[
  {
    "path": ".cirrus.yml",
    "content": "task:\n  name: macos_arm64\n  alias: macos_arm64\n  trigger_type: manual\n  timeout_in: 90m\n  macos_instance:\n    image: ghcr.io/cirruslabs/macos-runner:sonoma\n  brew_script:\n    - brew update\n    - brew install ghc@9.10 cabal-install\n  env:\n    PATH: /opt/homebrew/opt/ghc@9.10/bin:${PATH}\n  cabal_store_cache:\n    folder: ~/.cabal/store\n    fingerprint_key: macos_2023_03_12\n  deps_script:\n    - cabal update\n    - cabal build all -fembed_data_files -fhttp -fserver -flua --dependencies-only\n  upload_caches:\n    - cabal_store\n  install_script:\n    - sh macos/make_macos_release.sh\n  macos_arm64_artifacts:\n    path: ./macos-arm64/**\n\ntask:\n  name: linux_arm64\n  alias: linux_arm64\n  trigger_type: manual\n  timeout_in: 90m\n  arm_container:\n    image: quay.io/benz0li/ghc-musl:9.10\n    cpu: 4\n    memory: 12G\n  env:\n    CABALOPTS: -f-export-dynamic -fembed_data_files -fhttp -fserver -flua --enable-executable-static -j4\n    GHCOPTS: -j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread\n  cabal_store_cache:\n    folder: ~/.cabal/store\n    fingerprint_key: linux_arm64_2023_03_11\n  deps_script:\n    - cabal update\n    - cabal build --dependencies-only $CABALOPTS --ghc-options=\"$GHCOPTS\" pandoc-cli\n  upload_caches:\n    - cabal_store\n  package_script:\n    - bash linux/make_artifacts.sh\n    - cabal freeze && cat cabal.project.freeze\n  linux_arm64_artifacts:\n    path: ./linux-arm64/**\n\ntask:\n  name: linux_amd64\n  alias: linux_amd64\n  trigger_type: manual\n  timeout_in: 90m\n  container:\n    image: quay.io/benz0li/ghc-musl:9.10\n    cpu: 4\n    memory: 12G\n  env:\n    CABALOPTS: -f-export-dynamic -fembed_data_files -fhttp -fserver -flua --enable-executable-static -j4\n    GHCOPTS: -j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread\n  cabal_store_cache:\n    folder: ~/.cabal/store\n    fingerprint_key: linux_amd64_2023_03_12\n  deps_script:\n    - cabal update\n    - cabal build --dependencies-only $CABALOPTS --ghc-options=\"$GHCOPTS\" pandoc-cli\n  upload_caches:\n    - cabal_store\n  package_script:\n    - cabal freeze && cat cabal.project.freeze\n    - bash linux/make_artifacts.sh\n  linux_amd64_artifacts:\n    path: ./linux-amd64/**\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.{zip,docx}]\ncharset =\nend_of_line =\nindent_style =\nindent_size =\ninsert_final_newline =\ntrim_trailing_whitespace =\n\n[*.{markdown,md}]\ntrim_trailing_whitespace = false\n\n[test/*]\ninsert_final_newline = false\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".gitattributes",
    "content": "test/fb2/reader/* -text\npandoc-lua-engine/test/*.custom\t\t-text\npandoc-lua-engine/test/*.txt\t\t-text\n"
  },
  {
    "path": ".gitignore",
    "content": "/*.*\n/build-artifacts*\n/dist-newstyle\n/dist\n/ctags\n/LOG\n/TAGS\n/bench-*\n!.circleci/**\n!.cirrus.yml\n!.envrc\n!.editorconfig\n!.gitattributes\n!.github/**\n!.gitignore\n!.hlint.yaml\n!.mailmap\n!.stylish-haskell.yaml\n!AUTHORS.md\n!BUGS\n!CITATION.cff\n!CONTRIBUTING.md\n!COPYING.md\n!COPYRIGHT\n!INSTALL.md\n!MANUAL.txt\n!Makefile\n!README.md\n!README.template\n!RELEASE-CHECKLIST-TEMPLATE.org\n!SECURITY.md\n!Setup.hs\n!cabal.project\n!changelog.md\n!pandoc.cabal\n!hie.yaml\n!flake.nix\n!flake.lock\n!default.nix\n!release.nix\n!shell.nix\n!stack.yaml\n!weeder.toml\n!app/**\n!benchmark/**\n!citeproc/**\n!data/**\n!doc/**\n!linux/**\n!macos/**\n!man/**\n!pandoc-lua-engine/**\n!pandoc-server/**\n!pandoc-cli/**\n!src/**\n!test/**\n!tools/**\n!trypandoc/**\n!xml-light/**\n!windows/**\n*.bkp\n*.orig\n*.o\n*.hi\n*.dyn_o\n*.dyn_hi\n*~\n.*sw?\n.DS_Store\n.stack-work\n"
  },
  {
    "path": ".hlint.yaml",
    "content": "# HLint configuration file\n# https://github.com/ndmitchell/hlint\n##########################\n\n# Specify additional command line arguments\n#\n- arguments: [--color=auto, --cpp-ansi]\n\n# Ignore some builtin hints\n#\n- ignore: {name: \"Avoid lambda\"}\n- ignore: {name: \"Use bimap\"}\n- ignore: {name: \"Use void\"}\n- ignore: {name: \"Eta reduce\"}\n- ignore: {name: \"Evaluate\"}\n- ignore: {name: \"Reduce duplication\"} # TODO: could be more fine-grained\n- ignore: {name: \"Use &&&\"}\n- ignore: {name: \"Use String\"}\n- ignore: {name: \"Use camelCase\"}\n- ignore: {name: \"Use fmap\"}  # specific for GHC 7.8 compat\n- ignore: {name: \"Use isDigit\"}\n- ignore: {name: \"Use <&>\"}\n- ignore:\n    name: \"Monad law, left identity\"\n    within: Text.Pandoc.App.OutputSettings\n\n- ignore:\n    name: \"Move brackets to avoid $\"\n    within: Text.Pandoc.Writers.CslJson\n\n- ignore:\n    name: \"Redundant <$>\"\n    within:\n      - Text.Pandoc.Readers.Docx.Parse\n      - Text.Pandoc.Writers.MediaWiki\n      - Text.Pandoc.Writers.OpenDocument\n      - Text.Pandoc.Writers.Powerpoint.Output\n      - Text.Pandoc.Writers.Powerpoint.Presentation\n\n- ignore:\n    name: \"Redundant return\"\n    within: Text.Pandoc.Citeproc.BibTeX\n\n# With recent hlint this rule has given false positives on TH\n- ignore:\n    name: \"Redundant bracket\"\n\n\n- ignore:\n    name: \"Use <$>\"\n    within:\n      - Text.Pandoc.Readers.LaTeX\n      - Text.Pandoc.Readers.Markdown\n\n- ignore:\n    name: \"Use camelCase\"\n    within:\n      - Tests.Writers.Docbook\n      - Tests.Writers.Native\n      - Text.Pandoc.Citeproc\n      - Text.Pandoc.Extensions\n      - Text.Pandoc.Lua.Marshaling.Version\n      - Text.Pandoc.Lua.Module.Pandoc\n      - Text.Pandoc.Lua.Module.Utils\n      - Text.Pandoc.Readers.Odt.ContentReader\n      - Text.Pandoc.Readers.Odt.Namespaces\n\n- ignore:\n    name: \"Use forM_\"\n    within:\n      - Text.Pandoc.Readers.DocBook\n\n- ignore:\n    name: \"Use Just\"\n    within:\n      - Text.Pandoc.Citeproc.MetaValue\n      - Text.Pandoc.Readers.Odt.ContentReader\n      - Text.Pandoc.Writers.Roff\n\n- ignore:\n    name: \"Use list comprehension\"\n    within: Text.Pandoc.Citeproc.BibTeX\n\n- ignore:\n    name: \"Use list literal pattern\"\n    within: Text.Pandoc.Citeproc.MetaValue\n\n# TODO: check\n- ignore:\n    name: \"Use second\"\n    within:\n      - Text.Pandoc.Citeproc.BibTeX\n      - Text.Pandoc.Citeproc.Locator\n\n# TODO: check\n- ignore:\n    name: \"Use sortOn\"\n    within: Text.Pandoc.Writers.OpenDocument\n\n- ignore:\n    name: \"Use tuple-section\"\n    within:\n      - Text.Pandoc.Readers.EPUB\n      - Text.Pandoc.ImageSize\n      - Text.Pandoc.Readers.Markdown\n      - Text.Pandoc.Readers.RST\n\n# fromRight is only in base >= 4.10\n- ignore:\n    name: \"Use fromRight\"\n\n# Define some custom infix operators\n# - fixity: infixr 3 ~^#^~\n"
  },
  {
    "path": ".mailmap",
    "content": "Adam Brandizzi <brandizzi@gmail.com>\nAlbert Krewinkel <albert@zeitkraut.de> <albert+github@zeitkraut.de>\nAlbert Krewinkel <albert@zeitkraut.de> <albert.krewinkel@tourstream.eu>\nAlbert Krewinkel <albert@zeitkraut.de> <tarleb@moltkeplatz.de>\nAlbert Krewinkel <albert@zeitkraut.de> <tarleb@zeitkraut.de>\nAlexander Krotov <ilabdsf@gmail.com>\nAlex Ivkin <alex@ivkin.net>\nAlex Ivkin <alex@ivkin.net> <alexivkin@users.noreply.github.com>\nAndrew Dunning <andunning@gmail.com>\nAndrew Dunning <andunning@gmail.com> <adunning@users.noreply.github.com>\nAndrew Newman <andrewfnewman@gmail.com>\nClare Macrae <clare.macrae@googlemail.com> <github@cfmacrae.fastmail.co.uk>\nHugo Roy <hugo@fsfe.org>\nHugo Roy <hugo@xps.ampoliros.net>\nJohn MacFarlane <jgm@berkeley.edu> <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>\nJohn MacFarlane <jgm@berkeley.edu> <fiddlosopher@gmail.com>\nJohn MacFarlane <jgm@berkeley.edu> <jgm@Johns-MacBook-Pro.local>\nJose Luis Duran <jlduran@gmail.com> <jlduran@users.noreply.github.com>\nMarc Schreiber <schrieveslaach@online.de>\nMasayoshi Takahashi <maki@rubycolor.org>\nMatthew Pickering <matthewtpickering@gmail.com>\nMauro Bieg <mauro.bieg@gmail.com>\nMauro Bieg <mauro.bieg@gmail.com> <maurobieg@Mauros-MacBook-Air.local>\nMauro Bieg <mauro.bieg@gmail.com> <mb21@server.fake>\nMauro Bieg <mauro.bieg@gmail.com> <mb21@users.noreply.github.com>\nMauro Bieg <mb21@users.noreply.github.com>\nNils Carlson <nils.carlson@ludd.ltu.se>\nNils Carlson <nils.carlson@ludd.ltu.se> <pyssling@ludd.ltu.se>\nRobin Lambertz <robinlambertz+dev@gmail.com>\nRoland Hieber <rohieb@rohieb.name> <rohieb@users.noreply.github.com>\nSebastian Talmon <35015406+stalmon@users.noreply.github.com>\nSergei Trofimovich <slyfox@gentoo.org> <siarheit@google.com>\nSergei Trofimovich <slyfox@gentoo.org> <slyfox@inbox.ru>\nStefan Björk <stefan.bjork@gmail.com> <stefan@airistotle.local>\nThomas Hodgson <hello@twshodgson.net> <twsh@users.noreply.github.com>\nTimm Albers <timmm.albers@gmail.com> <timm.albers@open-xchange.com>\nYan Pashkovsky <yanpaso@gmail.com> <Yanpas@users.noreply.github.com>\n"
  },
  {
    "path": ".stylish-haskell.yaml",
    "content": "# stylish-haskell configuration file\n# ==================================\n\n# The stylish-haskell tool is mainly configured by specifying steps. These steps\n# are a list, so they have an order, and one specific step may appear more than\n# once (if needed). Each file is processed by these steps in the given order.\nsteps:\n  # Convert some ASCII sequences to their Unicode equivalents. This is disabled\n  # by default.\n  # - unicode_syntax:\n  #     # In order to make this work, we also need to insert the UnicodeSyntax\n  #     # language pragma. If this flag is set to true, we insert it when it's\n  #     # not already present. You may want to disable it if you configure\n  #     # language extensions using some other method than pragmas. Default:\n  #     # true.\n  #     add_language_pragma: true\n\n  # Align the right hand side of some elements.  This is quite conservative\n  # and only applies to statements where each element occupies a single\n  # line.\n  - simple_align:\n      cases: true\n      top_level_patterns: true\n      records: true\n\n  # Import cleanup\n  - imports:\n      # There are different ways we can align names and lists.\n      #\n      # - global: Align the import names and import list throughout the entire\n      #   file.\n      #\n      # - file: Like global, but don't add padding when there are no qualified\n      #   imports in the file.\n      #\n      # - group: Only align the imports per group (a group is formed by adjacent\n      #   import lines).\n      #\n      # - none: Do not perform any alignment.\n      #\n      # Default: global.\n      align: none\n\n      # Following options affect only import list alignment.\n      #\n      # List align has following options:\n      #\n      # - after_alias: Import list is aligned with end of import including\n      #   'as' and 'hiding' keywords.\n      #\n      #   > import qualified Data.List      as List (concat, foldl, foldr, head,\n      #   >                                          init, last, length)\n      #\n      # - with_alias: Import list is aligned with start of alias or hiding.\n      #\n      #   > import qualified Data.List      as List (concat, foldl, foldr, head,\n      #   >                                 init, last, length)\n      #\n      # - new_line: Import list starts always on new line.\n      #\n      #   > import qualified Data.List      as List\n      #   >     (concat, foldl, foldr, head, init, last, length)\n      #\n      # Default: after_alias\n      list_align: after_alias\n\n      # Long list align style takes effect when import is too long. This is\n      # determined by 'columns' setting.\n      #\n      # - inline: This option will put as much specs on same line as possible.\n      #\n      # - new_line: Import list will start on new line.\n      #\n      # - new_line_multiline: Import list will start on new line when it's\n      #   short enough to fit to single line. Otherwise it'll be multiline.\n      #\n      # - multiline: One line per import list entry.\n      #   Type with constructor list acts like single import.\n      #\n      #   > import qualified Data.Map as M\n      #   >     ( empty\n      #   >     , singleton\n      #   >     , ...\n      #   >     , delete\n      #   >     )\n      #\n      # Default: inline\n      long_list_align: inline\n\n      # List padding determines indentation of import list on lines after import.\n      # This option affects 'list_align' and 'long_list_align'.\n      list_padding: 4\n\n      # Separate lists option affects formatting of import list for type\n      # or class. The only difference is single space between type and list\n      # of constructors, selectors and class functions.\n      #\n      # - true: There is single space between Foldable type and list of it's\n      #   functions.\n      #\n      #   > import Data.Foldable (Foldable (fold, foldl, foldMap))\n      #\n      # - false: There is no space between Foldable type and list of it's\n      #   functions.\n      #\n      #   > import Data.Foldable (Foldable(fold, foldl, foldMap))\n      #\n      # Default: true\n      separate_lists: true\n\n  # Language pragmas\n  - language_pragmas:\n      # We can generate different styles of language pragma lists.\n      #\n      # - vertical: Vertical-spaced language pragmas, one per line.\n      #\n      # - compact: A more compact style.\n      #\n      # - compact_line: Similar to compact, but wrap each line with\n      #   `{-#LANGUAGE #-}'.\n      #\n      # Default: vertical.\n      style: vertical\n\n      # Align affects alignment of closing pragma brackets.\n      #\n      # - true: Brackets are aligned in same column.\n      #\n      # - false: Brackets are not aligned together. There is only one space\n      #   between actual import and closing bracket.\n      #\n      # Default: true\n      align: true\n\n      # stylish-haskell can detect redundancy of some language pragmas. If this\n      # is set to true, it will remove those redundant pragmas. Default: true.\n      remove_redundant: true\n\n  # Replace tabs by spaces. This is disabled by default.\n  # - tabs:\n  #     # Number of spaces to use for each tab. Default: 8, as specified by the\n  #     # Haskell report.\n  #     spaces: 8\n\n  # Remove trailing whitespace\n  - trailing_whitespace: {}\n\n# A common setting is the number of columns (parts of) code will be wrapped\n# to. Different steps take this into account. Default: 80.\ncolumns: 80\n\n# By default, line endings are converted according to the OS. You can override\n# preferred format here.\n#\n# - native: Native newline format. CRLF on Windows, LF on other OSes.\n#\n# - lf: Convert to LF (\"\\n\").\n#\n# - crlf: Convert to CRLF (\"\\r\\n\").\n#\n# Default: native.\nnewline: native\n\n# Sometimes, language extensions are specified in a cabal file or from the\n# command line instead of using language pragmas in the file. stylish-haskell\n# needs to be aware of these, so it can parse the file correctly.\n#\n# No language extensions are enabled by default.\n# language_extensions:\n  # - TemplateHaskell\n  # - QuasiQuotes\n"
  },
  {
    "path": "AUTHORS.md",
    "content": "# Contributors\n\n- Aaron Wolen\n- Adelar da Silva Queiróz\n- Agriya Khetarpal\n- Agustín Martín Barbero\n- Akash Patel\n- Akos Marton\n- Albert Krewinkel\n- Albert Lei\n- Alex Ivkin\n- Alex Toldaiev\n- Alex Vong\n- Alexander Batischev\n- Alexander Kondratskiy\n- Alexander Krotov\n- Alexander Sulfrian\n- Alexander V Vershilov\n- Alexandre Franke\n- Alfred Wechselberger\n- Amar Al-Zubaidi\n- Amir Dekel\n- Amneesh Singh\n- Amogh Rathore\n- Amy de Buitléir\n- Anabra\n- Anders Waldenborg\n- Andreas Deininger\n- Andreas Lööw\n- Andreas Scherer\n- Andres Freund\n- Andrew Dunning\n- Andy Morris\n- Aner Lucero\n- Anti-Distinctlyminty\n- Antoine Latter\n- Anton Antich\n- Anton Melnikov\n- Antonio Terceiro\n- Arata Mizuki\n- Arata Mizuki\n- Arfon Smith\n- Arlo O'Keeffe\n- Artem Pelenitsyn\n- Artyom Kazak\n- Asliddinbek Azizovich\n- B. Scott Michel\n- Bastien Dumont\n- Ben Firshman\n- Ben Gamari\n- Ben Steinberg\n- Beni Cherniavsky-Paskin\n- Benjamin Bray\n- Benjamin Esham\n- Benjamin Wuethrich\n- Benoit Schweblin\n- Benson Muite\n- Bjorn Buckwalter\n- Blake Eryx\n- Bodigrim\n- Bradley Kuhn\n- Brent Yorgey\n- Brian Leung\n- Bryan O'Sullivan\n- Caleb McDaniel\n- Caleb Mclennan\n- Calvin Beck\n- Carlos Scheidegger\n- Carlos Sosa\n- Carsten Allefeld\n- Castedo Ellerman\n- Cécile Chemin\n- Cédric Couralet\n- Cezary Drożak\n- Chandrahas77\n- Charanjit Singh\n- Charles Tapley Hoyt\n- Charlotte Koch\n- Chris Black\n- Chris Callison-Burch\n- Christian Conkle\n- Christian Christiansen\n- Christian Despres\n- Christoffer Ackelman\n- Christoffer Sawicki\n- Christophe Dervieux\n- Christopher Kenny\n- Clare Macrae\n- Clint Adams\n- Conal Elliott\n- Cormac Relf\n- Craig S. Bosma\n- Damien Clochard\n- Daniel Bergey\n- Daniel Kessler\n- Daniel Maslowski\n- Daniel T. Staal\n- Daniele D'Orazio\n- David A Roberts\n- David Lazar\n- David Martschenko\n- David Röthlisberger\n- Denis Laxalde\n- Denis Maier\n- Derek Chen-Becker\n- Diego Balseiro\n- Diogo Almiro\n- Dimitri Sabadie\n- Dimitris Apostolou\n- Dmitry Pogodin\n- Dmitry Volodin\n- Douglas Calvert\n- Edwin Török\n- Eigil Rischel\n- Elliot Bobrow\n- Emanuel Evans\n- Emmanuel Ferdman\n- Emerson Harkin\n- Emily Bourke\n- Emily Eisenberg\n- Eric Kow\n- Eric Schrijver\n- Eric Seidel\n- Erik Post\n- Erik Rask\n- Ethan Riley\n- Étienne Bersac\n- Evan Silberman\n- Even Brenden\n- Ezwal\n- Fabián Heredia Montiel\n- Félix Baylac-Jacqué\n- Felix Yan\n- Florian Beeres\n- Florian Eitel\n- Florian Klink\n- Florian Kohrt\n- FoxChillz\n- Francesco Mazzoli\n- Francesco Occhipinti\n- François Gannaz\n- Frank Seifferth\n- Frederik Elwert\n- Freiric Barral\n- Freirich Raabe\n- Frerich Raabe\n- Fyodor Sheremetyev\n- Gabor Pali\n- Gabriel Lewertowski\n- Gavin Beatty\n- George Stagg\n- Georgi Lyubenov\n- GHyman83\n- Gokul Rajiv\n- Gordon Woodhull\n- Gottfried Haider\n- Greg Maslov\n- Greg Rundlett\n- Grégory Bataille\n- Guriy Samarin\n- Gwern Branwen\n- Hamish Mackenzie\n- Hans-Peter Deifel\n- Hendrik Erz\n- Heiko Schlittermann\n- Henrik Tramberend\n- Henry de Valence\n- Herwig Stuetz\n- Hikaru Ibayashi\n- Hos Es\n- Hubert Plociniczak\n- Iacobus1983\n- Ian Max Andolina\n- Igor Khorlo\n- Igor Pashev\n- Ilona Silverwood\n- Ilya V. Portnov\n- Ivan Panchenko\n- Ivan Trubach\n- Ivar de Bruin\n- Ivo Clarysse\n- Jaap de Jong\n- Jacob Larkin\n- James J Balamuta\n- J. B. Rainsberger\n- J. Lewis Muir\n- Jackson Schuster\n- Jaehwang Jung\n- Jaime Marquínez Ferrándiz\n- Jake Zimmerman\n- Jakob Voß\n- James Aspnes\n- James P. Ascher\n- James Barlow\n- James Scott-Brown\n- Jamie F. Olson\n- Jan Larres\n- Jan Schulz\n- Jan Tojnar\n- Jannik Buhr\n- Jan-Otto Kröpke\n- Jared Lander\n- Jason Ronallo\n- Jeff Arnold\n- Jeff Runningen\n- Jens Getreu\n- Jens Petersen\n- Jens Oehlschlägel\n- Jesse Hathaway\n- Jeremie Knuesel\n- Jérémy Bobbio\n- Jeroen de Haas\n- Jerry Sky\n- Jesse Rosenthal\n- Jez Cope\n- Joe Hermaszewski\n- Joe Hillenbrand\n- John KetzerX\n- John Luke Bentley\n- John MacFarlane\n- John Muccigrosso\n- John Purnell\n- Jonas Scholl\n- Jonas Smedegaard\n- Jonathan\n- Jonathan Daugherty\n- Jonathan Dönszelmann\n- Jose Luis Duran\n- José de Mattos Neto\n- Josef Svenningsson\n- Joseph C. Sible\n- Julia Diaz\n- Julien Cretel\n- Julien Dutant\n- Juliette Fourcot\n- Juliusz Gonera\n- Justin Bogner\n- Justin Wood\n- Karl Pettersson\n- Keiichiro Shikano\n- Kelsey Hightower\n- Kevin Broch\n- Kolen Cheung\n- Konstantin Zudov\n- Kristof Bastiaensen\n- Krystof Beuermann\n- Lars-Dominik Braun\n- Laurent P. René de Cotret\n- Lawrence Chonavel\n- Leif Metcalf\n- Leo Heitmann Ruiz\n- Leonard Rosenthol\n- Lila\n- Link Swanson\n- Loïc Grobol\n- Lorenzo\n- Lucas Escot\n- Lucas Viana\n- Lucas V. R\n- Luis Rivera\n- Luke Plant\n- Manolis Stamatogiannakis\n- Marc Schreiber\n- Marcin Serwin\n- Mario Lang\n- Mark Gardner\n- Mark Szepieniec\n- Mark Wright\n- Martin Joerg\n- Martin Linn\n- Martin Michlmayr\n- Martín Pozo\n- Masataka Ogawa\n- Masayoshi Takahashi\n- Matej Kollar\n- Mathias Schenner\n- Mathias Walter\n- Mathieu Boespflug\n- Mathieu Duponchelle\n- Matt Dodson\n- Matthew Doty\n- Matthew Eddey\n- Matthew Pickering\n- Matthias C. M. Troffaes\n- Mauro Bieg\n- Max Bolingbroke\n- Max Heller\n- Max Rydahl Andersen\n- Merijn Verstraaten\n- Michael Beaumont\n- Michael Chladek\n- Michael Hoffmann\n- Michael McClurg\n- Michael Peyton Jones\n- Michael Reed\n- Michael Snoyman\n- Michael Stahl\n- Michael Thompson\n- Mickaël Canouil\n- Mike Tzou\n- Mikołaj Machowski\n- Milan Bracke\n- MinRK\n- Mohamed Akram\n- Morgan Willcock\n- Morton Fox\n- Nathan Gass\n- Naveen\n- Neil Mayhew\n- Nick Bart\n- Nick Berendsen\n- Nick Fleisher\n- Nicolas Kaiser\n- Niklas Eicker\n- Nikolai Korobeinikov\n- Nikolay Yakimov\n- Nils Carlson\n- Nixon Enraght-Moony\n- Noah Malmed\n- Nokome Bentley\n- Norwid Behrnd\n- OCzarnecki\n- Ola Wolska\n- Ole Martin Ruud\n- Oliver Fabel\n- Oliver Matthews\n- Olivier Benz\n- Olivier Dossmann\n- Ophir Lifshitz\n- Or Neeman\n- OvidiusCicero\n- Owen McGrath\n- Pablo Rodríguez\n- Pascal Wagler\n- Pau RE\n- Paul Rivier\n- Paul Tilley\n- Paulo Tanimoto\n- Pavol Otto\n- Per Christian Gaustad\n- Pete Ryland\n- Peter Briggs\n- Peter Fabinksi\n- Peter Wang\n- Philip Pesca\n- Philippe Ombredanne\n- Phillip Alday\n- Pranesh Prakash\n- Prat\n- Prayag Verma\n- Puneeth Chaganti\n- Quinn\n- R. N. West\n- Ralf Stephan\n- Raniere Silva\n- Raymond Berger\n- Raymond Ehlers\n- Recai Oktaş\n- Repetitive\n- Reuben Thomas\n- Rowan Rodrik van der Molen\n- Roland Hieber\n- Roman Beránek\n- Ruqi\n- RyanGlScott\n- Ryan Gibb\n- S.P.H\n- Salim B\n- Sam S. Almahri\n- Sam May\n- Samuel Tardieu\n- Saumel Lemmenmeier\n- Santiago Zarate\n- Sascha Wilde\n- Scott Morrison\n- Sean Soon\n- Sebastian Talmon\n- Sebbones\n- Sen-wen Deng\n- Sergei Trofimovich\n- Sergey Astanin\n- Seth Speaks\n- Shahbaz Youssefi\n- Shaun Attfield\n- Shim Myeongseob\n- Shin Sang-jae\n- Sidarth Kapur\n- Sidney Mau\n- Sidharth Kapur\n- Simon Hengel\n- Simon Schuster\n- Siphalor\n- Stefan Dresselhaus\n- Stephan Daus\n- Stephan Meijer\n- Stephen Altamirano\n- Stephen Huan\n- Stephen Reindl\n- Stéphane Guillou\n- Sukil Etxenike\n- Sukka\n- Sumit Sahrawat\n- Suraj Patil\n- Sven Wick\n- TEC\n- Tarik Graba\n- Tatiana Porras\n- Terence Eden\n- Thenaesh Elango\n- Thomas Hodgson\n- Thomas Soeiro\n- Thomas Weißschuh\n- Tiago-Manzato\n- Tim Lin\n- Tim Stewart\n- Tim Wisotzki\n- Timm Albers\n- Timothy Humphries\n- Tiziano Müller\n- Todd Sifleet\n- Tomas Dahlqvist\n- TomBen\n- Tom Leese\n- Toni Dietze\n- Tristan Stenner\n- Tristan de Cacqueray\n- Tristano Ajmone\n- Tuong Nguyen Manh\n- Uli Köhler\n- Urs Liska\n- Václav Haisman\n- Václav Zeman\n- Vaibhav Sagar\n- Vanessa McHale\n- Vasily Alferov\n- Veratyr\n- Viktor Kronvall\n- Vincent\n- Vlad Hanciuta\n- Vladimir Alexiev\n- Waldir Pimenta\n- Wandmalfarbe\n- Wentao Han\n- Wikiwide\n- William Lupton\n- William Rusnack\n- Winnie Hellmann\n- Wout Gevaert\n- Xavier Olive\n- Yan Pashkovsky\n- Yann Trividic\n- Yehuda Katz\n- YI\n- Yoan Blanc\n- You Jiangbin\n- Yuchen Pei\n- Zihang Chen\n- 3w36zj6\n- arcnmx\n- a-vrma\n- andrebauer\n- benniekiss\n- black-desk\n- blmage\n- bucklereed\n- bumper314\n- chinapedia\n- cholonam\n- closeobserve\n- csforste\n- d-dorazio\n- damon-sava-stanley\n- dbecher-ito\n- ebiim\n- ech0\n- etclub\n- favonia\n- guqicun\n- har7an\n- harabat\n- hseg\n- infinity0x\n- jeongminkim-islab\n- josch\n- kaizshang91\n- lawcho\n- lifeunleaded\n- lux-lth\n- luz paz\n- lwolfsonkin\n- massifrg\n- mbracke\n- mbrackeantidot\n- mh4ckt3mh4ckt1c4s\n- mjfs\n- mt_caret\n- nbehrnd\n- niszet\n- nkalvi\n- nuew\n- obcat\n- oltolm\n- oquechy\n- pacien\n- perro tuerto\n- piq9117\n- priiduonu\n- qerub\n- quasicomputational\n- reptee\n- ricnorr\n- robabla\n- roblabla\n- rodja.trappe\n- rski\n- samuel-weinhardt\n- sdhoward\n- shreevatsa.public\n- takahashim\n- taotieren\n- tecosaur\n- tgkokk\n- the-solipsist\n- thomjur\n- thsutton\n- thron7\n- timo-a\n- vijayphoenix\n- vkraven\n- wgevaert\n- wiefling\n- willj-dev\n- wuffi\n- λx.x\n"
  },
  {
    "path": "BUGS",
    "content": "To view a list of known bugs, or to enter a bug report, please use\nPandoc's issue tracker: <https://github.com/jgm/pandoc/issues>.\n\nSee also CONTRIBUTING.md.\n"
  },
  {
    "path": "CITATION.cff",
    "content": "cff-version: 1.2.0\ntitle: Pandoc\nmessage: \"If you use this software, please cite it as below.\"\ntype: software\nurl: \"https://github.com/jgm/pandoc\"\nauthors:\n  - given-names: John\n    family-names: MacFarlane\n    email: jgm@berkeley.edu\n    orcid: 'https://orcid.org/0000-0003-2557-9090'\n  - given-names: Albert\n    family-names: Krewinkel\n    email: tarleb+github@moltkeplatz.de\n    orcid: '0000-0002-9455-0796'\n  - given-names: Jesse\n    family-names: Rosenthal\n    email: jrosenthal@jhu.edu\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Contributing to pandoc\n======================\n\nWelcome to pandoc! Very soon after its beginnings in 2006, pandoc\nhas been influenced, improved, and modified, by users, devs, and\nnewcomers alike. The project thrives on its active community. It is\ngreat to have you here.\n\nHow can I help?\n---------------\n\nThere are many ways in which you can support pandoc. Here are a few\nideas:\n\n  * Participate in online discussions. The [discussion\n    forum] is a good place for this.\n\n  * Help with questions. Every request that is answered by the wider\n    community frees time for programming contributors. This will\n    speed up development of new features and issue fixes. Don't\n    underestimate your knowledge, please share it!\n\n    Good places to help are the [discussion forum], Q/A\n    sites like StackOverflow, community forums (e.g.\n    [RStudio][RStudio Community], [Zettlr][Zettlr Forum]), and, for\n    technical questions, the GitHub [issue tracker].\n\n  * Write or improve documentation. If you ran into a problem which\n    took more time to figure out than expected, please consider to\n    save other users from the same experience. People writing the\n    documentation tend to lack an outside view, so please help\n    provide one. Good documentation is both difficult and extremely\n    important.\n\n    The official docs are not the only place for documentation.\n    Pandoc also has a [Wiki][pandoc wiki]. Private blogs can serve\n    as documentation just as the official manual can.\n\n  * Contribute code. No matter whether it's a small fix in a format\n    template or a huge lump of Haskell code: help is welcome. It's\n    usually a good idea to talk about the plans early, as this can\n    prevent unnecessary work. See below for more information.\n\n  * Last but not least: consider funding the development and\n    maintenance of pandoc financially. You can find sponsor buttons\n    on the [pandoc website] and the [GitHub repository][GitHub\n    repo].\n\nA rich ecosystem of libraries, editors, filters, and templates has\ndeveloped around pandoc; conversely, pandoc builds and depends on a\nlarge number of libraries. Contributing to any of these projects is\nanother way that can help to ensure stability, and to keep pushing\nthe boundaries of what is possible with pandoc.\n\n[RStudio Community]: https://community.rstudio.com/\n[Zettlr Forum]: https://forum.zettlr.com/\n[pandoc wiki]: https://github.com/jgm/pandoc/wiki\n[pandoc website]: https://pandoc.org\n[GitHub repo]: https://github.com/jgm/pandoc\n\nHave a question?\n----------------\n\nAsk on the [discussion forum].\n\n\nFound a bug?\n------------\n\nBug reports are welcome!  Please report all bugs on pandoc's GitHub\n[issue tracker].\n\nBefore you submit a bug report, search the [open issues] *and* [closed issues]\nto make sure the issue hasn't come up before. Also, check the [User's Guide] and\n[FAQs] for anything relevant.\n\nMake sure you can reproduce the bug with the [latest released\nversion] of pandoc---or, even better, the development version,\nsince the bug may have been fixed since the last release.\n[Nightly builds] are available, so you don't need to compile\nfrom source to test against the development version.\n(To fetch a nightly, visit the link, click the topmost \"Nightly\"\nin the table, then choose your platform under \"Artifacts.\"  Note\nthat you must be logged in with a GitHub account.)\n\nYour report should give detailed, *reproducible* instructions, including\n\n  * the pandoc version (check using `pandoc -v`)\n  * the exact command line used\n  * the exact input used\n  * the output received\n  * the output you expected instead\n\nA small test case (just a few lines) is ideal.  If your input is large,\ntry to whittle it down to a *minimum working example*.\n\nOut of scope?\n-------------\n\nA less than perfect conversion does not necessarily mean there's\na bug in pandoc.  Quoting from the MANUAL:\n\n> Because pandoc's intermediate representation of a document is less\n> expressive than many of the formats it converts between, one should\n> not expect perfect conversions between every format and every other.\n> Pandoc attempts to preserve the structural elements of a document, but\n> not formatting details such as margin size.  And some document elements,\n> such as complex tables, may not fit into pandoc's simple document\n> model.  While conversions from pandoc's Markdown to all formats aspire\n> to be perfect, conversions from formats more expressive than pandoc's\n> Markdown can be expected to be lossy.\n\nFor example, both `docx` and `odt` formats can represent margin size, but\nbecause pandoc's internal document model does not contain a representation of\nmargin size, this information will be lost on converting from docx\nto `odt`.  (You can, however, customize margin size using `--reference-doc`.)\n\nSo before submitting a bug report, consider whether it might be\n\"out of scope.\" If it concerns a feature of documents that isn't\nrepresentable in pandoc's Markdown, then it very likely is.\n(If in doubt, you can always ask on the [discussion forum].)\n\nFixing bugs from the issue tracker\n----------------------------------\n\nAlmost all the bugs on the issue tracker have one or more associated\ntags. These are used to indicate the *complexity* and *nature* of a\nbug. There is not yet a way to indicate priority. An up to date\nsummary of issues can be found on [GitHub labels].\n\n* [good first issue] — The perfect starting point for new contributors. The\n  issue is generic and can be resolved without deep knowledge of the code\n  base.\n* [enhancement] — A feature which would be desirable. We recommend\n  you discuss any proposed enhancement on the [discussion forum]\n  before writing code.\n* [bug] — A problem which needs to be fixed.\n* [complexity:low] — The fix should only be a couple of lines.\n* [complexity:high] — The fix might require structural changes or in depth\n  knowledge of the code base.\n* [new:reader] — A request to add a new input format.\n* [new:writer] — A request to add a new output format.\n* [docs] — A discrepancy,  or ambiguity in the documentation.\n* [status:in-progress] — Someone is actively working on or planning to work on the\n  ticket.\n* [status:more-discussion-needed] — It is unclear what the correct approach\n  to solving the ticket is. Before starting on tickets such as this it\n  would be advisable to post on the ticket.\n* [status:more-info-needed] — We require more information from a user before\n  we can classify a report properly.\n\nIssues related to a specific format are tagged accordingly, e.g. feature request\nor bug reports related to Markdown are labelled with [format:markdown].\n\nHave an idea for a new feature?\n-------------------------------\n\nFirst, search the [discussion forum]\nand the issue tracker (both [open issues] *and*\n[closed issues]) to make sure that the idea has not been discussed before.\n\nExplain the rationale for the feature you're requesting.  Why would this\nfeature be useful?  Consider also any possible drawbacks, including backwards\ncompatibility, new library dependencies, and performance issues.\n\nFeatures are very rarely \"implement and forget\", as all code must be\nmaintained. This is especially relevant for large or complex\ncontributions. It is helpful to be sympathetic to that fact, and to\ncommunicate future plans and availability clearly.\n\nAny potential new feature is best discussed on the [discussion\nforum] before opening an issue.\n\nPatches and pull requests\n-------------------------\n\nPatches and pull requests are welcome.  Before you put time into a nontrivial\npatch, it is a good idea to discuss it on the\n[discussion forum], especially if it is for a new feature (rather\nthan fixing a bug).\n\nPlease follow these guidelines:\n\n1.  Each patch (commit) should make a single logical change (fix a bug, add\n    a feature, clean up some code, add documentation).  Everything\n    related to that change should be included (including tests and\n    documentation), and nothing unrelated should be included.\n\n2.  The first line of the commit message should be a short description\n    of the whole commit (ideally <= 50 characters).  Then there should\n    be a blank line, followed by a more detailed description of the\n    change.\n\n3.  Follow the stylistic conventions you find in the existing\n    pandoc code.  Use spaces, not tabs, and wrap code to 80 columns.\n    Always include type signatures for top-level functions.\n    Consider installing [EditorConfig], this will help you to follow the\n    coding style prevalent in pandoc.\n\n4.  Your code should compile without warnings (`-Wall` clean).\n\n5.  Run the tests to make sure your code does not introduce new bugs.\n    (See below under [Tests](#tests).)  All tests should pass.\n\n6.  It is a good idea to add test cases for the bug you are fixing.  (See\n    below under [Tests](#tests).)  If you are adding a new writer or reader,\n    you must include tests.\n\n7.  If you are adding a new feature, include updates to `MANUAL.txt`.\n\n8.  All code must be released under the general license governing pandoc\n    (GPL v2).\n\n9.  It is better not to introduce new dependencies.  Dependencies on\n    external C libraries should especially be avoided.\n\n10. We aim for compatibility with at least the last three\n    released ghc versions, and sometimes more.  Currently we\n    support ghc versions 9.6 and higher. All pull requests\n    and commits are tested automatically on GitHub Actions.\n\nTests\n-----\n\nTests can be run as follows:\n\n    cabal install --only-dependencies --enable-tests\n    cabal configure --enable-tests\n    cabal build\n    cabal test\n\nor, if you're using [stack],\n\n    stack setup\n    stack test\n\nThe test program is `test/test-pandoc.hs`.\n\nTo run particular tests (pattern-matching on their names), use\nthe `-p` option:\n\n    cabal install pandoc --enable-tests\n    cabal test --test-options='-p markdown'\n\nOr with stack:\n\n    stack test --test-arguments='-p markdown'\n\nIt is often helpful to add `-j4` (run tests in parallel) and\n`--hide-successes` (don't clutter output with successes) to the test\narguments as well. Collecting all options in a `cabal.project.local`\nfile in the project's root directory can help to keep `cabal`\ncommands short. E.g.:\n\n    flags: +embed_data_files\n    tests: True\n    test-show-details: direct\n    test-options: -j4 --hide-successes\n\nIf you add a new feature to pandoc, please add tests as well, following\nthe pattern of the existing tests. The test suite code is in\n`test/test-pandoc.hs`. If you are adding a new reader or writer, it is\nprobably easiest to add some data files to the `test` directory, and\nmodify `test/Tests/Old.hs`. Otherwise, it is better to modify the module\nunder the `test/Tests` hierarchy corresponding to the pandoc module you\nare changing.  Alternatively, you may add a \"command test\" to\nthe `/test/command/` hierarchy, following the pattern of the tests there.\nThese test files should have a meaningful name, which can include the issue\nnumber and/or the feature that's being tested. For example, `5474-tables.md`\nrefers to both issue and feature.\n\nYou can rebuild the golden tests in `tests/` by passing\n`--accept` to the test script. (If you're using stack, `stack\ntest --test-arguments \"--accept\"`; or `make TESTARGS=--accept`).\nThen check the changed golden files for accuracy, and\ncommit the changes.  For docx or pptx tests, open the files in Word\nor Powerpoint to ensure that they weren't corrupted and that\nthey had the expected result, and mention the Word/Powerpoint\nversion and OS in your commit comment.\n\nCode style\n----------\n\nPandoc uses [hlint] to identify opportunities for code improvements\nlike redundant brackets or unnecessary `Language` extensions.\nHowever, sometimes there are cases where there are good reasons to\nuse code different from what hlint proposes. In these cases, the\nrespective warning should be disabled in the file `.hlint.yaml`.\n\nThere should be no errors when running `hlint .`; this is checked by\nthe continuous integration (CI) setup. It is recommended that\ncontributors check their code with a local hlint installation, but\nrelying on the CI is fine, too.\n\nA good way to ensure no new warnings are introduced is to use a Git\n[pre-commit hook] which runs hlint on all updated Haskell files\nbefore creating a commit:\n\n    #!/bin/sh\n    git diff --diff-filter=MA --cached --name-only | grep '\\.hs$' | \\\n      xargs hlint --hint .hlint.yaml\n\n(If you are using GNU `xargs`, add the `-r` option immediately\nafter `xargs`.)\n\nSaving this to `.git/hooks/pre-commit`, and making the script\nexecutable, will prevent accidental introduction of potentially\nproblematic code.\n\nBenchmarks\n----------\n\nTo run benchmarks with cabal:\n\n    cabal configure --enable-benchmarks\n    cabal build\n    cabal bench\n\nWith stack:\n\n    stack bench\n\n\nUsing the REPL\n--------------\n\nWith a recent version of cabal, you can do `cabal repl` and get\na ghci REPL for working with pandoc.  With [stack], use\n`stack ghci`.\n\nWe recommend using the following `.ghci` file (which can be\nplaced in the source directory):\n\n    :set -fobject-code\n    :set -XTypeSynonymInstances\n    :set -XScopedTypeVariables\n    :set -XOverloadedStrings\n\nProfiling\n---------\n\nTo diagnose a performance issue with parsing, first try using\nthe `--trace` option.  This will give you a record of when block\nparsers succeed, so you can spot backtracking issues.\n\nTo use the GHC profiler with cabal:\n\n    cabal clean\n    cabal install --enable-library-profiling --enable-executable-profiling\n    pandoc +RTS -p -RTS [file]...\n    less pandoc.prof\n\nWith stack:\n\n    stack clean\n    stack install --profile\n    pandoc +RTS -p -RTS [file]...\n    less pandoc.prof\n\nThe code\n--------\n\nPandoc has a publicly accessible git repository on\nGitHub: <https://github.com/jgm/pandoc>.  To get a local copy of the source:\n\n    git clone https://github.com/jgm/pandoc.git\n\nThe source for the main pandoc program is `pandoc.hs`.  The source for\nthe pandoc library is in `src/`, the source for the tests is in\n`test/`, and the source for the benchmarks is in `benchmark/`.\n\nThe modules `Text.Pandoc.Definition`, `Text.Pandoc.Builder`, and\n`Text.Pandoc.Generic` are in a separate library `pandoc-types`.  The code can\nbe found in <https://github.com/jgm/pandoc-types>.\n\nTo build pandoc, you will need a working installation of the\n[Haskell platform].\n\nThe library is structured as follows:\n\n  - `Text.Pandoc` is a top-level module that exports what is needed\n    by most users of the library.  Any patches that add new readers\n    or writers will need to make changes here, too.\n  - `Text.Pandoc.Definition` (in `pandoc-types`) defines the types\n    used for representing a pandoc document.\n  - `Text.Pandoc.Builder` (in `pandoc-types`) provides functions for\n    building pandoc documents programmatically.\n  - `Text.Pandoc.Generics` (in `pandoc-types`) provides functions allowing\n    you to promote functions that operate on parts of pandoc documents\n    to functions that operate on whole pandoc documents, walking the\n    tree automatically.\n  - `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*`\n    are the writers.\n  - `Text.Pandoc.Citeproc.*` contain the code for citation handling,\n    including an interface to the [citeproc] library.\n  - `Text.Pandoc.Data` is used to embed data files when the `embed_data_files`\n    cabal flag is used.\n  - `Text.Pandoc.Emoji` is a thin wrapper around [emojis].\n  - `Text.Pandoc.Highlighting` contains the interface to the\n    skylighting library, which is used for code syntax highlighting.\n  - `Text.Pandoc.ImageSize` is a utility module containing functions for\n    calculating image sizes from the contents of image files.\n  - `Text.Pandoc.MIME` contains functions for associating MIME types\n    with extensions.\n  - `Text.Pandoc.Options` defines reader and writer options.\n  - `Text.Pandoc.PDF` contains functions for producing a PDF from a\n    LaTeX source.\n  - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers.\n    the needs of pandoc.\n  - `Text.Pandoc.SelfContained` contains functions for making an HTML\n    file \"self-contained,\" by importing remotely linked images, CSS,\n    and JavaScript and turning them into `data:` URLs.\n  - `Text.Pandoc.Shared` is a grab-bag of shared utility functions.\n  - `Text.Pandoc.Writers.Shared` contains utilities used in writers only.\n  - `Text.Pandoc.Slides` contains functions for splitting a markdown document\n    into slides, using the conventions described in the MANUAL.\n  - `Text.Pandoc.Templates` defines pandoc's templating system.\n  - `Text.Pandoc.UTF8` contains functions for converting text to and from\n    UTF8 bytestrings (strict and lazy).\n  - `Text.Pandoc.Asciify` contains functions to derive ascii versions of\n    identifiers that use accented characters.\n  - `Text.Pandoc.UUID` contains functions for generating UUIDs.\n  - `Text.Pandoc.XML` contains functions for formatting XML.\n\nAdding a new command-line option\n--------------------------------\n\nTo add a new command-line option, you'll need to make changes in several\nplaces:\n\n- `MANUAL.txt` -- documentation for new option, both in the list\n  of options and in the section on defaults files.\n- `Text.Pandoc.App.Opt` -- new constructor for Opt and default\n  value\n- `Text.Pandoc.App.CommandLineOptions` -- the option parser\n- `Text.Pandoc.App` or `Text.Pandoc.App.OutputSettings` --\n  handle the new option\n- possibly in pandoc-server: `Text.Pandoc.Server` -- handle the\n  new option\n\nIf your change requires a new field for ReaderOptions or\nWriterOptions, you'll also need to\n\n- `Text.Pandoc.Options` -- type change and default value\n- in pandoc-lua-engine: Text.Pandoc.Lua.Marshal.WriterOptions\n  and/or Text.Pandoc.Lua.Marshal.ReaderOptions\n\nLua filters\n-----------\n\nIf you've written a useful pandoc [lua filter](./doc/lua-filters.md),\nyou may want to consider submitting a pull request to the\n[lua-filters repository](https://github.com/pandoc/lua-filters).\n\n[open issues]: https://github.com/jgm/pandoc/issues\n[closed issues]: https://github.com/jgm/pandoc/issues?q=is%3Aissue+is%3Aclosed\n[latest released version]: https://github.com/jgm/pandoc/releases/latest\n[Nightly builds]: https://github.com/jgm/pandoc/actions?query=workflow%3ANightly\n[pandoc-discuss]: https://groups.google.com/group/pandoc-discuss\n[issue tracker]: https://github.com/jgm/pandoc/issues\n[User's Guide]: https://pandoc.org/MANUAL.html\n[FAQs]:  https://pandoc.org/faqs.html\n[EditorConfig]: https://editorconfig.org/\n[Haskell platform]: https://www.haskell.org/platform/\n[hlint]: https://hackage.haskell.org/package/hlint\n[citeproc]: https://hackage.haskell.org/package/citeproc\n[emojis]: https://hackage.haskell.org/package/emojis\n[hsb2hs]: https://hackage.haskell.org/package/hsb2hs\n[pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks\n[GitHub labels]: https://github.com/jgm/pandoc/labels\n[good first issue]:https://github.com/jgm/pandoc/labels/good%20first%20issue\n[enhancement]: https://github.com/jgm/pandoc/labels/enhancement\n[bug]: https://github.com/jgm/pandoc/labels/bug\n[complexity:low]: https://github.com/jgm/pandoc/labels/complexity:low\n[complexity:high]: https://github.com/jgm/pandoc/labels/complexity:high\n[docs]: https://github.com/jgm/pandoc/labels/docs\n[format:markdown]: https://github.com/jgm/pandoc/labels/format:markdown\n[new:reader]: https://github.com/jgm/pandoc/labels/new:reader\n[new:writer]: https://github.com/jgm/pandoc/labels/new:writer\n[status:in-progress]: https://github.com/jgm/pandoc/labels/status:in-progress\n[status:more-discussion-needed]: https://github.com/jgm/pandoc/labels/status:more-discussion-needed\n[status:more-info-needed]: https://github.com/jgm/pandoc/labels/status:more-info-needed\n[stack]: https://github.com/commercialhaskell/stack\n[discussion forum]: https://github.com/jgm/pandoc/discussions\n\n"
  },
  {
    "path": "COPYING.md",
    "content": "### GNU GENERAL PUBLIC LICENSE\n\nVersion 2, June 1991\n\n    Copyright (C) 1989, 1991 Free Software Foundation, Inc.  \n    <https://fsf.org/>\n    \n    Everyone is permitted to copy and distribute verbatim copies\n    of this license document, but changing it is not allowed.\n\n### Preamble\n\nThe licenses for most software are designed to take away your freedom\nto share and change it. By contrast, the GNU General Public License is\nintended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users. This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it. (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.) You can apply it to\nyour programs, too.\n\nWhen we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\nTo protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if\nyou distribute copies of the software, or if you modify it.\n\nFor example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have. You must make sure that they, too, receive or can get the\nsource code. And you must show them these terms so they know their\nrights.\n\nWe protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\nAlso, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware. If the software is modified by someone else and passed on,\nwe want its recipients to know that what they have is not the\noriginal, so that any problems introduced by others will not reflect\non the original authors' reputations.\n\nFinally, any free program is threatened constantly by software\npatents. We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary. To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at\nall.\n\nThe precise terms and conditions for copying, distribution and\nmodification follow.\n\n### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n**0.** This License applies to any program or other work which\ncontains a notice placed by the copyright holder saying it may be\ndistributed under the terms of this General Public License. The\n\"Program\", below, refers to any such program or work, and a \"work\nbased on the Program\" means either the Program or any derivative work\nunder copyright law: that is to say, a work containing the Program or\na portion of it, either verbatim or with modifications and/or\ntranslated into another language. (Hereinafter, translation is\nincluded without limitation in the term \"modification\".) Each licensee\nis addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope. The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the Program\n(independent of having been made by running the Program). Whether that\nis true depends on what the Program does.\n\n**1.** You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a\nfee.\n\n**2.** You may modify your copy or copies of the Program or any\nportion of it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n  \n**a)** You must cause the modified files to carry prominent notices\nstating that you changed the files and the date of any change.\n\n  \n**b)** You must cause any work that you distribute or publish, that in\nwhole or in part contains or is derived from the Program or any part\nthereof, to be licensed as a whole at no charge to all third parties\nunder the terms of this License.\n\n  \n**c)** If the modified program normally reads commands interactively\nwhen run, you must cause it, when started running for such interactive\nuse in the most ordinary way, to print or display an announcement\nincluding an appropriate copyright notice and a notice that there is\nno warranty (or else, saying that you provide a warranty) and that\nusers may redistribute the program under these conditions, and telling\nthe user how to view a copy of this License. (Exception: if the\nProgram itself is interactive but does not normally print such an\nannouncement, your work based on the Program is not required to print\nan announcement.)\n\nThese requirements apply to the modified work as a whole. If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works. But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n**3.** You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n  \n**a)** Accompany it with the complete corresponding machine-readable\nsource code, which must be distributed under the terms of Sections 1\nand 2 above on a medium customarily used for software interchange; or,\n\n  \n**b)** Accompany it with a written offer, valid for at least three\nyears, to give any third party, for a charge no more than your cost of\nphysically performing source distribution, a complete machine-readable\ncopy of the corresponding source code, to be distributed under the\nterms of Sections 1 and 2 above on a medium customarily used for\nsoftware interchange; or,\n\n  \n**c)** Accompany it with the information you received as to the offer\nto distribute corresponding source code. (This alternative is allowed\nonly for noncommercial distribution and only if you received the\nprogram in object code or executable form with such an offer, in\naccord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it. For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable. However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n**4.** You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License. Any attempt otherwise\nto copy, modify, sublicense or distribute the Program is void, and\nwill automatically terminate your rights under this License. However,\nparties who have received copies, or rights, from you under this\nLicense will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n**5.** You are not required to accept this License, since you have not\nsigned it. However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works. These actions are\nprohibited by law if you do not accept this License. Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n**6.** Each time you redistribute the Program (or any work based on\nthe Program), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions. You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n**7.** If, as a consequence of a court judgment or allegation of\npatent infringement or for any other reason (not limited to patent\nissues), conditions are imposed on you (whether by court order,\nagreement or otherwise) that contradict the conditions of this\nLicense, they do not excuse you from the conditions of this License.\nIf you cannot distribute so as to satisfy simultaneously your\nobligations under this License and any other pertinent obligations,\nthen as a consequence you may not distribute the Program at all. For\nexample, if a patent license would not permit royalty-free\nredistribution of the Program by all those who receive copies directly\nor indirectly through you, then the only way you could satisfy both it\nand this License would be to refrain entirely from distribution of the\nProgram.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices. Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n**8.** If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded. In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n**9.** The Free Software Foundation may publish revised and/or new\nversions of the General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number. If the Program\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation. If the Program does not specify a\nversion number of this License, you may choose any version ever\npublished by the Free Software Foundation.\n\n**10.** If you wish to incorporate parts of the Program into other\nfree programs whose distribution conditions are different, write to\nthe author to ask for permission. For software which is copyrighted by\nthe Free Software Foundation, write to the Free Software Foundation;\nwe sometimes make exceptions for this. Our decision will be guided by\nthe two goals of preserving the free status of all derivatives of our\nfree software and of promoting the sharing and reuse of software\ngenerally.\n\n**NO WARRANTY**\n\n**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nPROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nPROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n### END OF TERMS AND CONDITIONS\n\n### How to Apply These Terms to Your New Programs\n\nIf you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these\nterms.\n\nTo do so, attach the following notices to the program. It is safest to\nattach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    one line to give the program's name and an idea of what it does.\n    Copyright (C) yyyy  name of author\n\n    This program is free software; you can redistribute it and/or\n    modify it under the terms of the GNU General Public License\n    as published by the Free Software Foundation; either version 2\n    of the License, or (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n    \n    You should have received a copy of the GNU General Public License along\n    with this program; if not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper\nmail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details\n    type `show w'.  This is free software, and you are welcome\n    to redistribute it under certain conditions; type `show c' \n    for details.\n\nThe hypothetical commands \\`show w' and \\`show c' should show the\nappropriate parts of the General Public License. Of course, the\ncommands you use may be called something other than \\`show w' and\n\\`show c'; they could even be mouse-clicks or menu items--whatever\nsuits your program.\n\nYou should also get your employer (if you work as a programmer) or\nyour school, if any, to sign a \"copyright disclaimer\" for the program,\nif necessary. Here is a sample; alter the names:\n\n    Yoyodyne, Inc., hereby disclaims all copyright\n    interest in the program `Gnomovision'\n    (which makes passes at compilers) written \n    by James Hacker.\n\n    signature of Ty Coon, 1 April 1989\n    Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library,\nyou may consider it more useful to permit linking proprietary\napplications with the library. If this is what you want to do, use the\n[GNU Lesser General Public\nLicense](https://www.gnu.org/licenses/lgpl.html) instead of this\nLicense.\n"
  },
  {
    "path": "COPYRIGHT",
    "content": "Pandoc\nCopyright (C) 2006-2024 John MacFarlane <jgm at berkeley dot edu>\n\nWith the exceptions noted below, this code is released under the [GPL],\nversion 2 or later:\n\n   This program is free software; you can redistribute it and/or modify\n   it under the terms of the GNU General Public License as published by\n   the Free Software Foundation; either version 2 of the License, or\n   (at your option) any later version.\n\n   This program is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n   GNU General Public License for more details.\n\n   You should have received a copy of the GNU General Public License along\n   with this program; if not, see <https://www.gnu.org/licenses/>.\n\nThe GNU General Public License is available in the file COPYING.md in\nthe source distribution.  On Debian systems, the complete text of the\nGPL can be found in `/usr/share/common-licenses/GPL`.\n\n[GPL]: https://www.gnu.org/copyleft/gpl.html\n\nThe complete source code for pandoc version X.Y.Z is available at\n<https://hackage.haskell.org/package/pandoc-X.Y.Z/pandoc-X.Y.Z.tar.gz>\nand at <https://github.com/jgm/pandoc/tree/X.Y.Z>.\n\nPandoc includes some code with different copyrights, or subject to different\nlicenses.  The copyright and license statements for these sources are included\nbelow.  All are GPL-compatible licenses.\n\n----------------------------------------------------------------------\nThe modules in the `pandoc-types` repository (Text.Pandoc.Definition,\nText.Pandoc.Builder, Text.Pandoc.Generics, Text.Pandoc.JSON,\nText.Pandoc.Walk) are licensed under the BSD 3-clause license:\n\nCopyright (c) 2006-2024, John MacFarlane\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials provided\n      with the distribution.\n\n    * Neither the name of John MacFarlane nor the names of other\n      contributors may be used to endorse or promote products derived\n      from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n----------------------------------------------------------------------\nPandoc's templates (in `data/templates`) are dual-licensed as either\nGPL (v2 or higher, same as pandoc) or (at your option) the BSD\n3-clause license.\n\nCopyright (c) 2014--2024, John MacFarlane\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Writers/Muse.hs\nCopyright (C) 2017-2020 Alexander Krotov\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Writers/Texinfo.hs\nCopyright (C) 2008-2024 John MacFarlane and Peter Wang\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Writers/OpenDocument.hs\nCopyright (C) 2008-2024 Andrea Rossato and John MacFarlane\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Writers/Org.hs\nCopyright (C) 2010-2024 Puneeth Chaganti, John MacFarlane, and\n                        Albert Krewinkel\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Writers/ZimWiki.hs\nCopyright (C) 2017 Alex Ivkin\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/Docx.hs\nsrc/Text/Pandoc/Readers/Docx/*\nCopyright (C) 2014-2020 Jesse Rosenthal\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/Textile.hs\nCopyright (C) 2010-2024 Paul Rivier and John MacFarlane\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/TikiWiki.hs\nCopyright (C) 2017 Robin Lee Powell\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/JATS.hs\nCopyright (C) 2017-2018 Hamish Mackenzie\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/EPUB.hs\nCopyright (C) 2014-2024 Matthew Pickering and John MacFarlane\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/Org.hs\nsrc/Text/Pandoc/Readers/Org/*\ntest/Tests/Readers/Org/*\nCopyright (C) 2014-2024 Albert Krewinkel\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\npandoc-lua-engine/src/Text/Pandoc/Lua.hs\npandoc-lua-engine/src/Text/Pandoc/Lua/*\npandoc-lua-engine/test/lua/*\nCopyright (C) 2017--2024 Albert Krewinkel and John MacFarlane\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/Jira.hs\nsrc/Text/Pandoc/Writers/Jira.hs\ntest/Tests/Readers/Jira.hs\nCopyright (C) 2019--2024 Albert Krewinkel\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nsrc/Text/Pandoc/Readers/FB2.hs\nCopyright (C) 2018--2019 Alexander Krotov\n\nReleased under the GNU General Public License version 2 or later.\n\n----------------------------------------------------------------------\nThe dzslides template contains JavaScript and CSS from Paul Rouget's\ndzslides template.\nhttps://github.com/paulrouget/dzslides\n\nReleased under the Do What the Fuck You Want To Public License.\n\n------------------------------------------------------------------------\nPandoc embeds a Lua interpreter (via hslua).\n\nCopyright © 1994--2023 Lua.org, PUC-Rio.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------------------------------------\nSome of the code in wasm/pandoc.js and the patches in wasm/patches is\nfrom https://github.com/haskell-wasm/pandoc-wasm. It is released under\nthis license:\n\nMIT License\n\nCopyright (c) Tweag I/O Limited.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "INSTALL.md",
    "content": "# Installing pandoc\n\nThe simplest way to get the latest pandoc release is to use the installer.\n\n<a href=\"https://github.com/jgm/pandoc/releases/latest\"\n  class=\"btn btn-primary\" id=\"downloadInstallerBtn\">\n  Download the latest installer\n</a>\n\nFor alternative ways to install pandoc, see below under the heading for\nyour operating system.\n\n**Note**: the statically linked Pandoc binaries provided by us (or those\navailable on Conda Forge) have a limitation. They are unable to utilise Lua\nfilters that rely on Lua modules written in C. If you require the\nfunctionality offered by these filters, please consider an alternative\nmethod of installation.\n\n## Windows\n\nThere is a package installer at pandoc's [download page].\nThis will install pandoc, replacing older versions, and\nupdate your path to include the directory where pandoc's\nbinaries are installed.\n\nIf you prefer not to use the msi installer, we also provide\na zip file that contains pandoc's binaries and\ndocumentation.  Simply unzip this file and move the binaries\nto a directory of your choice.\n\nAlternatively, you can install pandoc using\n[Chocolatey](https://chocolatey.org):\n\n    choco install pandoc\n\nChocolatey can also install other software that integrates with Pandoc.\nFor example, to install `rsvg-convert` (from [librsvg], covering formats\nwithout SVG support), [Python] (to use Pandoc filters), and\n[MiKTeX] (to typeset PDFs with [LaTeX]):\n\n    choco install rsvg-convert python miktex\n\nOr, you can install pandoc using\n[winget](https://github.com/microsoft/winget-pkgs):\n\n    winget install --source winget --exact --id JohnMacFarlane.Pandoc\n\nOr, you can install Pandoc using [Conda forge].\n\nUsing multiple installation methods can result in two separate\ninstallations of pandoc; it is recommended to properly uninstall\npandoc before switching to an alternative installation method.\n\nBy default, Pandoc creates PDFs using LaTeX.  We recommend\ninstalling it via [MiKTeX]. With the option `--pdf-engine`,\nyou however can specify other programs for this task.\n\n## macOS\n\nThere is a package installer at pandoc's [download page].\nIf you later want to uninstall the package, you can do so\nby downloading [this script][uninstaller]\nand running it with `perl uninstall-pandoc.pl`.\n\nAlternatively, you can install pandoc using\n[Homebrew](https://brew.sh):\n\n     brew install pandoc\n\nHomebrew can also install other software that integrates with Pandoc.\nFor example, to install [librsvg] (its `rsvg-convert` covers formats\nwithout SVG support), [Python] (to use Pandoc filters), and\n[BasicTeX] (to typeset PDFs with [LaTeX]):\n\n     brew install librsvg python homebrew/cask/basictex\n\nNote: On unsupported versions of macOS (more than three releases old),\nHomebrew installs from source, which takes additional time and disk space\nfor the `ghc` compiler and dependent Haskell libraries.\n\nYou can also install pandoc using [MacPorts]:\n\n    port install pandoc\n\nOr, you can install Pandoc using [Conda forge].\n\nWe also provide a zip file containing the binaries and man\npages, for those who prefer not to use the installer.  Simply\nunzip the file and move the binaries and man pages to\nwhatever directory you like.\n\nBy default, Pandoc creates PDFs using LaTeX.  Because a full [MacTeX]\ninstallation uses four gigabytes of disk space, we recommend\n[BasicTeX] or [TinyTeX](https://yihui.org/tinytex/)\nand using the `tlmgr` tool to install additional packages\nas needed.  If you receive errors warning of fonts not found:\n\n    tlmgr install collection-fontsrecommended\n\nWith the option `--pdf-engine`, you however can specify other programs\nfor this task.\n\n## Linux\n\nCheck whether the pandoc version in your package manager is\nnot outdated. Pandoc is in the [Debian], [Ubuntu], [Slackware],\n[Arch], [Fedora], [NixOS], [openSUSE], [gentoo] and [Void] repositories.\n\nTo get the latest release, we provide a binary package for amd64\narchitecture on the **[download page]**.\n\nThe executable is statically linked and\nhas no dynamic dependencies or dependencies on external\ndata files.\n\nBoth a tarball and a deb installer are provided.  To install the deb:\n\n    sudo dpkg -i $DEB\n\nwhere `$DEB` is the path to the downloaded deb.  This will\ninstall the `pandoc` executable and man page.\n\nIf you use an RPM-based distro, you may be able to install\nthe deb from our download page using `alien`.\n\nOn any distro, you may install from the tarball into `$DEST`\n(say, `/usr/local/` or `$HOME/.local`) by doing\n\n    tar xvzf $TGZ --strip-components 1 -C $DEST\n\nwhere `$TGZ` is the path to the downloaded zipped tarball.\nFor Pandoc versions before 2.0, which don't provide\na tarball, try instead\n\n    ar p $DEB data.tar.gz | tar xvz --strip-components 2 -C $DEST\n\nOr, you can install Pandoc using [Conda forge].\n\nYou can also install from source, using the\ninstructions below under [Compiling from source].\n\nBy default, Pandoc creates PDFs using LaTeX.  We recommend installing\n[TeX Live](https://www.tug.org/texlive/) via your package\nmanager.  (On Debian/Ubuntu, `apt-get install texlive`.)  With the option\n`--pdf-engine`, you however can specify other programs for this task.\n\n## Chrome OS\n\nOn Chrome OS, pandoc can be installed using the\n[chromebrew](https://github.com/skycocker/chromebrew) package manager\nwith the command:\n\n```sh\ncrew install pandoc\n```\n\nThis will automatically build and configure pandoc for the specific\ndevice you are using.\n\n## BSD\n\nPandoc is in the [NetBSD], [FreeBSD], and [OpenBSD ports] repositories.\n\n## Conda Forge\n\nYou can install Pandoc using a [Conda\nForge](https://anaconda.org/conda-forge/pandoc) tool, like\n[Conda](https://conda.pydata.org/docs/intro.html),\n[[Micro]Mamba](https://mamba.readthedocs.io/en/latest/index.html) or\n[Pixi](https://prefix.dev). Conda forge also includes multiple LaTeX and\nother relevant packages for Pandoc (including `pandoc-citeproc`,\n`pandoc-plot`, `rsvg-convert` via `librsvg` etc.). **Note:** conda forge\ninstalls a statically-linked executable.\n\n    conda install -c conda-forge pandoc\n    pixi global install pandoc\n    micromamba install pandoc\n\n## Docker\n\nThe official Docker images for pandoc can be found at\n<https://github.com/pandoc/dockerfiles> and at\n[dockerhub](https://hub.docker.com/).\n\nThe [pandoc/core](https://hub.docker.com/r/pandoc/core)\nimage contains `pandoc`.\n\nThe [pandoc/latex](https://hub.docker.com/r/pandoc/latex)\nimage also contains the minimal LaTeX installation needed\nto produce PDFs using pandoc.\n\nTo run pandoc using Docker, converting `README.md` to `README.pdf`:\n\n    docker run --rm --volume \"`pwd`:/data\" --user `id -u`:`id -g` pandoc/latex README.md -o README.pdf\n\n## GitHub Actions\n\nPandoc can be run through\n[GitHub Actions](https://github.com/features/actions).  For some\nexamples, see <https://github.com/pandoc/pandoc-action-example>.\n\n## GitLab CI/CD\n\nPandoc can be run through [GitLab CI/CD].  For some\nexamples, see <https://gitlab.com/pandoc/pandoc-ci-example>.\n\n## Compiling from source\n\nIf for some reason a binary package is not available for your\nplatform, or if you want to hack on pandoc or use a non-released\nversion, you can install from source.\n\n### Getting the pandoc source code\n\nSource tarballs can be found at\n<https://hackage.haskell.org/package/pandoc>.  For example, to\nfetch the source for version 1.17.0.3:\n\n    wget https://hackage.haskell.org/package/pandoc-1.17.0.3/pandoc-1.17.0.3.tar.gz\n    tar xvzf pandoc-1.17.0.3.tar.gz\n    cd pandoc-1.17.0.3\n\nOr you can fetch the development code by cloning the repository:\n\n    git clone https://github.com/jgm/pandoc\n    cd pandoc\n\nNote:  there may be times when the development code is broken\nor depends on other libraries which must be installed\nseparately.  Unless you really know what you're doing, install\nthe last released version.\n\n### Quick stack method\n\nThe easiest way to build pandoc from source is to use [stack][stack]:\n\n1.  Install [stack][stack]. Note that Pandoc requires stack >= 1.7.0.\n\n2.\n        stack setup\n        stack install pandoc-cli\n\n    `stack setup` will automatically download the ghc compiler\n    if you don't have it.  `stack install` will install the\n    `pandoc` executable into `~/.local/bin`, which you should\n    add to your `PATH`.  This process will take a while, and\n    will consume a considerable amount of disk space.\n\n\n### Quick cabal method\n\n1.  Install [ghcup](https://www.haskell.org/ghcup/install/).\n    This will give you `ghc` and `cabal`.\n\n2.  Update your package database:\n\n        cabal update\n\n3.  Use `cabal` to install pandoc and its dependencies:\n\n        cabal install pandoc-cli\n\n    This procedure will install the released version of pandoc,\n    which will be downloaded automatically from HackageDB.\n    The `pandoc` executable will be symlinked in`$HOME/.cabal/bin`\n    on linux/unix/macOS and in `%APPDATA%\\cabal\\bin` on Windows.\n    Make sure this directory is in your path. To specify a\n    custom install directory, use `--installdir`. To have\n    the executable copied instead of symlinked, use\n    `--install-method=copy`.\n\n    If you want to install a modified or development version of\n    pandoc instead, switch to the source directory before running\n    the above command -- cabal will use the local code for all\n    projects mentioned in the `cabal.project`.\n\n4.  You should now be able to run `pandoc`:\n\n        pandoc --help\n\n5.  Cabal does not install the `pandoc.1` man page, but you can\n    copy it from the `man/` directory of the source code to\n    `/usr/local/share/man/man1/` or wherever man pages go on\n    your system.\n\n\n### Custom cabal method\n\nThis is a step-by-step procedure that offers maximal control\nover the build and installation.  Most users should use the\nquick install, but this information may be of use to packagers.\nFor more details, see the [Cabal User's Guide].  These instructions\nassume that the pandoc source directory is your working directory.\nYou will need cabal version 2.0 or higher.\n\n1.  Install dependencies:\n\n        cabal update\n        cabal build --only-dependencies\n\n2.  Configure:\n\n        cabal configure --prefix=DIR --bindir=DIR --libdir=DIR \\\n          --datadir=DIR --libsubdir=DIR --datasubdir=DIR --docdir=DIR \\\n          --htmldir=DIR --program-prefix=PREFIX --program-suffix=SUFFIX \\\n          --mandir=DIR --flags=FLAGSPEC --enable-tests\n\n    All of the options have sensible defaults that can be overridden\n    as needed.\n\n    `FLAGSPEC` is a list of Cabal configuration flags, optionally\n    preceded by a `-` (to force the flag to `false`), and separated\n    by spaces.  `pandoc`'s flags include:\n\n    - `embed_data_files`: embed all data files into the binary (default no).\n      This is helpful if you want to create a relocatable binary.\n\n    `pandoc-cli`'s flags include:\n\n    - `lua`:  compile in support for Lua filters and custom\n      writers.\n\n    - `server`:  compile in support for running in HTTP server\n      mode when the executable is renamed (or symlinked as)\n      `pandoc-server`.\n\n3.  Build:\n\n        cabal build\n        cabal test\n\n4.  Build API documentation:\n\n        cabal haddock --html-location=URL --hyperlink-source\n\n5.  Install\n\n        cabal install pandoc-cli\n\n### Creating a relocatable binary\n\nIt is possible to compile pandoc such that the data files\npandoc uses are embedded in the binary.  The resulting binary\ncan be run from any directory and is completely self-contained.\nWith cabal, add `-fembed_data_files` to the `cabal configure`\nor `cabal build` commands.\n\nWith stack, use `--flag pandoc:embed_data_files`.\n\n### Running tests\n\nPandoc comes with an automated test suite.\nTo run with cabal, `cabal test`; to run with stack, `stack\ntest`.\n\nTo run particular tests (pattern-matching on their names), use\nthe `-p` option:\n\n    cabal test --test-options='-p markdown'\n\nOr with stack:\n\n    stack test --test-arguments='-p markdown'\n\nIt is often helpful to add `-j4` (run tests in parallel)\nand `--hide-successes` (don't clutter output with successes)\nto the test arguments as well.\n\nIf you add a new feature to pandoc, please add tests as well, following\nthe pattern of the existing tests. The test suite code is in\n`test/test-pandoc.hs`. If you are adding a new reader or writer, it is\nprobably easiest to add some data files to the `test` directory, and\nmodify `test/Tests/Old.hs`. Otherwise, it is better to modify the module\nunder the `test/Tests` hierarchy corresponding to the pandoc module you\nare changing.\n\n### Running benchmarks\n\nTo build and run the benchmarks:\n\n    cabal configure --enable-benchmarks && cabal build\n    cabal bench\n\nor with stack:\n\n    stack bench\n\nTo use a smaller sample size so the benchmarks run faster:\n\n    cabal bench --benchmark-options='-s 20'\n\nTo run just the markdown benchmarks:\n\n    cabal bench --benchmark-options='markdown'\n\n\n[Arch]: https://archlinux.org/packages/?q=pandoc\n[Cabal User's Guide]: https://cabal.readthedocs.io/\n[Debian]: https://packages.debian.org/search?keywords=pandoc\n[Fedora]: https://packages.fedoraproject.org/pkgs/pandoc/pandoc/\n[FreeBSD]: https://www.freshports.org/textproc/hs-pandoc/\n[GHC]:  https://www.haskell.org/ghc/\n[GitLab CI/CD]: https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/\n[MacPorts]: https://ports.macports.org/port/pandoc/\n[MacTeX]: https://tug.org/mactex/\n[OpenBSD ports]: https://cvsweb.openbsd.org/ports/textproc/pandoc/\n[BasicTeX]: https://www.tug.org/mactex/morepackages.html\n[LaTeX]: https://www.latex-project.org\n[MiKTeX]: https://miktex.org/\n[librsvg]: https://wiki.gnome.org/Projects/LibRsvg\n[Python]: https://www.python.org\n[NetBSD]: https://pkgsrc.se/converters/pandoc\n[NixOS]: https://search.nixos.org/packages?query=pandoc\n[Slackware]: https://www.slackbuilds.org/result/?search=pandoc&sv=\n[Ubuntu]: https://packages.ubuntu.com/search?keywords=pandoc\n[download page]: https://github.com/jgm/pandoc/releases/latest\n[gentoo]: https://packages.gentoo.org/package/app-text/pandoc\n[haskell repository]: https://wiki.archlinux.org/index.php/Haskell_Package_Guidelines#.5Bhaskell.5D\n[openSUSE]: https://software.opensuse.org/package/pandoc\n[source tarball]: https://hackage.haskell.org/package/pandoc\n[stack]: https://docs.haskellstack.org/en/stable/install_and_upgrade.html\n[cabal-install]: https://hackage.haskell.org/package/cabal-install\n[Void]: https://voidlinux.org/packages/?arch=x86_64&q=pandoc\n[uninstaller]: https://raw.githubusercontent.com/jgm/pandoc/main/macos/uninstall-pandoc.pl\n"
  },
  {
    "path": "MANUAL.txt",
    "content": "---\ntitle: Pandoc User's Guide\nauthor: John MacFarlane\ndate: 2026-03-19\n---\n\n# Synopsis\n\n`pandoc` [*options*] [*input-file*]...\n\n# Description\n\nPandoc is a [Haskell] library for converting from one markup format to\nanother, and a command-line tool that uses this library.\n\nPandoc can convert between numerous markup and word processing formats,\nincluding, but not limited to, various flavors of [Markdown], [HTML],\n[LaTeX] and [Word docx]. For the full lists of input and output formats,\nsee the `--from` and `--to` [options below][General options].\nPandoc can also produce [PDF] output: see [creating a PDF], below.\n\nPandoc's enhanced version of Markdown includes syntax for [tables],\n[definition lists], [metadata blocks], [footnotes], [citations], [math],\nand much more.  See below under [Pandoc's Markdown].\n\nPandoc has a modular design: it consists of a set of readers, which parse\ntext in a given format and produce a native representation of the document\n(an _abstract syntax tree_ or AST), and a set of writers, which convert\nthis native representation into a target format. Thus, adding an input\nor output format requires only adding a reader or writer. Users can also\nrun custom [pandoc filters] to modify the intermediate AST.\n\nBecause pandoc's intermediate representation of a document is less\nexpressive than many of the formats it converts between, one should\nnot expect perfect conversions between every format and every other.\nPandoc attempts to preserve the structural elements of a document, but\nnot formatting details such as margin size.  And some document elements,\nsuch as complex tables, may not fit into pandoc's simple document\nmodel.  While conversions from pandoc's Markdown to all formats aspire\nto be perfect, conversions from formats more expressive than pandoc's\nMarkdown can be expected to be lossy.\n\n## Using pandoc\n\nIf no *input-files* are specified, input is read from *stdin*.\nOutput goes to *stdout* by default. For output to a file,\nuse the `-o`/`--output` option:\n\n    pandoc -o output.html input.txt\n\nBy default, pandoc produces a document fragment. To produce a standalone\ndocument (e.g. a valid HTML file including `<head>` and `<body>`),\nuse the `-s` or `--standalone` flag:\n\n    pandoc -s -o output.html input.txt\n\nFor more information on how standalone documents are produced, see\n[Templates] below.\n\nIf multiple input files are given, pandoc will concatenate them all (with\nblank lines between them) before parsing. (Use `--file-scope` to parse files\nindividually.)\n\n## Specifying formats\n\nThe format of the input and output can be specified explicitly using\ncommand-line options.  The input format can be specified using the\n`-f/--from` option, the output format using the `-t/--to` option.\nThus, to convert `hello.txt` from Markdown to LaTeX, you could type:\n\n    pandoc -f markdown -t latex hello.txt\n\nTo convert `hello.html` from HTML to Markdown:\n\n    pandoc -f html -t markdown hello.html\n\nSupported input and output formats are listed below under [Options]\n(see `-f` for input formats and `-t` for output formats).  You\ncan also use `pandoc --list-input-formats` and\n`pandoc --list-output-formats` to print lists of supported\nformats.\n\nIf the input or output format is not specified explicitly, pandoc\nwill attempt to guess it from the extensions of the filenames.\nThus, for example,\n\n    pandoc -o hello.tex hello.txt\n\nwill convert `hello.txt` from Markdown to LaTeX.  If no output file\nis specified (so that output goes to *stdout*), or if the output file's\nextension is unknown, the output format will default to HTML.\nIf no input file is specified (so that input comes from *stdin*), or\nif the input files' extensions are unknown, the input format will\nbe assumed to be Markdown.\n\n## Character encoding\n\nPandoc uses the UTF-8 character encoding for both input and output.\nIf your local character encoding is not UTF-8, you\nshould pipe input and output through [`iconv`]:\n\n    iconv -t utf-8 input.txt | pandoc | iconv -f utf-8\n\nNote that in some output formats (such as HTML, LaTeX, ConTeXt,\nRTF, OPML, DocBook, and Texinfo), information about\nthe character encoding is included in the document header, which\nwill only be included if you use the `-s/--standalone` option.\n\n[`iconv`]: https://www.gnu.org/software/libiconv/\n\n## Creating a PDF\n\nTo produce a PDF, specify an output file with a `.pdf` extension:\n\n    pandoc test.txt -o test.pdf\n\nBy default, pandoc will use LaTeX to create the PDF, which requires\nthat a LaTeX engine be installed (see `--pdf-engine` below).\nAlternatively, pandoc can use ConTeXt, roff ms, or HTML as an\nintermediate format.  To do this, specify an output file with a\n`.pdf` extension, as before, but add the `--pdf-engine` option\nor `-t context`, `-t html`, or `-t ms` to the command line.\nThe tool used to generate the PDF from the intermediate format\nmay be specified using `--pdf-engine`.\n\nYou can control the PDF style using variables, depending on\nthe intermediate format used: see [variables for LaTeX],\n[variables for ConTeXt], [variables for `wkhtmltopdf`],\n[variables for ms].  When HTML is used as an intermediate\nformat, the output can be styled using `--css`.\n\nTo debug the PDF creation, it can be useful to look at the intermediate\nrepresentation: instead of `-o test.pdf`, use for example `-s -o test.tex`\nto output the generated LaTeX. You can then test it with `pdflatex test.tex`.\n\nWhen using LaTeX, the following packages need to be available\n(they are included with all recent versions of [TeX Live]):\n[`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],\n[`iftex`], [`listings`] (if the\n`--listings` option is used), [`fancyvrb`], [`longtable`],\n[`booktabs`], [`multirow`] (if the document contains a table with\ncells that cross multiple rows), [`graphicx`] (if the document\ncontains images), [`bookmark`], [`xcolor`],\n[`soul`], [`geometry`] (with the `geometry` variable set),\n[`setspace`] (with `linestretch`), and\n[`babel`] (with `lang`).  If `CJKmainfont` is set, [`xeCJK`]\nis needed if `xelatex` is used, else [`luatexja`] is needed if\n`lualatex` is used. [`framed`] is required if code is highlighted in a\nscheme that use a colored background. The use of `xelatex` or\n`lualatex` as the PDF engine requires [`fontspec`]. `lualatex`\nuses [`selnolig`] and [`lua-ul`]. `xelatex` uses [`bidi`] (with\nthe `dir` variable set).\nIf the `mathspec` variable is set, `xelatex` will use [`mathspec`]\ninstead of [`unicode-math`].  The [`csquotes`] package will be used\nfor [typography] if the `csquotes` variable or metadata field is\nset to a true value.  The [`natbib`], [`biblatex`], [`bibtex`],\nand [`biber`] packages can optionally be used for [citation\nrendering].  If math with `\\cancel`, `\\bcancel`, or `\\xcancel`\nis used, the [`cancel`] package is needed.\nThe following packages will be used to improve\noutput quality if present, but pandoc does not require them to\nbe present: [`upquote`] (for straight quotes in verbatim\nenvironments), [`microtype`] (for better spacing adjustments),\n[`parskip`] (for better inter-paragraph spaces), [`xurl`] (for\nbetter line breaks in URLs), and [`footnotehyper`] or\n[`footnote`] (to allow footnotes in tables).\n\n[TeX Live]: https://www.tug.org/texlive/\n[`amsfonts`]: https://ctan.org/pkg/amsfonts\n[`amsmath`]: https://ctan.org/pkg/amsmath\n[`babel`]: https://ctan.org/pkg/babel\n[`biber`]: https://ctan.org/pkg/biber\n[`biblatex`]: https://ctan.org/pkg/biblatex\n[`bibtex`]: https://ctan.org/pkg/bibtex\n[`bidi`]: https://ctan.org/pkg/bidi\n[`bookmark`]: https://ctan.org/pkg/bookmark\n[`booktabs`]: https://ctan.org/pkg/booktabs\n[`csquotes`]: https://ctan.org/pkg/csquotes\n[`fancyvrb`]: https://ctan.org/pkg/fancyvrb\n[`fontspec`]: https://ctan.org/pkg/fontspec\n[`footnote`]: https://ctan.org/pkg/footnote\n[`footnotehyper`]: https://ctan.org/pkg/footnotehyper\n[`framed`]: https://ctan.org/pkg/framed\n[`geometry`]: https://ctan.org/pkg/geometry\n[`graphicx`]: https://ctan.org/pkg/graphicx\n[`cancel`]: https://ctan.org/pkg/cancel\n[`hyperref`]: https://ctan.org/pkg/hyperref\n[`iftex`]: https://ctan.org/pkg/iftex\n[`listings`]: https://ctan.org/pkg/listings\n[`lm`]: https://ctan.org/pkg/lm\n[`lua-ul`]: https://ctan.org/pkg/lua-ul\n[`luatexja`]: https://ctan.org/pkg/luatexja\n[`longtable`]: https://ctan.org/pkg/longtable\n[`mathspec`]: https://ctan.org/pkg/mathspec\n[`microtype`]: https://ctan.org/pkg/microtype\n[`multirow`]: https://ctan.org/pkg/multirow\n[`natbib`]: https://ctan.org/pkg/natbib\n[`parskip`]: https://ctan.org/pkg/parskip\n[`polyglossia`]: https://ctan.org/pkg/polyglossia\n[`prince`]: https://www.princexml.com/\n[`setspace`]: https://ctan.org/pkg/setspace\n[`soul`]: https://ctan.org/pkg/soul\n[`unicode-math`]: https://ctan.org/pkg/unicode-math\n[`upquote`]: https://ctan.org/pkg/upquote\n[`weasyprint`]: https://weasyprint.org\n[`wkhtmltopdf`]: https://wkhtmltopdf.org\n[`xcolor`]: https://ctan.org/pkg/xcolor\n[`xeCJK`]: https://ctan.org/pkg/xecjk\n[`xurl`]: https://ctan.org/pkg/xurl\n[`selnolig`]: https://ctan.org/pkg/selnolig\n\n\n\n## Reading from the Web\n\nInstead of an input file, an absolute URI may be given. In this case\npandoc will fetch the content using HTTP:\n\n    pandoc -f html -t markdown https://www.fsf.org\n\nIt is possible to supply a custom User-Agent string or other\nheader when requesting a document from a URL:\n\n    pandoc -f html -t markdown --request-header User-Agent:\"Mozilla/5.0\" \\\n      https://www.fsf.org\n\n# Options\n\n## General options {.options}\n\n`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*\n\n:   Specify input format.  *FORMAT* can be:\n\n    ::: {#input-formats}\n    - `asciidoc` ([AsciiDoc] markup)\n    - `bibtex` ([BibTeX] bibliography)\n    - `biblatex` ([BibLaTeX] bibliography)\n    - `bits` ([BITS] XML, alias for `jats`)\n    - `commonmark` ([CommonMark] Markdown)\n    - `commonmark_x` ([CommonMark] Markdown with extensions)\n    - `creole` ([Creole 1.0])\n    - `csljson` ([CSL JSON] bibliography)\n    - `csv` ([CSV] table)\n    - `tsv` ([TSV] table)\n    - `djot` ([Djot markup])\n    - `docbook` ([DocBook])\n    - `docx` ([Word docx])\n    - `dokuwiki` ([DokuWiki markup])\n    - `endnotexml` ([EndNote XML bibliography])\n    - `epub` ([EPUB])\n    - `fb2` ([FictionBook2] e-book)\n    - `gfm` ([GitHub-Flavored Markdown]),\n      or the deprecated and less accurate `markdown_github`;\n      use [`markdown_github`](#markdown-variants) only\n      if you need extensions not supported in [`gfm`](#markdown-variants).\n    - `haddock` ([Haddock markup])\n    - `html` ([HTML])\n    - `ipynb` ([Jupyter notebook])\n    - `jats` ([JATS] XML)\n    - `jira` ([Jira]/Confluence wiki markup)\n    - `json` (JSON version of native AST)\n    - `latex` ([LaTeX])\n    - `markdown` ([Pandoc's Markdown])\n    - `markdown_mmd` ([MultiMarkdown])\n    - `markdown_phpextra` ([PHP Markdown Extra])\n    - `markdown_strict` (original unextended [Markdown])\n    - `mediawiki` ([MediaWiki markup])\n    - `man` ([roff man])\n    - `mdoc` ([mdoc] manual page markup)\n    - `muse` ([Muse])\n    - `native` (native Haskell)\n    - `odt` ([OpenDocument text document][ODT])\n    - `opml` ([OPML])\n    - `org` ([Emacs Org mode])\n    - `pod` (Perl's [Plain Old Documentation])\n    - `pptx` ([PowerPoint])\n    - `ris` ([RIS] bibliography)\n    - `rtf` ([Rich Text Format])\n    - `rst` ([reStructuredText])\n    - `t2t` ([txt2tags])\n    - `textile` ([Textile])\n    - `tikiwiki` ([TikiWiki markup])\n    - `twiki` ([TWiki markup])\n    - `typst` ([typst])\n    - `vimwiki` ([Vimwiki])\n    - `xlsx` ([Excel spreadsheet][XLSX])\n    - `xml` (XML version of native AST)\n    - the path of a custom Lua reader, see [Custom readers and writers] below\n    :::\n\n    Extensions can be individually enabled or disabled by\n    appending `+EXTENSION` or `-EXTENSION` to the format name.\n    See [Extensions] below, for a list of extensions and\n    their names.  See `--list-input-formats` and `--list-extensions`,\n    below.\n\n`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*\n\n:   Specify output format.  *FORMAT* can be:\n\n    ::: {#output-formats}\n    - `ansi` (text with [ANSI escape codes], for terminal viewing)\n    - `asciidoc` (modern [AsciiDoc] as interpreted by [AsciiDoctor])\n    - `asciidoc_legacy` ([AsciiDoc] as interpreted by [`asciidoc-py`]).\n    - `asciidoctor` (deprecated synonym for `asciidoc`)\n    - `bbcode` [BBCode]\n    - `bbcode_fluxbb` [BBCode (FluxBB)]\n    - `bbcode_phpbb` [BBCode (phpBB)]\n    - `bbcode_steam` [BBCode (Steam)]\n    - `bbcode_hubzilla` [BBCode (Hubzilla)]\n    - `bbcode_xenforo` [BBCode (xenForo)]\n    - `beamer` ([LaTeX beamer][`beamer`] slide show)\n    - `bibtex` ([BibTeX] bibliography)\n    - `biblatex` ([BibLaTeX] bibliography)\n    - `chunkedhtml` (zip archive of multiple linked HTML files)\n    - `commonmark` ([CommonMark] Markdown)\n    - `commonmark_x` ([CommonMark] Markdown with extensions)\n    - `context` ([ConTeXt])\n    - `csljson` ([CSL JSON] bibliography)\n    - `djot` ([Djot markup])\n    - `docbook` or `docbook4` ([DocBook] 4)\n    - `docbook5` (DocBook 5)\n    - `docx` ([Word docx])\n    - `dokuwiki` ([DokuWiki markup])\n    - `epub` or `epub3` ([EPUB] v3 book)\n    - `epub2` (EPUB v2)\n    - `fb2` ([FictionBook2] e-book)\n    - `gfm` ([GitHub-Flavored Markdown]),\n      or the deprecated and less accurate `markdown_github`;\n      use [`markdown_github`](#markdown-variants) only\n      if you need extensions not supported in [`gfm`](#markdown-variants).\n    - `haddock` ([Haddock markup])\n    - `html` or `html5` ([HTML], i.e. [HTML5]/XHTML [polyglot markup])\n    - `html4` ([XHTML] 1.0 Transitional)\n    - `icml` ([InDesign ICML])\n    - `ipynb` ([Jupyter notebook])\n    - `jats_archiving` ([JATS] XML, Archiving and Interchange Tag Set)\n    - `jats_articleauthoring` ([JATS] XML, Article Authoring Tag Set)\n    - `jats_publishing` ([JATS] XML, Journal Publishing Tag Set)\n    - `jats` (alias for `jats_archiving`)\n    - `jira` ([Jira]/Confluence wiki markup)\n    - `json` (JSON version of native AST)\n    - `latex` ([LaTeX])\n    - `man` ([roff man])\n    - `markdown` ([Pandoc's Markdown])\n    - `markdown_mmd` ([MultiMarkdown])\n    - `markdown_phpextra` ([PHP Markdown Extra])\n    - `markdown_strict` (original unextended [Markdown])\n    - `markua` ([Markua])\n    - `mediawiki` ([MediaWiki markup])\n    - `ms` ([roff ms])\n    - `muse` ([Muse])\n    - `native` (native Haskell)\n    - `odt` ([OpenDocument text document][ODT])\n    - `opml` ([OPML])\n    - `opendocument` ([OpenDocument XML])\n    - `org` ([Emacs Org mode])\n    - `pdf` ([PDF])\n    - `plain` (plain text)\n    - `pptx` ([PowerPoint] slide show)\n    - `rst` ([reStructuredText])\n    - `rtf` ([Rich Text Format])\n    - `texinfo` ([GNU Texinfo])\n    - `textile` ([Textile])\n    - `slideous` ([Slideous] HTML and JavaScript slide show)\n    - `slidy` ([Slidy] HTML and JavaScript slide show)\n    - `dzslides` ([DZSlides] HTML5 + JavaScript slide show)\n    - `revealjs` ([reveal.js] HTML5 + JavaScript slide show)\n    - `s5` ([S5] HTML and JavaScript slide show)\n    - `tei` ([TEI Simple])\n    - `typst` ([typst])\n    - `vimdoc` ([Vimdoc])\n    - `xml` (XML version of native AST)\n    - `xwiki` ([XWiki markup])\n    - `zimwiki` ([ZimWiki markup])\n    - the path of a custom Lua writer, see [Custom readers and writers] below\n    :::\n\n    Note that `odt`, `docx`, `epub`, and `pdf` output will not be directed\n    to *stdout* unless forced with `-o -`.\n\n    Extensions can be individually enabled or\n    disabled by appending `+EXTENSION` or `-EXTENSION` to the format\n    name.  See [Extensions] below, for a list of extensions and their\n    names.  See `--list-output-formats` and `--list-extensions`, below.\n\n`-o` *FILE*, `--output=`*FILE*\n\n:   Write output to *FILE* instead of *stdout*.  If *FILE* is\n    `-`, output will go to *stdout*, even if a non-textual format\n    (`docx`, `odt`, `epub2`, `epub3`) is specified.  If the\n    output format is `chunkedhtml` and *FILE* has no extension,\n    then instead of producing a `.zip` file pandoc will create\n    a directory *FILE* and unpack the zip archive there\n    (unless *FILE* already exists, in which case an error\n    will be raised).\n\n`--data-dir=`*DIRECTORY*\n\n:   Specify the user data directory to search for pandoc data files.\n    If this option is not specified, the default user data directory\n    will be used.  On \\*nix and macOS systems this will be the `pandoc`\n    subdirectory of the XDG data directory (by default,\n    `$HOME/.local/share`, overridable by setting the `XDG_DATA_HOME`\n    environment variable).  If that directory does not exist and\n    `$HOME/.pandoc` exists, it will be used (for backwards compatibility).\n    On Windows the default user data directory is `%APPDATA%\\pandoc`.\n    You can find the default user data directory on your system by\n    looking at the output of `pandoc --version`.\n    Data files placed in this directory (for example, `reference.odt`,\n    `reference.docx`, `epub.css`, `templates`) will override\n    pandoc's normal defaults.  (Note that the user data directory\n    is not created by pandoc, so you will need to create it yourself\n    if you want to make use of it.)\n\n`-d` *FILE*, `--defaults=`*FILE*\n\n:   Specify a set of default option settings.  *FILE* is a YAML or JSON\n    file whose fields correspond to command-line option\n    settings.  All options for document conversion, including input\n    and output files, can be set using a defaults file.  The file will\n    be searched for first in the working directory, and then in\n    the `defaults` subdirectory of the user data directory\n    (see `--data-dir`).  The `.yaml` extension will be added if\n    *FILE* lacs an extension. See the section [Defaults files]\n    for more information on the file format. Settings from the\n    defaults file may be overridden or extended by subsequent\n    options on the command line.\n\n`--bash-completion`\n\n:   Generate a bash completion script.  To enable bash completion\n    with pandoc, add this to your `.bashrc`:\n\n        eval \"$(pandoc --bash-completion)\"\n\n`--verbose`\n\n:   Give verbose debugging output.\n\n`--quiet`\n\n:   Suppress warning messages.\n\n`--fail-if-warnings[=true|false]`\n\n:   Exit with error status if there are any warnings.\n\n`--log=`*FILE*\n\n:   Write log messages in machine-readable JSON format to\n    *FILE*.  All messages above DEBUG level will be written,\n    regardless of verbosity settings (`--verbose`, `--quiet`).\n\n`--list-input-formats`\n\n:   List supported input formats, one per line.\n\n`--list-output-formats`\n\n:   List supported output formats, one per line.\n\n`--list-extensions`[`=`*FORMAT*]\n\n:   List supported extensions for *FORMAT*, one per line, preceded\n    by a `+` or `-` indicating whether it is enabled by default\n    in *FORMAT*. If *FORMAT* is not specified, defaults for\n    pandoc's Markdown are given.\n\n`--list-highlight-languages`\n\n:   List supported languages for syntax highlighting, one per\n    line.\n\n`--list-highlight-styles`\n\n:   List supported styles for syntax highlighting, one per line.\n    See `--syntax-highlighting`.\n\n`-v`, `--version`\n\n:   Print version.\n\n`-h`, `--help`\n\n:   Show usage message.\n\n[ANSI escape codes]: https://en.wikipedia.org/wiki/ANSI_escape_code\n[Markdown]: https://daringfireball.net/projects/markdown/\n[CommonMark]: https://commonmark.org\n[PHP Markdown Extra]: https://michelf.ca/projects/php-markdown/extra/\n[GitHub-Flavored Markdown]: https://help.github.com/articles/github-flavored-markdown/\n[MultiMarkdown]: https://fletcherpenney.net/multimarkdown/\n[reStructuredText]: https://docutils.sourceforge.io/docs/ref/rst/introduction.html\n[S5]: https://meyerweb.com/eric/tools/s5/\n[Slidy]: https://www.w3.org/Talks/Tools/Slidy2/\n[Slideous]: https://goessner.net/articles/slideous/\n[HTML]: https://www.w3.org/html/\n[HTML5]: https://html.spec.whatwg.org/\n[polyglot markup]: https://www.w3.org/TR/html-polyglot/\n[XHTML]: https://www.w3.org/TR/xhtml1/\n[LaTeX]: https://www.latex-project.org/\n[`beamer`]: https://ctan.org/pkg/beamer\n[Beamer User's Guide]: http://mirrors.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf\n[ConTeXt]: https://www.contextgarden.net/\n[Rich Text Format]: https://en.wikipedia.org/wiki/Rich_Text_Format\n[DocBook]: https://docbook.org\n[Djot markup]: https://djot.net\n[JATS]: https://jats.nlm.nih.gov\n[BITS]: https://jats.nlm.nih.gov/extensions/bits/\n[Jira]: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all\n[txt2tags]: https://txt2tags.org\n[EPUB]: http://idpf.org/epub\n[OPML]: https://opml.org/spec2.opml\n[OpenDocument XML]: https://www.oasis-open.org/2021/06/16/opendocument-v1-3-oasis-standard-published/\n[ODT]: https://en.wikipedia.org/wiki/OpenDocument\n[Plain Old Documentation]: https://perldoc.perl.org/perlpod\n[Textile]: https://textile-lang.com\n[MediaWiki markup]: https://www.mediawiki.org/wiki/Help:Formatting\n[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki\n[ZimWiki markup]: https://zim-wiki.org/manual/Help/Wiki_Syntax.html\n[XWiki markup]: https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/\n[XLSX]: https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats\n[Vimdoc]: https://vimhelp.org/helphelp.txt.html#help-writing\n[TWiki markup]: https://twiki.org/cgi-bin/view/TWiki/TextFormattingRules\n[TikiWiki markup]: https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax\n[Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html\n[Creole 1.0]: http://www.wikicreole.org/wiki/Creole1.0\n[CSV]: https://tools.ietf.org/html/rfc4180\n[TSV]: https://www.iana.org/assignments/media-types/text/tab-separated-values\n[roff man]: https://man.cx/groff_man(7)\n[roff ms]: https://man.cx/groff_ms(7)\n[Haskell]: https://www.haskell.org\n[GNU Texinfo]: https://www.gnu.org/software/texinfo/\n[RIS]: https://en.wikipedia.org/wiki/RIS_(file_format)\n[Emacs Org mode]: https://orgmode.org\n[AsciiDoc]: https://asciidoc.org/\n[AsciiDoctor]: https://asciidoctor.org/\n[`asciidoc-py`]: https://github.com/asciidoc-py/asciidoc-py\n[DZSlides]: https://paulrouget.com/dzslides/\n[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML\n[PDF]: https://www.adobe.com/pdf/\n[reveal.js]: https://revealjs.com/\n[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1\n[Jupyter notebook]: https://nbformat.readthedocs.io/en/latest/\n[InDesign ICML]: https://web.archive.org/web/20211006210211/https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf\n[TEI Simple]: https://github.com/TEIC/TEI-Simple\n[Muse]: https://amusewiki.org/library/manual\n[PowerPoint]: https://en.wikipedia.org/wiki/Microsoft_PowerPoint\n[Vimwiki]: https://vimwiki.github.io\n[CSL JSON]: https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html\n[BibTeX]: https://ctan.org/pkg/bibtex\n[BibLaTeX]: https://ctan.org/pkg/biblatex\n[Markua]: https://leanpub.com/markua/read\n[EndNote XML bibliography]: https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition\n[typst]: https://typst.app\n[mdoc]: https://mandoc.bsd.lv/man/mdoc.7.html\n[BBCode]: https://www.bbcode.org/reference.php\n[BBCode (FluxBB)]: https://web.archive.org/web/20210623155046/https://fluxbb.org/forums/help.php#bbcode\n[BBCode (Hubzilla)]: https://hubzilla.org/help/member/bbcode\n[BBCode (Steam)]: https://steamcommunity.com/comment/ForumTopic/formattinghelp\n[BBCode (phpBB)]: https://www.phpbb.com/community/help/bbcode\n[BBCode (xenForo)]: https://www.xenfocus.com/community/help/bb-codes/\n\n## Reader options {.options}\n\n`--shift-heading-level-by=`*NUMBER*\n\n:   Shift heading levels by a positive or negative integer.\n    For example, with `--shift-heading-level-by=-1`, level 2\n    headings become level 1 headings, and level 3 headings\n    become level 2 headings.  Headings cannot have a level\n    less than 1, so a heading that would be shifted below level 1\n    becomes a regular paragraph.  Exception: with a shift of -N,\n    a level-N heading at the beginning of the document\n    replaces the metadata title. `--shift-heading-level-by=-1`\n    is a good choice when converting HTML or Markdown documents that\n    use an initial level-1 heading for the document title and\n    level-2+ headings for sections. `--shift-heading-level-by=1`\n    may be a good choice for converting Markdown documents that\n    use level-1 headings for sections to HTML, since pandoc uses\n    a level-1 heading to render the document title.\n\n`--base-header-level=`*NUMBER*\n\n:   *Deprecated.  Use `--shift-heading-level-by`=X instead,\n    where X = NUMBER - 1.* Specify the base level for headings\n    (defaults to 1).\n\n`--indented-code-classes=`*CLASSES*\n\n:   Specify classes to use for indented code blocks---for example,\n    `perl,numberLines` or `haskell`. Multiple classes may be separated\n    by spaces or commas.\n\n`--default-image-extension=`*EXTENSION*\n\n:   Specify a default extension to use when image paths/URLs have no\n    extension.  This allows you to use the same source for formats that\n    require different kinds of images.  Currently this option only affects\n    the Markdown and LaTeX readers.\n\n`--file-scope[=true|false]`\n\n:   Parse each file individually before combining for multifile\n    documents. This will allow footnotes in different files with the\n    same identifiers to work as expected. If this option is set,\n    footnotes and links will not work across files. Reading binary\n    files (docx, odt, epub) implies `--file-scope`.\n\n    If two or more files are processed using `--file-scope`,\n    prefixes based on the filenames will be added to identifiers\n    in order to disambiguate them, and internal links will\n    be adjusted accordingly.  For example, a header with\n    identifier `foo` in `subdir/file1.txt` will have its\n    identifier changed to `subdir__file1.txt__foo`.\n\n`-F` *PROGRAM*, `--filter=`*PROGRAM*\n\n:   Specify an executable to be used as a filter transforming the\n    pandoc AST after the input is parsed and before the output is\n    written.  The executable should read JSON from stdin and write\n    JSON to stdout.  The JSON must be formatted like  pandoc's own\n    JSON input and output.  The name of the output format will be\n    passed to the filter as the first argument.  Hence,\n\n        pandoc --filter ./caps.py -t latex\n\n    is equivalent to\n\n        pandoc -t json | ./caps.py latex | pandoc -f json -t latex\n\n    The latter form may be useful for debugging filters.\n\n    Filters may be written in any language.  `Text.Pandoc.JSON`\n    exports `toJSONFilter` to facilitate writing filters in Haskell.\n    Those who would prefer to write filters in python can use the\n    module [`pandocfilters`], installable from PyPI. There are also\n    pandoc filter libraries in [PHP], [perl], and\n    [JavaScript/node.js].\n\n    In order of preference, pandoc will look for filters in\n\n     1. a specified full or relative path (executable or\n     non-executable),\n\n     2. `$DATADIR/filters` (executable or non-executable)\n     where `$DATADIR` is the user data directory (see\n     `--data-dir`, above),\n\n     3. `$PATH` (executable only).\n\n    Filters, Lua-filters, and citeproc processing are applied in\n    the order specified on the command line.\n\n`-L` *SCRIPT*, `--lua-filter=`*SCRIPT*\n\n:   Transform the document in a similar fashion as JSON filters (see\n    `--filter`), but use pandoc's built-in Lua filtering system.  The given\n    Lua script is expected to return a list of Lua filters which will be\n    applied in order.  Each Lua filter must contain element-transforming\n    functions indexed by the name of the AST element on which the filter\n    function should be applied.\n\n    The `pandoc` Lua module provides helper functions for element\n    creation.  It is always loaded into the script's Lua environment.\n\n    See the [Lua filters documentation] for further details.\n\n    In order of preference, pandoc will look for Lua filters in\n\n     1. a specified full or relative path,\n\n     2. `$DATADIR/filters` where `$DATADIR` is the user data\n     directory (see `--data-dir`, above).\n\n    Filters, Lua filters, and citeproc processing are applied in\n    the order specified on the command line.\n\n`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]\n\n:   Set the metadata field *KEY* to the value *VAL*.  A value specified\n    on the command line overrides a value specified in the document\n    using [YAML metadata blocks][Extension: `yaml_metadata_block`].\n    Values will be parsed as YAML boolean or string values. If no value is\n    specified, the value will be treated as Boolean true.  Like\n    `--variable`, `--metadata` causes template variables to be set.\n    But unlike `--variable`, `--metadata` affects the metadata of the\n    underlying document (which is accessible from filters and may be\n    printed in some output formats) and metadata values will be escaped\n    when inserted into the template.\n\n`--metadata-file=`*FILE*\n\n:   Read metadata from the supplied YAML (or JSON) file. This\n    option can be used with every input format, but string scalars\n    in the metadata file will always be parsed as Markdown. (If the\n    input format is Markdown or a Markdown variant, then the\n    same variant will be used to parse the metadata file;\n    if it is a non-Markdown format, pandoc's default Markdown\n    extensions will be used.) This option can be used\n    repeatedly to include multiple metadata files; values in\n    files specified later on the command line will be preferred\n    over those specified in earlier files. Metadata values\n    specified inside the document, or by using `-M`, overwrite\n    values specified with this option. The file will be searched\n    for first in the working directory, and then in the `metadata`\n    subdirectory of the user data directory (see `--data-dir`).\n\n`-p`, `--preserve-tabs[=true|false]`\n\n:   Preserve tabs instead of converting them to spaces. (By default, pandoc\n    converts tabs to spaces before parsing its input.)  Note that this will\n    only affect tabs in literal code spans and code blocks. Tabs in regular\n    text are always treated as spaces.\n\n`--tab-stop=`*NUMBER*\n\n:   Specify the number of spaces per tab (default is 4).\n\n`--track-changes=accept`|`reject`|`all`\n\n:   Specifies what to do with insertions, deletions, and comments\n    produced by the MS Word \"Track Changes\" feature.  `accept` (the\n    default) processes all the insertions and deletions.\n    `reject` ignores them.  Both `accept` and `reject` ignore comments.\n    `all` includes all insertions, deletions, and comments, wrapped\n    in spans with `insertion`, `deletion`, `comment-start`, and\n    `comment-end` classes, respectively. The author and time of\n    change is included. `all` is useful for scripting: only\n    accepting changes from a certain reviewer, say, or before a\n    certain date. If a paragraph is inserted or deleted,\n    `track-changes=all` produces a span with the class\n    `paragraph-insertion`/`paragraph-deletion` before the\n    affected paragraph break. This option only affects the docx\n    reader.\n\n`--extract-media=`*DIR*|*FILE*`.zip`\n\n:   Extract images and other media contained in or linked from\n    the source document to the path *DIR*, creating it if\n    necessary, and adjust the images references in the document\n    so they point to the extracted files.  Media are downloaded,\n    read from the file system, or extracted from a binary\n    container (e.g. docx), as needed.  The original file paths\n    are used if they are relative paths not containing `..`.\n    Otherwise filenames are constructed from the SHA1 hash of\n    the contents.\n\n    If the path given ends in `.zip`, then instead of creating\n    a directory, pandoc will create a zip archive containing the\n    media files.\n\n`--abbreviations=`*FILE*\n\n:   Specifies a custom abbreviations file, with abbreviations\n    one to a line.  If this option is not specified, pandoc will\n    read the data file `abbreviations` from the user data\n    directory or fall back on a system default.  To see the\n    system default, use\n    `pandoc --print-default-data-file=abbreviations`.  The only\n    use pandoc makes of this list is in the Markdown reader.\n    Strings found in this list will be followed by a nonbreaking\n    space, and the period will not produce sentence-ending space\n    in formats like LaTeX.  The strings may not contain spaces.\n\n`--trace[=true|false]`\n\n:   Print diagnostic output tracing parser progress to stderr.\n    This option is intended for use by developers in diagnosing\n    performance issues.\n\n[`pandocfilters`]: https://github.com/jgm/pandocfilters\n[PHP]: https://github.com/vinai/pandocfilters-php\n[perl]: https://metacpan.org/pod/Pandoc::Filter\n[JavaScript/node.js]: https://github.com/mvhenderson/pandoc-filter-node\n[Lua filters documentation]: https://pandoc.org/lua-filters.html\n\n## General writer options {.options}\n\n`-s`, `--standalone`\n\n:   Produce output with an appropriate header and footer (e.g. a\n    standalone HTML, LaTeX, TEI, or RTF file, not a fragment).  This option\n    is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`\n    output.  For `native` output, this option causes metadata to\n    be included; otherwise, metadata is suppressed.\n\n`--template=`*FILE*|*URL*\n\n:   Use the specified file as a custom template for the generated document.\n    Implies `--standalone`. See [Templates], below, for a\n    description of template syntax. If the template is not found,\n    pandoc will search for it in the `templates` subdirectory of\n    the user data directory (see `--data-dir`). If no extension\n    is specified and an extensionless template is not found,\n    pandoc will look for a template with an extension\n    corresponding to the writer, so that `--template=special`\n    looks for `special.html` for HTML output. If this option is\n    not used, a default template appropriate for the output\n    format will be used (see `-D/--print-default-template`).\n\n`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`=`*VAL*]\n\n:   Set the template variable *KEY* to the string value *VAL* when rendering\n    the document in standalone mode. Either `:` or `=` may be used\n    to separate *KEY* from *VAL*. If no *VAL* is specified, the\n    key will be given the value `true`.  Structured values (lists, maps)\n    cannot be assigned using this option, but they can be assigned in\n    the `variables` section of a [defaults file][Defaults files] or\n    using the `--variable-json` option. If the variable already has\n    a *list* value, the value will be added to the list. If it already\n    has another kind of value, it will be made into a list containing\n    the previous and the new value. For example,\n    `-V keyword=Joe -V author=Sue` makes `author` contain a list\n    of strings: `Joe` and `Sue`.\n\n`--variable-json=`*KEY*[`=`:*JSON*]\n\n:   Set the template variable *KEY* to the value specified by a JSON\n    string (this may be a boolean, a string, a list, or a mapping;\n    a number will be treated as a string). For example,\n    `--variable-json foo=false` will give `foo` the boolean false\n    value, while `--variable-json foo='\"false\"'` will give it the\n    string value `\"false\"`. Either `:` or `=` may be used to\n    separate *KEY* from *VAL*. If the variable already has a\n    value, this value will be replaced.\n\n`--sandbox[=true|false]`\n\n:   Run pandoc in a sandbox, limiting IO operations in readers\n    and writers to reading the files specified on the command line.\n    Note that this option does not limit IO operations by\n    filters or in the production of PDF documents.  But it does\n    offer security against, for example, disclosure of files\n    through the use of `include` directives.  Anyone using\n    pandoc on untrusted user input should use this option.\n\n    Note: some readers and writers (e.g., `docx`) need access to data\n    files.  If these are stored on the file system, then pandoc\n    will not be able to find them when run in `--sandbox` mode\n    and will raise an error. For these applications, we\n    recommend using a pandoc binary compiled with the `embed_data_files`\n    option, which causes the data files to be baked into the binary\n    instead of being stored on the file system.\n\n`-D` *FORMAT*, `--print-default-template=`*FORMAT*\n\n:   Print the system default template for an output *FORMAT*. (See `-t`\n    for a list of possible *FORMAT*s.)  Templates in the user data\n    directory are ignored.  This option may be used with\n    `-o`/`--output` to redirect output to a file, but\n    `-o`/`--output` must come before `--print-default-template`\n    on the command line.\n\n    Note that some of the default templates use partials, for\n    example `styles.html`.  To print the partials, use\n    `--print-default-data-file`: for example,\n    `--print-default-data-file=templates/styles.html`.\n\n`--print-default-data-file=`*FILE*\n\n:   Print a system default data file.  Files in the user data directory\n    are ignored.  This option may be used with `-o`/`--output` to\n    redirect output to a file, but `-o`/`--output` must come before\n    `--print-default-data-file` on the command line.\n\n`--eol=crlf`|`lf`|`native`\n\n:   Manually specify line endings: `crlf` (Windows), `lf`\n    (macOS/Linux/UNIX), or `native` (line endings appropriate\n    to the OS on which pandoc is being run).  The default is\n    `native`.\n\n`--dpi`=*NUMBER*\n\n:   Specify the default dpi (dots per inch) value for conversion\n    from pixels to inch/centimeters and vice versa. (Technically,\n    the correct term would be ppi: pixels per inch.) The default\n    is 96dpi.   When images contain information about dpi\n    internally, the encoded value is used instead of the default\n    specified by this option.\n\n`--wrap=auto`|`none`|`preserve`\n\n:   Determine how text is wrapped in the output (the source\n    code, not the rendered version).  With `auto` (the default),\n    pandoc will attempt to wrap lines to the column width specified by\n    `--columns` (default 72).  With `none`, pandoc will not wrap\n    lines at all.  With `preserve`, pandoc will attempt to\n    preserve the wrapping from the source document (that is,\n    where there are nonsemantic newlines in the source, there\n    will be nonsemantic newlines in the output as well).\n    In `ipynb` output, this option affects wrapping of the\n    contents of Markdown cells.\n\n`--columns=`*NUMBER*\n\n:   Specify length of lines in characters.  This affects text wrapping\n    in the generated source code (see `--wrap`).  It also affects\n    calculation of column widths for plain text tables (see [Tables] below).\n\n`--toc[=true|false]`, `--table-of-contents[=true|false]`\n\n:   Include an automatically generated table of contents (or, in\n    the case of `latex`, `context`, `docx`, `odt`,\n    `opendocument`, `rst`, or `ms`, an instruction to create\n    one) in the output document. This option has no effect\n    unless `-s/--standalone` is used, and it has no effect\n    on `man`, `docbook4`, `docbook5`, or `jats` output.\n\n    Note that if you are producing a PDF via `ms` and using\n    (the default) `pdfroff` as a `--pdf-engine`, the table\n    of contents will appear at the beginning of the\n    document, before the title.  If you would prefer it to\n    be at the end of the document, use the option\n    `--pdf-engine-opt=--no-toc-relocation`. If `groff` is\n    used as the `--pdf-engine`, the table of contents will\n    always appear at the end of the document.\n\n`--toc-depth=`*NUMBER*\n\n:   Specify the number of section levels to include in the table\n    of contents.  The default is 3 (which means that level-1, 2, and 3\n    headings will be listed in the contents).\n\n`--lof[=true|false]`, `--list-of-figures[=true|false]`\n\n:   Include an automatically generated list of figures (or, in\n    some formats, an instruction to create one) in the output\n    document. This option has no effect unless `-s/--standalone`\n    is used, and it only has an effect on `latex`, `context`, and\n    `docx` output.\n\n`--lot[=true|false]`, `--list-of-tables[=true|false]`\n\n:   Include an automatically generated list of tables (or, in\n    some formats, an instruction to create one) in the output\n    document. This option has no effect unless `-s/--standalone`\n    is used, and it only has an effect on `latex`, `context`, and\n    `docx` output.\n\n`--strip-comments[=true|false]`\n\n:   Strip out HTML comments in the Markdown or Textile source,\n    rather than passing them on to Markdown, Textile or HTML\n    output as raw HTML.  This does not apply to HTML comments\n    inside raw HTML blocks when the `markdown_in_html_blocks`\n    extension is not set.\n\n`--syntax-highlighting=default|none|idiomatic|`*STYLE*`|`*FILE*\n\n:   The method to use for code syntax highlighting. Setting a\n    specific *STYLE* causes highlighting to be performed with the\n    internal highlighting engine, using KDE syntax definitions and\n    styles. The `idiomatic` method uses a format-specific\n    highlighter if one is available, or the default style if the\n    target format has no idiomatic highlighting method. Setting this\n    option to `none` disables all syntax highlighting. The\n    `default` method uses a format-specific default.\n\n    The default for HTML, EPUB, Docx, Ms, Man, and LaTeX output is\n    to use the internal highlighter with the default style; for Typst\n    it is to use Typst's own syntax highlighting system.\n\n    Style options are `pygments` (the default), `kate`,\n    `monochrome`, `breezeDark`, `espresso`, `zenburn`, `haddock`,\n    and `tango`. For more information on syntax highlighting in\n    pandoc, see [Syntax highlighting], below. See also\n    `--list-highlight-styles`.\n\n    Instead of a *STYLE* name, a JSON file with extension\n    `.theme` may be supplied.  This will be parsed as a KDE\n    syntax highlighting theme and (if valid) used as the\n    highlighting style.\n\n    To generate the JSON version of an existing style,\n    use `--print-highlight-style`.\n\n`--no-highlight`\n\n:   *Deprecated, use `--syntax-highlighting=none` instead.*\n\n    Disables syntax highlighting for code blocks and inlines, even when\n    a language attribute is given.\n\n`--highlight-style=`*STYLE*|*FILE*\n\n:   _Deprecated, use `--syntax-highlighting=`*STYLE*|*FILE* instead._\n\n    Specifies the coloring style to be used in highlighted source code.\n\n`--print-highlight-style=`*STYLE*|*FILE*\n\n:   Prints a JSON version of a highlighting style, which can\n    be modified, saved with a `.theme` extension, and used\n    with `--syntax-highlighting`.  This option may be used with\n    `-o`/`--output` to redirect output to a file, but\n    `-o`/`--output` must come before `--print-highlight-style`\n    on the command line.\n\n`--syntax-definition=`*FILE*\n\n:   Instructs pandoc to load a KDE XML syntax definition file,\n    which will be used for syntax highlighting of appropriately\n    marked code blocks.  This can be used to add support for\n    new languages or to use altered syntax definitions for\n    existing languages.  This option may be repeated to add\n    multiple syntax definitions.\n\n`-H` *FILE*, `--include-in-header=`*FILE*|*URL*\n\n:   Include contents of *FILE*, verbatim, at the end of the header.\n    This can be used, for example, to include special\n    CSS or JavaScript in HTML documents.  This option can be used\n    repeatedly to include multiple files in the header.  They will be\n    included in the order specified.  Implies `--standalone`.\n\n`-B` *FILE*, `--include-before-body=`*FILE*|*URL*\n\n:   Include contents of *FILE*, verbatim, at the beginning of the\n    document body (e.g. after the `<body>` tag in HTML, or the\n    `\\begin{document}` command in LaTeX). This can be used to include\n    navigation bars or banners in HTML documents. This option can be\n    used repeatedly to include multiple files. They will be included in\n    the order specified.  Implies `--standalone`. Note that if the\n    output format is `odt`, this file must be in OpenDocument XML format\n    suitable for insertion into the body of the document, and if\n    the output is `docx`, this file must be in appropriate\n    OpenXML format.\n\n`-A` *FILE*, `--include-after-body=`*FILE*|*URL*\n\n:   Include contents of *FILE*, verbatim, at the end of the document\n    body (before the `</body>` tag in HTML, or the\n    `\\end{document}` command in LaTeX). This option can be used\n    repeatedly to include multiple files. They will be included in the\n    order specified.  Implies `--standalone`. Note that if the\n    output format is `odt`, this file must be in OpenDocument XML format\n    suitable for insertion into the body of the document, and if\n    the output is `docx`, this file must be in appropriate\n    OpenXML format.\n\n`--resource-path=`*SEARCHPATH*\n\n:   List of paths to search for images and other resources.\n    The paths should be separated by `:` on Linux, UNIX, and\n    macOS systems, and by `;` on Windows.  If `--resource-path`\n    is not specified, the default resource path is the working\n    directory. Note that, if `--resource-path` is specified,\n    the working directory must be explicitly listed or it\n    will not be searched.  For example:\n    `--resource-path=.:test` will search the working directory\n    and the `test` subdirectory, in that order.\n    This option can be used repeatedly. Search path components\n    that come later on the command line will be searched before\n    those that come earlier, so\n    `--resource-path foo:bar --resource-path baz:bim` is\n    equivalent to `--resource-path baz:bim:foo:bar`.\n    Note that this option only has an effect when pandoc\n    itself needs to find an image (e.g., in producing a\n    PDF or docx, or when `--embed-resources` is used.)\n    It will not cause image paths to be rewritten in other\n    cases (e.g., when pandoc is generating LaTeX or HTML).\n\n`--request-header=`*NAME*`:`*VAL*\n\n:   Set the request header *NAME* to the value *VAL* when making\n    HTTP requests (for example, when a URL is given on the\n    command line, or when resources used in a document must be\n    downloaded). If you're behind a proxy, you also need to set\n    the environment variable `http_proxy` to `http://...`.\n\n`--no-check-certificate[=true|false]`\n\n:   Disable the certificate verification to allow access to\n    unsecure HTTP resources (for example when the certificate\n    is no longer valid or self signed).\n\n## Options affecting specific writers {.options}\n\n`--self-contained[=true|false]`\n\n:   *Deprecated synonym for `--embed-resources --standalone`.*\n\n`--embed-resources[=true|false]`\n\n:   Produce a standalone HTML file with no external dependencies, using\n    `data:` URIs to incorporate the contents of linked scripts, stylesheets,\n    images, and videos. The resulting file should be \"self-contained,\" in the\n    sense that it needs no external files and no net access to be displayed\n    properly by a browser. This option works only with HTML output formats,\n    including `html4`, `html5`, `html+lhs`, `html5+lhs`, `s5`, `slidy`,\n    `slideous`, `dzslides`, and `revealjs`. Scripts, images, and stylesheets at\n    absolute URLs will be downloaded; those at relative URLs will be sought\n    relative to the working directory (if the first source\n    file is local) or relative to the base URL (if the first source\n    file is remote).  Elements with the attribute\n    `data-external=\"1\"` will be left alone; the documents they\n    link to will not be incorporated in the document.\n    Limitation: resources that are loaded dynamically through\n    JavaScript cannot be incorporated; as a result, fonts may\n    be missing when `--mathjax` is used, and some\n    advanced features (e.g.  zoom or speaker notes) may not work\n    in an offline \"self-contained\" `reveal.js` slide show.\n\n    For SVG images, `img` tags with `data:` URIs are used,\n    unless the image has the class `inline-svg`, in which case\n    an inline SVG element is inserted. This approach is\n    recommended when there are many occurrences of the same\n    SVG in a document, as `<use>` elements will be used to\n    reduce duplication.\n\n`--link-images[=true|false]`\n\n:   Include links to images instead of embedding the images in ODT.\n    (This option currently only affects ODT output.)\n\n`--html-q-tags[=true|false]`\n\n:   Use `<q>` tags for quotes in HTML.  (This option only has an\n    effect if the `smart` extension is enabled for the input\n    format used.)\n\n`--ascii[=true|false]`\n\n:   Use only ASCII characters in output. Currently supported for XML\n    and HTML formats (which use entities instead of UTF-8 when this\n    option is selected), CommonMark, gfm, and Markdown (which use\n    entities), roff man and ms (which use hexadecimal escapes), and to a\n    limited degree LaTeX (which uses standard commands for accented\n    characters when possible).\n\n`--reference-links[=true|false]`\n\n:   Use reference-style links, rather than inline links, in writing Markdown\n    or reStructuredText.  By default inline links are used.  The\n    placement of link references is affected by the\n    `--reference-location` option.\n\n`--reference-location=block`|`section`|`document`\n\n:   Specify whether footnotes (and references, if `reference-links` is\n    set) are placed at the end of the current (top-level) block, the\n    current section, or the document. The default is\n    `document`. Currently this option only affects the\n    `markdown`, `muse`, `html`, `epub`, `slidy`, `s5`, `slideous`,\n    `dzslides`, and `revealjs` writers.  In slide formats,\n    specifying `--reference-location=section` will cause notes\n    to be rendered at the bottom of a slide.\n\n`--figure-caption-position=above`|`below`\n\n:   Specify whether figure captions go above or below figures\n    (default is `below`).  This option only affects HTML,\n    LaTeX, Docx, ODT, and Typst output.\n\n`--table-caption-position=above`|`below`\n\n:   Specify whether table captions go above or below tables\n    (default is `above`).  This option only affects HTML,\n    LaTeX, Docx, ODT, and Typst output.\n\n`--markdown-headings=setext`|`atx`\n\n:   Specify whether to use ATX-style (`#`-prefixed) or\n    Setext-style (underlined) headings for level 1 and 2\n    headings in Markdown output.  (The default is `atx`.)\n    ATX-style headings are always used for levels 3+.\n    This option also affects Markdown cells in `ipynb` output.\n\n`--list-tables[=true|false]`\n\n:   Render tables as list tables in RST output.\n\n`--top-level-division=default`|`section`|`chapter`|`part`\n\n:   Treat top-level headings as the given division type in\n    LaTeX, ConTeXt, DocBook, and TEI output. The hierarchy\n    order is part, chapter, then section; all headings are\n    shifted such that the top-level heading becomes the\n    specified type. The default behavior is to determine the\n    best division type via heuristics: unless other conditions\n    apply, `section` is chosen. When the `documentclass`\n    variable is set to `report`, `book`, or `memoir` (unless the\n    `article` option is specified), `chapter` is implied as the\n    setting for this option. If `beamer` is the output format,\n    specifying either `chapter` or `part` will cause top-level\n    headings to become `\\part{..}`, while second-level headings\n    remain as their default type.\n\n    In Docx output, this option adds section breaks before first-level\n    headings if `chapter` is selected, and before first- and second-level\n    headings if `part` is selected. Footnote numbers will restart\n    with each section break unless the reference doc modifies this.\n\n`-N`, `--number-sections=[true|false]`\n\n:   Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB\n    output.  By default, sections are not numbered.  Sections with class\n    `unnumbered` will never be numbered, even if `--number-sections`\n    is specified.\n\n`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]\n\n:   Offsets for section heading numbers. The first number is added\n    to the section number for level-1 headings, the second for\n    level-2 headings, and so on. So, for example, if you\n    want the first level-1 heading in your document to be\n    numbered \"6\" instead of \"1\", specify `--number-offset=5`.\n    If your document starts with a level-2 heading which you want\n    to be numbered \"1.5\", specify `--number-offset=1,4`.\n    `--number-offset` only directly affects the number of the\n    first section heading in a document; subsequent numbers\n    increment in the normal way. Implies `--number-sections`.\n    Currently this feature only affects HTML and Docx output.\n\n`--listings[=true|false]`\n\n:   *Deprecated, use `--syntax-highlighting=idiomatic` or\n    `--syntax-highlighting=default` instead.\n\n    Use the [`listings`] package for LaTeX code blocks. The package\n    does not support multi-byte encoding for source code. To handle UTF-8\n    you would need to use a custom template. This issue is fully\n    documented here: [Encoding issue with the listings package].\n\n`-i`, `--incremental[=true|false]`\n\n:   Make list items in slide shows display incrementally (one by one).\n    The default is for lists to be displayed all at once.\n\n`--slide-level=`*NUMBER*\n\n:   Specifies that headings with the specified level create\n    slides (for `beamer`, `revealjs`, `pptx`, `s5`, `slidy`,\n    `slideous`, `dzslides`). Headings above this level in the\n    hierarchy are used to divide the slide show into sections;\n    headings below this level create subheads within a slide.\n    Valid values are 0-6. If a slide level of 0 is specified,\n    slides will not be split automatically on headings, and\n    horizontal rules must be used to indicate slide boundaries.\n    If a slide level is not specified explicitly, the slide level\n    will be set automatically based on the contents of the\n    document; see [Structuring the slide show].\n\n`--section-divs[=true|false]`\n\n:   Wrap sections in `<section>` tags (or `<div>` tags for `html4`),\n    and attach identifiers to the enclosing `<section>` (or `<div>`)\n    rather than the heading itself (see\n    [Heading identifiers], below). This option only affects\n    HTML output (and does not affect HTML slide formats).\n\n`--email-obfuscation=none`|`javascript`|`references`\n\n:   Specify a method for obfuscating `mailto:` links in HTML documents.\n    `none` leaves `mailto:` links as they are.  `javascript` obfuscates\n    them using JavaScript. `references` obfuscates them by printing their\n    letters as decimal or hexadecimal character references.  The default\n    is `none`.\n\n`--id-prefix=`*STRING*\n\n:   Specify a prefix to be added to all identifiers and internal links\n    in HTML and DocBook output, and to footnote numbers in Markdown\n    and Haddock output. This is useful for preventing duplicate\n    identifiers when generating fragments to be included in other pages.\n\n`-T` *STRING*, `--title-prefix=`*STRING*\n\n:   Specify *STRING* as a prefix at the beginning of the title\n    that appears in the HTML header (but not in the title as it\n    appears at the beginning of the HTML body).  Implies `--standalone`.\n\n`-c` *URL*, `--css=`*URL*\n\n:   Link to a CSS style sheet. This option can be used repeatedly to\n    include multiple files. They will be included in the order specified.\n    This option only affects HTML (including HTML slide shows)\n    and EPUB output.  It should be used together with\n    `-s/--standalone`, because the link to the stylesheet goes\n    in the document header.\n\n    A stylesheet is required for generating EPUB.  If none is\n    provided using this option (or the `css` or `stylesheet`\n    metadata fields), pandoc will look for a file `epub.css` in the\n    user data directory (see `--data-dir`).  If it is not\n    found there, sensible defaults will be used.\n\n[`--reference-doc=`*FILE*|*URL*]{#option--reference-doc}\n\n:   Use the specified file as a style reference in producing a\n    docx or ODT file.\n\n    Docx\n\n    :   For best results, the reference docx should be a modified\n        version of a docx file produced using pandoc.  The contents\n        of the reference docx are ignored, but its stylesheets and\n        document properties (including margins, page size, header,\n        and footer) are used in the new docx. If no reference docx\n        is specified on the command line, pandoc will look for a\n        file `reference.docx` in the user data directory (see\n        `--data-dir`). If this is not found either, sensible\n        defaults will be used.\n\n        To produce a custom `reference.docx`, first get a copy of\n        the default `reference.docx`: `pandoc\n        -o custom-reference.docx --print-default-data-file reference.docx`.\n        Then open `custom-reference.docx` in Word, modify the\n        styles as you wish, and save the file.  For best\n        results, do not make changes to this file other than\n        modifying the styles used by pandoc:\n\n        Paragraph styles:\n\n        - Normal\n        - Body Text\n        - First Paragraph\n        - Compact\n        - Title\n        - Subtitle\n        - Author\n        - Date\n        - Abstract\n        - AbstractTitle\n        - Bibliography\n        - Heading 1\n        - Heading 2\n        - Heading 3\n        - Heading 4\n        - Heading 5\n        - Heading 6\n        - Heading 7\n        - Heading 8\n        - Heading 9\n        - Block Text [for block quotes]\n        - Footnote Block Text [for block quotes in footnotes]\n        - Source Code\n        - Footnote Text\n        - Definition Term\n        - Definition\n        - Caption\n        - Table Caption\n        - Image Caption\n        - Figure\n        - Captioned Figure\n        - TOC Heading\n\n        Character styles:\n\n        - Default Paragraph Font\n        - Verbatim Char\n        - Footnote Reference\n        - Hyperlink\n        - Section Number\n\n        Table style:\n\n        - Table\n\n    ODT\n\n    :   For best results, the reference ODT should be a modified\n        version of an ODT produced using pandoc.  The contents of\n        the reference ODT are ignored, but its stylesheets are used\n        in the new ODT. If no reference ODT is specified on the\n        command line, pandoc will look for a file `reference.odt` in\n        the user data directory (see `--data-dir`). If this is not\n        found either, sensible defaults will be used.\n\n        To produce a custom `reference.odt`, first get a copy of\n        the default `reference.odt`: `pandoc\n        -o custom-reference.odt --print-default-data-file reference.odt`.\n        Then open `custom-reference.odt` in LibreOffice, modify\n        the styles as you wish, and save the file.\n\n    PowerPoint\n\n    :   Templates included with Microsoft PowerPoint 2013 (either with\n        `.pptx` or `.potx` extension) are known to work, as are most\n        templates derived from these.\n\n        The specific requirement is that the template should contain layouts\n        with the following names (as seen within PowerPoint):\n\n        - Title Slide\n        - Title and Content\n        - Section Header\n        - Two Content\n        - Comparison\n        - Content with Caption\n        - Blank\n\n        For each name, the first layout found with that name will be used.\n        If no layout is found with one of the names, pandoc will output a\n        warning and use the layout with that name from the default reference\n        doc instead. (How these layouts are used is described in [PowerPoint\n        layout choice](#powerpoint-layout-choice).)\n\n        All templates included with a recent version of MS PowerPoint\n        will fit these criteria. (You can click on `Layout` under the\n        `Home` menu to check.)\n\n        You can also modify the default `reference.pptx`: first run\n        `pandoc -o custom-reference.pptx --print-default-data-file\n        reference.pptx`, and then modify `custom-reference.pptx`\n        in MS PowerPoint (pandoc will use the layouts with the names\n        listed above).\n\n`--split-level=`*NUMBER*\n\n:   Specify the heading level at which to split an EPUB or\n    chunked HTML document into separate files. The default is to split\n    into chapters at level-1 headings. In the case of EPUB, this\n    option only affects the internal composition of the EPUB, not the way\n    chapters and sections are displayed to users. Some\n    readers may be slow if the chapter files are too large, so for large\n    documents with few level-1 headings, one might want to use a chapter\n    level of 2 or 3. For chunked HTML, this option determines\n    how much content goes in each \"chunk.\"\n\n`--chunk-template=`*PATHTEMPLATE*\n\n:   Specify a template for the filenames in a `chunkedhtml` document.\n    In the template, `%n` will be replaced by the chunk number (padded\n    with leading 0s to 3 digits), `%s` with the section number of the chunk,\n    `%h` with the heading text (with formatting removed), `%i` with\n    the section identifier. For example, `section-%s-%i.html` might\n    be resolved to `section-1.1-introduction.html`. The characters\n    `/` and `\\` are not allowed in chunk templates and will be\n    ignored. The default is `%s-%i.html`.\n\n`--epub-chapter-level=`*NUMBER*\n\n:   *Deprecated synonym for `--split-level`.*\n\n`--epub-cover-image=`*FILE*\n\n:   Use the specified image as the EPUB cover.  It is recommended\n    that the image be less than 1000px in width and height. Note that\n    in a Markdown source document you can also specify `cover-image`\n    in a YAML metadata block (see [EPUB Metadata], below).\n\n`--epub-title-page=true`|`false`\n\n:   Determines whether a the title page is included in the EPUB\n    (default is `true`).\n\n`--epub-metadata=`*FILE*\n\n:   Look in the specified XML file for metadata for the EPUB.\n    The file should contain a series of [Dublin Core elements].\n    For example:\n\n         <dc:rights>Creative Commons</dc:rights>\n         <dc:language>es-AR</dc:language>\n\n    By default, pandoc will include the following metadata elements:\n    `<dc:title>` (from the document title), `<dc:creator>` (from the\n    document authors), `<dc:date>` (from the document date, which should\n    be in [ISO 8601 format]), `<dc:language>` (from the `lang`\n    variable, or, if is not set, the locale), and `<dc:identifier\n    id=\"BookId\">` (a randomly generated UUID). Any of these may be\n    overridden by elements in the metadata file.\n\n    Note: if the source document is Markdown, a YAML metadata block\n    in the document can be used instead.  See below under\n    [EPUB Metadata].\n\n`--epub-embed-font=`*FILE*\n\n:   Embed the specified font in the EPUB. This option can be repeated\n    to embed multiple fonts.  Wildcards can also be used: for example,\n    `DejaVuSans-*.ttf`.  However, if you use wildcards on the command\n    line, be sure to escape them or put the whole filename in single quotes,\n    to prevent them from being interpreted by the shell. To use the\n    embedded fonts, you will need to add declarations like the following\n    to your CSS (see `--css`):\n\n        @font-face {\n           font-family: DejaVuSans;\n           font-style: normal;\n           font-weight: normal;\n           src:url(\"../fonts/DejaVuSans-Regular.ttf\");\n        }\n        @font-face {\n           font-family: DejaVuSans;\n           font-style: normal;\n           font-weight: bold;\n           src:url(\"../fonts/DejaVuSans-Bold.ttf\");\n        }\n        @font-face {\n           font-family: DejaVuSans;\n           font-style: italic;\n           font-weight: normal;\n           src:url(\"../fonts/DejaVuSans-Oblique.ttf\");\n        }\n        @font-face {\n           font-family: DejaVuSans;\n           font-style: italic;\n           font-weight: bold;\n           src:url(\"../fonts/DejaVuSans-BoldOblique.ttf\");\n        }\n        body { font-family: \"DejaVuSans\"; }\n\n`--epub-subdirectory=`*DIRNAME*\n\n:   Specify the subdirectory in the OCF container that is to hold\n    the EPUB-specific contents.  The default is `EPUB`.  To put\n    the EPUB contents in the top level, use an empty string.\n\n`--ipynb-output=all|none|best`\n\n:   Determines how ipynb output cells are treated. `all` means\n    that all of the data formats included in the original are\n    preserved.  `none` means that the contents of data cells\n    are omitted.  `best` causes pandoc to try to pick the\n    richest data block in each output cell that is compatible\n    with the output format.  The default is `best`.\n\n`--pdf-engine=`*PROGRAM*\n\n:   Use the specified engine when producing PDF output.\n    Valid values are `pdflatex`, `lualatex`, `xelatex`, `latexmk`,\n    `tectonic`, `wkhtmltopdf`, `weasyprint`, `pagedjs-cli`,\n    `prince`, `context`, `groff`, `pdfroff`, and `typst`.\n    If the engine is not in your PATH, the full path of the engine\n    may be specified here. If this option is not specified,\n    pandoc uses the following defaults depending on the output\n    format specified using `-t/--to`:\n\n    - `-t latex` or none: `pdflatex` (other options: `xelatex`, `lualatex`,\n        `tectonic`, `latexmk`)\n    - `-t context`: `context`\n    - `-t html`:  `weasyprint` (other options: `prince`, `wkhtmltopdf`,\n        `pagedjs-cli`;\n        see [print-css.rocks](https://print-css.rocks) for a good\n        introduction to PDF generation from HTML/CSS)\n    - `-t ms`:  `pdfroff`\n    - `-t typst`: `typst`\n\n    This option is normally intended to be used when a PDF\n    file is specified as `-o/--output`.  However, it may still\n    have an effect when other output formats are requested.\n    For example, `ms` output will include `.pdfhref` macros\n    only if a `--pdf-engine` is selected, and the macros will\n    be differently encoded depending on whether `groff` or\n    `pdfroff` is specified.\n\n`--pdf-engine-opt=`*STRING*\n\n:   Use the given string as a command-line argument to the `pdf-engine`.\n    For example, to use a persistent directory `foo` for `latexmk`'s\n    auxiliary files, use `--pdf-engine-opt=-outdir=foo`.\n    Note that no check for duplicate options is done.\n\n[Dublin Core elements]: https://www.dublincore.org/specifications/dublin-core/dces/\n[ISO 8601 format]: https://www.w3.org/TR/NOTE-datetime\n[Encoding issue with the listings package]:\n  https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue\n\n## Citation rendering {.options}\n\n`-C`, `--citeproc`\n\n:   Process the citations in the file, replacing them with\n    rendered citations and adding a bibliography.\n    Citation processing will not take place unless bibliographic\n    data is supplied, either through an external file specified\n    using the `--bibliography` option or the `bibliography`\n    field in metadata, or via a `references` section in metadata\n    containing a list of citations in CSL YAML format with\n    Markdown formatting.  The style is controlled by a [CSL]\n    stylesheet specified using the `--csl` option or the `csl`\n    field in metadata. (If no stylesheet is specified,\n    the `chicago-author-date` style will be used by default.)\n    The citation processing transformation may be applied before\n    or after filters or Lua filters (see `--filter`,\n    `--lua-filter`): these transformations are applied in the\n    order they appear on the command line.  For more\n    information, see the section on [Citations].\n\n    Note: if this option is specified, the `citations` extension\n    will be disabled automatically in the writer, to ensure that\n    the citeproc-generated citations will be rendered instead of\n    the format's own citation syntax.\n\n`--bibliography=`*FILE*\n\n:   Set the `bibliography` field in the document's metadata to *FILE*,\n    overriding any value set in the metadata.  If you supply\n    this argument multiple times, each *FILE* will be added to\n    bibliography.  If *FILE* is a URL, it will be fetched\n    via HTTP. If *FILE* is not found relative to the\n    working directory, it will be sought in the resource path\n    (see `--resource-path`).\n\n`--csl=`*FILE*\n\n:   Set the `csl` field in the document's metadata to *FILE*,\n    overriding any value set in the metadata.  (This is equivalent to\n    `--metadata csl=FILE`.)  If *FILE* is a URL, it will be\n    fetched via HTTP.  If *FILE* is not found relative to the\n    working directory, it will be sought in the resource path\n    (see `--resource-path`) and finally in the `csl`\n    subdirectory of the pandoc user data directory.\n\n`--citation-abbreviations=`*FILE*\n\n:   Set the `citation-abbreviations` field in the document's metadata to\n    *FILE*, overriding any value set in the metadata.  (This is equivalent to\n    `--metadata citation-abbreviations=FILE`.)\n    If *FILE* is a URL, it will be fetched via HTTP.  If *FILE* is not\n    found relative to the working directory, it will be sought\n    in the resource path (see `--resource-path`) and finally in\n    the `csl` subdirectory of the pandoc user data directory.\n\n`--natbib`\n\n:   Use [`natbib`] for citations in LaTeX output.  This option\n    is not for use with the `--citeproc` option or with PDF\n    output.  It is intended for use in producing a LaTeX file\n    that can be processed with [`bibtex`].\n\n`--biblatex`\n\n:   Use [`biblatex`] for citations in LaTeX output.  This option\n    is not for use with the `--citeproc` option or with PDF\n    output. It is intended for use in producing a LaTeX file\n    that can be processed with [`bibtex`] or [`biber`].\n\n## Math rendering in HTML {.options}\n\nThe default is to render TeX math as far as possible using\nUnicode characters.  Formulas are put inside a `span` with\n`class=\"math\"`, so that they may be styled differently from the\nsurrounding text if needed. However, this gives acceptable\nresults only for basic math, usually you will want to use\n`--mathjax` or another of the following options.\n\n`--mathjax`[`=`*URL*]\n\n:   Use [MathJax] to display embedded TeX math in HTML output.\n    TeX math will be put between `\\(...\\)` (for inline math)\n    or `\\[...\\]` (for display math) and wrapped in `<span>` tags\n    with class `math`. Then the MathJax JavaScript will render it.\n    The *URL* should point to the `MathJax.js` load script.\n    If a *URL* is not provided, a link to the Cloudflare CDN will\n    be inserted.\n\n`--mathml`\n\n:   Convert TeX math to [MathML] (in `epub3`, `docbook4`,\n    `docbook5`, `jats`, `html4` and `html5`).  This is the\n    default in `odt` output. MathML is supported natively by\n    the main web browsers and select e-book readers.\n\n`--webtex`[`=`*URL*]\n\n:   Convert TeX formulas to `<img>` tags that link to an external script\n    that converts formulas to images. The formula will be URL-encoded\n    and concatenated with the URL provided. For SVG images you can for\n    example use `--webtex https://latex.codecogs.com/svg.latex?`.\n    If no URL is specified, the CodeCogs URL generating PNGs\n    will be used (`https://latex.codecogs.com/png.latex?`).\n    Note:  the `--webtex` option will affect Markdown output\n    as well as HTML, which is useful if you're targeting a\n    version of Markdown without native math support.\n\n`--katex`[`=`*URL*]\n\n:   Use [KaTeX] to display embedded TeX math in HTML output.\n    The *URL* is the base URL for the KaTeX library. That directory\n    should contain a `katex.min.js` and a `katex.min.css` file.\n    If a *URL* is not provided, a link to the KaTeX CDN will be inserted.\n\n`--gladtex`\n\n:   Enclose TeX math in `<eq>` tags in HTML output.  The resulting HTML\n    can then be processed by [GladTeX] to produce SVG images of the typeset\n    formulas and an HTML file with these images embedded.\n\n        pandoc -s --gladtex input.md -o myfile.htex\n        gladtex -d image_dir myfile.htex\n        # produces myfile.html and images in image_dir\n\n[MathML]: https://www.w3.org/Math/\n[MathJax]: https://www.mathjax.org\n[KaTeX]: https://github.com/Khan/KaTeX\n[GladTeX]: https://humenda.github.io/GladTeX/\n\n## Options for wrapper scripts {.options}\n\n`--dump-args[=true|false]`\n\n:   Print information about command-line arguments to *stdout*, then exit.\n    This option is intended primarily for use in wrapper scripts.\n    The first line of output contains the name of the output file specified\n    with the `-o` option, or `-` (for *stdout*) if no output file was\n    specified.  The remaining lines contain the command-line arguments,\n    one per line, in the order they appear.  These do not include regular\n    pandoc options and their arguments, but do include any options appearing\n    after a `--` separator at the end of the line.\n\n`--ignore-args[=true|false]`\n\n:   Ignore command-line arguments (for use in wrapper scripts).\n    Regular pandoc options are not ignored.  Thus, for example,\n\n        pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1\n\n    is equivalent to\n\n        pandoc -o foo.html -s\n\n# Exit codes\n\nIf pandoc completes successfully, it will return exit code 0.\nNonzero exit codes have the following meanings:\n\n Code Error\n----- ------------------------------------\n    1 PandocIOError\n    3 PandocFailOnWarningError\n    4 PandocAppError\n    5 PandocTemplateError\n    6 PandocOptionError\n   21 PandocUnknownReaderError\n   22 PandocUnknownWriterError\n   23 PandocUnsupportedExtensionError\n   24 PandocCiteprocError\n   25 PandocBibliographyError\n   31 PandocEpubSubdirectoryError\n   43 PandocPDFError\n   44 PandocXMLError\n   47 PandocPDFProgramNotFoundError\n   61 PandocHttpError\n   62 PandocShouldNeverHappenError\n   63 PandocSomeError\n   64 PandocParseError\n   66 PandocMakePDFError\n   67 PandocSyntaxMapError\n   83 PandocFilterError\n   84 PandocLuaError\n   89 PandocNoScriptingEngine\n   91 PandocMacroLoop\n   92 PandocUTF8DecodingError\n   93 PandocIpynbDecodingError\n   94 PandocUnsupportedCharsetError\n   95 PandocInputNotTextError\n   97 PandocCouldNotFindDataFileError\n   98 PandocCouldNotFindMetadataFileError\n   99 PandocResourceNotFound\n----- ------------------------------------\n\n# Defaults files\n\nThe `--defaults` option may be used to specify a package\nof options, in the form of a YAML or JSON file. Examples in\nthis section will be given in YAML, but the equivalent forms in\nJSON will also work.\n\nFields that are omitted will just have their regular\ndefault values.  So a defaults file can be as simple as\none line:\n\n``` yaml\nverbosity: INFO\n```\n\nor in JSON:\n\n``` json\n{ \"verbosity\": \"INFO\" }\n```\n\nIn fields that expect a file path (or list of file paths), the\nfollowing syntax may be used to interpolate environment variables:\n\n``` yaml\ncsl:  ${HOME}/mycsldir/special.csl\n```\n\n`${USERDATA}` may also be used; this will always resolve to the\nuser data directory that is current when the defaults file is\nparsed, regardless of the setting of the environment\nvariable `USERDATA`.\n\n`${.}` will resolve to the directory containing the defaults\nfile itself.  This allows you to refer to resources contained\nin that directory:\n\n``` yaml\nepub-cover-image: ${.}/cover.jpg\nepub-metadata: ${.}/meta.xml\nresource-path:\n- .             # the working directory from which pandoc is run\n- ${.}/images   # the images subdirectory of the directory\n                # containing this defaults file\n```\n\nThis environment variable interpolation syntax *only* works in\nfields that expect file paths.\n\nDefaults files can be placed in the `defaults` subdirectory of\nthe user data directory and used from any directory.  For\nexample, one could create a file specifying defaults for writing\nletters, save it as `letter.yaml` in the `defaults` subdirectory\nof the user data directory, and then invoke these defaults\nfrom any directory using `pandoc --defaults letter`\nor `pandoc -dletter`.\n\nWhen multiple defaults are used, their contents will be combined.\n\nNote that, where command-line arguments may be repeated\n(`--metadata-file`, `--css`, `--include-in-header`,\n`--include-before-body`, `--include-after-body`, `--variable`,\n`--metadata`, `--syntax-definition`), the values specified on\nthe command line will combine with values specified in the\ndefaults file, rather than replacing them.\n\nThe following tables show the mapping between the command line and\ndefaults file entries.\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| foo.md                           | input-file: foo.md                |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| foo.md bar.md                    | input-files:                      |\n|                                  |   - foo.md                        |\n|                                  |   - bar.md                        |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\nThe value of `input-files` may be left empty to indicate input from\nstdin, and it can be an empty sequence `[]` for no input.\n\n## General options\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --from markdown+emoji            | from: markdown+emoji              |\n| ```                              | ```                               |\n|                                  | ``` yaml                          |\n|                                  | reader: markdown+emoji            |\n|                                  | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --to markdown+hard_line_breaks   | to: markdown+hard_line_breaks     |\n| ```                              | ```                               |\n|                                  | ``` yaml                          |\n|                                  | writer: markdown+hard_line_breaks |\n|                                  | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --output foo.pdf                 | output-file: foo.pdf              |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --output -                       | output-file:                      |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --data-dir dir                   | data-dir: dir                     |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --defaults file                  | defaults:                         |\n| ```                              | - file                            |\n|                                  | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --verbose                        | verbosity: INFO                   |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --quiet                          | verbosity: ERROR                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --fail-if-warnings               | fail-if-warnings: true            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --sandbox                        | sandbox: true                     |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --log=FILE                       | log-file: FILE                    |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\nOptions specified in a defaults file itself always have priority over\nthose in another file included with a `defaults:` entry.\n\n`verbosity` can have the values `ERROR`, `WARNING`, or `INFO`.\n\n## Reader options\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --shift-heading-level-by -1      | shift-heading-level-by: -1        |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --indented-code-classes python   | indented-code-classes:            |\n|                                  |   - python                        |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --default-image-extension \".jpg\" | default-image-extension: '.jpg'   |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --file-scope                     | file-scope: true                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --citeproc \\                     | filters:                          |\n|  --lua-filter count-words.lua \\  |   - citeproc                      |\n|  --filter special.lua            |   - count-words.lua               |\n|                                  |   - type: json                    |\n|                                  |     path: special.lua             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --metadata key=value \\           | metadata:                         |\n|  --metadata key2                 |   key: value                      |\n|                                  |   key2: true                      |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --metadata-file meta.yaml        | metadata-files:                   |\n|                                  |   - meta.yaml                     |\n| ```                              | ```                               |\n|                                  | ``` yaml                          |\n|                                  | metadata-file: meta.yaml          |\n|                                  | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --preserve-tabs                  | preserve-tabs: true               |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --tab-stop 8                     | tab-stop: 8                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --track-changes accept           | track-changes: accept             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --extract-media dir              | extract-media: dir                |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --abbreviations abbrevs.txt      | abbreviations: abbrevs.txt        |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --trace                          | trace: true                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\nMetadata values specified in a defaults file are parsed as literal\nstring text, not Markdown.\n\nFilters will be assumed to be Lua filters if they have the `.lua`\nextension, and JSON filters otherwise.  But the filter type can also be\nspecified explicitly, as shown.  Filters are run in the order specified.\nTo include the built-in citeproc filter, use either `citeproc` or\n`{type: citeproc}`.\n\n## General writer options\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --standalone                     | standalone: true                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --template letter                | template: letter                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --variable key=val \\             | variables:                        |\n|   --variable key2                |   key: val                        |\n|                                  |   key2: true                      |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --eol nl                         | eol: nl                           |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --dpi 300                        | dpi: 300                          |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --wrap preserve                  | wrap: \"preserve\"                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --columns 72                     | columns: 72                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --table-of-contents              | table-of-contents: true           |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --toc                            | toc: true                         |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --toc-depth 3                    | toc-depth: 3                      |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --strip-comments                 | strip-comments: true              |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --no-highlight                   | syntax-highlighting: 'none'       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --syntax-highlighting kate       | syntax-highlighting: kate         |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --syntax-definition mylang.xml   | syntax-definitions:               |\n|                                  |   - mylang.xml                    |\n| ```                              | ```                               |\n|                                  | ``` yaml                          |\n|                                  | syntax-definition: mylang.xml     |\n|                                  | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --include-in-header inc.tex      | include-in-header:                |\n|                                  |   - inc.tex                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --include-before-body inc.tex    | include-before-body:              |\n|                                  |   - inc.tex                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --include-after-body inc.tex     | include-after-body:               |\n|                                  |   - inc.tex                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --resource-path .:foo            | resource-path: ['.','foo']        |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --request-header foo:bar         | request-headers:                  |\n|                                  |   - [\"User-Agent\", \"Mozilla/5.0\"] |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --no-check-certificate           | no-check-certificate: true        |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\n\n## Options affecting specific writers\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --self-contained                 | self-contained: true              |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --link-images                    | link-images: true                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --html-q-tags                    | html-q-tags: true                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --ascii                          | ascii: true                       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --reference-links                | reference-links: true             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --reference-location block       | reference-location: block         |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --figure-caption-position=above  | figure-caption-position: above    |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --table-caption-position=below   | table-caption-position: below     |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --markdown-headings atx          | markdown-headings: atx            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --list-tables                    | list-tables: true                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --top-level-division chapter     | top-level-division: chapter       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --number-sections                | number-sections: true             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --number-offset=1,4              | number-offset: \\[1,4\\]            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --listings                       | listings: true                    |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --list-of-figures                | list-of-figures: true             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --lof                            | lof: true                         |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --list-of-tables                 | list-of-tables: true              |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --lot                            | lot: true                         |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --incremental                    | incremental: true                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --slide-level 2                  | slide-level: 2                    |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --section-divs                   | section-divs: true                |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --email-obfuscation references   | email-obfuscation: references     |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --id-prefix ch1                  | identifier-prefix: ch1            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --title-prefix MySite            | title-prefix: MySite              |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --css styles/screen.css  \\       | css:                              |\n|   --css styles/special.css       |   - styles/screen.css             |\n|                                  |   - styles/special.css            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --reference-doc my.docx          | reference-doc: my.docx            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --epub-cover-image cover.jpg     | epub-cover-image: cover.jpg       |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --epub-title-page=false          | epub-title-page: false            |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --epub-metadata meta.xml         | epub-metadata: meta.xml           |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --epub-embed-font special.otf \\  | epub-fonts:                       |\n|   --epub-embed-font headline.otf |   - special.otf                   |\n|                                  |   - headline.otf                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --split-level 2                  | split-level: 2                    |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --chunk-template=\"%i.html\"       | chunk-template: \"%i.html\"         |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --epub-subdirectory=\"\"           | epub-subdirectory: ''             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --ipynb-output best              | ipynb-output: best                |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --pdf-engine xelatex             | pdf-engine: xelatex               |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --pdf-engine-opt=--shell-escape  | pdf-engine-opts:                  |\n|                                  |   - '-shell-escape'               |\n| ```                              | ```                               |\n|                                  | ``` yaml                          |\n|                                  | pdf-engine-opt: '-shell-escape'   |\n|                                  | ```                               |\n+----------------------------------+-----------------------------------+\n\n## Citation rendering\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --citeproc                       | citeproc: true                    |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --bibliography logic.bib         | bibliography: logic.bib           |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --csl ieee.csl                   | csl: ieee.csl                     |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --citation-abbreviations ab.json | citation-abbreviations: ab.json   |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --natbib                         | cite-method: natbib               |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --biblatex                       | cite-method: biblatex             |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\n`cite-method` can be `citeproc`, `natbib`, or `biblatex`. This only\naffects LaTeX output.  If you want to use citeproc to format citations,\nyou should also set 'citeproc: true'.\n\nIf you need control over when the citeproc processing is done relative\nto other filters, you should instead use `citeproc` in the list\nof `filters` (see [Reader options](#reader-options-1)).\n\n## Math rendering in HTML\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --mathjax                        | html-math-method:                 |\n|                                  |   method: mathjax                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --mathml                         | html-math-method:                 |\n|                                  |   method: mathml                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --webtex                         | html-math-method:                 |\n|                                  |   method: webtex                  |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --katex                          | html-math-method:                 |\n|                                  |   method: katex                   |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --gladtex                        | html-math-method:                 |\n|                                  |   method: gladtex                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\nIn addition to the values listed above, `method` can have the\nvalue `plain`.\n\nIf the command line option accepts a URL argument, an `url:` field can\nbe added to `html-math-method:`.\n\n## Options for wrapper scripts\n\n+----------------------------------+-----------------------------------+\n| command line                     | defaults file                     |\n+:=================================+:==================================+\n| ```                              | ``` yaml                          |\n| --dump-args                      | dump-args: true                   |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n| ```                              | ``` yaml                          |\n| --ignore-args                    | ignore-args: true                 |\n| ```                              | ```                               |\n+----------------------------------+-----------------------------------+\n\n# Templates\n\nWhen the `-s/--standalone` option is used, pandoc uses a template to\nadd header and footer material that is needed for a self-standing\ndocument.  To see the default template that is used, just type\n\n    pandoc -D *FORMAT*\n\nwhere *FORMAT* is the name of the output format. A custom template\ncan be specified using the `--template` option.  You can also override\nthe system default templates for a given output format *FORMAT*\nby putting a file `templates/default.*FORMAT*` in the user data\ndirectory (see `--data-dir`, above). *Exceptions:*\n\n- For `odt` output, customize the `default.opendocument` template.\n- For `docx` output, customize the `default.openxml` template.\n- For `pdf` output, customize the `default.latex` template\n  (or the `default.context` template, if you use `-t context`,\n  or the `default.ms` template, if you use `-t ms`, or the\n  `default.html` template, if you use `-t html`).\n- `pptx` has no template.\n\nNote that `docx`, `odt`, and `pptx` output can also be customized\nusing `--reference-doc`.  Use a reference doc to adjust the styles\nin your document; use a template to handle variable interpolation and\ncustomize the presentation of metadata, the position of the table\nof contents, boilerplate text, etc.\n\nTemplates contain *variables*, which allow for the inclusion of\narbitrary information at any point in the file. They may be set at the\ncommand line using the `-V/--variable` option. If a variable is not set,\npandoc will look for the key in the document's metadata, which can be set\nusing either [YAML metadata blocks][Extension: `yaml_metadata_block`]\nor with the `-M/--metadata` option.  In addition, some variables\nare given default values by pandoc.  See [Variables] below for\na list of variables used in pandoc's default templates.\n\nIf you use custom templates, you may need to revise them as pandoc\nchanges.  We recommend tracking the changes in the default templates,\nand modifying your custom templates accordingly. An easy way to do this\nis to fork the [pandoc-templates] repository and merge in\nchanges after each pandoc release.\n\n  [pandoc-templates]: https://github.com/jgm/pandoc-templates\n\n## Template syntax\n\n### Comments\n\nAnything between the sequence `$--` and the end of the\nline will be treated as a comment and omitted from the output.\n\n### Delimiters\n\nTo mark variables and control structures in the template,\neither `$`...`$` or `${`...`}` may be used as delimiters.\nThe styles may also be mixed in the same template, but the\nopening and closing delimiter must match in each case.  The\nopening delimiter may be followed by one or more spaces\nor tabs, which will be ignored. The closing delimiter may\nbe preceded by one or more spaces or tabs, which will be\nignored.\n\nTo include a literal `$` in the document, use `$$`.\n\n### Interpolated variables\n\nA slot for an interpolated variable is a variable name surrounded\nby matched delimiters.  Variable names must begin with a letter\nand can contain letters, numbers, `_`, `-`, and `.`.  The\nkeywords `it`, `if`, `else`, `endif`, `for`, `sep`, and `endfor` may\nnot be used as variable names. Examples:\n\n```\n$foo$\n$foo.bar.baz$\n$foo_bar.baz-bim$\n$ foo $\n${foo}\n${foo.bar.baz}\n${foo_bar.baz-bim}\n${ foo }\n```\n\nVariable names with periods are used to get at structured\nvariable values.  So, for example, `employee.salary` will return the\nvalue of the `salary` field of the object that is the value of\nthe `employee` field.\n\n- If the value of the variable is a simple value, it will be\n  rendered verbatim.  (Note that no escaping is done;\n  the assumption is that the calling program will escape\n  the strings appropriately for the output format.)\n- If the value is a list, the values will be concatenated.\n- If the value is a map, the string `true` will be rendered.\n- Every other value will be rendered as the empty string.\n\n### Conditionals\n\nA conditional begins with `if(variable)` (enclosed in\nmatched delimiters) and ends with `endif` (enclosed in matched\ndelimiters).  It may optionally contain an `else` (enclosed in\nmatched delimiters).  The `if` section is used if\n`variable` has a true value, otherwise the `else`\nsection is used (if present).  The following values count\nas true:\n\n- any map\n- any array containing at least one true value\n- any nonempty string\n- boolean True\n\nNote that in YAML metadata (and metadata specified on the\ncommand line using `-M/--metadata`), unquoted `true` and `false` will be\ninterpreted as Boolean values. But a variable specified on the\ncommand line using `-V/--variable` will always be given a string\nvalue. Hence a conditional `if(foo)` will be triggered if you\nuse `-V foo=false`, but not if you use `-M foo=false`.\n\nExamples:\n\n```\n$if(foo)$bar$endif$\n\n$if(foo)$\n  $foo$\n$endif$\n\n$if(foo)$\npart one\n$else$\npart two\n$endif$\n\n${if(foo)}bar${endif}\n\n${if(foo)}\n  ${foo}\n${endif}\n\n${if(foo)}\n${ foo.bar }\n${else}\nno foo!\n${endif}\n```\n\nThe keyword `elseif` may be used to simplify complex nested\nconditionals:\n\n```\n$if(foo)$\nXXX\n$elseif(bar)$\nYYY\n$else$\nZZZ\n$endif$\n```\n\n### For loops\n\nA for loop begins with `for(variable)` (enclosed in\nmatched delimiters) and ends with `endfor` (enclosed in matched\ndelimiters).\n\n- If `variable` is an array, the material inside the loop will\n  be evaluated repeatedly, with `variable` being set to each\n  value of the array in turn, and concatenated.\n- If `variable` is a map, the material inside will be set to\n  the map.\n- If the value of the associated variable is not an array or\n  a map, a single iteration will be performed on its value.\n\nExamples:\n\n```\n$for(foo)$$foo$$sep$, $endfor$\n\n$for(foo)$\n  - $foo.last$, $foo.first$\n$endfor$\n\n${ for(foo.bar) }\n  - ${ foo.bar.last }, ${ foo.bar.first }\n${ endfor }\n\n$for(mymap)$\n$it.name$: $it.office$\n$endfor$\n```\n\nYou may optionally specify a separator between consecutive\nvalues using `sep` (enclosed in matched delimiters).  The\nmaterial between `sep` and the `endfor` is the separator.\n\n```\n${ for(foo) }${ foo }${ sep }, ${ endfor }\n```\n\nInstead of using `variable` inside the loop, the special\nanaphoric keyword `it` may be used.\n\n```\n${ for(foo.bar) }\n  - ${ it.last }, ${ it.first }\n${ endfor }\n```\n\n### Partials\n\nPartials (subtemplates stored in different files) may be\nincluded by using the name of the partial, followed\nby `()`, for example:\n\n```\n${ styles() }\n```\n\nPartials will be sought in the directory containing\nthe main template. The file name will be assumed to\nhave the same extension as the main template if it\nlacks an extension. When calling the partial, the\nfull name including file extension can also be used:\n\n```\n${ styles.html() }\n```\n\n(If a partial is not found in the directory of the\ntemplate and the template path is given as a relative\npath, it will also be sought in the `templates`\nsubdirectory of the user data directory.)\n\nPartials may optionally be applied to variables using\na colon:\n\n```\n${ date:fancy() }\n\n${ articles:bibentry() }\n```\n\nIf `articles` is an array, this will iterate over its\nvalues, applying the partial `bibentry()` to each one.  So the\nsecond example above is equivalent to\n\n```\n${ for(articles) }\n${ it:bibentry() }\n${ endfor }\n```\n\nNote that the anaphoric keyword `it` must be used when\niterating over partials.  In the above examples,\nthe `bibentry` partial should contain `it.title`\n(and so on) instead of `articles.title`.\n\nFinal newlines are omitted from included partials.\n\nPartials may include other partials.\n\nA separator between values of an array may be specified\nin square brackets, immediately after the variable name\nor partial:\n\n```\n${months[, ]}\n\n${articles:bibentry()[; ]}\n```\n\nThe separator in this case is literal and (unlike with `sep`\nin an explicit `for` loop) cannot contain interpolated\nvariables or other template directives.\n\n### Nesting\n\nTo ensure that content is \"nested,\" that is, subsequent lines\nindented, use the `^` directive:\n\n```\n$item.number$  $^$$item.description$ ($item.price$)\n```\n\nIn this example, if `item.description` has multiple lines,\nthey will all be indented to line up with the first line:\n\n```\n00123  A fine bottle of 18-year old\n       Oban whiskey. ($148)\n```\n\nTo nest multiple lines to the same level, align them\nwith the `^` directive in the template. For example:\n\n```\n$item.number$  $^$$item.description$ ($item.price$)\n               (Available til $item.sellby$.)\n```\n\nwill produce\n\n```\n00123  A fine bottle of 18-year old\n       Oban whiskey. ($148)\n       (Available til March 30, 2020.)\n```\n\nIf a variable occurs by itself on a line, preceded by whitespace\nand not followed by further text or directives on the same line,\nand the variable's value contains multiple lines, it will be\nnested automatically.\n\n### Breakable spaces\n\nNormally, spaces in the template itself (as opposed to values of\nthe interpolated variables) are not breakable, but they can be\nmade breakable in part of the template by using the `~` keyword\n(ended with another `~`).\n\n```\n$~$This long line may break if the document is rendered\nwith a short line length.$~$\n```\n\n### Pipes\n\nA pipe transforms the value of a variable or partial. Pipes are\nspecified using a slash (`/`) between the variable name (or partial)\nand the pipe name. Example:\n\n```\n$for(name)$\n$name/uppercase$\n$endfor$\n\n$for(metadata/pairs)$\n- $it.key$: $it.value$\n$endfor$\n\n$employee:name()/uppercase$\n```\n\nPipes may be chained:\n\n```\n$for(employees/pairs)$\n$it.key/alpha/uppercase$. $it.name$\n$endfor$\n```\n\nSome pipes take parameters:\n\n```\n|----------------------|------------|\n$for(employee)$\n$it.name.first/uppercase/left 20 \"| \"$$it.name.salary/right 10 \" | \" \" |\"$\n$endfor$\n|----------------------|------------|\n```\n\nCurrently the following pipes are predefined:\n\n- `pairs`:  Converts a map or array to an array of maps,\n  each with `key` and `value` fields.  If the original\n  value was an array, the `key` will be the array index,\n  starting with 1.\n\n- `uppercase`:  Converts text to uppercase.\n\n- `lowercase`:  Converts text to lowercase.\n\n- `length`:  Returns the length of the value:  number\n  of characters for a textual value, number of elements\n  for a map or array.\n\n- `reverse`:  Reverses a textual value or array,\n  and has no effect on other values.\n\n- `first`: Returns the first value of an array, if\n  applied to a non-empty array; otherwise returns\n  the original value.\n\n- `last`: Returns the last value of an array, if\n  applied to a non-empty array; otherwise returns\n  the original value.\n\n- `rest`: Returns all but the first value of an array, if\n  applied to a non-empty array; otherwise returns\n  the original value.\n\n- `allbutlast`: Returns all but the last value of an array, if\n  applied to a non-empty array; otherwise returns\n  the original value.\n\n- `chomp`:  Removes trailing newlines (and breakable space).\n\n- `nowrap`:  Disables line wrapping on breakable spaces.\n\n- `alpha`:  Converts textual values that can be\n  read as an integer into lowercase alphabetic\n  characters `a..z` (mod 26). This can be used to get lettered\n  enumeration from array indices.  To get uppercase\n  letters, chain with `uppercase`.\n\n- `roman`:  Converts textual values that can be\n  read as an integer into lowercase roman numerals.\n  This can be used to get lettered enumeration from array indices.\n  To get uppercase roman, chain with `uppercase`.\n\n- `left n \"leftborder\" \"rightborder\"`:  Renders a textual value\n  in a block of width `n`, aligned to the left, with an optional\n  left and right border.  Has no effect on other values. This\n  can be used to align material in tables.  Widths are positive\n  integers indicating the number of characters.  Borders\n  are strings inside double quotes; literal `\"` and `\\` characters\n  must be backslash-escaped.\n\n- `right n \"leftborder\" \"rightborder\"`:  Renders a textual value\n  in a block of width `n`, aligned to the right, and has no\n  effect on other values.\n\n- `center n \"leftborder\" \"rightborder\"`:  Renders a textual\n  value in a block of width `n`, aligned to the center, and has\n  no effect on other values.\n\n\n## Variables\n\n### Metadata variables\n\n`title`, `author`, `date`\n:   allow identification of basic aspects of the document.  Included\n    in PDF metadata through LaTeX and ConTeXt.  These can be set\n    through a [pandoc title block][Extension: `pandoc_title_block`],\n    which allows for multiple authors, or through a\n    [YAML metadata block][Extension: `yaml_metadata_block`]:\n\n        ---\n        author:\n        - Aristotle\n        - Peter Abelard\n        ...\n\n    Note that if you just want to set PDF or HTML metadata, without\n    including a title block in the document itself, you can\n    set the `title-meta`, `author-meta`, and `date-meta`\n    variables.  (By default these are set automatically, based\n    on `title`, `author`, and `date`.) The page title in HTML\n    is set by `pagetitle`, which is equal to `title` by default.\n\n`subtitle`\n:   document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx\n    documents\n\n`abstract`\n:   document summary, included in HTML, LaTeX, ConTeXt, AsciiDoc, and docx\n    documents\n\n`abstract-title`\n:   title of abstract, currently used only in HTML, EPUB, docx, and Typst.\n    This will be set automatically to a localized value,\n    depending on `lang`, but can be manually overridden.\n\n`keywords`\n:   list of keywords to be included in HTML, PDF, ODT, pptx, docx\n    and AsciiDoc metadata; repeat as for `author`, above\n\n`subject`\n:   document subject, included in ODT, PDF, docx, EPUB, and pptx metadata\n\n`description`\n:   document description, included in ODT, docx and pptx metadata. Some\n    applications show this as `Comments` metadata.\n\n`category`\n:   document category, included in docx and pptx metadata\n\nAdditionally,\nany root-level string metadata, not included in ODT, docx\nor pptx metadata is added as a *custom property*.\nThe following [YAML] metadata block for instance:\n\n    ---\n    title:  'This is the title'\n    subtitle: \"This is the subtitle\"\n    author:\n    - Author One\n    - Author Two\n    description: |\n        This is a long\n        description.\n\n        It consists of two paragraphs\n    ...\n\nwill include `title`, `author` and `description` as standard document\nproperties and `subtitle` as a custom property when converting to docx,\nODT or pptx.\n\n### Language variables\n\n`lang`\n:   identifies the main language of the document using IETF language\n    tags (following the [BCP 47] standard), such as `en` or `en-GB`.\n    The [Language subtag lookup] tool can look up or verify these tags.\n    This affects most formats, and controls hyphenation in PDF output\n    when using LaTeX (through [`babel`] and [`polyglossia`]) or ConTeXt.\n\n    Use native pandoc [Divs and Spans] with the `lang` attribute to\n    switch the language:\n\n        ---\n        lang: en-GB\n        ...\n\n        Text in the main document language (British English).\n\n        ::: {lang=fr-CA}\n        > Cette citation est écrite en français canadien.\n        :::\n\n        More text in English. ['Zitat auf Deutsch.']{lang=de}\n\n`dir`\n:   the base script direction, either `rtl` (right-to-left)\n    or `ltr` (left-to-right).\n\n    For bidirectional documents, native pandoc `span`s and\n    `div`s with the `dir` attribute (value `rtl` or `ltr`) can\n    be used to override the base direction in some output\n    formats.  This may not always be necessary if the final\n    renderer (e.g. the browser, when generating HTML) supports\n    the [Unicode Bidirectional Algorithm].\n\n    When using LaTeX for bidirectional documents, only the\n    `xelatex` engine is fully supported (use\n    `--pdf-engine=xelatex`).\n\n[BCP 47]: https://tools.ietf.org/html/bcp47\n[Unicode Bidirectional Algorithm]: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics\n[Language subtag lookup]: https://r12a.github.io/app-subtags/\n\n### Variables for HTML\n\n`document-css`\n:   Enables inclusion of most of the [CSS] in the `styles.html`\n    [partial](#partials) (have a look with\n    `pandoc --print-default-data-file=templates/styles.html`).\n    Unless you use `--css`, this variable\n    is set to `true` by default. You can disable it with\n    e.g. `pandoc -M document-css=false`.\n\n`mainfont`\n:   sets the CSS `font-family` property on the `html` element.\n\n`fontsize`\n:   sets the base CSS `font-size`, which you'd usually set\n    to e.g. `20px`, but it also accepts `pt`\n    (12pt = 16px in most browsers).\n\n`fontcolor`\n:   sets the CSS `color` property on the `html` element.\n\n`linkcolor`\n:   sets the CSS `color` property on all links.\n\n`monofont`\n:   sets the CSS `font-family` property on `code` elements.\n\n`monobackgroundcolor`\n:   sets the CSS `background-color` property on `code` elements\n    and adds extra padding.\n\n`linestretch`\n:   sets the CSS `line-height` property on the `html` element,\n    which is preferred to be unitless.\n\n`maxwidth`\n:   sets the CSS `max-width` property (default is 36em).\n\n`backgroundcolor`\n:   sets the CSS `background-color` property on the `html` element.\n\n`margin-left`, `margin-right`, `margin-top`, `margin-bottom`\n:   sets the corresponding CSS `padding` properties on the `body` element.\n\nTo override or extend some [CSS] for just one document, include for example:\n\n    ---\n    header-includes: |\n      <style>\n      blockquote {\n        font-style: italic;\n      }\n      tr.even {\n        background-color: #f0f0f0;\n      }\n      td, th {\n        padding: 0.5em 2em 0.5em 0.5em;\n      }\n      tbody {\n        border-bottom: none;\n      }\n      </style>\n    ---\n\n[CSS]: https://developer.mozilla.org/en-US/docs/Learn/CSS\n\n### Variables for HTML math\n\n`classoption`\n:   when using `--katex`, you can render display math equations\n    flush left using [YAML metadata](#layout) or with `-M\n    classoption=fleqn`.\n\n### Variables for HTML slides\n\nThese affect HTML output when [producing slide shows with\npandoc](#slide-shows).\n\n`institute`\n:   author affiliations: can be a list when there are multiple authors\n\n`revealjs-url`\n:   base URL for reveal.js documents (defaults to\n    `https://unpkg.com/reveal.js@^5`)\n\n`s5-url`\n:   base URL for S5 documents (defaults to `s5/default`)\n\n`slidy-url`\n:   base URL for Slidy documents (defaults to\n    `https://www.w3.org/Talks/Tools/Slidy2`)\n\n`slideous-url`\n:   base URL for Slideous documents (defaults to `slideous`)\n\n`title-slide-attributes`\n:   additional attributes for the title slide of reveal.js slide shows.\n    See [background in reveal.js, beamer, and pptx] for an example.\n\n`highlightjs-theme`\n:   highlight.js theme for code highlighting when using\n    `--syntax-highlighting=idiomatic` with reveal.js (defaults to\n    `monokai`). See the [highlight.js demo page] for available themes.\n\n[highlight.js demo page]: https://highlightjs.org/demo\n\nAll [reveal.js configuration options] are available as variables.\nTo turn off boolean flags that default to true in reveal.js, use `0`.\n\n[reveal.js configuration options]: https://revealjs.com/config/\n\n### Variables for Beamer slides\n\nThese variables change the appearance of PDF slides using [`beamer`].\n\n`aspectratio`\n:   slide aspect ratio (`43` for 4:3 [default], `169` for 16:9,\n    `1610` for 16:10, `149` for 14:9, `141` for 1.41:1, `54` for 5:4,\n    `32` for 3:2)\n\n`beameroption`\n:   add extra beamer option with `\\setbeameroption{}`\n\n`institute`\n:   author affiliations: can be a list when there are multiple authors\n\n`logo`\n:   logo image for slides\n\n`logooptions`\n:   options for logo image (e.g., `width`, `height`)\n\n`navigation`\n:   controls navigation symbols (default is `empty` for no navigation\n    symbols; other valid values are `frame`, `vertical`, and `horizontal`)\n\n`section-titles`\n:   enables \"title pages\" for new sections (default is true)\n\n`theme`, `colortheme`, `fonttheme`, `innertheme`, `outertheme`\n:   beamer themes\n\n`themeoptions`, `colorthemeoptions`, `fontthemeoptions`, `innerthemeoptions`, `outerthemeoptions`\n:   options for LaTeX beamer themes (lists)\n\n`titlegraphic`\n:   image for title slide: can be a list\n\n`titlegraphicoptions`\n:   options for title slide image (e.g., `width`, `height`)\n\n`shorttitle`, `shortsubtitle`, `shortauthor`, `shortinstitute`, `shortdate`\n:   some beamer themes use short versions of the title, subtitle, author,\n    institute, date\n\n### Variables for PowerPoint\n\nThese variables control the visual aspects of a slide show that\nare not easily controlled via templates.\n\n`monofont`\n:   font to use for code.\n\n### Variables for LaTeX\n\nPandoc uses these variables when [creating a PDF] with a LaTeX engine.\n\n#### Layout\n\n`block-headings`\n:   make `\\paragraph` and `\\subparagraph` (fourth- and\n    fifth-level headings, or fifth- and sixth-level with book\n    classes) free-standing rather than run-in; requires further\n    formatting to distinguish from `\\subsubsection` (third- or\n    fourth-level headings). Instead of using this option,\n    [KOMA-Script] can adjust headings more extensively:\n\n        ---\n        documentclass: scrartcl\n        header-includes: |\n          \\RedeclareSectionCommand[\n            beforeskip=-10pt plus -2pt minus -1pt,\n            afterskip=1sp plus -1sp minus 1sp,\n            font=\\normalfont\\itshape]{paragraph}\n          \\RedeclareSectionCommand[\n            beforeskip=-10pt plus -2pt minus -1pt,\n            afterskip=1sp plus -1sp minus 1sp,\n            font=\\normalfont\\scshape,\n            indent=0pt]{subparagraph}\n        ...\n\n`classoption`\n:   option for document class, e.g. `oneside`; repeat for multiple options:\n\n        ---\n        classoption:\n        - twocolumn\n        - landscape\n        ...\n\n`documentclass`\n:   document class: usually one of the standard classes,\n    [`article`], [`book`], and [`report`]; the [KOMA-Script]\n    equivalents, `scrartcl`, `scrbook`, and `scrreprt`, which\n    default to smaller margins; or [`memoir`]\n\n`geometry`\n:   option for [`geometry`] package, e.g. `margin=1in`;\n    repeat for multiple options:\n\n        ---\n        geometry:\n        - top=30mm\n        - left=20mm\n        - heightrounded\n        ...\n\n`shorthands`\n:   Enable language-specific shorthands when loading `babel`.\n    (By default, pandoc includes `shorthands=off` when loading\n    `babel`, disabling language-specific shorthands.)\n\n`hyperrefoptions`\n:   option for [`hyperref`] package, e.g. `linktoc=all`;\n    repeat for multiple options:\n\n        ---\n        hyperrefoptions:\n        - linktoc=all\n        - pdfwindowui\n        - pdfpagemode=FullScreen\n        ...\n\n`indent`\n:   if true, pandoc will use document class settings for\n    indentation (the default LaTeX template otherwise removes\n    indentation and adds space between paragraphs)\n\n`linestretch`\n:   adjusts line spacing using the [`setspace`]\n    package, e.g. `1.25`, `1.5`\n\n`margin-left`, `margin-right`, `margin-top`, `margin-bottom`\n:   sets margins if `geometry` is not used (otherwise `geometry`\n    overrides these)\n\n`pagestyle`\n:   control `\\pagestyle{}`: the default article class\n    supports `plain` (default), `empty` (no running heads or page numbers),\n    and `headings` (section titles in running heads)\n\n`papersize`\n:   paper size, e.g. `letter`, `a4`\n\n`secnumdepth`\n:   numbering depth for sections (with `--number-sections` option\n    or `numbersections` variable)\n\n`beamerarticle`\n:   produce an article from Beamer slides.  Note: if you set\n    this variable, you must specify the beamer writer but use the\n    default *LaTeX* template: for example,\n    `pandoc -Vbeamerarticle -t beamer --template default.latex`.\n\n`handout`\n:   produce a handout version of Beamer slides (with overlays condensed\n    into single slides)\n\n`csquotes`\n:   load `csquotes` package and use `\\enquote` or `\\enquote*` for quoted text.\n\n`csquotesoptions`\n:   options to use for `csquotes` package (repeat for multiple options).\n\n`babeloptions`\n:   options to pass to the babel package (may be repeated for\n    multiple options). This defaults to `provide=*` if the main\n    language isn't a European language written with Latin or\n    Cyrillic script or Vietnamese. Most users will not need to\n    adjust the default setting.\n\n#### Fonts\n\n`fontenc`\n:   allows font encoding to be specified through `fontenc` package (with\n    `pdflatex`); default is `T1` (see [LaTeX font encodings guide])\n\n`fontfamily`\n:   font package for use with `pdflatex`:\n    [TeX Live] includes many options, documented in the [LaTeX Font Catalogue].\n    The default is [Latin Modern][`lm`].\n\n`fontfamilyoptions`\n:   options for package used as `fontfamily`; repeat for multiple options.\n    For example, to use the Libertine font with proportional lowercase\n    (old-style) figures through the [`libertinus`] package:\n\n        ---\n        fontfamily: libertinus\n        fontfamilyoptions:\n        - osf\n        - p\n        ...\n\n`fontsize`\n:   font size for body text. The standard classes allow 10pt, 11pt, and\n    12pt.  To use another size, set `documentclass` to one of\n    the [KOMA-Script] classes, such as `scrartcl` or `scrbook`.\n\n`mainfont`, `sansfont`, `monofont`, `mathfont`, `CJKmainfont`, `CJKsansfont`, `CJKmonofont`\n:   font families for use with `xelatex` or\n    `lualatex`: take the name of any system font, using the\n    [`fontspec`] package.  `CJKmainfont` uses the [`xecjk`] package if `xelatex` is used,\n    or the [`luatexja`] package if `lualatex` is used.\n\n`mainfontoptions`, `sansfontoptions`, `monofontoptions`, `mathfontoptions`, `CJKoptions`, `luatexjapresetoptions`\n:   options to use with `mainfont`, `sansfont`, `monofont`, `mathfont`,\n    `CJKmainfont` in `xelatex` and `lualatex`.  Allow for any\n    choices available through [`fontspec`]; repeat for multiple\n    options. For example, to use the [TeX Gyre] version of\n    Palatino with lowercase figures:\n\n        ---\n        mainfont: TeX Gyre Pagella\n        mainfontoptions:\n        - Numbers=Lowercase\n        - Numbers=Proportional\n        ...\n\n`mainfontfallback`, `sansfontfallback`, `monofontfallback`\n:   fonts to try if a glyph isn't found in `mainfont`, `sansfont`, or `monofont`\n    respectively. These are lists. The font name must be followed by a colon\n    and optionally a set of options, for example:\n\n        ---\n        mainfontfallback:\n          - \"FreeSans:\"\n          - \"NotoColorEmoji:mode=harf\"\n        ...\n\n    Font fallbacks currently only work with `lualatex`.\n\n`babelfonts`\n:   a map of Babel language names (e.g. `chinese`) to the font\n    to be used with the language:\n\n        ---\n        babelfonts:\n          chinese-hant: \"Noto Serif CJK TC\"\n          russian: \"Noto Serif\"\n        ...\n\n`microtypeoptions`\n:    options to pass to the microtype package\n\n#### Links\n\n`colorlinks`\n:   add color to link text; automatically enabled if any of\n    `linkcolor`, `filecolor`, `citecolor`, `urlcolor`, or `toccolor` are set\n\n`boxlinks`\n:   add visible box around links (has no effect if `colorlinks` is set)\n\n`linkcolor`, `filecolor`, `citecolor`, `urlcolor`, `toccolor`\n:   color for internal links, external links, citation links, linked\n    URLs, and links in table of contents, respectively: uses options\n    allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and\n    `x11names` lists\n\n`links-as-notes`\n:   causes links to be printed as footnotes\n\n`urlstyle`\n:   style for URLs (e.g., `tt`, `rm`, `sf`, and, the default, `same`)\n\n#### Front matter\n\n`lof`, `lot`\n:   include list of figures, list of tables (can also be set using\n    `--lof/--list-of-figures`, `--lot/--list-of-tables`)\n\n`thanks`\n:   contents of acknowledgments footnote after document title\n\n`toc`\n:   include table of contents (can also be set using\n    `--toc/--table-of-contents`)\n\n`toc-depth`\n:   level of section to include in table of contents\n\n#### BibLaTeX Bibliographies\n\nThese variables function when using BibLaTeX for [citation rendering].\n\n`biblatexoptions`\n:   list of options for biblatex\n\n`biblio-style`\n:   bibliography style, when used with `--natbib` and `--biblatex`\n\n`biblio-title`\n:   bibliography title, when used with `--natbib` and `--biblatex`\n\n`bibliography`\n:   bibliography to use for resolving references\n\n`natbiboptions`\n:   list of options for natbib\n\n#### Other\n\n`pdf-trailer-id`\n:   the PDF trailer ID; must be two PDF byte strings if set,\n    conventionally with 16 bytes each. E.g.,\n    `<00112233445566778899aabbccddeeff>\n    <00112233445566778899aabbccddeeff>`.\n\n    See the section on [reproducible builds].\n\n`pdfstandard`\n:   PDF standard(s) for the document, e.g. `ua-2`, `a-4f`.\n    Supports PDF/A, PDF/X, and PDF/UA variants.\n    Requires LuaLaTeX and LaTeX 2023+. Repeat for multiple standards:\n\n        ---\n        pdfstandard:\n        - ua-2\n        - a-4f\n        ...\n\n[KOMA-Script]: https://ctan.org/pkg/koma-script\n[LaTeX Font Catalogue]: https://tug.org/FontCatalogue/\n[LaTeX font encodings guide]: https://ctan.org/pkg/encguide\n[TeX Gyre]: http://www.gust.org.pl/projects/e-foundry/tex-gyre\n[`article`]: https://ctan.org/pkg/article\n[`book`]: https://ctan.org/pkg/book\n[`libertinus`]: https://ctan.org/pkg/libertinus\n[`memoir`]: https://ctan.org/pkg/memoir\n[`report`]: https://ctan.org/pkg/report\n\n### Variables for ConTeXt\n\nPandoc uses these variables when [creating a PDF] with ConTeXt.\n\n`fontsize`\n:   font size for body text (e.g. `10pt`, `12pt`)\n\n`headertext`, `footertext`\n:   text to be placed in running header or footer (see [ConTeXt Headers and\n    Footers]); repeat up to four times for different placement\n\n`indenting`\n:   controls indentation of paragraphs, e.g. `yes,small,next` (see\n    [ConTeXt Indentation]); repeat for multiple options\n\n`interlinespace`\n:   adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);\n    repeat for multiple options\n\n`layout`\n:   options for page margins and text arrangement (see [ConTeXt Layout]);\n    repeat for multiple options\n\n`linkcolor`, `contrastcolor`\n:   color for links outside and inside a page, e.g. `red`, `blue` (see\n    [ConTeXt Color])\n\n`linkstyle`\n:   typeface style for links, e.g. `normal`, `bold`, `slanted`, `boldslanted`,\n    `type`, `cap`, `small`\n\n`lof`, `lot`\n:   include list of figures, list of tables\n\n`mainfont`, `sansfont`, `monofont`, `mathfont`\n:   font families: take the name of any system font (see\n    [ConTeXt Font Switching])\n\n`mainfontfallback`, `sansfontfallback`, `monofontfallback`\n:   list of fonts to try, in order, if a glyph is not found in the\n    main font. Use `\\definefallbackfamily`-compatible font name syntax.\n    Emoji fonts are unsupported.\n\n`margin-left`, `margin-right`, `margin-top`, `margin-bottom`\n:   sets margins, if `layout` is not used (otherwise `layout`\n    overrides these)\n\n`pagenumbering`\n:   page number style and location (using [`setuppagenumbering`]);\n    repeat for multiple options\n\n`papersize`\n:   paper size, e.g. `letter`, `A4`, `landscape` (see [ConTeXt Paper Setup]);\n    repeat for multiple options\n\n`pdfa`\n:   adds to the preamble the setup necessary to generate PDF/A\n    of the type specified, e.g. `1a:2005`, `2a`. If no type is\n    specified (i.e. the value is set to True, by e.g.\n    `--metadata=pdfa` or `pdfa: true` in a YAML metadata block),\n    `1b:2005` will be used as default, for reasons of backwards\n    compatibility. Using `--variable=pdfa` without specified value\n    is not supported.  To successfully generate PDF/A the required\n    ICC color profiles have to be available and the content and all\n    included files (such as images) have to be standard-conforming.\n    The ICC profiles and output intent may be specified using the\n    variables `pdfaiccprofile` and `pdfaintent`.  See also [ConTeXt\n    PDFA] for more details.\n\n`pdfaiccprofile`\n:   when used in conjunction with `pdfa`, specifies the ICC profile to use\n    in the PDF, e.g. `default.cmyk`. If left unspecified, `sRGB.icc` is\n    used as default. May be repeated to include multiple profiles. Note that\n    the profiles have to be available on the system. They can be obtained\n    from [ConTeXt ICC Profiles].\n\n`pdfaintent`\n:   when used in conjunction with `pdfa`, specifies the output intent for\n    the colors, e.g. `ISO coated v2 300\\letterpercent\\space (ECI)`\n    If left unspecified, `sRGB IEC61966-2.1` is used as default.\n\n`toc`\n:   include table of contents (can also be set using\n    `--toc/--table-of-contents`)\n\n`urlstyle`\n:   typeface style for links without link text, e.g. `normal`, `bold`, `slanted`, `boldslanted`,\n    `type`, `cap`, `small`\n\n`whitespace`\n:   spacing between paragraphs, e.g. `none`, `small` (using\n    [`setupwhitespace`])\n\n`includesource`\n:   include all source documents as file attachments in the PDF file\n\n[ConTeXt Paper Setup]: https://wiki.contextgarden.net/Document_layout_and_layers/Paper_setup\n[ConTeXt Layout]: https://wiki.contextgarden.net/Document_layout_and_layers/Tutorials\n[ConTeXt Font Switching]: https://wiki.contextgarden.net/Characters_words_and_fonts/Tutorials\n[ConTeXt Color]: https://wiki.contextgarden.net/Color\n[ConTeXt Headers and Footers]: https://wiki.contextgarden.net/Document_layout_and_layers/Headers_and_footers\n[ConTeXt Indentation]: https://wiki.contextgarden.net/Text_blocks/Typography/Indentation\n[ConTeXt PDFA]: https://wiki.contextgarden.net/Input_and_compilation/PDF/PDFA\n[ConTeXt ICC Profiles]: https://wiki.contextgarden.net/Input_and_compilation/PDF/PDFX#ICC_profiles\n[`setupwhitespace`]: https://wiki.contextgarden.net/Command/setupwhitespace\n[`setupinterlinespace`]: https://wiki.contextgarden.net/Command/setupinterlinespace\n[`setuppagenumbering`]: https://wiki.contextgarden.net/Command/setuppagenumbering\n\n### Variables for `wkhtmltopdf`\n\nPandoc uses these variables when [creating a PDF] with [`wkhtmltopdf`].\nThe `--css` option also affects the output.\n\n`footer-html`, `header-html`\n:   add information to the header and footer\n\n`margin-left`, `margin-right`, `margin-top`, `margin-bottom`\n:   set the page margins\n\n`papersize`\n:   sets the PDF paper size\n\n### Variables for man pages\n\n`adjusting`\n:   adjusts text to left (`l`), right (`r`), center (`c`),\n    or both (`b`) margins\n\n`footer`\n:   footer in man pages\n\n`header`\n:   header in man pages\n\n`section`\n:   section number in man pages\n\n### Variables for Texinfo\n\n`version`\n:   version of software (used in title and title page)\n\n`filename`\n:   name of info file to be generated (defaults to a name based on the\n    texi filename)\n\n### Variables for Typst\n\n`template`\n:   Typst template to use (relative path only).\n\n`margin`\n:   A dictionary with the fields defined in the Typst documentation:\n    `x`, `y`, `top`, `bottom`, `left`, `right`.\n\n`papersize`\n:    Paper size: `a4`, `us-letter`, etc.\n\n`mainfont`\n:    Name of system font to use for the main font.\n\n`fontsize`\n:    Font size (e.g., `12pt`).\n\n`section-numbering`\n:    Schema to use for numbering sections, e.g. `1.A.1`.\n\n`page-numbering`\n:    Schema to use for numbering pages, e.g. `1` or `i`, or\n     an empty string to omit page numbering.\n\n`columns`\n:    Number of columns for body text.\n\n`thanks`\n:   contents of acknowledgments footnote after document title\n\n`mathfont`, `codefont`\n:    Name of system font to use for math and code, respectively.\n\n`linestretch`\n:   adjusts line spacing, e.g. `1.25`, `1.5`\n\n`linkcolor`, `filecolor`, `citecolor`\n:   color for external links, internal links, and citation links,\n    respectively: expects a hexadecimal color code\n\n### Variables for ms\n\n`fontfamily`\n:   `A` (Avant Garde), `B` (Bookman), `C` (Helvetica), `HN`\n    (Helvetica Narrow), `P` (Palatino), or `T` (Times New Roman).\n    This setting does not affect source code, which is always\n    displayed using monospace Courier. These built-in fonts are\n    limited in their coverage of characters. Additional fonts may\n    be installed using the script [`install-font.sh`] provided\n    by Peter Schaffter and documented in detail on [his web\n    site][ms-font-steps].\n\n`indent`\n:   paragraph indent (e.g. `2m`)\n\n`lineheight`\n:   line height (e.g. `12p`)\n\n`pointsize`\n:   point size (e.g. `10p`)\n\n[`install-font.sh`]: https://www.schaffter.ca/mom/bin/install-font.sh\n[ms-font-steps]: https://www.schaffter.ca/mom/momdoc/appendices.html#steps\n\n### Variables set automatically\n\nPandoc sets these variables automatically in response to [options] or\ndocument contents; users can also modify them. These vary depending\non the output format, and include the following:\n\n`body`\n:   body of document\n\n`date-meta`\n:   the `date` variable converted to ISO 8601 YYYY-MM-DD,\n    included in all HTML based formats (dzslides, epub,\n    html, html4, html5, revealjs, s5, slideous, slidy).\n    The recognized formats for `date` are: `mm/dd/yyyy`,\n    `mm/dd/yy`, `yyyy-mm-dd` (ISO 8601), `dd MM yyyy`\n    (e.g. either `02 Apr 2018` or `02 April 2018`),\n    `MM dd, yyyy` (e.g. `Apr. 02, 2018` or `April 02, 2018),\n    `yyyy[mm[dd]]` (e.g. `20180402, `201804` or `2018`).\n\n`header-includes`\n:   contents specified by `-H/--include-in-header` (may have multiple\n    values)\n\n`include-before`\n:   contents specified by `-B/--include-before-body` (may have\n    multiple values)\n\n`include-after`\n:   contents specified by `-A/--include-after-body` (may have\n    multiple values)\n\n`meta-json`\n:   JSON representation of all of the document's metadata. Field\n    values are transformed to the selected output format.\n\n`numbersections`\n:   non-null value if `-N/--number-sections` was specified\n\n`sourcefile`, `outputfile`\n:   source and destination filenames, as given on the command line.\n    `sourcefile` can also be a list if input comes from multiple files,\n    or empty if input is from stdin. You can use the following snippet in\n    your template to distinguish them:\n\n        $if(sourcefile)$\n        $for(sourcefile)$\n        $sourcefile$\n        $endfor$\n        $else$\n        (stdin)\n        $endif$\n\n    Similarly, `outputfile` can be `-` if output goes to the terminal.\n\n    If you need absolute paths, use e.g. `$curdir$/$sourcefile$`.\n\n`pdf-engine`\n:   name of PDF engine if provided using `--pdf-engine`, or the\n    default engine for the format if PDF output is requested.\n\n`curdir`\n:   working directory from which pandoc is run.\n\n`pandoc-version`\n:   pandoc version.\n\n`toc`\n:   non-null value if `--toc/--table-of-contents` was specified\n\n`toc-title`\n:   title of table of contents (works only with EPUB,\n    HTML, revealjs, opendocument, odt, docx, pptx, beamer, LaTeX).\n    Note that in docx and pptx a custom `toc-title` will be\n    picked up from metadata, but cannot be set as a variable.\n\n[pandoc-templates]: https://github.com/jgm/pandoc-templates\n\n# Extensions\n\nThe behavior of some of the readers and writers can be adjusted by\nenabling or disabling various extensions.\n\nAn extension can be enabled by adding `+EXTENSION`\nto the format name and disabled by adding `-EXTENSION`. For example,\n`--from markdown_strict+footnotes` is strict Markdown with footnotes\nenabled, while `--from markdown-footnotes-pipe_tables` is pandoc's\nMarkdown without footnotes or pipe tables.\n\nThe Markdown reader and writer make by far the most use of extensions.\nExtensions only used by them are therefore covered in the\nsection [Pandoc's Markdown] below (see [Markdown variants] for\n`commonmark` and `gfm`). In the following, extensions that also work\nfor other formats are covered.\n\nNote that Markdown extensions added to the `ipynb` format\naffect Markdown cells in Jupyter notebooks (as do command-line\noptions like `--markdown-headings`).\n\n## Typography\n\n### Extension: `smart` ###\n\nInterpret straight quotes as curly quotes, `---` as em-dashes,\n`--` as en-dashes, and `...` as ellipses. Nonbreaking spaces are\ninserted after certain abbreviations, such as \"Mr.\"\n\nThis extension can be enabled/disabled for the following formats:\n\ninput formats\n:  `markdown`, `commonmark`, `latex`, `mediawiki`, `org`, `rst`, `twiki`,\n   `html`\n\noutput formats\n:  `markdown`, `latex`, `context`, `org`, `rst`\n\nenabled by default in\n:  `markdown`, `latex`, `context` (both input and output)\n\nNote: If you are *writing* Markdown, then the `smart` extension\nhas the reverse effect: what would have been curly quotes comes\nout straight.\n\nIn LaTeX, `smart` means to use the standard TeX ligatures\nfor quotation marks (` `` ` and ` '' ` for double quotes,\n`` ` `` and `` ' `` for single quotes) and dashes (`--` for\nen-dash and `---` for em-dash).  If `smart` is disabled,\nthen in reading LaTeX pandoc will parse these characters\nliterally.  In writing LaTeX, enabling `smart` tells pandoc\nto use the ligatures when possible; if `smart` is disabled\npandoc will use unicode quotation mark and dash characters.\n\n## Headings and sections\n\n### Extension: `auto_identifiers` ###\n\nA heading without an explicitly specified identifier will be\nautomatically assigned a unique identifier based on the heading text.\n\nThis extension can be enabled/disabled for the following formats:\n\ninput formats\n:  `markdown`, `latex`, `rst`, `mediawiki`, `textile`\n\noutput formats\n:  `markdown`, `muse`\n\nenabled by default in\n:  `markdown`, `muse`\n\nThe default algorithm used to derive the identifier from the\nheading text is:\n\n  - Remove all formatting, links, etc.\n  - Remove all footnotes.\n  - Remove all non-alphanumeric characters,\n    except underscores, hyphens, and periods.\n  - Replace all spaces and newlines with hyphens.\n  - Convert all alphabetic characters to lowercase.\n  - Remove everything up to the first letter (identifiers may\n    not begin with a number or punctuation mark).\n  - If nothing is left after this, use the identifier `section`.\n\nThus, for example,\n\n  Heading                           Identifier\n  -------------------------------   ----------------------------\n  `Heading identifiers in HTML`     `heading-identifiers-in-html`\n  `Maître d'hôtel`                  `maître-dhôtel`\n  `*Dogs*?--in *my* house?`         `dogs--in-my-house`\n  `[HTML], [S5], or [RTF]?`         `html-s5-or-rtf`\n  `3. Applications`                 `applications`\n  `33`                              `section`\n\nThese rules should, in most cases, allow one to determine the identifier\nfrom the heading text. The exception is when several headings have the\nsame text; in this case, the first will get an identifier as described\nabove; the second will get the same identifier with `-1` appended; the\nthird with `-2`; and so on.\n\n(However, a different algorithm is used if\n`gfm_auto_identifiers` is enabled; see below.)\n\nThese identifiers are used to provide link targets in the table of\ncontents generated by the `--toc|--table-of-contents` option. They\nalso make it easy to provide links from one section of a document to\nanother. A link to this section, for example, might look like this:\n\n    See the section on\n    [heading identifiers](#heading-identifiers-in-html-latex-and-context).\n\nNote, however, that this method of providing links to sections works\nonly in HTML, LaTeX, and ConTeXt formats.\n\nIf the `--section-divs` option is specified, then each section will\nbe wrapped in a `section` (or a `div`, if `html4` was specified),\nand the identifier will be attached to the enclosing `<section>`\n(or `<div>`) tag rather than the heading itself. This allows entire\nsections to be manipulated using JavaScript or treated differently in\nCSS.\n\n### Extension: `ascii_identifiers` ###\n\nCauses the identifiers produced by `auto_identifiers` to be pure ASCII.\nAccents are stripped off of accented Latin letters, and non-Latin\nletters are omitted.\n\n### Extension: `gfm_auto_identifiers` ###\n\nChanges the algorithm used by `auto_identifiers` to conform to\nGitHub's method.  Spaces are converted to dashes (`-`),\nuppercase characters to lowercase characters, and punctuation\ncharacters other than `-` and `_` are removed.\nEmojis are replaced by their names.\n\n## Math Input\n\nThe extensions [`tex_math_dollars`](#extension-tex_math_dollars),\n[`tex_math_gfm`](#extension-tex_math_gfm),\n[`tex_math_single_backslash`](#extension-tex_math_single_backslash), and\n[`tex_math_double_backslash`](#extension-tex_math_double_backslash)\nare described in the section about Pandoc's Markdown.\n\nHowever, they can also be used with HTML input. This is handy for\nreading web pages formatted using MathJax, for example.\n\n## Raw HTML/TeX\n\nThe following extensions are described in more detail in\ntheir respective sections of [Pandoc's Markdown]:\n\n- [`raw_html`](#extension-raw_html) allows HTML elements which\n  are not representable in pandoc's AST to be parsed as raw HTML.\n  By default, this is disabled for HTML input.\n\n- [`raw_tex`](#extension-raw_tex) allows raw LaTeX, TeX, and ConTeXt\n  to be included in a document.  This extension can be enabled/disabled\n  for the following formats (in addition to `markdown`):\n\n  input formats\n  :  `latex`, `textile`, `html` (environments, `\\ref`, and\n     `\\eqref` only), `ipynb`\n\n  output formats\n  :  `textile`, `commonmark`\n\n  Note: as applied to `ipynb`, `raw_html` and `raw_tex` affect not\n  only raw TeX in Markdown cells, but data with mime type\n  `text/html` in output cells.  Since the `ipynb` reader attempts\n  to preserve the richest possible outputs when several options\n  are given, you will get best results if you disable `raw_html`\n  and `raw_tex` when converting to formats like `docx` which don't\n  allow raw `html` or `tex`.\n\n- [`native_divs`](#extension-native_divs) causes HTML `div`\n  elements to be parsed as native pandoc Div blocks.\n  If you want them to be parsed as raw HTML, use\n  `-f html-native_divs+raw_html`.\n\n- [`native_spans`](#extension-native_spans) causes HTML `span`\n  elements to be parsed as native pandoc Span inlines.\n  If you want them to be parsed as raw HTML, use\n  `-f html-native_spans+raw_html`.  If you want to drop all\n  `div`s and `span`s when converting HTML to Markdown, you\n  can use `pandoc -f html-native_divs-native_spans -t markdown`.\n\n## Literate Haskell support\n\n### Extension: `literate_haskell` ###\n\nTreat the document as literate Haskell source.\n\nThis extension can be enabled/disabled for the following formats:\n\ninput formats\n:  `markdown`, `rst`, `latex`\n\noutput formats\n:  `markdown`, `rst`, `latex`, `html`\n\nIf you append `+lhs` (or `+literate_haskell`) to one of the formats\nabove, pandoc will treat the document as literate Haskell source.\nThis means that\n\n  - In Markdown input, \"bird track\" sections will be parsed as Haskell\n    code rather than block quotations.  Text between `\\begin{code}`\n    and `\\end{code}` will also be treated as Haskell code.  For\n    ATX-style headings the character '=' will be used instead of '#'.\n\n  - In Markdown output, code blocks with classes `haskell` and `literate`\n    will be rendered using bird tracks, and block quotations will be\n    indented one space, so they will not be treated as Haskell code.\n    In addition, headings will be rendered setext-style (with underlines)\n    rather than ATX-style (with '#' characters). (This is because ghc\n    treats '#' characters in column 1 as introducing line numbers.)\n\n  - In restructured text input, \"bird track\" sections will be parsed\n    as Haskell code.\n\n  - In restructured text output, code blocks with class `haskell` will\n    be rendered using bird tracks.\n\n  - In LaTeX input, text in `code` environments will be parsed as\n    Haskell code.\n\n  - In LaTeX output, code blocks with class `haskell` will be rendered\n    inside `code` environments.\n\n  - In HTML output, code blocks with class `haskell` will be rendered\n    with class `literatehaskell` and bird tracks.\n\nExamples:\n\n    pandoc -f markdown+lhs -t html\n\nreads literate Haskell source formatted with Markdown conventions and writes\nordinary HTML (without bird tracks).\n\n    pandoc -f markdown+lhs -t html+lhs\n\nwrites HTML with the Haskell code in bird tracks, so it can be copied\nand pasted as literate Haskell source.\n\nNote that GHC expects the bird tracks in the first column, so indented\nliterate code blocks (e.g. inside an itemized environment) will not be\npicked up by the Haskell compiler.\n\n## Other extensions\n\n### Extension: `empty_paragraphs` ###\n\nAllows empty paragraphs.  By default empty paragraphs are\nomitted.\n\nThis extension can be enabled/disabled for the following formats:\n\ninput formats\n:  `docx`, `html`\n\noutput formats\n:  `docx`, `odt`, `opendocument`, `html`, `latex`\n\n### Extension: `native_numbering` ###\n\nEnables native numbering of figures and tables. Enumeration\nstarts at 1.\n\nThis extension can be enabled/disabled for the following formats:\n\noutput formats\n:  `odt`, `opendocument`, `docx`\n\n### Extension: `xrefs_name` ###\n\nLinks to headings, figures and tables inside the document are\nsubstituted with cross-references that will use the name or caption\nof the referenced item. The original link text is replaced once\nthe generated document is refreshed. This extension can be combined\nwith `xrefs_number` in which case numbers will appear before the\nname.\n\nText in cross-references is only made consistent with the referenced\nitem once the document has been refreshed.\n\nThis extension can be enabled/disabled for the following formats:\n\noutput formats\n:  `odt`, `opendocument`\n\n### Extension: `xrefs_number` ###\n\nLinks to headings, figures and tables inside the document are\nsubstituted with cross-references that will use the number\nof the referenced item. The original link text is discarded.\nThis extension can be combined with `xrefs_name` in which case\nthe name or caption numbers will appear after the number.\n\nFor the `xrefs_number` to be useful heading numbers must be enabled\nin the generated document, also table and figure captions must be enabled\nusing for example the `native_numbering` extension.\n\nNumbers in cross-references are only visible in the final document once\nit has been refreshed.\n\nThis extension can be enabled/disabled for the following formats:\n\noutput formats\n:  `odt`, `opendocument`\n\n### Extension: `styles` ### {#ext-styles}\n\nWhen converting from docx, add `custom-styles` attributes\nfor all docx styles, regardless of whether pandoc understands\nthe meanings of these styles. Because attributes cannot be\nadded directly to paragraphs or text in the pandoc AST,\nparagraph styles will cause Divs to be created and character\nstyles will cause Spans to be created to hold the attributes.\n(Table styles will be added to the Table elements directly.)\nThis extension can be used with [docx custom styles](#custom-styles).\n\ninput formats\n:  `docx`\n\n### Extension: `amuse` ###\n\nIn the `muse` input format, this enables Text::Amuse\nextensions to Emacs Muse markup.\n\n### Extension: `raw_markdown` ###\n\nIn the `ipynb` input format, this causes Markdown cells\nto be included as raw Markdown blocks (allowing lossless\nround-tripping) rather than being parsed.  Use this only\nwhen you are targeting `ipynb` or a Markdown-based\noutput format.\n\n### Extension: `citations` (typst) {#typst-citations}\n\nWhen the `citations` extension is enabled in `typst`\n(as it is by default), `typst` citations will\nbe parsed as native pandoc citations, and native\npandoc citations will be rendered as `typst` citations.\n\n### Extension: `citations` (org) {#org-citations}\n\nWhen the `citations` extension is enabled in `org`,\norg-cite and org-ref style citations will be parsed as\nnative pandoc citations, and org-cite citations will\nbe used to render native pandoc citations.\n\n  [org-cite]: https://orgmode.org/manual/Citations.html\n  [org-ref]:  https://github.com/jkitchin/org-ref\n\n### Extension: `citations` (docx) {#docx-citations}\n\nWhen `citations` is enabled in `docx`, citations inserted\nby Zotero or Mendeley or EndNote plugins will be parsed as native\npandoc citations.  (Otherwise, the formatted citations generated\nby the bibliographic software will be parsed as regular text.)\n\n### Extension: `fancy_lists` (org) {#org-fancy-lists}\n\nSome aspects of [Pandoc's Markdown fancy lists](#extension-fancy_lists) are also\naccepted in `org` input, mimicking the option `org-list-allow-alphabetical` in\nEmacs. As in Org Mode, enabling this extension allows lowercase and uppercase\nalphabetical markers for ordered lists to be parsed in addition to arabic ones.\nNote that for Org, this does not include roman numerals or the `#` placeholder\nthat are enabled by the extension in Pandoc's Markdown.\n\n### Extension: `element_citations` ###\n\nIn the `jats` output formats, this causes reference items to\nbe replaced with `<element-citation>` elements. These\nelements are not influenced by CSL styles, but all information\non the item is included in tags.\n\n### Extension: `ntb` ###\n\nIn the `context` output format this enables the use of [Natural Tables\n(TABLE)](https://wiki.contextgarden.net/TABLE) instead of the default\n[Extreme Tables (xtables)](https://wiki.contextgarden.net/xtables).\nNatural tables allow more fine-grained global customization but come\nat a performance penalty compared to extreme tables.\n\n### Extension: `smart_quotes` (org) ###\n\nInterpret straight quotes as curly quotes during parsing. When\n*writing* Org, then the `smart_quotes` extension has the reverse\neffect: what would have been curly quotes comes out straight.\n\nThis extension is implied if `smart` is enabled.\n\n### Extension: `special_strings` (org) ###\n\nInterpret `---` as em-dashes, `--` as en-dashes, `\\-` as shy\nhyphen, and `...` as ellipses.\n\nThis extension is implied if `smart` is enabled.\n\n### Extension: `tagging` ### {#extension--tagging}\n\nEnabling this extension with `context` output will produce markup\nsuitable for the production of tagged PDFs. This includes\nadditional markers for paragraphs and alternative markup for\nemphasized text. The `emphasis-command` template variable is set\nif the extension is enabled.\n\n# Pandoc's Markdown\n\nPandoc understands an extended and slightly revised version of\nJohn Gruber's [Markdown] syntax.  This document explains the syntax,\nnoting differences from original Markdown. Except where noted, these\ndifferences can be suppressed by using the `markdown_strict` format instead\nof `markdown`. Extensions can be enabled or disabled to specify the\nbehavior more granularly. They are described in the following. See also\n[Extensions] above, for extensions that work also on other formats.\n\n## Philosophy\n\nMarkdown is designed to be easy to write, and, even more importantly,\neasy to read:\n\n> A Markdown-formatted document should be publishable as-is, as plain\n> text, without looking like it's been marked up with tags or formatting\n> instructions.\\\n> -- [John Gruber](https://daringfireball.net/projects/markdown/syntax#philosophy)\n\nThis principle has guided pandoc's decisions in finding syntax for\ntables, footnotes, and other extensions.\n\nThere is, however, one respect in which pandoc's aims are different\nfrom the original aims of Markdown.  Whereas Markdown was originally\ndesigned with HTML generation in mind, pandoc is designed for multiple\noutput formats.  Thus, while pandoc allows the embedding of raw HTML,\nit discourages it, and provides other, non-HTMLish ways of representing\nimportant document elements like definition lists, tables, mathematics, and\nfootnotes.\n\n## Paragraphs\n\nA paragraph is one or more lines of text followed by one or more blank lines.\nNewlines are treated as spaces, so you can reflow your paragraphs as you like.\nIf you need a hard line break, put two or more spaces at the end of a line.\n\n### Extension: `escaped_line_breaks` ###\n\nA backslash followed by a newline is also a hard line break.\nNote:  in multiline and grid table cells, this is the only way\nto create a hard line break, since trailing spaces in the cells\nare ignored.\n\n## Headings\n\nThere are two kinds of headings: Setext and ATX.\n\n### Setext-style headings ###\n\nA setext-style heading is a line of text \"underlined\" with a row of `=` signs\n(for a level-one heading) or `-` signs (for a level-two heading):\n\n    A level-one heading\n    ===================\n\n    A level-two heading\n    -------------------\n\nThe heading text can contain inline formatting, such as emphasis (see\n[Inline formatting], below).\n\n\n### ATX-style headings ###\n\nAn ATX-style heading consists of one to six `#` signs and a line of\ntext, optionally followed by any number of `#` signs.  The number of\n`#` signs at the beginning of the line is the heading level:\n\n    ## A level-two heading\n\n    ### A level-three heading ###\n\nAs with setext-style headings, the heading text can contain formatting:\n\n    # A level-one heading with a [link](/url) and *emphasis*\n\n### Extension: `blank_before_header` ###\n\nOriginal Markdown syntax does not require a blank line before a heading.\nPandoc does require this (except, of course, at the beginning of the\ndocument). The reason for the requirement is that it is all too easy for a\n`#` to end up at the beginning of a line by accident (perhaps through line\nwrapping). Consider, for example:\n\n    I like several of their flavors of ice cream:\n    #22, for example, and #5.\n\n### Extension: `space_in_atx_header` ###\n\nMany Markdown implementations do not require a space between the\nopening `#`s of an ATX heading and the heading text, so that\n`#5 bolt` and `#hashtag` count as headings.  With this extension,\npandoc does require the space.\n\n### Heading identifiers ###\n\nSee also the [`auto_identifiers`\nextension](#extension-auto_identifiers) above.\n\n### Extension: `header_attributes` ###\n\nHeadings can be assigned attributes using this syntax at the end\nof the line containing the heading text:\n\n    {#identifier .class .class key=value key=value}\n\nThus, for example, the following headings will all be assigned the identifier\n`foo`:\n\n    # My heading {#foo}\n\n    ## My heading ##    {#foo}\n\n    My other heading   {#foo}\n    ---------------\n\n(This syntax is compatible with [PHP Markdown Extra].)\n\nNote that although this syntax allows assignment of classes and key/value\nattributes, writers generally don't use all of this information.  Identifiers,\nclasses, and key/value attributes are used in HTML and HTML-based formats such\nas EPUB and slidy.  Identifiers are used for labels and link anchors in the\nLaTeX, ConTeXt, Textile, Jira markup, and AsciiDoc writers.\n\nHeadings with the class `unnumbered` will not be numbered, even if\n`--number-sections` is specified.  A single hyphen (`-`) in an attribute\ncontext is equivalent to `.unnumbered`, and preferable in non-English\ndocuments.  So,\n\n    # My heading {-}\n\nis just the same as\n\n    # My heading {.unnumbered}\n\nIf the `unlisted` class is present in addition to `unnumbered`,\nthe heading will not be included in a table of contents.\n(Currently this feature is only implemented for certain\nformats: those based on LaTeX and HTML, PowerPoint, and RTF.)\n\n### Extension: `implicit_header_references` ###\n\nPandoc behaves as if reference links have been defined for each heading.\nSo, to link to a heading\n\n    # Heading identifiers in HTML\n\nyou can simply write\n\n    [Heading identifiers in HTML]\n\nor\n\n    [Heading identifiers in HTML][]\n\nor\n\n    [the section on heading identifiers][heading identifiers in\n    HTML]\n\ninstead of giving the identifier explicitly:\n\n    [Heading identifiers in HTML](#heading-identifiers-in-html)\n\nIf there are multiple headings with identical text, the corresponding\nreference will link to the first one only, and you will need to use explicit\nlinks to link to the others, as described above.\n\nLike regular reference links, these references are case-insensitive.\n\nExplicit link reference definitions always take priority over\nimplicit heading references.  So, in the following example, the\nlink will point to `bar`, not to `#foo`:\n\n    # Foo\n\n    [foo]: bar\n\n    See [foo]\n\n## Block quotations\n\nMarkdown uses email conventions for quoting blocks of text.\nA block quotation is one or more paragraphs or other block elements\n(such as lists or headings), with each line preceded by a `>` character\nand an optional space. (The `>` need not start at the left margin, but\nit should not be indented more than three spaces.)\n\n    > This is a block quote. This\n    > paragraph has two lines.\n    >\n    > 1. This is a list inside a block quote.\n    > 2. Second item.\n\nA \"lazy\" form, which requires the `>` character only on the first\nline of each block, is also allowed:\n\n    > This is a block quote. This\n    paragraph has two lines.\n\n    > 1. This is a list inside a block quote.\n    2. Second item.\n\nAmong the block elements that can be contained in a block quote are\nother block quotes. That is, block quotes can be nested:\n\n    > This is a block quote.\n    >\n    > > A block quote within a block quote.\n\nIf the `>` character is followed by an optional space, that space\nwill be considered part of the block quote marker and not part of\nthe indentation of the contents.  Thus, to put an indented code\nblock in a block quote, you need five spaces after the `>`:\n\n    >     code\n\n### Extension: `blank_before_blockquote` ###\n\nOriginal Markdown syntax does not require a blank line before a\nblock quote.  Pandoc does require this (except, of course, at\nthe beginning of the document). The reason for the requirement\nis that it is all too easy for a `>` to end up at the beginning\nof a line by accident (perhaps through line wrapping). So,\nunless the `markdown_strict` format is used, the following does\nnot produce a nested block quote in pandoc:\n\n    > This is a block quote.\n    >> Not nested, since `blank_before_blockquote` is enabled by default\n\n\n## Verbatim (code) blocks\n\n### Indented code blocks ###\n\nA block of text indented four spaces (or one tab) is treated as verbatim\ntext: that is, special characters do not trigger special formatting,\nand all spaces and line breaks are preserved.  For example,\n\n        if (a > 3) {\n          moveShip(5 * gravity, DOWN);\n        }\n\nThe initial (four space or one tab) indentation is not considered part\nof the verbatim text, and is removed in the output.\n\nNote: blank lines in the verbatim text need not begin with four spaces.\n\n\n### Fenced code blocks ###\n\n### Extension: `fenced_code_blocks` ###\n\nIn addition to standard indented code blocks, pandoc supports\n*fenced* code blocks.  These begin with a row of three or more\ntildes (`~`) and end with a row of tildes that must be at least as long as\nthe starting row. Everything between these lines is treated as code. No\nindentation is necessary:\n\n    ~~~~~~~\n    if (a > 3) {\n      moveShip(5 * gravity, DOWN);\n    }\n    ~~~~~~~\n\nLike regular code blocks, fenced code blocks must be separated\nfrom surrounding text by blank lines.\n\nIf the code itself contains a row of tildes or backticks, just use a longer\nrow of tildes or backticks at the start and end:\n\n    ~~~~~~~~~~~~~~~~\n    ~~~~~~~~~~\n    code including tildes\n    ~~~~~~~~~~\n    ~~~~~~~~~~~~~~~~\n\n### Extension: `backtick_code_blocks` ###\n\nSame as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes\n(`~`).\n\n### Extension: `fenced_code_attributes` ###\n\nOptionally, you may attach attributes to fenced or backtick code block using\nthis syntax:\n\n    ~~~~ {#mycode .haskell .numberLines startFrom=\"100\"}\n    qsort []     = []\n    qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++\n                   qsort (filter (>= x) xs)\n    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nHere `mycode` is an identifier, `haskell` and `numberLines` are\nclasses, and `startFrom` is an attribute with value `100`. Some\noutput formats can use this information to do syntax\nhighlighting. Currently, the only output formats that use this\ninformation are HTML, LaTeX, Docx, Ms, and PowerPoint. If\nhighlighting is supported for your output format and language,\nthen the code block above will appear highlighted, with numbered\nlines. (To see which languages are supported, type `pandoc\n--list-highlight-languages`.) Otherwise, the code block above\nwill appear as follows:\n\n    <pre id=\"mycode\" class=\"haskell numberLines\" startFrom=\"100\">\n      <code>\n      ...\n      </code>\n    </pre>\n\nThe `numberLines` (or `number-lines`) class will cause the lines\nof the code block to be numbered, starting with `1` or the value\nof the `startFrom` attribute.  The `lineAnchors` (or\n`line-anchors`) class will cause the lines to be clickable\nanchors in HTML output.\n\nA shortcut form can also be used for specifying the language of\nthe code block:\n\n    ```haskell\n    qsort [] = []\n    ```\n\nThis is equivalent to:\n\n    ``` {.haskell}\n    qsort [] = []\n    ```\n\nThis shortcut form may be combined with attributes:\n\n    ```haskell {.numberLines}\n    qsort [] = []\n    ```\n\nWhich is equivalent to:\n\n    ``` {.haskell .numberLines}\n    qsort [] = []\n    ```\n\nIf the `fenced_code_attributes` extension is disabled, but\ninput contains class attribute(s) for the code block, the first\nclass attribute will be printed after the opening fence as a bare\nword.\n\nTo prevent all highlighting, use the `--syntax-highlighting=none`\noption. To set the highlighting style or method, use\n`--syntax-highlighting`. For more information on highlighting, see\n[Syntax highlighting], below.\n\n## Line blocks\n\n### Extension: `line_blocks` ###\n\nA line block is a sequence of lines beginning with a vertical bar (`|`)\nfollowed by a space.  The division into lines will be preserved in\nthe output, as will any leading spaces; otherwise, the lines will\nbe formatted as Markdown.  This is useful for verse and addresses:\n\n    | The limerick packs laughs anatomical\n    | In space that is quite economical.\n    |    But the good ones I've seen\n    |    So seldom are clean\n    | And the clean ones so seldom are comical\n\n    | 200 Main St.\n    | Berkeley, CA 94718\n\nThe lines can be hard-wrapped if needed, but the continuation\nline must begin with a space.\n\n    | The Right Honorable Most Venerable and Righteous Samuel L.\n      Constable, Jr.\n    | 200 Main St.\n    | Berkeley, CA 94718\n\nInline formatting (such as emphasis) is allowed in the content\n(though it can't cross line boundaries). Block-level formatting\n(such as block quotes or lists) is not recognized.\n\nThis syntax is borrowed from [reStructuredText].\n\n## Lists\n\n### Bullet lists ###\n\nA bullet list is a list of bulleted list items.  A bulleted list\nitem begins with a bullet (`*`, `+`, or `-`).  Here is a simple\nexample:\n\n    * one\n    * two\n    * three\n\nThis will produce a \"compact\" list. If you want a \"loose\" list, in which\neach item is formatted as a paragraph, put spaces between the items:\n\n    * one\n\n    * two\n\n    * three\n\nThe bullets need not be flush with the left margin; they may be\nindented one, two, or three spaces. The bullet must be followed\nby whitespace.\n\nList items look best if subsequent lines are flush with the first\nline (after the bullet):\n\n    * here is my first\n      list item.\n    * and my second.\n\nBut Markdown also allows a \"lazy\" format:\n\n    * here is my first\n    list item.\n    * and my second.\n\n### Block content in list items ###\n\nA list item may contain multiple paragraphs and other block-level\ncontent. However, subsequent paragraphs must be preceded by a blank line\nand indented to line up with the first non-space content after\nthe list marker.\n\n      * First paragraph.\n\n        Continued.\n\n      * Second paragraph. With a code block, which must be indented\n        eight spaces:\n\n            { code }\n\nException: if the list marker is followed by an indented code\nblock, which must begin 5 spaces after the list marker, then\nsubsequent paragraphs must begin two columns after the last\ncharacter of the list marker:\n\n    *     code\n\n      continuation paragraph\n\nList items may include other lists.  In this case the preceding blank\nline is optional.  The nested list must be indented to line up with\nthe first non-space character after the list marker of the\ncontaining list item.\n\n    * fruits\n      + apples\n        - macintosh\n        - red delicious\n      + pears\n      + peaches\n    * vegetables\n      + broccoli\n      + chard\n\nAs noted above, Markdown allows you to write list items \"lazily,\" instead of\nindenting continuation lines. However, if there are multiple paragraphs or\nother blocks in a list item, the first line of each must be indented.\n\n    + A lazy, lazy, list\n    item.\n\n    + Another one; this looks\n    bad but is legal.\n\n        Second paragraph of second\n    list item.\n\n### Ordered lists ###\n\nOrdered lists work just like bulleted lists, except that the items\nbegin with enumerators rather than bullets.\n\nIn original Markdown, enumerators are decimal numbers followed\nby a period and a space.  The numbers themselves are ignored, so\nthere is no difference between this list:\n\n    1.  one\n    2.  two\n    3.  three\n\nand this one:\n\n    5.  one\n    7.  two\n    1.  three\n\n### Extension: `fancy_lists` ###\n\nUnlike original Markdown, pandoc allows ordered list items to be marked\nwith uppercase and lowercase letters and roman numerals, in addition to\nArabic numerals. List markers may be enclosed in parentheses or followed by a\nsingle right-parenthesis or period. They must be separated from the\ntext that follows by at least one space, and, if the list marker is a\ncapital letter with a period, by at least two spaces.[^2]\n\n[^2]:  The point of this rule is to ensure that normal paragraphs\n    starting with people's initials, like\n\n        B. Russell won a Nobel Prize (but not for \"On Denoting\").\n\n    do not get treated as list items.\n\n    This rule will not prevent\n\n        (C) 2007 Joe Smith\n\n    from being interpreted as a list item.  In this case, a backslash\n    escape can be used:\n\n        (C\\) 2007 Joe Smith\n\nThe `fancy_lists` extension also allows '`#`' to be used as an\nordered list marker in place of a numeral:\n\n    #. one\n    #. two\n\nNote:  the '`#`' ordered list marker doesn't work with `commonmark`.\n\n### Extension: `startnum` ###\n\nPandoc also pays attention to the type of list marker used, and to the\nstarting number, and both of these are preserved where possible in the\noutput format. Thus, the following yields a list with numbers followed\nby a single parenthesis, starting with 9, and a sublist with lowercase\nroman numerals:\n\n     9)  Ninth\n    10)  Tenth\n    11)  Eleventh\n           i. subone\n          ii. subtwo\n         iii. subthree\n\nPandoc will start a new list each time a different type of list\nmarker is used.  So, the following will create three lists:\n\n    (2) Two\n    (5) Three\n    1.  Four\n    *   Five\n\nIf default list markers are desired, use `#.`:\n\n    #.  one\n    #.  two\n    #.  three\n\n### Extension: `task_lists` ###\n\nPandoc supports task lists, using the syntax of GitHub-Flavored Markdown.\n\n    - [ ] an unchecked task list item\n    - [x] checked item\n\n### Definition lists ###\n\n### Extension: `definition_lists` ###\n\nPandoc supports definition lists, using the syntax of\n[PHP Markdown Extra] with some extensions.[^3]\n\n    Term 1\n\n    :   Definition 1\n\n    Term 2 with *inline markup*\n\n    :   Definition 2\n\n            { some code, part of Definition 2 }\n\n        Third paragraph of definition 2.\n\nEach term must fit on one line, which may optionally be followed by\na blank line, and must be followed by one or more definitions.\nA definition begins with a colon or tilde, which may be indented one\nor two spaces.\n\nA term may have multiple definitions, and each definition may\nconsist of one or more block elements (paragraph, code block,\nlist, etc.), each indented four spaces or one tab stop.  The\nbody of the definition (not including the first line)\nshould be indented four spaces. However, as with\nother Markdown lists, you can \"lazily\" omit indentation except\nat the beginning of a paragraph or other block element:\n\n    Term 1\n\n    :   Definition\n    with lazy continuation.\n\n        Second paragraph of the definition.\n\nIf you leave space before the definition (as in the example above),\nthe text of the definition will be treated as a paragraph.  In some\noutput formats, this will mean greater spacing between term/definition\npairs. For a more compact definition list, omit the space before the\ndefinition:\n\n    Term 1\n      ~ Definition 1\n\n    Term 2\n      ~ Definition 2a\n      ~ Definition 2b\n\nNote that space between items in a definition list is required.\n\n[^3]:  I have been influenced by the suggestions of [David\n  Wheeler](https://justatheory.com/2009/02/modest-markdown-proposal/).\n\n### Numbered example lists ###\n\n### Extension: `example_lists` ###\n\nThe special list marker `@` can be used for sequentially numbered\nexamples. The first list item with a `@` marker will be numbered '1',\nthe next '2', and so on, throughout the document. The numbered examples\nneed not occur in a single list; each new list using `@` will take up\nwhere the last stopped. So, for example:\n\n    (@)  My first example will be numbered (1).\n    (@)  My second example will be numbered (2).\n\n    Explanation of examples.\n\n    (@)  My third example will be numbered (3).\n\nNumbered examples can be labeled and referred to elsewhere in the\ndocument:\n\n    (@good)  This is a good example.\n\n    As (@good) illustrates, ...\n\nThe label can be any string of alphanumeric characters, underscores,\nor hyphens.\n\nContinuation paragraphs in example lists must always\nbe indented four spaces, regardless of the length of the\nlist marker.  That is, example lists always behave as if the\n`four_space_rule` extension is set.  This is because example\nlabels tend to be long, and indenting content to the\nfirst non-space character after the label would be awkward.\n\nYou can repeat an earlier numbered example by re-using its label:\n\n    (@foo) Sample sentence.\n\n    Intervening text...\n\n    This theory can explain the case we saw earlier (repeated):\n\n    (@foo) Sample sentence.\n\nThis only works reliably, though, if the repeated item is in a list\nby itself, because each numbered example list will be numbered\ncontinuously from its starting number.\n\n### Ending a list ###\n\nWhat if you want to put an indented code block after a list?\n\n    -   item one\n    -   item two\n\n        { my code block }\n\nTrouble! Here pandoc (like other Markdown implementations) will treat\n`{ my code block }` as the second paragraph of item two, and not as\na code block.\n\nTo \"cut off\" the list after item two, you can insert some non-indented\ncontent, like an HTML comment, which won't produce visible output in\nany format:\n\n    -   item one\n    -   item two\n\n    <!-- end of list -->\n\n        { my code block }\n\nYou can use the same trick if you want two consecutive lists instead\nof one big list:\n\n    1.  one\n    2.  two\n    3.  three\n\n    <!-- -->\n\n    1.  uno\n    2.  dos\n    3.  tres\n\n## Horizontal rules\n\nA line containing a row of three or more `*`, `-`, or `_` characters\n(optionally separated by spaces) produces a horizontal rule:\n\n    *  *  *  *\n\n    ---------------\n\nWe strongly recommend that horizontal rules be separated from\nsurrounding text by blank lines.  If a horizontal rule is not\nfollowed by a blank line, pandoc may try to interpret the\nlines that follow as a YAML metadata block or a table.\n\n## Tables\n\nFour kinds of tables may be used. The first three kinds presuppose the use of\na fixed-width font, such as Courier. The fourth kind can be used with\nproportionally spaced fonts, as it does not require lining up columns.\n\n### Extension: `table_captions` ###\n\nA caption may optionally be provided with all 4 kinds of tables (as\nillustrated in the examples below). A caption is a paragraph beginning\nwith the string `Table:` (or `table:` or just `:`), which will be stripped\noff. It may appear either before or after the table.\n\n### Extension: `simple_tables` ###\n\nSimple tables look like this:\n\n      Right     Left     Center     Default\n    -------     ------ ----------   -------\n         12     12        12            12\n        123     123       123          123\n          1     1          1             1\n\n    Table:  Demonstration of simple table syntax.\n\nThe header and table rows must each fit on one line.  Column\nalignments are determined by the position of the header text relative\nto the dashed line below it:[^4]\n\n  - If the dashed line is flush with the header text on the right side\n    but extends beyond it on the left, the column is right-aligned.\n  - If the dashed line is flush with the header text on the left side\n    but extends beyond it on the right, the column is left-aligned.\n  - If the dashed line extends beyond the header text on both sides,\n    the column is centered.\n  - If the dashed line is flush with the header text on both sides,\n    the default alignment is used (in most cases, this will be left).\n\n[^4]:  This scheme is due to Michel Fortin, who proposed it on the\n       [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).\n\nThe table must end with a blank line, or a line of dashes followed by\na blank line.\n\nThe column header row may be omitted, provided a dashed line is used\nto end the table. For example:\n\n    -------     ------ ----------   -------\n         12     12        12             12\n        123     123       123           123\n          1     1          1              1\n    -------     ------ ----------   -------\n\nWhen the header row is omitted, column alignments are determined on the basis\nof the first line of the table body. So, in the tables above, the columns\nwould be right, left, center, and right aligned, respectively.\n\n### Extension: `multiline_tables` ###\n\nMultiline tables allow header and table rows to span multiple lines\nof text (but cells that span multiple columns or rows of the table are\nnot supported).  Here is an example:\n\n    -------------------------------------------------------------\n     Centered   Default           Right Left\n      Header    Aligned         Aligned Aligned\n    ----------- ------- --------------- -------------------------\n       First    row                12.0 Example of a row that\n                                        spans multiple lines.\n\n      Second    row                 5.0 Here's another one. Note\n                                        the blank line between\n                                        rows.\n    -------------------------------------------------------------\n\n    Table: Here's the caption. It, too, may span\n    multiple lines.\n\nThese work like simple tables, but with the following differences:\n\n  - They must begin with a row of dashes, before the header text\n    (unless the header row is omitted).\n  - They must end with a row of dashes, then a blank line.\n  - The rows must be separated by blank lines.\n\nIn multiline tables, the table parser pays attention to the widths of\nthe columns, and the writers try to reproduce these relative widths in\nthe output. So, if you find that one of the columns is too narrow in the\noutput, try widening it in the Markdown source.\n\nThe header may be omitted in multiline tables as well as simple tables:\n\n    ----------- ------- --------------- -------------------------\n       First    row                12.0 Example of a row that\n                                        spans multiple lines.\n\n      Second    row                 5.0 Here's another one. Note\n                                        the blank line between\n                                        rows.\n    ----------- ------- --------------- -------------------------\n\n    : Here's a multiline table without a header.\n\nIt is possible for a multiline table to have just one row, but the row\nshould be followed by a blank line (and then the row of dashes that ends\nthe table), or the table may be interpreted as a simple table.\n\n### Extension: `grid_tables` ###\n\nGrid tables look like this:\n\n    : Sample grid table.\n\n    +---------------+---------------+--------------------+\n    | Fruit         | Price         | Advantages         |\n    +===============+===============+====================+\n    | Bananas       | $1.34         | - built-in wrapper |\n    |               |               | - bright color     |\n    +---------------+---------------+--------------------+\n    | Oranges       | $2.10         | - cures scurvy     |\n    |               |               | - tasty            |\n    +---------------+---------------+--------------------+\n\nThe row of `=`s separates the header from the table body,\nand can be omitted for a headerless table. The cells of grid\ntables may contain arbitrary block elements (multiple\nparagraphs, code blocks, lists, etc.).\n\nCells can span multiple columns or rows:\n\n    +---------------------+----------+\n    | Property            | Earth    |\n    +=============+=======+==========+\n    |             | min   | -89.2 °C |\n    | Temperature +-------+----------+\n    | 1961-1990   | mean  | 14 °C    |\n    |             +-------+----------+\n    |             | max   | 56.7 °C  |\n    +-------------+-------+----------+\n\nA table header may contain more than one row:\n\n    +---------------------+-----------------------+\n    | Location            | Temperature 1961-1990 |\n    |                     | in degree Celsius     |\n    |                     +-------+-------+-------+\n    |                     | min   | mean  | max   |\n    +=====================+=======+=======+=======+\n    | Antarctica          | -89.2 | N/A   | 19.8  |\n    +---------------------+-------+-------+-------+\n    | Earth               | -89.2 | 14    | 56.7  |\n    +---------------------+-------+-------+-------+\n\nAlignments can be specified as with pipe tables, by putting\ncolons at the boundaries of the separator line after the\nheader:\n\n    +---------------+---------------+--------------------+\n    | Right         | Left          | Centered           |\n    +==============:+:==============+:==================:+\n    | Bananas       | $1.34         | built-in wrapper   |\n    +---------------+---------------+--------------------+\n\nFor headerless tables, the colons go on the top line instead:\n\n    +--------------:+:--------------+:------------------:+\n    | Right         | Left          | Centered           |\n    +---------------+---------------+--------------------+\n\nA table foot can be defined by enclosing it with separator lines\nthat use `=` instead of `-`:\n\n     +---------------+---------------+\n     | Fruit         | Price         |\n     +===============+===============+\n     | Bananas       | $1.34         |\n     +---------------+---------------+\n     | Oranges       | $2.10         |\n     +===============+===============+\n     | Sum           | $3.44         |\n     +===============+===============+\n\nThe foot must always be placed at the very bottom of the table.\n\nGrid tables can be created easily using Emacs' table-mode\n(`M-x table-insert`).\n\n### Extension: `pipe_tables` ###\n\nPipe tables look like this:\n\n    | Right | Left | Default | Center |\n    |------:|:-----|---------|:------:|\n    |   12  |  12  |    12   |    12  |\n    |  123  |  123 |   123   |   123  |\n    |    1  |    1 |     1   |     1  |\n\n      : Demonstration of pipe table syntax.\n\nThe syntax is identical to [PHP Markdown Extra tables].  The beginning and\nending pipe characters are optional, but pipes are required between all\ncolumns.  The colons indicate column alignment as shown.  The header\ncannot be omitted.  To simulate a headerless table, include a header\nwith blank cells.\n\nSince the pipes indicate column boundaries, columns need not be vertically\naligned, as they are in the above example.  So, this is a perfectly\nlegal (though ugly) pipe table:\n\n    fruit| price\n    -----|-----:\n    apple|2.05\n    pear|1.37\n    orange|3.09\n\nThe cells of pipe tables cannot contain block elements like paragraphs\nand lists, and cannot span multiple lines.  If any line of the\nMarkdown source is longer than the column width (see `--columns`),\nthen the table will take up the full text width and the cell\ncontents will wrap, with the relative cell widths determined by\nthe number of dashes in the line separating the table header\nfrom the table body. (For example `---|-` would make the first column 3/4\nand the second column 1/4 of the full text width.)\nOn the other hand, if no lines are wider than column width, then\ncell contents will not be wrapped, and the cells will be sized\nto their contents.\n\nNote:  pandoc also recognizes pipe tables of the following\nform, as can be produced by Emacs' orgtbl-mode:\n\n    | One | Two   |\n    |-----+-------|\n    | my  | table |\n    | is  | nice  |\n\nThe difference is that `+` is used instead of `|`. Other orgtbl features\nare not supported. In particular, to get non-default column alignment,\nyou'll need to add colons as above.\n\n[PHP Markdown Extra tables]: https://michelf.ca/projects/php-markdown/extra/#table\n\n### Extension: `table_attributes` ###\n\nAttributes may be attached to tables by including them at the end\nof the caption. (For the syntax, see\n[`header_attributes`][Extension: `header_attributes`].)\n\n      : Here's the caption. {#ident .class key=\"value\"}\n\n## Metadata blocks\n\n### Extension: `pandoc_title_block` ###\n\nIf the file begins with a title block\n\n    % title\n    % author(s) (separated by semicolons)\n    % date\n\nit will be parsed as bibliographic information, not regular text.  (It\nwill be used, for example, in the title of standalone LaTeX or HTML\noutput.)  The block may contain just a title, a date and an author,\nor all three elements. If you want to include an author but no\ntitle, or a title and a date but no author, you need a blank line:\n\n```\n%\n% Author\n```\n\n```\n% My title\n%\n% June 15, 2006\n```\n\nThe title may occupy multiple lines, but continuation lines must\nbegin with leading space, thus:\n\n```\n% My title\n  on multiple lines\n```\n\nIf a document has multiple authors, the authors may be put on\nseparate lines with leading space, or separated by semicolons, or\nboth.  So, all of the following are equivalent:\n\n```\n% Author One\n  Author Two\n```\n\n```\n% Author One; Author Two\n```\n\n```\n% Author One;\n  Author Two\n```\n\nThe date must fit on one line.\n\nAll three metadata fields may contain standard inline formatting\n(italics, links, footnotes, etc.).\n\nTitle blocks will always be parsed, but they will affect the output only\nwhen the `--standalone` (`-s`) option is chosen. In HTML output, titles\nwill appear twice: once in the document head---this is the title that\nwill appear at the top of the window in a browser---and once at the\nbeginning of the document body. The title in the document head can have\nan optional prefix attached (`--title-prefix` or `-T` option). The title\nin the body appears as an H1 element with class \"title\", so it can be\nsuppressed or reformatted with CSS. If a title prefix is specified with\n`-T` and no title block appears in the document, the title prefix will\nbe used by itself as the HTML title.\n\nThe man page writer extracts a title, man page section number, and\nother header and footer information from the title line. The title\nis assumed to be the first word on the title line, which may optionally\nend with a (single-digit) section number in parentheses. (There should\nbe no space between the title and the parentheses.)  Anything after\nthis is assumed to be additional footer and header text. A single pipe\ncharacter (`|`) should be used to separate the footer text from the header\ntext.  Thus,\n\n    % PANDOC(1)\n\nwill yield a man page with the title `PANDOC` and section 1.\n\n    % PANDOC(1) Pandoc User Manuals\n\nwill also have \"Pandoc User Manuals\" in the footer.\n\n    % PANDOC(1) Pandoc User Manuals | Version 4.0\n\nwill also have \"Version 4.0\" in the header.\n\n### Extension: `yaml_metadata_block` ###\n\nA [YAML] metadata block is a valid YAML object, delimited by a line of three\nhyphens (`---`) at the top and a line of three hyphens (`---`) or three dots\n(`...`) at the bottom.  The initial line `---` must not be followed by a blank\nline. A YAML metadata block may occur anywhere in the document, but if\nit is not at the beginning, it must be preceded by a blank line.\n(Note that JSON may be used as well, because JSON is a subset of YAML.)\n\nNote that, because of the way pandoc concatenates input files\nwhen several are provided, you may also keep the metadata in a\nseparate YAML file and pass it to pandoc as an argument, along\nwith your Markdown files:\n\n    pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html\n\nJust be sure that the YAML file begins with `---` and ends with `---` or\n`...`. Alternatively, you can use the `--metadata-file` option. Using\nthat approach however, you cannot reference content (like footnotes)\nfrom the main Markdown input document.\n\nMetadata will be taken from the fields of the YAML object and added to any\nexisting document metadata.  Metadata can contain lists and objects (nested\narbitrarily), but all string scalars will be interpreted as Markdown.  Fields\nwith names ending in an underscore will be ignored by pandoc.  (They may be\ngiven a role by external processors.)  Field names must not be\ninterpretable as YAML numbers or boolean values (so, for\nexample, `yes`, `True`, and `15` cannot be used as field names).\n\nA document may contain multiple metadata blocks.  If two\nmetadata blocks attempt to set the same field, the value from\nthe second block will be taken.\n\nEach metadata block is handled internally as an independent YAML document.\nThis means, for example, that any YAML anchors defined in a block cannot be\nreferenced in another block.\n\nWhen pandoc is used with `-t markdown` to create a Markdown document,\na YAML metadata block will be produced only if the `-s/--standalone`\noption is used.  All of the metadata will appear in a single block\nat the beginning of the document.\n\nNote that [YAML] escaping rules must be followed. Thus, for example,\nif a title contains a colon, it must be quoted, and if it contains a\nbackslash escape, then it must be ensured that it is not treated as a\n[YAML escape sequence]. The pipe character (`|`) can be used to begin\nan indented block that will be interpreted literally, without need for\nescaping. This form is necessary when the field contains blank lines\nor block-level formatting:\n\n    ---\n    title:  'This is the title: it contains a colon'\n    author:\n    - Author One\n    - Author Two\n    keywords: [nothing, nothingness]\n    abstract: |\n      This is the abstract.\n\n      It consists of two paragraphs.\n    ...\n\nThe literal block after the `|` must be indented relative to the\nline containing the `|`.  If it is not, the YAML will be invalid\nand pandoc will not interpret it as metadata.  For an overview\nof the complex rules governing YAML, see the [Wikipedia entry on\nYAML syntax].\n\nTemplate variables will be set automatically from the metadata.  Thus, for\nexample, in writing HTML, the variable `abstract` will be set to the HTML\nequivalent of the Markdown in the `abstract` field:\n\n    <p>This is the abstract.</p>\n    <p>It consists of two paragraphs.</p>\n\nVariables can contain arbitrary YAML structures, but the template must match\nthis structure.  The `author` variable in the default templates expects a\nsimple list or string, but can be changed to support more complicated\nstructures.  The following combination, for example, would add an affiliation\nto the author if one is given:\n\n    ---\n    title: The document title\n    author:\n    - name: Author One\n      affiliation: University of Somewhere\n    - name: Author Two\n      affiliation: University of Nowhere\n    ...\n\nTo use the structured authors in the example above, you would need a custom\ntemplate:\n\n    $for(author)$\n    $if(author.name)$\n    $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$\n    $else$\n    $author$\n    $endif$\n    $endfor$\n\nRaw content to include in the document's header may be specified\nusing `header-includes`; however, it is important to mark up\nthis content as raw code for a particular output format, using\nthe [`raw_attribute` extension](#extension-raw_attribute), or it\nwill be interpreted as Markdown. For example:\n\n    header-includes:\n    - |\n      ```{=latex}\n      \\let\\oldsection\\section\n      \\renewcommand{\\section}[1]{\\clearpage\\oldsection{#1}}\n      ```\n\nNote:  the `yaml_metadata_block` extension works with\n`commonmark` as well as `markdown` (and it is enabled by default\nin `gfm` and `commonmark_x`).  However, in these formats the\nfollowing restrictions apply:\n\n- The YAML metadata block must occur at the beginning of the\n  document (and there can be only one).  If multiple files are\n  given as arguments to pandoc, only the first can be a YAML\n  metadata block.\n\n- The leaf nodes of the YAML structure are parsed in isolation from\n  each other and from the rest of the document.  So, for\n  example,  you can't use a reference link in these contexts\n  if the link definition is somewhere else in the document.\n\n[YAML escape sequence]: https://yaml.org/spec/1.2/spec.html#id2776092\n[Wikipedia entry on YAML syntax]:  https://en.wikipedia.org/wiki/YAML#Syntax\n\n## Backslash escapes\n\n### Extension: `all_symbols_escapable` ###\n\nExcept inside a code block or inline code, any punctuation or space\ncharacter preceded by a backslash will be treated literally, even if it\nwould normally indicate formatting.  Thus, for example, if one writes\n\n    *\\*hello\\**\n\none will get\n\n    <em>*hello*</em>\n\ninstead of\n\n    <strong>hello</strong>\n\nThis rule is easier to remember than original Markdown's rule,\nwhich allows only the following characters to be backslash-escaped:\n\n    \\`*_{}[]()>#+-.!\n\n(However, if the `markdown_strict` format is used, the original Markdown rule\nwill be used.)\n\nA backslash-escaped space is parsed as a nonbreaking space. In TeX output,\nit will appear as `~`. In HTML and XML output, it will appear as a\nliteral unicode nonbreaking space character (note that it will thus\nactually look \"invisible\" in the generated HTML source; you can still\nuse the `--ascii` command-line option to make it appear as an explicit\nentity).\n\nA backslash-escaped newline (i.e. a backslash occurring at the end of\na line) is parsed as a hard line break.  It will appear in TeX output as\n`\\\\` and in HTML as `<br />`.  This is a nice alternative to\nMarkdown's \"invisible\" way of indicating hard line breaks using\ntwo trailing spaces on a line.\n\nBackslash escapes do not work in verbatim contexts.\n\n## Inline formatting\n\n### Emphasis ###\n\nTo *emphasize* some text, surround it with `*`s or `_`, like this:\n\n    This text is _emphasized with underscores_, and this\n    is *emphasized with asterisks*.\n\nDouble `*` or `_` produces **strong emphasis**:\n\n    This is **strong emphasis** and __with underscores__.\n\nA `*` or `_` character surrounded by spaces, or backslash-escaped,\nwill not trigger emphasis:\n\n    This is * not emphasized *, and \\*neither is this\\*.\n\n### Extension: `intraword_underscores` ###\n\nBecause `_` is sometimes used inside words and identifiers,\npandoc does not interpret a `_` surrounded by alphanumeric\ncharacters as an emphasis marker.  If you want to emphasize\njust part of a word, use `*`:\n\n    feas*ible*, not feas*able*.\n\n### Strikeout ###\n\n### Extension: `strikeout` ###\n\nTo strike out a section of text with a horizontal line, begin and end it\nwith `~~`. Thus, for example,\n\n    This ~~is deleted text.~~\n\n\n### Superscripts and subscripts ###\n\n### Extension: `superscript`, `subscript` ###\n\nSuperscripts may be written by surrounding the superscripted text by `^`\ncharacters; subscripts may be written by surrounding the subscripted\ntext by `~` characters.  Thus, for example,\n\n    H~2~O is a liquid.  2^10^ is 1024.\n\nThe text between `^...^` or `~...~` may not contain spaces or\nnewlines.  If the superscripted or subscripted text contains\nspaces, these spaces must be escaped with backslashes.  (This is\nto prevent accidental superscripting and subscripting through\nthe ordinary use of `~` and `^`, and also bad interactions with\nfootnotes.) Thus, if you want the letter P with 'a cat' in\nsubscripts, use `P~a\\ cat~`, not `P~a cat~`.\n\n### Verbatim ###\n\nTo make a short span of text verbatim, put it inside backticks:\n\n    What is the difference between `>>=` and `>>`?\n\nIf the verbatim text includes a backtick, use double backticks:\n\n    Here is a literal backtick `` ` ``.\n\n(The spaces after the opening backticks and before the closing\nbackticks will be ignored.)\n\nThe general rule is that a verbatim span starts with a string\nof consecutive backticks (optionally followed by a space)\nand ends with a string of the same number of backticks (optionally\npreceded by a space).\n\nNote that backslash-escapes (and other Markdown constructs) do not\nwork in verbatim contexts:\n\n    This is a backslash followed by an asterisk: `\\*`.\n\n### Extension: `inline_code_attributes` ###\n\nAttributes can be attached to verbatim text, just as with\n[fenced code blocks]:\n\n    `<$>`{.haskell}\n\n### Underline ###\n\nTo underline text, use the `underline` class:\n\n    [Underline]{.underline}\n\nOr, without the `bracketed_spans` extension (but with `native_spans`):\n\n    <span class=\"underline\">Underline</span>\n\nThis will work in all output formats that support underline.\n\n### Small caps ###\n\nTo write small caps, use the `smallcaps` class:\n\n    [Small caps]{.smallcaps}\n\nOr, without the `bracketed_spans` extension:\n\n    <span class=\"smallcaps\">Small caps</span>\n\nFor compatibility with other Markdown flavors, CSS is also supported:\n\n    <span style=\"font-variant:small-caps;\">Small caps</span>\n\nThis will work in all output formats that support small caps.\n\n### Highlighting ###\n\nTo highlight text, use the `mark` class:\n\n    [Mark]{.mark}\n\nOr, without the `bracketed_spans` extension (but with `native_spans`):\n\n    <span class=\"mark\">Mark</span>\n\nThis will work in all output formats that support highlighting.\n\n\n## Math\n\n### Extension: `tex_math_dollars` ###\n\nAnything between two `$` characters will be treated as TeX math.  The\nopening `$` must have a non-space character immediately to its right,\nwhile the closing `$` must have a non-space character immediately to its\nleft, and must not be followed immediately by a digit.  Thus,\n`$20,000 and $30,000` won't parse as math.  If for some reason\nyou need to enclose text in literal `$` characters, backslash-escape\nthem and they won't be treated as math delimiters.\n\nFor display math, use `$$` delimiters.  (In this case, the delimiters\nmay be separated from the formula by whitespace.  However, there can be\nno blank lines between the opening and closing `$$` delimiters.)\n\nTeX math will be printed in all output formats. How it is rendered\ndepends on the output format:\n\nLaTeX\n  ~ It will appear verbatim surrounded by `\\(...\\)` (for inline\n    math) or `\\[...\\]` (for display math).\n\nMarkdown, Emacs Org mode, ConTeXt, ZimWiki\n  ~ It will appear verbatim surrounded by `$...$` (for inline\n    math) or `$$...$$` (for display math).\n\nXWiki\n  ~ It will appear verbatim surrounded by `{{formula}}..{{/formula}}`.\n\nreStructuredText\n  ~ It will be rendered using an [interpreted text role `:math:`].\n\nAsciiDoc\n  ~ For AsciiDoc output math will appear verbatim surrounded by\n    `latexmath:[...]`. For `asciidoc_legacy` the bracketed\n    material will also include inline or display math delimiters.\n\nTexinfo\n  ~ It will be rendered inside a `@math` command.\n\nroff man, Jira markup\n  ~ It will be rendered verbatim without `$`'s.\n\nMediaWiki, DokuWiki\n  ~ It will be rendered inside `<math>` tags.\n\nTextile\n  ~ It will be rendered inside `<span class=\"math\">` tags.\n\nRTF, OpenDocument\n  ~ It will be rendered, if possible, using Unicode characters,\n    and will otherwise appear verbatim.\n\nODT\n  ~ It will be rendered, if possible, using MathML.\n\nDocBook\n  ~ If the `--mathml` flag is used, it will be rendered using MathML\n    in an `inlineequation` or `informalequation` tag.  Otherwise it\n    will be rendered, if possible, using Unicode characters.\n\nDocx and PowerPoint\n  ~ It will be rendered using OMML math markup.\n\nFictionBook2\n  ~ If the `--webtex` option is used, formulas are rendered as images\n    using CodeCogs or other compatible web service, downloaded\n    and embedded in the e-book. Otherwise, they will appear verbatim.\n\nHTML, Slidy, DZSlides, S5, EPUB\n  ~ The way math is rendered in HTML will depend on the\n    command-line options selected. Therefore see [Math rendering in HTML]\n    above.\n\n[interpreted text role `:math:`]: https://docutils.sourceforge.io/docs/ref/rst/roles.html#math\n\n## Raw HTML\n\n### Extension: `raw_html` ###\n\nMarkdown allows you to insert raw HTML (or DocBook) anywhere in a document\n(except verbatim contexts, where `<`, `>`, and `&` are interpreted\nliterally).  (Technically this is not an extension, since standard\nMarkdown allows it, but it has been made an extension so that it can\nbe disabled if desired.)\n\nThe raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,\nDZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile\noutput, and suppressed in other formats.\n\nFor a more explicit way of including raw HTML in a Markdown\ndocument, see the [`raw_attribute` extension][Extension: `raw_attribute`].\n\nIn the CommonMark format, if `raw_html` is enabled, superscripts,\nsubscripts, strikeouts and small capitals will be represented as HTML.\nOtherwise, plain-text fallbacks will be used. Note that even if\n`raw_html` is disabled, tables will be rendered with HTML syntax if\nthey cannot use pipe syntax.\n\n### Extension: `markdown_in_html_blocks` ###\n\nOriginal Markdown allows you to include HTML \"blocks\":  blocks\nof HTML between balanced tags that are separated from the surrounding text\nwith blank lines, and start and end at the left margin.  Within\nthese blocks, everything is interpreted as HTML, not Markdown;\nso (for example), `*` does not signify emphasis.\n\nPandoc behaves this way when the `markdown_strict` format is used; but\nby default, pandoc interprets material between HTML block tags as Markdown.\nThus, for example, pandoc will turn\n\n    <table>\n    <tr>\n    <td>*one*</td>\n    <td>[a link](https://google.com)</td>\n    </tr>\n    </table>\n\ninto\n\n    <table>\n    <tr>\n    <td><em>one</em></td>\n    <td><a href=\"https://google.com\">a link</a></td>\n    </tr>\n    </table>\n\nwhereas `Markdown.pl` will preserve it as is.\n\nThere is one exception to this rule:  text between `<script>`,\n`<style>`, `<pre>`, and `<textarea>` tags is not interpreted as Markdown.\n\nThis departure from original Markdown should make it easier to mix\nMarkdown with HTML block elements.  For example, one can surround\na block of Markdown text with `<div>` tags without preventing it\nfrom being interpreted as Markdown.\n\n### Extension: `native_divs` ###\n\nUse native pandoc `Div` blocks for content inside `<div>` tags.\nFor the most part this should give the same output as\n`markdown_in_html_blocks`, but it makes it easier to write pandoc\nfilters to manipulate groups of blocks.\n\n### Extension: `native_spans` ###\n\nUse native pandoc `Span` blocks for content inside `<span>` tags.\nFor the most part this should give the same output as `raw_html`,\nbut it makes it easier to write pandoc filters to manipulate groups\nof inlines.\n\n### Extension: `raw_tex` ###\n\nIn addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be\nincluded in a document. Inline TeX commands will be preserved and passed\nunchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use\nLaTeX to include BibTeX citations:\n\n    This result was proved in \\cite{jones.1967}.\n\nNote that in LaTeX environments, like\n\n    \\begin{tabular}{|l|l|}\\hline\n    Age & Frequency \\\\ \\hline\n    18--25  & 15 \\\\\n    26--35  & 33 \\\\\n    36--45  & 22 \\\\ \\hline\n    \\end{tabular}\n\nthe material between the begin and end tags will be interpreted as raw\nLaTeX, not as Markdown.\n\nFor a more explicit and flexible way of including raw TeX in a\nMarkdown document, see the [`raw_attribute`\nextension][Extension: `raw_attribute`].\n\nInline LaTeX is ignored in output formats other than Markdown, LaTeX,\nEmacs Org mode, and ConTeXt.\n\n### Generic raw attribute ###\n\n### Extension: `raw_attribute` ###\n\nInline spans and fenced code blocks with a special\nkind of attribute will be parsed as raw content with the\ndesignated format.  For example, the following produces a raw\nroff `ms` block:\n\n    ```{=ms}\n    .MYMACRO\n    blah blah\n    ```\nAnd the following produces a raw `html` inline element:\n\n    This is `<a>html</a>`{=html}\n\nThis can be useful to insert raw xml into `docx` documents, e.g.\na pagebreak:\n\n    ```{=openxml}\n    <w:p>\n      <w:r>\n        <w:br w:type=\"page\"/>\n      </w:r>\n    </w:p>\n    ```\n\nThe format name should match the target format name (see\n`-t/--to`, above, for a list, or use `pandoc\n--list-output-formats`). Use `openxml` for `docx` output,\n`opendocument` for `odt` output, `html5` for `epub3` output,\n`html4` for `epub2` output, and `latex`, `beamer`,\n`ms`, or `html5` for `pdf` output (depending on what you\nuse for `--pdf-engine`).\n\nThis extension presupposes that the relevant kind of\ninline code or fenced code block is enabled.  Thus, for\nexample, to use a raw attribute with a backtick code block,\n`backtick_code_blocks` must be enabled.\n\nThe raw attribute cannot be combined with regular attributes.\n\n## LaTeX macros\n\n### Extension: `latex_macros` ###\n\nWhen this extension is enabled, pandoc will parse LaTeX\nmacro definitions and apply the resulting macros to all LaTeX\nmath and raw LaTeX.  So, for example, the following will work in\nall output formats, not just LaTeX:\n\n    \\newcommand{\\tuple}[1]{\\langle #1 \\rangle}\n\n    $\\tuple{a, b, c}$\n\nNote that LaTeX macros will not be applied if they occur\ninside a raw span or block marked with the\n[`raw_attribute` extension](#extension-raw_attribute).\n\nWhen `latex_macros` is disabled, the raw LaTeX and math will\nnot have macros applied. This is usually a better approach when\nyou are targeting LaTeX or PDF.\n\nMacro definitions in LaTeX will be passed through as raw LaTeX\nonly if `latex_macros` is not enabled.  Macro definitions in\nMarkdown source (or other formats allowing `raw_tex`) will\nbe passed through regardless of whether `latex_macros` is\nenabled.\n\n## Links\n\nMarkdown allows links to be specified in several ways.\n\n### Automatic links ###\n\nIf you enclose a URL or email address in pointy brackets, it\nwill become a link:\n\n    <https://google.com>\n    <sam@green.eggs.ham>\n\n### Inline links ###\n\nAn inline link consists of the link text in square brackets,\nfollowed by the URL in parentheses. (Optionally, the URL can\nbe followed by a link title, in quotes.)\n\n    This is an [inline link](/url), and here's [one with\n    a title](https://fsf.org \"click here for a good time!\").\n\nThere can be no space between the bracketed part and the parenthesized part.\nThe link text can contain formatting (such as emphasis), but the title cannot.\n\nEmail addresses in inline links are not autodetected, so they have to be\nprefixed with `mailto`:\n\n    [Write me!](mailto:sam@green.eggs.ham)\n\n### Reference links ###\n\nAn *explicit* reference link has two parts, the link itself and the link\ndefinition, which may occur elsewhere in the document (either\nbefore or after the link).\n\nThe link consists of link text in square brackets, followed by a label in\nsquare brackets. (There cannot be space between the two unless the\n`spaced_reference_links` extension is enabled.) The link definition\nconsists of the bracketed label, followed by a colon and a space, followed by\nthe URL, and optionally (after a space) a link title either in quotes or in\nparentheses.  The label must not be parseable as a citation (assuming\nthe `citations` extension is enabled):  citations take precedence over\nlink labels.\n\nHere are some examples:\n\n    [my label 1]: /foo/bar.html  \"My title, optional\"\n    [my label 2]: /foo\n    [my label 3]: https://fsf.org (The Free Software Foundation)\n    [my label 4]: /bar#special  'A title in single quotes'\n\nThe URL may optionally be surrounded by angle brackets:\n\n    [my label 5]: <http://foo.bar.baz>\n\nThe title may go on the next line:\n\n    [my label 3]: https://fsf.org\n      \"The Free Software Foundation\"\n\nNote that link labels are not case sensitive.  So, this will work:\n\n    Here is [my link][FOO]\n\n    [Foo]: /bar/baz\n\nIn an *implicit* reference link, the second pair of brackets is\nempty:\n\n    See [my website][].\n\n    [my website]: http://foo.bar.baz\n\nNote:  In `Markdown.pl` and most other Markdown implementations,\nreference link definitions cannot occur in nested constructions\nsuch as list items or block quotes.  Pandoc lifts this\narbitrary-seeming restriction.  So the following is fine in pandoc,\nthough not in most other implementations:\n\n    > My block [quote].\n    >\n    > [quote]: /foo\n\n### Extension: `shortcut_reference_links` ###\n\nIn a *shortcut* reference link, the second pair of brackets may\nbe omitted entirely:\n\n    See [my website].\n\n    [my website]: http://foo.bar.baz\n\n### Internal links ###\n\nTo link to another section of the same document, use the automatically\ngenerated identifier (see [Heading identifiers]). For example:\n\n    See the [Introduction](#introduction).\n\nor\n\n    See the [Introduction].\n\n    [Introduction]: #introduction\n\nInternal links are currently supported for HTML formats (including\nHTML slide shows and EPUB), LaTeX, and ConTeXt.\n\n## Images\n\nA link immediately preceded by a `!` will be treated as an image.\nThe link text will be used as the image's alt text:\n\n    ![la lune](lalune.jpg \"Voyage to the moon\")\n\n    ![movie reel]\n\n    [movie reel]: movie.gif\n\n### Extension: `implicit_figures` ###\n\nAn image with nonempty alt text, occurring by itself in a\nparagraph, will be rendered as a figure with a caption.  The\nimage's description will be used as the caption.\n\n    ![This is the caption.](image.png)\n\nHow this is rendered depends on the output format. Some output\nformats (e.g. RTF) do not yet support figures. In those\nformats, you'll just get an image in a paragraph by itself, with\nno caption.\n\nIf you just want a regular inline image, just make sure it is not\nthe only thing in the paragraph. One way to do this is to insert a\nnonbreaking space after the image:\n\n    ![This image won't be a figure](image.png)\\\n\nNote that in reveal.js slide shows, an image in a paragraph\nby itself that has the `r-stretch` class will fill the screen,\nand the caption and figure tags will be omitted.\n\nTo specify an alt text for the image that is different\nfrom the caption, you can use an explicit attribute (assuming the\n`link_attributes` extension is set):\n\n    ![The caption.](image.png){alt=\"description of image\"}\n\nFor LaTeX output, you can specify a [figure's\npositioning](https://www.overleaf.com/learn/latex/Positioning_images_and_tables#The_figure_environment)\nby adding the `latex-placement` attribute.\n\n    ![The caption.](image.png){latex-placement=\"ht\"}\n\n### Extension: `link_attributes` ###\n\nAttributes can be set on links and images:\n\n    An inline ![image](foo.jpg){#id .class width=30 height=20px}\n    and a reference ![image][ref] with attributes.\n\n    [ref]: foo.jpg \"optional title\" {#id .class key=val key2=\"val 2\"}\n\n(This syntax is compatible with [PHP Markdown Extra] when only `#id`\nand `.class` are used.)\n\nFor HTML and EPUB, all known HTML5 attributes except `width` and\n`height` (but including `srcset` and `sizes`) are passed through\nas is. Unknown attributes are passed through as custom\nattributes, with `data-` prepended. The other writers ignore\nattributes that are not specifically supported by their output format.\n\nThe `width` and `height` attributes on images are treated specially. When\nused without a unit, the unit is assumed to be pixels. However, any of\nthe following unit identifiers can be used: `px`, `cm`, `mm`, `in`, `inch`\nand `%`. There must not be any spaces between the number and the unit.\nFor example:\n\n```\n![](file.jpg){ width=50% }\n```\n\n- Dimensions may be converted to a form that is compatible with\n  the output format (for example, dimensions given in pixels will\n  be converted to inches when converting HTML to LaTeX). Conversion\n  between pixels and physical measurements is affected by the\n  `--dpi` option (by default, 96 dpi is assumed, unless the image\n  itself contains dpi information).\n- The `%` unit is generally relative to some available space.\n  For example the above example will render to the following.\n  - HTML: `<img href=\"file.jpg\" style=\"width: 50%;\" />`\n  - LaTeX: `\\includegraphics[width=0.5\\textwidth,height=\\textheight]{file.jpg}`\n    (If you're using a custom template, you need to configure `graphicx`\n    as in the default template.)\n  - ConTeXt: `\\externalfigure[file.jpg][width=0.5\\textwidth]`\n- Some output formats have a notion of a class\n  ([ConTeXt](https://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings))\n  or a unique identifier (LaTeX `\\caption`), or both (HTML).\n- When no `width` or `height` attributes are specified, the fallback\n  is to look at the image resolution and the dpi metadata embedded in\n  the image file.\n\n## Divs and Spans\n\nUsing the `native_divs` and `native_spans` extensions\n(see [above][Extension: `native_divs`]), HTML syntax can\nbe used as part of Markdown to create native `Div` and `Span`\nelements in the pandoc AST (as opposed to raw HTML).\nHowever, there is also nicer syntax available:\n\n### Extension: `fenced_divs` ###\n\nAllow special fenced syntax for native `Div` blocks.  A Div\nstarts with a fence containing at least three consecutive\ncolons plus some attributes. The attributes may optionally\nbe followed by another string of consecutive colons.\n\nNote:  the `commonmark` parser doesn't permit colons after\nthe attributes.\n\nThe attribute syntax is exactly as in fenced code blocks (see\n[Extension: `fenced_code_attributes`]).  As with fenced\ncode blocks, one can use either attributes in curly braces\nor a single unbraced word, which will be treated as a class\nname.  The Div ends with another line containing a string of at\nleast three consecutive colons.  The fenced Div should be\nseparated by blank lines from preceding and following blocks.\n\nExample:\n\n    ::::: {#special .sidebar}\n    Here is a paragraph.\n\n    And another.\n    :::::\n\nFenced divs can be nested.  Opening fences are distinguished\nbecause they *must* have attributes:\n\n    ::: Warning ::::::\n    This is a warning.\n\n    ::: Danger\n    This is a warning within a warning.\n    :::\n    ::::::::::::::::::\n\nFences without attributes are always closing fences.  Unlike\nwith fenced code blocks, the number of colons in the closing\nfence need not match the number in the opening fence.  However,\nit can be helpful for visual clarity to use fences of different\nlengths to distinguish nested divs from their parents.\n\n\n### Extension: `bracketed_spans` ###\n\nA bracketed sequence of inlines, as one would use to begin\na link, will be treated as a `Span` with attributes if it is\nfollowed immediately by attributes:\n\n    [This is *some text*]{.class key=\"val\"}\n\n## Footnotes\n\n### Extension: `footnotes` ###\n\nPandoc's Markdown allows footnotes, using the following syntax:\n\n    Here is a footnote reference,[^1] and another.[^longnote]\n\n    [^1]: Here is the footnote.\n\n    [^longnote]: Here's one with multiple blocks.\n\n        Subsequent paragraphs are indented to show that they\n    belong to the previous footnote.\n\n            { some.code }\n\n        The whole paragraph can be indented, or just the first\n        line.  In this way, multi-paragraph footnotes work like\n        multi-paragraph list items.\n\n    This paragraph won't be part of the note, because it\n    isn't indented.\n\nThe identifiers in footnote references may not contain spaces, tabs,\nnewlines, or the characters `^`, `[`, or `]`. These identifiers\nare used only to correlate the footnote reference with the note\nitself; in the output, footnotes will be numbered sequentially.\n\nThe footnotes themselves need not be placed at the end of the\ndocument.  They may appear anywhere except inside other block elements\n(lists, block quotes, tables, etc.).  Each footnote should be\nseparated from surrounding content (including other footnotes)\nby blank lines.\n\n### Extension: `inline_notes` ###\n\nInline footnotes are also allowed (though, unlike regular notes,\nthey cannot contain multiple paragraphs).  The syntax is as follows:\n\n    Here is an inline note.^[Inline notes are easier to write, since\n    you don't have to pick an identifier and move down to type the\n    note.]\n\nInline and regular footnotes may be mixed freely.\n\n## Citation syntax\n\n### Extension: `citations` ###\n\nTo cite a bibliographic item with an identifier foo, use the\nsyntax `@foo`.  Normal citations should be included in square\nbrackets, with semicolons separating distinct items:\n\n    Blah blah [@doe99; @smith2000; @smith2004].\n\nHow this is rendered depends on the citation style.  In an\nauthor-date style, it might render as\n\n    Blah blah (Doe 1999, Smith 2000, 2004).\n\nIn a footnote style, it might render as\n\n    Blah blah.[^1]\n\n    [^1]:  John Doe, \"Frogs,\" *Journal of Amphibians* 44 (1999);\n    Susan Smith, \"Flies,\" *Journal of Insects* (2000);\n    Susan Smith, \"Bees,\" *Journal of Insects* (2004).\n\nSee the [CSL user documentation] for more information about CSL\nstyles and how they affect rendering.\n\nUnless a citation key starts with a letter, digit, or `_`,\nand contains only alphanumerics and single internal punctuation\ncharacters (`:.#$%&-+?<>~/`), it must be surrounded\nby curly braces, which are not considered part of the key.\nIn `@Foo_bar.baz.`, the key is `Foo_bar.baz` because the final\nperiod is not *internal* punctuation, so it is not included in\nthe key.  In `@{Foo_bar.baz.}`, the key is `Foo_bar.baz.`, including\nthe final period.\nIn `@Foo_bar--baz`, the key is `Foo_bar` because the repeated internal\npunctuation characters terminate the key.\nThe curly braces are recommended if you use URLs as\nkeys: `[@{https://example.com/bib?name=foobar&date=2000}, p.  33]`.\n\nCitation items may optionally include a prefix, a locator, and\na suffix.  In\n\n    Blah blah [see @doe99, pp. 33-35 and *passim*; @smith04, chap. 1].\n\nthe first item (`doe99`) has prefix `see `, locator `pp.  33-35`,\nand suffix `and *passim*`.  The second item (`smith04`) has\nlocator `chap. 1` and no prefix or suffix.\n\nPandoc uses some heuristics to separate the locator from the\nrest of the subject.  It is sensitive to the locator terms\ndefined in the [CSL locale files].  Either abbreviated or\nunabbreviated forms are accepted. In the `en-US` locale, locator\nterms can be written in either singular or plural forms, as\n`book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,\n`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`,\n`fol.`/`fols.`; `number`, `no.`/`nos.`; `line`, `l.`/`ll.`;\n`note`, `n.`/`nn.`; `opus`, `op.`/`opp.`; `page`, `p.`/`pp.`;\n`paragraph`, `para.`/`paras.`; `part`, `pt.`/`pts.`; `section`,\n`sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`; `verse`,\n`v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no\nlocator term is used, \"page\" is assumed.\n\nIn complex cases, you can force something to be treated as\na locator by enclosing it in curly braces or prevent parsing\nthe suffix as locator by prepending curly braces:\n\n    [@smith{ii, A, D-Z}, with a suffix]\n    [@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]\n    [@smith{}, 99 years later]\n\nA minus sign (`-`) before the `@` will suppress mention of\nthe author in the citation.  This can be useful when the\nauthor is already mentioned in the text:\n\n    Smith says blah [-@smith04].\n\nYou can also write an author-in-text citation, by omitting the\nsquare brackets:\n\n    @smith04 says blah.\n\n    @smith04 [p. 33] says blah.\n\nThis will cause the author's name to be rendered, followed by\nthe bibliographical details.  Use this form when you want to\nmake the citation the subject of a sentence.\n\nWhen you are using a note style, it is usually better to let\nciteproc create the footnotes from citations rather than writing\nan explicit note.  If you do write an explicit note that\ncontains a citation, note that normal citations will be put in\nparentheses, while author-in-text citations will not.  For\nthis reason, it is sometimes preferable to use the\nauthor-in-text style inside notes when using a note style.\n\nMany CSL styles will format citations differently when the\nsame source has been cited earlier.  In documents with chapters,\nit is usually desirable to reset this position information\nat the beginning of every chapter. To do this, add the class\n`reset-citation-positions` to the heading for each chapter:\n\n    # The Beginning {.reset-citation-positions}\n\nNote that this class only has an effect when placed on\ntop-level headings; it is ignored in nested blocks.\n\n[CSL user documentation]: https://citationstyles.org/authors/\n[CSL]: https://docs.citationstyles.org/en/stable/specification.html\n[CSL markup specs]: https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#html-like-formatting-tags\n[Chicago Manual of Style]: https://chicagomanualofstyle.org\n[Citation Style Language]: https://citationstyles.org\n[Zotero Style Repository]: https://www.zotero.org/styles\n[finding and editing styles]: https://citationstyles.org/authors/\n[CSL locale files]: https://github.com/citation-style-language/locales\n\n## Non-default extensions\n\nThe following Markdown syntax extensions are not enabled by default\nin pandoc, but may be enabled by adding `+EXTENSION` to the format\nname, where `EXTENSION` is the name of the extension.  Thus, for\nexample, `markdown+hard_line_breaks` is Markdown with hard line breaks.\n\n### Extension: `rebase_relative_paths` ###\n\nRewrite relative paths for Markdown links and images, depending\non the path of the file containing the link or image link.  For\neach link or image, pandoc will compute the directory of the\ncontaining file, relative to the working directory, and prepend\nthe resulting path to the link or image path.\n\nThe use of this extension is best understood by example.\nSuppose you have a subdirectory for each chapter of a book,\n`chap1`, `chap2`, `chap3`. Each contains a file `text.md` and a\nnumber of images used in the chapter.  You would like to have\n`![image](spider.jpg)` in `chap1/text.md` refer to\n`chap1/spider.jpg` and `![image](spider.jpg)` in `chap2/text.md`\nrefer to `chap2/spider.jpg`.  To do this, use\n\n    pandoc chap*/*.md -f markdown+rebase_relative_paths\n\nWithout this extension, you would have to use\n`![image](chap1/spider.jpg)` in `chap1/text.md` and\n`![image](chap2/spider.jpg)` in `chap2/text.md`.  Links with\nrelative paths will be rewritten in the same way as images.\n\nAbsolute paths and URLs are not changed.  Neither are empty\npaths or paths consisting entirely of a fragment, e.g., `#foo`.\n\nNote that relative paths in reference links and images will\nbe rewritten relative to the file containing the link\nreference definition, not the file containing the reference link\nor image itself, if these differ.\n\n### Extension: `mark` ###\n\nTo highlight out a section of text, begin and end it with\nwith `==`. Thus, for example,\n\n    This ==is deleted text.==\n\n### Extension: `attributes` ###\n\nAllows attributes to be attached to any inline or block-level\nelement when parsing `commonmark`.\nThe syntax for the attributes is the same as that\nused in [`header_attributes`][Extension: `header_attributes`].\n\n- Attributes that occur immediately after an inline\n  element affect that element.  If they follow a space, then they\n  belong to the space.  (Hence, this option subsumes\n  `inline_code_attributes` and `link_attributes`.)\n- Attributes that occur immediately before a block\n  element, on a line by themselves, affect that\n  element.\n- Consecutive attribute specifiers may be used,\n  either for blocks or for inlines.  Their attributes\n  will be combined.\n- Attributes that occur at the end of the text of\n  a Setext or ATX heading (separated by whitespace\n  from the text) affect the heading element. (Hence, this\n  option subsumes `header_attributes`.)\n- Attributes that occur after the opening fence\n  in a fenced code block affect the code block element. (Hence,\n  this option subsumes `fenced_code_attributes`.)\n- Attributes that occur at the end of a reference\n  link definition affect links that refer to that\n  definition.\n\nNote that pandoc's AST does not currently allow attributes\nto be attached to arbitrary elements.  Hence a Span or Div\ncontainer will be added if needed.\n\n### Extension: `old_dashes` ###\n\nSelects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:\n`-` before a numeral is an en-dash, and `--` is an em-dash.\nThis option only has an effect if `smart` is enabled. It is\nselected automatically for `textile` input.\n\n### Extension: `angle_brackets_escapable` ###\n\nAllow `<` and `>` to be backslash-escaped, as they can be in\nGitHub flavored Markdown but not original Markdown.  This is\nimplied by pandoc's default `all_symbols_escapable`.\n\n### Extension: `lists_without_preceding_blankline` ###\n\nAllow a list to occur right after a paragraph, with no intervening\nblank space.\n\n### Extension: `four_space_rule` ###\n\nSelects the pandoc <= 2.0 behavior for parsing lists, so that\nfour spaces indent are needed for list item continuation\nparagraphs.\n\n### Extension: `spaced_reference_links` ###\n\nAllow whitespace between the two components of a reference link,\nfor example,\n\n    [foo] [bar].\n\n### Extension: `hard_line_breaks` ###\n\nCauses all newlines within a paragraph to be interpreted as hard line\nbreaks instead of spaces.\n\n### Extension: `ignore_line_breaks` ###\n\nCauses newlines within a paragraph to be ignored, rather than being\ntreated as spaces or as hard line breaks.  This option is intended for\nuse with East Asian languages where spaces are not used between words,\nbut text is divided into lines for readability.\n\n### Extension: `east_asian_line_breaks` ###\n\nCauses newlines within a paragraph to be ignored, rather than\nbeing treated as spaces or as hard line breaks, when they occur\nbetween two East Asian wide characters.  This is a better choice\nthan `ignore_line_breaks` for texts that include a mix of East\nAsian wide characters and other characters.\n\n### Extension: `emoji` ###\n\nParses textual emojis like `:smile:` as Unicode emoticons.\n\n### Extension: `tex_math_gfm` ###\n\nSupports two GitHub-specific formats for math.\nInline math: ``$`e=mc^2`$``.\n\nDisplay math:\n\n````\n``` math\ne=mc^2\n```\n````\n\n### Extension: `tex_math_single_backslash` ###\n\nCauses anything between `\\(` and `\\)` to be interpreted as inline\nTeX math, and anything between `\\[` and `\\]` to be interpreted\nas display TeX math.  Note: a drawback of this extension is that\nit precludes escaping `(` and `[`.\n\n### Extension: `tex_math_double_backslash` ###\n\nCauses anything between `\\\\(` and `\\\\)` to be interpreted as inline\nTeX math, and anything between `\\\\[` and `\\\\]` to be interpreted\nas display TeX math.\n\n### Extension: `markdown_attribute` ###\n\nBy default, pandoc interprets material inside block-level tags as Markdown.\nThis extension changes the behavior so that Markdown is only parsed\ninside block-level tags if the tags have the attribute `markdown=1`.\n\n### Extension: `mmd_title_block` ###\n\nEnables a [MultiMarkdown] style title block at the top of\nthe document, for example:\n\n    Title:   My title\n    Author:  John Doe\n    Date:    September 1, 2008\n    Comment: This is a sample mmd title block, with\n             a field spanning multiple lines.\n\nSee the MultiMarkdown documentation for details.  If `pandoc_title_block` or\n`yaml_metadata_block` is enabled, it will take precedence over\n`mmd_title_block`.\n\n### Extension: `abbreviations` ###\n\nParses PHP Markdown Extra abbreviation keys, like\n\n    *[HTML]: Hypertext Markup Language\n\nNote that the pandoc document model does not support\nabbreviations, so if this extension is enabled, abbreviation keys are\nsimply skipped (as opposed to being parsed as paragraphs).\n\n### Extension: `alerts` ###\n\nSupports [GitHub-style Markdown alerts], like\n\n    > [!TIP]\n    > Helpful advice for doing things better or more easily.\n\n  [GitHub-style Markdown alerts]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts\n\n### Extension: `autolink_bare_uris` ###\n\nMakes all absolute URIs into links, even when not surrounded by\npointy braces `<...>`.\n\n### Extension: `mmd_link_attributes` ###\n\nParses MultiMarkdown-style key-value attributes on link\nand image references. This extension should not be confused with the\n[`link_attributes`](#extension-link_attributes) extension.\n\n    This is a reference ![image][ref] with MultiMarkdown attributes.\n\n    [ref]: https://path.to/image \"Image title\" width=20px height=30px\n           id=myId class=\"myClass1 myClass2\"\n\n### Extension: `mmd_header_identifiers` ###\n\nParses MultiMarkdown-style heading identifiers (in square brackets,\nafter the heading but before any trailing `#`s in an ATX heading).\n\n### Extension: `gutenberg` ###\n\nUse [Project Gutenberg] conventions for `plain` output:\nall-caps for strong emphasis, surround by underscores\nfor regular emphasis, add extra blank space around headings.\n\n  [Project Gutenberg]: https://www.gutenberg.org\n\n### Extension: `sourcepos` ###\n\nInclude source position attributes when parsing `commonmark`.\nFor elements that accept attributes, a `data-pos` attribute\nis added; other elements are placed in a surrounding\nDiv or Span element with a `data-pos` attribute.\n\n### Extension: `short_subsuperscripts` ###\n\nParse MultiMarkdown-style subscripts and superscripts, which start with\na '~' or '^' character, respectively, and include the alphanumeric sequence\nthat follows. For example:\n\n    x^2 = 4\n\nor\n\n    Oxygen is O~2.\n\n### Extension: `wikilinks_title_after_pipe` ###\n\nPandoc supports multiple Markdown wikilink syntaxes, regardless of\nwhether the title is before or after the pipe.\n\nUsing `--from=markdown+wikilinks_title_after_pipe` results in\n```[[Wiki]]\n[[URL|title]]\n```\n\nwhile using `--from=markdown+wikilinks_title_before_pipe` results\nin\n```[[Wiki]]\n[[title|URL]]\n```\n\n## Markdown variants\n\nIn addition to pandoc's extended Markdown, the following Markdown\nvariants are supported:\n\n- `markdown_phpextra` (PHP Markdown Extra)\n- `markdown_github` (deprecated GitHub-Flavored Markdown)\n- `markdown_mmd` (MultiMarkdown)\n- `markdown_strict` (Markdown.pl)\n- `commonmark` (CommonMark)\n- `gfm` (Github-Flavored Markdown)\n- `commonmark_x` (CommonMark with many pandoc extensions)\n\nTo see which extensions are supported for a given format,\nand which are enabled by default, you can use the command\n\n    pandoc --list-extensions=FORMAT\n\nwhere `FORMAT` is replaced with the name of the format.\n\nNote that the list of extensions for `commonmark`,\n`gfm`, and `commonmark_x` are defined relative to default\ncommonmark.  So, for example, `backtick_code_blocks`\ndoes not appear as an extension, since it is enabled by\ndefault and cannot be disabled.\n\n# Citations\n\nWhen the `--citeproc` option is used, pandoc can automatically generate\ncitations and a bibliography in a number of styles.  Basic usage is\n\n    pandoc --citeproc myinput.txt\n\nTo use this feature, you will need to have\n\n- a document containing citations (see [Citation syntax]);\n- a source of bibliographic data: either an external bibliography\n  file or a list of `references` in the document's YAML metadata;\n- optionally, a [CSL] citation style.\n\n## Specifying bibliographic data\n\nYou can specify an external bibliography using the\n`bibliography` metadata field in a YAML metadata section or the\n`--bibliography` command line argument. If you want to use\nmultiple bibliography files, you can supply multiple\n`--bibliography` arguments or set `bibliography` metadata field\nto YAML array.  A bibliography may have any of these formats:\n\n  Format            File extension\n  ------------      --------------\n  BibLaTeX          .bib\n  BibTeX            .bibtex\n  CSL JSON          .json\n  CSL YAML          .yaml\n  RIS               .ris\n\nNote that `.bib` can be used with both BibTeX and BibLaTeX files;\nuse the extension `.bibtex` to force interpretation as BibTeX.\n\nIn BibTeX and BibLaTeX databases, pandoc parses LaTeX markup\ninside fields such as `title`; in CSL YAML databases, pandoc\nMarkdown; and in CSL JSON databases, an [HTML-like markup][CSL\nmarkup specs]:\n\n`<i>...</i>`\n:   italics\n\n`<b>...</b>`\n:   bold\n\n`<span style=\"font-variant:small-caps;\">...</span>` or `<sc>...</sc>`\n:   small capitals\n\n`<sub>...</sub>`\n:   subscript\n\n`<sup>...</sup>`\n:   superscript\n\n`<span class=\"nocase\">...</span>`\n:   prevent a phrase from being capitalized as title case\n\nAs an alternative to specifying a bibliography file using\n`--bibliography` or the YAML metadata field `bibliography`, you\ncan include the citation data directly in the `references` field\nof the document's YAML metadata. The field should contain an\narray of YAML-encoded references, for example:\n\n    ---\n    references:\n    - type: article-journal\n      id: WatsonCrick1953\n      author:\n      - family: Watson\n        given: J. D.\n      - family: Crick\n        given: F. H. C.\n      issued:\n        date-parts:\n        - - 1953\n          - 4\n          - 25\n      title: 'Molecular structure of nucleic acids: a structure for\n        deoxyribose nucleic acid'\n      title-short: Molecular structure of nucleic acids\n      container-title: Nature\n      volume: 171\n      issue: 4356\n      page: 737-738\n      DOI: 10.1038/171737a0\n      URL: https://www.nature.com/articles/171737a0\n      language: en-GB\n    ...\n\nIf both an external bibliography and inline (YAML metadata)\nreferences are provided, both will be used. In case of\nconflicting `id`s, the inline references will take precedence.\n\nNote that pandoc can be used to produce such a YAML metadata\nsection from a BibTeX, BibLaTeX, or CSL JSON bibliography:\n\n    pandoc chem.bib -s -f biblatex -t markdown\n    pandoc chem.json -s -f csljson -t markdown\n\nIndeed, pandoc can convert between any of these\ncitation formats:\n\n    pandoc chem.bib -s -f biblatex -t csljson\n    pandoc chem.yaml -s -f markdown -t biblatex\n\nRunning pandoc on a bibliography file with the `--citeproc`\noption will create a formatted bibliography in the format\nof your choice:\n\n    pandoc chem.bib -s --citeproc -o chem.html\n    pandoc chem.bib -s --citeproc -o chem.pdf\n\n### Capitalization in titles\n\nIf you are using a bibtex or biblatex bibliography, then observe\nthe following rules:\n\n  - English titles should be in title case.  Non-English titles should\n    be in sentence case, and the `langid` field in biblatex should be\n    set to the relevant language.  (The following values are treated\n    as English:  `american`, `british`, `canadian`, `english`,\n    `australian`, `newzealand`, `USenglish`, or `UKenglish`.)\n\n  - As is standard with bibtex/biblatex, proper names should be\n    protected with curly braces so that they won't be lowercased\n    in styles that call for sentence case.  For example:\n\n        title = {My Dinner with {Andre}}\n\n  - In addition, words that should remain lowercase (or camelCase)\n    should be protected:\n\n        title = {Spin Wave Dispersion on the {nm} Scale}\n\n    Though this is not necessary in bibtex/biblatex, it is necessary\n    with citeproc, which stores titles internally in sentence case,\n    and converts to title case in styles that require it.  Here we\n    protect \"nm\" so that it doesn't get converted to \"Nm\" at this stage.\n\nIf you are using a CSL bibliography (either JSON or YAML), then observe\nthe following rules:\n\n  - All titles should be in sentence case.\n\n  - Use the `language` field for non-English titles to prevent their\n    conversion to title case in styles that call for this. (Conversion\n    happens only if `language` begins with `en` or is left empty.)\n\n  - Protect words that should not be converted to title case using\n    this syntax:\n\n        Spin wave dispersion on the <span class=\"nocase\">nm</span> scale\n\n### Conference Papers, Published vs. Unpublished\n\nFor a formally published conference paper, use the biblatex entry type\n`inproceedings` (which will be mapped to CSL `paper-conference`).\n\nFor an unpublished manuscript, use the biblatex entry type\n`unpublished` without an `eventtitle` field (this entry type\nwill be mapped to CSL `manuscript`).\n\nFor a talk, an unpublished conference paper, or a poster\npresentation, use the biblatex entry type `unpublished` with an\n`eventtitle` field (this entry type will be mapped to CSL\n`speech`). Use the biblatex `type` field to indicate the type,\ne.g. \"Paper\", or \"Poster\". `venue` and `eventdate` may be useful\ntoo, though `eventdate` will not be rendered by most CSL styles.\nNote that `venue` is for the event's venue, unlike `location`\nwhich describes the publisher's location; do not use the latter\nfor an unpublished conference paper.\n\n\n## Specifying a citation style\n\nCitations and references can be formatted using any style supported by the\n[Citation Style Language], listed in the [Zotero Style Repository].\nThese files are specified using the `--csl` option or the `csl`\n(or `citation-style`) metadata field.  By default, pandoc will\nuse the [Chicago Manual of Style] author-date format.  (You can\noverride this default by copying a CSL style of your choice\nto `default.csl` in your user data directory.)\nThe CSL project provides further information on [finding and\nediting styles].\n\nThe `--citation-abbreviations` option (or the\n`citation-abbreviations` metadata field) may be used to specify\na JSON file containing abbreviations of journals that should be\nused in formatted bibliographies when `form=\"short\"` is\nspecified.  The format of the file can be illustrated with an\nexample:\n\n\n    { \"default\": {\n        \"container-title\": {\n                \"Lloyd's Law Reports\": \"Lloyd's Rep\",\n                \"Estates Gazette\": \"EG\",\n                \"Scots Law Times\": \"SLT\"\n        }\n      }\n    }\n\n\n## Citations in note styles\n\nPandoc's citation processing is designed to allow you to\nmove between author-date, numerical, and note styles without\nmodifying the Markdown source.  When you're using a note\nstyle, avoid inserting footnotes manually. Instead, insert\ncitations just as you would in an author-date style---for\nexample,\n\n    Blah blah [@foo, p. 33].\n\nThe footnote will be created automatically. Pandoc will take\ncare of removing the space and moving the note before or\nafter the period, depending on the setting of\n`notes-after-punctuation`, as described below in [Other relevant\nmetadata fields].\n\nIn some cases you may need to put a citation inside a regular\nfootnote.  Normal citations in footnotes (such as `[@foo, p.\n33]`) will be rendered in parentheses.  In-text citations (such\nas `@foo [p. 33]`) will be rendered without parentheses. (A\ncomma will be added if appropriate.)  Thus:\n\n    [^1]:  Some studies [@foo; @bar, p. 33] show that\n    frubulicious zoosnaps are quantical.  For a survey\n    of the literature, see @baz [chap. 1].\n\n\n## Placement of the bibliography\n\nIf the style calls for a list of works cited, it will be placed\nin a div with id `refs`, if one exists:[^note-on-refs]\n\n    ::: {#refs}\n    :::\n\nOtherwise, it will be placed at the end of the document.\nGeneration of the bibliography can be suppressed by setting\n`suppress-bibliography: true` in the YAML metadata.\n\n[^note-on-refs]:\n    Note that if `--file-scope` is used, a div written this way will be\n    given an identifier of the form `FILE__refs`, to avoid duplicate\n    identifiers (see `--file-scope`). In view of this possibility,\n    pandoc will place the bibliography in any div whose identifier is\n    `refs` *or* ends with `__refs`.\n\nIf you wish the bibliography to have a section heading, you can\nset `reference-section-title` in the metadata, or put the heading\nat the beginning of the div with id `refs` (if you are using it)\nor at the end of your document:\n\n    last paragraph...\n\n    # References\n\nThe bibliography will be inserted after this heading.  Note that\nthe `unnumbered` class will be added to this heading, so that the\nsection will not be numbered.\n\nIf you want to put the bibliography into a variable in your\ntemplate, one way to do that is to put the div with id `refs`\ninto a metadata field, e.g.\n\n    ---\n    refs: |\n       ::: {#refs}\n       :::\n    ...\n\nYou can then put the variable `$refs$` into your template where\nyou want the bibliography to be placed.\n\n## Including uncited items in the bibliography\n\nIf you want to include items in the bibliography without actually\nciting them in the body text, you can define a dummy `nocite` metadata\nfield and put the citations there:\n\n    ---\n    nocite: |\n      @item1, @item2\n    ...\n\n    @item3\n\nIn this example, the document will contain a citation for `item3`\nonly, but the bibliography will contain entries for `item1`, `item2`, and\n`item3`.\n\nIt is possible to create a bibliography with all the citations,\nwhether or not they appear in the document, by using a wildcard:\n\n    ---\n    nocite: |\n      @*\n    ...\n\nFor LaTeX output, you can also use [`natbib`] or [`biblatex`] to\nrender the bibliography. In order to do so, specify bibliography\nfiles as outlined above, and add `--natbib` or `--biblatex`\nargument to pandoc invocation. Bear in mind that bibliography\nfiles have to be in either BibTeX (for `--natbib`)\nor BibLaTeX (for `--biblatex`) format.\n\n## Other relevant metadata fields\n\nA few other metadata fields affect bibliography formatting:\n\n`link-citations`\n:   If true, citations will be hyperlinked to the\n    corresponding bibliography entries (for author-date and\n    numerical styles only).  Defaults to false.\n\n`link-bibliography`\n:   If true, DOIs, PMCIDs, PMID, and URLs in bibliographies will\n    be rendered as hyperlinks.  (If an entry contains a DOI, PMCID,\n    PMID, or URL, but none of these fields are rendered by the style,\n    then the title, or in the absence of a title the whole entry, will\n    be hyperlinked.)  Defaults to true.\n\n`lang`\n:   The `lang` field will affect how the style is localized,\n    for example in the translation of labels, the use\n    of quotation marks, and the way items are sorted.\n    (For backwards compatibility, `locale` may be used instead\n    of `lang`, but this use is deprecated.)\n\n    A BCP 47 language tag is expected:  for example, `en`,\n    `de`, `en-US`, `fr-CA`, `ug-Cyrl`.  The unicode extension\n    syntax (after `-u-`) may be used to specify options for\n    collation (sorting) more precisely. Here are some examples:\n\n    - `zh-u-co-pinyin`: Chinese with the Pinyin collation.\n    - `es-u-co-trad`: Spanish with the traditional collation\n      (with `Ch` sorting after `C`).\n    - `fr-u-kb`: French with \"backwards\" accent sorting\n      (with `coté` sorting after `côte`).\n    - `en-US-u-kf-upper`: English with uppercase letters sorting\n       before lower (default is lower before upper).\n\n`notes-after-punctuation`\n:    If true (the default for note styles), pandoc will put\n     footnote references or superscripted numerical citations\n     after following punctuation.  For example, if the source\n     contains `blah blah [@jones99].`, the result will look like\n     `blah blah.[^1]`, with the note moved after the period and\n     the space collapsed.  If false, the space will still be\n     collapsed, but the footnote will not be moved after the\n     punctuation.  The option may also be used in numerical styles\n     that use superscripts for citation numbers (but for these\n     styles the default is not to move the citation).\n\n\n# Slide shows\n\nYou can use pandoc to produce an HTML + JavaScript slide presentation\nthat can be viewed via a web browser.  There are five ways to do this,\nusing [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].\nYou can also produce a PDF slide show using LaTeX [`beamer`], or\nslide shows in Microsoft [PowerPoint] format.\n\nHere's the Markdown source for a simple slide show, `habits.txt`:\n\n    % Habits\n    % John Doe\n    % March 22, 2005\n\n    # In the morning\n\n    ## Getting up\n\n    - Turn off alarm\n    - Get out of bed\n\n    ## Breakfast\n\n    - Eat eggs\n    - Drink coffee\n\n    # In the evening\n\n    ## Dinner\n\n    - Eat spaghetti\n    - Drink wine\n\n    ------------------\n\n    ![picture of spaghetti](images/spaghetti.jpg)\n\n    ## Going to sleep\n\n    - Get in bed\n    - Count sheep\n\nTo produce an HTML/JavaScript slide show, simply type\n\n    pandoc -t FORMAT -s habits.txt -o habits.html\n\nwhere `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.\n\nFor Slidy, Slideous, reveal.js, and S5, the file produced by\npandoc with the `-s/--standalone` option embeds a link to\nJavaScript and CSS files, which are assumed to be available at\nthe relative path `s5/default` (for S5), `slideous` (for\nSlideous), `reveal.js` (for reveal.js), or at the Slidy website\nat `w3.org` (for Slidy).  (These paths can be changed by setting\nthe `slidy-url`, `slideous-url`, `revealjs-url`, or `s5-url`\nvariables; see [Variables for HTML slides], above.) For\nDZSlides, the (relatively short) JavaScript and CSS are included\nin the file by default.\n\nWith all HTML slide formats, the `--self-contained` option can\nbe used to produce a single file that contains all of the data\nnecessary to display the slide show, including linked scripts,\nstylesheets, images, and videos.\n\nTo produce a PDF slide show using beamer, type\n\n    pandoc -t beamer habits.txt -o habits.pdf\n\nNote that a reveal.js slide show can also be converted to a PDF\nby printing it to a file from the browser.\n\nTo produce a PowerPoint slide show, type\n\n    pandoc habits.txt -o habits.pptx\n\n## Structuring the slide show\n\nBy default, the *slide level* is the highest heading level in\nthe hierarchy that is followed immediately by content, and not another\nheading, somewhere in the document. In the example above, level-1 headings\nare always followed by level-2 headings, which are followed by content,\nso the slide level is 2. This default can be overridden using the\n`--slide-level` option.\n\nThe document is carved up into slides according to the following\nrules:\n\n  * A horizontal rule always starts a new slide.\n\n  * A heading at the slide level always starts a new slide.\n\n  * Headings *below* the slide level in the hierarchy create\n    headings *within* a slide.  (In beamer, a \"block\" will be\n    created.  If the heading has the class `example`, an\n    `exampleblock` environment will be used; if it has the class\n    `alert`, an `alertblock` will be used; otherwise a regular\n    `block` will be used.)\n\n  * Headings *above* the slide level in the hierarchy create\n    \"title slides,\" which just contain the section title\n    and help to break the slide show into sections.\n    Non-slide content under these headings will be included\n    on the title slide (for HTML slide shows) or in a\n    subsequent slide with the same title (for beamer).\n\n  * A title page is constructed automatically from the document's title\n    block, if present. (In the case of beamer, this can be disabled\n    by commenting out some lines in the default template.)\n\nThese rules are designed to support many different styles of slide show. If\nyou don't care about structuring your slides into sections and subsections,\nyou can either just use level-1 headings for all slides (in that case, level 1\nwill be the slide level) or you can set `--slide-level=0`.\n\nNote:  in reveal.js slide shows, if slide level is 2, a two-dimensional\nlayout will be produced, with level-1 headings building horizontally\nand level-2 headings building vertically. It is not recommended that\nyou use deeper nesting of section levels with reveal.js unless you set\n`--slide-level=0` (which lets reveal.js produce a one-dimensional layout\nand only interprets horizontal rules as slide boundaries).\n\n### PowerPoint layout choice\n\nWhen creating slides, the pptx writer chooses from a number of pre-defined\nlayouts, based on the content of the slide:\n\nTitle Slide\n:   This layout is used for the initial slide, which is generated and\n    filled from the metadata fields `date`, `author`, and `title`, if\n    they are present.\n\nSection Header\n:   This layout is used for what pandoc calls “title slides”, i.e.\n    slides which start with a header which is above the slide level in\n    the hierarchy.\n\nTwo Content\n:   This layout is used for two-column slides, i.e. slides containing a\n    div with class `columns` which contains at least two divs with class\n    `column`.\n\nComparison\n:   This layout is used instead of “Two Content” for any two-column\n    slides in which at least one column contains text followed by\n    non-text (e.g. an image or a table).\n\nContent with Caption\n:   This layout is used for any non-two-column slides which contain text\n    followed by non-text (e.g. an image or a table).\n\nBlank\n:   This layout is used for any slides which only contain blank content,\n    e.g. a slide containing only speaker notes, or a slide containing\n    only a non-breaking space.\n\nTitle and Content\n:   This layout is used for all slides which do not match the criteria\n    for another layout.\n\nThese layouts are chosen from the default pptx reference doc included with\npandoc, unless an alternative reference doc is specified using\n`--reference-doc`.\n\n## Incremental lists\n\nBy default, these writers produce lists that display \"all at once.\"\nIf you want your lists to display incrementally (one item at a time),\nuse the `-i` option. If you want a particular list to depart from the\ndefault, put it in a `div` block with class `incremental` or\n`nonincremental`. So, for example, using the `fenced div` syntax, the\nfollowing would be incremental regardless of the document default:\n\n    ::: incremental\n\n    - Eat spaghetti\n    - Drink wine\n\n    :::\n\nor\n\n    ::: nonincremental\n\n    - Eat spaghetti\n    - Drink wine\n\n    :::\n\nWhile using `incremental` and `nonincremental` divs is the\nrecommended method of setting incremental lists on a per-case basis,\nan older method is also supported: putting lists inside a blockquote\nwill depart from the document default (that is, it will display\nincrementally without the `-i` option and all at once with the `-i`\noption):\n\n    > - Eat spaghetti\n    > - Drink wine\n\nBoth methods allow incremental and nonincremental lists to be mixed\nin a single document.\n\nIf you want to include a block-quoted list, you can work around\nthis behavior by putting the list inside a fenced div, so that\nit is not the direct child of the block quote:\n\n    > ::: wrapper\n    > - a\n    > - list in a quote\n    > :::\n\n## Inserting pauses\n\nYou can add \"pauses\" within a slide by including a paragraph containing\nthree dots, separated by spaces:\n\n    # Slide with a pause\n\n    content before the pause\n\n    . . .\n\n    content after the pause\n\nNote: this feature is not yet implemented for PowerPoint output.\n\n## Styling the slides\n\nYou can change the style of HTML slides by putting customized CSS files\nin `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),\nor `$DATADIR/slideous` (for Slideous),\nwhere `$DATADIR` is the user data directory (see `--data-dir`, above).\nThe originals may be found in pandoc's system data directory (generally\n`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any\nfiles it does not find in the user data directory.\n\nFor dzslides, the CSS is included in the HTML file itself, and may\nbe modified there.\n\nAll [reveal.js configuration options] can be set through variables.\nFor example, themes can be used by setting the `theme` variable:\n\n    -V theme=moon\n\nOr you can specify a custom stylesheet using the `--css` option.\n\nTo style beamer slides, you can specify a `theme`, `colortheme`,\n`fonttheme`, `innertheme`, and `outertheme`, using the `-V` option:\n\n    pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf\n\nNote that heading attributes will turn into slide attributes\n(on a `<div>` or `<section>`) in HTML slide formats, allowing you\nto style individual slides.  In beamer, a number of heading\nclasses and attributes are recognized as frame options and\nwill be passed through as options to the frame: see\n[Frame attributes in beamer], below.\n\n## Speaker notes\n\nSpeaker notes are supported in reveal.js, PowerPoint (pptx),\nand beamer output. You can add notes to your Markdown document thus:\n\n    ::: notes\n\n    This is my note.\n\n    - It can contain Markdown\n    - like this list\n\n    :::\n\nTo show the notes window in reveal.js, press `s` while viewing the\npresentation. Speaker notes in PowerPoint will be available, as usual,\nin handouts and presenter view.\n\nNotes are not yet supported for other slide formats, but the notes\nwill not appear on the slides themselves.\n\n### Speaker notes on the title slide (PowerPoint)\n\nFor PowerPoint output, the title slide is generated from the document's\nYAML metadata block. To add speaker notes to this slide, use a `notes`\nfield in the metadata:\n\n    ---\n    title: My Presentation\n    author: Jane Doe\n    notes: |\n      Welcome everyone to this presentation.\n\n      Remember to introduce yourself and mention the key topics.\n    ---\n\nThe `notes` field can contain multiple paragraphs and Markdown formatting.\n\n## Columns\n\nTo put material in side by side columns, you can use a native\ndiv container with class `columns`, containing two or more div\ncontainers with class `column` and a `width` attribute:\n\n    :::::::::::::: {.columns}\n    ::: {.column width=\"40%\"}\n    contents...\n    :::\n    ::: {.column width=\"60%\"}\n    contents...\n    :::\n    ::::::::::::::\n\nNote: Specifying column widths does not currently work for PowerPoint.\n\n### Additional columns attributes in beamer\n\nThe div containers with classes `columns` and `column` can optionally have\nan `align` attribute.\nThe class `columns` can optionally have a `totalwidth` attribute or an\n`onlytextwidth` class.\n\n    :::::::::::::: {.columns align=center totalwidth=8em}\n    ::: {.column width=\"40%\"}\n    contents...\n    :::\n    ::: {.column width=\"60%\" align=bottom}\n    contents...\n    :::\n    ::::::::::::::\n\nThe `align` attributes on `columns` and `column` can be used with the\nvalues `top`, `top-baseline`, `center` and `bottom` to vertically align\nthe columns. It defaults to `top` in `columns`.\n\nThe `totalwidth` attribute limits the width of the columns to the given value.\n\n    :::::::::::::: {.columns align=top .onlytextwidth}\n    ::: {.column width=\"40%\" align=center}\n    contents...\n    :::\n    ::: {.column width=\"60%\"}\n    contents...\n    :::\n    ::::::::::::::\n\nThe class `onlytextwidth` sets the `totalwidth` to `\\textwidth`.\n\nSee Section 12.7 of the [Beamer User's Guide] for more details.\n\n## Frame attributes in beamer\n\nSometimes it is necessary to add the LaTeX `[fragile]` option to\na frame in beamer (for example, when using the `minted` environment).\nThis can be forced by adding the `fragile` class to the heading\nintroducing the slide:\n\n    # Fragile slide {.fragile}\n\nAll of the other frame attributes described in Section 8.1 of\nthe [Beamer User's Guide] may also be used: `allowdisplaybreaks`,\n`allowframebreaks`, `b`, `c`, `s`, `t`, `environment`, `label`, `plain`,\n`shrink`, `standout`, `noframenumbering`, `squeeze`.\n`allowframebreaks` is recommended especially for bibliographies, as\nit allows multiple slides to be created if the content overfills the\nframe:\n\n    # References {.allowframebreaks}\n\nIn addition, the `frameoptions` attribute may be used to\npass arbitrary frame options to a beamer slide:\n\n    # Heading {frameoptions=\"squeeze,shrink,customoption=foobar\"}\n\n## Background in reveal.js, beamer, and pptx\n\nBackground images can be added to self-contained reveal.js slide shows,\nbeamer slide shows, and pptx slide shows.\n\n### On all slides (beamer, reveal.js, pptx)\n\nWith beamer and reveal.js, the configuration option `background-image` can be\nused either in the YAML metadata block or as a command-line variable to get the same image on every slide.\n\nNote that for reveal.js, the `background-image` will be used as\na `parallaxBackgroundImage` (see below).\n\nFor pptx, you can use a `--reference-doc` in which\nbackground images have been set on the [relevant\nlayouts](#powerpoint-layout-choice).\n\n#### `parallaxBackgroundImage` (reveal.js)\n\nFor reveal.js, there is also the reveal.js-native option\n`parallaxBackgroundImage`, which produces a parallax scrolling background.\nYou must also set `parallaxBackgroundSize`, and can optionally set\n`parallaxBackgroundHorizontal`\nand `parallaxBackgroundVertical` to configure the scrolling behaviour.\nSee the [reveal.js\ndocumentation](https://revealjs.com/backgrounds/#parallax-background)\nfor more details about the meaning of these options.\n\nIn reveal.js's overview mode, the parallaxBackgroundImage will show up\nonly on the first slide.\n\n### On individual slides (reveal.js, pptx)\n\nTo set an image for a particular reveal.js or pptx slide, add\n`{background-image=\"/path/to/image\"}` to the first slide-level heading on the\nslide (which may even be empty).\n\nAs the [HTML writers pass unknown attributes\nthrough](#extension-link_attributes), other reveal.js background settings also\nwork on individual slides, including `background-size`, `background-repeat`,\n`background-color`, `transition`, and `transition-speed`. (The `data-` prefix\nwill automatically be added.)\n\nNote: `data-background-image` is also supported in pptx for consistency with\nreveal.js – if `background-image` isn’t found, `data-background-image` will be\nchecked.\n\n### On the title slide (reveal.js, pptx)\n\nTo add a background image to the automatically generated title slide for\nreveal.js, use the `title-slide-attributes` variable in the YAML metadata block.\nIt must contain a map of attribute names and values. (Note that the `data-`\nprefix is required here, as it isn’t added automatically.)\n\nFor pptx, pass a `--reference-doc` with the background\nimage set on the “Title Slide” layout.\n\n### Example (reveal.js)\n\n```\n---\ntitle: My Slide Show\nparallaxBackgroundImage: /path/to/my/background_image.png\ntitle-slide-attributes:\n    data-background-image: /path/to/title_image.png\n    data-background-size: contain\n---\n\n## Slide One\n\nSlide 1 has background_image.png as its background.\n\n## {background-image=\"/path/to/special_image.jpg\"}\n\nSlide 2 has a special image for its background, even though the heading has no content.\n```\n\n# EPUBs\n\n## EPUB Metadata\n\nThere are two ways to specify metadata for an EPUB. The first is to use\nthe `--epub-metadata` option, which takes as its argument an XML file\nwith [Dublin Core elements].\n\nThe second way is to use YAML, either in a\n[YAML metadata block][Extension: `yaml_metadata_block`] in a Markdown\ndocument, or in a separate YAML file specified with `--metadata-file`.\nHere is an example of a YAML metadata block with EPUB metadata:\n\n    ---\n    title:\n    - type: main\n      text: My Book\n    - type: subtitle\n      text: An investigation of metadata\n    creator:\n    - role: author\n      text: John Smith\n    - role: editor\n      text: Sarah Jones\n    identifier:\n    - scheme: DOI\n      text: doi:10.234234.234/33\n    publisher:  My Press\n    rights: © 2007 John Smith, CC BY-NC\n    ibooks:\n      version: 1.3.4\n    ...\n\nThe following fields are recognized:\n\n`identifier`\n  ~ Either a string value or an object with fields `text` and\n    `scheme`.  Valid values for `scheme` are `ISBN-10`,\n    `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,\n    `ISBN-13`, `Legal deposit number`, `URN`, `OCLC number`,\n    `Co-publisher’s ISBN-13`, `ISMN-13`, `ISBN-A`, `JP e-code`,\n    `OLCC number`, `JP Magazine ID`, `UPC-12+5`, `BNF Control number`,\n    `ISSN-13`, `ARK`, `Digital file internal version number`.\n\n`title`\n  ~ Either a string value, or an object with fields `file-as` and\n    `type`, or a list of such objects.  Valid values for `type` are\n    `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.\n\n`creator`\n  ~ Either a string value, or an object with fields `role`, `file-as`,\n    and `text`, or a list of such objects.  Valid values for `role` are\n    [MARC relators], but\n    pandoc will attempt to translate the human-readable versions\n    (like \"author\" and \"editor\") to the appropriate marc relators.\n\n`contributor`\n  ~ Same format as `creator`.\n\n`date`\n  ~ A string value in `YYYY-MM-DD` format.  (Only the year is necessary.)\n    Pandoc will attempt to convert other common date formats.\n\n`lang` (or legacy: `language`)\n  ~ A string value in [BCP 47] format.  Pandoc will default to the local\n    language if nothing is specified.\n\n`subject`\n  ~ Either a string value, or an object with fields `text`, `authority`,\n    and `term`, or a list of such objects. Valid values for `authority`\n    are either a [reserved authority value] (currently `AAT`, `BIC`,\n    `BISAC`, `CLC`, `DDC`, `CLIL`, `EuroVoc`, `MEDTOP`, `LCSH`, `NDC`,\n    `Thema`, `UDC`, and `WGS`) or an absolute IRI identifying a custom\n    scheme. Valid values for `term` are defined by the scheme.\n\n`description`\n  ~ A string value.\n\n`type`\n  ~ A string value.\n\n`format`\n  ~ A string value.\n\n`relation`\n  ~ A string value.\n\n`coverage`\n  ~ A string value.\n\n`rights`\n  ~ A string value.\n\n`belongs-to-collection`\n  ~ A string value.  Identifies the name of a collection to which\n    the EPUB Publication belongs.\n\n`group-position`\n  ~ The `group-position` field indicates the numeric position in which\n    the EPUB Publication belongs relative to other works belonging to\n    the same `belongs-to-collection` field.\n\n`cover-image`\n  ~ A string value (path to cover image).\n\n`css` (or legacy: `stylesheet`)\n  ~ A string value (path to CSS stylesheet).\n\n`page-progression-direction`\n  ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`\n    attribute for the [`spine` element].\n\n`accessModes`\n  ~ An array of strings ([schema][accessibility schema]).\n    Defaults to `[\"textual\"]`.\n\n`accessModeSufficient`\n  ~ An array of strings ([schema][accessibility schema]).\n    Defaults to `[\"textual\"]`.\n\n`accessibilityHazards`\n  ~ An array of strings ([schema][accessibility schema]).\n    Defaults to `[\"none\"]`.\n\n`accessibilityFeatures`\n  ~ An array of strings ([schema][accessibility schema]).\n    Defaults to\n\n        - \"alternativeText\"\n        - \"readingOrder\"\n        - \"structuralNavigation\"\n        - \"tableOfContents\"\n\n`accessibilitySummary`\n  ~ A string value.\n\n`ibooks`\n  ~ iBooks-specific metadata, with the following fields:\n\n    - `version`: (string)\n    - `specified-fonts`: `true`|`false` (default `false`)\n    - `ipad-orientation-lock`: `portrait-only`|`landscape-only`\n    - `iphone-orientation-lock`: `portrait-only`|`landscape-only`\n    - `binding`: `true`|`false` (default `true`)\n    - `scroll-axis`: `vertical`|`horizontal`|`default`\n\n[accessibility schema]:  https://kb.daisy.org/publishing/docs/metadata/schema.org/index.html\n[MARC relators]: https://loc.gov/marc/relators/relaterm.html\n[reserved authority value]: https://idpf.github.io/epub-registries/authorities/\n[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem\n\n## The `epub:type` attribute\n\nFor `epub3` output, you can mark up the heading that corresponds to an EPUB\nchapter using the [`epub:type` attribute][epub-type]. For example, to set\nthe attribute to the value `prologue`, use this Markdown:\n\n    # My chapter {epub:type=prologue}\n\nWhich will result in:\n\n    <body epub:type=\"frontmatter\">\n      <section epub:type=\"prologue\">\n        <h1>My chapter</h1>\n\nPandoc will output `<body epub:type=\"bodymatter\">`, unless\nyou use one of the following values, in which case either\n`frontmatter` or `backmatter` will be output.\n\n`epub:type` of first section      `epub:type` of body\n----------------------------      ------------------\nprologue                          frontmatter\nabstract                          frontmatter\nacknowledgments                   frontmatter\ncopyright-page                    frontmatter\ndedication                        frontmatter\ncredits                           frontmatter\nkeywords                          frontmatter\nimprint                           frontmatter\ncontributors                      frontmatter\nother-credits                     frontmatter\nerrata                            frontmatter\nrevision-history                  frontmatter\ntitlepage                         frontmatter\nhalftitlepage                     frontmatter\nseriespage                        frontmatter\nforeword                          frontmatter\npreface                           frontmatter\nfrontispiece                      frontmatter\nappendix                          backmatter\ncolophon                          backmatter\nbibliography                      backmatter\nindex                             backmatter\n\n[epub-type]: http://www.idpf.org/epub/31/spec/epub-contentdocs.html#sec-epub-type-attribute\n\n## Linked media\n\nBy default, pandoc will download media referenced from any `<img>`, `<audio>`,\n`<video>` or `<source>` element present in the generated EPUB,\nand include it in the EPUB container, yielding a completely\nself-contained EPUB.  If you want to link to external media resources\ninstead, use raw HTML in your source and add `data-external=\"1\"` to the tag\nwith the `src` attribute.  For example:\n\n    <audio controls=\"1\">\n      <source src=\"https://example.com/music/toccata.mp3\"\n              data-external=\"1\" type=\"audio/mpeg\">\n      </source>\n    </audio>\n\nIf the input format already is HTML then `data-external=\"1\"` will work\nas expected for `<img>` elements. Similarly, for Markdown, external\nimages can be declared with `![img](url){external=1}`. Note that this\nonly works for images; the other media elements have no native\nrepresentation in pandoc's AST and require the use of raw HTML.\n\n## EPUB styling\n\nBy default, pandoc will include some basic styling\ncontained in its `epub.css` data file.  (To see this,\nuse `pandoc --print-default-data-file epub.css`.)\nTo use a different CSS file, just use the `--css` command\nline option.  A few inline styles are defined in addition; these\nare essential for correct formatting of pandoc's HTML output.\n\nThe `document-css` variable may be set if the more opinionated\nstyling of pandoc's default HTML templates is desired (and\nin that case the variables defined in [Variables for HTML] may\nbe used to fine-tune the style).\n\n# Chunked HTML\n\n`pandoc -t chunkedhtml` will produce a zip archive of linked\nHTML files, one for each section of the original document.\nInternal links will automatically be adjusted to point to\nthe right place, images linked to under the working directory\nwill be incorporated, and navigation links will be added.\nIn addition, a JSON file `sitemap.json` will be included\ndescribing the hierarchical structure of the files.\n\nIf an output file without an extension is specified, then\nit will be interpreted as a directory and the zip archive\nwill be automatically unpacked into it (unless it already\nexists, in which case an error will be raised).  Otherwise\na `.zip` file will be produced.\n\nThe navigation links can be customized by adjusting the\ntemplate.  By default, a table of contents is included only\non the top page. To include it on every page, set the\n`toc` variable manually.\n\n# Jupyter notebooks\n\nWhen creating a [Jupyter notebook], pandoc will try to infer the\nnotebook structure.  Code blocks with the class `code` will be\ntaken as code cells, and intervening content will be taken as\nMarkdown cells.  Attachments will automatically be created for\nimages in Markdown cells. Metadata will be taken from the\n`jupyter` metadata field.  For example:\n\n````\n---\ntitle: My notebook\njupyter:\n  nbformat: 4\n  nbformat_minor: 5\n  kernelspec:\n     display_name: Python 2\n     language: python\n     name: python2\n  language_info:\n     codemirror_mode:\n       name: ipython\n       version: 2\n     file_extension: \".py\"\n     mimetype: \"text/x-python\"\n     name: \"python\"\n     nbconvert_exporter: \"python\"\n     pygments_lexer: \"ipython2\"\n     version: \"2.7.15\"\n---\n\n# Lorem ipsum\n\n**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\nbibendum felis dictum sodales.\n\n``` code\nprint(\"hello\")\n```\n\n## Pyout\n\n``` code\nfrom IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")\n```\n\n## Image\n\nThis image ![image](myimage.png) will be\nincluded as a cell attachment.\n````\n\nIf you want to add cell attributes, group cells differently, or\nadd output to code cells, then you need to include divs to\nindicate the structure. You can use either [fenced\ndivs][Extension: `fenced_divs`] or [native divs][Extension:\n`native_divs`] for this.  Here is an example:\n\n````\n:::::: {.cell .markdown}\n# Lorem\n\n**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\nbibendum felis dictum sodales.\n::::::\n\n:::::: {.cell .code execution_count=1}\n``` {.python}\nprint(\"hello\")\n```\n\n::: {.output .stream .stdout}\n```\nhello\n```\n:::\n::::::\n\n:::::: {.cell .code execution_count=2}\n``` {.python}\nfrom IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")\n```\n\n::: {.output .execute_result execution_count=2}\n```{=html}\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\nhello\n```\n:::\n::::::\n````\n\nIf you include raw HTML or TeX in an output cell, use the\n[raw attribute](#extension-raw_attribute), as shown\nin the last cell of the example above.  Although pandoc can\nprocess \"bare\" raw HTML and TeX, the result is often\ninterspersed raw elements and normal textual elements, and\nin an output cell pandoc expects a single, connected raw\nblock.  To avoid using raw HTML or TeX except when\nmarked explicitly using raw attributes, we recommend\nspecifying the extensions `-raw_html-raw_tex+raw_attribute` when\ntranslating between Markdown and ipynb notebooks.\n\nNote that options and extensions that affect reading and\nwriting of Markdown will also affect Markdown cells in ipynb\nnotebooks.  For example, `--wrap=preserve` will preserve\nsoft line breaks in Markdown cells; `--markdown-headings=setext` will\ncause Setext-style headings to be used; and `--preserve-tabs` will\nprevent tabs from being turned to spaces.\n\n# Vimdoc\n\nVimdoc writer generates Vim help files and makes use of the following metadata\nvariables:\n\n``` yaml\nabstract: \"A short description\"\nauthor: Author\ntitle: Title\n\n# Vimdoc-specific\nfilename: \"definition-lists.txt\"\nvimdoc-prefix: pandoc\n```\n\nComplete header requires `abstract`, `author`, `title` and `filename` to\nbe set. Compiling file with such metadata produces the following file\n(assumes `--standalone`, see [Templates]):\n\n``` vimdoc\n*definition-lists.txt*  A short description\n\n                            Title by Author\n\n\n                                 Type |gO| to see the table of contents.\n\n[...]\n\n vim:tw=72:sw=4:ts=4:ft=help:norl:et:\n```\n\nIf `vimdoc-prefix` is set, all non-command tags are prefixed with its\nvalue, it is used to prevent tag collision: all headers have a tag\n(either inferred or explicit) and multiple help pages can have the same\nheader names, therefore collision is to be expected. Let our input be\nthe following markdown file:\n\n``` markdown\n## Header\n\n`:[range]Fnl {expr}`{#:Fnl}\n:   Evaluates {expr} or range\n\n`vim.b`{#vim.b}\n:   Buffer-scoped (`:h b:`) variables for the current buffer. Invalid or unset\n    key returns `nil`. Can be indexed with an integer to access variables for a\n    specific buffer.\n\n[Span]{#span}\n:   generic inline container for phrasing content, which does not inherently\n    represent anything.\n```\n\nConvert it to vimdoc:\n\n``` vimdoc\n------------------------------------------------------------------------\nHeader                                                            *header*\n\n:[range]Fnl {expr}                                                  *:Fnl*\n    Evaluates {expr} or range\n`vim.b`                                                            *vim.b*\n    Buffer-scoped (|b:|) variables for the current buffer. Invalid or\n    unset key returns `nil`. Can be indexed with an integer to access\n    variables for a specific buffer.\nSpan                                                                *span*\n    generic inline container for phrasing content, which does not\n    inherently represent anything.\n```\n\nConvert it to vimdoc with metadata variable set (e.g. with\n`-M vimdoc-prefix=pandoc`)\n\n``` vimdoc\n------------------------------------------------------------------------\nHeader                                                     *pandoc-header*\n\n:[range]Fnl {expr}                                                  *:Fnl*\n    Evaluates {expr} or range\n`vim.b`                                                     *pandoc-vim.b*\n    Buffer-scoped (|b:|) variables for the current buffer. Invalid or\n    unset key returns `nil`. Can be indexed with an integer to access\n    variables for a specific buffer.\nSpan                                                         *pandoc-span*\n    generic inline container for phrasing content, which does not\n    inherently represent anything.\n```\n\n`vim.b` and `Span` got their prefixes but not `:Fnl` because ex-commands\n(those starting with `:`) don't get a prefix, since they are considered\nunique across help pages.\n\nIn both cases `:help b:` became reference `|b:|` (also works with\n`:h b:`). Links pointing to either <https://vimhelp.org/> or\n<https://neovim.io/doc/user> become references too.\n\nVim traditionally wraps at 78, but Pandoc defaults to 72. Use\n`--columns 78` to match Vim.\n\n# Syntax highlighting\n\nPandoc will automatically highlight syntax in [fenced code blocks] that\nare marked with a language name.  The Haskell library [skylighting] is\nused for highlighting. Currently highlighting is supported only for\nHTML, EPUB, Docx, Ms, Man, Typst, and LaTeX/PDF output. To see a list\nof language names that pandoc will recognize, type `pandoc\n--list-highlight-languages`.\n\nThe color scheme can be selected using the `--syntax-highlighting`\noption. The default color scheme is `pygments`, which imitates the\ndefault color scheme used by the Python library pygments (though\npygments is not actually used to do the highlighting). To see a\nlist of highlight styles, type `pandoc --list-highlight-styles`.\n\nIf you are not satisfied with the predefined styles, you can use\n`--print-highlight-style` to generate a JSON `.theme` file which\ncan be modified and used as the argument to\n`--syntax-highlighting`. To get a JSON version of the `pygments`\nstyle, for example:\n\n    pandoc -o my.theme --print-highlight-style pygments\n\nThen edit `my.theme` and use it like this:\n\n    pandoc --syntax-highlighting my.theme\n\nIf you are not satisfied with the built-in highlighting, or you\nwant to highlight a language that isn't supported, you can use the\n`--syntax-definition` option to load a [KDE-style XML syntax definition\nfile](https://docs.kde.org/stable5/en/kate/katepart/highlight.html).\nBefore writing your own, have a look at KDE's [repository of syntax\ndefinitions](https://github.com/KDE/syntax-highlighting/tree/master/data/syntax).\n\nIf you receive an error that pandoc \"Could not read highlighting theme\",\ncheck that the JSON file is encoded with UTF-8 and has no Byte-Order Mark (BOM).\n\nTo disable highlighting, use `--syntax-highlighting=none`.\n\nTo use a format's idiomatic syntax highlighting instead of\npandoc's built-in highlighting, use `--syntax-highlighting=idiomatic`.\nCurrently, `idiomatic` only affects the following formats:\n\n- In reveal.js, it causes reveal.js's highlighting plugin to be\n  used for source code highlighting.  The style may be customized\n  by setting the `highlightjs-theme` variable.\n\n- In Typst, it causes Typst's built-in highlighting to be used.\n  (This is also the default for Typst.)\n\n- In LaTeX, it causes the [`listings`][] package  to be used. Note that\n  `listings` does not support multi-byte encoding for source code. To handle\n  UTF-8 you would need to use a custom template. This issue is fully\n  documented here: [Encoding issue with the listings package][].\n\n- In other formats, `idiomatic` will have the same result as `default`.\n\n[skylighting]: https://github.com/jgm/skylighting\n\n# Custom Styles\n\nCustom styles can be used in the docx, odt and ICML formats.\n\n## Output\n\nBy default, pandoc's odt, docx and ICML output applies a predefined set of\nstyles for blocks such as paragraphs and block quotes, and uses largely\ndefault formatting (italics, bold) for inlines. This will work for most\npurposes, especially alongside a [reference doc](#option--reference-doc) file.\nHowever, if you need to apply your own styles to blocks, or match a preexisting\nset of styles, pandoc allows you to define custom styles for blocks and text\nusing `div`s and `span`s, respectively.\n\nIf you define a Div, Span, or Table with the attribute\n`custom-style`, pandoc will apply your specified style to the\ncontained elements (with the exception of elements whose function\ndepends on a style, like headings, code blocks, block quotes, or\nlinks). So, for example, using the `bracketed_spans` syntax,\n\n    [Get out]{custom-style=\"Emphatically\"}, he said.\n\nwould produce a file with \"Get out\" styled with character\nstyle `Emphatically`. Similarly, using the `fenced_divs` syntax,\n\n    Dickinson starts the poem simply:\n\n    ::: {custom-style=\"Poetry\"}\n    | A Bird came down the Walk---\n    | He did not know I saw---\n    :::\n\nwould style the two contained lines with the `Poetry` paragraph style.\n\nStyles will be defined in the output file as inheriting\nfrom normal text (docx) or Default Paragraph Style (odt), if the\nstyles are not yet in your [reference doc](#option--reference-doc).\nIf they are already defined, pandoc will not alter the definition.\n\nThis feature allows for greatest customization in conjunction with\n[pandoc filters]. If you want all paragraphs after block quotes to be\nindented, you can write a filter to apply the styles necessary. If you\nwant all italics to be transformed to the `Emphasis` character style\n(perhaps to change their color), you can write a filter which will\ntransform all italicized inlines to inlines within an `Emphasis`\ncustom-style `span`.\n\nFor docx or odt output, you don't need to enable any extensions for\ncustom styles to work.\n\nFor icml output, you can also set an `object-style` in images:\n\n    ![Image with object style](myImage.jpg){object-style=\"fixedSizeImage\"}\n\nIn InDesign you'll see that object style given to the image,\nand you'll be able to customize it, or load its definition from\na template of yours.\n\n[pandoc filters]: https://pandoc.org/filters.html\n\n## Input\n\nThe docx reader, by default, only reads those styles that it can\nconvert into pandoc elements, either by direct conversion or\ninterpreting the derivation of the input document's styles.\n\nBy enabling the [`styles` extension](#ext-styles) in the docx reader\n(`-f docx+styles`), you can produce output that maintains the styles\nof the input document, using the `custom-style` class. A `custom-style`\nattribute will be added for each style. Divs will be created to\nhold the paragraph styles, and Spans to hold the character styles.\nTable styles will be applied directly to the Table.\n\nFor example, using the `custom-style-reference.docx` file in the test\ndirectory, we have the following different outputs:\n\nWithout the `+styles` extension:\n\n    $ pandoc test/docx/custom-style-reference.docx -f docx -t markdown\n    This is some text.\n\n    This is text with an *emphasized* text style. And this is text with a\n    **strengthened** text style.\n\n    > Here is a styled paragraph that inherits from Block Text.\n\nAnd with the extension:\n\n    $ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown\n\n    ::: {custom-style=\"First Paragraph\"}\n    This is some text.\n    :::\n\n    ::: {custom-style=\"Body Text\"}\n    This is text with an [emphasized]{custom-style=\"Emphatic\"} text style.\n    And this is text with a [strengthened]{custom-style=\"Strengthened\"}\n    text style.\n    :::\n\n    ::: {custom-style=\"My Block Style\"}\n    > Here is a styled paragraph that inherits from Block Text.\n    :::\n\nWith these custom styles, you can use your input document as a\nreference-doc while creating docx output (see below), and maintain the\nsame styles in your input and output files.\n\n# Custom readers and writers\n\nPandoc can be extended with custom readers and writers written\nin [Lua].  (Pandoc includes a Lua interpreter, so Lua need not\nbe installed separately.)\n\nTo use a custom reader or writer, simply specify the path to the\nLua script in place of the input or output format. For example:\n\n    pandoc -t data/sample.lua\n    pandoc -f my_custom_markup_language.lua -t latex -s\n\nIf the script is not found relative to the working directory,\nit will be sought in the `custom` subdirectory of the user data\ndirectory (see `--data-dir`).\n\nA custom reader is a Lua script that defines one function,\nReader, which takes a string as input and returns a Pandoc\nAST.  See the [Lua filters documentation] for documentation\nof the functions that are available for creating pandoc\nAST elements.  For parsing, the [lpeg] parsing library\nis available by default. To see a sample custom reader:\n\n    pandoc --print-default-data-file creole.lua\n\nIf you want your custom reader to have access to reader options\n(e.g. the tab stop setting), you give your Reader function a\nsecond `options` parameter.\n\nA custom writer is a Lua script that defines a function\nthat specifies how to render each element in a Pandoc AST.\nSee the [djot-writer.lua] for a full-featured example.\n\nNote that custom writers have no default template.  If you want\nto use `--standalone` with a custom writer, you will need to\nspecify a template manually using `--template` or add a new\ndefault template with the name\n`default.NAME_OF_CUSTOM_WRITER.lua` to the `templates`\nsubdirectory of your user data directory (see [Templates]).\n\n[Lua]: https://www.lua.org\n[lpeg]:  http://www.inf.puc-rio.br/~roberto/lpeg/\n[djot-writer.lua]: https://github.com/jgm/djot.lua/blob/main/djot-writer.lua\n\n# Reproducible builds\n\nSome of the document formats pandoc targets (such as EPUB,\ndocx, and ODT) include build timestamps in the generated document.\nThat means that the files generated on successive builds will\ndiffer, even if the source does not.  To avoid this, set the\n`SOURCE_DATE_EPOCH` environment variable, and the timestamp will\nbe taken from it instead of the current time.\n`SOURCE_DATE_EPOCH` should contain an integer unix timestamp\n(specifying the number of seconds since midnight UTC January 1, 1970).\n\nFor reproducible builds with LaTeX, you can either specify the\n`pdf-trailer-id` in the metadata or leave it undefined, in which\ncase pandoc will create a trailer-id based on a hash of the\n`SOURCE_DATE_EPOCH` and the document's contents.\n\nSome document formats also include a unique identifier.  For\nEPUB, this can be set explicitly by setting the `identifier`\nmetadata field (see [EPUB Metadata], above).\n\n# Accessible PDFs and PDF archiving standards\n\nPDF is a flexible format, and using PDF in certain contexts\nrequires additional conventions. For example, PDFs are not\naccessible by default; they define how characters are placed on a\npage but do not contain semantic information on the content.\nHowever, it is possible to generate accessible PDFs, which use\ntagging to add semantic information to the document.\n\nPandoc defaults to LaTeX to generate PDF. LaTeX's `\\DocumentMetadata`\ninterface supports PDF standards and tagging when using LuaLaTeX;\nset the `pdfstandard` variable to enable this (see below). For older\nLaTeX installations, alternative engines must be used.\n\nThe PDF standards PDF/A and PDF/UA define further restrictions\nintended to optimize PDFs for archiving and accessibility. Tagging\nis commonly used in combination with these standards to ensure\nbest results.\n\nNote, however, that standard compliance depends on many things,\nincluding the colorspace of embedded images. Pandoc cannot check\nthis, and external programs must be used to ensure that generated\nPDFs are in compliance.\n\n## LaTeX\n\nSet the `pdfstandard` variable to produce tagged PDFs conforming\nto PDF/A, PDF/X, or PDF/UA standards. For example:\n\n    pandoc -V pdfstandard=ua-2 --pdf-engine=lualatex doc.md -o doc.pdf\n\nMultiple standards can be combined:\n\n    ---\n    pdfstandard:\n      - ua-2\n      - a-4f\n    ---\n\nThe required PDF version is inferred automatically. This feature\nrequires LuaLaTeX in TeX Live 2025 with LaTeX kernel 2025-06-01\nor newer.\n\n## ConTeXt\n\nConTeXt always produces tagged PDFs, but the quality depends on\nthe input. The default ConTeXt markup generated by pandoc is\noptimized for readability and reuse, not tagging. Enable the\n[`tagging`](#extension--tagging) format extension to force markup\nthat is optimized for tagging. For example:\n\n    pandoc -t context+tagging doc.md -o doc.pdf\n\nA recent `context` version should be used, as older versions\ncontained a bug that lead to invalid PDF metadata.\n\n## WeasyPrint\n\nThe HTML-based engine WeasyPrint includes experimental support for\nPDF/A and PDF/UA since version 57. Tagged PDFs can created with\n\n    pandoc --pdf-engine=weasyprint \\\n           --pdf-engine-opt=--pdf-variant=pdf/ua-1 ...\n\nThe feature is experimental and standard compliance should not be\nassumed.\n\n## Prince XML\n\nThe non-free HTML-to-PDF converter `prince` has extensive support\nfor various PDF standards as well as tagging. E.g.:\n\n    pandoc --pdf-engine=prince \\\n           --pdf-engine-opt=--tagged-pdf ...\n\nSee the prince documentation for more info.\n\n## Typst\n\nTypst 0.12 can produce PDF/A-2b:\n\n    pandoc --pdf-engine=typst --pdf-engine-opt=--pdf-standard=a-2b ...\n\n## Word Processors\n\nWord processors like LibreOffice and MS Word can also be used to\ngenerate standardized and tagged PDF output. Pandoc does not\nsupport direct conversions via these tools. However, pandoc can\nconvert a document to a `docx` or `odt` file, which can then be\nopened and converted to PDF with the respective word processor.\nSee the documentation for [Word][word-accessible-pdfs] and\n[LibreOffice][lo-pdf-export].\n\n[word-accessible-pdfs]: https://support.microsoft.com/en-us/office/create-accessible-pdfs-064625e0-56ea-4e16-ad71-3aa33bb4b7ed\n[lo-pdf-export]: https://help.libreoffice.org/latest/en-US/text/shared/01/ref_pdf_export_general.html\n\n\n# Running pandoc as a web server\n\nIf you rename (or symlink) the pandoc executable to\n`pandoc-server`, or if you call pandoc with `server` as the first\nargument, it will start up a web server with a JSON API. This\nserver exposes most of the conversion functionality of pandoc. For\nfull documentation, see the [pandoc-server] man page.\n\nIf you rename (or symlink) the pandoc executable to\n`pandoc-server.cgi`, it will function as a CGI program\nexposing the same API as `pandoc-server`.\n\n`pandoc-server` is designed to be maximally secure; it uses\nHaskell's type system to provide strong guarantees that no I/O\nwill be performed on the server during pandoc conversions.\n\n[pandoc-server]: https://github.com/jgm/pandoc/blob/master/doc/pandoc-server.md\n\n# Running pandoc as a Lua interpreter\n\nCalling the pandoc executable under the name `pandoc-lua` or with\n`lua` as the first argument will make it function as a standalone\nLua interpreter. The behavior is mostly identical to that of the\n[standalone `lua` executable][lua standalone], version 5.4.\nAll `pandoc.*` packages, as well as the packages `re` and `lpeg`,\nare available via global variables. Furthermore, the globals\n`PANDOC_VERSION`, `PANDOC_STATE`, and `PANDOC_API_VERSION` are\nset at startup. For full documentation, see the [pandoc-lua] man page.\n\n[lua standalone]: https://www.lua.org/manual/5.4/manual.html#7\n[pandoc-lua]: https://github.com/jgm/pandoc/blob/master/doc/pandoc-lua.md\n\n# A note on security\n\n1. Although pandoc itself will not create or modify any files other\n   than those you explicitly ask it create (with the exception\n   of temporary files used in producing PDFs), a filter or custom\n   writer could in principle do anything on your file system. Please\n   audit filters and custom writers very carefully before using them.\n\n2. Several input formats (including LaTeX, Org, RST, and Typst)\n   support `include` directives that allow the contents of a file to be\n   included in the output. An untrusted attacker could use these\n   to view the contents of files on the file system. (Using the\n   `--sandbox` option can protect against this threat.)\n\n3. Several output formats (including RTF, FB2, HTML with\n   `--self-contained`, EPUB, Docx, and ODT) will embed encoded\n   or raw images into the output file.  An untrusted attacker\n   could exploit this to view the contents of non-image files on the\n   file system.  (Using the `--sandbox` option can protect\n   against this threat, but will also prevent including images in\n   these formats.)\n\n4. In reading HTML files, pandoc will attempt to include the\n   contents of `iframe` elements by fetching content from the\n   local file or URL specified by `src`. If untrusted HTML is\n   processed on a server, this has the potential to reveal anything\n   readable by the process running the server. Using the `-f html+raw_html`\n   will mitigate this threat by causing the whole `iframe`\n   to be parsed as a raw HTML block. Using `--sandbox` will also\n   protect against the threat.\n\n5. If your application uses pandoc as a Haskell library (rather than\n   shelling out to the executable), it is possible to use it in a mode\n   that fully isolates pandoc from your file system, by running the\n   pandoc operations in the `PandocPure` monad. See the document\n   [Using the pandoc API](https://pandoc.org/using-the-pandoc-api.html)\n   for more details. (This corresponds to the use of the `--sandbox`\n   option on the command line.)\n\n6. Pandoc's parsers can exhibit pathological performance on some\n   corner cases.  It is wise to put any pandoc operations under\n   a timeout, to avoid DOS attacks that exploit these issues.\n   If you are using the pandoc executable, you can add the\n   command line options `+RTS -M512M -RTS` (for example) to limit\n   the heap size to 512MB.  Note that the `commonmark` parser\n   (including `commonmark_x` and `gfm`) is much less vulnerable\n   to pathological performance than the `markdown` parser, so\n   it is a better choice when processing untrusted input.\n\n7. The HTML generated by pandoc is not guaranteed to be safe.\n   If `raw_html` is enabled for the Markdown input, users can\n   inject arbitrary HTML.  Even if `raw_html` is disabled,\n   users can include dangerous content in URLs and attributes.\n   To be safe, you should run all HTML generated from untrusted\n   user input through an HTML sanitizer.\n\n# Authors\n\nCopyright 2006--2024 John MacFarlane (jgm@berkeley.edu). Released\nunder the [GPL], version 2 or greater.  This software carries no\nwarranty of any kind.  (See COPYRIGHT for full copyright and\nwarranty notices.) For a full list of contributors, see the file\nAUTHORS.md in the pandoc source code.\n\n[GPL]: https://www.gnu.org/copyleft/gpl.html \"GNU General Public License\"\n[YAML]: https://yaml.org/spec/1.2/spec.html \"YAML v1.2 Spec\"\n"
  },
  {
    "path": "Makefile",
    "content": "VERSION?=$(shell grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}')\nPANDOC_CLI_VERSION?=$(shell grep '^[Vv]ersion:' pandoc-cli/pandoc-cli.cabal | awk '{print $$2;}')\nSOURCEFILES?=$(shell git ls-tree -r main --name-only src pandoc-cli pandoc-server pandoc-lua-engine | grep \"\\.hs$$\")\nPANDOCSOURCEFILES?=$(shell git ls-tree -r main --name-only src | grep \"\\.hs$$\")\nDOCKERIMAGE=quay.io/benz0li/ghc-musl:9.10\nTIMESTAMP=$(shell date \"+%Y%m%d_%H%M\")\nLATESTBENCH=$(word 1,$(shell ls -t bench_*.csv 2>/dev/null))\nBASELINE?=$(LATESTBENCH)\nROOT?=Text.Pandoc\nifeq ($(BASELINE),)\nBASELINECMD=\nelse\nBASELINECMD=--baseline $(BASELINE)\nendif\nCABALOPTS?=--disable-optimization -f-export-dynamic -fhttp --ghc-option=-fwrite-ide-info --ghc-option=-fdiagnostics-color=always --ghc-option=-j\nWEBSITE=../../web/pandoc.org\nREVISION?=1\nBENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T --nonmoving-gc -RTS $(if $(PATTERN),--pattern \"$(PATTERN)\",)\npandoc=$(shell cabal list-bin $(CABALOPTS) pandoc-cli)\nOPTIMIZE_WASM?=1\n\nall: build test binpath ## build executable and run tests\n.PHONY: all\n\nbuild: ## build executable\n\tcabal build \\\n\t  $(CABALOPTS) pandoc-cli\n.PHONY: build\n\nprof: ## build with profiling and optimizations\n\tcabal build --enable-profiling all\n.PHONY: prof\n\nbinpath: ## print path of built pandoc executable\n\t@cabal list-bin -v0 $(CABALOPTS) pandoc-cli\n.PHONY: binpath\n\nghcid: ## run ghcid\n\tghcid -c 'cabal repl pandoc'\n.PHONY: ghcid\n\nrepl:  ## run cabal repl\n\tcabal repl $(CABALOPTS) pandoc\n.PHONY: repl\n\nlinecounts: ## print line counts for each module\n\t@wc -l $(SOURCEFILES) | sort -n\n.PHONY: linecounts\n\n# Note:  to accept current results of golden tests,\n# make test TESTARGS='--accept'\ntest:  ## unoptimized build and run tests with cabal\n\tcabal test \\\n\t  $(CABALOPTS) \\\n\t  --test-options=\"--hide-successes --ansi-tricks=false $(TESTARGS)\" all\n.PHONY: test\n\nquick-stack: ## unoptimized build and tests with stack\n\tstack install \\\n\t  --system-ghc --flag 'pandoc:embed_data_files' \\\n\t  --fast \\\n\t  --test \\\n\t  --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)'\n.PHONY: quick-stack\n\nprerelease: validate-epub README.md fix_spacing check-cabal check-stack checkdocs man check-version-sync check-changelog check-manversion uncommitted_changes ## prerelease checks\n.PHONY: prerelease\n\nuncommitted_changes:\n\t! git diff | grep '.'\n.PHONY: uncommitted_changes\n\nauthors:  ## prints unique authors since last released version\n\tgit log --pretty=format:\"%an\" $$(git tag -l | grep '[^0-9]' | sort | tail -1)..HEAD | sort | uniq | while read -r; do grep -i -q \"^- $$REPLY\" AUTHORS.md || echo $$REPLY ; done\n\ncheck-stack:\n\t$$HOME/.local/bin/stack-lint-extra-deps # check that stack.yaml dependencies are up to date\n\t! grep 'git:' stack.yaml # use only released versions\n.PHONY: check-stack\n\ncheck-cabal: git-files.txt sdist-files.txt\n\t@echo \"Checking to see if all committed test/data files are in sdist.\"\n\tdiff -u $^\n\t@for pkg in . pandoc-lua-engine pandoc-server pandoc-cli; \\\n\tdo \\\n\t     pushd $$pkg ; \\\n\t     cabal check --ignore=missing-upper-bounds ; \\\n\t     cabal outdated ; \\\n\t     popd ; \\\n\tdone\n\t! grep 'git:' cabal.project # use only released versions\n\n.PHONY: check-cabal\n\ncheck-version-sync:\n\t@echo \"Checking for match between pandoc and pandoc-cli versions\"\n\t[ $(VERSION) == $(PANDOC_CLI_VERSION) ]\n\t@echo \"Checking that pandoc-cli depends on this version of pandoc\"\n\tgrep 'pandoc == $(VERSION)' pandoc-cli/pandoc-cli.cabal\n.PHONY: check-version-sync\n\ncheck-changelog:\n\t@echo \"Checking for changelog entry for this version\"\n\trg '## pandoc $(VERSION) \\(\\d\\d\\d\\d-\\d\\d-\\d\\d\\)' changelog.md\n.PHONY: check-changelog\n\ncheck-manversion:\n\t@echo \"Checking version number in man pages\"\n\tgrep '\"pandoc $(VERSION)\"' \"pandoc-cli/man/pandoc.1\"\n\tgrep '\"pandoc $(VERSION)\"' \"pandoc-cli/man/pandoc-server.1\"\n\tgrep '\"pandoc $(VERSION)\"' \"pandoc-cli/man/pandoc-lua.1\"\n.PHONY: check-manversion\n\ncheckdocs:\n\t@echo \"Checking for tabs in manual.\"\n\t! rg -n -e '\\t' \\\n\t   MANUAL.txt changelog.md doc/pandoc-server.md doc/pandoc-lua.md\n.PHONY: checkdocs\n\nbench: ## build and run benchmarks\n\tcabal bench --benchmark-options='$(BENCHARGS)' 2>&1 | tee \"bench_$(TIMESTAMP).txt\"\n.PHONY: bench\n\nreformat: ## reformat with stylish-haskell\n\tfor f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done\n.PHONY: reformat\n\nlint: ## run hlint\n\thlint --report=hlint.html $(SOURCEFILES) || open hlint.html\n.PHONY: lint\n\nfix_spacing: ## fix trailing newlines and spaces\n\t@ERRORS=0; echo \"Checking for spacing errors...\" && for f in $(SOURCEFILES); do printf '%s\\n' \"`cat $$f`\" | sed -e 's/  *$$//' > $$f.tmp; diff -u $$f $$f.tmp || ERRORS=1; mv $$f.tmp $$f; done; [ $$ERRORS -eq 0 ] || echo \"Spacing errors have been fixed; please commit the changes.\"; exit $$ERRORS\n.PHONY: fix_spacing\n\nchanges_github: ## copy this release's changes in gfm\n\t@$(pandoc) --lua-filter tools/extract-changes.lua changelog.md -t gfm --wrap=none --template tools/changes_template.html | sed -e 's/\\\\#/#/g'\n.PHONY: changes_github\n\nman: pandoc-cli/man/pandoc.1 pandoc-cli/man/pandoc-server.1 pandoc-cli/man/pandoc-lua.1 ## build man pages\n.PHONY: man\n\nlatex-package-dependencies: ## print packages used by default latex template\n\t$(pandoc) lua tools/latex-package-dependencies.lua\n.PHONY: latex-package-dependencies\n\ncoverage: ## code coverage information\n\tcabal test \\\n\t  --ghc-option=-fhpc \\\n\t  $(CABALOPTS) \\\n\t  --test-options=\"--hide-successes --ansi-tricks=false $(TESTARGS)\"\n\thpc markup --destdir=coverage test/test-pandoc.tix\n\topen coverage/hpc_index.html\n.PHONY: coverage\n\ntransitive-deps: ## print transitive dependencies\n\tcabal-plan topo | sort | sed -e 's/-[0-9]\\..*//'\n.PHONY: transitive-deps\n\ndebpkg: ## create linux package\n\tdocker run -v `pwd`:/mnt \\\n                   -v `pwd`/linux/artifacts:/artifacts \\\n\t\t   --user $(id -u):$(id -g) \\\n\t\t   -e REVISION=$(REVISION) \\\n       -e CABALOPTS=\"-f-export-dynamic -fembed_data_files -fserver -flua --enable-executable-static -j4 --ghc-option=-j4 --ghc-option=-split-sections --ghc-option=-optc-Os --ghc-option=-optl=-pthread\" \\\n\t\t   -w /mnt \\\n\t\t   --memory=0 \\\n\t\t   --rm \\\n\t\t   $(DOCKERIMAGE) \\\n\t\t   bash \\\n\t\t   /mnt/linux/make_artifacts.sh\n.PHONY: debpkg\n\npandoc-cli/man/pandoc.1: MANUAL.txt man/pandoc.1.before man/pandoc.1.after pandoc.cabal\n\t$(pandoc) $< -f markdown -t man -s \\\n\t\t--lua-filter man/manfilter.lua \\\n\t\t--include-before-body man/pandoc.1.before \\\n\t\t--include-after-body man/pandoc.1.after \\\n\t\t--metadata author=\"\" \\\n    --variable section=\"1\" \\\n    --variable title=\"pandoc\" \\\n    --variable header='Pandoc User\\[cq]s Guide' \\\n\t\t--variable footer=\"pandoc $(VERSION)\" \\\n\t\t-o $@\n\npandoc-cli/man/%.1: doc/%.md pandoc.cabal\n\t$(pandoc) $< -f markdown -t man -s \\\n\t\t--lua-filter man/manfilter.lua \\\n\t\t--metadata author=\"\" \\\n    --variable section=\"1\" \\\n    --variable title=\"$(basename $(notdir $@))\" \\\n    --variable header='Pandoc User\\[cq]s Guide' \\\n\t\t--variable footer=\"pandoc $(VERSION)\" \\\n    --include-after-body man/pandoc.1.after \\\n\t\t-o $@\n\n\nREADME.md: README.template MANUAL.txt tools/update-readme.lua\n\t$(pandoc) --lua-filter tools/update-readme.lua \\\n\t      --reference-location=section -t gfm $< -o $@\n\ndoc/lua-filters.md: tools/update-lua-module-docs.lua  ## update lua-filters.md module docs\n\tcabal run pandoc-cli -- \\\n\t\t--standalone \\\n\t\t--reference-links \\\n\t\t--columns=66 \\\n\t\t--from=$< \\\n\t\t--output=$@ \\\n\t\t$@\n.PHONY: doc/lua-filters.md\n\ndownload_stats: ## print download stats from GitHub releases\n\tcurl https://api.github.com/repos/jgm/pandoc/releases | \\\n\t\tjq -r '.[] | .assets | .[] | \"\\(.download_count)\\t\\(.name)\"'\n.PHONY: download_stats\n\npandoc-templates: ## update pandoc-templates repo\n\trm ../pandoc-templates/default.* ; \\\n\tcp data/templates/* ../pandoc-templates/ ; \\\n\tpushd ../pandoc-templates/ && \\\n\tgit add * && \\\n\tgit commit -m \"Updated templates for pandoc $(VERSION)\" && \\\n\tpopd\n.PHONY: pandoc-templates\n\nupdate-website: ## update website and upload\n\tmake -C $(WEBSITE) update\n\tmake -C $(WEBSITE)\n\tmake -C $(WEBSITE) upload\n.PHONY: update-website\n\nupdate-translations: ## update data/translations from Babel and Polyglossia\n\tpython3 tools/update-translations.py\n.PHONY: update-translations\n\nvalidate-docx-golden-tests: ## validate docx golden tests against schema\n\twhich xmllint || (\"xmllint is required\" && exit 1)\n\ttest -d ./docx-validator || \\\n\t\t(git clone https://github.com/devoidfury/docx-validator && \\\n\t\tcd docx-validator && patch -p1 <../wml.xsd.patch)\n\tsh ./tools/validate-docx.sh test/docx/golden/*.docx\n.PHONY: validate-docx-golden-tests\n\nvalidate-docx-golden-tests2: ## validate docx golden tests using OOXMLValidator\n\twhich dotnet || (\"dotnet is required\" && exit 1)\n\twhich jq || (\"jq is required\" && exit 1)\n\ttest -d ./OOXML-Validator || \\\n\t\t(git clone https://github.com/mikeebowen/OOXML-Validator.git \\\n\t\t&& cd OOXML-Validator && dotnet build --configuration=Release)\n\tsh ./tools/validate-docx2.sh test/docx/golden/\n.PHONY: validate-docx-golden-tests2\n\nnode_modules/.bin/ace:\n\tnpm install @daisy/ace\n\nvalidate-epub: node_modules/.bin/ace ## generate an epub and validate it with epubcheck and ace\n\twhich epubcheck || exit 1\n\ttmp=$$(mktemp -d) && \\\n  for epubver in 2 3; do \\\n    file=$$tmp/ver$$epubver.epub ; \\\n\t  $(pandoc) test/epub/wasteland.epub --epub-cover=test/lalune.jpg -Mtitle=\"The Wasteland\" --resource-path test/epub -t epub$$epubver -o $$file --number-sections --toc --quiet && \\\n\t  echo $$file && \\\n\t  epubcheck $$file || exit 1 ; \\\n  done && \\\n\t./node_modules/.bin/ace $$tmp/ver3.epub -o ace-report-v2 --force\n\nmodules.csv: $(PANDOCSOURCEFILES)\n\t@rg '^import.*Text\\.Pandoc\\.' --with-filename $^ \\\n\t\t| rg -v 'Text\\.Pandoc\\.(Definition|Builder|Walk|Generic)' \\\n\t\t| sort \\\n\t\t| uniq \\\n\t\t| sed -e 's/src\\///' \\\n\t        | sed -e 's/\\//\\./g' \\\n\t\t| sed -e 's/\\.hs:import *\\(qualified *\\)*\\([^ ]*\\).*/,\\2/' \\\n\t\t> $@\n\nmodules.dot: modules.csv\n\t@echo \"digraph G {\" > $@\n\t@echo \"overlap=\\\"scale\\\"\" >> $@\n\t@sed -e 's/\\([^,]*\\),\\(.*\\)/  \"\\1\" -> \"\\2\";/' $< >> $@\n\t@echo \"}\" >> $@\n\n# To get the module dependencies of Text.Pandoc.Parsing:\n# make modules.pdf ROOT=Text.Pandoc.Parsing\nmodules.pdf: modules.dot\n\tgvpr -f tools/cliptree.gvpr -a '\"$(ROOT)\"' $< | dot -Tpdf > $@\n\n# make moduledeps ROOT=Text.Pandoc.Parsing\nmoduledeps: modules.csv  ## Print transitive dependencies of a module ROOT\n\t@echo \"$(ROOT)\"\n\t@$(pandoc) lua tools/moduledeps.lua transitive $(ROOT) | sort\n.PHONY: moduledeps\n\nclean: ## clean up\n\tcabal clean\n.PHONY: clean\n\n.PHONY: .FORCE\n\nsdist-files.txt: .FORCE\n\tcabal sdist --list-only | sed 's/\\.\\///' | grep '^\\(test\\|data\\)/' | sort > $@\n\ngit-files.txt: .FORCE\n\tgit ls-tree -r --name-only HEAD | grep '^\\(test\\|data\\)/' | sort > $@\n\nhelp: ## display this help\n\t@echo \"Targets:\"\n\t@grep -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = \":.*?## \"}; {printf \"%-16s %s\\n\", $$1, $$2}'\n\t@echo\n\t@echo \"Environment variables with default values:\"\n\t@printf \"%-16s%s\\n\" \"CABALOPTS\" \"$(CABALOPTS)\"\n\t@printf \"%-16s%s\\n\" \"TESTARGS\" \"$(TESTARGS)\"\n\t@printf \"%-16s%s\\n\" \"BASELINE\" \"$(BASELINE)\"\n\t@printf \"%-16s%s\\n\" \"REVISION\" \"$(REVISION)\"\n.PHONY: help\n\nrelease-checklist: release-checklist-$(VERSION).org\n.PHONY: release-checklist\n\nrelease-checklist-$(VERSION).org: RELEASE-CHECKLIST-TEMPLATE.org\n\tsed -e 's/RELEASE_VERSION/$(VERSION)/g' $< > $@\n\nhie.yaml: ## regenerate hie.yaml\n\tgen-hie > $@\n.PHONY: hie.yaml\n\npandoc.wasm: ## build pandoc.wasm\n\t-rm $@\n\twasm32-wasi-cabal update\n\twasm32-wasi-cabal build pandoc-cli\nifeq ($(OPTIMIZE_WASM),1)\n\techo \"Optimizing (this may take a long time, to avoid, set OPTIMIZE_WASM=0)...\"\n\twasm-opt -Oz $$(wasm32-wasi-cabal list-bin pandoc-cli | tail -1) -o $@\nelse\n\techo \"Copying unoptimized pandoc.wasm...\"\n\tcp \"$$(wasm32-wasi-cabal list-bin pandoc-cli | tail -1)\" \"$@\"\nendif\n.PHONY: pandoc.wasm\n"
  },
  {
    "path": "README.md",
    "content": "<!-- Do not edit this file.  It is generated automatically from\nREADME.template and MANUAL.txt via the command:\npandoc --lua-filter tools/update-readme.lua README.template -o README.md\n-->\n\n# Pandoc\n\n[![github\nrelease](https://img.shields.io/github/release/jgm/pandoc.svg?label=current+release)](https://github.com/jgm/pandoc/releases)\n[![hackage\nrelease](https://img.shields.io/hackage/v/pandoc.svg?label=hackage)](https://hackage.haskell.org/package/pandoc)\n[![homebrew](https://img.shields.io/homebrew/v/pandoc.svg)](https://formulae.brew.sh/formula/pandoc)\n[![stackage LTS\npackage](https://stackage.org/package/pandoc/badge/lts)](https://www.stackage.org/lts/package/pandoc)\n[![CI\ntests](https://github.com/jgm/pandoc/workflows/CI%20tests/badge.svg)](https://github.com/jgm/pandoc/actions)\n[![license](https://img.shields.io/badge/license-GPLv2+-lightgray.svg)](https://www.gnu.org/licenses/gpl.html)\n[![pandoc-discuss on google\ngroups](https://img.shields.io/badge/pandoc-discuss-red.svg?style=social)](https://groups.google.com/forum/#!forum/pandoc-discuss)\n\n## The universal markup converter\n\nPandoc is a [Haskell](https://haskell.org) library for converting from\none markup format to another, and a command-line tool that uses this\nlibrary.\n\nIt can convert *from*\n\n<div id=\"input-formats\">\n\n- `asciidoc` ([AsciiDoc](https://asciidoc.org/) markup)\n- `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)\n- `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)\n- `bits` ([BITS](https://jats.nlm.nih.gov/extensions/bits/) XML, alias\n  for `jats`)\n- `commonmark` ([CommonMark](https://commonmark.org) Markdown)\n- `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with\n  extensions)\n- `creole` ([Creole 1.0](http://www.wikicreole.org/wiki/Creole1.0))\n- `csljson` ([CSL\n  JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)\n  bibliography)\n- `csv` ([CSV](https://tools.ietf.org/html/rfc4180) table)\n- `tsv`\n  ([TSV](https://www.iana.org/assignments/media-types/text/tab-separated-values)\n  table)\n- `djot` ([Djot markup](https://djot.net))\n- `docbook` ([DocBook](https://docbook.org))\n- `docx` ([Word docx](https://en.wikipedia.org/wiki/Office_Open_XML))\n- `dokuwiki` ([DokuWiki markup](https://www.dokuwiki.org/dokuwiki))\n- `endnotexml` ([EndNote XML\n  bibliography](https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition))\n- `epub` ([EPUB](http://idpf.org/epub))\n- `fb2`\n  ([FictionBook2](http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1)\n  e-book)\n- `gfm` ([GitHub-Flavored\n  Markdown](https://help.github.com/articles/github-flavored-markdown/)),\n  or the deprecated and less accurate `markdown_github`; use\n  [`markdown_github`](https://pandoc.org/MANUAL.html#markdown-variants)\n  only if you need extensions not supported in\n  [`gfm`](https://pandoc.org/MANUAL.html#markdown-variants).\n- `haddock` ([Haddock\n  markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))\n- `html` ([HTML](https://www.w3.org/html/))\n- `ipynb` ([Jupyter\n  notebook](https://nbformat.readthedocs.io/en/latest/))\n- `jats` ([JATS](https://jats.nlm.nih.gov) XML)\n- `jira`\n  ([Jira](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all)/Confluence\n  wiki markup)\n- `json` (JSON version of native AST)\n- `latex` ([LaTeX](https://www.latex-project.org/))\n- `markdown` ([Pandoc’s\n  Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))\n- `markdown_mmd`\n  ([MultiMarkdown](https://fletcherpenney.net/multimarkdown/))\n- `markdown_phpextra` ([PHP Markdown\n  Extra](https://michelf.ca/projects/php-markdown/extra/))\n- `markdown_strict` (original unextended\n  [Markdown](https://daringfireball.net/projects/markdown/))\n- `mediawiki` ([MediaWiki\n  markup](https://www.mediawiki.org/wiki/Help:Formatting))\n- `man` ([roff man](https://man.cx/groff_man(7)))\n- `mdoc` ([mdoc](https://mandoc.bsd.lv/man/mdoc.7.html) manual page\n  markup)\n- `muse` ([Muse](https://amusewiki.org/library/manual))\n- `native` (native Haskell)\n- `odt` ([OpenDocument text\n  document](https://en.wikipedia.org/wiki/OpenDocument))\n- `opml` ([OPML](https://opml.org/spec2.opml))\n- `org` ([Emacs Org mode](https://orgmode.org))\n- `pod` (Perl’s [Plain Old\n  Documentation](https://perldoc.perl.org/perlpod))\n- `pptx`\n  ([PowerPoint](https://en.wikipedia.org/wiki/Microsoft_PowerPoint))\n- `ris` ([RIS](https://en.wikipedia.org/wiki/RIS_(file_format))\n  bibliography)\n- `rtf` ([Rich Text\n  Format](https://en.wikipedia.org/wiki/Rich_Text_Format))\n- `rst`\n  ([reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/introduction.html))\n- `t2t` ([txt2tags](https://txt2tags.org))\n- `textile` ([Textile](https://textile-lang.com))\n- `tikiwiki` ([TikiWiki\n  markup](https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax))\n- `twiki` ([TWiki\n  markup](https://twiki.org/cgi-bin/view/TWiki/TextFormattingRules))\n- `typst` ([typst](https://typst.app))\n- `vimwiki` ([Vimwiki](https://vimwiki.github.io))\n- `xlsx` ([Excel\n  spreadsheet](https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats))\n- `xml` (XML version of native AST)\n- the path of a custom Lua reader, see [Custom readers and\n  writers](https://pandoc.org/MANUAL.html#custom-readers-and-writers)\n  below\n\n</div>\n\nIt can convert *to*\n\n<div id=\"output-formats\">\n\n- `ansi` (text with [ANSI escape\n  codes](https://en.wikipedia.org/wiki/ANSI_escape_code), for terminal\n  viewing)\n- `asciidoc` (modern [AsciiDoc](https://asciidoc.org/) as interpreted by\n  [AsciiDoctor](https://asciidoctor.org/))\n- `asciidoc_legacy` ([AsciiDoc](https://asciidoc.org/) as interpreted by\n  [`asciidoc-py`](https://github.com/asciidoc-py/asciidoc-py)).\n- `asciidoctor` (deprecated synonym for `asciidoc`)\n- `bbcode` [BBCode](https://www.bbcode.org/reference.php)\n- `bbcode_fluxbb` [BBCode\n  (FluxBB)](https://web.archive.org/web/20210623155046/https://fluxbb.org/forums/help.php#bbcode)\n- `bbcode_phpbb` [BBCode\n  (phpBB)](https://www.phpbb.com/community/help/bbcode)\n- `bbcode_steam` [BBCode\n  (Steam)](https://steamcommunity.com/comment/ForumTopic/formattinghelp)\n- `bbcode_hubzilla` [BBCode\n  (Hubzilla)](https://hubzilla.org/help/member/bbcode)\n- `bbcode_xenforo` [BBCode\n  (xenForo)](https://www.xenfocus.com/community/help/bb-codes/)\n- `beamer` ([LaTeX beamer](https://ctan.org/pkg/beamer) slide show)\n- `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)\n- `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)\n- `chunkedhtml` (zip archive of multiple linked HTML files)\n- `commonmark` ([CommonMark](https://commonmark.org) Markdown)\n- `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with\n  extensions)\n- `context` ([ConTeXt](https://www.contextgarden.net/))\n- `csljson` ([CSL\n  JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)\n  bibliography)\n- `djot` ([Djot markup](https://djot.net))\n- `docbook` or `docbook4` ([DocBook](https://docbook.org) 4)\n- `docbook5` (DocBook 5)\n- `docx` ([Word docx](https://en.wikipedia.org/wiki/Office_Open_XML))\n- `dokuwiki` ([DokuWiki markup](https://www.dokuwiki.org/dokuwiki))\n- `epub` or `epub3` ([EPUB](http://idpf.org/epub) v3 book)\n- `epub2` (EPUB v2)\n- `fb2`\n  ([FictionBook2](http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1)\n  e-book)\n- `gfm` ([GitHub-Flavored\n  Markdown](https://help.github.com/articles/github-flavored-markdown/)),\n  or the deprecated and less accurate `markdown_github`; use\n  [`markdown_github`](https://pandoc.org/MANUAL.html#markdown-variants)\n  only if you need extensions not supported in\n  [`gfm`](https://pandoc.org/MANUAL.html#markdown-variants).\n- `haddock` ([Haddock\n  markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))\n- `html` or `html5` ([HTML](https://www.w3.org/html/),\n  i.e. [HTML5](https://html.spec.whatwg.org/)/XHTML [polyglot\n  markup](https://www.w3.org/TR/html-polyglot/))\n- `html4` ([XHTML](https://www.w3.org/TR/xhtml1/) 1.0 Transitional)\n- `icml` ([InDesign\n  ICML](https://web.archive.org/web/20211006210211/https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf))\n- `ipynb` ([Jupyter\n  notebook](https://nbformat.readthedocs.io/en/latest/))\n- `jats_archiving` ([JATS](https://jats.nlm.nih.gov) XML, Archiving and\n  Interchange Tag Set)\n- `jats_articleauthoring` ([JATS](https://jats.nlm.nih.gov) XML, Article\n  Authoring Tag Set)\n- `jats_publishing` ([JATS](https://jats.nlm.nih.gov) XML, Journal\n  Publishing Tag Set)\n- `jats` (alias for `jats_archiving`)\n- `jira`\n  ([Jira](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all)/Confluence\n  wiki markup)\n- `json` (JSON version of native AST)\n- `latex` ([LaTeX](https://www.latex-project.org/))\n- `man` ([roff man](https://man.cx/groff_man(7)))\n- `markdown` ([Pandoc’s\n  Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))\n- `markdown_mmd`\n  ([MultiMarkdown](https://fletcherpenney.net/multimarkdown/))\n- `markdown_phpextra` ([PHP Markdown\n  Extra](https://michelf.ca/projects/php-markdown/extra/))\n- `markdown_strict` (original unextended\n  [Markdown](https://daringfireball.net/projects/markdown/))\n- `markua` ([Markua](https://leanpub.com/markua/read))\n- `mediawiki` ([MediaWiki\n  markup](https://www.mediawiki.org/wiki/Help:Formatting))\n- `ms` ([roff ms](https://man.cx/groff_ms(7)))\n- `muse` ([Muse](https://amusewiki.org/library/manual))\n- `native` (native Haskell)\n- `odt` ([OpenDocument text\n  document](https://en.wikipedia.org/wiki/OpenDocument))\n- `opml` ([OPML](https://opml.org/spec2.opml))\n- `opendocument` ([OpenDocument\n  XML](https://www.oasis-open.org/2021/06/16/opendocument-v1-3-oasis-standard-published/))\n- `org` ([Emacs Org mode](https://orgmode.org))\n- `pdf` ([PDF](https://www.adobe.com/pdf/))\n- `plain` (plain text)\n- `pptx`\n  ([PowerPoint](https://en.wikipedia.org/wiki/Microsoft_PowerPoint)\n  slide show)\n- `rst`\n  ([reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/introduction.html))\n- `rtf` ([Rich Text\n  Format](https://en.wikipedia.org/wiki/Rich_Text_Format))\n- `texinfo` ([GNU Texinfo](https://www.gnu.org/software/texinfo/))\n- `textile` ([Textile](https://textile-lang.com))\n- `slideous` ([Slideous](https://goessner.net/articles/slideous/) HTML\n  and JavaScript slide show)\n- `slidy` ([Slidy](https://www.w3.org/Talks/Tools/Slidy2/) HTML and\n  JavaScript slide show)\n- `dzslides` ([DZSlides](https://paulrouget.com/dzslides/) HTML5 +\n  JavaScript slide show)\n- `revealjs` ([reveal.js](https://revealjs.com/) HTML5 + JavaScript\n  slide show)\n- `s5` ([S5](https://meyerweb.com/eric/tools/s5/) HTML and JavaScript\n  slide show)\n- `tei` ([TEI Simple](https://github.com/TEIC/TEI-Simple))\n- `typst` ([typst](https://typst.app))\n- `vimdoc`\n  ([Vimdoc](https://vimhelp.org/helphelp.txt.html#help-writing))\n- `xml` (XML version of native AST)\n- `xwiki` ([XWiki\n  markup](https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/))\n- `zimwiki` ([ZimWiki\n  markup](https://zim-wiki.org/manual/Help/Wiki_Syntax.html))\n- the path of a custom Lua writer, see [Custom readers and\n  writers](https://pandoc.org/MANUAL.html#custom-readers-and-writers)\n  below\n\n</div>\n\nPandoc can also produce PDF output via LaTeX, Groff ms, or HTML.\n\nPandoc’s enhanced version of Markdown includes syntax for tables,\ndefinition lists, metadata blocks, footnotes, citations, math, and much\nmore. See the User’s Manual below under [Pandoc’s\nMarkdown](https://pandoc.org/MANUAL.html#pandocs-markdown).\n\nPandoc has a modular design: it consists of a set of readers, which\nparse text in a given format and produce a native representation of the\ndocument (an *abstract syntax tree* or AST), and a set of writers, which\nconvert this native representation into a target format. Thus, adding an\ninput or output format requires only adding a reader or writer. Users\ncan also run custom pandoc filters to modify the intermediate AST (see\nthe documentation for [filters](https://pandoc.org/filters.html) and\n[Lua filters](https://pandoc.org/lua-filters.html)).\n\nBecause pandoc’s intermediate representation of a document is less\nexpressive than many of the formats it converts between, one should not\nexpect perfect conversions between every format and every other. Pandoc\nattempts to preserve the structural elements of a document, but not\nformatting details such as margin size. And some document elements, such\nas complex tables, may not fit into pandoc’s simple document model.\nWhile conversions from pandoc’s Markdown to all formats aspire to be\nperfect, conversions from formats more expressive than pandoc’s Markdown\ncan be expected to be lossy.\n\n## Installing\n\nHere’s [how to install pandoc](INSTALL.md).\n\n## Documentation\n\nPandoc’s website contains a full [User’s\nGuide](https://pandoc.org/MANUAL.html). It is also available\n[here](MANUAL.txt) as pandoc-flavored Markdown. The website also\ncontains some [examples of the use of\npandoc](https://pandoc.org/demos.html), a limited [online\ndemo](https://pandoc.org/try), and a [WebAssembly-based online\ndemo](https://pandoc.org/app).\n\n## Contributing\n\nPull requests, bug reports, and feature requests are welcome. Please\nmake sure to read [the contributor guidelines](CONTRIBUTING.md) before\nopening a new issue.\n\n## License\n\n© 2006-2024 John MacFarlane (jgm@berkeley.edu). Released under the\n[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html \"GNU General Public License\"),\nversion 2 or greater. This software carries no warranty of any kind.\n(See COPYRIGHT for full copyright and warranty notices.)\n"
  },
  {
    "path": "README.template",
    "content": "<!-- Do not edit this file.  It is generated automatically from\nREADME.template and MANUAL.txt via the command:\npandoc --lua-filter tools/update-readme.lua README.template -o README.md\n-->\n\nPandoc\n======\n\n[![github release](https://img.shields.io/github/release/jgm/pandoc.svg?label=current+release)](https://github.com/jgm/pandoc/releases)\n[![hackage release](https://img.shields.io/hackage/v/pandoc.svg?label=hackage)](https://hackage.haskell.org/package/pandoc)\n[![homebrew](https://img.shields.io/homebrew/v/pandoc.svg)](https://formulae.brew.sh/formula/pandoc)\n[![stackage LTS package](https://stackage.org/package/pandoc/badge/lts)](https://www.stackage.org/lts/package/pandoc)\n[![CI tests](https://github.com/jgm/pandoc/workflows/CI%20tests/badge.svg)](https://github.com/jgm/pandoc/actions)\n[![license](https://img.shields.io/badge/license-GPLv2+-lightgray.svg)](https://www.gnu.org/licenses/gpl.html)\n[![pandoc-discuss on google groups](https://img.shields.io/badge/pandoc-discuss-red.svg?style=social)](https://groups.google.com/forum/#!forum/pandoc-discuss)\n\n\nThe universal markup converter\n------------------------------\n\nPandoc is a [Haskell] library for converting from one markup format to\nanother, and a command-line tool that uses this library.\n\nIt can convert *from*\n\n::: {#input-formats}\n:::\n\nIt can convert *to*\n\n::: {#output-formats}\n:::\n\nPandoc can also produce PDF output via LaTeX, Groff ms, or HTML.\n\nPandoc's enhanced version of Markdown includes syntax for tables,\ndefinition lists, metadata blocks, footnotes, citations, math,\nand much more.  See the User's Manual below under\n[Pandoc's Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown).\n\nPandoc has a modular design: it consists of a set of readers, which parse\ntext in a given format and produce a native representation of the document\n(an _abstract syntax tree_ or AST), and a set of writers, which convert\nthis native representation into a target format. Thus, adding an input\nor output format requires only adding a reader or writer. Users can also\nrun custom pandoc filters to modify the intermediate AST (see\nthe documentation for [filters](https://pandoc.org/filters.html)\nand [Lua filters](https://pandoc.org/lua-filters.html)).\n\nBecause pandoc's intermediate representation of a document is less\nexpressive than many of the formats it converts between, one should\nnot expect perfect conversions between every format and every other.\nPandoc attempts to preserve the structural elements of a document, but\nnot formatting details such as margin size.  And some document elements,\nsuch as complex tables, may not fit into pandoc's simple document\nmodel.  While conversions from pandoc's Markdown to all formats aspire\nto be perfect, conversions from formats more expressive than pandoc's\nMarkdown can be expected to be lossy.\n\n\nInstalling\n----------\n\nHere's [how to install pandoc](INSTALL.md).\n\nDocumentation\n-------------\n\nPandoc’s website contains a full [User’s\nGuide](https://pandoc.org/MANUAL.html). It is also available\n[here](MANUAL.txt) as pandoc-flavored Markdown. The website also\ncontains some [examples of the use of\npandoc](https://pandoc.org/demos.html), a limited [online\ndemo](https://pandoc.org/try), and a [WebAssembly-based online\ndemo](https://pandoc.org/app).\n\nContributing\n------------\n\nPull requests, bug reports, and feature requests are welcome.  Please make\nsure to read [the contributor guidelines](CONTRIBUTING.md) before opening a\nnew issue.\n\n\nLicense\n-------\n\n© 2006-2024 John MacFarlane (jgm@berkeley.edu). Released under the\n[GPL], version 2 or greater.  This software carries no warranty of\nany kind.  (See COPYRIGHT for full copyright and warranty notices.)\n\n[GPL]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html \"GNU General Public License\"\n[Haskell]: https://haskell.org\n"
  },
  {
    "path": "RELEASE-CHECKLIST-TEMPLATE.org",
    "content": "#+STARTUP: content\n#+PROPERTY: :header-args: :results verbatim\n** pandoc RELEASE_VERSION release checklist\n*** TODO Check [[https://github.com/jgm/pandoc/issues?q=state%3Aopen%20label%3A%22priority%3Ahigh%22%20][priority-high]] tag\n*** TODO Release any prerelease packages in [[./cabal.project]]\n*** TODO [[./pandoc.cabal]] - bump version number\n*** TODO [[./pandoc-cli/pandoc-cli.cabal]] - bump version, sync pandoc version\n#+begin_src sh\ngit log $(git describe --tags --abbrev=0)..HEAD --oneline pandoc-cli\n#+end_src\n*** TODO [[./pandoc-lua-engine/pandoc-lua-engine.cabal]] - bump version?\n#+begin_src sh\ngit log $(git describe --tags --abbrev=0)..HEAD --oneline pandoc-lua-engine\n#+end_src\n*** TODO [[./pandoc-server/pandoc-server.cabal]] - bump version?\n#+begin_src sh\ngit log $(git describe --tags --abbrev=0)..HEAD --oneline pandoc-server\n#+end_src\n*** TODO Update [[./MANUAL.txt]] date and rebuild man pages\n#+begin_src sh :results silent\nNEWDATE=$(date -I)\nsed -i '' -e \"/^---$/,/^---$/s/^date:.*$/date: $NEWDATE/\" MANUAL.txt\nmake man\n#+end_src\n*** TODO Finalize [[./changelog.md]]\n#+begin_src sh :results output file :file LOG.md\ngit log $(git describe --tags --abbrev=0)..HEAD --mailmap --reverse --format=format:'  * %s%n    %aN%n%w(78,4,4)%b' | sed -e '/^ *John MacFarlane$/d' | sed -e 's/  *$//'\n#+end_src\n*** TODO prerelease checks\n#+begin_src sh :results output verbatim\nmake prerelease\n#+end_src\n*** TODO Update [[./AUTHORS.md]]\n#+begin_src sh :results output list org\nmake authors\n#+end_src\n*** TODO Run [[https://github.com/jgm/pandoc/actions/workflows/release-candidate.yml][release candidate workflow]] on GitHub\n    #+begin_src sh :var ghtoken=(jgm-authinfo-get \"api.github.com\" \"jgm_pandoc_release\")\ncurl -L \\\n  -X POST \\\n  -H \"Accept: application/vnd.github+json\" \\\n  -H \"Authorization: Bearer $ghtoken\"\\\n  -H \"X-GitHub-Api-Version: 2022-11-28\" \\\nhttps://api.github.com/repos/jgm/pandoc/actions/workflows/release-candidate.yml/dispatches \\\n  -d '{\"ref\":\"main\"}'\n    #+end_src\n*** TODO Run [[https://cirrus-ci.com][release candidate workflows]] manually on cirrus-ci.com\n*** TODO If it builds successfully, download artifacts\nfrom GitHub: Windows and intel mac and pandoc.wasm (rename as pandoc-VERSION.wasm)\nfrom Cirrus-ci.com: linux amd64 and arm64 and m1 mac\n*** TODO Use 'make' in macos artifact to sign code\n*** TODO Install pandoc from package\nSo website will have the correct executable.\n*** TODO Update website\n#+begin_src sh\nmake update-website\n#+end_src\n*** TODO Tag release in git:\n    - use X.Y for pandoc\n    - pandoc-cli-X.Y\n    - if needed: pandoc-server-X.Y\n    - if needed: pandoc-lua-engine-X.Y\n*** TODO Upload packages to Hackage:\n#+NAME: changed-packages\n#+begin_src sh :results silent\necho pandoc\necho pandoc-cli\nfor package in pandoc-lua-engine pandoc-server; do\n    lines=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline $package | wc -l)\n    if ! [ $lines -eq 0 ]; then\n        echo $package;\n    fi\ndone\n#+end_src\n\n    - pandoc\n    - pandoc-cli\n    and if changed:\n    - pandoc-server\n    - pandoc-lua-engine\n*** TODO make pandoc-templates\n#+begin_src sh\nmake pandoc-templates\npushd ~/src/pandoc-templates\ngit tag RELEASE_VERSION\ngit push\ngit push --tags\npopd\n#+end_src\n*** TODO Copy binary to server, install it\n#+begin_src\n# example:\ncd RELEASE_VERSION\ntar xvzf pandoc-RELEASE_VERSION-linux-amd64.tar.gz\nscp pandoc-RELEASE_VERSION/bin/pandoc website:cgi-bin/pandoc-server.cgi\n#+end_src\n\n*** TODO Upload pandoc.wasm\n#+begin_src sh\nmake pandoc.wasm\ncd wasm\nmake upload\n#+end_src\n*** TODO create release announcement and add to GH release announcement\n#+NAME: relann\n#+begin_src elisp :results value file :file relann-RELEASE_VERSION\n\"I'm pleased to announce the release of pandoc RELEASE_VERSION,\navailable in the usual places:\n\nBinary packages & changelog:\nhttps://github.com/jgm/pandoc/releases/tag/RELEASE_VERSION\n\nSource & API documentation:\nhttp://hackage.haskell.org/package/pandoc-RELEASE_VERSION\n\nDescription of release.\n\nAny API changes.\n\nThanks to all who contributed, especially new contributors ...\n\"\n#+end_src\n*** TODO Add [[https://github.com/jgm/pandoc/releases/][release on GitHub]]\n#+begin_src sh :var announcement=relann :results output literal\necho '```'\ncat relann-RELEASE_VERSION\necho '```'\necho ''\nmake changes_github\n#+end_src\n*** TODO Announce on [[mailto:pandoc-announce@googlegroups.com][pandoc-announce]]\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\n## Supported Versions\n\nOnly the most recent version of pandoc is supported with security updates.\n\n## Reporting a Vulnerability\n\nTo report a vulnerability, email the maintainer, jgm@berkeley.edu.\nBut first please read the section of the manual entitled\n[A note on security](https://pandoc.org/MANUAL.html#a-note-on-security),\nwhich describes some security guarantees pandoc does NOT make.\n"
  },
  {
    "path": "benchmark/benchmark-pandoc.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-\nCopyright (C) 2012-2024 John MacFarlane <jgm@berkeley.edu>\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n-}\nimport Text.Pandoc\nimport Text.Pandoc.MIME\nimport Control.DeepSeq (force)\nimport Control.Monad.Except (throwError)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Data.ByteString as B\nimport qualified Data.Text as T\nimport Test.Tasty.Bench\n-- import Gauge\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Maybe (mapMaybe)\nimport Data.List (sortOn)\nimport Text.Pandoc.Format (FlavoredFormat(..))\n\nreaderBench :: Pandoc\n            -> T.Text\n            -> Maybe Benchmark\nreaderBench _ name\n  | name `elem` [\"bibtex\", \"biblatex\", \"csljson\"] = Nothing\nreaderBench doc name = either (const Nothing) Just $\n  runPure $ do\n    (rdr, rexts) <- getReader $ FlavoredFormat name mempty\n    (wtr, wexts) <- getWriter $ FlavoredFormat name mempty\n    tmpl <- Just <$> compileDefaultTemplate name\n    case (rdr, wtr) of\n      (TextReader r, TextWriter w) -> do\n        inp <- w def{ writerWrapText = WrapAuto\n                    , writerExtensions = wexts\n                    , writerTemplate = tmpl } doc\n        return $ bench (T.unpack name) $\n          nf (either (error . show) id . runPure . r def) inp\n      (ByteStringReader r, ByteStringWriter w) -> do\n        inp <- w def{ writerWrapText = WrapAuto\n                    , writerExtensions = wexts\n                    , writerTemplate = tmpl } doc\n        return $ bench (T.unpack name) $\n          nf (either (error . show) id .\n                runPure . r def{readerExtensions = rexts}) inp\n      _ -> throwError $ PandocSomeError $ \"text/bytestring format mismatch: \"\n                           <> name\n\ngetImages :: IO [(FilePath, MimeType, BL.ByteString)]\ngetImages = do\n  ll <- B.readFile \"test/lalune.jpg\"\n  mv <- B.readFile \"test/movie.jpg\"\n  return [(\"lalune.jpg\", \"image/jpg\", BL.fromStrict ll)\n         ,(\"movie.jpg\", \"image/jpg\", BL.fromStrict mv)]\n\nwriterBench :: [(FilePath, MimeType, BL.ByteString)]\n            -> Pandoc\n            -> T.Text\n            -> Maybe Benchmark\nwriterBench _ _ name\n  | name `elem` [\"bibtex\", \"biblatex\", \"csljson\"] = Nothing\nwriterBench imgs doc name = either (const Nothing) Just $\n  runPure $ do\n    (wtr, wexts) <- getWriter $ FlavoredFormat name mempty\n    case wtr of\n      TextWriter writerFun ->\n        return $ bench (T.unpack name)\n               $ nf (\\d -> either (error . show) id $\n                       runPure $ do\n                         mapM_ (\\(fp,mt,bs) -> insertMedia fp (Just mt) bs) imgs\n                         writerFun def{ writerExtensions = wexts} d)\n                    doc\n      ByteStringWriter writerFun ->\n        return $ bench (T.unpack name)\n               $ nf (\\d -> either (error . show) id $\n                       runPure $ do\n                         mapM_ (\\(fp,mt,bs) -> insertMedia fp (Just mt) bs) imgs\n                         writerFun def{ writerExtensions = wexts} d)\n                    doc\n\nmain :: IO ()\nmain = do\n  inp <- UTF8.toText <$> B.readFile \"test/testsuite.txt\"\n  let opts = def\n  let doc = either (error . show) force $ runPure $ readMarkdown opts inp\n  defaultMain\n    [ env getImages $ \\imgs ->\n      bgroup \"writers\" $ mapMaybe (writerBench imgs doc . fst)\n                         (sortOn fst\n                           writers :: [(T.Text, Writer PandocPure)])\n    , bgroup \"readers\" $ mapMaybe (readerBench doc . fst)\n                         (sortOn fst\n                           readers :: [(T.Text, Reader PandocPure)])\n    ]\n"
  },
  {
    "path": "cabal.project",
    "content": "packages: .\n          pandoc-lua-engine\n          pandoc-server\n          pandoc-cli\nconstraints: skylighting-format-blaze-html >= 0.1.2,\n             skylighting-format-context >= 0.1.0.2,\n             auto-update >= 0.2.6,\n             crypton >= 1.1.1\n\npackage pandoc\n  flags: +embed_data_files +http\n\nif arch(wasm32)\n  tests: False\n\n  package atomic-counter\n    flags: +no-cmm\n\n  package aeson\n    flags: -ordered-keymap\n\n  package crypton\n    ghc-options: -optc-DARGON2_NO_THREADS\n\n  package digest\n    flags: -pkg-config\n\n  package lua\n    flags: +cross-compile\n    ghc-options: -optc-mllvm\n                 -optc-wasm-enable-sjlj\n                 -optc-D_WASI_EMULATED_PROCESS_CLOCKS\n                 -optc-D_WASI_EMULATED_SIGNAL\n                 -optc-DLUA_STUB_TMPNAM\n                 -optc-DLUA_STUB_TMPFILE\n                 -optc-DLUA_STUB_SYSTEM\n\n  package pandoc\n    flags: +embed_data_files -http\n\n  package pandoc-cli\n    flags: +lua -repl -server\n    ld-options: -lwasi-emulated-process-clocks -lwasi-emulated-signal -lsetjmp\n\n  package pandoc-lua-engine\n    flags: -repl\n\n  allow-newer:\n    all:base,\n    all:binary,\n    all:bytestring,\n    all:containers,\n    all:ghc-bignum,\n    all:template-haskell,\n    all:text,\n    all:time\n\n  source-repository-package\n    type: git\n    location: https://github.com/snoyberg/conduit.git\n    tag: 6b98f070fea09a3bf0a5d0897a2e27e3aa91c8fe\n    subdir: conduit-extra\n    post-checkout-command: sh -c \"patch -N -p1 < ../../../wasm/patches/conduit-extra.patch\"\n\n  source-repository-package\n    type: git\n    location: https://github.com/jappeace/ram.git\n    tag:  6e49475ae7b4b3545923407388690234d838dc45\n    post-checkout-command: sh -c \"patch -N -p1 < ../../../wasm/patches/memory.patch\"\n\n  source-repository-package\n    type: git\n    location: https://github.com/fpco/streaming-commons.git\n    tag: v0.2.3.1\n    post-checkout-command: sh -c \"patch -N -p1 < ../../../wasm/patches/streaming-commons.patch\"\n\n  source-repository-package\n    type: git\n    location: https://github.com/snoyberg/xml.git\n    tag: xml-conduit/1.10.1.0\n    subdir: xml-conduit\n    post-checkout-command: sh -c \"patch -N -p1 < ../../../wasm/patches/xml-conduit.patch\"\n\n  source-repository-package\n    type: git\n    location: https://github.com/haskellari/splitmix.git\n    tag: v0.1.3.2\n    post-checkout-command: sh -c \"patch -N -p1 < ../../../wasm/patches/splitmix.patch\"\n\n  source-repository-package\n    type: git\n    location: https://github.com/hslua/hslua\n    tag: lua-2.3.4\n    subdir: lua\n    post-checkout-command: sh -c \"patch -N -p1 < ../../../wasm/patches/lua.patch\"\n"
  },
  {
    "path": "changelog.md",
    "content": "# Revision history for pandoc\n\n## pandoc 3.9.0.2 (2026-03-19)\n\n  * Typst template: fix regression introduced in 3.9.0.1 (#11538).\n\n## pandoc 3.9.0.1 (2026-03-17)\n\n  * WASM GUI:\n\n    + Don't block everything while pandoc.wasm loads.\n    + Fix bug with Unicode filenames (#11447).\n    + Catch errors loading pandoc.\n\n  * Docx reader:\n\n    + Recognize media inside textboxes (#11053, Raymond Berger).\n    + Properly handle media stored with packaged-rooted paths\n      such as `/media` (#11518).  This can be produced by the online version of Word.\n      With this change, media stored at an absolute path will be stored\n      with its original name and not given a SHA1-based name.\n    + Preserve non-textbox content when unwrapping textboxes (#11510, #6893,\n      #11412, #5394, #9633). Treat text inside a textbox containing an image\n      as a figure caption.\n\n  * Typst reader:\n\n    + Handle bibliography command (#11460). If this is present, a\n      bibliography section is added to the document and the bibliography\n      paths are added to `bibliography` in the metadata. This sets things\n      up for using `--citeproc`.\n\n  * Textile reader:\n\n    + Handle block content in cells (#11455).\n\n  * Docx reader:\n\n    + Support `w:gridBefore` table row property (#11464, Jan Tojnar).\n\n  * LaTeX reader:\n\n    + Support `\\footnotemark` and `\\footnotetext` (#11450).\n      These commands allow separating the footnote mark from its content, useful\n      in tables, minipages, and other contexts where \\footnote cannot be used\n      directly.\n    + Support supertabular environment (#11523, bodigrim).\n\n  * ODT Reader:\n\n    + Fix relative linked images (#11369, Tuong Nguyen Manh).\n    + Recognize `Preformatted_20_Text` style Jan Tojnar\n      This is used by LibreOffice, and we will switch to that as well.\n    + Add block smushing logic (Jan Tojnar).\n    + Support Preformatted Text style (#4841, Jan Tojnar).\n\n  * Markdown reader:\n\n    + Fix bug with `lists_without_preceding_blankline` (#11534).\n\n  * Typst writer:\n\n    + Don't add a carriage return after `\\` for hard break (#11446).\n      They are not necessary.  Note that they can still be included\n      if you use `--wrap=preserve` and add a newline in your source document.\n    + Improve handling of data: URIs in images. Instead of using an\n      SVG with a link containing the data URI (the solution of #10460),\n      we can now simply produce a `bytes` object with the requisite bytes.\n      Typst figures out the format automatically.\n    + Fix escaping of quotes (#11463).\n    + Include alt attributes on images (mcanouil).\n    + Properly escape `.` after bracketed argument (#11511).\n\n  * Docx writer:\n\n    + Don't depend on `extractTarget` from Docx reader.\n    + Fix section breaks with `--top-level-division` (#11482, #10578).\n\n  * EPUB writer:\n\n    + Add cover metadata for EPUB3 (#11479). This allows\n      file managers to show cover thumbnails for EPUB3 files as well.\n    + Update allowed values for EPUB3 metadata `identifier.scheme` (#11481,\n      Pascal Wagler).\n\n  * ODT writer:\n\n    + Rename inline source class to match LibreOffice (#3390, Jan Tojnar).\n      Rename the text style we use to represent `Code` inlines from\n      `Source_20_Text` to `Source_Text`. This is the same name LibreOffice\n      Writer uses so it will be recognized by the Character Styles section\n      of the Styles menu.\n    + Remove font size from inline source class (Jan Tojnar). This matches\n      what LibreOffice Writer is doing. Also fixes literals inside\n      headings being too small.\n    + Modernize `Preformatted Text` & `Source Text` styles (Jan Tojnar).\n      Presumably, `font-family-generic` and `font-pitch` will allow to find a\n      replacement on systems that do not have `Courier New`.\n\n  * Markdown writer:\n\n    + Fix rendering of alerts (#11479). We only properly handled the case\n      where the alert started with a paragraph, but it can start with a list\n      or other block type.\n    + Escape literal `&` that would trigger entity (#11490).\n\n  * HTML writer:\n\n    + For revealjs, default `scrollProgress` to `auto` (Christophe Dervieux).\n\n  * PPTX writer:\n\n    + Register content type for embedded fonts (#11492).\n\n  * MediaWiki writer:\n\n    + Use appropriate syntax for external images (#11494).\n      Note that they will only be rendered as images if an option\n      `$wgAllowExternalImages` is enabled in the MediaWiki instance.\n\n  * ICML writer:\n\n    + Support for image object styles (#11498, massifrg).\n      This change allows users to style images in InDesign bysetting the\n      `object-style` attribute in a pandoc Image, which is mapped to the\n      AppliedObjectStyle attribute in the Rectangle element around an Image\n      element in the resulting ICML.\n\n  * JATS writer:\n\n    + Improve representation of Divs (Albert Krewinkel).  The writer now\n      checks if the element used to represent (non-special) Divs has any\n      `<boxed-text>` specific attributes. If it does, the writer keeps\n      wrapping the Div contents in a `<boxed-text>`, as it did before.\n      Otherwise, the writer falls back to the more appropriate `<p>` element\n      or simply unwraps the Div if the wrapping element wouldn't have any\n      attributes. The new behavior gives better semantic results in most cases,\n      as `<boxed-text>` should be used for text that \"is outside the flow of the\n      narrative text\", which doesn't apply to most divs.\n      \"Special\" divs, like those used to mark sections, are not\n      affected by this change.\n\n  * Text.Pandoc.Writers.GridTable:\n\n    + Normalize tables (#8102). Previously, if an invalid table was passed to\n      `toTable`, an array index error could be raised. Normalizing the table\n      forces it into a shape that won't allow this error.\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Add new function `pandoc.types.Sources` (#11441).\n\n  * LaTeX template: properly handle keywords with commas.\n    These need to be put in an `\\xmpquote{..}` command. Closes #11528.\n\n  * HTML styles template:  avoid duplicate code selector.\n    Consolidate two clauses. Closes #11484.\n\n  * Revealjs template: fix type rendering of scroll-view options\n    (Christophe Dervieux, #11486).\n\n  * Typst template:\n\n    + Use both place and block for title (Gordon Woodhull).\n      Otherwise the title will be confined to the left column\n    + Put title block in a conditional (#11529). This avoids an\n      empty block for documents that lack metadata information.\n      The empty block causes problems if `#set page` is used, as\n      it will cause a page break.\n\n  * Beamer template: add `logooption` variable (#11452, Sidney Mau).\n\n  * Text.Pandoc.ImageSize:\n\n    + Correctly handle percentage width, height on SVG (#11530).\n      Previously we were getting image size of 0 when a percentage\n      was specified for width or height on SVG.  With this change,\n      we simply ignore these percentages (becaues ImageSize doesn't\n      know the size of the containing element).\n\n  * Re-add `-threaded` to compile options in pandoc-cli.\n\n  * Use released djot, asciidoc, texmath, typst.\n\n  * Allow crypton 1.1, tls 2.2, http-client-tls 0.4.\n\n  * Require auto-update >= 0.2.6 to fix server on macOS (#11488).\n\n  * pandoc-cli.cabal: bump base min bound to 4.18 (same as pandoc).\n\n  * MANUAL.txt:\n\n    + Note that JSON may be used in YAML metadata blocks (#11525).\n    + Update link for ICML in manual.\n    + Fix outdated OPML spec URL in MANUAL.txt (#11504, Peter Briggs).\n\n## pandoc 3.9 (2026-02-03)\n\n  * Add support for compiling pandoc to WASM. (To build, `make\n    pandoc.wasm`.) A stanza in `cabal.project` contains the\n    necessary build modifications. We owe this almost entirely to\n    TerrorJack, who created the original proof of context and\n    came up with the necessary build flags and patches to some\n    dependencies.\n\n    `pandoc.wasm` has almost all the power of regular pandoc. The\n    main limitations is that it operates in a WASM sandbox and thus\n    cannot use HTTP to fetch resources and cannot run system commands.\n    As a result, JSON filters cannot be used, `--embed-resources`\n    works only with resources that have been explicitly provided in\n    the WASM sandbox, and PDFs cannot be produced (since that requires\n    running external commands). However, Lua filters can be used,\n    as long as they do not run system commands.\n\n    A JavaScript bridge module, `wasm/pandoc.js`, is provided; this\n    handles the setup necessary to run `pandoc.wasm` in a browser.\n\n    In addition, a full-featured GUI interface is provided in the\n    `wasm` subdirectory. `make serve` from that directory and it\n    will run locally, or visit <https://pandoc.org/app>.  Note that\n    once the relevant code has been downloaded by the browser, it runs\n    entirely in the browser, and the conversions never touch a server.\n    The GUI was developed in interaction with Claude Code.  This app\n    includes a WASM version of Typst and can produce PDF output via\n    Typst.\n\n  * Defaults files may now be either JSON or YAML (though a `.yaml`\n    extension will still be assumed if the file has no extension).\n    The structure of a JSON defaults file is isomorphic to that of\n    a YAML defaults file.\n\n  * Variable expansion now works even for the `defaults` field of\n    defaults files (#8024, Jacob Larkin).\n\n  * `--extract-media` will now create a zip archive containing the media\n    (instead of a directory) if the path provided has a `.zip` extension.\n\n  * Processing with `--citeproc` is now affected by a\n    `reset-citation-positions` class on headings. When the\n    `reset-citation-positions` class is added to a top-level\n    heading, `--citeproc` will reset position information at that\n    point in the document. This is needed in order to ensure that\n    the first citation in a chapter to a work that has been cited\n    in a previous chapter will not be in abbreviated form.\n\n  * RST reader:\n\n    + Fix definition lists where term ends with `-` (#11323).\n      This reverts some old code giving special treatment to\n      lines ending in hyphens; I don't understand why it was\n      there, because rst2html does not seem to do this.\n\n  * HTML reader:\n\n    + Revert an earlier change that caused style tags in the body\n      to be ignored (#10643, #11246).\n    + Parse inline style elements as RawInline (#10643, #11246).\n\n  * Markdown reader:\n\n    + Fix parsing of inline math (`$...$`) (#11311, benniekiss).\n      Do not allow blank lines before closing `$` delimiter. This brings the\n      parser in line with the documentation.\n    + Allow superscripted spans (#11409). These were being parsed as inline\n      notes. Now we disallow an inline note followed by\n      attributes, as this is almost certainly meant to be a span.\n    + Support `alerts` extension for pandoc markdown (#9716). It is not\n      enabled by default.\n\n  * MediaWiki reader:\n\n    + Add behavior switches support (#11354, Anton Melnikov).\n      They add a field to metadata without producing any text.\n    + Handle non-recognized tags as plain text (#11299).\n    + Better handling of inline tags (#11299). `<mark>`, `<var>`,\n      `<samp>`, and `<kbd>` now produce Code or Span elements with\n      classes, which can be handled by multiple output formats,\n      instead of simply being parsed as raw HTML tags.\n\n  * RTF reader:\n\n    + Ensure a new paragraph on `\\pard` (#11361, Tuong Nguyen Manh). New\n      paragraphs may start with `\\pard` alone without an explicit paragraph\n      break with `\\par` preceding it.\n    + Improve hyperlink parsing more (#10942, Tuong Nguyen Manh).\n      Both the field instruction and its result may be ungrouped.\n    + Fix bug where list items were incorporated into a following table\n      (#11364).\n\n  * ODT reader:\n\n    + Add table row and column spans (#11366, Tuong Nguyen Manh).\n      Parse the number-rows-spanned and number-columns-spanned attributes to\n      create Cells for the Table.\n\n  * DocBook reader:\n\n    + Support \"role\" attribute (#11255, Yann Trividic). The `role`\n      attribute is parsed and added to Pandoc AST elements, using a\n      wrapper Div if needed.\n    + Omit empty title when not required (#11422).\n      This affects example and sidebar elements.\n    + Fix adding wrong metadata (#11300, Tuong Nguyen Manh). Now\n      keep track of the current element stack to only add metadata\n      if inside an appropriate parent element.\n\n  * DocBook/JATS reader:\n\n    + Don't export surrounding space from inline elements (#11398). Previously\n      we would export leading and trailing space inside elements like\n      emphasis or ulink so they appeared outside the resulting pandoc Inline\n      (Emph or Link). This is not really motivated; DocBook and XML in general\n      treats leading and trailing whitespace in this context as significant.\n\n  * Docx reader:\n\n    + Handle tables without `tblGrid` (#11380).\n    + Look inside v:rect as well as v:shape (#11412).\n\n  * LaTeX reader:\n\n    + Handle more quote macros from fontspec and ngerman babel (#6120).\n\n  * Org reader:\n\n    + Don't include 'example' class when parsing org example blocks (#11339).\n      These are just unmarked code blocks.\n\n  * Texinfo writer:\n\n    + Improve handling of certain code blocks (#11312).\n      MediaWiki, for example, will parse a code block containing\n      formatting as a sequence of Code elements separated by\n      LineBreaks. For this we now use a texinfo example block.\n\n  * Typst writer:\n\n    + Escape hyphens when needed (#11334).\n\n  * HTML writer:\n\n    + Include all classes on highlighted code elements (#11423). Previously,\n      only the language class was included, and the others were dropped.\n    + Slide formats: Make `. . .` pause work in nested blocks (#7201, #7582).\n    + For revealjs, add idiomatic highlight.js support (#11420, Claude Opus 4.5).\n      When using `--syntax-highlighting=idiomatic` with reveal.js output, pandoc\n      now generates HTML compatible with reveal.js's built-in highlight.js plugin:\n      Code blocks use `<pre><code class=\"language-X\">` format.\n      The template loads highlight.js CSS, JS, and RevealHighlight plugin.\n\n  * Markdown writer:\n\n    + Ensure that `\\ ` line breaks are used for commonmark.\n    + Use setext for headers containing line breaks for commonmark (#11341).\n    + Allow display math to start/end with space (#11384).\n      This reverts to earlier < 3.7 behavior.\n    + Properly handle tables with footers (#11416).\n\n  * JATS writer:\n\n    + Fix XML output for nested figures (#11362, Albert Krewinkel).\n      Subfigures are now wrapped inside a `<fig-group>` element. Furthermore,\n      figure content that isn't allowed as children of `<fig>` elements, such as\n      raw text, gets wrapped in `<p>` elements to ensure schema-conforming XML.\n\n  * AsciiDoc writer:\n\n    + Use doubled delims in more contexts (#11362). Also escape the `#` character.\n    + Use a span with role for SmallCaps (#11374).\n    + Export spaces inside delimited constructs like emph.\n\n  * Docx writer:\n\n    + Skip directory entries when building media overrides (#11379, You Jiangbin).\n      Pandoc's docx writer was previously adding an `<Override>` for\n      `/word/media/` in `[Content_Types].xml` when the reference doc contains\n      media, which violates OPC rules and causes Word to report corruption.\n    + Refactor the monolithic `writeDocx` into a number of smaller functions\n      (Claude Opus 4.5).\n    + Replace generic XML traversal with direct path navigation (Claude\n      Opus 4.5). Instead of using Data.Generics `everywhere` to traverse the\n      entire XML tree when setting language attributes, navigate directly to\n      the known path `w:docDefaults/w:rPr/w:lang`. This is more efficient and\n      removes the dependency on `Data.Generics`.\n\n  * EPUB writer:\n\n    + Don't use footnote backlinks for EPUBv3. Here we use aside elements,\n      which are popups, and the backlinks are not needed; in some readers\n      they cause a redundant number to appear, since the reader adds a note number.\n\n  * MediaWiki writer:\n\n    + Use Doc Text instead of Text for document construction (with Claude Open 4.5).\n      This refactors the writer to use Text.DocLayout combinators (vcat, hcat,\n      literal, blankline, cr, chomp) for building output, following the pattern\n      used by other text format writers (RST, Markdown, Man). This enables\n      better control over line spacing and paragraph separation.\n    + Improve blank space around div elements (#11417). This is merely cosmetic.\n\n  * PPTX writer:\n\n    + Support notes field in metadata for title slide (#5844, Chris Callison-Burch).\n      This adds support for a `notes` field in the YAML metadata block that will\n      be used as speaker notes for the title slide in PowerPoint output.\n      Previously, there was no way to add speaker notes to the title slide since\n      it is generated from metadata rather than from content blocks.\n\n  * LaTeX writer:\n\n    + Add PDF standard support via DocumentMetadata (#11407, Gordon Woodhull\n      with Claude Opus 4.5). The `pdfstandard` variable can be\n      used to specify PDF standards (PDF/A, PDF/X, PDF/UA) in\n      LaTeX output. This uses LaTeX's `\\DocumentMetadata`\n      command, which requires LuaLaTeX. PDF version requirements\n      are automatically inferred, but can be explicitly overridden.\n      Automatic tagging is added for standards that require it.\n\n  * Typst template:\n\n    + Fix keywords usage. (#11317, har7an).\n    + Disable hyphenation for title, subtitle (#11375).\n    + Improve accessibility of definition lists (#11436). Before this\n      change, our show rule produced an error when typst was run with\n      `--pdf-standard=ua1`.\n\n  * HTML5 template:\n\n    + Conditionally include lang attribute, instead of providing\n      it with an empty value.\n\n  * JATS template:\n\n    + Fix author prefix placeholder (#11381, Christophe Dervieux).\n\n  * Text.Pandoc.Citeproc:\n\n    + Fix biblatex parsing of `@commentary` entries (#11322).\n    + Fix typo affecting `jurisdiction` biblatex type (#11321).\n    + Avoid adding an extra space at the beginning of a Cite.\n\n  * Text.Pandoc.Shared:\n\n    + Export `hasLineBreaks` [API change]. This was formerly\n      defined in the DocBook writer but more generally useful.\n\n  * Text.Pandoc.PDF:\n\n    + Add `SOURCE_DATE_EPOCH` to verbose environment variable info.\n\n  * Text.Pandoc.Class:\n\n    + Factor out `openURL` into Text.Pandoc.Class.IO.HTTP (unexported module).\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Mark readers and writers with their types (#11367). The\n      `pandoc.readers` and `pandoc.writers` maps now have string values\n      instead of boolean values. The string signals the type of the\n      reader/writer, `\"text\"` for TextReader/TextWriter and `\"bytestring\"`\n      for ByteStringReader/ByteStringWriter.\n    + Support equallity checks of LogMessage objects.\n    + Add function `pandoc.with_state` (#10859). The function allows\n      to run a callback with a modified pandoc state. This provides\n      the ability to temporarily modify the resource path, the user\n      data directory, and the HTTP request headers.\n    + Let `pandoc.with_state` error on unknown options (#11376).\n    + Add function `pandoc.utils.documentation` (#10999).\n      This is now used to generate much of the Lua API documentation.\n\n  * Text.Pandoc.App:\n\n    + Remove redundant check for asciidoc in UnknownReader.\n\n  * Text.Pandoc.Logging:\n\n    + Add `pretty` field to ToJSON instance for LogMessage.\n      This just reproduces the output of `logMessage`, for convenience for those\n      who are using the JSON output outside of Haskell.\n\n  * Text.Pandoc.Error:\n\n    + Change PandocHttpError constructor to take a Text instead of an\n      HttpException as the second argument (see #10980) [API change]\n      Motivation: exposing HttpException in the public API makes it\n      difficult to provide a version of pandoc that can be compiled\n      to wasm, which currently can't handle the network libraries.\n    + Define `displayException` for PandocError. This is a behavior change,\n      not an API change, since there was already a definition that defaulted\n      to using Show. The change here is that we use `renderError` for\n      a more human-readable version.\n\n  * Drop support for compilation with GHC versions < 9.6.\n\n  * Use released citeproc 0.13, djot 0.1.3, skylighting-format-blaze-html\n    0.1.2 (see #11423), texmath 0.13.1, asciidoc 0.1.0.1, typst-0.9,\n    hslua 2.5.\n\n  * Add `-Wno-deriving-typeble` to cabal ghc-options for ghc >= 9.12.\n\n  * Add `http` cabal flag (#10980). This allows pandoc to be\n    compiled without support for making HTTP requests, which is\n    useful when WASM is the target.\n\n  * pandoc-lua-engine has a new build flag `repl`, allowing support\n    for the Lua repl to be disabled for the wasm build.\n\n  * We now sign Windows artifacts with a code signing\n    certificate provided by SignPath.\n\n  * Mention Excel in cabal description.\n\n  * Makefile: remove some obsolete targets.\n\n  * MANUAL.txt:\n\n    + Fix typo about `--chunk-template` (#11358, Albert Lei).\n    + Fix link for bbcode_steam (#11389).\n    + Small rewrite of syntax-highlighting info.\n    + Fix defaults.yaml example for `wrap`.\n\n  * Fix a few mistakes in the contributing docs. (#11318, har7an).\n\n  * Fix a couple small errors in `doc/lua-filters.md`,\n    `doc/custom-writers.md`, and `doc/custom-readers.md`\n    (#11408, #11388).\n\n## pandoc 3.8.3 (2025-12-01)\n\n  * Add `asciidoc` as an input format (#1456).\n\n  * Add `xlsx` (Microsoft Excel) as an input format (Anton Antich).\n    Each worksheet turns into a section containing a table.\n\n  * Add `pptx` (PowerPoint) as new input format (Anton Antich).\n\n  * Add `bbcode` as a new output format (#11242, reptee). Several variants\n    of BBCode are also supported: `bbcode_fluxbb` (FluxBB), `bbcode_phpbb`\n    (phpBB), `bbcode_steam` (Hubzilla), `bbcode_hubzilla` (Hubzilla),\n    and `bbcode_xenforo` (xenForo).\n\n  * New exported module Text.Pandoc.Readers.AsciiDoc,\n    exporting `readAsciiDoc` [API change].\n\n  * New module `Text.Pandoc.Readers.Pptx`,\n    exporting `readPptx` (Anton Antich) [API change].\n\n  * New module `Text.Pandoc.Readers.Xlsx`,\n    exporting `readXlsx` (Anton Antich) [API change].\n\n  * LaTeX reader:\n\n    + Revert `\\linebreak` as LineBreak (#11272). `\\linebreak` is more\n      of a hint, it shouldn't produce a hard break.\n    + Better handling of `\\makeatletter` in parsing raw LaTeX (#11270).\n    + Fix spurious paragraph breaks in math environments (#11265,\n      Emmanuel Ferdman). Previously, a math environment with extra\n      space before the `\\end` would get rendered with a blank line,\n      which LaTeX treats as a paragraph break.\n    + Change type on `rawLaTeXParser` in Text.Pandoc.LaTeX.Parsing.\n      The preparser doesn't need to return a value.\n    + Fix `rawTeXParser` (#11253).  Make macro expansion in raw LaTeX\n      depend on the setting of the `latex_macros` extension.  Previously\n      macros were always expanded, even in raw TeX in markdown. In\n      addition, there was previously a bug that caused content to be\n      garbled in certain cases.\n    + Handle `ifstrequal` at a lower level, like the other `if`\n      commands (#11253).\n    + Move `ifstrequal`, `iftoggle`, etc., which were misplaced in\n      `environments`, to `blockCommands`, so these commands work properly.\n\n  * Docx reader:\n\n    + Handle REF link instruction (#11296, Ezwal).\n    + Check recursively for caption styles (Albert Krewinkel).\n      The docx reader uses caption styles to identify figures and\n      captioned tables. It now checks for known caption styles in the\n      full styles hierarchy of a paragraph instead of just checking\n      the style directly. This allows to recognize caption styles that\n      are built on top of the basic *caption* style, as is sometimes\n      the case in sophisticated styles.\n\n  * Markdown reader:\n\n    + Fix performance issue in links with `'` (#10880).\n\n  * Typst reader:\n\n    + Handle document metadata and `#title` (jgm/typst-hs#80).\n      Note that previously, the typst reader never returned document\n      metadata.  Now it does, even if the typst document does not contain\n      a `#title` function that would result in actually printing the\n      title block.\n\n  * Djot reader:\n\n    + Add Space elements (#11250). Previously we just got big\n      Str elements with spaces included. But many pandoc writers\n      assume that breakable spaces will be Space elements, and this\n      is also required for automatic wrapping.\n\n  * RST reader:\n\n    + Correctly handle intraword emphasis (#11309).\n\n  * Text.Pandoc.Readers:\n\n    + Export `readAsciiDoc`, `readXlsx`, `readPptx` [API change].\n\n  * New module Text.Pandoc.Writers.BBCode, exporting\n    `writeBBCode`,  `writeBBCodeSteam`, `writeBBCodeFluxBB`,\n    `writeBBCodePhpBB`, `writeBBCodeHubzilla`, `writeBBCodeXenforo`\n    [API change].\n\n  * LaTeX writer:\n\n    + Make level 1-3 headings work inside blockquotes (#11281, James Barlow).\n    + Remove `split` from list of math environments (#11274).\n    + Improve handling of math environments in tex math (#11266).\n\n  * HTML writer:\n\n    + Add reveal.js `scroll` and `scrollSnap` options to writer and\n      template (#10052, Asliddinbek Azizovich).\n    + Use 'defer' when including mathjax script, as recommended in\n      MathJax docs (#11292).\n\n  * ANSI writer:\n\n    + Apply row spans in tables (#10149, Tuong Nguyen Manh).\n      The ANSI writer is now able to keep track of row spans and apply\n      them in rows.\n\n  * Pptx writer:\n\n    + Handle reference doc without slides (#7536, Tuong Nguyen Manh).\n\n  * AsciiDoc writer:\n\n    + Add more table features (#11267, Tuong Nguyen Manh):\n      Row span and column span, footer row, individual horizontal\n      cell alignment.\n\n  * Typst template:\n\n    + Fix font for compatibility with typst 0.14, which doesn't\n      permit an empty array for `font` (#11238).\n    + Re-add `columns` to typst template (#11259), fixing a\n      pandoc 3.8 regression.\n    + Fix syntax for bibliography inclusion (#11233, Mickaël Canouil).\n      Previously the syntax was wrong when multiple bibliography files\n      were specified. Typst expects an array.\n\n  * Text.Pandoc.Writers:\n\n    + Export `writeBBCode`,  `writeBBCodeSteam`, `writeBBCodeFluxBB`,\n      `writeBBCodePhpBB`, `writeBBCodeHubzilla`, `writeBBCodeXenforo`\n      [API change].\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Add functions `insertCurrentSpansAtColumn`, `takePreviousSpansAtColumn`\n      and `decrementTrailingRowSpans` for applying and keeping track of\n      RowSpans over multiple rows (#10149, Tuong Nguyen Manh). [API change]\n\n  * Text.Pandoc.Logging:\n\n    + Change message for missing HTML title warning (#11307). Suggest\n      setting the `pagetitle` variable instead of setting `title` in metadata.\n\n  * Lua subsystem:\n\n    + Preserve common state of custom Lua readers (Albert Krewinkel).\n      The common state is transferred to Lua when calling a custom Lua\n      reader, and is now also transferred back after the reader has\n      finished. This ensures that info messages, warnings, and\n      mediabag entries are available to the main program and all\n      subsequent processing steps.\n\n  * Text.Pandoc.PDF:\n\n    + Avoid converting SVG to PDF when non-TeX PDF engine is used (#11275).\n      This fixes a 3.8 regression, which caused documents with SVGs to\n      raise an error when converted to PDF using WeasyPrint.\n    + Fix a 3.8 regression with typst and smart quotes (#11256).\n      Before 3.8, the default behavior when producing a PDF `-t typst`\n      was to produce smart quotes according to typst's defaults.\n      (This could be defeated by specifying `-t typst-smart`.)\n      This behavior broke in 3.8 because of a change to Text.Pandoc.PDF.\n      This change caused `smart` to be disabled for all formats when\n      producing PDFs, when before it was only disable for TeX-based\n      formats (to avoid bad ligatures). This commit restores the old\n      behavior. Possibly the regression also other affects other\n      non-TeX formats, e.g. HTML.\n\n  * Text.Pandoc.Shared:\n\n    + Add functions `allRowsEmpty` and `tableBodiesToRows` from the\n      RST writer for reuse in other writers. (Tuong Nguyen Manh) [API\n      change].\n\n  * Text.Pandoc.Citeproc:\n\n    + Allow formatting in locator to be transmitted to citeproc.\n      We do this indirectly, by rendering the formatting using the\n      HTML tags that citeproc recognizes.  Fixes jgm/citeproc#68\n      and jgm/citeproc#163. Note that formatting is only possible for\n      locators given in the explicit form, surrounded by curly braces.\n      It won't work for implicit locators, since these expect\n      number-like expressions.\n\n  * New non-exported module Text.Pandoc.Readers.OOXML.Shared\n    containing functions factored out from\n    Text.Pandoc.Readers.Docx.Util (Anton Antich).\n\n  * Tests: The common file `nativeDiff` has been extracted from\n    the Docx and Pptx text files and put in Tests.Helpers.\n\n  * Use asciidoc 0.1, djot 0.1.2.4, texmath 0.13.0.2, typst 0.8.1,\n    citeproc 0.12.\n\n  * MANUAL.txt:\n\n    + Improve `implicit_figure` documentation (#11082).\n    + Give both forms of options when referring to them (#11306).\n\n  * Update INSTALL.md (#11271).\n\n## pandoc 3.8.2.1 (2025-10-20)\n\n  * HTML reader: allow blank space between open and close `iframe`.\n\n  * RTF reader: improve hyperlink parsing (#11211).\n\n  * Org reader:\n\n    + Parse parameter lists on unknown blocks (#11188, Albert\n      Krewinkel). The reader tries to parse the rest of the opening\n      line of a block, e.g., `#+begin_myblock …`, as a parameters\n      list. It first assumes that the parameters are in lisp-style\n      (`:key value`), then alternatively tries to read python-style\n      key-value pairs (`key=value`) and falls back to reading the\n      entire remaining line as a single `parameter` attribute.\n    + Add support for dynamic blocks.\n\n  * Docx writer: properly handle nested comment spans (#8189, #6959,\n    mourino).\n\n  * RST writer: Don't use simple tables with RowSpans (#11214,\n    Tuong Nguyen Manh).\n\n  * Typst writer: Escape open paren after non-space (#11210).\n    This fixes an issue that occurs if an open paren comes\n    right after e.g. `#strong[test]`.\n\n  * Typst template: ensure that title block is properly centered (#11221).\n\n  * LaTeX writer/template: small fix for unnumbered tables for\n    compatibility with older LaTeX installations (#11201).\n    Thanks to @priiduonu for the solution.\n\n  * MANUAL.txt: Fixed missing backtick (#11209, FoxChillz).\n\n  * Correct anchor references to `pandoc.text` module documentation (#11111,\n    Emmanuel Ferdman).\n\n  * Fixed golden test regeneration in Docx reader test.\n\n  * Allow unicode-data 0.8.\n\n  * Use citeproc 0.11. This fixes a significant performance\n    regression in pandoc 3.8, which was due to a rewrite of the\n    default chicago-author-date.csl file. Performance with `--citeproc`\n    is now on par with what we had in pandoc 3.7, even with the\n    revised Chicago styles.\n\n## pandoc 3.8.2 (2025-10-05)\n\n  * Markdown reader/writer: implement new `table_attributes` extension\n    (#10884). When `table_attributes` is enabled (as it is by default for\n    pandoc's Markdown), attributes can be attached to a table by\n    including them at the end of the caption. Previously the writer\n    would emit an identifier in this position, but the reader didn't\n    handle it. Now arbitrary attributes are allowed, and they work in\n    both the reader and writer.\n\n  * Typst writer: don't add superfluous semicolons (#11196).\n    Previously we added semicolons after inline commands not\n    followed by spaces, but mainly this was to deal with one issue:\n    the presence of a semicolon after an inline command, which\n    would be swallowed as a command separator (#9252).\n    This commits adopts an approach that should avoid so many\n    superfluous semicolons: it escapes semicolons that might come\n    right after a command.\n\n  * Typst template: fix 3.8 regression in which links disappear\n    (#11194). A template change in 3.8 added a show rule for links which\n    causes them to disappear except in special cases.\n\n  * Text.Pandoc.Parsing: rewrite `oneOfStrings` more efficiently.\n\n  * LaTeX writer: Fix strikeout in links (#11192, Tuong Nguyen Manh).\n    As in #1294 `\\url` and `\\href` need to be protected\n    inside an mbox for `soul` commands.\n\n  * Text.Pandoc.Extensions: Add `Ext_table_attributes` constructor for\n    `Extension` [API change].\n\n  * Use released texmath 0.13.0.1.\n\n  * Update FSF contact information in COPYING (#11183, Bensun Muite).\n\n  * MANUAL.txt: remove some redundancy (#11178, Reuben Thomas).\n\n## pandoc 3.8.1 (2025-09-29)\n\n  * New output format `vimdoc` (Vim documentation format) (#11132, reptee).\n\n    + [API change] Added module Text.Pandoc.Writers.Vimdoc, exporting\n      `writeVimdoc`.\n\n  * Markdown reader:\n\n    + Improve superscript/subscript/inline note parsing (#8652).\n      We do not allow inline notes to be followed by `(` or `[`.\n      Otherwise, we parse inline notes before superscripts.\n      Also, the sub/superscript parsers have been adjusted so that they\n      really exclude unescaped spaces (as they did not before, when the\n      spaces occurred in nested inlines).\n    + Fix simple table alignment (#11136, Tuong Nguyen Manh). Take wide\n      characters into account when determining the alignment.\n\n  * LaTeX reader:\n\n    + Ignore `\\pandocbounded` (#11140).\n\n  * XML reader:\n\n    + Parse `<MetaString>` (#11137, massifrg).\n\n  * Typst reader:\n\n    + Add support for reading typst pagebreak (#11101, Raymond Berger).\n      The pagebreak is parsed as a HorizontalRule inside a wrapper Div\n      with class `page-break`.\n\n  * Docx reader:\n\n    + Handle figures in indented paragraphs (#11028).\n    + Change default for textwidth. This should only be used if `sectPr`\n      is not found.\n    + Properly calculate table column widths (#9837, #11147).\n      Previously we assumed that every table took up the full text\n      width. Now we read the text width from the document's `sectPr`.\n    + Use Tasty.Golden for Docx reader tests. This way we can update\n      them with `--accept`.\n\n  * RST reader:\n\n    + Fix regression in simple table parsing (#11150).\n    + SkippedContent warning if table directive contains\n      non-tabular content.\n    + Simple tables: leading space in a cell should not cause the contents\n      to be parsed as a block quote (#11146).\n    + Parse `:alt:` on figure (#11140). Also give a better default if\n      `alt` is not specified, using the stringified caption rather\n      than the filename.\n    + Support col spans for simple tables (Tuong Nguyen Manh).\n\n  * Markdown writer:\n\n    + Improve handling of implicit figures (#11140).\n      Allow implicit figures when alt text differs from caption\n      (in this case, we use an image attribute to add the alt).\n    + Use approximate pipe tables when it's the only option (#11128).\n      If we have a table with row/colspans that can rendered as an\n      approximate pipe table (without row/colspans), and no other table\n      format is enabled that could render the table, we fall back to\n      an \"approximate\" pipe table, with no row/colspans.\n\n  * RST writer:\n\n    + Ensure blank line before directives (#11162).\n    + Add col spans for simple tables (#10127, Tuong Nguyen Manh).\n\n  * OpenDocument writer:\n\n    + Add missing table elements (#10002, Tuong Nguyen Manh).\n      Add missing header rows after the first one,\n      footer rows as well as TableBody header rows.\n\n  * Docx writer:\n\n    + Fix regression (from 3.8) in highlighted code (#11156).\n\n  * Powerpoint writer:\n\n    + Handle single column (Tuong Nguyen Manh).\n\n  * Typst writer:\n\n    + Fix syntax highlighting (#11171, completes #10525).\n      Previously the native typst highlighting was always used, regardless\n      of the setting of `--syntax-highlighting`. With this change,\n      `--syntax-highlighting=none` and `--syntax-highlighting=<stylename>`\n      (with skylighting style) will work.\n\n  * LaTeX writer:\n\n    + Make beamer footnotes compatible with pauses (#5954).\n      Previously they would appear before the content to which\n      the note was attached, when there were pauses in a slide.\n    + Avoid `\\_` in bibliography variable (#11152).\n    + Ensure that unlabelled tables don't increment counter (#11141).\n    + Protect VERB in caption (#11139, Tuong Nguyen Manh).\n    + Don't add links to TOC (#11124, Albert Krewinkel).\n    + Fix strikeouts in beamer title (#11168, Tuong Nguyen Manh).\n\n  * LaTeX template: Add `shorthands` variable for LaTeX output\n    (#11160). If true, pandoc will allow language-specific shorthands\n    when loading babel. (This is helpful, for example, in getting\n    proper spacing around French punctuation.)\n\n  * epub.css: Remove coloring for `a, a:visiting` (#11174).\n    This was causing links in iOS books app not to be distinguished in\n    any way (since underlining is not used there).\n\n  * Text.Pandoc.Parsing:\n\n    + [API chage] (Tuong Nguyen Manh). New functions `tableWithSpans`,\n      `tableWithSpans'`, `toTableComponentsWithSpans` and\n      `toTableComponentsWithSpans'` take a list of lists of\n      (Blocks, RowSpan, ColSpan) to parse a Table with different RowSpan and\n      ColSpan values accordingly. New helper functions `singleRowSpans` and\n      `singleColumnSpans` help set all RowSpans or ColSpans to be 1 in case\n      the table format only allows setting one or the other.\n\n  * Text.Pandoc.Class:\n\n    + Let `fetchItem` fail if the HTTP request is not\n      successful (Albert Krewinkel). HTTP requests that don't return a 200\n      error code are now treated as an error. This ensures that a warning is\n      triggered when using `--embed-resources` or `--extract-media`.\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Add new function `removeLinks` [API change] (Albert Krewinkel).\n      The function converts links to spans. It is used, for example, to avoid\n      nested links. The HTML writer used to put the description of nested links\n      into small caps, but uses a simple *span* now.\n\n  * Text.Pandoc.Highlighting: export typst functions\n    [API change]. New exported functions `formatTypstBlock`,\n    `formatTypstInline`, `styleToTypst`.\n\n  * Text.Pandoc.XML:\n\n    + Add `fetchpriority` to list of HTML attributes (#11176).\n\n  * Allow unicode-data 0.7.\n\n  * Use released djot 0.1.2.3. Fixes a bug in which indentation\n    was swallowed in a code block inside a blockquote.\n\n\n## pandoc 3.8 (2025-09-06)\n\n  * Add a new input and output format `xml`, exactly representing a Pandoc\n    AST and isomorphic to the existing `native` and `json` formats (massifrg).\n    XML schemas for validation can be found in `tools/pandoc-xml.*`.\n    The format is documented in `doc/xml.md`. Pandoc now defaults to this\n    reader and writer when the `.xml` extension is used.\n\n    Two new exported modules are added [API change]:\n    Text.Pandoc.Readers.XML, exporting `readXML`, and\n    Text.Pandoc.Writers.XML, exporting `writeXML`.\n    A new unexported module Text.Pandoc.XMLFormat is also added.\n\n  * Add a new command line option `--syntax-highlighting`; this takes\n    the values `none`, `default`, `idiomatic`, a style name, or a path to a\n    theme file. It replaces the `--no-highlighting`, `--highlighting-style`,\n    and `--listings` options, which will still work but with a deprecation\n    warning. (Albert Krewinkel)\n\n  * Create directory of output file if it doesn't exist (#11040).\n\n  * Update `--version` copyright dates (#10961), and use a hardcoded\n    string \"pandoc\" for the program name in `--version`, per GNU\n    guidelines.\n\n  * Add `smart_quotes` and `special_strings` extensions (Albert Krewinkel).\n    Currently these only affect `org`. Org mode makes a distinction between\n    smart parsing of quotes, and smart parsing of special strings like `...`.\n    The finer grained control over these features is necessary to truthfully\n    reproduce Emacs Org mode behavior. Special strings are enabled by default,\n    while smart quotes are disabled.\n\n  * Remove the old `compact_definition_lists` extension. This was\n    neded to preserve backwards compatibility after pandoc 1.12\n    was released, but at this point we can get rid of it.\n\n  * Make `-t chunkedhtml -o -` output to stdout (as documented), rather\n    than creating a directory called `-` (#11068).\n\n  * RST reader: Support multiple header rows (#10338, TuongNM).\n\n  * LaTeX reader:\n\n    + Support soft hyphens (Albert Krewinkel).\n    + Parse `\\minisec` as unlisted level 6 headings (#10635, Albert Krewinkel).\n    + Support `\\ifmmode` (#10915).\n    + Change handling of math environments (#9711, #9296).\n      Certain environments in LaTeX will trigger math mode and can't\n      occur within math mode: e.g., `align` or `equation`.  Previously\n      we \"downshifted\" these, parsing an `align` environment as a\n      Math element with `aligned`, and an `equation` environment as a\n      regular display math element.  With this shift, we put these in\n      Math inlines but retain the original environments.\n      texmath and MathJax both handle these environments well.\n\n  * Typst reader:\n\n    + Fix addition of image path prefix to use posix separator.\n    + Properly resolve image paths in included files (#11090).\n    + Handle inline-level show rules on block content (#11017).\n      Typst allows things like `smallcaps` to be applied to block-level\n      content like headings.  This produces a type mismatch in pandoc,\n      so before processing the output of typst-hs, we transform it,\n      pulling the block-level elements outside of the inline-level\n      elements.\n\n  * Org reader:\n\n    + Improve sub- and superscript parsing (Albert Krewinkel).\n      Sub- and superscript must be preceded by a string in Org mode. Some text\n      preceded by space or at the start of a paragraph was previously parsed\n      incorrectly as sub- or superscript.\n    + Allow \"greater block\" names to contain any non-space char (#4287,\n      Albert Krewinkel).\n    + Accept quoted values as argument values (#8869, Albert Krewinkel).\n    + Recognize \"fast access\" characters in TODO state definitions\n      (#10990, Ryan Gibb).\n    + Improve org-cite parsing: Handle global prefix and suffix properly.\n      Use all and only the styles mentioned in oc-basic.el.\n      Allow space after `;`.\n\n  * HTML reader:\n\n    + Don't drop the initial newline in a `pre` element (#11064).\n\n  * DocBook reader:\n\n    + Add rowspan support (#10981, Sean Soon).\n    + Be sensitive to startingnumber attribute on ordered lists (#10912).\n\n  * POD reader:\n\n    + Fix named entity lookup (#11015, Evan Silberman).\n\n  * Man reader:\n\n    + Support header and footer reader (Sean Soon).\n\n  * Markdown reader:\n\n    + Don't confuse a span after an author-in-text citation with a\n      locator.  E.g. `@foo [test]{.bar}`.\n      See https://github.com/jgm/pandoc/issues/9080#issuecomment-3221689892.\n    + Make definition lists behave like other lists (#10889).\n      If the `four_space_rule` extension is not enabled,\n      figure out the indentation needed for child blocks dynamically,\n      by looking at the first nonspace content after the `:` marker.\n      Previously the four-space rule was always obeyed.\n    + Fix tight/loose detection for definition lists, to conform to\n      the documentation.\n\n  * ODT reader:\n\n    + Support `table-header-rows` (Tuong Nguyen Manh).\n\n  * Docx reader:\n\n    + Don't add highlighting if highlight color is \"none\" (#10900).\n    + Handle strict OpenXML as well as transitional (#7691).\n    + Fix `stringToInteger` (#9184). It previously converted things like\n      `11ccc` to an integer; now it requires that the whole string be parsable\n      as an integer.\n    + Improve handling of AlternateContent. This fixes handling of\n      one representation of emojis in Word (#11113).\n\n  * LaTeX writer:\n\n    + Control figure placement with attribute (#10369, Sean Soon).\n      If a `latex-placement` attribute is present on a figure, it will be used\n      as the optional positioning hint in LaTeX (e.g. `ht`). With implicit\n      figures, `latex-placement` will be added to the figure (and removed from\n      the image) if it is present on the image.\n    + Include cancel package only if there is math that contains `\\cancel`,\n      `\\bcancel`, or `\\xcancel`.\n    + Add braces around comments in `title-meta` (#10501). This is needed to\n      prevent PDFs from interpreting this as a sequence of titles.\n    + Set `pdf-trailer-id` if `SOURCE_DATE_EPOCH` envvar is set (#6539, Albert\n      Krewinkel). The `SOURCE_DATE_EPOCH` environment variable is used to trigger\n      reproducible PDF compilation, i.e., PDFs that are identical down to the\n      byte level for repeated runs.\n    + Be more conservative about using `\\url` (#8802). We only use it when the\n      URL is all ASCII, since the `\\url` macro causes problems when used with\n      some non-ASCII characters.\n    + Support soft hyphens (Albert Krewinkel).\n    + Change handling of math environments (#9711, #9296).\n      When certain math environments (e.g. `align`) are found in Math\n      elements, we emit them \"raw\" instead of putting them in `$..$`.\n\n  * Typst writer:\n\n    + Check `XID_Continue` in identifiers (Tuong Nguyen Manh).\n    + Add escapes to prevent inadvertent lists due to automatic wrapping\n      (#10047). Also simplify existing code that was meant to do this.\n    + Add parentheses around typst-native year-only citations (#11044).\n    + Add native Typst support for `nocite` (#10680, Albert Krewinkel).\n      The `nocite` metadata field can now be used to supply\n      additional citations that don't appear in the text, just as with citeproc\n      and LaTeX's bibtex and natbib.\n    + Set `lang` attribute in Divs (#10965).\n    + Rename `numbering` variable to `section-numbering` (Albert Krewinkel).\n      This is the name expected by the default template.\n    + Add support for custom and/or translated \"Abstract\" titles (Albert\n      Krewinkel, #9724).\n\n  * Org writer:\n\n    + Don't wrap link descriptions (#9000). Org doesn't reliable display\n      these as links if they have hard breaks.\n    + Disable smart quotes by default (Albert Krewinkel).\n\n  * Markdown writer:\n\n    + Better handling of pandoc-generated code blocks (#10926).\n      Omit the wrapper sourceCode divs added by pandoc around code blocks.\n      More intelligently identify which class to use for the one class\n      allowed in GFM code blocks.  If there is a class of form `language-X`,\n      use `X`; otherwise use the first class other than `sourceCode`.\n    + Use fenced divs even with empty attributes (#10955, Carlos Scheidegger).\n      Previously fenced divs were not used in this case, causing the writer to\n      fall back to raw HTML.\n    + Match indents in definition items (#10890, Albert Krewinkel).\n      Previously, the first line of a definition details item always used a\n      colon and three spaces instead of respecting the tab-stop setting, which\n      could lead to round-tripping issues. Likewise, the indentation of\n      continuation paragraphs in definition lists now matches the\n      two-characters leader of the first line for Markua output.\n\n  * DocBook writer:\n\n    + Use `startingnumber` instead of `override` for start numbers on ordered\n      lists (#10912).\n\n  * ANSI writer:\n\n    + Make `--wrap=none` work properly (#10898).\n\n  * Djot writer:\n\n    + Fix duplicate attributes before section headings (#10984).\n\n  * Docx writer:\n\n    + Ensure that documents don't start with a section separator\n      (#10578, Albert Krewinkel). Any leading section separator is removed from\n      the result.\n\n  * HTML writer:\n\n    + Unwrap \"wrapper\" divs (#11014). Some of the readers (e.g. djot) add\n      \"wrapper\" divs to hold attributes for elements that have no slot for\n      attributes in the pandoc AST. The HTML reader now \"unwraps\"\n      these wrappers so that the attributes go on the intended elements.\n\n  * Asciidoc writer:\n\n    + Handle lists with sublists following continuations (#11006).\n      These require an additional blank line in some cases.\n\n  * HTML styles template: prefix default styles with informative CSS comment\n    (Albert Krewinkel, #8819).\n\n  * Org template: add `#+options` lines if necessary (Albert Krewinkel).\n    The default template now adds `#+options` lines if non-default settings\n    are used for the `smart_quotes` and `special_strings` extensions.\n\n  * LaTeX template:\n\n    + Don't emit empty `linkcolor=` in hypersetup (#11098).\n    + Add RTL support for LuaTeX engine (Reuben Thomas).\n\n  * Typst template:\n\n    + Add several new variables (Christopher T. Kenny, #9956):\n      `thanks`, `abstract-title`, `linestretch`, `mathfont`, `codefont`,\n      `linkcolor`, `filecolor`, `citecolor`.\n\n  * `reference.docx`:\n\n    + Don't left-align table header row (R. N. West, #11019).\n    + Update East Asia font theme in `styles.xml` to `minorEastAsia` (TomBen).\n    + Update language settings in `styles.xml` for East Asia to Simplified\n      Chinese (TomBen).\n\n  * Text.Pandoc.PDF:\n\n    + `makePDF`: automatically embed resources from media bag in HTML\n      before trying to convert it with weasyprint, etc. (#11099).\n      This will give better results when converting from formats like docx.\n    + Use `utf8ToText` for LaTeX log messages.\n    + Make images from MediaBag available in tmp dir for every PDF engine,\n      not just LaTeX/ConTeXt (#10911).\n    + Improve error readability when pdf-engine is not supported (Albert\n      Krewinkel). Each supported engine is now printed on a line of its own.\n    + Allow `pdflatex-dev` and `lualatex-dev` as PDF engines (#10991, Albert\n      Krewinkel). These are the development versions of the LaTeX binaries;\n      installable, e.g., with `tlmgr install latex-base-dev`.\n    + Clean up `makePDF` (Albert Krewinkel).\n    + Avoid encoding errors when reading LaTeX logs (#10954).\n\n  * Text.Pandoc.Readers:\n\n    + Raise unknown reader error for `ods`, `odp`, `odf`, `xls`,\n      `xslx`, `zip` extensions.\n\n  * Text.Pandoc.App:\n\n    + Recognize binary signatures and fail early (Repetitive). Fail early when\n      receiving binary input with recognized signature: zip[-based], including\n      OpenDocument and Microsoft formats, PDF, CFBF-based (old Microsoft formats\n      including .doc and .xls), DjVu.\n    + Remove code duplication around version info.\n      Text.Pandoc.App.CommandLineOptions and `pandoc-cli/src/pandoc.hs`\n      had similar code for generating version information.\n      To avoid duplication, we now export `versionInfo` from\n      Text.Pandoc.App [API change]. This function has three parameters that can\n      be filled in when it is called by `pandoc-cli`.\n\n  * Text.Pandoc.Parsing:\n\n    + `tableWith` and `tableWith'` now return a list of lists of Blocks, rather\n      than a list of Blocks, for the header rows, allowing for multiple header\n      rows [API change] (#10338, TuongNM).\n\n  * Text.Pandoc.Citeproc:\n\n    + Don't move footnotes around em-dashes (#11046).\n    + Allow `--citeproc` to put the bibliography in a Div with id `refs`\n      even when `--file-scope` is used (#11072). When `--file-scope`\n      is used, a prefix will be added based on the filename, so the Div\n      will end up having an identifier like `myfile.md__refs`.\n      Previously, this prevented the bibliography from being added to\n      the marked Div. Now pandoc will add the bibliography to any Div\n      with the id `refs` or any id ending in `__refs`.\n\n  * Text.Pandoc.Citeproc.BibTeX: Protect case in periodical titles (#11048).\n    Thus, for example, `{npj} Quantum Information` should translate as\n    `[npj]{.nocase} Quantum Information`.\n\n  * Text.Pandoc.ImageSize:\n\n    + Detect more JPEG file signatures (R. N. West and John MacFarlane, #11049).\n    + Unpack compressed object streams in PDFs and look inside for MediaBox\n      information (#10902).\n    + Add Point and Pica as constructors of ImageSize [API change] (#8957).\n      This will prevent unnecessary conversion of units.\n    + Add Avif constructor on ImageType [API change] and support avif images\n      (#10979).\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Amend docs of `lookupMeta...` functions (#10634, Albert Krewinkel).\n\n  * Text.Pandoc.Options:\n\n    + Add and export `defaultWebTeXURL` WebTeX URL [API change] (#11029,\n      Sean Soon). This fixes the `webtex` option when used without\n      parameter in a defaults file.\n    + Add type `HighlightMethod` and patterns [API Change] (Albert Krewinkel).\n    + The `writerListings` and `writerHighlightStyle` fields of the\n      `WriterOptions` type are replaced with `writerHighlightMethod`\n      [API change] (Albert Krewinkel, #10525).\n\n  * Text.Pandoc.Extensions:\n\n    + Remove `Ext_compact_definition_lists` constructor for\n      `Extension` [API change].\n    + Add `Ext_smart_quotes` and `Ext_special_strings` constructors.\n      [API change].\n\n  * Text.Pandoc.SelfContained:\n\n    + Try fetching relative resources without query or fragment if the original\n      fetch fails. This provides a fix for #1477 in a way that doesn't raise\n      the problems mentioned in #11021.\n\n  * Text.Pandoc.Highlighting:\n\n    + Export `defaultStyle` [API Change] (Albert Krewinkel).\n      This allows to be more explicit about using a default style, and\n      providing a single point of truth for its value. The variable is\n      an alias for `pygments`.\n\n  * Text.Pandoc.Class:\n\n    + `downloadOrRead`: do not drop fragment/hash for local file paths (#11021).\n      With the previous behavior it was impossible to have an image\n      file containing `#` or `?`.\n    + Export function `runSilently` [API Change] (Albert Krewinkel).\n      The function runs an action in the PandocMonad, but returns all log\n      messages reported by that action instead of adding them to the main log.\n    + Make CommonState opaque. Text.Pandoc.Class now exports CommonState as\n      an opaque object, without its fields. [API change]\n      The internal module Text.Pandoc.Class.CommonState still exports\n      the fields.\n    + Text.Pandoc.Class now exports the following new functions:\n      `getRequestHeaders`, `setRequestHeaders`, `getSourceURL`,\n      `getTrace`. [API change]\n    + CommonState now has a `stManager` field. This allows us to cache the HTTP\n      client manager and reuse it for many requests, instead of creating it again\n      (an expensive operation) for each request. This fixes a memory leak and\n      performance issue in files with a large number of remote images (#10997).\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Add function `pandoc.structure.unique_identifier`.\n    + Add functions `pandoc.text.superscript` and `subscript`.\n    + Use proper interface functions to access the CommonState.\n      The `PANDOC_STATE` is no longer a userdata object, but a table that\n      behaves like the old object. Log messages in `PANDOC_STATE.log` are now\n      in temporal order.\n    + Add function `pandoc.path.exists`.\n    + Add `normalize` function to *Pandoc* objects (#10356).\n      This function performs a normalization of Pandoc documents. E.g.,\n      multiple successive spaces are collapsed, and tables are normalized such\n      that all rows and columns contain the same number of cells.\n    + Add more UTF-8-aware file operations to `pandoc.system`.\n      Functions that expect UTF-8-encoded filenames should make it easier to\n      write platform-independent scripts, as the encoding of the actual\n      filename depends on the system. In addition, there is a new\n      generalized method to run commands, and functions to retrieve XDG\n      directory names. The new functions are `command`, `copy`, `read_file`,\n      `remove`, `rename`, `times`, `write_file`, `xdg`.\n    + Allow hslua-2.4.\n    + Require lua-module-system 1.2.3. This provides List methods to the value\n      returned by `pandoc.system.list_directory` (#11032).\n\n  * MANUAL.txt:\n\n    + Fix broken ConTeXt links (R. N. West, #11055).\n    + Add `xml` as input/output format.\n    + Fix minor capitalization typo (#11052, Albert Krewinkel).\n\n  * `doc/lua-filters`:\n\n    + Fix docs for `pandoc.Cite` (Albert Krewinkel).\n    + Don't encourage returning tables of filters from Lua filters\n      (R. N. West, #10995). Use the `Pandoc:walk` method instead.\n\n  * doc/extras.md: Fix link to pandoc-mode (Erik Post).\n\n  * doc/lua-filters.md: Add example on using pandoc.Table constructor (#10956,\n    Sean Soon).\n\n  * Update `default.csl` from new chicago-author-date.csl, which is now\n    for the 18th edition.\n\n  * Use latest releases of citeproc, typst-hs, texmath, doclayout,\n    skylighting-core, skylighting.\n\n## pandoc 3.7.0.2 (2025-05-28)\n\n  * RST writer:\n\n    + Don't emit alignment markers in grid tables (#10857).\n\n  * Asciidoc writer:\n\n    + Add support for sidebars (GHyman83).\n\n  * LaTeX writer:\n\n    + Include alt option in `\\includegraphics` (#6095).\n\n  * Markdown writer:\n\n    + Preserve figure attributes (Nikolay Yakimov, #10867).\n      Fixes a regression introduced by 0d2114e, which caused the\n      Markdown writer to ignore attributes on the figure if it\n      has class or key-value attributes set.\n\n  * HTML writer:\n\n    + Use the ID prefix in the ID for the footnotes section (Benjamin Esham).\n\n  * Text.Pandoc.Writers.Shared:\n\n    + `gridTable`: fix (3.7) regression with missing cell alignments (#10853).\n    + `gridTable`: fix headings with colspans (#10855). If the heading\n      contains a colspan, we still need to include information in the header\n      line about the colspecs.\n    + `gridTable`: fix headerless tables. The top line should encode\n      colspan information.\n\n  * Text.Pandoc.SelfContained:\n\n    + Fix handling of empty script element (#10862). Previously in this\n      case the closing tag was dropped.\n    + Do not drop `data-` attributes in script tags (#10861).\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Add function `pandoc.mediabag.make_data_uri` (#10876).\n      The function takes a MIME type and raw data from which it creates an\n      RFC 2397 data URI.\n\n  * `tools/update-lua-module-docs`: fix handling of wikilinks\n    (Albert Krewinkel).\n\n  * `doc/lua-filters.md`: add missing docs for `pandoc.Caption`\n    (Albert Krewinkel).\n\n  * Require texmath 0.12.10.3, typst 0.8.0.1\n\n## pandoc 3.7.0.1 (2025-05-17)\n\n  * Text.Pandoc.Shared.Writer:  Fix numerous problems with `gridTable` and add\n    tests (#10848).  These fixes affect the Markdown, RST, and Muse writers.\n\n  * Fix context writer/template to produce tagged PDFs (#10846).\n    As before, the `tagging` extension must be enabled.\n    We now add the command that tells ConTeXt to start tagging.\n\n## pandoc 3.7 (2025-05-14)\n\n  * Add new command-line option `--variable-json` (#10341).\n    This allows non-string values (booleans, lists, maps) to be given to\n    template variables on the command line.\n\n  * The `--pdf-engine` option can now take `groff` as a value.\n\n  * Markdown writer:\n\n    + Avoid spaces after/before open/close delimiters (#10696).\n      E.g. instead of rendering `x<em> space </em>y` as `x* space *y` we render\n      it as `x *space* y`.\n    + Handle row/colspans in grid tables, and expand cells when it isn't\n      possible to lay them out without breaking string of non-whitespace.\n    + Render a figure with Para caption as implicit figure (#10755).\n    + When falling back to a Div with class `figure` for a figure that\n      can't be represented any other way, include a Div with class\n      `caption` containing the caption.\n    + Improve use of implicit figures when possible (#10758).\n      When the alt differs from the caption, but only as regards formatting, we\n      still use an implicit figure.\n    + Omit initial newlines in gfm `math` blocks to avoid an ugly blank line.\n    * Support the `four_space_rule` extension for `plain` output (#10813,\n      Manolis Stamatogiannakis).\n\n  * RST writer:\n\n    + Handle row/colspans in grid tables, and expand cells when it isn't\n      possible to lay them out without breaking string of non-whitespace.\n\n  * Muse writer:\n\n    + Handle row/colspans in grid tables, and expand cells when it isn't\n      possible to lay them out without breaking string of non-whitespace.\n\n  * JATS writer:\n\n    + Fix escaping for writing-review-editing role (#10744).\n\n  * HTML writer:\n\n    + Remove trailing slash from default revealjs URL (#8749). This\n      avoids a double slash in the URL's path component.\n\n  * LaTeX writer:\n\n    + Make alignment work within `multirow` in tables (#10772).\n\n  * Typst writer:\n\n    + Support `mark` class on spans (#10747).\n    + Add equation label if math contains `\\label{..}` (#10805).\n\n  * Roff format writers (man, ms):\n\n    + Use the most compatible form for roff escapes (#10716).\n      For example, `\\(xy` instead of `\\[xy]`. This was the original\n      AT&T troff form and is the most widely supported. The\n      bracketed form causes problem for some tools, e.g.\n      `makewhatis` on macOS. And emit `e` followed by an escape\n      for a unicode combining accent rather than the form `\\[e aa]`,\n      which works for groff but not e.g. on macOS's man.\n      This change affects Text.Pandoc.RoffChar,\n      Text.Pandoc.Writers.Roff, and the Man and Ms writers.\n\n  * Docx writer:\n\n    + Ensure that figures and tables with custom styles are not dropped\n      (#10705).\n    + Preserve Relationships for images from reference docx (#10759).\n      This should allow one to include an image in a reference.docx and\n      reference it in an openxml template.\n    + Don't renumber rels (#10769). We used to renumber the\n      Relationships so they didn't conflict with the set of fixed\n      Relationships we imposed. We are now preserving the ids\n      from the reference doc's document.xml.refs, so we shouldn't\n      renumber them or references introduced by the user (e.g. in\n      a template) will fail.\n\n  * Ms writer:\n\n    + Improve PDF TOC labels. We now use the plain writer to render these,\n      so that Greek characters etc. will show up properly.\n    + When no `pdf-engine` variable is specified, do not use the\n      `.pdfhref` macros at all (#10738). This gives better results for links\n      in formats other than PDF, since the link text would simply\n      disappear if it exists only in a `.pdfhref` macro. When a PDF\n      engine is specified, escape the argument of `.pdfhref O` in a way\n      that is appropriate.\n\n  * OpenDocument writer:\n\n    + Fix character styles in footnotes (#10791). Character\n      styles governing the position of the footnote reference\n      should not be imposed on the footnote text.\n\n  * Powerpoint writer:\n\n    + Use reference-doc font for captions (#9896, R. N. West).\n\n  * DocBook writer:\n\n    + Use literallayout element for LineBlock (#10825).\n\n  * MediaWiki reader/writer:\n\n    + Allow definition on same line as term (#10708).\n\n  * LaTeX reader:\n\n    + Skip at most one argument to LaTeX tabular newline (#7512,\n      Evan Silberman).\n    + Disable ligatures inside `\\texttt` (#10781).\n    + Support more symbol commands (#10782).\n\n  * Commonmark Reader:\n\n    + Handle GFM math irregularity with braces (#10631). In GFM, you need\n      to use `\\\\{` rather than `\\{` for a literal brace.\n\n  * DocBook reader:\n\n    + Improve handling of literallayout (#10825). This is now only made\n      a CodeBlock when there is a `monospaced` class. Otherwise it is made\n      a LineBlock.\n\n  * Org reader:\n\n    + Add AVIF to Org Reader image extensions (#10736, Christian Christiansen).\n    + Don't include newlines in inine code/verbatim (#10730).\n      Convert newlines to spaces as we do in other formats.\n    + Change handling of inline TeX (#10836). Previously inline\n      TeX was handled in a way that was different from org's own export,\n      and that could lead to information loss. This was particularly noticeable\n      for inline math environments such as `equation`.  Previously, an\n      `equation` environment starting at the beginning of a line would create\n      a raw block, splitting up the paragraph containing it (see\n      #10836). On the other hand, an `equation` environment not\n      at the beginning of a line would be turned into regular\n      inline elements representing the math. (This would cause\n      the equation number to go missing and in some cases degrade\n      the math formatting.) Now, we parse all of these as raw\n      \"latex\" inlines, which will be omitted when converting to\n      formats other than LaTeX (and other formats like pandoc's\n      Markdown that allow raw LaTex).\n\n  * Beamer template: fix regression in 3.6.4, reverting the omission of\n    `\\date` when the document does not have a date. By default, beamer\n    will display a date when no `\\date` is present in the title block,\n    so this was an unintended behavior change. The reverted\n    change was motivated by the desire to include a custom\n    `\\date` in the frontmatter via header-includes. This can be\n    achieved more simply by simply setting the `date` variable.\n    In markdown you can even use `date` in metadata and put some\n    raw LaTeX there.\n\n  * Ms template:\n\n    + Use T rather than P as default font family (#10738).\n    + Put PDF-specific things under a conditional.\n      Don't include them if `pdf-engine` isn't set.\n\n  * Upgrade reveal.js URL to v5 (#10740, Kolen Cheung).\n    v4 is no longer available on unpkg.com.\n\n  * Text.Pandoc.PDF: Allow `groff` to be used as `--pdf-engine` with `ms`\n    (#10738). When `groff` is used as a PDF engine, the `groff`\n    extension to `ms` is automatically enabled. Limitations:\n\n    - `groff` currently produces larger PDFs than `pdfroff`.\n    - With `groff`, a table of contents produced with\n      `--table-of-contents/--toc` will always be placed at the end of\n      the document.\n    - Certain characters (e.g. Greek characters) may be dropped in\n      the PDF outline.\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Export `delimited` [API change].\n    + New version of `gridTable` (#6344) [API change]. This\n      handles row and colspans. It also ensures that cells won't\n      wrap text in places where it wouldn't normally wrap, even\n      if this means making the cells wider than requested by the\n      colspec (#9001, #7641). Because the parameters are\n      different, this is a breaking API change.\n\n  * Text.Pandoc.App: set `pdf-engine` variable.\n    If `--pdf-engine` is specified or if a PDF is being produced, we set the\n    `pdf-engine` variable. This allows writers and templates to behave\n    differently depending on the PDF engine.\n\n  * Text.Pandoc.Class and Text.Pandoc.URI:\n\n    + Fix parsing of base64 data URIs to allow URI escapes and\n      whitespace (which will be ignored) (#10704).\n    + Handle percent encoding in `pBase64URI` instead of\n      unescaping later, for efficiency (#10704).\n\n  * Text.Pandoc.Citeproc.BibTeX:\n\n    + Recognize `en` as a `langid` in biblatex bibliographies (#10764).\n\n  * Text.Pandoc.MIME:\n\n    + Add mime type and extension for `avif` (#10704).\n    + Handle `apng`, `avif`, `jxl` (#10704).\n\n  * Text.Pandoc.Readers.LaTeX.Math: export `inlineEnvironmentNames`.\n    Internal module, not a change to the public API.\n\n  * `reference.docx` (Andrew Dunning):\n\n    + Remove extra spaces around text placeholders.\n    + Add footnote block text sample.\n\n  * Text.Pandoc.Class.Sandbox:\n\n    + Add `sandboxWithFileTree` function [API change] (Albert Krewinkel).\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + pandoc-lua-engine: add all test files to the cabal file.\n    + Allow `pandoc.read` to be called in \"sandbox\" mode for added\n      security (#10831). Readers running in a sandbox will not be\n      able to access the network or file system. The sandbox is\n      enabled if the fourth parameter is a list of files or\n      filename/content pairs. The files are read and then made\n      available in the sandbox via en ersatz file system.\n\n  * Makefile:\n\n    + Add target `release-checkist`.\n    + Install @daisy/ace from npm if not present.\n    + Use pandoc lua instead of lua.\n    + Fix typo in `latex-package-dependencies` target.\n    + Use `jq` instead of `json_reformat` in `validate-docx-golden-tests2`.\n\n  * NiX infrastructure: new working `flake.nix` and simpler `shell.nix`.\n    Removed old `default.nix`.\n\n  * Require random >= 1.3 and use `splitGen`. `split` has been deprecated.\n\n  * Use citeproc-0.9. Bump citeproc bounds for pandoc, pandoc-lua-engine.\n\n  * Use texmath-0.12.10.1.\n\n  * Use released typst 0.8 (partially supporting typst 0.13).\n\n  * Use citeproc 0.9.0.1.\n\n  * MANUAL.txt:\n\n    + Fix default URL for revealjs.\n    + Add note that `alerts` extension only works with commonmark (#9716).\n    + Remove \"Body Text Char\" from list of Word styles that can be customized\n      using a reference.docx (#10646). This doesn't seem to be present in\n      pandoc-generated docx files, nor is it a Word default.\n    + For pandoc lua, add note about the environment.\n    + Improve documentation of `--variable` option.\n\n  * `doc/typst-property-output.md`: Mention that `typst:no-figure` is a\n    class, not an attribute (#10826, Niklas Eicker).\n\n  * Change RELEASE-CHECKLIST to RELEASE-CHECKLIST-TEMPLATE.org. Use org-babel\n    to automate many of the steps of the release.\n\n  * INSTALL.md: update MacPorts information (#10719, Mohamed Akram).\n\n  * COPYRIGHT: fix link to source code.\n\n  * CONTRIBUTING.md: Fix link to discussion forum. (#10834, R. N. West).\n\n## pandoc 3.6.4 (2025-03-16)\n\n  * Disable `citations` extension in writers if `--citeproc` is used (#10662).\n    Otherwise we get undesirable results, as the format's native\n    citation mechanism is used instead of (or in addition to) the\n    citeproc-generated citations.\n\n  * Markdown reader:\n\n    + Allow line break between URL and title of link (#10621).\n    + Give better position information when YAML metadata parsing fails\n      with a YAML exception (#10231).\n    + Fixed `escapedChar'` parser (#10672). It should not accept\n      escaped newlines.\n    + Remove some misguided list fanciness (#9865, #7778, cf. #5628).\n      Previously we tried to handle things like commented out list items:\n      ```\n      - one\n      <!--\n      - two\n      -->\n      - three\n      ```\n      and also things like:\n      ```\n      - one `and\n      - two` and\n      ```\n      But the code we added to handle these cases caused problems with\n      other, more straightforward things, like:\n      ````\n      - one\n      - ```\n        code\n        ```\n      - three\n      ````\n      So we are rolling back all the fanciness, so that the markdown\n      parser now behaves more like the commonmark parser, in which\n      indicators of block-level structure always take priority over\n      indicators of inline structure.\n\n  * HTML reader:\n\n    + Skip MathJaX-introduced cruft (#10673).\n    + Ignore style tags in the body (#10643).\n\n  * LaTeX reader:\n\n    + Better handle comments/whitespace in option lists and includes (#10659).\n    + Support `\\newline`, `\\linebreak`.\n\n  * Docx reader/writer:\n\n    + Revert commit adding row heads\n      (cbe67b9602a736976ef6921aefbbc60d51c6755a) (#10627).\n      Word sets `w:firstColumn=\"1\"` by default for tables.  You have to find\n      the Table Design tab and explicitly uncheck \"First Column\" to make this\n      go away.  In most cases, I don't think writers intend to designate\n      the first column as a row head, so this commit is going to produce\n      unexpected results.  In addition, because of the table normalization\n      done by pandoc-type's `tableWith`, any table containing a colspanned\n      cell in the left-hand column will get broken if the first column is\n      designated a row head.  For these reasons it seems best to revert this\n      change, which was made in response to #9495.\n\n  * LaTeX writer and template:\n\n    + Remove `selnolig-langs` (#9863). We now specify the language as\n      a global option again, so we no longer need to specify it when\n      invoking selnolig.\n    + Use babel options `shorthands=off` (#6817).\n    + Use `*` for multirow width when no colwidth specified (#10685).\n      Otherwise the multirow will be excessively wide.\n    + Protect `\\phantomsection` (#10688, etclub).\n\n  * Markdown writer:\n\n    + Omit extra space after bullets (#7172). Those who want the old\n      behavior can obtain it by using `-t markdown+four_space_rule`.\n    + Treat `Emph [Emph ils]]` as `ils` (#10642). Otherwise we get\n      `**content**` which means strong emphasis.\n\n  * EPUB writer:\n\n    + Use a nonbreaking space after section number in nav.xhtml.\n      This seems to be required for iOS books app to display the space.\n\n  * Typst writer:\n\n    + Better heuristics for escaping potential list markers (#10650).\n    + Ensure that `citation-style` works as well as `csl` (#10661).\n\n  * Powerpoint writer:\n\n    + Avoid extra blank lines before author when there is no\n      subtitle (#10619).\n\n  * JATS template:\n\n    + Fix typo in author prefix in article.jats_publishing template\n      (#10622, Tiago-Manzato).\n\n  * Text.Pandoc.Parsing:\n\n    + Smart quote parsing: ignore curly quotes (#10610). Previously we\n      tried to match curly quotes as well as straight quotes,\n      producing Quoted inlines. But it seems better just to assume\n      that those who use curly quotes want them passed through\n      verbatim. This also fixes an (unintended) bug whereby curly\n      single left quotes would sometimes be changed to single right quotes.\n\n  * Text.Pandoc.Shared:\n\n    + `makeSections`: put some attributes on section element only.\n      Certain `role` and `epub:type` attributes should only be on the section\n      (and indeed, many `role`s give a validation error if left on the\n      heading element).\n\n  * Text.Pandoc.Logging:\n\n    + Change NoTitleElement from WARNING to INFO (#10671). Users\n      commonly complain about the warning when producing HTML\n      documents without an explicit title. It seems that an info\n      message is more appropriate, since pandoc's default here (using\n      the input's base name) ensures compliance with the standard and\n      many users are happy with that default. Those who want to make\n      sure the message is seen can use `--verbose`.\n\n  * Beamer template: only emit `\\date` if set (#10687, josch).\n\n  * Fix invalid OOXML in definition_list.docx test (#10394).\n\n  * MANUAL.txt:\n\n    + Correct typo: 'date' for doubled 'title' (#10654, Olivier Dossmann).\n    + Add note about `template` variable for typst.\n    + Change maxwidth default in MANUAL.txt (#10683).\n    + Improve EPUB metadata documentation.\n    + In Security section, alert readers to a threat relating to iframe in\n      HTML, and add LaTeX, Typst to the list of formats that have an\n      `include` (#10682).\n\n  * `doc/lua-filters.md`: Add missing html_math_method 'katex' (R. N. West).\n\n  * Use texmath 0.12.9.\n\n  * Use typst 0.7. Fixes an issue with package loading, a regression\n    in pandoc 3.6.3.\n\n## pandoc 3.6.3 (2025-02-09)\n\n  * Track wikilinks with a class instead of a title (Evan Silberman).\n    Previously wikilinks were distinguished by giving them the `title`\n    `wikilink`.  Now that we have link attributes, it makes more sense\n    to give them the `class` `wikilink`. This change affects all readers\n    and writers that support wikilinks.\n\n  * DocBook reader:\n\n    + Handle title inside `orderedlist` (#10594). Also some other\n      elements that allow title: `blockquote`, `calloutlist`, etc.\n    + Better handle `informalequation` (#10592, tombolano). Include `id`\n      attribute.\n    + Better handle `formalpara`, `example`, and `sidebar` (#8666, tombolano).\n      Include identifiers and titles in each case.\n\n  * Markdown reader:\n\n    + Simplify and fix normal citation parsing (#10584).\n      This fixes a bug that causes some normal citations to be\n      parsed as bracketed regular citations.\n\n  * ODT reader:\n\n    + Create Figure elements for images that are figures (#10567).\n    + Avoid producing spurious blockquotes in list items (#9505).\n    + Fix unwanted block quotes (#10575). Previously the reader created\n      block quotes whenever a paragraph was marked indented (even though\n      this just affects the first line). With this change we still\n      generate block quotes for content that has an altered left margin,\n      but not for indented paragraphs.\n\n  * Docx reader:\n\n    + Do not issue warning for comments with `+styles` (#10571, Stephen Reindl).\n\n  * LaTeX reader:\n\n    + Test \\{,re}newcommand arguments (#4470, Evan Silberman).\n\n  * Pod reader:\n\n    + Consume blanks after =encoding in pod reader (#10537, Evan Silberman).\n\n  * JATS writer:\n\n    + Add CRediT roles to JATS (Charles Tapley Hoyt and Jez Cope, #10152).\n      Enable annotating author roles using the Contribution Role Taxonomy\n      (CRediT) and export this information in conformant JATS.\n\n  * LaTeX writer/templates:\n\n    + Improve babel support (#8283). Previously we used the `.ini`\n      files for every language, but for European languages these tend to\n      provide inferior results to the `.ldf` files used by classic\n      Babel. Currently Babel documentation recommends using the classic\n      system for European languages written in Latin and Cyrillic\n      scripts and Vietnamese. So the LaTeX writer and template now\n      follow this guidance.\n\n      Main languages in the list of languages with good \"classic\" support\n      are added to global documentclass options and will be automatically\n      handled by Babel using the `.ldf` files.\n\n      If the main language is not in this list, the `babeloptions` variable\n      will be set to `provide=*`, which will cause support to be loaded from\n      the `.ini` file rather than an `.ldf`. So, for example, setting\n      `-V babeloptions=''` with a polytonic Greek document will cause the\n      `.ldf` support to be used instead of the `.ini`.\n\n      The default setting of this variable can be overwritten, but in most\n      cases the default should give good results.\n\n    + Allow `csquotesoptions` to be specified.\n    + Fix indentation bugs in `font-settings.latex`.\n\n  * Docx writer:\n\n    + Repeat reference doc's `sectPr` for each new section (#10577).\n      Previously we were only carrying over the reference doc's `sectPr`\n      at the end of the document, so it wouldn't affect the intermediate\n      sections that are now added if `--top-level-division` is `chapter`\n      or `part`. This could lead to bad results (e.g. page numbering\n      starting only on the last chapter).\n    + Create section divisions with `--top-level-division=part` (#10576).\n    + Improve title style in reference.docx; base Author and Date\n      on Title; remove condensed spacing (Andrew Dunning, #10581).\n\n  * Typst writer:\n\n    + Brace tables with `typst:no-figure` and `typst:text` attributes (#10563,\n      Gordon Woodhull).\n\n  * Ms writer:\n\n    + Fix escaping of `-` (#10536). `-` should now be escaped in man\n      output but not in ms output (where `\\-` is a unicode minus sign).\n\n  * HTML styles: fix style of `hr` so it works when printed (#10535, Hendrik Erz).\n    Previously `background-color` was used to style the hr, but this gets ignored\n    when printing.  This commit uses `border-top` instead.\n\n  * Text.Pandoc.Shared:\n\n    + Handle `<abbr>` as a span-like inline in `htmlSpanLikeElements`\n      (#5793, Evan Silberman).\n\n  * Text.Pandoc.MediaBag:\n\n    + Prefer MIME type when determining extensions for MediaBag items (#10557,\n      Max Heller).  This should give different results for remote images\n      that are served at URLs that do not contain misleading extensions\n      (e.g. `shields.io`).\n\n  * Text.Pandoc.Citeproc:\n\n    + Fix moving punctuation before citation notes. This previously worked with\n      regular citations, but not author-in-text citations. Now it works with both.\n\n  * `doc/lua-filters.md`:\n\n    + Correct luacheck URL (#10589, R. N. West).\n    + Add static analysis paragraph to debugging section (#10568, R. N. West).\n    + Add note about extensions handling in `read` and `write` (Albert Krewinkel).\n\n  * `doc/extras.md`:\n\n    + Add entry for pandoc-subfigs (R. N. West).\n    + Update diagram Lua filter URL and description (R. N. West).\n\n  * MANUAL.txt:\n\n    + Add note on using typst to produce pdf/a-2b.\n    + Document top-level-division functionality with Docx (#10579, Andrew Dunning).\n\n  * Raise xml-conduit upper bound.\n\n  * Depend on latest commonmark-pandoc, commonmark-extensions,\n    citeproc, typst.\n\n  * Makefile: make `make binpath` quiet.\n\n## pandoc 3.6.2 (2025-01-12)\n\n  * New input format: `pod` (Evan Silberman). Pod (\"Plain old documentation\")\n    is a markup languaged used principally to document Perl modules and\n    programs.\n\n  * New reader module Text.Pandoc.Readers.Pod, exporting `readPod`\n    [API change].\n\n  * Docx reader:\n\n    + Support row heads in tables (#9495). Reader: When `w:tblLook` has\n      `w:firstColumn` set (or an equivalent bit mask), we set row heads = 1\n      in the AST.\n    + Read table styles as custom styles when `styles` extension\n      is enabled (#9603).\n\n  * HTML reader:\n\n    + Add size information for font awesome SVG icons (#10134).\n      If the icon has class `fa-fw` or `fa-w16` or `fa-w14`, we add a width\n      attribute to prevent the icon from appearing full-width in PDF or\n      docx output.\n\n  * Djot reader:\n\n    + Use a Span with class \"mark\" rather than \"highlighted\" for\n      highlighted text, for consistency with the other pandoc readers and\n      writers.\n\n  * mandoc reader:\n\n    + Add mdoc St for C23 (Evan Silberman).\n\n  * RST reader:\n\n    + Fix handling of underscores (#10497). Fixes a a regression\n      introduced in 3.6.\n\n  * Docx writer:\n\n    + Support row heads in tables (#9495). Writer: set `w:firstColumn` in\n      `w:tblLook` when there are row heads. (Word only allows one, so this\n      is triggered by any number of row heads > 0.)\n\n  * Djot writer:\n\n    + Render a Span with sole class \"mark\" as highlighted text.\n\n  * Asciidoc writer:\n\n    + Don't emit the class in a span if it's just \"mark\" (#10511).\n      The \"mark\" class is used for highlighting, and Asciidoc treats\n      bare `#...#` with no attributes as highlighted text.\n    + Improve escaping (#10385, #2337, #6424).\n\n  * EPUB v2 writer:\n\n    + Fix cover image (#10505).  This is a regression introduced in 3.6.\n\n  * Typst writer:\n\n    + Fix handling of pixel image dimensions (#9945).\n      These are now converted to inches as in the LaTeX writer.\n\n  * Improve error message given when users specify `asciidoc` as input\n    format (#8416, Santiago Zarate).\n\n  * Allow random 1.3.\n\n  * Use texmath 0.12.8.13 (typst improvements).\n\n  * `lua-filters.md`: document `system.os` return values (#10523).\n\n  * `MANUAL.txt`:\n\n    + Improve manual's coverage of custom styles.\n    + Replace LibreOffice PDF documentation link to latest so it links\n      to the latest major release rather than a specific major release\n      (which there are two of every year) (Stéphane Guillou).\n    + Improve links and descriptions for `odt`, `opendocument` (#10518).\n\n## pandoc 3.6.1 (2024-12-23)\n\n  * Allow YAML bibliographies to be arrays of references (#10452).\n    Previously, they had to be YAML objects with a `references` key.\n\n  * Change `--template` to allow use of extensionless templates (#5270).\n    The intent is to allow bash process substitution: e.g.,\n    `--template <(echo \"foo\")`. Previously pandoc *always* added an\n    extension based on the output format, which caused problems\n    with the absolute filenames used by bash process substitution\n    (e.g. `/dev/fd/11`). Now, if the template has no extension,\n    pandoc will first try to find it without the extension, and\n    then add the extension if it can't be found. So, in general,\n    extensionless templates can now be used. But this has been\n    implemented in a way that should not cause problems for\n    existing uses, unless you are using a template `NAME.FORMAT`\n    but happen to have an extensionless file `NAME` in the template\n    search path.\n\n  * Allow `--shift-heading-level-by=-1` to work in djot in the same way\n    it works for other formats (with the top-level heading being\n    promoted to metadata title) (#10459).  This needed special\n    treatment because of the way djot surrounds sections with Divs.\n\n  * RST reader:\n\n    + Handle explicit reference links (#10484, Evan Silberman).\n      This case was missed when changing the reference link strategy for\n      RST to allow a single pass. (It is a regression in pandoc 3.6.)\n\n  * Markdown reader:\n\n    + Use T.P.URI's `pBase64DataURI` in parsing data URIs (#10075,\n      Evan Silberman and John MacFarlane).\n    + More efficient base64 data URI parsing (#10075, Evan\n      Silberman and John MacFarlane). This should yield dramatic\n      performance improvements for markdown documents containing\n      large data URIs in images.\n\n  * HTML reader:\n\n    + Don't canonicalize data: URIs (#10075). It can be very expensive\n      to call network-uri's URI parser on these.\n\n  * LaTeX reader:\n\n    + Handle `figure*` environment as a figure (#10472).\n\n  * MediaWiki reader:\n\n    + Allow empty quoted attributes (#10490).\n    + Allow cells starting with `+` (#10491).\n\n  * Textile reader:\n\n    + Improve parsing of spans (#9878). The span needs to be separated\n      from its surroundings by spaces. Also, a span can have attributes,\n      which we now attach.\n    + Inline constructors shouldn't trigger if closer is preceded by\n      whitespace (#10414).\n\n  * Docx writer:\n\n    + Put chapters in separate sections, and restart footnotes\n      by section by default (#2773). The main effect of this change is that\n      when `--top-level-division=chapter` is used, chapters will start on\n      a new page and footnote numbering will restart for each chapter.\n      Both of these defaults can be overridden in the reference.docx.\n    + Use styleIds not styleNames for Title, Subtitle, etc.\n      (#10282). This fixes a regression introduced in pandoc 3.5.\n      This change affects the default openxml template as well as the\n      OpenXML writer.\n\n  * Markdown writer:\n\n    + Avoid collapsing of initial/final newline in markdown raw blocks.\n      This makes it easy to write a filter that adds extra blank lines\n      before certain elements (#10477).\n\n  * Mediawiki writer:\n\n    + Escape line-initial characters that would otherwise be interpreted\n      as list starts (#9700).\n\n  * LaTeX writer:\n\n    + Properly handle boolean value for `csquotes` variable (#10403).\n    + Use displayquote for block quotes with `csquotes` (#10456).\n\n  * HTML writer:\n\n    + Avoid calling parseURIString for data URIs (#10075).\n      This was done to determine the \"media category,\" but we can\n      get that directly from the mime component of data: URIs.\n\n  * Typst writer:\n\n    + Properly handle data URIs in images (#10460).\n\n  * LaTeX/Beamer templates:\n\n    + Fix default.beamer `nocite` location (Thomas Hodgson).\n      It must be inside a frame or it is ignored (#10465).\n    + Move nocites from LaTeX preamble to body (#10461, Thomas\n      Hodgson). Putting `\\nocite` in the preamble works only with biblatex.\n\n  * Text.Pandoc.Parsing:\n\n    + Correct example in comment on `charsInBalanced` (Evan Silberman).\n\n  * Text.Pandoc.Error:\n\n    + Mention typst in rendering `PandocUnknownWriterError` for `pdf`\n      (Evan Silberman).\n\n  * Text.Pandoc.MediaBag:\n\n    + `insertMedia`: fast path for data URIs. Avoid the slow URI\n      parser from network-uri on large data URIs (#10075).\n\n  * Text.Pandoc.Class:\n\n    + Add shortcut for base64 data URIs in `downloadOrRead` (#10075).\n      This avoids calling the slow URI parser from network-uri on\n      data URIs, instead calling our own parser.\n\n  * Text.Pandoc.MIME:\n\n    + Fix `extensionFromMimeType`. We had a few special cases encoded,\n      but as previously written they wouldn't work properly with\n      modifiers like `;charset=utf-8`.\n\n  * Text.Pandoc.URI:\n\n    + Export `pBase64DataURI`.  Modify `isURI` to use this and avoid\n      calling network-uri's inefficient `parseURI` for data URIs.\n\n  * Text.Pandoc.PDF:\n\n    + Fix temp file extension in `toPdfViaTempFile` (#10468).\n      This fixes a regression in pandoc 3.6, which changed\n      the extension from `html` to `source`. Apparently\n      `wkhtmltopdf` needs it to be `.html`.  So now we have added\n      a parameter to `toPdfViaTempFile` that allows the extension\n      to be specified in a way that is appropriate to the PDF engine\n      used.\n\n  * Lua (Albert Krewinkel):\n\n    + Support more elements as input to `pandoc.utils.stringify`\n      (#10450). Elements of type Caption, Cell, TableHead, and TableFoot\n      can now be stringified.\n    + Add `Caption` constructor to `pandoc` module.\n\n  * Miscellaneous code quality improvements (Joseph C. Sible).\n\n  * Depend on citeproc 0.8.1.2, skylighting and skylighting-core\n    0.14.5.\n\n  * `doc/lua-filters.md: Fix links to constructors (Albert Krewinkel).\n\n\n## pandoc 3.6 (2024-12-07)\n\n  * Add `mdoc` as input format (Evan Silberman). This change\n    introduces a reader for mdoc, a roff-derived semantic markup\n    language for manual pages. This reader has been developed almost\n    exclusively against mandoc's documentation and implementation of\n    mdoc as a reference, and the real-world manual pages tested\n    against are those from the OpenBSD base system. Of ~3500 manuals\n    in mdoc format shipped with a fresh OpenBSD install, 17 cause the\n    mdoc reader to exit with a parse error. Any further chasing of\n    edge cases is deferred to future work.\n\n  * New module: Text.Pandoc.Readers.Mdoc, exporting `readMdoc` [API change].\n\n  * Issue warnings for duplicate YAML metadata keys (#10312).\n\n  * Ensure that `--sandbox` affects `--embed-resources`. Previously it\n    did not (contrary to what was implied by the manual), which means\n    that an image with URL `/etc/passwd` would leak an encoded version\n    of that file to HTML output with `--self-contained` or\n    `--embed-resources`, even if `--sandbox` was used. Thanks to\n    Samuel Mortenson for pointing out the issue.\n\n  * Text.Pandoc.App.OutputSettings: add `sandbox'` function.\n    This computes the sandboxed files from Opt and avoids code repetition.\n\n  * Docx reader:\n\n    + Parse index references as empty spans with attributes (#10171).\n      Attributes included are `entry`, and optionally `bold`, `italic`,\n      `yomi`, `see`.\n    + Don't create multiple paragraphs for title or subtitle (#10359).\n      If there are multiple paragraphs with Title or Subtitle style,\n      use only the first for metadata.\n    + Handle case where Zotero `itemData` has different id from the\n      `citationItem` id.  In this case we use the `citationItemId`\n      in the bibliography as well, overriding the `referenceId`\n      in the itemData (#10366).\n\n  * LaTeX reader:\n\n    + Put parsed minipage in specially marked Div (#10266).\n\n  * HTML reader:\n\n    + Parse footnotes defined by dpub-aria roles (#5294).\n\n  * MediaWiki reader:\n\n    + Fix indented tables with caption (#10390).\n    + Fix parsing of col/rowspan (#6992).\n\n  * Typst reader:\n\n    + Avoid generating empty paragraphs.\n    + Support `underparen`, `overparen`.\n    + Fix `#quote` attribution. If attribution is not present, don't print\n      the `--` (#10320).\n    + Fix typo in unicode code point for em dash (see #10320).\n\n  * Commonmark reader:\n\n    + `implicit_figures` should check for empty caption\n      and not produce an implicit figure in this case (#10429).\n\n  * RST reader:\n\n    + Use a new one-pass parsing strategy. Instead of having an initial pass\n      where we collect reference definitions, we create links with target\n      `##SUBST##something` or `##REF##something` or `##NOTE##something`,\n      and resolve these in a pass over the parsed AST. This allows us to handle\n      link references that are not at the top level (#10281).\n    + Ignore newlines in URL in explicit link (#10279).\n    + Handle block level substitutions.\n    + Support `:file:` on raw directive (#8584).\n    + Implement option lists (#10318).\n    + Avoid putting metadata in Para (#7766). Create MetaInlines when possible,\n      just as with markdown input. MetaBlocks is still used when there are\n      multiple paragraphs or non-paragraph content.\n      This change also affects field lists.\n    + Fix linked substitutions (#6588). E.g. `|Python|_`.\n    + Support inline anchors (#9196).\n    + Explicit links define references (#5081). For example,\n      ``Go to `g`_ `g <www.example.com>`_.`` should produce two links to\n      www.example.com.\n\n  * EPUB writer:\n\n    + Use standardized filename for cover image instead of the original name\n      (#10404). This avoids problems with e.g. filenames containing spaces.\n\n  * Markdown writer:\n\n    + Issue INFO warning when not rendering table, e.g., when `raw_html` is\n      disabled and the table can't be fit into a supported markdown table\n      format (#10407).\n    + Respect empty LineBlock lines in `plain` output (Evan Silberman).\n      The plain writer behaved as a markdown variant with `Ext_line_blocks`\n      turned off, and so empty lines in a line block would get eliminated.\n\n  * LaTeX writer:\n\n    Ensure that beamer footnotes go on frame, not column (#5769).\n\n  * HTML writer:\n\n    + Unwrap empty incremental divs (#10328, Albert Krewinkel).\n      Divs are unwrapped if the only purpose of the div seems to be to control\n      whether lists are presented incrementally on slides.\n\n  * Typst writer:\n\n    + Make template sensitive to a `page-numbering` variable (#10370).\n      This can be set to an empty string (or, in metadata, to false) for\n      no page numbers.\n    + Make `smart` extension work (#10271). If `smart` is not enabled, a command\n      in the default template will disable smartquote substitutions.\n      When `smart` is enabled, render curly apostrophes as straight\n      and escape straight apostrophes. When `smart` is disabled,\n      render curly apostrophes as curly and don't escape straight\n      apostrophes. Similarly for quotes, em and en dashes. This should\n      give more idiomatic typst output, with fewer unnecessary\n      escapes.\n\n  * ANSI writer:\n\n    + Respect empty LineBlock lines (Evan Silberman).\n\n  * JATS writer:\n\n    + Correct spelling of suppress attribute (#10350, Andreas Deininger).\n\n  * Typst template:\n\n    + Remove `definitions.typst` partial.\n    + Remove unnecessary definition of `endnote`.\n    + Incorporate the one remaining definition into `default.typst`.\n    + Use typst 0.12 code for two column layout (#10294, Luis Rivera).\n    + Note: the new templates presuppose typst 0.12; if you try to use an\n      earlier version of typst, an error will be raised.\n\n  * LaTeX/Beamer template:\n\n    + Split `fonts.latex` partial into two parts: `fonts.latex` and\n      `font-settings.latex`.\n    + In beamer template, load beamer theme between `fonts.latex` and\n      `font-settings.latex`. This allows a theme (such as metropolis)\n      to set its own default font, while still allowing the user to\n      override it. This fixes a regression in pandoc 3.5 (#10297).\n    + Note: Users who have custom templates based on pandoc 3.5 templates will\n      need to add `font-settings.latex()` after `fonts.latex()` in the\n      latex template. In a beamer template, the beamer theme-setting\n      code needs to be moved between these two partials.\n\n  * ConTeXt template: Ensure that font names don't wrap (#10305).\n\n  * `epub.css`: remove background-color (#10264, Suraj Patil).\n    With this greyish background color, epubs look bad on a Kindle (#10263).\n\n  * Text.Pandoc.ImageSize: add WebP support (Evan Silberman, #10397).\n    Add `Webp` constructor on ImageType [API change].\n\n  * Text.Pandoc.Readers.Roff and a new unexported module\n    Text.Pandoc.Readers.Roff.Escape: parameterize Roff\n    escaping (Evan Silberman) [API change]. This allows code to\n    be reused between the mdoc and man readers, despite the\n    differing Token types.\n\n  * Text.Pandoc.PDF:\n\n    + PDF via LaTeX: always do max runs if `toc` is present (#10308).\n      The old method (checking to see if toc hash had changed) is not\n      completely reliable.\n    + Use `.source` extension, not `.html`, in `toPdfViaTempFile` (#10314).\n\n  * Text.Pandoc.Logging: add `YamlWarning` constructor to `LogMessage`\n    [API change] (#10312).\n\n  * Text.Pandoc.Format: remove duplicate typst entry (#10388, Caleb Mclennan).\n\n  * Fix a typo in the `ua.yaml` localization for 'See' (Jens).\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Remove prefixes from Lua type names (#8574). Lua type names were\n      inconsistent with regard to the use of prefixes; all prefixes\n      are removed now, and Lua types now have the same name as the\n      Haskell types. The use of app-specific prefixes is suggested by\n      the Lua manual to avoid collisions. However, this shouldn't be a\n      problem with pandoc, as it cannot be used as a Lua package.\n\n  * doc/libraries.md: Add newly developed Haskell packages.\n    Sort list alphabetically (Albert Krewinkel).\n\n  * doc/lua-filters.md: document `pandoc.List:iter` method (Albert Krewinkel).\n    List objects have a new function `iter` that returns an iterator\n    function that returns the next list item on each call.\n\n  * MANUAL.txt:\n\n    + Clarify what the example of YAML EPUB metadata shows (#10405).\n    + Fix typo in template syntax (#10265, Pascal Wagler).\n    + Update manual with information on openxml template (#10273).\n    + Clarify that `--variable` can only assign string values (#10298).\n\n  * Fix comments in TEI writer referring to DocBook (#10430, Evan Silberman).\n\n  * Fix several typos in documentation (#10349, Andreas Deininger).\n\n  * Allow Diff 1.0.\n\n  * Add font-settings.latex partial to pandoc.cabal (#10379).\n\n  * Bump upper bound for data-default.\n\n  * Use latest typst, texmath, pandoc-lua-marshal, commonmark-pandoc,\n    commonmark-extensions, skylighting, skylighting-format-blaze-html.\n\n\n## pandoc 3.5 (2024-10-04)\n\n  * Add command-line options `--list-of-figures/--lof` and\n    `--list-of-tables/--lot` (#10029, Akash Patel).\n    Only docx, latex, and context are affected by these options currently.\n    Setting the `lof` and `lot` variables will also work for the formats\n    that are currently supported.\n\n  * Defaults files:  interpolation of environment variables now\n    works for `to` and `from` fields (#8024). This is needed because\n    these files can contain paths of custom readers/writers.\n\n  * Docx reader:\n\n    + Reset lists after headers in same list `numId` (#10258).\n      To accomplish this, we add a Heading constructor to BodyPart and\n      include on it all the information list items have.\n\n  * DocBook reader:\n\n    + Parse id, class, and tabstyle on tables (#10181, Erik Rask).\n      Add parsing of id (xml:id), class, and tabstyle XML attributes\n      for table and informaltable in the DocBook reader.\n      The tabstyle value is put in the 'custom-style' attribute.\n\n  * Dokuwiki reader:\n\n    + Be more forgiving about misaligned lists, like dokuwiki itself (#8863).\n    + Improve blockquote parsing in dokuwiki. Allow for quoted code blocks.\n    + Enable smart extension.\n    + Properly parse `--` and `---` as dashes.\n    + Fix block quote behavior (#6461). Blockquotes are not really block\n      containers in DokuWiki; the lines are interpreted literally (so,\n      e.g., you can't start a list), and line breaks are added at the ends.\n\n  * EPUB reader:\n\n    + Fix links to other files in the EPUB, making them internal links\n      to a fragment derived from the filename (#10207).  There was\n      already code to handle links like `#foo`, but not to handle links\n      like `ch0001.html#foo`.\n\n  * LaTeX reader:\n\n    + Add em, ex, px, mu to list of units for dimension args (#10212).\n\n  * ANSI writer:\n\n    + Fix subscripts (Evan Silberman).\n\n  * DokuWiki writer:\n\n    + Don't emit `<HTML>` tags (#7413). The use of these tags is now\n      strongly discouraged for security reasons, and will be removed.\n      We previously used them as a fallback for lists that could not\n      be represented using DokuWiki syntax, e.g. ordered lists with\n      fancy numbers or lists with multiple blocks in their items.\n      We also used them for block quotes with multiple blocks as\n      their contents. We now use the `<WRAP>` syntax (from the optional\n      WRAP plugin) to handle lists with multiple blocks as their contents.\n      A new method of handling block quotes with complex contents\n      has the side benefit of also handling nested block quotes,\n      which weren't supported before.\n      `<HTML>` and `<html>` tags are only for raw HTML blocks and\n      inlines, and only if the `raw_html` extension is enabled. (It is\n      now a valid extension for `dokuwiki`, though off by default.)\n\n  * Docx writer:\n\n    + Support `--list-of-figures` and `--list-of-tables` (or `lof` and\n      `lot` variables) (Akash Patel).\n\n  * HTML writer:\n\n    + Don't emit missing title/lang warnings if templates does not\n      contain the `pagetitle` or `lang` variables respectively (#9370).\n\n  * LaTeX writer:\n\n    + Better fix for lists in definition lists (#10241).\n      In commit a26ec96d89ccf532f7bca7591c96ba30d8544e4a we added an\n      empty `\\item[]` to the beginning of a list that occurs first\n      in a definition list, to avoid having one item on the line with\n      the label. This gave bad results in some cases (#10241) and there\n      is a more idiomatic solution anyway: using `\\hfill`.\n    + Avoid error on `refs` div with empty citations (#10185).\n      If there are no citations, don't emit an empty CSLReferences environment.\n\n  * RST writer:\n\n    + Change bullet list hang from 3 to 2. This accords with the style in\n      the RST reference docs.\n    + Handle cases where indented context starts with block quote (#10236).\n      In these cases we emit an empty comment to fix the point from\n      which indentation is measured; otherwise the block quote is not\n      parsed as a block quote. This affects list items and admonitions.\n    + Don't enclose the list table in a `.. table::`; this leads to\n      doubled captions (#10226).\n    + Fix alignment of list table items corresponding to cells (#10227).\n\n  * JATS template:\n\n    + Support `floats-group` (Albert Krewinkel, see #10196).\n      The content of the `floats-group` variable is now rendered in a\n      `<floats-group>` element when using the *publishing* or *archiving* tag\n      sets.\n\n  * LaTeX and Beamer templates:\n\n    + Split old default.latex into two templates, `default.latex` and\n      `default.beamer`, factoring common parts into partials:\n      `fonts.latex`, `common.latex`, `passoptions.latex`,\n      `hypersetup.latex`, `after-header-includes.latex`.\n    + Make `default.beamer` the default template for beamer.\n    + Add `shorttitle`, `shortsubtitle`, `shortauthor`, `shortinstitute`,\n      `shortdate` variables to beamer template (#10248, Thomas Hodgson).\n    + Make `--number-sections` work with beamer (#12045, Thomas Hodgson).\n    + Support a list of images for `titlegraphic` in beamer template\n      (#10246, Thomas Hodgson). Title graphic options will be\n      applied to each title graphic. Images will be separated by `\\enspace`.\n    + Beamer theme options (#10243)\n    + Add theme options to beamer template: `colorthemeoptions`,\n      `fontthemeoptions`, `innerthemeoptions`, `outerthemeoptions` (#10243,\n      Thomas Hodgson).\n    + Don't load amsmath, amssym in beamer template. These are loaded by\n      beamer automatically.\n\n  * Text.Pandoc.SelfContained:\n\n    + Improve handling of links to remote CSS (#10261).\n\n  * Text.Pandoc.Class:\n\n    + Allow extracting `data:` URIs even in PandocPure (`--sandbox`)\n      (#10249).\n    + Export `extractURIData` [API change].\n\n  * Text.Pandoc.PDF:\n\n    + Read `.toc` and `.log` files from output directory (#10186).\n      When this is different from the input directory, this is\n      where `.toc` and `.log` files are written.\n\n  * Text.Pandoc.Shared:\n\n    + Modify `addPandocAttributes` for changes in commonmark-pandoc.\n      The new commonmark-pandoc version automatically adds the\n      attribute `wrapper=\"1\"` on all Divs and Spans that\n      are introduced just as containers for attributes that belong\n      properly to their contents.  So we don't need to add the\n      attribute here. This gives much better results in some cases.\n      Previously the wrapper attribute was being added even for\n      explicit Divs and Spans in djot, but it is not needed in these cases.\n\n  * Text.Pandoc.Options:\n\n    + Add `writerListOfFigures` and `writerListOfTables` fields\n      to `WriterOptions` (#8245, Akash Patel). [API change]\n\n  * Text.Pandoc.App:\n\n    + Add `optListOfFigures` and `optListOfTables` to `Opt` (#8245)\n      [API change].\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Update List module (#9835). The module now comes with a method\n      `:at(index[, def])` that allows to access indices, accepts\n      negative indices to count from the end, and will return the\n      `def` value as a default if the list has no item at the given position.\n      Furthermore, the list constructor `pandoc.List` now accepts iterators.\n      E.g., `pandoc.List(text:gmatch '%S+')` returns the list of words\n      in `text`.\n    + Support character styling via `pandoc.layout`. The `Doc` values\n      produced and handled by the `pandoc.layout` module can now\n      be styled using `bold`, `italic`, `underlined`, or `strikeout`. The\n      style is ignored in normal rendering, but becomes visible when\n      rendering to ANSI output. The `pandoc.layout.render` function\n      now takes a third parameter that defines the output style,\n      either *plain* or *ansi*.\n    + It is now possible to return a single filter from a filter file, e.g.\n      ``` lua\n      -- Switch single- and double quotes\n      return {\n        Quoted = function (q)\n          elem.quotetype = elem.quotetype == 'SingleQuote'\n            and 'DoubleQuote' or 'SingleQuote'\n          return elem\n        end\n      }\n      ```\n      The filter must not contain numerical indexes, or it might be treated\n      as a list of filters.\n    + Add `list_of_figures` and `list_of_tables` to writer options\n      (Akash Patel).\n\n  * Use latest releases of commonmark, commonmark-pandoc, texmath, djot.\n\n  * Stop depending on package SHA (Albert Krewinkel). Use `crypton` instead.\n\n  * `linux/make_artifacts.sh`: add riscv64 support (Olivier Benz).\n\n  * Fix invalid XML in `test/docx/normalize.docx` (#10242).\n\n  * `doc/lua-filters.md`: list functions in `pandoc.utils` alphabetically\n    (Albert Krewinkel).\n\n  * MANUAL.txt:\n\n    + Clarify  use of `beamerarticle` variable (#10250).\n    + Add clarification to address user issues like #6704 (Yehuda Katz).\n\n## pandoc 3.4 (2024-09-09)\n\n  * New output format: `ansi` (for formatted console output) (Evan Silberman).\n    Most Pandoc elements are supported and printed in a reasonable way, if\n    not always ideally. This version does no detection of terminal\n    capabilities, nor does it fall back to different output styles for\n    less-capable terminals.\n\n  * Add command line options `--table-caption-position` and\n    `--figure-caption-position`. These allow the user to specify whether\n    to put captions above or below tables and figures, respectively.\n    The following output formats are supported: HTML (and related such\n    as EPUB), LaTeX (and Beamer), Docx, ODT/OpenDocument, Typst.\n\n  * Change default `--pdf-engine` via HTML to WeasyPrint (#10142).\n    `wkhtmltopdf` is deprecated.  `weasyprint` is the easiest-to-install,\n    maintained alternative.  For better results, one might prefer\n    `pagedjs-cli`.\n\n  * Org reader:\n\n    + Fix parsing of src blocks with an `-i` flag (#10071, Albert Krewinkel).\n      Tabs are now preserved in the contents of *src* blocks if the the block\n      has the `-i` flag.\n\n  * RTF reader:\n\n    + Handle images inside `shp` contexts (#10145).\n\n  * RST reader:\n\n    + Improve simple table support (#10093). Multiline rows occur\n      only when the *first* cell is empty; we were previously treating\n      lines with *any* empty cell as row continuations. In addition, we\n      no longer wrap multiline cells in Para if they can be represented\n      as Plain. This is consistent with docutils behavior.\n\n  * LaTeX reader:\n\n    + Math environments don't have bracketed options (#10160).\n    + Parse nested tabular environments (#4746).\n\n  * Typst reader:\n\n    + Change how \"block\" elements are handled. Previously they were\n      always parsed as divs.  But actually they can occur in some \"inline\"\n      contexts.  Now we first try to parse them as inlines, and only as\n      blocks if that fails.  A surrounding Div or Span element is added\n      only if there is an identifier.\n\n  * HTML reader:\n\n    + Only parse main element's contents (if present) (#10140).\n      If main has an id or class, we include a div with that id or class;\n      otherwise just the contents.\n    + Read TeX annotation in MathML content if present (#9971).\n    + Better handle KaTeX-generated math (#9971). KaTeX emits the mathml\n      followed by a span with an HTML fallback. Previously pandoc was\n      converting both.  We now ignore the HTML fallback span, marked\n      with class `katex-html`.\n\n  * Docx reader:\n\n    + Add \"SuppressAuthor\" and \"AuthorOnly\" to citationMode\n      when `+citations` is used (thomjur).\n\n  * New module: Text.Pandoc.Writers.ANSI [API change] (Evan Silberman).\n\n  * Docx writer:\n\n    + Support `custom-style` attribute for docx table (Sebbones).\n    + Support `--number-offsets`.\n    + Make table/figure rendering sensitive to caption position settings.\n\n  * OpenDocument writer:\n\n    + Make table/figure rendering sensitive to caption position settings.\n\n  * Typst writer/template:\n\n    + Implement figure caption positions by triggering a show rule in\n      the default template, which determines caption positions for\n      figures and tables globally.\n    + Don't include trailing semicolon after `@` style citations with suffixes\n      (#10148).\n    + Template: move header-includes before show doc (#9996, Gordon Woodhull).\n\n  * LaTeX writer:\n\n    + Make table/figure rendering sensitive to caption position settings (#5116).\n    + Preserve locator labels with `--natbib` (#10057).\n\n  * HTML writer/template:\n\n    + Make `<figcaption>` placement sensitive to caption position\n      settings. For tables, `<caption>` must be the first element, and\n      positioning is determined by CSS, for here we set a variable\n      which the default template is sensitive to.\n    + Use `makeSectionsWithOffsets` for `writerNumberOffsets`,\n      instead of the old, inefficient code.\n    + Don't add doc-biblioref role to every link in a citation;\n      only to links to the bibliography (#10156).\n    + Add `data-` when rendering `label` attribute (#10048).\n\n  * Markdown writer:\n\n    + Avoid emitting markdown caption if table has fallen back to raw HTML,\n      which will then contain a `<caption>` tag (#10094).\n    + Make math sensitive to `tex_math_gfm` extension (#9121).\n      This means that in GFM output, the \"new style\" math will be used\n      by default, e.g.\n\n          $`x=y`$\n\n          ```math\n          x = y\n          ```\n\n      To defeat this and get the older behavior, namely\n\n          $x=y$\n\n          $$x=y$$\n\n      one could use `-t gfm-tex_math_gfm`.\n\n  * AsciiDoc writer:\n\n    + Add `link:` prefix when needed (#10105). AsciiDoc requires it\n      except for `http`, `https`, `irc`, `mailto`, `ftp` schemes (#10105).\n    + Preserve original base level (#10062). We used to normalize so\n      that the base level is always 1, but asciidoc no longer seems\n      to care about that, and the behavior creates difficulties when\n      we are converting fragments.\n    + Don't emit empty figure caption (#10047).\n\n  * ODT writer:\n\n    + Add TableCaption to styles.xml (#10058, Ian Max Andolina).\n\n  * LaTeX template:\n\n    + Fix wrong beamer color in (sub)section page (Jonathan).\n\n  * Text.Pandoc.Options:\n\n    + Add `CaptionPosition` and new `WriterOptions` fields\n      `writerFigureCaptionPosition` and `writerTableCaptionPosition`\n      [API change].\n\n  * Text.Pandoc.Opt:\n\n    + Change default for optNumberOffset to `[]`. This behaves the same as\n      `[0,0,0,0,0]`.\n    + Add `Opt` fields `optFigureCaptionPosition` and\n      `optTableCaptionPosition` [API change].\n\n  * Text.Pandoc.Format: change `formatFromFilePaths` so that it is\n    smarter about URLs.  URLs are parsed, and we take the format from\n    the path component, if present (#10141). This means that\n    `https://emacs.org/` will be treated as HTML, while\n    `https://emacs.org/sample.org` will be treated as Org.\n\n  * Text.Pandoc.URI:\n\n    + Add unofficial `gemini:` to list of URI schemes (Pau RE).\n\n  * Text.Pandoc.Shared:\n\n    + Add `makeSectionsWithOffsets` [API change].\n    + Remove `stripEmptyParagraphs [API change] (Albert Krewinkel).\n      This function is no longer used.\n\n  * Text.Pandoc.Highlighting: Expose `formatANSI` [API change]\n    (Evan Silberman).\n\n  * Text.Pandoc.Writers.Shared: export `to{Sub,Super}scriptInline`\n    [API change] (Evan Silberman).\n\n  * Remove use of partial functions (e.g. `head`) in code.\n\n  * Use latest skylighting-core, skylighting, doclayout, texmath, typst.\n\n  * pandoc-lua-engine: Add accessors for several writer options, including\n    some that were added in previous releases.\n\n  * pandoc-server: Initialize some missing fields in WriterOptions:\n    `writerEpubTitlePage`, `writerChunkTemplate`, `writerListTables`,\n    `writerFigureCaptionPosition`, `writerTableCaptionPosition`.\n\n  * CONTRIBUTING.md: Summarize steps for adding a new cli option.\n\n  * MANUAL.txt:\n\n    + Clarify that the `--number-offset` option should only\n      directly affect numbering of the first section heading in\n      a document; subsequent headings will increment normally.\n    + Fix asciidoc link (#10039).\n    + Fix CSL Docs broken link (#10100, Tristano Ajmone).\n    + Document the use of `luatexja` when CJKmainfont is used with lualatex\n      (#3873, Kolen Cheung).\n    + Add a `citations` (typst) section to the manual (#9127).\n    + Clarify that `citations` affects both input and output for `org`.\n    + Add note on `--citeproc` that you may need to disable `citations`\n      extension on the output format (e.g., `-t markdown-citations`) to\n      see the rendered citation (#9127, #10012).\n\n  * INSTALL.md — reorganise info on static binaries and add conda-forge\n    install options (#10098, #10069, Ian Max Andolina).\n\n## pandoc 3.3 (2024-07-28)\n\n  * New cli option: `--link-images`.  This causes images to be linked\n    rather than embedded in ODT.\n\n  * Allow `--number-sections` to take an optional `true|false` argument.\n\n  * RTF reader:\n\n    + Handle `\\*\\shppict` without dropping image (#10025).\n\n  * TWiki Reader:\n\n    + Recognize WikiWords as internal links (#9941).\n    + Avoid partial function.\n\n  * Typst reader:\n\n    + Ignore 'pad' and just parse its body (#9958).\n    + Use typst 0.5.0.5. Fixes parsing of equations like `$1.$`.\n\n  * Docx writer:\n\n    + Fix regression with nested lists (#9994). The bug affects e.g.\n      ordered lists with bullet sublists; after the sublist the top-level\n      list reverts to bullets instead of being properly numbered.\n      This is a regression introduced in version 3.2.1.\n\n  * BibTeX writer:\n\n    + Ensure that \"literal\" names are enclosed in braces (#9987).\n\n  * Man writer:\n\n    + Use default middle header when metadata does not include `header`\n      (#9943).  This change causes pandoc to omit the middle\n      header parameter when `header` is not set, rather than\n      emitting `\"\"`.  The parameter is optional and man will use\n      a default based on the section if it is not specified.\n\n  * HTML templates: don't load polyfill (#9918).\n    This was added in a period when MathJaX required polyfill.\n    MathJaX no longer recommends this and polyfill should no\n    longer be necessary on any reasonably modern browser.\n\n  * Translations:\n\n    + Add `ua.yaml` (Jens Oehlschlägel).\n    + Add a script (`tools/update-translations.py`) and Makefile\n      target (`update-translations`) to update translation data\n      automatically from babel and polyglossia upstream\n      (Stephen Huan).\n    + Use this script to update language data, increasing the number\n      of languages we cover (Stephen Huan).  Fix a few small bugs in\n      existing translations.\n\n  * Fix some mistakes with Japanese language code (#9938).\n    In several places we were mistakenly assuming that the BCP 47 code for\n    Japanese language was `jp`.  It is `ja`.\n\n  * Text.Pandoc.Options:\n\n    + New field in WriterOptions: `writerLinkImages` [API change] (#9815).\n\n  * Text.Pandoc.App.Opt:\n\n    + New field in Opt: `optLinkImages` [API change] (#9815).\n\n  * Lua subsystem:\n\n    + Keep `lpeg` and `re` as \"loaded\" modules (Albert Krewinkel).\n      The modules `lpeg` and `re` are now treated as if they had been\n      loaded with `require`. Previously the modules were only assigned\n      to global values, but could be loaded again via `require`,\n      thereby allowing to use a system-wide installation. However, this\n      proved to be confusing.\n\n      The old behavior can be restored by adding the following lines to\n      the top of Lua scripts, or to the `init.lua` in the data dir.\n\n          debug.registry()['_LOADED'].lpeg = nil\n          debug.registry()['_LOADED'].re = nil\n\n  * `pandoc-cli`: Include pandoc copyright in Lua version info (Albert\n    Krewinkel).\n\n  * `pandoc-cli`: Refer printing of version info to the Lua interpreter\n    (Albert Krewinkel). The Lua interpreter no longer terminates when\n    called with `-v` or `--version` arguments, thus improving\n    compatibility with the default `lua` interpreter program.\n\n  * Avoid partial functions in JATS reader, DocBook writer, Haddock reader.\n\n  * Allow tls 2.1.x.\n\n  * MANUAL.txt:\n\n    + Make documentation of extensions clearer (#9060).\n    + Fix section level for two Extensions entries.\n\n  * lua-filters.md: Partially autogenerate docs for module `pandoc`\n    (Albert Krewinkel). The documentation system isn't powerful enough to\n    generate the full documentation automatically.\n\n## pandoc 3.2.1 (2024-06-24)\n\n  * Fix `gfm_auto_identifiers` to replace emojis with their aliases,\n    as documented (#9876).\n\n  * CSV reader:\n\n    + Turn line breaks into LineBreaks not SoftBreaks (#9797).\n\n  * Docx reader:\n\n    + Support task lists (#8211).\n    + Fix a small bug in parsing delimiters in numbered lists,\n      which led to the default delimiter being used wrongly in some cases.\n    + Improve handling of captions.\n      - Turn captioned images into Figure elements. Closes #9391.\n      - Improve the logic for associating elements with captions (#9358).\n      - Ensure that captions that can't be associated with an\n        element aren't just silently dropped (#9610).\n    + Support HorizontalRule. We support both pandoc-style and the style\n      described on a Microsoft support page, an empty paragraph with\n      a bottom border (#6285).\n    + React to `\"left\"` value on `jc` attribute.\n    + Handle column and cell alignments (#8551). We take the column alignments\n      from the first body row.\n    + Fix a bug that caused comments inside insertions or deletions\n      to be ignored (#9833).\n\n  * HTML reader:\n\n    + Better handle non-`li` elements in `ul` and `ol` (#9809).\n      For example, a `p` after a closed `li` will be incorporated into\n      the previous `li`. This mirrors what browsers do with this\n      invalid HTML.\n\n  * LaTeX reader:\n\n    + Fix parsing of dimensions beginning with `.`, e.g. `\\kern.1pt` (#9902).\n\n  * Markdown reader:\n\n    + Allow author-only textual citations (#7219). E.g. `-@reese2002`\n      outside of brackets.\n\n  * RST reader:\n\n    + Tighten up rules for when emphasis can start (#9805).\n    + Support `:cite:` role with citeproc (#9904). A subset of the\n      functionality of the sphinxcontrib-bibtex extension to Sphinx\n      is supported.\n\n  * Textile reader:\n\n    + Don't let spans begin right after a symbol (#9878).\n\n  * Typst reader:\n\n    + Fix an incomplete pattern match (#9807).\n    + Handle inline bodies ending in a parbreak. E.g.\n      ```\n      `#strong[\n      test\n      ]\n      ```\n\n  * ConTeXt template: remove `\\setupbackend[export=yes]` (#9820).\n\n  * Docx writer:\n\n    + Allow OpenXML templates to be used with `docx` (#8338, #9069, #7256,\n      #2928). The `--reference-doc` option allows customization of styles in\n      docx output, but it does not allow one to adjust the content of the output\n      (e.g., changing the order in which metadata, the table of contents,\n      and the body of the document are displayed), or adding boilerplate\n      text before or after the document body.  For these changes, one can\n      now use `--template` with an OpenXML template.  (See the default\n      `openxml` template for a sample.) `--include-before-body` and\n      `--include-after-body` can also now be used with `docx` output.\n      The included files must be OpenXML fragments suitable for\n      inclusion in the document body.\n    + New unexported module Text.Pandoc.Writers.Docx.OpenXML.\n    + Omit `jc` attribute on table cells with AlignDefault (#5662).\n    + Better formatting for task lists. Task lists are now properly\n      formatted, with no bullet (#5198).\n    + Replace an expensive generic traverse to remove Space elements,\n      for better performance.\n    + Wrap figures with `id` in a bookmark (#8662).\n    + Add eastAsia font hints to `w:r` (#9817). We do this when the text\n      in the run contains any CJK characters. This ensures that ambiguous\n      code points (e.g. quotation marks) will be represented as \"wide\"\n      characters when together with CJK characters.\n    + Clean up Abstract Title and Subtitle in default reference docx.\n      Center Subtitle, remove color.\n\n  * HTML writer:\n\n    + Ensure URI escaping needed for `html4` (#9905).\n      Unicode characters need not be escaped for html5, and still won't be.\n    + Don't emit unnecessary classes in HTML tables (#9325, Thomas Soeiro).\n      Pandoc used to emit a `header` class on the `tr` element that forms\n      the table header. This is no longer needed, because `head > tr` will\n      do the same thing. Similarly, pandoc used to emit `even` and `odd`\n      classes on `tr`s, allowing striped styling.  This is no longer needed,\n      because one can use e.g. `tbody tr:nth-child(2n)`.\n      Compatibility warning:  users who relied on these classes to style\n      tables may need to adjust their CSS.\n\n  * JATS writer:\n\n    + Support `supplementary-material` in metadata for `jats_articlepublishing`\n      (#9818).\n\n  * LaTeX writer:\n\n    + New method for ensuring images don't overflow (#9660).\n      Previously we relied on graphicx internals and made global\n      changes to Gin to force images to be resized if they exceed\n      textwidth.  This approach is brittle and caused problems\n      with `\\includesvg` (see #9660). The new approach uses a new macro\n      `\\pandocbounded` that is now defined in the LaTeX template.\n      (Thanks here to Falk Hanisch in https://github.com/mrpiggi/svg/issues/60.)\n      The LaTeX writer has been changed to enclose `\\includegraphics`\n      and `\\includesvg` commands in this macro when they don't explicitly\n      specify a width or height. In addition, the writer now adds\n      `keepaspectratio` to the `\\includegraphics` or `\\includesvg`\n      options if `height` is specified without width, or vice versa.\n      Previously, this was set in the preamble as a global option.\n      Users should attend to the following compatibility issues:\n      - If custom templates are used with the new LaTeX writer, they will have\n        to be updated to include the new `\\pandocbounded` macro, or an error\n        will be raised because of the undefined macro.\n      - Documents that specify explicit dimensions for an image may render\n        differently, if the dimensions are greater than the line width or\n        page height. Previously pandoc would shrink these images to fit,\n        but the new behavior takes the specified dimensions literally.\n        In addition, pandoc previously always enforced `keepaspectratio`,\n        even when width and height were both specified, so images with\n        width and height specified that do not conform to their intrinsic\n        aspect ratio will appear differently.\n    + Task lists must be unordered (#9185).\n    + Specify language option for `selnolig` and only include it if\n      `english` or `german` is used (#9863). (This includes changes to the\n      LaTeX template.) This should restore proper ligature suppression when\n      lualatex is used.\n    + Fix `--toc-depth` with beamer output (#9861). Previously only top-level\n      sections were ever included in the TOC, regardless of the setting of\n      `--toc-depth`.\n    + Use `\\linewidth` instead of `\\columnwidth` or `\\textwidth`\n      for resizing figures, table cells, etc. in LaTeX (#9775).\n      `\\linewidth`, unlike the others, is sensitive to indented environments\n      like lists.\n\n  * LaTeX template: put `babel-lang` in options to beamer (#9868).\n    This is required to make beamer use proper localized terms for\n    things like \"Section.\"\n\n  * Markdown writer:\n\n    + Don't print extra caption when using `implicit_figures`.\n    + Ensure blank line after HTML blocks in commonmark-based formats (#9792).\n    + Fix bug rendering block quotes in lists (#9908).\n\n  * Texinfo writer:\n\n    + Ensure proper escaping in all node/link contexts.\n    + Target node rather than anchor when possible in internal links.\n    + Remove illegal characters from internal link anchors (#6177).\n    + Use two commas not one in `@ref`.\n    + Don't add anchors to headings. We don't need them, now that we\n      make internal links use the node.\n    + Avoid duplicate node names.\n    + Improve menus. Properly handle the case where the node name is\n      different from the descriptive title.\n\n  * Texinfo template: add variables for filename and version.\n\n  * Typst writer:\n\n    + Support '.typst:no-figure' and 'typst:figure:kind=kind' attributes\n      (#9778, Carlos Scheidegger). This extends support for fine-grained\n      properties in Typst. If the `typst:no-figure` class is present on a\n      Table, the table will not be placed in a figure. If the\n      `typst:figure:kind` attribute is present, its value will be used\n      for the figure's `kind` (#9777). These features are documented in\n      `doc/typst-property-output.md`.\n\n  * Typst template:\n\n    + Add subtitle (#9747, Mickaël Canouil).\n    + Use content rather than string for title, author, date, email (#9823).\n      This allows formatting in title, author, date, and email fields.\n      Since the PDF metadata requires a string, and typst only\n      converts the title to a string (not the authors), we use\n\n  * Textile writer:\n\n    + Get rid of header, odd, even classes on `tr` (#9376).\n\n  * Text.Pandoc.Class:\n\n    + `fillMediaBag`: Convert IOErrors to warnings when fetching absolute\n       paths (#9859, Albert Krewinkel).  This will allow many conversions that\n       would have failed with an error to succeed (albeit without images or\n       other needed resources).\n\n  * Text.Pandoc.ImageSize:\n\n    + Don't prefer exif width/height when they conflict with image\n      width/height (#9871).  That was a mistaken call in #6936.\n      Usually when these values disagree, it is because the image\n      has been resized by a tool that leaves the original exif values\n      the same, so the width/height metadata are more likely to be\n      correct that exif width/height.\n\n  * Text.Pandoc.SelfContained:\n\n    + Strip CRs from XML before base64 encoding for data URI\n      (so tests can work on Windows).\n    + Only create `<svg>` elements for SVG images when the image has\n      the class `inline-svg`. Otherwise just use a `data` URI as we do\n      with other images (#9787).\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Split Init module into more modules. The module has grown unwieldy and\n      is therefore split into three internal Haskell modules, `Init`,\n      `Module`, and `Run`.\n    + Add function `pandoc.utils.run_lua_filter` (#9803).\n    + Add function `pandoc.template.get` (#9854, co-authored by Carsten Gips).\n      The function allows to specify a template with the same argument value\n      that would be used with the `--template` command line parameter.\n    + Keep CommonState object in the registry. The state is an internal\n      value and should be treated as such. The `PANDOC_STATE` global is\n      merely a copy; unsetting the global no longer breaks the Lua engine.\n    + Allow passing an environment to `run_lua_filter`.\n      The default is now to use a *copy* of the global environment when running\n      a filter; this ensures better separation when `run_lua_filter` is used\n      multiple times. A custom environment can be specified via the\n      optional third parameter.\n    + Set `pandoc.List` as default metatable for JSON lists (#9834).\n      Lists created by `pandoc.json.decode` now behave like lists generated\n      via `pandoc.List`. This also ensures that `pandoc.List` tables are\n      encoded as JSON arrays when passed to `pandoc.json.encode`.\n\n  * Text.Pandoc.Writers.Shared: export `toTaskListItem` [API change].\n\n  * Add unexported module Text.Pandoc.Char. This exports `isCJK`.\n    Use this instead of locally defined `isCJK` in T.P.Readers.MediaWiki.\n\n  * MANUAL.txt:\n\n    + Remove false claim that Lua mode does not support `-i` (#9757,\n      Ian Max Andolina).\n    + Use level-3 headings for extensions (to avoid gaps).\n    + Add anchor for tagging extension.\n    + Remove explicit referencess to generate anchors.\n      These will be linkified automatically.\n    + Fixed links to `option--reference-doc`.\n    + Add a note that column widths aren't supported in pptx for Divs\n      with class `columns` (#9890).\n    + Fix alerts example (#9826, Ian Max Andolina).\n    + Fix markup of `babelfonts` example code (Albert Krewinkel).\n\n  * `doc/custom-writers.md`:\n\n    + Fix usage of Template in example (Albert Krewinkel).\n    + Document the separator arg of `Writer.Blocks` (Albert Krewinkel).\n\n  * `doc/lua-filters.md` (Albert Krewinkel):\n\n    + Fix outdated documentation for math and quoting functions and fields.\n    + Autogenerate docs for module `pandoc.template` and `pandoc.layout`.\n    + Document operators of the \"Doc\" type.\n\n  * pandoc-lua-engine: depend on pandoc >= 3.2 (see #9755).\n\n  * Allow crypton-connection 0.4, time 1.14.\n\n  * Allow tasty-quickcheck 0.11.\n\n  * Use latest emojis, skylighting, skylighting-core, citeproc, djot,\n    commonmark-extensions, typst-hs\n\n## pandoc 3.2 (2024-05-11)\n\n  * Change to `--file-scope` behavior (#8741): previously a Div with an\n    identifier derived from the filename would be added around the contents\n    of each file. This caused problems for \"chunking\" files into chapters,\n    e.g. in EPUB. We no longer add the surrounding Div. This cooperates\n    better with chunking. Note, however, that if you have relied on the old\n    behavior to link to the beginning of the contents of a file using\n    its filename as identifier, that will no longer work.\n\n  * Markdown reader:\n\n    + Allow repeated labels in numbered example lists.\n      Previously if you tried to use the same label as an earlier\n      example list item, you'd get a new number, not the old one,\n      and references to the label would go to the second occurrence.\n      Now an existing label will be reused, and no new number will\n      be generated.  Caveat:  this only works reliably when the\n      re-used example list item occurs by itself in a list, or\n      occurs in a list of previously used example list items that\n      occur in exactly the same order as previously.\n    + Fix `normalCite` so it doesn't consume past a closing `]` boundary\n      (#9710).  This was causing an exponential performance bug on long\n      lists of links containing potential emphasis characters.\n    + Generalize `inlinesInBalancedBrackets` to `inBalancedBrackets`,\n      with a parameter for the inner parser.\n    + Auto-close unclosed divs (#9635). This applies to both fenced and\n      HTML-ish varieties. Otherwise we face an exponential performance\n      problem with backtracking. A warning is issued when a div is\n      implicitly closed.\n\n  * RST reader:\n\n    + Fix `figclass` and `align` annotations for figures (#7473, Gokul\n      Rajiv).\n\n  * LaTeX writer:\n\n    + Use `polytonicgreek` instead of `polutonikogreek` with babel (#9698).\n      `polutonikogreek` is outdated. Also recognize both in the LaTeX\n      reader.\n    + Improve treatment of math inside soul commands (#1294, #5529).\n      soul commands (`ul`, `hl`, `st`) are very fragile and the math\n      must be handled specially.\n\n  * LaTeX reader:\n\n    + Fix over-eager macro expansion in conditionals (#9676).\n    + Parse `flalign`, `flalign*` math environments (#9679). We parse\n      these as Math elements with an `aligned` environment. Semantically\n      it's not exactly the same, but better than falling back to raw LaTeX.\n\n  * LaTeX template: add `titlegraphicoptions` variable (#9207, Guilhem\n    Saurel).\n\n  * Docx reader:\n\n    + Issue warning rather than error when we can't parse EndNote citations\n      (see #8433).\n    + Fix anchor in header after anchor (#9626, mbracke).\n\n  * RTF reader:\n\n    + Don't try to handle non-default code pages (#9683). Emit a warning\n      instead.\n\n  * OpenDocument writer:\n\n    + Implement custom-style for spans (#9657).\n\n  * Typst writer:\n\n    + Add blank line in definition lists with multiple definitions (see\n      #9704).\n    + Property output (#9648, Gordon Woodhull). The Typst writer will pass\n      on specially marked attributes as raw Typst parameters on selected\n      elements. This allows extensive customization using filters.\n      A separate document (`doc/typst-property-output.md`) has been added\n      that provides extensive documentation and examples of the use of\n      this feature.\n\n  * Markdown writer:\n\n    + Don't try to align columns in pipe tables with lines greater than\n      COLUMNS. The alignment just reduces readibility when the lines\n      soft wrap.\n    + Don't use `raw_attribute` syntax for raw blocks, unless there is no\n      other option (see #9677).  Macros in a `raw_attribute` block don't\n      get interpreted when it is read again by pandoc's markdown reader.\n\n  * ConTeXt writer:\n\n    + Replace depreciated `\\sc` with `\\setsmallcaps` (#9518, James P.\n      Ascher).\n\n  * Docx writer:\n\n    + Use conventional styles/indents for Word bullet lists (#7280).\n\n  * `reference.docx`:\n\n    + Use current standard Word theme (#7280). This includes using the\n      sans-serif font Aptos instead of the serif font Cambria, and\n      default colors for headings.\n    + Remove duplicate `DefaultParagraphFont` in `styles.xml`.\n\n  * New module Text.Pandoc.Transforms [API change] (Albert Krewinkel).\n    This module exports the following functions which were formerly\n    exported from Text.Pandoc.Shared: `headerShift`,\n    `filterIpynbOutput`, `eastAsianLineBreakFilter`, as well as some\n    functions that were previously not exported.\n\n  * Text.Pandoc.Shared:\n\n    + `headerShift`, `filterIpynbOutput`, and `eastAsianLineBreakFilter`\n      are no longer exported from this module; they are now exported\n      from Text.Pandoc.Transforms (Albert Krewinkel).\n\n  * Text.Pandoc.Error:\n\n    + Improve reporting of unsupported extensions errors (#9247, Albert\n      Krewinkel).\n\n  * Text.Pandoc.App:\n\n    + Move \"transforms\" after filters (#9664). This will mean that\n      `--shift-heading-level-by` affects a heading added by\n      `reference-section-title`.\n\n  * Text.Pandoc.App.CommandLineOptions:\n\n    + Simplify output for `OptVersion`. Omit the information about versions\n      of dependencies. We no longer emit version info at this level anyway;\n      `pandoc-cli` intercepts and handles `--version`. This code would\n      only be called if someone used the pandoc library function\n      `handleWithOptInfo` in their own program.\n\n  * Text.Pandoc.ImageSize:\n\n    + Export `ImageSize` datatype.\n\n  * Text.Pandoc.SelfContained:\n\n    + Merge class attribute when both img and svg specify it (#9652,\n      Carlos Scheidegger).\n\n  * Text.Pandoc.Logging:\n\n    + Add `ScriptingInfo` constructor for `LogMessage` [API change]\n      (Albert Krewinkel).\n    + Make `DocxParserWarning` a WARNING, not INFO. [API change].\n    + Add `UnsupportedCodePage` constructor to `LogMessage` [API change].\n    + Add `UnclosedDiv` constructor for `LogMessage` [API change].\n\n  * Lua subsystem (Albert Krewinkel:\n\n    + Add a `pandoc.log` module.\n    + Uupdate to pandoc-lua-marshal version 0.2.7 (#8916).\n      This fixes counterintuitive behavior of the `content` property on\n      BulletList and OrderedList items. Unmarshalling of that field now\n      matches the behavior of the constructor.\n    + Use newest zip module. This adds a `symlink` function to Entry objects,\n      allowing to check if an entry represents a symbolic link.\n    + Improve `pandoc.json.decode` docs.\n    + Update and fix docs for `pandoc.types.Version` and `pandoc.utils.type`.\n    + Add new module `pandoc.image` The module provides basic querying\n      functions for image properties.\n    + Bump pandoc-lua-engine to 0.2.1.4.\n\n  * Use latest KaTeX CDN asset (#9707, Salim B).\n\n  * `pandoc-cli`: ensure UTF8 when emitting version info.\n\n  * tools/update-lua-module-docs.lua: improve script-internal docs, cleanup\n    (Albert Krewinkel).\n\n  * Allow network 3.2.\n\n  * Use latest versions of texmath, djot, skylighting-core, skylighting.\n\n  * Fix command test for #9652.\n\n  * Fix some typos in code comments (#9638, guqicun).\n\n  * Command tests: include regular PATH after directory with the test\n    executable (ensures that DLLs will be found on Windows).\n\n  * MANUAL.txt:\n\n    + Document `handout` variable for beamer (#9742).\n    + Document formats affected by `--slide-level` (#9745).\n    + Update the list of required LaTeX packages (#9728, Albert Krewinkel).\n    + Use more descriptive link text for ODT (#9673).\n    + Add clarification about `toc-title` in `docx`, `pptx` (#9645).\n    + Better document truthiness for conditionals (#9661).\n    + Mention that `custom-style` works with ODT (Ian Max Andolina).\n    + Harmonize typographic dashes (#9688, Salim B). Standardize on `---`\n      with no space.\n\n  * INSTALL.md: Minor tweaks (#9705, Leo Heitmann Ruiz).\n\n## pandoc 3.1.13 (2024-04-07)\n\n  * Org reader:\n\n    + Fix treatment of `id` property under heading (#9639).\n\n  * DocBook reader:\n\n    + Add empty title to admonition div if not present (#9569).\n      This allows admonition elements (e.g. `<note>`) to work with\n      `gfm` admonitions even if the `<title>` is not present.\n\n  * DokuWiki reader:\n\n    + Link text cannot contain formatting (e.g., `//` is not italics) (#9630).\n    + An explicitly empty link text (`[[url|]]`) works the same as an omitted\n      link text (#9632).\n\n  * Typst reader:\n\n    + Support Typst 0.11 table features: col/rowspans, table head\n      and foot (#9588).\n    + Parse cell col/rowspans.\n\n  * CSLJson writer:\n\n    + Put `$` or `$$` around math in `csljson` output (#9616).\n\n  * ConTeXt writer:\n\n    + Fix options order with `\\externalfigure`. The dimensions should\n      come after the class if both are present.\n\n  * Typst writer:\n\n    + Put label after Span, not before. Labels get applied to preceding markup\n      item.\n    + Support Typst 0.11 table features (#9588): colspans, rowspans,\n      cell alignment overrides, relative column widths,\n      header and footer, multiple table bodies with intermediate headers.\n      Row heads are not yet supported.\n    + The default typst template has been modified so that tables\n      don't have lines by default. As is standard with pandoc, we only\n      add a line under a header or over a footer. However, a different\n      default stroke pattern can easily be added in a template.\n    + More reliable escaping in inline `[..]` contexts (#9586). For example,\n      we need to escape `[\\1. April]` or it will be treated as an ordered list.\n    + Handle `unnumbered` on headings (#9585).\n\n  * LaTeX writer:\n\n    + Fix math inside strikeout (#9597).\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Export `isOrderedListMarker` [API change].\n\n  * Change lhs tests so they don't use `--standalone`.\n    This will avoid test failures due to minor changes in\n    skylighting versions, e.g. #9589.\n\n  * Use latest texmath, typst.\n\n  * Require pandoc-lua-marshal 0.2.6 (#9613, Albert Krewinkel).\n    Fixes an issue arising when the value of `content` properties\n    on *BlockQuote*, *Figure*, and *Div* elements was an empty list.\n\n  * Update lua-filters.md (#9611, Carlos Scheidegger).\n\n\n## pandoc 3.1.12.3 (2024-03-17)\n\n  * Markdown reader: Fix bug with footnotes at end of fenced div (#9576).\n\n  * LaTeX reader:\n\n    + Improve tokenization of `@` (#9555). Make tokenization sensitive to\n      `\\makeatletter`/`\\makeatother`. Previously we just always treated\n      `@` as a letter.  This led to bad results, e.g. with the sequence `\\@`.\n      E.g., `a\\@ b` would parse as \"ab\" and `a\\@b` as \"a\".\n    + Make `withRaw` work inside `parseFromToks` (#9517).\n      This is needed for raw environments to work inside table cells.\n    + Better handling of table colwidths (#9579). Previously the parser just\n      failed if the column width specified in `p{}` wasn't a multiple of\n      `\\linewidth`. This led to cases where content was skipped.\n\n  * Typst writer:\n\n    + Add 'kind' parameter to figures with tables (#9574).\n    + Avoid unnecessary box around image in figure (#9236).\n    + Omit width/height in images unless explicitly specified (#9236).\n      Previously we computed width/heigth for images that didn't have\n      size information, because otherwise typst would expand the image\n      to fit page width. This typst behavior has changed in 0.11.\n      This change fixes a bug in which images would sometimes overflow\n      page margins, depending on their intrinsic size.\n    + Don't add hard-coded `inset` to tables (#9580). Instead, set this\n      globally in the default template, allowing it to be customized.\n\n  * LaTeX template: Fix block headings support for unnumbered paragraphs\n    (#9542, #6018, Oliver Fabel).\n\n  * HTML templates: Replace polyfill provider (#9537, @SukkaW).\n    Replace polyfill.io with cdnjs.cloudflare.com/polyfill.\n    polyfill.io has been acquired by Funnull, and the service has\n    become unstable.\n\n  * Korean translations: delete colon in translation for 'to'.\n    This was invalid YAML, and not desired anyway, since a colon\n    is added.\n\n  * Use latest commonmark, commonmark-extensions.\n    This fixes a 3.12 regression in parsing of commonmark/gfm autolinks\n    (jgm/commonmark-hs#151).\n\n  * Depend on djot 0.1.1.3, which fixes a serious parsing bug affecting\n    regular paragraphs after lists.\n\n  * Depend on latest skylighting, skylighting-core, typst-hs, texmath.\n\n  * MANUAL.txt: Change broken link to IDML cookbook (#9563).\n\n## pandoc 3.1.12.2 (2024-02-29)\n\n  * Docx reader:\n\n    + Ensure that table captions are counted (#9518).\n    + Detect caption by style name not id (#9518).\n      The styleId can change depending on the localization.\n    + Avoid emitting empty paragraph where caption was.\n\n  * Markdown reader: fix regression in link parsing with wikilinks extensions\n    (#9481).  This fixes a regression introduced in 3.1.12.\n\n  * Org reader/writer: support admonitions (#9475).\n\n  * Org writer: omit extra blank line at end of quote block.\n\n  * Typst writer: ensure that `-`, `+`, etc. are escaped at beginning of block\n    (#9478). Our recent relaxing of escaping (#9386) caused problems for\n    things like emphasized `-` characters that were rendered using\n    `#strong[-]#`.  This now gets rendered as `#strong[\\-]`.\n\n  * LaTeX writer: fix bug when a language is specified in two different ways\n    (#9472). If you used `lang: de-DE` but then had a span or div with\n    `lang=de`, the preamble would try to load `ngerman` twice, leading\n    to an error. This fix ensures that a language is only loaded once.\n\n  * Docx writer: Don't copy over `footnotePr` in `settings.xml`\n    from reference.docx (#9522).\n\n  * EPUB writer: omit EPUB2-specific meta tag on EPUB3 (#9493).\n    This caused a validation failure in epubs with cover images.\n\n  * Lua: avoid crashing when an error message is not valid UTF-8 (Albert\n    Krewinkel).\n\n  * Text.Pandoc.SelfContained:\n\n    + Add `role=\"img\"` to svgs.\n    + Add `aria-label` to svg elements with `alt` text if present.\n      Screen readers ignore `alt` attributes on svg elements but do\n      pay attention to `aria-label` (#9525).\n\n  * Text.Pandoc.Shared: Fix regression in section numbering in\n    `makeSections` (#9516). Starting with pandoc 3.1.12, unnumbered\n    sections incremented the section number.\n\n  * Text.Pandoc.Class: fix `openUrl` TLS negotiation (#9483).\n    With the release of TLS 2.0.0, the TLS library started requiring\n    Extended Main Secret for the TLS handshake. This caused problems\n    connecting to zotero's server and others that do not support TLS 1.3.\n    This commit relaxes this requirement.\n\n  * Depend on djot 0.1.1.0 (fixes rendering on multiline block attributes).\n\n  * Use new releases of skylighting-format-blaze-html (#9520).\n    Fixes auto-wrapping of long source lines in HTML print media.\n\n  * Use new commonmark-extensions (fixes issue with the\n    `rebase_relative_paths` extension when used with commonmark/gfm.\n\n  * Makefile: improve epub-validation target (#9493).\n    Use `--epub-cover-image` to catch issues that only arise with that.\n\n## pandoc 3.1.12.1 (2024-02-17)\n\n  * EPUB writer: omit EPUBv3-specific accessibility features on epub2\n    (#9469). Fixes a regression in 3.1.12.\n\n  * More fixes for SVG ids with `--self-contained` (#9467).\n    This generalizes the fix to #9420 so it applies to things like\n    `style=\"fill(url(#...\"` and should fix problems with SVGs including\n    gradients.\n\n  * Powerpoint writer: properly handle math in headings and tables (#9465).\n    This ensures that paragraphs containing math are wrapped in\n    a `mc:AlternateContent` node as required.\n\n  * Makefile: make validate-epub check v2 output too.\n\n## pandoc 3.1.12 (2024-02-14)\n\n  * Add `djot` as input and output format. Djot is a light markup syntax\n    (https://djot.net).\n\n    + New module Text.Pandoc.Readers.Djot [API change]. The function\n      `readDjot` is also exported by Text.Pandoc.Readers.\n    + New module Text.Pandoc.Writers.Djot [API change]. The function\n      `writeDjot` is also exported by Text.Pandoc.Writers.\n\n  * `--number-sections` now uses the first digit for the number of\n    the top-level section, no matter what its level. So if the top-level\n    section is level-2, numbers will be `1`, `2`, etc. rather than\n    `0.1`, `0.2`, as in the past (#5071). For some backwards compatibility,\n    we revert to the old behavior when the `--number-offset` option is used.\n\n  * DocBook reader:\n\n    + Better handling of `<procedure>` and `<substeps>` (#9341):\n      `<procedure>` now gets parsed as an ordered list, and\n      `<substeps>` as a sublist.\n\n  * Man reader:\n\n    + Move spaces outside of emph/strong (#9445).\n\n  * MediaWiki reader:\n\n    + Don't make leading blanks underscores in image links (#9425).\n    + Allow lowercase `image:` (#9424).\n\n  * BibTeX reader:\n\n    + Support `pagetotal` in converting BibLaTeX.\n\n  * Markdown reader:\n\n    + Fix wikilinks extensions to allow newlines in titles (#9454).\n\n  * EPUB reader:\n\n    + Don't put `#` characters in identifiers.\n\n  * LaTeX reader:\n\n    + Improve treatment of `\\cref`, `\\Cref` (#7463). Use the\n      reference-type `ref+label` and `ref+Label`. Also, associate with\n      `\\vref` `ref` instead of `ref+page`.\n    + Limited support for `\\Cref` (#7463).\n    + Generate relative widths for `\\linewidth`, `\\textheight` (#9388).\n\n  * Typst reader:\n\n    + Fix handling of `\\overline` (#9294). Due to a typo, it was being\n      incorrectly rendered as an `\\underset`.\n    + Improve handling of inline `#quote` (#9413).\n    + Fix handling of `dot()`, `tilde()`, `ddot()` (jgm/typst-hs#38).\n    + Fix character used for `norm` (jgm/typst-hs#38).\n\n  * Typst writer:\n\n    + Use reference form (e.g. `@jones2000[p. 30]`) for citations when\n      possible.\n    + Use `#ref` or `@` for links with `reference-type=\"ref\"` (#7463).\n      This attribute is added to LaTeX `\\cref`, for example.\n    + Improve citation support (#9452). Emit `form: \"prose\"` or `form: \"year\"`\n      qualifiers if the citation is author-in-text or suppress-author.\n      Strip initial comma from suffix, since typst will add an extra one.\n    + Unescape URI escapes in image paths (#9389).\n    + Handle labels and citaiton ids with spaces and other special\n      characters (#9387). In these cases, we produce an explicit `label()`\n      rather than using `<>` or `@`.\n    + Avoid producing illegal labels (#9387).\n    + Avoid unnecessary escapes (#9386).\n\n  * LaTeX writer:\n\n    + Make writer sensitive to `empty_paragraphs` extension (#9443).\n    + Fix beamer highlighting (mh4ckt3mh4ckt1c4s).\n    + Create valid table even when table is empty (#9350).\n    + Set font fallback for babel main font (Max Heller).\n    + Add some kerns where needed between quotes (#9371).\n\n  * HTML writer:\n\n    + Add suffix to multiple footnote section ids, so they are\n      unique (Sam May). This is necessary when `--reference-location`\n      is `block` or `section`.\n\n  * EPUB writer:\n\n    + Add ARA roles for accessibility (#9378, Iacobus1983).\n      Footnote references are given role \"doc-noteref\", footnote text\n      gets \"doc-footnote\", and nav gets \"doc-toc\".\n    + Ensure that an alt attribute is always added (#9354). This seems to\n      be required by iBooks; even an empty alt attribute will satisfy it.\n    + Add `xml:lang` to package element (#9372).\n    + Add accessibility metadata to EPUB metadata (#9372, #9400,\n      Iacobus1983 and John MacFarlane). Reasonable default values are\n      used to ensure that pandoc's EPUBs conform to the EU Accessibilty Act\n      requirements, but values can be overridden using metadata.\n\n  * Docx writer:\n\n    + Restore ability to center-justify table (#9393). The fix to\n      #5947 caused all tables to be left indented. This was necessary\n      to avoid extra indentation in table cells when a table appeared\n      in a list item. This change makes the changes conditional, so\n      that they only affect tables in list items.\n\n  * Man writer:\n\n    + Fix bug with long URLs (#9458). URLs with more than 68 characters didn't\n      display properly because of wrapping.\n    + Support (limited) syntax highlighting in code blocks (#9446).\n      Currently only boldface and italics are supported. The `monochrome`\n      style might be of use for those generating man pages.\n\n  * Org writer:\n\n    + Escape special lines in code blocks (#9218, Albert Krewinkel).\n\n  * Markdown writer:\n\n    + Use different width fences for nested divs (#9450). Outer divs\n      have longer fences. This aids clarity for the reader, making it\n      easier to see where the div ends. It also makes the output\n      compatible with some other implementations, e.g. micromark,\n      which require different-width fences for nesting.\n    + Fix output for pipe tables with a huge number\n      of columns (#9346). Previously we got invalid pipe tables when the\n      number of table columns exceeded the setting of `--columns`.\n\n  * Powerpoint writer:\n\n    + Fix regression in layout for slides with figures (#9442).\n    + Use internal column widths in pptx writer tables (#5706,\n      Tomas Dahlqvist). The table writer used to only divide all\n      available width evenly for all columns. In this update the code\n      uses the incoming widths if they are available. If they are not\n      set the earlier even distribution is used. Some of the golden\n      templates are adjusted slightly because of different rounding when\n      using the new calculation model.\n\n  * Custom writers:\n\n    + Fix handling of common state (#9229, Albert Krewinkel).\n      The CommonState (`PANDOC_STATE` in Lua) may change between the time that\n      a custom writer script is first loaded and when the writer is run.\n      However, the writer was always using the initial state, which led to\n      problems, e.g. when the mediabag was updated in a filter, as those\n      updates where not visible to the writer. The state is now updated\n      right before the writer function runs.\n\n  * Text.Pandoc.SelfContained:\n\n    + Fix id replacements in SVGs with clipping paths (#9420).\n      This fixes `--embed-resources` when SVGs have `clip-path` attributes.\n    + Fix size of duplicated SVGs with `--embed-resources` (#9439).\n\n  * ConTeXt template: support font fallback (#9361, Lawrence Chonavel).\n\n  * Text.Pandoc.Shared:\n\n    + `addPandocAttributes`: use `wrapper` attribute, not `wrap`, for\n      Divs and Spans added as wrappers to hold attributes on elements\n      that do not accept them.\n    + `makeSections` behavior changes:\n      - When the optional base level parameter is provided, we no\n        longer ensure that the sequence of heading levels is gapless\n        (#9398). Instead, we set the lowest heading level to\n        the specified base level, and adjust the others accordingly. If\n        an author wants to skip a level, e.g. from level 1 to level 3,\n        they can do that. In general, the heading levels specified\n        in the source document are preserved; `makeSections` only\n        puts them into a hierarchical structure.\n      - Section numbers are now assigned differently, as described above\n        under `--number-sections` changes (#5071).\n    + Improve `makeSections` code for section number calculation.\n\n  * Text.Pandoc.Chunks:\n\n    + Autogenerate unique ids for sections missing them (#9383).\n      This is needed for TOC generation to work properly. We can't\n      create TOC links if there are no ids. This fixes some EPUB validation\n      issues we've been getting since switching over to Chunks for chunking.\n    + Improve `fixTOCTreePaths`. We weren't adding ids for section headings\n      that don't head a chunk, but these headings are needed for a TOC.\n\n  * Lua: catch encoding error in `pandoc.read` (#9385, Albert Krewinkel).\n    Fixed a bug that could lead to an un-catchable error and program\n    termination when `pandoc.read` was called with invalid UTF-8 input.\n\n  * LaTeX template: support font fallback (lawcho).  This support is\n    LuaLaTeX-specific.  See MANUAL.txt for documentation.\n\n  * Text.Pandoc.Readers: Add `readMan` to exports [API change] (George Stagg).\n\n  * Text.Pandoc.PDF:\n\n    + Reliably detect when TOC has changed (#9295). Sometimes the TOC\n      changes but there are no warnings: this happens when no labels\n      are present. In this case we must rerun LaTeX. So we now take the\n      SHA1 hash of the TOC file and rerun LaTeX if it changes between runs.\n    + Increase maximum number of LaTeX runs to 4 (#9299). On some documents,\n      4 runs are needed (e.g. when a LastPage reference is used).\n    + Avoid `readFileLazy`, which caused improperly cleaned-up\n      temp directories on Windows (#9460).\n\n  * MANUAL.txt:\n\n    + Harmonize spelling of Markdown and MultiMarkdown (#9402, Salim B).\n    + Add `<pre>` to list of exceptions for `markdown_in_html_blocks`\n      extension (#9305).\n    + Add clarification to docs for `--resource-path` (#9417).\n\n  * Makefile: Validate generated EPUB as part of prerelease checks.\n\n  * Add validation for docx golden files to CI (Edwin Török).\n\n## pandoc 3.1.11.1 (2024-01-05)\n\n  * Docx reader:\n\n    + Fix HYPERLINK with only switch and no argument (#9246).\n\n  * Org reader:\n\n    + Parse caption and label for grid tables (#9279).\n\n  * MediaWiki reader:\n\n    + Handle multiline math in list items (#9293).\n\n  * OPML writer:\n\n    + Respect `--wrap` options & `--columns` in contents of notes (#9297).\n\n  * ODT/OpenDocument writers:\n\n    + Properly handle highlighting styles (#9287). These styles were\n      going into an `office:styles` element in `content.xml`, but this\n      is invalid. Instead they must go in `styles.xml`. The variable\n      `highlighting-styles` no longer has any effect on the default\n      opendocument template, and highlighting styles are not included\n      in `opendocument` output.\n\n  * Markdown writer:\n\n    + Add table identifier at end of caption if present (#9279).\n\n  * Text.Pandoc.PDF:\n\n    + Expand list of environment variables to display in verbose output\n      (#9303).\n    + Ensure that we find all the LaTeX warnings requiring a rerun (#9284).\n      This should fix a regression from 3.1.9 that led to incorrect\n      alignments in tables (and possibly other issues).\n\n  * Docx writer:\n\n    + Ensure that pandoc's output validates (Edwin Török, #9273, #9269,\n      John MacFarlane, #9265, #9266, #9264).\n    + Don't emit empty table rows, which seem to cause problems for\n      Word (#9224).\n\n  * LaTeX writer:\n\n    + Omit superfluous page locator label when used with `--natbib` or\n      `--biblatex` (#9275). These will treat a bare number as a\n      page locator, and they will be able to localize it. Note that the\n      recognition of the locator label is locale-sensitive; if `lang` is\n      `de`, then `S. 33` is a page reference, and `p. 33` is not!\n\n  * Text.Pandoc.Chunks: Fine tune `makeChunks` (#9281).\n\n    + Ensure that chunks not based on sections (those with the\n      \"preamble\" class) get unique identifiers, by appending chunk number.\n    + This will also ensure that they get unique path names when\n      the path is generated from the identifier.\n\n  * Default HTML5 template: remove html5shiv (and support for IE < 9).\n\n  * Makefile:\n\n    + Fix `make quick-stack`: `j` was expecting a number (Edwin Török).\n    + Run built pandoc (instead of pandoc in path).\n    + Add `validate-epub` target, using `epubcheck` to test the golden files.\n    + Add `validate-docx-golden-tests` target.\n\n## pandoc 3.1.11 (2023-12-15)\n\n  * Typst writer:\n\n    + Emit `;` after typst code, unless followed by space (#9252).\n      Otherwise there's the potential that the typst code will swallow\n      up a following character.\n\n  * Text.Pandoc.Logging:\n\n    + Add `MakePDFWarning` constructor to LogMessage [API change].\n    + Add `MakePDFInfo` constructor to LogMessage [API change].\n\n  * Text.Pandoc.PDF:\n\n    + LaTeX warnings are passed on to the user as warnings.\n    + Use `report` with `MakePDFWarning` and `MakePDFInfo` to relay\n      verbose information and warnings, instead of writing directly\n      to stderr.\n    + Parse logs to determine whether additional runs needed, instead of\n      running a fixed number of times (#9255). (The number of times\n      that was appropriate given pandoc's default templates didn't\n      always work for custom templates, and thus pandoc 3.1.10's\n      change in the number of runs led to some regressions in PDF\n      production.)\n\n  * Makefile: in `make prelease`, add checks that pandoc-cli and\n    pandoc have the same version, that pandoc-cli depends on this\n    exact version of pandoc, that there is an entry for this version\n    in the changelog, and that the version numbers in the\n    generated man pages are correct.\n\n  * Regenerate man pages with pandoc 3.1.10. This properly escapes hyphens\n    and fixes version numbers in man pages for `pandoc-server` and\n    `pandoc-lua`.\n\n  * Depend on texmath 0.12.8.6. This omits unneeded `lr`s in typst\n    math output.\n\n  * Depend on typst 0.5. This allows the typst reader to support\n    multiline strings, the version type, and the `as`\n    keyword with `import`.\n\n## pandoc 3.1.10 (2023-12-12)\n\n  * Link pandoc-cli version to pandoc version. Henceforth pandoc-cli's\n    version will be synchronized with pandoc's, and pandoc-cli will\n    depend on an exact pandoc version. This will avoid confusion by\n    ensuring that `cabal install pandoc-cli-X.Y.Z` installs pandoc\n    version X.Y.Z. It will make things more straightforward for\n    upstream packagers (see #9232). This scheme does not follow the\n    Haskell PVP, but that should cause no harm, because this package\n    does not expose a library.\n\n  * Add `alerts` markdown extension. This enables GitHub style markdown\n    alerts as a commonmark extension. This extension is now default for\n    `gfm`. It can't be used with `markdown`, only with `commonmark` and\n    variants.\n\n  * Markdown reader:\n\n    + Preserve newlines in math instead of changing to spaces.\n      Otherwise we can get unwanted results if there's\n      a `%` comment (#9193).\n    + Make attributes work with reference links (#9171).\n\n  * HTML reader:\n\n    + Improve handling of invalidly nested sublists (#9187, cf. #8150).\n\n  * MediaWiki reader:\n\n    + Allow attribute keys with hyphens (#9178).\n\n  * ODT reader:\n\n    + Support attr `text:continue-numbering` (#8979, Stephan Meijer).\n\n  * Typst reader:\n\n    + Allow references (e.g. `@foo`) to become citations\n      if there is no corresponding label in the document.\n    + Collapse adjacent `cite` elements.\n    + Handle supplements in `cite`.\n    + Change `cite` (only one key allowed, a label) (typst 0.9 breaking change).\n    + Support `quote` element (typst 0.9).\n\n  * LaTeX reader:\n\n    + Handle otherlanguage environment and language-name environments like\n    `\\begin{french}...\\end{french}` (#9202).\n    + Fix theorem label parsing (#8872, Hikaru Ibayashi).\n\n  * Docx reader:\n\n    + Unwrap content of shaped textboxes (Stephan Meijer, #9214).\n    + Improve handling of `w:sym` (#9220). We now look up symbols in symbol\n      fonts using the table defined at Text.Pandoc.Readers.Docx.Symbols.\n    + Add unexported module Text.Pandoc.Readers.Docx.Symbols. This gives us a\n      table to use to resolve characters included in docx via `w:sym` element.\n\n  * Man reader:\n\n    + Properly handle `.sp` macro inside lists and block quotes (#9201).\n\n  * LaTeX writer:\n\n    + Fix bug with big footnotes inside emphasis (#8982, Hikaru Ibayashi).\n    + Handle identifiers inside heading contents. `\\phantomsection` can't\n      be used in this case, so we need `\\hypertarget` (#9209).\n\n  * LaTeX template:\n\n    + Include `bookmark` package unconditionally. This package\n      produces better PDF bookmarks than `hyperref` and does it on the\n      first pass.\n\n  * Typst writer:\n\n    + Use `quote` for block quotes.\n    + Support `--toc-depth` as in other writers (#9242).\n    + Put inline image dimensions on enclosing box, not image (#9104).\n    + Better handling of tables with captions (#9194).\n      We now put these in a figure with a caption argument.\n    + Update typst writer to typst 0.9 citation format (#9188).\n\n  * Typst template:\n\n    + Remove custom definition of `blockquote` in default template.\n      (We now use built-in `quote`.)\n    + Support table of contents.\n    + Support csl (#9186, Ian Max Andolina). Typst now supports CSL for its\n      native citation engine, so pandoc should use a specified `csl`\n      style in the template, falling back to `bibliographystyle` if\n      `csl` is not specified.\n\n  * Docx writer:\n\n    + Use different style for block quotes in notes (#9243).\n      Using \"Footnote Block Text\" for the style name, so it can be\n      given a different font size if footnotes are.\n    + Allow embedded fonts to be used in reference.docx (#6728).\n\n  * HTML5 writer:\n\n    + To conform to validator's expectations, `doc-footnote` role is used\n      with `aside` and `doc-endnotes` with `section`.\n    + `aside` is used only for notes at ends of sections or blocks;\n      if all the notes come at the end of the document, `section` is\n      used so we can have the `doc-endnotes` role.\n\n  * JATS writer:\n\n    + Handle case where there is material after refs div (#9166). Previously in\n      such cases the references were not being moved to back matter.\n\n  * Ms writer:\n\n    + Don't do normal escapes in filename arguments for PSPIC etc.\n\n  * T.P.RoffChar: escape `-` as `\\-`. The `groff_man (7)` man page indicates\n    that `-` characters will be treated as typographic hyphens and are not\n    appropriate for cases where the output should be copy-pasteable as an\n    ASCII hyphen-minus character.  (E.g. in command line options.)\n    However, until a recent update groff man did not actually do this;\n    it treated `-` and `\\-` the same.  With the new update (1.23.0)\n    the two are distinguished (see https://lwn.net/Articles/947941/\n    for background), so now it is important that pandoc escape `-`.\n\n  * Text.Pandoc.Extension: add `Ext_alerts` constructor [API change].\n\n  * Text.Pandoc.PDF: We now default to running LaTeX only\n    once in producing a PDF (instead of twice). This is made possible by the\n    shift to the `bookmark` package, which does not require a second pass for\n    PDF bookmarks. If a table of contents is present, we still have to run\n    three times to get the page numbers, and if beamer is used we still do a\n    minimum of two runs.\n\n  * Text.Pandoc.Shared:\n\n    + `renderTags'`: use minimized tag for `rect`.\n    + Allow svg `path` element to be minimized.\n    + Export `combineAttr` [API change].\n    + Improve `isTightList` so that it recognizes an item containing only a list\n      which is itself tight as potentially an item in a tight list (#9161).\n\n  * Text.Pandoc.MIME: Ensure we use `.svg` not `.svgz` as extension\n    for `image/svg+xml` mime type. This fixes issues with embedded\n    SVG images in docx output, among other things (#9195).\n\n  * Text.Pandoc.Class: `openURL` improvements for data uris.\n    Only treat data URI as `base64` if ';base64' is specified.\n    Otherwise treat as UTF-8 (not 100% reliable but should cover most\n    other cases). Strip off `;base64` (or `;charset=...` or whatever)\n    from mime type (#9195).\n\n  * Text.Pandoc.SelfContained: Improve treatment of embedded SVGs\n    (#9206, #8948).\n\n    + Ensure unique ids for elements by prefixing SVG id.\n    + Ensure SVG `id` attribute except when `use` element is used.\n    + Remove `width`, `height` attributes from svg element when `use`\n      element is used. Instead, add `width` and `height` 100% to the\n      `use` element. This seems to get the sizing right.\n\n  * Text.Pandoc.Citeproc: Don't link citations if\n    `suppress-bibliography` specified, for there will be nothing to\n    link to (#9163).\n\n  * epub.css: add styling for sup and sub (#9160).\n\n  * Switch from `base64` to `base64-bytestring` (#9233).\n\n  * Use newest versions of commonmark, commonmark-extensions,\n    commonmark-pandoc, texmath, typst, skylighting, skylighting-core.\n\n  * Benchmark: use standalone documents for reader tests.\n    Otherwise typst reader benchmark fails. Note: this means that we are now\n    parsing longer documents, so bench results on readers won't be comparable\n    to before.\n\n  * MANUAL.txt: update defaults file docs for bibliography fields (#9173).\n    Recommend using top-level `bibliography` `csl`, etc. instead\n    of a nested `metadata` field. Reason: `${USERDATA}` and `${HOME}`\n    are only expanded in these contexts, not in `metadata`.\n\n  * Move man pages to pandoc-cli package (#9245).\n\n## pandoc 3.1.9 (2023-10-27)\n\n  * Make `reference-section-title` work with `jats+element_citations`\n    (#9021).\n\n  * Add `bits` as synonym of `jats` as input format.\n\n  * JATS reader:\n\n    + Modify JATS reader to handle BITS too (#9138, Julia Diaz).\n      Add provision for title-group, book, book-part-wrapper, book-meta,\n      book-part-meta, book-title, book-title-group, index, toc, legend,\n      title, collection-meta\n    + Fix handling of alt-text (#9130, Julia Diaz). Previously we were\n      looking for an attribute that doesn't exist in JATS; alt-text is\n      provided by a child element.\n\n  * CommonMark reader:\n\n    + Handle `Ext_tex_math_gfm` (#9121). Parse GFM-specific math\n      constructions when `tex_math_gfm` enabled.\n\n  * DokuWiki reader:\n\n    + Allow autolinks to be avoided using e.g. `https:%%//%%...` (#9153).\n    + Parse `<code>` and `<file>` as block-level code (#9154).\n      Previously we treated them as inline code in some contexts,\n      but that is not how DokuWiki works.\n\n  * LaTeX reader:\n\n    + Better handle spacing commands `\\hfill`, `\\vfill`, `\\hskip`,\n      `\\vskip`, etc. (#9150).\n    + Fix incorrect abbreviation for astronomical unit (#9125,\n      Michael McClurg).\n\n  * Markdown reader:\n\n    + Fix blindspot with superscript in links (#8981).\n      Previously `[^super^](#ref)` wasn't parsed as a link, due to\n      code that was meant to prevent footnote markers from being\n      recognized as reference links.  This commit tightens up that\n      code to avoid this bad effect. We have also added a new\n      restriction on footnote labels: they cannot contain the characters\n      `^`, `[`, or `]`. Though this is technically a breaking change, we\n      suspect that the impact will be minimal, as it's very unlikely\n      people would be using these characters in their note labels.\n    + Don't apply `--default-image-extension` to data URIs (#9118).\n    + More accurate check that a normalCite is not a link,\n      bracketed span, or reference (#9080).\n\n  * HTML reader:\n\n    + Allow th to close td and vice versa (#9090).\n    + Parse task lists using input elements (#9047, Seth Speaks).\n\n  * Creole reader:\n\n    + Handle empty cells correctly (#9141, Sascha Wilde).\n\n  * Org writer:\n\n    + Escape literal `*`, `|`, `#` at beginning of line with ZWS (#9159).\n\n  * ICML writer:\n\n    + Prevent doubled attributes (#9158).\n\n  * Powerpoint writer:\n\n    + Fix a corruption error caused when the document used both a\n      regular png and a png in a data URI (#9113). (Similarly for any\n      other image format.) The problem was that duplicate entries in\n      `[Content Types].xml` were being created, one for the mime type\n      `image/png`, one for `image/png;base64`.\n\n  * LaTeX writer:\n\n    + Fix rowspans in tables so they use the width of\n      the column (`=` as the width parameter) (#9140).\n    + Don't treat table as \"simple\" if they have col widths.\n      This should help fix a problem wherein some grid tables with\n      colspans were overly wide (#9140).\n    + Fix uneven indents in line block output (#9088).\n\n  * JATS writer: fix 3.1.4 regression in handling block-level metadata\n    (#9092).\n\n  * Ms writer: improvements in image handling (#4475).\n\n    + PDFPIC is now used for PDF images in figures.\n    + Inline images that are postscript or PDF are rendered using\n      PSPIC or PDFPIC. This isn't ideal, because they will still be\n      rendered as if in a separate paragraph, but it's probably\n      better than just printing the image name.\n    + Units are included in height.\n\n  * HTML writer:\n\n    + If raw format is an HTML side deck format, emit it (James J Balamuta).\n\n  * Typst writer:\n\n    + Add `#box` around image to make it inline. (#9104)\n      An `#image` by itself in typst is a block-level element.\n      To force images to be inline (as they are in pandoc), we need\n      to add a box with an explicit width. When a width is not given\n      in image attributes, we compute one from the image itself, when\n      possible.\n    + Don't allow long heading to wrap (#9132).\n    + Escape `(` (#9137). If unescaped `(` occurs in\n      certain contexts, it can be parsed as function application.\n\n  * Man writer:\n\n    + Fix some spacing issues around links (#9120).\n      We need to use `\\c` before a `.UR` or `.MT`, to avoid\n      an extra space, and also after.  To ensure that a space\n      at the beginning of the following line doesn't get swallowed\n      up, we escape it with `\\`.\n    + Use UR, MT macros for URLs, emails (#9120).\n\n  * Text.Pandoc.Extensions:\n\n    + Add `Ext_tex_math_gfm` constructor to Extension (#9121).\n      [API change]. This handles two GitHub-specific syntaxes for math.\n      This is now default for `gfm`, in addition to `tex_math_dollars`.\n    + Remove duplicates for `Ext_raw_html` and `Ext_pipe_tables`\n      in some of the lists (Tim Stewart).\n\n  * Text.Pandoc.Metadata: Add helpful message on some metadata\n    YAML errors (#9155).\n\n  * Text.Pandoc.Shared:\n\n    + `splitSentences`: don't split after initials.\n      This improves the man and ms writer output, preventing\n      sentence breaks after initials.\n    + Add `addPandocAttributes` function [API change].\n      This is meant to simplify addition of attributes to Pandoc\n      elements: for elements that don't have a slot for attributes, an\n      enclosing Div or Span is added to hold the attributes.\n\n  * MANUAL.txt:\n\n    + Clarify that formatting can't cross line boundaries\n      in line blocks (#9119).\n    + Fix legacy option for citation (#8737, 3w36zj6)\n\n  * Update `et` translations (priiduonu).\n\n  * Updated `no` translations (Stephan Daus).\n    Renamed no.yaml (macrolanguage Norwegian) to nb.yaml (Norwegian Bokmål).\n    Created soft symbolic link from no.yaml pointing to nb.yaml.\n\n  * Lua subsystem: Use the newest LPeg version (lpeg-1.1.*) (#9107,\n    Albert Krewinkel).\n\n  * Default `epub.css`: Apply style to h6, format styles, and\n    combine identical styles under shared selectors (samuel-weinhardt).\n\n  * Update nix flake with dependencies (piq9117).\n\n  * LaTeX template: fix `\\CSLBlock` vertical space (John Purnell).\n\n  * Allow tasty 1.5 and Diff 0.5.\n\n  * Require commonmark-extensions 0.2.4, commonmark 0.2.4.\n\n  * Require texmath 0.12.8.4. This should improve math in\n    powerpoint, fixing empty boxes around roots in some cases.\n\n  * Require typst 0.3.2.1\n\n## pandoc 3.1.8 (2023-09-08)\n\n  * JATS reader:\n\n    + Ignore `<processing-meta>` element (#9057, Julia Diaz).\n    + Fix conversion of date to ISO 8601 format (#8865).\n\n  * LaTeX template:\n\n    + Add code allow `\\cite` to break across lines (#9050).\n    + Fix regression with CSL `display=\"block\"` (#7363).\n      This restores the line break before the block.\n    + Rewrite `CSLReferences` environment to avoid depending on\n      `enumitem`, which plays badly with beamer.  Instead we use\n      a regular list environment. Thanks to @jpcirrus for the\n      concept (#9053).\n    + Restore the pre-3.1.7 format of the `CSLReferences`\n      environment, which again has two parameters. The first\n      determines whether a hanging indent is used (1 = yes, 0 = no),\n      and the second is the entry line spacing (0 = none).\n    + Add a strut to avoid inconsistencies in spacing (#9058).\n    - Remove a break at the end of `CSLRightInline` to avoid\n      inconsistencies in spacing. It shouldn't be necessary\n      because the paragraph should extend to the right margin (#9058).\n\n  * LaTeX writer:\n\n    + Fix regression with figure labels (#9045). In 3.1.7, pandoc\n      added two labels to LaTeX figure environments, one with a\n      phantomsection.\n    + Fix default citeproc entry-spacing. According to the CSL manual,\n      the default entry spacing is 1. We were treating it as 0 (#9058).\n\n  * HTML writer:\n\n    + Use the ID prefix in the ID for the footnotes section (#9044,\n      Benjamin Esham).\n    + Fix CSL entry-spacing default (#9058).\n\n  * Text.Pandoc.Citeproc:  always include an `entry-spacing` attribute\n    in the Div if the bibliography element contains an entry-spacing\n    attribute (previously we omitted it when it was 0) (#9058).\n\n  * Clean up pandoc's own man pages by regenerating with pandoc 3.1.7.\n\n  * pandoc-lua-engine: bump lower bound for pandoc (#9046).\n\n  * Depend on texmath 0.12.8.2, fixing binom in typst writer (#9063).\n\n## pandoc 3.1.7 (2023-08-31)\n\n  * Org reader:\n\n    + Don't parse alphabetical lists unless the `fancy_lists` extension is\n      enabled (#9042).\n    + Allow escaping commas in macro arguments (Amneesh Singh).\n\n  * JATS reader:\n\n    + Support for `<permissions>` metadata (#9037, Julia Diaz).\n      metadata objects with multiple fields are created, matching the\n      structure in JATS.\n    + Correct name of JATS element `attrib`.\n\n  * Markdown reader:\n\n    + Support images with wikilink syntax, e.g. `![[foo|bar]]`, when\n      one of the `wikilinks` extension is enabled (#8853).\n    + Allow a citation or reference link to be parsed after a `!` (#8254).\n    + Fix dropped `!` before nonexistent reference (#9038).\n\n  * LaTeX writer:\n\n    + Fix regression in escaping URLs (#9043).\n    + Use `\\cite` and `\\bibitem` to link up citations, even with citeproc.\n      (#9031). This will give us better accessibility; when tagging is\n      enabled, the citation can be linked to the bibliography entry.\n      This changes some of the details of the layout and the default\n      template. We now make `CSLReferences` a special enumitem list\n      that will contain `\\bibitem`s. Internal links inside citations to\n      ids beginning in `ref-` are creating using `\\cite` instead of\n      `\\hyperref`.\n    + Use `\\phantomsection` and `\\label` instead of `\\hypertarget` (#9022).\n    + Use `\\hyperref` for LaTeX internal links, `\\hyperlink` for\n      beamer (since `\\hyperref` doesn't seem to work) (#9022).\n    + Backslash-escape `%` and `#` in URLs (#9014).\n\n  * JATS writer:\n\n    + Fix placement of ref-list when no title is specified for the\n      reference section (#9017). (In this case we place it in `back`\n      with an empty title.)\n\n  * Man writer:\n\n    + Avoid a `.PP` right after a section heading (#9020).\n      This is at best a no-op (in groff man and mandoc) and at worst\n      (in some formatters) may create extra whitespace.\n    + We revert the fanciness introduced in #7506, which employs a\n      custom font name `V` and a macro that makes this act like boldface\n      in a terminal and monospace in other formats.  Unfortunately,\n      this code uses a mechanism that is not portable (and does not\n      work in mandoc) (#9020).\n    + Instead of using `V` for inline code, we simply use `CR`.\n      Note that `\\f[CR]` is emitted instead of plain `\\f[C]`,\n      because there is no `C` font in man.  (This produces warnings\n      in recent versions of groff, #9020.)\n    + For code blocks, we now use the `.EX` and `.EE` macros,\n      together with `.IP` for spacing and indentation.  This gives\n      more standard code that can be better interpreted e.g. by mandoc\n      (#9020).\n\n  * Man template: don't emit `.hy`, regardless of setting of\n    `hyphenate` variable (#9020).\n\n  * LaTeX template: special redefinition of `\\st` for CJK (#9019).\n    soul's version raises on error on CJK text.\n\n  * Use latest skylighting-format-blaze-html (#7248).\n    This works around a longstanding iOS Safari bug that caused long\n    lines to be displayed in a different font size in highlighted code.\n\n  * Allow skylighting 0.14 (and require it in pandoc core).\n\n  * Allow text 2.1.\n\n## pandoc 3.1.6.2 (2023-08-22)\n\n  * Org reader: allow example lines to end immediately after the colon\n    (Brian Leung).\n\n  * Docx reader:\n\n    + Omit \"Table NN\" from caption (#9002).\n    + Avoid spurious block quotes in list items (#8836).\n\n  * JATS reader: Fix display of block elements (#8889, Julia Diaz).\n    A number of block elements, like disp-quote, list, and disp-formula, were\n    always treated as inlines if appearing inside paragraphs, even if their\n    usage granted a separate block.\n\n  * HTML reader: avoid duplicate id on header and div (#8991).\n\n  * Typst writer:\n\n    + Use `~` for nonbreaking space, and escape literal `~` (#9010).\n    + Put the label in right place for Div, use `#block` (#8991).\n      Previously we were putting the label at the beginning of\n      the Div's contents, but according to the documentation such a\n      label gets attached to the *preceding* element.  We now use an\n      explicit `#block` and add the label at the end.\n\n  * LaTeX writer:\n\n    + Improve escaping of URIs in href, url (#8992).\n    + Improve internal links and targets (#8744). We no longer\n      wrap section headings in a `\\hypertarget`. This is unnecessary\n      (hyperref creates an anchor based on the label) and it interferes with\n      tagging. In addition, we now use `\\hyperref` rather than `\\hyperlink`\n      for internal links. Currently `\\hypertarget` is still being used for\n      link anchors not on headings. Thanks to @u-fischer.\n\n  * HTML format templates (style.html): Fix typo in clause for svg\n    (Jackson Schuster).\n\n  * Use lastest texmath, typst-symbols, typst. Targets typst 0.7.\n\n\n## pandoc 3.1.6.1 (2023-08-11)\n\n * HTML reader: properly calculate RowHeadColumns (#8984). This fixes a\n   bug in the calculation of the number of header columns in table row.\n   It also changes the algorithm for determining the table body's\n   RowHeadColumns based on the numbers of head columns in each row.\n   Previously we used the max, and #8634 switched to the min, which\n   led to bad results. Now we only set RowHeadColumns to a non-zero value\n   if *all* rows have the same number of head columns.\n\n  * OpenDocument writer:\n\n    + Implement syntax highlighting for inline and block code (#6710).\n    + Support highlighted text in ODT/OpenDocument writers for Span\n      with class `mark` (#8960). The color can be adjusted by\n      modifying the Highlighted style.\n\n  * Typst writer: escape `//` so it doesn't get interpreted as a comment\n    (#8966).\n\n  * ChunkedHTML writer: Fix regression including MathJax script (#8967).\n    The fix for #8620 caused the script to be included when the table of\n    contents but not the body text of a page contains math.  But it broke the\n    case where the table of contents doesn't contain math but the page does.\n    This patch fixes the issue.\n\n  * Text.Pandoc.SelfContained:\n\n    + Retain attributes in SVG tag when referring to another\n      SVG's content using `<use>` (#8969).\n    + Allow units in width and height for SVG. Units are optional but allowed.\n    + Don't coerce calculated SVG dimensions to Int.\n    + fix calculation of SVG width and height. We were computing width and\n      height from viewBox incorrectly (#8969).\n    + Add clause for SVG to default CSS for HTML (#8969).\n    + Ensure that width and height attributes don't get specified\n      twice is both the img tag and the svg include them (#8965).\n    + Omit unnecessary attributes xmlns, xmlns:xlink, and version on\n      SVG element (#8965).\n    + Use 20 character rather than 40 character hashes for generated IDs\n      (#8965).\n\n  * Use pandoc-types 1.23.1. This fixes a regression with toJSONFilter (#8976),\n    which in 1.23.0.1 no longer worked on pure values of type `a -> [a]`.\n\n  * Use ghc 9.6 for release builds (#8947).\n\n  * Fix some links in FAQs (Diogo Almiro).\n\n\n## pandoc 3.1.6 (2023-07-20)\n\n  * Fix CVE-2023-38745, a variant of the vulnerability in CVE-2023-35936.\n    Guilhem Moulin noticed that the fix to CVE-2023-35936 was incomplete.\n    An attacker could get around it by double-encoding the malicious\n    extension to create or override arbitrary files.\n\n  * `--embed-resources`: Use inline SVG instead of data uris for SVG\n    images in HTML5 (#8948). Note that SelfContained does not have\n    access to the writer name, so we check for HTML5 by determining\n    whether the document starts with `<DOCTYPE! html>`. This means\n    that inline SVG won't be used when generating document fragments.\n\n  * Fix regression on short boolean arguments (#8956).\n    In 3.1.5 boolean arguments were allowed an optional argument\n    (`true|false`).  This created a regression for uses of fused\n    short arguments, e.g. `-somyfile.html`, which was equivalent\n    to `-s -omyfile.html`, but now raised an error because\n    pandoc attempted to parse `o` as a boolean `true` or `false`.\n    This change allows the fused short arguments to be used again.\n    Note that `-strue` will be interpreted as `-s` with an\n    argument `true`, not as `-s -t -rue`.  It is best to\n    use long option names with the optional boolean values,\n    to avoid confusion.\n\n  * Make `--epub-title-page`'s argument optional. It takes a boolean\n    argument, and now that all of our boolean flags take such an\n    argument, we can make this one optional for consistency.\n\n  * Improve errors for illegal output formats. Previously if you did\n    `pandoc -s -t bbb`, it would give you an error about the missing\n    `bbb` template instead of saying that `bbb` is not a\n    supported output format.\n\n  * Improve errors for incorrect command-line option values (#8879).\n    Always give the name of the relevant argument.\n\n  * Fix typo on error message for incorrect `--preserve-tabs` argument.\n    Thanks @fsoedjede\n\n  * Docx reader: use SVG version of image if present (#7244).\n    Previously the backup PNG was exported even if an SVG was\n    present, but the SVG should be preferred.\n\n  * Typst reader: fix regression in recognition of display math (#8949).\n    The last release caused all math to be parsed as inline math.\n\n  * JATS writer: don't use `<code>` for inline code (#8889).\n    It is intended for block-level code.\n\n  * HTML writer: don't make line blocks sensitive to `--wrap` (#8952).\n\n  * RST writer: fix figure handling (#8930, #8871).\n    This fixes a number of regressions from pandoc 2.x.\n    Properly handle caption, alt attribute in figures.\n    No longer treat a paragraph with a single image in it as a figure\n    (we have a dedicated Figure element now).\n\n  * Docx writer: Copy \"mirror margins\" property from reference.docx (#8946).\n\n  * Text.Pandoc.UTF8: Deprecate `decodeArg` which is now a no-op.\n    This was needed for old base versions which we no longer support.\n\n  * Use released skylighting, typst.\n\n  * Allow latest commonmark-extensions. This allows entities in wikilinks.\n\n  * Switch back to using ghc 9.2 for linux and Windows binary releases\n    (#8947, #8955). With ghc 9.4+, we were getting AVX instructions\n    in the amd64 binary, which aren't supported on older hardware.\n    For maximum compatibility we switch back to ghc 9.2, which doesn't\n    cause the problem. (As documented, ghc should not be emitting these\n    instructions, so we aren't clear on the diagnosis, but the cure\n    has been tested.)\n\n  * Change Windows release build to use cabal instead of stack.\n\n## pandoc 3.1.5 (2023-07-07)\n\n  * Allow all boolean flags to take an optional `true` or `false` value\n    (#8788, Sam S. Almahri). The default is true if no value is specified,\n    so this is fully backwards-compatible.\n\n  * Support `--id-prefix` for markdown output (#8878)\n\n  * Markdown reader:\n\n    + Add strictness annotations to fix a memory leak (#8762).\n\n  * Typst reader:\n\n    + Use typst-hs 0.3.0.0, which is more robust, fixes many bugs, and\n      targets typst 0.6.\n    + Package loading is now supported, as long as the package has been\n      cached or is local.\n    + Rewrite Typst reader in a way that makes it easier to extend.\n    + Filter out CR in raw.\n    + Handle block content for link element.\n    + Handle block-level content in text element.\n    + Handle style, align, place in inline contexts too.\n    + Improve info message for skipped elements.\n\n  * Add typst reader tests (#8942).\n\n  * MediaWiki reader:\n\n    + Revise treatment of \"link trail.\" Previously we only included ASCII\n      letters. That is correct for English but not for, e.g., Spanish (see\n      comment in #8525). A safer approach is to include all letters except\n      those in the CJK unified ideograph ranges.\n\n  * AsciiDoc writer:\n\n    + Make modern AsciiDoc the target for `asciidoc` (#8936).\n      The AsciiDoc community now regards the dialect parsed by `asciidoctor`\n      as the official AsciiDoc syntax, so it should be the target of our\n      `asciidoc` format. The `asciidoc` output format now behaves like\n      `asciidoctor` used to. `asciidoctor` is a deprecated synonym. For\n      the old `asciidoc` behavior (targeting the Python script),\n      use `asciidoc_legacy`. The templates have been consolidated. Instead of\n      separate `default.asciidoctor` and `default.asciidoc` templates, there\n      is just `default.asciidoc`.\n    + Text.Pandoc.Writers.AsciiDoc API changes:\n      - `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to.\n      - `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`.\n      - New exported function `writeAsciiDocLegacy` behaves like\n        `writeAsciDoc` used to.\n    + Update line-through for asciidoc writer to custom inline style (#8933,\n      Kevin Broch).\n\n  * Typst writer:\n\n    + Support `unlisted` class in headings (#8941).\n    + Consolidate bibliography files into one `#bibliography` command (#8937).\n    + Improve handling of autolinks (#8931).\n\n  * Docx writer:\n\n    + Make relative widths work in tables. This didn't work before because we\n      were missing an attribute that tells Word to used fixed widths rather\n      than computing optimal ones.\n\n  * DokuWiki writer: fix lists with Div elements (#8920).\n    The DokuWiki writer doesn't render Divs specially, so their presence in\n    a list (e.g. because of custom-styles) need not prevent a regular\n    DokuWiki list from being used. (Falling back to raw HTML in this case is\n    pointless because no new information is given.)\n\n  * LaTeX writer:\n\n    + Fix babel name for `fa` (should be `persian`).\n    + Prevent babel language from being imported twice (#8925).\n\n  * Text.Pandoc.Class:\n\n    + Add `toTextM` [API change]. This is like `Text.Pandoc.UTF8.toText`,\n      except:\n\n      - it takes a file path as first argument, in addition to\n        bytestring contents\n      - it raises an informative error with source position if\n        the contents are not UTF8-encoded\n\n    This replaces `utf8ToText` whenever we have the filename and are\n    in a PandocMonad instance. This will lead to more informative error\n    messages for UTF8-encoding, indicating the file path and byte offset\n    where the error occurs (#8884).\n\n  * Remove invalid term \"Subject\" from Turkish translations (#8921).\n\n  * stack.yaml: add pkg-config to nix packages (#8927, pacien).\n\n  * Allow aeson 2.2.\n\n  * MANUAL: Add clarification on --section-divs. Closes #8882.\n\n\n## pandoc 3.1.4 (2023-06-24)\n\n  * Fix a security vulnerability in MediaBag and T.P.Class.IO.writeMedia.\n    This vulnerability, discovered by Entroy C, allows users to write\n    arbitrary files to any location by feeding pandoc a specially crafted\n    URL in an image element.  The vulnerability is serious for anyone\n    using pandoc to process untrusted input.  The vulnerability does\n    not affect pandoc when run with the `--sandbox` flag. [CVE-2023-35936]\n\n  * Allow `epub-title-page` to be used in defaults files (#8908).\n\n  * Issue `Extracting` info message (in `--verbose` mode) when using\n    `--extract-media` or extracting media temporarily in PDF production.\n\n  * HTML reader: Update TableBody RowHeadColumns caculation (#8634,\n    Ruqi). This change sets RowHeadColumns to the minimum value of each row,\n    which gives better results in cases where rows have different numbers\n    of leading th tags.\n\n  * Dokuwiki reader: retain image query parameters as attributes (#8887, echo0).\n\n  * Textile reader: Add support for link references (#8706, Stephen Altamirano).\n    Textile supports what it calls \"link alias\", which are analogous to\n    Markdown's reference-style links.\n\n  * LaTeX reader: support alt text on images (#8743, Albert Krewinkel).\n\n  * Commonmark reader: Make `implicit_figures` work again.\n    Support for this (introduced in #6350) disappeared when we made an\n    architectural change.\n\n  * JATS reader:\n\n    + Add footer and multiple body parsing to table reader (#8765, Noah Malmed).\n    + Parse references title from ref-list (#8365).\n\n  * JATS writer:\n\n     + Make `--number-sections` work.\n     + Include title in ref-list (#8364). Previously the reference title ended\n       up in a separate section at the back of the body instead of in the ref-list\n       in the back matter.\n\n  * Mediawiki writer: allow highlighting to work for F# language\n    (Adelar da Silva Queiróz).\n\n  * LaTeX writer: Fix escaping of `&` in `\\href` and `\\url` (#8903).\n\n  * Docx writer:\n\n    + Fix localization of \"Abstract\" title (#8702).\n    + Allow `abstract-title` to be specified in docx metadata (#8794).\n\n  * ChunkedHTML writer: Make math work in top-level page (#8915).\n\n  * Text.Pandoc.Logging: add new log message type `ScriptingWarning`\n    [API change] (Albert Krewinkel).\n\n  * Lua: report warnings from Lua scripts (Albert Krewinkel).\n    Lua's warning system is plugged into pandoc's reporting architecture.\n    Warnings that are raised with the Lua `warn` function are now reported\n    together with other messages.\n\n  * Use crypton-connection instead of connection (#8896, Felix Yan).\n    Follows the change introduced in tls 1.7.0.\n\n  * Bump versions for skylighting-core, skylighting.\n\n  * Include lua/module/sample.svg in cabal extra-source-files (Felix Yan).\n\n  * Add Nynorsk (New Norwegian) translations (Per Christian Gaustad).\n\n  * Add tests for `fillMediaBag`/`extractMedia`.\n\n  * INSTALL.md:\n\n    + Mention alternatives to LaTeX to generate PDF (Norwid Behrnd).\n    + Update Linux install links (harabat).\n\n  * pandoc-extras.md: add to \"Academic publishing workflows\" (#8696,\n    Vladimir Alexiev).\n\n## pandoc 3.1.3 (2023-06-07)\n\n  * New output format: `typst`.\n\n  * New module: Text.Pandoc.Readers.Typst [API change].\n\n  * DocBook reader:\n\n    + Support more emphasis roles (Albert Krewinkel).\n      The role \"bf\" is taken to indicate \"bold face\", i.e.,\n      \"strongly emphasized\" text, while \"underline\" leads to\n      underlined text.\n\n  * JATS reader:\n\n    + Improve title and label parsing in the JATS reader (#8718,\n      Noah Malmed.)\n    + Add rowspan, colspan and alignment to cells in jats table\n      reader (#8408, Noah Malmed)\n\n  * Org reader (Albert Krewinkel):\n\n    + Require abstract environment to use lowercase.\n    + Treat `#+NAME` as synonym for `#+LABEL` (#8578).\n\n  * ODT reader:\n\n    + Allow lists in table cells (#8892).\n    + Allow frames inside spans (#8886).\n\n  * RST reader:\n\n    + Fix sorting on anonymous keys (#8877). This fixes a link\n      resolution bug bug affecting RST documents with anonymous links.\n\n  * HTML reader:\n\n    + Fix iframe with data URI of an image (#8856).\n      In this case we don't want to try to parse the data at the URL.\n      Instead, create an image inside a div.\n\n  * RTF reader:\n\n    + Fix bug in table parsing (#8767). In certain cases, text before a\n      table was being incorporated into the table itself.\n\n  * Docx reader:\n\n    + Introduce support for Intense Quote (Stephan Meijer).\n\n  * Markdown reader:\n\n    + Disallow escaping of `~` and `\"` in `markdown_strict` (#8777,\n      Albert Krewinkel). This matches the behavior of the legacy\n      `Markdown.pl` as well as what is described in the manual.\n\n  * LaTeX reader: ignore args to column type in `\\multicolumn` (#8789).\n\n  * HTML writer:\n\n    + Use first paragraph in task item as checkbox label (#8729, Albert\n      Krewinkel).\n\n  * Ms writer:\n\n    + Coerce titles to inlines (#8835). Block-level formatting is not\n      allowed inside `.TL`.\n\n  * LaTeX writer:\n\n    + Fix width for multicolumn simple table (#8831).\n\n  * Jira writer:\n\n    + Use first code block class as highlighting language (#8814, Albert\n      Krewinkel). The writer no longer searches the list of\n      classes for a known programming language but always uses\n      the first class in that list as the language identifier.\n\n  * OpenDocument writer:\n\n    + Handle row header column cells as header cells (#8764, Michael Stahl).\n    + Fix invalid `text:p` inside `text:p` from meta (#8256).\n\n  * ODT writer:\n\n    + Don't add settings.xml (Michael Stahl). This will cause defaults\n      to be used, which is what we want.\n    + Don't add unnecessary Configurations2 directory (Michael Stahl).\n    + Don't add thumbnail (Michael Stahl).\n    + Put `manifest.version` on directory file-entry (Michael Stahl).\n      See ODF 1.3 part 2, 4.16.14.1.\n    + Stop validator complaints by producing ODF 1.3 (Michael Stahl).\n\n  * MediaWiki writer:\n\n    + Remove links from inside links in mediawiki writer (#8739,\n      Wout Gevaert).\n\n  * Typst writer:\n\n     + Omit bibliography if `citations` not enabled (#8763).\n      With this change, the typst writer will omit the `#bibliography`\n      command when `citations` is not enabled.  (If you want to use\n      pandoc's own `--citeproc`, you should combine it with\n      `-t typst-citations` to disable native typst citations.\n    + Use `<..>` for labels, create internal links.\n    + Use `#footnote` for notes (#8893).\n    + Fix alignment issue in lists.  It's an aesthetic issue\n      only; the first line had an extra space indent after the\n      list marker.\n\n  * Commonmark writer:\n\n    + Use shortcut reference links: commonmark supports these.\n\n  * EPUB template: add `lang` attribute to `<html>` (Gabriel Lewertoski).\n\n  * Template styles.html: fix task-list styling in reveal.js\n    (#8731, Albert Krewinkel).\n\n  * LaTeX template: Fix `\\babelfont` (#8728).\n\n  * Text.Pandoc.Parsing:\n\n    + Remove unnecessary 'spaces' in `parseFromString`.\n\n  * Text.Pandoc.ImageSize: Drop BOM at start of SVG if present.\n    Otherwise our code can fail to determine image size.\n\n  * Lua subsystem:\n\n    + Fix value of PANDOC_SCRIPT_FILE for custom readers & writers\n      (#8781, Albert Krewinkel). The value did not hold the actual\n      file path for scripts in the *custom* folder of the datadir.\n\n  * Fix YAML in translation files for `cs` and `pl` (#8787).\n\n  * Fix pdf output via typst (#8754).  One must now use `typst\n    compile` rather than `typst`.\n\n  * MANUAL.txt:\n\n    + Added note that the user will need to create the user data\n      dir (#8727).\n    + Add `wikilinks` to non-default extensions (Ilona).\n    + Update link to custom djot writer (Albert Krewinkel).\n    + Better link to citation syntax.\n    + Fix typo (sdhoward).\n    + Note that `#` fancy list markers don't work with commonmark (#8772,\n      William Lupton).\n    + Add commonmark `fenced_div` note (#8773, William Lupton).\n    + Move highlighting documentation, with minor adjustments\n      (William Lupton).\n    + Fix inaccurate statement about spaces and tabs in template\n      syntax\n      (Frank Seifferth).\n\n  * Update documentation for org-mode (Christian Christiansen, #8716).\n\n  * doc/lua-filter.md:\n\n    + Fix typos (#8734, perro tuerto).\n    + Fix anchor (Toni Dietze).\n    + Use full field name in example (#8857, Matt Dodson).\n    + Fix copy-paste error (#8798, thron7).\n\n  * CONTRIBUTING.md: update info on ghc versions.\n\n  * INSTALL.md:\n\n    + Fix cabal install instructions (Albert Krewinkel).\n    + Use more relevant link to NetBSD/pkgsrc entry (Charlotte Koch).\n    + Fix Windows install instructions for winget (#8799).\n\n  * Tests: Rename test/docx/block_quotes_parse_indent.native for\n    consistency (Stephan Meijer).\n\n  * Add `tls` constraint on cabal.project. This is needed to\n    avoid problems caused by the transition to `crypton`.\n\n  * Require texmath 0.12.8.\n\n\n## pandoc 3.1.2 (2023-03-26)\n\n  * Add a Lua REPL (Albert Krewinkel). This can be started\n    with `pandoc lua -i`.  It is also possible to instruct a filter to\n    open the REPL at a certain point, for debugging (see `pandoc.cli.repl`).\n\n  * Support `typst` as a `--pdf-engine`.\n\n  * Add typst writer (#8713).  New module Text.Pandoc.Writers.Typst,\n    exporting `writeTypst` [API change].\n\n  * Org reader:\n\n    + Allow zero width space as an escape character (#8716,\n      Christian Christiansen). Allow the character U+200B to be used as\n      an escape character as described in the Org-mode documentation\n      (<https://orgmode.org/manual/Escape-Character.html>).\n\n  * DocBook reader:\n\n    + Handle \"book\" for xref references (#8712, Andres Freund)\n      This also adds a test xref to book and part.\n    + Handle `<part>` (#8712).\n\n  * HTML reader:\n\n    + Fix behavior with `-native_spans-raw_html` (#8711). Previously with\n      this configuration, `<span>`s were not treated as inline elements at all.\n\n  * HTML writer:\n\n    + Avoid duplicate classes (#8705).\n    + Use img element instead of embed for `.svg.gz` and `.png.gz` etc. (#8699).\n    + HTML writer footnotes changes (#8695): when `--reference-location=section`\n      or `=block`, use an `aside` element for the notes rather than a `section`.\n      When `--reference-location=section`, include the `aside` element inside\n      the section element, rather than outside. (In slide shows, this option\n      causes footnotes on a slide to be displayed at the bottom of the slide.)\n\n  * EPUB writer:\n\n    + Use different structure for epub footnotes (#8676, see #8672, #5583).\n      Many EPUB readers are thrown off by pandoc's current footnote\n      output.  Both the ol and the fact that the footnote backlink is\n      at the end of the note seem to pose problems.\n      With this commit, we now create a list of aside (or div) elements,\n      instead of an ordered list. Each element begins with a note number\n      that is linked back to the note reference.  (So, the backlink occurs\n      at the beginning rather than the end.) Thanks to @Porges and @lewer.\n\n  * Docx writer:\n\n    + Include abstract title (#8702). Uses localized term for abstract.\n\n  * Markdown writer:\n\n    + Use implicit figures if there's a caption but no alt (#8689,\n      Albert Krewinkel).\n\n  * Jira reader (Albert Krewinkel):\n\n    + Add panel title as nested div (#8681).\n    + Require jira-wiki-markup 1.5.1 (#8680). This fixes a bug in the parser\n      that caused text between two exclamation marks to be parsed as an\n      image. The first `!` of image markup must now be followed by a\n      non-space character; otherwise, the enclosed text is parsed as\n      normal content.\n\n  * Ms writer:\n\n    + Fix handling of Figure (#8660).\n\n  * ICML writer:\n\n    + Fix images with data (#8675). The Contents element\n      should be inside Properties.\n\n  * LaTeX writer:\n\n    + Add Chinese to Babel languages.\n    + Fix background image in Beamer when there are figure environments (#8671,\n      Martín Pozo).\n\n  * LaTeX template:\n\n    + Add `babelfonts` variable to default LaTeX template.\n      This allows specifying certain fonts to be used with\n      certain babel languages. Thanks to Frederik Elwert.\n    + Fix highlight/underline with lualatex (#8707). We need the lua-ul package\n      instead of soul, which doesn't work with lualatex.\n\n  * Lua (Albert Krewinkel):\n\n    + Add `pandoc.cli.repl` function\n    + Fix `json.encode` for nested AST elements. Ensures that objects with\n      nested AST elements can be encoded as JSON.\n    + Auto-generate docs for pandoc modules.\n    + Load text module as `pandoc.text`. This only affects the name in the\n      Lua-internal documentation. It is still possible to load the modules\n      via `require 'text'`, although this is deprecated.\n    + Move docs from module `text` to `pandoc.text`\n      The latter is easier to use and more consistent with the other modules.\n    + Keep the Lua stack clean A metatable used during initialization was\n      not properly removed from the stack. Likewise, accessing the\n      CommonState from Lua previously led to the pollution of the\n      Lua stack with a left-over value.\n    * Add function `pandoc.format.from_path`.\n    + Allow to get the JSON encoding of log messages.\n\n  * Text.Pandoc.Format: Add new function `formatFromFilePaths` [API change]\n    (#8710, Albert Krewinkel).\n\n  * The old Text.Pandoc.App.FormatHeuristics module has been removed.\n\n  * In `--version`, use Windows `%APPDATA%` variable to describe\n    user data dir (#8686, Pablo Rodríguez).\n\n  * Text.Pandoc.App.CommandLineOptions: don't lowercase arg to `--from`/`--read`\n    (Albert Krewinkel). This prevented users to use custom writers with\n    uppercase characters in their filenames. Format-normalization,\n    including lower-casing of format identifiers, happens during\n    format parsing.\n\n  * Documentation:\n\n    + Add `doc/nix.md`.\n    + Add `doc/extras.md`. This was formally in the website repo.\n    + `doc/lua-filters.md`: improve docs for `pandoc.zip`.\n\n  * Factor out `make_macos_release.sh` from the release candidate workflow.\n    Use cabal instead of stack to build the macos binary.\n\n  * Modify linux/make_artifacts.sh so it will work on cirrus.\n\n  * Switch to hslua-2.3\n\n  * Depend on latest releases of texmath, doclayout.\n\n## pandoc 3.1.1 (2023-03-05)\n\n  * EPUB reader: Give additional information in error if the epub\n    zip container can't be unpacked.\n\n  * TSV reader: don't gobble tabs as whitespace (#8661).\n\n  * Org reader: accept empty tables (#8659).\n\n  * LaTeX reader: fix multiplication syntax for tabular (#8658).\n    We recognized `*{6}{...}` but not `*6{...}` or `*6c`.\n\n  * Docx reader: parse image alt texts in LibreOffice generated files.\n    LibreOffice tags images slightly differently than Word; this change lets\n    the parses take that difference into account when looking for an image\n    description (alt text).\n\n  * DocBook reader:\n\n    + Fix `<xref>` references to tables in DocBook files\n      (#8626, Pavol Otto).\n    + Parse `figure` as a Figure element in the AST (#8668).\n\n  * JATS reader: avoid generating duplicate figure captions (#8669).\n\n  * RST reader: align with spec in syntax for role names (#8653).\n    In particular, we now allow colons in row names.\n\n  * Add note on converting from .doc format to FAQs (#8654).\n\n  * Trap error in getAppUserDataDirectory (#8648).\n    This can raise an error if pandoc is run in a non-user environment.\n\n  * LaTeX writer: do not use longtable foot with Beamer (#8638, Albert\n    Krewinkel). The table foot is made part of the table body, as\n    otherwise it won't show up in the output. The root cause for\n    this is that longtable cannot detect page breaks in Beamer.\n\n  * LaTeX template: Add CJKsansfont and CJKmonofont for XeLaTeX\n    (#8656, Yudong Jin). `CJKsansfont` and `CJKmonofont` will be\n    set for xelatex only if `CJKmainfont` is also provided.\n\n  * URL style in ConTeXt (#8612, Thomas Hodgson). Previously, a\n    URL like this would be in monospace text:\n    `\\useURL[url1][https://example.com]`.  Now, it will match the\n    main text unless the `linkstyle` variable is set, which\n    controls the styling of all links.  Closes #8602.\n\n  * Asciidoc writer: Properly escape `|` in table cells (#8665).\n\n  * asciidoc{,tor} template: fix revision date when author is unset\n    (#8637, arcnmx). Revision line syntax is only valid in\n    combination with an author line, so the date attribute must be\n    set explicitly when the author is missing\n\n  * HTML writer: allow \"track\" element to be treated as block-level HTML\n    (#8629).\n\n  * Include needed polyfill when MathJaX is used (#8625).\n\n  * JATS writer: include alt-text in `<graphic>`,\n    `<inline-graphic>` elements (#8631, Albert Krewinkel).\n\n  * Chunked HTML writer:  Retain metadata in processing sections\n    for chunked HTML (#8620).  Previously we suppressed metadata\n    in all but the top page, in order to prevent the title block\n    from being printed on every page. This prevented use of\n    custom variables set by metadata fields.  This commit moves\n    to a better solution: a conditional in the default template\n    restricts the title block to the top page.\n\n  * Lua API:\n\n    + Add new function `pandoc.system.cputime` (Albert\n      Krewinkel).  The function returns the CPU time consumed by\n      pandoc and can be used to benchmark Lua computations.\n    + Add module `pandoc.json` to handle JSON encoding (#8605,\n      Albert Krewinkel).\n\n  * Use pandoc-lua-marshal 0.2.1 (Albert Krewinkel).\n    All major AST elements now have `__tojson` metamethods that return the\n    JSON representation of an element. This allows to JSON-encode these\n    elements with libraries that respect the `__tojson` metamethod,\n    including dkjson.\n\n  * Use latest zip-archive.  This allows pandoc to open certain\n    epubs that it could not open before.\n\n  * Use commonmark-extensions 0.2.3.4. This fixes some bugs involving\n    definition lists and inline formatting.\n\n  * Use latest skylighting-format-context\n\n  * MANUAL.txt:\n\n    + Document chunk-template in defaults file.\n    + Remove obsolete \"raw content in a style\" section.\n    + Revise documentation for `--mathml` to reflect support in all major\n      browsers (#8667).\n\n  * docs/custom-readers.md: Update JSON parsing example. The example now\n    uses the built-in `pandoc.json` library to parse the API output.\n\n  * doc/press.md: Add article on CiTO in J Cheminform by @egonw.\n\n  * doc/lua-filters.md: fix typo in `run_json_filter` (Morgan Willcock).\n\n\n## pandoc 3.1 (2023-02-09)\n\n  * Fix regression with `--print-highlight-style` option (#8586).\n\n  * Add new `--chunk-template` option (#8581), allowing more control\n    over the filenames in chunked HTML output.\n\n  * Text.Pandoc.App: Add `optChunkTemplate` constructor to Opt [API change].\n\n  * Text.Pandoc.Options: add `writerChunkTemplate` constructor to\n    `WriterOptions` [API change].\n\n  * Text.Pandoc.Chunks: add Data, Typeable, Generic, ToJSON, FromJSON\n    instances for `PathTemplate` [API change].\n\n  * Text.Pandoc.Citeproc: Fix bug in `metaValueToReference` (#8611).\n    This bug caused us to get some repeated content when converting\n    MetaBlock to Inlines.\n\n  * Textile reader:\n\n    + Support footnote backlinks (#8585, Stephen Altamirano).\n    + Don't allow brackets in URLs (#8582).\n\n  * ODT reader: fix blockquote indent detection (#3437, Daniel Kessler).\n\n  * LaTeX writer: include short figure/table caption if one is given\n    (Albert Krewinkel). Short captions are used by LaTeX when generating\n    the list of figures or list of tables. Adding a short caption will\n    now overwrite the full caption in these lists.\n\n  * Powerpoint writer: fix handling of simple figures (#8565,\n    Albert Krewinkel). This ensures that simple figures are displayed\n    in the same way as before the introduction of a dedicated `Figure`\n    constructor in the AST.\n\n  * Improve handling of `%` in bib(la)tex parsing (#8597, #8595).\n\n  * Use released skylighting 0.13.2.1\n\n  * INSTALL.md: direct people to cabal install pandoc-cli.\n\n  * doc/lua-filters.md: document 'Figure' type and constructor (Albert\n    Krewinkel). Fix typos (Martin Joerg).\n\n  * Fix link in manual (#8583, Salim B).\n\n## pandoc 3.0.1 (2023-01-25)\n\n  * Fix use of extensions with custom readers (#8571).\n\n  * Text.Pandoc.Writers.Shared: export `setupTranslations` [API change].\n    Use this in HTML and OpenDocument writers, to ensure that\n    translations are set up properly even when we don't go through\n    `convertWithOpts`.\n\n  * LaTeX reader: fix regression in macro resolution for environments (#8573).\n\n  * Chunked HTML writer: Fix handling of images with absolute URLs (#8567).\n\n  * HTML writer:\n\n    + Don't omit newlines in task lists.\n    + Don't disable checkboxes in task lists (#8562).\n\n  * Ensure that automatically set variables `pandoc-version`, `outputfile`,\n    `title-prefix`, `epub-cover-image`, `curdir`, `dzslides-core` can be\n    overridden by `--variable` on the command line. Previously they would\n    create lists in the template Context, which is not desirable.\n\n  * Fix man page copying in `linux/make_artifacts.sh` (#8566).\n    Previously we were copying the pandoc-server.1 pandoc page to pandoc-lua.1.\n\n  * pandoc.cabal: remove pandoc.cabal, stack.cabal from extra-source-files\n    (#8560). The problem is that if these are in extra-source-files, then they\n    get put in the tarball, and then anyone trying to build the source\n    from an unpacked tarball will run into the problem that cabal.project\n    and stack.yaml refer to pandoc-server, pandoc-lua-engine, and\n    pandoc-cli, which aren't in the tarball.\n\n  * Require texmath 0.12.6 for better MathML output.\n\n  * Fix typo in Lua filter documentation (Carlos Scheidegger).\n\n  * Fix formatting of link in pandoc-server.md (James Scott-Brown).\n\n  * Minor changelog fixups.\n\n## pandoc 3.0 (2023-01-18)\n\n  * Split pandoc-server, pandoc-cli, and pandoc-lua-engine\n    into separate packages (#8309). Note that installing\n    the `pandoc` package from Hackage will no longer give you the\n    `pandoc` executable; for that you need to install `pandoc-cli`.\n\n  * Pandoc now behaves like a Lua interpreter when called as\n    `pandoc-lua` or when `pandoc lua` is used (#8311, Albert Krewinkel).\n    The Lua API that is available in filters is automatically\n    available to the interpreter. (See the `pandoc-lua` man page.)\n\n  * Pandoc behaves like a server when called as `pandoc-server`\n    or when `pandoc server` is used. (See the `pandoc-server` man page.)\n\n  * A new command-line option `--list-tables`, causes tables to be\n    formatted as list tables in RST (#4564, with Francesco Occhipinti).\n\n  * New command line option: `--epub-title-page=true|false` allows\n    the EPUB title page to be omitted (#6097).\n\n  * `--reference-doc` can now accept a URL argument (#8535) and\n    load a remote reference doc.\n\n  * `--version` output no longer contains version info for dependent\n    packages. Instead, it contains a \"Features\" line that indicates\n    whether the binary was compiled with support for acting as a server,\n    and for using Lua filters and Custom writers.\n\n  * A new option `--split-level` replaces `--epub-chapter-level`\n    and affects both EPUB and chunked HTML output.  `--epub-chapter-level`\n    will still work but is deprecated.\n\n  * Multiple input files with `--file-scope`: fix case where the links\n    are URL-encoded, e.g. with `%20` (#8467).\n\n  * Produce error if `--csl` is used more than once (#8195, Prat).\n\n  * Remove deprecated `--atx-headers` option.\n\n  * Remove deprecated option `--strip-empty-paragraphs`.\n\n  * In `--verbose` mode add message when running citeproc (as with\n    other filters).\n\n  * Add new `mark` extension for highlighted text in Markdown,\n    using `==` delimiters (#7743).\n\n  * Add new extensions `wikilinks_title_after_pipe` and\n    `wikilinks_title_before_pipe` for `commonmark` and `markdown`.\n    (#2923, Albert Krewinkel). The former enables links of style\n    `[[Name of page|Title]]` and the latter `[[Title|Name of\n    page]]`. Titles are optional in both variants, so this works\n    for both: `[[https://example.org]]`, `[[Name of page]]`. The\n    writer is modified to render links with title `wikilink` as\n    a wikilink if a respective extension is enabled. Pandoc will\n    use `wikilinks_title_after_pipe` if both extensions are\n    enabled.\n\n  * Add prefixes to identifiers with `--file-scope` (#6384).\n    This change only affects the case where `--file-scope` is used\n    and more than one file is specified on the command line.\n    In this case, identifiers will be prefixed with a string\n    derived from the file path, to disambiguate them. For example,\n    an identifier `foo` in `contents/file1.txt` will become\n    `contents__file1.txt__foo`.  Links will be adjusted accordingly:\n    if `file2.txt` links to `file1.txt#foo`, then the link will\n    be changed to point to `#file1.txt__foo`.  Similarly, a link\n    to `file1.txt` will point to `#file1.txt`.  A Div with an\n    identifier derived from the file path will be added around\n    each file's content, so that links to files will still work.\n\n  * New output format: `chunkedhtml`. This creates a zip file\n    containing multiple HTML files, one for each section,\n    linked with \"next,\" \"previous,\" \"up,\" and \"top\" links.\n    (If `-o` is used with an argument without an extension,\n    it is treated as a directory and the zip file is automatically\n    extracted there, unless it already exists.) The top page will\n    contain a table of contents if `--toc` is used.  A\n    `sitemap.json` file is also included. The option\n    `--split-level` determines the level at which sections are\n    to be split.\n\n  * Support complex figures (Albert Krewinkel, Aner Lucero).\n    There is now a dedicate Figure block constructor for\n    figures.  The old hack of representing a figure as\n    `Para [Image attr [..alt..] (source, \"fig:title\")]`\n    has been dropped.  Here is a summary of figure support\n    in different formats:\n\n    + Markdown reader: paragraphs containing just an image are treated as\n      figures if the `implicit_figures` extension is enabled. The identifier\n      is used as the figure's identifier and the image description is also\n      used as figure caption; all other attributes are treated as belonging\n      to the image.\n    + Markdown writer: figures are output as implicit figures if possible,\n      via HTML if the `raw_html` extension is enabled, and as Div elements\n      otherwise.\n    + HTML reader: `<figure>` elements are parsed as figures, with the\n      caption taken from the respective `<figcaption>` elements.\n    + HTML writer: the alt text is no longer constructed from the caption,\n      as was the case with implicit figures. This reduces duplication, but\n      comes at the risk of images that are missing alt texts. Authors should\n      take care to provide alt texts for all images. Some readers, most\n      notably the Markdown reader with the `implicit_figures` extension,\n      add a caption that's identical to the image description. The writer\n      checks for this and adds an `aria-hidden` attribute to the\n      `<figcaption>` element in that case.\n    + JATS reader: The `<fig>` and `<caption>` elements are parsed into\n      figure elements, even if the contents is more complex.\n    + JATS writer: The `<fig>` and `<caption>` elements are used write\n      figures.\n    + LaTeX reader: support for figures with non-image contents and for\n      subfigures.\n    + LaTeX writer: complex figures, e.g. with non-image contents and\n      subfigures, are supported. The `subfigure` template variable is set if\n      the document contains subfigures, triggering the conditional loading\n      of the *subcaption* package. Contants of figures that contain tables\n      are become unwrapped, as longtable environments are not allowed within\n      figures.\n    + DokuWiki, Haddock, Jira, Man, MediaWiki, Ms, Muse, PPTX, RTF, TEI,\n      ZimWiki writers: Figures are rendered like Div elements.\n    + Asciidoc writer: The figure contents is unwrapped; each image in the\n      the figure becomes a separate figure.\n    + Classic custom writers: Figures are passed to the global function\n      `Figure(caption, contents, attr)`, where `caption` and `contents` are\n      strings and `attr` is a table of key-value pairs.\n    + ConTeXt writer: Figures are wrapped in a \"placefigure\" environment\n      with `\\startplacefigure`/`\\endplacefigure`, adding the features\n      caption and listing title as properties. Subfigures are place in a\n      single row with the `\\startfloatcombination` environment.\n    + DocBook writer: Uses `mediaobject` elements, unless the figure contains\n      subfigures or tables, in which case the figure content is unwrapped.\n    - Docx writer: figures with multiple content blocks are rendered as\n      tables with style `FigureTable`; like before, single-image figures are\n      still output as paragraphs with style `Figure` or `Captioned Figure`,\n      depending on whether a caption is attached.\n    + DokuWiki writer: Caption and \"alt-text\" are no longer combined. The\n      alt text of a figure will now be lost in the conversion.\n    + FB2 writer: The figure caption is added as alt text to the images in\n      the figure; pre-existing alt texts are kept.\n    + ICML writer: Only single-image figures are supported. The contents of\n      figures with additional elements gets unwrapped.\n    + OpenDocument writer: A separate paragraph is generated for each block\n      element in a figure, each with style `FigureWithCaption`. Behavior for\n      single-image figures therefore remains unchanged.\n    + Org writer: Only the first element in a figure is given a caption;\n      additional block elements in the figure are appended without any\n      caption being added.\n    + RST writer: Single-image figures are supported as before; the contents\n      of more complex images become nested in a container of type `float`.\n    + Texinfo writer: Figures are rendered as float with type `figure`.\n    + Textile writer: Figures are rendered with the help of HTML elements.\n    + XWiki: Figures are placed in a group.\n\n  * Changes in custom readers/writers:\n\n    + It is now possible to have a custom reader and a custom writer for\n      a format together in the same file.  The file may also define\n      a custom template for the writer.\n    + Pandoc now checks the folder `custom` in the user's data directory\n      for a matching script if it can't find one in the local directory.\n      Previously, the `readers` and `writers` data directories were\n      searched for custom readers and writers, respectively. Scripts in\n      those directories must be moved to the `custom` folder.\n    + Custom readers used to implement a fallback behavior that allowed to\n      consume just a string value as input to the `Reader` function. This\n      has been removed, the first argument is now always a list of\n      sources. Use `tostring` on that argument to get a string.\n\n  * New module Text.Pandoc.Writers.ChunkedHTML,\n    exporting `writeChunkedHtml` [API change].\n\n  * We now set the `pandoc-version` variable centrally rather\n    than in the writers.  One effect is the man writer now emits\n    a comment with the pandoc version.\n\n  * pandoc-server:\n\n    + Add simple CORS support to pandoc-server (#8427).\n    + Print message to stderr when starting the server.\n\n  * Docx reader:\n\n    + Mark unnumbered headings with class `unnumbered` (#8148,\n      Albert Krewinkel). This change ensures good conversion\n      results when converting with `--number-sections`.\n    + Support parsing of highlighted text.\n    + Fix handling of `oMathPara` in `w:p` with other content (#8483).\n\n  * ODT reader:\n\n    + Fix relative links. ODT adds a `../` to relative links\n      (see #3524); this needs to be removed when converting from ODT.\n    + Handle \"section\" elements (#8409).\n    + Rename Text.Pandoc.Readers.Odt -> Text.Pandoc.Readers.ODT,\n      for consistency with Writers.ODT. Rename `readOdt` -> `readODT`.\n      [API change]\n\n  * DocBook reader:\n\n    + Support href on link even in a fragment (#8437).\n      (We now just look for an `href` attribute without\n      worrying about the namespace.)\n    + Parse title from imageobject/objectinfo (#8437).\n\n  * JATS reader:\n\n    + Handle uri element in references (#8270).\n\n  * Ipynb reader:\n\n    + Add cell id to attachment filename when storing in MediaBag (#8415).\n      Otherwise attachments with the same name can overwrite each other.\n\n  * LaTeX reader:\n\n    + Skip parenthenized args of toprule, midrule, etc (#8242).\n    + Handle `##` macro arguments properly (#8243).\n    + Remove unused function `toksToString` in Parsing module.\n    + Support more `soul` commands, including `\\hl`.\n    + Add `unnumbered` class for `\\part*` (#8447)\n    + Fix `TEXINPUTS` handling (#8392). If `TEXINPUTS` ends with `:`,\n      then the system default `TEXINPUTS` is added.  We handle this by\n      just adding the working directory in this case.\n    + Parse short table caption (see jgm/pandoc-types#103).\n      This is not too useful yet, because writers don't do anything with\n      the short caption.\n\n  * MediaWiki reader:\n\n    + Parse table cell with attributess, to support rowspan, colspan (#8231,\n      Ruqi).\n    + Refine \"blending\" rules for MediaWiki links (#8525, Ruqi).\n      The rules for \"blending\" characters outside a link into the link are\n      described here: https://en.wikipedia.org/wiki/Help:Wikitext#Blend_link\n      These pose a problem for CJK languages, which generally don't have\n      spaces after links. However, it turns out that the blending behavior, as\n      implemented on Wikipedia, is (contrary to the documentation) only for\n      ASCII letters. This commit implements that restriction, which fixes\n      the problem for CJK.\n\n  * HTML reader:\n\n    + Fix regression for `<tt>` (#8330). It was no longer being parsed as\n      Code (Justin Wood).\n\n  * RST reader:\n\n    + Support `mark` role for round-trip.\n\n  * Textile reader:\n\n    + Support linked images (#8541).\n    + Fix strong emph ending with link (#8540).\n    + Adding a Parser to look for ordered list start attribute numbers\n      if any (#2465, vkraven).\n    + Handle empty paragraphs (#8487). Also, if attributes are added\n      explicitly to a paragraph, put it in a Div with the attributes.\n\n  * Markdown reader:\n\n    + Allow fenced code block \"bare\" language to be combined\n      with attributes (#8174, Siphalor), e.g.\n      ````\n      ```haskell {.class #id}\n      ```\n      ````\n    + Allow table caption labels to start with lowercase `t` (#8259).\n    + Grid tables: allow specifying a table foot by enclosing it with\n      part separator lines, i.e., row separator lines consisting only\n      of `+` and `=` characters (#8257, Albert Krewinkel). E.g.:\n      ```\n      +------+-------+\n      | Item | Price |\n      +======+=======+\n      | Eggs | 5£    |\n      +------+-------+\n      | Spam | 3£    |\n      +======+=======+\n      | Sum  | 8£    |\n      +======+=======+\n      ```\n    + Fix `implicit_header_references` with duplicate headings (#8300).\n      Documentation says that when more than one heading has the same text,\n      an implicit reference `[Heading text][]` refers to the first one.\n      Previously pandoc linked to the last one instead. This patch\n      makes pandoc conform to the documented behavior.\n    + Parse highlighted text inside `==..==` if `mark` extension enabled.\n\n  * Org reader:\n\n    + Allow org-ref v2 citations with `&` prefix (#8302).\n    + Make `#+pandoc-emphasis-pre` work as expected (#8360, Amir Dekel).\n\n  * BibTeX reader:\n\n    + Fix handling of `%` in `url` field (#7678).\n      `%` does not function as a comment character inside `url`\n      (where URL-encoding is common).\n    + Allow `url` field in `bibtex` as well as `biblatex` (#8287).\n      This field is not officially supported for BibTeX, but many styles\n      can handle it (<https://www.bibtex.com/f/url-field/>),\n      and others will ignore it.\n    + Support `software` type in biblatex <-> CSL conversions (#8504).\n    + Make sure `version` field comes through in biblatex (#8504).\n\n  * BibTeX writer:\n\n    + Pass through `url` even for `bibtex` (#8287).\n\n  * Org writer:\n\n    + Pass through unknown languages in code blocks (#8278), instead\n      of producing `begin_example`.\n    + Use span attributes `tag-name` in headers as tags (#8513, Albert\n      Krewinkel). This enables round-tripping of tags in Org headings.\n\n  * EndNote reader:\n\n    + Better error when parsing EndNote references fails.\n\n  * DocBook writer:\n\n    + Rename Text.Pandoc.Writers.Docbook -> Text.Pandoc.Writers.DocBook.\n      Rename `writeDocbook` -> `writeDocBook`, for consistency with\n      the DocBook reader's naming. [API change]\n    + Fix position of textobject (#8437). It is a child of\n      `inlinemediaobject`, not `imageobject`.\n    + Add regression tests for #8437.\n    + Render image alt text using textobject element (#8437).\n    + Don't indent contents of title element.\n    + Store \"unnumbered\" class in DocBook role attribute (#1402, lifeunleaded).\n\n  * ConTeXt writer (Albert Krewinkel):\n\n    + Support syntax highlighting for code.\n    + Always use `\\type` for inline code.\n      Inline codes that contained curly braces where previously rendered\n      with `\\mono`; this led to unexpected results when the presentation\n      of `\\type` was customized, as those changes would not have\n      been applied to code rendered with `\\mono`.\n    + Add support for unlisted, unnumbered headings (#8486).\n    + Support `tagging` extension (Albert Krewinkel). Paragraphs\n      are enclosed by `\\bpar` and `\\epar` commands, and `highlight` commands\n      are used for emphasis. This results in much better tagging in PDF output.\n\n  * LaTeX writer:\n\n    + Do not repeat caption on headless tables (Albert Krewinkel).\n      The caption of headless tables was repeated on each page that\n      contained part of the table. It is now made part of the\n      \"first head\", i.e. the table head that is printed only once.\n    + Add separator line between table's body and its foot\n      (Albert Krewinkel).\n    + Ignore languages with no babel equivalent, instead of generating an\n      invalid command in the preamble (#8325).\n    + Use `\\includesvg` for SVGs and include the `svg` package (#8334).\n    + Use `soul` instead of `ulem` for strikeout, underline (#8411).\n      This handles things like hyphenation, line breaks, and nonbreaking\n      spaces better.\n    + Use `\\toprule\\noalign{}` instead of `\\toprule()` in tables,\n      and similarly for `\\midrule` and `\\bottomrule` (#8223).\n      This facilitates redefining `\\toprule`, `\\midrule`, and `\\bottomrule`\n      without needing to gobble the ()s. (Those who redefine these macros\n      on the assumption that they will be followed by `()` may need to\n      change their definitions.)\n    + Support highlighted text for Span with class `mark`.\n\n  * JATS writer:\n\n    + Use `<break/>` for LineBreak in the limited contexts that accept it\n      (#8344).\n    + Officially deprecate `writeJATS` in favor of `writeJatsArchiving`.\n\n  * RTF writer:\n\n    + Add space after unicode escape commands (#8264).  This fixes\n      a bug that caused characters to disappear after unicode escapes.\n\n  * RST writer:\n\n    + Render tables as list tables when the `--list-tables` option is\n      specified (`writerListTables`) (#4564, Francesco Occhipinti).\n    + Improve inline escaping rules (#8380).\n    + Use special `mark` role for Span with class `mark`.\n\n  * Commonmark writer:\n\n    + Ensure that we don't have blank lines in raw HTML (#8307).\n\n  * HTML writer:\n\n    + Only add role attribute in HTML5 (#8241). It is not valid in HTML4.\n    + Avoid aria-hidden in code blocks for HTML4 (#8241).\n    + Only treat `. . .` as a slide pause in slides, and not in regular\n      HTML output (#8281).\n    + Properly merge classes for headings of level > 6 (#8363).\n    + Prevent `<a>` inside `<a>` (#7585). If a link text contains a link,\n      we replace it with a span.\n    + Replace deprecated aria roles for bibliography entries (#8354).\n      `doc-biblioentry` -> `listitem`, `doc-bibliography` -> `list`.\n    + Remove obsolete stuff about mathml-script.\n      This was a shim we used to include for mathml support.\n      We don't do anything with this any more, so this is dead code.\n    + Include math links if there are raw commands or environments that\n      can be interpreted as math e.g. by MathJax (#8469).\n    + Add prooftree to list of math environments (#8462). This will cause\n      raw LaTeX prooftree environments to be rendered appropriately when\n      `--mathjax` is used.\n\n  * HTML, Markdown writers: filter out empty class attributes (#8251).\n    These should not be generated by any pandoc readers, but they\n    might be produced programmatically.\n\n  * Markdown writer:\n\n    + Avoid HTML fallbacks in the generated TOC (Albert Krewinkel, #8131).\n      The generated table of contents usually has IDs for each TOC link,\n      allowing to link back to specific parts of the TOC. However, this\n      leads to unidiomatic markup in formats like gfm, which do not support\n      attributes on links and hence fall back to HTML. The IDs on TOC items\n      are now removed in that case, leading to more aesthetic TOCs.\n    + Escape `!` before `[` (#8254).\n    + Support `mark` extension.\n\n  * AsciiDoc writer:\n\n    + In link text, only replace commas with entities when they're in\n      Str elements.  If a link contains an image, it may have attributes,\n      and the commas there should not be converted (see #8437, #8070).\n\n  * ODT writer:\n\n    + Fix relative links (#3524).\n\n  * Docx writer:\n\n    + Better handling of tables in lists (#5947). Previously the content\n      of each list cell was indented when the table belonged to a list\n      item.\n    + Indent tables in list items (#5947).\n    + Adjust correct attribute on `lang` element (#7022). For East Asian\n      languages, we need to adjust `w:eastAsia` rather than `w:val`.\n      This allows normal fonts to be used for any Latin-font text.\n      Similarly, for bidi languages, we need to adjust `w:bidi`\n      rather than `w:val`. We treat `he` and `ar` as bidi languages,\n      `zh`, `ja`, `ko` as East Asian languages.\n    + Support relative image widths (Albert Krewinkel).\n      Image widths given in percent are interpreted to be relative to\n      the text width. Previously, percent widths were taken relative to\n      the image's native size, inconsistently with other writers.\n    + Avoid using 'error' for unassigned table cells (#8468). Instead,\n      throw a regular pandoc error.\n    + Render a Span with class `mark` as highlighted. Currently\n      yellow is hardcoded.\n\n  * MediaWiki writer:\n\n    + Use the 'new' table structure, so that colspan and rowspan are\n      supported (Wout Gevaert).\n\n  * Man writer:\n\n    + Use UTF-8 by default for non-ascii characters (#8507).\n      Only use groff escapes if `--ascii` has been specified on the\n      command line (`writerPreferAscii`).\n\n  * ICML writer:\n\n    + Use Contents element for images with raw data instead of a link\n      with a data: uri (#8398).\n\n  * EPUB writer:\n\n    + Refactor to use Text.Pandoc.Chunks.\n    + Refactored and simplified code.\n    + Make title page optional (#6097).\n\n  * Ms writer:\n\n    + Properly format display equations (#8308).\n    + Remove -C option on PSPIC. Some old versions don't support this\n      option, and since it's the default it shouldn't be necessary.\n\n  * XWiki writer:\n\n    + Use template if it is specified (#8296). Previously\n      templates were ignored.\n\n  * LaTeX template:\n\n    + Set fonts after Beamer theme (Jeremie Knuesel). Beamer themes\n      such as metropolis and saintpetersburg change the default\n      fonts. This change gives precedence to the user font settings\n      by moving them after the loading of the Beamer theme.\n    + Set `\\babelfont` when `mainlang` and `lang` are specified and\n      `pdflatex` is not being used (#8538). This is needed for good\n      results in Arabic.\n    + Add variable `urlstyle` (#8429, Amar Al-Zubaidi). This is set to\n      `same` by default, so users should not experience any change.\n\n  * HTML template:\n\n    + Remove default font size, line height and font family in\n      default inline css (#8423). `mainfont`, `fontsize`,\n      and `linestretch` can still be used as before; the only difference\n      is that we no longer provide opinionated defaults.\n      This commit also adds a `maxwidth` variable that sets `max-width`;\n      if not set, 36em is used as a default.\n    + Add `code { hyphens: manual; }`.\n    + Use `styles.citations.html` partial in `styles.html`.\n    + Fix class name `hanging` -> `hanging-indent` in\n      `styles.citations.html`.\n    + Put Consolas before Lucida Console for code font (#8543).\n      This is to prevent Lucida Console from being used on Windows, where\n      it causes spacing issues in some applications, with boldface\n      glyphs wider than regular ones.\n\n  * EPUB CSS changes: Reduce the amount of inline CSS used for EPUBs\n    (#8379). Almost everything is now in the default EPUB CSS\n    (`data/epub.css`), which can be overridden either by\n    putting `epub.css` in the user data directory or by using\n    `--css` on the command line.  Inline styles are only used\n    for syntax highlighting (which depends on the style\n    specified, and is only included on pages with highlighted\n    code) and for bibliography formatting (which can depend on\n    the CSL style, and is only used in the page containing the\n    bibliography).\n\n    Note that, for compatibility with older readers, we don't\n    use flexbox to style `column/columns` divs by default, as\n    we do in HTML.  Instead, we use an older method which only\n    works when there are two `column` divs inside a `columns`\n    div.  If you need more than two columns and aren't worried\n    about support for older EPUB readers, you can modify the\n    default CSS (there is a comment in the CSS telling you what\n    to do).\n\n  * Reveal.js template: prevent line-wrapping of parallax options\n    (#8503, Albert Krewinkel).\n\n  * reference.pptx: Remove unsupported element (#8342, #6338, Link Swanson).\n    The default template contained text above the header, which can mislead\n    users into thinking there is a way to put text there using pandoc.\n\n  * Text.Pandoc.Readers.Metadata:\n\n    + Fix metadata parsing corner case (#8465).\n    + Don't fail on inline metadata beginning with newline (#8358).\n\n  * Text.Pandoc.App:\n\n    + Move initial input-to-Pandoc code to internal submodule (Albert\n      Krewinkel).\n    + Change `parseOptionsFromArgs` and `parseOptions` (#8406)\n      They now return `Either OptInfo Opt`. [API change]\n    + Add `OptInfo` type [API change].\n    + Add `handleOptInfo` function.  This performs the IO actions for\n      things like `--version` that were previously done in\n      `parseOptionsFromArgs` [API change].\n    + `convertWithOpts`: add argument for a `ScriptingEngine` [API change].\n    + Unify check for standalone output (Albert Krewinkel).\n    + New `optEpubTitlePage` field on `Opt` [API change] (#6097).\n    + Remove `optEpubChapterLevel`, add `optSplitLevel` [API change].\n    + Export `IpynbOutput(..)` [API change].\n\n  * Text.Pandoc.App.OutputSettings:\n\n    + Remove unused field `outputWriterName` in `OutputSettings`.\n\n  * Text.Pandoc.Citeproc:\n\n    + Check both extension and mime type to determine bibliography type\n      when the bibliography is fetched remotely (#7151).\n    + CslJson: allow an object with `items` property in addition to\n      an array of references. This is what is returned by e.g.\n      `https://api.zotero.org/groups/904125/items?v=...&format=csljson`\n    + Require a digit for an implicit \"page\" locator inside explicit\n      locator syntax `{...}` (#8288). Previously a locator specified as\n      `{}` would be rendered as `p.` with nothing after it.\n    + Update `sub verbo` to `sub-verbo` (#8315). This is a change in\n      the term's canonical name in citeproc. As a result of this change,\n      `sub verbo` locators have not worked in pandoc since citeproc 0.7.\n    + Text.Pandoc.Citeproc.MetaValue: remove unused function\n      `metaValueToPath`.\n    + Add internal module Text.Pandoc.Citeproc.Name (#8345). This exports\n      `toName`, which previously had been part of T.P.Citeproc.BibTeX,\n      and allows for cleaner module dependencies.\n\n  * Export module `Text.Pandoc.Slides` [API Change] (Albert Krewinkel).\n\n  * Add new module Text.Pandoc.Format [API change] (Albert Krewinkel).\n    The module provides functions and types for format spec parsing and\n    processing. The function `parseFormatSpec` was moved from\n    Text.Pandoc.Extensions to the new module and renamed to\n    `parseFlavoredFormat`. It now operates in\n    a PandocMonad and is based on the updated types.\n\n  * Text.Pandoc.Sources:\n\n    + Add UpdateSourcePos instances for String and\n      strict and lazy ByteString [API change].\n\n  * Text.Pandoc.Extensions:\n\n    + Fix JSON decoding of Extensions (#8352, Albert Krewinkel).\n    + Add new exported function `readExtension` [API change].\n    + Remove `parseFormatSpec` [API change]. This has been moved\n      to Text.Pandoc.Format and renamed as `parseFlavoredFormat`\n      (Albert Krewinkel).\n    + Simpler implementation of Extensions based on Set\n      (benchmarks show no performance penalty).\n    + Add `CustomExtension` constructor to `Extension` [API change].\n    + Remove `Bounded`, `Enum` instances for `Extension`.\n    + Add `extensionsToList` function.\n    + Revise `readExtension` so it can handle `CustomExtension`, and so\n      that it returns a Text rather than `Maybe Text`.\n    + Add `showExtension` [API change].\n    + Add `Ext_mark` extension [API change].\n    + Add `Ext_tagging` constructor [API change] (Albert Krewinkel).\n    + Add `Ext_wikilinks_title_after_pipe`, `Ext_wikilinks_title_before_pipe`\n      [API change] (Albert Krewinkel).\n\n  * Text.Pandoc.PDF:\n\n    + Fix `papersize` on PDF generation via ms (#8403).\n      We need to set an option in pdfroff in addition to including\n      a macro in the ms file. With this fix, `-Vpapersize=a4` should be\n      sufficient to produce A4 PDF via ms.\n    + Change default background color of PDFs generated via HTML (#8422,\n      Marcin Serwin).\n\n  * Text.Pandoc.MIME:\n\n    + Base module on package `mime-types`, which\n      is already a transitive dependency (#8277, Albert Krewinkel).\n    + Remove deprecated overrides (#8292).\n\n  * Text.Pandoc.XML:\n\n    + Re-export `lookupEntity` from commonmark-hs [API change].\n\n  * Text.Pandoc.Parsing:\n\n    + Remove gratuitious renaming of Parsec types. We were exporting\n      Parser, ParserT as synonyms of Parsec, ParsecT.\n      There is no good reason for this and it can cause confusion.\n      Also, when possible, we replace imports of Text.Parsec with\n      Text.Pandoc.Parsing. The idea is to make it easier, at some point,\n      to switch to megaparsec or another parsing engine if we want to.\n      New (re-)exports: `Stream(..)`, `updatePosString`, `SourceName`,\n      `Parsec`, `ParsecT`. Removed exports: `Parser`, `ParserT`\n      [API change].\n    + Export `errorMessages`, `messageString` [API change].\n    + Export `fromParsecError`, which can be used to turn a parsec\n      ParseError into a regular PandocParseError (#8382) [API change].\n    + Remove `nested` [API change]. It was not being used, and in fact it\n      was a bad idea from the beginning, as it had no hope of solving\n      the problem it was introduced to solve.\n    + Change `characterReference`, `charsInBalanced`. `characterReference`\n      so they now return a Text (some named references don't correspond\n      to a single Char). Use the the `lookupEntity` function from\n      commonmark-hs instead of the slow one from tagsoup [API change].\n    + `charsInBalanced` now takes a Text parser rather than a Char parser\n      as argument [API change].\n\n  * Text.Pandoc.Shared:\n\n    + Export `textToIdentifier` [API change].\n    + Remove deprecated `crFilter`. [API change]\n    + Remove deprecated `deLink`. [API change]\n    + Deprecate `notElemText`.\n    + Deprecate `makeMeta`.\n    + Remove `pandocVersion` (now available in Text.Pandoc.Version\n      as `pandocVersionText`).\n    + Remove `findM` [API change]. This was only used in one place, and\n      can be replaced with simpler code.\n    + Remove deprecated `makeMeta` [API change].\n    + Remove `ordNub` [API change]. This is just `nubOrd` from\n      Data.Containers.ListUtils.\n    + Remove `mapLeft` [API change]. This is just a synonym for\n      Bifunctor.first.\n    + Remove `elemText`, `notElemText` [API change].\n    + Drop export of `pandocVersion` and `pandocVersionText`,\n      which are now exported by Text.Pandoc.Version.\n    + Remove `escapeURI`, `isURI`. These are now exported by\n      Text.Pandoc.URI, and removing them from Shared helps make\n      the module structure more straightforward.\n    + Use LineBreak as default block sep in `blocksToInlines`.\n      (#8499, Albert Krewinkel). This change also affects the\n      `pandoc.utils.blocks_to_inlines` Lua function.\n    + `defaultUserDataDir` is no longer exported (it has been\n      moved to T.P.Data) [API change].\n    + New function `figureDiv`, offering offers a standardized way\n      to convert a figure into a Div element (Albert Krewinkel) [API change].\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Export `htmlAddStyle`, `htmlAlignmentToString` and `htmlAttrs`\n      [API change] (Wout Gevaert).\n    + Use 'literal tag' instead of 'text (T.unpack tag)' in `tagWithAttrs`\n      (Wout Gevaert).\n    + `toTableOfContents`: handle nested Divs better (#8402).\n\n  * Rename Text.Pandoc.Network.HTTP -> Text.Pandoc.URI.\n    This is still an unexported internal module.\n    Export `urlEncode`, `escapeURI`, `isURI`, `schemes`, `uriPathToPath`.\n    Drop exports of `schemes` and `uriPathToPath`.\n\n  * Text.Pandoc.URI `isURI`: don't require non-ASCII characters to be\n    escaped (#8508).\n\n  * Rename Text.Pandoc.Readers.LaTeX.Types -> Text.Pandoc.TeX (internal\n    module).\n\n  * Text.Pandoc.Options:\n\n    + WriterOptions now has a field `writerListTables`,\n      specifying that list tables be used in RST output [API change].\n    + New `writerEpubTitlePage` field on `WriterOptions` (#6097)\n      [API change].\n    + Remove `writerEpubChapterLevel`, add `writerSplitLevel` [API change].\n\n  * Text.Pandoc.Filter:\n\n    + Export `applyFilters` [API change].\n    + Export `applyJSONFilter` [API Change] (Albert Krewinkel).\n    + Parameterize `applyFilters` over scripting engine [API change] (Albert\n      Krewinkel).\n\n  * New exported module Text.Pandoc.Chunks [API change].  This\n    module provides functions to split Pandoc documents into\n    chunks to be rendered in separate files, e.g. one per\n    section.  Internal identifiers are rewritten appropriately to\n    point to the new locations (#6122).\n\n  * Text.Pandoc.Readers:\n\n    + Change argument type of `getReader`, so it takes a `FlavoredFormat`\n      instead of a `Text` [API change] (Albert Krewinkel).\n\n  * Text.Pandoc.Writers:\n\n    + Change argument type of `getWriter`, so it takes a `FlavoredFormat`\n      instead of a `Text` [API change] (Albert Krewinkel).\n\n  * Text.Pandoc.Templates:\n\n    + Do not try to normalize input to `getDefaultTemplate` (Albert\n      Krewinkel). The function `getDefaultTemplate` no longer splits off\n      extension modifers from the given format, as that conflicts with\n      using custom writers as formats. Haskell library users should use\n      `getDefaultTemplate <=< (fmap formatName . parseFlavoredFormat)`\n      if the input format can still contain extensions. The same is true\n      for `compileDefaultTemplate`, which calls `getDefaultTemplate`\n      internally\n    + Add Wrapper type documentation (#8490, William Rusnack).\n\n  * New exported module Text.Pandoc.Scripting (Albert Krewinkel).\n    The module contains the central data structure for scripting engines\n    (e.g., Lua) [API change].\n\n  * Text.Pandoc.Error:\n\n    + Add new PandocError constructor `PandocNoScriptingEngine` [API change]\n      (Albert Krewinkel).\n    + Add new PandocError constructor `PandocFormatError` [API change]\n      (Albert Krewinkel). The new error is used to report problems with\n      input or output format specifications.\n    + Add new PandocError constructor `PandocNoTemplateError`\n      (Albert Krewinkel).\n    + Remove `PandocParsecError` constructor from `PandocError` (#8385).\n      Henceforth we just use `PandocParseError`.\n\n  * New module Text.Pandoc.Version, exporting `pandocVersionText`\n    and `pandocVersion` [API change].  `pandocVersion` returns a `Version`\n    instead of a `Text`, which is consistent with `pandocTypesVersion`.\n\n  * Text.Pandoc.Class:\n\n    + Make `getPOSIXTime`, `getZonedTime` sensitive to `SOURCE_DATE_EPOCH`\n      environment variable if set (#7093).  (`getTimestamp` was\n      already sensitive.)  This ensures that EPUB builds are reproducible.\n    + Text.Pandoc.Class no longer exports `readDataFile`,\n      `readDefaultDataFile`, `setTranslations`, and `translateTerm`\n      [API change].\n    + Text.Pandoc.Class now exports `checkUserDataDir` [API change].\n\n  * T.P.Class.IO: export function `writeMedia` [API change] (Albert Krewinkel).\n    This is useful for the `pandoc.mediabag` module.\n\n  * Separate out Text.Pandoc.Data and Text.Pandoc.Translations from\n    Text.Pandoc.Class (#8348). This makes Text.Pandoc.Class\n    more self-contained.\n\n    + Text.Pandoc.Data is now an exported module, providing `readDataFile`\n      and `readDefaultDataFile` (both formerly provided by\n      Text.Pandoc.Class), and also `getDataFileNames` (formerly\n      unexported in Text.Pandoc.App.CommandLineOptions)\n      and `defaultUSerDataDir` (formerly provided by\n      Text.Pandoc.Shared). [API change]\n    + Text.Pandoc.Translations is now an exported module (along with\n      Text.Pandoc.Translations.Types), providing `readTranslations`,\n      `getTranslations`, `setTranslations`, `translateTerm`,\n      `lookupTerm`, `readTranslations`, `Term(..)`, and `Translations` [API\n      change].\n\n  * Text.Pandoc now exports Text.Pandoc.Data and `setTranslations`\n    and `translateTerm` {API change].\n\n  * Export module Text.Pandoc.Class.IO [API change].\n    The module is useful when defining instances of class PandocMonad for\n    types that are also instances of MonadIO.\n\n  * Remove modules Text.Pandoc.Writers.Custom and Text.Pandoc.Readers.Custom\n    [API Change] (Albert Krewinkel). The functions `writeCustom` and\n    `readCustom` are available from module Text.Pandoc.Lua.\n\n  * Text.Pandoc.Server:\n\n    + Split this module into a separate package, `pandoc-server`,\n      allowing the `pandoc` library to be compiled without server support.\n    + Return object if JSON is accepted. Previously we just returned\n      a JSON-encoded string. Now we return something like:\n      ```\n      {\n          \"output\": \"<p>hello</p>\"\n          \"base64\": false,\n          \"messages\": [\n              {\n                  \"message\": \"Not rendering RawInline (Format \\\"tex\\\") \\\"\\\\\\\\noe\\\"\",\n                  \"verbosity\": \"INFO\"\n              }\n          ],\n      }\n      ```\n      This is a change in the pandoc-server JSON API.\n    + Set translations in the writer based on `lang` metadata.\n    + Return error in JSON object if response is JSON.\n    + Remove `parseServerOpts`. [API change]\n\n  * Text.Pandoc.Lua:\n\n    + This module has been moved to a separate package,\n      `pandoc-lua-engine`.\n    + Export `applyFilter`, `readCustom`, and `writeCustom`.\n      No longer export the lower-level function `runFilterFile` [API\n      change].\n    + Change type of `applyFilter` [API Change] (Albert Krewinkel).\n      The module Text.Pandoc.Filter.Lua has been merged into\n      Text.Pandoc.Lua. The function `applyFilter` now has type\n      ``` haskell\n      applyFilter :: (PandocMonad m, MonadIO m)\n                  => Environment-> [String]-> FilePath-> Pandoc-> m Pandoc\n      ```\n      where `Environment` is defined in Text.Pandoc.Filter.Environment.\n    + Export new function `getEngine` [API Change].\n      The function returns the Lua scripting engine.\n    + Add unexported modules T.P.Lua.Reader, T.P.Lua.Writer.\n      These contain the definitions of `readCustom` and `writeCustom`\n      that were previously in T.P.Readers.Custom and T.P.Writers.Custom.\n    + Cleanup module dependencies, for a cleaner module dependency graph.\n    + The `writeCustom` function has changed to return a Writer and\n      an ExtensionsConfig [API change].  This allows ByteString writers\n      to be defined.\n    + The `readCustom` function has changed to return a Reader and an\n      ExtensionsConfig [API change].\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + The whole Lua subsystem has been moved to a separate package,\n      `pandoc-lua-engine`.  `pandoc` does not depend on it.\n      `convertWithOpts` has a new parameter that can be used to\n      pass in the scripting engine defined in `pandoc-lua-engine`\n      (or a different one, in theory).\n    + Fix the behavior of Lua \"Version\" objects under equality\n      comparisons (#8267).\n    + Support running Lua with a GC-collected Lua state.\n    + Ensure that extensions marshaling is consistent.\n    + Produce more informative error messages for pandoc errors.\n      Errors are reported in Lua in the same words in which they would be\n      reported in the terminal.\n    + Add new module `pandoc.format`. The module provides functions to\n      query the set of extensions supported by formats and the set\n      of extension enabled per default.\n    + Add function `pandoc.template.apply`.\n    + Add function `pandoc.template.meta_to_context`.\n      The functions converts Meta values to template contexts; the intended\n      use is in combination with `pandoc.template.apply`.\n    + Allow Doc values in `WriterOptions.variables`.\n      The specialized peeker and pusher function for `Context Text` values\n      does not go via JSON, and thus keeps Doc values unchanged during\n      round-tripping.\n    + Fix rendering of Lua errors in Lua, so that the\n      `Error running Lua` message is not prepended multiple times.\n    + Add new module `pandoc.zip`.\n    + Allow strings in place of compiled templates (#8321).\n      This allows to use a string as parameter to `pandoc.template.apply`\n      and in the WriterOptions `template` field.\n    + Rename `reader_extensions`/`writer_extensions` globals as `Extensions`\n      (#8390).\n    + Add `pandoc.scaffolding.Writer` (#8377). This can be used to reduce\n      boilerplate in custom writers.\n    + Fix peeker for PandocError (Albert Krewinkel). String error messages\n      were incorrectly popped of the stack when retrieving a PandocError.\n    + Add functions `pandoc.text.toencoding`, `pandoc.text.fromencoding`\n      (#8512, Albert Krewinkel).\n    + Add `pandoc.cli` module. Allow processing of CLI options in Lua.\n    + Support `-D` CLI option for custom writers.\n      A new error `PandocNoTemplateError` (code 87) is thrown if a template\n      is required but cannot be found.\n    + Allow table structure as format spec. This allows to pass structured\n      values as format specifiers to `pandoc.write` and `pandoc.read`.\n    + Add function `pandoc.mediabag.write` (Albert Krewinkel).\n    + Add module `pandoc.structure` (Albert Krewinkel). The function\n      `make_sections` has been given a friendlier interface and moved to the\n      new module; the old `pandoc.utils.make_sections` has been deprecated.\n\n  * Custom writers:\n\n    + The global variables `PANDOC_DOCUMENT` and `PANDOC_WRITER_OPTIONS`\n      are no longer set when the writer script is loaded. Both variables\n      are still set in classic writers before the conversion is started,\n      so they can be used when they are wrapped in functions.\n    + Deprecate classic custom writers.\n    + Add function `pandoc.write_classic`. The function can be used to\n      convert a classic writer into a new-style writer by setting it as\n      the value of `Writer`:\n      ``` lua\n      Writer = pandoc.write_classic\n      ```\n      or to fully restore the old behavior:\n      ``` lua\n      function Writer (doc, opts)\n        PANDOC_DOCUMENT = doc\n        PANDOC_WRITER_OPTIONS = opts\n        load(PANDOC_SCRIPT_FILE)()\n        return pandoc.write_classic(doc, opts)\n      end\n      ```\n    + Support extensions in custom writers. Custom writers can define the\n      extensions that they support via the global `writer_extensions`.\n      The variable's value must be a table with all supported extensions\n      as keys, and their default status as values. For example,\n      the below specifies that the writer supports the extensions `smart`\n      and `sourcepos`, but only the `smart` extension is enabled by default:\n      ``` lua\n      writer_extensions = {\n        smart = true,\n        sourcepos = false,\n      }\n      ```\n    + Custom writers can define a default template via a global `Template`\n      function; the data directory is no longer searched for a default\n      template. Writer authors can restore the old lookup behavior with\n      ``` lua\n      Template = function ()\n        local template\n        return template.compile(template.default(PANDOC_SCRIPT_FILE))\n      end\n      ```\n\n  * Custom readers:\n\n    + Support extensions in custom readers.\n      Custom readers, like writers, can define the set of supported\n      extensions by setting a global. E.g.:\n      ``` lua\n      reader_extensions = {\n        smart = true,\n        citations = false,\n      }\n      ```\n\n  * Use latest versions of `commonmark-extensions`, `texmath`,\n    `citeproc`, `gridtables`, and `skylighting`.\n\n  * Use pandoc-types 1.23.  This adds the `Figure` Block\n    constructor and removes the `Null` Block constructor.\n\n  * Require aeson >= 2.0.\n\n  * Use jira-wiki-markup 1.5.0 (#8511, Albert Krewinkel). Fixes issues with\n    icon-like sequences at the beginning of words.\n\n  * Use doctemplates 0.11, avoiding a transitive dependency on HsYAML.\n\n  * Use skylighting 0.13.1.2.\n\n  * Allow mtl 2.3.1 (Alexander Batischev).\n\n  * Use latest skylighting-format-context.\n\n  * Allow building with mtl 2.3.\n\n  * Remove `lua53` flag.  We now only support Lua 5.4.\n\n  * Add hie.yaml for haskell language server.\n\n  * Add tools/latex-package-dependencies.lua.\n\n  * Update default CSL with latest `chicago-author-date.csl`.\n\n  * make_artifacts.sh: various small improvements.\n\n  * Remove sample.lua from data files (#8356).\n\n  * Documentation:\n\n    + Deprecate `PANDOC_WRITER_OPTIONS` in custom writers (Albert Krewinkel).\n    + Document `pandoc.write_classic` (Albert Krewinkel).\n    + Document new table features (Albert Krewinkel).\n    + Clarify what background-image does in reveal.js (#6450).\n    + Documentation improvements for `blank_before_blockquote`\n      (#8324, Pranesh Prakash).\n    + Update grid table documentation (#8346).\n    + Add note about MathJax fonts to `--embed-resources`.\n    + Use cabal's --package-env more (#8317, Artem Pelenitsyn).\n    + Modify Zerobrane instructions to use Lua 5.4 (#8353, Ian Max Andolina).\n    + Fix documentation for highlight-style in `pandoc-server.md`.\n    + Fix link to fedora package site (#8246, Akos Marton).\n    + Rephrase paragraph on format extensions (#8375, Ilona Silverwood).\n    + Update README.template (#8496, Sven Wick).\n    + Fix a tiny typo in lua-filters.md (TomBen).\n    + Clarify that `--css` should be used with `-s`.\n    + Clarify font selection for pdf -t ms (#8421, nbehrnd).\n    + Clarify docs for `--metadata-file` (#8459).\n    + Fix typo in epub.md (Vladimir Alexiev).\n    + Add missing backtick in filters.md (R. N. West).\n    + `doc/lua-filters.md`: add documentation for `pandoc.format`\n      (Albert Krewinkel).\n    + Fix epub-embed-font documentation (#8455, Terence Eden).\n    + Removed obsolete Templates section in CONTRIBUTING.md.\n    + Add manual section on accessible PDFs, archiving standards (#8312,\n      Albert Krewinkel).\n\n  * Tests.Command: remove unused `runTest`.\n\n  * Add pandoc-lua.1 man page.\n\n  * Improve `shell.nix`.\n\n  * Add `tools/moduledeps.lua` for inspecting the internal module\n    dependency tree.\n\n  * Fix macOS zip so pandoc-server is a symlink. This cuts its size by 2x.\n\n  * CI: Improve CI speed by caching more, eliminating macos builds,\n    and splitting benchmarks into a separate action, run by\n    manual dispatch. (We still test that benchmarks build in\n    the regular CI.) The cache can be expired manually by\n    modifying the secret `CACHE_VERSION`.\n\n  * Remove the unnecessary Setup.hs from pandoc.\n    Cabal does not need this with build-type 'simple'.\n\n  * Add pandoc-lua and pandoc-server (symlinks) and their man pages\n    to releases.\n\n  * Use hslua-cli package for pandoc-lua interface (Albert Krewinkel).\n\n  * Add `server` flag to pandoc-cli, allowing it to be compiled without\n    server support.\n\n  * pandoc-cli: Allow building a binary without Lua support (Albert\n    Krewinkel). Disabling the `lua` cabal flag will result in a\n    binary without Lua.\n\n  * Move `--version` handling to pandoc-cli. We need it here in order\n    to print information about whether server and Lua support have been\n    compiled in.\n\n  * Move `nightly` flag from pandoc to pandoc-cli (#8339).\n\n  * Makefile changes:\n\n    - `make help` will now print all the targets and what they do.\n    - Add targets: `coverage`, `weeder`, `moduledeps`, `prerelease`,\n      `ghcid`, `repl`, `linecounts`, `hie.yaml`, `binpath`.\n    - Note that you can `` alias pandoc=`make binpath` `` for\n      convenient local testing of a build.\n    - Rename `quick-cabal` -> `build`, `quick-test` -> `test`.\n    - Exclude tests from `SOURCEFILES`.\n\n  * Factor out xml-light into an internal library.\n\n  * Add CITATION.cff (#8434).\n\n  * Move trypandoc to a separate repository, jgm/trypandoc.\n\n## pandoc 2.19.2 (2022-08-22)\n\n  * Fix regression with data uris in 2.19.1 (#8239).\n    In 2.19.1 we used the base64URL encoding rather than base64.\n\n  * pandoc-server: handle `citeproc` parameter as documented (#8235).\n\n  * Org reader: treat *emacs-jupyter* src blocks as code cells (#8236,\n    Albert Krewinkel). This improves support for notebook-like org files\n    that are intended to be used with emacs-jupyter package.\n\n  * HTML writer and templates: revert to using `width` property for column\n    widths (Albert Krewinkel). The default `flex` and `overflow-x` properties\n    of a column are set to `auto`. In combination, these changes allow to\n    get good results when using columns with or without explicit widths.\n\n  * Org writer (Albert Krewinkel):\n\n    + Add support for jupyter nodebook cells (#6367).\n    + Prefix code language of ipynb code blocks with `jupyter-`.\n      This is the convention used by the *emacs-jupyter* package.\n    + Keep code block attributes as header args. This allows to keep more\n      information in the resulting `src` blocks, making it easier to\n      roundtrip from or through Org. Org babel ignores unknown header\n      arguments.\n    + Add code block identifier as `#+name` to src blocks.\n\n  * Fix some typos in the codebase (luz paz).\n\n  * Require hslua-module-path 1.0.3 (#8228, Albert Krewinkel).\n\n## pandoc 2.19.1 (2022-08-18)\n\n  * Add server capabilities.\n\n    + New exported module Text.Pandoc.Server [API change].\n    + The pandoc executable now starts up a web server when renamed or\n      symlinked as `pandoc-server`, and functions as a CGI program when\n      renamed or symlinked as `pandoc-server.cgi`.  See the man page for\n      `pandoc-server` for full documentation.\n\n  * Text.Pandoc.App.Opts: Redo `FromJSON` for `Opt` so that optional\n    values can be omitted (in which case the values from\n    `defaultOptions` are used).\n\n  * Org reader: treat \"abstract\" block as metadata (Albert Krewinkel, #8204).\n    A block of type \"abstract\" is assumed to define the document's abstract.\n    It is transferred from the main text to the metadata.\n\n  * Org template: add abstract from metadata as block of type \"abstract\"\n    (#8204).\n\n  * HTML writer: use `flex` property for column widths\n    (Albert Krewinkel, #8232).\n\n  * LaTeX writer:\n\n    + Add label to tables that have an identifier (Albert Krewinkel, #8219).\n      Tables with an identifier are marked with a `\\label`. A caption is\n      always included in this case, even if the caption is empty.\n    + Use `\\textquotesingle` for straight quotes in text.\n    + Fix widths of multicolumn cells (#8218).\n\n  * LaTeX template: fix behavior of `colorlinks` variable (Albert\n    Krewinkel, #8226). Fixes a regression in 2.19 that required the\n    `boxlinks` variable to be set in addition to the usual link coloring\n    variables. Otherwise links were never colored in LaTeX PDF output.\n\n  * Text.Pandoc.Highlighting: Export `lookupHighlightingStyle`\n    [API change]. Previously this lived in an unexported module\n    Text.Pandoc.App.CommandLineOptions, under the name\n    `lookupHighlightStyle`.\n\n  * Text.Pandoc.App:\n\n    + Remove unneeded MonadIO constraints in readSources.\n    + Factor out `convertWithOpts'` from `convertWithOpts`.\n      This runs in any PandocMonad, MonadIO, MonadMask instance.\n      So far it is not exported, but it might find a use later.\n\n  * Support `--strip-comments` in commonmark/gfm (#8222).\n    This change makes the commonmark reader sensitive to\n    `readerStripComments`.\n\n  * Lua: add function `pandoc.utils.citeproc` (Albert Krewinkel).\n    The function runs the *citeproc* processor on a Pandoc document.\n    Exposing this functionality to Lua allows to make citation processing\n    part of a filter or writer, simplifies the creation of multiple\n    bibliographies, and enables the use of varying citation styles in\n    different parts of a document.\n\n  * Refactor `linux/make_artifacts.sh`.\n\n  * Update INSTALL.md installation from source instructions.\n\n  * Use base64 package instead of base64-bytestring. It is supposed to be\n    faster and more standards-compliant.\n\n  * trypandoc improvements:\n\n    + Add dropdown with canned examples.\n    + Add citeproc support.\n    + Support csv, bibliographic and binary formats.\n    + Add load from file.\n    + Add permalink.  Don't always reload page.\n    + Use vanilla JS and CSS + the new `pandoc-server.cgi`.\n\n  * Allow haddock-library-1.11.0.\n\n  * Convert `tool/extract-changes.hs` to a Lua filter.\n\n\n## pandoc 2.19 (2022-08-03)\n\n  * Add `--embed-resources` flag (Elliot Bobrow, #7331).  This can be\n    used to embed resources without implying `--standalone`.\n    Deprecate `--self-contained` in favor of `--embed-resources --standalone`.\n\n  * Allow environment variable interpolation in `highlight-style`\n    and `pdf-engine` fields in defaults files\n    (#8061; Jaehwang Jung, #8073).\n\n  * Allow placing custom readers and writers in user data directory\n    (Albert Krewinkel, #8112) (`readers` and `writers` subdirectories).\n\n  * Add `tsv` (tab separated values) as an input format (#7974).\n    [API change]: Text.Pandoc.Readers.CSV now exports `readTSV`.\n    Internal change:  In Text.Pandoc.CSV, `CSVOptions` has changed\n    so that `csvQuote` takes a Maybe value.\n\n  * Add `tex_math_dollars` to `gfm` default extensions (reflecting\n    gfm's new support for math).\n\n  * RST, Org, Markdown readers: support rowspans and colspans in grid tables\n    (#8202, Albert Krewinkel). Note: the writers does not yet support these\n    more complex grid table features, so these complex grid tables will\n    not round-trip.\n\n  * HTML, LaTeX, and MediaWiki readers: use `formatCode`\n    (#8162, #8129, Elliot Bobrow). This moves formatting from inside inline\n    code elements to the outside, since pandoc's Code element only takes string\n    content.\n\n  * Markdown reader:\n\n    + Don't parse inline notes with blank lines inside (#8028).\n    + Allow attributes in special spans (e.g. `smallcaps`, `underline`)\n      (Albert krewinkel, #4102). These spans are parsed as\n      SmallCaps or Underline elements, but any attributes are included\n      in a wrapping Span.\n\n  * HTML reader:\n\n    + Allow sublists that are not marked as items (Albert\n      Krewinkel, #8150). This is technically invalid HTML, but it can\n      be found in the wild and browsers handle it.\n\n  * Org reader (Albert Krewinkel):\n\n    + Recognize absolute paths on Windows (Albert Krewinkel, #8201).\n    + Recognize {webp,jxl} files as images (YI).\n    + Allow attrs for Org tables (Albert Krewinkel, #8049). Tables with\n      attributes are no longer wrapped in Div elements; attributes are added\n      directly to the table element.\n    + Support line selection in INCLUDE directives (Brian Leung, #8060).\n    + Fix Post / Pre mixup when setting emphasis chars (Amir Dekel, #8134).\n\n  * LaTeX reader:\n\n    + Support `\\includesvg` (#8027).\n    + Unescape characters in `\\lstinline` inside `\\passthrough` (#8179).\n    + Improve `mathEnvWith` (#8122). When converting e.g. an align\n      environment to an aligned environment inside a Math element, we need\n      to include a newline before the `\\end{aligned}`, since the previous\n      line might end in a comment.\n    + Fix treatment of extensions for `\\input` in LaTeX reader (#8092).\n      Previously we required a `.tex` extension, but TeX\n      allows any extension for `\\input` (as opposed to `\\include`).\n\n  * RTF reader:\n\n    + support `\\nosupersub` (#8170).\n\n  * TikiWiki reader:\n\n    + Support underlined text\n\n  * DocBook reader:\n\n    + Improved reading `<xref>` elements (Frerich Raabe, #8065).\n\n  * JATS reader:\n\n    + Strip `ref-` prefix from ref id in xref (#8007).\n    + Support edition in references (#8087).\n\n  * RIS reader:\n\n    + Make parser more forgiving (#8034). Allow blank lines after entries.\n      Allow entries with no space after the `-`, provided they\n      just have a newline, e.g. `DB -\\n`.\n    + Get right order of names (#8055).\n\n  * MediaWiki reader:\n\n    + Allow HTML comment after row start (#8110).\n\n  * DokuWiki reader:\n\n    + The `tex_math_dollars` extension is now supported for `dokuwiki`\n      (but off by default) (#8178).\n    + Content inside `<latex>...</latex>` is parsed as raw LaTeX inline,\n      and inside `<LATEX>..</LATEX>` as raw LaTeX block (#8178).\n    + The behavior of `<php>...</php>` is changed, so that instead of\n      producing a code block, it produces raw HTML with `<?php ... ?>`.\n\n  * LaTeX writer:\n\n    + Improve grouping with autocites (#8088).\n    + Extend list of book documentclasses (Wentau Han, #8053).\n    + Fix width of multicolumn cells (Albert Krewinkel, #8090).\n      Cells spanning multiple columns must be given an explicit width,\n      calculated from the table properties.\n    + Beamer: allow containsverbatim as alternative to fragile (#8080).\n\n  * HTML writer:\n\n    + Add 'footnotes' identifier to footnotes section (#8043).\n    + Fix bug with `--number-offset`. This formerly caused section divs\n      to be produced, even when `--section-divs` was not specified (#8097).\n    + Use CSS flexboxes for columns (Albert Krewinkel). This allows\n      an arbitrary number of columns, while the previous approach assumed\n      exactly two columns.\n    + Allow \"spanlike\" classes to be combined (see #8194). Previously\n      classes like \"underline\" and \"marked\" had to be the first class\n      in a span in order for the span to be interpreted as a \"ul\" or\n      \"mark\" element.  This commit allows these special classes to be\n      \"stacked,\" e.g. `[test]{.mark .underline}`; in addition, the\n      special classes are no longer required to come first in the list\n      of classes.\n    + Avoid doubled style attribute when height and width are added to\n      style because of an image, but the image already has a style attribute\n      (#8047).\n    + Do not include the deprecated doc-endnote role (#8030).\n      doc-endnote was deprecated in DPUB-ARIA 1.1.\n    + Remove extra soft break for tasklist (black-desk, #8142).\n      Browser will display the extra newline character between checkbox and\n      text as a space, which make tasklist items cannot be aligned.\n\n  * EPUB writer:\n\n    + Allow choice of math method for v3 (#8164). Previously we always\n      used MathML for math in EPUB3, because the spec includes MathML.\n      But this is not widely supported by readers, so it seems better\n      to allow users to choose their math method as they can with\n      EPUB2 or HTML. **NOTE:** Existing workflows that produce EPUBv3\n      documents including math will be affected by this change.  You\n      must add `--mathml` to your command line if you want to continue\n      producing MathML.\n\n  * RST writer:\n\n    + Fix missing spaces with nested inlines (#8182).\n    + Always escape literal backslash (#8178).\n\n  * Ms writer:\n\n    + Add comment in preamble stating generator.\n    + Fix roff ms syntax highlighting definitions (#8175, thanks to\n      Branden Robinson).\n\n  * ConTeXt writer:\n\n    + Support complex table structures (Albert Krewinkel, #8116).\n      The following table feature are now supported in ConTeXt:\n\n      - colspans,\n      - rowspans,\n      - multiple bodies,\n      - row headers, and\n      - multi-row table head and foot.\n\n      The wrapping `placetable` environment is also given a `reference` option\n      with the table identifier, enabling referencing of the table from within\n      the document.\n    + Unify link handling (Albert Krewinkel, #8096).\n      Autolinks, i.e. links with content that's the same as the linked URL,\n      are now marked with the `\\url` command. All other links, both internal\n      and external, are created with the `\\goto` command, leading to shorter,\n      slightly more idiomatic code. As before, autolinks can still be styled\n      via `\\setupurl`, other links via `\\setupinteraction`.\n    + Use \"sectionlevel\" environment for headings (Albert Krewinkel, #5539).\n      The document hierarchy is now conveyed using the\n      `\\startsectionlevel`/`\\stopsectionlevel` by default. This makes it easy\n      to include pandoc-generated snippets in documents at arbitrary levels.\n      The more semantic environments \"chapter\", \"section\", \"subsection\", etc.\n      are used if the `--top-level-division` command line parameter is set to\n      a non-default value.\n\n  * Docx writer:\n\n    + Add `w:lang` to `rPr` for Span and Div with lang attribute, so\n      that Word can know that \"Apfel\" is not a spelling error (#8026).\n    + Prevent crashing when handling invalid tables (Albert Krewinkel, #8102).\n      Tables with different numbers of cells per row would sometimes crash\n      pandoc. This fix prevents this by cutting off overlong rows.\n\n  * ICML writer:\n\n    + Support custom-style attribute on Table (#8079).\n\n  * AsciiDoc writer:\n\n    + Fix commas in link text (#8070). Commas in link text trigger\n      interpretation of attributes. To block this, we replace them with\n      numeric entities.\n    + Fix underline. We were rendering it as `+++text+++`; this is now\n      changed to `[.underline]#text#`.  See comment at\n      <https://github.com/jgm/pandoc/issues/8070#issuecomment-1126883824>.\n\n  * FB2 writer:\n\n    + Fix handling of non-section Divs (#8123).\n\n  * Markdown writer:\n\n    + Disable soft wrapping when `hard_line_breaks` enabled (#8035).\n      We were already doing this for `markdown`; this commit does\n      the same thing for `markua` and `commonmark` and `gfm`.\n    + Avoid excessive indentation on bullet lists for `commonmark`,\n      `markua`, `gfm`.  They are now nested by 2 spaces instead of 4 (#8011).\n\n  * Text.Pandoc.Class:\n\n    + Add new function `findFileWithDataFallback` [API Change]\n      (Albert Krewinkel).\n    + `fillMediaBag`: Keep attributes of original image on Span (Albert\n      Krewinkel, #8099). Images that cannot be fetched are replaced with a\n      Span that contains the image's description. The span now also retains\n      all original image attributes and inherits all attributes of the image.\n      Furthermore, the classes `image` and `placeholder` are added, and path\n      and title are store in attributes `original-image-src` and\n      `original-image-title`, respectively.\n\n  * Text.Pandoc.Shared:\n\n    + `makeSections`: don't make a section for a div with class \"fragments\"\n      (#8098).\n    + Ensure that Nulls are ignored by `makeSection` and in segmenting\n      slides (#8155).\n    + Add `formatCode` function to Text.Pandoc.Shared [API change]\n      (Elliot Bobrow, #8129).\n    + `taskListItemToAscii`: handle asciidoctor's characters (#8011).\n      Asciidoctor uses different unicode characters for task\n      lists; we should recognize them too and be able to convert\n      them to ascii task lists in formats like gfm.\n    + Deprecate `deLink` and mark for later removal.\n\n  * Text.Pandoc.Writers.Shared:\n\n    + `toTableOfContents`: Don't replace links with empty spans in TOC (#8020).\n\n  * Text.Pandoc.Readers.Metadata:\n\n    + Ensure that metadata values w/o trailing newlines are\n      parsed as inlines, as the manual states.\n      Previously, they were parsed as inlines if they would\n      otherwise have been a single Plain or Para, but otherwise\n      left unchanged.  This led to some quirky results (e.g. #8143).\n      We now use the general function `blocksToInlines` from T.P.Shared.\n\n  * Text.Pandoc.Parsing:\n\n    + Simplify `gridTableWith'`, `gridTableWith` [API Change] (Albert\n      Krewinkel). The functions `gridTableWith` and `gridTableWith'` no\n      longer takes a boolean argument that toggles whether a table head\n      should be parsed: both, tables with heads and without heads, are\n      always accepted now.\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Extend `pandoc.system` module (Albert Krewinkel, #8184).\n      The module now has the additional functions `list_directory`,\n      `make_directory`, and `remove_directory`. This makes it easier to write\n      cross-platform scripts that need to inspect or modify the file system.\n    + Require pandoc-lua-marshal 0.1.7. Adds a `clone` methods to\n      Pandoc objects and allows to pass Blocks in instead of full\n      Caption elements.\n    + Add fields `pandoc.readers` and `pandoc.writers` (#8177).\n      The set of supported input and output formats is made available to Lua\n      users.\n    + Ensure that tables marshaled via JSON arrays behave like Lists.\n      This allows to invoke methods like `map` and `includes` on lists like\n      `PANDOC_WRITER_OPTIONS.extensions`.\n    + Require hslua-2.2.1, unless lua53 flag is set, and do not reset\n      foreign encoding before running Lua. This fixes a problem where\n      the encoding used for Lua filenames would sometimes mismatch the\n      encoding used by the OS.\n    + Simplify module loading code. Modules are now loaded directly;\n      the special pandoc Lua package searcher is no longer necessary and\n      has been removed.\n    + Add function pandoc.mediabag.fill (#8104). The function allows to\n      fill the mediabag with all images in a given document. Images that\n      cannot be fetched are replaced with a Span containing the\n      image description.\n\n  * Populate mediabag after filters have run (Albert Krewinkel, #8099).\n    The mediabag is filled with document resources after the filters have\n    run. This allows, for example, filter authors to modify image paths\n    before pandoc tries to fetch the images.\n    Lua filters that rely on a filled mediabag can use the new\n    `pandoc.mediabag.fill` function to perform that action in the filter.\n\n  * Ms template: redefine rather than removing .CH macro (#8175).\n\n  * JATS template (Albert Krewinkel, except as noted):\n\n    + Include particles, prefix, suffix in names.\n    + Mark authors with cor-id as corresponding authors.\n      Corresponding authors are marked by setting the attribute\n      `corresp=\"yes\"` in their respective `<contrib>` element.\n    + Unconditionally include permissions element (#8040).\n      Fixes a bug that caused license information to be omitted when no\n      copyright information was provided.\n    + Follow JATS4R recommendation and PudMed Central for license URI\n      (Castedo Ellerman, #8041).\n\n  * LaTeX template:\n\n    + Rename  `\\textormath` to `\\TextOrMath` (Hos Es, #8036).\n    + Fix links-as-notes (Albert Krewinkel, #8077).\n\n  * HTML template styles:\n\n    + Remove `span.underline` rule. This is superfluous now that we\n      render Underline as `<u>`.\n    + Improve CSS for task lists (#8151).\n\n  * LaTeX template: Add `boxlinks` variable for LaTeX/PDF output (#8198).\n    If `boxlinks` is set but `colorlinks` is not, then boxes will\n    be printed around links (`hidelinks` will not be set in `hypersetup`).\n\n  * `--self-contained`: Handle `url()` in `<style>` elements (#8193).\n\n  * Text.Pandoc.PDF: use SHA1 hash of filename when converting SVG.\n    The previous code threw away the directory component of\n    the filename in constructing a new one. This led to\n    surprising results if you had e.g. `foo/pic.svg` and `bar/pic.svg`;\n    in the final PDF they'd be the same image, because the latter\n    would overwrite the former in the temp directory.\n\n  * Remove Muse reader round-trip tests. These are nondeterministic and have\n    repeatedly failed on strange edge cases.\n\n  * Update fonts MIME following IANA recommendation (Gabriel Lewertowski,\n    #8127).\n\n  * Future compat change for `liftA2` export from Prelude (Georgi Lyubenov,\n    #8132).\n\n  * Update `default.csl` from the latest chicago-author-date.csl.\n\n  * Update manfilter.hs for greater portability (#8045).\n    The tables in our man pages were not rendering correctly\n    with mandoc, now used by default with macOS. mandoc doesn't\n    allow man formatting inside table cells. For maximum portability,\n    we now render the tables in plain format and include them as code\n    blocks in the man page.\n\n  * CI: update macos container version (#8197, Sukka).\n\n  * Add `nightly` flag. This causes a `-nightly-COMPILEDATE`\n    suffix to be added the the output of `--version` (#8016).\n    This is used in the nightly CI builds.\n\n  * Update dependencies (aeson, skylighting, pandoc-lua-marshall,\n    citeproc, texmath).\n\n  * Documentation improvements (thanks to Jiří Wolker,\n    Castedo Ellerman, Albert Krewinkel, Bastien Dumont, Cezar Drożak, Benjamin\n    Wuethrich, Ivan Panchenko, Sukil Etxenike, Masataka Ogawa).\n\n## pandoc 2.18 (2022-04-04)\n\n  * New input formats: `endnotexml` (EndNote XML bibliography),\n    `ris` (RIS bibliography).\n\n  * A RIS bibliography file may now be used with `--citeproc`.\n\n  * Citeproc: Allow a formatted bibliography to be placed in metadata fields\n    via a Div with class `refs` (#7969, #526).  Thus, one can include a\n    metadata field, say `refs`, whose content is an\n    empty div with id `refs`, and the formatted bibliography will be put into\n    this metadata field.  It may then be interpolated into a template using the\n    variable `refs`.\n\n  * Ensure that you don't get PDF output to terminal.  `-t pdf` now behaves\n    like `-t docx` and gives an error unless the output is redirected.\n\n  * `--version` now prints hslua version (#7929) and\n    Lua version (#7997, Albert Krewinkel).\n\n  * Change `--metadata-file` parsing so that, when the input format is not\n    markdown or a markdown variant, pandoc's markdown is used (#6832, #7926).\n    When the input format is a markdown variant, the same format is used.\n    Reason for the change: it doesn't make sense to run the markdown parser\n    with a set of extensions designed for a non-markdown format, and\n    this dramatically limits what people can do in metadata files.\n\n  * Trim whitespace from math in `--webtex` (#7892).\n    This fixes problems with --webtex and markdown output,\n    when display math starts or ends with a newline.\n\n  * `--self-contained`: issue warning rather than failing with an error\n    if a resource can't be found (#7904).\n\n  * New exported module Text.Pandoc.Readers.EndNote, exporting\n    `readEndNoteXML` and `readEndNoteXMLCitation` [API change].\n\n  * New exported module, Text.Pandoc.Readers.RIS, exporting `readRIS` (#7894)\n    [API change].\n\n  * LaTeX reader:\n\n    + Handle subequations as inline math environment (#7883).\n    + Rudimentary support for `vbox` (#7939).\n    + Support `\\today` (#7905).\n    + Handle `\\label` and `\\ref` for footnotes (#7930).\n    + Allow inline groups starting with `\\bgroup` (#7953).\n    + Use custom TokStream that keeps track of whether macros are expanded.\n      This allows us to improve performance a bit by avoiding unnecessary\n      runs of the macro expansion code (e.g. from 24 ms to 20 ms on\n      our standard benchmark).\n    + Further optimizations for inline parsing.\n    + Better handling of `\\usepackage`.  If the package is local but\n      causes parse errors, parse everything up to the error and skip the\n      rest.  Issue a `CouldNotParseIncludeFile` warning indicating that\n      parsing failed at that point.\n    + Text.Pandoc.Readers.LaTeX.Parsing: Monoid and Semigroup instances for\n      TokStream.\n\n  * HTML reader:\n\n    + Give warnings and emit empty note when parsing\n      `<a epub:type=\"noteref\">` and the identifier\n      doesn't correspond to anything in the note table (#7884).\n      Previously we just silently skipped these cases.\n    + Fix parsing of epub footnotes (#7884).\n\n  * DocBook reader:\n\n    + Handle complete set of entities as specified at\n      <https://www.w3.org/2003/entities/2007doc/byalpha.html> (#7938).\n    + Handle abstract in info section (#7747).\n    + Improve info parsing.\n    + Simplify metadata parsing code (#7747).\n      Handle abstract as block-level content.\n      Report skipped info elements with `--verbose`.\n    + Handle address and coyright in metadata (#7747).\n\n  * DokuWiki reader:\n\n    + Add DokuWiki table alignment (#5202, damon-sava-stanley).\n\n  * RST reader:\n\n    + Fix treatment of headerless simple tables (#7902).\n    + Wrap math in Span to preserve attributes (#7998, Albert Krewinkel).\n      Math elements with a name, classes, or other fields are wrapped in a\n      `Span` with these attributes.\n\n  * JATS reader:\n\n    + Improve handling of fn-group elements (#6348, Albert Krewinkel).\n      Footnotes in `<fn-group>` elements are collected and re-inserted into\n      the document as proper footnotes in the place where they are referenced.\n    + Handle `pub-date` (#8000).\n    + Support PMID, DOI, issue in citations (#7995).\n    + Improve refs parsing.  Handle `issn` and `isbn`; use simpler form\n      for issued date.\n    + Strip 'ref-' from ref id in constructing CSL id.  This allows better\n      round-tripping, because the JATS writer adds the `ref-` prefix to\n      the citation id to get the ref element's id.\n\n  * Org reader:\n\n    + Allow \":\" in property drawer keys (Lucas V. R).\n      Any non-space character is allowed as property drawer key, including \":\"\n      itself (so it is not really a delimiter). The real delimiter is a space\n      character, so in a drawer like\n      ```\n      :PROPERTIES:\n      ::k:ey:: value\n      :END:\n      ```\n      \":k:ey:\" is a key with value \"value\".\n\n    + Allow comments above property drawer.\n    + More flexible LaTeX environments (Lucas V. R).\n    + Handle `#+bibliography:` as metadata so that it can work with\n      `--citeproc`.\n    + Parse `#+print_bibliography:` as Div with id `refs`.\n    + Allow multiple `#+bibliography:`.\n\n  * Markdown reader:\n\n    + Allow one-column pipe tables with pipe on right (#7919).\n    + Remove restriction on identifiers, so they no longer need to\n      begin with a letter (#7920).\n\n  * Docx reader:\n\n    + Enable `citations` extension for docx reader (#7840).\n      When enabled, Zotero, Mendeley, and EndNote citations embedded in\n      a docx are parsed as native pandoc citations.\n      (When disabled, the generated citation\n      text and bibliography are passed through as regular text.)\n      The bibliography generated by the plugin is suppressed.\n      Instead, bibliographic data embedded in citation items is added\n      to the `references` metadata field so that it can be used\n      with `--citeproc`.\n\n  * Docbook writer:\n\n    + Interpret links without contents as cross-references (#7360, Jan Tojnar).\n      Links without text contents are converted to `<xref>` elements. DocBook\n      processors will generate appropriate cross-reference text when presented\n      with an xref element.\n\n  * Docx writer:\n\n    + Single numbering ID for examples (#7895, mjfs).\n      This change ensures that example list items all belong to a single\n      number sequence, so that if items are added or deleted in a word\n      processor, the other items will renumber automatically.\n    + Add bookmark with table id to table (#7989, Nikolai\n      Korobeinikov, #7285).  This allows tables with ids to be linked to.\n\n  * Ipynb writer:\n\n    + Handle metadata better (#7928).  Previously we used the markdown\n      writer to render metadata.  This had some undesirable consequences\n      (e.g. en dash expanded to `--` when `smart` enabled), so now we use\n      the plain writer.\n\n  * LaTeX writer:\n\n    + Avoid extra space before `\\CSLRightInline` (#7932).\n    + Add `scrreport` to `chaptersClasses` (#6168, ivardb).\n    + Support `page`,`trim`,`clip` attributes on images (#7181).\n    + Add `()` after booktabs rules (#8001).  These commands take optional\n      arguments with () and [], which can lead to problems if the content\n      of the table cell begins with these characters.\n\n  * RST writer:\n\n    + Support all standard metadata (\"bibliographic\") fields.\n\n  * HTML writer: performance improvements.\n\n  * Org writer:\n\n    + Stop indenting property drawers, quote blocks\n      (#3245, Albert Krewinkel).  This follows the current default org-mode\n      behavior.\n\n  * Markdown writer:\n\n    + Move table-related code into submodule (Albert Krewinkel).\n    + Don't produce redundant header identifier when the\n      `gfm_auto_identifiers` extension is set (#7941).\n    + Update escaping rules for `\\`.  We now escape `\\` only if `raw_tex`\n      is enabled or it is followed by a non-alphanumeric.\n\n  * JATS writer:\n\n    + Encode author \"others\" as `<etal/>` (Albert Krewinkel).\n      Citeproc adopted the BibTeX convention to use the author name \"others\"\n      when there are additional authors that are not named. JATS uses the\n      `<etal>` element for this.\n    + Avoid doubled ref-list element (#7990).  Previously when generating JATS\n      with the `element_citations` extension enabled, the references were\n      put in a doubly-nested ref-list element (`<ref-list><ref-list>...`).\n    + Keep edition info in element citations (#7993, Albert Krewinkel).\n    + Fix handling of CSL variable 'page' (not 'pages' as we had before).\n      It should go to 'lpage' and 'rpage', not 'page-range'.\n\n  * EPUB writer: refactor for clarity (#7991, Jonathan Dönszelmann,\n    Ola Wolska, Ivar de Bruin, Jaap de Jong).\n\n  * Custom writer (Albert Krewinkel):\n\n    + Support new-style Writer function (Albert Krewinkel).\n      See the documentation for custom writers for details.\n    + Produce stacktrace if Writer function fails\n\n  * Text.Pandoc.Logging: add `CouldNotParseIncludeFile` constructor\n    for `LogMessage` [API change].\n\n  * Text.Pandoc.Shared:\n\n    + Put id attributes on TOC entries (#7907, damon-sava-stanley).\n      Naming scheme of id is \"toc-\" + id of linked to header/section.\n      Effects HTML, Markdown, Powerpoint, and RTF.\n    + Define `ordNub` as alias for `nubOrd` from containers package (#7963,\n      Albert Krewinkel).\n    + Export `ensureValidXmlIdentifiers`.  This function changes identifiers\n      that don't start with letters, and internal links to these identifiers,\n      making them compatible with XML standards.  The change\n      is simple: we add `id_` to the front.  There is potential\n      for duplication if there are already `id_...` identifiers\n      defined, but this seems rare enough not to worry too much\n      about.\n\n  * Ensure that valid XML identifiers are used in Docbook, EPUB, FB2,\n    HTML4, S5, Slidy, Slideous, ICML, ODT, TEI writers.\n    Thus, if you convert `[anchor]{#1} and [link to](#1)`,\n    `id_1` will be used instead of `1` for the identifier.\n\n  * Lua (Albert Krewinkel).\n\n    + Add module `pandoc.layout` to format and layout text.\n    + Move custom writer code into Lua hierarchy.\n    + Use pandoc-lua-marshal 0.1.5.\n    +  Allow any type of callable object as argument to List\n       functions `filter`, `map`, and `find_if`. These previously\n       required the argument to be of type `function`, which was too\n       restrictive.\n    + Inline: the type of Image captions is now `Inlines` instead of `List`.\n    + Allow passing `Sources` to `pandoc.read` (#8002).\n\n  * Text.Pandoc.PDF:\n\n    + Restore `wkhtmltopdf` as default pdf engine for HTML (Albert Krewinkel).\n    + Allow custom writer as format if engine is explicitly specified (#7898,\n      Albert Krewinkel).  Note that it may be necessary to explicitly\n      specify a template on the command line.\n\n  * Text.Pandoc.MediaBag: improve detection of absolute paths (#7881).\n\n  * Text.Pandoc.Extensions:\n\n    + Remove `raw_tex` extension from list of commonmark extensions, and\n      from the `commonmark_x` defaults.  commonmark doesn't parse raw TeX,\n      and it doesn't make sense to write it if we don't parse it.\n    + Remove `native_divs` from allowed gfm extensions (#7965).  This allows\n      `<div>` to be suppressed using `-raw_html`.  Previously `native_divs`\n      was enabled but could not be suppressed, because it was not in the\n      list of available extensions for commonmark-based formats.\n\n  * Text.Pandoc.Parsing:\n\n    + Partition module into (internal) submodules (#7962, Albert Krewinkel).\n    + Unify grid table parsing (#7971, Albert Krewinkel).\n      Grid table parsing in Markdown and RST are updated use the same\n      functions. Functions are generalized to meet requirements for both\n      formats.  This change also lays the ground for further generalizations\n      in table parsers, including support for advanced table features.\n      [API change] in Text.Pandoc.Parsing:\n\n      - Parse results of functions `tableWith'` and `gridTableWith'` are now a\n        `mf TableComponents` instead of a quadruple of alignments, column\n        widths, header rows and body rows.\n      - Additional exports from Text.Pandoc.Parsing:\n        `tableWith'`, `TableComponents`, `TableNormalization`,\n        `toTableComponents`, `toTableComponents'`.\n\n  * Text.Pandoc.XML.Light: add versions of the parsers that allow\n    specifying a custom entity map.  Exports new functions:\n    `parseXMLElementWithEntities`, `parseXMLContentsWithEntities` [API change].\n\n  * Text.Pandoc.Writers.GridTable: improve module documentation (Albert\n    Krewinkel).\n\n  * Text.Pandoc.Parsing.GridTable: simplify column handling code (Albert\n    Krewinkel).\n\n  * Text.Pandoc.MIME: Add mime type for mkv extension (#7181).\n\n  * Text.Pandoc.Asciify: Fix regression with `ascii_identifiers` and Turkish\n    undotted i (#8003).\n\n  * Relax upper bound for hslua, allow hslua-2.2. (#7929)\n    Lua 5.4 is used by default after this is merged. Packagers may still\n    include Lua 5.3 instead by building pandoc with `--constraint='hslua <2.2'`.\n    Differences between 5.3 and 5.4 should not generally affect pandoc Lua\n    filters.  See list of incompatible changes here:\n    <https://www.lua.org/manual/5.4/manual.html#8.1>\n\n  * JATS template: allow multiple licenses (Albert Krewinkel).\n\n  * LaTeX template:\n\n    + Skip `\\babelprovide` if `babel-lang` is empty (#7945) to avoid an error.\n    + Move hyperref near end of preamble (#5811).  It now comes after\n      header-includes and right before title, author, date, abstract.\n      Note:  Users who presuppose hyperref in their header-includes\n      will now have to add `\\usepackage{hyperref}` to their header-includes\n      to make it available there.  (The redundant `\\usepackage` will\n      do no harm in this case.)\n    + Remove special redefinition of `\\sout`.  This used to be necessary to\n      avoid problems with hyperref, when headings contain strikeout text,\n      but it does not seem to be necessary any more (tested).\n\n  * Tests: improve location reporting of failing tests (Albert Krewinkel).\n\n  * Add tests for idempotency of `makeSections` (#7950).\n\n  * Add armhf support in linux build script (#7944, Tony).\n\n  * Use latest pandoc-types, so that toJSONFilter will work with\n    Meta and MetaValue.\n\n  * Use latest doclayout, texmath, commonmark, citeproc.\n\n  * INSTALL.md: add reference to install via winget (#7951, Guriy Samarin).\n\n  * MANUAL.txt:\n\n    - Document way to get list in block quote in slide shows (#7916).\n    - Minor changes to security section.\n    - Note that `smart` works for html input.\n    - Fix typos (#7934, Dimitris Apostolou).\n    - Fix documentation for citations and org mode.\n    - Remove claim that `--self-contained` does not work with `--mathjax`\n      (#682).\n\n  * doc/org.md: remove obsolete citations section.\n    This mostly described citation formats we no longer support.\n\n  * doc/lua-filters.md: Fix typo (#7981, Mario Lang).\n\n  * Makefile: Use cabal for default build\n\n  * Add `lua53` cabal flag.  It is false by default.  If set to true, compile\n    with hslua 2.1 and Lua 5.3, otherwise hslua 2.2 and Lua 5.4.\n\n\n## pandoc 2.17.1.1 (2022-01-31)\n\n  * Fix regression in 2.17.1 which caused problems finding\n    default files in the default user data directory.  (Reverts\n    the item \"logic bug in `fullDefaultsPath`\", which was\n    misguided.)\n\n  * Sample custom writer: use single quotes for strings (#7487,\n    Albert Krewinkel).\n\n## pandoc 2.17.1 (2022-01-30)\n\n  * Support `pagedjs-cli` as pdf engine (#7838, Albert Krewinkel).\n    PagedJS is a polyfill and supports the Paged Media standards by the W3C.\n    <https://www.pagedjs.org/>\n\n  * CommonMark reader: fix source position after YAML metadata (#7863).\n\n  * LaTeX reader:\n\n    + Remove retokenizing in `rawLaTeXParser`.\n    + Ensure that `\\raggedright` doesn't gobble an argument (#7757).\n    + Improve `descItem`.  For some reason we were skipping\n      arbitrary blocks before `\\item`.  This is now changed to \"skip\n      whitespace and comments.\"\n    + Improve handling of `\\newif`.  Adding a pair of braces around the\n      second argument of `\\def` prevents LaTeX from an emergency stop\n      on input like the following (#6096).\n      ```\n      \\newif\\ifepub\n      \\epubtrue\n      \\ifepub\n      hi\n      \\fi\n      ```\n\n  * Docx reader: Parse both Zotero citation and bibliography as\n    `FieldInfo` (#7840).\n\n  * LaTeX writer:\n\n    + Allow arbitrary frameoptions to be passed to a beamer\n      frame, using the frameoptions attribute (#7869).\n    + Add s and squeeze to recognized beamer frameoptions (#7869).\n\n  * Markdown writer: handle explicit column widths with pipe tables (#7847).\n    If a table has explicit column width information *and* the content\n    extends beyond the `--columns` width, we need to adjust the\n    widths of the pipe separators to encode this width information.\n\n  * Docx writer: Separate tables even with RawBlocks between (#7724,\n    Michael Hoffmann).  Adjacent docx tables need to be separated by an\n    empty paragraph. If there's a RawBlock between tables which renders\n    to nothing, be sure to still insert the empty paragraph so that\n    they will not collapse together.\n\n  * Man writer: use custom font V for inline code (#7506).\n    The V font is defined conditionally, so that it renders\n    like CB in output formats that support that, and like B\n    in those that don't (e.g. the terminal).\n    Aliases also defined for VI, VB, VBI.\n\n  * Asciidoc writer: Support checklists in asciidoctor writer (#7832,\n    Nikolai Korobeinikov, ricnorr).  The checklist syntax (similar to\n    `task_list` in markdown) seems to be an asciidoctor-only addition.\n\n  * HTML writer:\n\n    + Avoid duplicate \"style\" attributes on table cells (#7871).\n    + Don't break lines inside code elements.  With the new (default)\n      line wrapping of HTML, in conjunction with the default CSS which\n      includes `code { whitespace: pre-wrap; }`, spurious line\n      breaks could be introduced into inline code (#7858).\n\n  * Custom writer: preserve order of element attributes (#7489, Albert\n    Krewinkel).  Attribute key-value pairs are marshaled as AttributeList,\n    i.e., as a userdata type that behaves both like a list and a map. This\n    allows to preserve the order of key-value pairs.\n\n  * Switch to hslua-2.1 (Albert Krewinkel). This allows for some code\n    simplification and improves stability.\n\n  * Don't read files outside of user data directory (Even Brenden).\n    If a file path does not exist relative to the working directory, and\n    it does exist relative to the user data directory, but outside of\n    of the user data directory, do not read it. This applies to\n    `readDataFile` and `readMetadataFile` in PandocMonad and, by\n    extension, any module that uses these by passing them relative paths.\n\n  * Text.Pandoc.Class.`makeCanonical`: Correctly handle consecutive \"..\"s\n    at the beginning of a path (Even Brenden).  Prior to this commit,\n    `../../file` would evaluate to `file`, when it should be unchanged.\n\n  * Search for metadata files in `$DATADIR/metadata` (#7851, Even Brenden).\n    If files specified with `--metadata-file` are not found in the working\n    directory, look in `$DATADIR/metadata` (#5876).\n\n  * Text.Pandoc.Class: export `readMetadataFile` [API change] (#5876).\n\n  * Text.Pandoc.Error: export new `PandocCouldNotFindMetadataFileError`\n    constructor for `PandocError` [API change] (#5876).\n\n  * Avoid putting a frame around speaker notes in beamer (#7857).\n    If speaker notes (a Div with class 'notes') occur right\n    after a section heading, but above slide level, the\n    resulting `\\note{..}` caommand should not be wrapped in\n    a frame, as that will cause a spurious blank slide.\n\n  * CSS in HTML template: adjust #TOC and h1 on mobile (#7835, Mauro Bieg).\n\n  * Text.Pandoc.Readers.LaTeX.Parsing: don't export `totoks`.\n    Make the first param of `tokenize` a SourcePos instead of\n    SourceName, and use it instead of `totoks`.\n\n  * Text.Pandoc.Shared: Modify `stringify` so it ignores `[Citation]`\n    inside `Cite` (#7855).  Otherwise we'll sometimes get two copies of\n    things, one from the `citationPrefix` or `citationSuffix` and another\n    from the embedded fallback text.  When there is no fallback text,\n    we'll get no content.  However, it really isn't an alternative to just\n    rely on the result of running `query` on the embedded `Citation`s;\n    this will result in a jumble of text rather than anything structured.\n\n  * Omit `--enable-doc` in the cabal haddock invocation in\n    `tools/build-and-upload-api-docs.sh`.\n\n  * Text.Pandoc.App.Opt: fix logic bug in `fullDefaultsPath`.\n    Previously we would (also) search the default user data directory\n    for a defaults file, even if a different user data directory\n    was specified using `--data-dir`.  This was a mistake; if\n    `--data-dir` is used, the default user data directory should\n    not be searched.\n\n  * Text.Pandoc.Shared: `defaultUserDataDir` behavior change (#7842).\n    If the XDG data directory is not defined (e.g. because\n    it's not supported in the OS or HOME isn't defined), we\n    return the empty string instead of raising an exception.\n\n  * Update command tests to distinguish stderr and test exit status.\n\n  * MANUAL: add that speaker notes can be used with beamer (#7856).\n\n  * Update `build-and-upload-api-docs.sh`.\n\n  * Document `--trace` option.\n    Document `no-check-certificate` in defaults files.\n    Document 'sandbox' option for defaults files.  (#7873).\n\n  * Fix pattern syntax in sample readability custom reader.\n\n  * doc/custom-readers.lua: add example for \"readable HTML.\"\n\n  * Fix message in man page about where code can be found.\n\n  * `manfilter.lua`:  remove extra indent in table cells with code blocks.\n\n  * Fix lua-filters documentation for table column widths (#7864).\n\n  * epub.doc: Update links to KindleGen (#7846, Benson Muite, Mauro Bieg).\n    KindleGen has been deprecated and we need to link to archived versions.\n\n  * Use tables in defaults files documentation, so each\n    default option is paired with the corresponding command-line\n    option (Carsten Allefeld).\n\n  * Use skylighting 0.12.2.\n\n  * Add pandoc-lua-marshal to Nix shell (#7849, Even Brenden).\n\n\n## pandoc 2.17.0.1 (2022-01-14)\n\n  * Require pandoc-lua-marshal 0.1.3.1 (#7831, Albert Krewinkel).\n    Fixes a problem with `List.includes` and `List.find` that caused a\n    Lua stackoverflow and subsequent program crash.\n\n  * HTML template: load header-includes before math (#7833, Kolen Cheung).\n    MathJax expect the config comes before loading the MathJax script.\n    This change of order allows one to config MathJax via\n    header-includes, which loads before the MathJax script. Cf. #2750.\n\n  * When reading defaults file, stop at a line `...`.  This line signals\n    the end of a YAML document.  This restores the behavior we got with\n    HsYaml.  yaml complains about content past this line.  See\n    https://github.com/jgm/pandoc/issues/4627#issuecomment-1012438765\n\n  * Text.Pandoc.Citeproc: allow `notes-after-punctuation` to work with\n    numerical styles that use superscripts (e.g.\n    american-medical-association.csl), as well as with note styles. The\n    default setting of `notes-after-punctuation` is true for note styles\n    and false otherwise.  This restores a behavior of pandoc-citeproc\n    that wasn't properly carried over to Citeproc (#7826, cf.\n    jgm/pandoc-citeproc#384).\n\n  * Use commonmark-pandoc 0.2.1.2 (#7769).\n\n  * Add FAQ on images in ipynb containers (#7749, Kolen Cheung).\n\n## pandoc 2.17 (2022-01-12)\n\n  * Support `markua` as an output format (#1871, Tim Wisotzki and\n    Saumel Lemmenmeier). Markua is a markdown variant used by Leanpub.\n\n  * Add text wrapping for HTML output (#7764). Previously the HTML writer\n    was exceptional in not being sensitive to the `--wrap` option.  With\n    this change `--wrap` now works for HTML. The default (as with other\n    formats) is automatic wrapping.  Note that the contents of `script`,\n    `textarea`, and `pre` tags are always laid out with the `flush`\n    combinator, so that unwanted spaces won't be introduced if these occur\n    in an indented context in a template.\n\n  * Don't read sources until in/out format are verified (#7797).\n\n  * Issue error with `--list-extensions` for invalid formats (#7797).\n\n  * Make `--citeproc` recognize `.yml` as well as `.yaml` extensions\n    as YAML bibliography files (#7707, Jörn Krenzer).\n\n  * Use latest version of KaTeX with `--katex`.\n\n  * Fix parsing of footnotes in `--metadata-file` (#7813).  Previously\n    non-inline footnotes were not being parsed.\n\n  * ODT reader:\n\n    + Parse list-header as a list item (Tuong Nguyen Manh).\n\n  * Commonmark reader:\n\n    + Put sourcepos attribute on header, not enclosing div\n      with `-f commonmark+sourcepos` (#7769).\n\n  * Markdown reader:\n\n    + Don't allow `^` at beginning of link or image label (#7723).\n      This is reserved for footnotes. Fixes regression from 0a93acf.\n    + Fix parsing of \"bare locators\" after author-in-text citations.\n      Previously `@item [p. 12; @item2]` was incorrectly parsed as\n      three citations rather than two.  This is now fixed by ensuring\n      that `prefix` doesn't gobble any semicolons.\n    + Revert changes to `inlinesInBalancedBrackets` (commit fa83246),\n      which caused regressions.\n    + Improve detection of pipe table line widths (#7713).  Fixed\n      calculation of maximum column widths in pipe tables.  It is\n      now based on the length of the markdown line, rather than a\n      \"stringified\" version of the parsed line.  This should be\n      more predictable for users. In addition, we take into account\n      double-wide characters such as emojis.\n\n  * Custom (Lua) readers:\n\n    + First argument is now a list of sources instead of the\n      concatenated text (Albert Krewinkel).  The list\n      structure can easily be converted to a string by applying\n      `tostring`, but it is also possible to access the elements\n      (each with a `text` and `name`). A small example is added\n      to the custom reader documentation, showcasing its use in a\n      reader that creates a syntax-highlighted code block for\n      each source code file passed as input. Existing readers\n      will still work through a fallback mechanism, issuing a\n      deprecation notice.\n\n  * Org reader:\n\n    + Parse official org-cite citations (#7329). We also support the older\n      org-ref style as a fallback. We no longer support the\n      \"markdown style\" or \"Berkeley style\" citations.\n    + Support alphabetical (fancy) lists (Lucas Viana). When the\n      `fancy_lists` extension is enabled, alphabetical list markers are\n      allowed, mimicking the behaviour of Org Mode when\n      `org-list-allow-alphabetical` is enabled.\n    + Support counter cookies in lists (Lucas Viana). Such cookies are\n      used to override the item counter in ordered lists. In org it is\n      possible to set the counter at any list item, but since Pandoc AST\n      does not support this, we restrict the usage to setting an offset for\n      the entire ordered list, by using the cookie in the first list item.\n    + Allow trailing spaces after key/value pairs in directives (Albert\n      Krewinkel). Ensures that spaces at the end of attribute directives like\n      `#+ATTR_HTML: :width 100%` (note the trailing spaces) are accepted.\n\n  * LaTeX reader:\n\n    + Omit visible content for `\\label{...}`. Previously we\n      included the text of the label in square brackets, but this is\n      undesirable in many cases. See discussion in\n      <https://github.com/jgm/pandoc/issues/813#issuecomment-978232426>.\n    + Improve references (#813). Resolve references to theorem environments.\n      Remove the Span caused by \"label\" in figure, table, and theorem\n      environments; this had an id that duplicated the environments' id.\n    + Fix semantics of `\\ref`. We were including the ams\n      environment type in addition to the number. This is proper\n      behavior for `\\cref` but not for `\\ref`.  To support `\\cref`\n      we need to store the environment label separately.\n    + Add babel mappings for Guajati (gu) and Oriya (or) (#7815).\n    + Fix typo `panjabi` -> `punjabi` in babel mappings (#7814).\n\n  * HTML reader:\n\n    + Parse attributes on links and images (#6970).\n\n * Docx reader:\n\n    + Handle multiple pic elements inside a drawing (#7786).\n    + Change `elemToParPart` to return `[ParPart]` instead of `ParPart`.\n      Also remove `NullParPart `constructor, as it is no longer\n      needed. This will allow us to handle elements that contain\n      multiple ParParts, e.g. `w:drawing` elements with multiple `pic:pic`.\n\n  * DocBook reader:\n\n    + Collapse internal spaces in literal and other similar tags (#7821),\n      as the standard docbook toolchain does.\n    + Be sensitive to spacing=\"compact\" in lists (#7799). When\n      `spacing=\"compact\"` is set, Para elements are turned into Plain,\n      so we get a \"tight\" list.\n\n  * Markdown writer:\n\n    + Add new exported function `writeMarkua` from Text.Pandoc.Writers.Markdown\n      [API change] (#1871, Tim Wisotzki and Saumel Lemmenmeier).\n    + Fix indentation issue in footnotes (#7801).\n    + Avoid extra space before citation suffix if it already starts\n      with a space.\n    + Ensure semicolon between the locator and the next citation when an\n      author-in-text citation has a locator and following citations.\n    + Improve escaping for `#` (#7726).\n\n  * Custom (Lua) writers:\n\n    + Allow variables to be set via second return value of `Doc`\n      (#6731, Albert Krewinkel). New templates variables can be added by\n      giving variable-value pairs as a second return value of the\n      global function `Doc`. Example:\n      ```\n      function Doc (body, meta, vars)\n        vars.date = vars.date or os.date '%B %e, %Y'\n        return body, vars\n      end\n      ```\n    + Provide global `PANDOC_WRITER_OPTIONS` (#6731, Albert Krewinkel).\n    + Assign default Pandoc object to global `PANDOC_DOCUMENT` (Albert\n      Krewinkel). The default Pandoc object is now non-strict, i.e., only\n      the parts of the document that are accessed will be marshaled to Lua.\n      A special type is no longer necessary. This change also makes it\n      possible to use the global variable with library functions such as\n      `pandoc.utils.references`, or to inspect the document contents with\n      `walk()`.\n\n  * LaTeX writer:\n\n    + Fix typo `panjabi` -> `punjabi` in babel mappings (#7814).\n\n  * MediaWiki writer:\n\n    + Remove redundant display text for wiki links (Jesse Hathaway).\n\n  * Docx writer:\n\n    + Handle bullets correctly in lists by not reusing numIds\n      (#7689, Michael Hoffmann).  This fixes a bug in which a Div in\n      a list item would receive bullets on its contained paragraphs.\n\n  * Org writer:\n\n    + Fix list items starting with a code block or other non-paragraph\n      content (#7810).\n    + Avoid blank lines after tight sublists (#7810).\n    + Fix extra blank line inserted after empty list item (#7810).\n    + Don't add blank line before lists (#7810).\n    + Support starting number cookies (Lucas Viana).  This is necessary\n      for lists that start at a number other than 1.\n    + Support the new org-cite syntax (#7329).\n\n  * Haddock writer:\n\n    + Avoid blank lines after tight sublists (#7810).\n\n  * Ipynb writer:\n\n    + Ensure deterministic order of keys.\n    + Handle cell output with raw block of markdown (#7563, Kolen Cheung).\n      Write RawBlock of markdown in code-cell output. This is designed\n      to fit the behavior of #7561, which makes the ipynb reader parse\n      code-cell output with mime \"text/markdown\" to a RawBlock of markdown.\n      This commit makes the ipynb writer writes this RawBlock of markdown\n      back inside a code-cell output with the same mime, preserving this\n      information in round-trip.\n    + In choosing between multiple output options, always favor\n      those marked with the output format over images (Kolen Cheung).\n      Previously, both `fmt == f` case and Image have a rank of 1.\n\n  * Ipynb reader & writer: properly handle cell \"id\" (#7728).\n    This is passed through if it exists (in Nb4); otherwise\n    the writer will add a random one so that all cells have an \"id\".\n\n  * Ms writer:\n\n    + Properly encode strings for PDF contents (#7731).\n\n  * JATS writer:\n\n    + Keep quotes in element-citations (Albert Krewinkel).\n      Fixed a bug that lead to quote characters being lost in\n      element-citations.\n\n  * RTF writer:\n\n    + Properly handle images in data URIs (#7771).\n\n  * Commonmark writer:\n\n    + Allow ')' delimiters on ordered lists.\n\n  * RST writer:\n\n    + Avoid extra blank line after empty list item (#7810).\n\n  * HTML writer:\n\n    + Make line breaks more consistent. With `--wrap=none`, we now\n      output line breaks between block-level elements. Previously they\n      were omitted entirely, so the whole document was on one line, unless\n      there were literal line breaks in pre sections.  This makes\n      the HTML writer's behavior more consistent with that of\n      other writers. Also, regardless of wrap settings,\n      put newline after `<dd>` and after block-level elements in\n      the footnotes section. And add a line break between an `img` tag\n      and the associated `figcaption`.\n    + reveal.js: Make sure images with `r-stretch` are not in p tags.\n      They must be direct children of the section. There was previously\n      code to make this work with the older class name `stretch`, but\n      the name has changed in reveal.js.\n    + reveal.js:  don't add `r-fit-text` class to section. It must go on\n      the header only.\n\n  * AsciiDoc writer:\n\n    + Improve detection of intraword emphasis (#7803).\n\n  * OpenDocument writer:\n\n    + Fix vertical alignment bug with display math (#7777).  Previously some\n      displayed formulas would be floated above a preceding text line.\n      This is fixed by setting `vertical-rel` to `text` rather than\n      `paragraph-content`.\n\n  * JATS template (Albert Krewinkel):\n\n    + Fix position of contrib affiliations in authoring set. Any\n      `<aff>` element must come before any `<email>` element.\n    + Fix affiliation tagging in `articleauthoring` output.\n      Affiliations were `xlink`ed even in the articleauthoring tag set, but\n      `<aff>` are not allowed as children of `contrib-group` elements in that\n      tag set. Each affiliation must be listed directly in the contrib\n      element.\n    + Add support for article subtitles.\n\n  * EPUB template:\n\n    + Include abstract in default template.\n    + Ensure that the essential styles needed by pandoc (`styles.html`\n      partial) are included in the templates. This is important for correct\n      formatting of CSL bibliographies. Note that much of the styling in\n      `styles.html` will be ignored for EPUB, because of the conditional on\n      `document-css`.  Setting the `document-css` variable will cause it\n      not to be ignored.\n\n  * HTML template:  Add abstract (#7588, Jannik Buhr, John MacFarlane).\n    By default, a localized title (the word \"Abstract\") will be\n    used, unless the variable `abstract-title` is set.\n\n  * ConTeXt template:  Make title appear in PDF title bar.  This is\n    recommended for accessibility reasons.  Note: doesn't work with macOS\n    Preview.app.\n\n  * `reference.pptx`: change to use 16:9 aspect ratio, Powerpoint's default.\n\n  * Text.Pandoc.Writers:\n\n    + Do not export `writeCustom` [API change]. This ensures that all\n      writers exported in T.P.Writers are parameterized and work with any\n      `PandocMonad` type. This is consistent with T.P.Readers, as\n      `readCustom` is not exported from that module either.\n\n  * Text.Pandoc.Writers.Shared:\n\n    + `endsWithPlain` now returns True if the list ends with a list\n      that ends with a Plain, and so on recursively (#7810).\n\n  * Text.Pandoc.Class.IO:\n\n    + `writeMedia`:  unescape percent-encoding in creating file path.\n      This addresses a problem with spaces in image filenames\n      when creating PDFs (#7819); it also affects `--extract-media`.\n\n  * New internal module Text.Pandoc.Writers.Blaze, exporting `layoutMarkup`.\n    This converts a blaze Html structure into a doclayout Doc Text.\n\n  * Text.Pandoc.Extensions:\n\n    + `parseFormatSpec`: cleaner error message for invalid extensions.\n\n  * Text.Pandoc.MediaBag:\n\n    + Fix bug in `extractMedia`, which caused the test for `..`\n      in paths to fail, with the result that images with `..`\n      in the path name could be extracted outside of the\n      directory specified by `extractMedia`. It also led a check for\n      `media` in resource paths to fail in the docx reader.\n\n  * Text.Pandoc.Citeproc:\n\n    + Avoid adding comma before an author-in-text citation in a note\n      if it begins with a title (no author) (#7761).\n    + Text.Pandoc.Citeproc.Locator now exports `toLocatorMap`,\n      `LocatorInfo`, and `LocatorMap`.  The type of `parseLocator`\n      has changed, so it now takes a `LocatorMap` rather than a `Locale`\n      as parameter, and returns a `LocatorInfo` instead of a tuple.\n    + Fix citation locator detection for German.  `toLocatorMap` now\n      stores keys case-folded. We want to do a case-insensitive\n      comparison when parsing locators, so that e.g. both\n      `Chap.` and `chap.` work. Previously we case-folded terms\n      when doing the lookup, but they weren't case-folded in the\n      map itself, which led to locator-detection breaking for\n      German (where the terms have uppercase letters).\n\n  * Lua (Albert Krewinkel):\n\n    + Allow single elements as singleton MetaBlocks/MetaInlines. Single\n      elements should always be treated as singleton lists in the Lua\n      subsystem.\n    + Add `pandoc.template` module. The module provides a `compile`\n      function to use strings as templates.\n    + Add `pandoc.WriterOptions` constructor.\n    + Add function `pandoc.write`.\n    + Provide global `PANDOC_WRITER_OPTIONS` (#5221).\n    + The function Text.Pandoc.Filter.applyFilters now takes a filter\n      environment of type `Environment`, instead of a ReaderOptions value\n      [API change].\n    + The `Environment` type is exported from Text.Pandoc.Filter\n      and allows to combine ReaderOptions and WriterOptions in a single\n      value [API change].\n    + Global, exported from Text.Pandoc.Lua, has a new type constructor\n      `PANDOC_WRITER_OPTIONS` [API change].\n    + Add constructors `pandoc.Blocks` and `pandoc.Inlines`.\n      The functions convert their argument into a list of Block and Inline\n      values, respectively. When applied to a string, they split the\n      string into `Str` elements separated by `Space` or `SoftBreak`\n      (#7712).\n    + Support topdown traversals The traversal order of filters can now\n      be selected by setting the key `traverse` of the filter to either\n      `'topdown'` or `'typewise'`; the default remains `'typewise'`.\n      Topdown traversals can be cut short by returning `false` as a\n      second value from the filter function. No child-element of the\n      returned element is processed in that case.\n    + Marshal ReaderOptions field `extensions`, `track_changes` via JSON.\n      Extensions are now available as a list of strings; the track-changes\n      settings are given as the kebab-case representation used in JSON.\n    + Allow binary (byte string) readers to be used with `pandoc.read`.\n    + Use global state when parsing documents in `pandoc.read`.\n      The function `pandoc.read` is updated to use the same state that was\n      used while parsing the main input files. This ensures that log\n      messages are preserved and that images embedded in the input are\n      added to the mediabag.\n    + Cleanup stack in `peekReadOptionsTable`. A ReaderOptions element was\n      left on top of the stack when the `peekReadOptionsTable` function\n      was invoked.\n    + `walk` methods are added to `Pandoc`, `Block`, `Inline`,\n      `Blocks`, `Inlines` values; the methods are similar to\n      `pandoc.utils.walk_block` and `pandoc.utils.walk_inline`, but\n      apply to filter to the element's contents.\n    + Functions of name `Doc` are no longer accepted as alternatives for\n      `Pandoc` filter functions. This functionality was undocumented.\n    + Improve handling of empty caption, body by `from_simple_table`\n      #7776). Create truly empty table caption and body when these are\n      empty in the simple table.\n    + Change representation of `TableHead`, `TableFoot`, and `Row` values\n      (#7718).  The objects now also follow the principle that element\n      attributes are accessible through the `.attr` field. Rows in `TableHead`\n      and `TableFoot` are available via the `.rows` field. Row objects have a\n      `.cells` field, containing the list of table cells.\n    + [Simplify](Simplify) code of `pandoc.utils.stringify`. Minor behavior change:\n      plain strings nested in tables are now included in the result string.\n    + Simplify and deprecate function `pandoc.utils.equals`. The function\n      is no longer required for element comparisons; it is now an alias\n      for the `==` operator.\n    + Add function `pandoc.utils.references` (#7752).\n    + Add new library function `pandoc.utils.type`.  The function behaves\n      like the default `type` function from Lua's standard library,\n      but is aware of pandoc userdata types. A typical use-case would be\n      to determine the type of a metadata value.\n    + Fix return types of `blocks_to_inlines`, `make_sections`.\n      Ensures the returned lists have the correct type (`Inlines` and\n      `Blocks`, respectively).\n    + Use more natural representation for Reference values\n      Omit `false` boolean values, push integers as numbers.\n\n  * Lua: use package pandoc-lua-marshal (#7719, Albert Krewinkel).\n    The marshaling functions for pandoc's AST are extracted into a separate\n    package. The package comes with a number of changes:\n\n    + Pandoc's List module was rewritten in C, and error messages were\n      improved.\n    + Lists of `Block` and `Inline` elements are marshaled using the new\n      list types `Blocks` and `Inlines`, respectively. These types\n      currently behave identical to the generic List type, but give better\n      error messages. This also opens up the possibility of adding\n      element-specific methods to these lists in the future.\n    + Elements of type `MetaValue` are no longer pushed as values which\n      have `.t` and `.tag` properties. This was already true for\n      `MetaString` and `MetaBool` values, which are still marshaled as Lua\n      strings and booleans, respectively. Affected values:\n      - `MetaBlocks` values are marshaled as a `Blocks` list;\n      - `MetaInlines` values are marshaled as a `Inlines` list;\n      - `MetaList` values are marshaled as a generic pandoc `List`s.\n      - `MetaMap` values are marshaled as plain tables and no longer\n        given any metatable.\n    + `Cell` values are now marshaled as userdata objects; a constructor\n      function for table cells is provided as `pandoc.Cell`.\n    + The test suite for marshaled objects and their constructors has\n      been extended and improved.\n    + A bug in `Citation` objects, where setting a citation's suffix\n      modified it's prefix, has been fixed.\n    + Inlines, Blocks, and List objects now have an `__eq` metamethod,\n      testing equality by comparing two lists element-wise.\n\n  * Powerpoint tests: shorten lines by grouping tests (Albert\n    Krewinkel). This makes the test output more pleasant to read\n    in narrow terminal windows.\n\n  * make check: check for unreleased dependencies.\n\n  * Add `tools/build-and-upload-api-docs.sh`.\n\n  * Update cabal description.\n\n  * `MANUAL.txt`: Add section on EPUB styling.\n\n  * `MANUAL.txt`: clarify \"standard Markdown\" as \"original Markdown\"\n    (#7802, Martin Fischer).\n\n  * `doc/custom-writers.md`: use filter to include source of example.\n\n  * Add an example to `doc/custom-readers.md`.\n\n  * Fix typo in `custom-readers.md` (#7722, Mauro Bieg).\n\n  * `doc/jats.md`: add link to JATS documentation (Martin Fischer).\n\n  * `doc/lua-filters.md`: many improvements (Albert Krewinkel,\n    John MacFarlane).\n\n  * Use commonmark-extensions 0.2.3. This allows a bare-word class attribute\n    on fenced divs.\n\n  * Use ipynb 0.2.\n\n  * Use citeproc 0.6.0.1.\n\n  * Use texmath 0.12.4.\n\n  * Use doctemplates 0.10.0.1.\n\n## pandoc 2.16.2 (2021-11-21)\n\n  * Add interface for custom readers written in Lua (#7669).\n    Users can now do `-f myreader.lua` and pandoc will treat the\n    script `myreader.lua` as a custom reader, which parses an input\n    string to a pandoc AST, using the pandoc module defined for\n    Lua filters.  A sample custom reader can be found in `data/creole.lua`.\n    Also see documentation in `doc/custom-readers.md`.\n\n  * New module Text.Pandoc.Readers.Custom, exporting `readCustom` [API change].\n\n  * Allow `plain` to be used in raw attribute syntax.\n\n  * Accept empty `--metadata-file` (#7675).\n    This was a regression from 2.15 behavior.\n\n  * Markdown reader: Improve `inlinesInBalancedBrackets`.\n    This is just a small improvement in terms of performance, but it's simpler\n    and more direct code.  Also, we avoid parsing interparagraph spaces in\n    balanced brackets, as the original did.\n\n  * BibTeX reader: Properly handle commented lines in BibTeX/BibLaTeX (#7668).\n\n  * RST reader: handle class attribute for for custom roles (#7699,\n    willj-dev).  Previously the class attribute was ignored, and the name\n    of the role used as the class.\n\n  * DocBook reader:\n\n    + Add `<titleabbr>` support (Rowan Rodrik van der Molen).\n    + Support for `<indexterm>` (#7607, Rowan Rodrik van der Molen).\n\n  * LaTeX reader:\n\n    + Add rudimentary support for `\\autoref` (#7693).\n    + Add 'uri' class when parsing `\\url`, for consistency\n      with treatment of autolinks in other formats (#7672).\n\n  * JATS reader: Capture `alt-text` in figures (#7703, Aner Lucero).\n\n  * MediaWiki writer: use HTML spans for anchors when header has id (#7697).\n    We need to generate a span when the header's ID doesn't match\n    the one MediaWiki would generate automatically.  Note that MediaWiki's\n    generation scheme is different from pandoc's (it uses uppercase letters,\n    and `_` instead of `-`, for example).  This means that in going from\n    markdown to mediawiki, we'll now get spans before almost every heading,\n    unless explicit identifiers are used that correspond to the ones MediaWiki\n    auto-generates.  This is uglier output but it's necessary for internal\n    links to work properly.\n\n  * Markdown writer: don't create autolinks when this loses information\n    (#7692).  Previously we sometimes lost attributes when rendering links\n    as autolinks.\n\n  * Text.Pandoc.Readers.Metadata: allow multiple YAML documents when parsing\n    YAML for `yamlBsToRefs`.  Some people use `---` as the end delimiter in\n    YAML bibliography files, which causes the `yaml` library to emit an\n    error unless we explicitly allow multiple YAML documents (and just\n    consider the first).\n\n  * JATS writer:\n\n    + Ensure figures are wrapped with `<p>` in list items\n      (Albert Krewinkel).  This prevents the generation of invalid output.\n    + Add URL to element citation entries (Albert Krewinkel).\n      The URL of a reference, if present, is added in tag `<uri>` to\n      element-citation entries.\n\n  * HTML writer: Don't create invalid `data-` attribute for empty\n    attribute key (#7546).\n\n  * LaTeX writer:\n\n    + Babel mappings: use `ancientgreek` for `grc`.\n    + With `-t latex-smart`, don't generate `\\ldots` from ellipsis (#7674).\n      Instead just use unicode ellipsis.\n\n  * JATS template: fix `equal-contrib` attribute (Albert Krewinkel).\n    The standard requires the value to be either `yes` or `no`, but is was\n    set to `true` for authors who contributed equally.\n\n  * reveal.js template: Add `disableLayout` variable (Christophe Dervieux).\n\n  * Text.Pandoc.Error: sort errors in `handleError` by exit code\n    (Albert Krewinkel).\n\n  * Text.Pandoc.Writers.Shared: Improve toLegacyTable (#7683,\n    Christian Despres).\n\n  * Lua subsystem:\n\n    + Include lpeg module (#7649, Albert Krewinkel).  Compiles the `lpeg`\n      library (Parsing Expression Grammars For Lua) into\n      the program.  Package maintainers may choose to rely on package\n      dependencies to make lpeg available, in which case they can compile\n      the with the constraint `lpeg +rely-on-shared-lpeg-library`.\n      `lpeg` and `re` are always made available in global variables,\n      without the need for a `require`.\n\n    + Set `lpeg` and `re` as globals; allow shared lib access via `require`.\n      The `lpeg` and `re` modules are loaded into globals of the respective\n      name, but they are not necessarily registered as loaded packages. This\n      ensures that\n\n      - the built-in library versions are preferred when setting the globals,\n      - a shared library is used if pandoc has been compiled without `lpeg`,\n        and\n      - the `require` mechanism can be used to load the shared library if\n        available, falling back to the internal version if possible and\n        necessary.\n\n    + Fix argument order in constructor `pandoc.Cite` (Albert Krewinkel).\n      This restores the old behavior; argument order had been switched\n      accidentally in pandoc 2.15.\n\n    + Add Pushable instance for `ReaderOptions` (Albert Krewinkel).\n\n    + Allow to pass custom reader options to `pandoc.read` as an\n      optional third argument (#7656, Albert Krewinkel).\n      The object can either be a table or a ReaderOptions value\n      like `PANDOC_READER_OPTIONS`. Creating new ReaderOptions objects is\n      possible through the new constructor `pandoc.ReaderOptions`.\n\n    + Display Pandoc values using their native Haskell representation\n      (Albert Krewinkel).\n\n    + Require latest hslua (2.0.1) (#7661, #7657, Albert Krewinkel).\n      This fixes issues with\n\n      - misleading error messages when a required function parameter is\n        omitted;\n      - absent properties still being listed in the output of `pairs`; and\n      - alias accessing leading to errors instead of returning `nil`, e.g.\n        with `(pandoc.Str '').identifier`.\n\n    + Add missing space in \"package not found\" message (#7658, Albert\n      Krewinkel).\n\n  * Update build files (#7696, Fabián Heredia Montiel).\n    Drop old windows 32-bit constraints.\n    Update cabal `tested-with` field to correspond to `ci.yml` matrix\n\n  * Remove unneeded package dependencies from benchmark target.\n\n  * Require ghc >= 8.6, base >= 4.12.\n    This allows us to get rid of the old custom prelude and\n    some crufty cpp.  But the primary reason for this is that\n    conduit has bumped its base lower bound to 4.12, making it\n    impossible for us to support lower base versions.\n\n  * Require Cabal 2.4.  Use wildcards to ensure that all pptx tests are\n    included (#7677).\n\n  * Update `bash_completion.tpl` (S.P.H.).\n\n  * Add `data/creole.lua` as sample custom reader.\n\n  * Add `doc/custom-readers.md` and `doc/custom-writers.md`.\n\n  * `doc/lua-filters.md`: add section on global modules, including lpeg\n    (Albert Krewinkel).\n\n  * `MANUAL.txt`: update table of exit codes and corresponding errors\n    (Albert Krewinkel).\n\n  * Use latest texmath.\n\n## pandoc 2.16.1 (2021-11-02)\n\n\n  * Docx reader:  don't let first line indents trigger block quotes (#7655).\n    This fixes a regression introduced in pandoc 2.15.\n\n  * Docx writer: use `getTimestamp` for modification times in\n    reference.docx (#7654).  This ensures that when `SOURCE_DATE_EPOCH` is\n    set, the modification times of files taken from the reference.docx will\n    be set deterministically, allowing for reproducible builds.\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Load module `pandoc.path` on startup (#7524).  Previously the module\n      always had to be loaded via `require 'pandoc.path'`.\n    + Fix typo in SoftBreak constructor.\n    + Re-add `content` property to Strikeout elements.\n      Fixes a regression introduced in 2.15.\n    + Be more forgiving when retrieving the Image `caption` property.\n      Fixes a regression introduced in 2.15.\n    + Display Attr values using their native Haskell representation.\n    + Allow omitting the 2nd parameter in pandoc.Code constructor.\n      Fixes a regression introduced in 2.15 which required users to always\n      specify an Attr value when constructing a Code element.\n    + Allow to compare, show Citation values.  Comparisons of Citation\n      values are performed in Haskell; values are equal if they represent\n      the same Haskell value. Converting a Citation value to a string\n      now yields its native Haskell string representation.\n    + Restore List behavior of MetaList (#7650).  Fixes a regression\n      introduced in 2.16 which had MetaList elements lose\n      the `pandoc.List` properties.\n    + Restore `content` property on Header elements.\n    + Ensure Block elements have all expected properties.\n    + Ensure Inline elements have all expected properties.\n\n  * Allow tasty-bench 0.3.x.\n\n## pandoc 2.16 (2021-10-31)\n\n  * Switch back from HsYAML to yaml for parsing YAML metadata (#6084).\n    HsYAML is around 20 times slower in parsing large YAML bibliographies.\n    In addition, HsYAML is not being actively maintained.  This sets us back\n    in our attempts to free ourselves from C dependencies (#4535).  But I\n    don't see a good alternative until a faster pure Haskell parser is available.\n    Notes:\n\n    + We've removed the FromYAML instances for all types that had them, since\n      this is a HsYAML-specific typeclass [API change].  (The yaml package just\n      uses From/ToJSON instead of having a dedicated From/ToYAML class.)\n    + Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N',\n      'Yes', 'No', 'On', 'Off' as boolean values.  Users may need to quote these\n      when they are meant to be interpreted as strings.  Similarly, 'null' is\n      parsed as a YAML null value (and will be treated as an empty string by\n      pandoc rather than the string 'null').  Quoting it will force it to be\n      interpreted as a string.\n    + Some tests had to be adjusted accordingly.\n    + Pandoc now behaves in a more useful way when the YAML metadata contains\n      escaping errors: instead of just failng silently and falling back to\n      some other interpretation of the section, it raises a YAML parsing error.\n\n  * Markdown writer: Ensure that special values are quoted in YAML metadata.\n    These include \"Y\", \"yes\", \"on\", and \"off\", which are now (with yaml library)\n    considered boolean values, as well as \"null\".\n\n  * Change JSON encodings of some types.\n\n    + For LineEnding use lowercase constructors, e.g. `crlf`, `native`.\n    + For HTMLSlideVariant use lowercase constructors.\n    + For ReaderOptions use e.g. `default-image-extension`\n      instead of `readerDefaultImageExtension` for field names.\n    + For Extension, use e.g. `tex_math_dollars` instead of\n      `Ext_tex_math_dollars` as constructor.\n    + For Extensions, use an array of Extensions, instead of\n      an object wrapping the tag `Extensions` and an integer.\n      (The integer representation is not supposed to be part of the\n      public API.)\n    + For Opt, use field names like `tab-stop` instead of `optTabStop`.\n\n  * Docx writer:\n\n    + Add IDs to native_numbering test (Tristan Stenner).\n    + Move \": \" out of the caption bookmark (Tristan Stenner).\n      This is needed so that native references to the figure are included as\n      \"As seen in Figure X, it is...\" instead of \"As seen in [Figure: X, it is...\"\n\n  * Lua (Albert Krewinkel, except as noted):\n\n    + Use hslua module abstraction where possible.\n    + Fix placement of tests for Block elements in pandoc module tests\n    + Increase strictness when getting attribute keys\n    + Re-add `t` and `tag` property to Attr values.\n      Removal of these properties from Attr values was a regression.\n    + Fix `pandoc.utils.stringify` regression.  The `pandoc.utils.stringify`\n      function returned empty strings when called with a string argument.\n    + Fix a copy/paste bug in Lua marshalling code (John MacFarlane, #7639).\n      This caused links to be changed to figures when Lua filters changed\n      link properties.\n    + Re-add `content` property to Link elements (#7647).\n      This was a regression introduced in version 2.15.\n    + Generate constants in module pandoc programmatically.\n    + Marshal SimpleTable, ListAttributes, Citation, and Block values as\n      userdata objects.  Properties of Block values are marshalled lazily,\n      which generally improves performance considerably. Script users may also\n      notice the following differences:\n\n      - Block element properties can no longer be accessed by numerical\n        indexing of the `.c` field. The `.c` property now serves as an alias\n        for `.content`, so some filter that used this undocumented method\n        for property access may continue to work, while others will need to\n        be updated and use proper property names.\n      - The marshalled Block elements now have a `show` method, and a\n        `__tostring` metamethod. Both return the Haskell string\n        representation of the element.\n      - Block values now have the Lua type `userdata` instead of `table`.\n\n  * Add a short guide to pandoc's sources (Albert Krewinkel).\n\n  * Fix epub files in epub reader tests, so that they are valid\n    according to epubcheck (#7586).\n\n  * Allow time 1.13.\n\n  * Require latest skylighting (0.12.1).\n\n  * Fix build on GHC 9.2 (Joseph C. Sible).\n\n  * Fix trypandoc so it builds with aeson > 2.\n\n\n## pandoc 2.15 (2021-10-23)\n\n  * Add `--sandbox` option  (#5045).\n\n    + Add sandbox feature.  When this option is used, readers and writers\n      only have access to input files (and other files specified directly on\n      command line).  This restriction is enforced in the type system.\n    + Filters, PDF production, custom writers are unaffected.  This\n      feature only insulates the actual readers and writers, not\n      the pipeline around them in Text.Pandoc.App.\n    + Note that when `--sandboxed` is specified, readers won't have\n      access to the resource path, nor will anything have access to\n      the user data directory.\n\n  * `--self-contained`: Fix bug that caused everything to be made a data\n    URI (#7635, #7367).  We only need to use data URIs in certain cases, but\n    due to a bug they were being used always.\n\n  * Pandoc will now fall back to latin1 encoding for inputs that can't be\n    read as UTF-8.  This is what it did previously for content fetched\n    from the web and not marked as to content type. It makes sense to do\n    the same for local files.  In this case a `NotUTF8Encoded` warning\n    will be issued, indicating that pandoc is interpreting the input as latin1.\n\n  * Markdown reader:\n\n    + Don't parse links or bracketed spans as citations (#7632).\n      Previously pandoc would parse `[link to (@a)](url)` as a\n      citation; similarly `[(@a)]{#ident}`.  This is undesirable.  One should\n      be able to use example references in citations, and even if `@a` is\n      not defined as an example reference, `[@a](url)` should be a link\n      containing an author-in-text citation rather than a normal citation\n      followed by literal `(url)`.\n    + Fix interaction of `--strip-comments` and list parsing (#7521).\n      Use of `--strip-comments` was causing tight lists to be rendered as\n      loose (as if the comment were a blank line).\n    + Fix parsing bug for math in bracketed spans and links (#7623).\n      This affects math with unbalanced brackets (e.g. `$(0,1]$`)\n      inside links, images, bracketed spans.\n    + Fix code blocks using `--preserve-tabs` (#7573).  Previously they\n      did not behave as the equivalent input with spaces would.\n\n  * DocBook reader:\n\n    + Honor linenumbering attribute (Samuel Tardieu).\n    The attribute DocBook `linenumbering=\"numbered\"` on code blocks\n    maps to the `numberLines` class internally.\n\n  * LaTeX reader:\n\n    + Implement siunitx v3 commands (#7614).\n      We support `\\unit`, `\\qty`, `\\qtyrange`, and `\\qtylist`\n      as synonyms of `\\si`, `\\SI`, `\\SIrange`, and `\\SIlist`.\n    + Properly handle `\\^` followed by group closing (#7615).\n    + Recognize that `\\vadjust` sometimes takes \"pre\" (#7531).\n    + Ignore (and gobble parameters of) CSLReferences environment (#7531).\n      Otherwise we get the parameters as numbers in the output.\n    + Restrict `\\endinput` to current file (Simun Schuster).\n\n  * RST reader: handle escaped colons in reference definitions (#7568).\n\n  * HTML reader:\n\n    + Handle empty tbody element in table (#7589).\n\n  * Ipynb reader (Kolen Cheung):\n\n    + Get cell output mime from `raw_mimetype` in addition to `format`.\n      (`format` is what the spec calls for, but `raw_mimetype` is\n      often used in practice; see jupyter/nbformat#229).\n    + Add more formats that can be handled as \"raw\" cells.\n    + Fix mime type for `rst`.\n    + Support `text/markdown`, which is now a supported mime type for raw\n      output (#7561).\n\n  * RTF reader:\n\n    + Support `\\binN` for binary image data.\n    + If doc begins with {\\rtf1 ... } only parse its contents.\n      Some documents seem to have non-RTF (e.g. XML) material after the\n      `{\\rtf1 ... }` group.\n    + Ignore `\\pgdsc` group.  Otherwise we get style names treated as test.\n    + Better handling of `\\*` and bookmarks.  We now ensure that groups\n      starting with `\\*` never cause text to be added to the document.\n      In addition, bookmarks now create a span between the start\n      and end of the bookmark, rather than an empty span.\n\n  * Docx reader:\n\n    + Avoid blockquote when parent style has more indent (Milan Bracke).\n      When a paragraph has an indentation different from the parent (named)\n      style, it used to be considered a blockquote. But this only makes sense\n      when the paragraph has more indentation. So this commit adds a check\n      for the indentation of the parent style.\n    + Fix handling of empty fields (Milan Bracke).  Some fields only\n      have an `instrText` and no content, Pandoc didn't understand these,\n      causing other fields to be misunderstood because it seemed like\n      a field was still open when it wasn't.\n    + Implement PAGEREF fields (Milan Bracke).  These fields, often used\n      in tables of contents, can be a hyperlink.\n    + Fix handling of nested fields (Milan Bracke).  Fields delimited by\n      `fldChar` elements can contain other fields. Before, the nested\n      fields would be ignored, except for the end, which would be\n      considered the end of the parent field.\n    + Add placeholder for word diagram instead of just omitting it (Ezwal).\n\n  * Org reader:\n\n    + Don't parse a list as first item in a list item (#7557).\n    + Allow an initial `:PROPERTIES:` drawer to add to metadata (#7520).\n\n  * Docx writer:\n\n    + Make id used in `native_numbering` predictable (#7551).\n    If the image has the id IMAGEID, then we use the id ref_IMAGEID\n    for the figure number.  This allows one to create a filter that\n    adds a figure number with figure name, e.g.\n    `<w:fldSimple w:instr=\" REF ref_superfig \"><w:r><w:t>Figure X</w:t>\n    </w:r></w:fldSimple>`.\n    If an image lack an id, an id of the form `ref_fig1` is used.\n  + Ensure we have unique ids for `wp:docPr` and `pic:cNvPr` elements\n    (#7527, #7503).\n  + Handle SVG images (#4058).  This change has several parts:\n    - In Text.Pandoc.App, if the writer is docx, we fill the media\n      bag and attempt to convert any SVG images to PNG, adding these\n      to the media bag.  The PNG backups have the same filenames as\n      the SVG images, but with an added .png extension.  If the conversion\n      cannot be done (e.g. because rsvg-convert is not present),\n      a warning is omitted.\n    - In Text.Pandoc.Writers.Docx, we now use Word 2016's syntax for\n      including SVG images. If a PNG fallback is present in the media bag,\n      we include a link to that too.\n\n  * Powerpoint writer (Emily Bourke):\n\n    + Add support for more layouts (#5097).  Up til now, four layouts\n      were supported: \"Title Slide\" (used for the automatically generated\n      metadata slide), \"Section Header\" (used for headings above slide\n      level), \"Two Column\" (used when there's a columns div), \"Title and\n      Content\" (used for all other slides).  We now support three\n      additional layouts: \"Comparison\", \"Content with Caption\", and\n      \"Blank\".  The manual describes the logic that determines which\n      layout is used for a slide.  Layouts may be customized in the\n      reference doc.\n    + Support specifying slide background images using a `background-image`\n      attribute on the slide's heading.  Only the \"stretch\" mode is supported,\n      and the background image is centred around the slide in the image's\n      larger axis, matching the observed default behaviour of PowerPoint.\n    + Add support for incremental lists (through same methods as in\n      other slide writers) (#5689).\n    + Copy embedded fonts from reference doc.\n    + Include all themes in output archive.\n    + Fix list level numbering (#4828, #4663).  In PowerPoint,\n      the content of a top-level list is at the same level as the content\n      of a top-level paragraph: the only difference is that a list style\n      has been applied.  Previously, the writer incremented the paragrap\n      h level on each list, turning what should be top-level lists into\n      second-level lists.\n    + Line up list continuation paragraphs.  This commit\n      changes the `marL` and `indent` values used for plain paragraphs\n      and numbered lists, and changes the spacing defined in the\n      reference doc master for bulleted lists.  For paragraphs, there is\n      now a left-indent taken from the `otherStyle` in the master.\n      For numbered lists, the number is positioned where the text would be\n      if this were a plain paragraph, and the text is indented to the next\n      level. This means that continuation paragraphs line up nicely with\n      numbered lists.  Existing reference docs may need to be modified so\n      that `otherStyle` and `bodyStyle` indent levels match, for this\n      feature to work with them.\n    + Consolidate text runs when possible (jgm).  This slims down the output\n      files by avoiding unnecessary text run elements.\n    + Support footers in the reference doc.\n      There is one behaviour which may not be immediately obvious: if the\n      reference doc specifies a fixed date (i.e. not automatically updating),\n      and there’s a date specified in the metadata for the document, the\n      footer date is replaced by the metadata date.\n    + Fix presentation rel numbering.  Before now, the numbering of `rId`s\n      was inconsistent when making the presentation XML and when making\n      the presentation relationships XML.\n    + Don’t add relationships unnecessarily.  Before now, for any layouts\n      added to the output from the default reference doc, the relationships\n      were unconditionally added to the output. However, if there was already\n      a layout in slideMaster1 at the same index then that results in\n      duplicate relationships.\n    + If slide level is 0, don't insert a slide break between a heading\n      and a following table, \"columns\" div, or paragraph starting\n      with an image.\n    + Fix capitalisation of `notesMasterId`.\n    + Restructure tests.\n\n  * Asciidoc writer:\n\n    + Translate numberLines attribute to `linesnum` switch (Samuel Tardieu).\n    + Improve escaping for `--` in URLs (#7529).\n\n  * LaTeX writer:\n\n    + Make babel use more idiomatic (#7604, hseg).  Use babel's\n      bidi implementation.  Import babel languages individually instead\n      of as package options.  Move `header-includes` to after\n      `babel` setup so it can be modified.\n    + Use babel, not polyglossia, with xelatex.  Previously polyglossia\n      worked better with xelatex, but that is no longer the case, so\n      we simplify the code so that babel is used with all latex\n      engines.  This involves a change to the default LaTeX template.\n\n  * Markdown writer:\n\n    + Avoid bad wraps at the Doc Text level.  Previously we tried to\n      do this at the Inline list level, but it makes more sense to\n      intervene on breaking spaces at the Doc Text level.\n    + Use `underline` class rather than `ul` for underline.\n      This only affects output with `bracketed_spans` enabled.\n      The markdown reader parses spans with either `.ul` or `.underline` as\n      Underline elements, but we're moving towards preferring the latter.\n\n  * RST writer:\n\n    + Properly handle anchors to ids with spaces or leading underscore\n      (#7593).  In this cases we need the quoted form, e.g.\n      ```\n      .. _`foo bar`:\n\n      .. _`_foo`:\n      ```\n      Side note: rST will \"normalize\" these identifiers anyway,\n      ignoring the underscore.\n\n  * HTML writer:\n\n    + Render `\\ref` and `\\eqref` as inline math, not display (see #7589).\n    + Pass through `\\ref` and `\\eqref` if MathJax is used (#7587).\n    + Pass through inline math environments with KaTeX.\n    + Support `--reference-location` for HTML output (#7461,\n      Francesco Mazzoli).\n    + Set \"hash\" to True by default (for reveal.js) (#7574).  See #6968\n      where the motivation for setting \"hash\" to True is explained.\n\n  * Native writer:  Use pretty-show to format native output (#7580).\n    Previously we used our own homespun formatting.  But this produces\n    over-long lines that aren't ideal for diffs in tests.\n    Performance is slower by about a factor of 10, but this isn't\n    really a problem because native isn't suitable as a serialization\n    format. (For serialization you should use json, because the reader\n    is so much faster than native.)\n\n  * Org writer:\n\n    + Don't indent contents of code blocks.  We previously indented them\n      by two spaces, following a common convention.  Since the convention\n      is fading, and the indentation is inconvenient for copy/paste, we are\n      discontinuing this practice.\n    + Update list of supported source languages in org writer (#5440).\n\n  * Ipynb writer (Kolen Cheung):\n\n    + Improve round trip identity for raw cell output.\n      See jupyter/nbformat#229.  The Jupyter ecosystem, including nbconvert,\n      lab and notebook, deviated from their own spec in nbformat, where\n      they used the key `raw_mimetype` instead of `format`.  Moreover,\n      the mime-type of rst used in Jupyter deviated from that suggested by\n      https://docutils.sourceforge.io/FAQ.html and is defined as\n      `text/restructuredtext` when chosen from \"Raw NBConvert Format\" in\n      Jupyter.  The new behavior should matche the real world usage better,\n      hence improving the round-trip \"identity\" in raw-cell.\n    + Add more formats that can be handled as \"raw\" cells.\n\n  * EPUB writer:\n\n    + Add EPUB3 subject metadata (authority/term) (nuew).\n      This adds the ability to specify EPUB 3 `authority` and `term` specific\n      refinements to the `subject` tag. Specifying a plain `subject` tag in\n      metadata will function as before.\n    + Treat epub:type \"frontispiece\" as front matter (#7600).\n\n  * reveal.js template: Fix line numbers in source code (#7634).\n    We need `overflow: visible` for these to work, and reveal's\n    default css disables this.  So we re-enable it in the default template.\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Export `splitSentences` as a Doc Text transform [API change].\n      Use this in man/ms.  We used to attempt automatic sentence\n      splitting in man and ms output, since sentence-ending\n      periods need to be followed by two spaces or a newline in\n      these formats.  But it's difficult to do this reliably at\n      the level of `[Inline]`.\n\n  * Text.Pandoc.Translations: small revisions for compatibility\n    with aeson 2.\n\n  * Don't prepend `file://` to `--syntax-definition` on Windows (#6374).\n    This was a fix for a problem in skylighting, but this\n    problem doesn't exist now that we've moved from HXT to xml-conduit.\n\n  * Text.Pandoc.Extensions:\n\n    + Add `Ext_footnotes` to default `gfm` etxensions.  Now `gfm`\n      supports footnotes.\n    + Alphabetize Extension constructors (also affects `--list-extensions`).\n\n  * Text.Pandoc.Citeproc.Util: Better implementation of `splitStrWhen`.\n    Previously the citeproc code had two less efficient\n    implementations.\n\n  * Update documentation for definition_list extension (#7594).\n    In 2015, we relaxed indentation requirements for the first\n    line of a definition (see commit d3544dc and issue #2087), but\n    the documnentation wasn't updated to reflect the change.\n\n  * Text.Pandoc.Citeproc.BibTeX: Fix expansion of special strings in series\n    e.g. `newseries` or `library` (#7591).  Expansion should not happen\n    when these strings are protected in braces, or when they're\n    capitalized.\n\n  * Text.Pandoc.Logging: add `NotUTF8Encoded` constructor to `LogMessage`\n    [API change].\n\n  * Text.Pandoc.App.FormatHeuristics: remove `.tei.xml` extension for TEI\n    (#7630).  This never worked, because `takeExtension`\n    only returns `.xml`.  So it won't be missed if we remove it.\n\n  * Text.Pandoc.Image:\n\n    + Generalize `svgToPng` to MonadIO.\n    + `svgToPng`, change first parameter from WriterOptions to Int.\n\n  * Text.Pandoc.Class:\n\n    + Add `readStdinStrict` method to PandocMonad [API change].\n    + Generalize type of `extractMedia` [API change].\n      It was uselessly  restricted to PandocIO, instead of any\n      instance of PandocMonad and MonadIO.\n\n  * Text.Pandoc.Class.PandocIO: derive MonadCatch, MonadThrow, MonadMask.\n    This allows us to use `withTempDir` [API change].\n\n  * Add module Text.Pandoc.Class.Sandbox, defining\n   `sandbox`.  Exported via Text.Pandoc.Class. [API change]\n\n  * Text.Pandoc.Filter:  Generalize type of `applyFilters`\n    from PandocIO to any instance of MonadIO and PandocMonad [API change].\n\n  * Text.Pandoc.PDF: generalize type of `makePDF`:\n    instead of PandocIO, it can be used in any instance of\n    PandocMonad, MonadIO, and MonadMask [API change].\n\n  * Lua subsystem and custom writers: generalize types from PandocIO\n    to any instance of PandocMonad and MonadIO [API change].\n    The type of `runLua` is now\n\n        (PandocMonad m, MonadIO m) =>\n        LuaE PandocError a -> m (Either PandocError a)\n\n    The change from `Lua` to `LuaE PandocError` is due to the switch to\n    hslua-2.0; see next item.\n\n  * Lua modules (Albert Krewinkel):\n\n    + Switch to hslua-2.0.  The new HsLua version takes a somewhat different\n      approach to marshalling and unmarshalling, relying less on typeclasses\n      and more on specialized types. This allows for better performance and\n      improved error messages.  Furthermore, new abstractions allow to\n      document the code and exposed functions.\n    + Marshal Version values, Inline elements, Attr elements,\n      and Pandoc elements as userdata.\n    + Remove deprecated inline constructors `DoubleQuoted`,\n      `SingleQuoted`, `DisplayMath`, and `InlineMath`.\n    + Attr values are no longer normalized when assigned to an Inline\n      element property.\n    + It's no longer possible to access parts of Inline elements via\n      numerical indexes. E.g., `pandoc.Span('test')[2]` used to give\n      `pandoc.Str 'test'`, but yields `nil` now. This was undocumented\n      behavior not intended to be used in user scripts. Use named properties\n      instead.\n    + Accessing `.c` to get a JSON-like tuple of all components no longer\n      works. This was undocumented behavior.\n    + Only known properties can be set on an element value. Trying to set a\n      different property will now raise an error.\n    + Adds a new `pandoc.AttributeList()` constructor, which creates the\n      associative attribute list that is used as the third component of\n      `Attr` values. Values of this type can often be passed to constructors\n      instead of `Attr` values.\n    + Convert IOErrors to PandocErrors in `pandoc.pipe` function (#7523).\n\n  * Text.Pandoc.PDF:  Previously we had to run `runIOorExplode` inside\n    `withTempDir`.  Now that PandocIO is an instance of MonadMask, this is\n    no longer necessary.\n\n  * Text.Pandoc.App:\n\n    + Reorganize to make it easier to limit IO in main loop.\n      Previously we used liftIO fairly liberally.  The code has\n      been restructured to avoid this.\n    + Move output-file writing out of PandocMonad action.\n\n  * Text.Pandoc.App.OutputSettings: Generalize some types\n    so we can run this with any instance of PandocMonad and MonadIO,\n    not just PandocIO.\n\n  * Use `simpleFigure` builder in readers  and `SimpleFigure`\n    pattern synonym in writers (Aner Lucero).\n\n  * Allow time 1.12.\n\n  * Use skylighting-0.12, skylighting-core-0.12.\n    This fixes highlighting issues with typescript, scala, and other\n    syntaxes that include keyword lists from different syntaxes.\n\n  * Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2,\n    texmath 0.12.3.2, ipynb 0.1.0.2.  (These changes also allow\n    building with aeson >= 2.)\n\n  * Require doclayout >= 0.3.1.1.  This fixes recognition of \"real widths\"\n    of emoji characters, which is important for tabular layout.\n\n  * Cut out over 100K of fat in epub test golden files.\n\n  * Make `test/epub/wasteland.epub` valid.\n\n  * Add missing `%` on some command tests.\n    This prevented `--accept` from working properly.\n\n  * Command tests: raise error if command doesn't begin with `%`.\n\n  * OOXML tests: use pretty-printed form to display diffs.\n    Otherwise everything is on one line and the diff is uninformative.\n\n  * Fix compareXML helper in Tests.Writers.OOXML.\n    Given how it is used, we were getting \"mine\" and \"good\"\n    flipped in the test results.\n\n  * MANUAL.txt:\n\n    + Clarify `attributes` extension support (William Lupton).\n    + Document formats affected by `--reference-location`.\n    + Document error code 25\n    + Add some more info regarding `--slide-level=0` (Salim B).\n    + Add more to security section of manual.\n    + Mention support of `title-toc` (#7171, Christophe Dervieux).\n\n  * doc/lua-filters.md:\n\n    + Add missing type for Image title (Quinn).\n    + Improve order of Image fields (Quinn).\n    + Rephrase pandoc.path docs (#7548, Quinn).\n    + Do not leak working directory in TikZ filter (Jeroen de Haas).\n\n## pandoc 2.14.2 (2021-08-21)\n\n  * Allow `--slide-level=0` (#7476). When the slide level is set\n    to 0, headings won't be used at all in splitting the document\n    into slides. Horizontal rules must be used to separate slides.\n\n  * Add RTF reader (#3982). `rtf` is now supported as an input\n    format as well as an output format. New module\n    Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change]\n\n  * HTML reader:  treat comments as blank when parsing (#7482).\n\n  * Markdown reader:\n\n    + Fix raw LaTeX injection issue (#7497). Using a code block\n      containing `\\end{verbatim}`, one could inject raw TeX into a\n      LaTeX document even when `raw_tex` is disabled. Thanks to\n      Augustin Laville for noticing the bug.\n    + Multimarkdown sub- and superscripts (#5512, OCzarnecki).\n      Added an extension `short_subsuperscripts` which modifies\n      the behavior of `subscript` and `superscript`, allowing\n      subscripts or superscripts containing only alphanumerics\n      to end with a space character (eg. `x^2 = 4` or `H~2 is\n      combustible`).  This improves support for multimarkdown.\n\n  * RST reader: Fix `:literal:` includes (#7513).  These should create\n    code blocks, not insert raw RST.\n\n  * LaTeX reader:\n\n    + Proper implicit grouping around environment macros.\n    + Support `\\global` before `\\def`, `\\let`, etc. (#7494).\n    + Fix scope for LaTeX macros (#7494). They should by default\n      scope over the group in which they are defined (except `\\gdef`\n      and `\\xdef`, which are global). In addition, environments must\n      be treated as groups.\n    + Improve handling of plain TeX macro primitives (#7474).\n      Fixed semantics for `\\let`.\n    + Implement `\\edef`, `\\gdef`, and `\\xdef`.\n\n  * Docx reader: Improve docx reader's robustness in extracting\n    images (#7511). The docx reader made some assumptions about\n    how docx containers were laid out that were not always true, with\n    the result that some images in documents did not get\n    extracted.\n\n  * LaTeX writer: Increase table column width precision (#7466,\n    Peter Fabinski). In some cases, the rounding performed by the\n    LaTeX table writer would introduce visible overrun outside\n    the text area. This adds two more decimal places to the width\n    values.\n\n  * Powerpoint writer:\n\n    + Include image title in description (#7352, Emily Bourke). The\n      image title (i.e. `![alt text](link \"title\")`) was previously\n      ignored when writing to pptx. This commit includes it in\n      PowerPoint's description of the image, along with the link.\n    + Select layouts from reference doc by name (Emily Bourke). Until\n      now, users had to make sure that their reference doc contains\n      layouts in a specific order: the first four layouts in the file\n      had to have a specific structure. Now the layout selection uses\n      the layout names rather than order: users must make sure their\n      reference doc contains four layouts with specific names, and if\n      a layout with the right name isn’t found pandoc will emit\n      a warning and use the corresponding layout from the default\n      reference doc as a fallback.\n\n  * Docx writer: be sensitive to the `native_numbering` extension\n    (#7499).  Figure and table numbers are now only included if\n    `native_numbering` is enabled.  (By default it is disabled.)\n    This is a behavior change with respect to 2.14.1, but the\n    default behavior is now that of previous versions.  The\n    change was necessary to avoid incompatibilities between\n    pandoc's native numbering and third-party cross reference\n    filters like pandoc-crossref.\n\n  * RTF writer:\n\n    + Omit `\\bin` in `\\pict`. According to the spec, this is not\n      needed or wanted when the data is in hexadecimal format, as\n      here.\n    + Emit `\\outlinelevel`` for section headings.\n\n  * RTF template: specify font family for fixed-width font f1.\n    According to the spec, this is mandatory.\n\n  * LaTeX writer: Use ulem for underline (#7351). ulem is\n    conditionally included already when the `strikeout` variable\n    is set, so we set this when there is underlined text, and use\n    `\\uline` instead of `\\underline`. This fixes wrapping for\n    underlined text.\n\n  * Text.Pandoc.Citeproc:\n\n    + Revise citeproc code to fit new citeproc 0.5 API (thanks to\n      Benjamin Bray). Linkification of URLs in the bibliography\n      is now done in the citeproc library, depending on the\n      setting of an option.  We set that option depending on the\n      value of the metadata field `link-bibliography` (defaulting\n      to true, for consistency with earlier behavior). If a DOI,\n      PMID, PMCID, or URL field is present but not explicitly\n      rendered, the title (or if no title, the whole entry) is\n      hyperlinked. These changes implement the recommendations\n      from the draft CSL v1.0.2 spec (Appendix VI):\n      <https://github.com/citation-style-language/documentation/blob/master/specification.rst#appendix-vi-links>\n    + Avoid odd handling of quotes. Recent citeproc changes\n      allow us to ignore Quoted elements; citeproc now uses its own\n      method for represented quoted things, and only localizes and\n      flipflops quotes it adds itself. Convert Quoted in bib\n      entries to special Spans before passing them off to\n      citeproc. This ensures that we get proper localization and\n      flipflopping if, e.g., quotes are used in titles\n      (jgm/citeproc#87).\n    + Removed quote localization from citeproc processing.\n      This is now done in citeproc itself.\n\n  * Text.Pandoc.Logging: Add PowerpointTemplateWarning log message\n    type [API change] (Emily Bourke).\n\n  * Text.Pandoc.Extension: Add `Ext_short_subsuperscripts`\n    constructor to `Extension` [API change] (OCzarnecki).\n\n  * Various sample.lua editorial fixes (#7493, #7487, William\n    Lupton).\n\n  * Bump base-compat version so we get compatibility with base 4.12.\n\n  * Use Prelude from base-compat for ghc 8.4 too.\n\n  * Add haskell-language-server to shell.nix (#7496, Emily Bourke).\n\n  * Tests.Helpers: export testGolden and use it in RTF reader.\n    This gives a diff output on failure.\n\n  * Remove obsolete and incorrect sentence in `--slide-level` docs.\n\n  * Add internal module Text.Pandoc.Network.HTTP, exporting\n    `urlEncode`.\n\n  * Text.Pandoc.Parsing: `parseFromString`: preserve at least\n    the source directory (#7464). Previously we just set the\n    source name to \"chunk\" when parsing from strings, to avoid\n    misleading source positions. This had the side effect that\n    `rebase_relative_paths` would break inside sections that\n    were parsed as strings. So, now we use\n    \"ORIGINAL_SOURCE_PATH_chunk\" instead of just \"chunk\".\n\n  * Text.Pandoc.MIME: use image/x-xcf instead of application/x-xcf\n    (#7454).\n\n  * Don’t compare `cdLine` in OOXML golden tests (Emily Bourke).\n    The `cdLine` field gives the line of the file some CData was\n    found on, which reflects irrelevant formatting differences.\n\n  * Provide more detailed XML diff in tests (Emily Bourke).\n\n  * OOXML tests: silence warnings. These can make the test output\n    confusing, making people think tests are failing when they're\n    passing.\n\n  * INSTALL.md: Add GitLab CI/CD example (#7448, Veratyr).\n\n  * MANUAL.txt\n\n    - Clarifications (William Lupton).\n    - Add a note on security risks of include directives.\n\n  * Document use of the 'underline' class (#7492, #7484, William\n    Lupton).\n\n  * Add a FAQ about the \"Cannot allocate memory\" error on M1 macs.\n\n  * Use texmath 0.12.3.1.\n\n  * Use released citeproc 0.5.\n\n  * Remove dependency on HTTP package (#7456, mt_caret).\n\n## pandoc 2.14.1 (2021-07-18)\n\n  * Text.Pandoc.ImageSize: Add Tiff constructor for ImageType (#7405)\n    [Minor API change].  This allows pandoc to get size information from\n    tiff images.\n\n  * Markdown reader:  don't try to read contents in self-closing HTML tag.\n    Previously we had problems parsing raw HTML with self-closing\n    tags like `<col/>`. The problem was that pandoc would look\n    for a closing tag to close the markdown contents, but the\n    closing tag had, in effect, already been parsed by `htmlTag`.\n\n  * LaTeX reader:\n\n    + Avoid trailing hyphen in translating languages (#7447).\n      Previously `\\foreignlanguage{english}` turned into `<span lang=\"en-\">`.\n      The same issue affected Arabic.\n    + Support `\\cline` in LaTeX tables (#7442).\n    + Improved parsing of raw LaTeX from Text streams (`rawLaTeXParser`,\n      used to read LaTeX in Markdown files, #7434).  We now use source\n      positions from the token stream to tell us how much of the text stream\n      to consume.  Getting this to work required a few other changes to\n      make token source positions accurate.\n\n  * DocBook reader:\n\n    + Handle images with imageobjectco elements (#7440).\n    + Add support for citerefentry (#7437, Jan Tojnar).\n\n  * RST reader: fix regression with code includes (#7436).\n    With the recent changes to include infrastructure,\n    included code blocks were getting an extra newline.\n\n  * HTML reader:\n\n    + Recognize data-external when reading HTML img tags (#7429,\n      Michael Hoffmann).  Preserve all attributes in img tags.  If attributes\n      have a `data-` prefix, it will be stripped.  In particular, this\n      preserves a `data-external` attribute as an `external` attribute in\n      the pandoc AST.\n    + Add col, colgroup to 'closes' definitions\n\n  * HTML writer:\n\n    + Remove duplicated alt text in HTML output (Aner Lucero).\n    + Remove `aria-hidden` when explicit alt text is provided (Aner Lucero).\n    + Set boolean values for reveal.js variables.\n\n  * Docx writer:\n\n    + Add table numbering for captioned tables.\n      The numbers are added using fields, so that Word can\n      create a list of tables that will update automatically.\n    + Support figure numbers.  These are set up in such a way that they\n      will work with Word's automatic table of figures (#7392).\n\n  * Markdown writer: put space between Plain and following fenced Div\n    (#4465).\n\n  * EPUB writer: Don't incorporate externally linked images in EPUB documents\n    (#7430, Michael Hoffmann).  Just as it is possible to avoid incorporating\n    an image in EPUB by passing `data-external=\"1\"` to a raw HTML snippet,\n    this makes the same possible for native Images, by looking for an\n    associated `external` attribute.\n\n  * Text.Pandoc.PDF:\n\n    + Fix `svgIn` path error (#7431).  We were duplicating\n      the temp directory; this didn't cause problems on macOS or linux\n      because there we use absolute paths for the temp directory.\n      But on Windows it caused errors converting SVG files.\n    + `convertImage`: normalize paths (#7431).  This will avoid paths\n      on Windows with mixed path separators.\n\n  * Text.Pandoc.Class: Always use / when adding directory to image destination\n    with `extractMedia`, even on Windows.\n\n  * Text.Pandoc.Citeproc:\n\n    + Allow `$` characters in bibtex keys (#7409).\n    + Set proper initial source name in parsing BibTeX (for better error\n      messages.)\n    + Revamp note citation handling (#7394).  Use latest\n      citeproc, which uses a Span with a class rather than a Note for notes.\n      This helps us distinguish between user notes and citation notes.  Don't\n      put citations at the beginning of a note in parentheses.  Fix small bug\n      in handling of citations in notes, which led to commas at the end of\n      sentences in some cases.\n    + Cleanup and efficiency improvement in `deNote`.\n    + Improve punctuation moving with `--citeproc`.  Previously, using\n      `--citeproc` could cause punctuation to move in quotes even when\n      there aer no citations. This has been changed; punctuation moving\n      is now limited to citations.  In addition, we only move footnotes\n      around punctuation if the style is a note style, even if\n      `notes-after-punctuation` is `true`.\n\n  * Use citeproc 0.10. This helps improve note citations (see above)\n    and eliminates double hyperlinks in author-in-text citations.\n    Author-only citations are no longer hyperlinked.  See jgm/citeproc#77.\n    It also fixes moving of punctuation inside quotes to conform to\n    the CSL spec: only comma and period are moved, not question\n    mark or exclamation point.\n\n  * Text.Pandoc.Error: fix line calculations in reporting parsec errors.\n    Also remove a spurious initial newline in the error report.\n\n  * Use doctemplates 0.4.1, which gives us better support for boolean\n    variable values.  Previously `$if(foo)$` would evaluate to true\n    for variables with boolean `false` values, because it cared only\n    about the string rendering (#7402).\n\n  * Require commonmark-pandoc >= 0.2.2.1.\n    This fixes task lists with multiple paragraphs.\n\n  * Use skylighting 0.11.\n\n  * CSS in HTML template: reset overflow-wrap on code blocks\n    (Mauro Bieg, #7423).\n\n  * LaTeX template: Revert change in PR #7295: \"move title, author, date up\n    to top of preamble.\" The change caused problem for people who used\n    LaTeX commands defined defined later in the preamble in the title\n    or author fields (#7422).\n\n  * Add `doc/faqs.md`.  This is imported from the website; in the future the\n    website version will be drawn from here.\n    Added a FAQ on the use of `\\AtEndPreamble` for cases when the contents of\n    `header-includes` need to refer to definitions that come later in the\n    preamble.  See #7422.\n\n  * Upgrade Debian 10 AMI for build-arm.sh.\n\n  * CircleCI: change to using xcode 11.1.0 (macOS 10.14.4).\n    We previously built on 10.13, but 10.13 no longer gets\n    security updates and CirclCI is deprecating.\n\n## pandoc 2.14.0.3 (2021-06-22)\n\n  * Text.Pandoc.MediaBag `insertMediaBag`: ensure we get a sane mediaPath\n    for URLs (#7391).  In earlier 2.14.x versions, we'd get\n    incorrect paths for resources downloaded from URLs when the\n    media are extracted (including in PDF production).\n  * Text.Pandoc.Parsing: improve `emailAddress` (#7398).\n    Previously the parser would accept characters in domains\n    that are illegal in domains, and this sometimes caused it\n    to gobble bits of the following text.\n  * txt2tags reader: modify the email address parser so\n    it still includes form parameters, even after the change to\n    `emailAddress` in Text.Pandoc.Parsing.\n  * Text.Pandoc.Readers.Metadata: Fix regression with comment-only YAML\n    metadata blocks (#7400).\n  * reveal.js writer and template: better handling of options.  Previously\n    it was impossible to specify false values for options that default to\n    true (e.g. `center`); setting the option to false just caused the portion\n    of the template setting the option to be omitted.  Now we prepopulate\n    all the variables with their default values, including them all\n    unconditionally and allowing them to be overridden.\n  * Markdown writer: Fix regression in code blocks with attributes (#7397).\n    Code blocks with a single class but nonempty attributes\n    were having attributes drop as a result of #7242.\n  * LaTeX writer:\n    + Add strut at end of minipage if it contains line breaks.\n      Without them, the last line is not as tall as it should be in\n      some cases.\n    + Always use a minipage for cells with line breaks, when\n      width information is available (#7393).  Otherwise the way we treat them\n      can lead to content that overflows a cell.\n    + Use `\\strut` instead of `~` before `\\\\` in empty line.\n  * Use lts-18.0 stack resolver.\n  * Require skylighting 0.10.5.2 (adding support for Swift).\n  * Require commonmark 0.2.1.\n  * Rephrase section on unsafe HTML in manual.\n  * Create SECURITY.md\n\n## pandoc 2.14.0.2 (2021-06-13)\n\n  * Fix MediaBag regressions (#7345). iIn the 2.14 release `--extract-media`\n    stopped working as before; there could be mismatches between the\n    paths in the rendered document and the extracted media.\n    This patch makes several changes that restore the earlier behavior\n    (while keeping the same API).  The `mediaPath` in 2.14 was always\n    constructed from the SHA1 hash of the media contents.  Now, we\n    preserve the original path unless it's an absolute path or contains\n    `..` segments (in that case we use a path based on the SHA1 hash of\n    the contents).\n\n    In Text.Pandoc.MediaBag, `mediaDirectory` and `mediaItems` now use the\n    `mediaPath`, rather than the mediabag key, for the first component of the\n    tuple.  This makes more sense, I think, and fits with the documentation of\n    these functions; eventually, though, we should rework the API so that\n    `mediaItems` returns both the keys and the MediaItems.\n\n    In Text.Pandoc.Class.IO, rewriting of source paths in `extractMedia` has\n    been fixed.\n\n    In Text.Pandoc.Class.PandocMonad, `fillMediaBag` has been modified so that\n    it doesn't modify image paths (that was part of the problem in #7345).\n\n    We now do path normalization (e.g. `\\` separators on Windows) in\n    writing the media.\n\n  * Text.Pandoc.PDF:\n\n    + Text.Pandoc.PDF: Fix regression in 2.14 for generation of PDFs with\n      SVGs (#7344).\n    + Only print relevant part of environment on `--verbose`.  Since\n      `--verbose` output might be put in an issue, we want to avoid\n      spilling out secrets in environment variables.\n\n  * Markdown reader: fix pipe table regression in 2.11.4 (#7343).\n    Previously pipe tables with empty headers (that is, a header\n    line with all empty cells) would be rendered as headerless\n    tables.  This broke in 2.11.4.  The fix here is to produce an\n    AST with an empty table head when a pipe table has all empty\n    header cells.\n\n  * LaTeX reader: don't allow optional `*` on symbol control sequences\n    (#7340).  Generally we allow optional starred variants of LaTeX commands\n    (since many allow them, and if we don't accept these explicitly,\n    ignoring the star usually gives acceptable results).  But we\n    don't want to do this for `\\(*\\)` and similar cases.\n\n  * Docx reader: handle absolute URIs in Relationship Target (#7374).\n\n  * Docx writer: fix handling of empty table headers (Albert Krewinkel,\n    #7369).  A table header which does not contain any cells is now treated as\n    an empty header.\n\n  * LaTeX writer: Fix regression in table header position (#7347).\n    In recent versions the table headers were no longer bottom-aligned\n    (if more than one line).  This patch fixes that by using minipages\n    for table headers in non-simple tables.\n\n  * CommonMark writer:\n\n    + Do not use simple class for fenced-divs (Jan Tojnar, amends #7242.)\n    + Do not throw away attributes when `Ext_attributes` is enabled.\n      `Ext_attributes` covers at least the following:\n      `Ext_fenced_code_attributes`, `Ext_header_attributes`,\n      `Ext_inline_code_attributes`, `Ext_link_attributes`.\n\n  * Markdown writer:\n\n    + Allow `pipe_tables` to be disabled for commonmark formats\n      (`commonmark_x`, `gfm`) (#7375).\n    + Re-use functions from Text.Pandoc.Markdown.Inline (Jan Tojnar).\n\n  * DocBook writer: Remove non-existent admonitions (Jan Tojnar).\n    `attention`, `error` and `hint` are reStructuredText specific.\n\n  * HTML writer: Don't omit width attribute on div (#7342).\n\n  * Text.Pandoc.MIME, `extensionFromMimeType`: add a few special cases.\n    When we do a reverse lookup in the MIME table, we just get the\n    last match, so when the same mime type is associated with several\n    different extensions, we sometimes got weird results, e.g. `.vs`\n    for `text/plain`.  These special cases help us get the most standard\n    extensions for mime types like `text/plain`.\n\n  * Lua utils: fix handling of table headers in `from_simple_table` (Albert\n    Krewinkel, #7369).  Passing an empty list of header cells now results\n    in an empty table header.\n\n  * Text.Pandoc.Citeproc:\n\n    + Avoid duplicate classes and attributes on references div.\n    + Fix regression in citeproc processing (#7376).  If inline\n      references are used (in the metadata `references` field), we\n      should still only include in the bibliography items that are\n      actually cited (unless `nocite` is used).\n\n  * Require citeproc 0.4.0.1.  This fixes a bug which led to doubled\n    \"et al.\" in some (rare) circumstances.\n\n  * MANUAL.txt:\n\n    + Mention GladTeX for EPUB export (Sebastian Humenda).\n      This updates the manual and the web site about the GladTeX usage.\n    + More details and a useful link for YAML syntax.\n\n  * CONTRIBUTING.md: update modules overview (Albert Krewinkel).\n\n  * using-the-pandoc-api.md: switch from String to Text (Albert Krewinkel).\n\n\n## pandoc 2.14.0.1 (2021-06-01)\n\n  * Commonmark reader: Fix regression in 2.14 with YAML metdata block parsing,\n    which could cause the document body to be omitted after metadata (#7339).\n\n  * HTML reader: fix column width regression in 2.14 (#7334).\n    Column widths specified with a style attribute were off by a factor of 100.\n\n  * Markdown reader: in `rebasePaths`, check for both Windows and Posix\n    absolute paths.  Previously Windows pandoc was treating\n    `/foo/bar.jpg` as non-absolute.\n\n  * Text.Pandoc.Logging: In rendering `LoadedResource`, use relative paths.\n\n  * Docx writer: fix regression on captions (#7328).  The \"Table Caption\"\n    style was no longer getting applied.  (It was overwritten by \"Compact.\")\n\n  * Use commonmark-extensions 0.2.1.2\n\n## pandoc 2.14 (2021-05-28)\n\n  * Change reader types, allowing better tracking of source positions\n    [API change].  Previously, when multiple file arguments were provided,\n    pandoc simply concatenated them and passed the contents to the readers,\n    which took a Text argument.  As a result, the readers had no way of knowing\n    which file was the source of any particular bit of text.  This meant that\n    we couldn't report accurate source positions on errors or include accurate\n    source positions as attributes in the AST.  More seriously, it meant that\n    we couldn't resolve resource paths relative to the files containing them\n    (see e.g. #5501, #6632, #6384, #3752).\n\n  * Add `rebase_relative_paths` extension (#3752).  When enabled, this\n    extension rewrites relative image and link paths by prepending\n    the (relative) directory of the containing file.  This\n    behavior is useful when your input sources are split\n    into multiple files, across several directories, with files\n    referring to images stored in the same directory.  The\n    extension can be enabled for all markdown and commonmark-based formats.\n\n  * Add Text.Pandoc.Sources (exported module), with a `Sources` type and a\n    `ToSources` class.  A `Sources` wraps a list of `(SourcePos, Text)` pairs\n    [API change]. A parsec `Stream` instance is provided for `Sources`.  The\n    module also exports versions of parsec's `satisfy` and other Char parsers\n    that track source positions accurately from a `Sources` stream (or any\n    instance of the new `UpdateSourcePos` class).\n\n  * Text.Pandoc.Parsing\n\n    + Export the modified Char parsers defined in Text.Pandoc.Sources\n      instead of the ones parsec provides.  Modified parsers to use a\n      `Sources` as stream [API change].\n    + Improve include file functions [API change].  Remove old\n      `insertIncludedFileF`.  Give `insertIncludedFile` a more general type,\n      allowing it to be used where `insertIncludedFileF` was.\n    + Add parameter to the `citeKey` parser from\n      Text.Pandoc.Parsing, which controls whether the `@{..}`\n      syntax is allowed [API change].\n\n  * Text.Pandoc.Error: Modified the constructor `PandocParsecError` to take a\n    `Sources` rather than a `Text` as first argument, so parse error locations\n    can be accurately reported.\n\n  * Fix source position reporting for YAML bibliographies (#7273).\n\n  * Issue error message when  reader or writer format is malformed\n    (#7231).  Previously we exited with an error status but (due to a bug)\n    no message.\n\n  * Smarter smart quotes (#7216, #2103).  Treat a leading `\"` with no\n    closing `\"` as a left curly quote.  This supports the practice, in\n    fiction, of continuing paragraphs quoting the same speaker without an\n    end quote.  It also helps with quotes that break over lines in line blocks.\n\n  * Markdown reader:\n\n    + Use MetaInlines not MetaBlocks for multimarkdown metadata fields.\n      This gives better results in converting to e.g.  pandoc markdown.\n    + Implement curly-brace syntax for Markdown citation keys (#6026).\n      The change provides a way to use citation keys that contain\n      special characters not usable with the standard citation key syntax.\n      Example: `@{foo_bar{x}'}` for the key `foo_bar{x}`.  It also allows\n      separating citation keys from immediately following text, e.g. `@{foo}A`.\n\n  * RST reader:\n\n    + Seek include files in the directory of the file\n      containing the include directive, as RST requires (#6632).\n    + Use `insertIncludedFile` from Text.Pandoc.Parsing\n      instead of reproducing much of its code.\n\n  * Org reader: Resolve org includes relative to the directory containing the\n    file containing the INCLUDE directive (#5501).\n\n  * ODT reader: Treat tabs as spaces (#7185, niszet).\n\n  * Docx reader:\n\n    + Add handling of vml image objects (#7257, mbrackeantidot).\n    + Support new table features (Emily Bourke, #6316):  column\n      spans, row spans, multiple header rows, table description\n      (parsed as a simple caption), captions, column widths.\n\n  * LaTeX reader:\n\n    + Improved siunitx support (#6658, #6620).\n    + Better support for `\\xspace` (#7299).\n    + Improve parsing of `\\def` macros.  We previously set \"verbatim mode\"\n      even for parsing the initial `\\def`; this caused problems\n      for `\\def` nested inside another `\\def`.\n    + Implement `\\newif`.\n\n  * ConTeXt writer: improve ordered lists (#5016, Denis Maier).\n    Change ordered list from itemize to enumerate.  Add new\n    itemgroup for ordered lists.  Remove manual insertion of\n    width attributes.  Use tabular figures in ordered list\n    enumerators.\n\n  * HTML reader:\n\n    + Don't fail on unmatched closing \"script\" tag (Albert Krenkel, #7282).\n    + Keep h1 tags as normal headers (#2293, Albert Krewinkel).\n      The tags `<title>` and `<h1 class=\"title\">` often contain the same\n      information, so the latter was dropped from the document. However, as\n      this can lead to loss of information, the heading is now always\n      retained.  Use `--shift-heading-level-by=-1` to turn the `<h1>`\n      into the document title, or a filter to restore the previous behavior.\n    + Handle relative lengths (e.g. `2*`) in HTML column widths (#4063).\n      See <https://www.w3.org/TR/html4/types.html#h-6.6>.\n\n  * DocBook/JATS readers:\n\n    + Fix mathml regression caused by the switch in XML libraries (#7173).\n    + Fix \"phrase\" in DocBook: take classes from \"role\" not \"class\" (#7195).\n\n  * DocBook reader: ensure that first and last names are separated (#6541).\n\n  * Jira reader (Albert Krewinkel, #7218):\n\n    + Support \"smart\" links: `[alias|https://example.com|smart-card]` syntax.\n    + Allow spaces and most unicode characters in attachment links.\n    + No longer require a newline character after `{noformat}`.\n    + Only allow URI path segment characters in bare links.\n    + The `file:` schema is no longer allowed in bare links; these\n      rarely make sense.\n\n  * Plain writer: handle superscript unicode minus (#7276).\n\n  * LaTeX writer:\n\n    + Better handling of line breaks in simple tables (#7272).\n      Now we also handle the case where they're embedded in other elements,\n      e.g. spans.\n    + For beamer output, support `exampleblock` and `alertblock` (#7278).\n      A block will be rendered as an `exampleblock` if the heading\n      has class `example` and an `alertblock` if it has class `alert`.\n    + Separate successive quote chars with thin space (#6958,\n      Albert Krewinkel).  Successive quote characters are separated with\n      a thin space to improve readability and to prevent unwanted ligatures.\n      Detection of these quotes sometimes had failed if the second quote\n      was nested in a span element.\n    + Separate successive quote chars with thin space (#6958, Albert\n      Krewinkel).\n\n  * EPUB Writer: Fix belongs-to-collection XML id choice (#7267, nuew).\n    The epub writer previously used the same XML id for both the book\n    identifier and the epub collection. This causes an error on epubcheck.\n\n  * BibTeX/BibLaTeX writer: Handle `annote` field (#7266).\n\n  * ZimWiki writer: allow links and emphasis in headers (#6605,\n    Albert Krewinkel).\n\n  * ConTeXt writer:\n\n    + Support blank lines in line blocks (#6564, Albert Krewinkel,\n      thanks to @denismaier).\n    + Use span identifiers as reference anchors (#7246, Albert Krewinkel).\n\n  * HTML writer:\n\n    + Keep attributes from code nested below `pre` tag (#7221,\n      Albert Krewinkel).  If a code block is defined with `<pre><code\n      class=\"language-x\">…</code></pre>`, where the `<pre>` element has no\n      attributes, then the attributes from the `<code>` element are used\n      instead. Any leading `language-` prefix is dropped in the code's\n      `class` attribute are dropped to improve syntax highlighting.\n    + Ensure headings only have valid attribs in HTML4 (#5944, Albert\n      Krewinkel).\n    + Parse `<header>` as a Div (Albert Krewinkel).\n\n  * Org writer:\n\n    + Inline latex envs need newlines (#7252, tecosaur).\n      As specified in https://orgmode.org/manual/LaTeX-fragments.html, an\n      inline \\begin{}...\\end{} LaTeX block must start on a new line.\n    + Use LaTeX style maths deliminators (#7196, tecosaur).\n\n  * JATS writer (Albert Krewinkel):\n\n    + Use either styled-content or named-content for spans (#7211).\n      If the element has a content-type attribute, or at least one class,\n      then that value is used as `content-type` and the span is put inside\n      a `<named-content>` element. Otherwise a `<styled-content>` element\n      is used instead.\n    + Reduce unnecessary use of `<p>` elements for wrapping (#7227).\n      The `<p>` element is used for wrapping in cases were the contents\n      would otherwise not be allowed in a certain context. Unnecessary\n      wrapping is avoided, especially around quotes (`<disp-quote>` elements).\n    + Convert spans to `<named-content>` elements (#7211).  Spans with\n      attributes are converted to `<named-content>` elements instead of\n      being wrapped with `<milestone-start/>` and `<milestone-end>`\n      elements. Milestone elements are not allowed in documents using the\n      articleauthoring tag set, so this change ensures the creation of valid\n      documents.\n    + Add footnote number as label in backmatter (#7210).  Footnotes in the\n      backmatter are given the footnote's number as a label.  The\n      articleauthoring output is unaffected from this change, as footnotes\n      are placed inline there.\n    + Escape disallows chars in identifiers.  XML identifiers must start\n      with an underscore or letter, and can contain only a limited set\n      of punctuation characters. Any IDs not adhering to these rules are\n      rewritten by writing the offending characters as `Uxxxx`,\n      where `xxxx` is the character's hex code.\n\n  * Jira writer:  use `{color}` when span has a color attribute\n    (Albert Krewinkel, tarleb/jira-wiki-markup#10).\n\n  * Docx writer:\n\n    + Autoset table width if no column has an explicit width (Albert\n      Krewinkel).\n    + Extract Table handling into separate module (Albert Krewinkel).\n    + Support colspans and rowspans in tables (Albert Krewinkel, #6315).\n    + Support multirow table headers (Albert Krewinkel).\n    + Improve integration of settings from reference.docx (#1209).\n      This change allows users to create a reference.docx that\n      sets `w:proofState` for spelling or grammar to `dirty`,\n      so that spell/grammar checking will be triggered on the\n      generated docx.\n    + Copy over more settings from reference.docx (#7240).  From settings.xml\n      in the reference-doc, we now include: `zoom`, `embedSystemFonts`,\n      `doNotTrackMoves`, `defaultTabStop`, `drawingGridHorizontalSpacing`,\n      `drawingGridVerticalSpacing`, `displayHorizontalDrawingGridEvery`,\n      `displayVerticalDrawingGridEvery`, `characterSpacingControl`,\n      `savePreviewPicture`, `mathPr`, `themeFontLang`, `decimalSymbol`,\n      `listSeparator`, `autoHyphenation`, `compat`.\n    + Set zoom to 100% by default in settings.xml.\n    + Align math options more with current Word defaults (e.g.  Cambria Math\n      font).\n    + Remove `rsid`s from default settings.xml.  Word will add these\n      when revisions are made.\n\n  * Ms writer: Handle tables with multiple paragraphs (#7288).\n    Previously they overflowed the table cell width.  We now set line lengths\n    per-cell and restore them after the table has been written.\n\n  * Markdown writer:\n\n    + Use cleaner braceless syntax for code blocks with a\n      single class (#7242, Jan Tojnar).\n    + Add quotes properly in markdown YAML metadata fields (#7245).\n      This fixes a bug, which caused the writer to look at the *last*\n      rather than the *first* character in determining whether quotes\n      were needed.  So we got spurious quotes in some cases and\n      didn't get necessary quotes in others.\n    + Use `@{..}` syntax for citations when needed.\n    + Use fewer unneeded escapes for `#` (see #6259).\n    + Improve escaping of `@`.  We need to escape literal `@` before\n      `{` because of the new citation syntax.\n\n  * Commonmark writer: Use backslash escapes for `<` and `|`...\n    instead of entities (#7208).\n\n  * Powerpoint writer: allow `monofont` to be specified in metadata\n    (#7187).\n\n  * LaTeX template:\n\n    + Use non-starred names for xcolor color names (#6109).\n      This should make svgnames and x11names work properly.\n    + Fix bad vertical spacing after bibliography (#7234, badumont).\n    + List of figures before list of tables (#7235, Julien Dutant).\n    + Move CSL macro definitions before header-includes so they can be\n      overridden (#7286).\n    + Improve treatment of CSL `entry-spacing` (#7296).\n      Previously with the default template settings (`indent` variable\n      not set), we would get interparagraph spaces separating bib\n      entries even with `entry-spacing=\"0\"`.  On the other hand,\n      setting `entry-spacing=\"2\"` gave ridiculously large spacing.\n      This change makes the spacing caused by `entry-spacing` a multiple\n      of `\\parskip` by default, which gives aesthetically reasonable\n      output.  Those who want a larger or smaller unit (e.g. because\n      they use `indent` which sets `\\parskip` to 0) may\n      `\\setlength{\\cslentryspacingunit}{10pt}` in header-includes\n      to override the defaults.\n    + Move title, author, date up to top of preamble (#7295).\n      This allows header-includes to use them, and puts them\n      in a position where you can see them immediately.\n    + Define commands for zero width non-joiner character\n      (#6639, Albert Krewinkel).  The zero-width non-joiner character\n      is used to avoid ligatures (e.g. in German).\n\n  * ConTeXt template:\n\n    + Define `enumerate` itemgroup (#5016, Denis Maier).\n    + List of figures before list of tables (#7235, Julien Dutant).\n\n  * reveal.js template:\n\n    + Support `toc-title` (#7171, Florian Kohrt).\n    + Use `hash: true` by default rather than `history: true` (#6968).\n\n  * HTML-based slide shows: add support for `institute` (#7289, Thomas\n    Hodgson).\n\n  * Text.Pandoc.Extensions: Add constructor `Ext_rebase_relative_paths` to\n    `Extensions` [API change].\n\n  * Text.Pandoc.XML.Light: add Eq, Ord instances for Content,\n    Element, Attr, CDataKind [API change].\n\n  * Text.Pandoc.MediaBag:\n\n    + Change type to use a `Text` key instead of `[FilePath]`.\n      We normalize the path and use `/` separators for consistency.\n    + Export `MediaItem` type [API change].\n    + Change `MediaBag` type to a map from Text to MediaItem [API change].\n    + `lookupMedia` now returns a `MediaItem` [API change].\n    + Change `insertMedia` so it sets the `mediaPath` to a filename based on\n      the SHA1 hash of the contents.  This will be used when contents\n      are extracted.\n\n  * Text.Pandoc.Class.PandocMonad:\n\n    + Remove `fetchMediaResource` [API change].  Use `fetchItem` to get\n      resources in `fillMediaBag`.\n    + Add informational message in `downloadOrRead` indicating what path\n      local resources have been loaded from.\n\n  * Text.Pandoc.Logging:\n\n    + Remove single quotes around paths in messages.\n    + Add LoadedResource constructor to LogMessage [API change].\n      This is for INFO-level messages telling where image data has been\n      loaded from.  (This can vary because of the resource path.)\n\n  * Text.Pandoc.Asciify: simplify code and export `toAsciiText` [API change].\n    Instead of encoding a giant (and incomplete) map, we now\n    just use unicode-transforms to normalize the text to\n    a canonical decomposition, and manipulate the result.\n\n  * App: allow tabs expansion even if file-scope is used (Albert Krewinkel,\n    #6709).  Tabs in plain-text inputs  are now handled correctly, even if\n    the `--file-scope` flag is used.\n\n  * Add new internal module Text.Pandoc.Writers.GridTable (Albert Krewinkel).\n\n  * Text.Pandoc.Highlighting: Change type of `languagesByExtension`, adding\n    a parameter for a `SyntaxMap` [API change] (Jan Tojnar, #7241).\n    Languages defined using `--syntax-definition` were not recognized by\n    `languagesByExtension`.  This patch corrects that, allowing the writers\n    to see all custom definitions.  The LaTeX writer still uses the default\n    syntax map, but that's okay in that context, since\n    `--syntax-definition` won't create new listings styles.\n\n  * Text.Pandoc.Citeproc:\n\n    + Ensure that CSL-related attributes are passed on to a Div with id\n      'refs'.  Otherwise things like `entry-spacing` won't work when\n      such Divs are used.\n    + Use metadata's `lang` for the lang parameter of citeproc, overriding\n      `localeLanguage`.\n    + Recognize locators spelled with a capital letter (#7323).\n    + Add a comma and a space in front of the suffix if it doesn't start\n      with space or punctuation (#7324).\n    + Don't detect math elements as locators (#7321).\n\n  * Remove Text.Pandoc.BCP47 module [API change].  Use types and functions\n    from UnicodeCollation.Lang instead.  This is a richer implementation\n    of BCP 47.\n\n  * Text.Pandoc.Shared:\n\n    + Fix regression in grid tables for wide characters (#7214).\n      In the translation from String to Text, a char-width-sensitive\n      `splitAt'` was dropped.  This commit reinstates it and uses it to make\n      `splitTextByInstances` char-width sensitive.\n    + Add `getLang` (formerly in the now-removed BCP47) [API change].\n\n  * Text.Pandoc.SelfContained: use `application/octet-stream`\n    for unknown mime types instead of halting with an error (#7202).\n\n  * Lua filters: respect Inlines/Blocks filter functions in `pandoc.walk_*`\n    (Albert Krewinkel).\n\n  * Add text as build-depend for trypandoc (#7193, Roman Beránek).\n\n  * Bump upper-bounds for network-uri, time, attoparsec.\n\n  * Use citeproc 0.4.\n\n  * Use texmath 0.12.3.\n\n  * Use jira-wiki-markup 1.3.5 (Albert Krewinkel).\n\n  * Require latest skylighting (fixes a bug in XML syntax highlighting).\n\n  * Use latest xml-conduit.\n\n  * Use latest commonmark, commonmark-extensions, commonmark-pandoc.\n\n  * Use haddock-library-1.10.0 (Albert Krewinkel).\n\n  * Allow compilation with base 4.15 (Albert Krewinkel).\n\n  * MANUAL:\n\n    + Add information about `lang` and bibliography sorting.\n    + Add info about YAML escape sequences, link to spec (#7152,\n      Albert Krewinkel).\n    + Note that `institute` variable works for HTML-based slides.\n    + Update documentation on citation syntax.\n    + Add citation example for locators and suffixes (Tristan Stenner)\n\n  * Updated and fixed typos in documentation (Charanjit Singh,\n    Anti-Distinctlyminty, Tatiana Porras, obcat).\n\n  * Add instructions for installing pandoc-types before compiling filter.\n\n  * INSTALL: add note that parallel installations should be avoided\n    (#6865).\n\n  * Remove `biblatex-nussbaum.md` test.  It is basically the same\n    as `biblaetx-quotes.md`.\n\n  * Command tests: fail if a file contains no tests---and fix a\n    test that failed in that way!\n\n  * Use smaller images in tests, reducing the size of the source tarball by 8 MB.\n\n\n## pandoc 2.13 (2021-03-21)\n\n  * Support `yaml_metadata_block` extension for `commonmark`, `gfm` (#6537).\n    This supported is a bit more limited than with pandoc's\n    `markdown`.  The YAML block must be the first thing in the input,\n    and the leaf notes are parsed in isolation from the rest of\n    the document.  So, for example, you can't use reference\n    links if the references are defined later in the document.\n\n  * Fix fallback to default partials when custom templates are used.\n    If the directory containing a template does not contain the partial,\n    it should be sought in the default templates, but this was not\n    working properly (#7164).\n\n  * Handle `nocite` better with `--biblatex` and `--natbib` (#4585).\n    Previously the nocite metadata field was ignored with these formats.\n    Now it populates a `nocite-ids` template variable and causes a\n    `\\nocite` command to be issued.\n\n  * Text.Pandoc.Citeproc: apply `fixLinks` correctly (#7130).  This is code\n    that incorporates a prefix like `https://doi.org/` into a following link\n    when appropriate.\n\n  * Text.Pandoc.Shared:\n\n    + Remove `backslashEscapes`, `escapeStringUsing` [API change].  Replace\n      these inefficient association list lookups with more efficient escaping\n      functions in the writers that used them (for a 10-25% performance boost\n      in org, haddock, rtf, texinfo writers).\n    + Remove `ToString`, `ToText` typeclasses [API change].  These were needed\n      for the transition from String to Text, but they are no longer used and\n      may clash with other things.\n    + Simplify `compactDL`.\n\n  * Text.Pandoc.Parsing:\n\n    + Change type of `readWithM` so that it is no longer polymorphic\n      [API change].  The `ToText` class has been removed, and now that we've\n      completed the transition to Text we no longer need this to operate\n      on Strings.\n    + Remove `F` type synonym [API change].  Muse and Org were defining their\n      own `F` anyway.\n\n  * Text.Pandoc.Readers.Metadata:\n\n    + Export `yamlMetaBlock` [API change].\n    + Make `yamlBsToMeta`, `yamlBsToRefs` polymorphic on the parser state\n      [API change].\n\n  * Markdown reader: Fix regression with `tex_math_backslash` (#7155).\n\n  * MediaWiki reader: Allow block-level content in notes (ref) (#7145).\n\n  * Jira reader (Albert Krewinkel):\n\n    + Fixed parsing of autolinks (i.e., of bare URLs in the text).\n      Previously an autolink would take up the rest of a line, as spaces\n      were allowed characters in these items.\n    + Emoji character sequences no longer cause parsing failures. This was\n      due to missing backtracking when emoji parsing fails.\n    + Mark divs created from panels with class \"panel\".\n\n  * RST reader: fix logic for ending comments (#7134).  Previously comments\n    sometimes got extended too far.\n\n  * DocBook writer:  include Header attributes as XML attributes on\n    section (Erik Rask).  Attributes with key names that are not allowed\n    as XML attributes are dropped, as are attributes with invalid values\n    and `xml:id` (DocBook 5) and `id` (DocBook 4).\n\n  * Docx writer:\n\n    + Make `nsid` in `abstractNum` deterministic.  Previously we assigned\n      a random number, but we don't need random values, so now we just\n      assign a value based on the list marker.\n    + Use integral values for `w:tblW` (#7141).\n\n  * Jira writer (Albert Krewinkel):\n\n    + Block quotes are only rendered as `bq.` if they do not contain a\n      linebreak.\n    + Jira writer: improve div/panel handling.  Include div attributes in\n      panels, always render divs with class `panel` as panels, and\n      avoid nesting of panels.\n\n  * HTML writer: Add warnings on duplicate attribute values.\n    This prevents emitting invalid HTML.  Ultimately it would be good to\n    prevent this in the types themselves, but this is better for now.\n\n  * Org writer: Prevent unintended creation of ordered list items (#7132,\n    Albert Krewinkel).  Adjust line wrapping if default wrapping would cause\n    a line to be read as an ordered list item.\n\n  * JATS templates: support 'equal-contrib' attrib for authors (Albert\n    Krewinkel).  Authors who contributed equally to a paper may be marked\n    with `equal-contrib`.\n\n  * reveal.js template: replace JS comment with HTML (#7154, Florian Kohrt).\n\n  * Text.Pandoc.Logging: Add `DuplicateAttribute` constructor to `LogMessage`.\n    [API change]\n\n  * Use `-j4` for linux release build.  This speeds up the build dramatically\n    on arm.\n\n  * cabal.project: remove ghcoptions.  Move flags to top level, so they can\n    be set differently on the command line.\n\n  * Require latest texmath, skylighting, citeproc, jira-wiki-markup.\n    (The latest skylighting fixes a bad bug with Haskell syntax highlighting.)\n    Narrow version bounds for texmath, skylighting, and citeproc, since\n    the test output depend on them.\n\n  * Use doclayout 0.3.0.2.  This significantly reduces the time and memory\n    needed to compile pandoc.\n\n  * Use `foldl'` instead of `foldl` everywhere.\n\n  * Update bounds for random (#7156, Alexey Kuleshevich).\n\n  * Remove uses of some partial functions.\n\n  * Don't bake in a larger stack size for the executable.\n\n  * Test improvements:\n\n    + Use `getExecutablePath` from base, avoiding the dependency on\n      `executable-path`.\n    + Factor out `setupEnvironment` in Helpers, to avoid code duplication.\n    + Fix finding of data files by setting teh `pandoc_datadir` environment\n      variable when we shell out to pandoc. This avoids the need to use\n      `--data-dir` for the tests, which caused problems finding `pandoc.lua`\n      when compiling without the `embed_data_files` flag (#7163).\n\n  * Benchmark improvements:\n\n    + Build `+RTS -A8m -RTS` into default ghc-options for benchmark.\n      This is necessary to get accurate benchmark results; otherwise we\n      are largely measuring garbage collecting, some not related to the\n      current benchmark.\n    + Allow specifying BASELINE file in 'make bench' for comparison\n      (otherwise the latest benchmark is chosen by default).\n    + Force `readFile` in benchmarks early (Bodigrim).\n\n  * CONTRIBUTING: suggest using a `cabal.project.local` file (#7153,\n    Albert Krewinkel).\n\n  * Add ghcid-test to Makefile.  This loads the test suite in ghcid.\n\n\n## pandoc 2.12 (2021-03-08)\n\n  * `--resource-path` now accumulates if specified multiple\n    times (#6152).  Resource paths specified later on the command line are\n    prepended to those specified earlier.  Thus,\n    `--resource-path foo --resource-path bar:baz` is equivalent to\n    `--resource-path bar:bas:foo`.  (The previous behavior was\n    for the last `--resource-path` to replace all the rest.)\n    `resource-path` in defaults files behaves the same way: it\n    will be prepended to the resource path set by earlier\n    command line options or defaults files.  This change\n    facilitates the use of multiple defaults files: each can\n    specify a directory containing resources it refers to\n    without clobbering the resource paths set by the others.\n\n  * Allow defaults files to refer to the home directory, the\n    user data directory, and the directory containing the defaults file\n    itself (#5871, #5982, #5977).  In fields that expect file paths\n    (and only in these fields),\n\n    + `${VARIABLE}` will expand to the value of the environment variable\n      `VARIABLE` (and in particular `${HOME}` will expand to the path\n      of the home directory).  A warning will be raised for undefined\n      variables.\n    + `${USERDATA}` will expand to the path of the user data\n      directory in force when the defaults file is being processed.\n    + `${.}` will expand to the directory containing the defaults file.\n      (This allows default files to be placed in a directory containing\n      resources they make use of.)\n\n  * When downloading content from URL arguments, be sensitive to\n    the character encoding (#5600).  We can properly handle UTF-8 and latin1\n    (ISO-8859-1); for others we raise an error.  Fall back to latin1 if\n    no charset is given in the mime type and UTF-8 decoding fails.\n\n  * Allow abbreviations that don't end in a period to be\n    specified using `--abbreviations` (#7124).\n\n  * Add new unexported module Text.Pandoc.XML.Light, as well\n    as Text.Pandoc.XML.Light.Types, Text.Pantoc.XML.Light.Proc,\n    Text.Pandoc.XML.Light.Output.  (Closes #6001, #6565, #7091).\n\n    This module exports definitions of `Element` and `Content`\n    that are isomorphic to xml-light's, but with Text\n    instead of String.  This allows us to keep most of the code in existing\n    readers that use xml-light, but avoid lots of unnecessary allocation.\n\n    We also add versions of the functions from xml-light's\n    Text.XML.Light.Output and Text.XML.Light.Proc that operate on our\n    modified XML types, and functions that convert xml-light types to our\n    types (since some of our dependencies, like texmath, use xml-light).\n\n    We export functions that use xml-conduit's parser to produce an\n    `Element` or `[Content]`.  This allows existing pandoc code to use\n    a better parser without much modification.\n\n    The new parser is used in all places where xml-light's parser was\n    previously used.  Benchmarks show a significant performance improvement\n    in parsing XML-based formats (with docbook, opml, jats, and docx\n    almost twice as fast, odt and fb2 more than twice as fast).\n\n    In addition, the new parser gives us better error reporting than\n    xml-light.  We report XML errors, when possible, using the new\n    `PandocXMLError` constructor in `PandocError`.\n\n    These changes revealed the need for some changes in the tests.  The\n    docbook-reader.docbook test lacked definitions for the entities it used;\n    these have been added. And the docx golden tests have been updated,\n    because the new parser does not preserve the order of attributes.\n\n  * DocBook reader:\n\n    + Avoid expensive tree normalization step, as it is not necessary\n      with the new XML parser.\n    + Support `informalfigure` (#7079) (Nils Carlson).\n\n  * Docx reader:\n\n    + Use Map instead of list for Namespaces.  This gives a speedup of\n      about 5-10%. With this and the XML parsing changes, the docx reader\n      is now about twice as fast as in the previous release.\n\n  * HTML reader:\n\n    + Small performance tweaks.\n    + Also, remove exported class `NamedTag(..)` [API change]. This was just\n      intended to smooth over the transition from String to Text and is no\n      longer needed.\n    + As a result, the functions `isInlineTag` and `isBlockTag`\n      are no longer polymorphic; they apply to a `Tag Text` [API change].\n    + Do a lookahead to find the right parser to use.  This takes\n      benchmarks from 34ms to 23ms, with less allocation.\n    + Fix bad handling of empty `src` attribute in `iframe` (#7099).\n      If `src` is empty, we simply skip the `iframe`.\n      If `src` is invalid or cannot be fetched, we issue a warning\n      nd skip instead of failing with an error.\n\n  * JATS reader:\n\n    + Avoid tree normalization, which is no longer necessary given the\n      new XML parser.\n\n  * LaTeX reader:\n\n    + Don't export `tokenize`, `untokenize` [API change].  These are internal\n      implementation details, which were only exported for testing.\n      They don't belong in the public API.\n    + Improved efficiency of the parser.  With these changes the reader\n      is almost twice as fast as in the last release in our benchmarks.\n    + Code cleanup, removing some unnecessary things.\n    + Rewrite `withRaw` so it doesn't rely on fragile assumptions\n      about token positions (which break when macros are expanded)\n      (#7092).  This requires the addition of `sEnableWithRaw` and\n      `sRawTokens` in `LaTeXState`, and a new combinator `disablingWithRaw`\n      to disable collecting of raw tokens in certain contexts.\n      Add `parseFromToks` to Text.Pandoc.Readers.LaTeX.Parsing.\n      Fix parsing of single character tokens so it doesn't mess\n      up the new raw token collecting.  These changes slightly increase\n      allocations and have a small performance impact.\n    + Handle some bibtex/biblatex-specific commands that used to be\n      dealt with in pandoc-citeproc (#7049).\n    + Optimize `satisfyTok`, avoiding unnecessary macro expansion steps.\n      Benchmarks after this change show 2/3 of the run time and 2/3 of the\n      allocation of the Feb. 10 benchmarks.\n    + Removed `sExpanded` in state.  This isn't actually needed and checking\n      it doesn't change anything.\n    + Improve `braced'`.  Remove the parameter, have it parse the\n      opening brace, and make it more efficient.\n    + Factor out pieces of the LaTeX reader to make the module smaller.\n      This reduces memory demands when compiling.  Created\n      Text.Pandoc.Readers.{LaTeX,Math,Citation,Table,Macro,Inline}.\n      Changed Text.Pandoc.Readers.LaTeX.SIunitx to export a command map\n      instead of individual commands.\n    + Handle table cells containing `&` in `\\verb` (#7129).\n\n  * Make Text.Pandoc.Readers.LaTeX.Types an unexported module [API change].\n\n  * Markdown reader:\n\n    + Improved handling of mmd link attributes in references (#7080).\n      Previously they only worked for links that had titles.\n    + Improved efficiency of the parser (benchmarks show a 15% speedup).\n\n  * OPML reader:\n\n    + Avoid tree normalization, which is no longer necessary with the\n      new XML parser.\n\n  * ODT reader:\n\n    + Finer-grained errors on parse failure (#7091).\n    + Give more information if the zip container can't be unpacked.\n\n  * Org reader:\n\n    + Support `task_lists` extension (Albert Krewinkel, #6336).\n    + Fix bug in org-ref citation parsing (Albert Krewinkel, #7101).\n      The org-ref syntax allows to list multiple citations separated by\n      comma.  Previously commas were accepted as part of the citation id,\n      so all citation lists were parsed as one single citation.\n\n  * RST reader:\n\n    + Use `getTimestamp` instead of `getCurrentTime` to fetch timestamp.\n      Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.\n    + RST reader: fix handling of header in CSV tables (#7064).\n      The interpretation of this line is not affected by the delim option.\n\n  * Jira reader:\n\n    + Modified the Doc parser to skip leading blank lines. This fixes\n      parsing of documents which start with multiple blank lines (Albert\n      Krewinkel, #7095).\n    + Prevent URLs within link aliases to be treated as autolinks (Albert\n      Krewinkel, #6944).\n\n  * Text.Pandoc.Shared\n\n    + Remove formerly exported functions that are no longer used in the\n      code base: `splitByIndices`, `splitStringByIndicies`, `substitute`,\n      and `underlineSpan` (which had been deprecated in April 2020)\n      [API change].\n    + Export `handleTaskListItem` (Albert Krewinkel) [API change].\n    + Change `defaultUserDataDirs` to `defaultUserDataDir` [API\n      change].  We determine what is the default user data directory\n      by seeing whether the XDG directory and/or legacy\n      directory exist.\n\n  * BibTeX writer:\n\n    + BibTeX writer: use doclayout and doctemplate.  This change allows\n      bibtex/biblatex output to wrap as other formats do,\n      depending on the settings of `--wrap` and `--columns` (#7068).\n\n  * CSL JSON writer:\n\n    + Output `[]` if no references in input, instead of raising a\n      PandocAppError as before.\n\n  * Docx writer:\n\n    + Use `getTimestamp` instead of `getCurrentTime` for timestamp.\n      Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.\n\n  * EPUB writer:\n\n    + Use `getTimestamp` instead of `getCurrentTime` for timestamp.\n      Setting `SOURCE_DATE_EPOCH` will allow reproducible builds (#7093).\n      This does not suffice to fully enable reproducible in EPUB, since\n      a unique id is still being generated for each build.\n    + Support `belongs-to-collection` metadata (#7063) (Nick Berendsen).\n\n  * JATS writer:\n\n    + Escape special chars in reference elements (Albert Krewinkel).\n      Prevents the generation of invalid markup if a citation element\n      contains an ampersand or another character with a special meaning\n      in XML.\n\n  * Jira writer:\n\n    + Use Span identifiers as anchors (Albert Krewinkel).\n    + Use `{noformat}` instead of `{code}` for unknown languages (Albert\n      Krewinkel). Code blocks which are not marked as a language supported\n      by Jira are rendered as preformatted text via `{noformat}` blocks.\n\n  * LaTeX writer:\n\n    + Adjust hypertargets to beginnings of paragraphs (#7078).\n      Use `\\vadjust pre` so that the hypertarget takes you to the beginning\n      of the paragraph rather than one line down.\n      This makes a particular difference for links to citations using\n      `--citeproc` and `link-citations: true`.\n    + Change BCP47 lang tag from `jp` to `ja` (Mauro Bieg, #7047).\n    + Use function instead of map for accent lookup (should be\n      more efficient).\n    + Split the module to make it easier to compile on low-memory\n      systems:  added Text.Pandoc.Writers.LaTeX.{Util,Citation,Lang}.\n\n  * Markdown writer:\n\n    + Handle math right before digit.  We insert an HTML comment to\n      avoid a `$` right before a digit, which pandoc will not recognize\n      as a math delimiter.\n    + Split the module to make it easier to compile on low-memory\n      systems: added Text.Pandoc.Writers.Markdown.{Types,Inline}.\n\n  * ODT writer:\n\n    + Use `getTimestamp` instead of `getCurrentTime` for timestamp.\n      Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.\n    + Update default ODT style (Lorenzo).  Previously, the \"First paragraph\"\n      style inherited from \"Standard\" but not from \"Text body.\" Now\n      it is adjusted to inherit from \"Text body\", to avoid some ugly\n      spacing issues. It may be necessary to update a custom `reference.odt`\n      in light of this change.\n\n  * Org writer:\n\n    + Support `task_lists` extension (Albert Krewinkel, #6336).\n\n  * Pptx writer:\n\n    + Use `getTimestamp` instead of `getCurrentTime` for timestamp.\n      Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.\n\n  * JATS templates: tag `author.name` as `string-name` (Albert Krewinkel).\n    The partitioning the components of a name into surname, given names,\n    etc. is not always possible or not available. Using `author.name`\n    allows to give the full name as a fallback to be used when\n    `author.surname` is not available.\n\n  * Add default templates for bibtex and biblatex, so that\n    the variables `header-include`, `include-before`, `include-after`\n    (or alternatively the command line options\n    `--include-in-header`, `--include-before-body`, `--include-after-body`)\n    may be used.\n\n  * LaTeX template:\n\n    + Update to iftex package (#7073) (Andrew Dunning)\n    + Wrap url colours in braces (#7121) (Loïc Grobol).\n\n  * revealjs template: Add 'center' option for vertical slide centering.\n    (maurerle, #7104).\n\n  * Text.Pandoc.XML: Improve efficiency of `fromEntities`.\n\n  * Text.Pandoc.MIME\n\n    + Add exported function `getCharset` [API change].\n\n  * Text.Pandoc.UTF8: change IO functions to return Text, not String\n    [API change].  This affects `readFile`, `getContents`, `writeFileWith`,\n    `writeFile`, `putStrWith`, `putStr`, `putStrLnWith`, `putStrLn`.\n    `hPutStrWith`, `hPutStr`, `hPutStrLnWith`, `hPutStrLn`, `hGetContents`.\n    This avoids the need to uselessly create a linked list of characters\n    when emiting output.\n\n  * Text.Pandoc.App\n\n    + Add `parseOptionsFromArgs` [API change, new exported function].\n    + Add fields for CSL options to `Opt` [API change]:\n      `optCSL`, `optbibliography`, `optCitationAbbreviations`.\n\n  * Text.Pandoc.Citeproc.BibTeX\n\n    + `Text.Pandoc.Citeproc.writeBibTeXString` now returns\n      `Doc Text` instead of `Text` (#7068).\n    + Correctly handle `pages` (= `page` in CSL) (#7067).\n    + Correctly handle BibLaTeX `langid` (= `language` in CSL, #7067).\n    + In BibTeX output, protect foreign titles since there's no language\n      field (#7067).\n    + Clean up BibTeX parsing (#7049).  Previously there was a messy code\n      path that gave strange results in some cases, not passing through raw\n      tex but trying to extract a string content.  This was an artefact of\n      trying to handle some special bibtex-specific commands in the BibTeX\n      reader. Now we just handle these in the LaTeX reader and simplify\n      parsing in the BibTeX reader. This does mean that more raw tex will\n      be passed through (and currently this is not sensitive to the\n      `raw_tex` extension; this should be fixed).\n\n  * Text.Pandoc.Citeproc.MetaValue\n\n    + Correctly parse \"raw\" date value in markdown references metadata.\n      (See jgm/citeproc#53.)\n\n  * Text.Pandoc.Citeproc\n\n    + Use https URLs for links (Salim B, #7122).\n\n  * Text.Pandoc.Class\n\n    + Add `getTimestamp` [API change].  This attempts to read the\n      `SOURCE_DATE_EPOCH` environment variable and parse a UTC time\n      from it (treating it as a unix date stamp, see\n      https://reproducible-builds.org/specs/source-date-epoch/). If the\n      variable is not set or can't be parsed as a unix date stamp, then the\n      function returns the current date.\n\n  * Text.Pandoc.Error\n\n    + Add `PandocUnsupportedCharsetError` constructor for\n      `PandocError` [API change].\n    + Export `renderError` [API change].\n    + Refactor `handleError` to use `renderError`. This allows us render\n      error messages without exiting.\n\n  * Text.Pandoc.Extensions\n\n    + `Ext_task_lists` is now supported by org (and turned\n      on by default) (Albert Krewinkel, #6336).\n    + Remove `Ext_fenced_code_attributes` from allowed commonmark attributes\n      (#7097).  This attribute was listed as allowed, but it didn't actually\n      do anything. Use `attributes` for code attributes and more.\n\n  * Lua subsystem:\n\n    + Always load built-in Lua scripts from default data-dir (Albert\n      Krewinkel).  The Lua modules `pandoc` and `pandoc.List` are now always\n      loaded from the system's default data directory. Loading from a\n      different directory by overriding the default path, e.g. via\n      `--data-dir`, is no longer supported to avoid unexpected behavior\n      and to address security concerns.\n    + Add module \"pandoc.path\" (Albert Krewinkel, #6001, #6565).\n      The module allows to work with file paths in a convenient and\n      platform-independent manner.\n    + Use strict evaluation when retrieving AST value from the stack\n      (Albert Krewinkel, #6674).\n\n  * Text.Pandoc.PDF\n\n    + Disable `smart` extension when building PDF via LaTeX.\n      This is to prevent accidental creation of ligatures like\n      `` ?` `` and `` !` `` (especially in languages with quotations like\n      German), and similar ligature issues.  (See jgm/citeproc#54.)\n\n  * Text.Pandoc.CSV:\n\n    + Fix parsing of unquoted values (#7112).  Previously we didn't allow\n      unescaped quotes in unquoted values, but they are allowed\n      in CSV.\n\n  * Test suite:\n\n    + Use a more robust method for testing the executable.  Many\n      of our tests require running the pandoc executable. This\n      is problematic for a few different reasons. First,\n      cabal-install will sometimes run the test suite after\n      building the library but before building the executable,\n      which means the executable isn't in place for the tests.\n      One can work around that by first building, then building\n      and running the tests, but that's fragile.  Second, we\n      have to find the executable. So far, we've done that using\n      a function `findPandoc` that attempts to locate it\n      relative to the test executable (which can be located\n      using findExecutablePath).  But the logic here is delicate\n      and work with every combination of options.  To solve both\n      problems, we add an `--emulate` option to the\n      `test-pandoc` executable.  When `--emulate` occurs as the\n      first argument passed to `test-pandoc`, the program simply\n      emulates the regular pandoc executable, using the rest of\n      the arguments (after `--emulate`). Thus, `test-pandoc\n      --emulate -f markdown -t latex` is just like `pandoc -f\n      markdown -t latex`.  Since all the work is done by library\n      functions, implementing this emulation just takes a couple\n      lines of code and should be entirely reliable.  With this\n      change, we can test the pandoc executable by running the\n      test program itself (locatable using `findExecutablePath`)\n      with the `--emulate` option. This removes the need for the\n      fragile `findPandoc` step, and it means we can run our\n      integration tests even when we're just building the\n      library, not the executable.  [Note: part of this change\n      involved simplifying some complex handling to set\n      environment variables for dynamic library paths.  I have\n      tested a build with `--enable-dynamic-executable`, and it\n      works, but further testing may be needed.]\n    + Print accurate location if a test fails (Albert\n      Krewinkel).  Ensures that tasty-hunit reports the location\n      of the failing test instead of the location of the helper\n      `test` function.\n\n  * Documentation: Update URLs and use `https` where possible (#7122,\n    Salim B).\n\n  * Add `doc/libraries.md`, a description of libraries that support pandoc.\n\n  * MANUAL.txt\n\n    + MANUAL: block-level formatting is not allowed in line blocks (#7107).\n    + Clarify `tex_math_dollars` extension.  Note that no blank lines\n      are allowed between the delimiters in display math.\n    + Add MANUAL section on reproducible builds.\n    + Document no template fallback for absolute path (#7077, Nixon\n      Enraght-Moony.)\n    + Improve docs for cite-method.\n    + Update README and man page.\n\n  * Makefile: in `make bench`, create CSV files for comparison and compare\n    against previous benchmark run.  Add timestamp to CSV filenames.\n\n  * cabal.project: don't explicitly set -trypandoc.\n    If we do, this can't be overridden on the cabal command line.\n\n  * doc/lua-filters.md: improve documentation for\n    `pandoc.mediabag.insert`, `pandoc.mediabag.fetch`,\n    `directory`, `normalize` (Albert Krewinkel).\n\n  * Allow base64-bytestring-1.2.* (Dmitrii Kovanikov)\n\n  * Require jira-wiki-markup 1.3.3 (Albert Krewinkel)\n\n  * Require citeproc 0.3.0.8, which correctly titlecases when titles\n    contain non-ASCII characters.\n\n  * Use skylighting 0.10.4.  This version of skylighting uses xml-conduit\n    rather than hxt. This speeds up parsing of XML syntax definitions\n    fourfold, and removes four packages from pandoc's dependency graph:\n    hxt-charproperties, hxt-unicode, hxt-regex-xmlschema, hxt.\n\n  * Add script `tools/parseTimings.pl` to help pin down which\n    modules take the most time and memory to compile.\n\n  * Avoid unnecessary use of NoImplicitPrelude pragma (#7089) (Albert\n    Krewinkel)\n\n  * Benchmarks\n\n    + Use the lighter-weight tasty-bench instead of criterion.\n    + Run writer benchmarks for binary formats too.\n    + Alphabetize benchmarks.\n    + Don't run benchmarks for bibliography formats\n      (yet; we need a special input for them).\n    + Show allocation data\n    + Clean up benchmark code.\n    + Allow specifying patterns using `-p blah'.\n\n  * trypandoc: add 2 second timeout.\n\n  * Use `-split-sections` in creating linux release binary.\n    This reduces executable size significantly (by about 30%).\n\n  * Remove `weigh-pandoc`.  It's not really useful any more, now that our\n    regular benchmarks include data on allocation.\n\n  * Improve linux package build process and add script to\n    automate building an arm64 binary package.\n\n\n## pandoc 2.11.4 (2021-01-22)\n\n  * Add `biblatex`, `bibtex` as output formats (closes #7040).\n\n  * Recognize more extensions as markdown by default (#7034):\n    `mkdn`, `mkd`, `mdwn`, `mdown`, `Rmd`.\n\n  * Implement defaults file inheritance (#6924, David Martschenko).\n    Allow defaults files to inherit options from other defaults files by\n    specifying them with the following syntax:\n    `defaults: [list of defaults files or single defaults file]`.\n\n  * Fix infinite HTTP requests when writing epubs from URL source (#7013).\n    Due to a bug in code added to avoid overwriting the cover image\n    if it had the form `fileX.YYY`, pandoc made an endless sequence\n    of HTTP requests when writing epub with input from a URL.\n\n  * Org reader:\n\n    + Allow multiple pipe chars in todo sequences (Albert Krewinkel, #7014).\n      Additional pipe chars, used to separate \"action\" state from \"no further\n      action\" states, are ignored. E.g., for the following sequence, both\n      `DONE` and `FINISHED` are states with no further action required:\n      `#+TODO: UNFINISHED | DONE | FINISHED`.\n    + Restructure output of captioned code blocks (Albert Krewinkel, #6977).\n      The Div wrapper of code blocks with captions now has the class\n      \"captioned-content\". The caption itself is added as a Plain block\n      inside a Div of class \"caption\". This makes it easier to write filters\n      which match on captioned code blocks. Existing filters will need to be\n      updated.\n    + Mark verbatim code with class `verbatim` (Dimitri Sabadie, #6998).\n\n  * LaTeX reader:\n\n    + Handle `filecontents` environment (#7003).\n    + Put contents of unknown environments in a Div when `raw_tex` is not\n      enabled (#6997). (When `raw_tex` is enabled, the whole environment is\n      parsed as a raw block.) The class name is the name of the environment.\n      Previously, we just included the contents without the surrounding Div,\n      but having a record of the environment's boundaries and name can be\n      useful.\n\n  * Mediawiki reader:\n\n    + Allow space around storng/emph delimiters (#6993).\n\n  * New module Text.Pandoc.Writers.BibTeX, exporting\n    writeBibTeX and writeBibLaTeX. [API change]\n\n  * LaTeX writer:\n\n    + Revert table line height increase in 2.11.3 (#6996).\n      In 2.11.3 we started adding `\\addlinespace`, which produced less dense\n      tables.  This wasn't an intentional change; I misunderstood a comment in\n      the discussion leading up to the change. This commit restores the earlier\n      default table appearance.  Note that if you want a less dense table, you\n      can use something like `\\def\\arraystretch{1.5}` in your header.\n\n  * EPUB writer:\n\n    + Adjust internal links to identifiers defined in raw HTML sections\n      after splitting into chapters (#7000).\n    + Recognize `Format \"html4\"`, `Format \"html5\"` as raw HTML.\n    + Adjust internal links to images, links, and tables after splitting into\n      chapters. Previously we only did this for Div and Span and Header\n      elements (see #7000).\n\n  * Ms writer:\n\n    + Don't justify text inside table cells.\n\n  * JATS writer:\n\n    + Use `<element-citation>` if `element_citations`\n      extension is enabled (Albert Krewinkel).\n    + Fix citations (Albert Krewinkel, #7018).  By default\n      we use formatted citations.\n    + Ensure that `<disp-quote>` is always wrapped in `<p>` (#7041).\n\n  * Markdown writer:\n\n    + Cleaned up raw formats.  We now react appropriately\n      to `gfm`, `commonmark`, and `commonmark_x` as raw formats.\n\n  * RST writer:\n\n    + Fix bug with dropped content from inside spans with a class in\n      some cases (#7039).\n\n  * Docx writer:\n\n    + Handle table header using styles (#7008).  Instead of hard-coding\n      the border and header cell vertical alignment, we now let this\n      be determined by the Table style, making use of Word's\n      \"conditional formatting\" for the table's first row.  For\n      headerless tables, we use the tblLook element to tell Word\n      not to apply conditional first-row formatting.\n\n  * Commonmark writer:\n\n    + Implement start number on ordered lists (#7009).  Previously they always\n      started at 1, but according to the spec the start number is respected.\n\n  * HTML writer:\n\n    + Fix implicit_figure at end of footnotes (#7006).\n\n  * ConTeXt template: Remove `\\setupthinrules` from default template.\n    The width parameter this used is not actually supported,\n    and the command didn't do anything.\n\n  * Text.Pandoc.Extensions:\n\n    + Add `Ext_element_citations` constructor (Albert Krewinkel).\n\n  * Text.Pandoc.Citeproc.BibTeX: New unexported function\n    `writeBibtexString`.\n\n  * Text.Pandoc.Citeproc:\n\n    + Use finer grained imports (Albert Krewinkel).\n    + Factor out and export `getStyle` [API change].\n    + Export `getReferences` [API change, #7106].\n    + Factor out getLang.\n\n  * Text.Pandoc.Parsing: modify `gridTableWith'` for headerless tables.\n    If the table lacks a header, the header row should be an empty\n    list. Previously we got a list of empty cells, which caused\n    an empty header to be emitted instead of no header.  In LaTeX/PDF\n    output that meant we got a double top line with space between.\n\n  * ImageSize:  use `viewBox` for SVG if no length, width attributes (#7045).\n    This change allows pandoc to extract size information from more SVGs.\n\n  * Add simple default.nix.\n\n  * Use commonmark 0.1.1.3.\n\n  * Use citeproc 0.3.0.5.\n\n  * Update default CSL to use latest chicago-author-date.csl.\n\n  * CONTRIBUTING.md: add note on GNU xargs.\n\n  * MANUAL.txt:\n\n    + Update description of `-L`/`--lua-filter`.\n    + Document use of citations in note styles (#6828).\n\n## pandoc 2.11.3.2 (2020-12-29)\n\n  * HTML reader: use renderTags' from Text.Pandoc.Shared (Albert Krewinkel).\n    A side effect of this change is that empty `<col>` elements are written\n    as self-closing tags in raw HTML blocks.\n\n  * Asciidoc writer: Add support for writing nested tables (#6972, timo-a).\n    Asciidoc supports one level of nesting. If deeper tables are to be\n    written, they are omitted and a warning is issued.\n\n  * Docx writer: fix nested tables with captions (#6983).\n    Previously we got unreadable content, because docx seems\n    to want a `<w:p>` element (even an empty one) at the end of\n    every table cell.\n\n  * Powerpoint writer: allow arbitrary OOXML in raw inline elements\n    (Albert Krewinkel).  The raw text is now included verbatim in the\n    output. Previously is was parsed into XML elements, which prevented\n    the inclusion of partial XML snippets.\n\n  * LaTeX writer: support colspans and rowspans in tables (#6950,\n    Albert Krewinkel).  Note that the multirow package is needed for\n    rowspans.  It is included in the latex template under a variable,\n    so that it won't be used unless needed for a table.\n\n  * HTML writer: don't include p tags in CSL bibliography entries\n    (#6966).  Fixes a regression in 2.11.3.\n\n  * Add `meta-description` variable to HTML templates (#6982). This\n    is populated by the writer by stringifying the `description`\n    field of metadata (Jerry Sky).  The `description` meta tag will\n    make the generated HTML documents more complete and SEO-friendly.\n\n  * Citeproc: fix handling of empty URL variables (`DOI`, etc.).\n    The `linkifyVariables` function was changing these to links\n    which then got treated as non-empty by citeproc, leading\n    to wrong results (e.g. ignoring nonempty URL when empty DOI is present).\n    See jgm/citeproc#41.\n\n  * Use citeproc 0.3.0.3.  Fixes an issue in author-only citations when\n    both an author and translator are present, and an issue with\n    citation group delimiters.\n\n  * Require texmath 0.12.1.  This improves siunitx support in math,\n    fixes bugs with `\\*mod` family operators and arrays, and avoids\n    italicizing symbols and operator names in docx output.\n\n  * Ensure that the perl interpreter used for filters with `.pl`\n    extension (wuffi).\n\n  * MANUAL: note that textarea content is never parsed as Markdown\n    (Albert Krewinkel).\n\n\n## pandoc 2.11.3.1 (2020-12-18)\n\n  * Added some missing files to extra-source-files and data\n    files, so they are included in the sdist tarball.  Closes #6961.\n    Cleaned up some extraneous data and test files, and added\n    a CI check to ensure that the test and data files included\n    in the sdist match what is in the git repository.\n\n  * Use citeproc 0.3.0.1, which avoids removing nonbreaking\n    space at the end of the `initialize-with` attribute. (Some\n    journals require nonbreaking space after initials, and this\n    makes that possible.)\n\n## pandoc 2.11.3 (2020-12-17)\n\n  * With `--bibliography` (or `bibliography` in metadata), a\n    URL may now be provided, and pandoc will fetch the resource.\n    In addition, if a file path is provided and it is not\n    found relative to the working directory, the resource\n    path will be searched (#6940).\n\n  * Add `sourcepos` extension for `commonmark`, `gfm`, `commonmark_x`\n    (#4565).  With the `sourcepos` extension set set, `data-pos`\n    attributes are added to the AST by the commonmark reader. No other\n    readers are affected.  The `data-pos` attributes are put on elements\n    that accept attributes; for other elements, an enlosing Div or Span\n    is added to hold the attributes.\n\n  * Change extensions for `commonmark_x`: replace `auto_identifiers`\n    with `gfm_auto_identifiers` (#6863).  `commonmark_x` never actually\n    supported `auto_identifiers` (it didn't do anything), because the\n    underlying library implements gfm-style identifiers only.  Attempts\n    to add the `auto_identifiers` extension to `commonmark` will now\n    fail with an error.\n\n  * HTML reader:\n\n    + Split module into several submodules (Albert Krewinkel).  Reducing\n      module size should reduce memory use during compilation.\n    + Support advanced table features (Albert Krewinkel):\n      block level content in captions, row and colspans,\n      body headers, row head columns, footers, attributes.\n    + Disable round-trip testing for tables. Information for cell\n      alignment in a column is not preserved during round-trips (Albert\n      Krewinkel).\n    + Allow finer grained options for tag omission (Albert Krewinkel).\n    + Simplify list attribute handling (Albert Krewinkel).\n    + Pay attention to `lang` attributes on body element (#6938).\n      These (as well as `lang` attributes on the html element) should update\n      lang in metadata.\n    + Retain attribute prefixes and avoid duplicates (#6938).\n      Previously we stripped attribute prefixes, reading `xml:lang` as\n      `lang` for example. This resulted in two duplicate `lang`\n      attributes when `xml:lang` and `lang` were both used.  This commit\n      causes the prefixes to be retained, and also avoids invald\n      duplicate attributes.\n\n  * Commonmark reader:\n\n    + Refactor `specFor`.\n    + Set input name to `\"\"` to avoid clutter in sourcepos output.\n\n  * Org reader:\n\n    + Parse `#+LANGUAGE` into `lang` metadata field (#6845, Albert\n      Krewinkel).\n    + Preserve targets of spurious links (#6916, Albert\n      Krewinkel).  Links with (internal) targets that the reader doesn't\n      know about are converted into emphasized text. Information on the\n      link target is now preserved by wrapping the text in a Span of class\n      `spurious-link`, with an attribute `target` set to the link's\n      original target. This allows to recover and fix broken or unknown\n      links with filters.\n\n  * DocBook reader:\n\n    + Table text width support (#6791, Nils Carlson).\n      Table width in relation to text width is not natively supported\n      by docbook but is by the docbook `fo` stylesheets through an XML\n      processing instruction, `<?dbfo table-width=\"50%\"?>`.\n\n  * LaTeX reader:\n\n    + Improve parsing of command options (#6869, #6873).\n      In cases where we run into trouble parsing inlines til the\n      closing `]`, e.g. quotes, we return a plain string with the\n      option contents. Previously we mistakenly included the brackets\n      in this string.\n    + Preserve center environment (#6852, Igor Pashev).\n      The contents of the `center` environment are put in a `Div`\n      with class `center`.\n    + Don't parse `\\rule` with width 0 as horizontal rule. These are\n      sometimes used as spacers in LaTeX.\n    + Don't apply theorem default styling to a figure inside (#6925).\n      If we put an image in italics, then when rendering to Markdown\n      we no longer get an implicit figure.\n\n  * Dokuwiki reader:\n\n    + Handle unknown interwiki links better (#6932).\n      DokuWiki lets the user define his own Interwiki links.  Previously\n      pandoc reacted to these by emitting a google search link, which is\n      not helpful. Instead, we now just emit the full URL including the\n      wikilink prefix, e.g. `faquk>FAQ-mathml`.  This at least gives users\n      the ability to modify the links using filters.\n\n  * Markdown writer:\n\n    + Properly handle boolean values in writing YAML metadata (#6388).\n    + Ensure that a new csl-block begins on a new line (#6921).\n      This just looks better and doesn't affect the semantics.\n\n  * RST writer:\n\n    + Better image handling (#6948).  An image alone in its paragraph\n    (but not a figure) is now rendered as an independent image, with an\n    `alt` attribute if a description is supplied.  An inline image that\n    is not alone in its paragraph will be rendered, as before, using a\n    substitution.  Such an image cannot have a \"center\", \"left\", or\n    \"right\" alignment, so the classes `align-center`, `align-left`, or\n    `align-right` are ignored.  However, `align-top`, `align-middle`,\n    `align-bottom` will generate a corresponding `align` attribute.\n\n  * Docx writer:\n\n    + Keep raw openxml strings verbatim  (#6933, Albert Krewinkel).\n    + Use Content instead of Element.  This allows us to inject\n      raw OpenXML into the document without reparsing it into an\n      Element, which is necessary if you want to inject an open\n      tag or close tag.\n    + Fix bullets/lists indentation, so that the first level is slightly\n      indented to the right instead of right on the margin (cholonam).\n    + Support bold and italic in \"complex script\" (#6911).\n      Previously bold and italics didn't work properly in LTR\n      text.  This commit causes the w:bCs and w:iCs attributes\n      to be used, in addition to w:b and w:i, for bold and\n      italics respectively.\n\n  * ICML writer:\n\n    + Fix image bounding box for custom widths/heighta (Mauro Bieg, #6936).\n\n  * LaTeX writer:\n\n    + Improve table spacing (#6842, #6860).\n      Remove the `\\strut` that was added at the end of minipage\n      environments in cells.  Replace `\\tabularnewline` with\n      `\\\\ \\addlinespace`.\n    + Improve calculation of column spacing (#6883).\n    + Extract table handling into separate module (Albert Krewinkel).\n    + Fix bug with nested `csl-` display Spans (#6921).\n    + Improve longtable output (#6883).  Don't create minipages for\n      regular paragraphs.  Put width and alignment information in the\n      longtable column descriptors.\n\n  * OpenDocument writer:\n\n    + Support for table width as a percentage of text width\n      (#6792, Nils Carson).\n    + Implement Div and Span ident support (#6755, Nils Carson).\n      Spans and Divs containing an ident in the Attr will become bookmarks\n      or sections with idents in OpenDocument format.\n    + Add two extensions, `xrefs_name` and `xrefs_number` (#6774, Nils\n      Carlson).  Links to headings, figures and tables inside the\n      document are substituted with cross-references that will use the\n      name or caption of the referenced item for `xrefs_name` or the\n      number for `xrefs_number`.  For the `xrefs_number` to be useful\n      heading numbers must be enabled in the generated document and\n      table and figure captions must be enabled using for example the\n      `native_numbering` extension.  In order for numbers and reference\n      text to be updated the generated document must be refreshed.\n\n  * JATS writer:\n\n    + Support advanced table features (Albert Krewinkel).\n    + Support author affiliations (#6687, Albert Krewinkel).\n\n  * Docbook writer:\n\n    + Use correct id attribute consistently (Jan Tojnar).\n      DocBook5 should always use `xml:id` instead of `id`.\n    + Handle admonition titles better (Jan Tojnar).\n      Docbook reader produces a `Div` with `title` class for `<title>`\n      element within an “admonition” element. Markdown writer then turns\n      this into a fenced div with `title` class attribute. Since fenced\n      divs are block elements, their content is recognized as a\n      paragraph by the Markdown reader. This is an issue for Docbook\n      writer because it would produce an invalid DocBook document from\n      such AST – the `<title>` element can only contain “inline”\n      elements.  Handle this special case separately by unwrapping\n      the paragraph before creating the `<title>` element.\n    + Add XML namespaces to top-level elements (#6923, Jan Tojnar).\n      Previously, we only added `xmlns` attributes to chapter\n      elements, even when running with `--top-level-division=section`.\n      These namespaces are now added to part and section elements too,\n      when they are the selected top-level divisions.\n      We do not need to add namespaces to documents produced with\n      `--standalone` flag, since those will already have xmlns attribute on\n      the root element in the template.\n\n  * HTML writer:\n\n    + Fix handling of nested `csl-` display spans (#6921).\n      Previously inner Spans used to represent CSL display attributes were\n      not rendered as div tags as intended.\n\n  * EPUB writer:\n\n    + Include title page in landmarks (#6919).\n      Note that the toc is also included if `--toc` is specified.\n    + Add frontmatter type on body element for nav.xhtml (#6918).\n\n  * EPUB templates: use preserveAspectRatio=\"xMidYMid\" for cover image (#6895,\n    Shin Sang-jae).  This change affects both the epub2 and the epub3\n    templates.  It avoids distortion of the cover image by requiring that the\n    aspect ratio be preserved.\n\n  * LaTeX template:\n\n    + Include `csquotes` package if `csquotes` variable set.\n    + Put back `amssymb`.  We need it for checkboxes in todo lists,\n      and maybe for other things.  In this location it seems compatible\n      with the cases that prompted #6469 and PR #6762.\n    + Disable language-specific shorthands in babel (#6817, #6887).\n      Babel defines \"shorthands\" for some languages, and these can\n      produce unexpected results. For example, in Spanish, `1.22`\n      gets rendered as `122`, and `et~al.` as `etal`.\n      One would think that babel's `shorthands=off` option (which\n      we were using) would disable these, but it doesn't.  So we\n      remove `shorthands=off` and add some code that redefines\n      the shorthands macro.  Eventually this will be fixed in babel,\n      I hope, and we can revert to something simpler.\n\n  * JATS template: allow array of persistent institute ids in `pid`\n    (Albert Krewinkel).\n\n  * Text.Pandoc.Parsing:  minor code and efficiency improvements.\n\n  * Text.Pandoc.Extension:\n\n    + Add `Ext_sourcepos` constructor for `Extension` [API change].\n    + Add `Ext_xrefs_name` and `Ext_xrefs_number` constructors for\n      `Extension` (Nils Carson) [API change].\n\n  * Text.Pandoc.Citeproc:\n\n    + Fix truncation of `[Citation]` list in `Cite` inside footnotes (#6890).\n      This affected author-in-text citations in footnotes.  It didn't cause\n      problems for the printed output, but for filters that expected the\n      citation id and other information.\n    + Allow the use of both inline and external references (#6951),\n      as with pandoc-citeproc.  References defined in the document's\n      metadata take priority over references with the same id defined in\n      an external bibliography.\n    + Use `fetchItem` to get external bibliography (#6940).\n    + Ensure that BCP47 lang codes can be used.  We ignore the variants\n      and just use the base lang code and country code when passing off\n      to citeproc.\n    + Citeproc BibTeX parser: revert change in `getRawField`\n      which was made (for reasons forgotten) when transferring\n      this code from pandoc-citeproc.  The change led to `--` in\n      URLs being interpreted as en-dashes, which is unwanted (#6874).\n\n  * Text.Pandoc.ImageSize:\n\n    + Default to DPI 72 if the format specifies DPI of 0 (#6880).\n      This shouldn't happen, in general, but it can happen with\n      JPEGs that don't conform to the spec.  Having a DPI of 0\n      will blow up size calculations (division by 0).\n    + ImageSize: use JuicyPixels to determine size for png, jpeg, and\n      gif, instead of doing our own binary parsing (#6936). This\n      gives more reliable results.\n\n  * Text.Pandoc.CSS:\n\n    + Remove `foldOrElse` (internal module) (Albert Krewinkel).\n\n  * Use skylighting 0.10.2 (#6625).\n\n  * Use citeproc 0.3. This fixes issues with references with\n    duplicate ids (jgm/citeproc#36).\n\n  * Use doctemplates 0.9.  This fixes issues with boolean\n    metadata values in the Markdown writer (#6388)\n    and in `meta-json` (#6650).  It also fixes\n    issues with nested for loops in templates.\n\n  * Add translations zh-Hans.yaml and zh-Hant.yaml (#6904, #6909,\n    Kolen Cheung, taotieren).\n\n  * Add tests: True to cabal.project.\n    This fixes some CI failures for cabal.\n\n  * Normalize test/tables/*.native (#6888, Kolen Cheung).\n\n  * Move executable to `app` directory to avoid problems with cabal repl.\n\n  * CONTRIBUTING: add section \"How can I help?\" (#6892, Albert Krewinkel).\n    Also adds a paragraph aimed at highlighting the importance of feature\n    maintenance.\n\n  * MANUAL: Document that --number-sections works in `ms` (#6935).\n\n\n## pandoc 2.11.2 (2020-11-19)\n\n  * Default to using ATX (`##`-style) headings for Markdown output\n    (#6662, Aner Lucero).  Previously we used Setext (underlined) headings\n    by default for levels 1--2.\n\n  * Add option `--markdown-headings=atx|setext`, and deprecate\n    `--atx-headers` (#6662, Aner Lucero).\n\n  * Support `markdown-headings` in defaults files.\n\n  * Fix corner case in YAML metadata parsing (#6823).  Previously YAML\n    metadata would sometimes not get recognized if a field ended with a\n    newline followed by spaces.\n\n  * `--self-contained`: increase coverage (#6854).\n    Previously we only self-contained attributes for certain tag names\n    (`img`, `embed`, `video`, `input`, `audio`, `source`, `track`,\n    `section`).  Now we self-contain any occurrence of `src`,\n    `data-src`, `poster`, or `data-background-image`, on any tag; and\n    also `href` on `link` tags.\n\n  * Markdown reader:\n\n    + Fix detection of locators following in-text citations.\n      Prevously, if we had `@foo [p. 33; @bar]`, the `p. 33` would be\n      incorrectly parsed as a prefix of `@bar` rather than a suffix of\n      `@foo`.\n    + Improve period suppression algorithm for citations in notes\n      in note citation styles (#6835).\n    + Don't increment `stateNoteNumber` for example list references.\n      This helps with #6836 (a bug in which example list references\n      disturb calculation of citation note number and affect when\n      `ibid` is triggered).\n\n  * LaTeX reader:\n\n    + Move `getNextNumber` from Readers.LaTeX to Readers.LaTeX.Parsing.\n    + Fix negative numbers in siunitx commands.  A change in pandoc 2.11\n      broke negative numbers, e.g.  `\\SI{-33}{\\celcius}` or `\\num{-3}`.\n      This fixes the regression.\n\n  * DocBook reader: drop period in formalpara title\n    and put it in a div with class `formalpara-title`, so that\n    people can reformat with filters (#6562).\n\n  * Man reader: improve handling of `.IP` (#6858).  We now better handle\n    `.IP` when it is used with non-bullet, non-numbered lists, creating a\n    definition list.  We also skip blank lines like groff itself.\n\n  * Bibtex reader: fall back on `en-US` if locale for LANG not found.\n    This reproduces earlier pandoc-citeproc behavior (jgm/citeproc#26).\n\n  * JATS writer:\n\n    + Wrap all tables (Albert Krewinkel).\n      All `<table>` elements are put inside `<table-wrap>` elements, as the\n      former are not valid as immediate child elements of `<body>`.\n    + Move Table handling to separate module (Albert Krewinkel).\n      Adds two new unexported modules:\n      Text.Pandoc.Writers.JATS.Types, Text.Pandoc.Writers.JATS.Table.\n\n  * Org writer:\n\n    + Replace org #+KEYWORDS with #+keywords (TEC).\n      As of ~2 years ago, lower case keywords became the standard (though\n      they are handled case insensitive, as always).\n    + Update org supported languages and identifiers according to the\n      current list contained in\n      <https://orgmode.org/worg/org-contrib/babel/languages/index.html>\n      (TEC).\n\n  * Only use `filterIpynbOutput` if input format is ipynb (#6841).\n    Before this change content could go missing from divs with class\n    `output`, even when non-ipynb was being converted.\n\n  * When checking reader/writer name, check base name now that we permit\n    extensions on formats other than markdown.\n\n  * Text.Pandoc.PDF: Fix `changePathSeparators` for Windows (#6173).\n    Previously a path beginning with a drive, like `C:\\foo\\bar`, was\n    translated to `C:\\/foo/bar`, which caused problems.\n    With this fix, the backslashes are removed.\n\n  * Text.Pandoc.Logging:\n\n    + Add constructor `ATXHeadingInLHS` to `LogMessage` [API change].\n    + Add constructor `EnvironmentVariableUndefined` to\n      `LogMessage` [API change].\n\n  * Fix error that is given when people specify `doc` output (#6834,\n    gison93).\n\n  * LaTeX template:  add a `\\break` after parbox in `CSLRightInline`.\n    This should fix spacing problems between entries with numeric styles.\n    Also fix number of params on `CSLReferences`.\n\n  * reveal.js template: Put quotes around `controlsLayout`,\n    `controlsBackArrows`, and `display`, since these require strings.\n    Add `showSlideNumber`, `hashOneBasedIndex`, `pause`.\n\n  * Use citeproc 0.2.  This fixes a bug with title case around parentheses.\n\n  * pandoc.cabal: remove 'static' flag.\n    This isn't really necessary and can be misleading (e.g. on macOS,\n    where a fully static build isn't possible). cabal's new option\n    `--enable-executable-static` does the same. On stack you can add\n    something like this to the options for your executable in package.yaml:\n\n        ld-options: -static -pthread\n\n  * Remove obsolete bibutils flag setting in `linux/make_artifacts.sh`.\n\n  * Manual:\n\n    + Correct `link-citation` -> `link-citations`.\n    + Add a sentence about `pagetitle` for HTML (#6843, Alex Toldaiev).\n\n  * INSTALL.md: Remove references to `pandoc-citeproc` (#6857).\n\n  * CONTRIBUTING: describe hlint and how it's used (#6840, Albert\n    Krewinkel).\n\n## pandoc 2.11.1.1 (2020-11-07)\n\n  * Citeproc: improve punctuation in in-text note citations (#6813).\n    Previously in-text note citations inside a footnote would sometimes have\n    the final period stripped, even if it was needed (e.g. on the end of\n    'ibid').\n\n  * Use citeproc 0.1.1.1.  This improves the decision about when\n    to use `ibid` in cases where citations are used inside\n    a footnote (#6813).\n\n  * Support `nocase` spans for `csljson` output.\n\n  * Require latest commonmark, commonmark-extensions.\n    This fixes a bug with `autolink_bare_uris` and commonmark.\n\n  * LaTeX reader: better handling of `\\\\` inside math in table cells (#6811).\n\n  * DokuWiki writer:  translate language names for code elements\n    and improve whitespace (#6807).\n\n  * MediaWiki writer: use `syntaxhighlight` tag instead of deprecated\n    `source` for highlighted code (#6810).  Also support `startFrom`\n    attribute and `numberLines`.\n\n  * Lint code in PRs and when committing to master (#6790,\n    Albert Krewinkel).\n\n  * doc/filters.md: describe technical details of filter invocations (#6815,\n    Albert Krewinkel).\n\n\n## pandoc 2.11.1 (2020-11-03)\n\n  * DocBook Reader: fix duplicate bibliography bug (#6773, Nils Carlson).\n\n  * HTML reader:\n\n    + Parse contents of iframes (#6770).\n    + Parse inline svg as image unless `raw_html` is set in the reader (in\n      which case the svg is passed through as raw HTML) (#6770).\n\n  * LaTeX reader:\n\n    + Fix bug parsing macro arguments (#6796).  If `\\cL` is\n      defined as `\\mathcal{L}`, and `\\til` as `\\tilde{#1}`, then\n      `\\til\\cL` should expand to `\\tilde{\\mathcal{L}}`, but\n      pandoc was expanding it to `\\tilde\\mathcal{L}`.  This is\n      fixed by parsing the arguments in \"verbatim mode\" when the\n      macro expands arguments at the point of use.\n    + Properly support optional (cite) argument for\n      `\\blockquote` from `csquotes` (#6802).\n\n  * LaTeX writer: Improved calculation of table column widths.\n    We now have LaTeX do the calculation, using `\\tabcolsep`.\n    So we should now have accurate relative column widths no\n    matter what the text width.  The default template has been modified to load\n    the calc package if tables are used.\n\n  * HTML writer: Fix duplicate \"class\" attribute for table\n    rows (Andy Morris).\n\n  * Text.Pandoc.Filter: allow shorter YAML representation of Citeproc\n    (Albert Krewinkel).  The map-based YAML representation of filters expects\n    `type` and `path` fields. The path field had to be present for all filter\n    types, but is not used for citeproc filters. The field can now be omitted\n    when type is \"citeproc\", as described in the MANUAL.\n\n  * Text.Pandoc.Error: Add `PandocBibliographyError` constructor\n    for `PandocError` [API change].  This ensures that bibliography parsing\n    errors generate messages that include the bibliography file name --\n    otherwise it can be quite mysterious where it is coming from.\n\n  * Citeproc: properly handle `csl` field with `data:` URI (#6783).\n    This is used with the JATS writer, so this fixes a regression\n    in pandoc 2.11 with JATS output and citeproc.\n\n  * Allow `citation-abbreviations` in defaults file.\n\n  * JATS templates: ensure `jats_publishing` output is valid\n    (Albert Krewinkel).\n\n  * LaTeX template:  Fix `CSLRightInline`, so that it does not\n    run over the right margin.\n\n  * HTML template: default CSS tweaks (Mauro Bieg and John\n    MacFarlane).\n\n    - Fix margin before codeblock\n    - Add `monobackgroundcolor` variable, making the background color\n      and padding of code optional.\n    - Ensure that backgrounds from highlighting styles take precedence over\n      monobackgroundcolor\n    - Remove list markers from TOC\n    - Add margin-bottom where needed\n    - Remove italics from blockquote styling\n    - Change borders and spacing in tables to be more consistent with other\n       output formats\n    - Style h5, h6\n    - Set font-size for print media to 12pt.\n    - Reduce interline space.\n    - Reduce interparagraph space.\n    - Reduce line width.\n    - Remove the special `line-height: 1` for table cells.\n    - Remove the special line-height for pre.\n    - Ensure that there is a bit more space before a heading\n      than after.\n    - Slightly reduced space after title header.\n    - Add CSS example to MANUAL\n\n  * man template:  Change comment that triggers `tbl` from\n    `.\\\"t` to `'\\\" t`, as specified in groff_man(7) (#6803).\n\n  * Use latest commonmark, commonmark-extensions.\n    This fixes a bug with nested blocks in footnotes with the\n    `footnote` extension to `commonmark`.  See jgm/commonmark-hs#63.\n\n  * Citeproc: use comma for in-text citations inside footnotes.\n    When an author-in-text citation like `@foo` occurs in a footnote,\n    we now render it with:  `AUTHOR NAME + COMMA + SPACE + REST`.\n    Previously we rendered: `AUTHOR NAME + SPACE + \"(\" + REST + \")\"`.\n    This gives better results.  Note that normal citations are still\n    rendered in parentheses.\n\n  * Use latest citeproc:\n\n    + citeproc no longer capitalizes notes, so we do it\n      in pandoc when appropriate.\n    + Closes #6783.\n\n  * Clarify manual on `--track-changes` (#6801).\n\n  * Add `doc/jats.md` to document pandoc's handling of JATS\n    (#6794, Albert Krewinkel).\n\n  * Fix code example in lua-filters.md (#6795).\n\n## pandoc 2.11.0.4 (2020-10-21)\n\n  * Commonmark writer: fix regression with fenced divs (#6768).\n    Starting with 2.10.1, fenced divs no longer render with\n    HTML div tags in commonmark output.  This is a regression\n    due to our transition from cmark-gfm.  This commit fixes it.\n\n  * Use released version of citeproc.  (This fixes a mis-step\n    in the 2.11.0.3 release, which is now deprecated.)\n\n  * Use latest sylighting, with support for `groovy`.\n\n  * Document that --html-q-tags requires the smart extension on the reader\n    (#6766).\n\n## pandoc 2.11.0.3 (2020-10-20)\n\n  * Use latest citeproc (closes #6765). This fixes a problem with\n    author-in-text citations for references including both an author\n    and an editor. Previously, both were included in the text, but only\n    the author should be.\n\n  * With `--citeproc`, ensure that the final period is removed when\n    citations that occur in notes in note-based styles get put in\n    parentheses.  See jgm/citeproc#20.\n\n  * Normalize rewritten image paths with `--extract-media` (#6761).\n    This change will avoid mixed paths like this one when\n    `--extract-media` is used with a Word file:\n    `![](C:\\Git\\TIJ4\\Markdown/media/image30.wmf)`.  Instead we'll get\n    `![](C:\\Git\\TIJ4\\Markdown`media`image30.wmf)`.\n\n  * Modify `--version` output.  Use space more efficiently and report the\n    citeproc and ipynb versions, along with skylighting, texmath, and\n    pandoc-types.  Drop the word \"default\" before \"user data directory.\"\n\n  * DocBook reader: bibliomisc and anchor support (#6754, Nils Carlson).\n    Also ensure that bibliodiv without a title no longer results in\n    an empty Header.\n\n  * ConTeXt template: adds `\\setupinterlinespace` to fonts larger\n    than normal (#6763, Denis Maier).\n\n  * LaTeX template: Do not load amssymb if not needed (#6469, Angelo Peronio).\n    See <https://tex.stackexchange.com/a/549938>.\n\n  * Relax upper bound on hslua, allow hslua-1.3.* (Albert Krewinkel).\n\n  * MANUAL:\n\n    + Improve explanation of \"indent\" variable (#6767, Cyrus Yip).\n    + Remove org from list of input formats supporting raw_tex (#6753,\n      Nick Fleisher).\n\n\n## pandoc 2.11.0.2 (2020-10-15)\n\n  * Fix handling of `xdata` in bibtex/biblatex bibliographies (#6752).\n\n  * Fix some small typos in the API documentation (#6751, Michael Hoffmann).\n\n  * Require citeproc 0.1.0.2.  This fixes a regression from pandoc-citeproc\n    involving spacing between components of a reference in certain styles\n    (e.g. `cell.csl`).\n\n  * Fix typos in comments, doc strings, error messages, and tests\n    (Albert Krewinkel, #6738).\n\n## pandoc 2.11.0.1 (2020-10-13)\n\n  * LaTeX reader: support more acronym commands (#6746):\n    `\\acl`, `\\aclp`, and capitalized versions of already\n    supported commands.\n\n  * Commonmark reader: add `pipe_table` extension *after* defaults (#6739).\n    Otherwise we get bad results for non-table, non-paragraph\n    lines containing pipe characters.\n\n  * Markdown writer: Fix autolinks rendering for gfm (#6740).\n    Previously, autolinks rendered as raw HTML, due to the\n    `class=\"uri\"` added by pandoc's markdown reader.\n\n  * LaTeX writer:\n\n    + Escape option values in lstlistings environment (#6742).\n    + Fix handling of `lang` `pt-BR` (#2953).  For polyglossia we now\n      use `\\setmainlanguage[variant=brazilian]{portuguese}` and for babel\n      `\\usepackage[shorthands=off,main=brazilian]{babel}`.\n\n  * Depend on latest citeproc (0.1.0.1).\n\n    + This fixes the citation number issue with ieee.csl and other\n      styles that do not explicitly sort bibliographies (#6741). (Pandoc\n      was numbering them by their order in the bibliography file,\n      rather than the order cited, as required by the CSL spec.)\n    + Fixes groupin/collapsing with citation items with prefixes.\n\n  * default.latex: fix `CSLReference` macro definition.\n\n  * Fix MANUAL.txt CSL JSON conversion examples.\n\n  * Fix spelling errors in changelog, MANUAL.txt, `doc/org.md` (#6738).\n\n\n## pandoc 2.11 (2020-10-11)\n\n  * Add `--citeproc` (`-C`) option to trigger built-in citation processing.\n    It is no longer necessary to use the external `pandoc-citeproc`\n    filter.  `--citeproc` behaves like a filter and can be positioned\n    relative to other filters as they appear on the command line.\n\n    The new built-in citation processing uses the citeproc library,\n    a reimplementation of CSL citation processing that fixes many\n    of the shortcomings of pandoc-citeproc.  In general, citation\n    processing should work much the same as it did with pandoc-citeproc,\n    but with greater fidelity to CSL styles and better performance.\n    (The tests from the pandoc-citeproc package have been carried\n    over to pandoc.) The following differences should be noted:\n\n    - At this point, only some of the writers (HTML, ms, LaTeX) properly\n      interpret CSL display styles.  You should get decent output in\n      all formats (at least as good as with pandoc-citeproc), but\n      indentation and block-alignment may not be right.\n\n    - pandoc-citeproc searches the `~/.csl` directory for `.csl`\n      styles.  Pandoc instead searches the `csl` subdirectory of\n      the pandoc user data directory (e.g., `~/.pandoc/csl` or\n      `~/.local/share/pandoc/csl`).  Users who already keep\n      CSL styles in `~/.csl` may find it convenient to add a\n      symlink.\n\n    - Some of the bibliography formats supported by pandoc-citeproc (via\n      hs-bibutils) are no longer supported:  Copac, EndNote,\n      ISI, MEDLINE, MODS, and RIS.  If you use one of these formats,\n      you may use the `bibutils` utility to convert to BibLaTeX.\n      We now support only BibTeX, BibLaTeX, CSL JSON,\n      and pandoc's YAML/Markdown analogue of CSL JSON.\n\n    - pandoc-citeproc would always retrieve the independent parent\n      of a dependent style by doing an HTTP request.  pandoc will\n      now first seek the independent parent locally (in the resource\n      path or in the `csl` subdirectory of the pandoc user data\n      directory) before resorting to HTTP.  In addition, you may\n      omit the `.csl` extension, e.g. `--csl zoology`.\n\n    - Using the `--bibliography` option (or including\n      `bibliography` in YAML metadata) no longer triggers\n      citation processing implicitly: one must always use the\n      `--citeproc` option if citation processing is wanted.\n\n  * Add `csljson` as and input and output format. This allows pandoc\n    to convert between `csljson` and other bibliography formats\n    (e.g. `-f csljson -t markdown -s` or `-f bibtex -t csljson`),\n    and to generate formatted versions of CSL JSON bibliographies\n    (e.g., `pandoc -f csljson --citeproc pl.json -o pl.pdf`).\n\n  * Added `bibtex`, `biblatex` as input formats.  This allows pandoc\n    to convert between BibLaTeX and BibTeX and other bibliography formats,\n    and to generated formatted versions of BibTeX/BibLaTeX bibliographies\n    (e.g., `pandoc -f biblatex --citeproc pl.bib -o pl.pdf`).\n\n  * Raise informative errors when YAML metadata parsing fails (#6730).\n    Previously the command would succeed, returning empty metadata,\n    with no errors or warnings.\n\n  * Sort languages in `--list-highlight-languages` output (#6718,\n    Albert Krewinkel).  Languages were previously sorted by their\n    long name, which leads to unexpected results).\n\n  * Add CSS to default HTML template (#6601, Mauro Bieg).  This\n    greatly improves the default typography in pandoc's HTML\n    output.  The CSS is sensitive to a number of variables\n    (e.g. `mainfont`, `fontsize`, `linestretch`): see the manual for\n    details. To restore the earlier, more spartan output, you can\n    disable this with `-M document-css=false`.\n\n  * Support `--toc-depth` option for ODT writer (#6696, niszet).\n\n  * Fix issues with Windows UNC paths with some options (#5127).\n\n  * Remove `fenced_code_blocks` and `backtick_code_blocks` from allowed\n    `commonmark` and `gfm` extensions.  These shouldn't really be counted\n    as extensions, because they can't be disabled in commonmark.\n    Adjust markdown writer to check for the commonmark variant in addition\n    to extensions.\n\n  * Add these extensions to `gfm` and `commonmark`:\n    `fenced_code_blocks`, `backtick_code_blocks`, `fenced_code_attributes`.\n    These can't really be disabled in the reader, but they need to be enabled\n    in the writer or we just get indented code.\n\n  * Make sure proper set of extensions is recognized for `commonmark_x`.\n\n  * Allow `gfm_auto_identifiers`, `ascii_identifiers` extensions for `docx`.\n\n  * Markdown reader:\n\n    + Add `Maybe FilePath` parameter to `yamlToMeta` [API change].\n    + Export `yamlToRefs` [API change], a version of `yamlToMeta`\n      specialized to references.\n    + Set `citationNoteNum` accurately in citations.\n    + Revise abbreviation support.  Don't insert a nonbreaking space after a\n      potential abbreviation if it comes right before a note or citation.\n      This causes problems for citeproc's moving of note citations.\n\n  * LaTeX reader:\n\n    + Support missing siunitx commands (#6658).\n    + Support `squared`, `cubed`, `tothe` in siunitx (#6657).\n    + Improved uncertainty handling in slunitx.\n    + Factored out siunitx stuff into separate unexposed module.\n    + Fix improper empty cell filtering (#6689, Christian Despres).\n    + Fix parsing of \"show name\" in `\\newtheorem` (#6734).\n      Previously we were just treating it as a string and\n      ignoring  accents and formatting.\n    + Prevent wrong nesting of `\\multirow` and `\\multicolumn` table\n      cells (#6603, Laurent P. René de Cotret).\n    + Table cell parser not consuming spaces correctly (#6596,\n      Laurent P. René de Cotret).\n    + Change `SIRange` to `SIrange` (#6617, Emerson Harkin).\n    + Allow blank lines inside `\\author` (#6324).\n\n  * DocBook reader:\n\n    + Don't squelch space at end of emphasis and other inline elements;\n      instead, move it outside the element (#6719).\n    + Implement table cell alignment (#6698, Nils Carlson).\n    + Implement column span support for tables (#6492, Nils Carlson).\n    + Update list of block level tags (#6610).\n\n\n  * JATS reader:\n\n    + Don't squelch space at end of emphasis and other inline elements;\n      instead, move it outside the element (#6719).\n\n  * RST reader:\n\n    + Apply `.. class::` directly to following Header rather than creating\n      a surrounding Div (#6699).\n\n  * Docx reader:\n\n    + Allow empty dates in comments and tracked changes (#6726, Diego\n      Balseiro).\n\n  * Markdown writer:\n\n    + Be less aggressive about using quotes for YAML values,\n      allowing e.g. a quotation mark or bracket as long as it's not at the\n      beginning of the line.\n    + Use double quotes for YAML metadata (#6727).\n    + Sort YAML metadata keys in Markdown output case-insensitive.\n\n\n  * Asciidoc writer:\n\n    + Support asciidoctor's block figures (#6538, argent0).\n\n  * LaTeX writer:\n\n    + Fix spacing issue with list in definition list.\n      When a list occurs at the beginning of a definition list definition,\n      it can start on the same line as the label, which looks bad.\n      Fix that by starting such lists with an `\\item[]`.\n\n  * HTML writer:\n\n    + Support intermediate table headers (#5314, Albert Krewinkel).\n    + Support attributes on all table elements (Albert Krewinkel).\n    + Render table footers if present (#6314, Albert Krewinkel).\n    + Fix addition of `doc-biblioentry` role.\n    + Support colspans and rowspans in HTML tables (#6312, Albert Krewinkel).\n\n  * ICML writer:\n\n    + Support internal document links (#5541, Leonard Rosenthol).\n    + Changed default link state to invisible (#6676, Leonard Rosenthol).\n\n  * Docx writer:\n\n    + Better handle list items whose contents are lists (#5948, Michael\n      Hoffmann).  If the first element of a bulleted or ordered list is\n      another list, then that first item would previously disappear if the\n      target format is docx.\n    + Separate adjacent tables (#4315).  Word combines adjacent tables,\n      so to prevent this we insert an empty paragraph between two\n      adjacent tables.\n\n  * Org writer:\n\n    + Don't force blank line after headings (#6554).\n\n  * OpenDocument writer:\n\n    + Implement table cell alignment (#6700 Nils Carson, Mauro Bieg).\n    + New table cell support with row and column spans (#6682, Nils Carson).\n    + Syntax highlighting for inline code (#6711, niszet).\n\n  * Add Text.Pandoc.Citeproc module, exporting `processCitations`\n    [API change].  This depends on several other, unexported\n    modules under Text.Pandoc.Citeproc.\n\n  * Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`.\n    [API change]\n\n  * Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`.\n    [API change]\n\n  * Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and\n    `readBibLaTeX`. [API change]\n\n  * Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.\n    [API change] This runs the processCitations transformation.\n    We need to treat it like a filter so it can be placed\n    in the sequence of filter runs (after some, before others).\n    In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,\n    so this special filter may be specified either way in a defaults file\n    (or by `citeproc: true`, though this gives no control of positioning\n    relative to other filters).\n\n  * Add new exported module Text.Pandoc.Writers.AnnotatedTable [API change]\n    (#6655, Christian Despres).  This module (which should generally\n    be imported qualified to avoid name conflicts) provides a\n    `Table` type that mirrors the structure of a pandoc `Table`,\n    but with added inferred information so that the writers do not have to\n    lay out tables themselves. The `toTable` and `fromTable` functions convert\n    between an annotated `Table` and a regular pandoc `Table`. In addition to\n    producing a `Table` with coherent and well-formed annotations, the\n    `toTable` function also normalizes its input table like the table\n    builder does.  Tests ensure that `toTable` normalizes tables exactly\n    like the table builder, and that its annotations are coherent.\n\n  * Text.Pandoc.Logging:\n\n    + Remove unused `CouldNotParseYamlMetadata` constructor for `LogMessage`\n      [API change].\n    + Add `CiteprocWarning` constructor to `LogMessage` [API change].\n\n  * Text.Pandoc.Readers.Metadata: export `yamlBsToRefs` [API change].\n    These allow specifying an id filter so we parse only references\n    that are used in the document.\n\n  * Text.Pandoc.Parsing:\n\n    + Export ParseError [API change].\n    + Add `stateInNote` and `stateNoteNumber` to `ParserState`\n      [API change].  These are used to populate note numbers for citation\n      processing.\n\n  * Fix apparent typos in sample.lua (#6729, William Lupton).\n    Also make the writer less aggressive in escaping quotes.\n\n  * Text.Pandoc.Options:\n\n    + `defaultMathJaxURL`: use `tex-chtml-full` instead of `tex-mml-chtml`\n      (#6599, Kolen Cheung).  This drops the MathML support (which we\n      don't need for HTML math rendering) and includes the full JavaScript,\n      which makes it possible to use `--self-contained` (though there may\n      still be issues if the required math fonts aren't available).  This\n      change should also reduce latency in pages with lots of formulas.\n    + Add `/tex-chtml-full.js` to `defaultMathJaxURL` (#6593) Previously we\n      added this in processing command line options, but not in processing\n      defaults files, which was inconsistent.\n\n  * epub.css: Fix cover page selectors and add note explaining their use\n    (#6649, a-vrma).\n\n  * Add data files needed for Text.Pandoc.Citeproc:  these include\n    `default.csl` in the data directory and a `citeproc` directory that\n    is only used at compile-time for biblatex localizations.  Note that we've\n    added `file-embed` as a mandatory rather than a conditional\n    dependency, because of the biblatex localization files.\n\n  * Lua filters:\n\n    + Add SimpleTable for backwards compatibility (#6575, Albert Krewinkel).\n      A new type `SimpleTable` is made available to Lua filters. It is\n      similar to the `Table` type in pandoc versions before 2.10;\n      conversion functions from and to the new Table type are provided.\n      Old filters using tables now require minimal changes and can use, e.g.,\n\n          if PANDOC_VERSION > {2,10,1} then\n            pandoc.Table = pandoc.SimpleTable\n          end\n\n      and\n\n          function Table (tbl)\n            tbl = pandoc.utils.to_simple_table(tbl)\n            …\n            return pandoc.utils.from_simple_table(tbl)\n          end\n\n      to work with the current pandoc version.\n\n    + Make `attr` argument optional in `Table` constructor (Albert Krewinkel).\n      This changes the Lua API. It is highly unlikely for this change to affect\n      existing filters, since the documentation for the new Table constructor\n      (and type) was incomplete and partly wrong before.  The Lua API is now\n      more consistent, as all constructors for elements with attributes now\n      take attributes as the last parameter.\n\n  * MANUAL.txt:\n\n    * Add a dedicated Citations section which consolidates the information\n      the manual used to contain about citation processing, and incorporates\n      some information formerly found in the pandoc-citeproc man page.\n    + Add note about lualatex using `selnolig`.\n    + Remove duplicate `seriespage` (#6568, Blake Eryx).\n    + Remove lists of support extensions for markdown variants (#6604).\n      Instead, offer the advice to use `--list-extensions=FORMAT`.\n    + Fix position of attributes in header (Albert Krewinkel).\n    + Delete obsolete section on compact and loose lists (#6684).\n\n\n  * doc/lua-filters.md:\n\n    + Add info on how to debug Lua filters (#6732, Ian Max Andolina).\n    + Document Underline type and constructor (Albert Krewinkel).\n    + Document `body` field (Albert Krewinkel).\n    + Add missing header attribute\n    + Add missing Link.title field (Albert Krewinkel).\n    + Make the setting-the-date example conditional (the-solipsist).\n      This makes the example a bit more realistic.\n    + Remove outdated link table example.\n\n  * doc/org.md:\n\n    + Add section on tables (Albert Krewinkel).\n    + Add section on handling of unknown directives (Albert Krewinkel).\n\n  * CONTRIBUTING.md: fix typo (#6584, Dmitry Volodin).\n\n  * Use golden test framework for command tests.  This means that\n    `--accept` can be used to update expected output.\n\n  * Use the `smart` extension when generating pandoc's man page (#6613).\n\n  * Release-candidate: don't build windows i386.\n    So far we haven't been able to figure out how to get\n    stack to use a 32-bit ghc.\n\n  * Use `null` instead of deprecated `Builder.isNull`.\n\n  * Makefile:\n\n    + Fix macospkg target to fetch target from S3 artifacts.\n    + Fix pandoc-templates target to include all partials.\n\n  * Remove duplicated dependency in pandoc.cabal (#6591, Felix Yan).\n\n  * Sort build depends in pandoc.cabal alphabetically (#6691,\n    Albert Krewinkel).\n\n  * Add .travis.yml for macos release candidate build (#6622).\n    We need to build the release candidate on Travis rather\n    than GitHub actions, because GH has macos 10.15, and\n    binaries compiled on that OS will not work with 10.13.\n    This build is only triggered on `rc/*` branches.\n\n  * Remove instructions for building pandoc-citeproc from CI and\n    release binary build instructions.  We will no longer distribute\n    pandoc-citeproc.\n\n  * Fix math rendering in trypandoc (this broke after\n    commit d8ad766d17603784b86fc5c2e1b22864125d04d1).\n\n  * Use latest versions of skylighting, commonmark (#6589),\n    comonmark-extensions, commonmark-pandoc, texmath.\n\n  * Relax version bounds for hslua, hslua-module-text, bytestring.\n\n  * Use released pandoc-types 1.22.  This changes the JSON\n    encoding slightly for the new table types introduced\n    in 1.21, so they're more consistent with the rest.\n    Developers of libraries for pandoc filters will want\n    to take note.\n\n  * Fix hlint suggestions, update hlint.yaml (#6680, Christian Despres).\n\n  * Code cleanup (#6678, Joseph C. Sible).\n\n  * Add haddocks to functions in Text.Pandoc.Writers.Shared (Albert\n    Krewinkel).\n\n  * Remove duplicate `tshow` definition.\n\n  * Linux release candidate build: use ghc-musl container.  This simplifies\n    our build process (over using a customized alpine container).\n\n\n## pandoc 2.10.1 (2020-07-23)\n\n  * Add `commonmark_x` output format. This is `commonmark` with a number\n    of useful pandoc extensions enabled.\n\n  * Many more extensions now work with `commonmark` and `gfm`.\n\n  * Add generic `attributes` extension.  This allows attributes to\n    be added to any block or inline element in a uniform way.  Since\n    the Pandoc AST doesn't include attributes on each element type,\n    the attributes will sometimes be added by creating a surrounding\n    Div or Span container.  Currently this extension is only\n    compatible with the `commonmark` and `gfm` readers.\n\n    To add an attribute to a block-level element, e.g. a paragraph,\n    put it before the block:\n    ```\n    {#mypara}\n    This is a paragraph.\n    ```\n    Multiple attributes may be used and will be combined:\n    ```\n    {#mypara}\n    {.blue .warning key=\"val\"}\n    This is a paragraph.\n    ```\n    To add an attribute to an inline-level element, put it\n    immediately after the element:\n    ```\n    *emphasized text*{.special}\n    ```\n\n  * Support `--number-sections` for docx output (#1413).\n\n  * LaTeX reader:\n\n    + Support `\\SIRange` reader (#6418, Emerson Harkin).\n    + Support table col-span and row-span (#6311, Laurent P. René de Cotret).\n      Supports `\\multirow` and `\\multicolumn`.\n    + Support amsthm:  `\\newtheorem`, `\\theoremstyle`, and theorem and\n      proof environments, including labels and references.  The only thing\n      that is unsupported is the second optional argument, which causes\n      numbering to be reset after the specified series is incremented.\n    + Moved some code to T.P.LaTeX.Parsing.  We need to reduce the size\n      of the LaTeX reader to ease compilation on resource-limited systems.\n\n  * RST reader:\n\n    + Fix csv tables with multiline cells (#6549).\n    + Fix spurious newlines in some attributes from directives.\n    + Avoid extra newline in included code blocks.\n\n  * Commonmark reader:\n\n    + Switch from cmark-gfm to commonmark-hs for commonmark and gfm\n      parsing.  This avoids depending on a C library\n      and allows us to support more pandoc extensions for\n      `commonmark` and `gfm`.\n\n  * DocBook reader:\n\n    + Parse releaseinfo as metadata (#6542).\n\n  * Docx reader:\n\n    + Only use `bCs/iCs` on runs with `rtl` or `cs` property (#6514, Nikolay\n      Yakimov).\n    + Code cleanup/refactoring (Nikolay Yakimov).\n\n  * Org reader (Albert Krewinkel):\n\n    + Respect export setting which disables entities\n      MathML-like entities, e.g., `\\alpha`, can be disabled with the\n      `#+OPTION: e:nil` export setting (Albert Krewinkel).\n    + Respect export setting disabling footnotes.  Footnotes can be removed\n      from the final document with the `#+OPTION: f:nil` export setting.\n    + Respect tables-excluding export setting.  Tables can be removed from\n      the final document with the `#+OPTION: |:nil` export setting.\n\n  * Markdown writer:\n\n    + Move `asciify` out of `escapeString`.  Otherwise `unsmartify`\n      doesn't catch quotes that have already been turned to entities.\n    + Add `writeCommonmark` (new exported function, API change).\n    + Use unicode super/subscript characters when possible if the\n      `superscript` or `subscript` extension or `raw_html` aren't available.\n    + Render caption as following paragraph when `table_caption` extension\n      is not enabled.\n    + Use numerical labels for reference links that are longer\n      than 999 characters or contain square brackets, for conformity\n      with commonmark (#6560).\n\n  * Commonmark writer:\n\n    + Instead of using cmark-gfm, use `writeCommonmark` from the\n      Markdown writer.  This function calls the markdown writer\n      with appropriate extensions and a few small modifications\n      (e.g. not requiring backslashes before spaces inside\n      super/subscripts).  With this change `comonmark` and\n      `gfm` output can be used with a wider selection of\n      extensions.\n\n  * Jira writer: keep image caption as alt attribute (#6529, Albert\n    Krewinkel).\n\n  * HTML writer:\n\n    + Improve alt-text/caption handling for HTML5 (#6491, Albert Krewinkel).\n      Screen readers read an image's `alt` attribute and the figure caption,\n      both of which come from the same source in pandoc. The figure caption is\n      hidden from screen readers with the `aria-hidden` attribute. This\n      improves accessibility.  For HTML4, where `aria-hidden` is not allowed,\n      pandoc still uses an empty `alt` attribute to avoid duplicate contents.\n\n  * Ms writer:\n\n    + Fix code highlighting with blank lines.  Previously blank lines\n      were simply omitted from highlighted code.\n    + Escape starting periods in ms writer code blocks (#6505, Michael\n      Hoffmann).  If a line of ms code block output starts with a period (.),\n      it should be prepended by `\\&` so that it is not interpreted as a roff\n      command.\n\n  * Text.Pandoc.Extensions:\n\n    + Add `raw_markdown` extension (which only affects `ipynb`\n      input).\n    + Trim down `githubMarkdownExtensions`.\n      Previously it included all of the following, which make\n      sense for the legacy `markdown_github` but not for `gfm`,\n      since they are part of base commonmark and thus\n      can't be turned off in `gfm`:\n\n      - `Ext_all_symbols_escapable`\n      - `Ext_backtick_code_blocks`\n      - `Ext_fenced_code_blocks`\n      - `Ext_space_in_atx_header`\n      - `Ext_intraword_underscores`\n      - `Ext_lists_without_preceding_blankline`\n      - `Ext_shortcut_reference_links`\n\n      These have been removed from `githubMarkdownExtensions`, though\n      they're still turned on for legacy `markdown_github`.\n    + Add `Ext_attributes` constructor for `Extension` [API change].\n\n  * LaTeX template: use selnolig to selectively suppress ligatures with\n    lualatex (#6534).\n\n  * Benchmark bytestring readers (Nikolay Yakimov).\n\n  * Documentation:\n\n    + Update using-the-pandoc-api.md (favonia).\n    + Fix Typos in lua-filters.md (tajmone).\n    + Rewrite Raw HTML/TeX section in MANUAL.txt to avoid duplicate\n      headings for the extensions.\n    + Fix typo in MANUAL.txt (Benjamin Wuethrich).\n    + Remove duplicate 'titlepage' in MANUAL.txt (Blake Eryx).\n    + CONTRIBUTING.md: Advertise the official nightlies in GitHub actions.\n      Replaces #6500, thanks to @ickc.\n\n\n\n## pandoc 2.10 (2020-06-29)\n\n  * Use pandoc-types 1.21.  This adds two things:\n\n    + A native Underline constructor for Inline (#6277, Vaibhav Sagar).\n    + More expressive types for tables (#1024, Christian Despres).\n      Tables can now take attributes; and rowspans and colspans,\n      column headers, multiple row headers, table head and foot\n      can all be represented.  (Note, however, that reader and\n      writer support for these features is still lacking, so\n      most users won't see any differences in table conversion\n      yet.  These changes just lay the foundation for further\n      improvements.)\n\n  * Support new Underline element in readers and writers (#6277,\n    Vaibhav Sagar).\n\n  * Support new Table type (Christian Despres).\n    The Builder.simpleTable now only adds a row to the TableHead\n    when the given header row is not null. This uncovered an\n    inconsistency in the readers: some would unconditionally\n    emit a header filled with empty cells, even if the header\n    was not present. Now every reader has the conditional\n    behaviour.  Only the XWiki writer depended on the header row\n    being always present; it now pads its head as necessary.\n\n  * Add an option to disable certificate validation (#6156, Cédric Couralet,\n    Cécile Chemin, Juliette Fourcot).  This commit adds the option\n    `--no-check-certificate`, which disables certificate checking when\n    resources are fetched by HTTP.\n\n  * Unify defaults and markdown metadata parsers (#6328, Nikolay\n    Yakimov). Clean up code in Text.Pandoc.Readers.Metadata and\n    properly handle errors in `yamlToMeta`.  This fixes parsing\n    of Boolean fields in metadata withinin defaults files and reduces\n    code duplication.\n\n  * Docbook reader:\n\n    + Implement `<procedure>` (#6442, Mathieu Boespflug).\n    + Implement `<phrase>` (#6438, Mathieu Boespflug).\n    + Treat envar and systemitem like code (#6435, Mathieu Boespflug).\n    + Implement `<replaceable>` (#6437, Mathieu Boespflug)\n    + Map `<simplesect>` to unnumbered section (#6436, Mathieu Boespflug).\n\n  * JATS reader:\n\n    + Handle \"label\" element in section title (#6288).\n    + Parse abstract element into metadata field of same name\n      (#6480, Albert Krewinkel).\n\n  * Jira reader (Albert Krewinkel):\n\n    + Resolve multiple parsing problems, including issues with empty\n      table cells, faulty recognition of closing emphasis characters, and\n      parsing of image attributes (#6212, #6219, #6220).\n    + Two consecutive markup chars are now parsed verbatim (#6343);\n      styled text must not be empty.\n    + Newlines are no longer allowed within styled text (#6325).\n    + Links to anchors are now parsed as links (#6407).\n    + Retain image attributes (#6234).  Jira images attributes as in\n      `!image.jpg|align=right!` are retained as key-value pairs. Thumbnail\n      images, such as `!example.gif|thumbnail!`, are marked by a\n      `thumbnail` class in their attributes.\n    + Use Underline for inserted text (#6237). Previously, the span was\n      marked with the non-standard class `inserted`.\n    + Improve icon conversion for `(/)`, `(x)`, `(!)`, `(?)`\n      `(+)`, `(-)`, `(off)`, `(*)`. (#6236, #6264).\n    + Support citations, attachment links, and user links (#6231, #6238,\n      #6239).\n    + Resolve parsing issues of blockquote, color (#6233, #6235).\n\n  * HTML reader:\n\n    + Parse attributes into table attributes.\n    + Support `<bdo>` (#5794, Tristan de Cacqueray).\n    + Add `summary` to list of block-level HTML tags (#6385).\n      This improves support for summary/details inside Markdown.\n      NOTE:  you need to include a blank line before the closing\n      `</details>`, if you want the last part of the content to\n      be parsed as a paragraph.\n    + Fix parsing unclosed th elements in a table (#6247).\n\n  * Commonmark reader: Implement `implicit_figures` extension (#6350).\n\n  * Markdown Reader:\n\n    + Fix inline code in lists (#6284, Nikolay Yakimov).\n      Previously inline code containing list markers was sometimes\n      parsed incorrectly.\n    + Don't require blank line after grid table (#6481).\n      This allows grid tables to be enclosed in fenced divs with no\n      intervening blank lines.\n\n  * LaTeX reader:\n\n    + Don't parse beyond `\\end{document}` (#6380).\n      This required some internal changes to `\\subfile` handling.\n    + Better handling of `\\lettrine`.  SmallCaps instead of Span\n      for the part after the initial capital.  Ensure that both\n      arguments are parsed, so that in Markdown both\n      are treated as raw LateX. (Closes #6258.)\n\n  * Org reader (Albert Krewinkel):\n\n    + Recognize images with uppercase extensions (#6472).\n    + Keep unknown keyword lines as raw org.  The lines of unknown\n      keywords, like `#+SOMEWORD: value` are no longer read as metadata,\n      but kept as raw `org` blocks. This ensures that more information\n      is retained when round-tripping org-mode files; additionally,\n      this change makes it possible to support non-standard org\n      extensions via filters.\n    + Unify keyword handling.  Handling of export settings and other\n      keywords (like `#+LINK`) has been combined and unified.\n    + Support `LATEX_HEADER_EXTRA` and `HTML_HEAD_EXTRA`\n      settings.  These export settings are treated like their non-extra\n      counterparts, i.e., the values are added to the `header-includes`\n      metadata list.\n    + Allow multiple `#+SUBTITLE` export settings.  The values of all\n      lines are read as inlines and collected in the `subtitle`\n      metadata field.\n    + Read `#+INSTITUTE` values as text with markup.  The value is\n      stored in the `institute` metadata field and used in the\n      default beamer presentation template.\n    + The behavior of the `#+AUTHOR` and `#+KEYWORD` export\n      settings has changed: Org now allows multiple such lines\n      and adds a space between the contents of each line. Pandoc\n      now always parses these settings as meta inlines; setting\n      values are no longer treated as comma-separated lists.\n      Note that a Lua filter can be used to restore the previous\n      behavior.\n    + Read description lines as inlines (#6485). `#+DESCRIPTION` lines\n      are now treated as text with markup. If multiple such\n      lines are given, then all lines are read and separated by soft\n      linebreaks.\n    + Honor tex export option (#4070).  The `tex` export option can be set\n      with `#+OPTION: tex:nil` and allows three settings:\n      `t` (the default) causes LaTeX fragments to be parsed as TeX or added\n      as raw TeX.  `nil` removes all LaTeX fragments from the document.\n      `verbatim` treats LaTeX as text.\n\n\n  * RST reader:\n\n    + Pass arbitrary attributes through in code blocks (#6465).\n      Exceptions: name (which becomes the id), class (which becomes the\n      classes), and number-lines (which is treated specially to fit\n      with pandoc highlighting).\n    + Handle `date::` directive (#6276).\n\n  * Textile reader: support `pre.` for code blocks (#6454).\n\n  * Ipynb reader:\n\n    + Implement `raw_markdown` extension (#5408).  Specifying\n      `-f ipynb+raw_markdown` will cause Markdown cells\n      to be represented as raw Markdown blocks, instead of being\n      parsed.  This is not what you want when going from `ipynb`\n      to other formats, but it may be useful when going from `ipynb`\n      to Markdown or to `ipynb`, to avoid semantically insignificant\n      changes in the contents of the Markdown cells that might\n      otherwise be introduced.\n    + Handle application/pdf output as image (#6430).\n    + Properly handle image/svg+xml as an image (#6430).\n\n  * Docx reader:\n\n    + Distinguish between docx parsing and docx container unpacking errors.\n\n  * MediaWiki reader:\n\n    + Fix `gfm_auto_identifiers` so that `-` is not replaced by `_` (#6335).\n\n  * Vimwiki reader:\n\n    + Add nested syntax highlighting (#6256, Vlad Hanciuta).\n      Nested syntaxes are specified like this:\n      ```\n      {{{sql\n      SELECT * FROM table\n      }}}\n      ```\n      The preformatted code block parser has been extended to check if the\n      first attribute of the block is not a `key=value` pair, and in that\n      case it will be considered as a class.\n\n\n  * Jira writer (Albert Krewinkel):\n\n    + Always escape braces (#6478).  Braces are now always escaped, even\n      within words or when surrounded by whitespace. Jira and\n      Confluence treat braces specially.\n    + Convert Underline to inserted text (`+inserted+`).\n    + Add image attributes (#6234).  Image attributes are added\n      to the output as image parameters. If the image has a\n      class \"thumbnail\", then a thumbnail image is generated;\n      all other attributes are discarded in this case.\n\n  * LaTeX writer:\n\n    + Ensure that `-M csquotes` works even in fragment mode (#6265).\n    + Escape `^` specially for listings (#6460).\n    + Create hypertarget for links with identifier (#6360).\n    + Distinguish between single and double quotes when using enquote\n      package (#6457, dbecher-ito).\n    + Add support for customizable alignment of columns in beamer (#6331,\n      andrebauer).\n    + Add support for customizable alignment of columns in beamer\n      (#4805, #4150, andrebauer).\n\n  * HTML writer:\n\n    + Use CSS in favor of `<br>` for display math (#6372)\n      Some CSS to ensure that display math is\n      displayed centered and on a new line is now included\n      in the default HTML-based templates; this may be\n      overridden if the user wants a different behavior.\n\n  * Org writer:\n\n    + Clean-up Div handling (Albert Krewinkel).\n\n  * Docx writer:\n\n    + Enable column and row bands for tables (#6371).\n      This change will not have any effect with the default style.\n      However, it enables users to use a style (via a reference.docx)\n      that turns on row and/or column bands.\n\n  * OpenDocument (and ODT) writer:\n\n    + Add custom-style \"Abstract\" in metadata abstract.\n      This ensures that the abstract is rendered with style Abstract.\n    + Enable custom-style attribute on a Div.\n      This allows you to apply a custom style to contained paragraphs.\n\n  * DocBook writer:\n\n    + Add id of figure to enclosed image.\n    + Add personname element to docbook author (#6244).\n\n  * FB2 writer:\n\n    + Properly handle cover-image containing spaces (#6391).\n\n  * Markdown writer:\n\n    + Ensure consistent padding for pipe tables (#6240).\n    + Avoid unnecessary escapes before intraword `_` when\n      `intraword_underscores` extension is enabled (#6296).\n\n  * RST writer:\n\n    + Properly handle images with same alt text (#6194).\n      Previously we created duplicate references for these in rendering RST.\n\n  * AsciiDoc writer:\n\n    + Add blank line after Div (#6308).\n\n  * Haddock Writer:\n\n    + Support Haddock tables (Joe Hermaszewski).\n      See this PR on Haddock for details on the table format:\n      <https://github.com/haskell/haddock/pull/718>.\n\n  * PowerPoint writer (Jesse Rosenthal):\n\n    + Write math input verbatim in speaker notes (#6301).\n      OMML in speaker notes would lead to corrupt PowerPoint output. We now\n      output the OMML verbatim as LaTeX in the speaker notes.\n\n  * LaTeX template: Make polyglossia package options list-aware\n    (#6444, Frederik Elwert).\n\n  * Reveal.js template:\n\n    + Update template for reveal.js 4.0.0 (#6390, Salim B).\n    + Update template with newly available options (#6347, Jake Zimmerman).\n    + Use CDN version of revealjs v4 by default (#6408).\n\n  * opendocument template: Add abstract and subtitle to opendocument\n    template (#6369).\n\n  * reference.odt: clean up styles.  Add Abstract.\n    Change Author, Date to centered paragraphs with no character\n    styling.\n\n  * epub.css: wrap overlong lines in highlighted code blocks (#6242).\n    This fixes a problem in iBooks v2.4 with our earlier\n    horizontally scrolling code blocks.  The problem seems to\n    be a bug in iBooks, not pandoc, but since iBooks is a major\n    target we're changing pandoc's default behavior so that\n    pandoc-produced epubs work on that platform.\n\n  * Text.Pandoc.PDF:\n\n    + Use `--enable-local-file-access` in invoking `wkhtmltopdf` (#6474).\n      `wkhtmltopdf` changed in recent versions to require this for\n      access to local files.  This fixes PDF via HTML5 with `--css`.\n    + Send verbose output to stderr, not stdout (#6483).\n\n  * Text.Pandoc.MIME: Fix MIME type for TrueType fonts in EPUBs\n    (#6464, Michael Reed).\n\n  * Text.Pandoc.Shared:\n\n    + `makeSections`: omit number attribute when unnumbered class\n      is present (#6339).  Previously the attribute was included but given\n      an empty value, and this caused the table of contents creation\n      functions in Text.Pandoc.Writers.Shared to think these items had\n      numbers, which meant that they were included in the TOC even if the\n      `unlisted` class was used.\n    + Deprecate `underlineSpan` in Shared in favor of\n      `Text.Pandoc.Builder.underline` (Vaibhav Sagar).\n    + `renderTags'`: use self-closing tag for col element (#6295).\n\n  * Text.Pandoc.UUID: Fix `getRandomUUID`, which previously would\n    return the same value twice in a row. Make `getRandomUUID`\n    polymorphic in PandocMonad.  Remove `getUUID` (#6228, Joseph C. Sible).\n\n  * Text.Pandoc.Class: Generalize `PandocIO` functions to `MonadIO`.\n\n  * Fixed Katex standalone script (#6399, Lucas Escot).\n    Global macros are now persistent when using the HTML Writer with the\n    `--katex` option.\n\n  * Lua subsystem (Albert Krewinkel):\n\n    + Use new type PandocLua for all pandoc Lua operations (API change).\n      The new type `PandocLua` is an instance of the `PandocMonad` typeclass\n      and can thus be used in a way similar to `PandocIO`.\n    + Use PandocError for exceptions in Lua subsystem (API change).\n      The PandocError type is used throughout the Lua subsystem. All Lua\n      functions throw an exception of this type if an error occurs. The\n      `LuaException` type is removed and no longer exported from\n      `Text.Pandoc.Lua`. In its place, a new constructor `PandocLuaError`\n      is added to PandocError.\n\n  * Lua filters: improve error messages for failing filters (#6332,\n    Albert Krewinkel).  Print the Lua error properly instead of\n    displaying their `show` string.\n\n  * Use latest skylighting.  This fixes a bug with lua multiline\n    comments (and may improve handling of other syntaxes as well).\n    IT also adds `aria-hidden=\"true\"` to the empty a elements, which\n    helps people who use screen readers.\n\n  * Use latest texmath.\n\n  * Require latest doctemplates 0.8.2.\n    This adds support for template pipes `first`, `rest`,\n    `last`, `allbutlast`.\n\n  * Revert  0e48a02 and dependency on base-noprelude, which hasn't\n    been updated for ghc 8.10 (see #6187).\n\n  * Dependency adjustments:\n\n    + Allow haddock-library 1.9.x.\n    + Allow hslua 1.1 (#6243, Felix Yan).\n    + Allow base64-bytestring 1.1.\n    + Use latest jira-wiki-markup.\n    + Allow http-client 0.7.\n    + Allow tasty 1.3.x.\n    + Allow aeson 1.5 (#6400, Felix Yan).\n    + Remove unused dependency `vector` (#6462, Laurent P. René de Cotret).\n    + Bump QuickCheck upper bound.\n\n  * Significant code cleanup and simplification (Joseph C. Sible, #6223,\n    #6209, #6225, #6229, #6226, #6340).\n\n  * Remove unnecessary hlint ignores (#6341, Joseph C. Sible).\n\n  * Remove obsolete RelaxedPolyRec extension (#6487, Nikolay Yakimov).\n\n  * trypandoc improvements (Mike Tzou):\n\n    + Add standalone option to the command text (#6210).\n    + Update third party libraries.\n\n  * MANUAL.txt:\n\n    + Clarify template partial naming (#6476, Mauro Bieg).\n    + Describe `jira` as \"Jira/Confluence wiki markup\" (#6351, Albert\n      Krewinkel).  In the past, Jira's wiki markup was also used by -- and\n      could be imported into -- Atlassian Confluence.\n    + Add link to print-css.rocks (#6272, Mauro Bieg).\n    + Clarify pipe table column width adjustment (#6254).\n    + Fix ATX header syntax.\n    + Fix misleading note about image size conversions (#6353).\n    + Update links to reveal.js documentation (#6386, Salim B).\n    + Separate adjacent verbatim code blocks (#6307, tom-audm).\n\n  * org.md:\n\n    + Document behavior of `smart` extension (#4387, Albert Krewinkel).\n    + Describe all supported export options in detail.\n\n  * lua-filters.md:\n\n    + Fix description of BulletList Lua type (Levi Gruspe).\n    + Use pandoc.system module in TikZ example (Albert\n      Krewinkel).  Showcase temporary directory handling with\n      `with_temporary_directory` and `with_working_directory`.\n\n  * INSTALL.md: fix FreeBSD port link (#6422, Mo).\n    The FreeBSD port was renamed from pandoc to hs-pandoc in 2010.\n    The old pandoc port is still at version 1.5.1.1\n\n  * Propagate `(DY)LD_LIBRARY_PATH` in tests (#6376, Lila).\n\n  * Bump `cabal-version` to 2.2 (#6377).\n\n  * Make it possible to compile using Stack on NixOS (#6439, Mathieu\n    Boespflug).\n\n  * CI action to check for commit message length (Nikolay Yakimov, #6398).\n\n\n## pandoc 2.9.2.1 (2020-03-23)\n\n  * Markdown reader: Fix table alignment when heading begins with t (#6153).\n    Due to a typo (`t` instead of `\\t`) we were center aligning column\n    headings that begin with a lowercase `t`!\n\n  * Text.Pandoc.Readers.Roff:\n\n    + Fix parsing of `\\.` in man/ms readers (#6175).\n      Previously due to a typo it was being parsed as `` ` ``.\n    + Fix parsing of `\\'` in man/ms readers (#6175).  It was being parsed\n      as a backtick.\n\n  * Jira reader (Albert Krewinkel):\n\n    + Fix parsing of tables without preceding blankline (#6198).\n      A bug was fixed which caused faulty parsing if a table was not\n      preceded by a newline and the first table cell had no space\n      after the initial `|` characters.\n    + Fix parsing of strikeout, emphasis (#6196).  A bug was fixed which\n      caused non-emphasized text containing digits and/or non-special\n      symbols (like dots) to sometimes be parsed incorrectly.\n    + Support colored inline text, indented lists (#6183, #6184).\n\n  * Ms writer:\n\n    + Fix definition lists so indent even when paragraph indent is\n      set to 0 (as is the default).  Also ensure indent for display math\n      that falls back to TeX.\n    + Use `.QS/.QE` instead of `.RS/.RE` for block quotes.\n\n  * EPUB writer: fix regression on detection of front/back/bodymatter\n    (#6170).  This bug caused sections with epub:type `dedication` to be\n    misplaced in bodymatter instead of frontmatter as specified\n    in the manual.  The same problem would affect other epub:types.\n    The pattern matching needed to be changed with the use of\n    `makeSection`.\n\n  * AsciiDoc writer:  remove redundant `otherwise` guard in\n    `inlineToAsciiDoc` (#6146, Ryan Scott).\n\n  * Text.Pandoc.Class:\n\n    + Fix missing import when data files are not embedded (Albert Krewinkel).\n    + Subdivide Text.Pandoc.Class into small unexported modules\n      and ensure that all functions have Haddock documentation (#6106,\n      Albert Krewinkel).\n    + Finer grained imports of Text.Pandoc.Class submodules (#6203, Albert\n      Krewinkel).\n\n  * Text.Pandoc.XML: Add to list of HTML5 attributes:\n    `allow`, `autocapitalize`, `decoding`, `enterkeyhint`,\n    `imagesizes`, `imagesrcset`, `loading`.\n\n  * Use implicit Prelude (#6187, Albert Krewinkel).\n    The previous behavior was introduced as a fix for #4464. It seems that\n    this change alone did not fix the issue, and `stack ghci` and `cabal\n    repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded\n    for these versions. Given this, it seems cleaner to revert to the\n    implicit Prelude.\n\n  * Always use custom prelude (#6187, Albert Krewinkel).\n    Previously, the custom prelude was used only with older GHC versions, as\n    a workaround for problems with ghci. The ghci problems are resolved by\n    replacing package `base` with `base-noprelude`, allowing for consistent\n    use of the custom prelude across all GHC versions.\n\n  * Remove outdated checks for no longer supported base versions\n    (Albert Krewinkel).\n\n  * PDF via wkhtmltopdf: put user-specified options last (#6171).\n    Certain options (e.g. `cover`) need to come after flags on\n    the command line.\n\n  * Text.Pandoc.App: set resource path at the beginning so it can affect\n    things like include-in-header (#5982).\n\n  * Change macOS release candidate CI process so that notarized\n    packages can be produced (#6169).\n\n  * Make MANUAL more explicit about nonbreaking space handling by\n    `all_symbols_escapable` (#6154, Fabien Schurter).\n\n  * trypandoc (Mike Tzou):\n\n    + Add checkbox for standalone option (#6189).\n    + Use strict mode for JavaScript code (#6188).\n    + Fetch resources over https (#6188).\n    + Remove unnecessary attributes on style, script elements (#6188).\n\n  * Use details tag to make GitHub releases changelog collapsible.\n\n  * Update filter code in doc/filters.md so it works with latest pandoc\n    (#6185).\n\n  * linux/Dockerfile: upgrade to alpine 3.11 (#6180, Albert Krewinkel).\n    This is used to build the static linux binaries.\n\n\n## pandoc 2.9.2 (2020-02-15)\n\n  * Add `csv` as an input format (#6100).  The CSV table is converted into a\n    pandoc simple table.  A new module Text.Pandoc.Readers.CSV\n    exports `readCSV` [API change].\n\n  * Introduce new format variants for JATS writer (#6014, Albert Krewinkel):\n\n    - `jats_archiving` for the \"Archiving and Interchange Tag Set\",\n    - `jats_publishing` for the \"Journal Publishing Tag Set\", and\n    - `jats_articleauthoring` for the \"Article Authoring Tag Set.\"\n\n    The `jats` output format is now an alias for `jats_archiving`.\n    The module Text.Pandoc.Writers.JATS now exports\n    `writeJatsArchiving`, `writeJatsPublishing`, and\n    `writeJatsArticleAuthoring`, as well as the legacy\n    `writeJATS` [API change].\n\n  * `--defaults`: Support `bibliography` and `csl` fields.\n    Move `addMeta` from Text.Pandoc.App.CommandLineOptions to\n    Text.Pandoc.App.Opt (internal change).\n\n  * Add timing info for filters in `--verbose` mode (#6112).\n    When verbose mode is specified (verbosity == INFO), print a\n    notice when running a filter and when a filter completes (including\n    timing).\n\n  * LaTeX reader:\n\n    + Allow `&` in LaTeX citation keys (#6110).\n    + Improve caption and label parsing.\n    + Don't emit empty Span elements for labels.\n    + Put tables with labels in a surrounding Div.\n    + Resolve `\\ref` to table numbers (#6137).\n    + Skip comments in more places where this is needed (#6114).\n    + Allow beamer overlays for all commands in all raw tex (#6043).\n      This affects parsing of raw tex in LaTeX and in Markdown and\n      other formats.\n    + Improve parsing of raw environments (#6034).  If parsing fails\n      in a raw environment (e.g. due to special characters like unescaped\n      `_`), try again as a verbatim environment, which is less sensitive to\n      special characters.  This allows us to capture special environments\n      that change catcodes as raw tex when `-f latex+raw_tex` is used.\n\n  * RST reader:\n\n    + Add highlight directive (#6140, Lucas Escot).\n\n  * MediaWiki writer:\n\n    + Prevent triple `[[[` which confuses MediaWiki (#6119).\n\n  * HTML reader:\n\n    + Don't parse `data-id` as `id` attribute.  And similarly don't\n      parse any `data-X` as `X` when `X` is a valid HTML attribute.\n\n  * Org reader:\n\n    + Simplify parsing of sub- and superscripts (#6127, Albert Krewinkel).\n      Speeds up parsing of single-word, markup-less sub- and superscripts.\n\n  * LaTeX writer:\n\n    + Group biblatex citations even with prefix and suffix (#5849, Ethan\n      Riley).  Previously biblatex citations were only grouped if there\n      was no prefix.  This patch allows them to be grouped in subgroups split\n      by prefixes and suffixes, which allows better citation sorting.\n    + Fix regression in handling of columns in beamer slides (#6033).\n      Columns in title slides were causing problems with\n      slide division.\n    + Fix duplicate frame classes in LaTeX/Beamer output (#6107).\n\n  * HTML writer:\n\n    + Fix duplicate attributes on headings (#6062), regression from 2.7.x.\n    + Fix `--number-offset` with HTML TOC.  Eventually it would be worth\n      adding a parameter to `makeSections` so this could be done at that\n      level; then it would also affect other writers that construct\n      TOC manually.\n    + reveal.js: restore old behavior for 2D nesting (#6032).\n      The fix to #6030 actually changed behavior, so that the\n      2D nesting occurred at slide level N-1 and N, instead of\n      at the top-level section.  This commit restores the v2.7.3 behavior.\n      If there are more than 2 levels, the top level is horizontal\n      and the rest are collapsed to vertical.\n    + reveal.js: ensure that pauses work even in title slides (#5819).\n\n  * Markdown writer:\n\n    + Fix regression: spurious dots in markdown_mmd metadata output (#6133).\n\n  * Docx writer:\n\n    + Fix regression with Compact style on tight lists (#6072).\n      Starting in 2.8, the docx writer no longer distinguishes between tight\n      and loose lists, since the Compact style is omitted.  This is a\n      side-effect of the fix to #5670, as explained in the changelog.  This\n      patch fixes the problem by extending the exception currently offered to\n      Plain blocks inside tables to Plain blocks inside list items.\n\n  * Jira writer:\n\n    + Fix output of table headers (Albert Krewinkel, #6035).\n\n  * Add Text.Pandoc.Image with unexported svgToPng.\n\n  * Text.Pandoc.XML: Export `html5Attributes`, `html4Attributes`,\n    `rdfaAttributes` (formerly unexported in Text.Pandoc.Writers.HTML).\n    [API change]\n\n  * Text.Pandoc.Shared: Export a new function `findM` (#6125,\n    Joseph C. Sible).\n\n  * Text.Pandoc.Logging: Add `RunningFilter`, `FilterCompleted`\n    constructors to LogMessage [API change].\n\n  * Text.Pandoc.CSV: fix bug in CSV parser; previously an extra blank record\n    would sometimes be inserted at the end.\n\n  * LaTeX template: add space option to xeCJK with PassOptionsToPackage\n    (#6002).  Otherwise we can get a clash with documentclasses that\n    already load the package.\n\n  * Lua filters:\n\n    + Allow filtering of element lists (#6038, Albert Krewinkel).  Lists of\n      Inline and Block elements can now be filtered via `Inlines` and\n      `Blocks` functions, respectively. This is helpful if a filter\n      conversion depends on the order of elements rather than a single\n      element.  For example, the following filter can be used to remove all\n      spaces before a citation:\n\n          function isSpaceBeforeCite (spc, cite)\n            return spc and spc.t == 'Space'\n             and cite and cite.t == 'Cite'\n          end\n\n          function Inlines (inlines)\n            for i = #inlines-1,1,-1 do\n              if isSpaceBeforeCite(inlines[i], inlines[i+1]) then\n                inlines:remove(i)\n              end\n            end\n            return inlines\n          end\n\n    + Add methods `insert`, `remove`, and `sort` to pandoc.List\n      (Albert Krewinkel).  Example of use:\n\n          local numbers = pandoc.List {2, 3, 1}\n          numbers:sort()     -- numbers is now {1, 2, 3}\n    + Make `pandoc.List` a callable constructor (Albert Krewinkel).\n      It is now possible to construct a new List via\n      `pandoc.List()` instead of `pandoc.List:new()`.\n    + Add tests for pandoc.List module (Albert Krewinkel).\n\n  * Text.Pandoc.App.CommandLineOptions: Change `setVariable` to use `Text`\n    instead of `String`.  This avoids some unnecessary unpacking.\n\n  * Use versioned directory for windows release zipfile.\n    Also remove old `make-windows-installer.bat`, superseded by GitHub\n    actions workflow, and modify `pandoc.wxs` for new paths.\n\n  * Extensive code cleanup (#6141, #6128, #6129, #6130, #6123,\n    #6105, 6102, #6117, #6124, #6115, #6116, #6111, Joseph C. Sible).\n\n  * Fix hlint warnings (Albert Krewinkel).\n\n  * Use latest doclayout, doctemplates (#6031).  The new version of\n    doclayout fixes a memory leak that affected `--include-in-header` with\n    large files (and possibly other cases involving extremely long lines).\n\n  * Use latest texmath.\n\n  * Use latest skylighting and fix test suite (#6086).\n\n  * sample.lua: Fix typo in descriptive comments (#6136, Caleb Maclennan).\n    Fix typo in error message (#6135).\n\n  * Add Docker and GH Actions instructions/links to INSTALL.md.\n\n  * Update filter documentation (#6065). Improve cabal v2 instructions.\n    Remove example using pandoc API directly (we have other\n    docs for that and it was outdated).\n\n  * Lua filter docs:\n\n    + Cross-link constructors and types (Albert Krewinkel).\n      Thanks to @bpj for the idea.\n    + Sort pandoc.List methods alphabetically (Albert Krewinkel).\n    + Unify, fix anchors and internal links (#6061, Albert Krewinkel).\n      Links and anchors now follow consistent conventions, like\n      lowercase-only anchor names.  This breaks some links to specific\n      sections in the document, but will make it much easier to link\n      documentation in the future.\n    + Clarify filter function execution order (#6059, Albert Krewinkel).\n\n  * In docs, update URLs and use `https:` wherever possible (#6090,\n    Salim B).\n\n## pandoc 2.9.1.1 (2020-01-05)\n\n  * Markdown reader:\n\n    + Fix parsing bug affected indented code after raw HTML (#6009, #5360).\n\n  * LaTeX writer:\n\n    + Fix regression in beamer slide structure with certain slide levels\n      (#6030).\n    + Allow framebreaks for beamer's TOC (Heiko Schlittermann, #6012)\n    + Properly handle unnumbered headings level 4+ (#6018).\n      Previously the `\\paragraph` command was used instead of\n      `\\paragraph*` for unnumbered level 4 headings.\n\n  * HTML writer:\n\n    + Fix revealjs slide structure regression with certain slide levels\n      (#6030).\n    + Add newlines to make slide show output more readable.\n\n  * Org writer:\n\n    + Remove extra spaces from table cells (Albert Krewinkel, #6024).\n\n  * JATS template: Update JATS dtd (Arfon Smith, #6020).  Use the archiving\n    and interchange DTD rather than the more restrictive journal publishing\n    DTD (which doesn't permit ext-link as a valid child).\n\n  * Text.Pandoc.PDF: Fix `runTeXProgram` so that the input source is always\n    overwritten (#6027).  Previously it wasn't overridden if the file already\n    existed, which led to bad results on subsequent runs when\n    `pdf-engine-opt=-output-directory=` was used to specify an explicit temp\n    dir.\n\n  * Text.Pandoc.BCP47: Change `getLang` to handle block-level contents\n    (#6008).  Some readers (e.g. RST) will populate the `lang` metadata field\n    with block-level content.  `getLang` has been modified to handle this.\n    Previously in these cases the LaTeX writer would not properly set the\n    \"main language\" of the document.\n\n  * Fix `test/tables.org` (Albert Krewinkel).\n\n  * Use HTTPS in copyright message (Felix Yan, #6010)\n\n\n## pandoc 2.9.1 (2019-12-23)\n\n  * Add Jira reader (Albert Krewinkel, #5556).\n\n  * Jira writer: use jira-wiki-markup renderer (Albert Krewinkel,\n    #5926). The following improvements are included in this change:\n\n    + non-jira raw blocks are fully discarded instead of showing\n      as blank lines;\n    + table cells can contain multiple blocks;\n    + unnecessary blank lines are removed from the output;\n    + markup chars within words are properly surrounded by\n      braces;\n    + preserving soft linebreaks via `--wrap=preserve` is\n      supported.\n\n    Note that backslashes are rendered as HTML entities, as there\n    appears no alternative to produce a plain backslash if it is\n    followed by markup. This may cause problems when used with\n    confluence, where rendering seems to fail in this case.\n\n  * Fix regression with `--number-sections`. Starting with 2.8,\n    `--number-sections` also had the effect of `--section-divs`,\n    even if `--section-divs` was not specified.\n\n  * Improved table of contents generation in markdown, RTF,\n    commonmark, better handling cases where section headings are\n    enclosed in divs.\n\n  * Ensure that later default file values for `variable` replace\n    earlier ones (5988).\n\n  * HTML reader: Add `nav` to list of block-level tags.\n\n  * Org reader (Albert Krewinkel):\n\n    + Wrap named table in Div, using name as id (#5984).\n      Tables which are given a name via `#+NAME:` or `#+LABEL:`\n      are wrapped in an additional Div, with the name set as the\n      Div's ID.\n    + Report parsing errors properly.\n    + Fix parsing problem for colons in headline (#5993).\n\n  * Text.Pandoc.PDF: Ensure UTF8 when printing source in\n    `--verbose` mode, avoiding an error on platforms that\n    default to something other than UTF-8 (#5997).\n\n  * Text.Pandoc.Templates: Strip directory before trying to find\n    partial in data files (#5987).\n\n  * Text.Pandoc.Shared: Improve `makeSections` so we don't get\n    doubled \"number\" attributes in EPUB output (or anywhere\n    else) (#5986).\n\n  * Added tests for `--toc` and `--section-divs`.\n\n  * Text.Pandoc.MIME: Added glsl MIME type for WebGL maps (#6000,\n    Jared Lander).\n\n  * MANUAL: A bit clearer explanation for `--base-header-level`.\n    We now say exactly how to translate between the deprecated\n    `--base-header-level` and `--shift-heading-level-by`.\n\n  * lua-filters.md:\n\n    + Remove spurious dot in title (#5996, Mauro Bieg).\n    + Replace metadata example with image centering (#6004,\n      Albert Krewinkel). Thanks to @efx for proposing this filter.\n\n\n## pandoc 2.9 (2019-12-11)\n\n  * Text.Pandoc.Templates [API change]\n\n    + Add Monad wrappers `WithDefaultPartials` and `WithPartials`.\n      Wrapping these around an instance of `PandocMonad` gives\n      us different instances of `TemplateMonad`, with different\n      search behavior in retrieving partials.\n      To compile a template and limit partial search to pandoc's\n      data files, use `runWithDefaultPartials (compileTemplate ...)`.\n      To compile a template and allow partials to be found locally\n      (either on the file system or via HTTP, in the event that\n      the main template has an absolute URL), ue\n      `runWithPartials (compileTemplate ...)`.\n    + Export `getTemplate`, which seeks a template locally,\n      or via HTTP if the template has an absolute URL, falling\n      back to the data files if not found.\n    + Export `compileDefaultTemplate` -- does `getDefaultTemplate`\n      and compiles the result, raising an error on failure.\n\n  * Text.Pandoc.Class [API change]\n\n    + Remove `TemplateMonad` instances for `PandocIO` and `PandocPure`.\n      These were too limiting and caused a bug whereby a local\n      partial could be used even when the default template was requested.\n      We now rely on instances provided in the Templates module.\n\n  * Text.Pandoc.App.OutputSettings: Simplify template retrieval code.\n\n  * ConTeXt template: Adjust to title formatting (#5949, Denis Maier).\n    Add `\\setupinterlinespace` to `title`, `subtitle`, `date` and `author`\n    elements:  otherwise longer titles that run over multiple lines will look\n    squashed as `\\tfd` etc. won't adapt the line spacing to the font size.\n\n  * reveal.js template: Add title-slide-attributes variable (#5981,\n    Frederik Elwert).\n\n  * More informative JSON parse error (#5973).\n\n  * Use external emojis package (forked from pandoc).  Removed emoji data\n    in Text.Pandoc.Emoji.\n\n  * Fix regression in `makeSections` (#5965).\n    Previously `hierarchicalize` (the ancestor of `makeSections`) would put\n    header attributes on the containing Div.  In 2.8 this behavior changed,\n    which broke some tools depending on pandoc.  Here we roll back this change,\n    so that attributes again migrate from the header to the containing Div when\n    `makeSections` is run.  Note that attributes are retained on the header as\n    well (unlike before) -- with the exception of the `id` attribute, which of\n    course cannot be duplicated.\n\n  * Fix `--toc-depth` regression in 2.8 (#5967).\n\n  * Use doctemplates 0.8.  Rename template 'filters' as 'pipes'\n    to avoid confusion with the other notion of filter used by pandoc.\n\n  * Fix README.md so that relative links from manual become absolute.\n    Previously they'd be broken links when viewed on GitHub or Hackage.\n    So we add the base URL for the pandoc manual.\n\n  * Document display math syntax in manual.\n\n## pandoc 2.8.1 (2019-12-05)\n\n  * Add `ascii_identifiers` as a supported extension for `markdown`.\n    This fixes a regression in 2.8.\n\n  * Fix regression with behavior of `--variable` (#5962).\n    Previously `-Vfoo=1 -Vfoo=2` would produce a list value for foo;\n    with 2.8 it produced just `2`.  This commit restores the earlier\n    behavior.\n\n  * Roll back part of of `--shift-heading-level-by` change (#5957).\n    With positive heading shifts, starting in 2.8 this option\n    caused metadata titles to be removed and changed to regular\n    headings.  This behavior is incompatible with the old\n    behavior of `--base-header-level` and breaks old workflows,\n    so we have rolled back the change. Note that there is now an\n    asymmetry in positive and negative heading level shifts:\n    With positive shifts, the metadata title stays the same and\n    does not get changed to a heading in the body, while with\n    negative shifts, a heading can be converted into the\n    metadata title.\n\n  * Text.Pandoc.Shared: Fix `makeSections` so it doesn't turn\n    column Divs into sections.\n\n  * HTML writer: add task-list class to ul if all elements are\n    task list items.  This will allow styling unordered task\n    lists in a way that omits the bullet.\n\n  * HTML-based templates: Add CSS to suppress bullet on unordered task lists.\n\n  * ConTeXt template: Fix `\\startcslreferences` and use ConTeXt syntax\n    conventions (#5945, Denis Maier).  The old version had a too large\n    a skip at the beginning of the reference list.\n\n  * LaTeX template: keep the `\\author{}` command even if author is not\n    specified (#5961, Yihui Xie).  Avoids a LaTeX warning.\n\n  * Generate Emoji module with TH.\n\n    + Add Text.Pandoc.Emoji.TH.\n    + Replace long literal list in Text.Pandoc.Emoji with one-liner\n      generating it from `emoji.json` using TH.\n    + Add Makefile target to download `emoji.json`.\n    + Remove `tools/emoji.hs`.\n\n  * Increase GC allocation space for compilation in cabal.project.\n\n  * Clean up manual on PDF generation backend options (#5940).\n\n  * Update release checklist to include code signing step and update\n    Windows release-candidate builds (#5950).\n\n\n## pandoc 2.8.0.1 (2019-11-26)\n\n  * List `pdf` in `--list-output-formats`.\n  * EPUB writer: Fix regression with `--css` (#5937).  In 2.8 `--css`\n    would not have an effect on EPUB output.\n  * RST writer: Use grid tables for one-column tables, since\n    simple tables clash with heading syntax in this case (#5936).\n  * Add unexported module Text.Pandoc.Readers.Metadata (see #5914).\n  * Use doctemplates 0.7.2, which adds the `nowrap` filter to\n    templates.\n  * Update default man template using `nowrap` for .TH heading (#5929).\n  * HTML templates: Add support for `toc-title` variable (#5930,\n    Alexandre Franke).\n  * Remove `grffile` (LaTeX package) requirement in MANUAL.txt\n    (#5927, Ian Max Andolina).\n  * Use skylighting 0.8.3.\n\n## pandoc 2.8 (2019-11-22)\n\n  * Improvements in templates system (from doctemplates):\n\n    + Pandoc templates now support a number of new features that\n      have been added in doctemplates: notably, `elseif`, `it`,\n      partials, filters, and syntax to control nesting and reflowing of\n      text.  These changes make pandoc more suitable out of the\n      box for generating plain-text documents from data in YAML\n      metadata.  It can create enumerated lists and even tabular\n      structures.\n    + We now used templates parameterized on doclayout Doc types.\n      The main impact of this change is better reflowing of\n      content interpolated into templates.  Previously,\n      interpolated variables were rendered independently and\n      interpolated as strings, which could lead to overly long\n      lines. Now the templates interpolated as Doc values which\n      may include breaking spaces, and reflowing occurs after\n      template interpolation rather than before.\n    + Remove code from the LaTeX, Docbook, and JATS writers that\n      looked in the template for strings to determine whether it\n      is a book or an article, or whether csquotes is used. This\n      was always kludgy and unreliable.\n    + Change template code to use new API for doctemplates.\n\n  * Add `--defaults`/`-d` option.  This adds the ability to specify\n    a collection of default values for options in a YAML file. For\n    example, one might define a set of defaults for letters,\n    and then do `pandoc -d letter myletter.md -o myletter.pdf`.\n    See the documentation of this feature in MANUAL.txt.\n\n  * Raise error on unsupported extensions (#4338).\n\n  * The `--list-extensions[=FORMAT]` option now lists only\n    extensions that affect the given FORMAT.\n\n  * Add `-L` option as shortcut for `--lua-filter`.\n\n  * Add `--shift-heading-level-by` option and deprecate\n    `--base-heading-level` (#5615). The new option does\n   everything the old one does, but also allows negative shifts.\n   It also promotes the document metadata (if not null) to a\n   level-1 heading with a +1 shift, and demotes an initial\n   level-1 heading to document metadata with a -1 shift. This\n   supports converting documents that use an initial level-1\n   heading for the document title.\n\n  * Allow `--metadata-file` to be used repeatedly to include\n    multiple metadata files (Owen McGrath, #5702). Values in\n    files specified first will be overridden by those in later\n    files.\n\n  * `--ascii` now uses numerical hex character references (#5718).\n\n  * Allow PDF output to stdout (#5751).  PDF output now behaves like other\n    binary formats: it will not be output to the terminal, but can be\n    sent to stdout using either `-o -` or a pipe.  The intermediate format\n    will be determined based on the setting of `--pdf-engine`.\n\n  * Make some writers sensitive to 'unlisted' class on headings (#1762).\n    If this is present on a heading with the 'unnumbered' class,\n    the heading won't appear in the TOC.  This class has no\n    effect if 'unnumbered' is not also specified.  This affects HTML-based\n    writers (including slide shows and EPUB), LateX (including beamer), RTF,\n    and PowerPoint.  Other writers do not yet support `unlisted`.\n\n  * Fix `gfm_auto_identifiers` behavior with emojis (#5813).  Note that\n    we also now use emoji names for emojis when `ascii_identifiers`\n    is enabled.\n\n  * When `--ipynb-output` is used with the default \"best\" format, strip\n    ANSI escape codes for non-ipynb output (#5633).  These cause problems\n    in many formats, including LaTeX.\n\n  * Don't look for template files remotely for remote input (#5579).\n    Previously pandoc would look for the template at a remote URL when a\n    URL was used for the input file, instead of taking it from the\n    data directory.\n\n  * Allow combining `-Vheader-includes` and `--include-in-header` (#5904).\n    Previously `header-includes` set as a variable would be\n    clobbered by material included using `--include-in-header`.\n\n  * Change merge behavior for metadata.  Previously, if a document\n    contained two YAML metadata blocks that set the same field, the\n    conflict would be resolved in favor of the first. Now it is resolved\n    in favor of the second (due to a change in pandoc-types).\n    This makes the behavior more uniform with other things in pandoc\n    (such as reference links and `--metadata-file`).\n\n  * Don't add a newline to fragment output if there's already one.\n\n  * Change exit codes and document in MANUAL.txt:\n\n    + `PandocAppError` was 1, is now 4\n    + `PandocOptionError` was 2, is now 6\n    + `PandocMakePDFError` was 65, is now 66\n\n  * Switch to new pandoc-types and use Text instead of String [API change].\n    (Christian Despres, #5884).\n\n  * HTML reader:\n\n    + Better handling of `<q>` with cite attribute (#5798, Ole Martin Ruud).\n      If a `<q>` tag has a `cite` attribute, we interpret it as a Quoted\n      element with an inner Span.\n    + Add support for HTML `<samp>` element (#5792, Amogh Rathore).\n      The `<samp>` element is parsed as Code with class `sample`.\n    + Add support for HTML `<var>` element (#5799, Amogh Rathore).\n      The `<var>` element is parsed as Code with class `variable`.\n    + Add support for `<mark>` elements (Florian B, #5797).  Parse\n      `<mark>` elements from HTML as Spans with class `mark`.\n    + Add support for `<kbd>` elements, parsing them as Span with class\n      `kbd` (Daniele D'Orazio, #5796).\n    + Add support for `<dfn>`, parsing this as a Span with class `dfn`\n      (#5882, Florian Beeres).\n\n  * Markdown reader:\n\n    + Headers: don't parse content over newline boundary (#5714).\n    + Handle inline code more eagerly within lists (Brian Leung, #5627).\n    + Removed some needless lookaheads.\n    + Don't parse footnote body unless extension enabled.\n    + Fix small super/subscript issue (#5878).  Superscripts and subscripts\n      cannot contain spaces, but newlines were previously allowed\n      (unintentionally).  This led to bad interactions in some cases\n      with footnotes.  With this change newlines are also not allowed inside\n      super/subscripts.\n    + Use `take1WhileP` for `str`, table row.  This yields a small but\n      measurable performance improvement.\n\n\n  * LaTeX reader:\n\n    + Fix parsing of optional arguments that contain braced text (#5740).\n    + Don't try to parse includes if `raw_tex` is set (#5673).\n      When the `raw_tex` extension is set, we just carry through\n      `\\usepackage`, `\\input`, etc. verbatim as raw LaTeX.\n    + Properly handle optional arguments for macros (#5682).\n    + Fix `\\\\` in `\\parbox` inside a table cell (#5711).\n    + Improve `withRaw` so it can handle cases where the token string is\n      modified by a parser (e.g. accent when it only takes part of a Word\n      token) (#5686).  This fixes a bug that caused the ends of\n      certain documents to be dropped.\n    + Handle `\\passthrough` macro used by latex writer (#5659).\n    + Support tex `\\tt` command (#5654).\n    + Search for image with list of extensions like latex does, if an\n      extension is not provided (#4933).\n    + Handle `\\looseness` command values better (#4439).\n    + Add `mbox` and `hbox` handling (Vasily Alferov, #5586).\n      When `+raw_tex` is enabled, these are passed through literally.\n      Otherwise, they are handled in a way that emulates LaTeX's behavior.\n    + Properly handle `\\providecommand` and `\\provideenvironment` (#5635).\n      They are now ignored if the corresponding command or environment\n      is already defined.\n    + Support epigraph command in LaTeX Reader (oquechy, #3523).\n    + Ensure that expanded macros in raw LaTeX  end with a space\n      if the original did (#4442).\n    + Treat `ly` environment from lilypond as verbatim (Urs Liska, #5671).\n    + Add `tikzcd` to list of special environments (Eigil Rischel).\n      This allows it to be processed by filters, in the same way that\n      one can do for `tikzpicture`.\n\n  * Roff reader:\n\n    + Better support for `while`.\n    + More improvements in parsing conditionals.\n    + Fix problem parsing comments before macro.\n    + Improve handling of groups.\n    + Better parsing of groups (#5410).  We now allow groups\n      where the closing `\\\\}` isn't at the beginning of a line.\n\n  * RST reader:\n\n    + Keep `name` property in `imgAttr` (Brian Leung, #5619).\n    + Fixed parsing of indented blocks (#5753).  We were requiring\n      consistent indentation, but this isn't required by RST.\n    + Use title, not admonition-title, for admonition title.\n      This puts RST reader into alignment with docbook reader.\n    + Don't strip final underscore from absolute URI (#5763).\n    + Avoid spurious warning when resolving links to internal anchors\n      ending with `_` (#5763).\n\n  * Org reader:\n\n    + Accept `ATTR_LATEX` in block attributes (Albert Krewinkel, #5648).\n      Attributes for LaTeX output are accepted as valid block attributes;\n      however, their values are ignored.\n    + Modify handling of example blocks (Brian Leung, #5717).\n    + Allow the `-i` switch to ignore leading spaces (Brian Leung).\n    + Handle awkwardly-aligned code blocks within lists (Brian Leung).\n      Code blocks in Org lists must have their `#+BEGIN_` aligned in a\n      reasonable way, but their other components can be\n      positioned otherwise.\n    + Fix parsing of empty comment lines (#5856, Albert Krewinkel).\n      Comment lines in Org-mode can be completely empty.\n\n  * Muse reader (Alexander Krotov):\n\n    + Add RTL support (#5551).\n    + Do not allow closing asterisks to be followed by `*`.\n    + Do not split series of asterisks into symbols and emphasis (#5821).\n    + Do not terminate emphasis on `*` not followed by space.\n\n  * DokuWiki reader:\n\n    + Parse markup inside monospace ('') (#5916, Alexander Krotov).\n\n  * Docx reader:\n\n    + Move style-parsing-specific code to a new unexported module,\n      Text.Pandoc.Readers.Docx.Parse.Styles (Nikolay Yakimov).\n    + Move StyleMap to docx writer (Nikolay Yakimov).\n    + Only use LTR when it is overriding BiDi setting (#5723, Jesse\n      Rosenthal).  The left-to-right direction setting in docx is used\n      in the spec only for overriding an explicit right-to-left setting.\n      We only process it when it happens in a paragraph set with BiDi.\n      This is especially important for docs exported from Google Docs,\n      which explicitly (and unnecessarily) set `rtl=0` for every paragraph.\n    + Fix list number resumption for sublists (#4324).\n      The first list item of a sublist should not resume numbering\n      from the number of the last sublist item of the same level,\n      if that sublist was a sublist of a different list item.\n\n  * Docbook reader:\n\n    + Richer parse for admonitions (Michael Peyton Jones, #1234).\n      Instead of parsing admonitions as blockquotes, we now parse\n      them as Divs with an appropriate class. We also handle titles\n      for admonitions as a nested Div with the \"title\" class.\n    + Fix nesting of chapters and sections (#5864, Florian Klink,\n      Félix Baylac-Jacqué).\n    + Fix bug with entities in mathphrase element (#5885).\n\n  * MediaWiki reader:\n\n    + Skip optional `{{table}}` template (#5757).\n\n  * LaTeX reader:\n\n    + Fix dollar-math parsing to ensure that space is left between a\n      control sequence and a following letter (#5836).\n    + In `untokenize`, ensure space between control sequence\n      and following letter (#5836).\n    + Don't omit macro definitions defined in the preamble.\n      These were formerly omitted (though they still affected macro\n      resolution if `latex_macros` was set).  Now they are included in\n      the document body.\n    + Parse macro definitions as raw LaTeX when `latex_macros` is\n      disabled.  (When `latex_macros` is enabled, we omit them, since\n      pandoc is applying the macros itself.)\n    + Fix a hang/memory leak in certain circumstances (#5845).\n    + Text.Pandoc.Readers.LaTeX.Parsing: add `[Tok]` parameter to\n      `rawLaTeXParser`.  This allows us to repeat retokenizing\n      unnecessarily in e.g. `rawLaTeXBlock`.\n    + Add KOMA-Script metadata commands (#5910, Andrew Dunning).\n      Add all titling commands to existing definition for `\\dedication`.\n    + Parse `\\micro` siunitx unit command (#5921, Jose Luis Duran).\n\n  * Markdown writer:\n\n    + Ensure proper nesting when we have long ordered list markers (#5705).\n    + Make `plain` output plainer (#5741).  Previously we used the following\n      Project Gutenberg conventions for plain output: extra space before and\n      after level 1 and 2 headings, all-caps for strong emphasis,\n      underscores surrounding regular emphasis. Now these\n      conventions are used only when the `gutenberg` extension is\n      enabled. By default, Strong and Emph are rendered without\n      special formatting, and headings are rendered without\n      special formatting, and with only one blank line following.\n      To restore the former behavior, use `-t plain+gutenberg`.\n    + Prefer using raw_attribute when enabled (#4311).\n      The `raw_attribute` will be used to mark raw bits, even HTML\n      and LaTeX, and even when `raw_html` and `raw_tex` are\n      enabled, as they are by default. To get the old behavior,\n      disable `raw_attribute` in the writer.\n    + Prefer `pipe_tables` to raw HTML even when we must\n      lose width information (#2608, #4497).\n    + Improve escaping in list items (#5918).\n\n  * AsciiDoc writer:\n\n    + Don't include `+` in code blocks for regular asciidoc.\n      This is asciidoctor-specific.\n    + Handle admonitions (#5690).\n\n  * LaTeX writer:\n\n    + Add thin space when needed in LaTeX quote ligatures (#5684).\n    + Use `\\hspace{0pt}` for 0-width space U+200B (#5756).\n    + Use `cslreferences` environment for csl bibliographies.\n      This allows bibliographies to receive special formatting.\n      The template now contains definition of this environment (enabled\n      only when CSL is used).  It also defines a `\\cslhangindent` length.\n      This is set to 2em by default when the bibliography style specifies\n      a hanging indent.  To override the length, you can use e.g.\n      `\\setlength{\\cslhangindent}{7em}` in header-includes.\n      See jgm/pandoc-citeproc#410.\n    + Strip off `{}` around locator for biblatex/natbib output (#5722).\n    + Fix line breaks at start of paragraph (#3324).\n      Previously we just omitted these. Now we render them\n      using `\\hfill\\break` instead of `\\\\`.  This is a revision\n      of a PR by @sabine (#5591) who should be credited with the idea.\n    + We no longer look in the template or header-includes to see if a\n      book or article documentclass is used, or to see whether the\n      `csquotes` package is used. To use `csquotes` for LaTeX, set\n      `csquotes` in your variables or metadata. To specify a book\n      style, use the `documentclass` variable or\n      `--top-level-division`.\n    + Fix horizontal rule (#5801).  We change to use 0.5pt rather than\n      `\\linethickness`, which apparently only ever worked \"by accident\"\n      and no longer works with recent updates to texlive.\n\n  * ConTeXt writer:\n\n    + Add option to include source files in ConTeXt PDFs (Tristan\n      Stenner, #5578). The metadata field or variable\n      (`includesource`) can be set to attach the source documents\n      to the resulting PDF.\n    + Customizable type of PDF/A for the ConTeXt writer (Karl\n      Pettersson, #5608).  The `pdfa` variable may now be set in metadata.\n      Also updated color profile settings in accordance with ConTeXt wiki,\n      and made ICC profile and output intent for PDF/A customizable\n      using `pdfaiccprofile` and `pdfaintent`.\n    + Unit tests: adjust code property to avoid an irrelevant\n      failure involving inline code with two consecutive newlines.\n    + Set `csl-hanging-indent` variable if needed.\n    + Use special environment for CSL references.\n    + Use braces, not start/stop, for inline language tags.\n      This prevents unwanted gobbling of spaces.\n\n  * HTML writer:\n\n    + Use numeric character references with `--ascii` (#5718).\n      Previously we used named character references with html5 output.\n      But these aren't valid XML, and we aim to produce html5 that is\n      also valid XHTML (polyglot markup).  (This is also needed for epub3.)\n    + Ensure that line numbers in code blocks get id-prefix (#5650).\n    + Ensure TeX formulas are rendered correctly (Philip Pesca,\n      #5658). The web service passed in to `--webtex` may render\n      formulas using inline or display style by default.\n      Prefixing formulas with the appropriate command ensures\n      they are rendered correctly.\n    + Render inline formulas correctly with `--webtex` (Philip\n      Pesca, #5655). We add `\\textstyle` to the beginning of the\n      formula to ensure it will be rendered in inline style.\n    + Pass through `aria-` attributes to HTML5 (#5642).\n    + Render a Quoted element with an inner Span with\n      `cite` attribute using a `<q>` tag (#5798, Ole Martin Ruud).\n    + Render a Span with class `mark` using the `<mark>` element\n      (Florian Beeres, #5797).\n    + Render Span with class `dfn` using `<dfn>` element\n      (Florian Beeres, #5882).\n    + Render Span with class `kbd` using `<kbd>` element (Daniele\n      D'Orazio, #5796).\n    + Render Code with class `variable` using `<var>` element\n      (Amogh Rathore, #5799).\n    + Render Code with class `sample` using `<samp>` element\n      (Amogh Rathore, #5799).\n\n  * EPUB writer:\n\n    + Improve splitting into chapters (#5761), using `makeSection`.\n    + Avoid issuing warning multiple times when title not set (see #5760).\n    + Use svg tag wrapper for cover image (#5638).  In addition, the\n      code generating the image has been moved to the template, to make it\n      more customizable. NOTE: Those who use custom EPUB\n      templates will need to adjust their templates, adding the\n      code to generate the cover image. (Previously this was just\n      inserted into 'body'.)\n    + Improve toChapters, making it work better if there are Divs\n      around sections.\n    + Add support for EPUB2 covers (blmage, #3992).\n    + Do not override existing \"fileN\" medias when writing to EPUB format\n      (blmage, #4206).\n    + Ensure that `lang` variable is set on all chapters (so that it\n      will add an `xml:lang` attribute on the `html` element).\n\n  * RST writer:\n\n    + Removed remnants of `admonition-title`.\n    + Fix handling of `:align:` on figures and images (#4420).\n      When the image has the `align-right` (etc.) class, we now use\n      an `:align:` attribute.\n    + Improve spacing for tables with no width information (#5899).\n      If a simple table would be too wide, we use a grid table.\n    + Fix backslash escaping after strings (Albert Krewinkel, #5906).\n      The check whether a complex inline element following a string must\n      be escaped, now depends on the last character of the string instead\n      of the first.\n    + Ensure there's a blank line before tables (#5898).\n\n  * Dokuwiki writer:\n\n    + Handle mixed lists without HTML fallback (#5107).\n\n  * XWiki writer:\n\n    + Fix multiline table (Zihang Chen, #5683).\n\n  * Muse writer:\n\n    + Add RTL support (Alexander Krotov, #5551).\n\n  * Man writer:\n\n    + Suppress non-absolute link URLs (#5770).  Absolute URLs are\n      still printed in parentheses following the link text, but relative\n      URLs are suppressed (just as internal links starting with '#'\n      always have been).\n    + Improved definition list term output.  Now we boldface code but\n      not other things. This matches the most common style in man pages\n      (particularly option lists).\n\n  * Ms writer:\n\n    + Use `.LP` instead of `.PP` for line block (#5588).\n    + Use boldface for definition terms in DefinitionLists.\n\n  * JATS writer:\n\n    + Do not emit empty `<fn-group>` (Mauro Bieg, #5595).\n    + Update template to v1.1dtd (#5632, Arfon Smith).\n    + Update `data/jats.csl` to avoid commas between editor\n      name-part elements. (#5629)\n    + Add `abstract` to template (Mauro Bieg).\n\n  * TEI writer:\n\n    + Don't strip hash from internal links (#5922).\n\n  * Jira writer:\n\n    + Remove escapeStringForJira for code blocks (Jan-Otto Kröpke).\n    + Remove extraneous newline after single-line block quotes\n      (#5858, Albert Krewinkel).\n    + Improve escaping of special characters, using backslash escapes\n      instead of HTML entities (#5858, Albert Krewinkel).\n\n  * OpenDocument writer:\n\n    + Avoid duplicate attributes (#4634). We use the innermost\n      attribute in nested cases.\n    + If `native_numbering` extension is set, use native OpenDocument\n      enumeration for figures and tables (Nils Carlson).\n    + Place caption before table (#5681, Dmitry Pogodin).\n\n  * ODT writer:\n\n    + Add a test for MathML formulas in ODT documents (blmage).\n    + Improve the parsing of frames in ODT documents (blmage).\n\n  * Docx writer:\n\n    + Make handling of styles more robust in localized versions\n      of Word (Nikolay Yakimov, #5523, #5052, #5074).  We now use\n      style names, not ids, for assigning semantic meaning, since\n      the ids can change depending on the locale. Style name\n      comparisons are case-insensitive, since those are\n      case-insensitive in Word. Since docx style names can have\n      spaces in them, and pandoc-markdown classes can't, anywhere\n      when style name is used as a class name, spaces are\n      replaced with ASCII dashes `-`. Code styles, i.e. \"Source\n      Code\" and \"Verbatim Char\" now honor style inheritance. Docx\n      Reader now honours \"Compact\" style (used in\n      Pandoc-generated docx). The side-effect is that \"Compact\"\n      style no longer shows up in docx+styles output. Styles\n      inherited from \"Compact\" will still show up.\n    + Re-use Readers.Docx.Parse for StyleMap (#5766, Nikolay Yakimov).\n    + Internal improvements and code simplification (Nikolay Yakimov).\n    + Preserve built-in styles in DOCX with custom style (Ben Steinberg,\n      #5670).  This change prevents custom styles on divs and spans\n      from overriding styles on certain elements inside them, like\n      headings, blockquotes, and links. On those elements, the\n      \"native\" style is required for the element to display correctly.\n      This change also allows nesting of custom styles; in order to do so,\n      it removes the default \"Compact\" style applied to Plain blocks,\n      except when inside a table.\n    + Add `proofState` to list of elements carried over from\n      settings.xml in the reference.docx (Krystof Beuermann, #5703).\n    + Change order of `ilvl` and `numId` in `document.xml` (Agustín\n      Martín Barbero, #5645). Also, make list para properties go first.\n      This reordering of properties shouldn't be necessary but\n      it seems Word Online does not understand the docx correctly otherwise.\n\n  * PowerPoint writer:\n\n    + Code formatting is now context dependent (Jeroen de Haas, #5573).\n      This commit alters the way in which the Powerpoint writer treats\n      inline code and code blocks. Inline code is now formatted at\n      the same size as the surrounding text. Code blocks are now given\n      a margin and font size according to their level.\n      Furthermore this commit allows changing the font with which code is\n      formatted via the `monofont` option.\n    + Start numbering at appropriate numbers (Jesse Rosenthal, #5709).\n      Starting numbers for ordered lists were previously ignored. Now\n      we specify the number if it is something other than 1.\n\n  * Text.Pandoc.Parsing:\n\n    + Add `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`,\n      `many1Till`, `manyUntil`, `mantyUntilChar`: these are like their\n      unsuffixed counterparts but pack some or all of their output\n      (Christian Despres, #5884).\n    + Add `stateAllowLineBreaks` to `ParserState` [API change].\n    + Fix inline parsing in grid table cells (#5708).\n    + Change type of `setLastStrPos` so it takes a `Maybe SourcePos`\n      rather than a `SourcePos` [API change].\n    + Make `parseFromString'` and `gridTableWith` and\n      `gridTableWith'` polymorphic in the parser state,\n      constraining it with `HasLastStrPosition` [API change].\n    + `parseFromString'`: reset `stateLastStrPos` to `Nothing` before parse.\n    + Rename takeWhileP -> take1WhileP and clean it up.\n      (It doesn't match the empty sequence.)\n\n  * Text.Pandoc.PDF:\n\n    + For PDFs via HTML, ensure temp file is deleted even if the pdf\n      program is not found (#5720).\n    + Better detection of a Cygwin environment (#5451).\n    + Don't assume tex log file is UTF8-encoded (#5872).\n      Fall back to latin1 if it can't be read as UTF-8.\n\n  * Text.Pandoc.Extensions:\n\n    + Export new function `getAllExtensions`, which returns the\n      extensions that affect a given format (whether enabled by default\n      or not) [API change].\n    + Change type of `parseFormatSpec` from\n      `Either ParseError (String, Extensions -> Extensions)`\n      to `Either ParseError (String, [Extension], [Extension])`\n      [API change].\n    + Add `Ext_gutenberg` constructor to `Extension` [API change].\n    + Add `Ext_native_numbering` constructor to `Extension` [API change]\n      (Nils Carlson).\n\n  * Text.Pandoc.Readers, Text.Pandoc.Writers:\n\n    + Change type of `getReader` and `getWriter` so they return\n      a value in the PandocMonad instance rather than an Either\n      [API change].  Exceptions for unknown formats and unsupported\n      extensions are now raised by these functions.\n\n  * Text.Pandoc.App\n\n    + Change `optMetadataFile` type from `Maybe FilePath` to `[FilePath]`\n      (Owen McGrath, #5702) [API change].\n\n  * Text.Pandoc.Logging:\n\n    + Add `CouldNotDeduceFormat` constructor to `LogMessage` [API change].\n      Issue this warning when we're falling back to markdown or\n      html because we don't recognize the extension of the input or\n      output files.\n    + Clarify warning for missing title (#5760).\n    + Add `UnusualConversion` constructor to `LogMessage` [API change]\n      (Mauro Bieg, #5736).  Emit warning on `-f latex -o out.pdf`.\n\n  * Lua filters:\n\n    + Improve function documentation (Albert Krewkinkel).\n    + Traverse nested blocks and inlines in correct order (Albert\n      Krewinkel, #5667). Traversal methods are updated to use the new\n      Walk module so that sequences with nested Inline (or Block) elements\n      are traversed in the order in which they appear in the linearized\n      document.\n    + New unexported module `Text.Pandoc.Lua.Walk` (Albert Krewinkel).\n      Lua filters must be able to traverse sequences of AST\n      elements and to replace elements by splicing sequences back\n      in their place. Special `Walkable` instances can be used for\n      this; those are provided in a new module\n      `Text.Pandoc.Lua.Walk`.\n    + `Attr` values can now be given as normal Lua tables (Albert\n      Krewinkel, #5744).  This can be used as a convenient alternative\n      to constructing `Attr` values with `pandoc.Attr`. Identifiers\n      are taken from the `id` field, classes must be given as\n      space separated words in the `class` field. All remaining fields\n      are included as attributes. With this change, the following lines\n      now create equal elements:\n      ```\n      pandoc.Span('test', {id = 'test', class = 'a b', check = 1})\n      pandoc.Span('test', pandoc.Attr('test', {'a','b'}, {check = 1}))\n      ```\n      This also works when using the *attr* setter:\n      ```\n      local span = pandoc.Span 'text'\n      span.attr = {id = 'test', class = 'a b', check = 1}\n      ```\n      Furthermore, the *attributes* field of AST elements can now be a\n      plain key-value table even when using the `attributes` accessor:\n      ```\n      local span = pandoc.Span 'test'\n      span.attributes = {check = 1}   -- works as expected now\n      ```\n    + Export `make_sections`, remove `hierarchicalize`. Lua filters that\n      use `hierarchicalize` will need to be rewritten to use\n      `make_sections`.\n    + Add a `clone()` method to all AST elements (Albert Krewinkel, #5568).\n    + Fix Lua function names in pandoc.system (niszet). Change\n      `get_current_directory` to `get_working_directory` and\n      `with_temp_directory` to `with_temporary_directory`, to\n      conform to the manual.\n\n  * Text.Pandoc.Error:\n\n    + Add constructors `PandocUnknownReaderError`,\n      `PandocUnknownWriterError`, `PandocUnsupportedExtensionError`.\n      [API change].\n    + Better message for `PandocShouldNeverHappenError`.\n    + Better message for `PandocTemplateError`.\n\n  * Text.Pandoc.Emoji:\n\n    + Update emoji list (#5666). Done using new `tools/emojis.hs`,\n     which uses the list from the gem GitHub uses. Future updates\n     can be done with this tool.\n\n  * Text.Pandoc.PDF:\n\n    + Pass value of `--dpi` to `rsvg-convert` when converting SVG to PDF\n      in the process of creating a PDF (#5721).\n\n  * Text.Pandoc.Shared:\n\n    + Replace `Element` and `makeHierarchical` with `makeSections`.\n      Now that we have Divs, we can use them to represent the\n      structure of sections, and we don't need a special Element type.\n      `makeSections` reorganizes a block list, adding Divs with class\n      `section` around sections, and adding numbering if needed.\n      This change also fixes some longstanding issues recognizing section\n      structure when the document contains Divs (#3057, see also #997).\n    + Remove `Element` type [API change]\n    + Remove `makeHierarchicalize` [API change]\n    + Add `makeSections` [API change]\n    + Export `deLink` [API change]\n    + Make `filterIpynbOutput` strip ANSI escapes from code in output\n      for non-ipynb formats, when the default \"best\" option is used with\n      `--ipynb-output` (#5633).\n    + Fix `camelCaseToHyphenated` so it handles `ABCDef` better.\n    + Improve `isTight` (#5857).  If a list has an empty item,\n      this should not count against its being a tight list.\n    + Export `htmlSpanLikeElements` [API change] (Daniele D'Orazio, #5796).\n      This is a mapping of HTML span-like elements that are internally\n      represented as a Span with a single class.\n    + Change the implementation of `htmlSpanLikeElements` to retain\n      classes and attributes (#5882, Florian Beeres).\n\n  * Text.Pandoc.Slides: recognize content in Divs when determining\n    slide level.\n\n  * Text.Pandoc.SelfContained:\n\n    + Omit content-type on type attribute for `<style>` (#5725).\n      It doesn't seem to be valid for HTML5, and as a result Chrome\n      ignores the style element.\n\n  * Text.Pandoc.Pretty has been removed [API change].\n    We now use the new external doclayout module instead.\n\n  * Text.Pandoc.Writers.Shared:\n\n    + Remove `metaToJSON`, `metaToJSON'` [API change].\n    + Modify `addVariablesToContext`, `defField`, `setField`, `getField`,\n     `resetField` to work with Context rather than JSON values. [API change]\n    + Export new function `endsWithPlain` [API change].\n    + Change `gridTables` so it does better at keeping the widths of\n      columns (#4320) and does better at figuring out column widths\n      when no widths are given (#5899).\n\n  * Text.Pandoc.Options\n\n    + Change type of `writerTemplate` to `Maybe Template` instead\n      of `Maybe String`.\n    + Change To/FromJSON instances for `HTMLMathMethod`, `CiteMethod`,\n      `ObfuscationMethod`, `TrackChanges`, `WrapOption`,\n      `TopLevelDivision`, `ReferenceLocation`, `HTMLSlideVariant` (#5790).\n      In each case we use lowercase (or hyphenated lowercase) for\n      constructors to line up more closely with command-line option\n      values.  This is a breaking change for those who manually decode or\n      encode JSON for these data types (e.g. for `ReaderOptions` or\n      `WriterOptions`).\n\n  * Text.Pandoc.Filters:\n\n    + Add `FromYAML` instance for `Filter`.\n    + `applyFilters`: Add and apply filters in order (not reversed)\n      This changes `applyFilters` from Text.Pandoc.Filter so\n      that it does a left fold rather than a right fold, applying\n      the filters in the order listed.\n\n  * Text.Pandoc.XML:\n\n    + Change `toEntities` to emit numerical hex character references\n      (#5718).\n\n  * Text.Pandoc.Highlighting:\n\n    + Add additional listings languages (Wandmalfarbe).\n\n  * Text.Pandoc.MediaBag:\n\n    + Some of the types using Strings were switched to use FilePath instead\n      (Christian Despres, #5884).\n\n  * Text.Pandoc.Templates:\n\n    + Don't import/export `varListToJSON` [API change].  It is removed in\n      doctemplates >= 0.3.\n    + Change type of `renderTemplate'` [API change].  Return value is\n      now Text rather than being polymorphic.  This makes room for\n      upcoming removal of the `TemplateTarget` class from doctemplates.\n\n  * Text.Pandoc.App.Opt [API changes]:\n\n    + More convenient To/FromJSON instances.  Make the field names\n      like `strip-empty-paragraphs` rather than `optStripEmptyParagraphs`.\n      Anyone who is using JSON serialization of Opt will need to adjust\n      things accordingly.\n    + Change `optHighlightStyle` to a `Maybe String` instead of\n      `Maybe Style`.  Do the parsing/loading of themes later, after\n      option parsing.\n    + Remove `optBaseHeaderLevel` from `Opt`.  We now just use\n      `optShiftHeadingLevelBy`, to avoid redundancy.\n    + Change `optShiftHeadingLevel` to `optShiftHeadingLevelBy` to\n      match the option.\n    + Custom FromJSON instance for `LineEnding`, so either `CRLF`\n      or `crlf` will work.\n    + Change `optVariables` from `[(String, String)]` to `Context Text`.\n    + Change `optMetadata` to `Meta`, to allow structured values.\n      The current behavior of the `--metadata` option stays the same.\n    + Rename `optReader`, `optWriter` as `optFrom`, `optTo`.\n    + Add `FromYAML` instances to `Opt` and to all subsidiary types.\n    + Rename `optMetadataFile` to `optMetadataFiles`.\n    + Rename `optPDFEngineArgs` to `optPDFEngineOpts`.\n    + Rename `optWrapText` to `optWrap`.\n    + Add `IpynbOutput` enumerated type: use this instead of\n      a string for `optIpynbOutput`.\n    + Change optInputFiles to a `Maybe [FilePath]` (#5888) [API change].\n      `Nothing` means: nothing specified.\n      `Just []` means: an empty list specified (e.g. in defaults).\n    + List fields in Opt so they aren't reversed (#5881) [API change].\n      Previously `optIncludeInHeader`, etc. were in reverse order.\n    + The `sourcefile` variable is now always a list. It used to be\n      sometimes a string, sometimes a list (when there was more than one).\n\n  * Template changes:\n\n    + default.latex: added code for `cslreferences` environment,\n      to be used for pandoc-citeproc references. A `csl-hanging-indent`\n      variable (set automatically if there is a `hanging-ident`\n      class on the references Div) controls whether contents of this\n      environment receive a hanging indent.\n    + default.latex: Add `space` as default option for xeCJK, so that\n      spaces between words are preserved (#5855, jeongminkim-islab).\n      This is necessary for Korean.\n    + default.latex: Remove include of `grffile` (#5848).\n      This package used to be needed for proper handling of image filenames\n      containing periods (in addition to the period before the extension).\n      It no longer works with the latest LaTeX kernel and graphicx,\n      so we have removed it. Future versions of graphicx will handle\n      these filenames without the need for `grffile`.\n    + default.context: add a saner default for page numbers.\n      Previously they appeared centered at the top of the page;\n      now we put them centered at the bottom, unless the `pagenumbering`\n      variable is set.\n    + default.context: define a start-stop-pair `cslreferences` to\n      allow for hanging indents in the bibliography (#5875, Denis Maier).\n    + default.ms: update defaults.  Use Palatino font, use slightly\n      wider interparagraph space, don't indent paragraphs,\n      and put page numbers on the bottom.  This brings ms output\n      closer to default LaTeX output.\n    + default.revealjs: add navigationMode (Mauro Bieg, #5657).\n    + default.muse: handle multiple authors better.\n    + docbook4, docbook5 templates: add indentation to body.\n    + HTML-based templates: use `styles.html` partial to avoid\n      code duplication.\n    + HTML-based templates: change indentation of styles in template.\n\n  * reference.docx (#5820):\n\n    + Change Block Text (block quote) style so that the same font\n      is used as in the body text, and the block text is indented\n      left and right.\n    + All headings now have a uniform color.\n    + Level-1 headings no longer set `w:themeShade=\"B5\"`.\n    + Level-2 headings are now 14 point rather than 16 point.\n    + Level-3 headings are now 12 point rather than 14 point.\n    + Level-4 headings are italic rather than bold.\n\n  * epub.css: Add CSS for hanging-indent div to support pandoc-citeproc's\n   new hanging indents.\n\n  * pandoc.cabal:\n\n    + Repeat ghc-options in all stanzas.\n    + Remove conditionals for ghc < 8 (Albert Krewinkel, #5693).\n    + Compile with `-Wcpp-undef` and `-fhide-source-paths` when possible\n      (Albert Krewinkel).\n    + Add cabal.project to extra-source-files (Albert Krewinkel).\n    + Add dependency on skylighting-core (#5729). Even though it shouldn't\n      be needed, some tools require it.\n    + Require latest pandoc-types, texmath, skylighting, haddock-library.\n    + Ensure TemplateHaskell is added to other-extensions when it is\n      used (Vanessa McHale, #5728).\n    + Remove `derive_json_via_th` flag; always use TH.  This cuts down\n      on code duplication and reduces the chance for errors.  See #4083.\n\n  * Makefile:\n\n    + Add ghci target.\n    + Add ghcid target.\n    + Remove references to obsolete flag (#5694).\n\n  * Benchmarks: fix failure on ipynb.\n\n  * Use MathJax 3 (zorkow).\n\n  * KaTeX math: respect `classoption=fleqn` variable,\n    bump KaTeX version to 0.11.1 (#5815, Mauro Bieg).\n\n  * Fix redundant constraint compiler warnings (Pete Ryland, #5625).\n\n  * Use throwError instead of fail when appropriate.\n\n  * Use Prelude.fail to avoid ambiguity with fail from GHC.Base.\n\n  * Add `diff-zip.sh` to tools (John MacFarlane, Agustín Martín Barbero).\n    This is intended to make it easier to test differences in zip\n    containers, like epub, docx, or odt.\n\n  * Add `.gitattributes` (#5747).  This ensures that the golden files\n    in `test/fb2/reader/` don't have newlines converted. This should fix\n    a test failure on GitHub CI with Windows.\n\n  * Reorder options in `--help`.\n\n  * Revise code for HsYAML-0.2.0.0 (@vijayphoenix, #5704).\n\n  * Remove blank line in code example in Haddocks (Leif Metcalf, #5679).\n\n  * Fix trypandoc with `getReader`/`getWriter` changes.\n\n  * Allow building pandoc with GHC 8.8.\n\n  * linux tarball: add architecture `-amd64` to filename.\n    Now it will be: `pandoc-VERSION-linux-ARCH.tar.gz`.\n\n  * MANUAL.txt:\n\n    + Add section for exit codes.\n    + Document some pptx limitations in slide show section:\n      No incremental display (#5689).  No pause with `. . .` (#5701).\n    + reveal.js flags (Mauro Bieg, #5653).\n    + Document addition of `data-` prefix to unknown attributes in HTML5.\n    + Link to YAML spec (Mauro Bieg, #5687).\n    + Fix capitalization of \"Linux\" (#5859, Marcus Stollsteimer).\n    + Use a table for exit codes.\n    + Put all template variable docs into one section.\n    + Use ATX headers consistently.\n    + Add fuller documentation of templates (#5779), including\n      new template syntax, partials, etc.\n    + Add documentation for the variable `hyperrefoptions` (Wandmalfarbe).\n    + Clarify when macro definitions are passed as raw latex.\n      In Markdown input, they are always passed through.  In LaTeX, only if\n      `latex_macros` is disabled.\n    + Clarify that `--dpi` provides a default and doesn't override\n      dpi values specified in the images themselves (#5721).\n    + Document how to use custom writers with `--standalone` (#5866).\n    + Clarify `--preserve-tabs` default.\n\n  * INSTALL.md:\n\n    + Fix instructions for libicu.\n    + Add Void Linux instructions (Volodymyr Kozachnyskyi).\n\n  * CONTRIBUTING.md:\n\n    + Add information on tests (Agustín Martín Barbero, #5652).\n    + Add information about command test naming to CONTRIBUTING (Florian B).\n\n  * Fix typos in changelog and comments (#5896, Brian Wignall).\n\n  * doc/lua-filters.md:\n\n    + Fix mistakes in mediabag module docs (#5851, Albert Krewinkel).\n    + Improve metadata replacement example in lua-filters doc (#5851).\n    + Mention which Lua version is shipped with pandoc (Albert Krewinkel,\n      #5892).\n\n## pandoc 2.7.3 (2019-06-11)\n\n  * Add `jira` (Atlassian's Jira wiki markup) as output format (#2497,\n    Albert Krewinkel).\n\n  * Add `tex_math_dollars` to `multimarkdownExtensions` (#5512).\n    This form is now supported in multimarkdown,\n    in addition to `tex_math_double_backslash`.\n\n  * Fix `--self-contained` so it works when output format has extensions.\n    Previously if you used `--self-contained` with `html-smart` or\n    `html+smart`, it wouldn't work.\n\n  * Add template variable `curdir` with working directory\n    from which pandoc is run (#5464).\n\n  * Markdown reader: don't create implicit reference for empty header\n    (#5549).\n\n  * Muse reader: allow images inside link descriptions (Alexander Krotov).\n\n  * HTML reader: epub related fixes.\n\n    + With epub extensions, check for `epub:type` in addition to `type`.\n    + Fix problem with noteref parsing which caused block-level\n      content to be eaten with the noteref.\n    + Rename `pAnyTag` to `pAny`.\n    + Refactor note resolution.\n    + Trim definition list terms (Alexander Krotov).\n\n  * LaTeX reader:\n\n    + Add braces when resolving `\\DeclareMathOperator`\n      (#5441).  These seem to be needed for xelatex but not pdflatex.\n    + Allow newlines in `\\mintinline`.\n    + Pass through unknown listings language as class (#5540).\n      Previously if the language was not in the list of languages supported\n      by listings, it would not be added as a class, so highlighting\n      would not be triggered.\n    + `rawLaTeXInline`: Include trailing `{}`s in raw latex commands (#5439).\n      This change affects the markdown reader and other readers that allow raw\n      LaTeX.  Previously, trailing `{}` would be included for unknown\n      commands, but not for known commands.  However, they are sometimes used\n      to avoid a trailing space after the command.  The chances that a `{}`\n      after a LaTeX command is not part of the command are very small.\n\n  * MediaWiki reader: handle multiple attributes in table row (#5471,\n    chinapedia).\n\n  * Docx reader: Add support for `w:rtl` (#5545).  Elements with this\n    property are put into Span inlines with `dir=\"rtl\"`.\n\n  * DocBook reader: Issue `IgnoredElement` warnings.\n\n  * Org reader (Albert Krewinkel):\n\n    + Fix planning elements in headers level 3 and higher\n      (#5494).  Planning info is now always placed before\n      the subtree contents.  Previously, the planning info was placed after\n      the content if the header's subtree was converted to a list, which\n      happens with headers of level 3 and higher per default.\n    + Omit, but warn about unknown export options.  Unknown export\n      options are properly ignored and omitted from the output.\n    + Prefer plain symbols over math symbols (#5483).\n      Symbols like `\\alpha` are output plain and unemphasized, not as math.\n    + Recognize emphasis after TODO/DONE keyword (#5484).\n\n  * FB2 reader:\n\n    + Skip unknown elements rather than throwing errors (#5560).\n      Sometimes custom elements are used (e.g. `id` element\n      inside `author`); previously the reader would halt with an error.\n      Now it skips the element and issues an `IgnoredElement` warning.\n    + Parse notes (#5493, Alexander Krotov).\n    + Internal improvements (Alexander Krotov).\n\n  * OpenDocument writer:  Roll back automatic figure/table numbering\n    (#5474).  This was added in pandoc 2.7.2, but it makes it impossible\n    to use pandoc-crossref. So this has been rolled back for now,\n    until we find a good solution to make this behavior optional\n    (or a creative way to let pandoc-crossref and this feature\n    to coexist).\n\n  * New module Text.Pandoc.Writers.Jira, exporting `writeJira` [API\n    change] (Albert Krewinkel).\n\n  * EPUB writer:\n\n    + Don't include 'landmarks' if there aren't any.\n      Previously we could get an empty ol element, which caused\n      validation errors with epubcheck.\n    + Ensure unique ids for styleesheets in content.opf (#5463).\n    + Make stylesheet link compatible with kindlegen (#5466,\n      Eric Schrijver).  Pandoc omitted `type=\"text/css\"` from both\n      `<style>` and `<rel=\"stylesheet\">` elements in all templates, which\n      is valid according to the spec. However, Amazon’s kindlegen software\n      relies on this attribute on `<link>` elements when detecting\n      stylesheets to include.\n\n  * HTML writer:\n\n    + Output video and audio elements depending on file\n      extension of the image path (Mauro Bieg).\n    + Emit empty alt tag in figures (#5518, Mauro Bieg).\n      The same text is already in the <figcaption> and\n      screen-readers would read it twice, see #4737.\n    + Don't add variation selector if it's already there.\n      This fixes round-trip failures.\n    + Prevent gratuitous emojification on iOS (#5469).\n      iOS chooses to render a number of Unicode entities, including '↩', as\n      big colorful emoji.  This can be defeated by appending Unicode\n      VARIATION SELECTOR-15'/'VARIATION SELECTOR-16'.  So we now append this\n      character when escaping strings, for both '↩' and '↔'.  If other\n      characters prove problematic, they can simply be added to\n      `needsVariationSelector`.  + Add `class=\"heading\"` to level 7+ Headers\n      rendered as `<p>` elements (#5457).\n\n  * RST writer: treat Span with no attributes as transparent (#5446).\n    Previously an Emph inside a Span was being treated as\n    nested markup and ignored.  With this patch, the Span\n    is just ignored.\n\n  * LaTeX writer:\n\n    + Include inline code attributes with `--listings` (#5420).\n    + Don't produce columns environment unless beamer (#5485).\n    + Fix footnote in image caption.  Regression: the fix for #4683 broke\n      this case.\n    + Don't highlight code in headings (#5574).  This causes\n      compilation errors.\n    + Use `\\mbox` to get proper behavior inside `\\sout` (#5529).\n\n  * EPUB writer: Fix document section assignments (#5546).\n    For example, introduction should go in bodymatter, not frontmatter, and\n    epigraph, conclusion, and afterward should go in bodymatter, not\n    backmatter.  For the full list of assignments, see the manual.\n\n  * Markdown writer:\n\n    + Add backslashes to avoid unwanted interpretation of\n      definition list terms as other kinds of block (#554).\n    + Ensure the code fence is long enough (#5519).\n      Previously too few backticks were used when the code block\n      contained an indented line of backticks.  (Ditto tildes.)\n    + Handle labels with integer names (Jesse Rosenthal, #5495).\n      Previously if labels had integer names, it could produce a conflict\n      with auto-labeled reference links. Now we test for a conflict and\n      find the next available integer.  This involves adding a new state\n      variable `stPrevRefs` to keep track of refs used in other document\n      parts when using `--reference-location=block|section`\n\n  * Textile writer: fix closing tag for math output (Albert Krewinkel).\n    Opening and closing tag for math output match now.\n\n  * Org writer: always indent src blocks content by 2 spaces (#5440, Albert\n    Krewinkel).  Emacs always uses two spaces when indenting the content of\n    src blocks, e.g., when exiting a `C-c '` edit-buffer. Pandoc used to\n    indent contents by the space-equivalent of one tab, but now always uses\n    two spaces, too.\n\n  * Asciidoc writer:\n\n    + Use `` `+...+` `` form for inline code.\n      The old `` `a__b__c` `` yields emphasis inside code in asciidoc.\n      To get a pure literal code span, use `` `+a__b__c+` ``.\n    + Use proper smart quotes with asciidoctor (#5487).\n      Asciidoctor has a different format for smart quotes.\n    + Use doubled ## when necessary for spans (#5566).\n    + Ensure correct nesting of strong/emph (#5565): strong\n      must be the outer element.\n\n  * JATS writer:\n\n    + Wrap elements with p when needed (#5570).  The JATS spec restricts\n      what elements can go inside `fn` and `list-item`.  So we wrap other\n      elements inside `<p specific-use=\"wrapper\">` when needed.\n    + Properly handle footnotes (#5511) according to \"best practice.\"\n      (Group them at the end in `<fn-group>` and use `<xref>` elements\n      to link them.)\n    + Fix citations with PMID so they validate (#5481).  This includes\n      an update to data/jats.csl.\n    + Ensure validity of `<pub-date>` by parsing the date and\n      extracting year, month, and day, as expected.  Also add an\n      iso-8601-date attribute automatically.\n    + Don't use `<break>` element for LineBreak. It is only\n      allowed in a few special contexts, and not in `<p>` elements.\n    + Don't make `<string-name>` a child of `<string>`, which is illegal.\n\n  * FB2 writer:\n\n    + Do not wrap note references into `<sup>` and brackets\n      (Alexander Krotov).  Existing FB2 readers, such as FBReader, already\n      display links with type=\"note\" as a superscript.\n    + Use genre metadata field (#5478).\n\n  * Muse writer: do not escape empty line after `<br>` (Alexander Krotov).\n\n  * Add unicode code point in \"Missing character\" warning (#5538).\n    If the character isn't in the console font, the message is pretty useless,\n    so we show the code point for anything non-ASCII.\n\n  * Lua: add Version type to simplify comparisons (Albert Krewinkel).\n    Version specifiers like `PANDOC_VERSION` and `PANDOC_API_VERSION` are\n    turned into `Version` objects. The objects simplify version-appropriate\n    comparisons while maintaining backward-compatibility.\n    A function `pandoc.types.Version` is added as part of the newly\n    introduced module `pandoc.types`, allowing users to create version\n    objects in scripts.\n\n  * pandoc lua module (Albert Krewinkel):\n\n    - Fix deletion of nonexistent attributes (#5569).\n    - Better tests for Attr and AttributeList.\n\n  * pandoc.mediabag lua module (Albert Krewinkel):\n\n    + Add function `delete` for deleting a single item.\n    + Add function `empty` for removing all entries.\n    + Add function `items` for iterating over mediabag.\n\n  * Text.Pandoc.Class: Fix handling of `file:` URL scheme in\n    `downloadOrRead` (#5517, Mauro Bieg).  Previously `file:/`\n    URLs were handled wrongly and pandoc attempted to make HTTP\n    requests, which failed.\n\n  * Text.Pandoc.MIME: add `mediaCategory` [API change] (Mauro Bieg).\n\n  * Text.Pandoc.Shared:\n\n    + Add `onlySimpleTableCells` [API change]\n      (Mauro Bieg) and use this to consolidate simple-table detection\n      (#5524).  This fixes an inconsistency in the HTML reader, which did not\n      treat tables with `<p>` inside cells as simple.\n    + `metaToJSON`: treat digits starting with 0 as a string, not a number\n      (#5479).  This fixes a regression in YAML metadata in pandoc 2.7.2.\n\n  * Text.Pandoc.Logging: Add `IgnoredElement` constructor for\n    `LogMessage`.  `SkippedConetnt` doesn't work for some XML-based\n    readers which don't have access to parsec source positions.\n\n  * Text.Pandoc.Asciify: Add Turkish undotted-i (#5433, Mauro Bieg).\n\n  * Improve output of Lua tests (#5499, Albert Krewinkel).\n    This makes use of tasty-lua, a package to write tests in Lua\n    and integrate the results into Tasty output. Test output becomes\n    more informative: individual tests and test groups become visible\n    in test output. Failures are reported with helpful error messages.\n\n  * Lua: add `pandoc.system` module (#5468, Albert Krewinkel).\n    The `system` Lua module provides utility functions to interact with the\n    operating- and file system. E.g.\n    `print(pandoc.system.get_current_directory())`\n    or\n    ```lua\n        pandoc.system.with_temporary_directory('tikz', function (dir)\n          -- write and compile a TikZ file with pdflatex\n        end)\n    ```\n\n  * LaTeX template: Add pdflang to hypersetup if lang is set (#5443).\n\n  * beamer template: Fix using Beamer with geometry (#5505, Daniel Maslowski).\n    Beamer already loads geometry, so we need to use the `\\geometry`\n    command to set geometry options.\n\n  * EPUB2/3 templates: Move inline styles to default epub.css (#5466).\n    NOTE: Those who use a custom CSS stylesheet with EPUB should\n    add these lines:\n\n        code{ white-space: pre-wrap; }\n        span.smallcaps{ font-variant: small-caps; }\n        span.underline{ text-decoration: underline; }\n        q { quotes: \"“\" \"”\" \"‘\" \"’\"; }\n        div.column{ display: inline-block; vertical-align: top; width: 50%; }\n\n  * reveal.js template:\n\n    + Updates for revealjs 3.8.0 (#5435, ebiim).\n    + Remove reference to head.min.js (#5448, Winnie Hellmann).\n      NOTE: users will need to update reveal.js to at least 3.8.0\n      for their presentations generated with this version of pandoc\n      to work correctly.\n\n  * Text.Pandoc.PDF:\n\n    + Replace `</>` with literal `/` (#5451).\n      We use forward-slash for a directory separator in tmpDir,\n      even on Windows (because that's what tex likes).  So we\n      should not put a backslash between the tmpDir and the\n      filename on Windows.  This is harmless enough in normal\n      Windows setups, but it breaks on Cygwin.\n      Thanks to @cc2x for noticing and diagnosing the problem.\n    + Allow use of `-output-directory` in `--pdf-engine-opt` (#5462).\n      This is currently possible with `mklatex` and `-outdir`, but\n      was not yet possible with xelatex and `-output-directory`.\n    + For PDF via ms/pdfroff, make TOC appear at beginning and in\n      PDF bookmarks (#5553).  Previously the TOC appeared at the end\n      of the document, and was not bookmarked.  To keep it at the end,\n      add `--pdf-engine-opt=--no-toc-relocation` to your command line.\n\n  * Fix broken links in documents (#5473, Shim Myeongseob).\n    Also, use absolute links to pandoc.org when possible, so that\n    the links can be followed by people viewing these documents\n    on GitHub.\n\n  * Improved sample lua tikz filter in lua-filters docs (#5445,\n    Matthew Doty).  There are three changes:\n\n    + It only processes elements which begin with `\\begin{tikzpicture}`\n    + It uses pdf2svg instead of imagemagick to preserve fidelity\n    + The images produced have transparent backgrounds\n\n  * MANUAL.txt:\n\n    + Add note about `title-meta`, `author-meta`, `date-meta` (#5486).\n    + Fix typo (#5489, Christian Krause).\n\n  * add test/tables.xwiki to git and pandoc.cabal (#5498, Mauro Bieg).\n\n  * Disable missing-home-modules warning in `stack.yaml`.\n    Otherwise `stack ghci` fails.\n\n\n## pandoc 2.7.2 (2019-04-05)\n\n  * Add XWiki writer (#1800, Derek Chen-Becker).\n    Add `Text.Pandoc.Writers.XWiki`, exporting `writeXWiki` [API change].\n\n  * Dokuwiki Reader: parse single curly brace (#5416, Mauro Bieg).\n\n  * Vimwiki reader: improve handling of internal links (#5414).\n    We no longer append `.html` to link targets, and we add a title\n    `wikilink`.  This mirrors behavior of other wiki readers.  Generally\n    the `.html` extension is not wanted.  It may be important for output\n    to HTML in certain circumstances, but it can always be added using a\n    filter that matches on links with title `wikilink`.\n\n    If your workflow requires the current behavior, here is a lua filter\n    that will add the `.html` extension:\n\n    ```lua\n    function Link(el)\n      if el.title == 'wikilink' then\n        el.target = el.target .. \".html\"\n      end\n      return el\n    end\n    ```\n  * ipynb reader:\n\n    + Use format `ipynb` for raw cell where no format given.\n    + Avoid introducing spurious `.0` on integers in metadata.\n\n  * Markdown reader: fenced div takes priority over setext header.\n\n  * HTML reader: read `data-foo` attribute into `foo` (#5392).\n    The HTML writer adds the `data-` prefix for HTML5 for nonstandard\n    attributes.  But the attributes are represented in the AST without\n    the `data-` prefix, so we should strip this when reading HTML.\n\n  * LaTeX reader: Improve autolink detection (#5340).\n\n  * PowerPoint writer (Jesse Rosenthal):\n\n    + Expand builtin reference doc to model all layouts.\n      The previous built-in reference doc had only title and content\n      layouts. Add in a section-header slide and a two-content slide, so\n      users can more easily modify it to build their own templates.\n    + Always open up in slide view.  When editing a\n      template/reference-doc, the user might be in Master view, but when\n      producing a slide show, it is assumed that slide view will be\n      desired.\n    + Remove `handoutsMasterList` from template presentation.xml\n    + Fix numerous errors in templating (#5402). Previously, some templates\n      produced by Office 365 (MacOS) would not render with `--reference-doc`\n      correctly. We now apply correct shapes for content, and build\n      shape trees correctly.\n    + Make default placeholder type for template lookup.\n    + Apply speaker notes to metadata slide if applicable.\n    + Test for speaker notes after breaking header.\n    + Correctly handle notes after section-title header.\n      Previously, if notes came after a section-title header (ie, a level-1\n      header in a slide-level=2 presentation), they would go on the next\n      slide. This keeps them on the slide with the header.\n    + Internal improvements.\n\n  * ipynb writer:\n\n    + Use format `ipynb` for raw cell where no format given.\n      According to nbformat docs, this is supposed to render in every\n      format.  We don't do that, but we at least preserve it as a raw\n      block in markdown, so you can round-trip.\n    + Consolidate adjacent raw blocks.  Sometimes pandoc creates two\n      HTML blocks, e.g. one for the open tag and one for a close tag.\n      If these aren't consolidated, only one will show up in output cell.\n    + Fixed carry-over of nbformat from metadata.\n    + Preserve `nbformat_minor` if it's given.  This helps with round-tripping.\n\n  * LaTeX writer:\n\n    + Avoid inadvertently creating ?` or !` ligatures (#5407).\n      These are upside down ? and !, resp.\n    + Fix footnotes in table caption and cells (#5367).  This fixes a\n      bug wherein footnotes appeared in the wrong order, and with\n      duplicate numbers, when in table captions and cells.\n      We now use regular `\\footnote` commands, even in the table\n      caption and the minipages containing cells. Apparently\n      longtable knows how to handle this.\n\n  * HTML writer: Don't add data- prefix to RDFa attributes (#5403).\n\n  * JATS writer: Ensure that plain strings go inside `<pub-id>` tag (#5397).\n\n  * Markdown writer:\n\n    + Better rendering of numbers (#5398).  If the number is integral,\n      we render it as an integral not a float.\n    + Proper rendering of empty map in YAML metadata (#5398).  Should\n      be `{}`, not empty string.\n    + Properly escape attributes in Markdown writer (#5369).\n    + Be sure implicit figures work in list contexts (#5368).\n      Previously they would sometimes not work: e.g., when they\n      occurred in final paragraphs in lists that were originally\n      parsed as Plain and converted later using PlainToPara.\n\n  * Docx writer: Use `w:br` without attributes for line breaks (#5377).\n    We previously added the attribute `type=\"textWrapping\"`, but\n    this causes problems on Word Online.\n\n  * LaTeX template (Andrew Dunning):\n\n    + Ensure correct heading/table order (#5365).  Improve workaround\n      (#1658) for tables following headings.  The new solution works whether\n      or not the `indent` variable is enabled.\n    + Remove `subparagraph` variable. The default is now to use run-in\n      style for level 4 and 5 headings (`\\paragraph` and `\\subparagraph`).\n      To get the previous default behavior (where these were formatted as\n      blocks, like `\\subsubsection`), set the `block-headings` variable.\n    + Add pandoc to PDF metadata (#5388).\n    + Group graphics-related code (#5389).\n    + Move `\\setstretch` after front matter (#5179).  Ensures that\n      `\\maketitle`, `\\tableofcontents`, and so forth are not affected by\n      changes to line spacing.\n\n  * Update data/jats.csl to avoid commas between name-part elements\n    (#5397).\n\n  * Add support for golang (`go`) with `--listings` (#5427).\n\n  * Text.Pandoc.Shared - improve `metaToJSON` behavior with numbers.\n    We now do a better job marshalling numbers from MetaString\n    or MetaInlines into JSON Number.\n\n  * Text.Pandoc.Writers.Shared: `metaValueToJSON`: use Number Values for\n    integers.  Pandoc's MetaValue doesn't have a distinguished number type,\n    so numbers are put in MetaStrings.  If the MetaString consists\n    entirely of digits, we convert it to a Number.  We should probably\n    consider adding a MetaNumber constructor to MetaValue, for better\n    round-tripping with JSON etc.  This change aids round-tripping in\n    ipynb metadata fields, like `toc_depth`.\n\n  * Text.Pandoc.Class: `fetchItem`: don't treat UNC paths as\n    protocol-relative URLs (#5127).  These are paths beginning `//?/UNC/...`.\n\n  * Text.Pandoc.ImageSize: Improve `pdfSize` so it handles\n    a wider range of PDFs (#4322, with help from Richard Davis).\n\n  * Text.Pandoc.Pretty: avoid stack overflow by using strict sum (#5401).\n\n  * Fix harmless error in file-scope code (#5422).\n\n  * MANUAL.txt:\n\n    + Improve 'header' and 'heading' usage (#5423, Andrew\n      Dunning).  The term 'header' was being used where 'heading'\n      is more appropriate.\n    + Add paragraph on options affecting markdown in ipynb.\n\n  * stack.yaml - remove -Wmissing-home-modules\n    This seems to cause problems with stack ghci.  Remove RTS options.\n\n  * Add ghc-options to cabal.project.\n\n  * appveyor.yml - use ghc 8.6.4.  Fixes segfault issues on Windows (#5037).\n\n  * linux build process: Remove clone of pandoc-citeproc (#5366).\n    It wasn't being used; cabal.project specifies the version to use.\n\n## pandoc 2.7.1 (2019-03-14)\n\n  * Add tectonic as an option for --pdf-engine (#5345, Cormac Relf).\n    Runs tectonic on STDIN instead of a temporary .tex file, so that it\n    looks in the working directory for `\\include` and `\\input` like the rest\n    of the engines.  Allows overriding the output directory\n    args with `--pdf-engine-opt=--outdir --pdf-engine-opt=\"$DIR\"`.\n\n  * Allow `-o/--output` to be used with `--print-default-data-file`,\n    `--print-highlighting-style`, `--print-default-template`.\n    Note that `-o` must occur BEFORE the `--print*` command on the command\n    line (this is documented, #5357).\n\n  * LaTeX reader:\n\n    + Support `\\underline`, `\\ul`, `\\uline` (#5359, Paul\n      Tilley).  These are parsed as a Span with class `underline`, as\n      with other readers.\n    + Ensure that `\\Footcite` and `\\Footcites` get put in a note.\n\n  * ipynb reader:\n\n    + Remove sensitivity to `raw_html`, `raw_tex` extensions.\n      We now include every output format. Pruning is handled by\n      `--ipynb-output`.\n    + Better handling of cell metadata.  We now include even complex cell\n      metadata in the Div's attributes (as JSON, in complex cases, or\n      as plain strings in simple cases).\n\n  * ipynb writer:\n\n    + Recurse into native divs for output cell data (#5354).\n    + Render cell metadata fields from div attributes.\n\n  * Docx writer: avoid extra copy of abstractNum and num elements\n    in numbering.xml.  This caused pandoc-produced docx files to\n    be uneditable using Word Online (#5358).\n\n  * Markdown writer: improve handling of raw blocks/inline.\n    We now emit raw content using `raw_attribute` when no more\n    direct method is available.  Use of `raw_attribute` can be\n    forced by disabling `raw_html` and `raw_tex`.\n\n  * LaTeX writer: Add classes for frontmatter support (#5353, Andrew Dunning)\n    and remove frontmatter from `scrreprt`.\n\n  * LaTeX template:\n\n    + Improve readability (#5363, Andrew Dunning).\n    + Robust section numbering removal (#5351, Andrew Dunning).\n      Ensures that section numbering does not reappear with custom\n      section levels.  See <https://tex.stackexchange.com/questions/473653/>.\n    + Better handling of front/main/backmatter (#5348).\n      In pandoc 2.7 we assumed that every class with chapters would accept\n      `\\frontmatter`, `\\mainmatter`, and `\\backmatter`.  This is not so (e.g.\n      report does not).  So pandoc 2.7 breaks on report class by including an\n      unsupported command.  Instead of the `book-class` variable, we use two\n      variables, `has-chapters` and `has-frontmatter`, and set these\n      intelligently in the writer.\n\n  * Text.Pandoc.Shared: Improve `filterIpynbOutput`.  Ensure that\n    images are prioritized over text. `best` should include everything\n    for ipynb.\n\n  * Tests.Old: specify `--data-dir=../data` to ensure tests can find\n    data files even if they haven't been installed.  Remove old\n    `pandoc_datadir` environment variable, which hasn't done anything for a\n    long time.\n\n  * MANUAL.txt: Add recommendation to use `raw_attribute` with ipynb (#5354).\n\n  * Use cmark-gfm-hs 0.1.8 (note that 0.1.7 is buggy).\n\n  * Use latest pandoc-citeproc, texmath.\n\n\n## pandoc 2.7 (2019-03-03)\n\n  * Use XDG data directory for user data directory (#3582). Instead of\n    `$HOME/.pandoc`, the default user data directory is now\n    `$XDG_DATA_HOME/pandoc`, where `XDG_DATA_HOME` defaults to\n    `$HOME/.local/share` but can be overridden by setting the\n    environment variable. If this directory is missing, then\n    `$HOME/.pandoc` is searched instead, for backwards compatibility.\n    However, we recommend moving local pandoc data files from\n    `$HOME/.pandoc` to `$HOME/.local/share/pandoc`. On Windows the\n    default user data directory remains the same.\n\n  * Slide show formats behavior change:  content under headers\n    less than slide level is no longer ignored, but included in\n    the title slide (for HTML slide shows) or in a slide after\n    the title slide (for beamer).  This change makes possible\n    2D reveal.js slideshows with content in the top slide on\n    each stack (#4317, #5237).\n\n  * Add command line option `--ipynb-output=all|none|best` (#5339).\n    Output cells in ipynb notebooks often contain several different\n    versions of an output, with different MIME types, e.g. an HTML\n    table and a plain-text fallback.  Specifying `--ipynb-output=best`\n    (the default) ensures that the best version for the output format\n    is used.  `all` includes all versions, and `none` suppresses them\n    all, leaving output cells empty.\n\n  * `asciidoctor` is now an output format separate from `asciidoc`,\n    to accommodate some minor implementation-specific differences\n    (currently just in the treatment of display math).\n\n  * Add `latexmk` as an option for `--pdf-engine` (#3195).\n    Note that you can use `--pdf-engine-opt=-outdir=bar` to specify\n    a persistent temp directory.\n\n  * Markdown reader:\n\n    + Improve tight/loose list handling (#5285). Previously the\n      algorithm allowed list items with a mix of Para and Plain, which\n      is never wanted.\n    + Add newline when parsing blocks in YAML (#5271). Otherwise last\n      block gets parsed as a Plain rather than a Para. This is a\n      regression in pandoc 2.x. This patch restores pandoc 1.19\n      behavior.\n    + Make `yamlToMeta` respect extensions (#5272, Mauro Bieg).\n      This adds a `ReaderOptions` parameter to `yamlToMeta` [API change].\n    + Fix bug parsing fenced code blocks (#5304). Previously parsing\n      would break if the code block contained a string of backticks of\n      sufficient length followed by something other than end of line.\n\n  * LaTeX reader: don't let `\\egroup` match `{`. `braced` now actually\n    requires nested braces. Otherwise some legitimate command and\n    environment definitions can break.\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Rename `getDocumentPath` as `getDocumentXmlPath`.\n    + Use field notation for setting `ReaderEnv`.\n    + Figure out `document.xml` path once at the beginning of parsing, and\n      add it to the environment, so we can avoid repeated lookups.\n    + Dynamically determine main document xml path (#5277).\n      The desktop Word program places the main document file in\n      `word/document.xml`, but the online word places it in\n      `word/document2.xml`. This file path is actually stated in the root\n      `_rels/.rels` file, in the `Relationship` element with an\n      `http://../officedocument` type.\n    + Fix paths in archive to prevent Windows failure (#5277).\n      Some paths in archives are absolute (have an opening slash) which, for\n      reasons unknown, produces a failure in the test suite on MS\n      Windows. This fixes that by removing the leading slash if it exists.\n    + Add comments to aid code readability.\n    + Trim space inside the last inline (#5273).\n    + Unwrap sdt elements in footnotes and comments (#5302).\n\n  * Muse reader (Alexander Krotov):\n\n    + Test that block level markup does not break `<verbatim>`.\n    + Add secondary note support.\n\n  * ipynb reader: handle images referring to attachments. Previously\n    we didn't strip off the attachment: prefix, so even though the\n    attachment was available in the mediabag, pandoc couldn't find it.\n\n  * JATS reader:\n\n    + Fix parsing of figures (#5321). This ensures that a figure\n      containing a single image is parsed as a pandoc \"implicit\n      figure\" (i.e., a Para with a single Image whose title attribute\n      begins with `fig:`). More complex figures will still be parsed\n      as divs.\n    + Support `fig-group` block element (#5317).\n    + Handle citations with multiple references (#5310). The `rid`\n      attribute can have a space-separated list of ids.\n\n  * AsciiDoc Writer: Add `writeAsciiDoctor` [API change, Tarik Graba].\n    Handle display math appropriately for Asciidoctor.\n\n  * JATS writer: wrap figure caption in `<p>` to fix validation (#5290,\n    Mauro Bieg).\n\n  * HTML writer:\n\n    + Implement WAI-ARIA roles for (end)notes, citations, and\n      bibliography (#4213). Note that doc-biblioref is only used when\n      link-citations produces links, since it belongs on links.\n    + Include content (including speaker notes) in title slides\n      (#4317, #5237).\n\n  * ipynb writer:\n\n    + Ensure final newline.\n    + Only include metadata under `jupyter` field.\n    + Don't create attachments for images with absolute URIs,\n      including data: URIs (#5303).\n    + Keep plain text fallbacks in output even if a richer format is\n      included (#5293). We don't know what output format will be needed.\n      See the `--ipynb-output` command line option for a way to control\n      what formats are included in the output.\n\n  * Markdown writer: use `markdown=\"1\"` when appropriate for Divs:\n    when `native_divs` and `markdown_in_html_blocks` are disabled\n    but `raw_html` and `markdown_attribute` are enabled.\n\n  * LaTeX writer:\n\n    + Use right fold for `escapeString`.  This is more elegant than\n      the explicit recursive code we were using.\n    + Avoid `{}` after control sequences when escaping.\n      `\\ldots{}.` doesn't behave as well as `\\ldots.` with the latex\n      ellipsis package.  This patch causes pandoc to avoid emitting\n      the `{}` when it is not necessary.  Now `\\ldots` and other\n      control sequences used in escaping will be followed by either\n      a `{}`, a space, or nothing, depending on context.\n    + For beamer, include contents under headers superordinate to\n      slidelevel (#4317). Currently we keep the fancy title slide, and\n      add a new slide with the same title and whatever content was\n      under the header.\n\n  * Powerpoint writer (Jesse Rosenthal): support underlines.\n    Use span with single class \"underline\" as in docx writer.\n\n  * Muse writer: escape secondary notes (Alexander Krotov).\n\n  * FB2 writer: add section identifiers support (#5229, John KetzerX).\n\n  * Make `--fail-if-warnings` work for PDF output (#5343).\n\n  * Lua filters (Albert Krewinkel):\n\n    + Load module `pandoc` before calling `init.lua` (#5287). The file\n      `init.lua` in pandoc's data directory is run as part of pandoc's\n      Lua initialization process. Previously, the `pandoc` module was\n      loaded in `init.lua`, and the structure for marshaling was\n      set up after. This allowed simple patching of element\n      marshaling, but made using `init.lua` more difficult. Now, all\n      required modules are now loaded before calling `init.lua`. The\n      file can be used entirely for user customization. Patching\n      marshaling functions, while discouraged, is still possible via\n      the `debug` module.\n    + All Lua modules bundled with pandoc, i.e., `pandoc.List`,\n      `pandoc.mediabag`, `pandoc.utils`, and `text` are re-exported from the\n      `pandoc` module. They are assigned to the fields `List`, `mediabag`,\n      `utils`, and `text`, respectively.\n\n  * Text.Pandoc.Lua (Albert Krewinkel):\n\n    + Split `StackInstances` into smaller Marshaling modules.\n    + Get `CommonState` from Lua global. This allows more control over\n      the common state from within Lua scripts.\n\n  * LaTeX template:\n\n    + Support the `subject` metadata variable (#5289, Pascal Wagler).\n    + Add `\\frontmatter`, `\\mainmatter`, `\\backmatter`\n      for book classes (#5306).\n\n  * epub3 template: Add titlepage class to section (#5269).\n\n  * HTML5 template: Add ARIA role `doc-toc` for table of contents (#4213).\n\n  * Make `--metadata-file` use selected extensions (#5279, #5272, Mauro Bieg).\n\n  * Text.Pandoc.Shared:\n\n    + Remove `withTempDir` [API change].\n    + Add new exported function `defaultUserDataDirs` [API change].\n    + Add `filterIpynbOutput` [API change].\n    + `compactify`: Avoid lists with a mix of Plain and Para elements\n      (#5285).\n\n  * Text.Pandoc.Translations: reorder alphabetically and remove `Author`\n    (#5334, Mauro Bieg).\n\n  * Text.Pandoc.Extensions:\n\n    + More carefully groom ipynb default extensions.\n    + Add `all_symbols_escapable` to `githubMarkdownExtensions`.\n\n  * Text.Pandoc.PDF:\n\n    + Use system temp directory when possible (#1192). Previously we\n      created temp dirs in the working directory, partly (a) because\n      there were problems using the system temp directory on Windows,\n      when their pathnames included tildes, and partly (b) because\n      programs like `epstopdf.pl` would not be allowed to write to\n      directories outside the working directory in restricted mode. We\n      now (a) use the system temp dir except when the path includes\n      tildes, and (b) set `TEXMFOUTPUT` when creating the PDF, so that\n      subsidiary programs can use the system temp directory. This\n      addresses problems that occurred when pandoc was used in a\n      synced directory (such as Dropbox).\n    + Change types of subsidiary functions to PandocIO, to allow\n      warnings to be threaded through (#5343).\n\n  * Text.Pandoc.MIME: add WebP (#5267, Mauro Bieg).\n\n  * Tests: avoid calling `findPandoc` multiple times.\n\n  * Old tests: remove need for temp files by using `pipeProcess`.\n\n  * Added simple ipynb reader/writer tests (#5274).\n\n  * Rearrange `--help` output in a more rational way, with common\n    options at the beginning and options grouped by function (#5336).\n\n  * trypandoc: Add JATS and other missing formats (Arfon Smith, #5291).\n\n  * Add missing copyright notices and remove license boilerplate (#4592,\n    Albert Krewinkel).\n\n  * Use latest basement/foundation on 32bit windows.\n\n  * Use latest skylighting (#5328). Custom syntax definitions no\n    longer try to load `language.dtd`.\n\n  * Require texmath 0.11.2.1\n\n  * Use latest pandoc-citeproc (0.16.1.1).\n\n  * MANUAL.txt:\n\n    + Clarify variable substitution indentation in templates (#5338,\n      Agustín Martín Barbero).\n    + Reorder custom-styles section (#5324, Mauro Bieg).\n\n## pandoc 2.6 (2019-01-30)\n\n  * Support ipynb (Jupyter notebook) as input and output format.\n\n    + Add `ipynb` as input and output format (extension `.ipynb`).\n    + Added Text.Pandoc.Readers.Ipynb [API change].\n    + Added Text.Pandoc.Writers.Ipynb [API change].\n    + Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error\n      [API change].\n    + Depend on ipynb library.\n    + Note: there is no template for ipynb.\n\n  * Add DokuWiki reader (#1792, Alexander Krotov).  This adds\n    Text.Pandoc.Readers.DokuWiki [API change], and adds `dokuwiki`\n    as an input format.\n\n  * Implement task lists (#3051, Mauro Bieg). Added `task_lists`\n    extension. Task lists are supported from markdown and gfm input.\n    They should work, to some degree, in all output formats, though in\n    most formats you'll get a bullet list with a unicode character for\n    the box. In HTML, you get checkboxes and in LaTeX/PDF output, a\n    box is used as the list marker. API changes:\n\n    + Added constructor `Ext_task_lists` to `Extension`.\n    + Added `taskListItemFromAscii` and `taskListItemToAscii` to\n      Text.Pandoc.Shared.\n\n  * Allow some command line options to take URL in addition to FILE.\n    `--include-in-header`, `--include-before-body`, `--include-after-body`.\n\n  * HTML reader:\n\n    + Handle empty `start` attribute (see #5162).\n    + Treat `textarea` as a verbatim environment (#5241) and preserve\n      spacing.\n\n  * RST reader:\n\n    + Change treatment of `number-lines` directive (Brian Leung,\n      #5207). Directives of this type without numeric inputs should\n      not have a `startFrom` attribute; with a blank value, the\n      writers can produce extra whitespace.\n    + Removed superfluous `sourceCode` class on code blocks (#5047).\n    + Handle `sourcecode` directive as synonym for `code` (#5204).\n\n  * Markdown reader:\n\n    + Remove `sourceCode` class for literate Haskell code blocks\n      (#5047). Reverse order of `literate` and `haskell` classes on\n      code blocks when parsing literate Haskell, so `haskell` is\n      first.\n    + Treat `<textarea>` as a verbatim environment (#5241).\n\n  * Org reader:\n\n    + Handle `minlevel` option differently (#5190, Brian Leung).\n      When `minlevel` exceeds the original minimum level observed in\n      the file to be included, every heading should be shifted\n      rightward.\n    + Allow for case of `:minlevel == 0` (#5190).\n    + Fix treatment of links to images (#5191, Albert Krewinkel).\n      Links with descriptions which are pointing to images are no\n      longer parsed as inline images, but as links.\n    + Add support for #+SELECT_TAGS (Brian Leung).\n    + Separate filtering logic from conversion function (Brian Leung).\n\n  * TWiki reader: Fix performance issue with underscores (#3921).\n\n  * MediaWiki reader: use `_` instead of `-` in auto-identifiers (#4731).\n    We may not still be exactly matching mediawiki's algorithm.\n\n  * LaTeX reader:\n\n    + Remove `sourceCode` class for literate Haskell code blocks\n      (#5047). Reverse order of `literate` and `haskell` classes on\n      code blocks when parsing literate Haskell, so `haskell` is\n      first.\n    + Support `\\DeclareMathOperator` (#5149).\n    + Support `\\inputminted` (#5103).\n    + Support `\\endinput` (#5233).\n    + Allow includes with dots like `cc_by_4.0`.  Previously the `.0`\n      was interpreted as a file extension, leading pandoc not to add\n      `.tex` (and thus not to find the file).  The new behavior matches\n      tex more closely.\n\n  * Man reader:\n\n    + Use `mapLeft` from Shared instead of defining own.\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Handle level overrides (#5134).\n\n  * Docx writer:\n\n    + Support custom properties (#3024, #5252, Agustín Martín Barbero).\n      Also supports additional core properties:  `subject`, `lang`,\n      `category`, `description`.\n    + Make Level into a real type, instead of an alias for a tuple\n      (Jesse Rosenthal).\n\n  * ICML writer (Mauro Bieg):\n\n    + Support custom-styles (#5137, see #2106).\n    + Support unnumbered headers (#5140).\n\n  * Texinfo writer: Use header identifier for anchor if present (#4731).\n    Previously we were overwriting an existing identifier with a new one.\n\n  * Org writer: Preserve line-numbering for example and code blocks\n    (Brian Leung).\n\n  * Man/Ms writers: Don't escape `-` as `\\-`. The `\\-` gets rendered\n    in HTML and PDF as a unicode minus sign.\n\n  * Ms writer: Ensure we have a newline after .EN in display math (#5251).\n\n  * RST writer: Don't wrap simple table header lines (#5128).\n\n  * Asciidoc writer: Shorter delimiters for tables, blockquotes\n    (#4364). This matches asciidoctor reference docs.\n\n  * Dokuwiki writer: Remove automatic `:` prefix before internal image\n    links (#5183, Damien Clochard).  This prevented users from making\n    relative image links.\n\n *  Zimwiki writer: remove automatic colon prefix before internal\n    images (#5183, Damien Clochard).\n\n  * MediaWiki writer: fix caption, use 'thumb' instead of 'frame'\n    (#5105). Captions used to have the word 'caption' prepended; this\n    has been removed. Also, 'thumb' is used instead of 'frame' to\n    allow images to be resized.\n\n  * reveal.js writer:\n\n    + Ensure that we don't get > 2 levels of section nesting,\n      even with slide level > 2 (#5168).\n    + If slide level == N but there is no N-level header, make\n      sure the next header with level > N gets treated as a slide\n      and put in a section, rather than remaining loose (#5168).\n\n  * Markdown writer:\n\n    + Make `plain` RawBlocks pass through in `plain` output.\n    + Include needed whitespace after HTML figure (#5121).\n      We use HTML for a figure in markdown dialects that can't\n      represent it natively.\n\n  * Commonmark writer:\n\n    + Fix handling of SoftBreak with `hard_line_breaks` (#5195).\n    + Implement `--toc` (`writerTableOfContents`)\n      in commonmark/gfm writers (#5172).\n\n  * EPUB writer:\n\n    + Ensure that picture transforms are done on metadata too.\n    + Small fixes to `nav.xhtml`:\n      Add 'landmarks' id attribute to the landmarks nav.\n      Replace old default CSS removing numbers from ol.toc li\n      with new rules that match `nav#toc ol, nav#landmarks ol`.\n      We keep the `toc` class on `ol` for backwards compatibility.\n\n  * LaTeX writer:\n\n    + Make raw content marked `beamer` pass through in `beamer`\n      output (pandoc/lua-filters#40).\n    + Beamer: avoid duplicated `fragile` property in some cases\n      (#5208).\n    + Add `#` special characters for listings (#4939).\n      This character needs special handling in `\\lstinline`.\n\n *  RTF writer: use `toTableOfContents` from Shared to replace\n    old duplicated code.\n\n  * Pptx writer:\n\n    + Support custom properties.  Also supports additional core\n      properties: `subject`, `category`, `description` (#5252,\n      Agustín Martín Barbero).\n    + Use `toTableOfContents` from Shared to replace old duplicated code.\n\n  * ODT writer (Augustín Martín Barbero):\n\n    + Fix typo in custom properties (#2839).\n    + Improve standard properties, including the following core\n      properties: `generator` (Pandoc/VERSION), `description`, `subject`,\n      `keywords`, `initial-creator` (from authors), `creation-date`\n      (actual creation date) (#5252).\n\n  * Custom writers:\n\n    + Allow '-' in filenames for custom lua writers (#5187).\n    + sample.lua: add `SingleQuoted`, `DoubleQuoted` (#5104).\n    + sample.lua: Add a missing `>` (MichaWiedenmann).\n\n  * reveal.js template:  Add `zoomKey` config (#4249).\n\n  * HTML5 template: Remove unnecessary type=\"text/css\" on style and\n    link for HTML5 (#5146).\n\n  * LaTeX template (Andrew Dunning, except where noted):\n\n    + Prevent fontspec from scaling `mainfont` to match the default\n      font, Latin Modern. A main font set to 12pt could\n      previously appear between 11pt to 13pt depending on its design.\n      To return to the earlier rendering, use `-V\n      mainfontoptions=\"Scale=MatchLowercase\"` (#5212, #5218).\n    + Display monospaced fonts without TeX ligatures when using\n      `--pdf-engine=lualatex`. It now matches the behaviour of other\n      engines (#5212, #5218).\n    + Remove the deprecated `romanfont` variable. The functionality of\n      `mainfont` is identical (#5218).\n    + Render `\\subtitle` with the standard document classes.\n      Previously, `subtitle` only appeared when using the KOMA-Script\n      classes or Beamer (#5213, #5244).\n    + Use Babel instead of Polyglossia for LuaLaTeX. This avoids\n      several language selection problems, notably with retaining\n      French spacing conventions when switching to a verbatim\n      environment or another language; and in printing Greek text\n      without hyphenation (#5193).\n    + Use the [`xurl`](https://ctan.org/pkg/xurl) package if\n      available, improving the appearance of URLs by allowing them to\n      break at additional points (#5193).\n    + Use [`bookmark`](https://ctan.org/pkg/bookmark) if available\n      to correct heading levels in PDF bookmarks: see the [KOMA-Script\n      3.26 release notes](https://komascript.de/release3.26) (#5193).\n    + Require the [`xcolor`](https://ctan.org/pkg/xcolor) package to\n      avoid a possible error when using additional packages alongside\n      footnotes in tables (#5193, closes #4861).\n    + Remove obsolete `fixltx2e` package, which has no functionality\n      with TeX Live 2015 or later (#5193).\n    + Allow multiple `fontfamilies.options` (#5193, closes #5194).\n    + Restrict `institute` variable to Beamer (#5219).\n    + Use [`footnotehyper`](https://ctan.org/pkg/footnotehyper)\n      package if available to make footnotes in tables compatible\n      with `hyperref` (#5234).\n    + Number parts and chapters in book classes only if the\n      `numbersections` variable is set, for consistency with other\n      output formats. To return to the previous behaviour, use\n      `-V numbersections -V secnumdepth=0` (#5235).\n    + Reindent file (#5193).\n    + Use built-in parskip handling with KOMA-Script classes (#5143, Enno).\n    + Set default listings language for lua, assembler (#5227, John\n      MacFarlane).  Otherwise we get an error when trying to compile code\n      with lua or assembler code.  To change the default dialect\n      (currently 5.3 for lua and x86masm for assembler), you can use\n      `--include-in-header` to inject something like\n      `\\lstset{defaultdialect=[5.2]Lua}`.\n\n  * Text.Pandoc.Readers: Changed types of `readJSON`; it now runs\n    in an instance of PandocMonad, like the other readers and\n    writers.  [API change]\n\n  * Text.Pandoc.Writers: Changed types of `writeJSON`; it now runs\n    in an instance of PandocMonad, like the other readers and\n    writers.  [API change]\n\n  * Text.Pandoc.Error: Added `PandocUTF8DecodingError` constructor\n    for `PandocError`. [API change]\n\n  * Text.Pandoc.Writers.Shared - add `toTableOfContents`. [API change]\n    This is refactored out from the Markdown writer.\n    It can be used in other writers to create a table of contents.\n\n  * Improve error messages for UTF-8 decoding errors. Now we give\n    the filename and byte offset (#4765).\n\n  * Text.Pandoc.XML: Strip out illegal XML characters in\n    `escapeXMLString` (#5119).\n\n  * Text.Pandoc.Process: update `pipeProcess` (Albert Krewinkel).\n    The implementation of `pipeProcess` was rewritten to fix sporadic\n    failures caused by prematurely closed pipes.\n\n  * Use `safeRead` instead of `read` everywhere in the code\n    (John MacFarlane, Mauro Bieg, #5162, #5180).\n\n  * Text.Pandoc.SelfContained: Decompress `.svgz` when\n    converting to `data:` URI (#5163, Alexander Krotov).\n\n  * Text.Pandoc.Parsing: Remove unused `HasHeaderMap`\n    (#5175, Alexander Krotov). [API change]\n\n  * Normalize Windows paths to account for change in ghc 8.6 (#5127).\n    When pandoc is compiled with ghc 8.6, Windows paths are treated\n    differently, and paths beginning `\\\\server` no longer work.\n    This commit rewrites such patsh to `\\\\?\\UNC\\server` which works.\n    The change operates at the level of argument parsing, so it\n    only affects the command line program.\n\n  * Simplify/fix reading of `--metadata` values on command line\n    to avoid problems relating to hvr/HsYAML#7 (#5177).\n\n  * data/pandoc.lua: auto-fix nested constructor arguments (Albert\n    Krewinkel).  Incorrect types to pandoc element constructors are\n    automatically converted to the correct types when possible. This was\n    already done for most constructors, but conversions are now also done\n    for nested types (like lists of lists).\n\n  * Removed custom Setup.hs, use build-type: simple. The only thing we\n    gained from the custom build was automatic installation of the man\n    page when using 'cabal install'. But custom builds cause problems,\n    e.g., with cross-compilation. Installation of the man page is\n    better handled by packagers. Note to packagers (e.g. Debian): it\n    may be necessary to add a step installing the man page with the\n    next release.\n\n  * Allow latest http-client, tasty, zip-archive, Glob.\n\n  * Require skylighting >= 0.7.5, adding support for sml, J,\n    typescript.\n\n   * Tests:  Cleaned up `findPandoc` in `Tests.Helpers`, so it\n     works well with cabal v2.\n\n  * INSTALL.md:\n\n    + Use button for installer links (John MacFarlane, Mauro Bieg,\n      #5167).\n    + Fix links and bump required stack version (max).\n    + Improve installation notes on associated software (Andrew\n      Dunning). Includes explanation of how to install related tools\n      with package managers (since the method of installing\n      `rsvg-convert` is not obvious).\n\n  * doc/org.md: improve documentation of org features (Albert\n    Krewinkel).\n\n  * doc/lua-filters.md:  use 3rd level headers for module fields.\n\n  * MANUAL:\n\n    + Clarify automatic identifiers (#5201). We remove\n      non-alphanumerics. This includes, e.g., emojis.\n    + Fix example for Div with id (Geoffrey Ely).\n    + Update list of LaTeX packages used.\n    + Make it clear that `hard_line_breaks` works in `gfm` (see #5195).\n    + Mention `raw_attribute` in documentation for `raw_html` and\n      `raw_tex` (#5240, thanks to @eiro).\n    + Clarify that `$sep$` must come right before `$endfor$` in templates\n      (#5243, Lev Givon).\n    + Document metadata support for docx, odt, pptx writers (Agustín\n      Martín Barbero).\n    + Reorganize template variables (#5249, Andrew Dunning).\n      Add additional headings to categorize variables, and\n      alphabetize when there is large number; add more examples.\n    + Document `date-meta` template variable (#5260, Tristan Stenner).\n\n  * trypandoc: Fix CSS and viewport.\n\n## pandoc 2.5 (2018-11-27)\n\n  * Text.Pandoc.App: split into several unexported submodules (Albert\n    Krewinkel):  Text.Pandoc.App.FormatHeuristics,\n    Text.Pandoc.App.Opt, Text.Pandoc.App.CommandLineOptions,\n    Text.Pandoc.App.OutputSettings.  This is motivated partly by the\n    desire to reduce recompilations when something is modified,\n    since App previously depended on virtually every other module.\n\n  * Text.Pandoc.Extensions\n\n    + Semantically, `gfm_auto_identifiers` is now a modifier of\n      `auto_identifiers`; for identifiers to be set, `auto_identifiers` must\n      be turned on, and then the type of identifier produced depends on\n      `gfm_auto_identifiers` and `ascii_identifiers` are set. Accordingly,\n      `auto_identifiers` is now added to `githubMarkdownExtensions` (#5057).\n    + Remove `ascii_identifiers` from `githubMarkdownExtensions`.\n      GitHub doesn't seem to strip non-ascii characters any more.\n\n  * Text.Pandoc.Lua.Module.Utils (Albert Krewinkel)\n\n    + Test AST object equality via Haskell (#5092).  Equality of Lua\n      objects representing pandoc AST elements is tested by unmarshalling\n      the objects and comparing the result in Haskell.\n      A new function `equals` which performs this test has been added to the\n      `pandoc.utils` module.\n    + Improve stringify.  Meta value strings (MetaString)\n      and booleans (MetaBool) are now converted to the literal string and the\n      lowercase boolean name, respectively. Previously, all values of these\n      types were converted to the empty string.\n\n  * Text.Pandoc.Parsing: Remove Functor and Applicative constraints where Monad\n    already exists (Alexander Krotov).\n\n  * Text.Pandoc.Pretty: Don't render BreakingSpace at end of line\n    or beginning of line (#5050).\n\n  * Text.Pandoc.Readers.Markdown\n\n    + Fix parsing of citations, quotes, and underline emphasis\n      after symbols.  Starting with pandoc 2.4, citations, quoted inlines,\n      and underline emphasis were no longer recognized after certain\n      symbols, like parentheses (#5099, #5053).\n    + In pandoc 2.4, a soft break after an abbreviation would be\n      relocated before it to allow for insertion of a nonbreaking\n      space after the abbreviation. This behavior is here reverted.\n      A soft break after an abbreviation will remain, and no nonbreaking\n      space will be added. Those who care about this issue should take care not\n      to end lines with an abbreviation, or to insert nonbreaking spaces\n      manually.\n\n  * Text.Pandoc.Readers.FB2: Do not throw error for unknown elements in\n    `<body>` (Alexander Krotov).  Some libraries include custom elements\n    in their FB2 files.\n\n  * Text.Pandoc.Readers.HTML\n\n    + Allow `tfoot` before body rows (#5079).\n    + Parse `<small>` as a Span with class \"small\" (#5080).\n    + Allow thead containing a row with `td` rather than `th` (#5014).\n\n  * Text.Pandoc.Readers.LaTeX\n\n    + Cleaned up handling of dimension arguments.  Allow decimal points,\n      preceding space.\n    + Don't allow arguments for verbatim, etc.\n    + Allow space before bracketed options.\n    + Allow optional arguments after `\\\\` in tables.\n    + Improve parsing of `\\tiny`, `\\scriptsize`, etc.  Parse as raw,\n      but know that these font changing commands take no arguments.\n\n  * Text.Pandoc.Readers.Muse\n\n    + Trim whitespace before parsing grid table cells (Alexander Krotov).\n    + Add grid tables support (Alexander Krotov).\n\n  * Text.Pandoc.Shared\n\n    + For bibliography match Div with id `refs`, not class `references`.\n      This was a mismatch between pandoc's docx, epub, latex, and markdown\n      writers and the behavior of pandoc-citeproc, which actually looks for a\n      div with id `refs` rather than one with class `references`.\n    + Exactly match GitHub's identifier generating algorithm (#5057).\n    + Add parameter for `Extensions` to `uniqueIdent` and\n      `inlineListToIdentifier` (#5057).  [API change]\n      This allows these functions to be sensitive to the settings of\n      `Ext_gfm_auto_identifiers` and `Ext_ascii_identifiers`, and allows us to\n      use `uniqueIdent` in the CommonMark reader, replacing custom code.  It\n      also means that `gfm_auto_identifiers` can now be used in all formats.\n\n  * Text.Pandoc.Writers.AsciiDoc\n\n    + Use `.`+ as list markers to support nested ordered lists (#5087).\n    + Support list number styles (#5089).\n    + Render Spans using `[#id .class]#contents#` (#5080).\n\n  * Text.Pandoc.Writers.CommonMark\n\n    + Respect `--ascii` (#5043, quasicomputational).\n    + Make sure `--ascii` affects quotes, super/subscript.\n\n  * Text.Pandoc.Writers.Docx\n\n    + Fix bookmarks to headers with long titles (#5091).\n      Word has a 40 character limit for bookmark names.  In addition, bookmarks\n      must begin with a letter.  Since pandoc's auto-generated identifiers may\n      not respect these constraints, some internal links did not work.  With\n      this change, pandoc uses a bookmark name based on the SHA1 hash of the\n      identifier when the identifier isn't a legal bookmark name.\n    + Add bookmarks to code blocks (Nikolay Yakimov).\n    + Add bookmarks to images (Nikolay Yakimov).\n    + Refactor common bookmark creation code into a function (Nikolay Yakimov).\n\n  * Text.Pandoc.Writers.EPUB: Handle calibre metadata (#5098).\n    Nodes of the form\n\n          <meta name=\"calibre:series\" content=\"Classics on War and Politics\"/>\n\n      are now included from an epub XML metadata file.  You can also include\n      this information in your YAML metadata, like so:\n\n          calibre:\n           series: Classics on War and Policitics\n\n      In addition, ibooks-specific metadata can now be included via an XML\n      file. (Previously, it could only be included via YAML metadata, see\n      #2693.)\n\n  * Text.Pandoc.Writers.HTML: Use plain `\"` instead of `&quot;` outside of\n    attributes.\n\n  * Text.Pandoc.Writers.ICML: Consolidate adjacent strings, inc. spaces.\n    This avoids splitting up the output unnecessarily into separate elements.\n\n  * Text.Pandoc.Writers.LaTeX: Don't emit `[<+->]` unless beamer output, even\n    if `writerIncremental` is True (#5072).\n\n  * Text.Pandoc.Writers.Muse (Alexander Krotov).\n\n    + Output tables as grid tables if they have multi-line cells.\n    + Indent simple tables only on the top level.\n    + Output tables with one column as grid tables.\n    + Add support for `--reference-location`.\n    + Internal improvements.\n\n  * Text.Pandoc.Writers.OpenDocument: Fix list indentation (Nils Carlson,\n    #5095).  This was a regression in pandoc 2.4.\n\n  * Text.Pandoc.Writers.RTF: Fix warnings for skipped raw inlines.\n\n  * Text.Pandoc.Writers.Texinfo: Add blank line before `@menu` section (#5055).\n\n  * Text.Pandoc.XML: in `toHtml5Entities`, prefer shorter entities\n    when there are several choices for a particular character.\n\n  * data/abbreviations\n\n    + Add additional abbreviations (Andrew Dunning)\n      Many of these borrowed from the Chicago Manual of Style 10.42,\n      'Scholarly abbreviations'.\n\n  * Templates\n\n    + Asciidoc template:  add :lang: to title header is lang is set in\n      metadata (#5088).\n\n  * pandoc.cabal: Add cabal flag `derive_json_via_th` (Albert Krewinkel)\n    Disabling the flag will cause derivation of ToJSON and FromJSON\n    instances via GHC Generics instead of Template Haskell. The flag is\n    enabled by default, as deriving via Generics can be slow (see #4083).\n\n  * trypandoc:\n\n    + Tweaked drop-down lists.\n    + Put link to site in footer.\n    + Preselect output format.\n    + Update on change of in or out format.\n    + Add man input format.\n\n  * MANUAL.txt:\n\n    + Fix outdated description of latex_macros extension.\n    + Clarified placement of bibliography.\n    + Added \"A note on security.\"\n    + Fix note on curly brace syntx for locators.\n    + Document new explicit syntax for citeproc locators.\n    + Remove confusing cross-links for some extensions.\n    + Don't put pandoc in code ticks in heading.\n    + Document that `--ascii` works for gfm and commonmark too.\n    + Add `man` to `--from` options.\n\n  * doc/customizing-pandoc.md: various improvements (Mauro Bieg).\n\n\n## pandoc 2.4 (2018-11-03)\n\n### New features\n\n  * New input format `man` (Yan Pashkovsky, John MacFarlane).\n\n### Behavior changes\n\n  * `--ascii` is now implemented in the writers, not in Text.Pandoc.App,\n    via the new `writerPreferAscii` field in `WriterOptions`.\n    Now the `write*` functions for Docbook, HTML, ICML, JATS, LaTeX,\n    Ms, Markdown, and OPML are sensitive to `writerPreferAscii`.\n    Previously the to-ascii translation was done in Text.Pandoc.App,\n    and thus not available to those using the writer functions\n    directly.\n\n  * `--ascii` now works with Markdown output.  HTML5 character reference\n    entities are used.\n\n  * `--ascii` now works with LaTeX output. 100% ASCII output can't be\n    guaranteed, but the writer will use commands like `\\\"{a}` and `\\l`\n    whenever possible, to avoid emitting a non-ASCII character.\n\n  * For HTML5 output, `--ascii` now uses HTML5 character reference\n    entities rather than numerical entities.\n\n  * Improved detection of format based on extension (in Text.Pandoc.App).\n    We now ensure that if someone tries to convert a file for a\n    format that has a pandoc writer but not a reader, it won't just\n    default to markdown.\n\n  * Add viz. to abbreviations file (#5007, Nick Fleisher).\n\n  * AsciiDoc writer:  always use single-line section headers,\n    instead of the old underline style (#5038).  Previously the single-line\n    style would be used if `--atx-headers` was specified, but\n    now it is always used.\n\n  * RST writer: Use simple tables when possible (#4750).\n\n  * CommonMark (and gfm) writer: Add plain text fallbacks. (#4528,\n    quasicomputational). Previously, the writer would unconditionally\n    emit HTML output for subscripts, superscripts, strikeouts (if the\n    strikeout extension is disabled) and small caps, even with\n    `raw_html` disabled. Now there are plain-text (and, where\n    possible, fancy Unicode) fallbacks for all of these corresponding\n    (mostly) to the Markdown fallbacks, and the HTML output is only\n    used when `raw_html` is enabled.\n\n  * Powerpoint writer: support raw openxml (Jesse Rosenthal, #4976).\n    This allows raw openxml blocks and inlines to be used in the pptx\n    writer. Caveats: (1) It's up to the user to write\n    well-formed openxml. The chances for corruption, especially with\n    such a brittle format as pptx, is high. (2) Because of\n    the tricky way that blocks map onto shapes, if you are using\n    a raw block, it should be the only block on a slide\n    (otherwise other text might end up overlapping it). (3) The\n    pptx ooxml namespace abbreviations are different from the\n    docx ooxml namespaces. Again, it's up to the user to get it\n    right. Unzipped document and ooxml specification should be\n    consulted.\n\n  * With `--katex` in HTML formats, do not use the autorenderer (#4946).\n    We no longer surround formulas with `\\(..\\)` or `\\[..\\]`. Instead,\n    we tell katex to convert the contents of span elements with\n    class \"math\". Since math has already been identified, this\n    avoids wasted time parsing for LaTeX delimiters. Note, however,\n    that this may yield unexpected results if you have span elements\n    with class \"math\" that don't contain LaTeX math.\n    Also, use latest version of KaTeX by default (0.9.0).\n\n  * The man writer now produces ASCII-only output, using groff escapes,\n    for portability.\n\n  * ODT writer:\n\n    + Add title, author and date to metadata; any remaining\n      metadata fields are added as `meta:user-defined` tags.\n    + Implement table caption numbering (#4949, Nils Carlson).\n      Captioned tables are numbered and labeled with format \"Table 1:\n      caption\", where \"Table\" is replaced by a translation, depending\n      on the value of `lang` in metadata. Uncaptioned tables are not\n      enumerated.\n    + OpenDocument writer: Implement figure numbering in captions (#4944,\n      Nils Carlson). Figure captions are now numbered 1, 2, 3, ...\n      The format in the caption is \"Figure 1: caption\" and so on\n      (where \"Figure\" is replaced by a translation, depending on the\n      value of `lang` in the metadata). Captioned figures are numbered\n      consecutively and uncaptioned figures are not enumerated. This\n      is necessary in order for LibreOffice to generate an\n      Illustration Index (Table of Figures) for included figures.\n\n  * RST reader: Pass through fields in unknown directives as div attributes\n    (#4715). Support `class` and `name` attributes for all directives.\n\n  * Org reader: Add partial support for `#+EXCLUDE_TAGS` option. (#4284,\n    Brian Leung). Headers with the corresponding tags should not\n    appear in the output.\n\n  * Log warnings about missing title attributes now include a\n    suggestion about how to fix the problem (#4909).\n\n  * Lua filter changes (Albert Krewinkel):\n\n    + Report traceback when an error occurs. A proper Lua traceback is\n      added if either loading of a file or execution of a filter\n      function fails. This should be of help to authors of Lua filters\n      who need to debug their code.\n\n    + Allow access to pandoc state (#5015). Lua filters and custom\n      writers now have read-only access to most fields of pandoc's\n      internal state via the global variable `PANDOC_STATE`.\n\n    + Push ListAttributes via constructor (Albert Krewinkel).\n      This ensures that ListAttributes, as present in OrderedList elements,\n      have additional accessors (viz. `start`, `style`, and `delimiter`).\n\n    + Rename ReaderOptions fields, use snake_case. Snake case is used\n      in most variable names, using camelCase for these fields was an\n      oversight. A metatable is added to ensure that the old field\n      names remain functional.\n\n    + Iterate over AST element fields when using `pairs`. This makes\n      it possible to iterate over all ield names of an AST element by\n      using a generic `for` loop with pairs`:\n\n          for field_name, field_content in pairs(element) do\n          ...\n          end\n\n      Raw table fields of AST elements should be considered an\n      implementation detail and might change in the future. Accessing\n      element properties should always happen through the fields\n      listed in the Lua filter docs.\n\n      Note that the iterator currently excludes the `t`/`tag` field.\n\n    + Ensure that MetaList elements behave like Lists. Methods usable\n      on Lists can also be used on MetaList objects.\n\n    + Fix MetaList constructor (Albert Krewinkel). Passing a MetaList\n      object to the constructor `pandoc.MetaList` now returns the\n      passed list as a MetaList. This is consistent with the\n      constructor behavior when passed an (untagged) list.\n\n  * Custom writers: Custom writers have access to the global variable\n    `PANDOC_DOCUMENT`(Albert Krewinkel, #4957). The variable contains\n    a userdata wrapper around the full pandoc AST and exposes two\n    fields, `meta` and `blocks`. The field content is only\n    marshaled on-demand, performance of scripts not accessing the\n    fields remains unaffected.\n\n### API changes\n\n  * Text.Pandoc.Options: add `writerPreferAscii` to `WriterOptions`.\n\n  * Text.Pandoc.Shared:\n\n    + Export `splitSentences`. This was previously duplicated in the Man and\n      Ms writers.\n    + Add `ToString` typeclass (Alexander Krotov).\n\n  * New exported module Text.Pandoc.Filter (Albert Krewinkel).\n\n  * Text.Pandoc.Parsing\n\n    + Generalize `gridTableWith` to any `Char` Stream (Alexander Krotov).\n    + Generalize `readWithM` from `[Char]` to any `Char` Stream\n      that is a `ToString` instance (Alexander Krotov).\n\n  * New exposed module Text.Pandoc.Filter (Albert Krewinkel).\n\n  * Text.Pandoc.XML: add `toHtml5Entities`.\n\n  * New exported module Text.Pandoc.Readers.Man (Yan Pashkovsky, John\n    MacFarlane).\n\n  * Text.Pandoc.Writers.Shared\n\n    + Add exported functions `toSuperscript` and\n      `toSubscript` (quasicomputational, #4528).\n    + Remove exported functions `metaValueToInlines`,\n      `metaValueToString`. Add new exported functions\n      `lookupMetaBool`, `lookupMetaBlocks`, `lookupMetaInlines`,\n      `lookupMetaString`. Use these whenever possible for uniformity\n      in writers (Mauro Bieg, #4907). (Note that\n      removed function `metaValueToInlines` was in previous\n      released versions.)\n    + Add `metaValueToString`.\n\n  * Text.Pandoc.Lua\n\n    + Expose more useful internals (Albert Krewinkel):\n\n      - `runFilterFile` to run a Lua filter from file;\n      - data type `Global` and its constructors; and\n      - `setGlobals` to add globals to a Lua environment.\n\n      This module also contains `Pushable` and `Peekable` instances\n      required to get pandoc's data types to and from Lua. Low-level\n      Lua operation remain hidden in Text.Pandoc.Lua.\n\n    + Rename `runPandocLua` to `runLua` (Albert Krewinkel).\n\n    + Remove `runLuaFilter`, merging this into Text.Pandoc.Filter.Lua's\n      `apply` (Albert Krewinkel).\n\n### Bug fixes and under-the-hood improvements\n\n  * Text.Pandoc.Parsing\n\n    + Make `uri` accept any stream with Char tokens (Alexander Krotov).\n    + Rewrite `uri` without `withRaw` (Alexander Krotov).\n    + Generalize `parseFromString` and `parseFromString'` to any\n      streams with Char token (Alexander Krotov)\n    + Rewrite `nonspaceChar` using `noneOf` (Alexander Krotov)\n\n  * Text.Pandoc.Shared: Reimplement `mapLeft` using `Bifunctor.first`\n    (Alexander Krotov).\n\n  * Text.Pandoc.Pretty: Simplify `Text.Pandoc.Pretty.offset`\n    (Alexander Krotov).\n\n  * Text.Pandoc.App\n\n    + Work around HXT limitation for --syntax-definition with windows\n      drive (#4836).\n    + Always preserve tabs for man format. We need it for tables.\n    + Split command line parsing code into a separate unexported\n      module, Text.Pandoc.App.CommandLineOptions (Albert Krewinkel).\n\n  * Text.Pandoc.Readers.Roff: new unexported module for tokenizing\n    roff documents.\n\n  * New unexported module Text.Pandoc.RoffChar, provided character\n    escape tables for roff formats.\n\n  * Text.Pandoc.Readers.HTML: Fix `htmlTag` and `isInlineTag` to\n    accept processing instructions (#3123, regression since 2.0).\n\n  * Text.Pandoc.Readers.JATS: Use `foldl'` instead of `maximum` to\n    account for empty lists (Alexander Krotov).\n\n  * Text.Pandoc.Readers.RST: Don't allow single-dash separator in\n    headerless table (#4382).\n\n  * Text.Pandoc.Readers.Org: Parse empty argument array in inline src\n    blocks (Brian Leung).\n\n  * Text.Pandoc.Readers.Vimwiki:\n\n    + Get rid of `F`, `runF` and `stateMeta'` in favor of `stateMeta`\n      (Alexander Krotov).\n    + Parse `Text` without converting to `[Char]` (Alexander Krotov).\n\n  * Text.Pandoc.Readers.Creole: Parse `Text` without converting to\n    `[Char]` (Alexander Krotov).\n\n  * Text.Pandoc.Readers.LaTeX\n\n    + Allow space at end of math after `\\` (#5010).\n    + Add support for `nolinkurl` command (#4992, Brian Leung).\n    + Simplified type on `doMacros'`.\n    + Tokenize before pulling tokens, rather than after (#4408). This\n      has some performance penalty but is more reliable.\n    + Make macroDef polymorphic and allow in inline context.\n      Otherwise we can't parse something like `\\lowercase{\\def\\x{Foo}}`.\n     I have actually seen tex like this in the wild.\n    + Improved parsing of `\\def`, `\\let`. We now correctly parse:\n      ```\n      \\def\\bar{hello}\n      \\let\\fooi\\bar\n      \\def\\fooii{\\bar}\n      \\fooi +\\fooii\n\n      \\def\\bar{goodbye}\n      \\fooi +\\fooii\n      ```\n    + Improve parsing of `\\def` argspec.\n    + Skip `\\PackageError` commands (see #4408).\n    + Fix bugs omitting raw tex (#4527). The default is `-raw_tex`,\n      so no raw tex should result unless we explicitly say `+raw_tex`.\n      Previously some raw commands did make it through.\n    + Moved `isArgTok` to Text.Pandoc.Readers.LaTeX.Parsing.\n    + Moved `babelLangToBCP`, `polyglossiaLangToBCP` to new module,\n      Text.Pandoc.Readers.LaTeX.Lang (unexported).\n    + Simplified accent code using unicode-transforms.\n      New dependency on unicode-transforms package for normalization.\n    + Allow verbatim blocks ending with blank lines (#4624).\n    + Support `breq` math environments: `dmath`, `dgroup`, `darray`.\n      This collects some of the general-purpose code from the LaTeX reader,\n      with the aim of making the module smaller.\n\n  * Text.Pandoc.Readers.Markdown\n\n    + Fix awkward soft break movements before abbreviations (#4635).\n    + Add updateStrPos in a couple places where needed.\n\n  * Text.Pandoc.Readers.Docx: Trigger bold/italic with bCs, iCs\n    (#4947). These are variants for \"complex scripts\" like Arabic\n    and are now treated just like b, i (bold, italic).\n\n  * Text.Pandoc.Readers.Muse (Alexander Krotov)\n\n    + Try to parse lists before trying to parse table.\n      This ensures that tables inside lists are parsed correctly.\n    + Forbid whitespace after opening and before closing markup\n      elements.\n    + Parse page breaks.\n    + Simplify `museToPandocTable` to get rid of partial functions.\n    + Allow footnotes to start with empty line.\n    + Make sure that the whole text is parsed.\n    + Allow empty headers. Previously empty headers caused parser to\n      terminate without parsing the rest of the document.\n    + Allow examples to be indented with tabs.\n    + Remove indentation from examples indicated by `{{{` and `}}}`.\n    + Fix parsing of empty cells.\n    + Various changes to internals.\n    + Rewrite some parsers in applicative style.\n    + Avoid tagsoup dependency.\n    + Allow table caption to contain `+`.\n\n  * Text.Pandoc.Writers.LaTeX\n\n    + Add newline if math ends in a comment (#4880). This prevents the\n      closing delimiter from being swalled up in the comment.\n    + With `--listings`, don't pass through org-babel attributes (#4889).\n    + With `--biblatex`, use `\\autocite` when possible (#4960).\n      `\\autocites{a1}{a2}{a3}` will not collapse the entries. So, if\n      we don't have prefixes and suffixes, we use instead\n      `\\autocite{a1,a2,a3}`.\n    + Fix description lists contining highlighted code (#4662).\n\n  * Text.Pandoc.Writers.Man\n\n    + Don't wrap `.SH` and `.SS` lines (#5019).\n    + Avoid unnecessary `.RS`/`.RE` pair in definition lists with\n      one paragraph definitions.\n    + Moved common groff functions to Text.Pandoc.Writers.Groff.\n    * Fix strong/code combination on man (should be `\\f[CB]` not\n      `\\f[BC]`, see #4973).\n    + Man writer: use `\\f[R]` instead of `\\f[]` to reset font\n      (Alexander Krotov, #4973).\n    + Move `splitSentences` to Text.Pandoc.Shared.\n\n  * Text.Pandoc.Writers.Docx\n\n    + Add framework for custom properties (#3034). So far, we don't\n      actually write any custom properties, but we have the\n      infrastructure to add this.\n\n    + Handle tables in table cells (#4953). Although this is not\n      documented in the spec, some versions of Word require a `w:p`\n      element inside every table cell. Thus, we add one when the\n      contents of a cell do not already include one (e.g. when a table\n      cell contains a table).\n\n  * Text.Pandoc.Writers.AsciiDoc:  Prevent illegal nestings.\n    Adjust header levels so that n+1 level headers are only\n    found under n level headers, and the top level is 1.\n\n  * Text.Pandoc.Writers.OpenDocument: Improve bullet/numbering\n    alignment (#4385). This change eliminates the large gap we used\n    to have between bullet and text, and also ensures that numbers\n    in numbered lists will be right-aligned.\n\n  * Text.Pandoc.Writers.ZimWiki\n\n    + Number ordered list items sequentially, rather than always\n      with 1 (#4962).\n    + Remove extra indentation on lists (#4963).\n\n  * Text.Pandoc.Writers.EPUB: Use metadata field `css` instead of\n    `stylesheet` (Mauro Bieg, #4990).\n\n  * Text.Pandoc.Writers.Markdown: Ensure blank between raw block and\n    normal content (#4629). Otherwise a raw block can prevent a\n    paragraph from being recognized as such.\n\n  * Text.Pandoc.Writers.Ms\n\n    + Removed old `escapeBar`. We don't need this now that we use\n      `@` for math delim.\n    + Moved common code to Text.Pandoc.Writers.Roff and to\n      Text.Pandoc.RoffChar.\n    + Move `splitSentences` to Text.Pandoc.Shared (to avoid duplication\n      with the man writer).\n\n   * Text.Pandoc.Writers.Muse (Alexander Krotov).\n\n    + Add support for grid tables.\n    + Fix Muse writer style.\n    + Use `length` instead of `realLength` to calculate definition\n      indentation. Muse parsers don't take character width into\n      account when calculating indentation.\n    + Do not insert newline before lists.\n    + Use lightweight markup after `</em>` tag.\n\n  * New unexported module Text.Pandoc.Writers.Roff, providing functions\n    useful for all roff format writers (man, ms).\n\n  * Text.Pandoc.Lua\n\n    + Move globals handling to separate module Text.Pandoc.Lua.Global\n      (Albert Krewinkel).\n\n    + Lua filter internals: push Shared.Element as userdata (Albert\n      Krewinkel). Hierarchical Elements were pushed to Lua as plain\n      tables. This is simple, but has the disadvantage that marshaling\n      is eager: all child elements will be marshaled as part of the\n      object. Using a Lua userdata object instead allows lazy access\n      to fields, causing content marshaling just (but also each time)\n      when a field is accessed. Filters which do not traverse the full\n      element contents tree become faster as a result.\n\n### Default template changes\n\n  * LaTeX template:\n\n    + Add variable `hyperrefoptions` (#4925, Mathias Walter).\n    + Add variable `romanfont`, `romanfontoptions` (#4665, OvidiusCicero).\n\n  * AsciiDoc template: use single-line style for title.\n\n  * revealjs template: Fix typo in the socket.io javascript plugin (#5006,\n    Yoan Blanc).\n\n  * Text.Pandoc.Lua.Util: add missing docstring to `defineHowTo`\n    (Albert Krewinkel).\n\n  * data/pandoc.lua: add datatype ListAttributes (Albert Krewinkel)\n\n  * data/sample.lua: replace custom pipe function with pandoc.utils.pipe\n    (Albert Krewinkel).\n\n### Documentation improvements\n\n  * INSTALL.md\n\n    + Add chromeos install instructions (#4958) (Evan Pratten).\n    + Add note about TinyTeX.\n\n  * MANUAL.txt\n\n    + Change `groff` -> `roff`.\n    + Implement `--ascii` for Markdown writer.\n    + Clarify LaTeX image dimensions output (Mauro Bieg).\n\n  * doc/customizing-pandoc.md: added skeleton (Mauro Bieg, #3288).\n\n  * doc/getting-started.md: Added title to test1.md to avoid warning.\n\n  * doc/lua-filters.md: merge type references into main document,\n    fix description of Code.text (Albert Krewinkel).\n\n### Build infrastructure improvements\n\n  * Makefile\n\n    + Makefile: added quick-cabal, full-cabal targets.\n    + Make .msi download targets insensitive to order of appveyor builds.\n\n  * Update benchmarks for ghc 8.6.1.\n\n   * pandoc.cabal:\n\n    + Enable more compiler warnings (Albert Krewinkel).\n    + Make base lower bound 4.8.\n    + Bump upper bound for QuickCheck.\n    + Bump upper bound for binary.\n    + Updated version bounds for containers and haddock-library (#4974).\n    + Added docx/docPropos/custom.xml to cabal data-files.\n    + Require skylighting 0.7.4 (#4920).\n    + New dependency on unicode-transforms package for normalization.\n\n  * Improved .travis.yml testing and test with GHC 8.6.1 (Albert Krewinkel).\n\n  * Added `tools/changelog-helper.sh`.\n\n  * Added test/grofftest.sh for testing the man reader on real man pages.\n\n## pandoc 2.3.1 (2018-09-28)\n\n  * RST reader:\n\n    + Parse RST inlines containing newlines (#4912, Francesco Occhipinti).\n      This eliminates a regression introduced after pandoc 2.1.1, which\n      caused inline constructions containing newlines not to be recognized.\n    + Fix bug with internal link targets (#4919).  They were gobbling up\n      indented content underneath.\n\n  * Markdown reader: distinguish autolinks in the AST.  With this change,\n    autolinks are parsed as Links with the `uri` class. (The same is true\n    for bare links, if the `autolink_bare_uris` extension is enabled.)\n    Email autolinks are parsed as Links with the `email` class.  This\n    allows the distinction to be represented in the AST.\n\n  * Org reader:\n\n    + Force inline code blocks to honor export options (Brian Leung).\n    + Parse empty argument array in inline src blocks (Brian Leung).\n\n  * Muse reader (Alexander Krotov):\n\n    + Added additional tests.\n    + Do not allow code markup to be followed by digit.\n    + Remove heading level limit.\n    + Simplify `<literal>` tag parsers\n    + Parse Text instead of String. Benchmark shows 7% improvement.\n    + Get rid of HTML parser dependency.\n    + Various code improvements.\n\n  * ConTeXt writer: change `\\` to `/` in Windows image paths (#4918).\n    We do this in the LaTeX writer, and it avoids problems.\n    Note that `/` works as a LaTeX path separator on Windows.\n\n  * LaTeX writer:\n\n    + Add support for multiprenote and multipostnote arguments\n      with `--biblatex` (Brian Leung, #4930).  The multiprenotes occur before\n      the first prefix of a multicite, and the multipostnotes follow the\n      last suffix.\n    + Fix a use of `last` that might take empty list.  If you ran with\n      `--biblatex` and have an empty document (metadata but no blocks),\n      pandoc would previously raise an error because of the use of\n      `last` on an empty list.\n\n  * RTF writer: Fix build failure with ghc-8.6.1 caused by missing\n    MonadFail instance (Jonas Scholl).\n\n  * ODT Writer: Improve table header row style handling (Nils Carlson).\n    This changes the way styles for cells in the header row\n    and normal rows are handled in ODT tables.\n    Previously a new (but identical) style was generated for\n    every table, specifying the style of the cells within the table.\n    After this change there are two style definitions for table cells,\n    one for the cells in the header row, one for all other cells.\n    This doesn't change the actual styles, but makes post-processing\n    changes to the table styles much simpler as it is no longer\n    necessary to introduce new styles for header rows and there are\n    now only two styles where there was previously one per table.\n\n  * HTML writer:\n\n    + Don't add `uri` class to presumed autolinks.  Formerly the `uri`\n      class was added to autolinks by the HTML writer, but it had to\n      guess what was an autolink and could not distinguish\n      `[http://example.com](http://example.com)` from\n      `<http://example.com>`.  It also incorrectly recognized\n      `[pandoc](pandoc)` as an autolink.  Now the HTML writer\n      simply passes through the `uri` attribute if it is present,\n      but does not add anything.\n    + Avoid adding extra section nestings for revealjs.\n      Previously revealjs title slides at level (slidelevel - 1)\n      were nested under an extra section element, even when\n      the section contained no additional (vertical) content.\n      That caused problems for some transition effects.\n    + Omit unknown attributes in EPUB2 output.  For example,\n      `epub:type` attributes should not be passed through,\n      or the epub produced will not validate.\n\n  * JATS writer: remove 'role' attribute on 'bold' and 'sc' elements (#4937).\n    The JATS spec does not allow these.\n\n  * Textile writer: don't represent `uri` class explicitly\n    for autolinks (#4913).\n\n  * Lua filters (Albert Krewinkel):\n\n    + Cleanup filter execution code.\n    + Better error on test failure.\n\n  * HTML, Muse reader tests: reduce time taken by round-trip test.\n\n  * Added cabal.project.\n\n  * MANUAL: `epub:type` is only useful for epub3 (Maura Bieg).\n\n  * Use hslua v1.0.0 (Albert Krewinkel).\n\n  * Fix `translations/ru` to use modern Russian orthography\n    (Ivan Trubach).\n\n  * Build Windows binary using ghc 8.6.1 and cabal new-build. This\n    fixes issues with segfaults in the 32-bit Windows binaries (#4283).\n\n## pandoc 2.3 (2018-09-16)\n\n  * Add `--metadata-file` option (Mauro Bieg, #1960), which allows\n    users to specify metadata in a YAML file, regardless of the\n    input format (#1960).\n\n  * Text.Pandoc.Writers.Shared: export `isDisplayMath` (API change).\n\n  * Text.Pandoc.Readers.Markdown: export `yamlToMeta` (API change,\n    Mauro Bieg).\n\n  * Text.Pandoc.Readers.LaTeX.Types:\n\n    + New type `ArgSpec` (API change).\n    + Second parameter of `Macro` constructor is now `[ArgSpec]` instead of\n      `Int` (API change).\n\n  * Markdown reader:\n\n    + Use `tex` instead of `latex` for raw tex-ish content. We can't\n      always tell if it's LaTeX, ConTeXt, or plain TeX. Better just to\n      use `tex` always. Note that if `context` or `latex` specifically\n      is desired, you can still force that in a markdown document by\n      using the raw attribute. Note that this change may affect some\n      filters, if they assume that raw tex parsed by the Markdown reader\n      will be RawBlock (Format `latex`). In most cases it should be\n      trivial to modify the filters to accept `tex` as well.\n    + Refactor and reorganize YAML code (Mauro Bieg).\n    + Make `example_lists` work for interrupted lists\n      without `startnum` (#4908).\n\n  * HTML reader:\n\n    + Parse `<script type=\"math/tex` tags as math (#4877).\n      These are used by MathJax in some configurations.\n    + Extract spaces inside links instead of trimming them\n      (Alexander Krotov, #4845).\n    + Added round-trip tests (Alexander Krotov).\n    + Make parsing sensitive to the `raw_tex` extension (#1126). This now\n      allows raw LaTeX environments, `\\ref`, and `\\eqref` to be parsed\n      (which is helpful for translation HTML documents using MathJaX).\n\n  * Org reader (Albert Krewinkel):\n\n    + Respect export option `p` for planning info.  Inclusion of planning info\n      (`*DEADLINE*`, `*SCHEDULED*`, and `*CLOSED*`) can be controlled via the\n      `p` export option: setting the option to `t` will add all planning\n      information in a *Plain* block below the respective headline.\n    + Org reader internals: don't rely on RecordWildCards and ViewPatterns\n      ghc extensions.\n    + Strip planning info from output.  Planning info is parsed, but not\n      included in the output (as is the default with Emacs Org-mode, #4867).\n\n  * LaTeX reader:\n\n    + Handle parameter patterns for `\\def` (#4768, #4771).\n      For example:  `\\def\\foo#1[#2]{#1 and #2}`.\n    + Allow `%` characters in URLs. This affects `\\href` and `\\url` (#4832).\n    + Fixed parsing of `\\texorpdfstring`. We were returning the wrong\n      argument as the content.\n    + Support `blockcquote`, `foreignblockquote`, `foreigncblockquote`,\n      `hyphenblockquote`, `hyphencblockquote`, `enquote*`, `foreignquote`,\n      `hyphenquote` from `csquotes` (#4848). Note that `foreignquote`\n      will be parsed as a regular Quoted inline (not using the quotes\n      appropriate to the foreign language).\n    + Support more text-mode accents (#4652). Add support for `\\|`, `\\b`, `\\G`,\n      `\\h`, `\\d`, `\\f`, `\\r`, `\\t`, `\\U`, `\\i`, `\\j`, `\\newtie`,\n      `\\textcircled`. Also fall back to combining characters when composed\n      characters are not available.\n    + Resolve `\\ref` for figure numbers.\n    + Support `mintinline` (#4365, Marc Schreiber).\n    + Fix siunitx unit commands so they are only recognized in\n      siunitx contexts (#4842). For example, `\\l` outside of an\n      siunitx context should be l-slash, not l (for liter).\n    + Fix double `unnumbered` class (#4838). The `unnumbered` class\n      was being included twice for starred sections.\n\n  * RST reader: Don't skip link definitions after comments (#4860).\n\n  * Muse reader (Alexander Krotov):\n\n    + Close the `</quote>` in indented tag test.\n      There is already a separate test for unclosed `</quote>`.\n    + Autonumber sections in the correct order.  Parsing now stops\n      at each section header to ensure the header is registered before\n      parsing of the next section starts.\n    + Move duplicate code into `headingStart` function.\n    + Allow newline after opening `*` or `**`.\n    + Don't allow digits after closing marker in lightweight markup\n      This change makes reader more compatible with Emacs Muse.\n    + Parse `<verse>` tag in one pass instead of using\n      `parseFromString`. This change makes it possible to have\n      verbatim `</verse>` tag inside verse.\n\n  * ODT reader:  deal gracefully with missing `<office:font-face-decls/>`\n    (#4336). This allows pandoc to parse ODT document produced by KDE's\n    Calligra.\n\n  * Muse writer (Alexander Krotov):\n\n    + Output headers without asterisks if not on the top level.\n    + Never wrap definition list terms.\n    + Set `envInsideBlock = True` when rendering notes.\n    + Use `\"\"` instead of `[]` for empty String.\n    + Check for whitespace in the beginning and end of Str's.\n    + Escape `-`, `;` and `>` in the beginning of strings.\n    + Escape list markers in the beginning of notes.\n    + Normalize inline list before testing if tags should be used.\n    + Use tags instead of lightweight markup for empty strings.\n    + Use lightweight markup when possible.\n    + Escape empty strings.  This guarantees that `conditionalEscapeString`\n      never returns empty string.\n    + Wrap conditionalEscapeString result into `Muse` type.\n      This removes the need to pass `envInsideLinkDescription` to it.\n    + Separate `shouldEscapeString` function.\n    + Simplify inline list rendering.\n    + Replace newlines in strings with spaces.\n\n  * Docx writer:\n\n    + Add MetaString case for abstract, subtitle (#4900, Mauro Bieg).\n    + Properly handle display math in spans (#4826). This isn't a\n      complete solution, since other nestings of display math may still\n      cause problems, but it should work for what is by far the most\n      common case.\n\n  * HTML writer:\n\n    + Always output `<dt>` element, even if it is empty (#4883,\n      Alexander Krotov).\n    + Don't prefix `epub:` attributes with `data-`.\n\n  * Org writer: Don't escape literal `_`, `^` (#4882). Org doesn't\n    recognize these escapes.\n\n  * ODT writer: Fix percentage image scaling (#4881, Nils Carlson).\n    Image scaling was broken when a width was set to a percentage.\n\n  * EPUB writer: set `epub:type` on body element in each chapter,\n    depending on the `epub:type` of the first section (#4823). This\n    only affects epub3. See\n    http://www.idpf.org/epub/profiles/edu/structure/#h.l0bzsloklt10\n\n  * FB2 writer: put `coverpage` element between title and date rather than in\n    `document-info` element (#4854).\n\n  * Markdown writer: Escape `~` if strikeout extension enabled (#4840).\n\n  * Haddock writer: Use proper format for latex math in haddock (#4571, Joe\n    Hermaszewski). Inline math in `\\(..\\)`, display math in `\\[..\\]`,\n    tex is now used. Previously we'd \"fake it with unicode\" and fall\n    back to tex when that didn't work. But newer haddock versions\n    support latex math.\n\n  * TEI writer:\n\n    + Ensure that title element is always present, even if empty (#4839).\n    + Put author tags in the template, rather than adding them in\n      the writer (#4839).\n\n  * LaTeX writer/template: be sensitive to `filecolor` variable (#4822).\n    `linkcolor` only affects internal links, and `urlcolor` only\n    affects linked URLs.  For external links, the option to use is\n    `filecolor`.\n\n  * ConTeXt writer: output raw `tex` blocks as well as `context` (#969).\n\n  * RST writer:\n\n    + Use `.. raw:: latex` for `tex` content.\n    + Use `.. container` for generic Divs, instead of raw HTML.\n    + Render Divs with admonition classes as admonitions (#4833).\n      Also omit Div with class `admonition-title`. These are generated\n      by the RST reader and should be omitted on round-trip.\n\n  * Text.Pandoc.PDF: fix message printed when rsvg-convert is not available\n    (#4855, Antonio Terceiro).\n\n  * HTML5 template: add the `title-block-header` identifier to the\n    `header` element, to make it easier to style precisely (#4767,\n    J. B. Rainsberger).\n\n  * OpenDocument template: Remove unnecessary indenting of TOC title (#4798,\n    José de Mattos Neto).\n\n  * latex template: Add support for $toc-title$ to LaTeX (and PDF)\n    (#4853, Wandmalfarbe).\n\n  * TEI template: improve `publicationStmt`. Add support for\n    `publisher`, `address`, `pubPlace`, and `date` variables.\n\n  * beamer template: Support \"toc-title\" (#4835, Cyril Roelandt).\n\n  * Text.Pandoc.Extensions: Fix haddock on `Ext_footnotes` (Chris Martin).\n\n  * Lua: cleanup Lua utils, remove unused functions (Albert Krewinkel).\n\n  * MANUAL.txt:\n\n    + Clarify that `--biblatex/--natbib` don't work directly for PDF\n      (#4904).\n    + Document `epub:type` attribute (Mauro Bieg, #4901)\n    + Clarify when `--resource-path` has an effect.\n    + More detail on customization in syntax highlighting section.\n    + Document encoding issue with `--listings` (#4871, Damien Clochard).\n    + Remove docs on removed `--katex-stylesheet` (Mauro Bieg, #4862).\n    + Use https for context wiki links (#4910).\n\n  * CONTRIBUTING.md:\n\n    + Link to lua-filters repository (#4874).\n    + Fix mistake in REPL instructions for stack. (#4849, Brian Leung).\n\n  * lua-filters.md: add links to filters, and to lua-filters repository\n    (#4874).\n\n  * INSTALL.md:\n\n    + Indicate that cabal >= 2.0 is needed.\n    + Added chocolatey installation method (#4844, Miodrag Milić).\n\n  * Travis: exclude round-trip tests, except for nightly test which can fail.\n\n  * Use latest texmath, pandoc-citeproc.\n\n  * Use a patched version of foundation until\n    https://github.com/haskell-foundation/foundation/pull/503\n    is fixed.\n\n  * Clean up appveyor build and Windows package creation.\n    We now use 64-bit stack and ghc 8.4.3, lts-12 for the 64-bit build. The\n    WiX-based msi is now 64-bit for 64-bit builds (fixing #4795).\n\n  * Remove obsolete RELEASE-CHECKLIST.md.\n\n  * Added additional compiler warnings in Makefile and CI builds.\n\n## pandoc 2.2.3.2 (2018-08-07)\n\n  * Markdown reader: Properly handle boolean values in YAML metadata (#4819).\n    This fixes a regression in 2.2.3, which cause boolean values to\n    be parsed as MetaInlines instead of MetaBool.\n\n    We here record another undocumented (but desirable) change in 2.2.3:\n    numerical metadata fields are now parsed as MetaInlines rather than\n    MetaString.\n\n## pandoc 2.2.3.1 (2018-08-06)\n\n  * Markdown reader: Fix parsing of embedded mappings in YAML metadata\n    (#4817).  This fixes a regression in 2.2.3 which caused embedded\n    mappings (e.g. mappings in sequences) not to work in YAML metadata.\n\n## pandoc 2.2.3 (2018-08-05)\n\n  * RST reader: improve parsing of inline interpreted text roles (#4811).\n\n    + Use a Span with class \"title-reference\" for the default\n      title-reference role.\n    + Use `B.text` to split up contents into `Space`s, `SoftBreak`s,\n      and `Str`s for `title-reference`.\n    + Use Code with class \"interpreted-text\" instead of Span and Str for\n      unknown roles.  (The RST writer has also been modified to round-trip\n      this properly.)\n    + Disallow blank lines in interpreted text.\n    + Backslash-escape now works in interpreted text.\n    + Backticks followed by alphanumerics no longer end interpreted text.\n    + Remove support for nested inlines (Francesco Occhipinti).\n      RST does not allow nested emphasis, links, or other inline\n      constructs.  This fixes several bugs (#4581, #4561, #4792).\n\n  * Org reader: fix parsers relying on `parseFromString` (#4784, Albert\n    Krewinkel).  Emphasis was not parsed when it followed directly after\n    some block types (e.g., lists).\n\n  * Markdown reader: Allow unquoted numbers and booleans as YAML mapping\n    keys.  Previously in 2.2.2 you could not do\n    ```\n    ---\n    0: bar\n    ...\n    ```\n    but only\n    ```\n    ---\n    '0': bar\n    ...\n    ```\n    With this change, both forms work.\n\n  * DocBook reader: metadata handling improvements.\n    Now we properly parse title and subtitle elements that are direct\n    children of book and article (as well as children of bookinfo,\n    articleinfo, or info).  We also now use the `subtitle` metadata\n    field for subtitles, rather than tacking the subtitle on to the\n    title.\n\n  * RST writer:\n\n    + Allow images to be directly nested within links (#4810, Francesco\n      Occhipinti).\n    + Use `titleblock` instead of `title` variable for title block (#4803,\n      Francesco Occhipinti).  `titleblock` contains a properly formatted\n      title and subtitle (using top-level headers).  `title` and\n      `subtitle` variables are still available and just contain the\n      title and subtitle text.  Note that this change will require an\n      update to custom rst templates.\n    + Render Code with class \"interpreted-text\" as interpreted text role.\n\n  * MediaWiki writer: Avoid extra blank line in tables with empty cells\n    (#4794).  Note that the old output is semantically identical, but the\n    new output looks better.\n\n  * Lua Utils module: add function `blocks_to_inlines` (#4799, Albert\n    Krewinkel).  Exposes a function converting which flattenes a list of\n    blocks into a list of inlines. An example use case would be the\n    conversion of Note elements into other inlines.\n\n  * RST template:  use `titleblock` instead of `title`.  Users of\n    custom RST templates will want to update this.\n\n  * LaTeX template: Moved some beamer code in default.latex template.\n    This change allows beamer themes to change the template and font (as\n    Metropolis does) (#4450).\n\n  * Better error message on `-t pdf -o out.pdf` (#1155, Mauro Bieg).\n\n  * Added test case for #4669 to repository.\n\n  * INSTALL.md: Fix broken link for cabal-install (#4806, ChanHoHo).\n\n  * MANUAL.txt:\n\n    + Add beamer info for slide backgrounds (#4802, John Muccigrosso).\n    + Clarify when `csquotes` is used in LaTeX writer (#4514).\n    + Add `commonmark` to list of output formats where `raw_tex` has an\n      effect (see #4527).\n\n\n## pandoc 2.2.2.1 (2018-07-19)\n\n  * Fix regression finding templates in user data directory (#4777).\n    Under version 2.2.1 and prior pandoc found latex templates in the\n    templates directory under the data directory, but this broke in 2.2.2.\n\n  * Fix for bug in parsing `\\input` in `rawLaTeXBlock` and\n    `rawLaTeXInline` (#4781). (This primarily affects the markdown\n    reader, and other readers that accept raw tex.)\n    Starting in 2.2.2, everything after an `\\input` (or `\\include`)\n    in a markdown file would be parsed as raw LaTeX.\n\n  * MANUAL:\n\n    + Clarify `gfm` vs `markdown_github` (#4783, Mauro Bieg).\n    * Use `keywords` instead of `tags` in YAML metadata example (#4779).\n      Unlike `tags`, `keywords` is used in some of the writers\n      and default templates.\n\n  * Add missing `rollingLinks` option to revealjs template (#4778,\n    Igor Khorlo).\n\n## pandoc 2.2.2 (2018-07-16)\n\n  * Use HsYAML instead of yaml for translations and YAML metadata (#4747).\n    yaml wraps a C library; HsYAML is pure Haskell.  Advances #4535.\n\n    Note: HsYAML implements YAML 1.2, in which the valid true\n    values are `true`, `True`, `TRUE`.  This means a change in\n    the semantics of YAML metadata that could affect users:\n    `y`, `yes`, and `on` no longer count as true values.\n\n  * Fix regression: make `--pdf-engine` work with full paths (#4681, Mauro\n    Bieg).\n\n  * CommonMark reader: Handle `ascii_identifiers` extension (#4742,\n    Anders Waldenborg).  Non-ascii characters were not stripped from\n    identifiers even if the `ascii_identifiers` extension was\n    enabled (which is is by default for gfm).\n\n  * TikiWiki reader: Improve list parsing (#4722, Mauro Bieg).\n    Remove trailing Space from list items.  Parse lists that have no space\n    after marker.\n\n  * LaTeX reader:\n\n    + Treat `lilypond` as a verbatim environment (#4725).\n    + Parse figure label into Image id (#4700, Mauro Bieg).\n    + Beamer: Allow \"noframenumbering\" option (#4696, Raymond Ehlers).\n    + Allow spaces around `\\graphicspath` arguments (#4698).\n    + Handle includes without surrounding blanklines (#4553).\n      In addition, `\\input` can now be used in an inline context,\n      e.g. to provide part of a paragraph, as it can in LaTeX.\n    + In `rawLaTeXBlock`, handle macros that resolve to a\n      `\\begin` or `\\end` (#4667).\n    + In `rawLaTeXBlock`, don't expand macros in macro definitions (#4653).\n      Note that this only affected LaTeX in markdown.\n    + Tighten up reading of beamer overlay specifications (#4669).\n      Ideally we'd turn these on only when reading beamer, but currently\n      beamer is not distinguished from latex as an input format.\n      This commit also activates parsing of overlay specifications\n      after commands in general (e.g. `\\item`), since they can occur\n      in many contexts in beamer.\n    + Parse more siunitx unit commands (#4296, #4773).\n    + Be more forgiving in key/value option parsing (#4761).\n\n  * Markdown reader:\n\n    + Allow empty code spans, e.g. `` ` ` ``.\n    + Emojis are now wrapped in Spans with class `emoji` and\n      attribute `data-emoji` (Anders Waldenborg, #4743).\n      This allows the writer to handle them in a special way\n      (e.g. using a special font, or just rendering the\n      emoji name).\n\n  * Muse reader (Alexander Krotov, except where indicated):\n\n    + Get rid of non-exhaustive pattern match warning (Mauro Bieg).\n    + Add support for floating images.\n    + Add support for images with specified width.\n    + Parse image URLs without \"guard\" and \"takeExtension\".\n    + Split link and image parsing into separate functions.\n    + Parse links starting with \"URL:\" explicitly instead of trying to strip\n      \"URL:\" prefix after parsing.\n\n  * Texinfo writer: Use `@sup` and `@sub` instead of custom macros (#4728,\n    Alexander Krotov).\n\n  * Markdown writer: Preserve `implicit_figures` with attributes, even if\n    `implicit_attributes` is not set, by rendering in raw HTML (#4677).\n\n  * Markdown and commonmark/github writers now respect the `emoji`\n    extension.  So, `-f markdown+emoji -t markdown+emoji` now leaves\n    `:smile:` as `:smile:` rather than converting it to a smile\n    character.\n\n  * Docx writer: Be sensitive to `toc` in YAML metadata (#4645).\n\n  * ODT/OpenDocument writer: Make internal links work (#4358).\n    This adds proper bookmarks to the headers with non-null IDs.\n\n  * EPUB writer: Properly escape pagetitle.  Previously we weren't\n    escaping `&` and other XML characters in the pagetitle, so a title\n    containing a `&` would be invalid.\n\n  * AsciiDoc Writer: Eescape square brackets at start of line (#4545,\n    Mauro Bieg).\n\n  * RST writer:\n\n    + Don't treat 'example' as a syntax name (#4748).\n      This fixes conversions from org with example blocks.\n    + Support `--number-sections` via the `section-numbering`\n      directive in standalone output.\n\n  * reveal.js writer and template: reuse mathjax URL\n    provided by the argument to `--mathjax` or the normal pandoc default,\n    rather than a hard-coded one in the template (#4701).\n\n  * LaTeX writer:\n\n    + Properly handle footnotes in table captions (#4683).\n      Refactored code from figure captions to use in both places.\n    + In beamer output, fix single digit column percentage (#4690, Mauro\n      Bieg).\n\n  * FB2 writer (Alexander Krotov):\n\n    + Convert Plain to Para in annotation (#2424).\n    + Fix order of items in title-info (#2424).\n\n  * Custom writer: fix error message on script failure (Albert Krewinkel).\n    Error messages produced by Lua were not displayed by Pandoc.\n\n  * Text.Pandoc.Emoji now exports `emojiToInline`, which returns a Span\n    inline containing the emoji character and some attributes with metadata\n    (class `emoji`, attribute `data-emoji` with emoji name).  (API change,\n    Anders Waldenborg, #4743).\n\n  * Text.Pandoc.PDF:\n\n    + Revert fix for #4484 (only compress images on last run, #4755).\n      This will mean some increase in the time it takes to\n      produce an image-heavy PDF with xelatex, but it will\n      make tables of contents correct, which is more important.\n    + Fix logic error in `runTeXProgram`.  We were running the tex program\n      one more time than requested.  This should speed up PDF production.\n\n  * Allow `--template` to take a URL as argument.\n\n  * Text.Pandoc.Highlighting: Add missing re-export of `breezeDark`\n    highlighting style (#4687, Adrian Sieber, API change).\n\n  * Clarify macOS install in INSTALL.md (#4661).  Make the binary package\n    installer the recommended method, and note that on some older versions of\n    macOS, homebrew installs from source and takes a lot of disk space\n    (#4664, Ian).\n\n  * MANUAL:\n\n    + Clarify EPUB linked media (#4756, Mauro Bieg)\n    + Update manual for \"true\" YAML values.  Now that we're using HsYAML and\n      YAML 1.2, the valid true values are `true`, `True`, `TRUE`.  NOTE!\n      `y`, `yes`, `on` no longer count as true values.\n    + Document `-F` as alias for `--filter` (thanks to Gandalf Saxe).\n    + Update manual on how math is rendered in LaTeX.\n    + Add proxy description (#4131, Mauro Bieg).\n    + Clarify that `--toc` requires `--standalone` (#4703).\n    + Update citation styles link (#4699, wiefling).\n\n  * In API docs, clarify how `Ext_east_asian_line_breaks` extension works\n    (kaizshang91).  Note that it will not take effect when readers/writers\n    are called as libraries (#4674).\n\n  * Improved translations/fr (#4766, lux-lth).\n\n  * Removed inadvertently added `.orig` files from repository (#4648).\n\n  * Remove `network-uri` flag and use 'Network.Socket'.\n    This removes a compiler warning.  There is no need for the old\n    `network-uri` flag, since network 2.6 was released in 2014.\n\n  * Add stack.lts10.yaml, stack.lts11.yaml.  use lts-12 in stack.yaml.\n\n  * Bump upper bounds for dependent packages.\n\n  * Exclude foundation 0.0.21 for ghc 7.10.  Otherwise cabal gets\n    confused because of the way ghc 7.10 is excluded in foundation's\n    cabal file.  This can be removed when haskell-foundation/foundation#500\n    is fixed.\n\n  * Require cabal-version >= 2.0.  This is needed for haddock-library.\n\n\n\n\n## pandoc 2.2.1 (2018-05-10)\n\n  * Restored and undeprecated gladtex for HTML math (#4607).\n\n    + Added `GladTeX` constructor to `Text.Pandoc.Options.HTMLMathMethod`\n      [API change, reverts removal in v2.2]\n    + Restored and undeprecated `--gladtex` option, removed in v2.2.\n\n  * LaTeX reader:  Handle `$` in `/text{..}` inside math (#4576).\n\n  * Org reader: Fix image filename recognition (Albert Krewinkel).\n    Use a function from the filepath library to check whether a string is a\n    valid file name.  The custom validity checker that was used before gave\n    wrong results (e.g. for absolute file paths on Windows,\n    kawabata/ox-pandoc#52).\n\n  * FB2 reader: Replace some errors with warnings (Alexander Krotov).\n\n  * HTML writer:\n\n    + Strip links from headers when creating TOC (#4340).\n      Otherwise the TOC entries will not link to the sections.\n    + Fix regression with tex math environments in HTML + MathJax (#4639).\n\n  * Muse writer (Alexander Krotov): Add support for left-align and\n    right-align classes (#4542).\n\n  * Docx writer: Support underline (#4633).\n\n  * Text.Pandoc.Parsing: Lookahead for non-whitespace after\n    `singleQuoteStart` and `doubleQuoteStart` (#4637).\n\n  * `test-pandoc-utils.lua`:  more robust testing on both windows\n    and \\*nix. Previously the pipe tests were only run if\n    `\\bin/false` and `/bin/sed` were present, which they aren't\n    in default MacOS and Windows systems.  Fixed by using `tr`\n    and `false`, which should always be in the path on a \\*nix\n    system, and `find` and `echo` for Windows.\n\n  * Text.Pandoc.Shared: add `uriPathToPath`.\n    This adjusts the path from a file: URI in a way that is sensitive\n    to Windows/Linux differences.  Thus, on Windows,\n    `/c:/foo` gets interpreted as `c:/foo`, but on Linux,\n    `/c:/foo` gets interpreted as `/c:/foo`.  See #4613.\n\n  * Use `uriPathToPath` with file: URIs (#4613).\n\n  * Revert piping HTML to pdf-engine (Mauro Bieg, #4413).  Use a temp\n    file as before.\n\n  * Text.Pandoc.Class: Catch IO errors when writing media files\n    and issue a warning, rather than an error (Francesco Occhipinti, #4559).\n\n  * Don't lowercase custom writer filename (Alexander Krotov, #4610).\n\n  * MANUAL (Mauro Bieg):\n\n    + Clarify truthiness in template variables (#2281).\n    + Clarify pipe table width calculation (#4520).\n\n  * ConTeXt template: New Greek fallback typeface (Pablo Rodríguez, #4405).\n    CMU Serif gives better typographic results than the previous\n    Greek fallback DejaVu Serif.\n\n  * Make HTML template polyglot (#4606, OvidiusCicero), by making\n    `<link rel=\"stylesheet\" href=\"$css$\">` self-closing.\n\n  * Use texmath 0.11, allowing better translation of non-ASCII\n    characters in math (#4642).\n\n\n## pandoc 2.2 (2018-04-27)\n\n  * New input format: `fb2` (FictionBook2) (Alexander Krotov).\n\n  * Make `--ascii` work for all XML formats (ICML, OPML, JATS,...),\n    and for `ms` and `man`.\n\n  * Remove deprecated `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`,\n    `--asciimathml` options.\n\n  * New module Text.Pandoc.Readers.FB2, exporting readFB2 (Alexander\n    Krotov, API change).\n\n  * Markdown reader:\n\n    + Allow empty key-value attributes, like `title=\"\"` (#2944).\n    + Handle table w/o following blank line in fenced div (#4560).\n    + Remove \"fallback\" for `doubleQuote` parser.  Previously the\n      parser tried to be efficient -- if no end double quote was found,\n      it would just return the contents.  But this could backfire in a\n      case `**this should \"be bold**`, since the fallback would return\n      the content `\"be bold**` and the closing boldface delimiter\n      would never be encountered.\n    + Improve computation of the relative width of the last column in a\n      multiline table, so we can round-trip tables without constantly\n      shrinking the last column.\n\n  * EPUB reader:\n\n    + Fix images with space in file path (#4344).\n\n  * LaTeX reader:\n\n    + Properly resolve section numbers with `\\ref` and chapters (#4529).\n    + Parse sloppypar environment (#4517, Marc Schreiber).\n    + Improve handling of raw LaTeX (for markdown etc.) (#4589, #4594).\n      Previously there were some bugs in how macros were handled.\n    + Support `\\MakeUppercase`, `\\MakeLowercase`, `\\uppercase`,\n      `\\lowercase`, and also `\\MakeTextUppercase` and\n      `\\MakeTextLowercase` from textcase (#4959).\n\n  * Textile reader:\n\n    + Fixed tables with no body rows (#4513).\n      Previously these raised an exception.\n\n  * Mediawiki reader:\n\n    + Improve table parsing (#4508).  This fixes detection of table\n      attributes and also handles `!` characters in cells.\n\n  * DocBook reader:\n\n    + Properly handle title in `section` element (#4526).\n      Previously we just got `section_title` for `section` (though `sect1`,\n      `sect2`, etc. were handled properly).\n    + Read tex math as output by asciidoctor (#4569, Joe Hermaszewski).\n\n  * Docx reader:\n\n    + Combine adjacent CodeBlocks with the same attributes into\n      a single CodeBlock.  This prevents a multiline codeblock in\n      Word from being read as different paragraphs.\n\n  * RST reader:\n\n    + Allow < 3 spaces indent under directives (#4579).\n    + Fix anonymous redirects with backticks (#4598).\n\n  * Muse reader (Alexander Krotov):\n\n    + Add support for Text::Amuse multiline headings.\n    + Add `<math>` tag support.\n    + Add support for `<biblio>` and `<play>` tags.\n    + Allow links to have empty descriptions.\n    + Require block `<literal>` tags to be on separate lines.\n    + Allow `-` in anchors.\n    + Allow verse to be indented.\n    + Allow nested footnotes.\n    + Internal improvements.\n\n  * Muse writer (Alexander Krotov):\n\n    + Escape `>` only at the beginning of a line.\n    + Escape `]` in image title.\n    + Escape `]` brackets in URLs as `%5D`.\n    + Only escape brackets when necessary.\n    + Escape ordered list markers.\n    + Do not escape list markers unless preceded by space.\n    + Escape strings starting with space.\n    + Escape semicolons and markers after line break.\n    + Escape `;` to avoid accidental comments.\n    + Don't break headers, line blocks and tables with line breaks.\n    + Correctly output empty headings.\n    + Escape horizontal rule only if at the beginning of the line.\n    + Escape definition list terms starting with list markers.\n    + Place header IDs before header.\n    + Improve span writing.\n    + Do not join Spans in normalization.\n    + Don't align ordered list items.\n    + Remove key-value pairs from attributes before normalization.\n    + Enable `--wrap=preserve` for all tests by default.\n    + Reduced `<verbatim>` tags in output.\n    + Internal changes.\n\n  * RST writer:\n\n    + Use more consistent indentation (#4563).  Previously we\n      used an odd mix of 3- and 4-space indentation.  Now we use 3-space\n      indentation, except for ordered lists, where indentation must\n      depend on the width of the list marker.\n    + Flatten nested inlines (#4368, Francesco Occhipinti).\n      Nested inlines are not valid RST syntax, so we flatten them following\n      some readability criteria discussed in #4368.\n\n  * EPUB writer:\n\n    + Ensure that `pagetitle` is always set, even when structured titles\n      are used.  This prevents spurious warnings about empty title\n      elements (#4486).\n\n  * FB2 writer (Alexander Krotov):\n\n    + Output links inline instead of producing notes.  Previously all links\n      were turned into footnotes with unclickable URLs inside.\n    + Allow emphasis and notes in titles.\n    + Don't intersperse paragraph with empty lines.\n    + Convert metadata value `abstract` to book annotation.\n    + Use `<empty-line />` for `HorizontalRule` rather than `LineBreak`.\n      FB2 does not have a way to represent line breaks inside paragraphs;\n      previously we used `<empty-line />` elements, but these are not allowed\n      inside paragraphs.\n\n  * Powerpoint writer (Jesse Rosenthal):\n\n    + Handle Quoted Inlines (#4532).\n    + Simplify code with `ParseXml`.\n    + Allow fallback options when looking for placeholder type.\n    + Check reference-doc for all layouts.\n    + Simplify speaker notes logic.\n    + Change notes state to a simpler per-slide value.\n    + Remove `Maybe` from `SpeakerNotes` in `Slide`. `mempty`\n      means no speaker notes.\n    + Add tests for improved speaker notes.\n    + Handle speaker notes earlier in the conversion process.\n    + Keep notes with related blocks (#4477).  Some blocks automatically\n      split slides (imgs, tables, `column` divs). We assume that any\n      speaker notes immediately following these are connected to these\n      elements, and keep them with the related blocks, splitting after them.\n    + Remove `docProps/thumbnail.jpeg` in data dir (Jesse Rosenthal, #4588).\n      It contained a nonfree ICC color calibration profile and is not needed\n      for production of a powerpoint document.\n\n  * Markdown writer:\n\n    + Include a blank line at the end of the row in a single-row multiline\n      table, to prevent it from being interpreted as a simple table (#4578).\n\n  * CommonMark writer:\n\n    + Correctly ignore LaTeX raw blocks when `raw_tex` is not\n      enabled (#4527, quasicomputational).\n\n  * EPUB writer:\n\n    + Add `epub:type=\"footnotes\"` to notes section in EPUB3 (#4489).\n\n  * LaTeX writer:\n\n    + In beamer, don't use format specifier for default ordered lists\n      (#4556).  This gives better results for styles that put ordered list\n      markers in boxes or circles.\n    + Update `\\lstinline` delimiters (#4369, Tim Parenti).\n\n  * Ms writer:\n\n    + Use `\\f[R]` rather than `\\f[]` to reset font (#4552).\n    + Use `\\f[BI]` and `\\f[CB]` in headers, instead of `\\f[I]` and `\\f[C]`,\n      since the header font is automatically bold (#4552).\n    + Use `\\f[CB]` rather than `\\f[BC]` for monospace bold (#4552).\n    + Create pdf anchor for a Div with an identifier (#4515).\n    + Escape `/` character in anchor ids (#4515).\n    + Improve escaping for anchor ids: we now use _uNNN_ instead of uNNN\n      to avoid ambiguity.\n\n  * Man writer:\n\n    + Don't escape U+2019 as `'` (#4550).\n\n  * Text.Pandoc.Options:\n\n    + Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from\n    `Text.Pandoc.Options.HTMLMathMethod` [API change].\n\n  * Text.Pandoc.Class:\n\n    + `writeMedia`: unescape URI-escaping in file path.  This avoids\n      writing things like `file%20one.png` to the file system.\n\n  * Text.Pandoc.Parsing:\n\n    + Fix `romanNumeral` parser (#4480).  We previously accepted 'DDC'\n      as 1100.\n    + `uri`: don't treat `*` characters at end as part of URI (#4561).\n\n  * Text.Pandoc.MIME:\n\n    + Use the alias `application/eps` for EPS (#2067).\n      This will ensure that we retain the eps extension after reading the\n      image into a mediabag and writing it again.\n\n  * Text.Pandoc.PDF:\n\n    + Use `withTempDir` in `html2pdf`.\n    + With `xelatex`, don't compress images til the last run (#4484).\n      This saves time for image-heavy documents.\n    + Don't try to convert EPS files (#2067).  `pdflatex` converts them\n      itself, and JuicyPixels can't do it.\n    + For `pdflatex`, use a temp directory in the working directory.\n      Otherwise we can have problems with the EPS conversion pdflatex\n      tries to do, which can't operate on a file above the working\n      directory without `--shell-escape`.\n\n  * Changes to tests to accommodate changes in pandoc-types.\n    In <https://github.com/jgm/pandoc-types/pull/36> we changed\n    the table builder to pad cells.  This commit changes tests\n    (and two readers) to accord with this behavior.\n\n  * Set default extensions for `beamer` same as `latex`.\n\n  * LaTeX template:\n\n    + Add `beameroption` variable (#4359, Étienne Bersac).\n    + Use `pgfpages` package; this is needed for notes on second\n      screen in beamer (Étienne Bersac).\n    + Add `background-image` variable (#4601, John Muccigrosso).\n\n  * reveal.js template: Add `background-image` variable (#4600,\n    John Muccigrosso).\n\n  * ms template: Fix date.  Previously `.ND` was used, but this only\n    works if you have a title page, which we don't.  Thanks to @teoric.\n\n  * Removed pragmas for unused extensions (#4506, Anabra).\n\n  * Fix bash completion for `--print-default-data-file` (#4549).\n    Previously this looked in the filesystem, even if pandoc\n    was compiled with `embed_data_files` (and sometimes it looked\n    in a nonexistent build directory).  Now the bash completion\n    script just includes a hard-coded list of data file names.\n\n  * MANUAL:\n\n    + Clarify template vs metadata variables (#4501, Mauro Bieg).\n    + Fix raw content example (#4479, Mauro Bieg).\n    + Specify that you use html for raw output in epub.\n    + Add examples for raw docx blocks (#4472, Tristan Stenner).\n      The documentation states that the target format name should match\n      the output format, which isn't the case for `docx`/`openxml` and\n      some others.\n    + Don't say that `empty_paragraphs` affects markdown output (#4540).\n    + Consolidate input/output format documentation (#4577, Mauro Bieg).\n\n  * New README template. Take in/out formats from manual.\n\n  * Fix example in lua-filters docs (#4459, HeirOfNorton).\n\n  * Use the `-threaded` GHC flag when building benchmarks (#4587,\n    Francesco Occhipinti).\n\n  * Bump temporary upper bound to 1.4.\n\n  * Use pandoc-citeproc 0.14.3.1.\n\n  * Use texmath-0.10.1.2 (fixes escapes in math in ms, #4597).\n\n  * Removed old lib directory.  This was used for something long ago,\n    but plays no role now.\n\n  * Removed unneeded data file `LaTeXMathML.js`.\n\n  * Create 64- and 32-bit versions of Windows binary packages.\n\n## pandoc 2.1.3 (2018-03-18)\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Add tests for nested smart tags.\n    + Parse nested smart tags.\n    + Make unwrapSDT into a general `unwrap` function that can unwrap both\n      nested SDT tags and smartTags. This makes the SmartTags constructor in\n      the Docx type unnecessary, so we remove it (#4446).\n    + Remove unused `docxWarnings` (Alexander Krotov).\n\n  * RST reader: Allow unicode bullet characters (#4454).\n\n  * Haddock reader:  Better table handling, using haddock-library's\n    new table support, if compiled against a version that\n    includes it.  Note that tables with col/rowspans will not\n    translate well into Pandoc.\n\n  * Muse reader (Alexander Krotov):\n\n    + Various internal improvements.\n    + Require closing tag to have the same indentation as opening.\n    + Do not reparse blocks inside unclosed block tag (#4425).\n    + Parse `<class>` tag (supported by Emacs Muse).\n    + Do not produce empty Str element for unindented verse lines.\n\n  * LaTeX reader:\n\n    + Add support to parse unit string of `\\SI` command (closes #4296,\n      Marc Schreiber).\n\n  * Haddock writer:  In the writer, we now render tables always as\n    grid tables, since Haddock supports these.\n\n  * DokuWiki writer: rewrite backSlashLineBreaks (#4445, Mauro Bieg).\n\n  * Docx writer: Fixed formatting of `DefaultStyle` ordered lists in\n    docx writer.  We want decimal for the top level, not lower roman.\n\n  * RST writer:\n\n    + Strip whitespace at beginning and ending of inline containers\n      (#4327, Francesco Occhipinti).\n    + Filter out empty inline containers (#4434).  There is nothing in\n      RST that corresponds to e.g. `Emph []`, so we just ignore elements\n      like this (Francesco Occhipinti).\n\n  * Muse writer (Alexander Krotov):\n\n    + Support spans with anchors.\n    + Replace smallcaps with emphasis before normalization.\n    + Output smallcaps as emphasis.\n    + Expand Cite before list normalization.\n    + Write empty inline lists as `<verbatim></verbatim>`.\n    + Remove empty Str from the beginning of inline lists during normalization.\n    + Escape \"-\" to avoid creating bullet lists.\n    + Fix math expansion for more than one expression per paragraph.\n    + Expand math before inline list normalization.\n\n  * Dokuwiki writer: fix LineBreaks in Tables (#4313, Mauro Bieg).\n\n  * Ms writer:\n\n    + Asciify pdf anchors, since unicode anchors don't work (#4436).\n      Internal links should be converted automatically, so this shouldn't\n      affect users directly.\n    + Don't escape hyphens as `\\-`; that's for a minus sign (#4467).\n\n  * Beamer writer: put hyperlink after `\\begin{frame}` and not in the title\n    (#4307).  If it's in the title, then we get a titlebar on slides with\n    the `plain` attribute, when the id is non-null.  This fixes a regression\n    in 2.0.\n\n  * EPUB writer: Remove notes from TOC in nav.xhtml (#4453, Mauro Bieg).\n\n  * JATS writer: Remove extraneous, significant whitespace (#4335,\n    Nokome Bentley).\n\n  * html2pdf: inject base tag with current working directory (#4413, Mauro\n    Bieg).  This helps ensure that linked resources are included.\n\n  * Add Semigroup instances for everything for which we defined a\n    Monoid instance previously (API change):\n\n    + Text.Pandoc.Class.FileTree.\n    + Text.Pandoc.Translations.Translations.\n    + Text.Pandoc.Extensions.Extensions.\n    + Text.Pandoc.Readers.Odt.StyleReader.Styles.\n    + Text.Pandoc.Pretty.Doc.\n    + Text.Pandoc.MediaBag.MediaBag.\n\n  * Add custom Prelude to give clean code for Monoid and Semigroup\n    that works with ghc 7.10-8.4.  The custom Prelude (`prelude/Prelude`)\n    is used for ghc versions < 8.4.  `NoImplicitPrelude` is used\n    in all source files, and Prelude is explicitly imported\n    (this is necessary for ghci to work properly with the custom prelude).\n\n  * Text.Pandoc.Writers.Shared (Francesco Occhipinti):\n\n    + Export `stripLeadingTrailingSpace`.\n    + Don't wrap lines in grid tables when `--wrap=none` (#4320).\n    + `gridTable`: Don't wrap lines in tables when `--wrap=none`.  Instead,\n      expand cells, even if it results in cells that don't respect relative\n      widths or surpass page column width.  This change affects RST,\n      Markdown, and Haddock writers.\n\n  * Raise error if someone tries to print docx, odt, etc. template (#4441).\n\n  * LaTeX template: Provide `bidi` package's option using\n    `\\PassOptionsToPackage`  (#4357, Václav Haisman).  This avoid a\n    clash when   `polyglossia` loads it first and then it is loaded again\n    for XeLaTeX.\n\n  * ConTeXt template: Added `pdfa` variable to generate PDF/A (#4294, Henri\n    Menke).  Instructions on how to install the ICC profiles on ConTeXt\n    standalone can be found in the wiki:\n    <http://wiki.contextgarden.net/PDFX#ICC_profiles>.\n    If the ICC profiles are not available the log will contain error\n    messages.\n\n  * Use latest pandoc-types, skylighting\n\n  * Use latest pandoc-citeproc in binary package.\n\n  * Bump upper bound for time, criterion, haddock-library, exceptions,\n    http-types, aeson, haddock-library.\n\n  * Bump upper bound tasty-quickcheck 0.10 (#4429, Felix Yan).\n\n  * pandoc.cabal:  fix up other-extensions and language fields.\n    Language is now consistently `Haskell2010`, and other-extensions\n    is consistently `NoImplicitPrelude`. Everything else to be specified\n    in the module header as needed.\n\n  * Removed `old-locale` flag and Text.Pandoc.Compat.Time.\n    This is no longer necessary since we no longer support ghc 7.8.\n\n  * Make `weigh-pandoc` into a benchmark program.\n    Remove `weigh-pandoc` flag.  `weigh-pandoc` is now built (and run)\n    automatically when you build (and run) benchmarks.\n\n  * MANUAL: add instructions for background images reveal.js (#4325, John\n    Muccigrosso).\n\n  * appveyor: use VS 2013 environment instead of VS 2015 for Windows builds.\n\n## pandoc 2.1.2 (2018-03-02)\n\n  * Markdown reader:\n\n    + Fix parsing bug with nested fenced divs (#4281).  Previously we allowed\n      \"nonindent spaces\" before the opening and closing `:::`, but this\n      interfered with list parsing, so now we require the fences to be flush with\n      the margin of the containing block.\n\n  * Commonmark reader:\n\n    + `raw_html` is now on by default.  It can be disabled explicitly\n      using `-f commonmark-raw_html`.\n\n  * Org reader (Albert Krewinkel):\n\n    + Move citation tests to separate module.\n    + Allow changing emphasis syntax (#4378).  The characters allowed before\n      and after emphasis can be configured via `#+pandoc-emphasis-pre` and\n      `#+pandoc-emphasis-post`, respectively. This allows to change which\n      strings are recognized as emphasized text on a per-document or even\n      per-paragraph basis.  Example:\n\n          #+pandoc-emphasis-pre: \"-\\t ('\\\"{\"\n          #+pandoc-emphasis-post: \"-\\t\\n .,:!?;'\\\")}[\"\n\n  * LaTeX reader:\n\n    + Fixed comments inside citations (#4374).\n    + Fix regression in package options including underscore (#4424).\n    + Make `--trace` work.\n    + Fixed parsing of `tabular*` environment (#4279).\n\n  * RST reader:\n\n    + Fix regression in parsing of headers with trailing space (#4280).\n\n  * Muse reader (Alexander Krotov):\n\n    + Enable `<literal>` tags even if amuse extension is enabled.\n      Amusewiki disables <literal> tags for security reasons.\n      If user wants similar behavior in pandoc, RawBlocks and RawInlines\n      can be removed or replaced with filters.\n    + Remove space prefix from `<literal>` tag contents.\n    + Do not consume whitespace while looking for closing end tag.\n    + Convert alphabetical list markers to decimal in round-trip test.\n      Alphabetical lists are an addition of Text::Amuse.\n      They are not present in Emacs Muse and can be ambiguous\n      when list starts with \"i.\", \"c.\" etc.\n    + Allow `<quote>` and other tags to be indented.\n    + Allow single colon in definition list term.\n    + Fix parsing of verse in lists.\n    + Improved parsing efficiency.  Avoid `parseFromString`.\n      Lists are parsed in linear instead of exponential time now.\n    + Replace ParserState with MuseState.\n    + Prioritize lists with roman numerals over alphabetical lists.\n      This is to make sure \"i.\" starts a roman numbered list,\n      instead of a list with letter \"i\" (followed by \"j\", \"k\", ...\").\n    + Fix directive parsing.\n    + Parse definition lists with multiple descriptions.\n    + Parse next list item before parsing more item contents.\n    + Fixed a bug: headers did not terminate lists.\n    + Move indentation parsing from `definitionListItem` to `definitionList`.\n    + Paragraph indentation does not indicate nested quote.\n      Muse allows indentation to indicate quotation or alignment,\n      but only on the top level, not within a <quote> or list.\n    + Require that block tags are on separate lines.\n      Text::Amuse already explicitly requires it anyway.\n    + Fix matching of closing inline tags.\n    + Various internal changes.\n    + Fix parsing of nested definition lists.\n    + Require only one space for nested definition list indentation.\n    + Do not remove trailing whitespace from `<code>`.\n    + Fix parsing of trailing whitespace.  Newline after whitespace now\n      results in softbreak instead of space.\n\n  * Docx reader (Jesse Rosenthal, except where noted):\n\n    + Handle nested sdt tags (#4415).\n    + Don't look up dependant run styles if `+styles` is enabled.\n    + Move pandoc inline styling inside custom-style span.\n    + Read custom styles (#1843).  This will read all paragraph and\n      character classes as divs and spans, respectively. Dependent styles\n      will still be resolved, but will be wrapped with appropriate style\n      tags. It is controlled by the `+styles` extension (`-f docx+styles`).\n      This can be used in conjunction with the `custom-style` feature in the\n      docx writer for a pandoc-docx editing workflow. Users can convert from\n      an input docx, reading the custom-styles, and then use that same input\n      docx file as a reference-doc for producing an output docx file. Styles\n      will be maintained across the conversion, even if pandoc doesn't\n      understand them.\n    + Small change to Fields hyperlink parser.  Previously, unquoted string\n      required a space at the end of the line (and consumed it). Now we\n      either take a space (and don't consume it), or end of input.\n    + Pick table width from the longest row or header (Francesco Occhipinti,\n      #4360).\n\n  * Muse writer (Alexander Krotov):\n\n    + Change verse markup: `> ` instead of `<verse>` tag.\n    + Remove empty strings during inline normalization.\n    + Don't indent nested definition lists.\n    + Use unicode quotes for quoted text.\n    + Write image width specified in percent in Text::Amuse mode.\n    + Don't wrap displayMath into `<verse>`.\n    + Escape nonbreaking space (`~~`).\n    + Join code with different attributes during normalization.\n    + Indent lists inside Div.\n    + Support definitions with multiple descriptions.\n\n  * Powerpoint writer (Jesse Rosenthal):\n\n    + Use table styles This will use the default table style in the\n      reference-doc file. As a result they will be easier when using\n      in a template, and match the color scheme.\n    + Remove empty slides.  Because of the way that slides were split, these\n      could be accidentally produced by comments after images.  When animations\n      are added, there will be a way to add an empty slide with either\n      incremental lists or pauses.\n    + Implement syntax highlighting.  Note that background colors can't\n      be implemented in PowerPoint, so highlighting styles that require\n      these will be incomplete.\n    + New test framework for pptx.  We now compare the output of the\n      Powerpoint writer with files that we know to (a) not be corrupt,\n      and (b) to show the desired output behavior (details below).\n    + Add `notesMaster` to `presentation.xml` if necessary.\n    + Ignore links and (end)notes in speaker notes.\n    + Output speaker notes.\n    + Read speaker note templates conditionally.  If there are speaker\n      notes in the presentation, we read in the notesMasters templates\n      from the reference pptx file.\n    + Fix deletion track changes (#4303, Jesse Rosenthal).\n\n  * Markdown writer: properly escape @ to avoid capture as citation\n    (#4366).\n\n  * LaTeX writer:\n\n    + Put hypertarget inside figure environment (#4388).\n      This works around a problem with the endfloat package and\n      makes pandoc's output compatible with it.\n    + Fix image height with percentage (#4389).  This previously caused\n      the image to be resized to a percentage of textwidth, rather than\n      textheight.\n\n  * ConTeXt writer (Henri Menke):\n\n    + New section syntax and support `--section-divs` (#2609).\n      `\\section[my-header]{My Header}` ->\n      `\\section[title={My Header},reference={my-header}]`.\n      The ConTeXt writer now supports the `--section-divs` option to\n      write sections in the fenced style, with `\\startsection` and\n      `\\stopsection`.\n    + xtables: correct wrong usage of caption (Henri Menke).\n\n  * Docx writer:\n\n    + Fix image resizing with multiple images (#3930, Andrew Pritchard).\n    + Use new golden framework (Jesse Rosenthal).\n    + Make more deterministic to facilitate testing (Jesse Rosenthal).\n      - `getUniqueId` now calls to the state to get an incremented digit,\n        instead of calling to P.uniqueHash.\n      - we always start the PRNG in mkNumbering/mkAbstractNum with the same\n        seed (1848), so our randoms should be the same each time.\n    + Fix ids in comment writing (Jesse Rosenthal).  Comments from\n      `--track-changes=all` were producing corrupt docx, because the\n      writer was trying to get id from the `(ID,_,_)` field of\n      the attributes, and ignoring the \"id\" entry in the key-value pairs. We\n      now check both.\n\n  * Ms writer: Added papersize variable.\n\n  * TEI writer:\n\n    + Use `height` instead of `depth` for images (#4331).\n    + Ensure that id prefix is always used.\n    + Don't emit `role` attribute; that was a leftover from the\n      Docbook writer.\n    + Use 'xml:id', not 'id' attribute (#4371).\n\n  * AsciiDoc writer:\n\n    + Do not output implicit heading IDs (#4363, Alexander\n      Krotov).  Convert to `asciidoc-auto_identifiers` for old behaviour.\n\n  * RST writer:\n\n    + Remove `blockToRST'` moving its logic into `fixBlocks`\n      (Francesco Occhipinti).\n    + Insert comment between lists and quotes (#4248, Francesco Occchipinti).\n\n  * RST template: remove definition of 'math' role as raw.\n    This used to be needed prior to v 0.8 of docutils, but\n    now math support is built-in.\n\n  * Slides: Use divs to set incremental/non-incremental (#4381,\n    Jesse Rosenthal).  The old method (list inside blockquote) still\n    works, but we are encouraging the use of divs with class\n    `incremental` or `nonincremental`.\n\n  * Text.Pandoc.ImageSize:\n\n    + Make image size detection for PDFs more robust (#4322).\n    + Determine image size for PDFs (#4322).\n    + EMF Image size support (#4375, Andrew Pritchard).\n\n  * Text.Pandoc.Extensions:\n\n    + Add `Ext_styles` (Jesse Rosenthal, API change).  This will be used in\n      the docx reader (defaulting to off) to read pargraph and character\n      styles not understood by pandoc (as divs and spans, respectively).\n    + Made `Ext_raw_html` default for `commonmark` format.\n\n  * Text.Pandoc.Parsing:\n\n    + Export `manyUntil` (Alexander Krotov, API change).\n    + Export improved `sepBy1` (Alexander Krotov).\n    + Export list marker parsers: `upperRoman`, `lowerRoman`,\n      `decimal`, `lowerAlpha`, `upperAlpha` (Alexander Krotov, API change).\n\n  * Tests/Lua: fix tests on windows (Albert Krewinkel).\n\n  * Lua: register script name in global variable (#4393).  The name of the Lua\n    script which is executed is made available in the global Lua variable\n    `PANDOC_SCRIPT_FILE`, both for Lua filters and custom writers.\n\n  * Tests: Abstract powerpoint tests out to OOXML tests (Jesse Rosenthal).\n    There is very little pptx-specific in these tests, so we abstract out\n    the basic testing function so it can be used for docx as well. This\n    should allow us to catch some errors in the docx writer that slipped\n    by the roundtrip testing.\n\n  * Lua filters: store constructors in registry (Albert Krewinkel).  Lua\n    functions used to construct AST element values are stored in the Lua\n    registry for quicker access. Getting a value from the registry is much\n    faster than getting a global value (partly to idiosyncrasies of hslua);\n    this change results in a considerable performance boost.\n\n  * Documentation:\n\n    + `doc/org.md` Add draft of Org-mode documentation (Albert Krewinkel).\n    + `doc/lua-filters.md`: document global vars set for filters\n      (Albert Krewinkel).\n    + INSTALL.md: mention Stack version. (#4343, Adam Brandizzi).\n    + MANUAL: add documentation on custom styles (Jesse Rosenthal).\n    + MANUAL.txt: Document incremental and nonincremental divs (Jesse\n      Rosenthal).  Blockquoted lists are still described, but fenced divs are\n      presented in preference.\n    + MANUAL.txt: document header and footer variables (newmana).\n    + MANUAL.txt: self-contained implies standalone (#4304, Daniel Lublin).\n    + CONTRIBUTING.md: label was renamed. (#4310, Alexander Brandizzi).\n\n  * Require tagsoup 0.14.3 (#4282), fixing HTML tokenization bug.\n\n  * Use latest texmath.\n\n  * Use latest pandoc-citeproc.\n\n  * Allow exceptions 0.9.\n\n  * Require aeson-pretty 0.8.5 (#4394).\n\n  * Bump blaze-markup, blaze-html lower bounds to 0.8, 0.9 (#4334).\n\n  * Update tagsoup to 0.14.6 (Alexander Krotov, #4282).\n\n  * Removed ghc-prof-options.  As of cabal 1.24, sensible defaults are used.\n\n  * Update default.nix to current nixpkgs-unstable for hslua-0.9.5 (#4348,\n    jarlg).\n\n## pandoc 2.1.1 (2018-01-18)\n\n  * Markdown reader:\n\n    + Don't coalesce adjacent raw LaTeX blocks if they are separated by a\n      blank line.  See lierdakil/pandoc-crossref#160.\n    + Improved `inlinesInBalancedBrackets` (#4272, jgm/pandoc-citeproc#315).\n      The change both improves performance and fixes a regression whereby\n      normal citations inside inline notes and figure captions were not\n      parsed correctly.\n\n  * RST reader:\n\n    + Better handling for headers with an anchor (#4240).  Instead of creating a\n      Div containing the header, we put the id directly on the header.\n      This way header promotion will work properly.\n    + Add aligned environment when needed in math (#4254).  `rst2latex.py`\n      uses an `align*` environment for math in `.. math::` blocks, so this\n      math may contain line breaks.  If it does, we put the math in an\n      `aligned` environment to simulate `rst2latex.py`'s behavior.\n\n  * HTML reader:\n\n    + Fix col width parsing for percentages < 10% (#4262, n3fariox).\n\n  * LaTeX reader:\n\n    + Advance source position at end of stream.\n    + Pass through macro defs in `rawLaTeXBlock` even if the `latex_macros`\n      extension is set (#4246).  This reverts to earlier behavior and is\n      probably safer on the whole, since some macros only modify things in\n      included packages, which pandoc's macro expansion can't modify.\n    + Fixed pos calculation in tokenizing escaped space.\n    + Allow macro definitions inside macros (#4253).  Previously we went into\n      an infinite loop with\n      ```\n      \\newcommand{\\noop}[1]{#1}\n      \\noop{\\newcommand{\\foo}[1]{#1}}\n      \\foo{hi}\n      ```\n    + Fix inconsistent column widths (#4238).  This fixes a bug whereby column\n      widths for the body were different from widths for the header in some\n      tables.\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Parse hyperlinks in `instrText` tags (#3389, #4266).  This was a form of\n      hyperlink found in older versions of word. The changes introduced for\n      this, though, create a framework for parsing further fields in MS Word\n      (see the spec, ECMA-376-1:2016, §17.16.5, for more on these fields).\n      We introduce a new module, `Text.Pandoc.Readers.Docx.Fields` which\n      contains a simple parsec parser. At the moment, only simple hyperlink\n      fields are accepted, but that can be extended in the future.\n\n  * Muse reader (Alexander Krotov):\n\n    + Parse `~~` as non-breaking space in Text::Amuse mode.\n    + Refactor list parsing.\n\n  * Powerpoint writer (Jesse Rosenthal):\n\n    + Change reference to `notesSlide` to `endNotesSlide`.\n    + Move image sizing into `picProps`.\n    + Improve table placement.\n    + Make our own `_rels/.rels` file.\n    + Import reference-doc images properly.\n    + Move `Presentation.hs` out of `PandocMonad`.\n    + Refactor into separate modules.  T.P.W.Powerpoint.Presentation\n      defines the Presentation datatype and goes Pandoc->Presentation;\n      T.P.W.Pandoc.Output goes Presentation->Archive.\n      Text.Pandoc.Writers.Powerpoint a thin wrapper around the two modules.\n    + Avoid overlapping blocks in column output.\n    + Position images correctly in two-column layout.\n    + Make content shape retrieval environment-aware.\n    + Improve image handling.  We now determine image and caption placement\n      by getting the dimensions of the content box in a given layout.\n      This allows for images to be correctly sized and positioned in a\n      different template.  Note that images without captions and headers are\n      no longer full-screened. We can't do this dependably in different\n      layouts, because we don't know where the header is (it could be to\n      the side of the content, for example).\n    + Read presentation size from reference file.  Our presentation size is\n      now dependent on the reference/template file we use.\n    + Handle (sub)headers above slidelevel correctly.  Above the slidelevel,\n      subheaders will be printed in bold and given a bit of extra space\n      before them. Note that at the moment, no distinction is made between\n      levels of headers above the slide header, though that can be changed.\n    + Check for required files.  Since we now import from reference/dist\n      file by glob, we need to make sure that we're getting the files we\n      need to make a non-corrupt Powerpoint. This performs that check.\n    + Improve templating using `--reference-doc`.  Templating should work\n      much more reliably now.\n    + Include Notes slide in TOC.\n    + Set notes slide header to slide-level.\n    + Add table of contents.  This is triggered by the `--toc` flag. Note\n      that in a long slide deck this risks overrunning the text box. The user\n      can address this by setting `--toc-depth=1`.\n    + Set notes slide number correctly.\n    + Clean up adding metadata slide.  We want to count the slide numbers\n      correctly if it's in there.\n    + Add anchor links.  For anchor-type links (`[foo](#bar)`) we produce\n      an anchor link. In powerpoint these are links to slides, so we keep\n      track of a map relating anchors to the slides they occur on.\n    + Make the slide number available to the blocks.  For anchors,\n      block-processing functions need to know what slide number\n      they're in. We make the `envCurSlideId` available to blocks.\n    + Move `curSlideId` to environment.\n    + Allow setting `toc-title` in metadata.\n    + Link notes to endnotes slide.\n\n  * Markdown writer:\n\n    + Fix cell width calculation (#4265).  Previously we could get\n      ever-lengthening cell widths when a table was run repeatedly through\n      `pandoc -f markdown -t markdown`.\n\n  * LaTeX writer:\n\n    + Escape `&` in lstinline (Robert Schütz).\n\n  * ConTeXt writer:\n\n    + Use xtables instead of Tables (#4223, Henri Menke).\n      Default to xtables for context output.  Natural Tables are used\n      if the new `ntb` extension is set.\n\n  * HTML writer:\n\n     + Fixed footnote backlinks with `--id-prefix` (#4235).\n\n  * `Text.Pandoc.Extensions`:  Added `Ext_ntb` constructor (API change,\n    Henri Menke).\n\n  * `Text.Pandoc.ImageSize`: add derived `Eq` instance to `Dimension`\n    (Jesse Rosenthal, API change).\n\n  * Lua filters (Albert Krewinkel):\n\n    + Make `PANDOC_READER_OPTIONS` available.\n      The options which were used to read the document are made available to\n      Lua filters via the `PANDOC_READER_OPTIONS` global.\n    + Add lua module `pandoc.utils.run_json_filter`, which runs a JSON filter\n      on a Pandoc document.\n    + Refactor filter-handling code into `Text.Pandoc.Filter.JSON`,\n      `Text.Pandoc.Filter.Lua`, and `Text.Pandoc.Filter.Path`.\n    + Improve error messages.  Provide more context about the task\n      which caused an error.\n\n  * data/pandoc.lua (Albert Krewinkel):\n\n    + Accept singleton inline as a list.  Every constructor which accepts a\n      list of inlines now also accepts a single inline element for\n      convenience.\n    + Accept single block as singleton list. Every constructor which accepts\n      a list of blocks now also accepts a single block element for\n      convenience.  Furthermore, strings are accepted as shorthand for\n      `{pandoc.Str \"text\"}` in constructors.\n    + Add attr, listAttributes accessors.  Elements with\n      attributes got an additional `attr` accessor. Attributes were\n      accessible only via the `identifier`, `classes`, and `attributes`,\n      which was in conflict with the documentation, which indirectly states\n      that such elements have the an `attr` property.\n    + Drop `_VERSION`.  Having a `_VERSION` became superfluous, as this\n      module is closely tied to the pandoc version, which is available via\n      `PANDOC_VERSION`.\n    + Fix access to Attr components.  Accessing an Attr value (e.g.,\n      ` Attr().classes`) was broken; the more common case of accessing it via\n      an Inline or Block element was unaffected by this.\n\n  * Move `metaValueToInlines` to from Docx writer to\n    `Text.Pandoc.Writers.Shared`, so it can be used by other writers\n    (Jesse Rosenthal).\n\n  * MANUAL.txt:\n\n    + Clarify otherlangs in LaTeX (#4072).\n    + Clarify `latex_macros` extension.\n    + Recommend use of `raw_attribute` extension in header includes (#4253).\n\n  * Allow latest QuickCheck, tasty, criterion.\n\n  * Remove custom prelude and ghc 7.8 support.\n\n  * Reduce compiler noise (exact paths for compiled modules).\n\n## pandoc 2.1 (2018-01-07)\n\n  * Allow filters and lua filters to be interspersed (#4196).  Previously\n    we ran all lua filters before JSON filters.  Now we run filters in\n    the order they are presented on the command line, whether lua or JSON.\n    There are two incompatible API changes: The type of `applyFilters`\n    has changed, and `applyLuaFilters` has been removed.  `Filter` is\n    also now exported.\n\n  * Use latest skylighting and omit the `missingIncludes` check, fixing\n    a major performance regression in earlier releases of the 2.x series\n    (#4226).  Behavior change: If you use a custom syntax definition that\n    refers to a syntax you haven't loaded, pandoc will now complain when\n    it is highlighting the text, rather than doing a check at the start.\n    This change dramatically speeds up invocations of pandoc on short\n    inputs.\n\n  * Text.Pandoc.Class: make `FileTree` opaque (don't export\n    `FileTree` constructor).  This forces users to interact with it using\n    `insertInFileTree` and `getFileInfo`, which normalize file names.\n\n  * Markdown reader:\n\n    + Rewrite `inlinesInBalancedBrackets`.  The rewrite is much more\n      direct, avoiding `parseFromString`.  And it performs significantly\n      better; unfortunately, parsing time still increases exponentially\n      (see #1735).\n    + Avoid parsing raw tex unless `\\` + letter seen.  This seems to\n      help with the performance problem, #4216.\n\n  * LaTeX reader: Simplified a check for raw tex command.\n\n  * Muse reader (Alexander Krotov):\n\n    + Enable round trip test (#4107).\n    + Automatically translate `#cover` into `#cover-image`.\n      Amusewiki uses #cover directive to specify cover image.\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Allow for insertion/deletion of paragraphs (#3927).\n      If the paragraph has a deleted or inserted paragraph break (depending\n      on the track-changes setting) we hold onto it until the next\n      paragraph. This takes care of accept and reject. For this we introduce\n      a new state which holds the ils from the previous para if necessary.\n      For `--track-changes=all`, we add an empty span with class\n      `paragraph-insertion`/`paragraph-deletion` at the end of the paragraph\n      prior to the break to be inserted or deleted.\n    + Remove unused anchors (#3679).  Docx produces a lot of anchors with\n      nothing pointing to them---we now remove these to produce cleaner\n      output. Note that this has to occur at the end of the process\n      because it has to follow link/anchor rewriting.\n    + Read multiple children of `w:sdtContents`.\n    + Combine adjacent anchors.  There isn't any reason to have numerous\n      anchors in the same place, since we can't maintain docx's\n      non-nesting overlapping. So we reduce to a single anchor.\n    + Improved tests.\n\n  * Muse writer (Alexander Krotov): don't escape URIs from AST\n\n  * Docx writer:\n\n    + Removed redundant subtitle in title (Sebastian Talmon).\n    + `firstRow` table definition compatibility for Word 2016 (Sebastian\n      Talmon).  Word 2016 seems to use a default value of \"1\" for table\n      headers, if there is no firstRow definition (although a default\n      value of 0 is documented), so all tables get the first Row formatted\n      as header.  Setting the parameter to 0 if the table has no header\n      row fixes this for Word 2016\n    + Fix custom styles with spaces in the name (#3290).\n\n  * Powerpoint writer (Jesse Rosenthal):\n\n    + Ignore Notes div for parity with other slide outputs.\n    + Set default slidelevel correctly.  We had previously defaulted to\n      slideLevel 2. Now we use the correct behavior of defaulting to the\n      highest level header followed by content. We change an expected test\n      result to match this behavior.\n    + Split blocks correctly for linked images.\n    + Combine adjacent runs.\n    + Make inline code inherit code size.  Previously (a) the code size\n      wasn't set when we force size, and (b) the properties was set from\n      the default, instead of inheriting.\n    + Simplify `replaceNamedChildren` function.\n    + Allow linked images.  The following markdown:\n      `[![Image Title](image.jpg)](http://www.example.com)`\n      will now produce a linked image in the resulting PowerPoint file.\n    + Fix error with empty table cell.  We require an empty `<a:p>` tag,\n      even if the cell contains no paragraphs---otherwise PowerPoint\n      complains of corruption.\n    + Implement two-column slides.  This uses the columns/column div\n      format described in the pandoc manual. At the moment, only two\n      columns (half the screen each) are allowed. Custom widths are not\n      supported.\n    + Added more tests.\n\n  * OpenDocument/ODT writers: improved rendering of formulas (#4170, oltolm).\n\n  * Lua filters (Albert Krewinkel):\n\n    + `data/pandoc.lua`: drop 'pandoc-api-version' from Pandoc objects\n    + The current pandoc-types version is made available to Lua programs in\n      the global `PANDOC_API_VERSION`. It contains the version as a list of\n      numbers.\n    + The pandoc version available as a global `PANDOC_VERSION` (a list\n      of numbers).\n    + `data/pandoc.lua`: make `Attr` an `AstElement`.\n    + `data/pandoc.lua`: make all types subtypes of `AstElement`.\n      `Pandoc`, `Meta`, and `Citation` were just plain functions and did\n      not set a metatable on the returned value, which made it difficult\n      to amend objects of these types with new behavior. They are now\n      subtypes of AstElement, meaning that all their objects can gain\n      new features when a method is added to the behavior object\n      (e.g., `pandoc.Pandoc.behavior`).\n    + `data/pandoc.lua`: split type and behavior tables.  Clearly distinguish\n      between a type and the behavioral properties of an instance of that\n      type. The behavior of a type (and all its subtypes) can now be\n      amended by adding methods to that types `behavior` object, without\n      exposing the type objects internals.  E.g.:\n      ```lua\n      pandoc.Inline.behavior.frob = function () print'42' end\n      local str = pandoc.Str'hello'\n      str.frob() -- outputs '42'\n      ```\n    + `data/pandoc.lua`: fix Element inheritance.  Extending all elements\n      of a given type (e.g., all inline elements) was difficult, as the\n      table used to lookup unknown methods would be reset every time a\n      new element of that type was created, preventing recursive property\n      lookup. This is was changed in that all methods and attributes of\n      supertypes are now available to their subtypes.\n    + `data/pandoc.lua`: fix attribute names of Citation (#4222).  The\n      fields were named like the Haskell fields, not like the documented,\n      shorter version.  The names are changed to match the documentation\n      and Citations are given a shared metatable to enable simple\n      extensibility.\n    + `data/pandoc.lua`: drop function `pandoc.global_filter`.\n    + Bump `hslua` version to 0.9.5.  This version fixes a bug that made it\n      difficult to handle failures while getting lists or a Map from Lua.\n      A bug in pandoc, which made it necessary to always pass a tag when\n      using MetaList or MetaBlock, is fixed as a result. Using the pandoc\n      module's constructor functions for these values is now optional\n      (if still recommended).\n    + Stop exporting `pushPandocModule` (API change).  The introduction\n      of `runPandocLua` renders direct use of this function obsolete.\n    + Update generation of module docs for lua filters.\n    + `Lua.Module.Utils`: make stringify work on `MetaValues` (John\n      MacFarlane).  I'm sure this was intended in the first place,\n      but currently only `Meta` is supported.\n\n  * Improve benchmarks.\n\n    + Set the default extensions properly.\n    + Improve benchmark argument parsing.  You can now say\n      `make bench BENCHARGS=\"markdown latex reader\"` and both the\n      markdown and latex readers will be benchmarked.\n\n  * MANUAL.txt simplify and add more structure (Mauro Bieg).\n\n  * Generate README.md from template and MANUAL.txt.\n    `make README.md` will generate the README.md after changes\n    to MANUAL.txt have been made.\n\n  * Update copyright notices to include 2018 (Albert Krewinkel).\n\n## pandoc 2.0.6 (2017-12-28)\n\n  * Added `jats` as an input format.\n\n    + Add Text.Pandoc.Readers.JATS, exporting `readJATS` (API\n      change) (Hamish Mackenzie).\n    + Improved citation handling in JATS reader.  JATS citations\n      are now converted to pandoc citations, and JATS ref-lists\n      are converted into a `references` field in metadata, suitable\n      for use with pandoc-citeproc. Thus a JATS article with embedded\n      bibliographic information can be processed with pandoc and\n      pandoc-citeproc to produce a formatted bibliography.\n\n  * Allow `--list-extensions` to take an optional FORMAT argument.\n    This lists the extensions set by default for the selected FORMAT.\n    The extensions are now alphabetized, and the `+` or `-`\n    indicating the default setting comes before, rather than after,\n    the extension.\n\n  * Markdown reader:\n\n    + Preserve original whitespace between blocks.\n    + Recognize `\\placeformula` as context.\n    + Be pickier about table captions.  A caption starts with a `:` which\n      can't be followed by punctuation.  Otherwise we can falsely interpret\n      the start of a fenced div, or even a table header line like\n      `:--:|:--:`, as a caption.\n    + Always use four space rule for example lists.  It would be awkward\n      to indent example list contents to the first non-space character after\n      the label, since example list labels are often long.  Thanks to\n      Bernhard Fisseni for the suggestion.\n    + Improve raw tex parsing.  Note that the Markdown reader is also\n      affected by the `latex_macros` extension changes described below\n      under the LaTeX reader.\n\n  * LaTeX reader:\n\n    + `latex_macros` extension changes (#4179).  Don't pass through macro\n      definitions themselves when `latex_macros` is set.  The macros\n      have already been applied.  If `latex_macros` is enabled, then\n      `rawLaTeXBlock` in Text.Pandoc.Readers.LaTeX will succeed in parsing\n      a macro definition, and will update pandoc's internal macro map\n      accordingly, but the empty string will be returned.\n    + Export `tokenize`, `untokenize` (API change).\n    + Use `applyMacros` in `rawLaTeXBlock`, `rawLaTeXInline`.\n    + Refactored `inlineCommand`.\n    + Fix bug in tokenizer.  Material following `^^` was\n      dropped if it wasn't a character escape.  This only affected\n      invalid LaTeX, so we didn't see it in the wild, but it appeared\n      in a QuickCheck test failure.\n    + Fix regression in LateX tokenization (#4159).  This mainly affects the\n      Markdown reader when parsing raw LaTeX with escaped spaces.\n    + Add tests of LaTeX tokenizer.\n    + Support `\\foreignlanguage` from babel.\n    + Be more tolerant of `&` character (#4208).  This allows us to parse\n      unknown tabular environments as raw LaTeX.\n\n  * Muse reader (Alexander Krotov):\n\n    + Parse anchors immediately after headings as IDs.\n    + Require that note references does not start with 0.\n    + Parse empty comments correctly.\n\n  * Org reader (Albert Krewinkel):\n\n    + Fix asterisks-related parsing error (#4180).\n    + Support minlevel option for includes (#4154).  The level of headers\n      in included files can be shifted to a higher level by specifying a\n      minimum header level via the `:minlevel` parameter. E.g.\n      `#+include: \"tour.org\" :minlevel 1` will shift the headers in\n      tour.org such that the topmost headers become level 1 headers.\n    + Break-up org reader test file into multiple modules.\n\n  * OPML reader:\n\n    + Enable raw HTML and other extensions by default for notes\n      (#4164).  This fixes a regression in 2.0.  Note that extensions can\n      now be individually disabled, e.g.  `-f opml-smart-raw_html`.\n\n  * RST reader:\n\n    + Allow empty list items (#4193).\n    + More accurate parsing of references (#4156).  Previously we erroneously\n      included the enclosing backticks in a reference ID (#4156).  This\n      change also disables interpretation of syntax inside references, as\n      in docutils.  So, there is no emphasis in `` `my *link*`_ ``.\n\n  * Docx reader:\n\n    + Continue lists after interruption (#4025, Jesse Rosenthal).\n      Docx expects that lists will continue where they left off after an\n      interruption and introduces a new id if a list is starting again. So\n      we keep track of the state of lists and use them to define a \"start\"\n      attribute, if necessary.\n    + Add tests for structured document tags unwrapping (Jesse Rosenthal).\n    + Preprocess Document body to unwrap `w:sdt` elements (Jesse Rosenthal,\n      #4190).\n\n  * Plain writer:\n\n    + Don't linkify table of contents.\n\n  * RST writer:\n\n    + Fix anchors for headers (#4188).  We were missing an `_`.\n\n  * PowerPoint writer (Jesse Rosenthal):\n\n    + Treat lists inside BlockQuotes as lists.  We don't yet produce\n      incremental lists in PowerPoint, but we should at least treat lists\n      inside BlockQuotes as lists, for compatibility with other slide formats.\n    + Add ability to force size.  This replaces the more specific\n      `blockQuote runProp`, which only affected the size of blockquotes. We\n      can use this for notes, etc.\n    + Implement notes.  This currently prints all notes on a final slide.\n      Note that at the moment, there is a danger of text overflowing the\n      note slide, since there is no logic for adding further slides.\n    + Implement basic definition list functionality to PowerPoint writer.\n    + Don't look for default template file for Powerpoint (#4181).\n    + Add pptx to isTextFormat list.  This is used to check standalone\n      and not writing to the terminal.\n    + Obey slide level option (Jesse Rosenthal).\n    + Introduce tests.\n\n  * Docx writer:\n\n    + Ensure that `distArchive` is the one that comes with pandoc\n      (#4182).  Previously a `reference.docx` in `~/.pandoc` (or the user data\n      dir) would be used instead, and this could cause problems because a\n      user-modified docx sometimes lacks vital sections that we count\n      on the `distArchive` to supply.\n\n  * Org writer:\n\n    + Do not wrap \"-\" to avoid accidental bullet lists (Alexander Krotov).\n    + Don't allow fn refs to wrap to beginning of line (#4171, with help from\n      Alexander Krotov).  Otherwise they can be interpreted as footnote\n      definitions.\n\n  * Muse writer (Alexander Krotov):\n\n    + Don't wrap note references to the next line (#4172).\n\n  * HTML writer:\n\n    + Use br elements in line blocks instead of relying on CSS\n      (#4162).  HTML-based templates have had the custom CSS for\n      `div.line-block` removed.  Those maintaining custom templates will want\n      to remove this too.  We still enclose line blocks in a div with class\n      `line-block`.\n\n  * LaTeX writer:\n\n    + Use `\\renewcommand` for `\\textlatin` with babel (#4161).\n      This avoids a clash with a deprecated `\\textlatin` command defined\n      in Babel.\n    + Allow fragile=singleslide attribute in beamer slides (#4169).\n    + Use `\\endhead` after `\\toprule` in headerless tables (#4207).\n\n  * FB2 writer:\n\n    + Add cover image specified by `cover-image` meta (Alexander Krotov,\n      #4195).\n\n  * JATS writer (Hamish Mackenzie):\n\n    + Support writing `<fig>` and `<table-wrap>` elements\n      with `<title>` and `<caption>` inside them by using Divs with class set\n      to one of `fig`, `table-wrap` or `caption` (Hamish Mackenzie).  The\n      title is included as a Heading so the constraint on where Heading can\n      occur is also relaxed.\n    + Leave out empty alt attributes on links.\n    + Deduplicate image mime type code.\n    + Make `<p>` optional in `<td>` and `<th>` (#4178).\n    + Self closing tags for empty xref (#4187).\n    + Improve support for code language.\n\n  * Custom writer:\n\n    + Use init file to setup Lua interpreter (Albert Krewinkel).\n      The same init file (`data/init`) that is used to setup the Lua\n      interpreter for Lua filters is also used to setup the interpreter of\n      custom writers.lua.\n    + Define instances for newtype wrapper (Albert Krewinkel).  The custom\n      writer used its own `ToLuaStack` instance definitions, which made\n      it difficult to share code with Lua filters, as this could result\n      in conflicting instances.  A `Stringify` wrapper is introduced to\n      avoid this problem.\n    + Added tests for custom writer.\n    + Fixed definition lists and tables in `data/sample.lua`.\n\n  * Fixed regression: when target is PDF, writer extensions were being\n    ignored.  So, for example, `pandoc -t latex-smart -o file.pdf`\n    did not work properly.\n\n  * Lua modules (Albert Krewinkel):\n\n    + Add `pandoc.utils` module, to hold utility functions.\n    + Create a Haskell module Text.Pandoc.Lua.Module.Pandoc to\n      define the `pandoc` lua module.\n    + Make a Haskell module for each Lua module. Move definitions for the\n      `pandoc.mediabag` modules to a separate Haskell module.\n    + Move `sha1` from the main `pandoc` module to `pandoc.utils`.\n    + Add function `pandoc.utils.hierarchicalize` (convert list of\n      Pandoc blocks into (hierarchical) list of Elements).\n    + Add function `pandoc.utils.normalize_date` (parses a date and\n      converts it (if possible) to \"YYYY-MM-DD\" format).\n    + Add function `pandoc.utils.to_roman_numeral` (allows conversion\n      of numbers below 4000 into roman numerals).\n    + Add function `pandoc.utils.stringify` (converts any AST element\n      to a string with formatting removed).\n    + `data/init.lua`: load `pandoc.utils` by default\n    + Turn pipe, read into full Haskell functions.  The `pipe` and `read`\n      utility functions are converted from hybrid lua/haskell functions\n      into full Haskell functions. This avoids the need for intermediate\n      `_pipe`/`_read` helper functions, which have dropped.\n    + pandoc.lua: re-add missing MetaMap function.  This was a bug\n      introduced in version 2.0.4.\n\n  * Text.Pandoc.Class: Add `insertInFileTree` [API change].  This gives\n    a pure way to insert an ersatz file into a `FileTree`.  In addition, we\n    normalize paths both on insertion and on lookup.\n\n  * Text.Pandoc.Shared: export `blocksToInlines'` (API change, Maura Bieg).\n\n  * Text.Pandoc.MIME: Add opus to MIME type table as audio/ogg (#4198).\n\n  * Text.Pandoc.Extensions:   Alphabetical order constructors for\n    `Extension`.  This makes them appear in order in `--list-extensions`.\n\n  * Allow lenient decoding of latex error logs, which are not always\n    properly UTF8-encoded (#4200).\n\n  * Update latex template to work with recent versions of beamer.\n    The old template produced numbered sections with some recent\n    versions of beamer.  Thanks to Thomas Hodgson.\n\n  * Updated reference.docx (#4175).  Instead of just \"Hello, world\", the\n    document now contains exemplars of most of the styles that have an\n    effect on pandoc documents.  This makes it easier to see the effect\n    of style changes.\n\n  * Removed `default.theme` data file (#4096).  It is no longer needed now\n    that we have `--print-highlight-style`.\n\n  * Added `stack.lts9.yaml` for building with lts 9 and ghc 8.0.2.\n    We still need this for the alpine static linux build, since\n    we don't have ghc 8.2.2 for that yet.\n\n  * Removed `stack.pkg.yaml`.  We only really need `stack.yaml`; we\n    can put flag settings for pandoc-citeproc there.\n\n  * Makefile: Add 'trypandoc' and 'pandoc-templates' targets to\n    make releases easier.\n\n  * MANUAL.txt:\n\n    + Add note on what formats have `+smart` by default.\n    + Use native syntax for custom-style (#4174, Mauro Bieg).\n    + Introduce dedicated Extensions section, since some extensions\n      affect formats other than markdown (Mauro Bieg, #4204).\n    + Clarify default html output for `--section-divs` (Richard Edwards).\n\n  * filters.md: say that Text.Pandoc.JSON comes form pandoc-types.\n    Closes jgm/pandoc-website#16.\n\n  * epub.md: Delete removed `-S` option from command (#4151, Georger Araújo).\n\n## pandoc 2.0.5 (2017-12-12)\n\n  * Fix a bug in 2.0.4, whereby pandoc could not read the theme files\n    generated with `--print-highlight-style` (#4133).  Improve JSON\n    serialization of styles.\n\n  * Fix CSS issues involving line numbers (#4128).\n    Highlighted code blocks are now enclosed in a div with class `sourceCode`.\n    Highlighting CSS no longer sets a generic color for pre and code; we only\n    set these for class `sourceCode`.\n\n  * `--pdf-engine-opt`: fix bug where option order was reversed (#4137).\n\n  * Add PowerPoint (pptx) writer (Jesse Rosenthal).\n    It works following the standard Pandoc conventions for making other\n    sorts of slides. Caveats:\n\n    + Syntax highlighting is not yet implemented. (This is difficult\n      because there are no character classes in Powerpoint.)\n    + Footnotes and Definition lists are not yet implemented. (Notes will\n      usually take the form of a final slide.\n    + Image placement and auto-resizing has a few glitches.\n    + Reference powerpoint files don't work dependably from the command\n      line. This will be implemented, but at the moment users are advised\n      to change themes from within Powerpoint.\n\n  * Create shared Text.Pandoc.Writers.OOXML module (Jesse Rosenthal).\n    This is for functions used by both Powerpoint and Docx writers.\n\n  * Add default pptx data for Powerpoint writer (Jesse Rosenthal).\n\n  * Add `empty_paragraphs` extension.\n\n    + Deprecate `--strip-empty-paragraphs` option.  Instead we now\n      use an `empty_paragraphs` extension that can be enabled on\n      the reader or writer.  By default, disabled.\n    + Add `Ext_empty_paragraphs` constructor to `Extension`.\n    + Revert \"Docx reader: don't strip out empty paragraphs.\"\n      This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b.\n    + Implement `empty_paragraphs` extension in docx reader and writer,\n      opendocument writer, html reader and writer.\n    + Add tests for `empty_paragraphs` extension.\n\n  * Markdown reader:\n\n    + Don't parse native div as table caption (#4119).\n    + Improved computation of column widths in pipe tables.\n      Pipe tables with lines longer than the text width (as set\n      by `--columns`) are now scaled to text width, with the relative\n      widths of columns determined by the ratios between the\n      header lines.  Previously we computed column widths using\n      the ratio of header line lengths to column width, so that\n      tables with narrow header lines were extremely thin, which\n      was very rarely the desired result.\n\n  * LaTeX reader: fix `\\` before newline (#4134).  This should be a space,\n    as long as it's not followed by a blank line. This has been fixed at the\n    tokenizer level.\n\n  * Muse reader (Alexander Krotov):\n\n    + Add test for `#disable-tables` directive in Emacs mode.\n    + Don't allow emphasis to be preceded by letter.\n    + Add underline support in Emacs Muse mode..\n    + Support multiline directives in Amusewiki mode\n\n  * Man writer: omit internal links (#4136).  That is, just print the link\n    text without the URL.\n\n  * Markdown reader: accept processing instructions as raw HTML (#4125).\n\n  * Lua filters (Albert Krewinkel):\n\n    + Use script to initialize the interpreter.  The file `init.lua` is\n      used to initialize the Lua interpreter which is used in Lua filters.\n      This gives users the option to require libraries which they want to\n      use in all of their filters, and to extend default modules.\n    + Fix package loading for Lua 5.1.  The list of package searchers is\n      named `package.loaders` in Lua 5.1 and LuaJIT, and `package.searchers`\n      in Lua 5.2 and later.\n    + Refactor lua module handling.  The integration with Lua's package/module\n      system is improved: A pandoc-specific package searcher is prepended to\n      the searchers in `package.searchers`. The modules `pandoc` and\n      `pandoc.mediabag` can now be loaded via `require`.\n    + Bump lower bound of hslua.  The release hslua 0.9.3 contains a new\n      function which makes using Haskell functions as package loaders much\n      easier.\n\n  * reveal.js template:  add title-slide identifier to title slide (#4120).\n    This allows it to be styled more easily.\n\n  * LaTeX template: Added support for `pagestyle` variable (#4135,\n    Thomas Hodgson)\n\n  * Add `-threaded` to ghc-options for executable (#4130, fixes a build\n    error on linux).\n\n\n## pandoc 2.0.4 (2017-12-03)\n\n  * Add `--print-highlight-style` option.  This generates a JSON version\n    of a highlighting style, which can be saved as a `.theme` file, modified,\n    and used with `--highlight-style` (#4106, #4096).\n\n  * Add `--strip-empty-paragraphs` option.  This works for any input format.\n    It is primarily intended for use with docx and odt documents where\n    empty paragraphs have been used for inter-paragraph spaces.\n\n  * Support `--webtex` for `gfm` output.\n\n  * Recognize `.muse` file extension.\n\n  * Support beamer `\\alert` in LaTeX reader. Closes #4091.\n\n  * Docx reader: don't strip out empty paragraphs (#2252).\n    Users who have a conversion pipeline from docx may want to consider adding\n    `--strip-empty-paragraphs` to the command line.\n\n  * Org reader (Albert Krewinkel): Allow empty list items (#4090).\n\n  * Muse reader (Alexander Krotov):\n\n    + Parse markup in definition list terms.\n    + Allow definition to end with EOF.\n    + Make code blocks round trip.\n    + Drop common space prefix from list items.\n    + Add partial round trip test.\n    + Don't interpret XML entities.\n    + Remove `nested`.\n    + Parse `~~` as non-breaking space in Emacs mode.\n    + Correctly remove indentation from notes.  Exactly one space is\n      required and considered to be part of the marker.\n    + Allow list items to be empty.\n    + Add ordered list test.\n    + Add more multiline definition tests.\n    + Don't allow blockquotes within lists.\n    + Fix reading of multiline definitions.\n    + Add inline `<literal>` support.\n    + Concatenate inlines of the same type\n\n  * Docx writer: allow empty paragraphs (#2252).\n\n  * CommonMark/gfm writer:\n\n    + Use raw html for native divs/spans (#4113).  This allows a pandoc\n      markdown native div or span to be rendered in gfm using raw html tags.\n    + Implement `raw_html` and `raw_tex` extensions.  Note that `raw_html`\n      is enabled by default for `gfm`, while `raw_tex` is disabled by default.\n\n  * Muse writer (Alexander Krotov):\n\n    + Test that inline math conversion result is normalized.\n      Without normalization this test produced\n      `<em>a</em><em>b</em><em>c</em>`.\n    + Improve inline list normalization and move to writer.\n    + Escape hash symbol.\n    + Escape `----` to avoid accidental horizontal rules.\n    + Escape only `</code>` inside code tag.\n    + Additional `<verbatim>` is not needed as `<code>` is verbatim already.\n\n  * LaTeX writer:\n\n    + Allow specifying just width or height for image size.\n      Previously both needed to be specified (unless the image was\n      being resized to be smaller than its original size).\n      If height but not width is specified, we now set width to\n      textwidth. If width but not height is specified, we now set\n      height to textheight.  Since we have `keepaspectratio`, this\n      yields the desired result.\n    + Escape `~` and `_` in code with `--listings` (#4111).\n\n  * HTML writer: export `tagWithAttributes`.  This is a helper allowing\n    other writers to create single HTML tags.\n\n  * Let papersizes `a0`, `a1`, `a2`, ... be case-insensitive by\n    converting the case as needed in LaTeX and ConTeXt writers.\n\n  * Change `fixDisplayMath` from `Text.Pandoc.Writers.Shared`\n    so that it no longer produces empty `Para`'s as an artifact.\n\n  * `Text.Pandoc.Shared.blocksToInlines`:  rewrote using builder.\n    This gives us automatic normalization, so we don't get\n    for example two consecutive Spaces.\n\n  * Include default CSS for 'underline' class in HTML-based templates.\n\n  * revealjs template:  add `tex2jax` configuration for the\n    math plugin.  With the next release of reveal.js, this will\n    fix the problem of `$`s outside of math contexts being\n    interpreted as math delimiters (#4027).\n\n  * `pandoc.lua` module for use in lua filters (Albert Krewinkel):\n\n    + Add basic lua List module (#4099, #4081).  The List module is\n      automatically loaded, but not assigned to a global variable. It can be\n      included in filters by calling `List = require 'List'`.  Lists of blocks,\n      lists of inlines, and lists of classes are now given `List` as a metatable,\n      making working with them more convenient.  E.g., it is now possible to\n      concatenate lists of inlines using Lua's concatenation operator `..`\n      (requires at least one of the operants to have `List` as a metatable):\n\n          function Emph (emph)\n            local s = {pandoc.Space(), pandoc.Str 'emphasized'}\n            return pandoc.Span(emph.content .. s)\n          end\n\n      The `List` metatable is assigned to the tables which get passed to\n      the constructors `MetaBlocks`, `MetaInline`, and `MetaList`. This\n      enables the use of the resulting objects as lists.\n    + `Lua/StackInstances`: push Pandoc and Meta via constructor.\n      Pandoc and Meta elements are now pushed by calling the respective\n      constructor functions of the pandoc Lua module. This makes serialization\n      consistent with the way blocks and inlines are pushed to lua and allows\n      to use List methods with the `blocks` value.\n    + Add documentation for pandoc.List in `lua-filters.md`.\n\n  * Use latest tagsoup.  This fixes a bug in parsing HTML tags with\n    `&` (but not a valid entity) following them (#4094, #4088).\n\n  * Use skylighting 0.4.4.1, fixing the color of unmarked code text\n    when `numberLines` is used (#4103).\n\n  * Make `normalizeDate` more forgiving (Mauro Bieg, #4101), not\n    requiring a leading 0 on single-digit days.\n\n  * Fix `--help` output for `--highlight-style` to include `FILE` (Mauro\n    Bieg, #4095).\n\n  * Clearer deprecation warning for `--latexmathml, --asciimathml, -m`.\n    Previously we only mentioned `--latexmathml`, even if `-m` was\n    used.\n\n  * Changelog: fix description of lua filters in 2.0 release\n    (Albert Krewinkel).  Lua filters were initially run *after* conventional\n    (JSON) filters.  However, this was changed later to make it easier to deal\n    with files in the mediabag. The changelog is updated to describe that\n    feature of the 2.0 release correctly.\n\n  * Change Generic JSON instances to TemplateHaskell (Jasper Van der Jeugt,\n    #4085).  This reduces compile time and memory usage significantly.\n\n  * `lua-filters.md`: Added tikz filter example.\n\n  * Create alternative zip file for macOS binaries.\n\n  * Create alternative zip file for Windows binaries.\n\n  * Update INSTALL.md since we now provide zips for binaries.\n\n  * Relax `http-types` dependency (Justus Sagemüller, #4084).\n\n  * Add `epub.md`, `getting-started.md` to docs.  These used to live in\n    the website repo.\n\n  * Add `packages` target to Makefile.\n\n  * Bump bounds for binary, http-types, tasty-hunit\n\n## pandoc 2.0.3 (2017-11-20)\n\n  * Lua filters: preload text module (Albert Krewinkel, #4077).\n    The `text` module is preloaded in lua. The module contains some UTF-8\n    aware string functions, implemented in Haskell.  The module is loaded on\n    request only, e.g.:\n\n        text = require 'text'\n        function Str (s)\n          s.text = text.upper(s.text)\n          return s\n        end\n\n  * Allow table-like access to attributes in lua filters (Albert Krewinkel,\n    #4071).  Attribute lists are represented as associative lists in Lua. Pure\n    associative lists are awkward to work with. A metatable is attached to\n    attribute lists, allowing to access and use the associative list as if\n    the attributes were stored in as normal key-value pair in table.\n    Note that this changes the way `pairs` works on attribute lists. Instead\n    of producing integer keys and two-element tables, the resulting iterator\n    function now returns the key and value of those pairs.  Use `ipairs` to\n    get the old behavior.  Warning: the new iteration mechanism only works if\n    pandoc has been compiled with Lua 5.2 or later (current default: 5.3).\n\n  * Text.Pandoc.Parsing.uri:  allow `&` and `=` as word characters (#4068).\n    This fixes a bug where pandoc would stop parsing a URI with an\n    empty attribute:  for example, `&a=&b=` wolud stop at `a`.\n    (The uri parser tries to guess which punctuation characters\n    are part of the URI and which might be punctuation after it.)\n\n  * Introduce `HasSyntaxExtensions` typeclass (Alexander Krotov, #4074).\n\n    + Added new `HasSyntaxExtensions` typeclass for `ReaderOptions` and\n      `WriterOptions`.\n    + Reimplemented `isEnabled` function from `Options.hs` to accept both\n      `ReaderOptions` and `WriterOptions`.\n    + Replaced `enabled` from `CommonMark.hs` with new `isEnabled`.\n\n  * Add `amuse` extension (Alexander Krotov) to enable Amuse wiki\n    behavior for `muse`.  New `Ext_amuse` constructor for\n    `Extension`. Note: this is switched on by default; for\n    Emacs behavior, use `muse-amuse`.\n\n  * Muse reader (Alexander Krotov):\n\n    + Count only one space as part of list item marker.\n    + Produce SoftBreaks on newlines. Now wrapping can be preserved\n      with `--wrap=preserve`.\n    + Add Text::Amuse footnote extensions.  Footnote end is indicated by\n      indentation, so footnotes can be placed anywhere in the text,\n      not just at the end of it.\n    + Accept Emacs Muse definition lists when `-amuse`.\n      Emacs Muse does not require indentation.\n\n  * HTML reader:\n\n    + Ensure we don't produce level 0 headers (#4076), even for chapter\n      sections in epubs.  This causes problems because writers aren't set\n      up to expect these.\n    + Allow spaces after `\\(` and before `\\)` with `tex_math_single_backslash`.\n      Previously `\\( \\frac{1}{a} < \\frac{1}{b} \\)` was not parsed as math in\n      `markdown` or `html` `+tex_math_single_backslash`.\n\n  * MANUAL: clarify that math extensions work with HTML.\n    Clarify that `tex_math_dollars` and `tex_math_single_backslash`\n    will work with HTML as well as Markdown.\n\n  * Creole reader: Fix performance issue for longer lists (Sascha Wilde,\n    #4067).\n\n  * RST reader: better support for 'container' directive (#4066).\n    Create a div, incorporate name attribute and classes.\n\n  * LaTeX reader:\n\n    + Support column specs like `*{2}{r}` (#4056).  This is equivalent to\n      `rr`.  We now expand it like a macro.\n    + Allow optional args for parbox (#4056).\n    + Allow optional arguments on `\\footnote` (#4062).\n\n  * EPUB writer: Fixed path for cover image (#4069).  It was previously\n    `media/media/imagename`, and should have been `media/imagename`.\n\n  * Markdown writer: fix bug with doubled footnotes in grid tables\n    (#4061).\n\n  * LaTeX template:  include natbib/biblatex after polyglossia (#4073).\n    Otherwise we seem to get an error; biblatex wants polyglossia\n    language to be defined.\n\n  * Added examples to lua filters documentation.\n\n\n## pandoc 2.0.2 (2017-11-12)\n\n  * Deprecated ancient HTML math methods: `--latexmathml`, `--gladtex`,\n    `--mimetex`, `--jsmath`.\n\n  * Fixed URIs in `data/jats.csl`.  They were being rendered twice,\n    leading to invalid XML in default JATS output with pandoc-citeproc.\n\n  * `lua-filters.md`: use real-world man page filter as example.\n\n  * Add lua filter functions `walk_inline` and `walk_block`\n    in the pandoc module, to apply filters inside particular\n    inline and block elements.\n\n  * Refactored some code from `Text.Pandoc.Lua.PandocModule`\n    into new internal module `Text.Pandoc.Lua.Filter`.\n\n  * Markdown reader:\n\n    + Allow fenced code blocks to be indented 1-3 spaces (#4011).\n      This brings our handling of them into alignment with CommonMark's.\n    + Fix YAML metadata with \"chomp\" (`|-`).  Previously if a\n      YAML block under `|-` contained a blank line, pandoc would\n      not parse it as metadata.\n\n  * Removed `etc.` from abbreviations file.  Often `etc.` ends a\n    sentence, and we want the period to be treated as a\n    sentence-ending period.\n\n  * Fix regression with `--metadata` (#4054).  Values specified with\n    `--metadata` should replace a metadata value set in the document\n    itself, rather than creating a list including a new value.\n\n  * EPUB writer:\n\n    + Fix EPUB OCF structure.  #3720 had been improperly implemented.\n    + Fix modified paths for raw HTML tags (src, poster, etc.)\n      (#4050, #4055). This had not been updated for the new EPUB\n      container layout, with a separate text/ subdirectory.\n    + Fix image paths with empty `--epub-subdirectory`.\n\n  * Miscellaneous code cleanup (Alexander Krotov).\n\n  * Use pandoc-types 1.17.3, which adds `Walkable` instances\n    for `[Block] Block` and `[Inline] Inline`.\n\n  * Remove obsolete `stack.full.yaml` (#4052).\n\n  * Change to using pandoc-citeproc 0.12.1 in binary packages.\n\n  * Consolidate math output method documentation (#4049, Mauro Bieg).\n\n  * `MANUAL.txt`: fix header level of \"Extension: emoji\" (Albert Krewinkel).\n\n  * Use lua filter to generate man page from `MANUAL.txt`, replacing old\n    Haskell filters.  This is easier and faster.\n\n  * Improved `INSTALL.md`.\n\n  * Update commands to extract deb archive on Linux (#4043, Salim B).\n\n\n## pandoc 2.0.1.1 (2017-11-04)\n\n  * Improved fix to #3989 (parsing of HTML tags containing\n    `>` in an attribute or comment). The previous fix (in 2.0.1) only\n    worked in certain cases.\n\n  * FB2 writer (Alexander Krotov):\n\n    + Add `unrecognised` genre to `<title-info>`\n      (Alexander Krotov).  XML schema requires at least one genre.\n    + Remove `<annotation>` from `<body>`.\n\n  * CommonMark writer: fix strikethrough for `gfm` (#4038).\n\n  * Use texmath 0.10, which adds support for a wider range of\n    symbols and fixes default column alignments in MathML\n    and OMML.\n\n  * Highlighting fixes, using skylighting 0.4.3.2:\n\n    + Fix invalid CSS.\n    + Support `lineAnchors` (or `line-anchors`) in HTML code blocks.\n    + Ensure that code lines don't get duplicate identifiers (#4031).\n      The line identifiers are built using the code block's identifier\n      as a prefix. If the code block has null identifier, we use\n      `cb1`, `cb2`, etc.\n\n  * Added a few abbreviations to `data/abbreviations`,\n    and sorted the list (#3984, Wandmalfarbe).\n\n  * Improved support for columns in HTML writer (#4028).\n\n    + Remove `width` attribute from the `div`.\n    + Remove space between `<div class=\"column\">` elements,\n      since this prevents columns whose widths sum to 100%\n      (the space takes up space).\n    + Move as much as possible of the CSS to the template.\n    + Ensure that all the HTML-based templates (including epub)\n      contain the CSS for columns.\n    + Columns default to 50% width unless they are given a width\n      attribute.  So if you want two equal-width columns, you\n      can use a div with class `column` and no `width` attribute.\n\n  * SelfContained: use `base64` for css links with media attribute (#4026).\n    This fixes `--self-contained` with S5.\n\n  * Improve `pandoc-template-mode.el` (Vaclav Haisman).\n\n  * INSTALL.md: MacOS instructions needed xar -f (adam234).\n\n  * MANUAL.txt:\n\n    + Clarify that --setext-headers doesn't affect gfm output (#4035).\n    + Clarify what is needed to open and close a div in `fenced_divs`\n      (#4039, Tristano Ajmone).\n    + Removed reference to `default.beamer` in docs (#4024).\n      Also added mention of other templates affecting PDF output\n      with different settings.\n\n\n## pandoc 2.0.1 (2017-10-31)\n\n  * Fixed regression in parsing of HTML comments in markdown and other\n    non-HTML formats (`Text.Pandoc.Readers.HTML.htmlTag`) (#4019).\n    The parser stopped at the first `>` character, even if it wasn't\n    the end of the comment.\n\n  * Creole reader (Sascha Wilde):\n\n    + Fix some minor typos and formatting.\n    + Add additional test on nowiki-block after para.\n    + Fix lists with trailing white space.\n\n  * LaTeX reader: handle `%` comment right after command.\n    For example, `\\emph%`.\n\n  * Markdown reader:  make sure fenced div closers work in lists.\n    Previously the following failed:\n\n        ::: {.class}\n        1. one\n        2. two\n        :::\n\n    and you needed a blank line before the closing `:::`.\n\n  * Make `fenced_divs` affect the Markdown writer.  If `fenced_divs` is\n    enabled, Divs will be rendered as fenced divs.\n\n  * LaTeX/Beamer writer: support \"blocks\" inside columns and other Divs\n    (#4016).\n\n  * HTML Writer: consistently use dashed class-names (Mauro Bieg, #3556).\n    Note: this change may require some changes in CSS rules.\n    `footnoteRef` has become `footnote-ref`, `titleslide` has\n    become `title-slide`, and `footnoteBack` has become `footnote-back`.\n\n  * JATS writer: Properly pass through author metadata (#4020).\n\n  * FB2 writer (Alexander Krotov):\n\n    + Write blocks outside of `<p>` in definitions.\n    + Make bullet lists consistent with ordered lists, repeating\n      the marker for the outer list rather than indenting sublists,\n      since indentation does not work in readers.\n    + Add new style FB2 tests.\n\n  * `Text.Pandoc.ImageSize`: Add `Millimeter` constructor to `Dimension`\n    (#4012) [API change]. Now sizes given in 'mm' are no longer converted\n    to 'cm'.\n\n  * Revise documentation of small caps syntax (Andrew Dunning, #4013).\n\n  * Fix broken reference links in manual (Andrew Dunning, #4014)\n\n  * Fixed example of slide columns structure in changelog (#4015).\n    Also documented this feature in MANUAL.txt.\n\n\n## pandoc 2.0.0.1 (2017-10-30)\n\n  * EPUB writer:\n\n    + Fixed filepaths for nonstandard epub-subdirectory values.\n    + Ensure that epub2 is recognized as a non-text format,\n      so that a template is used.\n    + Don't include \"prefix\" attribute for ibooks for epub2.\n      It doesn't validate.\n    + Fix stylesheet paths; previously we had an incorrect\n      stylesheet path for the cover page and nav page.\n\n  * LaTeX reader:\n\n    + Insert space when needed in macro expansion (#4007).\n      Sometimes we need to insert a space after a control sequence\n      to prevent it merging with a following letter.\n    + Allow unbraced arguments for macros (#4007).\n    + Allow body of macro definition to be unbraced (#4007).\n\n  * Linux package build: ensure that pandoc-citeproc is statically linked.\n\n  * trypandoc: add native, ms.\n\n\n## pandoc 2.0 (2017-10-29)\n\n### New features\n\n  * New output format `ms` (groff ms). Complete support, including\n    tables, math, syntax highlighting, and PDF bookmarks. The writer uses\n    texmath's new eqn writer to convert math to eqn format, so a ms file\n    produced with this writer should be processed with `groff -ms -e` if\n    it contains math.\n\n  * New output format `jats` (Journal Article Tag Suite).  This is an XML\n    format used in archiving and publishing articles.  Note that a\n    URI-encoded CSL stylesheet (`data/jats.csl`) is added automatically\n    unless a stylesheet is specified using `--css`.\n\n  * New output format `gfm` (GitHub-flavored CommonMark) (#3841).\n    This uses bindings to GitHub's fork of cmark, so it should parse\n    gfm exactly as GitHub does (excepting certain postprocessing\n    steps, involving notifications, emojis, etc.).  `markdown_github`\n    has been deprecated in favor of `gfm`.\n\n  * New output format `muse` (Emacs Muse) (Alexander Krotov, #3489).\n\n  * New input format `gfm` (GitHub-flavored CommonMark) (#3841).\n    This uses bindings to GitHub's fork of cmark.  `markdown_github`\n    has been deprecated in favor of `gfm`.\n\n  * New input format `muse` (Emacs Muse) reader (Alexander Krotov, #3620).\n\n  * New input format `tikiwiki` (TikiWiki markup) (rlpowell, #3800).\n\n  * New input format `vimwiki` (Vimwiki markup) (Yuchen Pei, #3705).\n    Note that there is a new data file, `data/vimwiki.css`, which can\n    be used to display the HTML produced by this reader and\n    pandoc's HTML writer in the style of vimwiki's own HTML\n    export.\n\n  * New input format `creole` (Creole 1.0) (#3994, Sascha Wilde).\n\n  * New syntax for Divs, with `fenced_divs` extension enabled by\n    default (#168).  This gives an attractive, plain-text way to create\n    containers for block-level content.\n\n  * Added new syntax for including raw content in any output format,\n    enabled by the `raw_attribute` extension (which is on by default\n    for `markdown` and `multimarkdown`).  The syntax is the same as\n    for fenced code blocks or code inlines, only with `{=FORMAT}` for\n    attributes, where `FORMAT` is the name of the output format\n    (e.g., `ms`, `html`).\n\n  * Implement multicolumn support for slide formats (#1710).\n    The structure expected is:\n\n        :::::::::::::: {.columns}\n        ::: {.column width=\"40%\"}\n        contents...\n        :::\n        ::: {.column width=\"60%\"}\n        contents...\n        :::\n        ::::::::::::::\n\n    Support has been added for beamer and all HTML slide formats.\n\n  * Allows line comments in templates, beginning with `$--` (#3806).\n    (Requires doctemplates 0.2.1.)\n\n  * Add `--eol=crlf|lf|native` flag and writer option to control line endings\n    (Stefan Dresselhaus, #3663, #2097).\n\n  * Add `--log` option to save log messages in JSON format to a file (#3392).\n\n  * Add `--request-header` option, to set request headers when pandoc\n    makes HTTP requests to fetch external resources. For example:\n    `--request-header User-Agent:blah`.\n\n  * Added lua filters (Albert Krewinkel, #3514).  The new `--lua-filter`\n    option works like `--filter` but takes pathnames of special lua filters\n    and uses the lua interpreter baked into pandoc, so that no external\n    interpreter is needed.  Note that lua filters are all applied after\n    regular filters, regardless of their position on the command line.\n    For documentation of lua filters, see `doc/lua-filters.md`.\n\n  * Set `PANDOC_READER_OPTIONS` in environment where filters are run.\n    This contains a JSON representation of `ReaderOptions`, so filters\n    can access it.\n\n  * Support creation of pdf via groff `ms` and pdfroff.\n    `pandoc -t ms -o output.pdf input.txt`.\n\n  * Support for PDF generation via HTML and `weasyprint` or `prince`\n    (Mauro Bieg, #3909).  `pandoc -t html5 -o output.pdf --pdf-engine=prince`.\n\n  * Added `--epub-subdirectory` option (#3720).  This specifies the\n    subdirectory in the OCF container that holds the EPUB specific content.\n    We now put all EPUB related content in an `EPUB/` subdirectory by default\n    (later this will be configurable).\n\n    ```\n      mimetype\n      META-INF/\n        com.apple.ibooks.display-options.xml\n        container.xml\n      EPUB/ <<--configurable-->>\n        fonts/ <<--static-->>\n        font.otf\n      media/ <<--static-->>\n        cover.jpg\n        fig1.jpg\n      styles/ <<--static-->>\n        stylesheet.css\n      content.opf\n      toc.ncx\n      text/ <<--static-->>\n        ch001.xhtml\n    ```\n\n  * Added `--resource-path=SEARCHPATH` command line option (#852).\n    SEARCHPATH is separated by the usual character, depending on OS\n    (: on unix, ; on windows).  Default resource path is just working\n    directory.  However, the working directory must be explicitly\n    specified if the `--resource-path` option is used.\n\n  * Added --abbreviations=FILE option for custom abbreviations file\n    (#256).  Dfault abbreviations file (`data/abbreviations`) contains\n    a list of strings that will be recognized by pandoc's\n    Markdown parser as abbreviations.  (A nonbreaking space will\n    be inserted after the period, preventing a sentence space in\n    formats like LaTeX.) Users can override the default by putting a file\n    abbreviations in their user data directory (`~/.pandoc` on *nix).\n\n  * Allow a theme file as argument to `--highlight-style`.\n    Also include a sample, `default.theme`, in `data/`.\n\n  * Allow `--syntax-definition` option for dynamic loading of syntax\n    highlighting definitions (#3334).\n\n  * Lists in `markdown` by default now use the CommonMark variable\n    nesting rules (#3511). The indentation required for a block-level\n    item to be included in a list item is no longer fixed, but is\n    determined by the first line of the list item.  To be included in\n    the list item, a block must be indented to the level of the first\n    non-space content after the list marker. Exception: if are 5 or more\n    spaces after the list marker, then the content is interpreted as an\n    indented code block, and continuation paragraphs must be indented\n    two spaces beyond the end of the list marker.  See the CommonMark\n    spec for more details and examples.\n\n    Documents that adhere to the four-space rule should, in most cases,\n    be parsed the same way by the new rules.  Here are some examples\n    of texts that will be parsed differently:\n\n        - a\n          - b\n\n    will be parsed as a list item with a sublist; under the four-space\n    rule, it would be a list with two items.\n\n        - a\n\n              code\n\n    Here we have an indented code block under the list item, even though it\n    is only indented six spaces from the margin, because it is four spaces\n    past the point where a continuation paragraph could begin.  With the\n    four-space rule, this would be a regular paragraph rather than a code\n    block.\n\n        - a\n\n                code\n\n    Here the code block will start with two spaces, whereas under\n    the four-space rule, it would start with `code`.  With the four-space\n    rule, indented code under a list item always must be indented eight\n    spaces from the margin, while the new rules require only that it\n    be indented four spaces from the beginning of the first non-space\n    text after the list marker (here, `a`).\n\n    This change was motivated by a slew of bug reports from people\n    who expected lists to work differently (#3125, #2367, #2575, #2210,\n     #1990, #1137, #744, #172, #137, #128) and by the growing prevalance\n    of CommonMark (now used by GitHub, for example).  Those who\n    prefer the old behavior can use `-f markdown+four_space_rule`.\n\n  * Added `four_space_rule` extension.  This triggers the old pandoc\n    parsing rule for content nested under list items (the \"four space\n    rule\").\n\n  * Added `spaced_reference_links` extension (#2602).  It allows whitespace\n    between the two parts of a reference link:  e.g.\n\n        [a] [b]\n\n        [b]: url\n\n    This was previously enabled by default; now it is forbidden by default.\n\n  * Add `space_in_atx_header` extension (#3512).  This is enabled by default\n    in pandoc and GitHub markdown but not the other flavors.\n    This requirse a space between the opening #'s and the header\n    text in ATX headers (as CommonMark does but many other implementations\n    do not).  This is desirable to avoid falsely capturing things ilke\n\n        #hashtag\n\n    or\n\n        #5\n\n  * Add `sourcefile` and `outputfile` template variables (Roland Hieber,\n    #3431).\n\n  * Allow ibooks-specific metadata in epubs (#2693).  You can now have\n    the following fields in your YAML metadata, and it will be treated\n    appropriately in the generated EPUB:\n\n    ```\n      ibooks:\n        version: 1.3.4\n        specified-fonts: false\n        ipad-orientation-lock: portrait-only\n        iphone-orientation-lock: landscape-only\n        binding: true\n        scroll-axis: vertical\n    ```\n\n\n### Behavior changes\n\n  * Reader functions no longer presuppose that CRs have been\n    stripped from the input. (They strip CRs themselves, before\n    parsing, to simplify the parsers.)\n\n  * Added support for translations (localization) (#3559).\n    Currently this only affects the LaTeX reader, for things\n    like `\\figurename`.  Translation data files for 46 languages\n    can be found in `data/translations`.\n\n  * Make `--ascii` work with DocBook output too.\n\n  * Rename `--latex-engine` to `--pdf-engine`,\n    and `--latex-engine-opt` to `--pdf-engine-opt`.\n\n  * Removed `--parse-raw` and `readerParseRaw`.  These were confusing.\n    Now we rely on the `+raw_tex` or `+raw_html` extension with latex or html\n    input.  Thus, instead of `--parse-raw -f latex` we use `-f latex+raw_tex`,\n    and instead of `--parse-raw -f html` we use `-f html+raw_html`.\n\n  * With `--filter` R filters are now recognized, even if they are\n    not executable (#3940, #3941, Andrie de Vries).\n\n  * Support SVG in PDF output, converting with `rsvg2pdf` (#1793).\n\n  * Make epub an alias for epub3, not epub2.\n\n  * Removed `--epub-stylesheet`; use `--css` instead (#3472, #847).\n    Multiple stylesheets may be used.  Stylesheets will be taken both from\n    `--css` and from the `stylesheet` metadata field (which can contain\n    either a file path or a list of them).\n\n  * `--mathml` and MathML in HTMLMathMethod no longer take an argument.\n    The argument was for a bridge JavaScript that used to be necessary\n    in 2004.  We have removed the script already.\n\n  * `--katex` improvements.  The latest version is used, and the\n    autoload script is loaded by default.\n\n  * Change MathJax CDN default since old one is shutting down (#3544).\n    Note:  The new URL requires a version number, which we'll have\n    to update manually in subsequent pandoc releases in order to\n    take advantage of mathjax improvements.\n\n  * `--self-contained`: don't incorporate elements with `data-external=\"1\"`\n    (#2656).  You can leave an external link as it is by adding the attribute\n    data-external=\"1\" to the element.  Pandoc will then not try to\n    incorporate its content when `--self-contained` is used.  This is\n    similar to a feature already supported by the EPUB writer.\n\n  * Allow `--extract-media` to work with non-binary input formats\n    (#1583, #2289).  If `--extract-media` is supplied with a non-binary\n    input format, pandoc will attempt to extract the contents of all\n    linked images, whether in local files, data: uris, or external uris.\n    They will be named based on the sha1 hash of the contents.\n\n  * Make `papersize: a4` work regardless of the case of `a4`.\n    It is converted to `a4` in LaTeX and `A4` in ConTeXt.\n\n  * Make `east_asian_line_breaks` affect all readers/writers (#3703).\n\n  * Underlined elements are now treated consistently by readers\n    (#2270, hftf); they are always put in a Span with class `underline`.\n    This allows the user to treat them differently from other emphasis,\n    using a filter.  Docx, Org, Textile, Txt2Tags, and HTML readers\n    have been changed.\n\n  * Improved behavior of `auto_identifiers` when there are explicit ids\n    (#1745).  Previously only autogenerated ids were added to the list\n    of header identifiers in state, so explicit ids weren't taken\n    into account when generating unique identifiers.  Duplicated\n    identifiers could result.  This simple fix ensures that explicitly given\n    identifiers are also taken into account.\n\n  * Use `table-of-contents` for contents of toc, make `toc` a boolean\n    (#2872).  Changed markdown, rtf, and HTML-based templates accordingly.\n    This allows you to set `toc: true` in the metadata; this\n    previously produced strange results in some output formats.\n    For backwards compatibility, `toc` is still set to the\n    toc contents.  But it is recommended that you update templates\n    to use `table-of-contents` for the toc contents and `toc`\n    for a boolean flag.\n\n  * Change behavior with binary format output to stdout.\n    Previously, for binary formats, output to stdout was disabled\n    unless we could detect that the output was being piped (and not\n    sent to the terminal).  Unfortunately, such detection is not\n    possible on Windows, leaving windows users no way to pipe binary\n    output.  So we have changed the behavior in the following way:\n\n    + Output to stdout is allowed when it can be determined that\n      the output is being piped (on non-Windows platforms).\n    + If the `-o` option is not used, binary output is never sent\n      to stdout by default; instead, an error is raised.\n    + If `-o -` is used, binary output is sent to stdout, regardless\n      of whether it is being piped. This works on Windows too.\n\n  * Better error behavior:  uses of `error` have been replaced by\n    raising of `PandocError`, which can be trapped and handled by the\n    calling program.\n\n  * Removed `hard_line_breaks` extension from `markdown_github` (#3594).\n    GitHub has two Markdown modes, one for long-form documents like READMEs\n    and one for short things like issue comments. In issue comments, a line\n    break is treated as a hard line break. In README, wikis, etc., it is\n    treated as a space as in regular Markdown.  Since pandoc is more likely to\n    be used to convert long-form documents from GitHub Markdown,\n    `-hard_line_breaks` is a better default.\n\n  * Include `backtick_code_blocks` extension in `mardkown_mmd` (#3637).\n\n  * Escape `MetaString` values (as added with `-M/--metadata` flag) (#3792).\n    Previously they would be transmitted to the template without any\n    escaping.  Note that `--M title='*foo*'` yields a different result from\n\n        ---\n        title: *foo*\n        ---\n\n    In the latter case, we have emphasis; in the former case, just\n    a string with literal asterisks (which will be escaped\n    in formats, like Markdown, that require it).\n\n  * Allow `em`, `cm`, `in` for image height/width in HTML, LaTeX (#3450).\n\n  * HTML writer: Insert `data-` in front of unsupported attributes.  Thus,\n    a span with attribute `foo` gets written to HTML5 with `data-foo`, so\n    it is valid HTML5.  HTML4 is not affected.  This will allow us to use\n    custom attributes in pandoc without producing invalid HTML. (With help\n    from Wandmalfarbe, #3817.)\n\n  * Plain writer:  improved super/subscript rendering.  We now\n    handle more non-digit characters for which there are\n    sub/superscripted unicode characters.  When unicode\n    sub/superscripted characters are not available, we use\n    `_(..)` or `^(..)` (#3518).\n\n  * Docbook, JATS, TEI writers: print INFO message when omitting interior\n    header (#3750).  This only applies to section headers inside list items,\n    e.g., which were otherwise silently omitted.\n\n  * Change to `--reference-links` in Markdown writer (#3701).  With\n    `--reference-location` of `section` or `block`, pandoc will now repeat\n    references that have been used in earlier sections.  The Markdown\n    reader has also been modified, so that *exactly* repeated references\n    do not generate a warning, only references with the same label but\n    different targets.  The idea is that, with references after every block,\n    one might want to repeat references sometimes.\n\n  * ODT/OpenDocument writer:\n\n    + Support `lang` attribute (#1667).\n    + Added support for `--toc` (#2836).  Thanks to @anayrat.\n\n  * Docx writer:\n\n    + `lang` meta, see #1667 (Mauro Bieg, #3515).\n    + Change `FigureWithCaption` to `CaptionedFigure` (iandol, #3658).\n    + Use `Table` rather than `Table Normal` for table style (#3275).\n      `Table Normal` is the default table style and can't be modified.\n    + Pass through comments (#2994).  We assume that comments are defined as\n      parsed by the docx reader:\n\n        I want <span class=\"comment-start\" id=\"0\" author=\"Jesse Rosenthal\"\n        date=\"2016-05-09T16:13:00Z\">I left a comment.</span>some text to\n        have a comment <span class=\"comment-end\" id=\"0\"></span>on it.\n\n      We assume also that the id attributes are unique and properly\n      matched between comment-start and comment-end.\n    + Bookmark improvements.  Bookmark start/end now surrounds content rather\n      than preceding it.  Bookmarks generated for Div with id\n      (jgm/pandoc-citeproc#205).\n    + Add `keywords` metadata to docx document properties (Ian).\n\n  * RST writer: support unknown interpreted text roles by\n    parsing them as `Span` with `role` attributes (#3407).  This\n    way they can be manipulated in the AST.\n\n  * HTML writer:\n\n    + Line block: Use class instead of style attribute (#1623).  We now\n      issue `<div class=\"line-block\">` and include a default definition\n      for `line-block` in the default templates, instead of hard-coding a\n      `style` on the div.\n    + Add class `footnoteBack` to footnote back references (Timm Albers).\n      This allows for easier CSS styling.\n    + Render SmallCaps as span with smallcaps class (#1592), rather than\n      using a style attribute directly.  This gives the user more flexibility\n      in styling small caps in CSS.\n    + With reveal.js we use `data-src` instead of `src` for images for\n      lazy loading.\n    + Special-case `.stretch` class for images in reveal.js (#1291).\n      Now in reveal.js, an image with class `stretch` in a paragraph\n      by itself will stretch to fill the whole screen, with no\n      caption or figure environment.\n\n  * Added warnings for non-rendered blocks to writers.\n\n  * Writers now raise an error on template failure.\n\n  * When creating a PDF via LaTeX, warn if the font is missing some\n    characters (#3742).\n\n  * Remove initial check for PDF-creating program (#3819).\n    Instead, just try running it and raise the exception if it\n    isn't found at that point.  This improves things for users of Cygwin\n    on Windows, where the executable won't be found by `findExecutable`\n    unless `.exe` is added.  The same exception is raised as before, but\n    at a later point.\n\n  * Readers issue warning for duplicate header identifiers (#1745).\n    Autogenerated header identifiers are given suffixes so as not to clash\n    with previously used header identifiers. But they may still coincide with\n    an explicit identifier that is given for a header later in the document,\n    or with an identifier on a div, span, link, or image. We now issue\n    a warning in this case, so users can supply an explicit identifier.\n\n  * CommonMark reader now supports `emoji`, `hard_line_breaks`, `smart`,\n    and `raw_html` extensions.\n\n  * Markdown reader:\n\n    + Don't allow backslash + newline to affect block structure (#3730).\n      Note that as a result of this change, the following, which formerly\n      produced a header with two lines separated by a line break, will\n      now produce a header followed by a paragraph:\n\n        # Hi\\\n        there\n\n      This may affect some existing documents that relied on\n      this undocumented and unintended behavior.  This change makes pandoc\n      more consistent with other Markdown implementations, and with itself\n      (since the two-space version of a line break doesn't work inside ATX\n      headers, and neither version works inside Setext headers).\n\n\n  * Org reader (Albert Krewinkel, unless noted):\n\n    + Support `table.el` tables (#3314).\n    + Support macros (#3401).\n    + Support the `#+INCLUDE:` file inclusion mechanism (#3510).\n      Recognized include types are `example`, `export`, `src`, and\n      normal org file inclusion.  Advanced features like line numbers\n      and level selection are not implemented yet.\n    + Interpret more meta value as inlines.  The values of the following\n      meta variables are now interpreted using org-markup instead of\n      treating them as pure strings: `keywords` (comma-separated list of\n      inlines), `subtitle` (inline values), `nocite` (inline values, can\n      be repeated).\n    + Support `\\n` export option (#3940).  This turns all newlines in the\n      text into hard linebreaks.\n\n  * RST reader:\n\n    + Improved admonition support (#223).  We no longer add an\n      `admonition` class, we just use the class for the type of admonition,\n      `note` for example.  We put the word corresponding to the label in\n      a paragraph inside a `Div` at the beginning of the admonition with\n      class `admonition-title`.  This is about as close as we can get to\n      RST's own output.\n    + Initial support of `.. table` directive.  This allows adding captions\n      to tables.\n    + Support `.. line-block` directive.  This is deprecated but may still\n      be in older documents.\n    + Support scale and align attributes of images (#2662).\n    + Implemented implicit internal header links (#3475).\n    + Support RST-style citations (#853).  The citations appear at the end\n      of the document as a definition list in a special div with id\n      `citations`. Citations link to the definitions.\n    + Recurse into bodies of unknown directives (#3432).\n      In most cases it's better to preserve the content than\n      to emit it.  This isn't guaranteed to have good results;\n      it will fail spectacularly for unknown raw or verbatim directives.\n    + Handle chained link definitions (#262).  For example,\n\n          .. _hello:\n          .. _goodbye: example.com\n\n      Here both `hello` and `goodbye` should link to `example.com`.\n    + Support anchors (#262).  E.g.\n\n          `hello`\n\n          .. _hello:\n\n          paragraph\n\n      This is supported by putting \"paragraph\" in a `Div` with id `hello`.\n    + Support `:widths:` attribute for table directive.\n    + Implement csv-table directive (#3533).  Most attributes are supported,\n      including `:file:` and `:url:`.\n    + Support unknown interpreted text roles by parsing them as Span\n      with \"role\" attributes (#3407).  This way they can be manipulated in\n      the AST.\n\n  * HTML reader: parse a span with class `smallcaps` as `SmallCaps`.\n\n  * LaTeX reader:\n\n    + Implemented `\\graphicspath` (#736).\n    + Properly handle column prefixes/suffixes.  For example, in\n      `\\begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}}`\n      each cell will be interpreted as if it has a `$`\n      before its content and a `$` after (math mode).\n    + Handle komascript `\\dedication` (#1845).  It now adds a\n      `dedication` field to metadata.  It is up to the user to supply\n      a template that uses this variable.\n    + Support all `\\textXX` commands, where XX = `rm`, `tt`, `up`, `md`,\n      `sf`, `bf` (#3488).  Spans with a class are used when there is\n      nothing better.\n    + Expand `\\newenvironment` macros (#987).\n    + Add support for LaTeX subfiles package (Marc Schreiber, #3530).\n    + Better support for subfigure package (#3577).\n      A figure with two subfigures turns into two pandoc\n      figures; the subcaptions are used and the main caption\n      ignored, unless there are no subcaptions.\n    + Add support for `\\vdots` (Marc Schreiber, #3607).\n    + Add basic support for hyphenat package (Marc Schreiber, #3603).\n    + Add basic `\\textcolor` support (Marc Schreiber).\n    + Add support for `tabularx` environment (Marc Schreiber, #3632).\n    + Better handling of comments inside math environments (#3113).\n      This solves a problem with commented out `\\end{eqnarray}` inside\n      an eqnarray (among other things).\n    + Parse tikzpicture as raw verbatim environment if `raw_tex` extension\n      is selected (#3692).  Otherwise skip with a warning.  This is better\n      than trying to parse it as text!\n    + Add `\\colorbox` support (Marc Schreiber).\n    + Set identifiers on Spans used for `\\label`.\n    + Have `\\setmainlanguage` set `lang` in metadata.\n    + Support etoolbox's `\\ifstrequal`.\n    + Support `plainbreak`, `fancybreak` et al from the memoir class\n      (bucklereed, #3833).\n    + Support `\\let`.  Also, fix regular macros so they're expanded at the\n      point of use, and NOT also the point of definition.  `\\let` macros,\n      by contrast, are expanded at the point of definition.  Added an\n      `ExpansionPoint` field to `Macro` to track this difference.\n    + Support simple `\\def` macros.  Note that we still don't support\n      macros with fancy parameter delimiters, like `\\def\\foo#1..#2{...}`.\n    + Support `\\chaptername`, `\\partname`, `\\abstractname`, etc.  (#3559,\n      obsoletes #3560).\n    + Put content of `\\ref`, `\\label`, `\\eqref` commands into `Span` with\n      attributes, so they can be handled in filters (Marc Schreiber, #3639)\n    + Add Support for `glossaries` and `acronym` package (Marc Schreiber,\n      #3589). Acronyms are not resolved by the reader, but acronym and\n      glossary information is put into attributes on Spans so that they\n      can be processed in filters.\n    + Use `Link` instead of `Span` for `\\ref`.  This makes more sense\n      semantically and avoids unnecessary `Span [Link]` nestings when\n      references are resolved.\n    + Rudimentary support for `\\hyperlink`.\n    + Support `\\textquoteleft|right`, `\\textquotedblleft|right` (#3849).\n    + Support `\\lq`, `\\rq`.\n    + Implement `\\newtoggle`, `\\iftoggle`, `\\toggletrue|false` from etoolbox\n      (#3853).\n    + Support `\\RN` and `\\Rn`, from biblatex (bucklereed, #3854).\n    + Improved support for `\\hyperlink`, `\\hypertarget` (#2549).\n    + Support `\\k` ogonek accent.\n    + Improve handling of accents.  Handle ogonek, and fall back correctly\n      with forms like `\\\"{}`.\n    + Better support for ogonek accents.\n    + Support for `\\faCheck` and `\\faClose` (Marc Schreiber, #3727).\n    + Support for `xspace` (Marc Schreiber, #3797).\n    + Support `\\setmainlanguage` or `\\setdefaultlanguage` (polyglossia)\n      and `\\figurename`.\n    + Better handling of `\\part` in LaTeX (#1905).  Now we parse chapters as\n      level 0 headers, and parts as level -1 headers.  After parsing, we\n      check for the lowest header level, and if it's less than 1 we bump\n      everything up so that 1 is the lowest header level.  So `\\part` will\n      always produce a header; no command-line options are needed.\n    + Add block version of `\\textcolor` (Marc Schreiber).\n    + `\\textcolor` works as inline and block command (Marc Schreiber).\n    + `\\textcolor` will be parse as span at the beginning of a paragraph\n      (Marc Schreiber).\n    + Read polyglossia/babel `\\text(LANG){...}` (bucklereed)\n    + Improved handling of include files in LaTeX reader (#3971).\n      Previously `\\include` wouldn't work if the included file\n      contained, e.g., a begin without a matching end.\n    + Support `\\expandafter` (#3983).\n    + Handle `\\DeclareRobustCommand` (#3983).  Currently it's just treated\n      as a synonym for `\\newcommand`.\n    + Handle `\\lettrine` (Mauro Bieg).\n\n  * Math improvements due to updates in texmath:\n\n    + Improved handling of accents and upper/lower delimiters.\n    + Support for output in GNU eqn format (used with *roff).\n    + Allow `\\boldsymbol` + a token without braces, and similarly\n      with other styling commands.\n    + Improve parsing of `\\mathop` to allow multi-character operator names.\n    + Add thin space after math operators when \"faking it with\n      unicode.\"\n\n  * `walk` is now used instead of `bottomUp` in the `ToJSONFilter`\n    instance for `a -> [a]` (pandoc-types).  Note that behavior\n    will be slightly different, since `bottomUp`'s treatment of\n    a function `[a] -> [a]` is to apply it to each sublist of a\n    list, while walk applies it only to maximal sublists.\n    Usually the latter behavior is what is wanted, and the\n    former can be simulated when needed.  But there may be\n    existing filters that need to be rewritten in light of the\n    new behavior.  Performance should be improved.\n\n  * There are some changes to syntax highlighting due to revisions\n    in the `skylighting` library:\n\n    + Support for `powershell` has been added, and many syntax\n      definitions have been updated.\n    + Background colors have been added to the `kate` style.\n    + The way highlighted code blocks are formatted in HTML has\n      been changed (David Baynard), in ways that may require\n      changes in hard-coded CSS affecting highlighting.\n      (If you haven't included hard-coded highlighting CSS in\n      your template, you needn't change anything.)\n\n\n### API changes\n\n  * New module `Text.Pandoc.Class` (Jesse Rosenthal, John MacFarlane).\n    This contains definitions of the `PandocMonad` typeclass, the\n    `PandocIO` and `PandocPure` monads, and associated functions.\n\n  * Changed types of all writers and readers.\n\n    + We now use `Text` instead of `String` in the interface (#3731).\n      (We have not yet changed the internals of most readers to work\n      with `Text`, but making this change in the API now opens up a\n      path to doing that.)\n    + The result is now of form `m a` with constraint `PandocMonad m`.\n      Readers and writers can be combined to form monadic values which\n      can be run using either `runIO` or `runPure`.  If `runIO` is used,\n      then both readers and writers will be able to do IO when needed\n      (for include files, for example); if `runPure` is used,\n      then the functions are pure and will not touch IO.\n    + Where previously you used\n      `writeRST def (readMarkdown def \"[foo](url)\")`, now you\n      would use\n      `runPure $ readMarkdown def (pack \"[foo](url)\") >>= writeRST def`.\n\n  * New module `Text.Pandoc.Readers` (Albert Krewinkel).  This\n    contains reader helper functions formerly defined in the\n    top-level `Text.Pandoc` module.\n\n    + Changed `StringReader` -> `TextReader`.\n    + `getReader` now returns a pair of a reader and\n      `Extensions`, instead of building the extensions into the\n      reader (#3659).  The calling code must explicitly set\n      `readerExtensions` using the `Extensions` returned.  The\n      point of the change is to make it possible for the calling\n      code to determine what extensions are being used.\n\n  * New module `Text.Pandoc.Writers` (Albert Krewinkel).\n    This contains writer helper functions formerly defined in the\n    top-level `Text.Pandoc` module.\n\n    + Changed `StringWriter` -> `TextWriter`.\n    + `getWriter` now returns a pair of a reader and\n      `Extensions`, instead of building the extensions into the\n      reader (#3659).  The calling code must explicitly set\n      `readerExtensions` using the `Extensions` returned.  The\n      point of the change is to make it possible for the calling\n      code to determine what extensions are being used.\n\n  * New module `Text.Pandoc.Lua`, exporting `runLuaFilter` (Albert Krewinkel,\n    #3514).\n\n  * New module `Text.Pandoc.App`.  This abstracts out the functionality\n    of the command line program (`convertWithOpts`), so it can be reproduced\n    e.g. in a desktop or web application.  Instead of exiting, we throw errors\n    (#3548), which are caught (leading to exit) in pandoc.hs, but allow other\n    users of `Text.Pandoc.App` to recover.  `pandoc.hs` is now a 2-liner.\n    The module also exports some utility functions for parsing options\n    and running filters.\n\n  * New module `Text.Pandoc.Logging` (exported module) (#3392).\n    This now contains the `Verbosity` definition previously in\n    `Text.Pandoc.Options`, as well as a new `LogMessage` datatype that will\n    eventually be used instead of raw strings for warnings.  This will enable\n    us, among other things, to provide machine-readable warnings if desired.\n    Include ToJSON instance and showLogMessage.  This gives us the possibility\n    of both machine-readable and human-readable output for log messages.\n\n  * New module `Text.Pandoc.BCP47`, with `getLang`, `Lang(..)`, `parseBCP47`.\n\n  * New module `Text.Pandoc.Translations`, exporting `Term`,\n    `Translations`, `readTranslations`.\n\n  * New module `Text.Pandoc.Readers.LaTeX.Types', exporting `Macro`, `Tok`,\n    `TokType`, `Line`, `Column`.\n\n  * `Text.Pandoc.Error`: added many new constructors for `PandocError`.\n\n  * Expose some previously private modules (#3260).  These are often\n    helpful to people writing their own reader or writer modules:\n\n    + `Text.Pandoc.Writers.Shared`\n    + `Text.Pandoc.Parsing`\n    + `Text.Pandoc.Asciify`\n    + `Text.Pandoc.Emoji`\n    + `Text.Pandoc.ImageSize`\n    + `Text.Pandoc.Highlighting`\n`\n  * New module `Text.Pandoc.Extensions` (Albert Krewinkel):\n    Extension parsing and processing functions were defined in the top-level\n    `Text.Pandoc` module.  These functions are moved to the Extensions\n    submodule as to enable reuse in other submodules.\n\n  * Add `Ext_raw_attribute` constructor for `Extension`.\n\n  * Add `Ext_fenced_divs` constructor for `Extension'.\n\n  * Add `Ext_four_space_rule` constructor in `Extension`.\n\n  * Add `Ext_gfm_auto_identifiers` constructor for `Extension`.\n\n  * Add `Monoid` instance for `Extensions`.\n\n  * Add `Text.Pandoc.Writers.Ms`, exporting `writeMs`.\n\n  * Add `Text.Pandoc.Writers.JATS`, exporting `writeJATS`.\n\n  * Add `Text.Pandoc.Writers.Muse`, exporting `writeMuse`.\n\n  * Add `Text.Pandoc.Readers.Muse`, exporting `readMuse`.\n\n  * Add `Text.Pandoc.Readers.TikiWiki`, exporting `readTikiWiki`.\n\n  * Add `Text.Pandoc.Readers.Vimwiki`, exporting `readVimwiki`.\n\n  * Add `Text.Pandoc.Readers.Creole`, exporting `readCreole`.\n\n  * Export `setVerbosity` from `Text.Pandoc`.\n\n  * `Text.Pandoc.Pretty`: Add `Eq` instance for `Doc`.\n\n  * `Text.Pandoc.XML`: `toEntities`: changed type to `Text -> Text`.\n\n  * `Text.Pandoc.UTF8`:\n\n    + Export `fromText`, `fromTextLazy`, `toText`, `toTextLazy`.\n      Define `toString`, `toStringLazy` in terms of them.\n    + Add new functions parameterized on `Newline`: `writeFileWith`,\n      `putStrWith`, `putStrLnWith`, `hPutStrWith`, `hPutStrLnWith`.\n\n  * `Text.Pandoc.MediaBag`: removed `extractMediaBag`.\n\n  * `Text.Pandoc.Highlighting`:\n\n    + `highlighting` now returns an Either rather than Maybe.\n      This allows us to display error information returned by the skylighting\n      library.  Display a warning if the highlighting library throws an error.\n    + Add parameter for `SyntaxMap` to `highlight`.\n\n  * `Text.Pandoc.Writers.Math`:\n\n    + Export `defaultMathJaxURL`, `defaultKaTeXURL`.  This will ensure that\n      we only need to update these in one place.\n\n  * `Text.Pandoc.SelfContained`:\n\n    + Removed `WriterOptions` parameter from `makeSelfContained`.\n    + Put `makeSelfContained` in PandocMonad instead of IO.  This removes\n      the need to pass MediaBag around and improves exceptions.  It also\n      opens up the possibility of using makeSelfContained purely.\n    + Export `makeDataURI`.\n\n  * `Text.Pandoc.ImageSize`:\n\n    + Export `lengthToDim`, new function `scaleDimension`.\n    + Export `inEm` from ImageSize (#3450).\n    + Change `showFl` and `show` instance for `Dimension` so\n      extra decimal places are omitted.\n    + Added `Em` as a constructor of `Dimension`.\n    + Add `WriterOptions` parameter to `imageSize` signature (Mauro Bieg).\n\n  * `Text.Pandoc.Templates`:\n\n    + Change type of `renderTemplate'`.  Now it runs in `PandocMonad`\n      and raises a proper `PandocTemplateError` if there are problems, rather\n      than failing with uncatchable `error`.\n    + Change signature of `getDefaultTemplate`.  Now it runs in any instance\n      of `PandocMonad`, and returns a `String` rather than an `Either` value.\n      And it no longer takes a `datadir` parameter, since this can be\n      retrieved from `CommonState`.\n\n  * `Text.Pandoc.Options`:\n\n    + Added `writerEpubSubdirectory` to `WriterOptions` (#3720).\n      The EPUB writer now takes its EPUB subdirectory from this option.\n    + In `WriterOptions`, rename `writerLaTeXEngine` to `writerPdfEngine`\n      and `writerLaTeXArgs` to `writerPdfArgs` (Mauro Bieg, #3909).\n    + Add `writerSyntaxMap` to `WriterOptions`.\n    + Removed `writerEpubStylesheet` from `WriterOptions`.\n    + Remove `writerUserDataDir` from `WriterOptions`.  It is now carried\n      in `CommonState` in `PandocMonad` instances.  (And thus it can be used\n      by readers too.)\n    + Changed `writerEpubMetadata` to a `Maybe String`.\n    + Removed `readerApplyMacros` from `ReaderOptions`.  Now we just check\n      the `latex_macros` reader extension.\n    + FromJSON/ToJSON instances for `ReaderOptions`.\n    + In `HTMLMathMethod`, the `KaTeX` contsructor now takes only\n      one string (for the KaTeX base URL), rather than two.\n    + Removed `writerSourceURL` from `WriterOptions`.  We now use\n      `stSourceURL` in `CommonState`, which is set by `setInputFiles`.\n\n  * `Text.Pandoc.Shared`:\n\n    + `tabFilter` now takes a `Text`, not `String`.\n    + `openURL`: Changed type from an Either.  Now it will just raise\n      an exception to be trapped later.\n    + Remove `normalizeSpaces` (#1530).\n    + Remove `warn`.  (Use `report` from `Text.Pandoc.Class` instead.)\n    + Export a new function `crFilter`.\n    + Add `eastAsianLineBreakFilter` (previously in Markdown reader).\n    + Provide custom `isURI` that rejects unknown schemes.\n      (Albert Krewinkel, #2713).  We also export the set of known\n      `schemes`.  The new function replaces the function of the same name\n      from `Network.URI`, as the latter did not check whether a scheme is\n      well-known.  All official IANA schemes (as of 2017-05-22) are\n      included in the set of known schemes.  The four non-official schemes\n      `doi`, `isbn`, `javascript`, and `pmid` are kept.\n    + Remove `err`.\n    + Remove `readDataFile`, `readDefaultDataFile`, `getReferenceDocx`,\n      `getReferenceODT`. These now live in `Text.Pandoc.Class`,\n      where they are defined in terms of `PandocMonad`\n      primitives and have different signatures.\n    + Remove `openURL`.  Use `openURL` from `Text.Pandoc.Class` instead.\n    + Add `underlineSpan`.\n\n  * `Text.Pandoc.Readers.HTML`: export new `NamedTag` class.\n\n  * `Text.Pandoc.Readers.Markdown`: remove `readDocxWithWarnings`.\n     With the new API one can simply use `getLog` after running\n     the reader.\n\n  * `Text.Pandoc.Readers.LaTeX`: Changed types for `rawLaTeXInline`\n     and `rawLaTeXBlock`.  (Both now return a `String`, and they are\n     polymorphic in state.)\n\n\n### Bug fixes and under-the-hood improvements\n\n  * TEI writer: Added identifiers on `<div>` elements.\n\n  * DokuWiki reader: Better handling for code block in list item (#3824).\n\n  * Custom writer: Remove old preprocesesor conditionals (Albert Krewinkel).\n\n  * ZimWiki writer: Removed internal formatting from note and table cells,\n    because ZimWiki does not support it (Alex Ivkin, #3446).\n\n  * MediaWiki writer:\n\n    + Updated list of syntax highlighting languages (#3461).\n      Now `r` gets you `<source>` rather than `<code>` (among others).\n    + Add display attribute on `<math>` tags (#3452).  This allows display\n      math to be rendered properly.\n    + Remove newline before `</ref>` (#2652).\n    + Don't softbreak lines inside list items (#3531).\n\n  * Org writer:\n\n    + Reduce to two spaces after bullets (#3417, Albert Krewinkel).\n    + Add unit tests (Alexander Krotov).\n    + Stop using raw HTML to wrap divs (Albert Krewinkel, #3771).\n    + Do not strip `#` from Org anchor links (Alexander Krotov).\n\n  * CommonMark writer:\n\n    + Avoid excess blank lines at end of output.\n    + Prefer pipe tables to HTML tables even if it means losing relative\n      column width information (#3734).\n    + Support table, strikethrough extensions, when enabled (as with gfm).\n      Note that we bypass the commonmark writer from cmark and construct our\n      own pipe tables, with better results.\n    + Properly support `--wrap=none`.\n    + Use smallcaps class for `SmallCaps` (#1592).\n    + Omit \"fig:\" prefix in image titles.  This is used internally to\n      indicate internal figures.\n\n  * RST writer:\n\n    + Properly handle table captions.\n    + Don't wrap lines in in definition list terms.  Wrapping is not allowed.\n    + Implemented `+/-smart` and improved escaping with `+smart`.\n    + Add empty comments when needed to avoid including a blockquote\n      in the indented content of a preceding block (#3675).\n    + Improve grid table output, fix bug with empty rows (#3516).\n      Uses the new `gridTable` in Writers.Shared, which is here\n      improved to better handle 0-width cells.\n    + Remove space at beginning/end of RST code span (#3496).  Otherwise\n      we get invalid RST.  There seems to be no way to escape the space.\n    + Add header anchors when header has non-standard id (#3937).\n    + Correctly handle inline code containing backticks, using a `:literal:`\n      role (#3974).\n    + Don't backslash-escape word-internal punctuation (#3978).\n\n  * Markdown writer:\n\n    + Don't include variables in metadata blocks.  Previously variables set\n      on the command line were included in e.g. YAML metadata, contrary to\n      documentation and intentions.\n    + Improved escaping with `+smart`.\n    + Fixed grid tables embedded in grid tables (#2834).\n    + Use span with class 'smallcaps' for SmallCaps, instead of a style\n      attribute as before (#1592).\n    + Escape initial `%` in a paragraph if the `pandoc_title_blocks`\n      extension is enabled (#3454).  Otherwise in a document starting with\n      a literal `%` the first line is wrongly interpreted as a title.\n    + Fixed false ordered lists in YAML metadata (#3492, #1685).  Now we\n      properly escape things that would otherwise start ordered lists,\n      such as\n\n          ---\n          title: 1. inline\n          ...\n    + Better handling of tables with empty columns (#3337).  We now\n      calculate the number of columns based on the longest row (or the\n      length of aligns or widths).\n    + Escape unordered list markers at beginning of paragraph (#3497), to\n      avoid false interpretation as a list.\n    + Escape `|` appropriately.\n    + Ensure space before list at top level (#3487).\n    + Avoid spurious blanklines at end of document after tables and list,\n      for example.\n    + Fixed bugs in simple/multiline list output (#3384).\n      Previously we got overlong lists with `--wrap=none`.  This is fixed.\n      Previously a multiline list could become a simple list (and would\n      always become one with `--wrap=none`).\n    + Don't emit a simple table if `simple_tables` disabled (#3529).\n    + Case-insensitive reference links (David A Roberts, #3616).\n      Ensure that we do not generate reference links whose labels differ only\n      by case.  Also allow implicit reference links when the link\n      text and label are identical up to case.\n    + Put space before reference link definitions (Mauro Bieg, #3630).\n    + Better escaping for links (David A. Roberts, #3619).  Previously the\n      Markdown writer would sometimes create links where there were none\n      in the source.  This is now avoided by selectively escaping bracket\n      characters when they occur in a place where a link might be created.\n    + Added missing `\\n` (David A. Roberts, #3647).\n    + Fixed duplicated reference links with `--reference-links`\n      and `--reference-location=section` (#3674).  Also ensure that there\n      are no empty link references `[]`.\n    + Avoid inline surround-marking with empty content (#3715).\n      E.g. we don't want `<strong></strong>` to become `****`.\n      Similarly for emphasis, super/subscript, strikeout.\n    + Don't allow soft break in header (#3736).\n    + Make sure `plain`, `markdown_github`, etc. work for raw.\n      Previously only `markdown` worked.  Note: currently a raw block labeled\n      `markdown_github` will be printed for any `markdown` format.\n    + Ensure that `+` and `-` are escaped properly so they don't cause\n      spurious lists (#3773).  Previously they were only\n      if succeeded by a space, not if they were at end of line.\n    + Use pipe tables if `raw_html` disabled and `pipe_tables` enabled,\n      even if the table has relative width information (#3734).\n    + Markdown writer: don't crash on `Str \"\"`.\n    + Make `Span` with null attribute transparent.  That is, we don't use\n      brackets or `<span>` tags to mark spans when there are no attributes;\n      we simply output the contents.\n    + Escape pipe characters when `pipe_tables` enabled (#3887).\n    + Better escaping of `<` and `>`.  If `all_symbols_escapable` is set,\n      we backslash escape these.  Otherwise we use entities as before.\n    + When writing plain, don't use `&nbsp;` to separate list and indented\n      code.  There's no need for it in this context, since this isn't to be\n      interpreted using Markdown rules.\n    + Preserve classes in JS obfuscated links (Timm Albers, #2989).\n      HTML links containing classes originally now preserve them when using\n      javascript email obfuscation.\n    + Render `SmallCaps` as a native span when `native_spans` are enabled.\n    + Always write attributes with `bracketed_spans` (d-dorazio).\n\n  * Man writer:\n\n    + Fix handling of nested font commands (#3568).  Previously pandoc emitted\n      incorrect markup for bold + italic, for example, or bold + code.\n    + Avoid error for definition lists with no definitions (#3832).\n\n  * DocBook writer:\n\n    + Fix internal links with `writerIdentifierPrefix opt`\n      (#3397, Mauro Bieg).\n\n  * Docx writer:\n\n    + Don't include bookmarks on headers unless non-null id (#3476).\n    + Support 9 levels of headers (#1642).\n    + Allow 9 list levels (#3519).\n    + Don't take `distArchive` from datadir (#3322).  The docx writer takes\n      components from the distribution's version of `reference.docx` when it\n      can't find them in a user's custom `reference.docx`.  Previously, we\n      allowed a `reference.docx` in the data directory (e.g. `~/.pandoc`)\n      to be used as the distribution's reference.docx.  This led to a\n      bizarre situation where pandoc would produce a good docx using\n      `--template ~/.pandoc/ref.docx`, but if `ref.docx` were moved to\n      `~/.pandoc/reference.docx`, it would then produce a corrupted docx.\n    + Fixed handling of soft hyphen (0173) (#3691).\n    + Better handling of keywords (#3719).\n    + Cleaner code for handling dir and style attributes for `Div`.\n    + Use `Set` for dynamic styles to avoid duplicates.\n    + Removed redundant element from data/docx/word/numbering.xml.\n      The elements we need are generated when the document is\n      compiled; this didn't do anything.\n    + Activate `evenAndOddHeaders` from reference docx (#3901,\n      Augustín Martín Barbero).\n\n  * ODT/OpenDocument writer:\n\n    + Calculate aspect ratio for percentage-sized images (Mauro Bieg, #3239).\n    + Use more widely available bullet characters (#1400).  The old\n      characters weren't available in some font sets.  These seem to work\n      well on Windows and Linux versions of LibreOffice.\n    + Wider labels for lists (#2421).  This avoids overly narrow labels for\n      ordered lists with `()` delimiters.  However, arguably it creates\n      overly wide labels for bullets.  Also, lists now start flush with\n      the margin, rather than indented.\n    + Fixed dropped elements in some ordered lists (#2434).\n\n  * FB2 writer:\n\n    + Don't render `RawBlock` as code.\n    + Don't fail with an error on interior headers (e.g. in list) (#3750).\n      Instead, omit them with an INFO message.\n    + Add support for \"lang\" metadata (Alexander Krotov, #3625).\n    + Format `LineBlock` as poem (Alexander Krotov).  Previously writer\n      produced one paragraph with `<empty-line/>` elements, which are not\n      allowed inside `<p>` according to FB2 schema.\n    + Replace `concatMap` with `cMap` (Alexander Krotov).\n    + Write FB2 lists without nesting blocks inside `<p>` (Alexander\n      Krotov, #4004)\n\n  * HTML writer:\n\n    + Make sure `html4`, `html5` formats work for raw blocks/inlines.\n    + Render raw inline environments when `--mathjax` used (#3816).\n      We previously did this only with raw blocks, on the assumption\n      that math environments would always be raw blocks. This has changed\n      since we now parse them as inline environments.\n    + Ensure we don't get two style attributes for width and height.\n    + Report when not rendering raw inline/block.\n    + Issue warning if no title specified and template used (#3473).\n    + Info message if `lang` is unspecified (#3486).\n    + Removed unused parameter in `dimensionsToAttributeList`.\n    + Avoid two class attributes when adding `uri` class (#3716).\n    + Fix internal links with `writerIdentifierPrefix opt` (#3397, Mauro\n      Bieg).\n    + Use revealjs's math plugin for mathjax (#3743).  This is a thin\n      wrapper around mathjax that makes math look better on revealjs.\n    + Slidy:  use h1 for all slides, even if they were originally\n      level 2 headers (#3566).  Otherwise the built-in table of contents\n      in Slidy breaks.\n\n  * LaTeX writer:\n\n    + Don't render LaTeX images with data: URIs (#3636).  Note that\n      `--extract-media` can be used when the input contains data: URIs.\n    + Make highlighted code blocks work in footnotes (Timm Albers).\n    + Don't use figure inside table cell (#3836).\n    + Use proper code for list enumerators (#3891).  This should fix problems\n      with lists that don't use arabic numerals.\n    + Always add hypertarget when there's a non-empty identifier (#2719).\n      Previously the hypertargets were only added when there was actually\n      a link to that identifier.\n    + Use `%` after hypertarget before code block.\n    + Add `\\leavevmode` before hypertarget at start of paragraph (#2704,\n      fixes formatting problems in beamer citations).\n    + Don't use `lstinline` in `\\item[..]` (#645).  If you do, the contents\n      of item disappear or are misplaced.  Use `\\texttt` instead.\n    + Fix problem with escaping in `lstinline` (#1629).  Previously the\n      LaTeX writer created invalid LaTeX when `--listings` was specified and\n      a code span occurred inside emphasis or another construction.\n    + Fix error with line breaks after empty content (#2874).  LaTeX\n      requires something before a line break, so we insert a `~` if no\n      printable content has yet been emitted.\n    + Use BCP47 parser.\n    + Fixed detection of otherlangs (#3770).  We weren't recursing into\n      inline contexts.\n    + Handle language in inline code with `--listings` (#3422).\n    + Write euro symbol directly in LaTeX (Andrew Dunning, #3801).\n      The textcomp package allows pdfLaTeX to parse `€` directly, making the\n      `\\euro` command unneeded.\n    + Fixed footnotes in table captions (#2378).  Note that if the table has\n      a first page header and a continuation page header, the notes will\n      appear only on the first occurrence of the header.\n    + In `writeBeamer` output, allow hyperlinks to frames (#3220).\n      Previously you could link to a header above or below slide level but\n      not *to* slide level.  This commit changes that.  Hypertargets are\n      inserted inside frame titles; technically the reference is to just\n      after the title, but in normal use (where slides are viewed full\n      screen in a slide show), this does not matter.\n    + Remove `\\strut` at beginning of table cells (#3436).  This fixes a\n      problem with alignment of lists in table cells.  The `\\strut` at the\n      end seems to be enough to avoid the too-close spacing that motivated\n      addition of the strut  in #1573.\n    + Add partial siunitx Support (Marc Schreiber, #3588).\n\n  * ConTeXt writer:\n\n    + Refactored to use BCP47 module.\n    + Remove unnecessary `$` (Alexander Krotov, #3482).\n    + Use header identifiers for chapters (#3968).\n\n  * EPUB writer:\n\n    + `title_page.xhtml` is now put in `text/`.\n    + Don't strip formatting in TOC (#1611).\n\n  * Textile reader:\n\n    + Fix bug for certain links in table cells (#3667).\n    + Allow 'pre' code in list item (#3916).\n\n  * HTML reader:\n\n    + Added warnings for ignored material (#3392).\n    + Better sanity checks to avoid parsing unintended things as\n      raw HTML in the Markdown reader (#3257).\n    + Revise treatment of `li` with `id` attribute (#3596).  Previously we\n      always added an empty div before the list item, but this created\n      problems with spacing in tight lists.  Now we do this: If the list\n      item contents begin with a `Plain` block, we modify the `Plain`\n      block by adding a `Span` around its contents.  Otherwise, we add a\n      `Div` around the contents of the list item (instead of adding an\n      empty `Div` to the beginning, as before).\n    + Add `details` tag to list of block tags (#3694).\n    + Removed `button` from block tag list (#3717).  It is already in the\n      `eitherBlockOrInlineTag` list, and should be both places.\n    + Use `Set`s instead of lists for block tag lookup.\n    + Rewrote to use `Text` throughout.  Effect on memory usage is modest\n      (< 10%).\n    + Use the lang value of `<html>` to set the lang meta value (bucklereed,\n      #3765).\n    + Ensure that paragraphs are closed properly when the parent block\n      element closes, even without `</p>` (#3794).\n    + Parse `<figure>` and `<figcaption>` (Mauro Bieg, #3813).\n    + Parse `<main>` like `<div role=main>` (bucklereed, #3791).\n      `<main>` closes `<p>` and behaves like a block element generally\n    + Support column alignments (#1881).  These can be set either\n      with a `width` attribute or with `text-width` in a `style` attribute.\n    + Modified state type to be an instance of `HasLogMessages`, so\n      `registerHeader` can issue warnings.\n    + `</td>` or `</th>` should close any open block tag (#3991).\n    + `<td>` should close an open `<th>` or `<td>`.\n    + `htmlTag` improvements (#3989).  We previously failed on cases\n      where an attribute contained a `>` character. This patch fixes the\n      bug, which especially affects raw HTML in Markdown.\n\n  * Txt2Tags reader:\n\n    + Newline is not indentation (Alexander Krotov).\n\n  * MediaWiki reader:\n\n    + Allow extra hyphens after `|-` in tables (#2649).\n    + Allow blank line after table start (#2649).\n    + Fixed more table issues (#2649).\n    + Ensure that list starts begin at left margin (#2606).  Including when\n      they're in tables or other list items.\n    + Make smart double quotes depend on `smart` extension (#3585).\n    + Don't do curly quotes inside `<tt>` contexts (#3585).  Even if `+smart`.\n    + Modified state type to be an instance of `HasLogMessages`, so\n      `registerHeader` can issue warnings.\n\n  * TWiki reader (Alexander Krotov):\n\n    + Remove unnecessary `$` (#3597).\n    + Simplify `linkText` (#3605).\n\n  * EPUB reader:\n\n    + Minor refactoring, avoiding explicit MediaBag handling.\n      This all works behind the scenes in CommonState plumbing.\n\n  * Docx reader:\n\n    + Don't drop smartTag contents (#2242).\n    + Handle local namespace declarations (#3365).  Previously we didn't\n      recognize math, for example, when the xmlns declaration occurred on\n      the element and not the root.\n    + More efficient trimSps (#1530).  Replacing `trimLineBreaks`.  This\n      does the work of `normalizeSpaces` as well, so we avoid the need for\n      that function here.\n    + Avoid 0-level headers (Jesse Rosenthal, #3830).  We used to parse\n      paragraphs styled with \"HeadingN\" as \"nth-level header.\" But if a\n      document has a custom style named \"Heading0\", this will produce a\n      0-level header, which shouldn't exist. We only parse this style\n      if N>0. Otherwise we treat it as a normal style name, and\n      follow its dependencies, if any.\n    + Add tests for avoiding zero-level header (Jesse Rosenthal).\n\n  * ODT reader:\n\n    + Replaced `collectRights` with Rights from `Data.Either`.\n    + Remove dead code (Albert Krewinkel).\n\n  * Org reader (Albert Krewinkel, unless noted).\n\n    + Don't allow tables inside list items (John MacFarlane, #3499).\n    + Disallow tables on list marker lines (#3499).\n    + Convert markup at beginning of footnotes (John MacFarlane, #3576).\n    + Allow emphasized text to be followed by `[` (#3577).\n    + Handle line numbering switch for src blocks.\n      The line-numbering switch that can be given to source blocks (`-n` with\n      an start number as an optional parameter) is parsed and translated to a\n      class/key-value combination used by highlighting and other readers and\n      writers.\n    + Stop adding rundoc prefix to src params.  Source block parameter names\n      are no longer prefixed with `rundoc`. This was intended to simplify\n      working with the rundoc project, a babel runner. However, the rundoc\n      project is unmaintained, and adding those markers is not the reader's\n      job anyway.  The original language that is specified for a source\n      element is now retained as the `data-org-language` attribute and only\n      added if it differs from the translated language.\n    + Allow multi-word arguments to src block params (#3477).  The reader now\n      correctly parses src block parameter list even if parameter arguments\n      contain multiple words.\n    + Avoid creating `nullMeta` by applying `setMeta` directly\n      (Alexander Krotov).\n    + Replace `sequence . map` with `mapM`.\n    + Fix smart parsing behavior.  Parsing of smart quotes and special\n      characters can either be enabled via the `smart` language extension or\n      the `'` and `-` export options. Smart parsing is active if either the\n      extension or export option is enabled.  Only smart parsing of special\n      characters (like ellipses and en and em dashes) is enabled by default,\n      while smart quotes are disabled.  Previously, all smart parsing was\n      disabled unless the language extension was enabled.\n    + Subject full doc tree to headline transformations (Albert Krewinkel,\n      #3695).  Emacs parses org documents into a tree structure, which is\n      then post-processed during exporting. The reader is changed to do the\n      same, turning the document into a single tree of headlines starting\n      at level 0.\n    + Fix cite parsing behaviour (Herwig Stuetz).  Until now, `org-ref`\n      cite keys included special characters also at the end. This caused\n      problems when citations occur right before colons or at the end of\n      a sentence.  With this change, all non alphanumeric characters at\n      the end of a cite key are ignored.  This also adds `,` to the list\n      of special characters that are legal in cite keys to better mirror\n      the behaviour of org-export.\n    + Fix module names in haddock comments.  Copy-pasting had lead to\n      haddock module descriptions containing the wrong module names.\n    + Recognize babel result blocks with attributes (#3706).  Babel\n      result blocks can have block attributes like captions and names.\n      Result blocks with attributes were not recognized and were parsed\n      as normal blocks without attributes.\n    + Include tags in headlines.  The Emacs default is to include tags in the\n      headline when exporting.  Instead of just empty spans, which contain the\n      tag name as attribute, tags are rendered as small caps and wrapped in\n      those spans.  Non-breaking spaces serve as separators for multiple tags.\n    + Respect export option for tags (#3713).  Tags are appended to\n      headlines by default, but will be omitted when the `tags` export option\n      is set to nil.\n    + Use `tag-name` attribute instead of `data-tag-name`.\n    + Use `org-language` attribute rather than `data-org-language`.\n    + Modified state type to be an instance of `HasLogMessages`, so\n      `registerHeader` can issue warnings.\n    + End footnotes after two blank lines.  Footnotes can not only be\n      terminated by the start of a new footnote or a header, but also by two\n      consecutive blank lines.\n    + Update emphasis border chars (#3933).  The org reader was updated to\n      match current org-mode behavior: the set of characters which are\n      acceptable to occur as the first or last character in an org emphasis\n      have been changed and now allows all non-whitespace chars at the\n      inner border of emphasized text (see `org-emphasis-regexp-components`).\n\n  * RST reader:\n\n    + Fixed small bug in list parsing (#3432).  Previously the parser didn't\n      handle properly this case:\n\n          * - a\n            - b\n          * - c\n            - d\n    + Handle multiline cells in simple tables (#1166).\n    + Parse list table directive (Keiichiro Shikano, #3432).\n    + Make use of `anyLineNewline` (Alexander Krotov, #3686).\n    + Use `anyLineNewline` in `rawListItem` (Alexander Krotov, #3702).\n    + Reorganize block parsers for ~20% faster parsing.\n    + Fixed `..include::` directive (#3880).\n    + Handle blank lines correctly in line blocks (Alexander Krotov, #3881).\n      Previously pandoc would sometimes combine two line blocks separated\n      by blanks, and ignore trailing blank lines within the line block.\n    + Fix indirect hyperlink targets (#512).\n\n  * Markdown reader:\n\n    + Allow attributes in reference links to start on next line (#3674).\n    + Parse YAML metadata in a context that sees footnotes defined in\n      the body of the document (#1279).\n    + When splitting pipe table cells, skip tex math (#3481).\n      You might have a `|` character inside math.  (Or for that matter\n      something that the parser might mistake for raw HTML.)\n    + Treat span with class `smallcaps` as SmallCaps.\n      This allows users to specify small caps in Markdown this way:\n      `[my text]{.smallcaps}` (#1592).\n    + Fixed internal header links (#2397).\n      This patch also adds `shortcut_reference_links` to the list\n      of mmd extensions.\n    + Treat certain environments as inline\n      when they occur without space surrounding them (#3309, #2171).\n      E.g. equation, math.  This avoids incorrect vertical space\n      around equations.\n    + Optimized `nonindentSpaces`.  Makes the benchmark go from 40 to 36 ms.\n    + Allow latex macro definitions indented 1-3 spaces.\n      Previously they only worked if nonindented.\n    + Improved parsing of indented raw HTML blocks (#1841).\n      Previously we inadvertently interpreted indented HTML as\n      code blocks.  This was a regression.  We now seek to determine the\n      indentation level of the contents of an HTML block, and (optionally)\n      skip that much indentation.  As a side effect, indentation may be\n      stripped off of raw HTML blocks, if `markdown_in_html_blocks` is\n      used. This is better than having things interpreted as indented\n      code blocks.\n    + Fixed smart quotes after emphasis (#2228).  E.g. in `*foo*'s 'foo'`.\n    + Warn for notes defined but not used (#1718).\n    + Use `anyLineNewline` (Alexander Krotov).\n    + Interpret YAML metadata as Inlines when possible (#3755).  If\n      the metadata field is all on one line, we try to interpret it as\n      Inlines, and only try parsing as Blocks if that fails.  If it\n      extends over one line (including possibly the `|` or `>` character\n      signaling an indented block), then we parse as Blocks.  This was\n      motivated by some German users finding that `date: '22. Juin 2017'`\n      got parsed as an ordered list.\n    + Fixed spurious parsing as citation as reference def (#3840).\n      We now disallow reference keys starting with `@` if the\n      `citations` extension is enabled.\n    + Parse `-@roe` as suppress-author citation (pandoc-citeproc#237).\n      Previously only `[-@roe]` (with brackets) was recognized as\n      suppress-author, and `-@roe` was treated the same as `@roe`.\n    + Fixed parsing of fenced code after list when there is no intervening\n      blank line (#3733).\n    + Allow raw latex commands starting with `\\start` (#3558).  Previously\n      these weren't allowed because they were interpreted as starting\n      ConTeXt environments, even without a corresponding `\\stop`...\n    + Added `inlines`, `inlines1`.\n    + Require nonempty alt text for `implicit_figures` (#2844).\n      A figure with an empty caption doesn't make sense.\n    + Removed texmath macro material; now all this is handled\n      in the LaTeX reader functions.\n    + Fixed bug with indented code following raw LaTeX (#3947).\n\n  * LaTeX reader:\n\n    + Rewrote LaTeX reader with proper tokenization (#1390,\n      #2118, #3236, #3779, #934, #982).  This rewrite is primarily\n      motivated by the need to get macros working properly.  A side benefit\n      is that the reader is significantly faster.  We now tokenize the\n      input text, then parse the token stream.  Macros modify the token\n      stream, so they should now be effective in any context, including\n      math. Thus, we no longer need the clunky macro processing\n      capacities of texmath.\n    + Parse `\\,` to `\\8198` (six-per-em space) (Henri Werth).\n    + Allow `\\newcommand\\foo{blah}` without braces.\n    + Support `\\lstinputlisting` (#2116).\n    + Issue warnings when skipping unknown latex commands (#3392).\n    + Include contents of `\\parbox`.\n    + Allow `\\hspace` and `\\vspace` to count as raw block or inline.\n      Previously we would refuse to parse anything as raw inline if\n      it was in the `blockCommands` list.  Now we allow exceptions\n      if they're listed under ignoreInlines in inlineCommands.\n      This should make it easier e.g. to include an `\\hspace`\n      between two side-by-side raw LaTeX tables.\n    + Don't drop contents of `\\hypertarget`.\n    + Handle spaces before `\\cite` arguments.\n    + Allow newpage, clearpage, pagebreak in inline contexts as well as\n      block contexts (#3494).\n    + Treat `{{xxx}}` the same as `{xxx}` (#2115).\n    + Use `pMacroDefinition` in macro (for more direct parsing).\n      Note that this means that `macro` will now parse one\n      macro at a time, rather than parsing a whole group together.\n    + Fixed failures on `\\ref{}`, `\\label{}` with `+raw_tex`.  Now these\n      commands are parsed as raw if `+raw_tex`; otherwise, their argument\n      is parsed as a bracketed string.\n    + Don't crash on empty `enumerate` environment (#3707).\n    + Handle escaped `&` inside table cell (#3708).\n    + Handle block structure inside table cells (#3709).  `minipage` is no\n      longer required.\n    + Handle some width specifiers on table columns (#3709).  Currently\n      we only handle the form `0.9\\linewidth`.  Anything else would have\n      to be converted to a percentage, using some kind arbitrary assumptions\n      about line widths.\n    + Make sure `\\write18` is parsed as raw LaTeX.  The change is in the\n      LaTeX reader's treatment of raw commands, but it also affects the\n      Markdown reader.\n    + Fixed regression with starred environment names (#3803).\n    + Handle optional args in raw `\\titleformat` (#3804).\n    + Improved heuristic for raw block/inline.  An unknown command at the\n      beginning of the line that could be either block or inline is\n      treated as block if we have a sequence of block commands followed by\n      a newline or a `\\startXXX` command (which might start a raw ConTeXt\n      environment).\n    + Don't remove macro definitions from the output, even if\n      `Ext_latex_macros` is set, so that macros will be applied.\n      Since they're only applied to math in Markdown, removing the macros\n      can have bad effects.  Even for math macros, keeping them should be\n      harmless.\n    + Removed `macro`.  It is no longer necessary, since the\n      `rawLaTeXBlock` parser will parse macro definitions.  This also avoids\n      the need for a separate `latexMacro` parser in the Markdown reader.\n    + Use `label` instead of `data-label` for label in caption (#3639).\n    + Fixed space after `\\figurename` etc.\n    + Resolve references to section numbers.\n    + Fix `\\let\\a=0` case, with single character token.\n    + Allow `@` as a letter in control sequences.  `@` is commonly used\n      in macros using `\\makeatletter`.  Ideally we'd make the tokenizer\n      sensitive to `\\makeatletter` and `\\makeatother`, but until then this\n      seems a good change.\n    + Track header numbers and correlate with labels.\n    + Allow `]` inside group in option brackets (#3857).\n    + lstinline with braces can be used (verb cannot be used with braces)\n      (Marc Schreiber, #3535).\n    + Fix keyval function: pandoc did not parse options in braces correctly\n      (Marc Schreiber, #3642).\n    + When parsing raw LaTeX commands, include trailing space (#1773).\n      Otherwise things like `\\noindent foo` break and turn into\n      `\\noindentfoo`.  Affects `-f latex+raw_tex` and `-f markdown` (and other\n      formats that allow `raw_tex`).\n    + Don't treat \"...\" as Quoted (#3958).  This caused quotes to be omitted in\n      `\\texttt` contexts.\n    + Add tests for existing `\\includegraphics` behaviour (Ben Firshman).\n    + Allow space before `=` in bracketd options (Ben Firshman).\n    + Be more forgiving in parsing command options.  This was needed, for\n      example, to make some minted options work.\n    + Strip off quotes in `\\include` filenames.\n\n  * Added `Text.Pandoc.CSV`, simple (unexported) CSV parser.\n\n  * `Text.Pandoc.PDF`:\n\n    + Got `--resource-path` working with PDF output (#852).\n    + Fetch images when generating PDF via context (#3380).\n      To do this, we create the temp directory as a subdirectory\n      of the working directory. Since context mk IV by default looks\n      for images in the parent directory, this works.\n    + Use `report` instead of `warn`, make it sensitive to verbosity settings.\n    + Use `fillMediaBag` and `extractMedia` to extract media to temp dir.\n      This reduces code duplication.\n    + `html2pdf`: use stdin instead of intermediate HTML file\n    + Removed useless `TEXINPUTS` stuff for `context2pdf`.  mkiv context\n      doesn't use `TEXINPUTS`.\n\n  * `Text.Pandoc.Pretty`:\n\n    + Simplified definition of `realLength`.\n    + Don't error for blocks of size < 1.  Instead, resize to 1 (see #1785).\n\n  * `Text.Pandoc.MIME`:\n\n    + Use `application/javascript` (not `application/x-javascript`).\n    + Added `emf` to mimeTypes with type `application/x-msmetafile` (#1713).\n\n  * `Text.Pandoc.ImageSize`:\n\n    + Improve SVG image size code (Marc Schreiber, #3580).\n    + Make `imageSize` recognize basic SVG dimensions (Mauro Bieg, #3462).\n\n  * Use `Control.Monad.State.Strict` throughout.  This gives 20-30% speedup\n    and reduction of memory usage in most of the writers.\n\n  * Use `foldrWithKey` instead of deprecated `foldWithKey`.\n\n  * `Text.Pandoc.SelfContained`:\n\n    + Fixed problem with embedded fonts (#3629).\n    + Refactored getData from `getDataURI` in `SelfContained`.\n    + Don't use data URIs for script or style (#3423).  Instead, just use\n      script or style tags with the content inside.  The old method with\n      data URIs prevents certain optimizations outside pandoc.  Exception:\n      data URIs are still used when a script contains `</script>` or a\n      style contains `</`.\n    + SelfContained: Handle URL inside material retrieved from a URL\n      (#3629).  This can happen e.g. with an @import of a google web font.\n      (What is imported is some CSS which contains an url reference\n      to the font itself.) Also, allow unescaped pipe (|) in URL.\n    + Load resources from `data-src` (needed for lazy loading in\n      reveal.js slide shows).\n    + Handle `data-background-image` attribute on section (#3979).\n\n  * `Text.Pandoc.Parsing`:\n\n    + Added `indentWith` (Alexander Krotov, #3687).\n    + Added `stateCitations` to `ParserState`.\n    + Removed `stateChapters` from `ParserState`.\n    + In `ParserState`, make `stateNotes'` a Map, add `stateNoteRefs`.\n    + Added `gobbleSpaces` and `gobbleAtMostSpaces`.\n    + Adjusted type of `insertIncludedFile` so it can be used with token\n      parser.\n    + Replace old texmath macro stuff from Parsing.  Use Macro from\n      Text.Pandoc.Readers.LaTeX.Types instead.\n    + Export `insertIncludedFile`.\n    + Added `HasLogMessages`, `logMessage`, `reportLogMessages` (#3447).\n    + Replace partial with total function (Albert Krewinkel).\n    + Introduce `HasIncludeFiles` type class (Albert Krewinkel).  The\n      `insertIncludeFile` function is generalized to work with all parser\n      states which are instances of that class.\n    + Add `insertIncludedFilesF` which returns F blocks (Albert Krewinkel).\n      The `insertIncludeFiles` function was generalized and renamed\n      to `insertIncludedFiles'`; the specialized versions are based on that.\n    + `many1Till`: Check for the end condition before parsing (Herwig\n      Stuetz).  By not checking for the end condition before the first\n      parse, the parser was applied too often, consuming too much of the\n      input. This only affects `many1Till p end` where `p` matches on a\n      prefix of `end`.\n    + Provide `parseFromString` (#3690).  This is a version of\n      `parseFromString` specialied to ParserState, which resets\n      `stateLastStrPos` at the end.  This is almost always what we want.\n      This fixes a bug where `_hi_` wasn't treated as emphasis in the\n      following, because pandoc got confused about the position of the\n      last word: `- [o] _hi_`.\n    + Added `takeP`, `takeWhileP` for efficient parsing of `[Char]`.\n    + Fix `blanklines` documentation (Alexander Krotov, #3843).\n    + Give less misleading line information with `parseWithString`.\n      Previously positions would be reported past the end of the chunk.\n      We now reset the source position within the chunk and report\n      positions \"in chunk.\"\n    + Add `anyLineNewline` (Alexander Krotov).\n    + Provide shared F monad functions for Markdown and Org readers\n      (Albert Krewinkel).  The `F` monads used for delayed evaluation\n      of certain values in the Markdown and Org readers are based on a\n      shared data type capturing the common pattern of both `F` types.\n    + Add `returnF` (Alexander Krotov).\n    + Avoid parsing `Notes:**` as a bare URI (#3570).  This avoids parsing\n      bare URIs that start with a scheme + colon + `*`, `_`, or `]`.\n    + Added `readerAbbreviations` to `ParserState`.  Markdown reader\n      now consults this to determine what is an abbreviation.\n    + Combine grid table parsers (Albert Krewinkel, #3638).  The grid table\n      parsers for markdown and rst was combined into one single\n      parser `gridTable`, slightly changing parsing behavior of both\n      parsers: (1) The markdown parser now compactifies block content\n      cell-wise: pure text blocks in cells are now treated as paragraphs\n      only if the cell contains multiple paragraphs, and as plain blocks\n      otherwise. Before, this was true only for single-column tables. (2)\n      The rst parser now accepts newlines and multiple blocks in header\n      cells.\n    + Generalize tableWith, gridTableWith (Albert Krewinkel).\n      The parsing functions `tableWith` and `gridTableWith` are generalized\n      to work with more parsers. The parser state only has to be an\n      instance of the `HasOptions` class instead of requiring a concrete\n      type. Block parsers are required to return blocks wrapped into a\n      monad, as this makes it possible to use parsers returning results\n      wrapped in `Future`s.\n\n  * `Text.Pandoc.Shared`:\n\n    + Simplify `toRomanNumeral` using guards (Alexander Krotov, #3445)\n    + `stringify`: handle Quoted better (#3958).  Previously we were losing\n      the quotation marks in Quoted elements.\n\n  * `Text.Pandoc.Writers.Shared`:\n\n    + Export `metaToJSON'`, `addVariablesToJSON` (#3439).\n      This allows us to add the variables AFTER using the metadata\n      to generate a YAML header (in the Markdown writer).\n    + Added `unsmartify` (previously in RST writer).\n      Undo literal double curly quotes.  Previously we left these.\n    + Generalize type of `metaToJSON` so it can take a Text.  Previously a\n      String was needed as argument; now any ToJSON instance will do.\n    + Added `gridTable` (previously in Markdown writer).\n    + `gridTable`: Refactored to use widths in chars.\n    + `gridTable`:  remove unnecessary extra space in cells.\n    + Fixed `addVariablesToJSON`.  It was previously not allowing multiple\n      values to become lists.\n    + Pipe tables: impose minimum cell size (see #3526).\n\n\n### Default template changes\n\n  * HTML templates (including EPUB and HTML slide show templates):\n\n    + Make default.html5 polyglot markup conformant (John Luke Bentley,\n      #3473).  Polyglot markup is HTML5 that is also valid XHTML. See\n      <https://www.w3.org/TR/html-polyglot>.  With this change, pandoc's\n      html5 writer creates HTML that is both valid HTML5 and valid XHTML.\n    + Regularized CSS in html/epub/html slide templates (#3485).\n      All templates now include `code{white-space: pre-wrap}`\n      and CSS for `q` if `--html-q-tags` is used.  Previously some templates\n      had `pre` and others `pre-wrap`; the `q` styles were only sometimes\n      included.\n    + CSS for `.smallcaps`, (Mauro Bieg, #1592)\n    + `default.revealjs`: make `history` default to true.\n    + `default.revealjs`: use lazy loading (#2283).\n    + `default.revealjs`: add `mathjax` variable and some conditional code\n      to use the MathJaX plugin.\n    + `default.slidy` uses `https` instead of `http` (ickc, #3848).\n    + `default.dzslides`: Load Google Font using HTTPS by default\n      (Yoan Blanc).\n\n  * DocBook5 template: Use `lang` and `subtitle` variables (Jens Getreu,\n    #3855).\n\n  * LaTeX/Beamer template:\n\n    + Combine LaTeX/Beamer templates (Andrew Dunning, #3878).\n      `default.beamer` has been removed; beamer now uses the\n      `default.latex` template.  Beamer-specific parts are conditional\n      on the `beamer` variable set by the writer. Note that\n      `pandoc -D beamer` will return this (combined) template.\n    + Use `xcolor` for `colorlinks` option (Andrew Dunning, #3877).\n      Beamer loads `xcolor` rather than `color`, and thus the\n      `dvipsnames` option doesn't take effect. This also provides a wider\n      range of colour selections with the `svgnames` option.\n    + Use starred versions of `xcolor` names (Andrew Dunning).\n      Prevents changes to documents defined using the `dvipsnames` list (e.g.\n      `Blue` gives a different result with svgnames enabled).\n    + Load `polyglossia` after header-includes (#3898).  It needs to be\n      loaded as late as possible.\n    + Use `unicode-math` (Vaclav Haisman).  Use `mathspec` with only\n      XeLaTeX on request.\n    + Don't load `fontspec` before `unicode-math` (over there).\n      The `unicode-math` package loads `fontspec` so explicit loading of\n      `fontspec` before `unicode-math` is not necessary.\n    + Use `unicode-math` by default in default.latex template.  mathspec will\n      be used in xelatex if the `mathspec` variable is set; otherwise\n      unicode-math will be used (Václav Haisman).\n    + Use `dvipsnames` options when `colorlinks` specified (otherwise\n      we get an error for `maroon`) (Thomas Hodgson).\n    + Added beamer `titlegraphic` and `logo` variables (Thomas Hodgson).\n    + Fix typo in fix for notes in tables (#2378, zeeMonkeez).\n    + Fix `hyperref` options clash (Andrew Dunning, #3847) Avoids an options\n      clash when loading a package (e.g. `tufte-latex`) that uses\n      `hyperref` settings different from those in the template.\n    + Add `natbiboptions` variable (#3768).\n    + Fix links inside captions in LaTeX output with links-as-notes\n      (Václav Haisman, #3651).  Declare our redefined `\\href` robust.\n    + Load `parskip` before `hyperref` (Václav Haisman, #3654).\n    + Allow setting Japanese fonts when using LuaLaTeX (Václav Haisman,\n      #3873).  by using the `luatexja-fontspec` and `luatexja-preset`\n      packages. Use existing `CJKmainfont` and `CJKoptions` template\n      variables. Add `luatexjafontspecoptions` for `luatexja-fontspec`\n      and `luatexjapresetoptions` for `luatexja-preset`.\n    + Added `aspectratio` variable to beamer template (Václav Haisman,\n      #3723).\n    + Modified template.latex to fix XeLaTex being used with tables\n      (lwolfsonkin, #3661).  Reordered `lang` variable handling to\n      immediately before `bidi`.\n\n  * ConTeXt template: Improved font handling: `simplefonts` is now\n    obsolete in ConTeXt (Pablo Rodríguez).\n\n\n### Documentation improvements\n\n  * MANUAL.txt:\n\n    + Add URL for Prince HTML > PDF engine (Ian, #3919).\n    + Document that content above slide-level will be omitted in\n      slide shows.  See #3460, #2265.\n    + Explain `--webtex` SVG url (Mauro Bieg, #3471)\n    + Small clarification in YAML metadata section.\n    + Document that html4 is technically XHTML 1.0 transitional.\n    + Remove refs to highlighting-kate (#3672).\n    + Document ibooks specific epub metadata.\n    + Clarify that mathml is used for ODT math.\n    + Mention limitations of Literate Haskell Support (#3410,\n      Joachim Breitner).\n    + Add documentation of limitations of grid tables (Stephen\n      McDowell, #3864).\n    + Clarify that meta-json contains transformed values (Jakob Voß,\n      #3491) Make clear that template variable `meta-json` does not\n      contain plain text values or JSON output format but field values\n      transformed to the selected output format.\n\n  * COPYRIGHT:\n\n    + Clarify that templates are dual-licensed.\n    + Clarify that pandoc-types is BSD3 licensed.\n    + List new files not written by jgm (Albert Krewinkel).\n    + Update dates in copyright notices (Albert Krewinkel).  This follows\n      the suggestions given by the FSF for GPL licensed software.\n      <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>\n\n  * INSTALL.md:\n\n    + Improved instructions for tests with patterns.\n    + Put RPM-based distros on separate point (Mauro Bieg, #3449)\n\n  * CONTRIBUTING.md:\n\n    + Fixed typos (Wandmalfarbe, #3479).\n    + Add \"ask on pandoc-discuss\" (Mauro Bieg).\n\n  * Add lua filter documentation in `doc/lua-filters.md`.  Note that the\n    end of this document is autogenerated from `data/pandoc.lua`\n    using `make doc/lua-filters.md`, which uses `tools/ldoc.ltp`\n    (Albert Krewinkel).\n\n  * Add `doc/filters.md`. This is the old scripting tutorial from\n    the website.\n\n  * Add `doc/using-the-pandoc-api.md` (#3289).  This gives an introduction\n    to using pandoc as a Haskell library.\n\n\n### Build infrastructure improvements\n\n  * Removed `data/templates` submodule.  Templates are now a subtree\n    in `data/templates`.  This removes the need to do `git submodule\n    update`.\n\n  * Renamed `tests` -> `test`.\n\n  * Remove `https` flag.  Always build with HTTPS support.\n\n  * Use `file-embed` instead of `hsb2hs` to embed data files when\n    `embed_data_files` flag is set.  `file-embed` gives us better dependency\n    tracking:  if a data file changes, ghc/stack/cabal know to recompile\n    the Data module.  This also removes `hsb2hs` as a build dependency.\n\n  * Add `custom-setup` stanza to pandoc, lowercase field names.\n\n  * Add `static` Cabal flag.\n\n  * Name change OSX -> MacOS.  Add a -MacOS suffix to mac package rather\n    than -OSX.  Changed local names from osx to macos.\n\n  * make_macos_package.sh - Use strip to reduce executable size.\n\n  * Revised binary linux package.  Now a completely static executable\n    is created, using Docker and alpine.  We create both a deb and a\n    tarball.  The old `deb` directory has been replaced with a `linux`\n    directory.  Running `make` in the `linux` directory should\n    perform the build, putting the binary packages in `artifacts/`.\n\n  * `linux/control.in`: add `Replaces:`, so existing pandoc-citeproc and\n    pandoc-data packages will be uninstalled; this package provides\n    both (#3822).  Add latex packages as 'suggested', update\n    description.\n\n  * Remove cpphs build requirement -- it is no longer needed.\n\n  * Replaced `{deb,macos,windows}/stack.yaml` with `stack.pkg.yaml`.\n\n  * Name change OSX -> macOS (ickc, #3869).\n\n  * Fix casing of Linux, UNIX, and Windows (ickc).\n\n  * `.travis.yml`:  create a source dist and do cabal build and test there.\n    That way we catch errors due to files missing from the data\n    section of pandoc.cabal.\n\n  * Makefile:\n\n    + Split `make haddock` from `make full`.\n    + Add BRANCH variable for winpkg.\n    + Add `lint` target.\n    + Improve `make full`. Disable optimizations.\n      Build everything, inc. trypandoc and benchmarks.  Use parallel build.\n    + Allow `make test` to take `TESTARGS`.\n\n  * Added new command tests (`Tests.Command`), using small text files\n    in `test/command/`.  Any files added in this directory will be treated\n    as shell tests (see smart.md for an example).  This makes it very easy\n    to add regression tests etc.\n\n  * Test fixes so we can find data files.  In old tests & command tests,\n    we now set the environment variable `pandoc_datadir`.  In lua tests,\n    we set the datadir explicitly.\n\n  * Refactored `compareOutput` in docx writer test.\n\n  * Consolidated some common functions in `Tests.Helper`.\n\n  * Small change to unbalanced bracket test to speed up test suite.\n\n  * Speed up Native writer quickcheck tests.\n\n  * Use tasty for tests rather than test-framework.\n\n  * Add simple Emacs mode to help with Pandoc templates editing.\n    (Václav Haisman, #3889). `tools/pandoc-template-mode.el`\n\n\n## pandoc 1.19.2.4 (2017-09-10)\n\n  * Add dependencies on texmath and skylighting to the executable.\n    This is needed for dependency version numbers to be available,\n    with Cabal > 2.\n\n## pandoc 1.19.2.3 (2017-09-09)\n\n  * Add CPP to Setup.hs so it works with Cabal >= 2 and < 2.\n\n## pandoc 1.19.2.2 (2017-09-08)\n\n  * Fix build with GHC 8.2.1 (#3876, Peter Simons).  Setup.hs does not\n    compile with Cabal 2.x, so we require an earlier version via\n    setup-depends.  The following packages need newer versions with\n    GHC 8.2.1 and had their constraints relaxed accordingly:\n    executable-path, process, syb, and time.\n\n## pandoc 1.19.2.1 (2017-01-31)\n\n  * Require skylighting >= 0.1.1.4.\n  * Adjust test output for skylighting version.\n  * Relax upper bounds on blaze-html and blaze-markup.\n\n## pandoc 1.19.2 (2017-01-29)\n\n  * Use skylighting library instead of highlighting-kate for syntax\n    highlighting. Skylighting is faster and more accurate (#3363).\n    Later we'll be able to add features like warning messages, dynamic\n    loading of xml syntax definitions, and dynamic loading of themes.\n\n  * Added a new highlight style, `breezeDark`.\n\n  * Text.Pandoc.Highlighting: Update list of `listings` languages (#3374).\n    This allows more languages to be used when using the `--listings`\n    option.\n\n  * OpenDocument writer:\n\n    + Small refactoring.  Removed separate 'parent' parameter in paraStyle.\n    + Don't profilerate text styles unnecessarily (#3371).\n      This change makes the writer create only as many temporary\n      text styles as are absolutely necessary. It also consolidates\n      adjacent nodes with the same style.\n\n  * Org reader (Albert Krewinkel):\n\n    + Allow short hand for single-line raw blocks (Albert Krewinkel,\n      #3366).  Single-line raw blocks can be given via `#+FORMAT: raw line`,\n      where `FORMAT` must be one of `latex`, `beamer`, `html`, or `texinfo`.\n    + Accept org-ref citations followed by commas (Albert Krewinkel).\n      Bugfix for an issue which, whenever the citation was immediately\n      followed by a comma, prevented correct parsing of org-ref citations.\n    + Ensure emphasis markup can be nested.  Nested emphasis markup (e.g.\n      `/*strong and emphasized*/`) was interpreted incorrectly in that the\n      inner markup was not recognized.\n    + Remove pipe char irking the haddock coverage tool (Albert Krewinkel).\n\n  * Docx reader: Empty header should be list of lists (Jesse Rosenthal).\n    In the past, the docx reader wrote an empty header as an empty list. It\n    should have the same width as a row (and be filled with empty cells).\n\n  * MediaWiki reader:\n\n    + Improved handling of display math (#3362).  Sometimes display math is\n      indented with more than one colon.  Previously we handled these cases\n      badly, generating definition lists and missing the math.\n    + Fix quotation mark parsing (#3336, tgkokk).  Change MediaWiki reader's\n      behavior when the smart option is parsed to match other readers'\n      behavior.\n\n  * Markdown reader:\n\n    + Fixed `-f markdown_github-hard_line_breaks+escaped_line_breaks`\n      (#3341).  Previously this did not properly enable escaped line breaks.\n    + Disallow space between inline code and attributes (#3326, #3323,\n      Mauro Bieg).\n\n  * DocBook5 writer: make id attribute xml:id, fixes #3329 (#3330, Mauro Bieg).\n\n  * Added some test cases for ODT reader (#3306, #3308, Hubert Plociniczak).\n\n  * LaTeX writer: allow tables with empty cells to count as \"plain.\"\n    This addresses a problem of too-wide tables when empty cells\n    are used.  Thanks to Joost Kremers for reporting the issue.\n\n  * Org writer: prefix footnote numbers with `fn:` (Albert Krewinkel).\n    Unprefixed numbers where used by older org-mode versions, but are no\n    longer supported.\n\n  * HTML writer: don't process pars with empty RawInline, (#1040, #3327,\n    Mauro Bieg).\n\n  * Markdown writer: Fix display math with `--webtex` (#3298).\n\n  * Fix sample.lua so it properly handles raw blocks/inlines (#3358,\n    bumper314).\n\n  * Templates:\n\n    + default.latex: Moved geometry after hyperref (Václav Haisman).\n      Otherwise PDF sizes can be wrong in some circumstances.\n    + Copied a few changes from default.latex to default.beamer\n      (Wandmalfarbe).\n    + default.latex, default.beamer: Changed position of `\\VerbatimNotes`\n      and `fancyvrb`.  This fixes hyperlinks on footnotes in documents\n      that contain verbatim in notes (#3361).  (Note: the beamer template\n      was updated to match the LaTeX template, but at this point verbatim\n      in notes seems not to work in beamer.)\n    + default.latex: Allow passing `microtypeoptions` to microtype\n      (Václav Haisman).\n    + default.latex: Add hyphen option to url package.\n    + default.docbook5: Fix namespace declarations (Mauro Bieg).\n\n  * Moved `make_osx_package.sh` to `osx/` directory.\n\n  * Travis continuous integration:\n\n    + Fix false positives with dist build.\n    + Speed improvements (Kolen Cheung, #3304, #3357).\n\n  * MANUAL.txt:\n\n    + Clarify that blank space is needed around footnotes (#3352).\n    + Fixed typo (#3351, Alexey Rogechev).\n    + Note that `--wrap=auto` does not work in HTML output.\n    + Default `--columns` width is 72, not 80.\n    + Fixed broken links (#3316, Kolen Cheung).\n    + Document usage of `@*` in nocite section (#3333, John Muccigrosso).\n\n  * INSTALL.md:\n\n    + Indent code so it's properly formatted (#3335, Bheesham Persaud).\n    + Added instructions for extracting binary from OSX, Windows packages.\n\n  * CONTRIBUTING.md: Describe labels currently used in issue tracker\n    (Albert Krewinkel).  The labels have changed over time, the list of\n    labels is updated to reflect the current set of labels used in the\n    issue tracker.\n\n  * Rearrange and extend badges in README (Albert Krewinkel, #3354)\n\n  * Bumped version bounds for dependencies.\n\n\n## pandoc 1.19.1 (2016-12-10)\n\n  * Set `PANDOC_VERSION` environment variable for filters (#2640).\n    This allows filters to check the pandoc version that produced\n    the JSON they are receiving.\n\n  * Docx reader: Ensure one-row tables don't have header (#3285,\n    Jesse Rosenthal).  Tables in MS Word are set by default to have\n    special first-row formatting, which pandoc uses to determine whether\n    or not they have a header. This means that one-row tables will, by\n    default, have only a header -- which we imagine is not what people\n    want. This change ensures that a one-row table is not understood to\n    be a header only.  Note that this means that it is impossible to\n    produce a header-only table from docx, even though it is legal\n    pandoc. But we believe that in nearly all cases, it will be an\n    accidental (and unwelcome) result\n\n  * HTML reader:\n\n    + Fixed some bad regressions in HTML table parser (#3280).\n      This regression leads to the introduction of empty rows\n      in some circumstances.\n    + Understand `style=width:` as well as `width` in `col` (#3286).\n\n  * RST reader:\n\n    + Print warnings when keys, substitition, notes not found.\n      Previously the parsers failed and we got raw text.  Now we get a\n      link with an empty URL, or empty inlines in the case of a note or\n      substitution.\n\n    + Fix hyperlink aliases (#3283).\n\n  * Man writer: Ensure that periods are escaped at beginning of line\n    (#3270).\n\n  * LaTeX writer: Fix unnumbered headers when used with `--top-level`\n    (#3272, Albert Krewinkel). Fix interaction of top-level\n    divisions `part` or `chapter` with unnumbered headers when\n    emitting LaTeX. Headers are ensured to be written using\n    stared commands (like `\\subsection*{}`).\n\n  * LaTeX template: use comma not semicolon to separate keywords for\n    `pdfkeywords`.  Thanks to Wandmalfarbe.\n\n  * Markdown writer: Fixed incorrect word wrapping (#3277).\n    Previously pandoc would sometimes wrap lines too early due to\n    this bug.\n\n  * Text.Pandoc.Pretty:  Added `afterBreak` [API change].  This makes it\n    possible to insert escape codes for content that needs escaping at the\n    beginning of a line.\n\n  * Removed old MathMLInHTML.js from 2004, which should no longer\n    be needed for MathML with modern browsers.\n\n  * Fixed tests with dynamic linking (#2709).\n\n  * Makefile: Use stack instead of cabal for targets.  This is just\n    a convenience for developers.\n\n  * Fixed bash completion of filenames with space (#2749).\n\n  * MANUAL: improved documentation on how to create a custom\n    `reference.docx`.\n\n  * Fix minor spelling typos in the manual (#3273, Anthony Geoghegan)\n\n## pandoc 1.19 (2016-12-01)\n\n  * Changed resolution of filter paths.\n\n    + We now first treat the argument of `--filter` as a full (absolute\n      or relative) path, looking for a program there. If it's found, we\n      run it.\n    + If not, and if it is a simple program name or a relative path, we\n      try resolving it relative to `$DATADIR/filters`.\n    + If this fails, then we treat it as a program name and look in the\n      user's PATH.\n    + Removed a hardcoded '/' that may have caused problems with\n      Windows paths.\n\n    Previously if you did `--filter foo` and you had `foo` in your path and\n    also an executable `foo` in your working directory, the one in the path\n    would be used. Now the one in the working directory is used.\n\n    In addition, when you do `--filter foo/bar.hs`, pandoc will now find a\n    filter `$DATADIR/filters/foo/bar.hs` -- assuming there isn't a\n    `foo/bar.hs` relative to the working directory.\n\n  * Allow `file://` URIs as arguments (#3196). Also improved default reader\n    format detection. Previously with a URI ending in .md or .markdown,\n    pandoc would assume HTML input. Now it treats these as markdown.\n\n  * Allow to overwrite top-level division type heuristics (#3258,\n    Albert Krewinkel). Pandoc uses heuristics to determine the most\n    reasonable top-level division type when emitting LaTeX or\n    Docbook markup. It is now possible to overwrite this implicitly set\n    top-level division via the `top-level-division` command line parameter.\n\n  * Text.Pandoc.Options \\[API changes\\]:\n\n    + Removed `writerStandalone` field in `WriterOptions`, made\n      `writerTemplate` a `Maybe` value. Previously setting\n      `writerStandalone = True` did nothing unless a template was provided\n      in writerTemplate. Now a fragment will be generated if\n      `writerTemplate` is `Nothing`; otherwise, the specified template\n      will be used and standalone output generated.\n    + `Division` has been renamed `TopLevelDivision` (#3197). The\n      `Section`, `Chapter`, and `Part` constructors were renamed to\n      `TopLevelSection`, `TopLevelChapter`, and\n      `TopLevelPart`, respectively. An additional `TopLevelDefault`\n      constructor was added, which is now also the new default value of\n      the `writerTopLevelDivision` field in `WriterOptions`.\n\n  * Improved error if they give wrong arg to `--top-level-division`.\n\n  * Use new module from texmath to lookup MS font codepoints in Docx reader.\n    Removed unexported module Text.Pandoc.Readers.Docx.Fonts. Its code now\n    lives in texmath (0.9).\n\n  * DocBook reader: Fixed xref lookup (#3243). It previously only worked\n    when the qnames lacked the docbook namespace URI.\n\n  * HTML reader:\n\n    + Improved table parsing (#3027). We now check explicitly for non-1\n      rowspan or colspan attributes, and fail when we encounter them.\n      Previously we checked that each row had the same number of cells,\n      but that could be true even with rowspans/colspans. And there are\n      cases where it isn't true in tables that we can handle fine -- e.g.\n      when a tr element is empty. So now we just pad rows with empty cells\n      when needed.\n    + Treat `<math>` as MathML by default unless something else is\n      explicitly specified in xmlns. Provided it parses as MathML,\n      of course. Also fixed default which should be to inline math if no\n      display attribute is used.\n    + Only treat \"a\" element as link if it has href (#3226). Otherwise\n      treat as span.\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Add a placeholder value for CHART. We wrap `[CHART]` in a\n      `<span class=\"chart\">`. Note that it maps to inlines because, in\n      docx, anything in a drawing tag can be part of a larger paragraph.\n    + Be more specific in parsing images We not only want `w:drawing`,\n      because that could also include charts. Now we specify\n      `w:drawing/pic:pic`. This shouldn't change behavior at all, but it's\n      a first step toward allowing other sorts of drawing data as well.\n    + Abstract out function to avoid code repetition.\n    + Update tests for img title and alt (#3204).\n    + Handle Alt text and titles in images. We use the \"description\" field\n      as alt text and the \"title\" field as title. These can be accessed\n      through the \"Format Picture\" dialog in Word.\n    + Docx reader utils: handle empty namespace in `elemName`. Previously,\n      if given an empty namespace `(elemName ns \"\" \"foo\")` `elemName`\n      would output a QName with a `Just \"\"` namespace. This is never what\n      we want. Now we output a `Nothing`. If someone *does* want a\n      `Just \"\"` in the namespace, they can enter the QName\n      value explicitly.\n\n  * ODT reader/writer:\n\n    + Inline code when text has a special style (Hubert Plociniczak). When\n      a piece of text has a text `Source_Text` then we assume that this is\n      a piece of the document that represents a code that needs to\n      be inlined. Adapted the writer to also reflect that change.\n      Previously it was just writing a 'preformatted' text using a\n      non-distinguishable font style. Code blocks are still not recognized\n      by the ODT reader. That's a separate issue.\n    + Infer table's caption from the paragraph (#3224,\n      Hubert Plociniczak). ODT's reader always put empty captions for the\n      parsed tables. This commit\n\n        1.  checks paragraphs that follow the table definition\n        2.  treats specially a paragraph with a style named 'Table'\n        3.  does some postprocessing of the paragraphs that combines tables\n            followed immediately by captions\n\n      The ODT writer used the `TableCaption` style for the caption\n      paragraph.  This commit follows the OpenOffice approach which allows\n      for appending captions to table but uses a built-in style named\n      `Table` instead of `TableCaption`. Users of a custom `reference.odt`\n      should change the style's name from `TableCaption` to `Table`.\n\n  * ODT reader: Infer tables' header props from rows (#3199,\n    Hubert Plociniczak). ODT reader simply provided an empty header list\n    which meant that the contents of the whole table, even if not empty, was\n    simply ignored. While we still do not infer headers we at least have to\n    provide default properties of columns.\n\n  * Markdown reader:\n\n    +   Allow reference link labels starting with `@...` if `citations`\n        extension disabled (#3209). Example: in\n\n            \\[link text\\]\\[@a\\]\n\n        `link text` isn't hyperlinked because `[@a]` is parsed as\n        a citation. Previously this happened whether or not the `citations`\n        extension was enabled. Now it happens only if the `citations`\n        extension is enabled.\n    +   Allow alignments to be specified in Markdown grid tables. For\n        example,\n\n            +-------+---------------+--------------------+\n            | Right    | Left                 | Centered |\n            +=========:+:=================+:=============:+\n            | Bananas | $1.34         | built-in wrapper |\n            +-------+---------------+--------------------+\n\n    +   Allow Small Caps elements to be created using bracketed spans (as\n        they already can be using HTML-syntax spans) (#3191, Kolen Cheung).\n\n  * LaTeX reader:\n\n    + Don't treat `\\vspace` and `\\hspace` as block commands (#3256).\n      Fixed an error which came up, for example, with `\\vspace` inside\n      a caption. (Captions expect inlines.)\n    + Improved table handling. We can now parse all of the tables emitted\n      by pandoc in our tests. The only thing we don't get yet are\n      alignments and column widths in more complex tables. See #2669.\n    + Limited support for minipage.\n    + Allow for `[]`s inside LaTeX optional args. Fixes cases like:\n    + Handle BVerbatim from fancyvrb (#3203).\n    + Handle hungarumlaut (#3201).\n    + Allow beamer-style `<...>` options in raw LaTeX (also in Markdown)\n      (#3184). This allows use of things like `\\only<2,3>{my content}` in\n      Markdown that is going to be converted to beamer.\n\n  * Use pre-wrap for code in dzslides template (Nicolas Porcel). Otherwise\n    overly long code will appear on every slide.\n\n  * Org reader (Albert Krewinkel):\n\n    +   Respect column width settings (#3246). Table column properties can\n        optionally specify a column's width with which it is displayed in\n        the buffer. Some exporters, notably the ODT exporter in org-mode\n        v9.0, use these values to calculate relative column widths. The org\n        reader now implements the same behavior. Note that the org-mode\n        LaTeX and HTML exporters in Emacs don't support this feature yet,\n        which should be kept in mind by users who use the column\n        widths parameters.\n    +   Allow HTML attribs on non-figure images (#3222). Images which are\n        the only element in a paragraph can still be given HTML attributes,\n        even if the image does not have a caption and is hence not a figure.\n        The following will add set the `width` attribute of the image to\n        `50%`:\n\n            +ATTR\\_HTML: :width 50%\n            =======================\n\n            \\[\\[file:image.jpg\\]\\]\n\n    +   Support `ATTR_HTML` for special blocks (#3182). Special\n        blocks (i.e. blocks with unrecognized names) can be prefixed with an\n        `ATTR_HTML` block attribute. The attributes defined in that\n        meta-directive are added to the `Div` which is used to represent the\n        special block.\n    +   Support the `todo` export option. The `todo` export option allows to\n        toggle the inclusion of TODO keywords in the output. Setting this to\n        `nil` causes TODO keywords to be dropped from headlines. The default\n        is to include the keywords.\n    +   Add support for todo-markers. Headlines can have optional\n        todo-markers which can be controlled via the `#+TODO`, `#+SEQ_TODO`,\n        or `#+TYP_TODO` meta directive. Multiple such directives can be\n        given, each adding a new set of recognized todo-markers. If no\n        custom todo-markers are defined, the default `TODO` and `DONE`\n        markers are used. Todo-markers are conceptually separate from\n        headline text and are hence excluded when autogenerating\n        headline IDs. The markers are rendered as spans and labelled with\n        two classes: One class is the markers name, the other signals the\n        todo-state of the marker (either `todo` or `done`).\n\n  * LaTeX writer:\n\n    + Use `\\autocites*` when \"suppress-author\" citation used.\n    + Ensure that simple tables have simple cells (#2666). If cells\n      contain more than a single Plain or Para, then we need to set\n      nonzero widths and put contents into minipages.\n    + Remove invalid inlines in sections (#3218, Hubert Plociniczak).\n\n  * Markdown writer:\n\n    + Fix calculation of column widths for aligned multiline tables\n      (#1911, Björn Peemöller). This also fixes excessive CPU and memory\n      usage for tables when `--columns` is set in such a way that cells\n      must be very tiny. Now cells are guaranteed to be big enough so that\n      single words don't need to line break, even if this pushes the line\n      length above the column width.\n    + Use bracketed form for native spans when `bracketed_spans`\n      enabled (#3229).\n    + Fixed inconsistent spacing issue (#3232). Previously a tight bullet\n      sublist got rendered with a blank line after, while a tight ordered\n      sublist did not. Now we don't get the blank line in either case.\n    + Fix escaping of spaces in super/subscript (#3225). Previously two\n      backslashes were inserted, which gave a literal backslash.\n    + Adjust widths in Markdown grid tables so that they match\n      on round-trip.\n\n  * Docx writer:\n\n    + Give full detail when there are errors converting tex math.\n    + Handle title text in images (Jesse Rosenthal). We already handled\n      alt text. This just puts the image \"title\" into the docx\n      \"title\" attr.\n    + Fixed XML markup for empty cells (#3238). Previously the Compact\n      style wasn't being applied properly to empty cells.\n\n  * HTML writer:\n\n    + Updated `renderHtml` import from blaze-html.\n\n  * Text.Pandoc.Pretty:\n\n    + Fixed some bugs that caused blank lines in tables (#3251). The bugs\n      caused spurious blank lines in grid tables when we had things like\n      `blankline $$ blankline`.\n    + Add exported function `minOffet` \\[API change\\] (Björn Peemöller).\n    + Added error message for illegal call to `block` (Björn Peemöller).\n\n  * Text.Pandoc.Shared:\n\n    + Put `warn` in MonadIO.\n    + `fetchItem`: Better handling of protocol-relative URL (#2635). If\n      URL starts with `//` and there is no \"base URL\" (as there would be\n      if a URL were used on the command line), then default to http:.\n\n  * Export Text.Pandoc.getDefaultExtensions \\[API change\\] (#3178).\n\n  * In --version, trap error in `getAppUserDataDirectory` (#3241). This\n    fixes a crash with `pandoc --version` on unusual systems with no real\n    user (e.g. SQL Server 2016).\n\n  * Added weigh-pandoc for memory usage diagnostics (#3169).\n\n  * Use correct mime types for woff and woff2 (#3228).\n\n  * Remove make\\_travis\\_yml.hs (#3235, Kolen Cheung).\n\n  * changelog: Moved an item that was misplaced in the 1.17.2 section to the\n    1.18 section where it belongs.\n\n  * CONTRIBUTING.md: minor change in wording and punctuation (#3252,\n    Kolen Cheung).\n\n  * Further revisions to manual for `--version` changes (#3244).\n\n\n\n## pandoc 1.18 (2016-10-26)\n\n  * Added `--list-input-formats`, `--list-output-formats`,\n    `--list-extensions`, `--list-highlight-languages`, and\n    `--list-highlight-styles` (#3173).  Removed list of highlighting\n    languages from `--version` output.  Removed list of input and output\n    formats from default `--help` output.\n\n  * Added `--reference-location=block|section|document` option\n    (Jesse Rosenthal).  This determines whether Markdown link references\n    and footnotes are placed at the end of the document, the end of the\n    section, or the end of the top-level block.\n\n  * Added `--top-level-division=section|chapter|part` (Albert Krewinkel).\n    This determines what a level-1 header corresponds to in LaTeX,\n    ConTeXt, DocBook, and TEI output.  The default is `section`.\n    The `--chapters` option has been deprecated in favor of\n    `--top-level-division=chapter`.\n\n  * Added `LineBlock` constructor for `Block` (Albert Krewinkel).  This\n    is now used in parsing RST and Markdown line blocks, DocBook\n    `linegroup`/`line` combinations, and Org-mode `VERSE` blocks.\n    Previously `Para` blocks with hard linebreaks were used.  `LineBlock`s\n    are handled specially in the following output formats: AsciiDoc\n    (as `[verse]` blocks), ConTeXt (`\\startlines`/`\\endlines`),\n    HTML (`div` with a style), Markdown (line blocks if `line_blocks`\n    is enabled), Org-mode (`VERSE` blocks), RST (line blocks). In\n    other output formats, a paragraph with hard linebreaks is emitted.\n\n  * Allow binary formats to be written to stdout (but not to tty) (#2677).\n    Only works on posix, since we use the unix library to check whether\n    output is to tty.  On Windows, pandoc works as before and always requires\n    an output file parameter for binary formats.\n\n  * Changed JSON output format (Jesse Rosenthal).  Previously we used\n    generically generated JSON, but this was subject to change depending\n    on the version of aeson pandoc was compiled with.  To ensure stability,\n    we switched to using manually written ToJSON and FromJSON\n    instances, and encoding the API version.  **Note:**  pandoc filter\n    libraries will need to be revised to handle the format change.\n    Here is a summary of the essential changes:\n\n    + The toplevel JSON format is now `{\"pandoc-api-version\" :\n      [MAJ, MIN, REV], \"meta\" : META, \"blocks\": BLOCKS}`\n      instead of `[{\"unMeta\": META}, [BLOCKS]]`.\n      Decoding fails if the major and minor version numbers don't\n      match.\n    + Leaf nodes no longer have an empty array for their \"c\" value.\n      Thus, for example, a `Space` is encoded as `{\"t\":\"Space\"}`\n      rather than `{\"t\":\"Space\",\"c\":[]}` as before.\n\n  * Removed `tests/Tests/Arbitrary.hs` and added a `Text.Pandoc.Arbitrary`\n    module to pandoc-types (Jesse Rosenthal).  This makes it easier\n    to use QuickCheck with pandoc types outside of pandoc itself.\n\n  * Add `bracketed_spans` Markdown extension, enabled by default\n    in pandoc `markdown`.  This allows you to create a native span\n    using this syntax:  `[Here is my span]{#id .class key=\"val\"}`.\n\n  * Added `angle_brackets_escapable` Markdown extension (#2846).\n    This is needed because github flavored Markdown has a slightly\n    different set of escapable symbols than original Markdown;\n    it includes angle brackets.\n\n  * Export `Text.Pandoc.Error` in `Text.Pandoc` [API change].\n\n  * Print highlighting-kate version in `--version`.\n\n  * `Text.Pandoc.Options`:\n\n    + `Extension` has new constructors `Ext_brackted_spans` and\n      `Ext_angle_brackets_escapable` [API change].\n    + Added `ReferenceLocation` type [API change] (Jesse Rosenthal).\n    + Added `writerReferenceLocation` field to `WriterOptions` (Jesse\n      Rosenthal).\n\n  * `--filter`:  we now check `$DATADIR/filters` for filters before\n    looking in the path (#3127, Jesse Rosenthal, thanks to Jakob\n    Voß for the idea).  Filters placed in this directory need not\n    be executable; if the extension is `.hs`, `.php`, `.pl`, `.js`,\n    or `.rb`, pandoc will run the right interpreter.\n\n  * For `--webtex`, replace deprecated Google Chart API by CodeCogs as\n    default (Kolen Cheung).\n\n  * Removed `raw_tex` extension from `markdown_mmd` defaults (Kolen Cheung).\n\n  * Execute .js filters with node (Jakob Voß).\n\n  * Textile reader:\n\n    + Support `bc..` extended code blocks (#3037).  Also, remove trailing\n      newline in code blocks (consistently with Markdown reader).\n    + Improve table parsing.  We now handle cell and row attributes, mostly\n      by skipping them.  However, alignments are now handled properly.\n      Since in pandoc alignment is per-column, not per-cell, we\n      try to devine column alignments from cell alignments.\n      Table captions are also now parsed, and textile indicators\n      for thead and tfoot no longer cause parse failure.  (However,\n      a row designated as tfoot will just be a regular row in pandoc.)\n    + Improve definition list parsing.  We now allow multiple terms\n      (which we concatenate with linebreaks).  An exponential parsing\n      bug (#3020) is also fixed.\n    + Disallow empty URL in explicit link (#3036).\n\n  * RST reader:\n\n    + Use Div instead of BlockQuote for admonitions (#3031).\n      The Div has class `admonition` and (if relevant) one of the\n      following:  `attention`, `caution`, `danger`, `error`, `hint`,\n      `important`, `note`, `tip`, `warning`.  **Note:** This will change\n      the rendering of some RST documents!  The word (\"Warning\", \"Attention\",\n      etc.) is no longer added; that must be done with CSS or a filter.\n    + A Div is now used for `sidebar` as well.\n    + Skip whitespace before note (Jesse Rosenthal, #3163).  RST requires a\n      space before a footnote marker. We discard those spaces so that footnotes\n      will be adjacent to the text that comes before it. This is in line with\n      what rst2latex does.\n    + Allow empty lines when parsing line blocks (Albert Krewinkel).\n\n  * Markdown reader:\n\n    + Allow empty lines when parsing line blocks (Albert Krewinkel).\n    + Allow attributes on autolinks (#3183, Daniele D'Orazio).\n\n  * LaTeX reader:\n\n    + More robust parsing of unknown environments (#3026).\n      We no longer fail on things like `^` inside options for tikz.\n    + Be more forgiving of non-standard characters, e.g. `^` outside of math.\n      Some custom environments give these a meaning, so we should try not to\n      fall over when we encounter them.\n    + Drop duplicate `*` in bibtexKeyChars (Albert Krewinkel)\n\n  * MediaWiki reader:\n\n    + Fix for unquoted attribute values in mediawiki tables (#3053).\n      Previously an unquoted attribute value in a table row\n      could cause parsing problems.\n    + Improved treatment of verbatim constructions (#3055).\n      Previously these yielded strings of alternating Code and Space\n      elements; we now incorporate the spaces into the Code.  Emphasis\n      etc. is still possible inside these.\n    + Properly interpret XML tags in pre environments (#3042).  They are meant\n      to be interpreted as literal text.\n\n  * EPUB reader:  don't add root path to data: URIs (#3150).\n    Thanks to @lep for the bug report and patch.\n\n  * Org reader (Albert Krewinkel):\n\n    + Preserve indentation of verse lines (#3064).  Leading spaces in verse\n      lines are converted to non-breaking spaces, so indentation is preserved.\n    + Ensure image sources are proper links.  Image sources as those in plain\n      images, image links, or figures, must be proper URIs or relative file\n      paths to be recognized as images.  This restriction is now enforced\n      for all image sources.  This also fixes the reader's usage of uncleaned\n      image sources, leading to `file:` prefixes not being deleted from\n      figure images.  Thanks to @bsag for noticing this bug.\n    + Trim verse lines properly (Albert Krewinkel).\n    + Extract meta parsing code to module.  Parsing of meta-data is well\n      separable from other block parsing tasks.  Moving into new module to\n      get small files and clearly arranged code.\n    + Read markup only for special meta keys.  Most meta-keys should be read\n      as normal string values, only a few are interpreted as marked-up text.\n    + Allow multiple, comma-separated authors.  Multiple authors can be\n      specified in the `#+AUTHOR` meta line if they are given as a\n      comma-separated list.\n    + Give precedence to later meta lines.  The last meta-line of any given\n      type is the significant line.  Previously the value of the first line\n      was kept, even if more lines of the same type were encountered.\n    + Read LaTeX_header as header-includes.  LaTeX-specific header commands\n      can be defined in `#+LaTeX_header` lines.  They are parsed as\n      format-specific inlines to ensure that they will only show up in LaTeX\n      output.\n    + Set documentclass meta from LaTeX_class.\n    + Set classoption meta from LaTeX_class_options.\n    + Read HTML_head as header-includes.  HTML-specific head content can be\n      defined in `#+HTML_head` lines.  They are parsed as format-specific\n      inlines to ensure that they will only show up in HTML output.\n    + Respect `author` export option.  The `author` option controls whether\n      the author should be included in the final markup.  Setting\n      `#+OPTIONS: author:nil` will drop the author from the final meta-data\n      output.\n    + Respect `email` export option.  The `email` option controls whether the\n      email meta-field should be included in the final markup. Setting\n      `#+OPTIONS: email:nil` will drop the email field from the final\n      meta-data output.\n    + Respect `creator` export option.  The `creator` option controls whether\n      the creator meta-field should be included in the final markup.  Setting\n      `#+OPTIONS: creator:nil` will drop the creator field from the final\n      meta-data output.  Org-mode recognizes the special value `comment` for\n      this field, causing the creator to be included in a comment.  This is\n      difficult to translate to Pandoc internals and is hence interpreted the\n      same as other truish values (i.e. the meta field is kept if it's\n      present).\n    + Respect unnumbered header property (#3095).  Sections the `unnumbered`\n      property should, as the name implies, be excluded from the automatic\n      numbering of section provided by some output formats.  The Pandoc\n      convention for this is to add an \"unnumbered\" class to the header.  The\n      reader treats properties as key-value pairs per default, so a special\n      case is added to translate the above property to a class instead.\n    + Allow figure with empty caption (Albert Krewinkel, #3161).\n      A `#+CAPTION` attribute before an image is enough to turn an image into\n      a figure. This wasn't the case because the `parseFromString` function,\n      which processes the caption value, would fail on empty values. Adding\n      a newline character to the caption value fixes this.\n\n  * Docx reader:\n\n    + Use XML convenience functions (Jesse Rosenthal).\n      The functions `isElem` and `elemName` (defined in Docx/Util.hs) make\n      the code a lot cleaner than the original XML.Light functions, but they\n      had been used inconsistently. This puts them in wherever applicable.\n    + Handle anchor spans with content in headers.  Previously, we would only\n      be able to figure out internal links to a header in a docx if the\n      anchor span was empty. We change that to read the inlines out of the\n      first anchor span in a header.\n    + Let headers use existing id.  Previously we always generated an id for\n      headers (since they wouldn't bring one from Docx). Now we let it use an\n      existing one if possible. This should allow us to recurs through anchor\n      spans.\n    + Use all anchor spans for header ids.  Previously we only used the first\n      anchor span to affect header ids. This allows us to use all the anchor\n      spans in a header, whether they're nested or not (#3088).\n    + Test for nested anchor spans in header.  This ensures that anchor spans\n      in header with content (or with other anchor spans inside) will resolve\n      to links to a header id properly.\n\n  * ODT reader (Hubert Plociniczak)\n\n    + Include list's starting value.  Previously the starting value of\n      the lists' items has been hardcoded to 1. In reality ODT's list\n      style definition can provide a new starting value in one of its\n      attributes.\n    + Infer caption from the text following the image.\n      Frame can contain other frames with the text boxes.\n    + Add `fig:` to title for Image with a caption (as expected\n      by pandoc's writers).\n    + Basic support for images in ODT documents.\n    + Don't duplicate text for anchors (#3143).  When creating an anchor\n      element we were adding its representation as well as the original\n      content, leading to text duplication.\n\n  * DocBook writer:\n\n    + Include an anchor element when a div or span has an id (#3102).\n      Note that DocBook does not have a class attribute, but at least this\n      provides an anchor for internal links.\n\n  * LaTeX writer:\n\n    + Don't use * for unnumbered paragraph, subparagraph.  The starred\n      variants don't exist.  This helps with part of #3058...it gets rid of\n      the spurious `*`s.  But we still have numbers on the 4th and 5th level\n      headers.\n    + Properly escape backticks in verbatim (#3121, Jesse Rosenthal).\n      Otherwise they can cause unintended ligatures like `` ?` ``.\n    + Handle NARRAOW NO-BREAK SPACE into LaTeX (Vaclav Zeman) as `\\,`.\n    + Don't include `[htbp]` placement for figures (#3103, Václav Haisman).\n      This allows figure placement defaults to be changed by the user\n      in the template.\n\n  * TEI writer: remove heuristic to detect book template (Albert Krewinkel).\n    TEI doesn't have `<book>` elements but only generic `<divN>` division\n    elements. Checking the template for a trailing `</book>` is nonsensical.\n\n  * MediaWiki writer:  transform filename with underscores in images (#3052).\n    `foo bar.jpg` becomes `foo_bar.jpg`. This was already done\n    for internal links, but it also needs to happen for images.\n\n  * ICML writer: replace partial function (!!) in table handling (#3175,\n    Mauro Bieg).\n\n  * Man writer: allow section numbers that are not a single digit (#3089).\n\n  * AsciiDoc writer: avoid unnecessary use of \"unconstrained\" emphasis\n    (#3068).  In AsciiDoc, you must use a special form of emphasis\n    (double `__`) for intraword emphasis.  Pandoc was previously using\n    this more than necessary.\n\n  * EPUB writer:  use stringify instead of plain writer for metadata\n    (#3066).  This means that underscores won't be used for emphasis,\n    or CAPS for bold.  The metadata fields will just have unadorned\n    text.\n\n  * Docx Writer:\n\n    + Implement user-defined styles (Jesse Rosenthal).  Divs and Spans\n      with a `custom-style` key in the attributes will apply the corresponding\n      key to the contained blocks or inlines.\n    + Add ReaderT env to the docx writer (Jesse Rosenthal).\n    + Clean up and streamline RTL behavior (Jesse Rosenthal, #3140).\n      You can set `dir: rtl` in YAML metadata, or use `-M dir=rtl`\n      on the command line.  For finer-grained control, you can set\n      the `dir` attribute in Div or Span elements.\n\n  * Org writer (Albert Krewinkel):\n\n    + Remove blank line after figure caption.  Org-mode only treats an image\n      as a figure if it is directly preceded by a caption.\n    + Ensure blank line after figure.  An Org-mode figure should be surrounded\n      by blank lines.  The figure would be recognized regardless, but images\n      in the following line would unintentionally be treated as figures as\n      well.\n    + Ensure link targets are paths or URLs.  Org-mode treats links as\n      document internal searches unless the link target looks like a URL or\n      file path, either relative or absolute.  This change ensures that this\n      is always the case.\n    + Translate language identifiers.  Pandoc and Org-mode use different\n      programming language identifiers.  An additional translation between\n      those identifiers is added to avoid unexpected behavior.  This fixes a\n      problem where language specific source code would sometimes be output\n      as example code.\n    + Drop space before footnote markers (Albert Krewinkel, #3162).\n      The writer no longer adds an extra space before footnote markers.\n\n  * Markdown writer:\n\n    + Don't emit HTML for tables unless `raw_html` extension is set (#3154).\n      Emit `[TABLE]` if no suitable table formats are enabled and raw HTML\n      is disabled.\n    + Check for the `raw_html` extension before emitting a raw HTML block.\n    + Abstract out note/ref function (Jesse Rosenthal).\n    + Add ReaderT monad for environment variables (Jesse Rosenthal).\n\n  * HTML, EPUB, slidy, revealjs templates: Use `<p>` instead of `<h1>` for\n    subtitle, author, date (#3119).  Note that, as a result of this change,\n    authors may need to update CSS.\n\n  * revealjs template:  Added `notes-server` option\n    (jgm/pandoc-templates#212, Yoan Blanc).\n\n  * Beamer template:\n\n    + Restore whitespace between paragraphs. This was\n      a regression in the last release (jgm/pandoc-templates#207).\n    + Added `themeoptions` variable (Carsten Gips).\n    + Added `beamerarticle` variable.  This causes the `beamerarticle`\n      package to be loaded in beamer, to produce an article from beamer\n      slides.  (Carsten Gips)\n    + Added support for `fontfamilies` structured variable\n      (Artem Klevtsov).\n    + Added hypersetup options (Jake Zimmerman).\n\n  * LaTeX template:\n\n    + Added dummy definition for `\\institute`.\n      This isn't a standard command, and we want to avoid a crash when\n      `institute` is used with the default template.\n    + Define default figure placement (Václav Haisman), since pandoc\n      no longer includes `[htbp]` for figures.  Users with custom templates\n      will want to add this. See #3103.\n    + Use footnote package to fix notes in tables (jgm/pandoc-templates#208,\n      Václav Haisman).\n\n  * Moved template compiling/rendering code to a separate library.\n    `doctemplates`.  This allows the pandoc templating system to be\n    used independently.\n\n  * Text.Pandoc.Error: Fix out of index error in `handleError`\n    (Matthew Pickering).  The fix is to not try to show the exact line when\n    it would cause an out-of-bounds error as a result of included files.\n\n  * Text.Pandoc.Shared: Add `linesToBlock` function (Albert Krewinkel).\n\n  * Text.Pandoc.Parsing.emailAddress: tighten up parsing of email\n    addresses.  Technically `**@user` is a valid email address, but if we\n    allow things like this, we get bad results in markdown flavors\n    that autolink raw email addresses (see #2940).  So we exclude a few\n    valid email addresses in order to avoid these more common bad cases.\n\n  * Text.Pandoc.PDF:  Don't crash with nonexistent image (#3100).  Instead,\n    emit the alt text, emphasized.  This accords with what the ODT writer\n    currently does.  The user will still get a warning about a nonexistent\n    image.\n\n  * Fix example in API documentation (#3176, Thomas Weißschuh).\n\n  * Tell where to get tarball in INSTALL (#3062).\n\n  * Rename README to MANUAL.txt and add GitHub-friendly README.md\n    (Albert Krewinkel, Kolen Cheung).\n\n  * Replace COPYING with Markdown version COPYING.md from GNU (Kolen Cheung).\n\n  * MANUAL.txt:\n\n    + Put note on structured vars in separate paragraph (#2148, Albert\n      Krewinkel).  Make it clearer that structured author variables require a\n      custom template\n    + Note that `--katex` works best with `html5` (#3077).\n    + Fix the LaTeX and EPUB links in manual (Morton Fox).\n    + Document `biblio-title` variable.\n\n  * Improve spacing of footnotes in `--help` output (Waldir Pimenta).\n\n  * Update KaTeX to v0.6.0 (Kolen Cheung).\n\n  * Allow latest dependencies.\n\n  * Use texmath 0.8.6.6 (#3040).\n\n  * Allow http-client 0.4.30, which is the version in stackage lts.\n    Previously we required 0.5.\n    Remove CPP conditionals for earlier versions.\n\n  * Remove support for GHC < 7.8 (Jesse Rosenthal).\n\n    + Remove Compat.Monoid.\n    + Remove an inline monad compatibility macro.\n    + Remove Text.Pandoc.Compat.Except.\n    + Remove directory compat.\n    + Change constraint on mtl.\n    + Remove unnecessary CPP condition in UTF8.\n    + Bump base lower bound to 4.7.\n    + Remove 7.6 build from .travis.yaml.\n    + Bump supported ghc version in CONTRIBUTING.md.\n    + Add note about GHC version support to INSTALL.\n    + Remove GHC 7.6 from list of tested versions (Albert Krewinkel).\n    + Remove TagSoup compat.\n    + Add EOL note to time compat module.  Because time 1.4 is a boot library\n      for GHC 7.8, we will support the compatibility module as long as we\n      support 7.8. But we should be clear about when we will no longer need\n      it.\n    + Remove blaze-html CPP conditional.\n    + Remove unnecessary CPP in custom Prelude.\n\n## pandoc 1.17.2 (2016-07-17)\n\n  * Added Zim Wiki writer, template and tests. `zimwiki` is now\n    a valid output format. (Alex Ivkin)\n\n  * Changed email-obfuscation default to no obfuscation (#2988).\n    + `writerEmailObfuscation` in `defaultWriterOptions` is now\n      `NoObfuscation`.\n    + the default for the command-line `--email-obfuscation` option is\n      now `none`.\n\n  * Docbook writer: Declare xlink namespace in Docbook5 output (Ivo Clarysse).\n\n  * Org writer:\n\n    + Support arbitrary raw inlines (Albert Krewinkel).\n      Org mode allows arbitrary raw inlines (\"export snippets\" in Emacs\n      parlance) to be included as `@@format:raw foreign format text@@`.\n    + Improve Div handling (Albert Krewinkel).  Div blocks handling is\n      changed to make the output look more like idiomatic org mode:\n        - Div-wrapped content is output as-is if the div's attribute is the\n          null attribute.\n        - Div containers with an id but neither classes nor key-value pairs\n          are unwrapped and the id is added as an anchor.\n        - Divs with classes associated with greater block elements are\n          wrapped in a `#+BEGIN`...`#+END` block.\n        - The old behavior for Divs with more complex attributes is kept.\n\n  * HTML writer:  Better support for raw LaTeX environments (#2758).\n    Previously we just passed all raw TeX through when MathJax\n    was used for HTML math.  This passed through too much.\n    With this patch, only raw LaTeX environments that MathJax\n    can handle get passed through.\n    This patch also causes raw LaTeX environments to be treated\n    as math, when possible, with MathML and WebTeX output.\n\n  * Markdown writer:  use raw HTML for simple, pipe tables with linebreaks\n    (#2993).  Markdown line breaks involve a newline, and simple and pipe\n    tables can't contain one.\n\n  * Make --webtex work with the Markdown writer (#1177).\n    This is a convenient option for people using\n    websites whose Markdown flavors don't provide for math.\n\n  * Docx writer:\n\n    + Set paragraph to FirstPara after display math (Jesse Rosenthal).\n      We treat display math like block quotes, and apply FirstParagraph style\n      to paragraphs that follow them. These can be styled as the user\n      wishes. (But, when the user is using indentation, this allows for\n      paragraphs to continue after display math without indentation.)\n    + Use actual creation time as doc prop (Jesse Rosenthal).\n      Previously, we had used the user-supplied date, if available, for Word's\n      document creation metadata. This could lead to weird results, as in\n      cases where the user post-dates a document (so the modification might be\n      prior to the creation). Here we use the actual computer time to set the\n      document creation.\n\n  * LaTeX writer:\n\n    + Don't URI-escape image source (#2825).  Usually this is a local file,\n      and replacing spaces with `%20` ruins things.\n    + Allow 'standout' as a beamer frame option (#3007).\n      `## Slide title {.standout}`.\n\n  * RST reader: Fixed links with no explicit link text.  The link\n    `` `<foo>`_ `` should have `foo` as both its link text and its URL.\n    See RST spec at <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases>\n    Closes Debian #828167 -- reported by Christian Heller.\n\n  * Textile reader:\n\n    + Fixed attributes (#2984).  Attributes can't be followed by\n      a space.  So, `_(class)emph_` but `_(noclass) emph_`.\n    + Fixed exponential parsing bug (#3020).\n    + Fix overly aggressive interpretation as images (#2998).\n      Spaces are not allowed in the image URL in textile.\n\n  * LaTeX reader:\n\n    + Fix `\\cite` so it is a NormalCitation not AuthorInText.\n    + Strip off double quotes around image source if present (#2825).\n      Avoids interpreting these as part of the literal filename.\n\n  * Org reader:\n\n    + Add semicolon to list of special chars (Albert Krewinkel)\n      Semicolons are used as special characters in citations syntax.  This\n      ensures the correct parsing of Pandoc-style citations: `[prefix; @key;\n      suffix]`.  Previously, parsing would have failed unless there was a space\n      or other special character as the last <prefix> character.\n    + Add support for \"Berkeley-style\" cites (Albert Krewinkel, #1978).\n      A specification for an official Org-mode citation syntax was drafted by\n      Richard Lawrence and enhanced with the help of others on the orgmode\n      mailing list.  Basic support for this citation style is added to the\n      reader.\n    + Support arbitrary raw inlines (Albert Krewinkel).\n      Org mode allows arbitrary raw inlines (\"export snippets\" in Emacs\n      parlance) to be included as `@@format:raw foreign format text@@`.\n    + Remove partial functions (Albert Krewinkel, #2991).\n      Partial functions like `head` lead to avoidable errors and should be\n      avoided.  They are replaced with total functions.\n    + Support figure labels (Albert Krewinkel, #2496, #2999).\n      Figure labels given as `#+LABEL: thelabel` are used as the ID of the\n      respective image.  This allows e.g. the LaTeX to add proper `\\label`\n      markup.\n    + Improve tag and properties type safety (Albert Krewinkel).\n      Specific newtype definitions are used to replace stringly typing of tags\n      and properties.  Type safety is increased while readability is improved.\n    + Parse as headlines, convert to blocks (Albert Krewinkel).\n      Emacs org-mode is based on outline-mode, which treats documents as trees\n      with headlines are nodes.  The reader is refactored to parse into a\n      similar tree structure.  This simplifies transformations acting on\n      document (sub-)trees.\n    * Refactor comment tree handling (Albert Krewinkel).\n      Comment trees were handled after parsing, as pattern matching on lists\n      is easier than matching on sequences.  The new method of reading\n      documents as trees allows for more elegant subtree removal.\n    * Support archived trees export options (Albert Krewinkel).\n      Handling of archived trees can be modified using the `arch` option.\n      Archived trees are either dropped, exported completely, or collapsed to\n      include just the header when the `arch` option is nil, non-nil, or\n      `headline`, respectively.\n    * Put export setting parser into module (Albert Krewinkel).\n      Export option parsing is distinct enough from general block parsing to\n      justify putting it into a separate module.\n    * Support headline levels export setting (Albert Krewinkel).\n      The depths of headlines can be modified using the `H` option.  Deeper\n      headlines will be converted to lists.\n    * Replace ugly code with view pattern (Albert Krewinkel).\n      Some less-than-smart code required a pragma switching of overlapping\n      pattern warnings in order to compile seamlessly.  Using view patterns\n      makes the code easier to read and also doesn't require overlapping\n      pattern checks to be disabled.\n    * Fix parsing of verbatim inlines (Albert Krewinkel, #3016).\n      Org rules for allowed characters before or after markup chars were not\n      checked for verbatim text.  This resultet in wrong parsing outcomes of\n      if the verbatim text contained e.g. space enclosed markup characters as\n      part of the text (`=is_substr = True=`).  Forcing the parser to update\n      the positions of allowed/forbidden markup border characters fixes this.\n\n  * LaTeX template: fix for obscure hyperref/xelatex issue.\n    Here's a minimal case:\n\n        \\documentclass[]{article}\n        \\usepackage{hyperref}\n        \\begin{document}\n        \\section{\\%á}\n        \\end{document}\n\n    Without this change, this fails on the second invocation of xelatex.\n    This affects inputs this like `# %á` with pdf output via xelatex.\n\n  * trypandoc:  call results 'html' instead of 'result'.\n    This is for better compatibility with babelmark2.\n\n  * Document MultiMarkdown as input/output format (Albert Krewinkel, #2973).\n    MultiMarkdown was only mentioned as a supported Markdown dialect but not\n    as a possible input or output format.  A brief mention is added\n    everywhere the other supported markdown dialects are mentioned.\n\n  * Document Org mode as a format containing raw HTML (Albert Krewinkel)\n    Raw HTML is kept when the output format is Emacs Org mode.\n\n  * Implement `RawInline` and `RawBlock` in sample lua custom writer (#2985).\n\n  * Text.Pandoc.Shared:\n\n    + Introduce blocksToInlines function (Jesse Rosenthal).\n      This is a lossy function for converting `[Block] -> [Inline]`. Its main\n      use, at the moment, is for docx comments, which can contain arbitrary\n      blocks (except for footnotes), but which will be converted to spans.\n      This is, at the moment, pretty useless for everything but the basic\n      `Para` and `Plain` comments. It can be improved, but the docx reader\n      should probably emit a warning if the comment contains more than this.\n    + Add BlockQuote to blocksToInlines (Jesse Rosenthal).\n    + Add further formats for `normalizeDate` (Jesse Rosenthal).\n      We want to avoid illegal dates -- in particular years with greater than\n      four digits. We attempt to parse series of digits first as `%Y%m%d`, then\n      `%Y%m`, and finally `%Y`.\n    + `normalizeDate` should reject illegal years (Jesse Rosenthal).\n      We only allow years between 1601 and 9999, inclusive. The ISO 8601\n      actually says that years are supposed to start with 1583, but MS Word\n      only allows 1601-9999. This should stop corrupted word files if the date\n      is out of that range, or is parsed incorrectly.\n    + Improve year sanity check in normalizeDate (Jesse Rosenthal).\n      Previously we parsed a list of dates, took the first one, and then\n      tested its year range. That meant that if the first one failed, we\n      returned nothing, regardless of what the others did. Now we test for\n      sanity before running `msum` over the list of Maybe values. Anything\n      failing the test will be Nothing, so will not be a candidate.\n\n  * Docx reader:\n\n    + Add simple comment functionality. (Jesse Rosenthal).\n      This adds simple track-changes comment parsing to the docx reader. It is\n      turned on with `--track-changes=all`. All comments are converted to\n      inlines, which can list some information. In the future a warning will be\n      added for comments with formatting that seems like it will be excessively\n      denatured.  Note that comments can extend across blocks. For that reason\n      there are two spans: `comment-start` and `comment-end`.  `comment-start`\n      will contain the comment. `comment-end` will always be empty.  The two\n      will be associated by a numeric id.\n    + Enable warnings in top-level reader (Jesse Rosenthal).\n      Previously we had only allowed for warnings in the parser. Now we allow\n      for them in the `Docx.hs` as well. The warnings are simply concatenated.\n    + Add warning for advanced comment formatting. (Jesse Rosenthal).\n      We can't guarantee we'll convert every comment correctly, though we'll\n      do the best we can. This warns if the comment includes something other\n      than Para or Plain.\n    + Add tests for warnings. (Jesse Rosenthal).\n    + Add tests for comments (Jesse Rosenthal).\n      We test for comments, using all track-changes options. Note that we\n      should only output comments if `--track-changes=all`. We also test for\n      emitting warnings if there is complicated formatting.\n\n  * README: update to include track-changes comments. (Jesse Rosenthal)\n\n  * Improved Windows installer - don't ignore properties set on command-line.\n    See #2708.  Needs testing to see if this resolves the issue.\n    Thanks to @nkalvi.\n\n  * Process markdown extensions on command line in L->R order (#2995).\n    Previously they were processed, very unintuitively, in R->L\n    order, so that `markdown-tex_math_dollars+tex_math_dollars`\n    had `tex_math_dollars` disabled.\n\n  * Added `secnumdepth` variable to LaTeX template (#2920).\n\n  * Include table of contents in README.html in Windows package.\n\n  * Writers: treat SoftBreak as space for stripping (Jesse Rosenthal)\n    In Writers.Shared, we strip leading and trailing spaces for display\n    math. Since SoftBreak's are treated as spaces, we should strip those\n    too.\n\n  * beamer, latex templates:  pass biblatexoptions directly in package load.\n    This allows runtime optinos to be used.  Fixes jgm/pandoc-citeproc#201\n\n  * CPP workaround for deprecation of `parseUrl` in http-client.\n\n  * Removed some redundant class constraints.\n\n  * make_oxs_package.sh - use OSX env variable.\n\n  * Added `winpkg` target to Makefile.  This downloads the windows package\n    from appveyor and signs it using the key.\n\n  * Document Org mode as a format containing raw TeX (Albert Krewinkel).\n    Raw TeX is kept verbatim when the output format is Emacs Org mode.\n\n  * Support math with haddock-library >= 1.4.\n\n  * Removed `-rtsopts` from library stanza.  It has no effect, and Hackage\n    wouldn't accept the package.\n\n  * Update library dependency versions.\n\n## pandoc 1.17.1 (2016-06-04)\n\n  * New output format: `docbook5` (Ivo Clarysse).\n\n  * `Text.Pandoc.Options`: Add `writerDocBook5` to `WriterOptions`\n    (API change).\n\n  * Org writer:\n\n    + Add :PROPERTIES: drawer support (Albert Krewinkel, #1962).\n      This allows header attributes to be added to org documents in the form\n      of `:PROPERTIES:` drawers.  All available attributes are stored as\n      key/value pairs.  This reflects the way the org reader handles\n      `:PROPERTIES:` blocks.\n    + Add drawer capability (Carlos Sosa).  For the implementation of the\n      Drawer element in the Org Writer, we make use of a generic Block\n      container with attributes.  The presence of a `drawer` class defines\n      that the `Div` constructor is a drawer. The first class defines the\n      drawer name to use.  The key-value list in the attributes defines\n      the keys to add inside the Drawer.  Lastly, the list of Block elements\n      contains miscellaneous blocks elements to add inside of the Drawer.\n    + Use `CUSTOM_ID` in properties (Albert Krewinkel).  The `ID` property is\n      reserved for internal use by Org-mode and should not be used.\n      The `CUSTOM_ID` property is to be used instead, it is converted to the\n      `ID` property for certain export format.\n\n  * LaTeX writer:\n\n    + Ignore `--incremental` unless output format is beamer (#2843).\n    + Fix polyglossia to babel env mapping (Mauro Bieg, #2728).\n      Allow for optional argument in square brackets.\n    + Recognize `la-x-classic` as Classical Latin (Andrew Dunning).\n      This allows one to access the hyphenation patterns in CTAN's\n      hyph-utf8.\n    + Add missing languages from hyph-utf8 (Andrew Dunning).\n    + Improve use of `\\strut` with `\\minipage` inside tables\n      (Jose Luis Duran).  This improves spacing in multiline\n      tables.\n    + Use `{}` around options containing special chars (#2892).\n    + Avoid lazy `foldl`.\n    + Don't escape underscore in labels (#2921).  Previously they were\n      escaped as `ux5f`.\n    + brazilian -> brazil for polyglossia (#2953).\n\n  * HTML writer: Ensure mathjax link is added when math appears in footnote\n    (#2881).  Previously if a document only had math in a footnote, the\n    MathJax link would not be added.\n\n  * EPUB writer: set `navpage` variable on nav page.\n    This allows templates to treat it differently.\n\n  * DocBook writer:\n\n    + Use docbook5 if `writerDocbook5` is set (Ivo Clarysse).\n    + Properly handle `ulink`/`link` (Ivo Clarysse).\n\n  * EPUB reader:\n\n    + Unescape URIs in spine (#2924).\n    + EPUB reader:  normalise link id (Mauro Bieg).\n\n  * Docx Reader:\n\n    + Parse `moveTo` and `moveFrom` (Jesse Rosenthal).\n      `moveTo` and `moveFrom` are track-changes tags that are used when a\n      block of text is moved in the document. We now recognize these tags and\n      treat them the same as `insert` and `delete`, respectively. So,\n      `--track-changes=accept` will show the moved version, while\n      `--track-changes=reject` will show the original version.\n    + Tests for track-changes moving (Jesse Rosenthal).\n\n  * ODT, EPUB, Docx readers: throw `PandocError` on unzip failure\n    (Jesse Rosenthal) Previously, `readDocx`, `readEPUB`, and `readOdt`\n    would error out if zip-archive failed. We change the archive extraction\n    step from `toArchive` to `toArchiveOrFail`, which returns an Either value.\n\n  * Markdown, HTML readers:  be more forgiving about unescaped `&` in\n    HTML (#2410).  We are now more forgiving about parsing invalid HTML with\n    unescaped `&` as raw HTML.  (Previously any unescaped `&`\n    would cause pandoc not to recognize the string as raw HTML.)\n\n  * Markdown reader:\n\n    + Fix pandoc title blocks with lines ending in 2 spaces (#2799).\n    + Added `-s` to markdown-reader-more test.\n\n  * HTML reader: fixed bug in `pClose`.  This caused exponential parsing\n    behavior in documnets with unclosed tags in `dl`, `dd`, `dt`.\n\n  * MediaWiki reader: Allow spaces before `!` in MediaWiki table header\n    (roblabla).\n\n  * RST reader: Support `:class:` option for code block in RST reader\n    (Sidharth Kapur).\n\n  * Org reader (all Albert Krewinkel, except where noted otherwise):\n\n    + Stop padding short table rows.\n      Emacs Org-mode doesn't add any padding to table rows.  The first\n      row (header or first body row) is used to determine the column count,\n      no other magic is performed.\n    + Refactor rows-to-table conversion.  This refactors\n      the codes conversing a list table lines to an org table ADT.\n      The old code was simplified and is now slightly less ugly.\n    + Fix handling of empty table cells, rows (Albert Krewinkel, #2616).\n      This fixes Org mode parsing of some corner cases regarding empty cells\n      and rows.  Empty cells weren't parsed correctly, e.g. `|||` should be\n      two empty cells, but would be parsed as a single cell containing a pipe\n      character.  Empty rows where parsed as alignment rows and dropped from\n      the output.\n    + Fix spacing after LaTeX-style symbols.\n      The org-reader was dropping space after unescaped LaTeX-style symbol\n      commands: `\\ForAll \\Auml` resulted in `∀Ä` but should give `∀ Ä`\n      instead.  This seems to be because the LaTeX-reader treats the\n      command-terminating space as part of the command.  Dropping the trailing\n      space from the symbol-command fixes this issue.\n    + Print empty table rows.  Empty table rows should not\n      be dropped from the output, so row-height is always set to be at least 1.\n    + Move parser state into separate module.\n      The org reader code has become large and confusing.  Extracting smaller\n      parts into submodules should help to clean things up.\n    + Add support for sub/superscript export options.\n      Org-mode allows to specify export settings via `#+OPTIONS` lines.\n      Disabling simple sub- and superscripts is one of these export options,\n      this options is now supported.\n    + Support special strings export option Parsing of special strings\n      (like `...` as ellipsis or `--` as en dash) can be toggled using the `-`\n      option.\n    + Support emphasized text export option.  Parsing of emphasized text can\n      be toggled using the `*` option.  This influences parsing of text marked\n      as emphasized, strong, strikeout, and underline.  Parsing of inline math,\n      code, and verbatim text is not affected by this option.\n    + Support smart quotes export option.  Reading of smart quotes can be\n      toggled using the `'` option.\n    + Parse but ignore export options. All known export options are parsed\n      but ignored.\n    + Refactor block attribute handling.  A parser state attribute was used\n      to keep track of block attributes defined in meta-lines.  Global state\n      is undesirable, so block attributes are no longer saved as part of the\n      parser state.  Old functions and the respective part of the parser state\n      are removed.\n    + Use custom `anyLine`.  Additional state changes need to be made after\n      a newline is parsed, otherwise markup may not be recognized correctly.\n      This fixes a bug where markup after certain block-types would not be\n      recognized.\n    + Add support for `ATTR_HTML` attributes (#1906).\n      Arbitrary key-value pairs can be added to some block types using a\n      `#+ATTR_HTML` line before the block.  Emacs Org-mode only includes these\n      when exporting to HTML, but since we cannot make this distinction here,\n      the attributes are always added.  The functionality is now supported\n      for figures.\n    + Add `:PROPERTIES:` drawer support (#1877).\n      Headers can have optional `:PROPERTIES:` drawers associated with them.\n      These drawers contain key/value pairs like the header's `id`.  The\n      reader adds all listed pairs to the header's attributes; `id` and\n      `class` attributes are handled specially to match the way `Attr` are\n      defined.  This also changes behavior of how drawers of unknown type\n      are handled.  Instead of including all unknown drawers, those are not\n      read/exported, thereby matching current Emacs behavior.\n    + Use `CUSTOM_ID` in properties.  See above on Org writer changes.\n    + Respect drawer export setting.  The `d` export option can be used\n      to control which drawers are exported and which are discarded.\n      Basic support for this option is added here.\n    + Ignore leading space in org code blocks (Emanuel Evans, #2862).\n      Also fix up tab handling for leading whitespace in code blocks.\n    + Support new syntax for export blocks.  Org-mode version 9\n      uses a new syntax for export blocks.  Instead of `#+BEGIN_<FORMAT>`,\n      where `<FORMAT>` is the format of the block's content, the new\n      format uses `#+BEGIN_export <FORMAT>` instead.  Both types are\n      supported.\n    + Refactor `BEGIN...END` block parsing.\n    + Fix handling of whitespace in blocks, allowing content to be indented\n      less then the block header.\n    + Support org-ref style citations.  The *org-ref* package is an\n      org-mode extension commonly used to manage citations in org\n      documents.  Basic support for the `cite:citeKey` and\n      `[[cite:citeKey][prefix text::suffix text]]` syntax is added.\n    + Split code into separate modules, making for cleaner code and\n      better decoupling.\n\n  * Added `docbook5` template.\n\n  * `--mathjax` improvements:\n\n    + Use new CommonHTML output for MathJax (updated default MathJax URL,\n      #2858).\n    + Change default mathjax setup to use `TeX-AMS_CHTML` configuration.\n      This is designed for cases where the input is always TeX and maximal\n      conformity with TeX is desired.  It seems to be smaller and load faster\n      than what we used before.  See #2858.\n    + Load the full MathJax config to maximize loading speed (KolenCheung).\n\n  * Bumped upper version bounds to allow use of latest packages\n    and compilation with ghc 8.\n\n  * Require texmath 0.8.6.2.  Closes several texmath-related bugs (#2775,\n    #2310, #2310, #2824).  This fixes behavior of roots, e.g.\n    `\\sqrt[3]{x}`, and issues with sub/superscript positioning\n    and matrix column alignment in docx.\n\n  * README:\n\n    + Clarified documentation of `implicit_header_references` (#2904).\n    + Improved documentation of `--columns` option.\n\n  * Added appveyor setup, with artefacts (Jan Schulz).\n\n  * stack.yaml versions: Use proper flags used for texmath, pandoc-citeproc.\n\n  * LaTeX template: support for custom font families (vladipus).\n    Needed for correct polyglossia operation with Cyrillic fonts and perhaps\n    can find some other usages.  Example usage in YAML metadata:\n\n          fontfamilies:\n          - name: \\cyrillicfont\n            font: Liberation Serif\n          - name: \\cyrillicfonttt\n            options: Scale=MatchLowercase\n            font: Liberation\n\n  * Create unsigned msi as build artifact in appveyor build.\n\n  * On travis, test with ghc 8.0.1; drop testing for ghc 7.4.1.\n\n\n\n## pandoc 1.17.0.3 (2016-03-24)\n\n  * LaTeX writer: Fixed position of label in figures (#2813).\n    Previously the label wasn't in the right place, and `\\ref`\n    wouldn't work properly.\n  * Added .tei test files to pandoc.cabal so they'll be included\n    in tarball (#2811).\n  * Updated copyright dates.\n\n## pandoc 1.17.0.2 (2016-03-23)\n\n  * Fixed serious regression in `htmlInBalanced`, which caused\n    newlines to be omitted in some raw HTML blocks in Markdown\n    (#2804).\n\n## pandoc 1.17.0.1 (2016-03-21)\n\n  * File scope is no longer used when there are no input files (i.e.,\n    when input comes from stdin).  Previously file scope was triggered\n    when the `json` reader was specified and input came from `stdin`,\n    and this caused no output to be produced.  (Fix due to Jesse Rosenthal;\n    thanks to Fedor Sheremetyev for calling the bug to our attention.)\n  * Improved documentation of templates (#2797).\n\n## pandoc 1.17 (2016-03-20)\n\n  * Added `--file-scope` option (Jesse Rosenthal).\n    By default pandoc operates on multiple files by first concatenating\n    them (around extra line breaks) and then processing the joined file. So\n    it only parses a multi-file document at the document scope. This has the\n    benefit that footnotes and links can be in different files, but for\n    some purposes it is useful to parse the individual files first\n    and then combine their outputs (e.g. when the files use footnotes\n    or links with the same labels).  The `--file-scope` option causes\n    pandoc to parse the files first, and then combine the parsed output,\n    instead of combining before parsing. `--file-scope` is selected\n    automatically for binary input files (which cannot be concatenated)\n    and for pandoc json.\n\n  * Add TEI Writer (Chris Forster) and `tei` output format.\n\n  * Added a general `ByteStringReader` with warnings, used by the docx\n    reader (API change, Jesse Rosenthal).\n\n  * Add `readDocxWithWarnings` (API change, Jesse Rosenthal).\n\n  * Changed type of `Shared.uniqueIdent` argument from\n    `[String]` to `Set String`.  This avoids performance problems in documents\n    with many identically named headers (API change, #2671).\n\n  * Removed `tex_math_single_backslash` from `markdown_github` options\n    (#2707).\n\n  * Make language extensions as well as full language names\n    trigger syntax highlighting.  For example, `py` will now work as\n    well as `python` (jgm/highlighting-kate#83).\n\n  * Added `institute` variable to latex, beamer templates (Fraser\n    Tweedale, Josef Svenningsson).\n\n  * Docx reader (Jesse Rosenthal):\n\n    + Handle alternate content.  Some word functions (especially graphics)\n      give various choices for content so there can be backwards compatibility.\n    + Don't turn numbered headers into lists.\n    + Docx Reader: Add state to the parser, for warnings\n    + Update feature checklist in source code.\n    + Get rid of `Modifiable` typeclass.\n    + Add tests for adjacent hyperlinks.\n    + Add a \"Link\" modifier to `Reducible`. We want to make sure that\n      links have their spaces removed, and are appropriately smushed\n      together (#2689).\n\n  * HTML reader:\n\n    + Fixed behavior of base tag (#2777).\n      If the base path does not end with slash, the last component\n      will be replaced.  E.g. base = `http://example.com/foo`\n      combines with `bar.html` to give `http://example.com/bar.html`.\n      If the href begins with a slash, the whole path of the base\n      is replaced.  E.g. base = `http://example.com/foo/` combines\n      with `/bar.html` to give `http://example.com/bar.html`.\n    + Rewrote `htmlInBalanced`.  This version avoids an exponential\n      performance problem with `<script>` tags, and it should be faster\n      in general (#2730).\n    + Properly handle an empty cell in a simple table (#2718).\n    + Handle multiple `<meta>` tags with same name.  Put them in a list\n      in the metadata so they are all preserved, rather than (as before)\n      throwing out all but one..\n\n  * Markdown reader:\n\n    + Improved pipe table parsing (#2765).\n    + Allow `+` separators in pipe table cells.  We already allowed\n      them in the header, but not in the body rows, for some reason.\n      This gives compatibility with org-mode tables.\n    + Don't cross line boundary parsing pipe table row.\n      Previously an Emph element could be parsed across the newline\n      at the end of the pipe table row.\n    + Use `htmlInBalanced` for `rawVerbatimBlock`, for better\n      performance (#2730).\n    + Fixed bug with smart quotes around tex math.\n\n  * LaTeX reader:\n\n    + Handle interior `$` characters in math (#2743).  For example,\n      `$$\\hbox{$i$}$$`.\n    + `inlineCommand` now gobbles an empty `{}` after any command (#2687).\n      This gives better results when people write e.g. `\\TeX{}` in Markdown.\n    + Properly handle LaTeX \"math\" environment as inline math (#2171).\n\n  * Textile reader: Support `>`, `<`, `=`, `<>` text alignment attributes.\n    Closes #2674.\n\n  * Org reader (Albert Krewinkel):\n\n    + Prefix even empty figure names with \"fig:\" (#2643).  The\n      convention used by pandoc for figures is to mark them by prefixing\n      the name with `fig:`.  The org reader failed to do this if a figure\n      had no name.\n    + Refactor link-target processing (#2684).\n\n  * ConTeXt writer: Fix whitespace at line beginning in line blocks (#2744).\n    Thanks to @c-foster.\n\n  * HTML writer: Don't include alignment attribute for default table columns.\n    Previously these were given \"left\" alignment.  Better to leave off\n    alignment attributes altogether (#2694).\n\n  * Markdown writer: Use hyphens for YAML metadata block bottom line, for\n    better compatibility with other Markdown flavors (Henrik Tramberend).\n\n  * LaTeX writer:\n\n    + Use image identifier to create a label and hypertarget for\n      figures (Mauro Bieg).\n    + Avoid double toprule in headerless table with caption (#2742).\n    + Clean up options parser (Jesse Rosenthal).\n    + Treat `memoir` template with `article` option as article, instead\n      of treating all `memoir` templates as books.\n    + Allow more flexible table alignment (Henrik Tramberend, #2665).\n      New default is not to include `[c]` option (which is the default\n      anyway if no positioning is specified).  Now LaTeX emplates can\n      control the overall table alignment in a document by setting the\n      longtable length variables `LTleft` and `LTright`.  For example,\n      `\\setlength\\LTleft\\parindent\\setlength\\LTright\\fill`\n      will create left-aligned tables that respect paragraph indentation.\n\n  * Docx writer: Handle image alt text (#2754, Mauro Bieg).\n\n  * Org writer - pass through RawInline with format \"org\".\n\n  * DokuWiki writer: use `$$` for display math.\n\n  * Custom writer: Pass attributes parameter to CaptionedImage (#2697).\n\n  * Make protocol-relative URIs work again (#2737).\n\n  * make_osx_package.sh:  Use env variable for developer id certs.\n\n  * Raise `tagsoup` lower bound to 0.13.7 to fix entity-related\n    problems (#2734).\n\n  * Allow `zip-archive` 0.3.\n\n  * Allow `aeson` 0.11.\n\n## pandoc 1.16.0.2 (2016-01-12)\n\n  * Depend on deepseq rather than deepseq-generics (fpco/stackage#1096).\n\n  * Fixed regression in latex smart quote parsing (#2645).\n    In cases where a match was not found for a quote, everything\n    from the open quote to the end of the paragraph was being dropped.\n\n## pandoc 1.16.0.1 (2016-01-10)\n\n  * Fixed regression with `--latex-engine` (#2618). In 1.16\n    `--latex-engine` raises an error if a full path is given.\n\n  * Org reader: Fix function dropping subtrees tagged `:noexport`\n    (Albert Krewinkel, #2628):\n\n  * Markdown reader: renormalize table column widths if they exceed 100%\n    (#2626).\n\n  * Textile reader:  don't allow block HTML tags in inline contexts.\n    The reader previously did allow this, following redcloth,\n    which happily parses\n\n        Html blocks can be <div>inlined</div> as well.\n\n    as\n\n        <p>Html blocks can be <div>inlined</div> as well.</p>\n\n    This is invalid HTML.  The above sample now produces;\n\n        <p>Html blocks can be</p>\n        <div>\n        <p>inlined</p>\n        </div>\n        <p>as well.</p>\n\n  * Improved default template lookup for custom lua scripts (#2625).\n    Previously, if you tried to do `pandoc -s -t /path/to/lua/script.lua`,\n    pandoc would look for the template in\n    `~/.pandoc/templates/default./path/to/lua/script.lua`.\n    With this change it will look in the more reasonable\n    `~/.pandoc/templates/default.script.lua`.  This makes it possible to\n    store default templates for custom writers.\n\n  * RST, Markdown writers: Fixed rendering of grid tables with blank rows\n    (#2615).\n\n  * LaTeX writer: restore old treatment of Span (#2624).  A Span is\n    now rendered with surrounding `{}`, as it was before 1.16.\n\n  * Entity handling fixes: improved handling of entities like\n    `&lang;` that require a trailing semicolon.  Allow uppercase\n    `x` in numerical hexadecimal character references, working\n    around a tagsoup bug.\n\n  * `stack.yaml` - use lts-4.0, but with older aeson to avoid excessive\n    memory use on compile.  With aeson 0.10 we were getting an out of\n    memory error on a 2GB Ubuntu 64-bit VM.\n\n  * Improved deb package creation script. Made `DPKGVER` work.\n    Renamed `COMMIT` to `TREE`.  You should now be able to do\n    `TREE=1.16.0.1 DPKGVER=2 make deb`.\n\n\n## pandoc 1.16 (2016-01-02)\n\n  * Added `Attr` field to `Link` and `Image` (Mauro Bieg, #261, API change).\n\n    + Added syntax for link and image attributes to pandoc's Markdown.\n    + Updated readers and writers to use link and image attributes\n      when appropriate.\n    + Support image attributes in Docx, Textile, RST readers.\n\n  * Renamed link attribute extensions.  The old `link_attributes` is\n    now `mmd_link_attributes`, and `link_attributes` now enables the\n    new pandoc-style link and image attributes (API change).\n    Note: this change could break some existing workflows.\n\n  * Implemented `SoftBreak` and new `--wrap` option (#1701, API change).\n    Added threefold wrapping option.\n\n    + Command line option: deprecated `--no-wrap`, added\n      `--wrap=[auto|none|preserve]`\n    + Added `WrapOption`, exported from `Text.Pandoc.Options`\n    + Changed type of `writerWrapText` in `WriterOptions` from\n      `Bool` to `WrapOption`.\n    + Modified `Text.Pandoc.Shared` functions to allow `SoftBreak`.\n    + Supported `SoftBreak` in readers and writers.\n\n  * Text.Pandoc.Options:  Added `writerDpi` to `WriterOptions` (API\n    change, Mauro Bieg).\n\n  * Added `--dpi` command-line option (Mauro Bieg).\n\n  * Rationalized behavior of `--no-tex-ligatures` and `--smart` (#2541).\n    This change makes `--no-tex-ligatures` affect the LaTeX reader\n    as well as the LaTeX and ConTeXt writers.  If it is used,\n    the LaTeX reader will parse characters `` ` ``, `'`, and `-`\n    literally, rather than parsing ligatures for quotation marks\n    and dashes.  And the LaTeX writer will print unicode quotation\n    mark and dash characters literally, rather than converting\n    them to the standard ASCII ligatures.  Note that `--smart` has\n    no effect on the LaTeX reader.  `--smart` is still the default\n    for all input formats when LaTeX or ConTeXt is the output format,\n    *unless* `--no-tex-ligatures` is used.\n\n    Some examples to illustrate the logic:\n\n    ```\n    % echo \"'hi'\" | pandoc -t latex\n    `hi'\n    % echo \"'hi'\" | pandoc -t latex --no-tex-ligatures\n    'hi'\n    % echo \"'hi'\" | pandoc -t latex --no-tex-ligatures --smart\n    ‘hi’\n    % echo \"'hi'\" | pandoc -f latex --no-tex-ligatures\n    <p>'hi'</p>\n    % echo \"'hi'\" | pandoc -f latex\n    <p>’hi’</p>\n    ```\n\n  * Removed deprecated options `--offline` and `--html5`.\n\n  * Fixed language code for Czech (`cs` not `cz`) (#2597).\n\n  * Implemented `east_asian_line_breaks` extension (#2586).\n    In `Text.Pandoc.Options`, added `Ext_east_asian_line_breaks` constructor\n    to `Extension` (API change).  This extension is like\n    `ignore_line_breaks`, but smarter -- it only ignores line breaks\n    between two East Asian wide characters.  This makes it better suited\n    for writing with a mix of East Asian and non-East Asian scripts.\n\n  * Added support for PDF creation via `wkhtmltopdf`.\n    To use this: `pandoc -t html5 -o result.pdf` (and add `--mathjax`\n    if you have math.) Margins can be set using the variables\n    `margin-top`, `margin-bottom`, `margin-left`, `margin-right`.\n    Other styling can be done through CSS.\n\n  * Fixed cite key parsing regression (jgm/pandoc-citeproc#201).\n    We were capturing final colons as in `[@foo: bar]`; the citation id\n    was being parsed as `@foo:`.\n\n  * ICML writer:\n\n    + Fixed image syntax for local files (#2589).\n    + Changed type of `writeICML` (Mauro Bieg).\n      API change:  It is now `WriterOptions -> Pandoc -> IO String`.\n      Also handle new image attributes.\n    + Intersperse line breaks instead of appending them to\n      every `ParagraphStyleRange` (Mauro Bieg, #2501).\n    + Add `Cite` style to citations (Mauro Bieg).\n    + Added figure handling (#2590, Mauro Bieg).\n    + Better handling of math.  Instead of just printing the raw tex,\n      we now try to fake it with unicode characters.\n\n  * HTML writer: Include `example` class for example lists (#2524).\n\n  * ODT/OpenDocument writer: improved image attributes (Mauro Bieg).\n\n    + Support for percentage widths/heights\n    + Use `Attr` instead of title to get dimensions from ODT walker\n      to `writeOpenDocument`.\n\n  * AsciiDoc writer:\n\n    + Support anchors in spans and divs with id elements\n      (jgm/pandoc-citeproc#143).\n    + Fixed code blocks (#1861).\n\n  * Haddock writer:  omit formatting inside links, which isn't supported\n    by Haddock (#2515).\n\n  * MediaWiki writer:  Fixed spacing issues in table cells.\n\n    + Start cell on new line unless it's a single Para or Plain\n      (#2606).\n    + For single Para or Plain, insert a space after the `|` to\n      avoid problems when the text begins with a character like\n      `-` (#2604).\n\n  * Beamer writer: mark frame as fragile when it contains verbatim (#1613).\n\n  * LaTeX writer:\n\n    + Add support for GAP highlighting using listings (Raniere Silva).\n    + Consider `header-includes` content as well as templates\n      when determining whether to use csquotes (Andreas Lööw).\n    + Create defaults for geometry using `margin-left` etc.\n      If `geometry` has no value, but `margin-left`, `margin-right`,\n      `margin-top`, and/or `-margin-bottom` are given, a default value\n      for `geometry` is created from these.  Note that these variables\n      already affect PDF production via HTML5 with `wkhtmltopdf`.\n\n  * ConTeXt writer: set default layout based on `margin-left`, etc.\n    This sets up `\\setuplayout` based on the variables `margin-left`,\n    `margin-right`, `margin-bottom`, and `margin-top`, if no layout\n    is given.\n\n  * Docx writer:  better handling of PDF images.  Previously we tried\n    to get the image size from the image even if an explicit size was\n    specified.  Since we still can't get image size for PDFs, this made\n    it impossible to use PDF images in docx.  Now we don't try to get\n    the image size when a size is already explicitly specified.\n\n  * Markdown writer:  use raw HTML for link/image attributes when\n    the `link_attributes` extension is unset and `raw_html` is set (#2554).\n\n  * MediaWiki reader: interpret markup inside `<tt>`, `<code>` (#2607).\n\n  * LaTeX reader:\n\n    + Improved smart quote parsing (#2555). This fixes redering of\n      unmatched quotes.\n    + Use curly quotes for unmatched ` (#2555).\n    + Allow blank space between braced arguments of commands (#2592).\n\n  * Markdown reader:\n\n    + Improved pipe table relative widths.  Previously pipe table\n      columns got relative widths (based on the header underscore lines)\n      when the source of one of the rows was greater in width than the\n      column width.  This gave bad results in some cases where much of\n      the width of the row was due to nonprinting material (e.g. link\n      URLs).  Now pandoc only looks at printable width (the width of a\n      plain string version of the source), which should give better results.\n      Thanks to John Muccigrosso for bringing up the issue.\n    + Fixed parsing bug with macros.  Previously macro definitions in\n      indented code blocks were being parsed as macro definitions, not code.\n\n  * Textile reader:  skip over attribute in image source (#2515).\n    We don't have a place yet for styles or sizes on images, but\n    we can skip the attributes rather than incorrectly taking them\n    to be part of the filename.\n\n  * Docx reader: Handle dummy list items (Jesse Rosenthal).\n    These come up when people create a list item and then delete the\n    bullet. It doesn't refer to any real list item, and we used to ignore\n    it.\n\n  * CommonMark reader/writer rewritten to use latest `cmark`.\n\n  * Fixed Emoji character definitions (#2523).  There were many bugs in the\n    definitions.\n\n  * `Text.Pandoc.CSS`:\n\n    + Added `pickStylesToKVs` function to extract multiple properties at\n      once (API change, Mauro Bieg).\n    + Parse CSS that doesn't contain the optional semicolon (Mauro Bieg).\n\n  * `trypandoc`: sort drop-down lists.\n\n  * Beamer template:\n\n    + Made `\\euro` conditional on presence of character.\n      for xelatex and lualatex, as it is for pdflatex (Andrew Dunning).\n    + Moved `header-includes` before setting of title (Thomas Hodgson),\n      to match the LaTeX template (jgm/pandoc-templates#168).\n    + Added `section-titles` variable (defaults to true)\n      to enable/suppress section title pages in beamer\n      slide shows (Thomas Hodgson).\n    + Moved beamer themes after fonts, so that themes can\n      change fonts.  (Previously the fonts set were being\n      clobbered by lmodern.sty.) (Thomas Hodgson).\n\n  * Beamer/LaTeX template changes (Thomas Hodgson):\n    + Added `thanks` variable\n    + Use `parskip.sty` when `indent` isn't set (fall back to using\n      `setlength` as before if `parskip.sty` isn't available).\n    + Use `biblio-style` with biblatex.\n    + Added `biblatexoptions` variable.\n\n  * LaTeX template changes:\n\n    + Added `paper` after `$papersize$` variable in latex template.\n      Thus you can say `papersize: a4` and the latex will contain\n      `a4paper`.  This change may break some existing workflows; if\n      you currently specify `a4paper`, you'll get `a4paperpaper` which\n      is meaningless.  However, the change seems worth it, as it will\n      make the `papersize` variable work uniformly across ConTeXt, LaTeX,\n      and html->pdf via wkhtmltopdf.\n    + Only pass options to color package if `colorlinks` is set\n      (Andrew Dunning).\n    + Make definition of `\\euro` conditional in xelatex/lualatex,\n      as it is already for pdflatex (Andrew Dunning).\n    + Removed setting of `subject` in PDF metadata.\n      This used to be set to the subtitle, but really the subtitle\n      need not give the subject.  Also, `subtitle` can contain formatting,\n      so we'd need, at least, a plain text version for this.\n    + Moved `header-includes` before setting of `\\title`, `\\author`,\n      etc.  This allows these macros to be redefined.\n    + Use `\\subtitle` command for `subtitle`, instead of tacking it\n      on to the title as before.  We give a no-op fallback definition if it\n      is not defined.  This change should produce much better results\n      in classes that support `\\subtitle`.  With the default article\n      class, which does not define `\\subtitle`, subtitles will no\n      longer be printed unless the user defines `\\subtitle` and\n      redefines `\\maketitle`.\n    + Moved redefinitions of `\\paragraph` and `\\subparagraph` to\n      before header-includes.\n\n  * Context template:\n\n    + Use `simplefonts` for font loading (Paolo Rodríguez).  This is\n      needed for things to work on ConTeXt stable from TeXLive 2015.\n    + Revert use of `\\setuphead` in title block (Andrew Dunning,\n      Rik Kabel).\n\n  * Update LaTeX/ConTeXt link colour usage (Andrew Dunning).\n\n  * Fixed man template so disabling hyphenation actually works.\n    The command needs to come after .TH.\n\n  * Added 'navigation' variable to beamer template (#2543).\n    Valid values are `empty` (the default), `horizontal`, `vertical`,\n    and `frame`.  Note that this changes the default behavior from\n    `horizontal` to `empty`.  Closes #2543.\n\n  * Added `toc` to HTML slide format templates (Andrew Dunning),\n    so that `--toc` creates a contents slide.\n\n  * Added `stack.full.yaml` to build `pandoc-citeproc` as well.\n\n  * Allow pipe tables with no body rows (#2556).\n    Previously this raised a runtime error.\n\n  * Shared: Improved `fetchItem` so that `C:/Blah/Blah.jpg` isn't treated\n    as URL.  The Haskell URI parsing routines will accept \"C:\" as a\n    scheme, so we rule that out manually.  This helps with\n    `--self-contained` and absolute Windows paths.\n\n  * Define a `meta-json` variable for all writers (#2019).  This contains\n    a JSON version of all the metadata, in the format selected for the\n    writer.  So, for example, to get just the YAML metadata, you can run\n    pandoc with the following custom template: `$meta-json$`.  The intent\n    is to make it easier for static site generators and other tools to get\n    at the metadata.\n\n  * Document limitations of --self-contained (#2553).\n\n  * Improved Citations section of README (#2551).  Added information\n    about `link-citations` and a link to the pandoc-citeproc man page.\n\n  * `ImageSize`: use `safeRead` instead of `readMaybe`, which isn't\n    in base < 4.6.\n\n  * Allow .adoc file extension for AsciiDoc (Andrew Dunning).\n\n  * Improved implicit pandoc-citeproc inclusion.\n    The filter pandoc-citeproc is automatically used when\n    `--bibliography` is specified on the command line, unless\n    `--natbib` or `--biblatex` is used.  However, previously this\n    only worked if `--bibliography` was spelled out in full, and not\n    if `--biblio` was used.\n\n  * reveal.js: Interpret pauses correctly for all headers (#2530).\n    Previously, when using headers below the slide level, pauses are left\n    uninterpreted into pauses. In my opinion, unexpected behavior but\n    intentional looking at the code.\n\n  * Remove redundant `center` variable for reveal.js (Andrew Dunning).\n\n  * Parsing: Add `extractIdClass`, modified type of `KeyTable` (Mauro\n    Bieg, API change).\n\n  * ImageSize:  Added functions for converting between image dimensions\n    (Mauro Bieg).\n\n  * Use lts-3.18 in stack.yaml.  This avoids Windows build\n    issues with the HTTP library.\n\n  * Bump version bounds for dependencies.\n\n## pandoc 1.15.2.1 (2015-11-16)\n\n  * Added two missing test files, and `stack.yaml`, to\n    `extra-source-files` so they're included in the source tarball.\n\n  * reveal.js template: Fixed parallaxBackground options.\n    `parallaxBackgroundHorizontal` and `parallaxBackgroundVertical`\n    need integer values, not strings.  (Vaughn Iverson)\n\n## pandoc 1.15.2 (2015-11-15)\n\n  * `pandoc my.md -t context -o my.pdf` will now create a PDF using\n    ConTeXt rather than LaTeX (#2463).\n\n  * Fixed omitted `url(...)` in CSS data-uri with `--self-contained` (#2489).\n\n  * Added `emoji` Markdown extension, enabled by default in `markdown_github`\n    (#2523).  Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options`\n    (API change).\n\n  * `Text.Pandoc.Readers.HTML.parseTags`: Fixed over-eager raw HTML inline\n    parsing (#2469).  Tightened up the inline HTML parser so it disallows\n    TagWarnings.\n\n  * Derive `Generic` instances for the types in `Text.Pandoc.Options`.\n\n  * Org reader:\n\n    + Fix paragraph/list interaction (Albert Krewinkel, #2464).\n      Paragraphs can be followed by lists, even if there is no blank line\n      between the two blocks.  However, this should only be true if the\n      paragraph is not within a list, were the preceding block should be\n      parsed as a plain instead of paragraph (to allow for compact lists).\n      Thanks to @rgaiacs for bringing this up.\n    + Allow toggling header args (Albert Krewinkel, #2269).\n      Org-mode allows to skip the argument of a code block header argument if\n      it's toggling a value.  Argument-less headers are now recognized,\n      avoiding weird parsing errors.\n    + Fix markup parsing in headers (Albert Krewinkel, #2504).\n      Markup as the very first item in a header wasn't recognized.  This was\n      caused by an incorrect parser state: positions at which inline markup\n      can start need to be marked explicitly by changing the parser state.\n      This wasn't done for headers.  The proper function to update the state\n      is now called at the beginning of the header parser, fixing this issue.\n    + Fix emphasis rules for smart parsing (Albert Krewinkel, #2513).\n      Smart quotes, ellipses, and dashes should behave like normal quotes,\n      single dashes, and dots with respect to text markup parsing.\n    + Require whitespace around definition list markers (#2518).\n      This rule was not checked before, resulting in bugs with footnotes\n      and some link types.\n\n  * Markdown reader:\n\n    + Pipe tables with long lines now get relative cell widths (#2471).\n      If a pipe table contains a line longer than the column width (as set by\n      `--columns` or 80 by default), relative widths are computed based on the\n      widths of the separator lines relative to the column width.  This should\n      solve persistent problems with long pipe tables in LaTeX/PDF output, and\n      give more flexibility for determining relative column widths in other\n      formats, too.  For narrower pipe tables, column widths of 0 are used,\n      telling pandoc not to specify widths explicitly in output formats that\n      permit this.\n    + Improved parser for `mmd_title_block`.  We now allow blank metadata\n      fields.  These were explicitly disallowed before.\n    + Citation keys can now contain `://`, so URLs and DOIs can be used\n      as citation keys (jgm/pandoc-citeproc#166).\n\n  * Beamer template:  fix incompatibility of section slides with natbib.\n    Natbib (and presumably biblatex) bibliography commands create\n    their own section.  Since these are in frame environments,\n    we have an incompatibility with the `\\AtBeginSection` macro\n    which creates a special frame when a new section occurs.\n    (We can't have a frame inside another frame.) This change disables\n    `\\AtBeginSection` inside bibliography slides.  Thinks to Yihui Xie for\n    bringing the problem to my attention.  This supersedes #145.  See\n    discussion there.\n\n  * Textile reader:  don't do smart punctuation unless explicitly asked\n    (#2480).  Note that although smart punctuation is part of the textile\n    spec, it's not always wanted when converting from textile\n    to, say, Markdown.  So it seems better to make this an option.\n\n  * LaTeX reader: Handle `comment` environment (Arata Mizuki).\n    The `comment` environment is handled in a similar way to the\n    `verbatim` environment, except that its content is discarded.\n\n  * Docx reader:  Follow relationships correctly in foot/endnotes (#2258,\n    Jesse Rosenthal).  This fixes a problem with links in notes.\n\n  * LaTeX and ConTeXt writers: support `lang` attribute on divs and spans\n    (mb21).  For LaTeX, also collect `lang` and `dir` attributes on spans and\n    divs to set the `lang`, `otherlangs` and `dir` variables if they aren’t set\n    already.  See #895.\n\n  * LaTeX writer:\n\n    + Use proper command for `\\textarabic` (mb21).\n    + Added `de-CH-1901`, fixed `el-polyton` in `toPloyglossia` (Nick Bart).\n    + Use `\\hypertarget` and `\\hyperlink` for links.  This works correctly\n      to link to Div or Span elements.  We now don't bother defining `\\label`\n      for Div or Span elements.  Closes jgm/pandoc-citeproc#174.\n    + Avoid footnotes in list of figures (#1506).\n    + Properly handle footnotes in captions (#1506).\n    + Add `\\protect` to `\\hyperlink` (#2490).  Thanks to Hadrien Mary.\n    + Set `colorlinks` if `linkcolor`, `urlcolor`, `citecolor`, or\n      `toccolor` is set (#2508).\n\n  * Textile writer: support start number in ordered lists (#2465).\n\n  * OpenDocument writer:  Allow customization of opendocument\n    automatic styles.  Automatic styles can now be inserted in the\n    template, which now provides the enclosing `<office:automatic-styles>`\n    tags (#2520).\n\n  * Docx writer:  insert space between footnote reference and note (#2527).\n    This matches Word's default behavior.\n\n  * EPUB writer:  don't download linked media when `data-external` attribute\n    set (#2473).  By default pandoc downloads all linked media and includes it\n    in the EPUB container.  This can be disabled by setting `data-external` on\n    the tags linking to media that should not be downloaded.  Example:\n\n        <audio controls=\"1\">\n         <source src=\"http://www.sixbarsjail.it/tmp/bach_toccata.mp3\"\n         type=\"audio/mpeg\"></source>\n        </audio>\n\n  * HTML writer:  use width on whole table if col widths sum to < 100%.\n    Otherwise some browsers display the table with the columns\n    separated far apart.\n\n  * AsciiDoc template:  Fix `author` and `date`; add `keywords`,\n    `abstract` (Andrew Dunning).\n\n  * HTML-based templates (Andrew Dunning):\n\n    + Use en dash instead of hyphen between title prefix and title.\n    + Add `keywords` to metadata.\n    + Add `lang`, `dir`, `quotes` where missing.\n    + Always make author and date display conditional.\n    + Updated dzslides template from source.\n\n  * Man template: make \"generated by\" comment conditional.\n\n  * LaTeX, Beamer templates:\n\n    + Add `babel-otherlangs` for language divs/spans; `babel-newcommands`,\n      filled by commands that make babel understand the polyglossia-style\n      language directives (mb21, #137).\n    + Improved formatting of conditionals; `$for$` is always provided to allow\n      multiple options (Andrew Dunning, #141).\n    + Use `Ligatures=TeX` rather than `Mapping=tex-text` with `fontspec`\n      to improve support for LuaTeX (Andrew Dunning, #135).\n    + Revise `hyperref` usage (Andrew Dunning, #139, #141):\n        - use same options for all LaTeX engines;\n        - add `subtitle` and `keywords` to PDF metadata;\n        - do not override `hyperref` link coloring without user input, effectively making\n          the `hidelinks` option the default (removed as a separate variable);\n        - link colors can be enabled (using a slightly darker version of the old\n          defaults) using a new `colorlinks` variable, automatically used by\n          the LaTeX writer when custom colors are specified;\n        - `pdfborder={0 0 0}` is automatically set by `hyperref` with\n          `colorlinks`, and is only applied if `colorlinks` is disabled.\n\n  * ConTeXt template (Andrew Dunning):\n\n    + New variables for controlling styles: `linkstyle`, `linkcolor`,\n      `linkcontrastcolor`, `layout`, `pagenumbering`, `whitespace`, `indenting`,\n      `interlinespace`, `headertext`, `footertext`, `mainfont`, `sansfont`,\n      `monofont`, `mathfont`, `fontsize`.\n    + Default template no longer supports MkII.\n    + Improve writing of title block (suppressing numbering of first page).\n    + Add `title` `subtitle`, `author`, `date`, `keywords` to PDF metadata.\n    + Support `subtitle`, `abstract`.\n    + Support list of figures (`lof`), list of tables (`lot`).\n    + Disable link styling by default.\n    + Define styles for all section types.\n    + Enable microtype.\n    + Improved formatting of conditionals.\n\n  * Beamer template:  added code to prevent slide breaks inside paragraphs\n    (#2422, thanks to Nick Bart).  This will matter, in practice, only when\n    `allowframebreaks` is used.  It is especially helpful for bibliography\n    slides.\n\n  * OpenDocument template:  Add `<office:automatic-styles>` tag around\n    automatic styles.  The writer now longer provides this (see #2520).\n\n  * Restored Text.Pandoc.Compat.Monoid.\n\n  * Do not export (<>) from custom Prelude.  The Prelude now matches\n    base 4.8 Prelude's API.\n\n  * Don't use custom prelude with ghc 7.10.  Use the custom prelude\n    only for earlier versions.  This change makes `stack ghci` and\n    `cabal repl` work (#2503), at least with ghc 7.10.\n\n  * Changed § to % in operators from Odt.Arrows.Utils (#2457).\n    This prevents problems building haddocks with \"C\" locale.\n\n  * Change default for old-locale flag to False.\n\n  * Use stack in deb, osx, and Windows package generators.\n\n  * Added Vagrantfile for building deb in vm.\n    This should help in automating binary package creation.  'make package'\n    will make the package.  'make package COMMIT=blah' will make the package\n    from commit blah.\n\n  * README:\n\n    + Consistent capitalization for pandoc and Markdown.\n    + Fixed `auto_identifiers` examples (Benoit Schweblin).\n    + Improved documentation of template variables (Andrew Dunning).\n\n## pandoc 1.15.1 (2015-10-15)\n\n  * `pandocVersion` is now defined in `Text.Pandoc.Shared`\n    and reexported from `Text.Pandoc` (Alex Vong).  This allows\n    writers to access it.  (Alex Vong) (API change)\n\n  * For `markdown_mmd`, add: `implicit_figures`, `superscripts`,\n    `subscripts` (#2401).\n\n  * Added `odt` as input format (MarLinn).  Added new module\n    `Text.Pandoc.Reader.ODT` (API change). Fully implemented features:\n    Paragraphs, Headers, Basic styling, Unordered lists, Ordered lists,\n    External Links, Internal Links, Footnotes, Endnotes, Blockquotes.\n    Partly implemented features: Citations, Tables.\n\n  * Markdown Reader:\n\n    + Add basic tests for each header style (Ophir Lifshitz).\n    + Add implicit header ref tests for headers with spaces (Ophir Lifshitz).\n    + Skip spaces in headers (Ophir Lifshitz).\n    + Handle 'id' and 'class' in parsing key/value attributes (#2396).\n      `# Header {id=\"myid\" class=\"foo bar\"}`\n      is now equivalent to `# Header {#myid .foo .bar}`.\n    + Use '=' instead of '#' for atx-style headers in markdown+lhs.\n      (Kristof Bastiaensen)\n    + Pipe tables: allow indented columns.  Previously the left-hand column\n      could not start with 4 or more spaces indent.  This was inconvenient\n      for right-aligned left columns.  Note that the first (header column)\n      must still have 3 or fewer spaces indentation, or the table will be\n      treated as an indented code  block.\n    + Fix regression:  allow HTML comments containing `--`.\n      Technically this isn't allowed in an HTML comment, but\n      we've always allowed it, and so do most other implementations.\n      It is handy if e.g. you want to put command line arguments\n      in HTML comments.\n\n  * LaTeX reader:\n\n    + Don't eat excess whitespace after macros with only optional\n      arguments (#2446).\n    + Support longtable (#2411).\n    + Implement `\\Cite` (#2335).\n    + Support abstract environment.  The abstract populates an\n      `abstract` metadata field.\n    + Properly handle booktabs lines.  Lines aren't part of the\n      pandoc table model, so we just ignore them (#2307).\n\n  * HTML reader:\n\n    + Handle type attribute on ol, e.g. `<ol type=\"i\">` (#2313).\n    + Updated for new automatic header attributes.\n    + Add auto identifiers if not present on headers.  This makes\n      TOC linking work properly.\n    + Detect `font-variant` with `pickStyleAttrProps` (Ophir Lifshitz).\n    + Test `<ol>` type, class, and inline list-style(-type) CSS\n      (Ophir Lifshitz).\n    + Better handling of \"section\" elements (#2438).  Previously\n      `<section>` tags were just parsed as raw HTML blocks.  With\n      this change, section elements are parsed as Div elements with\n      the class \"section\".\n\n  * MediaWiki reader:  handle unquoted table attributes (#2355).\n\n  * DocBook reader:\n\n    + Added proper support for DocBook `xref` elements (Frerich Raabe).\n      Added `dbContent` field to reader state, so we can lookup\n      cross refs.\n    + Handle `informalexample` (#2319).\n\n  * Docx Reader:\n\n    + Create special punctuation test (Ophir Lifshitz).\n    + Parse soft, no-break hyphen elements (Ophir Lifshitz).\n    + Updated headers test (Ophir Lifshitz). Replaced `styles.xml`\n      in `headers.docx` with pandoc's current `styles.xml`, which\n      contains styles for Heading 1 through 6. Added Heading 4\n      through 7 to the test document. Note that Heading 7 is not\n      parsed as a Heading because there is no Heading 7 style.\n\n  * RST reader:  better handling of indirect roles.\n    Previously the parser failed on this kind of case\n\n        .. role:: indirect(code)\n\n        .. role:: py(indirect)\n           :language: python\n\n        :py:`hi`\n\n    Now it correctly recognizes `:py:` as a code role.\n\n  * Org reader:\n\n    + Add auto identifiers if not present on headers\n      (#2354, Juliusz Gonera).\n    + Allow verse blocks to contain empty lines (#2402,\n      Albert Krewinkel).\n\n  * EPUB reader:  stop mangling external URLs (#2284).\n\n  * RST writer:\n\n    + Don't insert `\\ ` when complex expression in matched pairs.\n      E.g. `` [:sup:`3`] `` is okay; you don't need `` [:sup:`3`\\ ] ``.\n    + Ensure that `\\ ` is inserted when needed before Cite and Span\n      elements that begin with a \"complex\" element (jgm/pandoc-citeproc#157).\n    + Normalize headers only in \"standalone\" mode (#2394).\n\n  * Haddock writer: escape `*` and `^` (G. Bataille).\n\n  * Markdown writer:\n\n    + In TOC, add links to headers (#829).\n    + Use unicode super/subscripts for digits in plain output\n      (when the `superscripts` and `subscripts` extensions are\n      not enabled).\n\n  * Docx writer:\n\n    + Moved invalid character stripping to `formattedString`.\n      This avoids an inefficient generic traversal (#2356).\n    + Use user data directory for `reference.docx` archive.\n      This allows the test suite to work without installing pandoc first.\n      It also brings the docx writer in line with the odt writer.\n    + Tests:  docx writer tests now use `../data` for data directory.\n      This allows tests to be run without installing first.\n    + Tests: Use real jpg (not empty) for docx tests to avoid warning.\n\n  * LaTeX writer:\n\n    + Fixed detection of 'chapters' from template.\n      If a documentclass isn't specified in metadata, but the\n      template has a hardwired bookish documentclass, act as if\n      `--chapters` was used.  This was the default in earlier\n      versions, but it has been broken for a little while.\n    + Correctly recognize book documentclass in metadata (#2395).\n    + Set language-related variables automatically, depending\n      on the value of the `lang` field, which is now always\n      assumed to be in BCP47 format (mb21, #1614, #2437).\n    + Add `\\protect` to `\\hyperdef` in inline context.  This way we\n      don't get an error when this is used as a moveable argument (#2136).\n    + Support all frame attributes in Beamer.\n    + Percent-encode more special characters in URLs (#1640, #2377).\n      The special characters are '<','>','|','\"','{','}','[',']','^', '`'.\n\n  * HTML writer:\n\n    + Update KaTeX JS and CSS versions (Emily Eisenberg).\n    + For dzslides, add `role=\"note\"` for speaker notes (#1693).\n    + Percent-encode more special characters in URLs (#1640, #2377).\n      The special characters are '<','>','|','\"','{','}','[',']','^', '`'.\n    + Render Div with class `section` as `<section>` in HTML5.\n\n  * EPUB writer:\n\n    + In TOC, replace literal `<br/>` with space (#2105).\n    + With `--webtex`, include image file rather than `data:` URI (#2363).\n\n  * Native writer: format Div properly, with blocks separated.\n\n  * Support bidirectional text output with XeLaTeX, ConTeXt and HTML\n    (#2191, mb21).\n\n  * Reference Docx:\n\n    + Add missing Header 6 style (steel blue) (Ophir Lifshitz).\n    + Correct `outlineLvl` for Header styles (Ophir Lifshitz).\n\n  * Templates\n\n    + Beamer:  Add `innertheme`, `outertheme` variables\n      (Guilhem Bonnefille, #121). Add space after colon in figure caption.\n      Integrate recent font and language updates from LaTeX template;\n      allow use of `mainfont` variable for changing the slide text\n      in XeTeX and LuaTeX (Andrew Dunning, #131).\n    + LaTeX:  Add `mainfontoptions`, `sansfontoptions`,\n      `monofontoptions`, `mathfontoptions`, `fontfamilyoptions`\n      (Andrew Dunning, #122).  Support handling of bidirectional\n      text (mb21, #120). Improve reliability of superscripts/subscripts\n      under XeTeX and prevent letters and numbers from appearing on a\n      different baseline by removing use of the `realscripts` package\n      (via `xltxtra`).  To restore use of OpenType characters for these\n      features under XeTeX or LuaTeX, add `\\usepackage{realscripts}` to\n      `header-includes` (Andrew Dunning, #130).  Remove redundant\n      reference to `xunicode` (Andrew Dunning, #130).  Add `fontenc`,\n      `indent`, `subparagraph` variables (Andrew Dunning).\n      Allow use of `hidelinks` variable for `hyperref` package (Hugo Roy,\n      #113).  Prevent package clash with `tufte-latex` and other classes that\n      include `hyperref` or `color` (Xavier Olive, #115).\n    + ConTeXt:  Support handling of bidirectional text (mb21, #120).\n    + LaTeX and ConTeXt: Use more specific language variables.\n      Instead of directly using `lang`, we now use `babel-lang` and\n      `polyglossia-lang` and `context-lang`.  These variables are set by\n      the writers to the necessary values, based on the `lang` variable\n      (which now always takes a value in BCP47 format). (mb21, #114, #129).\n    + HTML:  Support handling of bidirectional text (mb21, #120).\n      Move HTML5 shiv after CSS and fix URL (Andrew Dunning).\n      Add dir attribute in html5 (Andrew Dunning).\n    + reveal.js: Add `controls`, `progress` variables (Grégoire Pineau, #127).\n      Add `width`, `height` variables (Anrew Dunning).  Update template\n      from 3.1 source (Andrew Dunning).  All configuration options are now\n      available as variables, but are only be included if set (reveal.js\n      uses defaults otherwise).\n    + man: Added comment stating that the page is autogenerated by pandoc,\n      giving version.  Added `adjusting` and `hyphenate` variables\n      (Alex Vong, #123).\n\n  * epub.css: added selectors for nested emphasis (Pablo Rodriguez).\n\n  * MediaBag:  ensure that `/` is always used as path separator.\n\n  * `sample.lua`: define `CaptionedImage`, add newline at end (#2393).\n\n  * Added `--bash-completion` option.  This generates a bash completion\n    script.  To use: `eval \"$(pandoc --bash-completion)\"`.\n\n  * Text.Pandoc.Error: Define Typeable and Exception instances\n    for PandocError (#2386).\n\n  * Text.Pandoc.Parsing: `toKey`: strip off outer brackets.\n    This makes keys with extra space at the beginning and end\n    work:  e.g.\n\n        [foo]: bar\n\n        [ foo ]\n\n    will now be a link to bar (it wasn't before).\n\n  * Text.Pandoc: disable `auto_identifiers` for epub.\n    The epub writer inserts its own auto identifiers;\n    this is more complex due to splitting into \"chapter\" files.\n\n  * Renamed Text.Pandoc.Compat.Locale -> Text.Pandoc.Compat.Time.\n    It now reexports Data.Time.\n\n  * Use custom Prelude to avoid compiler warnings.\n\n    + The (non-exported) prelude is in prelude/Prelude.hs.\n    + It exports Monoid and Applicative, like base 4.8 prelude,\n      but works with older base versions.\n    + It exports (<>) for mappend.\n    + It hides 'catch' on older base versions.\n\n  * Added a `stack.ymal` and stack install instructions to INSTALL.\n\n  * Clarified what is \"out of scope\" in README and CONTRIBUTING.md.\n\n  * Added note to CONTRIBUTING.md about ghc versions and travis.\n\n  * Clarify docs on block quotes.  The space after `>` is optional (#2346).\n\n  * Removed obsolete reference to default.csl (#2372).\n\n  * List all styles in manual for `--reference-docx` (Chris Black)\n\n  * Don't capitalize header links in man page.\n\n  * Added section on repl to CONTRIBUTING.md.\n\n  * README:  Added space after backslash in image example (#2329).\n\n  * Document details of citation locator terms (Nick Bart).\n\n  * Fixed some internal links in README (#2309).\n\n  * Improve CSL documentation, variables documentations,\n    links, and cross-references in README. (Andrew Dunning)\n\n  * Fix build failure with `--flags=-https` (Sergei Trofimovich).\n\n  * Use `newManager` instead of `withManager` in recent `http-client`.\n    This avoids a deprecation warning.\n\n  * Allow building with latest versions of http-types,\n    HUnit, criterion, syb, aeson.\n\n  * Updated benchmark program for new criterion API.\n\n  * Setup.hs: rewrite so as not to use process, directory, filepath.\n    Using anything outside base is dangerous, since older\n    versions of ghc may link against two different versions.\n\n  * Added appveyor (Windows continuous integration) builds.\n\n  * New `.travis.yml`.  Autgenerated using `make_travis_yml.hs`.\n    This script has been modified in a few ways, e.g. to add `GHCOPTS`.\n    `make .travis.yml` regenerates it based on the tested-with\n    field of the cabal file.\n\n## pandoc 1.15.0.6 (2015-07-15)\n\n  * `--self-contained`: Fixed overaggressive CSS minimization\n    (#2301, 2286). Previously `--self-contained` wiped out all\n    spaces in CSS, including semantically significant spaces.\n    This was a regression from 1.14.x.\n\n  * Markdown reader: don't allow bare URI links or autolinks in link\n    label (#2300).  Added test cases.\n\n  * `Text.Pandoc.Parsing`, `uri`: Improved bare autolink detection (#2299).\n    Previously we disallowed `-` at the end of an autolink,\n    and disallowed the combination `=-`.  This commit liberalizes the\n    rules for allowing punctuation in a bare URI, and adds test cases.\n    One potential drawback is that you can no longer put a bare\n    URI in em dashes like this:\n    `this uri---http://example.com---is an example.`\n    But in this respect we now match github's treatment of bare URIs.\n\n  * HTML writer:  support speaker notes in dzslides.\n    With this change `<div class=\"notes\">` and also `<div class=\"notes\"\n    role=\"note\">` will be output if `-t dzslides` is used. So we can\n    have speaker notes in dzslides too.  Thanks to maybegeek.\n\n  * Updated dzslides template.\n\n  * Improved documentation of options to print system default files (#2298).\n    `--print-default-data-file` and `--print-default-template`.\n\n  * DokuWiki writer: use `$..$` for Math instead of `<math>..</math>`\n    (Tiziano Müller).  MathJax seems currently to be the only maintained\n    math rendering extension for DokuWiki.\n\n  * `Text.Pandoc.Shared`: Changed `hierarchicalize` so it treats references\n    div as top-level header (#2294).  This fixes a bug with `--section-divs`,\n    where the final references section added by pandoc-citeproc, enclosed in\n    its own div, got nested in the div for the section previous to it.\n\n  * Allow vector 0.11.\n\n  * Require cmark > 0.4.\n\n## pandoc 1.15.0.5 (2015-07-10)\n\n  * HTML writer: Fixed email javascript obfuscation with `mailto:`\n    URLs (#2280).  This fixes a potential security issue.  Because\n    single quotes weren't being escaped in the link portion, a\n    specially crafted email address could allow javascript code injection.\n\n  * RST reader:  allow inline formatting in definition list field\n    names (Lars-Dominik Braun).\n\n  * PDF:  Make sure `--latex-engine-opt` goes before the filename\n    on the command line.  LaTeX needs the argument to come after\n    the options (#1779).\n\n  * CommonMark writer: fixed tags used for super/subscript.\n\n  * ConTeXt template:  activate hanging indent for definition lists\n    (mb21).\n\n  * Make cabal require `hsb2hs` >= 0.3.1 if `embed_data_files` specified.\n    This is done by adding `hookedPrograms` in `Setup.hs`, which allows us\n    to include `hsb2hs` in Build-Tools in cabal.\n\n  * Improved Windows installer (thanks to nkalvi).\n\n    + When per-machine installation is chosen, the system path\n      is updated instead of the user's.\n    + An appropriate default is used for per-machine installation\n      directory.\n    + Admin privileges are no longer required for a per-user install\n\n  * Travis:  unpack sdist for build to catch packaging bugs.\n\n  * Improved documentation on where user templates go (#2272).\n\n## pandoc 1.15.0.4 (2015-07-03)\n\n  * Added pandoc.1 man page to the repository.  It is no longer\n    built as part of the cabal build process. (This proved too\n    fragile.)  pandoc.1 can be regenerated (`make man/pandoc.1`)\n    when `README` is changed.\n\n  * Copying of the man page now respects `--destdir` (#2262).\n\n  * Improved error messages for filters.  User is now informed if\n    the filter requires an interpreter that isn't found in the path,\n    or if the filter returns an error status.\n\n## pandoc 1.15.0.3 (2015-07-02)\n\n  * Ensure target directory is created when installing man page.\n\n## pandoc 1.15.0.2 (2015-07-02)\n\n  * Added files needed for building man page to Extra-Source-Files.\n\n## pandoc 1.15.0.1 (2015-07-01)\n\n  * Man page is now built and installed as part of the cabal build\n    process. Removed Makefile target for man page.\n\n## pandoc 1.15 (2015-07-01)\n\n  * Man page changes:\n\n    + Removed `--man1`, `--man5` options (breaking change).\n    + Removed `Text.Pandoc.ManPages` module (breaking API change).\n    + Makefile target for `man/man1/pandoc.1`.  This uses pandoc to\n      create the man page from README using a custom template and filters.\n    + Added `man/` directory with template and filters needed to build\n      man page.\n    + We no longer have two man pages: `pandoc.1` and `pandoc_markdown.5`.\n      Now there is just pandoc.1, which has all the content from README.\n      This change was needed because of the extensive cross-references\n      between parts of the README.\n    + Removed old `data/pandoc.1.template` and\n      `data/pandoc_markdown.5.template`.\n\n  * OpenDocument writer: Do not add a carriage return after a hard\n    line break (Michael Chladek).\n\n  * ConTeXt writer:\n\n    + use `\\goto` for internal links.\n    + Added a `%` at end for `\\reference` to avoid spurious space.\n\n  * Ignore sandbox on 'make quick'\n\n## pandoc 1.14.1 (2015-06-30)\n\n  * Added `--man1` and `--man5` options to pandoc, allowing\n    pandoc to generate its own man pages. Man pages are no longer\n    automatically generated in the build process (the process for\n    this was too complex and prone to failure, #2190). The\n    `make-pandoc-man-pages` executable has been removed. The\n    `man/` directory has been removed, and man page templates\n    have been moved to `data/`. NOTE TO PACKAGERS: You will no\n    longer find pandoc's man pages in `man/`, but you can\n    generate them using `pandoc --man1 > pandoc.1` and `pandoc\n    --man5 > pandoc_markdown.5`.\n\n  * Added new unexported module:  `Text.Pandoc.ManPages`.\n\n  * `README` now acts like a data file (even though it isn't in\n    `data/`).  So, for example, `pandoc --print-default-data-file README`\n    will produce the README.)  This change was required for the `--man1`\n    and `--man5` options, since the man pages are produced from the\n    README, but it may be useful for other purposes as well.\n\n  * Allow `reference.docx` and `reference.odt` to be used with\n    `--print-default-data-file` and to shadow defaults if placed in\n    the user data directory.  Note that as of 1.14, we no longer\n    include these files as data files; instead, we include their\n    components.  This change causes pandoc to behave as if it has\n    these data files; they are constructed on demand when needed\n    using `getDefaultReferenceDocx` and `getDefaultReferenceODT`.\n\n  * Fixed regression in CSS parsing with `--self-contained` (#2224).\n    Pandoc 1.14.0.x used css-text to parse the CSS, but its parser\n    silently drops big sections of CSS.  This commit replaces the\n    use of css-text with a small but principled CSS preprocessor,\n    which removes whitespace and comments and replaces `url()` with\n    base 64 data when possible.\n\n  * Use `https://` instead of `//` for MathJax and KaTeX CDN URLs (#1920).\n    This will allow math to work when pages are being viewed locally.\n\n  * `Text.Pandoc.Options`:  Export `plainExtensions`.\n    These are the extensions used in `plain` output.\n\n  * LaTeX reader: Don't parse `_` and `^` as sub/superscript outside of\n    math mode; treat them as regular inline text.  Normally these will\n    cause an error in LaTeX, but there are contexts (e.g. `alltt`\n    environments) where they are allowed.\n\n  * HTML reader:  allow `<body>` to close `<head>`.\n\n  * DocBook reader: support `mediaobject`s and `figures` (#2184, mb21).\n\n  * RST reader: Fix reference names with special characters\n    (Lars-Dominik Braun).\n\n  * Textile writer:  escape `+` and `-` as entities (#2225).\n\n  * DokuWiki writer: Use proper `<code>` tags for code blocks (#2213).\n\n  * Plain writer:  don't use symbols for super/subscript (#2237).\n    Simplified code by using `plainExtensions`.\n\n  * InDesign writer: Properly escape URLs containing more than one\n    colon character (gohai).\n\n  * Docx writer: Make sure we use dist version of `reference.docx`\n    (and not the user's version) for certain settings.  Taking some\n    settings values from a user-supplied reference.docx can lead to\n    corruption.  This fixes a regression from the last release (#2249).\n\n  * `Text.Pandoc.Shared`: exports `getDefaultReferenceDocx` and\n    `getDefaultReferenceODT` (API change).  These functions have been\n    removed from the Docx and ODT writers.\n\n  * LaTeX template (Xavier Olive):\n    + Added `CJKmainfont` and `CJKoptions` variables.\n    + Allow dvipsnames (e.g. `MidnightBlue`) for colors (Xavier Olive).\n\n  * Epub templates:  use `author.role`, not `author.type`.\n\n  * Bump cmark version to >= 0.3.4.\n\n  * Improved Windows installer (#2205, thanks to nkalvi).\n    Users can now select a per-user or systemwide install, and can set\n    the installation path.  At the end of installation, the install location\n    is given.  The install location is also now given in the list of\n    installed programs in Control Panel.  Cleaner WiX syntax is used for\n    setting the path.\n\n  * Added `download_stats` target to Makefile.\n\n## pandoc 1.14.0.4 (2015-06-02)\n\n  * Added missing commonmark template.\n\n  * Improved try pandoc (moved button, show raw command).\n\n## pandoc 1.14.0.3 (2015-06-01)\n\n  * Allow compilation with syb 0.5.*.\n\n  * Custom writer:  fixed some compiler warnings for ghc < 7.10.\n\n## pandoc 1.14.0.2 (2015-05-31)\n\n  * Allow building with hslua 0.4.\n\n## pandoc 1.14.0.1 (2015-05-28)\n\n  * Fixed problem with building of `reference.docx` and `reference.odt`\n    when the `embed_data_files` flag is used.  Instead of having a phase\n    of the build where `reference.docx` and `reference.odt` are created\n    from their constituent data files, we now construct these archives\n    from their constituents when a `docx` or `odt` is built.  The\n    constituent files have been moved from `extra-source-files` to\n    `data-files`, and `reference.docx` and `reference.odt` have been\n    removed. Users can create their own `reference.docx` or\n    `reference.odt` by using pandoc to create a simple `docx` or `odt`.\n    `make-reference-files.hs` has been removed, simplifying the build\n    process (#2187)\n\n  * Don't include generated man pages in extra-source-files (#2189).\n\n  * Bumped upper bound for aeson.\n\n  * ConTeXt writer:  create internal link anchors for Div elements with\n    identifiers.  (This is needed for linked citations to work.)\n\n## pandoc 1.14 (2015-05-27)\n\n### New features\n\n  * Added `commonmark` as input and output format.\n\n  * Added `--verbose` flag for debugging output in PDF production (#1840,\n    #1653).\n\n  * Allow wildcards in `--epub-embed-font` arguments (#1939).\n\n  * Added `--latex-engine-opt` option (#969, #1779, Sumit Sahrawat).\n\n  * Added `shortcut_reference_links` extension (Konstantin Zudov, #1977).\n    This is enabled by default for those markdown flavors that\n    support reading shortcut reference links, namely: `markdown`,\n    `markdown_strict`, `markdown_github`, `markdown_php`.\n    If the extension is enabled, the reader parses shortcut reference\n    links like `[foo]`, and the writer creates such links unless doing\n    so would cause problems.  Users of markdown flavors that support\n    shortcut reference links should not notice a difference in reading\n    markdown, but the markdown pandoc produces may differ.\n    If shortcut links are not desired, the extension can be disabled\n    in the normal way.\n\n### Behavior changes\n\n  * `--toc` is now supported for `docx` output (#458, Nikolay Yakimov).\n    A \"dirty\" TOC is created at the beginning of document.\n    It can be regenerated after the document has been opened.\n\n  * An implicit `--filter pandoc-citeproc` is now triggered only when the\n    `--bibliography` option is used, and not when the `bibliography`\n    field in metadata is specified (#1849).\n\n  * Markdown reader:\n\n    + Reference links with `implicit_header_references` are no longer\n      case-sensitive (#1606).\n    + Definition lists no longer require indentation for first line (#2087).\n      Previously the body of the definition (after the `:` or `~` marker)\n      needed to be in column 4.  This commit relaxes that requirement,\n      to better match the behavior of PHP Markdown Extra.  So, now\n      this is a valid definition list:\n\n            foo\n            : bar\n    + Resolve a potentially ambiguity with table captions:\n\n            foo\n\n              : bar\n\n              -----\n              table\n              -----\n\n      Is \"bar\" a definition, or the caption for the table?  We'll count\n      it as a caption for the table.\n    + Disallow headerless pipe tables (#1996), to conform to GFM and PHP\n      Markdown Extra.  Note:  If you have been using headerless pipe tables,\n      this change may cause existing tables to break.\n    + Allow pipe tables with header but no body (#2017).\n    + Allow a digit as first character of a citation key (Matthias Troffaes).\n      See https://github.com/jgm/pandoc-citeproc/issues/97\n\n  * LaTeX reader:\n\n    + Don't limit includes to `.tex` extension (#1882).\n      If the extension is not `.tex`, it must be given explicitly in\n      the `\\input` or `\\include`.\n\n  * Docx reader:\n\n    + Allow numbering in the style file.  This allows inherited styles\n      with numbering (lists) (Jesse Rosenthal).\n\n  * Org reader:\n\n    + Support smart punctuation (Craig Bosma).\n    + Drop trees with a :noexport: tag (Albert Krewinkel). Trees having a\n      `:noexport:` tag set are not exported.  This mirrors org-mode.\n    + Put header tags into empty spans (Albert Krewinkel, #2160).\n      Org mode allows headers to be tagged: `* Headline  :TAG1:TAG2`.\n      Instead of being interpreted as part of the headline, the tags are now\n      put into the attributes of empty spans.  Spans without textual content\n      won't be visible by default, but they are detectable by filters.  They\n      can also be styled using CSS when written as HTML.\n    + Generalize code block result parsing (Albert Krewinkel).\n      Previously, only code blocks were recognized as result blocks;\n      now, any kind of block can be the result.\n\n  * Append newline to the LineBreak in Dokuwiki, HTML, EPUB,\n    LaTeX, MediaWiki, OpenDocument, Texinfo writers (#1924, Tim Lin).\n\n  * HTML writer:\n\n    + Add \"inline\" or \"display\" class to math spans (#1914).\n      This allows inline and display math to be styled differently.\n    + Include raw latex blocks if `--mathjax` specified (#1938).\n    + Require highlighting-kate >= 0.5.14 (#1903).\n      This ensures that all code blocks will be wrapped in a `div`\n      with class `sourceCode`.  Also, the default highlighting CSS\n      now adds `div.sourceCode { x-overflow: auto; }`, which means\n      that code blocks (even with line numbers) will acquire a scroll\n      bar on screens too small to display them (e.g. mobile phones).\n      See also jgm/highlighting-kate#65.\n\n  * LaTeX writer:\n\n    + Use a declaration for tight lists (Jose Luis Duran, Joseph\n      Harriott). Previously, pandoc hard-coded some commands to make\n      tight lists in LaTeX.  Now we use a custom command instead,\n      allowing the styling to be changed in a macro in the header.\n      (Note:  existing templates may need to be modified to include\n      the definition of this macro.  See the current template.)\n    + Beamer output: if the header introducing a slide has the\n      class `fragile`, add the `[fragile]` option to the slide (#2119).\n\n  * MediaWiki writer:\n\n    + Use `File:` instead of the deprecated `Image:` for images and\n      other media files (Greg Rundlett).\n\n  * DocBook writer:\n\n    + Render a `Div (id,_,_) [Para _]` element as a `para` element\n      with an `id` attribute.  This makes links to citations work in\n      DocBook with pandoc-citeproc.\n\n  * RST writer:\n\n    + Normalize headings to sequential levels (Nikolay Yakimov).\n      This is pretty much required by docutils.\n    + Treat headings in block quotes, etc as rubrics (Nikolay Yakimov).\n    + Better handling of raw latex inline (#1961).  We use\n      `` :raw-latex:`...` `` and add a definition for this role to\n      the template.\n\n  * EPUB writer:\n\n    + Remove `linear=no` from cover `itemref` (#1609).\n    + Don't use `sup` element for epub footnotes (#1995).\n      Instead, just use an a element with class `footnoteRef`.\n      This allows more styling options, and provides better results\n      in some readers (e.g. iBooks, where anything inside the a\n      tag breaks popup footnotes).\n    + Take TOC title from `toc-title` metadata field.\n\n  * Docx writer:\n\n    + Implemented `FirstParagraph` style (Jesse Rosenthal).\n      Following the ODT writer, we add the `FirstParagraph` style to the\n      first text paragraph following an image, blockquote, table, heading,\n      or beginning of document.  This allows it to be styled differently.\n      The default is for it to be the same as `Normal`.\n    + Added `BodyText` style (Jesse Rosenthal).\n      We apply a `BodyText` style to all unstyled paragraphs. This is,\n      essentially, the same as `Normal`, except that since not everything\n      inherits from `BodyText` (the metadata won't, for example, or\n      the headers or footnote numbers), we can change the text in the body\n      without having to make exceptions for everything.  If we do want to\n      change *everything*, we can still do it through `Normal`.\n    + Altered `Blockquote` style slightly (Jesse Rosenthal).\n      Since `BlockQuote` derives from `BodyText`, we just want to specify\n      by default that it won't indent, regardless of what `BodyText` does.\n      Note that this will not produce any visible difference in the default\n      configuration.\n    + Take TOC title from `toc-title` metadata field (Nikolay Yakimov).\n    + Added a style to figure images (Nikolay Yakimov).\n      Figures with empty captions use style `Figure`.\n      Figures with nonempty captions use style `Figure with Caption`, which\n      is based on `Figure`, and additionally has `keepNext` set.\n\n  * ODT writer:\n\n    + Added figure captions (Nikolay Yakimov). The following styles are\n      used for figures:\n      `Figure` -- for figure with empty caption),\n      `FigureWithCaption` (based on `Figure`) -- for figure with caption,\n      `FigureCaption` (based on `Caption`) -- for figure captions.\n      Also, `TableCaption` (based on `Caption`) is used for table captions.\n\n### API changes\n\n  * New `Text.Pandoc.Error` module with `PandocError` type\n    (Matthew Pickering).\n\n  * All readers now return `Either PandocError Pandoc` instead of `Pandoc`\n    (Matthew Pickering).  This allows better handling of errors.\n\n  * Added `Text.Pandoc.Writers.CommonMark`, exporting `writeCommonMark`.\n\n  * Added `Text.Pandoc.Readers.CommonMark`, exporting `readCommonMark`.\n\n  * Derive `Data` and `Typeable` instances for `MediaBag`, `Extension`,\n    `ReaderOptions`, `EPUBVersion`, `CiteMethod`, `ObfuscationMethod`,\n    `HTMLSlideVariant`, `TrackChanges`, `WriterOptions` (Shabbaz\n    Youssefi).\n\n  * New `Ext_shortcut_reference_links` constructor for `Extension`\n    (Konstantin Zudov).\n\n###  Bug fixes\n\n  * Markdown reader:\n\n    + Allow smart `'` after inline math (#1909, Nikolay Yakimov).\n    + Check for tex macros after indented code (#1973).\n    + Rewrote `charsInBalancedBrackets` for efficiency.\n    + Make sure a closing `</div>` doesn't get included in a\n      definition list item (#2127).\n    + Don't parse bracketed text as citation if it might be a link,\n      image, or footnote (Nikolay Yakimov).\n    + Require space after key in mmd title block (#2026, Nikolay\n      Yakimov).  Require space after key-value delimiter colon in mmd title\n      block.\n    + Require nonempty value in mmd title block (Nikolay Yakimov).\n    + Disable all metadata block extensions when parsing\n      metadata field values (#2026, Nikolay Yakimov).  Otherwise we\n      could get a mmd title block inside YAML metadata, for example.\n\n  * HTML reader:\n\n    + Improve self-closing tag detection in `htmlInBalanced` (#2146).\n    + Handle tables with `<th>` in body rows (#1859, mb21).\n    + Fixed `htmlTag` (#1820).  If the tag parses as a comment, we check\n      to see if the input starts with `<!--`. If not, it's bogus comment\n      mode and we fail `htmlTag`.\n    + Handle `base` tag; if it has an `href` value, this is added to\n      all relative URLs in links and images.\n\n  * DocBook reader:\n\n    + Look inside \"info\" elements for section titles (#1931).\n\n  * Docx reader:\n\n    + Parse images in deprecated vml format (Jesse Rosenthal).\n    + Allow sub/superscript verbatims (Jesse Rosenthal).\n      Verbatim usually shuts off all other run styles, but we don't want it\n      to shut off sub/superscript.\n\n  * LaTeX reader:\n\n    + Handle `tabular*` environment (#1850).\n      Note that the table width is not actually parsed or taken into\n      account, but pandoc no longer chokes on it.\n    + Ignore options in `\\lstinline` rather than raising error (#1997).\n    + Add some test cases for simple tables (Mathias Schenner).\n    + Handle valign argument in tables (Mathias Schenner) (currently\n      we just ignore this).\n    + Allow non-empty colsep in tables (Mathias Schenner).\n      The `tabular` environment allows non-empty column separators\n      with the \"@{...}\" syntax. Previously, pandoc would fail to\n      parse tables if a non-empty colsep was present. With this\n      commit, these separators are still ignored, but the table gets\n      parsed. A test case is included.\n    + Recognize `\\newpage` as a block command.\n    + Allow block content in `\\title{}` (#2001).\n    + Check for block-level newcommand aliases in blockCommand (Nikolay\n      Yakimov).\n    + Guard against paragraph starting with inline macro (Nikolay Yakimov).\n    + Properly gobble spaces after `\\\\` (#2007).\n\n  * Textile reader:\n\n    +  Handle newlines in table cells, and empty cells (#1919).\n\n  * Org reader:\n\n    + Allow image links with non-image targets (Hans-Peter Deifel).\n      This matches behavior of Org-Mode for links like\n      `[[http://example.com][https://www.haskell.org/static/img/logo.png]]`.\n\n  * Docbook writer:\n\n    + Don't print empty id attributes (thanks to Steve Horne).\n\n  * HTML writer:\n\n    + Fixed list-style-type for numbered example lists.\n      Should be \"decimal,\" not \"example\" (#1902).\n    + Do not omit missing `alt` attribute on `img` tag (#1131,\n      Konstantin Zudov).\n    + Allow multiple colgroups in table (#2122).\n    + In revealjs, ensure that lists in speaker notes don't add \"fragment\"\n      classes, which can cause additional keypresses to be needed to\n      advance a slide (#1394).\n\n  * LaTeX writer:\n\n    + Don't escape `$` in URL (#1913).\n    + Don't use listings in headers (Matthew Pickering, #1963).\n    + Recognize book documentclass if set in metadata (#1971).\n      This sets `--chapters` implicitly if the documentclass in metadata\n      is a book documentclass.  Previously this was done only if a book\n      documentclass was set in a variable.\n    + Add a `\\label` in `\\hyperdef` for Div, Span (or links don't work).\n    + Make `mainlang` work when `lang` is in metadata (#2174).\n\n  * Texinfo writer:\n\n    + Fix wrapping by using breakable spaces (Tim Lin).\n\n  * RST writer:\n\n    + Fixed toc depth in RST writer.  Previously the depth was being\n      rendered as a floating point number with a decimal point.\n\n  * Markdown writer:\n\n    + Improved escaping (#2086).  `<` should not be escaped as `\\<`, for\n      compatibility with original Markdown.  We now escape `<` and `>`\n      with entities.  Also, we now backslash-escape square brackets.\n    + Avoid introducing spurious list items through wrapping (#1946).\n    + Don't emit span tags if plain or raw HTML disabled.\n\n  * MediaWiki writer:\n\n    + Convert spaces to underscores in wikilink URL (#1982), like MediaWiki.\n\n  * AsciiDoc writer:\n\n    + Insert some needed blank lines (#1860).\n    + Avoid wrapping after list marker (#1858).\n\n  * EPUB writer:\n\n    + Properly handle internal links to IDs in spans, divs (#1884).\n    + Use plain writer for metadata dc: fields (#2121).\n      This gives better results when we have, e.g. multiple paragraphs.\n      Note that tags aren't allowed in these fields.\n    + Properly handle image links without an extension (#1855).\n    + Improved chapter splitting and internal link rewriting (#1887,\n      #2162, #2163).  This will ensure that internal links work and\n      that the references section produced by pandoc-citeproc is\n      in its own chapter.\n    + Fixed handling of svg images (#2183).\n\n  * ICML writer:\n\n    + Better handling of raw blocks and inlines (#1951).\n      Previously these were always escaped and printed verbatim.\n      Now they are ignored unless the format is `icml`, in which\n      case they are passed through unescaped.\n    + Fixed image URIs in ICML output (gohai).\n\n  * Custom writer:\n\n    + Raise error if loadstring returns an error status.\n    + Raise `PandocLuaException` instead of using 'error'.\n      Eventually we'll change the return type so that no exception\n      is involved, but at least this can be trapped.\n    + Use UTF-8 aware bytestring conversion.\n    + Set foreign encoding to UTF-8 (Nikolay Yakimov, #2101, #1634).\n      Also factored out ByteString, since it's only used as an intermediate\n      representation.\n\n  * Docx writer:\n\n    + Copy hyphenation settings from reference.docx (Nikolay Yakimov).\n    + Filter out illegal XML characters (#1992, Matthew Pickering).\n    + Added `noProof` to docx syntax highlighting `SourceCode` style.\n    + Added footnotes id -1 and 0 (Jesse Rosenthal).\n      Word uses, by default, footnotes with id -1 and 0 for separators. If a\n      user modifies `reference.docx`, they will end up with a `settings.xml`\n      file that references these footnotes, but no such footnotes in the\n      document. This will produce a corruption error. Here we add these to the\n      document and `settings.xml` file, so future modifications won't break\n      the file.\n    + Handle lists correctly inside table cells (Jesse Rosenthal).\n      Previously we didn't transform lists inside table cells.\n    + Set firstRow information in tables (Nikolay Yakimov).\n    + Don't replace `SourceCode` style in `reference.docx` if it is defined\n      there (Nikolay Yakimov, #1872).  If `--no-highlight` specified, remove\n      any `SourceCode` and `*Tok` styles in `reference.docx`.\n    + Attempt to match international style names (#1607, Nikolay Yakimov).\n    + Set these styles as custom (Nikolay Yakimov): `Author`, `Abstract`,\n      `Compact`, `Image Caption`, `Table Caption`, `Definition Term`,\n      `Definition`, `First Paragraph`.\n    + Rename these styles to correspond with Word `Normal.dotm` (Nikolay\n      Yakimov): `Block Quote -> Block Text`, `Link -> Hyperlink`,\n      `Footnote Ref -> Footnote Reference`.\n    + Added `Caption` style (Nikolay Yakimov).\n    + Changed these styles' inheritance (Nikolay Yakimov):\n      `Image Caption <- Caption`, `Table Caption <- Caption`.\n    + Remove `SourceCode` style from `reference.docx` (#1872).\n      This is added automatically by the docx writer.\n    + Added toc heading style to `reference.docx` (Nikolay Yakimov).\n\n  * `Text.Pandoc.PDF`\n\n    + Don't suggest \"Try xelatex\" if xelatex already in use (mb21, #1832).\n    + More comprehensible errors on image conversion (#2067).\n      EPS can't be supported without shelling out to something like\n      ImageMagick, but at least we can avoid mysterious error messages.\n\n  * `Text.Pandoc.Shared`:\n\n    + Make safeRead safe (#1801, Matthew Pickering).\n    + Added `mapLeft`, `hush` (Matthew Pickering).\n\n  * `Text.Pandoc.Pretty`:\n\n    + Remove partial function (Matthew Pickering).\n\n  * `Text.Pandoc.SelfContained`:\n\n    + Add `;charset=utf-8` to script mime type if missing (#1842).\n    + Improved building of data URIs (#1940).  Now base64 is used except\n      for `text/*` mime types.\n    + `cssURLs` no longer tries to fetch fragment URLs (#2121).\n    + Properly handle data URIs in css urls (#2129).\n      Use a proper CSS parser (adds dependency on `text-css`).\n\n  * `Text.Pandoc.UTF8`:\n\n    + Better handling of bare CRs in input files (#2132).\n      Previously we just stripped them out; now we convert\n      other line ending styles to LF line endings.\n\n  * `Text.Pandoc.ImageSize`:\n\n    + Fixed some exif header parsing bugs (#1834).\n    + Make imageSize return an Either, not a Maybe (#1834).\n      Use `runGetOrFail` (with `binary >= 0.7`) to return `Left` on\n      parse failure (rather than `error`).\n    + Improved warnings when image size can't be determined.\n    + Removed error landmines (Matthew Pickering).\n\n  * Added woff2 to MIME types (Alfred Wechselberger).\n\n  * pandoc:  When a binary input format is used, warn that file\n    arguments past the first one are being ignored (Matthew Pickering).\n\n### Template changes\n\n  * LaTeX template:\n\n    + Degrade gracefully if `\\paragraph` not defined.\n    + Include `grffile` together with `graphicx` (#2074).\n      This properly handles filenames containing spaces and dots.\n    + Redefine `\\paragraph`, `\\subparagraph`...  to behave more\n      like section headers (#1658).\n    + Import hyperref before polyglossia to avoid an error with xelatex,\n      \"please load package hyperref before bidi package\" (Nick Bart).\n    + Added `toccolor` variable to control link color in toc (Kaixhin).\n\n  * LaTeX, Beamer templates:\n\n    + Provide `\\tightlist`, which is now used by the LaTeX writer.\n    + Use polyglossia in beamer (#85).\n    + Use `bibliography` instead of `biblio-files`\n      (#1661).  Also use `\\addbibresource` instead of `\\bibliography` for\n      biblatex.\n    + Added `setotherlanguages` in polyglossia. This uses an `otherlang`\n      variable that is derived from a comma-separated list in `lang`;\n      the last language is `mainlang` and the others are `otherlang`.\n\n  * EPUB templates:\n\n    + Use `div`, not `p`, for \"rights\" on title page.\n    + Added header-includes, include-before, include-after (#1987).\n\n  * OpenDocument template:\n\n    + Use `text:p` instead of `text:h` for title.\n      Using `text:h` causes problems with numbering.  Closes #2059.\n      Thanks to @nkalvi for diagnosing this.\n\n  * reveal.js template:\n\n    + Link to non-minified css, js.  The minified versions no longer\n      ship with the library.\n    + Correctly include style CSS (#1949).\n    + New configurable options options: `center`, `maxScale`, `slideNuber`\n      (Dmitry Smirnov, pandoc-templates#89).\n    + Moved custom CSS after theme.  This allows custom CSS to modify\n      themes, instead of being replaced by them.\n    + Allow `center` to be set to false.\n\n### Under the hood improvements\n\n  * Removed pre-built `reference.docx` and `reference.odt` (Nikolay\n    Yakimov).  Instead the repository now includes the component text files,\n    and the zipped binaries are built from these using a helper\n    program, `make-reference-files`.  This should make maintenance of\n    these components easier going forward.\n\n  * `Text.Pandoc.Parsing`:\n\n    + Added new `<+?>` combinator (Nikolay Yakimov).\n    + Added `stateHeaderKeys` to `ParserState`.\n\n  * `make_deb.sh` fixes:\n\n    + Detect architecture.\n    + Add Installed-Size to debian package control file (#1900).\n    + Use `fakeroot` to get permissions right.\n    + Use `mkdir` and `cp` instead of `install`.\n    + Set permissions of directories to 755.\n    + Install in `/usr` rather than `/usr/local`.\n    + Compress man pages.\n    + Combine copyright files for `pandoc`, `pandoc-citeproc`.\n\n  * Added `Text.Pandoc.Compat.Locale` and `old-locale` flag\n    to assist with transition to `time` 1.5.\n\n  * Updated CONTRIBUTING.md with information about issue tags (Matthew\n    Pickering).\n\n  * Updated travis installs to the new sudo-less syntax (Tim Lin).\n\n  * Updated dependency version bounds.\n\n  * EPUB tests:  don't use `joinPath`, which varies across platforms.\n    Instead, use a forward-slash to join paths, regardless of the\n    platform. This matches the way `MediaBag` now works.\n\n  * Clarify JSON input and output in usage message (Caleb McDaniel).\n\n  * Improved INSTALL instructions.\n\n  * Always build man pages.  Removed make-pandoc-man-pages flag.\n\n  * Makefile:  removed man target, now that we generate man pages by default.\n\n  * README:\n\n    + Fixed typos (J. Lewis Muir).\n    + Added documentation on backtick_code_blocks (#2135, Nikolay Yakimov).\n    + Added note on in-field markup in biblio databases (Nick Bart).\n    + Fixed misleading example of raw HTML block.\n    + Various minor formatting and consistency fixes for the program\n      options (Andreas Lööw).\n    + Made definition lists for options all \"loose\" for consistency.\n    + Added YAML biblio format to table, and note on `pandoc-citeproc`'s\n      `--bib2json` and `--bib2yaml` options (Nick Bart).\n    + Removed obsolete reference to `mods2yaml` (Nick Bart).\n    + Added section on syntax highlighting.\n    + Documented `toccolor` variable.\n\n## pandoc 1.13.2.1 (2015-04-15)\n\n  * Updated to build with ghc 7.10.1.\n\n  * Bumped package upper bounds for filepath, blaze-html, blaze-markup.\n\n## pandoc 1.13.2 (2014-12-20)\n\n  * TWiki Reader: add new new twiki reader (API chaneg, Alexander Sulfrian).\n\n  * Markdown reader:\n\n    + Better handling of paragraph in div (#1591).\n      Previously text that ended a div would be parsed as Plain\n      unless there was a blank line before the closing div tag.\n    + Don't treat a citation as a reference link label (#1763).\n    + Fix autolinks with following punctuation (#1811).\n      The price of this is that autolinked bare URIs can no longer\n      contain `>` characters, but this is not a big issue.\n    + Fix `Ext_lists_without_preceding_blankline` bug (#1636, Artyom).\n    + Allow `startnum` to work without `fancy_lists`. Formerly\n      `pandoc -f markdown-fancy_lists+startnum` did not work properly.\n\n  * RST reader (all Daniel Bergey):\n\n    + Parse quoted literal blocks (#65).  RST quoted literal blocks are\n      the same as indented literal blocks (which pandoc already supports)\n      except that the quote character is preserved in each line.\n    + Parse RST class directives. The class directive accepts one or more\n      class names, and creates a Div value with those classes.  If the\n      directive has an indented body, the body is parsed as the children of\n      the Div.  If not, the first block following the directive is made a\n      child of the Div. This differs from the behavior of rst2xml, which\n      does not create a Div element.  Instead, the specified classes are\n      applied to each child of the directive.  However, most Pandoc Block\n      constructors to not take an Attr argument, so we can't duplicate this\n      behavior.\n    + Warn about skipped directives.\n    + Literal role now produces Code. Code role should have \"code\" class.\n    + Improved support for custom roles\n\n        - Added `sourceCode` to classes for `:code:` role, and anything\n          inheriting from it.\n        - Add the name of the custom role to classes if the Inline\n          constructor supports Attr.\n        - If the custom role directive does not specify a parent role,\n          inherit from the `:span:` role.\n\n      This differs somewhat from the `rst2xml.py` behavior.  If a custom\n      role inherits from another custom role, Pandoc will attach both\n      roles' names as classes.  `rst2xml.py` will only use the class of\n      the directly invoked role (though in the case of inheriting from a\n      `:code:` role with a `:language:` defined, it will also provide the\n      inherited language as a class).\n    + Warn about ignored fields in role directives.\n\n  * LaTeX reader:\n\n    + Parse label after caption into a span instead of\n     inserting an additional paragraph of bracketed text (#1747).\n    + Parse math environments as inline when possible (#1821).\n    + Better handling of `\\noindent` and `\\greektext` (#1783).\n    + Handle `\\texorpdfstring` more gracefully.\n    + Handle `\\cref` and `\\sep` (Wikiwide).\n    + Support `\\smartcite` and `\\Smartcite` from biblatex.\n\n  * HTML reader:\n\n    + Retain display type of MathML output (#1719, Matthew Pickering).\n    + Recognise `<br>` tags inside `<pre>` blocks (#1620, Matthew Pickering).\n    + Make `embed` tag either block or inline (#1756).\n\n  * DocBook reader:\n\n    + Handle `keycombo`, `keycap` (#1815).\n    + Get string content in inner tags for literal elements (#1816).\n    + Handle `menuchoice` elements better, with a `>` between (#1817).\n    + Include `id` on section headers (#1818).\n    + Document/test \"type\" as implemented (Brian O'Sullivan).\n    + Add support for calloutlist and callout (Brian O'Sullivan).\n      We treat a calloutlist as a bulleted list. This works well in practice.\n    + Add support for `classname` (Bryan O'Sullivan).\n\n  * Docx reader:\n\n    + Fix window path for image lookup (Jesse Rosenthal).\n      Don't use os-sensitive \"combine\", since we always want the paths in our\n      zip-archive to use forward-slashes.\n    + Single-item headers in ordered lists are headers (Jesse Rosenthal).\n      When users number their headers, Word understands that as a single item\n      enumerated list. We make the assumption that such a list is, in fact,\n      a header.\n    + Rewrite rewriteLink to work with new headers (Jesse Rosenthal).\n      There could be new top-level headers after making lists, so we have to\n      rewrite links after that.\n    + Use polyglot header list (Jesse Rosenthal).\n      We're just keeping a list of header formats that different languages\n      use as their default styles. At the moment, we have English, German,\n      Danish, and French. We can continue to add to this.\n      This is simpler than parsing the styles file, and perhaps less\n      error-prone, since there seems to be some variations, even within a\n      language, of how a style file will define headers.\n    + Remove header class properly in other langs (Jesse Rosenthal).\n      When we encounter one of the polyglot header styles, we want to remove\n      that from the par styles after we convert to a header. To do that, we\n      have to keep track of the style name, and remove it appropriately.\n    + Account for external link URLs with anchors. Previously, if a URL\n      had an anchor, the reader would incorrectly identify it as an\n      internal link and return only the anchor as URL. (Caleb McDaniel)\n    + Fix for Issue #1692 (i18n styles) (Nikolay Yakimov).\n\n  * Org reader:\n\n    + Added state changing blanklines (Jesse Rosenthal).\n      This allows us to emphasize at the beginning of a new paragraph (or, in\n      general, after blank lines).\n    + Fixed bug with bulleted lists:\n\n        - a\n        - b\n        * c\n\n      was being parsed as a list, even though an unindented `*`\n      should make a heading.  See\n      <http://orgmode.org/manual/Plain-lists.html#fn-1>.\n    + Org reader: absolute, relative paths in link (#1741, Albert\n      Krewinkel). The org reader was too restrictive when parsing links;\n      some relative links and links to files given as absolute paths\n      were not recognized correctly.\n    + Org reader:  allow empty links (jgm/gitit#471, Albert Krewinkel).\n      This is important for use in gitit, which uses empty links\n      for wikilinks.\n    + Respect indent when parsing Org bullet lists (#1650, Timothy\n      Humphries).  Fixes issue with top-level bullet list parsing.\n    + Fix indent issue for definition lists (Timothy Humphries,\n      see #1650, #1698, #1680).\n    + Parse multi-inline terms correctly in definition list (#1649,\n      Matthew Pickering).\n    + Fix rules for emphasis recognition (Albert Krewinkel).\n      Things like `/hello,/` or `/hi'/` were falsy recognized as emphasised\n      strings.  This is wrong, as `,` and `'` are forbidden border chars and\n      may not occur on the inner border of emphasized text.\n    + Drop COMMENT document trees (Albert Krewinkel).\n      Document trees under a header starting with the word `COMMENT` are\n      comment trees and should not be exported.  Those trees are dropped\n      silently (#1678).\n    + Properly handle links to `file:target` (Albert Krewinkel).\n      Org links like `[[file:target][title]]` were not handled correctly,\n      parsing the link target verbatim.  The org reader is changed such that\n      the leading `file:` is dropped from the link target (see #756, #1812).\n    + Parse LaTeX-style MathML entities (#1657, Albert Krewinkel).\n      Org supports special symbols which can be included using LaTeX syntax,\n      but are actually MathML entities.  Examples for this are\n      `\\nbsp` (non-breaking space), `\\Aacute` (the letter A with accent acute)\n      or `\\copy` (the copyright sign ©)\n\n  * EPUB reader:\n\n    + URI handling improvements. Now we outsource most of the work to\n      `fetchItem'`. Also, do not include queries in file extensions (#1671).\n\n  * LaTeX writer:\n\n    + Use `\\texorpdfstring` for section captions when needed (Vaclav Zeman).\n    + Handle consecutive linebreaks (#1733).\n    + Protect graphics in headers (Jesse Rosenthal).\n      Graphics in `\\section`/`\\subsection` etc titles need to be `\\protect`ed.\n    + Put `~` before header in list item text (Jesse Rosenthal).\n      Because of the built-in line skip, LaTeX can't handle a section header\n      as the first element in a list item.\n    + Avoid using reserved characters as `\\lstinline` delimiters (#1595).\n    + Better handling of display math in simple tables (#1754).\n      We convert display math to inline math in simple tables,\n      since LaTeX can't deal with display math in simple tables.\n    + Escape spaces in code (#1694, Bjorn Buckwalter).\n\n  * MediaWiki writer:\n\n    + Fixed links with URL = text. Previously these were rendered as bare\n      words, even if the URL was not an absolute URL (#1825).\n\n  * ICML writer:\n\n    + Don't force all citations into footnotes.\n\n  * RTF writer:\n\n    + Add blankline at end of output (#1732, Matthew Pickering).\n\n  * RST writer:\n\n    + Ensure blank line after figure.\n    + Avoid excess whitespace after last list item (#1777).\n    + Wrap line blocks with spaces before continuations (#1656).\n    + Fixed double-rendering of footnotes in RST tables (#1769).\n\n  * DokuWiki writer:\n\n    + Better handling of block quotes. This change ensures that\n      multiple paragraph blockquotes are rendered using native `>`\n      rather than as HTML (#1738).\n    + Fix external images (#1739). Preface relative links with \":\",\n      absolute URIs without. (Timothy Humphries)\n\n  * HTML writer:\n\n    + Use protocol-relative URL for mathjax.\n    + Put newline btw img and caption paragraph.\n    + MathML now outputted with tex annotation (#1635, Matthew Pickering).\n    + Add support for KaTeX HTML math (#1626, Matthew Pickering).\n      This adds `KaTeX` to `HTMLMathMethod` (API change).\n    + Don't double render when `email-obfuscation=none` (#1625, Matthew\n      Pickering).\n    + Make header attributes work outside top level (#1711).\n      Previously they only appeared on top level header elements.\n      Now they work e.g. in blockquotes.\n\n  * ODT writer:\n\n    + Correctly handle images without extensions (#1729).\n    + Strip querystring in ODT write (#1682, Todd Sifleet).\n\n  * FB2 writer:\n\n    + Add newline to output.\n\n  * EPUB writer:\n\n    + Don't add `sourceURL` to absolute URIs (#1669).\n    + Don't use unsupported `opf:title-type` for epub2.\n    + Include \"landmarks\" section in nav document for epub3 (#1757).\n    + Removed playOrder from navpoint elements in ncx file (#1760).\n      These aren't required, and they make manual modification of epubs\n      difficult.\n    + Extract title even from structured title.\n    + Don't include nav node in spine unless `--toc` was requested.\n      Previously we included it in the spine with `linear=\"no\"`, leading\n      to odd results in some readers (#1593).\n    + Fixed absolute URI detection (#1672).\n    + Correctly resolve relative URIs (#1671).\n    + Use regular page template for `nav.xhtml`, including doctype (#1759).\n\n  * Docx writer:\n\n    + Put docx table captions above tables (#1641, Nikolay Yakimov).\n    + Get the page width from the reference docx file, and use\n      it to scale images that are too large to fit (Grégory Bataille).\n    + Partial fix for #1607 (Nikolay Yakimov). International heading styles\n      are inferred based on `<w:name val=\"heading #\">` fallback, if there\n      are no en-US \"Heading#\" styles\n    + Look in user data dir for archive `reference.docx`.\n    + Renumber header and footer relationships to avoid collisions (Jesse\n      Rosenthal). We previously took the old relationship names of the\n      headers and footer in secptr. That led to collisions. We now make\n      a map of available names in the relationships file, and then rename\n     in secptr.\n\n  * ConTeXt writer:\n\n    + Add function toLabel (Mark Szepieniec).\n      This function can be used to sanitize reference labels so that\n      they do not contain any of the illegal characters \\#[]\",{}%()|= .\n      Currently only Links have their labels sanitized, because they\n      are the only Elements that use passed labels.\n\n  * `Text.Pandoc.Shared`:\n\n    + Moved import of `toChunks` outside of CPP conditional (#1590).\n    + Fix `inDirectory` to reset to the original directory in case\n      an exception occurs (Freiric Barral).\n\n  * Templates:\n\n    + LaTeX template: load polyglossia before bibtex (jgm/pandoc-templates#70).\n      Thanks to bluebirch.\n    + LaTeX template: Added `\\VerbatimFootnotes` if there is verbatim in notes\n      (#1616).\n    + LaTeX template:  Add shorthands=off to babel options (#1648).\n    + EPUB, EPUB3 templates: Added `id=\"cover\"` to body of cover page.\n      This aids styling, making it possible for example to set 0 margins\n      on the title page (#1758).\n    + EPUB, EPUB3 templates:  Handle structured metadata on titlepage.\n      Previously we just expected 'title', 'subtitle', 'author', 'date'.\n      Now we still support those, but also support the format recommended\n      for epub metadata in the pandoc README:\n\n        ---\n        title:\n        - type: main\n          text: My Book\n        - type: subtitle\n          text: An investigation of metadata\n        creator:\n        - role: author\n          text: John Smith\n        - role: editor\n          text: Sarah Jones\n        identifier:\n        - scheme: DOI\n          text: doi:10.234234.234/33\n        publisher:  My Press\n        rights:  (c) 2007 John Smith, CC BY-NC\n        ...\n\n  * `Text.Pandoc.Templates.getDefaultTemplate`:\n    don't fail when called with \"fb2\" (#1660).\n\n  * `Text.Pandoc.Parsing`:\n\n    + Fixed `inlineMath` so it handles `\\text{..}` containing `$`.\n      For example: `$x = \\text{the $n$th root of $y$}` (#1677).\n    + Change `parseFromString` to fail if not all input is consumed.\n      (Matthew Pickering)\n    + Moved `addWarning` from Markdown reader to `Parsing`, so it can be\n      used by more readers (API change, Daniel Bergey).\n\n  * `Text.Pandoc.Pretty`:\n\n    +  Improve performance of `realLength` (Matthew Pickering).\n    +  Make CR + BLANKLINE = BLANKLINE. This fixes an extra blank line we\n       were getting at the end of markdown fragments (as well as rst, org,\n       etc.) (#1705).\n\n  * `Text.Pandoc.MIME`:\n\n    + Add mime type for WebVTT (Jason Ronallo).\n    + Changed mime type for `otf` to `application/vnd.ms-opentype` (#1761).\n      This is needed for epub3 validation.\n\n  * `Text.Pandoc.MediaBag`:\n\n    + Fix Windows specific path problems (#1597).\n\n  * `Text.Pandoc.Shared`:\n\n    + Make `collapseFilePath` OS-agnostic (Matthew Pickering).\n\n  * Link the test suite using `-threaded`.\n    This allows the test suite to be run using `+RTS -N`.\n\n  * Added `network` dependency under `network-uri` flag in test section.\n\n  * Give better error messages when someone tries to convert from\n    pdf, doc, odt (#1683).\n\n  * Added `track` to list of tags treated by `--self-contained` (#1664).\n\n\n## pandoc 1.13.1 (2014-08-30)\n\n  * Fixed `--self-contained` with Windows paths (#1558).\n    Previously `C:\\foo.js` was being wrongly interpreted as a URI.\n\n  * HTML reader:  improved handling of tags that can be block or inline.\n    Previously a section like this would be enclosed in a paragraph,\n    with RawInline for the video tags (since video is a tag that can\n    be either block or inline):\n\n        <video controls=\"controls\">\n           <source src=\"../videos/test.mp4\" type=\"video/mp4\" />\n           <source src=\"../videos/test.webm\" type=\"video/webm\" />\n           <p>\n              The videos can not be played back on your system.<br/>\n              Try viewing on Youtube (requires Internet connection):\n              <a href=\"http://youtu.be/etE5urBps_w\">Relative Velocity on\n        Youtube</a>.\n           </p>\n        </video>\n\n    This change will cause the video and source tags to be parsed\n    as RawBlock instead, giving better output.\n    The general change is this:  when we're parsing a \"plain\" sequence\n    of inlines, we don't parse anything that COULD be a block-level tag.\n\n  * Docx reader:\n\n    + Be sensitive to user styles.  Note that \"Hyperlink\" is\n      \"blacklisted,\" as we don't want the default underline styling to be\n      inherited by all links by default (Jesse Rosenthal).\n    + Read single paragraph in table cell as `Plain` (Jesse Rosenthal).\n      This makes to docx reader's native output fit with the way the markdown\n      reader understands its markdown output.\n\n  * Txt2Tags reader:\n\n    + Header is now parsed only if standalone flag is set (Matthew Pickering).\n    + The header is now parsed as meta information. The first line is the\n      `title`, the second is the `author` and third line is the `date`\n      (Matthew Pickering).\n    + Corrected formatting of `%%mtime` macro (Matthew Pickering).\n    + Fixed crash when reading from stdin.\n\n  * Textile writer:  Extended the range of cases where native textile\n    tables will be used (as opposed to raw HTML):  we now handle any\n    alignment type, but only for simple tables with no captions.\n\n  * EPUB writer:  Don't use page-progression-direction in EPUB2, which\n    doesn't support it.  Also, if page-progression-direction not specified\n    in metadata, don't include the attribute even in EPUB3; not including it\n    is the same as including it with the value \"default\", as we did before.\n    (#1550)\n\n  * Org writer: Accept example lines with indentation at the beginning\n    (Calvin Beck).\n\n  * DokuWiki writer:\n\n    + Refactor to use Reader monad (Matthew Pickering).\n    + Avoid using raw HTML in table cells; instead, use `\\\\`\n      instead of newlines (Jesse Rosenthal).\n    + Properly handle HTML table cell alignments, and use spacing\n      to make the tables look prettier (#1566).\n\n  * Docx writer:\n\n    + Bibliography entries get `Bibliography` style (#1559).\n    + Implement change tracking (Jesse Rosenthal).\n\n  * LaTeX writer:\n\n    + Fixed a bug that caused a table caption to repeat across all pages\n      (Jose Luis Duran).\n    + Improved vertical spacing in tables and made it customizable using\n      standard lengths set by booktab.  See\n      <https://groups.google.com/forum/#!msg/pandoc-discuss/qMu6_5lYy0o/ZAU7lzAIKw0J>\n      (Jose Luis Duran).\n    + Added `\\strut` to fix spacing in multiline tables (Jose Luis Duran).\n    + Use `\\tabularnewline` instead of `\\\\` in table cells (Jose Luis Duran).\n    + Made horizontal rules more flexible (Jose Luis Duran).\n\n  * Text.Pandoc.MIME:\n\n    + Added `MimeType` (type synonym for `String`) and `getMimeTypeDef`.\n      Code cleanups (Artyom Kazak).\n\n  * Templates:\n\n    + LaTeX template: disable microtype protrusion for typewriter font (#1549,\n      thanks lemzwerg).\n\n  * Improved OSX build procedure.\n\n  * Added `network-uri` flag, to deal with split of `network-uri` from\n    `network`.\n\n  * Fix build dependencies for the `trypandoc` flag, so that they are\n    ignored if `trypandoc` flag is set to False (Gabor Pali).\n\n  * Updated README to remove outdated claim that `--self-contained`\n    looks in the user data directory for missing files.\n\n## pandoc 1.13.0.1 (2014-08-17)\n\n  * Docx writer:\n\n    + Fixed regression which bungled list numbering (#1544), causing\n      all lists to appear as basic ordered lists.\n    + Include row width in table rows (Christoffer Ackelman, Viktor Kronvall).\n      Added a property to all table rows where the sum of column widths\n      is specified in pct (fraction of 5000).  This helps persuade Word\n      to lay out the table with the widths we specify.\n\n  * Fixed a bug in Windows 8 which caused pandoc not to find the\n    `pandoc-citeproc` filter (#1542).\n\n  * Docx reader: miscellaneous under-the-hood improvements (Jesse Rosenthal).\n    Most significantly, the reader now uses Builder, leading to some\n    performance improvements.\n\n  * HTML reader:  Parse appropriately styled span as SmallCaps.\n\n  * Markdown writer: don't escape `$`, `^`, `~` when `tex_math_dollars`,\n    `superscript`, and `subscript` extensions, respectively, are\n    deactivated (#1127).\n\n  * Added `trypandoc` flag to build CGI executable used in the online\n    demo.\n\n  * Makefile:  Added 'quick', 'osxpkg' targets.\n\n  * Updated README in templates to indicate templates license.\n    The templates are dual-licensed, BSD3 and GPL2+.\n\n## pandoc 1.13 (15 August 2014)\n\n### New features\n\n  * Added `docx` as an input format (Jesse Rosenthal).  The docx\n    reader includes conversion of native Word equations to pandoc\n    LaTeX `Math` elements.  Metadata is taken from paragraphs at the\n    beginning of the document with styles `Author`, `Title`, `Subtitle`,\n    `Date`, and `Abstract`.\n\n  * Added `epub` as an input format (Matthew Pickering).  The epub\n    reader includes conversion of MathML to pandoc LaTeX `Math`\n    elements.\n\n  * Added `t2t` (Txt2Tags) as an input format (Matthew Pickering).\n    Txt2tags is a lightweight markup format described at\n    <http://txt2tags.org/>.\n\n  * Added `dokuwiki` as an output format (Clare Macrae).\n\n  * Added `haddock` as an output format.\n\n  * Added `--extract-media` option to extract media contained in a zip\n    container (docx or epub) while adjusting image paths to point to the\n    extracted images.\n\n  * Added a new markdown extension, `compact_definition_lists`, that\n    restores the syntax for definition lists of pandoc 1.12.x, allowing\n    tight definition lists with no blank space between items, and\n    disallowing lazy wrapping.  (See below under behavior changes.)\n\n  * Added an extension `epub_html_exts` for parsing HTML in EPUBs.\n\n  * Added extensions `native_spans` and `native_divs` to activate\n    parsing of material in HTML span or div tags as Pandoc Span\n    inlines or Div blocks.\n\n  * `--trace` now works with the Markdown, HTML, Haddock, EPUB,\n    Textile, and MediaWiki readers.  This is an option intended\n    for debugging parsing problems; ordinary users should not need\n    to use it.\n\n### Behavior changes\n\n  * Changed behavior of the `markdown_attribute` extension, to bring\n    it in line with PHP markdown extra and multimarkdown.  Setting\n    `markdown=\"1\"` on an outer tag affects all contained tags,\n    recursively, until it is reversed with `markdown=\"0\"` (#1378).\n\n  * Revised markdown definition list syntax (#1429).  Both the reader\n    and writer are affected.  This change brings pandoc's definition list\n    syntax into alignment with that used in PHP markdown extra and\n    multimarkdown (with the exception that pandoc is more flexible about\n    the definition markers, allowing tildes as well as colons).  Lazily\n    wrapped definitions are now allowed.  Blank space is required\n    between list items.  The space before a definition is used to determine\n    whether it is a paragraph or a \"plain\" element.  **WARNING: This change\n    may break existing documents!**  Either check your documents for\n    definition lists without blank space between items, or use\n    `markdown+compact_definition_lists` for the old behavior.\n\n  * `.numberLines` now works in fenced code blocks even if no language\n    is given (#1287, jgm/highlighting-kate#40).\n\n  * Improvements to `--filter`:\n\n    + Don't search PATH for a filter with an explicit path.\n      This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from\n      the system path, even if there was a `caps.py` in the working directory.\n    + Respect shebang if filter is executable (#1389).\n    + Don't print misleading error message.\n      Previously pandoc would say that a filter was not found,\n      even in a case where the filter had a syntax error.\n\n  * HTML reader:\n\n    + Parse `div` and `span` elements even without `--parse-raw`,\n      provided `native_divs` and `native_spans` extensions are set.\n      Motivation:  these now generate native pandoc Div and Span\n      elements, not raw HTML.\n    + Parse EPUB-specific elements if the `epub_html_exts`\n      extension is enabled.  These include `switch`, `footnote`,\n      `rearnote`, `noteref`.\n\n  * Org reader:\n\n    + Support for inline LaTeX.  Inline LaTeX is now accepted and parsed by the\n      org-mode reader.  Both math symbols (like `\\tau`) and LaTeX commands (like\n      `\\cite{Coffee}`), can be used without any further escaping (Albert\n      Krewinkel).\n\n  * Textile reader and writer:\n\n    + The `raw_tex` extension is no longer set by default.  You can\n      enable it with `textile+raw_tex`.\n\n  * DocBook reader:\n\n    + Support `equation`, `informalequation`, `inlineequation` elements with\n      `mml:math` content.  This is converted into LaTeX and put into a Pandoc\n      Math inline.\n\n  * Revised `plain` output, largely following the style of Project\n    Gutenberg:\n\n    + Emphasis is rendered with `_underscores_`, strong emphasis\n      with ALL CAPS.\n    + Headings are rendered differently, with space to set them off,\n      not with setext style underlines. Level 1 headers are ALL CAPS.\n    + Math is rendered using unicode when possible, but without the\n      distracting emphasis markers around variables.\n    + Footnotes use a regular `[n]` style.\n\n  * Markdown writer:\n\n    + Horizontal rules are now a line across the whole page.\n    + Prettier pipe tables.  Columns are now aligned  (#1323).\n    + Respect the `raw_html` extension.  `pandoc -t markdown-raw_html`\n      no longer emits any raw HTML, including span and div tags\n      generated by Span and Div elements.\n    + Use span with style for `SmallCaps` (#1360).\n\n  * HTML writer:\n\n    + Autolinks now have class `uri`, and email autolinks have class\n      `email`, so they can be styled.\n\n  * Docx writer:\n\n    + Document formatting is carried over from `reference.docx`.\n      This includes margins, page size, page orientation, header,\n      and footer, including images in headers and footers.\n    + Include abstract (if present) with `Abstract` style (#1451).\n    + Include subtitle (if present) with `Subtitle` style, rather\n      than tacking it on to the title (#1451).\n\n  * Org writer:\n\n    + Write empty span elements with an id attribute as org anchors.\n      For example `Span (\"uid\",[],[]) []` becomes `<<uid>>`.\n\n  * LaTeX writer:\n\n    + Put table captions above tables, to match the conventional\n      standard.  (Previously they appeared below tables.)\n    + Use `\\(..\\)` instead of `$..$` for inline math (#1464).\n    + Use `\\nolinkurl` in email autolinks.  This allows them to be styled\n      using `\\urlstyle{tt}`.  Thanks to Ulrike Fischer for the solution.\n    + Use `\\textquotesingle` for `'` in inline code.  Otherwise we get\n      curly quotes in the PDF output (#1364).\n    + Use `\\footnote<.>{..}` for notes in beamer, so that footnotes\n      do not appear before the overlays in which their markers appear\n      (#1525).\n    + Don't produce a `\\label{..}` for a Div or Span element.  Do produce\n      a `\\hyperdef{..}` (#1519).\n\n  * EPUB writer:\n\n    + If the metadata includes `page-progression-direction` (which can be\n      `ltr` or `rtl`, the `page-progression-direction` attribute will\n      be set in the EPUB spine (#1455).\n\n  * Custom lua writers:\n\n    + Custom writers now work with `--template`.\n    + Removed HTML header scaffolding from `sample.lua`.\n    + Made citation information available in lua writers.\n\n  * `--normalize` and `Text.Pandoc.Shared.normalize` now consolidate\n    adjacent `RawBlock`s when possible.\n\n### API changes\n\n  * Added `Text.Pandoc.Readers.Docx`, exporting `readDocx` (Jesse Rosenthal).\n\n  * Added `Text.Pandoc.Readers.EPUB`, exporting `readEPUB` (Matthew\n    Pickering).\n\n  * Added `Text.Pandoc.Readers.Txt2Tags`, exporting `readTxt2Tags` (Matthew\n    Pickering).\n\n  * Added `Text.Pandoc.Writers.DokuWiki`, exporting `writeDokuWiki`\n    (Clare Macrae).\n\n  * Added `Text.Pandoc.Writers.Haddock`, exporting `writeHaddock`.\n\n  * Added `Text.Pandoc.MediaBag`, exporting `MediaBag`, `lookupMedia`,\n    `insertMedia`, `mediaDirectory`, `extractMediaBag`.  The docx and epub\n    readers return a pair of a `Pandoc` document and a `MediaBag` with\n    the media resources they contain.  This can be extracted using\n    `--extract-media`.  Writers that incorporate media (PDF, Docx,\n    ODT, EPUB, RTF, or HTML formats with `--self-contained`) will look\n    for resources in the `MediaBag` generated by the reader, in addition to\n    the file system or web.\n\n  * `Text.Pandoc.Readers.TexMath`: Removed deprecated `readTeXMath`.\n    Renamed `readTeXMath'` to `texMathToInlines`.\n\n  * `Text.Pandoc`: Added `Reader` data type (Matthew Pickering).\n    `readers` now associates names of readers with `Reader`\n     structures.  This allows inclusion of readers, like the docx\n     reader, that take binary rather than textual input.\n\n  * `Text.Pandoc.Shared`:\n\n    + Added `capitalize` (Artyom Kazak), and replaced uses of\n      `map toUpper` (which give bad results for many languages).\n    + Added `collapseFilePath`, which removes intermediate `.` and\n      `..` from a path (Matthew Pickering).\n    + Added `fetchItem'`, which works like `fetchItem` but searches\n      a `MediaBag` before looking on the net or file system.\n    + Added `withTempDir`.\n    + Added `removeFormatting`.\n    + Added `extractSpaces` (from HTML reader) and generalized its type\n      so that it can be used by the docx reader (Matthew Pickering).\n    + Added `ordNub`.\n    + Added `normalizeInlines`, `normalizeBlocks`.\n    + `normalize` is now `Pandoc -> Pandoc` instead of\n      `Data a :: a -> a`.  Some users may need to change their uses of\n      `normalize` to the newly exported `normalizeInlines` or\n      `normalizeBlocks`.\n\n  * `Text.Pandoc.Options`:\n\n    + Added `writerMediaBag` to `WriterOptions`.\n    + Removed deprecated and no longer used `readerStrict` in\n      `ReaderOptions`.  This is handled by `readerExtensions` now.\n    + Added `Ext_compact_definition_lists`.\n    + Added `Ext_epub_html_exts`.\n    + Added `Ext_native_divs` and `Ext_native_spans`.\n      This allows users to turn off the default pandoc behavior of\n      parsing contents of div and span tags in markdown and HTML\n      as native pandoc Div blocks and Span inlines.\n\n  * `Text.Pandoc.Parsing`:\n\n    + Generalized `readWith` to `readWithM` (Matthew Pickering).\n    + Export `runParserT` and `Stream` (Matthew Pickering).\n    + Added `HasQuoteContext` type class (Matthew Pickering).\n    + Generalized types of `mathInline`, `smartPunctuation`, `quoted`,\n      `singleQuoted`, `doubleQuoted`, `failIfInQuoteContext`,\n      `applyMacros` (Matthew Pickering).\n    + Added custom `token` (Matthew Pickering).\n    + Added `stateInHtmlBlock` to `ParserState`.  This is used to keep\n      track of the ending tag we're waiting for when we're parsing inside\n      HTML block tags.\n    + Added `stateMarkdownAttribute` to `ParserState`. This is used\n      to keep track of whether the markdown attribute has been set in\n      an enclosing tag.\n    + Generalized type of `registerHeader`, using new type classes\n      `HasReaderOptions`, `HasIdentifierList`, `HasHeaderMap` (Matthew\n      Pickering).  These allow certain common functions to be reused\n      even in parsers that use custom state (instead of `ParserState`),\n      such as the MediaWiki reader.\n    + Moved `inlineMath`, `displayMath` from Markdown reader to Parsing,\n      and generalized their types (Matthew Pickering).\n\n  * `Text.Pandoc.Pretty`:\n\n    + Added `nestle`.\n    + Added `blanklines`, which guarantees a certain number of blank lines\n      (and no more).\n\n### Bug fixes\n\n  * Markdown reader:\n\n    + Fixed parsing of indented code in list items.  Indented code\n      at the beginning of a list item must be indented eight spaces\n      from the margin (or edge of the container), or four spaces\n      from the list marker, whichever is greater.\n    + Fixed small bug in HTML parsing with `markdown_attribute`, which\n      caused incorrect tag nesting for input like\n      `<aside markdown=\"1\">*hi*</aside>`.\n    + Fixed regression with intraword underscores (#1121).\n    + Improved parsing of inline links containing quote characters (#1534).\n    + Slight rewrite of `enclosure`/`emphOrStrong` code.\n    + Revamped raw HTML block parsing in markdown (#1330).\n      We no longer include trailing spaces and newlines in the\n      raw blocks.  We look for closing tags for elements (but without\n      backtracking).  Each block-level tag is its own `RawBlock`;\n      we no longer try to consolidate them (though `--normalize` will do so).\n    + Combine consecutive latex environments.  This helps when you have\n      two minipages which can't have blank lines between them (#690, #1196).\n    + Support smallcaps through span.\n      `<span style=\"font-variant:small-caps;\">foo</span>` will be\n      parsed as a `SmallCaps` inline, and will work in all output\n      formats that support small caps (#1360).\n    + Prevent spurious line breaks after list items (#1137).  When the\n      `hard_line_breaks` option was specified, pandoc would formerly\n      produce a spurious line break after a tight list item.\n    + Fixed table parsing bug (#1333).\n    + Handle `c++` and `objective-c` as language identifiers in\n      github-style fenced blocks (#1318).\n    + Inline math must have nonspace before final `$` (#1313).\n\n  * LaTeX reader:\n\n    + Handle comments at the end of tables.  This resolves the issue\n      illustrated in <http://stackoverflow.com/questions/24009489>.\n    + Correctly handle table rows with too few cells.  LaTeX seems to\n      treat them as if they have empty cells at the end  (#241).\n    + Handle leading/trailing spaces in `\\emph` better.\n      `\\emph{ hi }` gets parsed as `[Space, Emph [Str \"hi\"], Space]`\n      so that we don't get things like `* hi *` in markdown output.\n      Also applies to `textbf` and some other constructions (#1146).\n    + Don't assume preamble doesn't contain environments (#1338).\n    + Allow (and discard) optional argument for `\\caption` (James Aspnes).\n\n  * HTML reader:\n\n    + Fixed major parsing problem with HTML tables.  Table cells were\n      being combined into one cell (#1341).\n    + Fixed performance issue with malformed HTML tables.\n      We let a `</table>` tag close an open `<tr>` or `<td>` (#1167).\n    + Allow space between `<col>` and `</col>`.\n    + Added `audio` and `source` in `eitherBlockOrInline`.\n    + Moved `video`, `svg`, `progress`, `script`, `noscript`, `svg` from\n      `blockTags` to `eitherBlockOrInline`.\n    + `map` and `object` were mistakenly in both lists; they have been removed\n      from `blockTags`.\n    + Ignore `DOCTYPE` and `xml` declarations.\n\n  * MediaWiki reader:\n\n    + Don't parse backslash escapes inside `<source>` (#1445).\n    + Tightened up template parsing.\n      The opening `{{` must be followed by an alphanumeric or `:`.\n      This prevents the exponential slowdown in #1033.\n    + Support \"Bild\" for images.\n\n  * DocBook reader:\n\n    + Better handle elements inside code environments.  Pandoc's document\n      model does not allow structure inside code blocks, but at least this way\n      we preserve the text (#1449).\n    + Support `<?asciidoc-br?>` (#1236).\n\n  * Textile reader:\n\n    + Fixed list parsing. Lists can now start without an intervening\n      blank line (#1513).\n    + HTML block-level tags that do not start a line are parsed as\n      inline HTML and do not interrupt paragraphs (as in RedCloth).\n\n  * Org reader:\n\n    + Make tildes create inline code (#1345).  Also relabeled `code` and\n      `verbatim` parsers to accord with the org-mode manual.\n    + Respect `:exports` header argument in code blocks (Craig Bosma).\n    + Fixed tight lists with sublists (#1437).\n\n  * EPUB writer:\n\n    + Avoid excess whitespace in `nav.xhtml`.  This should improve\n      TOC view in iBooks (#1392).\n    + Fixed regression on cover image.\n      In 1.12.4 and 1.12.4.2, the cover image would not appear properly,\n      because the metadata id was not correct.  Now we derive the id from the\n      actual cover image filename, which we preserve rather than using\n      \"cover-image.\"\n    + Keep newlines between block elements.  This allows\n      easier diff-ability (#1424).\n    + Use `stringify` instead of custom `plainify`.\n    + Use `renderTags'` for all tag rendering.  This properly handles tags\n      that should be self-closing.  Previously `<hr/>` would appear in EPUB\n      output as `<hr></hr>` (#1420).\n    + Better handle HTML media tags.\n    + Handle multiple dates with OPF `event` attributes.  Note: in EPUB3 we\n      can have only one dc:date, so only the first one is used.\n\n  * LaTeX writer:\n\n    + Correctly handle figures in notes.  Notes can't contain figures in\n      LaTeX, so we fake it to avoid an error  (#1053).\n    + Fixed strikeout + highlighted code (#1294).\n      Previously strikeout highlighted code caused an error.\n\n  * ConTeXt writer:\n\n    + Improved detection of autolinks with URLs containing escapes.\n\n  * RTF writer:\n\n    + Improved image embedding: `fetchItem'` is now used to get the\n      images, and calculated image sizes are indicated in the RTF.\n    + Avoid extra paragraph tags in metadata (#1421).\n\n  * HTML writer:\n\n    + Deactivate \"incremental\" inside slide speaker notes (#1394).\n    + Don't include empty items in the table of contents for\n      slide shows.  (These would result from creating a slide\n      using a horizontal rule.)\n\n  * MediaWiki writer:\n\n    + Minor renaming of `st` prefixed names.\n\n  * AsciiDoc writer:\n\n    + Double up emphasis and strong emphasis markers in intraword\n      contexts, as required by asciidoc (#1441).\n\n  * Markdown writer:\n\n    + Avoid wrapping that might start a list, blockquote, or header (#1013).\n    + Use Span instead of (hackish) `SmallCaps` in `plainify`.\n    + Don't use braced attributes for fenced code (#1416).\n      If `Ext_fenced_code_attributes` is not set, the first class\n      attribute will be printed after the opening fence as a bare word.\n    + Separate adjacent lists of the same kind with an HTML comment (#1458).\n\n  * PDF writer:\n\n    + Fixed treatment of data uris for images (#1062).\n\n  * Docx writer:\n\n    + Use Compact style for empty table cells (#1353).\n      Otherwise we get overly tall lines when there are empty\n      table cells and the other cells are compact.\n    + Create overrides per-image for `media/` in reference docx.\n      This should be somewhat more robust and cover more types of images.\n    + Improved `entryFromArchive` to avoid an unneeded parse.\n    + Section numbering carries over from reference.docx (#1305).\n    + Simplified `abstractNumId` numbering.  Instead of sequential numbering,\n      we assign numbers based on the list marker styles.\n\n  * `Text.Pandoc.Options`:\n\n    + Removed `Ext_fenced_code_attributes` from `markdown_github`\n      extensions.\n\n  * `Text.Pandoc.ImageSize`:\n\n    + Use default instead of failing if image size not found\n      in exif header (#1358).\n    + ignore unknown exif header tag rather than crashing.\n      Some images seem to have tag type of 256, which was causing\n      a runtime error.\n\n  * `Text.Pandoc.Shared`:\n\n    + `fetchItem`:  unescape URI encoding before reading local file (#1427).\n    + `fetchItem`:  strip a fragment like `?#iefix` from the extension before\n      doing mime lookup, to improve mime type guessing.\n    + Improved logic of `fetchItem`:  absolute URIs are fetched from the net;\n      other things are treated as relative URIs if `sourceURL` is `Just _`,\n      otherwise as file paths on the local file system.\n    + `fetchItem` now properly handles links without a protocol (#1477).\n    + `fetchItem` now escapes characters not allowed in URIs before trying\n      to parse the URIs.\n    + Fixed runtime error with `compactify'DL` on certain lists (#1452).\n\n  * `pandoc.hs`: Don't strip path off of `writerSourceURL`: the path is\n    needed to resolve relative URLs when we fetch resources (#750).\n\n  * `Text.Pandoc.Parsing`\n\n    + Simplified `dash` and `ellipsis` (#1419).\n    + Removed `(>>~)` in favor of the equivalent `(<*)` (Matthew Pickering).\n    + Generalized functions to use `ParsecT` (Matthew Pickering).\n    + Added `isbn` and `pmid` to list of recognized schemes (Matthew\n      Pickering).\n\n### Template changes\n\n  * Added haddock template.\n  * EPUB3:  Added `type` attribute to `link` tags.  They are supposed to\n    be \"advisory\" in HTML5, but kindlegen seems to require them.\n  * EPUB3:  Put title page in section with `epub:type=\"titlepage\"`.\n  * LaTeX: Made `\\subtitle` work properly (#1327).\n  * LaTeX/Beamer: remove conditional around date (#1321).\n  * LaTeX:  Added `lot` and `lof` variables, which can be set to\n    get `\\listoftables` and `\\listoffigures` (#1407).  Note that\n    these variables can be set at the command line with `-Vlot -Vlof`\n    or in YAML metadata.\n\n### Under the hood improvements\n\n  * Rewrote normalize for efficiency (#1385).\n\n  * Rewrote Haddock reader to use `haddock-library` (#1346).\n\n    + This brings pandoc's rendering of haddock markup in line\n      with the new haddock.\n    + Fixed line breaks in `@` code blocks.\n    + alex and happy are no longer build-depends.\n\n  * Added `Text.Pandoc.Compat.Directory` to allow building against\n    different versions of the `directory` library.\n\n  + Added `Text.Pandoc.Compat.Except` to allow building against\n    different versions of `mtl`.\n\n  * Code cleanup in some writers, using Reader monad to avoid\n    passing options parameter around (Matej Kollar).\n\n  * Improved readability in `pandoc.hs`.\n\n  * Miscellaneous code cleanups (Artyom Kazak).\n\n  * Avoid `import Prelude hiding (catch)` (#1309, thanks to Michael\n    Thompson).\n\n  * Changed `http-conduit` flag to `https`.  Depend on `http-client`\n    and `http-client-tls` instead of `http-conduit`.  (Note:  pandoc still\n    depends on `conduit` via `yaml`.)\n\n  * Require `highlighting-kate >= 0.5.8.5` (#1271, #1317, Debian #753299).\n    This change to highlighting-kate means that PHP fragments no longer need\n    to start with `<?php`.  It also fixes a serious bug causing failures with\n    ocaml and fsharp.\n\n  * Require latest `texmath`.  This fixes `\\tilde{E}` and allows\n    `\\left` to be used with `]`, `)` etc. (#1319), among many other\n    improvements.\n\n  * Require latest `zip-archive`.  This has fixes for unicode path names.\n\n  * Added tests for plain writer.\n\n  * `Text.Pandoc.Templates`:\n\n    + Fail informatively on template syntax errors.\n      With the move from parsec to attoparsec, we lost good error\n      reporting.  In fact, since we weren't testing for end of input,\n      malformed templates would fail silently.  Here we revert back to\n      Parsec for better error messages.\n    + Use `ordNub` (#1022).\n\n  * Benchmarks:\n\n    + Made benchmarks compile again (Artyom Kazak).\n    + Fixed so that the failure of one benchmark does not prevent others\n      from running (Artyom Kazak).\n    + Use `nfIO` instead of the `getLength` trick to force full evaluation.\n    + Changed benchmark to use only the test suite, so that benchmarks\n      run more quickly.\n\n  * Windows build script:\n\n    + Add `-windows` to file name.\n    + Use one install command for pandoc, pandoc-citeproc.\n    + Force install of pandoc-citeproc.\n\n  * `make_osx_package`:  Call zip file `pandoc-VERSION-osx.zip`.\n    The zip should not be named `SOMETHING.pkg.zip`, or OSX finder\n    will extract it into a folder named `SOMETHING.pkg`, which it\n    will interpret as a defective package (#1308).\n\n  * `README`:\n\n    + Made headers for all extensions so they have IDs and can be\n      linked to (Beni Cherniavsky-Paskin).\n    + Fixed typos (Phillip Alday).\n    + Fixed documentation of attributes (#1315).\n    + Clarified documentation on small caps (#1360).\n    + Better documentation for `fenced_code_attributes` extension\n      (Caleb McDaniel).\n    + Documented fact that you can put YAML metadata in a separate file\n      (#1412).\n\n\n## pandoc 1.12.4.2 (2014-05-14)\n\n  * Require highlighting-kate >= 0.5.8.  Fixes a performance regression.\n\n  * Shared:  `addMetaValue` now behaves slightly differently:\n    if both the new and old values are lists, it concatenates their\n    contents to form a new list.\n\n  * LaTeX reader:\n\n    + Set `bibliography` in metadata from `\\bibliography` or\n      `\\addbibresource` command.\n    + Don't error on `%foo` with no trailing newline.\n\n  * Org reader:\n\n    + Support code block headers (`#+BEGIN_SRC ...`) (Albert Krewinkel).\n    + Fix parsing of blank lines within blocks (Albert Krewinkel).\n    + Support pandoc citation extension (Albert Krewinkel).  This can\n      be turned off by specifying `org-citation` as the input format.\n\n  * Markdown reader:\n\n    + `citeKey` moved to `Text.Pandoc.Parsing` so it can be used by\n      other readers (Albert Krewinkel).\n\n  * `Text.Pandoc.Parsing`:\n\n    + Added `citeKey` (see above).\n    + Added `HasLastStrPosition` type class and `updateLastStrPos`\n      and `notAfterString` functions.\n\n  * Updated copyright notices (Albert Krewinkel).\n\n  * Added default.icml to data files so it installs with the package.\n\n  * OSX package:\n\n    + The binary is now built with options to ensure that it can be\n      used with OSX 10.6+.\n    + Moved OSX package materials to osx directory.\n    + Added OSX package uninstall script, included in the zip container\n      (thanks to Daniel T. Staal).\n\n## pandoc 1.12.4 (2014-05-07)\n\n  * Made it possible to run filters that aren't executable\n    (#1096). Pandoc first tries to find the executable (searching\n    the path if path isn't given). If it fails, but the file\n    exists and has a `.py`, `.pl`, `.rb`, `.hs`, or `.php`\n    extension, pandoc runs the filter using the appropriate\n    interpreter. This should make it easier to use filters on\n    Windows, and make it more convenient for everyone.\n\n  * Added Emacs org-mode reader (Albert Krewinkel).\n\n  * Added InDesign ICML Writer (mb21).\n\n  * MediaWiki reader:\n\n    + Accept image links in more languages (Jaime Marquínez Ferrándiz).\n    + Fixed bug in certain nested lists (#1213).  If a level 2 list was\n      followed by a level 1 list, the first item of the level 1 list\n      would be lost.\n    + Handle table rows containing just an HTML comment (#1230).\n\n  * LaTeX reader:\n\n    + Give better location information on errors, pointing to line\n      numbers within included files (#1274).\n    + LaTeX reader:  Better handling of `table` environment (#1204).\n      Positioning options no longer rendered verbatim.\n    + Better handling of figure and table with caption (#1204).\n    + Handle `@{}` and `p{length}` in tabular.  The length is not actually\n      recorded, but at least we get a table (#1180).\n    + Properly handle `\\nocite`.  It now adds a `nocite` metadata\n      field.  Citations there will appear in the bibliography but not\n      in the text (unless you explicitly put a `$nocite$` variable\n      in your template).\n\n  * Markdown reader:\n\n    + Ensure that whole numbers in YAML metadata are rendered without\n      decimal points.  (This became necessary with changes to aeson\n      and yaml libraries.  aeson >= 0.7 and yaml >= 0.8.8.2 are now required.)\n    + Fixed regression on line breaks in strict mode (#1203).\n    + Small efficiency improvements.\n    + Improved parsing of nested `div`s.  Formerly a closing `div` tag\n      would be missed if it came right after other block-level tags.\n    + Avoid backtracking when closing `</div>` not found.\n    + Fixed bug in reference link parsing in `markdown_mmd`.\n    + Fixed a bug in list parsing (#1154).  When reading a raw list\n      item, we now strip off up to 4 spaces.\n    + Fixed parsing of empty reference link definitions (#1186).\n    + Made one-column pipe tables work (#1218).\n\n  * Textile reader:\n\n    + Better support for attributes.  Instead of being ignored, attributes\n      are now parsed and included in Span inlines.  The output will be a bit\n      different from stock textile: e.g. for `*(foo)hi*`, we'll get\n      `<em><span class=\"foo\">hi</span></em>` instead of\n      `<em class=\"foo\">hi</em>`.  But at least the data is not lost.\n    + Improved treatment of HTML spans (%) (#1115).\n    + Improved link parsing.  In particular we now pick up on attributes.\n      Since pandoc links can't have attributes, we enclose the whole link in\n      a span if there are attributes (#1008).\n    + Implemented correct parsing rules for inline markup (#1175, Matthew\n      Pickering).\n    + Use Builder (Matthew Pickering).\n\n  * DocBook reader:\n\n    + Better treatment of `formalpara`.  We now emit the title (if present)\n      as a separate paragraph with boldface text (#1215).\n    + Set metadata `author` not `authors`.\n    + Added recognition of `authorgroup` and `releaseinfo` elements (#1214,\n      Matthew Pickering).\n    + Converted current meta information parsing in DocBook to a more\n      extensible version which is aware of the more recent meta\n      representation (Matthew Pickering).\n\n  * HTML reader:\n\n    + Require tagsoup 0.13.1, to fix a bug with parsing of script tags\n      (#1248).\n    + Treat processing instructions & declarations as block.  Previously\n      these were treated as inline, and included in paragraph tags in HTML\n      or DocBook output, which is generally not what is wanted (#1233).\n    + Updated `closes` with rules from HTML5 spec.\n    + Use Builder (Matthew Pickering, #1162).\n\n  * RST reader:\n\n    + Remove duplicate `http` in PEP links (Albert Krewinkel).\n    + Make rst figures true figures (#1168, CasperVector)\n    + Enhanced Pandoc's support for rST roles (Merijn Verstaaten).\n      rST parser now supports: all built-in rST roles, new role definition,\n      role inheritance, though with some limitations.\n    + Use `author` rather than `authors` in metadata.\n    + Better handling of directives.  We now correctly handle field\n      lists that are indented more than three spaces.  We treat an\n      `aafig` directive as a code block with attributes, so it can be\n      processed in a filter (#1212).\n\n  * LaTeX writer:\n\n    + Mark span contents with label if span has an ID (Albert Krewinkel).\n    + Made `--toc-depth` work well with books in latex/pdf output (#1210).\n    + Handle line breaks in simple table cells (#1217).\n    + Workaround for level 4-5 headers in quotes.  These previously produced\n      invalid LaTeX: `\\paragraph` or `\\subparagraph` in a `quote` environment.\n      This adds an `mbox{}` in these contexts to work around the problem.\n      See <http://tex.stackexchange.com/a/169833/22451> (#1221).\n    + Use `\\/` to avoid en-dash ligature instead of `-{}-` (Vaclav Zeman).\n      This is to fix LuaLaTeX output. The `-{}-` sequence does not avoid the\n      ligature with LuaLaTeX but `\\/` does.\n    + Fixed string escaping in `hyperref` and `hyperdef` (#1130).\n\n  * ConTeXt writer:  Improved autolinks (#1270).\n\n  * DocBook writer:\n\n    + Improve handling of hard line breaks in Docbook writer\n      (Neil Mayhew).  Use a `<literallayout>` for the entire paragraph, not\n      just for the newline character.\n    + Don't let line breaks inside footnotes influence the enclosing\n      paragraph (Neil Mayhew).\n    + Distinguish tight and loose lists in DocBook output, using\n      `spacing=\"compact\"` (Neil Mayhew, #1250).\n\n  * Docx writer:  When needed files are not present in the user's\n    `reference.docx`, fall back on the versions in the `reference.docx`\n    in pandoc's data files. This fixes a bug that occurs when a\n    `reference.docx` saved by LibreOffice is used. (#1185)\n\n  * EPUB writer:\n\n    + Include extension in epub ids.  This fixes a problem with duplicate\n      extensions for fonts and images with the same base name but different\n      extensions (#1254).\n    + Handle files linked in raw `img` tags (#1170).\n    + Handle media in `audio` source tags (#1170).\n      Note that we now use a `media` directory rather than `images`.\n    + Incorporate files linked in `video` tags (#1170).  `src` and `poster`\n      will both be incorporated into `content.opf` and the epub container.\n\n  * HTML writer:\n\n    + Add colgroup around col tags (#877).  Also affects EPUB writer.\n    + Fixed bug with unnumbered section headings.  Unnumbered section\n      headings (with class `unnumbered`) were getting numbers.\n    + Improved detection of image links. Previously image links with\n      queries were not recognized, causing `<embed>` to be used instead\n      of `<img>`.\n\n  * Man writer:  Ensure that terms in definition lists aren't line wrapped\n    (#1195).\n\n  * Markdown writer:\n\n    + Use proper escapes to avoid unwanted lists (#980).  Previously we used\n      0-width spaces, an ugly hack.\n    + Use longer backtick fences if needed (#1206).  If the content contains a\n      backtick fence and there are attributes, make sure longer fences are\n      used to delimit the code.  Note:  This works well in pandoc, but github\n      markdown is more limited, and will interpret the first string of three\n      or more backticks as ending the code block.\n\n  * RST writer:  Avoid stack overflow with certain tables (#1197).\n\n  * RTF writer:  Fixed table cells containing paragraphs.\n\n  * Custom writer:\n\n    + Correctly handle UTF-8 in custom lua scripts (#1189).\n    + Fix bugs with lua scripts with mixed-case filenames and\n      paths containing `+` or `-` (#1267).  Note that `getWriter`\n      in `Text.Pandoc` no longer returns a custom writer on input\n      `foo.lua`.\n\n  * AsciiDoc writer:  Handle multiblock and empty table cells\n    (#1245, #1246).  Added tests.\n\n  * `Text.Pandoc.Options`: Added `readerTrace` to `ReaderOptions`\n\n  * `Text.Pandoc.Shared`:\n\n    + Added `compactify'DL` (formerly in markdown reader) (Albert Krewinkel).\n    + Fixed bug in `toRomanNumeral`:  numbers ending with '9' would\n      be rendered as Roman numerals ending with 'IXIV' (#1249).  Thanks to\n      Jesse Rosenthal.\n    + `openURL`: set proxy with value of http_proxy env variable (#1211).\n      Note:  proxies with non-root paths are not supported, due to\n      limitations in `http-conduit`.\n\n  * `Text.Pandoc.PDF`:\n\n    + Ensure that temp directories deleted on Windows (#1192).  The PDF is\n      now read as a strict bytestring, ensuring that process ownership will\n      be terminated, so the temp directory can be deleted.\n    + Use `/` as path separators in a few places, even on Windows.\n      This seems to be necessary for texlive (#1151, thanks to Tim Lin).\n    + Use `;` for `TEXINPUTS` separator on Windows (#1151).\n    + Changes to error reporting, to handle non-UTF8 error output.\n\n  * `Text.Pandoc.Templates`:\n\n    + Removed unneeded datatype context (Merijn Verstraaten).\n\n    + YAML objects resolve to \"true\" in conditionals (#1133).\n      Note:  If `address` is a YAML object and you just have `$address$`\n      in your template, the word `true` will appear, which may be\n      unexpected.  (Previously nothing would appear.)\n\n  * `Text.Pandoc.SelfContained`:  Handle `poster` attribute in `video`\n    tags (#1188).\n\n  * `Text.Pandoc.Parsing`:\n\n    + Made `F` an instance of Applicative (#1138).\n    + Added `stateCaption`.\n    + Added `HasMacros`, simplified other typeclasses.\n      Removed `updateHeaderMap`, `setHeaderMap`, `getHeaderMap`,\n      `updateIdentifierList`, `setIdentifierList`, `getIdentifierList`.\n    + Changed the smart punctuation parser to return `Inlines`\n      rather than `Inline` (Matthew Pickering).\n    + Changed `HasReaderOptions`, `HasHeaderMap`, `HasIdentifierList`\n      from typeclasses of monads to typeclasses of states.  This simplifies\n      the instance definitions and provides more flexibility.  Generalized\n      type of `getOption` and added a default definition.  Removed\n      `askReaderOption`.  Added `extractReaderOption`.  Added\n      `extractHeaderMap` and `updateHeaderMap` in `HasHeaderMap`.\n      Gave default definitions for `getHeaderMap`, `putHeaderMap`,\n      `modifyHeaderMap`.  Added `extractIdentifierList` and\n      `updateIdentifierList` in `HasIdentifierList`.  Gave defaults\n      for `getIdentifierList`, `putIdentifierList`, and\n      `modifyIdentifierList`.  The ultimate goal here is to allow different\n      parsers to use their own, tailored parser states (instead of\n      `ParserState`) while still using shared functions.\n\n  * Template changes:\n\n    + LaTeX template: Use `fontenc` package only with `pdflatex` (#1164).\n    + LaTeX template:  Add `linestretch` and `fontfamily` variables.\n    + LaTeX template:  Conditionalize author and date commands.\n    + Beamer template: Consistent styles for figure and table captions\n      (aaronwolen).\n    + LaTeX and beamer template:  Adjust widths correctly for oversized\n      images.  Use `\\setkeys{Gin}{}` to set appropriate defaults for\n      `\\includegraphics` (Yihui Xie, Garrick Aden-Buie).  Load\n      `upquote` only after `fontenc` (Yihui Xie).\n    + Beamer template: Added caption package (#1200).\n    + Beamer template:  changes for better unicode handling (KarolS).\n    + DocBook template:  use `authorgroup` if there are authors.\n    + revealjs template: Move `include-after` to end (certainlyakey).\n    + revealjs template: Fixed PDF print function (#1220, kevinkenan).\n\n  * Bumped version bounds of dependencies.\n\n  * Added a `--trace` command line option, for debugging backtracking\n    bugs.  So far this only works with the markdown reader.\n\n  * MathMLinHTML:  Fixed deprecation warning (#362, gwern, Albert Krewinkel).\n\n  * Updated travis script to test with multiple GHC versions.\n\n  * Force failure of a Travis build if GHC produces warnings (Albert\n    Krewinkel).\n\n  * Add `.editorconfig` (Albert Krewinkel).\n    See <http://editorconfig.org/> for details.\n\n  * Give more useful error message if '-t pdf' is specified (#1155).\n\n  * Added `Cite`, `SmallCaps` to `Arbitrary` instance (#1269).\n\n  * Allow `html4` as a synonym of `html` as a reader (it already works\n    as a writer).\n\n  * README:\n\n    + Added an explanation of how to use YAML metadata to\n      force items to appear in the bibliography without citations in\n      the text (like LaTeX `\\nocite`).\n    + Added note to `--bibtex/--natbib`: not for use in making PDF\n      (#1194, thanks to nahoj).\n    + Added explanatory notes about `--natbib` and `--biblatex`.\n    + Added specification of legal syntax for citation keys.\n    + Fixed variable defaults documentation (Albert Krewinkel).\n\n  * Removed copyright statements for files that have been removed\n    (Albert Krewinkel).\n\n  * Moved some doc files from `data-files` to `extra-source-files` (#1123).\n    They aren't needed at runtime.  We keep README and COPYRIGHT in data\n    to ensure that they'll be available on all systems on which pandoc\n    is installed.\n\n  * Use cabal sandboxes in Windows build script.\n\n## pandoc 1.12.3.3 (2014-02-03)\n\n  * To changes to source; recompiled tarball with latest alex and\n    happy, so they will work with GHC 7.8.\n\n## pandoc 1.12.3.2 (2014-02-03)\n\n  * Bumped version bounds for blaze-html, blaze-markup.\n\n  * ImageSize:  Avoid use of lookAhead, which is not in binary >= 0.6\n    (#1124).\n\n  * Fixed mediawiki ordered list parsing (#1122).\n\n  * HTML reader:  Fixed bug reading inline math with `$$` (#225).\n\n  * Added support for LaTeX style literate Haskell code blocks in rST\n    (Merijn Verstraaten).\n\n## pandoc 1.12.3.1 (2014-01-14)\n\n  * Relaxed version constraint on binary, allowing the use of binary 0.5.\n\n\n## pandoc 1.12.3 (2014-01-10)\n\n  * The `--bibliography` option now sets the `biblio-files` variable.\n    So, if you're using `--natbib` or `--biblatex`, you can just use\n    `--bibliography=foo.bib` instead of `-V bibliofiles=foo`.\n\n  * Don't run pandoc-citeproc filter if `--bibliography` is\n    used together with `--natbib` or `--biblatex` (Florian Eitel).\n\n  * Template changes:\n\n    + Updated beamer template to include booktabs.\n    + Added `abstract` variable to LaTeX template.\n    + Put `header-includes` after `title` in LaTeX template (#908).\n    + Allow use of `\\includegraphics[size]` in beamer.\n      This just required porting a macro definition from the default\n      LaTeX template to the default beamer template.\n\n  * `reference.docx`:  Include `FootnoteText` style.\n    Otherwise Word ignores the style, even when specified in the `pPr`.\n    (#901)\n\n  * `reference.odt`:  Tidied `styles.xml`.\n\n  * Relaxed version bounds for dependencies.\n\n  * Added `withSocketsDo` around http conduit code in `openURL`,\n    so it works on Windows (#1080).\n\n  * Added `Cite` function to `sample.lua`.\n\n  * Markdown reader:\n\n    + Fixed regression in title blocks (#1089).\n      If author field was empty, date was being ignored.\n    + Allow backslash-newline hard line breaks in grid and\n      multiline table cells.\n    + Citation keys may now start with underscores, and may contain\n      underscores adjacent to internal punctuation.\n\n  * LaTeX reader:\n\n    + Add support for `Verb` macro (jrnold) (#1090).\n    + Support babel-style quoting: `` \"`...\"' ``.\n\n  * Properly handle script blocks in strict mode.  (That is,\n    `markdown-markdown_in_html_blocks`.) Previously a spurious\n    `<p>` tag was being added (#1093).\n\n  * Docbook reader: Avoid failure if `tbody` contains no `tr` or `row`\n    elements.\n\n  * LaTeX writer:\n\n    + Factored out function for table cell creation.\n    + Better treatment of footnotes in tables.\n      Notes now appear in the regular sequence, rather than in the\n      table cell.  (This was a regression in 1.10.)\n\n  * HTML reader: Parse name/content pairs from meta tags as metadata.\n    Closes #1106.\n\n  * Moved `fixDisplayMath` from Docx writer to `Writer.Shared`.\n\n  * OpenDocument writer:  Fixed `RawInline`, `RawBlock` so they don't escape.\n\n  * ODT writer:  Use mathml for proper rendering of formulas.\n    Note:  LibreOffice's support for this seems a bit buggy.  But\n    it should be better than what we had before.\n\n  * RST writer: Ensure no blank line after def in definition list (#992).\n\n  * Markdown writer: Don't use tilde code blocks with braced attributes in\n    `markdown_github` output.  A consequence of this change is that the\n    backtick form will be preferred in general if both are enabled.  That\n    is good, as it is much more widespread than the tilde form.  (#1084)\n\n  * Docx writer:  Fixed problem with some modified reference docx files.\n    Include `word/_rels/settings.xml.rels` if it exists, as well as other\n    `rels` files besides the ones pandoc generates explicitly.\n\n  * HTML writer:\n\n    + With `--toc`, headers no longer link to themselves (#1081).\n    + Omit footnotes from TOC entries.  Otherwise we get doubled\n      footnotes when headers have notes!\n\n  * EPUB writer:\n\n    + Avoid duplicate notes when headings contain notes.\n      This arose because the headings are copied into the metadata\n      \"title\" field, and the note gets rendered twice.  We strip the\n      note now before putting the heading in \"title\".\n    + Strip out footnotes from toc entries.\n    + Fixed bug with `--epub-stylesheet`.  Now the contents of\n      `writerEpubStylesheet` (set by `--epub-stylesheet`)\n      should again work, and take precedence over a stylesheet specified\n      in the metadata.\n\n  * `Text.Pandoc.Pretty`:  Added `nestle`.  API change.\n\n  * `Text.Pandoc.MIME`: Added `wmf`, `emf`.\n\n  * `Text.Pandoc.Shared`:  `fetchItem` now handles image URLs beginning\n    with `//`.\n\n  * `Text.Pandoc.ImageSize`:  Parse EXIF format JPEGs.  Previously\n    we could only get size information for JFIF format, which led\n    to squished images in Word documents. Closes #976.\n\n  * Removed old `MarkdownTest_1.0.3` directory (#1104).\n\n\n## pandoc 1.12.2.1 (2013-12-08)\n\n  * Markdown reader:  Fixed regression in list parser, involving\n    continuation lines containing raw HTML (or even verbatim raw HTML).\n\n## pandoc 1.12.2 (2013-12-07)\n\n  * Metadata may now be included in YAML blocks in a markdown document.\n    For example,\n\n        ---\n        title:\n        - type: main\n          text: My Book\n        - type: subtitle\n          text: An investigation of metadata\n        creator:\n        - role: author\n          text: John Smith\n        - role: editor\n          text: Sarah Jones\n        identifier:\n        - scheme: DOI\n          text: doi:10.234234.234/33\n        publisher:  My Press\n        rights:  (c) 2007 John Smith, CC BY-NC\n        cover-image: img/mypic.jpg\n        stylesheet: style.css\n        ...\n\n    Metadata may still be provided using `--epub-metadata`; it will\n    be merged with the metadata in YAML blocks.\n\n  * EPUB writer:\n\n    + `meta` tags are now used instead of `opf` attributes for EPUB3.\n    + Insert \"svg\" property as needed in opf (EPUB 3).\n    + Simplify `imageTypeOf` using `getMimeType`.\n    + Add properties attribute to `cover-image` item for EPUB 3.\n    + Don't include node for `cover.xhtml` if no cover!\n    + Ensure that same identifier is used throughout (#1044).\n      If an identifier is given in metadata, we use that; otherwise\n      we generate a random uuid.\n    + Add cover reference to guide element (EPUB 2) (Shaun Attfield).\n      Fixes an issue with Calibre putting the cover at the end of the book\n      if the spine has `linear=\"no\"`.  Apparently this is best practice\n      for other converters as well:\n      <http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6>.\n    + Allow `stylesheet` in metadata.  The value is a path to the stylesheet.\n    + Allow partial dates:  `YYYY`, `YYYY-MM`.\n\n  * Markdown writer:  Fix rendering of tight sublists (#1050).\n    Previously a spurious blank line was included after a tight sublist.\n\n  * ODT writer:  Add `draw:name` attribute to `draw:frame` elements (#1069).\n    This is reported to be necessary to avoid an error from recent\n    versions of Libre Office when files contain more than one image\n    Thanks to wmanley for reporting and diagnosing the problem.\n\n  * ConTeXt writer:  Don't hardcode figure/table placement and numbering.\n    Instead, let this be set in the template, using `\\setupfloat`.\n    Thanks to on4aa and Aditya Mahajan for the suggestion (#1067).\n\n  * Implemented CSL flipflopping spans in DOCX, LaTeX, and HTML writers.\n\n  * Fixed bug with markdown intraword emphasis.  Closes #1066.\n\n  * Docbook writer:  Hierarchicalize block content in metadata.\n    Previously headers just disappeared from block-level metadata\n    when it was used in templates.  Now we apply the 'hierarchicalize'\n    transformation.  Note that a block headed by a level-2 header will\n    turn into a `<sect1>` element.\n\n  * OpenDocument writer:  Skip raw HTML (#1035).\n    Previously it was erroneously included as verbatim text.\n\n  * HTML/EPUB writer, footnotes:  Put `<sup>` tag inside `<a>` tags.\n    This allows better control of formatting, since the `<a>`\n    tags have a distinguishing class (#1049).\n\n  * Docx writer:\n\n    + Use mime type info returned by fetchItem.\n    + Fixed core metadata (#1046).\n      Don't create empty date nodes if no date given.\n      Don't create multiple `dc:creator` nodes; instead separate by\n      semicolons.\n    + Fix URL for core-properties in `_rels/.rels` (#1046).\n\n  * Plain writer: don't print `<span>` tags.\n\n  * LaTeX writer:\n\n    + Fix definition lists with internal links in terms (#1032).\n      This fix puts braces around a term that contains an internal\n      link, to avoid problems with square brackets.\n    + Properly escape pdftitle, pdfauthor (#1059).\n    + Use booktabs package for tables (thanks to Jose Luis Duran).\n\n  * Updated beamer template.  Now references should work properly\n    (in a slide) when `--biblatex` or `--natbib` is used.\n\n  * LaTeX reader:\n\n    + Parse contents of curly quotes or matched `\"` as quotes.\n    + Support `\\textnormal` as span with class `nodecor`.\n      This is needed for pandoc-citeproc.\n    + Improved citation parsing.  This fixes a run-time error that occurred\n      with `\\citet{}` (empty list of keys).  It also ensures that empty keys\n      don't get produced.\n\n  * MediaWiki reader:  Add automatic header identifiers.\n\n  * HTML reader:\n\n    + Use pandoc `Div` and `Span` for raw `<div>`, `<span>` when\n      `--parse-raw`.\n    + Recognize `svg` tags as block level content (thanks to MinRK).\n    + Parse LaTeX math if appropriate options are set.\n\n  * Markdown reader:\n\n    + Yaml block must start immediately after `---`.  If there's a blank\n      line after `---`, we interpreted it as a horizontal rule.\n    + Correctly handle empty bullet list items.\n    + Stop parsing \"list lines\" when we hit a block tag.\n      This fixes exponential slowdown in certain input, e.g.\n      a series of lists followed by `</div>`.\n\n   * Slides:  Preserve `<div class=\"references\">` in references slide.\n\n  * `Text.Pandoc.Writer.Shared`:\n\n    + Fixed bug in `tagWithAttrs`.  A space was omitted before key-value\n      attributes, leading to invalid HTML.\n    + `normalizeDate`: Allow dates with year only (thanks to Shaun Attfield).\n    + Fixed bug in `openURL` with `data:` URIs.  Previously the base-64\n      encoded bytestring was returned.  We now decode it so it's a proper\n      image!\n\n  * DocBook reader:  Handle numerical attributes starting with decimal.\n    Also use `safeRead` instead of `read`.\n\n  * `Text.Pandoc.Parsing`:\n\n    + Generalized type of `registerHeader`, using new type classes\n      `HasReadeOptions`, `HasIdentifierList`, `HasHeaderMap`.\n      These allow certain common functions to be reused\n      even in parsers that use custom state (instead of `ParserState`),\n      such as the MediaWiki reader.\n    + Moved inlineMath, displayMath from Markdown reader to Parsing.\n      Generalize their types and export them from Parsing.  (API change.)\n\n  * `Text.Pandoc.Readers.TexMath`: Export `readTeXMath'`, which attends\n    to display/inline.  Deprecate `readTeXMath`, and use `readTeXMath'`\n    in all the writers.  Require `texmath >= 0.6.5.2`.\n\n  * `Text.Pandoc.MIME`:\n\n    + Add entry for `jfif`.\n    + In looking up extensions, drop the encoding info.\n      E.g. for 'image/jpg;base64' we should lookup 'image/jpg'.\n\n  * Templates:  Changed how array variables are resolved.  Previously if\n    `foo` is an array (which might be because multiple values were set on\n    the command line), `$foo$` would resolve to the concatenation of the\n    elements of foo.  This is rarely useful behavior.  It has been changed\n    so that the first value is rendered.  Of course, you can still iterate\n    over the values using `$for(foo)$`.  This has the result that you can\n    override earlier settings using `-V` by putting new values later on the\n    command line, which is useful for many purposes.\n\n  * `Text.Pandoc`:  Don't default to `pandocExtensions` for all writers.\n\n  * Allow \"epub2\" as synonym for \"epub\", \"html4\" for \"html\".\n\n  * Don't look for slidy files in data files with `--self-contained`.\n\n  * Allow `https:` command line arguments to be downloaded.\n\n  * Fixed `make_osx_package.sh` so data files embedded in `pandoc-citeproc`.\n\n## pandoc 1.12.1 (2013-10-20)\n\n  * `Text.Pandoc.Definition`:  Changed default JSON serialization format.\n    Instead of `{\"Str\": \"foo\"}`, for example, we now have `{\"t\": \"Str\",\n    \"c\": \"foo\"}`.  This new format is easier to work with outside of Haskell.\n    Incidentally, \"t\" stands for \"tag\", \"c\" for \"contents\".\n\n  * MediaWiki reader: Trim contents of `<math>` tags, to avoid problems\n    when converting to markdown (#1027).\n\n  * LaTeX reader:\n\n    + Ensure that preamble doesn't contribute to the text of\n      the document.\n    + Fixed character escaping in `\\url{}`.  Previously `\\~` wasn't handled\n      properly, among others.\n    + Parse `{groups}` as `Span`.  This is needed for accurate conversion of\n      bibtex titles, since we need to know what was protected from\n      titlecase conversions.\n\n  * LaTeX writer:\n\n    + Specially escape non-ascii characters in labels.\n      Otherwise we can get compile errors and other bugs when\n      compiled with pdflatex (#1007).  Thanks to begemotv2718 for the fix.\n    + Add link anchors for code blocks with identifiers (#1025).\n\n  * Throughout the code, use `isURI` instead of `isAbsoluteURI`.\n    It allows fragments identifiers.\n\n  * Slide formats:\n\n    + A Div element with class \"notes\" is treated as speaker\n      notes.  Currently beamer goes to `\\note{}`, revealjs to\n      `<aside class=\"notes\">`, and the notes are simply suppressed in\n      other formats  (#925).\n    + Fixed `. . .` (pause) on HTML slide formats.  Closes #1029.\n      The old version caused a pause to be inserted before the first\n      material on a slide. This has been fixed.\n    + Removed data files for s5, slideous, slidy.\n      Users of s5 and slideous will have to download the needed\n      files, as has been documented for some time in the README.\n      By default, slidy code will be sought on the web, as before.\n\n  * HTML writer: Insert command to typeset mathjax only in slideous output\n    (#966, #1012).\n\n  * RST writer:  Skip spaces after display math.  Otherwise we get indentation\n    problems, and part of the next paragraph may be rendered as part of the\n    math.\n\n  * OpenDocument writer:  Fix formatting of strikeout code (#995),\n    thanks to wilx.  don't use `font-face-decls` variable.\n\n  * Fixed test suite so it works with cabal sandboxes.\n\n## pandoc 1.12.0.2 (2013-09-20)\n\n  * Removed an unused dependency (`stringable`) from pandoc.cabal.\n    This will help packagers, but users should not need to upgrade.\n\n## pandoc 1.12.0.1 (2013-09-20)\n\n  * Allow `--metadata` to be repeated for the same key to form a list.\n    This also has the effect that `--bibliography` can be repeated,\n    as before.\n\n  * Handle boolean values in `--metadata`.  Note that anything not parseable\n    as a YAML boolean or string is treated as a literal string.\n    You can get a string value with \"yes\", or any of the strings interpretable\n    as booleans, by quoting it:\n\n        -M boolvalue=yes -M stringvalue='\"yes\"'\n\n  * LaTeX writer: Don't print references if `--natbib` or `--biblatex`\n    option used.\n\n  * DOCX writer: Add `settings.xml` to the zip container.  Fixes a bug\n    in which docx files could not be read by some versions of Word\n    and LibreOffice (#990).\n\n  * Fixed a regression involving slide shows with bibliographies.\n    The Div container around references messed up the procedure for carving\n    a document into slides.  So we now remove the surrounding Div in\n    `prepSlides`.\n\n  * More informative error message when a filter is not found in path.\n\n  * Depend on pandoc-types 1.12.1.  This provide `ToJSONFilter`\n    instances for `Data a => a -> [a]` and `Data a => a -> IO [a]`.\n\n  * Don't use unicode_collation in building OSX package:\n    it adds something like 50MB of dependencies to the package.\n\n  * Declare alex and happy as build-tools (#986).\n\n## pandoc 1.12 (2013-09-15)\n\n### New features\n\n  * Much more flexible metadata, including arbitrary fields and structured\n    values.  Metadata can be specified flexibly in pandoc markdown using\n    YAML metadata blocks, which may occur anywhere in the document:\n\n        ---\n        title: Here is my title.\n        abstract: |\n          This is the abstract.\n\n          1. It can contain\n          2. block content\n             and *inline markup*\n\n        tags: [cat, dog, animal]\n        ...\n\n    Metadata fields automatically populate template variables.\n\n  * Added `opml` (OPML) as input and output format.  The `_note` attribute,\n    used in OmniOutliner and supported by multimarkdown, is supported.\n    We treat the contents as markdown blocks under a section header.\n\n  * Added `haddock` (Haddock markup) as input format (David Lazar).\n\n  * Added `revealjs` output format, for reveal.js HTML 5 slide shows.\n    (Thanks to Jamie F. Olson for the initial patch.)\n    Nested vertical stacks are used for hierarchical structure.\n    Results for more than one level of nesting may be odd.\n\n  * Custom writers can now be written in lua.\n\n        pandoc -t data/sample.lua\n\n    will load the script sample.lua and use it as a custom writer.\n    (For a sample, do `pandoc --print-default-data-file sample.lua`.)\n    Note that pandoc embeds a lua interpreter, so lua need not be\n    installed separately.\n\n  * New `--filter/-F` option to make it easier to run \"filters\"\n    (Pandoc AST transformations that operate on JSON serializations).\n    Filters are always passed the name of the output format, so their\n    behavior can be tailored to it.  The repository\n    <https://github.com/jgm/pandocfilters> contains\n    a python module for writing pandoc filters in python, with\n    a number of examples.\n\n  * Added `--metadata/-M` option.\n    This is like `--variable/-V`, but actually adds to metadata, not\n    just variables.\n\n  * Added `--print-default-data-file` option, which allows printing\n    of any of pandoc's data files. (For example,\n    `pandoc --print-default-data-file reference.odt` will print\n    `reference.odt`.)\n\n  * Added syntax for \"pauses\" in slide shows:\n\n        This gives\n\n        . . .\n\n        me pause.\n\n  * New markdown extensions:\n\n    + `ignore_line_breaks`:  causes intra-paragraph line breaks to be ignored,\n      rather than being treated as hard line breaks or spaces.  This is useful\n      for some East Asian languages, where spaces aren't used between words,\n      but text is separated into lines for readability.\n    + `yaml_metadata_block`:  Parse YAML metadata blocks.  (Default.)\n    + `ascii_identifiers`: This will force `auto_identifiers` to use ASCII\n       only. (Default for `markdown_github`.) (#807)\n    + `lists_without_preceding_blankline`:  Allow lists to start without\n      preceding blank space.  (Default for `markdown_github`.) (#972)\n\n### Behavior changes\n\n  * `--toc-level` no longer implies `--toc`.\n    Reason: EPUB users who don't want a visible TOC may still want\n    to set the TOC level for in the book navigation.\n\n  * `--help` now prints in and out formats in alphabetical order, and\n    says something about PDF output (#720).\n\n  * `--self-contained` now returns less verbose output (telling you\n    which URLs it is fetching, but not giving the full header).  In\n    addition, there are better error messages when fetching a URL fails.\n\n  * Citation support is no longer baked in to core pandoc. Users who\n    need citations will need to install and use a separate filter\n    (`--filter pandoc-citeproc`).  This filter will take `bibliography`,\n    `csl`, and `citation-abbreviations` from the metadata, though it\n    may still be specified on the command line as before.\n\n  * A `Cite` element is now created in parsing markdown whether or not\n    there is a matching reference.\n\n  * The `pandoc-citeproc` script will put the bibliography at the\n    end of the document, as before.  However, it will be put inside a `Div`\n    element with class \"references\", allowing users some control\n    over the styling of references.  A final header, if any, will\n    be included in the `Div`.\n\n  * The markdown writer will not print a bibliography if the\n    `citations` extension is enabled.  (If the citations are formatted\n    as markdown citations, it is redundant to have a bibliography,\n    since one will be generated automatically.)\n\n  * Previously we used to store the directory of the first input file,\n    even if it was local, and used this as a base directory for finding\n    images in ODT, EPUB, Docx, and PDF.  This has been confusing to many\n    users.  So we now look for images relative to the current\n    working directory, even if the first file argument is in another\n    directory.   Note that this change may break some existing workflows.\n    If you have been assuming that relative links will be interpreted\n    relative to the directory of the first file argument, you'll need\n    to make that the current directory before running pandoc. (#942)\n\n  * Better error reporting in some readers, due to changes in `readWith`:\n    the line in which the error occurred is printed, with a caret pointing\n    to the column.\n\n  * All slide formats now support incremental slide view for definition lists.\n\n  * Parse `\\(..\\)` and `\\[..\\]` as math in MediaWiki reader.\n    Parse `:<math>...</math>` as display math.  These notations are used with\n    the MathJax MediaWiki extension.\n\n  * All writers: template variables are set automatically from metadata\n    fields.  However, variables specified on the command line with\n    `--variable` will completely shadow metadata fields.\n\n  * If `--variable` is used to set many variables with the same name,\n    a list is created.\n\n  * Man writer:  The `title`, `section`, `header`, and `footer` can now\n    all be set individually in metadata.  The `description` variable has been\n    removed.  Quotes have been added so that spaces are allowed in the\n    title.  If you have a title that begins\n\n        COMMAND(1) footer here | header here\n\n    pandoc will still parse it into a title, section, header, and\n    footer.  But you can also specify these elements explicitly (#885).\n\n  * Markdown reader\n\n    + Added support for YAML metadata blocks, which can come anywhere\n      in the document (not just at the beginning).  A document can contain\n      multiple YAML metadata blocks.\n    + HTML span and div tags are parsed as pandoc Span and Div elements.\n\n  * Markdown writer\n\n    + Allow simple tables to be printed as grid tables,\n      if other table options are disabled.  This means you can do\n      `pandoc -t markdown-pipe_tables-simple_tables-multiline_tables`\n      and all tables will render as grid tables.\n    + Support YAML title block (render fields in alphabetical order\n      to make output predictable).\n\n### API changes\n\n  * `Meta` in `Text.Pandoc.Definition` has been changed to allow\n    structured metadata.  (Note:  existing code that pattern-matches\n    on `Meta` will have to be revised.)  Metadata can now contain\n    indefinitely many fields, with content that can be a string,\n    a Boolean, a list of `Inline` elements, a list of `Block`\n    elements, or a map or list of these.\n\n  * A new generic block container (`Div`) has been added to `Block`,\n    and a generic inline container (`Span`) has been added to `Inline`.\n    These can take attributes.  They will render in HTML, Textile,\n    MediaWiki, Org, RST and Markdown (with `markdown_in_html`\n    extension) as HTML `<div>` and `<span>` elements; in other formats\n    they will simply pass through their contents.  But they can be\n    targeted by scripts.\n\n  * `Format` is now a newtype, not an alias for String.\n    Equality comparisons are case-insensitive.\n\n  * Added `Text.Pandoc.Walk`, which exports hand-written tree-walking\n    functions that are much faster than the SYB functions from\n    `Text.Pandoc.Generic`.  These functions are now used where possible\n    in pandoc's code.  (`Tests.Walk` verifies that `walk` and `query`\n    match the generic traversals `bottomUp` and `queryWith`.)\n\n  * Added `Text.Pandoc.JSON`, which provides `ToJSON` and `FromJSON`\n    instances for the basic pandoc types. They use GHC generics and\n    should be faster than the old JSON serialization using\n    `Data.Aeson.Generic`.\n\n  * Added `Text.Pandoc.Process`, exporting `pipeProcess`.\n    This is a souped-up version of `readProcessWithErrorcode` that\n    uses lazy bytestrings instead of strings and allows setting\n    environment variables.  (Used in `Text.Pandoc.PDF`.)\n\n  * New module `Text.Pandoc.Readers.OPML`.\n\n  * New module `Text.Pandoc.Writers.OPML`.\n\n  * New module `Text.Pandoc.Readers.Haddock` (David Lazar).\n    This is based on Haddock's own lexer/parser.\n\n  * New module `Text.Pandoc.Writers.Custom`.\n\n  * In `Text.Pandoc.Shared`, `openURL` and `fetchItem` now return an\n    Either, for better error handling.\n\n  * Made `stringify` polymorphic in `Text.Pandoc.Shared`.\n\n  * Removed `stripTags` from `Text.Pandoc.XML`.\n\n  * `Text.Pandoc.Templates`:\n\n    + Simplified `Template` type to a newtype.\n    + Removed `Empty`.\n    + Changed type of `renderTemplate`: it now takes a JSON context\n      and a compiled template.\n    + Export `compileTemplate`.\n    + Export `renderTemplate'` that takes a string instead of a compiled\n      template.\n    + Export `varListToJSON`.\n\n  * `Text.Pandoc.PDF` exports `makePDF` instead of `tex2pdf`.\n\n  * `Text.Pandoc`:\n\n    + Made `toJsonFilter` an alias for `toJSONFilter` from `Text.Pandoc.JSON`.\n    + Removed `ToJsonFilter` typeclass.  `ToJSONFilter` from\n      `Text.Pandoc.JSON` should be used instead.  (Compiling against\n      pandoc-types instead of pandoc will also produce smaller executables.)\n    * Removed the deprecated `jsonFilter` function.\n    + Added `readJSON`, `writeJSON` to the API (#817).\n\n  * `Text.Pandoc.Options`:\n\n    + Added `Ext_lists_without_preceding_blankline`,\n      `Ext_ascii_identifiers`, `Ext_ignore_line_breaks`,\n      `Ext_yaml_metadataBlock` to `Extension`.\n    + Changed `writerSourceDirectory` to `writerSourceURL` and changed the\n      type to a `Maybe`.  `writerSourceURL` is set to 'Just url' when the\n      first command-line argument is an absolute URL.  (So, relative links\n      will be resolved in relation to the first page.)  Otherwise, 'Nothing'.\n    + All bibliography-related fields have been removed from\n      `ReaderOptions` and `WriterOptions`: `writerBiblioFiles`,\n      `readerReferences`, `readerCitationStyle`.\n\n  * The `Text.Pandoc.Biblio` module has been removed.  Users of the\n    pandoc library who want citation support will need to use\n    `Text.CSL.Pandoc` from `pandoc-citeproc`.\n\n### Bug fixes\n\n  * In markdown, don't autolink a bare URI that is followed by `</a>`\n    (#937).\n\n  * `Text.Pandoc.Shared`\n\n    + `openURL` now follows redirects (#701), properly handles `data:`\n      URIs, and prints diagnostic output to stderr rather than stdout.\n    + `readDefaultDataFile`: normalize the paths.  This fixes bugs in\n      `--self-contained` on pandoc compiled with `embed_data_files` (#833).\n    + Fixed `readDefaultDataFile` so it works on Windows.\n    + Better error messages for `readDefaultDataFile`.  Instead of\n      listing the last path tried, which can confuse people who are\n      using `--self-contained`, so now we just list the data file name.\n    + URL-escape pipe characters.  Even though these are legal, `Network.URI`\n      doesn't regard them as legal in URLs.  So we escape them first (#535).\n\n  * Mathjax in HTML slide shows:  include explicit \"Typeset\" call.\n    This seems to be needed for some formats (e.g. slideous) and won't\n    hurt in others (#966).\n\n  * `Text.Pandoc.PDF`\n\n    + On Windows, create temdir in working directory, since the system\n      temp directory path may contain tildes, which can cause\n      problems in LaTeX (#777).\n    + Put temporary output directory in `TEXINPUTS` (see #917).\n    + `makePDF` tries to download images that are not found locally,\n      if the first argument is a URL (#917).\n    + If compiling with `pdflatex` yields an encoding error, offer\n      the suggestion to use `--latex-engine=xelatex`.\n\n  * Produce automatic header identifiers in parsing textile, RST,\n    and LaTeX, unless `auto_identifiers` extension is disabled (#967).\n\n  * `Text.Pandoc.SelfContained`:  Strip off fragment, query of relative URL\n     before treating as a filename.  This fixes `--self-contained` when used\n     with CSS files that include web fonts using the method described here:\n      <http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/>\n      (#739).  Handle `src` in `embed`, `audio`, `source`, `input` tags.\n\n  * `Text.Pandoc.Parsing`: `uri` parser no longer treats punctuation before\n    percent-encoding, or a `+` character, as final punctuation.\n\n  * `Text.Pandoc.ImageSize`:  Handle EPS (#903).  This change will make\n    EPS images properly sized on conversion to Word.\n\n  * Slidy:  Use slidy.js rather than slidy.js.gz.\n    Reason:  some browsers have trouble with the gzipped js file,\n    at least on the local file system (#795).\n\n  * Markdown reader\n\n    + Properly handle blank line at beginning of input (#882).\n    + Fixed bug in unmatched reference links.  The input\n      `[*infile*] [*outfile*]` was getting improperly parsed:\n      \"infile\" was emphasized, but \"*outfile*\" was literal (#883).\n    + Allow internal `+` in citation identifiers (#856).\n    + Allow `.` or `)` after `#` in ATX headers if no `fancy_lists`.\n    + Do not generate blank title, author, or date metadata elements.\n      Leave these out entirely if they aren't present.\n    + Allow backtick code blocks not to be preceded by blank line (#975).\n\n  * Textile reader:\n\n    + Correctly handle entities.\n    + Improved handling of `<pre>` blocks (#927). Remove internal HTML tags\n      in code blocks, rather than printing them verbatim. Parse attributes\n      on `<pre>` tag for code blocks.\n\n  * HTML reader: Handle non-simple tables (#893).  Column widths are read from\n    `col` tags if present, otherwise divided equally.\n\n  * LaTeX reader\n\n    + Support alltt environment (#892).\n    + Support `\\textasciitilde`, `\\textasciicircum` (#810).\n    + Treat `\\textsl` as emphasized text reader (#850).\n    + Skip positional options after `\\begin{figure}`.\n    + Support `\\v{}` for hacek (#926).\n    + Don't add spurious \", \" to citation suffixes.\n      This is added when needed in pandoc-citeproc.\n    + Allow spaces in alignment spec in tables, e.g. `{ l r c }`.\n    + Improved support for accented characters (thanks to Scott Morrison).\n    + Parse label after section command and set id (#951).\n\n  * RST reader:\n\n    + Don't insert paragraphs where docutils doesn't.\n      `rst2html` doesn't add `<p>` tags to list items (even when they are\n      separated by blank lines) unless there are multiple paragraphs in the\n      list.  This commit changes the RST reader to conform more closely to\n      what docutils does (#880).\n    + Improved metadata.  Treat initial field list as metadata when\n      standalone specified.  Previously ALL fields \"title\", \"author\",\n      \"date\" in field lists were treated as metadata, even if not at\n      the beginning.  Use `subtitle` metadata field for subtitle.\n    + Fixed 'authors' metadata parsing in reST.  Semicolons separate\n      different authors.\n\n  * MediaWiki reader\n\n    + Allow space before table rows.\n    + Fixed regression for `<ref>URL</ref>`.\n      `<` is no longer allowed in URLs, according to the uri parser\n      in `Text.Pandoc.Parsing`.  Added a test case.\n    + Correctly handle indented preformatted text without preceding\n      or following blank line.\n    + Fixed `|` links inside table cells.  Improved attribute parsing.\n    + Skip attributes on table rows.  Previously we just crashed if\n      rows had attributes, now we ignore them.\n    + Ignore attributes on headers.\n    + Allow `Image:` for images (#971).\n    + Parse an image with caption in a paragraph by itself as a figure.\n\n  * LaTeX writer\n\n    + Don't use ligatures in escaping inline code.\n    + Fixed footnote numbers in LaTeX/PDF tables.  This fixes a bug\n      wherein notes were numbered incorrectly in tables (#827).\n    + Always create labels for sections.  Previously the labels were only\n      created when there were links to the section in the document (#871).\n    + Stop escaping `|` in LaTeX math.\n      This caused problems with array environments (#891).\n    + Change `\\` to `/` in paths.  `/` works even on Windows in LaTeX.\n      `\\` will cause major problems if unescaped.\n    + Write id for code block to label attribute in LaTeX when listings\n      is used (thanks to Florian Eitel).\n    + Scale LaTeX tables so they don't exceed columnwidth.\n    + Avoid problem with footnotes in unnumbered headers (#940).\n\n  * Beamer writer: when creating beamer slides, add `allowframebreaks` option\n      to the slide if it is one of the header classes.  It is recommended\n      that your bibliography slide have this attribute:\n\n        # References {.allowframebreaks}\n\n    This causes multiple slides to be created if necessary, depending\n    on the length of the bibliography.\n\n  * ConTeXt writer: Properly handle tables without captions.  The old output\n    only worked in MkII. This should work in MkIV as well (#837).\n\n  * MediaWiki writer: Use native mediawiki tables instead of HTML (#720).\n\n  * HTML writer:\n\n    + Fixed `--no-highlight` (Alexander Kondratskiy).\n    + Don't convert to lowercase in email obfuscation (#839).\n    + Ensure proper escaping in `<title>` and `<meta>` fields.\n\n  * AsciiDoc writer:\n\n    + Support `--atx-headers` (Max Rydahl Andersen).\n    + Don't print empty identifier blocks `([[]])` on headers (Max\n      Rydahl Andersen).\n\n  * ODT writer:\n\n    + Fixing wrong numbered-list indentation in open document format\n      (Alexander Kondratskiy) (#369).\n    + `reference.odt`: Added pandoc as \"generator\" in `meta.xml`.\n    + Minor changes for ODF 1.2 conformance (#939). We leave the\n      nonconforming `contextual-spacing` attribute, which is provided by\n      LibreOffice itself and seems well supported.\n\n  * Docx writer:\n\n    + Fixed rendering of display math in lists.\n      In 1.11 and 1.11.1, display math in lists rendered as a new list\n      item.  Now it always appears centered, just as outside of lists,\n      and in proper display math style, no matter how far indented the\n      containing list item is (#784).\n    + Use `w:br` with `w:type` `textWrapping` for linebreaks.\n      Previously we used `w:cr` (#873).\n    + Use Compact style for Plain block elements, to\n      differentiate between tight and loose lists (#775).\n    + Ignore most components of `reference.docx`.\n      We take the `word/styles.xml`, `docProps/app.xml`,\n      `word/theme/theme1.xml`, and `word/fontTable.xml` from\n      `reference.docx`, ignoring everything else.  This should help\n      with the corruption problems caused when different versions of\n      Word resave the reference.docx and reorganize things.\n    +  Made `--no-highlight` work properly.\n\n  * EPUB writer\n\n    + Don't add `dc:creator` tags if present in EPUB metadata.\n    + Add `id=\"toc-title\"` to `h1` in `nav.xhtml` (#799).\n    + Don't put blank title page in reading sequence.\n      Set `linear=\"no\"` if no title block.  Addresses #797.\n    + Download webtex images and include as data URLs.\n      This allows you to use `--webtex` in creating EPUBs.\n      Math with `--webtex` is automatically made self-contained.\n    + In `data/epub.css`, removed highlighting styles (which\n      are no longer needed, since styles are added by the HTML\n      writer according to `--highlighting-style`).  Simplified\n      margin fields.\n    + If resource not found, skip it, as in Docx writer (#916).\n\n  * RTF writer:\n\n    + Properly handle characters above the 0000-FFFF range.\n      Uses surrogate pairs.  Thanks to Hiromi Ishii for the patch.\n    + Fixed regression with RTF table of contents.\n    + Only autolink absolute URIs.  This fixes a regression, #830.\n\n  * Markdown writer:\n\n    + Only autolink absolute URIs.  This fixes a regression, #830.\n    + Don't wrap attributes in fenced code blocks.\n    + Write full metadata in MMD style title blocks.\n    + Put multiple authors on separate lines in pandoc titleblock.\n      Also, don't wrap long author entries, as new lines get treated\n      as new authors.\n\n  * `Text.Pandoc.Templates`:\n\n    + Fixed bug retrieving default template for markdown variants.\n    + Templates can now contain \"record lookups\" in variables;\n      for example, `author.institution` will retrieve the `institution`\n      field of the `author` variable.\n    + More consistent behavior of `$for$`.  When `foo` is not a list,\n      `$for(foo)$...$endfor$` should behave like $if(foo)$...$endif$.\n      So if `foo` resolves to \"\", no output should be produced.\n      See pandoc-templates#39.\n\n  * Citation processing improvements (now part of pandoc-citeproc):\n\n    + Fixed `endWithPunct` The new version correctly sees a sentence\n      ending in '.)' as ending with punctuation.  This fixes a bug which\n      led such sentences to receive an extra period at the end: '.).'.\n      Thanks to Steve Petersen for reporting.\n    + Don't interfere with Notes that aren't citation notes.\n      This fixes a bug in which notes not generated from citations were\n      being altered (e.g. first letter capitalized) (#898).\n    + Only capitalize footnote citations when they have a prefix.\n    + Changes in suffix parsing.  A suffix beginning with a digit gets 'p'\n      inserted before it before passing to citeproc-hs, so that bare numbers\n      are treated as page numbers by default.  A suffix not beginning with\n      punctuation has a space added at the beginning (rather than a comma and\n      space, as was done before for not-author-in-text citations).\n      The result is that `\\citep[23]{item1}` in LaTeX will be interpreted\n      properly, with '23' treated as a locator of type 'page'.\n    + Many improvements to citation rendering, due to fixes in citeproc-hs\n      (thanks to Andrea Rossato).\n    + Warnings are issued for undefined citations, which are rendered\n      as `???`.\n    + Fixed hanging behavior when locale files cannot be found.\n\n### Template changes\n\n  * DocBook:  Use DocBook 4.5 doctype.\n\n  * Org: '#+TITLE:' is inserted before the title.\n    Previously the writer did this.\n\n  * LaTeX:  Changes to make mathfont work with xelatex.\n    We need the mathspec library, not just fontspec, for this.\n    We also need to set options for setmathfont (#734).\n\n  * LaTeX: Use `tex-ansi` mapping for `monofont`.\n    This ensures that straight quotes appear as straight, rather than\n    being treated as curly.  See #889.\n\n  * Made `\\includegraphics` more flexible in LaTeX template.\n    Now it can be used with options, if needed.  Thanks to Bernhard Weichel.\n\n  * LaTeX/Beamer: Added `classoption` variable.\n    This is intended for class options like `oneside`; it may\n    be repeated with different options.  (Thanks to Oliver Matthews.)\n\n  * Beamer: Added `fonttheme` variable.  (Thanks to Luis Osa.)\n\n  * LaTeX: Added `biblio-style` variable (#920).\n\n  * DZSlides: title attribute on title section.\n\n  * HTML5: add meta tag to allow scaling by user (Erik Evenson)\n\n### Under-the-hood improvements\n\n  * Markdown reader:Improved strong/emph parsing, using the strategy of\n    <https://github.com/jgm/Markdown>.  The new parsing algorithm requires\n    no backtracking, and no keeping track of nesting levels.  It will give\n    different results in some edge cases, but these should not affect normal\n    uses.\n\n  * Added `Text.Pandoc.Compat.Monoid`.\n    This allows pandoc to compile with `base` < 4.5, where `Data.Monoid`\n    doesn't export `<>`.  Thanks to Dirk Ullirch for the patch.\n\n  * Added `Text.Pandoc.Compat.TagSoupEntity`.\n    This allows pandoc to compile with `tagsoup` 0.13.x.\n    Thanks to Dirk Ullrich for the patch.\n\n  * Most of `Text.Pandoc.Readers.TeXMath` has been moved to the\n    `texmath` module (0.6.4).  (This allows `pandoc-citeproc` to\n    handle simple math in bibliography fields.)\n\n  * Added `Text.Pandoc.Writers.Shared` for shared functions used\n    only in writers.  `metaToJSON` is used in writers to create a\n    JSON object for use in the templates from the pandoc metadata\n    and variables.  `getField`, `setField`, and `defField` are\n    for working with JSON template contexts.\n\n  * Added `Text.Pandoc.Asciify` utility module.\n    This exports functions to create ASCII-only versions of identifiers.\n\n  * `Text.Pandoc.Parsing`\n\n    + Generalized state type on `readWith` (API change).\n    + Specialize readWith to `String` input. (API change).\n    + In `ParserState`, replace `stateTitle`, `stateAuthors`, `stateDate`\n      with `stateMeta` and `stateMeta'`.\n\n  * `Text.Pandoc.UTF8`: use strict bytestrings in reading.  The use of lazy\n     bytestrings seemed to cause problems using pandoc on 64-bit Windows\n     7/8 (#874).\n\n  * Factored out `registerHeader` from markdown reader, added to\n    `Text.Pandoc.Parsing`.\n\n  * Removed `blaze_html_0_5` flag, require `blaze-html` >= 0.5.\n    Reason:  < 0.5 does not provide a monoid instance for Attribute,\n    which is now needed by the HTML writer (#803).\n\n  * Added `http-conduit` flag, which allows fetching https resources.\n    It also brings in a large number of dependencies (`http-conduit`\n    and its dependencies), which is why for now it is an optional flag\n    (#820).\n\n  * Added CONTRIBUTING.md.\n\n  * Improved INSTALL instructions.\n\n  * `make-windows-installer.bat`: Removed explicit paths for executables.\n\n  * `aeson` is now used instead of `json` for JSON.\n\n  * Set default stack size to 16M.  This is needed for some large\n    conversions, esp. if pandoc is compiled with 64-bit ghc.\n\n  * Various small documentation improvements.\n    Thanks to achalddave and drothlis for patches.\n\n  * Removed comment that chokes recent versions of CPP (#933).\n\n  * Removed support for GHC version < 7.2, since pandoc-types now\n    requires at least GHC 7.2 for GHC generics.\n\n\n## pandoc 1.11.1 (2013-03-17)\n\n  * Markdown reader:\n\n    + Fixed regression in which parentheses were lost in link URLs.\n      Added tests.  Closes #786.\n    + Better handling of unmatched double quotes in `--smart` mode.\n      These occur frequently in fiction, since it is customary not to\n      close quotes in dialogue if the speaker does not change between\n      paragraphs.  The unmatched quotes now get turned into literal\n      left double quotes. (No `Quoted` inline is generated, however.)\n      Closes #99 (again).\n\n  * HTML writer: Fixed numbering mismatch between TOC and sections.\n    `--number-offset` now affects TOC numbering as well\n    as section numbering, as it should have all along.  Closes #789.\n\n  * Markdown writer: Reverted 1.11 change that caused citations to be rendered\n    as markdown citations, even if `--bibliography` was specified, unless\n    `citation` extension is disabled.  Now, formatted citations are always\n    printed if `--bibliography` was specified.  If you want to reformat\n    markdown keeping pandoc markdown citations intact, don't use\n    `--bibliography`.  Note that citations parsed from LaTeX documents will\n    be rendered as pandoc markdown citations when `--bibliography` is not\n    specified.\n\n  * ODT writer: Fixed regression leading to corrupt ODTs.\n    This was due to a change in the `Show` instance for\n    `Text.Pandoc.Pretty.Doc`.  Closes #780.\n\n  * Fixed spacing bugs involving code block attributes in\n    RST reader and Markdown writer. Closes #763.\n\n  * Windows package:  Various improvements due to Fyodor Sheremetyev.\n\n    + Automatically set installation path (Program Files or Local App Data).\n    + Set system PATH environment variable when installing for all users.\n    + Pandoc can installed for all users using the following command.\n      `msiexec /i pandoc-1.11.msi ALLUSERS=1`.\n\n  * Bumped QuickCheck version bound.\n\n## pandoc 1.11 (2013-03-09)\n\n  * Added `--number-offset` option.  (See README for description.)\n\n  * Added `--default-image-extension` option.  (See README for description.)\n\n  * `--number-sections` behavior change: headers with class `unnumbered`\n    will not be numbered.\n\n  * `--version` now reports the default data directory.\n\n  * `Text.Pandoc.Parsing` is no longer exposed. (API change.)\n\n  * `Text.Pandoc.Highlighting` is no longer exposed. (API change.)\n\n  * `Text.Pandoc.Shared`:  Changed type of `Element`.  `Sec` now includes\n    a field for `Attr` rather than just `String`.  (API change.)\n\n  * Added `markdown_github` as input format.  This was an accidental\n    omission in 1.10.\n\n  * Added `readerDefaultImageExtension` field to `ReaderOptions`.  (API\n    change.)\n\n  * Added `writerNumberOffset` field in `WriterOptions`. (API change.)\n\n  * Beamer template:\n\n    + Fixed captions with longtable.  Thanks to Joost Kremers.\n    + Provide `\\Oldincludegraphics` as in LaTeX template (Benjamin Bannier).\n\n  * LaTeX template:\n\n    + Load microtype after fonts.  Microtype needs to know\n      what fonts are being used.  Thanks to dfc for the patch.\n    + Set `secnumdepth` to 5 if `--number-sections` specified.\n      This yields behavior equivalent to the other writers, numbering\n      level 4 and 5 headers too.  Closes #753.\n\n  * HTML reader:\n\n    + Handle `<colgroup>` tag.\n    + Preserve all header attributes.\n\n  * LaTeX reader:\n\n    + Parse `\\hrule` as `HorizontalRule`.  Closes #746.\n    + Parse starred variants of `\\section` etc. as headers with\n      attribute `unnumbered`.\n    + Read optional attributes in `lstlisting` and `Verbatim` environments.\n      We convert these to pandoc standard names, e.g. `numberLines`\n      for `numbers=left`, `startFrom=100` from `firstnumber=100`.\n    + Handle language attribute for lstlistings.\n    + Better support for Verbatim and minted environments.  Closes #763.\n\n  * Markdown reader:\n\n    + `-` in an attribute context = `.unnumbered`.  The point of this\n      is to provide a way to specify unnumbered headers in non-English\n      documents.\n    + Fixed bug parsing key/value attributes.  Parsing failed if you\n      had an unquoted attribute immediately before the final '}'.\n    + Make backslash escape work in attributes.\n    + Fix title block parsing.  Now if `mmd_title_blocks` is specified,\n      pandoc will parse a MMD title block if it sees one, even if\n      `pandoc_title_blocks` is enabled.\n    + Refactoring: `litChar` now includes entities, so we don't need\n      to use `fromEntities` e.g. on titles.\n    + Allow spaces around borders in pipe tables.  Closes #772.\n    + Allow all punctuation in angle-bracket autolinks.  Previously\n      things like `----` were disallowed, because the uri parser\n      treated them as trailing punctuation.  Closes #768.\n    + Make `implicit_header_references` work properly when\n      headers are given explicit identifiers.\n    + Check for tables before line blocks.  Otherwise some pipe\n      tables get treated as line blocks.\n    + Allow `&` in emails (for entities).\n    + Properly handle entities in titles and links.  A markdown link\n      `<http://g&ouml;ogle.com>` should be a link to `http://göogle.com`.\n      Closes #723.\n\n  * Textile reader:\n\n    + Handle attributes on headers.\n\n  * LaTeX reader:\n\n    + Add `fig:` as title for images with captions.\n      This is needed for them to be rendered as figures.  Closes #766.\n    + Never emit an empty paragraph.  See #761.\n    + Handle `\\caption` for images in figures.  Closes #766.\n    + Parse `\\section*`, etc. as unnumbered sections.\n\n  * HTML writer:\n\n    + Support header attributes.  The attributes go on\n      the enclosing `section` or `div` tag if `--section-divs` is specified.\n    + Fixed a regression (only now noticed) in html+lhs output.\n      Previously the bird tracks were being omitted.\n\n  * LaTeX writer:\n\n    + Omit lists with no items to avoid LaTeX errors.\n    + Support line numbering with `--listings`.\n      If `numberLines` class is present, we add `numbers=left`;\n      if `startFrom` is present, we add `firstnumber=`. (#763)\n\n  * ConTeXt writer:\n\n    + Removed `\\placecontent`.  This produced a duplicate toc,\n      in conjunction with `\\placelist`.\n    + Use `\\title`, `\\subject` etc. for headers with\n      `unnumbered` class.\n\n  * Textile writer:\n\n    + Support header attributes.\n\n  * Markdown writer:\n\n    + Use grid tables when needed, and if enabled.  Closes #740.\n    + Render citations as pandoc-markdown citations.\n      Previously citations were rendered as citeproc-formatted citations\n      by default.  Now we render them as pandoc citations, e.g. `[@item1]`,\n      unless the `citations` extension is disabled.\n      If you still want formatted citations in your markdown output,\n      use `pandoc -t markdown-citations`.\n\n  * RST writer:\n\n    + Support `:number-lines:` in code blocks.\n\n  * Docx writer:\n\n    + Better treatment of display math.  Display math inside a\n      paragraph is now put in a separate paragraph, so it will render\n      properly (centered and without extra blank lines around it).\n      Partially addresses #742.\n    + Content types and document rels xml files are now created from\n      scratch, rather than being taken over from `reference.docx`.\n      This fixes problems that arise when you edit the `reference.docx`\n      with Word.\n    + We also now encode mime types for each individual image rather\n      than using defaults.  This should allow us to handle a wider\n      range of image types (including PDF).   Closes #414.\n    + Changed style names in `reference docx`.\n      `FootnoteReference` -> `FootnoteRef`, `Hyperlink` -> `Link`.\n      The old names got changed by Word when the `reference.docx` was\n      edited.  Closes #414.\n\n  * EPUB writer:\n\n    + Fix section numbering.  Previously the numbering restarted from 1\n      in each chapter (with `--number-sections`), though the numbers in\n      the table of contents were correct.\n    + Headers with \"unnumbered\" attribute are not numbered.  (Nor do they\n      cause an increment in running numbering.) Section numbers now work\n      properly, even when there is material before the first numbered section.\n    + Include HTML TOC, even in epub2.  The TOC is included in `<spine>`,\n      but `linear` is set to `no` unless the `--toc` option is specified.\n      Include `<guide>` element in OPF.  This should allow the TOC to\n      be usable in Kindles when converted with kindlegen. Closes #773.\n\n  * `Text.Pandoc.Parsing`: Optimized `oneOfStringsCI`.\n    This dramatically reduces the speed penalty that comes from enabling the\n    `autolink_bare_uris` extension.  The penalty is still substantial (in one\n    test, from 0.33s to 0.44s), but nowhere near what it used to be.\n    The RST reader is also much faster now, as it autodetects URIs.\n\n  * `Text.Pandoc.Shared`:  `hierarchicalize` will not number section\n    with class \"unnumbered\".  Unnumbered sections get `[]` for their\n    section number.\n\n  * `Text.Pandoc.Pretty`:\n\n    + Fixed `chomp` so it works inside `Prefixed` elements.\n    + Changed `Show` instance so it is better for debugging.\n\n  * `Text.Pandoc.ImageSize`:  Added `Pdf` to `ImageType`.\n\n  * `Text.Pandoc.UTF8`:  Strip off BOM if present.  Closes #743.\n\n  * Windows installer improvements:\n\n    + The installer is now signed with a certificate (thanks to\n      Fyodor Sheremetyev).\n    + WiX is used instead of InnoSetup.  The installer is now a\n      standard msi file.\n    + The version number is now auto-detected, and need not be\n      updated separately.\n\n  * OSX installer improvements:\n\n    + The package and pandoc executable are now signed with a\n      certificate (thanks to Fyodor Sheremetyev).\n    + RTF version of license is used.\n    + Use full path for sysctl in `InstallationCheck` script (jonahbull).\n      Closes #580.\n\n  * Converted COPYING to markdown.\n\n  * pandoc.cabal:  Require latest versions of highlighting-kate,\n    texmath, citeproc-hs, zip-archive.\n\n## pandoc 1.10.1 (2013-01-23)\n\n  * Markdown reader:  various optimizations, leading to a\n    significant performance boost.\n\n  * RST reader:  Allow anonymous form of inline links:\n    `` `hello <url>`__ `` Closes #724.\n\n  * Mediawiki reader: Don't require newlines after tables.\n    Thanks to jrunningen for the patch. Closes #733.\n\n  * Fixed LaTeX macro parsing.  Now LaTeX macro definitions are preserved\n    when output is LaTeX, and applied when it is another format.\n    Partially addresses #730.\n\n  * Markdown and RST readers:  Added parser to `block` that skips blank\n    lines.  This fixes a subtle regression involving grid tables with\n    empty cells.  Also added test for grid table with empty cells.\n    Closes #732.\n\n  * RST writer:  Use `.. code:: language` for code blocks with language.\n    Closes #721.\n\n  * DocBook writer:  Fixed output for hard line breaks, adding a newline\n    between `<literallayout>` tags.\n\n  * Markdown writer:  Use an autolink when link text matches url.\n    Previously we also checked for a null title, but this\n    test fails for links produced by citeproc-hs in bibliographies.\n    So, if the link has a title, it will be lost on conversion\n    to an autolink, but that seems okay.\n\n  * Markdown writer:  Set title, author, date variables as before.\n    These are no longer used in the default template, since we use\n    titleblock, but we set them anyway for those who use custom templates.\n\n  * LaTeX writer:  Avoid extra space at start/end of table cell.\n    Thanks to Nick Bart for the suggestion of using @{}.\n\n  * `Text.Pandoc.Parsing`:\n\n    + More efficient version of `anyLine`.\n    + Type of `macro` has changed; the parser now returns `Blocks`\n      instead of `Block`.\n\n  * Relaxed old-time version bound, allowing 1.0.*.\n\n  * Removed obsolete `hsmarkdown` script.  Those who need `hsmarkdown`\n    should create a symlink as described in the README.\n\n## pandoc 1.10.0.5 (2013-01-23)\n\n  * Markdown reader: Try `lhsCodeBlock` before `rawTeXBlock`.  Otherwise\n    `\\begin{code}...\\end{code}` isn't handled properly in markdown+lhs.\n    Thanks to Daniel Miot for noticing the bug and suggesting the fix.\n\n  * Markdown reader: Fixed bug with headerless grid tables.\n    The 1.10 code assumed that each table header cell contains exactly one\n    block. That failed for headerless tables (0) and also for tables with\n    multiple blocks in a header cell.  The code is fixed and tests provided.\n    Thanks to Andrew Lee for pointing out the bug.\n\n  * Markdown reader: Fixed regressions in fenced code blocks. Closes #722.\n\n    + Tilde code fences can again take a bare language string\n      (`~~~ haskell`), not just curly-bracketed attributes\n      (`~~~ {.haskell}`).\n    + Backtick code blocks can take the curly-bracketed attributes.\n    + Backtick code blocks don't *require* a language.\n    + Consolidated code for the two kinds of fenced code blocks.\n\n  * LaTeX template: Use `\\urlstyle{same}` to avoid monospace URLs.\n\n  * Markdown writer: Use proportional font for email autolinks with\n    obfuscation.  Closes #714.\n\n  * Corrected name of `blank_before_blockquote` in README.  Closes #718.\n\n  * `Text.Pandoc.Shared`: Fixed bug in `uri` parser.\n    The bug prevented an autolink at the end of a string (e.g.\n    at the end of a line block line) from counting as a link.  Closes #711.\n\n  * Use the `hsb2hs` preprocessor instead of TH for embed_data_files.\n    This should work on Windows, unlike the TH solution with\n    file-embed.\n\n  * Eliminated use of TH in test suite.\n\n  * Added `Text.Pandoc.Data` (non-exported) to hold the association\n    list of embedded data files, if the `embed_data_files` flag is selected.\n    This isolates the code that needs special treatment with file-embed or\n    `hsb2hs`.\n\n  * Changes to `make-windows-installer.bat`.\n\n    + Exit batch file if any of the cabal-dev installs fail.\n    + There's no longer any need to reinstall `highlighting-kate`.\n    + Don't start with a `cabal update`; leave that to the user.\n    + Force reinstall of pandoc.\n\n  * Fixed EPUB writer so it builds with blaze-html 0.4.x. Thanks to\n    Jens Petersen.\n\n## pandoc 1.10.0.4 (2013-01-20)\n\n  * Fixed bug with escaped % in LaTeX reader. Closes #710.\n\n## pandoc 1.10.0.3 (2013-01-20)\n\n  * Added further missing fb2 tests to cabal file.\n\n## pandoc 1.10.0.2 (2013-01-20)\n\n  * Added fb2 tests to cabal file's extra-source-files.\n\n## pandoc 1.10.0.1 (2013-01-20)\n\n  * Bump version bounds on test-framework packages.\n\n## pandoc 1.10 (2013-01-19)\n\n### New features\n\n  * New input formats:  `mediawiki` (MediaWiki markup).\n\n  * New output formats:  `epub3` (EPUB v3 with MathML),\n    `fb2` (FictionBook2 ebooks).\n\n  * New `--toc-depth` option, specifying how many levels of\n    headers to include in a table of contents.\n\n  * New `--epub-chapter-level` option, specifying the header\n    level at which to divide EPUBs into separate files.\n    Note that this normally affects only performance, not the\n    visual presentation of the EPUB in a reader.\n\n  * Removed the `--strict` option.  Instead of using `--strict`,\n    one can now use the format name `markdown_strict` for either input\n    or output.  This gives more fine-grained control that `--strict`\n    did, allowing one to convert from pandoc's markdown to strict\n    markdown or vice versa.\n\n  * It is now possible to enable or disable specific syntax\n    extensions by appending them (with `+` or `-`) to the writer\n    or reader name.  For example,\n\n        pandoc -f markdown-footnotes+hard_line_breaks\n\n    disables footnotes and enables treating newlines as hard\n    line breaks.  The literate Haskell extensions are now implemented\n    this way as well, using either `+lhs` or `+literate_haskell`.\n    For a list of extension names, see the README under\n    \"Pandoc's Markdown.\"\n\n  * The following aliases have been introduced for specific\n    combinations of markdown extensions:  `markdown_phpextra`,\n    `markdown_github`, `markdown_mmd`, `markdown_strict`.  These aliases\n    work just like regular reader and writer names, and can be modified\n    with extension modifiers as described above. (Note that conversion\n    from one markdown dialect to another does not work perfectly,\n    because there are differences in markdown parsers besides\n    just the extensions, and because pandoc's internal document model is\n    not rich enough to capture all of the extensions.)\n\n  * New `--html-q-tags` option.  The previous default was to use `<q>`\n    tags for smart quotes in HTML5.  But `<q>` tags are also valid HTML4.\n    Moreover, they are not a robust way of typesetting quotes, since\n    some user agents don't support them, and some CSS resets (e.g.\n    bootstrap) prevent pandoc's quotes CSS from working properly.\n    We now just insert literal quote characters by default in both\n    `html` and `html5` output, but this option is provided for\n    those who still want `<q>` tags.\n\n  * The markdown reader now prints warnings (to stderr) about\n    duplicate link and note references.  Closes #375.\n\n  * Markdown syntax extensions:\n\n    + Added pipe tables.  Thanks to François Gannaz for the initial patch.\n      These conform to PHP Markdown Extra's pipe table syntax. A subset\n      of org-mode table syntax is also supported, which means that you can\n      use org-mode's nice table editor to create tables.\n\n    + Added support for RST-style line blocks. These are\n      useful for verse and addresses.\n\n    + Attributes can now be specified for headers, using the same\n      syntax as in code blocks.  (However, currently only the\n      identifier has any effect in most writers.)  For example,\n\n            # My header {#foo}\n\n            See [the header above](#foo).\n\n    + Pandoc will now act as if link references have been defined\n      for all headers without explicit identifiers.\n      So, you can do this:\n\n            # My header\n\n            Link to [My header].\n            Another link to [it][My header].\n\n      Closes #691.\n\n  * LaTeX reader:\n\n    + Command macros now work everywhere, including non-math.\n      Environment macros still not supported.\n    + `\\input` now works, as well as `\\include`.  TEXINPUTS is used.\n      Pandoc looks recursively into included files for more included files.\n\n### Behavior changes\n\n  * The Markdown reader no longer puts the text of autolinks in a\n    `Code` inline.  This means that autolinks will no longer appear\n    in a monospace font.\n\n  * The character `/` can now appear in markdown citation keys.\n\n  * HTML blocks in strict_markdown are no longer required to begin\n    at the left margin.  Technically this is required, according to\n    the markdown syntax document, but `Markdown.pl` and other markdown\n    processors are more liberal.\n\n  * The `-V` option has been changed so that if there are duplicate\n    variables, those specified later on the command line take precedence.\n\n  * Tight lists now work in LaTeX and ConTeXt output.\n\n  * The LaTeX writer no longer relien on the `enumerate` package.\n    Instead, it uses standard LaTeX commands to change the list numbering\n    style.\n\n  * The LaTeX writer now uses `longtable` instead of `ctable`. This allows\n    tables to be split over page boundaries.\n\n  * The RST writer now uses a line block to render paragraphs containing\n    linebreaks (which previously weren't supported at all).\n\n  * The markdown writer now applies the `--id-prefix` to footnote IDs.\n    Closes #614.\n\n  * The plain writer no longer uses backslash-escaped line breaks\n    (which are not very \"plain\").\n\n  * `Text.Pandoc.UTF8`: Better error message for invalid UTF8.\n    Read bytestring and use `Text`'s decodeUtf8 instead of using\n    `System.IO.hGetContents`.  This way you get a message saying\n    \"invalid UTF-8 stream\" instead of \"invalid byte sequence.\"\n    You are also told which byte caused the problem.\n\n  * Docx, ODT, and EPUB writers now download images specified by a URL\n    instead of skipping them or raising an error.\n\n  * EPUB writer:\n\n    + The default CSS now left-aligns headers by default, instead of\n      centering.  This is more consistent with the rest of the writers.\n    + A proper multi-level table of contents is now used in `toc.ncx`.\n      There is no longer a subsidiary table of contents at the beginning\n      of each chapter.\n    + Code highlighting now works by default.\n    + Section divs are used by default for better semantic markup.\n    + The title is used instead of \"Title Page\" in the table of contents.\n      Otherwise we have a hard-coded English string, which looks\n      strange in ebooks written in other languages.  Closes #572.\n\n  * HTML writer:\n\n    + Put mathjax in span with class \"math\".  Closes #562.\n    + Put citations in a span with class \"citation.\" In HTML5, also include\n      a `data-cite` attribute with a space-separated list of citation\n      keys.\n\n  * `Text.Pandoc.UTF8`:  use universalNewlineMode in reading.\n    This treats both `\\r\\n` and `\\n` as `\\n` on input, no matter\n    what platform we're running on.\n\n  * Citation processing is now done in the Markdown and LaTeX\n    readers, not in `pandoc.hs`.  This makes it easier for library users\n    to use citations.\n\n### Template changes\n\n  * HTML: Added css to template to preserve spaces in `<code>` tags.\n    Thanks to Dirk Laurie.\n\n  * Beamer:  Remove English-centric strings in section pages.\n    Section pages used to have \"Section\" and a number as well as the\n    section title. Now they just have the title.  Similarly for part\n    and subsection.  Closes #566.\n\n  * LaTeX, ConTeXt: Added papersize variable.\n\n  * LaTeX, Beamer templates: Use longtable instead of ctable.\n\n  * LaTeX, Beamer templates: Don't require 'float' package for tables.\n    We don't actually seem to use the '[H]' option.\n\n  * Markdown, plain: Fixed titleblock so it is just a single string.\n    Previously separate title, author, and date variables were used,\n    but this didn't allow different kinds of title blocks.\n\n  * EPUB:\n\n    + Rationalized templates.  Previously there were three different\n      templates involved in epub production. There is now just one\n      template, `default.epub` or `default.epub3`. It can now be\n      overridden using `--template`, just like other templates.\n      The titlepage is now folded into the default template.\n      A `titlepage` variable selects it.\n    + UTF-8, lang tag, meta tags, title element.\n\n  * Added scale-to-width feature to beamer template\n\n### API changes\n\n  * `Text.Pandoc.Definition`: Added `Attr` field to `Header`.\n    Previously header identifiers were autogenerated by the writers.\n    Now they are added in the readers (either automatically or explicitly).\n\n  * `Text.Pandoc.Builder`:\n\n    + `Inlines` and `Blocks` are now synonyms for `Many Inline` and\n      `Many Block`.  `Many` is a newtype wrapper around `Seq`, with\n      custom Monoid instances for `Many Inline` and `Many Block.  This\n      allows `Many` to be made an instance of `Foldable` and `Traversable`.\n    + The old `Listable` class has been removed.\n    + The module now exports `isNull`, `toList`, `fromList`.\n    + The old `Read` and `Show` instances have been removed; derived\n      instances are now used.\n    + Added `headerWith`.\n\n  * The readers now take a `ReaderOptions` rather than a `ParserState`\n    as a parameter.  Indeed, not all parsers use the `ParserState` type;\n    some have a custom state.  The motivation for this change was to separate\n    user-specifiable options from the accounting functions of parser state.\n\n  * New module `Text.Pandoc.Options`.  This includes the `WriterOptions`\n    formerly in `Text.Pandoc.Shared`, and its associated\n    data types.  It also includes a new type `ReaderOptions`, which\n    contains many options formerly in `ParserState`, and its associated\n    data types:\n\n    + `ParserState.stateParseRaw` -> `ReaderOptions.readerParseRaw`.\n    + `ParserState.stateColumns` -> `ReaderOptions.readerColumns`.\n    + `ParserState.stateTabStop` -> `ReaderOptions.readerTabStop`.\n    + `ParserState.stateOldDashes` -> `ReaderOptions.readerOldDashes`.\n    + `ParserState.stateLiterateHaskell` -> `ReaderOptions.readerLiterateHaskell`.\n    + `ParserState.stateCitations` -> `ReaderOptions.readerReferences`.\n    + `ParserState.stateApplyMacros` -> `ReaderOptions.readerApplyMacros`.\n    + `ParserState.stateIndentedCodeClasses` ->\n      `ReaderOptions.readerIndentedCodeClasses`.\n    + Added `ReaderOptions.readerCitationStyle`.\n\n  * `WriterOptions` now includes `writerEpubVersion`, `writerEpubChapterLevel`,\n    `writerEpubStylesheet`, `writerEpubFonts`, `writerReferenceODT`,\n    `writerReferenceDocx`, and `writerTOCDepth`.  `writerEPUBMetadata` has\n    been renamed `writerEpubMetadata` for consistency.\n\n  * Changed signatures of `writeODT`, `writeDocx`, `writeEPUB`, since they no\n    longer stylesheet, fonts, reference files as separate parameters.\n\n  * Removed `writerLiterateHaskell` from `WriterOptions`, and\n    `readerLiterateHaskell` from `ReaderOptions`.  LHS is now handled\n    by an extension (`Ext_literate_haskell`).\n\n  * Removed deprecated `writerXeTeX`.\n\n  * Removed `writerStrict` from `WriterOptions`.  Added `writerExtensions`.\n    Strict is now handled through extensions.\n\n  * `Text.Pandoc.Options` exports `pandocExtensions`, `strictExtensions`,\n    `phpMarkdownExtraExtensions`, `githubMarkdownExtensions`,\n    and `multimarkdownExtensions`, as well as the `Extensions` type.\n\n  * New `Text.Pandoc.Readers.MediaWiki` module, exporting\n    `readMediaWiki`.\n\n  * New `Text.Pandoc.Writers.FB2` module, exporting `writeFB2`\n    (thanks to Sergey Astanin).\n\n  * `Text.Pandoc`:\n\n    + Added `getReader`, `getWriter` to `Text.Pandoc`.\n    + `writers` is now an association list `(String, Writer)`.\n      A `Writer` can be a `PureStringWriter`, an `IOStringWriter`, or\n      an `IOByteStringWriter`.  ALL writers are now in the 'writers'\n      list, including the binary writers and FB2 writer.  This allows\n      code in `pandoc.hs` to be simplified.\n    + Changed type of `readers`, so all readers are in IO.\n      Users who want pure readers can still get them form the reader\n      modules; this just affects the function `getReader` that looks up\n      a reader based on the format name.  The point of this change is to\n      make it possible to print warnings from the parser.\n\n  * `Text.Pandoc.Parsing`:\n\n    + `Text.Parsec` now exports all Parsec functions used in pandoc code.\n      No other module directly imports Parsec.  This will make it easier\n      to change the parsing backend in the future, if we want to.\n    + `Text.Parsec` is used instead of `Text.ParserCombinators.Parsec`.\n    + Export the type synonym `Parser`.\n    + Export `widthsFromIndices`, `NoteTable'`, `KeyTable'`, `Key'`, `toKey'`,\n     `withQuoteContext`, `singleQuoteStart`, `singleQuoteEnd`,\n     `doubleQuoteStart`, `doubleQuoteEnd`, `ellipses`, `apostrophe`,\n     `dash`, `nested`, `F(..)`, `askF`, `asksF`, `runF`, `lineBlockLines`.\n    + `ParserState` is no longer an instance of `Show`.\n    + Added `stateSubstitutions` and `stateWarnings` to `ParserState`.\n    + Generalized type of `withQuoteContext`.\n    + Added `guardEnabled`, `guardDisabled`, `getOption`.\n    + Removed `failIfStrict`.\n    + `lookupKeySrc` and `fromKey` are no longer exported.\n\n  * `Data.Default` instances are now provided for `ReaderOptions`,\n    `WriterOptions`, and `ParserState`.  `Text.Pandoc` re-exports `def`.\n    Now you can use `def` (which is re-exported by `Text.Pandoc`) instead\n    of `defaultWriterOptions` (which is still defined).  Closes #546.\n\n  * `Text.Pandoc.Shared`:\n\n    + Added `safeRead`.\n    + Renamed `removedLeadingTrailingSpace` to `trim`,\n      `removeLeadingSpace` to `triml`, and `removeTrailingSpace` to `trimr`.\n    + Count `\\r` as space in `trim` functions.\n    + Moved `renderTags'` from HTML reader and `Text.Pandoc.SelfContained`\n      to `Shared`.\n    + Removed `failUnlessLHS`.\n    + Export `compactify'`, formerly in Markdown reader.\n    + Export `isTightList`.\n    + Do not export `findDataFile`.\n    + `readDataFile` now returns a strict ByteString.\n    + Export `readDataFileUTF8` which returns a String, like the\n      old `readDataFile`.\n    + Export `fetchItem` and `openURL`.\n\n  * `Text.Pandoc.ImageSize`: Use strict, not lazy bytestrings.\n    Removed `readImageSize`.\n\n  * `Text.Pandoc.UTF8`: Export `encodePath`, `decodePath`,\n     `decodeArg`, `toString`, `fromString`, `toStringLazy`,\n     `fromStringLazy`.\n\n  * `Text.Pandoc.UTF8` is now an exposed module.\n\n  * `Text.Pandoc.Biblio`:\n\n    + csl parameter now a `String` rather than a `FilePath`.\n    + Changed type of `processBiblio`.  It is no longer in the IO monad.\n      It now takes a `Maybe Style` argument rather than parameters for CSL\n      and abbrev filenames.  (`pandoc.hs` now calls the functions to parse\n      the style file and add abbreviations.)\n\n  * Markdown reader now exports `readMarkdownWithWarnings`.\n\n  * `Text.Pandoc.RTF` now exports `writeRTFWithEmbeddedImages` instead of\n    `rtfEmbedImage`.\n\n### Bug fixes\n\n  * Make `--ascii` work properly with `--self-contained`.  Closes #568.\n\n  * Markdown reader:\n\n    + Fixed link parser to avoid exponential slowdowns.  Closes #620.\n      Previously the parser would hang on input like this:\n\n            [[[[[[[[[[[[[[[[[[hi\n\n      We fixed this by making the link parser parser characters\n      between balanced brackets (skipping brackets in inline code spans),\n      then parsing the result as an inline list.  One change is that\n\n            [hi *there]* bud](/url)\n\n      is now no longer parsed as a link.  But in this respect pandoc behaved\n      differently from most other implementations anyway, so that seems okay.\n\n    + Look for raw html/latex blocks before tables.\n      Otherwise the following gets parsed as a table:\n\n            \\begin{code}\n            --------------\n            -- My comment.\n            \\end{code}\n\n      Closes #578.\n\n  * RST reader:\n\n    + Added support for `:target:` on `.. image::` blocks\n      and substitutions.\n    + Field list fixes:\n\n        - Fixed field lists items with body beginning after a new line\n          (Denis Laxalde).\n        - Allow any char but ':' in names of field lists in RST reader\n          (Denis Laxalde).\n        - Don't allow line breaks in field names.\n        - Require whitespace after field list field names.\n        - Don't create empty definition list for metadata field lists.\n          Previously a field list consisting only of metadata fields (author,\n          title, date) would be parsed as an empty DefinitionList, which is\n          not legal in LaTeX and not needed in any format.\n\n    + Don't recognize inline-markup starts inside words.\n      For example, `2*2 = 4*1` should not contain an emphasized\n      section.  Added test case for \"Literal symbols\".  Closes #569.\n    + Allow dashes as separator in simple tables.  Closes #555.\n    + Added support for `container`, `compound`, `epigraph`,\n      `rubric`, `highlights`, `pull-quote`.\n    + Added support for `.. code::`.\n    + Made directive labels case-insensitive.\n    + Removed requirement that directives begin at left margin.\n      This was (correctly) not in earlier releases; docutils doesn't\n      make the requirement.\n    + Added support for `replace::` and `unicode::` substitutions.\n    + Ignore unknown interpreted roles.\n    + Renamed image parser to `subst`, since it now handles all\n      substitution references.\n\n  * Textile reader:\n\n    + Allow newlines before pipes in table.  Closes #654.\n    + Fixed bug with list items containing line breaks.\n      Now pandoc correctly handles hard line breaks inside list items.\n      Previously they broke list parsing.\n    + Implemented comment blocks.\n    + Fixed bug affected words ending in hyphen.\n    + Properly handle links with surrounding brackets.\n      Square brackets need to be used when the link isn't surrounded by\n      spaces or punctuation, or when the URL ending may be ambiguous.\n      Closes #564.\n    + Removed nullBlock.  Better to know about parsing problems than\n      to skip stuff when we get stuck.\n    + Allow ID attributes on headers.\n    + Textile reader:  Avoid parsing dashes as strikeout.\n      Previously the input\n\n            text--\n            text--\n            text--\n            text--\n\n      would be parsed with strikeouts rather than dashes. This fixes\n      the problem by requiring that a strikeout delimiting - not be\n      followed by a -.  Closes #631.\n    + Expanded list of `stringBreakers`.\n      This fixes a bug on input like \"(_hello_)\" which should\n      be a parenthesized emphasized \"hello\".\n      The new list is taken from the PHP source of textile 2.4.\n    + Fixed autolinks.  Previously the textile reader and writer\n      incorrectly implemented RST-style autolinks for URLs and email\n      addresses.  This has been fixed.  Now an autolink is done this way:\n      `\"$\":http://myurl.com`.\n    + Fixed footnotes bug in textile.  This affected notes occurring\n      before punctuation, e.g. `foo[1].`.  Closes #518.\n\n  * LaTeX reader:\n\n    + Better handling of citation commands.\n    + Better handling of `\\noindent`.\n    + Added a 'try' in rawLaTeXBlock, so we can handle `\\begin` without `{`.\n      Closes #622.\n    + Made `rawLaTeXInline` try to parse block commands as well.  This\n      is usually what we want, given how `rawLaTeXInline` is used in\n      the markdown and textile readers.  If a block-level LaTeX command\n      is used in the middle of a paragraph (e.g. `\\subtitle` inside a title),\n      we can treat it as raw inline LaTeX.\n    + Handle `\\slash` command.  Closes #605.\n    + Basic `\\enquote` support.\n    + Fixed parsing of paragraphs beginning with a group.  Closes #606.\n    + Use curly quotes for bare straight quotes.\n    + Support obeylines environment.  Closes #604.\n    + Guard against \"begin\", \"end\" in inlineCommand and\n      blockCommand.\n    + Better error messages for environments.  Now it should tell you that\n      it was looking for \\end{env}, instead of giving \"unknown parse error.\"\n\n  * HTML reader:\n\n    + Added HTML 5 tags to list of block-level tags.\n    + HTML reader: Fixed bug in `htmlBalanced`, which\n      caused hangs in parsing certain markdown input using\n      strict mode.\n    + Parse `<q>` as `Quoted DoubleQuote`.\n    + Handle nested `<q>` tags properly.\n    + Modified `htmlTag` for fewer false positives.\n      A tag must start with `<` followed by `!`,`?`, `/`, or a letter.\n      This makes it more useful in the wikimedia and markdown parsers.\n\n  * DocBook reader: Support title in \"figure\" element.  Closes #650.\n\n  * MediaWiki writer:\n\n    + Remove newline after `<br/>` in translation of `LineBreak`\n      There's no particular need for a newline (other than making the\n      generated MediaWiki source look nice to a human), and in fact\n      sometimes it is incorrect: in particular, inside an enumeration, list\n      items cannot have embedded newline characters. (Brent Yorgey)\n    + Use `<code>` not `<tt>` for Code.\n\n  * Man writer: Escape `-` as `\\-`.\n    Unescaped `-`'s become hyphens, while `\\-`'s are left as ascii minus\n    signs.  That is preferable for use with command-line options.  See\n    <http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html>.  Thanks\n    to Andrea Bolognani for bringing the issue to our attention.\n\n  * RST writer:\n\n    + Improved line block output. Use nonbreaking spaces for\n      initial indent (otherwise lost in HTML and LaTeX).\n      Allow multiple paragraphs in a single line block.\n      Allow soft breaks w continuations in line blocks.\n    + Properly handle images with no alt text.  Closes #678.\n    + Fixed bug with links with duplicate text.  We now (a) use anonymous\n      links for links with inline URLs, and (b) use an inline link instead\n      of a reference link if the reference link would require a label that\n      has already been used for a different link.  Closes #511.\n    + Fixed hyperlinked images. Closes #611. Use `:target:`\n      field when you have a simple linked image.\n    + Don't add `:align: center` to figures.\n\n  * Texinfo writer:  Fixed internal cross-references.\n    Now we insert anchors after each header, and use `@ref` instead of `@uref`\n    for links.  Commas are now escaped as `@comma{}` only when needed;\n    previously all commas were escaped.  (This change is needed, in part,\n    because `@ref` commands must be followed by a real comma or period.) Also\n    insert a blank line in from of `@verbatim` environments.\n\n  * DocBook writer:\n\n    + Made --id-prefix work in DocBook as well as HTML.\n      Closes #607.\n    + Don't include empty captions in figures.  Closes #581.\n\n  * LaTeX writer:\n\n    + Use `\\hspace*` for nonbreaking space after line break,\n      since `~` spaces after a line break are just ignored.\n      Closes #687.\n    + Don't escape `_` in URLs or hyperref identifiers.\n    + Properly escape strings inside `\\url{}`.  Closes #576.\n    + Use `[fragile]` only for slides containing code rendered\n      using listings. Closes #649.\n    + Escape `|` as `\\vert` in LaTeX math.  This avoids a clash with\n      highlighting-kate's macros, which redefine `|` as a short verbatim\n      delimiter.  Thanks to Björn Peemöller for raising this issue.\n    + Use minipage rather than parbox for block containers in tables.\n      This allows verbatim code to be included in grid tables.\n      Closes #663.\n    + Prevent paragraphs containing only linebreaks or spaces.\n\n  * HTML writer:\n\n    + Included `highlighting-css` for code spans, too.\n      Previously it was only included if used in a code block.  Closes #653.\n    + Improved line breaks with `<dd>` tags.  We now put a newline between\n      `</dd>` and `<dd>` when there are multiple definitions.\n    + Changed mathjax cdn url so it doesn't use https.  (This caused\n      problems when used with `--self-contained`.) See #609.\n\n  * EPUB writer:\n\n    + `--number-sections` now works properly.\n    + Don't strip meta and link elements in epub metadata.\n      Patch from aberrancy. Closes #589.\n    + Fixed a couple validation bugs.\n    + Use ch001, ch002, etc. for chapter filenames.  This improves sorting\n      of chapters in some readers, which apparently sort ch2 after ch10.\n      Closes #610.\n\n  * ODT writer: properly set title property (Arlo O'Keeffe).\n\n  * Docx writer:\n\n    + Fixed bug with nested lists.  Previously a list like\n\n            1. one\n                - a\n                - b\n            2. two\n\n      would come out with a bullet instead of \"2.\"\n      Thanks to Russell Allen for reporting the bug.\n    + Use `w:cr` in `w:r` instead of `w:br` for linebreaks.\n      This seems to fix a problem viewing pandoc-generated\n      docx files in LibreOffice.\n    + Use integer ids for bookmarks.  Closes #626.\n    + Added nsid to abstractNum elements.  This helps when merging\n      word documents with numbered or bulleted lists.  Closes #627.\n    + Use separate footnotes.xml for notes.\n      This seems to help LibreOffice convert the file, even though\n      it was valid docx before.  Closes #637.\n    + Use rIdNN identifiers for r:embed in images.\n    + Avoid reading image files again when we've already processed them.\n    + Fixed typo in `referenc.docx` that prevented image captions from\n      working. Thanks to Huashan Chen.\n\n  * `Text.Pandoc.Parsing`:\n\n    + Fixed bug in `withRaw`, which didn't correctly handle the case\n      where nothing is parsed.\n    + Made `emailAddress` parser more correct.  Now it is based on RFC 822,\n      though it still doesn't implement quoted strings in email addresses.\n    + Revised URI parser.  It now allows many more schemes, allows\n      uppercase URIs, and better handles trailing punctuation and\n      trailing slashes in bare URIs.  Added many tests.\n    + Simplified and improved singleQuoteStart.  This makes `'s'`, `'l'`,\n      etc. parse properly.  Formerly we had some English-centric heuristics,\n      but they are no longer needed. Closes #698.\n\n  * `Text.Pandoc.Pretty`:  Added wide punctuation range to `charWidth`.\n    This fixes bug with Chinese commas in markdown and reST tables, and\n    a bug that caused combining characters to be dropped.\n\n  * `Text.Pandoc.MIME`: Added MIME types for .wof and .eot.  Closes #640.\n\n  * `Text.Pandoc.Biblio`:\n\n    + Run `mvPunc` and `deNote` on metadata too.\n      This fixed a bug with notes on titles using footnote styles.\n    + Fixed bug in fetching CSL files from CSL data directory.\n\n  * `pandoc.hs`:  Give correct value to `writerSourceDirectory` when a URL\n    is provided.  It should be the URL up to the path.\n\n  * Fixed/simplified diff output for tests.\n    Biblio: Make sure mvPunc and deNote run on metadata too.\n    This fixed a bug with notes on titles using footnote styles.\n\n### Under the hood improvements\n\n  * We no longer depend on `utf8-string`.  Instead we use functions\n    defined in `Text.Pandoc.UTF8` that use `Data.Text`'s conversions.\n\n  * Use `safeRead` instead of using `reads` directly (various modules).\n\n  * \"Implicit figures\" (images alone in a paragraph) are now handled\n    differently.  The markdown reader gives their titles the prefix `fig:`; the\n    writers look for this before treating the image as a figure.  Though this\n    is a bit of a hack, it has two advantages: (i) implicit figures can be\n    limited to the markdown reader, and (ii) they can be deactivated by turning\n    off the `implicit_figures` extension.\n\n  * `catch` from `Control.Exception` is now used instead of the\n    old Preface `catch`.\n\n  * `Text.Pandoc.Shared`:  Improved algorithm for `normalizeSpaces`\n    and `oneOfStrings` (which is now non-backtracking).\n\n  * `Text.Pandoc.Biblio`: Remove workaround for `toCapital`.\n    Now citeproc-hs is fixed upstream, so this is no longer needed.\n    Closes #531.\n\n  * Textile reader: Improved speed of `hyphenedWords`.\n    This speeds up the textile  reader by about a factor of 4.\n\n  * Use `Text.Pandoc.Builder` in RST reader, for more flexibility,\n    better performance, and automatic normalization.\n\n  * Major rewrite of markdown reader:\n\n    + Use `Text.Pandoc.Builder` instead of lists.  This also\n      means that everything is normalized automatically.\n    + Move to a one-pass parsing strategy, returning values in the reader\n      monad, which are then run (at the end of parsing) against the final\n      parser state.\n\n  * In HTML writer, we now use `toHtml` instead of pre-escaping.\n    We work around the problem that blaze-html unnecessarily escapes `'`\n    by pre-escaping just the `'` characters, instead of the whole string.\n    If blaze-html later stops escaping `'` characters, we can simplify\n    `strToHtml` to `toHtml`.  Closes #629.\n\n  * Moved code for embedding images in RTFs from `pandoc.hs` to the\n    RTF writer (which now exports `writeRTFWithEmbeddedImages`).\n\n  * Moved citation processing from `pandoc.hs` into the readers.\n    This makes things more convenient for library users.\n\n  * The man pages are now built by an executable `make-pandoc-man-pages`,\n    which has its own stanza in the cabal file so that dependencies can be\n    handled by Cabal. Special treatment in `Setup.hs` ensures that this\n    executable never gets installed; it is only used to create the man pages.\n\n  * The cabal file has been modified so that the pandoc library is used\n    in building the pandoc executable.  (This required moving `pandoc.hs`\n    from `src` to `.`.)  This cuts compile time in half.\n\n  * The `executable` and `library` flags have been removed.\n\n  * `-threaded` has been removed from ghc-options.\n\n  * Version bounds of dependencies have been raised, and the\n    `blaze_html_0_5` flag now defaults to True.  Pandoc now compiles on\n    GHC 7.6.\n\n  * We now require base >= 4.2.\n\n  * Integrated the benchmark program into cabal.  One can now do:\n\n        cabal configure --enable-benchmarks && cabal build\n        cabal bench --benchmark-option='markdown' --benchmark-option='-s 20'\n\n    The benchmark now uses README + testsuite, so benchmark results\n    from older versions aren't comparable.\n\n  * Integrated test suite with cabal.\n    To run tests, configure with `--enable-tests`, then `cabal test`.\n    You can specify particular tests using `--test-options='-t markdown'`.\n    No output is shown unless tests fail.  The Haskell test modules\n    have been moved from `src/` to `tests/`.\n\n  * Moved all data files and templates to the `data/` subdirectory.\n\n  * Added an `embed_data_files` cabal flag.  This causes all\n    data files to be embedded in the binary, so that the binary\n    is self-sufficient and can be relocated anywhere, copied on\n    a USB key, etc.  The Windows installer now uses this.\n    (Since we no longer have the option to build the executable\n    without the library, this is the only way to get a relocatable\n    binary on Windows.)\n\n  * Removed pcre3.dll from windows package.\n    It isn't needed unless highlighting-kate is compiled with the\n    `pcre-light` flag. By default, regex-prce-builtin is used.\n\n\n## pandoc 1.9.4.5 (2012-10-21)\n\n  * Raised version bounds on network, base64-bytestring, json,\n    and template-haskell.\n\n## pandoc 1.9.4.4 (2012-10-20)\n\n  * Removed `tests` flag and made test suite into a proper cabal\n    test suite, which can now be enabled using `--enable-tests`\n    and run with `cabal test`.\n\n  * Moved man page creation out of `Setup.hs` and into an\n    executable built by Cabal, but never installed.  This\n    allows dependencies to be specified, and solves a problem\n    with 1.9.4.3, which could only be installed if `data-default`\n    had already been installed.\n\n  * Updated `lhs-latex.tex` test for latest highlighting-kate\n    representation of backticks.\n\n## pandoc 1.9.4.3 (2012-10-20)\n\n  * Removed `-threaded` from default compile flags.\n\n  * Modified modules to compile with GHC 7.6 and latest version of time\n    package.\n\n## pandoc 1.9.4.2 (2012-06-29)\n\n  * Don't encode/decode file paths if base >= 4.4.\n    Prior to base 4.4, filepaths and command line arguments were treated\n    as unencoded lists of bytes, not unicode strings, so we had to work\n    around that by encoding and decoding them. This commit adds CPP\n    checks for the base version that intelligibly enable encoding/decoding\n    when needed. Fixes a bug with multilingual filenames when pandoc was\n    compiled with ghc 7.4 (#540).\n\n  * Don't generate an empty H1 after hrule slide breaks.\n    We now use a slide-level header with contents `[Str \"\\0\"]` to mark\n    an hrule break.  This avoids creation of an empty H1 in these\n    contexts.  Closes #484.\n\n  * Docbook reader: Added support for \"bold\" emphasis.  Thanks to mb21.\n\n  * In make_osx_package.sh, ensure citeproc-hs is built with the\n    embed_data_files flag.\n\n  * MediaWiki writer: Avoid extra blank lines after sublists (Gavin Beatty).\n\n  * ConTeXt writer: Don't escape `&`, `^`, `<`, `>`, `_`,\n    simplified escapes for `}` and `{` to `\\{` and `\\}` (Aditya Mahajan).\n\n  * Fixed handling of absolute URLs in CSS imports with `--self-contained`.\n    Closes #535.\n\n  * Added webm to mime types. Closes #543.\n\n  * Added some missing exports and tests to the cabal file\n    (Alexander V Vershilov).\n\n  * Compile with `-rtsopts` and `-threaded` by default.\n\n## pandoc 1.9.4.1 (2012-06-08)\n\n  * Markdown reader: Added `cf.` and `cp.` to list of likely abbreviations.\n\n  * LaTeX template: Added `linkcolor`, `urlcolor` and `links-as-notes`\n    variables.  Make TOC links black.\n\n  * LaTeX template improvements.\n\n    + Don't print date unless one is given explicitly in the document.\n    + Simplified templates.\n    + Use fontenc [T1] by default, and lmodern.\n    + Use microtype if available.\n\n  * Biblio:\n\n    + Add comma to beginning of bare suffix, e.g. `@item1 [50]`.\n      Motivation: `@item1 [50]` should be as close as possible to\n      `[@item1, 50]`.\n    + Added workaround for a bug in citeproc-hs 0.3.4 that causes footnotes\n      beginning with a citation to be empty.  Closes #531.\n\n  * Fixed documentation on mixed lists.  Closes #533.\n\n## pandoc 1.9.4 (2012-06-03)\n\n  * Simplified `Text.Pandoc.Biblio` and fixed bugs with citations inside\n    footnotes and captions.  We now handle note citations by inserting\n    footnotes during initial citation processing, and doing a separate\n    pass later to remove notes inside notes.\n\n  * Added 'zenburn' highlight style from highlighting-kate.\n\n  * Added Slideous writer. Slideous is an HTML + javascript slide show\n    format, similar to Slidy, but works with IE 7. (Jonas Smedegaard)\n\n  * LaTeX writer:\n\n    + Ensure we don't have extra blank lines at ends of cells.\n      This can cause LaTeX errors, as they are interpreted as new paragraphs.\n    + More consistent interblock spacing.\n    + Require highlighting-kate >= 0.5.1, for proper highlighted inline\n      code in LaTeX.  Closes #527.\n    + Ensure that a Verbatim at the end of a footnote is followed by\n      a newline. (Fixes a regression in the previous version.)\n    + In default template, use black for internal links and TOC.\n      Added commented-out code to use footnotes for links, as would\n      be suitable in print output.\n\n  * Beamer writer:  When `--incremental` is used, lists inside\n    a block quote should appear all at once.  (This makes Beamer\n    output consistent with the HTML slide show formats.)\n\n  * ConTeXt writer:\n\n    + Escape `%` as `\\letterpercent{}` not `\\letterpercent `,\n      to avoid gobbling spaces after the `%` sign.\n    + Ensure space after `\\stopformula`.\n\n  * Markdown writer:\n\n    + Use `:` form instead of `~` in definition lists, for better\n      compatibility with other markdown implementations.\n    + Don't wrap the term, because it breaks definition lists.\n    + Use a nonzero space to prevent false recognition\n      of list marker in ordered lists.  Closes #516.\n\n  * Org writer: Add space before language name.  Closes #523.\n\n  * Docx writer: Simplified bullet characters so they work properly\n    with Word 2007. Closes #520.\n\n  * LaTeX reader: Support `\\centerline`.\n\n  * RST reader:  handle figures.  Closes #522.\n\n  * Textile reader: fix for `<notextile>` and `==`.  Closes #517.\n    (Paul Rivier)\n\n## pandoc 1.9.3 (2012-05-12)\n\n  * Added docbook reader (with contributions from Mauro Bieg).\n\n  * Fixed bug in `fromEntities`.  The previous version would turn\n    `hi & low you know;` into `hi &`.\n\n  * HTML reader:\n\n    + Don't skip nonbreaking spaces.\n      Previously a paragraph containing just `&nbsp;` would be rendered\n      as an empty paragraph. Thanks to Paul Vorbach for pointing out the bug.\n    + Support `<col>` and `<caption>` in tables. Closes #486.\n\n  * Markdown reader:\n\n    + Don't recognize references inside delimited code blocks.\n    + Allow list items to begin with lists.\n\n  * LaTeX reader:\n\n    + Handle `\\bgroup`, `\\egroup`, `\\begingroup`, `\\endgroup`.\n    + Control sequences can't be followed by a letter.\n      This fixes a bug where `\\begingroup` was parsed as `\\begin`\n      followed by `group`.\n    + Parse 'dimension' arguments to unknown commands.  e.g. `\\parindent0pt`\n    + Make `\\label` and `\\ref` sensitive to `--parse-raw`.\n      If `--parse-raw` is selected, these will be parsed as raw latex\n      inlines, rather than bracketed text.\n    + Don't crash on unknown block commands (like `\\vspace{10pt}`)\n      inside `\\author`; just skip them.  Closes #505.\n\n  * Textile reader:\n\n    + Implemented literal escapes with `==` and `<notextile>`.  Closes #473.\n    + Added support for LaTeX blocks and inlines (Paul Rivier).\n    + Better conformance to RedCloth inline parsing (Paul Rivier).\n    + Parse '+text+' as emphasized (should be underlined, but this\n      is better than leaving literal plus characters in the output.\n\n  * Docx writer: Fixed multi-paragraph list items.  Previously they each\n    got a list marker.  Closes #457.\n\n  * LaTeX writer:\n\n    + Added `--no-tex-ligatures` option to avoid replacing\n      quotation marks and dashes with TeX ligatures.\n    + Use `fixltx2e` package to provide `\\textsubscript`.\n    + Improve spacing around LaTeX block environments:\n      quote, verbatim, itemize, description, enumerate.\n      Closes #502.\n    + Use blue instead of pink for URL links in latex/pdf output.\n\n  * ConTeXt writer: Fixed escaping of `%`.\n    In text, `%` needs to be escaped as `\\letterpercent`, not `\\%`\n    Inside URLs, `%` needs to be escaped as `\\%`\n    Thanks to jmarca and adityam for the fix.  Closes #492.\n\n  * Texinfo writer:  Escape special characters in node titles.\n    This fixes a problem pointed out by Joost Kremers.  Pandoc used\n    to escape an '@' in a chapter title, but not in the corresponding\n    node title, leading to invalid texinfo.\n\n  * Fixed document encoding in texinfo template.\n    Resolves Debian Bug #667816.\n\n  * Markdown writer:\n\n    + Don't force delimited code blocks to be flush left.\n      Fixes bug with delimited code blocks inside lists etc.\n    + Escape `<` and `$`.\n\n  * LaTeX writer: Use `\\hyperref[ident]{text}` for internal links.\n    Previously we used `\\href{\\#ident}{text}`, which didn't work on\n    all systems. Thanks to Dirk Laurie.\n\n  * RST writer: Don't wrap link references.  Closes #487.\n\n  * Updated to use latest versions of blaze-html, mtl.\n\n\n## pandoc 1.9.2 (2012-04-05)\n\n  * LaTeX reader:\n\n    + Made `lstlisting` work as a proper verbatim environment.\n    + Fixed bug parsing LaTeX tables with one column.\n\n  * LaTeX writer:\n\n    + Use `{}` around `ctable` caption, so that formatting can be used.\n    + Don't require eurosym package unless document has a €.\n\n  * LaTeX template: Added variables for `geometry`, `romanfont`,\n    `sansfont`, `mathfont`, `mainfont` so users can more easily\n    customize fonts.\n\n  * PDF writer:\n\n    + Run latex engine at least two times, to ensure\n      that PDFs will have hyperlinked bookmarks.\n    + Added PDF metadata (title,author) in LaTeX standalone + PDF output.\n\n  * Texinfo writer: retain directories in image paths.  (Peter Wang)\n\n  * RST writer:  Better handling of inline formatting, in accord\n    with docutils' \"inline markup recognition rules\" (though we don't\n    implement the unicode rules fully). Now `hi*there*hi` gets\n    rendered properly as `hi\\ *there*\\ hi`, and unnecessary\n    `\\ ` are avoided around `:math:`, `:sub:`, `:sup:`.\n\n  * RST reader:\n\n    + Parse `\\ ` as null, not escaped space.\n    + Allow `` :math:`...` `` even when not followed by blank\n      or `\\`.  This does not implement the complex rule docutils follows,\n      but it should be good enough for most purposes.\n    + Add support for the rST default-role directive. (Greg Maslov)\n\n  * Text.Pandoc.Parsing: Added `stateRstDefaultRole` field to `ParserState`.\n    (Greg Maslov)\n\n  * Markdown reader: Properly handle citations nested in other inline\n    elements.\n\n  * Markdown writer:  don't replace empty alt in image with \"image\".\n\n  * DZSlides:  Updated template.html and styles in default template.\n    Removed bizarre CSS for `q` in dzslides template.\n\n  * Avoid repeated `id` attribute in section and header in HTML slides.\n\n  * README improvements:  new instructions on internal links,\n    removed misleading note on reST math.\n\n  * Build system:\n\n    + Fixed Windows installer so that dzslides works.\n    + Removed stripansi.sh.\n    + Added .travis.yml for Travis continuous integration support..\n    + Fixed upper bound for zlib (Sergei Trofimovich).\n    + Fixed upper bound for test-framework.\n    + Updated haddocks for haddock-2.10 (Sergei Trofimovich).\n\n\n## pandoc 1.9.1.2 (2012-03-09)\n\n  * Added `beamer+lhs` as output format.\n\n  * Don't escape `<` in `<style>` tags with `--self-contained`.\n    This fixes a bug which prevented highlighting from working\n    when using `--self-contained`.\n\n  * PDF: run latex engine three times if `--toc` specified.\n    This fixes page numbers in the table of contents.\n\n  * Docx writer: Added TableNormal style to tables.\n\n  * LaTeX math environment fixes. `aligned` is now used instead of\n    the nonexistent `aligned*`. `multline` instead of the nonexistent\n    `multiline`.\n\n  * LaTeX writer: Use `\\textasciitilde` for literal `~`.\n\n  * HTML writer: Don't escape contents of EQ tags with --gladtex.\n    This fixes a regression from 1.8.\n\n  * Use `<q>` tags for Quoted items for HTML5 output.\n    The quote style can be changed by modifying the template\n    or including a css file. A default quote style is included.\n\n  * LaTeX reader: Fixed accents (\\~{a}, `\\c{c}`).\n    Correctly handle \\^{}. Support \"minted\" as a LaTeX verbatim block.\n\n  * Updated LaTeX template for better language support.\n    Use `polyglossia` instead of `babel` with xetex.\n    Set `lang` as documentclass option.\n    `\\setmainlanguage` will use the last of a comma-separated\n    list of languages. Thanks to François Gannaz.\n\n  * Fixed default LaTeX template so `\\euro` and `€` work.  The\n    `eurosym` package is needed if you are using pdflatex.\n\n  * Fixed escaping of period in man writer (thanks to Michael Thompson).\n\n  * Fixed list label positions in beamer.\n\n  * Set `mainlang` variable in context writer.\n    This parallels behavior of latex writer.  `mainlang` is the last\n    of a comma-separated list of languages in lang.\n\n  * EPUB language metadat: convert e.g. `en_US` from locale to `en-US`.\n\n  * Changed `-V` so that you can specify a key without a value.\n    Such keys get the value `true`.\n\n  * Fixed permissions on installed man pages - thanks Magnus Therning.\n\n  * Windows installer: require XP or higher.  The installer is\n    now compiled on a Windows 7 machine, which fixes a problem\n    using citation functions on Windows 7.\n\n  * OSX package: Check for 64-bit Intel CPU before installing.\n\n\n## pandoc 1.9.1.1 (2012-02-11)\n\n  * Better handling of raw latex environments in markdown.  Now\n\n        \\begin{equation}\n        a_1\n        \\end{equation}\n\n    turns into a raw latex block as expected.\n\n  * Improvements to LaTeX reader:\n\n    + Skip options after block commands.\n    + Correctly handle `{\\\\}` in braced.\n    + Added a needed 'try'.\n    + Citations: add `, ` to suffix if it doesn't start with space or\n      punctuation. Otherwise we get no space between the year and the\n      suffix in author-date styles.\n\n  * Added two needed data files for S5.  This fixes a problem with\n    `pandoc -t s5 --self-contained`.  Also removed `slides.min.js`,\n    which was no longer being used.\n\n  * Fixed some minor problems in `reference.docx`:\n    name on \"Date\" style, `xCs` instead of `xIs`.\n\n  * Fixed a problem creating docx files using a reference docx\n    modified using Word.  The problem seems to be that Word\n    modifies `_rels/.rels`, changing the Type of the Relationship to\n    `docProps/core.xml`. Pandoc now changes this back to the correct\n    value if it has been altered, fixing the problem.\n\n  * Fixed html5 template so it works properly with highlighting.\n\n## pandoc 1.9.1 (2012-02-09)\n\n  * LaTeX reader:\n\n    + Fixed regression in 1.9; properly handle escaped $ in latex math.\n    + Put LaTeX verse environments in blockquotes.\n\n  * Markdown reader:\n\n    + Limit nesting of strong/emph.  This avoids exponential lookahead\n      in parasitic cases, like `a**a*a**a*a**a*a**a*a**a*a**a*a**a*a**`.\n    + Improved attributes syntax (in code blocks/spans): (1)\n      Attributes can contain line breaks. (2) Values in key-value\n      attributes can be surrounded by either double or single quotes, or\n      left unquoted if they contain no spaces.\n\n  * Headers no longer wrap in markdown or RST writers.\n\n  * Added `stateMaxNestingLevel` to `ParserState`.\n    We set this to 6, so you can still have `Emph` inside `Emph`,\n    just not indefinitely.\n\n  * More efficient implementation of `nowrap` in `Text.Pandoc.Pretty`.\n\n  * `Text.Pandoc.PDF`:  Only run latex twice if `\\tableofcontents`\n    is present.\n\n  * Require highlighting-kate >= 0.5.0.2, texmath >= 0.6.0.2.\n\n## pandoc 1.9.0.5 (2012-02-06)\n\n  * Changed cabal file so that build-depends for the test program\n    are not required unless the tests flag is used.\n\n  * LaTeX writer:  insert `{}` between adjacent hyphens so they don't\n    form ligatures (dashes) in code spans.\n\n## pandoc 1.9.0.4 (2012-02-06)\n\n  * Raised version bound on test-framework to avoid problems\n    compiling tests on GHC 7.4.1.\n\n  * LaTeX reader: Use raw LaTeX as fallback inline text for Cites,\n    so citations don't just disappear unless you process with\n    citeproc.  Ignore `\\bibliographystyle`, `\\nocite`.\n\n  * Simplified tex2pdf; it will always run latex twice to\n    resolve table of contents and hyperrefs.\n\n## pandoc 1.9.0.3 (2012-02-06)\n\n  * Require Cabal >= 1.10.\n\n  * Tweaked cabal file to meet Cabal 1.10 requirements.\n\n## pandoc 1.9.0.2 (2012-02-05)\n\n  * Allow build with json 0.4 or 0.5.  Otherwise we can't build with\n    ghc 6.12.\n\n## pandoc 1.9 (2012-02-05)\n\n### New features\n\n  * Added a Microsoft Word `docx` writer. The writer includes support\n    for highlighted code and for math (which is converted from TeX to OMML,\n    Office's native math markup language, using texmath's new OMML module).\n    A new option `--reference-docx` allows the user to customize the\n    styles.\n\n  * Added an `asciidoc` writer (<http://www.methods.co.nz/asciidoc/>).\n\n  * Better support for slide shows:\n\n    + Added a `dzslides` writer. DZSlides is a lightweight HTML5/javascript\n      slide show format due to Paul Rouget (<http://paulrouget.com/dzslides/>).\n\n    + Added a LaTeX `beamer` writer. Beamer is a LaTeX package for creating\n      slide presentations.\n\n    + New, flexible rules for dividing documents into sections and slides\n      (see the \"Structuring the slide show\" in the User's Guide).  These\n      are backward-compatible with the old rules, but they allow slide\n      shows to be organized into sections and subsections containing\n      multiple slides.\n\n    + A new `--slide-level` option allows users to override defaults\n      and select a slide level below the first header level with content.\n\n  * A new `--self-contained` option produces HTML output that does not\n    depend on an internet connection or the presence of any external\n    files. Linked images, CSS, and javascript is downloaded (or fetched\n    locally) and encoded in `data:` URIs. This is useful for making portable\n    `HTML slide shows. The --offline` option has been deprecated and is now\n    `treated as a synonym or --self-contained`.\n\n  * Support for PDF output:\n\n    + Removed the old `markdown2pdf`.\n    + `pandoc` can now create PDFs (assuming you have latex and a set of\n      appropriate packages installed): just specify an output file with the\n      `.pdf` extension.\n    + A new option `--latex-engine` allows you to specify `pdflatex`,\n      `xelatex`, or `lualatex` as the processor.\n\n  * Highlighting changes:\n\n    + Syntax highlighting is now a standard feature; the `highlighting`\n      flag is no longer needed when compiling.\n    + A new `--no-highlight` option allows highlighting to be disabled.\n    + Highlighting now works in `docx`, `latex`, and `epub`, as well as\n      `html`, `html5`, `dzslides`, `s5`, and `slidy`.\n    + A new `--highlight-style` option selects between various highlighting\n      color themes.\n\n  * Internal links to sections now work in ConTeXt and LaTeX as well as HTML.\n\n  * LaTeX `\\include` and `\\usepackage` commands are now processed,\n    provided the files are in the working directory.\n\n  * EPUB improvements:\n\n    + Internal and external links now work in EPUB.\n    + Raw HTML is allowed.\n    + New `--epub-embed-font` option.\n    + Customizable templates for EPUB pages offer more control over\n      formatting: `epub-page.html`, `epub-coverimage.html`,\n      `epub-titlepage.html`.\n\n  * `--mathml` now works with DocBook.\n\n  * Added support for math in RST reader and writer.  Inline math uses the\n    `` :math:`...` `` construct.  Display math uses\n\n        .. math:: ...\n\n    or if the math is multiline,\n\n        .. math::\n\n           ...\n\n    These constructions are now supported now by `rst2latex.py`.\n\n  * Github syntax for fenced code blocks is supported in pandoc's\n    markdown.  You can now write\n\n        ```ruby\n        x = 2\n        ```\n\n    instead of\n\n        ~~~ {.ruby}\n        x = 2\n        ~~~~\n\n  * Easier scripting:  a new `toJsonFilter` function makes it easier to\n    write Haskell scripts to manipulate the Pandoc AST.\n    See [Scripting with pandoc](scripting.html#pandoc-1.9-changes).\n\n### Behavior changes\n\n  * Fixed parsing of consecutive lists in markdown.\n    Pandoc previously behaved like Markdown.pl for consecutive\n    lists of different styles. Thus, the following would be parsed\n    as a single ordered list, rather than an ordered list followed\n    by an unordered list:\n\n        1. one\n        2. two\n\n        - one\n        - two\n\n    This change makes pandoc behave more sensibly, parsing this as\n    two lists.  Any change in list type (ordered/unordered) or in\n    list number style will trigger a new list. Thus, the following\n    will also be parsed as two lists:\n\n        1. one\n        2. two\n\n        a. one\n        b. two\n\n    Since we regard this as a bug in Markdown.pl, and not something\n    anyone would ever rely on, we do not preserve the old behavior\n    even when `--strict` is selected.\n\n  * Dashes work differently with `--smart`: `---` is always em-dash,\n    and `--` is always en-dash.  Pandoc no longer tries to guess when\n    `-` should be en-dash.  *Note:* This may change how existing documents\n    look when processed with pandoc. A new option, `--old-dashes`,\n    is provided for legacy documents.\n\n  * The markdown writer now uses setext headers for levels 1-2.\n    The old behavior (ATX headers for all levels) can be restored\n    using the new `--atx-headers` option.\n\n  * Links are now allowed in markdown image captions.  They are also\n    allowed in links, but will appear there as regular text. So,\n\n        [link with [link](/url)](/url)\n\n    will turn into\n\n        <p><a href=\"/url\">link with link</a></p>\n\n  * Improved handling of citations using `citeproc-hs-0.3.4`.\n    Added `--citation-abbreviations` option.\n\n  * Citation keys can no longer end with a punctuation character.\n    This means that `@item1.` will be parsed as a citation with key\n    'item1', followed by a period, instead of a citation with key\n    'item1.', as was the case previously.\n\n  * In HTML output, citations are now put in a span with class `citation`.\n\n  * The markdown reader now recognizes DocBook block and inline tags.\n    It was always possible to include raw DocBook tags in a markdown\n    document, but now pandoc will be able to distinguish block from\n    inline tags and behave accordingly. Thus, for example,\n\n        <sidebar>\n        hello\n        </sidebar>\n\n    will not be wrapped in `<para>` tags.\n\n  * The LaTeX parser has been completely rewritten; it is now much more\n    accurate, robust, and extensible. However, there are two important\n    changes in how it treats unknown LaTeX. (1) Previously, unknown\n    environments became BlockQuote elements; now, they are treated\n    as \"transparent\", so `\\begin{unknown}xyz\\end{unknown}` is the\n    same as `xyz`.  (2) Previously, arguments of unknown commands\n    were passed through with their braces; now the braces are stripped\n    off.\n\n  * `--smart` is no longer selected automatically with `man` output.\n\n  * The deprecated `--xetex` option has been removed.\n\n  * The `--html5`/`-5` option has been deprecated. Use `-t html5`\n    instead. `html5` and `html5+lhs` are now separate output formats.\n\n  * Single quotes are no longer escaped in HTML output.  They do not\n    need to be escaped outside of attributes.\n\n  * Pandoc will no longer transform leading newlines in code\n    blocks to `<br/>` tags.\n\n  * The ODT writer now sizes images appropriately, using the image\n    size and DPI information embedded in the image.\n\n  * `--standalone` is once again implicitly for a non-text output format\n    (ODT, EPUB).  You can again do `pandoc test.txt -o test.odt`\n    and get a standalone ODT file.\n\n  * The Docbook writer now uses `<sect1>`, `<sect2>`, etc. instead of\n    `<section>`.\n\n  * The HTML writer now uses `<del>` for strikeout.\n\n  * In HTML output with `--section-divs`, the classes `section` and\n    `level[1,2,..6]` are put on the `div` tags so they can be styled.\n    In HTML 5 output with `--section-divs`, the classes\n    `level[1,2,...6]` are put on `section` tags.\n\n  * EPUB writer changes:\n\n    + The `lang` variable now sets the language\n      in the metadata (if it is not set, we default to the locale).\n    + EPUB:  UTF-8 is used rather than decimal entities.\n\n  * Added `titleslide` class to title slide in S5 template.\n\n  * In HTML, EPUB, and docx metadata, the date is normalized into\n    YYYY-MM-DD format if possible. (This is required for validation.)\n\n  * Attributes in highlighted code blocks are now preserved in HTML.\n    The container element will have the classes, id, and key-value attributes\n    you specified in the delimited code block. Previously these were stripped\n    off.\n\n  * The reference backlink in the HTML writer no longer has a special\n    `footnoteBacklink` class.\n\n  * The HTML template has been split into `html` and `html5` templates.\n\n  * Author and date are treated more consistently in HTML templates.\n    Authors are now `<h2>`, date `<h3>`.\n\n  * URLs are hyphenated in the ConTeXt writer (B. Scott Michel).\n\n  * In `Text.Pandoc.Builder`, `+++` has been replaced by `<>`.\n\n### Bug fixes\n\n  * Better support for combining characters and East Asian wide characters\n    in markdown and reST.\n\n  * Better handling of single quotes with `--smart`.\n    Previously `D'oh l'*aide*` would be parsed with left and right single\n    quotes instead of apostrophes. This kind of error is now fixed.\n\n  * Highlighting: Use `reads` instead of `read` for better error handling.\n    Fixes crash on `startNum=\"abc\"`.\n\n  * Added blank comment after directives in rst template.\n\n  * Unescape entities in citation `refId`. The `refId`s coming\n    from citeproc contain XML numeric entities, and these don't match with the\n    citation keys parsed by pandoc. Solution is to unescape them.\n\n  * HTML reader: Fixed bug parsing tables with both thead and tbody.\n\n  * Markdown reader:\n\n    + Better handling of escapes in link URLs and titles.\n    + Fixed backslash escapes in reference links.\n    + Fixed bug in table/hrule parsing, by checking that the top\n      line of a table is not followed by a blank line. This bug caused\n      slowdowns on some files with hrules and tables, as pandoc tried to\n      interpret the hrules as the tops of multiline tables.\n    + Fixed bug in code block attribute parser. Previously the ID attribute\n      got lost if it didn't come first. Now attributes can come in any order.\n\n  * RST reader: allow footnotes followed by newline without space characters.\n\n  * LaTeX reader:\n\n    + Ignore empty groups {}, { }.\n    + LaTeX reader: Handle `\\@`.\n    + LaTeX reader:  Don't crash on commands like `\\itemsep`.\n    + LaTeX reader:  Better handling of letter environments.\n\n  * RST writer: Fixed bug involving empty table cells. isSimple was being\n    calculated in a way that assumed there were no non-empty cells.\n\n  * ConTeXt writer:\n\n    + Made `--toc` work even without `--number-sections`.\n    + Escape # in link URLs.\n    + Use buffering for footnotes containing code blocks.\n    + Changed 'descr' to 'description', fixed alignment.\n\n  * LaTeX writer:\n\n    + Escape euro character.\n    + Don't escape `~` inside `\\href{...}`.\n    + Escape `#` in href URLs.\n    + Improved detection of book classes.  We now check the\n      `documentclass` variable, and if that is not set, we look through\n      the template itself.  Also, we have added the KOMA classes scrreprt\n      and scrbook.  You can now make a book using\n      `pandoc -V documentclass:book mybook.txt -o mybook.pdf`\n    + LHS files now set the \"listings\" variable, so that the definition\n      of the `code` environment will be included in the template.\n    + Links are colored blue by default (this can be changed by\n      modifying `hyperref` settings in the template).\n    + Added `lang` variable to LaTeX template.\n\n  * HTML writer:\n\n    + Fixed bug in HTML template with html5 and mathml.\n    + Don't use self-closing img, br, hr tags for HTML5.\n    + Use `<section>` for footnotes if HTML5.\n    + Update HTML templates to use Content-Style-Type meta tag.\n    + Use separate variables for meta-date, meta-author.\n      This makes footnotes work in author and date fields.\n    + Use 'vertical-align:middle' in WebTeX math for better alignment.\n\n  * S5/slidy writer:  Make footnotes appear on separate slide at end.\n\n  * MIME: Added 'layout-cache' to getMimeType. This ensures that the\n    META-INF/manifest.xml for ODT files will have everything it needs, so\n    that ODT files modified by LibreOffice can be used as `--reference-odt`.\n\n  * `Text.Pandoc.Templates`: Return empty string for json template.\n\n  * `Text.Pandoc.Biblio`:\n\n    + Expand citations recursively inside nested inlines.\n    + Treat `\\160` as space when parsing locator and suffix.\n      This fixes a bug with \"p. 33\" when `--smart` is used. Previously\n      the whole \"p. 33\" would be included in the suffix, with no locator.\n    + Put whole author-in-text citation in a Cite.  Previously just the\n      date and other info went in the Cite.\n    + Don't add comma+space to prefix if it ends in punctuation.\n\n  * Updated chicago-author-date.csl.  The old version did not work\n    properly for edited volumes with no author.\n\n  * EPUB writer:\n\n    + Add date to EPUB titlepage and metadata.\n    + Added TOC identifier in EPUB page template.\n    + Don't generate superfluous file `cover-image.jpg`.\n\n###  Under the hood improvements\n\n  * Modified `make_osx_package.sh` to use cabal-dev.\n    Items are no longer installed as root.\n    Man pages are zipped and given proper permissions.\n\n  * Modified windows installer generator to use cabal-dev.\n\n  * Setup: Making man pages now works with cabal-dev (at least on OSX). In\n    Setup.hs we now invoke 'runghc' in a way that points it to the correct\n    package databases, instead of always falling back to the default user\n    package db.\n\n  * Updated to work with GHC 7.4.1.\n\n  * Removed dependency on old-time.\n\n  * Removed dependency on dlist.\n\n  * New slidy directory for \"self-contained.\"\n\n  * TeXMath writer:  Use unicode thin spaces for thin spaces.\n\n  * Markdown citations: don't strip off initial space in locator.\n\n### API changes\n\n  * Removed `Apostrophe`, `EmDash`, `EnDash`, and `Ellipses`\n    from the native `Inline` type in pandoc-types.  Now we use `Str`\n    elements with unicode.\n\n  * Improvements to `Text.Pandoc.Builder`:\n\n    + `Inlines` and `Blocks` are now newtypes (not synonyms for\n      sequences).\n    + Instances are defined for `IsString`, `Show`, `Read`, `Monoid`,\n      and a new `Listable` class, which allows these to be manipulated\n      to some extent like lists. Monoid append includes automatic\n      normalization.\n    + `+++` has been replaced by `<>` (mappend).\n\n  * Use blaze-html instead of xhtml for HTML generation.\n    This changes the type of `writeHtml`.\n\n  * `Text.Pandoc.Shared`:\n\n    + Added `warn` and `err`.\n    + Removed `unescapeURI`, modified `escapeURI`.\n      (See under [behavior changes], above.)\n\n  * Changes in URI escaping:  Previously the readers escaped URIs by\n    converting unicode characters to octets and then percent encoding.\n    Now unicode characters are left as they are, and `escapeURI` only\n    percent-encodes space characters.  This gives more readable\n    URIs, and works well with modern user agents. URIs are no longer unescaped\n    at all on conversion to `markdown`, `asciidoc`, `rst`, `org`.\n\n  * New module `Text.Pandoc.SelfContained`.\n\n  * New module `Text.Pandoc.Docx`.\n\n  * New module `Text.Pandoc.PDF`.\n\n  * Added `writerBeamer` to `WriterOptions`.\n\n  * Added `normalizeDate` to `Text.Pandoc.Shared`.\n\n  * Added `splitStringWithIndices` in `Text.Pandoc.Shared`.\n    This is like `splitWithIndices`, but it is sensitive to distinctions\n    between wide, combining, and regular characters.\n\n  * `Text.Pandoc.Pretty`:\n\n    + Added `chomp` combinator.\n    + Added `beforeNonBreak` combinator.  This allows you to include\n      something conditionally on it being before a nonblank.\n      Used for RST inline math.\n    + Added `charWidth` function. All characters marked W or F in the unicode\n      spec EastAsianWidth.txt get width 2.\n    + Added `realLength`, based on `charWidth`. `realLength` is now\n      used in calculating offsets.\n\n  * New module `Text.Pandoc.Slides`, for common functions for breaking\n    a document into slides.\n\n  * Removed `Text.Pandoc.S5`, which is no longer needed.\n\n  * Removed `Text.Pandoc.CharacterReferences`.  Moved\n    `characterReference` to `Text.Pandoc.Parsing`.\n    `decodeCharacterReferences` is replaced by `fromEntities`\n    in `Text.Pandoc.XML`.\n\n  * Added `Text.Pandoc.ImageSize`.  This is intened for use\n    in `docx` and `odt` writers, so the size and dpi of images\n    can be calculated.\n\n  * Removed `writerAscii` in `WriterOptions`.\n\n  * Added `writerHighlight` to `WriterOptions`.\n\n  * Added `DZSlides` to `HTMLSlideVariant`.\n\n  * `writeEPUB` has a new argument for font files to embed.\n\n  * Added `stateLastStrPos` to `ParserState`. This lets us keep track\n    of whether we're parsing the position immediately after a regular\n    (non-space, non-symbol) string, which is useful for distinguishing\n    apostrophes from single quote starts.\n\n  * `Text.Pandoc.Parsing`:\n\n    + `escaped` now returns a `Char`.\n    + Removed `charsInBalanced'`, added a character parser as\n      a parameter of `charsInBalanced`.  This is needed for\n      proper handling of escapes, etc.\n    + Added `withRaw`.\n\n  * Added `toEntities` to `Text.Pandoc.XML`.\n\n  * `Text.Pandoc.Readers.LaTeX`:\n\n    + Export `handleIncludes`.\n    + Export `rawLaTeXBlock` instead of `rawLaTeXEnvironment'`.\n\n  * Added `ToJsonFilter` class and `toJsonFilter` function to\n    `Text.Pandoc`, deprecating the old `jsonFilter` function.\n\n  * `Text.Pandoc.Highlighting`:\n\n     + Removed `highlightHtml`, `defaultHighlightingCss`.\n     + Export `formatLaTeXInline`, `formatLaTeXBlock`, and `highlight`, plus\n       key functions from highlighting-kate.\n     + Changed types of highlighting function.  `highlight` returns a\n       `Maybe`, not an `Either`.\n\n\n## pandoc 1.8.2.1 (2011-08-01)\n\n  * Adjusted Arbitrary instance to help avoid timeouts in tests.\n\n  * Added `Tests.Writers.Markdown` to cabal file.\n\n  * Relaxed version bounds on pandoc-types, test-framework.\n\n## pandoc 1.8.2 (2011-07-30)\n\n  * Added script to produce OS X package.\n\n  * Made `templates` directory a git submodule.  This should make it\n    easier for people to revise their custom templates when the default\n    templates change.\n\n  * Changed template naming scheme: `FORMAT.template` -> `default.FORMAT`.\n    **Note:** If you have existing templates in `~/.pandoc/templates`, you\n    must rename them to conform to the new scheme!\n\n  * Default template improvements:\n\n    + HTML:  Display author and date after title.\n    + HTML:  Made table of contents more customizable.  The container\n      for the TOC is now in the template, so users can insert a header\n      or other styling. (Thanks to Bruce D'Arcus for the suggestion.)\n    + HTML, Slidy, S5:  Enclose scripts in CDATA tags.\n    + Slidy, S5: Added `s5-url` and `slidy-url` variables, instead of\n      hard-coding.  If you want to put your slidy files in the slidy\n      subdirectory, for example, you can do\n      `pandoc -t slidy -V slidy-url=slidy -s`.\n    + LaTeX: Use `\\and` to separate authors in LaTeX documents (reader\n      & writer).  Closes #279.\n    + LaTeX: Set `\\emergencystretch` to prevent overfull lines.\n    + LaTeX: Use different `hyperref` options for `xetex`, fixing\n      problems with unicode bookmarks (thanks to CircleCode).\n    + LaTeX: Removed `ucs` package, use `utf8` rather than `utf8x`\n      with `inputenc`.  This covers fewer characters but is more\n      robust with other packages, and `ucs` is unmaintained.  Users\n      who need better unicode support should use xelatex or lualatex.\n\n  * If a template specified with `--template` is not found, look for it\n    in `datadir`.  Also, if no extension is provided, supply one based\n    on the writer.  So now you can put your `special.latex` template in\n    `~/.pandoc/templates`, and use it from any directory via\n    `pandoc -t latex --template special`.\n\n  * Added `nonspaceChar` to `Text.Pandoc.Parsing`.\n\n  * Fixed smart quotes bug, now handling `'...hi'` properly.\n\n  * RST reader:\n\n    + Partial support for labeled footnotes.\n    + Improved accuracy of `simpleReferenceName` parser.\n\n  * HTML reader:\n\n    + Substitute correct unicode characters for\n      characters in the 128..159 range, which are often found even in\n      HTML that purports to be UTF-8.\n\n  * LaTeX reader:  Handle `\\subtitle` command (a subtitle is added\n    to the title, after a colon and linebreak). Closes #280.\n\n  * Leaner `reference.odt`.\n\n  * Added unexported module `Text.Pandoc.MIME` for use in\n    the ODT writer.\n\n  * ODT writer:  Construct `manifest.xml` based on archive contents.\n    This fixes a bug in ODTs containing images. Recent versions of\n    LibreOffice would reject these as corrupt, because `manifest.xml`\n    did not contain a reference to the image files.\n\n  * LaTeX writer:\n\n    + Make verbatim environments flush to avoid spurious\n      blank lines.  Closes #277.\n    + Use `\\texttt` and escapes insntead of `\\verb!...!`, which\n      is too fragile (doesn't work in command arguments).\n    + Use `\\enquote{}` for quotes if the template includes\n      the `csquotes` package. This provides better support for\n      local quoting styles. (Thanks to Andreas Wagner for the idea.)\n\n  * ConTeXt writer:  Make `\\starttyping`/`\\stoptyping` flush with\n    margin, preventing spurious blank lines.\n\n  * Slidy writer:\n\n    + Use non-minimized version of `slidy.css` with `--offline`\n      option, so users can more easily edit it.\n    + Also fixed a bug in the CSS that prevented proper centering\n      of title (now reported and fixed upstream).\n\n  * S5 writer:\n\n    + Replaced `s5/default/slides.js.{comment,packed}` with\n      new compressed `s5/default/slides.min.js`.\n    + Use `data:` protocol to embed S5 CSS in `<link>` tags,\n      when `--offline` is specified. Using inline CSS didn't\n      work with Chrome or Safari.  This fixes offline\n      S5 on those browsers.\n\n  * HTML writer:  Removed English title on footnote backlinks.\n    This is incongrous in non-English documents.\n\n  * Docbook writer:\n\n    + Use CALS tables.  (Some older docbook software does not work\n      well with XHTML tables.)  Closes #77.\n    + Use `programlisting` tags (instead of `screen`) for code blocks.\n\n  * `markdown2pdf`:\n\n    + Calls latex with `-halt-on-error -interaction nonstopmode` instead\n      of `-interaction=batchmode`, which essentially just ignored errors,\n      leading to bad results. Better to know when something is wrong.\n    + Fixed issues with non-UTF-8 output of `pdflatex`.\n    + Better error reporting.\n\n  * `--mathjax` now takes an optional URL argument. If it is not\n    provided, pandoc links directly to the (secure) mathjax CDN,\n    as now recommended (thanks to dsanson).\n\n  * Deprecated `--xetex` option in `pandoc`.  It is no longer needed,\n    since the LaTeX writer now produces a file that can be processed by\n    `latex`, `pdflatex`, `lualatex`, or `xelatex`.\n\n  * Introduced `--luatex` option to `markdown2pdf`. This causes `lualatex`\n    to be used to create the PDF.\n\n\n## pandoc 1.8.1.2 (2011-07-16)\n\n  * Added `--epub-cover-image` option.\n\n  * Documented `--biblatex` and `--natbib` options.\n\n  * Allow `--section-divs` with slidy output.  Resolves Issue #296.\n\n  * Disallow notes within notes in reST and markdown.\n    These previously caused infinite looping and stack overflows.\n    For example:\n\n        [^1]\n\n        [^1]: See [^1]\n\n    Note references are allowed in reST notes, so this isn't a full\n    implementation of reST. That can come later. For now we need to\n    prevent the stack overflows.  Partially resolves Issue #297.\n\n  * EPUB writer: Allow non-plain math methods.\n\n  * Forbid ()s in citation item keys.  Resolves Issue #304: problems with\n    `(@item1; @item2)` because the final paren was being parsed as part of\n    the item key.\n\n  * Changed URI parser so it doesn't include trailing punctuation.\n    So, in RST, `http://google.com.` should be parsed as a link followed by a\n    period. The parser is smart enough to recognize balanced parentheses, as\n    often occur in wikipedia links: `http://foo.bar/baz_(bam)`.\n\n  * Markdown+lhs reader: Require space after inverse bird tracks, so that\n    HTML tags can be used freely at the left margin of a markdown+lhs document.\n    Thanks to Conal Elliot for the suggestion.\n\n  * Markdown reader: Fixed bug in footnote order (reported by CircleCode).\n\n  * RST reader:\n      + Fixed bug in in field lists with multi-line items at the\n        end of the list.\n      + Added parentheses to RST `specialChars`, so\n        `(http://google.com)` will be parsed as a link in parens.\n        Resolves Issue #291.\n      + Allow `|` followed by newline in RST line block.\n\n  * LaTeX reader:\n      + Support `\\dots`.\n      + Gobble option & space after linebreak `\\\\[10pt]`.\n\n  * Textile reader:\n      + Make it possible to have colons after links.  (qerub)\n      + Make it possible to have colons after links.  (Christoffer Sawicki)\n\n  * HTML reader:\n      + Skip spaces after `<b>`, `<emph>`, etc.\n      + Handle tbody, thead in simple tables.  Closes #274.\n      + Implicit `Para`s instead of `Plains` in some contexts.\n\n  * OpenDocument writer:  Use special `First paragraph` style for\n    first paragraph after most non-paragraph blocks. This allows users to\n    specify e.g. that only paragraphs after the first paragraph of a block are\n    to be indented. Thanks to Andrea Rossato for the patch. Closes #20.\n\n  * LaTeX writer:  use `deVerb` on table and picture captions.\n    Otherwise LaTeX complains about `\\verb` inside command argument.\n    Thanks to bbanier for reporting the bug.\n\n  * Markdown writer: Insert HTML comment btw list and indented code block.\n    This prevents the code block from being interpreted as part of the list.\n\n  * EPUB writer: Add a meta element specify the cover.\n    Some EPUB e-readers, such as the Nook, require a meta element inside the\n    OPF metadata block to ensure the cover image is properly displayed.\n    (Kelsey Hightower)\n\n  * HTML writer: Use embed tag for images with non-image extensions.\n    (e.g.  PDFs).  Closes #264.\n\n  * LaTeX writer: Improved tables.\n\n      + More space between lines, top-align cells.\n      + Use ctable package, which allows footnotes and\n        provides additional options.\n      + Made cell alignments work in multiline tables.\n      + Closes #271, #272.\n\n  * Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.\n    Also do this when copying image files into EPUBs and ODTs.\n    Closes #263.\n\n  * Changed to github issue tracker.\n\n  * Added failing emph/strong markdown test case due to Perry Wagle.\n\n  * Slidy improvements:\n      + Updated to use Slidy2.\n      + Fixed bug, unclosed div tag.\n      + Added `duration` variable in template.\n        Setting this activates the timer.\n      + Use 'titlepage' instead of 'cover' for title div.\n\n\n## pandoc 1.8.1.1 (2011-02-13)\n\n  * `markdown2pdf`:  Removed some debugging lines accidentally included\n    in the 1.8.1 release. With those lines, the temp directory is created\n    in the working directory, and it is not deleted.  This fix restores\n    the original behavior.\n\n## pandoc 1.8.1 (2011-02-13)\n\n  * Added `--ascii` option.  Currently supported only in HTML writer,\n    which it causes to use numerical entities instead of UTF-8.\n\n  * EPUB writer: `--toc` now works to provide a table of contents\n    at the beginning of each chapter.\n\n  * LaTeX writer:  Change figure defaults to `htbp`.\n    This prevents \"too many unprocessed floats.\"  Resolves\n    Issue #285.\n\n  * `Text.Pandoc.UTF8`:  Encode filenames even when using recent\n    base.\n\n  * `markdown2pdf`: Fixed filename encoding issues. With help from Paulo\n    Tanimoto. Resolves Issue #286.\n\n  * HTML writer: Put line breaks in section divs.\n\n  * `Text.Pandoc.Shared`: Make `writerSectionDivs` default to False.\n\n## pandoc 1.8.0.3 (2011-02-05)\n\n  * Fixed Source-repository stanza in cabal file.\n\n## pandoc 1.8.0.2 (2011-02-05)\n\n  * HTML writer:\n\n    + Stringify alt text instead of converting to HTML.\n    + Break lines after block elements, not inside tags.\n      HTML output now closely resembles that of tidy. Resolves Issue #134.\n\n  * Markdown reader: Fixed bug in footnote block parser (pointed out\n    by Jesse Rosenthal).  The problem arose when the blank line\n    at the end of a footnote block contained indenting spaces.\n\n  * Shared: Improved 'normalize' function so it normalizes Spaces too.\n    In normal form, Space elements only occur to separate two non-Space\n    elements.  So, we never have [Space], or [, ..., Space].\n\n  * Tests:\n\n    + Improved Arbitrary instance.\n    + Added timeout for test instances.\n\n  * README:\n\n    + Added section on four-space rule for lists.  Resolves Issue #283.\n    + Clarified optional arguments on math options.\n\n  * markdown2pdf: Fixed bug with output file extensions.\n    Previously `markdown2pdf test.txt -o test.en.pdf` would produce\n    `test.pdf`, not `test.en.pdf`.  Thanks to Paolo Tanimoto for the fix.\n\n## pandoc 1.8.0.1 (2011-01-31)\n\n  * Revised Interact.hs so that it works with the CPP macros\n    in the UTF8 module.\n\n  * Revised Setup.hs so that we don't call MakeManPage.hs unless\n    the man pages are out of date.\n\n## pandoc  1.8 (2011-01-30)\n\n### New features\n\n  * Support for citations using Andrea Rossato's `citeproc-hs` 0.3.\n    You can now write, for example,\n\n        Water is wet [see @doe99, pp. 33-35; also @smith04, ch. 1].\n\n    and, when you process your document using `pandoc`, specifying\n    a citation style using `--csl` and a bibliography using `--bibliography`,\n    the citation will be replaced by an appropriately formatted\n    citation, and a list of works cited will be added to the end\n    of the document.\n\n    This means that you can switch effortlessly between different citation\n    and bibliography styles, including footnote, numerical, and author-date\n    formats. The bibliography can be in any of the following formats: MODS,\n    BibTeX, BibLaTeX, RIS, EndNote, EndNote XML, ISI, MEDLINE, Copac, or JSON.\n    See the README for further details.\n\n    Citations are supported in the markdown reader, using a special\n    syntax, and in the LaTeX reader, using natbib or biblatex syntax.\n    (Thanks to Nathan Gass for the natbib and biblatex support.)\n\n  * New `textile` reader and writer.  Thanks to Paul Rivier for contributing\n    the `textile` reader, an almost complete implementation of the textile\n    syntax used by the ruby [RedCloth library](http://redcloth.org/textile).\n    Resolves Issue #51.\n\n  * New `org` writer, for Emacs Org-mode, contributed by Puneeth Chaganti.\n\n  * New `json` reader and writer, for reading and writing a JSON\n    representation of the native Pandoc AST.  These are much faster\n    than the `native` reader and writer, and should be used for\n    serializing Pandoc to text.  To convert between the JSON representation\n    and native Pandoc, use `encodeJSON` and `decodeJSON` from\n    `Text.JSON.Generic`.\n\n  * A new `jsonFilter` function in `Text.Pandoc` makes it easy\n    to write scripts that transform a JSON-encoded pandoc document.\n    For example:\n\n        -- removelinks.hs - removes links from document\n        import Text.Pandoc\n        main = interact $ jsonFilter $ bottomUp removeLink\n                 where removeLink (Link xs _) = Emph xs\n                       removeLink x = x\n\n    To use this to remove links while translating markdown to LaTeX:\n\n        pandoc -t json | runghc removelinks.hs | pandoc -f json -t latex\n\n  * Attributes are now allowed in inline `Code` elements, for example:\n\n        In this code, `ulist ! [theclass \"special\"] << elts`{.haskell} is...\n\n    The attribute syntax is the same as for delimited code blocks.\n    `Code` inline has an extra argument place for attributes, just like\n    `CodeBlock`. Inline code will be highlighted in HTML output, if pandoc\n    is compiled with highlighting support. Resolves Issue #119.\n\n  * New `RawBlock` and `RawInline` elements (replacing `RawHtml`,\n    `HtmlInline`, and `TeX`) provide lots of flexibility in writing\n    scripts to transform Pandoc documents. Scripts can now change\n    how each element is rendered in each output format.\n\n  * You can now define LaTeX macros in markdown documents, and pandoc\n    will apply them to TeX math.  For example,\n\n        \\newcommand{\\plus}[2]{#1 + #2}\n        $\\plus{3}{4}$\n\n    yields `3+4`.  Since the macros are applied in the reader, they\n    will work in every output format, not just LaTeX.\n\n  * LaTeX macros can also be used in LaTeX documents (both in math\n    and in non-math contexts).\n\n  * A new `--mathjax` option has been added for displaying\n    math in HTML using MathJax.  Resolves issue #259.\n\n  * Footnotes are now supported in the RST reader. (Note, however,\n    that unlike docutils, pandoc ignores the numeral or symbol used in\n    the note; footnotes are put in an auto-numbered ordered list.)\n    Resolves Issue #258.\n\n  * A new `--normalize` option causes pandoc to normalize the AST\n    before writing the document.  This means that, for example,\n    `*hi**there*` will be rendered as `<em>hithere</em>`\n    instead of `<em>hi</em><em>there</em>`.  This is not the default,\n    because there is a significant performance penalty.\n\n  * A new `--chapters` command-line option causes headers\n    in DocBook, LaTeX, and ConTeXt to start with \"chapter\" (level one).\n    Resolves Issue #265.\n\n  * In DocBook output, `<chapter>` is now used for top-level\n    headers if the template contains `<book>`. Resolves Issue #265.\n\n  * A new `--listings` option in `pandoc` and `markdown2pdf` causes\n    the LaTeX writer to use the listings package for code blocks.\n    (Thanks to Josef Svennigsson for the pandoc patch, and Etienne\n    Millon for the markdown2pdf patch.)\n\n  * `markdown2pdf` now supports `--data-dir`.\n\n  * URLs in autolinks now have class \"url\" so they can be styled.\n\n  * Improved prettyprinting in most formats.  Lines will be wrapped\n    more evenly and duplicate blank lines avoided.\n\n  * New `--columns` command-line option sets the column width for\n    line wrapping and relative width calculations for tables.\n\n  * Made `--smart` work in HTML, RST, and Textile readers, as well\n    as markdown.\n\n  * Added `--html5` option for HTML5 output.\n\n  * Added support for listings package in LaTeX reader\n    (Puneeth Chaganti).\n\n  * Added support for simple tables in the LaTeX reader.\n\n  * Added support for simple tables in the HTML reader.\n\n  * Significant performance improvements in many readers and writers.\n\n### API and program changes\n\n  * Moved `Text.Pandoc.Definition` from the `pandoc` package to a new\n    auxiliary package, `pandoc-types`. This will make it possible for other\n    programs to supply output in Pandoc format, without depending on the whole\n    pandoc package.\n\n  * Added `Attr` field to `Code`.\n\n  * Removed `RawHtml`, `HtmlInline`, and `TeX` elements; added generic\n    `RawBlock` and `RawInline`.\n\n  * Moved generic functions to `Text.Pandoc.Generic`. Deprecated\n    `processWith`, replacing it with two functions, `bottomUp` and `topDown`.\n    Removed previously deprecated functions `processPandoc` and `queryPandoc`.\n\n  * Added `Text.Pandoc.Builder`, for building `Pandoc` structures.\n\n  * `Text.Pandoc` now exports association lists `readers` and `writers`.\n\n  * Added `Text.Pandoc.Readers.Native`, which exports `readNative`.\n    `readNative` can now read full pandoc documents, block lists, blocks,\n    inline lists, or inlines.  It will interpret `Str \"hi\"`\n    as if it were `Pandoc (Meta [] [] []) [Plain [Str \"hi\"]]`.\n    This should make testing easier.\n\n  * Removed deprecated `-C/--custom-header` option.\n    Use `--template` instead.\n\n  * `--biblio-file` has been replaced by `--bibliography`.\n    `--biblio-format` has been removed; pandoc now guesses the format\n    from the file extension (see README).\n\n  * pandoc will treat an argument as a URI only if it has an\n    `http(s)` scheme.  Previously pandoc would treat some\n    Windows pathnames beginning with `C:/` as URIs.\n\n  * The `--sanitize-html` option and the `stateSanitize` field in\n    `ParserState` have been removed. Sanitization is better done in the\n    resulting HTML using `xss-sanitize`, which is based on pandoc's\n    sanitization, but improved.\n\n  * pandoc now adds a newline to the end of its output in fragment\n    mode (= not `--standalone`).\n\n  * Added support for `lang` in `html` tag in the HTML template,\n    so you can do `pandoc -s -V lang=es`, for example.\n\n  * `highlightHtml` in `Text.Pandoc.Highlighting` now takes\n    a boolean argument that selects between \"inline\" and\n    \"block\" HTML.\n\n  * `Text.Pandoc.Writers.RTF` now exports `rtfEmbedImage`.\n    Images are embedded in RTF output when possible (png, jpeg).\n    Resolves Issue #275.\n\n  * Added `Text.Pandoc.Pretty`. This is better suited for pandoc than the\n    `pretty` package.  Changed all writers that used\n    `Text.PrettyPrint.HughesPJ` to use `Text.Pandoc.Pretty` instead.\n\n  * Rewrote `writeNative` using the new prettyprinting module. It is\n    now much faster. The output has been made more consistent and compressed.\n    `writeNative` is also now sensitive to writerStandalone`, and will simply\n    `print a block list if writerStandalone` is False.\n\n  * Removed `Text.Pandoc.Blocks`. `Text.Pandoc.Pretty` allows you to define\n    blocks and concatenate them, so a separate module is no longer needed.\n\n  * `Text.Pandoc.Shared`:\n\n    + Added `writerColumns`, `writerChapters`, and `writerHtml5` to\n      `WriterOptions`.\n    + Added `normalize`.\n    + Removed unneeded prettyprinting functions:\n      `wrapped`, `wrapIfNeeded`, `wrappedTeX`, `wrapTeXIfNeeded`, `hang'`,\n      `BlockWrapper`, `wrappedBlocksToDoc`.\n    + Made `splitBy` take a test instead of an element.\n    + Added `findDataFile`, refactored `readDataFile`.\n    + Added `stringify`. Rewrote `inlineListToIdentifier` using `stringify`.\n    + Fixed `inlineListToIdentifier` to treat `\\160` as ' '.\n\n  * `Text.Pandoc.Readers.HTML`:\n\n    + Removed `rawHtmlBlock`, `anyHtmlBlockTag`, `anyHtmlInlineTag`,\n      `anyHtmlTag`, `anyHtmlEndTag`, `htmlEndTag`, `extractTagType`,\n      `htmlBlockElement`, `htmlComment`\n    + Added `htmlTag`, `htmlInBalanced`, `isInlineTag`, `isBlockTag`,\n      `isTextTag`\n\n  * Moved `smartPunctuation` from `Text.Pandoc.Readers.Markdown`\n    to `Text.Pandoc.Readers.Parsing`, and parameterized it with\n    an inline parser.\n\n  * Ellipses are no longer allowed to contain spaces.\n    Previously we allowed '. . .', ' . . . ', etc.  This caused\n    too many complications, and removed author's flexibility in\n    combining ellipses with spaces and periods.\n\n  * Allow linebreaks in URLs (treat as spaces). Also, a string of\n    consecutive spaces or tabs is now parsed as a single space. If you have\n    multiple spaces in your URL, use `%20%20`.\n\n  * `Text.Pandoc.Parsing`:\n\n    + Removed `refsMatch`.\n    + Hid `Key` constructor.\n    + Removed custom `Ord` and `Eq` instances for `Key`.\n    + Added `toKey` and `fromKey` to convert between `Key` and `[Inline]`.\n    + Generalized type on `readWith`.\n\n  * Small change in calculation of relative widths of table columns.\n    If the size of the header > the specified column width, use\n    the header size as 100% for purposes of calculating\n    relative widths of columns.\n\n  * Markdown writer now uses some pandoc-specific features when `--strict`\n    is not specified: `\\` newline is used for a hard linebreak instead of\n    two spaces then a newline. And delimited code blocks are used when\n    there are attributes.\n\n  * HTML writer:  improved gladTeX output by setting ENV appropriately\n    for display or inline math (Jonathan Daugherty).\n\n  * LaTeX writer: Use `\\paragraph`, `\\subparagraph` for level 4,5 headers.\n\n  * LaTeX reader:\n\n    + `\\label{foo}` and `\\ref{foo}` now become `{foo}` instead of `(foo)`.\n    + `\\index{}` commands are skipped.\n\n  * Added `fontsize` variable to default LaTeX template.\n    This makes it easy to set the font size using `markdown2pdf`:\n    `markdown2pdf -V fontsize=12pt input.txt`.\n\n  * Fixed problem with strikeout in LaTeX headers when using\n    hyperref, by adding a command to the default LaTeX template\n    that disables `\\sout` inside pdf strings. Thanks to Joost Kremers\n    for the fix.\n\n  * The `COLUMNS` environment variable no longer has any effect.\n\n### Under-the-hood improvements\n\n  * Pandoc now compiles with GHC 7. (This alone leads to a\n    significant performance improvement, 15-20%.)\n\n  * Completely rewrote HTML reader using tagsoup as a lexer. The\n    new reader is faster and more accurate.  Unlike the\n    old reader, it does not get bogged down on some input\n    (Issues #277, 255). And it handles namespaces in tags\n    (Issue #274).\n\n  * Replaced `escapeStringAsXML` with a faster version.\n\n  * Rewrote `spaceChar` and some other parsers in Text.Pandoc.Parsing\n    for a significant performance boost.\n\n  * Improved performance of all readers by rewriting parsers.\n\n  * Simplified Text.Pandoc.CharacterReferences by using\n    entity lookup functions from TagSoup.\n\n  * `Text.Pandoc.UTF8` now uses the unicode-aware IO functions\n    from `System.IO` if base >= 4.2.  This gives support for\n    windows line endings on windows.\n\n  * Remove duplications in documentation by generating the\n    pandoc man page from README, using `MakeManPage.hs`.\n\n  * README now includes a full description of markdown syntax,\n    including non-pandoc-specific parts.  A new `pandoc_markdown`\n    man page is extracted from this, so you can look up markdown\n    syntax by doing `man pandoc_markdown`.\n\n  * Completely revised test framework (with help from Nathan Gass).\n    The new test framework is built when the `tests` Cabal flag is set. It\n    includes the old integration tests, but also some new unit and quickcheck\n    tests. Test output has been much improved, and you can now specify a glob\n    pattern after `cabal test` to indicate which tests should be run;\n    for example `cabal test citations` will run all the citation tests.\n\n  * Added a shell script, `stripansi.sh`, for filtering ANSI control\n    sequences from test output: `cabal test | ./stripansi.sh > test.log`.\n\n  * Added `Interact.hs` to make it easier to use ghci while developing.\n    `Interact.hs` loads `ghci` from the `src` directory, specifying\n    all the options needed to load pandoc modules (including\n    specific package dependencies, which it gets by parsing\n    dist/setup-config).\n\n  * Added `Benchmark.hs`, testing all readers + writers using criterion.\n\n  * Added `stats.sh`, to make it easier to collect and archive\n    benchmark and lines-of-code stats.\n\n  * Added upper bounds to all cabal dependencies.\n\n  * Include man pages in extra-source-files.  This allows users to\n    install pandoc from the tarball without needing to build the man\n    pages.\n\n### Bug fixes\n\n  * Filenames are encoded as UTF8.  Resolves Issue #252.\n\n  * Handle curly quotes better in `--smart` mode. Previously, curly quotes\n    were just parsed literally, leading to problems in some output formats.\n    Now they are parsed as `Quoted` inlines, if `--smart` is specified.\n    Resolves Issue #270.\n\n  * Text.Pandoc.Parsing: Fixed bug in grid table parser.\n    Spaces at end of line were not being stripped properly,\n    resulting in unintended LineBreaks.\n\n  * Markdown reader:\n\n    + Allow HTML comments as inline elements in markdown.\n      So, `aaa <!-- comment --> bbb` can be a single paragraph.\n    + Fixed superscripts with links: `^[link](/foo)^` gets\n      recognized as a superscripted link, not an inline note followed by\n      garbage.\n    + Fixed regression, making markdown reference keys case-insensitive again.\n      Resolves Issue #272.\n    + Properly handle abbreviations (like `Mr.`) at the end of a line.\n    + Better handling of intraword underscores, avoiding exponential\n      slowdowns in some cases.  Resolves Issue #182.\n    + Fixed bug in alignments in tables with blank rows in the header.\n\n  * RST reader:\n\n    + Field lists now allow spaces in field names, and\n      block content in field values. (Thanks to Lachlan Musicman\n      for pointing out the bug.)\n    + Definition list items are now always `Para` instead of\n      `Plain`, matching behavior of `rst2xml.py`.\n    + In image blocks, the description is parsed properly and\n      used for the alt attribute, not also the title.\n    + Skip blank lines at beginning of file. Resolves\n      Debian #611328.\n\n  * LaTeX reader:\n\n    + Improved parsing of preamble.\n      Previously you'd get unexpected behavior on a document that\n      contained `\\begin{document}` in, say, a verbatim block.\n    + Allow spaces between `\\begin` or `\\end` and `{`.\n    + Support `\\L` and `\\l`.\n    + Skip comments inside paragraphs.\n\n  * LaTeX writer:\n\n    + Escape strings in `\\href{..}`.\n    + In nonsimple tables, put cells in `\\parbox`.\n\n  * OpenDocument writer:  don't print raw TeX.\n\n  * Markdown writer:\n\n    + Fixed bug in `Image`.  URI was getting unescaped twice!\n    + Avoid printing extra blank lines at the end if there are\n      no notes or references.\n\n  * LaTeX and ConTeXt: Escape `[` and `]` as `{[}` and `{]}`.\n    This avoids unwanted interpretation as an optional argument.\n\n  * ConTeXt writer: Fixed problem with inline code.  Previously\n    `}` would be rendered `\\type{}}`. Now we check the string for '}' and '{'.\n    If it contains neither, use `\\type{}`; otherwise use `\\mono{}`\n    with an escaped version of the string.\n\n  * `:` now allowed in HTML tags. Resolves Issue #274.\n\n\n\n## pandoc  1.6 (2010-07-24)\n\n+ New EPUB and HTML Slidy writers. (Issue #122)\n\n    - [EPUB] is a standard ebook format, used in Apple's iBooks for\n      the iPad and iPhone, Barnes and Noble's nook reader, the Sony\n      reader, and many other devices, and by online ebook readers like\n      [bookworm]. (Amazon's Kindle uses a different format, MobiPocket,\n      but EPUB books can easily be converted to Kindle format.) Now you\n      can write your book in markdown and produce an ebook with a single\n      command! I've put up a short [tutorial here].\n    - [Slidy], like S5, is a system for producing HTML+javascript slide shows.\n\n+ All input is assumed to be UTF-8, no matter what the locale and ghc\n  version, and all output is UTF-8. This reverts to pre-1.5 behavior.\n  Also, a BOM, if present, is stripped from the input.\n\n+ Markdown now supports grid tables, whose cells can contain\n  arbitrary block elements. (Issue #43)\n\n+ Sequentially numbered example lists in markdown with `@` marker.\n\n+ Markdown table captions can begin with a bare colon and no longer need\n  to include the English word \"table.\" Also, a caption can now occur\n  either before or after the table. (Issue #227)\n\n+ New command-line options:\n\n    - `--epub-stylesheet` allows you to specify a CSS file that will\n      be used to style your ebook.\n    - `--epub-metadata` allows you to specify metadata for the ebook.\n    - `--offline` causes the generated HTML slideshow to include all\n      needed scripts and stylesheets.\n    - `--webtex` causes TeX math to be converted to images using the\n      Google Charts API (unless a different URL is specified).\n    - `--section-divs` causes div tags to be added around each section\n      in an HTML document. (Issue #230, 239)\n\n+ Default behavior of S5 writer in standalone mode has changed:\n  previously, it would include all needed scripts and stylesheets\n  in the generated HTML; now, only links are included unless\n  the `--offline` option is used.\n\n+ Default behavior of HTML writer has changed. Between 1.2 and 1.5,\n  pandoc would enclose sections in div tags with identifiers on the\n  div tags, so that the sections can be manipulated in javascript.\n  This caused undesirable interactions with raw HTML div tags. So,\n  starting with 1.6, the default is to put the identifiers directly\n  on the header tags, and not to include the divs.  The `--section-divs`\n  option selects the 1.2-1.5 behavior.\n\n+ API changes:\n\n    - `HTMLMathMethod`: Added `WebTeX`, removed `MimeTeX`.\n    - `WriterOptions`: Added `writerUserDataDir`, `writerSourceDirectory`,\n      `writerEPUBMetadata` fields. Removed `writerIncludeBefore`,\n      `writerIncludeAfter`.\n    - Added `headerShift` to `Text.Pandoc.Shared`.\n    - Moved parsing code and `ParserState` from `Text.Pandoc.Shared`\n      to a new module, `Text.Pandoc.Parsing`.\n    - Added `stateHasChapters` to `ParserState`.\n    - Added `HTMLSlideVariant`.\n    - Made `KeyTable` a map instead of an association list.\n    - Added accessors for `Meta` fields (`docTitle`, `docAuthors`, `docDate`).\n    - `Pandoc`, `Meta`, `Inline`, and `Block` have been given `Ord` instances.\n    - Reference keys now have a type of their own (`Key`), with its\n      own `Ord` instance for case-insensitive comparison.\n    - Added `Text.Pandoc.Writers.EPUB`.\n    - Added `Text.Pandoc.UUID`.\n    - Removed `Text.Pandoc.ODT`, added `Text.Pandoc.Writers.ODT`.\n      Removed `saveOpenDocumentAsODT`, added `writeODT`.\n    - Added `Text.Pandoc.Writers.Native` and `writeNative`.\n      Removed `prettyPandoc`.\n    - Added `Text.Pandoc.UTF8` for portable UTF8 string IO.\n    - Removed `Text.Pandoc.Writers.S5` and the `writeS5` function.\n      Moved `s5Includes` to a new module, `Text.Pandoc.S5`.\n      To write S5, you now use `writeHtml` with `writerSlideVariant`\n      set to `S5Slides` or `SlidySlides`.\n\n+ Template changes.  If you use custom templates, please update them,\n  particularly if you use syntax highlighting with pandoc. The old HTML\n  templates hardcoded highlighting CSS that will no longer work with\n  the most recent version of highlighting-kate.\n\n    - HTML template: avoid empty meta tag if no date.\n    - HTML template: Use default highlighting CSS from highlighting-kate\n      instead of hard-coding the CSS into the template.\n    - HTML template: insert-before text goes before the title, and\n      immediately after the `<body>` tag, as documented. (Issue #241)\n    - Added slidy and s5 templates.\n    - Added amssymb to preamble of latex template. (github Issue 1)\n\n+ Removed excess newlines at the end of output. Note: because output\n  will not contain an extra newline, you may need to make adjustments\n  if you are inserting pandoc's output into a template.\n\n+ In S5 and slidy, horizontal rules now cause a new slide, so you\n  are no longer limited to one slide per section.\n\n+ Improved handling of code in man writer. Inline code is now monospace,\n  not bold, and code blocks now use .nf (no fill) and .IP (indented para).\n\n+ HTML reader parses `<tt>` as Code. (Issue #247)\n\n+ html+lhs output now contains bird tracks, even when compiled without\n  highlighting support. (Issue #242)\n\n+ Colons are now no longer allowed in autogenerated XML/HTML identifiers,\n  since they have a special meaning in XML.\n\n+ Code improvements in ODT writer.  Remote images are now replaced with\n  their alt text rather than a broken link.\n\n+ LaTeX reader improvements:\n\n    - Made latex `\\section`, `\\chapter` parsers more forgiving of whitespace.\n    - Parse `\\chapter{}` in latex.\n    - Changed `rawLaTeXInline` to accept `\\section`, `\\begin`, etc.\n    - Use new `rawLaTeXInline'` in LaTeX reader, and export `rawLaTeXInline`\n      for use in markdown reader.\n    - Fixes bug wherein `\\section{foo}` was not recognized as raw TeX\n      in markdown document.\n\n+ LaTeX writer:  images are automatically shrunk if they would extend\n  beyond the page margin.\n\n+ Plain, markdown, RST writers now use unicode for smart punctuation.\n\n+ Man writer converts math to unicode when possible, as in other writers.\n\n+ `markdown2pdf` can now recognize citeproc options.\n\n+ Command-line arguments are converted to UTF-8. (Issue #234)\n\n+ `Text.Pandoc.TeXMath` has been rewritten to use texmath's parser.\n  This allows it to handle a wider range of formulas. Also, if a formula\n  cannot be converted, it is left in raw TeX; formulas are no longer\n  partially converted.\n\n+ Unicode curly quotes are left alone when parsing smart quotes. (Issue #143)\n\n+ Cabal file changes:\n\n    - Removed parsec < 3 restriction.\n    - Added 'threaded' flag for architectures where GHC lacks a threaded\n      runtime.\n    - Use 'threaded' only for markdown2pdf; it is not needed for pandoc.\n    - Require highlighting-kate 0.2.7.\n\n+ Use explicit imports from `Data.Generics`. Otherwise we have a\n  conflict with the 'empty' symbol, introduced in syb >= 0.2. (Issue #237)\n\n+ New data files:  slidy/slidy.min.js, slidy/slidy.min.css, epub.css.\n\n[EPUB]: http://en.wikipedia.org/wiki/EPUB\n[Slidy]: http://www.w3.org/Talks/Tools/Slidy\n[bookworm]: http://bookworm.oreilly.com/\n[tutorial here]: http://johnmacfarlane.net/pandoc/epub.html\n\n## pandoc  1.5.1.1 (2010-03-29)\n\n+ Fixed header identifiers (uniqueIdent in Shared) so they\n  work as advertized in README and are guaranteed to be\n  valid XHTML names. Thanks to Xyne for reporting the bug.\n\n## pandoc  1.5.1 (2010-03-23)\n\n+ Fixed treatment of unicode characters in URIs.\n+ Revised Setup.hs so it works with debian's build process.\n+ Fixed bug in OpenDocument writer that led to invalid\n  XML for some input.\n\n## pandoc  1.5.0.1 (2010-03-21)\n\n+ HTML writer: Fixed error in math writer (with MathML option)\n  that caused an infinite loop for unparsable MathML.\n\n## pandoc  1.5 (2010-03-20)\n\n+ Moved repository to [github](http://github.com/jgm/pandoc).\n+ New `--mathml` option, for display of TeX math as MathML.\n+ New `--data-dir` option, allowing users to specify a data\n  directory other than `~/.pandoc`.  Files placed in this directory\n  will be used instead of system defaults.\n+ New `--base-header-level` option. For example, `--base-header-level=2`\n  changes level 1 headers to level 2, level 2 to level 3, etc.\n+ New 'plain' output format: plain text without pictures, hyperlinks,\n  inline formatting, or anything else that looks even vaguely\n  markupish.\n+ Titles and authors in title blocks can now span multiple lines,\n  as long as the continuation lines begin with a space character.\n+ When given an absolute URI as a parameter, pandoc will fetch\n  the content via HTTP.\n+ The HTML reader has been made much more forgiving. It no\n  longer requires well-formed xhtml as input.\n+ `html2markdown` has been removed; it is no longer necessary, given\n  the last two changes. `pandoc` can be used by itself to convert\n  web pages to markdown or other formats.\n+ `hsmarkdown` has also been removed.  Use `pandoc --strict` instead.\n  Or symlink pandoc's executable to `hsmarkdown`; `pandoc` will then\n  behave like `hsmarkdown` used to.\n+ An image in a paragraph by itself is now rendered as a figure\n  in most writers, with the alt text as the caption.\n+ Incomplete support for reST tables (simple and grid). Thanks to\n  Eric Kow. Colspans and rowspans not yet supported.\n+ In mediawiki, links with relative URLs are now formatted as wikilinks.\n  Also, headers have been promoted: `= head =` is now level 1 instead of\n  level 2.\n+ The markdown reader now handles \"inverse bird tracks\" when parsing\n  literate haskell.  These are used for haskell example code that\n  is not part of the literate program.\n+ The `-B` and `-A` options now imply `-s` and no longer work in\n  fragment mode.\n+ Headerless tables are now printed properly in all writers.\n  In addition, tbody, thead, and cols are used in HTML and Docbook\n  tables.\n+ Improved build system; removed obsolete Makefile.\n+ In LaTeX writer, `\\chapter` is now used instead of `\\section`.\n  when the documentclass is book, report, or memoir.\n+ Many small bug fixes. See [changelog] for details.\n\n## pandoc  1.4 (2010-01-02)\n\n+ New template system replaces old headers, giving users much\n  more control over pandoc's output in `--standalone` mode.\n  Added `--template` and `--variable` options.  The `--print-default-header`\n  option is now `--print-default-template`.  See README under\n  \"Templates\" for details.\n+ The old `--custom-header` option should still work, but it has\n  been deprecated.\n+ New `--reference-odt` option allows users to customize styles\n  in ODT output.\n+ Users may now put custom templates, s5 styles, and a reference\n  ODT in the `~/.pandoc` directory, where they will override system\n  defaults. See README for details.\n+ Unicode is now used whenever possible in HTML and XML output. Entities\n  are used only where necessary (`&gt;`, `&lt;`, `&quot;`, `&amp;`).\n+ Authors and dates may now include formatting and notes.\n+ Added `--xetex` option for `pandoc` and `markdown2pdf`.\n+ Windows installer now includes highlighting support and\n  `markdown2pdf` and `hsmarkdown` wrappers.\n+ Pandoc no longer requires Template Haskell, which should make\n  it more portable.\n+ Pandoc can now be built on GHC 6.12, as well as earlier versions.\n+ See README for other small improvements and bug fixes.\n\n## pandoc  1.3 (2009-12-10)\n\n+ Added `--id-prefix` option to help prevent duplicate\n  identifiers when you're generating HTML fragments.\n+ Added `--indented-code-classes` option, which specifies\n  default highlighting syntax for indented code blocks.\n+ `--number-sections` now affects HTML output.\n+ Improved syntax for markdown definition lists.\n+ Better looking simple tables.\n+ Markdown tables without headers are now possible.\n+ New hard line break syntax:  backslash followed by newline.\n+ Improved performance of markdown reader by ~10% by eliminating the\n  need for a separate parsing pass for notes.\n+ Improved syntax highlighting for literate Haskell.\n+ Support for \"..code-block\" directive in RST reader.\n+ Windows binary now includes highlighting support.\n+ Many bug fixes and small improvements. See [changelog]\n  for details.\n\n## pandoc  1.2.1 (2009-07-18)\n\n+ Improved the efficiency of the markdown reader's\n  abbreviation parsing (should give a big performance\n  boost with `--smart`).\n+ HTML writer now wraps sections in divs with unique\n  identifiers, for easier manipulation.\n+ Improved LaTeX reader's coverage of math modes.\n+ Added a portable Haskell version of markdown2pdf (thanks\n  to Paolo Tanimoto).\n+ Made `--strict` compatible with `--standalone` and `--toc.`\n+ Many other small improvements and bug fixes.\n  See [changelog] for details.\n\n## pandoc  1.2 (2009-03-01)\n\n+ Added support for literate Haskell. lhs support is triggered by\n  '+lhs' suffixes in formats. For example, 'latex+lhs' is literate\n  Haskell LaTeX. '.lhs' files are treated by default as literate\n  markdown.\n+ Added `--email-obfuscation` option.\n+ Brought citeproc support up to date for citeproc-hs-0.2.\n+ Many bugs fixed. See [changelog] for details.\n\n## pandoc  1.1 (2008-11-06)\n\n+ New `--jsmath` option supporting use of pandoc with [jsMath].\n+ Classes on HTML table output for better CSS styling.\n+ Windows installer no longer requires admin privileges.\n+ Many bugs fixed.  See [changelog] for details.\n\n## pandoc  1.0 (2008-09-13)\n\n+ New writers for MediaWiki, GNU Texinfo (thanks to Peter Wang),\n  OpenDocument XML (thanks to Andrea Rossato), and ODT (OpenOffice\n  document).\n+ New [delimited code blocks](README.html#delimited-code-blocks),\n  with optional syntax highlighting.\n+ Reorganized build system:  pandoc can now be built using standard\n  Cabal tools.  It can be compiled on Windows without Cygwin.\n  The tests can also be run without perl or unix tools.\n+ LaTeXMathML replaces ASCIIMathML for rendering math in HTML.\n+ Support for \"displayed\" math.\n+ Common abbreviations are now handled more intelligently, with\n  a non-breaking space (and not a sentence-ending space) after\n  the period.\n+ Code is -Wall clean.\n+ Many bug fixes and small improvements.  See [changelog] for\n  full details.\n\n## pandoc  0.46 (2008-01-08)\n\n+ Added a `--sanitize-html` option (and a corresponding parameter\n  in `ParserState` for those using the pandoc libraries in programs).\n  This option causes pandoc to sanitize HTML (in HTML or Markdown\n  input) using a whitelist method. Possibly harmful HTML elements\n  are replaced with HTML comments. This should be useful in the\n  context of web applications, where pandoc may be used to convert\n  user input into HTML.\n+ Made -H, -A, and -B options cumulative: if they are specified\n  multiple times, multiple files will be included.\n+ Many bug fixes and small improvements.  See [changelog] for full\n  details.\n\n## pandoc  0.45 (2007-12-09)\n\n+ Many bug fixes and structural improvements.  See [changelog] for\n  full details.\n+ Improved treatment of math. Math is now rendered using unicode\n  by default in HTML, RTF, and DocBook output. For more accurate\n  display of math in HTML, `--gladtex`, `--mimetex`, and `--asciimathml`\n  options are provided. See the [User's Guide](README.html#math) for\n  details.\n+ Removed support for box-style block quotes in markdown.\n+ More idiomatic ConTeXt output.\n+ Text wrapping in ConTeXt and LaTeX output.\n+ Pandoc now correctly handles all standard line endings\n  (CR, LF, CRLF).\n+ New `--no-wrap` option that disables line wrapping and minimizes\n  whitespace in HTML output.\n+ Build process is now compatible with both GHC 6.8 and GHC 6.6.\n  GHC and GHC_PKG environment variables may be used to specify\n  which version of the compiler to use, when multiple versions are\n  installed.\n\n## pandoc 0.44 (2007-09-03)\n\n  [ John MacFarlane ]\n\n  * Fixed bug in HTML writer:  when --toc was used, anchors were put around\n    headers, which is invalid XHTML (block content within inline element).\n    Now the anchors are put inside the header tags.  Resolves Issue #23.\n\n  * Added xmlns attribute to html element in html writer tests.\n    This attribute is added by more recent versions of the\n    xhtml library (>= 3000), and is required for valid XHTML.\n\n  [ Recai Oktaş ]\n\n  * On configure, compile 'Setup.hs' to 'setup' and use 'setup' as the build\n    command instead of 'runhaskell', which, on some platforms (such as s390,\n    alpha, m68k), throws the following error:\n\n        runhaskell Setup.hs configure --prefix=/usr\n        ghc-6.6.1: not built for interactive use\n\n    This causes a serious FTBFS bug.  Closes: #440668.\n\n## pandoc 0.43 (2007-09-02)\n\n  [ John MacFarlane ]\n\n  * The focus of this release is performance.  The markdown parser\n    is about five times faster than in 0.42, based on benchmarks\n    with the TextMate manual.\n\n  * Main.hs: Replaced CRFilter and tabFilter with single function\n    tabFilter, which operates on the whole string rather than breaking\n    it into lines, and handles dos-style line-endings as well as tabs.\n\n  * Added separate LaTeX reader and native reader tests; removed\n    round-trip tests.\n\n  * Text.Pandoc.Shared:\n\n    + Removed tabsToSpaces and tabsInLine (they were used only in Main.hs.)\n    + General code cleanup (to elimante warnings when compiling with -Wall.)\n    + Added 'wrapped' function, which helps wrap text into paragraphs,\n      using the prettyprinting library.\n    + Rewrote charsInBalanced and charsInBalanced'.\n        - Documented restriction: open and close must be distinct characters.\n        - Rearranged options for greater efficiency.\n        - Bug fix: Changed inner call to charsInBalanced inside\n          charsInBalanced' to charsInBalanced'.\n    + anyLine now requires that the line end with a newline (not eof).\n      This is a harmless assumption, since we always add newlines to the\n      end of a block before parsing with anyLine, and it yields a 10% speed\n      boost.\n    + Removed unnecessary 'try' in anyLine.\n    + Removed unneeded 'try' from romanNumeral parser.\n    + Use notFollowedBy instead of notFollowedBy' in charsInBalanced.\n    + Removed unneeded 'try' in parseFromString.\n    + Removed unneeded 'try' from stringAnyCase.  (Now it behaves\n      like 'string'.)\n    + Changed definition of 'enclosed' in Text.Pandoc.Shared so that\n      'try' is not automatically applied to the 'end' parser. Added\n      'try' in calls to 'enclosed' where needed. Slight speed increase.\n\n  * Writers:\n\n    + Replaced individual wrapping routines in RST, Man, and Markdown\n      writers with 'wrapped' from Text.Pandoc.Shared.\n    + Rewrote LaTeX writer to use the prettyprinting library,\n      so we get word wrapping, etc.\n    + Modified latex writer tests for new latex writer using prettyprinter.\n    + Fixed bug in LaTeX writer: autolinks would not cause\n      `\\usepackage{url}` to be put in the document header. Also, changes\n      to state in enumerated list items would be overwritten.\n    + In Markdown writer, escape paragraphs that begin with ordered list\n      markers, so they don't get interpreted as ordered lists.\n\n  * Text.Pandoc.Reades.LaTeX:\n\n    + Fixed bug in LaTeX reader, which wrongly assumed that the roman\n      numeral after \"enum\" in \"setcounter\" would consist entirely of\n      \"i\"s. 'enumiv' is legitimate.\n    + LaTeX command and environment names can't contain numbers.\n    + Rearranged order of parsers in inline for slight speed improvement.\n    + Added '`' to special characters and 'unescapedChar'.\n\n  * Text.Pandoc.Readers.RST:\n\n    + Removed unneeded try's in RST reader; also minor code cleanup.\n    + Removed tabchar.\n    + Rearranged parsers in inline (doubled speed).\n\n  * Text.Pandoc.Readers.Markdown:\n\n    + Skip notes parsing if running in strict mode. (This yields a nice\n      speed improvement in strict mode.)\n    + Simplify autolink parsing code, using Network.URI to test for\n      URIs. Added dependency on network library to debian/control and\n      pandoc.cabal.\n    + More perspicuous definition of nonindentSpaces.\n    + Removed unneeded 'try' in 'rawLine'.\n    + Combined linebreak and whitespace into a new whitespace parser, to\n      avoid unnecessary reparsing of space characters.\n    + Removed unnecessary 'try' in 'codeBlock', 'ellipses', 'noteMarker',\n      'multilineRow', 'dashedLine', 'rawHtmlBlocks'.\n    + Use lookAhead in parsers for setext headers and definition lists\n      to see if the next line begins appropriately; if not, don't waste\n      any more time parsing.\n    + Don't require blank lines after code block. (It's sufficient to\n      end code block with a nonindented line.)\n    + Changed definition of 'emph': italics with '_' must not\n      be followed by an alphanumeric character. This is to help\n      prevent interpretation of e.g. `[LC_TYPE]: my_type` as\n      `[LC<em>TYPE]:my</em>type`.\n    + Improved Markdown.pl-compatibility in referenceLink: the two parts\n      of a reference-style link may be separated by one space, but not\n      more... [a] [link], [not]    [a link].\n    + Fixed markdown inline code parsing so it better accords with\n      Markdown.pl: the marker for the end of the code section is a clump\n      of the same number of `'s with which the section began, followed\n      by a non-` character. So, for example,\n         ` h ``` i ` -> `<code>h ``` i</code>`.\n    + Split 'title' into 'linkTitle' and 'referenceTitle', since the\n      rules are slightly different.\n    + Rewrote 'para' for greater efficiency.\n    + Rewrote link parsers for greater efficiency.\n    + Removed redundant 'referenceLink' in definition of inline (it's\n      already in 'link').\n    + Refactored escapeChar so it doesn't need 'try'.\n    + Refactored hrule for performance in Markdown reader.\n    + More intelligent rearranging of 'inline' so that most frequently\n      used parsers are tried first.\n    + Removed tabchar parser, as whitespace handles tabs anyway.\n\n  * Text.Pandoc.CharacterReferences:\n\n    + Refactored.\n    + Removed unnecessary 'try's for a speed improvement.\n    + Removed unnecessary '&' and ';' from the entity table.\n\n  * Build process:\n\n    + Makefile: Get VERSION from cabal file, not Main.hs.\n    + Modified MacPorts Portfile:\n        - Depend on haddock\n        - Build and install libraries and library documentation in\n          addition to pandoc executable\n        - Added template item for md5 sum in Portfile.in.\n        - Incorporated changes from MacPorts repository (r28278).\n    + FreeBSD port:  Don't try to generate distinfo in Makefile.\n      It can be made using 'make makesum' in FreeBSD.\n    + Make both freebsd and macports targets depend on tarball.\n\n  * Website and documentation:\n\n    + Updated INSTALL instructions.\n    + Added pandocwiki demo to website.\n    + Removed local references to Portfile, since pandoc is now in the\n      MacPorts repository.\n\n## pandoc 0.42 (2007-08-26)\n\n  [ John MacFarlane ]\n\n  * Main.hs: Use utf8 conversion on the extra files loaded with\n    the -H, -C, -B, and -A options.  This fixes problems with unicode\n    characters in these files.\n\n  * Exposed Text.Pandoc.ASCIIMathML, since it is imported in\n    Text.Pandoc.Readers.HTML and without it we get a linking error when\n    using the library.\n\n  * Markdown reader:\n\n    + Added new rule for enhanced markdown ordered lists: if the list\n      marker is a capital letter followed by a period (including a\n      single-letter capital roman numeral), then it must be followed by\n      at least two spaces. The point of this is to avoid accidentally\n      treating people's initials as list markers: a paragraph might begin,\n      \"B. Russell was an English philosopher,\" and this shouldn't be\n      treated as a list.  Documented change in README.\n    + Blocks that start with \"p. \" and a digit are no longer treated\n      as ordered lists (it's a page number).\n    + Added a needed 'try' to listItem.\n    + Removed check for a following setext header in endline.\n      A full test is too inefficient (doubles benchmark time), and the\n      substitute we had before is not 100% accurate.\n    + Don't use Code elements for autolinks if --strict specified.\n\n  * LaTeX writer:  When a footnote ends with a Verbatim environment, the\n    close } of the footnote cannot occur on the same line or an error occurs.\n    Fixed this by adding a newline before the closing } of every footnote.\n\n  * HTML writer:\n    + Removed incorrect \"{}\" around style information in HTML tables.\n      Column widths now work properly in HTML.\n    + If --strict option is specified (and --toc is not), don't include\n      identifiers in headers, for better Markdown compatibility.\n\n  * Build process:\n\n    + Separated $(web_dest) and website targets.\n    + In website, index.txt is now constructed from template index.txt.in.\n    + Added freebsd target to Markefile. This creates the freebsd Makefile\n      from Makefile.in, and creates distinfo.  Removed Makefile and distinfo\n      from the repository.\n    + Added macport target to Makefile. Portfile is built from template\n      Portfile.in.\n    + Removed OSX package targets.  (Too many difficulties involving\n      dependencies on dynamic libraries.)\n    + More complete INSTALL instructions for all architectures.\n\n  * Website:\n    + Added a programming demo, pandocwiki.\n\n  [ Recai Oktaş ]\n\n  * Do not forget to close pandoc's ITP.  Closes: #391666\n\n## pandoc 0.41 (2007-08-19)\n\n  [ John MacFarlane ]\n\n  * Fixed bugs in HTML reader:\n    + Skip material at end *only if* `</html>` is present (previously,\n      only part of the document would be parsed if an error was\n      found; now a proper error message is given).\n    + Added new constant eitherBlockOrInline with elements that may\n      count either as block-level or as inline. Modified isInline and\n      isBlock to take this into account.\n    + Modified rawHtmlBlock to accept any tag (even an inline tag):\n      this is innocuous, because rawHtmlBlock is tried only if a regular\n      inline element can't be parsed.\n    + Added a necessary 'try' in definition of 'para'.\n\n  * Fixed bug in markdown ordered list parsing.  The problem was that\n    anyOrderedListStart did not check for a space following the\n    ordered list marker.  So in 'A.B. 2007' the parser would be\n    expecting a list item, but would not find one, causing an error.\n    Fixed a similar bug in the RST reader.  Resolves Issue #22.\n\n  * Refactored RST and Markdown readers using parseFromString.\n\n  * LaTeX reader will now skip anything after \\end{document}.\n\n  * Fixed blockquote output in markdown writer: previously, block\n    quotes in indented contexts would be indented only in the first\n    line.\n\n  * Added note to INSTALL about variations in versions of the xhtml\n    library that can lead to failed tests (thanks to Leif LeBaron).\n\n## pandoc 0.4 (2007-01-16)\n\n  [ John MacFarlane ]\n\n  * Added two new output formats: groff man pages and ConTeXt. By\n    default, output files with extensions \".ctx\" and \".context\" are\n    assumed to be ConTeXt, and output files with single-digit extensions\n    are assumed to be man pages.\n\n  * Enhanced ordered lists (documented in README, under Lists):\n    + The OrderedList block element now stores information about\n      list number style, list number delimiter, and starting number.\n    + The readers parse this information when possible.\n    + The writers use this information to style ordered lists.\n    + The enhancement can be disabled using the --strict option.\n\n  * Added support for tables (with a new Table block element). Two kinds\n    of tables are supported: a simple table with one-line rows, and a\n    more complex variety with multiline rows. All output formats are\n    supported, but only markdown tables are parsed at the moment. The\n    syntax is documented in README.\n\n  * Added support for definition lists (with a new DefinitionList block\n    element). All output and input formats are supported. The syntax is\n    documented in README.\n\n  * Added support for superscripts and subscripts (with new Superscript\n    and Subscript inline elements).  All input and output\n    formats.  The syntax is documented in README.\n\n  * Added support for strikeout (with a new Strikeout inline element).\n    All input and output formats are supported. Thanks to Bradley Kuhn,\n    who contributed a patch. The syntax is documented in README. Resolves\n    Issue #18.\n\n  * Added a --toc|--table-of-contents option.  This causes an automatically\n    generated table of contents (or an instruction that creates one) to\n    be inserted at the beginning of the document. Not supported in S5,\n    DocBook, or man page writers.\n\n  * Modified the -m|--asciimathml option:\n\n    + If an optional URL argument is provided, a link is inserted\n      instead of the contents of the ASCIIMathML.js script.\n    + Nothing is inserted unless the document actually contains\n      LaTeX math.\n\n  * Removed Blank block element as unnecessary.\n\n  * Removed Key and Note blocks from the Pandoc data structure. All\n    links are now stored as explicit links, and note contents are\n    stored with the (inline) notes.\n\n    + All link Targets are now explicit (URL, title) pairs; there\n      is no longer a 'Ref' target.\n    + Markdown and RST parsers now need to extract data from key and\n      note blocks and insert them into the relevant inline elements.\n      Other parsers have been simplified, since there is no longer any need\n      to construct separate key and note blocks.\n    + Markdown, RST, and HTML writers need to construct lists of\n      notes; Markdown and RST writers need to construct lists of link\n      references (when the --reference-links option is specified); and\n      the RST writer needs to construct a list of image substitution\n      references. All writers have been rewritten to use the State monad\n      when state is required.\n    + Several functions (generateReference, keyTable,\n      replaceReferenceLinks, replaceRefLinksBlockList, and some auxiliaries\n      used by them) have been removed from Text.Pandoc.Shared, since\n      they are no longer needed. New functions and data structures\n      (Reference, isNoteBlock, isKeyBlock, isLineClump) have been\n      added. The functions inTags, selfClosingTag, inTagsSimple, and\n      inTagsIndented have been moved to the DocBook writer, since that\n      is now the only module that uses them. NoteTable is now exported\n      in Text.Pandoc.Shared.\n    + Added stateKeys and stateNotes to ParserState; removed stateKeyBlocks,\n      stateKeysUsed, stateNoteBlocks, stateNoteIdentifiers, stateInlineLinks.\n    + Added writerNotes and writerReferenceLinks to WriterOptions.\n\n  * Added Text.Pandoc module that exports basic readers, writers,\n    definitions, and utility functions. This should export everything\n    needed for most uses of Pandoc libraries. The haddock documentation\n    includes a short example program.\n\n  * Text.Pandoc.ASCIIMathML is no longer an exported module.\n\n  * Added Text.Pandoc.Blocks module to help in printing markdown\n    and RST tables.  This module provides functions for working with\n    fixed-width blocks of text--e.g., placing them side by side, as\n    in a table row.\n\n  * Refactored to avoid reliance on Haskell's Text.Regex library, which\n    (a) is slow, and (b) does not properly handle unicode.  This fixed\n    some strange bugs, e.g. in parsing S-cedilla, and improved performance.\n\n    + Replaced 'gsub' with a general list function  'substitute'\n      that does not rely on Text.Regex.\n    + Rewrote extractTagType in HTML reader so that it doesn't use\n      regexs.\n    + In Markdown reader, replaced email regex test with a custom email\n      autolink parser (autoLinkEmail). Also replaced selfClosingTag regex\n      with a custom function isSelfClosingTag.\n    + Modified Docbook writer so that it doesn't rely on Text.Regex for\n      detecting 'mailto' links.\n    + Removed escapePreservingRegex and reamped entity-handling\n      functions in Text.Pandoc.Shared and Text.Pandoc.CharacterReferences to\n      avoid reliance on Text.Regex (see below on character reference\n      handling changes).\n\n  * Renamed Text.Pandoc.Entities as Text.Pandoc.CharacterReferences.\n\n  * Changed handling of XML entities.  Entities are now parsed (and unicode\n    characters returned) in the Markdown and HTML readers, rather than being\n    handled in the writers.  In HTML and Docbook writers, UTF-8 is now used\n    instead of entities for characters above 128.  This makes the HTML and\n    DocBook output much more readable and more easily editable.\n\n    + Removed sgmlHexEntity, sgmlDecimalEntity, sgmlNamedEntity, and\n      sgmlCharacterEntity regexes from Text.Pandoc.Shared.\n    + Renamed escapeSGMLChar to escapeCharForXML.  Added escapeStringForXML.\n      Moved both functions to Text.Pandoc.Writers.Docbook.\n    + Added characterReference parser to Text.Pandoc.CharacterReferences.\n      This parses a string and return a unicode character.\n    + Rewrote decodeCharacterReferences to use the new parser instead of\n      Text.Regex.\n    + Added new charRef parser for Markdown and HTML, which replaces the\n      old 'entity' parser. Added '&' as a special character in Markdown reader.\n    + Modified HTML and Markdown readers to call decodeEntities on all raw\n      strings (e.g. authors, dates, link titles), to ensure that no\n      unprocessed entities are included in the native representation of\n      the document.  (In the HTML reader, most of this work is done by a\n      change in extractAttributeName.)\n    + In XML and Markdown output, escape unicode nonbreaking space as '&nbsp;',\n      since a unicode non-breaking space is impossible to distinguish visually\n      from a regular space.  (Resolves Issue #3.)\n    + Removed encodeEntitiesNumerical.\n    + Use Data.Map for entityTable and (new) reverseEntityTable, for a\n      slight performance boost over the old association list.\n    + Removed unneeded decodeEntities from 'str' parser in HTML and\n      Markdown readers.\n\n  * Text.Pandoc.UTF8:  Renamed encodeUTF8 to toUTF8, decodeUTF8 to\n    fromUTF8, for clarity.\n\n  * Replaced old haskell98 module names replaced by hierarchical module\n    names, e.g. List by Data.List.  Removed haskell98 from dependencies\n    in pandoc.cabal, and added mtl (needed for state monad). Substituted\n    xhtml for html.\n\n  * Refactored and cleaned up character escaping in writers, using\n    backslashEscapes and escapeStringUsing functions.\n\n  * Instead of adding `\\n\\n` to the end of an input string in Main.hs,\n    this is now done in the readers. This makes the libraries behave\n    the way you'd expect from the pandoc program. Resolves Issue #10.\n\n  * URLs and email addresses in autolinks are now typeset as Code.\n\n  * In Main.hs, changed putStr to putStrLn -- mainly because MacOS X\n    doesn't display the whole output unless there's a line ending.\n\n  * Major code cleanup in all modules, for greater consistency, concision,\n    and readability.\n\n  * HTML reader:\n\n    + Fixed several bugs (extractTagType, attribute parsing).\n    + Remove Null blocks in lists of blocks when possible.\n    + Allow HTML comments as raw HTML inline.\n\n  * Markdown reader:\n\n    + Ordered list items may no longer begin with uppercase letters, or\n      letters greater than 'n'.  (This prevents first initials and page\n      reference, e.g. 'p. 400', from being parsed as beginning lists.)\n      Also, numbers beginning list items may no longer end with ')',\n      which is now allowed only after letters.  Note: These changes\n      may cause documents to be parsed differently. Users should take\n      care in upgrading.\n    + Changed autoLink parsing to conform better to Markdown.pl's\n      behavior. `<google.com>` is not treated as a link, but\n      `<http://google.com>`, `<ftp://google.com>`, and\n      `<mailto:google@google.com>` are.\n    + Cleaned up handling of embedded quotes in link titles.  Now these are\n      stored as a '\"' character, not as '&quot;'.\n    + Use lookAhead parser for the 'first pass' (looking for reference keys),\n      instead of parsing normally, then using setInput to reset input.  This\n      yields a slight performance boost.\n    + Fixed several bugs in smart quote recognition.\n    + Fixed bug in indentSpaces (which didn't properly handle\n      cases with mixed spaces and tabs).\n    + Consolidated 'text', 'special', and 'inline' into 'inline'.\n    + Fixed bug which allowed URL and title to be separated by multiple blank\n      lines in links and reference keys.  They can be on separate lines but\n      can't have blank lines between them.\n    + Correctly handle bracketed text inside inline footnotes and links,using\n      new function inlinesInBalanced.  Resolves Issue #14.\n    + Fixed bug in footnotes: links in footnotes were not being\n      processed. Solution: three-stage parse. First, get all the\n      reference keys and add information to state. Next, get all the\n      notes and add information to state. (Reference keys may be needed\n      at this stage.) Finally, parse everything else.\n    + Replaced named constants like 'emphStart' with literals.\n    + Removed an extra occurrence of escapedChar in definition of inline.\n\n  * RST reader:\n\n    + Allow the URI in a RST hyperlink target to start on the line\n      after the reference key.\n    + Added 'try' in front of 'string', where needed, or used a different\n      parser.  This fixes a bug where ````` would not be correctly parsed as\n      a verbatim `.\n    + Fixed slow performance in parsing inline literals in RST reader.  The\n      problem was that ``#`` was seen by 'inline' as a potential link or image.\n      Fix:  inserted 'notFollowedBy (char '`')' in link parsers.\n      Resolves Issue #8.\n    + Use lookAhead instead of getInput/setInput in RST reader.  Removed\n      unneeded getState call, since lookAhead automatically saves and\n      restores the parser state.\n    + Allow hyperlink target URIs to be split over multiple lines, and\n      to start on the line after the reference. Resolves Issue #7.\n    + Fixed handling of autolinks.\n\n  * LaTeX reader:\n\n    + Replaced `choice [(try (string ...), ...]` idiom with `oneOfStrings`,\n      for clarity.\n    + Added clauses for tilde and caret. Tilde is `\\ensuremath{\\sim}`, and\n      caret is `\\^{}`, not `\\^` as before.\n    + Added parsing for `\\url`.\n    + Parse `\\texttt{}` as code, provided there's nothing fancy inside.\n\n  * HTML writer:\n\n    + Modified HTML writer to use the Text.XHtml library. This results\n      in cleaner, faster code, and it makes it easier to use Pandoc in\n      other projects, like wikis, which use Text.XHtml. Two functions are\n      now provided, writeHtml and writeHtmlString: the former outputs an\n      Html structure, the latter a rendered string. The S5 writer is also\n      changed, in parallel ways (writeS5, writeS5String).\n    + The Html header is now written programmatically, so it has been\n      removed from the 'headers' directory. The S5 header is still\n      needed, but the doctype and some of the meta declarations have\n      been removed, since they are written programmatically. This change\n      introduces a new dependency on the xhtml package.\n    + Fixed two bugs in email obfuscation involving improper escaping\n      of '&' in the `<noscript>` section and in `--strict` mode. Resolves\n      Issue #9.\n    + Fixed another bug in email obfuscation: If the text to be obfuscated\n      contains an entity, this needs to be decoded before obfuscation.\n      Thanks to thsutton for the patch. Resolves Issue #15.\n    + Changed the way the backlink is displayed in HTML footnotes.\n      Instead of appearing on a line by itself, it now generally\n      appears on the last line of the note.  (Exception:  when the\n      note does not end with a Plain or Para block.) This saves space\n      and looks better.\n    + Added automatic unique identifiers to headers:\n      - The identifier is derived from the header via a scheme\n        documented in README.\n      - WriterState now includes a list of header identifiers and a table\n        of contents in addition to notes.\n      - The function uniqueIdentifiers creates a list of unique identifiers\n        from a list of inline lists (e.g. headers).\n      - This list is part of WriterState and gets consumed by blockToHtml\n        each time a header is encountered.\n    + Include CSS for .strikethrough class in header only if strikethrough\n      text appears in the document.\n    + If the 'strict' option is specified, elements that do not appear in\n      standard markdown (like definition lists) are passed through as\n      raw HTML.\n    + Simplified treatment of autolinks, using pattern matching instead of\n      conditionals.\n\n  * Markdown writer:\n\n    + Links in markdown output are now printed as inline links by default,\n      rather than reference links.  A --reference-links option has been added\n      that forces links to be printed as reference links.  Resolves Issue #4.\n    + Use autolinks when possible.  Instead of `[site.com](site.com)`,\n      use `<site.com>`.\n\n  * LaTeX writer:\n\n    + Rewrote to use the State monad. The preamble now includes only those\n      packages that are actually required, given the document's content.\n      Thus, for example, if strikeout is not used, ulem is not required.\n      Modified LaTeXHeader accordingly.\n    + Modified LaTeX writer to insert `\\,` between consecutive quotes.\n    + Removed unused function tableRowColumnWidths.\n    + Simplified code for escaping special characters.\n    + Leave extra blank line after `\\maketitle`.\n    + Include empty `\\author{}` when no author specified to avoid LaTeX\n      errors.\n    + Include fancyvrb code in header only if needed -- that is, only\n      if there is actually code in a footnote.\n    + Use `\\url{}` for autolinks.\n    + Include [mathletters] option in ucs package, so that basic unicode\n      Greek letters will work correctly.\n\n  * RST writer:  Force blank line before lists, so that sublists will\n    be handled correctly.\n\n  * Docbook writer:  Fixed a bug:  email links with text, like\n    [foo](me@bar.baz), were being incorrectly treated as autolinks.\n\n  * Removed Text.ParserCombinators.Pandoc and moved all its functions to\n    Text.Pandoc.Shared.\n\n  * Text.Pandoc.Shared:\n\n    + Added defaultWriterOptions.\n    + Added writerTableOfContents to WriterOptions.\n    + Added writerIgnoreNotes option to WriterOptions.  This is needed\n      for processing header blocks for a table of contents, since notes on\n      headers should not appear in the TOC.\n    + Added prettyprinting for native Table format.\n    + Removed some unneeded imports.\n    + Moved escape and nullBlock parsers from\n      Text.ParserCombinators.Pandoc, since the latter is for\n      general-purpose parsers that don't depend on Text.Pandoc.Definition.\n    + Moved isHeaderBlock from Text.Pandoc.Writers.HTML.\n    + Moved Element, headerAtLeast, and hierarchicalize from Docbook\n      writer, because HTML writer now uses these in constructing a table\n      of contents.\n    + Added clauses for new inline elements (Strikeout, Superscript,\n      Subscript) to refsMatch.\n    + Removed backslashEscape; added new functions escapeStringUsing and\n      backslashEscapes.\n    + Moved failIfStrict from markdown reader, since it is now used also\n      by the HTML reader.\n    + Added a 'try' to the definition of indentSpaces.\n    + In definition of 'reference', added check to make sure it's not a note\n      reference.\n    + Added functions: camelCaseToHyphenated, toRomanNumeral,\n      anyOrderedListMarker, orderedListmarker, orderedListMarkers,\n      charsInBalanced', withHorizDisplacement, romanNumeral\n    + Fixed a bug in the anyLine parser. Previously it would parse an empty\n      string \"\", but it should fail on an empty string, or we get an error\n      when it is used inside \"many\" combinators.\n    + Removed followedBy' parser, replacing it with the lookAhead parser from\n      Parsec.\n    + Added some needed 'try's before multicharacter parsers, especially in\n      'option' contexts.\n    + Removed the 'try' from the 'end' parser in 'enclosed', so that\n      'enclosed' behaves like 'option', 'manyTill', etc.\n    + Added lineClump parser, which parses a raw line block up to and\n      including any following blank lines.\n    + Renamed parseFromStr to parseFromString.\n    + Added a 'try' to the 'end' parser in 'enclosed'.  This makes errors in\n      the use of 'enclosed' less likely. Removed some now-unnecessary 'try's\n      in calling code.\n    + Removed unneeded 'try' in blanklines.\n    + Removed endsWith function and rewrote calling functions to use\n      isSuffixOf instead.\n    + Added >>~ combinator.\n    + Fixed bug in normalizeSpaces:  Space:Str \"\":Space should compress to\n      Space.\n\n  * Refactored runtests.pl; added separate tests for tables.\n\n  * Shell scripts:\n\n    + Added -asxhtml flag to tidy in html2markdown. This will\n      perhaps help the parser, which expects closing tags.\n    + Modified markdown2pdf to run pdflatex a second time if --toc or\n      --table-of-contents was specified; otherwise the table of\n      contents won't appear.\n    + Modified markdown2pdf to print a helpful message if the 'ulem'\n      LaTeX package is required and not found.\n\n  * Changes to build process:\n\n    + Dropped support for compilation with GHC 6.4.  GHC 6.6 or higher\n      is now required.\n    + Removed cabalize and Pandoc.cabal.in. The repository now contains\n      pandoc.cabal itself.\n    + Pandoc.cabal has been changed to pandoc.cabal, because HackageDB\n      likes the cabal file to have the same name as the tarball.\n    + Expanded and revised the package description in pandoc.cabal.\n      Revised the package synopsis.\n    + The tarball built by 'make tarball' now contains files built from\n      templates (including man pages and shell scripts), so pandoc can\n      be built directly using Cabal tools, without preprocessing.\n    + Executable binaries are now stripped before installing.\n    + Man pages are now generated from markdown sources, using pandoc's\n      man page writer.\n    + Use HTML version of README (instead of RTF) in Mac OS X installer.\n    + Instead of testing for the existence of a pandoc symlink in build-exec,\n      use ln -f.\n\n  * Documentation:\n\n    + Updated README and man pages with information on new features.\n    + Updated INSTALL instructions with some useful clarifications and\n      links.\n    + Updated web content.\n\n  * Added FreeBSD port.\n\n  [ Recai Oktaş ]\n\n  * debian/control:\n\n    + Changed pandoc's Build-Depends to include libghc6-mtl-dev and\n      libghc6-xhtml-dev.  Removed libghc6-html-dev.\n    + Suggest texlive-latex-recommended | tetex-extra instead of\n      tetex-bin.  This brings in fancyvrb and unicode support.\n\n\n## pandoc 0.3 (2007-01-05)\n\n  [ John MacFarlane ]\n\n  * Changes in pandoc options:\n\n    + Allow options to follow or precede arguments.\n    + Changed '--smartypants' to '--smart' and adjusted symbols accordingly.\n    + Added '--strict' option.\n    + Added '-o/--output' option.\n    + Added '--dump-args' and '--ignore-args' options (for use in wrappers).\n    + Modified '-v' and '-h' output to go to STDERR, not STDOUT, and return\n      error conditions.  This is helpful for writing wrappers.\n    + Added copyright message to '-v' output, modeled after FSF messages.\n    + Reformatted usage message so that it doesn't wrap illegibly.\n    + Removed extra blanks after '-h' and '-D' output.\n\n  * Added docbook writer.\n\n  * Added implicit setting of default input and output format based\n    on input and output filename extensions.  These defaults are\n    overridden if explicit input and output formats are specified using\n    '-t', '-f', '-r', or '-w' options.  Documented in pandoc(1) man page\n    and README.\n\n  * Allow ordered list items to begin with (single) letters, as well\n    as numbers.  The list item marker may now be terminated either by\n    '.' or by ')'.  This extension to standard markdown is documented\n    in README.\n\n  * Revised footnote syntax.  (See README for full details.)  The\n    '[^1]' format now standard in markdown extensions is supported,\n    as are inline footnotes with this syntax: `^[My note.]`.\n    The earlier footnote syntax `^(1)` is no longer supported.\n\n  * Improved HTML representation of footnotes.  All footnotes\n    are now auto-numbered and appear in an ordered list at the\n    end of the HTML document.  Since the default appearance is now\n    acceptable, the old footnote styles have been removed from the\n    HTML header.\n\n  * Bug fixes:\n\n    + Fixed a serious bug in the markdown, LaTeX, and RST readers.\n      These readers ran 'runParser' on processed chunks of text to handle\n      embedded block lists in lists and quotation blocks.  But then\n      any changes made to the parser state in these chunks was lost,\n      as the state is local to the parser.  So, for example, footnotes\n      didn't work in quotes or list items.  The fix:  instead of calling\n      runParser on some raw text, use setInput to make it the input, then\n      parse it, then use setInput to restore the input to what it was\n      before.  This is shorter and more elegant, and it fixes the problem.\n    + Fixed bug in notFollowedBy' combinator (adding 'try' before\n      'parser').  Adjusted code that uses this combinator accordingly.\n    + Fixed bug in RTF writer that caused improper indentation on\n      footnotes occurring in indented blocks like lists.\n    + Fixed parsing of metadata in LaTeX reader.  Now the title, author,\n      and date are parsed correctly.  Everything else in the preamble\n      is skipped.\n    + Modified escapedChar in LaTeX reader to allow a `\\` at the end of a\n      line to count as escaped whitespace.\n    + Modified LaTeX reader to produce inline links rather than reference\n      links.  Otherwise, links in footnotes aren't handled properly.\n    + Fixed handling of titles in links in Markdown reader, so that\n      embedded quotation marks are now handled properly.\n    + Fixed Markdown reader's handling of embedded brackets in links.\n    + Fixed Markdown reader so that it only parses bracketed material\n      as a reference link if there is actually a corresponding key.\n    + Revised inline code parsing in Markdown reader to conform to\n      markdown standard.  Now any number of `s can begin inline code,\n      which will end with the same number of `s.  For example, to\n      have two backticks as code, write ``` `` ```.  Modified Markdown\n      writer accordingly.\n    + Fixed bug in text-wrapping routine in Markdown and RST writers.\n      Now LineBreaks no longer cause wrapping problems.\n    + Supported hexadecimal numerical entity references as well as\n      decimal ones.\n    + Fixed bug in Markdown reader's handling of underscores and other\n      inline formatting markers inside reference labels:  for example,\n      in '[A_B]: /url/a_b', the material between underscores was being\n      parsed as emphasized inlines.\n    + Changed Markdown reader's handling of backslash escapes so that\n      only non-alphanumeric characters can be escaped.  Strict mode\n      follows Markdown.pl in only allowing a select group of punctuation\n      characters to be escaped.\n    + Modified HTML reader to skip a newline following a `<br>` tag.\n      Otherwise the newline will be treated as a space at the beginning\n      of the next line.\n\n  * Made handling of code blocks more consistent.  Previously, some\n    readers allowed trailing newlines, while others stripped them.\n    Now, all readers strip trailing newlines in code blocks. Writers\n    insert a newline at the end of code blocks as needed.\n\n  * Modified readers to make spacing at the end of output more consistent.\n\n  * Minor improvements to LaTeX reader:\n\n    + `\\thanks` now treated like a footnote.\n    + Simplified parsing of LaTeX command arguments and options.\n      commandArgs now returns a list of arguments OR options (in\n      whatever order they appear).  The brackets are included, and\n      a new stripFirstAndLast function is provided to strip them off\n      when needed.  This fixes a problem in dealing with \\newcommand\n      and \\newenvironment.\n\n  * Revised RTF writer:\n\n    + Default font is now Helvetica.\n    + An `\\f0` is added to each `\\pard`, so that font resizing works\n      correctly.\n\n  * Moved handling of \"smart typography\" from the writers to the Markdown\n    and LaTeX readers.  This allows great simplification of the writers\n    and more accurate smart quotes, dashes, and ellipses.  DocBook can\n    now use `<quote>`.  The '--smart' option now toggles an option in\n    the parser state rather than a writer option.  Several new kinds\n    of inline elements have been added: Quoted, Ellipses, Apostrophe,\n    EmDash, EnDash.\n\n  * Changes in HTML writer:\n\n    + Include title block in header even when title is null.\n    + Made javascript obfuscation of emails even more obfuscatory,\n      by combining it with entity obfuscation.\n\n  * Changed default ASCIIMathML text color to black.\n\n  * Test suite:\n\n    + Added --strip-trailing-cr option to diff in runtests.pl, for\n      compatibility with Windows.\n    + Added regression tests with footnotes in quote blocks and lists.\n\n  * Makefile changes:\n\n    + osx-pkg target creates a Mac OS X package (directory). New osx\n      directory contains files needed for construction of the package.\n    + osx-dmg target creates a compressed disk image containing the package.\n    + win-pkg target creates Windows binary package.\n    + tarball target creates distribution source tarball.\n    + website target generates pandoc's website automatically, including\n      demos.  New 'web' directory contains files needed for construction\n      of the website (which will be created as the 'pandoc' subdirectory\n      of 'web').\n    + Makefile checks to see if we're running Windows/Cygwin; if so,\n      a '.exe' extension is added to each executable in EXECS.\n\n  * Removed all wrappers except markdown2pdf and html2markdown.\n\n  * Added new wrapper hsmarkdown, to be used as a drop-in replacement\n    for Markdown.pl.  hsmarkdown calls pandoc with the '--strict'\n    option and disables other options.\n\n  * Added code to html2markdown that tries to determine the character\n    encoding of an HTML file, by parsing the \"Content-type\" meta tag.\n\n    + If the encoding can't be determined, then if the content is local,\n      the local encoding is used; if it comes from a URL, UTF-8 is used\n      by default.\n    + If input is from STDIN, don't try to determine character encoding.\n    + Encoding can be specified explicitly using '-e' option.\n\n  * Improved warning messages in wrappers:\n\n    + Print warning if iconv not available\n    + More user-friendly error messages in markdown2pdf, when\n      pdflatex fails.\n\n  * Code cleanup:\n\n    + Renamed 'Text/Pandoc/HtmlEntities' module to\n      'Text/Pandoc/Entities'. Also changed function names so as\n      not to be HTML-specific.\n    + Refactored SGML string escaping functions from HTML and Docbook\n      writers into Text/Pandoc/Shared.  (escapeSGML, stringToSGML)\n    + Removed 'BlockQuoteContext' from ParserContext, as it isn't\n      used anywhere.\n    + Removed splitBySpace and replaced it with a general, polymorphic\n      splitBy function.\n    + Refactored LaTeX reader for clarity (added isArg function).\n    + Converted some CR's to LF's in src/ui/default/print.css.\n    + Added license text to top of source files.\n    + Added module data for haddock to source files.\n    + Reformatted code for consistency.\n\n  * Rewrote documentation and man pages.  Split README into INSTALL\n    and README.\n\n  * Split LICENSE into COPYING and COPYRIGHT.\n\n  * Removed TODO, since we now maintain ToDo on the wiki.\n\n  * Made COPYRIGHT in top level a symlink to debian/copyright, to avoid\n    duplication.\n\n  [ Recai Oktaş ]\n\n  * Revamped build process to conform to debian standards and created\n    a proper debian package.  Closes: #391666.\n\n  * Modified build process to support GHC 6.6.\n\n    + The package can still be compiled using GHC 6.4.2, though because\n      of dependencies the \"make deb\" target works only with GHC 6.6+.\n    + The script 'cabalize' is used to create an appropriate\n      'Pandoc.cabal' from 'Pandoc.cabal.in', depending on the GHC and\n      Cabal versions.\n\n  * Refactored template processing (fillTemplates.pl).\n\n  * Modified wrapper scripts to make them more robust and portable.\n    To avoid code duplication and ensure consistency, wrappers are\n    generated via a templating system from templates in src/wrappers.\n\n    + Wrappers now accept multiple filenames, when appropriate.\n    + Spaces and tabs allowed in filenames.\n    + getopts shell builtin is used for portable option parsing.\n    + Improved html2markdown's web grabber code, making it more robust,\n      configurable and verbose.  Added '-e', '-g' options.\n\n\n## pandoc 0.2 (2006-08-14)\n\n  * Fixed unicode/utf-8 translation\n\n## pandoc 0.1 (2006-08-14)\n\n  * Initial creation of debian package\n\n"
  },
  {
    "path": "citeproc/biblatex-localization/.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/UKenglish.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/USenglish.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/american.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/australian.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/austrian.lbx.strings",
    "content": "january|J\\\"anner|J\\\"an\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/brazil.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/brazilian.lbx.strings",
    "content": "bibliography|Bibliografia|Bibliografia\nreferences|Refer\\^encias|Refer\\^encias\nshorthands|Lista de abreviaturas|Abreviaturas\neditor|editor|ed\\adddot\neditors|editores|ed\\adddot\ncompiler|compilador|comp\\adddot\ncompilers|compiladores|comp\\adddot\nredactor|redator|red\\adddot\nredactors|redatores|red\\adddot\nreviser|revisor|rev\\adddot\nrevisers|revisores|rev\\adddot\nfounder|fundador|fund\\adddot\nfounders|fundadores|fund\\adddot\ncontinuator|continuador|cont\\adddot\ncontinuators|continuadores|cont\\adddot\ncollaborator|colaborador|colab\\adddot\ncollaborators|colaboradores|colab\\adddot\ntranslator|tradutor|trad\\adddot\ntranslators|tradutores|trad\\adddot\ncommentator|coment\\'ario|coment\\adddot\ncommentators|coment\\'ario|coment\\adddot\nannotator|notas|notas\nannotators|notas|notas\ncommentary|coment\\'ario|coment\\adddot\nannotations|notas|notas\nforeword|pref\\'acio|pref\\adddot\nafterword|posf\\'acio|posf\\adddot\norganizer|organizador|org\\adddot\norganizers|organizadores|org\\adddot\nbyauthor|por|por\nbyeditor|editado por|ed\\adddotspace por\nbycompiler|compilado por|comp\\adddotspace por\nbyredactor|redigido por|red\\adddotspace por\nbyreviser|revisado por|rev\\adddotspace por\nbyreviewer|resenhado por|res\\adddotspace por\nbyfounder|fundado por|fund\\adddotspace por\nbycontinuator|continuado por|cont\\adddotspace por\nbytranslator|traduzido \\lbx@lfromlang\\ por|trad\\adddot\\ \\lbx@sfromlang\\ por\nbycommentator|comentado por|coment\\adddot\\ por\nbyannotator|anotado por|anot\\adddot\\ por\nbyorganizer|organizado por|org\\adddotspace por\nwithcommentator|com coment\\'ario de|com coment\\adddot\\ de\nwithannotator|com notas de|com notas de\nwithforeword|com pref\\'acio de|com pref\\adddot\\ de\nwithafterword|com posf\\'acio de|com posf\\adddot\\ de\nand|e|e\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nvolume|volume|vol\\adddot\nvolumes|volumes|vol\\adddot\ninvolumes|em|em\njourvol|volume|v\\adddot\njourser|s\\'erie|s\\'er\\adddot\nbook|livro|livro\npart|parte|parte\nissue|n\\'umero|n\\'um\\adddot\nnewseries|nova s\\'erie|nova s\\'er\\adddot\noldseries|s\\'erie antiga|s\\'er\\adddot\\ antiga\nreprint|reimpress\\~ao|reimpr\\adddot\nreprintof|reimpress\\~ao de|reimpr\\adddotspace de\nreprintas|reimpresso como|reimpr\\adddotspace como\nreprintfrom|reimpresso de|reimpr\\adddotspace de\ntranslationas|traduzido como|trad\\adddotspace como\ntranslationfrom|traduzido do|trad\\adddotspace do\nreviewof|resenha de|res\\adddotspace de\norigpubas|originalmente publicado como|orig\\adddotspace pub\\adddotspace como\norigpubin|originalmente publicado em|orig\\adddotspace pub\\adddotspace em\nastitle|como|como\nbypublisher|por|por\nnodate|sem\\space data|s\\adddot d\\adddot\npage|p\\'agina|p\\adddot\npages|p\\'aginas|pp\\adddot\ncolumn|coluna|col\\adddot\ncolumns|colunas|col\\adddot\nline|linha|l\\adddot\nlines|linhas|ll\\adddot\nverse|verso|v\\adddot\nverses|versos|vv\\adddot\nparagraph|par\\'agrafo|par\\adddot\nparagraphs|par\\'agrafos|par\\adddot\npagetotal|p\\'agina|p\\adddot\npagetotals|p\\'aginas|pp\\adddot\ncolumntotal|coluna|col\\adddot\ncolumntotals|colunas|col\\adddot\nlinetotal|linha|l\\adddot\nlinetotals|linhas|ll\\adddot\nversetotal|verso|v\\adddot\nversetotals|versos|vv\\adddot\nparagraphtotal|par\\'agrafo|par\\adddot\nparagraphtotals|par\\'agrafos|par\\adddot\nin|em|em\ninseries|em|em\nofseries|de|de\nnumber|n\\'umero|n\\adddot\nchapter|cap\\'\\i tulo|cap\\adddot\nbathesis|trabalho de conclus\\~ao|trab\\adddotspace de conc\\adddot\nphdthesis|tese de doutorado|tese de dout\\adddot\ncandthesis||\nresreport|relat\\'orio de pesquisa|rel\\adddotspace de pesq\\adddot\ntechreport|relat\\'orio t\\'ecnico|rel\\adddotspace t\\'ecn\\adddot\nsoftware|software|software\ndatacd|CD-ROM|CD-ROM\naudiocd|CD de \\'audio|CD de \\'audio\nversion|vers\\~ao|vers\\~ao\nurlfrom|dispon\\'ivel em|disp\\adddotspace em\nurlseen|acesso em|acesso em\nsubmitted|submetido|submetido\ninpress|no prelo|no prelo\nprepublished|pr\\'e-publicado|pr\\'e-publicado\ncitedas|doravante citado como|doravante citado como\nthiscite|especialmente|esp\\adddot\nseenote|ver nota|ver nota\nquotedin|apud|apud\nidem|idem|idem\nidemsm|idem|idem\nidemsf|eadem|eadem\nidemsn|idem|idem\nidempm|eidem|eidem\nidempf|eaedem|eaedem\nidempn|eadem|eadem\nidempp|eidem|eidem\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|passim\nsee|ver|ver\nseealso|ver tamb\\'em|ver tamb\\'em\nbackrefpage|ver p\\'agina|ver p\\adddot\nbackrefpages|ver p\\'aginas|ver pp\\adddot\njanuary|janeiro|jan\\adddot\nfebruary|fevereiro|fev\\adddot\napril|abril|abr\\adddot\nmay|maio|mai\\adddot\njune|junho|jun\\adddot\njuly|julho|jul\\adddot\naugust|agosto|ago\\adddot\nseptember|setembro|set\\adddot\noctober|outubro|out\\adddot\nnovember|novembro|nov\\adddot\ndecember|dezembro|dez\\adddot\nlangamerican|ingl\\^es|ingl\\^es\nlangbulgarian|b\\'ulgaro|b\\'ulgaro\nlangcatalan|catal\\~ao|catal\\~ao\nlangcroatian|croata|croata\nlangczech|tcheco|tcheco\nlangdanish|dinamarqu\\^es|dinamarqu\\^es\nlangenglish|ingl\\^es|ingl\\^es\nlangfinnish|finland\\^es|finland\\^es\nlangestonian|estoniano|estoniano\nlangfrench|franc\\^es|franc\\^es\nlanggalician|galego|galego\nlanggerman|alem\\~ao|alem\\~ao\nlanggreek|grego|grego\nlanghungarian|h\\'ungaro|h\\'ungaro\nlangitalian|italiano|italiano\nlangjapanese|japon\\^es|japon\\^es\nlanglatin|latim|latim\nlanglatvian|let\\~ao|let\\~ao\nlanglithuanian|lituano|lituano\nlangnorwegian|noruegu\\^es|noruegu\\^es\nlangpolish|polon\\^es|polon\\^es\nlangrussian|russo|russo\nlangserbian|s\\'ervio|s\\'ervio\nlangslovak|eslovaco|eslovaco\nlangslovene|esloveno|esloveno\nlangspanish|espanhol|espanhol\nlangswedish|sueco|sueco\nlangturkish|turco|turco\nlangukrainian|ucraniano|ucraniano\nfromamerican|do ingl\\^es|do ingl\\^es\nfrombulgarian|do b\\'ulgaro|do b\\'ulgaro\nfromcatalan|do catal\\~ao|do catal\\~ao\nfromcroatian|do croata|do croata\nfromczech|do tcheco|do tcheco\nfromdanish|do dinamarqu\\^es|do dinamarqu\\^es\nfromenglish|do ingl\\^es|do ingl\\^es\nfromestonian|do estoniano|do estoniano\nfromfinnish|do finland\\^es|do finland\\^es\nfromfrench|do franc\\^es|do franc\\^es\nfromgalician|do galego|do galego\nfromgerman|do alem\\~ao|do alem\\~ao\nfromgreek|do grego|do grego\nfromhungarian|do h\\'ungaro|do h\\'ungaro\nfromitalian|do italiano|do italiano\nfromjapanese|do japon\\^es|do japon\\^es\nfromlatin|do latim|do latim\nfromlatvian|do let\\~ao|do let\\~ao\nfromlithuanian|do lituano|do lituano\nfromnorwegian|do noruegu\\^es|do noruegu\\^es\nfrompolish|do polon\\^es|do polon\\^es\nfromrussian|do russo|do russo\nfromserbian|do s\\'ervio|do s\\'ervio\nfromslovak|do eslovaco|do eslovaco\nfromslovene|do esloveno|do esloveno\nfromspanish|do espanhol|do espanhol\nfromswedish|do sueco|do sueco\nfromturkish|do turco|do turco\nfromukrainian|do ucraniano|do ucraniano\ncountryde|Alemanha|DE\ncountryeu|Uni\\~ao Europeia|EU\ncountryep|Uni\\~ao Europeia|EP\ncountryuk|Reino Unido|GB\ncountryus|Estados Unidos|US\npatent|patente|pat\\adddot\npatentde|patente alem\\~a|pat\\adddot\\ alem\\~a\npatenteu|patente europeia|pat\\adddot\\ europeia\npatentfr|patente francesa|pat\\adddot\\ francesa\npatentuk|patente brit\\^anica|pat\\adddot\\ brit\\^anica\npatentus|patente americana|pat\\adddot\\ americana\npatreq|pedido de patente|ped\\adddot\\ de pat\\adddot\npatreqde|pedido de patente alem\\~a|ped\\adddot\\ de pat\\adddot\\ alem\\~a\npatreqeu|pedido de patente europeia|ped\\adddot\\ de pat\\adddot\\ europeia\npatreqfr|pedido de patente francesa|ped\\adddot\\ de pat\\adddot\\ francesa\npatrequk|pedido de patente brit\\^anica|ped\\adddot\\ de pat\\adddot\\ brit\\^anica\npatrequs|pedido de patente americana|ped\\adddot\\ de pat\\adddot\\ americana\nfile|arquivo|arquivo\nlibrary|biblioteca|biblioteca\nabstract|resumo|resumo\nannotation|notas|notas\ncommonera|Era Comum|EC\nbeforecommonera|antes da Era Comum|AEC\nannodomini|depois de Cristo|d\\adddot C\\adddot\nbeforechrist|antes de Cristo|a\\adddot C\\adddot\ncirca|circa|ca\\adddot\nspring|primavera|primavera\nsummer|ver\\~ao|ver\\~ao\nautumn|outono|outono\nwinter|inverno|inverno\nam|AM|AM\npm|PM|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/british.lbx.strings",
    "content": "organizer|organiser|org\\adddot\norganizers|organisers|orgs\\adddot\nbyorganizer|organised by|org\\adddotspace by\n"
  },
  {
    "path": "citeproc/biblatex-localization/bulgarian.lbx.strings",
    "content": "bibliography|Библиография|Библиография\nreferences|Литература|Литература\nshorthands|Списък на съкращенията|Съкращения\neditor|редактор|ред\\adddot\neditors|редактори|ред\\adddot\ncompiler|съставител|съст\\adddot\ncompilers|съставители|съст\\adddot\nredactor|редактор|ред\\adddot\nredactors|редактори|ред\\adddot\nreviser|коректор|кор\\adddotspace кор\\adddot\nrevisers|коректор|кор\\adddotspace кор\\adddot\nfounder|основател|осн\\adddot\nfounders|основатели|осн\\adddot\ncontinuator|продължител|прод\\adddot\ncontinuators|продължител|прод\\adddot\ncollaborator|участник|участ\\adddot\ncollaborators|участници|участ\\adddot\ntranslator|преводач|прев\\adddot\ntranslators|преводачи|прев\\adddot\ncommentator|коментатор|комент\\adddot\ncommentators|коментатори|комент\\adddot\nannotator|бележки|бел\\adddot\nannotators|бележки|бел\\adddot\ncommentary|комментар|комент\\adddot\nannotations|бележки|бел\\adddot\nintroduction|уводна статия|ув\\adddotspace ст\\adddot\nforeword|предговор|предг\\adddot\nafterword|послеслов|послесл\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/canadian.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/catalan.lbx.strings",
    "content": "bibliography|Bibliografia|Bibliografia\nreferences|Refer\\`encies|Refer\\`encies\nshorthands|Llista d'abreviatures|Abreviatures\neditor|editor|ed\\adddot\neditors|editors|ed\\adddot\ncompiler|compilador|comp\\adddot\ncompilers|compiladors|comp\\adddot\nredactor|redactor|red\\adddot\nredactors|redactors|red\\adddot\nreviser|revisor|rev\\adddot\nrevisers|revisors|rev\\adddot\nfounder|fundador|fund\\adddot\nfounders|fundadors|fund\\adddot\ncontinuator|continuador|cont\\adddot\ncontinuators|continuadors|cont\\adddot\ncollaborator|co\\l.laborador|co\\l.l\\adddot\ncollaborators|co\\l.laboradors|co\\l.l\\adddot\ntranslator|traductor|trad\\adddot\ntranslators|traductors|trad\\adddot\ncommentator|comentarista|com\\adddot\ncommentators|comentaristes|com\\adddot\nannotator|anotador|anot\\adddot\nannotators|anotadors|anot\\adddot\ncommentary|comentari|com\\adddot\nannotations|notes|n\\adddot\nintroduction|introducci\\'o|intr\\adddot\nforeword|pr\\`oleg|pr\\`ol\\adddot\neditortr|editor i traductor|ed\\adddotspace i trad\\adddot\neditorstr|editors i traductors|ed\\adddotspace i trad\\adddot\neditorco|editor i comentarista|ed\\adddotspace i com\\adddot\neditorsco|editors i comentaristes|ed\\adddotspace i com\\adddot\neditoran|editor i anotador|ed\\adddotspace i anot\\adddot\neditorsan|editors i anotadors|ed\\adddotspace i anot\\adddot\norganizer|organitzador|org\\adddot\norganizers|organitzadors|org\\adddot\nbyorganizer|organitzat per|org\\adddotspace per\nbyauthor|per|per\nbyeditor|edici\\'o a cura \\smartof|ed\\adddotspace\\smartof\nbycompiler|compilaci\\'o a cura \\smartof|comp\\adddotspace\\smartof\nbyredactor|redacci\\'o a cura \\smartof|red\\adddotspace\\smartof\nbyreviser|revisi\\'o a cura \\smartof|rev\\adddotspace\\smartof\nbyreviewer|ressenya a cura \\smartof|ress\\adddotspace\\smartof\nbyfounder|fundat per|fund\\adddotspace per\nbycontinuator|continuat per|cont\\adddotspace per\nbycollaborator|amb la co\\l.laboraci\\'o \\smartof|amb la co\\l.l\\adddotspace\\smartof\nbytranslator|traducci\\'o \\lbx@fromlang\\ a cura \\smartof|trad\\adddotspace\\lbx@fromlang\\ \\smartof\nbycommentator|comentari a cura \\smartof|com\\adddotspace\\smartof\nbyannotator|notes a cura \\smartof|n\\adddotspace\\smartof\nwithcommentator|amb un comentari a cura \\smartof|amb un com\\adddotspace\\smartof\nwithannotator|amb notes a cura \\smartof|amb n\\adddotspace\\smartof\nwithintroduction|amb una introducci\\'o a cura \\smartof|amb una intr\\adddotspace\\smartof\nwithforeword|amb un pr\\`oleg a cura \\smartof|amb un pr\\`ol\\adddotspace\\smartof\nand|i|i\nandothers|et al\\adddot|et al\\adddot\nandmore|i m\\'es|i m\\'es\nvolume|volum|vol\\adddot\nvolumes|volums|vol\\adddot\ninvolumes|en|en\njourvol|volum|vol\\adddot\njourser|s\\`erie|s\\`er\\adddot\nbook|llibre|llib\\adddot\npart|part|part\nissue|n\\'umero|n\\'um\\adddot\nnewseries|s\\`erie nova|s\\`erie nova\noldseries|s\\`erie antiga|s\\`erie ant\\adddot\nedition|edici\\'o|ed\\adddot\nreprint|reimpressi\\'o|reimpr\\adddot\nreprintof|reimpressi\\'o \\smartof|reimpr\\adddotspace\\smartof\nreprintas|reimpr\\`es com|reimpr\\adddotspace com\nreprintfrom|reimpr\\`es \\smartof|reimpr\\adddotspace\\smartof\nreviewof|ressenya \\smartof|ress\\adddotspace\\smartof\ntranslationof|traducci\\'o \\smartof|trad\\adddotspace\\smartof\norigpubas|publicat origin\\`ariament com|pub\\adddotspace orig\\adddotspace com\norigpubin|publicat origin\\`ariament el|pub\\adddotspace orig\\adddotspace el\nastitle|com|com\nbypublisher|per|per\npage|p\\`agina|p\\`ag\\adddot\npages|p\\`agines|p\\`ag\\adddot\ncolumn|columna|col\\adddot\ncolumns|columnes|cols\\adddot\nnodate|sine data|s\\adddotspace d\\adddot\nverse|vers|v\\adddot\nverses|versos|v\\adddot\nsection|apartat|\\S\nsections|apartats|\\S\nparagraph|par\\`agraf|\\P\nparagraphs|par\\`agrafs|\\P\npagetotal|p\\`agina|p\\`ag\\adddot\npagetotals|p\\`agines|p\\`ag\\adddot\ncolumntotal|columna|col\\adddot\ncolumntotals|columnes|col\\adddot\nversetotal|vers|v\\adddot\nversetotals|versos|v\\adddot\nsectiontotal|secci\\'o|\\S\nsectiontotals|seccions|\\S\nparagraphtotal|par\\`agrafs|\\P\nparagraphtotals|par\\`agrafs|\\P\nin|a|a\ninseries|a|a\nofseries|\\smartof|\\smartof\nnumber|n\\'umero|n\\'um\\adddot\nbathesis|treball final de grau|treb\\adddotspace fin\\adddotspace de gr\\adddot\nmathesis|treball final de m\\`aster|treb\\adddotspace fin\\adddotspace de m\\`ast\\adddot\nphdthesis|tesi doctoral|tesi doct\\adddot\ncandthesis|tesi de candidatura|tesi de cand\\adddot\nresreport|informe de recerca|inf\\adddotspace de rec\\adddot\ntechreport|informe t\\`ecnic|inf\\adddotspace t\\`ec\\adddot\nsoftware|programari|prog\\adddot\ndatacd|CD de dades|CD de dades\naudiocd|CD d'\\`audio|CD d'\\`audio\nversion|versi\\'o|vers\\adddot\nurlfrom|disponible a|disp\\adddotspace a\nurlseen|consultat|cons\\adddot\ninpreparation|en preparaci\\'o|en prep\\adddot\ninpress|a impremta|a impr\\adddot\nprepublished|pre-publicat|pre-publicat\nsubmitted|enviat a publicar|env\\adddotspace a pub\\adddot\nforthcoming|properament|prop\\adddot\ncitedas|d'ara endavant citat com|d'ara end\\adddotspace cit\\adddotspace com\nthiscite|concretament|concr\\adddot\nseenote|vegeu la nota|v\\adddotspace la n\\adddot\nquotedin|citat a|cit\\adddotspace a\nopcit|\\`op\\adddotspace cit\\adddot|\\`op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|seq\\adddot|seq\\adddot\nsequentes|et seq\\adddot|et seq\\adddot\npassim|p\\`assim|p\\`assim\nsee|vegeu|v\\adddot\nseealso|vegeu tamb\\'e|v\\adddotspace tamb\\'e\nbackrefpage|vegeu la p\\`agina|v\\adddotspace la p\\`ag\\adddot\nbackrefpages|vegeu les p\\`agines|v\\adddotspace les p\\`ag\\adddot\njanuary|gener|gen\\adddot\nfebruary|febrer|febr\\adddot\napril|abril|abr\\adddot\nmay|maig|maig\njune|juny|juny\njuly|juliol|jul\\adddot\naugust|agost|ag\\adddot\nseptember|setembre|set\\adddot\noctober|octubre|oct\\adddot\nnovember|novembre|nov\\adddot\ndecember|desembre|des\\adddot\nlangamerican|angl\\`es americ\\`a|ang\\adddotspace amer\\adddot\nlangbrazilian|portugu\\`es brasiler|port\\adddotspace bras\\adddot\nlangbulgarian|b\\'ulgar|b\\'ulg\\adddot\nlangcatalan|catal\\`a|cat\\adddot\nlangczech|txec|txec\nlangcroatian|croat|croat\nlangdanish|dan\\`es|dan\\adddot\nlangdutch|neerland\\`es|neerl\\adddot\nlangenglish|angl\\`es|ang\\adddot\nlangestonian|estoni\\`a|eston\\adddot\nlangfinnish|fin\\`es|fin\\adddot\nlangfrench|franc\\`es|fr\\adddot\nlanggalician|gallec|gal\\adddot\nlanggerman|alemany|al\\adddot\nlanggreek|grec|grec\n"
  },
  {
    "path": "citeproc/biblatex-localization/croatian.lbx.strings",
    "content": "bibliography|Bibliografija|Bibliografija\nreferences|Literatura|Literatura\nshorthands|Popis kratica|Kratice\neditor|urednik|ur\\adddot\neditors|urednici|ur\\adddot\nredactor|redaktor|redaktor\nredactors|redaktori|redaktori\nreviser|korektor|korektor\nrevisers|korektori|korektori\ncollaborator|suradnik|sur\\adddot\ncollaborators|suradnici|sur\\adddot\ntranslator|prijevod|prev\\adddot\ntranslators|prijevod|prev\\adddot\ncommentator|komentator|komentator\ncommentators|komentatori|komentatori\ncommentary|komentar|komentar\nintroduction|uvod|uvod\nforeword|predgovor|predgovor\nafterword|pogovor|pogovor\neditortr|prijevod i obrada|ur\\adddotspace i prev\\adddot\neditorstr|prijevod i obrada|ur\\adddotspace i prev\\adddot\norganizer|organizacija|organizacija\norganizers|organizacija|organizacija\nbyorganizer|organizacija|organizacija\nbyauthor|autor|autor\nbyeditor|obrada|ur\\adddot\nbyredactor|redaktura|red\\adddot\nbyreviser|korektura|kor\\adddot\nbyreviewer|recenzija|recenzija\nbycontinuator|nastavio|nastavio\nbycollaborator|u suradnji s|u sur\\adddotspace s\nbycommentator|komentari|komentari\nwithcommentator|komentari|komentari\nwithintroduction|uvod|uvod\nwithforeword|predgovor|predgovor\nwithafterword|pogovor|pogovor\nand|i|i\nandothers|i drugi|i dr\\adddot\nandmore|i drugi|i dr\\adddot\nvolume|sv\\adddot|sv\\adddot\nvolumes|sv\\adddot|sv\\adddot\ninvolumes|u|u\njourvol|sv\\adddot|sv\\adddot\njourser|serija|serija\nbook|knjiga|knj\\adddot\npart|dio|dio\nissue|izd\\adddot|izd\\adddot\nnewseries|nova serija|nova serija\noldseries|stara serija|stara serija\nedition|izdanje|izdanje\nreprint|pretisak|pretisak\nreprintof|pretisak|pretisak\nreprintas|iznova otisnuto kao|iznova otisnuto kao\nreprintfrom|iznova otisnut|iznova otisnut\ntranslationof|prijevod|prijevod\ntranslationas|prev\\adddotspace kao|prev\\adddotspace kao\ntranslationfrom|prijevod|prijevod\nreviewof|osvrt na|osvrt na\norigpubas|izvorno obj\\adddotspace kao|izv\\adddotspace obj\\adddotspace kao\norigpubin|izvorno obj\\adddot|izv\\adddotspace obj\\adddot\nastitle|kao|kao\nbypublisher||\nnodate|bez datuma|bez datuma\npage|stranica|str\\adddot\npages|stranice|str\\adddot\ncolumn|stupac|stupac\ncolumns|stupci|stupci\nline|linija|l\\adddot\nlines|linije|ll\\adddot\nverse|stih|stih\nverses|stihovi|stihovi\nsection|odjeljak|\\S\nsections|odjeljci|\\S\\S\nparagraph|stavak|st\\adddot\nparagraphs|stavci|st\\adddot\npagetotal|str\\adddot|str\\adddot\npagetotals|str\\adddot|str\\adddot\ncolumntotal|stupac|stupac\ncolumntotals|stupaca|stupaca\nlinetotal|linija|lin\\adddot\nlinetotals|linija|lin\\adddot\nversetotal|stih|st\\adddot\nversetotals|stihova|st\\adddot\nsectiontotal|odjeljak|odj\\adddot\nsectiontotals|odjeljaka|odj\\adddot\nparagraphtotal|stavak|st\\adddot\nparagraphtotals|stavaka|st\\adddot\nin||\ninseries|u seriji|u seriji\nofseries|iz serije|iz serije\nnumber|broj|br\\adddot\nchapter|poglavlje|pogl\\adddot\nbathesis|diplomski rad|dipl\\adddotspace rad\nmathesis|magistarski rad|mag\\adddotspace rad\nphdthesis|doktorska disertacija|disertacija\nsoftware|softver|softver\ndatacd|CD-ROM|CD-ROM\naudiocd|audio CD|audio CD\nversion|verzija|verzija\nurl|adresa|adresa\nurlfrom|dostupno na|dost\\adddotspace na\nurlseen|pogledano|pogledano\ninpreparation|u pripremi|u pripremi\nsubmitted|predan|predan\ninpress|u tisku|u tisku\nprepublished|pred objavom|pred obj\\adddot\ncitedas|dalje citirano kao|dalje citirano kao\nthiscite|napose|napose\nquotedin|citirano u|citirano u\nidem|idem|idem\nidemsm|idem|idem\nidemsf|eadem|eadem\nidemsn|idem|idem\nidempm|eidem|eidem\nidempf|eaedem|eaedem\nidempn|eadem|eadem\nidempp|eidem|eidem\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|usporedi|usp\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|pass\\adddot\nsee|vidi|v\\adddot\nseealso|pogledaj i|pogl\\adddotspace i\nbackrefpage|citirano na stranci|cit\\adddotspace na str\\adddot\nbackrefpages|cited on pages|cit\\adddotspace na str\\adddot\napril|travanj|travanj\nmay|svibanj|svibanj\njune|lipanj|lipanj\njuly|srpanj|srpanj\naugust|kolovoz|kolovoz\nseptember|rujan|rujan\noctober|listopad|listopad\nnovember|studeni|studeni\ndecember|prosinac|prosinac\ndateapril|travnja|travnja\ndatemay|svibnja|svibnja\ndatejune|lipnja|lipnja\ndatejuly|srpnja|srpnja\ndateaugust|kolovoza|kolovoza\ndateseptember|rujna|rujna\ndateoctober|listopada|listopada\ndatenovember|studenoga|studenoga\ndatedecember|prosinca|prosinca\nlangamerican|engleski|engleski\nlangbrazilian|portugalski|portugalski\nlangbulgarian|bugarski|bugarski\nlangcatalan|katalonski|katalonski\nlangcroatian|hrvatski|hrvatski\nlangdanish|danski|danski\nlangdutch|nizozemski|nizozemski\nlangenglish|engleski|engleski\nlangestonian|estonski|estonski\nlangfinnish|finski|finski\nlangfrench|francuski|francuski\nlanggalician|galicijski|galicijski\nlanghungarian|ma\\dj arski|ma\\dj arski\nlangitalian|talijanski|talijanski\nlangjapanese|japanski|japanski\nlanglatin|latinski|latinski\nlanglatvian|letonski|letonski\nlangpolish|poljski|poljski\nlangportuguese|portugalski|portugalski\nlangrussian|ruski|ruski\nlangslovene|slovenski|slovenski\nlangukrainian|ukrajinski|ukrajinski\nfromamerican|s engleskog|s engleskog\nfrombrazilian|s portugalskog|s portugalskog\nfrombulgarian|s bugarskog|s bugarskog\nfromcatalan|s katalonskog|s katalonskog\nfromcroatian|s hrvatskog|s hrvatskog\nfromdanish|s danskog|s danskog\nfromdutch|s nizozemskog|s nizozemskog\nfromenglish|s engleskog|s engleskog\nfromestonian|s estonskog|s estonskog\nfromfinnish|s finskog|s finskog\nfromfrench|s francuskog|s francuskog\nfromgalician|s galicijskog|s galicijskog\nfromhungarian|s ma\\dj arskog|s ma\\dj arskog\nfromitalian|s talijanskog|s talijanskog\nfromjapanese|s japanskog|s japanskog\nfromlatin|s latinskog|s latinskog\nfromlatvian|s letonskog|s letonskog\nfrompolish|s poljskog|s poljskog\nfromportuguese|s portugalskog|s portugalskog\nfromrussian|s ruskog|s ruskog\nfromslovene|sa slovenskog|sa slovenskog\nfromukrainian|s ukrajinskog|s ukrajinskog\ncountryeu|Europska unija|EU\ncountryep|Europska unija|EP\ncountryfr|Francuska|FR\ncountryuk|Velika Britanija|GB\npatent|patent|pat\\adddot\npatenteu|europski patent|europski pat\\adddot\npatentfr|francuski patent|francuski pat\\adddot\npatentuk|britanski patent|britanski pat\\adddot\npatentus|US patent|US pat\\adddot\npatreq|patentni zahtjev|pat\\adddot\\ zahtjev\npatreqeu|europski patentni zahtjev|EU pat\\adddotspace zahtjev\npatrequs|US patentni zahtjev|US pat\\adddot\\ zahtjev\nfile|datoteka|datoteka\nlibrary|biblioteka|biblioteka\ncommonera|n\\adddotspace e\\adddot|n\\adddotspace e\\adddot\nbeforecommonera|pr\\adddotspace n\\adddotspace e\\adddot|pr\\adddotspace n\\adddotspace e\\adddot\nannodomini|poslije Krista|p\\adddotspace Kr\\adddot\nbeforechrist|prije Krista|pr\\adddotspace Kr\\adddot\ncirca|oko|cca\\adddot\nsummer|ljeto|ljeto\nautumn|jesen|jesen\nwinter|zima|zima\nam|prije podne|AM\npm|poslije podne|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/czech.lbx.strings",
    "content": "bibliography|Bibliografie|Bibliografie\nreferences|Odkazy|Odkazy\nshorthands|Seznam zkratek|Zkratky\neditor|editor|ed\\adddot\ncompiler|sestavil|sest\\adddot\ncompilers|sestavili|sest\\adddot\nredactor|redaktor|red\\adddot\nreviser|korektor|kor\\adddot\nfounder|zakladatel|zakl\\adddot\nannotations|anotace|anot\\adddot\nafterword|doslov|dosl\\adddot\nbyauthor||\nbycompiler|sestaveno|sest\\adddot\nwithannotator|s\\addnbspace anotacemi od|s\\addnbspace anot\\adddot\\ od\nwithafterword|s\\addnbspace doslovem od|s\\addnbspace dosl\\adddot\\ od\nand|a|a\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nvolume|svazek|sv\\adddot\nvolumes|svazky|sv\\adddot\ninvolumes|in|in\nbook|kniha|kniha\nreprint|dotisk|dotisk\nreprintof|dotisk|dotisk\nreprintas|dotisknuto jako|dotisknuto jako\nreprintfrom|dotisknuto z\\addnbspace|dotisknuto z\\addnbspace\nreviewof|recenze|recenz\\adddot\nastitle|jako|jako\nbypublisher||\npage|strana|s\\adddot\npages|strany|s\\adddot\ncolumn|sloupec|sl\\adddot\ncolumns|sloupce|sl\\adddot\nsection|sekce|\\S\nsections|sekce|\\S\\S\nparagraph|odstavec|ods\\adddot\nparagraphs|odstavce|ods\\adddot\npagetotal|strana|s\\adddot\npagetotals|strany|s\\adddot\ncolumntotal|sloupec|sl\\adddot\ncolumntotals|sloupce|sl\\adddot\nsectiontotal|sekce|\\S\nsectiontotals|sekce|\\S\\S\nparagraphtotal|odstavec|ods\\adddot\nparagraphtotals|odstavce|ods\\adddot\nin|in|in\ninseries|in|in\nofseries|z|z\nchapter|kapitola|kap\\adddot\ndatacd|CD-ROM|CD-ROM\naudiocd|audio CD|audio CD\nversion|verze|ver\\adddot\nurl|URL|URL\ninpress|v\\addnbspace tisku|v\\addnbspace tisku\nidem|idem|idem\nidemsm|idem|idem\nidemsf|eadem|eadem\nidemsn|idem|idem\nidempm|eidem|eidem\nidempf|eaedem|eaedem\nidempn|eadem|eadem\nidempp|eidem|eidem\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|pass\\adddot\nsee|viz|viz\njanuary|leden|led\\adddot\napril|duben|dub\\adddot\naugust|srpen|srp\\adddot\nnovember|listopad|lis\\adddot\ndecember|prosinec|pros\\adddot\nlanglatin|latina|lat\\adddot\nfromlatin|z\\addnbspace latiny|z\\addnbspace lat\\adddot\ncountryfr|Francie|FR\npatent|patent|pat\\adddot\npatentus|US patent|US pat\\adddot\nfile|soubor|soub\\adddot\nlibrary|knihovna|knih\\adddot\nabstract|abstrakt|abst\\adddot\nannotation|anotace|anot\\adddot\nannodomini|po Kristu|po Kr\\adddot\ncirca|cirka|ca\\adddot\nspring|jaro|jaro\nautumn|podzim|podzim\nwinter|zima|zima\nam|AM|AM\npm|PM|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/danish.lbx.strings",
    "content": "bibliography|Bibliografi|Bibliografi\nreferences|Litteraturhenvisninger|Litteratur\nshorthands|Forkortelser|Forkortelser\neditor|redakt\\o r|red\\adddot\neditors|redakt\\o rer|red\\adddot\ncompiler|kompilator|kompilator\ncompilers|kompilatorer|kompilatorer\nredactor|medredakt\\o r|medred\\adddot\nredactors|medredakt\\o rer|medred\\adddot\nreviser|revision|rev\\adddot\nrevisers|revision|rev\\adddot\nfounder|stifter|stifter\nfounders|stiftere|stiftere\ncontinuator|videref\\o rer|videref\\adddot\ncontinuators|videref\\o rere|videref\\adddot\ncollaborator|medarbejder|medarb\\adddot\ncollaborators|medarbejdere|medarb\\adddot\ntranslator|overs\\ae tter|overs\\adddot\ntranslators|overs\\ae ttere|overs\\adddot\ncommentator|kommentator|komm\\adddot\ncommentators|kommentatorer|komm\\adddot\nannotator|kommentator|komm\\adddot\nannotators|kommentatorer|komm\\adddot\ncommentary|kommentar|komm\\adddot\nannotations|annoteringer|ann\\adddot\nintroduction|indledning|indl\\adddot\nforeword|forord|forord\nafterword|efterord|efterord\norganizer|organisator|org\\adddot\norganizers|organisatorer|org\\adddot\nbyorganizer|organiseret af|org\\adddotspace av\nbyauthor|af|af\nbyeditor|redigeret af|red\\adddotspace af\nbycompiler|kompileret af|komp\\adddotspace af\nbyredactor|bearbejdet af|bearb\\adddotspace af\nbyreviser|revideret af|rev\\adddotspace af\nbyreviewer|bed\\o mt af|bed\\adddotspace af\nbyfounder|stiftet af|stiftet af\nbycontinuator|videref\\o rt af|videref\\adddotspace af\nbycollaborator|i samarbejde med|i samarb\\adddotspace m\\adddot\nbycommentator|kommenteret af|komm\\adddot\\ af\nbyannotator|annoteret af|ann\\adddot\\ af\nwithcommentator|med kommentarer af|m\\adddotspace komm\\adddot\\ af\nwithannotator|med annoteringer af|m\\adddotspace ann\\adddot\\ af\nwithintroduction|med indledning af|m\\adddotspace indl\\adddot\\ af\nwithforeword|med forord af|m\\adddotspace forord af\nwithafterword|med efterord af|m\\adddotspace efterord af\nand|og|og\nandothers|med flere|m.fl\\adddot\nandmore|med mere|m.m\\adddot\nvolume|bind|bd\\adddot\nvolumes|bind|bd\\adddot\ninvolumes|i|i\njourvol|\\aa rgang|\\aa rg\\adddot\njourser|r\\ae kke|rk\\adddot\nbook|bog|bog\npart|del|del\nissue|nummer|nr\\adddot\nnewseries|ny r\\ae kke|ny rk\\adddot\noldseries|gammel r\\ae kke|gl. rk\\adddot\nedition|udgave|udg\\adddot\nreprint|genoptryk|genoptr\\adddot\nreprintof|genoptryk af|genoptr\\adddot\\ af\nreprintas|genoptryk under titlen|genoptr\\adddot\\ under titlen\nreprintfrom|genoptryk fra|genoptr\\adddot\\ fra\ntranslationof|overs\\ae ttelse af|overs\\adddot\\ af\ntranslationas|oversat under titlen|overs\\adddotspace\\ under titlen\ntranslationfrom|oversat fra|overs\\adddotspace\\ fra\nreviewof|bed\\o mmelse af|bed\\adddotspace af\norigpubas|oprindeligt udgivet som|opr\\adddot\\ udg\\adddot\\ som\norigpubin|oprindeligt udgivet i|opr\\adddot\\ udg\\adddot\\ i\nastitle|under titlen|under titlen\nbypublisher|af|af\nnodate|uden \\aa rstal|u.\\aa\\adddot\npage|side|s\\adddot\npages|sider|s\\adddot\ncolumn|spalte|sp\\adddot\ncolumns|spalter|sp\\adddot\nline|linje|l\\adddot\nlines|linjer|l\\adddot\nverse|vers|v\\adddot\nverses|vers|v\\adddot\nsection|paragraf|par\\adddot\nsections|paragraffer|par\\adddot\nparagraph|afsnit|afsn\\adddot\nparagraphs|afsnit|afsn\\adddot\npagetotal|side|s\\adddot\npagetotals|sider|s\\adddot\ncolumntotal|spalte|sp\\adddot\ncolumntotals|spalter|sp\\adddot\nline|linje|l\\adddot\nlines|linjer|l\\adddot\nverse|vers|v\\adddot\nverses|vers|v\\adddot\nlinetotal|linje|l\\adddot\nlinetotals|linje|l\\adddot\nversetotal|vers|v\\adddot\nversetotals|vers|v\\adddot\nsectiontotal|paragraf|par\\adddot\nsectiontotals|paragraffer|par\\adddot\nparagraphtotal|afsnit|afsn\\adddot\nparagraphtotals|afsnit|afsn\\adddot\nin|i|i\ninseries|i r\\ae kken|i rk\\adddot\nofseries|fra r\\ae kken|fra rk\\adddot\nnumber|nummer|nr\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/dutch.lbx.strings",
    "content": "bibliography|Bibliografie|Bibliografie\nreferences|Referenties|Referenties\nshorthands|Lijst van afkortingen|Afkortingen\neditor|redacteur|red\\adddot\neditors|redacteurs|red\\adddot\ncompiler|samensteller|samenst\\adddot\ncompilers|samenstellers|samenst\\adddot\nfounder|oprichter|opr\\adddot\nfounders|oprichters|opr\\adddot\ncontinuator|opvolger|opv\\adddot\ncontinuators|opvolgers|opv\\adddot\nredactor|redacteur|red\\adddot\nredactors|redacteuren|red\\adddot\nreviser|revisor|rev\\adddot\nrevisers|revisors|rev\\adddot\ncollaborator|medewerker|med\\adddot\ncollaborators|medewerkers|med\\adddot\ntranslator|vertaler|vert\\adddot\ntranslators|vertalers|vert\\adddot\ncommentator|commentator|comm\\adddot\ncommentators|commentatoren|comm\\adddot\nannotator|annotator|annot\\adddot\nannotators|annotatoren|annot\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/english.lbx.strings",
    "content": "bibliography|Bibliography|Bibliography\nreferences|References|References\nshorthands|List of Abbreviations|Abbreviations\neditor|editor|ed\\adddot\neditors|editors|eds\\adddot\ncompiler|compiler|comp\\adddot\ncompilers|compilers|comp\\adddot\nredactor|redactor|red\\adddot\nredactors|redactors|red\\adddot\nreviser|reviser|rev\\adddot\nrevisers|revisers|rev\\adddot\nfounder|founder|found\\adddot\nfounders|founders|found\\adddot\ncontinuator|continued|cont\\adddot\ncontinuators|continued|cont\\adddot\ncollaborator|collaborator|collab\\adddot\ncollaborators|collaborators|collab\\adddot\ntranslator|translator|trans\\adddot\ntranslators|translators|trans\\adddot\ncommentator|commentator|comm\\adddot\ncommentators|commentators|comm\\adddot\nannotator|annotator|annot\\adddot\nannotators|annotators|annot\\adddot\ncommentary|commentary|comm\\adddot\nannotations|annotations|annot\\adddot\nintroduction|introduction|intro\\adddot\nforeword|foreword|forew\\adddot\nafterword|afterword|afterw\\adddot\norganizer|organizer|org\\adddot\norganizers|organizers|orgs\\adddot\nbyorganizer|organized by|org\\adddotspace by\nbyauthor|by|by\nbyeditor|edited by|ed\\adddotspace by\nbycompiler|compiled by|comp\\adddotspace by\nbyredactor|redacted by|red\\adddotspace by\nbyreviser|revised by|rev\\adddotspace by\nbyreviewer|reviewed by|rev\\adddotspace by\nbyfounder|founded by|found\\adddotspace by\nbycontinuator|continued by|cont\\adddotspace by\nbycollaborator|in collaboration with|in collab\\adddotspace with\nbytranslator|translated \\lbx@lfromlang\\ by|trans\\adddot\\ \\lbx@sfromlang\\ by\nbycommentator|commented by|comm\\adddot\\ by\nbyannotator|annotated by|annot\\adddot\\ by\nwithcommentator|with a commentary by|with a comment\\adddot\\ by\nwithannotator|with annotations by|with annots\\adddot\\ by\nwithintroduction|with an introduction by|with an intro\\adddot\\ by\nwithforeword|with a foreword by|with a forew\\adddot\\ by\nwithafterword|with an afterword by|with an afterw\\adddot\\ by\nand|and|and\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nvolume|volume|vol\\adddot\nvolumes|volumes|vols\\adddot\ninvolumes|in|in\njourvol|volume|vol\\adddot\njourser|series|ser\\adddot\nbook|book|book\npart|part|part\nissue|issue|issue\nnewseries|new series|new ser\\adddot\noldseries|old series|old ser\\adddot\nedition|edition|ed\\adddot\nreprint|reprint|repr\\adddot\nreprintof|reprint of|repr\\adddotspace of\nreprintas|reprinted as|rpt\\adddotspace as\nreprintfrom|reprinted from|repr\\adddotspace from\nreviewof|review of|rev\\adddotspace of\ntranslationof|translation of|trans\\adddotspace of\ntranslationas|translated as|trans\\adddotspace as\ntranslationfrom|translated from|trans\\adddotspace from\norigpubas|originally published as|orig\\adddotspace pub\\adddotspace as\norigpubin|originally published in|orig\\adddotspace pub\\adddotspace in\nastitle|as|as\nbypublisher|by|by\nnodate|no date|n\\adddot d\\adddot\npage|page|p\\adddot\npages|pages|pp\\adddot\ncolumn|column|col\\adddot\ncolumns|columns|cols\\adddot\nline|line|l\\adddot\nlines|lines|ll\\adddot\nverse|verse|v\\adddot\nverses|verses|vv\\adddot\nsection|section|\\S\nsections|sections|\\S\\S\nparagraph|paragraph|par\\adddot\nparagraphs|paragraphs|par\\adddot\npagetotal|page|p\\adddot\npagetotals|pages|pp\\adddot\ncolumntotal|column|col\\adddot\ncolumntotals|columns|cols\\adddot\nlinetotal|line|l\\adddot\nlinetotals|lines|ll\\adddot\nversetotal|verse|v\\adddot\nversetotals|verses|vv\\adddot\nsectiontotal|section|\\S\nsectiontotals|sections|\\S\\S\nparagraphtotal|paragraph|par\\adddot\nparagraphtotals|paragraphs|par\\adddot\nin|in|in\ninseries|in|in\nofseries|of|of\nnumber|number|no\\adddot\nchapter|chapter|chap\\adddot\nbathesis|Bachelor's thesis|BA\\addabbrvspace thesis\nmathesis|Master's thesis|MA\\addabbrvspace thesis\nphdthesis|PhD\\addabbrvspace thesis|PhD\\addabbrvspace thesis\ncandthesis|Candidate thesis|Cand\\adddotspace thesis\nresreport|research report|research rep\\adddot\ntechreport|technical report|tech\\adddotspace rep\\adddot\nsoftware|computer software|comp\\adddotspace software\ndatacd|CD-ROM|CD-ROM\naudiocd|audio CD|audio CD\nversion|version|version\nurl|address|address\nurlfrom|available from|available from\nurlseen|visited on|visited on\ninpreparation|in preparation|in preparation\nsubmitted|submitted|submitted\nforthcoming|forthcoming|forthcoming\ninpress|in press|in press\nprepublished|pre-published|pre-published\ncitedas|henceforth cited as|henceforth cited as\nthiscite|especially|esp\\adddot\nseenote|see note|see n\\adddot\nquotedin|quoted in|qtd\\adddotspace in\nidem|idem|idem\nidemsm|idem|idem\nidemsf|eadem|eadem\nidemsn|idem|idem\nidempm|eidem|eidem\nidempf|eaedem|eaedem\nidempn|eadem|eadem\nidempp|eidem|eidem\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|pass\\adddot\nsee|see|see\nseealso|see also|see also\nbackrefpage|cited on page|cit\\adddotspace on p\\adddot\nbackrefpages|cited on pages|cit\\adddotspace on pp\\adddot\njanuary|January|Jan\\adddot\nfebruary|February|Feb\\adddot\nmarch|March|Mar\\adddot\napril|April|Apr\\adddot\nmay|May|May\njune|June|June\njuly|July|July\naugust|August|Aug\\adddot\nseptember|September|Sept\\adddot\noctober|October|Oct\\adddot\nnovember|November|Nov\\adddot\ndecember|December|Dec\\adddot\nlangamerican|American|American\nlangbrazilian|Brazilian|Brazilian\nlangbulgarian|Bulgarian|Bulgarian\nlangcatalan|Catalan|Catalan\nlangcroatian|Croatian|Croatian\nlangczech|Czech|Czech\nlangdanish|Danish|Danish\nlangdutch|Dutch|Dutch\nlangenglish|English|English\nlangestonian|Estonian|Estonian\nlangfinnish|Finnish|Finnish\nlangfrench|French|French\nlanggalician|Galician|Galician\nlanggerman|German|German\nlanggreek|Greek|Greek\nlanghungarian|Hungarian|Hungarian\nlangitalian|Italian|Italian\nlangjapanese|Japanese|Japanese\nlanglatin|Latin|Latin\nlanglatvian|Latvian|Latvian\nlanglithuanian|Lithuanian|Lithuanian\nlangnorwegian|Norwegian|Norwegian\nlangpolish|Polish|Polish\nlangportuguese|Portuguese|Portuguese\nlangrussian|Russian|Russian\nlangserbian|Serbian|Serbian\nlangslovak|Slovak|Slovak\nlangslovene|Slovene|Slovene\nlangspanish|Spanish|Spanish\nlangswedish|Swedish|Swedish\nlangturkish|Turkish|Turkish\nlangukrainian|Ukrainian|Ukrainian\nfromamerican|from the American|from the American\nfrombrazilian|from the Brazilian|from the Brazilian\nfrombulgarian|from the Bulgarian|from the Bulgarian\nfromcatalan|from the Catalan|from the Catalan\nfromcroatian|from the Croatian|from the Croatian\nfromczech|from the Czech|from the Czech\nfromdanish|from the Danish|from the Danish\nfromdutch|from the Dutch|from the Dutch\nfromenglish|from the English|from the English\nfromestonian|from the Estonian|from the Estonian\nfromfinnish|from the Finnish|from the Finnish\nfromfrench|from the French|from the French\nfromgalician|from the Galician|from the Galician\nfromgerman|from the German|from the German\nfromgreek|from the Greek|from the Greek\nfromhungarian|from the Hungarian|from the Hungarian\nfromitalian|from the Italian|from the Italian\nfromjapanese|from the Japanese|from the Japanese\nfromlatin|from the Latin|from the Latin\nfromlatvian|from the Latvian|from the Latvian\nfromlithuanian|from the Lithuanian|from the Lithuanian\nfromnorwegian|from the Norwegian|from the Norwegian\nfrompolish|from the Polish|from the Polish\nfromportuguese|from the Portuguese|from the Portuguese\nfromrussian|from the Russian|from the Russian\nfromserbian|from the Serbian|from the Serbian\nfromslovak|from the Slovak|from the Slovak\nfromslovene|from the Slovene|from the Slovene\nfromspanish|from the Spanish|from the Spanish\nfromswedish|from the Swedish|from the Swedish\nfromturkish|from the Turkish|from the Turkish\nfromukrainian|from the Ukrainian|from the Ukrainian\ncountryde|Germany|DE\ncountryeu|European Union|EU\ncountryep|European Union|EP\ncountryfr|France|FR\ncountryuk|United Kingdom|GB\ncountryus|United States of America|US\npatent|patent|pat\\adddot\npatentde|German patent|German pat\\adddot\npatenteu|European patent|European pat\\adddot\npatentfr|French patent|French pat\\adddot\npatentuk|British patent|British pat\\adddot\npatentus|U.S\\adddotspace patent|U.S\\adddotspace pat\\adddot\npatreq|patent request|pat\\adddot\\ req\\adddot\npatreqde|German patent request|German pat\\adddot\\ req\\adddot\npatreqeu|European patent request|European pat\\adddot\\ req\\adddot\npatreqfr|French patent request|French pat\\adddot\\ req\\adddot\npatrequk|British patent request|British pat\\adddot\\ req\\adddot\npatrequs|U.S\\adddotspace patent request|U.S\\adddotspace pat\\adddot\\ req\\adddot\nfile|file|file\nlibrary|library|library\nabstract|abstract|abstract\nannotation|annotations|annotations\ncommonera|Common Era|CE\nbeforecommonera|Before Common Era|BCE\nannodomini|Anno Domini|AD\nbeforechrist|Before Christ|BC\ncirca|circa|ca\\adddot\nspring|Spring|Spr\\adddot\nsummer|Summer|Sum\\adddot\nautumn|Autumn|Aut\\adddot\nwinter|Winter|Win\\adddot\nam|AM|AM\npm|PM|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/estonian.lbx.strings",
    "content": "bibliography|bibliograafia|bibliograafia\nreferences|viited|viited\neditor|toimetaja|toim\\adddot\neditors|toimetajad|toim\\adddot\ncompiler|koostaja|koost\\adddot\ncompilers|koostajad|koost\\adddot\nredactor|toimetaja|toim\\adddot\nredactors|toimetajad|toim\\adddot\nreviser|toimetaja|toim\\adddot\nrevisers|toimetajad|toim\\adddot\nfounder|asutaja|asutaja\nfounders|asutajad|asutajad\ncommentator|kommenteerija|kommenteerija\ncommentators|kommenteerijad|kommenteerijad\nannotator|kommenteerija|kommenteerija\nannotators|kommenteerijad|kommenteerijad\ncommentary|kommentaarid|kommentaarid\nannotations|kommentaarid|kommentaarid\nintroduction|sissejuhatus|sissejuhatus\norganizer|korraldaja|korraldaja\norganizers|korraldajad|korraldajad\nbyorganizer|korraldanud|korraldanud\nbyauthor|kirjutanud|kirj\\adddot\nbyeditor|toimetanud|toim\\adddot\nbycompiler|koostanud|koost\\adddot\nbyredactor|toimetanud|toim\\adddot\nbyreviewer|vaadanud|vaadanud\nbyfounder|asutanud|asutanud\nbycommentator|kommenteerinud|kommenteerinud\nbyannotator|kommenteerinud|kommenteerinud\nwithcommentator|koos kommentaaridega|koos kommentaaridega\nwithannotator|koos kommentaaridega|koos kommentaaridega\nwithintroduction|koos tutvustusega|koos tutvustusega\nand|ja|ja\ninvolumes|osas|osas\njourser|seeria|seeria\nbook|raamat|raamat\npart|osa|osa\nissue|number|nr\\adddot\nnewseries|uus seerias|uus seer\\adddot\noldseries|vana seeria|vana seer\\adddot\nreviewof|arvustus teosest|arvustus teosest\norigpubas|algselt avaldatud kui|algselt avaldatud kui\norigpubin|algselt avaldatud aastal|algselt avaldatud aastal\nastitle|pealkirjaga|pealkirjaga\ncolumn|veerg|veerg\ncolumns|veerud|veerud\nline|rida|rida\nlines|read|read\nverse|salm|salm\nverses|salmid|salmid\nsection|jagu|jagu\nsections|jaod|jaod\ncolumntotal|veerge kokku|veerge kokku\ncolumntotals|veergusid kokku|veergusid kokku\nlinetotal|ridu kokku|ridu kokku\nlinetotals|ridasid kokku|ridasid kokku\nversetotal|salmi kokku|salmi kokku\nversetotals|salmesid kokku|salmesid kokku\nsectiontotal|jagusid kokku|jagusid kokku\nsectiontotals|jagusid kokku|jagusid kokku\nin|teoses|teoses\ninseries|sarjas|sarjas\nofseries|sarjast|sarjast\nnumber|number|nr\nresreport|uuringuraport|uuringuraport\ntechreport|tehniline raport|tehniline raport\nsoftware|tarkvara|tarkvara\ndatacd|CD-ROM|CD-ROM\naudiocd|audioplaat|audioplaat\nversion|versioon|versioon\nurl|aadress|aadress\nurlfrom|saadaval|saadaval\nurlseen|vaadatud|vaadatud\ninpreparation|koostamisel|koostamisel\nsubmitted|esitatud|esitatud\nforthcoming|tulevases|tulevases\ncitedas|edaspidi viidatud kui|edaspidi viidatud kui\nthiscite|eriti|eriti\nquotedin|noteeritud|noteeritud\nsee|vaata|vt\nseealso|vaata ka|vt ka\nbackrefpage|viidatud lehel|viidatud lehel\njanuary|jaanuar|jaanuar\nfebruary|veebruar|veebruar\napril|aprill|aprill\nmay|mai|mai\njune|juuni|juuni\njuly|juuli|juuli\naugust|august|august\nseptember|september|september\noctober|oktoober|oktoober\nnovember|november|november\ndecember|detsember|detsember\nlangamerican|Ameerika inglise keel|Ameerika inglise keel\nlangbrazilian|brasiilia keel|brasiilia keel\nlangbulgarian|bulgaaria keel|bulgaaria keel\nlangcatalan|katalaani keel|katalaani keel\nlangcroatian|horvaadi keel|horvaadi keel\nlangdanish|taani keel|taani keel\nlangdutch|hollandi keel|hollandi keel\nlangenglish|inglise keel|inglise keel\nlangestonian|eesti keel|eesti keel\nlangfinnish|soome keel|soome keel\nlangfrench|prantsuse keel|prantsuse keel\nlanggalician|galeegi keel|galeegi keel\nlanggerman|saksa keel|saksa keel\nlanggreek|kreeka keel|kreeka keel\nlanghungarian|ungari keel|ungari keel\nlangitalian|itaalia keel|itaalia keel\nlangjapanese|jaapani keel|jaapani keel\nlanglatin|ladina keel|ladina keel\nlangnorwegian|norra keel|norra keel\nlangpolish|poola keel|poola keel\nlangportuguese|portugali keel|portugali keel\nlangrussian|vene keel|vene keel\nlangslovak|slovakia keel|slovakia keel\nlangslovene|sloveeni keel|sloveeni keel\nlangspanish|hispaania keel|hispaania keel\nlangswedish|rootsi keel|rootsi keel\nlangukrainian|ukraina keel|ukraina keel\nfromamerican|Ameerika inglise keelest|Ameerika inglise keelest\nfrombrazilian|brasiilia keelest|brasiilia keelest\nfrombulgarian|bulgaaria keelest|bulgaaria keelest\nfromcatalan|katalani keelest|kalatalani keelest\nfromcroatian|horvaadi keelest|horvaadi keelest\nfromdanish|taani keelest|taani keelest\nfromdutch|hollandi keelest|hollandi keelest\nfromenglish|inglise keelest|inglise keelest\nfromestonian|eesti keelest|eesti keelest\nfromfinnish|soome keelest|soome keelest\nfromfrench|prantsuse keelest|prantsuse keelest\nfromgalician|galeegi keelest|galeegi keelest\nfromgerman|saksa keelest|saksa keelest\nfromgreek|kreeka keelest|kreeka keelest\nfromhungarian|ungari keelest|ungari keelest\nfromitalian|itaalia keelest|itaalia keelest\nfromjapanese|jaapani keelest|jaapani keelest\nfromlatin|ladina keelest|ladina keelest\nfromnorwegian|norra keelest|norra keelest\nfromportuguese|portugali keelest|portugali keelest\nfromrussian|vene keelest|vene keelest\nfromslovak|slovakia keelest|slovakia keelest\nfromslovene|sloveenia keelest|sloveenia keelest\nfromspanish|hispaania keelest|hispaania keelest\nfromswedish|rootsi keelest|rootsi keelest\nfromukrainian|ukraina keelest|ukraina keelest\ncountryde|Saksamaa|DE\ncountryeu|Euroopa Liit|EL\ncountryep|Euroopa Parlament|EP\ncountryfr|Prantsusmaa|FR\ncountryuk|Suurbritannia|GB\ncountryus|Ameerika|US\npatent|patent|pat\\adddot\npatentde|Saksa patent|Saksa pat\\adddot\npatenteu|Euroopa patent|Euroopa pat\\adddot\npatentfr|Prantsuse patent|Prantsuse pat\\adddot\npatentuk|Briti patent|Briti pat\\adddot\npatentus|U.S\\adddotspace patent|U.S\\adddotspace pat\\adddot\npatreq|patendi taotlus|pat\\adddotspace taotl\\adddot\npatreqde|Saksa patendi taotlus|Saksa pat\\adddotspace taotl\\adddot\npatreqeu|Euroopa patendi taotlus|Euroopa pat\\adddotspace taotl\\adddot\npatreqfr|Prantsuse patendi taotlus|Prantsuse pat\\adddotspace taotl\\adddot\npatrequk|Briti patendi taotlus|Briti pat\\adddotspace taotl\\adddot\npatrequs|U.S\\adddotspace patendi taotlus.|U.S\\adddotspace pat\\adddotspace taotl\\adddot\nfile|fail|fail\nlibrary|raamatukogu|raamatukogu\nabstract|teesid|teesid\nannotation|kommentaarid|kommentaarid\ncommonera|meie ajaarvamise j\\\"argi|m\\adddot a\\adddot j\nbeforecommonera|enne meie ajaarvamist|e\\adddot m\\adddot a\nannodomini|p\\\"arast Kristust|pKr\nbeforechrist|enne Kristust|eKr\nspring|kevadel|kevadel\nsummer|suvel|suvel\nwinter|talvel|talvel\nam|AM|AM\npm|PM|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/finnish.lbx.strings",
    "content": "bibliography|Kirjallisuusluettelo|Kirjallisuus\nreferences|Viitteet|Viitteet\nshorthands|Lyhenteet|Lyhenteet\neditor|toimittanut|toim\\adddot\neditors|toimittaneet|toim\\adddot\ncompiler|koontanut|koontanut\ncompilers|koontaneet|koontaneet\nredactor|toimittanut|toim\\adddot\nredactors|toimittaneet|toim\\adddot\nreviser|toimittanut|toim\\adddot\nrevisers|toimittaneet|toim\\adddot\nfounder|perustaja|perustaja\nfounders|perustajat|perustajat\ncontinuator|jatkaja|jatkaja\ncontinuators|jatkajat|jatkajat\ncollaborator|avustaja|avustaja\ncollaborators|avustajat|avustajat\ntranslator|k\\\"a\\\"ant\\\"anyt|k\\\"a\\\"ant\\adddot\ntranslators|k\\\"a\\\"ant\\\"anyt|k\\\"a\\\"ant\\adddot\ncommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut\ncommentators|kommentaarin kirjoittaneet|kommentaarin kirjoittaneet\nannotator|selityksin varustanut|selityksin varustanut\nannotators|selityksin varustaneet|selityksin varustaneet\ncommentary|kommentaari|kommentaari\nannotations|selitykset|selitykset\nintroduction|johdanto|johdanto\nforeword|esipuhe|esipuhe\nafterword|j\\\"alkisanat|j\\\"alkisanat\norganizer|toimittanut|toim\\adddot\norganizers|toimittaneet|toim\\adddot\nbyorganizer|toimittanut|toim\\adddot\nbyauthor|kirjoittanut|kirj\\adddot\nbyeditor|toimittanut|toim\\adddot\nbycompiler|koontanut|koontanut\nbyredactor|toimittanut|toim\\adddot\nbyreviser|toimittanut|toim\\adddot\nbyreviewer|toimittanut|toim\\adddot\nbyfounder|perustanut|perustanut\nbycontinuator|jatkanut|jatkanut\nbycollaborator|yhteisty\\\"oss\\\"a|yhteisty\\\"oss\\\"a\nbytranslator|\\lbx@lfromlang k\\\"a\\\"ant\\\"anyt|\\lbx@sfromlang k\\\"a\\\"ant\\adddot\nbycommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut\nbyannotator|selityksin varustanut|selityksin varustanut\nwithcommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut\nwithannotator|selityksin varustanut|selityksin varustanut\nwithintroduction|johdannon kirjottanut|johdannon kirjottanut\nwithforeword|esipuheen kirjoittanut|esipuheen kirjoittanut\nwithafterword|j\\\"alkisanat kirjoittanut|j\\\"alkisanat kirjoittanut\nand|ja|ja\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|jne\\adddot|jne\\adddot\nvolume|volyymi|vol\\adddot\nvolumes|volyymit|vol\\adddot\ninvolumes||\njourvol|volyymi|vol\\adddot\njourser|sarja|sarja\nbook|kirja|kirja\npart|osa|osa\nissue|numero|numero\nnewseries|uusi sarja|uusi sarja\noldseries|vanha sarja|vanha sarja\nedition|painos|painos\nreprint|j\\\"alkipainos|j\\\"alkipainos\nreprintof|julkaistu aiemmin nimell\\\"a|julkaistu aiemmin nimell\\\"a\nreprintas|julkaistu uudelleen nimell\\\"a|julkaistu uudelleen nimell\\\"a\nreprintfrom|julkaistu aiemmin nimell\\\"a|julkaistu aiemmin nimell\\\"a\ntranslationof|k\\\"a\\\"ann\\\"os teoksesta|k\\\"a\\\"ann\\\"os teoksesta\ntranslationas|k\\\"a\\\"annetty nimell\\\"a|k\\\"a\\\"annetty nimell\\\"a\ntranslationfrom|k\\\"a\\\"annetty kielest\\\"a|k\\\"a\\\"annetty kielest\\\"a\nreviewof|arvostelu teoksesta|arvostelu teoksesta\norigpubas|julkaistu ensi kerran nimell\\\"a|julkaistu ensi kerran nimell\\\"a\norigpubin|julkaistu ensi kerran vuonna|julkaistu ensi kerran vuonna\nastitle|nimell\\\"a|nimell\\\"a\nbypublisher|julkaissut|julkaissut\npage|sivu|s\\adddot\npages|sivut|s\\adddot\ncolumn|palsta|palsta\ncolumns|palstat|palstat\nline|rivi|rivi\nlines|rivit|rivit\nnodate|ei julkaisup\\\"aiv\\\"a\\\"a|ei julkaisup\\\"aiv\\\"a\\\"a\nverse|s\\\"ae|s\\\"ae\nverses|s\\\"akeet|s\\\"akeet\nsection|kohta|kohta\nsections|kohdat|kohdat\nparagraph|kappale|kappale\nparagraphs|kappaleet|kappaleet\npagetotal|sivu|s\\adddot\npagetotals|sivut|s\\adddot\ncolumntotal|palsta|palsta\ncolumntotals|palstat|palstat\nlinetotal|rivi|rivi\nlinetotals|rivit|rivit\nversetotal|s\\\"ae|s\\\"ae\nversetotals|s\\\"akeet|s\\\"akeet\nsectiontotal|kohta|kohta\nsectiontotals|kohdat|kohdat\nparagraphtotal|kappale|kappale\nparagraphtotals|kappaleet|kappaleet\nin|teoksessa|teoksessa\ninseries|sarjassa|sarjassa\nofseries|sarjassa|sarjassa\nnumber|numero|nro\nchapter|luku|luku\nbathesis|tutkielma|tutkielma\nmathesis|tutkielma|tutkielma\nphdthesis|tohtorinv\\\"ait\\\"oskirja|tohtorinv\\\"ait\\\"oskirja\ncandthesis|kanditaatintutkielma|kanditaatintutkielma\nresreport|tutkimusraportti|tutkimusraportti\ntechreport|tekninen raportti|tekninen raportti\nsoftware|ohjelmisto|ohjelmisto\ndatacd|data-CD|data-CD\naudiocd|\\\"a\\\"ani-CD|\\\"a\\\"ani-CD\nversion|versio|versio\nurl|url|url\nurlfrom|saatavilla osoitteesta|saatavilla osoitteesta\nurlseen|viitattu|viitattu\ninpreparation|valmisteilla|valmisteilla\nsubmitted|l\\\"ahetetty|l\\\"ahetetty\nforthcoming|hyv\\\"aksytty julkaistavaksi|hyv\\\"aksytty julkaistavaksi\ninpress|painossa|painossa\nprepublished|esijulkaistu|esijulkaistu\ncitedas|jatkossa|jatkossa\nthiscite|sama|sama\nseenote|katso viite|katso viite\nquotedin|lainattu teoksessa|lainattu teoksessa\nidem|idem|id\\adddot\nidemsf|idem|id\\adddot\nidemsm|idem|id\\adddot\nidemsn|idem|id\\adddot\nidempf|idem|id\\adddot\nidempm|idem|id\\adddot\nidempn|idem|id\\adddot\nidempp|idem|id\\adddot\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|pass\\adddot\nsee|katso|ks\\adddot\nseealso|katso my\\\"os|katso my\\\"os\nbackrefpage|katso sivu|ks\\adddotspace s\\adddot\nbackrefpages|katso sivut|ks\\adddotspace s\\adddot\njanuary|tammikuuta|tammikuuta\nfebruary|helmikuuta|helmikuuta\nmarch|maaliskuuta|maaliskuuta\napril|huhtikuuta|huhtikuuta\nmay|toukokuuta|toukokuuta\njune|kes\\\"akuuta|kes\\\"akuuta\njuly|hein\\\"akuuta|hein\\\"akuuta\naugust|elokuuta|elokuuta\nseptember|syyskuuta|syyskuuta\noctober|lokakuuta|lokakuuta\nnovember|marraskuuta|marraskuuta\ndecember|joulukuuta|joulukuuta\nbasicjanuary|tammikuu|tammikuu\nbasicfebruary|helmikuu|helmikuu\nbasicmarch|maaliskuu|maaliskuu\nbasicapril|huhtikuu|huhtikuu\nbasicmay|toukokuu|toukokuu\nbasicjune|kes\\\"akuu|kes\\\"akuu\nbasicjuly|hein\\\"akuu|hein\\\"akuu\nbasicaugust|elokuu|elokuu\nbasicseptember|syyskuu|syyskuu\nbasicoctober|lokakuu|lokakuu\nbasicnovember|marraskuu|marraskuu\nbasicdecember|joulukuu|joulukuu\nlangamerican|amerikanenglanti|amerikanenglanti\nlangbrazilian|brasilianportugali|brasilianportugali\nlangbulgarian|bulgaria|bulgaria\nlangcatalan|katalonia|katalonia\nlangcroatian|kroatia|kroatia\nlangdanish|tanska|tanska\nlangdutch|hollanti|hollanti\nlangenglish|englanti|englanti\nlangestonian|viro|viro\nlangfinnish|suomi|suomi\nlangfrench|ranska|ranska\nlanggalician|galicia|galicia\nlanggerman|saksa|saksa\nlanggreek|kreikka|kreikka\nlanghungarian|unkari|unkari\nlangitalian|italia|italia\nlanglatin|latina|latina\nlanglatvian|latvia|latvia\nlangnorwegian|norja|norja\nlangpolish|puola|puola\nlangportuguese|portugali|portugali\nlangrussian|ven\\\"aj\\\"a|ven\\\"aj\\\"a\nlangslovak|slovakia|slovakia\nlangslovene|slovenia|slovenia\nlangspanish|espanja|espanja\nlangswedish|ruotsi|ruotsi\nfromamerican|englannin kielest\\\"a|englannin kielest\\\"a\nfrombrazilian|portugalin kielest\\\"a|portugalin kielest\\\"a\nfrombulgarian|bulgarian kielest\\\"a|bulgarian kielest\\\"a\nfromcatalan|katalonian kielest\\\"a|katalonian kielest\\\"a\nfromcroatian|kroatian kielest\\\"a|kroatian kielest\\\"a\nfromdanish|tanskan kielest\\\"a|tanskan kielest\\\"a\nfromdutch|hollannin kielest\\\"a|hollannin kielest\\\"a\nfromenglish|englannin kielest\\\"a|englannin kielest\\\"a\nfromestonian|viron kielest\\\"a|viron kielest\\\"a\nfromfinnish|suomen kielest\\\"a|suomen kielest\\\"a\nfromfrench|ranskan kielest\\\"a|ranskan kielest\\\"a\nfromgalician|galician kielest\\\"a|galician kielest\\\"a\nfromgerman|saksan kielest\\\"a|saksan kielest\\\"a\nfromgreek|kreikan kielest\\\"a|kreikan kielest\\\"a\nfromhungarian|unkarin kielest\\\"a|unkarin kielest\\\"a\nfromitalian|italian kielest\\\"a|italian kielest\\\"a\nfromlatin|latinan kielest\\\"a|latinan kielest\\\"a\nfromlatvian|latvian kielest\\\"a|latvian kielest\\\"a\nfromnorwegian|norjan kielest\\\"a|norjan kielest\\\"a\nfrompolish|puolan kielest\\\"a|puolan kielest\\\"a\nfromportuguese|portugalin kielest\\\"a|portugalin kielest\\\"a\nfromrussian|ven\\\"aj\\\"an kielest\\\"a|ven\\\"aj\\\"an kielest\\\"a\nfromslovak|slovakian kielest\\\"a|slovakian kielest\\\"a\nfromslovene|slovenian kielest\\\"a|slovenian kielest\\\"a\nfromspanish|espanjan kielest\\\"a|espanjan kielest\\\"a\nfromswedish|ruotsin kielest\\\"a|ruotsin kielest\\\"a\ncountryde|Saksa|DE\ncountryeu|Euroopan Unioni|EU\ncountryep|Euroopan Unioni|EP\ncountryfr|Ranska|FR\ncountryuk|Iso-Britannia|GB\ncountryus|Yhdysvallat|US\npatent|patentti|pat\\adddot\npatentde|saksalainen patentti|saksalainen pat\\adddot\npatenteu|Euroopan Unionin patentti|Euroopan Unionin pat\\adddot\npatentfr|ranskalainen patentti|ranskalainen pat\\adddot\npatentuk|isobritannialainen patentti|isobritannialainen pat\\adddot\npatentus|yhdysvaltalainen patentti|yhdysvaltalainen pat\\adddot\npatreq|patenttihakemus|pat\\adddot\\ hak\\adddot\npatreqde|saksalainen patenttihakemus|saksalainen pat\\adddot\\ hak\\adddot\npatreqeu|Euroopan Unionin patenttihakemus|Euroopan Unionin pat\\adddot\\ hak\\adddot\npatreqfr|ranskalainen patenttihakemus|ranskalainen pat\\adddot\\ hak\\adddot\npatrequk|isobritannialainen patenttihakemus|isobritannialainen pat\\adddot\\ hak\\adddot\npatrequs|yhdysvaltalainen patenttihakemus|yhdysvaltalainen pat\\adddot\\ hak\\adddot\nfile|tiedosto|tiedosto\nlibrary|kirjasto|kirjasto\nabstract|tiivistelm\\\"a|tiivistelm\\\"a\nannotation|selitykset|selitykset\ncommonera|j\\\"alkeen ajanlaskun alun|jaa\\adddot\nbeforecommonera|ennen ajanlaskun alkua|eaa\\adddot\nannodomini|j\\\"alkeen Kristuksen syntym\\\"an|jKr\\adddot\nbeforechrist|ennen Kristuksen syntym\\\"a\\\"a|eKr\\adddot\ncirca|noin|n\\adddot\nspring|kev\\\"at|kev\\\"at\nsummer|kes\\\"a|kes\\\"a\nautumn|syksy|syksy\nwinter|talvi|talvi\nam|ap\\adddot|ip\\adddot\npm|ip\\adddot|ip\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/french.lbx.strings",
    "content": "bibliography|Bibliographie|Bibliographie\nreferences|R\\'ef\\'erences|R\\'ef\\'erences\nshorthands|Liste des abr\\'eviations|Abr\\'eviations\neditor|\\'editeur|\\'ed\\adddot\neditors|\\'editeurs|\\'ed\\adddot\ncompiler|compilateur|comp\\adddot\ncompilers|compilateurs|comp\\adddot\nredactor|r\\'edacteur|r\\'ed\\adddot\nredactors|r\\'edacteurs|r\\'ed\\adddot\nreviser|r\\'eviseur|r\\'ev\\adddot\nrevisers|r\\'eviseurs|r\\'ev\\adddot\nfounder|fondateur|fond\\adddot\nfounders|fondateurs|fond\\adddot\ncontinuator|continuateur|cont\\adddot\ncontinuators|continuateurs|cont\\adddot\ncollaborator|collaborateur|coll\\adddot\ncollaborators|collaborateurs|coll\\adddot\ntranslator|traducteur|trad\\adddot\ntranslators|traducteurs|trad\\adddot\ncommentator|commentateur|comm\\adddot\ncommentators|commentateurs|comm\\adddot\nannotator|annotateur|annot\\adddot\nannotators|annotateurs|annot\\adddot\ncommentary|commentaires|comment\\adddot\nannotations|annotations|annot\\adddot\nintroduction|introduction|introd\\adddot\nforeword|pr\\'eface|pr\\'ef\\adddot\nafterword|postface|postf\\adddot\neditortr|\\'editeur et traducteur|\\'ed\\adddotspace et trad\\adddot\neditorstr|\\'editeurs et traducteurs|\\'ed\\adddotspace et trad\\adddot\norganizer|organisateur|org\\adddot\norganizers|organisateurs|org\\adddot\nbyorganizer|organis\\'e par|org\\adddotspace par\nbyauthor|par|par\nbyeditor|sous la direction \\smartof|sous la dir\\adddotspace\\smartof\nbycompiler|compil\\'e par|comp\\adddotspace par\nbyredactor|r\\'edig\\'e par|r\\'ed\\adddotspace par\nbyreviser|r\\'evis\\'e par|r\\'ev\\adddotspace par\nbyreviewer|examin\\'e par|ex\\adddotspace par\nbyfounder|d\\'ecouvert par|d\\'ecouv\\adddotspace par\nbycontinuator|continu\\'e par|cont\\adddotspace par\nbytranslator|traduit \\lbx@lfromlang\\ par|trad\\adddotspace \\lbx@sfromlang\\ par\nbycommentator|comment\\'e par|comm\\adddotspace par\nbyannotator|annot\\'e par|annot\\adddotspace par\nwithcommentator|avec des commentaires \\smartof|avec des comment\\adddotspace\\smartof\nwithannotator|avec des annotations \\smartof|avec des annot\\adddotspace\\smartof\nwithintroduction|avec une introduction \\smartof|avec une introd\\adddotspace\\smartof\nwithforeword|avec une pr\\'eface \\smartof|avec une pr\\'ef\\adddotspace\\smartof\nwithafterword|avec une postface \\smartof|avec une postf\\adddotspace\\smartof\nand|et|et\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nvolume|tome|t\\adddot\nvolumes|tomes|t\\adddot\ninvolumes|en|en\njourvol|tome|t\\adddot\njourser|s\\'erie|s\\'er\\adddot\nbook|livre|livre\npart|partie|partie\nissue|\\'edition|\\'ed\\adddot\nnewseries|nouvelle s\\'erie|nouv\\adddotspace s\\'er\\adddot\noldseries|ancienne s\\'erie|anc\\adddotspace s\\'er\\adddot\nedition|\\'edition|\\'ed\\adddot\nreprint|r\\'eimpression|r\\'eimpr\\adddot\nreprintof|r\\'eimpression de|r\\'eimpr\\adddotspace de\nreprintas|r\\'eimpression sous le titre|r\\'eimpr\\adddotspace sous le titre\nreprintfrom|r\\'eimpression \\`a partir \\smartof|r\\'eimpr\\adddotspace \\`a part\\adddotspace\\smartof\ntranslationof|traduction de|trad\\adddotspace de\ntranslationas|traduit sous le titre|trad\\adddotspace sous le titre\ntranslationfrom|traduit de|trad\\adddotspace de\nreviewof|critique de|crit.\\adddotspace de\norigpubas|publi\\'e \\`a l'origine sous le titre|pub\\adddotspace \\`a l'orig\\adddotspace sous le titre\norigpubin|publi\\'e \\`a l'origine en|pub\\adddotspace \\`a l'orig\\adddotspace en\nastitle|sous le titre|sous le titre\nbypublisher|par|par\npage|page|p\\adddot\npages|pages|p\\adddot\ncolumn|colonne|col\\adddot\ncolumns|colonnes|col\\adddot\nline|ligne|l\\adddot\nlines|lignes|l\\adddot\nverse|vers|v\\adddot\nverses|vers|v\\adddot\nsection|section|sect\\adddot\nsections|sections|sect\\adddot\nparagraph|paragraphe|\\S\nparagraphs|paragraphes|\\S\npagetotal|page|p\\adddot\npagetotals|pages|p\\adddot\ncolumntotal|colonne|col\\adddot\ncolumntotals|colonnes|col\\adddot\nlinetotal|ligne|l\\adddot\nlinetotals|lignes|l\\adddot\nversetotal|vers|v\\adddot\nversetotals|vers|v\\adddot\nsectiontotal|section|sect\\adddot\nsectiontotals|sections|sect\\adddot\nparagraphtotal|paragraphe|\\S\nparagraphtotals|paragraphes|\\S\nin|in|in\ninseries|in|in\nofseries|de|de\nnumber|num\\'ero|n\\textsuperscript{o\nchapter|chapitre|chap\\adddot\nbathesis|m\\'emoire de bachelor|m\\'em\\adddotspace de bach\\adddot\nmathesis|m\\'emoire de master|m\\'em\\adddotspace de mast\\adddot\nphdthesis|th\\`ese de doctorat|th\\`ese de doct\\adddot\ncandthesis|th\\`ese de candidature|th\\`ese de cand\\adddot\nresreport|rapport scientifique|rapp\\adddotspace scient\\adddot\ntechreport|rapport technique|rapp\\adddotspace tech\\adddot\nsoftware|logiciel|logiciel\ndatacd|c\\'ed\\'erom|c\\'ed\\'erom\naudiocd|disque compact audio|CD\nversion|version|version\nurl|adresse|adresse\nurlfrom|disponible \\`a l'adresse|disp\\adddotspace \\`a l'adr\\adddot\nurlseen|visit\\'e le|visit\\'e le\ninpreparation|en pr\\'eparation|en pr\\'ep\\adddot\nsubmitted|soumis|soumis\ninpress|sous presse|sous presse\nprepublished|pr\\'epubli\\'e|pr\\'epubl\\adddot\ncitedas|d\\'esign\\'e ci-apr\\`es par|ci-apr\\`es\nthiscite|sp\\'ecialement|sp\\'ec\\adddot\nseenote|voir note|cf\\adddotspace note\nquotedin|cit\\'e dans|cit\\'e dans\nidem|idem|idem\nidemsm|idem|idem\nidemsf|eadem|eadem\nidemsn|idem|idem\nidempm|eidem|eidem\nidempf|eaedem|eaedem\nidempn|eadem|eadem\nidempp|eidem|eidem\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|pass\\adddot\nsee|cf\\adddot|cf\\adddot\nseealso|cf\\adddotspace aussi|cf\\adddotspace aussi\nbackrefpage|cf\\adddotspace page|cf\\adddotspace p\\adddot\nbackrefpages|cf\\adddotspace pages|cf\\adddotspace p\\adddot\njanuary|janvier|jan\\adddot\nfebruary|f\\'evrier|f\\'ev\\adddot\nmarch|mars|mars\napril|avril|avr\\adddot\nmay|mai|mai\njune|juin|juin\njuly|juillet|juill\\adddot\naugust|ao\\^ut|ao\\^ut\nseptember|septembre|sept\\adddot\noctober|octobre|oct\\adddot\nnovember|novembre|nov\\adddot\ndecember|d\\'ecembre|d\\'ec\\adddot\nlangamerican|am\\'ericain|am\\'ericain\nlangbrazilian|br\\'esilien|br\\'esilien\nlangbulgarian|bulgare|bulgare\nlangcatalan|catalan|catalan\nlangcroatian|croate|croate\nlangczech|tch\\`eque|tch\\`eque\nlangdanish|danois|danois\nlangdutch|n\\'eerlandais|n\\'eerlandais\nlangenglish|anglais|anglais\nlangestonian|estonien|estonien\nlangfinnish|finnois|finnois\nlanggalician|galicien|galicien\nlanggerman|allemand|allemand\nlanggreek|grec|grec\nlanghungarian|hongrois|hongrois\nlangitalian|italien|italien\nlangjapanese|japonais|japonais\nlanglatin|latin|latin\nlanglatvian|letton|letton\nlangnorwegian|norv\\'egien|norv\\'egien\nlangpolish|polonais|polonais\nlangportuguese|portugais|portugais\nlangrussian|russe|russe\nlangserbian|serbe|serbe\nlangslovak|slovaque|slovaque\nlangslovene|slov\\`ene|slov\\`ene\nlangspanish|espagnol|espagnol\nlangswedish|su\\'edois|su\\'edois\nlangukrainian|ukrainien|ukrainien\nfromamerican|de l'am\\'ericain|de l'am\\'ericain\nfrombrazilian|du br\\'esilien|du br\\'esilien\nfrombulgarian|du bulgare|du bulgare\nfromcatalan|du catalan|du catalan\nfromcroatian|du croate|du croate\nfromczech|du tch\\`eque|du tch\\`eque\nfromdanish|du danois|du danois\nfromdutch|du n\\'eerlandais|du n\\'eerlandais\nfromenglish|de l'anglais|de l'anglais\nfromestonian|de l'estonien|de l'estonien\nfromfinnish|du finnois|du finnois\nfromgalician|du galicien|du galicien\nfromgerman|de l'allemand|de l'allemand\nfromgreek|du grec|du grec\nfromhungarian|du hongrois|du hongrois\nfromitalian|de l'italien|de l'italien\nfromjapanese|du japonais|du japonais\nfromlatin|du latin|du latin\nfromlatvian|du letton|du letton\nfromnorwegian|du norv\\'egien|du norv\\'egien\nfrompolish|du polonais|du polonais\nfromportuguese|du portugais|du portugais\nfromrussian|du russe|du russe\nfromserbian|du serbe|du serbe\nfromslovak|du slovaque|du slovaque\nfromslovene|du slov\\`ene|du slov\\`ene\nfromspanish|de l'espagnol|de l'espagnol\nfromswedish|du su\\'edois|du su\\'edois\nfromukrainian|de l'ukrainien|de l'ukrainien\ncountryde|Allemagne|DE\ncountryeu|Union europ\\'eenne|EU\ncountryep|Union europ\\'eenne|EP\ncountryfr|France|FR\ncountryuk|Royaume-Uni|GB\ncountryus|\\'Etats-Unis|US\npatent|brevet|brev\\adddot\npatentde|brevet allemand|brev\\adddotspace allem\\adddot\npatenteu|brevet europ\\'een|brev\\adddotspace europ\\adddot\npatentuk|brevet britannique|brev\\adddotspace brit\\adddot\npatentus|brevet am\\'ericain|brev\\adddotspace am\\'er\\adddot\npatreq|demande de brevet|demande de brev\\adddot\npatreqde|demande de brevet allemand|demande de brev\\adddotspace allem\\adddot\npatreqeu|demande de brevet europ\\'een|demande de brev\\adddotspace europ\\adddot\npatrequk|demande de brevet britannique|demande de brev\\adddotspace brit\\adddot\npatrequs|demande de brevet am\\'ericain|demande de brev\\adddotspace am\\'er\\adddot\nfile|fichier|fichier\nlibrary|biblioth\\`eque|biblioth\\adddot\nabstract|r\\'esum\\'e|r\\'es\\adddot\nannotation|annotations|annotations\ncommonera|de l'\\`ere commune|EC\nbeforecommonera|avant l'\\`ere commune|AEC\nannodomini|apr\\`es J\\'esus-Christ|apr\\adddotspace J\\adddot-C\\adddot\nbeforechrist|avant J\\'esus-Christ|av\\adddotspace J\\adddot-C\\adddot\ncirca|vers|vers\nspring|printemps|printemps\nsummer|\\'et\\'e|\\'et\\'e\nautumn|automne|automne\nwinter|hiver|hiver\nam|AM|AM\npm|PM|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/galician.lbx.strings",
    "content": "bibliography|Bibliograf\\'ia|Bibliograf\\'ia\nreferences|Referencias|Referencias\nshorthands|Lista de abreviaturas|Abreviaturas\neditor|editor|ed\\adddot\neditors|editores|eds\\adddot\ncompiler|compilador|comp\\adddot\ncompilers|compiladores|comp\\adddot\nredactor|redactor|red\\adddot\nredactors|redactores|red\\adddot\nreviser|revisor|rev\\adddot\nrevisers|revisores|revs\\adddot\nfounder|fundador|fund\\adddot\nfounders|fundadores|fund\\adddot\ncontinuator|continuador|cont\\adddot\ncontinuators|continuadores|cont\\adddot\ncollaborator|colaborador|col\\adddot\ncollaborators|colaboradores|cols\\adddot\ntranslator|tradutor|trad\\adddot\ntranslators|tradutores|trads\\adddot\ncommentator|comentador|coment\\adddot\ncommentators|comentadores|coments\\adddot\nannotator|anotador|anot\\adddot\nannotators|anotadores|anots\\adddot\ncommentary|comentario|coment\\adddot\nannotations|notas|notas\nintroduction|introduci\\'on|introd\\adddot\nforeword|prefacio|pref\\adddot\nafterword|posfacio|posf\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/german.lbx.strings",
    "content": "bibliography|Literaturverzeichnis|Literatur\nreferences|Literaturverzeichnis|Literatur\nshorthands|Sigelverzeichnis|Sigel\neditor|Herausgeber|Hrsg\\adddot\neditors|Herausgeber|Hrsg\\adddot\ncompiler|Kompilator|Komp\\adddot\ncompilers|Kompilatoren|Komp\\adddot\nredactor|Bearbeiter|Bearb\\adddot\nredactors|Bearbeiter|Bearb\\adddot\nreviser|\\\"Uberarbeiter|\\\"Uberarb\\adddot\nrevisers|\\\"Uberarbeiter|\\\"Uberarb\\adddot\nfounder|Begr\\\"under|Begr\\adddot\nfounders|Begr\\\"under|Begr\\adddot\ncontinuator|Fortf\\\"uhrer|Fortf\\adddot\ncontinuators|Fortf\\\"uhrer|Fortf\\adddot\ncollaborator|Mitarbeiter|Mitarb\\adddot\ncollaborators|Mitarbeiter|Mitarb\\adddot\ntranslator|\\\"Ubersetzer|\\\"Ubers\\adddot\ntranslators|\\\"Ubersetzer|\\\"Ubers\\adddot\ncommentator|Kommentator|Komm\\adddot\ncommentators|Kommentatoren|Komm\\adddot\nannotator|Kommentator|Komm\\adddot\nannotators|Kommentatoren|Komm\\adddot\ncommentary|Kommentar|Komm\\adddot\nannotations|Erl\\\"auterungen|Erl\\\"aut\\adddot\nintroduction|Einleitung|Einl\\adddot\nforeword|Vorwort|Vorw\\adddot\nafterword|Nachwort|Nachw\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/greek.lbx.strings",
    "content": "bibliography|Βιβλιογραφία|Βιβλιογραφία\nreferences|Αναφορές|Αναφορές\nshorthands|Κατάλογος συντμήσεων|Συντμήσεις\neditor|επιμελητής|επιμελητής\neditors|επιμελητές|επιμελητές\ncompiler|συντάκτης|συντάκτης\ncompilers|συντάκτες|συντάκτες\nredactor|συντάκτης|συντάκτης\nredactors|συντάκτες|συντάκτες\n"
  },
  {
    "path": "citeproc/biblatex-localization/hungarian.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/icelandic.lbx.strings",
    "content": "bibliography|Heimildaskr\\'a|Heimildaskr\\'a\nreferences|Heimildir|Heimildir\nshorthands|Listi yfir skammstafanir|Skammstafanir\neditor|ristj\\'ori|ritstj\\adddot\neditors|ritstj\\'orar|ritstj\\adddot\ncompiler|samantekt|samantekt\ncompilers|samantekt|samantekt\n"
  },
  {
    "path": "citeproc/biblatex-localization/italian.lbx.strings",
    "content": "bibliography|Bibliografia|Bibliografia\nreferences|Riferimenti bibliografici|Riferimenti bibliografici\nshorthands|Elenco delle sigle|Sigle\neditor|curatore|cur\\adddot\neditors|curatori|cur\\adddot\ncompiler|compilatore|comp\\adddot\ncompilers|compilatori|comp\\adddot\nredactor|redattore|red\\adddot\nredactors|redattori|red\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/latvian.lbx.strings",
    "content": "redactor|redaktors|redakt\\adddot\nredactors|redaktori|radakt\\adddot\nreviser|revidents|revid\\adddot\nrevisers|revidenti|revid\\adddot\nintroduction|ievads|ievads\nbyeditor|izdevis|izdevis\nbytranslator|tulkojis|tulk\\adddot\nwithintroduction|ar ievadu no|ar ievadu no\nbyeditortr|izdevis un tulkojis|izdev\\adddotspace un tulk\\adddot\nand|un|un\nandothers|un citi|u\\adddotspace c\\adddot\njourvol|izdevums|izdev\\adddot\nissue|izdevums|izdev\\adddot\nedition|izdevums|izdev\\adddot\ntranslationof|tulkojums no|tulk\\adddotspace no\ntranslationfrom|tulkots no|tulk\\adddotspace no\nreviewof|recenzija|recenz\\adddot\nbypublisher|no|no\nnodate|bez datuma|bez dat\\adddot\npage|lappuse|lpp\\adddot\npages|lappuses|lpp\\adddot\ncolumn|sleja|sleja\ncolumns|slejas|slejas\nline|rinda|rinda\nlines|rindas|rindas\nverse|pants|pants\nverses|panti|panti\nparagraph|rindkopa|rindk\\adddot\nparagraphs|rindkopas|rindk\\adddot\npagetotal|lappuse|lpp\\adddot\npagetotals|lappuses|lpp\\adddot\ncolumntotal|sleja|sleja\ncolumntotals|slejas|slejas\nlinetotal|rinda|rinda\nlinetotals|rindas|rindas\nversetotal|pants|pants\nversetotals|panti|panti\nparagraphtotal|rindkopa|rindk\\adddot\nparagraphtotals|rindkopas|rindk\\adddot\nin||\nnumber|numurs|nr\\adddot\ndatacd|datu CD|datu CD\naudiocd|audio CD|audio CD\nversion|versija|versija\nurl|pieejams|pieejams\nurlfrom|pieejams no|pieejams no\ninpreparation|tiek gatavots|tiek gatavots\nsubmitted|iesniegts|iesniegts\nmarch|marts|marts\nmay|maijs|maijs\naugust|augusts|aug\\adddot\nseptember|septembris|sept\\adddot\noctober|oktobris|okt\\adddot\nnovember|novembris|nov\\adddot\ndecember|decembris|dec\\adddot\nlangfinnish|somu|somu\nlangrussian|krievu|krievu\nlangswedish|zviedru|zviedru\nfromfinnish|no somu|no somu\nfromrussian|no krievu|no krievu\nfromswedish|no zviedru|no zviedru\ncountryep|Eiropas Parlaments|EP\ncountryfr|Francija|FR\npatent|patents|patents\npatenteu|Eiropas patents|Eiropas pat\\adddot\npatentus|ASV patents|ASV pat\\adddot\nfile|fails|fails\ncirca|ap|ap\nspring|pavasaris|pav\\adddot\nsummer|vasara|vas\\adddot\nautumn|rudens|rud\\adddot\nwinter|ziema|ziema\nam|AM|AM\npm|PM|PM\ndateyear|gada|g\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/lithuanian.lbx.strings",
    "content": "bibliography|Bibliografija|Bibliografija\nreferences|Literatūros sąrašas|Literatūra\nshorthands|Santrumpų sąrašas|Santrumpos\neditor|sudarytojas|sud\\adddot\neditors|sudarytojai|sud\\adddot\ncompiler|parengėjas|pareng\\adddot\ncompilers|parengėjai|pareng\\adddot\nredactor|redaktorius|red\\adddot\nredactors|redaktoriai|red\\adddot\nreviser|korektorius|kor\\adddot\nrevisers|korektoriai|kor\\adddot\nfounder|pradininkas|prad\\adddot\nfounders|pradininkai|prad\\adddot\ncontinuator|tęsėjas|tęs\\adddot\ncontinuators|tęsėjai|tęs\\adddot\ncollaborator|bendradarbis|bendr\\adddot\ncollaborators|bendradarbiai|bendr\\adddot\ntranslator|vertėjas|vert\\adddot\ntranslators|vertėjai|vert\\adddot\ncommentator|komentarų autorius|koment\\adddotspace aut\\adddot\ncommentators|komentarų autoriai|koment\\adddotspace aut\\adddot\nannotator|paaiškinimų autorius|paaišk\\adddotspace aut\\adddot\nannotators|paaiškinimų autoriai|paaišk\\adddotspace aut\\adddot\ncommentary|komentarai|koment\\adddot\nannotations|paaiškinimai|paaišk\\adddot\nintroduction|įvadas|įv\\adddot\nforeword|pratarmė|prat\\adddot\nafterword|pabaigos žodis|pab\\adddotspace žodis\norganizer|organizatorius|org\\adddot\norganizers|organizatoriai|org\\adddot\nbyorganizer|organizavo|org\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/magyar.lbx.strings",
    "content": "bibliography|Irodalomjegyz\\'ek|Irodalom\nreferences|Hivatkoz\\'asok|Hivatkoz\\'asok\nshorthands|R\\\"ovid\\'it\\'esek jegyz\\'eke|R\\\"ovid\\'it\\'esek\ncompiler|\\\"ossze\\'all\\'it\\'o|\\\"ossze\\'all\\adddot\ncompilers|\\\"ossze\\'all\\'it\\'ok|\\\"ossze\\'all\\adddot\nreviser|korrektor|korr\\adddot\nrevisers|korrektorok|korr\\adddot\nfounder|alap\\'it\\'o|alap\\adddot\nfounders|alap\\'it\\'ok|alap\\adddot\n%continuator||\n%continuators||\ntranslator|ford\\'it\\'o|ford\\adddot\ntranslators|ford\\'it\\'ok|ford\\adddot\ncommentator|komment\\'ator|komm\\adddot\ncommentators|komment\\'atorok|komm\\adddot\nannotator|jegyzetek \\'ir\\'oja|jegyz\\adddot\nannotators|jegyzetek \\'ir\\'oi|jegyz\\adddot\ncommentary|komment\\'ar|komm\\adddot\nannotations|jegyzetek|jegyz\\adddot\nintroduction|bevezet\\'es|bev\\adddot\nafterword|ut\\'osz\\'o|ut\\'osz\\'o\nbyorganizer|szervezte|szerv\\adddot\nbyauthor|\\'irta|\\'irta\nbyeditor|szerkesztette|szerk\\adddot\nbycompiler|\\\"ossze\\'all\\'itotta|\\\"ossze\\'all\\adddot\nbyredactor|sajt\\'o al\\'a rendezte|kiad\\adddot\nbyreviser|jav\\'itotta|jav\\adddot\nbyreviewer|b\\'ir\\'alta|b\\'ir\\adddot\nbyfounder|alap\\'itotta|alap\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/naustrian.lbx.strings",
    "content": "citedas|im Folgenden zitiert als|im Folgenden zit\\adddotspace als\njanuary|J\\\"anner|J\\\"an\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/newzealand.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/ngerman.lbx.strings",
    "content": "citedas|im Folgenden zitiert als|im Folgenden zit\\adddotspace als\n"
  },
  {
    "path": "citeproc/biblatex-localization/norsk.lbx.strings",
    "content": "bibliography|Bibliografi|Bibliografi\nreferences|Referanser|Referanser\nshorthands|Forkortelser|Forkortelser\ncompiler|kompilator|komp\\adddot\ncompilers|kompilatorer|komp\\adddot\nredactor|bearbeidelse|bearb\\adddot\nredactors|bearbeidelse|bearb\\adddot\nreviser|revisjon|rev\\adddot\nrevisers|revisjon|rev\\adddot\nfounder|grunnlegger|grunnl\\adddot\nfounders|grunnleggere|grunnl\\adddot\ncollaborator|samarbeid|samarb\\adddot\ncollaborators|samarbeid|samarb\\adddot\ntranslator|oversetter|overs\\adddot\ntranslators|oversettere|overs\\adddot\ncommentator|kommentarer|komm\\adddot\ncommentators|kommentarer|komm\\adddot\nannotator|forklaringer|forkl\\adddot\nannotators|forklaringer|forkl\\adddot\ncommentary|kommentarer|komm\\adddot\nannotations|forklaringer|forkl\\adddot\nintroduction|innledning|innl\\adddot\nforeword|forord|forord\nafterword|etterord|etterord\norganizer|organisator|org\\adddot\norganizers|organisatorer|org\\adddot\nbyorganizer|organisert av|org\\adddotspace av\nbyauthor|av|av\nbyeditor|redigert av|red\\adddotspace av\nbycompiler|kompilert av|komp\\adddotspace av\nbyredactor|bearbeidet av|bearb\\adddotspace av\nbyreviser|revidert av|rev\\adddotspace av\nbyreviewer|kritikk ved|krit\\adddotspace ved\nbyfounder|grunnlagt av|grunnl\\adddotspace av\nbycollaborator|i samarbeid med|i samarb\\adddotspace med\nbytranslator|oversatt \\lbx@lfromlang\\ av|overs\\adddot\\ \\lbx@sfromlang\\ av\nbycommentator|kommentert av|komm\\adddot\\ av\nbyannotator|forklart av|forkl\\adddot\\ av\nwithcommentator|med kommentarer av|med komm\\adddot\\ av\nwithannotator|med forklaringer av|med forkl\\adddot\\ av\nwithintroduction|med innledning av|med innl\\adddot\\ av\nwithforeword|med forord av|med forord av\nwithafterword|med etterord av|med etterord av\nand|og|og\nandothers|med flere|mfl\\adddot\nandmore|med mer|m.m\\adddot\nvolume|bind|bd\\adddot\nvolumes|bind|bd\\adddot\ninvolumes|i|i\njourser|serie|ser\\adddot\nbook|bok|bok\npart|del|del\nissue|nummer|nr\\adddot\nnewseries|ny serie|ny ser\\adddot\noldseries|gammel serie|gl\\adddotspace ser\\adddot\nedition|utgave|utg\\adddot\nreprint|opptrykk|opptr\\adddot\nreprintof|opptrykk av|opptr\\adddotspace av\nreprintas|trykt om som|tr\\adddotspace om som\nreprintfrom|opptrykk fra|opptr\\adddotspace fra\ntranslationof|oversettelse av|overs\\adddotspace av\ntranslationas|oversatt som|overs\\adddotspace som\ntranslationfrom|oversatt fra|overs\\adddotspace fra\nreviewof|kritikk av|krit\\adddotspace av\norigpubas|opprinnelig utgitt som|oppr\\adddot\\ utg\\adddot\\ som\norigpubin|opprinnelig utgitt i|oppr\\adddot\\ utg\\adddot\\ i\nastitle|som|som\nbypublisher|av|av\nnodate|udatert|udatert\npage|side|s\\adddot\npages|sider|s\\adddot\ncolumn|spalte|sp\\adddot\ncolumns|spalter|sp\\adddot\nline|linje|l\\adddot\nlines|linjer|l\\adddot\nverse|vers|v\\adddot\nverses|vers|v\\adddot\nsection|avsnitt|avsn\\adddot\nsections|avsnitt|avsn\\adddot\nparagraph|avsnitt|avsn\\adddot\nparagraphs|avsnitt|avsn\\adddot\npagetotal|side|s\\adddot\npagetotals|sider|s\\adddot\ncolumntotal|spalte|sp\\adddot\ncolumntotals|spalter|sp\\adddot\nlinetotal|linje|l\\adddot\nlinetotals|linjer|l\\adddot\nversetotal|vers|v\\adddot\nversetotals|vers|v\\adddot\nsectiontotal|avsnitt|avsn\\adddot\nsectiontotals|avsnitt|avsn\\adddot\nparagraphtotal|avsnitt|avsn\\adddot\nparagraphtotals|avsnitt|avsn\\adddot\nin|i|i\ninseries|i|i\nofseries|av|av\nnumber|nummer|nr\\adddot\nchapter|kapittel|kap\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/nswissgerman.lbx.strings",
    "content": "citedas|im Folgenden zitiert als|im Folgenden zit\\adddotspace als\ncountryuk|Grossbritannien|GB\n"
  },
  {
    "path": "citeproc/biblatex-localization/nynorsk.lbx.strings",
    "content": "references|Referansar|Referansar\nshorthands|Forkortingar|Forkortingar\ncompilers|kompilatorar|komp\\adddot\nredactor|omarbeiding|omarb\\adddot\nredactors|omarbeiding|omarb\\adddot\nfounder|grunnleggjar|grunnl\\adddot\nfounders|grunnleggjarar|grunnl\\adddot\ntranslator|omsetjar|oms\\adddot\ntranslators|omsetjarar|oms\\adddot\ncommentator|kommentarar|komm\\adddot\ncommentators|kommentarar|komm\\adddot\nannotator|forklaringar|forkl\\adddot\nannotators|forklaringar|forkl\\adddot\ncommentary|kommentarar|komm\\adddot\nannotations|forklaringar|forkl\\adddot\nintroduction|innleiing|innl\\adddot\norganizers|organisatorar|org\\adddot\nbyredactor|omarbeidd av|omarb\\adddotspace av\nwithcommentator|med kommentarar av|med komm\\adddot\\ av\nwithannotator|med forklaringar av|med forkl\\adddot\\ av\nwithintroduction|med innleiing av|med innl\\adddot\\ av\nandothers|med fleire|mfl\\adddot\nandmore|med meir|m.m\\adddot\noldseries|gamal serie|gl\\adddotspace ser\\adddot\ntranslationof|omsetjing av|oms\\adddotspace av\ntranslationas|omsett som|oms\\adddotspace som\norigpubas|opphavleg utgitt som|opph\\adddot\\ utg\\adddot\\ som\norigpubin|opphavleg utgitt i|opph\\adddot\\ utg\\adddot\\ i\n"
  },
  {
    "path": "citeproc/biblatex-localization/polish.lbx.strings",
    "content": "bibliography|Bibliografia|Bibliografia\nreferences|Bibliografia|Bibliografia\neditor|redaktor|red\\adddot\neditors|redaktorzy|red\\adddot\ncompiler|redaktor|red\\adddot\ncompilers|redaktorzy|red\\adddot\nredactor|redaktor|red\\adddot\nredactors|redaktorzy|red\\adddot\nreviser|korektor|kor\\adddot\nrevisers|korektorzy|kor\\adddot\ncollaborator|uczestnik|ucz\\adddot\ncollaborators|uczestnicy|ucz\\adddot\ntranslator|t\\l umacz|t\\l um\\adddot\ntranslators|t\\l umacze|t\\l um\\adddot\ncommentator|komentator|kom\\adddot\ncommentators|komentatorzy|kom\\adddot\nannotator|uwaga|uw\\adddot\nannotators|uwagi|uw\\adddot\ncommentary|komentarz|kom\\adddot\nannotations|komentarze|kom\\adddot\nforeword|przedmowa|przedm\\adddot\nafterword|pos\\l owie|pos\\l \\adddot\neditortr|redaktor i t\\l umacz|red\\adddotspace i per\\adddot\neditorstr|redaktorzy i t\\l umacze|red\\adddotspace i per\\adddot\neditorco|redaktor i komentator|red\\adddotspace i kom\\adddot\ntranslatorco|t\\l umacz i komentator|t\\l um\\adddotspace i kom\\adddot\ntranslatorsco|t\\l umacze i komentatorzy|t\\l um\\adddotspace i kom\\adddot\norganizer|organizator|org\\adddot\norganizers|organizatorzy|org\\adddot\nbyorganizer|organizowane|org\\adddot\nbyauthor|autorstwo|aut\\adddot\nbyeditor|redagowa\\l|red\\adddot\nbyredactor|zredagowano|zred\\adddot\nbyreviser|poprawione|popr\\adddot\nbyreviewer|recenzja|rec\\adddot\nbytranslator|t\\l umaczenie \\lbx@lfromlang|t\\l um\\adddotspace \\lbx@sfromlang\nbycommentator|skomentowane przez|skom\\adddot\nbyannotator|uwagi od|uw\\adddot\nwithcommentator|komentarze|kom\\adddot\nwithannotator|uwagi|uw\\adddot\nwithforeword|przedmowa|przedm\\adddot\nwithafterword|pos\\l owie|pos\\l \\adddot\nbyeditoran|zredagowany i z uwagami|zredag\\adddotspace i z uw\\adddot\nbyeditoraf|zredagowany, z pos\\l owiem|zred., z pos\\l \\adddot\nbyeditorcofo|zredagowany, komentarze i przedmowa|zred., kom\\adddotspace i przedm\\adddot\nbyeditorcoaf|zredagowany, komentarze i pos\\l owie|zred., kom\\adddotspace i pos\\l \\adddot\nbyeditoranfo|zredagowany, uwagi i przedmowa|zred., uw\\adddotspace i przedm\\adddot\nbyeditoranaf|zredagowany, uwagi i pos\\l owie|zred., uw\\adddotspace i pos\\l \\adddot\nand|i|i\nandothers|i inni|i in\\adddot\nandmore|i inni|i in\\adddot\nvolume|tom|t\\adddot\nvolumes|tomy|t\\adddot\ninvolumes|w|w\njourvol|tom|t\\adddot\njourser|seria|ser\\adddot\nissue|wydanie|wyd\\adddot\nnewseries|nowa seria|now\\adddotspace ser\\adddot\noldseries|stara seria|star\\adddotspace ser\\adddot\nedition|wydruk|wyd\\adddot\nreprint|przedruk|przedr\\adddot\nreprintof|przedruk|przedr\\adddot\nreprintas|przedrukowano jako|przedr\\adddotspace jako\nreprintfrom|przedrukowano z|przedr\\adddotspace z\ntranslationof|t\\l umaczenie|t\\l um\\adddot\ntranslationas|t\\l umaczenie jako|t\\l um\\adddotspace jako\ntranslationfrom|t\\l umaczenie z|t\\l um\\adddotspace z\nreviewof|recenzja na\\addcolon|rec\\adddotspace na\\addcolon\norigpubin|pierwodruk wydano w|pierw\\adddotspace wyd\\adddotspace w\nastitle|pod tytu\\l em|pod tyt\\adddot\npage|strona|s\\adddot\npages|strony|s\\adddot\ncolumn|kolumna|kol\\adddot\ncolumns|kolumny|kol\\adddot\nline|linijka|l\\adddot\nlines|linijki|l\\adddot\nnodate|bez daty|b\\adddot d\\adddot\nverse|werset|wer\\adddot\nverses|wersety|wer\\adddot\nsection|paragraf|par\\adddot\nsections|paragrafy|par\\adddot\nparagraph|akapit|akap\\adddot\nparagraphs|akapity|akap\\adddot\npagetotal|strona|s\\adddot\npagetotals|strony|s\\adddot\ncolumntotal|kolumna|kol\\adddot\ncolumntotals|kolumny|kol\\adddot\nlinetotal|wers|wer\\adddot\nlinetotals|wersy|wer\\adddot\nversetotal|wiersz|wier\\adddot\nversetotals|wiersze|wier\\adddot\nsectiontotal|paragraf|par\\adddot\nsectiontotals|paragrafy|par\\adddot\nparagraphtotal|akapit|akap\\adddot\nparagraphtotals|akapit|akap\\adddot\nin|w|w\ninseries|w|w\nofseries|z|z\nnumber|numer|nr\\adddot\nchapter|rozdzia\\l |rozd\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/portuges.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/portuguese.lbx.strings",
    "content": "bibliography|Bibliografia|Bibliografia\nreferences|Refer\\^encias|Refer\\^encias\nshorthands|Lista de Abreviaturas|Abreviaturas\neditor|editor|ed\\adddot\neditors|editores|eds\\adddot\ncompiler|compilador|comp\\adddot\ncompilers|compiladores|comp\\adddot\nredactor|redator|red\\adddot\nredactors|redatores|red\\adddot\nreviser|revisor|rev\\adddot\nrevisers|revisores|rev\\adddot\nfounder|fundador|fund\\adddot\nfounders|fundadores|fund\\adddot\ncontinuator|continuador|cont\\adddot\ncontinuators|continuadores|cont\\adddot\ncollaborator|colaborador|col\\adddot\ncollaborators|colaboradores|col\\adddot\ntranslator|tradutor|trad\\adddot\ntranslators|tradutores|trad\\adddot\ncommentator|comentador|coment\\adddot\ncommentators|comentadores|coment\\adddot\nannotator|anotador|anot\\adddot\nannotators|anotadores|anot\\adddot\ncommentary|coment\\'ario|coment\\adddot\nannotations|notas|notas\nforeword|pref\\'acio|pref\\adddot\nafterword|posf\\'acio|posf\\adddot\norganizer|organizador|org\\adddot\norganizers|organizadores|orgs\\adddot\nbyorganizer|organizado por|org\\adddotspace por\nbyauthor|por|por\nbyeditor|editado por|ed\\adddotspace por\nbycompiler|compilado por|comp\\adddotspace por\nbyredactor|redigido por|red\\adddotspace por\nbyreviser|revisto por|rev\\adddotspace por\nbyreviewer|resenhado por|res\\adddotspace por\nbyfounder|fundado por|fund\\adddotspace por\nbycontinuator|continuado por|cont\\adddotspace por\nbytranslator|traduzido \\lbx@lfromlang\\ por|trad\\adddot\\ \\lbx@sfromlang\\ por\nbycommentator|comentado por|coment\\adddot\\ por\nbyannotator|notas de|notas de\nwithcommentator|com coment\\'arios de|com coment\\adddot\\ de\nwithannotator|com notas de|com notas de\nwithforeword|com pref\\'acio de|com pref\\adddot\\ de\nwithafterword|com posf\\'acio de|com posf\\adddot\\ de\nand|e|e\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nvolume|volume|vol\\adddot\nvolumes|volumes|vols\\adddot\ninvolumes|em|em\njourvol|volume|vol\\adddot\njourser|s\\'erie|s\\'er\\adddot\nbook|livro|livro\npart|parte|parte\nissue|n\\'umero|n\\'umero\nnewseries|nova s\\'erie|nova s\\'er\\adddot\noldseries|s\\'erie antiga|s\\'er\\adddot\\ antiga\nreprint|reimpress\\~ao|reimpr\\adddot\nreprintof|reimpress\\~ao de|reimpr\\adddotspace de\nreprintas|reimpresso como|reimpr\\adddotspace como\nreprintfrom|reimpresso|reimpr\\adddot\ntranslationas|traduzido como|trad\\adddotspace como\ntranslationfrom|traduzido do|trad\\adddotspace do\nreviewof|resenha de|res\\adddotspace de\norigpubas|originalmente publicado como|orig\\adddotspace pub\\adddotspace como\norigpubin|originalmente publicado em|orig\\adddotspace pub\\adddotspace em\nastitle|como|como\nbypublisher|por|por\nnodate|sem data|s\\adddot d\\adddot\npage|p\\'agina|p\\adddot\npages|p\\'aginas|pp\\adddot\ncolumn|coluna|col\\adddot\ncolumns|colunas|cols\\adddot\nline|linha|l\\adddot\nlines|linhas|ll\\adddot\nverse|verso|v\\adddot\nverses|versos|vv\\adddot\nparagraph|par\\'agrafo|par\\adddot\nparagraphs|par\\'agrafo|par\\adddot\npagetotal|p\\'agina|p\\adddot\npagetotals|p\\'aginas|pp\\adddot\ncolumntotal|coluna|col\\adddot\ncolumntotals|colunas|cols\\adddot\nlinetotal|linha|l\\adddot\nlinetotals|linhas|ll\\adddot\nversetotal|verso|v\\adddot\nversetotals|versos|vv\\adddot\nparagraphtotal|par\\'agrafo|par\\adddot\nparagraphtotals|par\\'agrafo|par\\adddot\nin|em|em\ninseries|em|em\nofseries|de|de\nnumber|n\\'umero|n\\adddot\\textordmasculine\nchapter|cap\\'\\i tulo|cap\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/russian.lbx.strings",
    "content": "bibliography|Список литературы|Список литературы\nreferences|Список литературы|Список литературы\nshorthands|Список сокращений|Сокращения\neditor|редактор|ред\\adddot\neditors|редакторы|ред\\adddot\ncompiler|составитель|сост\\adddot\ncompilers|составители|сост\\adddot\nredactor|редактор|ред\\adddot\nredactors|редакторы|ред\\adddot\nreviser|ревизионный корректор|ревиз\\adddotspace кор\\adddot\nrevisers|ревизионные корректоры|ревиз\\adddotspace кор\\adddot\nfounder|основатель|осн\\adddot\nfounders|основатели|осн\\adddot\ncontinuator|продолжатель|прод\\adddot\ncontinuators|продолжатели|прод\\adddot\ncollaborator|участник|участ\\adddot\ncollaborators|участники|участ\\adddot\ntranslator|переводчик|пер\\adddot\ntranslators|переводчики|пер\\adddot\ncommentator|комментатор|коммент\\adddot\ncommentators|комментаторы|коммент\\adddot\nannotator|примечания|примеч\\adddot\nannotators|примечания|примеч\\adddot\ncommentary|комментарий|коммент\\adddot\nannotations|примечания|примеч\\adddot\nintroduction|вступительная статья|вступ\\adddotspace ст\\adddot\nforeword|предисловие|предисл\\adddot\nafterword|послесловие|послесл\\adddot\norganizer|организатор|орг\\adddot\norganizers|организаторы|орг\\adddot\nbyorganizer|организатор|орг\\adddot\nbyauthor||\nbyeditor|под редакцией|под\\addabbrvspace ред\\adddot\nbycompiler|составитель|сост\\adddot\nbyredactor|под редакцией|под\\addabbrvspace ред\\adddot\nbyreviser|исправлено|испр\\adddot\nbyreviewer|рецензия|рец\\adddot\nbyfounder|учредитель|учр\\adddot\nbycontinuator|продолжение|продолж\\adddot\nbycollaborator|при участии|при\\addabbrvspace уч\\adddot\nbytranslator|перевод \\lbx@lfromlang|пер\\adddot\\ \\lbx@sfromlang\nbycommentator|комментарии|коммент\\adddot\nbyannotator|примечания|примеч\\adddot\nwithcommentator|комментарии|коммент\\adddot\nwithannotator|примечания|примеч\\adddot\nwithintroduction|вступительная статья|вступ\\adddotspace ст\\adddot\nwithforeword|предисловие|предисл\\adddot\nwithafterword|послесловие|послесл\\adddot\nand|и|и\nandothers|и\\addabbrvspace др\\adddot|и\\addabbrvspace др\\adddot\nandmore|и\\addabbrvspace др\\adddot|и\\addabbrvspace др\\adddot\nvolume|том|т\\adddot\nvolumes|томах|т\\adddot\ninvolumes|в|в\njourvol|том|т\\adddot\njourser|серия|сер\\adddot\nbook|книга|кн\\adddot\npart|часть|ч\\adddot\nissue|выпуск|вып\\adddot\nnewseries|новая серия|нов\\adddotspace сер\\adddot\noldseries|старая серия|стар\\adddotspace сер\\adddot\nedition|издание|изд\\adddot\nreprint|переиздание|переизд\\adddot\nreprintof|переиздание|переизд\\adddot\nreprintas|переиздано как|переизд\\adddotspace как\nreprintfrom|переиздано с|переизд\\adddotspace с\ntranslationof|перевод по изданию\\addcolon|пер\\adddotspace по изд\\adddot\\addcolon\ntranslationas|перевод\\addcolon|пер\\adddot\\addcolon\ntranslationfrom|перевод с|пер\\adddotspace с\nreviewof|рецензия на\\addcolon|рец\\adddotspace на\\addcolon\nastitle|\\addcolon|\\addcolon\nbypublisher|\\addcomma|\\addcomma\nnodate|б\\adddot г\\adddot|б\\adddot г\\adddot\npage|страница|с\\adddot\npages|страницы|с\\adddot\ncolumn|колонка|кол\\adddot\ncolumns|колонки|кол\\adddot\nline|строка|строка\nlines|строки|строка\nverse|стих|стих\nverses|стихи|стихи\nsection|параграф|\\S\nsections|параграфы|\\S\\S\nparagraph|абзац|абз\\adddot\nparagraphs|абзацы|абз\\adddot\npagetotal|страница|с\\adddot\npagetotals|страницы|с\\adddot\ncolumntotal|колонка|кол\\adddot\ncolumntotals|колонки|кол\\adddot\nlinetotal|строка|строка\nlinetotals|строки|строка\nversetotal|стих|стих\nversetotals|стихи|стихи\nsectiontotal|параграф|\\S\nsectiontotals|параграфы|\\S\\S\nparagraphtotal|абзац|абз\\adddot\nparagraphtotals|абзацы|абз\\adddot\nin|в|в\ninseries|в|в\nofseries|из|из\nnumber|номер|№\nchapter|глава|гл\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/serbian.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/serbianc.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/slovak.lbx.strings",
    "content": "references|Referencie|Referencie\nshorthands|Zoznam skratiek|Skratky\neditor|editor|ed\\adddot\neditors|editori|ed\\adddot\ncompilers|zostavovatelia|zost\\adddot\nredactor|redaktor|red\\adddot\nredactors|redaktori|red\\adddot\nreviser|korektor|kor\\adddot\nrevisers|korektori|kor\\adddot\nfounders|zakladatelia|zakl\\adddot\ntranslators|prekladatelia|prekl\\adddot\nforeword|predhovor|predh\\adddot\nafterword|doslov|dosl\\adddot\nbyauthor||\nwithforeword|s\\addnbspace predhovorom od|s\\addnbspace predh\\adddot\\ od\nwithafterword|s\\addnbspace doslovom od|s\\addnbspace dosl\\adddot\\ od\nand|a|a\nandothers|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\nandmore|et\\addabbrvspace al\\adddot|et\\addabbrvspace al\\adddot\ninvolumes|in|in\nbook|kniha|kniha\nedition|vydanie|vyd\\adddot\nreviewof|recenzia|recenz\\adddot\ntranslationof|preklad|prekl\\adddot\nastitle|ako|ako\nbypublisher||\npage|strana|s\\adddot\npages|strany|s\\adddot\nline|riadok|r\\adddot\nlines|riadky|r\\adddot\nsection|sekcia|\\S\nsections|sekcie|\\S\\S\nparagraph|odsek|ods\\adddot\nparagraphs|odseky|ods\\adddot\npagetotal|strana|s\\adddot\npagetotals|strany|s\\adddot\nlinetotal|riadok|r\\adddot\nlinetotals|riadky|r\\adddot\nsectiontotal|sekcia|\\S\nsectiontotals|sekcie|\\S\\S\nparagraphtotal|odsek|ods\\adddot\nparagraphtotals|odseky|ods\\adddot\nin|in|in\ninseries|in|in\nofseries|z|z\nchapter|kapitola|kap\\adddot\ndatacd|CD-ROM|CD-ROM\naudiocd|audio CD|audio CD\nversion|verzia|ver\\adddot\nurl|URL|URL\nidem|idem|idem\nidemsm|idem|idem\nidemsf|eadem|eadem\nidemsn|idem|idem\nidempm|eidem|eidem\nidempf|eaedem|eaedem\nidempn|eadem|eadem\nidempp|eidem|eidem\nibidem|ibidem|ibid\\adddot\nopcit|op\\adddotspace cit\\adddot|op\\adddotspace cit\\adddot\nloccit|loc\\adddotspace cit\\adddot|loc\\adddotspace cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|sq\\adddot|sq\\adddot\nsequentes|sqq\\adddot|sqq\\adddot\npassim|passim|pass\\adddot\nmarch|marec|mar\\adddot\naugust|august|aug\\adddot\nseptember|september|sept\\adddot\nnovember|november|nov\\adddot\ndecember|december|dec\\adddot\ncountryde|Nemecko|DE\npatent|patent|pat\\adddot\npatentus|US patent|US pat\\adddot\nabstract|abstrakt|abst\\adddot\nannodomini|po Kristovi|po Kr\\adddot\nbeforechrist|pred Kristom|pred Kr\\adddot\ncirca|cirka|ca\\adddot\nspring|jar|jar\nsummer|leto|leto\nwinter|zima|zima\nam|AM|AM\npm|PM|PM\n"
  },
  {
    "path": "citeproc/biblatex-localization/slovene.lbx.strings",
    "content": "bibliography|Literatura|Literatura\nreferences|Literatura|Literatura\nshorthands|Kratice|Kratice\neditor|urednik|ur\\adddot\neditors|uredniki|ur\\adddot\ncompiler|sestavljalec|sest\\adddot\ncompilers|sestavljalci|sest\\adddot\nredactor|redaktor|redaktor\nredactors|redaktorji|redaktorji\nreviser|korektor|korektor\nrevisers|korektorji|korektorji\nfounder|snovalec|snovalec\nfounders|snovalci|snovalci\ncontinuator|nadaljevalec|nadaljevalec\ncontinuators|nadaljevalci|nadaljevalci\ncollaborator|sodelavec|sod\\adddot\ncollaborators|sodelavci|sod\\adddot\ntranslator|prevajalec|prev\\adddot\ntranslators|prevajalci|prev\\adddot\ncommentator|komentator|komentator\ncommentators|komentatorji|komentatorji\nannotator|anotator|anotator\nannotators|anotatorji|anotatorji\ncommentary|komentar|komentar\nannotations|opombe|op\\adddot\nintroduction|uvod|uvod\nforeword|predgovor|predg\\adddot\nafterword|spremna beseda|spr\\adddotspace b\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/slovenian.lbx.strings",
    "content": ""
  },
  {
    "path": "citeproc/biblatex-localization/spanish.lbx.strings",
    "content": "references|Referencias|Referencias\nshorthands|Lista de abreviaturas|Abreviaturas\neditor|edici\\'on|ed\\adddot\neditors|edici\\'on|eds\\adddot\ncommentator|comentario|com\\adddot\ncommentators|comentarios|coms\\adddot\nannotator|anotaciones|anot\\adddot\nannotators|anotaciones|anots\\adddot\ncommentary|comentario|com\\adddot\nannotations|notas|notas\nintroduction|introducci\\'on|intr\\adddot\nforeword|pr\\'ologo|pr\\'ol\\adddot\norganizer|organizaci\\'on|org\\adddot\norganizers|organizaci\\'on|orgs\\adddot\nbyorganizer|organizado por|org\\adddotspace por\nbyauthor|de|de\nbyeditor|editado por|ed\\adddotspace por\nbycompiler|compilado por|comp\\adddotspace por\nbyredactor|redacci\\'on de|red\\adddotspace de\nbyreviser|revisado por|rev\\adddotspace por\nbyfounder|fundado por|fund\\adddotspace por\nbycontinuator|continuado por|cont\\adddotspace por\nbytranslator|traducido \\lbx@lfromlang\\ por|trad\\adddot \\lbx@sfromlang\\ por\nbycommentator|comentado por|com\\adddotspace por\nbyannotator|anotado por|anot\\adddotspace por\nwithcommentator|con comentario de|con com\\adddotspace de\nwithannotator|con notas de|con notas de\nwithintroduction|con introduci\\'on de|con intr\\adddotspace de\nwithforeword|con pr\\'ologo de|con pr\\'ol\\adddotspace de\nand|y|y\nandothers|y~col\\adddot|y~col\\adddot\nandmore|et\\adddotspace al\\adddot|et\\adddotspace al\\adddot\nvolume|volumen|vol\\adddot\nvolumes|vol\\'umenes|vols\\adddot\ninvolumes|en|en\njourvol|volumen|vol\\adddot\njourser|\\'epoca|\\'ep\\adddot\nbook|libro|libro\npart|parte|parte\nissue|n\\'umero|n\\'um\\adddot\nnewseries|nueva \\'epoca|n\\adddotspace \\'ep\\adddot\noldseries|antigua \\'epoca|ant\\adddotspace \\'ep\\adddot\nedition|edici\\'on|ed\\adddot\nreprintas|reimpreso como|reimp\\adddotspace como\ntranslationas|traducido como|trad\\adddotspace como\ntranslationfrom|traducido del|trad\\adddotspace del\norigpubas|publicado originalmente como|pub\\adddotspace orig\\adddotspace como\norigpubin|publicado originalmente en|pub\\adddot orig\\adddot en\nbypublisher|por la editorial|por la ed\\adddot\npage|p\\'agina|p\\'ag\\adddot\npages|p\\'aginas|p\\'ags\\adddot\ncolumn|columna|col\\adddot\ncolumns|columnas|cols\\adddot\nverse|verso|v\\adddot\nverses|versos|vv\\adddot\nsections|secciones|secs\\adddot\npagetotal|p\\'agina|p\\'ag\\adddot\npagetotals|p\\'aginas|p\\'ags\\adddot\ncolumntotal|columna|col\\adddot\ncolumntotals|columnas|cols\\adddot\nversetotal|verso|v\\adddot\nversetotals|versos|vv\\adddot\nsectiontotals|secciones|secs\\adddot\nin|en|en\ninseries|en|en\nofseries|de|de\nnumber|n\\'umero|n\\sptext{o\nchapter|cap\\'itulo|cap\\adddot\nbathesis|Tesis de licenciatura|Tesis de lic\\adddot\nphdthesis|Tesis doctoral|Tesis doct\\adddot\ncandthesis|Tesis de candidatura doctoral|Tesis de cand\\adddotspace doct\\adddot\ntechreport|informe t\\'ecnico|inf\\adddotspace t\\'ec\\adddot\nsoftware|programa|prog\\adddot\ndatacd|disco de datos|CD de datos\naudiocd|disco de audio|CD de audio\nversion|versi\\'on|ver\\adddot\nurl|direcci\\'on|direcci\\'on\nurlfrom|disponible desde|disp\\adddotspace desde\nurlseen|visitado|visitado\nsubmitted|enviado|enviado\nforthcoming|pr\\'oximamente|prox\\adddot\ninpress|en prensa|en prensa\nprepublished|previamente publicado|prepublicado\ncitedas|citado en adelante como|cit\\adddotspace en adelante como\nthiscite|especialmente|esp\\adddot\nseenote|ver nota|ver n\\adddot\nquotedin|citado en|cit\\adddotspace en\nloccit|loc\\adddotspace cit\\adddot|loc\\adddot cit\\adddot\nconfer|cf\\adddot|cf\\adddot\nsequens|s\\adddot|s\\adddot\nsequentes|ss\\adddot|ss\\adddot\npassim|p\\'assim|p\\'assim\nsee|v\\'ease|vid\\adddot\nseealso|v\\'ease tambi\\'en|vid\\adddotspace tambi\\'en\nbackrefpage|v\\'ease p\\'agina|vid\\adddotspace p\\'ag\\adddot\nbackrefpages|v\\'eanse p\\'aginas|vid\\adddotspace p\\'ags\\adddot\njanuary|enero|ene\\adddot\nfebruary|febrero|feb\\adddot\nmarch|marzo|mar\\adddot\napril|abril|abr\\adddot\nmay|mayo|mayo\njune|junio|jun\\adddot\njuly|julio|jul\\adddot\naugust|agosto|ago\\adddot\nseptember|septiembre|sep\\adddot\noctober|octubre|oct\\adddot\nnovember|noviembre|nov\\adddot\ndecember|diciembre|dic\\adddot\nlangbrazilian|brasile\\~no|brasile\\~no\nlangbulgarian|b\\'ulgaro|b\\'ulgaro\nlangcroatian|croata|croata\nlangczech|checo|checo\nlangdanish|dan\\'es|dan\\'es\nlangdutch|neerland\\'es|neerland\\'es\nlangenglish|ingl\\'es|ingl\\'es\nlangestonian|estonio|estonio\nlangfrench|franc\\'es|franc\\'es\nlanggalician|gallego|gallego\nlanggerman|alem\\'an|alem\\'an\nlanggreek|griego|griego\nlanghungarian|h\\'ungaro|h\\'ungaro\nlangitalian|italiano|italiano\nlangjapanese|japon\\'es|japon\\'es\nlanglatvian|lituano|lituano\nlangnorwegian|noruego|noruego\nlangpolish|polaco|polaco\nlangportuguese|portugu\\'es|portugu\\'es\nlangrussian|ruso|ruso\nlangslovak|eslovaco|eslovaco\nlangslovene|esloveno|esloveno\nlangspanish|espa\\~nol|espa\\~nol\nlangswedish|sueco|sueco\nlangukrainian|ucraniano|ucraniano\nfrombrazilian|del brasile\\~no|del brasile\\~no\nfrombulgarian|del b\\'ulgaro|del b\\'ulgaro\nfromcroatian|del croata|del croata\nfromczech|del checo|del checo\nfromdanish|del dan\\'es|del dan\\'es\nfromdutch|del neerland\\'es|del neerland\\'es\nfromenglish|del ingl\\'es|del ingl\\'es\nfromestonian|del estonio|del estonio\nfromfrench|del franc\\'es|del franc\\'es\nfromgalician|del gallego|del gallego\nfromgerman|del alem\\'an|del alem\\'an\nfromgreek|del griego|del griego\nfromhungarian|del h\\'ungaro|del h\\'ungaro\nfromitalian|del italiano|del italiano\nfromjapanese|del japon\\'es|del japon\\'es\nfromlatvian|del lituano|del lituano\nfromnorwegian|del noruego|del noruego\nfrompolish|del polaco|del polaco\nfromportuguese|del portugu\\'es|del portugu\\'es\nfromrussian|del ruso|del ruso\nfromslovak|del eslovaco|del eslovaco\nfromslovene|del esloveno|del esloveno\nfromspanish|del espa\\~nol|del espa\\~nol\nfromswedish|del sueco|del sueco\nfromukrainian|del ucraniano|del ucraniano\ncountryde|Alemania|DE\ncountryeu|Uni\\'on Europea|EU\ncountryep|Uni\\'on Europea|EP\ncountryfr|Francia|FR\ncountryuk|Reino Unido|GB\ncountryus|Estados Unidos|US\npatent|patente|pat\\adddot\npatentde|patente alemana|pat\\adddotspace alemana\npatenteu|patente europea|pat\\adddotspace europea\npatentfr|patente francesa|pat\\adddotspace francesa\npatentuk|patente brit\\'anica|pat\\adddotspace brit\\'anica\npatentus|patente estadounidense|pat\\adddotspace estadounidense\npatreq|solicitud de patente|sol\\adddotspace de pat\\adddot\npatreqde|solicitud de patente alemana|sol\\adddotspace de pat\\adddot alemana\npatreqeu|solicitud de patente europea|sol\\adddotspace de pat\\adddot europea\npatreqfr|solicitud de patente francesa|sol\\adddotspace de pat\\adddot francesa\npatrequk|solicitud de patente brit\\'anica|sol\\adddotspace de pat\\adddot brit\\'anica\npatrequs|solicitud de patente estadounidense|sol\\adddotspace de pat\\adddot estadounidense\nfile|archivo|archivo\nlibrary|biblioteca|bibl\\adddot\nabstract|resumen|resumen\ncommonera|era com\\'un|e\\adddotspace c\\adddot\nbeforecommonera|antes de la era com\\'un|a\\adddotspace e\\adddotspace c\\adddot\nannodomini|despu\\'es de Cristo|d\\adddotspace C\\adddot\nbeforechrist|antes de Cristo|a\\adddotspace C\\adddot\ncirca|circa|ca\\adddot\nspring|primavera|prim\\adddot\nsummer|verano|ver\\adddot\nautumn|oto\\~no|ot\\adddot\nwinter|invierno|inv\\adddot\nam|a\\adddotspace m\\adddot|a\\adddot m\\adddot\npm|p\\adddotspace m\\adddot|p\\adddot m\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/swedish.lbx.strings",
    "content": "bibliography|Litteraturf\\\"orteckning|Litteratur\nreferences|Referenser|Referenser\nshorthands|F\\\"orkortningar|F\\\"orkortningar\neditor|utgivare|utg\\adddot\neditors|utgivare|utg\\adddot\ncompiler|sammanst\\\"allare|sammanst\\adddot\ncompilers|sammanst\\\"allare|sammanst\\adddot\nredactor|redakt\\\"or|red\\adddot\nredactors|redakt\\\"orer|red\\adddot\n"
  },
  {
    "path": "citeproc/biblatex-localization/swissgerman.lbx.strings",
    "content": "countryuk|Grossbritannien|GB\n"
  },
  {
    "path": "citeproc/biblatex-localization/turkish.lbx.strings",
    "content": "references|Kaynaklar|Kaynaklar\nshorthands|K\\i saltmalar dizini|K\\i saltmalar\ncompiler|derleyen|der\\adddot\ncompilers|derleyenler|der\\adddot\nredactor|yay\\i na haz\\i rlayan|yay\\adddot\\ haz\\adddot\nredactors|yay\\i na haz\\i rlayanlar|yay\\adddot\\ haz\\adddot\nreviser|tashih eden|tashih\\adddot\nrevisers|tashih edenler|tashih\\adddot\nfounder|kurucu|kur\\adddot\nfounders|kurucular|kur\\adddot\ncontinuator|tamamlayan|tam\\adddot\ncontinuators|tamamlayanlar|tam\\adddot\ncollaborator|ortak|ortak\ncollaborators|ortaklar|ortaklar\ncommentator|yorumlayan|yrm\\adddot\ncommentators|yorumlayanlar|yrm\\adddot\ncommentary|yorum|yrm\\adddot\nbyauthor|yazar|yazar\nbycompiler|derleyen|der\\adddot\nbyredactor|yay\\i na haz\\i rlayan|yay\\adddot\\ haz\\adddot\nbyreviser|tashih|tashih\nbyfounder|kurucu|kur\\adddot\nbycontinuator|tamamlayan|tam\\adddot\nbycommentator|yorumlayan|yrm\\adddot\nwithcommentator|yorumlar\\i yla katk\\i da bulunan|yrm\\adddot\\ kat\\adddot\\ bul\\adddot\nand|ve|ve\nvolume|cilt|c\\adddot\nvolumes|cilt|c\\adddot\njourvol|cilt|c\\adddot\njourser|seri|seri\nbook|kitap|kitap\npart|k\\i s\\i m|k\\i s\\i m\nissue|say\\i|say\\i\nnewseries|yeni seri|yeni seri\noldseries|eski seri|eski seri\nedition|bask\\i|bs\\adddot\nreprint|yeni bask\\i s\\i|yeni bask\\i s\\i\nreprintof|yeni bask\\i s\\i|yeni bask\\i s\\i\nreprintas|yeni bask\\i s\\i|yeni bask\\i s\\i\nreprintfrom|yeni bask\\i s\\i|yeni bask\\i s\\i\nreviewof|derlenen eser|der\\adddot\\ eser\norigpubas|as\\i l eser|as\\i l eser\norigpubin|as\\i l eser yay\\i n tarihi|as\\i l eser yay\\i n tarihi\nbypublisher|yay\\i n evi|yay\\i n evi\nnodate|tarih yok|t\\adddot y\\adddot\npage|sayfa|s\\adddot\npages|sayfalar|ss\\adddot\nline|sat\\i r|sat\\adddot\nlines|sat\\i rlar|sat\\adddot\nverse|m\\i sra|m\\i s\\adddot\nverses|m\\i sralar|m\\i s\\adddot\nparagraph|paragraf|par\\adddot\nparagraphs|paragraflar|par\\adddot\npagetotal|toplam sayfa|s\\adddot\npagetotals|toplam sayfalar|ss\\adddot\nlinetotal|toplam sat\\i r|sat\\adddot\nlinetotals|toplam sat\\i rlar|sat\\adddot\nversetotal|toplam m\\i sra|m\\i s\\adddot\nversetotals|toplam m\\i sralar|m\\i s\\adddot\nparagraphtotal|toplam paragraf|par\\adddot\nparagraphtotals|toplam paragraflar|par\\adddot\ninseries|serilerde|serilerde\nofseries|serilerde|serilerde\nnumber|numara|no\\adddot\nbathesis|lisans tezi|lis\\adddot\\ tezi\nphdthesis|doktora tezi|dok\\adddot\\ tezi\ncandthesis|aday tezi|aday tezi\ntechreport|teknik rapor|tek\\adddot\\ rap\\adddot\nsoftware|bilgisayar yaz\\i l\\i m\\i|bilg\\adddot\\ yaz\\adddot\ndatacd|CD|CD\naudiocd|ses CD'si|ses CD'si\nversion|versiyon|ver\\adddot\nforthcoming|yak\\i nda|yak\\i nda\nprepublished|taslak bas\\i m\\i|taslak bas\\i m\\i\ncitedas|at\\i f olarak|at\\i f olarak\nseenote|nota bak\\i n\\i z|nota bkz\\adddot\nquotedin|al\\i nt\\i|al\\i nt\\i\nidem|ayn\\i|ayn\\i\nidemsm|ayn\\i|ayn\\i\nidemsf|ayn\\i|ayn\\i\nidemsn|ayn\\i|ayn\\i\nidempm|ayn\\i lar\\i|ayn\\i lar\\i\nidempf|ayn\\i lar\\i|ayn\\i lar\\i\nidempn|ayn\\i lar\\i|ayn\\i lar\\i\nidempp|ayn\\i lar\\i|ayn\\i lar\\i\nloccit|at\\i f yap\\i lan yer|at\\i f yap\\adddot\\ yer\nsequens|takip eden|takip eden\nsequentes|takip eden|takip eden\npassim|rastgele|rastgele\nsee|bak\\i n\\i z|bkz\\adddot\nseealso|ayr\\i ca bak\\i n\\i z|ayr\\i ca bkz\\adddot\njanuary|Ocak|Ocak\nmarch|Mart|Mar\\adddot\napril|Nisan|Nis\\adddot\nmay|May\\i s|May\\adddot\njune|Haziran|Haz\\adddot\njuly|Temmuz|Tem\\adddot\noctober|Ekim|Ekim\nnovember|Kas\\i m|Kas\\adddot\ndecember|Aral\\i k|Ara\\adddot\nlangamerican|Amerikanca|Amerikanca\nlangbrazilian|Brezilyanca|Brezilyanca\nlangbulgarian|Bulgarca|Bulgarca\nlangcatalan|Katalanca|Katalanca\nlangdanish|Danimarkanca|Danimarkanca\nlangestonian|Estonca|Estonca\nlangfinnish|Fince|Fince\nlangfrench|Frans\\i zca|Frans\\i zca\nlanggalician|Galce|Galce\nlanggerman|Almanca|Almanca\nlanggreek|Yunanca|Yunanca\nlanghungarian|Macarca|Macarca\nlangjapanese|Japonca|Japonca\nlanglatin|Latince|Latince\nlanglatvian|Letonca|Letonca\nlanglithuanian|Litvanca|Litvanca\nlangpolish|Polonyaca|Polonyaca\nlangportuguese|Portekizce|Portekizce\nlangslovene|Slovence|Slovence\nlangukrainian|Ukraynaca|Ukraynaca\nfromamerican|Amerikanca'dan|Amerikanca'dan\nfrombrazilian|Brezilyanca'dan|Brezilyanca'dan\nfrombulgarian|Bulgarca'dan|Bulgarca'dan\nfromcatalan|Katalanca'dan|Katalanca'dan\nfromdanish|Danimarkanca'dan|Danimarkanca'dan\nfromestonian|Estonyaca'dan|Estonyaca'dan\nfromfinnish|Fince'den|Fince'den\nfromfrench|Frans\\i zca'dan|Frans\\i zca'dan\nfromgalician|Galyaca'dan|Galyaca'dan\nfromgerman|Almanca'dan|Almanca'dan\nfromgreek|Yunanca'dan|Yunanca'dan\nfromhungarian|Macarca'dan|Macarca'dan\nfromjapanese|Japonca'dan|Japonca'dan\nfromlatin|Latince'den|Latince'den\nfromlatvian|Latvianca'dan|Latvianca'dan\nfromlithuanian|Litvanca'dan|Litvanca'dan\nfrompolish|Polonyaca'dan|Polonyaca'dan\nfromportuguese|Portekizce'den|Portekizce'den\nfromslovene|Slovence'den|Slovence'den\nfromukrainian|Ukraynaca'dan|Ukraynaca'dan\ncountryde|Almanya|DE\ncountryfr|Fransa|FR\npatent|patent|pat\\adddot\npatentde|Alman patenti|Alman pat\\adddot\npatenteu|Avrupa patenti|Avrupa pat\\adddot\npatentfr|Frans\\i z patenti|Frans\\i z pat\\adddot\npatentus|Amerika patenti|Amerika pat\\adddot\npatreq|patent beklemede|pat\\adddot\\ bek\\adddot\npatreqde|Alman patenti beklemede|Alman pat\\adddot\\ bek\\adddot\npatreqeu|Avrupa patenti beklemede|Avrupa pat\\adddot\\ bek\\adddot\npatreqfr|Frans\\i z patenti beklemede|Frans\\i z pat\\adddot\\ bek\\adddot\npatrequs|Amerika patenti beklemede|Amerika pat\\adddot\\ bek\\adddot\nfile|dosya|dosya\ncommonera|milattan sonra|MS\nannodomini|milattan sonra|MS\nsummer|Yaz|Yaz\nautumn|Sonbahar|Sonbahar\n"
  },
  {
    "path": "citeproc/biblatex-localization/ukrainian.lbx.strings",
    "content": "bibliography|Перелік літератури|Література\nreferences|Перелік літератури|Література\nshorthands|Перелік скорочень|Скорочення\neditor|редактор|ред\\adddot\neditors|редактори|ред\\adddot\ncompiler|укладач|уклад\\adddot\ncompilers|укладачі|уклад\\adddot\nredactor|редактор|ред\\adddot\nredactors|редактори|ред\\adddot\nreviser|ревізійний коректор|ревіз\\adddotspace кор\\adddot\nrevisers|ревізійні коректори|ревіз\\adddotspace кор\\adddot\nfounder|засновник|засн\\adddot\nfounders|засновник|засн\\adddot\ncontinuator|продовжувач|прод\\adddot\ncontinuators|продовжувачі|прод\\adddot\ncollaborator|учасник|учас\\adddot\ncollaborators|учасники|учас\\adddot\ntranslator|перекладач|пер\\adddot\ntranslators|перекладачі|пер\\adddot\ncommentator|коментатор|комент\\adddot\ncommentators|коментатори|комент\\adddot\nannotator|примітки|прим\\adddot\nannotators|примітки|прим\\adddot\ncommentary|коментар|комент\\adddot\nannotations|примітки|прим\\adddot\nintroduction|вступна стаття|вступ\\adddotspace ст\\adddot\nforeword|передмова|передм\\adddot\nafterword|післямова|післям\\adddot\norganizer|організатор|орг\\adddot\norganizers|організатори|орг\\adddot\nbyorganizer|організатор|орг\\adddot\nbyauthor|згідно автора|згідн\\adddot авт\\adddot\nbyeditor|за редакцією|за\\addabbrvspace ред\\adddot\nbycompiler|укладач|уклад\\adddot\nbyredactor|за редакцією|за\\addabbrvspace ред\\adddot\nbyreviser|виправлено|випр\\adddot\nbyreviewer|рецензія|рец\\adddot\nbyfounder|засновник|засн\\adddot\nbycontinuator|продовження|продовж\\adddot\nbycollaborator|за участю|за\\addabbrvspace уч\\adddot\nbytranslator|переклад \\lbx@lfromlang|пер\\adddot\\ \\lbx@sfromlang\nbycommentator|коментарі|комент\\adddot\nbyannotator|примітки|прим\\adddot\nwithcommentator|коментарі|комент\\adddot\nwithannotator|примітки|прим\\adddot\nwithintroduction|вступна стаття|вступ\\adddotspace ст\\adddot\nwithforeword|передмовие|передм\\adddot\nwithafterword|післямовие|післям\\adddot\nand|та|та\nandothers|та\\addabbrvspace ін\\adddot|та\\addabbrvspace ін\\adddot\nandmore|та\\addabbrvspace ін\\adddot|та\\addabbrvspace ін\\adddot\nvolume|том|т\\adddot\nvolumes|томах|т\\adddot\ninvolumes|в|в\njourvol|том|т\\adddot\njourser|серія|сер\\adddot\nbook|книга|кн\\adddot\npart|частина|ч\\adddot\nissue|випуск|вип\\adddot\nnewseries|нова серія|нов\\adddotspace сер\\adddot\noldseries|стара серія|стар\\adddotspace сер\\adddot\nedition|видання|вид\\adddot\nreprint|перевидання|перевид\\adddot\nreprintof|перевидання|перевид\\adddot\nreprintas|перевидано як|перевид\\adddotspace як\nreprintfrom|перевидано з|перевид\\adddotspace з\ntranslationof|переклад по виданню\\addcolon|пер\\adddotspace по вид\\adddot\\addcolon\ntranslationas|переклад\\addcolon|пер\\adddot\\addcolon\ntranslationfrom|переклад з|пер\\adddotspace з\nreviewof|рецензія на\\addcolon|рец\\adddotspace на\\addcolon\nastitle|\\addcolon|\\addcolon\nbypublisher|\\addcomma|\\addcomma\nnodate|б\\adddot р\\adddot|б\\adddot р\\adddot\npage|сторінка|с\\adddot\npages|сторінки|с\\adddot\ncolumn|колонка|кол\\adddot\ncolumns|колонки|кол\\adddot\nline|рядок|рядок\nlines|рядки|рядки\nverse|вірш|вірш\nverses|вірші|вірші\nsection|параграф|\\S\nsections|параграфи|\\S\\S\nparagraph|абзац|абз\\adddot\nparagraphs|абзаци|абз\\adddot\npagetotal|сторінка|с\\adddot\npagetotals|сторінки|с\\adddot\ncolumntotal|колонка|кол\\adddot\ncolumntotals|колонки|кол\\adddot\nlinetotal|рядок|рядок\nlinetotals|рядки|рядки\nversetotal|вірш|вірш\nversetotals|вірші|вірші\nsectiontotal|параграф|\\S\nsectiontotals|параграфи|\\S\\S\nparagraphtotal|абзац|абз\\adddot\nparagraphtotals|абзаци|абз\\adddot\nin|в|в\ninseries|в|в\nofseries|із|із\nnumber|номер|№\nchapter|глава|гл\\adddot\n"
  },
  {
    "path": "data/abbreviations",
    "content": "aet.\naetat.\nal.\nApr.\nAug.\nbk.\nBros.\nc.\nCapt.\ncf.\nch.\nchap.\nchs.\nCo.\ncol.\nCorp.\ncp.\nd.\nDec.\nDr.\ne.g.\ned.\neds.\nesp.\nf.\nfasc.\nFeb.\nff.\nfig.\nfl.\nfol.\nfols.\nFr.\nGen.\nGov.\nHon.\ni.e.\nill.\nInc.\nincl.\nJan.\nJr.\nJul.\nJun.\nLtd.\nM.A.\nM.D.\nMar.\nMr.\nMrs.\nMs.\nn.\nn.b.\nnn.\nNo.\nNov.\nOct.\np.\nPh.D.\npp.\nPres.\nProf.\npt.\nq.v.\nRep.\nRev.\ns.v.\ns.vv.\nsaec.\nsec.\nSen.\nSep.\nSept.\nSgt.\nSr.\nSt.\nuniv.\nviz.\nvol.\nvs.\n"
  },
  {
    "path": "data/bash_completion.tpl",
    "content": "# This script enables bash autocompletion for pandoc.  To enable\n# bash completion, add this to your .bashrc:\n# eval \"$(pandoc --bash-completion)\"\n\n_pandoc()\n{\n    local cur prev opts lastc informats outformats highlight_styles datafiles\n    COMPREPLY=()\n    cur=\"${COMP_WORDS[COMP_CWORD]}\"\n    prev=\"${COMP_WORDS[COMP_CWORD-1]}\"\n\n    # These should be filled in by pandoc:\n    opts=\"%s\"\n    informats=\"%s\"\n    outformats=\"%s\"\n    highlight_styles=\"%s\"\n    datafiles=\"%s\"\n\n    case \"${prev}\" in\n         --from|-f|--read|-r)\n             COMPREPLY=( $(compgen -W \"${informats}\" -- ${cur}) )\n             return 0\n             ;;\n         --to|-t|--write|-w|-D|--print-default-template)\n             COMPREPLY=( $(compgen -W \"${outformats}\" -- ${cur}) )\n             return 0\n             ;;\n         --email-obfuscation)\n             COMPREPLY=( $(compgen -W \"references javascript none\" -- ${cur}) )\n             return 0\n             ;;\n         --ipynb-output)\n             COMPREPLY=( $(compgen -W \"all none best\" -- ${cur}) )\n             return 0\n             ;;\n         --pdf-engine)\n             COMPREPLY=( $(compgen -W \"pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff\" -- ${cur}) )\n             return 0\n             ;;\n         --print-default-data-file)\n             COMPREPLY=( $(compgen -W \"${datafiles}\" -- ${cur}) )\n             return 0\n             ;;\n         --wrap)\n             COMPREPLY=( $(compgen -W \"auto none preserve\" -- ${cur}) )\n             return 0\n             ;;\n         --track-changes)\n             COMPREPLY=( $(compgen -W \"accept reject all\" -- ${cur}) )\n             return 0\n             ;;\n         --reference-location)\n             COMPREPLY=( $(compgen -W \"block section document\" -- ${cur}) )\n             return 0\n             ;;\n         --top-level-division)\n             COMPREPLY=( $(compgen -W \"section chapter part\" -- ${cur}) )\n             return 0\n             ;;\n         --highlight-style|--print-highlight-style)\n             COMPREPLY=( $(compgen -W \"${highlight_styles}\" -- ${cur}) )\n             return 0\n             ;;\n         --eol)\n             COMPREPLY=( $(compgen -W \"crlf lf native\" -- ${cur}) )\n             return 0\n             ;;\n         --markdown-headings)\n             COMPREPLY=( $(compgen -W \"setext atx\" -- ${cur}) )\n             return 0\n             ;;\n         *)\n             ;;\n    esac\n\n    case \"${cur}\" in\n         -*)\n             COMPREPLY=( $(compgen -W \"${opts}\" -- ${cur}) )\n             return 0\n             ;;\n         *)\n             local IFS=$'\\n'\n             COMPREPLY=( $(compgen -X '' -f \"${cur}\") )\n             return 0\n             ;;\n    esac\n\n}\n\ncomplete -o filenames -o bashdefault -F _pandoc pandoc\n"
  },
  {
    "path": "data/creole.lua",
    "content": "-- A sample custom reader for Creole 1.0 (common wiki markup)\n-- http://www.wikicreole.org/wiki/CheatSheet\n\n-- For better performance we put these functions in local variables:\nlocal P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt =\n  lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V,\n  lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt\n\nlocal whitespacechar = S(\" \\t\\r\\n\")\nlocal specialchar = S(\"/*~[]\\\\{}|\")\nlocal wordchar = (1 - (whitespacechar + specialchar))\nlocal spacechar = S(\" \\t\")\nlocal newline = P\"\\r\"^-1 * P\"\\n\"\nlocal blankline = spacechar^0 * newline\nlocal endline = newline * #-blankline\nlocal endequals = spacechar^0 * P\"=\"^0 * spacechar^0 * newline\nlocal cellsep = spacechar^0 * P\"|\"\n\nlocal function trim(s)\n   return (s:gsub(\"^%s*(.-)%s*$\", \"%1\"))\nend\n\nlocal function ListItem(lev, ch)\n  local start\n  if ch == nil then\n    start = S\"*#\"\n  else\n    start = P(ch)\n  end\n  local subitem = function(c)\n    if lev < 6 then\n      return ListItem(lev + 1, c)\n    else\n      return (1 - 1) -- fails\n    end\n  end\n  local parser = spacechar^0\n               * start^lev\n               * #(- start)\n               * spacechar^0\n               * Ct((V\"Inline\" - (newline * spacechar^0 * S\"*#\"))^0)\n               * newline\n               * (Ct(subitem(\"*\")^1) / pandoc.BulletList\n                  +\n                  Ct(subitem(\"#\")^1) / pandoc.OrderedList\n                  +\n                  Cc(nil))\n               / function (ils, sublist)\n                   return { pandoc.Plain(ils), sublist }\n                 end\n  return parser\nend\n\n-- Grammar\nG = P{ \"Doc\",\n  Doc = Ct(V\"Block\"^0)\n      / pandoc.Pandoc ;\n  Block = blankline^0\n        * ( V\"Header\"\n          + V\"HorizontalRule\"\n          + V\"CodeBlock\"\n          + V\"List\"\n          + V\"Table\"\n          + V\"Para\") ;\n  Para = Ct(V\"Inline\"^1)\n       * newline\n       / pandoc.Para ;\n  HorizontalRule = spacechar^0\n                 * P\"----\"\n                 * spacechar^0\n                 * newline\n                 / pandoc.HorizontalRule;\n  Header = (P(\"=\")^1 / string.len)\n         * spacechar^1\n         * Ct((V\"Inline\" - endequals)^1)\n         * endequals\n         / pandoc.Header;\n  CodeBlock = P\"{{{\"\n            * blankline\n            * C((1 - (newline * P\"}}}\"))^0)\n            * newline\n            * P\"}}}\"\n            / pandoc.CodeBlock;\n  Placeholder = P\"<<<\"\n              * C(P(1) - P\">>>\")^0\n              * P\">>>\"\n              / function() return pandoc.Div({}) end;\n  List = V\"BulletList\"\n       + V\"OrderedList\" ;\n  BulletList = Ct(ListItem(1,'*')^1)\n             / pandoc.BulletList ;\n  OrderedList = Ct(ListItem(1,'#')^1)\n             / pandoc.OrderedList ;\n  Table = (V\"TableHeader\" + Cc{})\n        * Ct(V\"TableRow\"^1)\n        / function(headrow, bodyrows)\n            local numcolumns = #(bodyrows[1])\n            local aligns = {}\n            local widths = {}\n            for i = 1,numcolumns do\n              aligns[i] = pandoc.AlignDefault\n              widths[i] = 0\n            end\n            return pandoc.utils.from_simple_table(\n              pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows))\n          end ;\n  TableHeader = Ct(V\"HeaderCell\"^1)\n              * cellsep^-1\n              * spacechar^0\n              * newline ;\n  TableRow   = Ct(V\"BodyCell\"^1)\n             * cellsep^-1\n             * spacechar^0\n             * newline ;\n  HeaderCell = cellsep\n             * P\"=\"\n             * spacechar^0\n             * Ct((V\"Inline\" - (newline + cellsep))^0)\n             / function(ils) return { pandoc.Plain(ils) } end ;\n  BodyCell   = cellsep\n             * spacechar^0\n             * Ct((V\"Inline\" - (newline + cellsep))^0)\n             / function(ils) return { pandoc.Plain(ils) } end ;\n  Inline = V\"Emph\"\n         + V\"Strong\"\n         + V\"LineBreak\"\n         + V\"Link\"\n         + V\"URL\"\n         + V\"Image\"\n         + V\"Str\"\n         + V\"Space\"\n         + V\"SoftBreak\"\n         + V\"Escaped\"\n         + V\"Placeholder\"\n         + V\"Code\"\n         + V\"Special\" ;\n  Str = wordchar^1\n      / pandoc.Str;\n  Escaped = P\"~\"\n          * C(P(1))\n          / pandoc.Str ;\n  Special = specialchar\n          / pandoc.Str;\n  Space = spacechar^1\n        / pandoc.Space ;\n  SoftBreak = endline\n            * # -(V\"HorizontalRule\" + V\"CodeBlock\")\n            / pandoc.SoftBreak ;\n  LineBreak = P\"\\\\\\\\\"\n            / pandoc.LineBreak ;\n  Code = P\"{{{\"\n       * C((1 - P\"}}}\")^0)\n       * P\"}}}\"\n       / trim / pandoc.Code ;\n  Link = P\"[[\"\n       * C((1 - (P\"]]\" + P\"|\"))^0)\n       * (P\"|\" * Ct((V\"Inline\" - P\"]]\")^1))^-1 * P\"]]\"\n       / function(url, desc)\n           local txt = desc or {pandoc.Str(url)}\n           return pandoc.Link(txt, url)\n         end ;\n  Image = P\"{{\"\n        * #-P\"{\"\n        * C((1 - (S\"}\"))^0)\n        * (P\"|\" * Ct((V\"Inline\" - P\"}}\")^1))^-1\n        * P\"}}\"\n        / function(url, desc)\n            local txt = desc or \"\"\n            return pandoc.Image(txt, url)\n          end ;\n  URL = P\"http\"\n      * P\"s\"^-1\n      * P\":\"\n      * (1 - (whitespacechar + (S\",.?!:;\\\"'\" * #whitespacechar)))^1\n      / function(url)\n          return pandoc.Link(pandoc.Str(url), url)\n        end ;\n  Emph = P\"//\"\n       * Ct((V\"Inline\" - P\"//\")^1)\n       * P\"//\"\n       / pandoc.Emph ;\n  Strong = P\"**\"\n         * Ct((V\"Inline\" -P\"**\")^1)\n         * P\"**\"\n         / pandoc.Strong ;\n}\n\nfunction Reader(input, reader_options)\n  return lpeg.match(G, tostring(input))\nend\n"
  },
  {
    "path": "data/default.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" demote-non-dropping-particle=\"display-and-sort\" page-range-format=\"chicago-16\" version=\"1.0\">\n  <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->\n  <info>\n    <title>Chicago Manual of Style 18th edition (author-date)</title>\n    <title-short>CMOS with Bluebook (author-date [13.102])</title-short>\n    <id>http://www.zotero.org/styles/chicago-author-date</id>\n    <link href=\"http://www.zotero.org/styles/chicago-author-date\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/chicago-notes-bibliography\" rel=\"template\"/>\n    <link href=\"https://www.chicagomanualofstyle.org/\" rel=\"documentation\"/>\n    <author>\n      <name>Andrew Dunning</name>\n      <uri>https://orcid.org/0000-0003-0464-5036</uri>\n    </author>\n    <category citation-format=\"author-date\"/>\n    <category field=\"anthropology\"/>\n    <category field=\"communications\"/>\n    <category field=\"generic-base\"/>\n    <category field=\"geography\"/>\n    <category field=\"history\"/>\n    <category field=\"humanities\"/>\n    <category field=\"law\"/>\n    <category field=\"linguistics\"/>\n    <category field=\"literature\"/>\n    <category field=\"philosophy\"/>\n    <category field=\"political_science\"/>\n    <category field=\"science\"/>\n    <category field=\"social_science\"/>\n    <category field=\"sociology\"/>\n    <category field=\"theology\"/>\n    <summary>Chicago-style source citations (with Bluebook for legal citations), author-date system</summary>\n    <updated>2025-08-07T00:00:00+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <!-- Chicago omits 'by' from `verb-short` forms; it abbreviates only the most common roles -->\n      <term name=\"advance-online-publication\">ahead of print</term>\n      <term name=\"anonymous\">unsigned</term>\n      <term form=\"verb-short\" name=\"collection-editor\">ed.</term>\n      <term form=\"short\" name=\"collection-number\">\n        <single>vol.</single>\n        <multiple>vols.</multiple>\n      </term>\n      <term form=\"verb-short\" name=\"compiler\">comp.</term>\n      <term form=\"verb-short\" name=\"editor\">ed.</term>\n      <term form=\"short\" name=\"editor-translator\">\n        <single>ed. and trans.</single>\n        <multiple>eds. and trans.</multiple>\n      </term>\n      <term form=\"short\" name=\"editortranslator\">\n        <single>ed. and trans.</single>\n        <multiple>eds. and trans.</multiple>\n      </term>\n      <term form=\"verb\" name=\"editor-translator\">edited and translated by</term>\n      <term form=\"verb\" name=\"editortranslator\">edited and translated by</term>\n      <term form=\"verb-short\" name=\"editor-translator\">ed. and trans.</term>\n      <term form=\"verb-short\" name=\"editortranslator\">ed. and trans.</term>\n      <term form=\"verb-short\" name=\"illustrator\">ill.</term>\n      <term form=\"short\" name=\"legislation\">Pub. L.</term>\n      <term name=\"manuscript\">unpublished manuscript</term>\n      <term name=\"original-work-published\">originally published as</term>\n      <term form=\"short\" name=\"paper-conference\">paper</term>\n      <!-- 'under' replaces 's.v.' from CMOS17 and earlier (CMOS18 14.130) -->\n      <term name=\"sub-verbo\">under</term>\n      <term form=\"short\" name=\"sub-verbo\">under</term>\n      <term name=\"timestamp\">at</term>\n      <term form=\"verb-short\" name=\"translator\">trans.</term>\n    </terms>\n  </locale>\n  <locale xml:lang=\"en-GB\">\n    <terms>\n      <!-- ensure consistency with other `en-GB` contractions -->\n      <term form=\"short\" name=\"collection-number\">\n        <single>vol.</single>\n        <multiple>vols</multiple>\n      </term>\n      <term form=\"short\" name=\"editor-translator\">\n        <single>ed. and trans.</single>\n        <multiple>eds and trans.</multiple>\n      </term>\n      <term form=\"short\" name=\"editortranslator\">\n        <single>ed. and trans.</single>\n        <multiple>eds and trans.</multiple>\n      </term>\n    </terms>\n  </locale>\n  <!-- Contents:\n    \n       This file interprets Chicago using APA's four basic reference elements\n       (cf. CMOS18 14.2, 14.64, 14.161):\n\n        1. Author (CMOS18 13.74-86)\n        2. Date (author-date system only, CMOS18 13.102)\n        3. Title and descriptions (CMOS18 13.87-101)\n            3.1. Title\n            3.2. Description\n            3.3. Identifiers (edition, contributors, volume)\n        4. Source\n            4.1. Serial sources\n            4.2. Monographic sources\n            4.3. Series\n            4.4. Event\n            4.5. Publisher\n            4.6. Date\n            4.7. Locator (including page references)\n            4.8. Medium\n            4.9. Archival location\n            4.10. URL or persistent identifier\n      \n       Freeform annotations to bibliography entries: \n        \n        5. Notes\n       \n       Chicago also provides parallel rules for legal references following\n       The Bluebook: A Uniform System of Citation (code shared with APA):\n\n        6. Legal references\n  -->\n  <!-- In this file, macros suffixed `-bib` and `-note` are parallel versions\n       of the same features for the bibliography and notes, and all changes\n       must be applied to both. They should only contain differences of\n       punctuation (periods in bibliography, commas in notes) and capitalization,\n       except where the comments indicate structural changes. -->\n  <!-- Categories of CSL item types:\n\n       Serial\n       : article-journal article-magazine article-newspaper periodical post-weblog review review-book\n\n       Serial or Monographic\n       : interview paper-conference\n\n         Monographic with any of `collection-editor compiler editor editorial-director`.\n         A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.\n\n       Monographic\n       : article book broadcast chapter classic collection dataset document\n         entry entry-dictionary entry-encyclopedia event figure\n         graphic manuscript map motion_picture musical_score\n         pamphlet patent performance personal_communication post report\n         software song speech standard thesis webpage\n\n       Legal\n       : bill hearing legal_case legislation regulation treaty\n  -->\n  <!-- Variable labels -->\n  <macro name=\"label-chapter-number\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"chapter-number\" type=\"song\">\n          <text value=\"track\"/>\n        </if>\n        <else-if is-numeric=\"chapter-number\">\n          <label form=\"short\" variable=\"chapter-number\"/>\n        </else-if>\n      </choose>\n      <text variable=\"chapter-number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-chapter-number-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"chapter-number\" type=\"song\">\n          <text text-case=\"capitalize-first\" value=\"track\"/>\n        </if>\n        <else-if is-numeric=\"chapter-number\">\n          <label form=\"short\" text-case=\"capitalize-first\" variable=\"chapter-number\"/>\n        </else-if>\n      </choose>\n      <text text-case=\"capitalize-first\" variable=\"chapter-number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-collection-number\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"collection-number\">\n          <label form=\"short\" variable=\"collection-number\"/>\n        </if>\n      </choose>\n      <text variable=\"collection-number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-edition\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"edition\">\n          <number form=\"ordinal\" variable=\"edition\"/>\n          <label form=\"short\" variable=\"edition\"/>\n        </if>\n        <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n          <!-- full label for serial edition (CMOS18 14.89) -->\n          <text variable=\"edition\"/>\n          <label variable=\"edition\"/>\n        </else-if>\n        <else-if match=\"any\" type=\"interview paper-conference\">\n          <choose>\n            <if match=\"any\" variable=\"collection-editor compiler editor editorial-director\">\n              <!-- monographic usage -->\n              <text variable=\"edition\"/>\n            </if>\n            <else>\n              <!-- serial usage -->\n              <text variable=\"edition\"/>\n              <label variable=\"edition\"/>\n            </else>\n          </choose>\n        </else-if>\n        <else>\n          <text variable=\"edition\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"label-edition-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"edition\">\n          <number form=\"ordinal\" variable=\"edition\"/>\n          <label form=\"short\" variable=\"edition\"/>\n        </if>\n        <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n          <!-- full label for serial edition (CMOS18 14.89) -->\n          <text text-case=\"title\" variable=\"edition\"/>\n          <label text-case=\"capitalize-first\" variable=\"edition\"/>\n        </else-if>\n        <else-if match=\"any\" type=\"interview paper-conference\">\n          <choose>\n            <if match=\"any\" variable=\"collection-editor compiler editor editorial-director\">\n              <!-- monographic usage -->\n              <text text-case=\"capitalize-first\" variable=\"edition\"/>\n            </if>\n            <else>\n              <!-- serial usage -->\n              <text text-case=\"title\" variable=\"edition\"/>\n              <label text-case=\"capitalize-first\" variable=\"edition\"/>\n            </else>\n          </choose>\n        </else-if>\n        <else>\n          <text text-case=\"capitalize-first\" variable=\"edition\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"label-issue\">\n    <group delimiter=\" \">\n      <label form=\"short\" variable=\"issue\"/>\n      <text variable=\"issue\"/>\n    </group>\n  </macro>\n  <macro name=\"label-locator\">\n    <group delimiter=\" \">\n      <choose>\n        <if locator=\"page\"/>\n        <else-if match=\"any\" type=\"bill hearing legal_case legislation regulation treaty\">\n          <!-- Bluebook-style labels for legal types (CMOS18 14.174) -->\n          <choose>\n            <if locator=\"chapter paragraph section\" match=\"any\">\n              <label form=\"symbol\" variable=\"locator\"/>\n            </if>\n            <else>\n              <label form=\"short\" variable=\"locator\"/>\n            </else>\n          </choose>\n        </else-if>\n        <else-if is-numeric=\"locator\">\n          <choose>\n            <if locator=\"line\">\n              <label variable=\"locator\"/>\n            </if>\n            <else>\n              <label form=\"short\" variable=\"locator\"/>\n            </else>\n          </choose>\n        </else-if>\n        <else-if locator=\"chapter line verse\" match=\"any\"/>\n        <!-- a non-numeric canonical reference is identified by its formatting and does not need a label (CMOS18 14.143-54) -->\n        <else>\n          <label form=\"short\" variable=\"locator\"/>\n        </else>\n      </choose>\n      <text variable=\"locator\"/>\n    </group>\n  </macro>\n  <macro name=\"label-number-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"standard\"/>\n        <else-if is-numeric=\"number\" match=\"any\" type=\"legislation regulation\">\n          <label form=\"short\" text-case=\"capitalize-first\" variable=\"number\"/>\n        </else-if>\n      </choose>\n      <text text-case=\"capitalize-first\" variable=\"number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-number-of-volumes\">\n    <group delimiter=\" \">\n      <text variable=\"number-of-volumes\"/>\n      <choose>\n        <if is-numeric=\"number-of-volumes\">\n          <label form=\"short\" variable=\"number-of-volumes\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"label-part-number\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"part-number\">\n          <!-- TODO: Replace with `part-number` label when CSL provides one -->\n          <text form=\"short\" term=\"part\"/>\n        </if>\n      </choose>\n      <text variable=\"part-number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-part-number-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"part-number\">\n          <!-- TODO: Replace with `part-number` label when CSL provides one -->\n          <text form=\"short\" term=\"part\" text-case=\"capitalize-first\"/>\n        </if>\n      </choose>\n      <text text-case=\"capitalize-first\" variable=\"part-number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-section-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"section\">\n          <label form=\"short\" text-case=\"capitalize-first\" variable=\"section\"/>\n        </if>\n      </choose>\n      <text text-case=\"title\" variable=\"section\"/>\n    </group>\n  </macro>\n  <macro name=\"label-section-symbol\">\n    <group delimiter=\" \">\n      <label form=\"symbol\" variable=\"section\"/>\n      <text variable=\"section\"/>\n    </group>\n  </macro>\n  <macro name=\"label-supplement-number\">\n    <group delimiter=\" \">\n      <choose>\n        <!-- TODO: Replace with `supplement-number` label when CSL provides one -->\n        <if is-numeric=\"supplement-number\" variable=\"volume-title\">\n          <!-- if there is a volume title, it is already described as a supplement -->\n          <text form=\"short\" term=\"issue\"/>\n        </if>\n        <else-if is-numeric=\"supplement-number\" type=\"periodical\" variable=\"title\">\n          <text form=\"short\" term=\"issue\"/>\n        </else-if>\n        <else-if is-numeric=\"supplement-number\">\n          <text form=\"short\" term=\"supplement\"/>\n        </else-if>\n      </choose>\n      <text variable=\"supplement-number\"/>\n    </group>\n  </macro>\n  <macro name=\"label-version\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"software\">\n          <!-- short version label for software (CMOS18 14.169) -->\n          <label form=\"short\" variable=\"version\"/>\n        </if>\n        <else>\n          <label variable=\"version\"/>\n        </else>\n      </choose>\n      <text variable=\"version\"/>\n    </group>\n  </macro>\n  <macro name=\"label-version-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"software\">\n          <!-- short version label for software (CMOS18 14.169) -->\n          <label form=\"short\" text-case=\"capitalize-first\" variable=\"version\"/>\n        </if>\n        <else>\n          <label text-case=\"capitalize-first\" variable=\"version\"/>\n        </else>\n      </choose>\n      <text variable=\"version\"/>\n    </group>\n  </macro>\n  <macro name=\"label-volume\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"volume\">\n          <label form=\"short\" variable=\"volume\"/>\n        </if>\n      </choose>\n      <text variable=\"volume\"/>\n    </group>\n  </macro>\n  <macro name=\"label-volume-capitalized\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"volume\">\n          <label form=\"short\" text-case=\"capitalize-first\" variable=\"volume\"/>\n        </if>\n      </choose>\n      <text text-case=\"capitalize-first\" variable=\"volume\"/>\n    </group>\n  </macro>\n  <!-- 1. Author (CMOS18 13.74-86) -->\n  <macro name=\"author-bib\">\n    <names variable=\"composer\">\n      <name and=\"text\" delimiter-precedes-last=\"always\" name-as-sort-order=\"first\"/>\n      <label form=\"short\" prefix=\", \"/>\n      <substitute>\n        <names variable=\"author\"/>\n        <!-- cf. `interview` model (CMOS18 14.110); if it is desired to prioritize `host` over `guest`, the latter could be encoded as a `contributor` -->\n        <names variable=\"guest\"/>\n        <names variable=\"host\"/>\n        <choose>\n          <if type=\"song\">\n            <names variable=\"performer\"/>\n          </if>\n        </choose>\n        <choose>\n          <if type=\"classic\">\n            <!-- contributors fall after the title of `classic` (CMOS18 14.147) -->\n            <text macro=\"author-title-substitute-bib\"/>\n          </if>\n          <else-if type=\"entry-dictionary\" variable=\"container-title\">\n            <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->\n            <text macro=\"author-title-substitute-container\"/>\n          </else-if>\n          <else-if type=\"entry-encyclopedia\" variable=\"container-title\">\n            <text macro=\"author-title-substitute-container\"/>\n          </else-if>\n        </choose>\n        <names variable=\"illustrator\"/>\n        <choose>\n          <if match=\"none\" type=\"standard\">\n            <names variable=\"editor-translator\"/>\n            <names variable=\"editor\"/>\n            <names variable=\"translator\"/>\n            <names variable=\"collection-editor\"/>\n          </if>\n        </choose>\n        <names variable=\"director\"/>\n        <choose>\n          <!-- serial `broadcast` prioritizes title (CMOS18 14.165, 14.168) -->\n          <if type=\"broadcast\" variable=\"container-title number title\"/>\n          <else>\n            <names variable=\"producer\"/>\n            <names variable=\"executive-producer\"/>\n            <names variable=\"series-creator\"/>\n            <choose>\n              <if type=\"broadcast\">\n                <names variable=\"contributor\"/>\n              </if>\n            </choose>\n          </else>\n        </choose>\n        <names variable=\"editorial-director\"/>\n        <names variable=\"compiler\"/>\n        <choose>\n          <if match=\"any\" type=\"event performance speech\">\n            <names variable=\"chair\"/>\n            <names variable=\"organizer\"/>\n          </if>\n        </choose>\n        <names variable=\"curator\"/>\n        <choose>\n          <if type=\"software\">\n            <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169) -->\n            <text variable=\"publisher\"/>\n          </if>\n          <else-if type=\"standard\">\n            <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->\n            <text variable=\"authority\"/>\n          </else-if>\n        </choose>\n        <text macro=\"author-title-substitute-container\"/>\n        <text macro=\"author-title-substitute-bib\"/>\n        <choose>\n          <if type=\"manuscript\">\n            <choose>\n              <if match=\"none\" variable=\"container-title event-date event-place event-title genre title publisher publisher-place\">\n                <text macro=\"source-archive-bib\"/>\n              </if>\n            </choose>\n          </if>\n        </choose>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-inline\">\n    <choose>\n      <if match=\"any\" type=\"bill hearing legal_case legislation regulation treaty\">\n        <text macro=\"title-and-descriptions-short\"/>\n      </if>\n      <else-if match=\"any\" type=\"interview personal_communication\">\n        <text macro=\"author-inline-and-recipient\"/>\n      </else-if>\n      <else>\n        <names variable=\"composer\">\n          <name and=\"text\" form=\"short\" initialize-with=\". \"/>\n          <substitute>\n            <names variable=\"author\"/>\n            <names variable=\"guest\"/>\n            <names variable=\"host\"/>\n            <choose>\n              <if type=\"song\">\n                <names variable=\"performer\"/>\n              </if>\n            </choose>\n            <choose>\n              <if match=\"any\" type=\"classic performance\">\n                <!-- contributors fall after the title of `classic` (CMOS18 14.147), `performance` (CMOS18 14.166) -->\n                <text macro=\"author-title-substitute-short\"/>\n              </if>\n              <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n                <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->\n                <choose>\n                  <if variable=\"container-title\">\n                    <text macro=\"author-title-substitute-container\"/>\n                  </if>\n                </choose>\n              </else-if>\n            </choose>\n            <names variable=\"illustrator\"/>\n            <choose>\n              <if match=\"none\" type=\"standard\">\n                <names variable=\"editor-translator\"/>\n                <names variable=\"editor\"/>\n                <names variable=\"translator\"/>\n                <names variable=\"collection-editor\"/>\n              </if>\n            </choose>\n            <choose>\n              <if type=\"broadcast\" variable=\"container-title number title\"/>\n              <else>\n                <names variable=\"director\"/>\n                <names variable=\"producer\"/>\n                <names variable=\"executive-producer\"/>\n                <names variable=\"series-creator\"/>\n                <choose>\n                  <if type=\"broadcast\">\n                    <names variable=\"contributor\"/>\n                  </if>\n                </choose>\n              </else>\n            </choose>\n            <names variable=\"editorial-director\"/>\n            <names variable=\"compiler\"/>\n            <choose>\n              <if match=\"any\" type=\"event performance speech\">\n                <names variable=\"chair\"/>\n                <names variable=\"organizer\"/>\n              </if>\n            </choose>\n            <names variable=\"curator\"/>\n            <choose>\n              <if type=\"software\">\n                <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169) -->\n                <text variable=\"publisher\"/>\n              </if>\n              <else-if type=\"standard\">\n                <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->\n                <text variable=\"authority\"/>\n              </else-if>\n            </choose>\n            <text macro=\"author-title-substitute-container-short\"/>\n            <text macro=\"author-title-substitute-short\"/>\n            <choose>\n              <if type=\"manuscript\">\n                <choose>\n                  <if match=\"none\" variable=\"container-title event-date event-place event-title genre title publisher publisher-place\">\n                    <text macro=\"source-archive-note\"/>\n                  </if>\n                </choose>\n              </if>\n            </choose>\n          </substitute>\n        </names>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"author-sort\">\n    <choose>\n      <if match=\"any\" type=\"bill hearing legal_case legislation regulation treaty\">\n        <text macro=\"legal-title\"/>\n      </if>\n      <else>\n        <text macro=\"author-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Author elements -->\n  <macro name=\"author-inline-and-recipient\">\n    <!-- identical to `author-short-and-recipient` but with initialization -->\n    <group delimiter=\" \">\n      <choose>\n        <!-- Inaccessible personal commmunication is cited in-text (CMOS18 14.111) -->\n        <if match=\"none\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n          <!-- These variables indicate whether the letter is retrievable by the reader -->\n          <group delimiter=\", \">\n            <names variable=\"author\">\n              <name and=\"text\" initialize-with=\". \"/>\n              <substitute>\n                <text macro=\"title-and-descriptions-short\"/>\n              </substitute>\n            </names>\n          </group>\n          <choose>\n            <if match=\"none\" variable=\"genre\">\n              <names variable=\"recipient\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\" initialize-with=\". \"/>\n              </names>\n            </if>\n          </choose>\n        </if>\n        <else-if variable=\"author recipient\">\n          <names variable=\"author\">\n            <label/>\n            <name and=\"text\" form=\"short\" initialize-with=\". \"/>\n          </names>\n          <choose>\n            <if match=\"none\" variable=\"genre\">\n              <names variable=\"recipient\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\" form=\"short\" initialize-with=\". \"/>\n              </names>\n            </if>\n          </choose>\n        </else-if>\n        <else>\n          <names variable=\"author\">\n            <name and=\"text\" form=\"short\" initialize-with=\". \"/>\n            <substitute>\n              <text macro=\"title-and-descriptions-short\"/>\n            </substitute>\n          </names>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"author-title-substitute-bib\">\n    <choose>\n      <if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\n        <choose>\n          <if variable=\"reviewed-genre title\">\n            <text macro=\"title-bib\"/>\n          </if>\n          <else-if variable=\"reviewed-genre reviewed-title title\">\n            <text macro=\"title-bib\"/>\n          </else-if>\n          <else>\n            <text macro=\"title-and-descriptions-bib\"/>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"title\">\n        <text macro=\"title-bib\"/>\n      </else-if>\n      <else>\n        <!-- If an item has no `title`, substitute with descriptions. -->\n        <text macro=\"title-and-descriptions-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"author-title-substitute-short\">\n    <choose>\n      <if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\n        <choose>\n          <if variable=\"reviewed-genre title\">\n            <text macro=\"title-short\"/>\n          </if>\n          <else-if variable=\"reviewed-genre reviewed-title title\">\n            <text macro=\"title-short\"/>\n          </else-if>\n          <else>\n            <text macro=\"title-and-descriptions-short\"/>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"title\">\n        <text macro=\"title-short\"/>\n      </else-if>\n      <else>\n        <!-- If an item has no `title`, substitute with descriptions and capitalize -->\n        <text macro=\"title-and-descriptions-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"author-title-substitute-container\">\n    <choose>\n      <if match=\"none\" variable=\"container-title\"/>\n      <else-if match=\"any\" type=\"article-magazine article-newspaper\">\n        <!-- Anonymous magazine and newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->\n        <text macro=\"source-serial-name\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->\n        <text macro=\"source-serial-name\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"none\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- serial usage -->\n            <text macro=\"source-serial-name\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n        <!-- Anonymous entries in reference works (CMOS18 14.130) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n      <else-if type=\"broadcast\">\n        <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n      <else-if type=\"webpage\">\n        <!-- Website title substituted in bibliography only (CMOS18 14.104) -->\n        <text text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"author-title-substitute-container-short\">\n    <choose>\n      <if match=\"none\" variable=\"container-title\"/>\n      <else-if match=\"any\" type=\"article-magazine article-newspaper\">\n        <!-- Anonymous magazine/newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"none\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- serial usage -->\n            <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n        <!-- Anonymous entries in reference works (CMOS18 14.130) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n      <else-if type=\"broadcast\">\n        <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n      <else-if type=\"webpage\">\n        <!-- Website title substituted in bibliography only (CMOS18 14.104) -->\n        <text text-case=\"title\" variable=\"container-title\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!-- 2. Date (CMOS18 13.102) -->\n  <macro name=\"date\">\n    <choose>\n      <if variable=\"issued\">\n        <group delimiter=\" \">\n          <!-- reprints and earlier editions may give original year in brackets (CMOS18 14.16) -->\n          <text macro=\"date-original-year\" prefix=\"(\" suffix=\")\"/>\n          <group>\n            <text macro=\"date-issued-year\"/>\n            <text variable=\"year-suffix\"/>\n          </group>\n        </group>\n      </if>\n      <else-if variable=\"available-date\">\n        <date date-parts=\"year\" form=\"text\" variable=\"available-date\"/>\n      </else-if>\n      <else-if variable=\"event-date\">\n        <text macro=\"date-event-year\"/>\n      </else-if>\n      <else-if variable=\"status\">\n        <group>\n          <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\n          <text text-case=\"capitalize-first\" variable=\"status\"/>\n          <text prefix=\"-\" variable=\"year-suffix\"/>\n        </group>\n      </else-if>\n      <else-if type=\"collection\">\n        <!-- do not give n.d. for archival collections (CMOS18 14.128) -->\n        <text prefix=\"-\" variable=\"year-suffix\"/>\n      </else-if>\n      <else-if type=\"manuscript\">\n        <!-- do not give n.d. with a bare shelfmark -->\n        <choose>\n          <if match=\"any\" variable=\"container-title event-date event-place event-title genre title publisher publisher-place\">\n            <text form=\"short\" term=\"no date\"/>\n            <text prefix=\"-\" variable=\"year-suffix\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else>\n        <text form=\"short\" term=\"no date\"/>\n        <text prefix=\"-\" variable=\"year-suffix\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-short\">\n    <choose>\n      <if variable=\"issued\">\n        <group delimiter=\" \">\n          <choose>\n            <if is-uncertain-date=\"original-date\">\n              <!-- Uncertain date already has square brackets -->\n              <text macro=\"date-original-year\"/>\n            </if>\n            <else>\n              <text macro=\"date-original-year\" prefix=\"[\" suffix=\"]\"/>\n            </else>\n          </choose>\n          <group>\n            <choose>\n              <if match=\"any\" type=\"interview personal_communication\">\n                <choose>\n                  <if match=\"any\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n                    <!-- These variables indicate that the communication is retrievable by the reader. If not, then use the in-text-only personal communication format -->\n                    <text macro=\"date-issued-year\"/>\n                  </if>\n                  <else>\n                    <text macro=\"date-issued-full\"/>\n                  </else>\n                </choose>\n              </if>\n              <else>\n                <text macro=\"date-issued-year\"/>\n              </else>\n            </choose>\n            <text variable=\"year-suffix\"/>\n          </group>\n        </group>\n      </if>\n      <else-if variable=\"available-date\">\n        <date date-parts=\"year\" form=\"text\" variable=\"available-date\"/>\n      </else-if>\n      <else-if variable=\"event-date\">\n        <text macro=\"date-event-year\"/>\n      </else-if>\n      <else-if variable=\"status\">\n        <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\n        <text text-case=\"lowercase\" variable=\"status\"/>\n        <text prefix=\"-\" variable=\"year-suffix\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"interview personal_communication\">\n        <choose>\n          <if match=\"any\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n            <!-- only give n.d. for accessible personal communication (CMOS18 14.111)-->\n            <text form=\"short\" term=\"no date\"/>\n          </if>\n        </choose>\n        <text prefix=\"-\" variable=\"year-suffix\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"classic collection entry entry-dictionary entry-encyclopedia\">\n        <!-- do not give n.d. for archival collections (CMOS18 14.128), `classic` (CMOS18 14.143), or reference entries (CMOS18 14.131) -->\n        <text prefix=\"-\" variable=\"year-suffix\"/>\n      </else-if>\n      <else-if type=\"manuscript\">\n        <!-- do not give n.d. with a bare shelfmark -->\n        <choose>\n          <if match=\"any\" variable=\"container-title event-date event-place event-title genre title publisher publisher-place\">\n            <text form=\"short\" term=\"no date\"/>\n            <text prefix=\"-\" variable=\"year-suffix\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else>\n        <text form=\"short\" term=\"no date\"/>\n        <text prefix=\"-\" variable=\"year-suffix\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-sort-group\">\n    <!-- Sort items with and without dates (CMOS18 14.44):\n\n          1. items with dates (= 0)\n          2. `no date` items (= 1)\n          3. items with `status` (forthcoming, in press, etc.) (= 2) -->\n    <choose>\n      <if variable=\"issued\">\n        <text value=\"0\"/>\n      </if>\n      <else-if variable=\"status\">\n        <text value=\"2\"/>\n      </else-if>\n      <else>\n        <!-- n.d. -->\n        <text value=\"1\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-sort-year\">\n    <!-- while reference lists are to be sorted chronologically (CMOS18 13.112), it appears that only the year is to be taken into account (CMOS18 13.114) -->\n    <choose>\n      <if type=\"personal_communication\" variable=\"event-date issued\">\n        <date date-parts=\"year\" form=\"text\" variable=\"event-date\"/>\n      </if>\n      <else>\n        <text macro=\"date-issued-year\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Date elements -->\n  <macro name=\"date-event-full\">\n    <choose>\n      <if is-uncertain-date=\"issued\">\n        <!-- guessed-at date (CMOS18 14.44) -->\n        <date form=\"text\" prefix=\"[\" suffix=\"?]\" variable=\"event-date\"/>\n      </if>\n      <else>\n        <date form=\"text\" variable=\"event-date\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-event-year\">\n    <choose>\n      <if is-uncertain-date=\"issued\">\n        <!-- guessed-at date (CMOS18 14.44) -->\n        <date date-parts=\"year\" form=\"text\" prefix=\"[\" suffix=\"?]\" variable=\"event-date\"/>\n      </if>\n      <else>\n        <date date-parts=\"year\" form=\"text\" variable=\"event-date\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-issued-full\">\n    <choose>\n      <if is-uncertain-date=\"issued\">\n        <!-- guessed-at date (CMOS18 14.44) -->\n        <date form=\"text\" prefix=\"[\" suffix=\"?]\" variable=\"issued\"/>\n      </if>\n      <else>\n        <date form=\"text\" variable=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-issued-month\">\n    <date variable=\"issued\">\n      <date-part name=\"month\"/>\n    </date>\n  </macro>\n  <macro name=\"date-issued-month-day\">\n    <date variable=\"issued\">\n      <date-part name=\"month\"/>\n      <date-part name=\"day\" prefix=\" \"/>\n    </date>\n  </macro>\n  <macro name=\"date-issued-year\">\n    <choose>\n      <if is-uncertain-date=\"issued\">\n        <!-- guessed-at date (CMOS18 14.44) -->\n        <date date-parts=\"year\" form=\"text\" prefix=\"[\" suffix=\"?]\" variable=\"issued\"/>\n      </if>\n      <else>\n        <date date-parts=\"year\" form=\"text\" variable=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-original-month\">\n    <date variable=\"original-date\">\n      <date-part name=\"month\"/>\n    </date>\n  </macro>\n  <macro name=\"date-original-month-day\">\n    <date variable=\"original-date\">\n      <date-part name=\"month\"/>\n      <date-part name=\"day\" prefix=\" \"/>\n    </date>\n  </macro>\n  <macro name=\"date-original-year\">\n    <choose>\n      <if is-uncertain-date=\"original-date\">\n        <date date-parts=\"year\" form=\"text\" prefix=\"[\" suffix=\"?]\" variable=\"original-date\"/>\n      </if>\n      <else>\n        <date date-parts=\"year\" form=\"text\" variable=\"original-date\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 3. Title and descriptions (CMOS18 13.87-101) -->\n  <macro name=\"title-and-descriptions-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <if variable=\"title\">\n          <text macro=\"title-bib\"/>\n          <text macro=\"description-bib\"/>\n          <text macro=\"identifier-bib\"/>\n        </if>\n        <else-if match=\"any\" type=\"bill report\">\n          <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\n          <!-- Congressional reports are indistinguishable from other reports -->\n          <text macro=\"identifier-number-bib\"/>\n          <text macro=\"identifier-bib\"/>\n          <text macro=\"description-bib\"/>\n        </else-if>\n        <else>\n          <text macro=\"description-bib\"/>\n          <text macro=\"identifier-bib\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"title-and-descriptions-short\">\n    <choose>\n      <if variable=\"title\">\n        <text macro=\"title-short\"/>\n      </if>\n      <else-if match=\"any\" type=\"bill report\">\n        <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\n        <text macro=\"legal-identifier-bill-report\"/>\n      </else-if>\n      <else>\n        <text macro=\"description-short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-and-source-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"broadcast\" variable=\"container-title number title\">\n          <!-- Bespoke `broadcast` format (CMOS18 14.165, 14.168) -->\n          <text macro=\"source-monographic-title-bib\"/>\n          <group delimiter=\", \">\n            <text macro=\"identifier-number-bib\"/>\n            <text macro=\"title-bib\"/>\n            <text macro=\"description-bib\"/>\n            <text macro=\"source-monographic-identifier-contributors-bib\"/>\n          </group>\n          <text macro=\"source-series-bib\"/>\n          <choose>\n            <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->\n            <if match=\"any\" variable=\"event-date original-date original-publisher original-publisher-place publisher status\">\n              <text macro=\"source-event-bib\"/>\n            </if>\n          </choose>\n        </if>\n        <else-if type=\"chapter\" variable=\"container-title genre\">\n          <!-- 'Introduction to' etc. (CMOS18 14.12, 14.14) -->\n          <group delimiter=\" \">\n            <text macro=\"title-and-descriptions-bib\"/>\n            <text macro=\"source-bib\"/>\n          </group>\n        </else-if>\n        <else>\n          <text macro=\"title-and-descriptions-bib\"/>\n          <text macro=\"source-bib\"/>\n        </else>\n      </choose>\n      <group delimiter=\", \">\n        <choose>\n          <!-- show event information here only if collapsed with `issued` (CMOS18 14.167) -->\n          <if match=\"any\" variable=\"event-date original-date original-publisher original-publisher-place publisher status\"/>\n          <!-- monographic usage only -->\n          <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\"/>\n          <else-if match=\"any\" type=\"interview paper-conference\">\n            <choose>\n              <if match=\"any\" variable=\"collection-editor container-author editor editorial-director\">\n                <!-- monographic usage -->\n                <text macro=\"source-event-bib\"/>\n              </if>\n            </choose>\n          </else-if>\n          <else>\n            <text macro=\"source-event-bib\"/>\n          </else>\n        </choose>\n        <text macro=\"source-monographic-publication-bib\"/>\n      </group>\n      <text macro=\"source-medium-bib\"/>\n      <text macro=\"source-archive-bib\"/>\n      <text macro=\"source-date-accessed-DOI-URL-bib\"/>\n    </group>\n  </macro>\n  <!-- 3.1. Title -->\n  <macro name=\"title-bib\">\n    <choose>\n      <if match=\"any\" type=\"post webpage\">\n        <!-- Handle `container-title` on `post` or `webpage` in manner of `publisher` -->\n        <text macro=\"title-and-part-filter-review-bib\"/>\n      </if>\n      <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <text macro=\"title-and-part-filter-review-bib\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"any\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- monographic usage -->\n            <text macro=\"title-monographic-bib\"/>\n          </if>\n          <else>\n            <!-- serial usage -->\n            <text macro=\"title-and-part-filter-review-bib\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <text macro=\"title-monographic-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-short\">\n    <choose>\n      <if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\n        <choose>\n          <if variable=\"reviewed-genre title\">\n            <!-- Quotes, title case -->\n            <text form=\"short\" quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n          </if>\n          <else-if variable=\"reviewed-genre reviewed-title title\">\n            <!-- Quotes, title case -->\n            <text form=\"short\" quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n          </else-if>\n          <else>\n            <text macro=\"description-short\"/>\n          </else>\n        </choose>\n      </if>\n      <else>\n        <text macro=\"title-primary-short\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Title elements -->\n  <macro name=\"title-and-part-filter-review-bib\">\n    <choose>\n      <if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\n        <choose>\n          <if match=\"any\" variable=\"reviewed-genre reviewed-title\">\n            <text macro=\"title-and-part-title-bib\"/>\n          </if>\n        </choose>\n      </if>\n      <else>\n        <text macro=\"title-and-part-title-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-and-part-title-bib\">\n    <group delimiter=\". \">\n      <text macro=\"title-primary\"/>\n      <group delimiter=\", \">\n        <text macro=\"label-part-number-capitalized\"/>\n        <text macro=\"title-part\"/>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"title-monographic-bib\">\n    <!-- For monographic items, assume `part-number` and `part-title` refer to the book/volume. -->\n    <!-- There is no `title-monographic-note` as notes always open with the primary title. -->\n    <choose>\n      <if variable=\"container-title\">\n        <text macro=\"title-primary\"/>\n      </if>\n      <!-- For monographic items without `container-title`, bibliography entries list `part-title` or `volume-title` first if available -->\n      <else-if variable=\"part-title\">\n        <text macro=\"title-part\"/>\n      </else-if>\n      <else-if variable=\"volume-title\">\n        <text font-style=\"italic\" text-case=\"title\" variable=\"volume-title\"/>\n      </else-if>\n      <else>\n        <text macro=\"title-primary\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-part\">\n    <choose>\n      <if type=\"patent\">\n        <!-- No italics or quotes, sentence case -->\n        <text form=\"short\" text-case=\"capitalize-first\" variable=\"part-title\"/>\n      </if>\n      <else-if match=\"any\" type=\"bill collection legislation regulation treaty\">\n        <!-- No italics or quotes, title case -->\n        <text text-case=\"title\" variable=\"part-title\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <!-- Italicized, sentence case -->\n        <text font-style=\"italic\" variable=\"part-title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"book classic graphic hearing map\">\n        <!-- Italicized, title case (regardless of `container-title`) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"part-title\"/>\n      </else-if>\n      <else-if type=\"entry-encyclopedia\" variable=\"author container-title\">\n        <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\n        <text quotes=\"true\" text-case=\"title\" variable=\"part-title\"/>\n      </else-if>\n      <else-if type=\"entry-dictionary\" variable=\"container-title\">\n        <!-- Quotes, sentence case -->\n        <text quotes=\"true\" variable=\"part-title\"/>\n      </else-if>\n      <else-if type=\"entry-encyclopedia\" variable=\"container-title\">\n        <!-- Quotes, sentence case -->\n        <text quotes=\"true\" variable=\"part-title\"/>\n      </else-if>\n      <else-if type=\"post\">\n        <!-- Quotes, sentence case -->\n        <text quotes=\"true\" variable=\"part-title\"/>\n      </else-if>\n      <!-- Other types are formatted based on presence of `container-title` -->\n      <else-if variable=\"container-title\">\n        <!-- Quotes, title case -->\n        <text quotes=\"true\" text-case=\"title\" variable=\"part-title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\">\n        <!-- Container-like but not necessarily with `container-title` -->\n        <!-- Quotes, title case -->\n        <text quotes=\"true\" text-case=\"title\" variable=\"part-title\"/>\n      </else-if>\n      <else>\n        <!-- Italicized, title case (default) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"part-title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-primary\">\n    <choose>\n      <if type=\"patent\">\n        <!-- No italics or quotes, sentence case -->\n        <text form=\"short\" text-case=\"capitalize-first\" variable=\"title\"/>\n      </if>\n      <else-if match=\"any\" type=\"bill collection legislation regulation treaty\">\n        <!-- No italics or quotes, title case -->\n        <text text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <!-- Italicized, sentence case -->\n        <text font-style=\"italic\" variable=\"title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"book classic graphic hearing map\">\n        <!-- Italicized, title case (regardless of `container-title`) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"entry-encyclopedia\" variable=\"author container-title\">\n        <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\n        <text quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"entry-dictionary\" variable=\"container-title\">\n        <!-- Quotes, sentence case -->\n        <text quotes=\"true\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"entry-encyclopedia\" variable=\"container-title\">\n        <!-- Quotes, sentence case -->\n        <text quotes=\"true\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"post\">\n        <!-- Quotes, sentence case -->\n        <text quotes=\"true\" variable=\"title\"/>\n      </else-if>\n      <!-- Other types are formatted based on presence of `container-title` -->\n      <else-if variable=\"container-title\">\n        <!-- Quotes, title case -->\n        <text quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\">\n        <!-- Container-like but not necessarily with `container-title` -->\n        <!-- Quotes, title case -->\n        <text quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else>\n        <!-- Italicized, title case (default) -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-primary-short\">\n    <choose>\n      <if type=\"patent\">\n        <!-- No italics or quotes, sentence case -->\n        <text form=\"short\" text-case=\"capitalize-first\" variable=\"title\"/>\n      </if>\n      <else-if match=\"any\" type=\"bill collection legislation regulation treaty\">\n        <!-- No italics or quotes, title case -->\n        <text form=\"short\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <!-- Italicized, sentence case -->\n        <text font-style=\"italic\" form=\"short\" variable=\"title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"book classic graphic hearing map\">\n        <!-- Italicized, title case (regardless of `container-title`) -->\n        <text font-style=\"italic\" form=\"short\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"entry-encyclopedia\" variable=\"author container-title\">\n        <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\n        <text form=\"short\" quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"entry-dictionary\" variable=\"container-title\">\n        <!-- Quotes, sentence case -->\n        <text form=\"short\" quotes=\"true\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"entry-encyclopedia\" variable=\"container-title\">\n        <!-- Quotes, sentence case -->\n        <text form=\"short\" quotes=\"true\" variable=\"title\"/>\n      </else-if>\n      <else-if type=\"post\">\n        <!-- Quotes, sentence case -->\n        <text form=\"short\" quotes=\"true\" variable=\"title\"/>\n      </else-if>\n      <!-- Other types are formatted based on presence of `container-title` -->\n      <else-if variable=\"container-title\">\n        <!-- Quotes, title case -->\n        <text form=\"short\" quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\">\n        <!-- Container-like but not necessarily with `container-title` -->\n        <!-- Quotes, title case -->\n        <text form=\"short\" quotes=\"true\" text-case=\"title\" variable=\"title\"/>\n      </else-if>\n      <else>\n        <!-- Italicized, title case (default) -->\n        <text font-style=\"italic\" form=\"short\" text-case=\"title\" variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 3.2. Description -->\n  <macro name=\"description-bib\">\n    <choose>\n      <if match=\"any\" type=\"interview\" variable=\"interviewer\">\n        <text macro=\"description-interview-bib\"/>\n      </if>\n      <else-if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <text macro=\"description-review-bib\"/>\n      </else-if>\n      <else-if type=\"personal_communication\">\n        <text macro=\"description-letter-bib\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <text macro=\"description-serial-bib\"/>\n      </else-if>\n      <else-if type=\"paper-conference\">\n        <text macro=\"description-paper-conference-bib\"/>\n      </else-if>\n      <else-if type=\"song\" variable=\"composer\">\n        <text macro=\"description-song-bib\"/>\n      </else-if>\n      <!-- thesis type appears with university name (CMOS18 14.113) -->\n      <else-if type=\"thesis\"/>\n      <else-if match=\"none\" variable=\"container-title\">\n        <!-- Other description -->\n        <text macro=\"description-format-bib\"/>\n      </else-if>\n      <else>\n        <text macro=\"description-generic-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-short\">\n    <choose>\n      <if match=\"any\" type=\"interview\" variable=\"interviewer\">\n        <text macro=\"description-interview-short\"/>\n      </if>\n      <else-if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n        <text macro=\"description-review-short\"/>\n      </else-if>\n      <else-if type=\"personal_communication\">\n        <text macro=\"description-letter-short\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <text macro=\"description-serial-short\"/>\n      </else-if>\n      <else-if type=\"paper-conference\">\n        <choose>\n          <if match=\"any\" variable=\"collection-editor container-author editor editorial-director\">\n            <!-- monographic usage -->\n            <text macro=\"description-format-short\"/>\n          </if>\n          <else>\n            <!-- serial usage -->\n            <text macro=\"description-serial-short\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <text macro=\"description-format-short\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Description elements -->\n  <macro name=\"description-format-bib\">\n    <choose>\n      <if variable=\"genre number\"/>\n      <else-if variable=\"genre\">\n        <text text-case=\"capitalize-first\" variable=\"genre\"/>\n      </else-if>\n      <else-if type=\"manuscript\">\n        <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\n        <choose>\n          <if match=\"none\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n            <text term=\"manuscript\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if type=\"personal_communication\">\n        <!-- 'personal communication' if no `genre` (CMOS18 14.111) -->\n        <choose>\n          <if match=\"none\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n            <text term=\"personal-communication\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"description-format-short\">\n    <choose>\n      <if variable=\"genre\">\n        <text variable=\"genre\"/>\n      </if>\n      <else-if variable=\"medium\">\n        <text variable=\"medium\"/>\n      </else-if>\n      <else-if type=\"manuscript\">\n        <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\n        <choose>\n          <if match=\"none\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n            <text term=\"manuscript\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if type=\"personal_communication\">\n        <!-- 'pers. comm.' if no `genre` (CMOS18 14.111) -->\n        <choose>\n          <if match=\"none\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n            <text form=\"short\" term=\"personal-communication\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if variable=\"chapter-number\">\n        <text macro=\"label-chapter-number\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"description-generic-bib\">\n    <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->\n    <choose>\n      <if match=\"any\" type=\"event paper-conference performance speech\">\n        <choose>\n          <if match=\"any\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- monographic usage -->\n            <text macro=\"description-format-bib\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if match=\"none\" type=\"document report software standard\">\n        <text macro=\"description-format-bib\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"description-interview-bib\">\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"genre number\">\n          <!-- `genre` printed with `number` -->\n          <names variable=\"interviewer\">\n            <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n            <name and=\"text\"/>\n          </names>\n        </if>\n        <else-if variable=\"genre\">\n          <group delimiter=\" \">\n            <text text-case=\"capitalize-first\" variable=\"genre\"/>\n            <group delimiter=\" \">\n              <text form=\"verb\" term=\"container-author\"/>\n              <names variable=\"interviewer\"/>\n            </group>\n          </group>\n        </else-if>\n        <else-if variable=\"interviewer\">\n          <names variable=\"interviewer\">\n            <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n            <name and=\"text\"/>\n          </names>\n        </else-if>\n        <else>\n          <text macro=\"description-format-bib\"/>\n        </else>\n      </choose>\n      <text macro=\"source-event-place-first\"/>\n    </group>\n  </macro>\n  <macro name=\"description-interview-short\">\n    <choose>\n      <if disambiguate=\"true\">\n        <names variable=\"interviewer\">\n          <label form=\"verb\" suffix=\" \"/>\n          <name and=\"text\"/>\n          <substitute>\n            <text macro=\"description-format-short\"/>\n          </substitute>\n        </names>\n      </if>\n      <else-if match=\"any\" variable=\"genre medium\">\n        <choose>\n          <if match=\"none\" variable=\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n            <!-- capitalize if no author or title -->\n            <text macro=\"description-format-bib\"/>\n          </if>\n          <else>\n            <text macro=\"description-format-short\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <!-- generic description for an unpublished interview (CMOS18 14.108) -->\n        <text term=\"interview\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-letter-bib\">\n    <choose>\n      <if variable=\"recipient\">\n        <group delimiter=\", \">\n          <choose>\n            <if variable=\"genre number\">\n              <!-- `genre` appears with `number` -->\n              <names variable=\"recipient\">\n                <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                <name and=\"text\"/>\n              </names>\n            </if>\n            <else-if variable=\"genre\">\n              <group delimiter=\" \">\n                <text macro=\"description-format-bib\"/>\n                <names variable=\"recipient\">\n                  <label form=\"verb\" suffix=\" \"/>\n                  <name and=\"text\"/>\n                </names>\n              </group>\n            </else-if>\n            <else>\n              <names variable=\"recipient\">\n                <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                <name and=\"text\"/>\n              </names>\n            </else>\n          </choose>\n          <text variable=\"event-place\"/>\n          <text macro=\"date-event-full\"/>\n        </group>\n      </if>\n      <else>\n        <text macro=\"description-format-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-letter-short\">\n    <!-- shortened notes ideally give author, recipient, place, and date (CMOS18 14.13) -->\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"genre recipient\">\n          <group delimiter=\" \">\n            <text macro=\"description-format-short\"/>\n            <names variable=\"recipient\">\n              <label form=\"verb\" suffix=\" \"/>\n              <name and=\"text\"/>\n            </names>\n          </group>\n        </if>\n        <else>\n          <text macro=\"description-format-short\"/>\n        </else>\n      </choose>\n      <text variable=\"event-place\"/>\n      <text macro=\"date-event-full\"/>\n    </group>\n  </macro>\n  <macro name=\"description-paper-conference-bib\">\n    <choose>\n      <if match=\"any\" variable=\"collection-editor container-author editor editorial-director\">\n        <!-- monographic usage -->\n        <text macro=\"description-generic-bib\"/>\n      </if>\n      <else>\n        <!-- serial usage -->\n        <group delimiter=\". \">\n          <text macro=\"description-serial-bib\"/>\n          <text macro=\"source-event-bib\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-review-bib\">\n    <!-- Reviewed item -->\n    <group delimiter=\". \">\n      <group delimiter=\", \">\n        <group delimiter=\" \">\n          <text macro=\"description-review-genre-bib\"/>\n          <text macro=\"description-review-title\"/>\n        </group>\n        <choose>\n          <if variable=\"reviewed-genre reviewed-title title\">\n            <names variable=\"reviewed-author\">\n              <label form=\"verb\" suffix=\" \"/>\n              <name and=\"text\"/>\n            </names>\n          </if>\n          <else-if variable=\"reviewed-genre\"/>\n          <else>\n            <names variable=\"reviewed-author\">\n              <label form=\"verb\" suffix=\" \"/>\n              <name and=\"text\"/>\n            </names>\n          </else>\n        </choose>\n        <text macro=\"source-event-place-first\"/>\n      </group>\n      <text macro=\"label-section-capitalized\"/>\n    </group>\n  </macro>\n  <macro name=\"description-review-genre-bib\">\n    <choose>\n      <if variable=\"reviewed-genre\">\n        <group delimiter=\" \">\n          <text macro=\"description-review-term-unsigned-bib\"/>\n          <text variable=\"reviewed-genre\"/>\n          <choose>\n            <if match=\"none\" variable=\"reviewed-title\">\n              <names variable=\"reviewed-author\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\"/>\n              </names>\n            </if>\n          </choose>\n        </group>\n      </if>\n      <else-if variable=\"number\">\n        <text macro=\"description-review-term-unsigned-bib\"/>\n      </else-if>\n      <!-- If no `reviewed-genre`, assume that `genre` is entered as 'Review of the book' or similar -->\n      <else-if variable=\"genre\">\n        <text text-case=\"capitalize-first\" variable=\"genre\"/>\n      </else-if>\n      <else>\n        <text macro=\"description-review-term-unsigned-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-review-short\">\n    <group delimiter=\" \">\n      <text term=\"review-of\"/>\n      <text macro=\"description-review-title-short\"/>\n    </group>\n  </macro>\n  <macro name=\"description-review-term-unsigned-bib\">\n    <!-- Anonymous reviews appear as 'unsigned' (CMOS18 14.102) -->\n    <choose>\n      <if match=\"any\" variable=\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n        <text term=\"review-of\" text-case=\"capitalize-first\"/>\n      </if>\n      <else>\n        <group delimiter=\" \">\n          <text term=\"anonymous\" text-case=\"capitalize-first\"/>\n          <text term=\"review-of\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-review-title\">\n    <choose>\n      <if match=\"any\" variable=\"reviewed-genre reviewed-title\">\n        <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\n        <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"reviewed-title\"/>\n      </if>\n      <else>\n        <!-- Assume title is title of reviewed work -->\n        <text font-style=\"italic\" text-case=\"title\" variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-review-title-short\">\n    <choose>\n      <if match=\"any\" variable=\"reviewed-genre reviewed-title\">\n        <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\n        <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\n        <text font-style=\"italic\" form=\"short\" text-case=\"title\" variable=\"reviewed-title\"/>\n      </if>\n      <else>\n        <!-- Assume title is title of reviewed work -->\n        <text font-style=\"italic\" form=\"short\" text-case=\"title\" variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-serial-bib\">\n    <group delimiter=\". \">\n      <text macro=\"description-format-bib\"/>\n      <!-- `section` provides magazine departments (CMOS18 14.88) and newspaper column names (CMOS18 14.93) -->\n      <text macro=\"label-section-capitalized\"/>\n    </group>\n  </macro>\n  <macro name=\"description-serial-short\">\n    <choose>\n      <if variable=\"title\"/>\n      <else-if variable=\"genre\">\n        <text macro=\"description-format-short\"/>\n      </else-if>\n      <else>\n        <text variable=\"section\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-song-bib\">\n    <!-- Performer of classical music works -->\n    <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->\n    <group delimiter=\" \">\n      <!-- Based on `description-format` macro -->\n      <choose>\n        <if variable=\"genre\">\n          <text text-case=\"capitalize-first\" variable=\"genre\"/>\n          <text form=\"verb\" term=\"performer\"/>\n        </if>\n        <!-- providing 'performed by' label for recorded readings (CMOS18 14.164), but it should be omitted for classical music (CMOS18 14.163) -->\n        <else>\n          <text form=\"verb\" term=\"performer\" text-case=\"capitalize-first\"/>\n        </else>\n      </choose>\n      <names variable=\"author\">\n        <substitute>\n          <names variable=\"performer\"/>\n        </substitute>\n      </names>\n    </group>\n  </macro>\n  <!-- 3.3. Identifier (edition, contributors, volume) -->\n  <macro name=\"identifier-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"patent\">\n          <text macro=\"identifier-patent\"/>\n        </if>\n        <else-if type=\"report\">\n          <text macro=\"identifier-report-bib\"/>\n        </else-if>\n        <else-if match=\"any\" type=\"post webpage\">\n          <!-- Handle `container-title` on `post` or `webpage` as `publisher` -->\n          <text macro=\"identifier-number-bib\"/>\n          <text macro=\"label-version-capitalized\"/>\n          <text macro=\"identifier-edition-bib\"/>\n          <text macro=\"identifier-contributors-bib\"/>\n          <text macro=\"identifier-volume-monographic-bib\"/>\n        </else-if>\n        <else-if variable=\"container-title\">\n          <choose>\n            <if match=\"any\" type=\"broadcast graphic map motion_picture\">\n              <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\n              <text macro=\"identifier-number-bib\"/>\n            </if>\n          </choose>\n          <text macro=\"identifier-contributors-bib\"/>\n        </else-if>\n        <else>\n          <choose>\n            <if match=\"none\" type=\"song\">\n              <text macro=\"identifier-number-bib\"/>\n            </if>\n          </choose>\n          <text macro=\"label-version-capitalized\"/>\n          <text macro=\"identifier-edition-bib\"/>\n          <choose>\n            <if match=\"any\" variable=\"part-title volume-title\">\n              <text macro=\"identifier-contributors-bib\"/>\n            </if>\n            <else-if match=\"any\" variable=\"number-of-volumes part-number volume\">\n              <!-- `collection-editor` belongs with `collection-title` if item is not multivolume -->\n              <choose>\n                <if variable=\"collection-editor\">\n                  <names variable=\"collection-editor\">\n                    <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                    <name and=\"text\"/>\n                  </names>\n                </if>\n                <else>\n                  <text macro=\"identifier-contributors-bib\"/>\n                </else>\n              </choose>\n            </else-if>\n            <else>\n              <text macro=\"identifier-contributors-bib\"/>\n            </else>\n          </choose>\n          <text macro=\"identifier-volume-monographic-bib\"/>\n          <choose>\n            <!-- `collection-editor` supplied in `identifier-volume-monographic-bib` if there is a `part-title` or `volume-title` -->\n            <if match=\"any\" variable=\"part-title volume-title\"/>\n            <else-if match=\"any\" variable=\"number-of-volumes part-number volume\">\n              <choose>\n                <if variable=\"collection-editor\">\n                  <text macro=\"identifier-contributors-bib\"/>\n                </if>\n              </choose>\n            </else-if>\n          </choose>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <!-- Identifier elements -->\n  <macro name=\"identifier-contributors-bib\">\n    <choose>\n      <if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <text macro=\"identifier-contributors-serial-bib\"/>\n      </if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"any\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- monographic usage -->\n            <text macro=\"identifier-contributors-monographic-bib\"/>\n          </if>\n          <else>\n            <!-- serial usage -->\n            <text macro=\"identifier-contributors-serial-bib\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <text macro=\"identifier-contributors-monographic-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"identifier-contributors-monographic-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <if match=\"any\" type=\"post webpage\">\n          <group delimiter=\". \">\n            <names variable=\"container-author\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"editor-translator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names delimiter=\". \" variable=\"editor translator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"editorial-director\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"guest\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"host\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"illustrator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"narrator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names delimiter=\". \" variable=\"compiler chair organizer curator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names delimiter=\". \" variable=\"series-creator executive-producer\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"producer\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"director\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <choose>\n              <if match=\"any\" type=\"broadcast performance\">\n                <names variable=\"script-writer\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n              </if>\n            </choose>\n            <names variable=\"performer\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <choose>\n              <if match=\"none\" type=\"thesis\">\n                <names variable=\"contributor\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n              </if>\n            </choose>\n          </group>\n        </if>\n        <else>\n          <!-- Handle `container-title` on `post` or `webpage` as `publisher` -->\n          <group delimiter=\". \">\n            <choose>\n              <if match=\"none\" variable=\"container-title\">\n                <names variable=\"container-author\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names variable=\"editor-translator\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names delimiter=\". \" variable=\"editor translator\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names variable=\"editorial-director\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names variable=\"guest\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names variable=\"host\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n              </if>\n            </choose>\n            <names variable=\"illustrator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <names variable=\"narrator\">\n              <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n              <name and=\"text\"/>\n            </names>\n            <choose>\n              <if match=\"none\" variable=\"container-title\">\n                <names delimiter=\". \" variable=\"compiler chair organizer curator\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names delimiter=\". \" variable=\"series-creator executive-producer\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names variable=\"producer\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <names variable=\"director\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <choose>\n                  <if match=\"any\" type=\"broadcast performance\">\n                    <names variable=\"script-writer\">\n                      <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                      <name and=\"text\"/>\n                    </names>\n                  </if>\n                </choose>\n                <names variable=\"performer\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n                <choose>\n                  <if match=\"none\" type=\"song thesis\">\n                    <names variable=\"contributor\">\n                      <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                      <name and=\"text\"/>\n                    </names>\n                  </if>\n                </choose>\n              </if>\n            </choose>\n            <choose>\n              <if type=\"song\">\n                <!-- Song contributors attached to album (CMOS18 14.163) -->\n                <names variable=\"contributor\">\n                  <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n                  <name and=\"text\"/>\n                </names>\n              </if>\n            </choose>\n          </group>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"identifier-contributors-serial-bib\">\n    <group delimiter=\". \">\n      <names delimiter=\". \" variable=\"translator narrator\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n      <names delimiter=\", \" variable=\"compiler chair organizer curator\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n      <names delimiter=\", \" variable=\"series-creator executive-producer\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"producer\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"director\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"script-writer\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"performer\">\n        <label form=\"verb\" suffix=\" \" text-case=\"capitalize-first\"/>\n        <name and=\"text\"/>\n      </names>\n    </group>\n  </macro>\n  <macro name=\"identifier-edition-bib\">\n    <choose>\n      <if match=\"none\" variable=\"original-date\">\n        <text macro=\"label-edition-capitalized\"/>\n      </if>\n      <else-if variable=\"original-title\">\n        <text macro=\"label-edition-capitalized\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"identifier-number-bib\">\n    <group delimiter=\" \">\n      <choose>\n        <if is-numeric=\"number\" type=\"broadcast\" variable=\"genre\">\n          <text text-case=\"capitalize-first\" variable=\"genre\"/>\n          <text variable=\"number\"/>\n        </if>\n        <else-if is-numeric=\"number\" type=\"broadcast\">\n          <text text-case=\"capitalize-first\" value=\"episode\"/>\n          <text variable=\"number\"/>\n        </else-if>\n        <else-if variable=\"number\">\n          <text text-case=\"title\" variable=\"genre\"/>\n          <text macro=\"label-number-capitalized\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"identifier-patent\">\n    <group delimiter=\", \">\n      <group delimiter=\" \">\n        <!-- `authority`: US ; `genre`: patent ; `number`: 123,445 -->\n        <text form=\"short\" variable=\"authority\"/>\n        <!-- 'US Patent' capitalized in both bibliography and note forms -->\n        <choose>\n          <if variable=\"genre\">\n            <text text-case=\"capitalize-first\" variable=\"genre\"/>\n          </if>\n          <else>\n            <text term=\"patent\" text-case=\"capitalize-first\"/>\n          </else>\n        </choose>\n        <text variable=\"number\"/>\n      </group>\n      <group delimiter=\" \">\n        <text value=\"filed\"/>\n        <date form=\"text\" variable=\"submitted\"/>\n      </group>\n      <group delimiter=\" \">\n        <choose>\n          <if variable=\"issued submitted\">\n            <text term=\"and\"/>\n          </if>\n        </choose>\n        <text value=\"issued\"/>\n        <!-- Always give full issue date, even in author-date (CMOS18 14.158) -->\n        <text macro=\"date-issued-full\"/>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"identifier-report-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <if variable=\"container-title\">\n          <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->\n          <text macro=\"identifier-contributors-bib\"/>\n        </if>\n        <else-if variable=\"title\">\n          <text macro=\"identifier-number-bib\"/>\n          <text macro=\"label-version-capitalized\"/>\n          <text macro=\"identifier-edition-bib\"/>\n          <text macro=\"identifier-contributors-bib\"/>\n          <text macro=\"identifier-volume-monographic-bib\"/>\n        </else-if>\n        <else>\n          <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->\n          <text macro=\"label-version-capitalized\"/>\n          <text macro=\"identifier-edition-bib\"/>\n          <text macro=\"identifier-contributors-bib\"/>\n          <text macro=\"identifier-volume-monographic-bib\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"identifier-volume-bib\">\n    <!-- In notes styles, bibliography entries may be listed either under an individual volume title or its series, but the former approach is required for author-date, which is the form that this macro implements (CMOS18 14.21) -->\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"part-number part-title volume volume-title\">\n          <!-- part and title with individual titles -->\n          <group delimiter=\" \">\n            <text macro=\"label-part-number-capitalized\"/>\n            <text value=\"of\"/>\n            <text font-style=\"italic\" text-case=\"title\" variable=\"volume-title\"/>\n          </group>\n          <group delimiter=\" \">\n            <text macro=\"label-volume\"/>\n            <text value=\"of\"/>\n            <group delimiter=\", \">\n              <text macro=\"title-primary\"/>\n              <names variable=\"collection-editor\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\"/>\n              </names>\n            </group>\n          </group>\n        </if>\n        <else-if match=\"any\" variable=\"part-title volume-title\">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"part-number volume\">\n                <group delimiter=\", \">\n                  <text macro=\"label-volume-capitalized\"/>\n                  <text macro=\"label-part-number\"/>\n                  <text value=\"of\"/>\n                </group>\n              </if>\n              <else-if variable=\"part-number\">\n                <text macro=\"label-part-number-capitalized\"/>\n                <text value=\"of\"/>\n              </else-if>\n              <else-if variable=\"volume\">\n                <text macro=\"label-volume-capitalized\"/>\n                <text value=\"of\"/>\n              </else-if>\n            </choose>\n            <group delimiter=\", \">\n              <text macro=\"title-primary\"/>\n              <names variable=\"collection-editor\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\"/>\n              </names>\n            </group>\n          </group>\n        </else-if>\n        <else-if variable=\"part-number volume\">\n          <text macro=\"label-volume-capitalized\"/>\n          <text macro=\"label-part-number\"/>\n        </else-if>\n        <else-if variable=\"part-number\">\n          <text macro=\"label-part-number-capitalized\"/>\n        </else-if>\n        <else-if variable=\"volume\">\n          <text macro=\"label-volume-capitalized\"/>\n        </else-if>\n        <else>\n          <text macro=\"label-number-of-volumes\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"identifier-volume-monographic-bib\">\n    <choose>\n      <if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\"/>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"any\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- monographic usage -->\n            <text macro=\"identifier-volume-bib\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else>\n        <text macro=\"identifier-volume-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 4. Source -->\n  <macro name=\"source-bib\">\n    <choose>\n      <if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <!-- serial usage -->\n        <text macro=\"source-serial-bib\"/>\n      </if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"any\" variable=\"collection-editor container-author editor editorial-director\">\n            <!-- monographic usage -->\n            <text macro=\"source-monographic-bib\"/>\n          </if>\n          <else>\n            <!-- serial usage -->\n            <text macro=\"source-serial-bib\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"patent post webpage\"/>\n      <else>\n        <text macro=\"source-monographic-bib\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 4.1. Serial sources -->\n  <macro name=\"source-serial-bib\">\n    <group delimiter=\". \">\n      <text macro=\"source-serial-title-volume-bib\"/>\n      <choose>\n        <if type=\"article-newspaper\">\n          <group delimiter=\", \">\n            <text macro=\"source-serial-title-bib\"/>\n            <text macro=\"source-serial-identifier-bib\"/>\n          </group>\n        </if>\n        <else-if variable=\"collection-title volume\">\n          <group delimiter=\", \">\n            <text macro=\"source-serial-title-bib\"/>\n            <text macro=\"source-serial-identifier-bib\"/>\n          </group>\n        </else-if>\n        <else-if variable=\"volume\">\n          <group delimiter=\" \">\n            <text macro=\"source-serial-title-bib\"/>\n            <text macro=\"source-serial-identifier-bib\"/>\n          </group>\n        </else-if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"source-serial-title-bib\"/>\n            <text macro=\"source-serial-identifier-bib\"/>\n          </group>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <!-- Serial source title -->\n  <macro name=\"source-serial-name\">\n    <group delimiter=\" \">\n      <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      <choose>\n        <!-- TODO: remove conditional when Zotero stops double-mapping `event-place` and `publisher-place` -->\n        <if match=\"none\" variable=\"event-date event-title\">\n          <text prefix=\"(\" suffix=\")\" variable=\"publisher-place\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-serial-title-bib\">\n    <group delimiter=\", \">\n      <choose>\n        <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\n        <if match=\"none\" variable=\"container-title\"/>\n        <else-if match=\"none\" type=\"periodical\" variable=\"supplement-number volume-title\"/>\n        <!-- TODO: use `container-genre` here once available to allow a custom description of the journal volume -->\n        <else-if variable=\"supplement-number volume-title\">\n          <text term=\"supplement\" text-case=\"capitalize-first\"/>\n        </else-if>\n        <else-if type=\"periodical\" variable=\"supplement-number title\">\n          <text term=\"supplement\" text-case=\"capitalize-first\"/>\n        </else-if>\n        <else-if variable=\"volume-title\">\n          <text term=\"special-issue\" text-case=\"capitalize-first\"/>\n        </else-if>\n        <else-if type=\"periodical\" variable=\"title\">\n          <text term=\"special-issue\" text-case=\"capitalize-first\"/>\n        </else-if>\n      </choose>\n      <text macro=\"source-serial-name\"/>\n      <choose>\n        <!-- 'ahead of print' is placed akin to a series (CMOS18 14.75) -->\n        <if match=\"any\" variable=\"available-date collection-title issue number page status supplement-number volume\"/>\n        <else-if type=\"article-journal\" variable=\"DOI issued\">\n          <text term=\"advance-online-publication\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-serial-title-volume-bib\">\n    <choose>\n      <if variable=\"volume-title\">\n        <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <text macro=\"source-monographic-preposition-bib\"/>\n            <text quotes=\"true\" text-case=\"title\" variable=\"volume-title\"/>\n          </group>\n          <text macro=\"source-monographic-identifier-contributors-bib\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <!-- Serial source identifier -->\n  <macro name=\"source-serial-identifier-bib\">\n    <choose>\n      <if match=\"any\" variable=\"issue supplement-number volume\">\n        <group delimiter=\": \">\n          <text macro=\"source-serial-identifier-volume-author-date\"/>\n          <text macro=\"source-serial-locator\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\", \">\n          <group delimiter=\". \">\n            <text macro=\"source-serial-identifier-volume-author-date\"/>\n            <!-- periodical edition always capitalized (CMOS18 14.89) -->\n            <text macro=\"label-edition-capitalized\"/>\n          </group>\n          <text macro=\"source-serial-locator\"/>\n        </group>\n      </else>\n      <!-- TODO: If CSL adds `date-part` detection, add two further conditions to address CMOS18 14.74: delimiting with \":\" if there is a `volume` and no month or `issue` or `supplement number`; delimiting with \", \" or there is an `issue` or `supplement number` and no month -->\n    </choose>\n  </macro>\n  <macro name=\"source-serial-identifier-volume-author-date\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"article-newspaper\">\n          <!-- newspapers provide the full date in place of volume/issue numbers (CMOS18 14.89) -->\n          <text variable=\"collection-title\"/>\n          <text macro=\"source-serial-volume-status-bib\"/>\n        </if>\n        <else-if match=\"any\" variable=\"issue supplement-number volume\">\n          <choose>\n            <if match=\"any\" type=\"article-magazine review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n              <!-- date appears first if the magazine or review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->\n              <choose>\n                <if match=\"none\" variable=\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n                  <choose>\n                    <!-- no extra date details with a volume plus issue/supplement -->\n                    <if variable=\"issue volume\"/>\n                    <else-if variable=\"supplement-number\"/>\n                    <!-- nothing to substitute if there is no issue/supplement/volume -->\n                    <else-if match=\"none\" variable=\"issue volume\"/>\n                    <else>\n                      <text macro=\"source-date-bib\"/>\n                      <!-- for CMOS17 author-date: -->\n                      <!-- <text macro=\"source-date-issued-month-day\"/> -->\n                    </else>\n                  </choose>\n                </if>\n              </choose>\n            </if>\n          </choose>\n          <!-- `collection-title` is for any serial with multiple series (e.g. '4th ser.') -->\n          <text variable=\"collection-title\"/>\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"volume\">\n                <choose>\n                  <if variable=\"collection-title\">\n                    <text macro=\"label-volume\"/>\n                  </if>\n                  <else-if match=\"any\" type=\"article-magazine review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n                    <!-- provide label if a magazine or review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->\n                    <choose>\n                      <if match=\"any\" variable=\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n                        <text variable=\"volume\"/>\n                      </if>\n                      <!-- TODO: when CSL provides date part detection, volume should be lowercase if there is a month, but otherwise capitalized -->\n                      <else>\n                        <text macro=\"label-volume-capitalized\"/>\n                      </else>\n                    </choose>\n                  </else-if>\n                  <else>\n                    <text variable=\"volume\"/>\n                  </else>\n                </choose>\n                <group delimiter=\", \" prefix=\"(\" suffix=\")\">\n                  <choose>\n                    <if match=\"any\" variable=\"issue supplement-number\">\n                      <text variable=\"issue\"/>\n                      <text macro=\"label-supplement-number\"/>\n                    </if>\n                    <else-if match=\"any\" type=\"article-magazine review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\">\n                      <!-- date for anonymous magazine and review articles only appears here if it did not earlier (CMOS18 14.87, 14.102) -->\n                      <choose>\n                        <if match=\"any\" variable=\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n                          <text macro=\"source-date-bib\"/>\n                          <!-- for CMOS17 author-date: -->\n                          <!-- <text macro=\"source-date-issued-month-day\"/> -->\n                        </if>\n                      </choose>\n                    </else-if>\n                    <else>\n                      <text macro=\"source-date-bib\"/>\n                      <!-- for CMOS17 author-date: -->\n                      <!-- <text macro=\"source-date-issued-month-day\"/> -->\n                    </else>\n                  </choose>\n                </group>\n              </if>\n              <else-if match=\"any\" variable=\"issue supplement-number\">\n                <group delimiter=\" \">\n                  <group delimiter=\", \">\n                    <text macro=\"label-issue\"/>\n                    <text macro=\"label-supplement-number\"/>\n                  </group>\n                  <choose>\n                    <if match=\"any\" variable=\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n                      <text macro=\"source-date-bib\" prefix=\"(\" suffix=\")\"/>\n                      <!-- for CMOS17 author-date: -->\n                      <!-- <text macro=\"source-date-issued-month-day\" prefix=\"(\" suffix=\")\"/> -->\n                    </if>\n                  </choose>\n                </group>\n              </else-if>\n            </choose>\n          </group>\n        </else-if>\n        <else>\n          <text variable=\"collection-title\"/>\n          <choose>\n            <if match=\"any\" type=\"interview\" variable=\"interviewer\">\n              <!-- publisher possible with `interview` (cf. CMOS18 14.110) -->\n              <text variable=\"publisher\"/>\n            </if>\n          </choose>\n          <text macro=\"source-serial-volume-status-bib\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-serial-volume-status-bib\">\n    <group delimiter=\", \">\n      <choose>\n        <if match=\"none\" variable=\"collection-title issue number page supplement-number volume\">\n          <group delimiter=\" \">\n            <!-- article accepted for publication and available on publisher website (CMOS18 14.75) -->\n            <!-- TODO: use CSL term for `available-date` when available -->\n            <text value=\"accepted\"/>\n            <date form=\"text\" variable=\"available-date\"/>\n          </group>\n        </if>\n      </choose>\n      <group delimiter=\" \">\n        <text macro=\"source-date-status-bib\"/>\n        <text macro=\"source-date-bib\"/>\n        <!-- for CMOS17 author-date: -->\n        <!-- <text macro=\"source-date-issued-full-serial\"/> -->\n      </group>\n    </group>\n  </macro>\n  <!-- Serial source locator -->\n  <macro name=\"source-serial-locator\">\n    <choose>\n      <if match=\"any\" variable=\"locator number\">\n        <group delimiter=\", \">\n          <text macro=\"label-locator\"/>\n          <!-- an article ID appears alongside locators in notes (CMOS18 14.71) -->\n          <text variable=\"number\"/>\n        </group>\n      </if>\n      <!-- do not give pages for newspapers (CMOS18 14.89) -->\n      <else-if type=\"article-newspaper\"/>\n      <else>\n        <text variable=\"page\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 4.2. Monographic sources -->\n  <macro name=\"source-monographic-bib\">\n    <group delimiter=\". \">\n      <!-- Monographic sources repeat main reference elements -->\n      <choose>\n        <if variable=\"container-title\">\n          <group delimiter=\", \">\n            <group delimiter=\" \">\n              <choose>\n                <if match=\"none\" type=\"broadcast motion_picture\">\n                  <text macro=\"source-monographic-preposition-bib\"/>\n                </if>\n              </choose>\n              <text macro=\"source-monographic-title-bib\"/>\n            </group>\n            <text macro=\"source-monographic-description-bib\"/>\n            <text macro=\"source-monographic-identifier-bib\"/>\n            <text macro=\"source-monographic-locator\"/>\n          </group>\n        </if>\n      </choose>\n      <text macro=\"source-series-bib\"/>\n      <choose>\n        <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->\n        <if match=\"any\" variable=\"event-date original-date original-publisher original-publisher-place publisher status\">\n          <text macro=\"source-event-bib\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <!-- Monographic source title -->\n  <macro name=\"source-monographic-preposition-bib\">\n    <choose>\n      <if type=\"chapter\" variable=\"container-title genre\">\n        <text value=\"to\"/>\n      </if>\n      <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n        <choose>\n          <if match=\"any\" variable=\"author composer\">\n            <!-- Give preposition only for signed entries; otherwise, title is substituted -->\n            <text term=\"in\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </else-if>\n      <!-- if printing chapter page numbers (CMOS17/classic):\n      <else-if variable=\"chapter-number page title\"><text term=\"in\" text-case=\"capitalize-first\"/></else-if>\n      -->\n      <else-if variable=\"chapter-number\">\n        <group delimiter=\" \">\n          <text macro=\"label-chapter-number-capitalized\"/>\n          <choose>\n            <if type=\"song\">\n              <text term=\"on\"/>\n            </if>\n            <else>\n              <text term=\"in\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n      <else>\n        <text term=\"in\" text-case=\"capitalize-first\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-monographic-title-bib\">\n    <choose>\n      <if variable=\"part-title\">\n        <text macro=\"title-part\"/>\n      </if>\n      <else-if variable=\"volume-title\">\n        <text font-style=\"italic\" text-case=\"title\" variable=\"volume-title\"/>\n      </else-if>\n      <else>\n        <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Monographic source description -->\n  <macro name=\"source-monographic-description-bib\">\n    <choose>\n      <if match=\"any\" type=\"event paper-conference performance speech\">\n        <!-- Conference presentations should describe the session unless published in a proceedings -->\n        <choose>\n          <if match=\"none\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- serial usage -->\n            <text macro=\"description-format-bib\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"software\">\n        <!-- For entries in mobile app reference works, place description after `container-title` -->\n        <text macro=\"description-format-bib\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"document report standard\">\n        <!-- For chapters in report, standards, and generic documents, place description after `container-title` -->\n        <text macro=\"description-format-bib\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!-- Monographic source identifier -->\n  <macro name=\"source-monographic-identifier-bib\">\n    <!-- Based on `identifier-bib` -->\n    <choose>\n      <if variable=\"container-title\">\n        <group delimiter=\", \">\n          <choose>\n            <if match=\"none\" type=\"broadcast graphic map motion_picture song\">\n              <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\n              <text macro=\"identifier-number-bib\"/>\n            </if>\n          </choose>\n          <text macro=\"label-version\"/>\n          <text macro=\"label-edition\"/>\n          <choose>\n            <if match=\"any\" variable=\"part-title volume-title\">\n              <text macro=\"source-monographic-identifier-contributors-bib\"/>\n            </if>\n            <else-if match=\"any\" variable=\"number-of-volumes part-number volume\">\n              <!-- `collection-editor` belongs with `collection-title` if item is not multivolume -->\n              <choose>\n                <if variable=\"collection-editor\">\n                  <names variable=\"collection-editor\">\n                    <label form=\"verb\" suffix=\" \"/>\n                    <name and=\"text\"/>\n                  </names>\n                </if>\n                <else>\n                  <text macro=\"source-monographic-identifier-contributors-bib\"/>\n                </else>\n              </choose>\n            </else-if>\n            <else>\n              <text macro=\"source-monographic-identifier-contributors-bib\"/>\n            </else>\n          </choose>\n          <text macro=\"source-monographic-identifier-volume-bib\"/>\n          <choose>\n            <!-- `collection-editor` supplied in `source-monographic-identifier-volume-bib` if there is a `part-title` or `volume-title` -->\n            <if match=\"any\" variable=\"part-title volume-title\"/>\n            <else-if match=\"any\" variable=\"number-of-volumes part-number volume\">\n              <choose>\n                <if variable=\"collection-editor\">\n                  <text macro=\"source-monographic-identifier-contributors-bib\"/>\n                </if>\n              </choose>\n            </else-if>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"source-monographic-identifier-contributors-bib\">\n    <group delimiter=\", \">\n      <names variable=\"container-author\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"editor-translator\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names delimiter=\", \" variable=\"editor translator\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"guest\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"host\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names delimiter=\", \" variable=\"chair organizer\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names delimiter=\", \" variable=\"illustrator narrator compiler curator\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names delimiter=\", \" variable=\"series-creator executive-producer\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"producer\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"editorial-director\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <choose>\n        <if match=\"any\" type=\"broadcast performance\">\n          <names variable=\"script-writer\">\n            <label form=\"verb\" suffix=\" \"/>\n            <name and=\"text\"/>\n          </names>\n        </if>\n      </choose>\n      <names variable=\"director\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <names variable=\"performer\">\n        <label form=\"verb\" suffix=\" \"/>\n        <name and=\"text\"/>\n      </names>\n      <choose>\n        <if match=\"none\" type=\"song thesis\">\n          <!-- Song contributors attached to album (CMOS18 14.163) -->\n          <names variable=\"contributor\">\n            <label form=\"verb\" suffix=\" \"/>\n            <name and=\"text\"/>\n          </names>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-monographic-identifier-volume-bib\">\n    <!-- Mostly identical to `identifier-volume-bib` but without capitalization; giving `container-title` rather than `title-primary`; and ensuring volume number -->\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"part-number part-title volume volume-title\">\n          <!-- part and title with individual titles -->\n          <group delimiter=\" \">\n            <text macro=\"label-part-number\"/>\n            <text value=\"of\"/>\n            <text font-style=\"italic\" text-case=\"title\" variable=\"volume-title\"/>\n          </group>\n          <group delimiter=\" \">\n            <text macro=\"label-volume\"/>\n            <text value=\"of\"/>\n            <group delimiter=\", \">\n              <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n              <names variable=\"collection-editor\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\"/>\n              </names>\n            </group>\n          </group>\n        </if>\n        <else-if match=\"any\" variable=\"part-title volume-title\">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"part-number volume\">\n                <group delimiter=\", \">\n                  <text macro=\"label-volume\"/>\n                  <text macro=\"label-part-number\"/>\n                  <text value=\"of\"/>\n                </group>\n              </if>\n              <else-if variable=\"part-number\">\n                <text macro=\"label-part-number\"/>\n                <text value=\"of\"/>\n              </else-if>\n              <else-if variable=\"volume\">\n                <text macro=\"label-volume\"/>\n                <text value=\"of\"/>\n              </else-if>\n            </choose>\n            <group delimiter=\", \">\n              <text font-style=\"italic\" text-case=\"title\" variable=\"container-title\"/>\n              <names variable=\"collection-editor\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\"/>\n              </names>\n            </group>\n          </group>\n        </else-if>\n        <else-if match=\"any\" variable=\"part-number volume\">\n          <choose>\n            <if is-numeric=\"volume\" match=\"none\">\n              <text macro=\"label-volume\"/>\n            </if>\n            <else-if variable=\"container-title\">\n              <!-- remove condition in styles that print chapter page numbers (CMOS17/classic) -->\n              <text macro=\"label-volume\"/>\n            </else-if>\n            <else-if is-numeric=\"volume\" variable=\"page\">\n              <choose>\n                <!-- check for variables that might come between the volume and page number -->\n                <if match=\"any\" variable=\"collection-editor part-number part-title volume-title\">\n                  <text macro=\"label-volume\"/>\n                </if>\n              </choose>\n            </else-if>\n            <else>\n              <text macro=\"label-volume\"/>\n            </else>\n          </choose>\n          <text macro=\"label-part-number\"/>\n        </else-if>\n        <else>\n          <text macro=\"label-number-of-volumes\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <!-- Monographic source locator -->\n  <macro name=\"source-monographic-locator\">\n    <choose>\n      <if is-numeric=\"volume\" locator=\"page\">\n        <group delimiter=\":\">\n          <choose>\n            <if match=\"none\" variable=\"collection-editor part-number part-title volume-title\">\n              <text variable=\"volume\"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </if>\n      <else-if variable=\"locator\">\n        <text macro=\"label-locator\"/>\n      </else-if>\n      <!-- remove `container-title` condition in styles that print chapter page numbers (CMOS17/classic) -->\n      <else-if variable=\"container-title\"/>\n      <else-if is-numeric=\"volume\" variable=\"page\">\n        <!-- collapse the volume and page number if adjacent -->\n        <group delimiter=\":\">\n          <choose>\n            <!-- check for variables that might come between the volume and page number -->\n            <if match=\"none\" variable=\"collection-editor part-number part-title volume-title\">\n              <text variable=\"volume\"/>\n            </if>\n          </choose>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else>\n        <text variable=\"page\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 4.3. Series -->\n  <macro name=\"source-series-bib\">\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"collection-editor collection-title\">\n          <choose>\n            <if match=\"any\" variable=\"number-of-volumes part-number part-title volume volume-title\">\n              <text macro=\"source-series-title\"/>\n            </if>\n            <else>\n              <text text-case=\"title\" variable=\"collection-title\"/>\n              <names variable=\"collection-editor\">\n                <label form=\"verb\" suffix=\" \"/>\n                <name and=\"text\"/>\n              </names>\n              <text macro=\"label-collection-number\"/>\n              <text macro=\"label-issue\"/>\n            </else>\n          </choose>\n        </if>\n        <else>\n          <text macro=\"source-series-title\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-series-title\">\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"issue\">\n          <text text-case=\"title\" variable=\"collection-title\"/>\n          <text macro=\"label-collection-number\"/>\n          <text macro=\"label-issue\"/>\n        </if>\n        <else-if is-numeric=\"collection-number\" variable=\"collection-title\">\n          <group delimiter=\" \">\n            <text text-case=\"title\" variable=\"collection-title\"/>\n            <text variable=\"collection-number\"/>\n          </group>\n        </else-if>\n        <else-if variable=\"collection-title\">\n          <text text-case=\"title\" variable=\"collection-title\"/>\n          <text variable=\"collection-number\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <!-- 4.4. Event -->\n  <macro name=\"source-event-bib\">\n    <group delimiter=\" \">\n      <choose>\n        <!-- omit types that provide event information in description  -->\n        <if match=\"any\" type=\"interview\" variable=\"interviewer\"/>\n        <else-if type=\"personal_communication\" variable=\"recipient\"/>\n        <else-if match=\"any\" type=\"review review-book\" variable=\"reviewed-author reviewed-genre reviewed-title\"/>\n        <else-if match=\"any\" variable=\"event event-date event-title\">\n          <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->\n          <choose>\n            <if type=\"paper-conference\">\n              <choose>\n                <if match=\"none\" variable=\"collection-editor compiler editor editorial-director issue page supplement-number volume\">\n                  <!-- Don't print event info for conference papers published in proceedings -->\n                  <text macro=\"source-event-status-bib\"/>\n                  <text macro=\"source-event-description-bib\"/>\n                </if>\n              </choose>\n            </if>\n            <else>\n              <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->\n              <text macro=\"source-event-status-bib\"/>\n              <text macro=\"source-event-description-bib\"/>\n            </else>\n          </choose>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-event-place-first\">\n    <!-- for descriptive elements for interviews, reviews, letters -->\n    <choose>\n      <if match=\"any\" variable=\"event event-date event-title\">\n        <group delimiter=\", \">\n          <text variable=\"event-title\"/>\n          <text variable=\"event-place\"/>\n          <text macro=\"date-event-full\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"source-event-status-bib\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"broadcast\" variable=\"status\">\n          <!-- 'aired', 'performed', etc. (CMOS18 14.165) -->\n          <text text-case=\"capitalize-first\" variable=\"status\"/>\n        </if>\n        <else-if type=\"paper-conference\">\n          <choose>\n            <if variable=\"genre\">\n              <text text-case=\"capitalize-first\" value=\"presented\"/>\n            </if>\n            <else>\n              <text form=\"short\" term=\"paper-conference\" text-case=\"capitalize-first\"/>\n              <text value=\"presented\"/>\n            </else>\n          </choose>\n          <choose>\n            <if variable=\"event-title\">\n              <text term=\"at\"/>\n            </if>\n          </choose>\n        </else-if>\n        <else-if type=\"song\">\n          <text text-case=\"capitalize-first\" value=\"recorded\"/>\n          <choose>\n            <if variable=\"event-title\">\n              <text term=\"at\"/>\n            </if>\n          </choose>\n        </else-if>\n        <else-if variable=\"event-date issued\"/>\n        <else-if match=\"none\" variable=\"issued\">\n          <text text-case=\"capitalize-first\" variable=\"status\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-event-title\">\n    <choose>\n      <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\n      <if variable=\"event-title\">\n        <text variable=\"event-title\"/>\n      </if>\n      <else>\n        <text variable=\"event\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-event-title-capitalized\">\n    <choose>\n      <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\n      <if variable=\"event-title\">\n        <text text-case=\"capitalize-first\" variable=\"event-title\"/>\n      </if>\n      <else>\n        <text text-case=\"capitalize-first\" variable=\"event\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-event-description-bib\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"song\">\n          <text macro=\"source-event-title\"/>\n        </if>\n        <else-if type=\"paper-conference\" variable=\"genre\">\n          <text macro=\"source-event-title-capitalized\"/>\n        </else-if>\n        <else-if type=\"paper-conference\">\n          <text macro=\"source-event-title\"/>\n        </else-if>\n        <else>\n          <text macro=\"source-event-title-capitalized\"/>\n        </else>\n      </choose>\n      <text macro=\"date-event-full\"/>\n      <text variable=\"event-place\"/>\n    </group>\n  </macro>\n  <!-- 4.5. Facts of publication -->\n  <macro name=\"source-monographic-publication-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <!-- Provide only for monographic types -->\n        <if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\"/>\n        <else-if match=\"any\" type=\"interview paper-conference\">\n          <choose>\n            <if match=\"any\" variable=\"collection-editor container-author editor editorial-director\">\n              <!-- monographic usage -->\n              <text macro=\"source-publication-and-date-bib\"/>\n            </if>\n          </choose>\n        </else-if>\n        <!-- `patent` date in identification (CMOS18 14.158) -->\n        <else-if type=\"patent\"/>\n        <else>\n          <text macro=\"source-publication-and-date-bib\"/>\n        </else>\n      </choose>\n      <text macro=\"source-publication-original-title-bib\"/>\n    </group>\n  </macro>\n  <macro name=\"source-publication-and-date-bib\">\n    <group delimiter=\", \">\n      <choose>\n        <if match=\"any\" type=\"post webpage\">\n          <!-- `container-title` functions like a publisher with social media and website sources (CMOS18 14.104-106) -->\n          <text text-case=\"title\" variable=\"container-title\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"broadcast\" variable=\"DOI\">\n          <!-- a podcast publisher appears before the date, whereas the network of an aired show appears after (CMOS18 14.165); unfortunately CSL stores both in `publisher` -->\n          <!-- TODO: `DOI` or `URL` detection is the only way to distinguish radio/TV from podcasts, but it is obviously imprecise; modify if CSL provides a `podcast` type -->\n          <text macro=\"source-publication-history-bib\"/>\n        </if>\n        <else-if type=\"broadcast\" variable=\"URL\">\n          <text macro=\"source-publication-history-bib\"/>\n        </else-if>\n        <else-if type=\"broadcast\"/>\n        <else>\n          <text macro=\"source-publication-history-bib\"/>\n        </else>\n      </choose>\n      <group delimiter=\" \">\n        <text macro=\"source-date-status-bib\"/>\n        <text macro=\"source-date-bib\"/>\n      </group>\n      <choose>\n        <if type=\"broadcast\" variable=\"URL\"/>\n        <else-if type=\"broadcast\">\n          <group delimiter=\" \">\n            <text term=\"on\"/>\n            <text macro=\"source-publication-history-bib\"/>\n          </group>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <!-- Facts of publication elements -->\n  <macro name=\"source-publication-description-bib\">\n    <choose>\n      <if type=\"article\" variable=\"genre\"/>\n      <else-if type=\"article\">\n        <!-- `preprint` term attached to repository name, but specific working paper descriptors appear in description (CMOS18 14.76, 14.116) -->\n        <text term=\"preprint\" text-case=\"capitalize-first\"/>\n      </else-if>\n      <else-if type=\"thesis\">\n        <!-- thesis type appears with university name (CMOS18 14.113) -->\n        <text macro=\"description-format-bib\"/>\n      </else-if>\n      <else-if match=\"any\" variable=\"original-publisher original-publisher-place\">\n        <choose>\n          <!-- `edition` provides an alternative label to `reprint` (CMOS18 14.16) -->\n          <if match=\"any\" variable=\"edition original-title\"/>\n          <else-if match=\"none\" type=\"book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis\"/>\n          <else-if variable=\"issued original-date\">\n            <text text-case=\"capitalize-first\" value=\"reprint\"/>\n          </else-if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"source-publication-history-bib\">\n    <choose>\n      <if variable=\"original-title\">\n        <!-- `original-title` is covered in `source-publication-original-title-bib` -->\n        <group delimiter=\", \">\n          <text macro=\"source-publication-description-bib\"/>\n          <text macro=\"source-publication-publisher-bib\"/>\n        </group>\n      </if>\n      <else-if match=\"any\" variable=\"edition original-publisher original-publisher-place\">\n        <group delimiter=\". \">\n          <!-- full stop to separate original date if `original-publisher` (CMOS18 14.16) -->\n          <group delimiter=\", \">\n            <text macro=\"source-publication-publisher-original-bib\"/>\n            <text macro=\"source-date-original\"/>\n          </group>\n          <group delimiter=\". \">\n            <choose>\n              <if variable=\"issued original-date\">\n                <text macro=\"label-edition-capitalized\"/>\n              </if>\n            </choose>\n            <group delimiter=\", \">\n              <text macro=\"source-publication-description-bib\"/>\n              <text macro=\"source-publication-publisher-bib\"/>\n            </group>\n          </group>\n        </group>\n      </else-if>\n      <else>\n        <group delimiter=\"; \">\n          <!-- semicolon to separate original date if no publisher (CMOS18 14.165) -->\n          <text macro=\"source-date-original\"/>\n          <group delimiter=\", \">\n            <text macro=\"source-publication-description-bib\"/>\n            <text macro=\"source-publication-publisher-bib\"/>\n          </group>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-publication-original-title-bib\">\n    <!-- Work originally published under a different title (CMOS18 13.101) -->\n    <choose>\n      <if variable=\"original-title\">\n        <group delimiter=\" \">\n          <text term=\"original-work-published\" text-case=\"capitalize-first\"/>\n          <group delimiter=\", \">\n            <names variable=\"original-author\"/>\n            <text font-style=\"italic\" text-case=\"title\" variable=\"original-title\"/>\n          </group>\n          <group delimiter=\", \" prefix=\"(\" suffix=\")\">\n            <text macro=\"source-publication-publisher-original-bib\"/>\n            <text macro=\"source-date-original\"/>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"source-publication-publisher-bib\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"thesis\" variable=\"publisher\">\n          <text text-case=\"capitalize-first\" variable=\"publisher\"/>\n        </if>\n        <else-if variable=\"publisher\">\n          <group delimiter=\": \">\n            <!-- <text text-case=\"capitalize-first\" variable=\"publisher-place\"/> -->\n            <text text-case=\"capitalize-first\" variable=\"publisher\"/>\n          </group>\n        </else-if>\n        <!-- TODO: remove conditional when Zotero fixes double-mapping of `event-place` -->\n        <else-if match=\"any\" variable=\"event-date event-title\"/>\n        <else>\n          <text text-case=\"capitalize-first\" variable=\"publisher-place\"/>\n        </else>\n      </choose>\n      <choose>\n        <if type=\"song\">\n          <!-- Album catalogue number follows label name (CMOS18 14.163-164) -->\n          <text variable=\"number\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"source-publication-publisher-original-bib\">\n    <choose>\n      <if variable=\"original-publisher\">\n        <group delimiter=\": \">\n          <!-- <text text-case=\"capitalize-first\" variable=\"original-publisher-place\"/> -->\n          <text text-case=\"capitalize-first\" variable=\"original-publisher\"/>\n        </group>\n      </if>\n      <else>\n        <text text-case=\"capitalize-first\" variable=\"original-publisher-place\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 4.6. Date -->\n  <macro name=\"source-date-bib\">\n    <!-- the date represents the last-mentioned title (CMOS18 14.21) -->\n    <!-- there is no `source-date-note` as the date of a multivolume work is not used in note form -->\n    <choose>\n      <if variable=\"available-date volume-title\">\n        <!-- TODO: Is there a better CSL variable for a date of a multivolume work (CMOS18 14.21)? -->\n        <date date-parts=\"year\" form=\"text\" variable=\"available-date\"/>\n      </if>\n      <else-if variable=\"available-date part-title\">\n        <date date-parts=\"year\" form=\"text\" variable=\"available-date\"/>\n      </else-if>\n      <else>\n        <text macro=\"source-date-issued-month-day\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Date elements -->\n  <macro name=\"source-date-issued-month-day\">\n    <!-- Variant for author-date styles -->\n    <!-- Give full date for more ephemeral types -->\n    <!-- NB: any changes must also be applied to `source-date-original-month-day` -->\n    <choose>\n      <if type=\"personal_communication\" variable=\"event-date issued\">\n        <!-- Provide issue date for letters listed under event-date -->\n        <text macro=\"date-issued-year\"/>\n      </if>\n      <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <text macro=\"source-date-issued-month-day-serial\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"none\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- serial usage -->\n            <text macro=\"source-date-issued-month-day-serial\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n        <choose>\n          <if match=\"any\" variable=\"DOI URL\">\n            <!-- Online reference works use full dates (CMOS18 14.131) -->\n            <text macro=\"date-issued-month-day\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"article broadcast collection dataset document event graphic interview manuscript map patent performance personal_communication post software song speech standard webpage\">\n        <text macro=\"date-issued-month-day\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"source-date-issued-month-day-serial\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <!-- newspapers provide the full date in place of volume/issue numbers (CMOS18 14.89) -->\n        <text macro=\"date-issued-month-day\"/>\n      </if>\n      <else-if match=\"any\" variable=\"issue supplement-number volume\">\n        <text macro=\"date-issued-month\"/>\n      </else-if>\n      <else>\n        <text macro=\"date-issued-month-day\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-date-original\">\n    <text macro=\"source-date-original-month-day\"/>\n  </macro>\n  <macro name=\"source-date-original-month-day\">\n    <!-- Give full date for more ephemeral types -->\n    <!-- Macro derived from `source-date-issued-month-day` -->\n    <choose>\n      <if type=\"personal_communication\" variable=\"event-date original-date\">\n        <!-- Provide original date for letters listed under event-date -->\n        <text macro=\"date-original-year\"/>\n      </if>\n      <else-if match=\"any\" type=\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\">\n        <choose>\n          <if match=\"any\" variable=\"issue supplement-number volume\">\n            <text macro=\"date-original-month\"/>\n          </if>\n          <else>\n            <text macro=\"date-original-month-day\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"interview paper-conference\">\n        <choose>\n          <if match=\"none\" variable=\"collection-editor compiler editor editorial-director\">\n            <!-- serial usage -->\n            <choose>\n              <if match=\"any\" variable=\"issue supplement-number volume\">\n                <text macro=\"date-original-month\"/>\n              </if>\n              <else>\n                <text macro=\"date-original-month-day\"/>\n              </else>\n            </choose>\n          </if>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n        <choose>\n          <if match=\"any\" variable=\"DOI URL\">\n            <!-- Online reference works use full dates (CMOS18 14.131) -->\n            <text macro=\"date-original-month-day\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if match=\"any\" type=\"article broadcast collection dataset document event graphic interview manuscript map patent performance personal_communication post software song speech standard webpage\">\n        <text macro=\"date-original-month-day\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"source-date-status-bib\">\n    <choose>\n      <if type=\"broadcast\" variable=\"event-title issued status\"/>\n      <!-- on a `broadcast`, if there is an `event-title`, `status` appears with `event-date` as part of `source-event` (CMOS18 14.165) -->\n      <else-if variable=\"issued status\">\n        <!-- `status` specifies date type, e.g. 'effective', 'last modified', 'approved' (CMOS18 14.104 for `webpage`; CMOS18 14.159 for `standard`) -->\n        <choose>\n          <if match=\"any\" variable=\"original-date original-publisher original-publisher-place original-title publisher\">\n            <text variable=\"status\"/>\n          </if>\n          <else>\n            <text text-case=\"capitalize-first\" variable=\"status\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if type=\"broadcast\" variable=\"issued URL\"/>\n      <else-if type=\"broadcast\" variable=\"issued\">\n        <!-- `status` of a radio or TV broadcast is 'aired' if unspecified (CMOS18 14.165) -->\n        <text text-case=\"capitalize-first\" value=\"aired\"/>\n      </else-if>\n      <else-if type=\"software\" variable=\"issued publisher\">\n        <!-- `status` of software is 'released' if unspecified (CMOS18 14.169) -->\n        <choose>\n          <if match=\"any\" variable=\"author chair collection-editor compiler composer contributor curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\">\n            <!-- lowercase if `publisher` is adjacent -->\n            <text value=\"released\"/>\n          </if>\n          <else>\n            <text text-case=\"capitalize-first\" value=\"released\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if type=\"software\" variable=\"original-date\">\n        <!-- lowercase if `original-date` is adjacent -->\n        <text value=\"released\"/>\n      </else-if>\n      <else-if type=\"software\" variable=\"issued\">\n        <!-- capitalize if `publisher` is not present -->\n        <text text-case=\"capitalize-first\" value=\"released\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!-- 4.7. Locator (including page references) -->\n  <macro name=\"source-locator-author-date\">\n    <choose>\n      <if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n        <choose>\n          <if match=\"any\" variable=\"author locator\">\n            <text macro=\"label-locator\"/>\n          </if>\n          <else-if variable=\"container-title title\">\n            <!-- unsigned reference entry title appears in the locator (CMOS18 13.130) -->\n            <group delimiter=\" \">\n              <choose>\n                <if match=\"none\" variable=\"DOI URL\">\n                  <!-- Only print reference entries use `sub-verbo` (CMOS18 14.131) -->\n                  <text form=\"short\" term=\"sub-verbo\"/>\n                </if>\n              </choose>\n              <text form=\"short\" quotes=\"true\" variable=\"title\"/>\n            </group>\n          </else-if>\n        </choose>\n      </if>\n      <else>\n        <text macro=\"label-locator\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- 4.8. Medium -->\n  <macro name=\"source-medium-bib\">\n    <group delimiter=\", \">\n      <text text-case=\"capitalize-first\" variable=\"medium\"/>\n      <text variable=\"scale\"/>\n      <text variable=\"dimensions\"/>\n    </group>\n  </macro>\n  <!-- 4.9. Archival location -->\n  <macro name=\"source-archive-bib\">\n    <choose>\n      <!-- With `archive_collection` or `archive-place`: physical archives -->\n      <if type=\"graphic\">\n        <text macro=\"source-archive-name-first\"/>\n      </if>\n      <else-if match=\"any\" type=\"collection document manuscript personal_communication\" variable=\"archive_collection archive-place\">\n        <text macro=\"source-archive-location-first-bib\"/>\n      </else-if>\n      <!-- Without `archive_collection` or `archive-place`: digital archives (database and identifier) -->\n      <else>\n        <text macro=\"source-archive-identifier\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-archive-note\">\n    <choose>\n      <!-- With `archive_collection` or `archive-place`: physical archives -->\n      <if type=\"graphic\">\n        <text macro=\"source-archive-name-first\"/>\n      </if>\n      <else-if match=\"any\" type=\"collection document manuscript personal_communication\" variable=\"archive_collection archive-place\">\n        <text macro=\"source-archive-location-first-note\"/>\n      </else-if>\n      <!-- Without `archive_collection` or `archive-place`: digital archives (database and identifier) -->\n      <else>\n        <text macro=\"source-archive-identifier\"/>\n      </else>\n    </choose>\n  </macro>\n  <!-- Archival elements -->\n  <macro name=\"source-archive-identifier\">\n    <choose>\n      <if variable=\"archive archive_location\">\n        <!-- database identifier: the only example is `thesis`, but presumably this is for all types (CMOS18 14.113) -->\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text prefix=\"(\" suffix=\")\" variable=\"archive_location\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\", \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"source-archive-location-first-bib\">\n    <!-- Order of elements begins with the most specific (CMOS18 14.119, 14.127) -->\n    <!-- In note styles, the bibliography generally provide entries for a `collection` rather than individual items (CMOS18 14.120, 14.128) -->\n    <group delimiter=\". \">\n      <group delimiter=\", \">\n        <text text-case=\"capitalize-first\" variable=\"archive_location\"/>\n        <text variable=\"archive_collection\"/>\n      </group>\n      <group delimiter=\", \">\n        <text variable=\"archive\"/>\n        <text variable=\"archive-place\"/>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"source-archive-location-first-note\">\n    <!-- Order of elements begins with the most specific (CMOS18 14.119, 14.127) -->\n    <!-- In note styles, the bibliography generally provide entries for a `collection` rather than individual items (CMOS18 14.120, 14.128) -->\n    <group delimiter=\", \">\n      <group delimiter=\", \">\n        <text variable=\"archive_location\"/>\n        <text variable=\"archive_collection\"/>\n      </group>\n      <group delimiter=\", \">\n        <text variable=\"archive\"/>\n        <text variable=\"archive-place\"/>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"source-archive-name-first\">\n    <!-- Archive (gallery) name first for art (CMOS18 14.133) -->\n    <group delimiter=\", \">\n      <text variable=\"archive\"/>\n      <text variable=\"archive-place\"/>\n      <text variable=\"archive_collection\"/>\n      <text variable=\"archive_location\"/>\n    </group>\n  </macro>\n  <!-- 4.10. URL or persistent identifier -->\n  <macro name=\"source-date-accessed-DOI-URL-bib\">\n    <group delimiter=\". \">\n      <choose>\n        <if variable=\"DOI\"/>\n        <else-if match=\"any\" variable=\"available-date event-date issued status\"/>\n        <else-if variable=\"accessed URL\">\n          <group delimiter=\" \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date form=\"text\" variable=\"accessed\"/>\n          </group>\n        </else-if>\n      </choose>\n      <text macro=\"source-DOI-URL\"/>\n    </group>\n  </macro>\n  <macro name=\"source-DOI-URL\">\n    <choose>\n      <if variable=\"DOI\">\n        <text prefix=\"https://doi.org/\" variable=\"DOI\"/>\n      </if>\n      <else-if variable=\"URL\">\n        <text variable=\"URL\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!-- 5. Notes -->\n  <!-- TODO: add variables for distributor and exhibitions if available in CSL -->\n  <!-- 6. Legal references: Bluebook style (shared with APA) -->\n  <!-- Where APA or Chicago diverge from Bluebook, the official manual is followed -->\n  <macro name=\"legal-reference\">\n    <!-- Type usage:\n\n         `bill`\n         : bills, resolutions, federal reports\n\n         `legal_case`\n         : all legal and court cases\n\n         `hearing`\n         : hearings and testimony\n\n         `legislation`\n         : statutes, constitutional items, and charters\n\n         `regulation`\n         : codified regulations, uncodified regulations, executive orders\n\n         `treaty`\n         : treaties\n    -->\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"treaty\">\n          <text macro=\"legal-title\"/>\n          <names variable=\"author\">\n            <!-- Treaty parties should be included at least for bilateral treaties (Bluebook 21.4.2) -->\n            <name delimiter=\"-\" et-al-min=\"100\" et-al-use-first=\"99\" form=\"short\"/>\n          </names>\n          <text macro=\"legal-date\"/>\n          <!-- treaty source/report in addition to URL (Bluebook 21.4.5) -->\n          <text macro=\"legal-source\"/>\n        </if>\n        <else>\n          <group delimiter=\" \">\n            <group delimiter=\", \">\n              <text macro=\"legal-title\"/>\n              <text macro=\"legal-source\"/>\n            </group>\n            <text macro=\"legal-date\"/>\n            <text macro=\"legal-identifier\"/>\n          </group>\n        </else>\n      </choose>\n      <group delimiter=\" \">\n        <!-- locator for use in notes -->\n        <choose>\n          <if locator=\"page\" variable=\"page\">\n            <text term=\"at\"/>\n          </if>\n        </choose>\n        <text macro=\"label-locator\"/>\n      </group>\n    </group>\n  </macro>\n  <!-- 6.1. Legal date -->\n  <macro name=\"legal-date\">\n    <choose>\n      <if type=\"treaty\">\n        <text macro=\"date-issued-full\"/>\n      </if>\n      <else-if type=\"legal_case\">\n        <text macro=\"legal-date-case\"/>\n      </else-if>\n      <else-if match=\"any\" type=\"bill hearing legislation regulation\">\n        <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n          <group delimiter=\" \">\n            <text macro=\"date-original-year\"/>\n            <text form=\"symbol\" term=\"and\"/>\n          </group>\n          <choose>\n            <if variable=\"issued\">\n              <text macro=\"date-issued-year\"/>\n            </if>\n            <else>\n              <!-- Show proposal date for uncodified regulations. Assume date is entered literally ala \"proposed May 23, 2016\". -->\n              <!-- TODO: Add `proposed` date here if that becomes available -->\n              <date form=\"text\" variable=\"submitted\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"legal-date-case\">\n    <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n      <text variable=\"authority\"/>\n      <choose>\n        <if variable=\"container-title\">\n          <!-- Print only year for cases published in reporters-->\n          <text macro=\"date-issued-year\"/>\n        </if>\n        <else>\n          <text macro=\"date-issued-full\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <!-- 6.2.1. Legal title -->\n  <macro name=\"legal-title\">\n    <choose>\n      <if match=\"any\" type=\"bill legal_case legislation regulation treaty\">\n        <text text-case=\"title\" variable=\"title\"/>\n      </if>\n      <else-if type=\"hearing\">\n        <!-- use standard format (Bluebook 13.3) -->\n        <group delimiter=\": \" font-style=\"italic\">\n          <text text-case=\"capitalize-first\" variable=\"title\"/>\n          <group delimiter=\" \">\n            <text term=\"hearing\" text-case=\"capitalize-first\"/>\n            <group delimiter=\" \">\n              <group delimiter=\" \">\n                <text term=\"on\"/>\n                <text variable=\"number\"/>\n              </group>\n              <group delimiter=\" \">\n                <text value=\"before the\"/>\n                <text variable=\"section\"/>\n              </group>\n            </group>\n          </group>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <!-- 6.2.2. Legal identifier -->\n  <macro name=\"legal-identifier\">\n    <choose>\n      <if type=\"hearing\">\n        <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n          <!-- Use the 'verb' form of the hearing term to hold 'testimony of' -->\n          <text form=\"verb\" term=\"hearing\"/>\n          <names variable=\"author\">\n            <name and=\"symbol\" initialize=\"false\"/>\n          </names>\n        </group>\n      </if>\n      <else-if match=\"any\" type=\"bill legislation regulation\">\n        <!-- For uncodified regulations, assume future code section is in `status`. -->\n        <text prefix=\"(\" suffix=\")\" variable=\"status\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"legal-identifier-bill-report\">\n    <group delimiter=\" \">\n      <text variable=\"genre\"/>\n      <choose>\n        <if match=\"any\" variable=\"authority chapter-number container-title\">\n          <text variable=\"number\"/>\n        </if>\n        <else>\n          <!-- If there is no legislative body, session number, or code/record title, assume the item is a congressional report and include 'No.' label. -->\n          <text macro=\"label-number-capitalized\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <!-- 6.3. Legal source -->\n  <macro name=\"legal-source\">\n    <!-- Expect legal item `container-title` to be stored in short form -->\n    <choose>\n      <if type=\"bill\">\n        <text macro=\"legal-source-bill\"/>\n      </if>\n      <else-if type=\"hearing\">\n        <text macro=\"legal-source-hearing\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <text macro=\"legal-source-case\"/>\n      </else-if>\n      <else-if type=\"legislation\">\n        <text macro=\"legal-source-legislation\"/>\n      </else-if>\n      <else-if type=\"regulation\">\n        <text macro=\"legal-source-regulation\"/>\n      </else-if>\n      <else-if type=\"treaty\">\n        <text macro=\"legal-source-treaty\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!-- Legal source types -->\n  <macro name=\"legal-source-bill\">\n    <group delimiter=\", \">\n      <text macro=\"legal-identifier-bill-report\"/>\n      <group delimiter=\" \">\n        <text variable=\"authority\"/>\n        <!-- `chapter-number` is a session number -->\n        <text variable=\"chapter-number\"/>\n      </group>\n      <group delimiter=\" \">\n        <text variable=\"volume\"/>\n        <text variable=\"container-title\"/>\n        <text variable=\"page-first\"/>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"legal-source-case\">\n    <group delimiter=\" \">\n      <choose>\n        <if variable=\"container-title\">\n          <group delimiter=\" \">\n            <text variable=\"volume\"/>\n            <text variable=\"container-title\"/>\n            <text macro=\"label-section-symbol\"/>\n            <choose>\n              <if match=\"any\" variable=\"page page-first\">\n                <text variable=\"page-first\"/>\n              </if>\n              <else>\n                <text value=\"___\"/>\n              </else>\n            </choose>\n          </group>\n        </if>\n        <else>\n          <text macro=\"label-number-capitalized\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"legal-source-hearing\">\n    <group delimiter=\" \">\n      <text variable=\"authority\"/>\n      <!-- `chapter-number` is a session number -->\n      <text variable=\"chapter-number\"/>\n    </group>\n  </macro>\n  <macro name=\"legal-source-legislation\">\n    <choose>\n      <if variable=\"number\">\n        <!-- `number` is a public law number -->\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"genre\">\n                <text text-case=\"capitalize-first\" variable=\"genre\"/>\n              </if>\n              <else>\n                <text form=\"short\" term=\"legislation\" text-case=\"capitalize-first\"/>\n              </else>\n            </choose>\n            <text macro=\"label-number-capitalized\"/>\n          </group>\n          <group delimiter=\" \">\n            <text variable=\"volume\"/>\n            <text variable=\"container-title\"/>\n            <text variable=\"page-first\"/>\n          </group>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\" \">\n          <text variable=\"volume\"/>\n          <text variable=\"container-title\"/>\n          <choose>\n            <if variable=\"section\">\n              <text macro=\"label-section-symbol\"/>\n            </if>\n            <else>\n              <text variable=\"page-first\"/>\n            </else>\n          </choose>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"legal-source-regulation\">\n    <group delimiter=\", \">\n      <group delimiter=\" \">\n        <text variable=\"genre\"/>\n        <text macro=\"label-number-capitalized\"/>\n      </group>\n      <group delimiter=\" \">\n        <text variable=\"volume\"/>\n        <text variable=\"container-title\"/>\n        <choose>\n          <if variable=\"section\">\n            <text macro=\"label-section-symbol\"/>\n          </if>\n          <else>\n            <text variable=\"page-first\"/>\n          </else>\n        </choose>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"legal-source-treaty\">\n    <group delimiter=\" \">\n      <number variable=\"volume\"/>\n      <text variable=\"container-title\"/>\n      <choose>\n        <if match=\"any\" variable=\"page page-first\">\n          <text variable=\"page-first\"/>\n        </if>\n        <else>\n          <text macro=\"label-number-capitalized\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <!-- Citation -->\n  <macro name=\"citation-author-date-item\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"classic\">\n          <text macro=\"author-inline\"/>\n          <choose>\n            <if variable=\"author\">\n              <text macro=\"title-and-descriptions-short\"/>\n            </if>\n          </choose>\n        </if>\n        <else-if match=\"any\" variable=\"event-date issued\">\n          <choose>\n            <if match=\"any\" type=\"interview personal_communication\">\n              <choose>\n                <if match=\"any\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n                  <group delimiter=\" \">\n                    <text macro=\"author-inline\"/>\n                    <text macro=\"date-short\"/>\n                  </group>\n                </if>\n                <else>\n                  <!-- unpublished `interview` or `personal_communication` use inline format (CMOS18 14.111) -->\n                  <text macro=\"author-inline\"/>\n                  <text macro=\"title-and-descriptions-short\"/>\n                  <text macro=\"date-short\"/>\n                </else>\n              </choose>\n            </if>\n            <else>\n              <group delimiter=\" \">\n                <text macro=\"author-inline\"/>\n                <text macro=\"date-short\"/>\n              </group>\n            </else>\n          </choose>\n        </else-if>\n        <else>\n          <!--- Comma with forthcoming or n.d. -->\n          <text macro=\"author-inline\"/>\n          <choose>\n            <if match=\"any\" type=\"interview personal_communication\">\n              <choose>\n                <if match=\"none\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n                  <!-- unpublished `interview` or `personal_communication` use inline format (CMOS18 14.111) -->\n                  <text macro=\"title-and-descriptions-short\"/>\n                </if>\n              </choose>\n            </if>\n          </choose>\n          <text macro=\"date-short\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <citation after-collapse-delimiter=\"; \" collapse=\"year\" disambiguate-add-givenname=\"true\" disambiguate-add-names=\"true\" disambiguate-add-year-suffix=\"true\" et-al-min=\"3\" et-al-use-first=\"1\">\n    <layout delimiter=\"; \" prefix=\"(\" suffix=\")\">\n      <choose>\n        <if type=\"classic\">\n          <!-- with `classic`, a non-numeric canonical reference or identifying number is separated by a space rather than a comma (CMOS18 14.145) -->\n          <choose>\n            <if is-numeric=\"locator\">\n              <group delimiter=\", \">\n                <text macro=\"citation-author-date-item\"/>\n                <text macro=\"source-locator-author-date\"/>\n              </group>\n            </if>\n            <else-if locator=\"chapter line verse\" match=\"any\">\n              <group delimiter=\" \">\n                <text macro=\"citation-author-date-item\"/>\n                <text macro=\"source-locator-author-date\"/>\n              </group>\n            </else-if>\n            <else>\n              <group delimiter=\", \">\n                <text macro=\"citation-author-date-item\"/>\n                <text macro=\"source-locator-author-date\"/>\n              </group>\n            </else>\n          </choose>\n        </if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"citation-author-date-item\"/>\n            <text macro=\"source-locator-author-date\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <!-- Bibliography -->\n  <macro name=\"bibliography-author-date\">\n    <group delimiter=\". \">\n      <choose>\n        <if match=\"any\" type=\"bill hearing legal_case legislation regulation treaty\">\n          <!-- Legal items have different orders and delimiters -->\n          <text macro=\"legal-reference\"/>\n          <text macro=\"source-date-accessed-DOI-URL-bib\"/>\n          <text variable=\"references\"/>\n        </if>\n        <else>\n          <text macro=\"author-bib\"/>\n          <text macro=\"date\"/>\n          <text macro=\"title-and-source-bib\"/>\n          <text variable=\"references\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <bibliography et-al-min=\"7\" et-al-use-first=\"3\" hanging-indent=\"true\">\n    <sort>\n      <key macro=\"author-sort\"/>\n      <key macro=\"date-sort-group\"/>\n      <key macro=\"date-sort-year\"/>\n      <key macro=\"date\"/>\n      <key macro=\"title-and-descriptions-bib\"/>\n      <key macro=\"source-bib\"/>\n      <key variable=\"volume\"/>\n      <key variable=\"part-number\"/>\n      <key variable=\"event-date\"/>\n      <key variable=\"issued\"/>\n      <key macro=\"source-archive-bib\"/>\n    </sort>\n    <layout suffix=\".\">\n      <choose>\n        <if type=\"classic\">\n          <choose>\n            <if match=\"any\" variable=\"archive editor translator publisher\">\n              <text macro=\"bibliography-author-date\"/>\n            </if>\n          </choose>\n        </if>\n        <else-if match=\"any\" type=\"entry entry-dictionary entry-encyclopedia\">\n          <choose>\n            <if variable=\"author\">\n              <!-- Signed reference entries appear in the bibliography (CMOS18 14.132) -->\n              <text macro=\"bibliography-author-date\"/>\n            </if>\n            <else-if match=\"any\" variable=\"DOI URL\">\n              <!-- Provide a bibliography if necessary identifying information is not in text -->\n              <text macro=\"bibliography-author-date\"/>\n            </else-if>\n          </choose>\n        </else-if>\n        <else-if match=\"any\" type=\"interview personal_communication\">\n          <choose>\n            <if match=\"any\" variable=\"archive archive-place container-title DOI number publisher references URL\">\n              <!-- Personal communications only appear in the bibliography if the reader can retrieve them (CMOS18 14.13, 14.111) -->\n              <text macro=\"bibliography-author-date\"/>\n            </if>\n          </choose>\n        </else-if>\n        <else>\n          <text macro=\"bibliography-author-date\"/>\n        </else>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "data/docbook-entities.txt",
    "content": "aacgr 03AC\nAacgr 0386\naacute 00E1\nAacute 00C1\nabreve 0103\nAbreve 0102\nac 223E\nacd 223F\nacE 223E  0333\nacirc 00E2\nAcirc 00C2\nacute 00B4\nacy 0430\nAcy 0410\naelig 00E6\nAElig 00C6\naf 2061\nafr 1D51E\nAfr 1D504\nagr 03B1\nAgr 0391\nagrave 00E0\nAgrave 00C0\nalefsym 2135\naleph 2135\nalpha 03B1\nAlpha 0391\namacr 0101\nAmacr 0100\namalg 2A3F\namp 0026\nAMP 0026\nand 2227\nAnd 2A53\nandand 2A55\nandd 2A5C\nandslope 2A58\nandv 2A5A\nang 2220\nange 29A4\nangle 2220\nangmsd 2221\nangmsdaa 29A8\nangmsdab 29A9\nangmsdac 29AA\nangmsdad 29AB\nangmsdae 29AC\nangmsdaf 29AD\nangmsdag 29AE\nangmsdah 29AF\nangrt 221F\nangrtvb 22BE\nangrtvbd 299D\nangsph 2222\nangst 00C5\nangzarr 237C\naogon 0105\nAogon 0104\naopf 1D552\nAopf 1D538\nap 2248\napacir 2A6F\nape 224A\napE 2A70\napid 224B\napos 0027\nApplyFunction 2061\napprox 2248\napproxeq 224A\naring 00E5\nAring 00C5\nascr 1D4B6\nAscr 1D49C\nAssign 2254\nast 002A\nasymp 2248\nasympeq 224D\natilde 00E3\nAtilde 00C3\nauml 00E4\nAuml 00C4\nawconint 2233\nawint 2A11\nb.alpha 1D6C2\nb.beta 1D6C3\nb.chi 1D6D8\nb.delta 1D6C5\nb.Delta 1D6AB\nb.epsi 1D6C6\nb.epsiv 1D6DC\nb.eta 1D6C8\nb.gamma 1D6C4\nb.Gamma 1D6AA\nb.gammad 1D7CB\nb.Gammad 1D7CA\nb.iota 1D6CA\nb.kappa 1D6CB\nb.kappav 1D6DE\nb.lambda 1D6CC\nb.Lambda 1D6B2\nb.mu 1D6CD\nb.nu 1D6CE\nb.omega 1D6DA\nb.Omega 1D6C0\nb.phi 1D6D7\nb.Phi 1D6BD\nb.phiv 1D6DF\nb.pi 1D6D1\nb.Pi 1D6B7\nb.piv 1D6E1\nb.psi 1D6D9\nb.Psi 1D6BF\nb.rho 1D6D2\nb.rhov 1D6E0\nb.sigma 1D6D4\nb.Sigma 1D6BA\nb.sigmav 1D6D3\nb.tau 1D6D5\nb.Theta 1D6AF\nb.thetas 1D6C9\nb.thetav 1D6DD\nb.upsi 1D6D6\nb.UpsiUpsilon\nb.xi 1D6CF\nb.Xi 1D6B5\nb.zeta 1D6C7\nbackcong 224C\nbackepsilon 03F6\nbackprime 2035\nbacksim 223D\nbacksimeq 22CD\nBackslash 2216\nBarv 2AE7\nbarvee 22BD\nbarwed 2305\nBarwed 2306\nbarwedge 2305\nbbrk 23B5\nbbrktbrk 23B6\nbcong 224C\nbcy 0431\nBcy 0411\nbdquo 201E\nbecaus 2235\nbecause 2235\nBecause 2235\nbemptyv 29B0\nbepsi 03F6\nbernou 212C\nBernoullis 212C\nbeta 03B2\nBeta 0392\nbeth 2136\nbetween 226C\nbfr 1D51F\nBfr 1D505\nbgr 03B2\nBgr 0392\nbigcap 22C2\nbigcirc 25EF\nbigcup 22C3\nbigodot 2A00\nbigoplus 2A01\nbigotimes 2A02\nbigsqcup 2A06\nbigstarUB starf\nbigtriangledown 25BD\nbigtriangleup 25B3\nbiguplus 2A04\nbigvee 22C1\nbigwedge 22C0\nbkarow 290D\nblacklozengeUB lozf\nblacksquare 25AA\nblacktriangleUB utrif\nblacktriangledownUB dtrif\nblacktriangleleftUB ltrif\nblacktrianglerightUB rtrif\nblank 2423\nblk12 2592\nblk14 2591\nblk34 2593\nblock 2588\nbne 003D  20E5\nbnequiv 2261  20E5\nbnot 2310\nbNot 2AED\nbopf 1D553\nBopf 1D539\nbot 22A5\nbottom 22A5\nbowtie 22C8\nboxbox 29C9\nboxdl 2510\nboxdL 2555\nboxDl 2556\nboxDL 2557\nboxdr 250C\nboxdR 2552\nboxDr 2553\nboxDR 2554\nboxh 2500\nboxH 2550\nboxhd 252C\nboxhD 2565\nboxHd 2564\nboxHD 2566\nboxhu 2534\nboxhU 2568\nboxHu 2567\nboxHU 2569\nboxminus 229F\nboxplus 229E\nboxtimes 22A0\nboxul 2518\nboxuL 255B\nboxUl 255C\nboxUL 255D\nboxur 2514\nboxuR 2558\nboxUr 2559\nboxUR 255A\nboxv 2502\nboxV 2551\nboxvh 253C\nboxvH 256A\nboxVh 256B\nboxVH 256C\nboxvl 2524\nboxvL 2561\nboxVl 2562\nboxVL 2563\nboxvr 251C\nboxvR 255E\nboxVr 255F\nboxVR 2560\nbprime 2035\nbreve 02D8\nBreve 02D8\nbrvbar 00A6\nbscr 1D4B7\nBscr 212C\nbsemi 204F\nbsim 223D\nbsime 22CD\nbsol 005C\nbsolb 29C5\nbsolhsub 27C8\nbull 2022\nbulletUB bull\nbump 224E\nbumpe 224F\nbumpE 2AAE\nbumpeq 224F\nBumpeq 224E\ncacute 0107\nCacute 0106\ncap 2229\nCap 22D2\ncapand 2A44\ncapbrcup 2A49\ncapcap 2A4B\ncapcup 2A47\ncapdot 2A40\nCapitalDifferentialD 2145\ncaps 2229  FE00\ncaret 2041\ncaron 02C7\nCayleys 212D\nccaps 2A4D\nccaron 010D\nCcaron 010C\nccedil 00E7\nCcedil 00C7\nccirc 0109\nCcirc 0108\nCconint 2230\nccups 2A4C\nccupssm 2A50\ncdot 010B\nCdot 010A\ncedil 00B8\nCedilla 00B8\ncemptyv 29B2\ncent 00A2\ncenterdotUM middot\nCenterDotUM middot\ncfr 1D520\nCfr 212D\nchcy 0447\nCHcy 0427\ncheck 2713\ncheckmarkUB check\nchi 03C7\nChi 03A7\ncir 25CB\ncirc 02C6\ncirceq 2257\ncirclearrowleft 21BA\ncirclearrowright 21BB\ncircledast 229B\ncircledcirc 229A\ncircleddash 229D\nCircleDot 2299\ncircledRUM reg\ncircledS 24C8\nCircleMinus 2296\nCirclePlus 2295\nCircleTimes 2297\ncire 2257\ncirE 29C3\ncirfnint 2A10\ncirmid 2AEF\ncirscir 29C2\nClockwiseContourIntegral 2232\nCloseCurlyDoubleQuoteUM rdquo\nCloseCurlyQuoteUM rsquo\nclubs 2663\nclubsuitUB clubs\ncolon 003A\nColon 2237\ncolone 2254\nColone 2A74\ncoloneq 2254\ncomma 002C\ncommat 0040\ncomp 2201\ncompfn 2218\ncomplement 2201\ncomplexes 2102\ncong 2245\ncongdot 2A6D\nCongruent 2261\nconint 222E\nConint 222F\nContourIntegral 222E\ncopf 1D554\nCopf 2102\ncoprod 2210\nCoproduct 2210\ncopy 00A9\nCOPY 00A9\ncopysr 2117\nCounterClockwiseContourIntegral 2233\ncrarr 21B5\ncross 2717\nCross 2A2F\ncscr 1D4B8\nCscr 1D49E\ncsub 2ACF\ncsube 2AD1\ncsup 2AD0\ncsupe 2AD2\nctdot 22EF\ncudarrl 2938\ncudarrr 2935\ncuepr 22DE\ncuesc 22DF\ncularr 21B6\ncularrp 293D\ncup 222A\nCup 22D3\ncupbrcap 2A48\ncupcap 2A46\nCupCap 224D\ncupcup 2A4A\ncupdot 228D\ncupor 2A45\ncups 222A  FE00\ncurarr 21B7\ncurarrm 293C\ncurlyeqprec 22DE\ncurlyeqsucc 22DF\ncurlyvee 22CE\ncurlywedge 22CF\ncurren 00A4\ncurvearrowleft 21B6\ncurvearrowright 21B7\ncuvee 22CE\ncuwed 22CF\ncwconint 2232\ncwint 2231\ncylcty 232D\ndagger 2020\nDagger 2021\ndaleth 2138\ndarr 2193\ndArr 21D3\nDarr 21A1\ndash 2010\ndashv 22A3\nDashv 2AE4\ndbkarow 290F\ndblac 02DD\ndcaron 010F\nDcaron 010E\ndcy 0434\nDcy 0414\ndd 2146\nDD 2145\nddaggerUB Dagger\nddarr 21CA\nDDotrahd 2911\nddotseq 2A77\ndeg 00B0\nDel 2207\ndelta 03B4\nDelta 0394\ndemptyv 29B1\ndfisht 297F\ndfr 1D521\nDfr 1D507\ndgr 03B4\nDgr 0394\ndHar 2965\ndharl 21C3\ndharr 21C2\nDiacriticalAcute 00B4\nDiacriticalDot 02D9\nDiacriticalDoubleAcute 02DD\nDiacriticalGrave 0060\nDiacriticalTilde 02DC\ndiam 22C4\ndiamond 22C4\nDiamond 22C4\ndiamondsuitUB diams\ndiams 2666\ndie 00A8\nDifferentialD 2146\ndigamma 03DD\ndisin 22F2\ndivUM divide\ndivide 00F7\ndivideontimes 22C7\ndivonx 22C7\ndjcy 0452\nDJcy 0402\ndlcorn 231E\ndlcrop 230D\ndollar 0024\ndopf 1D555\nDopf 1D53B\ndot 02D9\nDot 00A8\nDotDot 20DC\ndoteq 2250\ndoteqdot 2251\nDotEqual 2250\ndotminus 2238\ndotplus 2214\ndotsquare 22A1\ndoublebarwedge 2306\nDoubleContourIntegral 222F\nDoubleDot 00A8\nDoubleDownArrow 21D3\nDoubleLeftArrow 21D0\nDoubleLeftRightArrow 21D4\nDoubleLeftTee 2AE4\nDoubleLongLeftArrow 27F8\nDoubleLongLeftRightArrow 27FA\nDoubleLongRightArrow 27F9\nDoubleRightArrow 21D2\nDoubleRightTee 22A8\nDoubleUpArrow 21D1\nDoubleUpDownArrow 21D5\nDoubleVerticalBar 2225\ndownarrowUM darr\nDownarrow 21D3\nDownArrowUM darr\nDownArrowBar 2913\nDownArrowUpArrow 21F5\nDownBreve 0311\ndowndownarrows 21CA\ndownharpoonleft 21C3\ndownharpoonright 21C2\nDownLeftRightVector 2950\nDownLeftTeeVector 295E\nDownLeftVector 21BD\nDownLeftVectorBar 2956\nDownRightTeeVector 295F\nDownRightVector 21C1\nDownRightVectorBar 2957\nDownTee 22A4\nDownTeeArrow 21A7\ndrbkarow 2910\ndrcorn 231F\ndrcrop 230C\ndscr 1D4B9\nDscr 1D49F\ndscy 0455\nDScy 0405\ndsol 29F6\ndstrok 0111\nDstrok 0110\ndtdot 22F1\ndtri 25BF\ndtrif 25BE\nduarr 21F5\nduhar 296F\ndwangle 29A6\ndzcy 045F\nDZcy 040F\ndzigrarr 27FF\neacgr 03AD\nEacgr 0388\neacute 00E9\nEacute 00C9\neaster 2A6E\necaron 011B\nEcaron 011A\necir 2256\necirc 00EA\nEcirc 00CA\necolon 2255\necy 044D\nEcy 042D\neDDot 2A77\nedot 0117\neDot 2251\nEdot 0116\nee 2147\neeacgr 03AE\nEEacgr 0389\neegr 03B7\nEEgr 0397\nefDot 2252\nefr 1D522\nEfr 1D508\neg 2A9A\negr 03B5\nEgr 0395\negrave 00E8\nEgrave 00C8\negs 2A96\negsdot 2A98\nel 2A99\nElement 2208\nelinters 23E7\nell 2113\nels 2A95\nelsdot 2A97\nemacr 0113\nEmacr 0112\nempty 2205\nemptyset 2205\nEmptySmallSquare 25FB\nemptyv 2205\nEmptyVerySmallSquare 25AB\nemsp 2003\nemsp13 2004\nemsp14 2005\neng 014B\nENG 014A\nensp 2002\neogon 0119\nEogon 0118\neopf 1D556\nEopf 1D53C\nepar 22D5\neparsl 29E3\neplus 2A71\nepsi 03B5\nepsilon 03B5\nEpsilon 0395\nepsiv 03F5\neqcirc 2256\neqcolon 2255\neqsim 2242\neqslantgtr 2A96\neqslantless 2A95\nEqual 2A75\nequals 003D\nEqualTilde 2242\nequest 225F\nEquilibrium 21CC\nequiv 2261\nequivDD 2A78\neqvparsl 29E5\nerarr 2971\nerDot 2253\nescr 212F\nEscr 2130\nesdot 2250\nesim 2242\nEsim 2A73\neta 03B7\nEta 0397\neth 00F0\nETH 00D0\neuml 00EB\nEuml 00CB\neuro 20AC\nexcl 0021\nexist 2203\nExists 2203\nexpectation 2130\nexponentiale 2147\nExponentialE 2147\nfallingdotseq 2252\nfcy 0444\nFcy 0424\nfemale 2640\nffilig FB03\nfflig FB00\nffllig FB04\nffr 1D523\nFfr 1D509\nfilig FB01\nFilledSmallSquare 25FC\nFilledVerySmallSquare 25AA\nfjlig 0066  006A\nflat 266D\nfllig FB02\nfltns 25B1\nfnof 0192\nfopf 1D557\nFopf 1D53D\nforall 2200\nForAll 2200\nfork 22D4\nforkv 2AD9\nFouriertrf 2131\nfpartint 2A0D\nfrac12 00BD\nfrac13 2153\nfrac14 00BC\nfrac15 2155\nfrac16 2159\nfrac18 215B\nfrac23 2154\nfrac25 2156\nfrac34 00BE\nfrac35 2157\nfrac38 215C\nfrac45 2158\nfrac56 215A\nfrac58 215D\nfrac78 215E\nfrasl 2044\nfrown 2322\nfscr 1D4BB\nFscr 2131\ngacute 01F5\ngamma 03B3\nGamma 0393\ngammad 03DD\nGammad 03DC\ngap 2A86\ngbreve 011F\nGbreve 011E\nGcedil 0122\ngcirc 011D\nGcirc 011C\ngcy 0433\nGcy 0413\ngdot 0121\nGdot 0120\nge 2265\ngE 2267\ngel 22DB\ngEl 2A8C\ngeq 2265\ngeqq 2267\ngeqslant 2A7E\nges 2A7E\ngescc 2AA9\ngesdot 2A80\ngesdoto 2A82\ngesdotol 2A84\ngesl 22DB  FE00\ngesles 2A94\ngfr 1D524\nGfr 1D50A\ngg 226B\nGg 22D9\nggg 22D9\nggr 03B3\nGgr 0393\ngimel 2137\ngjcy 0453\nGJcy 0403\ngl 2277\ngla 2AA5\nglE 2A92\nglj 2AA4\ngnap 2A8A\ngnapprox 2A8A\ngne 2A88\ngnE 2269\ngneq 2A88\ngneqq 2269\ngnsim 22E7\ngopf 1D558\nGopf 1D53E\ngrave 0060\nGreaterEqual 2265\nGreaterEqualLess 22DB\nGreaterFullEqual 2267\nGreaterGreater 2AA2\nGreaterLess 2277\nGreaterSlantEqual 2A7E\nGreaterTilde 2273\ngscr 210A\nGscr 1D4A2\ngsim 2273\ngsime 2A8E\ngsiml 2A90\ngt 003E\nGt 226B\nGT 003E\ngtcc 2AA7\ngtcir 2A7A\ngtdot 22D7\ngtlPar 2995\ngtquest 2A7C\ngtrapprox 2A86\ngtrarr 2978\ngtrdot 22D7\ngtreqless 22DB\ngtreqqless 2A8C\ngtrless 2277\ngtrsim 2273\ngvertneqq 2269  FE00\ngvnE 2269  FE00\nHacek 02C7\nhairsp 200A\nhalf 00BD\nhamilt 210B\nhardcy 044A\nHARDcy 042A\nharr 2194\nhArr 21D4\nharrcir 2948\nharrw 21AD\nHat 005E\nhbar 210F\nhcirc 0125\nHcirc 0124\nhearts 2665\nheartsuitUB hearts\nhellip 2026\nhercon 22B9\nhfr 1D525\nHfr 210C\nHilbertSpace 210B\nhksearow 2925\nhkswarow 2926\nhoarr 21FF\nhomtht 223B\nhookleftarrow 21A9\nhookrightarrow 21AA\nhopf 1D559\nHopf 210D\nhorbar 2015\nHorizontalLine 2500\nhscr 1D4BD\nHscr 210B\nhslash 210F\nhstrok 0127\nHstrok 0126\nHumpDownHump 224E\nHumpEqual 224F\nhybull 2043\nhyphen 2010\niacgr 03AF\nIacgr 038A\niacute 00ED\nIacute 00CD\nic 2063\nicirc 00EE\nIcirc 00CE\nicy 0438\nIcy 0418\nidiagr 0390\nidigr 03CA\nIdigr 03AA\nIdot 0130\niecy 0435\nIEcy 0415\niexcl 00A1\niff 21D4\nifr 1D526\nIfr 2111\nigr 03B9\nIgr 0399\nigrave 00EC\nIgrave 00CC\nii 2148\niiiint 2A0C\niiint 222D\niinfin 29DC\niiota 2129\nijlig 0133\nIJlig 0132\nIm 2111\nimacr 012B\nImacr 012A\nimage 2111\nImaginaryI 2148\nimagline 2110\nimagpart 2111\nimath 0131\nimof 22B7\nimped 01B5\nImplies 21D2\nin 2208\nincare 2105\ninfin 221E\ninfintie 29DD\ninodot 0131\nint 222B\nInt 222C\nintcal 22BA\nintegers 2124\nIntegral 222B\nintercal 22BA\nIntersection 22C2\nintlarhk 2A17\nintprod 2A3C\nInvisibleComma 2063\nInvisibleTimes 2062\niocy 0451\nIOcy 0401\niogon 012F\nIogon 012E\niopf 1D55A\nIopf 1D540\niota 03B9\nIota 0399\niprod 2A3C\niquest 00BF\niscr 1D4BE\nIscr 2110\nisin 2208\nisindot 22F5\nisinE 22F9\nisins 22F4\nisinsv 22F3\nisinv 2208\nit 2062\nitilde 0129\nItilde 0128\niukcyUkrainian\nIukcyUkrainian\niuml 00EF\nIuml 00CF\njcirc 0135\nJcirc 0134\njcy 0439\nJcy 0419\njfr 1D527\nJfr 1D50D\njmath 0237\njopf 1D55B\nJopf 1D541\njscr 1D4BF\nJscr 1D4A5\njsercy 0458\nJsercy 0408\njukcyUkrainian\nJukcyUkrainian\nkappa 03BA\nKappa 039A\nkappav 03F0\nkcedil 0137\nKcedil 0136\nkcy 043A\nKcy 041A\nkfr 1D528\nKfr 1D50E\nkgr 03BA\nKgr 039A\nkgreen 0138\nkhcy 0445\nKHcy 0425\nkhgr 03C7\nKHgr 03A7\nkjcy 045C\nKJcy 040C\nkopf 1D55C\nKopf 1D542\nkscr 1D4C0\nKscr 1D4A6\nlAarr 21DA\nlacute 013A\nLacute 0139\nlaemptyv 29B4\nlagran 2112\nlambda 03BB\nLambda 039B\nlang 27E8\nLang 27EA\nlangd 2991\nlangle 27E8\nlap 2A85\nLaplacetrf 2112\nlaquo 00AB\nlarr 2190\nlArr 21D0\nLarr 219E\nlarrb 21E4\nlarrbfs 291F\nlarrfs 291D\nlarrhk 21A9\nlarrlp 21AB\nlarrpl 2939\nlarrsim 2973\nlarrtl 21A2\nlat 2AAB\nlatail 2919\nlAtail 291B\nlate 2AAD\nlates 2AAD  FE00\nlbarr 290C\nlBarr 290E\nlbbrk 2772\nlbraceUM lcub\nlbrackUM lsqb\nlbrke 298B\nlbrksld 298F\nlbrkslu 298D\nlcaron 013E\nLcaron 013D\nlcedil 013C\nLcedil 013B\nlceil 2308\nlcub 007B\nlcy 043B\nLcy 041B\nldca 2936\nldquo 201C\nldquor 201E\nldrdhar 2967\nldrushar 294B\nldsh 21B2\nle 2264\nlE 2266\nLeftAngleBracket 27E8\nleftarrowUM larr\nLeftarrow 21D0\nLeftArrowUM larr\nLeftArrowBar 21E4\nLeftArrowRightArrow 21C6\nleftarrowtail 21A2\nLeftCeiling 2308\nLeftDoubleBracket 27E6\nLeftDownTeeVector 2961\nLeftDownVector 21C3\nLeftDownVectorBar 2959\nLeftFloor 230A\nleftharpoondown 21BD\nleftharpoonup 21BC\nleftleftarrows 21C7\nleftrightarrow 2194\nLeftrightarrow 21D4\nLeftRightArrow 2194\nleftrightarrows 21C6\nleftrightharpoons 21CB\nleftrightsquigarrow 21AD\nLeftRightVector 294E\nLeftTee 22A3\nLeftTeeArrow 21A4\nLeftTeeVector 295A\nleftthreetimes 22CB\nLeftTriangle 22B2\nLeftTriangleBar 29CF\nLeftTriangleEqual 22B4\nLeftUpDownVector 2951\nLeftUpTeeVector 2960\nLeftUpVector 21BF\nLeftUpVectorBar 2958\nLeftVector 21BC\nLeftVectorBar 2952\nleg 22DA\nlEg 2A8B\nleq 2264\nleqq 2266\nleqslant 2A7D\nles 2A7D\nlescc 2AA8\nlesdot 2A7F\nlesdoto 2A81\nlesdotor 2A83\nlesg 22DA  FE00\nlesges 2A93\nlessapprox 2A85\nlessdot 22D6\nlesseqgtr 22DA\nlesseqqgtr 2A8B\nLessEqualGreater 22DA\nLessFullEqual 2266\nLessGreater 2276\nlessgtr 2276\nLessLess 2AA1\nlesssim 2272\nLessSlantEqual 2A7D\nLessTilde 2272\nlfisht 297C\nlfloor 230A\nlfr 1D529\nLfr 1D50F\nlg 2276\nlgE 2A91\nlgr 03BB\nLgr 039B\nlHar 2962\nlhard 21BD\nlharu 21BC\nlharul 296A\nlhblk 2584\nljcy 0459\nLJcy 0409\nll 226A\nLl 22D8\nllarr 21C7\nllcorner 231E\nLleftarrow 21DA\nllhard 296B\nlltri 25FA\nlmidot 0140\nLmidot 013F\nlmoust 23B0\nlmoustache 23B0\nlnap 2A89\nlnapprox 2A89\nlne 2A87\nlnE 2268\nlneq 2A87\nlneqq 2268\nlnsim 22E6\nloang 27EC\nloarr 21FD\nlobrk 27E6\nlongleftarrow 27F5\nLongleftarrow 27F8\nLongLeftArrow 27F5\nlongleftrightarrow 27F7\nLongleftrightarrow 27FA\nLongLeftRightArrow 27F7\nlongmapsto 27FC\nlongrightarrow 27F6\nLongrightarrow 27F9\nLongRightArrow 27F6\nlooparrowleft 21AB\nlooparrowright 21AC\nlopar 2985\nlopf 1D55D\nLopf 1D543\nloplus 2A2D\nlotimes 2A34\nlowast 2217\nlowbar 005F\nLowerLeftArrow 2199\nLowerRightArrow 2198\nloz 25CA\nlozengeUB loz\nlozf 29EB\nlpar 0028\nlparlt 2993\nlrarr 21C6\nlrcorner 231F\nlrhar 21CB\nlrhard 296D\nlrm 200E\nlrtri 22BF\nlsaquo 2039\nlscr 1D4C1\nLscr 2112\nlsh 21B0\nLsh 21B0\nlsim 2272\nlsime 2A8D\nlsimg 2A8F\nlsqb 005B\nlsquo 2018\nlsquor 201A\nlstrok 0142\nLstrok 0141\nlt 003C\nLt 226A\nLT 003C\nltcc 2AA6\nltcir 2A79\nltdot 22D6\nlthree 22CB\nltimes 22C9\nltlarr 2976\nltquest 2A7B\nltri 25C3\nltrie 22B4\nltrif 25C2\nltrPar 2996\nlurdshar 294A\nluruhar 2966\nlvertneqq 2268  FE00\nlvnE 2268  FE00\nmacr 00AF\nmale 2642\nmalt 2720\nmalteseUB malt\nmap 21A6\nMap 2905\nmapsto 21A6\nmapstodown 21A7\nmapstoleft 21A4\nmapstoup 21A5\nmarker 25AE\nmcomma 2A29\nmcy 043C\nMcy 041C\nmdash 2014\nmDDot 223A\nmeasuredangle 2221\nMediumSpace 205F\nMellintrf 2133\nmfr 1D52A\nMfr 1D510\nmgr 03BC\nMgr 039C\nmho 2127\nmicro 00B5\nmid 2223\nmidast 002A\nmidcir 2AF0\nmiddot 00B7\nminus 2212\nminusb 229F\nminusd 2238\nminusdu 2A2A\nMinusPlus 2213\nmlcp 2ADB\nmldr 2026\nmnplus 2213\nmodels 22A7\nmopf 1D55E\nMopf 1D544\nmp 2213\nmscr 1D4C2\nMscr 2133\nmstpos 223E\nmu 03BC\nMu 039C\nmultimap 22B8\nmumap 22B8\nnabla 2207\nnacute 0144\nNacute 0143\nnang 2220  20D2\nnap 2249\nnapE 2A70  0338\nnapid 224B  0338\nnapos 0149\nnapprox 2249\nnatur 266E\nnaturalUB natur\nnaturals 2115\nnbsp 00A0\nnbump 224E  0338\nnbumpe 224F  0338\nncap 2A43\nncaron 0148\nNcaron 0147\nncedil 0146\nNcedil 0145\nncong 2247\nncongdot 2A6D  0338\nncup 2A42\nncy 043D\nNcy 041D\nndash 2013\nne 2260\nnearhk 2924\nnearr 2197\nneArr 21D7\nnearrow 2197\nnedot 2250  0338\nNegativeMediumSpace 200B\nNegativeThickSpace 200B\nNegativeThinSpace 200B\nNegativeVeryThinSpace 200B\nnequiv 2262\nnesear 2928\nnesim 2242  0338\nNestedGreaterGreater 226B\nNestedLessLess 226A\nNewLine 000A\nnexist 2204\nnexists 2204\nnfr 1D52B\nNfr 1D511\nnge 2271\nngE 2267  0338\nngeq 2271\nngeqq 2267  0338\nngeqslant 2A7E  0338\nnges 2A7E  0338\nnGg 22D9  0338\nngr 03BD\nNgr 039D\nngsim 2275\nngt 226F\nnGt 226B  20D2\nngtr 226F\nnGtv 226B  0338\nnharr 21AE\nnhArr 21CE\nnhpar 2AF2\nni 220B\nnis 22FC\nnisd 22FA\nniv 220B\nnjcy 045A\nNJcy 040A\nnlarr 219A\nnlArr 21CD\nnldr 2025\nnle 2270\nnlE 2266  0338\nnleftarrow 219A\nnLeftarrow 21CD\nnleftrightarrow 21AE\nnLeftrightarrow 21CE\nnleq 2270\nnleqq 2266  0338\nnleqslant 2A7D  0338\nnles 2A7D  0338\nnless 226E\nnLl 22D8  0338\nnlsim 2274\nnlt 226E\nnLt 226A  20D2\nnltri 22EA\nnltrie 22EC\nnLtv 226A  0338\nnmid 2224\nNoBreak 2060\nNonBreakingSpaceUM nbsp\nnopf 1D55F\nNopf 2115\nnot 00AC\nNot 2AEC\nNotCongruent 2262\nNotCupCap 226D\nNotDoubleVerticalBar 2226\nNotElement 2209\nNotEqual 2260\nNotEqualTilde 2242  0338\nNotExists 2204\nNotGreater 226F\nNotGreaterEqual 2271\nNotGreaterFullEqual 2267  0338\nNotGreaterGreater 226B  0338\nNotGreaterLess 2279\nNotGreaterSlantEqual 2A7E  0338\nNotGreaterTilde 2275\nNotHumpDownHump 224E  0338\nNotHumpEqual 224F  0338\nnotin 2209\nnotindot 22F5  0338\nnotinE 22F9  0338\nnotinva 2209\nnotinvb 22F7\nnotinvc 22F6\nNotLeftTriangle 22EA\nNotLeftTriangleBar 29CF  0338\nNotLeftTriangleEqual 22EC\nNotLess 226E\nNotLessEqual 2270\nNotLessGreater 2278\nNotLessLess 226A  0338\nNotLessSlantEqual 2A7D  0338\nNotLessTilde 2274\nNotNestedGreaterGreater 2AA2  0338\nNotNestedLessLess 2AA1  0338\nnotni 220C\nnotniva 220C\nnotnivb 22FE\nnotnivc 22FD\nNotPrecedes 2280\nNotPrecedesEqual 2AAF  0338\nNotPrecedesSlantEqual 22E0\nNotReverseElement 220C\nNotRightTriangle 22EB\nNotRightTriangleBar 29D0  0338\nNotRightTriangleEqual 22ED\nNotSquareSubset 228F  0338\nNotSquareSubsetEqual 22E2\nNotSquareSuperset 2290  0338\nNotSquareSupersetEqual 22E3\nNotSubset 2282  20D2\nNotSubsetEqual 2288\nNotSucceeds 2281\nNotSucceedsEqual 2AB0  0338\nNotSucceedsSlantEqual 22E1\nNotSucceedsTilde 227F  0338\nNotSuperset 2283  20D2\nNotSupersetEqual 2289\nNotTilde 2241\nNotTildeEqual 2244\nNotTildeFullEqual 2247\nNotTildeTilde 2249\nNotVerticalBar 2224\nnpar 2226\nnparallel 2226\nnparsl 2AFD  20E5\nnpart 2202  0338\nnpolint 2A14\nnpr 2280\nnprcue 22E0\nnpre 2AAF  0338\nnprec 2280\nnpreceq 2AAF  0338\nnrarr 219B\nnrArr 21CF\nnrarrc 2933  0338\nnrarrw 219D  0338\nnrightarrow 219B\nnRightarrow 21CF\nnrtri 22EB\nnrtrie 22ED\nnsc 2281\nnsccue 22E1\nnsce 2AB0  0338\nnscr 1D4C3\nNscr 1D4A9\nnshortmid 2224\nnshortparallel 2226\nnsim 2241\nnsime 2244\nnsimeq 2244\nnsmid 2224\nnspar 2226\nnsqsube 22E2\nnsqsupe 22E3\nnsub 2284\nnsube 2288\nnsubE 2AC5  0338\nnsubset 2282  20D2\nnsubseteq 2288\nnsubseteqq 2AC5  0338\nnsucc 2281\nnsucceq 2AB0  0338\nnsup 2285\nnsupe 2289\nnsupE 2AC6  0338\nnsupset 2283  20D2\nnsupseteq 2289\nnsupseteqq 2AC6  0338\nntgl 2279\nntilde 00F1\nNtilde 00D1\nntlg 2278\nntriangleleft 22EA\nntrianglelefteq 22EC\nntriangleright 22EB\nntrianglerighteq 22ED\nnu 03BD\nNu 039D\nnum 0023\nnumero 2116\nnumsp 2007\nnvap 224D  20D2\nnvdash 22AC\nnvDash 22AD\nnVdash 22AE\nnVDash 22AF\nnvge 2265  20D2\nnvgt 003E  20D2\nnvHarr 2904\nnvinfin 29DE\nnvlArr 2902\nnvle 2264  20D2\nnvlt 003C  20D2\nnvltrie 22B4  20D2\nnvrArr 2903\nnvrtrie 22B5  20D2\nnvsim 223C  20D2\nnwarhk 2923\nnwarr 2196\nnwArr 21D6\nnwarrow 2196\nnwnear 2927\noacgr 03CC\nOacgr 038C\noacute 00F3\nOacute 00D3\noast 229B\nocir 229A\nocirc 00F4\nOcirc 00D4\nocy 043E\nOcy 041E\nodash 229D\nodblac 0151\nOdblac 0150\nodiv 2A38\nodot 2299\nodsold 29BC\noelig 0153\nOElig 0152\nofcir 29BF\nofr 1D52C\nOfr 1D512\nogon 02DB\nogr 03BF\nOgr 039F\nograve 00F2\nOgrave 00D2\nogt 29C1\nohacgr 03CE\nOHacgr 038F\nohbar 29B5\nohgr 03C9\nOHgr 03A9\nohm 03A9\noint 222E\nolarr 21BA\nolcir 29BE\nolcross 29BB\noline 203E\nolt 29C0\nomacr 014D\nOmacr 014C\nomega 03C9\nOmega 03A9\nomicron 03BF\nOmicron 039F\nomid 29B6\nominus 2296\noopf 1D560\nOopf 1D546\nopar 29B7\nOpenCurlyDoubleQuoteUM ldquo\nOpenCurlyQuoteUM lsquo\noperp 29B9\noplus 2295\nor 2228\nOr 2A54\norarr 21BB\nord 2A5D\norder 2134\norderof 2134\nordf 00AA\nordm 00BA\norigof 22B6\noror 2A56\norslope 2A57\norv 2A5B\noS 24C8\noscr 2134\nOscr 1D4AA\noslash 00F8\nOslash 00D8\nosol 2298\notilde 00F5\nOtilde 00D5\notimes 2297\nOtimes 2A37\notimesas 2A36\nouml 00F6\nOuml 00D6\novbar 233D\nOverBar 203E\nOverBrace 23DE\nOverBracket 23B4\nOverParenthesis 23DC\npar 2225\npara 00B6\nparallel 2225\nparsim 2AF3\nparsl 2AFD\npart 2202\nPartialD 2202\npcy 043F\nPcy 041F\npercnt 0025\nperiod 002E\npermil 2030\nperp 22A5\npertenk 2031\npfr 1D52D\nPfr 1D513\npgr 03C0\nPgr 03A0\nphgr 03C6\nPHgr 03A6\nphi 03C6\nPhi 03A6\nphiv 03D5\nphmmat 2133\nphone 260E\npi 03C0\nPi 03A0\npitchfork 22D4\npiv 03D6\nplanck 210F\nplanckh 210E\nplankv 210F\nplus 002B\nplusacir 2A23\nplusb 229E\npluscir 2A22\nplusdo 2214\nplusdu 2A25\npluse 2A72\nPlusMinusUM plusmn\nplusmn 00B1\nplussim 2A26\nplustwo 2A27\npmUM plusmn\nPoincareplane 210C\npointint 2A15\npopf 1D561\nPopf 2119\npound 00A3\npr 227A\nPr 2ABB\nprap 2AB7\nprcue 227C\npre 2AAF\nprE 2AB3\nprec 227A\nprecapprox 2AB7\npreccurlyeq 227C\nPrecedes 227A\nPrecedesEqual 2AAF\nPrecedesSlantEqual 227C\nPrecedesTilde 227E\npreceq 2AAF\nprecnapprox 2AB9\nprecneqq 2AB5\nprecnsim 22E8\nprecsim 227E\nprime 2032\nPrime 2033\nprimes 2119\nprnap 2AB9\nprnE 2AB5\nprnsim 22E8\nprod 220F\nProduct 220F\nprofalar 232E\nprofline 2312\nprofsurf 2313\nprop 221D\nProportion 2237\nProportional 221D\npropto 221D\nprsim 227E\nprurel 22B0\npscr 1D4C5\nPscr 1D4AB\npsgr 03C8\nPSgr 03A8\npsi 03C8\nPsi 03A8\npuncsp 2008\nqfr 1D52E\nQfr 1D514\nqint 2A0C\nqopf 1D562\nQopf 211A\nqprime 2057\nqscr 1D4C6\nQscr 1D4AC\nquaternions 210D\nquatint 2A16\nquest 003F\nquesteq 225F\nquot 0022\nQUOT 0022\nrAarr 21DB\nrace 223D  0331\nracute 0155\nRacute 0154\nradic 221A\nraemptyv 29B3\nrang 27E9\nRang 27EB\nrangd 2992\nrange 29A5\nrangle 27E9\nraquo 00BB\nrarr 2192\nrArr 21D2\nRarr 21A0\nrarrap 2975\nrarrb 21E5\nrarrbfs 2920\nrarrc 2933\nrarrfs 291E\nrarrhk 21AA\nrarrlp 21AC\nrarrpl 2945\nrarrsim 2974\nrarrtl 21A3\nRarrtl 2916\nrarrw 219D\nratail 291A\nrAtail 291C\nratio 2236\nrationals 211A\nrbarr 290D\nrBarr 290F\nRBarr 2910\nrbbrk 2773\nrbraceUM rcub\nrbrackUM rsqb\nrbrke 298C\nrbrksld 298E\nrbrkslu 2990\nrcaron 0159\nRcaron 0158\nrcedil 0157\nRcedil 0156\nrceil 2309\nrcub 007D\nrcy 0440\nRcy 0420\nrdca 2937\nrdldhar 2969\nrdquo 201D\nrdquor 201D\nrdsh 21B3\nRe 211C\nreal 211C\nrealine 211B\nrealpart 211C\nreals 211D\nrect 25AD\nreg 00AE\nREG 00AE\nReverseElement 220B\nReverseEquilibrium 21CB\nReverseUpEquilibrium 296F\nrfisht 297D\nrfloor 230B\nrfr 1D52F\nRfr 211C\nrgr 03C1\nRgr 03A1\nrHar 2964\nrhard 21C1\nrharu 21C0\nrharul 296C\nrho 03C1\nRho 03A1\nrhov 03F1\nRightAngleBracket 27E9\nrightarrowUM rarr\nRightarrow 21D2\nRightArrowUM rarr\nRightArrowBar 21E5\nRightArrowLeftArrow 21C4\nrightarrowtail 21A3\nRightCeiling 2309\nRightDoubleBracket 27E7\nRightDownTeeVector 295D\nRightDownVector 21C2\nRightDownVectorBar 2955\nRightFloor 230B\nrightharpoondown 21C1\nrightharpoonup 21C0\nrightleftarrows 21C4\nrightleftharpoons 21CC\nrightrightarrows 21C9\nrightsquigarrow 219D\nRightTee 22A2\nRightTeeArrow 21A6\nRightTeeVector 295B\nrightthreetimes 22CC\nRightTriangle 22B3\nRightTriangleBar 29D0\nRightTriangleEqual 22B5\nRightUpDownVector 294F\nRightUpTeeVector 295C\nRightUpVector 21BE\nRightUpVectorBar 2954\nRightVector 21C0\nRightVectorBar 2953\nring 02DA\nrisingdotseq 2253\nrlarr 21C4\nrlhar 21CC\nrlm 200F\nrmoust 23B1\nrmoustache 23B1\nrnmid 2AEE\nroang 27ED\nroarr 21FE\nrobrk 27E7\nropar 2986\nropf 1D563\nRopf 211D\nroplus 2A2E\nrotimes 2A35\nRoundImplies 2970\nrpar 0029\nrpargt 2994\nrppolint 2A12\nrrarr 21C9\nRrightarrow 21DB\nrsaquo 203A\nrscr 1D4C7\nRscr 211B\nrsh 21B1\nRsh 21B1\nrsqb 005D\nrsquo 2019\nrsquor 2019\nrthree 22CC\nrtimes 22CA\nrtri 25B9\nrtrie 22B5\nrtrif 25B8\nrtriltri 29CE\nRuleDelayed 29F4\nruluhar 2968\nrx 211E\nsacute 015B\nSacute 015A\nsbquo 201A\nsc 227B\nSc 2ABC\nscap 2AB8\nscaron 0161\nScaron 0160\nsccue 227D\nsce 2AB0\nscE 2AB4\nscedil 015F\nScedil 015E\nscirc 015D\nScirc 015C\nscnap 2ABA\nscnE 2AB6\nscnsim 22E9\nscpolint 2A13\nscsim 227F\nscy 0441\nScy 0421\nsdot 22C5\nsdotb 22A1\nsdote 2A66\nsearhk 2925\nsearr 2198\nseArr 21D8\nsearrow 2198\nsect 00A7\nsemi 003B\nseswar 2929\nsetminus 2216\nsetmn 2216\nsext 2736\nsfgr 03C2\nsfr 1D530\nSfr 1D516\nsfrown 2322\nsgr 03C3\nSgr 03A3\nsharp 266F\nshchcy 0449\nSHCHcy 0429\nshcy 0448\nSHcy 0428\nShortDownArrow 2193\nShortLeftArrow 2190\nshortmid 2223\nshortparallel 2225\nShortRightArrow 2192\nShortUpArrow 2191\nshy 00AD\nsigma 03C3\nSigma 03A3\nsigmaf 03C2\nsigmav 03C2\nsim 223C\nsimdot 2A6A\nsime 2243\nsimeq 2243\nsimg 2A9E\nsimgE 2AA0\nsiml 2A9D\nsimlE 2A9F\nsimne 2246\nsimplus 2A24\nsimrarr 2972\nslarr 2190\nSmallCircle 2218\nsmallsetminus 2216\nsmashp 2A33\nsmeparsl 29E4\nsmid 2223\nsmile 2323\nsmt 2AAA\nsmte 2AAC\nsmtes 2AAC  FE00\nsoftcy 044C\nSOFTcy 042C\nsol 002F\nsolb 29C4\nsolbar 233F\nsopf 1D564\nSopf 1D54A\nspades 2660\nspadesuitUB spades\nspar 2225\nsqcap 2293\nsqcaps 2293  FE00\nsqcup 2294\nsqcups 2294  FE00\nSqrt 221A\nsqsub 228F\nsqsube 2291\nsqsubset 228F\nsqsubseteq 2291\nsqsup 2290\nsqsupe 2292\nsqsupset 2290\nsqsupseteq 2292\nsqu 25A1\nsquare 25A1\nSquare 25A1\nSquareIntersection 2293\nSquareSubset 228F\nSquareSubsetEqual 2291\nSquareSuperset 2290\nSquareSupersetEqual 2292\nSquareUnion 2294\nsquarf 25AA\nsquf 25AA\nsrarr 2192\nsscr 1D4C8\nSscr 1D4AE\nssetmn 2216\nssmile 2323\nsstarf 22C6\nstar 2606\nStar 22C6\nstarf 2605\nstraightepsilon 03F5\nstraightphi 03D5\nstrns 00AF\nsub 2282\nSub 22D0\nsubdot 2ABD\nsube 2286\nsubE 2AC5\nsubedot 2AC3\nsubmult 2AC1\nsubne 228A\nsubnE 2ACB\nsubplus 2ABF\nsubrarr 2979\nsubset 2282\nSubset 22D0\nsubseteq 2286\nsubseteqq 2AC5\nSubsetEqual 2286\nsubsetneq 228A\nsubsetneqq 2ACB\nsubsim 2AC7\nsubsub 2AD5\nsubsup 2AD3\nsucc 227B\nsuccapprox 2AB8\nsucccurlyeq 227D\nSucceeds 227B\nSucceedsEqual 2AB0\nSucceedsSlantEqual 227D\nSucceedsTilde 227F\nsucceq 2AB0\nsuccnapprox 2ABA\nsuccneqq 2AB6\nsuccnsim 22E9\nsuccsim 227F\nSuchThat 220B\nsum 2211\nSum 2211\nsung 266A\nsup 2283\nSup 22D1\nsup1 00B9\nsup2 00B2\nsup3 00B3\nsupdot 2ABE\nsupdsub 2AD8\nsupe 2287\nsupE 2AC6\nsupedot 2AC4\nSuperset 2283\nSupersetEqual 2287\nsuphsol 27C9\nsuphsub 2AD7\nsuplarr 297B\nsupmult 2AC2\nsupne 228B\nsupnE 2ACC\nsupplus 2AC0\nsupset 2283\nSupset 22D1\nsupseteq 2287\nsupseteqq 2AC6\nsupsetneq 228B\nsupsetneqq 2ACC\nsupsim 2AC8\nsupsub 2AD4\nsupsup 2AD6\nswarhk 2926\nswarr 2199\nswArr 21D9\nswarrow 2199\nswnwar 292A\nszlig 00DF\nTab 0009\ntarget 2316\ntau 03C4\nTau 03A4\ntbrk 23B4\ntcaron 0165\nTcaron 0164\ntcedil 0163\nTcedil 0162\ntcy 0442\nTcy 0422\ntdot 20DB\ntelrec 2315\ntfr 1D531\nTfr 1D517\ntgr 03C4\nTgr 03A4\nthere4 2234\ntherefore 2234\nTherefore 2234\ntheta 03B8\nTheta 0398\nthetasym 03D1\nthetav 03D1\nthgr 03B8\nTHgr 0398\nthickapprox 2248\nthicksim 223C\nThickSpace 205F  200A\nthinsp 2009\nThinSpaceUB thinsp\nthkap 2248\nthksim 223C\nthorn 00FE\nTHORN 00DE\ntilde 02DC\nTilde 223C\nTildeEqual 2243\nTildeFullEqual 2245\nTildeTilde 2248\ntimes 00D7\ntimesb 22A0\ntimesbar 2A31\ntimesd 2A30\ntint 222D\ntoea 2928\ntop 22A4\ntopbot 2336\ntopcir 2AF1\ntopf 1D565\nTopf 1D54B\ntopfork 2ADA\ntosa 2929\ntprime 2034\ntrade 2122\nTRADE 2122\ntriangleUB utri\ntriangledownUB dtri\ntriangleleftUB ltri\ntrianglelefteq 22B4\ntriangleq 225C\ntrianglerightUB rtri\ntrianglerighteq 22B5\ntridot 25EC\ntrie 225C\ntriminus 2A3A\nTripleDot 20DB\ntriplus 2A39\ntrisb 29CD\ntritime 2A3B\ntrpezium 23E2\ntscr 1D4C9\nTscr 1D4AF\ntscy 0446\nTScy 0426\ntshcy 045B\nTSHcy 040B\ntstrok 0167\nTstrok 0166\ntwixt 226C\ntwoheadleftarrow 219E\ntwoheadrightarrow 21A0\nuacgr 03CD\nUacgrUpsilon\nuacute 00FA\nUacuteU with acute\nuarr 2191\nuArr 21D1\nUarr 219F\nUarrocir 2949\nubrcy 045E\nUbrcyU\nubreve 016D\nUbreveU\nucirc 00FB\nUcircU with circumflex\nucy 0443\nUcyU\nudarr 21C5\nudblac 0171\nUdblacU\nudhar 296E\nudiagr 03B0\nudigr 03CB\nUdigrUpsilon\nufisht 297E\nufr 1D532\nUfrU\nugr 03C5\nUgrUpsilon\nugrave 00F9\nUgraveU with grave\nuHar 2963\nuharl 21BF\nuharr 21BE\nuhblk 2580\nulcorn 231C\nulcorner 231C\nulcrop 230F\nultri 25F8\numacr 016B\nUmacrU\numl 00A8\nUnderBar 005F\nUnderBrace 23DF\nUnderBracket 23B5\nUnderParenthesis 23DD\nUnion 22C3\nUnionPlus 228E\nuogon 0173\nUogonU\nuopf 1D566\nUopfU\nuparrowUM uarr\nUparrow 21D1\nUpArrowUM uarr\nUpArrowBar 2912\nUpArrowDownArrow 21C5\nupdownarrow 2195\nUpdownarrow 21D5\nUpDownArrow 2195\nUpEquilibrium 296E\nupharpoonleft 21BF\nupharpoonright 21BE\nuplus 228E\nUpperLeftArrow 2196\nUpperRightArrow 2197\nupsi 03C5\nUpsiUpsilon capital Upsilon\nupsih 03D2\nupsilon 03C5\nUpsilonUgr\nUpTee 22A5\nUpTeeArrow 21A5\nupuparrows 21C8\nurcorn 231D\nurcorner 231D\nurcrop 230E\nuring 016F\nUringU\nurtri 25F9\nuscr 1D4CA\nUscrU\nutdot 22F0\nutilde 0169\nUtildeU\nutri 25B5\nutrif 25B4\nuuarr 21C8\nuuml 00FC\nUumlU with diaeresis\nuwangle 29A7\nvangrt 299C\nvarepsilon 03F5\nvarkappa 03F0\nvarnothing 2205\nvarphi 03D5\nvarpi 03D6\nvarpropto 221D\nvarr 2195\nvArrUpdownarrow A: up&down dbl arrow\nvarrho 03F1\nvarsigma 03C2\nvarsubsetneq 228A  FE00\nvarsubsetneqq 2ACB  FE00\nvarsupsetneq 228B  FE00\nvarsupsetneqq 2ACC  FE00\nvartheta 03D1\nvartriangleleft 22B2\nvartriangleright 22B3\nvBar 2AE8\nVbar 2AEB\nvBarv 2AE9\nvcy 0432\nVcy 0412\nvdash 22A2\nvDash 22A8\nVdash 22A9\nVDash 22AB\nVdashl 2AE6\nvee 2228\nVee 22C1\nveebar 22BB\nveeeq 225A\nvellip 22EE\nverbar 007C\nVerbar 2016\nvertUM verbar\nVert 2016\nVerticalBar 2223\nVerticalLineUM verbar\nVerticalSeparator 2758\nVerticalTilde 2240\nVeryThinSpaceUB hairsp\nvfr 1D533\nVfr 1D519\nvltri 22B2\nvnsub 2282  20D2\nvnsup 2283  20D2\nvopf 1D567\nVopf 1D54D\nvprop 221D\nvrtri 22B3\nvscr 1D4CB\nVscr 1D4B1\nvsubne 228A  FE00\nvsubnE 2ACB  FE00\nvsupne 228B  FE00\nvsupnE 2ACC  FE00\nVvdash 22AA\nvzigzag 299A\nwcirc 0175\nWcirc 0174\nwedbar 2A5F\nwedge 2227\nWedge 22C0\nwedgeq 2259\nweierp 2118\nwfr 1D534\nWfr 1D51A\nwopf 1D568\nWopf 1D54E\nwp 2118\nwr 2240\nwreath 2240\nwscr 1D4CC\nWscr 1D4B2\nxcap 22C2\nxcirc 25EF\nxcup 22C3\nxdtri 25BD\nxfr 1D535\nXfr 1D51B\nxgr 03BE\nXgr 039E\nxharr 27F7\nxhArr 27FA\nxi 03BE\nXi 039E\nxlarr 27F5\nxlArr 27F8\nxmap 27FC\nxnis 22FB\nxodot 2A00\nxopf 1D569\nXopf 1D54F\nxoplus 2A01\nxotime 2A02\nxrarr 27F6\nxrArr 27F9\nxscr 1D4CD\nXscr 1D4B3\nxsqcup 2A06\nxuplus 2A04\nxutri 25B3\nxvee 22C1\nxwedge 22C0\nyacute 00FD\nYacute 00DD\nyacy 044F\nYAcy 042F\nycirc 0177\nYcirc 0176\nycy 044B\nYcyU\nyen 00A5\nyfr 1D536\nYfr 1D51C\nyicyUkrainian\nYIcyUkrainian\nyopf 1D56A\nYopf 1D550\nyscr 1D4CE\nYscr 1D4B4\nyucy 044E\nYUcyU\nyuml 00FF\nYuml 0178\nzacute 017A\nZacute 0179\nzcaron 017E\nZcaron 017D\nzcy 0437\nZcy 0417\nzdot 017C\nZdot 017B\nzeetrf 2128\nZeroWidthSpace 200B\nzeta 03B6\nZeta 0396\nzfr 1D537\nZfr 2128\nzgr 03B6\nZgr 0396\nzhcy 0436\nZHcy 0416\nzigrarr 21DD\nzopf 1D56B\nZopf 2124\nzscr 1D4CF\nZscr 1D4B5\nzwj 200D\nzwnj 200C\n"
  },
  {
    "path": "data/docx/[Content_Types].xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\"><Default Extension=\"xml\" ContentType=\"application/xml\" /><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" /><Override PartName=\"/word/webSettings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml\" /><Override PartName=\"/word/numbering.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\" /><Override PartName=\"/word/settings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\" /><Override PartName=\"/word/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\" /><Override PartName=\"/word/fontTable.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\" /><Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" /><Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" /><Override PartName=\"/docProps/custom.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.custom-properties+xml\"/><Override PartName=\"/word/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\" /><Override PartName=\"/word/document.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\" /><Override PartName=\"/word/comments.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\" /><Override PartName=\"/word/footnotes.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\" /></Types>\n"
  },
  {
    "path": "data/docx/_rels/.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"word/document.xml\" /><Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\" /><Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\" /><Relationship Id=\"rId5\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\" Target=\"docProps/custom.xml\"/>\n</Relationships>\n"
  },
  {
    "path": "data/docx/docProps/app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\n  <Words>83</Words>\n  <SharedDoc>false</SharedDoc>\n  <HyperlinksChanged>false</HyperlinksChanged>\n  <Lines>12</Lines>\n  <AppVersion>12.0000</AppVersion>\n  <LinksUpToDate>false</LinksUpToDate>\n  <Application>Microsoft Word 12.0.0</Application>\n  <CharactersWithSpaces>583</CharactersWithSpaces>\n  <Template>Normal.dotm</Template>\n  <DocSecurity>0</DocSecurity>\n  <TotalTime>6</TotalTime>\n  <ScaleCrop>false</ScaleCrop>\n  <Characters>475</Characters>\n  <Paragraphs>8</Paragraphs>\n  <Pages>1</Pages>\n</Properties>"
  },
  {
    "path": "data/docx/docProps/core.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><dc:title>Title</dc:title><dc:creator>Author</dc:creator><cp:keywords></cp:keywords><dcterms:created xsi:type=\"dcterms:W3CDTF\">2017-12-27T05:22:50Z</dcterms:created><dcterms:modified xsi:type=\"dcterms:W3CDTF\">2017-12-27T05:22:50Z</dcterms:modified></cp:coreProperties>"
  },
  {
    "path": "data/docx/docProps/custom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\"></Properties>\n"
  },
  {
    "path": "data/docx/word/_rels/document.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering\" Id=\"rId1\" Target=\"numbering.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Id=\"rId2\" Target=\"styles.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\" Id=\"rId3\" Target=\"settings.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings\" Id=\"rId4\" Target=\"webSettings.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable\" Id=\"rId5\" Target=\"fontTable.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Id=\"rId6\" Target=\"theme/theme1.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes\" Id=\"rId7\" Target=\"footnotes.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\" Id=\"rId8\" Target=\"comments.xml\" /><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Id=\"rId30\" Target=\"http://example.com\" TargetMode=\"External\" /></Relationships>\n"
  },
  {
    "path": "data/docx/word/_rels/footnotes.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Id=\"rId30\" Target=\"http://example.com\" TargetMode=\"External\" /></Relationships>"
  },
  {
    "path": "data/docx/word/comments.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<w:comments xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" />"
  },
  {
    "path": "data/docx/word/document.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<w:document xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"\nxmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\"\nxmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\nxmlns:o=\"urn:schemas-microsoft-com:office:office\"\nxmlns:v=\"urn:schemas-microsoft-com:vml\"\nxmlns:w10=\"urn:schemas-microsoft-com:office:word\"\nxmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"\nxmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\"\nxmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\">\n\n  <w:body>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Title\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Title</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Subtitle\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Subtitle</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Author\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Author</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Date\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Date</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Abstract\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Abstract</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading1\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"21\" w:name=\"heading-1\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 1</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"21\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading2\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"22\" w:name=\"heading-2\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 2</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"22\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading3\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"23\" w:name=\"heading-3\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 3</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"23\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading4\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"24\" w:name=\"heading-4\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 4</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"24\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading5\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"25\" w:name=\"heading-5\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 5</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"25\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading6\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"26\" w:name=\"heading-6\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 6</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"26\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading7\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"27\" w:name=\"heading-7\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 7</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"27\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading8\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"28\" w:name=\"heading-8\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 8</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"28\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Heading9\" />\n      </w:pPr>\n      <w:bookmarkStart w:id=\"29\" w:name=\"heading-9\" />\n      <w:r>\n        <w:t xml:space=\"preserve\">Heading 9</w:t>\n      </w:r>\n      <w:bookmarkEnd w:id=\"29\" />\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"FirstParagraph\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">First Paragraph.</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"BodyText\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Body Text. Body Text Char.</w:t>\n      </w:r>\n      <w:r>\n        <w:t xml:space=\"preserve\"> </w:t>\n      </w:r>\n      <w:r>\n        <w:rPr>\n          <w:rStyle w:val=\"VerbatimChar\" />\n        </w:rPr>\n        <w:t xml:space=\"preserve\">Verbatim Char</w:t>\n      </w:r>\n      <w:r>\n        <w:t xml:space=\"preserve\">.</w:t>\n      </w:r>\n      <w:r>\n        <w:t xml:space=\"preserve\"> </w:t>\n      </w:r>\n      <w:hyperlink r:id=\"rId30\">\n        <w:r>\n          <w:rPr>\n            <w:rStyle w:val=\"Hyperlink\" />\n          </w:rPr>\n          <w:t xml:space=\"preserve\">Hyperlink</w:t>\n        </w:r>\n      </w:hyperlink>\n      <w:r>\n        <w:t xml:space=\"preserve\">.</w:t>\n      </w:r>\n      <w:r>\n        <w:t xml:space=\"preserve\"> </w:t>\n      </w:r>\n      <w:r>\n        <w:t xml:space=\"preserve\">Footnote.</w:t>\n      </w:r>\n      <w:r>\n        <w:rPr>\n          <w:rStyle w:val=\"FootnoteReference\" />\n        </w:rPr>\n        <w:footnoteReference w:id=\"31\" />\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"BlockText\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Block Text.</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"TableCaption\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Table caption.</w:t>\n      </w:r>\n    </w:p>\n    <w:tbl>\n      <w:tblPr>\n        <w:tblStyle w:val=\"Table\" />\n        <w:tblLook w:firstRow=\"1\" />\n        <w:tblCaption w:val=\"Table caption.\" />\n      </w:tblPr>\n      <w:tblGrid />\n      <w:tr>\n        <w:trPr>\n          <w:cnfStyle w:firstRow=\"1\" w:val=\"100000000000\" />\n        </w:trPr>\n        <w:tc>\n          <w:tcPr>\n            <w:tcBorders>\n              <w:bottom w:val=\"single\" />\n            </w:tcBorders>\n            <w:vAlign w:val=\"bottom\" />\n          </w:tcPr>\n          <w:p>\n            <w:pPr>\n              <w:pStyle w:val=\"Compact\" />\n              <w:jc w:val=\"left\" />\n            </w:pPr>\n            <w:r>\n              <w:t xml:space=\"preserve\">Table</w:t>\n            </w:r>\n          </w:p>\n        </w:tc>\n        <w:tc>\n          <w:tcPr>\n            <w:tcBorders>\n              <w:bottom w:val=\"single\" />\n            </w:tcBorders>\n            <w:vAlign w:val=\"bottom\" />\n          </w:tcPr>\n          <w:p>\n            <w:pPr>\n              <w:pStyle w:val=\"Compact\" />\n              <w:jc w:val=\"left\" />\n            </w:pPr>\n            <w:r>\n              <w:t xml:space=\"preserve\">Table</w:t>\n            </w:r>\n          </w:p>\n        </w:tc>\n      </w:tr>\n      <w:tr>\n        <w:tc>\n          <w:p>\n            <w:pPr>\n              <w:pStyle w:val=\"Compact\" />\n              <w:jc w:val=\"left\" />\n            </w:pPr>\n            <w:r>\n              <w:t xml:space=\"preserve\">1</w:t>\n            </w:r>\n          </w:p>\n        </w:tc>\n        <w:tc>\n          <w:p>\n            <w:pPr>\n              <w:pStyle w:val=\"Compact\" />\n              <w:jc w:val=\"left\" />\n            </w:pPr>\n            <w:r>\n              <w:t xml:space=\"preserve\">2</w:t>\n            </w:r>\n          </w:p>\n        </w:tc>\n      </w:tr>\n    </w:tbl>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"ImageCaption\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Image Caption</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"DefinitionTerm\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">DefinitionTerm</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Definition\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Definition</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"DefinitionTerm\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">DefinitionTerm</w:t>\n      </w:r>\n    </w:p>\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"Definition\" />\n      </w:pPr>\n      <w:r>\n        <w:t xml:space=\"preserve\">Definition</w:t>\n      </w:r>\n    </w:p>\n    <w:sectPr>\n      <w:footnotePr>\n        <w:numRestart w:val=\"eachSect\" />\n      </w:footnotePr>\n    </w:sectPr>\n  </w:body>\n</w:document>\n"
  },
  {
    "path": "data/docx/word/fontTable.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<w:fonts xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">\n  <w:font w:name=\"Aptos\">\n    <w:panose1 w:val=\"020B0004020202020204\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"swiss\"/>\n    <w:pitch w:val=\"variable\"/>\n    <w:sig w:usb0=\"20000287\" w:usb1=\"00000003\" w:usb2=\"00000000\" w:usb3=\"00000000\" w:csb0=\"0000019F\" w:csb1=\"00000000\"/>\n  </w:font>\n  <w:font w:name=\"Times New Roman\">\n    <w:panose1 w:val=\"02020603050405020304\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"roman\"/>\n    <w:pitch w:val=\"variable\"/>\n    <w:sig w:usb0=\"E0002EFF\" w:usb1=\"C000785B\" w:usb2=\"00000009\" w:usb3=\"00000000\" w:csb0=\"000001FF\" w:csb1=\"00000000\"/>\n  </w:font>\n  <w:font w:name=\"Aptos Display\">\n    <w:panose1 w:val=\"020B0004020202020204\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"swiss\"/>\n    <w:pitch w:val=\"variable\"/>\n    <w:sig w:usb0=\"20000287\" w:usb1=\"00000003\" w:usb2=\"00000000\" w:usb3=\"00000000\" w:csb0=\"0000019F\" w:csb1=\"00000000\"/>\n  </w:font>\n  <w:font w:name=\"Cambria Math\">\n    <w:panose1 w:val=\"02040503050406030204\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"roman\"/>\n    <w:pitch w:val=\"variable\"/>\n    <w:sig w:usb0=\"E00002FF\" w:usb1=\"420024FF\" w:usb2=\"00000000\" w:usb3=\"00000000\" w:csb0=\"0000019F\" w:csb1=\"00000000\"/>\n  </w:font>\n  <w:font w:name=\"Courier New\">\n    <w:panose1 w:val=\"02070309020205020404\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"modern\"/>\n    <w:pitch w:val=\"fixed\"/>\n    <w:sig w:usb0=\"E0002AFF\" w:usb1=\"C0007843\" w:usb2=\"00000009\" w:usb3=\"00000000\" w:csb0=\"000001FF\" w:csb1=\"00000000\"/>\n  </w:font>\n  <w:font w:name=\"Cambria\">\n    <w:panose1 w:val=\"02040503050406030204\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"roman\"/>\n    <w:pitch w:val=\"variable\"/>\n    <w:sig w:usb0=\"E00002FF\" w:usb1=\"400004FF\" w:usb2=\"00000000\" w:usb3=\"00000000\" w:csb0=\"0000019F\" w:csb1=\"00000000\"/>\n  </w:font>\n  <w:font w:name=\"Calibri\">\n    <w:panose1 w:val=\"020F0502020204030204\"/>\n    <w:charset w:val=\"00\"/>\n    <w:family w:val=\"swiss\"/>\n    <w:pitch w:val=\"variable\"/>\n    <w:sig w:usb0=\"E0002AFF\" w:usb1=\"C000247B\" w:usb2=\"00000009\" w:usb3=\"00000000\" w:csb0=\"000001FF\" w:csb1=\"00000000\"/>\n  </w:font>\n</w:fonts>\n"
  },
  {
    "path": "data/docx/word/footnotes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<w:footnotes xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\">\n  <w:footnote w:type=\"continuationSeparator\" w:id=\"0\"><w:p><w:r><w:continuationSeparator /></w:r></w:p></w:footnote>\n  <w:footnote w:type=\"separator\" w:id=\"-1\"><w:p><w:r><w:separator /></w:r></w:p></w:footnote>\n  <w:footnote w:id=\"31\">\n    <w:p>\n      <w:pPr><w:pStyle w:val=\"FootnoteText\" /></w:pPr>\n      <w:r>\n        <w:rPr>\n          <w:rStyle w:val=\"FootnoteReference\" />\n        </w:rPr>\n      <w:footnoteRef />\n      </w:r>\n      <w:r><w:t>Footnote Text.</w:t></w:r>\n    </w:p>\n    <w:p>\n      <w:pPr><w:pStyle w:val=\"FootnoteBlockText\"/></w:pPr>\n      <w:r><w:t>Footnote Block Text</w:t></w:r>\n    </w:p>\n  </w:footnote>\n</w:footnotes>"
  },
  {
    "path": "data/docx/word/numbering.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<w:numbering xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:abstractNum w:abstractNumId=\"990\"><w:nsid w:val=\"170cd2de\" /><w:multiLevelType w:val=\"multilevel\" /><w:lvl w:ilvl=\"0\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"0\" /></w:tabs><w:ind w:left=\"480\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"1\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"720\" /></w:tabs><w:ind w:left=\"1200\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"2\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"1440\" /></w:tabs><w:ind w:left=\"1920\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"3\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"2160\" /></w:tabs><w:ind w:left=\"2640\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"4\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"2880\" /></w:tabs><w:ind w:left=\"3360\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"5\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"3600\" /></w:tabs><w:ind w:left=\"4080\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"6\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"4320\" /></w:tabs><w:ind w:left=\"4800\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"7\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"5040\" /></w:tabs><w:ind w:left=\"5520\" w:hanging=\"480\" /></w:pPr></w:lvl><w:lvl w:ilvl=\"8\"><w:numFmt w:val=\"bullet\" /><w:lvlText w:val=\" \" /><w:lvlJc w:val=\"left\" /><w:pPr><w:tabs><w:tab w:val=\"num\" w:pos=\"5760\" /></w:tabs><w:ind w:left=\"6240\" w:hanging=\"480\" /></w:pPr></w:lvl></w:abstractNum><w:num w:numId=\"1000\"><w:abstractNumId w:val=\"990\" /></w:num></w:numbering>"
  },
  {
    "path": "data/docx/word/settings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<w:settings xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:sl=\"http://schemas.openxmlformats.org/schemaLibrary/2006/main\">\n  <w:zoom w:percent=\"100\" />\n  <w:embedSystemFonts />\n  <w:proofState w:spelling=\"clean\" w:grammar=\"clean\" />\n  <w:stylePaneFormatFilter w:val=\"0004\" />\n  <w:doNotTrackMoves />\n  <w:defaultTabStop w:val=\"720\" />\n  <w:drawingGridHorizontalSpacing w:val=\"360\" />\n  <w:drawingGridVerticalSpacing w:val=\"360\" />\n  <w:displayHorizontalDrawingGridEvery w:val=\"0\" />\n  <w:displayVerticalDrawingGridEvery w:val=\"0\" />\n  <w:characterSpacingControl w:val=\"doNotCompress\" />\n  <w:savePreviewPicture />\n  <w:footnotePr>\n    <w:footnote w:id=\"-1\" />\n    <w:footnote w:id=\"0\" />\n  </w:footnotePr>\n  <w:rsids>\n  </w:rsids>\n  <m:mathPr>\n    <m:mathFont m:val=\"Cambria Math\" />\n    <m:brkBin m:val=\"before\" />\n    <m:brkBinSub m:val=\"--\" />\n    <m:smallFrac m:val=\"0\" />\n    <m:dispDef />\n    <m:lMargin m:val=\"0\" />\n    <m:rMargin m:val=\"0\" />\n    <m:wrapRight />\n    <m:intLim m:val=\"subSup\" />\n    <m:naryLim m:val=\"undOvr\" />\n  </m:mathPr>\n  <w:themeFontLang w:val=\"en-US\" />\n  <w:clrSchemeMapping w:bg1=\"light1\" w:t1=\"dark1\" w:bg2=\"light2\" w:t2=\"dark2\" w:accent1=\"accent1\" w:accent2=\"accent2\" w:accent3=\"accent3\" w:accent4=\"accent4\" w:accent5=\"accent5\" w:accent6=\"accent6\" w:hyperlink=\"hyperlink\" w:followedHyperlink=\"followedHyperlink\" />\n  <w:decimalSymbol w:val=\".\" />\n  <w:listSeparator w:val=\",\" />\n</w:settings>\n"
  },
  {
    "path": "data/docx/word/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<w:styles xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">\n  <w:docDefaults>\n    <w:rPrDefault>\n      <w:rPr>\n        <w:rFonts w:asciiTheme=\"minorHAnsi\" w:eastAsiaTheme=\"minorEastAsia\" w:hAnsiTheme=\"minorHAnsi\" w:cstheme=\"minorBidi\" />\n        <w:sz w:val=\"24\" />\n        <w:szCs w:val=\"24\" />\n        <w:lang w:val=\"en-US\" w:eastAsia=\"zh-CN\" w:bidi=\"ar-SA\" />\n      </w:rPr>\n    </w:rPrDefault>\n    <w:pPrDefault>\n      <w:pPr>\n        <w:spacing w:after=\"200\" />\n      </w:pPr>\n    </w:pPrDefault>\n  </w:docDefaults>\n  <w:latentStyles w:defLockedState=\"0\" w:defUIPriority=\"0\" w:defSemiHidden=\"0\" w:defUnhideWhenUsed=\"0\" w:defQFormat=\"0\" w:count=\"276\" />\n  <w:style w:type=\"paragraph\" w:default=\"1\" w:styleId=\"Normal\">\n    <w:name w:val=\"Normal\" />\n    <w:qFormat />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"BodyText\">\n    <w:name w:val=\"Body Text\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:link w:val=\"BodyTextChar\" />\n    <w:qFormat />\n    <w:pPr>\n      <w:spacing w:before=\"180\" w:after=\"180\" />\n    </w:pPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"FirstParagraph\">\n    <w:name w:val=\"First Paragraph\" />\n    <w:basedOn w:val=\"BodyText\" />\n    <w:next w:val=\"BodyText\" />\n    <w:qFormat />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"Compact\">\n    <w:name w:val=\"Compact\" />\n    <w:basedOn w:val=\"BodyText\" />\n    <w:qFormat />\n    <w:pPr>\n      <w:spacing w:before=\"36\" w:after=\"36\" />\n    </w:pPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Title\">\n    <w:name w:val=\"Title\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"TitleChar\" />\n    <w:uiPriority w:val=\"10\" />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:spacing w:after=\"80\" w:line=\"240\" w:lineRule=\"auto\" />\n      <w:contextualSpacing />\n      <w:jc w:val=\"center\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\"\n      w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\"\n      w:cstheme=\"majorBidi\" />\n      <w:sz w:val=\"56\" />\n      <w:szCs w:val=\"56\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"TitleChar\">\n    <w:name w:val=\"Title Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Title\" />\n    <w:uiPriority w:val=\"10\" />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\"\n      w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\"\n      w:cstheme=\"majorBidi\" />\n      <w:sz w:val=\"56\" />\n      <w:szCs w:val=\"56\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Subtitle\">\n    <w:name w:val=\"Subtitle\" />\n    <w:basedOn w:val=\"Title\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"SubtitleChar\" />\n    <w:uiPriority w:val=\"11\" />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:numPr>\n        <w:ilvl w:val=\"1\" />\n      </w:numPr>\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:spacing w:val=\"15\" />\n      <w:sz w:val=\"28\" />\n      <w:szCs w:val=\"28\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"SubtitleChar\">\n    <w:name w:val=\"Subtitle Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Subtitle\" />\n    <w:uiPriority w:val=\"11\" />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"595959\" w:themeColor=\"text1\"\n      w:themeTint=\"A6\" />\n      <w:spacing w:val=\"15\" />\n      <w:sz w:val=\"28\" />\n      <w:szCs w:val=\"28\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"Author\">\n    <w:name w:val=\"Author\" />\n    <w:basedOn w:val=\"Title\" />\n    <w:next w:val=\"BodyText\" />\n    <w:qFormat />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n    </w:pPr>\n    <w:rPr>\n      <w:sz w:val=\"24\" />\n      <w:szCs w:val=\"24\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Date\">\n    <w:name w:val=\"Date\" />\n    <w:basedOn w:val=\"Title\" />\n    <w:next w:val=\"BodyText\" />\n    <w:qFormat />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n    </w:pPr>\n    <w:rPr>\n      <w:sz w:val=\"24\" />\n      <w:szCs w:val=\"24\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"AbstractTitle\">\n    <w:name w:val=\"Abstract Title\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"Abstract\" />\n    <w:qFormat />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"300\" w:after=\"0\" />\n      <w:jc w:val=\"center\" />\n    </w:pPr>\n    <w:rPr>\n      <w:b />\n      <w:sz w:val=\"20\" />\n      <w:szCs w:val=\"20\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"Abstract\">\n    <w:name w:val=\"Abstract\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:qFormat />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"100\" w:after=\"300\" />\n    </w:pPr>\n    <w:rPr>\n      <w:sz w:val=\"20\" />\n      <w:szCs w:val=\"20\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Bibliography\">\n    <w:name w:val=\"Bibliography\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"Bibliography\" />\n    <w:qFormat />\n    <w:pPr />\n    <w:rPr />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading1\">\n    <w:name w:val=\"heading 1\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading1Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"360\" w:after=\"80\" />\n      <w:outlineLvl w:val=\"0\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\"\n      w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n      <w:sz w:val=\"40\" />\n      <w:szCs w:val=\"40\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading2\">\n    <w:name w:val=\"heading 2\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading2Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"160\" w:after=\"80\" />\n      <w:outlineLvl w:val=\"1\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\"\n      w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n      <w:sz w:val=\"32\" />\n      <w:szCs w:val=\"32\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading3\">\n    <w:name w:val=\"heading 3\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading3Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"160\" w:after=\"80\" />\n      <w:outlineLvl w:val=\"2\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n      <w:sz w:val=\"28\" />\n      <w:szCs w:val=\"28\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading4\">\n    <w:name w:val=\"heading 4\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading4Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"80\" w:after=\"40\" />\n      <w:outlineLvl w:val=\"3\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:i />\n      <w:iCs />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading5\">\n    <w:name w:val=\"heading 5\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading5Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"80\" w:after=\"40\" />\n      <w:outlineLvl w:val=\"4\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading6\">\n    <w:name w:val=\"heading 6\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading6Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"40\" w:after=\"0\" />\n      <w:outlineLvl w:val=\"5\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:i />\n      <w:iCs />\n      <w:color w:val=\"595959\" w:themeColor=\"text1\"\n      w:themeTint=\"A6\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading7\">\n    <w:name w:val=\"heading 7\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading7Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:before=\"40\" w:after=\"0\" />\n      <w:outlineLvl w:val=\"6\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"595959\" w:themeColor=\"text1\"\n      w:themeTint=\"A6\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading8\">\n    <w:name w:val=\"heading 8\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading8Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:after=\"0\" />\n      <w:outlineLvl w:val=\"7\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:i />\n      <w:iCs />\n      <w:color w:val=\"272727\" w:themeColor=\"text1\"\n      w:themeTint=\"D8\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Heading9\">\n    <w:name w:val=\"heading 9\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"BodyText\" />\n    <w:link w:val=\"Heading9Char\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:after=\"0\" />\n      <w:outlineLvl w:val=\"8\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"272727\" w:themeColor=\"text1\"\n      w:themeTint=\"D8\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\" w:styleId=\"Heading1Char\">\n    <w:name w:val=\"Heading 1 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading1\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\"\n      w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n      <w:sz w:val=\"40\" />\n      <w:szCs w:val=\"40\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading2Char\">\n    <w:name w:val=\"Heading 2 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading2\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\"\n      w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n      <w:sz w:val=\"32\" />\n      <w:szCs w:val=\"32\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading3Char\">\n    <w:name w:val=\"Heading 3 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading3\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n      <w:sz w:val=\"28\" />\n      <w:szCs w:val=\"28\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading4Char\">\n    <w:name w:val=\"Heading 4 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading4\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:i />\n      <w:iCs />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading5Char\">\n    <w:name w:val=\"Heading 5 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading5\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"0F4761\" w:themeColor=\"accent1\"\n      w:themeShade=\"BF\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading6Char\">\n    <w:name w:val=\"Heading 6 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading6\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:i />\n      <w:iCs />\n      <w:color w:val=\"595959\" w:themeColor=\"text1\"\n      w:themeTint=\"A6\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading7Char\">\n    <w:name w:val=\"Heading 7 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading7\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"595959\" w:themeColor=\"text1\"\n      w:themeTint=\"A6\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading8Char\">\n    <w:name w:val=\"Heading 8 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading8\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:i />\n      <w:iCs />\n      <w:color w:val=\"272727\" w:themeColor=\"text1\"\n      w:themeTint=\"D8\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\"\n  w:styleId=\"Heading9Char\">\n    <w:name w:val=\"Heading 9 Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"Heading9\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:semiHidden />\n    <w:rsid w:val=\"00A10FD9\" />\n    <w:rPr>\n      <w:rFonts w:eastAsiaTheme=\"majorEastAsia\"\n      w:cstheme=\"majorBidi\" />\n      <w:color w:val=\"272727\" w:themeColor=\"text1\"\n      w:themeTint=\"D8\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"BlockText\">\n    <w:name w:val=\"Block Text\" />\n    <w:basedOn w:val=\"BodyText\" />\n    <w:next w:val=\"BodyText\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:pPr>\n      <w:spacing w:before=\"100\" w:after=\"100\" />\n      <w:ind w:firstLine=\"0\" w:left=\"480\" w:right=\"480\" />\n    </w:pPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"FootnoteText\">\n    <w:name w:val=\"Footnote Text\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"FootnoteText\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"FootnoteBlockText\">\n    <w:name w:val=\"Footnote Block Text\" />\n    <w:basedOn w:val=\"FootnoteText\" />\n    <w:next w:val=\"FootnoteText\" />\n    <w:uiPriority w:val=\"9\" />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:pPr>\n      <w:spacing w:before=\"100\" w:after=\"100\" />\n      <w:ind w:firstLine=\"0\" w:left=\"480\" w:right=\"480\" />\n    </w:pPr>\n  </w:style>\n  <w:style w:type=\"character\" w:default=\"1\" w:styleId=\"DefaultParagraphFont\">\n    <w:name w:val=\"Default Paragraph Font\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n  </w:style>\n  <w:style w:type=\"table\" w:default=\"1\" w:styleId=\"Table\">\n    <w:name w:val=\"Table\" />\n    <w:basedOn w:val=\"TableNormal\" />\n    <w:semiHidden />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:tblPr>\n      <w:tblInd w:w=\"0\" w:type=\"dxa\" />\n      <w:tblCellMar>\n        <w:top w:w=\"0\" w:type=\"dxa\" />\n        <w:left w:w=\"108\" w:type=\"dxa\" />\n        <w:bottom w:w=\"0\" w:type=\"dxa\" />\n        <w:right w:w=\"108\" w:type=\"dxa\" />\n      </w:tblCellMar>\n    </w:tblPr>\n    <w:tblStylePr w:type=\"firstRow\">\n      <w:tcPr>\n        <w:tcBorders>\n          <w:bottom w:val=\"single\"/>\n        </w:tcBorders>\n        <w:vAlign w:val=\"bottom\"/>\n      </w:tcPr>\n    </w:tblStylePr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"DefinitionTerm\">\n    <w:name w:val=\"Definition Term\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:next w:val=\"Definition\" />\n    <w:pPr>\n      <w:keepNext />\n      <w:keepLines />\n      <w:spacing w:after=\"0\" />\n    </w:pPr>\n    <w:rPr>\n      <w:b />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"Definition\">\n    <w:name w:val=\"Definition\" />\n    <w:basedOn w:val=\"Normal\" />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"Caption\">\n    <w:name w:val=\"Caption\" />\n    <w:basedOn w:val=\"Normal\" />\n    <w:link w:val=\"BodyTextChar\" />\n    <w:pPr>\n      <w:spacing w:before=\"0\" w:after=\"120\" />\n    </w:pPr>\n    <w:rPr>\n      <w:i />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"TableCaption\">\n    <w:name w:val=\"Table Caption\" />\n    <w:basedOn w:val=\"Caption\" />\n    <w:pPr>\n      <w:keepNext />\n    </w:pPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"ImageCaption\">\n    <w:name w:val=\"Image Caption\" />\n    <w:basedOn w:val=\"Caption\" />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"Figure\">\n    <w:name w:val=\"Figure\" />\n    <w:basedOn w:val=\"Normal\" />\n  </w:style>\n  <w:style w:type=\"paragraph\" w:customStyle=\"1\" w:styleId=\"CaptionedFigure\">\n    <w:name w:val=\"Captioned Figure\" />\n    <w:basedOn w:val=\"Figure\" />\n    <w:pPr>\n      <w:keepNext />\n    </w:pPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\" w:styleId=\"BodyTextChar\">\n    <w:name w:val=\"Body Text Char\" />\n    <w:basedOn w:val=\"DefaultParagraphFont\" />\n    <w:link w:val=\"BodyText\" />\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\" w:styleId=\"VerbatimChar\">\n    <w:name w:val=\"Verbatim Char\" />\n    <w:basedOn w:val=\"BodyTextChar\" />\n    <w:rPr>\n      <w:rFonts w:ascii=\"Consolas\" w:hAnsi=\"Consolas\" />\n      <w:sz w:val=\"22\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:customStyle=\"1\" w:styleId=\"SectionNumber\">\n    <w:name w:val=\"Section Number\" />\n    <w:basedOn w:val=\"BodyTextChar\" />\n  </w:style>\n  <w:style w:type=\"character\" w:styleId=\"FootnoteReference\">\n    <w:name w:val=\"Footnote Reference\" />\n    <w:basedOn w:val=\"BodyTextChar\" />\n    <w:rPr>\n      <w:vertAlign w:val=\"superscript\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"character\" w:styleId=\"Hyperlink\">\n    <w:name w:val=\"Hyperlink\" />\n    <w:basedOn w:val=\"BodyTextChar\" />\n    <w:rPr>\n      <w:color w:val=\"4F81BD\" w:themeColor=\"accent1\" />\n    </w:rPr>\n  </w:style>\n  <w:style w:type=\"paragraph\" w:styleId=\"TOCHeading\">\n    <w:name w:val=\"TOC Heading\" />\n    <w:basedOn w:val=\"Heading1\" />\n    <w:next w:val=\"BodyText\" />\n    <w:uiPriority w:val=\"39\" />\n    <w:unhideWhenUsed />\n    <w:qFormat />\n    <w:pPr>\n      <w:spacing w:before=\"240\" w:line=\"259\" w:lineRule=\"auto\" />\n      <w:outlineLvl w:val=\"9\" />\n    </w:pPr>\n    <w:rPr>\n      <w:rFonts w:asciiTheme=\"majorHAnsi\" w:eastAsiaTheme=\"majorEastAsia\" w:hAnsiTheme=\"majorHAnsi\" w:cstheme=\"majorBidi\" />\n      <w:b w:val=\"0\" />\n      <w:bCs w:val=\"0\" />\n      <w:color w:val=\"365F91\" w:themeColor=\"accent1\" w:themeShade=\"BF\" />\n    </w:rPr>\n  </w:style>\n</w:styles>\n"
  },
  {
    "path": "data/docx/word/theme/theme1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\">\n  <a:themeElements>\n    <a:clrScheme name=\"Office\">\n      <a:dk1>\n        <a:sysClr val=\"windowText\" lastClr=\"000000\"/>\n      </a:dk1>\n      <a:lt1>\n        <a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>\n      </a:lt1>\n      <a:dk2>\n        <a:srgbClr val=\"0E2841\"/>\n      </a:dk2>\n      <a:lt2>\n        <a:srgbClr val=\"E8E8E8\"/>\n      </a:lt2>\n      <a:accent1>\n        <a:srgbClr val=\"156082\"/>\n      </a:accent1>\n      <a:accent2>\n        <a:srgbClr val=\"E97132\"/>\n      </a:accent2>\n      <a:accent3>\n        <a:srgbClr val=\"196B24\"/>\n      </a:accent3>\n      <a:accent4>\n        <a:srgbClr val=\"0F9ED5\"/>\n      </a:accent4>\n      <a:accent5>\n        <a:srgbClr val=\"A02B93\"/>\n      </a:accent5>\n      <a:accent6>\n        <a:srgbClr val=\"4EA72E\"/>\n      </a:accent6>\n      <a:hlink>\n        <a:srgbClr val=\"467886\"/>\n      </a:hlink>\n      <a:folHlink>\n        <a:srgbClr val=\"96607D\"/>\n      </a:folHlink>\n    </a:clrScheme>\n    <a:fontScheme name=\"Office\">\n      <a:majorFont>\n        <a:latin typeface=\"Aptos Display\" panose=\"02110004020202020204\"/>\n        <a:ea typeface=\"\"/>\n        <a:cs typeface=\"\"/>\n        <a:font script=\"Jpan\" typeface=\"游ゴシック Light\"/>\n        <a:font script=\"Hang\" typeface=\"맑은 고딕\"/>\n        <a:font script=\"Hans\" typeface=\"等线 Light\"/>\n        <a:font script=\"Hant\" typeface=\"新細明體\"/>\n        <a:font script=\"Arab\" typeface=\"Times New Roman\"/>\n        <a:font script=\"Hebr\" typeface=\"Times New Roman\"/>\n        <a:font script=\"Thai\" typeface=\"Angsana New\"/>\n        <a:font script=\"Ethi\" typeface=\"Nyala\"/>\n        <a:font script=\"Beng\" typeface=\"Vrinda\"/>\n        <a:font script=\"Gujr\" typeface=\"Shruti\"/>\n        <a:font script=\"Khmr\" typeface=\"MoolBoran\"/>\n        <a:font script=\"Knda\" typeface=\"Tunga\"/>\n        <a:font script=\"Guru\" typeface=\"Raavi\"/>\n        <a:font script=\"Cans\" typeface=\"Euphemia\"/>\n        <a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>\n        <a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>\n        <a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>\n        <a:font script=\"Thaa\" typeface=\"MV Boli\"/>\n        <a:font script=\"Deva\" typeface=\"Mangal\"/>\n        <a:font script=\"Telu\" typeface=\"Gautami\"/>\n        <a:font script=\"Taml\" typeface=\"Latha\"/>\n        <a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Orya\" typeface=\"Kalinga\"/>\n        <a:font script=\"Mlym\" typeface=\"Kartika\"/>\n        <a:font script=\"Laoo\" typeface=\"DokChampa\"/>\n        <a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>\n        <a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>\n        <a:font script=\"Viet\" typeface=\"Times New Roman\"/>\n        <a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>\n        <a:font script=\"Geor\" typeface=\"Sylfaen\"/>\n        <a:font script=\"Armn\" typeface=\"Arial\"/>\n        <a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/>\n        <a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/>\n        <a:font script=\"Java\" typeface=\"Javanese Text\"/>\n        <a:font script=\"Lisu\" typeface=\"Segoe UI\"/>\n        <a:font script=\"Mymr\" typeface=\"Myanmar Text\"/>\n        <a:font script=\"Nkoo\" typeface=\"Ebrima\"/>\n        <a:font script=\"Olck\" typeface=\"Nirmala UI\"/>\n        <a:font script=\"Osma\" typeface=\"Ebrima\"/>\n        <a:font script=\"Phag\" typeface=\"Phagspa\"/>\n        <a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Sora\" typeface=\"Nirmala UI\"/>\n        <a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/>\n        <a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/>\n        <a:font script=\"Tfng\" typeface=\"Ebrima\"/>\n      </a:majorFont>\n      <a:minorFont>\n        <a:latin typeface=\"Aptos\" panose=\"02110004020202020204\"/>\n        <a:ea typeface=\"\"/>\n        <a:cs typeface=\"\"/>\n        <a:font script=\"Jpan\" typeface=\"游明朝\"/>\n        <a:font script=\"Hang\" typeface=\"맑은 고딕\"/>\n        <a:font script=\"Hans\" typeface=\"等线\"/>\n        <a:font script=\"Hant\" typeface=\"新細明體\"/>\n        <a:font script=\"Arab\" typeface=\"Arial\"/>\n        <a:font script=\"Hebr\" typeface=\"Arial\"/>\n        <a:font script=\"Thai\" typeface=\"Cordia New\"/>\n        <a:font script=\"Ethi\" typeface=\"Nyala\"/>\n        <a:font script=\"Beng\" typeface=\"Vrinda\"/>\n        <a:font script=\"Gujr\" typeface=\"Shruti\"/>\n        <a:font script=\"Khmr\" typeface=\"DaunPenh\"/>\n        <a:font script=\"Knda\" typeface=\"Tunga\"/>\n        <a:font script=\"Guru\" typeface=\"Raavi\"/>\n        <a:font script=\"Cans\" typeface=\"Euphemia\"/>\n        <a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/>\n        <a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/>\n        <a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/>\n        <a:font script=\"Thaa\" typeface=\"MV Boli\"/>\n        <a:font script=\"Deva\" typeface=\"Mangal\"/>\n        <a:font script=\"Telu\" typeface=\"Gautami\"/>\n        <a:font script=\"Taml\" typeface=\"Latha\"/>\n        <a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Orya\" typeface=\"Kalinga\"/>\n        <a:font script=\"Mlym\" typeface=\"Kartika\"/>\n        <a:font script=\"Laoo\" typeface=\"DokChampa\"/>\n        <a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/>\n        <a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/>\n        <a:font script=\"Viet\" typeface=\"Arial\"/>\n        <a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/>\n        <a:font script=\"Geor\" typeface=\"Sylfaen\"/>\n        <a:font script=\"Armn\" typeface=\"Arial\"/>\n        <a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/>\n        <a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/>\n        <a:font script=\"Java\" typeface=\"Javanese Text\"/>\n        <a:font script=\"Lisu\" typeface=\"Segoe UI\"/>\n        <a:font script=\"Mymr\" typeface=\"Myanmar Text\"/>\n        <a:font script=\"Nkoo\" typeface=\"Ebrima\"/>\n        <a:font script=\"Olck\" typeface=\"Nirmala UI\"/>\n        <a:font script=\"Osma\" typeface=\"Ebrima\"/>\n        <a:font script=\"Phag\" typeface=\"Phagspa\"/>\n        <a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/>\n        <a:font script=\"Sora\" typeface=\"Nirmala UI\"/>\n        <a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/>\n        <a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/>\n        <a:font script=\"Tfng\" typeface=\"Ebrima\"/>\n      </a:minorFont>\n    </a:fontScheme>\n    <a:fmtScheme name=\"Office\">\n      <a:fillStyleLst>\n        <a:solidFill>\n          <a:schemeClr val=\"phClr\"/>\n        </a:solidFill>\n        <a:gradFill rotWithShape=\"1\">\n          <a:gsLst>\n            <a:gs pos=\"0\">\n              <a:schemeClr val=\"phClr\">\n                <a:lumMod val=\"110000\"/>\n                <a:satMod val=\"105000\"/>\n                <a:tint val=\"67000\"/>\n              </a:schemeClr>\n            </a:gs>\n            <a:gs pos=\"50000\">\n              <a:schemeClr val=\"phClr\">\n                <a:lumMod val=\"105000\"/>\n                <a:satMod val=\"103000\"/>\n                <a:tint val=\"73000\"/>\n              </a:schemeClr>\n            </a:gs>\n            <a:gs pos=\"100000\">\n              <a:schemeClr val=\"phClr\">\n                <a:lumMod val=\"105000\"/>\n                <a:satMod val=\"109000\"/>\n                <a:tint val=\"81000\"/>\n              </a:schemeClr>\n            </a:gs>\n          </a:gsLst>\n          <a:lin ang=\"5400000\" scaled=\"0\"/>\n        </a:gradFill>\n        <a:gradFill rotWithShape=\"1\">\n          <a:gsLst>\n            <a:gs pos=\"0\">\n              <a:schemeClr val=\"phClr\">\n                <a:satMod val=\"103000\"/>\n                <a:lumMod val=\"102000\"/>\n                <a:tint val=\"94000\"/>\n              </a:schemeClr>\n            </a:gs>\n            <a:gs pos=\"50000\">\n              <a:schemeClr val=\"phClr\">\n                <a:satMod val=\"110000\"/>\n                <a:lumMod val=\"100000\"/>\n                <a:shade val=\"100000\"/>\n              </a:schemeClr>\n            </a:gs>\n            <a:gs pos=\"100000\">\n              <a:schemeClr val=\"phClr\">\n                <a:lumMod val=\"99000\"/>\n                <a:satMod val=\"120000\"/>\n                <a:shade val=\"78000\"/>\n              </a:schemeClr>\n            </a:gs>\n          </a:gsLst>\n          <a:lin ang=\"5400000\" scaled=\"0\"/>\n        </a:gradFill>\n      </a:fillStyleLst>\n      <a:lnStyleLst>\n        <a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\n          <a:solidFill>\n            <a:schemeClr val=\"phClr\"/>\n          </a:solidFill>\n          <a:prstDash val=\"solid\"/>\n          <a:miter lim=\"800000\"/>\n        </a:ln>\n        <a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\n          <a:solidFill>\n            <a:schemeClr val=\"phClr\"/>\n          </a:solidFill>\n          <a:prstDash val=\"solid\"/>\n          <a:miter lim=\"800000\"/>\n        </a:ln>\n        <a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\n          <a:solidFill>\n            <a:schemeClr val=\"phClr\"/>\n          </a:solidFill>\n          <a:prstDash val=\"solid\"/>\n          <a:miter lim=\"800000\"/>\n        </a:ln>\n      </a:lnStyleLst>\n      <a:effectStyleLst>\n        <a:effectStyle>\n          <a:effectLst/>\n        </a:effectStyle>\n        <a:effectStyle>\n          <a:effectLst/>\n        </a:effectStyle>\n        <a:effectStyle>\n          <a:effectLst>\n            <a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\">\n              <a:srgbClr val=\"000000\">\n                <a:alpha val=\"63000\"/>\n              </a:srgbClr>\n            </a:outerShdw>\n          </a:effectLst>\n        </a:effectStyle>\n      </a:effectStyleLst>\n      <a:bgFillStyleLst>\n        <a:solidFill>\n          <a:schemeClr val=\"phClr\"/>\n        </a:solidFill>\n        <a:solidFill>\n          <a:schemeClr val=\"phClr\">\n            <a:tint val=\"95000\"/>\n            <a:satMod val=\"170000\"/>\n          </a:schemeClr>\n        </a:solidFill>\n        <a:gradFill rotWithShape=\"1\">\n          <a:gsLst>\n            <a:gs pos=\"0\">\n              <a:schemeClr val=\"phClr\">\n                <a:tint val=\"93000\"/>\n                <a:satMod val=\"150000\"/>\n                <a:shade val=\"98000\"/>\n                <a:lumMod val=\"102000\"/>\n              </a:schemeClr>\n            </a:gs>\n            <a:gs pos=\"50000\">\n              <a:schemeClr val=\"phClr\">\n                <a:tint val=\"98000\"/>\n                <a:satMod val=\"130000\"/>\n                <a:shade val=\"90000\"/>\n                <a:lumMod val=\"103000\"/>\n              </a:schemeClr>\n            </a:gs>\n            <a:gs pos=\"100000\">\n              <a:schemeClr val=\"phClr\">\n                <a:shade val=\"63000\"/>\n                <a:satMod val=\"120000\"/>\n              </a:schemeClr>\n            </a:gs>\n          </a:gsLst>\n          <a:lin ang=\"5400000\" scaled=\"0\"/>\n        </a:gradFill>\n      </a:bgFillStyleLst>\n    </a:fmtScheme>\n  </a:themeElements>\n  <a:objectDefaults/>\n  <a:extraClrSchemeLst/>\n  <a:extLst>\n    <a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\">\n      <thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{2E142A2C-CD16-42D6-873A-C26D2A0506FA}\" vid=\"{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}\"/>\n    </a:ext>\n  </a:extLst>\n</a:theme>\n"
  },
  {
    "path": "data/docx/word/webSettings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ns0:webSettings xmlns:ns0=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">\n  <ns0:allowPNG />\n  <ns0:doNotSaveAsSingleFile />\n</ns0:webSettings>"
  },
  {
    "path": "data/dzslides/template.html",
    "content": "<!DOCTYPE html>\n\n<meta charset=\"utf-8\">\n<title>The Title Of Your Presentation</title>\n\n<!-- Your Slides -->\n<!-- One section is one slide -->\n\n<section>\n    <!-- This is the first slide -->\n    <h1>My Presentation</h1>\n    <footer>by John Doe</footer>\n</section>\n\n<section>\n    <p>Some random text: But I've never been to the moon! You can see how I lived before I met you. Also Zoidberg.\n    I could if you hadn't turned on the light and shut off my stereo.</p>\n</section>\n\n<section>\n    <h3>An incremental list</h3>\n    <ul class=\"incremental\">\n      <li>Item 1\n      <li>Item 2\n      <li>Item 3\n        <ul class=\"incremental\">\n          <li> Item 3.1\n          <li> Item 3.2\n        </ul>\n    </ul>\n    <div role=\"note\">Some notes. They are only visible using onstage shell.</div>\n</section>\n\n<section>\n  <blockquote>\n    Who's brave enough to fly into something we all keep calling a death sphere?\n  </blockquote>\n  <details>\n    <p>In the onstage shell, notes scroll rather than overflow:</p>\n    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac dui eu est feugiat lacinia sit amet nec leo. Mauris eu ipsum leo. Nulla mi odio, cursus sed sollicitudin non, fringilla id magna. Suspendisse sit amet posuere elit. Maecenas iaculis, turpis a placerat imperdiet, libero lorem feugiat nisi, nec tincidunt diam nibh sit amet massa. Vestibulum quis adipiscing tellus. Maecenas sollicitudin sodales pulvinar. Donec dui ipsum, bibendum facilisis consequat interdum, tempus ut mauris. Aliquam ut dolor nec odio scelerisque bibendum quis in neque. Aliquam dui dui, pulvinar quis fermentum quis, gravida eu augue. Nunc tristique dolor a urna pulvinar bibendum. Curabitur mollis cursus neque, in scelerisque metus porta non. Donec tempor enim in nibh vestibulum et convallis nisi malesuada. Duis ut lectus sed metus venenatis porttitor id pharetra quam. Suspendisse sapien turpis, ornare in molestie et, gravida eget turpis.\n    </p>\n  </details>\n</section>\n\n<section>\n    <h2>Part two</h2>\n</section>\n\n<section>\n    <figure> <!-- Figures are used to display images and videos fullpage -->\n      <img src=\"http://placekitten.com/g/800/600\">\n      <figcaption>An image</figcaption>\n    </figure>\n    <div role=\"note\">Kittens are so cute!</div>\n</section>\n\n<section>\n    <figure> <!-- Videos are automatically played -->\n      <video src=\"http://videos-cdn.mozilla.net/brand/Mozilla_Firefox_Manifesto_v0.2_640.webm\" poster=\"http://www.mozilla.org/images/about/poster.jpg\"></video>\n      <figcaption>A video</figcaption>\n    </figure>\n</section>\n\n<section>\n    <h2>End!</h2>\n</section>\n\n<!-- Your Style -->\n<!-- Define the style of your presentation -->\n\n<!-- Maybe a font from http://www.google.com/webfonts ? -->\n<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>\n\n<style>\n  html, .view body { background-color: black; counter-reset: slideidx; }\n  body, .view section { background-color: white; border-radius: 12px }\n  /* A section is a slide. It's size is 800x600, and this will never change */\n  section, .view head > title {\n      /* The font from Google */\n      font-family: 'Oswald', arial, serif;\n      font-size: 30px;\n  }\n\n  .view section:after {\n    counter-increment: slideidx;\n    content: counter(slideidx, decimal-leading-zero);\n    position: absolute; bottom: -80px; right: 100px;\n    color: white;\n  }\n\n  .view head > title {\n    color: white;\n    text-align: center;\n    margin: 1em 0 1em 0;\n  }\n\n  h1, h2 {\n    margin-top: 200px;\n    text-align: center;\n    font-size: 80px;\n  }\n  h3 {\n    margin: 100px 0 50px 100px;\n  }\n\n  ul {\n      margin: 50px 200px;\n  }\n  li > ul {\n      margin: 15px 50px;\n  }\n\n  p {\n    margin: 75px;\n    font-size: 50px;\n  }\n\n  blockquote {\n    height: 100%;\n    background-color: black;\n    color: white;\n    font-size: 60px;\n    padding: 50px;\n  }\n  blockquote:before {\n    content: open-quote;\n  }\n  blockquote:after {\n    content: close-quote;\n  }\n\n  /* Figures are displayed full-page, with the caption\n     on top of the image/video */\n  figure {\n    background-color: black;\n    width: 100%;\n    height: 100%;\n  }\n  figure > * {\n    position: absolute;\n  }\n  figure > img, figure > video {\n    width: 100%; height: 100%;\n  }\n  figcaption {\n    margin: 70px;\n    font-size: 50px;\n  }\n\n  footer {\n    position: absolute;\n    bottom: 0;\n    width: 100%;\n    padding: 40px;\n    text-align: right;\n    background-color: #F3F4F8;\n    border-top: 1px solid #CCC;\n  }\n\n  /* Transition effect */\n  /* Feel free to change the transition effect for original\n     animations. See here:\n     https://developer.mozilla.org/en/CSS/CSS_transitions\n     How to use CSS3 Transitions: */\n  section {\n    -moz-transition: left 400ms linear 0s;\n    -webkit-transition: left 400ms linear 0s;\n    -ms-transition: left 400ms linear 0s;\n    transition: left 400ms linear 0s;\n  }\n  .view section {\n    -moz-transition: none;\n    -webkit-transition: none;\n    -ms-transition: none;\n    transition: none;\n  }\n\n  .view section[aria-selected] {\n    border: 5px red solid;\n  }\n\n  /* Before */\n  section { left: -150%; }\n  /* Now */\n  section[aria-selected] { left: 0; }\n  /* After */\n  section[aria-selected] ~ section { left: +150%; }\n\n  /* Incremental elements */\n\n  /* By default, visible */\n  .incremental > * { opacity: 1; }\n\n  /* The current item */\n  .incremental > *[aria-selected] { opacity: 1; }\n\n  /* The items to-be-selected */\n  .incremental > *[aria-selected] ~ * { opacity: 0; }\n\n  /* The progressbar, at the bottom of the slides, show the global\n     progress of the presentation. */\n  #progress-bar {\n    height: 2px;\n    background: #AAA;\n  }\n</style>\n\n<!-- {{{{ dzslides core\n#\n#\n#     __  __  __       .  __   ___  __\n#    |  \\  / /__` |    | |  \\ |__  /__`\n#    |__/ /_ .__/ |___ | |__/ |___ .__/ core :€\n#\n#\n# The following block of code is not supposed to be edited.\n# But if you want to change the behavior of these slides,\n# feel free to hack it!\n#\n-->\n\n<div id=\"progress-bar\"></div>\n\n<!-- Default Style -->\n<style>\n  * { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }\n  [role=\"note\"] { display: none; }\n  body {\n    width: 800px; height: 600px;\n    margin-left: -400px; margin-top: -300px;\n    position: absolute; top: 50%; left: 50%;\n    overflow: hidden;\n    display: none;\n  }\n  .view body {\n    position: static;\n    margin: 0; padding: 0;\n    width: 100%; height: 100%;\n    display: inline-block;\n    overflow: visible; overflow-x: hidden;\n    /* undo Dz.onresize */\n    transform: none !important;\n    -moz-transform: none !important;\n    -webkit-transform: none !important;\n    -o-transform: none !important;\n    -ms-transform: none !important;\n  }\n  .view head, .view head > title { display: block }\n  section {\n    position: absolute;\n    pointer-events: none;\n    width: 100%; height: 100%;\n  }\n  .view section {\n    pointer-events: auto;\n    position: static;\n    width: 800px; height: 600px;\n    margin: -150px -200px;\n    float: left;\n\n    transform: scale(.4);\n    -moz-transform: scale(.4);\n    -webkit-transform: scale(.4);\n    -o-transform: scale(.4);\n    -ms-transform: scale(.4);\n  }\n  .view section > * { pointer-events: none; }\n  section[aria-selected] { pointer-events: auto; }\n  html { overflow: hidden; }\n  html.view { overflow: visible; }\n  body.loaded { display: block; }\n  .incremental {visibility: hidden; }\n  .incremental[active] {visibility: visible; }\n  #progress-bar{\n    bottom: 0;\n    position: absolute;\n    -moz-transition: width 400ms linear 0s;\n    -webkit-transition: width 400ms linear 0s;\n    -ms-transition: width 400ms linear 0s;\n    transition: width 400ms linear 0s;\n  }\n  .view #progress-bar {\n    display: none;\n  }\n</style>\n\n<script>\n  var Dz = {\n    remoteWindows: [],\n    idx: -1,\n    step: 0,\n    html: null,\n    slides: null,\n    progressBar : null,\n    params: {\n      autoplay: \"1\"\n    }\n  };\n\n  Dz.init = function() {\n    document.body.className = \"loaded\";\n    this.slides = Array.prototype.slice.call($$(\"body > section\"));\n    this.progressBar = $(\"#progress-bar\");\n    this.html = document.body.parentNode;\n    this.setupParams();\n    this.onhashchange();\n    this.setupTouchEvents();\n    this.onresize();\n    this.setupView();\n  }\n\n  Dz.setupParams = function() {\n    var p = window.location.search.substr(1).split('&');\n    p.forEach(function(e, i, a) {\n      var keyVal = e.split('=');\n      Dz.params[keyVal[0]] = decodeURIComponent(keyVal[1]);\n    });\n  // Specific params handling\n    if (!+this.params.autoplay)\n      $$.forEach($$(\"video\"), function(v){ v.controls = true });\n  }\n\n  Dz.onkeydown = function(aEvent) {\n    // Don't intercept keyboard shortcuts\n    if (aEvent.altKey\n      || aEvent.ctrlKey\n      || aEvent.metaKey\n      || aEvent.shiftKey) {\n      return;\n    }\n    if ( aEvent.keyCode == 37 // left arrow\n      || aEvent.keyCode == 38 // up arrow\n      || aEvent.keyCode == 33 // page up\n    ) {\n      aEvent.preventDefault();\n      this.back();\n    }\n    if ( aEvent.keyCode == 39 // right arrow\n      || aEvent.keyCode == 40 // down arrow\n      || aEvent.keyCode == 34 // page down\n    ) {\n      aEvent.preventDefault();\n      this.forward();\n    }\n    if (aEvent.keyCode == 35) { // end\n      aEvent.preventDefault();\n      this.goEnd();\n    }\n    if (aEvent.keyCode == 36) { // home\n      aEvent.preventDefault();\n      this.goStart();\n    }\n    if (aEvent.keyCode == 32) { // space\n      aEvent.preventDefault();\n      this.toggleContent();\n    }\n    if (aEvent.keyCode == 70) { // f\n      aEvent.preventDefault();\n      this.goFullscreen();\n    }\n    if (aEvent.keyCode == 79) { // o\n      aEvent.preventDefault();\n      this.toggleView();\n    }\n  }\n\n  /* Touch Events */\n\n  Dz.setupTouchEvents = function() {\n    var orgX, newX;\n    var tracking = false;\n\n    var db = document.body;\n    db.addEventListener(\"touchstart\", start.bind(this), false);\n    db.addEventListener(\"touchmove\", move.bind(this), false);\n\n    function start(aEvent) {\n      aEvent.preventDefault();\n      tracking = true;\n      orgX = aEvent.changedTouches[0].pageX;\n    }\n\n    function move(aEvent) {\n      if (!tracking) return;\n      newX = aEvent.changedTouches[0].pageX;\n      if (orgX - newX > 100) {\n        tracking = false;\n        this.forward();\n      } else {\n        if (orgX - newX < -100) {\n          tracking = false;\n          this.back();\n        }\n      }\n    }\n  }\n\n  Dz.setupView = function() {\n    document.body.addEventListener(\"click\", function ( e ) {\n      if (!Dz.html.classList.contains(\"view\")) return;\n      if (!e.target || e.target.nodeName != \"SECTION\") return;\n\n      Dz.html.classList.remove(\"view\");\n      Dz.setCursor(Dz.slides.indexOf(e.target) + 1);\n    }, false);\n  }\n\n  /* Adapt the size of the slides to the window */\n\n  Dz.onresize = function() {\n    var db = document.body;\n    var sx = db.clientWidth / window.innerWidth;\n    var sy = db.clientHeight / window.innerHeight;\n    var transform = \"scale(\" + (1/Math.max(sx, sy)) + \")\";\n\n    db.style.MozTransform = transform;\n    db.style.WebkitTransform = transform;\n    db.style.OTransform = transform;\n    db.style.msTransform = transform;\n    db.style.transform = transform;\n  }\n\n\n  Dz.getNotes = function(aIdx) {\n    var s = $(\"section:nth-of-type(\" + aIdx + \")\");\n    var d = s.$(\"[role='note']\");\n    return d ? d.innerHTML : \"\";\n  }\n\n  Dz.onmessage = function(aEvent) {\n    var argv = aEvent.data.split(\" \"), argc = argv.length;\n    argv.forEach(function(e, i, a) { a[i] = decodeURIComponent(e) });\n    var win = aEvent.source;\n    if (argv[0] === \"REGISTER\" && argc === 1) {\n      this.remoteWindows.push(win);\n      this.postMsg(win, \"REGISTERED\", document.title, this.slides.length);\n      this.postMsg(win, \"CURSOR\", this.idx + \".\" + this.step);\n      return;\n    }\n    if (argv[0] === \"BACK\" && argc === 1)\n      this.back();\n    if (argv[0] === \"FORWARD\" && argc === 1)\n      this.forward();\n    if (argv[0] === \"START\" && argc === 1)\n      this.goStart();\n    if (argv[0] === \"END\" && argc === 1)\n      this.goEnd();\n    if (argv[0] === \"TOGGLE_CONTENT\" && argc === 1)\n      this.toggleContent();\n    if (argv[0] === \"SET_CURSOR\" && argc === 2)\n      window.location.hash = \"#\" + argv[1];\n    if (argv[0] === \"GET_CURSOR\" && argc === 1)\n      this.postMsg(win, \"CURSOR\", this.idx + \".\" + this.step);\n    if (argv[0] === \"GET_NOTES\" && argc === 1)\n      this.postMsg(win, \"NOTES\", this.getNotes(this.idx));\n  }\n\n  Dz.toggleContent = function() {\n    // If a Video is present in this new slide, play it.\n    // If a Video is present in the previous slide, stop it.\n    var s = $(\"section[aria-selected]\");\n    if (s) {\n      var video = s.$(\"video\");\n      if (video) {\n        if (video.ended || video.paused) {\n          video.play();\n        } else {\n          video.pause();\n        }\n      }\n    }\n  }\n\n  Dz.setCursor = function(aIdx, aStep) {\n    // If the user change the slide number in the URL bar, jump\n    // to this slide.\n    aStep = (aStep != 0 && typeof aStep !== \"undefined\") ? \".\" + aStep : \".0\";\n    window.location.hash = \"#\" + aIdx + aStep;\n  }\n\n  Dz.onhashchange = function() {\n    var cursor = window.location.hash.split(\"#\"),\n        newidx = 1,\n        newstep = 0;\n    if (cursor.length == 2) {\n      newidx = ~~cursor[1].split(\".\")[0];\n      newstep = ~~cursor[1].split(\".\")[1];\n      if (newstep > Dz.slides[newidx - 1].$$('.incremental > *').length) {\n        newstep = 0;\n        newidx++;\n      }\n    }\n    this.setProgress(newidx, newstep);\n    if (newidx != this.idx) {\n      this.setSlide(newidx);\n    }\n    if (newstep != this.step) {\n      this.setIncremental(newstep);\n    }\n    for (var i = 0; i < this.remoteWindows.length; i++) {\n      this.postMsg(this.remoteWindows[i], \"CURSOR\", this.idx + \".\" + this.step);\n    }\n  }\n\n  Dz.back = function() {\n    if (this.idx == 1 && this.step == 0) {\n      return;\n    }\n    if (this.step == 0) {\n      this.setCursor(this.idx - 1,\n                     this.slides[this.idx - 2].$$('.incremental > *').length);\n    } else {\n      this.setCursor(this.idx, this.step - 1);\n    }\n  }\n\n  Dz.forward = function() {\n    if (this.idx >= this.slides.length &&\n        this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {\n        return;\n    }\n    if (this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {\n      this.setCursor(this.idx + 1, 0);\n    } else {\n      this.setCursor(this.idx, this.step + 1);\n    }\n  }\n\n  Dz.goStart = function() {\n    this.setCursor(1, 0);\n  }\n\n  Dz.goEnd = function() {\n    var lastIdx = this.slides.length;\n    var lastStep = this.slides[lastIdx - 1].$$('.incremental > *').length;\n    this.setCursor(lastIdx, lastStep);\n  }\n\n  Dz.toggleView = function() {\n    this.html.classList.toggle(\"view\");\n\n    if (this.html.classList.contains(\"view\")) {\n      $(\"section[aria-selected]\").scrollIntoView(true);\n    }\n  }\n\n  Dz.setSlide = function(aIdx) {\n    this.idx = aIdx;\n    var old = $(\"section[aria-selected]\");\n    var next = $(\"section:nth-of-type(\"+ this.idx +\")\");\n    if (old) {\n      old.removeAttribute(\"aria-selected\");\n      var video = old.$(\"video\");\n      if (video) {\n        video.pause();\n      }\n    }\n    if (next) {\n      next.setAttribute(\"aria-selected\", \"true\");\n      if (this.html.classList.contains(\"view\")) {\n        next.scrollIntoView();\n      }\n      var video = next.$(\"video\");\n      if (video && !!+this.params.autoplay) {\n        video.play();\n      }\n    } else {\n      // That should not happen\n      this.idx = -1;\n      // console.warn(\"Slide doesn't exist.\");\n    }\n  }\n\n  Dz.setIncremental = function(aStep) {\n    this.step = aStep;\n    var old = this.slides[this.idx - 1].$('.incremental > *[aria-selected]');\n    if (old) {\n      old.removeAttribute('aria-selected');\n    }\n    var incrementals = $$('.incremental');\n    if (this.step <= 0) {\n      $$.forEach(incrementals, function(aNode) {\n        aNode.removeAttribute('active');\n      });\n      return;\n    }\n    var next = this.slides[this.idx - 1].$$('.incremental > *')[this.step - 1];\n    if (next) {\n      next.setAttribute('aria-selected', true);\n      next.parentNode.setAttribute('active', true);\n      var found = false;\n      $$.forEach(incrementals, function(aNode) {\n        if (aNode != next.parentNode)\n          if (found)\n            aNode.removeAttribute('active');\n          else\n            aNode.setAttribute('active', true);\n        else\n          found = true;\n      });\n    } else {\n      setCursor(this.idx, 0);\n    }\n    return next;\n  }\n\n  Dz.goFullscreen = function() {\n    var html = $('html'),\n        requestFullscreen = html.requestFullscreen || html.requestFullScreen || html.mozRequestFullScreen || html.webkitRequestFullScreen;\n    if (requestFullscreen) {\n      requestFullscreen.apply(html);\n    }\n  }\n  \n  Dz.setProgress = function(aIdx, aStep) {\n    var slide = $(\"section:nth-of-type(\"+ aIdx +\")\");\n    if (!slide)\n      return;\n    var steps = slide.$$('.incremental > *').length + 1,\n        slideSize = 100 / (this.slides.length - 1),\n        stepSize = slideSize / steps;\n    this.progressBar.style.width = ((aIdx - 1) * slideSize + aStep * stepSize) + '%';\n  }\n  \n  Dz.postMsg = function(aWin, aMsg) { // [arg0, [arg1...]]\n    aMsg = [aMsg];\n    for (var i = 2; i < arguments.length; i++)\n      aMsg.push(encodeURIComponent(arguments[i]));\n    aWin.postMessage(aMsg.join(\" \"), \"*\");\n  }\n  \n  function init() {\n    Dz.init();\n    window.onkeydown = Dz.onkeydown.bind(Dz);\n    window.onresize = Dz.onresize.bind(Dz);\n    window.onhashchange = Dz.onhashchange.bind(Dz);\n    window.onmessage = Dz.onmessage.bind(Dz);\n  }\n\n  window.onload = init;\n</script>\n\n\n<script> // Helpers\n  if (!Function.prototype.bind) {\n    Function.prototype.bind = function (oThis) {\n\n      // closest thing possible to the ECMAScript 5 internal IsCallable\n      // function \n      if (typeof this !== \"function\")\n      throw new TypeError(\n        \"Function.prototype.bind - what is trying to be fBound is not callable\"\n      );\n\n      var aArgs = Array.prototype.slice.call(arguments, 1),\n          fToBind = this,\n          fNOP = function () {},\n          fBound = function () {\n            return fToBind.apply( this instanceof fNOP ? this : oThis || window,\n                   aArgs.concat(Array.prototype.slice.call(arguments)));\n          };\n\n      fNOP.prototype = this.prototype;\n      fBound.prototype = new fNOP();\n\n      return fBound;\n    };\n  }\n\n  var $ = (HTMLElement.prototype.$ = function(aQuery) {\n    return this.querySelector(aQuery);\n  }).bind(document);\n\n  var $$ = (HTMLElement.prototype.$$ = function(aQuery) {\n    return this.querySelectorAll(aQuery);\n  }).bind(document);\n\n  $$.forEach = function(nodeList, fun) {\n    Array.prototype.forEach.call(nodeList, fun);\n  }\n\n</script>\n<!-- vim: set fdm=marker: }}} -->\n"
  },
  {
    "path": "data/epub.css",
    "content": "/* This defines styles and classes used in the book */\n@page {\n  margin: 10px;\n}\nhtml, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,\nblockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,\nins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,\nfieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,\narticle, aside, canvas, details, embed, figure, figcaption, footer, header,\nhgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, ol,\nul, li, dl, dt, dd {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  font-size: 100%;\n  vertical-align: baseline;\n}\nhtml {\n  line-height: 1.2;\n  font-family: Georgia, serif;\n  color: #1a1a1a;\n}\np {\n  text-indent: 0;\n  margin: 1em 0;\n  widows: 2;\n  orphans: 2;\n}\nimg {\n  max-width: 100%;\n}\nsup {\n  vertical-align: super;\n  font-size: smaller;\n}\nsub {\n  vertical-align: sub;\n  font-size: smaller;\n}\nh1 {\n  margin: 3em 0 0 0;\n  font-size: 2em;\n  page-break-before: always;\n  line-height: 150%;\n}\nh2 {\n  margin: 1.5em 0 0 0;\n  font-size: 1.5em;\n  line-height: 135%;\n}\nh3 {\n  margin: 1.3em 0 0 0;\n  font-size: 1.3em;\n}\nh4 {\n  margin: 1.2em 0 0 0;\n  font-size: 1.2em;\n}\nh5 {\n  margin: 1.1em 0 0 0;\n  font-size: 1.1em;\n}\nh6 {\n  font-size: 1em;\n}\nh1, h2, h3, h4, h5, h6 {\n  text-indent: 0;\n  text-align: left;\n  font-weight: bold;\n  page-break-after: avoid;\n  page-break-inside: avoid;\n}\n\nol, ul {\n  margin: 1em 0 0 1.7em;\n}\nli > ol, li > ul {\n  margin-top: 0;\n}\nblockquote {\n  margin: 1em 0 1em 1.7em;\n}\ncode {\n  font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;\n  font-size: 85%;\n  margin: 0;\n  hyphens: manual;\n}\npre {\n  margin: 1em 0;\n  overflow: auto;\n}\npre code {\n  padding: 0;\n  overflow: visible;\n  overflow-wrap: normal;\n}\n.sourceCode {\n  background-color: transparent;\n  overflow: visible;\n}\nhr {\n  background-color: #1a1a1a;\n  border: none;\n  height: 1px;\n  margin: 1em 0;\n}\ntable {\n  margin: 1em 0;\n  border-collapse: collapse;\n  width: 100%;\n  overflow-x: auto;\n  display: block;\n}\ntable caption {\n  margin-bottom: 0.75em;\n}\ntbody {\n  margin-top: 0.5em;\n  border-top: 1px solid #1a1a1a;\n  border-bottom: 1px solid #1a1a1a;\n}\nth, td {\n  padding: 0.25em 0.5em 0.25em 0.5em;\n}\nth {\n  border-top: 1px solid #1a1a1a;\n}\nheader {\n  margin-bottom: 4em;\n  text-align: center;\n}\n#TOC li {\n  list-style: none;\n}\n#TOC ul {\n  padding-left: 1.3em;\n}\n#TOC > ul {\n  padding-left: 0;\n}\n#TOC a:not(:hover) {\n  text-decoration: none;\n}\ncode {\n  white-space: pre-wrap;\n}\nspan.smallcaps {\n  font-variant: small-caps;\n}\n\n/* This is the most compatible CSS, but it only allows two columns: */\ndiv.column {\n  display: inline-block;\n  vertical-align: top;\n  width: 50%;\n}\n/* If you can rely on CSS3 support, use this instead: */\n/* div.columns {\n  display: flex;\n  gap: min(4vw, 1.5em);\n}\ndiv.column {\n  flex: auto;\n  overflow-x: auto;\n} */\n\ndiv.hanging-indent {\n  margin-left: 1.5em;\n  text-indent: -1.5em;\n}\nul.task-list {\n  list-style: none;\n}\nul.task-list li input[type=\"checkbox\"] {\n  width: 0.8em;\n  margin: 0 0.8em 0.2em -1.6em;\n  vertical-align: middle;\n}\n.display.math {\n  display: block;\n  text-align: center;\n  margin: 0.5rem auto;\n}\n\n/* For title, author, and date on the cover page */\nh1.title { }\np.author { }\np.date { }\n\nnav#toc ol, nav#landmarks ol {\n  padding: 0;\n  margin-left: 1em;\n}\nnav#toc ol li, nav#landmarks ol li {\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n}\na.footnote-ref {\n  vertical-align: super;\n}\nem, em em em, em em em em em {\n  font-style: italic;\n}\nem em, em em em em {\n  font-style: normal;\n}\nq {\n  quotes: \"“\" \"”\" \"‘\" \"’\";\n}\n@media screen { /* Workaround for iBooks issue; see #6242 */\n  .sourceCode {\n    overflow: visible !important;\n    white-space: pre-wrap !important;\n  }\n}\n"
  },
  {
    "path": "data/init.lua",
    "content": "-- This Lua script is run every time the Lua interpreter is started when running\n-- a Lua filter. It can be customized to load additional modules or to alter the\n-- default modules.\n"
  },
  {
    "path": "data/odt/META-INF/manifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\" manifest:version=\"1.3\">\n <manifest:file-entry manifest:full-path=\"/\" manifest:version=\"1.3\" manifest:media-type=\"application/vnd.oasis.opendocument.text\"/>\n <manifest:file-entry manifest:full-path=\"meta.xml\" manifest:media-type=\"text/xml\"/>\n <manifest:file-entry manifest:full-path=\"content.xml\" manifest:media-type=\"text/xml\"/>\n <manifest:file-entry manifest:full-path=\"manifest.rdf\" manifest:media-type=\"application/rdf+xml\"/>\n <manifest:file-entry manifest:full-path=\"styles.xml\" manifest:media-type=\"text/xml\"/>\n</manifest:manifest>\n"
  },
  {
    "path": "data/odt/content.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\" xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rpt=\"http://openoffice.org/2005/report\" xmlns:of=\"urn:oasis:names:tc:opendocument:xmlns:of:1.2\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:grddl=\"http://www.w3.org/2003/g/data-view#\" xmlns:officeooo=\"http://openoffice.org/2009/office\" xmlns:tableooo=\"http://openoffice.org/2009/table\" xmlns:drawooo=\"http://openoffice.org/2010/draw\" xmlns:calcext=\"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0\" xmlns:field=\"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0\" xmlns:formx=\"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0\" xmlns:css3t=\"http://www.w3.org/TR/css3-text/\" office:version=\"1.3\"><office:scripts/><office:font-face-decls><style:font-face style:name=\"StarSymbol\" svg:font-family=\"StarSymbol\"/><style:font-face style:name=\"Tahoma1\" svg:font-family=\"Tahoma\"/><style:font-face style:name=\"Courier New\" svg:font-family=\"&apos;Courier New&apos;\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\"/><style:font-face style:name=\"Times New Roman\" svg:font-family=\"&apos;Times New Roman&apos;\" style:font-family-generic=\"roman\" style:font-pitch=\"variable\"/><style:font-face style:name=\"Arial\" svg:font-family=\"Arial\" style:font-family-generic=\"swiss\" style:font-pitch=\"variable\"/><style:font-face style:name=\"Lucida Sans Unicode\" svg:font-family=\"&apos;Lucida Sans Unicode&apos;\" style:font-family-generic=\"system\" style:font-pitch=\"variable\"/><style:font-face style:name=\"Tahoma\" svg:font-family=\"Tahoma\" style:font-family-generic=\"system\" style:font-pitch=\"variable\"/></office:font-face-decls><office:automatic-styles><style:style style:name=\"P1\" style:family=\"paragraph\" style:parent-style-name=\"Footer\"><style:paragraph-properties fo:text-align=\"center\" style:justify-single-word=\"false\"/></style:style></office:automatic-styles><office:body><office:text><text:sequence-decls><text:sequence-decl text:display-outline-level=\"0\" text:name=\"Illustration\"/><text:sequence-decl text:display-outline-level=\"0\" text:name=\"Table\"/><text:sequence-decl text:display-outline-level=\"0\" text:name=\"Text\"/><text:sequence-decl text:display-outline-level=\"0\" text:name=\"Drawing\"/></text:sequence-decls><text:p text:style-name=\"Standard\">Hello World!</text:p></office:text></office:body></office:document-content>\n"
  },
  {
    "path": "data/odt/manifest.rdf",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <rdf:Description rdf:about=\"styles.xml\">\n    <rdf:type rdf:resource=\"http://docs.oasis-open.org/ns/office/1.2/meta/odf#StylesFile\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"\">\n    <ns0:hasPart xmlns:ns0=\"http://docs.oasis-open.org/ns/office/1.2/meta/pkg#\" rdf:resource=\"styles.xml\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"content.xml\">\n    <rdf:type rdf:resource=\"http://docs.oasis-open.org/ns/office/1.2/meta/odf#ContentFile\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"\">\n    <ns0:hasPart xmlns:ns0=\"http://docs.oasis-open.org/ns/office/1.2/meta/pkg#\" rdf:resource=\"content.xml\"/>\n  </rdf:Description>\n  <rdf:Description rdf:about=\"\">\n    <rdf:type rdf:resource=\"http://docs.oasis-open.org/ns/office/1.2/meta/pkg#Document\"/>\n  </rdf:Description>\n</rdf:RDF>\n"
  },
  {
    "path": "data/odt/meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<office:document-meta\n    xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\"\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n    xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n    xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\"\n    xmlns:ooo=\"http://openoffice.org/2004/office\"\n    xmlns:grddl=\"http://www.w3.org/2003/g/data-view#\"\n    office:version=\"1.3\">\n  <office:meta>\n    <meta:document-statistic\n      meta:table-count=\"0\" meta:image-count=\"0\" meta:object-count=\"0\"\n      meta:page-count=\"1\" meta:paragraph-count=\"2\" meta:word-count=\"3\"\n      meta:character-count=\"14\"\n      meta:non-whitespace-character-count=\"12\"/>\n    <meta:generator>Pandoc</meta:generator>\n  </office:meta>\n</office:document-meta>\n"
  },
  {
    "path": "data/odt/mimetype",
    "content": "application/vnd.oasis.opendocument.text"
  },
  {
    "path": "data/odt/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<office:document-styles xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\"\nxmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\"\nxmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"\nxmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\"\nxmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"\nxmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\"\nxmlns:xlink=\"http://www.w3.org/1999/xlink\"\nxmlns:dc=\"http://purl.org/dc/elements/1.1/\"\nxmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\"\nxmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\"\nxmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\"\nxmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\"\nxmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\"\nxmlns:math=\"http://www.w3.org/1998/Math/MathML\"\nxmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\"\nxmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\"\nxmlns:ooo=\"http://openoffice.org/2004/office\"\nxmlns:ooow=\"http://openoffice.org/2004/writer\"\nxmlns:oooc=\"http://openoffice.org/2004/calc\"\nxmlns:dom=\"http://www.w3.org/2001/xml-events\"\nxmlns:rpt=\"http://openoffice.org/2005/report\"\nxmlns:of=\"urn:oasis:names:tc:opendocument:xmlns:of:1.2\"\nxmlns:xhtml=\"http://www.w3.org/1999/xhtml\"\nxmlns:grddl=\"http://www.w3.org/2003/g/data-view#\"\nxmlns:officeooo=\"http://openoffice.org/2009/office\"\nxmlns:tableooo=\"http://openoffice.org/2009/table\"\nxmlns:drawooo=\"http://openoffice.org/2010/draw\"\nxmlns:calcext=\"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0\"\nxmlns:css3t=\"http://www.w3.org/TR/css3-text/\" office:version=\"1.3\">\n  <office:font-face-decls>\n    <style:font-face style:name=\"StarSymbol\"\n    svg:font-family=\"StarSymbol\" />\n    <style:font-face style:name=\"Tahoma1\"\n    svg:font-family=\"Tahoma\" />\n    <style:font-face style:name=\"Courier New\"\n    svg:font-family=\"'Courier New'\"\n    style:font-family-generic=\"modern\" style:font-pitch=\"fixed\" />\n    <style:font-face style:name=\"Times New Roman\"\n    svg:font-family=\"'Times New Roman'\"\n    style:font-family-generic=\"roman\"\n    style:font-pitch=\"variable\" />\n    <style:font-face style:name=\"Arial\" svg:font-family=\"Arial\"\n    style:font-family-generic=\"swiss\"\n    style:font-pitch=\"variable\" />\n    <style:font-face style:name=\"Lucida Sans Unicode\"\n    svg:font-family=\"'Lucida Sans Unicode'\"\n    style:font-family-generic=\"system\"\n    style:font-pitch=\"variable\" />\n    <style:font-face style:name=\"Tahoma\" svg:font-family=\"Tahoma\"\n    style:font-family-generic=\"system\"\n    style:font-pitch=\"variable\" />\n  </office:font-face-decls>\n  <office:styles>\n    <style:default-style style:family=\"graphic\">\n      <style:graphic-properties fo:wrap-option=\"wrap\"\n      draw:shadow-offset-x=\"0.1181in\"\n      draw:shadow-offset-y=\"0.1181in\"\n      draw:start-line-spacing-horizontal=\"0.1114in\"\n      draw:start-line-spacing-vertical=\"0.1114in\"\n      draw:end-line-spacing-horizontal=\"0.1114in\"\n      draw:end-line-spacing-vertical=\"0.1114in\"\n      style:flow-with-text=\"false\" />\n      <style:paragraph-properties style:text-autospace=\"ideograph-alpha\"\n      style:line-break=\"strict\" style:writing-mode=\"lr-tb\"\n      style:font-independent-line-spacing=\"false\">\n        <style:tab-stops />\n      </style:paragraph-properties>\n      <style:text-properties style:use-window-font-color=\"true\"\n      fo:font-size=\"12pt\" fo:language=\"en\" fo:country=\"US\"\n      style:letter-kerning=\"true\" style:font-size-asian=\"12pt\"\n      style:language-asian=\"zxx\" style:country-asian=\"none\"\n      style:font-size-complex=\"12pt\" style:language-complex=\"zxx\"\n      style:country-complex=\"none\" />\n    </style:default-style>\n    <style:style style:name=\"Author\" style:family=\"paragraph\"\n      style:parent-style-name=\"Standard\" style:class=\"html\">\n        <style:paragraph-properties fo:text-align=\"center\" />\n    </style:style>\n    <style:style style:name=\"Date\" style:family=\"paragraph\"\n      style:parent-style-name=\"Standard\" style:class=\"html\">\n        <style:paragraph-properties fo:text-align=\"center\" />\n    </style:style>\n    <style:style style:name=\"Abstract\" style:family=\"paragraph\"\n      style:parent-style-name=\"Standard\" style:class=\"html\">\n      <style:paragraph-properties fo:margin-left=\"0.3937in\"\n      fo:margin-right=\"0.3937in\" fo:margin-top=\"0.1in\"\n      fo:margin-bottom=\"0.1in\" style:contextual-spacing=\"false\"\n      fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:default-style style:family=\"paragraph\">\n      <style:paragraph-properties fo:hyphenation-ladder-count=\"no-limit\"\n      style:text-autospace=\"ideograph-alpha\"\n      style:punctuation-wrap=\"hanging\" style:line-break=\"strict\"\n      style:tab-stop-distance=\"0.4925in\"\n      style:writing-mode=\"page\" />\n      <style:text-properties style:use-window-font-color=\"true\"\n      style:font-name=\"Times New Roman\" fo:font-size=\"12pt\"\n      fo:language=\"en\" fo:country=\"US\" style:letter-kerning=\"true\"\n      style:font-name-asian=\"Lucida Sans Unicode\"\n      style:font-size-asian=\"12pt\" style:language-asian=\"zxx\"\n      style:country-asian=\"none\" style:font-name-complex=\"Tahoma\"\n      style:font-size-complex=\"12pt\" style:language-complex=\"zxx\"\n      style:country-complex=\"none\" fo:hyphenate=\"false\"\n      fo:hyphenation-remain-char-count=\"2\"\n      fo:hyphenation-push-char-count=\"2\" />\n    </style:default-style>\n    <style:default-style style:family=\"table\">\n      <style:table-properties table:border-model=\"collapsing\" />\n    </style:default-style>\n    <style:default-style style:family=\"table-row\">\n      <style:table-row-properties fo:keep-together=\"auto\" />\n    </style:default-style>\n    <style:style style:name=\"Standard\" style:family=\"paragraph\"\n    style:class=\"text\" />\n    <style:style style:name=\"Heading\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\"\n    style:next-style-name=\"Text_20_body\" style:class=\"text\">\n      <style:paragraph-properties fo:margin-top=\"0.1665in\"\n      fo:margin-bottom=\"0.0835in\" style:contextual-spacing=\"false\"\n      fo:keep-with-next=\"always\" />\n      <style:text-properties style:font-name=\"Arial\"\n      fo:font-size=\"14pt\"\n      style:font-name-asian=\"Lucida Sans Unicode\"\n      style:font-size-asian=\"14pt\" style:font-name-complex=\"Tahoma\"\n      style:font-size-complex=\"14pt\" />\n    </style:style>\n    <style:style style:name=\"Text_20_body\"\n    style:display-name=\"Text body\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"text\">\n      <style:paragraph-properties fo:margin-top=\"0.0598in\"\n      fo:margin-bottom=\"0.0598in\"\n      style:contextual-spacing=\"false\" />\n    </style:style>\n    <style:style style:name=\"List\" style:family=\"paragraph\"\n    style:parent-style-name=\"Text_20_body\" style:class=\"list\">\n      <style:text-properties style:font-name-complex=\"Tahoma1\" />\n    </style:style>\n    <style:style style:name=\"Caption\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"extra\">\n      <style:paragraph-properties fo:margin-top=\"0.0835in\"\n      fo:margin-bottom=\"0.0835in\" style:contextual-spacing=\"false\"\n      text:number-lines=\"false\" text:line-number=\"0\" />\n      <style:text-properties fo:font-size=\"12pt\"\n      fo:font-style=\"italic\" style:font-size-asian=\"12pt\"\n      style:font-style-asian=\"italic\"\n      style:font-name-complex=\"Tahoma1\"\n      style:font-size-complex=\"12pt\"\n      style:font-style-complex=\"italic\" />\n    </style:style>\n    <style:style style:name=\"TableCaption\" style:family=\"paragraph\"\n    style:parent-style-name=\"Caption\" style:class=\"extra\">\n    </style:style>\n    <style:style style:name=\"Table\" style:family=\"paragraph\"\n    style:parent-style-name=\"Caption\" style:class=\"extra\">\n    </style:style>\n    <style:style style:name=\"FigureCaption\" style:family=\"paragraph\"\n    style:parent-style-name=\"Caption\" style:class=\"extra\">\n    </style:style>\n    <style:style style:name=\"Figure\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"extra\">\n      <style:paragraph-properties text:number-lines=\"false\"\n      text:line-number=\"0\" />\n    </style:style>\n    <style:style style:name=\"FigureWithCaption\" style:family=\"paragraph\"\n    style:parent-style-name=\"Figure\" style:class=\"extra\">\n      <style:paragraph-properties text:number-lines=\"false\"\n      text:line-number=\"0\" fo:keep-with-next=\"always\" />\n    </style:style>\n    <style:style style:name=\"Index\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"index\">\n      <style:paragraph-properties text:number-lines=\"false\"\n      text:line-number=\"0\" />\n      <style:text-properties style:font-name-complex=\"Tahoma1\" />\n    </style:style>\n    <style:style style:name=\"Heading_20_1\"\n    style:display-name=\"Heading 1\" style:family=\"paragraph\"\n    style:parent-style-name=\"Heading\"\n    style:next-style-name=\"Text_20_body\"\n    style:default-outline-level=\"1\" style:class=\"text\">\n      <style:text-properties fo:font-size=\"115%\"\n      fo:font-weight=\"bold\" style:font-size-asian=\"115%\"\n      style:font-weight-asian=\"bold\" style:font-size-complex=\"115%\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Heading_20_2\"\n    style:display-name=\"Heading 2\" style:family=\"paragraph\"\n    style:parent-style-name=\"Heading\"\n    style:next-style-name=\"Text_20_body\"\n    style:default-outline-level=\"2\" style:class=\"text\">\n      <style:text-properties fo:font-size=\"14pt\"\n      fo:font-style=\"italic\" fo:font-weight=\"bold\"\n      style:font-size-asian=\"14pt\" style:font-style-asian=\"italic\"\n      style:font-weight-asian=\"bold\" style:font-size-complex=\"14pt\"\n      style:font-style-complex=\"italic\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Heading_20_3\"\n    style:display-name=\"Heading 3\" style:family=\"paragraph\"\n    style:parent-style-name=\"Heading\"\n    style:next-style-name=\"Text_20_body\"\n    style:default-outline-level=\"3\" style:class=\"text\">\n      <style:text-properties fo:font-size=\"14pt\"\n      fo:font-weight=\"bold\" style:font-size-asian=\"14pt\"\n      style:font-weight-asian=\"bold\" style:font-size-complex=\"14pt\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Heading_20_4\"\n    style:display-name=\"Heading 4\" style:family=\"paragraph\"\n    style:parent-style-name=\"Heading\"\n    style:next-style-name=\"Text_20_body\"\n    style:default-outline-level=\"4\" style:class=\"text\">\n      <style:text-properties fo:font-size=\"85%\"\n      fo:font-style=\"italic\" fo:font-weight=\"bold\"\n      style:font-size-asian=\"85%\" style:font-style-asian=\"italic\"\n      style:font-weight-asian=\"bold\" style:font-size-complex=\"85%\"\n      style:font-style-complex=\"italic\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Heading_20_5\"\n    style:display-name=\"Heading 5\" style:family=\"paragraph\"\n    style:parent-style-name=\"Heading\"\n    style:next-style-name=\"Text_20_body\"\n    style:default-outline-level=\"5\" style:class=\"text\">\n      <style:text-properties fo:font-size=\"85%\"\n      fo:font-weight=\"bold\" style:font-size-asian=\"85%\"\n      style:font-weight-asian=\"bold\" style:font-size-complex=\"85%\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Heading_20_6\"\n    style:display-name=\"Heading 6\" style:family=\"paragraph\"\n    style:parent-style-name=\"Heading\"\n    style:next-style-name=\"Text_20_body\"\n    style:default-outline-level=\"6\" style:class=\"text\">\n      <style:text-properties fo:font-size=\"75%\"\n      fo:font-weight=\"bold\" style:font-size-asian=\"75%\"\n      style:font-weight-asian=\"bold\" style:font-size-complex=\"75%\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Quotations\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"html\">\n      <style:paragraph-properties fo:margin-left=\"0.3937in\"\n      fo:margin-right=\"0.3937in\" fo:margin-top=\"0.1in\"\n      fo:margin-bottom=\"0.1in\" style:contextual-spacing=\"false\"\n      fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"Preformatted_20_Text\"\n    style:display-name=\"Preformatted Text\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"html\">\n      <style:paragraph-properties fo:margin-top=\"0in\"\n      fo:margin-bottom=\"0in\" style:contextual-spacing=\"false\" />\n      <style:text-properties style:font-name=\"Courier New\"\n      fo:font-family=\"&apos;Courier New&apos;\"\n      style:font-family-generic=\"modern\"\n      style:font-pitch=\"fixed\"\n      fo:font-size=\"10pt\"\n      style:font-name-asian=\"Courier New\"\n      style:font-family-asian=\"&apos;Courier New&apos;\"\n      style:font-family-generic-asian=\"modern\"\n      style:font-pitch-asian=\"fixed\"\n      style:font-size-asian=\"10pt\"\n      style:font-name-complex=\"Courier New\"\n      style:font-family-complex=\"&apos;Courier New&apos;\"\n      style:font-family-generic-complex=\"modern\"\n      style:font-pitch-complex=\"fixed\"\n      style:font-size-complex=\"10pt\"\n      fo:language=\"zxx\" />\n    </style:style>\n    <style:style style:name=\"Source_20_Text\" style:display-name=\"Source Text\" style:family=\"text\">\n      <style:text-properties style:font-name=\"Courier New\"\n      fo:font-family=\"&apos;Courier New&apos;\"\n      style:font-family-generic=\"modern\"\n      style:font-pitch=\"fixed\"\n      style:font-name-asian=\"Courier New\"\n      style:font-family-asian=\"&apos;Courier New&apos;\"\n      style:font-family-generic-asian=\"modern\"\n      style:font-pitch-asian=\"fixed\"\n      style:font-name-complex=\"Courier New\"\n      style:font-family-complex=\"&apos;Courier New&apos;\"\n      style:font-family-generic-complex=\"modern\"\n      style:font-pitch-complex=\"fixed\"\n      fo:language=\"zxx\" />\n    </style:style>\n    <style:style style:name=\"Highlighted\" style:family=\"text\">\n      <style:text-properties fo:background-color=\"#ffff38\" />\n    </style:style>\n    <style:style style:name=\"Definition_20_Term\"\n    style:display-name=\"Definition Term\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\"\n    style:next-style-name=\"Definition_20_Definition\">\n      <style:paragraph-properties fo:margin-top=\"0.0598in\"\n      fo:margin-bottom=\"0.0598in\"\n      style:contextual-spacing=\"false\" />\n    </style:style>\n    <style:style style:name=\"Definition_20_Definition\"\n    style:display-name=\"Definition Definition\"\n    style:family=\"paragraph\" style:parent-style-name=\"Standard\"\n    style:next-style-name=\"Text_20_body\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\"\n      fo:margin-right=\"0in\" fo:text-indent=\"0in\"\n      style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"Table_20_Contents\"\n    style:display-name=\"Table Contents\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"extra\">\n      <style:paragraph-properties fo:margin-left=\"0.0299in\"\n      fo:margin-right=\"0.0299in\" fo:text-indent=\"0in\"\n      style:auto-text-indent=\"false\" text:number-lines=\"false\"\n      text:line-number=\"0\" />\n    </style:style>\n    <style:style style:name=\"Table_20_Heading\"\n    style:display-name=\"Table Heading\" style:family=\"paragraph\"\n    style:parent-style-name=\"Table_20_Contents\"\n    style:class=\"extra\">\n      <style:paragraph-properties fo:margin-left=\"0.0299in\"\n      fo:margin-right=\"0.0299in\" fo:text-align=\"start\"\n      style:justify-single-word=\"false\" fo:text-indent=\"0in\"\n      style:auto-text-indent=\"false\" style:shadow=\"none\"\n      text:number-lines=\"false\" text:line-number=\"0\" />\n      <style:text-properties fo:font-weight=\"bold\"\n      style:font-weight-asian=\"bold\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Footnote\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"extra\">\n      <style:paragraph-properties fo:margin-left=\"0.1965in\"\n      fo:margin-right=\"0in\" fo:text-indent=\"-0.1965in\"\n      style:auto-text-indent=\"false\" text:number-lines=\"false\"\n      text:line-number=\"0\" />\n      <style:text-properties fo:font-size=\"10pt\"\n      style:font-size-asian=\"10pt\"\n      style:font-size-complex=\"10pt\" />\n    </style:style>\n    <style:style style:name=\"Footer\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\" style:class=\"extra\">\n      <style:paragraph-properties text:number-lines=\"false\"\n      text:line-number=\"0\">\n        <style:tab-stops>\n          <style:tab-stop style:position=\"3.25in\"\n          style:type=\"center\" />\n          <style:tab-stop style:position=\"6.5in\"\n          style:type=\"right\" />\n        </style:tab-stops>\n      </style:paragraph-properties>\n    </style:style>\n    <style:style style:name=\"Definition_20_Term_20_Tight\"\n    style:display-name=\"Definition Term Tight\"\n    style:family=\"paragraph\" style:parent-style-name=\"Standard\"\n    style:next-style-name=\"Definition_20_Definition_20_Tight\">\n      <style:paragraph-properties fo:margin-top=\"0.0799in\"\n      fo:margin-bottom=\"0.0799in\"\n      style:contextual-spacing=\"false\" />\n    </style:style>\n    <style:style style:name=\"Definition_20_Definition_20_Tight\"\n    style:display-name=\"Definition Definition Tight\"\n    style:family=\"paragraph\" style:parent-style-name=\"Standard\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\"\n      fo:margin-right=\"0in\" fo:margin-top=\"0in\"\n      fo:margin-bottom=\"0in\" style:contextual-spacing=\"false\"\n      fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"Horizontal_20_Line\"\n    style:display-name=\"Horizontal Line\" style:family=\"paragraph\"\n    style:parent-style-name=\"Standard\"\n    style:next-style-name=\"Text_20_body\" style:class=\"html\">\n      <style:paragraph-properties fo:margin-top=\"0in\"\n      fo:margin-bottom=\"0.1965in\" style:contextual-spacing=\"false\"\n      style:border-line-width-bottom=\"0.0008in 0.0138in 0.0008in\"\n      fo:padding=\"0in\" fo:border-left=\"none\" fo:border-right=\"none\"\n      fo:border-top=\"none\" fo:border-bottom=\"1.11pt double #808080\"\n      text:number-lines=\"false\" text:line-number=\"0\"\n      style:join-border=\"false\" />\n      <style:text-properties fo:font-size=\"6pt\"\n      style:font-size-asian=\"6pt\" style:font-size-complex=\"6pt\" />\n    </style:style>\n    <style:style style:name=\"First_20_paragraph\"\n    style:display-name=\"First paragraph\" style:family=\"paragraph\"\n    style:parent-style-name=\"Text_20_body\"\n    style:next-style-name=\"Text_20_body\" style:class=\"text\" />\n    <style:style style:name=\"Numbering_20_Symbols\"\n    style:display-name=\"Numbering Symbols\" style:family=\"text\" />\n    <style:style style:name=\"Bullet_20_Symbols\"\n    style:display-name=\"Bullet Symbols\" style:family=\"text\">\n      <style:text-properties style:font-name=\"StarSymbol\"\n      fo:font-size=\"9pt\" style:font-name-asian=\"StarSymbol\"\n      style:font-size-asian=\"9pt\"\n      style:font-name-complex=\"StarSymbol\"\n      style:font-size-complex=\"9pt\" />\n    </style:style>\n    <style:style style:name=\"Emphasis\" style:family=\"text\">\n      <style:text-properties fo:font-style=\"italic\"\n      style:font-style-asian=\"italic\"\n      style:font-style-complex=\"italic\" />\n    </style:style>\n    <style:style style:name=\"Strong_20_Emphasis\"\n    style:display-name=\"Strong Emphasis\" style:family=\"text\">\n      <style:text-properties fo:font-weight=\"bold\"\n      style:font-weight-asian=\"bold\"\n      style:font-weight-complex=\"bold\" />\n    </style:style>\n    <style:style style:name=\"Strikeout\" style:family=\"text\">\n      <style:text-properties style:text-line-through-style=\"solid\" />\n    </style:style>\n    <style:style style:name=\"Superscript\" style:family=\"text\">\n      <style:text-properties style:text-position=\"super 58%\" />\n    </style:style>\n    <style:style style:name=\"Subscript\" style:family=\"text\">\n      <style:text-properties style:text-position=\"sub 58%\" />\n    </style:style>\n    <style:style style:name=\"Citation\" style:family=\"text\">\n      <style:text-properties fo:font-style=\"italic\"\n      style:font-style-asian=\"italic\"\n      style:font-style-complex=\"italic\" />\n    </style:style>\n    <style:style style:name=\"Teletype\" style:family=\"text\">\n      <style:text-properties style:font-name=\"Courier New\"\n      style:font-name-asian=\"Courier New\"\n      style:font-name-complex=\"Courier New\" />\n    </style:style>\n\n    <style:style style:name=\"Internet_20_link\"\n    style:display-name=\"Internet link\" style:family=\"text\">\n      <style:text-properties fo:color=\"#000080\"\n      style:text-underline-style=\"solid\"\n      style:text-underline-width=\"auto\"\n      style:text-underline-color=\"font-color\" />\n    </style:style>\n    <style:style style:name=\"Footnote_20_Symbol\"\n    style:display-name=\"Footnote Symbol\" style:family=\"text\" />\n    <style:style style:name=\"Footnote_20_anchor\"\n    style:display-name=\"Footnote anchor\" style:family=\"text\">\n      <style:text-properties style:text-position=\"super 58%\" />\n    </style:style>\n    <style:style style:name=\"Definition\" style:family=\"text\" />\n    <text:outline-style style:name=\"Outline\">\n      <text:outline-level-style text:level=\"1\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"2\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"3\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"4\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"5\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"6\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"7\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"8\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"9\" style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n      <text:outline-level-style text:level=\"10\"\n      style:num-format=\"\">\n        <style:list-level-properties text:min-label-distance=\"0.15in\" />\n      </text:outline-level-style>\n    </text:outline-style>\n    <text:list-style style:name=\"Numbering_20_1\"\n    style:display-name=\"Numbering 1\">\n      <text:list-level-style-number text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"0.1972in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"0.3937in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"0.5909in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"0.7874in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"0.9846in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"1.1815in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"1.3787in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"1.5752in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:space-before=\"1.7724in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"Numbering_20_2\"\n    style:display-name=\"Numbering 2\">\n      <text:list-level-style-number text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\">\n        <style:list-level-properties text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"2\">\n        <style:list-level-properties text:space-before=\"0.1965in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"3\">\n        <style:list-level-properties text:space-before=\"0.3929in\"\n        text:min-label-width=\"0.3937in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"4\">\n        <style:list-level-properties text:space-before=\"0.7866in\"\n        text:min-label-width=\"0.4925in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"5\">\n        <style:list-level-properties text:space-before=\"1.2791in\"\n        text:min-label-width=\"0.5902in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"6\">\n        <style:list-level-properties text:space-before=\"1.8693in\"\n        text:min-label-width=\"0.7091in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"7\">\n        <style:list-level-properties text:space-before=\"2.5783in\"\n        text:min-label-width=\"0.9055in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"8\">\n        <style:list-level-properties text:space-before=\"3.4839in\"\n        text:min-label-width=\"1.0236in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"9\">\n        <style:list-level-properties text:space-before=\"4.5075in\"\n        text:min-label-width=\"1.1028in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"10\">\n        <style:list-level-properties text:space-before=\"5.6102in\"\n        text:min-label-width=\"1.2209in\" />\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"Numbering_20_3\"\n    style:display-name=\"Numbering 3\">\n      <text:list-level-style-number text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\">\n        <style:list-level-properties text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"2\">\n        <style:list-level-properties text:space-before=\"1.1815in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"3\">\n        <style:list-level-properties text:space-before=\"2.3626in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"4\">\n        <style:list-level-properties text:space-before=\"3.5441in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"5\">\n        <style:list-level-properties text:space-before=\"4.7252in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"6\">\n        <style:list-level-properties text:space-before=\"5.9063in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"7\">\n        <style:list-level-properties text:space-before=\"7.0878in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"8\">\n        <style:list-level-properties text:space-before=\"8.2689in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"9\">\n        <style:list-level-properties text:space-before=\"9.45in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\"\n      text:start-value=\"10\">\n        <style:list-level-properties text:space-before=\"10.6315in\"\n        text:min-label-width=\"1.1811in\" />\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"Numbering_20_4\"\n    style:display-name=\"Numbering 4\">\n      <text:list-level-style-number text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\">\n        <style:list-level-properties text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"2\">\n        <style:list-level-properties text:space-before=\"0.1972in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"3\">\n        <style:list-level-properties text:space-before=\"0.3937in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"4\">\n        <style:list-level-properties text:space-before=\"0.5909in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"5\">\n        <style:list-level-properties text:space-before=\"0.7874in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"6\">\n        <style:list-level-properties text:space-before=\"0.9846in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"7\">\n        <style:list-level-properties text:space-before=\"1.1815in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"8\">\n        <style:list-level-properties text:space-before=\"1.3787in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"9\">\n        <style:list-level-properties text:space-before=\"1.5752in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"I\" text:start-value=\"10\">\n        <style:list-level-properties text:space-before=\"1.7724in\"\n        text:min-label-width=\"0.1965in\" />\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"Numbering_20_5\"\n    style:display-name=\"Numbering 5\">\n      <text:list-level-style-number text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\">\n        <style:list-level-properties text:min-label-width=\"0.1575in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\".\"\n      style:num-format=\"1\" text:start-value=\"2\"\n      text:display-levels=\"2\">\n        <style:list-level-properties text:space-before=\"0.1772in\"\n        text:min-label-width=\"0.2563in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" style:num-suffix=\")\"\n      style:num-format=\"a\" text:start-value=\"3\">\n        <style:list-level-properties text:space-before=\"0.4331in\"\n        text:min-label-width=\"0.1772in\" />\n      </text:list-level-style-number>\n      <text:list-level-style-bullet text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.6319in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.7874in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.9429in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.0988in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.2543in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.4098in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.5654in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"List_20_1\"\n    style:display-name=\"List 1\">\n      <text:list-level-style-bullet text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.1579in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.3146in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.4724in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.6299in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.7878in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"0.9445in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.1024in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.2598in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"•\">\n        <style:list-level-properties text:space-before=\"1.4177in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"List_20_2\"\n    style:display-name=\"List 2\">\n      <text:list-level-style-bullet text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.1181in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.2362in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.3539in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.472in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.5902in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.7091in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.8272in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"0.9453in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"–\">\n        <style:list-level-properties text:space-before=\"1.063in\"\n        text:min-label-width=\"0.1181in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"List_20_3\"\n    style:display-name=\"List 3\">\n      <text:list-level-style-bullet text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"☑\">\n        <style:list-level-properties text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"□\">\n        <style:list-level-properties text:space-before=\"0.1555in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"☑\">\n        <style:list-level-properties text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"□\">\n        <style:list-level-properties text:space-before=\"0.1555in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"☑\">\n        <style:list-level-properties text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"□\">\n        <style:list-level-properties text:space-before=\"0.1555in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"☑\">\n        <style:list-level-properties text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"□\">\n        <style:list-level-properties text:space-before=\"0.1555in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"☑\">\n        <style:list-level-properties text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"□\">\n        <style:list-level-properties text:space-before=\"0.1555in\"\n        text:min-label-width=\"0.1555in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"List_20_4\"\n    style:display-name=\"List 4\">\n      <text:list-level-style-bullet text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"➢\">\n        <style:list-level-properties text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"0.1579in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"0.3146in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"0.4724in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"0.6299in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"0.7878in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"0.9445in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"1.1024in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"1.2598in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"\">\n        <style:list-level-properties text:space-before=\"1.4177in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"List_20_5\"\n    style:display-name=\"List 5\">\n      <text:list-level-style-bullet text:level=\"1\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"0.1579in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"0.3146in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"0.4724in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"0.6299in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"0.7878in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"0.9445in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"1.1024in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"1.2598in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\"\n      text:style-name=\"Numbering_20_Symbols\" text:bullet-char=\"✗\">\n        <style:list-level-properties text:space-before=\"1.4177in\"\n        text:min-label-width=\"0.1575in\" />\n        <style:text-properties style:font-name=\"StarSymbol\" />\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:notes-configuration text:note-class=\"footnote\"\n    text:citation-style-name=\"Footnote_20_Symbol\"\n    text:citation-body-style-name=\"Footnote_20_anchor\"\n    style:num-format=\"1\" text:start-value=\"0\"\n    text:footnotes-position=\"page\"\n    text:start-numbering-at=\"document\" />\n    <text:notes-configuration text:note-class=\"endnote\"\n    style:num-format=\"i\" text:start-value=\"0\" />\n    <text:linenumbering-configuration text:number-lines=\"false\"\n    text:offset=\"0.1965in\" style:num-format=\"1\"\n    text:number-position=\"left\" text:increment=\"5\" />\n  </office:styles>\n  <office:automatic-styles>\n    <style:style style:name=\"MP1\" style:family=\"paragraph\"\n    style:parent-style-name=\"Footer\">\n      <style:paragraph-properties fo:text-align=\"center\"\n      style:justify-single-word=\"false\" />\n    </style:style>\n    <style:page-layout style:name=\"Mpm1\">\n      <style:page-layout-properties fo:page-width=\"8.5in\"\n      fo:page-height=\"11in\" style:num-format=\"1\"\n      style:print-orientation=\"portrait\" fo:margin-top=\"1in\"\n      fo:margin-bottom=\"1in\" fo:margin-left=\"1in\"\n      fo:margin-right=\"1in\" style:writing-mode=\"lr-tb\"\n      style:footnote-max-height=\"0in\">\n        <style:footnote-sep style:width=\"0.0071in\"\n        style:distance-before-sep=\"0.0398in\"\n        style:distance-after-sep=\"0.0398in\" style:line-style=\"none\"\n        style:adjustment=\"left\" style:rel-width=\"25%\"\n        style:color=\"#000000\" />\n      </style:page-layout-properties>\n      <style:header-style />\n      <style:footer-style>\n        <style:header-footer-properties fo:min-height=\"0.4in\"\n        fo:margin-left=\"0in\" fo:margin-right=\"0in\"\n        fo:margin-top=\"0.2in\" style:dynamic-spacing=\"false\" />\n      </style:footer-style>\n    </style:page-layout>\n  </office:automatic-styles>\n  <office:master-styles>\n    <style:master-page style:name=\"Standard\"\n    style:page-layout-name=\"Mpm1\">\n      <style:footer>\n        <text:p text:style-name=\"MP1\">\n          <text:page-number text:select-page=\"current\">\n          1</text:page-number>\n        </text:p>\n      </style:footer>\n    </style:master-page>\n  </office:master-styles>\n</office:document-styles>\n"
  },
  {
    "path": "data/pptx/[Content_Types].xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\"><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Override PartName=\"/ppt/presentation.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\"/><Override PartName=\"/ppt/slideMasters/slideMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\"/><Override PartName=\"/ppt/slides/slide1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/><Override PartName=\"/ppt/slides/slide2.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/><Override PartName=\"/ppt/slides/slide3.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/><Override PartName=\"/ppt/slides/slide4.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/><Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/><Override PartName=\"/ppt/presProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml\"/><Override PartName=\"/ppt/viewProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml\"/><Override PartName=\"/ppt/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/><Override PartName=\"/ppt/tableStyles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout2.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout3.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout4.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout5.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout6.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout7.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout8.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout9.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout10.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/slideLayouts/slideLayout11.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/><Override PartName=\"/ppt/theme/theme2.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/><Override PartName=\"/ppt/notesSlides/notesSlide1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/><Override PartName=\"/ppt/notesSlides/notesSlide2.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/><Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/><Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/></Types>"
  },
  {
    "path": "data/pptx/_rels/.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"ppt/presentation.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/docProps/app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\"><TotalTime>2</TotalTime><Words>49</Words><Application>Microsoft Macintosh PowerPoint</Application><PresentationFormat>On-screen Show (16:9)</PresentationFormat><Paragraphs>15</Paragraphs><Slides>4</Slides><Notes>2</Notes><HiddenSlides>0</HiddenSlides><MMClips>0</MMClips><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size=\"6\" baseType=\"variant\"><vt:variant><vt:lpstr>Fonts Used</vt:lpstr></vt:variant><vt:variant><vt:i4>2</vt:i4></vt:variant><vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant><vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant><vt:variant><vt:i4>4</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size=\"7\" baseType=\"lpstr\"><vt:lpstr>Arial</vt:lpstr><vt:lpstr>Calibri</vt:lpstr><vt:lpstr>Office Theme</vt:lpstr><vt:lpstr>Presentation Title</vt:lpstr><vt:lpstr>Slide Title</vt:lpstr><vt:lpstr>Section header</vt:lpstr><vt:lpstr>Slide Title for Two-Content</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0000</AppVersion></Properties>"
  },
  {
    "path": "data/pptx/docProps/core.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><dc:title>Title</dc:title><dc:creator>Jesse Rosenthal</dc:creator><cp:lastModifiedBy>Jesse Rosenthal</cp:lastModifiedBy><cp:revision>5</cp:revision><dcterms:created xsi:type=\"dcterms:W3CDTF\">2017-06-05T14:10:58Z</dcterms:created><dcterms:modified xsi:type=\"dcterms:W3CDTF\">2022-01-02T22:49:03Z</dcterms:modified></cp:coreProperties>\r\n"
  },
  {
    "path": "data/pptx/ppt/_rels/presentation.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId8\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\"/><Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide2.xml\"/><Relationship Id=\"rId7\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\"/><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide1.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster1.xml\"/><Relationship Id=\"rId6\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/><Relationship Id=\"rId5\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide4.xml\"/><Relationship Id=\"rId10\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\"/><Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide3.xml\"/><Relationship Id=\"rId9\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/notesMasters/_rels/notesMaster1.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme2.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/notesMasters/notesMaster1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:bg><p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Header Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"hdr\" sz=\"quarter\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"2971800\" cy=\"458788\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Date Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3884613\" y=\"0\"/><a:ext cx=\"2971800\" cy=\"458788\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle><a:lvl1pPr algn=\"r\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{0F9C1CCF-B725-44A7-AA57-5E433BD85C9F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Slide Image Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\" noRot=\"1\" noChangeAspect=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldImg\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"1143000\"/><a:ext cx=\"5486400\" cy=\"3086100\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom><a:noFill/><a:ln w=\"12700\"><a:solidFill><a:prstClr val=\"black\"/></a:solidFill></a:ln></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"ctr\"/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Notes Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" sz=\"quarter\" idx=\"3\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"4400550\"/><a:ext cx=\"5486400\" cy=\"3600450\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle/><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Footer Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"4\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"0\" y=\"8685213\"/><a:ext cx=\"2971800\" cy=\"458787\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"7\" name=\"Slide Number Placeholder 6\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"5\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3884613\" y=\"8685213\"/><a:ext cx=\"2971800\" cy=\"458787\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"r\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{18BDFEC3-8487-43E8-A154-7C12CBC1FFF2}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3782709779\"/></p:ext></p:extLst></p:cSld><p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/><p:notesStyle><a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3657600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1200\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:notesStyle></p:notesMaster>"
  },
  {
    "path": "data/pptx/ppt/notesSlides/_rels/notesSlide1.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide1.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/notesSlides/_rels/notesSlide2.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide2.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/notesSlides/notesSlide1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:notes xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Slide Image Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\" noRot=\"1\" noChangeAspect=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldImg\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"1143000\"/><a:ext cx=\"5486400\" cy=\"3086100\"/></a:xfrm></p:spPr></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Notes Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Here</a:t></a:r><a:r><a:rPr lang=\"en-US\" baseline=\"0\" dirty=\"0\"/><a:t> is a note</a:t></a:r></a:p><a:p><a:endParaRPr lang=\"en-US\" baseline=\"0\" dirty=\"0\"/></a:p><a:p><a:r><a:rPr lang=\"en-US\" baseline=\"0\" dirty=\"0\"/><a:t>With another paragraph.</a:t></a:r><a:endParaRPr lang=\"en-US\" dirty=\"0\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Slide Number Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{18BDFEC3-8487-43E8-A154-7C12CBC1FFF2}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3171319170\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>"
  },
  {
    "path": "data/pptx/ppt/notesSlides/notesSlide2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:notes xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Slide Image Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\" noRot=\"1\" noChangeAspect=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldImg\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"1143000\"/><a:ext cx=\"5486400\" cy=\"3086100\"/></a:xfrm></p:spPr></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Notes Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>A</a:t></a:r><a:r><a:rPr lang=\"en-US\" baseline=\"0\" dirty=\"0\"/><a:t> speaker note on </a:t></a:r><a:r><a:rPr lang=\"en-US\" baseline=\"0\"/><a:t>this slide too.</a:t></a:r><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Slide Number Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{18BDFEC3-8487-43E8-A154-7C12CBC1FFF2}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>2</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3016900036\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>"
  },
  {
    "path": "data/pptx/ppt/presProps.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:presentationPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:extLst><p:ext uri=\"{E76CE94A-603C-4142-B9EB-6D1370010A27}\"><p14:discardImageEditData xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"0\"/></p:ext><p:ext uri=\"{D31A062A-798A-4329-ABDD-BBA856620510}\"><p14:defaultImageDpi xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"0\"/></p:ext><p:ext uri=\"{FD5EFAAD-0ECE-453E-9831-46B23BE46B34}\"><p15:chartTrackingRefBased xmlns:p15=\"http://schemas.microsoft.com/office/powerpoint/2012/main\" val=\"0\"/></p:ext></p:extLst></p:presentationPr>"
  },
  {
    "path": "data/pptx/ppt/presentation.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" saveSubsetFonts=\"1\" autoCompressPictures=\"0\"><p:sldMasterIdLst><p:sldMasterId id=\"2147483648\" r:id=\"rId1\"/></p:sldMasterIdLst><p:notesMasterIdLst><p:notesMasterId r:id=\"rId6\"/></p:notesMasterIdLst><p:sldIdLst><p:sldId id=\"256\" r:id=\"rId2\"/><p:sldId id=\"257\" r:id=\"rId3\"/><p:sldId id=\"258\" r:id=\"rId4\"/><p:sldId id=\"259\" r:id=\"rId5\"/></p:sldIdLst><p:sldSz cx=\"9144000\" cy=\"5143500\" type=\"screen16x9\"/><p:notesSz cx=\"6858000\" cy=\"9144000\"/><p:defaultTextStyle><a:defPPr><a:defRPr lang=\"en-US\"/></a:defPPr><a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3657600\" algn=\"l\" defTabSz=\"457200\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:defaultTextStyle><p:extLst><p:ext uri=\"{EFAFB233-063F-42B5-8137-9DF3F51BA10A}\"><p15:sldGuideLst xmlns:p15=\"http://schemas.microsoft.com/office/powerpoint/2012/main\"><p15:guide id=\"1\" orient=\"horz\" pos=\"1620\" userDrawn=\"1\"><p15:clr><a:srgbClr val=\"A4A3A4\"/></p15:clr></p15:guide><p15:guide id=\"2\" pos=\"2880\" userDrawn=\"1\"><p15:clr><a:srgbClr val=\"A4A3A4\"/></p15:clr></p15:guide></p15:sldGuideLst></p:ext></p:extLst></p:presentation>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout1.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout10.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout11.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout2.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout3.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout4.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout5.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout6.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout7.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout8.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/_rels/slideLayout9.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"title\" preserve=\"1\"><p:cSld name=\"Title Slide\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ctrTitle\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"685800\" y=\"1597819\"/><a:ext cx=\"7772400\" cy=\"1102519\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Subtitle 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"subTitle\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"1371600\" y=\"2914650\"/><a:ext cx=\"6400800\" cy=\"1314450\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl9pPr></a:lstStyle><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master subtitle style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Date Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Footer Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Slide Number Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"1444357513\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout10.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"vertTx\" preserve=\"1\"><p:cSld name=\"Title and Vertical Text\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Vertical Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" orient=\"vert\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr vert=\"eaVert\"/><a:lstStyle/><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Date Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Footer Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Slide Number Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"313914798\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout11.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"vertTitleAndTx\" preserve=\"1\"><p:cSld name=\"Vertical Title and Text\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Vertical Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\" orient=\"vert\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"6629400\" y=\"205979\"/><a:ext cx=\"2057400\" cy=\"4388644\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr vert=\"eaVert\"/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Vertical Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" orient=\"vert\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"205979\"/><a:ext cx=\"6019800\" cy=\"4388644\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr vert=\"eaVert\"/><a:lstStyle/><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Date Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Footer Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Slide Number Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2581529045\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"obj\" preserve=\"1\"><p:cSld name=\"Title and Content\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Content Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Date Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Footer Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Slide Number Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"338346009\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"secHead\" preserve=\"1\"><p:cSld name=\"Section Header\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"722313\" y=\"3305176\"/><a:ext cx=\"7772400\" cy=\"1021556\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"t\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"3000\" b=\"1\" cap=\"all\"/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"722313\" y=\"2180035\"/><a:ext cx=\"7772400\" cy=\"1125140\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1350\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Date Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Footer Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Slide Number Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"1073069076\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"twoObj\" preserve=\"1\"><p:cSld name=\"Two Content\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Content Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph sz=\"half\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"1200151\"/><a:ext cx=\"4038600\" cy=\"3394472\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz=\"2100\"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz=\"1800\"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz=\"1500\"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz=\"1350\"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz=\"1350\"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz=\"1350\"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz=\"1350\"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz=\"1350\"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz=\"1350\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Content Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph sz=\"half\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"4648200\" y=\"1200151\"/><a:ext cx=\"4038600\" cy=\"3394472\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz=\"2100\"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz=\"1800\"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz=\"1500\"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz=\"1350\"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz=\"1350\"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz=\"1350\"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz=\"1350\"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz=\"1350\"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz=\"1350\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Date Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Footer Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"7\" name=\"Slide Number Placeholder 6\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2619886245\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"twoTxTwoObj\" preserve=\"1\"><p:cSld name=\"Comparison\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"1151335\"/><a:ext cx=\"4040188\" cy=\"479822\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1800\" b=\"1\"/></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\" b=\"1\"/></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1350\" b=\"1\"/></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Content Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph sz=\"half\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"1631156\"/><a:ext cx=\"4040188\" cy=\"2963466\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz=\"1800\"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz=\"1500\"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz=\"1350\"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz=\"1200\"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz=\"1200\"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz=\"1200\"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz=\"1200\"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz=\"1200\"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz=\"1200\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Text Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" sz=\"quarter\" idx=\"3\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"4645026\" y=\"1151335\"/><a:ext cx=\"4041775\" cy=\"479822\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1800\" b=\"1\"/></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\" b=\"1\"/></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1350\" b=\"1\"/></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1200\" b=\"1\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Content Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph sz=\"quarter\" idx=\"4\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"4645026\" y=\"1631156\"/><a:ext cx=\"4041775\" cy=\"2963466\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz=\"1800\"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz=\"1500\"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz=\"1350\"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz=\"1200\"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz=\"1200\"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz=\"1200\"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz=\"1200\"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz=\"1200\"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz=\"1200\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"7\" name=\"Date Placeholder 6\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"8\" name=\"Footer Placeholder 7\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"9\" name=\"Slide Number Placeholder 8\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2535793967\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout6.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"titleOnly\" preserve=\"1\"><p:cSld name=\"Title Only\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Date Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Footer Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Slide Number Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3472721253\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout7.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"blank\" preserve=\"1\"><p:cSld name=\"Blank\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Date Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Footer Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Slide Number Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2130901097\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout8.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"objTx\" preserve=\"1\"><p:cSld name=\"Content with Caption\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457201\" y=\"204787\"/><a:ext cx=\"3008313\" cy=\"871538\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1500\" b=\"1\"/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Content Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3575050\" y=\"204788\"/><a:ext cx=\"5111750\" cy=\"4389835\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz=\"2400\"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz=\"2100\"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz=\"1800\"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz=\"1500\"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz=\"1500\"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz=\"1500\"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz=\"1500\"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz=\"1500\"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz=\"1500\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Text Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" sz=\"half\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457201\" y=\"1076326\"/><a:ext cx=\"3008313\" cy=\"3518297\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"/></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\"><a:buNone/><a:defRPr sz=\"900\"/></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\"><a:buNone/><a:defRPr sz=\"750\"/></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Date Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Footer Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"7\" name=\"Slide Number Placeholder 6\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3540895647\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideLayouts/slideLayout9.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" type=\"picTx\" preserve=\"1\"><p:cSld name=\"Picture with Caption\"><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"1792288\" y=\"3600450\"/><a:ext cx=\"5486400\" cy=\"425054\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1500\" b=\"1\"/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Picture Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"pic\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"1792288\" y=\"459581\"/><a:ext cx=\"5486400\" cy=\"3086100\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\"><a:buNone/><a:defRPr sz=\"2400\"/></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\"><a:buNone/><a:defRPr sz=\"2100\"/></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1800\"/></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"/></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"/></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"/></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"/></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"/></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1500\"/></a:lvl9pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Text Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" sz=\"half\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"1792288\" y=\"4025503\"/><a:ext cx=\"5486400\" cy=\"603647\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\"><a:buNone/><a:defRPr sz=\"1050\"/></a:lvl1pPr><a:lvl2pPr marL=\"342900\" indent=\"0\"><a:buNone/><a:defRPr sz=\"900\"/></a:lvl2pPr><a:lvl3pPr marL=\"685800\" indent=\"0\"><a:buNone/><a:defRPr sz=\"750\"/></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" indent=\"0\"><a:buNone/><a:defRPr sz=\"675\"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Date Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Footer Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"7\" name=\"Slide Number Placeholder 6\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3566899855\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>"
  },
  {
    "path": "data/pptx/ppt/slideMasters/_rels/slideMaster1.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId8\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout8.xml\"/><Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout3.xml\"/><Relationship Id=\"rId7\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout7.xml\"/><Relationship Id=\"rId12\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme1.xml\"/><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout2.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout1.xml\"/><Relationship Id=\"rId6\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout6.xml\"/><Relationship Id=\"rId11\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout11.xml\"/><Relationship Id=\"rId5\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout5.xml\"/><Relationship Id=\"rId10\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout10.xml\"/><Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout4.xml\"/><Relationship Id=\"rId9\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout9.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slideMasters/slideMaster1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:bg><p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title Placeholder 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"205979\"/><a:ext cx=\"8229600\" cy=\"857250\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"ctr\"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"1200151\"/><a:ext cx=\"8229600\" cy=\"3394472\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:pPr lvl=\"0\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl=\"1\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl=\"2\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl=\"3\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl=\"4\"/><a:r><a:rPr lang=\"en-US\"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Date Placeholder 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"457200\" y=\"4767263\"/><a:ext cx=\"2133600\" cy=\"273844\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"ctr\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"900\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Footer Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"3\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3124200\" y=\"4767263\"/><a:ext cx=\"2895600\" cy=\"273844\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"ctr\"/><a:lstStyle><a:lvl1pPr algn=\"ctr\"><a:defRPr sz=\"900\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Slide Number Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"4\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"6553200\" y=\"4767263\"/><a:ext cx=\"2133600\" cy=\"273844\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"ctr\"/><a:lstStyle><a:lvl1pPr algn=\"r\"><a:defRPr sz=\"900\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{C5EF2332-01BF-834F-8236-50238282D533}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3676200875\"/></p:ext></p:extLst></p:cSld><p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/><p:sldLayoutIdLst><p:sldLayoutId id=\"2147483649\" r:id=\"rId1\"/><p:sldLayoutId id=\"2147483650\" r:id=\"rId2\"/><p:sldLayoutId id=\"2147483651\" r:id=\"rId3\"/><p:sldLayoutId id=\"2147483652\" r:id=\"rId4\"/><p:sldLayoutId id=\"2147483653\" r:id=\"rId5\"/><p:sldLayoutId id=\"2147483654\" r:id=\"rId6\"/><p:sldLayoutId id=\"2147483655\" r:id=\"rId7\"/><p:sldLayoutId id=\"2147483656\" r:id=\"rId8\"/><p:sldLayoutId id=\"2147483657\" r:id=\"rId9\"/><p:sldLayoutId id=\"2147483658\" r:id=\"rId10\"/><p:sldLayoutId id=\"2147483659\" r:id=\"rId11\"/></p:sldLayoutIdLst><p:txStyles><p:titleStyle><a:lvl1pPr algn=\"ctr\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"0\"/></a:spcBef><a:buNone/><a:defRPr sz=\"3300\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mj-lt\"/><a:ea typeface=\"+mj-ea\"/><a:cs typeface=\"+mj-cs\"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr marL=\"342900\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"685800\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"–\"/><a:defRPr sz=\"2100\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"1028700\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1371600\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"–\"/><a:defRPr sz=\"1500\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1714500\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"»\"/><a:defRPr sz=\"1500\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2057400\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1500\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2400300\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1500\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"2743200\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1500\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3086100\" indent=\"-342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:spcBef><a:spcPct val=\"20000\"/></a:spcBef><a:buFont typeface=\"Arial\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1500\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr lang=\"en-US\"/></a:defPPr><a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"342900\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"685800\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1028700\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1371600\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"1714500\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2057400\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"2400300\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"2743200\" algn=\"l\" defTabSz=\"342900\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1350\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:otherStyle></p:txStyles></p:sldMaster>"
  },
  {
    "path": "data/pptx/ppt/slides/_rels/slide1.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide1.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout1.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slides/_rels/slide2.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide2.xml\"/><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout2.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slides/_rels/slide3.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout3.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slides/_rels/slide4.xml.rels",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout4.xml\"/></Relationships>"
  },
  {
    "path": "data/pptx/ppt/slides/slide1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ctrTitle\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Presentation Title</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Subtitle 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"subTitle\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Presentation Subtitle</a:t></a:r></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"392669009\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>"
  },
  {
    "path": "data/pptx/ppt/slides/slide2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Slide Title</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Content Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:pPr marL=\"0\" indent=\"0\"><a:buNone/></a:pPr><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Hello</a:t></a:r><a:r><a:rPr lang=\"en-US\"/><a:t>, world.</a:t></a:r></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"572707455\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>"
  },
  {
    "path": "data/pptx/ppt/slides/slide3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Section header</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"3996781534\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>"
  },
  {
    "path": "data/pptx/ppt/slides/slide4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Title 3\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Slide Title for Two-Content</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"5\" name=\"Content Placeholder 4\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph sz=\"half\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Some content on </a:t></a:r><a:r><a:rPr lang=\"en-US\"/><a:t>the left.</a:t></a:r><a:endParaRPr lang=\"en-US\" dirty=\"0\"/></a:p><a:p><a:pPr marL=\"0\" indent=\"0\"><a:buNone/></a:pPr><a:endParaRPr lang=\"en-US\" dirty=\"0\"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"6\" name=\"Content Placeholder 5\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph sz=\"half\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang=\"en-US\" dirty=\"0\"/><a:t>Some content on the right.</a:t></a:r></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\"><p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"1324621109\"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>"
  },
  {
    "path": "data/pptx/ppt/tableStyles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<a:tblStyleLst xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\"/>"
  },
  {
    "path": "data/pptx/ppt/theme/theme1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2><a:lt2><a:srgbClr val=\"EEECE1\"/></a:lt2><a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1><a:accent2><a:srgbClr val=\"C0504D\"/></a:accent2><a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3><a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4><a:accent5><a:srgbClr val=\"4BACC6\"/></a:accent5><a:accent6><a:srgbClr val=\"F79646\"/></a:accent6><a:hlink><a:srgbClr val=\"0000FF\"/></a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Calibri\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"ＭＳ Ｐゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Angsana New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:majorFont><a:minorFont><a:latin typeface=\"Calibri\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"ＭＳ Ｐゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Cordia New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"1\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"100000\"/><a:shade val=\"100000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:shade val=\"100000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/></a:schemeClr></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera><a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"40000\"><a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:spDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx=\"1\"><a:schemeClr val=\"accent1\"/></a:lnRef><a:fillRef idx=\"3\"><a:schemeClr val=\"accent1\"/></a:fillRef><a:effectRef idx=\"2\"><a:schemeClr val=\"accent1\"/></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"lt1\"/></a:fontRef></a:style></a:spDef><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx=\"2\"><a:schemeClr val=\"accent1\"/></a:lnRef><a:fillRef idx=\"0\"><a:schemeClr val=\"accent1\"/></a:fillRef><a:effectRef idx=\"1\"><a:schemeClr val=\"accent1\"/></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/></a:theme>"
  },
  {
    "path": "data/pptx/ppt/theme/theme2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"44546A\"/></a:dk2><a:lt2><a:srgbClr val=\"E7E6E6\"/></a:lt2><a:accent1><a:srgbClr val=\"5B9BD5\"/></a:accent1><a:accent2><a:srgbClr val=\"ED7D31\"/></a:accent2><a:accent3><a:srgbClr val=\"A5A5A5\"/></a:accent3><a:accent4><a:srgbClr val=\"FFC000\"/></a:accent4><a:accent5><a:srgbClr val=\"4472C4\"/></a:accent5><a:accent6><a:srgbClr val=\"70AD47\"/></a:accent6><a:hlink><a:srgbClr val=\"0563C1\"/></a:hlink><a:folHlink><a:srgbClr val=\"954F72\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Calibri Light\" panose=\"020F0302020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"ＭＳ Ｐゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Angsana New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:majorFont><a:minorFont><a:latin typeface=\"Calibri\" panose=\"020F0502020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"ＭＳ Ｐゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Cordia New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/><a:extLst><a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\"><thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}\" vid=\"{4A3C46E8-61CC-4603-A589-7422A47A8E4A}\"/></a:ext></a:extLst></a:theme>"
  },
  {
    "path": "data/pptx/ppt/viewProps.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<p:viewPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" lastView=\"sldThumbnailView\"><p:normalViewPr><p:restoredLeft sz=\"15643\" autoAdjust=\"0\"/><p:restoredTop sz=\"94694\" autoAdjust=\"0\"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr snapToGrid=\"0\" snapToObjects=\"1\"><p:cViewPr varScale=\"1\"><p:scale><a:sx n=\"161\" d=\"100\"/><a:sy n=\"161\" d=\"100\"/></p:scale><p:origin x=\"560\" y=\"200\"/></p:cViewPr><p:guideLst><p:guide orient=\"horz\" pos=\"1620\"/><p:guide pos=\"2880\"/></p:guideLst></p:cSldViewPr></p:slideViewPr><p:outlineViewPr><p:cViewPr><p:scale><a:sx n=\"33\" d=\"100\"/><a:sy n=\"33\" d=\"100\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:outlineViewPr><p:notesTextViewPr><p:cViewPr><p:scale><a:sx n=\"100\" d=\"100\"/><a:sy n=\"100\" d=\"100\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx=\"76200\" cy=\"76200\"/></p:viewPr>"
  },
  {
    "path": "data/templates/affiliations.jats",
    "content": "$--\n$-- Affiliations\n$--\n<aff id=\"aff-$it.id$\">\n$-- wrap affiliation if it has a known institution identifier\n$if(it.group)$\n<institution content-type=\"group\">${it.group}</institution>\n$endif$\n$if(it.department)$\n<institution content-type=\"dept\">${it.department}</institution>\n$endif$\n<institution-wrap>\n$if(it.organization)$\n<institution>${it.organization}</institution>\n$else$\n<institution>${it.name}</institution>\n$endif$\n$if(it.isni)$\n<institution-id institution-id-type=\"ISNI\">${it.isni}</institution-id>\n$endif$\n$if(it.ringgold)$\n<institution-id institution-id-type=\"Ringgold\">${it.ringgold}</institution-id>\n$endif$\n$if(it.ror)$\n<institution-id institution-id-type=\"ROR\">${it.ror}</institution-id>\n$endif$\n$for(it.pid)$\n<institution-id institution-id-type=\"${it.type}\">${it.id}</institution-id>\n$endfor$\n</institution-wrap>$if(it.street-address)$,\n$for(it.street-address)$\n<addr-line>${it}</addr-line>$sep$,\n$endfor$\n$else$$if(it.city)$, <city>$it.city$</city>$endif$$endif$$if(it.country)$,\n<country$if(it.country-code)$ country=\"$it.country-code$\"$endif$>$it.country$</country>$endif$\n</aff>\n"
  },
  {
    "path": "data/templates/after-header-includes.latex",
    "content": "\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}\n$if(links-as-notes)$\n% Make links footnotes instead of hotlinks:\n\\DeclareRobustCommand{\\href}[2]{#2\\footnote{\\url{#1}}}\n$endif$\n$if(verbatim-in-note)$\n\\VerbatimFootnotes % allow verbatim text in footnotes\n$endif$\n"
  },
  {
    "path": "data/templates/article.jats_publishing",
    "content": "$if(article.type)$\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"$article.type$\">\n$else$\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n$endif$\n<front>\n<journal-meta>\n$if(journal.publisher-id)$\n<journal-id journal-id-type=\"publisher-id\">$journal.publisher-id$</journal-id>\n$endif$\n$if(journal.nlm-ta)$\n<journal-id journal-id-type=\"nlm-ta\">$journal.nlm-ta$</journal-id>\n$endif$\n$if(journal.pmc)$\n<journal-id journal-id-type=\"pmc\">$journal.pmc$</journal-id>\n$endif$\n$-- Fallback: an empty journal-id in case none is available.\n$if(journal.publisher-id)$\n$elseif(journal.nlm-ta)$\n$elseif(journal.pmc)$\n$else$\n<journal-id></journal-id>\n$endif$\n<journal-title-group>\n$if(journal.title)$\n<journal-title>$journal.title$</journal-title>\n$endif$\n$if(journal.abbrev-title)$\n<abbrev-journal-title>$journal.abbrev-title$</abbrev-journal-title>\n$endif$\n</journal-title-group>\n$if(journal.pissn)$\n<issn publication-format=\"print\">$journal.pissn$</issn>\n$endif$\n$if(journal.eissn)$\n<issn publication-format=\"electronic\">$journal.eissn$</issn>\n$endif$\n$-- At least one issn element is required; use empty issn as fallback\n$if(journal.pissn)$\n$elseif(journal.eissn)$\n$else$\n<issn></issn>\n$endif$\n<publisher>\n<publisher-name>$journal.publisher-name$</publisher-name>\n$if(journal.publisher-loc)$\n<publisher-loc>$journal.publisher-loc$</publisher-loc>\n$endif$\n</publisher>\n</journal-meta>\n<article-meta>\n$if(article.publisher-id)$\n<article-id pub-id-type=\"publisher-id\">$article.publisher-id$</article-id>\n$endif$\n$if(article.doi)$\n<article-id pub-id-type=\"doi\">$article.doi$</article-id>\n$endif$\n$if(article.pmid)$\n<article-id pub-id-type=\"pmid\">$article.pmid$</article-id>\n$endif$\n$if(article.pmcid)$\n<article-id pub-id-type=\"pmcid\">$article.pmcid$</article-id>\n$endif$\n$if(article.art-access-id)$\n<article-id pub-id-type=\"art-access-id\">$article.art-access-id$</article-id>\n$endif$\n$if(article.heading)$\n<article-categories>\n<subj-group subj-group-type=\"heading\">\n<subject>$article.heading$</subject>\n</subj-group>\n$if(article.categories)$\n<subj-group subj-group-type=\"categories\">\n$for(article.categories)$\n<subject>$article.categories$</subject>\n$endfor$\n</subj-group>\n$endif$\n</article-categories>\n$endif$\n$if(title)$\n<title-group>\n<article-title>$title$</article-title>\n$if(subtitle)$\n<subtitle>${subtitle}</subtitle>\n$endif$\n</title-group>\n$endif$\n$if(author)$\n<contrib-group>\n$for(author)$\n<contrib contrib-type=\"author\"$if(author.equal-contrib)$ equal-contrib=\"yes\"$endif$$if(author.cor-id)$ corresp=\"yes\"$endif$>\n$if(author.orcid)$\n<contrib-id contrib-id-type=\"orcid\">$author.orcid$</contrib-id>\n$endif$\n$if(author.surname)$\n<name>\n<surname>$if(author.non-dropping-particle)$${author.non-dropping-particle} $endif$$author.surname$</surname>\n<given-names>$author.given-names$$if(author.dropping-particle)$ ${author.dropping-particle}$endif$</given-names>\n$if(author.prefix)$\n<prefix>${author.prefix}</prefix>\n$endif$\n$if(author.suffix)$\n<suffix>${author.suffix}</suffix>\n$endif$\n</name>\n$elseif(author.name)$\n<string-name>$author.name$</string-name>\n$else$\n<string-name>$author$</string-name>\n$endif$\n$for(author.roles)$\n$if(it.credit)$\n<role vocab=\"credit\"$if(it.degree)$ degree-contribution=\"$it.degree$\"$endif$\n      vocab-identifier=\"https://credit.niso.org/\"\n      vocab-term-identifier=\"https://credit.niso.org/contributor-roles/$it.credit$/\"\n      vocab-term=\"$it.credit-name$\"\n>$if(it.name)$$it.name$$else$$it.credit-name$$endif$</role>\n$elseif(it.name)$\n<role>$it.name$</role>\n$endif$\n$endfor$\n$if(author.email)$\n<email>$author.email$</email>\n$endif$\n$-- if affiliations are listed separately, then create links. Otherwise\n$-- include them here.\n$if(affiliation)$\n$for(author.affiliation)$\n<xref ref-type=\"aff\" rid=\"aff-$author.affiliation$\"/>\n$endfor$\n$else$\n$for(author.affiliation)$\n${ it:affiliations.jats() }\n$endfor$\n$endif$\n$if(author.cor-id)$\n<xref ref-type=\"corresp\" rid=\"cor-$author.cor-id$\"><sup>*</sup></xref>\n$endif$\n</contrib>\n$endfor$\n$for(affiliation)$\n${ it:affiliations.jats() }\n$endfor$\n</contrib-group>\n$endif$\n$if(article.author-notes)$\n<author-notes>\n$if(article.author-notes.corresp)$\n$for(article.author-notes.corresp)$\n<corresp id=\"cor-$article.author-notes.corresp.id$\">* E-mail: <email>$article.author-notes.corresp.email$</email></corresp>\n$endfor$\n$endif$\n$if(article.author-notes.conflict)$\n<fn fn-type=\"conflict\"><p>$article.author-notes.conflict$</p></fn>\n$endif$\n$if(article.author-notes.con)$\n<fn fn-type=\"con\"><p>$article.author-notes.con$</p></fn>\n$endif$\n</author-notes>\n$endif$\n$if(date)$\n<pub-date date-type=\"$if(date.type)$$date.type$$else$pub$endif$\" publication-format=\"electronic\"$if(date.iso-8601)$ iso-8601-date=\"$date.iso-8601$\"$endif$>\n$if(date.day)$\n<day>$date.day$</day>\n$endif$\n$if(date.month)$\n<month>$date.month$</month>\n$endif$\n<year>$date.year$</year>\n</pub-date>\n$endif$\n$if(article.volume)$\n<volume>$article.volume$</volume>\n$endif$\n$if(article.issue)$\n<issue>$article.issue$</issue>\n$endif$\n$if(article.fpage)$\n<fpage>$article.fpage$</fpage>\n$endif$\n$if(article.lpage)$\n<lpage>$article.lpage$</lpage>\n$endif$\n$if(article.elocation-id)$\n<elocation-id>$article.elocation-id$</elocation-id>\n$endif$\n$if(history)$\n<history>\n</history>\n$endif$\n<permissions>\n$for(copyright.statement)$\n<copyright-statement>$copyright.statement$</copyright-statement>\n$endfor$\n$for(copyright.year)$\n<copyright-year>$copyright.year$</copyright-year>\n$endfor$\n$for(copyright.holder)$\n<copyright-holder>$copyright.holder$</copyright-holder>\n$endfor$\n$if(copyright.text)$\n<license license-type=\"$copyright.type$\" xlink:href=\"$copyright.link$\">\n<license-p>$copyright.text$</license-p>\n</license>\n$endif$\n$for(license)$\n<license$if(it.type)$ license-type=\"${it.type}\"$endif$>\n$if(it.link)$\n<ali:license_ref xmlns:ali=\"http://www.niso.org/schemas/ali/1.0/\">${it.link}</ali:license_ref>\n$endif$\n<license-p>$if(it.text)$${it.text}$else$${it}$endif$</license-p>\n</license>\n$endfor$\n</permissions>\n$if(abstract)$\n<abstract>\n$abstract$\n</abstract>\n$endif$\n$if(tags)$\n<kwd-group kwd-group-type=\"author\">\n$for(tags)$\n<kwd>$tags$</kwd>\n$endfor$\n</kwd-group>\n$endif$\n$if(article.funding-statement)$\n<funding-group>\n<funding-statement>$article.funding-statement$</funding-statement>\n</funding-group>\n$endif$\n</article-meta>\n$if(notes)$\n<notes>$notes$</notes>\n$endif$\n</front>\n<body>\n$body$\n</body>\n<back>\n$if(back)$\n$back$\n$endif$\n</back>\n$if(floats-group)$\n<floats-group>\n$floats-group$\n</floats-group>\n$endif$\n</article>\n\n"
  },
  {
    "path": "data/templates/common.latex",
    "content": "$if(linestretch)$\n\\usepackage{setspace}\n$endif$\n$--\n$-- paragraph formatting\n$--\n$if(indent)$\n$else$\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n$endif$\n$if(beamer)$\n$else$\n$if(block-headings)$\n% Make \\paragraph and \\subparagraph free-standing\n\\makeatletter\n\\ifx\\paragraph\\undefined\\else\n  \\let\\oldparagraph\\paragraph\n  \\renewcommand{\\paragraph}{\n    \\@ifstar\n      \\xxxParagraphStar\n      \\xxxParagraphNoStar\n  }\n  \\newcommand{\\xxxParagraphStar}[1]{\\oldparagraph*{#1}\\mbox{}}\n  \\newcommand{\\xxxParagraphNoStar}[1]{\\oldparagraph{#1}\\mbox{}}\n\\fi\n\\ifx\\subparagraph\\undefined\\else\n  \\let\\oldsubparagraph\\subparagraph\n  \\renewcommand{\\subparagraph}{\n    \\@ifstar\n      \\xxxSubParagraphStar\n      \\xxxSubParagraphNoStar\n  }\n  \\newcommand{\\xxxSubParagraphStar}[1]{\\oldsubparagraph*{#1}\\mbox{}}\n  \\newcommand{\\xxxSubParagraphNoStar}[1]{\\oldsubparagraph{#1}\\mbox{}}\n\\fi\n\\makeatother\n$endif$\n$endif$\n$--\n$-- verbatim in notes\n$--\n$if(verbatim-in-note)$\n\\usepackage{fancyvrb}\n$endif$\n$-- highlighting\n$if(listings)$\n\\usepackage{listings}\n\\newcommand{\\passthrough}[1]{#1}\n\\lstset{defaultdialect=[5.3]Lua}\n\\lstset{defaultdialect=[x86masm]Assembler}\n$endif$\n$if(lhs)$\n\\lstnewenvironment{code}{\\lstset{language=Haskell,basicstyle=\\small\\ttfamily}}{}\n$endif$\n$if(highlighting-macros)$\n$highlighting-macros$\n$endif$\n$--\n$-- tables\n$--\n$if(tables)$\n\\usepackage{longtable,booktabs,array}\n\\newcounter{none} % for unnumbered tables\n$if(multirow)$\n\\usepackage{multirow}\n$endif$\n\\usepackage{calc} % for calculating minipage widths\n$if(beamer)$\n\\usepackage{caption}\n% Make caption package work with longtable\n\\makeatletter\n\\def\\fnum@table{\\tablename~\\thetable}\n\\makeatother\n$else$\n% Correct order of tables after \\paragraph or \\subparagraph\n\\usepackage{etoolbox}\n\\makeatletter\n\\patchcmd\\longtable{\\par}{\\if@noskipsec\\mbox{}\\fi\\par}{}{}\n\\makeatother\n% Allow footnotes in longtable head/foot\n\\IfFileExists{footnotehyper.sty}{\\usepackage{footnotehyper}}{\\usepackage{footnote}}\n\\makesavenoteenv{longtable}\n$endif$\n$endif$\n$--\n$-- graphics\n$--\n$if(graphics)$\n\\usepackage{graphicx}\n\\makeatletter\n\\newsavebox\\pandoc@box\n\\newcommand*\\pandocbounded[1]{% scales image to fit in text height/width\n  \\sbox\\pandoc@box{#1}%\n  \\Gscale@div\\@tempa{\\textheight}{\\dimexpr\\ht\\pandoc@box+\\dp\\pandoc@box\\relax}%\n  \\Gscale@div\\@tempb{\\linewidth}{\\wd\\pandoc@box}%\n  \\ifdim\\@tempb\\p@<\\@tempa\\p@\\let\\@tempa\\@tempb\\fi% select the smaller of both\n  \\ifdim\\@tempa\\p@<\\p@\\scalebox{\\@tempa}{\\usebox\\pandoc@box}%\n  \\else\\usebox{\\pandoc@box}%\n  \\fi%\n}\n% Set default figure placement to htbp\n\\def\\fps@figure{htbp}\n\\makeatother\n$endif$\n$if(svg)$\n\\usepackage{svg}\n$endif$\n$--\n$-- strikeout/underline\n$--\n$if(strikeout)$\n\\ifLuaTeX\n  \\usepackage{luacolor}\n  \\usepackage[soul]{lua-ul}\n\\else\n  \\usepackage{soul}\n$if(beamer)$\n  \\makeatletter\n  \\let\\HL\\hl\n  \\renewcommand\\hl{% fix for beamer highlighting\n    \\let\\set@color\\beamerorig@set@color\n    \\let\\reset@color\\beamerorig@reset@color\n    \\HL}\n  \\makeatother\n$endif$\n$if(CJKmainfont)$\n  \\ifXeTeX\n    % soul's \\st doesn't work for CJK:\n    \\usepackage{xeCJKfntef}\n    \\renewcommand{\\st}[1]{\\sout{#1}}\n  \\fi\n$endif$\n\\fi\n$endif$\n$--\n$-- CSL citations\n$--\n$if(csl-refs)$\n% definitions for citeproc citations\n\\NewDocumentCommand\\citeproctext{}{}\n\\NewDocumentCommand\\citeproc{mm}{%\n  \\begingroup\\def\\citeproctext{#2}\\cite{#1}\\endgroup}\n\\makeatletter\n % allow citations to break across lines\n \\let\\@cite@ofmt\\@firstofone\n % avoid brackets around text for \\cite:\n \\def\\@biblabel#1{}\n \\def\\@cite#1#2{{#1\\if@tempswa , #2\\fi}}\n\\makeatother\n\\newlength{\\cslhangindent}\n\\setlength{\\cslhangindent}{1.5em}\n\\newlength{\\csllabelwidth}\n\\setlength{\\csllabelwidth}{3em}\n\\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing\n {\\begin{list}{}{%\n  \\setlength{\\itemindent}{0pt}\n  \\setlength{\\leftmargin}{0pt}\n  \\setlength{\\parsep}{0pt}\n  % turn on hanging indent if param 1 is 1\n  \\ifodd #1\n   \\setlength{\\leftmargin}{\\cslhangindent}\n   \\setlength{\\itemindent}{-1\\cslhangindent}\n  \\fi\n  % set entry spacing\n  \\setlength{\\itemsep}{#2\\baselineskip}}}\n {\\end{list}}\n\\usepackage{calc}\n\\newcommand{\\CSLBlock}[1]{\\hfill\\break\\parbox[t]{\\linewidth}{\\strut\\ignorespaces#1\\strut}}\n\\newcommand{\\CSLLeftMargin}[1]{\\parbox[t]{\\csllabelwidth}{\\strut#1\\strut}}\n\\newcommand{\\CSLRightInline}[1]{\\parbox[t]{\\linewidth - \\csllabelwidth}{\\strut#1\\strut}}\n\\newcommand{\\CSLIndent}[1]{\\hspace{\\cslhangindent}#1}\n$endif$\n$--\n$-- Babel language support\n$--\n$if(lang)$\n\\ifLuaTeX\n\\usepackage[bidi=basic$if(shorthands)$$else$,shorthands=off$endif$$for(babeloptions)$,$babeloptions$$endfor$]{babel}\n\\else\n\\usepackage[bidi=default$if(shorthands)$$else$,shorthands=off$endif$$for(babeloptions)$,$babeloptions$$endfor$]{babel}\n\\fi\n$if(babel-lang)$\n$if(mainfont)$\n\\ifPDFTeX\n\\else\n\\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}\n\\fi\n$endif$\n$endif$\n$for(babelfonts/pairs)$\n\\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}\n$endfor$\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n$endif$\n$--\n$-- pagestyle\n$--\n$if(pagestyle)$\n\\pagestyle{$pagestyle$}\n$endif$\n$--\n$-- prevent overfull lines\n$--\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n$--\n$-- tight lists\n$--\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n$--\n$-- subfigure support\n$--\n$if(subfigure)$\n\\usepackage{subcaption}\n$endif$\n$--\n$-- text direction support for pdftex\n$--\n$if(dir)$\n\\ifPDFTeX\n  \\TeXXeTstate=1\n  \\newcommand{\\RL}[1]{\\beginR #1\\endR}\n  \\newcommand{\\LR}[1]{\\beginL #1\\endL}\n  \\newenvironment{RTL}{\\beginR}{\\endR}\n  \\newenvironment{LTR}{\\beginL}{\\endL}\n\\fi\n\\ifluatex\n  \\newcommand{\\RL}[1]{\\bgroup\\textdir TRT#1\\egroup}\n  \\newcommand{\\LR}[1]{\\bgroup\\textdir TLT#1\\egroup}\n  \\newenvironment{RTL}{\\textdir TRT\\pardir TRT\\bodydir TRT}{}\n  \\newenvironment{LTR}{\\textdir TLT\\pardir TLT\\bodydir TLT}{}\n\\fi\n$endif$\n$--\n$-- bibliography support support for natbib and biblatex\n$--\n$if(natbib)$\n\\usepackage[$natbiboptions$]{natbib}\n\\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}\n$endif$\n$if(biblatex)$\n\\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}\n$for(bibliography)$\n\\addbibresource{$bibliography$}\n$endfor$\n$endif$\n$--\n$-- csquotes\n$--\n$if(csquotes)$\n\\usepackage[$for(csquotesoptions)$$csquotesoptions$$sep$,$endfor$]{csquotes}\n$endif$\n"
  },
  {
    "path": "data/templates/default.ansi",
    "content": "$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$table-of-contents$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.asciidoc",
    "content": "$if(titleblock)$\n= $title$\n$if(author)$\n$for(author)$$author$$sep$; $endfor$\n$if(date)$\n$date$\n$endif$\n$elseif(date)$\n:revdate: $date$\n$endif$\n$if(keywords)$\n:keywords: $for(keywords)$$keywords$$sep$, $endfor$\n$endif$\n$if(lang)$\n:lang: $lang$\n$endif$\n$if(toc)$\n:toc:\n$endif$\n$if(math)$\n:stem: latexmath\n$endif$\n\n$endif$\n$if(abstract)$\n[abstract]\n== Abstract\n$abstract$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.bbcode",
    "content": "$body$\n"
  },
  {
    "path": "data/templates/default.beamer",
    "content": "$passoptions.latex()$\n\\documentclass[\n$if(fontsize)$\n  $fontsize$,\n$endif$\n  ignorenonframetext,\n$if(handout)$\n  handout,\n$endif$\n$if(aspectratio)$\n  aspectratio=$aspectratio$,\n$endif$\n$if(babel-lang)$\n  $babel-lang$,\n$endif$\n$for(classoption)$\n  $classoption$$sep$,\n$endfor$\n]{$documentclass$}\n$if(geometry)$\n\\geometry{$for(geometry)$$geometry$$sep$,$endfor$}\n$endif$\n\\newif\\ifbibliography\n$if(background-image)$\n\\usebackgroundtemplate{%\n  \\includegraphics[width=\\paperwidth]{$background-image$}%\n}\n% In beamer background-image does not work well when other images are used, so this is the workaround\n\\pgfdeclareimage[width=\\paperwidth,height=\\paperheight]{background}{$background-image$}\n\\usebackgroundtemplate{\\pgfuseimage{background}}\n$endif$\n\\usepackage{pgfpages}\n\\setbeamertemplate{caption}[numbered]\n\\setbeamertemplate{caption label separator}{: }\n\\setbeamercolor{caption name}{fg=normal text.fg}\n\\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$\n$--\n$-- section numbering\n$--\n$if(numbersections)$\n$else$\n% remove section numbering\n\\setbeamertemplate{part page}{\n  \\centering\n  \\begin{beamercolorbox}[sep=16pt,center]{part title}\n    \\usebeamerfont{part title}\\insertpart\\par\n  \\end{beamercolorbox}\n}\n\\setbeamertemplate{section page}{\n  \\centering\n  \\begin{beamercolorbox}[sep=12pt,center]{section title}\n    \\usebeamerfont{section title}\\insertsection\\par\n  \\end{beamercolorbox}\n}\n\\setbeamertemplate{subsection page}{\n  \\centering\n  \\begin{beamercolorbox}[sep=8pt,center]{subsection title}\n    \\usebeamerfont{subsection title}\\insertsubsection\\par\n  \\end{beamercolorbox}\n}\n$endif$\n$for(beameroption)$\n\\setbeameroption{$beameroption$}\n$endfor$\n% Prevent slide breaks in the middle of a paragraph\n\\widowpenalties 1 10000\n\\raggedbottom\n$if(section-titles)$\n\\AtBeginPart{\n  \\frame{\\partpage}\n}\n\\AtBeginSection{\n  \\ifbibliography\n  \\else\n    \\frame{\\sectionpage}\n  \\fi\n}\n\\AtBeginSubsection{\n  \\frame{\\subsectionpage}\n}\n$endif$\n$fonts.latex()$\n$-- Set Beamer theme before user font settings so they can override theme\n$if(theme)$\n\\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}\n$endif$\n$if(colortheme)$\n\\usecolortheme[$for(colorthemeoptions)$$colorthemeoptions$$sep$,$endfor$]{$colortheme$}\n$endif$\n$if(fonttheme)$\n\\usefonttheme[$for(fontthemeoptions)$$fontthemeoptions$$sep$,$endfor$]{$fonttheme$}\n$endif$\n$if(mainfont)$\n\\usefonttheme{serif} % use mainfont rather than sansfont for slide text\n$endif$\n$if(innertheme)$\n\\useinnertheme[$for(innerthemeoptions)$$innerthemeoptions$$sep$,$endfor$]{$innertheme$}\n$endif$\n$if(outertheme)$\n\\useoutertheme[$for(outerthemeoptions)$$outerthemeoptions$$sep$,$endfor$]{$outertheme$}\n$endif$\n$font-settings.latex()$\n$common.latex()$\n$for(header-includes)$\n$header-includes$\n$endfor$\n$after-header-includes.latex()$\n$hypersetup.latex()$\n\n$if(title)$\n\\title$if(shorttitle)$[$shorttitle$]$endif${\\texorpdfstring{$title$}{$title-meta$}$if(thanks)$\\thanks{$thanks$}$endif$}\n$endif$\n$if(subtitle)$\n\\subtitle$if(shortsubtitle)$[$shortsubtitle$]$endif${\\texorpdfstring{$subtitle$}{$subtitle-meta$}}\n$endif$\n\\author$if(shortauthor)$[$shortauthor$]$endif${\\texorpdfstring{$for(author)$$author$$sep$ \\and $endfor$}{$author-meta$}}\n\\date$if(shortdate)$[$shortdate$]$endif${$date$}\n$if(institute)$\n\\institute$if(shortinstitute)$[$shortinstitute$]$endif${$for(institute)$$institute$$sep$ \\and $endfor$}\n$endif$\n$if(titlegraphic)$\n\\titlegraphic{\n$for(titlegraphic)$\n  \\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}$sep$\\enspace\n$endfor$}\n$endif$\n$if(logo)$\n\\logo{\\includegraphics$if(logooptions)$[$for(logooptions)$$logooptions$$sep$, $endfor$]$endif${$logo$}}\n$endif$\n\n\\begin{document}\n$if(title)$\n\\frame{\\titlepage}\n$if(abstract)$\n\\begin{abstract}\n$abstract$\n\\end{abstract}\n$endif$\n$endif$\n\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$if(toc-title)$\n\\renewcommand*\\contentsname{$toc-title$}\n$endif$\n\\begin{frame}[allowframebreaks]\n$if(toc-title)$\n  \\frametitle{$toc-title$}\n$endif$\n  \\setcounter{tocdepth}{$toc-depth$}\n  \\tableofcontents\n\\end{frame}\n\\setcounter{tocdepth}{$toc-depth$}\n\\tableofcontents\n}\n$endif$\n$if(lof)$\n\\listoffigures\n$endif$\n$if(lot)$\n\\listoftables\n$endif$\n$if(linestretch)$\n\\setstretch{$linestretch$}\n$endif$\n$body$\n\n$if(natbib)$\n$if(bibliography)$\n$if(biblio-title)$\n$if(has-chapters)$\n\\renewcommand\\bibname{$biblio-title$}\n$else$\n\\renewcommand\\refname{$biblio-title$}\n$endif$\n$endif$\n\\begin{frame}[allowframebreaks]{$biblio-title$}\n$if(nocite-ids)$\n  \\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}\n$endif$\n  \\bibliographytrue\n  \\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}\n\\end{frame}\n\n$endif$\n$endif$\n$if(biblatex)$\n\\begin{frame}[allowframebreaks]{$biblio-title$}\n$if(nocite-ids)$\n  \\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}\n$endif$\n  \\bibliographytrue\n  \\printbibliography[heading=none]\n\\end{frame}\n\n$endif$\n$for(include-after)$\n$include-after$\n\n$endfor$\n\\end{document}\n"
  },
  {
    "path": "data/templates/default.biblatex",
    "content": "$for(header-includes)$\n$header-includes$\n$endfor$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.bibtex",
    "content": "$for(header-includes)$\n$header-includes$\n$endfor$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.chunkedhtml",
    "content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$lang$\" xml:lang=\"$lang$\"$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\" />\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\" />\n$endif$\n$if(description-meta)$\n  <meta name=\"description\" content=\"$description-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style>\n    div.sitenav { display: flex; flex-direction: row; flex-wrap: wrap; }\n    span.navlink { flex: 1; }\n    span.navlink-label { display: inline-block; min-width: 4em; }\n    $styles.html()$\n  </style>\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" />\n$endfor$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n$if(math)$\n  $math$\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n<nav id=\"sitenav\">\n<div class=\"sitenav\">\n<span class=\"navlink\">\n$if(up.url)$\n<span class=\"navlink-label\">Up:</span> <a href=\"$up.url$\" accesskey=\"u\" rel=\"up\">$up.title$</a>\n$endif$\n</span>\n<span class=\"navlink\">\n$if(top)$\n<span class=\"navlink-label\">Top:</span> <a href=\"$top.url$\" accesskey=\"t\" rel=\"top\">$top.title$</a>\n$endif$\n</span>\n</div>\n<div class=\"sitenav\">\n<span class=\"navlink\">\n$if(next.url)$\n<span class=\"navlink-label\">Next:</span> <a href=\"$next.url$\" accesskey=\"n\" rel=\"next\">$next.title$</a>\n$endif$\n</span>\n<span class=\"navlink\">\n$if(previous.url)$\n<span class=\"navlink-label\">Previous:</span> <a href=\"$previous.url$\" accesskey=\"p\" rel=\"previous\">$previous.title$</a>\n$endif$\n</span>\n</div>\n</nav>\n$if(top)$\n$-- only print title block if this is NOT the top page\n$else$\n$if(title)$\n<header id=\"title-block-header\">\n<h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n<p class=\"subtitle\">$subtitle$</p>\n$endif$\n$for(author)$\n<p class=\"author\">$author$</p>\n$endfor$\n$if(date)$\n<p class=\"date\">$date$</p>\n$endif$\n$if(abstract)$\n<div class=\"abstract\">\n<div class=\"abstract-title\">$abstract-title$</div>\n$abstract$\n</div>\n$endif$\n$endif$\n</header>\n$endif$\n$if(toc)$\n<nav id=\"$idprefix$TOC\" role=\"doc-toc\">\n$if(toc-title)$\n<h2 id=\"$idprefix$toc-title\">$toc-title$</h2>\n$endif$\n$table-of-contents$\n</nav>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.commonmark",
    "content": "$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$table-of-contents$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.context",
    "content": "$if(tagging)$\n\\setupbackend[format=pdf/ua-2]\n\\enabledirectives[backend.usetags=mkiv]\n\\setuptagging[state=start]\n$endif$\n$if(context-lang)$\n\\mainlanguage[$context-lang$]\n$endif$\n$if(context-dir)$\n\\setupalign[$context-dir$]\n\\setupdirections[bidi=on,method=two]\n$endif$\n% Enable hyperlinks\n\\setupinteraction\n  [state=start,\n$if(title)$\n  title={$title$},\n$endif$\n$if(subtitle)$\n  subtitle={$subtitle$},\n$endif$\n$if(author)$\n  author={$for(author)$$author$$sep$; $endfor$},\n$endif$\n$if(keywords)$\n  keyword={$for(keywords)$$keywords$$sep$; $endfor$},\n$endif$\n  style=$linkstyle$,\n  color=$linkcolor$,\n  contrastcolor=$linkcontrastcolor$]\n\\setupurl[style=$urlstyle$]\n\n% make chapter, section bookmarks visible when opening document\n\\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]\n\\setupinteractionscreen[option={bookmark,title}]\n\n$if(papersize)$\n\\setuppapersize[$for(papersize)$$papersize$$sep$,$endfor$]\n$endif$\n$if(layout)$\n\\setuplayout[$for(layout)$$layout$$sep$,$endfor$]\n$endif$\n$if(pagenumbering)$\n\\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]\n$else$\n\\setuppagenumbering[location={footer,middle}]\n$endif$\n$if(pdfa)$\n% attempt to generate PDF/A\n\\setupbackend\n  [format=PDF/A-$pdfa$,\n   profile={$if(pdfaiccprofile)$$for(pdfaiccprofile)$$pdfaiccprofile$$sep$,$endfor$$else$sRGB.icc$endif$},\n   intent=$if(pdfaintent)$$pdfaintent$$else$sRGB IEC61966-2.1$endif$]\n$endif$\n\\setupstructure[state=start,method=auto]\n\n% use microtypography\n\\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]\n\\definefontfeature[default:tnum][default][tnum=yes, pnum=no]\n\\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]\n\\setupalign[hz,hanging]\n\\setupitaliccorrection[global, always]\n\n\\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted\n\n$-- set up font fallbacks\n$for(mainfontfallback)$\n\\definefallbackfamily[mainface][rm][$mainfontfallback/nowrap$][range=0x0000-0xFFFF, check=yes, force=no]\n$endfor$\n$for(sansfontfallback)$\n\\definefallbackfamily[mainface][ss][$sansfontfallback/nowrap$][range=0x0000-0xFFFF, check=yes, force=no]\n$endfor$\n$for(monofontfallback)$\n\\definefallbackfamily[mainface][tt][$monofontfallback/nowrap$][range=0x0000-0xFFFF, check=yes, force=no]\n$endfor$\n\\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]\n\\definefontfamily[mainface][rm][$if(mainfont)$$mainfont/nowrap$$else$Latin Modern Roman$endif$]\n\\definefontfamily[mainface][mm][$if(mathfont)$$mathfont/nowrap$$else$Latin Modern Math$endif$]\n\\definefontfamily[mainface][ss][$if(sansfont)$$sansfont/nowrap$$else$Latin Modern Sans$endif$]\n\\definefontfamily[mainface][tt][$if(monofont)$$monofont/nowrap$$else$Latin Modern Typewriter$endif$][features=none]\n\\setupbodyfont[mainface$if(fontsize)$,$fontsize$$endif$]\n\n\\setupwhitespace[$if(whitespace)$$whitespace$$else$medium$endif$]\n$if(indenting)$\n\\setupindenting[$for(indenting)$$indenting$$sep$,$endfor$]\n$endif$\n$if(interlinespace)$\n\\setupinterlinespace[$for(interlinespace)$$interlinespace$$sep$,$endfor$]\n$endif$\n\n\\setuphead[chapter]            [style=\\tfd\\setupinterlinespace,header=empty]\n\\setuphead[section]            [style=\\tfc\\setupinterlinespace]\n\\setuphead[subsection]         [style=\\tfb\\setupinterlinespace]\n\\setuphead[subsubsection]      [style=\\bf]\n\\setuphead[subsubsubsection]   [style=\\sc]\n\\setuphead[subsubsubsubsection][style=\\it]\n\n\\definesectionlevels\n   [default]\n   [section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]\n\n$if(headertext)$\n\\setupheadertexts$for(headertext)$[$headertext$]$endfor$\n$endif$\n$if(footertext)$\n\\setupfootertexts$for(footertext)$[$footertext$]$endfor$\n$endif$\n$if(number-sections)$\n$else$\n\\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]\n$endif$\n\n\\definedescription\n  [description]\n  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]\n\n\\setupitemize[autointro]    % prevent orphan list intro\n\\setupitemize[indentnext=no]\n\n\\defineitemgroup[enumerate]\n\\setupenumerate[each][fit][itemalign=left,distance=.5em,style={\\feature[+][default:tnum]}]\n\n\\setupfloat[figure][default={here,nonumber}]\n\\setupfloat[table][default={here,nonumber}]\n\n\\setupxtable[frame=off]\n\\setupxtable[head][topframe=on]\n\\setupxtable[body][]\n\\setupxtable[foot][]\n\\setupxtable[lastrow][bottomframe=on]\n\n$if(emphasis-commands)$\n$emphasis-commands$\n$endif$\n$if(highlighting-commands)$\n$highlighting-commands$\n$endif$\n$if(csl-refs)$\n\\definemeasure[cslhangindent][1.5em]\n\\definenarrower[hangingreferences][left=\\measure{cslhangindent}]\n\\definestartstop [cslreferences] [\n\t$if(csl-hanging-indent)$\n\tbefore={%\n\t  \\starthangingreferences[left]\n      \\setupindenting[-\\leftskip,yes,first]\n      \\doindentation\n  \t},\n  \tafter=\\stophangingreferences,\n\t$endif$\n]\n$endif$\n$if(includesource)$\n$for(sourcefile)$\n\\attachment[file=$curdir$/$sourcefile$,method=hidden]\n$endfor$\n$endif$\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n\\starttext\n$if(title)$\n\\startalignment[middle]\n  {\\tfd\\setupinterlinespace $title$}\n$if(subtitle)$\n  \\smallskip\n  {\\tfa\\setupinterlinespace $subtitle$}\n$endif$\n$if(author)$\n  \\smallskip\n  {\\tfa\\setupinterlinespace $for(author)$$author$$sep$\\crlf $endfor$}\n$endif$\n$if(date)$\n  \\smallskip\n  {\\tfa\\setupinterlinespace $date$}\n$endif$\n  \\bigskip\n\\stopalignment\n$endif$\n$if(abstract)$\n\\midaligned{\\it Abstract}\n\\startnarrower[2*middle]\n$abstract$\n\\stopnarrower\n\\blank[big]\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$if(toc)$\n\\completecontent\n$endif$\n$if(lof)$\n\\completelistoffigures\n$endif$\n$if(lot)$\n\\completelistoftables\n$endif$\n\n$body$\n\n$for(include-after)$\n$include-after$\n$endfor$\n\\stoptext\n"
  },
  {
    "path": "data/templates/default.djot",
    "content": "$if(title)$\n# $title$\n\n$endif$\n$if(author)$\n$for(author)$\n$author$\n$endfor$\n\n$endif$\n$if(date)$\n$date$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n\n$endfor$\n"
  },
  {
    "path": "data/templates/default.docbook4",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n$if(mathml)$\n<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook EBNF Module V1.1CR1//EN\"\n                  \"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd\">\n$else$\n<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.5//EN\"\n                  \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\">\n$endif$\n<article>\n  <articleinfo>\n    <title>$title$</title>\n$if(author)$\n    <authorgroup>\n$for(author)$\n      <author>\n        $author$\n      </author>\n$endfor$\n    </authorgroup>\n$endif$\n$if(date)$\n    <date>$date$</date>\n$endif$\n  </articleinfo>\n$for(include-before)$\n  $include-before$\n$endfor$\n  $body$\n$for(include-after)$\n  $include-after$\n$endfor$\n</article>\n"
  },
  {
    "path": "data/templates/default.docbook5",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article>\n<article\n$if(lang)$\n  xml:lang=\"$lang$\"\n$endif$\n  xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\"\n$if(mathml)$\n  xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"\n$endif$\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\" >\n  <info>\n    <title>$title$</title>\n$if(subtitle)$\n    <subtitle>$subtitle$</subtitle>\n$endif$\n$if(author)$\n    <authorgroup>\n$for(author)$\n      <author>\n        $author$\n      </author>\n$endfor$\n    </authorgroup>\n$endif$\n$if(date)$\n    <date>$date$</date>\n$endif$\n  </info>\n$for(include-before)$\n  $include-before$\n$endfor$\n  $body$\n$for(include-after)$\n  $include-after$\n$endfor$\n</article>\n"
  },
  {
    "path": "data/templates/default.dokuwiki",
    "content": "$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n__TOC__\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.dzslides",
    "content": "<!DOCTYPE html>\n<head$if(lang)$ lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n  <meta charset=\"utf-8\">\n  <meta name=\"generator\" content=\"pandoc\">\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\">\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\">\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\">\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style>\n    $styles.html()$\n  </style>\n$if(css)$\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\">\n$endfor$\n$else$\n<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>\n\n<style>\n  html, .view body { background-color: black; counter-reset: slideidx; }\n  body, .view section { background-color: white; border-radius: 12px }\n  /* A section is a slide. It's size is 800x600, and this will never change */\n  section, .view head > title {\n      /* The font from Google */\n      font-family: 'Oswald', arial, serif;\n      font-size: 30px;\n  }\n\n  .view section:after {\n    counter-increment: slideidx;\n    content: counter(slideidx, decimal-leading-zero);\n    position: absolute; bottom: -80px; right: 100px;\n    color: white;\n  }\n\n  .view head > title {\n    color: white;\n    text-align: center;\n    margin: 1em 0 1em 0;\n  }\n\n  h1, h2 {\n    margin-top: 200px;\n    text-align: center;\n    font-size: 80px;\n  }\n  h3 {\n    margin: 100px 0 50px 100px;\n  }\n\n  ul {\n      margin: 50px 200px;\n  }\n  li > ul {\n      margin: 15px 50px;\n  }\n\n  p {\n    margin: 75px;\n    font-size: 50px;\n  }\n\n  blockquote {\n    height: 100%;\n    background-color: black;\n    color: white;\n    font-size: 60px;\n    padding: 50px;\n  }\n  blockquote:before {\n    content: open-quote;\n  }\n  blockquote:after {\n    content: close-quote;\n  }\n\n  /* Figures are displayed full-page, with the caption\n     on top of the image/video */\n  figure {\n    background-color: black;\n    width: 100%;\n    height: 100%;\n  }\n  figure > * {\n    position: absolute;\n  }\n  figure > img, figure > video {\n    width: 100%; height: 100%;\n  }\n  figcaption {\n    margin: 70px;\n    font-size: 50px;\n  }\n\n  footer {\n    position: absolute;\n    bottom: 0;\n    width: 100%;\n    padding: 40px;\n    text-align: right;\n    background-color: #F3F4F8;\n    border-top: 1px solid #CCC;\n  }\n\n  /* Transition effect */\n  /* Feel free to change the transition effect for original\n     animations. See here:\n     https://developer.mozilla.org/en/CSS/CSS_transitions\n     How to use CSS3 Transitions: */\n  section {\n    -moz-transition: left 400ms linear 0s;\n    -webkit-transition: left 400ms linear 0s;\n    -ms-transition: left 400ms linear 0s;\n    transition: left 400ms linear 0s;\n  }\n  .view section {\n    -moz-transition: none;\n    -webkit-transition: none;\n    -ms-transition: none;\n    transition: none;\n  }\n\n  .view section[aria-selected] {\n    border: 5px red solid;\n  }\n\n  /* Before */\n  section { left: -150%; }\n  /* Now */\n  section[aria-selected] { left: 0; }\n  /* After */\n  section[aria-selected] ~ section { left: +150%; }\n\n  /* Incremental elements */\n\n  /* By default, visible */\n  .incremental > * { opacity: 1; }\n\n  /* The current item */\n  .incremental > *[aria-selected] { opacity: 1; }\n\n  /* The items to-be-selected */\n  .incremental > *[aria-selected] ~ * { opacity: 0; }\n\n  /* The progressbar, at the bottom of the slides, show the global\n     progress of the presentation. */\n  #progress-bar {\n    height: 2px;\n    background: #AAA;\n  }\n</style>\n$endif$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$if(title)$\n<section class=\"title\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n  <footer>\n    $if(author)$<span class=\"author\">$for(author)$$author$$sep$, $endfor$</span> · $endif$$if(institute)$<span class=\"institute\">$for(institute)$$institute$$sep$, $endfor$</span> · $endif$$if(date)$<span class=\"date\">$date$</span>$endif$\n  </footer>\n</section>\n$endif$\n$if(toc)$\n<section id=\"$idprefix$TOC\">\n$table-of-contents$\n</section>\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n$dzslides-core$\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.epub2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <title>$pagetitle$</title>\n  <style type=\"text/css\">\n$if(csl-css)$\n    $styles.citations.html()$\n$endif$\n$if(highlighting-css)$\n    /* CSS for syntax highlighting */\n    $highlighting-css$\n$endif$\n  </style>\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"$css$\" />\n$endfor$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body$if(coverpage)$ id=\"cover\"$endif$>\n$if(titlepage)$\n$for(title)$\n$if(title.text)$\n  <h1 class=\"$title.type$\">$title.text$</h1>\n$else$\n  <h1 class=\"title\">$title$</h1>\n$endif$\n$endfor$\n$if(subtitle)$\n  <p class=\"subtitle\">$subtitle$</p>\n$endif$\n$for(author)$\n  <p class=\"author\">$author$</p>\n$endfor$\n$for(creator)$\n  <p class=\"$creator.role$\">$creator.text$</p>\n$endfor$\n$if(publisher)$\n  <p class=\"publisher\">$publisher$</p>\n$endif$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n$if(rights)$\n  <div class=\"rights\">$rights$</div>\n$endif$\n$if(abstract)$\n<div class=\"abstract\">\n<div class=\"abstract-title\">$abstract-title$</div>\n$abstract$\n</div>\n$endif$\n$else$\n$if(coverpage)$\n<div id=\"cover-image\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" width=\"100%\" height=\"100%\" viewBox=\"0 0 $cover-image-width$ $cover-image-height$\" preserveAspectRatio=\"xMidYMid\">\n<image width=\"$cover-image-width$\" height=\"$cover-image-height$\" xlink:href=\"../media/$cover-image$\" />\n</svg>\n</div>\n$else$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n$endif$\n$endif$\n</body>\n</html>\n\n"
  },
  {
    "path": "data/templates/default.epub3",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <title>$pagetitle$</title>\n  <style>\n$if(csl-css)$\n    $styles.citations.html()$\n$endif$\n$if(highlighting-css)$\n    /* CSS for syntax highlighting */\n    $highlighting-css$\n$endif$\n  </style>\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"$css$\" />\n$endfor$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body$if(coverpage)$ id=\"cover\"$endif$$if(body-type)$ epub:type=\"$body-type$\"$endif$>\n$if(titlepage)$\n<section epub:type=\"titlepage\" class=\"titlepage\">\n$for(title)$\n$if(title.type)$\n  <h1 class=\"$title.type$\">$title.text$</h1>\n$else$\n  <h1 class=\"title\">$title$</h1>\n$endif$\n$endfor$\n$if(subtitle)$\n  <p class=\"subtitle\">$subtitle$</p>\n$endif$\n$for(author)$\n  <p class=\"author\">$author$</p>\n$endfor$\n$for(creator)$\n  <p class=\"$creator.role$\">$creator.text$</p>\n$endfor$\n$if(publisher)$\n  <p class=\"publisher\">$publisher$</p>\n$endif$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n$if(rights)$\n  <div class=\"rights\">$rights$</div>\n$endif$\n$if(abstract)$\n<div class=\"abstract\">\n<div class=\"abstract-title\">$abstract-title$</div>\n$abstract$\n</div>\n$endif$\n</section>\n$else$\n$if(coverpage)$\n<div id=\"cover-image\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" width=\"100%\" height=\"100%\" viewBox=\"0 0 $cover-image-width$ $cover-image-height$\" preserveAspectRatio=\"xMidYMid\">\n<image width=\"$cover-image-width$\" height=\"$cover-image-height$\" xlink:href=\"../media/$cover-image$\" />\n</svg>\n</div>\n$else$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n$endif$\n$endif$\n</body>\n</html>\n\n"
  },
  {
    "path": "data/templates/default.haddock",
    "content": "$body$\n"
  },
  {
    "path": "data/templates/default.html4",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\" />\n$endif$\n$if(description-meta)$\n  <meta name=\"description\" content=\"$description-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style type=\"text/css\">\n    $styles.html()$\n  </style>\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" type=\"text/css\" />\n$endfor$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n$if(math)$\n  $math$\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n$if(title)$\n<div id=\"$idprefix$header\">\n<h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n<h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n<h2 class=\"author\">$author$</h2>\n$endfor$\n$if(date)$\n<h3 class=\"date\">$date$</h3>\n$endif$\n$if(abstract)$\n<div class=\"abstract\">\n<div class=\"abstract-title\">$abstract-title$</div>\n$abstract$\n</div>\n$endif$\n</div>\n$endif$\n$if(toc)$\n<div id=\"$idprefix$TOC\">\n$if(toc-title)$\n<h2 id=\"$idprefix$toc-title\">$toc-title$</h2>\n$endif$\n$table-of-contents$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.html5",
    "content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\" />\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\" />\n$endif$\n$if(description-meta)$\n  <meta name=\"description\" content=\"$description-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style>\n    $styles.html()$\n  </style>\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" />\n$endfor$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n$if(math)$\n  $math$\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n$if(title)$\n<header id=\"title-block-header\">\n<h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n<p class=\"subtitle\">$subtitle$</p>\n$endif$\n$for(author)$\n<p class=\"author\">$author$</p>\n$endfor$\n$if(date)$\n<p class=\"date\">$date$</p>\n$endif$\n$if(abstract)$\n<div class=\"abstract\">\n<div class=\"abstract-title\">$abstract-title$</div>\n$abstract$\n</div>\n$endif$\n</header>\n$endif$\n$if(toc)$\n<nav id=\"$idprefix$TOC\" role=\"doc-toc\">\n$if(toc-title)$\n<h2 id=\"$idprefix$toc-title\">$toc-title$</h2>\n$endif$\n$table-of-contents$\n</nav>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.icml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$$ID/NormalCharacterStyle\" Name=\"Default\" />\n      $charStyles$\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$$ID/NormalParagraphStyle\" Name=\"$$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      $parStyles$\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n$if(objectStyles)$\n    <RootObjectStyleGroup Self=\"pandoc_object_styles\">\n      $objectStyles$\n    </RootObjectStyleGroup>\n$endif$\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n$body$\n\n  </Story>\n  $hyperlinks$\n</Document>\n"
  },
  {
    "path": "data/templates/default.jats_archiving",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n$if(xml-stylesheet)$\n<?xml-stylesheet type=\"text/xsl\" href=\"$xml-stylesheet$\"?>\n$endif$\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n${ article.jats_publishing() }\n"
  },
  {
    "path": "data/templates/default.jats_articleauthoring",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n$if(xml-stylesheet)$\n<?xml-stylesheet type=\"text/xsl\" href=\"$xml-stylesheet$\"?>\n$endif$\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Article Authoring DTD v1.2 20190208//EN\"\n                  \"JATS-articleauthoring1.dtd\">\n$if(article.type)$\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"$article.type$\">\n$else$\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n$endif$\n<front>\n<article-meta>\n$if(title)$\n<title-group>\n<article-title>$title$</article-title>\n$if(subtitle)$\n<subtitle>${subtitle}</subtitle>\n$endif$\n</title-group>\n$endif$\n$if(author)$\n<contrib-group>\n$for(author)$\n<contrib contrib-type=\"author\"$if(author.equal-contrib)$ equal-contrib=\"yes\"$endif$$if(author.cor-id)$ corresp=\"yes\"$endif$>\n$if(author.orcid)$\n<contrib-id contrib-id-type=\"orcid\">$author.orcid$</contrib-id>\n$endif$\n$if(author.surname)$\n<name>\n<surname>$if(author.non-dropping-particle)$${author.non-dropping-particle} $endif$${author.surname}</surname>\n<given-names>${author.given-names}$if(author.dropping-particle)$ ${author.dropping-particle}$endif$</given-names>\n$if(author.prefix)$\n<prefix>${author.prefix}</prefix>\n$endif$\n$if(author.suffix)$\n<suffix>${author.suffix}</suffix>\n$endif$\n</name>\n$elseif(author.name)$\n<string-name>$author.name$</string-name>\n$else$\n<string-name>$author$</string-name>\n$endif$\n$for(author.affiliation)$\n${ it:affiliations.jats() }\n$endfor$\n$if(author.email)$\n<email>$author.email$</email>\n$endif$\n$if(author.cor-id)$\n<xref ref-type=\"corresp\" rid=\"cor-$author.cor-id$\"><sup>*</sup></xref>\n$endif$\n</contrib>\n$endfor$\n</contrib-group>\n$endif$\n<permissions>\n$for(copyright.statement)$\n<copyright-statement>$copyright.statement$</copyright-statement>\n$endfor$\n$for(copyright.year)$\n<copyright-year>$copyright.year$</copyright-year>\n$endfor$\n$for(copyright.holder)$\n<copyright-holder>$copyright.holder$</copyright-holder>\n$endfor$\n$if(copyright.text)$\n<license license-type=\"$copyright.type$\" xlink:href=\"$copyright.link$\">\n<license-p>$copyright.text$</license-p>\n</license>\n$endif$\n$for(license)$\n<license$if(it.type)$ license-type=\"${it.type}\"$endif$$if(it.link)$ xlink:href=\"${it.link}\"$endif$>\n<license-p>$if(it.text)$${it.text}$else$${it}$endif$</license-p>\n</license>\n$endfor$\n</permissions>\n<abstract>\n$abstract$\n</abstract>\n$if(tags)$\n<kwd-group kwd-group-type=\"author\">\n$for(tags)$\n<kwd>$tags$</kwd>\n$endfor$\n</kwd-group>\n$endif$\n$if(article.funding-statement)$\n<funding-group>\n<funding-statement>$article.funding-statement$</funding-statement>\n</funding-group>\n$endif$\n$if(supplementary-material)$\n<supplementary-material>\n$supplementary-material$\n</supplementary-material>\n$endif$\n</article-meta>\n</front>\n<body>\n$body$\n</body>\n<back>\n$if(back)$\n$back$\n$endif$\n</back>\n</article>\n"
  },
  {
    "path": "data/templates/default.jats_publishing",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n$if(xml-stylesheet)$\n<?xml-stylesheet type=\"text/xsl\" href=\"$xml-stylesheet$\"?>\n$endif$\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN\"\n                  \"JATS-publishing1.dtd\">\n${ article.jats_publishing() }\n"
  },
  {
    "path": "data/templates/default.jira",
    "content": "$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.latex",
    "content": "$document-metadata.latex()$\n$passoptions.latex()$\n\\documentclass[\n$for(babel-otherlangs)$\n  $babel-otherlangs$,\n$endfor$\n$if(babel-lang)$\n  $babel-lang$,\n$endif$\n$if(fontsize)$\n  $fontsize$,\n$endif$\n$if(papersize)$\n  $papersize$paper,\n$endif$\n$for(classoption)$\n  $classoption$$sep$,\n$endfor$\n]{$documentclass$}\n$if(beamerarticle)$\n\\usepackage{beamerarticle} % needs to be loaded first\n$endif$\n\\usepackage{xcolor}\n$if(geometry)$\n\\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}\n$endif$\n\\usepackage{amsmath,amssymb}\n$if(cancel)$\n\\usepackage{cancel}\n$endif$\n$--\n$-- section numbering\n$--\n$if(numbersections)$\n\\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}\n$else$\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n$endif$\n$fonts.latex()$\n$font-settings.latex()$\n$common.latex()$\n$for(header-includes)$\n$header-includes$\n$endfor$\n$after-header-includes.latex()$\n$hypersetup.latex()$\n$if(pdf-trailer-id)$\n\n\\ifXeTeX\n\\special{pdf:trailerid [ $pdf-trailer-id$ ]}\n\\fi\n\\ifPDFTeX\n\\pdftrailerid{}\n\\pdftrailer{/ID [ $pdf-trailer-id$ ]}\n\\fi\n\\ifLuaTeX\n\\pdfvariable trailerid {[ $pdf-trailer-id$ ]}\n\\fi\n$endif$\n\n$if(title)$\n\\title{$title$$if(thanks)$\\thanks{$thanks$}$endif$}\n$endif$\n$if(subtitle)$\n\\usepackage{etoolbox}\n\\makeatletter\n\\providecommand{\\subtitle}[1]{% add subtitle to \\maketitle\n  \\apptocmd{\\@title}{\\par {\\large #1 \\par}}{}{}\n}\n\\makeatother\n\\subtitle{$subtitle$}\n$endif$\n\\author{$for(author)$$author$$sep$ \\and $endfor$}\n\\date{$date$}\n\n\\begin{document}\n$if(has-frontmatter)$\n\\frontmatter\n$endif$\n$if(title)$\n\\maketitle\n$if(abstract)$\n\\begin{abstract}\n$abstract$\n\\end{abstract}\n$endif$\n$endif$\n\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$if(toc-title)$\n\\renewcommand*\\contentsname{$toc-title$}\n$endif$\n{\n$if(colorlinks)$\n$if(toccolor)$\n\\hypersetup{linkcolor=$toccolor$}\n$endif$\n$endif$\n\\setcounter{tocdepth}{$toc-depth$}\n\\tableofcontents\n}\n$endif$\n$if(lof)$\n\\listoffigures\n$endif$\n$if(lot)$\n\\listoftables\n$endif$\n$if(linestretch)$\n\\setstretch{$linestretch$}\n$endif$\n$if(has-frontmatter)$\n\\mainmatter\n$endif$\n$body$\n\n$if(has-frontmatter)$\n\\backmatter\n$endif$\n$if(nocite-ids)$\n\\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}\n$endif$\n$if(natbib)$\n$if(bibliography)$\n$if(biblio-title)$\n$if(has-chapters)$\n\\renewcommand\\bibname{$biblio-title$}\n$else$\n\\renewcommand\\refname{$biblio-title$}\n$endif$\n$endif$\n\\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}\n\n$endif$\n$endif$\n$if(biblatex)$\n\\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$\n\n$endif$\n$for(include-after)$\n$include-after$\n\n$endfor$\n\\end{document}\n"
  },
  {
    "path": "data/templates/default.man",
    "content": "$if(has-tables)$\n'\\\" t\n$endif$\n$if(pandoc-version)$\n.\\\" Automatically generated by Pandoc $pandoc-version$\n.\\\"\n$endif$\n$if(adjusting)$\n.ad $adjusting$\n$endif$\n.TH \"$title/nowrap$\" \"$section/nowrap$\" \"$date/nowrap$\" \"$footer/nowrap$\"$if(header)$ \"$header/nowrap$\"$endif$\n$for(header-includes)$\n$header-includes$\n$endfor$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n$if(author)$\n.SH AUTHORS\n$for(author)$$author$$sep$; $endfor$.\n$endif$\n"
  },
  {
    "path": "data/templates/default.markdown",
    "content": "$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$table-of-contents$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.markua",
    "content": "$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$table-of-contents$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.mediawiki",
    "content": "$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n__TOC__\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.ms",
    "content": "$if(pandoc-version)$\n.\\\" Automatically generated by Pandoc $pandoc-version$\n.\\\"\n$endif$\n.\\\" **** Custom macro definitions *********************************\n.\\\" * Super/subscript\n.\\\" (https://lists.gnu.org/archive/html/groff/2012-07/msg00046.html)\n.ds { \\v'-0.3m'\\\\s[\\\\n[.s]*9u/12u]\n.ds } \\s0\\v'0.3m'\n.ds < \\v'0.3m'\\s[\\\\n[.s]*9u/12u]\n.ds > \\s0\\v'-0.3m'\n.\\\" * Horizontal line\n.de HLINE\n.LP\n.ce\n\\l'20'\n..\n$if(highlighting-macros)$\n.\\\" * Syntax highlighting macros\n$highlighting-macros$\n$endif$\n.\\\" **** Settings *************************************************\n.\\\" text width\n.nr LL 5.5i\n.\\\" left margin\n.nr PO 1.25i\n.\\\" top margin\n.nr HM 1.25i\n.\\\" bottom margin\n.nr FM 1.25i\n.\\\" header/footer width\n.nr LT \\n[LL]\n.\\\" point size\n.nr PS $if(pointsize)$$pointsize$$else$10p$endif$\n.\\\" line height\n.nr VS $if(lineheight)$$lineheight$$else$12p$endif$\n.\\\" font family: A, BM, H, HN, N, P, T, ZCM\n.fam $if(fontfamily)$$fontfamily$$else$T$endif$\n.\\\" paragraph indent\n.nr PI $if(indent)$$indent$$else$0m$endif$\n.\\\" interparagraph space\n.nr PD 0.4v\n.\\\" footnote width\n.nr FL \\n[LL]\n.\\\" footnote point size\n.nr FPS (\\n[PS] - 2000)\n$if(papersize)$\n.\\\" paper size\n.ds paper $papersize$\n$endif$\n.\\\" color used for strikeout\n.defcolor strikecolor rgb 0.7 0.7 0.7\n.\\\" point size difference between heading levels\n.nr PSINCR 1p\n.\\\" heading level above which point size no longer changes\n.nr GROWPS 2\n.\\\" comment these out if you want a dot after section numbers:\n.als SN SN-NO-DOT\n.als SN-STYLE SN-NO-DOT\n.\\\" page numbers in footer, centered\n.ds CH\n.ds CF %\n$if(adjusting)$\n.ad $adjusting$\n$endif$\n$if(hyphenate)$\n.hy\n$else$\n.nh\n$endif$\n$if(has-inline-math)$\n.EQ\ndelim @@\n.EN\n$endif$\n$if(pdf-engine)$\n.\\\" color for links (rgb)\n.ds PDFHREF.COLOUR   0.35 0.00 0.60\n.\\\" border for links (default none)\n.ds PDFHREF.BORDER   0 0 0\n.\\\" pdf outline fold level\n.nr PDFOUTLINE.FOLDLEVEL 3\n.\\\" start out in outline view\n.pdfview /PageMode /UseOutlines\n.\\\" ***************************************************************\n.\\\" PDF metadata\n.pdfinfo /Title \"$title-meta$\"\n.pdfinfo /Author \"$author-meta$\"\n$endif$\n$for(header-includes)$\n$header-includes$\n$endfor$\n$if(title)$\n.TL\n$title$\n$endif$\n$for(author)$\n.AU\n$author$\n$endfor$\n$if(date)$\n.AU\n.sp 0.5\n.ft R\n$date$\n$endif$\n$if(abstract)$\n.AB\n$abstract$\n.AE\n$endif$\n.\\\" 1 column (use .2C for two column)\n.1C\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$if(toc)$\n.TC\n$endif$\n$for(include-after)$\n$include-after$\n$endfor$\n.pdfsync\n"
  },
  {
    "path": "data/templates/default.muse",
    "content": "$if(author)$\n#author $for(author)$$author$$sep$; $endfor$\n$endif$\n$if(title)$\n#title $title$\n$endif$\n$if(lang)$\n#lang $lang$\n$endif$\n$if(LISTtitle)$\n#LISTtitle $LISTtitle$\n$endif$\n$if(subtitle)$\n#subtitle $subtitle$\n$endif$\n$if(SORTauthors)$\n#SORTauthors $SORTauthors$\n$endif$\n$if(SORTtopics)$\n#SORTtopics $SORTtopics$\n$endif$\n$if(date)$\n#date $date$\n$endif$\n$if(notes)$\n#notes $notes$\n$endif$\n$if(source)$\n#source $source$\n$endif$\n\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.opendocument",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\" xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" office:version=\"1.3\">\n  <office:font-face-decls>\n    <style:font-face style:name=\"Courier New\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\" svg:font-family=\"'Courier New'\" />\n  </office:font-face-decls>\n  <office:automatic-styles>\n    $automatic-styles$\n  </office:automatic-styles>\n$for(header-includes)$\n  $header-includes$\n$endfor$\n<office:body>\n<office:text>\n$if(title)$\n<text:p text:style-name=\"Title\">$title$</text:p>\n$endif$\n$if(subtitle)$\n<text:p text:style-name=\"Subtitle\">$subtitle$</text:p>\n$endif$\n$for(author)$\n<text:p text:style-name=\"Author\">$author$</text:p>\n$endfor$\n$if(date)$\n<text:p text:style-name=\"Date\">$date$</text:p>\n$endif$\n$if(abstract)$\n$abstract$\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$if(toc)$\n<text:table-of-content>\n  <text:table-of-content-source text:outline-level=\"$toc-depth$\">\n    <text:index-title-template text:style-name=\"Contents_20_Heading\">$toc-title$</text:index-title-template>\n    <text:table-of-content-entry-template text:outline-level=\"1\"\n    text:style-name=\"Contents_20_1\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"2\"\n    text:style-name=\"Contents_20_2\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"3\"\n    text:style-name=\"Contents_20_3\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"4\"\n    text:style-name=\"Contents_20_4\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"5\"\n    text:style-name=\"Contents_20_5\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"6\"\n    text:style-name=\"Contents_20_6\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"7\"\n    text:style-name=\"Contents_20_7\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"8\"\n    text:style-name=\"Contents_20_8\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"9\"\n    text:style-name=\"Contents_20_9\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n    <text:table-of-content-entry-template text:outline-level=\"10\"\n    text:style-name=\"Contents_20_10\">\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-chapter />\n      <text:index-entry-text />\n      <text:index-entry-link-end />\n      <text:index-entry-tab-stop style:type=\"right\"\n      style:leader-char=\".\" />\n      <text:index-entry-link-start text:style-name=\"Internet_20_link\" />\n      <text:index-entry-page-number />\n      <text:index-entry-link-end />\n    </text:table-of-content-entry-template>\n  </text:table-of-content-source>\n</text:table-of-content>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</office:text>\n</office:body>\n</office:document-content>\n"
  },
  {
    "path": "data/templates/default.openxml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<w:document xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\">\n<w:body>\n$if(title)$\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"$title-style-id$\" />\n      </w:pPr>\n      $title$\n    </w:p>\n$endif$\n$if(subtitle)$\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"$subtitle-style-id$\" />\n      </w:pPr>\n      $subtitle$\n    </w:p>\n$endif$\n$for(author)$\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"$author-style-id$\" />\n      </w:pPr>\n      $author$\n    </w:p>\n$endfor$\n$if(date)$\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"$date-style-id$\" />\n      </w:pPr>\n      $date$\n    </w:p>\n$endif$\n$if(abstract)$\n$if(abstract-title)$\n    <w:p>\n      <w:pPr>\n        <w:pStyle w:val=\"$abstract-title-style-id$\" />\n      </w:pPr>\n      <w:r><w:t xml:space=\"preserve\">$abstract-title$</w:t></w:r>\n    </w:p>\n$endif$\n    $abstract$\n$endif$\n$for(include-before)$\n    $include-before$\n$endfor$\n$if(toc)$\n    $toc$\n$endif$\n$if(lof)$\n    $lof$\n$endif$\n$if(lot)$\n    $lot$\n$endif$\n    $body$\n$for(include-after)$\n    $include-after$\n$endfor$\n    $sectpr$\n  </w:body>\n</w:document>\n"
  },
  {
    "path": "data/templates/default.opml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<opml version=\"2.0\">\n  <head>\n    <title>$title$</title>\n    <dateModified>$date$</dateModified>\n    <ownerName>$for(author)$$author$$sep$; $endfor$</ownerName>\n  </head>\n  <body>\n$body$\n  </body>\n</opml>\n"
  },
  {
    "path": "data/templates/default.org",
    "content": "$if(title)$\n#+title: $title$\n\n$endif$\n$if(author)$\n#+author: $for(author)$$author$$sep$; $endfor$\n$endif$\n$if(date)$\n#+date: $date$\n\n$endif$\n$if(options/pairs)$\n$for(options/pairs)$\n#+options: ${it.key}:${it.value}\n$endfor$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$if(abstract)$\n#+begin_abstract\n$abstract$\n#+end_abstract\n$endif$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.plain",
    "content": "$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$table-of-contents$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.revealjs",
    "content": "<!DOCTYPE html>\n<html$if(lang)$ lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"generator\" content=\"pandoc\">\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\">\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\">\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\">\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n  <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui\">\n  <link rel=\"stylesheet\" href=\"$revealjs-url$/dist/reset.css\">\n  <link rel=\"stylesheet\" href=\"$revealjs-url$/dist/reveal.css\">\n  <style>\n    .reveal .sourceCode {  /* see #7635 */\n      overflow: visible;\n    }\n    $styles.html()$\n  </style>\n$if(theme)$\n  <link rel=\"stylesheet\" href=\"$revealjs-url$/dist/theme/$theme$.css\" id=\"theme\">\n$else$\n  <link rel=\"stylesheet\" href=\"$revealjs-url$/dist/theme/black.css\" id=\"theme\">\n$endif$\n$if(highlight-js)$\n  <link rel=\"stylesheet\" href=\"$revealjs-url$/plugin/highlight/$highlightjs-theme$.css\">\n$endif$\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\"/>\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n  <div class=\"reveal\">\n    <div class=\"slides\">\n\n$if(title)$\n<section id=\"$idprefix$title-slide\"$for(title-slide-attributes/pairs)$ $it.key$=\"$it.value$\"$endfor$>\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <p class=\"subtitle\">$subtitle$</p>\n$endif$\n$for(author)$\n  <p class=\"author\">$author$</p>\n$endfor$\n$for(institute)$\n  <p class=\"institute\">$institute$</p>\n$endfor$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n</section>\n$endif$\n$if(toc)$\n<section id=\"$idprefix$TOC\">\n<nav role=\"doc-toc\"> \n$if(toc-title)$\n<h2 id=\"$idprefix$toc-title\">$toc-title$</h2>\n$endif$\n$table-of-contents$\n</nav>\n</section>\n$endif$\n\n$body$\n    </div>\n  </div>\n\n  <script src=\"$revealjs-url$/dist/reveal.js\"></script>\n\n  <!-- reveal.js plugins -->\n  <script src=\"$revealjs-url$/plugin/notes/notes.js\"></script>\n  <script src=\"$revealjs-url$/plugin/search/search.js\"></script>\n  <script src=\"$revealjs-url$/plugin/zoom/zoom.js\"></script>\n$if(mathjax)$\n  <script src=\"$revealjs-url$/plugin/math/math.js\"></script>\n$endif$\n$if(highlight-js)$\n  <script src=\"$revealjs-url$/plugin/highlight/highlight.js\"></script>\n$endif$\n\n  <script>\n\n      // Full list of configuration options available at:\n      // https://revealjs.com/config/\n      Reveal.initialize({\n        // Display controls in the bottom right corner\n        controls: $controls$,\n\n        // Help the user learn the controls by providing hints, for example by\n        // bouncing the down arrow when they first encounter a vertical slide\n        controlsTutorial: $controlsTutorial$,\n\n        // Determines where controls appear, \"edges\" or \"bottom-right\"\n        controlsLayout: '$controlsLayout$',\n\n        // Visibility rule for backwards navigation arrows; \"faded\", \"hidden\"\n        // or \"visible\"\n        controlsBackArrows: '$controlsBackArrows$',\n\n        // Display a presentation progress bar\n        progress: $progress$,\n\n        // Display the page number of the current slide\n        slideNumber: $slideNumber$,\n\n        // 'all', 'print', or 'speaker'\n        showSlideNumber: '$showSlideNumber$',\n\n        // Add the current slide number to the URL hash so that reloading the\n        // page/copying the URL will return you to the same slide\n        hash: $hash$,\n\n        // Start with 1 for the hash rather than 0\n        hashOneBasedIndex: $hashOneBasedIndex$,\n\n        // Flags if we should monitor the hash and change slides accordingly\n        respondToHashChanges: $respondToHashChanges$,\n\n        // Push each slide change to the browser history\n        history: $history$,\n\n        // Enable keyboard shortcuts for navigation\n        keyboard: $keyboard$,\n\n        // Enable the slide overview mode\n        overview: $overview$,\n\n        // Disables the default reveal.js slide layout (scaling and centering)\n        // so that you can use custom CSS layout\n        disableLayout: $disableLayout$,\n\n        // Vertical centering of slides\n        center: $center$,\n\n        // Enables touch navigation on devices with touch input\n        touch: $touch$,\n\n        // Loop the presentation\n        loop: $loop$,\n\n        // Change the presentation direction to be RTL\n        rtl: $rtl$,\n\n        // see https://revealjs.com/vertical-slides/#navigation-mode\n        navigationMode: '$navigationMode$',\n\n        // Randomizes the order of slides each time the presentation loads\n        shuffle: $shuffle$,\n\n        // Turns fragments on and off globally\n        fragments: $fragments$,\n\n        // Flags whether to include the current fragment in the URL,\n        // so that reloading brings you to the same fragment position\n        fragmentInURL: $fragmentInURL$,\n\n        // Flags if the presentation is running in an embedded mode,\n        // i.e. contained within a limited portion of the screen\n        embedded: $embedded$,\n\n        // Flags if we should show a help overlay when the questionmark\n        // key is pressed\n        help: $help$,\n\n        // Flags if it should be possible to pause the presentation (blackout)\n        pause: $pause$,\n\n        // Flags if speaker notes should be visible to all viewers\n        showNotes: $showNotes$,\n\n        // Global override for autoplaying embedded media (null/true/false)\n        autoPlayMedia: $autoPlayMedia$,\n\n        // Global override for preloading lazy-loaded iframes (null/true/false)\n        preloadIframes: $preloadIframes$,\n\n        // Number of milliseconds between automatically proceeding to the\n        // next slide, disabled when set to 0, this value can be overwritten\n        // by using a data-autoslide attribute on your slides\n        autoSlide: $autoSlide$,\n\n        // Stop auto-sliding after user input\n        autoSlideStoppable: $autoSlideStoppable$,\n\n        // Use this method for navigation when auto-sliding\n        autoSlideMethod: $autoSlideMethod$,\n\n        // Specify the average time in seconds that you think you will spend\n        // presenting each slide. This is used to show a pacing timer in the\n        // speaker view\n        defaultTiming: $defaultTiming$,\n\n        // Enable slide navigation via mouse wheel\n        mouseWheel: $mouseWheel$,\n\n        // The display mode that will be used to show slides\n        display: '$display$',\n\n        // Hide cursor if inactive\n        hideInactiveCursor: $hideInactiveCursor$,\n\n        // Time before the cursor is hidden (in ms)\n        hideCursorTime: $hideCursorTime$,\n\n        // Opens links in an iframe preview overlay\n        previewLinks: $previewLinks$,\n\n        // Transition style (none/fade/slide/convex/concave/zoom)\n        transition: '$transition$',\n\n        // Transition speed (default/fast/slow)\n        transitionSpeed: '$transitionSpeed$',\n\n        // Transition style for full page slide backgrounds\n        // (none/fade/slide/convex/concave/zoom)\n        backgroundTransition: '$backgroundTransition$',\n\n        // Number of slides away from the current that are visible\n        viewDistance: $viewDistance$,\n\n        // Number of slides away from the current that are visible on mobile\n        // devices. It is advisable to set this to a lower number than\n        // viewDistance in order to save resources.\n        mobileViewDistance: $mobileViewDistance$,\n$if(view)$\n\n        // Enable scroll view\n        view: '$view/nowrap$',\n        // see https://revealjs.com/scroll-view/#scrollbar\n$if(scrollProgressAuto)$\n        scrollProgress: 'auto',\n$elseif(scrollProgress)$\n        scrollProgress: $scrollProgress$,\n$else$\n        scrollProgress: false,\n$endif$\n        // see https://revealjs.com/scroll-view/#url-activation\n        scrollActivationWidth: $scrollActivationWidth$,\n        // see https://revealjs.com/scroll-view/#scroll-snapping\n$if(scrollSnap)$\n        scrollSnap: '$scrollSnap/nowrap$',\n$else$\n        scrollSnap: false,\n$endif$\n        // Experimental. see https://revealjs.com/scroll-view/#scroll-snapping\n        scrollLayout: '$scrollLayout/nowrap$',\n$endif$\n$if(parallaxBackgroundImage)$\n\n        // Parallax background image\n        parallaxBackgroundImage: '$parallaxBackgroundImage/nowrap$', // e.g. \"'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'\"\n$else$\n$if(background-image)$\n\n       // Parallax background image\n       parallaxBackgroundImage: '$background-image/nowrap$', // e.g. \"'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'\"\n$endif$\n$endif$\n$if(parallaxBackgroundSize)$\n\n        // Parallax background size\n        parallaxBackgroundSize: '$parallaxBackgroundSize/nowrap$', // CSS syntax, e.g. \"2100px 900px\"\n$endif$\n$if(parallaxBackgroundHorizontal)$\n\n        // Amount to move parallax background (horizontal and vertical) on slide change\n        // Number, e.g. 100\n        parallaxBackgroundHorizontal: $parallaxBackgroundHorizontal/nowrap$,\n$endif$\n$if(parallaxBackgroundVertical)$\n\n        parallaxBackgroundVertical: $parallaxBackgroundVertical/nowrap$,\n$endif$\n$if(width)$\n\n        // The \"normal\" size of the presentation, aspect ratio will be preserved\n        // when the presentation is scaled to fit different resolutions. Can be\n        // specified using percentage units.\n        width: $width$,\n$endif$\n$if(height)$\n\n        height: $height$,\n$endif$\n$if(margin)$\n\n        // Factor of the display size that should remain empty around the content\n        margin: $margin$,\n$endif$\n$if(minScale)$\n\n        // Bounds for smallest/largest possible scale to apply to content\n        minScale: $minScale$,\n$endif$\n$if(maxScale)$\n\n        maxScale: $maxScale$,\n$endif$\n$if(mathjax)$\n\n        math: {\n          mathjax: '$mathjaxurl$',\n          config: 'TeX-AMS_HTML-full',\n          tex2jax: {\n            inlineMath: [['\\\\(','\\\\)']],\n            displayMath: [['\\\\[','\\\\]']],\n            balanceBraces: true,\n            processEscapes: false,\n            processRefs: true,\n            processEnvironments: true,\n            preview: 'TeX',\n            skipTags: ['script','noscript','style','textarea','pre','code'],\n            ignoreClass: 'tex2jax_ignore',\n            processClass: 'tex2jax_process'\n          },\n        },\n$endif$\n\n        // reveal.js plugins\n        plugins: [\n$if(mathjax)$\n          RevealMath,\n$endif$\n$if(highlight-js)$\n          RevealHighlight,\n$endif$\n          RevealNotes,\n          RevealSearch,\n          RevealZoom\n        ]\n      });\n    </script>\n  $for(include-after)$\n  $include-after$\n  $endfor$\n  </body>\n</html>\n"
  },
  {
    "path": "data/templates/default.rst",
    "content": "$if(titleblock)$\n$titleblock$\n\n$for(author)$\n:Author: $^$$author$\n$endfor$\n$if(authors)$\n:Authors:\n   $author$\n$endif$\n$if(date)$\n:Date: $^$$date$\n$endif$\n$if(address)$\n:Address: $^$$address$\n$endif$\n$if(contact)$\n:Contact: $^$$contact$\n$endif$\n$if(copyright)$\n:Copyright: $^$$copyright$\n$endif$\n$if(dedication)$\n:Dedication: $^$$dedication$\n$endif$\n$if(organization)$\n:Organization: $^$$organization$\n$endif$\n$if(revision)$\n:Revision: $^$$revision$\n$endif$\n$if(status)$\n:Status: $^$$status$\n$endif$\n$if(version)$\n:Version: $^$$version$\n$endif$\n$if(abstract)$\n:Abstract:\n   $abstract$\n$endif$\n\n$endif$\n$if(rawtex)$\n.. role:: raw-latex(raw)\n   :format: latex\n..\n\n$endif$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n.. contents::\n   :depth: $toc-depth$\n..\n\n$endif$\n$if(number-sections)$\n.. section-numbering::\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.rtf",
    "content": "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 \\fmodern Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n$if(title)$\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\b \\fs36 $title$\\par}\n$endif$\n$for(author)$\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  $author$\\par}\n$endfor$\n$if(date)$\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  $date$\\par}\n$endif$\n$if(spacer)$\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n$endif$\n$if(toc)$\n$table-of-contents$\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n}\n"
  },
  {
    "path": "data/templates/default.s5",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"version\" content=\"S5 1.1\" />\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style type=\"text/css\">\n    $styles.html()$\n  </style>\n  <!-- configuration parameters -->\n  <meta name=\"defaultView\" content=\"slideshow\" />\n  <meta name=\"controlVis\" content=\"hidden\" />\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" type=\"text/css\" />\n$endfor$\n  <!-- style sheet links -->\n  <link rel=\"stylesheet\" href=\"$s5-url$/slides.css\" type=\"text/css\" media=\"projection\" id=\"slideProj\" />\n  <link rel=\"stylesheet\" href=\"$s5-url$/outline.css\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" />\n  <link rel=\"stylesheet\" href=\"$s5-url$/print.css\" type=\"text/css\" media=\"print\" id=\"slidePrint\" />\n  <link rel=\"stylesheet\" href=\"$s5-url$/opera.css\" type=\"text/css\" media=\"projection\" id=\"operaFix\" />\n  <!-- S5 JS -->\n  <script src=\"$s5-url$/slides.js\" type=\"text/javascript\"></script>\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n<div class=\"layout\">\n<div id=\"controls\"></div>\n<div id=\"currentSlide\"></div>\n<div id=\"header\"></div>\n<div id=\"footer\">\n  <h1>$date$</h1>\n  <h2>$title$</h2>\n</div>\n</div>\n<div class=\"presentation\">\n$if(title)$\n<div class=\"title-slide slide\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h2 class=\"subtitle\">$subtitle$</h2>\n$endif$\n$if(author)$\n  <h3 class=\"author\">$for(author)$$author$$sep$<br/>$endfor$</h3>\n$endif$\n$if(institute)$\n  <h3 class=\"institute\">$for(institute)$$institute$$sep$<br/>$endfor$</h3>\n$endif$\n$if(date)$\n  <h4 class=\"date\">$date$</h4>\n$endif$\n</div>\n$endif$\n$if(toc)$\n<div class=\"slide\" id=\"$idprefix$TOC\">\n$table-of-contents$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.slideous",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style type=\"text/css\">\n    $styles.html()$\n  </style>\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n    href=\"$slideous-url$/slideous.css\" />\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n   href=\"$css$\" />\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n  <script src=\"$slideous-url$/slideous.js\"\n    charset=\"utf-8\" type=\"text/javascript\"></script>\n$if(duration)$\n  <meta name=\"duration\" content=\"$duration$\" />\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n<div id=\"statusbar\">\n<span style=\"float:right;\">\n<span style=\"margin-right:4em;font-weight:bold;\"><span id=\"slideidx\"></span> of {$$slidecount}</span>\n<button id=\"homebutton\" title=\"first slide\">1</button>\n<button id=\"prevslidebutton\" title=\"previous slide\">&laquo;</button>\n<button id=\"previtembutton\" title=\"previous item\">&lsaquo;</button>\n<button id=\"nextitembutton\" title=\"next item\">&rsaquo;</button>\n<button id=\"nextslidebutton\" title=\"next slide\">&raquo;</button>\n<button id=\"endbutton\" title=\"last slide\">{$$slidecount}</button>\n<button id=\"incfontbutton\" title=\"content\">A+</button>\n<button id=\"decfontbutton\" title=\"first slide\">A-</button>\n<select id=\"tocbox\" size=\"1\"><option></option></select>\n</span>\n<span id=\"eos\">&frac12;</span>\n<span title=\"{$$location}, {$$date}\">{$$title}, {$$author}</span>\n</div>\n$if(title)$\n<div class=\"slide titlepage\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$if(author)$\n  <p class=\"author\">\n$for(author)$$author$$sep$<br/>$endfor$\n  </p>\n$endif$\n$if(institute)$\n  <p class=\"institute\">\n$for(institute)$$institute$$sep$<br/>$endfor$\n  </p>\n$endif$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n</div>\n$endif$\n$if(toc)$\n<div class=\"slide\" id=\"$idprefix$TOC\">\n$table-of-contents$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.slidy",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$$if(dir)$ dir=\"$dir$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n$if(keywords)$\n  <meta name=\"keywords\" content=\"$for(keywords)$$keywords$$sep$, $endfor$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>\n  <style type=\"text/css\">\n    $styles.html()$\n  </style>\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n    href=\"$slidy-url$/styles/slidy.css\" />\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n   href=\"$css$\" />\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n  <script src=\"$slidy-url$/scripts/slidy.js\"\n    charset=\"utf-8\" type=\"text/javascript\"></script>\n$if(duration)$\n  <meta name=\"duration\" content=\"$duration$\" />\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n$if(title)$\n<div class=\"slide titlepage\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <p class=\"subtitle\">$subtitle$</p>\n$endif$\n$if(author)$\n  <p class=\"author\">\n$for(author)$$author$$sep$<br/>$endfor$\n  </p>\n$endif$\n$if(institute)$\n  <p class=\"institute\">\n$for(institute)$$institute$$sep$<br/>$endfor$\n  </p>\n$endif$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n</div>\n$endif$\n$if(toc)$\n<div class=\"slide\" id=\"$idprefix$TOC\">\n$table-of-contents$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"
  },
  {
    "path": "data/templates/default.tei",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TEI xmlns=\"http://www.tei-c.org/ns/1.0\"$if(lang)$ xml:lang=\"$lang$\"$endif$>\n<teiHeader>\n  <fileDesc>\n    <titleStmt>\n      <title>$title$</title>\n$for(author)$\n      <author>$author$</author>\n$endfor$\n    </titleStmt>\n    <publicationStmt>\n$if(publicationStmt)$\n      <p>$if(publicationStmt)$$publicationStmt$$endif$</p>\n$endif$\n$if(license)$\n      <availability><licence>$license$</licence></availability>\n$endif$\n$if(publisher)$\n      <publisher>$publisher$</publisher>\n$endif$\n$if(pubPlace)$\n      <pubPlace>$pubPlace$</pubPlace>\n$endif$\n$if(address)$\n      <address>$address$</address>\n$endif$\n$if(date)$\n      <date>$date$</date>\n$endif$\n    </publicationStmt>\n    <sourceDesc>\n$if(sourceDesc)$\n      $sourceDesc$\n$else$\n      <p>Produced by pandoc.</p>\n$endif$\n    </sourceDesc>\n  </fileDesc>\n</teiHeader>\n<text>\n$for(include-before)$\n$include-before$\n$endfor$\n<body>\n$body$\n</body>\n$for(include-after)$\n$include-after$\n$endfor$\n</text>\n</TEI>\n"
  },
  {
    "path": "data/templates/default.texinfo",
    "content": "\\input texinfo  @c -*-texinfo-*-\n$if(filename)$\n@setfilename $filename$\n$endif$\n$if(title)$\n@settitle $title$$if(version)$ $version$$endif$\n$endif$\n\n@documentencoding UTF-8\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n$if(strikeout)$\n@macro textstrikeout{text}\n~~\\text\\~~\n@end macro\n\n$endif$\n@ifnottex\n@paragraphindent 0\n@end ifnottex\n$if(titlepage)$\n@titlepage\n@title $title$\n$if(version)$\n@subtitle $version$\n$endif$\n$for(author)$\n@author $author$\n$endfor$\n$if(date)$\n$date$\n$endif$\n@end titlepage\n\n$endif$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n@contents\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n\n@bye\n"
  },
  {
    "path": "data/templates/default.textile",
    "content": "$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.typst",
    "content": "#let horizontalrule = line(start: (25%,0%), end: (75%,0%))\n\n#show terms.item: it => block(breakable: false)[\n  #text(weight: \"bold\")[#it.term]\n  #block(inset: (left: 1.5em, top: -0.4em))[#it.description]\n]\n\n#set table(\n  inset: 6pt,\n  stroke: none\n)\n\n#show figure.where(\n  kind: table\n): set figure.caption(position: $if(table-caption-position)$$table-caption-position$$else$top$endif$)\n\n#show figure.where(\n  kind: image\n): set figure.caption(position: $if(figure-caption-position)$$figure-caption-position$$else$bottom$endif$)\n\n$if(highlighting-definitions)$\n// syntax highlighting functions from skylighting:\n$highlighting-definitions$\n\n$endif$\n$if(template)$\n#import \"$template$\": conf\n$else$\n$template.typst()$\n$endif$\n\n$if(smart)$\n$else$\n#set smartquote(enabled: false)\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n#show: doc => conf(\n$if(title)$\n  title: [$title$],\n$endif$\n$if(subtitle)$\n  subtitle: [$subtitle$],\n$endif$\n$if(author)$\n  authors: (\n$for(author)$\n$if(author.name)$\n    ( name: [$author.name$],\n      affiliation: [$author.affiliation$],\n      email: [$author.email$] ),\n$else$\n    ( name: [$author$],\n      affiliation: \"\",\n      email: \"\" ),\n$endif$\n$endfor$\n    ),\n$endif$\n$if(keywords)$\n  keywords: ($for(keywords)$$keywords$$sep$,$endfor$),\n$endif$\n$if(date)$\n  date: [$date$],\n$endif$\n$if(lang)$\n  lang: \"$lang$\",\n$endif$\n$if(region)$\n  region: \"$region$\",\n$endif$\n$if(abstract-title)$\n  abstract-title: [$abstract-title$],\n$endif$\n$if(abstract)$\n  abstract: [$abstract$],\n$endif$\n$if(thanks)$\n  thanks: [$thanks$],\n$endif$\n$if(margin)$\n  margin: ($for(margin/pairs)$$margin.key$: $margin.value$,$endfor$),\n$endif$\n$if(papersize)$\n  paper: \"$papersize$\",\n$endif$\n$if(mainfont)$\n  font: (\"$mainfont$\",),\n$endif$\n$if(fontsize)$\n  fontsize: $fontsize$,\n$endif$\n$if(mathfont)$\n  mathfont: ($for(mathfont)$\"$mathfont$\",$endfor$),\n$endif$\n$if(codefont)$\n  codefont: ($for(codefont)$\"$codefont$\",$endfor$),\n$endif$\n$if(linestretch)$\n  linestretch: $linestretch$,\n$endif$\n$if(section-numbering)$\n  sectionnumbering: \"$section-numbering$\",\n$endif$\n  pagenumbering: $if(page-numbering)$\"$page-numbering$\"$else$none$endif$,\n$if(linkcolor)$\n  linkcolor: [$linkcolor$],\n$endif$\n$if(citecolor)$\n  citecolor: [$citecolor$],\n$endif$\n$if(filecolor)$\n  filecolor: [$filecolor$],\n$endif$\n  cols: $if(columns)$$columns$$else$1$endif$,\n  doc,\n)\n\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n#outline(\n  title: auto,\n  depth: $toc-depth$\n);\n$endif$\n\n$body$\n\n$if(citations)$\n$for(nocite-ids)$\n#cite(label(\"${it}\"), form: none)\n$endfor$\n$if(csl)$\n\n#set bibliography(style: \"$csl$\")\n$elseif(bibliographystyle)$\n\n#set bibliography(style: \"$bibliographystyle$\")\n$endif$\n$if(bibliography)$\n\n#bibliography(($for(bibliography)$\"$bibliography$\"$sep$,$endfor$)$if(full-bibliography)$, full: true$endif$)\n$endif$\n$endif$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.vimdoc",
    "content": "$if(filename)$*${filename}*\t$endif$$if(abstract)$${abstract}$endif$$if(filename)$\n\n\n$endif$$if(combined-title)$${combined-title}\n\n\n$endif$$toc-reminder$\n\n$if(toc)$\n$toc$\n\n$endif$\n\n$body$\n\n $modeline$\n"
  },
  {
    "path": "data/templates/default.xwiki",
    "content": "$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n{{toc /}}\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/default.zimwiki",
    "content": "Content-Type: text/x-zim-wiki\nWiki-Format: zim 0.4\n\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n__TOC__\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"
  },
  {
    "path": "data/templates/document-metadata.latex",
    "content": "$--\n$-- PDF standard support (PDF/A, PDF/UA, PDF/X)\n$-- Requires LuaLaTeX and recent LaTeX (2023+)\n$--\n$if(pdfstandard)$\n\\DocumentMetadata{\n$if(pdfstandard.version)$\n  pdfversion=$pdfstandard.version$,\n$endif$\n$if(pdfstandard.standards)$\n  pdfstandard={$for(pdfstandard.standards)$$it$$sep$,$endfor$},\n$endif$\n$if(pdfstandard.tagging)$\n  tagging=on,\n$endif$\n$if(lang)$\n  lang=$lang$,\n$endif$\n  xmp=true}\n$endif$\n"
  },
  {
    "path": "data/templates/font-settings.latex",
    "content": "$-- User font settings (must come after default font and Beamer theme)\n$if(fontfamily)$\n\\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}\n$endif$\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n$if(mainfont)$\n$if(mainfontfallback)$\n  \\ifLuaTeX\n    \\usepackage{luaotfload}\n    \\directlua{luaotfload.add_fallback(\"mainfontfallback\",{\n      $for(mainfontfallback)$\"$mainfontfallback$\"$sep$,$endfor$\n    })}\n  \\fi\n$endif$\n  \\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}\n$endif$\n$if(sansfont)$\n$if(sansfontfallback)$\n  \\ifLuaTeX\n    \\usepackage{luaotfload}\n    \\directlua{luaotfload.add_fallback(\"sansfontfallback\",{\n      $for(sansfontfallback)$\"$sansfontfallback$\"$sep$,$endfor$\n    })}\n  \\fi\n$endif$\n  \\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}\n$endif$\n$if(monofont)$\n$if(monofontfallback)$\n  \\ifLuaTeX\n    \\usepackage{luaotfload}\n    \\directlua{luaotfload.add_fallback(\"monofontfallback\",{\n      $for(monofontfallback)$\"$monofontfallback$\"$sep$,$endfor$\n    })}\n  \\fi\n$endif$\n  \\setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}\n$endif$\n$for(fontfamilies)$\n  \\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}\n$endfor$\n$if(mathfont)$\n$if(mathspec)$\n  \\ifXeTeX\n    \\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}\n  \\else\n    \\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}\n  \\fi\n$else$\n  \\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}\n$endif$\n$endif$\n$if(CJKmainfont)$\n  \\ifXeTeX\n    \\usepackage{xeCJK}\n    \\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}\n$if(CJKsansfont)$\n    \\setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}\n$endif$\n$if(CJKmonofont)$\n    \\setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}\n$endif$\n  \\fi\n$endif$\n$if(luatexjapresetoptions)$\n  \\ifLuaTeX\n    \\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}\n  \\fi\n$endif$\n$if(CJKmainfont)$\n  \\ifLuaTeX\n    \\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}\n    \\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}\n  \\fi\n$endif$\n\\fi\n$if(zero-width-non-joiner)$\n%% Support for zero-width non-joiner characters.\n\\makeatletter\n\\def\\zerowidthnonjoiner{%\n  % Prevent ligatures and adjust kerning, but still support hyphenating.\n  \\texorpdfstring{%\n    \\TextOrMath{\\nobreak\\discretionary{-}{}{\\kern.03em}%\n      \\ifvmode\\else\\nobreak\\hskip\\z@skip\\fi}{}%\n  }{}%\n}\n\\makeatother\n\\ifPDFTeX\n  \\DeclareUnicodeCharacter{200C}{\\zerowidthnonjoiner}\n\\else\n  \\catcode`^^^^200c=\\active\n  \\protected\\def ^^^^200c{\\zerowidthnonjoiner}\n\\fi\n%% End of ZWNJ support\n$endif$\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\n"
  },
  {
    "path": "data/templates/fonts.latex",
    "content": "\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n$if(mathspec)$\n  \\ifXeTeX\n    \\usepackage{mathspec} % this also loads fontspec\n  \\else\n    \\usepackage{unicode-math} % this also loads fontspec\n  \\fi\n$else$\n  \\usepackage{unicode-math} % this also loads fontspec\n$endif$\n  \\defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n$if(fontfamily)$\n$else$\n$-- Set default font before Beamer theme so the theme can override it\n\\usepackage{lmodern}\n$endif$\n"
  },
  {
    "path": "data/templates/hypersetup.latex",
    "content": "\\hypersetup{\n$if(title-meta)$\n  pdftitle={$title-meta$},\n$endif$\n$if(author-meta)$\n  pdfauthor={$author-meta$},\n$endif$\n$if(lang)$\n  pdflang={$lang$},\n$endif$\n$if(subject)$\n  pdfsubject={$subject$},\n$endif$\n$if(keywords)$\n  pdfkeywords={$for(keywords)$\\xmpquote{$keywords$}$sep$, $endfor$},\n$endif$\n$if(colorlinks)$\n  colorlinks=true,\n  linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},\n  filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},\n  citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},\n  urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},\n$else$\n$if(boxlinks)$\n$else$\n  hidelinks,\n$endif$\n$endif$\n  pdfcreator={LaTeX via pandoc}}\n\n"
  },
  {
    "path": "data/templates/passoptions.latex",
    "content": "% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n$if(colorlinks)$\n\\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}\n$endif$\n$if(CJKmainfont)$\n\\PassOptionsToPackage{space}{xeCJK}\n$endif$\n"
  },
  {
    "path": "data/templates/styles.citations.html",
    "content": "/* CSS for citations */\ndiv.csl-bib-body { }\ndiv.csl-entry {\n  clear: both;\n$if(csl-entry-spacing)$\n  margin-bottom: $csl-entry-spacing$;\n$endif$\n}\n.hanging-indent div.csl-entry {\n  margin-left:2em;\n  text-indent:-2em;\n}\ndiv.csl-left-margin {\n  min-width:2em;\n  float:left;\n}\ndiv.csl-right-inline {\n  margin-left:2em;\n  padding-left:1em;\n}\ndiv.csl-indent {\n  margin-left: 2em;\n}\n"
  },
  {
    "path": "data/templates/styles.html",
    "content": "/* Default styles provided by pandoc.\n** See https://pandoc.org/MANUAL.html#variables-for-html for config info.\n*/\n$if(document-css)$\nhtml {\n$if(mainfont)$\n  font-family: $mainfont$;\n$endif$\n$if(fontsize)$\n  font-size: $fontsize$;\n$endif$\n$if(linestretch)$\n  line-height: $linestretch$;\n$endif$\n  color: $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;\n  background-color: $if(backgroundcolor)$$backgroundcolor$$else$#fdfdfd$endif$;\n}\nbody {\n  margin: 0 auto;\n  max-width: $if(maxwidth)$$maxwidth$$else$36em$endif$;\n  padding-left: $if(margin-left)$$margin-left$$else$50px$endif$;\n  padding-right: $if(margin-right)$$margin-right$$else$50px$endif$;\n  padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;\n  padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;\n  hyphens: auto;\n  overflow-wrap: break-word;\n  text-rendering: optimizeLegibility;\n  font-kerning: normal;\n}\n@media (max-width: 600px) {\n  body {\n    font-size: 0.9em;\n    padding: 12px;\n  }\n  h1 {\n    font-size: 1.8em;\n  }\n}\n@media print {\n  html {\n    background-color: $if(backgroundcolor)$$backgroundcolor$$else$white$endif$;\n  }\n  body {\n    background-color: transparent;\n    color: black;\n    font-size: 12pt;\n  }\n  p, h2, h3 {\n    orphans: 3;\n    widows: 3;\n  }\n  h2, h3, h4 {\n    page-break-after: avoid;\n  }\n}\np {\n  margin: 1em 0;\n}\na {\n  color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$;\n}\na:visited {\n  color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$;\n}\nimg {\n  max-width: 100%;\n}\nsvg {\n  height: auto;\n  max-width: 100%;\n}\nh1, h2, h3, h4, h5, h6 {\n  margin-top: 1.4em;\n}\nh5, h6 {\n  font-size: 1em;\n  font-style: italic;\n}\nh6 {\n  font-weight: normal;\n}\nol, ul {\n  padding-left: 1.7em;\n  margin-top: 1em;\n}\nli > ol, li > ul {\n  margin-top: 0;\n}\nblockquote {\n  margin: 1em 0 1em 1.7em;\n  padding-left: 1em;\n  border-left: 2px solid #e6e6e6;\n  color: #606060;\n}\n$if(abstract)$\ndiv.abstract {\n  margin: 2em 2em 2em 2em;\n  text-align: left;\n  font-size: 85%;\n}\ndiv.abstract-title {\n  font-weight: bold;\n  text-align: center;\n  padding: 0;\n  margin-bottom: 0.5em;\n}\n$endif$\ncode {\n  white-space: pre-wrap;\n  font-family: $if(monofont)$$monofont$$else$Menlo, Monaco, Consolas, 'Lucida Console', monospace$endif$;\n$if(monobackgroundcolor)$\n  background-color: $monobackgroundcolor$;\n  padding: .2em .4em;\n$endif$\n  font-size: 85%;\n  margin: 0;\n  hyphens: manual;\n}\npre {\n  margin: 1em 0;\n$if(monobackgroundcolor)$\n  background-color: $monobackgroundcolor$;\n  padding: 1em;\n$endif$\n  overflow: auto;\n}\npre code {\n  padding: 0;\n  overflow: visible;\n  overflow-wrap: normal;\n}\n.sourceCode {\n background-color: transparent;\n overflow: visible;\n}\nhr {\n  border: none;\n  border-top: 1px solid #1a1a1a;\n  height: 1px;\n  margin: 1em 0;\n}\ntable {\n  margin: 1em 0;\n  border-collapse: collapse;\n  width: 100%;\n  overflow-x: auto;\n  display: block;\n  font-variant-numeric: lining-nums tabular-nums;\n}\ntable caption {\n$if(table-caption-below)$\n  caption-side: bottom;\n  margin-top: 0.75em;\n$else$\n  margin-bottom: 0.75em;\n$endif$\n}\ntbody {\n  margin-top: 0.5em;\n  border-top: 1px solid $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;\n  border-bottom: 1px solid $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;\n}\nth {\n  border-top: 1px solid $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;\n  padding: 0.25em 0.5em 0.25em 0.5em;\n}\ntd {\n  padding: 0.125em 0.5em 0.25em 0.5em;\n}\nheader {\n  margin-bottom: 4em;\n  text-align: center;\n}\n#TOC li {\n  list-style: none;\n}\n#TOC ul {\n  padding-left: 1.3em;\n}\n#TOC > ul {\n  padding-left: 0;\n}\n#TOC a:not(:hover) {\n  text-decoration: none;\n}\n$endif$\nspan.smallcaps{font-variant: small-caps;}\ndiv.columns{display: flex; gap: min(4vw, 1.5em);}\ndiv.column{flex: auto; overflow-x: auto;}\ndiv.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\n/* The extra [class] is a hack that increases specificity enough to\n   override a similar rule in reveal.js */\nul.task-list[class]{list-style: none;}\nul.task-list li input[type=\"checkbox\"] {\n  font-size: inherit;\n  width: 0.8em;\n  margin: 0 0.8em 0.2em -1.6em;\n  vertical-align: middle;\n}\n$if(quotes)$\nq { quotes: \"“\" \"”\" \"‘\" \"’\"; }\n$endif$\n$if(displaymath-css)$\n.display.math{display: block; text-align: center; margin: 0.5rem auto;}\n$endif$\n$if(highlighting-css)$\n/* CSS for syntax highlighting */\n$highlighting-css$\n$endif$\n$if(csl-css)$\n$styles.citations.html()$\n$endif$\n"
  },
  {
    "path": "data/templates/template.typst",
    "content": "#let content-to-string(content) = {\n  if content.has(\"text\") {\n    content.text\n  } else if content.has(\"children\") {\n    content.children.map(content-to-string).join(\"\")\n  } else if content.has(\"body\") {\n    content-to-string(content.body)\n  } else if content == [ ] {\n    \" \"\n  }\n}\n#let conf(\n  title: none,\n  subtitle: none,\n  authors: (),\n  keywords: (),\n  date: none,\n  abstract-title: none,\n  abstract: none,\n  thanks: none,\n  cols: 1,\n  margin: (x: 1.25in, y: 1.25in),\n  paper: \"us-letter\",\n  lang: \"en\",\n  region: \"US\",\n  font: none,\n  fontsize: 11pt,\n  mathfont: none,\n  codefont: none,\n  linestretch: 1,\n  sectionnumbering: none,\n  linkcolor: none,\n  citecolor: none,\n  filecolor: none,\n  pagenumbering: \"1\",\n  doc,\n) = {\n  set document(\n    title: title,\n    keywords: keywords,\n  )\n  set document(\n      author: authors.map(author => content-to-string(author.name)).join(\", \", last: \" & \"),\n  ) if authors != none and authors != ()\n  set page(\n    paper: paper,\n    margin: margin,\n    numbering: pagenumbering,\n    columns: cols\n  )\n\n  set par(\n    justify: true,\n    leading: linestretch * 0.65em\n  )\n  set text(lang: lang,\n           region: region,\n           size: fontsize)\n\n  set text(font: font) if font != none\n  show math.equation: set text(font: mathfont) if mathfont != none\n  show raw: set text(font: codefont) if codefont != none\n\n  set heading(numbering: sectionnumbering)\n\n  show link: set text(fill: rgb(content-to-string(linkcolor))) if linkcolor != none\n  show ref: set text(fill: rgb(content-to-string(citecolor))) if citecolor != none\n  show link: this => {\n    if filecolor != none and type(this.dest) == label {\n      text(this, fill: rgb(content-to-string(filecolor)))\n    } else {\n      text(this)\n    }\n  }\n\n  if title != none {\n    place(top, float: true, scope: \"parent\", clearance: 4mm, block(below: 1em, width: 100%)[\n      #if title != none {\n        align(center, block[\n            #text(weight: \"bold\", size: 1.5em, hyphenate: false)[#title #if thanks != none {\n                footnote(thanks, numbering: \"*\")\n                counter(footnote).update(n => n - 1)\n              }]\n            #(\n              if subtitle != none {\n                parbreak()\n                text(weight: \"bold\", size: 1.25em, hyphenate: false)[#subtitle]\n              }\n             )])\n      }\n\n      #if authors != none and authors != [] {\n        let count = authors.len()\n        let ncols = calc.min(count, 3)\n        grid(\n          columns: (1fr,) * ncols,\n          row-gutter: 1.5em,\n          ..authors.map(author => align(center)[\n            #author.name \\\n            #author.affiliation \\\n            #author.email\n          ])\n        )\n      }\n\n      #if date != none {\n        align(center)[#block(inset: 1em)[\n            #date\n          ]]\n      }\n\n      #if abstract != none {\n        block(inset: 2em)[\n          #text(weight: \"semibold\")[#abstract-title] #h(1em) #abstract\n        ]\n      }\n    ])\n  }\n  doc\n}\n"
  },
  {
    "path": "data/translations/af.yaml",
    "content": "Abstract: Samevatting\nAppendix: Bylae\nBibliography: Bibliografie\nCc: a.a.\nChapter: Hoofstuk\nContents: Inhoudsopgawe\nEncl: Bylae(n)\nFigure: Figuur\nIndex: Inhoud\nListOfFigures: Lys van figure\nListOfTables: Lys van tabelle\nPage: Bladsy\nPart: Deel\nPreface: Voorwoord\nProof: Bewys\nReferences: Verwysings\nSee: sien\nSeeAlso: sien ook\nTable: Tabel\nTo: Aan\n"
  },
  {
    "path": "data/translations/alt.yaml",
    "content": "Chapter: Бажалык\nContents: Бажалыктар\nFigure: Јурук\nGlossary: Сӧзлик\nPreface: Сӧс бажы\n"
  },
  {
    "path": "data/translations/am.yaml",
    "content": "Abstract: አኅጽተሮ ጽሁፍ\nAppendix: መድበል\nBibliography: ቢዋ መጽሃፍት\nCc: ግልባጭ\nChapter: ክፍል\nContents: ይዘት\nEncl: አባሪዎች\nFigure: ሥዕል\nIndex: ምህጻር ቃል\nListOfFigures: የሥዕችሎ ማውጫ\nListOfTables: የሰንጠዥረ ማውጫ\nPage: ገጽ\nPart: ንዑስ ክፍል\nPreface: መቅድም\nProof: ማረጋገጫ\nReferences: የነሥ ጹሁፍ ምንጭ\nSee: ይመልከቱ\nSeeAlso: ይህምን ይመልከቱ\nTable: ሰንጠረዥ\nTo: ለ\n"
  },
  {
    "path": "data/translations/ar.yaml",
    "content": "Abstract: ملخص\nAppendix: الملاحق\nBibliography: المصادر\nCc: نسخة ل‬\nChapter: باب\nContents: المحتويات\nEncl: المرفقات\nFigure: شكل\nGlossary: قاموس\nIndex: الفهرس\nListOfFigures: قائمة الأشكال\nListOfTables: قائمة الجداول\nPage: صفحة\nPart: القسم\nPreface: مدخل\nProof: برهان\nReferences: المراجع\nSee: راجع\nSeeAlso: راجع أيضًا\nTable: جدول\nTo: إلى\n"
  },
  {
    "path": "data/translations/as.yaml",
    "content": "Abstract: মূলভাৱ\nAppendix: পৰিশিষ্ট\nBibliography: তথ্যসূত্ৰ\nCc: প্ৰতিলিপি\nChapter: অধ্যায়\nContents: সমল\nEncl: সংযোজিত\nFigure: চিত্ৰ\nGlossary: অৰ্থকোষ\nIndex: বিষয়সূচী\nListOfFigures: চিত্ৰসূচী\nListOfTables: তালিকাসূচী\nPage: পৃষ্ঠা\nPart: অংশ\nPreface: পাতনি\nProof: প্ৰমাণ\nReferences: প্ৰসংগ\nSee: চাওক\nSeeAlso: ও\nTable: তালিকা\nTo: মুখে\n"
  },
  {
    "path": "data/translations/ast.yaml",
    "content": "Abstract: Sumariu\nAppendix: Apéndiz\nBibliography: Bibliografía\nCc: cc\nChapter: Capítulu\nContents: Conteníu\nEncl: incl.\nFigure: Figura\nGlossary: Glosariu\nIndex: Índiz\nListOfFigures: Llista de figures\nListOfTables: Llista de tables\nPage: Páxina\nPart: Parte\nPreface: Entamu\nProof: Demostración\nReferences: Referencies\nSee: ver\nSeeAlso: ver tamién\nTable: Tabla\nTo: Pa\n"
  },
  {
    "path": "data/translations/az.yaml",
    "content": "Abstract: Annotasiya\nAppendix: Əlavə\nBibliography: Ədəbiyyat\nCc: cc\nChapter: Fəsil\nContents: Mündəricat\nEncl: encl\nFigure: Şəkil\nGlossary: Terminlər lüğəti\nIndex: Mövzu göstəricisi\nListOfFigures: Şəkillərin siyahısı\nListOfTables: Cədvəllərin siyahısı\nPage: səh.\nPart: Hissə\nPreface: Ön söz\nProof: İsbatı\nReferences: Ədəbiyyat\nSee: baxın\nSeeAlso: həmçinin baxın\nTable: Cədvəl\nTo: To\n"
  },
  {
    "path": "data/translations/be.yaml",
    "content": "Abstract: Анатацыя\nAppendix: Дадатак\nBibliography: Літаратура\nCc: зых.\nChapter: Глава\nContents: Зьмест\nEncl: укл.\nFigure: Рыс.\nGlossary: Слоўнік тэрмінаў\nIndex: Прадметны паказальнік\nListOfFigures: Сьпіс ілюстрацый\nListOfTables: Сьпіс табліц\nPage: с.\nPart: Частка\nPreface: Прадмова\nProof: Доказ\nReferences: Сьпіс літаратуры\nSee: гл.\nSeeAlso: гл. таксама\nTable: Табліца\nTo: вх.\n"
  },
  {
    "path": "data/translations/bg.yaml",
    "content": "Abstract: Абстракт\nAppendix: Приложение\nBibliography: Библиография\nCc: копия\nChapter: Глава\nContents: Съдържание\nEncl: Приложения\nFigure: Фигура\nGlossary: Притурка\nIndex: Азбучен указател\nListOfFigures: Списък на фигурите\nListOfTables: Списък на таблиците\nPage: Стр.\nPart: Част\nPreface: Предговор\nProof: Доказателство\nReferences: Литература\nSee: вж.\nSeeAlso: вж. също и\nTable: Таблица\nTo: За\n"
  },
  {
    "path": "data/translations/bn.yaml",
    "content": "Abstract: সারসংক্ষেপ\nAppendix: পরিশিষ্ট\nBibliography: তথ্যবিবরণ\nCc: অনুলিপি\nChapter: অধ্যায়\nContents: সূচীপত্র\nEncl: সংযুক্তি\nFigure: ছবি/নকশা\nGlossary: পরিভাষার শব্দসম্ভার\nIndex: সূচক/নির্দেশক\nListOfFigures: ছবি/নকশা সমূহের তালিকা\nListOfTables: তালিকাসারণী\nPage: পৃষ্ঠা\nPart: খন্ড\nPreface: পূর্বকথা\nProof: প্রমাণ\nReferences: তথ্যসুত্রসমূহ\nSee: দেখুন\nSeeAlso: আরও দেখুন\nTable: সারনী\nTo: প্রতি\n"
  },
  {
    "path": "data/translations/bo.yaml",
    "content": "Abstract: གནད་བསྡུས།\nAppendix: ཞར་བྱུང་།\nBibliography: དཔེ་ཆའི་ཐོ་གཞུང་།\nCc: འདྲ་བཤུས་ལེན་མཁན་\nChapter: ལེའུ་\nContents: དཀར་ཆག།\nFigure: པར་རིས་\nGlossary: མིང་ཚིག་རེའུ་མིག།\nIndex: གསུལ་བྱང་།\nPage: ཤོག་\nPart: ཆ་ཤས་\nPreface: དཔེ་དེབ་ཀྱི་གླེང་བརྗོད།\nProof: བདེན་དཔང་།\nTable: རེའུ་མིག་\n"
  },
  {
    "path": "data/translations/br.yaml",
    "content": "Abstract: Dvierrañ\nAppendix: Stagadenn\nBibliography: Lennadurezh\nCc: Eilskrid da\nChapter: Pennad\nContents: Taolenn\nEncl: Dielloù kevret\nFigure: Figurenn\nGlossary: Glossary\nIndex: Meneger\nListOfFigures: Listenn ar Figurennoù\nListOfTables: Listenn an taolennoù\nPage: Pajenn\nPart: Lodenn\nPreface: Rakskrid\nProof: Proof\nReferences: Daveennoù\nSee: Gwelout\nSeeAlso: Gwelout ivez\nTable: Taolenn\nTo: evit\n"
  },
  {
    "path": "data/translations/bs.yaml",
    "content": "Abstract: Sažetak\nAppendix: Dodatak\nBibliography: Bibliografija\nCc: Kopija\nChapter: Poglavlje\nContents: Sadržaj\nEncl: Prilozi\nFigure: Slika\nGlossary: Rječnik\nIndex: Indeks\nListOfFigures: Popis slika\nListOfTables: Popis tabela\nPage: Stranica\nPart: Dio\nPreface: Predgovor\nProof: Dokaz\nReferences: Literatura\nSee: Vidjeti\nSeeAlso: Također vidjeti\nTable: Tabela\nTo: Prima\n"
  },
  {
    "path": "data/translations/bua.yaml",
    "content": "Abstract: Тобшолол\nAppendix: Хабсаралта\nBibliography: Ном зүй\nChapter: Бүлэг\nContents: Гаршаг\nEncl: Оруулаха\nFigure: Зураг\nIndex: Бүгэд хэлхээс\nListOfFigures: Зурагай жагсаалт\nListOfTables: Хүснэгэтэй жагсаалт\nPage: Хуудаһан\nPart: Бүлэг\nPreface: Оршол\nReferences: Ашаглаһан ном\nSee: Үз\nSeeAlso: Mүн үз\nTable: Хүсэнэгт\n"
  },
  {
    "path": "data/translations/ca.yaml",
    "content": "Abstract: Resum\nAppendix: Apèndix\nBibliography: Bibliografia\nCc: Còpies a\nChapter: Capítol\nContents: Índex\nEncl: Adjunt\nFigure: Figura\nGlossary: Glossari\nIndex: Índex alfabètic\nListOfFigures: Índex de figures\nListOfTables: Índex de taules\nPage: Pàgina\nPart: Part\nPreface: Pròleg\nProof: Demostració\nReferences: Referències\nSee: Vegeu\nSeeAlso: Vegeu també\nTable: Taula\nTo: A\n"
  },
  {
    "path": "data/translations/ckb-Arab.yaml",
    "content": "Abstract: پوختە\nAppendix: پاشکۆ\nBibliography: کتێبنامە\nCc: ڕوونووس\nChapter: بەندی\nContents: نێوەڕۆک\nEncl: هاوپێچ\nFigure: وێنەی\nGlossary: فەرهەنگۆک\nIndex: پێنوێن\nListOfFigures: لیستی وێنەکان\nListOfTables: لیستی خشتەکان\nPage: لاپەڕە\nPart: بەشی\nPreface: پێشەكی\nProof: سەلماندن\nReferences: سەرچاوەکان\nSee: چاو لێکەن\nSeeAlso: هەروەها چاو لێکەن\nTable: خشتەی\nTo: بۆ\n"
  },
  {
    "path": "data/translations/ckb-Latn.yaml",
    "content": "Abstract: Puxte\nAppendix: Paşko\nBibliography: Kitêbname\nCc: Rûnûs\nChapter: Bendî\nContents: Nêwerrok\nEncl: Hawpêç\nFigure: Wêney\nGlossary: Ferhengok\nIndex: Pêrrist\nListOfFigures: Lîstî Wênekan\nListOfTables: Lîstî Xiştekan\nPage: Laperre\nPart: Beşî\nPreface: Pêşekî\nProof: Selmandin\nReferences: Serçawekan\nSee: Çaw lêken\nSeeAlso: Herweha çaw lêken\nTable: Xiştey\nTo: Bo\n"
  },
  {
    "path": "data/translations/cs.yaml",
    "content": "Abstract: Abstrakt\nAppendix: Příloha\nBibliography: Literatura\nCc: Na vědomí\nChapter: Kapitola\nContents: Obsah\nEncl: Příloha\nFigure: Obrázek\nGlossary: Slovník\nIndex: Rejstřík\nListOfFigures: Seznam obrázků\nListOfTables: Seznam tabulek\nPage: Strana\nPart: Část\nPreface: Předmluva\nProof: Důkaz\nReferences: Reference\nSee: viz\nSeeAlso: viz také\nTable: Tabulka\nTo: Komu\n"
  },
  {
    "path": "data/translations/cu.yaml",
    "content": "Abstract: Аннотация\nAppendix: Приложение\nBibliography: Литература\nCc: исх.\nChapter: Глава\nContents: Содержание\nEncl: вкл.\nFigure: Рис.\nGlossary: Словарь терминов\nIndex: Предметный указатель\nListOfFigures: Список иллюстраций\nListOfTables: Список таблиц\nPage: с.\nPart: Часть\nPreface: Предисловие\nProof: Доказательство\nReferences: Список литературы\nSee: см.\nSeeAlso: см. также\nTable: Таблица\nTo: вх.\n"
  },
  {
    "path": "data/translations/cy.yaml",
    "content": "Abstract: Crynodeb\nAppendix: Atodiad\nBibliography: Llyfryddiaeth\nCc: copïau\nChapter: Pennod\nContents: Cynnwys\nEncl: amgaeëdig\nFigure: Darlun\nGlossary: Rhestr termau\nIndex: Mynegai\nListOfFigures: Rhestr Ddarluniau\nListOfTables: Rhestr Dablau\nPage: tudalen\nPart: Rhan\nPreface: Rhagair\nProof: Prawf\nReferences: Cyfeiriadau\nSee: gweler\nSeeAlso: gweler hefyd\nTable: Taflen\nTo: At\n"
  },
  {
    "path": "data/translations/cz.yaml",
    "content": "Abstract: Abstrakt\nAppendix: Dodatek\nBibliography: Literatura\nCc: Na vědomí\nChapter: Kapitola\nContents: Obsah\nEncl: Příloha\nFigure: Obrázek\nGlossary: Slovník\nIndex: Index\nListOfFigures: Seznam obrázků\nListOfTables: Seznam tabulek\nPage: Strana\nPart: Část\nPreface: Předmluva\nProof: Důkaz\nReferences: Reference\nSee: viz\nSeeAlso: viz\nTable: Tabulka\nTo: Komu\n"
  },
  {
    "path": "data/translations/da.yaml",
    "content": "Abstract: Resumé\nAppendix: Bilag\nBibliography: Litteratur\nCc: Kopi til\nChapter: Kapitel\nContents: Indhold\nEncl: Vedlagt\nFigure: Figur\nGlossary: Gloseliste\nIndex: Indeks\nListOfFigures: Figurer\nListOfTables: Tabeller\nPage: Side\nPart: Del\nPreface: Forord\nProof: Bevis\nReferences: Litteratur\nSee: Se\nSeeAlso: Se også\nTable: Tabel\nTo: Til\n"
  },
  {
    "path": "data/translations/de.yaml",
    "content": "Abstract: Zusammenfassung\nAppendix: Anhang\nBibliography: Literaturverzeichnis\nCc: Verteiler\nChapter: Kapitel\nContents: Inhaltsverzeichnis\nEncl: Anlage(n)\nFigure: Abbildung\nGlossary: Glossar\nIndex: Index\nListing: Auflistung\nListOfFigures: Abbildungsverzeichnis\nListOfTables: Tabellenverzeichnis\nPage: Seite\nPart: Teil\nPreface: Vorwort\nProof: Beweis\nReferences: Literatur\nSee: siehe\nSeeAlso: siehe auch\nTable: Tabelle\nTo: An\n"
  },
  {
    "path": "data/translations/dsb.yaml",
    "content": "Abstract: Abstrakt\nAppendix: Dodawki\nBibliography: Literatura\nCc: CC\nChapter: Kapitl\nContents: Wopśimjeśe\nEncl: Pśiłoga\nFigure: Wobraz\nGlossary: Glossary\nIndex: Indeks\nListOfFigures: Zapis wobrazow\nListOfTables: Zapis tabulkow\nPage: Strona\nPart: Źěl\nPreface: Zawod\nProof: Proof\nReferences: Referency\nSee: gl.\nSeeAlso: gl.~teke\nTable: Tabulka\nTo: Komu\n"
  },
  {
    "path": "data/translations/el.yaml",
    "content": "Abstract: Περίληψη\nAppendix: Παράρτημα\nBibliography: Βιβλιογραφία\nCc: Κοινοποίηση\nChapter: Κεφάλαιο\nContents: Περιεχόμενα\nEncl: Συνημμένα\nFigure: Σχήμα\nGlossary: Γλωσσάρι\nIndex: Ευρετήριο\nListOfFigures: Κατάλογος Σχημάτων\nListOfTables: Κατάλογος Πινάκων\nPage: Σελίδα\nPart: Μέρος\nPreface: Πρόλογος\nProof: Απόδειξη\nReferences: Αναφορές\nSee: βλέπε\nSeeAlso: βλέπε επίσης\nTable: Πίνακας\nTo: Προς\n"
  },
  {
    "path": "data/translations/en.yaml",
    "content": "Abstract: Abstract\nAppendix: Appendix\nBibliography: Bibliography\nCc: cc\nChapter: Chapter\nContents: Contents\nEncl: encl\nFigure: Figure\nGlossary: Glossary\nIndex: Index\nListing: Listing\nListOfFigures: List of Figures\nListOfTables: List of Tables\nPage: page\nPart: Part\nPreface: Preface\nProof: Proof\nReferences: References\nSee: see\nSeeAlso: see also\nTable: Table\nTo: To\n"
  },
  {
    "path": "data/translations/eo.yaml",
    "content": "Abstract: Resumo\nAppendix: Apendico\nBibliography: Bibliografio\nCc: Kopie al\nChapter: Ĉapitro\nContents: Enhavo\nEncl: Aldono(j)\nFigure: Figuro\nGlossary: Glosaro\nIndex: Indekso\nListOfFigures: Listo de figuroj\nListOfTables: Listo de tabeloj\nPage: Paĝo\nPart: Parto\nPreface: Antaŭparolo\nProof: Pruvo\nReferences: Citaĵoj\nSee: vidu\nSeeAlso: vidu ankaŭ\nTable: Tabelo\nTo: Al\n"
  },
  {
    "path": "data/translations/es-ES.yaml",
    "content": "Abstract: Resumen\nAppendix: Apéndice\nBibliography: Bibliografía\nCc: Copia a\nChapter: Capítulo\nContents: Índice general\nEncl: Adjunto(s)\nFigure: Figura\nGlossary: Glosario\nIndex: Índice alfabético\nListOfFigures: Índice de figuras\nListOfTables: Índice de cuadros\nPage: Página\nPart: Parte\nPreface: Prefacio\nProof: Prueba\nReferences: Referencias\nSee: véase\nSeeAlso: véase también\nTable: Cuadro\nTo: A\n"
  },
  {
    "path": "data/translations/es-MX.yaml",
    "content": "Abstract: Resumen\nAppendix: Apéndice\nBibliography: Bibliografía\nCc: Copia a\nChapter: Capítulo\nContents: Índice\nEncl: Anexo\nFigure: Figura\nGlossary: Glosario\nIndex: Índice Alfabético\nListOfFigures: Índice de Figuras\nListOfTables: Índice de Cuadros\nPage: Página\nPart: Parte\nPreface: Prefacio\nProof: Demostración\nReferences: Referencias\nSee: véase\nSeeAlso: véase también\nTable: Cuadro\nTo: A\n"
  },
  {
    "path": "data/translations/es.yaml",
    "content": "Abstract: Resumen\nAppendix: Apéndice\nBibliography: Bibliografía\nCc: Copia a\nChapter: Capítulo\nContents: Índice\nEncl: Adjunto\nFigure: Figura\nGlossary: Glosario\nIndex: Índice alfabético\nListOfFigures: Índice de figuras\nListOfTables: Índice de cuadros\nPage: página\nPart: Parte\nPreface: Prefacio\nProof: Demostración\nReferences: Referencias\nSee: véase\nSeeAlso: véase también\nTable: Cuadro\nTo: A\n"
  },
  {
    "path": "data/translations/et.yaml",
    "content": "Abstract: Kokkuvõte\nAppendix: Lisa\nBibliography: Kirjandus\nCc: Koopia(d)\nChapter: Peatükk\nContents: Sisukord\nEncl: Lisa(d)\nFigure: Joonis\nGlossary: Sõnastik\nIndex: Indeks\nListing: Kood\nListOfFigures: Joonised\nListOfTables: Tabelid\nPage: Lk.\nPart: Osa\nPreface: Sissejuhatus\nProof: Korrektuur\nReferences: Viited\nSee: vt.\nSeeAlso: vt. ka\nTable: Tabel\nTo: Saaja\n"
  },
  {
    "path": "data/translations/eu.yaml",
    "content": "Abstract: Laburpena\nAppendix: Eranskina\nBibliography: Bibliografia\nCc: Kopia\nChapter: Kapitulua\nContents: Gaien Aurkibidea\nEncl: Erantsia\nFigure: Irudia\nGlossary: Glosarioa\nIndex: Kontzeptuen Aurkibidea\nListOfFigures: Irudien Zerrenda\nListOfTables: Taulen Zerrenda\nPage: Orria\nPart: Atala\nPreface: Hitzaurrea\nProof: Frogapena\nReferences: Erreferentziak\nSee: Ikusi\nSeeAlso: Ikusi, halaber\nTable: Taula\nTo: Nori\n"
  },
  {
    "path": "data/translations/fa.yaml",
    "content": "Abstract: چکیده\nAppendix: پیوست\nBibliography: کتاب‌نامه\nCc: رونوشت\nChapter: فصل\nContents: فهرست\nEncl: پیوست\nFigure: شكل\nGlossary: فرهنگ‌نامه\nIndex: نمایه\nListOfFigures: فهرست شکل‌ها\nListOfTables: فهرست جدول‌ها\nPage: صفحه\nPart: بخش\nPreface: پیش‌گفتار\nProof: اثبات\nReferences: مرجع‌ها\nSee: ببینید\nSeeAlso: نیز ببینید\nTable: جدول\nTo: به\n"
  },
  {
    "path": "data/translations/fi.yaml",
    "content": "Abstract: Tiivistelmä\nAppendix: Liite\nBibliography: Kirjallisuutta\nCc: Jakelu\nChapter: Luku\nContents: Sisällys\nEncl: Liitteet\nFigure: Kuva\nGlossary: Sanasto\nIndex: Hakemisto\nListOfFigures: Kuvat\nListOfTables: Taulukot\nPage: Sivu\nPart: Osa\nPreface: Esipuhe\nProof: Todistus\nReferences: Viitteet\nSee: katso\nSeeAlso: katso myös\nTable: Taulukko\nTo: Vastaanottaja\n"
  },
  {
    "path": "data/translations/fil.yaml",
    "content": "Abstract: Abstrak\nAppendix: Hugpong\nBibliography: Talaaklatan\nChapter: Kabanata\nContents: Talalamanan\nFigure: Laraw\nGlossary: Glosaryo\nIndex: Talatuntunan\nListOfFigures: Talalarawan\nListOfTables: Talatalayan\nPage: Pahina\nPart: Bahagi\nPreface: Paunang Salita\nProof: Patunay\nReferences: Talasanggunian\nSee: tignan ang\nSeeAlso: tignan din\nTable: Talay\n"
  },
  {
    "path": "data/translations/fr.yaml",
    "content": "Abstract: Résumé\nAppendix: Annexe\nBibliography: Bibliographie\nCc: Cc\nChapter: Chapitre\nContents: Table des matières\nFigure: Figure\nGlossary: Glossaire\nIndex: Index\nListOfFigures: Table des figures\nListOfTables: Liste des tableaux\nPage: Page\nPart: Partie\nPreface: Préface\nProof: Démonstration\nReferences: Références\nSee: Voir\nSeeAlso: Voir aussi\nTable: Tableau\nTo: À\n"
  },
  {
    "path": "data/translations/fur.yaml",
    "content": "Abstract: Somari\nAppendix: Zonte\nBibliography: Bibliografie\nCc: Cun copie a\nChapter: Cjapitul\nContents: Tabele gjenerâl\nEncl: Zonte(is)\nFigure: Figure\nGlossary: Glossari\nIndex: Tabele analitiche\nListOfFigures: Liste des figuris\nListOfTables: Liste des tabelis\nPage: Pagjine\nPart: Part\nPreface: Prefazion\nProof: Dimostrazion\nReferences: Riferiments\nSee: cjale\nSeeAlso: cjale ancje\nTable: Tabele\nTo: Par\n"
  },
  {
    "path": "data/translations/ga.yaml",
    "content": "Abstract: Achoimre\nAppendix: Aguisín\nBibliography: Leabharliosta\nCc: cc\nChapter: Caibidil\nContents: Clár Ábhair\nEncl: faoi iamh\nFigure: Léaráid\nGlossary: Glossary\nIndex: Innéacs\nListOfFigures: Léaráidí\nListOfTables: Táblaí\nPage: Leathanach\nPart: Cuid\nPreface: Réamhrá\nProof: Cruthúnas\nReferences: Tagairtí\nSee: féach\nSeeAlso: féach freisin\nTable: Tábla\nTo: Go\n"
  },
  {
    "path": "data/translations/gd.yaml",
    "content": "Abstract: Brìgh\nAppendix: Ath-sgr`ıobhadh\nBibliography: Leabhraichean\nCc: lethbhreac gu\nChapter: Caibideil\nContents: Clàr-obrach\nEncl: a-staigh\nFigure: Dealbh\nGlossary: Glossary\nIndex: Clàr-innse\nListOfFigures: Liosta Dhealbh\nListOfTables: Liosta Chlàr\nPage: t.d.\nPart: Cuid\nPreface: Preface\nProof: Proof\nReferences: Iomraidh\nSee: see\nSeeAlso: see also\nTable: Clàr\nTo: gu\n"
  },
  {
    "path": "data/translations/gl.yaml",
    "content": "Abstract: Resumo\nAppendix: Apéndice\nBibliography: Bibliografía\nCc: Copia a\nChapter: Capítulo\nContents: Índice\nEncl: Adxunto\nFigure: Figura\nGlossary: Glosario\nIndex: Índice alfabético\nListOfFigures: Índice de figuras\nListOfTables: Índice de cadros\nPage: Páxina\nPart: Parte\nPreface: Prefacio\nProof: Demostración\nReferences: Referencias\nSee: véxase\nSeeAlso: véxase tamén\nTable: Cadro\nTo: A\n"
  },
  {
    "path": "data/translations/grc.yaml",
    "content": "Abstract: Περίληψις\nAppendix: Παράρτημα\nBibliography: Βιβλιογραφία\nCc: Κοινοποίησις\nChapter: Κεφάλαιον\nContents: Περιεχόμενα\nEncl: Συνημμένως\nFigure: Σχῆμα\nGlossary: Γλωσσάριον\nIndex: Εὑρετήριον\nListOfFigures: Κατάλογος σχημάτων\nListOfTables: Κατάλογος πινάκων\nPage: Σελὶς\nPart: Μέρος\nPreface: Προοίμιον\nProof: Ἀπόδειξις\nReferences: Ἀναφοραὶ\nSee: ὃρα\nSeeAlso: ὃρα ὡσαύτως\nTable: Πίναξ\nTo: Πρὸς\n"
  },
  {
    "path": "data/translations/gu.yaml",
    "content": "Appendix: અનુસૂચિ\nChapter: પ્રકરણ\nIndex: અનુક્રમણિકા\nPage: પાનુ\nPart: ભાગ\nProof: પુરાવો\nSee: જુવો\nSeeAlso: ઉપરાંત\nTable: ટેબલ\n"
  },
  {
    "path": "data/translations/ha.yaml",
    "content": "Abstract: Taƙaitawa\nAppendix: Ƙarin bayani\nBibliography: Fahirinsa\nCc: cc\nChapter: Babi\nContents: Abin da ke ciki\nEncl: saƙe\nFigure: Addadi\nGlossary: Ƙamus\nIndex: Fihirinsa\nListOfFigures: Tsarin Addadi\nListOfTables: Tsarin tabili\nPage: Shafi\nPart: Kashi\nPreface: Gabatarwa\nProof: Shaida\nReferences: Nassoshi\nSee: duba\nSeeAlso: kuma\nTable: tabili\nTo: je\n"
  },
  {
    "path": "data/translations/he.yaml",
    "content": "Abstract: תקציר\nAppendix: נספח\nBibliography: ביבליוגרפיה\nCc: העתקים\nChapter: פרק\nContents: תוכן העניינים\nEncl: רצ\"ב\nFigure: איור\nGlossary: מילון מונחים\nIndex: מפתח\nListOfFigures: רשימת האיורים\nListOfTables: רשימת הטבלאות\nPage: עמוד\nPart: חלק\nPreface: מבוא\nProof: הוכחה\nReferences: מקורות\nSee: ראה\nSeeAlso: ראה גם\nTable: טבלה\nTo: אל\n"
  },
  {
    "path": "data/translations/hi.yaml",
    "content": "Abstract: सारांश\nAppendix: परिशिष्ट\nBibliography: संदर्भ-ग्रन्थ\nChapter: अध्याय\nContents: अनुक्रम\nFigure: चित्र\nGlossary: शब्दार्थ सूची\nIndex: सूची\nListOfFigures: चित्रों की सूची\nListOfTables: तालिकाओं की सूची\nPage: पृष्ठ\nPart: खण्ड\nPreface: प्रस्तावना\nProof: प्रमाण\nReferences: हवाले\nSee: देखिए\nSeeAlso: और देखिए\nTable: तालिका\n"
  },
  {
    "path": "data/translations/hr.yaml",
    "content": "Abstract: Sažetak\nAppendix: Dodatak\nBibliography: Bibliografija\nCc: Kopija\nChapter: Poglavlje\nContents: Sadržaj\nEncl: Prilozi\nFigure: Slika\nGlossary: Pojmovnik\nIndex: Kazalo\nListOfFigures: Popis slika\nListOfTables: Popis tablica\nPage: Stranica\nPart: Dio\nPreface: Predgovor\nProof: Dokaz\nReferences: Literatura\nSee: Vidjeti\nSeeAlso: Također vidjeti\nTable: Tablica\nTo: Prima\n"
  },
  {
    "path": "data/translations/hsb.yaml",
    "content": "Abstract: Abstrakt\nAppendix: Dodawki\nBibliography: Literatura\nCc: CC\nChapter: Kapitl\nContents: Wobsah\nEncl: Přłoha\nFigure: Wobraz\nGlossary: Glossary\nIndex: Indeks\nListOfFigures: Zapis wobrazow\nListOfTables: Zapis tabulkow\nPage: Strona\nPart: Dźěl\nPreface: Zawod\nProof: Proof\nReferences: Referency\nSee: hl.\nSeeAlso: hl.~tež\nTable: Tabulka\nTo: Komu\n"
  },
  {
    "path": "data/translations/hu.yaml",
    "content": "Abstract: Kivonat\nAppendix: függelék\nBibliography: Irodalomjegyzék\nCc: Körlevél–címzettek\nChapter: fejezet\nContents: Tartalomjegyzék\nEncl: Melléklet\nFigure: ábra\nGlossary: Szójegyzék\nIndex: Tárgymutató\nListOfFigures: Ábrák jegyzéke\nListOfTables: Táblázatok jegyzéke\nPage: oldal\nPart: rész\nPreface: Előszó\nProof: Bizonyítás\nReferences: Hivatkozások\nSee: lásd\nSeeAlso: lásd még\nTable: táblázat\nTo: Címzett\n"
  },
  {
    "path": "data/translations/hy.yaml",
    "content": "Abstract: Սեղմագիր\nAppendix: Հավելված\nBibliography: Գրականություն\nCc: Կրկնօրինակը՝\nChapter: Գլուխ\nContents: Բովանդակություն\nEncl: Կից՝\nFigure: Նկար\nGlossary: Տերմինների ցանկ\nIndex: Առարկայական ցանկ\nListOfFigures: Նկարների ցանկ\nListOfTables: Աղյուսակների ցանկ\nPage: էջ\nPart: Մաս\nPreface: Նախաբան\nProof: Ապացույց\nReferences: Հղումներ\nSee: տե՛ս\nSeeAlso: տե՛ս նաև\nTable: Աղյուսակ\n"
  },
  {
    "path": "data/translations/ia.yaml",
    "content": "Abstract: Summario\nAppendix: Appendice\nBibliography: Bibliographia\nCc: Copia\nChapter: Capitulo\nContents: Contento\nEncl: Incluso\nFigure: Figura\nGlossary: Glossario\nIndex: Indice\nListOfFigures: Lista de figuras\nListOfTables: Lista de tabellas\nPage: Pagina\nPart: Parte\nPreface: Prefacio\nProof: Prova\nReferences: Referentias\nSee: vide\nSeeAlso: vide etiam\nTable: Tabella\nTo: A\n"
  },
  {
    "path": "data/translations/id.yaml",
    "content": "Abstract: Ringkasan\nAppendix: Lampiran\nBibliography: Bibliografi\nCc: cc\nChapter: Bab\nContents: Daftar Isi\nEncl: Lampiran\nFigure: Gambar\nGlossary: Daftar Istilah\nIndex: Indeks\nListOfFigures: Daftar Gambar\nListOfTables: Daftar Tabel\nPage: Halaman\nPart: Bagian\nPreface: Pendahuluan\nProof: Bukti\nReferences: Pustaka\nSee: lihat\nSeeAlso: lihat juga\nTable: Tabel\nTo: Kepada\n"
  },
  {
    "path": "data/translations/is.yaml",
    "content": "Abstract: Útdráttur\nAppendix: Viðauki\nBibliography: Heimildir\nCc: Samrit\nChapter: Kafli\nContents: Efnisyfirlit\nEncl: Hjálagt\nFigure: Mynd\nGlossary: Orðalisti\nIndex: Atriðisorðaskrá\nListOfFigures: Myndaskrá\nListOfTables: Töfluskrá\nPage: Blaðsíða\nPart: Hluti\nPreface: Formáli\nProof: Sönnun\nReferences: Heimildir\nSee: Sjá\nSeeAlso: Sjá einnig\nTable: Tafla\nTo: Til\n"
  },
  {
    "path": "data/translations/it.yaml",
    "content": "Abstract: Sommario\nAppendix: Appendice\nBibliography: Bibliografia\nCc: e~p.~c.\nChapter: Capitolo\nContents: Indice\nEncl: Allegati\nFigure: Figura\nGlossary: Glossario\nIndex: Indice analitico\nListOfFigures: Elenco delle figure\nListOfTables: Elenco delle tabelle\nPage: Pag.\nPart: Parte\nPreface: Prefazione\nProof: Dimostrazione\nReferences: Riferimenti bibliografici\nSee: vedi\nSeeAlso: vedi anche\nTable: Tabella\nTo: Per\n"
  },
  {
    "path": "data/translations/ja.yaml",
    "content": "Abstract: 概要\nAppendix: 付録\nBibliography: 文献目録\nCc: 同報\nChapter: 章\nContents: 目次\nEncl: 添付\nFigure: 図\nGlossary: 用語集\nIndex: 索引\nListOfFigures: 図目次\nListOfTables: 表目次\nPage: 頁\nPart: 部\nPreface: 端書き\nProof: 証明\nReferences: 参考文献\nSee: 参照\nSeeAlso: 参照\nTable: 表\nTo: 宛先\n"
  },
  {
    "path": "data/translations/ka.yaml",
    "content": "Abstract: ანოტაცია\nAppendix: დანართი\nBibliography: ლიტერატურა\nCc: წყარ.\nChapter: თავი\nContents: შინაარსი\nEncl: ჩათვ.\nFigure: სურ.\nGlossary: ტერმინები\nIndex: საძიებელი\nListOfFigures: სურათი\nListOfTables: ცხრილი\nPage: გვ.\nPart: ნაწილი\nPreface: წინასიტყვაობა\nProof: დამტკიცება\nReferences: ლიტერატურა\nSee: იხ.\nSeeAlso: იხ. ასევე\nTable: ცხრ.\nTo: შ.\n"
  },
  {
    "path": "data/translations/km.yaml",
    "content": "Abstract: សង្ខេប\nAppendix: សេចក្ដីបន្ថែម\nBibliography: គន្ថនិទ្ទេស\nCc: ចម្លងជួន\nChapter: ជំពូក\nContents: មាតិការ\nEncl: ឯកសារភ្ជាប់\nFigure: រូប\nGlossary: សទានុក្រម\nIndex: សន្ទស្សន៍\nListOfFigures: បញ្ជីរូបភាព\nListOfTables: បញ្ជីតារាង\nPage: ទំព័រ\nPart: ផ្នែក\nPreface: អារម្ភកថា\nProof: សម្រាយ\nReferences: ឯកសារយោង\nSee: មើល\nSeeAlso: មើលបន្ថែម\nTable: តារាង\nTo: ផ្ញើរទៅ\n"
  },
  {
    "path": "data/translations/kmr-Arab.yaml",
    "content": "Abstract: کورتەبیر\nAppendix: پاشکۆ\nBibliography: چاڤکانییا پرتووکان\nCc: بەلاڤکەر\nChapter: سەرێ\nContents: ناڤێرۆک\nEncl: دوماهک\nFigure: دیمەنێ\nGlossary: چاڤکانییا لێکۆلینێ\nIndex: پێرست\nListOfFigures: هەژمارا دیمەنا\nListOfTables: هەژمارا کەڤالێن\nPage: رووپەلێ\nPart: بەشا\nPreface: پێشگۆتن\nProof: دەلیل\nReferences: پرتووکێن بژارتی\nSee: بنێرا\nSeeAlso: لە ڤێیا ژ بنێرا\nTable: کەڤالا\nTo: ژ بۆ\n"
  },
  {
    "path": "data/translations/kmr-Latn.yaml",
    "content": "Abstract: Kurtebîr\nAppendix: Tebînîya\nBibliography: Çavkanîya Pirtukan\nCc: Belavker\nChapter: Serê\nContents: Navêrok\nEncl: Dumahik\nFigure: Dimenê\nGlossary: Çavkanîya lêkolînê\nIndex: Endeks\nListOfFigures: Hejmara Dimena\nListOfTables: Hejmara Kevalen\nPage: Rûpelê\nPart: Bêşa\nPreface: Peşgotin\nProof: Delîl\nReferences: Pirtuken bijartî\nSee: binêra\nSeeAlso: le vêya ji binêra\nTable: Kevala\nTo: Ji bo\n"
  },
  {
    "path": "data/translations/kn.yaml",
    "content": "Abstract: ಸಾರಾಂಶ\nAppendix: ಅನುಬಂಧ\nBibliography: ಗ್ರಂಥಸೂಚಿ\nCc: cc\nChapter: ಅಧ್ಯಾಯ\nContents: ವಿಷಯಗಳು\nEncl: encl\nFigure: ಚಿತ್ರ\nIndex: ಸೂಚಿ\nListOfFigures: ಚಿತ್ರಗಳ ಪಟ್ಟಿ\nListOfTables: ಕೋಷ್ಟಕಗಳ ಪಟ್ಟಿ\nPage: ಪುಟ\nPart: ಭಾಗ\nPreface: ಮುನ್ನುಡಿ\nProof: ಕರಡುಪ್ರತಿ\nReferences: ಉಲ್ಲೇಖಗಳು\nSee: ನೋಡು\nSeeAlso: ಇದನ್ನೂ ಸಹ ನೋಡು\nTable: ಕೋಷ್ಟಕ\nTo: ಗೆ\n"
  },
  {
    "path": "data/translations/ko.yaml",
    "content": "Abstract: 요약\nAppendix: 부록\nBibliography: 참고문헌\nCc: 사본\nChapter: 장\nContents: 차례\nEncl: 동봉\nFigure: 그림\nIndex: 찾아보기\nListOfFigures: 그림 차례\nListOfTables: 표 차례\nPage: 페이지\nPreface: 서문\nProof: 증명\nReferences: 참고문헌\nTable: 표\nTo: 수신\n"
  },
  {
    "path": "data/translations/la.yaml",
    "content": "Abstract: Summarium\nAppendix: Additamentum\nBibliography: Conspectus librorum\nCc: Exemplar\nChapter: Caput\nContents: Index\nEncl: Additur\nFigure: Descriptio\nGlossary: Glossarium\nIndex: Index rerum notabilium\nListOfFigures: Conspectus descriptionum\nListOfTables: Conspectus tabularum\nPage: charta\nPart: Pars\nPreface: Praefatio\nProof: Demonstratio\nReferences: Conspectus librorum\nSee: cfr.\nSeeAlso: cfr.\nTable: Tabula\n"
  },
  {
    "path": "data/translations/lb.yaml",
    "content": "Abstract: Resümee\nAppendix: Annex\nBibliography: Bibliographie\nCc: Distributeur\nChapter: Kapitel\nContents: Contenue\nEncl: Annex(en)\nFigure: Bild\nGlossary: Glossär\nIndex: Index\nListOfFigures: Lëscht vun de Biller\nListOfTables: Lëscht vun den Tabellen\nPage: Säit\nPart: Deel\nPreface: Virwuert\nProof: Beweis\nReferences: Literatur\nSee: kuck\nSeeAlso: kuck och\nTable: Tabell\nTo: Un\n"
  },
  {
    "path": "data/translations/lo.yaml",
    "content": "Abstract: ບົດຫຍໍ້ຄວາມ\nAppendix: ພາກຄັດຕິດ\nBibliography: ເອກະສານອ້າງອີງ\nCc: ສໍາເນົາເຖິງ\nChapter: ບົດທີ\nContents: ສາລະບານ\nEncl: ເອກະສານປະກອບ\nFigure: ຮູບທີ\nGlossary: ປະມວນສັບ\nIndex: ດັດຊະນີ\nListOfFigures: ສາລະບານຮູບ\nListOfTables: ສາລະບານຕາຕະລາງ\nPage: ໜ້າ\nPart: ພາກ\nPreface: ຄໍານໍາ\nProof: ຂໍ້ພິສູດ\nReferences: ໜັງສືອ້າງອີງ\nSee: ອ່ານ\nSeeAlso: ອ່ານເພີ່ມ\nTable: ຕາຕະລາງທີ\nTo: ຮຽນ\n"
  },
  {
    "path": "data/translations/lt.yaml",
    "content": "Abstract: Santrauka\nAppendix: Priedas\nBibliography: Literatūra\nCc: Kopijos\nChapter: Skyrius\nContents: Turinys\nEncl: Įdėta\nFigure: pav.\nGlossary: Terminų žodynas\nIndex: Rodyklė\nListOfFigures: Iliustracijų sąrašas\nListOfTables: Lentelių sąrašas\nPage: puslapis\nPart: Dalis\nPreface: Pratarmė\nProof: Įrodymas\nReferences: Literatūra\nSee: žiūrėk\nSeeAlso: taip pat\nTable: lentelė\nTo: Kam\n"
  },
  {
    "path": "data/translations/lv.yaml",
    "content": "Abstract: Anotācija\nAppendix: Pielikums\nBibliography: Literatūra\nCc: Kopija(s)\nChapter: Nodaļa\nContents: Saturs\nEncl: Pielikumā\nFigure: Att.\nIndex: Priekšmetu rādītājs\nListOfFigures: Attēlu saraksts\nListOfTables: Tabulu saraksts\nPage: lpp.\nPart: Daļa\nPreface: Priekšvārds\nProof: Pierādījums\nReferences: Literatūras saraksts\nSee: sk.\nSeeAlso: sk. arī\nTable: Tabula\nTo: To\n"
  },
  {
    "path": "data/translations/mk.yaml",
    "content": "Abstract: Апстракт\nAppendix: Прилог\nBibliography: Библиографиjа\nCc: копиjа\nChapter: Глава\nContents: Содржина\nEncl: Прилози\nFigure: Слика\nGlossary: Речник\nIndex: Индекс на термини\nListOfFigures: Листа на слики\nListOfTables: Листа на табели\nPage: стр.\nPart: Дел\nPreface: Предговор\nProof: доказ\nReferences: Литература\nSee: види\nSeeAlso: види исто така\nTable: Табела\nTo: За\n"
  },
  {
    "path": "data/translations/ml.yaml",
    "content": "Abstract: സാരാംശം\nAppendix: ശിഷ്ടം\nChapter: അദ്ധ്യായം\nContents: ഉള്ളടക്കം\nFigure: ചിത്രം\nIndex: സൂചിക\nListOfFigures: ചിത്രസൂചിക\nListOfTables: പട്ടികകളുടെ സൂചിക\nPart: ഭാഗം\nSee: കാണുക\nSeeAlso: ഇതും കാണുക\nTable: പട്ടിക\n"
  },
  {
    "path": "data/translations/mn.yaml",
    "content": "Abstract: Удиртгал\nAppendix: Хавсралт\nBibliography: Номзүй\nCc: э.с.\nChapter: Бүлэг\nContents: Гарчиг\nEncl: Ишлэл\nFigure: Зураг\nIndex: Товъёг\nListOfFigures: Зургийн жагсаалт\nListOfTables: Хүснэгтийн жагсаалт\nPage: тал\nPart: Хэсэг\nPreface: Өмнөх үг\nProof: Баталгаа\nReferences: Ашигласан ном\nSee: талд үз\nSeeAlso: мөн талд үз\nTable: Хүснэгт\n"
  },
  {
    "path": "data/translations/mr.yaml",
    "content": "Abstract: सारांश\nAppendix: परिशिष्ट\nBibliography: संदर्भसूची\nCc: प्रत\nChapter: प्रकरण\nContents: अनुक्रमणिका\nEncl: समाविष्ट\nFigure: आकृती\nGlossary: संज्ञासूची\nIndex: सूची\nListOfFigures: आकृत्यांची सूची\nListOfTables: कोष्टकसूची\nPage: पृष्ठ\nPart: खंड\nPreface: प्रस्तावना\nProof: सिद्धता\nReferences: संदर्भ\nSee: पाहा\nSeeAlso: हेदेखील पाहा\nTable: कोष्टक\nTo: प्रति\n"
  },
  {
    "path": "data/translations/ms.yaml",
    "content": "Abstract: Abstrak\nAppendix: Lampiran\nBibliography: Bibliografi\nCc: sk\nChapter: Bab\nContents: Kandungan\nEncl: Lampiran\nFigure: Gambar\nGlossary: Istilah\nIndex: Indeks\nListOfFigures: Senarai Gambar\nListOfTables: Senarai Jadual\nPage: Halaman\nPart: Bahagian\nPreface: Prakata\nProof: Bukti\nReferences: Rujukan\nSee: sila rujuk\nSeeAlso: rujuk juga\nTable: Jadual\nTo: Kepada\n"
  },
  {
    "path": "data/translations/nb.yaml",
    "content": "Abstract: Sammendrag\nAppendix: Tillegg\nBibliography: Bibliografi\nCc: Kopi sendt\nChapter: Kapittel\nContents: Innhold\nEncl: Vedlegg\nFigure: Figur\nGlossary: Ordliste\nIndex: Register\nListOfFigures: Figurer\nListOfTables: Tabeller\nPage: Side\nPart: Del\nPreface: Forord\nProof: Bevis\nReferences: Referanser\nSee: Se\nSeeAlso: Se også\nTable: Tabell\nTo: Til\n"
  },
  {
    "path": "data/translations/nko.yaml",
    "content": "Abstract: ߓߊߕߐߡߐ߲\nAppendix: ߘߋ߬ߙߋ\nBibliography: ߟߍߙߊߥߙߍߟߐ߲߲\nCc: ߓߊ ߘߏ߫ ߘߌ߫\nChapter: ߛߌ߰ߘߊ\nContents: ߞߣߐߘߐ\nEncl: ߝߍ߬ߕߊ\nFigure: ߢߊ\nGlossary: ߞߘߐߝߐߟߊ߲\nIndex: ߛߙߍߘߍ\nListOfFigures: ߢߊ ߟߎ߬ ߛߙߍߘߍ\nListOfTables: ߦߌ߬ߘߊ߬ߥߟߊ ߟߎ߬ ߛߙߍߘߍ\nPage: ߞߐߜߍ\nPart: ߛߌ߰ߘߊ߬ߙߋ߲\nPreface: ߢߍߛߓߍ\nProof: ߦߌ߬ߘߊ߬ߞߏ\nReferences: ߞߐߡߊߛߙߋ\nSee: ߡߊߝߟߍ߫\nSeeAlso: ߝߟߍߡߊߛߊ߬ߦߌ߬\nTable: ߦߌ߬ߘߊ߬ߥߟߊ\nTo: ߞߊߕߙߍ߬\n"
  },
  {
    "path": "data/translations/nl.yaml",
    "content": "Abstract: Samenvatting\nAppendix: Bĳlage\nBibliography: Bibliografie\nCc: cc\nChapter: Hoofdstuk\nContents: Inhoudsopgave\nEncl: Bĳlage(n)\nFigure: Figuur\nGlossary: Verklarende Woordenlĳst\nIndex: Index\nListOfFigures: Lĳst van figuren\nListOfTables: Lĳst van tabellen\nPage: Pagina\nPart: Deel\nPreface: Voorwoord\nProof: Bewĳs\nReferences: Referenties\nSee: zie\nSeeAlso: zie ook\nTable: Tabel\nTo: Aan\n"
  },
  {
    "path": "data/translations/nn.yaml",
    "content": "Abstract: Samandrag\nAppendix: Tillegg\nBibliography: Litteratur\nCc: Kopi til\nChapter: Kapittel\nContents: Innhald\nEncl: Vedlegg\nFigure: Figur\nGlossary: Ordliste\nIndex: Register\nListOfFigures: Figurar\nListOfTables: Tabellar\nPage: Side\nPart: Del\nPreface: Forord\nProof: Bevis\nReferences: Referansar\nSee: Sjå\nSeeAlso: Sjå òg\nTable: Tabell\nTo: Til\n"
  },
  {
    "path": "data/translations/oc.yaml",
    "content": "Abstract: Resumit\nAppendix: Annèx\nBibliography: Bibliografia\nCc: còpia a\nChapter: Capítol\nContents: Ensenhador\nEncl: Pèça junta\nFigure: Figura\nGlossary: Glossari\nIndex: Indèx\nListOfFigures: Taula de las figuras\nListOfTables: Taula dels tablèus\nPage: Pagina\nPart: Partida\nPreface: Prefàcia\nProof: Demostracion\nReferences: Referéncias\nSee: vejatz\nSeeAlso: vejatz tanben\nTable: Tablèu\nTo: A\n"
  },
  {
    "path": "data/translations/or.yaml",
    "content": "Abstract: ସାରାଂଶ\nAppendix: ପରିଶିଷ୍ଟ\nBibliography: ସୂଚନା\nCc: କପି କରନ୍ତୁ\nChapter: ଅଧ୍ୟାୟ\nContents: ସୁଚୀ ପତ୍ର\nEncl: ସଂଲଗ୍ନ\nFigure: ପ୍ରତିଛବି\nGlossary: ଶବ୍ଦର ଶବ୍ଦକୋଷ\nIndex: ସୂଚକାଙ୍କ\nListOfFigures: ପ୍ରତିଛବି ତାଲିକା\nListOfTables: ଟେବୁଲ ତାଲିକା\nPage: ପୃଷ୍ଠା\nPart: ବିଭାଗ\nPreface: ପ୍ରାରମ୍ଭ\nProof: ପ୍ରମାଣ\nReferences: ସନ୍ଦର୍ଭ\nSee: ଦେଖନ୍ତୁ\nSeeAlso: ଅଧିକ ଦେଖନ୍ତୁ\nTable: ଟେବୁଲ୍\nTo: ପ୍ରତି\n"
  },
  {
    "path": "data/translations/pa.yaml",
    "content": "Abstract: ਨਿਚੋੜ\nAppendix: ਲੜੀਵਾਰ\nBibliography: ਸੰਬੰਧਤ ਹਵਾਲੇ\nCc: ਕਾਪੀ\nChapter: ਪਾਠ\nContents: ਸਮਗਰੀ\nEncl: ਨੱਥੀ\nFigure: ਸ਼ਕਲ\nGlossary: ਕੁੰਜੀ\nIndex: ਸੂਚੀ\nListOfFigures: ਸ਼ਕਲਾਂ ਦੀ ਲੜੀ\nListOfTables: ਲੜੀਆਂ ਦਾ ਲੇਖਾ\nPage: ਵਰਕਾ\nPart: ਹਿੱਸਾ\nPreface: ਮੁੱਖਬੰਦ\nProof: ਪਰਮਾਣ\nReferences: ਹਵਾਲਾ\nSee: ਵੇਖੋ\nSeeAlso: ਹੋਰ\nTable: ਲੇਖਾ\n"
  },
  {
    "path": "data/translations/pl.yaml",
    "content": "Abstract: Streszczenie\nAppendix: Dodatek\nBibliography: Bibliografia\nCc: Kopie\nChapter: Rozdział\nContents: Spis treści\nEncl: Załącznik\nFigure: Rysunek\nGlossary: Glossary\nIndex: Indeks\nListOfFigures: Spis rysunków\nListOfTables: Spis tabel\nPage: Strona\nPart: Część\nPreface: Przedmowa\nProof: Dowód\nReferences: Literatura\nSee: Zobacz\nSeeAlso: Zobacz też\nTable: Tabela\nTo: Do\n"
  },
  {
    "path": "data/translations/pms.yaml",
    "content": "Abstract: Somari\nAppendix: Gionta\nBibliography: Bibliografìa\nCc: Con còpia a\nChapter: Capìtol\nContents: Tàula\nEncl: Gionta/e\nFigure: Figura\nGlossary: Glossari\nIndex: Tàula analìtica\nListOfFigures: Lista dle figure\nListOfTables: Lista dle tabele\nPage: Pàgina\nPart: Part\nPreface: Prefassion\nProof: Dimostrassion\nReferences: Riferiment\nSee: vëd\nSeeAlso: vëd anche\nTable: Tabela\nTo: Për\n"
  },
  {
    "path": "data/translations/pt-BR.yaml",
    "content": "Abstract: Resumo\nAppendix: Apêndice\nBibliography: Referências Bibliográficas\nCc: Cópia para\nChapter: Capítulo\nContents: Sumário\nEncl: Anexo\nFigure: Figura\nGlossary: Glossário\nIndex: Índice Remissivo\nListOfFigures: Lista de Figuras\nListOfTables: Lista de Tabelas\nPage: Página\nPart: Parte\nPreface: Prefácio\nProof: Demonstração\nReferences: Referências\nSee: veja\nSeeAlso: veja também\nTable: Tabela\nTo: Para\n"
  },
  {
    "path": "data/translations/pt-PT.yaml",
    "content": "Abstract: Resumo\nAppendix: Apêndice\nBibliography: Bibliografia\nCc: Com cópia a\nChapter: Capítulo\nContents: Conteúdo\nEncl: Anexo\nFigure: Figura\nGlossary: Glossário\nIndex: Índice\nListOfFigures: Lista de Figuras\nListOfTables: Lista de Tabelas\nPage: Página\nPart: Parte\nPreface: Prefácio\nProof: Demonstração\nReferences: Referências\nSee: ver\nSeeAlso: ver também\nTable: Tabela\nTo: Para\n"
  },
  {
    "path": "data/translations/pt.yaml",
    "content": "Abstract: Resumo\nAppendix: Apêndice\nBibliography: Bibliografia\nCc: Com cópia a\nChapter: Capítulo\nContents: Conteúdo\nEncl: Anexo\nFigure: Figura\nGlossary: Glossário\nIndex: Índice\nListOfFigures: Lista de Figuras\nListOfTables: Lista de Tabelas\nPage: Página\nPart: Parte\nPreface: Prefácio\nProof: Demonstração\nReferences: Referências\nSee: ver\nSeeAlso: ver também\nTable: Tabela\nTo: Para\n"
  },
  {
    "path": "data/translations/rm.yaml",
    "content": "Abstract: Recapitulaziun\nAppendix: Appendix\nBibliography: Index bibliografic\nCc: Copia a\nChapter: Chapitel\nContents: Tavla dal cuntegn\nEncl: Agiunta(s)\nFigure: Figura\nGlossary: Glossari\nIndex: Register da materias\nListOfFigures: Tavla da las figuras\nListOfTables: Tavla da las tabellas\nPage: pagina\nPart: Part\nPreface: Prefaziun\nProof: Demonstraziun\nReferences: Bibliografia\nSee: vesair\nSeeAlso: vesair era\nTable: Tabella\nTo: A\n"
  },
  {
    "path": "data/translations/ro.yaml",
    "content": "Abstract: Rezumat\nAppendix: Anexa\nBibliography: Bibliografie\nCc: Copie\nChapter: Capitolul\nContents: Cuprins\nEncl: Anexă\nFigure: Figura\nGlossary: Glosar\nIndex: Glosar\nListOfFigures: Listă de figuri\nListOfTables: Listă de tabele\nPage: Pagina\nPart: Partea\nPreface: Prefaţă\nProof: Demonstraţie\nReferences: Bibliografie\nSee: Vezi\nSeeAlso: Vezi de asemenea\nTable: Tabela\nTo: Pentru\n"
  },
  {
    "path": "data/translations/ru.yaml",
    "content": "Abstract: Аннотация\nAppendix: Приложение\nBibliography: Литература\nCc: исх.\nChapter: Глава\nContents: Содержание\nEncl: вкл.\nFigure: Рис.\nGlossary: Словарь терминов\nIndex: Предметный указатель\nListOfFigures: Список иллюстраций\nListOfTables: Список таблиц\nPage: с.\nPart: Часть\nPreface: Предисловие\nProof: Доказательство\nReferences: Список литературы\nSee: см.\nSeeAlso: см. также\nTable: Таблица\nTo: вх.\n"
  },
  {
    "path": "data/translations/se.yaml",
    "content": "Abstract: Čoahkkáigeassu\nAppendix: Čuovus\nBibliography: Girjjálašvuohta\nCc: Kopia sáddejuvvon\nChapter: Kapihttal\nContents: Sisdoallu\nEncl: Mielddus\nFigure: Govus\nGlossary: Sátnelistu\nIndex: Registtar\nListOfFigures: Govvosat\nListOfTables: Tabeallat\nPage: Siidu\nPart: Oassi\nPreface: Ovdasátni\nProof: Duođaštus\nReferences: Čujuhusat\nSee: geahča\nSeeAlso: geahča maiddái\nTable: Tabealla\nTo: Vuostáiváldi\n"
  },
  {
    "path": "data/translations/si.yaml",
    "content": "Abstract: සංක්ෂෙපය\nAppendix: උපග්‍රන්ථය\nBibliography: ග්‍රන්ථ නාමාවලිය\nCc: පිටපත්\nChapter: පරිච්ඡේදය\nContents: පටුන\nEncl: ඇමුණුම\nFigure: සටහන\nGlossary: පදමාලාව\nIndex: සූචිය\nListOfFigures: සටහන් ලේඛනය\nListOfTables: වගු ලේඛනය\nPage: පිට\nPart: කොටස\nPreface: පෙරවදන\nProof: සාධනය\nReferences: යොමුව\nSee: බලනු\nSeeAlso: තවද\nTable: වගුව\nTo: වෙත\n"
  },
  {
    "path": "data/translations/sk.yaml",
    "content": "Abstract: Abstrakt\nAppendix: Dodatok\nBibliography: Literatúra\nCc: cc.\nChapter: Kapitola\nContents: Obsah\nEncl: Príloha\nFigure: Obr.\nGlossary: Slovník\nIndex: Register\nListOfFigures: Zoznam obrázkov\nListOfTables: Zoznam tabuliek\nPage: Str.\nPart: Časť\nPreface: Predhovor\nProof: Dôkaz\nReferences: Literatúra\nSee: viď\nSeeAlso: viď tiež\nTable: Tabuľka\nTo: Pre\n"
  },
  {
    "path": "data/translations/sl.yaml",
    "content": "Abstract: Povzetek\nAppendix: Dodatek\nBibliography: Literatura\nCc: Kopije\nChapter: Poglavje\nContents: Kazalo\nEncl: Priloge\nFigure: Slika\nGlossary: Slovar\nIndex: Stvarno kazalo\nListOfFigures: Slike\nListOfTables: Tabele\nPage: Stran\nPart: Del\nPreface: Predgovor\nProof: Dokaz\nReferences: Literatura\nSee: glej\nSeeAlso: glej tudi\nTable: Tabela\nTo: Prejme\n"
  },
  {
    "path": "data/translations/sq.yaml",
    "content": "Abstract: Përmbledhja\nAppendix: Shtesa\nBibliography: Bibliografia\nCc: Kopja\nChapter: Kapitulli\nContents: Përmbajtja\nEncl: Lidhja\nFigure: Figura\nGlossary: Përhasja e Fjalëve\nIndex: Indeksi\nListOfFigures: Figurat\nListOfTables: Tabelat\nPage: Faqe\nPart: Pjesa\nPreface: Parathenia\nProof: Vërtetim\nReferences: Referencat\nSee: shiko\nSeeAlso: shiko dhe\nTable: Tabela\nTo: Për\n"
  },
  {
    "path": "data/translations/sr-Cyrl.yaml",
    "content": "Abstract: Сажетак\nAppendix: Додатак\nBibliography: Библиографиjа\nCc: Копиjе\nChapter: Глава\nContents: Садржаj\nEncl: Прилози\nFigure: Слика\nGlossary: Речник\nIndex: Индекс\nListOfFigures: Списак слика\nListOfTables: Списак табела\nPage: страна\nPart: Део\nPreface: Предговор\nProof: Доказ\nReferences: Литература\nSee: види\nSeeAlso: видитакође\nTable: Табела\nTo: Прима\n"
  },
  {
    "path": "data/translations/sr-Latn.yaml",
    "content": "Abstract: Sažetak\nAppendix: Dodatak\nBibliography: Bibliografija\nCc: Kopije\nChapter: Glava\nContents: Sadržaj\nEncl: Prilozi\nFigure: Slika\nGlossary: Rečnik\nIndex: Indeks\nListOfFigures: Spisak slika\nListOfTables: Spisak tabela\nPage: strana\nPart: Deo\nPreface: Predgovor\nProof: Dokaz\nReferences: Literatura\nSee: vidi\nSeeAlso: vidi takođe\nTable: Tabela\nTo: Prima\n"
  },
  {
    "path": "data/translations/sr.yaml",
    "content": "Abstract: Сажетак\nAppendix: Додатак\nBibliography: Библиографиjа\nCc: Копиjе\nChapter: Глава\nContents: Садржаj\nEncl: Прилози\nFigure: Слика\nGlossary: Речник\nIndex: Индекс\nListOfFigures: Списак слика\nListOfTables: Списак табела\nPage: страна\nPart: Део\nPreface: Предговор\nProof: Доказ\nReferences: Литература\nSee: види\nSeeAlso: видитакође\nTable: Табела\nTo: Прима\n"
  },
  {
    "path": "data/translations/sv.yaml",
    "content": "Abstract: Sammanfattning\nAppendix: Bilaga\nBibliography: Litteraturförteckning\nCc: Kopia för kännedom\nChapter: Kapitel\nContents: Innehåll\nEncl: Bil.\nFigure: Figur\nGlossary: Ordlista\nIndex: Sakregister\nListOfFigures: Figurer\nListOfTables: Tabeller\nPage: Sida\nPart: Del\nPreface: Förord\nProof: Bevis\nReferences: Referenser\nSee: se\nSeeAlso: se även\nTable: Tabell\nTo: Till\n"
  },
  {
    "path": "data/translations/ta.yaml",
    "content": "Abstract: சாராம்சம்\nAppendix: பிற்சேர்க்கை\nChapter: அத்தியாயம்\nContents: உள்ளே\nFigure: படம்\nIndex: சுட்டி\nListOfFigures: படங்களின் பட்டியல்\nListOfTables: அட்டவணை பட்டியல்\nPart: பகுதி\nSee: பார்க்க\nTable: அட்டவணை\n"
  },
  {
    "path": "data/translations/te.yaml",
    "content": "Abstract: సారాంశం\nAppendix: అదనంగా\nBibliography: గ్రంథాల జాబితా\nCc: సిసి\nChapter: అధ్యాయము\nContents: విషయాలు\nEncl: ఎంక్లోజర్*\nFigure: ఆకృతి\nGlossary: నిఘంటువు\nIndex: విషయ సూచిక\nListOfFigures: ఆకృతుల జాబితా\nListOfTables: పట్టికల జాబితా\nPage: పేజి\nPart: భాగం\nPreface: ముందుమాట\nProof: రుజువు\nReferences: ఆధారాలు\nSee: చూడండి\nSeeAlso: కూడా చూడండి\nTable: పట్టిక\nTo: కి\n"
  },
  {
    "path": "data/translations/th.yaml",
    "content": "Abstract: บทคัดย่อ\nAppendix: ภาคผนวก\nBibliography: บรรณานุกรม\nCc: สำเนาถึง\nChapter: บทที่\nContents: สารบัญ\nEncl: สิ่งที่แนบมาด้วย\nFigure: รูปที่\nIndex: ดรรชนี\nListOfFigures: สารบัญรูป\nListOfTables: สารบัญตาราง\nPage: หน้า\nPart: ภาค\nPreface: บทนำ\nProof: พิสูจน์\nReferences: หนังสืออ้างอิง\nSee: ดู\nSeeAlso: ดูเพิ่มเติม\nTable: ตารางที่\nTo: เรียน\n"
  },
  {
    "path": "data/translations/tk.yaml",
    "content": "Abstract: Gysgaça manysy\nAppendix: Goşmaça\nBibliography: Çeşmeler\nCc: Iberilenler\nChapter: Bap\nContents: Mazmuny\nEncl: Goşmaça\nFigure: Surat\nGlossary: Sözlük\nIndex: Indeks\nListOfFigures: Suratlaryň sanawy\nListOfTables: Tablisalaryň sanawy\nPage: Sahypa\nPart: Bölüm\nPreface: Sözbaşy\nProof: Delil\nReferences: Çeşmeler\nSee: ser.\nSeeAlso: şuňa-da ser.\nTable: Tablisa\nTo: Kime\n"
  },
  {
    "path": "data/translations/tr.yaml",
    "content": "Abstract: Özet\nAppendix: Ek\nBibliography: Kaynakça\nCc: Diğer Alıcılar\nChapter: Bölüm\nContents: İçindekiler\nEncl: İlişik\nFigure: Şekil\nGlossary: Lügatçe\nIndex: Dizin\nListOfFigures: Şekil Listesi\nListOfTables: Tablo Listesi\nPage: Sayfa\nPart: Kısım\nPreface: Önsöz\nProof: Kanıt\nReferences: Kaynaklar\nSee: bkz.\nSeeAlso: ayrıca bkz.\nTable: Tablo\nTo: Alıcı\n"
  },
  {
    "path": "data/translations/ua.yaml",
    "content": "Abstract: Резюме\nAppendix: Додаток\nBibliography: Бібліографія\nCc: Розповсюджувач\nChapter: Розділ\nContents: Зміст\nEncl: Додаток(и)\nFigure: Ілюстрація\nGlossary: Глосарій\nIndex: Індекс\nListing: Список\nListOfFigures: Список рисунків\nListOfTables: Список таблиць\nPage: Сторінка\nPart: Частина\nPreface: Передмова\nProof: Докази\nReferences: Література\nSee: див.\nSeeAlso: див. також\nTable: Таблиця\nTo: До\n"
  },
  {
    "path": "data/translations/ug.yaml",
    "content": "Abstract: ئابستراكت\nAppendix: قوشۇمچە\nBibliography: پايدىلانما\nCc: باشقا تاپشۇرۇۋالغۇچى\nChapter: باب\nContents: مۇندەرىجە\nEncl: قوشۇمچە ھۆججەت\nFigure: رەسىم\nGlossary: لۇغەت\nIndex: ئىندېكىس\nListOfFigures: رەسىملەر\nListOfTables: جەدۋەللەر\nPage: بەت\nPart: قىسىم\nPreface: كىرىش سۆز\nProof: ئىسپات\nReferences: پايدىلانما\nSee: قاراڭ\nSeeAlso: ئايرىم قاراڭ\nTable: جەدۋەل\nTo: تاپشۇرۇۋالغۇچى\n"
  },
  {
    "path": "data/translations/uk.yaml",
    "content": "Abstract: Анотація\nAppendix: Додаток\nBibliography: Бібліоґрафія\nCc: копія\nChapter: Розділ\nContents: Зміст\nEncl: вкладка\nFigure: Рис.\nGlossary: Словник термінів\nIndex: Покажчик\nListOfFigures: Перелік ілюстрацій\nListOfTables: Перелік таблиць\nPage: с.\nPart: Частина\nPreface: Вступ\nProof: Доведення\nReferences: Література\nSee: див.\nSeeAlso: див. також\nTable: Табл.\nTo: До\n"
  },
  {
    "path": "data/translations/ur.yaml",
    "content": "Abstract: ملخّص\nAppendix: ضمیمہ\nBibliography: کتابیات\nCc: نقل\nChapter: باب\nContents: فہرست عنوانات\nEncl: منسلک\nFigure: شكل\nGlossary: لغت\nIndex: اشاریہ\nListOfFigures: فہرست اشکال\nListOfTables: فہرست جداول\nPage: صفحہ\nPart: حصّہ\nPreface: دیباچہ\nProof: ثبوت\nReferences: حوالہ جات\nSee: ملاحظہ ہو\nSeeAlso: ایضاً\nTable: جدول\nTo: بملاحظہ\n"
  },
  {
    "path": "data/translations/vi.yaml",
    "content": "Abstract: Tóm tắt nội dung\nAppendix: Phụ lục\nBibliography: Tài liệu tham khảo\nCc: Cùng gửi\nChapter: Chương\nContents: Mục lục\nEncl: Kèm theo\nFigure: Hình\nGlossary: Từ điển chú giải\nIndex: Chỉ mục\nListOfFigures: Danh sách hình vẽ\nListOfTables: Danh sách bảng\nPage: Trang\nPart: Phần\nPreface: Lời nói đầu\nProof: Chứng minh\nReferences: Tài liệu\nSee: Xem\nSeeAlso: Xem thêm\nTable: Bảng\nTo: Gửi\n"
  },
  {
    "path": "data/translations/zh-Hans.yaml",
    "content": "Abstract: 摘要\nAppendix: 附录\nBibliography: 文献目录\nCc: 副本\nChapter: 章\nContents: 目录\nEncl: 附件\nFigure: 图\nGlossary: 术语\nIndex: 索引\nListing: 列表\nListOfFigures: 附图目录\nListOfTables: 表格索引\nPage: 页\nPart: 段\nPreface: 序\nProof: 校对\nReferences: 参考文献\nSee: 见\nSeeAlso: 参见\nTable: 表\nTo: 到\n"
  },
  {
    "path": "data/translations/zh-Hant.yaml",
    "content": "Abstract: 摘要\nAppendix: 附錄\nBibliography: 文獻目錄\nCc: 副本\nChapter: 章\nContents: 目錄\nEncl: 附件\nFigure: 圖\nGlossary: 術語\nIndex: 索引\nListing: 列表\nListOfFigures: 附圖目錄\nListOfTables: 表格索引\nPage: 頁\nPart: 段\nPreface: 序\nProof: 校對\nReferences: 參考文獻\nSee: 見\nSeeAlso: 參見\nTable: 表\nTo: 到\n"
  },
  {
    "path": "doc/custom-readers.md",
    "content": "---\nauthor:\n- John MacFarlane\ndate: 'November 18, 2021'\ntitle: Creating Custom Pandoc Readers in Lua\n---\n\n# Introduction\n\nIf you need to parse a format not already handled by pandoc,\nyou can create a custom reader using the [Lua] language.\nPandoc has a built-in Lua interpreter, so you needn't\ninstall any additional software to do this.\n\n[Lua]: https://www.lua.org\n\nA custom reader is a Lua file that defines a function\ncalled `Reader`, which takes two arguments:\n\n- the raw input to be parsed, as a list of sources\n- optionally, a table of reader options, e.g.\n  `{ columns = 62, standalone = true }`.\n\nThe `Reader` function should return a `Pandoc` AST.\nThis can be created using functions in the [`pandoc` module],\nwhich is automatically in scope.  (Indeed, all of the utility\nfunctions that are available for [Lua filters] are available\nin custom readers, too.)\n\nEach source item corresponds to a file or stream passed to pandoc\ncontaining its text and name. E.g., if a single file `input.txt`\nis passed to pandoc, then the list of sources will contain just a\nsingle element `s`, where `s.name == 'input.txt'` and `s.text`\ncontains the file contents as a string.\n\nThe sources list, as well as each of its elements, can be\nconverted to a string via the Lua standard library function\n`tostring`.\n\n[Lua filters]: https://pandoc.org/lua-filters.html\n[`pandoc` module]: https://pandoc.org/lua-filters.html#module-pandoc\n\nA minimal example would be\n\n```lua\nfunction Reader(input)\n  return pandoc.Pandoc({ pandoc.CodeBlock(tostring(input)) })\nend\n```\n\nThis just returns a document containing a big code block with all\nof the input. Or, to create a separate code block for each input\nfile, one might write\n\n``` lua\nfunction Reader(input)\n  return pandoc.Pandoc(input:map(\n    function (s) return pandoc.CodeBlock(s.text) end))\nend\n```\n\nIn a nontrivial reader, you'll want to parse the input.\nYou can do this using standard Lua library functions\n(for example, the [patterns] library), or with the powerful\nand fast [lpeg] parsing library, which is automatically in scope.\nYou can also use external Lua libraries (for example,\nan XML parser).\n\nA previous pandoc version passed a raw string instead of a list\nof sources to the Reader function. Reader functions that rely on\nthis are obsolete, but still supported: Pandoc analyzes any\nscript error, detecting when code assumed the old behavior. The\ncode is rerun with raw string input in this case, thereby\nensuring backwards compatibility.\n\n[patterns]: http://lua-users.org/wiki/PatternsTutorial\n[lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/\n\n# Bytestring readers\n\nIn order to read binary formats, including docx, odt, and epub,\npandoc supports the `ByteStringReader` function. A\n`ByteStringReader` function is similar to the `Reader` function\nthat processes text input. Instead of a list of sources, the\nByteStringReader function is passed a bytestring, i.e., a string\nthat contains the binary input.\n\n``` lua\n-- read input as epub\nfunction ByteStringReader (input)\n  return pandoc.read(input, 'epub')\nend\n```\n\n# Format extensions\n\nCustom readers can be built such that their behavior is\ncontrollable through format extensions, such as `smart`,\n`citations`, or `hard-line-breaks`. Supported extensions are those\nthat are present as a key in the global `Extensions` table. Fields\nof extensions that are enabled default have the value `true` or\n`enable`, while those that are supported but disabled have value\n`false` or `disable`.\n\nExample: A reader with the following global table supports the\nextensions `smart`, `citations`, and `foobar`, with `smart` enabled and\nthe other two disabled by default:\n\n``` lua\nExtensions = {\n  smart = 'enable',\n  citations = 'disable',\n  foobar = true\n}\n```\n\nThe users control extensions as usual, e.g., `pandoc -f\nmy-reader.lua+citations`. The extensions are accessible through\nthe reader options' `extensions` field, e.g.:\n\n``` lua\nfunction Reader (input, opts)\n  print(\n    'The citations extension is',\n    opts.extensions:includes 'citations' and 'enabled' or 'disabled'\n  )\n  -- ...\nend\n```\n\nExtensions that are neither enabled nor disabled in the\n`Extensions` field are treated as unsupported by the\nreader. Trying to modify such an extension via the command line\nwill lead to an error.\n\n\n# Example: plain text reader\n\nThis is a simple example using [lpeg] to parse the input\ninto space-separated strings and blankline-separated paragraphs.\n\n```lua\n-- A sample custom reader that just parses text into blankline-separated\n-- paragraphs with space-separated words.\n\n-- For better performance we put these functions in local variables:\nlocal P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt =\n  lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V,\n  lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt\n\nlocal whitespacechar = S(\" \\t\\r\\n\")\nlocal wordchar = (1 - whitespacechar)\nlocal spacechar = S(\" \\t\")\nlocal newline = P\"\\r\"^-1 * P\"\\n\"\nlocal blanklines = newline * (spacechar^0 * newline)^1\nlocal endline = newline - blanklines\n\n-- Grammar\nG = P{ \"Pandoc\",\n  Pandoc = Ct(V\"Block\"^0) / pandoc.Pandoc;\n  Block = blanklines^0 * V\"Para\" ;\n  Para = Ct(V\"Inline\"^1) / pandoc.Para;\n  Inline = V\"Str\" + V\"Space\" + V\"SoftBreak\" ;\n  Str = wordchar^1 / pandoc.Str;\n  Space = spacechar^1 / pandoc.Space;\n  SoftBreak = endline / pandoc.SoftBreak;\n}\n\nfunction Reader(input)\n  return lpeg.match(G, tostring(input))\nend\n```\n\nExample of use:\n\n```\n% pandoc -f plain.lua -t native\n*Hello there*, this is plain text with no formatting\nexcept paragraph breaks.\n\n- Like this one.\n^D\n[ Para\n    [ Str \"*Hello\"\n    , Space\n    , Str \"there*,\"\n    , Space\n    , Str \"this\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"plain\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"no\"\n    , Space\n    , Str \"formatting\"\n    , SoftBreak\n    , Str \"except\"\n    , Space\n    , Str \"paragraph\"\n    , Space\n    , Str \"breaks.\"\n    ]\n, Para\n    [ Str \"-\"\n    , Space\n    , Str \"Like\"\n    , Space\n    , Str \"this\"\n    , Space\n    , Str \"one.\"\n    ]\n]\n```\n\n# Example: a wiki Creole reader\n\nThis is a parser for [Creole common wiki markup].\nIt uses an [lpeg] grammar.  Fun fact: this custom reader is faster than\npandoc's built-in creole reader! This shows that high-performance\nreaders can be designed in this way.\n\n[Creole common wiki markup]: http://www.wikicreole.org/wiki/CheatSheet\n\n\n```lua\n-- A sample custom reader for Creole 1.0 (common wiki markup)\n-- http://www.wikicreole.org/wiki/CheatSheet\n\n-- For better performance we put these functions in local variables:\nlocal P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt =\n  lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V,\n  lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt\n\nlocal whitespacechar = S(\" \\t\\r\\n\")\nlocal specialchar = S(\"/*~[]\\\\{}|\")\nlocal wordchar = (1 - (whitespacechar + specialchar))\nlocal spacechar = S(\" \\t\")\nlocal newline = P\"\\r\"^-1 * P\"\\n\"\nlocal blankline = spacechar^0 * newline\nlocal endline = newline * #-blankline\nlocal endequals = spacechar^0 * P\"=\"^0 * spacechar^0 * newline\nlocal cellsep = spacechar^0 * P\"|\"\n\nlocal function trim(s)\n   return (s:gsub(\"^%s*(.-)%s*$\", \"%1\"))\nend\n\nlocal function ListItem(lev, ch)\n  local start\n  if ch == nil then\n    start = S\"*#\"\n  else\n    start = P(ch)\n  end\n  local subitem = function(c)\n    if lev < 6 then\n      return ListItem(lev + 1, c)\n    else\n      return (1 - 1) -- fails\n    end\n  end\n  local parser = spacechar^0\n               * start^lev\n               * #(- start)\n               * spacechar^0\n               * Ct((V\"Inline\" - (newline * spacechar^0 * S\"*#\"))^0)\n               * newline\n               * (Ct(subitem(\"*\")^1) / pandoc.BulletList\n                  +\n                  Ct(subitem(\"#\")^1) / pandoc.OrderedList\n                  +\n                  Cc(nil))\n               / function (ils, sublist)\n                   return { pandoc.Plain(ils), sublist }\n                 end\n  return parser\nend\n\n-- Grammar\nG = P{ \"Doc\",\n  Doc = Ct(V\"Block\"^0)\n      / pandoc.Pandoc ;\n  Block = blankline^0\n        * ( V\"Header\"\n          + V\"HorizontalRule\"\n          + V\"CodeBlock\"\n          + V\"List\"\n          + V\"Table\"\n          + V\"Para\") ;\n  Para = Ct(V\"Inline\"^1)\n       * newline\n       / pandoc.Para ;\n  HorizontalRule = spacechar^0\n                 * P\"----\"\n                 * spacechar^0\n                 * newline\n                 / pandoc.HorizontalRule;\n  Header = (P(\"=\")^1 / string.len)\n         * spacechar^1\n         * Ct((V\"Inline\" - endequals)^1)\n         * endequals\n         / pandoc.Header;\n  CodeBlock = P\"{{{\"\n            * blankline\n            * C((1 - (newline * P\"}}}\"))^0)\n            * newline\n            * P\"}}}\"\n            / pandoc.CodeBlock;\n  Placeholder = P\"<<<\"\n              * C(P(1) - P\">>>\")^0\n              * P\">>>\"\n              / function() return pandoc.Div({}) end;\n  List = V\"BulletList\"\n       + V\"OrderedList\" ;\n  BulletList = Ct(ListItem(1,'*')^1)\n             / pandoc.BulletList ;\n  OrderedList = Ct(ListItem(1,'#')^1)\n             / pandoc.OrderedList ;\n  Table = (V\"TableHeader\" + Cc{})\n        * Ct(V\"TableRow\"^1)\n        / function(headrow, bodyrows)\n            local numcolumns = #(bodyrows[1])\n            local aligns = {}\n            local widths = {}\n            for i = 1,numcolumns do\n              aligns[i] = pandoc.AlignDefault\n              widths[i] = 0\n            end\n            return pandoc.utils.from_simple_table(\n              pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows))\n          end ;\n  TableHeader = Ct(V\"HeaderCell\"^1)\n              * cellsep^-1\n              * spacechar^0\n              * newline ;\n  TableRow   = Ct(V\"BodyCell\"^1)\n             * cellsep^-1\n             * spacechar^0\n             * newline ;\n  HeaderCell = cellsep\n             * P\"=\"\n             * spacechar^0\n             * Ct((V\"Inline\" - (newline + cellsep))^0)\n             / function(ils) return { pandoc.Plain(ils) } end ;\n  BodyCell   = cellsep\n             * spacechar^0\n             * Ct((V\"Inline\" - (newline + cellsep))^0)\n             / function(ils) return { pandoc.Plain(ils) } end ;\n  Inline = V\"Emph\"\n         + V\"Strong\"\n         + V\"LineBreak\"\n         + V\"Link\"\n         + V\"URL\"\n         + V\"Image\"\n         + V\"Str\"\n         + V\"Space\"\n         + V\"SoftBreak\"\n         + V\"Escaped\"\n         + V\"Placeholder\"\n         + V\"Code\"\n         + V\"Special\" ;\n  Str = wordchar^1\n      / pandoc.Str;\n  Escaped = P\"~\"\n          * C(P(1))\n          / pandoc.Str ;\n  Special = specialchar\n          / pandoc.Str;\n  Space = spacechar^1\n        / pandoc.Space ;\n  SoftBreak = endline\n            * # -(V\"HorizontalRule\" + V\"CodeBlock\")\n            / pandoc.SoftBreak ;\n  LineBreak = P\"\\\\\\\\\"\n            / pandoc.LineBreak ;\n  Code = P\"{{{\"\n       * C((1 - P\"}}}\")^0)\n       * P\"}}}\"\n       / trim / pandoc.Code ;\n  Link = P\"[[\"\n       * C((1 - (P\"]]\" + P\"|\"))^0)\n       * (P\"|\" * Ct((V\"Inline\" - P\"]]\")^1))^-1 * P\"]]\"\n       / function(url, desc)\n           local txt = desc or {pandoc.Str(url)}\n           return pandoc.Link(txt, url)\n         end ;\n  Image = P\"{{\"\n        * #-P\"{\"\n        * C((1 - (S\"}\"))^0)\n        * (P\"|\" * Ct((V\"Inline\" - P\"}}\")^1))^-1\n        * P\"}}\"\n        / function(url, desc)\n            local txt = desc or \"\"\n            return pandoc.Image(txt, url)\n          end ;\n  URL = P\"http\"\n      * P\"s\"^-1\n      * P\":\"\n      * (1 - (whitespacechar + (S\",.?!:;\\\"'\" * #whitespacechar)))^1\n      / function(url)\n          return pandoc.Link(pandoc.Str(url), url)\n        end ;\n  Emph = P\"//\"\n       * Ct((V\"Inline\" - P\"//\")^1)\n       * P\"//\"\n       / pandoc.Emph ;\n  Strong = P\"**\"\n         * Ct((V\"Inline\" -P\"**\")^1)\n         * P\"**\"\n         / pandoc.Strong ;\n}\n\nfunction Reader(input, reader_options)\n  return lpeg.match(G, tostring(input))\nend\n```\n\nExample of use:\n\n```\n% pandoc -f creole.lua -t markdown\n== Wiki Creole\n\nYou can make things **bold** or //italic// or **//both//** or //**both**//.\n\nCharacter formatting extends across line breaks: **bold,\nthis is still bold. This line deliberately does not end in star-star.\n\nNot bold. Character formatting does not cross paragraph boundaries.\n\nYou can use [[internal links]] or [[http://www.wikicreole.org|external links]],\ngive the link a [[internal links|different]] name.\n^D\n## Wiki Creole\n\nYou can make things **bold** or *italic* or ***both*** or ***both***.\n\nCharacter formatting extends across line breaks: \\*\\*bold, this is still\nbold. This line deliberately does not end in star-star.\n\nNot bold. Character formatting does not cross paragraph boundaries.\n\nYou can use [internal links](internal links) or [external\nlinks](http://www.wikicreole.org), give the link a\n[different](internal links) name.\n```\n\n# Example: parsing JSON from an API\n\nThis custom reader consumes the JSON output of\n<https://www.reddit.com/r/haskell.json> and produces\na document containing the current top articles on the\nHaskell subreddit.\n\nIt assumes that the `pandoc.json` library is available, which\nships with pandoc versions after (not including) 3.1. It's still\npossible to use this with older pandoc version by using a\ndifferent JSON library. E.g., `luajson` can be installed using\n`luarocks install luajson`---but be sure you are installing it for\nLua 5.4, which is the version packaged with pandoc.\n\n\n```lua\n-- consumes the output of https://www.reddit.com/r/haskell.json\n\nlocal json = require 'pandoc.json'\n\nlocal function read_inlines(raw)\n  local doc = pandoc.read(raw, \"commonmark\")\n  return pandoc.utils.blocks_to_inlines(doc.blocks)\nend\n\nlocal function read_blocks(raw)\n  local doc = pandoc.read(raw, \"commonmark\")\n  return doc.blocks\nend\n\nfunction Reader(input)\n\n  local parsed = json.decode(tostring(input))\n  local blocks = {}\n\n  for _,entry in ipairs(parsed.data.children) do\n    local d = entry.data\n    table.insert(blocks, pandoc.Header(2,\n                  pandoc.Link(read_inlines(d.title), d.url)))\n    for _,block in ipairs(read_blocks(d.selftext)) do\n      table.insert(blocks, block)\n    end\n  end\n\n  return pandoc.Pandoc(blocks)\n\nend\n```\n\nSimilar code can be used to consume JSON output from other APIs.\n\nNote that the content of the text fields is markdown, so we\nconvert it using `pandoc.read()`.\n\n\n# Example: syntax-highlighted code files\n\nThis is a reader that puts the content of each input file into a\ncode block, sets the file's extension as the block's class to\nenable code highlighting, and places the filename as a header\nabove each code block.\n\n``` lua\nfunction to_code_block (source)\n  local _, lang = pandoc.path.split_extension(source.name)\n  return pandoc.Div{\n    pandoc.Header(1, source.name == '' and '<stdin>' or source.name),\n    pandoc.CodeBlock(source.text, {class=lang}),\n  }\nend\n\nfunction Reader (input, opts)\n  return pandoc.Pandoc(input:map(to_code_block))\nend\n```\n\n# Example: extracting the content from web pages\n\nThis reader uses the command-line program `readable`\n(install via `npm install -g readability-cli`)\nto clean out parts of HTML input that have to do with\nnavigation, leaving only the content.\n\n``` lua\n-- Custom reader that extracts the content from HTML documents,\n-- ignoring navigation and layout elements. This preprocesses input\n-- through the 'readable' program (which can be installed using\n-- 'npm install -g readability-cli') and then calls the HTML reader.\n-- In addition, Divs that seem to have only a layout function are removed\n-- to avoid clutter.\n\nfunction make_readable(source)\n  local result\n  if not pcall(function ()\n      local name = source.name\n      if not name:match(\"http\") then\n        name = \"file:///\" .. name\n      end\n      result = pandoc.pipe(\"readable\",\n                 {\"--keep-classes\",\"--base\",name},\n                 source.text)\n    end) then\n      io.stderr:write(\"Error running 'readable': do you have it installed?\\n\")\n      io.stderr:write(\"npm install -g readability-cli\\n\")\n      os.exit(1)\n  end\n  return result\nend\n\nlocal boring_classes =\n        { row = true,\n          page = true,\n          container = true\n        }\n\nlocal boring_attributes = { \"role\" }\n\nlocal function is_boring_class(cl)\n  return boring_classes[cl] or cl:match(\"col%-\") or cl:match(\"pull%-\")\nend\n\nlocal function handle_div(el)\n  for i,class in ipairs(el.classes) do\n    if is_boring_class(class) then\n      el.classes[i] = nil\n    end\n  end\n  for i,k in ipairs(boring_attributes) do\n    el.attributes[k] = nil\n  end\n  if el.identifier:match(\"readability%-\") then\n    el.identifier = \"\"\n  end\n  if #el.classes == 0 and #el.attributes == 0 and #el.identifier == 0 then\n    return el.content\n  else\n    return el\n  end\nend\n\nfunction Reader(sources)\n  local readable = ''\n  for _,source in ipairs(sources) do\n    readable = readable .. make_readable(source)\n  end\n  local doc = pandoc.read(readable, \"html\", PANDOC_READER_OPTIONS)\n  -- Now remove Divs used only for layout\n  return doc:walk{ Div = handle_div }\nend\n```\n\nExample of use:\n\n```\npandoc -f readable.lua -t markdown https://pandoc.org\n```\nand compare the output to\n```\npandoc -f html -t markdown https://pandoc.org\n```\n\n"
  },
  {
    "path": "doc/custom-writers.md",
    "content": "---\nauthor:\n- John MacFarlane\ndate: 'November 21, 2021'\ntitle: Creating Custom Pandoc Writers in Lua\n---\n\n# Introduction\n\nIf you need to render a format not already handled by pandoc,\nor you want to change how pandoc renders a format,\nyou can create a custom writer using the [Lua] language.\nPandoc has a built-in Lua interpreter, so you needn't\ninstall any additional software to do this.\n\n[Lua]: https://www.lua.org\n\nA custom writer is a Lua file that defines how to render the\ndocument. Writers must define just a single function, named either\n`Writer` or `ByteStringWriter`, which gets passed the document and\nwriter options, and then handles the conversion of the document,\nrendering it into a string. This interface was introduced in\npandoc 2.17.2, with ByteString writers becoming available in\npandoc 3.0.\n\nPandoc also supports \"classic\" custom writers, where a Lua\nfunction must be defined for each AST element type. Classic style\nwriters are *deprecated* and should be replaced with new-style\nwriters if possible.\n\n# Writers\n\nCustom writers using the new style must contain a global function\nnamed `Writer` or `ByteStringWriter`. Pandoc calls this function\nwith the document and writer options as arguments, and expects the\nfunction to return a UTF-8 encoded string.\n\n``` lua\nfunction Writer (doc, opts)\n  -- ...\nend\n```\n\nWriters that do not return text but binary data should define a\nfunction with name `ByteStringWriter` instead. The function must\nstill return a string, but it does not have to be UTF-8 encoded\nand can contain arbitrary binary data.\n\nIf both `Writer` and `ByteStringWriter` functions are defined,\nthen only the `Writer` function will be used.\n\n## Format extensions\n\nWriters can be customized through format extensions, such as\n`smart`, `citations`, or `hard_line_breaks`. The global\n`Extensions` table indicates supported extensions with a\nkey. Extensions enabled by default are assigned a true value,\nwhile those that are supported but disabled are assigned a false\nvalue.\n\nExample: A writer with the following global table supports the\nextensions `smart`, `citations`, and `foobar`, with `smart` enabled and\nthe others disabled by default:\n\n``` lua\nExtensions = {\n  smart = true,\n  citations = false,\n  foobar = false\n}\n```\n\nThe users control extensions as usual, e.g., `pandoc -t\nmy-writer.lua+citations`. The extensions are accessible through\nthe writer options' `extensions` field, e.g.:\n\n``` lua\nfunction Writer (doc, opts)\n  print(\n    'The citations extension is',\n    opts.extensions:includes 'citations' and 'enabled' or 'disabled'\n  )\n  -- ...\nend\n```\n\n## Default template\n\nThe default template of a custom writer is defined by the return\nvalue of the global function `Template`. Pandoc uses the default\ntemplate for rendering when the user has not specified a template,\nbut invoked with the `-s`/`--standalone` flag.\n\nThe `Template` global can be left undefined, in which case pandoc\nwill throw an error when it would otherwise use the default\ntemplate.\n\n## Example: modified Markdown writer\n\nWriters have access to all modules described in the [Lua filters\ndocumentation][]. This includes `pandoc.write`, which can be used\nto render a document in a format already supported by pandoc. The\ndocument can be modified before this conversion, as demonstrated\nin the following short example. It renders a document as GitHub\nFlavored Markdown, but always uses fenced code blocks, never\nindented code.\n\n``` lua\nfunction Writer (doc, opts)\n  local filter = {\n    CodeBlock = function (cb)\n      -- only modify if code block has no attributes\n      if cb.attr == pandoc.Attr() then\n        local delimited = '```\\n' .. cb.text .. '\\n```'\n        return pandoc.RawBlock('markdown', delimited)\n      end\n    end\n  }\n  return pandoc.write(doc:walk(filter), 'gfm', opts)\nend\n\nTemplate = pandoc.template.default 'gfm'\n```\n\n[Lua filters documentation]: https://pandoc.org/lua-filters.html\n\n## Reducing boilerplate with `pandoc.scaffolding.Writer`\n\nThe `pandoc.scaffolding.Writer` structure is a custom writer scaffold\nthat serves to avoid common boilerplate code when defining a custom\nwriter. The object can be used as a function and allows to skip details\nlike metadata and template handling, requiring only the render functions\nfor each AST element type.\n\nThe value of `pandoc.scaffolding.Writer` is a function that should\nusually be assigned to the global `Writer`:\n\n``` lua\nWriter = pandoc.scaffolding.Writer\n```\n\nThe render functions for Block and Inline values can then be added\nto `Writer.Block` and `Writer.Inline`, respectively. The functions\nare passed the element and the WriterOptions.\n\n``` lua\nWriter.Inline.Str = function (str)\n  return str.text\nend\nWriter.Inline.SoftBreak = function (_, opts)\n  return opts.wrap_text == \"wrap-preserve\"\n    and cr\n    or space\nend\nWriter.Inline.LineBreak = cr\n\nWriter.Block.Para = function (para)\n  return {Writer.Inlines(para.content), pandoc.layout.blankline}\nend\n```\n\nThe render functions must return a string, a pandoc.layout *Doc*\nelement, or a list of such elements. In the latter case, the\nvalues are concatenated as if they were passed to\n`pandoc.layout.concat`. If the value does not depend on the input,\na constant can be used as well.\n\nThe tables `Writer.Block` and `Writer.Inline` can be used as\nfunctions; they apply the right render function for an element of\nthe respective type. E.g., `Writer.Block(pandoc.Para 'x')` will\ndelegate to the `Writer.Para` render function and will return the\nresult of that call.\n\nSimilarly, the functions `Writer.Blocks` and `Writer.Inlines` can\nbe used to render lists of elements, and `Writer.Pandoc` renders\nthe document's blocks. The function `Writer.Blocks` can take a\nseparator as an optional second argument, e.g.,\n`Writer.Blocks(blks, pandoc.layout.cr)`; the default block\nseparator is `pandoc.layout.blankline`.\n\nAll predefined functions can be overwritten when needed.\n\nThe resulting Writer uses the render functions to handle metadata\nvalues and converts them to template variables. The template is\napplied automatically if one is given.\n\n# Classic style\n\nA writer using the classic style defines rendering functions for\neach element of the pandoc AST. Note that this style is\n*deprecated* and may be removed in later versions.\n\nFor example,\n\n``` lua\nfunction Para(s)\n  return \"<paragraph>\" .. s .. \"</paragraph>\"\nend\n```\n\n## Template variables\n\nNew template variables can be added, or existing ones\nmodified, by returning a second value from function `Doc`.\n\nFor example, the following will add the current date in\nvariable `date`, unless `date` is already defined as either a\nmetadata value or a variable:\n\n``` lua\nfunction Doc (body, meta, vars)\n  vars.date = vars.date or meta.date or os.date '%B %e, %Y'\n  return body, vars\nend\n```\n\n## Changes in pandoc 3.0\n\nCustom writers were reworked in pandoc 3.0. For technical reasons,\nthe global variables `PANDOC_DOCUMENT` and `PANDOC_WRITER_OPTIONS`\nare set to the empty document and default values, respectively.\nThe old behavior can be restored by adding the following snippet,\nwhich turns a classic into a new style writer.\n\n``` lua\nfunction Writer (doc, opts)\n  PANDOC_DOCUMENT = doc\n  PANDOC_WRITER_OPTIONS = opts\n  loadfile(PANDOC_SCRIPT_FILE)()\n  return pandoc.write_classic(doc, opts)\nend\n```\n"
  },
  {
    "path": "doc/customizing-pandoc.md",
    "content": "---\nauthor:\n- Mauro Bieg\n- John MacFarlane\ntitle: Customizing Pandoc\n---\n\nThis document provides a quick overview over the various ways to\ncustomize pandoc's output, with links to fuller documentation\nand some examples.\n\n## Templates\n\nWhen the `-s`/`--standalone` option is used, pandoc will\ngenerate a standalone document rather than a fragment.\nFor example, in HTML output this will include the\n`<head>` element; in LaTeX output, it will include the\npreamble.\n\nPandoc comes with a default template for (almost) every output\nformat. A template is a plain text file containing variables\nthat are replaced by text generated by pandoc.  For example,\nthe variable `$body$` will be replaced by the document body,\nand `$title$` by the title from metadata.\n\nTo look at the default template for an output format, you can do\n`pandoc -D FORMAT`, where `FORMAT` is replaced by the name of\nthe format. For example `pandoc -D latex`. You can also use your\nown template instead, either by using the `--template` option\nor by putting the custom template in your user data directory\n(on Linux and macOS, `~/.pandoc/templates/`).\n\nNote that in many cases you can avoid the need for a custom\ntemplate by including a file with the `--include-in-header`,\n`--include-before-body`, or `--include-after-body` option.\nOr you can set the corresponding template variable directly.\n\n### Template variables\n\nThere are several ways to set template variables:\n\n|      | [`--variable`]   | [`--metadata`]   | [YAML metadata] and [`--metadata-file`] |\n|:---------------|:------------------|:------------------|:----------------------------|\n| values can be… | strings and bools | strings and bools | also YAML objects and lists |\n| strings are…   | inserted verbatim | escaped           | interpreted as markdown     |\n| accessible by filters: | no        | yes               | yes                         |\n\n\n[`--variable`]:      https://pandoc.org/MANUAL.html#option--variable\n[`--metadata`]:      https://pandoc.org/MANUAL.html#option--metadata\n[YAML metadata]:     https://pandoc.org/MANUAL.html#extension-yaml_metadata_block\n[`--metadata-file`]: https://pandoc.org/MANUAL.html#option--metadata-file\n\n\n\nFor more information, see [Templates](https://pandoc.org/MANUAL.html#templates) in\nthe pandoc manual.\n\n### Example: adding structured author data to HTML\n\nTODO\n\n### Example: generating documents from YAML metadata\n\nTODO <!-- Example of generating a structured document,\nsay, a table, from structured YAML metadata using\njust the control structures in pandoc's template\nlanguage. -->\n\n## Reference docx/pptx/odt\n\nFor `docx`, `pptx` or `odt` documents, things are a bit more\ncomplicated. Instead of a single template file, you need to\nprovide a customized `reference.docx/pptx/odt`.\nSee the manual for the\n[`--reference-doc`](https://pandoc.org/MANUAL.html#option--reference-doc) option.\n\n### Example: changing the font and line spacing in a Word docx\n\nTODO\n\n## Filters\n\nTemplates are very powerful, but they are only a sort of scaffold to\nplace your document's body text in. You cannot directly change the\nbody text using the template.\n\nIf you need to affect the output of the actual body text, you\ncan use a pandoc filter. A filter is a small program that\ntransforms the document, between the parsing and the writing phase,\nwhile it is still in pandoc's native format. For example,\na filter might find all the Header elements of a document\nand capitalize their text.\n\nPandoc's native representation of a document is an\nabstract syntax tree (AST), not unlike the HTML DOM. It is\ndocumented\n[here](https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Definition.html). A `Pandoc` document is a chunk of\nmetadata (`Meta`) and a list of `Block`s. The `Block`s, in\nturn, are composed of other `Block`s and `Inline` elements.\n(`Block` elements are things like paragraphs, lists, headers,\nand code blocks. `Inline` elements are individual words,\nlinks, emphasis, and so on.) Filters operate on these\nelements.  You can use `pandoc -t native` to learn about the\nAST's structure.\n\nThere are two kinds of filters: JSON filters (which transform a\nJSON serialization of the pandoc AST, and may be written in any\nlanguage that can parse and emit JSON), and Lua filters (which\nuse an interface built directly into pandoc, and must be written\nin the Lua language).  If you are writing your own filters, it\nis best to use Lua filters, which are more portable (they\nrequire only pandoc itself) and more efficient.  See [Lua\nfilters](https://pandoc.org/lua-filters.html) for documentation and examples.  If\nyou would prefer to write your filter in another language, see\n[Filters](https://pandoc.org/filters.html) for a gentle introduction to JSON\nfilters.\n\nThere's a repository of lua filters at\n[pandoc/lua-filters](https://github.com/pandoc/lua-filters)\non GitHub.  A number of pandoc filters, written in\nHaskell, are available on\n[Hackage](https://hackage.haskell.org/packages/search?terms=pandoc+filter)\nand can be installed using the `stack` or `cabal` tools.\nThe wiki also lists [third party\nfilters](https://github.com/jgm/pandoc/wiki/Pandoc-Filters).\n\n### Example: capitalizing headers\n\nTODO\n\n### Example: code extractor\n\nTODO\n\n## Generic Divs and Spans\n\nTODO\n[Divs and Spans](https://pandoc.org/MANUAL.html#divs-and-spans): generic blocks\nthat can be transformed with filters\n\n### Example: colored text\n\n\n### Example: custom styles in docx\n\n[Custom Styles in Docx](https://pandoc.org/MANUAL.html#custom-styles-in-docx)\n\n## Raw attributes\n\nTODO\n[Generic raw attributes](https://pandoc.org/MANUAL.html#generic-raw-attribute):\nto include raw snippets\n\n## Custom writers\n\nTODO\n[Custom writers](https://pandoc.org/MANUAL.html#custom-writers)\n\n## Custom syntax highlighting\n\nTODO\n[Custom syntax highlighting](https://pandoc.org/MANUAL.html#syntax-highlighting),\nprovided by the [skylighting\nlibrary](https://github.com/jgm/skylighting)\n\nincluding highlighting styles\n\n"
  },
  {
    "path": "doc/epub.md",
    "content": "---\ntitle: Creating an ebook with pandoc\nauthor: John MacFarlane\n---\n\nStarting with version 1.6, pandoc can produce output in the [EPUB]\nelectronic book format. EPUB books can be viewed on iPads, Nooks, and\nother electronic book readers, including many smart phones. (They can\nalso be converted to Kindle books using the GUI only [KindlePreviewer] \non Windows and Mac OSX. [KindleGen] – which offers a command line\ninterface and supports [Linux][KindleGenLinux], [Mac OSX][KindleGenMacOSX]\nand [Windows][KindleGenWindows] – has been deprecated, but binaries can still\nbe found on the internet.)\n\nThis means that it's now very easy to produce an electronic book!\nLet's try it.\n\n# A toy example\n\nUse your text editor to create a file `mybook.txt`, with the following\ncontents:\n\n    % My Book\n    % Sam Smith\n\n    This is my book!\n\n    # Chapter One\n\n    Chapter one is over.\n\n    # Chapter Two\n\n    Chapter two has just begun.\n\nTo make this into an ebook takes only one command:\n\n    pandoc mybook.txt -o mybook.epub\n\nYou can upload `mybook.epub` to your ebook reader and try it out.\n\nNote that if your markdown file contains links to local images, for\nexample\n\n    ![Juliet](images/sun.jpg)\n\npandoc will automatically include the images in the generated\nepub.\n\n# A real book\n\nTo see what this would look like for a real book, let's convert Scott\nChacon's book [Pro Git], which he wrote using pandoc's markdown variant\nand released under a [Creative Commons] license. (If you use the book,\nplease consider [buying a copy] to help support his excellent work.)\n\nYou can find the markdown source for the book on its\n[github site].  Let's get a copy of the whole repository:[^1]\n\n    git clone https://github.com/progit/progit.git\n\n[^1]: If you don't have [git], you can browse to the [github site] and\nclick \"Download Source\" to get the same files in a zip or tar archive.\n\nThis command will create a working directory called `progit` on\nyour machine.  The actual markdown sources for the English version\nof the book are in the `en` subdirectory, so start by changing\nto that directory:\n\n    cd progit/en\n\nAs you can see, each chapter is a single text file in its own directory.\nChacon does some postprocessing on these files, for example, to insert images.\nThis is a placeholder for Figure 1-1, for example:\n\n    Insert 18333fig0101.png\n    Figure 1-1. Local version control diagram.\n\nThe actual image file is called `18333fig0101-tn.png` and lives in\nthe `figures` subdirectory of the repository, as you can verify.\n\nFor demonstration purposes, we want pure markdown files, so let's\nchange this placeholder into a markdown image link.  Pandoc will\ntreat a paragraph containing a single image as a figure with\na caption, which is what we want:\n\n    ![Figure 1-1. Local version control diagram.](../figures/18333fig0101-tn.png)\n\nWe can make this change in all the files with a perl one-liner:\n\n    perl -i -0pe \\\n    's/^Insert\\s*(.*)\\.png\\s*\\n([^\\n]*)$/!\\[\\2](..\\/figures\\/\\1-tn.png)/mg' \\\n    */*.markdown\n\nThis will modify the files in place. (We won't worry about backing\nthem up; if we mess up, we can get the original files back with\n`git reset --hard`.)\n\nOK! Now we're almost ready to make an ebook.  We have the chapters,\neach in its own file, but we still need a title. Create a file,\n`title.txt`, with a pandoc YAML metadata block:\n\n```\n---\ntitle: Pro Git\nauthor: Scott Chacon\nrights:  Creative Commons Non-Commercial Share Alike 3.0\nlanguage: en-US\n...\n```\n\nSee the [User's Guide](https://pandoc.org/MANUAL.html#epub-metadata) for more information\nabout these fields.\n\nNow run pandoc to make the ebook, using our title page and modified\nchapter files as sources:\n\n    pandoc -o progit.epub title.txt \\\n      01-introduction/01-chapter1.markdown \\\n      02-git-basics/01-chapter2.markdown \\\n      03-git-branching/01-chapter3.markdown \\\n      04-git-server/01-chapter4.markdown \\\n      05-distributed-git/01-chapter5.markdown \\\n      06-git-tools/01-chapter6.markdown \\\n      07-customizing-git/01-chapter7.markdown \\\n      08-git-and-other-scms/01-chapter8.markdown \\\n      09-git-internals/01-chapter9.markdown\n\nThat's it!  The ebook, `progit.epub`, is ready to be uploaded to your reader.\n\n## Changing the format\n\nYou can use the `--css` option to specify a CSS file\nfor the book.  The default CSS is minimal and can be found\n[on GitHub](https://github.com/jgm/pandoc/blob/main/data/epub.css)\nor in the `epub.css` file in your data directory\n(see `--data-dir` in the [User's Guide]).\n\nYou can even embed fonts in the EPUB if you want; see the [User's Guide]\nunder `--epub-embed-font` for instructions.\n\n## Math\n\nPandoc has an EPUB3 writer.  It renders LaTeX math into MathML, which\nEPUB3 readers are supposed to support (but unfortunately few do).\n\nOf course, this isn't much help if you want EPUB2 output (`pandoc -t epub2`)\nor target readers that don't support MathML. Then you have two options:\n\n1.  Use the [`--webtex`](https://pandoc.org/MANUAL.html#option--webtex) option,\n    which will use a web service to convert the TeX to an image.\n2.  Use the [`--gladtex`](https://pandoc.org/MANUAL.html#option--gladtex) option\n    to convert maths into SVG images on your local machine.\n\nBoth GladTeX and WebTeX add the LaTeX source of the formula as alternative text\nof the image, increasing accessibility for blind users.\n\n[KindlePreviewer]: https://www.amazon.com/Kindle-Previewer/b?node=21381691011\n[KindleGen]: https://www.amazon.com/gp/feature.html?docId=1000765211\n[KindleGenLinux]: https://archive.org/details/kindlegen2.9\n[KindleGenMacOSX]: https://web.archive.org/web/20190905040839/https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211\n[KindleGenWindows]: https://archive.org/details/kindlegen_win32_v2_9\n[EPUB]:  https://en.wikipedia.org/wiki/EPUB\n[Pro Git]: https://git-scm.com/book/en/v2\n[Creative Commons]: https://creativecommons.org/\n[buying a copy]: https://git-scm.com/book/en/v2\n[github site]: https://github.com/progit/progit\n[git]: https://git-scm.com\n[Dublin Core metadata elements]: https://dublincore.org/documents/dces/\n[User's Guide]: https://pandoc.org/MANUAL.html\n\n"
  },
  {
    "path": "doc/extras.md",
    "content": "---\ntitle: Pandoc Extras\nauthor: John MacFarlane\n---\n\nThis is a curated list of some of the most useful third-party\nsoftware that extends pandoc's capabilities.  For a more\ncomplete list, see the [Pandoc Extras wiki page](https://github.com/jgm/pandoc/wiki/Pandoc-Extras).\n\n\n### GUI\n\n  - [PanWriter](https://github.com/mb21/panwriter/#panwriter) is\n    a Markdown editor with live preview that can import and export\n    using pandoc.\n  - [Pandoc Mac OS X\n    Services](https://github.com/mb21/Pandoc-Mac-OS-X-Services)\n    allows you to invoke pandoc from any text editor with the\n    opened file as input.\n\n### Editor support\n\n  - [pandoc-mode](http://joostkremers.github.io/pandoc-mode) for Emacs\n  - [vim-pandoc](https://github.com/vim-pandoc) for Vim\n\n### CLI wrappers\n\n  - [panzer](https://github.com/msprev/panzer) allows you to\n    specify command-line options and styles in the Markdown file's YAML\n    metadata.\n  - [pandocomatic](https://heerdebeer.org/Software/markdown/pandocomatic/)\n    is similar to panzer but also provides support for\n    converting directory trees.\n  - [panrun](https://github.com/mb21/panrun) is a more\n    minimalistic alternative to panzer and pandocomatic.\n\n### Editing/document changes\n\n  - [pandiff](https://github.com/davidar/pandiff) creates prose\n    diffs for any document format supported by pandoc.\n  - [pancritic](https://github.com/ickc/pancritic) allows using\n    [CriticMarkup](http://criticmarkup.com/spec.php#caveats) with pandoc.\n\n### Charts and data\n\n  - [R Markdown](https://rmarkdown.rstudio.com) allows you to\n    process Markdown documents with integrated data and charts\n    (integrates pandoc).\n  - [pandoc-plot](https://github.com/LaurentRDC/pandoc-plot)\n    allows you to integrate programmatically generated plots\n    generated by various tools.\n\n### Citations\n\n  - [zotxt](https://github.com/egh/zotxt) is Zotero extension\n    for working with pandoc\n\n### Numbering and cross-references\n\n  - [pandoc-crossref](https://github.com/lierdakil/pandoc-crossref)\n    is a filter that adds support for figure, table, and\n    equation numbers and cross-references.\n  - [pandoc-xnos](https://github.com/tomduck/pandoc-xnos) is\n    a suite of filters supporting numbering and\n    cross-referencing figures, equations, tables, and sections.\n\n### Academic publishing workflows\n\n  - [Quarto](https://quarto.org/) is an open-source scientific and technical publishing system\n    to make reproducible, production quality \n    articles, presentations, websites, blogs, and books.\n    It supports equations, citations, crossrefs, figure panels, callouts, advanced layout, etc.\n  - [Manubot](https://manubot.org) is a workflow and set of tools for the next\n    generation of scholarly publishing, including citation support and\n    support for multiple output formats.\n    It's especially suited for papers with a very large set of authors.\n  - [pandoc-ext](https://github.com/pandoc-ext) includes goodies such as\n    putting the Abstract into a section,\n    multiple bibliographies,\n    support the Citation Typing Ontology (CiTO), etc.\n  - [Baseprinter](https://try.perm.pub/baseprinter/) is an open-source pandoc wrapper to\n    generate Baseprint document snapshots and HTML/PDF previews.\n    These snapshots can be self-published/archived as editions of a\n    [Baseprint document succession](https://try.perm.pub/document_succession/).\n  - [Pandoc Scholar](https://github.com/pandoc-scholar/pandoc-scholar) is a\n    set of utilities to make publishing of scientific articles as simple and\n    pleasant as possible. It simplifies setting authors' metadata in\n    YAML blocks, allows to add semantic annotation to citations, and\n    only requires the programs `pandoc` and `make`.\n    Please note that it is no longer maintained and refers to `Quarto` and `pandoc-ext`\n\n### Containers\n\n  - [pandoc docker images](https://github.com/pandoc/dockerfiles)\n\n### Lua filters\n\n(For a fuller list, see [the lua-filters\nrepository](https://github.com/pandoc/lua-filters).)\n\n  - [Spell\n    checking](https://github.com/pandoc/lua-filters/tree/master/spellcheck).\n  - [Word count](https://github.com/pandoc/lua-filters/tree/master/wordcount).\n  - [Embed textually-specified\n    diagrams](https://github.com/pandoc-ext/diagram) in Mermaid, Dot/GraphViz,\n    PlantUML, Asymptote, CeTZ, and TikZ.\n  - [Create subfigures in pandoc's Markdown](https://github.com/rnwst/pandoc-subfigs).\n  - [Handle scholarly\n    metadata](https://github.com/pandoc/lua-filters/tree/master/scholarly-metadata).\n  - [Panda](http://christophe.delord.free.fr/panda/) provides\n    conditionals, code file inclusion, string expansion,\n    and diagrams from code blocks.\n\n"
  },
  {
    "path": "doc/faqs.md",
    "content": "% FAQs\n\n::: faqs\n\n## How can I convert a whole directory of files from Markdown to RTF?\n\nOn linux or OSX:\n\n    for f in *.txt; do pandoc \"$f\" -s -o \"${f%.txt}.rtf\"; done\n\n\nIn Windows Powershell:\n\n    gci -r -i *.txt\n    |foreach{$rtf=$_.directoryname+\"\\\"+$_.basename+\".rtf\";pandoc -f markdown -s $_.fullname -o $rtf}\n\n## I used pandoc to convert a document to ICML (or OPML or RTF), and when I try to open it I'm told it's invalid.  What have I done wrong?\n\nBe sure to use the `-s` or `--standalone` flag, or you just get a\nfragment, not a full document with the required header:\n\n    pandoc -s -f markdown -t icml -o my.icml my.md\n\n## I get a blank document when I try to convert a markdown document in Chinese to PDF.\n\nBy default, pandoc uses pdflatex to generate the PDF, and pdflatex\ndoesn't handle Chinese characters. But you can change the default to\nuse xelatex instead. You should also make sure you're using a font\nwith Chinese glyphs.  For example:\n\n    pandoc -o c.pdf --pdf-engine=xelatex -V mainfont='Adobe Ming Std'\n\n## The Windows installer does a single user install, rather than installing pandoc for all users. How can I install pandoc for all users?\n\nRun the following command as admin:\n\n    msiexec /i pandoc-VERSION.msi ALLUSERS=1\n\nThis will put pandoc in `C:\\Program Files\\Pandoc`.\nYou can install Pandoc to a different directory by setting APPLICATIONFOLDER parameter,\nfor example:\n\n    msiexec /i pandoc-1.11.1.msi ALLUSERS=1 APPLICATIONFOLDER=\"C:\\Pandoc\"\n\n## How do I change the margins in PDF output?\n\nThe option\n\n    -V geometry:margin=1in\n\nwill set the margins to one inch on each side.  If you don't want uniform\nmargins, you can do something like\n\n    -V geometry:\"top=2cm, bottom=1.5cm, left=1cm, right=1cm\"\n\nOr\n\n    -V geometry:\"left=3cm, width=10cm\"\n\nFor more options, see the documentation for the LaTeX [geometry\npackage](https://www.ctan.org/pkg/geometry).\n\n## How does pandoc compare to multimarkdown?\n\nHere is a [wiki\npage](https://github.com/jgm/pandoc/wiki/Pandoc-vs-Multimarkdown)\ncomparing the two.\n\n## When I specify an image width of 50% and convert to LaTeX, pandoc sets the height to textheight and the aspect ratio isn't preserved. How can I prevent this?\n\nFor example, if you convert an image with `{width=\"50%\"}`, the LaTeX produced\nwill be `\\includegraphics[width=0.5\\textwidth,height=\\textheight]`.\n\nThis output presupposes the following code in pandoc's default latex\ntemplate:\n\n```\n% Scale images if necessary, so that they will not overflow the page\n% margins by default, and it is still possible to overwrite the defaults\n% using explicit options in \\includegraphics[width, height, ...]{}\n\\setkeys{Gin}{width=\\maxwidth,height=\\maxheight,keepaspectratio}\n```\n\nIf you don't have this in your custom template, you should\nadd it.  If we didn't set the `height` explicitly in this way,\nthe image would not be resized correctly unless it was\nbeing resized to smaller than its original size.\n\n## Pandoc sometimes uses too much memory. How can I limit the memory used by pandoc?\n\n`pandoc +RTS -M30m -RTS` will limit heap memory to 30MB.\nWhen converting a document requires more than this, an out of\nmemory error will be issued.\n\n## When using `--include-in-header` with PDF or LaTeX output, how do I reference tex declarations coming after `$header-includes$` in the default template?\n\nFor various reasons, the `$header-includes$` are not at the very\nend of the LaTeX preamble.  This poses a problem when the code\nyou are inserting depends on declarations in the preamble coming\nafter the `$header-includes$` location. For example, you might\nwant to reference the `\\author` and `\\title` metadata values\n(set at the very bottom of the preamble) and present them in\nmargins. In that case you can wrap your code in `etoolbox`'s\n`\\AtEndPreamble`.  The technique is demonstrated in [this\ngist](https://gist.github.com/JohnLukeBentley/9dda6166b9ee5c4127afd2b8cd16b70a).\nWhen using `\\AtEndPreamble`, keep any `makeatletter` or\n`makeatother` outside of the `\\AtEndPreamble`, as shown in the\nexample.\n\n## How can I convert PDFs to other formats using pandoc?\n\nYou can't. You can try opening the PDF in Word or Google Docs\nand saving in a format from which pandoc can convert directly.\n\n## Do I really need to install a 1 GB TeX installation to produce a PDF using pandoc?\n\nNo.  You can get by with a relatively small TeX installation,\nfor example, by starting with MacTeX's Basic TeX distribution\nand using the `tlmgr` tool to install a few packages required by pandoc\n(see [the manual](https://pandoc.org/MANUAL.html#creating-a-pdf)).\n\nOr, you can produce PDFs via HTML and `wkhtmltopdf`,\nor via groff ms and `pdfroff`.  (These don't produce as nice\ntypography as TeX, particularly when it comes to math, but they\nmay be fine for many purposes.)\n\n\n## Converting to PDF on an M1 Mac, I get a \"Cannot allocate memory\" error.\n\nWe are not sure why this happens, but we have found that\nfully specifying the `pdflatex` path avoids the error. For\nexample,\n\n    pandoc -o my.pdf --pdf-engine=/Library/TeX/texbin/pdflatex\n\n## When I convert from ipynb, some visualizations aren't showing up.\n\nFirst, unless your target is a binary format (docx, odt, epub),\nyou must use either `--extract-media` or (for HTML only)\n`--embed-resources` to make the images in the ipynb container\navailable to your output file.\n\nSecond, some Jupyter extensions, especially those that use JavaScript\nfor visualizations, assume the presence of\n[`require.js`](https://github.com/requirejs/requirejs).\nTo ensure that this script is available in your HTML output, you\ncan use:\n\n```\npandoc -s -o output.html input.ipynb \\\n-V header-includes='<script src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\"></script>'\n```\n\n## How can I get BibTeX references to work when converting from LaTeX?\n\nUse the `--citeproc` option.\nIf it still doesn't work, you may need to tell pandoc where\nyour bibliography file is using `--bibliography`.\nYour references may not be formatted the same as they are\nwhen you use `latex` and `bibtex`; you can change the format\nof the citations by specifying an appropriate CSL bibliography\nstyle using `--csl`\n(see [the manual](https://pandoc.org/MANUAL.html#specifying-a-citation-style)).\n\n### How can I produce PDF/A with pandoc?\n\nThe simplest approach is via ConTeXt:\n\n```\npandoc --pdf-engine=context -V pdfa\n```\n\nAlternatively, `--pdf-engine=pdflatex` can be used with\nthe following in `header-includes` in metadata (or included from\na file using `--include-in-header`):\n\n```\n\\usepackage[a-2u,mathxmp]{pdfx}\n\\usepackage[pdfa]{hyperref}\n```\n\nOr `--pdf-engine=lualatex` can be used with the following:\n\n```\n\\usepackage{hyperxmp}\n\\hypersetup{pdfapart=3,pdfaconformance=B}\n\\immediate\\pdfobj stream attr{/N 3} file{sRGB.icc}\n\\pdfcatalog{/OutputIntents [<<\n/Type /OutputIntent /S /GTS_PDFA1\n/DestOutputProfile \\the\\pdflastobj\\space 0 R\n/OutputConditionIdentifier (sRGB) /Info (sRGB)\n>>]}\n```\n\n\n### Pandoc adds column widths to pipe tables when any line is wider than the setting for `--columns`. How can I prevent this?\n\nSave this filter as `nowidths.lua` and then pass `--lua-filter\nnowidths.lua` as an additional option to pandoc.\n(See [issue 8139](https://github.com/jgm/pandoc/issues/8139).)\n\n``` lua\n-- Unset the width attribute of HTML colspecs in tables\n-- See https://github.com/jgm/pandoc/issues/8139\nfunction Table (tbl)\n  if PANDOC_VERSION[1] >= 2 and PANDOC_VERSION[2] >= 10 then\n    tbl.colspecs = tbl.colspecs:map(function (colspec)\n        local align = colspec[1]\n        local width = nil  -- default width\n        return {align, width}\n    end)\n  else\n    for i, w in ipairs(tbl.widths) do\n      tbl.widths[i] = 0\n    end\n  end\n  return tbl\nend\n```\n\n### How can I use pandoc to read Word files in the old .DOC format?\n\nInstall `antiword` and use it to convert the doc to DocBook,\nwhich can be read by pandoc.\n\n```\nantiword -x db input.doc | pandoc -f docbook\n```\n\n:::\n"
  },
  {
    "path": "doc/filters.md",
    "content": "% Pandoc filters\n% John MacFarlane\n\n# Summary\n\nPandoc provides an interface for users to write programs (known\nas filters) which act on pandoc’s AST.\n\nPandoc consists of a set of readers and writers. When converting\na document from one format to another, text is parsed by a\nreader into pandoc’s intermediate representation of the\ndocument---an \"abstract syntax tree\" or AST---which is then\nconverted by the writer into the target format.\nThe pandoc AST format is defined in the module\n[`Text.Pandoc.Definition` in the `pandoc-types` package\n](https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Definition.html).\n\nA \"filter\" is a program that modifies the AST, between the\nreader and the writer.\n\n    INPUT --reader--> AST --filter--> AST --writer--> OUTPUT\n\nPandoc supports two kinds of filters:\n\n- **Lua filters** use the Lua language to\n  define transformations on the pandoc AST.  They are\n  described in a [separate document](lua-filters.html).\n\n- **JSON filters**, described here, are pipes that read from\n  standard input and write to standard output, consuming and\n  producing a JSON representation of the pandoc AST:\n\n                             source format\n                                  ↓\n                               (pandoc)\n                                  ↓\n                          JSON-formatted AST\n                                  ↓\n                            (JSON filter)\n                                  ↓\n                          JSON-formatted AST\n                                  ↓\n                               (pandoc)\n                                  ↓\n                            target format\n\nLua filters have a couple of advantages.  They use a Lua\ninterpreter that is embedded in pandoc, so you don't need\nto have any external software installed.  And they are\nusually faster than JSON filters.  But if you wish to\nwrite your filter in a language other than Lua, you may\nprefer to use a JSON filter. JSON filters may be written\nin any programming language.\n\nYou can use a JSON filter directly in a pipeline:\n\n    pandoc -s input.txt -t json | \\\n     pandoc-citeproc | \\\n     pandoc -s -f json -o output.html\n\nBut it is more convenient to use the `--filter` option,\nwhich handles the plumbing automatically:\n\n    pandoc -s input.txt --filter pandoc-citeproc -o output.html\n\nFor a gentle introduction into writing your own filters,\ncontinue this guide. There’s also a [list of third party filters\non the wiki](https://github.com/jgm/pandoc/wiki/Pandoc-Filters).\n\n\n# A simple example\n\nSuppose you wanted to replace all level 2+ headings in a markdown\ndocument with regular paragraphs, with text in italics. How would you go\nabout doing this?\n\nA first thought would be to use regular expressions. Something\nlike this:\n\n    perl -pe 's/^##+ (.*)$/\\*\\1\\*/' source.txt\n\nThis should work most of the time.  But don't forget\nthat ATX style headings can end with a sequence of `#`s\nthat is not part of the heading text:\n\n    ## My heading ##\n\nAnd what if your document contains a line starting with `##` in an HTML\ncomment or delimited code block?\n\n    <!--\n    ## This is just a comment\n    -->\n\n    ~~~~\n    ### A third level heading in standard markdown\n    ~~~~\n\nWe don't want to touch *these* lines.  Moreover, what about Setext\nstyle second-level heading?\n\n    A heading\n    ---------\n\nWe need to handle those too.  Finally, can we be sure that adding\nasterisks to each side of our string will put it in italics?\nWhat if the string already contains asterisks around it? Then we'll\nend up with bold text, which is not what we want. And what if it contains\na regular unescaped asterisk?\n\nHow would you modify your regular expression to handle these cases? It\nwould be hairy, to say the least.\n\nA better approach is to let pandoc handle the parsing, and\nthen modify the AST before the document is written. For this,\nwe can use a filter.\n\nTo see what sort of AST is produced when pandoc parses our text,\nwe can use pandoc's `native` output format:\n\n~~~~\n% cat test.txt\n## my heading\n\ntext with *italics*\n% pandoc -s -t native test.txt\nPandoc (Meta {unMeta = fromList []})\n[Header 2 (\"my-heading\",[],[]) [Str \"My\",Space,Str \"heading\"]\n, Para [Str \"text\",Space,Str \"with\",Space,Emph [Str \"italics\"]] ]\n~~~~\n\nA `Pandoc` document consists of a `Meta` block (containing\nmetadata like title, authors, and date) and a list of `Block`\n elements.  In this case, we have two `Block`s, a `Header` and a `Para`.\nEach has as its content a list of `Inline` elements.  For more details on\nthe pandoc AST, see the [haddock documentation for `Text.Pandoc.Definition`].\n\n[haddock documentation for `Text.Pandoc.Definition`]: https://hackage.haskell.org/package/pandoc-types\n\nWe can use Haskell to create a JSON filter that transforms this\nAST, replacing each `Header` block with level >= 2 with a `Para`\nwith its contents wrapped inside an `Emph` inline:\n\n~~~~                          {.haskell}\n#!/usr/bin/env runhaskell\n-- behead.hs\nimport Text.Pandoc.JSON\n\nmain :: IO ()\nmain = toJSONFilter behead\n\nbehead :: Block -> Block\nbehead (Header n _ xs) | n >= 2 = Para [Emph xs]\nbehead x = x\n~~~~\n\nThe `toJSONFilter` function does two things.  First, it lifts\nthe `behead` function (which maps `Block -> Block`) onto a\ntransformation of the entire `Pandoc` AST, walking the AST\nand transforming each block.  Second, it wraps this `Pandoc ->\nPandoc` transformation with the necessary JSON serialization\nand deserialization, producing an executable that consumes\nJSON from stdin and produces JSON to stdout.\n\nTo use the filter, make it executable:\n\n    chmod +x behead.hs\n\nand then\n\n    pandoc -f SOURCEFORMAT -t TARGETFORMAT --filter ./behead.hs\n\n(It is also necessary that `pandoc-types` be installed in the\nlocal package repository. To do this using cabal-install,\n`cabal v2-update && cabal v2-install --lib pandoc-types --package-env .`.)\n\nAlternatively, we could compile the filter:\n\n    ghc -package-env=default --make behead.hs\n    pandoc -f SOURCEFORMAT -t TARGETFORMAT --filter ./behead\n\nNote that if the filter is placed in the system PATH, then the initial\n`./` is not needed.  Note also that the command line can include\nmultiple instances of `--filter`:  the filters will be applied in\nsequence.\n\n\n# LaTeX for WordPress\n\nAnother easy example. WordPress blogs require a special format for\nLaTeX math.  Instead of `$e=mc^2$`, you need: `$LaTeX e=mc^2$`.\nHow can we convert a markdown document accordingly?\n\nAgain, it's difficult to do the job reliably with regexes.\nA `$` might be a regular currency indicator, or it might occur in\na comment or code block or inline code span.  We just want to find\nthe `$`s that begin LaTeX math. If only we had a parser...\n\nWe do.  Pandoc already extracts LaTeX math, so:\n\n~~~~                          {.haskell}\n#!/usr/bin/env runhaskell\n-- wordpressify.hs\nimport Text.Pandoc.JSON\n\nmain = toJSONFilter wordpressify\n  where wordpressify (Math x y) = Math x (\"LaTeX \" ++ y)\n        wordpressify x = x\n~~~~\n\nMission accomplished. (I've omitted type signatures here,\njust to show it can be done.)\n\n\n# But I don't want to learn Haskell!\n\nWhile it's easiest to write pandoc filters in Haskell, it is fairly\neasy to write them in python using the `pandocfilters` package.\nThe package is in PyPI and can be installed using `pip install\npandocfilters` or `easy_install pandocfilters`.\n\nHere's our \"beheading\" filter in python:\n\n~~~ {.python}\n#!/usr/bin/env python\n\n\"\"\"\nPandoc filter to convert all level 2+ headings to paragraphs with\nemphasized text.\n\"\"\"\n\nfrom pandocfilters import toJSONFilter, Emph, Para\n\ndef behead(key, value, format, meta):\n  if key == 'Header' and value[0] >= 2:\n    return Para([Emph(value[2])])\n\nif __name__ == \"__main__\":\n  toJSONFilter(behead)\n~~~\n\n`toJSONFilter(behead)` walks the AST and applies the `behead` action\nto each element.  If `behead` returns nothing, the node is unchanged;\nif it returns an object, the node is replaced; if it returns a list,\nthe new list is spliced in.\n\nNote that, although these parameters are not used in this example,\n`format` provides access to the target format, and `meta` provides access to\nthe document's metadata.\n\nThere are many examples of python filters in [the pandocfilters\nrepository](https://github.com/jgm/pandocfilters).\n\nFor a more Pythonic alternative to pandocfilters, see\nthe [panflute](https://pypi.org/project/panflute) library.\nDon't like Python? There are also ports of pandocfilters in\n\n- [PHP](https://github.com/vinai/pandocfilters-php),\n- [perl](https://metacpan.org/pod/Pandoc::Filter),\n- TypeScript/JavaScript via Node.js\n  - [pandoc-filter](https://github.com/mvhenderson/pandoc-filter-node),\n  - [node-pandoc-filter](https://github.com/mu-io/node-pandoc-filter),\n- [Groovy](https://github.com/dfrommi/groovy-pandoc), and\n- [Ruby](https://heerdebeer.org/Software/markdown/paru/).\n\nStarting with pandoc 2.0, pandoc includes built-in support for\nwriting filters in lua.  The lua interpreter is built in to\npandoc, so a lua filter does not require any additional software\nto run.  See the [documentation on lua\nfilters](https://pandoc.org/lua-filters.html).\n\n# Include files\n\nSo none of our transforms have involved IO. How about a script that\nreads a markdown document, finds all the inline code blocks with\nattribute `include`, and replaces their contents with the contents of\nthe file given?\n\n~~~~                          {.haskell}\n#!/usr/bin/env runhaskell\n-- includes.hs\nimport Text.Pandoc.JSON\nimport qualified Data.Text.IO as TIO\nimport qualified Data.Text as T\n\ndoInclude :: Block -> IO Block\ndoInclude cb@(CodeBlock (id, classes, namevals) contents) =\n  case lookup (T.pack \"include\") namevals of\n       Just f     -> CodeBlock (id, classes, namevals) <$>\n                      TIO.readFile (T.unpack f)\n       Nothing    -> return cb\ndoInclude x = return x\n\nmain :: IO ()\nmain = toJSONFilter doInclude\n~~~~\n\nTry this on the following:\n\n    Here's the pandoc README:\n\n    ~~~~ {include=\"README\"}\n    this will be replaced by contents of README\n    ~~~~\n\n# Removing links\n\nWhat if we want to remove every link from a document, retaining\nthe link's text?\n\n~~~~                          {.haskell}\n#!/usr/bin/env runhaskell\n-- delink.hs\nimport Text.Pandoc.JSON\n\nmain = toJSONFilter delink\n\ndelink :: Inline -> [Inline]\ndelink (Link _ txt _) = txt\ndelink x              = [x]\n~~~~\n\nNote that `delink` can't be a function of type `Inline -> Inline`,\nbecause the thing we want to replace the link with is not a single\n`Inline` element, but a list of them. So we make `delink` a function\nfrom an `Inline` element to a list of `Inline` elements.\n`toJSONFilter` can still lift this function to a transformation of type\n`Pandoc -> Pandoc`.\n\n# A filter for ruby text\n\nFinally, here's a nice real-world example, developed on the\n[pandoc-discuss](https://groups.google.com/group/pandoc-discuss/browse_thread/thread/7baea325565878c8) list.  Qubyte wrote:\n\n> I'm interested in using pandoc to turn my markdown notes on Japanese\n> into nicely set HTML and (Xe)LaTeX. With HTML5, ruby (typically used to\n> phonetically read chinese characters by placing text above or to the\n> side) is standard, and support from browsers is emerging (Webkit based\n> browsers appear to fully support it). For those browsers that don't\n> support it yet (notably Firefox) the feature falls back in a nice way\n> by placing the phonetic reading inside brackets to the side of each\n> Chinese character, which is suitable for other output formats too. As\n> for (Xe)LaTeX, ruby is not an issue.\n>\n> At the moment, I use inline HTML to achieve the result when the\n> conversion is to HTML, but it's ugly and uses a lot of keystrokes, for\n> example\n>\n> ~~~ {.xml}\n> <ruby>ご<rt></rt>飯<rp>（</rp><rt>はん</rt><rp>）</rp></ruby>\n> ~~~\n>\n> sets ご飯 \"gohan\" with \"han\" spelt phonetically above the second\n> character, or to the right of it in brackets if the browser does not\n> support ruby.  I'd like to have something more like\n>\n>     r[はん](飯)\n>\n> or any keystroke saving convention would be welcome.\n\nWe came up with the following script, which uses the convention that a\nmarkdown link with a URL beginning with a hyphen is interpreted as ruby:\n\n    [はん](-飯)\n\n~~~ {.haskell}\n{-# LANGUAGE OverloadedStrings #-}\n-- handleruby.hs\nimport Text.Pandoc.JSON\nimport System.Environment (getArgs)\nimport qualified Data.Text as T\n\nhandleRuby :: Maybe Format -> Inline -> Inline\nhandleRuby (Just format) x@(Link attr [Str ruby] (src,_)) =\n  case T.uncons src of\n    Just ('-',kanji)\n      | format == Format \"html\" -> RawInline format $\n        \"<ruby>\" <> kanji <> \"<rp>(</rp><rt>\" <> ruby <>\n        \"</rt><rp>)</rp></ruby>\"\n      | format == Format \"latex\" -> RawInline format $\n        \"\\\\ruby{\" <> kanji <> \"}{\" <> ruby <> \"}\"\n      | otherwise -> Str ruby\n    _ -> x\nhandleRuby _ x = x\n\nmain :: IO ()\nmain = toJSONFilter handleRuby\n~~~\n\nNote that, when a script is called using `--filter`, pandoc passes\nit the target format as the first argument.  When a function's\nfirst argument is of type `Maybe Format`, `toJSONFilter` will\nautomatically assign it `Just` the target format or `Nothing`.\n\nWe compile our script:\n\n    # first, make sure pandoc-types is installed:\n    cabal install --lib pandoc-types --package-env .\n    ghc --make handleRuby\n\nThen run it:\n\n    % pandoc -F ./handleRuby -t html\n    [はん](-飯)\n    ^D\n    <p><ruby>飯<rp>(</rp><rt>はん</rt><rp>)</rp></ruby></p>\n    % pandoc -F ./handleRuby -t latex\n    [はん](-飯)\n    ^D\n    \\ruby{飯}{はん}\n\nNote:  to use this to generate PDFs via LaTeX, you'll need\nto use `--pdf-engine=xelatex`, specify a `mainfont` that has\nthe Japanese characters (e.g. \"[Noto Sans CJK JP](https://fonts.google.com/noto/specimen/Noto+Sans+JP)\"), and add\n`\\usepackage{ruby}` to your template or header-includes.\n\n# Exercises\n\n1.  Put all the regular text in a markdown document in ALL CAPS\n    (without touching text in URLs or link titles).\n\n2.  Remove all horizontal rules from a document.\n\n3.  Renumber all enumerated lists with roman numerals.\n\n4.  Replace each delimited code block with class `dot` with an\n    image generated by running `dot -Tpng` (from graphviz) on the\n    contents of the code block.\n\n5.  Find all code blocks with class `python` and run them\n    using the python interpreter, printing the results to the console.\n\n# Technical details of JSON filters\n\nA JSON filter is any program which can consume and produce a\nvalid pandoc JSON document representation. This section describes\nthe technical details surrounding the invocation of filters.\n\n## Arguments\n\nThe program will always be called with the target format as the\nonly argument. A pandoc invocation like\n\n    pandoc --filter demo --to=html\n\nwill cause pandoc to call the program `demo` with argument `html`.\n\n## Environment variables\n\nPandoc sets additional environment variables before calling a\nfilter.\n\n`PANDOC_VERSION`\n:   The version of the pandoc binary used to process the document.\n    Example: `2.11.1`.\n\n`PANDOC_READER_OPTIONS`\n:   JSON object representation of the options passed to the input\n    parser.\n\n    Object fields:\n\n    `abbreviations`\n    :   set of known abbreviations (array of strings).\n\n    `columns`\n    :   number of columns in terminal; an integer.\n\n    `default-image-extension`\n    :   default extension for images; a string.\n\n    `extensions`\n    :   integer representation of the syntax extensions bit\n        field.\n\n    `indented-code-classes`\n    :   default classes for indented code blocks; array of\n        strings.\n\n    `standalone`\n    :   whether the input was a standalone document with header;\n        either `true` or `false`.\n\n    `strip-comments`\n    :   HTML comments are stripped instead of parsed as raw HTML;\n        either `true` or `false`.\n\n    `tab-stop`\n    :   width (i.e. equivalent number of spaces) of tab stops;\n        integer.\n\n    `track-changes`\n    :   track changes setting for docx; one of\n        `\"accept-changes\"`, `\"reject-changes\"`, and\n        `\"all-changes\"`.\n\n## Supported interpreters\n\nFiles passed to the `--filter`/`-F` parameter are expected to be\nexecutable. However, if the executable bit is not set, then\npandoc tries to guess a suitable interpreter from the file\nextension.\n\n  file extension   interpreter\n  ---------------- --------------\n  .py              `python`\n  .hs              `runhaskell`\n  .pl              `perl`\n  .rb              `ruby`\n  .php             `php`\n  .js              `node`\n  .r               `Rscript`\n"
  },
  {
    "path": "doc/getting-started.md",
    "content": "---\ntitle: Getting started with pandoc\nauthor: John MacFarlane\n---\n\nThis document is for people who are unfamiliar with command line\ntools.  Command-line experts can go straight to the [User's\nGuide](https://pandoc.org/MANUAL.html) or the pandoc man page.\n\n# Step 1:  Install pandoc\n\nFirst, install pandoc, following the [instructions for\nyour platform](https://pandoc.org/installing.html).\n\n# Step 2:  Open a terminal\n\nPandoc is a command-line tool.  There is no graphic user interface.\nSo, to use it, you'll need to open a terminal window:\n\n- On OS X, the Terminal application can be found in\n  `/Applications/Utilities`.  Open a Finder window and go to\n  `Applications`, then `Utilities`.  Then double click on\n  `Terminal`.  (Or, click the spotlight icon in the upper right\n  hand corner of your screen and type `Terminal` -- you should\n  see `Terminal` under `Applications`.)\n\n- On Windows, you can use either the classic command prompt or the\n  more modern PowerShell terminal. If you use Windows in desktop\n  mode, run the `cmd` or `powershell` command from the Start menu.\n  If you use the Windows 8 start screen instead, simply type\n  `cmd` or `powershell`, and then run either the \"Command\n  Prompt\" or \"Windows Powershell\" application.  If you are using\n  `cmd`, type `chcp 65001` before using pandoc, to set the\n  encoding to UTF-8.\n\n- On Linux, there are many possible configurations, depending on\n  what desktop environment you're using:\n\n    * In Unity, use the search function on the `Dash`, and search\n      for `Terminal`.  Or, use the keyboard shortcut `Ctrl-Alt-T`.\n    * In Gnome, go to `Applications`, then `Accessories`, and\n      select `Terminal`, or use `Ctrl-Alt-T`.\n    * In XFCE, go to `Applications`, then `System`, then `Terminal`,\n      or use `Super-T`.\n    * In KDE, go to `KMenu`, then `System`, then `Terminal Program (Konsole)`.\n\nYou should now see a rectangle with a \"prompt\" (possibly just a symbol\nlike `%`, but probably including more information, such as your\nusername and directory), and a blinking cursor.\n\nLet's verify that pandoc is installed.  Type\n\n    pandoc --version\n\nand hit enter.  You should see a message telling you which version\nof pandoc is installed, and giving you some additional information.\n\n# Step 3:  Changing directories\n\nFirst, let's see where we are.  Type\n\n    pwd\n\non Linux or OSX, or\n\n    echo %cd%\n\non Windows, and hit enter.  Your terminal should print your current\nworking directory.  (Guess what `pwd` stands for?)  This should be your\nhome directory.\n\nLet's navigate now to our `Documents` directory:  type\n\n    cd Documents\n\nand hit enter.  Now type\n\n    pwd\n\n(or `echo %cd%` on Windows)\nagain.  You should be in the `Documents` subdirectory of your home\ndirectory.  To go back to your home directory, you could type\n\n    cd ..\n\nThe `..` means \"one level up.\"\n\nGo back to your `Documents` directory if you're not there already.\nLet's try creating a subdirectory called `pandoc-test`:\n\n    mkdir pandoc-test\n\nNow change to the `pandoc-test` directory:\n\n    cd pandoc-test\n\nIf the prompt doesn't tell you what directory you're in, you can\nconfirm that you're there by doing\n\n    pwd\n\n(or `echo %cd%`) again.\n\nOK, that's all you need to know for now about using the terminal.\nBut here's a secret that will save you a lot of typing.  You can\nalways type the up-arrow key to go back through your history\nof commands.  So if you want to use a command you typed earlier,\nyou don't need to type it again:  just use up-arrow until it comes\nup.  Try this.  (You can use down-arrow as well, to go the other\ndirection.)  Once you have the command, you can also use the\nleft and right arrows and the backspace/delete key to edit it.\n\nMost terminals also support tab completion of directories and\nfilenames.  To try this, let's first go back up to our `Documents`\ndirectory:\n\n    cd ..\n\nNow, type\n\n    cd pandoc-\n\nand hit the tab key instead of enter.  Your terminal should fill\nin the rest (`test`), and then you can hit enter.\n\nTo review:\n\n  - `pwd` (or `echo %cd%` on Windows)\n    to see what the current working directory is.\n  - `cd foo` to change to the `foo` subdirectory of your working\n    directory.\n  - `cd ..` to move up to the parent of the working directory.\n  - `mkdir foo` to create a subdirectory called `foo` in the\n    working directory.\n  - up-arrow to go back through your command history.\n  - tab to complete directories and file names.\n\n# Step 4:  Using pandoc as a filter\n\nType\n\n    pandoc\n\nand hit enter.  You should see the cursor just sitting there, waiting\nfor you to type something.  Type this:\n\n    Hello *pandoc*!\n\n    - one\n    - two\n\nWhen you're finished (the cursor should be at the beginning of the line),\ntype `Ctrl-D` on OS X or Linux, or `Ctrl-Z` followed\nby `Enter` on Windows.  You should now see your text converted to HTML!\n\n    <p>Hello <em>pandoc</em>!</p>\n    <ul>\n    <li>one</li>\n    <li>two</li>\n    </ul>\n\nWhat just happened?  When pandoc is invoked without specifying any\ninput files, it operates as a \"filter,\" taking input from the\nterminal and sending its output back to the terminal.  You can use\nthis feature to play around with pandoc.\n\nBy default, input is interpreted as pandoc markdown, and output is\nHTML.  But we can change that.  Let's try converting *from* HTML\n*to* markdown:\n\n    pandoc -f html -t markdown\n\nNow type:\n\n    <p>Hello <em>pandoc</em>!</p>\n\nand hit `Ctrl-D` (or `Ctrl-Z` followed by `Enter` on Windows).\nYou should see:\n\n    Hello *pandoc*!\n\nNow try converting something from markdown to LaTeX.  What command\ndo you think you should use?\n\n# Step 5:  Text editor basics\n\nYou'll probably want to use pandoc to convert a file, not to read\ntext from the terminal.  That's easy, but first we need to create\na text file in our `pandoc-test` subdirectory.\n\n**Important:**  To create a text file, you'll need to use a text\neditor, *not* a word processor like Microsoft Word.  On Windows, you\ncan use Notepad (in `Accessories`).  On OS X, you can use\n`TextEdit` (in `Applications`).  On Linux, different platforms come\nwith different text editors:  Gnome has `GEdit`, and KDE has `Kate`.\n\nStart up your text editor.  Type the following:\n\n    ---\n    title: Test\n    ...\n\n    # Test!\n\n    This is a test of *pandoc*.\n\n    - list one\n    - list two\n\nNow save your file as `test1.md` in the directory\n`Documents/pandoc-test`.\n\nNote:  If you use plain text a lot, you'll want a better editor than\n`Notepad` or `TextEdit`.  You might want to look at\n[Visual Studio Code](https://code.visualstudio.com/) or\n[Sublime Text](https://www.sublimetext.com/) or (if you're willing\nto put in some time learning an unfamiliar interface)\n[Vim](https://www.vim.org) or [Emacs](https://www.gnu.org/software/emacs).\n\n# Step 6:  Converting a file\n\nGo back to your terminal.  We should still be in the\n`Documents/pandoc-test` directory.  Verify that with `pwd`.\n\nNow type\n\n    ls\n\n(or `dir` if you're on Windows).\nThis will list the files in the current directory.  You should see\nthe file you created, `test1.md`.\n\nTo convert it to HTML, use this command:\n\n    pandoc test1.md -f markdown -t html -s -o test1.html\n\nThe filename `test1.md` tells pandoc which file to convert.\nThe `-s` option says to create a \"standalone\" file, with a header\nand footer, not just a fragment.  And the `-o test1.html` says\nto put the output in the file `test1.html`.  Note that we could\nhave omitted `-f markdown` and `-t html`, since the default\nis to convert from markdown to HTML, but it doesn't hurt to\ninclude them.\n\nCheck that the file was created by typing `ls` again.  You\nshould see `test1.html`.  Now open this in a browser.  On OS X,\nyou can type\n\n    open test1.html\n\nOn Windows, type\n\n    .\\test1.html\n\nYou should see a browser window with your document.\n\nTo create a LaTeX document, you just need to change the command\nslightly:\n\n    pandoc test1.md -f markdown -t latex -s -o test1.tex\n\nTry opening `test1.tex` in your text editor.\n\nPandoc can often figure out the input and output formats from\nthe filename extensions.  So, you could have just used:\n\n    pandoc test1.md -s -o test1.tex\n\nPandoc knows you're trying to create a LaTeX document, because of the\n`.tex` extension.\n\nNow try creating a Word document (with extension `docx`).\n\nIf you want to create a PDF, you'll need to have LaTeX installed.\n(See [MacTeX](https://tug.org/mactex/) on OS X,\n[MiKTeX](https://miktex.org) on Windows, or install the texlive\npackage on Linux.)  Then do\n\n    pandoc test1.md -s -o test1.pdf\n\n# Step 7:  Command-line options\n\nYou now know the basics.  Pandoc has a lot of options.  At this point\nyou can start to learn more about them by reading the\n[User's Guide](https://pandoc.org/MANUAL.html).\n\nHere's an example.  The `--mathml` option causes pandoc to\nconvert TeX math into MathML.  Type\n\n    pandoc --mathml\n\nthen enter this text, followed by `Ctrl-D` (`Ctrl-Z` followed by\n`Enter` on Windows):\n\n    $x = y^2$\n\nNow try the same thing without `--mathml`.  See the difference\nin output?\n\nIf you forget an option, or forget which formats are supported, you\ncan always do\n\n    pandoc --help\n\nto get a list of all the supported options.\n\nOn OS X or Linux systems, you can also do\n\n    man pandoc\n\nto get the pandoc manual page.  All of this information is also\nin the User's Guide.\n\nIf you get stuck, you can always ask questions on the\n[discussion forum](https://github.com/jgm/pandoc/discussions).\nBut be sure to check the [FAQs](https://pandoc.org/faqs.html) first,\nand search through the forum to see if your question has\nbeen answered before.\n\n"
  },
  {
    "path": "doc/jats.md",
    "content": "---\ntitle: JATS\nauthor: Albert Krewinkel\n---\n\nThis document describes pandoc's handling of [JATS].\n\nMetadata Values\n===============\n\n`abstract`\n:   Article summary. Added via the document's front matter via the\n    [`<abstract>`][elem:abstract] element.\n\n`author`\n:   list of article contributors. Each author should have a surname\n    and a given name listed in the entry; if the author has no\n    `surname` value, then the item will be used as the contributors\n    [`string-name`][elem:string-name].\n\n    `orcid`\n    :   the contributor's ORCID identifier.\n\n    `surname`\n    :   surname of the contributor. Usually the family name in\n        western names.\n\n        See [`<surname>`][elem:surname].\n\n    `given-names`\n    :   personal names of the contributor; this includes middle\n        names (if any) in western-style names.\n\n        See [`<given-names>`][elem:given-names].\n\n    `name`\n    :   full name of the author; included only as a fallback if\n        `author.surname` is not available. Tagged with\n        [`<string-name>`][elem:string-name].\n\n    `email`\n    :   the contributor's email address.\n\n        Used as the contents of the [`<email>`][elem:given-names]\n        element.\n\n    `affiliation`\n    :   either full affiliation entries as described in field\n        `affiliation`, or a list of affiliation identifiers.\n\n        The identifiers link to the organizations with which an\n        author is affiliated. Each identifier in this list must\n        also occur as the `id` of an affiliation listed in the\n        top-level `affiliation` list.\n\n        If the top-level `affiliation` field is set, then this\n        entry assumed to be a list of identifiers, and a list of\n        full entries if that field is unset.\n\n        Full entries must be given if the articleauthoring tag\n        set it used, as affiliation links are not allowed in that\n        schema.\n\n    `roles`\n    :   a list of dictionaries describing the author's role(s).\n        Each role is added as an [`<role>`] element to\n        the author's [`<contrib>`] element. The following examples\n        illustrate:\n\n        An ad-hoc role:\n\n        ```yaml\n        roles:\n          - name: Dolphin Catcher\n        ```\n\n        A role specified with CRediT.\n\n        ```yaml\n        roles:\n          - credit: writing-review-editing\n        ```\n\n        The `credit-name` is automatically looked up from\n        the CRediT taxonomy, but you can also specify it\n        yourself:\n\n        ```yaml\n        roles:\n          - credit: writing-review-editing\n            credit-name: Writing – review & editing\n        ```\n\n        A role specified with CRediT, including an\n        optional degree of contribution. Note that\n        specifying the degree only is allowed when\n        using CRediT roles and not ad-hoc roles.\n\n        ```yaml\n        roles:\n          - credit: writing-review-editing\n            degree: Lead\n        ```\n\n        A role specified with CRediT with a label override,\n        useful for internationalization:\n\n        ```yaml\n        roles:\n          - credit: writing-review-editing\n            name: Escrita – revisão e edição\n        ```\n\n        The value for `credit` and `credit-name`\n        must be from one of the 14 terms from the\n        Contribution Role Taxonomy (CRediT):\n\n        | `credit`                 | `credit-name`              |\n        |--------------------------|----------------------------|\n        | `conceptualization`      | Conceptualization          |\n        | `data-curation`          | Data curation              |\n        | `formal-analysis`        | Formal analysis            |\n        | `funding-acquisition`    | Funding acquisition        |\n        | `investigation`          | Investigation              |\n        | `methodology`            | Methodology                |\n        | `project-administration` | Project administration     |\n        | `resources`              | Resources                  |\n        | `software`               | Software                   |\n        | `supervision`            | Supervision                |\n        | `validation`             | Validation                 |\n        | `visualization`          | Visualization              |\n        | `writing-original-draft` | Writing – original draft   |\n        | `writing-review-editing` | Writing – review & editing |\n\n        JATS suggests in [`<degree-contribution>`] to use one of\n        the following three values when specifying the degree of\n        contribution:\n\n        1. `Lead`\n        2. `Equal`\n        3. `Supporting`\n\n    `equal-contrib`\n    :   boolean attribute used to mark authors who contributed\n        equally to the work. The\n        [`equal-contrib`][attr:equal-contrib] attribute, set to\n        `yes`, is added to the author's [`<contrib>`] element if\n        this is set to a truthy value.\n\n    `cor-id`\n    :   identifier linking to the contributor's correspondence\n        information. The info itself must be stored as an item in\n        `article.author-notes.corresp`. If the `cor-id` value is\n        set, then an [`<xref>`][elem:xref] link of\n        [`ref-type`][attr:ref-type] `corresp` is added. The\n        [`rid`][attr:rid] attribute is set to `cor-<ID>`, where\n        `<ID>` is the stringified value of this attribute.\n\n        Furthermore, the [`corresp`][attr:corresp] attribute on\n        the author's [`<contrib>`] element is set to `yes` if\n        this attribute is set to a truthy.\n\n`affiliation`\n:   the list of organizations with which contributors are\n    affiliated. Each institution is added as an [`<aff>`] element to\n    the author's contrib-group.\n\n    The fields are given in the order in which they are included in\n    the output.\n\n    `id`\n    :   internal identifier; used as the [`<aff>`] element's `id`\n        value, prefixed with `aff-`.\n\n    `group`\n    :   name of the research group or other low-level organizational\n        structure; used as value of an [`<institution>`] element with\n        [`content-type`][attr:content-type] set to `group`.\n\n    `department`\n    :   name of the department or other mid-level organizational\n        structure; used as value of an [`<institution>`] element with\n        [`content-type`][attr:content-type] set to `dept`.\n\n    `organization`\n    :   name of the company, university, or other top-level\n        organizational structure; used as value of an\n        [`<institution>`] element. The institution element is wrapped\n        in an [`<institution-wrap>`] element; any identifiers, like\n        `ringgold` or `ror`, are added to the wrapper and must hence\n        belong to this organization (not the department or group).\n\n    `isni`\n    :   International Standard Name Identifier of the organization.\n        Added via an [`<institution-id>`] element with\n        [`institution-id-type`](attr:institution-id-type) set to\n        `ISNI`.\n\n    `ringgold`\n    :   [Ringgold] identifier of the organization. Added via an\n        [`<institution-id>`] element with\n        [`institution-id-type`](attr:institution-id-type) set to\n        `Ringgold`.\n\n    `ror`\n    :   Research Organization Registry identifier of the\n        organization. Added via an [`<institution-id>`] element with\n        [`institution-id-type`](attr:institution-id-type) set to\n        `ROR`.\n\n    `pid`\n    :   Array of persistent identifiers which are added as\n        [`<institution-id>`] elements. Each item must contain a map\n        with keys `type`, used as\n        [`institution-id-type`](attr:institution-id-type), and `id`,\n        used as element content.\n\n    `street-address`\n    :   The organization's street address; each list item is wrapped\n        in an [`<addr-line>`] element, separated by a comma and\n        space (`, `).\n\n    `city`\n    :   City in which the organization is located; used only if\n        `street-address` is not given, in which case the value is\n        wrapped in a [`<city>`] element.\n\n    `country`\n    :   Country in which the organization is located; used as the\n        value of a [`<country>`] element.\n\n    `country-code`\n    :   Two letter ISO-3166-1 country identifier; used as the\n        [`country`][attr:country] attribute in element [`<country>`]\n        (if the latter is present).\n\n`copyright`\n:   Copyright and licensing information. This information is\n    rendered via the [`<permissions>`][elem:permissions] element.\n\n    It is recommended to use the `license` field (described below)\n    for licensing information. If licensing information is\n    included below `copyright`, then the variables `type`, `link`,\n    and `text` should always be used together.\n\n    `statement`\n    :   copyright notice or statement; used as content of the\n        [`<copyright-statement>`][elem:copyright-statement]. Use a\n        list for multiple statements.\n\n    `year`\n    :   the year of copyright; used as content of the\n        [`<copyright-year>`][elem:copyright-year]. Use a list to\n        for multiple copyright years. The JATS documentation\n        states that this field need not to be used if the year is\n        included in the copyright statement.\n\n    `holder`\n    :   the copyright holder; included via the\n        [`<copyright-holder>`][elem:copyright-holder] element. Use\n        a list for multiple copyright holders.\n\n    `text`\n    :   inline text setting the license under which the text is\n        published; included via the\n        [`<license-p>`][elem:copyright-holder] element.\n\n    `type`\n    :   type of the license; used as value of the\n        [`license-type`][attr:license-type] attribute.\n\n    `link`\n    :   external link describing the license; used as value of a\n        `xlink:href` attribute in the `<license>` element.\n\n`date`\n:   publication date. This value should usually be a string\n    representation of a date. Pandoc will parse and deconstruct the\n    date into the components given below. It is also possible to\n    pass these components directly.\n\n    The publication date is recorded in the document via the\n    [`<pub-date>`] element and its sub-elements. The\n    [`publication-format`][attr:publication-format] attribute is\n    always set to `electronic`.\n\n    `iso-8601`\n    :   ISO-8601 representation of the publication date. Used as the\n        value of the [`<pub-date>`] element's\n        [`iso-8601-date`][attr:iso-8601-date] attribute.\n\n        This value is set automatically if pandoc can parse the\n        `date` value as a date.\n\n    `day`, `month`, `year`\n    :   Day, month, and year of the publication date. Only the\n        publication year is required. The values are used as the\n        contents of the elements with the respective names.\n\n        The values are set automatically if pandoc can parse the\n        `date` value as a date.\n\n    `type`\n    :   The type of event marked by this date. The value is set as\n        the [`date-type`][attr:date-type] attribute on the\n        [`<pub-date>`] element and defaults to \"pub\" if not\n        specified.\n\n`article`\n:   information concerning the article that identifies or describes\n    it. The key-value pairs within this map are typically used\n    within the [`<article-meta>`][elem:article-meta] element.\n\n    `publisher-id`\n    :   external article identifier assigned by the publisher. Used\n        as the content of the [`<article-id>`][elem:article-id]\n        element with attribute [`pub-id-type`][attr:pub-id-type] set\n        to `publisher-id`.\n\n    `doi`\n    :   Digital Object Identifier (DOI) assigned to the article.\n        Used as the content of the [`<article-id>`][elem:article-id]\n        element with attribute [`pub-id-type`][attr:pub-id-type] set\n        to `doi`.\n\n    `pmid`\n    :   PubMed Identifier (PubMed ID) assigned to the article. Used\n        as the content of the [`<article-id>`][elem:article-id]\n        element with attribute [`pub-id-type`][attr:pub-id-type] set\n        to `pmid`.\n\n    `pmcid`\n    :   PubMed Central Identifier assigned to the article. Used as\n        the content of the [`<article-id>`][elem:article-id] element\n        with attribute [`pub-id-type`][attr:pub-id-type] set to\n        `pmcid`.\n\n    `art-access-id`\n    :   generic article accession identifier. Used as the content of\n        the [`<article-id>`][elem:article-id] element with attribute\n        [`pub-id-type`][attr:pub-id-type] set to `art-access-id`.\n\n    `heading`\n    :   name of a subject or topic describing the article. Used as\n        the content of the [`<subject>`][elem:subject] element,\n        nested in a [`<subj-group>`][elem:subj-group] element which\n        has `heading` as its\n        [`subj-group-type`][attr:subj-group-type] attribute.\n\n    `categories`\n    :   list a subject or topic describing the article. Items are\n        each used as the content a the [`<subject>`][elem:subject]\n        element, grouped in a single\n        [`<subj-group>`][elem:subj-group] element with its\n        [`subj-group-type`][attr:subj-group-type] attribute set to\n        `categories`.\n\n    `author-notes`\n    :   Additional information about authors, like conflict of\n        interest statements and corresponding author contact info.\n        Wrapped in an [`<author-notes>`][elem:author-notes] element.\n\n        `conflict`\n        :   Conflict of interest statement. Rendered as a footnote\n            ([`<fn>`][elem:fn]) of [`fn-type`](attr:fn-type)\n            `conflict`.\n\n        `con`\n        :   Contributed-by information. Rendered as a footnote\n            ([`<fn>`][elem:fn]) of [`fn-type`](attr:fn-type) `con`.\n\n        `corresp`\n        :   Correspondence information. This must be a list of\n            contributor correspondence items, where each item must\n            have the properties `id` and `email`. The info is then\n            rendered via a [`<corresp>`][elem:corresp] element.\n\n    `funding-statement`\n    :   Prose describing the funding. Added to the article's\n        frontmatter via the\n        [`funding-statement`][elem:funding-statement] element.\n\n`journal`\n:   information on the journal in which the article is published.\n    This must be a map; the following key/value pairs are\n    recognized.\n\n    `publisher-id`\n    :   journal identifier assigned by the publisher. Used as\n        content of element [`<journal-id>`][elem:journal-id] with\n        attribute [`journal-id-type`][attr:journal-id-type] set to\n        `publisher-id`.\n\n    `nlm-ta`\n    :   journal identifier assigned by PubMed. Used as content of\n        element [`<journal-id>`][elem:journal-id] with attribute\n        [`journal-id-type`][attr:journal-id-type] set to `nlm-ta`.\n\n    `pmc`\n    :   journal identifier assigned by PubMed Central. Used as\n        content of element [`<journal-id>`][elem:journal-id] with\n        attribute [`journal-id-type`][attr:journal-id-type] set to\n        `pmc`.\n\n    `title`\n    :   full title of the journal in which the article is published.\n        Used as content of the\n        [`<journal-title>`][elem:journal-title] element.\n\n    `abbrev-title`\n    :   short form of the journal title. Used as content of the\n        [`<abbrev-journal-title>`][elem:abbrev-journal-title]\n        element.\n\n    `pissn`\n    :   ISSN identifier of the publication's print version. Used as\n        content of the [`<issn>`][elem:issn] element with the\n        [`publication-format`][attr:publication-format] attribute\n        set to `print`.\n\n    `eissn`\n    :   ISSN identifier of the publication's electronic version.\n        Used as content of the [`<issn>`][elem:issn] element with\n        the [`publication-format`][attr:publication-format]\n        attribute set to `electronic`.\n\n    `publisher-name`\n    :   name of the publishing entity (person, company, or other).\n        Used as the content of the\n        [`<publisher-name>`][elem:publisher-name] element.\n\n    `publisher-loc`\n    :   place of publication. Used as the content of the\n        [`<publisher-loc>`][elem:publisher-loc] element.\n\n`license`\n:   Article licensing information. Each item of this field is\n    rendered as a `<license>` element within the\n    [`<permissions>`][elem:permissions] element.\n\n    Item content should be either a single paragraph, or a map\n    with the fields listed below.\n\n    `text`\n    :   inline text describing a license under which the text is\n        published; included via the\n        [`<license-p>`][elem:copyright-holder] element.\n\n    `type`\n    :   type of the license; used as value of the\n        [`license-type`][attr:license-type] attribute.\n\n    `link`\n    :   external link describing the license; used as value of a\n        `xlink:href` attribute in the `<license>` element.\n\n`notes`\n:   Additional notes concerning the whole article. Added to the\n    article's frontmatter via the [`<notes>`][elem:notes] element.\n\n`subtitle`\n:   Subordinate part of the document title. Added to the\n    document's front matter as a\n    [`<subtitle>`][elem:article-title] element.\n\n`tags`\n:   list of keywords. Items are used as contents of the\n    [`<kwd>`][elem:kwd] element; the elements are grouped in a\n    [`<kwd-group>`][elem:kwd-group] with the\n    [`kwd-group-type`][attr:kwd-group-type] value `author`.\n\n`title`\n:   The article title. Added to the document's front matter via the\n    [`<article-title>`][elem:article-title] element.\n\n`supplementary-material`\n:   Supplementary metadata. Added to the document's front matter\n    via the [`<supplementary-material>`][elem:supplementary-material]\n    element.  Only available with `jats_articlepublishing`.\n\n`floats-group`\n:   List of floating objects, such as figures, tables, text boxes,\n    etc., that are not part of the main text. The value is\n    rendered by nesting it below a\n    [`<floats-group>`][elem:floats-group] element. Only available\n    with `jats_publishing` and `jats_archiving`.\n\n\nRequired Metadata\n-----------------\n\nPandoc will try to generate a valid JATS document even when\ninformation is missing, filling in placeholders or using empty\nvalues. This circumvents the intend to ensure a minimum set of\ninformation being present in documents of a certain tag set. It is\nhence recommended to always provide the information listed below.\n\n### Publishing Tag Set\n\nRequired metadata values:\n\n- One or more of `journal.publisher-id`, `journal.nlm-ta`,\n  `journal.pmc`.\n- One or more of `journal.pissn`, `journal.eissn`.\n\n[JATS]: https://jats.nlm.nih.gov/\n[Ringgold]: https://ringgold.com/\n[attr:content-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/content-type.html\n[attr:corresp]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/corresp.html\n[attr:date-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/date-type.html\n[attr:equal-contrib]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/equal-contrib.html\n[attr:fn-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/fn-type.html\n[attr:institution-id-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/institution-id-type.html\n[attr:iso-8601-date]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/iso-8601-date.html\n[attr:journal-id-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/journal-id-type.html\n[attr:kwd-group-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/kwd-group-type.html\n[attr:license-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/license-type.html\n[attr:pub-id-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/pub-id-type.html\n[attr:publication-format]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/publication-format.html\n[attr:ref-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/ref-type.html\n[attr:rid]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/rid.html\n[attr:subj-group-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/subj-group-type.html\n[elem:abbrev-journal-title]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/abbrev-journal-title.html\n[elem:abstract]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/abstract.html\n[elem:article-id]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/article-id.html\n[elem:article-meta]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/article-meta.html\n[elem:article-title]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/article-title.html\n[elem:supplementary-material]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/supplementary-material.html\n[elem:copyright-holder]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/copyright-holder.html\n[elem:copyright-statement]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/copyright-statement.html\n[elem:copyright-year]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/copyright-year.html\n[elem:corresp]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/corresp.html\n[elem:email]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/email.html\n[elem:floats-group]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/floats-group.html\n[elem:fn]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/fn.html\n[elem:funding-statement]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/funding-statement.html\n[elem:given-names]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/given-names.html\n[elem:issn]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/issn.html\n[elem:journal-id]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/journal-id.html\n[elem:journal-title]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/journal-title.html\n[elem:kwd-group]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/kwd-group.html\n[elem:kwd]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/kwd.html\n[elem:license-p]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/license-p.html\n[elem:license]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/license.html\n[elem:notes]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/notes.html\n[elem:permissions]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/permissions.html\n[elem:publisher-loc]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/publisher-loc.html\n[elem:publisher-name]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/publisher-name.html\n[elem:string-name]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/string-name.html\n[elem:subj-group]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/subj-group.html\n[elem:subject]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/subject.html\n[elem:subtitle]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/subtitle.html\n[elem:surname]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/surname.html\n[elem:xref]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/xref.html\n\n[`<addr-line>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/addr-line.html\n[`<aff>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/aff.html\n[`<city>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/city.html\n[`<contrib>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/contrib.html\n[`<country>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/country.html\n[`<institution-id>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/institution-id.html\n[`<institution-wrap>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/institution-wrap.html\n[`<institution>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/institution.html\n[`<pub-date>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/pub-date.html\n[`<role>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/role.html\n[`<degree-contribution>`]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/degree-contribution.html\n"
  },
  {
    "path": "doc/libraries.md",
    "content": "---\ntitle: The pandoc family of libraries\nauthor: John MacFarlane\n---\n\nThe following Haskell libraries have been developed to support\npandoc:\n\n\n[citeproc]\n:   Citation processing using CSL stylesheets.\n\n[commonmark], [commonmark-extensions], and [commonmark-pandoc]\n:   Efficient, standards-compliant parser for commonmark and extensions.\n\n[djot]\n:   Parser and renderer for djot light markup syntax.\n\n[doclayout]\n:   Combinators for laying out a textual document, with support\n    for line wrapping, tabular layout, and more.\n\n[doctemplates]\n:   Supports pandoc's templates.\n\n[emojis]\n:   Conversion between emoji characters and aliases.\n\n[gridtables]\n:   Support for parsing grid style textual tables.\n\n[hslua-aeson]\n:   Converter from aeson data types to Lua objects.\n\n[hslua-cli]\n:   Command-line interface mimicking the default `lua` executable.\n\n[hslua-module-doclayout]\n:   Lua bindings to the doclayout library mentioned above.\n\n[hslua-module-path], [-system], [-text], and [-version]\n:   Lua modules that expose functionality of basic Haskell\n    libraries to Lua.\n\n[hslua-objectorientation], [hslua-packaging]\n:   Bindings, wrappers, and helper functions to access Haskell data\n    types from Lua via an object-oriented interface.\n\n[ipynb]\n:   Representation of Jupyter notebooks and conversion to and\n    from JSON.\n\n[jira-wiki-markup]\n:   Support for parsing Jira wiki syntax.\n\n[rfc5051]\n:   Simple unicode collation (used for citation sorting).\n\n[skylighting-core] and [skylighting]\n:   Syntax highlighting engine supporting over 140 languages.\n\n[texmath]\n:   Conversion of math between tex, Word equation, MathML, and GNU eqn.\n\n[typst]\n:   Parsing and evaluating typst syntax.\n\n[typst-symbol]\n:   Symbol and emoji lookup for typst language.\n\n[unicode-collation]\n:   Proper Unicode collation (sorting).\n\n[zip-archive]\n:   A pure zip file creator and extractor, used by pandoc for\n    docx, ODT, and EPUB.\n\n[citeproc]: https://hackage.haskell.org/package/citeproc\n[commonmark-extensions]: https://hackage.haskell.org/package/commonmark-extensions\n[commonmark-pandoc]: https://hackage.haskell.org/package/commonmark-pandoc\n[commonmark]: https://hackage.haskell.org/package/commonmark\n[djot]: https://hackage.haskell.org/package/djot\n[doclayout]: https://hackage.haskell.org/package/doclayout\n[doctemplates]: https://hackage.haskell.org/package/doctemplates\n[emojis]: https://hackage.haskell.org/package/emojis\n[gridtables]: https://hackage.haskell.org/package/gridtables\n[hslua-aeson]: https://hackage.haskell.org/package/hslua-aeson\n[hslua-cli]: https://hackage.haskell.org/package/hslua-cli\n[hslua-module-doclayout]: https://hackage.haskell.org/package/hslua-module-doclayout\n[hslua-module-path]: https://hackage.haskell.org/package/hslua-module-path\n[-system]: https://hackage.haskell.org/package/hslua-module-system\n[-text]: https://hackage.haskell.org/package/hslua-module-text\n[-version]: https://hackage.haskell.org/package/hslua-module-version\n[hslua-objectorientation]: https://hackage.haskell.org/package/hslua-objectorientation\n[hslua-packaging]: https://hackage.haskell.org/package/hslua-packaging\n[ipynb]: https://hackage.haskell.org/package/ipynb\n[jira-wiki-markup]: https://hackage.haskell.org/package/jira-wiki-markup\n[rfc5051]: https://hackage.haskell.org/package/rfc5051\n[skylighting-core]: https://hackage.haskell.org/package/skylighting-core\n[skylighting]: https://hackage.haskell.org/package/skylighting\n[texmath]: https://hackage.haskell.org/package/texmath\n[typst-symbol]: https://hackage.haskell.org/package/typst-symbol\n[typst]: https://hackage.haskell.org/package/typst\n[unicode-collation]: https://hackage.haskell.org/package/unicode-collation\n[zip-archive]: https://hackage.haskell.org/package/zip-archive\n"
  },
  {
    "path": "doc/lua-filters.md",
    "content": "---\nauthor:\n- Albert Krewinkel\n- John MacFarlane\ndate: 'January 10, 2020'\ntitle: Pandoc Lua Filters\n---\n\n# Introduction\n\nPandoc has long supported filters, which allow the pandoc\nabstract syntax tree (AST) to be manipulated between the parsing\nand the writing phase. [Traditional pandoc\nfilters](https://pandoc.org/filters.html) accept a JSON\nrepresentation of the pandoc AST and produce an altered JSON\nrepresentation of the AST. They may be written in any\nprogramming language, and invoked from pandoc using the\n`--filter` option.\n\nAlthough traditional filters are very flexible, they have a\ncouple of disadvantages. First, there is some overhead in\nwriting JSON to stdout and reading it from stdin (twice, once on\neach side of the filter). Second, whether a filter will work\nwill depend on details of the user's environment. A filter may\nrequire an interpreter for a certain programming language to be\navailable, as well as a library for manipulating the pandoc AST\nin JSON form. One cannot simply provide a filter that can be\nused by anyone who has a certain version of the pandoc\nexecutable.\n\nStarting with version 2.0, pandoc makes it possible to write\nfilters in Lua without any external dependencies at all. A Lua\ninterpreter (version 5.4) and a Lua library for creating pandoc\nfilters is built into the pandoc executable. Pandoc data types\nare marshaled to Lua directly, avoiding the overhead of writing\nJSON to stdout and reading it from stdin.\n\nHere is an example of a Lua filter that converts strong emphasis\nto small caps:\n\n``` lua\nreturn {\n  Strong = function (elem)\n    return pandoc.SmallCaps(elem.content)\n  end,\n}\n```\n\nor equivalently,\n\n``` lua\nfunction Strong(elem)\n  return pandoc.SmallCaps(elem.content)\nend\n```\n\nThis says: walk the AST, and when you find a Strong element,\nreplace it with a SmallCaps element with the same content.\n\nTo run it, save it in a file, say `smallcaps.lua`, and invoke\npandoc with `--lua-filter=smallcaps.lua`.\n\nHere's a quick performance comparison, converting the pandoc\nmanual (MANUAL.txt) to HTML, with versions of the same JSON\nfilter written in compiled Haskell (`smallcaps`) and interpreted\nPython (`smallcaps.py`):\n\n  Command                                 Time\n  --------------------------------------- -------\n  `pandoc`                                1.01s\n  `pandoc --filter ./smallcaps`           1.36s\n  `pandoc --filter ./smallcaps.py`        1.40s\n  `pandoc --lua-filter ./smallcaps.lua`   1.03s\n\nAs you can see, the Lua filter avoids the substantial overhead\nassociated with marshaling to and from JSON over a pipe.\n\n# Lua filter structure\n\nLua filters are tables with element names as keys and values\nconsisting of functions acting on those elements.\n\nFilters are expected to be put into separate files and are\npassed via the `--lua-filter` command-line argument. For\nexample, if a filter is defined in a file `current-date.lua`,\nthen it would be applied like this:\n\n    pandoc --lua-filter=current-date.lua -f markdown MANUAL.txt\n\nThe `--lua-filter` option may be supplied multiple times. Pandoc\napplies all filters (including JSON filters specified via\n`--filter` and Lua filters specified via `--lua-filter`) in the\norder they appear on the command line.\n\nPandoc expects each Lua file to return a filter. If there is\nno value returned by the filter script, then pandoc will try to\ngenerate a single filter by collecting all top-level functions\nwhose names correspond to those of pandoc elements (e.g., `Str`,\n`Para`, `Meta`, or `Pandoc`). (That is why the two examples above\nare equivalent.)\n\nIt is currently also possible to return a list of filters\nfrom a Lua file which are called sequentially. Before the\n[walk](#type-pandoc:walk) method was made available, this was\nthe only way to run multiple filters from one Lua file. However,\nreturning a list of filters is now discouraged in favor of using\nthe [walk](#type-pandoc:walk) method, and this functionality may\nbe removed at some point.\n\nFor each filter, the document is traversed and each element\nsubjected to the filter. Elements for which the filter contains\nan entry (i.e. a function of the same name) are passed to Lua\nelement filtering function. In other words, filter entries will\nbe called for each corresponding element in the document,\ngetting the respective element as input.\n\nThe return value of a filter function must be one of the\nfollowing:\n\n-   nil: this means that the object should remain unchanged.\n-   a pandoc object: this must be of the same type as the input\n    and will replace the original object.\n-   a list of pandoc objects: these will replace the original\n    object; the list is merged with the neighbors of the\n    original objects (spliced into the list the original object\n    belongs to); returning an empty list deletes the object.\n\nThe function's output must result in an element of the same type\nas the input. This means a filter function acting on an inline\nelement must return either nil, an inline, or a list of inlines,\nand a function filtering a block element must return one of nil,\na block, or a list of block elements. Pandoc will throw an error\nif this condition is violated.\n\nIf there is no function matching the element's node type, then\nthe filtering system will look for a more general fallback\nfunction. Two fallback functions are supported, `Inline` and\n`Block`. Each matches elements of the respective type.\n\nElements without matching functions are left untouched.\n\nSee [module documentation](#module-pandoc) for a list of pandoc\nelements.\n\n## Filters on element sequences\n\nFor some filtering tasks, it is necessary to know the order\nin which elements occur in the document. It is not enough then to\ninspect a single element at a time.\n\nThere are two special function names, which can be used to define\nfilters on lists of blocks or lists of inlines.\n\n[`Inlines (inlines)`]{#inlines-filter}\n:   If present in a filter, this function will be called on all\n    lists of inline elements, like the content of a [Para]\n    (paragraph) block, or the description of an [Image]. The\n    `inlines` argument passed to the function will be a [List] of\n    [Inline] elements for each call.\n\n[`Blocks (blocks)`]{#blocks-filter}\n:   If present in a filter, this function will be called on all\n    lists of block elements, like the content of a [MetaBlocks]\n    meta element block, on each item of a list, and the main\n    content of the [Pandoc] document. The `blocks` argument\n    passed to the function will be a [List] of [Block] elements\n    for each call.\n\nThese filter functions are special in that the result must either\nbe nil, in which case the list is left unchanged, or must be a\nlist of the correct type, i.e., the same type as the input\nargument. Single elements are **not** allowed as return values,\nas a single element in this context usually hints at a bug.\n\nSee [\"Remove spaces before normal citations\"][Inlines filter\nexample] for an example.\n\nThis functionality has been added in pandoc 2.9.2.\n\n[Inlines filter example]: #remove-spaces-before-citations\n\n## Traversal order\n\nThe traversal order of filters can be selected by setting the key\n`traverse` to either `'topdown'` or `'typewise'`; the default is\n`'typewise'`.\n\nExample:\n\n``` lua\nlocal filter = {\n  traverse = 'topdown',\n  -- ... filter functions ...\n}\nreturn filter\n```\n\nSupport for this was added in pandoc 2.17; previous versions\nignore the `traverse` setting.\n\n### Typewise traversal\n\nElement filter functions within a filter set are called in a\nfixed order, skipping any which are not present:\n\n  1. functions for [*Inline* elements](#type-inline),\n  2. the [`Inlines`](#inlines-filter) filter function,\n  2. functions for [*Block* elements](#type-block) ,\n  2. the [`Blocks`](#inlines-filter) filter function,\n  3. the [`Meta`](#type-meta) filter function, and last\n  4. the [`Pandoc`](#type-pandoc) filter function.\n\nIt is still possible to force a different order by manually\nrunning the filters using the [walk](#type-pandoc:walk) method.\nFor example, if the filter for *Meta* is to be run before that\nfor *Str*, one can write\n\n``` lua\nfunction Pandoc(doc)\n  doc = doc:walk { Meta = Meta } -- (1)\n  return doc:walk { Str = Str }  -- (2)\nend\n```\n\n### Topdown traversal\n\nIt is sometimes more natural to traverse the document tree\ndepth-first from the root towards the leaves, and all in a single\nrun.\n\nFor example, a block list `[Plain [Str \"a\"], Para [Str\n\"b\"]]`{.haskell} will try the following filter functions, in\norder: `Blocks`, `Plain`, `Inlines`, `Str`, `Para`, `Inlines`,\n`Str`.\n\nTopdown traversals can be cut short by returning `false` as a\nsecond value from the filter function. No child-element of\nthe returned element is processed in that case.\n\nFor example, to exclude the contents of a footnote from being\nprocessed, one might write\n\n``` lua\ntraverse = 'topdown'\nfunction Note (n)\n  return n, false\nend\n```\n\n## Global variables\n\nPandoc passes additional data to Lua filters by setting global\nvariables.\n\n`FORMAT`\n:   The global `FORMAT` is set to the format of the pandoc\n    writer being used (`html5`, `latex`, etc.), so the behavior\n    of a filter can be made conditional on the eventual output\n    format.\n\n`PANDOC_READER_OPTIONS`\n:   Table of the options which were provided to the parser.\n    ([ReaderOptions](#type-readeroptions))\n\n`PANDOC_WRITER_OPTIONS`\n:   Table of the options that will be passed to the writer.\n    While the object can be modified, the changes will **not**\n    be picked up by pandoc.\n    ([WriterOptions](#type-writeroptions))\n\n    Accessing this variable in **custom writers** is\n    **deprecated**. Starting with pandoc 3.0, it is set to a\n    placeholder value (the default options) in custom writers.\n    Access to the actual writer options is provided via the\n    `Writer` or `ByteStringWriter` function, to which the options\n    are passed as the second function argument.\n\n    *Since: pandoc 2.17*\n\n`PANDOC_VERSION`\n:   Contains the pandoc version as a [Version] object which\n    behaves like a numerically indexed table, most significant\n    number first. E.g., for pandoc 2.7.3, the value of the\n    variable is equivalent to a table `{2, 7, 3}`. Use\n    `tostring(PANDOC_VERSION)` to produce a version string. This\n    variable is also set in custom writers.\n\n`PANDOC_API_VERSION`\n:   Contains the version of the pandoc-types API against which\n    pandoc was compiled. It is given as a numerically indexed\n    table, most significant number first. E.g., if pandoc was\n    compiled against pandoc-types 1.17.3, then the value of the\n    variable will behave like the table `{1, 17, 3}`. Use\n    `tostring(PANDOC_API_VERSION)` to produce a version string.\n    This variable is also set in custom writers.\n\n`PANDOC_SCRIPT_FILE`\n:   The name used to involve the filter. This value can be used\n    to find files relative to the script file. This variable is\n    also set in custom writers.\n\n`PANDOC_STATE`\n:   The state shared by all readers and writers. It is used by\n    pandoc to collect and pass information. The value of this\n    variable is of type [CommonState] and\n    is read-only.\n\n`pandoc`\n:   The *pandoc* module, described in the next section, is\n    available through the global `pandoc`. The other modules\n    described herein are loaded as subfields under their\n    respective name.\n\n`lpeg`\n:   This variable holds the `lpeg` module, a package based on\n    Parsing Expression Grammars (PEG).  It provides excellent\n    parsing utilities and is documented on the official [LPeg\n    homepage].  Pandoc uses a built-in version of the library,\n    unless it has been configured by the package maintainer to\n    rely on a system-wide installation.\n\n`re`\n:   Contains the LPeg.re module, which is built on top of LPeg\n    and offers an implementation of a [regex engine].  Pandoc\n    uses a built-in version of the library, unless it has been\n    configured by the package maintainer to rely on a system-wide\n    installation.\n\n[LPeg homepage]: http://www.inf.puc-rio.br/~roberto/lpeg/\n[regex engine]: http://www.inf.puc-rio.br/~roberto/lpeg/re.html\n\n# Pandoc Module\n\nThe `pandoc` Lua module is loaded into the filter's Lua\nenvironment and provides a set of functions and constants to\nmake creation and manipulation of elements easier. The global\nvariable `pandoc` is bound to the module and should generally\nnot be overwritten for this reason.\n\nTwo major functionalities are provided by the module: element\ncreator functions and access to some of pandoc's main\nfunctionalities.\n\n## Element creation\n\nElement creator functions like `Str`, `Para`, and `Pandoc` are\ndesigned to allow easy creation of new elements that are simple\nto use and can be read back from the Lua environment.\nInternally, pandoc uses these functions to create the Lua\nobjects which are passed to element filter functions. This means\nthat elements created via this module will behave exactly as\nthose elements accessible through the filter function parameter.\n\n## Exposed pandoc functionality\n\nSome pandoc functions have been made available in Lua:\n\n-   [`walk_block`](#pandoc.walk_block) and\n    [`walk_inline`](#pandoc.walk_inline) allow filters to be applied\n    inside specific block or inline elements;\n-   [`read`](#pandoc.read) allows filters to parse strings into pandoc\n    documents;\n-   [`pipe`](#pandoc.pipe) runs an external command with input from and\n    output to strings;\n-   the [`pandoc.mediabag`](#module-pandoc.mediabag) module\n    allows access to the \"mediabag,\" which stores binary content\n    such as images that may be included in the final document;\n-   the [`pandoc.utils`](#module-pandoc.utils) module contains\n    various utility functions.\n\n# Lua interpreter initialization\n\nInitialization of pandoc's Lua interpreter can be controlled by\nplacing a file `init.lua` in pandoc's data directory. A common\nuse-case would be to load additional modules, or even to alter\ndefault modules.\n\nThe following snippet is an example of code that might be useful\nwhen added to `init.lua`. The snippet adds all Unicode-aware\nfunctions defined in the [`text` module](#module-pandoc.text) to the\ndefault `string` module, prefixed with the string `uc_`.\n\n``` lua\nfor name, fn in pairs(require 'text') do\n  string['uc_' .. name] = fn\nend\n```\n\nThis makes it possible to apply these functions on strings using\ncolon syntax (`mystring:uc_upper()`).\n\n# Debugging Lua filters\n\nMany errors can be avoided by performing static analysis.\n[`luacheck`](https://github.com/lunarmodules/luacheck) may be used\nfor this purpose. A Luacheck configuration file for pandoc filters\nis available at <https://github.com/rnwst/pandoc-luacheckrc>.\n\nWilliam Lupton has written a Lua module with some handy\nfunctions for debugging Lua filters, including functions\nthat can pretty-print the Pandoc AST elements manipulated\nby the filters: it is available at\n<https://github.com/wlupton/pandoc-lua-logging>.\n\nIt is possible to use a debugging interface to halt execution and\nstep through a Lua filter line by line as it is run inside Pandoc.\nThis is accomplished using the remote-debugging interface of the\npackage [`mobdebug`](https://github.com/pkulchenko/MobDebug).\nAlthough mobdebug can be run from the terminal, it is more useful\nrun within the donation-ware Lua editor and IDE, [ZeroBrane\nStudio](https://studio.zerobrane.com/). ZeroBrane offers a REPL\nconsole and UI to step-through and view all variables and state.\n\nZeroBrane doesn't come with Lua 5.4 bundled, but it can debug it, so\nyou should install Lua 5.4, and then add\n[`mobdebug`](https://luarocks.org/modules/paulclinger/mobdebug) and\nits dependency\n[`luasocket`](https://luarocks.org/modules/luasocket/luasocket) using\n[`luarocks`](https://luarocks.org). ZeroBrane can use your Lua 5.4\ninstall by adding `path.lua = \"/path/to/your/lua\"` in your ZeroBrane\nsettings file. Next, open your Lua filter in ZeroBrane, and add\n`require('mobdebug').start()` at the line where you want your\nbreakpoint. Then make sure the Project > Lua Interpreter is set to the\n\"Lua\" you added in settings and enable \"Start Debugger Server\" [see\ndetailed instructions\nhere](https://studio.zerobrane.com/doc-remote-debugging). Run Pandoc\nas you normally would, and ZeroBrane should break at the correct line.\n\n## Common pitfalls\n\nAST elements not updated\n:   A filtered element will only be updated if the filter\n    function returns a new element to replace it. A function like\n    the below has no effect, as the function returns no value:\n\n    ``` lua\n    function Str (str)\n      str.text = string.upper(str.text)\n    end\n    ```\n\n    The correct version would be\n\n    ``` lua\n    function Str (str)\n      str.text = string.upper(str.text)\n      return str\n    end\n    ```\n\nPattern behavior is locale dependent\n:   The character classes in Lua's pattern library depend on the\n    current locale: E.g., the character `©` will be treated as\n    punctuation, and matched by the pattern `%p`, on CP-1252\n    locales, but not on systems using a UTF-8 locale.\n\n    A reliable way to ensure unified handling of patterns and\n    character classes is to use the \"C\" locale by adding\n    `os.setlocale 'C'` to the top of the Lua script.\n\nString library is not Unicode aware\n:   Lua's `string` library treats each byte as a single\n    character. A function like `string.upper` will not have the\n    intended effect when applied to words with non-ASCII\n    characters. Similarly, a pattern like `[☃]` will match *any*\n    of the bytes `\\240`, `\\159`, `\\154`, and `\\178`, but\n    **won't** match the \"snowman\" Unicode character.\n\n    Use the [pandoc.text](#module-pandoc.text) module for Unicode-aware\n    transformation, and consider using using the lpeg or re\n    library for pattern matching.\n\n# Examples\n\nThe following filters are presented as examples. A repository of\nuseful Lua filters (which may also serve as good examples) is\navailable at <https://github.com/pandoc/lua-filters>.\n\n## Macro substitution\n\nThe following filter converts the string `{{helloworld}}` into\nemphasized text \"Hello, World\".\n\n``` lua\nreturn {\n  Str = function (elem)\n    if elem.text == \"{{helloworld}}\" then\n      return pandoc.Emph {pandoc.Str \"Hello, World\"}\n    else\n      return elem\n    end\n  end,\n}\n```\n\n## Center images in LaTeX and HTML output\n\nFor LaTeX, wrap an image in LaTeX snippets which cause the image\nto be centered horizontally. In HTML, the image element's style\nattribute is used to achieve centering.\n\n``` lua\n-- Filter images with this function if the target format is LaTeX.\nif FORMAT:match 'latex' then\n  function Image (elem)\n    -- Surround all images with image-centering raw LaTeX.\n    return {\n      pandoc.RawInline('latex', '\\\\hfill\\\\break{\\\\centering'),\n      elem,\n      pandoc.RawInline('latex', '\\\\par}')\n    }\n  end\nend\n\n-- Filter images with this function if the target format is HTML\nif FORMAT:match 'html' then\n  function Image (elem)\n    -- Use CSS style to center image\n    elem.attributes.style = 'margin:auto; display: block;'\n    return elem\n  end\nend\n```\n\n## Setting the date in the metadata\n\nThis filter sets the date in the document's metadata to the\ncurrent date, if a date isn't already set:\n\n``` lua\nfunction Meta(m)\n  if m.date == nil then\n    m.date = os.date(\"%B %e, %Y\")\n    return m\n  end\nend\n```\n\n## Remove spaces before citations\n\nThis filter removes all spaces preceding an \"author-in-text\"\ncitation. In Markdown, author-in-text citations (e.g.,\n`@citekey`), must be preceded by a space. If these spaces are\nundesired, they must be removed with a filter.\n\n``` lua\nlocal function is_space_before_author_in_text(spc, cite)\n  return spc and spc.t == 'Space'\n    and cite and cite.t == 'Cite'\n    -- there must be only a single citation, and it must have\n    -- mode 'AuthorInText'\n    and #cite.citations == 1\n    and cite.citations[1].mode == 'AuthorInText'\nend\n\nfunction Inlines (inlines)\n  -- Go from end to start to avoid problems with shifting indices.\n  for i = #inlines-1, 1, -1 do\n    if is_space_before_author_in_text(inlines[i], inlines[i+1]) then\n      inlines:remove(i)\n    end\n  end\n  return inlines\nend\n```\n\n## Replacing placeholders with their metadata value\n\nLua filter functions are run in the order\n\n> *Inlines → Blocks → Meta → Pandoc*.\n\nPassing information from a higher level (e.g., metadata) to a\nlower level (e.g., inlines) is still possible by using two\nfilters living in the same file:\n\n``` lua\nlocal vars = {}\n\nlocal function get_vars (meta)\n  for k, v in pairs(meta) do\n    if pandoc.utils.type(v) == 'Inlines' then\n      vars[\"%\" .. k .. \"%\"] = {table.unpack(v)}\n    end\n  end\nend\n\nlocal function replace (el)\n  if vars[el.text] then\n    return pandoc.Span(vars[el.text])\n  else\n    return el\n  end\nend\n\nfunction Pandoc(doc)\n  return doc:walk { Meta = get_vars }:walk { Str = replace }\nend\n```\n\nIf the contents of file `occupations.md` are\n\n``` markdown\n---\nname: Samuel Q. Smith\noccupation: Professor of Oenology\n---\n\nName\n\n:   %name%\n\nOccupation\n\n:   %occupation%\n```\n\nthen running `pandoc --lua-filter=meta-vars.lua occupations.md`\nwill output:\n\n``` html\n<dl>\n<dt>Name</dt>\n<dd><p><span>Samuel Q. Smith</span></p>\n</dd>\n<dt>Occupation</dt>\n<dd><p><span>Professor of Oenology</span></p>\n</dd>\n</dl>\n```\nNote that the placeholders must not contain any spaces, otherwise\nthey will turn into two separate Str elements and the filter\nwon't work.\n\n## Modifying pandoc's `MANUAL.txt` for man pages\n\nThis is the filter we use when converting `MANUAL.txt` to man\npages. It converts level-1 headers to uppercase (using\n[`walk`](#type-block:walk) to transform inline elements inside\nheaders), removes footnotes, and replaces links with regular\ntext.\n\n``` lua\n-- we use pandoc.text to get a UTF-8 aware 'upper' function\nlocal text = pandoc.text\n\nfunction Header(el)\n    if el.level == 1 then\n      return el:walk {\n        Str = function(el)\n            return pandoc.Str(text.upper(el.text))\n        end\n      }\n    end\nend\n\nfunction Link(el)\n    return el.content\nend\n\nfunction Note(el)\n    return {}\nend\n```\n\n## Creating a handout from a paper\n\nThis filter extracts all the numbered examples, section headers,\nblock quotes, and figures from a document, in addition to any\ndivs with class `handout`. (Note that only blocks at the \"outer\nlevel\" are included; this ignores blocks inside nested\nconstructs, like list items.)\n\n``` lua\n-- creates a handout from an article, using its headings,\n-- blockquotes, numbered examples, figures, and any\n-- Divs with class \"handout\"\n\nfunction Pandoc(doc)\n    local hblocks = {}\n    for i,el in pairs(doc.blocks) do\n        if (el.t == \"Div\" and el.classes[1] == \"handout\") or\n           (el.t == \"BlockQuote\") or\n           (el.t == \"OrderedList\" and el.style == \"Example\") or\n           (el.t == \"Para\" and #el.c == 1 and el.c[1].t == \"Image\") or\n           (el.t == \"Header\") then\n           table.insert(hblocks, el)\n        end\n    end\n    return pandoc.Pandoc(hblocks, doc.meta)\nend\n```\n\n## Counting words in a document\n\nThis filter counts the words in the body of a document (omitting\nmetadata like titles and abstracts), including words in code. It\nshould be more accurate than `wc -w` run directly on a Markdown\ndocument, since the latter will count markup characters, like\nthe `#` in front of an ATX header, or tags in HTML documents, as\nwords. To run it, `pandoc --lua-filter wordcount.lua myfile.md`.\n\n``` lua\n-- counts words in a document\n\nwords = 0\n\nwordcount = {\n  Str = function(el)\n    -- we don't count a word if it's entirely punctuation:\n    if el.text:match(\"%P\") then\n        words = words + 1\n    end\n  end,\n\n  Code = function(el)\n    _,n = el.text:gsub(\"%S+\",\"\")\n    words = words + n\n  end,\n\n  CodeBlock = function(el)\n    _,n = el.text:gsub(\"%S+\",\"\")\n    words = words + n\n  end\n}\n\nfunction Pandoc(el)\n    -- skip metadata, just count body:\n    el.blocks:walk(wordcount)\n    print(words .. \" words in body\")\n    os.exit(0)\nend\n```\n\n## Creating a table\n\nThis filter creates a document that contains the following \ntable with 5 columns. It serves as a working example of how \nto use the [`pandoc.Table`](#pandoc.Table) constructor. \n\n+--------+--------+--------+--------+---+\n| This   | is my  | table  | header |   |\n+========+:=======+:======:+=======:+===+\n| Cell 1 | Cell 2 | Cell 3 |        |   |\n+--------+--------+--------+--------+---+\n| Cell 4 | Cell 5 | Cell 6 |        |   |\n+========+========+========+========+===+\n| This is my table footer.          |   |\n+===================================+===+\n\n: This is my table caption.\n\nNote that:\n\n- The number of columns in the resulting Table element is \n  equal to the number of entries in the `colspecs` parameter.\n\n- A [ColSpec] object must contain the cell alignment, but the \n  column width is optional.\n\n- A [TableBody] object is specified using a Lua table in the \n  `bodies` parameter because there is no `pandoc.TableBody` \n  constructor.\n\n```lua\nfunction Pandoc ()\n  local caption = pandoc.Caption( \"This is my table caption.\" )\n  local colspecs = {\n    { pandoc.AlignLeft },\n    { pandoc.AlignDefault }, \n    { pandoc.AlignCenter }, \n    { pandoc.AlignRight },\n    { pandoc.AlignDefault }\n  }\n  local head = pandoc.TableHead{\n    pandoc.Row{\n      pandoc.Cell( \"This\" ), \n      pandoc.Cell( \"is my\" ), \n      pandoc.Cell( \"table\" ),\n      pandoc.Cell( \"header\" )\n    }\n  }\n  local bodies = {\n    {\n      attr={},\n      body={ \n        pandoc.Row{\n          pandoc.Cell( \"Cell 1\" ), \n          pandoc.Cell( \"Cell 2\" ), \n          pandoc.Cell( \"Cell 3\" )\n        },\n        pandoc.Row{\n          pandoc.Cell( \"Cell 4\" ), \n          pandoc.Cell( \"Cell 5\" ), \n          pandoc.Cell( \"Cell 6\" )\n        }\n      },\n      head={},\n      row_head_columns=0\n    }\n  }\n  local foot = pandoc.TableFoot{\n    pandoc.Row{\n      pandoc.Cell( \"This is my table footer.\", pandoc.AlignDefault, 1, 4 )\n    }\n  }\n  return pandoc.Pandoc { \n    pandoc.Table(caption, colspecs, head, bodies, foot) \n  }\nend\n```\n\n## Extracting links from a document\n\nThis filter creates a document containing a table that lists\nthe URLs the input document links to, together with the \nnumber of links to each URL.\n\n```lua\nlinks = {}\n\nfunction Link (el)\n  if links[el.target] then\n    links[el.target] = links[el.target] + 1\n  else\n    links[el.target] = 1\n  end\n  return el\nend\n\nfunction Pandoc ()\n  local caption = pandoc.Caption(\"Link count.\")\n  local colspecs = { \n    { pandoc.AlignDefault, 0.8 }, \n    { pandoc.AlignLeft, 0.2 }\n  }\n  local head = pandoc.TableHead{\n    pandoc.Row{ pandoc.Cell(\"Target\"), pandoc.Cell(\"Count\") }\n  }\n  local foot = pandoc.TableFoot()\n  local rows = {}\n  for link, count in pairs(links) do\n    rows[#rows + 1] = pandoc.Row{ \n        pandoc.Cell( link ), \n        pandoc.Cell( pandoc.utils.stringify(count) ) \n    }\n  end\n  local bodies = {\n    {\n      attr={},\n      body=rows,\n      head={},\n      row_head_columns=0\n    }\n  }\n  return pandoc.Pandoc {\n    pandoc.Table(caption, colspecs, head, bodies, foot)\n  }\nend\n```\n\n## Converting ABC code to music notation\n\nThis filter replaces code blocks with class `abc` with images\ncreated by running their contents through `abcm2ps` and\nImageMagick's `convert`. (For more on ABC notation, see\n<https://abcnotation.com>.)\n\nImages are added to the mediabag. For output to binary formats,\npandoc will use images in the mediabag. For textual formats, use\n`--extract-media` to specify a directory where the files in the\nmediabag will be written, or (for HTML only) use\n`--embed-resources`.\n\n``` lua\n-- Pandoc filter to process code blocks with class \"abc\" containing\n-- ABC notation into images.\n--\n-- * Assumes that abcm2ps and ImageMagick's convert are in the path.\n-- * For textual output formats, use --extract-media=abc-images\n-- * For HTML formats, you may alternatively use --embed-resources\n\nlocal filetypes = { html = {\"png\", \"image/png\"}\n                  , latex = {\"pdf\", \"application/pdf\"}\n                  }\nlocal filetype = filetypes[FORMAT][1] or \"png\"\nlocal mimetype = filetypes[FORMAT][2] or \"image/png\"\n\nlocal function abc2eps(abc, filetype)\n    local eps = pandoc.pipe(\"abcm2ps\", {\"-q\", \"-O\", \"-\", \"-\"}, abc)\n    local final = pandoc.pipe(\"convert\", {\"-\", filetype .. \":-\"}, eps)\n    return final\nend\n\nfunction CodeBlock(block)\n    if block.classes[1] == \"abc\" then\n        local img = abc2eps(block.text, filetype)\n        local fname = pandoc.sha1(img) .. \".\" .. filetype\n        pandoc.mediabag.insert(fname, mimetype, img)\n        return pandoc.Para{ pandoc.Image({pandoc.Str(\"abc tune\")}, fname) }\n    end\nend\n```\n\n## Building images with Ti*k*Z\n\nThis filter converts raw LaTeX Ti*k*Z environments into images. It\nworks with both PDF and HTML output. The Ti*k*Z code is compiled\nto an image using `pdflatex`, and the image is converted from\npdf to svg format using\n[`pdf2svg`](https://github.com/dawbarton/pdf2svg), so both of\nthese must be in the system path. Converted images are cached in\nthe working directory and given filenames based on a hash of the\nsource, so that they need not be regenerated each time the\ndocument is built. (A more sophisticated version of this might\nput these in a special cache directory.)\n\n``` lua\nlocal system = require 'pandoc.system'\n\nlocal tikz_doc_template = [[\n\\documentclass{standalone}\n\\usepackage{xcolor}\n\\usepackage{tikz}\n\\begin{document}\n\\nopagecolor\n%s\n\\end{document}\n]]\n\nlocal function tikz2image(src, filetype, outfile)\n  system.with_temporary_directory('tikz2image', function (tmpdir)\n    system.with_working_directory(tmpdir, function()\n      local f = io.open('tikz.tex', 'w')\n      f:write(tikz_doc_template:format(src))\n      f:close()\n      os.execute('pdflatex tikz.tex')\n      if filetype == 'pdf' then\n        os.rename('tikz.pdf', outfile)\n      else\n        os.execute('pdf2svg tikz.pdf ' .. outfile)\n      end\n    end)\n  end)\nend\n\nextension_for = {\n  html = 'svg',\n  html4 = 'svg',\n  html5 = 'svg',\n  latex = 'pdf',\n  beamer = 'pdf' }\n\nlocal function file_exists(name)\n  local f = io.open(name, 'r')\n  if f ~= nil then\n    io.close(f)\n    return true\n  else\n    return false\n  end\nend\n\nlocal function starts_with(start, str)\n  return str:sub(1, #start) == start\nend\n\n\nfunction RawBlock(el)\n  if starts_with('\\\\begin{tikzpicture}', el.text) then\n    local filetype = extension_for[FORMAT] or 'svg'\n    local fbasename = pandoc.sha1(el.text) .. '.' .. filetype\n    local fname = system.get_working_directory() .. '/' .. fbasename\n    if not file_exists(fname) then\n      tikz2image(el.text, filetype, fname)\n    end\n    return pandoc.Para({pandoc.Image({}, fbasename)})\n  else\n   return el\n  end\nend\n```\n\nExample of use:\n\n    pandoc --lua-filter tikz.lua -s -o cycle.html <<EOF\n    Here is a diagram of the cycle:\n\n    \\begin{tikzpicture}\n\n    \\def \\n {5}\n    \\def \\radius {3cm}\n    \\def \\margin {8} % margin in angles, depends on the radius\n\n    \\foreach \\s in {1,...,\\n}\n    {\n      \\node[draw, circle] at ({360/\\n * (\\s - 1)}:\\radius) {$\\s$};\n      \\draw[->, >=latex] ({360/\\n * (\\s - 1)+\\margin}:\\radius)\n        arc ({360/\\n * (\\s - 1)+\\margin}:{360/\\n * (\\s)-\\margin}:\\radius);\n    }\n    \\end{tikzpicture}\n    EOF\n\n# Lua type reference\n\nThis section describes the types of objects available to Lua\nfilters. See the [pandoc module](#module-pandoc) for\nfunctions to create these objects.\n\n## Shared Properties\n\n### `clone`\n\n`clone ()`\n\nAll instances of the types listed here, with the exception of\nread-only objects, can be cloned via the `clone()` method.\n\nUsage:\n\n    local emph = pandoc.Emph {pandoc.Str 'important'}\n    local cloned_emph = emph:clone()  -- note the colon\n\n## Pandoc {#type-pandoc}\n\nPandoc document\n\nValues of this type can be created with the\n[`pandoc.Pandoc`](#pandoc.Pandoc) constructor. Pandoc values are\nequal in Lua if and only if they are equal in Haskell.\n\n`blocks`\n:   document content ([Blocks][])\n\n`meta`\n:   document meta information ([Meta] object)\n\n### Methods {#type-pandoc-methods}\n\n#### normalize\n\n`normalize(self)`\n\nPerform a normalization of Pandoc documents. E.g., multiple\nsuccessive spaces are collapsed, and tables are normalized, so\nthat all rows and columns contain the same number of cells.\n\nParameters:\n\n`self`\n:   the element ([Pandoc][])\n\nResults:\n\n-   cloned and normalized document. ([Pandoc][])\n\n### walk {#type-pandoc:walk}\n\n`walk(self, lua_filter)`\n\nApplies a Lua filter to the Pandoc element. Just as for\nfull-document filters, the order in which elements are traversed\ncan be controlled by setting the `traverse` field of the filter;\nsee the section on [traversal order][Traversal order]. Returns a\n(deep) copy on which the filter has been applied: the original\nelement is left untouched.\n\nParameters:\n\n`self`\n:   the element ([Pandoc](#type-pandoc))\n\n`lua_filter`\n:   map of filter functions (table)\n\nResult:\n\n-   filtered document ([Pandoc][])\n\nUsage:\n\n    -- returns `pandoc.Pandoc{pandoc.Para{pandoc.Str 'Bye'}}`\n    return pandoc.Pandoc{pandoc.Para('Hi')}:walk {\n      Str = function (_) return 'Bye' end,\n    }\n\n\n## Meta {#type-meta}\n\nMeta information on a document; string-indexed collection of\n[MetaValues].\n\nValues of this type can be created with the\n[`pandoc.Meta`](#pandoc.meta) constructor. Meta values are equal\nin Lua if and only if they are equal in Haskell.\n\n## MetaValue {#type-metavalue}\n\nDocument meta information items. This is not a separate type, but\ndescribes a set of types that can be used in places were a\nMetaValue is expected. The types correspond to the following\nHaskell type constructors:\n\n- boolean → MetaBool\n- string or number → MetaString\n- Inlines → MetaInlines\n- Blocks → MetaBlocks\n- List/integer indexed table → MetaList\n- string-indexed table → MetaMap\n\nThe corresponding constructors\n[`pandoc.MetaBool`](#pandoc.metabool),\n[`pandoc.MetaString`](#pandoc.metastring),\n[`pandoc.MetaInlines`](#pandoc.metainlines),\n[`pandoc.MetaBlocks`](#pandoc.metablocks),\n[`pandoc.MetaList`](#pandoc.metalist), and\n[`pandoc.MetaMap`](#pandoc.metamap)\ncan be used to ensure that a value is treated in the intended\nway. E.g., an empty table is normally treated as a `MetaMap`, but\ncan be made into an empty `MetaList` by calling\n`pandoc.MetaList{}`. However, the same can be accomplished by\nusing the generic functions like `pandoc.List`, `pandoc.Inlines`,\nor `pandoc.Blocks`.\n\nUse the function [`pandoc.utils.type`](#pandoc.utils.type) to\nget the type of a metadata value.\n\n## Block {#type-block}\n\nBlock values are equal in Lua if and only if they are equal in\nHaskell.\n\n### Common methods\n\n#### walk {#type-block:walk}\n\n`walk(self, lua_filter)`\n\nApplies a Lua filter to the block element. Just as for\nfull-document filters, the order in which elements are traversed\ncan be controlled by setting the `traverse` field of the filter;\nsee the section on [traversal order][Traversal order]. Returns a\n(deep) copy on which the filter has been applied: the original\nelement is left untouched.\n\nNote that the filter is applied to the subtree, but not to the\n`self` block element. The rationale is that otherwise the element\ncould be deleted by the filter, or replaced with multiple block\nelements, which might lead to possibly unexpected results.\n\nParameters:\n\n`self`\n:   the element ([Block](#type-block))\n\n`lua_filter`\n:   map of filter functions (table)\n\nResult:\n\n-   filtered block ([Block][])\n\nUsage:\n\n    -- returns `pandoc.Para{pandoc.Str 'Bye'}`\n    return pandoc.Para('Hi'):walk {\n      Str = function (_) return 'Bye' end,\n    }\n\n\n### BlockQuote {#type-blockquote}\n\nA block quote element.\n\nValues of this type can be created with the\n[`pandoc.BlockQuote`](#pandoc.BlockQuote) constructor.\n\nFields:\n\n`content`\n:   block content ([Blocks][])\n\n`tag`, `t`\n:   the literal `BlockQuote` (string)\n\n### BulletList {#type-bulletlist}\n\nA bullet list.\n\nValues of this type can be created with the\n[`pandoc.BulletList`](#pandoc.BulletList) constructor.\n\nFields:\n\n`content`\n:   list items ([List] of items, i.e., [List] of [Blocks][])\n\n`tag`, `t`\n:   the literal `BulletList` (string)\n\n### CodeBlock {#type-codeblock}\n\nBlock of code.\n\nValues of this type can be created with the\n[`pandoc.CodeBlock`](#pandoc.CodeBlock) constructor.\n\nFields:\n\n`text`\n:   code string (string)\n\n`attr`\n:   element attributes ([Attr])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `CodeBlock` (string)\n\n### DefinitionList {#type-definitionlist}\n\nDefinition list, containing terms and their explanation.\n\nValues of this type can be created with the\n[`pandoc.DefinitionList`](#pandoc.DefinitionList) constructor.\n\nFields:\n\n`content`\n:   list of items\n\n`tag`, `t`\n:   the literal `DefinitionList` (string)\n\n### Div {#type-div}\n\nGeneric block container with attributes.\n\nValues of this type can be created with the\n[`pandoc.Div`](#pandoc.Div) constructor.\n\nFields:\n\n`content`\n:   block content ([Blocks][])\n\n`attr`\n:   element attributes ([Attr])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of\n    strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `Div` (string)\n\n### Figure {#type-figure}\n\nFigure with caption and arbitrary block contents.\n\nValues of this type can be created with the\n[`pandoc.Figure`](#pandoc.Figure) constructor.\n\nFields:\n\n`content`\n:   block content ([Blocks][])\n\n`caption`\n:   figure caption ([Caption][])\n\n`attr`\n:   element attributes ([Attr][])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List][] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes][])\n\n`tag`, `t`\n:   the literal `Figure` (string)\n\n### Header {#type-header}\n\nCreates a header element.\n\nValues of this type can be created with the\n[`pandoc.Header`](#pandoc.Header) constructor.\n\nFields:\n\n`level`\n:   header level (integer)\n\n`content`\n:   inline content ([Inlines][])\n\n`attr`\n:   element attributes ([Attr])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes`\n    ([Attributes])\n\n`tag`, `t`\n:   the literal `Header` (string)\n\n### HorizontalRule {#type-horizontalrule}\n\nA horizontal rule.\n\nValues of this type can be created with the\n[`pandoc.HorizontalRule`](#pandoc.HorizontalRule) constructor.\n\nFields:\n\n`tag`, `t`\n:   the literal `HorizontalRule` (string)\n\n### LineBlock {#type-lineblock}\n\nA line block, i.e. a list of lines, each separated from the next\nby a newline.\n\nValues of this type can be created with the\n[`pandoc.LineBlock`](#pandoc.LineBlock) constructor.\n\nFields:\n\n`content`\n:   inline content ([List] of lines, i.e. [List] of [Inlines][])\n\n`tag`, `t`\n:   the literal `LineBlock` (string)\n\n### OrderedList {#type-orderedlist}\n\nAn ordered list.\n\nValues of this type can be created with the\n[`pandoc.OrderedList`](#pandoc.OrderedList) constructor.\n\nFields:\n\n`content`\n:   list items ([List] of items, i.e., [List] of [Blocks][])\n\n`listAttributes`\n:   list parameters ([ListAttributes])\n\n`start`\n:   alias for `listAttributes.start` (integer)\n\n`style`\n:   alias for `listAttributes.style` (string)\n\n`delimiter`\n:   alias for `listAttributes.delimiter` (string)\n\n`tag`, `t`\n:   the literal `OrderedList` (string)\n\n### Para {#type-para}\n\nA paragraph.\n\nValues of this type can be created with the\n[`pandoc.Para`](#pandoc.Para) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Para` (string)\n\n### Plain {#type-plain}\n\nPlain text, not a paragraph.\n\nValues of this type can be created with the\n[`pandoc.Plain`](#pandoc.Plain) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Plain` (string)\n\n### RawBlock {#type-rawblock}\n\nRaw content of a specified format.\n\nValues of this type can be created with the\n[`pandoc.RawBlock`](#pandoc.RawBlock) constructor.\n\nFields:\n\n`format`\n:   format of content (string)\n\n`text`\n:   raw content (string)\n\n`tag`, `t`\n:   the literal `RawBlock` (string)\n\n### Table {#type-table}\n\nA table.\n\nValues of this type can be created with the\n[`pandoc.Table`](#pandoc.Table) constructor.\n\nFields:\n\n`attr`\n:   table attributes ([Attr])\n\n`caption`\n:   table caption ([Caption])\n\n`colspecs`\n:   column specifications, i.e., alignments and widths ([List] of\n    [ColSpec]s)\n\n`head`\n:   table head ([TableHead])\n\n`bodies`\n:   table bodies ([List] of [TableBody]s)\n\n`foot`\n:   table foot ([TableFoot])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `Table` (string)\n\nA [table cell]{#type-table-cell} is a list of blocks.\n\n*[Alignment]{#type-alignment}* is a string value indicating the\nhorizontal alignment of a table column. `AlignLeft`,\n`AlignRight`, and `AlignCenter` leads cell content to be\nleft-aligned, right-aligned, and centered, respectively. The\ndefault alignment is `AlignDefault` (often equivalent to\ncentered).\n\n## Blocks {#type-blocks}\n\nList of [Block] elements, with the same methods as a generic\n[List](#type-list). It is usually not necessary to create values\nof this type in user scripts, as pandoc can convert other types\ninto Blocks wherever a value of this type is expected:\n\n-   a list of [Block] (or Block-like) values is used directly;\n-   a single [Inlines][] value is wrapped into a [Plain] element;\n-   string values are turned into an [Inlines][] value by splitting\n    the string into words (see [Inlines](#type-inlines)), and\n    then wrapping the result into a Plain singleton.\n\n### Methods\n\nLists of type `Blocks` share all methods available in generic\nlists, see the [`pandoc.List` module](#module-pandoc.list).\n\nAdditionally, the following methods are available on Blocks\nvalues:\n\n#### walk {#type-blocks:walk}\n\n`walk(self, lua_filter)`\n\nApplies a Lua filter to the Blocks list. Just as for\nfull-document filters, the order in which elements are traversed\ncan be controlled by setting the `traverse` field of the filter;\nsee the section on [traversal order][Traversal order]. Returns a\n(deep) copy on which the filter has been applied: the original\nlist is left untouched.\n\nParameters:\n\n`self`\n:   the list ([Blocks][])\n\n`lua_filter`\n:   map of filter functions (table)\n\nResult:\n\n-   filtered list ([Blocks][])\n\nUsage:\n\n    -- returns `pandoc.Blocks{pandoc.Para('Salve!')}`\n    return pandoc.Blocks{pandoc.Plain('Salve!)}:walk {\n      Plain = function (p) return pandoc.Para(p.content) end,\n    }\n\n## Inline {#type-inline}\n\nInline values are equal in Lua if and only if they are equal in\nHaskell.\n\n### Common methods\n\n#### walk {#type-inline:walk}\n\n`walk(self, lua_filter)`\n\nApplies a Lua filter to the Inline element. Just as for\nfull-document filters, the order in which elements are traversed\ncan be controlled by setting the `traverse` field of the filter;\nsee the section on [traversal order][Traversal order]. Returns a\n(deep) copy on which the filter has been applied: the original\nelement is left untouched.\n\nNote that the filter is applied to the subtree, but not to the\n`self` inline element. The rationale is that otherwise the\nelement could be deleted by the filter, or replaced with multiple\ninline elements, which might lead to possibly unexpected results.\n\nParameters:\n\n`self`\n:   the element ([Inline](#type-inline))\n\n`lua_filter`\n:   map of filter functions (table)\n\nResult:\n\n-   filtered inline element ([Inline][])\n\nUsage:\n\n    -- returns `pandoc.SmallCaps('SPQR)`\n    return pandoc.SmallCaps('spqr'):walk {\n      Str = function (s) return string.upper(s.text) end,\n    }\n\n### Cite {#type-cite}\n\nCitation.\n\nValues of this type can be created with the\n[`pandoc.Cite`](#pandoc.Cite) constructor.\n\nFields:\n\n`content`\n:   ([Inlines][])\n\n`citations`\n:   citation entries ([List] of [Citations])\n\n`tag`, `t`\n:   the literal `Cite` (string)\n\n### Code {#type-code}\n\nInline code\n\nValues of this type can be created with the\n[`pandoc.Code`](#pandoc.Code) constructor.\n\nFields:\n\n`text`\n:   code string (string)\n\n`attr`\n:   attributes ([Attr])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `Code` (string)\n\n### Emph {#type-emph}\n\nEmphasized text\n\nValues of this type can be created with the\n[`pandoc.Emph`](#pandoc.Emph) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Emph` (string)\n\n### Image {#type-image}\n\nImage: alt text (list of inlines), target\n\nValues of this type can be created with the\n[`pandoc.Image`](#pandoc.Image) constructor.\n\nFields:\n\n`caption`\n:   text used to describe the image ([Inlines][])\n\n`src`\n:   path to the image file (string)\n\n`title`\n:   brief image description (string)\n\n`attr`\n:   attributes ([Attr])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `Image` (string)\n\n### LineBreak {#type-linebreak}\n\nHard line break\n\nValues of this type can be created with the\n[`pandoc.LineBreak`](#pandoc.LineBreak) constructor.\n\nFields:\n\n`tag`, `t`\n:   the literal `LineBreak` (string)\n\n### Link {#type-link}\n\nHyperlink: alt text (list of inlines), target\n\nValues of this type can be created with the\n[`pandoc.Link`](#pandoc.Link) constructor.\n\nFields:\n\n`attr`\n:   attributes ([Attr])\n\n`content`\n:   text for this link ([Inlines][])\n\n`target`\n:   the link target (string)\n\n`title`\n:   brief link description\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `Link` (string)\n\n### Math {#type-math}\n\nTeX math (literal)\n\nValues of this type can be created with the\n[`pandoc.Math`](#pandoc.Math) constructor.\n\nFields:\n\n`mathtype`\n:   specifier determining whether the math content should be\n    shown inline (`InlineMath`) or on a separate line\n    (`DisplayMath`) (string)\n\n`text`\n:   math content (string)\n\n`tag`, `t`\n:   the literal `Math` (string)\n\n### Note {#type-note}\n\nFootnote or endnote\n\nValues of this type can be created with the\n[`pandoc.Note`](#pandoc.Note) constructor.\n\nFields:\n\n`content`\n:   ([Blocks][])\n\n`tag`, `t`\n:   the literal `Note` (string)\n\n### Quoted {#type-quoted}\n\nQuoted text\n\nValues of this type can be created with the\n[`pandoc.Quoted`](#pandoc.Quoted) constructor.\n\nFields:\n\n`quotetype`\n:   type of quotes to be used; one of `SingleQuote` or\n    `DoubleQuote` (string)\n\n`content`\n:   quoted text ([Inlines][])\n\n`tag`, `t`\n:   the literal `Quoted` (string)\n\n### RawInline {#type-rawinline}\n\nRaw inline\n\nValues of this type can be created with the\n[`pandoc.RawInline`](#pandoc.RawInline) constructor.\n\nFields:\n\n`format`\n:   the format of the content (string)\n\n`text`\n:   raw content (string)\n\n`tag`, `t`\n:   the literal `RawInline` (string)\n\n### SmallCaps {#type-smallcaps}\n\nSmall caps text\n\nValues of this type can be created with the\n[`pandoc.SmallCaps`](#pandoc.Smallcaps) constructor.\n\nFields:\n\n`content`\n:   ([Inlines][])\n\n`tag`, `t`\n:   the literal `SmallCaps` (string)\n\n### SoftBreak {#type-softbreak}\n\nSoft line break\n\nValues of this type can be created with the\n[`pandoc.SoftBreak`](#pandoc.Softbreak) constructor.\n\nFields:\n\n`tag`, `t`\n:   the literal `SoftBreak` (string)\n\n### Space {#type-space}\n\nInter-word space\n\nValues of this type can be created with the\n[`pandoc.Space`](#pandoc.Space) constructor.\n\nFields:\n\n`tag`, `t`\n:   the literal `Space` (string)\n\n### Span {#type-span}\n\nGeneric inline container with attributes\n\nValues of this type can be created with the\n[`pandoc.Span`](#pandoc.Span) constructor.\n\nFields:\n\n`attr`\n:   attributes ([Attr])\n\n`content`\n:   wrapped content ([Inlines][])\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n`tag`, `t`\n:   the literal `Span` (string)\n\n### Str {#type-str}\n\nText\n\nValues of this type can be created with the\n[`pandoc.Str`](#pandoc.Str) constructor.\n\nFields:\n\n`text`\n:   content (string)\n\n`tag`, `t`\n:   the literal `Str` (string)\n\n### Strikeout {#type-strikeout}\n\nStrikeout text\n\nValues of this type can be created with the\n[`pandoc.Strikeout`](#pandoc.Strikeout) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Strikeout` (string)\n\n### Strong {#type-strong}\n\nStrongly emphasized text\n\nValues of this type can be created with the\n[`pandoc.Strong`](#pandoc.Strong) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Strong` (string)\n\n### Subscript {#type-subscript}\n\nSubscripted text\n\nValues of this type can be created with the\n[`pandoc.Subscript`](#pandoc.Subscript) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Subscript` (string)\n\n### Superscript {#type-superscript}\n\nSuperscripted text\n\nValues of this type can be created with the\n[`pandoc.Superscript`](#pandoc.Superscript) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Superscript` (string)\n\n### Underline {#type-underline}\n\nUnderlined text\n\nValues of this type can be created with the\n[`pandoc.Underline`](#pandoc.Underline) constructor.\n\nFields:\n\n`content`\n:   inline content ([Inlines][])\n\n`tag`, `t`\n:   the literal `Underline` (string)\n\n## Inlines {#type-inlines}\n\nList of [Inline] elements, with the same methods as a generic\n[List](#type-list). It is usually not necessary to create values\nof this type in user scripts, as pandoc can convert other types\ninto Inlines wherever a value of this type is expected:\n\n-   lists of [Inline] (or Inline-like) values are used directly;\n-   single [Inline] values are converted into a list containing\n    just that element;\n-   String values are split into words, converting line breaks\n    into [SoftBreak](#type-softbreak) elements, and other\n    whitespace characters into [Spaces](#type-space).\n\n### Methods\n\nLists of type `Inlines` share all methods available in generic\nlists, see the [`pandoc.List` module](#module-pandoc.list).\n\nAdditionally, the following methods are available on *Inlines*\nvalues:\n\n#### walk {#type-inlines:walk}\n\n`walk(self, lua_filter)`\n\nApplies a Lua filter to the Inlines list. Just as for\nfull-document filters, the order in which elements are handled\nare Inline → Inlines → Block → Blocks. The filter is applied\nto all list items *and* to the list itself. Returns a (deep)\ncopy on which the filter has been applied: the original list is\nleft untouched.\n\nParameters:\n\n`self`\n:   the list ([Inlines](#type-inlines))\n\n`lua_filter`\n:   map of filter functions (table)\n\nResult:\n\n-   filtered list ([Inlines](#type-inlines))\n\nUsage:\n\n    -- returns `pandoc.Inlines{pandoc.SmallCaps('SPQR')}`\n    return pandoc.Inlines{pandoc.Emph('spqr')}:walk {\n      Str = function (s) return string.upper(s.text) end,\n      Emph = function (e) return pandoc.SmallCaps(e.content) end,\n    }\n\n\n## Element components\n\n### Attr {#type-attr}\n\nA set of element attributes. Values of this type can be created\nwith the [`pandoc.Attr`](#pandoc.Attr) constructor. For\nconvenience, it is usually not necessary to construct the value\ndirectly if it is part of an element, and it is sufficient to\npass an HTML-like table. E.g., to create a span with identifier\n\"text\" and classes \"a\" and \"b\", one can write:\n\n    local span = pandoc.Span('text', {id = 'text', class = 'a b'})\n\nThis also works when using the `attr` setter:\n\n    local span = pandoc.Span 'text'\n    span.attr = {id = 'text', class = 'a b', other_attribute = '1'}\n\nAttr values are equal in Lua if and only if they are equal in\nHaskell.\n\nFields:\n\n`identifier`\n:   element identifier (string)\n\n`classes`\n:   element classes ([List] of strings)\n\n`attributes`\n:   collection of key/value pairs ([Attributes])\n\n### Attributes {#type-attributes}\n\nList of key/value pairs. Values can be accessed by using keys as\nindices to the list table.\n\nAttributes values are equal in Lua if and only if they are equal\nin Haskell.\n\n### Caption {#type-caption}\n\nThe caption of a table, with an optional short caption.\n\nFields:\n\n`long`\n:   long caption ([Blocks][])\n\n`short`\n:   short caption ([Inlines][])\n\n### Cell {#type-cell}\n\nA table cell.\n\nFields:\n\n`attr`\n:   cell attributes\n\n`alignment`\n:   individual cell alignment ([Alignment]).\n\n`contents`\n:   cell contents ([Blocks][]).\n\n`col_span`\n:   number of columns spanned by the cell; the width of the cell\n    in columns (integer).\n\n`row_span`\n:   number of rows spanned by the cell; the height of the cell in\n    rows (integer).\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes])\n\n### Citation {#type-citation}\n\nSingle citation entry\n\nValues of this type can be created with the\n[`pandoc.Citation`](#pandoc.citation) constructor.\n\nCitation values are equal in Lua if and only if they are equal in\nHaskell.\n\nFields:\n\n`id`\n:   citation identifier, e.g., a bibtex key (string)\n\n`mode`\n:   citation mode, one of `AuthorInText`, `SuppressAuthor`, or\n    `NormalCitation` (string)\n\n`prefix`\n:   citation prefix ([Inlines][])\n\n`suffix`\n:   citation suffix ([Inlines][])\n\n`note_num`\n:   note number (integer)\n\n`hash`\n:   hash (integer)\n\n### ColSpec {#type-colspec}\n\nColumn alignment and width specification for a single table\ncolumn.\n\nThis is a pair, i.e., a plain table, with the following\ncomponents:\n\n1. cell alignment ([Alignment]).\n2. table column width, as a fraction of the page width (number).\n\n### ListAttributes {#type-listattributes}\n\nList attributes\n\nValues of this type can be created with the\n[`pandoc.ListAttributes`](#pandoc.ListAttributes) constructor.\n\nFields:\n\n`start`\n:   number of the first list item (integer)\n\n`style`\n:   style used for list numbers; possible values are\n    `DefaultStyle`, `Example`, `Decimal`, `LowerRoman`,\n    `UpperRoman`, `LowerAlpha`, and `UpperAlpha` (string)\n\n`delimiter`\n:   delimiter of list numbers; one of `DefaultDelim`, `Period`,\n    `OneParen`, and `TwoParens` (string)\n\n### Row {#type-row}\n\nA table row.\n\nFields:\n\n`attr`\n:   element attributes ([Attr][])\n\n`cells`\n:   list of table cells ([List][] of [Cell][]s)\n\n### TableBody {#type-tablebody}\n\nA body of a table, with an intermediate head and the specified\nnumber of row header columns.\n\nFields:\n\n`attr`\n:   table body attributes ([Attr][])\n\n`body`\n:   table body rows ([List][] of [Row][]s)\n\n`head`\n:   intermediate head ([List][] of [Row][]s)\n\n`row_head_columns`\n:   number of columns taken up by the row head of each row of a\n    [TableBody][]. The row body takes up the remaining columns.\n\n### TableFoot {#type-tablefoot}\n\nThe foot of a table.\n\nFields:\n\n`attr`\n:   element attributes ([Attr][])\n\n`rows`\n:   list of rows ([List][] of [Row][]s)\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List][] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes][])\n\n### TableHead {#type-tablehead}\n\nThe head of a table.\n\nFields:\n\n`attr`\n:   element attributes ([Attr][])\n\n`rows`\n:   list of rows ([List][] of [Row][]s)\n\n`identifier`\n:   alias for `attr.identifier` (string)\n\n`classes`\n:   alias for `attr.classes` ([List][] of strings)\n\n`attributes`\n:   alias for `attr.attributes` ([Attributes][])\n\n## ReaderOptions {#type-readeroptions}\n\nPandoc reader options\n\nFields:\n\n`abbreviations`\n:   set of known abbreviations (set of strings)\n\n`columns`\n:   number of columns in terminal (integer)\n\n`default_image_extension`\n:   default extension for images (string)\n\n`extensions`\n:   string representation of the syntax extensions bit field\n    (sequence of strings)\n\n`indented_code_classes`\n:   default classes for indented code blocks (list of strings)\n\n`standalone`\n:   whether the input was a standalone document with header\n    (boolean)\n\n`strip_comments`\n:   HTML comments are stripped instead of parsed as raw HTML\n    (boolean)\n\n`tab_stop`\n:   width (i.e. equivalent number of spaces) of tab stops\n    (integer)\n\n`track_changes`\n:   track changes setting for docx; one of `accept-changes`,\n    `reject-changes`, and `all-changes` (string)\n\n## WriterOptions {#type-writeroptions}\n\nPandoc writer options\n\nFields:\n\n`chunk_template`\n:   Template used to generate chunked HTML filenames (string)\n\n`cite_method`\n:   How to print cites -- one of 'citeproc', 'natbib', or\n    'biblatex' (string)\n\n`columns`\n:   Characters in a line (for text wrapping) (integer)\n\n`dpi`\n:   DPI for pixel to/from inch/cm conversions (integer)\n\n`email_obfuscation`\n:   How to obfuscate emails -- one of 'none', 'references', or\n    'javascript' (string)\n\n`epub_chapter_level`\n:   Header level for chapters, i.e., how the document is split\n    into separate files (integer)\n\n`epub_fonts`\n:   Paths to fonts to embed (sequence of strings)\n\n`epub_metadata`\n:   Metadata to include in EPUB (string|nil)\n\n`epub_subdirectory`\n:   Subdir for epub in OCF (string)\n\n`extensions`\n:   Markdown extensions that can be used (sequence of strings)\n\n`highlight_style`\n:   Style to use for highlighting; see the output of `pandoc\n    --print-highlight-style=...` for an example structure. The\n    value `nil` means that no highlighting is used. (table|nil)\n\n`html_math_method`\n:   How to print math in HTML; one of 'plain', 'mathjax',\n    'mathml', 'webtex', 'katex', 'gladtex', or a table with keys\n    `method` and `url`. (string|table)\n\n`html_q_tags`\n:   Use `<q>` tags for quotes in HTML (boolean)\n\n`identifier_prefix`\n:   Prefix for section & note ids in HTML and for footnote marks\n    in markdown (string)\n\n`incremental`\n:   True if lists should be incremental (boolean)\n\n`listings`\n:   Use listings package for code (boolean)\n\n`number_offset`\n:   Starting number for section, subsection, ... (sequence of\n    integers)\n\n`number_sections`\n:   Number sections in LaTeX (boolean)\n\n`prefer_ascii`\n:   Prefer ASCII representations of characters when possible\n    (boolean)\n\n`reference_doc`\n:   Path to reference document if specified (string|nil)\n\n`reference_links`\n:   Use reference links in writing markdown, rst (boolean)\n\n`reference_location`\n:   Location of footnotes and references for writing markdown;\n    one of 'end-of-block', 'end-of-section', 'end-of-document'.\n    The common prefix may be omitted when setting this value.\n    (string)\n\n`section_divs`\n:   Put sections in div tags in HTML (boolean)\n\n`setext_headers`\n:   Use setext headers for levels 1-2 in markdown (boolean)\n\n`slide_level`\n:   Force header level of slides (integer\\|nil)\n\n`tab_stop`\n:   Tabstop for conversion btw spaces and tabs (integer)\n\n`table_of_contents`\n:   Include table of contents (boolean)\n\n`template`\n:   Template to use ([Template](#type-template)|nil)\n\n`toc_depth`\n:   Number of levels to include in TOC (integer)\n\n`top_level_division`\n:   Type of top-level divisions; one of 'top-level-part',\n    'top-level-chapter', 'top-level-section', or\n    'top-level-default'. The prefix `top-level` may be omitted\n    when setting this value. (string)\n\n`variables`\n:   Variables to set in template; string-indexed table (table)\n\n`wrap_text`\n:   Option for wrapping text; one of 'wrap-auto', 'wrap-none',\n    or 'wrap-preserve'. The `wrap-` prefix may be omitted when\n    setting this value. (string)\n\n\n## CommonState {#type-commonstate}\n\nThe state used by pandoc to collect information and make it\navailable to readers and writers.\n\nFields:\n\n`input_files`\n:   List of input files from command line\n    ([List] of strings)\n\n`output_file`\n:   Output file from command line (string or nil)\n\n`log`\n:   A list of log messages ([List] of [LogMessage]s)\n\n`request_headers`\n:   Headers to add for HTTP requests; table with header names as\n    keys and header contents as value (table)\n\n`resource_path`\n:   Path to search for resources like included images\n    ([List] of strings)\n\n`source_url`\n:   Absolute URL or directory of first source file (string or\n    nil)\n\n`user_data_dir`\n:   Directory to search for data files (string or nil)\n\n`trace`\n:   Whether tracing messages are issued (boolean)\n\n`verbosity`\n:   Verbosity level; one of `INFO`, `WARNING`, `ERROR` (string)\n\n## Doc {#type-doc}\n\nReflowable plain-text document. A Doc value can be rendered and\nreflown to fit a given column width.\n\nThe [`pandoc.layout`](#module-pandoc.layout) module can be used to\ncreate and modify Doc values. All functions in that module that\ntake a Doc value as their first argument are also available as Doc\nmethods. E.g., `(pandoc.layout.literal 'text'):render()`.\n\nIf a string is passed to a function expecting a Doc, then the\nstring is treated as a literal value. I.e., the following two\nlines are equivalent:\n\n``` lua\ntest = pandoc.layout.quotes(pandoc.layout.literal 'this')\ntest = pandoc.layout.quotes('this')\n```\n### Operators {#type-doc-operators}\n\n#### `..` {#type-doc.__concat}\n\nConcatenate two `Doc` elements.\n\n#### `+` {#type-doc.__add}\n\nConcatenate two `Doc`s, inserting a reflowable space between them.\n\n#### `/` {#type-doc.__div}\n\nIf `a` and `b` are `Doc` elements, then `a / b` puts `a` above `b`.\n\n#### `//` {#type-doc.__idiv}\n\nIf `a` and `b` are `Doc` elements, then `a // b` puts `a` above\n`b`, inserting a blank line between them.\n\n\n## List {#type-list}\n\nA list is any Lua table with integer indices. Indices start at\none, so if `alist = {'value'}` then `alist[1] == 'value'`.\n\nLists, when part of an element, or when generated during\nmarshaling, are made instances of the `pandoc.List` type for\nconvenience. The `pandoc.List` type is defined in the\n[*pandoc.List*](#module-pandoc.list) module. See there for\navailable methods.\n\nValues of this type can be created with the\n[`pandoc.List`](#pandoc.list) constructor, turning a normal Lua\ntable into a List.\n\n## LogMessage {#type-logmessage}\n\nA pandoc log message. Objects have no fields, but can be\nconverted to a string via `tostring`.\n\n## SimpleTable {#type-simpletable}\n\nA simple table is a table structure which resembles the old (pre\npandoc 2.10) Table type. Bi-directional conversion from and to\n[Tables](#type-table) is possible with the\n[`pandoc.utils.to_simple_table`](#pandoc.utils.to_simple_table)\nand\n[`pandoc.utils.from_simple_table`](#pandoc.utils.from_simple_table)\nfunction, respectively. Instances of this type can also be created\ndirectly with the [`pandoc.SimpleTable`](#pandoc.simpletable)\nconstructor.\n\nFields:\n\n`caption`\n:   [Inlines][]\n\n`aligns`\n:   column alignments ([List] of [Alignments](#type-alignment))\n\n`widths`\n:   column widths; a  ([List] of numbers)\n\n`headers`\n:   table header row ([List] of simple cells, i.e., [List] of\n    [Blocks][])\n\n`rows`\n:   table rows ([List] of rows, where a row is a list of simple\n    cells, i.e., [List] of [Blocks][])\n\n## Template {#type-template}\n\nOpaque type holding a compiled template.\n\n## Version {#type-version}\n\nA version object. This represents a software version like\n\"2.7.3\". The object behaves like a numerically indexed table,\ni.e., if `version` represents the version `2.7.3`, then\n\n    version[1] == 2\n    version[2] == 7\n    version[3] == 3\n    #version == 3   -- length\n\nComparisons are performed element-wise, i.e.\n\n    Version '1.12' > Version '1.9'\n\nValues of this type can be created with the\n[`pandoc.types.Version`](#pandoc.types.Version) constructor.\n\n### `must_be_at_least`\n\n`must_be_at_least(actual, expected [, error_message])`\n\nRaise an error message if the actual version is older than the\nexpected version; does nothing if `actual` is equal to or newer\nthan the expected version.\n\nParameters:\n\n`actual`\n:   actual version specifier ([Version])\n\n`expected`\n:   minimum expected version ([Version])\n\n`error_message`\n:   optional error message template. The string is used as\n    format string, with the expected and actual versions as\n    arguments. Defaults to\n    `\"expected version %s or newer, got %s\"`.\n\nUsage:\n\n    PANDOC_VERSION:must_be_at_least '2.7.3'\n    PANDOC_API_VERSION:must_be_at_least(\n      '1.17.4',\n      'pandoc-types is too old: expected version %s, got %s'\n    )\n\n[Attributes]: #type-attributes\n[Cells]: #type-cell\n[Citation]: #type-citation\n[Citations]: #type-citation\n[ColSpec]: #type-colspec\n[CommonState]: #type-commonstate\n[Div]: #type-div\n[Image]: #type-image\n[List]: #type-list\n[ListAttributes]: #type-listattributes\n[Meta]: #type-meta\n[MetaBlocks]: #type-metablocks\n[MetaValue]: #type-metavalue\n[MetaValues]: #type-metavalue\n[LogMessage]: #type-logmessage\n[Pandoc]: #type-pandoc\n[Para]: #type-para\n[Plain]: #type-plain\n[Rows]: #type-row\n[SimpleTable]: #type-simpletable\n[Version]: #type-version\n\n## Chunk {#type-chunk}\n\nPart of a document; usually chunks are each written to a separate\nfile.\n\nFields:\n\n`heading`\n:   heading text ([Inlines][])\n\n`id`\n:   identifier (string)\n\n`level`\n:   level of topmost heading in chunk (integer)\n\n`number`\n:   chunk number (integer)\n\n`section_number`\n:   hierarchical section number (string)\n\n`path`\n:   target filepath for this chunk (string)\n\n`up`\n:   link to the enclosing section, if any ([Chunk][]|nil)\n\n`prev`\n:   link to the previous section, if any ([Chunk][]|nil)\n\n`next`\n:   link to the next section, if any ([Chunk][]|nil)\n\n`unlisted`\n:   whether the section in this chunk should be listed in the TOC\n    even if the chunk has no section number. (boolean)\n\n`contents`\n:   the chunk's block contents ([Blocks][])\n\n## ChunkedDoc {#type-chunkeddoc}\n\nA Pandoc document divided into [Chunks]{#type-chunk}.\n\nThe table of contents info in field `toc` is rose-tree structure\nrepresented as a list. The node item is always placed at index\n`0`; subentries make up the rest of the list. Each node item\ncontains the fields `title` ([Inlines][]), `number` (string|nil),\n`id` (string), `path` (string), and `level` (integer).\n\nFields:\n\n`chunks`\n:   list of chunks that make up the document (list of\n    [Chunks](#type-chunk)).\n\n`meta`\n:   the document's metadata ([Meta][])\n\n`toc`\n:   table of contents information (table)\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc -->\n\n# Module pandoc\n\nFields and functions for pandoc scripts; includes constructors for\ndocument tree elements, functions to parse text in a given format,\nand functions to filter and modify a subtree.\n\n## Fields {#pandoc-fields}\n\n### readers {#pandoc.readers}\n\nSet of formats that pandoc can parse. All keys in this table can\nbe used as the `format` value in `pandoc.read`. (table)\n\n### writers {#pandoc.writers}\n\nSet of formats that pandoc can generate. All keys in this table\ncan be used as the `format` value in `pandoc.write`. (table)\n\n## Functions {#pandoc-functions}\n\n### Pandoc {#pandoc.Pandoc}\n\n`Pandoc (blocks[, meta])`\n\nParameters:\n\n`blocks`\n:   document contents ([Blocks])\n\n`meta`\n:   document metadata ([Meta])\n\nReturns:\n\n- new Pandoc document ([Pandoc])\n\n### Meta {#pandoc.Meta}\n\n`Meta (meta)`\n\nParameters:\n\n`meta`\n:   table containing meta information (table)\n\nReturns:\n\n- new Meta table (table)\n\n### MetaBlocks {#pandoc.MetaBlocks}\n\n`MetaBlocks (content)`\n\nCreates a value to be used as a MetaBlocks value in meta data;\ncreates a copy of the input list via `pandoc.Blocks`, discarding\nall non-list keys.\n\nParameters:\n\n`content`\n:   block content ([Blocks])\n\nReturns:\n\n- list of Block elements ([Blocks])\n\n### MetaBool {#pandoc.MetaBool}\n\n`MetaBool (bool)`\n\nParameters:\n\n`bool`\n:   true or false (boolean)\n\nReturns:\n\n- input, unchanged (boolean)\n\n### MetaInlines {#pandoc.MetaInlines}\n\n`MetaInlines (inlines)`\n\nCreates a value to be used as a MetaInlines value in meta data;\ncreates a copy of the input list via `pandoc.Inlines`, discarding\nall non-list keys.\n\nParameters:\n\n`inlines`\n:   inline elements ([Inlines])\n\nReturns:\n\n- list of Inline elements ([Inlines])\n\n### MetaList {#pandoc.MetaList}\n\n`MetaList (values)`\n\nCreates a value to be used as a MetaList in meta data; creates a\ncopy of the input list via `pandoc.List`, discarding all non-list\nkeys.\n\nParameters:\n\n`values`\n:   value, or list of values ([MetaValue]\\|{[MetaValue],\\...})\n\nReturns:\n\n- list of meta values ([List]{unknown-type=\"List\"})\n\n### MetaMap {#pandoc.MetaMap}\n\n`MetaMap (key_value_map)`\n\nCreates a value to be used as a MetaMap in meta data; creates a\ncopy of the input table, keeping only pairs with string keys and\ndiscards all other keys.\n\nParameters:\n\n`key_value_map`\n:   a string-indexed map of meta values (table)\n\nReturns:\n\n- map of meta values (table)\n\n### MetaString {#pandoc.MetaString}\n\n`MetaString (s)`\n\nCreates a value to be used as a MetaString in meta data; this is\nthe identity function for boolean values and exists only for\ncompleteness.\n\nParameters:\n\n`s`\n:   string value (string)\n\nReturns:\n\n- unchanged input (string)\n\n### BlockQuote {#pandoc.BlockQuote}\n\n`BlockQuote (content)`\n\nCreates a block quote element\n\nParameters:\n\n`content`\n:   block content ([Blocks])\n\nReturns:\n\n- BlockQuote element ([Block])\n\n### BulletList {#pandoc.BulletList}\n\n`BulletList (items)`\n\nCreates a bullet list.\n\nParameters:\n\n`items`\n:   list items ({[Blocks],\\...})\n\nReturns:\n\n- BulletList element ([Block])\n\n### CodeBlock {#pandoc.CodeBlock}\n\n`CodeBlock (text[, attr])`\n\nCreates a code block element.\n\nParameters:\n\n`text`\n:   code string (string)\n\n`attr`\n:   element attributes ([Attr])\n\nReturns:\n\n- CodeBlock element ([Block])\n\n### DefinitionList {#pandoc.DefinitionList}\n\n`DefinitionList (content)`\n\nCreates a definition list, containing terms and their explanation.\n\nParameters:\n\n`content`\n:   definition items ([{{Inlines,\n    {Blocks,\\...}},\\...}]{unknown-type=\"{{Inlines, {Blocks,...}},...}\"})\n\nReturns:\n\n- DefinitionList element ([Block])\n\n### Div {#pandoc.Div}\n\n`Div (content[, attr])`\n\nCreates a div element\n\nParameters:\n\n`content`\n:   block content ([Blocks])\n\n`attr`\n:   element attributes ([Attr])\n\nReturns:\n\n- Div element ([Block])\n\n### Figure {#pandoc.Figure}\n\n`Figure (content[, caption[, attr]])`\n\nCreates a [Figure] element.\n\nParameters:\n\n`content`\n:   figure block content ([Blocks])\n\n`caption`\n:   figure caption ([Caption])\n\n`attr`\n:   element attributes ([Attr])\n\nReturns:\n\n- Figure object ([Block])\n\n### Header {#pandoc.Header}\n\n`Header (level, content[, attr])`\n\nCreates a header element.\n\nParameters:\n\n`level`\n:   heading level ([integer]{unknown-type=\"integer\"})\n\n`content`\n:   inline content ([Inlines])\n\n`attr`\n:   element attributes ([Attr])\n\nReturns:\n\n- Header element ([Block])\n\n### HorizontalRule {#pandoc.HorizontalRule}\n\n`HorizontalRule ()`\n\nCreates a horizontal rule.\n\nReturns:\n\n- HorizontalRule element ([Block])\n\n### LineBlock {#pandoc.LineBlock}\n\n`LineBlock (content)`\n\nCreates a line block element.\n\nParameters:\n\n`content`\n:   lines ({[Inlines],\\...})\n\nReturns:\n\n- LineBlock element ([Block])\n\n### OrderedList {#pandoc.OrderedList}\n\n`OrderedList (items[, listAttributes])`\n\nCreates an ordered list.\n\nParameters:\n\n`items`\n:   list items ({[Blocks],\\...})\n\n`listAttributes`\n:   list parameters ([ListAttributes])\n\nReturns:\n\n- OrderedList element ([Block])\n\n### Para {#pandoc.Para}\n\n`Para (content)`\n\nCreates a para element.\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- Para element ([Block])\n\n### Plain {#pandoc.Plain}\n\n`Plain (content)`\n\nCreates a plain element.\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- Plain element ([Block])\n\n### RawBlock {#pandoc.RawBlock}\n\n`RawBlock (format, text)`\n\nCreates a raw content block of the specified format.\n\nParameters:\n\n`format`\n:   format of content (string)\n\n`text`\n:   raw content (string)\n\nReturns:\n\n- RawBlock element ([Block])\n\n### Table {#pandoc.Table}\n\n`Table (caption, colspecs, head, bodies, foot[, attr])`\n\nCreates a table element.\n\nParameters:\n\n`caption`\n:   table caption ([Caption])\n\n`colspecs`\n:   column alignments and widths ({[ColSpec],\\...})\n\n`head`\n:   table head ([TableHead])\n\n`bodies`\n:   table bodies ({[TableBody],\\...})\n\n`foot`\n:   table foot ([TableFoot])\n\n`attr`\n:   element attributes ([Attr])\n\nReturns:\n\n- Table element ([Block])\n\n### Blocks {#pandoc.Blocks}\n\n`Blocks (block_like_elements)`\n\nCreates a [Blocks] list.\n\nParameters:\n\n`block_like_elements`\n:   List where each element can be treated as a [Block] value, or\n    a single such value. ([Blocks])\n\nReturns:\n\n- list of block elements ([Blocks])\n\n### Cite {#pandoc.Cite}\n\n`Cite (content, citations)`\n\nCreates a Cite inline element\n\nParameters:\n\n`content`\n:   placeholder content ([Inlines])\n\n`citations`\n:   List of Citations ({[Citation]{unknown-type=\"Citation\"},\\...})\n\nReturns:\n\n- cite element ([Inline])\n\n### Code {#pandoc.Code}\n\n`Code (code[, attr])`\n\nCreates a Code inline element\n\nParameters:\n\n`code`\n:   code string (string)\n\n`attr`\n:   additional attributes ([Attr])\n\nReturns:\n\n- code element ([Inline])\n\n### Emph {#pandoc.Emph}\n\n`Emph (content)`\n\nCreates an inline element representing emphasized text.\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### Image {#pandoc.Image}\n\n`Image (caption, src[, title[, attr]])`\n\nCreates an Image element\n\nParameters:\n\n`caption`\n:   text used to describe the image ([Inlines])\n\n`src`\n:   path to the image file (string)\n\n`title`\n:   brief image description (string)\n\n`attr`\n:   image attributes ([Attr])\n\nReturns:\n\n- Image element ([Inline])\n\n### LineBreak {#pandoc.LineBreak}\n\n`LineBreak ()`\n\nCreate a LineBreak inline element\n\nReturns:\n\n- line break ([Inline])\n\n### Link {#pandoc.Link}\n\n`Link (content, target[, title[, attr]])`\n\nCreates a link inline element, usually a hyperlink.\n\nParameters:\n\n`content`\n:   text for this link ([Inlines])\n\n`target`\n:   the link target (string)\n\n`title`\n:   brief link description (string)\n\n`attr`\n:   link attributes ([Attr])\n\nReturns:\n\n- link element ([Inline])\n\n### Math {#pandoc.Math}\n\n`Math (mathtype, text)`\n\nCreates a Math element, either inline or displayed.\n\nParameters:\n\n`mathtype`\n:   rendering specifier ([MathType]{unknown-type=\"MathType\"})\n\n`text`\n:   math content (string)\n\nReturns:\n\n- math element ([Inline])\n\n### Note {#pandoc.Note}\n\n`Note (content)`\n\nCreates a Note inline element\n\nParameters:\n\n`content`\n:   footnote block content ([Blocks])\n\nReturns:\n\n- note ([Inline])\n\n### Quoted {#pandoc.Quoted}\n\n`Quoted (quotetype, content)`\n\nCreates a Quoted inline element given the quote type and quoted\ncontent.\n\nParameters:\n\n`quotetype`\n:   type of quotes ([QuoteType]{unknown-type=\"QuoteType\"})\n\n`content`\n:   inlines in quotes ([Inlines])\n\nReturns:\n\n- quoted element ([Inline])\n\n### RawInline {#pandoc.RawInline}\n\n`RawInline (format, text)`\n\nCreates a raw inline element\n\nParameters:\n\n`format`\n:   format of content (string)\n\n`text`\n:   string content (string)\n\nReturns:\n\n- raw inline element ([Inline])\n\n### SmallCaps {#pandoc.SmallCaps}\n\n`SmallCaps (content)`\n\nCreates text rendered in small caps\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### SoftBreak {#pandoc.SoftBreak}\n\n`SoftBreak ()`\n\nCreates a SoftBreak inline element.\n\nReturns:\n\n- soft break ([Inline])\n\n### Space {#pandoc.Space}\n\n`Space ()`\n\nCreate a Space inline element\n\nReturns:\n\n- new space ([Inline])\n\n### Span {#pandoc.Span}\n\n`Span (content[, attr])`\n\nCreates a Span inline element\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\n`attr`\n:   additional attributes ([Attr])\n\nReturns:\n\n- [Span] object ([Inline])\n\n### Str {#pandoc.Str}\n\n`Str (text)`\n\nCreates a Str inline element\n\nParameters:\n\n`text`\n:    (string)\n\nReturns:\n\n- [Str] object ([Inline])\n\n### Strikeout {#pandoc.Strikeout}\n\n`Strikeout (content)`\n\nCreates text which is struck out.\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### Strong {#pandoc.Strong}\n\n`Strong (content)`\n\nCreates a Strong element, whose text is usually displayed in a\nbold font.\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### Subscript {#pandoc.Subscript}\n\n`Subscript (content)`\n\nCreates a Subscript inline element\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### Superscript {#pandoc.Superscript}\n\n`Superscript (content)`\n\nCreates a Superscript inline element\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### Underline {#pandoc.Underline}\n\n`Underline (content)`\n\nCreates an Underline inline element\n\nParameters:\n\n`content`\n:   inline content ([Inlines])\n\nReturns:\n\n- new object ([Inline])\n\n### Inlines {#pandoc.Inlines}\n\n`Inlines (inline_like_elements)`\n\nConverts its argument into an [Inlines] list:\n\n- copies a list of [Inline] elements into a fresh list; any string\n  `s` within the list is treated as `pandoc.Str(s)`;\n- turns a single [Inline] into a singleton list;\n- splits a string into `Str`-wrapped words, treating interword\n  spaces as `Space`s or `SoftBreak`s.\n\nParameters:\n\n`inline_like_elements`\n:   List where each element can be treated as an [Inline] value,\n    or just a single such value. ([Inlines])\n\nReturns:\n\n- list of inline elements ([Inlines])\n\n### Attr {#pandoc.Attr}\n\n`Attr ([identifier[, classes[, attributes]]])`\n\nCreate a new set of attributes\n\nParameters:\n\n`identifier`\n:   element identifier (string\\|table\\|[Attr])\n\n`classes`\n:   element classes ({string,\\...})\n\n`attributes`\n:   table containing string keys and values\n    (table\\|[AttributeList])\n\nReturns:\n\n- new Attr object ([Attr])\n\n### Caption {#pandoc.Caption}\n\n`Caption ([long[, short]])`\n\nCreates a new Caption object.\n\nParameters:\n\n`long`\n:   full caption ([Blocks])\n\n`short`\n:   short summary caption ([Inlines])\n\nReturns:\n\n- new Caption object ([Caption])\n\n*Since: 3.6.1*\n\n### Cell {#pandoc.Cell}\n\n`Cell (blocks[, align[, rowspan[, colspan[, attr]]]])`\n\nCreate a new table cell.\n\nParameters:\n\n`blocks`\n:   cell contents ([Blocks])\n\n`align`\n:   text alignment; defaults to `AlignDefault` ([Alignment])\n\n`rowspan`\n:   number of rows occupied by the cell; defaults to `1`\n    ([integer]{unknown-type=\"integer\"})\n\n`colspan`\n:   number of columns occupied by the cell; defaults to `1`\n    ([integer]{unknown-type=\"integer\"})\n\n`attr`\n:   cell attributes ([Attr])\n\nReturns:\n\n- new Cell object ([Cell])\n\n### AttributeList {#pandoc.AttributeList}\n\n`AttributeList (attribs)`\n\nParameters:\n\n`attribs`\n:   an attribute list (table\\|[AttributeList])\n\nReturns:\n\n- new AttributeList object ([AttributeList])\n\n### Citation {#pandoc.Citation}\n\n`Citation (id, mode[, prefix[, suffix[, note_num[, hash]]]])`\n\nCreates a single citation.\n\nParameters:\n\n`id`\n:   citation ID (e.g. BibTeX key) (string)\n\n`mode`\n:   citation rendering mode\n    ([CitationMode]{unknown-type=\"CitationMode\"})\n\n`prefix`\n:    ([Inlines])\n\n`suffix`\n:    ([Inlines])\n\n`note_num`\n:   note number ([integer]{unknown-type=\"integer\"})\n\n`hash`\n:   hash number ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- new citation object ([Citation]{unknown-type=\"Citation\"})\n\n### ListAttributes {#pandoc.ListAttributes}\n\n`ListAttributes ([start[, style[, delimiter]]])`\n\nCreates a new ListAttributes object.\n\nParameters:\n\n`start`\n:   number of the first list item\n    ([integer]{unknown-type=\"integer\"})\n\n`style`\n:   style used for list numbering (string)\n\n`delimiter`\n:   delimiter of list numbers (string)\n\nReturns:\n\n- new ListAttributes object ([ListAttributes])\n\n### Row {#pandoc.Row}\n\n`Row ([cells[, attr]])`\n\nCreates a table row.\n\nParameters:\n\n`cells`\n:   list of table cells in this row ({[Cell],\\...})\n\n`attr`\n:   row attributes ([Attr])\n\nReturns:\n\n- new Row object ([Row])\n\n### TableFoot {#pandoc.TableFoot}\n\n`TableFoot ([rows[, attr]])`\n\nCreates a table foot.\n\nParameters:\n\n`rows`\n:   list of table rows ({[Row],\\...})\n\n`attr`\n:   table foot attributes ([Attr])\n\nReturns:\n\n- new TableFoot object ([TableFoot])\n\n### TableHead {#pandoc.TableHead}\n\n`TableHead ([rows[, attr]])`\n\nCreates a table head.\n\nParameters:\n\n`rows`\n:   list of table rows ({[Row],\\...})\n\n`attr`\n:   table head attributes ([Attr])\n\nReturns:\n\n- new TableHead object ([TableHead])\n\n### SimpleTable {#pandoc.SimpleTable}\n\n`SimpleTable (caption, align, widths, header, rows)`\n\nUsage:\n\n    local caption = \"Overview\"\n    local aligns = {pandoc.AlignDefault, pandoc.AlignDefault}\n    local widths = {0, 0} -- let pandoc determine col widths\n    local headers = {{pandoc.Plain({pandoc.Str \"Language\"})},\n                     {pandoc.Plain({pandoc.Str \"Typing\"})}}\n    local rows = {\n      {{pandoc.Plain \"Haskell\"}, {pandoc.Plain \"static\"}},\n      {{pandoc.Plain \"Lua\"}, {pandoc.Plain \"Dynamic\"}},\n    }\n    simple_table = pandoc.SimpleTable(\n      caption,\n      aligns,\n      widths,\n      headers,\n      rows\n    )\n\nParameters:\n\n`caption`\n:   table caption ([Inlines])\n\n`align`\n:   column alignments ({[Alignment],\\...})\n\n`widths`\n:   relative column widths ({number,\\...})\n\n`header`\n:   table header row ({[Blocks],\\...})\n\n`rows`\n:   table rows ({{[Blocks],\\...},\\...})\n\nReturns:\n\n- new SimpleTable object ([SimpleTable])\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n## Constants\n\n[`AuthorInText`]{#pandoc.authorintext}\n\n:   Author name is mentioned in the text.\n\n    See also: [Citation](#type-citation)\n\n[`SuppressAuthor`]{#pandoc.suppressauthor}\n\n:   Author name is suppressed.\n\n    See also: [Citation](#type-citation)\n\n[`NormalCitation`]{#pandoc.normalcitation}\n\n:   Default citation style is used.\n\n    See also: [Citation](#type-citation)\n\n[`DisplayMath`]{#pandoc.displaymath}\n\n:   Math style identifier, marking that the formula should be show\n    in \"display\" style, i.e., on a separate line.\n\n    See also: [Math](#type-math)\n\n[`InlineMath`]{#pandoc.inlinemath}\n\n:   Math style identifier, marking that the formula should be show\n    inline.\n\n    See also: [Math](#type-math)\n\n[`SingleQuote`]{#pandoc.singlequote}\n\n:   Quote type used with [Quoted](#type-quoted), indicating\n    that the string is enclosed in *single* quotes.\n\n    See also: [Quoted](#type-quoted)\n\n[`DoubleQuote`]{#pandoc.doublequote}\n\n:   Quote type used with [Quoted](#type-quoted), indicating\n    that the string is enclosed in *double* quotes.\n\n    See also: [Quoted](#type-quoted)\n\n[`AlignLeft`]{#pandoc.alignleft}\n\n:   Table cells aligned left.\n\n    See also: [Table](#type-alignment)\n\n[`AlignRight`]{#pandoc.alignright}\n\n:   Table cells right-aligned.\n\n    See also: [Table](#type-alignment)\n\n[`AlignCenter`]{#pandoc.aligncenter}\n\n:   Table cell content is centered.\n\n    See also: [Table](#type-alignment)\n\n[`AlignDefault`]{#pandoc.aligndefault}\n\n:   Table cells are alignment is unaltered.\n\n    See also: [Table](#type-alignment)\n\n[`DefaultDelim`]{#pandoc.defaultdelim}\n\n:   Default list number delimiters are used.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`Period`]{#pandoc.period}\n\n:   List numbers are delimited by a period.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`OneParen`]{#pandoc.oneparen}\n\n:   List numbers are delimited by a single parenthesis.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`TwoParens`]{#pandoc.twoparens}\n\n:   List numbers are delimited by a double parentheses.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`DefaultStyle`]{#pandoc.defaultstyle}\n\n:   List are numbered in the default style\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`Example`]{#pandoc.example}\n\n:   List items are numbered as examples.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`Decimal`]{#pandoc.decimal}\n\n:   List are numbered using decimal integers.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`LowerRoman`]{#pandoc.lowerroman}\n\n:   List are numbered using lower-case roman numerals.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`UpperRoman`]{#pandoc.upperroman}\n\n:   List are numbered using upper-case roman numerals\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`LowerAlpha`]{#pandoc.loweralpha}\n\n:   List are numbered using lower-case alphabetic characters.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`UpperAlpha`]{#pandoc.upperalpha}\n\n:   List are numbered using upper-case alphabetic characters.\n\n    See also: [ListAttributes](#type-listattributes)\n\n[`sha1`]{#pandoc.sha1}\n\n:   Alias for [`pandoc.utils.sha1`](#pandoc.utils.sha1)\n    (DEPRECATED, use `pandoc.utils.sha1` instead).\n\n## Other constructors\n\n### `ReaderOptions (opts)` {#pandoc.readeroptions}\n\nCreates a new [ReaderOptions] value.\n\nParameters\n\n`opts`\n:   Either a table with a subset of the properties of a\n    [ReaderOptions] object, or another ReaderOptions object.\n    Uses the defaults specified in the manual for all\n    properties that are not explicitly specified. Throws an\n    error if a table contains properties which are not present\n    in a ReaderOptions object. ([ReaderOptions]|table)\n\nReturns: new [ReaderOptions] object\n\nUsage:\n\n    -- copy of the reader options that were defined on the command line.\n    local cli_opts = pandoc.ReaderOptions(PANDOC_READER_OPTIONS)\n\n    -- default reader options, but columns set to 66.\n    local short_colums_opts = pandoc.ReaderOptions {columns = 66}\n\n### `WriterOptions (opts)` {#pandoc.writeroptions}\n\nCreates a new [WriterOptions][] value.\n\nParameters\n\n`opts`\n:   Either a table with a subset of the properties of a\n    [WriterOptions] object, or another WriterOptions object.\n    Uses the defaults specified in the manual for all\n    properties that are not explicitly specified. Throws an\n    error if a table contains properties which are not present\n    in a WriterOptions object. ([WriterOptions]|table)\n\nReturns: new [WriterOptions] object\n\nUsage:\n\n    -- copy of the writer options that were defined on the command line.\n    local cli_opts = pandoc.WriterOptions(PANDOC_WRITER_OPTIONS)\n\n    -- default writer options, but DPI set to 300.\n    local short_colums_opts = pandoc.WriterOptions {dpi = 300}\n\n## Helper functions\n\n### `pipe (command, args, input)` {#pandoc.pipe}\n\nRuns command with arguments, passing it some input, and returns\nthe output.\n\nParameters:\n\n`command`\n:   program to run; the executable will be resolved using default\n    system methods (string).\n\n`args`\n:   list of arguments to pass to the program (list of strings).\n\n`input`\n:   data which is piped into the program via stdin (string).\n\nReturns:\n\n-   Output of command, i.e. data printed to stdout (string)\n\nRaises:\n\n-   A table containing the keys `command`, `error_code`, and\n    `output` is thrown if the command exits with a non-zero\n    error code.\n\nUsage:\n\n    local output = pandoc.pipe(\"sed\", {\"-e\",\"s/a/b/\"}, \"abc\")\n\n### `walk_block (element, filter)` {#pandoc.walk_block}\n\nApply a filter inside a block element, walking its contents.\nReturns a (deep) copy on which the filter has been applied:\nthe original element is left untouched.\n\nParameters:\n\n`element`\n:   the block element\n\n`filter`\n:   a Lua filter (table of functions) to be applied within the\n    block element\n\nReturns: the transformed block element\n\n### `walk_inline (element, filter)` {#pandoc.walk_inline}\n\nApply a filter inside an inline element, walking its contents.\nReturns a (deep) copy on which the filter has been applied:\nthe original element is left untouched.\n\nParameters:\n\n`element`\n:   the inline element\n\n`filter`\n:   a Lua filter (table of functions) to be applied within the\n    inline element\n\nReturns: the transformed inline element\n\n### `with_state (options, callback)` {#pandoc.with_state}\n\nRuns a function with a modified pandoc state.\n\nThe given callback is invoked after setting the pandoc state to the\ngiven values. The modifiable options are restored to their original\nvalues once the callback has returned.\n\nThe following state variables can be controlled:\n\n  - `request_headers` (list of key-value tuples)\n  - `resource_path` (list of filepaths)\n  - `user_data_dir` (string)\n\nOther options are ignored, and the rest of the state is not modified.\n\nUsage:\n\n    local opts = {\n      request_headers = {\n        {'Authorization', 'Basic my-secret'}\n      }\n    }\n    pandoc.with_state(opts, function ()\n      local mime, contents = pandoc.mediabag.fetch(image_url)\n    )\n\n### `read (markup[, format[, reader_options[, read_env]]])` {#pandoc.read}\n\nParse the given string into a Pandoc document.\n\nThe parser is run in the same environment that was used to read\nthe main input files; it has full access to the file-system and\nthe mediabag. This means that if the document specifies files to\nbe included, as is possible in formats like LaTeX,\nreStructuredText, and Org, then these will be included in the\nresulting document. Any media elements are added to those\nretrieved from the other parsed input files. Use the `read_env`\nparameter to modify this behavior.\n\nThe `format` parameter defines the format flavor that will be\nparsed. This can be either a string, using `+` and `-` to enable\nand disable extensions, or a table with fields `format` (string)\nand `extensions` (table). The `extensions` table can be a list of\nall enabled extensions, or a table with extensions as keys and\ntheir activation status as values (`true` or `'enable'` to enable\nan extension, `false` or `'disable'` to disable it).\n\nNote: The extensions field in `reader_options` is ignored, as the\nfunction will always use the format extensions specified via the\n`format` parameter.\n\nParameters:\n\n`markup`\n:   the markup to be parsed (string|Sources)\n\n`format`\n:   format specification; defaults to `\"markdown\"`. See the\n    description above for a complete description of this\n    parameter. (string|table)\n\n`reader_options`\n:   options passed to the reader; may be a ReaderOptions object or\n    a table with a subset of the keys and values of a\n    ReaderOptions object; defaults to the default values\n    documented in the manual. ([ReaderOptions]|table)\n\n`read_env`\n:   If the value is not given or `nil`, then the global\n    environment is used. Passing a list of filenames causes the\n    reader to be run in a sandbox. The given files are read from\n    the file system and provided to the sandbox via an ersatz file\n    system. The table can also contain mappings from filenames to\n    contents, which will be used to populate the ersatz file\n    system.\n\nReturns: pandoc document ([Pandoc](#type-pandoc))\n\nUsage:\n\n    local org_markup = \"/emphasis/\"  -- Input to be read\n    local document = pandoc.read(org_markup, \"org\")\n    -- Get the first block of the document\n    local block = document.blocks[1]\n    -- The inline element in that block is an `Emph`\n    assert(block.content[1].t == \"Emph\")\n\n[ReaderOptions]: #type-readeroptions\n\n### `write (doc[, format[, writer_options]])` {#pandoc.write}\n\nConverts a document to the given target format.\n\nNote: The extensions field in `writer_options` is ignored, as the\nfunction will always use the format extensions specified via the\n`format` parameter.\n\nParameters:\n\n`doc`\n:   document to convert ([Pandoc](#type-pandoc))\n\n`format`\n:   format specification; defaults to `\"html\"`. See the\n    documentation of [`pandoc.read`](#pandoc.read) for a complete\n    description of this parameter. (string|table)\n\n`writer_options`\n:   options passed to the writer; may be a WriterOptions object\n    or a table with a subset of the keys and values of a\n    WriterOptions object; defaults to the default values\n    documented in the manual. ([WriterOptions]|table)\n\nReturns:\n-   converted document (string)\n\nUsage:\n\n    local doc = pandoc.Pandoc(\n      {pandoc.Para {pandoc.Strong 'Tea'}}\n    )\n    local html = pandoc.write(doc, 'html')\n    assert(html == \"<p><strong>Tea</strong></p>\")\n\n### `write_classic (doc[, writer_options])` {#pandoc.write_custom}\n\nRuns a classic custom Lua writer, using the functions defined\nin the current environment.\n\nParameters:\n\n`doc`\n:   document to convert ([Pandoc](#type-pandoc))\n\n`writer_options`\n:   options passed to the writer; may be a [WriterOptions] object\n    or a table with a subset of the keys and values of a\n    WriterOptions object; defaults to the default values\n    documented in the manual. ([WriterOptions]|table)\n\nReturns:\n-   converted document (string)\n\nUsage:\n\n    -- Adding this function converts a classic writer into a\n    -- new-style custom writer.\n    function Writer (doc, opts)\n      PANDOC_DOCUMENT = doc\n      PANDOC_WRITER_OPTIONS = opts\n      loadfile(PANDOC_SCRIPT_FILE)()\n      return pandoc.write_classic(doc, opts)\n    end\n\n[WriterOptions]: #type-writeroptions\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.cli -->\n\n# Module pandoc.cli\n\nCommand line options and argument parsing.\n\n## Fields {#pandoc.cli-fields}\n\n### default_options {#pandoc.cli.default_options}\n\nDefault CLI options, using a JSON-like representation. (table)\n\n## Functions {#pandoc.cli-functions}\n\n### parse_options {#pandoc.cli.parse_options}\n\n`parse_options (args)`\n\nParses command line arguments into pandoc options. Typically this\nfunction will be used in stand-alone pandoc Lua scripts, taking\nthe list of arguments from the global `arg`.\n\nParameters:\n\n`args`\n:   list of command line arguments ({string,\\...})\n\nReturns:\n\n- parsed options, using their JSON-like representation. (table)\n\n*Since: 3.0*\n\n### repl {#pandoc.cli.repl}\n\n`repl ([env])`\n\nStarts a read-eval-print loop (REPL). The function returns all\nvalues of the last evaluated input. Exit the REPL by pressing\n`ctrl-d` or `ctrl-c`; press `F1` to get a list of all key\nbindings.\n\nThe REPL is started in the global namespace, unless the `env`\nparameter is specified. In that case, the global namespace is\nmerged into the given table and the result is used as `_ENV` value\nfor the repl.\n\nSpecifically, local variables *cannot* be accessed, unless they\nare explicitly passed via the `env` parameter; e.g.\n\n    function Pandoc (doc)\n      -- start repl, allow to access the `doc` parameter\n      -- in the repl\n      return pandoc.cli.repl{ doc = doc }\n    end\n\n**Note**: it seems that the function exits immediately on Windows,\nwithout prompting for user input.\n\nParameters:\n\n`env`\n:   Extra environment; the global environment is merged into this\n    table. (table)\n\nReturns:\n\nThe result(s) of the last evaluated input, or nothing if the last\ninput resulted in an error.\n\n*Since: 3.1.2*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.utils -->\n\n# Module pandoc.utils\n\nThis module exposes internal pandoc functions and utility\nfunctions.\n\n## Functions {#pandoc.utils-functions}\n\n### blocks_to_inlines {#pandoc.utils.blocks_to_inlines}\n\n`blocks_to_inlines (blocks[, sep])`\n\nSquash a list of blocks into a list of inlines.\n\nUsage\n\n    local blocks = {\n      pandoc.Para{ pandoc.Str 'Paragraph1' },\n      pandoc.Para{ pandoc.Emph 'Paragraph2' }\n    }\n    local inlines = pandoc.utils.blocks_to_inlines(blocks)\n    assert(\n      inlines == pandoc.Inlines {\n        pandoc.Str 'Paragraph1',\n        pandoc.Linebreak(),\n        pandoc.Emph{ pandoc.Str 'Paragraph2' }\n      }\n    )\n\nParameters:\n\n`blocks`\n:   List of [Block] elements to be flattened. ([Blocks])\n\n`sep`\n:   List of [Inline] elements inserted as separator between two\n    consecutive blocks; defaults to `{pandoc.LineBreak()}`.\n    ([Inlines])\n\nReturns:\n\n- ([Inlines])\n\n*Since: 2.2.3*\n\n### citeproc {#pandoc.utils.citeproc}\n\n`citeproc (doc)`\n\nProcess the citations in the file, replacing them with rendered\ncitations and adding a bibliography. See the manual section on\ncitation rendering for details.\n\nUsage:\n\n    -- Lua filter that behaves like `--citeproc`\n    function Pandoc (doc)\n      return pandoc.utils.citeproc(doc)\n    end\n\nParameters:\n\n`doc`\n:   document ([Pandoc])\n\nReturns:\n\n- processed document ([Pandoc])\n\n*Since: 2.19.1*\n\n### documentation {#pandoc.utils.documentation}\n\n`documentation (object[, format])`\n\nReturn the documentation for a function or module defined by\npandoc. Throws an error if there is no documentation for the given\nobject.\n\nThe result format can be any textual format accepted by\n`pandoc.write`, and the documentation will be returned in that\nformat. Additionally, the special format `blocks` is accepted, in\nwhich case the documentation is returned as [Blocks].\n\nParameters:\n\n`object`\n:   Retrieve documentation for this object (any)\n\n`format`\n:   result format; defaults to `'ansi'` (string\\|table)\n\nReturns:\n\n- rendered documentation (string\\|[Blocks])\n\n*Since: 3.8.4*\n\n### equals {#pandoc.utils.equals}\n\n`equals (element1, element2)`\n\nTest equality of AST elements. Elements in Lua are considered\nequal if and only if the objects obtained by unmarshaling are\nequal.\n\n**This function is deprecated.** Use the normal Lua `==` equality\noperator instead.\n\nParameters:\n\n`element1`\n:   (any)\n\n`element2`\n:   (any)\n\nReturns:\n\n- Whether the two objects represent the same element (boolean)\n\n*Since: 2.5*\n\n### from_simple_table {#pandoc.utils.from_simple_table}\n\n`from_simple_table (simple_tbl)`\n\nCreates a [Table] block element from a [SimpleTable]. This is\nuseful for dealing with legacy code which was written for pandoc\nversions older than 2.10.\n\nUsage:\n\n    local simple = pandoc.SimpleTable(table)\n    -- modify, using pre pandoc 2.10 methods\n    simple.caption = pandoc.SmallCaps(simple.caption)\n    -- create normal table block again\n    table = pandoc.utils.from_simple_table(simple)\n\nParameters:\n\n`simple_tbl`\n:   ([SimpleTable])\n\nReturns:\n\n- table block element ([Block])\n\n*Since: 2.11*\n\n### make_sections {#pandoc.utils.make_sections}\n\n`make_sections (number_sections, baselevel, blocks)`\n\nConverts a list of [Block] elements into sections. `Div`s will be\ncreated beginning at each `Header` and containing following\ncontent until the next `Header` of comparable level. If\n`number_sections` is true, a `number` attribute will be added to\neach `Header` containing the section number. If `base_level` is\nnon-null, `Header` levels will be reorganized so that there are no\ngaps, and so that the base level is the level specified.\n\nParameters:\n\n`number_sections`\n:   whether section divs should get an additional `number`\n    attribute containing the section number. (boolean)\n\n`baselevel`\n:   shift top-level headings to this level (integer\\|nil)\n\n`blocks`\n:   list of blocks to process ([Blocks])\n\nReturns:\n\n- blocks with sections ([Blocks])\n\n*Since: 2.8*\n\n### normalize_date {#pandoc.utils.normalize_date}\n\n`normalize_date (date)`\n\nParse a date and convert (if possible) to \"YYYY-MM-DD\" format. We\nlimit years to the range 1601-9999 (ISO 8601 accepts greater than\nor equal to 1583, but MS Word only accepts dates starting 1601).\nReturns nil instead of a string if the conversion failed.\n\nParameters:\n\n`date`\n:   the date string (string)\n\nReturns:\n\n- normalized date, or nil if normalization failed. (string\\|nil)\n\n*Since: 2.0.6*\n\n### references {#pandoc.utils.references}\n\n`references (doc)`\n\nGet references defined inline in the metadata and via an external\nbibliography. Only references that are actually cited in the\ndocument (either with a genuine citation or with `nocite`) are\nreturned. URL variables are converted to links.\n\nThe structure used represent reference values corresponds to that\nused in CSL JSON; the return value can be use as `references`\nmetadata, which is one of the values used by pandoc and citeproc\nwhen generating bibliographies.\n\nUsage:\n\n    -- Include all cited references in document\n    function Pandoc (doc)\n      doc.meta.references = pandoc.utils.references(doc)\n      doc.meta.bibliography = nil\n      return doc\n    end\n\nParameters:\n\n`doc`\n:   document ([Pandoc])\n\nReturns:\n\n- lift of references. (table)\n\n*Since: 2.17*\n\n### run_json_filter {#pandoc.utils.run_json_filter}\n\n`run_json_filter (doc, filter[, args])`\n\nFilter the given doc by passing it through a JSON filter.\n\nParameters:\n\n`doc`\n:   the Pandoc document to filter ([Pandoc])\n\n`filter`\n:   filter to run (string)\n\n`args`\n:   list of arguments passed to the filter. Defaults to\n    `{FORMAT}`. ({string,\\...})\n\nReturns:\n\n- filtered document ([Pandoc])\n\n*Since: 2.1.1*\n\n### run_lua_filter {#pandoc.utils.run_lua_filter}\n\n`run_lua_filter (doc, filter[, env])`\n\nFilter the given doc by passing it through a Lua filter.\n\nThe filter will be run in the current Lua process.\n\nParameters:\n\n`doc`\n:   the Pandoc document to filter ([Pandoc])\n\n`filter`\n:   filepath of the filter to run (string)\n\n`env`\n:   environment to load and run the filter in (table)\n\nReturns:\n\n- filtered document ([Pandoc])\n\n*Since: 3.2.1*\n\n### sha1 {#pandoc.utils.sha1}\n\n`sha1 (input)`\n\nComputes the SHA1 hash of the given string input.\n\nParameters:\n\n`input`\n:   (string)\n\nReturns:\n\n- hexadecimal hash value (string)\n\n*Since: 2.0.6*\n\n### stringify {#pandoc.utils.stringify}\n\n`stringify (element)`\n\nConverts the given element (Pandoc, Meta, Block, or Inline) into a\nstring with all formatting removed.\n\nParameters:\n\n`element`\n:   some pandoc AST element\n    ([Pandoc]\\|[Block]\\|[Inline]\\|[Caption]\\|[Cell]\\|[MetaValue])\n\nReturns:\n\n- A plain string representation of the given element. (string)\n\n*Since: 2.0.6*\n\n### to_roman_numeral {#pandoc.utils.to_roman_numeral}\n\n`to_roman_numeral (n)`\n\nConverts an integer \\< 4000 to uppercase roman numeral.\n\nUsage:\n\n    local to_roman_numeral = pandoc.utils.to_roman_numeral\n    local pandoc_birth_year = to_roman_numeral(2006)\n    -- pandoc_birth_year == 'MMVI'\n\nParameters:\n\n`n`\n:   positive integer below 4000 (integer)\n\nReturns:\n\n- A roman numeral. (string)\n\n*Since: 2.0.6*\n\n### to_simple_table {#pandoc.utils.to_simple_table}\n\n`to_simple_table (tbl)`\n\nConverts a table into an old/simple table.\n\nUsage:\n\n    local simple = pandoc.utils.to_simple_table(table)\n    -- modify, using pre pandoc 2.10 methods\n    simple.caption = pandoc.SmallCaps(simple.caption)\n    -- create normal table block again\n    table = pandoc.utils.from_simple_table(simple)\n\nParameters:\n\n`tbl`\n:   a table ([Block])\n\nReturns:\n\n- SimpleTable object ([SimpleTable])\n\n*Since: 2.11*\n\n### type {#pandoc.utils.type}\n\n`type (value)`\n\nPandoc-friendly version of Lua's default `type` function,\nreturning type information similar to what is presented in the\nmanual.\n\nThe function works by checking the metafield `__name`. If the\nargument has a string-valued metafield `__name`, then it returns\nthat string. Otherwise it behaves just like the normal `type`\nfunction.\n\nUsage:\n\n    -- Prints one of 'string', 'boolean', 'Inlines', 'Blocks',\n    -- 'table', and 'nil', corresponding to the Haskell constructors\n    -- MetaString, MetaBool, MetaInlines, MetaBlocks, MetaMap,\n    -- and an unset value, respectively.\n\n    function Meta (meta)\n      print('type of metavalue `author`:', pandoc.utils.type(meta.author))\n    end\n\nParameters:\n\n`value`\n:   any Lua value (any)\n\nReturns:\n\n- type of the given value (string)\n\n*Since: 2.17*\n\n### Version {#pandoc.utils.Version}\n\n`Version (v)`\n\nCreates a Version object.\n\nParameters:\n\n`v`\n:   version description\n    ([Version]\\|string\\|{integer,\\...}\\|number)\n\nReturns:\n\n- new Version object ([Version])\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.mediabag -->\n\n# Module pandoc.mediabag\n\nThe `pandoc.mediabag` module allows accessing pandoc's media\nstorage. The \"media bag\" is used when pandoc is called with the\n`--extract-media` or (for HTML only) `--embed-resources` option.\n\nThe module is loaded as part of module `pandoc` and can either be\naccessed via the `pandoc.mediabag` field, or explicitly required,\ne.g.:\n\n    local mb = require 'pandoc.mediabag'\n\n## Functions {#pandoc.mediabag-functions}\n\n### delete {#pandoc.mediabag.delete}\n\n`delete (filepath)`\n\nRemoves a single entry from the media bag.\n\nParameters:\n\n`filepath`\n:   Filename of the item to deleted. The media bag will be left\n    unchanged if no entry with the given filename exists. (string)\n\n*Since: 2.7.3*\n\n### empty {#pandoc.mediabag.empty}\n\n`empty ()`\n\nClear-out the media bag, deleting all items.\n\n*Since: 2.7.3*\n\n### fetch {#pandoc.mediabag.fetch}\n\n`fetch (source)`\n\nFetches the given source from a URL or local file. Returns two\nvalues: the contents of the file and the MIME type (or an empty\nstring).\n\nThe function will first try to retrieve `source` from the\nmediabag; if that fails, it will try to download it or read it\nfrom the local file system while respecting pandoc's \"resource\npath\" setting.\n\nUsage:\n\n    local diagram_url = 'https://pandoc.org/diagram.jpg'\n    local mt, contents = pandoc.mediabag.fetch(diagram_url)\n\nParameters:\n\n`source`\n:   path to a resource; either a local file path or URI (string)\n\nReturns:\n\n- The entry's MIME type, or `nil` if the file was not found.\n  (string)\n\n- Contents of the file, or `nil` if the file was not found.\n  (string)\n\n*Since: 2.0*\n\n### fill {#pandoc.mediabag.fill}\n\n`fill (doc)`\n\nFills the mediabag with the images in the given document. An image\nthat cannot be retrieved will be replaced with a Span of class\n\"image\" that contains the image description.\n\nImages for which the mediabag already contains an item will not be\nprocessed again.\n\nParameters:\n\n`doc`\n:   document from which to fill the mediabag ([Pandoc])\n\nReturns:\n\n- modified document ([Pandoc])\n\n*Since: 2.19*\n\n### insert {#pandoc.mediabag.insert}\n\n`insert (filepath, mimetype, contents)`\n\nAdds a new entry to pandoc's media bag. Replaces any existing\nmedia bag entry the same `filepath`.\n\nUsage:\n\n    local fp = 'media/hello.txt'\n    local mt = 'text/plain'\n    local contents = 'Hello, World!'\n    pandoc.mediabag.insert(fp, mt, contents)\n\nParameters:\n\n`filepath`\n:   filename and path relative to the output folder. (string)\n\n`mimetype`\n:   the item's MIME type; use `nil` if the MIME type is unknown or\n    unavailable. (string\\|nil)\n\n`contents`\n:   the binary contents of the file. (string)\n\n*Since: 2.0*\n\n### items {#pandoc.mediabag.items}\n\n`items ()`\n\nReturns an iterator triple to be used with Lua's generic `for`\nstatement. The iterator returns the filepath, MIME type, and\ncontent of a media bag item on each invocation. Items are\nprocessed one-by-one to avoid excessive memory use.\n\nThis function should be used only when full access to all items,\nincluding their contents, is required. For all other cases,\n[`list`] should be preferred.\n\nUsage:\n\n    for fp, mt, contents in pandoc.mediabag.items() do\n      -- print(fp, mt, contents)\n    end\n\nReturns:\n\nIterator triple:\n\n- The iterator function; must be called with the iterator state\n  and the current iterator value.\n- Iterator state -- an opaque value to be passed to the iterator\n  function.\n- Initial iterator value.\n\n*Since: 2.7.3*\n\n### list {#pandoc.mediabag.list}\n\n`list ()`\n\nGet a summary of the current media bag contents.\n\nUsage:\n\n    -- calculate the size of the media bag.\n    local mb_items = pandoc.mediabag.list()\n    local sum = 0\n    for i = 1, #mb_items do\n        sum = sum + mb_items[i].length\n    end\n    print(sum)\n\nReturns:\n\n- A list of elements summarizing each entry in the media bag. The\n  summary item contains the keys `path`, `type`, and `length`,\n  giving the filepath, MIME type, and length of contents in bytes,\n  respectively. (table)\n\n*Since: 2.0*\n\n### lookup {#pandoc.mediabag.lookup}\n\n`lookup (filepath)`\n\nLookup a media item in the media bag, and return its MIME type and\ncontents.\n\nUsage:\n\n    local filename = 'media/diagram.png'\n    local mt, contents = pandoc.mediabag.lookup(filename)\n\nParameters:\n\n`filepath`\n:   name of the file to look up. (string)\n\nReturns:\n\n- The entry's MIME type, or nil if the file was not found.\n  (string)\n\n- Contents of the file, or nil if the file was not found. (string)\n\n*Since: 2.0*\n\n### make_data_uri {#pandoc.mediabag.make_data_uri}\n\n`make_data_uri (mime_type, raw_data)`\n\nConvert the input data into a data URI as defined by RFC 2397.\n\nExample:\n\n    -- Embed an unofficial pandoc logo\n    local pandoc_logo_url = 'https://raw.githubusercontent.com/'\n      .. 'tarleb/pandoc-logo/main/pandoc.svg'\n\n    local datauri = pandoc.mediabag.make_data_uri(\n      pandoc.mediabag.fetch(pandoc_logo_url)\n    )\n\n    local image = pandoc.Image('Logo', datauri)\n\nParameters:\n\n`mime_type`\n:   MIME type of the data (string)\n\n`raw_data`\n:   data to encode (string)\n\nReturns:\n\n- data uri (string)\n\n*Since: 3.7.1*\n\n### write {#pandoc.mediabag.write}\n\n`write (dir[, fp])`\n\nWrites the contents of mediabag to the given target directory. If\n`fp` is given, then only the resource with the given name will be\nextracted. Omitting that parameter means that the whole mediabag\ngets extracted. An error is thrown if `fp` is given but cannot be\nfound in the mediabag.\n\nParameters:\n\n`dir`\n:   path of the target directory (string)\n\n`fp`\n:   canonical name (relative path) of resource (string)\n\n*Since: 3.0*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n# Module pandoc.List\n\nThis module defines pandoc's list type. It comes with useful\nmethods and convenience functions.\n\n## Constructor\n\n[`pandoc.List([table])`]{#pandoc.list}\n\n:   Create a new List. If the optional argument `table` is given,\n    set the metatable of that value to `pandoc.List`. This is an\n    alias for [`pandoc.List:new([table])`](#pandoc.list:new).\n\n## Metamethods\n\n### `pandoc.List:__concat (list)` {#pandoc.list:__concat}\n\nConcatenates two lists.\n\nParameters:\n\n`list`\n:   second list concatenated to the first\n\nReturns: a new list containing all elements from list1 and\nlist2\n\n### `pandoc.List:__eq (a, b)` {#pandoc.list:__eq}\n\nCompares two lists for equality. The lists are taken as equal\nif and only if they are of the same type (i.e., have the same\nnon-nil metatable), have the same length, and if all elements\nare equal.\n\nParameters:\n\n`a`, `b`\n:   any Lua object\n\nReturns:\n\n-   `true` if the two lists are equal, `false` otherwise.\n\n## Methods\n\n### `pandoc.List:at` {#pandoc.list:at}\n\n`:at (index[, default])`\n\nReturns the element at the given index, or `default` if the list\ncontains no item at the given position.\n\nNegative integers count back from the last item in the list.\n\nParameters:\n\n`index`\n:   element position (integer)\n\n`default`\n:   the default value that is returned if the index is out of\n    range (any)\n\nReturns:\n\n-   the list item at `index`, or `default`.\n\n### `pandoc.List:clone ()` {#pandoc.list:clone}\n\nReturns a (shallow) copy of the list. (To get a deep copy\nof the list, use `walk` with an empty filter.)\n\n### `pandoc.List:extend (list)` {#pandoc.list:extend}\n\nAdds the given list to the end of this list.\n\nParameters:\n\n`list`\n:   list to appended\n\n### `pandoc.List:find (needle, init)` {#pandoc.list:find}\n\nReturns the value and index of the first occurrence of the\ngiven item.\n\nParameters:\n\n`needle`\n:   item to search for\n\n`init`\n:   index at which the search is started\n\nReturns: first item equal to the needle, or nil if no such\nitem exists.\n\n### `pandoc.List:find_if (pred, init)` {#pandoc.list:find_if}\n\nReturns the value and index of the first element for which\nthe predicate holds true.\n\nParameters:\n\n`pred`\n:   the predicate function\n\n`init`\n:   index at which the search is started\n\nReturns: first item for which \\`test\\` succeeds, or nil if\nno such item exists.\n\n### `pandoc.List:filter (pred)` {#pandoc.list:filter}\n\nReturns a new list containing all items satisfying a given\ncondition.\n\nParameters:\n\n`pred`\n:   condition items must satisfy.\n\nReturns: a new list containing all items for which \\`test\\`\nwas true.\n\n### `pandoc.List:includes (needle, init)` {#pandoc.list:includes}\n\nChecks if the list has an item equal to the given needle.\n\nParameters:\n\n`needle`\n:   item to search for\n\n`init`\n:   index at which the search is started\n\nReturns: true if a list item is equal to the needle, false\notherwise\n\n### `pandoc.List:insert ([pos], value)` {#pandoc.list:insert}\n\nInserts element `value` at position `pos` in list, shifting\nelements to the next-greater index if necessary.\n\nThis function is identical to\n[`table.insert`](https://www.lua.org/manual/5.4/manual.html#6.6).\n\nParameters:\n\n`pos`\n:   index of the new value; defaults to length of the list + 1\n\n`value`\n:   value to insert into the list\n\n### `pandoc.List:iter ([step])` {#pandoc.list:iter}\n\nCreate an iterator over the list. The resulting function returns the\nnext value each time it is called.\n\nUsage:\n\n    for item in List{1, 1, 2, 3, 5, 8}:iter() do\n      -- process item\n    end\n\nParameters:\n\n`step`\n:   step width with which to step through the list. Negative step sizes\n    will cause the iterator to start from the end of the list. Defaults\n    to 1. (integer)\n\nReturns:\n\n-   iterator (function)\n\n### `pandoc.List:map (fn)` {#pandoc.list:map}\n\nReturns a copy of the current list by applying the given\nfunction to all elements.\n\nParameters:\n\n`fn`\n:   function which is applied to all list items.\n\n### `pandoc.List:new([table])` {#pandoc.list:new}\n\nCreate a new List. If the optional argument `table` is given,\nset the metatable of that value to `pandoc.List`.\n\nThe function also accepts an iterator, in which case it creates a\nnew list from the return values of the iterator function.\n\nParameters:\n\n`table`\n:   table which should be treatable as a list; defaults to an\n    empty table\n\nReturns: the updated input value\n\n### `pandoc.List:remove ([pos])` {#pandoc.list:remove}\n\nRemoves the element at position `pos`, returning the value\nof the removed element.\n\nThis function is identical to\n[`table.remove`](https://www.lua.org/manual/5.4/manual.html#6.6).\n\nParameters:\n\n`pos`\n:   position of the list value that will be removed; defaults\n    to the index of the last element\n\nReturns: the removed element\n\n### `pandoc.List:sort ([comp])` {#pandoc.list:sort}\n\nSorts list elements in a given order, in-place. If `comp` is\ngiven, then it must be a function that receives two list\nelements and returns true when the first element must come\nbefore the second in the final order (so that, after the\nsort, `i < j` implies `not comp(list[j],list[i]))`. If comp\nis not given, then the standard Lua operator `<` is used\ninstead.\n\nNote that the comp function must define a strict partial\norder over the elements in the list; that is, it must be\nasymmetric and transitive. Otherwise, no valid sort may be\npossible.\n\nThe sort algorithm is not stable: elements considered equal\nby the given order may have their relative positions changed\nby the sort.\n\nThis function is identical to\n[`table.sort`](https://www.lua.org/manual/5.4/manual.html#6.6).\n\nParameters:\n\n`comp`\n:   Comparison function as described above.\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.format -->\n\n# Module pandoc.format\n\nInformation about the formats supported by pandoc.\n\n## Functions {#pandoc.format-functions}\n\n### all_extensions {#pandoc.format.all_extensions}\n\n`all_extensions (format)`\n\nReturns the list of all valid extensions for a format. No\ndistinction is made between input and output; an extension can\nhave an effect when reading a format but not when writing it, or\n*vice versa*.\n\nParameters:\n\n`format`\n:   format name (string)\n\nReturns:\n\n- all extensions supported for `format` ([FormatExtensions])\n\n*Since: 3.0*\n\n### default_extensions {#pandoc.format.default_extensions}\n\n`default_extensions (format)`\n\nReturns the list of default extensions of the given format; this\nfunction does not check if the format is supported, it will return\na fallback list of extensions even for unknown formats.\n\nParameters:\n\n`format`\n:   format name (string)\n\nReturns:\n\n- default extensions enabled for `format` ([FormatExtensions])\n\n*Since: 3.0*\n\n### extensions {#pandoc.format.extensions}\n\n`extensions (format)`\n\nReturns the extension configuration for the given format. The\nconfiguration is represented as a table with all supported\nextensions as keys and their default status as value, with `true`\nindicating that the extension is enabled by default, while `false`\nmarks a supported extension that's disabled.\n\nThis function can be used to assign a value to the `Extensions`\nglobal in custom readers and writers.\n\nParameters:\n\n`format`\n:   format identifier (string)\n\nReturns:\n\n- extensions config (table)\n\n*Since: 3.0*\n\n### from_path {#pandoc.format.from_path}\n\n`from_path (path)`\n\nParameters:\n\n`path`\n:   file path, or list of paths (string\\|{string,\\...})\n\nReturns:\n\n- format determined by heuristic (string\\|nil)\n\n*Since: 3.1.2*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.image -->\n\n# Module pandoc.image\n\nBasic image querying functions.\n\n## Functions {#pandoc.image-functions}\n\n### size {#pandoc.image.size}\n\n`size (image[, opts])`\n\nReturns a table containing the size and resolution of an image;\nthrows an error if the given string is not an image, or if the\nsize of the image cannot be determined.\n\nThe resulting table has four entries: *width*, *height*,\n*dpi_horz*, and *dpi_vert*.\n\nThe `opts` parameter, when given, should be either a WriterOptions\nobject such as `PANDOC_WRITER_OPTIONS`, or a table with a `dpi`\nentry. It affects the calculation for vector image formats such as\nSVG.\n\nParameters:\n\n`image`\n:   image data (string)\n\n`opts`\n:   writer options ([WriterOptions]\\|table)\n\nReturns:\n\n- image size information or error message (table)\n\n*Since: 3.1.13*\n\n### format {#pandoc.image.format}\n\n`format (image)`\n\nReturns the format of an image as a lowercase string.\n\nFormats recognized by pandoc include *png*, *gif*, *tiff*, *jpeg*,\n*pdf*, *svg*, *eps*, and *emf*.\n\nParameters:\n\n`image`\n:   binary image data (string)\n\nReturns:\n\n- image format, or nil if the format cannot be determined\n  (string\\|nil)\n\n*Since: 3.1.13*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.json -->\n\n# Module pandoc.json\n\nJSON module to work with JSON; based on the Aeson Haskell package.\n\n## Fields {#pandoc.json-fields}\n\n### null {#pandoc.json.null}\n\nValue used to represent the `null` JSON value. (light userdata)\n\n## Functions {#pandoc.json-functions}\n\n### decode {#pandoc.json.decode}\n\n`decode (str[, pandoc_types])`\n\nCreates a Lua object from a JSON string. If the input can be\ndecoded as representing an [Inline], [Block], [Pandoc], [Inlines],\nor [Blocks] element the function will return an object of the\nappropriate type. Otherwise, if the input does not represent any\nof the AST types, the default decoding is applied: Objects and\narrays are represented as tables, the JSON `null` value becomes\n[null], and JSON booleans, strings, and numbers are converted\nusing the Lua types of the same name.\n\nThe special handling of AST elements can be disabled by setting\n`pandoc_types` to `false`.\n\nParameters:\n\n`str`\n:   JSON string (string)\n\n`pandoc_types`\n:   whether to use pandoc types when possible. (boolean)\n\nReturns:\n\n- decoded object (any)\n\n*Since: 3.1.1*\n\n### encode {#pandoc.json.encode}\n\n`encode (object)`\n\nEncodes a Lua object as JSON string.\n\nIf the object has a metamethod with name `__tojson`, then the\nresult is that of a call to that method with `object` passed as\nthe sole argument. The result of that call is expected to be a\nvalid JSON string, but this is not checked.\n\nParameters:\n\n`object`\n:   object to convert (any)\n\nReturns:\n\n- JSON encoding of the given `object` (string)\n\n*Since: 3.1.1*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.log -->\n\n# Module pandoc.log\n\nAccess to pandoc's logging system.\n\n## Functions {#pandoc.log-functions}\n\n### info {#pandoc.log.info}\n\n`info (message)`\n\nReports a ScriptingInfo message to pandoc's logging system.\n\nParameters:\n\n`message`\n:   the info message (string)\n\n*Since: 3.2*\n\n### silence {#pandoc.log.silence}\n\n`silence (fn)`\n\nApplies the function to the given arguments while preventing log\nmessages from being added to the log. The warnings and info\nmessages reported during the function call are returned as the\nfirst return value, with the results of the function call\nfollowing thereafter.\n\nParameters:\n\n`fn`\n:   function to be silenced (function)\n\nReturns:\n\nList of log messages triggered during the function call, and any\nvalue returned by the function.\n\n*Since: 3.2*\n\n### warn {#pandoc.log.warn}\n\n`warn (message)`\n\nReports a ScriptingWarning to pandoc's logging system. The warning\nwill be printed to stderr unless logging verbosity has been set to\n*ERROR*.\n\nParameters:\n\n`message`\n:   the warning message (string)\n\n*Since: 3.2*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.path -->\n\n# Module pandoc.path\n\nModule for file path manipulations.\n\n## Fields {#pandoc.path-fields}\n\n### separator {#pandoc.path.separator}\n\nThe character that separates directories. (string)\n\n### search_path_separator {#pandoc.path.search_path_separator}\n\nThe character that is used to separate the entries in the `PATH`\nenvironment variable. (string)\n\n## Functions {#pandoc.path-functions}\n\n### directory {#pandoc.path.directory}\n\n`directory (filepath)`\n\nGets the directory name, i.e., removes the last directory\nseparator and everything after from the given path.\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- The filepath up to the last directory separator. (string)\n\n*Since: 2.12*\n\n### exists {#pandoc.path.exists}\n\n`exists (path[, type])`\n\nCheck whether there exists a filesystem object at the given path.\nIf `type` is given and either *directory* or *file*, then the\nfunction returns `true` if and only if the file system object has\nthe given type, or if it's a symlink pointing to an object of that\ntype. Passing *symlink* as type requires the path itself to be a\nsymlink. Types other than those will cause an error.\n\nParameters:\n\n`path`\n:   file path to check (string)\n\n`type`\n:   the required type of the filesystem object (string)\n\nReturns:\n\n- whether a filesystem object of type `type` exists at `path`.\n  (boolean)\n\n*Since: 3.7.1*\n\n### filename {#pandoc.path.filename}\n\n`filename (filepath)`\n\nGet the file name.\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- File name part of the input path. (string)\n\n*Since: 2.12*\n\n### is_absolute {#pandoc.path.is_absolute}\n\n`is_absolute (filepath)`\n\nChecks whether a path is absolute, i.e. not fixed to a root.\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- `true` iff `filepath` is an absolute path, `false` otherwise.\n  (boolean)\n\n*Since: 2.12*\n\n### is_relative {#pandoc.path.is_relative}\n\n`is_relative (filepath)`\n\nChecks whether a path is relative or fixed to a root.\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- `true` iff `filepath` is a relative path, `false` otherwise.\n  (boolean)\n\n*Since: 2.12*\n\n### join {#pandoc.path.join}\n\n`join (filepaths)`\n\nJoin path elements back together by the directory separator.\n\nParameters:\n\n`filepaths`\n:   path components ({string,\\...})\n\nReturns:\n\n- The joined path. (string)\n\n*Since: 2.12*\n\n### make_relative {#pandoc.path.make_relative}\n\n`make_relative (path, root[, unsafe])`\n\nContract a filename, based on a relative path. Note that the\nresulting path will never introduce `..` paths, as the presence of\nsymlinks means `../b` may not reach `a/b` if it starts from `a/c`.\nFor a worked example see [this blog post].\n\nParameters:\n\n`path`\n:   path to be made relative (string)\n\n`root`\n:   root path (string)\n\n`unsafe`\n:   whether to allow `..` in the result. (boolean)\n\nReturns:\n\n- contracted filename (string)\n\n*Since: 2.12*\n\n### normalize {#pandoc.path.normalize}\n\n`normalize (filepath)`\n\nNormalizes a path.\n\n- `//` makes sense only as part of a (Windows) network drive;\n  elsewhere, multiple slashes are reduced to a single\n  `path.separator` (platform dependent).\n- `/` becomes `path.separator` (platform dependent).\n- `./` is removed.\n- an empty path becomes `.`\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- The normalized path. (string)\n\n*Since: 2.12*\n\n### split {#pandoc.path.split}\n\n`split (filepath)`\n\nSplits a path by the directory separator.\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- List of all path components. ({string,\\...})\n\n*Since: 2.12*\n\n### split_extension {#pandoc.path.split_extension}\n\n`split_extension (filepath)`\n\nSplits the last extension from a file path and returns the parts.\nThe extension, if present, includes the leading separator; if the\npath has no extension, then the empty string is returned as the\nextension.\n\nParameters:\n\n`filepath`\n:   path (string)\n\nReturns:\n\n- filepath without extension (string)\n\n- extension or empty string (string)\n\n*Since: 2.12*\n\n### split_search_path {#pandoc.path.split_search_path}\n\n`split_search_path (search_path)`\n\nTakes a string and splits it on the `search_path_separator`\ncharacter. Blank items are ignored on Windows, and converted to\n`.` on Posix. On Windows path elements are stripped of quotes.\n\nParameters:\n\n`search_path`\n:   platform-specific search path (string)\n\nReturns:\n\n- list of directories in search path ({string,\\...})\n\n*Since: 2.12*\n\n### treat_strings_as_paths {#pandoc.path.treat_strings_as_paths}\n\n`treat_strings_as_paths ()`\n\nAugment the string module such that strings can be used as path\nobjects.\n\n*Since: 2.12*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.structure -->\n\n# Module pandoc.structure\n\nAccess to the higher-level document structure, including\nhierarchical sections and the table of contents.\n\n## Functions {#pandoc.structure-functions}\n\n### make_sections {#pandoc.structure.make_sections}\n\n`make_sections (blocks[, opts])`\n\nPuts [Blocks] into a hierarchical structure: a list of sections\n(each a Div with class \"section\" and first element a Header).\n\nThe optional `opts` argument can be a table; two settings are\nrecognized: If `number_sections` is true, a `number` attribute\ncontaining the section number will be added to each `Header`. If\n`base_level` is an integer, then `Header` levels will be\nreorganized so that there are no gaps, with numbering levels\nshifted by the given value. Finally, an integer `slide_level`\nvalue triggers the creation of slides at that heading level.\n\nNote that a [WriterOptions] object can be passed as the opts\ntable; this will set the `number_section` and `slide_level` values\nto those defined on the command line.\n\nUsage:\n\n    local blocks = {\n      pandoc.Header(2, pandoc.Str 'first'),\n      pandoc.Header(2, pandoc.Str 'second'),\n    }\n    local opts = PANDOC_WRITER_OPTIONS\n    local newblocks = pandoc.structure.make_sections(blocks, opts)\n\nParameters:\n\n`blocks`\n:   document blocks to process ([Blocks]\\|[Pandoc])\n\n`opts`\n:   options (table)\n\nReturns:\n\n- processed blocks ([Blocks])\n\n*Since: 3.0*\n\n### slide_level {#pandoc.structure.slide_level}\n\n`slide_level (blocks)`\n\nFind level of header that starts slides (defined as the least\nheader level that occurs before a non-header/non-hrule in the\nblocks).\n\nParameters:\n\n`blocks`\n:   document body ([Blocks]\\|[Pandoc])\n\nReturns:\n\n- slide level (integer)\n\n*Since: 3.0*\n\n### split_into_chunks {#pandoc.structure.split_into_chunks}\n\n`split_into_chunks (doc[, opts])`\n\nConverts a [Pandoc] document into a [ChunkedDoc].\n\nParameters:\n\n`doc`\n:   document to split ([Pandoc])\n\n`opts`\n\n:   Splitting options.\n\n    The following options are supported:\n\n        `path_template`\n        :   template used to generate the chunks' filepaths\n            `%n` will be replaced with the chunk number (padded with\n            leading 0s to 3 digits), `%s` with the section number of\n            the heading, `%h` with the (stringified) heading text,\n            `%i` with the section identifier. For example,\n            `\"section-%s-%i.html\"` might be resolved to\n            `\"section-1.2-introduction.html\"`.\n\n            Default is `\"chunk-%n\"` (string)\n\n        `number_sections`\n        :   whether sections should be numbered; default is `false`\n            (boolean)\n\n        `chunk_level`\n        :   The heading level the document should be split into\n            chunks. The default is to split at the top-level, i.e.,\n            `1`. (integer)\n\n        `base_heading_level`\n        :   The base level to be used for numbering. Default is `nil`\n            (integer|nil)\n\n    (table)\n\nReturns:\n\n- ([ChunkedDoc])\n\n*Since: 3.0*\n\n### table_of_contents {#pandoc.structure.table_of_contents}\n\n`table_of_contents (toc_source[, opts])`\n\nGenerates a table of contents for the given object.\n\nParameters:\n\n`toc_source`\n:   list of command line arguments\n    ([Blocks]\\|[Pandoc]\\|[ChunkedDoc])\n\n`opts`\n:   options ([WriterOptions])\n\nReturns:\n\n- Table of contents as a BulletList object ([Block])\n\n*Since: 3.0*\n\n### unique_identifier {#pandoc.structure.unique_identifier}\n\n`unique_identifier (inlines[, used[, exts]])`\n\nGenerates a unique identifier from a list of inlines, similar to\nwhat's generated by the `auto_identifiers` extension.\n\nThe method used to generated identifiers can be modified through\n`ext`, which is a list of format extensions.\n\nIt can be used to generate IDs similar to what the\n`auto_identifiers` extension provides.\n\nExample:\n\n     local used_ids = {}\n     function Header (h)\n       local id =\n         pandoc.structure.unique_identifier(h.content, used_ids)\n       used_ids[id] = true\n       h.identifier = id\n       return h\n     end\n\nParameters:\n\n`inlines`\n:   base for identifier ([Inlines])\n\n`used`\n:   set of identifiers (string keys, boolean values) that have\n    already been used. (table)\n\n`exts`\n:   list of format extensions ({string,\\...})\n\nReturns:\n\n- unique identifier (string)\n\n*Since: 3.8*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.system -->\n\n# Module pandoc.system\n\nAccess to the system's information and file functionality.\n\n## Fields {#pandoc.system-fields}\n\n### arch {#pandoc.system.arch}\n\nThe machine architecture on which the program is running. (string)\n\n### os {#pandoc.system.os}\n\nThe operating system on which the program is running. The most\ncommon values are `darwin` (macOS), `freebsd`, `linux`,\n`linux-android`, `mingw32` (Windows), `netbsd`, `openbsd`.\n(string)\n\n## Functions {#pandoc.system-functions}\n\n### cputime {#pandoc.system.cputime}\n\n`cputime ()`\n\nReturns the number of picoseconds CPU time used by the current\nprogram. The precision of this result may vary in different\nversions and on different platforms.\n\nReturns:\n\n- CPU time in picoseconds (integer)\n\n*Since: 3.1.1*\n\n### command {#pandoc.system.command}\n\n`command (command, args[, input[, opts]])`\n\nExecutes a system command with the given arguments and `input` on\n*stdin*.\n\nParameters:\n\n`command`\n:   command to execute (string)\n\n`args`\n:   command arguments ({string,\\...})\n\n`input`\n:   input on stdin (string)\n\n`opts`\n:   process options (table)\n\nReturns:\n\n- exit code -- `false` on success, an integer otherwise\n  (integer\\|boolean)\n\n- stdout (string)\n\n- stderr (string)\n\n*Since: 3.7.1*\n\n### copy {#pandoc.system.copy}\n\n`copy (source, target)`\n\nCopy a file with its permissions. If the destination file already\nexists, it is overwritten.\n\nParameters:\n\n`source`\n:   source file (string)\n\n`target`\n:   target destination (string)\n\n*Since: 3.7.1*\n\n### environment {#pandoc.system.environment}\n\n`environment ()`\n\nRetrieves the entire environment as a string-indexed table.\n\nReturns:\n\n- A table mapping environment variable names to their value.\n  (table)\n\n*Since: 2.7.3*\n\n### get_working_directory {#pandoc.system.get_working_directory}\n\n`get_working_directory ()`\n\nObtain the current working directory as an absolute path.\n\nReturns:\n\n- The current working directory. (string)\n\n*Since: 2.8*\n\n### list_directory {#pandoc.system.list_directory}\n\n`list_directory ([directory])`\n\nList the contents of a directory.\n\nParameters:\n\n`directory`\n:   Path of the directory whose contents should be listed.\n    Defaults to `.`. (string)\n\nReturns:\n\n- A table of all entries in `directory`, except for the special\n  entries (`.` and `..`). (table)\n\n*Since: 2.19*\n\n### make_directory {#pandoc.system.make_directory}\n\n`make_directory (dirname[, create_parent])`\n\nCreate a new directory which is initially empty, or as near to\nempty as the operating system allows. The function throws an error\nif the directory cannot be created, e.g., if the parent directory\ndoes not exist or if a directory of the same name is already\npresent.\n\nIf the optional second parameter is provided and truthy, then all\ndirectories, including parent directories, are created as\nnecessary.\n\nParameters:\n\n`dirname`\n:   name of the new directory (string)\n\n`create_parent`\n:   create parent directory if necessary (boolean)\n\n*Since: 2.19*\n\n### read_file {#pandoc.system.read_file}\n\n`read_file (filepath)`\n\nParameters:\n\n`filepath`\n:   File to read (string)\n\nReturns:\n\n- file contents (string)\n\n*Since: 3.7.1*\n\n### rename {#pandoc.system.rename}\n\n`rename (old, new)`\n\nChange the name of an existing path from `old` to `new`.\n\nIf `old` is a directory and `new` is a directory that already\nexists, then `new` is atomically replaced by the `old` directory.\nOn Win32 platforms, this function fails if `new` is an existing\ndirectory.\n\nIf `old` does not refer to a directory, then neither may `new`.\n\nRenaming may not work across file system boundaries or due to\nother system-specific reasons. It's generally more robust to copy\nthe source path to its destination before deleting the source.\n\nParameters:\n\n`old`\n:   original path (string)\n\n`new`\n:   new path (string)\n\n*Since: 3.7.1*\n\n### remove {#pandoc.system.remove}\n\n`remove (filename)`\n\nRemoves the directory entry for an existing file.\n\nParameters:\n\n`filename`\n:   file to remove (string)\n\n*Since: 3.7.1*\n\n### remove_directory {#pandoc.system.remove_directory}\n\n`remove_directory (dirname[, recursive])`\n\nRemove an existing, empty directory. If `recursive` is given, then\ndelete the directory and its contents recursively.\n\nParameters:\n\n`dirname`\n:   name of the directory to delete (string)\n\n`recursive`\n:   delete content recursively (boolean)\n\n*Since: 2.19*\n\n### times {#pandoc.system.times}\n\n`times (filepath)`\n\nObtain the modification and access time of a file or directory.\nThe times are returned as strings using the ISO 8601 format.\n\nParameters:\n\n`filepath`\n:   file or directory path (string)\n\nReturns:\n\n- time at which the file or directory was last modified (table)\n\n- time at which the file or directory was last accessed (table)\n\n*Since: 3.7.1*\n\n### with_environment {#pandoc.system.with_environment}\n\n`with_environment (environment, callback)`\n\nRun an action within a custom environment. Only the environment\nvariables given by `environment` will be set, when `callback` is\ncalled. The original environment is restored after this function\nfinishes, even if an error occurs while running the callback\naction.\n\nParameters:\n\n`environment`\n:   Environment variables and their values to be set before\n    running `callback` (table)\n\n`callback`\n:   Action to execute in the custom environment (function)\n\nReturns:\n\nThe results of the call to `callback`.\n\n*Since: 2.7.3*\n\n### with_temporary_directory {#pandoc.system.with_temporary_directory}\n\n`with_temporary_directory (parent_dir, templ, callback)`\n\nCreate and use a temporary directory inside the given directory.\nThe directory is deleted after the callback returns.\n\nParameters:\n\n`parent_dir`\n:   Parent directory to create the directory in. If this parameter\n    is omitted, the system's canonical temporary directory is\n    used. (string)\n\n`templ`\n:   Directory name template. (string)\n\n`callback`\n:   Function which takes the name of the temporary directory as\n    its first argument. (function)\n\nReturns:\n\nThe results of the call to `callback`.\n\n*Since: 2.8*\n\n### with_working_directory {#pandoc.system.with_working_directory}\n\n`with_working_directory (directory, callback)`\n\nRun an action within a different directory. This function will\nchange the working directory to `directory`, execute `callback`,\nthen switch back to the original working directory, even if an\nerror occurs while running the callback action.\n\nParameters:\n\n`directory`\n:   Directory in which the given `callback` should be executed\n    (string)\n\n`callback`\n:   Action to execute in the given directory (function)\n\nReturns:\n\nThe results of the call to `callback`.\n\n*Since: 2.7.3*\n\n### write_file {#pandoc.system.write_file}\n\n`write_file (filepath, contents)`\n\nWrites a string to a file.\n\nParameters:\n\n`filepath`\n:   path to target file (string)\n\n`contents`\n:   file contents (string)\n\n*Since: 3.7.1*\n\n### xdg {#pandoc.system.xdg}\n\n`xdg (xdg_directory_type[, filepath])`\n\nAccess special directories and directory search paths.\n\nSpecial directories for storing user-specific application data,\nconfiguration, and cache files, as specified by the [XDG Base\nDirectory Specification].\n\nParameters:\n\n`xdg_directory_type`\n\n:   The type of the XDG directory or search path. Must be one of\n    `config`, `data`, `cache`, `state`, `datadirs`, or\n    `configdirs`.\n\n    Matching is case-insensitive, and underscores and `XDG`\n    prefixes are ignored, so a value like `XDG_DATA_DIRS` is also\n    acceptable.\n\n    The `state` directory might not be available, depending on the\n    version of the underlying Haskell library. (string)\n\n`filepath`\n:   relative path that is appended to the path; ignored if the\n    result is a list of search paths. (string)\n\nReturns:\n\n- Either a single file path, or a list of search paths.\n  (string\\|{string,\\...})\n\n*Since: 3.7.1*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n\n<!-- Auto-generation temporarily disabled; needs updates in the documenation\nrenderer and in `hslua-packaging`. -->\n\n<!-- BEGIN DISABLED: AUTOGENERATED CONTENT for module pandoc.layout -->\n\n# Module pandoc.layout\n\nPlain-text document layouting.\n\n## Fields {#pandoc.layout-fields}\n\n### blankline {#pandoc.layout.blankline}\n\nInserts a blank line unless one exists already. ([Doc])\n\n### cr {#pandoc.layout.cr}\n\nA carriage return. Does nothing if we're at the beginning of a\nline; otherwise inserts a newline. ([Doc])\n\n### empty {#pandoc.layout.empty}\n\nThe empty document. ([Doc])\n\n### space {#pandoc.layout.space}\n\nA breaking (reflowable) space. ([Doc])\n\n## Functions {#pandoc.layout-functions}\n\n### after_break {#pandoc.layout.after_break}\n\n`after_break (text)`\n\nCreates a [Doc] which is conditionally included only if it comes\nat the beginning of a line.\n\nAn example where this is useful is for escaping line-initial `.`\nin roff man.\n\nParameters:\n\n`text`\n:   content to include when placed after a break (string)\n\nReturns:\n\n- new doc ([Doc])\n\n*Since: 2.18*\n\n### before_non_blank {#pandoc.layout.before_non_blank}\n\n`before_non_blank (doc)`\n\nConditionally includes the given `doc` unless it is followed by a\nblank space.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- conditional doc ([Doc])\n\n*Since: 2.18*\n\n### blanklines {#pandoc.layout.blanklines}\n\n`blanklines (n)`\n\nInserts blank lines unless they exist already.\n\nParameters:\n\n`n`\n:   number of blank lines ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- conditional blank lines ([Doc])\n\n*Since: 2.18*\n\n### braces {#pandoc.layout.braces}\n\n`braces (doc)`\n\nPuts the `doc` in curly braces.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- `doc` enclosed by {}. ([Doc])\n\n*Since: 2.18*\n\n### brackets {#pandoc.layout.brackets}\n\n`brackets (doc)`\n\nPuts the `doc` in square brackets\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- doc enclosed by \\[\\]. ([Doc])\n\n*Since: 2.18*\n\n### cblock {#pandoc.layout.cblock}\n\n`cblock (doc, width)`\n\nCreates a block with the given width and content, aligned\ncentered.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`width`\n:   block width in chars ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- doc, aligned centered in a block with max `width` chars per\n  line. ([Doc])\n\n*Since: 2.18*\n\n### chomp {#pandoc.layout.chomp}\n\n`chomp (doc)`\n\nChomps trailing blank space off of the `doc`.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- `doc` without trailing blanks ([Doc])\n\n*Since: 2.18*\n\n### concat {#pandoc.layout.concat}\n\n`concat (docs[, sep])`\n\nConcatenates a list of `Doc`s.\n\nParameters:\n\n`docs`\n:   list of Docs ([\\`{Doc,\\...}\\`]{unknown-type=\"`{Doc,...}`\"})\n\n`sep`\n:   separator (default: none) ([Doc])\n\nReturns:\n\n- concatenated doc ([Doc])\n\n*Since: 2.18*\n\n### double_quotes {#pandoc.layout.double_quotes}\n\n`double_quotes (doc)`\n\nWraps a `Doc` in double quotes.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- `doc` enclosed by `\"` chars ([Doc])\n\n*Since: 2.18*\n\n### flush {#pandoc.layout.flush}\n\n`flush (doc)`\n\nMakes a `Doc` flush against the left margin.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- flushed `doc` ([Doc])\n\n*Since: 2.18*\n\n### hang {#pandoc.layout.hang}\n\n`hang (doc, ind, start)`\n\nCreates a hanging indent.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`ind`\n:   indentation width ([integer]{unknown-type=\"integer\"})\n\n`start`\n:   document ([Doc])\n\nReturns:\n\n- `doc` prefixed by `start` on the first line, subsequent lines\n  indented by `ind` spaces. ([Doc])\n\n*Since: 2.18*\n\n### inside {#pandoc.layout.inside}\n\n`inside (contents, start, end)`\n\nEncloses a [Doc] inside a start and end [Doc].\n\nParameters:\n\n`contents`\n:   document ([Doc])\n\n`start`\n:   document ([Doc])\n\n`end`\n:   document ([Doc])\n\nReturns:\n\n- enclosed contents ([Doc])\n\n*Since: 2.18*\n\n### lblock {#pandoc.layout.lblock}\n\n`lblock (doc, width)`\n\nCreates a block with the given width and content, aligned to the\nleft.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`width`\n:   block width in chars ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- doc put into block with max `width` chars per line. ([Doc])\n\n*Since: 2.18*\n\n### literal {#pandoc.layout.literal}\n\n`literal (text)`\n\nCreates a `Doc` from a string.\n\nParameters:\n\n`text`\n:   literal value (string)\n\nReturns:\n\n- doc contatining just the literal string ([Doc])\n\n*Since: 2.18*\n\n### nest {#pandoc.layout.nest}\n\n`nest (doc, ind)`\n\nIndents a `Doc` by the specified number of spaces.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`ind`\n:   indentation size ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- `doc` indented by `ind` spaces ([Doc])\n\n*Since: 2.18*\n\n### nestle {#pandoc.layout.nestle}\n\n`nestle (doc)`\n\nRemoves leading blank lines from a `Doc`.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- `doc` with leading blanks removed ([Doc])\n\n*Since: 2.18*\n\n### nowrap {#pandoc.layout.nowrap}\n\n`nowrap (doc)`\n\nMakes a `Doc` non-reflowable.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- same as input, but non-reflowable ([Doc])\n\n*Since: 2.18*\n\n### parens {#pandoc.layout.parens}\n\n`parens (doc)`\n\nPuts the `doc` in parentheses.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- doc enclosed by (). ([Doc])\n\n*Since: 2.18*\n\n### prefixed {#pandoc.layout.prefixed}\n\n`prefixed (doc, prefix)`\n\nUses the specified string as a prefix for every line of the inside\ndocument (except the first, if not at the beginning of the line).\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`prefix`\n:   prefix for each line (string)\n\nReturns:\n\n- prefixed `doc` ([Doc])\n\n*Since: 2.18*\n\n### quotes {#pandoc.layout.quotes}\n\n`quotes (doc)`\n\nWraps a `Doc` in single quotes.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- doc enclosed in `'`. ([Doc])\n\n*Since: 2.18*\n\n### rblock {#pandoc.layout.rblock}\n\n`rblock (doc, width)`\n\nCreates a block with the given width and content, aligned to the\nright.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`width`\n:   block width in chars ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- doc, right aligned in a block with max `width` chars per line.\n  ([Doc])\n\n*Since: 2.18*\n\n### vfill {#pandoc.layout.vfill}\n\n`vfill (border)`\n\nAn expandable border that, when placed next to a box, expands to\nthe height of the box. Strings cycle through the list provided.\n\nParameters:\n\n`border`\n:   vertically expanded characters (string)\n\nReturns:\n\n- automatically expanding border Doc ([Doc])\n\n*Since: 2.18*\n\n### render {#pandoc.layout.render}\n\n`render (doc[, colwidth[, style]])`\n\nRender a [Doc]. The text is reflowed on breakable spaces to match\nthe given line length. Text is not reflowed if the line\nlength parameter is omitted or nil.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`colwidth`\n:   Maximum number of characters per line. A value of `nil`, the\n    default, means that the text is not reflown.\n    ([integer]{unknown-type=\"integer\"})\n\n`style`\n:   Whether to generate plain text or ANSI terminal output. Must\n    be either `'plain'` or `'ansi'`. Defaults to `'plain'`.\n    (string)\n\nReturns:\n\n- rendered doc (string)\n\n*Since: 2.18*\n\n### is_empty {#pandoc.layout.is_empty}\n\n`is_empty (doc)`\n\nChecks whether a doc is empty.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- `true` iff `doc` is the empty document, `false` otherwise.\n  (boolean)\n\n*Since: 2.18*\n\n### height {#pandoc.layout.height}\n\n`height (doc)`\n\nReturns the height of a block or other Doc.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- doc height ([integer]{unknown-type=\"integer\"}\\|string)\n\n*Since: 2.18*\n\n### min_offset {#pandoc.layout.min_offset}\n\n`min_offset (doc)`\n\nReturns the minimal width of a [Doc] when reflowed at breakable\nspaces.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- minimal possible width\n  ([integer]{unknown-type=\"integer\"}\\|string)\n\n*Since: 2.18*\n\n### offset {#pandoc.layout.offset}\n\n`offset (doc)`\n\nReturns the width of a [Doc] as number of characters.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- doc width ([integer]{unknown-type=\"integer\"}\\|string)\n\n*Since: 2.18*\n\n### real_length {#pandoc.layout.real_length}\n\n`real_length (str)`\n\nReturns the real length of a string in a monospace font: 0 for a\ncombining character, 1 for a regular character, 2 for an East\nAsian wide character.\n\nParameters:\n\n`str`\n:   UTF-8 string to measure (string)\n\nReturns:\n\n- text length ([integer]{unknown-type=\"integer\"}\\|string)\n\n*Since: 2.18*\n\n### update_column {#pandoc.layout.update_column}\n\n`update_column (doc, i)`\n\nReturns the column that would be occupied by the last laid out\ncharacter.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`i`\n:   start column ([integer]{unknown-type=\"integer\"})\n\nReturns:\n\n- column number ([integer]{unknown-type=\"integer\"}\\|string)\n\n*Since: 2.18*\n\n### bold {#pandoc.layout.bold}\n\n`bold (doc)`\n\nPuts a [Doc] in boldface.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- bolded Doc ([Doc])\n\n*Since: 3.4.1*\n\n### italic {#pandoc.layout.italic}\n\n`italic (doc)`\n\nPuts a [Doc] in italics.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- styled Doc ([Doc])\n\n*Since: 3.4.1*\n\n### underlined {#pandoc.layout.underlined}\n\n`underlined (doc)`\n\nUnderlines a [Doc].\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- styled Doc ([Doc])\n\n*Since: 3.4.1*\n\n### strikeout {#pandoc.layout.strikeout}\n\n`strikeout (doc)`\n\nPuts a line through the [Doc].\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\nReturns:\n\n- styled Doc ([Doc])\n\n*Since: 3.4.1*\n\n### fg {#pandoc.layout.fg}\n\n`fg (doc, color)`\n\nSet the foreground color.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`color`\n:   One of 'black', 'red', 'green', 'yellow', 'blue', 'magenta'\n    'cyan', or 'white'. (string)\n\nReturns:\n\n- styled Doc ([Doc])\n\n*Since: 3.4.1*\n\n### bg {#pandoc.layout.bg}\n\n`bg (doc, color)`\n\nSet the background color.\n\nParameters:\n\n`doc`\n:   document ([Doc])\n\n`color`\n:   One of 'black', 'red', 'green', 'yellow', 'blue', 'magenta'\n    'cyan', or 'white'. (string)\n\nReturns:\n\n- styled Doc ([Doc])\n\n*Since: 3.4.1*\n\n## Types {#pandoc.layout-types}\n\n### Doc {#type-pandoc.Doc}\n\nSee the description [above][Doc].\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.scaffolding -->\n\n# Module pandoc.scaffolding\n\nScaffolding for custom writers.\n\n## Fields {#pandoc.scaffolding-fields}\n\n### Writer {#pandoc.scaffolding.Writer}\n\nAn object to be used as a `Writer` function; the construct handles\nmost of the boilerplate, expecting only render functions for all\nAST elements (table)\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.text -->\n\n# Module pandoc.text\n\nUTF-8 aware text manipulation functions, implemented in Haskell.\n\nThe text module can also be loaded under the name `text`, although\nthis is discouraged and deprecated.\n\n``` lua\n-- uppercase all regular text in a document:\nfunction Str (s)\n  s.text = pandoc.text.upper(s.text)\n  return s\nend\n```\n\n## Functions {#pandoc.text-functions}\n\n### fromencoding {#pandoc.text.fromencoding}\n\n`fromencoding (s[, encoding])`\n\nConverts a string to UTF-8. The `encoding` parameter specifies the\nencoding of the input string. On Windows, that parameter defaults\nto the current ANSI code page; on other platforms the function\nwill try to use the file system's encoding.\n\nThe set of known encodings is system dependent, but includes at\nleast `UTF-8`, `UTF-16BE`, `UTF-16LE`, `UTF-32BE`, and `UTF-32LE`.\nNote that the default code page on Windows is available through\n`CP0`.\n\nParameters:\n\n`s`\n:   string to be converted (string)\n\n`encoding`\n:   target encoding (string)\n\nReturns:\n\n- UTF-8 string (string)\n\n*Since: 3.0*\n\n### len {#pandoc.text.len}\n\n`len (s)`\n\nReturns the length of a UTF-8 string, i.e., the number of\ncharacters.\n\nParameters:\n\n`s`\n:   UTF-8 encoded string (string)\n\nReturns:\n\n- length (integer\\|string)\n\n*Since: 2.0.3*\n\n### lower {#pandoc.text.lower}\n\n`lower (s)`\n\nReturns a copy of a UTF-8 string, converted to lowercase.\n\nParameters:\n\n`s`\n:   UTF-8 string to convert to lowercase (string)\n\nReturns:\n\n- Lowercase copy of `s` (string)\n\n*Since: 2.0.3*\n\n### reverse {#pandoc.text.reverse}\n\n`reverse (s)`\n\nReturns a copy of a UTF-8 string, with characters reversed.\n\nParameters:\n\n`s`\n:   UTF-8 string to revert (string)\n\nReturns:\n\n- Reversed `s` (string)\n\n*Since: 2.0.3*\n\n### sub {#pandoc.text.sub}\n\n`sub (s, i[, j])`\n\nReturns a substring of a UTF-8 string, using Lua's string indexing\nrules.\n\nParameters:\n\n`s`\n:   UTF-8 string (string)\n\n`i`\n:   substring start position (integer)\n\n`j`\n:   substring end position (integer)\n\nReturns:\n\n- text substring (string)\n\n*Since: 2.0.3*\n\n### subscript {#pandoc.text.subscript}\n\n`subscript (input)`\n\nTries to convert the string into a Unicode subscript version of\nthe string. Returns `nil` if not all characters of the input can\nbe mapped to a subscript Unicode character. Supported characters\ninclude numbers, parentheses, and plus/minus.\n\nParameters:\n\n`input`\n:   string to convert to subscript characters (string)\n\nReturns:\n\n- Subscript version of the input, or `nil` if not all characters\n  could be converted. (string\\|nil)\n\n*Since: 3.8*\n\n### superscript {#pandoc.text.superscript}\n\n`superscript (input)`\n\nTries to convert the string into a Unicode superscript version of\nthe string. Returns `nil` if not all characters of the input can\nbe mapped to a superscript Unicode character. Supported characters\ninclude numbers, parentheses, and plus/minus.\n\nParameters:\n\n`input`\n:   string to convert to superscript characters (string)\n\nReturns:\n\n- Superscript version of the input, or `nil` if not all characters\n  could be converted. (string\\|nil)\n\n*Since: 3.8*\n\n### toencoding {#pandoc.text.toencoding}\n\n`toencoding (s[, enc])`\n\nConverts a UTF-8 string to a different encoding. The `encoding`\nparameter defaults to the current ANSI code page on Windows; on\nother platforms it will try to guess the file system's encoding.\n\nThe set of known encodings is system dependent, but includes at\nleast `UTF-8`, `UTF-16BE`, `UTF-16LE`, `UTF-32BE`, and `UTF-32LE`.\nNote that the default code page on Windows is available through\n`CP0`.\n\nParameters:\n\n`s`\n:   UTF-8 string (string)\n\n`enc`\n:   target encoding (string)\n\nReturns:\n\n- re-encoded string (string)\n\n*Since: 3.0*\n\n### upper {#pandoc.text.upper}\n\n`upper (s)`\n\nReturns a copy of a UTF-8 string, converted to uppercase.\n\nParameters:\n\n`s`\n:   UTF-8 string to convert to uppercase (string)\n\nReturns:\n\n- Uppercase copy of `s` (string)\n\n*Since: 2.0.3*\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.template -->\n\n# Module pandoc.template\n\nHandle pandoc templates.\n\n## Functions {#pandoc.template-functions}\n\n### apply {#pandoc.template.apply}\n\n`apply (template, context)`\n\nApplies a context with variable assignments to a template,\nreturning the rendered template. The `context` parameter must be a\ntable with variable names as keys and [Doc], string, boolean, or\ntable as values, where the table can be either be a list of the\naforementioned types, or a nested context.\n\nParameters:\n\n`template`\n:   template to apply ([Template])\n\n`context`\n:   variable values (table)\n\nReturns:\n\n- rendered template ([Doc])\n\n*Since: 3.0*\n\n### compile {#pandoc.template.compile}\n\n`compile (template[, templates_path])`\n\nCompiles a template string into a [Template] object usable by\npandoc.\n\nIf the `templates_path` parameter is specified, then it should be\nthe file path associated with the template. It is used when\nchecking for partials. Partials will be taken only from the\ndefault data files if this parameter is omitted.\n\nAn error is raised if compilation fails.\n\nParameters:\n\n`template`\n:   template string (string)\n\n`templates_path`\n:   parameter to determine a default path and extension for\n    partials; uses the data files templates path by default.\n    (string)\n\nReturns:\n\n- compiled template ([Template])\n\n*Since: 2.17*\n\n### default {#pandoc.template.default}\n\n`default ([writer])`\n\nReturns the default template for a given writer as a string. An\nerror is thrown if no such template can be found.\n\nParameters:\n\n`writer`\n:   name of the writer for which the template should be retrieved;\n    defaults to the global `FORMAT`. (string)\n\nReturns:\n\n- raw template (string)\n\n*Since: 2.17*\n\n### get {#pandoc.template.get}\n\n`get (filename)`\n\nRetrieve text for a template.\n\nThis function first checks the resource paths for a file of this\nname; if none is found, the `templates` directory in the user data\ndirectory is checked. Returns the content of the file, or throws\nan error if no file is found.\n\nParameters:\n\n`filename`\n:   name of the template (string)\n\nReturns:\n\n- content of template file (string)\n\n*Since: 3.2.1*\n\n### meta_to_context {#pandoc.template.meta_to_context}\n\n`meta_to_context (meta, blocks_writer, inlines_writer)`\n\nCreates template context from the document's [Meta] data, using\nthe given functions to convert [Blocks] and [Inlines] to [Doc]\nvalues.\n\nParameters:\n\n`meta`\n:   document metadata ([Meta])\n\n`blocks_writer`\n:   converter from [Blocks] to [Doc] values (function)\n\n`inlines_writer`\n:   converter from [Inlines] to [Doc] values (function)\n\nReturns:\n\n- template context (table)\n\n*Since: 3.0*\n\n## Types {#pandoc.template-types}\n\n### Template {#type-pandoc.template.Template}\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.types -->\n\n# Module pandoc.types\n\nConstructors for types that are not part of the pandoc AST.\n\n## Functions {#pandoc.types-functions}\n\n### Version {#pandoc.types.Version}\n\n`Version (version_specifier)`\n\nParameters:\n\n`version_specifier`\n:   A version string like `'2.7.3'`, a Lua number like `2.0`, a\n    list of integers like `{2,7,3}`, or a Version object.\n    (string\\|number\\|{integer,\\...}\\|[Version])\n\nReturns:\n\n- New Version object. ([Version])\n\n*Since: 2.7.3*\n\n### Sources {#pandoc.types.Sources}\n\n`Sources (srcs)`\n\nCreates a new Sources element, i.e., a list of [Source] items.\n\nPandoc's text readers expect the input text to be paired with\ninformation on where the text originated, e.g., a file name. This\nabstraction is provided via the `Sources` type.\n\nPandoc accepts a range of objects wherever a *Sources* list is\nexpected:\n\n- a list of [Source] items;\n- a simple string, which becomes an unnamed source;\n- a list of table objects, where each table contains the fields\n  `name` (the filepath) and `text` (the file contents)\n\nA Sources list can be converted to a string via the default\n`tostring` Lua function. This will concatenate all source items.\n\nParameters:\n\n`srcs`\n:   sources (string\\|{string,\\...}\\|table)\n\nReturns:\n\n- new Sources object ({[Source],\\...})\n\n*Since: 3.9.1*\n\n## Types {#pandoc.types-types}\n\n### Source {#type-pandoc.types.Source}\n\n### Version {#type-pandoc.types.Version}\n\n#### Methods\n\n##### Version.must_be_at_least {#Version.must_be_at_least}\n\n`Version.must_be_at_least (self, reference[, msg])`\n\nParameters:\n\n`self`\n:   version to check ([Version])\n\n`reference`\n:   minimum version ([Version])\n\n`msg`\n:   alternative message (string)\n\nReturns:\n\nReturns no result, and throws an error if this version is older\nthan `reference`.\n\n<!-- END: AUTOGENERATED CONTENT -->\n\n<!-- Disabled due to limitations in the current documentation\n     renderer. -->\n<!-- BEGIN DISABLED: AUTOGENERATED CONTENT for module pandoc.zip -->\n\n# Module pandoc.zip\n\nFunctions to create, modify, and extract files from zip archives.\n\nThe module can be called as a function, in which case it behaves\nlike the `zip` function described below.\n\nZip options are optional; when defined, they must be a table with\nany of the following keys:\n\n- `recursive`: recurse directories when set to `true`;\n- `verbose`: print info messages to stdout;\n- `destination`: the value specifies the directory in which to\n  extract;\n- `location`: value is used as path name, defining where files are\n  placed.\n- `preserve_symlinks`: Boolean value, controlling whether symbolic\n  links are preserved as such. This option is ignored on Windows.\n\n## Functions {#pandoc.zip-functions}\n\n### Archive {#pandoc.zip.Archive}\n\n`Archive ([bytestring_or_entries])`\n\nReads an *Archive* structure from a raw zip archive or a list of\nEntry items; throws an error if the given string cannot be decoded\ninto an archive.\n\nParameters:\n\n`bytestring_or_entries`\n:   binary archive data or list of entries; defaults to an empty\n    list (string\\|{[zip.Entry],\\...})\n\nReturns:\n\n- new Archive ([zip.Archive])\n\n*Since: 3.0*\n\n### Entry {#pandoc.zip.Entry}\n\n`Entry (path, contents[, modtime])`\n\nGenerates a ZipEntry from a filepath, uncompressed content, and\nthe file's modification time.\n\nParameters:\n\n`path`\n:   file path in archive (string)\n\n`contents`\n:   uncompressed contents (string)\n\n`modtime`\n:   modification time (integer)\n\nReturns:\n\n- a new zip archive entry ([zip.Entry])\n\n*Since: 3.0*\n\n### read_entry {#pandoc.zip.read_entry}\n\n`read_entry (filepath[, opts])`\n\nGenerates a ZipEntry from a file or directory.\n\nParameters:\n\n`filepath`\n:   (string)\n\n`opts`\n:   zip options (table)\n\nReturns:\n\n- a new zip archive entry ([zip.Entry])\n\n*Since: 3.0*\n\n### zip {#pandoc.zip.zip}\n\n`zip (filepaths[, opts])`\n\nPackage and compress the given files into a new Archive.\n\nParameters:\n\n`filepaths`\n:   list of files from which the archive is created.\n    ({string,\\...})\n\n`opts`\n:   zip options (table)\n\nReturns:\n\n- a new archive ([zip.Archive])\n\n*Since: 3.0*\n\n## Types {#pandoc.zip-types}\n\n### zip.Archive {#type-pandoc.zip.Archive}\n\n#### Properties {#type-pandoc.zip.Archive-properties}\n\n##### entries {#type-pandoc.zip.Archive.entries}\n\nFiles in this zip archive ({[zip.Entry],\\...})\n\n#### Methods {#type-pandoc.zip.Archive-methods}\n\n##### bytestring {#pandoc.zip.Archive.bytestring}\n\n`bytestring (self)`\n\nReturns the raw binary string representation of the archive.\n\nParameters:\n\n`self`\n:    ([zip.Archive])\n\nReturns:\n\n- bytes of the archive (string)\n\n##### extract {#pandoc.zip.Archive.extract}\n\n`extract (self[, opts])`\n\nExtract all files from this archive, creating directories as\nneeded. Note that the last-modified time is set correctly only in\nPOSIX, not in Windows. This function fails if encrypted entries\nare present.\n\nParameters:\n\n`self`\n:    ([zip.Archive])\n\n`opts`\n:   zip options (table)\n\n### zip.Entry {#type-pandoc.zip.Entry}\n\n#### Properties {#type-pandoc.zip.Entry-properties}\n\n##### modtime {#type-pandoc.zip.Entry.modtime}\n\nModification time (seconds since unix epoch)\n([integer]{unknown-type=\"integer\"})\n\n##### path {#type-pandoc.zip.Entry.path}\n\nRelative path, using `/` as separator ([zip.Entry])\n\n#### Methods {#type-pandoc.zip.Entry-methods}\n\n##### contents {#pandoc.zip.Entry.contents}\n\n`contents (self[, password])`\n\nGet the uncompressed contents of a zip entry. If `password` is\ngiven, then that password is used to decrypt the contents. An\nerror is throws if decrypting fails.\n\nParameters:\n\n`self`\n:    ([zip.Entry])\n\n`password`\n:   password for entry (string)\n\nReturns:\n\n- binary contents (string)\n\n##### symlink {#pandoc.zip.Entry.symlink}\n\n`symlink (self)`\n\nReturns the target if the Entry represents a symbolic link, and\n`nil` otherwise. Always returns `nil` on Windows.\n\nParameters:\n\n`self`\n:    ([zip.Entry])\n\nReturns:\n\n- link target if entry represents a symbolic link (string\\|nil)\n\n[zip.Entry]: #type-pandoc.zip.Entry\n[zip.Archive]: #type-pandoc.zip.Archive\n<!-- END DISABLED: AUTOGENERATED CONTENT -->\n\n<!-- BEGIN: GENERATED REFERENCE LINKS -->\n\n  [Blocks]: #type-blocks\n  [Meta]: #type-meta\n  [Pandoc]: #type-pandoc\n  [Inlines]: #type-inlines\n  [MetaValue]: #type-metavalue\n  [Block]: #type-block\n  [Attr]: #type-attr\n  [Figure]: #type-figure\n  [Caption]: #type-caption\n  [ListAttributes]: #type-listattributes\n  [ColSpec]: #type-colspec\n  [TableHead]: #type-tablehead\n  [TableBody]: #type-tablebody\n  [TableFoot]: #type-tablefoot\n  [Inline]: #type-inline\n  [Span]: #type-span\n  [Str]: #type-str\n  [AttributeList]: #type-attributes\n  [Alignment]: #type-alignment\n  [Cell]: #type-cell\n  [Row]: #type-row\n  [SimpleTable]: #type-simpletable\n  [Table]: #type-table\n  [Version]: #type-version\n  [`list`]: #pandoc.mediabag.list\n  [FormatExtensions]: #FormatExtensions\n  [WriterOptions]: #type-writeroptions\n  [null]: #pandoc.json.null\n  [this blog post]: http://neilmitchell.blogspot.co.uk/2015/10/filepaths-are-subtle-symlinks-are-hard.html\n  [ChunkedDoc]: #type-chunkeddoc\n  [XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/latest/\n  [Doc]: #type-doc\n  [Template]: #type-template\n  [Source]: #type-pandoc.types.Source\n"
  },
  {
    "path": "doc/nix.md",
    "content": "---\ntitle: Using NiX to develop pandoc\nauthor: John MacFarlane\n---\n\nThe source directory contains `shell.nix` and `flake.nix`,\nso if you have NiX installed, you can use either `nix shell`\nor `nix develop` can be used to obtain a shell with pandoc\ndependencies installed.\n\nTo set up `direnv` so that the NiX shell is automatically\nactivated whenever the directory is entered, add the following\n`.envrc` in the pandoc source directory:\n\n```\nif ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then\n    source_url \"https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc\" \"sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=\"\nfi\nuse flake\n```\n\nThis uses [nix-direnv] for caching.  See its web page for\nfurther help.\n\n[nix-direnv]: https://github.com/nix-community/nix-direnv\n\n"
  },
  {
    "path": "doc/org.md",
    "content": "---\ntitle: Org-mode features and differences\nauthor: Albert Krewinkel\n---\n\nPandoc's handling of org files is similar to that of Emacs\norg-mode. This document aims to highlight the cases where this is\nnot possible or just not the case yet.\n\nExport options\n==============\n\nThe following export keywords are supported. (Because they\npopulate metadata fields, they will not generally affect the\noutput unless you use the `-s/--standalone` option to generate\na standalone document with metadata.)\n\n- AUTHOR: comma-separated list of author(s); fully supported.\n\n- CREATOR: output generator; passed as plain-text metadata entry\n  `creator`, but not used by any default templates.\n\n- DATE: creation or publication date; well supported by pandoc.\n\n- EMAIL: author email address; passed as plain-text metadata\n  field `email`, but not used by any default templates.\n\n- LANGUAGE: document language; included as plain-text metadata\n  field `lang`. The value should be a [BCP47 language tag].\n\n- SELECT_TAGS: tags which select a tree for export.\n\n- EXCLUDE\\_TAGS: tags which prevent a subtree from being\n  exported. Fully supported.\n\n- TITLE: document title; fully supported.\n\n- EXPORT\\_FILE\\_NAME: target filename; *unsupported*, the output\n  defaults to stdout unless a target has to be given as a command\n  line option.\n\n::: {.alert .alert-info}\nPandoc tries to be compatible with org-mode when exporting an org document. If\nyou find some behavior confusing, please do refer to org-mode\n[Export-Settings](https://orgmode.org/manual/Export-Settings.html)\ndocumentation. For example, a common confusion\n([#3214](https://github.com/jgm/pandoc/issues/3214 \"Problem with headers lower\nthen 3 in org-mode reader\"), [#5169](https://github.com/jgm/pandoc/issues/5169\n\"org mode headings past level three converted to numbered outline list\"),\n[#6145](https://github.com/jgm/pandoc/issues/6145 \"Headers 4 levels deep render\ndifferently\"), [#7236](https://github.com/jgm/pandoc/issues/7236 \"In Org mode,\nHeader with level > 3 are not recognized as headers\")) is treatment of headers\nwith level > 3 differently because org-mode sets `org-export-headline-levels`\n(configurable with `#+OPTIONS: H:3`) to 3 by default.\n:::\n\n[BCP47 language tag]: https://tools.ietf.org/html/bcp47\n\nFormat-specific options\n-----------------------\n\nEmacs Org-mode supports additional export options which work for\nspecific export formats. Some of these options' behavior differs\nin Org-mode depending on the output format, while pandoc is\nformat-agnostic when parsing; differences are noted where they\noccur.\n\n- DESCRIPTION: the document's description; pandoc parses this\n  option as text with markup into the `description` metadata\n  field. The field is not used in default templates.\n\n  Pandoc follows the LaTeX exporter in that it allows markup in\n  the description. In contrast, the Org-mode HTML exporter treats\n  the description as plain text.\n\n- LATEX\\_HEADER and LATEX_HEADER_EXTRA: arbitrary lines to add to\n  the document's preamble. Contrary to Org-mode, these lines are\n  not inserted before the hyperref settings, but close to the end\n  of the preamble.\n\n  The contents of this option are stored as a list of raw LaTeX\n  lines in the `header-includes` metadata field.\n\n- LATEX\\_CLASS: the LaTeX document class; like Org-mode, pandoc\n  uses `article` as the default class.\n\n  The contents of this option are stored as plain text in the\n  `documentclass` metadata field.\n\n- LATEX\\_CLASS\\_OPTIONS: Options for the LaTeX document class;\n  fully supported.\n\n  The contents of this option are stored as plain text in the\n  `classoption` metadata field.\n\n- SUBTITLE: the document's subtitle; fully supported.\n\n  The content of this option is stored as inlines in the\n  `subtitle` metadata field.\n\n- HTML\\_HEAD and HTML\\_HEAD\\_EXTRA: arbitrary lines to add to the\n  HTML document's head; fully supported.\n\n  The contents of these options are stored as a list of raw HTML\n  lines in the `header-includes` metadata field.\n\nPandoc-specific options\n-----------------------\n\nPandoc recognizes some export options not used by Emacs Org.\n\n- NOCITE: this field adds the listed citations to the\n  bibliography, without the need to mention them to the text. The\n  special value `@*` causes all available references to be added\n  the bibliography.\n\n- HEADER-INCLUDES: like HTML_HEAD and, LATEX_HEADER, but treats\n  the option's value as normal text with markup.\n\n- INSTITUTE: Affiliation of the author; the value is read as text\n  with markup and is stored in the `institute` metadata field. The\n  field is included by default on the title slide of beamer\n  presentations.\n\nOther options\n-------------\n\nAny export option or directive not listed above has no effect when\nparsing with pandoc. However, the information is retained as a\n*raw block*. It can be accessed through a\n[filter](https://pandoc.org/filters.html) and will be included in\norg output.\n\n### Directives as metadata\n\nAs an example, we will restore an old behavior of pandoc versions\nprior to 2.10. Unknown keywords were treated as variable\ndefinitions, and were added the document's metadata. Typing\n`#+key: value` in the org-file used to have the same effect as\nrunning pandoc with the `--metadata key=value` option.\n\nSince pandoc 2.10, each unhandled line starting with `#+` is kept\ninternally as a raw block with format `org`. This block can be\ninspected and processed by a filter. Below is a [Lua\nfilter](https://pandoc.org/lua-filters.html) which converts these\nunhandled lines into metadata key-value pairs.\n\n``` lua\n-- intermediate store for variables and their values\nlocal variables = {}\n\n--- Function called for each raw block element.\nfunction RawBlock (raw)\n  -- Don't do anything unless the block contains *org* markup.\n  if raw.format ~= 'org' then return nil end\n\n  -- extract variable name and value\n  local name, value = raw.text:match '#%+(%w+):%s*(.+)$'\n  if name and value then\n    variables[name] = value\n  end\nend\n\n-- Add the extracted variables to the document's metadata.\nfunction Meta (meta)\n  for name, value in pairs(variables) do\n    meta[name] = value\n  end\n  return meta\nend\n```\n\nTables\n======\n\nPandoc supports normal org tables (sometimes called \"pipe tables\")\nand grid tables (tables created by [table.el]).\n\nColumn widths\n-------------\n\nOrg mode tables don't allow line-breaks within cells, and lines\nwhich contain text can get very long. This often leads to tables\nwhich run off the page when exporting, especially when exporting\nto PDF via LaTeX. Overlong lines in the source text are this is\nusually hidden by setting a [column width], but the default Emacs\nexporters ignore that setting. Pandoc deviates from Emacs's\nbehavior and uses this information to resize the table columns\nwhen exporting.\n\nLimitations\n-----------\n\nThere is no support yet for cells spanning multiple columns or\nrows. The table.el grid tables allows rowspans and colspans and so\ndoes pandoc's internal structure since 2.10, but the parser has\nnot been updated yet.\n\n[table.el]: http://table.sourceforge.net/\n[column width]: https://orgmode.org/manual/Column-Width-and-Alignment.html\n\nEmphasis rules\n==============\n\nOrg-mode uses complex rules to decide whether a string\nrepresents emphasized text. In Emacs, this can be customized via\nthe variable `org-emphasis-regexp-components`. A variable like\nthis doesn't fit well with pandoc's model. Instead, it is\npossible to use special lines to change these values:\n\n    #+pandoc-emphasis-pre: \"-\\t ('\\\"{\\x200B\"\n    #+pandoc-emphasis-post: \"-\\t\\n .,:!?;'\\\")}[\\x200B\"\n\nThe above describes the default values of these variables. The\narguments must be valid (Haskell) strings. If interpretation of\nthe argument as string fails, the default is restored.\n\nChanging emphasis rules only affect the part of the document\nfollowing the special lines. They must be some of the first\nlines to alter parsing behavior for the whole document. It is\nalso possible to change the values temporarily for selected\nsections only. The string `test` in the following snippet will\nbe read as emphasized text, while the rest of the document will\nbe parsed using default emphasis rules:\n\n    #+pandoc-emphasis-pre: \"[\"\n    #+pandoc-emphasis-post: \"]\"\n    [/test/]\n    #+pandoc-emphasis-pre:\n    #+pandoc-emphasis-post:\n\n`smart` extension\n=================\n\nOrg-mode allows to insert certain characters via special character\nsequences. For example, instead of typing the Unicode /HORIZONTAL\nELLISPIS/ character `…` by hand, one can instead type tree dots\n`...`. En dashes and em dashes can be written as `--` and `---`\nrespectively. Furthermore, quotation marks (`\"`) and\napostrophe-quotes (`'`) can be treated in a \"smart\" way,\npotentially replacing them with proper, language specific unicode\nquotation characters.\n\nLike in Markdown, these behaviors can be turned on all-at-once by\nenabling the `smart` extension. However, disabling `smart` (the\ndefault) will *not* necessarily disable smart quotes and special\nstrings. Instead, it will just result in the default Org mode\nbehavior.\n\nThe special string feature can be turned off via the `#+OPTIONS:\n-:nil` [export setting]. There are currently no command line flags\nwhich control these features. As a workaround, one can use process\nsubstitution, a feature supported by most shells. It allows to\nprovide the options line on the command line:\n\n    pandoc -f org <(printf \"#+OPTIONS: -:nil\\n\") …\n\n[export setting]: https://orgmode.org/manual/Export-Settings.html\n\n`fancy_lists` extension\n=======================\n\nOrg-mode has a variable `org-list-allow-alphabetical` that when\nset to `t`, allows ordered lists with single-character\nalphabetical markers. Since this variable is `nil` by default,\nalphabetical markers can be optionally enabled in Pandoc by\nenabling the `fancy_lists` extension.\n\nWhen `fancy_lists` is enabled, Pandoc will also parse list\nmarkers starting with one lowercase or uppercase alphabetical\ncharacter, like `a.` and `D)`. Contrary to the use of this\nextension in markdown, roman numerals or the `#` placeholder\ncan't be used as markers as they are not allowed in Org-mode.\n\nOne additional behavior that is enabled by the `fancy_lists`\nextension is that the `.` and `)` delimiters for list markers\nwill be distinguished by Pandoc. In essence, this means that when\nconverting Org into formats like LaTeX, Pandoc will respect the\ntype of delimiter that you used in your Org file, instead of\nalways using the default delimiter for the exported format.\n\nCurrently unsupported features\n==============================\n\nLibrary of babel\n----------------\n\nThe library of babel translates between various programming\nlanguages. This is out-of-scope for pandoc. Use Emacs to run\ncode, then feed the resulting org file to pandoc.\n"
  },
  {
    "path": "doc/pandoc-lua.md",
    "content": "---\ntitle: pandoc-lua\nsection: 1\ndate: September 22, 2022\n---\n\n# SYNOPSIS\n\n`pandoc-lua` [*options*] [*script* [*args*]]\n\n# DESCRIPTION\n\n`pandoc-lua` is a standalone Lua interpreter with behavior similar\nto that of the standard `lua` executable, but exposing all of\npandoc's Lua libraries. All `pandoc.*` packages, as well as the\npackages `re` and `lpeg`, are available via global variables.\nFurthermore, the globals `PANDOC_VERSION`, `PANDOC_STATE`, and\n`PANDOC_API_VERSION` are set at startup.\n\nIf no script argument is given, then the script is assumed to be\npassed in via *stdin*. When called without arguments, `pandoc-lua`\nbehaves as `pandoc-lua -v -i` when the standard input (`stdin`) is\na terminal, and as `pandoc-lua -` otherwise. On Windows the\nprogram will always behave as if it was connected to a terminal.\n\nWhen called without the option `-E`, the interpreter checks for an\nenvironment variable `LUA_INIT` before running any argument. If\nthe variable content has the format *`@filename`*, then\n`pandoc-lua` executes the file. Otherwise, `pandoc-lua` executes\nthe string itself.\n\n# OPTIONS\n\n`-e stat`\n:   Execute statement `stat`.\n\n`-l mod`\n:   If mod has the pattern `g=m`, then require library `m` into\n    global `g`; otherwise require library `mod` into global\n    `mod`.\n\n`-v`\n:   Show version information.\n\n`-i`\n:   Enter interactive mode after running *script*.\n\n`-E`\n:   Ignore environment variables. This is not fully implemented\n    yet and only ignores the `LUA_INIT` variable. Other variables\n    like `LUA_PATH` and `LUA_CPATH` are **not** ignored.\n\n`-W`\n:   Turn warnings on.\n\n# INTERACTIVE MODE\n\nIn interactive mode, the Lua interpreter repeatedly prompts and\nwaits for a line. After reading a line, Lua first tries to\ninterpret the line as an expression. If it succeeds, it prints its\nvalue. Otherwise, it interprets the line as a statement. If you\nwrite an incomplete statement, the interpreter waits for its\ncompletion by issuing a different prompt.\n\nExit the interactive mode by pressing `Ctrl-D` or `Ctrl-C`, or by\ntyping `os.exit()`. The *Isocline* library is used for line\nediting. Press `F1` to get a list of available keybindings; the\n`ctrl` key is abbreviated as `^` in that list.\n\n# AUTHORS\n\nCopyright 2023 John MacFarlane (jgm@berkeley.edu) and\ncontributors. Released under the [GPL], version 2 or later. This\nsoftware carries no warranty of any kind. (See COPYRIGHT for full\ncopyright and warranty notices.)\n\nLua: Copyright 1994-2023 Lua.org, PUC-Rio.\n\n[GPL]: https://www.gnu.org/copyleft/gpl.html \"GNU General Public License\"\n\n"
  },
  {
    "path": "doc/pandoc-server.md",
    "content": "---\ntitle: pandoc-server\nsection: 1\ndate: August 15, 2022\n---\n\n# SYNOPSIS\n\n`pandoc-server` [*options*]\n\n# DESCRIPTION\n\n`pandoc-server` is a web server that can perform pandoc\nconversions.  It can be used either as a running server\nor as a CGI program.\n\nTo use `pandoc-server` as a CGI program, rename it (or symlink\nit) as `pandoc-server.cgi`. (Note: if you symlink it, you may\nneed to adjust your webserver's configuration in order to allow\nit to follow symlinks for the CGI script.)\n\nAll pandoc functions are run in the PandocPure monad, which\nensures that they can do no I/O operations on the server.\nThis should provide a high degree of security. This security\ndoes, however, impose certain limitations:\n\n- PDFs cannot be produced.\n\n- Filters are not supported.\n\n- Resources cannot be fetched via HTTP.\n\n- Any images, include files, or other resources needed for\n  the document conversion must be explicitly included in\n  the request, via the `files` field (see below under API).\n\n# OPTIONS\n\n`--port NUM`\n:    HTTP port on which to run the server.  Default: 3030.\n\n`--timeout SECONDS`\n:    Timeout in seconds, after which a conversion is killed. Default: 2.\n\n     When `pandoc-server` is run as a CGI program, this option\n     can be set via the `PANDOC_SERVER_TIMEOUT` environment variable.\n\n`--help`\n:    Print this help.\n\n`--version`\n:    Print version.\n\n# API\n\n## Root endpoint\n\nThe root (`/`) endpoint accepts only POST requests.\n\n### Response\n\nIt returns a converted document in one of the following\nformats (in order of preference), depending on the `Accept` header:\n\n- `application/octet-stream`\n- `text/plain`\n- `application/json`\n\nIf the result is a binary format (e.g., `epub` or `docx`)\nand the content is returned as plain text or JSON, the\nbinary will be base64 encoded.\n\nIf a JSON response is given, it will have one of the\nfollowing formats. If the conversion is not successful:\n\n```\n{ \"error\": string with the error message }\n```\n\nIf the conversion is successful:\n\n```\n{ \"output\": string with textual or base64-encoded binary output,\n  \"base64\": boolean (true means the \"output\" is base64-encoded),\n  \"messages\": array of message objects (see below) }\n```\n\nEach element of the \"messages\" array will have the format\n\n```\n{ \"message\": string,\n  \"verbosity\": string (either \"WARNING\" or \"INFO\") }\n```\n\n### Request\n\nThe body of the POST request should be a JSON object,\nwith the following fields.  Only the `text` field is\nrequired; all of the others can be omitted for default\nvalues.  When there are several string alternatives,\nthe first one given is the default.\n\n`text` (string)\n\n:   The document to be converted.  Note:\n    if the `from` format is binary (e.g., `epub` or `docx`), then\n    `text` should be a base64 encoding of the document.\n\n`from` (string, default `\"markdown\"`)\n\n:   The input format, possibly with extensions, just as it is\n    specified on the pandoc command line.\n\n`to` (string, default `\"html\"`)\n\n:   The output format, possibly with extensions, just as it is\n    specified on the pandoc command line.\n\n`shift-heading-level-by` (integer, default 0)\n\n:   Increase or decrease the level of all headings.\n\n`indented-code-classes` (array of strings)\n\n:   List of classes to be applied to indented Markdown code blocks.\n\n`default-image-extension` (string)\n\n:   Extension to be applied to image sources that lack extensions\n    (e.g. `\".jpg\"`).\n\n`metadata` (JSON map)\n\n:   String-valued metadata.\n\n`tab-stop` (integer, default 4)\n\n:   Tab stop (spaces per tab).\n\n`track-changes` (`\"accept\"|\"reject\"|\"all\"`)\n\n:   Specifies what to do with insertions, deletions, and\n    comments produced by the MS Word \"Track Changes\" feature. Only\n    affects docx input.\n\n`abbreviations` (file path)\n\n:   List of strings to be regarded as abbreviations when\n    parsing Markdown. See `--abbreviations` in `pandoc(1)` for\n    details.\n\n`standalone` (boolean, default false)\n\n:   If true, causes a standalone document to be produced, using\n    the default template or the custom template specified using\n    `template`.  If false, a fragment will be produced.\n\n`template` (string)\n\n:   String contents of a document template (see Templates in\n    `pandoc(1)` for the format).\n\n`variables` (JSON map)\n\n:   Variables to be interpolated in the template. (See Templates\n    in `pandoc(1)`.)\n\n`dpi` (integer, default 96)\n\n:   Dots-per-inch to use for conversions between pixels and\n    other measurements (for image sizes).\n\n`wrap` (`\"auto\"|\"preserve\"|\"none\"`)\n\n:   Text wrapping option: either `\"auto\"` (automatic\n    hard-wrapping to fit within a column width), `\"preserve\"`\n    (insert newlines where they are present in the source),\n    or `\"none\"` (don't insert any unnecessary newlines at all).\n\n`columns` (integer, default 72)\n\n:   Column width (affects text wrapping and calculation of\n    table column widths in plain text formats)\n\n`table-of-contents` (boolean, default false)\n\n:   Include a table of contents (in supported formats).\n\n`toc-depth` (integer, default 3)\n\n:   Depth of sections to include in the table of contents.\n\n`list-of-figures` (boolean, default false)\n\n:   Include a list of figures (in supported formats).\n\n`list-of-tables` (boolean, default false)\n\n:   Include a list of tables (in supported formats).\n\n`strip-comments` (boolean, default false)\n\n:   Causes HTML comments to be stripped in Markdown or Textile\n    source, instead of being passed through to the output format.\n\n`syntax-highlighting` (`\"default\"|\"none\"|\"idiomatic\"|style`)\n\n:   The method used for code syntax highlighting. Setting a\n    specific *style* causes highlighting to be performed with the\n    internal highlighting engine, using KDE syntax definitions and\n    styles. The `\"idiomatic\"` method uses a format-specific\n    highlighter if one is available, or the default style if the\n    target format has no idiomatic highlighting method. Setting\n    this option to `none` disables all syntax highlighting. The\n    `\"default\"` method uses a format-specific default.\n\n    Standard styles are `\"pygments\"` (the default), `\"kate\"`,\n    `\"monochrome\"`, `\"breezeDark\"`, `\"espresso\"`, `\"zenburn\"`,\n    `\"haddock\"`, and `\"tango\"`. Alternatively, the path of a\n    `.theme` with a KDE syntax theme may be used (in this case,\n    the relevant file contents must also be included in `files`,\n    see below).\n\n    The default for HTML, EPUB, Docx, Ms, Man, and LaTeX output is\n    to use the internal highlighter with the default style; Typst\n    output relies on Typst's own syntax highlighting system by\n    default.\n\n`embed-resources`\n\n:   Embed images, scripts, styles and other resources in an HTML\n    document using `data` URIs.  Note that this will not work\n    unless the contents of all external resources are included\n    under `files`.\n\n`html-q-tags` (boolean, default false)\n\n:   Use `<q>` elements in HTML instead of literal quotation marks.\n\n`ascii` (boolean, default false)\n\n:   Use entities and escapes when possible to avoid non-ASCII\n    characters in the output.\n\n`reference-links` (boolean, default false)\n\n:   Create reference links rather than inline links in Markdown output.\n\n`reference-location` (`\"document\"|\"section\"|\"block\"`)\n\n:   Determines whether link references and footnotes are placed\n    at the end of the document, the end of the section, or the\n    end of the block (e.g. paragraph), in\n    certain formats. (See `pandoc(1)` under `--reference-location`.)\n\n`setext-headers` (boolean, default false)\n\n:   Use Setext (underlined) headings instead of ATX (`#`-prefixed)\n    in Markdown output.\n\n`top-level-division` (`\"default\"|\"part\"|\"chapter\"|\"section\"`)\n\n:   Determines how top-level headings are interpreted in\n    LaTeX, ConTeXt, DocBook, and TEI.  The `\"default\"` value\n    tries to choose the best interpretation based on heuristics.\n\n`number-sections` (boolean, default false)\n\n:   Automatically number sections (in supported formats).\n\n\n`number-offset` (array of integers)\n\n:   Offsets to be added to each component of the section number.\n    For example, `[1]` will cause the first section to be\n    numbered \"2\" and the first subsection \"2.1\"; `[0,1]` will\n    cause the first section to be numbered \"1\" and the first\n    subsection \"1.2.\"\n\n`html-math-method` (`\"plain\"|\"webtex\"|\"gladtex\"|\"mathml\"|\"mathjax\"|\"katex\"`)\n\n:   Determines how math is represented in HTML.\n\n`listings` (boolean, default false)\n\n:   Use the `listings` package to format code in LaTeX output.\n\n`incremental` (boolean, default false)\n\n:   If true, lists appear incrementally by default in slide shows.\n\n`slide-level` (integer)\n\n:   Heading level that deterimes slide divisions in slide shows.\n    The default is to pick the highest heading level under which\n    there is body text.\n\n`section-divs` (boolean, default false)\n\n:   Arrange the document into a hierarchy of nested sections\n    based on the headings.\n\n`email-obfuscation` (`\"none\"|\"references\"|\"javascript\"`)\n\n:   Determines how email addresses are obfuscated in HTML.\n\n`identifier-prefix` (string)\n\n:   Prefix to be added to all automatically-generated identifiers.\n\n`title-prefix` (string)\n\n:   Prefix to be added to the title in the HTML header.\n\n`reference-doc` (file path)\n\n:   Reference doc to use in creating `docx` or `odt` or `pptx`.\n    See `pandoc(1)` under `--reference-doc` for details.\n    The contents of the file must be included under `files`.\n\n`split-level` (integer, default 1)\n\n:   Heading level at which documents are split in EPUB or\n    chunked HTML.\n\n`epub-cover-image` (file path)\n\n:   Cover image for EPUB.\n    The contents of the file must be included under `files`.\n\n`epub-metadata` (file path)\n\n:   Path of file containing Dublin core XML elements to be used for\n    EPUB metadata.  The contents of the file must be included\n    under `files`.\n\n`epub-subdirectory` (string, default \"EPUB\")\n\n:   Name of content subdirectory in the EPUB container.\n\n`epub-fonts` (array of file paths)\n\n:   Fonts to include in the EPUB. The fonts themselves must be\n    included in `files` (see below).\n\n`ipynb-output` (`\"best\"|\"all\"|\"none\"`)\n\n:   Determines how ipynb output cells are treated. `all` means\n    that all of the data formats included in the original are\n    preserved.  `none` means that the contents of data cells\n    are omitted.  `best` causes pandoc to try to pick the\n    richest data block in each output cell that is compatible\n    with the output format.\n\n`citeproc` (boolean, default false)\n\n:   Causes citations to be processed using citeproc.  See\n    Citations in `pandoc(1)` for details.\n\n`bibliography` (array of file paths)\n\n:   Files containing bibliographic data. The contents of the\n    files must be included in `files`.\n\n`csl` (file path)\n\n:   CSL style file. The contents of the file must be included\n    in `files`.\n\n`cite-method` (`\"citeproc\"|\"natbib\"|\"biblatex\"`)\n\n:   Determines how citations are formatted in LaTeX output.\n\n`files` (JSON mapping of file paths to base64-encoded strings)\n\n:   Any files needed for the conversion, including images\n    referred to in the document source, should be included here.\n    Binary data must be base64-encoded.  Textual data may be\n    left as it is, unless it is *also* valid base 64 data,\n    in which case it will be interpreted that way.\n\n## `/batch` endpoint\n\nThe `/batch` endpoint behaves like the root endpoint,\nexcept for these two points:\n\n- It accepts a JSON array, each element of which is a JSON\n  object like the one expected by the root endpoint.\n- It returns a JSON array of JSON results.\n\nThis endpoint can be used to convert a sequence of small\nsnippets in one request.\n\n## `/version` endpoint\n\nThe `/version` endpoint accepts a GET request and returns\nthe pandoc version as a plain or JSON-encoded string,\ndepending on Accept headers.\n\n## `/babelmark` endpoint\n\nThe `/babelmark` endpoint accepts a GET request with\nthe following query parameters:\n\n- `text` (required string)\n- `from` (optional string, default is `\"markdown\"`)\n- `to` (optional string, default is `\"html\"`)\n- `standalone` (optional boolean, default is `false`)\n\nIt returns a JSON object with fields `html` and `version`.\nThis endpoint is designed to support the\n[Babelmark](https://babelmark.github.io) website.\n\n# AUTHORS\n\nCopyright 2022 John MacFarlane (jgm@berkeley.edu). Released\nunder the [GPL], version 2 or greater.  This software carries no\nwarranty of any kind.  (See COPYRIGHT for full copyright and\nwarranty notices.)\n\n[GPL]: https://www.gnu.org/copyleft/gpl.html \"GNU General Public License\"\n\n"
  },
  {
    "path": "doc/press.md",
    "content": "% Press\n\nHere are some books, articles, and blogs that discuss pandoc:\n\n# Articles\n\n- [Pandoc](http://en.wikipedia.org/wiki/Pandoc) on Wikipedia.\n\n- Egon Willighagen, [Two years of explicit CiTO\n  annotations](https://doi.org/10.1186/s13321-023-00683-2).\n  Journal of Cheminformatics 15, 14 (2023). doi:\n  10.1186/s13321-023-00683-2.\n\n- Albert Krewinkel, Juanjo Bazán, and Afron M. Smith,\n  [\"JATS from Markdown: Developer friendly single-source\n  scholarly\n  publishing\"](https://www.ncbi.nlm.nih.gov/books/NBK579698/),\n  *JATS-Con Proceedings 2022*.\n\n- A. Ohri and T. Schmah, [\"Machine Translation of Mathematical\n  Text,\"](https://doi.org/10.1109/ACCESS.2021.3063715) in\n  *IEEE Access*, vol. 9, pp. 38078-38086, 2021,\n  doi: 10.1109/ACCESS.2021.3063715.\n\n- Julien Dehut, [\"En finir avec Word ! Pour une analyse des\n  enjeux relatifs aux traitements de texte et à leur\n  utilisation\"](https://eriac.hypotheses.org/80),\n  *L'Atelier des Savoirs*, January 23, 2018.\n\n- Phillips, Lee.  [\"Technical Writing with Pandoc and\n  Panflute\"](https://lee-phillips.org/panflute-gnuplot/).\n  Reproduced with permission from *Linux Journal*, September, 2017.\n\n- Krewinkel, Albert and Robert Winkler.  [\"Formatting Open\n  Science: agile creation of multiple document types by writing\n  academic manuscripts in pandoc\n  markdown.\"](https://peerj.com/preprints/2648/).\n  *PeerJ Preprints*.\n\n- Krijnen, Jacco, Doaitse Swierstra, and Marcos O. Viera. [\"Expand:\n  Towards an Extensible Pandoc\n  System.\"](http://dx.doi.org/10.1007/978-3-319-04132-2_14)\n  *Practical Aspects of Declarative Languages* (Springer International\n  Publishing, 2014), 200--215.\n\n- Kielhorn, Axel. [\"Multi-target publishing-Generating ePub, PDF, and\n  more, from Markdown using\n  pandoc.\"](https://www.tug.org/TUGboat/tb32-3/tb102kielhorn.pdf)\n  *TUGboat-TeX Users Group* 32, no. 3 (2011): 272.\n\n- Massimiliano Dominici. [\"An Overview of Pandoc.\"](http://www.dw.tug.org/TUGboat/tb35-1/tb109dominici.pdf),\n  *TUGboat* 32 (2014), n. 1: 44-50.\n\n- Gieben, R. [\"Writing I-Ds and RFCs Using Pandoc and a Bit of\n  XML.\"](https://tools.ietf.org/html/rfc7328.html) (RFC 7328, 2014).\n\n- Ovadia, Steven (2014). [\"Markdown for Librarians and\n  Academics\".](http://www.tandfonline.com/doi/pdf/10.1080/01639269.2014.904696)\n  *Behavioral & Social Sciences Librarian* 33 (2): 120–124.\n  doi:10.1080/01639269.2014.904696\n\n- Daniel Burgos and Alberto Corbí, \"Semi-Automated Correction Tools for\n  Mathematics-Based Exercises in MOOC Environments,\"\n  [*International Journal of Artificial Intelligence and Interactive Multimedia*,\n  3](http://www.ijimai.org/journal/sites/default/files/journals/IJIMAI20153_3.pdf), 89-95.\n\n- Garnett A, Alperin JP, Willinsky J. \"The Public Knowledge Project XML\n  Publishing Service and meTypeset: Don't call it 'Yet Another\n  Word-to-JATS Conversion Kit'.\" *Journal Article Tag Suite\n  Conference (JATS-Con) Proceedings* 2015 [Internet]. Bethesda (MD):\n  National Center for Biotechnology Information (US); 2015. Available\n  from: <http://www.ncbi.nlm.nih.gov/books/NBK279666/>\n\n# Books\n\n- Digital Publishing Toolkit Collective,\n  [*From Print to EBooks: A Hybrid Publishing Toolkit for the Arts*](http://networkcultures.org/blog/publication/from-print-to-ebooks-a-hybrid-publishing-toolkit-for-the-arts/)\n  (Institute of Network Cultures), ch. 6.\n\n- Hasecke, Jan Ulrich. [*Das ZEN von Pandoc: Bücher und E-Books einfach\nund professionell\nproduzieren*](http://www.amazon.com/Das-ZEN-von-Pandoc-professionell-ebook/dp/B00TQ55D34).\n\n- Michael Kofler,\n  [*Markdown und\n  Pandoc*](http://www.amazon.com/Markdown-Pandoc-German-Michael-Kofler-ebook/dp/B00CX7HIOO/ref=sr_1_1?ie=UTF8&qid=1424543894&sr=8-1&keywords=pandoc).\n\n# Blog posts\n\n- Grec, Dan (2021), [\"How I self-published a professional paperback and\n  eBook using LaTeX and\n  Pandoc\"](http://theroadchoseme.com/how-i-self-published-a-professional-paperback-and-ebook-using-latex-and-pandoc),\n  The Road Chose Me.\n\n- Grandesso, Piero (2018-03-23). [\"A pandoc-based layout workflow for\n  scholarly journals\"](http://pierog.it/en/2018/03/markdown-workflow/).\n  Piero G: Notes on Open Access, Scholarly Publishing etc.\n\n- Krewinkel, Albert (2017-12-23). [\"Extending pandoc with\n  Lua\"](http://lua.space/general/extending-pandoc-with-lua).\n  Lua.Space.\n\n- Pullum, Geoffrey (2017-03-13).  [\"Word-Processing\n  Misery\"](http://www.chronicle.com/blogs/linguafranca/2017/03/13/word-processing-hell/).\n  The Chronicle of Higher Education Blogs: Lingua Franca.\n\n- Curiositry (2017-02-28).  [\"Pandoc for\n  Writers\"](http://www.autodidacts.io/convert-markdown-to-standard-manuscript-format-odts-docs-and-pdfs-with-pandoc/).\n  The Autodidacts.\n\n- Tenen, Dennis and Grant Wythoff (2014-03-19). [\"Sustainable Authorship\n  in Plain Text using Pandoc and Markdown\"](http://programminghistorian.org/lessons/sustainable-authorship-in-plain-text-using-pandoc-and-markdown). The Programming\n  Historian.\n\n- Mullen, Lincoln (2012-02-23). [\"Pandoc Converts All Your (Text)\n   Documents\"](http://chronicle.com/blogs/profhacker/pandoc-converts-all-your-text-documents/38700), The Chronicle of Higher Education Blogs: ProfHacker.\n\n- Mullen, Lincoln (2012-03-20). [\"Make Your Own E-Books with\n  Pandoc\"](http://chronicle.com/blogs/profhacker/make-your-own-e-books-with-pandoc/39067). The Chronicle of Higher Education Blogs: ProfHacker.\n\n- Fenner, Martin (2013-12-12). [\"From Markdown to JATS XML in one\n  Step\"](http://blog.martinfenner.org/2013/12/12/from-markdown-to-jats-xml-in-one-step/). Gobbledygook.\n\n- McDaniel, W. Caleb (2012-09-28). [\"Why (and How) I Wrote My Academic\n  Book in Plain Text\"](http://wcm1.web.rice.edu/my-academic-book-in-plain-text.html).\n\n- Healy, Kieran (2014-01-23). [\"Plain Text, Papers, Pandoc\"](http://kieranhealy.org/blog/archives/2014/01/23/plain-text/).\n\n- Till, Kaitlyn, Shed Simas, and Velma Larkai (2014-04-14). [\"The Flying\n  Narwhal: Small mag workflow\"](http://tkbr.ccsp.sfu.ca/mpub/2014/04/14/the-flying-narwhal-small-mag-workflow/#more-639). Publishing @ SFU.\n\n- Maxwell, John (2013-11-01). [\"Building Publishing Workflows with\n Pandoc and Git\"](http://www.ccsp.sfu.ca/2013/11/building-publishing-workflows-with-pandoc-and-git/). Publishing @ SFU.\n\n- Maxwell, John (2014-02-26). [\"On Pandoc\"](http://tkbr.ccsp.sfu.ca:5001/Slides/On%20Pandoc). eBound Canada: Digital Production Workshop, Vancouver, BC.\n\n- Puppet labs (2013-11-28).\n  [\"How We Automated our Ebook Builds with Pandoc and KindleGen.\"](http://puppetlabs.com/blog/automated-ebook-generation-convert-markdown-epub-mobi-pandoc-kindlegen).\n\n- Fenner, Martin (2014-08-25).\n  [\"Using Microsoft Word with\n  git.\"](http://blog.martinfenner.org/2014/08/25/using-microsoft-word-with-git/).\n\n- Wouter Soudan (2015-12-02). [\"From Word to Markdown to InDesign: \n   Fully automated typesetting.\"](http://rhythmus.be/md2indd/)\n\n- Mattia Tezzele (2015-11-24), [\"Typesetting automation: A Plain-text workflow for painless\n  production of personal documents & offline\n  correspondence---featuring Pandoc, LaTeX, and a simple\n  makefile](http://mrzool.cc/writing/typesetting-automation/)\n\n# Talks\n\n- MacFarlane, John (2014-05-17). [\"Pandoc for Haskell Hackers\"](http://johnmacfarlane.net/BayHac2014/#/). BayHac 2014, Mountain View, CA.\n\n\n"
  },
  {
    "path": "doc/short-guide-to-pandocs-sources.md",
    "content": "---\ntitle: Short guide to pandoc's sources\nsubtitle: Laying a path for code wanderers\nauthor: Albert Krewinkel\ndate: 2021-06-07\n---\n\nPandoc, the universal document converter, can serve as a nice intro\ninto functional programming with Haskell. For many contributors,\nincluding the author of this guide, pandoc was their first real\nexposure to this language. Despite its impressive size of more than\n60.000 lines of Haskell code (excluding the test suite), pandoc is\nstill very approachable due to its modular architecture. It can\nserve as an interesting subject for learning.\n\nThis guide exists to navigate the large amount of sources, to\nlay-out a path that can be followed for learning, and to explain the\nunderlying concepts.\n\nA basic understanding of Haskell and of pandoc's functionality is\nassumed.\n\n# Getting the code\n\nPandoc has a publicly accessible git repository on GitHub:\n<https://github.com/jgm/pandoc>. To get a local copy of the source:\n\n    git clone https://github.com/jgm/pandoc\n\nThe source for the main pandoc program is `app/pandoc.hs`. The\nsource for the pandoc library is in `src/`, the source for the tests\nis in `test/`, and the source for the benchmarks is in `benchmark/`.\n\nCore type definitions are in the separate [*pandoc-types* repo].\nGet it with\n\n    git clone https://github.com/jgm/pandoc-types\n\nThe organization of library and test sources is identical to the\nmain repo.\n\n[*pandoc-types* repo]: https://github.com/jgm/pandoc-types\n\n# Document representation\n\nThe way documents are represented in pandoc is part of its success.\nEvery document is read into one central data structure, the\nso-called *abstract syntax tree* (AST).\n\nThe AST is defined in module `Text.Pandoc.Definition` in package\n[*pandoc-types*].\n\nIt is not necessary to understand the AST in detail, just check-out\nthe following points:\n\n * The [`Pandoc`][def-Pandoc] type serves as the central structure.\n\n * A document has metadata and a list of \"block\" elements.\n\n * There are various types of [blocks][def-Block]; some contain raw\n   text, others contain \"Inline\" elements.\n\n * [Inlines][def-Inline] are \"running text\", with many different\n   types. The most important constructors are `Str` (a word),\n   `Space` (a space char), `Emph` (emphasized text), and `Strong`\n   (strongly emphasized text). It's worth checking their\n   definitions.\n\n * Element attributes are captured as [`Attr`][def-Attr], which is a\n   triple of the element identifier, its classes, and the key-value\n   pairs.^[For plans to change this see [jgm/pandoc-types#88].]\n\n[*pandoc-types*]: https://hackage.haskell.org/package/pandoc-types\n[jgm/pandoc-types#88]: https://github.com/jgm/pandoc-types/issues/88\n[def-Pandoc]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Pandoc\n[def-Block]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Block\n[def-Inline]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Inline\n[def-Attr]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Attr\n\n# Basic architecture\n\nTake a look at pandoc's source files. The code is below the `src`\ndirectory, in the `Text.Pandoc` module. The basic flow is:\n\n 1. Document is parsed into the internal representation by a\n    *reader*;\n\n 2. the document AST is modified (optional);\n\n 3. then the internal representation is converted into the target\n    format by a *writer*.\n\nThe [*readers*] can be found in `Text.Pandoc.Readers`, while the\n[*writers*] are submodules of `Text.Pandoc.Writers`. The document\nmodification step is powerful and used in different ways, e.g., in\n[*filters*].\n\nThese parts are the \"muscles\" of pandoc, which do the heavy lifting.\nEverything else can be thought of as the bones and fibers to which\nthese parts are attached and which make them usable.\n\n# Writers\n\nWriters are usually simpler than readers and therefore easier to\ngrasp.\n\nBroadly speaking, there are three kind of writers:\n\n 1. Text writers: these are used for lightweight markup languages\n    and generate plain text output. Examples: Markdown, Org,\n    reStructuredText.\n 2. XML writers, which convert the AST into structured XML.\n    Examples: HTML, JATS.\n 3. Binary writers, which are like XML writers, but combine the\n    output with other data and zip it into a single file. Examples:\n    docx, epub.\n\n Most writers follow a common pattern and have three main functions:\n docTo*Format*, blockTo*Format* and inlineTo*Format*. Each converts\n the `Pandoc`, `Block`, and `Inline` elements, respectively. The\n *XWiki* and *TEI* writers are comparatively simple and suitable\n samples when taking a first look.\n\n Most writers are self-contained in that most of the conversion code\n is within a single module. However, newer writers often use a\n different setup: those are built around modules from an external\n package. The details of how to serialize the document are not in\n the writer module itself, but in an external module. The writer\n only has to convert pandoc's AST into the document representation\n used by the module. Good examples: commonmark, jira.\n\n## DocLayout\n\nAll writers build on the `doclayout` package. It can be thought of\nas a pretty printer with extra features suitable for lightweight\nmarkup languages. E.g., multiple blank lines are collapsed into a\nsingle blank line, unless multiple blank lines are specifically\nrequested.  This simplifies the code significantly.\n\nSee the repo at https://github.com/jgm/doclayout, and the [hackage\ndocumentation](https://hackage.haskell.org/package/doclayout)\n\n# Readers\n\nThe same distinction that applies to writers also applies to\nreaders. Readers for XML formats use XML parsing libraries, while\nplain text formats are parsed with [parsec].\n\n## Builders\n\nThe plain type constructors from the [`Text.Pandoc.Definition`]\nmodule can be difficult to use, which is why the module\n[`Text.Pandoc.Builder`] exists. It offers functions to conveniently\nbuild and combine AST elements.\n\nThe most interesting and important types in `Builder` are\n[`Blocks`][def-Blocks] and [`Inlines`][def-Inlines]. All type\nconstructors use simple lists for sequences of AST elements.\nBuilding lists can be awkward and often comes with bad performance\ncharacteristics, esp. when appending. The `Blocks` and `Inlines`\ntypes are better suited for these operations and are therefore used\nextensively in builder functions.\n\nThe builder functions are named with the convention that the suffix\n`With` is added if the first argument is an `Attr`; there is usually\nanother function without that suffix, creating an element with no\nattributes.\n\n[def-Blocks]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Builder.html#Blocks\n[def-Inlines]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Builder.html#Inlines\n[parsec]: https://hackage.haskell.org/package/parsec\n\n# PandocMonad\n\nLooking at the readers and writers, one will notice that they all\noperate within the `PandocMonad` type class. This class gives access\nto options, file operations, and other shared information. The\ntypeclass has two main implementations: one operates in IO, so on\nthe \"real world\", while the other provides a pure functional\ninterface, suitable to \"mock\" an environment for testing.\n\n# Document modifications\n\nOne of the big advantages of a central document structure is that it\nallows document modifications via a unified interface. This section\ndescribes the multiple ways in which the document can be altered.\n\n## Walkable\n\nDocument traversal happens through the `Walkable` class in module\n`Text.Pandoc.Walk` ([*pandoc-types* package]).\n\n## Transformations\n\nTransformations are simple modifications controllable through\ncommand-line options.\n\n## Filters\n\nFilters allow to use Lua or any external language to perform\ndocument transformations.\n\n\n[`Text.Pandoc.Builder`]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Builder.html\n[`Text.Pandoc.Definition`]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Definition.html\n\n# Module overview\n\nThe library is structured as follows:\n\n  - `Text.Pandoc` is a top-level module that exports what is needed\n    by most users of the library.  Any patches that add new readers\n    or writers will need to make changes here, too.\n  - `Text.Pandoc.Definition` (in `pandoc-types`) defines the types\n    used for representing a pandoc document.\n  - `Text.Pandoc.Builder` (in `pandoc-types`) provides functions for\n    building pandoc documents programmatically.\n  - `Text.Pandoc.Generics` (in `pandoc-types`) provides functions allowing\n    you to promote functions that operate on parts of pandoc documents\n    to functions that operate on whole pandoc documents, walking the\n    tree automatically.\n  - `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*`\n    are the writers.\n  - `Text.Pandoc.Citeproc.*` contain the code for citation handling,\n    including an interface to the [citeproc] library.\n  - `Text.Pandoc.Data` is used to embed data files when the `embed_data_files`\n    cabal flag is used.\n  - `Text.Pandoc.Emoji` is a thin wrapper around [emojis].\n  - `Text.Pandoc.Highlighting` contains the interface to the\n    skylighting library, which is used for code syntax highlighting.\n  - `Text.Pandoc.ImageSize` is a utility module containing functions for\n    calculating image sizes from the contents of image files.\n  - `Text.Pandoc.MIME` contains functions for associating MIME types\n    with extensions.\n  - `Text.Pandoc.Lua.*` implement Lua filters.\n  - `Text.Pandoc.Options` defines reader and writer options.\n  - `Text.Pandoc.PDF` contains functions for producing PDFs.\n  - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers.\n    the needs of pandoc.\n  - `Text.Pandoc.SelfContained` contains functions for making an HTML\n    file \"self-contained,\" by importing remotely linked images, CSS,\n    and JavaScript and turning them into `data:` URLs.\n  - `Text.Pandoc.Shared` is a grab-bag of shared utility functions.\n  - `Text.Pandoc.Writers.Shared` contains utilities used in writers only.\n  - `Text.Pandoc.Slides` contains functions for splitting a markdown document\n    into slides, using the conventions described in the MANUAL.\n  - `Text.Pandoc.Templates` defines pandoc's templating system.\n  - `Text.Pandoc.UTF8` contains functions for converting text to and from\n    UTF8 bytestrings (strict and lazy).\n  - `Text.Pandoc.Asciify` contains functions to derive ascii versions of\n    identifiers that use accented characters.\n  - `Text.Pandoc.UUID` contains functions for generating UUIDs.\n  - `Text.Pandoc.XML` contains functions for formatting XML.\n\n\n<!--\n# Templating\n## DocTemplates\n-->\n"
  },
  {
    "path": "doc/typst-property-output.md",
    "content": "---\ntitle: Typst property output\nauthor: Gordon Woodhull\n---\n\nPandoc Typst property output\n============================\n\nIn addition to the output of structural properties built into Pandoc's Typst Writer, the Writer can also output non-structural Typst properties. This is enabled by setting attributes with keys of the form `typst:prop` or `typst:text:prop` on supported elements.\n\n\nTypst properties\n----------------\n\n[Typst](https://typst.app/) allows specification of visual and layout properties as parameters to elements\n\n```typst\n#block(fill=orange)[Hello]\n```\n\nand set-rules\n\n```typst\n#set text(fill=blue); Hello\n```\n\nThe parameter values are [Typst code](https://typst.app/docs/reference/syntax/#modes) that can use any features of the Typst language.\n\nPandoc Typst property output\n----------------------------\n\nFor the set of supported Pandoc elements, the Pandoc Typst Writer will output attributes as parameters to corresponding Typst elements or set-text rules. \n\nThe Typst Writer looks for attributes with keys of the form `typst:prop` or `typst:text:prop` and assumes the values are raw Typst code.\n\n`prop` is the name of the property to set.\n\nFor example, `pandoc -f html -t typst` with HTML input\n\n```html\n<div typst:inset=\"10pt\">foo</div>\n```\n\nproduces Typst output\n\n```typst\n#block(inset: 10pt)[\nfoo\n]\n```\n\nand with HTML input\n\n```html\n<div typst:text:fill=\"purple\">foo</div>\n```\n\nit produces Typst output\n\n```typst\n#block[\n#set text(fill: purple); foo\n]\n```\n\nThe Typst Writer does not check the validity of `prop` or the value. Since Typst is a statically typed language, improper property names or values usually result in compilation failure.\n\nSupported elements\n------------------\n\nThe following Pandoc AST elements are currently supported. More may be supported in the future.\n\n- [Span](https://pandoc.org/lua-filters.html#type-span)\n\n  `typst:text:prop`\n\n  : The content is wrapped in a Typst [text element](https://typst.app/docs/reference/text/text/) with the specified properties set.\n\n- [Div](https://pandoc.org/lua-filters.html#type-div)\n\n  `typst:prop`\n\n  : The `prop` is output as a parameter to the Typst [block element](https://typst.app/docs/reference/layout/block/).\n\n  `typst:text:prop`\n\n  : The `prop` is output as a parameter to a set-text rule at the start of the block content.\n\n- [Table](https://pandoc.org/lua-filters.html#type-table)\n\n  `typst:prop`\n\n  : The `prop` is output as a parameter to the Typst [table element](https://typst.app/docs/reference/model/table/).\n\n  `typst:text:prop`\n\n  : The table is wrapped in a Typst [text element](https://typst.app/docs/reference/text/text/) with `prop` as one of its parameters.\n\n  `typst:no-figure` (class)\n\n  : By default, Pandoc will wrap the table in a Typst [figure element](https://typst.app/docs/reference/model/figure/). If the table has this class, only the table element itself will be emitted. This avoids Typst's crossreference counter of kind `table` from being incremented.\n\n  `typst:figure:kind`\n\n  : If this attribute is set, Pandoc will wrap the table in a Typst [figure element](https://typst.app/docs/reference/model/figure/) with the specified `kind` attribute. This is useful for tables that should be cross-referenced as something other than `Table ...` in the document. Typst will use the `kind` attribute to increment the corresponding counter: `raw` and `image`.\n\n- Table [Cell](https://pandoc.org/lua-filters.html#type-cell)\n\n  `typst:prop`\n\n  : The `prop` is output as a parameter to the Typst table [cell element](https://typst.app/docs/reference/model/table/#definitions-cell).\n\n  `typst:text:prop`\n\n  : The `prop` is output as a parameter to a set-text rule at the start of the cell content.\n\n\nLua filter example\n------------------\n\nHere is a minimal example of a Lua filter which translates the CSS [color property](https://developer.mozilla.org/en-US/docs/Web/CSS/color) on a span element to the equivalent [fill parameter](https://typst.app/docs/reference/text/text/#parameters-fill) on a Typst text element.\n\n```lua\nfunction styleToTable(style)\n  if not style then return nil end\n  local ret = {}\n  for clause in style:gmatch('([^;]+)') do\n    k,v = clause:match(\"([%w-]+)%s*:%s*(.*)$\")\n    ret[k] = v\n  end\n  return ret\nend\n\nfunction Span(span)\n  local style = styleToTable(span.attributes['style'])\n  if not style then return end\n  if style['color'] then\n    span.attributes['typst:text:fill'] = style['color']\n  end\n  return span\nend\n```\n\nGiven the HTML input\n\n```html\n<p>Here is some <span style=\"color:orange\">orange text</span>.</p>\n```\n\nthe command\n\n```sh\npandoc -f html -t typst --lua-filter ./typst-property-example.lua\n```\n\nwill produce the Typst output\n\n```typst\nHere is some #text(fill: orange)[orange text].\n```\n\nOf course, this simple filter will only work for Typst's [predefined colors](https://typst.app/docs/reference/visualize/color/#predefined-colors). A more complete filter would need to translate the value as well.\n"
  },
  {
    "path": "doc/using-the-pandoc-api.md",
    "content": "% Using the pandoc API\n% John MacFarlane\n\nPandoc can be used as a Haskell library, to write your own\nconversion tools or power a web application.  This document\noffers an introduction to using the pandoc API.\n\nDetailed API documentation at the level of individual functions\nand types is available at\n<https://hackage.haskell.org/package/pandoc>.\n\n# Pandoc's architecture\n\nPandoc is structured as a set of *readers*, which translate\nvarious input formats into an abstract syntax tree (the\nPandoc AST) representing a structured document, and a set of\n*writers*, which render this AST into various output formats.\nPictorially:\n\n```\n[input format] ==reader==> [Pandoc AST] ==writer==> [output format]\n```\n\nThis architecture allows pandoc to perform $M \\times N$\nconversions with $M$ readers and $N$ writers.\n\nThe Pandoc AST is defined in the\n[pandoc-types](https://hackage.haskell.org/package/pandoc-types)\npackage.  You should start by looking at the Haddock\ndocumentation for [Text.Pandoc.Definition].  As you'll see, a\n`Pandoc` is composed of some metadata and a list of `Block`s.\nThere are various kinds of `Block`, including `Para`\n(paragraph), `Header` (section heading), and `BlockQuote`.  Some\nof the `Block`s (like `BlockQuote`) contain lists of `Block`s,\nwhile others (like `Para`) contain lists of `Inline`s, and still\nothers (like `CodeBlock`) contain plain text or nothing.\n`Inline`s are the basic elements of paragraphs.  The distinction\nbetween `Block` and `Inline` in the type system makes it\nimpossible to represent, for example, a link (`Inline`) whose\nlink text is a block quote (`Block`).  This expressive\nlimitation is mostly a help rather than a hindrance, since many\nof the formats pandoc supports have similar limitations.\n\nThe best way to explore the pandoc AST is to use `pandoc -t\nnative`, which will display the AST corresponding to some\nMarkdown input:\n\n```\n% echo -e \"1. *foo*\\n2. bar\" | pandoc -t native\n[OrderedList (1,Decimal,Period)\n [[Plain [Emph [Str \"foo\"]]]\n ,[Plain [Str \"bar\"]]]]\n```\n\n# A simple example\n\nHere is a simple example of the use of a pandoc reader and\nwriter to perform a conversion:\n\n```haskell\nimport Text.Pandoc\nimport qualified Data.Text as T\nimport qualified Data.Text.IO as TIO\n\nmain :: IO ()\nmain = do\n  result <- runIO $ do\n    doc <- readMarkdown def (T.pack \"[testing](url)\")\n    writeRST def doc\n  rst <- handleError result\n  TIO.putStrLn rst\n```\n\nSome notes:\n\n1. The first part constructs a conversion pipeline: the input\n   string is passed to `readMarkdown`, and the resulting Pandoc\n   AST (`doc`) is then rendered by `writeRST`.  The conversion\n   pipeline is \"run\" by `runIO`---more on that below.\n\n2. `result` has the type `Either PandocError Text`.  We could\n   pattern-match on this manually, but it's simpler in this\n   context to use the `handleError` function from\n   Text.Pandoc.Error.  This exits with an appropriate error\n   code and message if the value is a `Left`, and returns the\n   `Text` if the value is a `Right`.\n\n# The PandocMonad class\n\nLet's look at the types of `readMarkdown` and `writeRST`:\n\n```haskell\nreadMarkdown :: (PandocMonad m, ToSources a)\n             => ReaderOptions\n             -> a\n             -> m Pandoc\nwriteRST     :: PandocMonad m\n             => WriterOptions\n             -> Pandoc\n             -> m Text\n```\n\nThe `PandocMonad m =>` part is a typeclass constraint.\nIt says that `readMarkdown` and `writeRST` define computations\nthat can be used in any instance of the `PandocMonad`\ntype class.  `PandocMonad` is defined in the module\n[Text.Pandoc.Class].\n\nTwo instances of `PandocMonad` are provided: `PandocIO` and\n`PandocPure`. The difference is that computations run in\n`PandocIO` are allowed to do IO (for example, read a file),\nwhile computations in `PandocPure` are free of any side effects.\n`PandocPure` is useful for sandboxed environments, when you want\nto prevent users from doing anything malicious.  To run the\nconversion in `PandocIO`, use `runIO` (as above).  To run it in\n`PandocPure`, use `runPure`.\n\nAs you can see from the Haddocks, [Text.Pandoc.Class]\nexports many auxiliary functions that can be used in any\ninstance of `PandocMonad`.  For example:\n\n```haskell\n-- | Get the verbosity level.\ngetVerbosity :: PandocMonad m => m Verbosity\n\n-- | Set the verbosity level.\nsetVerbosity :: PandocMonad m => Verbosity -> m ()\n\n-- Get the accumulated log messages (in temporal order).\ngetLog :: PandocMonad m => m [LogMessage]\ngetLog = reverse <$> getsCommonState stLog\n\n-- | Log a message using 'logOutput'.  Note that 'logOutput' is\n-- called only if the verbosity level exceeds the level of the\n-- message, but the message is added to the list of log messages\n-- that will be retrieved by 'getLog' regardless of its verbosity level.\nreport :: PandocMonad m => LogMessage -> m ()\n\n-- | Fetch an image or other item from the local filesystem or the net.\n-- Returns raw content and maybe mime type.\nfetchItem :: PandocMonad m\n          => Text\n          -> m (B.ByteString, Maybe MimeType)\n\n-- Set the resource path searched by 'fetchItem'.\nsetResourcePath :: PandocMonad m => [FilePath] -> m ()\n```\n\nIf we wanted more verbose informational messages\nduring the conversion we defined in the previous\nsection, we could do this:\n\n```haskell\n  result <- runIO $ do\n    setVerbosity INFO\n    doc <- readMarkdown def (T.pack \"[testing](url)\")\n    writeRST def doc\n```\n\nNote that `PandocIO` is an instance of `MonadIO`, so you can\nuse `liftIO` to perform arbitrary IO operations inside a pandoc\nconversion chain.\n\n`readMarkdown` is polymorphic in its second argument, which\ncan be any type that is an instance of the `ToSources`\ntypeclass.  You can use `Text`, as in the example above.\nBut you can also use `[(FilePath, Text)]`, if the input comes\nfrom multiple files and you want to track source positions\naccurately.\n\n# Options\n\nThe first argument of each reader or writer is for\noptions controlling the behavior of the reader or writer:\n`ReaderOptions` for readers and `WriterOptions`\nfor writers.  These are defined in [Text.Pandoc.Options].  It is\na good idea to study these options to see what can be adjusted.\n\n`def` (from Data.Default) denotes a default value for\neach kind of option.  (You can also use `defaultWriterOptions`\nand `defaultReaderOptions`.)  Generally you'll want to use\nthe defaults and modify them only when needed, for example:\n\n```haskell\n    writeRST def{ writerReferenceLinks = True }\n```\n\nSome particularly important options to know about:\n\n1.  `writerTemplate`:  By default, this is `Nothing`, which\n    means that a document fragment will be produced. If you\n    want a full document, you need to specify `Just template`,\n    where `template` is a `Template Text` from\n    [Text.Pandoc.Templates] containing the template's\n    contents (not the path).\n\n2.  `readerExtensions` and `writerExtensions`:  These specify\n    the extensions to be used in parsing and rendering.\n    Extensions are defined in [Text.Pandoc.Extensions].\n\n# Builder\n\nSometimes it's useful to construct a Pandoc document\nprogrammatically.  To make this easier we provide the\nmodule [Text.Pandoc.Builder] `pandoc-types`.\n\nBecause concatenating lists is slow, we use special\ntypes `Inlines` and `Blocks` that wrap a `Sequence` of\n`Inline` and `Block` elements.  These are instances\nof the Monoid typeclass and can easily be concatenated:\n\n```haskell\nimport Text.Pandoc.Builder\n\nmydoc :: Pandoc\nmydoc = doc $ header 1 (text (T.pack \"Hello!\"))\n           <> para (emph (text (T.pack \"hello world\")) <> text (T.pack \".\"))\n\nmain :: IO ()\nmain = print mydoc\n```\n\nIf you use the `OverloadedStrings` pragma, you can\nsimplify this further:\n\n```haskell\nmydoc = doc $ header 1 \"Hello!\"\n           <> para (emph \"hello world\" <> \".\")\n```\n\nHere's a more realistic example.  Suppose your boss says: write\nme a letter in Word listing all the filling stations in Chicago\nthat take the Voyager card.  You find some JSON data in this\nformat (`fuel.json`):\n\n```json\n[ {\n  \"state\" : \"IL\",\n  \"city\" : \"Chicago\",\n  \"fuel_type_code\" : \"CNG\",\n  \"zip\" : \"60607\",\n  \"station_name\" : \"Clean Energy - Yellow Cab\",\n  \"cards_accepted\" : \"A D M V Voyager Wright_Exp CleanEnergy\",\n  \"street_address\" : \"540 W Grenshaw\"\n}, ...\n```\n\nAnd then use aeson and pandoc to parse the JSON and create\nthe Word document:\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\nimport Text.Pandoc.Builder\nimport Text.Pandoc\nimport Data.Monoid ((<>), mempty, mconcat)\nimport Data.Aeson\nimport Control.Applicative\nimport Control.Monad (mzero)\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport Data.List (intersperse)\n\ndata Station = Station{\n    address        :: T.Text\n  , name           :: T.Text\n  , cardsAccepted  :: [T.Text]\n  } deriving Show\n\ninstance FromJSON Station where\n    parseJSON (Object v) = Station <$>\n       v .: \"street_address\" <*>\n       v .: \"station_name\" <*>\n       (T.words <$> (v .:? \"cards_accepted\" .!= \"\"))\n    parseJSON _          = mzero\n\ncreateLetter :: [Station] -> Pandoc\ncreateLetter stations = doc $\n    para \"Dear Boss:\" <>\n    para \"Here are the CNG stations that accept Voyager cards:\" <>\n    simpleTable [plain \"Station\", plain \"Address\", plain \"Cards accepted\"]\n           (map stationToRow stations) <>\n    para \"Your loyal servant,\" <>\n    plain (image \"JohnHancock.png\" \"\" mempty)\n  where\n    stationToRow station =\n      [ plain (text $ name station)\n      , plain (text $ address station)\n      , plain (mconcat $ intersperse linebreak\n                       $ map text $ cardsAccepted station)\n      ]\n\nmain :: IO ()\nmain = do\n  json <- BL.readFile \"fuel.json\"\n  let letter = case decode json of\n                    Just stations -> createLetter [s | s <- stations,\n                                        \"Voyager\" `elem` cardsAccepted s]\n                    Nothing       -> error \"Could not decode JSON\"\n  docx <- runIO (writeDocx def letter) >>= handleError\n  BL.writeFile \"letter.docx\" docx\n  putStrLn \"Created letter.docx\"\n```\n\nVoila!  You've written the letter without using Word and\nwithout looking at the data.\n\n# Data files\n\nPandoc has a number of data files, which can be found in the\n`data/` subdirectory of the repository.  These are installed\nwith pandoc (or, if pandoc was compiled with the\n`embed_data_files` flag, they are embedded in the binary).\nYou can retrieve data files using `readDataFile` from\nText.Pandoc.Class.  `readDataFile` will first look for the\nfile in the \"user data directory\" (`setUserDataDir`,\n`getUserDataDir`), and if it is not found there, it will\nreturn the default installed with the system.\nTo force the use of the default, `setUserDataDir Nothing`.\n\n# Metadata files\n\nPandoc can add metadata to documents, as described in the\nUser's Guide. Similar to data files, metadata YAML files can\nbe retrieved using `readMetadataFile` from Text.Pandoc.Class.\n`readMetadataFile` will first look for the file in the working\ndirectory, and if it is not found there, it will look for it\nin the `metadata` subdirectory of the user data directory\n(`setUserDataDir`, `getUserDataDir`).\n\n# Templates\n\nPandoc has its own template system, described in the User's\nGuide.  To retrieve the default template for a system,\nuse `getDefaultTemplate` from [Text.Pandoc.Templates].\nNote that this looks first in the\n`templates` subdirectory of the user data directory, allowing\nusers to override the system defaults.  If you want to disable\nthis behavior, use `setUserDataDir Nothing`.\n\nTo render a template, use `renderTemplate'`, which takes two\narguments, a template (Text) and a context (any instance\nof ToJSON).  If you want to create a context from the metadata\npart of a Pandoc document, use `metaToJSON'` from\n[Text.Pandoc.Writers.Shared].  If you also want to incorporate\nvalues from variables, use `metaToJSON` instead, and make sure\n`writerVariables` is set in `WriterOptions`.\n\n\n# Handling errors and warnings\n\n`runIO` and `runPure` return an `Either PandocError a`. All errors\nraised in running a `PandocMonad` computation will be trapped\nand returned as a `Left` value, so they can be handled by\nthe calling program.  To see the constructors for `PandocError`,\nsee the documentation for [Text.Pandoc.Error].\n\nTo raise a `PandocError` from inside a `PandocMonad` computation,\nuse `throwError`.\n\nIn addition to errors, which stop execution of the conversion\npipeline, one can generate informational messages.\nUse `report` from [Text.Pandoc.Class] to issue a `LogMessage`.\nFor a list of constructors for `LogMessage`, see\n[Text.Pandoc.Logging].  Note that each type of log message\nis associated with a verbosity level.  The verbosity level\n(`setVerbosity`/`getVerbosity`) determines whether the report\nwill be printed to stderr (when running in `PandocIO`), but\nregardless of verbosity level, all reported messages are stored\ninternally and may be retrieved using `getLog`.\n\n# Walking the AST\n\nIt is often useful to walk the Pandoc AST either to extract\ninformation (e.g., what are all the URLs linked to in this\ndocument?, do all the code samples compile?) or to transform a\ndocument (e.g., increase the level of every section header,\nremove emphasis, or replace specially marked code blocks with\nimages).  To make this easier and more efficient, `pandoc-types`\nincludes a module [Text.Pandoc.Walk].\n\nHere's the essential documentation:\n\n```haskell\nclass Walkable a b where\n  -- | @walk f x@ walks the structure @x@ (bottom up) and replaces every\n  -- occurrence of an @a@ with the result of applying @f@ to it.\n  walk  :: (a -> a) -> b -> b\n  walk f = runIdentity . walkM (return . f)\n  -- | A monadic version of 'walk'.\n  walkM :: (Monad m, Functor m) => (a -> m a) -> b -> m b\n  -- | @query f x@ walks the structure @x@ (bottom up) and applies @f@\n  -- to every @a@, appending the results.\n  query :: Monoid c => (a -> c) -> b -> c\n```\n\n`Walkable` instances are defined for most combinations of\nPandoc types.  For example, the `Walkable Inline Block`\ninstance allows you to take a function `Inline -> Inline`\nand apply it over every inline in a `Block`.  And\n`Walkable [Inline] Pandoc` allows you to take a function\n`[Inline] -> [Inline]` and apply it over every maximal\nlist of `Inline`s in a `Pandoc`.\n\nHere's a simple example of a function that promotes\nthe levels of headers:\n\n```haskell\npromoteHeaderLevels :: Pandoc -> Pandoc\npromoteHeaderLevels = walk promote\n  where promote :: Block -> Block\n        promote (Header lev attr ils) = Header (lev + 1) attr ils\n        promote x = x\n```\n\n`walkM` is a monadic version of `walk`; it can be used, for\nexample, when you need your transformations to perform IO\noperations, use PandocMonad operations, or update internal\nstate.  Here's an example using the State monad to add unique\nidentifiers to each code block:\n\n```haskell\naddCodeIdentifiers :: Pandoc -> Pandoc\naddCodeIdentifiers doc = evalState (walkM addCodeId doc) 1\n  where addCodeId :: Block -> State Int Block\n        addCodeId (CodeBlock (_,classes,kvs) code) = do\n          curId <- get\n          put (curId + 1)\n          return $ CodeBlock (show curId,classes,kvs) code\n        addCodeId x = return x\n```\n\n`query` is used to collect information from the AST.\nIts argument is a query function that produces a result\nin some monoidal type (e.g. a list).  The results are\nconcatenated together.  Here's an example that returns a\nlist of the URLs linked to in a document:\n\n```haskell\nlistURLs :: Pandoc -> [Text]\nlistURLs = query urls\n  where urls (Link _ _ (src, _)) = [src]\n        urls _                   = []\n```\n\n# Creating a front-end\n\nAll of the functionality of the command-line program `pandoc`\nhas been abstracted out in `convertWithOpts` in\nthe module [Text.Pandoc.App].  Creating a GUI front-end for\npandoc is thus just a matter of populating the `Opts`\nstructure and calling this function.\n\n# Notes on using pandoc in web applications\n\n1. Pandoc's parsers can exhibit pathological behavior on some\n   inputs.  So it is always a good idea to wrap uses of pandoc\n   in a timeout function (e.g. `System.Timeout.timeout` from `base`)\n   to prevent DoS attacks.\n\n2. If pandoc generates HTML from untrusted user input, it is\n   always a good idea to filter the generated HTML through\n   a sanitizer (such as `xss-sanitize`) to avoid security\n   problems.\n\n3. Using `runPure` rather than `runIO` will ensure that\n   pandoc's functions perform no IO operations (e.g. writing\n   files).  If some resources need to be made available, a\n   \"fake environment\" is provided inside the state available\n   to `runPure` (see `PureState` and its associated functions\n   in [Text.Pandoc.Class]).  It is also possible to write\n   a custom instance of `PandocMonad` that, for example,\n   makes wiki resources available as files in the fake environment,\n   while isolating pandoc from the rest of the system.\n\n\n[Text.Pandoc.Definition]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Definition.html\n[Text.Pandoc.Walk]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Walk.html\n[Text.Pandoc.Class]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Class.html\n[Text.Pandoc.Options]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Options.html\n[Text.Pandoc.Extensions]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Extensions.html\n[Text.Pandoc.Builder]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Builder.html\n[Text.Pandoc.Templates]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Templates.html\n[Text.Pandoc.Logging]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Logging.html\n[Text.Pandoc.App]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-App.html\n[Text.Pandoc.Error]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Error.html\n[Text.Pandoc.Writers.Shared]: https://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Writers-Shared.html\n"
  },
  {
    "path": "doc/xml.md",
    "content": "---\ntitle: XML\nauthor: massifrg@gmail.com\n---\n\n# Pandoc XML format\n\nThis document describes Pandoc's `xml` format, a 1:1 equivalent\nof the `native` and `json` formats.\n\nHere's the xml version of the beginning of this document,\nto give you a glimpse of the format:\n\n```xml\n<?xml version='1.0' ?>\n<Pandoc api-version=\"1,23,1\">\n<meta>\n  <entry key=\"author\">\n    <MetaInlines>massifrg@gmail.com</MetaInlines>\n  </entry>\n  <entry key=\"title\">\n    <MetaInlines>XML</MetaInlines>\n  </entry>\n</meta>\n<blocks>\n  <Header id=\"pandoc-xml-format\" level=\"1\">Pandoc XML format</Header>\n  <Para>This document describes Pandoc’s <Code>xml</Code> format, a 1:1 equivalent<SoftBreak />of the <Code>native</Code> and <Code>json</Code> formats.</Para>\n  ...\n</blocks>\n</Pandoc>\n```\n\n## The tags\n\nIf you know [Pandoc types](https://hackage.haskell.org/package/pandoc-types-1.23.1/docs/Text-Pandoc-Definition.html), the XML conversion is fairly straightforward.\n\nThese are the main rules:\n\n- `Str` inlines are usually converted to plain, UTF-8 text (see below for exceptions)\n\n- `Space` inlines are usually converted to \" \" chars (see below for exceptions)\n\n- every `Block` and `Inline` becomes an element with the same name and the same capitalization:\n  a `Para` Block becomes a `<Para>` element, an `Emph` Inline becomes an `<Emph>` element,\n  and so on;\n\n- the root element is `<Pandoc>` and it has a `api-version` attribute, whose value\n  is a string of comma-separated integer numbers; it matches the `pandoc-api-version`\n  field of the `json` format;\n\n- the root `<Pandoc>` element has only two children: `<meta>` and `<blocks>`\n  (lowercase, as in `json` format);\n\n- blocks and inlines with an `Attr` are HTM-like, and they have:\n\n  - the `id` attribute for the identifier\n\n  - the `class` attribute, a string of space-separated classes\n\n  - the other attributes of `Attr`, without any prefix (so no `data-` prefix, instead of HTML)\n\n- attributes are in lower (kebab) case:\n\n  - `level` in Header\n\n  - `start`, `number-style`, `number-delim` in OrderedList;\n    style and delimiter values are capitalized exactly as in `Text.Pandoc.Definition`;\n\n  - `format` in `RawBlock` and RawInline\n\n  - `quote-type` in Quoted (values are `SingleQuote` and `DoubleQuote`)\n\n  - `math-type` in Math (values are `InlineMath` and `DisplayMath`)\n\n  - `title` and `src` in Image target\n\n  - `title` and `href` in Link target\n\n  - `alignment` and `col-width` in ColSpec (about `col-width` values, see below);\n    (alignment values are capitalized as in `Text.Pandoc.Definition`)\n\n  - `alignment`, `row-span` and `col-span` in Cell\n\n  - `row-head-columns` in TableBody\n\n  - `id`, `mode`, `note-num` and `hash` for Citation (about Cite elements, see below);\n    (`mode` values are capitalized as in `Text.Pandoc.Definition`)\n\nThe classes of items with an `Attr` are put in a `class` attribute,\nso that you can style the XML with CSS.\n\n## Str and Space elements\n\n`Str` and `Space` usually result in text and normal \" \" spaces, but there are exceptions:\n\n- `Str \"\"`, an empty string, is not suppressed; instead it is converted into a `<Str />` element;\n\n- `Str \"foo bar\"`, a string containing a space, is converted as `<Str content=\"foo bar\" />`;\n\n- consecutive `Str` inlines, as in `[ ..., Str \"foo\", Str \"bar\", ... ]`,\n  are encoded as `foo<Str content=\"bar\" />` to keep their individuality;\n\n- consecutive `Space` inlines, as in `[ ..., Space, Space, ... ]`,\n  are encoded as `<Space count=\"2\" />`\n\n- `Space` inlines at the start or at the end of their container element\n  are always encoded with a `<Space />` element, instead of just a \" \"\n\nThese encodings are necessary to ensure 1:1 equivalence of the `xml` format with the AST,\nor the `native` and `json` formats.\n\nSince the ones above are corner cases, usually you should not see those `<Str />` and `<Space />`\nelements in your documents.\n\n## Added tags\n\nSome other elements have been introduced to better structure the resulting XML.\n\nSince they are not Pandoc Blocks or Inlines, or they have no constructor or type\nin Pandoc's haskell code, they are kept lowercased.\n\n### BulletList and OrderedList items\n\nItems of those lists are embedded in `<item>` elements.\n\nThese snippets are from the `xml` version of `test/testsuite.native`:\n\n```xml\n<BulletList>\n  <item>\n    <Plain>asterisk 1</Plain>\n  </item>\n  <item>\n    <Plain>asterisk 2</Plain>\n  </item>\n  <item>\n    <Plain>asterisk 3</Plain>\n  </item>\n</BulletList>\n...\n<OrderedList start=\"1\" number-style=\"Decimal\" number-delim=\"Period\">\n  <item>\n    <Plain>First</Plain>\n  </item>\n  <item>\n    <Plain>Second</Plain>\n  </item>\n  <item>\n    <Plain>Third</Plain>\n  </item>\n</OrderedList>\n```\n\n### DefinitionList items\n\nDefinition lists have `<item>` elements.\n\nEach `<item>` term has only one `<term>` child element,\nand one or more `<def>` children elements.\n\nThis snippet is from the `xml` version of `test/testsuite.native`:\n\n```xml\n<DefinitionList>\n  <item>\n    <term>apple</term>\n    <def>\n      <Plain>red fruit</Plain>\n    </def>\n  </item>\n  <item>\n    <term>orange</term>\n    <def>\n      <Plain>orange fruit</Plain>\n    </def>\n  </item>\n  <item>\n    <term>banana</term>\n    <def>\n      <Plain>yellow fruit</Plain>\n    </def>\n  </item>\n</DefinitionList>\n```\n\n### Figure and Table captions\n\nFigures and tables have a `<Caption>` child element,\nwhich in turn may optionally have a `<ShortCaption>` child element.\n\nThis snippet is from the `xml` version of `test/testsuite.native`:\n\n```xml\n<Figure>\n  <Caption>\n    <Plain>lalune</Plain>\n  </Caption>\n  <Plain><Image src=\"lalune.jpg\" title=\"Voyage dans la Lune\">lalune</Image></Plain>\n</Figure>\n```\n\n### Tables\n\nA `<Table>` element has:\n\n- a `<Caption>` child element;\n\n- a `<colspecs>` child element, whose children are empty\n  `<ColSpec alignment=\"...\" col-width=\"...\" />` elements;\n\n- a `<TableHead>` child element;\n\n- one or more `<TableBody>` children elements, that in turn\n  have two children: `<header>` and `<body>`, whose children\n  are `<Row>` elements;\n\n- a `<TableFoot>` child element.\n\nThis specification is debatable; I have these doubts:\n\n- is it necessary to enclose the `<ColSpec>` elements in a `<colspecs>` element?\n\n- to discriminate between header and data cells in table bodies,\n  there are the `row-head-columns` attribute, and the `<header>` and `<body>` children\n  of the `<TableBody>` element, but there's only one type of cell:\n  every cell is a `<Cell>` element\n\n- the specs are a tradeoff between consistency with pandoc types and CSS compatibility;\n  this way bodies' header rows are easily stylable with CSS, while header columns are not\n\nThe `ColWidthDefault` value becomes a \"0\" value for the attribute `col-width`;\nthis way it's type-consistent with non-zero values, but I'm still doubtful whether to\nleave its value as a \"ColWidthDefault\" string.\n\nHere's an example from the `xml` version of `test/tables/planets.native`:\n\n```xml\n<Table>\n  <Caption>\n    <Para>Data about the planets of our solar system.</Para>\n  </Caption>\n  <colspecs>\n    <ColSpec col-width=\"0\" alignment=\"AlignCenter\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignCenter\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignDefault\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignRight\" />\n    <ColSpec col-width=\"0\" alignment=\"AlignDefault\" />\n  </colspecs>\n  <TableHead>\n    <Row>\n      <Cell col-span=\"2\" row-span=\"1\" alignment=\"AlignDefault\" />\n      <Cell col-span=\"1\" row-span=\"1\" alignment=\"AlignDefault\">\n        <Plain>Name</Plain>\n      </Cell>\n      <Cell col-span=\"1\" row-span=\"1\" alignment=\"AlignDefault\">\n        <Plain>Mass (10^24kg)</Plain>\n      </Cell>\n      ...\n    </Row>\n  </TableHead>\n  <TableBody row-head-columns=\"3\">\n    <header />\n    <body>\n      <Row>\n        <Cell col-span=\"2\" row-span=\"4\" alignment=\"AlignDefault\">\n          <Plain>Terrestrial planets</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>Mercury</Plain>\n        </Cell>\n          <Cell alignment=\"AlignDefault\">\n        <Plain>0.330</Plain>\n          </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>4,879</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>5427</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>3.7</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>4222.6</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>57.9</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>167</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>0</Plain>\n        </Cell>\n        <Cell alignment=\"AlignDefault\">\n          <Plain>Closest to the Sun</Plain>\n        </Cell>\n      </Row>\n      ...\n    </body>\n  </TableBody>\n  <TableFoot />\n</Table>\n```\n\n### Metadata and MetaMap entries\n\nMetadata entries are meta values (`MetaBool`, `MetaString`, `MetaInlines`, `MetaBlocks`,\n`MetaList` and `MetaMap` elements) inside `<entry>` elements.\n\nThe `<meta>` and the `<MetaMap>` elements have the same children elements (`<entry>`),\nwhich have a `key` attribute.\n\n`<MetaInlines>`, `<MetaBlocks>`, `<MetaList>` and `<MetaMap>` elements\nall have children elements.\n\n`<MetaString>` elements have only text.\n\n`<MetaBool>` elements are empty, they can be either `<MetaBool value=\"true\" />`\nor `<MetaBool value=\"false\" />`.\n\nThis snippet is from the `xml` version of `test/testsuite.native`:\n\n```xml\n<meta>\n  <entry key=\"author\">\n    <MetaList>\n      <MetaInlines>John MacFarlane</MetaInlines>\n      <MetaInlines>Anonymous</MetaInlines>\n    </MetaList>\n  </entry>\n  <entry key=\"date\">\n    <MetaInlines>July 17, 2006</MetaInlines>\n  </entry>\n  <entry key=\"title\">\n    <MetaInlines>Pandoc Test Suite</MetaInlines>\n  </entry>\n</meta>\n```\n\n### Cite elements\n\n`Cite` inlines are modeled with `<Cite>` elements, whose first child\nis a `<citations>` element, that have only `<Citation>` children elements.\n\n`<Citation>` elements are empty, unless they have a prefix and/or a suffix.\n\nHere's an example from the `xml` version of `test/markdown-citations.native`:\n\n```xml\n<Para><Cite><citations>\n  <Citation note-num=\"3\" mode=\"AuthorInText\" id=\"item1\" hash=\"0\" />\n</citations>@item1</Cite> says blah.</Para>\n<Para><Cite><citations>\n  <Citation note-num=\"4\" mode=\"AuthorInText\" id=\"item1\" hash=\"0\">\n    <suffix>p. 30</suffix>\n  </Citation>\n</citations>@item1 [p. 30]</Cite> says blah.</Para>\n<Para>A citation group <Cite><citations>\n  <Citation note-num=\"8\" mode=\"NormalCitation\" id=\"item1\" hash=\"0\">\n    <prefix>see</prefix>\n    <suffix> chap. 3</suffix>\n  </Citation>\n  <Citation note-num=\"8\" mode=\"NormalCitation\" id=\"пункт3\" hash=\"0\">\n    <prefix>also</prefix>\n    <suffix> p. 34-35</suffix>\n  </Citation>\n</citations>[see @item1 chap. 3; also @пункт3 p. 34-35]</Cite>.</Para>\n```\n"
  },
  {
    "path": "flake.lock",
    "content": "{\n  \"nodes\": {\n    \"flake-utils\": {\n      \"inputs\": {\n        \"systems\": \"systems\"\n      },\n      \"locked\": {\n        \"lastModified\": 1731533236,\n        \"narHash\": \"sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=\",\n        \"owner\": \"numtide\",\n        \"repo\": \"flake-utils\",\n        \"rev\": \"11707dc2f618dd54ca8739b309ec4fc024de578b\",\n        \"type\": \"github\"\n      },\n      \"original\": {\n        \"owner\": \"numtide\",\n        \"repo\": \"flake-utils\",\n        \"type\": \"github\"\n      }\n    },\n    \"flake-utils_2\": {\n      \"inputs\": {\n        \"systems\": \"systems_2\"\n      },\n      \"locked\": {\n        \"lastModified\": 1731533236,\n        \"narHash\": \"sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=\",\n        \"owner\": \"numtide\",\n        \"repo\": \"flake-utils\",\n        \"rev\": \"11707dc2f618dd54ca8739b309ec4fc024de578b\",\n        \"type\": \"github\"\n      },\n      \"original\": {\n        \"owner\": \"numtide\",\n        \"repo\": \"flake-utils\",\n        \"type\": \"github\"\n      }\n    },\n    \"ghc-wasm-meta\": {\n      \"inputs\": {\n        \"flake-utils\": \"flake-utils_2\",\n        \"nixpkgs\": \"nixpkgs\"\n      },\n      \"locked\": {\n        \"host\": \"gitlab.haskell.org\",\n        \"lastModified\": 1769511593,\n        \"narHash\": \"sha256-zHh+dPvGHX6ZIk5XQm20y2Qg31tXeqX5REe06pBvMiU=\",\n        \"owner\": \"haskell-wasm\",\n        \"repo\": \"ghc-wasm-meta\",\n        \"rev\": \"e950d94ea9a091d64ee38ff735e52d46191e76af\",\n        \"type\": \"gitlab\"\n      },\n      \"original\": {\n        \"host\": \"gitlab.haskell.org\",\n        \"owner\": \"haskell-wasm\",\n        \"repo\": \"ghc-wasm-meta\",\n        \"type\": \"gitlab\"\n      }\n    },\n    \"nixpkgs\": {\n      \"locked\": {\n        \"lastModified\": 1769318308,\n        \"narHash\": \"sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=\",\n        \"owner\": \"NixOS\",\n        \"repo\": \"nixpkgs\",\n        \"rev\": \"1cd347bf3355fce6c64ab37d3967b4a2cb4b878c\",\n        \"type\": \"github\"\n      },\n      \"original\": {\n        \"owner\": \"NixOS\",\n        \"ref\": \"nixos-25.11\",\n        \"repo\": \"nixpkgs\",\n        \"type\": \"github\"\n      }\n    },\n    \"nixpkgs_2\": {\n      \"locked\": {\n        \"lastModified\": 1769205588,\n        \"narHash\": \"sha256-ugJzenE0+X/5ILJEcl0+NavMQhqMro3cwPhR/NjOOzU=\",\n        \"owner\": \"NixOS\",\n        \"repo\": \"nixpkgs\",\n        \"rev\": \"28528e01b00d737528b90d0ccb9cd468290fdc36\",\n        \"type\": \"github\"\n      },\n      \"original\": {\n        \"owner\": \"NixOS\",\n        \"repo\": \"nixpkgs\",\n        \"type\": \"github\"\n      }\n    },\n    \"root\": {\n      \"inputs\": {\n        \"flake-utils\": \"flake-utils\",\n        \"ghc-wasm-meta\": \"ghc-wasm-meta\",\n        \"nixpkgs\": \"nixpkgs_2\"\n      }\n    },\n    \"systems\": {\n      \"locked\": {\n        \"lastModified\": 1681028828,\n        \"narHash\": \"sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=\",\n        \"owner\": \"nix-systems\",\n        \"repo\": \"default\",\n        \"rev\": \"da67096a3b9bf56a91d16901293e51ba5b49a27e\",\n        \"type\": \"github\"\n      },\n      \"original\": {\n        \"owner\": \"nix-systems\",\n        \"repo\": \"default\",\n        \"type\": \"github\"\n      }\n    },\n    \"systems_2\": {\n      \"locked\": {\n        \"lastModified\": 1681028828,\n        \"narHash\": \"sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=\",\n        \"owner\": \"nix-systems\",\n        \"repo\": \"default\",\n        \"rev\": \"da67096a3b9bf56a91d16901293e51ba5b49a27e\",\n        \"type\": \"github\"\n      },\n      \"original\": {\n        \"owner\": \"nix-systems\",\n        \"repo\": \"default\",\n        \"type\": \"github\"\n      }\n    }\n  },\n  \"root\": \"root\",\n  \"version\": 7\n}\n"
  },
  {
    "path": "flake.nix",
    "content": "{\n  description = \"pandoc\";\n\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs\";\n    flake-utils.url = \"github:numtide/flake-utils\";\n    ghc-wasm-meta.url = \"gitlab:haskell-wasm/ghc-wasm-meta?host=gitlab.haskell.org\";\n  };\n\n  outputs = { self, nixpkgs, flake-utils, ghc-wasm-meta }:\n    flake-utils.lib.eachDefaultSystem (system:\n      let\n        pkgs = nixpkgs.legacyPackages.${system};\n\n        haskellPackages = pkgs.haskellPackages;\n        # Or, override some dependencies as follows:\n        # haskellPackages = (pkgs.haskellPackages.override {\n        #   all-cabal-hashes = pkgs.fetchurl {\n        #    # The hash in the URL is just a git commit hash\n        #    url = \"https://github.com/commercialhaskell/all-cabal-hashes/archive/2e3f153549871ada6ecbf36719339a5da051bc76.tar.gz\";\n        #    sha256 = \"ymHZb6wCZlrtKb+T+iOL17jyN8IzA7s52uiamUIkWNI=\";\n        #   };\n        # }).extend(self: super: {\n        #   citeproc = pkgs.haskell.lib.dontCheck (self.callHackage \"citeproc\" \"0.9.0.1\" {});\n        #   texmath = self.callHackage \"texmath\" \"0.12.10.2\" {};\n        # });\n\n        jailbreakUnbreak = pkg:\n          pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));\n\n        # PUT YOUR PACKAGE NAME HERE:\n        packageName = \"pandoc\";\n\n        wasmToolchain = ghc-wasm-meta.packages.${system}.default;\n        # Alternatively, if you want a specific \"bundle\":\n        # wasmToolchain = ghc-wasm-meta.packages.${system}.all_9_14;\n      in {\n        packages.${packageName} =\n          haskellPackages.callCabal2nix packageName self rec {\n            # Dependency overrides go here\n          };\n\n        packages.default = self.packages.${system}.${packageName};\n        defaultPackage = self.packages.${system}.default;\n\n        devShells.default = pkgs.mkShell {\n          buildInputs = with pkgs; [\n            wasmToolchain\n            haskellPackages.haskell-language-server\n            haskellPackages.hlint\n            haskellPackages.cabal-install\n            haskellPackages.cabal-plan\n            haskellPackages.hpc\n            haskellPackages.ghcid\n            haskellPackages.stylish-haskell\n            haskellPackages.eventlog2html\n            haskellPackages.profiterole\n            haskellPackages.profiteur\n            zlib.dev\n            git\n            gnumake\n            bashInteractive\n            ripgrep\n            unzip\n            jq\n            libxml2 # for xmllint\n            epubcheck # for validate-epub\n            nodejs # for validate-epub\n          ];\n          inputsFrom = map (__getAttr \"env\") (__attrValues self.packages.${system});\n        };\n\n        devShell = self.devShells.${system}.default;\n      });\n}\n"
  },
  {
    "path": "hie.yaml",
    "content": "cradle:\n  cabal:\n    - path: \"./xml-light\"\n      component: \"pandoc:lib:xml-light\"\n\n    - path: \"./src\"\n      component: \"lib:pandoc\"\n\n    - path: \"./test\"\n      component: \"pandoc:test:test-pandoc\"\n\n    - path: \"./benchmark/benchmark-pandoc.hs\"\n      component: \"pandoc:bench:benchmark-pandoc\"\n\n    - path: \"pandoc-cli/no-lua/pandoc.hs\"\n      component: \"pandoc-cli:exe:pandoc\"\n\n    - path: \"pandoc-cli/no-lua/PandocCLI/Lua.hs\"\n      component: \"pandoc-cli:exe:pandoc\"\n\n    - path: \"pandoc-cli/no-lua/PandocCLI/Server.hs\"\n      component: \"pandoc-cli:exe:pandoc\"\n\n    - path: \"pandoc-lua-engine/src\"\n      component: \"lib:pandoc-lua-engine\"\n\n    - path: \"pandoc-lua-engine/test\"\n      component: \"pandoc-lua-engine:test:test-pandoc-lua-engine\"\n\n    - path: \"pandoc-server/src\"\n      component: \"lib:pandoc-server\"\n"
  },
  {
    "path": "linux/control.in",
    "content": "Package: pandoc\nVersion: VERSION\nSection: text\nPriority: optional\nArchitecture: ARCHITECTURE\nInstalled-Size: INSTALLED_SIZE\nDepends: libc6 (>= 2.13), libgmp10, zlib1g (>= 1:1.1.4)\nReplaces: pandoc-data\nSuggests: texlive-latex-recommended, texlive-xetex,\n texlive-fonts-recommended\nMaintainer: John MacFarlane <jgm@berkeley.edu>\nDescription: general markup converter\n  Pandoc is a Haskell library for converting from one markup format\n  to another, and a command-line tool that uses this library. The\n  formats it can handle include light markup formats (many variants\n  of Markdown, reStructuredText, AsciiDoc, Org-mode, Muse, Textile,\n  txt2tags), HTML formats (HTML 4 and 5), ebook formats (EPUB v2\n  and v3, FB2), Documentation formats (GNU TexInfo, Haddock),\n  Roff formats (man, ms), TeX formats (LaTeX, ConTeXt), XML\n  formats (DocBook 4 and 5, JATS, TEI Simple, OpenDocument),\n  outline formats (OPML), bibliography formats (BibTeX, BibLaTeX,\n  CSL JSON, CSL YAML, RIS), word processor formats (Docx, RTF,\n  ODT), interactive notebook formats (Jupyter notebook\n  ipynb), page layout formats (InDesign ICML), wiki markup\n  formats (MediaWiki, DokuWiki, TikiWiki, TWiki, Vimwiki,\n  XWiki, ZimWiki, Jira wiki, Creole), slide show formats\n  (LaTeX Beamer, PowerPoint, Slidy, reveal.js, Slideous, S5,\n  DZSlides), data formats (CSV and TSV tables), and PDF (via\n  external programs such as pdflatex or wkhtmltopdf).\n\n"
  },
  {
    "path": "linux/make_artifacts.sh",
    "content": "#!/bin/bash\nset -e\n\ncabal update\ncabal clean\ncabal build $CABALOPTS --ghc-options=\"$GHCOPTS\" pandoc-cli\nBINPATH=$(cabal list-bin $CABALOPTS --ghc-options=\"$GHCOPTS\" pandoc-cli)\necho \"Built executable: $BINPATH\"\n\nWORK=\"$(pwd)\"\n\nMACHINE=$(uname -m)\ncase \"$MACHINE\" in\n  x86_64)  ARCHITECTURE=amd64;;\n  i686)    ARCHITECTURE=i386;;\n  i386)    ARCHITECTURE=i386;;\n  aarch64) ARCHITECTURE=arm64;;\n  armv6l | armv7l) ARCHITECTURE=armhf;;\n  riscv64) ARCHITECTURE=riscv64;;\n  *)       ARCHITECTURE=unknown;;\nesac\n\nARTIFACTS=\"$WORK/linux-${ARCHITECTURE}\"\necho \"Creating $ARTIFACTS directory\"\nmkdir -p $ARTIFACTS\n\necho \"Copying and stripping pandoc binary\"\ncp \"$BINPATH\" \"$ARTIFACTS/pandoc\"\nstrip \"$ARTIFACTS/pandoc\"\n\necho \"Checking that the binary is statically linked...\"\nfile \"$ARTIFACTS/pandoc\" | grep \"statically linked\"\n\necho \"Checking that the binary has +lua and +server support...\"\n\"$ARTIFACTS/pandoc\" --version | grep -q '+server +lua'\n\necho \"Checking that the binary has data files baked in...\"\nstrings \"$ARTIFACTS/pandoc\" | grep -q '\\$title\\$'\n\nmake_deb() {\n  VERSION=$(\"$ARTIFACTS\"/pandoc --version | awk '{print $2; exit;}')\n  REVISION=${REVISION:-1}\n  DEBVER=$VERSION-$REVISION\n  BASE=pandoc-$DEBVER-$ARCHITECTURE\n  DIST=$WORK/$BASE\n  DEST=$DIST/usr\n  COPYRIGHT=$DEST/share/doc/pandoc/copyright\n\n  mkdir -p \"$DEST/bin\"\n  mkdir -p \"$DEST/share/man/man1\"\n  mkdir -p \"$DEST/share/doc/pandoc\"\n\n  find \"$DIST\" -type d -exec chmod 755 {} \\;\n  cp \"$ARTIFACTS/pandoc\" \"$DEST/bin/\"\n  pushd \"$DEST/bin\"\n  ln -s pandoc pandoc-server\n  ln -s pandoc pandoc-lua\n  popd\n  for manpage in pandoc.1 pandoc-lua.1 pandoc-server.1\n  do\n    cp \"$WORK/pandoc-cli/man/$manpage\" \"$DEST/share/man/man1/$manpage\"\n    gzip -9 \"$DEST/share/man/man1/$manpage\"\n  done\n  cp $WORK/COPYRIGHT \"$COPYRIGHT\"\n  echo \"\" >> \"$COPYRIGHT\"\n\n  INSTALLED_SIZE=$(du -k -s \"$DEST\" | awk '{print $1}')\n  mkdir \"$DIST/DEBIAN\"\n  perl -pe \"s/VERSION/$DEBVER/\" $WORK/linux/control.in | \\\n    perl -pe \"s/ARCHITECTURE/$ARCHITECTURE/\" | \\\n    perl -pe \"s/INSTALLED_SIZE/$INSTALLED_SIZE/\" \\\n    > \"$DIST/DEBIAN/control\"\n\n  # we limit compression to avoid OOM error\n  fakeroot dpkg-deb -Zgzip -z9 --build \"$DIST\"\n  rm -rf \"$DIST\"\n  cp \"$BASE.deb\" \"$ARTIFACTS/\"\n  echo \"Created $BASE.deb\"\n}\n\n# Make tarball for pandoc\nmake_tarball() {\n  TARGET=pandoc-$VERSION\n  pushd \"$ARTIFACTS\"\n  rm -rf \"$TARGET\"\n  mkdir \"$TARGET\"\n  mkdir \"$TARGET/bin\" \"$TARGET/share\" \"$TARGET/share/man\" \"$TARGET/share/man/man1\"\n  cp $WORK/pandoc-cli/man/pandoc.1 $WORK/pandoc-cli/man/pandoc-server.1 $WORK/pandoc-cli/man/pandoc-lua.1 \"$TARGET/share/man/man1\"\n  gzip -9 \"$TARGET\"/share/man/man1/*.1\n  mv pandoc \"$TARGET/bin\"\n  pushd \"$TARGET/bin\"\n  ln -s pandoc pandoc-server\n  ln -s pandoc pandoc-lua\n  popd\n\n  tar cvzf \"$TARGET-linux-$ARCHITECTURE.tar.gz\" \"$TARGET\"\n  echo \"Created $TARGET-linux-$ARCHITECTURE.tar.gz\"\n  rm -r \"$TARGET\"\n  popd\n}\n\necho \"Making debian package...\"\nmake_deb\n\necho \"Making tarball...\"\nmake_tarball\n\necho \"Finished!\"\nexit 0\n"
  },
  {
    "path": "macos/Makefile",
    "content": "ARCHITECTURE=$(shell cat architecture.txt)\nVERSION=$(shell cat version.txt)\nBASE=pandoc-$(VERSION)-$(ARCHITECTURE)\nDEST=pandoc/usr/local\nALL=$(BASE)-macOS.pkg $(BASE)-macOS.zip\nTOOLPATH=/Applications/XCode.app/Contents/Developer/usr/bin\n\nall: $(ALL) notarize\n\nsigned.txt: $(DEST)\n\tchmod +x $(DEST)/bin/pandoc\n\tcodesign --force --options runtime -s \"5U2WKE6DES\" $(DEST)/bin/pandoc\n\techo \"SIGNED\" > signed.txt\n\n$(DEST)/bin/pandoc-server:\n\tcd $(DEST)/bin && ln -s pandoc pandoc-server\n\n$(DEST)/bin/pandoc-lua:\n\tcd $(DEST)/bin && ln -s pandoc pandoc-lua\n\npandoc.pkg: $(DEST)/bin/pandoc-server $(DEST)/bin/pandoc-lua signed.txt\n\tpkgbuild --root pandoc --identifier net.johnmacfarlane.pandoc --version $(VERSION) --ownership recommended $@\n\n$(BASE)-macOS.pkg: pandoc.pkg\n\tproductbuild --distribution distribution.xml --resources Resources --package-path $< --version $(VERSION) --sign 'Developer ID Installer: John Macfarlane' $@\n\n$(BASE)-macOS.zip: $(DEST)/bin/pandoc-server $(DEST)/bin/pandoc-lua signed.txt\n\tmv $(DEST) $(BASE)\n\tzip --symlinks -r $@ $(BASE)\n\nnotarize: $(BASE)-macOS.pkg\n\t$(TOOLPATH)/notarytool submit $< --keychain-profile=pandoc --wait && \\\n    $(TOOLPATH)/stapler staple $<\n\nclean:\n\trm signed.txt $(BASE) pandoc.pkg # gon.hcl\n\ndistclean: clean\n\trm $(ALL)\n\n.PHONY: all clean distclean\n"
  },
  {
    "path": "macos/distribution.xml.in",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<installer-gui-script minSpecVersion=\"1\">\n    <title>pandoc</title>\n    <organization>net.johnmacfarlane.pandoc</organization>\n    <domains enable_localSystem=\"true\" enable_anywhere=\"true\" />\n    <options customize=\"allow\" require-scripts=\"false\" rootVolumeOnly=\"false\" />\n    <!-- Define documents displayed at various steps -->\n    <!-- <welcome    file=\"welcome.html\"    mime-type=\"text/html\" /> -->\n    <license    file=\"license.html\"    mime-type=\"text/html\" />\n    <!-- <conclusion file=\"conclusion.html\" mime-type=\"text/html\" /> -->\n    <options hostArchitectures=\"ARCHITECTURE\" />\n    <!-- List all component packages -->\n    <pkg-ref id=\"net.johnmacfarlane.pandoc\"\n             version=\"PANDOCVERSION\"\n             auth=\"root\">pandoc.pkg</pkg-ref>\n    <!-- List them again here. They can now be organized\n         as a hierarchy if you want. -->\n    <choices-outline>\n        <line choice=\"net.johnmacfarlane.pandoc\"/>\n    </choices-outline>\n    <!-- Define each choice above -->\n    <choice\n        id=\"net.johnmacfarlane.pandoc\"\n        visible=\"false\"\n        title=\"pandoc\"\n        description=\"pandoc - universal text converter\"\n        start_selected=\"true\">\n      <pkg-ref id=\"net.johnmacfarlane.pandoc\"/>\n    </choice>\n</installer-gui-script>\n"
  },
  {
    "path": "macos/make_macos_release.sh",
    "content": "#!/bin/sh -e\n\nMACHINE=$(uname -m)\n\nVERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $2;}')\nARTIFACTS=macos-$MACHINE\nRESOURCES=$ARTIFACTS/Resources\nROOT=$ARTIFACTS/pandoc\nDEST=$ROOT/usr/local\nME=$(whoami)\n\nCABALOPTS=\"-fembed_data_files -fserver -flua -fhttp\"\n# Build the pandoc binary and put it in .\ncabal update\ncabal build all $CABALOPTS\nBINPATH=$(cabal list-bin $CABALOPTS pandoc-cli)\necho \"Built executable...\"\n\n# Create directories\necho \"Creating $ARTIFACTS directory...\"\nmkdir -p $ARTIFACTS\nmkdir -p $RESOURCES\nmkdir -p $DEST/bin\nmkdir -p $DEST/share/man/man1\n\n# Copy binary and strip it\necho \"Copying executable...\"\ncp \"$BINPATH\" \"$DEST/bin/\"\nstrip \"$DEST/bin/pandoc\"\n\n# Copy man pages and license\necho \"Copying manuals and license...\"\ncp pandoc-cli/man/pandoc.1 \"$DEST/share/man/man1/pandoc.1\"\ncp pandoc-cli/man/pandoc-server.1 \"$DEST/share/man/man1/pandoc-server.1\"\ncp pandoc-cli/man/pandoc-lua.1 \"$DEST/share/man/man1/pandoc-lua.1\"\n\"$BINPATH\" -s COPYING.md -Vpagetitle=License -o \"$RESOURCES/license.html\"\n\n# Prepare distribution directory; after downloading, run 'make' to notarize\necho \"Preparing distribution directory...\"\nchown -R \"$ME:staff\" \"$ROOT\"\nsed -e \"s/PANDOCVERSION/$VERSION/; s/ARCHITECTURE/$MACHINE/;\" macos/distribution.xml.in > \"$ARTIFACTS/distribution.xml\"\ncp macos/Makefile \"$ARTIFACTS/\"\necho \"$VERSION\" > \"$ARTIFACTS/version.txt\"\necho \"$MACHINE\" > \"$ARTIFACTS/architecture.txt\"\n\nls -R $ARTIFACTS\necho \"Finished...\"\n"
  },
  {
    "path": "macos/uninstall-pandoc.pl",
    "content": "#!/usr/bin/perl\n\n# Script to remove all files installed by the macOS pandoc installer\n# and unregister the package.  Modified from a script contributed\n# by Daniel T. Staal.\n\nuse warnings;\nuse strict;\n\nuse File::Spec;\n\n# The main info: this is the list of files to remove and the pkg_id.\nmy $pkg_id    = 'net.johnmacfarlane.pandoc';\n\n# Find which, if any, volume Pandoc is installed on.\nmy $volume;\n\n# First check /, then other volumes on the box.\nmy $cur_test = `pkgutil --pkgs=$pkg_id`;\nif ( $cur_test =~ m/$pkg_id/ ) {\n    $volume = '/';\n} else {\n    opendir( my $dh, '/Volumes' ) or die \"Can't list Volumes: $!\\n\";\n    foreach my $dir ( readdir($dh) ) {\n      next if $dir =~ m/^\\./;    # Skip dotfiles.\n\n      my $path = File::Spec->rel2abs( $dir, '/Volumes' );\n      next if !( -d $path );     # Skip anything that isn't a directory.\n\n      my $cur_test = `pkgutil --pkgs=$pkg_id --volume '$path'`;\n      if ( $cur_test =~ m/$pkg_id/ ) {\n          $volume = $path;\n          last;\n      }\n    }\n}\n\ndie \"Pandoc not installed.\\n\" if !( defined($volume) );\n\n# Get the list of files to remove.\nmy @pkg_files = `pkgutil --volume '$volume' --only-files --files '$pkg_id'`;\n@pkg_files = map { chomp; File::Spec->rel2abs($_, $volume) } @pkg_files;\n\n# Confirm uninstall with the user.\nprint \"The following files will be deleted:\\n\\n\";\nprint join(\"\\n\", @pkg_files);\nprint \"\\n\\n\";\nprint \"Do you want to proceed and uninstall pandoc (Y/N)?\";\nmy $input = <STDIN>;\n\nif ($input =~ m/^[Yy]/) {\n\n    # Actually remove the files.\n    foreach my $file (@pkg_files) {\n        if ( -e $file ) {\n            if ( system( 'sudo', 'rm', $file ) == 0 ) {\n                warn \"Deleted $file\\n\";\n            } else {\n                warn \"Unable to delete $file: $?\\n\";\n                die \"Aborting Uninstall.\\n\";\n            }\n        }  else {\n            warn \"File $file does not exist.  Skipping.\\n\";\n        }\n    }\n\n    # Clean up the install.\n    if (system('sudo', 'pkgutil', '--forget', $pkg_id, '--volume', $volume) != 0) {\n        die \"Unable to clean up install: $?\\n\";\n    }\n\n} else {\n\n   print \"OK, aborting uninstall.\\n\";\n   exit;\n}\n\nprint \"Pandoc has been successfully uninstalled.\\n\";\nexit;\n"
  },
  {
    "path": "man/manfilter.lua",
    "content": "-- we use preloaded text to get a UTF-8 aware 'upper' function\nlocal text = require('text')\n\n-- capitalize level 1 headers\nfunction Header(el)\n    if el.level == 1 then\n      return pandoc.walk_block(el, {\n        Str = function(el)\n            return pandoc.Str(text.upper(el.text))\n        end })\n    end\nend\n\n-- For portability with mandoc, which doesn't allow man commands\n-- inside table cells, we convert all tables to code blocks.\nfunction Table(el)\n  local rendered = pandoc.write(pandoc.Pandoc({el}), \"plain\")\n  local adjusted = rendered  -- tame grid table lines\n                     :gsub(\"%+([=:][=:]+)\",\n                       function(s)\n                         return \" \" .. string.rep(\"-\", #s - 1)\n                       end)\n                     :gsub(\"(%+[-:][-:]+)\",\n                       function(s)\n                         return \"\"\n                       end)\n                     :gsub(\"%+\\n\",\"\\n\")\n                     :gsub(\"\\n|    \",\"\\n|\")\n                     :gsub(\"|\",\"\")\n  return { pandoc.RawBlock(\"man\", \".RS -14n\"),\n           pandoc.CodeBlock(adjusted),\n           pandoc.RawBlock(\"man\", \".RE\") }\nend\n\n\n-- replace links with link text\nfunction Link(el)\n    return el.content\nend\n\n-- remove notes\nfunction Note(el)\n    return {}\nend\n"
  },
  {
    "path": "man/pandoc.1.after",
    "content": ".PP\nThe Pandoc source code may be downloaded\nfrom <https://hackage.haskell.org/package/pandoc> or\n<https://github.com/jgm/pandoc/releases>.  Further\ndocumentation is available at <https://pandoc.org>.\n"
  },
  {
    "path": "man/pandoc.1.before",
    "content": ".SH NAME\npandoc - general markup converter\n"
  },
  {
    "path": "pandoc-cli/README.md",
    "content": "# pandoc-cli\n\nThis package provides the command-line document-conversion program `pandoc`.\nThere is not much to this package; all of the work is done by\nthe libraries `pandoc` and `pandoc-server`.\n\n## License\n\n© 2006-2024 John MacFarlane (jgm@berkeley.edu). Released under the\n[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html \"GNU General Public License\"),\nversion 2 or greater. This software carries no warranty of any kind.\n(See COPYRIGHT for full copyright and warranty notices.)\n"
  },
  {
    "path": "pandoc-cli/lua/PandocCLI/Lua.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : PandocCLI.Lua\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nFunctions to run the pandoc Lua scripting engine.\n-}\nmodule PandocCLI.Lua (runLuaInterpreter, getEngine) where\n\n#ifdef REPL\nimport Control.Monad ((<=<))\nimport System.Environment (lookupEnv)\nimport System.IO.Temp (withSystemTempFile)\nimport System.IO (hClose)\nimport Text.Pandoc.Class (runIOorExplode)\nimport Text.Pandoc.Error (handleError)\nimport Text.Pandoc.Lua (runLua, runLuaNoEnv, getEngine)\nimport Text.Pandoc.Version (pandocVersionText)\nimport HsLua.CLI (EnvBehavior (..), Settings (..), runStandalone)\n#else\nimport Text.Pandoc.Lua (getEngine)\nimport System.IO (stderr, hPutStrLn)\nimport System.Exit (exitWith, ExitCode(..))\n#endif\n\n-- | Runs pandoc as a Lua interpreter that is (mostly) compatible with\n-- the default @lua@ program shipping with Lua.\n--\n-- The filename for the history of the REPL is taken from the\n-- @PANDOC_REPL_HISTORY@ environment variable if possible. Otherwise a\n-- new temporary file is used; it is removed after the REPL finishes.\nrunLuaInterpreter :: String    -- ^ Program name\n                  -> [String]  -- ^ Command line arguments\n                  -> IO ()\n#ifdef REPL\nrunLuaInterpreter progName args = do\n  -- We need some kind of temp\n  mbhistfile <- lookupEnv \"PANDOC_REPL_HISTORY\"\n  case mbhistfile of\n    Just histfile -> runStandaloneWithHistory histfile\n    Nothing -> withSystemTempFile \"pandoc-hist\" $ \\fp handle -> do\n      -- We cannot pass a handle to the repl; the file will be re-opened\n      -- there.\n      hClose handle\n      runStandaloneWithHistory fp\n  where\n    runStandaloneWithHistory histfile =  do\n      let settings = Settings\n            { settingsVersionInfo =\n              \"\\nEmbedded in pandoc \" <>\n              pandocVersionText <>\n              \"  Copyright (C) 2006-2024 John MacFarlane\"\n            , settingsRunner = runner\n            , settingsHistory = Just histfile\n            }\n      runStandalone settings progName args\n    runner envBehavior =\n      let runLua' = case envBehavior of\n                      IgnoreEnvVars  -> runLuaNoEnv\n                      ConsultEnvVars -> runLua\n      in handleError <=< runIOorExplode . runLua'\n#else\nrunLuaInterpreter _ _ = do\n  hPutStrLn stderr \"Pandoc not compiled with Lua interpreter support.\"\n  exitWith $ ExitFailure 4\n#endif\n"
  },
  {
    "path": "pandoc-cli/man/pandoc-lua.1",
    "content": ".\\\" Automatically generated by Pandoc 3.9.0.2\n.\\\"\n.TH \"pandoc-lua\" \"1\" \"September 22, 2022\" \"pandoc 3.9.0.2\" \"Pandoc User\\[cq]s Guide\"\n.SH SYNOPSIS\n\\f[CR]pandoc\\-lua\\f[R] [\\f[I]options\\f[R]] [\\f[I]script\\f[R]\n[\\f[I]args\\f[R]]]\n.SH DESCRIPTION\n\\f[CR]pandoc\\-lua\\f[R] is a standalone Lua interpreter with behavior\nsimilar to that of the standard \\f[CR]lua\\f[R] executable, but exposing\nall of pandoc\\(cqs Lua libraries.\nAll \\f[CR]pandoc.*\\f[R] packages, as well as the packages \\f[CR]re\\f[R]\nand \\f[CR]lpeg\\f[R], are available via global variables.\nFurthermore, the globals \\f[CR]PANDOC_VERSION\\f[R],\n\\f[CR]PANDOC_STATE\\f[R], and \\f[CR]PANDOC_API_VERSION\\f[R] are set at\nstartup.\n.PP\nIf no script argument is given, then the script is assumed to be passed\nin via \\f[I]stdin\\f[R].\nWhen called without arguments, \\f[CR]pandoc\\-lua\\f[R] behaves as\n\\f[CR]pandoc\\-lua \\-v \\-i\\f[R] when the standard input\n(\\f[CR]stdin\\f[R]) is a terminal, and as \\f[CR]pandoc\\-lua \\-\\f[R]\notherwise.\nOn Windows the program will always behave as if it was connected to a\nterminal.\n.PP\nWhen called without the option \\f[CR]\\-E\\f[R], the interpreter checks\nfor an environment variable \\f[CR]LUA_INIT\\f[R] before running any\nargument.\nIf the variable content has the format\n\\f[I]\\f[CI]\\(atfilename\\f[I]\\f[R], then \\f[CR]pandoc\\-lua\\f[R] executes\nthe file.\nOtherwise, \\f[CR]pandoc\\-lua\\f[R] executes the string itself.\n.SH OPTIONS\n.TP\n\\f[CR]\\-e stat\\f[R]\nExecute statement \\f[CR]stat\\f[R].\n.TP\n\\f[CR]\\-l mod\\f[R]\nIf mod has the pattern \\f[CR]g=m\\f[R], then require library \\f[CR]m\\f[R]\ninto global \\f[CR]g\\f[R]; otherwise require library \\f[CR]mod\\f[R] into\nglobal \\f[CR]mod\\f[R].\n.TP\n\\f[CR]\\-v\\f[R]\nShow version information.\n.TP\n\\f[CR]\\-i\\f[R]\nEnter interactive mode after running \\f[I]script\\f[R].\n.TP\n\\f[CR]\\-E\\f[R]\nIgnore environment variables.\nThis is not fully implemented yet and only ignores the\n\\f[CR]LUA_INIT\\f[R] variable.\nOther variables like \\f[CR]LUA_PATH\\f[R] and \\f[CR]LUA_CPATH\\f[R] are\n\\f[B]not\\f[R] ignored.\n.TP\n\\f[CR]\\-W\\f[R]\nTurn warnings on.\n.SH INTERACTIVE MODE\nIn interactive mode, the Lua interpreter repeatedly prompts and waits\nfor a line.\nAfter reading a line, Lua first tries to interpret the line as an\nexpression.\nIf it succeeds, it prints its value.\nOtherwise, it interprets the line as a statement.\nIf you write an incomplete statement, the interpreter waits for its\ncompletion by issuing a different prompt.\n.PP\nExit the interactive mode by pressing \\f[CR]Ctrl\\-D\\f[R] or\n\\f[CR]Ctrl\\-C\\f[R], or by typing \\f[CR]os.exit()\\f[R].\nThe \\f[I]Isocline\\f[R] library is used for line editing.\nPress \\f[CR]F1\\f[R] to get a list of available keybindings; the\n\\f[CR]ctrl\\f[R] key is abbreviated as \\f[CR]\\(ha\\f[R] in that list.\n.SH AUTHORS\nCopyright 2023 John MacFarlane (jgm\\(atberkeley.edu) and contributors.\nReleased under the GPL, version 2 or later.\nThis software carries no warranty of any kind.\n(See COPYRIGHT for full copyright and warranty notices.)\n.PP\nLua: Copyright 1994\\-2023 Lua.org, PUC\\-Rio.\n.PP\nThe Pandoc source code may be downloaded\nfrom <https://hackage.haskell.org/package/pandoc> or\n<https://github.com/jgm/pandoc/releases>.  Further\ndocumentation is available at <https://pandoc.org>.\n"
  },
  {
    "path": "pandoc-cli/man/pandoc-server.1",
    "content": ".\\\" Automatically generated by Pandoc 3.9.0.2\n.\\\"\n.TH \"pandoc-server\" \"1\" \"August 15, 2022\" \"pandoc 3.9.0.2\" \"Pandoc User\\[cq]s Guide\"\n.SH SYNOPSIS\n\\f[CR]pandoc\\-server\\f[R] [\\f[I]options\\f[R]]\n.SH DESCRIPTION\n\\f[CR]pandoc\\-server\\f[R] is a web server that can perform pandoc\nconversions.\nIt can be used either as a running server or as a CGI program.\n.PP\nTo use \\f[CR]pandoc\\-server\\f[R] as a CGI program, rename it (or symlink\nit) as \\f[CR]pandoc\\-server.cgi\\f[R].\n(Note: if you symlink it, you may need to adjust your webserver\\(cqs\nconfiguration in order to allow it to follow symlinks for the CGI\nscript.)\n.PP\nAll pandoc functions are run in the PandocPure monad, which ensures that\nthey can do no I/O operations on the server.\nThis should provide a high degree of security.\nThis security does, however, impose certain limitations:\n.IP \\(bu 2\nPDFs cannot be produced.\n.IP \\(bu 2\nFilters are not supported.\n.IP \\(bu 2\nResources cannot be fetched via HTTP.\n.IP \\(bu 2\nAny images, include files, or other resources needed for the document\nconversion must be explicitly included in the request, via the\n\\f[CR]files\\f[R] field (see below under API).\n.SH OPTIONS\n.TP\n\\f[CR]\\-\\-port NUM\\f[R]\nHTTP port on which to run the server.\nDefault: 3030.\n.TP\n\\f[CR]\\-\\-timeout SECONDS\\f[R]\nTimeout in seconds, after which a conversion is killed.\nDefault: 2.\n.RS\nWhen \\f[CR]pandoc\\-server\\f[R] is run as a CGI program, this option can\nbe set via the \\f[CR]PANDOC_SERVER_TIMEOUT\\f[R] environment variable.\n.RE\n.TP\n\\f[CR]\\-\\-help\\f[R]\nPrint this help.\n.TP\n\\f[CR]\\-\\-version\\f[R]\nPrint version.\n.SH API\n.SS Root endpoint\nThe root (\\f[CR]/\\f[R]) endpoint accepts only POST requests.\n.SS Response\nIt returns a converted document in one of the following formats (in\norder of preference), depending on the \\f[CR]Accept\\f[R] header:\n.IP \\(bu 2\n\\f[CR]application/octet\\-stream\\f[R]\n.IP \\(bu 2\n\\f[CR]text/plain\\f[R]\n.IP \\(bu 2\n\\f[CR]application/json\\f[R]\n.PP\nIf the result is a binary format (e.g., \\f[CR]epub\\f[R] or\n\\f[CR]docx\\f[R]) and the content is returned as plain text or JSON, the\nbinary will be base64 encoded.\n.PP\nIf a JSON response is given, it will have one of the following formats.\nIf the conversion is not successful:\n.IP\n.EX\n{ \\(dqerror\\(dq: string with the error message }\n.EE\n.PP\nIf the conversion is successful:\n.IP\n.EX\n{ \\(dqoutput\\(dq: string with textual or base64\\-encoded binary output,\n  \\(dqbase64\\(dq: boolean (true means the \\(dqoutput\\(dq is base64\\-encoded),\n  \\(dqmessages\\(dq: array of message objects (see below) }\n.EE\n.PP\nEach element of the \\(lqmessages\\(rq array will have the format\n.IP\n.EX\n{ \\(dqmessage\\(dq: string,\n  \\(dqverbosity\\(dq: string (either \\(dqWARNING\\(dq or \\(dqINFO\\(dq) }\n.EE\n.SS Request\nThe body of the POST request should be a JSON object, with the following\nfields.\nOnly the \\f[CR]text\\f[R] field is required; all of the others can be\nomitted for default values.\nWhen there are several string alternatives, the first one given is the\ndefault.\n.TP\n\\f[CR]text\\f[R] (string)\nThe document to be converted.\nNote: if the \\f[CR]from\\f[R] format is binary (e.g., \\f[CR]epub\\f[R] or\n\\f[CR]docx\\f[R]), then \\f[CR]text\\f[R] should be a base64 encoding of\nthe document.\n.TP\n\\f[CR]from\\f[R] (string, default \\f[CR]\\(dqmarkdown\\(dq\\f[R])\nThe input format, possibly with extensions, just as it is specified on\nthe pandoc command line.\n.TP\n\\f[CR]to\\f[R] (string, default \\f[CR]\\(dqhtml\\(dq\\f[R])\nThe output format, possibly with extensions, just as it is specified on\nthe pandoc command line.\n.TP\n\\f[CR]shift\\-heading\\-level\\-by\\f[R] (integer, default 0)\nIncrease or decrease the level of all headings.\n.TP\n\\f[CR]indented\\-code\\-classes\\f[R] (array of strings)\nList of classes to be applied to indented Markdown code blocks.\n.TP\n\\f[CR]default\\-image\\-extension\\f[R] (string)\nExtension to be applied to image sources that lack extensions\n(e.g.\\ \\f[CR]\\(dq.jpg\\(dq\\f[R]).\n.TP\n\\f[CR]metadata\\f[R] (JSON map)\nString\\-valued metadata.\n.TP\n\\f[CR]tab\\-stop\\f[R] (integer, default 4)\nTab stop (spaces per tab).\n.TP\n\\f[CR]track\\-changes\\f[R] (\\f[CR]\\(dqaccept\\(dq|\\(dqreject\\(dq|\\(dqall\\(dq\\f[R])\nSpecifies what to do with insertions, deletions, and comments produced\nby the MS Word \\(lqTrack Changes\\(rq feature.\nOnly affects docx input.\n.TP\n\\f[CR]abbreviations\\f[R] (file path)\nList of strings to be regarded as abbreviations when parsing Markdown.\nSee \\f[CR]\\-\\-abbreviations\\f[R] in \\f[CR]pandoc(1)\\f[R] for details.\n.TP\n\\f[CR]standalone\\f[R] (boolean, default false)\nIf true, causes a standalone document to be produced, using the default\ntemplate or the custom template specified using \\f[CR]template\\f[R].\nIf false, a fragment will be produced.\n.TP\n\\f[CR]template\\f[R] (string)\nString contents of a document template (see Templates in\n\\f[CR]pandoc(1)\\f[R] for the format).\n.TP\n\\f[CR]variables\\f[R] (JSON map)\nVariables to be interpolated in the template.\n(See Templates in \\f[CR]pandoc(1)\\f[R].)\n.TP\n\\f[CR]dpi\\f[R] (integer, default 96)\nDots\\-per\\-inch to use for conversions between pixels and other\nmeasurements (for image sizes).\n.TP\n\\f[CR]wrap\\f[R] (\\f[CR]\\(dqauto\\(dq|\\(dqpreserve\\(dq|\\(dqnone\\(dq\\f[R])\nText wrapping option: either \\f[CR]\\(dqauto\\(dq\\f[R] (automatic\nhard\\-wrapping to fit within a column width),\n\\f[CR]\\(dqpreserve\\(dq\\f[R] (insert newlines where they are present in\nthe source), or \\f[CR]\\(dqnone\\(dq\\f[R] (don\\(cqt insert any unnecessary\nnewlines at all).\n.TP\n\\f[CR]columns\\f[R] (integer, default 72)\nColumn width (affects text wrapping and calculation of table column\nwidths in plain text formats)\n.TP\n\\f[CR]table\\-of\\-contents\\f[R] (boolean, default false)\nInclude a table of contents (in supported formats).\n.TP\n\\f[CR]toc\\-depth\\f[R] (integer, default 3)\nDepth of sections to include in the table of contents.\n.TP\n\\f[CR]list\\-of\\-figures\\f[R] (boolean, default false)\nInclude a list of figures (in supported formats).\n.TP\n\\f[CR]list\\-of\\-tables\\f[R] (boolean, default false)\nInclude a list of tables (in supported formats).\n.TP\n\\f[CR]strip\\-comments\\f[R] (boolean, default false)\nCauses HTML comments to be stripped in Markdown or Textile source,\ninstead of being passed through to the output format.\n.TP\n\\f[CR]syntax\\-highlighting\\f[R] (\\f[CR]\\(dqdefault\\(dq|\\(dqnone\\(dq|\\(dqidiomatic\\(dq|style\\f[R])\nThe method used for code syntax highlighting.\nSetting a specific \\f[I]style\\f[R] causes highlighting to be performed\nwith the internal highlighting engine, using KDE syntax definitions and\nstyles.\nThe \\f[CR]\\(dqidiomatic\\(dq\\f[R] method uses a format\\-specific\nhighlighter if one is available, or the default style if the target\nformat has no idiomatic highlighting method.\nSetting this option to \\f[CR]none\\f[R] disables all syntax highlighting.\nThe \\f[CR]\\(dqdefault\\(dq\\f[R] method uses a format\\-specific default.\n.RS\n.PP\nStandard styles are \\f[CR]\\(dqpygments\\(dq\\f[R] (the default),\n\\f[CR]\\(dqkate\\(dq\\f[R], \\f[CR]\\(dqmonochrome\\(dq\\f[R],\n\\f[CR]\\(dqbreezeDark\\(dq\\f[R], \\f[CR]\\(dqespresso\\(dq\\f[R],\n\\f[CR]\\(dqzenburn\\(dq\\f[R], \\f[CR]\\(dqhaddock\\(dq\\f[R], and\n\\f[CR]\\(dqtango\\(dq\\f[R].\nAlternatively, the path of a \\f[CR].theme\\f[R] with a KDE syntax theme\nmay be used (in this case, the relevant file contents must also be\nincluded in \\f[CR]files\\f[R], see below).\n.PP\nThe default for HTML, EPUB, Docx, Ms, Man, and LaTeX output is to use\nthe internal highlighter with the default style; Typst output relies on\nTypst\\(cqs own syntax highlighting system by default.\n.RE\n.TP\n\\f[CR]embed\\-resources\\f[R]\nEmbed images, scripts, styles and other resources in an HTML document\nusing \\f[CR]data\\f[R] URIs.\nNote that this will not work unless the contents of all external\nresources are included under \\f[CR]files\\f[R].\n.TP\n\\f[CR]html\\-q\\-tags\\f[R] (boolean, default false)\nUse \\f[CR]<q>\\f[R] elements in HTML instead of literal quotation marks.\n.TP\n\\f[CR]ascii\\f[R] (boolean, default false)\nUse entities and escapes when possible to avoid non\\-ASCII characters in\nthe output.\n.TP\n\\f[CR]reference\\-links\\f[R] (boolean, default false)\nCreate reference links rather than inline links in Markdown output.\n.TP\n\\f[CR]reference\\-location\\f[R] (\\f[CR]\\(dqdocument\\(dq|\\(dqsection\\(dq|\\(dqblock\\(dq\\f[R])\nDetermines whether link references and footnotes are placed at the end\nof the document, the end of the section, or the end of the block\n(e.g.\\ paragraph), in certain formats.\n(See \\f[CR]pandoc(1)\\f[R] under \\f[CR]\\-\\-reference\\-location\\f[R].)\n.TP\n\\f[CR]setext\\-headers\\f[R] (boolean, default false)\nUse Setext (underlined) headings instead of ATX (\\f[CR]#\\f[R]\\-prefixed)\nin Markdown output.\n.TP\n\\f[CR]top\\-level\\-division\\f[R] (\\f[CR]\\(dqdefault\\(dq|\\(dqpart\\(dq|\\(dqchapter\\(dq|\\(dqsection\\(dq\\f[R])\nDetermines how top\\-level headings are interpreted in LaTeX, ConTeXt,\nDocBook, and TEI.\nThe \\f[CR]\\(dqdefault\\(dq\\f[R] value tries to choose the best\ninterpretation based on heuristics.\n.TP\n\\f[CR]number\\-sections\\f[R] (boolean, default false)\nAutomatically number sections (in supported formats).\n.TP\n\\f[CR]number\\-offset\\f[R] (array of integers)\nOffsets to be added to each component of the section number.\nFor example, \\f[CR][1]\\f[R] will cause the first section to be numbered\n\\(lq2\\(rq and the first subsection \\(lq2.1\\(rq; \\f[CR][0,1]\\f[R] will\ncause the first section to be numbered \\(lq1\\(rq and the first\nsubsection \\(lq1.2.\\(rq\n.TP\n\\f[CR]html\\-math\\-method\\f[R] (\\f[CR]\\(dqplain\\(dq|\\(dqwebtex\\(dq|\\(dqgladtex\\(dq|\\(dqmathml\\(dq|\\(dqmathjax\\(dq|\\(dqkatex\\(dq\\f[R])\nDetermines how math is represented in HTML.\n.TP\n\\f[CR]listings\\f[R] (boolean, default false)\nUse the \\f[CR]listings\\f[R] package to format code in LaTeX output.\n.TP\n\\f[CR]incremental\\f[R] (boolean, default false)\nIf true, lists appear incrementally by default in slide shows.\n.TP\n\\f[CR]slide\\-level\\f[R] (integer)\nHeading level that deterimes slide divisions in slide shows.\nThe default is to pick the highest heading level under which there is\nbody text.\n.TP\n\\f[CR]section\\-divs\\f[R] (boolean, default false)\nArrange the document into a hierarchy of nested sections based on the\nheadings.\n.TP\n\\f[CR]email\\-obfuscation\\f[R] (\\f[CR]\\(dqnone\\(dq|\\(dqreferences\\(dq|\\(dqjavascript\\(dq\\f[R])\nDetermines how email addresses are obfuscated in HTML.\n.TP\n\\f[CR]identifier\\-prefix\\f[R] (string)\nPrefix to be added to all automatically\\-generated identifiers.\n.TP\n\\f[CR]title\\-prefix\\f[R] (string)\nPrefix to be added to the title in the HTML header.\n.TP\n\\f[CR]reference\\-doc\\f[R] (file path)\nReference doc to use in creating \\f[CR]docx\\f[R] or \\f[CR]odt\\f[R] or\n\\f[CR]pptx\\f[R].\nSee \\f[CR]pandoc(1)\\f[R] under \\f[CR]\\-\\-reference\\-doc\\f[R] for\ndetails.\nThe contents of the file must be included under \\f[CR]files\\f[R].\n.TP\n\\f[CR]split\\-level\\f[R] (integer, default 1)\nHeading level at which documents are split in EPUB or chunked HTML.\n.TP\n\\f[CR]epub\\-cover\\-image\\f[R] (file path)\nCover image for EPUB.\nThe contents of the file must be included under \\f[CR]files\\f[R].\n.TP\n\\f[CR]epub\\-metadata\\f[R] (file path)\nPath of file containing Dublin core XML elements to be used for EPUB\nmetadata.\nThe contents of the file must be included under \\f[CR]files\\f[R].\n.TP\n\\f[CR]epub\\-subdirectory\\f[R] (string, default \\(lqEPUB\\(rq)\nName of content subdirectory in the EPUB container.\n.TP\n\\f[CR]epub\\-fonts\\f[R] (array of file paths)\nFonts to include in the EPUB.\nThe fonts themselves must be included in \\f[CR]files\\f[R] (see below).\n.TP\n\\f[CR]ipynb\\-output\\f[R] (\\f[CR]\\(dqbest\\(dq|\\(dqall\\(dq|\\(dqnone\\(dq\\f[R])\nDetermines how ipynb output cells are treated.\n\\f[CR]all\\f[R] means that all of the data formats included in the\noriginal are preserved.\n\\f[CR]none\\f[R] means that the contents of data cells are omitted.\n\\f[CR]best\\f[R] causes pandoc to try to pick the richest data block in\neach output cell that is compatible with the output format.\n.TP\n\\f[CR]citeproc\\f[R] (boolean, default false)\nCauses citations to be processed using citeproc.\nSee Citations in \\f[CR]pandoc(1)\\f[R] for details.\n.TP\n\\f[CR]bibliography\\f[R] (array of file paths)\nFiles containing bibliographic data.\nThe contents of the files must be included in \\f[CR]files\\f[R].\n.TP\n\\f[CR]csl\\f[R] (file path)\nCSL style file.\nThe contents of the file must be included in \\f[CR]files\\f[R].\n.TP\n\\f[CR]cite\\-method\\f[R] (\\f[CR]\\(dqciteproc\\(dq|\\(dqnatbib\\(dq|\\(dqbiblatex\\(dq\\f[R])\nDetermines how citations are formatted in LaTeX output.\n.TP\n\\f[CR]files\\f[R] (JSON mapping of file paths to base64\\-encoded strings)\nAny files needed for the conversion, including images referred to in the\ndocument source, should be included here.\nBinary data must be base64\\-encoded.\nTextual data may be left as it is, unless it is \\f[I]also\\f[R] valid\nbase 64 data, in which case it will be interpreted that way.\n.SS \\f[CR]/batch\\f[R] endpoint\nThe \\f[CR]/batch\\f[R] endpoint behaves like the root endpoint, except\nfor these two points:\n.IP \\(bu 2\nIt accepts a JSON array, each element of which is a JSON object like the\none expected by the root endpoint.\n.IP \\(bu 2\nIt returns a JSON array of JSON results.\n.PP\nThis endpoint can be used to convert a sequence of small snippets in one\nrequest.\n.SS \\f[CR]/version\\f[R] endpoint\nThe \\f[CR]/version\\f[R] endpoint accepts a GET request and returns the\npandoc version as a plain or JSON\\-encoded string, depending on Accept\nheaders.\n.SS \\f[CR]/babelmark\\f[R] endpoint\nThe \\f[CR]/babelmark\\f[R] endpoint accepts a GET request with the\nfollowing query parameters:\n.IP \\(bu 2\n\\f[CR]text\\f[R] (required string)\n.IP \\(bu 2\n\\f[CR]from\\f[R] (optional string, default is\n\\f[CR]\\(dqmarkdown\\(dq\\f[R])\n.IP \\(bu 2\n\\f[CR]to\\f[R] (optional string, default is \\f[CR]\\(dqhtml\\(dq\\f[R])\n.IP \\(bu 2\n\\f[CR]standalone\\f[R] (optional boolean, default is \\f[CR]false\\f[R])\n.PP\nIt returns a JSON object with fields \\f[CR]html\\f[R] and\n\\f[CR]version\\f[R].\nThis endpoint is designed to support the Babelmark website.\n.SH AUTHORS\nCopyright 2022 John MacFarlane (jgm\\(atberkeley.edu).\nReleased under the GPL, version 2 or greater.\nThis software carries no warranty of any kind.\n(See COPYRIGHT for full copyright and warranty notices.)\n.PP\nThe Pandoc source code may be downloaded\nfrom <https://hackage.haskell.org/package/pandoc> or\n<https://github.com/jgm/pandoc/releases>.  Further\ndocumentation is available at <https://pandoc.org>.\n"
  },
  {
    "path": "pandoc-cli/man/pandoc.1",
    "content": ".\\\" Automatically generated by Pandoc 3.9.0.2\n.\\\"\n.TH \"pandoc\" \"1\" \"2026\\-03\\-19\" \"pandoc 3.9.0.2\" \"Pandoc User\\[cq]s Guide\"\n.SH NAME\npandoc - general markup converter\n.SH SYNOPSIS\n\\f[CR]pandoc\\f[R] [\\f[I]options\\f[R]] [\\f[I]input\\-file\\f[R]]\\&...\n.SH DESCRIPTION\nPandoc is a Haskell library for converting from one markup format to\nanother, and a command\\-line tool that uses this library.\n.PP\nPandoc can convert between numerous markup and word processing formats,\nincluding, but not limited to, various flavors of Markdown, HTML, LaTeX\nand Word docx.\nFor the full lists of input and output formats, see the\n\\f[CR]\\-\\-from\\f[R] and \\f[CR]\\-\\-to\\f[R] options below.\nPandoc can also produce PDF output: see creating a PDF, below.\n.PP\nPandoc\\(cqs enhanced version of Markdown includes syntax for tables,\ndefinition lists, metadata blocks, footnotes, citations, math, and much\nmore.\nSee below under Pandoc\\(cqs Markdown.\n.PP\nPandoc has a modular design: it consists of a set of readers, which\nparse text in a given format and produce a native representation of the\ndocument (an \\f[I]abstract syntax tree\\f[R] or AST), and a set of\nwriters, which convert this native representation into a target format.\nThus, adding an input or output format requires only adding a reader or\nwriter.\nUsers can also run custom pandoc filters to modify the intermediate AST.\n.PP\nBecause pandoc\\(cqs intermediate representation of a document is less\nexpressive than many of the formats it converts between, one should not\nexpect perfect conversions between every format and every other.\nPandoc attempts to preserve the structural elements of a document, but\nnot formatting details such as margin size.\nAnd some document elements, such as complex tables, may not fit into\npandoc\\(cqs simple document model.\nWhile conversions from pandoc\\(cqs Markdown to all formats aspire to be\nperfect, conversions from formats more expressive than pandoc\\(cqs\nMarkdown can be expected to be lossy.\n.SS Using pandoc\nIf no \\f[I]input\\-files\\f[R] are specified, input is read from\n\\f[I]stdin\\f[R].\nOutput goes to \\f[I]stdout\\f[R] by default.\nFor output to a file, use the \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R]\noption:\n.IP\n.EX\npandoc \\-o output.html input.txt\n.EE\n.PP\nBy default, pandoc produces a document fragment.\nTo produce a standalone document (e.g.\\ a valid HTML file including\n\\f[CR]<head>\\f[R] and \\f[CR]<body>\\f[R]), use the \\f[CR]\\-s\\f[R] or\n\\f[CR]\\-\\-standalone\\f[R] flag:\n.IP\n.EX\npandoc \\-s \\-o output.html input.txt\n.EE\n.PP\nFor more information on how standalone documents are produced, see\nTemplates below.\n.PP\nIf multiple input files are given, pandoc will concatenate them all\n(with blank lines between them) before parsing.\n(Use \\f[CR]\\-\\-file\\-scope\\f[R] to parse files individually.)\n.SS Specifying formats\nThe format of the input and output can be specified explicitly using\ncommand\\-line options.\nThe input format can be specified using the \\f[CR]\\-f/\\-\\-from\\f[R]\noption, the output format using the \\f[CR]\\-t/\\-\\-to\\f[R] option.\nThus, to convert \\f[CR]hello.txt\\f[R] from Markdown to LaTeX, you could\ntype:\n.IP\n.EX\npandoc \\-f markdown \\-t latex hello.txt\n.EE\n.PP\nTo convert \\f[CR]hello.html\\f[R] from HTML to Markdown:\n.IP\n.EX\npandoc \\-f html \\-t markdown hello.html\n.EE\n.PP\nSupported input and output formats are listed below under Options (see\n\\f[CR]\\-f\\f[R] for input formats and \\f[CR]\\-t\\f[R] for output formats).\nYou can also use \\f[CR]pandoc \\-\\-list\\-input\\-formats\\f[R] and\n\\f[CR]pandoc \\-\\-list\\-output\\-formats\\f[R] to print lists of supported\nformats.\n.PP\nIf the input or output format is not specified explicitly, pandoc will\nattempt to guess it from the extensions of the filenames.\nThus, for example,\n.IP\n.EX\npandoc \\-o hello.tex hello.txt\n.EE\n.PP\nwill convert \\f[CR]hello.txt\\f[R] from Markdown to LaTeX.\nIf no output file is specified (so that output goes to\n\\f[I]stdout\\f[R]), or if the output file\\(cqs extension is unknown, the\noutput format will default to HTML.\nIf no input file is specified (so that input comes from\n\\f[I]stdin\\f[R]), or if the input files\\(cq extensions are unknown, the\ninput format will be assumed to be Markdown.\n.SS Character encoding\nPandoc uses the UTF\\-8 character encoding for both input and output.\nIf your local character encoding is not UTF\\-8, you should pipe input\nand output through \\f[CR]iconv\\f[R]:\n.IP\n.EX\niconv \\-t utf\\-8 input.txt | pandoc | iconv \\-f utf\\-8\n.EE\n.PP\nNote that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,\nOPML, DocBook, and Texinfo), information about the character encoding is\nincluded in the document header, which will only be included if you use\nthe \\f[CR]\\-s/\\-\\-standalone\\f[R] option.\n.SS Creating a PDF\nTo produce a PDF, specify an output file with a \\f[CR].pdf\\f[R]\nextension:\n.IP\n.EX\npandoc test.txt \\-o test.pdf\n.EE\n.PP\nBy default, pandoc will use LaTeX to create the PDF, which requires that\na LaTeX engine be installed (see \\f[CR]\\-\\-pdf\\-engine\\f[R] below).\nAlternatively, pandoc can use ConTeXt, roff ms, or HTML as an\nintermediate format.\nTo do this, specify an output file with a \\f[CR].pdf\\f[R] extension, as\nbefore, but add the \\f[CR]\\-\\-pdf\\-engine\\f[R] option or\n\\f[CR]\\-t context\\f[R], \\f[CR]\\-t html\\f[R], or \\f[CR]\\-t ms\\f[R] to the\ncommand line.\nThe tool used to generate the PDF from the intermediate format may be\nspecified using \\f[CR]\\-\\-pdf\\-engine\\f[R].\n.PP\nYou can control the PDF style using variables, depending on the\nintermediate format used: see variables for LaTeX, variables for\nConTeXt, variables for \\f[CR]wkhtmltopdf\\f[R], variables for ms.\nWhen HTML is used as an intermediate format, the output can be styled\nusing \\f[CR]\\-\\-css\\f[R].\n.PP\nTo debug the PDF creation, it can be useful to look at the intermediate\nrepresentation: instead of \\f[CR]\\-o test.pdf\\f[R], use for example\n\\f[CR]\\-s \\-o test.tex\\f[R] to output the generated LaTeX.\nYou can then test it with \\f[CR]pdflatex test.tex\\f[R].\n.PP\nWhen using LaTeX, the following packages need to be available (they are\nincluded with all recent versions of TeX Live): \\f[CR]amsfonts\\f[R],\n\\f[CR]amsmath\\f[R], \\f[CR]lm\\f[R], \\f[CR]unicode\\-math\\f[R],\n\\f[CR]iftex\\f[R], \\f[CR]listings\\f[R] (if the \\f[CR]\\-\\-listings\\f[R]\noption is used), \\f[CR]fancyvrb\\f[R], \\f[CR]longtable\\f[R],\n\\f[CR]booktabs\\f[R], \\f[CR]multirow\\f[R] (if the document contains a\ntable with cells that cross multiple rows), \\f[CR]graphicx\\f[R] (if the\ndocument contains images), \\f[CR]bookmark\\f[R], \\f[CR]xcolor\\f[R],\n\\f[CR]soul\\f[R], \\f[CR]geometry\\f[R] (with the \\f[CR]geometry\\f[R]\nvariable set), \\f[CR]setspace\\f[R] (with \\f[CR]linestretch\\f[R]), and\n\\f[CR]babel\\f[R] (with \\f[CR]lang\\f[R]).\nIf \\f[CR]CJKmainfont\\f[R] is set, \\f[CR]xeCJK\\f[R] is needed if\n\\f[CR]xelatex\\f[R] is used, else \\f[CR]luatexja\\f[R] is needed if\n\\f[CR]lualatex\\f[R] is used.\n\\f[CR]framed\\f[R] is required if code is highlighted in a scheme that\nuse a colored background.\nThe use of \\f[CR]xelatex\\f[R] or \\f[CR]lualatex\\f[R] as the PDF engine\nrequires \\f[CR]fontspec\\f[R].\n\\f[CR]lualatex\\f[R] uses \\f[CR]selnolig\\f[R] and \\f[CR]lua\\-ul\\f[R].\n\\f[CR]xelatex\\f[R] uses \\f[CR]bidi\\f[R] (with the \\f[CR]dir\\f[R]\nvariable set).\nIf the \\f[CR]mathspec\\f[R] variable is set, \\f[CR]xelatex\\f[R] will use\n\\f[CR]mathspec\\f[R] instead of \\f[CR]unicode\\-math\\f[R].\nThe \\f[CR]csquotes\\f[R] package will be used for typography if the\n\\f[CR]csquotes\\f[R] variable or metadata field is set to a true value.\nThe \\f[CR]natbib\\f[R], \\f[CR]biblatex\\f[R], \\f[CR]bibtex\\f[R], and\n\\f[CR]biber\\f[R] packages can optionally be used for citation rendering.\nIf math with \\f[CR]\\(rscancel\\f[R], \\f[CR]\\(rsbcancel\\f[R], or\n\\f[CR]\\(rsxcancel\\f[R] is used, the \\f[CR]cancel\\f[R] package is needed.\nThe following packages will be used to improve output quality if\npresent, but pandoc does not require them to be present:\n\\f[CR]upquote\\f[R] (for straight quotes in verbatim environments),\n\\f[CR]microtype\\f[R] (for better spacing adjustments),\n\\f[CR]parskip\\f[R] (for better inter\\-paragraph spaces), \\f[CR]xurl\\f[R]\n(for better line breaks in URLs), and \\f[CR]footnotehyper\\f[R] or\n\\f[CR]footnote\\f[R] (to allow footnotes in tables).\n.SS Reading from the Web\nInstead of an input file, an absolute URI may be given.\nIn this case pandoc will fetch the content using HTTP:\n.IP\n.EX\npandoc \\-f html \\-t markdown https://www.fsf.org\n.EE\n.PP\nIt is possible to supply a custom User\\-Agent string or other header\nwhen requesting a document from a URL:\n.IP\n.EX\npandoc \\-f html \\-t markdown \\-\\-request\\-header User\\-Agent:\\(dqMozilla/5.0\\(dq \\(rs\n  https://www.fsf.org\n.EE\n.SH OPTIONS\n.SS General options\n.TP\n\\f[CR]\\-f\\f[R] \\f[I]FORMAT\\f[R], \\f[CR]\\-r\\f[R] \\f[I]FORMAT\\f[R], \\f[CR]\\-\\-from=\\f[R]\\f[I]FORMAT\\f[R], \\f[CR]\\-\\-read=\\f[R]\\f[I]FORMAT\\f[R]\nSpecify input format.\n\\f[I]FORMAT\\f[R] can be:\n.RS\n.IP \\(bu 2\n\\f[CR]asciidoc\\f[R] (AsciiDoc markup)\n.IP \\(bu 2\n\\f[CR]bibtex\\f[R] (BibTeX bibliography)\n.IP \\(bu 2\n\\f[CR]biblatex\\f[R] (BibLaTeX bibliography)\n.IP \\(bu 2\n\\f[CR]bits\\f[R] (BITS XML, alias for \\f[CR]jats\\f[R])\n.IP \\(bu 2\n\\f[CR]commonmark\\f[R] (CommonMark Markdown)\n.IP \\(bu 2\n\\f[CR]commonmark_x\\f[R] (CommonMark Markdown with extensions)\n.IP \\(bu 2\n\\f[CR]creole\\f[R] (Creole 1.0)\n.IP \\(bu 2\n\\f[CR]csljson\\f[R] (CSL JSON bibliography)\n.IP \\(bu 2\n\\f[CR]csv\\f[R] (CSV table)\n.IP \\(bu 2\n\\f[CR]tsv\\f[R] (TSV table)\n.IP \\(bu 2\n\\f[CR]djot\\f[R] (Djot markup)\n.IP \\(bu 2\n\\f[CR]docbook\\f[R] (DocBook)\n.IP \\(bu 2\n\\f[CR]docx\\f[R] (Word docx)\n.IP \\(bu 2\n\\f[CR]dokuwiki\\f[R] (DokuWiki markup)\n.IP \\(bu 2\n\\f[CR]endnotexml\\f[R] (EndNote XML bibliography)\n.IP \\(bu 2\n\\f[CR]epub\\f[R] (EPUB)\n.IP \\(bu 2\n\\f[CR]fb2\\f[R] (FictionBook2 e\\-book)\n.IP \\(bu 2\n\\f[CR]gfm\\f[R] (GitHub\\-Flavored Markdown), or the deprecated and less\naccurate \\f[CR]markdown_github\\f[R]; use \\f[CR]markdown_github\\f[R] only\nif you need extensions not supported in \\f[CR]gfm\\f[R].\n.IP \\(bu 2\n\\f[CR]haddock\\f[R] (Haddock markup)\n.IP \\(bu 2\n\\f[CR]html\\f[R] (HTML)\n.IP \\(bu 2\n\\f[CR]ipynb\\f[R] (Jupyter notebook)\n.IP \\(bu 2\n\\f[CR]jats\\f[R] (JATS XML)\n.IP \\(bu 2\n\\f[CR]jira\\f[R] (Jira/Confluence wiki markup)\n.IP \\(bu 2\n\\f[CR]json\\f[R] (JSON version of native AST)\n.IP \\(bu 2\n\\f[CR]latex\\f[R] (LaTeX)\n.IP \\(bu 2\n\\f[CR]markdown\\f[R] (Pandoc\\(cqs Markdown)\n.IP \\(bu 2\n\\f[CR]markdown_mmd\\f[R] (MultiMarkdown)\n.IP \\(bu 2\n\\f[CR]markdown_phpextra\\f[R] (PHP Markdown Extra)\n.IP \\(bu 2\n\\f[CR]markdown_strict\\f[R] (original unextended Markdown)\n.IP \\(bu 2\n\\f[CR]mediawiki\\f[R] (MediaWiki markup)\n.IP \\(bu 2\n\\f[CR]man\\f[R] (roff man)\n.IP \\(bu 2\n\\f[CR]mdoc\\f[R] (mdoc manual page markup)\n.IP \\(bu 2\n\\f[CR]muse\\f[R] (Muse)\n.IP \\(bu 2\n\\f[CR]native\\f[R] (native Haskell)\n.IP \\(bu 2\n\\f[CR]odt\\f[R] (OpenDocument text document)\n.IP \\(bu 2\n\\f[CR]opml\\f[R] (OPML)\n.IP \\(bu 2\n\\f[CR]org\\f[R] (Emacs Org mode)\n.IP \\(bu 2\n\\f[CR]pod\\f[R] (Perl\\(cqs Plain Old Documentation)\n.IP \\(bu 2\n\\f[CR]pptx\\f[R] (PowerPoint)\n.IP \\(bu 2\n\\f[CR]ris\\f[R] (RIS bibliography)\n.IP \\(bu 2\n\\f[CR]rtf\\f[R] (Rich Text Format)\n.IP \\(bu 2\n\\f[CR]rst\\f[R] (reStructuredText)\n.IP \\(bu 2\n\\f[CR]t2t\\f[R] (txt2tags)\n.IP \\(bu 2\n\\f[CR]textile\\f[R] (Textile)\n.IP \\(bu 2\n\\f[CR]tikiwiki\\f[R] (TikiWiki markup)\n.IP \\(bu 2\n\\f[CR]twiki\\f[R] (TWiki markup)\n.IP \\(bu 2\n\\f[CR]typst\\f[R] (typst)\n.IP \\(bu 2\n\\f[CR]vimwiki\\f[R] (Vimwiki)\n.IP \\(bu 2\n\\f[CR]xlsx\\f[R] (Excel spreadsheet)\n.IP \\(bu 2\n\\f[CR]xml\\f[R] (XML version of native AST)\n.IP \\(bu 2\nthe path of a custom Lua reader, see Custom readers and writers below\n.PP\nExtensions can be individually enabled or disabled by appending\n\\f[CR]+EXTENSION\\f[R] or \\f[CR]\\-EXTENSION\\f[R] to the format name.\nSee Extensions below, for a list of extensions and their names.\nSee \\f[CR]\\-\\-list\\-input\\-formats\\f[R] and\n\\f[CR]\\-\\-list\\-extensions\\f[R], below.\n.RE\n.TP\n\\f[CR]\\-t\\f[R] \\f[I]FORMAT\\f[R], \\f[CR]\\-w\\f[R] \\f[I]FORMAT\\f[R], \\f[CR]\\-\\-to=\\f[R]\\f[I]FORMAT\\f[R], \\f[CR]\\-\\-write=\\f[R]\\f[I]FORMAT\\f[R]\nSpecify output format.\n\\f[I]FORMAT\\f[R] can be:\n.RS\n.IP \\(bu 2\n\\f[CR]ansi\\f[R] (text with ANSI escape codes, for terminal viewing)\n.IP \\(bu 2\n\\f[CR]asciidoc\\f[R] (modern AsciiDoc as interpreted by AsciiDoctor)\n.IP \\(bu 2\n\\f[CR]asciidoc_legacy\\f[R] (AsciiDoc as interpreted by\n\\f[CR]asciidoc\\-py\\f[R]).\n.IP \\(bu 2\n\\f[CR]asciidoctor\\f[R] (deprecated synonym for \\f[CR]asciidoc\\f[R])\n.IP \\(bu 2\n\\f[CR]bbcode\\f[R] BBCode\n.IP \\(bu 2\n\\f[CR]bbcode_fluxbb\\f[R] BBCode (FluxBB)\n.IP \\(bu 2\n\\f[CR]bbcode_phpbb\\f[R] BBCode (phpBB)\n.IP \\(bu 2\n\\f[CR]bbcode_steam\\f[R] BBCode (Steam)\n.IP \\(bu 2\n\\f[CR]bbcode_hubzilla\\f[R] BBCode (Hubzilla)\n.IP \\(bu 2\n\\f[CR]bbcode_xenforo\\f[R] BBCode (xenForo)\n.IP \\(bu 2\n\\f[CR]beamer\\f[R] (LaTeX beamer slide show)\n.IP \\(bu 2\n\\f[CR]bibtex\\f[R] (BibTeX bibliography)\n.IP \\(bu 2\n\\f[CR]biblatex\\f[R] (BibLaTeX bibliography)\n.IP \\(bu 2\n\\f[CR]chunkedhtml\\f[R] (zip archive of multiple linked HTML files)\n.IP \\(bu 2\n\\f[CR]commonmark\\f[R] (CommonMark Markdown)\n.IP \\(bu 2\n\\f[CR]commonmark_x\\f[R] (CommonMark Markdown with extensions)\n.IP \\(bu 2\n\\f[CR]context\\f[R] (ConTeXt)\n.IP \\(bu 2\n\\f[CR]csljson\\f[R] (CSL JSON bibliography)\n.IP \\(bu 2\n\\f[CR]djot\\f[R] (Djot markup)\n.IP \\(bu 2\n\\f[CR]docbook\\f[R] or \\f[CR]docbook4\\f[R] (DocBook 4)\n.IP \\(bu 2\n\\f[CR]docbook5\\f[R] (DocBook 5)\n.IP \\(bu 2\n\\f[CR]docx\\f[R] (Word docx)\n.IP \\(bu 2\n\\f[CR]dokuwiki\\f[R] (DokuWiki markup)\n.IP \\(bu 2\n\\f[CR]epub\\f[R] or \\f[CR]epub3\\f[R] (EPUB v3 book)\n.IP \\(bu 2\n\\f[CR]epub2\\f[R] (EPUB v2)\n.IP \\(bu 2\n\\f[CR]fb2\\f[R] (FictionBook2 e\\-book)\n.IP \\(bu 2\n\\f[CR]gfm\\f[R] (GitHub\\-Flavored Markdown), or the deprecated and less\naccurate \\f[CR]markdown_github\\f[R]; use \\f[CR]markdown_github\\f[R] only\nif you need extensions not supported in \\f[CR]gfm\\f[R].\n.IP \\(bu 2\n\\f[CR]haddock\\f[R] (Haddock markup)\n.IP \\(bu 2\n\\f[CR]html\\f[R] or \\f[CR]html5\\f[R] (HTML, i.e.\\ HTML5/XHTML polyglot\nmarkup)\n.IP \\(bu 2\n\\f[CR]html4\\f[R] (XHTML 1.0 Transitional)\n.IP \\(bu 2\n\\f[CR]icml\\f[R] (InDesign ICML)\n.IP \\(bu 2\n\\f[CR]ipynb\\f[R] (Jupyter notebook)\n.IP \\(bu 2\n\\f[CR]jats_archiving\\f[R] (JATS XML, Archiving and Interchange Tag Set)\n.IP \\(bu 2\n\\f[CR]jats_articleauthoring\\f[R] (JATS XML, Article Authoring Tag Set)\n.IP \\(bu 2\n\\f[CR]jats_publishing\\f[R] (JATS XML, Journal Publishing Tag Set)\n.IP \\(bu 2\n\\f[CR]jats\\f[R] (alias for \\f[CR]jats_archiving\\f[R])\n.IP \\(bu 2\n\\f[CR]jira\\f[R] (Jira/Confluence wiki markup)\n.IP \\(bu 2\n\\f[CR]json\\f[R] (JSON version of native AST)\n.IP \\(bu 2\n\\f[CR]latex\\f[R] (LaTeX)\n.IP \\(bu 2\n\\f[CR]man\\f[R] (roff man)\n.IP \\(bu 2\n\\f[CR]markdown\\f[R] (Pandoc\\(cqs Markdown)\n.IP \\(bu 2\n\\f[CR]markdown_mmd\\f[R] (MultiMarkdown)\n.IP \\(bu 2\n\\f[CR]markdown_phpextra\\f[R] (PHP Markdown Extra)\n.IP \\(bu 2\n\\f[CR]markdown_strict\\f[R] (original unextended Markdown)\n.IP \\(bu 2\n\\f[CR]markua\\f[R] (Markua)\n.IP \\(bu 2\n\\f[CR]mediawiki\\f[R] (MediaWiki markup)\n.IP \\(bu 2\n\\f[CR]ms\\f[R] (roff ms)\n.IP \\(bu 2\n\\f[CR]muse\\f[R] (Muse)\n.IP \\(bu 2\n\\f[CR]native\\f[R] (native Haskell)\n.IP \\(bu 2\n\\f[CR]odt\\f[R] (OpenDocument text document)\n.IP \\(bu 2\n\\f[CR]opml\\f[R] (OPML)\n.IP \\(bu 2\n\\f[CR]opendocument\\f[R] (OpenDocument XML)\n.IP \\(bu 2\n\\f[CR]org\\f[R] (Emacs Org mode)\n.IP \\(bu 2\n\\f[CR]pdf\\f[R] (PDF)\n.IP \\(bu 2\n\\f[CR]plain\\f[R] (plain text)\n.IP \\(bu 2\n\\f[CR]pptx\\f[R] (PowerPoint slide show)\n.IP \\(bu 2\n\\f[CR]rst\\f[R] (reStructuredText)\n.IP \\(bu 2\n\\f[CR]rtf\\f[R] (Rich Text Format)\n.IP \\(bu 2\n\\f[CR]texinfo\\f[R] (GNU Texinfo)\n.IP \\(bu 2\n\\f[CR]textile\\f[R] (Textile)\n.IP \\(bu 2\n\\f[CR]slideous\\f[R] (Slideous HTML and JavaScript slide show)\n.IP \\(bu 2\n\\f[CR]slidy\\f[R] (Slidy HTML and JavaScript slide show)\n.IP \\(bu 2\n\\f[CR]dzslides\\f[R] (DZSlides HTML5 + JavaScript slide show)\n.IP \\(bu 2\n\\f[CR]revealjs\\f[R] (reveal.js HTML5 + JavaScript slide show)\n.IP \\(bu 2\n\\f[CR]s5\\f[R] (S5 HTML and JavaScript slide show)\n.IP \\(bu 2\n\\f[CR]tei\\f[R] (TEI Simple)\n.IP \\(bu 2\n\\f[CR]typst\\f[R] (typst)\n.IP \\(bu 2\n\\f[CR]vimdoc\\f[R] (Vimdoc)\n.IP \\(bu 2\n\\f[CR]xml\\f[R] (XML version of native AST)\n.IP \\(bu 2\n\\f[CR]xwiki\\f[R] (XWiki markup)\n.IP \\(bu 2\n\\f[CR]zimwiki\\f[R] (ZimWiki markup)\n.IP \\(bu 2\nthe path of a custom Lua writer, see Custom readers and writers below\n.PP\nNote that \\f[CR]odt\\f[R], \\f[CR]docx\\f[R], \\f[CR]epub\\f[R], and\n\\f[CR]pdf\\f[R] output will not be directed to \\f[I]stdout\\f[R] unless\nforced with \\f[CR]\\-o \\-\\f[R].\n.PP\nExtensions can be individually enabled or disabled by appending\n\\f[CR]+EXTENSION\\f[R] or \\f[CR]\\-EXTENSION\\f[R] to the format name.\nSee Extensions below, for a list of extensions and their names.\nSee \\f[CR]\\-\\-list\\-output\\-formats\\f[R] and\n\\f[CR]\\-\\-list\\-extensions\\f[R], below.\n.RE\n.TP\n\\f[CR]\\-o\\f[R] \\f[I]FILE\\f[R], \\f[CR]\\-\\-output=\\f[R]\\f[I]FILE\\f[R]\nWrite output to \\f[I]FILE\\f[R] instead of \\f[I]stdout\\f[R].\nIf \\f[I]FILE\\f[R] is \\f[CR]\\-\\f[R], output will go to \\f[I]stdout\\f[R],\neven if a non\\-textual format (\\f[CR]docx\\f[R], \\f[CR]odt\\f[R],\n\\f[CR]epub2\\f[R], \\f[CR]epub3\\f[R]) is specified.\nIf the output format is \\f[CR]chunkedhtml\\f[R] and \\f[I]FILE\\f[R] has no\nextension, then instead of producing a \\f[CR].zip\\f[R] file pandoc will\ncreate a directory \\f[I]FILE\\f[R] and unpack the zip archive there\n(unless \\f[I]FILE\\f[R] already exists, in which case an error will be\nraised).\n.TP\n\\f[CR]\\-\\-data\\-dir=\\f[R]\\f[I]DIRECTORY\\f[R]\nSpecify the user data directory to search for pandoc data files.\nIf this option is not specified, the default user data directory will be\nused.\nOn *nix and macOS systems this will be the \\f[CR]pandoc\\f[R]\nsubdirectory of the XDG data directory (by default,\n\\f[CR]$HOME/.local/share\\f[R], overridable by setting the\n\\f[CR]XDG_DATA_HOME\\f[R] environment variable).\nIf that directory does not exist and \\f[CR]$HOME/.pandoc\\f[R] exists, it\nwill be used (for backwards compatibility).\nOn Windows the default user data directory is\n\\f[CR]%APPDATA%\\(rspandoc\\f[R].\nYou can find the default user data directory on your system by looking\nat the output of \\f[CR]pandoc \\-\\-version\\f[R].\nData files placed in this directory (for example,\n\\f[CR]reference.odt\\f[R], \\f[CR]reference.docx\\f[R],\n\\f[CR]epub.css\\f[R], \\f[CR]templates\\f[R]) will override pandoc\\(cqs\nnormal defaults.\n(Note that the user data directory is not created by pandoc, so you will\nneed to create it yourself if you want to make use of it.)\n.TP\n\\f[CR]\\-d\\f[R] \\f[I]FILE\\f[R], \\f[CR]\\-\\-defaults=\\f[R]\\f[I]FILE\\f[R]\nSpecify a set of default option settings.\n\\f[I]FILE\\f[R] is a YAML or JSON file whose fields correspond to\ncommand\\-line option settings.\nAll options for document conversion, including input and output files,\ncan be set using a defaults file.\nThe file will be searched for first in the working directory, and then\nin the \\f[CR]defaults\\f[R] subdirectory of the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R]).\nThe \\f[CR].yaml\\f[R] extension will be added if \\f[I]FILE\\f[R] lacs an\nextension.\nSee the section Defaults files for more information on the file format.\nSettings from the defaults file may be overridden or extended by\nsubsequent options on the command line.\n.TP\n\\f[CR]\\-\\-bash\\-completion\\f[R]\nGenerate a bash completion script.\nTo enable bash completion with pandoc, add this to your\n\\f[CR].bashrc\\f[R]:\n.RS\n.IP\n.EX\neval \\(dq$(pandoc \\-\\-bash\\-completion)\\(dq\n.EE\n.RE\n.TP\n\\f[CR]\\-\\-verbose\\f[R]\nGive verbose debugging output.\n.TP\n\\f[CR]\\-\\-quiet\\f[R]\nSuppress warning messages.\n.TP\n\\f[CR]\\-\\-fail\\-if\\-warnings[=true|false]\\f[R]\nExit with error status if there are any warnings.\n.TP\n\\f[CR]\\-\\-log=\\f[R]\\f[I]FILE\\f[R]\nWrite log messages in machine\\-readable JSON format to \\f[I]FILE\\f[R].\nAll messages above DEBUG level will be written, regardless of verbosity\nsettings (\\f[CR]\\-\\-verbose\\f[R], \\f[CR]\\-\\-quiet\\f[R]).\n.TP\n\\f[CR]\\-\\-list\\-input\\-formats\\f[R]\nList supported input formats, one per line.\n.TP\n\\f[CR]\\-\\-list\\-output\\-formats\\f[R]\nList supported output formats, one per line.\n.TP\n\\f[CR]\\-\\-list\\-extensions\\f[R][\\f[CR]=\\f[R]\\f[I]FORMAT\\f[R]]\nList supported extensions for \\f[I]FORMAT\\f[R], one per line, preceded\nby a \\f[CR]+\\f[R] or \\f[CR]\\-\\f[R] indicating whether it is enabled by\ndefault in \\f[I]FORMAT\\f[R].\nIf \\f[I]FORMAT\\f[R] is not specified, defaults for pandoc\\(cqs Markdown\nare given.\n.TP\n\\f[CR]\\-\\-list\\-highlight\\-languages\\f[R]\nList supported languages for syntax highlighting, one per line.\n.TP\n\\f[CR]\\-\\-list\\-highlight\\-styles\\f[R]\nList supported styles for syntax highlighting, one per line.\nSee \\f[CR]\\-\\-syntax\\-highlighting\\f[R].\n.TP\n\\f[CR]\\-v\\f[R], \\f[CR]\\-\\-version\\f[R]\nPrint version.\n.TP\n\\f[CR]\\-h\\f[R], \\f[CR]\\-\\-help\\f[R]\nShow usage message.\n.SS Reader options\n.TP\n\\f[CR]\\-\\-shift\\-heading\\-level\\-by=\\f[R]\\f[I]NUMBER\\f[R]\nShift heading levels by a positive or negative integer.\nFor example, with \\f[CR]\\-\\-shift\\-heading\\-level\\-by=\\-1\\f[R], level 2\nheadings become level 1 headings, and level 3 headings become level 2\nheadings.\nHeadings cannot have a level less than 1, so a heading that would be\nshifted below level 1 becomes a regular paragraph.\nException: with a shift of \\-N, a level\\-N heading at the beginning of\nthe document replaces the metadata title.\n\\f[CR]\\-\\-shift\\-heading\\-level\\-by=\\-1\\f[R] is a good choice when\nconverting HTML or Markdown documents that use an initial level\\-1\nheading for the document title and level\\-2+ headings for sections.\n\\f[CR]\\-\\-shift\\-heading\\-level\\-by=1\\f[R] may be a good choice for\nconverting Markdown documents that use level\\-1 headings for sections to\nHTML, since pandoc uses a level\\-1 heading to render the document title.\n.TP\n\\f[CR]\\-\\-base\\-header\\-level=\\f[R]\\f[I]NUMBER\\f[R]\n\\f[I]Deprecated.\nUse \\f[CI]\\-\\-shift\\-heading\\-level\\-by\\f[I]=X instead, where X = NUMBER\n\\- 1.\\f[R] Specify the base level for headings (defaults to 1).\n.TP\n\\f[CR]\\-\\-indented\\-code\\-classes=\\f[R]\\f[I]CLASSES\\f[R]\nSpecify classes to use for indented code blocks\\(emfor example,\n\\f[CR]perl,numberLines\\f[R] or \\f[CR]haskell\\f[R].\nMultiple classes may be separated by spaces or commas.\n.TP\n\\f[CR]\\-\\-default\\-image\\-extension=\\f[R]\\f[I]EXTENSION\\f[R]\nSpecify a default extension to use when image paths/URLs have no\nextension.\nThis allows you to use the same source for formats that require\ndifferent kinds of images.\nCurrently this option only affects the Markdown and LaTeX readers.\n.TP\n\\f[CR]\\-\\-file\\-scope[=true|false]\\f[R]\nParse each file individually before combining for multifile documents.\nThis will allow footnotes in different files with the same identifiers\nto work as expected.\nIf this option is set, footnotes and links will not work across files.\nReading binary files (docx, odt, epub) implies\n\\f[CR]\\-\\-file\\-scope\\f[R].\n.RS\n.PP\nIf two or more files are processed using \\f[CR]\\-\\-file\\-scope\\f[R],\nprefixes based on the filenames will be added to identifiers in order to\ndisambiguate them, and internal links will be adjusted accordingly.\nFor example, a header with identifier \\f[CR]foo\\f[R] in\n\\f[CR]subdir/file1.txt\\f[R] will have its identifier changed to\n\\f[CR]subdir__file1.txt__foo\\f[R].\n.RE\n.TP\n\\f[CR]\\-F\\f[R] \\f[I]PROGRAM\\f[R], \\f[CR]\\-\\-filter=\\f[R]\\f[I]PROGRAM\\f[R]\nSpecify an executable to be used as a filter transforming the pandoc AST\nafter the input is parsed and before the output is written.\nThe executable should read JSON from stdin and write JSON to stdout.\nThe JSON must be formatted like pandoc\\(cqs own JSON input and output.\nThe name of the output format will be passed to the filter as the first\nargument.\nHence,\n.RS\n.IP\n.EX\npandoc \\-\\-filter ./caps.py \\-t latex\n.EE\n.PP\nis equivalent to\n.IP\n.EX\npandoc \\-t json | ./caps.py latex | pandoc \\-f json \\-t latex\n.EE\n.PP\nThe latter form may be useful for debugging filters.\n.PP\nFilters may be written in any language.\n\\f[CR]Text.Pandoc.JSON\\f[R] exports \\f[CR]toJSONFilter\\f[R] to\nfacilitate writing filters in Haskell.\nThose who would prefer to write filters in python can use the module\n\\f[CR]pandocfilters\\f[R], installable from PyPI.\nThere are also pandoc filter libraries in PHP, perl, and\nJavaScript/node.js.\n.PP\nIn order of preference, pandoc will look for filters in\n.IP \"1.\" 3\na specified full or relative path (executable or non\\-executable),\n.IP \"2.\" 3\n\\f[CR]$DATADIR/filters\\f[R] (executable or non\\-executable) where\n\\f[CR]$DATADIR\\f[R] is the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R], above),\n.IP \"3.\" 3\n\\f[CR]$PATH\\f[R] (executable only).\n.PP\nFilters, Lua\\-filters, and citeproc processing are applied in the order\nspecified on the command line.\n.RE\n.TP\n\\f[CR]\\-L\\f[R] \\f[I]SCRIPT\\f[R], \\f[CR]\\-\\-lua\\-filter=\\f[R]\\f[I]SCRIPT\\f[R]\nTransform the document in a similar fashion as JSON filters (see\n\\f[CR]\\-\\-filter\\f[R]), but use pandoc\\(cqs built\\-in Lua filtering\nsystem.\nThe given Lua script is expected to return a list of Lua filters which\nwill be applied in order.\nEach Lua filter must contain element\\-transforming functions indexed by\nthe name of the AST element on which the filter function should be\napplied.\n.RS\n.PP\nThe \\f[CR]pandoc\\f[R] Lua module provides helper functions for element\ncreation.\nIt is always loaded into the script\\(cqs Lua environment.\n.PP\nSee the Lua filters documentation for further details.\n.PP\nIn order of preference, pandoc will look for Lua filters in\n.IP \"1.\" 3\na specified full or relative path,\n.IP \"2.\" 3\n\\f[CR]$DATADIR/filters\\f[R] where \\f[CR]$DATADIR\\f[R] is the user data\ndirectory (see \\f[CR]\\-\\-data\\-dir\\f[R], above).\n.PP\nFilters, Lua filters, and citeproc processing are applied in the order\nspecified on the command line.\n.RE\n.TP\n\\f[CR]\\-M\\f[R] \\f[I]KEY\\f[R][\\f[CR]=\\f[R]\\f[I]VAL\\f[R]], \\f[CR]\\-\\-metadata=\\f[R]\\f[I]KEY\\f[R][\\f[CR]:\\f[R]\\f[I]VAL\\f[R]]\nSet the metadata field \\f[I]KEY\\f[R] to the value \\f[I]VAL\\f[R].\nA value specified on the command line overrides a value specified in the\ndocument using YAML metadata blocks.\nValues will be parsed as YAML boolean or string values.\nIf no value is specified, the value will be treated as Boolean true.\nLike \\f[CR]\\-\\-variable\\f[R], \\f[CR]\\-\\-metadata\\f[R] causes template\nvariables to be set.\nBut unlike \\f[CR]\\-\\-variable\\f[R], \\f[CR]\\-\\-metadata\\f[R] affects the\nmetadata of the underlying document (which is accessible from filters\nand may be printed in some output formats) and metadata values will be\nescaped when inserted into the template.\n.TP\n\\f[CR]\\-\\-metadata\\-file=\\f[R]\\f[I]FILE\\f[R]\nRead metadata from the supplied YAML (or JSON) file.\nThis option can be used with every input format, but string scalars in\nthe metadata file will always be parsed as Markdown.\n(If the input format is Markdown or a Markdown variant, then the same\nvariant will be used to parse the metadata file; if it is a\nnon\\-Markdown format, pandoc\\(cqs default Markdown extensions will be\nused.)\nThis option can be used repeatedly to include multiple metadata files;\nvalues in files specified later on the command line will be preferred\nover those specified in earlier files.\nMetadata values specified inside the document, or by using\n\\f[CR]\\-M\\f[R], overwrite values specified with this option.\nThe file will be searched for first in the working directory, and then\nin the \\f[CR]metadata\\f[R] subdirectory of the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R]).\n.TP\n\\f[CR]\\-p\\f[R], \\f[CR]\\-\\-preserve\\-tabs[=true|false]\\f[R]\nPreserve tabs instead of converting them to spaces.\n(By default, pandoc converts tabs to spaces before parsing its input.)\nNote that this will only affect tabs in literal code spans and code\nblocks.\nTabs in regular text are always treated as spaces.\n.TP\n\\f[CR]\\-\\-tab\\-stop=\\f[R]\\f[I]NUMBER\\f[R]\nSpecify the number of spaces per tab (default is 4).\n.TP\n\\f[CR]\\-\\-track\\-changes=accept\\f[R]|\\f[CR]reject\\f[R]|\\f[CR]all\\f[R]\nSpecifies what to do with insertions, deletions, and comments produced\nby the MS Word \\(lqTrack Changes\\(rq feature.\n\\f[CR]accept\\f[R] (the default) processes all the insertions and\ndeletions.\n\\f[CR]reject\\f[R] ignores them.\nBoth \\f[CR]accept\\f[R] and \\f[CR]reject\\f[R] ignore comments.\n\\f[CR]all\\f[R] includes all insertions, deletions, and comments, wrapped\nin spans with \\f[CR]insertion\\f[R], \\f[CR]deletion\\f[R],\n\\f[CR]comment\\-start\\f[R], and \\f[CR]comment\\-end\\f[R] classes,\nrespectively.\nThe author and time of change is included.\n\\f[CR]all\\f[R] is useful for scripting: only accepting changes from a\ncertain reviewer, say, or before a certain date.\nIf a paragraph is inserted or deleted, \\f[CR]track\\-changes=all\\f[R]\nproduces a span with the class\n\\f[CR]paragraph\\-insertion\\f[R]/\\f[CR]paragraph\\-deletion\\f[R] before\nthe affected paragraph break.\nThis option only affects the docx reader.\n.TP\n\\f[CR]\\-\\-extract\\-media=\\f[R]\\f[I]DIR\\f[R]|\\f[I]FILE\\f[R]\\f[CR].zip\\f[R]\nExtract images and other media contained in or linked from the source\ndocument to the path \\f[I]DIR\\f[R], creating it if necessary, and adjust\nthe images references in the document so they point to the extracted\nfiles.\nMedia are downloaded, read from the file system, or extracted from a\nbinary container (e.g.\\ docx), as needed.\nThe original file paths are used if they are relative paths not\ncontaining \\f[CR]..\\f[R].\nOtherwise filenames are constructed from the SHA1 hash of the contents.\n.RS\n.PP\nIf the path given ends in \\f[CR].zip\\f[R], then instead of creating a\ndirectory, pandoc will create a zip archive containing the media files.\n.RE\n.TP\n\\f[CR]\\-\\-abbreviations=\\f[R]\\f[I]FILE\\f[R]\nSpecifies a custom abbreviations file, with abbreviations one to a line.\nIf this option is not specified, pandoc will read the data file\n\\f[CR]abbreviations\\f[R] from the user data directory or fall back on a\nsystem default.\nTo see the system default, use\n\\f[CR]pandoc \\-\\-print\\-default\\-data\\-file=abbreviations\\f[R].\nThe only use pandoc makes of this list is in the Markdown reader.\nStrings found in this list will be followed by a nonbreaking space, and\nthe period will not produce sentence\\-ending space in formats like\nLaTeX.\nThe strings may not contain spaces.\n.TP\n\\f[CR]\\-\\-trace[=true|false]\\f[R]\nPrint diagnostic output tracing parser progress to stderr.\nThis option is intended for use by developers in diagnosing performance\nissues.\n.SS General writer options\n.TP\n\\f[CR]\\-s\\f[R], \\f[CR]\\-\\-standalone\\f[R]\nProduce output with an appropriate header and footer (e.g.\\ a standalone\nHTML, LaTeX, TEI, or RTF file, not a fragment).\nThis option is set automatically for \\f[CR]pdf\\f[R], \\f[CR]epub\\f[R],\n\\f[CR]epub3\\f[R], \\f[CR]fb2\\f[R], \\f[CR]docx\\f[R], and \\f[CR]odt\\f[R]\noutput.\nFor \\f[CR]native\\f[R] output, this option causes metadata to be\nincluded; otherwise, metadata is suppressed.\n.TP\n\\f[CR]\\-\\-template=\\f[R]\\f[I]FILE\\f[R]|\\f[I]URL\\f[R]\nUse the specified file as a custom template for the generated document.\nImplies \\f[CR]\\-\\-standalone\\f[R].\nSee Templates, below, for a description of template syntax.\nIf the template is not found, pandoc will search for it in the\n\\f[CR]templates\\f[R] subdirectory of the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R]).\nIf no extension is specified and an extensionless template is not found,\npandoc will look for a template with an extension corresponding to the\nwriter, so that \\f[CR]\\-\\-template=special\\f[R] looks for\n\\f[CR]special.html\\f[R] for HTML output.\nIf this option is not used, a default template appropriate for the\noutput format will be used (see\n\\f[CR]\\-D/\\-\\-print\\-default\\-template\\f[R]).\n.TP\n\\f[CR]\\-V\\f[R] \\f[I]KEY\\f[R][\\f[CR]=\\f[R]\\f[I]VAL\\f[R]], \\f[CR]\\-\\-variable=\\f[R]\\f[I]KEY\\f[R][\\f[CR]=\\f[R]\\f[I]VAL\\f[R]]\nSet the template variable \\f[I]KEY\\f[R] to the string value\n\\f[I]VAL\\f[R] when rendering the document in standalone mode.\nEither \\f[CR]:\\f[R] or \\f[CR]=\\f[R] may be used to separate\n\\f[I]KEY\\f[R] from \\f[I]VAL\\f[R].\nIf no \\f[I]VAL\\f[R] is specified, the key will be given the value\n\\f[CR]true\\f[R].\nStructured values (lists, maps) cannot be assigned using this option,\nbut they can be assigned in the \\f[CR]variables\\f[R] section of a\ndefaults file or using the \\f[CR]\\-\\-variable\\-json\\f[R] option.\nIf the variable already has a \\f[I]list\\f[R] value, the value will be\nadded to the list.\nIf it already has another kind of value, it will be made into a list\ncontaining the previous and the new value.\nFor example, \\f[CR]\\-V keyword=Joe \\-V author=Sue\\f[R] makes\n\\f[CR]author\\f[R] contain a list of strings: \\f[CR]Joe\\f[R] and\n\\f[CR]Sue\\f[R].\n.TP\n\\f[CR]\\-\\-variable\\-json=\\f[R]\\f[I]KEY\\f[R][\\f[CR]=\\f[R]:\\f[I]JSON\\f[R]]\nSet the template variable \\f[I]KEY\\f[R] to the value specified by a JSON\nstring (this may be a boolean, a string, a list, or a mapping; a number\nwill be treated as a string).\nFor example, \\f[CR]\\-\\-variable\\-json foo=false\\f[R] will give\n\\f[CR]foo\\f[R] the boolean false value, while\n\\f[CR]\\-\\-variable\\-json foo=\\(aq\\(dqfalse\\(dq\\(aq\\f[R] will give it the\nstring value \\f[CR]\\(dqfalse\\(dq\\f[R].\nEither \\f[CR]:\\f[R] or \\f[CR]=\\f[R] may be used to separate\n\\f[I]KEY\\f[R] from \\f[I]VAL\\f[R].\nIf the variable already has a value, this value will be replaced.\n.TP\n\\f[CR]\\-\\-sandbox[=true|false]\\f[R]\nRun pandoc in a sandbox, limiting IO operations in readers and writers\nto reading the files specified on the command line.\nNote that this option does not limit IO operations by filters or in the\nproduction of PDF documents.\nBut it does offer security against, for example, disclosure of files\nthrough the use of \\f[CR]include\\f[R] directives.\nAnyone using pandoc on untrusted user input should use this option.\n.RS\n.PP\nNote: some readers and writers (e.g., \\f[CR]docx\\f[R]) need access to\ndata files.\nIf these are stored on the file system, then pandoc will not be able to\nfind them when run in \\f[CR]\\-\\-sandbox\\f[R] mode and will raise an\nerror.\nFor these applications, we recommend using a pandoc binary compiled with\nthe \\f[CR]embed_data_files\\f[R] option, which causes the data files to\nbe baked into the binary instead of being stored on the file system.\n.RE\n.TP\n\\f[CR]\\-D\\f[R] \\f[I]FORMAT\\f[R], \\f[CR]\\-\\-print\\-default\\-template=\\f[R]\\f[I]FORMAT\\f[R]\nPrint the system default template for an output \\f[I]FORMAT\\f[R].\n(See \\f[CR]\\-t\\f[R] for a list of possible \\f[I]FORMAT\\f[R]s.)\nTemplates in the user data directory are ignored.\nThis option may be used with \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R] to\nredirect output to a file, but \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R] must\ncome before \\f[CR]\\-\\-print\\-default\\-template\\f[R] on the command line.\n.RS\n.PP\nNote that some of the default templates use partials, for example\n\\f[CR]styles.html\\f[R].\nTo print the partials, use \\f[CR]\\-\\-print\\-default\\-data\\-file\\f[R]:\nfor example,\n\\f[CR]\\-\\-print\\-default\\-data\\-file=templates/styles.html\\f[R].\n.RE\n.TP\n\\f[CR]\\-\\-print\\-default\\-data\\-file=\\f[R]\\f[I]FILE\\f[R]\nPrint a system default data file.\nFiles in the user data directory are ignored.\nThis option may be used with \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R] to\nredirect output to a file, but \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R] must\ncome before \\f[CR]\\-\\-print\\-default\\-data\\-file\\f[R] on the command\nline.\n.TP\n\\f[CR]\\-\\-eol=crlf\\f[R]|\\f[CR]lf\\f[R]|\\f[CR]native\\f[R]\nManually specify line endings: \\f[CR]crlf\\f[R] (Windows), \\f[CR]lf\\f[R]\n(macOS/Linux/UNIX), or \\f[CR]native\\f[R] (line endings appropriate to\nthe OS on which pandoc is being run).\nThe default is \\f[CR]native\\f[R].\n.TP\n\\f[CR]\\-\\-dpi\\f[R]=\\f[I]NUMBER\\f[R]\nSpecify the default dpi (dots per inch) value for conversion from pixels\nto inch/centimeters and vice versa.\n(Technically, the correct term would be ppi: pixels per inch.)\nThe default is 96dpi.\nWhen images contain information about dpi internally, the encoded value\nis used instead of the default specified by this option.\n.TP\n\\f[CR]\\-\\-wrap=auto\\f[R]|\\f[CR]none\\f[R]|\\f[CR]preserve\\f[R]\nDetermine how text is wrapped in the output (the source code, not the\nrendered version).\nWith \\f[CR]auto\\f[R] (the default), pandoc will attempt to wrap lines to\nthe column width specified by \\f[CR]\\-\\-columns\\f[R] (default 72).\nWith \\f[CR]none\\f[R], pandoc will not wrap lines at all.\nWith \\f[CR]preserve\\f[R], pandoc will attempt to preserve the wrapping\nfrom the source document (that is, where there are nonsemantic newlines\nin the source, there will be nonsemantic newlines in the output as\nwell).\nIn \\f[CR]ipynb\\f[R] output, this option affects wrapping of the contents\nof Markdown cells.\n.TP\n\\f[CR]\\-\\-columns=\\f[R]\\f[I]NUMBER\\f[R]\nSpecify length of lines in characters.\nThis affects text wrapping in the generated source code (see\n\\f[CR]\\-\\-wrap\\f[R]).\nIt also affects calculation of column widths for plain text tables (see\nTables below).\n.TP\n\\f[CR]\\-\\-toc[=true|false]\\f[R], \\f[CR]\\-\\-table\\-of\\-contents[=true|false]\\f[R]\nInclude an automatically generated table of contents (or, in the case of\n\\f[CR]latex\\f[R], \\f[CR]context\\f[R], \\f[CR]docx\\f[R], \\f[CR]odt\\f[R],\n\\f[CR]opendocument\\f[R], \\f[CR]rst\\f[R], or \\f[CR]ms\\f[R], an\ninstruction to create one) in the output document.\nThis option has no effect unless \\f[CR]\\-s/\\-\\-standalone\\f[R] is used,\nand it has no effect on \\f[CR]man\\f[R], \\f[CR]docbook4\\f[R],\n\\f[CR]docbook5\\f[R], or \\f[CR]jats\\f[R] output.\n.RS\n.PP\nNote that if you are producing a PDF via \\f[CR]ms\\f[R] and using (the\ndefault) \\f[CR]pdfroff\\f[R] as a \\f[CR]\\-\\-pdf\\-engine\\f[R], the table\nof contents will appear at the beginning of the document, before the\ntitle.\nIf you would prefer it to be at the end of the document, use the option\n\\f[CR]\\-\\-pdf\\-engine\\-opt=\\-\\-no\\-toc\\-relocation\\f[R].\nIf \\f[CR]groff\\f[R] is used as the \\f[CR]\\-\\-pdf\\-engine\\f[R], the table\nof contents will always appear at the end of the document.\n.RE\n.TP\n\\f[CR]\\-\\-toc\\-depth=\\f[R]\\f[I]NUMBER\\f[R]\nSpecify the number of section levels to include in the table of\ncontents.\nThe default is 3 (which means that level\\-1, 2, and 3 headings will be\nlisted in the contents).\n.TP\n\\f[CR]\\-\\-lof[=true|false]\\f[R], \\f[CR]\\-\\-list\\-of\\-figures[=true|false]\\f[R]\nInclude an automatically generated list of figures (or, in some formats,\nan instruction to create one) in the output document.\nThis option has no effect unless \\f[CR]\\-s/\\-\\-standalone\\f[R] is used,\nand it only has an effect on \\f[CR]latex\\f[R], \\f[CR]context\\f[R], and\n\\f[CR]docx\\f[R] output.\n.TP\n\\f[CR]\\-\\-lot[=true|false]\\f[R], \\f[CR]\\-\\-list\\-of\\-tables[=true|false]\\f[R]\nInclude an automatically generated list of tables (or, in some formats,\nan instruction to create one) in the output document.\nThis option has no effect unless \\f[CR]\\-s/\\-\\-standalone\\f[R] is used,\nand it only has an effect on \\f[CR]latex\\f[R], \\f[CR]context\\f[R], and\n\\f[CR]docx\\f[R] output.\n.TP\n\\f[CR]\\-\\-strip\\-comments[=true|false]\\f[R]\nStrip out HTML comments in the Markdown or Textile source, rather than\npassing them on to Markdown, Textile or HTML output as raw HTML.\nThis does not apply to HTML comments inside raw HTML blocks when the\n\\f[CR]markdown_in_html_blocks\\f[R] extension is not set.\n.TP\n\\f[CR]\\-\\-syntax\\-highlighting=default|none|idiomatic|\\f[R]\\f[I]STYLE\\f[R]\\f[CR]|\\f[R]\\f[I]FILE\\f[R]\nThe method to use for code syntax highlighting.\nSetting a specific \\f[I]STYLE\\f[R] causes highlighting to be performed\nwith the internal highlighting engine, using KDE syntax definitions and\nstyles.\nThe \\f[CR]idiomatic\\f[R] method uses a format\\-specific highlighter if\none is available, or the default style if the target format has no\nidiomatic highlighting method.\nSetting this option to \\f[CR]none\\f[R] disables all syntax highlighting.\nThe \\f[CR]default\\f[R] method uses a format\\-specific default.\n.RS\n.PP\nThe default for HTML, EPUB, Docx, Ms, Man, and LaTeX output is to use\nthe internal highlighter with the default style; for Typst it is to use\nTypst\\(cqs own syntax highlighting system.\n.PP\nStyle options are \\f[CR]pygments\\f[R] (the default), \\f[CR]kate\\f[R],\n\\f[CR]monochrome\\f[R], \\f[CR]breezeDark\\f[R], \\f[CR]espresso\\f[R],\n\\f[CR]zenburn\\f[R], \\f[CR]haddock\\f[R], and \\f[CR]tango\\f[R].\nFor more information on syntax highlighting in pandoc, see Syntax\nhighlighting, below.\nSee also \\f[CR]\\-\\-list\\-highlight\\-styles\\f[R].\n.PP\nInstead of a \\f[I]STYLE\\f[R] name, a JSON file with extension\n\\f[CR].theme\\f[R] may be supplied.\nThis will be parsed as a KDE syntax highlighting theme and (if valid)\nused as the highlighting style.\n.PP\nTo generate the JSON version of an existing style, use\n\\f[CR]\\-\\-print\\-highlight\\-style\\f[R].\n.RE\n.TP\n\\f[CR]\\-\\-no\\-highlight\\f[R]\n\\f[I]Deprecated, use \\f[CI]\\-\\-syntax\\-highlighting=none\\f[I]\ninstead.\\f[R]\n.RS\n.PP\nDisables syntax highlighting for code blocks and inlines, even when a\nlanguage attribute is given.\n.RE\n.TP\n\\f[CR]\\-\\-highlight\\-style=\\f[R]\\f[I]STYLE\\f[R]|\\f[I]FILE\\f[R]\n\\f[I]Deprecated, use\n\\f[CI]\\-\\-syntax\\-highlighting=\\f[I]\\f[R]STYLE\\f[I]|\\f[R]FILE\\f[I]\ninstead.\\f[R]\n.RS\n.PP\nSpecifies the coloring style to be used in highlighted source code.\n.RE\n.TP\n\\f[CR]\\-\\-print\\-highlight\\-style=\\f[R]\\f[I]STYLE\\f[R]|\\f[I]FILE\\f[R]\nPrints a JSON version of a highlighting style, which can be modified,\nsaved with a \\f[CR].theme\\f[R] extension, and used with\n\\f[CR]\\-\\-syntax\\-highlighting\\f[R].\nThis option may be used with \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R] to\nredirect output to a file, but \\f[CR]\\-o\\f[R]/\\f[CR]\\-\\-output\\f[R] must\ncome before \\f[CR]\\-\\-print\\-highlight\\-style\\f[R] on the command line.\n.TP\n\\f[CR]\\-\\-syntax\\-definition=\\f[R]\\f[I]FILE\\f[R]\nInstructs pandoc to load a KDE XML syntax definition file, which will be\nused for syntax highlighting of appropriately marked code blocks.\nThis can be used to add support for new languages or to use altered\nsyntax definitions for existing languages.\nThis option may be repeated to add multiple syntax definitions.\n.TP\n\\f[CR]\\-H\\f[R] \\f[I]FILE\\f[R], \\f[CR]\\-\\-include\\-in\\-header=\\f[R]\\f[I]FILE\\f[R]|\\f[I]URL\\f[R]\nInclude contents of \\f[I]FILE\\f[R], verbatim, at the end of the header.\nThis can be used, for example, to include special CSS or JavaScript in\nHTML documents.\nThis option can be used repeatedly to include multiple files in the\nheader.\nThey will be included in the order specified.\nImplies \\f[CR]\\-\\-standalone\\f[R].\n.TP\n\\f[CR]\\-B\\f[R] \\f[I]FILE\\f[R], \\f[CR]\\-\\-include\\-before\\-body=\\f[R]\\f[I]FILE\\f[R]|\\f[I]URL\\f[R]\nInclude contents of \\f[I]FILE\\f[R], verbatim, at the beginning of the\ndocument body (e.g.\\ after the \\f[CR]<body>\\f[R] tag in HTML, or the\n\\f[CR]\\(rsbegin{document}\\f[R] command in LaTeX).\nThis can be used to include navigation bars or banners in HTML\ndocuments.\nThis option can be used repeatedly to include multiple files.\nThey will be included in the order specified.\nImplies \\f[CR]\\-\\-standalone\\f[R].\nNote that if the output format is \\f[CR]odt\\f[R], this file must be in\nOpenDocument XML format suitable for insertion into the body of the\ndocument, and if the output is \\f[CR]docx\\f[R], this file must be in\nappropriate OpenXML format.\n.TP\n\\f[CR]\\-A\\f[R] \\f[I]FILE\\f[R], \\f[CR]\\-\\-include\\-after\\-body=\\f[R]\\f[I]FILE\\f[R]|\\f[I]URL\\f[R]\nInclude contents of \\f[I]FILE\\f[R], verbatim, at the end of the document\nbody (before the \\f[CR]</body>\\f[R] tag in HTML, or the\n\\f[CR]\\(rsend{document}\\f[R] command in LaTeX).\nThis option can be used repeatedly to include multiple files.\nThey will be included in the order specified.\nImplies \\f[CR]\\-\\-standalone\\f[R].\nNote that if the output format is \\f[CR]odt\\f[R], this file must be in\nOpenDocument XML format suitable for insertion into the body of the\ndocument, and if the output is \\f[CR]docx\\f[R], this file must be in\nappropriate OpenXML format.\n.TP\n\\f[CR]\\-\\-resource\\-path=\\f[R]\\f[I]SEARCHPATH\\f[R]\nList of paths to search for images and other resources.\nThe paths should be separated by \\f[CR]:\\f[R] on Linux, UNIX, and macOS\nsystems, and by \\f[CR];\\f[R] on Windows.\nIf \\f[CR]\\-\\-resource\\-path\\f[R] is not specified, the default resource\npath is the working directory.\nNote that, if \\f[CR]\\-\\-resource\\-path\\f[R] is specified, the working\ndirectory must be explicitly listed or it will not be searched.\nFor example: \\f[CR]\\-\\-resource\\-path=.:test\\f[R] will search the\nworking directory and the \\f[CR]test\\f[R] subdirectory, in that order.\nThis option can be used repeatedly.\nSearch path components that come later on the command line will be\nsearched before those that come earlier, so\n\\f[CR]\\-\\-resource\\-path foo:bar \\-\\-resource\\-path baz:bim\\f[R] is\nequivalent to \\f[CR]\\-\\-resource\\-path baz:bim:foo:bar\\f[R].\nNote that this option only has an effect when pandoc itself needs to\nfind an image (e.g., in producing a PDF or docx, or when\n\\f[CR]\\-\\-embed\\-resources\\f[R] is used.)\nIt will not cause image paths to be rewritten in other cases (e.g., when\npandoc is generating LaTeX or HTML).\n.TP\n\\f[CR]\\-\\-request\\-header=\\f[R]\\f[I]NAME\\f[R]\\f[CR]:\\f[R]\\f[I]VAL\\f[R]\nSet the request header \\f[I]NAME\\f[R] to the value \\f[I]VAL\\f[R] when\nmaking HTTP requests (for example, when a URL is given on the command\nline, or when resources used in a document must be downloaded).\nIf you\\(cqre behind a proxy, you also need to set the environment\nvariable \\f[CR]http_proxy\\f[R] to \\f[CR]http://...\\f[R].\n.TP\n\\f[CR]\\-\\-no\\-check\\-certificate[=true|false]\\f[R]\nDisable the certificate verification to allow access to unsecure HTTP\nresources (for example when the certificate is no longer valid or self\nsigned).\n.SS Options affecting specific writers\n.TP\n\\f[CR]\\-\\-self\\-contained[=true|false]\\f[R]\n\\f[I]Deprecated synonym for\n\\f[CI]\\-\\-embed\\-resources \\-\\-standalone\\f[I].\\f[R]\n.TP\n\\f[CR]\\-\\-embed\\-resources[=true|false]\\f[R]\nProduce a standalone HTML file with no external dependencies, using\n\\f[CR]data:\\f[R] URIs to incorporate the contents of linked scripts,\nstylesheets, images, and videos.\nThe resulting file should be \\(lqself\\-contained,\\(rq in the sense that\nit needs no external files and no net access to be displayed properly by\na browser.\nThis option works only with HTML output formats, including\n\\f[CR]html4\\f[R], \\f[CR]html5\\f[R], \\f[CR]html+lhs\\f[R],\n\\f[CR]html5+lhs\\f[R], \\f[CR]s5\\f[R], \\f[CR]slidy\\f[R],\n\\f[CR]slideous\\f[R], \\f[CR]dzslides\\f[R], and \\f[CR]revealjs\\f[R].\nScripts, images, and stylesheets at absolute URLs will be downloaded;\nthose at relative URLs will be sought relative to the working directory\n(if the first source file is local) or relative to the base URL (if the\nfirst source file is remote).\nElements with the attribute \\f[CR]data\\-external=\\(dq1\\(dq\\f[R] will be\nleft alone; the documents they link to will not be incorporated in the\ndocument.\nLimitation: resources that are loaded dynamically through JavaScript\ncannot be incorporated; as a result, fonts may be missing when\n\\f[CR]\\-\\-mathjax\\f[R] is used, and some advanced features (e.g.\\ zoom\nor speaker notes) may not work in an offline \\(lqself\\-contained\\(rq\n\\f[CR]reveal.js\\f[R] slide show.\n.RS\n.PP\nFor SVG images, \\f[CR]img\\f[R] tags with \\f[CR]data:\\f[R] URIs are used,\nunless the image has the class \\f[CR]inline\\-svg\\f[R], in which case an\ninline SVG element is inserted.\nThis approach is recommended when there are many occurrences of the same\nSVG in a document, as \\f[CR]<use>\\f[R] elements will be used to reduce\nduplication.\n.RE\n.TP\n\\f[CR]\\-\\-link\\-images[=true|false]\\f[R]\nInclude links to images instead of embedding the images in ODT.\n(This option currently only affects ODT output.)\n.TP\n\\f[CR]\\-\\-html\\-q\\-tags[=true|false]\\f[R]\nUse \\f[CR]<q>\\f[R] tags for quotes in HTML.\n(This option only has an effect if the \\f[CR]smart\\f[R] extension is\nenabled for the input format used.)\n.TP\n\\f[CR]\\-\\-ascii[=true|false]\\f[R]\nUse only ASCII characters in output.\nCurrently supported for XML and HTML formats (which use entities instead\nof UTF\\-8 when this option is selected), CommonMark, gfm, and Markdown\n(which use entities), roff man and ms (which use hexadecimal escapes),\nand to a limited degree LaTeX (which uses standard commands for accented\ncharacters when possible).\n.TP\n\\f[CR]\\-\\-reference\\-links[=true|false]\\f[R]\nUse reference\\-style links, rather than inline links, in writing\nMarkdown or reStructuredText.\nBy default inline links are used.\nThe placement of link references is affected by the\n\\f[CR]\\-\\-reference\\-location\\f[R] option.\n.TP\n\\f[CR]\\-\\-reference\\-location=block\\f[R]|\\f[CR]section\\f[R]|\\f[CR]document\\f[R]\nSpecify whether footnotes (and references, if\n\\f[CR]reference\\-links\\f[R] is set) are placed at the end of the current\n(top\\-level) block, the current section, or the document.\nThe default is \\f[CR]document\\f[R].\nCurrently this option only affects the \\f[CR]markdown\\f[R],\n\\f[CR]muse\\f[R], \\f[CR]html\\f[R], \\f[CR]epub\\f[R], \\f[CR]slidy\\f[R],\n\\f[CR]s5\\f[R], \\f[CR]slideous\\f[R], \\f[CR]dzslides\\f[R], and\n\\f[CR]revealjs\\f[R] writers.\nIn slide formats, specifying \\f[CR]\\-\\-reference\\-location=section\\f[R]\nwill cause notes to be rendered at the bottom of a slide.\n.TP\n\\f[CR]\\-\\-figure\\-caption\\-position=above\\f[R]|\\f[CR]below\\f[R]\nSpecify whether figure captions go above or below figures (default is\n\\f[CR]below\\f[R]).\nThis option only affects HTML, LaTeX, Docx, ODT, and Typst output.\n.TP\n\\f[CR]\\-\\-table\\-caption\\-position=above\\f[R]|\\f[CR]below\\f[R]\nSpecify whether table captions go above or below tables (default is\n\\f[CR]above\\f[R]).\nThis option only affects HTML, LaTeX, Docx, ODT, and Typst output.\n.TP\n\\f[CR]\\-\\-markdown\\-headings=setext\\f[R]|\\f[CR]atx\\f[R]\nSpecify whether to use ATX\\-style (\\f[CR]#\\f[R]\\-prefixed) or\nSetext\\-style (underlined) headings for level 1 and 2 headings in\nMarkdown output.\n(The default is \\f[CR]atx\\f[R].)\nATX\\-style headings are always used for levels 3+.\nThis option also affects Markdown cells in \\f[CR]ipynb\\f[R] output.\n.TP\n\\f[CR]\\-\\-list\\-tables[=true|false]\\f[R]\nRender tables as list tables in RST output.\n.TP\n\\f[CR]\\-\\-top\\-level\\-division=default\\f[R]|\\f[CR]section\\f[R]|\\f[CR]chapter\\f[R]|\\f[CR]part\\f[R]\nTreat top\\-level headings as the given division type in LaTeX, ConTeXt,\nDocBook, and TEI output.\nThe hierarchy order is part, chapter, then section; all headings are\nshifted such that the top\\-level heading becomes the specified type.\nThe default behavior is to determine the best division type via\nheuristics: unless other conditions apply, \\f[CR]section\\f[R] is chosen.\nWhen the \\f[CR]documentclass\\f[R] variable is set to \\f[CR]report\\f[R],\n\\f[CR]book\\f[R], or \\f[CR]memoir\\f[R] (unless the \\f[CR]article\\f[R]\noption is specified), \\f[CR]chapter\\f[R] is implied as the setting for\nthis option.\nIf \\f[CR]beamer\\f[R] is the output format, specifying either\n\\f[CR]chapter\\f[R] or \\f[CR]part\\f[R] will cause top\\-level headings to\nbecome \\f[CR]\\(rspart{..}\\f[R], while second\\-level headings remain as\ntheir default type.\n.RS\n.PP\nIn Docx output, this option adds section breaks before first\\-level\nheadings if \\f[CR]chapter\\f[R] is selected, and before first\\- and\nsecond\\-level headings if \\f[CR]part\\f[R] is selected.\nFootnote numbers will restart with each section break unless the\nreference doc modifies this.\n.RE\n.TP\n\\f[CR]\\-N\\f[R], \\f[CR]\\-\\-number\\-sections=[true|false]\\f[R]\nNumber section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB\noutput.\nBy default, sections are not numbered.\nSections with class \\f[CR]unnumbered\\f[R] will never be numbered, even\nif \\f[CR]\\-\\-number\\-sections\\f[R] is specified.\n.TP\n\\f[CR]\\-\\-number\\-offset=\\f[R]\\f[I]NUMBER\\f[R][\\f[CR],\\f[R]\\f[I]NUMBER\\f[R]\\f[CR],\\f[R]\\f[I]\\&...\\f[R]]\nOffsets for section heading numbers.\nThe first number is added to the section number for level\\-1 headings,\nthe second for level\\-2 headings, and so on.\nSo, for example, if you want the first level\\-1 heading in your document\nto be numbered \\(lq6\\(rq instead of \\(lq1\\(rq, specify\n\\f[CR]\\-\\-number\\-offset=5\\f[R].\nIf your document starts with a level\\-2 heading which you want to be\nnumbered \\(lq1.5\\(rq, specify \\f[CR]\\-\\-number\\-offset=1,4\\f[R].\n\\f[CR]\\-\\-number\\-offset\\f[R] only directly affects the number of the\nfirst section heading in a document; subsequent numbers increment in the\nnormal way.\nImplies \\f[CR]\\-\\-number\\-sections\\f[R].\nCurrently this feature only affects HTML and Docx output.\n.TP\n\\f[CR]\\-\\-listings[=true|false]\\f[R]\n*Deprecated, use \\f[CR]\\-\\-syntax\\-highlighting=idiomatic\\f[R] or\n\\f[CR]\\-\\-syntax\\-highlighting=default\\f[R] instead.\n.RS\n.PP\nUse the \\f[CR]listings\\f[R] package for LaTeX code blocks.\nThe package does not support multi\\-byte encoding for source code.\nTo handle UTF\\-8 you would need to use a custom template.\nThis issue is fully documented here: Encoding issue with the listings\npackage.\n.RE\n.TP\n\\f[CR]\\-i\\f[R], \\f[CR]\\-\\-incremental[=true|false]\\f[R]\nMake list items in slide shows display incrementally (one by one).\nThe default is for lists to be displayed all at once.\n.TP\n\\f[CR]\\-\\-slide\\-level=\\f[R]\\f[I]NUMBER\\f[R]\nSpecifies that headings with the specified level create slides (for\n\\f[CR]beamer\\f[R], \\f[CR]revealjs\\f[R], \\f[CR]pptx\\f[R], \\f[CR]s5\\f[R],\n\\f[CR]slidy\\f[R], \\f[CR]slideous\\f[R], \\f[CR]dzslides\\f[R]).\nHeadings above this level in the hierarchy are used to divide the slide\nshow into sections; headings below this level create subheads within a\nslide.\nValid values are 0\\-6.\nIf a slide level of 0 is specified, slides will not be split\nautomatically on headings, and horizontal rules must be used to indicate\nslide boundaries.\nIf a slide level is not specified explicitly, the slide level will be\nset automatically based on the contents of the document; see Structuring\nthe slide show.\n.TP\n\\f[CR]\\-\\-section\\-divs[=true|false]\\f[R]\nWrap sections in \\f[CR]<section>\\f[R] tags (or \\f[CR]<div>\\f[R] tags for\n\\f[CR]html4\\f[R]), and attach identifiers to the enclosing\n\\f[CR]<section>\\f[R] (or \\f[CR]<div>\\f[R]) rather than the heading\nitself (see Heading identifiers, below).\nThis option only affects HTML output (and does not affect HTML slide\nformats).\n.TP\n\\f[CR]\\-\\-email\\-obfuscation=none\\f[R]|\\f[CR]javascript\\f[R]|\\f[CR]references\\f[R]\nSpecify a method for obfuscating \\f[CR]mailto:\\f[R] links in HTML\ndocuments.\n\\f[CR]none\\f[R] leaves \\f[CR]mailto:\\f[R] links as they are.\n\\f[CR]javascript\\f[R] obfuscates them using JavaScript.\n\\f[CR]references\\f[R] obfuscates them by printing their letters as\ndecimal or hexadecimal character references.\nThe default is \\f[CR]none\\f[R].\n.TP\n\\f[CR]\\-\\-id\\-prefix=\\f[R]\\f[I]STRING\\f[R]\nSpecify a prefix to be added to all identifiers and internal links in\nHTML and DocBook output, and to footnote numbers in Markdown and Haddock\noutput.\nThis is useful for preventing duplicate identifiers when generating\nfragments to be included in other pages.\n.TP\n\\f[CR]\\-T\\f[R] \\f[I]STRING\\f[R], \\f[CR]\\-\\-title\\-prefix=\\f[R]\\f[I]STRING\\f[R]\nSpecify \\f[I]STRING\\f[R] as a prefix at the beginning of the title that\nappears in the HTML header (but not in the title as it appears at the\nbeginning of the HTML body).\nImplies \\f[CR]\\-\\-standalone\\f[R].\n.TP\n\\f[CR]\\-c\\f[R] \\f[I]URL\\f[R], \\f[CR]\\-\\-css=\\f[R]\\f[I]URL\\f[R]\nLink to a CSS style sheet.\nThis option can be used repeatedly to include multiple files.\nThey will be included in the order specified.\nThis option only affects HTML (including HTML slide shows) and EPUB\noutput.\nIt should be used together with \\f[CR]\\-s/\\-\\-standalone\\f[R], because\nthe link to the stylesheet goes in the document header.\n.RS\n.PP\nA stylesheet is required for generating EPUB.\nIf none is provided using this option (or the \\f[CR]css\\f[R] or\n\\f[CR]stylesheet\\f[R] metadata fields), pandoc will look for a file\n\\f[CR]epub.css\\f[R] in the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R]).\nIf it is not found there, sensible defaults will be used.\n.RE\n.TP\n\\f[CR]\\-\\-reference\\-doc=\\f[R]\\f[I]FILE\\f[R]|\\f[I]URL\\f[R]\nUse the specified file as a style reference in producing a docx or ODT\nfile.\n.RS\n.TP\nDocx\nFor best results, the reference docx should be a modified version of a\ndocx file produced using pandoc.\nThe contents of the reference docx are ignored, but its stylesheets and\ndocument properties (including margins, page size, header, and footer)\nare used in the new docx.\nIf no reference docx is specified on the command line, pandoc will look\nfor a file \\f[CR]reference.docx\\f[R] in the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R]).\nIf this is not found either, sensible defaults will be used.\n.RS\n.PP\nTo produce a custom \\f[CR]reference.docx\\f[R], first get a copy of the\ndefault \\f[CR]reference.docx\\f[R]:\n\\f[CR]pandoc \\-o custom\\-reference.docx \\-\\-print\\-default\\-data\\-file reference.docx\\f[R].\nThen open \\f[CR]custom\\-reference.docx\\f[R] in Word, modify the styles\nas you wish, and save the file.\nFor best results, do not make changes to this file other than modifying\nthe styles used by pandoc:\n.PP\nParagraph styles:\n.IP \\(bu 2\nNormal\n.IP \\(bu 2\nBody Text\n.IP \\(bu 2\nFirst Paragraph\n.IP \\(bu 2\nCompact\n.IP \\(bu 2\nTitle\n.IP \\(bu 2\nSubtitle\n.IP \\(bu 2\nAuthor\n.IP \\(bu 2\nDate\n.IP \\(bu 2\nAbstract\n.IP \\(bu 2\nAbstractTitle\n.IP \\(bu 2\nBibliography\n.IP \\(bu 2\nHeading 1\n.IP \\(bu 2\nHeading 2\n.IP \\(bu 2\nHeading 3\n.IP \\(bu 2\nHeading 4\n.IP \\(bu 2\nHeading 5\n.IP \\(bu 2\nHeading 6\n.IP \\(bu 2\nHeading 7\n.IP \\(bu 2\nHeading 8\n.IP \\(bu 2\nHeading 9\n.IP \\(bu 2\nBlock Text [for block quotes]\n.IP \\(bu 2\nFootnote Block Text [for block quotes in footnotes]\n.IP \\(bu 2\nSource Code\n.IP \\(bu 2\nFootnote Text\n.IP \\(bu 2\nDefinition Term\n.IP \\(bu 2\nDefinition\n.IP \\(bu 2\nCaption\n.IP \\(bu 2\nTable Caption\n.IP \\(bu 2\nImage Caption\n.IP \\(bu 2\nFigure\n.IP \\(bu 2\nCaptioned Figure\n.IP \\(bu 2\nTOC Heading\n.PP\nCharacter styles:\n.IP \\(bu 2\nDefault Paragraph Font\n.IP \\(bu 2\nVerbatim Char\n.IP \\(bu 2\nFootnote Reference\n.IP \\(bu 2\nHyperlink\n.IP \\(bu 2\nSection Number\n.PP\nTable style:\n.IP \\(bu 2\nTable\n.RE\n.TP\nODT\nFor best results, the reference ODT should be a modified version of an\nODT produced using pandoc.\nThe contents of the reference ODT are ignored, but its stylesheets are\nused in the new ODT.\nIf no reference ODT is specified on the command line, pandoc will look\nfor a file \\f[CR]reference.odt\\f[R] in the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R]).\nIf this is not found either, sensible defaults will be used.\n.RS\n.PP\nTo produce a custom \\f[CR]reference.odt\\f[R], first get a copy of the\ndefault \\f[CR]reference.odt\\f[R]:\n\\f[CR]pandoc \\-o custom\\-reference.odt \\-\\-print\\-default\\-data\\-file reference.odt\\f[R].\nThen open \\f[CR]custom\\-reference.odt\\f[R] in LibreOffice, modify the\nstyles as you wish, and save the file.\n.RE\n.TP\nPowerPoint\nTemplates included with Microsoft PowerPoint 2013 (either with\n\\f[CR].pptx\\f[R] or \\f[CR].potx\\f[R] extension) are known to work, as\nare most templates derived from these.\n.RS\n.PP\nThe specific requirement is that the template should contain layouts\nwith the following names (as seen within PowerPoint):\n.IP \\(bu 2\nTitle Slide\n.IP \\(bu 2\nTitle and Content\n.IP \\(bu 2\nSection Header\n.IP \\(bu 2\nTwo Content\n.IP \\(bu 2\nComparison\n.IP \\(bu 2\nContent with Caption\n.IP \\(bu 2\nBlank\n.PP\nFor each name, the first layout found with that name will be used.\nIf no layout is found with one of the names, pandoc will output a\nwarning and use the layout with that name from the default reference doc\ninstead.\n(How these layouts are used is described in PowerPoint layout choice.)\n.PP\nAll templates included with a recent version of MS PowerPoint will fit\nthese criteria.\n(You can click on \\f[CR]Layout\\f[R] under the \\f[CR]Home\\f[R] menu to\ncheck.)\n.PP\nYou can also modify the default \\f[CR]reference.pptx\\f[R]: first run\n\\f[CR]pandoc \\-o custom\\-reference.pptx \\-\\-print\\-default\\-data\\-file reference.pptx\\f[R],\nand then modify \\f[CR]custom\\-reference.pptx\\f[R] in MS PowerPoint\n(pandoc will use the layouts with the names listed above).\n.RE\n.RE\n.TP\n\\f[CR]\\-\\-split\\-level=\\f[R]\\f[I]NUMBER\\f[R]\nSpecify the heading level at which to split an EPUB or chunked HTML\ndocument into separate files.\nThe default is to split into chapters at level\\-1 headings.\nIn the case of EPUB, this option only affects the internal composition\nof the EPUB, not the way chapters and sections are displayed to users.\nSome readers may be slow if the chapter files are too large, so for\nlarge documents with few level\\-1 headings, one might want to use a\nchapter level of 2 or 3.\nFor chunked HTML, this option determines how much content goes in each\n\\(lqchunk.\\(rq\n.TP\n\\f[CR]\\-\\-chunk\\-template=\\f[R]\\f[I]PATHTEMPLATE\\f[R]\nSpecify a template for the filenames in a \\f[CR]chunkedhtml\\f[R]\ndocument.\nIn the template, \\f[CR]%n\\f[R] will be replaced by the chunk number\n(padded with leading 0s to 3 digits), \\f[CR]%s\\f[R] with the section\nnumber of the chunk, \\f[CR]%h\\f[R] with the heading text (with\nformatting removed), \\f[CR]%i\\f[R] with the section identifier.\nFor example, \\f[CR]section\\-%s\\-%i.html\\f[R] might be resolved to\n\\f[CR]section\\-1.1\\-introduction.html\\f[R].\nThe characters \\f[CR]/\\f[R] and \\f[CR]\\(rs\\f[R] are not allowed in chunk\ntemplates and will be ignored.\nThe default is \\f[CR]%s\\-%i.html\\f[R].\n.TP\n\\f[CR]\\-\\-epub\\-chapter\\-level=\\f[R]\\f[I]NUMBER\\f[R]\n\\f[I]Deprecated synonym for \\f[CI]\\-\\-split\\-level\\f[I].\\f[R]\n.TP\n\\f[CR]\\-\\-epub\\-cover\\-image=\\f[R]\\f[I]FILE\\f[R]\nUse the specified image as the EPUB cover.\nIt is recommended that the image be less than 1000px in width and\nheight.\nNote that in a Markdown source document you can also specify\n\\f[CR]cover\\-image\\f[R] in a YAML metadata block (see EPUB Metadata,\nbelow).\n.TP\n\\f[CR]\\-\\-epub\\-title\\-page=true\\f[R]|\\f[CR]false\\f[R]\nDetermines whether a the title page is included in the EPUB (default is\n\\f[CR]true\\f[R]).\n.TP\n\\f[CR]\\-\\-epub\\-metadata=\\f[R]\\f[I]FILE\\f[R]\nLook in the specified XML file for metadata for the EPUB.\nThe file should contain a series of Dublin Core elements.\nFor example:\n.RS\n.IP\n.EX\n <dc:rights>Creative Commons</dc:rights>\n <dc:language>es\\-AR</dc:language>\n.EE\n.PP\nBy default, pandoc will include the following metadata elements:\n\\f[CR]<dc:title>\\f[R] (from the document title), \\f[CR]<dc:creator>\\f[R]\n(from the document authors), \\f[CR]<dc:date>\\f[R] (from the document\ndate, which should be in ISO 8601 format), \\f[CR]<dc:language>\\f[R]\n(from the \\f[CR]lang\\f[R] variable, or, if is not set, the locale), and\n\\f[CR]<dc:identifier id=\\(dqBookId\\(dq>\\f[R] (a randomly generated\nUUID).\nAny of these may be overridden by elements in the metadata file.\n.PP\nNote: if the source document is Markdown, a YAML metadata block in the\ndocument can be used instead.\nSee below under EPUB Metadata.\n.RE\n.TP\n\\f[CR]\\-\\-epub\\-embed\\-font=\\f[R]\\f[I]FILE\\f[R]\nEmbed the specified font in the EPUB.\nThis option can be repeated to embed multiple fonts.\nWildcards can also be used: for example, \\f[CR]DejaVuSans\\-*.ttf\\f[R].\nHowever, if you use wildcards on the command line, be sure to escape\nthem or put the whole filename in single quotes, to prevent them from\nbeing interpreted by the shell.\nTo use the embedded fonts, you will need to add declarations like the\nfollowing to your CSS (see \\f[CR]\\-\\-css\\f[R]):\n.RS\n.IP\n.EX\n\\(atfont\\-face {\n   font\\-family: DejaVuSans;\n   font\\-style: normal;\n   font\\-weight: normal;\n   src:url(\\(dq../fonts/DejaVuSans\\-Regular.ttf\\(dq);\n}\n\\(atfont\\-face {\n   font\\-family: DejaVuSans;\n   font\\-style: normal;\n   font\\-weight: bold;\n   src:url(\\(dq../fonts/DejaVuSans\\-Bold.ttf\\(dq);\n}\n\\(atfont\\-face {\n   font\\-family: DejaVuSans;\n   font\\-style: italic;\n   font\\-weight: normal;\n   src:url(\\(dq../fonts/DejaVuSans\\-Oblique.ttf\\(dq);\n}\n\\(atfont\\-face {\n   font\\-family: DejaVuSans;\n   font\\-style: italic;\n   font\\-weight: bold;\n   src:url(\\(dq../fonts/DejaVuSans\\-BoldOblique.ttf\\(dq);\n}\nbody { font\\-family: \\(dqDejaVuSans\\(dq; }\n.EE\n.RE\n.TP\n\\f[CR]\\-\\-epub\\-subdirectory=\\f[R]\\f[I]DIRNAME\\f[R]\nSpecify the subdirectory in the OCF container that is to hold the\nEPUB\\-specific contents.\nThe default is \\f[CR]EPUB\\f[R].\nTo put the EPUB contents in the top level, use an empty string.\n.TP\n\\f[CR]\\-\\-ipynb\\-output=all|none|best\\f[R]\nDetermines how ipynb output cells are treated.\n\\f[CR]all\\f[R] means that all of the data formats included in the\noriginal are preserved.\n\\f[CR]none\\f[R] means that the contents of data cells are omitted.\n\\f[CR]best\\f[R] causes pandoc to try to pick the richest data block in\neach output cell that is compatible with the output format.\nThe default is \\f[CR]best\\f[R].\n.TP\n\\f[CR]\\-\\-pdf\\-engine=\\f[R]\\f[I]PROGRAM\\f[R]\nUse the specified engine when producing PDF output.\nValid values are \\f[CR]pdflatex\\f[R], \\f[CR]lualatex\\f[R],\n\\f[CR]xelatex\\f[R], \\f[CR]latexmk\\f[R], \\f[CR]tectonic\\f[R],\n\\f[CR]wkhtmltopdf\\f[R], \\f[CR]weasyprint\\f[R], \\f[CR]pagedjs\\-cli\\f[R],\n\\f[CR]prince\\f[R], \\f[CR]context\\f[R], \\f[CR]groff\\f[R],\n\\f[CR]pdfroff\\f[R], and \\f[CR]typst\\f[R].\nIf the engine is not in your PATH, the full path of the engine may be\nspecified here.\nIf this option is not specified, pandoc uses the following defaults\ndepending on the output format specified using \\f[CR]\\-t/\\-\\-to\\f[R]:\n.RS\n.IP \\(bu 2\n\\f[CR]\\-t latex\\f[R] or none: \\f[CR]pdflatex\\f[R] (other options:\n\\f[CR]xelatex\\f[R], \\f[CR]lualatex\\f[R], \\f[CR]tectonic\\f[R],\n\\f[CR]latexmk\\f[R])\n.IP \\(bu 2\n\\f[CR]\\-t context\\f[R]: \\f[CR]context\\f[R]\n.IP \\(bu 2\n\\f[CR]\\-t html\\f[R]: \\f[CR]weasyprint\\f[R] (other options:\n\\f[CR]prince\\f[R], \\f[CR]wkhtmltopdf\\f[R], \\f[CR]pagedjs\\-cli\\f[R]; see\nprint\\-css.rocks for a good introduction to PDF generation from\nHTML/CSS)\n.IP \\(bu 2\n\\f[CR]\\-t ms\\f[R]: \\f[CR]pdfroff\\f[R]\n.IP \\(bu 2\n\\f[CR]\\-t typst\\f[R]: \\f[CR]typst\\f[R]\n.PP\nThis option is normally intended to be used when a PDF file is specified\nas \\f[CR]\\-o/\\-\\-output\\f[R].\nHowever, it may still have an effect when other output formats are\nrequested.\nFor example, \\f[CR]ms\\f[R] output will include \\f[CR].pdfhref\\f[R]\nmacros only if a \\f[CR]\\-\\-pdf\\-engine\\f[R] is selected, and the macros\nwill be differently encoded depending on whether \\f[CR]groff\\f[R] or\n\\f[CR]pdfroff\\f[R] is specified.\n.RE\n.TP\n\\f[CR]\\-\\-pdf\\-engine\\-opt=\\f[R]\\f[I]STRING\\f[R]\nUse the given string as a command\\-line argument to the\n\\f[CR]pdf\\-engine\\f[R].\nFor example, to use a persistent directory \\f[CR]foo\\f[R] for\n\\f[CR]latexmk\\f[R]\\(cqs auxiliary files, use\n\\f[CR]\\-\\-pdf\\-engine\\-opt=\\-outdir=foo\\f[R].\nNote that no check for duplicate options is done.\n.SS Citation rendering\n.TP\n\\f[CR]\\-C\\f[R], \\f[CR]\\-\\-citeproc\\f[R]\nProcess the citations in the file, replacing them with rendered\ncitations and adding a bibliography.\nCitation processing will not take place unless bibliographic data is\nsupplied, either through an external file specified using the\n\\f[CR]\\-\\-bibliography\\f[R] option or the \\f[CR]bibliography\\f[R] field\nin metadata, or via a \\f[CR]references\\f[R] section in metadata\ncontaining a list of citations in CSL YAML format with Markdown\nformatting.\nThe style is controlled by a CSL stylesheet specified using the\n\\f[CR]\\-\\-csl\\f[R] option or the \\f[CR]csl\\f[R] field in metadata.\n(If no stylesheet is specified, the \\f[CR]chicago\\-author\\-date\\f[R]\nstyle will be used by default.)\nThe citation processing transformation may be applied before or after\nfilters or Lua filters (see \\f[CR]\\-\\-filter\\f[R],\n\\f[CR]\\-\\-lua\\-filter\\f[R]): these transformations are applied in the\norder they appear on the command line.\nFor more information, see the section on Citations.\n.RS\n.PP\nNote: if this option is specified, the \\f[CR]citations\\f[R] extension\nwill be disabled automatically in the writer, to ensure that the\nciteproc\\-generated citations will be rendered instead of the\nformat\\(cqs own citation syntax.\n.RE\n.TP\n\\f[CR]\\-\\-bibliography=\\f[R]\\f[I]FILE\\f[R]\nSet the \\f[CR]bibliography\\f[R] field in the document\\(cqs metadata to\n\\f[I]FILE\\f[R], overriding any value set in the metadata.\nIf you supply this argument multiple times, each \\f[I]FILE\\f[R] will be\nadded to bibliography.\nIf \\f[I]FILE\\f[R] is a URL, it will be fetched via HTTP.\nIf \\f[I]FILE\\f[R] is not found relative to the working directory, it\nwill be sought in the resource path (see \\f[CR]\\-\\-resource\\-path\\f[R]).\n.TP\n\\f[CR]\\-\\-csl=\\f[R]\\f[I]FILE\\f[R]\nSet the \\f[CR]csl\\f[R] field in the document\\(cqs metadata to\n\\f[I]FILE\\f[R], overriding any value set in the metadata.\n(This is equivalent to \\f[CR]\\-\\-metadata csl=FILE\\f[R].)\nIf \\f[I]FILE\\f[R] is a URL, it will be fetched via HTTP.\nIf \\f[I]FILE\\f[R] is not found relative to the working directory, it\nwill be sought in the resource path (see \\f[CR]\\-\\-resource\\-path\\f[R])\nand finally in the \\f[CR]csl\\f[R] subdirectory of the pandoc user data\ndirectory.\n.TP\n\\f[CR]\\-\\-citation\\-abbreviations=\\f[R]\\f[I]FILE\\f[R]\nSet the \\f[CR]citation\\-abbreviations\\f[R] field in the document\\(cqs\nmetadata to \\f[I]FILE\\f[R], overriding any value set in the metadata.\n(This is equivalent to\n\\f[CR]\\-\\-metadata citation\\-abbreviations=FILE\\f[R].)\nIf \\f[I]FILE\\f[R] is a URL, it will be fetched via HTTP.\nIf \\f[I]FILE\\f[R] is not found relative to the working directory, it\nwill be sought in the resource path (see \\f[CR]\\-\\-resource\\-path\\f[R])\nand finally in the \\f[CR]csl\\f[R] subdirectory of the pandoc user data\ndirectory.\n.TP\n\\f[CR]\\-\\-natbib\\f[R]\nUse \\f[CR]natbib\\f[R] for citations in LaTeX output.\nThis option is not for use with the \\f[CR]\\-\\-citeproc\\f[R] option or\nwith PDF output.\nIt is intended for use in producing a LaTeX file that can be processed\nwith \\f[CR]bibtex\\f[R].\n.TP\n\\f[CR]\\-\\-biblatex\\f[R]\nUse \\f[CR]biblatex\\f[R] for citations in LaTeX output.\nThis option is not for use with the \\f[CR]\\-\\-citeproc\\f[R] option or\nwith PDF output.\nIt is intended for use in producing a LaTeX file that can be processed\nwith \\f[CR]bibtex\\f[R] or \\f[CR]biber\\f[R].\n.SS Math rendering in HTML\nThe default is to render TeX math as far as possible using Unicode\ncharacters.\nFormulas are put inside a \\f[CR]span\\f[R] with\n\\f[CR]class=\\(dqmath\\(dq\\f[R], so that they may be styled differently\nfrom the surrounding text if needed.\nHowever, this gives acceptable results only for basic math, usually you\nwill want to use \\f[CR]\\-\\-mathjax\\f[R] or another of the following\noptions.\n.TP\n\\f[CR]\\-\\-mathjax\\f[R][\\f[CR]=\\f[R]\\f[I]URL\\f[R]]\nUse MathJax to display embedded TeX math in HTML output.\nTeX math will be put between \\f[CR]\\(rs(...\\(rs)\\f[R] (for inline math)\nor \\f[CR]\\(rs[...\\(rs]\\f[R] (for display math) and wrapped in\n\\f[CR]<span>\\f[R] tags with class \\f[CR]math\\f[R].\nThen the MathJax JavaScript will render it.\nThe \\f[I]URL\\f[R] should point to the \\f[CR]MathJax.js\\f[R] load script.\nIf a \\f[I]URL\\f[R] is not provided, a link to the Cloudflare CDN will be\ninserted.\n.TP\n\\f[CR]\\-\\-mathml\\f[R]\nConvert TeX math to MathML (in \\f[CR]epub3\\f[R], \\f[CR]docbook4\\f[R],\n\\f[CR]docbook5\\f[R], \\f[CR]jats\\f[R], \\f[CR]html4\\f[R] and\n\\f[CR]html5\\f[R]).\nThis is the default in \\f[CR]odt\\f[R] output.\nMathML is supported natively by the main web browsers and select e\\-book\nreaders.\n.TP\n\\f[CR]\\-\\-webtex\\f[R][\\f[CR]=\\f[R]\\f[I]URL\\f[R]]\nConvert TeX formulas to \\f[CR]<img>\\f[R] tags that link to an external\nscript that converts formulas to images.\nThe formula will be URL\\-encoded and concatenated with the URL provided.\nFor SVG images you can for example use\n\\f[CR]\\-\\-webtex https://latex.codecogs.com/svg.latex?\\f[R].\nIf no URL is specified, the CodeCogs URL generating PNGs will be used\n(\\f[CR]https://latex.codecogs.com/png.latex?\\f[R]).\nNote: the \\f[CR]\\-\\-webtex\\f[R] option will affect Markdown output as\nwell as HTML, which is useful if you\\(cqre targeting a version of\nMarkdown without native math support.\n.TP\n\\f[CR]\\-\\-katex\\f[R][\\f[CR]=\\f[R]\\f[I]URL\\f[R]]\nUse KaTeX to display embedded TeX math in HTML output.\nThe \\f[I]URL\\f[R] is the base URL for the KaTeX library.\nThat directory should contain a \\f[CR]katex.min.js\\f[R] and a\n\\f[CR]katex.min.css\\f[R] file.\nIf a \\f[I]URL\\f[R] is not provided, a link to the KaTeX CDN will be\ninserted.\n.TP\n\\f[CR]\\-\\-gladtex\\f[R]\nEnclose TeX math in \\f[CR]<eq>\\f[R] tags in HTML output.\nThe resulting HTML can then be processed by GladTeX to produce SVG\nimages of the typeset formulas and an HTML file with these images\nembedded.\n.RS\n.IP\n.EX\npandoc \\-s \\-\\-gladtex input.md \\-o myfile.htex\ngladtex \\-d image_dir myfile.htex\n# produces myfile.html and images in image_dir\n.EE\n.RE\n.SS Options for wrapper scripts\n.TP\n\\f[CR]\\-\\-dump\\-args[=true|false]\\f[R]\nPrint information about command\\-line arguments to \\f[I]stdout\\f[R],\nthen exit.\nThis option is intended primarily for use in wrapper scripts.\nThe first line of output contains the name of the output file specified\nwith the \\f[CR]\\-o\\f[R] option, or \\f[CR]\\-\\f[R] (for \\f[I]stdout\\f[R])\nif no output file was specified.\nThe remaining lines contain the command\\-line arguments, one per line,\nin the order they appear.\nThese do not include regular pandoc options and their arguments, but do\ninclude any options appearing after a \\f[CR]\\-\\-\\f[R] separator at the\nend of the line.\n.TP\n\\f[CR]\\-\\-ignore\\-args[=true|false]\\f[R]\nIgnore command\\-line arguments (for use in wrapper scripts).\nRegular pandoc options are not ignored.\nThus, for example,\n.RS\n.IP\n.EX\npandoc \\-\\-ignore\\-args \\-o foo.html \\-s foo.txt \\-\\- \\-e latin1\n.EE\n.PP\nis equivalent to\n.IP\n.EX\npandoc \\-o foo.html \\-s\n.EE\n.RE\n.SH EXIT CODES\nIf pandoc completes successfully, it will return exit code 0.\nNonzero exit codes have the following meanings:\n.RS -14n\n.IP\n.EX\n    Code Error\n  \\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n       1 PandocIOError\n       3 PandocFailOnWarningError\n       4 PandocAppError\n       5 PandocTemplateError\n       6 PandocOptionError\n      21 PandocUnknownReaderError\n      22 PandocUnknownWriterError\n      23 PandocUnsupportedExtensionError\n      24 PandocCiteprocError\n      25 PandocBibliographyError\n      31 PandocEpubSubdirectoryError\n      43 PandocPDFError\n      44 PandocXMLError\n      47 PandocPDFProgramNotFoundError\n      61 PandocHttpError\n      62 PandocShouldNeverHappenError\n      63 PandocSomeError\n      64 PandocParseError\n      66 PandocMakePDFError\n      67 PandocSyntaxMapError\n      83 PandocFilterError\n      84 PandocLuaError\n      89 PandocNoScriptingEngine\n      91 PandocMacroLoop\n      92 PandocUTF8DecodingError\n      93 PandocIpynbDecodingError\n      94 PandocUnsupportedCharsetError\n      95 PandocInputNotTextError\n      97 PandocCouldNotFindDataFileError\n      98 PandocCouldNotFindMetadataFileError\n      99 PandocResourceNotFound\n.EE\n.RE\n.SH DEFAULTS FILES\nThe \\f[CR]\\-\\-defaults\\f[R] option may be used to specify a package of\noptions, in the form of a YAML or JSON file.\nExamples in this section will be given in YAML, but the equivalent forms\nin JSON will also work.\n.PP\nFields that are omitted will just have their regular default values.\nSo a defaults file can be as simple as one line:\n.IP\n.EX\nverbosity\\f[B]:\\f[R] INFO\n.EE\n.PP\nor in JSON:\n.IP\n.EX\n{ \\(dqverbosity\\(dq: \\(dqINFO\\(dq }\n.EE\n.PP\nIn fields that expect a file path (or list of file paths), the following\nsyntax may be used to interpolate environment variables:\n.IP\n.EX\ncsl\\f[B]:\\f[R]  ${HOME}/mycsldir/special.csl\n.EE\n.PP\n\\f[CR]${USERDATA}\\f[R] may also be used; this will always resolve to the\nuser data directory that is current when the defaults file is parsed,\nregardless of the setting of the environment variable\n\\f[CR]USERDATA\\f[R].\n.PP\n\\f[CR]${.}\\f[R] will resolve to the directory containing the defaults\nfile itself.\nThis allows you to refer to resources contained in that directory:\n.IP\n.EX\nepub\\-cover\\-image\\f[B]:\\f[R] ${.}/cover.jpg\nepub\\-metadata\\f[B]:\\f[R] ${.}/meta.xml\nresource\\-path\\f[B]:\\f[R]\n\\f[B]\\-\\f[R] .\\f[I]             # the working directory from which pandoc is run\\f[R]\n\\f[B]\\-\\f[R] ${.}/images\\f[I]   # the images subdirectory of the directory\\f[R]\n\\f[I]                # containing this defaults file\\f[R]\n.EE\n.PP\nThis environment variable interpolation syntax \\f[I]only\\f[R] works in\nfields that expect file paths.\n.PP\nDefaults files can be placed in the \\f[CR]defaults\\f[R] subdirectory of\nthe user data directory and used from any directory.\nFor example, one could create a file specifying defaults for writing\nletters, save it as \\f[CR]letter.yaml\\f[R] in the \\f[CR]defaults\\f[R]\nsubdirectory of the user data directory, and then invoke these defaults\nfrom any directory using \\f[CR]pandoc \\-\\-defaults letter\\f[R] or\n\\f[CR]pandoc \\-dletter\\f[R].\n.PP\nWhen multiple defaults are used, their contents will be combined.\n.PP\nNote that, where command\\-line arguments may be repeated\n(\\f[CR]\\-\\-metadata\\-file\\f[R], \\f[CR]\\-\\-css\\f[R],\n\\f[CR]\\-\\-include\\-in\\-header\\f[R],\n\\f[CR]\\-\\-include\\-before\\-body\\f[R],\n\\f[CR]\\-\\-include\\-after\\-body\\f[R], \\f[CR]\\-\\-variable\\f[R],\n\\f[CR]\\-\\-metadata\\f[R], \\f[CR]\\-\\-syntax\\-definition\\f[R]), the values\nspecified on the command line will combine with values specified in the\ndefaults file, rather than replacing them.\n.PP\nThe following tables show the mapping between the command line and\ndefaults file entries.\n.RS -14n\n.IP\n.EX\n\n command line                      defaults file                     \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n foo.md                            input\\-file: foo.md            \n\n foo.md bar.md                     input\\-files:                  \n                                     \\- foo.md                    \n                                     \\- bar.md                    \n\n.EE\n.RE\n.PP\nThe value of \\f[CR]input\\-files\\f[R] may be left empty to indicate input\nfrom stdin, and it can be an empty sequence \\f[CR][]\\f[R] for no input.\n.SS General options\n.RS -14n\n.IP\n.EX\n\n command line                        defaults file                         \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-from markdown+emoji               from: markdown+emoji              \n                                                                       \n                                     reader: markdown+emoji            \n\n \\-\\-to markdown+hard_line_breaks      to: markdown+hard_line_breaks     \n                                                                       \n                                     writer: markdown+hard_line_breaks \n\n \\-\\-output foo.pdf                    output\\-file: foo.pdf              \n\n \\-\\-output \\-                          output\\-file:                      \n\n \\-\\-data\\-dir dir                      data\\-dir: dir                     \n\n \\-\\-defaults file                     defaults:                         \n                                     \\- file                            \n\n \\-\\-verbose                           verbosity: INFO                   \n\n \\-\\-quiet                             verbosity: ERROR                  \n\n \\-\\-fail\\-if\\-warnings                  fail\\-if\\-warnings: true            \n\n \\-\\-sandbox                           sandbox: true                     \n\n \\-\\-log=FILE                          log\\-file: FILE                    \n\n.EE\n.RE\n.PP\nOptions specified in a defaults file itself always have priority over\nthose in another file included with a \\f[CR]defaults:\\f[R] entry.\n.PP\n\\f[CR]verbosity\\f[R] can have the values \\f[CR]ERROR\\f[R],\n\\f[CR]WARNING\\f[R], or \\f[CR]INFO\\f[R].\n.SS Reader options\n.RS -14n\n.IP\n.EX\n\n command line                          defaults file                       \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-shift\\-heading\\-level\\-by \\-1           shift\\-heading\\-level\\-by: \\-1      \n\n \\-\\-indented\\-code\\-classes python        indented\\-code\\-classes:          \n                                         \\- python                      \n\n \\-\\-default\\-image\\-extension \\(dq.jpg\\(dq      default\\-image\\-extension: \\(aq.jpg\\(aq \n\n \\-\\-file\\-scope                          file\\-scope: true                \n\n \\-\\-citeproc \\(rs                          filters:                        \n  \\-\\-lua\\-filter count\\-words.lua \\(rs         \\- citeproc                    \n  \\-\\-filter special.lua                   \\- count\\-words.lua             \n                                         \\- type: json                  \n                                           path: special.lua           \n\n \\-\\-metadata key=value \\(rs                metadata:                       \n  \\-\\-metadata key2                        key: value                    \n                                         key2: true                    \n\n \\-\\-metadata\\-file meta.yaml             metadata\\-files:                 \n                                         \\- meta.yaml                   \n                                                                       \n                                       metadata\\-file: meta.yaml        \n\n \\-\\-preserve\\-tabs                       preserve\\-tabs: true             \n\n \\-\\-tab\\-stop 8                          tab\\-stop: 8                     \n\n \\-\\-track\\-changes accept                track\\-changes: accept           \n\n \\-\\-extract\\-media dir                   extract\\-media: dir              \n\n \\-\\-abbreviations abbrevs.txt           abbreviations: abbrevs.txt      \n\n \\-\\-trace                               trace: true                     \n\n.EE\n.RE\n.PP\nMetadata values specified in a defaults file are parsed as literal\nstring text, not Markdown.\n.PP\nFilters will be assumed to be Lua filters if they have the\n\\f[CR].lua\\f[R] extension, and JSON filters otherwise.\nBut the filter type can also be specified explicitly, as shown.\nFilters are run in the order specified.\nTo include the built\\-in citeproc filter, use either \\f[CR]citeproc\\f[R]\nor \\f[CR]{type: citeproc}\\f[R].\n.SS General writer options\n.RS -14n\n.IP\n.EX\n\n command line                        defaults file                         \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-standalone                        standalone: true                  \n\n \\-\\-template letter                   template: letter                  \n\n \\-\\-variable key=val \\(rs                variables:                        \n   \\-\\-variable key2                     key: val                        \n                                       key2: true                      \n\n \\-\\-eol nl                            eol: nl                           \n\n \\-\\-dpi 300                           dpi: 300                          \n\n \\-\\-wrap preserve                     wrap: \\(dqpreserve\\(dq                  \n\n \\-\\-columns 72                        columns: 72                       \n\n \\-\\-table\\-of\\-contents                 table\\-of\\-contents: true           \n\n \\-\\-toc                               toc: true                         \n\n \\-\\-toc\\-depth 3                       toc\\-depth: 3                      \n\n \\-\\-strip\\-comments                    strip\\-comments: true              \n\n \\-\\-no\\-highlight                      syntax\\-highlighting: \\(aqnone\\(aq       \n\n \\-\\-syntax\\-highlighting kate          syntax\\-highlighting: kate         \n\n \\-\\-syntax\\-definition mylang.xml      syntax\\-definitions:               \n                                       \\- mylang.xml                    \n                                                                       \n                                     syntax\\-definition: mylang.xml     \n\n \\-\\-include\\-in\\-header inc.tex         include\\-in\\-header:                \n                                       \\- inc.tex                       \n\n \\-\\-include\\-before\\-body inc.tex       include\\-before\\-body:              \n                                       \\- inc.tex                       \n\n \\-\\-include\\-after\\-body inc.tex        include\\-after\\-body:               \n                                       \\- inc.tex                       \n\n \\-\\-resource\\-path .:foo               resource\\-path: [\\(aq.\\(aq,\\(aqfoo\\(aq]        \n\n \\-\\-request\\-header foo:bar            request\\-headers:                  \n                                       \\- [\\(dqUser\\-Agent\\(dq, \\(dqMozilla/5.0\\(dq] \n\n \\-\\-no\\-check\\-certificate              no\\-check\\-certificate: true        \n\n.EE\n.RE\n.SS Options affecting specific writers\n.RS -14n\n.IP\n.EX\n\n command line                          defaults file                       \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-self\\-contained                      self\\-contained: true            \n\n \\-\\-link\\-images                         link\\-images: true               \n\n \\-\\-html\\-q\\-tags                         html\\-q\\-tags: true               \n\n \\-\\-ascii                               ascii: true                     \n\n \\-\\-reference\\-links                     reference\\-links: true           \n\n \\-\\-reference\\-location block            reference\\-location: block       \n\n \\-\\-figure\\-caption\\-position=above       figure\\-caption\\-position: above  \n\n \\-\\-table\\-caption\\-position=below        table\\-caption\\-position: below   \n\n \\-\\-markdown\\-headings atx               markdown\\-headings: atx          \n\n \\-\\-list\\-tables                         list\\-tables: true               \n\n \\-\\-top\\-level\\-division chapter          top\\-level\\-division: chapter     \n\n \\-\\-number\\-sections                     number\\-sections: true           \n\n \\-\\-number\\-offset=1,4                   number\\-offset: \\(rs[1,4\\(rs]          \n\n \\-\\-listings                            listings: true                  \n\n \\-\\-list\\-of\\-figures                     list\\-of\\-figures: true           \n\n \\-\\-lof                                 lof: true                       \n\n \\-\\-list\\-of\\-tables                      list\\-of\\-tables: true            \n\n \\-\\-lot                                 lot: true                       \n\n \\-\\-incremental                         incremental: true               \n\n \\-\\-slide\\-level 2                       slide\\-level: 2                  \n\n \\-\\-section\\-divs                        section\\-divs: true              \n\n \\-\\-email\\-obfuscation references        email\\-obfuscation: references   \n\n \\-\\-id\\-prefix ch1                       identifier\\-prefix: ch1          \n\n \\-\\-title\\-prefix MySite                 title\\-prefix: MySite            \n\n \\-\\-css styles/screen.css  \\(rs            css:                            \n   \\-\\-css styles/special.css              \\- styles/screen.css           \n                                         \\- styles/special.css          \n\n \\-\\-reference\\-doc my.docx               reference\\-doc: my.docx          \n\n \\-\\-epub\\-cover\\-image cover.jpg          epub\\-cover\\-image: cover.jpg     \n\n \\-\\-epub\\-title\\-page=false               epub\\-title\\-page: false          \n\n \\-\\-epub\\-metadata meta.xml              epub\\-metadata: meta.xml         \n\n \\-\\-epub\\-embed\\-font special.otf \\(rs       epub\\-fonts:                     \n   \\-\\-epub\\-embed\\-font headline.otf        \\- special.otf                 \n                                         \\- headline.otf                \n\n \\-\\-split\\-level 2                       split\\-level: 2                  \n\n \\-\\-chunk\\-template=\\(dq%i.html\\(dq            chunk\\-template: \\(dq%i.html\\(dq       \n\n \\-\\-epub\\-subdirectory=\\(dq\\(dq                epub\\-subdirectory: \\(aq\\(aq           \n\n \\-\\-ipynb\\-output best                   ipynb\\-output: best              \n\n \\-\\-pdf\\-engine xelatex                  pdf\\-engine: xelatex             \n\n \\-\\-pdf\\-engine\\-opt=\\-\\-shell\\-escape       pdf\\-engine\\-opts:                \n                                         \\- \\(aq\\-shell\\-escape\\(aq             \n                                                                       \n                                       pdf\\-engine\\-opt: \\(aq\\-shell\\-escape\\(aq \n\n.EE\n.RE\n.SS Citation rendering\n.RS -14n\n.IP\n.EX\n\n command line                          defaults file                       \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-citeproc                            citeproc: true                  \n\n \\-\\-bibliography logic.bib              bibliography: logic.bib         \n\n \\-\\-csl ieee.csl                        csl: ieee.csl                   \n\n \\-\\-citation\\-abbreviations ab.json      citation\\-abbreviations: ab.json \n\n \\-\\-natbib                              cite\\-method: natbib             \n\n \\-\\-biblatex                            cite\\-method: biblatex           \n\n.EE\n.RE\n.PP\n\\f[CR]cite\\-method\\f[R] can be \\f[CR]citeproc\\f[R], \\f[CR]natbib\\f[R],\nor \\f[CR]biblatex\\f[R].\nThis only affects LaTeX output.\nIf you want to use citeproc to format citations, you should also set\n`citeproc: true'.\n.PP\nIf you need control over when the citeproc processing is done relative\nto other filters, you should instead use \\f[CR]citeproc\\f[R] in the list\nof \\f[CR]filters\\f[R] (see Reader options).\n.SS Math rendering in HTML\n.RS -14n\n.IP\n.EX\n\n command line                      defaults file                     \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-mathjax                         html\\-math\\-method:             \n                                     method: mathjax             \n\n \\-\\-mathml                          html\\-math\\-method:             \n                                     method: mathml              \n\n \\-\\-webtex                          html\\-math\\-method:             \n                                     method: webtex              \n\n \\-\\-katex                           html\\-math\\-method:             \n                                     method: katex               \n\n \\-\\-gladtex                         html\\-math\\-method:             \n                                     method: gladtex             \n\n.EE\n.RE\n.PP\nIn addition to the values listed above, \\f[CR]method\\f[R] can have the\nvalue \\f[CR]plain\\f[R].\n.PP\nIf the command line option accepts a URL argument, an \\f[CR]url:\\f[R]\nfield can be added to \\f[CR]html\\-math\\-method:\\f[R].\n.SS Options for wrapper scripts\n.RS -14n\n.IP\n.EX\n\n command line                      defaults file                     \n \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n \\-\\-dump\\-args                       dump\\-args: true               \n\n \\-\\-ignore\\-args                     ignore\\-args: true             \n\n.EE\n.RE\n.SH TEMPLATES\nWhen the \\f[CR]\\-s/\\-\\-standalone\\f[R] option is used, pandoc uses a\ntemplate to add header and footer material that is needed for a\nself\\-standing document.\nTo see the default template that is used, just type\n.IP\n.EX\npandoc \\-D *FORMAT*\n.EE\n.PP\nwhere \\f[I]FORMAT\\f[R] is the name of the output format.\nA custom template can be specified using the \\f[CR]\\-\\-template\\f[R]\noption.\nYou can also override the system default templates for a given output\nformat \\f[I]FORMAT\\f[R] by putting a file\n\\f[CR]templates/default.*FORMAT*\\f[R] in the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R], above).\n\\f[I]Exceptions:\\f[R]\n.IP \\(bu 2\nFor \\f[CR]odt\\f[R] output, customize the \\f[CR]default.opendocument\\f[R]\ntemplate.\n.IP \\(bu 2\nFor \\f[CR]docx\\f[R] output, customize the \\f[CR]default.openxml\\f[R]\ntemplate.\n.IP \\(bu 2\nFor \\f[CR]pdf\\f[R] output, customize the \\f[CR]default.latex\\f[R]\ntemplate (or the \\f[CR]default.context\\f[R] template, if you use\n\\f[CR]\\-t context\\f[R], or the \\f[CR]default.ms\\f[R] template, if you\nuse \\f[CR]\\-t ms\\f[R], or the \\f[CR]default.html\\f[R] template, if you\nuse \\f[CR]\\-t html\\f[R]).\n.IP \\(bu 2\n\\f[CR]pptx\\f[R] has no template.\n.PP\nNote that \\f[CR]docx\\f[R], \\f[CR]odt\\f[R], and \\f[CR]pptx\\f[R] output\ncan also be customized using \\f[CR]\\-\\-reference\\-doc\\f[R].\nUse a reference doc to adjust the styles in your document; use a\ntemplate to handle variable interpolation and customize the presentation\nof metadata, the position of the table of contents, boilerplate text,\netc.\n.PP\nTemplates contain \\f[I]variables\\f[R], which allow for the inclusion of\narbitrary information at any point in the file.\nThey may be set at the command line using the\n\\f[CR]\\-V/\\-\\-variable\\f[R] option.\nIf a variable is not set, pandoc will look for the key in the\ndocument\\(cqs metadata, which can be set using either YAML metadata\nblocks or with the \\f[CR]\\-M/\\-\\-metadata\\f[R] option.\nIn addition, some variables are given default values by pandoc.\nSee Variables below for a list of variables used in pandoc\\(cqs default\ntemplates.\n.PP\nIf you use custom templates, you may need to revise them as pandoc\nchanges.\nWe recommend tracking the changes in the default templates, and\nmodifying your custom templates accordingly.\nAn easy way to do this is to fork the pandoc\\-templates repository and\nmerge in changes after each pandoc release.\n.SS Template syntax\n.SS Comments\nAnything between the sequence \\f[CR]$\\-\\-\\f[R] and the end of the line\nwill be treated as a comment and omitted from the output.\n.SS Delimiters\nTo mark variables and control structures in the template, either\n\\f[CR]$\\f[R]\\&...\\f[CR]$\\f[R] or \\f[CR]${\\f[R]\\&...\\f[CR]}\\f[R] may be\nused as delimiters.\nThe styles may also be mixed in the same template, but the opening and\nclosing delimiter must match in each case.\nThe opening delimiter may be followed by one or more spaces or tabs,\nwhich will be ignored.\nThe closing delimiter may be preceded by one or more spaces or tabs,\nwhich will be ignored.\n.PP\nTo include a literal \\f[CR]$\\f[R] in the document, use \\f[CR]$$\\f[R].\n.SS Interpolated variables\nA slot for an interpolated variable is a variable name surrounded by\nmatched delimiters.\nVariable names must begin with a letter and can contain letters,\nnumbers, \\f[CR]_\\f[R], \\f[CR]\\-\\f[R], and \\f[CR].\\f[R].\nThe keywords \\f[CR]it\\f[R], \\f[CR]if\\f[R], \\f[CR]else\\f[R],\n\\f[CR]endif\\f[R], \\f[CR]for\\f[R], \\f[CR]sep\\f[R], and \\f[CR]endfor\\f[R]\nmay not be used as variable names.\nExamples:\n.IP\n.EX\n$foo$\n$foo.bar.baz$\n$foo_bar.baz\\-bim$\n$ foo $\n${foo}\n${foo.bar.baz}\n${foo_bar.baz\\-bim}\n${ foo }\n.EE\n.PP\nVariable names with periods are used to get at structured variable\nvalues.\nSo, for example, \\f[CR]employee.salary\\f[R] will return the value of the\n\\f[CR]salary\\f[R] field of the object that is the value of the\n\\f[CR]employee\\f[R] field.\n.IP \\(bu 2\nIf the value of the variable is a simple value, it will be rendered\nverbatim.\n(Note that no escaping is done; the assumption is that the calling\nprogram will escape the strings appropriately for the output format.)\n.IP \\(bu 2\nIf the value is a list, the values will be concatenated.\n.IP \\(bu 2\nIf the value is a map, the string \\f[CR]true\\f[R] will be rendered.\n.IP \\(bu 2\nEvery other value will be rendered as the empty string.\n.SS Conditionals\nA conditional begins with \\f[CR]if(variable)\\f[R] (enclosed in matched\ndelimiters) and ends with \\f[CR]endif\\f[R] (enclosed in matched\ndelimiters).\nIt may optionally contain an \\f[CR]else\\f[R] (enclosed in matched\ndelimiters).\nThe \\f[CR]if\\f[R] section is used if \\f[CR]variable\\f[R] has a true\nvalue, otherwise the \\f[CR]else\\f[R] section is used (if present).\nThe following values count as true:\n.IP \\(bu 2\nany map\n.IP \\(bu 2\nany array containing at least one true value\n.IP \\(bu 2\nany nonempty string\n.IP \\(bu 2\nboolean True\n.PP\nNote that in YAML metadata (and metadata specified on the command line\nusing \\f[CR]\\-M/\\-\\-metadata\\f[R]), unquoted \\f[CR]true\\f[R] and\n\\f[CR]false\\f[R] will be interpreted as Boolean values.\nBut a variable specified on the command line using\n\\f[CR]\\-V/\\-\\-variable\\f[R] will always be given a string value.\nHence a conditional \\f[CR]if(foo)\\f[R] will be triggered if you use\n\\f[CR]\\-V foo=false\\f[R], but not if you use \\f[CR]\\-M foo=false\\f[R].\n.PP\nExamples:\n.IP\n.EX\n$if(foo)$bar$endif$\n\n$if(foo)$\n  $foo$\n$endif$\n\n$if(foo)$\npart one\n$else$\npart two\n$endif$\n\n${if(foo)}bar${endif}\n\n${if(foo)}\n  ${foo}\n${endif}\n\n${if(foo)}\n${ foo.bar }\n${else}\nno foo!\n${endif}\n.EE\n.PP\nThe keyword \\f[CR]elseif\\f[R] may be used to simplify complex nested\nconditionals:\n.IP\n.EX\n$if(foo)$\nXXX\n$elseif(bar)$\nYYY\n$else$\nZZZ\n$endif$\n.EE\n.SS For loops\nA for loop begins with \\f[CR]for(variable)\\f[R] (enclosed in matched\ndelimiters) and ends with \\f[CR]endfor\\f[R] (enclosed in matched\ndelimiters).\n.IP \\(bu 2\nIf \\f[CR]variable\\f[R] is an array, the material inside the loop will be\nevaluated repeatedly, with \\f[CR]variable\\f[R] being set to each value\nof the array in turn, and concatenated.\n.IP \\(bu 2\nIf \\f[CR]variable\\f[R] is a map, the material inside will be set to the\nmap.\n.IP \\(bu 2\nIf the value of the associated variable is not an array or a map, a\nsingle iteration will be performed on its value.\n.PP\nExamples:\n.IP\n.EX\n$for(foo)$$foo$$sep$, $endfor$\n\n$for(foo)$\n  \\- $foo.last$, $foo.first$\n$endfor$\n\n${ for(foo.bar) }\n  \\- ${ foo.bar.last }, ${ foo.bar.first }\n${ endfor }\n\n$for(mymap)$\n$it.name$: $it.office$\n$endfor$\n.EE\n.PP\nYou may optionally specify a separator between consecutive values using\n\\f[CR]sep\\f[R] (enclosed in matched delimiters).\nThe material between \\f[CR]sep\\f[R] and the \\f[CR]endfor\\f[R] is the\nseparator.\n.IP\n.EX\n${ for(foo) }${ foo }${ sep }, ${ endfor }\n.EE\n.PP\nInstead of using \\f[CR]variable\\f[R] inside the loop, the special\nanaphoric keyword \\f[CR]it\\f[R] may be used.\n.IP\n.EX\n${ for(foo.bar) }\n  \\- ${ it.last }, ${ it.first }\n${ endfor }\n.EE\n.SS Partials\nPartials (subtemplates stored in different files) may be included by\nusing the name of the partial, followed by \\f[CR]()\\f[R], for example:\n.IP\n.EX\n${ styles() }\n.EE\n.PP\nPartials will be sought in the directory containing the main template.\nThe file name will be assumed to have the same extension as the main\ntemplate if it lacks an extension.\nWhen calling the partial, the full name including file extension can\nalso be used:\n.IP\n.EX\n${ styles.html() }\n.EE\n.PP\n(If a partial is not found in the directory of the template and the\ntemplate path is given as a relative path, it will also be sought in the\n\\f[CR]templates\\f[R] subdirectory of the user data directory.)\n.PP\nPartials may optionally be applied to variables using a colon:\n.IP\n.EX\n${ date:fancy() }\n\n${ articles:bibentry() }\n.EE\n.PP\nIf \\f[CR]articles\\f[R] is an array, this will iterate over its values,\napplying the partial \\f[CR]bibentry()\\f[R] to each one.\nSo the second example above is equivalent to\n.IP\n.EX\n${ for(articles) }\n${ it:bibentry() }\n${ endfor }\n.EE\n.PP\nNote that the anaphoric keyword \\f[CR]it\\f[R] must be used when\niterating over partials.\nIn the above examples, the \\f[CR]bibentry\\f[R] partial should contain\n\\f[CR]it.title\\f[R] (and so on) instead of \\f[CR]articles.title\\f[R].\n.PP\nFinal newlines are omitted from included partials.\n.PP\nPartials may include other partials.\n.PP\nA separator between values of an array may be specified in square\nbrackets, immediately after the variable name or partial:\n.IP\n.EX\n${months[, ]}\n\n${articles:bibentry()[; ]}\n.EE\n.PP\nThe separator in this case is literal and (unlike with \\f[CR]sep\\f[R] in\nan explicit \\f[CR]for\\f[R] loop) cannot contain interpolated variables\nor other template directives.\n.SS Nesting\nTo ensure that content is \\(lqnested,\\(rq that is, subsequent lines\nindented, use the \\f[CR]\\(ha\\f[R] directive:\n.IP\n.EX\n$item.number$  $\\(ha$$item.description$ ($item.price$)\n.EE\n.PP\nIn this example, if \\f[CR]item.description\\f[R] has multiple lines, they\nwill all be indented to line up with the first line:\n.IP\n.EX\n00123  A fine bottle of 18\\-year old\n       Oban whiskey. ($148)\n.EE\n.PP\nTo nest multiple lines to the same level, align them with the\n\\f[CR]\\(ha\\f[R] directive in the template.\nFor example:\n.IP\n.EX\n$item.number$  $\\(ha$$item.description$ ($item.price$)\n               (Available til $item.sellby$.)\n.EE\n.PP\nwill produce\n.IP\n.EX\n00123  A fine bottle of 18\\-year old\n       Oban whiskey. ($148)\n       (Available til March 30, 2020.)\n.EE\n.PP\nIf a variable occurs by itself on a line, preceded by whitespace and not\nfollowed by further text or directives on the same line, and the\nvariable\\(cqs value contains multiple lines, it will be nested\nautomatically.\n.SS Breakable spaces\nNormally, spaces in the template itself (as opposed to values of the\ninterpolated variables) are not breakable, but they can be made\nbreakable in part of the template by using the \\f[CR]\\(ti\\f[R] keyword\n(ended with another \\f[CR]\\(ti\\f[R]).\n.IP\n.EX\n$\\(ti$This long line may break if the document is rendered\nwith a short line length.$\\(ti$\n.EE\n.SS Pipes\nA pipe transforms the value of a variable or partial.\nPipes are specified using a slash (\\f[CR]/\\f[R]) between the variable\nname (or partial) and the pipe name.\nExample:\n.IP\n.EX\n$for(name)$\n$name/uppercase$\n$endfor$\n\n$for(metadata/pairs)$\n\\- $it.key$: $it.value$\n$endfor$\n\n$employee:name()/uppercase$\n.EE\n.PP\nPipes may be chained:\n.IP\n.EX\n$for(employees/pairs)$\n$it.key/alpha/uppercase$. $it.name$\n$endfor$\n.EE\n.PP\nSome pipes take parameters:\n.IP\n.EX\n|\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-|\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-|\n$for(employee)$\n$it.name.first/uppercase/left 20 \\(dq| \\(dq$$it.name.salary/right 10 \\(dq | \\(dq \\(dq |\\(dq$\n$endfor$\n|\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-|\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-|\n.EE\n.PP\nCurrently the following pipes are predefined:\n.IP \\(bu 2\n\\f[CR]pairs\\f[R]: Converts a map or array to an array of maps, each with\n\\f[CR]key\\f[R] and \\f[CR]value\\f[R] fields.\nIf the original value was an array, the \\f[CR]key\\f[R] will be the array\nindex, starting with 1.\n.IP \\(bu 2\n\\f[CR]uppercase\\f[R]: Converts text to uppercase.\n.IP \\(bu 2\n\\f[CR]lowercase\\f[R]: Converts text to lowercase.\n.IP \\(bu 2\n\\f[CR]length\\f[R]: Returns the length of the value: number of characters\nfor a textual value, number of elements for a map or array.\n.IP \\(bu 2\n\\f[CR]reverse\\f[R]: Reverses a textual value or array, and has no effect\non other values.\n.IP \\(bu 2\n\\f[CR]first\\f[R]: Returns the first value of an array, if applied to a\nnon\\-empty array; otherwise returns the original value.\n.IP \\(bu 2\n\\f[CR]last\\f[R]: Returns the last value of an array, if applied to a\nnon\\-empty array; otherwise returns the original value.\n.IP \\(bu 2\n\\f[CR]rest\\f[R]: Returns all but the first value of an array, if applied\nto a non\\-empty array; otherwise returns the original value.\n.IP \\(bu 2\n\\f[CR]allbutlast\\f[R]: Returns all but the last value of an array, if\napplied to a non\\-empty array; otherwise returns the original value.\n.IP \\(bu 2\n\\f[CR]chomp\\f[R]: Removes trailing newlines (and breakable space).\n.IP \\(bu 2\n\\f[CR]nowrap\\f[R]: Disables line wrapping on breakable spaces.\n.IP \\(bu 2\n\\f[CR]alpha\\f[R]: Converts textual values that can be read as an integer\ninto lowercase alphabetic characters \\f[CR]a..z\\f[R] (mod 26).\nThis can be used to get lettered enumeration from array indices.\nTo get uppercase letters, chain with \\f[CR]uppercase\\f[R].\n.IP \\(bu 2\n\\f[CR]roman\\f[R]: Converts textual values that can be read as an integer\ninto lowercase roman numerals.\nThis can be used to get lettered enumeration from array indices.\nTo get uppercase roman, chain with \\f[CR]uppercase\\f[R].\n.IP \\(bu 2\n\\f[CR]left n \\(dqleftborder\\(dq \\(dqrightborder\\(dq\\f[R]: Renders a\ntextual value in a block of width \\f[CR]n\\f[R], aligned to the left,\nwith an optional left and right border.\nHas no effect on other values.\nThis can be used to align material in tables.\nWidths are positive integers indicating the number of characters.\nBorders are strings inside double quotes; literal \\f[CR]\\(dq\\f[R] and\n\\f[CR]\\(rs\\f[R] characters must be backslash\\-escaped.\n.IP \\(bu 2\n\\f[CR]right n \\(dqleftborder\\(dq \\(dqrightborder\\(dq\\f[R]: Renders a\ntextual value in a block of width \\f[CR]n\\f[R], aligned to the right,\nand has no effect on other values.\n.IP \\(bu 2\n\\f[CR]center n \\(dqleftborder\\(dq \\(dqrightborder\\(dq\\f[R]: Renders a\ntextual value in a block of width \\f[CR]n\\f[R], aligned to the center,\nand has no effect on other values.\n.SS Variables\n.SS Metadata variables\n.TP\n\\f[CR]title\\f[R], \\f[CR]author\\f[R], \\f[CR]date\\f[R]\nallow identification of basic aspects of the document.\nIncluded in PDF metadata through LaTeX and ConTeXt.\nThese can be set through a pandoc title block, which allows for multiple\nauthors, or through a YAML metadata block:\n.RS\n.IP\n.EX\n\\-\\-\\-\nauthor:\n\\- Aristotle\n\\- Peter Abelard\n\\&...\n.EE\nNote that if you just want to set PDF or HTML metadata, without\nincluding a title block in the document itself, you can set the\n\\f[CR]title\\-meta\\f[R], \\f[CR]author\\-meta\\f[R], and\n\\f[CR]date\\-meta\\f[R] variables.\n(By default these are set automatically, based on \\f[CR]title\\f[R],\n\\f[CR]author\\f[R], and \\f[CR]date\\f[R].)\nThe page title in HTML is set by \\f[CR]pagetitle\\f[R], which is equal to\n\\f[CR]title\\f[R] by default.\n.RE\n.TP\n\\f[CR]subtitle\\f[R]\ndocument subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx\ndocuments\n.TP\n\\f[CR]abstract\\f[R]\ndocument summary, included in HTML, LaTeX, ConTeXt, AsciiDoc, and docx\ndocuments\n.TP\n\\f[CR]abstract\\-title\\f[R]\ntitle of abstract, currently used only in HTML, EPUB, docx, and Typst.\nThis will be set automatically to a localized value, depending on\n\\f[CR]lang\\f[R], but can be manually overridden.\n.TP\n\\f[CR]keywords\\f[R]\nlist of keywords to be included in HTML, PDF, ODT, pptx, docx and\nAsciiDoc metadata; repeat as for \\f[CR]author\\f[R], above\n.TP\n\\f[CR]subject\\f[R]\ndocument subject, included in ODT, PDF, docx, EPUB, and pptx metadata\n.TP\n\\f[CR]description\\f[R]\ndocument description, included in ODT, docx and pptx metadata.\nSome applications show this as \\f[CR]Comments\\f[R] metadata.\n.TP\n\\f[CR]category\\f[R]\ndocument category, included in docx and pptx metadata\n.PP\nAdditionally, any root\\-level string metadata, not included in ODT, docx\nor pptx metadata is added as a \\f[I]custom property\\f[R].\nThe following YAML metadata block for instance:\n.IP\n.EX\n\\-\\-\\-\ntitle:  \\(aqThis is the title\\(aq\nsubtitle: \\(dqThis is the subtitle\\(dq\nauthor:\n\\- Author One\n\\- Author Two\ndescription: |\n    This is a long\n    description.\n\n    It consists of two paragraphs\n\\&...\n.EE\n.PP\nwill include \\f[CR]title\\f[R], \\f[CR]author\\f[R] and\n\\f[CR]description\\f[R] as standard document properties and\n\\f[CR]subtitle\\f[R] as a custom property when converting to docx, ODT or\npptx.\n.SS Language variables\n.TP\n\\f[CR]lang\\f[R]\nidentifies the main language of the document using IETF language tags\n(following the BCP 47 standard), such as \\f[CR]en\\f[R] or\n\\f[CR]en\\-GB\\f[R].\nThe Language subtag lookup tool can look up or verify these tags.\nThis affects most formats, and controls hyphenation in PDF output when\nusing LaTeX (through \\f[CR]babel\\f[R] and \\f[CR]polyglossia\\f[R]) or\nConTeXt.\n.RS\nUse native pandoc Divs and Spans with the \\f[CR]lang\\f[R] attribute to\nswitch the language:\n.IP\n.EX\n\\-\\-\\-\nlang: en\\-GB\n\\&...\n\nText in the main document language (British English).\n\n::: {lang=fr\\-CA}\n> Cette citation est écrite en français canadien.\n:::\n\nMore text in English. [\\(aqZitat auf Deutsch.\\(aq]{lang=de}\n.EE\n.RE\n.TP\n\\f[CR]dir\\f[R]\nthe base script direction, either \\f[CR]rtl\\f[R] (right\\-to\\-left) or\n\\f[CR]ltr\\f[R] (left\\-to\\-right).\n.RS\nFor bidirectional documents, native pandoc \\f[CR]span\\f[R]s and\n\\f[CR]div\\f[R]s with the \\f[CR]dir\\f[R] attribute (value \\f[CR]rtl\\f[R]\nor \\f[CR]ltr\\f[R]) can be used to override the base direction in some\noutput formats.\nThis may not always be necessary if the final renderer (e.g.\\ the\nbrowser, when generating HTML) supports the Unicode Bidirectional\nAlgorithm.\nWhen using LaTeX for bidirectional documents, only the\n\\f[CR]xelatex\\f[R] engine is fully supported (use\n\\f[CR]\\-\\-pdf\\-engine=xelatex\\f[R]).\n.RE\n.SS Variables for HTML\n.TP\n\\f[CR]document\\-css\\f[R]\nEnables inclusion of most of the CSS in the \\f[CR]styles.html\\f[R]\npartial (have a look with\n\\f[CR]pandoc \\-\\-print\\-default\\-data\\-file=templates/styles.html\\f[R]).\nUnless you use \\f[CR]\\-\\-css\\f[R], this variable is set to\n\\f[CR]true\\f[R] by default.\nYou can disable it with e.g.\\ \\f[CR]pandoc \\-M document\\-css=false\\f[R].\n.TP\n\\f[CR]mainfont\\f[R]\nsets the CSS \\f[CR]font\\-family\\f[R] property on the \\f[CR]html\\f[R]\nelement.\n.TP\n\\f[CR]fontsize\\f[R]\nsets the base CSS \\f[CR]font\\-size\\f[R], which you\\(cqd usually set to\ne.g.\\ \\f[CR]20px\\f[R], but it also accepts \\f[CR]pt\\f[R] (12pt = 16px in\nmost browsers).\n.TP\n\\f[CR]fontcolor\\f[R]\nsets the CSS \\f[CR]color\\f[R] property on the \\f[CR]html\\f[R] element.\n.TP\n\\f[CR]linkcolor\\f[R]\nsets the CSS \\f[CR]color\\f[R] property on all links.\n.TP\n\\f[CR]monofont\\f[R]\nsets the CSS \\f[CR]font\\-family\\f[R] property on \\f[CR]code\\f[R]\nelements.\n.TP\n\\f[CR]monobackgroundcolor\\f[R]\nsets the CSS \\f[CR]background\\-color\\f[R] property on \\f[CR]code\\f[R]\nelements and adds extra padding.\n.TP\n\\f[CR]linestretch\\f[R]\nsets the CSS \\f[CR]line\\-height\\f[R] property on the \\f[CR]html\\f[R]\nelement, which is preferred to be unitless.\n.TP\n\\f[CR]maxwidth\\f[R]\nsets the CSS \\f[CR]max\\-width\\f[R] property (default is 36em).\n.TP\n\\f[CR]backgroundcolor\\f[R]\nsets the CSS \\f[CR]background\\-color\\f[R] property on the\n\\f[CR]html\\f[R] element.\n.TP\n\\f[CR]margin\\-left\\f[R], \\f[CR]margin\\-right\\f[R], \\f[CR]margin\\-top\\f[R], \\f[CR]margin\\-bottom\\f[R]\nsets the corresponding CSS \\f[CR]padding\\f[R] properties on the\n\\f[CR]body\\f[R] element.\n.PP\nTo override or extend some CSS for just one document, include for\nexample:\n.IP\n.EX\n\\-\\-\\-\nheader\\-includes: |\n  <style>\n  blockquote {\n    font\\-style: italic;\n  }\n  tr.even {\n    background\\-color: #f0f0f0;\n  }\n  td, th {\n    padding: 0.5em 2em 0.5em 0.5em;\n  }\n  tbody {\n    border\\-bottom: none;\n  }\n  </style>\n\\-\\-\\-\n.EE\n.SS Variables for HTML math\n.TP\n\\f[CR]classoption\\f[R]\nwhen using \\f[CR]\\-\\-katex\\f[R], you can render display math equations\nflush left using YAML metadata or with \\f[CR]\\-M classoption=fleqn\\f[R].\n.SS Variables for HTML slides\nThese affect HTML output when producing slide shows with pandoc.\n.TP\n\\f[CR]institute\\f[R]\nauthor affiliations: can be a list when there are multiple authors\n.TP\n\\f[CR]revealjs\\-url\\f[R]\nbase URL for reveal.js documents (defaults to\n\\f[CR]https://unpkg.com/reveal.js\\(at\\(ha5\\f[R])\n.TP\n\\f[CR]s5\\-url\\f[R]\nbase URL for S5 documents (defaults to \\f[CR]s5/default\\f[R])\n.TP\n\\f[CR]slidy\\-url\\f[R]\nbase URL for Slidy documents (defaults to\n\\f[CR]https://www.w3.org/Talks/Tools/Slidy2\\f[R])\n.TP\n\\f[CR]slideous\\-url\\f[R]\nbase URL for Slideous documents (defaults to \\f[CR]slideous\\f[R])\n.TP\n\\f[CR]title\\-slide\\-attributes\\f[R]\nadditional attributes for the title slide of reveal.js slide shows.\nSee background in reveal.js, beamer, and pptx for an example.\n.TP\n\\f[CR]highlightjs\\-theme\\f[R]\nhighlight.js theme for code highlighting when using\n\\f[CR]\\-\\-syntax\\-highlighting=idiomatic\\f[R] with reveal.js (defaults\nto \\f[CR]monokai\\f[R]).\nSee the highlight.js demo page for available themes.\n.PP\nAll reveal.js configuration options are available as variables.\nTo turn off boolean flags that default to true in reveal.js, use\n\\f[CR]0\\f[R].\n.SS Variables for Beamer slides\nThese variables change the appearance of PDF slides using\n\\f[CR]beamer\\f[R].\n.TP\n\\f[CR]aspectratio\\f[R]\nslide aspect ratio (\\f[CR]43\\f[R] for 4:3 [default], \\f[CR]169\\f[R] for\n16:9, \\f[CR]1610\\f[R] for 16:10, \\f[CR]149\\f[R] for 14:9, \\f[CR]141\\f[R]\nfor 1.41:1, \\f[CR]54\\f[R] for 5:4, \\f[CR]32\\f[R] for 3:2)\n.TP\n\\f[CR]beameroption\\f[R]\nadd extra beamer option with \\f[CR]\\(rssetbeameroption{}\\f[R]\n.TP\n\\f[CR]institute\\f[R]\nauthor affiliations: can be a list when there are multiple authors\n.TP\n\\f[CR]logo\\f[R]\nlogo image for slides\n.TP\n\\f[CR]logooptions\\f[R]\noptions for logo image (e.g., \\f[CR]width\\f[R], \\f[CR]height\\f[R])\n.TP\n\\f[CR]navigation\\f[R]\ncontrols navigation symbols (default is \\f[CR]empty\\f[R] for no\nnavigation symbols; other valid values are \\f[CR]frame\\f[R],\n\\f[CR]vertical\\f[R], and \\f[CR]horizontal\\f[R])\n.TP\n\\f[CR]section\\-titles\\f[R]\nenables \\(lqtitle pages\\(rq for new sections (default is true)\n.TP\n\\f[CR]theme\\f[R], \\f[CR]colortheme\\f[R], \\f[CR]fonttheme\\f[R], \\f[CR]innertheme\\f[R], \\f[CR]outertheme\\f[R]\nbeamer themes\n.TP\n\\f[CR]themeoptions\\f[R], \\f[CR]colorthemeoptions\\f[R], \\f[CR]fontthemeoptions\\f[R], \\f[CR]innerthemeoptions\\f[R], \\f[CR]outerthemeoptions\\f[R]\noptions for LaTeX beamer themes (lists)\n.TP\n\\f[CR]titlegraphic\\f[R]\nimage for title slide: can be a list\n.TP\n\\f[CR]titlegraphicoptions\\f[R]\noptions for title slide image (e.g., \\f[CR]width\\f[R],\n\\f[CR]height\\f[R])\n.TP\n\\f[CR]shorttitle\\f[R], \\f[CR]shortsubtitle\\f[R], \\f[CR]shortauthor\\f[R], \\f[CR]shortinstitute\\f[R], \\f[CR]shortdate\\f[R]\nsome beamer themes use short versions of the title, subtitle, author,\ninstitute, date\n.SS Variables for PowerPoint\nThese variables control the visual aspects of a slide show that are not\neasily controlled via templates.\n.TP\n\\f[CR]monofont\\f[R]\nfont to use for code.\n.SS Variables for LaTeX\nPandoc uses these variables when creating a PDF with a LaTeX engine.\n.SS Layout\n.TP\n\\f[CR]block\\-headings\\f[R]\nmake \\f[CR]\\(rsparagraph\\f[R] and \\f[CR]\\(rssubparagraph\\f[R] (fourth\\-\nand fifth\\-level headings, or fifth\\- and sixth\\-level with book\nclasses) free\\-standing rather than run\\-in; requires further formatting\nto distinguish from \\f[CR]\\(rssubsubsection\\f[R] (third\\- or\nfourth\\-level headings).\nInstead of using this option, KOMA\\-Script can adjust headings more\nextensively:\n.RS\n.IP\n.EX\n\\-\\-\\-\ndocumentclass: scrartcl\nheader\\-includes: |\n  \\(rsRedeclareSectionCommand[\n    beforeskip=\\-10pt plus \\-2pt minus \\-1pt,\n    afterskip=1sp plus \\-1sp minus 1sp,\n    font=\\(rsnormalfont\\(rsitshape]{paragraph}\n  \\(rsRedeclareSectionCommand[\n    beforeskip=\\-10pt plus \\-2pt minus \\-1pt,\n    afterskip=1sp plus \\-1sp minus 1sp,\n    font=\\(rsnormalfont\\(rsscshape,\n    indent=0pt]{subparagraph}\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]classoption\\f[R]\noption for document class, e.g.\\ \\f[CR]oneside\\f[R]; repeat for multiple\noptions:\n.RS\n.IP\n.EX\n\\-\\-\\-\nclassoption:\n\\- twocolumn\n\\- landscape\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]documentclass\\f[R]\ndocument class: usually one of the standard classes, \\f[CR]article\\f[R],\n\\f[CR]book\\f[R], and \\f[CR]report\\f[R]; the KOMA\\-Script equivalents,\n\\f[CR]scrartcl\\f[R], \\f[CR]scrbook\\f[R], and \\f[CR]scrreprt\\f[R], which\ndefault to smaller margins; or \\f[CR]memoir\\f[R]\n.TP\n\\f[CR]geometry\\f[R]\noption for \\f[CR]geometry\\f[R] package, e.g.\\ \\f[CR]margin=1in\\f[R];\nrepeat for multiple options:\n.RS\n.IP\n.EX\n\\-\\-\\-\ngeometry:\n\\- top=30mm\n\\- left=20mm\n\\- heightrounded\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]shorthands\\f[R]\nEnable language\\-specific shorthands when loading \\f[CR]babel\\f[R].\n(By default, pandoc includes \\f[CR]shorthands=off\\f[R] when loading\n\\f[CR]babel\\f[R], disabling language\\-specific shorthands.)\n.TP\n\\f[CR]hyperrefoptions\\f[R]\noption for \\f[CR]hyperref\\f[R] package, e.g.\\ \\f[CR]linktoc=all\\f[R];\nrepeat for multiple options:\n.RS\n.IP\n.EX\n\\-\\-\\-\nhyperrefoptions:\n\\- linktoc=all\n\\- pdfwindowui\n\\- pdfpagemode=FullScreen\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]indent\\f[R]\nif true, pandoc will use document class settings for indentation (the\ndefault LaTeX template otherwise removes indentation and adds space\nbetween paragraphs)\n.TP\n\\f[CR]linestretch\\f[R]\nadjusts line spacing using the \\f[CR]setspace\\f[R] package,\ne.g.\\ \\f[CR]1.25\\f[R], \\f[CR]1.5\\f[R]\n.TP\n\\f[CR]margin\\-left\\f[R], \\f[CR]margin\\-right\\f[R], \\f[CR]margin\\-top\\f[R], \\f[CR]margin\\-bottom\\f[R]\nsets margins if \\f[CR]geometry\\f[R] is not used (otherwise\n\\f[CR]geometry\\f[R] overrides these)\n.TP\n\\f[CR]pagestyle\\f[R]\ncontrol \\f[CR]\\(rspagestyle{}\\f[R]: the default article class supports\n\\f[CR]plain\\f[R] (default), \\f[CR]empty\\f[R] (no running heads or page\nnumbers), and \\f[CR]headings\\f[R] (section titles in running heads)\n.TP\n\\f[CR]papersize\\f[R]\npaper size, e.g.\\ \\f[CR]letter\\f[R], \\f[CR]a4\\f[R]\n.TP\n\\f[CR]secnumdepth\\f[R]\nnumbering depth for sections (with \\f[CR]\\-\\-number\\-sections\\f[R]\noption or \\f[CR]numbersections\\f[R] variable)\n.TP\n\\f[CR]beamerarticle\\f[R]\nproduce an article from Beamer slides.\nNote: if you set this variable, you must specify the beamer writer but\nuse the default \\f[I]LaTeX\\f[R] template: for example,\n\\f[CR]pandoc \\-Vbeamerarticle \\-t beamer \\-\\-template default.latex\\f[R].\n.TP\n\\f[CR]handout\\f[R]\nproduce a handout version of Beamer slides (with overlays condensed into\nsingle slides)\n.TP\n\\f[CR]csquotes\\f[R]\nload \\f[CR]csquotes\\f[R] package and use \\f[CR]\\(rsenquote\\f[R] or\n\\f[CR]\\(rsenquote*\\f[R] for quoted text.\n.TP\n\\f[CR]csquotesoptions\\f[R]\noptions to use for \\f[CR]csquotes\\f[R] package (repeat for multiple\noptions).\n.TP\n\\f[CR]babeloptions\\f[R]\noptions to pass to the babel package (may be repeated for multiple\noptions).\nThis defaults to \\f[CR]provide=*\\f[R] if the main language isn\\(cqt a\nEuropean language written with Latin or Cyrillic script or Vietnamese.\nMost users will not need to adjust the default setting.\n.SS Fonts\n.TP\n\\f[CR]fontenc\\f[R]\nallows font encoding to be specified through \\f[CR]fontenc\\f[R] package\n(with \\f[CR]pdflatex\\f[R]); default is \\f[CR]T1\\f[R] (see LaTeX font\nencodings guide)\n.TP\n\\f[CR]fontfamily\\f[R]\nfont package for use with \\f[CR]pdflatex\\f[R]: TeX Live includes many\noptions, documented in the LaTeX Font Catalogue.\nThe default is Latin Modern.\n.TP\n\\f[CR]fontfamilyoptions\\f[R]\noptions for package used as \\f[CR]fontfamily\\f[R]; repeat for multiple\noptions.\nFor example, to use the Libertine font with proportional lowercase\n(old\\-style) figures through the \\f[CR]libertinus\\f[R] package:\n.RS\n.IP\n.EX\n\\-\\-\\-\nfontfamily: libertinus\nfontfamilyoptions:\n\\- osf\n\\- p\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]fontsize\\f[R]\nfont size for body text.\nThe standard classes allow 10pt, 11pt, and 12pt.\nTo use another size, set \\f[CR]documentclass\\f[R] to one of the\nKOMA\\-Script classes, such as \\f[CR]scrartcl\\f[R] or \\f[CR]scrbook\\f[R].\n.TP\n\\f[CR]mainfont\\f[R], \\f[CR]sansfont\\f[R], \\f[CR]monofont\\f[R], \\f[CR]mathfont\\f[R], \\f[CR]CJKmainfont\\f[R], \\f[CR]CJKsansfont\\f[R], \\f[CR]CJKmonofont\\f[R]\nfont families for use with \\f[CR]xelatex\\f[R] or \\f[CR]lualatex\\f[R]:\ntake the name of any system font, using the \\f[CR]fontspec\\f[R] package.\n\\f[CR]CJKmainfont\\f[R] uses the \\f[CR]xecjk\\f[R] package if\n\\f[CR]xelatex\\f[R] is used, or the \\f[CR]luatexja\\f[R] package if\n\\f[CR]lualatex\\f[R] is used.\n.TP\n\\f[CR]mainfontoptions\\f[R], \\f[CR]sansfontoptions\\f[R], \\f[CR]monofontoptions\\f[R], \\f[CR]mathfontoptions\\f[R], \\f[CR]CJKoptions\\f[R], \\f[CR]luatexjapresetoptions\\f[R]\noptions to use with \\f[CR]mainfont\\f[R], \\f[CR]sansfont\\f[R],\n\\f[CR]monofont\\f[R], \\f[CR]mathfont\\f[R], \\f[CR]CJKmainfont\\f[R] in\n\\f[CR]xelatex\\f[R] and \\f[CR]lualatex\\f[R].\nAllow for any choices available through \\f[CR]fontspec\\f[R]; repeat for\nmultiple options.\nFor example, to use the TeX Gyre version of Palatino with lowercase\nfigures:\n.RS\n.IP\n.EX\n\\-\\-\\-\nmainfont: TeX Gyre Pagella\nmainfontoptions:\n\\- Numbers=Lowercase\n\\- Numbers=Proportional\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]mainfontfallback\\f[R], \\f[CR]sansfontfallback\\f[R], \\f[CR]monofontfallback\\f[R]\nfonts to try if a glyph isn\\(cqt found in \\f[CR]mainfont\\f[R],\n\\f[CR]sansfont\\f[R], or \\f[CR]monofont\\f[R] respectively.\nThese are lists.\nThe font name must be followed by a colon and optionally a set of\noptions, for example:\n.RS\n.IP\n.EX\n\\-\\-\\-\nmainfontfallback:\n  \\- \\(dqFreeSans:\\(dq\n  \\- \\(dqNotoColorEmoji:mode=harf\\(dq\n\\&...\n.EE\nFont fallbacks currently only work with \\f[CR]lualatex\\f[R].\n.RE\n.TP\n\\f[CR]babelfonts\\f[R]\na map of Babel language names (e.g.\\ \\f[CR]chinese\\f[R]) to the font to\nbe used with the language:\n.RS\n.IP\n.EX\n\\-\\-\\-\nbabelfonts:\n  chinese\\-hant: \\(dqNoto Serif CJK TC\\(dq\n  russian: \\(dqNoto Serif\\(dq\n\\&...\n.EE\n.RE\n.TP\n\\f[CR]microtypeoptions\\f[R]\noptions to pass to the microtype package\n.SS Links\n.TP\n\\f[CR]colorlinks\\f[R]\nadd color to link text; automatically enabled if any of\n\\f[CR]linkcolor\\f[R], \\f[CR]filecolor\\f[R], \\f[CR]citecolor\\f[R],\n\\f[CR]urlcolor\\f[R], or \\f[CR]toccolor\\f[R] are set\n.TP\n\\f[CR]boxlinks\\f[R]\nadd visible box around links (has no effect if \\f[CR]colorlinks\\f[R] is\nset)\n.TP\n\\f[CR]linkcolor\\f[R], \\f[CR]filecolor\\f[R], \\f[CR]citecolor\\f[R], \\f[CR]urlcolor\\f[R], \\f[CR]toccolor\\f[R]\ncolor for internal links, external links, citation links, linked URLs,\nand links in table of contents, respectively: uses options allowed by\n\\f[CR]xcolor\\f[R], including the \\f[CR]dvipsnames\\f[R],\n\\f[CR]svgnames\\f[R], and \\f[CR]x11names\\f[R] lists\n.TP\n\\f[CR]links\\-as\\-notes\\f[R]\ncauses links to be printed as footnotes\n.TP\n\\f[CR]urlstyle\\f[R]\nstyle for URLs (e.g., \\f[CR]tt\\f[R], \\f[CR]rm\\f[R], \\f[CR]sf\\f[R], and,\nthe default, \\f[CR]same\\f[R])\n.SS Front matter\n.TP\n\\f[CR]lof\\f[R], \\f[CR]lot\\f[R]\ninclude list of figures, list of tables (can also be set using\n\\f[CR]\\-\\-lof/\\-\\-list\\-of\\-figures\\f[R],\n\\f[CR]\\-\\-lot/\\-\\-list\\-of\\-tables\\f[R])\n.TP\n\\f[CR]thanks\\f[R]\ncontents of acknowledgments footnote after document title\n.TP\n\\f[CR]toc\\f[R]\ninclude table of contents (can also be set using\n\\f[CR]\\-\\-toc/\\-\\-table\\-of\\-contents\\f[R])\n.TP\n\\f[CR]toc\\-depth\\f[R]\nlevel of section to include in table of contents\n.SS BibLaTeX Bibliographies\nThese variables function when using BibLaTeX for citation rendering.\n.TP\n\\f[CR]biblatexoptions\\f[R]\nlist of options for biblatex\n.TP\n\\f[CR]biblio\\-style\\f[R]\nbibliography style, when used with \\f[CR]\\-\\-natbib\\f[R] and\n\\f[CR]\\-\\-biblatex\\f[R]\n.TP\n\\f[CR]biblio\\-title\\f[R]\nbibliography title, when used with \\f[CR]\\-\\-natbib\\f[R] and\n\\f[CR]\\-\\-biblatex\\f[R]\n.TP\n\\f[CR]bibliography\\f[R]\nbibliography to use for resolving references\n.TP\n\\f[CR]natbiboptions\\f[R]\nlist of options for natbib\n.SS Other\n.TP\n\\f[CR]pdf\\-trailer\\-id\\f[R]\nthe PDF trailer ID; must be two PDF byte strings if set, conventionally\nwith 16 bytes each.\nE.g.,\n\\f[CR]<00112233445566778899aabbccddeeff> <00112233445566778899aabbccddeeff>\\f[R].\n.RS\nSee the section on reproducible builds.\n.RE\n.TP\n\\f[CR]pdfstandard\\f[R]\nPDF standard(s) for the document, e.g.\\ \\f[CR]ua\\-2\\f[R],\n\\f[CR]a\\-4f\\f[R].\nSupports PDF/A, PDF/X, and PDF/UA variants.\nRequires LuaLaTeX and LaTeX 2023+.\nRepeat for multiple standards:\n.RS\n.IP\n.EX\n\\-\\-\\-\npdfstandard:\n\\- ua\\-2\n\\- a\\-4f\n\\&...\n.EE\n.RE\n.SS Variables for ConTeXt\nPandoc uses these variables when creating a PDF with ConTeXt.\n.TP\n\\f[CR]fontsize\\f[R]\nfont size for body text (e.g.\\ \\f[CR]10pt\\f[R], \\f[CR]12pt\\f[R])\n.TP\n\\f[CR]headertext\\f[R], \\f[CR]footertext\\f[R]\ntext to be placed in running header or footer (see ConTeXt Headers and\nFooters); repeat up to four times for different placement\n.TP\n\\f[CR]indenting\\f[R]\ncontrols indentation of paragraphs, e.g.\\ \\f[CR]yes,small,next\\f[R] (see\nConTeXt Indentation); repeat for multiple options\n.TP\n\\f[CR]interlinespace\\f[R]\nadjusts line spacing, e.g.\\ \\f[CR]4ex\\f[R] (using\n\\f[CR]setupinterlinespace\\f[R]); repeat for multiple options\n.TP\n\\f[CR]layout\\f[R]\noptions for page margins and text arrangement (see ConTeXt Layout);\nrepeat for multiple options\n.TP\n\\f[CR]linkcolor\\f[R], \\f[CR]contrastcolor\\f[R]\ncolor for links outside and inside a page, e.g.\\ \\f[CR]red\\f[R],\n\\f[CR]blue\\f[R] (see ConTeXt Color)\n.TP\n\\f[CR]linkstyle\\f[R]\ntypeface style for links, e.g.\\ \\f[CR]normal\\f[R], \\f[CR]bold\\f[R],\n\\f[CR]slanted\\f[R], \\f[CR]boldslanted\\f[R], \\f[CR]type\\f[R],\n\\f[CR]cap\\f[R], \\f[CR]small\\f[R]\n.TP\n\\f[CR]lof\\f[R], \\f[CR]lot\\f[R]\ninclude list of figures, list of tables\n.TP\n\\f[CR]mainfont\\f[R], \\f[CR]sansfont\\f[R], \\f[CR]monofont\\f[R], \\f[CR]mathfont\\f[R]\nfont families: take the name of any system font (see ConTeXt Font\nSwitching)\n.TP\n\\f[CR]mainfontfallback\\f[R], \\f[CR]sansfontfallback\\f[R], \\f[CR]monofontfallback\\f[R]\nlist of fonts to try, in order, if a glyph is not found in the main\nfont.\nUse \\f[CR]\\(rsdefinefallbackfamily\\f[R]\\-compatible font name syntax.\nEmoji fonts are unsupported.\n.TP\n\\f[CR]margin\\-left\\f[R], \\f[CR]margin\\-right\\f[R], \\f[CR]margin\\-top\\f[R], \\f[CR]margin\\-bottom\\f[R]\nsets margins, if \\f[CR]layout\\f[R] is not used (otherwise\n\\f[CR]layout\\f[R] overrides these)\n.TP\n\\f[CR]pagenumbering\\f[R]\npage number style and location (using \\f[CR]setuppagenumbering\\f[R]);\nrepeat for multiple options\n.TP\n\\f[CR]papersize\\f[R]\npaper size, e.g.\\ \\f[CR]letter\\f[R], \\f[CR]A4\\f[R], \\f[CR]landscape\\f[R]\n(see ConTeXt Paper Setup); repeat for multiple options\n.TP\n\\f[CR]pdfa\\f[R]\nadds to the preamble the setup necessary to generate PDF/A of the type\nspecified, e.g.\\ \\f[CR]1a:2005\\f[R], \\f[CR]2a\\f[R].\nIf no type is specified (i.e.\\ the value is set to True, by e.g.\n\\f[CR]\\-\\-metadata=pdfa\\f[R] or \\f[CR]pdfa: true\\f[R] in a YAML metadata\nblock), \\f[CR]1b:2005\\f[R] will be used as default, for reasons of\nbackwards compatibility.\nUsing \\f[CR]\\-\\-variable=pdfa\\f[R] without specified value is not\nsupported.\nTo successfully generate PDF/A the required ICC color profiles have to\nbe available and the content and all included files (such as images)\nhave to be standard\\-conforming.\nThe ICC profiles and output intent may be specified using the variables\n\\f[CR]pdfaiccprofile\\f[R] and \\f[CR]pdfaintent\\f[R].\nSee also ConTeXt PDFA for more details.\n.TP\n\\f[CR]pdfaiccprofile\\f[R]\nwhen used in conjunction with \\f[CR]pdfa\\f[R], specifies the ICC profile\nto use in the PDF, e.g.\\ \\f[CR]default.cmyk\\f[R].\nIf left unspecified, \\f[CR]sRGB.icc\\f[R] is used as default.\nMay be repeated to include multiple profiles.\nNote that the profiles have to be available on the system.\nThey can be obtained from ConTeXt ICC Profiles.\n.TP\n\\f[CR]pdfaintent\\f[R]\nwhen used in conjunction with \\f[CR]pdfa\\f[R], specifies the output\nintent for the colors,\ne.g.\\ \\f[CR]ISO coated v2 300\\(rsletterpercent\\(rsspace (ECI)\\f[R] If\nleft unspecified, \\f[CR]sRGB IEC61966\\-2.1\\f[R] is used as default.\n.TP\n\\f[CR]toc\\f[R]\ninclude table of contents (can also be set using\n\\f[CR]\\-\\-toc/\\-\\-table\\-of\\-contents\\f[R])\n.TP\n\\f[CR]urlstyle\\f[R]\ntypeface style for links without link text, e.g.\\ \\f[CR]normal\\f[R],\n\\f[CR]bold\\f[R], \\f[CR]slanted\\f[R], \\f[CR]boldslanted\\f[R],\n\\f[CR]type\\f[R], \\f[CR]cap\\f[R], \\f[CR]small\\f[R]\n.TP\n\\f[CR]whitespace\\f[R]\nspacing between paragraphs, e.g.\\ \\f[CR]none\\f[R], \\f[CR]small\\f[R]\n(using \\f[CR]setupwhitespace\\f[R])\n.TP\n\\f[CR]includesource\\f[R]\ninclude all source documents as file attachments in the PDF file\n.SS Variables for \\f[CR]wkhtmltopdf\\f[R]\nPandoc uses these variables when creating a PDF with\n\\f[CR]wkhtmltopdf\\f[R].\nThe \\f[CR]\\-\\-css\\f[R] option also affects the output.\n.TP\n\\f[CR]footer\\-html\\f[R], \\f[CR]header\\-html\\f[R]\nadd information to the header and footer\n.TP\n\\f[CR]margin\\-left\\f[R], \\f[CR]margin\\-right\\f[R], \\f[CR]margin\\-top\\f[R], \\f[CR]margin\\-bottom\\f[R]\nset the page margins\n.TP\n\\f[CR]papersize\\f[R]\nsets the PDF paper size\n.SS Variables for man pages\n.TP\n\\f[CR]adjusting\\f[R]\nadjusts text to left (\\f[CR]l\\f[R]), right (\\f[CR]r\\f[R]), center\n(\\f[CR]c\\f[R]), or both (\\f[CR]b\\f[R]) margins\n.TP\n\\f[CR]footer\\f[R]\nfooter in man pages\n.TP\n\\f[CR]header\\f[R]\nheader in man pages\n.TP\n\\f[CR]section\\f[R]\nsection number in man pages\n.SS Variables for Texinfo\n.TP\n\\f[CR]version\\f[R]\nversion of software (used in title and title page)\n.TP\n\\f[CR]filename\\f[R]\nname of info file to be generated (defaults to a name based on the texi\nfilename)\n.SS Variables for Typst\n.TP\n\\f[CR]template\\f[R]\nTypst template to use (relative path only).\n.TP\n\\f[CR]margin\\f[R]\nA dictionary with the fields defined in the Typst documentation:\n\\f[CR]x\\f[R], \\f[CR]y\\f[R], \\f[CR]top\\f[R], \\f[CR]bottom\\f[R],\n\\f[CR]left\\f[R], \\f[CR]right\\f[R].\n.TP\n\\f[CR]papersize\\f[R]\nPaper size: \\f[CR]a4\\f[R], \\f[CR]us\\-letter\\f[R], etc.\n.TP\n\\f[CR]mainfont\\f[R]\nName of system font to use for the main font.\n.TP\n\\f[CR]fontsize\\f[R]\nFont size (e.g., \\f[CR]12pt\\f[R]).\n.TP\n\\f[CR]section\\-numbering\\f[R]\nSchema to use for numbering sections, e.g.\\ \\f[CR]1.A.1\\f[R].\n.TP\n\\f[CR]page\\-numbering\\f[R]\nSchema to use for numbering pages, e.g.\\ \\f[CR]1\\f[R] or \\f[CR]i\\f[R],\nor an empty string to omit page numbering.\n.TP\n\\f[CR]columns\\f[R]\nNumber of columns for body text.\n.TP\n\\f[CR]thanks\\f[R]\ncontents of acknowledgments footnote after document title\n.TP\n\\f[CR]mathfont\\f[R], \\f[CR]codefont\\f[R]\nName of system font to use for math and code, respectively.\n.TP\n\\f[CR]linestretch\\f[R]\nadjusts line spacing, e.g.\\ \\f[CR]1.25\\f[R], \\f[CR]1.5\\f[R]\n.TP\n\\f[CR]linkcolor\\f[R], \\f[CR]filecolor\\f[R], \\f[CR]citecolor\\f[R]\ncolor for external links, internal links, and citation links,\nrespectively: expects a hexadecimal color code\n.SS Variables for ms\n.TP\n\\f[CR]fontfamily\\f[R]\n\\f[CR]A\\f[R] (Avant Garde), \\f[CR]B\\f[R] (Bookman), \\f[CR]C\\f[R]\n(Helvetica), \\f[CR]HN\\f[R] (Helvetica Narrow), \\f[CR]P\\f[R] (Palatino),\nor \\f[CR]T\\f[R] (Times New Roman).\nThis setting does not affect source code, which is always displayed\nusing monospace Courier.\nThese built\\-in fonts are limited in their coverage of characters.\nAdditional fonts may be installed using the script\n\\f[CR]install\\-font.sh\\f[R] provided by Peter Schaffter and documented\nin detail on his web site.\n.TP\n\\f[CR]indent\\f[R]\nparagraph indent (e.g.\\ \\f[CR]2m\\f[R])\n.TP\n\\f[CR]lineheight\\f[R]\nline height (e.g.\\ \\f[CR]12p\\f[R])\n.TP\n\\f[CR]pointsize\\f[R]\npoint size (e.g.\\ \\f[CR]10p\\f[R])\n.SS Variables set automatically\nPandoc sets these variables automatically in response to options or\ndocument contents; users can also modify them.\nThese vary depending on the output format, and include the following:\n.TP\n\\f[CR]body\\f[R]\nbody of document\n.TP\n\\f[CR]date\\-meta\\f[R]\nthe \\f[CR]date\\f[R] variable converted to ISO 8601 YYYY\\-MM\\-DD,\nincluded in all HTML based formats (dzslides, epub, html, html4, html5,\nrevealjs, s5, slideous, slidy).\nThe recognized formats for \\f[CR]date\\f[R] are: \\f[CR]mm/dd/yyyy\\f[R],\n\\f[CR]mm/dd/yy\\f[R], \\f[CR]yyyy\\-mm\\-dd\\f[R] (ISO 8601),\n\\f[CR]dd MM yyyy\\f[R] (e.g.\\ either \\f[CR]02 Apr 2018\\f[R] or\n\\f[CR]02 April 2018\\f[R]), \\f[CR]MM dd, yyyy\\f[R]\n(e.g.\\ \\f[CR]Apr. 02, 2018\\f[R] or\n\\f[CR]April 02, 2018),\\f[R]yyyy[mm[dd]]\\f[CR](e.g.\\f[R]20180402,\n\\f[CR]201804\\f[R] or \\f[CR]2018\\f[R]).\n.TP\n\\f[CR]header\\-includes\\f[R]\ncontents specified by \\f[CR]\\-H/\\-\\-include\\-in\\-header\\f[R] (may have\nmultiple values)\n.TP\n\\f[CR]include\\-before\\f[R]\ncontents specified by \\f[CR]\\-B/\\-\\-include\\-before\\-body\\f[R] (may have\nmultiple values)\n.TP\n\\f[CR]include\\-after\\f[R]\ncontents specified by \\f[CR]\\-A/\\-\\-include\\-after\\-body\\f[R] (may have\nmultiple values)\n.TP\n\\f[CR]meta\\-json\\f[R]\nJSON representation of all of the document\\(cqs metadata.\nField values are transformed to the selected output format.\n.TP\n\\f[CR]numbersections\\f[R]\nnon\\-null value if \\f[CR]\\-N/\\-\\-number\\-sections\\f[R] was specified\n.TP\n\\f[CR]sourcefile\\f[R], \\f[CR]outputfile\\f[R]\nsource and destination filenames, as given on the command line.\n\\f[CR]sourcefile\\f[R] can also be a list if input comes from multiple\nfiles, or empty if input is from stdin.\nYou can use the following snippet in your template to distinguish them:\n.RS\n.IP\n.EX\n$if(sourcefile)$\n$for(sourcefile)$\n$sourcefile$\n$endfor$\n$else$\n(stdin)\n$endif$\n.EE\nSimilarly, \\f[CR]outputfile\\f[R] can be \\f[CR]\\-\\f[R] if output goes to\nthe terminal.\nIf you need absolute paths, use e.g.\\ \\f[CR]$curdir$/$sourcefile$\\f[R].\n.RE\n.TP\n\\f[CR]pdf\\-engine\\f[R]\nname of PDF engine if provided using \\f[CR]\\-\\-pdf\\-engine\\f[R], or the\ndefault engine for the format if PDF output is requested.\n.TP\n\\f[CR]curdir\\f[R]\nworking directory from which pandoc is run.\n.TP\n\\f[CR]pandoc\\-version\\f[R]\npandoc version.\n.TP\n\\f[CR]toc\\f[R]\nnon\\-null value if \\f[CR]\\-\\-toc/\\-\\-table\\-of\\-contents\\f[R] was\nspecified\n.TP\n\\f[CR]toc\\-title\\f[R]\ntitle of table of contents (works only with EPUB, HTML, revealjs,\nopendocument, odt, docx, pptx, beamer, LaTeX).\nNote that in docx and pptx a custom \\f[CR]toc\\-title\\f[R] will be picked\nup from metadata, but cannot be set as a variable.\n.SH EXTENSIONS\nThe behavior of some of the readers and writers can be adjusted by\nenabling or disabling various extensions.\n.PP\nAn extension can be enabled by adding \\f[CR]+EXTENSION\\f[R] to the\nformat name and disabled by adding \\f[CR]\\-EXTENSION\\f[R].\nFor example, \\f[CR]\\-\\-from markdown_strict+footnotes\\f[R] is strict\nMarkdown with footnotes enabled, while\n\\f[CR]\\-\\-from markdown\\-footnotes\\-pipe_tables\\f[R] is pandoc\\(cqs\nMarkdown without footnotes or pipe tables.\n.PP\nThe Markdown reader and writer make by far the most use of extensions.\nExtensions only used by them are therefore covered in the section\nPandoc\\(cqs Markdown below (see Markdown variants for\n\\f[CR]commonmark\\f[R] and \\f[CR]gfm\\f[R]).\nIn the following, extensions that also work for other formats are\ncovered.\n.PP\nNote that Markdown extensions added to the \\f[CR]ipynb\\f[R] format\naffect Markdown cells in Jupyter notebooks (as do command\\-line options\nlike \\f[CR]\\-\\-markdown\\-headings\\f[R]).\n.SS Typography\n.SS Extension: \\f[CR]smart\\f[R]\nInterpret straight quotes as curly quotes, \\f[CR]\\-\\-\\-\\f[R] as\nem\\-dashes, \\f[CR]\\-\\-\\f[R] as en\\-dashes, and \\f[CR]...\\f[R] as\nellipses.\nNonbreaking spaces are inserted after certain abbreviations, such as\n\\(lqMr.\\(rq\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\ninput formats\n\\f[CR]markdown\\f[R], \\f[CR]commonmark\\f[R], \\f[CR]latex\\f[R],\n\\f[CR]mediawiki\\f[R], \\f[CR]org\\f[R], \\f[CR]rst\\f[R], \\f[CR]twiki\\f[R],\n\\f[CR]html\\f[R]\n.TP\noutput formats\n\\f[CR]markdown\\f[R], \\f[CR]latex\\f[R], \\f[CR]context\\f[R],\n\\f[CR]org\\f[R], \\f[CR]rst\\f[R]\n.TP\nenabled by default in\n\\f[CR]markdown\\f[R], \\f[CR]latex\\f[R], \\f[CR]context\\f[R] (both input\nand output)\n.PP\nNote: If you are \\f[I]writing\\f[R] Markdown, then the \\f[CR]smart\\f[R]\nextension has the reverse effect: what would have been curly quotes\ncomes out straight.\n.PP\nIn LaTeX, \\f[CR]smart\\f[R] means to use the standard TeX ligatures for\nquotation marks (\\f[CR]\\(ga\\(ga\\f[R] and \\f[CR]\\(aq\\(aq\\f[R] for double\nquotes, \\f[CR]\\(ga\\f[R] and \\f[CR]\\(aq\\f[R] for single quotes) and\ndashes (\\f[CR]\\-\\-\\f[R] for en\\-dash and \\f[CR]\\-\\-\\-\\f[R] for\nem\\-dash).\nIf \\f[CR]smart\\f[R] is disabled, then in reading LaTeX pandoc will parse\nthese characters literally.\nIn writing LaTeX, enabling \\f[CR]smart\\f[R] tells pandoc to use the\nligatures when possible; if \\f[CR]smart\\f[R] is disabled pandoc will use\nunicode quotation mark and dash characters.\n.SS Headings and sections\n.SS Extension: \\f[CR]auto_identifiers\\f[R]\nA heading without an explicitly specified identifier will be\nautomatically assigned a unique identifier based on the heading text.\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\ninput formats\n\\f[CR]markdown\\f[R], \\f[CR]latex\\f[R], \\f[CR]rst\\f[R],\n\\f[CR]mediawiki\\f[R], \\f[CR]textile\\f[R]\n.TP\noutput formats\n\\f[CR]markdown\\f[R], \\f[CR]muse\\f[R]\n.TP\nenabled by default in\n\\f[CR]markdown\\f[R], \\f[CR]muse\\f[R]\n.PP\nThe default algorithm used to derive the identifier from the heading\ntext is:\n.IP \\(bu 2\nRemove all formatting, links, etc.\n.IP \\(bu 2\nRemove all footnotes.\n.IP \\(bu 2\nRemove all non\\-alphanumeric characters, except underscores, hyphens,\nand periods.\n.IP \\(bu 2\nReplace all spaces and newlines with hyphens.\n.IP \\(bu 2\nConvert all alphabetic characters to lowercase.\n.IP \\(bu 2\nRemove everything up to the first letter (identifiers may not begin with\na number or punctuation mark).\n.IP \\(bu 2\nIf nothing is left after this, use the identifier \\f[CR]section\\f[R].\n.PP\nThus, for example,\n.RS -14n\n.IP\n.EX\n  Heading                       Identifier\n  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n  Heading identifiers in HTML   heading\\-identifiers\\-in\\-html\n  Maître d\\(aqhôtel                maître\\-dhôtel\n  *Dogs*?\\-\\-in *my* house?       dogs\\-\\-in\\-my\\-house\n  [HTML], [S5], or [RTF]?       html\\-s5\\-or\\-rtf\n  3. Applications               applications\n  33                            section\n.EE\n.RE\n.PP\nThese rules should, in most cases, allow one to determine the identifier\nfrom the heading text.\nThe exception is when several headings have the same text; in this case,\nthe first will get an identifier as described above; the second will get\nthe same identifier with \\f[CR]\\-1\\f[R] appended; the third with\n\\f[CR]\\-2\\f[R]; and so on.\n.PP\n(However, a different algorithm is used if\n\\f[CR]gfm_auto_identifiers\\f[R] is enabled; see below.)\n.PP\nThese identifiers are used to provide link targets in the table of\ncontents generated by the \\f[CR]\\-\\-toc|\\-\\-table\\-of\\-contents\\f[R]\noption.\nThey also make it easy to provide links from one section of a document\nto another.\nA link to this section, for example, might look like this:\n.IP\n.EX\nSee the section on\n[heading identifiers](#heading\\-identifiers\\-in\\-html\\-latex\\-and\\-context).\n.EE\n.PP\nNote, however, that this method of providing links to sections works\nonly in HTML, LaTeX, and ConTeXt formats.\n.PP\nIf the \\f[CR]\\-\\-section\\-divs\\f[R] option is specified, then each\nsection will be wrapped in a \\f[CR]section\\f[R] (or a \\f[CR]div\\f[R], if\n\\f[CR]html4\\f[R] was specified), and the identifier will be attached to\nthe enclosing \\f[CR]<section>\\f[R] (or \\f[CR]<div>\\f[R]) tag rather than\nthe heading itself.\nThis allows entire sections to be manipulated using JavaScript or\ntreated differently in CSS.\n.SS Extension: \\f[CR]ascii_identifiers\\f[R]\nCauses the identifiers produced by \\f[CR]auto_identifiers\\f[R] to be\npure ASCII.\nAccents are stripped off of accented Latin letters, and non\\-Latin\nletters are omitted.\n.SS Extension: \\f[CR]gfm_auto_identifiers\\f[R]\nChanges the algorithm used by \\f[CR]auto_identifiers\\f[R] to conform to\nGitHub\\(cqs method.\nSpaces are converted to dashes (\\f[CR]\\-\\f[R]), uppercase characters to\nlowercase characters, and punctuation characters other than\n\\f[CR]\\-\\f[R] and \\f[CR]_\\f[R] are removed.\nEmojis are replaced by their names.\n.SS Math Input\nThe extensions \\f[CR]tex_math_dollars\\f[R], \\f[CR]tex_math_gfm\\f[R],\n\\f[CR]tex_math_single_backslash\\f[R], and\n\\f[CR]tex_math_double_backslash\\f[R] are described in the section about\nPandoc\\(cqs Markdown.\n.PP\nHowever, they can also be used with HTML input.\nThis is handy for reading web pages formatted using MathJax, for\nexample.\n.SS Raw HTML/TeX\nThe following extensions are described in more detail in their\nrespective sections of Pandoc\\(cqs Markdown:\n.IP \\(bu 2\n\\f[CR]raw_html\\f[R] allows HTML elements which are not representable in\npandoc\\(cqs AST to be parsed as raw HTML.\nBy default, this is disabled for HTML input.\n.IP \\(bu 2\n\\f[CR]raw_tex\\f[R] allows raw LaTeX, TeX, and ConTeXt to be included in\na document.\nThis extension can be enabled/disabled for the following formats (in\naddition to \\f[CR]markdown\\f[R]):\n.RS 2\n.TP\ninput formats\n\\f[CR]latex\\f[R], \\f[CR]textile\\f[R], \\f[CR]html\\f[R] (environments,\n\\f[CR]\\(rsref\\f[R], and \\f[CR]\\(rseqref\\f[R] only), \\f[CR]ipynb\\f[R]\n.TP\noutput formats\n\\f[CR]textile\\f[R], \\f[CR]commonmark\\f[R]\n.PP\nNote: as applied to \\f[CR]ipynb\\f[R], \\f[CR]raw_html\\f[R] and\n\\f[CR]raw_tex\\f[R] affect not only raw TeX in Markdown cells, but data\nwith mime type \\f[CR]text/html\\f[R] in output cells.\nSince the \\f[CR]ipynb\\f[R] reader attempts to preserve the richest\npossible outputs when several options are given, you will get best\nresults if you disable \\f[CR]raw_html\\f[R] and \\f[CR]raw_tex\\f[R] when\nconverting to formats like \\f[CR]docx\\f[R] which don\\(cqt allow raw\n\\f[CR]html\\f[R] or \\f[CR]tex\\f[R].\n.RE\n.IP \\(bu 2\n\\f[CR]native_divs\\f[R] causes HTML \\f[CR]div\\f[R] elements to be parsed\nas native pandoc Div blocks.\nIf you want them to be parsed as raw HTML, use\n\\f[CR]\\-f html\\-native_divs+raw_html\\f[R].\n.IP \\(bu 2\n\\f[CR]native_spans\\f[R] causes HTML \\f[CR]span\\f[R] elements to be\nparsed as native pandoc Span inlines.\nIf you want them to be parsed as raw HTML, use\n\\f[CR]\\-f html\\-native_spans+raw_html\\f[R].\nIf you want to drop all \\f[CR]div\\f[R]s and \\f[CR]span\\f[R]s when\nconverting HTML to Markdown, you can use\n\\f[CR]pandoc \\-f html\\-native_divs\\-native_spans \\-t markdown\\f[R].\n.SS Literate Haskell support\n.SS Extension: \\f[CR]literate_haskell\\f[R]\nTreat the document as literate Haskell source.\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\ninput formats\n\\f[CR]markdown\\f[R], \\f[CR]rst\\f[R], \\f[CR]latex\\f[R]\n.TP\noutput formats\n\\f[CR]markdown\\f[R], \\f[CR]rst\\f[R], \\f[CR]latex\\f[R], \\f[CR]html\\f[R]\n.PP\nIf you append \\f[CR]+lhs\\f[R] (or \\f[CR]+literate_haskell\\f[R]) to one\nof the formats above, pandoc will treat the document as literate Haskell\nsource.\nThis means that\n.IP \\(bu 2\nIn Markdown input, \\(lqbird track\\(rq sections will be parsed as Haskell\ncode rather than block quotations.\nText between \\f[CR]\\(rsbegin{code}\\f[R] and \\f[CR]\\(rsend{code}\\f[R]\nwill also be treated as Haskell code.\nFor ATX\\-style headings the character `=' will be used instead of `#'.\n.IP \\(bu 2\nIn Markdown output, code blocks with classes \\f[CR]haskell\\f[R] and\n\\f[CR]literate\\f[R] will be rendered using bird tracks, and block\nquotations will be indented one space, so they will not be treated as\nHaskell code.\nIn addition, headings will be rendered setext\\-style (with underlines)\nrather than ATX\\-style (with `#' characters).\n(This is because ghc treats `#' characters in column 1 as introducing\nline numbers.)\n.IP \\(bu 2\nIn restructured text input, \\(lqbird track\\(rq sections will be parsed\nas Haskell code.\n.IP \\(bu 2\nIn restructured text output, code blocks with class \\f[CR]haskell\\f[R]\nwill be rendered using bird tracks.\n.IP \\(bu 2\nIn LaTeX input, text in \\f[CR]code\\f[R] environments will be parsed as\nHaskell code.\n.IP \\(bu 2\nIn LaTeX output, code blocks with class \\f[CR]haskell\\f[R] will be\nrendered inside \\f[CR]code\\f[R] environments.\n.IP \\(bu 2\nIn HTML output, code blocks with class \\f[CR]haskell\\f[R] will be\nrendered with class \\f[CR]literatehaskell\\f[R] and bird tracks.\n.PP\nExamples:\n.IP\n.EX\npandoc \\-f markdown+lhs \\-t html\n.EE\n.PP\nreads literate Haskell source formatted with Markdown conventions and\nwrites ordinary HTML (without bird tracks).\n.IP\n.EX\npandoc \\-f markdown+lhs \\-t html+lhs\n.EE\n.PP\nwrites HTML with the Haskell code in bird tracks, so it can be copied\nand pasted as literate Haskell source.\n.PP\nNote that GHC expects the bird tracks in the first column, so indented\nliterate code blocks (e.g.\\ inside an itemized environment) will not be\npicked up by the Haskell compiler.\n.SS Other extensions\n.SS Extension: \\f[CR]empty_paragraphs\\f[R]\nAllows empty paragraphs.\nBy default empty paragraphs are omitted.\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\ninput formats\n\\f[CR]docx\\f[R], \\f[CR]html\\f[R]\n.TP\noutput formats\n\\f[CR]docx\\f[R], \\f[CR]odt\\f[R], \\f[CR]opendocument\\f[R],\n\\f[CR]html\\f[R], \\f[CR]latex\\f[R]\n.SS Extension: \\f[CR]native_numbering\\f[R]\nEnables native numbering of figures and tables.\nEnumeration starts at 1.\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\noutput formats\n\\f[CR]odt\\f[R], \\f[CR]opendocument\\f[R], \\f[CR]docx\\f[R]\n.SS Extension: \\f[CR]xrefs_name\\f[R]\nLinks to headings, figures and tables inside the document are\nsubstituted with cross\\-references that will use the name or caption of\nthe referenced item.\nThe original link text is replaced once the generated document is\nrefreshed.\nThis extension can be combined with \\f[CR]xrefs_number\\f[R] in which\ncase numbers will appear before the name.\n.PP\nText in cross\\-references is only made consistent with the referenced\nitem once the document has been refreshed.\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\noutput formats\n\\f[CR]odt\\f[R], \\f[CR]opendocument\\f[R]\n.SS Extension: \\f[CR]xrefs_number\\f[R]\nLinks to headings, figures and tables inside the document are\nsubstituted with cross\\-references that will use the number of the\nreferenced item.\nThe original link text is discarded.\nThis extension can be combined with \\f[CR]xrefs_name\\f[R] in which case\nthe name or caption numbers will appear after the number.\n.PP\nFor the \\f[CR]xrefs_number\\f[R] to be useful heading numbers must be\nenabled in the generated document, also table and figure captions must\nbe enabled using for example the \\f[CR]native_numbering\\f[R] extension.\n.PP\nNumbers in cross\\-references are only visible in the final document once\nit has been refreshed.\n.PP\nThis extension can be enabled/disabled for the following formats:\n.TP\noutput formats\n\\f[CR]odt\\f[R], \\f[CR]opendocument\\f[R]\n.SS Extension: \\f[CR]styles\\f[R]\nWhen converting from docx, add \\f[CR]custom\\-styles\\f[R] attributes for\nall docx styles, regardless of whether pandoc understands the meanings\nof these styles.\nBecause attributes cannot be added directly to paragraphs or text in the\npandoc AST, paragraph styles will cause Divs to be created and character\nstyles will cause Spans to be created to hold the attributes.\n(Table styles will be added to the Table elements directly.)\nThis extension can be used with docx custom styles.\n.TP\ninput formats\n\\f[CR]docx\\f[R]\n.SS Extension: \\f[CR]amuse\\f[R]\nIn the \\f[CR]muse\\f[R] input format, this enables Text::Amuse extensions\nto Emacs Muse markup.\n.SS Extension: \\f[CR]raw_markdown\\f[R]\nIn the \\f[CR]ipynb\\f[R] input format, this causes Markdown cells to be\nincluded as raw Markdown blocks (allowing lossless round\\-tripping)\nrather than being parsed.\nUse this only when you are targeting \\f[CR]ipynb\\f[R] or a\nMarkdown\\-based output format.\n.SS Extension: \\f[CR]citations\\f[R] (typst)\nWhen the \\f[CR]citations\\f[R] extension is enabled in \\f[CR]typst\\f[R]\n(as it is by default), \\f[CR]typst\\f[R] citations will be parsed as\nnative pandoc citations, and native pandoc citations will be rendered as\n\\f[CR]typst\\f[R] citations.\n.SS Extension: \\f[CR]citations\\f[R] (org)\nWhen the \\f[CR]citations\\f[R] extension is enabled in \\f[CR]org\\f[R],\norg\\-cite and org\\-ref style citations will be parsed as native pandoc\ncitations, and org\\-cite citations will be used to render native pandoc\ncitations.\n.SS Extension: \\f[CR]citations\\f[R] (docx)\nWhen \\f[CR]citations\\f[R] is enabled in \\f[CR]docx\\f[R], citations\ninserted by Zotero or Mendeley or EndNote plugins will be parsed as\nnative pandoc citations.\n(Otherwise, the formatted citations generated by the bibliographic\nsoftware will be parsed as regular text.)\n.SS Extension: \\f[CR]fancy_lists\\f[R] (org)\nSome aspects of Pandoc\\(cqs Markdown fancy lists are also accepted in\n\\f[CR]org\\f[R] input, mimicking the option\n\\f[CR]org\\-list\\-allow\\-alphabetical\\f[R] in Emacs.\nAs in Org Mode, enabling this extension allows lowercase and uppercase\nalphabetical markers for ordered lists to be parsed in addition to\narabic ones.\nNote that for Org, this does not include roman numerals or the\n\\f[CR]#\\f[R] placeholder that are enabled by the extension in\nPandoc\\(cqs Markdown.\n.SS Extension: \\f[CR]element_citations\\f[R]\nIn the \\f[CR]jats\\f[R] output formats, this causes reference items to be\nreplaced with \\f[CR]<element\\-citation>\\f[R] elements.\nThese elements are not influenced by CSL styles, but all information on\nthe item is included in tags.\n.SS Extension: \\f[CR]ntb\\f[R]\nIn the \\f[CR]context\\f[R] output format this enables the use of Natural\nTables (TABLE) instead of the default Extreme Tables (xtables).\nNatural tables allow more fine\\-grained global customization but come at\na performance penalty compared to extreme tables.\n.SS Extension: \\f[CR]smart_quotes\\f[R] (org)\nInterpret straight quotes as curly quotes during parsing.\nWhen \\f[I]writing\\f[R] Org, then the \\f[CR]smart_quotes\\f[R] extension\nhas the reverse effect: what would have been curly quotes comes out\nstraight.\n.PP\nThis extension is implied if \\f[CR]smart\\f[R] is enabled.\n.SS Extension: \\f[CR]special_strings\\f[R] (org)\nInterpret \\f[CR]\\-\\-\\-\\f[R] as em\\-dashes, \\f[CR]\\-\\-\\f[R] as\nen\\-dashes, \\f[CR]\\(rs\\-\\f[R] as shy hyphen, and \\f[CR]...\\f[R] as\nellipses.\n.PP\nThis extension is implied if \\f[CR]smart\\f[R] is enabled.\n.SS Extension: \\f[CR]tagging\\f[R]\nEnabling this extension with \\f[CR]context\\f[R] output will produce\nmarkup suitable for the production of tagged PDFs.\nThis includes additional markers for paragraphs and alternative markup\nfor emphasized text.\nThe \\f[CR]emphasis\\-command\\f[R] template variable is set if the\nextension is enabled.\n.SH PANDOC\\(cqS MARKDOWN\nPandoc understands an extended and slightly revised version of John\nGruber\\(cqs Markdown syntax.\nThis document explains the syntax, noting differences from original\nMarkdown.\nExcept where noted, these differences can be suppressed by using the\n\\f[CR]markdown_strict\\f[R] format instead of \\f[CR]markdown\\f[R].\nExtensions can be enabled or disabled to specify the behavior more\ngranularly.\nThey are described in the following.\nSee also Extensions above, for extensions that work also on other\nformats.\n.SS Philosophy\nMarkdown is designed to be easy to write, and, even more importantly,\neasy to read:\n.RS\n.PP\nA Markdown\\-formatted document should be publishable as\\-is, as plain\ntext, without looking like it\\(cqs been marked up with tags or\nformatting instructions.\n.PD 0\n.P\n.PD\n\\(en John Gruber\n.RE\n.PP\nThis principle has guided pandoc\\(cqs decisions in finding syntax for\ntables, footnotes, and other extensions.\n.PP\nThere is, however, one respect in which pandoc\\(cqs aims are different\nfrom the original aims of Markdown.\nWhereas Markdown was originally designed with HTML generation in mind,\npandoc is designed for multiple output formats.\nThus, while pandoc allows the embedding of raw HTML, it discourages it,\nand provides other, non\\-HTMLish ways of representing important document\nelements like definition lists, tables, mathematics, and footnotes.\n.SS Paragraphs\nA paragraph is one or more lines of text followed by one or more blank\nlines.\nNewlines are treated as spaces, so you can reflow your paragraphs as you\nlike.\nIf you need a hard line break, put two or more spaces at the end of a\nline.\n.SS Extension: \\f[CR]escaped_line_breaks\\f[R]\nA backslash followed by a newline is also a hard line break.\nNote: in multiline and grid table cells, this is the only way to create\na hard line break, since trailing spaces in the cells are ignored.\n.SS Headings\nThere are two kinds of headings: Setext and ATX.\n.SS Setext\\-style headings\nA setext\\-style heading is a line of text \\(lqunderlined\\(rq with a row\nof \\f[CR]=\\f[R] signs (for a level\\-one heading) or \\f[CR]\\-\\f[R] signs\n(for a level\\-two heading):\n.IP\n.EX\nA level\\-one heading\n===================\n\nA level\\-two heading\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n.EE\n.PP\nThe heading text can contain inline formatting, such as emphasis (see\nInline formatting, below).\n.SS ATX\\-style headings\nAn ATX\\-style heading consists of one to six \\f[CR]#\\f[R] signs and a\nline of text, optionally followed by any number of \\f[CR]#\\f[R] signs.\nThe number of \\f[CR]#\\f[R] signs at the beginning of the line is the\nheading level:\n.IP\n.EX\n## A level\\-two heading\n\n### A level\\-three heading ###\n.EE\n.PP\nAs with setext\\-style headings, the heading text can contain formatting:\n.IP\n.EX\n# A level\\-one heading with a [link](/url) and *emphasis*\n.EE\n.SS Extension: \\f[CR]blank_before_header\\f[R]\nOriginal Markdown syntax does not require a blank line before a heading.\nPandoc does require this (except, of course, at the beginning of the\ndocument).\nThe reason for the requirement is that it is all too easy for a\n\\f[CR]#\\f[R] to end up at the beginning of a line by accident (perhaps\nthrough line wrapping).\nConsider, for example:\n.IP\n.EX\nI like several of their flavors of ice cream:\n#22, for example, and #5.\n.EE\n.SS Extension: \\f[CR]space_in_atx_header\\f[R]\nMany Markdown implementations do not require a space between the opening\n\\f[CR]#\\f[R]s of an ATX heading and the heading text, so that\n\\f[CR]#5 bolt\\f[R] and \\f[CR]#hashtag\\f[R] count as headings.\nWith this extension, pandoc does require the space.\n.SS Heading identifiers\nSee also the \\f[CR]auto_identifiers\\f[R] extension above.\n.SS Extension: \\f[CR]header_attributes\\f[R]\nHeadings can be assigned attributes using this syntax at the end of the\nline containing the heading text:\n.IP\n.EX\n{#identifier .class .class key=value key=value}\n.EE\n.PP\nThus, for example, the following headings will all be assigned the\nidentifier \\f[CR]foo\\f[R]:\n.IP\n.EX\n# My heading {#foo}\n\n## My heading ##    {#foo}\n\nMy other heading   {#foo}\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n.EE\n.PP\n(This syntax is compatible with PHP Markdown Extra.)\n.PP\nNote that although this syntax allows assignment of classes and\nkey/value attributes, writers generally don\\(cqt use all of this\ninformation.\nIdentifiers, classes, and key/value attributes are used in HTML and\nHTML\\-based formats such as EPUB and slidy.\nIdentifiers are used for labels and link anchors in the LaTeX, ConTeXt,\nTextile, Jira markup, and AsciiDoc writers.\n.PP\nHeadings with the class \\f[CR]unnumbered\\f[R] will not be numbered, even\nif \\f[CR]\\-\\-number\\-sections\\f[R] is specified.\nA single hyphen (\\f[CR]\\-\\f[R]) in an attribute context is equivalent to\n\\f[CR].unnumbered\\f[R], and preferable in non\\-English documents.\nSo,\n.IP\n.EX\n# My heading {\\-}\n.EE\n.PP\nis just the same as\n.IP\n.EX\n# My heading {.unnumbered}\n.EE\n.PP\nIf the \\f[CR]unlisted\\f[R] class is present in addition to\n\\f[CR]unnumbered\\f[R], the heading will not be included in a table of\ncontents.\n(Currently this feature is only implemented for certain formats: those\nbased on LaTeX and HTML, PowerPoint, and RTF.)\n.SS Extension: \\f[CR]implicit_header_references\\f[R]\nPandoc behaves as if reference links have been defined for each heading.\nSo, to link to a heading\n.IP\n.EX\n# Heading identifiers in HTML\n.EE\n.PP\nyou can simply write\n.IP\n.EX\n[Heading identifiers in HTML]\n.EE\n.PP\nor\n.IP\n.EX\n[Heading identifiers in HTML][]\n.EE\n.PP\nor\n.IP\n.EX\n[the section on heading identifiers][heading identifiers in\nHTML]\n.EE\n.PP\ninstead of giving the identifier explicitly:\n.IP\n.EX\n[Heading identifiers in HTML](#heading\\-identifiers\\-in\\-html)\n.EE\n.PP\nIf there are multiple headings with identical text, the corresponding\nreference will link to the first one only, and you will need to use\nexplicit links to link to the others, as described above.\n.PP\nLike regular reference links, these references are case\\-insensitive.\n.PP\nExplicit link reference definitions always take priority over implicit\nheading references.\nSo, in the following example, the link will point to \\f[CR]bar\\f[R], not\nto \\f[CR]#foo\\f[R]:\n.IP\n.EX\n# Foo\n\n[foo]: bar\n\nSee [foo]\n.EE\n.SS Block quotations\nMarkdown uses email conventions for quoting blocks of text.\nA block quotation is one or more paragraphs or other block elements\n(such as lists or headings), with each line preceded by a \\f[CR]>\\f[R]\ncharacter and an optional space.\n(The \\f[CR]>\\f[R] need not start at the left margin, but it should not\nbe indented more than three spaces.)\n.IP\n.EX\n> This is a block quote. This\n> paragraph has two lines.\n>\n> 1. This is a list inside a block quote.\n> 2. Second item.\n.EE\n.PP\nA \\(lqlazy\\(rq form, which requires the \\f[CR]>\\f[R] character only on\nthe first line of each block, is also allowed:\n.IP\n.EX\n> This is a block quote. This\nparagraph has two lines.\n\n> 1. This is a list inside a block quote.\n2. Second item.\n.EE\n.PP\nAmong the block elements that can be contained in a block quote are\nother block quotes.\nThat is, block quotes can be nested:\n.IP\n.EX\n> This is a block quote.\n>\n> > A block quote within a block quote.\n.EE\n.PP\nIf the \\f[CR]>\\f[R] character is followed by an optional space, that\nspace will be considered part of the block quote marker and not part of\nthe indentation of the contents.\nThus, to put an indented code block in a block quote, you need five\nspaces after the \\f[CR]>\\f[R]:\n.IP\n.EX\n>     code\n.EE\n.SS Extension: \\f[CR]blank_before_blockquote\\f[R]\nOriginal Markdown syntax does not require a blank line before a block\nquote.\nPandoc does require this (except, of course, at the beginning of the\ndocument).\nThe reason for the requirement is that it is all too easy for a\n\\f[CR]>\\f[R] to end up at the beginning of a line by accident (perhaps\nthrough line wrapping).\nSo, unless the \\f[CR]markdown_strict\\f[R] format is used, the following\ndoes not produce a nested block quote in pandoc:\n.IP\n.EX\n> This is a block quote.\n>> Not nested, since \\(gablank_before_blockquote\\(ga is enabled by default\n.EE\n.SS Verbatim (code) blocks\n.SS Indented code blocks\nA block of text indented four spaces (or one tab) is treated as verbatim\ntext: that is, special characters do not trigger special formatting, and\nall spaces and line breaks are preserved.\nFor example,\n.IP\n.EX\n    if (a > 3) {\n      moveShip(5 * gravity, DOWN);\n    }\n.EE\n.PP\nThe initial (four space or one tab) indentation is not considered part\nof the verbatim text, and is removed in the output.\n.PP\nNote: blank lines in the verbatim text need not begin with four spaces.\n.SS Fenced code blocks\n.SS Extension: \\f[CR]fenced_code_blocks\\f[R]\nIn addition to standard indented code blocks, pandoc supports\n\\f[I]fenced\\f[R] code blocks.\nThese begin with a row of three or more tildes (\\f[CR]\\(ti\\f[R]) and end\nwith a row of tildes that must be at least as long as the starting row.\nEverything between these lines is treated as code.\nNo indentation is necessary:\n.IP\n.EX\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\nif (a > 3) {\n  moveShip(5 * gravity, DOWN);\n}\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\n.EE\n.PP\nLike regular code blocks, fenced code blocks must be separated from\nsurrounding text by blank lines.\n.PP\nIf the code itself contains a row of tildes or backticks, just use a\nlonger row of tildes or backticks at the start and end:\n.IP\n.EX\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\ncode including tildes\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\n.EE\n.SS Extension: \\f[CR]backtick_code_blocks\\f[R]\nSame as \\f[CR]fenced_code_blocks\\f[R], but uses backticks\n(\\f[CR]\\(ga\\f[R]) instead of tildes (\\f[CR]\\(ti\\f[R]).\n.SS Extension: \\f[CR]fenced_code_attributes\\f[R]\nOptionally, you may attach attributes to fenced or backtick code block\nusing this syntax:\n.IP\n.EX\n\\(ti\\(ti\\(ti\\(ti {#mycode .haskell .numberLines startFrom=\\(dq100\\(dq}\nqsort []     = []\nqsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++\n               qsort (filter (>= x) xs)\n\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\\(ti\n.EE\n.PP\nHere \\f[CR]mycode\\f[R] is an identifier, \\f[CR]haskell\\f[R] and\n\\f[CR]numberLines\\f[R] are classes, and \\f[CR]startFrom\\f[R] is an\nattribute with value \\f[CR]100\\f[R].\nSome output formats can use this information to do syntax highlighting.\nCurrently, the only output formats that use this information are HTML,\nLaTeX, Docx, Ms, and PowerPoint.\nIf highlighting is supported for your output format and language, then\nthe code block above will appear highlighted, with numbered lines.\n(To see which languages are supported, type\n\\f[CR]pandoc \\-\\-list\\-highlight\\-languages\\f[R].)\nOtherwise, the code block above will appear as follows:\n.IP\n.EX\n<pre id=\\(dqmycode\\(dq class=\\(dqhaskell numberLines\\(dq startFrom=\\(dq100\\(dq>\n  <code>\n  ...\n  </code>\n</pre>\n.EE\n.PP\nThe \\f[CR]numberLines\\f[R] (or \\f[CR]number\\-lines\\f[R]) class will\ncause the lines of the code block to be numbered, starting with\n\\f[CR]1\\f[R] or the value of the \\f[CR]startFrom\\f[R] attribute.\nThe \\f[CR]lineAnchors\\f[R] (or \\f[CR]line\\-anchors\\f[R]) class will\ncause the lines to be clickable anchors in HTML output.\n.PP\nA shortcut form can also be used for specifying the language of the code\nblock:\n.IP\n.EX\n\\(ga\\(ga\\(gahaskell\nqsort [] = []\n\\(ga\\(ga\\(ga\n.EE\n.PP\nThis is equivalent to:\n.IP\n.EX\n\\(ga\\(ga\\(ga {.haskell}\nqsort [] = []\n\\(ga\\(ga\\(ga\n.EE\n.PP\nThis shortcut form may be combined with attributes:\n.IP\n.EX\n\\(ga\\(ga\\(gahaskell {.numberLines}\nqsort [] = []\n\\(ga\\(ga\\(ga\n.EE\n.PP\nWhich is equivalent to:\n.IP\n.EX\n\\(ga\\(ga\\(ga {.haskell .numberLines}\nqsort [] = []\n\\(ga\\(ga\\(ga\n.EE\n.PP\nIf the \\f[CR]fenced_code_attributes\\f[R] extension is disabled, but\ninput contains class attribute(s) for the code block, the first class\nattribute will be printed after the opening fence as a bare word.\n.PP\nTo prevent all highlighting, use the\n\\f[CR]\\-\\-syntax\\-highlighting=none\\f[R] option.\nTo set the highlighting style or method, use\n\\f[CR]\\-\\-syntax\\-highlighting\\f[R].\nFor more information on highlighting, see Syntax highlighting, below.\n.SS Line blocks\n.SS Extension: \\f[CR]line_blocks\\f[R]\nA line block is a sequence of lines beginning with a vertical bar\n(\\f[CR]|\\f[R]) followed by a space.\nThe division into lines will be preserved in the output, as will any\nleading spaces; otherwise, the lines will be formatted as Markdown.\nThis is useful for verse and addresses:\n.IP\n.EX\n| The limerick packs laughs anatomical\n| In space that is quite economical.\n|    But the good ones I\\(aqve seen\n|    So seldom are clean\n| And the clean ones so seldom are comical\n\n| 200 Main St.\n| Berkeley, CA 94718\n.EE\n.PP\nThe lines can be hard\\-wrapped if needed, but the continuation line must\nbegin with a space.\n.IP\n.EX\n| The Right Honorable Most Venerable and Righteous Samuel L.\n  Constable, Jr.\n| 200 Main St.\n| Berkeley, CA 94718\n.EE\n.PP\nInline formatting (such as emphasis) is allowed in the content (though\nit can\\(cqt cross line boundaries).\nBlock\\-level formatting (such as block quotes or lists) is not\nrecognized.\n.PP\nThis syntax is borrowed from reStructuredText.\n.SS Lists\n.SS Bullet lists\nA bullet list is a list of bulleted list items.\nA bulleted list item begins with a bullet (\\f[CR]*\\f[R], \\f[CR]+\\f[R],\nor \\f[CR]\\-\\f[R]).\nHere is a simple example:\n.IP\n.EX\n* one\n* two\n* three\n.EE\n.PP\nThis will produce a \\(lqcompact\\(rq list.\nIf you want a \\(lqloose\\(rq list, in which each item is formatted as a\nparagraph, put spaces between the items:\n.IP\n.EX\n* one\n\n* two\n\n* three\n.EE\n.PP\nThe bullets need not be flush with the left margin; they may be indented\none, two, or three spaces.\nThe bullet must be followed by whitespace.\n.PP\nList items look best if subsequent lines are flush with the first line\n(after the bullet):\n.IP\n.EX\n* here is my first\n  list item.\n* and my second.\n.EE\n.PP\nBut Markdown also allows a \\(lqlazy\\(rq format:\n.IP\n.EX\n* here is my first\nlist item.\n* and my second.\n.EE\n.SS Block content in list items\nA list item may contain multiple paragraphs and other block\\-level\ncontent.\nHowever, subsequent paragraphs must be preceded by a blank line and\nindented to line up with the first non\\-space content after the list\nmarker.\n.IP\n.EX\n  * First paragraph.\n\n    Continued.\n\n  * Second paragraph. With a code block, which must be indented\n    eight spaces:\n\n        { code }\n.EE\n.PP\nException: if the list marker is followed by an indented code block,\nwhich must begin 5 spaces after the list marker, then subsequent\nparagraphs must begin two columns after the last character of the list\nmarker:\n.IP\n.EX\n*     code\n\n  continuation paragraph\n.EE\n.PP\nList items may include other lists.\nIn this case the preceding blank line is optional.\nThe nested list must be indented to line up with the first non\\-space\ncharacter after the list marker of the containing list item.\n.IP\n.EX\n* fruits\n  + apples\n    \\- macintosh\n    \\- red delicious\n  + pears\n  + peaches\n* vegetables\n  + broccoli\n  + chard\n.EE\n.PP\nAs noted above, Markdown allows you to write list items \\(lqlazily,\\(rq\ninstead of indenting continuation lines.\nHowever, if there are multiple paragraphs or other blocks in a list\nitem, the first line of each must be indented.\n.IP\n.EX\n+ A lazy, lazy, list\nitem.\n\n+ Another one; this looks\nbad but is legal.\n\n    Second paragraph of second\nlist item.\n.EE\n.SS Ordered lists\nOrdered lists work just like bulleted lists, except that the items begin\nwith enumerators rather than bullets.\n.PP\nIn original Markdown, enumerators are decimal numbers followed by a\nperiod and a space.\nThe numbers themselves are ignored, so there is no difference between\nthis list:\n.IP\n.EX\n1.  one\n2.  two\n3.  three\n.EE\n.PP\nand this one:\n.IP\n.EX\n5.  one\n7.  two\n1.  three\n.EE\n.SS Extension: \\f[CR]fancy_lists\\f[R]\nUnlike original Markdown, pandoc allows ordered list items to be marked\nwith uppercase and lowercase letters and roman numerals, in addition to\nArabic numerals.\nList markers may be enclosed in parentheses or followed by a single\nright\\-parenthesis or period.\nThey must be separated from the text that follows by at least one space,\nand, if the list marker is a capital letter with a period, by at least\ntwo spaces.\n.PP\nThe \\f[CR]fancy_lists\\f[R] extension also allows `\\f[CR]#\\f[R]' to be\nused as an ordered list marker in place of a numeral:\n.IP\n.EX\n#. one\n#. two\n.EE\n.PP\nNote: the `\\f[CR]#\\f[R]' ordered list marker doesn\\(cqt work with\n\\f[CR]commonmark\\f[R].\n.SS Extension: \\f[CR]startnum\\f[R]\nPandoc also pays attention to the type of list marker used, and to the\nstarting number, and both of these are preserved where possible in the\noutput format.\nThus, the following yields a list with numbers followed by a single\nparenthesis, starting with 9, and a sublist with lowercase roman\nnumerals:\n.IP\n.EX\n 9)  Ninth\n10)  Tenth\n11)  Eleventh\n       i. subone\n      ii. subtwo\n     iii. subthree\n.EE\n.PP\nPandoc will start a new list each time a different type of list marker\nis used.\nSo, the following will create three lists:\n.IP\n.EX\n(2) Two\n(5) Three\n1.  Four\n*   Five\n.EE\n.PP\nIf default list markers are desired, use \\f[CR]#.\\f[R]:\n.IP\n.EX\n#.  one\n#.  two\n#.  three\n.EE\n.SS Extension: \\f[CR]task_lists\\f[R]\nPandoc supports task lists, using the syntax of GitHub\\-Flavored\nMarkdown.\n.IP\n.EX\n\\- [ ] an unchecked task list item\n\\- [x] checked item\n.EE\n.SS Definition lists\n.SS Extension: \\f[CR]definition_lists\\f[R]\nPandoc supports definition lists, using the syntax of PHP Markdown Extra\nwith some extensions.\n.IP\n.EX\nTerm 1\n\n:   Definition 1\n\nTerm 2 with *inline markup*\n\n:   Definition 2\n\n        { some code, part of Definition 2 }\n\n    Third paragraph of definition 2.\n.EE\n.PP\nEach term must fit on one line, which may optionally be followed by a\nblank line, and must be followed by one or more definitions.\nA definition begins with a colon or tilde, which may be indented one or\ntwo spaces.\n.PP\nA term may have multiple definitions, and each definition may consist of\none or more block elements (paragraph, code block, list, etc.), each\nindented four spaces or one tab stop.\nThe body of the definition (not including the first line) should be\nindented four spaces.\nHowever, as with other Markdown lists, you can \\(lqlazily\\(rq omit\nindentation except at the beginning of a paragraph or other block\nelement:\n.IP\n.EX\nTerm 1\n\n:   Definition\nwith lazy continuation.\n\n    Second paragraph of the definition.\n.EE\n.PP\nIf you leave space before the definition (as in the example above), the\ntext of the definition will be treated as a paragraph.\nIn some output formats, this will mean greater spacing between\nterm/definition pairs.\nFor a more compact definition list, omit the space before the\ndefinition:\n.IP\n.EX\nTerm 1\n  \\(ti Definition 1\n\nTerm 2\n  \\(ti Definition 2a\n  \\(ti Definition 2b\n.EE\n.PP\nNote that space between items in a definition list is required.\n.SS Numbered example lists\n.SS Extension: \\f[CR]example_lists\\f[R]\nThe special list marker \\f[CR]\\(at\\f[R] can be used for sequentially\nnumbered examples.\nThe first list item with a \\f[CR]\\(at\\f[R] marker will be numbered `1',\nthe next `2', and so on, throughout the document.\nThe numbered examples need not occur in a single list; each new list\nusing \\f[CR]\\(at\\f[R] will take up where the last stopped.\nSo, for example:\n.IP\n.EX\n(\\(at)  My first example will be numbered (1).\n(\\(at)  My second example will be numbered (2).\n\nExplanation of examples.\n\n(\\(at)  My third example will be numbered (3).\n.EE\n.PP\nNumbered examples can be labeled and referred to elsewhere in the\ndocument:\n.IP\n.EX\n(\\(atgood)  This is a good example.\n\nAs (\\(atgood) illustrates, ...\n.EE\n.PP\nThe label can be any string of alphanumeric characters, underscores, or\nhyphens.\n.PP\nContinuation paragraphs in example lists must always be indented four\nspaces, regardless of the length of the list marker.\nThat is, example lists always behave as if the\n\\f[CR]four_space_rule\\f[R] extension is set.\nThis is because example labels tend to be long, and indenting content to\nthe first non\\-space character after the label would be awkward.\n.PP\nYou can repeat an earlier numbered example by re\\-using its label:\n.IP\n.EX\n(\\(atfoo) Sample sentence.\n\nIntervening text...\n\nThis theory can explain the case we saw earlier (repeated):\n\n(\\(atfoo) Sample sentence.\n.EE\n.PP\nThis only works reliably, though, if the repeated item is in a list by\nitself, because each numbered example list will be numbered continuously\nfrom its starting number.\n.SS Ending a list\nWhat if you want to put an indented code block after a list?\n.IP\n.EX\n\\-   item one\n\\-   item two\n\n    { my code block }\n.EE\n.PP\nTrouble!\nHere pandoc (like other Markdown implementations) will treat\n\\f[CR]{ my code block }\\f[R] as the second paragraph of item two, and\nnot as a code block.\n.PP\nTo \\(lqcut off\\(rq the list after item two, you can insert some\nnon\\-indented content, like an HTML comment, which won\\(cqt produce\nvisible output in any format:\n.IP\n.EX\n\\-   item one\n\\-   item two\n\n<!\\-\\- end of list \\-\\->\n\n    { my code block }\n.EE\n.PP\nYou can use the same trick if you want two consecutive lists instead of\none big list:\n.IP\n.EX\n1.  one\n2.  two\n3.  three\n\n<!\\-\\- \\-\\->\n\n1.  uno\n2.  dos\n3.  tres\n.EE\n.SS Horizontal rules\nA line containing a row of three or more \\f[CR]*\\f[R], \\f[CR]\\-\\f[R], or\n\\f[CR]_\\f[R] characters (optionally separated by spaces) produces a\nhorizontal rule:\n.IP\n.EX\n*  *  *  *\n\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n.EE\n.PP\nWe strongly recommend that horizontal rules be separated from\nsurrounding text by blank lines.\nIf a horizontal rule is not followed by a blank line, pandoc may try to\ninterpret the lines that follow as a YAML metadata block or a table.\n.SS Tables\nFour kinds of tables may be used.\nThe first three kinds presuppose the use of a fixed\\-width font, such as\nCourier.\nThe fourth kind can be used with proportionally spaced fonts, as it does\nnot require lining up columns.\n.SS Extension: \\f[CR]table_captions\\f[R]\nA caption may optionally be provided with all 4 kinds of tables (as\nillustrated in the examples below).\nA caption is a paragraph beginning with the string \\f[CR]Table:\\f[R] (or\n\\f[CR]table:\\f[R] or just \\f[CR]:\\f[R]), which will be stripped off.\nIt may appear either before or after the table.\n.SS Extension: \\f[CR]simple_tables\\f[R]\nSimple tables look like this:\n.IP\n.EX\n  Right     Left     Center     Default\n\\-\\-\\-\\-\\-\\-\\-     \\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-   \\-\\-\\-\\-\\-\\-\\-\n     12     12        12            12\n    123     123       123          123\n      1     1          1             1\n\nTable:  Demonstration of simple table syntax.\n.EE\n.PP\nThe header and table rows must each fit on one line.\nColumn alignments are determined by the position of the header text\nrelative to the dashed line below it:\n.IP \\(bu 2\nIf the dashed line is flush with the header text on the right side but\nextends beyond it on the left, the column is right\\-aligned.\n.IP \\(bu 2\nIf the dashed line is flush with the header text on the left side but\nextends beyond it on the right, the column is left\\-aligned.\n.IP \\(bu 2\nIf the dashed line extends beyond the header text on both sides, the\ncolumn is centered.\n.IP \\(bu 2\nIf the dashed line is flush with the header text on both sides, the\ndefault alignment is used (in most cases, this will be left).\n.PP\nThe table must end with a blank line, or a line of dashes followed by a\nblank line.\n.PP\nThe column header row may be omitted, provided a dashed line is used to\nend the table.\nFor example:\n.IP\n.EX\n\\-\\-\\-\\-\\-\\-\\-     \\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-   \\-\\-\\-\\-\\-\\-\\-\n     12     12        12             12\n    123     123       123           123\n      1     1          1              1\n\\-\\-\\-\\-\\-\\-\\-     \\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-   \\-\\-\\-\\-\\-\\-\\-\n.EE\n.PP\nWhen the header row is omitted, column alignments are determined on the\nbasis of the first line of the table body.\nSo, in the tables above, the columns would be right, left, center, and\nright aligned, respectively.\n.SS Extension: \\f[CR]multiline_tables\\f[R]\nMultiline tables allow header and table rows to span multiple lines of\ntext (but cells that span multiple columns or rows of the table are not\nsupported).\nHere is an example:\n.IP\n.EX\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n Centered   Default           Right Left\n  Header    Aligned         Aligned Aligned\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n   First    row                12.0 Example of a row that\n                                    spans multiple lines.\n\n  Second    row                 5.0 Here\\(aqs another one. Note\n                                    the blank line between\n                                    rows.\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\nTable: Here\\(aqs the caption. It, too, may span\nmultiple lines.\n.EE\n.PP\nThese work like simple tables, but with the following differences:\n.IP \\(bu 2\nThey must begin with a row of dashes, before the header text (unless the\nheader row is omitted).\n.IP \\(bu 2\nThey must end with a row of dashes, then a blank line.\n.IP \\(bu 2\nThe rows must be separated by blank lines.\n.PP\nIn multiline tables, the table parser pays attention to the widths of\nthe columns, and the writers try to reproduce these relative widths in\nthe output.\nSo, if you find that one of the columns is too narrow in the output, try\nwidening it in the Markdown source.\n.PP\nThe header may be omitted in multiline tables as well as simple tables:\n.IP\n.EX\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n   First    row                12.0 Example of a row that\n                                    spans multiple lines.\n\n  Second    row                 5.0 Here\\(aqs another one. Note\n                                    the blank line between\n                                    rows.\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\n: Here\\(aqs a multiline table without a header.\n.EE\n.PP\nIt is possible for a multiline table to have just one row, but the row\nshould be followed by a blank line (and then the row of dashes that ends\nthe table), or the table may be interpreted as a simple table.\n.SS Extension: \\f[CR]grid_tables\\f[R]\nGrid tables look like this:\n.IP\n.EX\n: Sample grid table.\n\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n| Fruit         | Price         | Advantages         |\n+===============+===============+====================+\n| Bananas       | $1.34         | \\- built\\-in wrapper |\n|               |               | \\- bright color     |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n| Oranges       | $2.10         | \\- cures scurvy     |\n|               |               | \\- tasty            |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n.EE\n.PP\nThe row of \\f[CR]=\\f[R]s separates the header from the table body, and\ncan be omitted for a headerless table.\nThe cells of grid tables may contain arbitrary block elements (multiple\nparagraphs, code blocks, lists, etc.).\n.PP\nCells can span multiple columns or rows:\n.IP\n.EX\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n| Property            | Earth    |\n+=============+=======+==========+\n|             | min   | \\-89.2 °C |\n| Temperature +\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n| 1961\\-1990   | mean  | 14 °C    |\n|             +\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n|             | max   | 56.7 °C  |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n.EE\n.PP\nA table header may contain more than one row:\n.IP\n.EX\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n| Location            | Temperature 1961\\-1990 |\n|                     | in degree Celsius     |\n|                     +\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\n|                     | min   | mean  | max   |\n+=====================+=======+=======+=======+\n| Antarctica          | \\-89.2 | N/A   | 19.8  |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\n| Earth               | \\-89.2 | 14    | 56.7  |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-+\n.EE\n.PP\nAlignments can be specified as with pipe tables, by putting colons at\nthe boundaries of the separator line after the header:\n.IP\n.EX\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n| Right         | Left          | Centered           |\n+==============:+:==============+:==================:+\n| Bananas       | $1.34         | built\\-in wrapper   |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n.EE\n.PP\nFor headerless tables, the colons go on the top line instead:\n.IP\n.EX\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-:+:\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+:\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-:+\n| Right         | Left          | Centered           |\n+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n.EE\n.PP\nA table foot can be defined by enclosing it with separator lines that\nuse \\f[CR]=\\f[R] instead of \\f[CR]\\-\\f[R]:\n.IP\n.EX\n +\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n | Fruit         | Price         |\n +===============+===============+\n | Bananas       | $1.34         |\n +\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-+\n | Oranges       | $2.10         |\n +===============+===============+\n | Sum           | $3.44         |\n +===============+===============+\n.EE\n.PP\nThe foot must always be placed at the very bottom of the table.\n.PP\nGrid tables can be created easily using Emacs\\(cq table\\-mode\n(\\f[CR]M\\-x table\\-insert\\f[R]).\n.SS Extension: \\f[CR]pipe_tables\\f[R]\nPipe tables look like this:\n.IP\n.EX\n| Right | Left | Default | Center |\n|\\-\\-\\-\\-\\-\\-:|:\\-\\-\\-\\-\\-|\\-\\-\\-\\-\\-\\-\\-\\-\\-|:\\-\\-\\-\\-\\-\\-:|\n|   12  |  12  |    12   |    12  |\n|  123  |  123 |   123   |   123  |\n|    1  |    1 |     1   |     1  |\n\n  : Demonstration of pipe table syntax.\n.EE\n.PP\nThe syntax is identical to PHP Markdown Extra tables.\nThe beginning and ending pipe characters are optional, but pipes are\nrequired between all columns.\nThe colons indicate column alignment as shown.\nThe header cannot be omitted.\nTo simulate a headerless table, include a header with blank cells.\n.PP\nSince the pipes indicate column boundaries, columns need not be\nvertically aligned, as they are in the above example.\nSo, this is a perfectly legal (though ugly) pipe table:\n.IP\n.EX\nfruit| price\n\\-\\-\\-\\-\\-|\\-\\-\\-\\-\\-:\napple|2.05\npear|1.37\norange|3.09\n.EE\n.PP\nThe cells of pipe tables cannot contain block elements like paragraphs\nand lists, and cannot span multiple lines.\nIf any line of the Markdown source is longer than the column width (see\n\\f[CR]\\-\\-columns\\f[R]), then the table will take up the full text width\nand the cell contents will wrap, with the relative cell widths\ndetermined by the number of dashes in the line separating the table\nheader from the table body.\n(For example \\f[CR]\\-\\-\\-|\\-\\f[R] would make the first column 3/4 and\nthe second column 1/4 of the full text width.)\nOn the other hand, if no lines are wider than column width, then cell\ncontents will not be wrapped, and the cells will be sized to their\ncontents.\n.PP\nNote: pandoc also recognizes pipe tables of the following form, as can\nbe produced by Emacs\\(cq orgtbl\\-mode:\n.IP\n.EX\n| One | Two   |\n|\\-\\-\\-\\-\\-+\\-\\-\\-\\-\\-\\-\\-|\n| my  | table |\n| is  | nice  |\n.EE\n.PP\nThe difference is that \\f[CR]+\\f[R] is used instead of \\f[CR]|\\f[R].\nOther orgtbl features are not supported.\nIn particular, to get non\\-default column alignment, you\\(cqll need to\nadd colons as above.\n.SS Extension: \\f[CR]table_attributes\\f[R]\nAttributes may be attached to tables by including them at the end of the\ncaption.\n(For the syntax, see \\f[CR]header_attributes\\f[R].)\n.IP\n.EX\n  : Here\\(aqs the caption. {#ident .class key=\\(dqvalue\\(dq}\n.EE\n.SS Metadata blocks\n.SS Extension: \\f[CR]pandoc_title_block\\f[R]\nIf the file begins with a title block\n.IP\n.EX\n% title\n% author(s) (separated by semicolons)\n% date\n.EE\n.PP\nit will be parsed as bibliographic information, not regular text.\n(It will be used, for example, in the title of standalone LaTeX or HTML\noutput.)\nThe block may contain just a title, a date and an author, or all three\nelements.\nIf you want to include an author but no title, or a title and a date but\nno author, you need a blank line:\n.IP\n.EX\n%\n% Author\n.EE\n.IP\n.EX\n% My title\n%\n% June 15, 2006\n.EE\n.PP\nThe title may occupy multiple lines, but continuation lines must begin\nwith leading space, thus:\n.IP\n.EX\n% My title\n  on multiple lines\n.EE\n.PP\nIf a document has multiple authors, the authors may be put on separate\nlines with leading space, or separated by semicolons, or both.\nSo, all of the following are equivalent:\n.IP\n.EX\n% Author One\n  Author Two\n.EE\n.IP\n.EX\n% Author One; Author Two\n.EE\n.IP\n.EX\n% Author One;\n  Author Two\n.EE\n.PP\nThe date must fit on one line.\n.PP\nAll three metadata fields may contain standard inline formatting\n(italics, links, footnotes, etc.).\n.PP\nTitle blocks will always be parsed, but they will affect the output only\nwhen the \\f[CR]\\-\\-standalone\\f[R] (\\f[CR]\\-s\\f[R]) option is chosen.\nIn HTML output, titles will appear twice: once in the document\nhead\\(emthis is the title that will appear at the top of the window in a\nbrowser\\(emand once at the beginning of the document body.\nThe title in the document head can have an optional prefix attached\n(\\f[CR]\\-\\-title\\-prefix\\f[R] or \\f[CR]\\-T\\f[R] option).\nThe title in the body appears as an H1 element with class \\(lqtitle\\(rq,\nso it can be suppressed or reformatted with CSS.\nIf a title prefix is specified with \\f[CR]\\-T\\f[R] and no title block\nappears in the document, the title prefix will be used by itself as the\nHTML title.\n.PP\nThe man page writer extracts a title, man page section number, and other\nheader and footer information from the title line.\nThe title is assumed to be the first word on the title line, which may\noptionally end with a (single\\-digit) section number in parentheses.\n(There should be no space between the title and the parentheses.)\nAnything after this is assumed to be additional footer and header text.\nA single pipe character (\\f[CR]|\\f[R]) should be used to separate the\nfooter text from the header text.\nThus,\n.IP\n.EX\n% PANDOC(1)\n.EE\n.PP\nwill yield a man page with the title \\f[CR]PANDOC\\f[R] and section 1.\n.IP\n.EX\n% PANDOC(1) Pandoc User Manuals\n.EE\n.PP\nwill also have \\(lqPandoc User Manuals\\(rq in the footer.\n.IP\n.EX\n% PANDOC(1) Pandoc User Manuals | Version 4.0\n.EE\n.PP\nwill also have \\(lqVersion 4.0\\(rq in the header.\n.SS Extension: \\f[CR]yaml_metadata_block\\f[R]\nA YAML metadata block is a valid YAML object, delimited by a line of\nthree hyphens (\\f[CR]\\-\\-\\-\\f[R]) at the top and a line of three hyphens\n(\\f[CR]\\-\\-\\-\\f[R]) or three dots (\\f[CR]...\\f[R]) at the bottom.\nThe initial line \\f[CR]\\-\\-\\-\\f[R] must not be followed by a blank line.\nA YAML metadata block may occur anywhere in the document, but if it is\nnot at the beginning, it must be preceded by a blank line.\n(Note that JSON may be used as well, because JSON is a subset of YAML.)\n.PP\nNote that, because of the way pandoc concatenates input files when\nseveral are provided, you may also keep the metadata in a separate YAML\nfile and pass it to pandoc as an argument, along with your Markdown\nfiles:\n.IP\n.EX\npandoc chap1.md chap2.md chap3.md metadata.yaml \\-s \\-o book.html\n.EE\n.PP\nJust be sure that the YAML file begins with \\f[CR]\\-\\-\\-\\f[R] and ends\nwith \\f[CR]\\-\\-\\-\\f[R] or \\f[CR]...\\f[R].\nAlternatively, you can use the \\f[CR]\\-\\-metadata\\-file\\f[R] option.\nUsing that approach however, you cannot reference content (like\nfootnotes) from the main Markdown input document.\n.PP\nMetadata will be taken from the fields of the YAML object and added to\nany existing document metadata.\nMetadata can contain lists and objects (nested arbitrarily), but all\nstring scalars will be interpreted as Markdown.\nFields with names ending in an underscore will be ignored by pandoc.\n(They may be given a role by external processors.)\nField names must not be interpretable as YAML numbers or boolean values\n(so, for example, \\f[CR]yes\\f[R], \\f[CR]True\\f[R], and \\f[CR]15\\f[R]\ncannot be used as field names).\n.PP\nA document may contain multiple metadata blocks.\nIf two metadata blocks attempt to set the same field, the value from the\nsecond block will be taken.\n.PP\nEach metadata block is handled internally as an independent YAML\ndocument.\nThis means, for example, that any YAML anchors defined in a block cannot\nbe referenced in another block.\n.PP\nWhen pandoc is used with \\f[CR]\\-t markdown\\f[R] to create a Markdown\ndocument, a YAML metadata block will be produced only if the\n\\f[CR]\\-s/\\-\\-standalone\\f[R] option is used.\nAll of the metadata will appear in a single block at the beginning of\nthe document.\n.PP\nNote that YAML escaping rules must be followed.\nThus, for example, if a title contains a colon, it must be quoted, and\nif it contains a backslash escape, then it must be ensured that it is\nnot treated as a YAML escape sequence.\nThe pipe character (\\f[CR]|\\f[R]) can be used to begin an indented block\nthat will be interpreted literally, without need for escaping.\nThis form is necessary when the field contains blank lines or\nblock\\-level formatting:\n.IP\n.EX\n\\-\\-\\-\ntitle:  \\(aqThis is the title: it contains a colon\\(aq\nauthor:\n\\- Author One\n\\- Author Two\nkeywords: [nothing, nothingness]\nabstract: |\n  This is the abstract.\n\n  It consists of two paragraphs.\n\\&...\n.EE\n.PP\nThe literal block after the \\f[CR]|\\f[R] must be indented relative to\nthe line containing the \\f[CR]|\\f[R].\nIf it is not, the YAML will be invalid and pandoc will not interpret it\nas metadata.\nFor an overview of the complex rules governing YAML, see the Wikipedia\nentry on YAML syntax.\n.PP\nTemplate variables will be set automatically from the metadata.\nThus, for example, in writing HTML, the variable \\f[CR]abstract\\f[R]\nwill be set to the HTML equivalent of the Markdown in the\n\\f[CR]abstract\\f[R] field:\n.IP\n.EX\n<p>This is the abstract.</p>\n<p>It consists of two paragraphs.</p>\n.EE\n.PP\nVariables can contain arbitrary YAML structures, but the template must\nmatch this structure.\nThe \\f[CR]author\\f[R] variable in the default templates expects a simple\nlist or string, but can be changed to support more complicated\nstructures.\nThe following combination, for example, would add an affiliation to the\nauthor if one is given:\n.IP\n.EX\n\\-\\-\\-\ntitle: The document title\nauthor:\n\\- name: Author One\n  affiliation: University of Somewhere\n\\- name: Author Two\n  affiliation: University of Nowhere\n\\&...\n.EE\n.PP\nTo use the structured authors in the example above, you would need a\ncustom template:\n.IP\n.EX\n$for(author)$\n$if(author.name)$\n$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$\n$else$\n$author$\n$endif$\n$endfor$\n.EE\n.PP\nRaw content to include in the document\\(cqs header may be specified\nusing \\f[CR]header\\-includes\\f[R]; however, it is important to mark up\nthis content as raw code for a particular output format, using the\n\\f[CR]raw_attribute\\f[R] extension, or it will be interpreted as\nMarkdown.\nFor example:\n.IP\n.EX\nheader\\-includes:\n\\- |\n  \\(ga\\(ga\\(ga{=latex}\n  \\(rslet\\(rsoldsection\\(rssection\n  \\(rsrenewcommand{\\(rssection}[1]{\\(rsclearpage\\(rsoldsection{#1}}\n  \\(ga\\(ga\\(ga\n.EE\n.PP\nNote: the \\f[CR]yaml_metadata_block\\f[R] extension works with\n\\f[CR]commonmark\\f[R] as well as \\f[CR]markdown\\f[R] (and it is enabled\nby default in \\f[CR]gfm\\f[R] and \\f[CR]commonmark_x\\f[R]).\nHowever, in these formats the following restrictions apply:\n.IP \\(bu 2\nThe YAML metadata block must occur at the beginning of the document (and\nthere can be only one).\nIf multiple files are given as arguments to pandoc, only the first can\nbe a YAML metadata block.\n.IP \\(bu 2\nThe leaf nodes of the YAML structure are parsed in isolation from each\nother and from the rest of the document.\nSo, for example, you can\\(cqt use a reference link in these contexts if\nthe link definition is somewhere else in the document.\n.SS Backslash escapes\n.SS Extension: \\f[CR]all_symbols_escapable\\f[R]\nExcept inside a code block or inline code, any punctuation or space\ncharacter preceded by a backslash will be treated literally, even if it\nwould normally indicate formatting.\nThus, for example, if one writes\n.IP\n.EX\n*\\(rs*hello\\(rs**\n.EE\n.PP\none will get\n.IP\n.EX\n<em>*hello*</em>\n.EE\n.PP\ninstead of\n.IP\n.EX\n<strong>hello</strong>\n.EE\n.PP\nThis rule is easier to remember than original Markdown\\(cqs rule, which\nallows only the following characters to be backslash\\-escaped:\n.IP\n.EX\n\\(rs\\(ga*_{}[]()>#+\\-.!\n.EE\n.PP\n(However, if the \\f[CR]markdown_strict\\f[R] format is used, the original\nMarkdown rule will be used.)\n.PP\nA backslash\\-escaped space is parsed as a nonbreaking space.\nIn TeX output, it will appear as \\f[CR]\\(ti\\f[R].\nIn HTML and XML output, it will appear as a literal unicode nonbreaking\nspace character (note that it will thus actually look \\(lqinvisible\\(rq\nin the generated HTML source; you can still use the \\f[CR]\\-\\-ascii\\f[R]\ncommand\\-line option to make it appear as an explicit entity).\n.PP\nA backslash\\-escaped newline (i.e.\\ a backslash occurring at the end of\na line) is parsed as a hard line break.\nIt will appear in TeX output as \\f[CR]\\(rs\\(rs\\f[R] and in HTML as\n\\f[CR]<br />\\f[R].\nThis is a nice alternative to Markdown\\(cqs \\(lqinvisible\\(rq way of\nindicating hard line breaks using two trailing spaces on a line.\n.PP\nBackslash escapes do not work in verbatim contexts.\n.SS Inline formatting\n.SS Emphasis\nTo \\f[I]emphasize\\f[R] some text, surround it with \\f[CR]*\\f[R]s or\n\\f[CR]_\\f[R], like this:\n.IP\n.EX\nThis text is _emphasized with underscores_, and this\nis *emphasized with asterisks*.\n.EE\n.PP\nDouble \\f[CR]*\\f[R] or \\f[CR]_\\f[R] produces \\f[B]strong emphasis\\f[R]:\n.IP\n.EX\nThis is **strong emphasis** and __with underscores__.\n.EE\n.PP\nA \\f[CR]*\\f[R] or \\f[CR]_\\f[R] character surrounded by spaces, or\nbackslash\\-escaped, will not trigger emphasis:\n.IP\n.EX\nThis is * not emphasized *, and \\(rs*neither is this\\(rs*.\n.EE\n.SS Extension: \\f[CR]intraword_underscores\\f[R]\nBecause \\f[CR]_\\f[R] is sometimes used inside words and identifiers,\npandoc does not interpret a \\f[CR]_\\f[R] surrounded by alphanumeric\ncharacters as an emphasis marker.\nIf you want to emphasize just part of a word, use \\f[CR]*\\f[R]:\n.IP\n.EX\nfeas*ible*, not feas*able*.\n.EE\n.SS Strikeout\n.SS Extension: \\f[CR]strikeout\\f[R]\nTo strike out a section of text with a horizontal line, begin and end it\nwith \\f[CR]\\(ti\\(ti\\f[R].\nThus, for example,\n.IP\n.EX\nThis \\(ti\\(tiis deleted text.\\(ti\\(ti\n.EE\n.SS Superscripts and subscripts\n.SS Extension: \\f[CR]superscript\\f[R], \\f[CR]subscript\\f[R]\nSuperscripts may be written by surrounding the superscripted text by\n\\f[CR]\\(ha\\f[R] characters; subscripts may be written by surrounding the\nsubscripted text by \\f[CR]\\(ti\\f[R] characters.\nThus, for example,\n.IP\n.EX\nH\\(ti2\\(tiO is a liquid.  2\\(ha10\\(ha is 1024.\n.EE\n.PP\nThe text between \\f[CR]\\(ha...\\(ha\\f[R] or \\f[CR]\\(ti...\\(ti\\f[R] may\nnot contain spaces or newlines.\nIf the superscripted or subscripted text contains spaces, these spaces\nmust be escaped with backslashes.\n(This is to prevent accidental superscripting and subscripting through\nthe ordinary use of \\f[CR]\\(ti\\f[R] and \\f[CR]\\(ha\\f[R], and also bad\ninteractions with footnotes.)\nThus, if you want the letter P with `a cat' in subscripts, use\n\\f[CR]P\\(tia\\(rs cat\\(ti\\f[R], not \\f[CR]P\\(tia cat\\(ti\\f[R].\n.SS Verbatim\nTo make a short span of text verbatim, put it inside backticks:\n.IP\n.EX\nWhat is the difference between \\(ga>>=\\(ga and \\(ga>>\\(ga?\n.EE\n.PP\nIf the verbatim text includes a backtick, use double backticks:\n.IP\n.EX\nHere is a literal backtick \\(ga\\(ga \\(ga \\(ga\\(ga.\n.EE\n.PP\n(The spaces after the opening backticks and before the closing backticks\nwill be ignored.)\n.PP\nThe general rule is that a verbatim span starts with a string of\nconsecutive backticks (optionally followed by a space) and ends with a\nstring of the same number of backticks (optionally preceded by a space).\n.PP\nNote that backslash\\-escapes (and other Markdown constructs) do not work\nin verbatim contexts:\n.IP\n.EX\nThis is a backslash followed by an asterisk: \\(ga\\(rs*\\(ga.\n.EE\n.SS Extension: \\f[CR]inline_code_attributes\\f[R]\nAttributes can be attached to verbatim text, just as with fenced code\nblocks:\n.IP\n.EX\n\\(ga<$>\\(ga{.haskell}\n.EE\n.SS Underline\nTo underline text, use the \\f[CR]underline\\f[R] class:\n.IP\n.EX\n[Underline]{.underline}\n.EE\n.PP\nOr, without the \\f[CR]bracketed_spans\\f[R] extension (but with\n\\f[CR]native_spans\\f[R]):\n.IP\n.EX\n<span class=\\(dqunderline\\(dq>Underline</span>\n.EE\n.PP\nThis will work in all output formats that support underline.\n.SS Small caps\nTo write small caps, use the \\f[CR]smallcaps\\f[R] class:\n.IP\n.EX\n[Small caps]{.smallcaps}\n.EE\n.PP\nOr, without the \\f[CR]bracketed_spans\\f[R] extension:\n.IP\n.EX\n<span class=\\(dqsmallcaps\\(dq>Small caps</span>\n.EE\n.PP\nFor compatibility with other Markdown flavors, CSS is also supported:\n.IP\n.EX\n<span style=\\(dqfont\\-variant:small\\-caps;\\(dq>Small caps</span>\n.EE\n.PP\nThis will work in all output formats that support small caps.\n.SS Highlighting\nTo highlight text, use the \\f[CR]mark\\f[R] class:\n.IP\n.EX\n[Mark]{.mark}\n.EE\n.PP\nOr, without the \\f[CR]bracketed_spans\\f[R] extension (but with\n\\f[CR]native_spans\\f[R]):\n.IP\n.EX\n<span class=\\(dqmark\\(dq>Mark</span>\n.EE\n.PP\nThis will work in all output formats that support highlighting.\n.SS Math\n.SS Extension: \\f[CR]tex_math_dollars\\f[R]\nAnything between two \\f[CR]$\\f[R] characters will be treated as TeX\nmath.\nThe opening \\f[CR]$\\f[R] must have a non\\-space character immediately to\nits right, while the closing \\f[CR]$\\f[R] must have a non\\-space\ncharacter immediately to its left, and must not be followed immediately\nby a digit.\nThus, \\f[CR]$20,000 and $30,000\\f[R] won\\(cqt parse as math.\nIf for some reason you need to enclose text in literal \\f[CR]$\\f[R]\ncharacters, backslash\\-escape them and they won\\(cqt be treated as math\ndelimiters.\n.PP\nFor display math, use \\f[CR]$$\\f[R] delimiters.\n(In this case, the delimiters may be separated from the formula by\nwhitespace.\nHowever, there can be no blank lines between the opening and closing\n\\f[CR]$$\\f[R] delimiters.)\n.PP\nTeX math will be printed in all output formats.\nHow it is rendered depends on the output format:\n.TP\nLaTeX\nIt will appear verbatim surrounded by \\f[CR]\\(rs(...\\(rs)\\f[R] (for\ninline math) or \\f[CR]\\(rs[...\\(rs]\\f[R] (for display math).\n.TP\nMarkdown, Emacs Org mode, ConTeXt, ZimWiki\nIt will appear verbatim surrounded by \\f[CR]$...$\\f[R] (for inline math)\nor \\f[CR]$$...$$\\f[R] (for display math).\n.TP\nXWiki\nIt will appear verbatim surrounded by\n\\f[CR]{{formula}}..{{/formula}}\\f[R].\n.TP\nreStructuredText\nIt will be rendered using an interpreted text role \\f[CR]:math:\\f[R].\n.TP\nAsciiDoc\nFor AsciiDoc output math will appear verbatim surrounded by\n\\f[CR]latexmath:[...]\\f[R].\nFor \\f[CR]asciidoc_legacy\\f[R] the bracketed material will also include\ninline or display math delimiters.\n.TP\nTexinfo\nIt will be rendered inside a \\f[CR]\\(atmath\\f[R] command.\n.TP\nroff man, Jira markup\nIt will be rendered verbatim without \\f[CR]$\\f[R]\\(cqs.\n.TP\nMediaWiki, DokuWiki\nIt will be rendered inside \\f[CR]<math>\\f[R] tags.\n.TP\nTextile\nIt will be rendered inside \\f[CR]<span class=\\(dqmath\\(dq>\\f[R] tags.\n.TP\nRTF, OpenDocument\nIt will be rendered, if possible, using Unicode characters, and will\notherwise appear verbatim.\n.TP\nODT\nIt will be rendered, if possible, using MathML.\n.TP\nDocBook\nIf the \\f[CR]\\-\\-mathml\\f[R] flag is used, it will be rendered using\nMathML in an \\f[CR]inlineequation\\f[R] or \\f[CR]informalequation\\f[R]\ntag.\nOtherwise it will be rendered, if possible, using Unicode characters.\n.TP\nDocx and PowerPoint\nIt will be rendered using OMML math markup.\n.TP\nFictionBook2\nIf the \\f[CR]\\-\\-webtex\\f[R] option is used, formulas are rendered as\nimages using CodeCogs or other compatible web service, downloaded and\nembedded in the e\\-book.\nOtherwise, they will appear verbatim.\n.TP\nHTML, Slidy, DZSlides, S5, EPUB\nThe way math is rendered in HTML will depend on the command\\-line\noptions selected.\nTherefore see Math rendering in HTML above.\n.SS Raw HTML\n.SS Extension: \\f[CR]raw_html\\f[R]\nMarkdown allows you to insert raw HTML (or DocBook) anywhere in a\ndocument (except verbatim contexts, where \\f[CR]<\\f[R], \\f[CR]>\\f[R],\nand \\f[CR]&\\f[R] are interpreted literally).\n(Technically this is not an extension, since standard Markdown allows\nit, but it has been made an extension so that it can be disabled if\ndesired.)\n.PP\nThe raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,\nDZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile\noutput, and suppressed in other formats.\n.PP\nFor a more explicit way of including raw HTML in a Markdown document,\nsee the \\f[CR]raw_attribute\\f[R] extension.\n.PP\nIn the CommonMark format, if \\f[CR]raw_html\\f[R] is enabled,\nsuperscripts, subscripts, strikeouts and small capitals will be\nrepresented as HTML.\nOtherwise, plain\\-text fallbacks will be used.\nNote that even if \\f[CR]raw_html\\f[R] is disabled, tables will be\nrendered with HTML syntax if they cannot use pipe syntax.\n.SS Extension: \\f[CR]markdown_in_html_blocks\\f[R]\nOriginal Markdown allows you to include HTML \\(lqblocks\\(rq: blocks of\nHTML between balanced tags that are separated from the surrounding text\nwith blank lines, and start and end at the left margin.\nWithin these blocks, everything is interpreted as HTML, not Markdown; so\n(for example), \\f[CR]*\\f[R] does not signify emphasis.\n.PP\nPandoc behaves this way when the \\f[CR]markdown_strict\\f[R] format is\nused; but by default, pandoc interprets material between HTML block tags\nas Markdown.\nThus, for example, pandoc will turn\n.IP\n.EX\n<table>\n<tr>\n<td>*one*</td>\n<td>[a link](https://google.com)</td>\n</tr>\n</table>\n.EE\n.PP\ninto\n.IP\n.EX\n<table>\n<tr>\n<td><em>one</em></td>\n<td><a href=\\(dqhttps://google.com\\(dq>a link</a></td>\n</tr>\n</table>\n.EE\n.PP\nwhereas \\f[CR]Markdown.pl\\f[R] will preserve it as is.\n.PP\nThere is one exception to this rule: text between \\f[CR]<script>\\f[R],\n\\f[CR]<style>\\f[R], \\f[CR]<pre>\\f[R], and \\f[CR]<textarea>\\f[R] tags is\nnot interpreted as Markdown.\n.PP\nThis departure from original Markdown should make it easier to mix\nMarkdown with HTML block elements.\nFor example, one can surround a block of Markdown text with\n\\f[CR]<div>\\f[R] tags without preventing it from being interpreted as\nMarkdown.\n.SS Extension: \\f[CR]native_divs\\f[R]\nUse native pandoc \\f[CR]Div\\f[R] blocks for content inside\n\\f[CR]<div>\\f[R] tags.\nFor the most part this should give the same output as\n\\f[CR]markdown_in_html_blocks\\f[R], but it makes it easier to write\npandoc filters to manipulate groups of blocks.\n.SS Extension: \\f[CR]native_spans\\f[R]\nUse native pandoc \\f[CR]Span\\f[R] blocks for content inside\n\\f[CR]<span>\\f[R] tags.\nFor the most part this should give the same output as\n\\f[CR]raw_html\\f[R], but it makes it easier to write pandoc filters to\nmanipulate groups of inlines.\n.SS Extension: \\f[CR]raw_tex\\f[R]\nIn addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be\nincluded in a document.\nInline TeX commands will be preserved and passed unchanged to the LaTeX\nand ConTeXt writers.\nThus, for example, you can use LaTeX to include BibTeX citations:\n.IP\n.EX\nThis result was proved in \\(rscite{jones.1967}.\n.EE\n.PP\nNote that in LaTeX environments, like\n.IP\n.EX\n\\(rsbegin{tabular}{|l|l|}\\(rshline\nAge & Frequency \\(rs\\(rs \\(rshline\n18\\-\\-25  & 15 \\(rs\\(rs\n26\\-\\-35  & 33 \\(rs\\(rs\n36\\-\\-45  & 22 \\(rs\\(rs \\(rshline\n\\(rsend{tabular}\n.EE\n.PP\nthe material between the begin and end tags will be interpreted as raw\nLaTeX, not as Markdown.\n.PP\nFor a more explicit and flexible way of including raw TeX in a Markdown\ndocument, see the \\f[CR]raw_attribute\\f[R] extension.\n.PP\nInline LaTeX is ignored in output formats other than Markdown, LaTeX,\nEmacs Org mode, and ConTeXt.\n.SS Generic raw attribute\n.SS Extension: \\f[CR]raw_attribute\\f[R]\nInline spans and fenced code blocks with a special kind of attribute\nwill be parsed as raw content with the designated format.\nFor example, the following produces a raw roff \\f[CR]ms\\f[R] block:\n.IP\n.EX\n\\(ga\\(ga\\(ga{=ms}\n\\&.MYMACRO\nblah blah\n\\(ga\\(ga\\(ga\n.EE\n.PP\nAnd the following produces a raw \\f[CR]html\\f[R] inline element:\n.IP\n.EX\nThis is \\(ga<a>html</a>\\(ga{=html}\n.EE\n.PP\nThis can be useful to insert raw xml into \\f[CR]docx\\f[R] documents,\ne.g.\na pagebreak:\n.IP\n.EX\n\\(ga\\(ga\\(ga{=openxml}\n<w:p>\n  <w:r>\n    <w:br w:type=\\(dqpage\\(dq/>\n  </w:r>\n</w:p>\n\\(ga\\(ga\\(ga\n.EE\n.PP\nThe format name should match the target format name (see\n\\f[CR]\\-t/\\-\\-to\\f[R], above, for a list, or use\n\\f[CR]pandoc \\-\\-list\\-output\\-formats\\f[R]).\nUse \\f[CR]openxml\\f[R] for \\f[CR]docx\\f[R] output,\n\\f[CR]opendocument\\f[R] for \\f[CR]odt\\f[R] output, \\f[CR]html5\\f[R] for\n\\f[CR]epub3\\f[R] output, \\f[CR]html4\\f[R] for \\f[CR]epub2\\f[R] output,\nand \\f[CR]latex\\f[R], \\f[CR]beamer\\f[R], \\f[CR]ms\\f[R], or\n\\f[CR]html5\\f[R] for \\f[CR]pdf\\f[R] output (depending on what you use\nfor \\f[CR]\\-\\-pdf\\-engine\\f[R]).\n.PP\nThis extension presupposes that the relevant kind of inline code or\nfenced code block is enabled.\nThus, for example, to use a raw attribute with a backtick code block,\n\\f[CR]backtick_code_blocks\\f[R] must be enabled.\n.PP\nThe raw attribute cannot be combined with regular attributes.\n.SS LaTeX macros\n.SS Extension: \\f[CR]latex_macros\\f[R]\nWhen this extension is enabled, pandoc will parse LaTeX macro\ndefinitions and apply the resulting macros to all LaTeX math and raw\nLaTeX.\nSo, for example, the following will work in all output formats, not just\nLaTeX:\n.IP\n.EX\n\\(rsnewcommand{\\(rstuple}[1]{\\(rslangle #1 \\(rsrangle}\n\n$\\(rstuple{a, b, c}$\n.EE\n.PP\nNote that LaTeX macros will not be applied if they occur inside a raw\nspan or block marked with the \\f[CR]raw_attribute\\f[R] extension.\n.PP\nWhen \\f[CR]latex_macros\\f[R] is disabled, the raw LaTeX and math will\nnot have macros applied.\nThis is usually a better approach when you are targeting LaTeX or PDF.\n.PP\nMacro definitions in LaTeX will be passed through as raw LaTeX only if\n\\f[CR]latex_macros\\f[R] is not enabled.\nMacro definitions in Markdown source (or other formats allowing\n\\f[CR]raw_tex\\f[R]) will be passed through regardless of whether\n\\f[CR]latex_macros\\f[R] is enabled.\n.SS Links\nMarkdown allows links to be specified in several ways.\n.SS Automatic links\nIf you enclose a URL or email address in pointy brackets, it will become\na link:\n.IP\n.EX\n<https://google.com>\n<sam\\(atgreen.eggs.ham>\n.EE\n.SS Inline links\nAn inline link consists of the link text in square brackets, followed by\nthe URL in parentheses.\n(Optionally, the URL can be followed by a link title, in quotes.)\n.IP\n.EX\nThis is an [inline link](/url), and here\\(aqs [one with\na title](https://fsf.org \\(dqclick here for a good time!\\(dq).\n.EE\n.PP\nThere can be no space between the bracketed part and the parenthesized\npart.\nThe link text can contain formatting (such as emphasis), but the title\ncannot.\n.PP\nEmail addresses in inline links are not autodetected, so they have to be\nprefixed with \\f[CR]mailto\\f[R]:\n.IP\n.EX\n[Write me!](mailto:sam\\(atgreen.eggs.ham)\n.EE\n.SS Reference links\nAn \\f[I]explicit\\f[R] reference link has two parts, the link itself and\nthe link definition, which may occur elsewhere in the document (either\nbefore or after the link).\n.PP\nThe link consists of link text in square brackets, followed by a label\nin square brackets.\n(There cannot be space between the two unless the\n\\f[CR]spaced_reference_links\\f[R] extension is enabled.)\nThe link definition consists of the bracketed label, followed by a colon\nand a space, followed by the URL, and optionally (after a space) a link\ntitle either in quotes or in parentheses.\nThe label must not be parseable as a citation (assuming the\n\\f[CR]citations\\f[R] extension is enabled): citations take precedence\nover link labels.\n.PP\nHere are some examples:\n.IP\n.EX\n[my label 1]: /foo/bar.html  \\(dqMy title, optional\\(dq\n[my label 2]: /foo\n[my label 3]: https://fsf.org (The Free Software Foundation)\n[my label 4]: /bar#special  \\(aqA title in single quotes\\(aq\n.EE\n.PP\nThe URL may optionally be surrounded by angle brackets:\n.IP\n.EX\n[my label 5]: <http://foo.bar.baz>\n.EE\n.PP\nThe title may go on the next line:\n.IP\n.EX\n[my label 3]: https://fsf.org\n  \\(dqThe Free Software Foundation\\(dq\n.EE\n.PP\nNote that link labels are not case sensitive.\nSo, this will work:\n.IP\n.EX\nHere is [my link][FOO]\n\n[Foo]: /bar/baz\n.EE\n.PP\nIn an \\f[I]implicit\\f[R] reference link, the second pair of brackets is\nempty:\n.IP\n.EX\nSee [my website][].\n\n[my website]: http://foo.bar.baz\n.EE\n.PP\nNote: In \\f[CR]Markdown.pl\\f[R] and most other Markdown implementations,\nreference link definitions cannot occur in nested constructions such as\nlist items or block quotes.\nPandoc lifts this arbitrary\\-seeming restriction.\nSo the following is fine in pandoc, though not in most other\nimplementations:\n.IP\n.EX\n> My block [quote].\n>\n> [quote]: /foo\n.EE\n.SS Extension: \\f[CR]shortcut_reference_links\\f[R]\nIn a \\f[I]shortcut\\f[R] reference link, the second pair of brackets may\nbe omitted entirely:\n.IP\n.EX\nSee [my website].\n\n[my website]: http://foo.bar.baz\n.EE\n.SS Internal links\nTo link to another section of the same document, use the automatically\ngenerated identifier (see Heading identifiers).\nFor example:\n.IP\n.EX\nSee the [Introduction](#introduction).\n.EE\n.PP\nor\n.IP\n.EX\nSee the [Introduction].\n\n[Introduction]: #introduction\n.EE\n.PP\nInternal links are currently supported for HTML formats (including HTML\nslide shows and EPUB), LaTeX, and ConTeXt.\n.SS Images\nA link immediately preceded by a \\f[CR]!\\f[R] will be treated as an\nimage.\nThe link text will be used as the image\\(cqs alt text:\n.IP\n.EX\n![la lune](lalune.jpg \\(dqVoyage to the moon\\(dq)\n\n![movie reel]\n\n[movie reel]: movie.gif\n.EE\n.SS Extension: \\f[CR]implicit_figures\\f[R]\nAn image with nonempty alt text, occurring by itself in a paragraph,\nwill be rendered as a figure with a caption.\nThe image\\(cqs description will be used as the caption.\n.IP\n.EX\n![This is the caption.](image.png)\n.EE\n.PP\nHow this is rendered depends on the output format.\nSome output formats (e.g.\\ RTF) do not yet support figures.\nIn those formats, you\\(cqll just get an image in a paragraph by itself,\nwith no caption.\n.PP\nIf you just want a regular inline image, just make sure it is not the\nonly thing in the paragraph.\nOne way to do this is to insert a nonbreaking space after the image:\n.IP\n.EX\n![This image won\\(aqt be a figure](image.png)\\(rs\n.EE\n.PP\nNote that in reveal.js slide shows, an image in a paragraph by itself\nthat has the \\f[CR]r\\-stretch\\f[R] class will fill the screen, and the\ncaption and figure tags will be omitted.\n.PP\nTo specify an alt text for the image that is different from the caption,\nyou can use an explicit attribute (assuming the\n\\f[CR]link_attributes\\f[R] extension is set):\n.IP\n.EX\n![The caption.](image.png){alt=\\(dqdescription of image\\(dq}\n.EE\n.PP\nFor LaTeX output, you can specify a figure\\(cqs positioning by adding\nthe \\f[CR]latex\\-placement\\f[R] attribute.\n.IP\n.EX\n![The caption.](image.png){latex\\-placement=\\(dqht\\(dq}\n.EE\n.SS Extension: \\f[CR]link_attributes\\f[R]\nAttributes can be set on links and images:\n.IP\n.EX\nAn inline ![image](foo.jpg){#id .class width=30 height=20px}\nand a reference ![image][ref] with attributes.\n\n[ref]: foo.jpg \\(dqoptional title\\(dq {#id .class key=val key2=\\(dqval 2\\(dq}\n.EE\n.PP\n(This syntax is compatible with PHP Markdown Extra when only\n\\f[CR]#id\\f[R] and \\f[CR].class\\f[R] are used.)\n.PP\nFor HTML and EPUB, all known HTML5 attributes except \\f[CR]width\\f[R]\nand \\f[CR]height\\f[R] (but including \\f[CR]srcset\\f[R] and\n\\f[CR]sizes\\f[R]) are passed through as is.\nUnknown attributes are passed through as custom attributes, with\n\\f[CR]data\\-\\f[R] prepended.\nThe other writers ignore attributes that are not specifically supported\nby their output format.\n.PP\nThe \\f[CR]width\\f[R] and \\f[CR]height\\f[R] attributes on images are\ntreated specially.\nWhen used without a unit, the unit is assumed to be pixels.\nHowever, any of the following unit identifiers can be used:\n\\f[CR]px\\f[R], \\f[CR]cm\\f[R], \\f[CR]mm\\f[R], \\f[CR]in\\f[R],\n\\f[CR]inch\\f[R] and \\f[CR]%\\f[R].\nThere must not be any spaces between the number and the unit.\nFor example:\n.IP\n.EX\n![](file.jpg){ width=50% }\n.EE\n.IP \\(bu 2\nDimensions may be converted to a form that is compatible with the output\nformat (for example, dimensions given in pixels will be converted to\ninches when converting HTML to LaTeX).\nConversion between pixels and physical measurements is affected by the\n\\f[CR]\\-\\-dpi\\f[R] option (by default, 96 dpi is assumed, unless the\nimage itself contains dpi information).\n.IP \\(bu 2\nThe \\f[CR]%\\f[R] unit is generally relative to some available space.\nFor example the above example will render to the following.\n.RS 2\n.IP \\(bu 2\nHTML: \\f[CR]<img href=\\(dqfile.jpg\\(dq style=\\(dqwidth: 50%;\\(dq />\\f[R]\n.IP \\(bu 2\nLaTeX:\n\\f[CR]\\(rsincludegraphics[width=0.5\\(rstextwidth,height=\\(rstextheight]{file.jpg}\\f[R]\n(If you\\(cqre using a custom template, you need to configure\n\\f[CR]graphicx\\f[R] as in the default template.)\n.IP \\(bu 2\nConTeXt: \\f[CR]\\(rsexternalfigure[file.jpg][width=0.5\\(rstextwidth]\\f[R]\n.RE\n.IP \\(bu 2\nSome output formats have a notion of a class (ConTeXt) or a unique\nidentifier (LaTeX \\f[CR]\\(rscaption\\f[R]), or both (HTML).\n.IP \\(bu 2\nWhen no \\f[CR]width\\f[R] or \\f[CR]height\\f[R] attributes are specified,\nthe fallback is to look at the image resolution and the dpi metadata\nembedded in the image file.\n.SS Divs and Spans\nUsing the \\f[CR]native_divs\\f[R] and \\f[CR]native_spans\\f[R] extensions\n(see above), HTML syntax can be used as part of Markdown to create\nnative \\f[CR]Div\\f[R] and \\f[CR]Span\\f[R] elements in the pandoc AST (as\nopposed to raw HTML).\nHowever, there is also nicer syntax available:\n.SS Extension: \\f[CR]fenced_divs\\f[R]\nAllow special fenced syntax for native \\f[CR]Div\\f[R] blocks.\nA Div starts with a fence containing at least three consecutive colons\nplus some attributes.\nThe attributes may optionally be followed by another string of\nconsecutive colons.\n.PP\nNote: the \\f[CR]commonmark\\f[R] parser doesn\\(cqt permit colons after\nthe attributes.\n.PP\nThe attribute syntax is exactly as in fenced code blocks (see Extension:\n\\f[CR]fenced_code_attributes\\f[R]).\nAs with fenced code blocks, one can use either attributes in curly\nbraces or a single unbraced word, which will be treated as a class name.\nThe Div ends with another line containing a string of at least three\nconsecutive colons.\nThe fenced Div should be separated by blank lines from preceding and\nfollowing blocks.\n.PP\nExample:\n.IP\n.EX\n::::: {#special .sidebar}\nHere is a paragraph.\n\nAnd another.\n:::::\n.EE\n.PP\nFenced divs can be nested.\nOpening fences are distinguished because they \\f[I]must\\f[R] have\nattributes:\n.IP\n.EX\n::: Warning ::::::\nThis is a warning.\n\n::: Danger\nThis is a warning within a warning.\n:::\n::::::::::::::::::\n.EE\n.PP\nFences without attributes are always closing fences.\nUnlike with fenced code blocks, the number of colons in the closing\nfence need not match the number in the opening fence.\nHowever, it can be helpful for visual clarity to use fences of different\nlengths to distinguish nested divs from their parents.\n.SS Extension: \\f[CR]bracketed_spans\\f[R]\nA bracketed sequence of inlines, as one would use to begin a link, will\nbe treated as a \\f[CR]Span\\f[R] with attributes if it is followed\nimmediately by attributes:\n.IP\n.EX\n[This is *some text*]{.class key=\\(dqval\\(dq}\n.EE\n.SS Footnotes\n.SS Extension: \\f[CR]footnotes\\f[R]\nPandoc\\(cqs Markdown allows footnotes, using the following syntax:\n.IP\n.EX\nHere is a footnote reference,[\\(ha1] and another.[\\(halongnote]\n\n[\\(ha1]: Here is the footnote.\n\n[\\(halongnote]: Here\\(aqs one with multiple blocks.\n\n    Subsequent paragraphs are indented to show that they\nbelong to the previous footnote.\n\n        { some.code }\n\n    The whole paragraph can be indented, or just the first\n    line.  In this way, multi\\-paragraph footnotes work like\n    multi\\-paragraph list items.\n\nThis paragraph won\\(aqt be part of the note, because it\nisn\\(aqt indented.\n.EE\n.PP\nThe identifiers in footnote references may not contain spaces, tabs,\nnewlines, or the characters \\f[CR]\\(ha\\f[R], \\f[CR][\\f[R], or\n\\f[CR]]\\f[R].\nThese identifiers are used only to correlate the footnote reference with\nthe note itself; in the output, footnotes will be numbered sequentially.\n.PP\nThe footnotes themselves need not be placed at the end of the document.\nThey may appear anywhere except inside other block elements (lists,\nblock quotes, tables, etc.).\nEach footnote should be separated from surrounding content (including\nother footnotes) by blank lines.\n.SS Extension: \\f[CR]inline_notes\\f[R]\nInline footnotes are also allowed (though, unlike regular notes, they\ncannot contain multiple paragraphs).\nThe syntax is as follows:\n.IP\n.EX\nHere is an inline note.\\(ha[Inline notes are easier to write, since\nyou don\\(aqt have to pick an identifier and move down to type the\nnote.]\n.EE\n.PP\nInline and regular footnotes may be mixed freely.\n.SS Citation syntax\n.SS Extension: \\f[CR]citations\\f[R]\nTo cite a bibliographic item with an identifier foo, use the syntax\n\\f[CR]\\(atfoo\\f[R].\nNormal citations should be included in square brackets, with semicolons\nseparating distinct items:\n.IP\n.EX\nBlah blah [\\(atdoe99; \\(atsmith2000; \\(atsmith2004].\n.EE\n.PP\nHow this is rendered depends on the citation style.\nIn an author\\-date style, it might render as\n.IP\n.EX\nBlah blah (Doe 1999, Smith 2000, 2004).\n.EE\n.PP\nIn a footnote style, it might render as\n.IP\n.EX\nBlah blah.[\\(ha1]\n\n[\\(ha1]:  John Doe, \\(dqFrogs,\\(dq *Journal of Amphibians* 44 (1999);\nSusan Smith, \\(dqFlies,\\(dq *Journal of Insects* (2000);\nSusan Smith, \\(dqBees,\\(dq *Journal of Insects* (2004).\n.EE\n.PP\nSee the CSL user documentation for more information about CSL styles and\nhow they affect rendering.\n.PP\nUnless a citation key starts with a letter, digit, or \\f[CR]_\\f[R], and\ncontains only alphanumerics and single internal punctuation characters\n(\\f[CR]:.#$%&\\-+?<>\\(ti/\\f[R]), it must be surrounded by curly braces,\nwhich are not considered part of the key.\nIn \\f[CR]\\(atFoo_bar.baz.\\f[R], the key is \\f[CR]Foo_bar.baz\\f[R]\nbecause the final period is not \\f[I]internal\\f[R] punctuation, so it is\nnot included in the key.\nIn \\f[CR]\\(at{Foo_bar.baz.}\\f[R], the key is \\f[CR]Foo_bar.baz.\\f[R],\nincluding the final period.\nIn \\f[CR]\\(atFoo_bar\\-\\-baz\\f[R], the key is \\f[CR]Foo_bar\\f[R] because\nthe repeated internal punctuation characters terminate the key.\nThe curly braces are recommended if you use URLs as keys:\n\\f[CR][\\(at{https://example.com/bib?name=foobar&date=2000}, p.  33]\\f[R].\n.PP\nCitation items may optionally include a prefix, a locator, and a suffix.\nIn\n.IP\n.EX\nBlah blah [see \\(atdoe99, pp. 33\\-35 and *passim*; \\(atsmith04, chap. 1].\n.EE\n.PP\nthe first item (\\f[CR]doe99\\f[R]) has prefix \\f[CR]see\\f[R], locator\n\\f[CR]pp.  33\\-35\\f[R], and suffix \\f[CR]and *passim*\\f[R].\nThe second item (\\f[CR]smith04\\f[R]) has locator \\f[CR]chap. 1\\f[R] and\nno prefix or suffix.\n.PP\nPandoc uses some heuristics to separate the locator from the rest of the\nsubject.\nIt is sensitive to the locator terms defined in the CSL locale files.\nEither abbreviated or unabbreviated forms are accepted.\nIn the \\f[CR]en\\-US\\f[R] locale, locator terms can be written in either\nsingular or plural forms, as \\f[CR]book\\f[R],\n\\f[CR]bk.\\f[R]/\\f[CR]bks.\\f[R]; \\f[CR]chapter\\f[R],\n\\f[CR]chap.\\f[R]/\\f[CR]chaps.\\f[R]; \\f[CR]column\\f[R],\n\\f[CR]col.\\f[R]/\\f[CR]cols.\\f[R]; \\f[CR]figure\\f[R],\n\\f[CR]fig.\\f[R]/\\f[CR]figs.\\f[R]; \\f[CR]folio\\f[R],\n\\f[CR]fol.\\f[R]/\\f[CR]fols.\\f[R]; \\f[CR]number\\f[R],\n\\f[CR]no.\\f[R]/\\f[CR]nos.\\f[R]; \\f[CR]line\\f[R],\n\\f[CR]l.\\f[R]/\\f[CR]ll.\\f[R]; \\f[CR]note\\f[R],\n\\f[CR]n.\\f[R]/\\f[CR]nn.\\f[R]; \\f[CR]opus\\f[R],\n\\f[CR]op.\\f[R]/\\f[CR]opp.\\f[R]; \\f[CR]page\\f[R],\n\\f[CR]p.\\f[R]/\\f[CR]pp.\\f[R]; \\f[CR]paragraph\\f[R],\n\\f[CR]para.\\f[R]/\\f[CR]paras.\\f[R]; \\f[CR]part\\f[R],\n\\f[CR]pt.\\f[R]/\\f[CR]pts.\\f[R]; \\f[CR]section\\f[R],\n\\f[CR]sec.\\f[R]/\\f[CR]secs.\\f[R]; \\f[CR]sub verbo\\f[R],\n\\f[CR]s.v.\\f[R]/\\f[CR]s.vv.\\f[R]; \\f[CR]verse\\f[R],\n\\f[CR]v.\\f[R]/\\f[CR]vv.\\f[R]; \\f[CR]volume\\f[R],\n\\f[CR]vol.\\f[R]/\\f[CR]vols.\\f[R]; \\f[CR]¶\\f[R]/\\f[CR]¶¶\\f[R];\n\\f[CR]§\\f[R]/\\f[CR]§§\\f[R].\nIf no locator term is used, \\(lqpage\\(rq is assumed.\n.PP\nIn complex cases, you can force something to be treated as a locator by\nenclosing it in curly braces or prevent parsing the suffix as locator by\nprepending curly braces:\n.IP\n.EX\n[\\(atsmith{ii, A, D\\-Z}, with a suffix]\n[\\(atsmith, {pp. iv, vi\\-xi, (xv)\\-(xvii)} with suffix here]\n[\\(atsmith{}, 99 years later]\n.EE\n.PP\nA minus sign (\\f[CR]\\-\\f[R]) before the \\f[CR]\\(at\\f[R] will suppress\nmention of the author in the citation.\nThis can be useful when the author is already mentioned in the text:\n.IP\n.EX\nSmith says blah [\\-\\(atsmith04].\n.EE\n.PP\nYou can also write an author\\-in\\-text citation, by omitting the square\nbrackets:\n.IP\n.EX\n\\(atsmith04 says blah.\n\n\\(atsmith04 [p. 33] says blah.\n.EE\n.PP\nThis will cause the author\\(cqs name to be rendered, followed by the\nbibliographical details.\nUse this form when you want to make the citation the subject of a\nsentence.\n.PP\nWhen you are using a note style, it is usually better to let citeproc\ncreate the footnotes from citations rather than writing an explicit\nnote.\nIf you do write an explicit note that contains a citation, note that\nnormal citations will be put in parentheses, while author\\-in\\-text\ncitations will not.\nFor this reason, it is sometimes preferable to use the author\\-in\\-text\nstyle inside notes when using a note style.\n.PP\nMany CSL styles will format citations differently when the same source\nhas been cited earlier.\nIn documents with chapters, it is usually desirable to reset this\nposition information at the beginning of every chapter.\nTo do this, add the class \\f[CR]reset\\-citation\\-positions\\f[R] to the\nheading for each chapter:\n.IP\n.EX\n# The Beginning {.reset\\-citation\\-positions}\n.EE\n.PP\nNote that this class only has an effect when placed on top\\-level\nheadings; it is ignored in nested blocks.\n.SS Non\\-default extensions\nThe following Markdown syntax extensions are not enabled by default in\npandoc, but may be enabled by adding \\f[CR]+EXTENSION\\f[R] to the format\nname, where \\f[CR]EXTENSION\\f[R] is the name of the extension.\nThus, for example, \\f[CR]markdown+hard_line_breaks\\f[R] is Markdown with\nhard line breaks.\n.SS Extension: \\f[CR]rebase_relative_paths\\f[R]\nRewrite relative paths for Markdown links and images, depending on the\npath of the file containing the link or image link.\nFor each link or image, pandoc will compute the directory of the\ncontaining file, relative to the working directory, and prepend the\nresulting path to the link or image path.\n.PP\nThe use of this extension is best understood by example.\nSuppose you have a subdirectory for each chapter of a book,\n\\f[CR]chap1\\f[R], \\f[CR]chap2\\f[R], \\f[CR]chap3\\f[R].\nEach contains a file \\f[CR]text.md\\f[R] and a number of images used in\nthe chapter.\nYou would like to have \\f[CR]![image](spider.jpg)\\f[R] in\n\\f[CR]chap1/text.md\\f[R] refer to \\f[CR]chap1/spider.jpg\\f[R] and\n\\f[CR]![image](spider.jpg)\\f[R] in \\f[CR]chap2/text.md\\f[R] refer to\n\\f[CR]chap2/spider.jpg\\f[R].\nTo do this, use\n.IP\n.EX\npandoc chap*/*.md \\-f markdown+rebase_relative_paths\n.EE\n.PP\nWithout this extension, you would have to use\n\\f[CR]![image](chap1/spider.jpg)\\f[R] in \\f[CR]chap1/text.md\\f[R] and\n\\f[CR]![image](chap2/spider.jpg)\\f[R] in \\f[CR]chap2/text.md\\f[R].\nLinks with relative paths will be rewritten in the same way as images.\n.PP\nAbsolute paths and URLs are not changed.\nNeither are empty paths or paths consisting entirely of a fragment,\ne.g., \\f[CR]#foo\\f[R].\n.PP\nNote that relative paths in reference links and images will be rewritten\nrelative to the file containing the link reference definition, not the\nfile containing the reference link or image itself, if these differ.\n.SS Extension: \\f[CR]mark\\f[R]\nTo highlight out a section of text, begin and end it with with\n\\f[CR]==\\f[R].\nThus, for example,\n.IP\n.EX\nThis ==is deleted text.==\n.EE\n.SS Extension: \\f[CR]attributes\\f[R]\nAllows attributes to be attached to any inline or block\\-level element\nwhen parsing \\f[CR]commonmark\\f[R].\nThe syntax for the attributes is the same as that used in\n\\f[CR]header_attributes\\f[R].\n.IP \\(bu 2\nAttributes that occur immediately after an inline element affect that\nelement.\nIf they follow a space, then they belong to the space.\n(Hence, this option subsumes \\f[CR]inline_code_attributes\\f[R] and\n\\f[CR]link_attributes\\f[R].)\n.IP \\(bu 2\nAttributes that occur immediately before a block element, on a line by\nthemselves, affect that element.\n.IP \\(bu 2\nConsecutive attribute specifiers may be used, either for blocks or for\ninlines.\nTheir attributes will be combined.\n.IP \\(bu 2\nAttributes that occur at the end of the text of a Setext or ATX heading\n(separated by whitespace from the text) affect the heading element.\n(Hence, this option subsumes \\f[CR]header_attributes\\f[R].)\n.IP \\(bu 2\nAttributes that occur after the opening fence in a fenced code block\naffect the code block element.\n(Hence, this option subsumes \\f[CR]fenced_code_attributes\\f[R].)\n.IP \\(bu 2\nAttributes that occur at the end of a reference link definition affect\nlinks that refer to that definition.\n.PP\nNote that pandoc\\(cqs AST does not currently allow attributes to be\nattached to arbitrary elements.\nHence a Span or Div container will be added if needed.\n.SS Extension: \\f[CR]old_dashes\\f[R]\nSelects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:\n\\f[CR]\\-\\f[R] before a numeral is an en\\-dash, and \\f[CR]\\-\\-\\f[R] is an\nem\\-dash.\nThis option only has an effect if \\f[CR]smart\\f[R] is enabled.\nIt is selected automatically for \\f[CR]textile\\f[R] input.\n.SS Extension: \\f[CR]angle_brackets_escapable\\f[R]\nAllow \\f[CR]<\\f[R] and \\f[CR]>\\f[R] to be backslash\\-escaped, as they\ncan be in GitHub flavored Markdown but not original Markdown.\nThis is implied by pandoc\\(cqs default \\f[CR]all_symbols_escapable\\f[R].\n.SS Extension: \\f[CR]lists_without_preceding_blankline\\f[R]\nAllow a list to occur right after a paragraph, with no intervening blank\nspace.\n.SS Extension: \\f[CR]four_space_rule\\f[R]\nSelects the pandoc <= 2.0 behavior for parsing lists, so that four\nspaces indent are needed for list item continuation paragraphs.\n.SS Extension: \\f[CR]spaced_reference_links\\f[R]\nAllow whitespace between the two components of a reference link, for\nexample,\n.IP\n.EX\n[foo] [bar].\n.EE\n.SS Extension: \\f[CR]hard_line_breaks\\f[R]\nCauses all newlines within a paragraph to be interpreted as hard line\nbreaks instead of spaces.\n.SS Extension: \\f[CR]ignore_line_breaks\\f[R]\nCauses newlines within a paragraph to be ignored, rather than being\ntreated as spaces or as hard line breaks.\nThis option is intended for use with East Asian languages where spaces\nare not used between words, but text is divided into lines for\nreadability.\n.SS Extension: \\f[CR]east_asian_line_breaks\\f[R]\nCauses newlines within a paragraph to be ignored, rather than being\ntreated as spaces or as hard line breaks, when they occur between two\nEast Asian wide characters.\nThis is a better choice than \\f[CR]ignore_line_breaks\\f[R] for texts\nthat include a mix of East Asian wide characters and other characters.\n.SS Extension: \\f[CR]emoji\\f[R]\nParses textual emojis like \\f[CR]:smile:\\f[R] as Unicode emoticons.\n.SS Extension: \\f[CR]tex_math_gfm\\f[R]\nSupports two GitHub\\-specific formats for math.\nInline math: \\f[CR]$\\(gae=mc\\(ha2\\(ga$\\f[R].\n.PP\nDisplay math:\n.IP\n.EX\n\\(ga\\(ga\\(ga math\ne=mc\\(ha2\n\\(ga\\(ga\\(ga\n.EE\n.SS Extension: \\f[CR]tex_math_single_backslash\\f[R]\nCauses anything between \\f[CR]\\(rs(\\f[R] and \\f[CR]\\(rs)\\f[R] to be\ninterpreted as inline TeX math, and anything between \\f[CR]\\(rs[\\f[R]\nand \\f[CR]\\(rs]\\f[R] to be interpreted as display TeX math.\nNote: a drawback of this extension is that it precludes escaping\n\\f[CR](\\f[R] and \\f[CR][\\f[R].\n.SS Extension: \\f[CR]tex_math_double_backslash\\f[R]\nCauses anything between \\f[CR]\\(rs\\(rs(\\f[R] and \\f[CR]\\(rs\\(rs)\\f[R] to\nbe interpreted as inline TeX math, and anything between\n\\f[CR]\\(rs\\(rs[\\f[R] and \\f[CR]\\(rs\\(rs]\\f[R] to be interpreted as\ndisplay TeX math.\n.SS Extension: \\f[CR]markdown_attribute\\f[R]\nBy default, pandoc interprets material inside block\\-level tags as\nMarkdown.\nThis extension changes the behavior so that Markdown is only parsed\ninside block\\-level tags if the tags have the attribute\n\\f[CR]markdown=1\\f[R].\n.SS Extension: \\f[CR]mmd_title_block\\f[R]\nEnables a MultiMarkdown style title block at the top of the document,\nfor example:\n.IP\n.EX\nTitle:   My title\nAuthor:  John Doe\nDate:    September 1, 2008\nComment: This is a sample mmd title block, with\n         a field spanning multiple lines.\n.EE\n.PP\nSee the MultiMarkdown documentation for details.\nIf \\f[CR]pandoc_title_block\\f[R] or \\f[CR]yaml_metadata_block\\f[R] is\nenabled, it will take precedence over \\f[CR]mmd_title_block\\f[R].\n.SS Extension: \\f[CR]abbreviations\\f[R]\nParses PHP Markdown Extra abbreviation keys, like\n.IP\n.EX\n*[HTML]: Hypertext Markup Language\n.EE\n.PP\nNote that the pandoc document model does not support abbreviations, so\nif this extension is enabled, abbreviation keys are simply skipped (as\nopposed to being parsed as paragraphs).\n.SS Extension: \\f[CR]alerts\\f[R]\nSupports GitHub\\-style Markdown alerts, like\n.IP\n.EX\n> [!TIP]\n> Helpful advice for doing things better or more easily.\n.EE\n.SS Extension: \\f[CR]autolink_bare_uris\\f[R]\nMakes all absolute URIs into links, even when not surrounded by pointy\nbraces \\f[CR]<...>\\f[R].\n.SS Extension: \\f[CR]mmd_link_attributes\\f[R]\nParses MultiMarkdown\\-style key\\-value attributes on link and image\nreferences.\nThis extension should not be confused with the\n\\f[CR]link_attributes\\f[R] extension.\n.IP\n.EX\nThis is a reference ![image][ref] with MultiMarkdown attributes.\n\n[ref]: https://path.to/image \\(dqImage title\\(dq width=20px height=30px\n       id=myId class=\\(dqmyClass1 myClass2\\(dq\n.EE\n.SS Extension: \\f[CR]mmd_header_identifiers\\f[R]\nParses MultiMarkdown\\-style heading identifiers (in square brackets,\nafter the heading but before any trailing \\f[CR]#\\f[R]s in an ATX\nheading).\n.SS Extension: \\f[CR]gutenberg\\f[R]\nUse Project Gutenberg conventions for \\f[CR]plain\\f[R] output: all\\-caps\nfor strong emphasis, surround by underscores for regular emphasis, add\nextra blank space around headings.\n.SS Extension: \\f[CR]sourcepos\\f[R]\nInclude source position attributes when parsing \\f[CR]commonmark\\f[R].\nFor elements that accept attributes, a \\f[CR]data\\-pos\\f[R] attribute is\nadded; other elements are placed in a surrounding Div or Span element\nwith a \\f[CR]data\\-pos\\f[R] attribute.\n.SS Extension: \\f[CR]short_subsuperscripts\\f[R]\nParse MultiMarkdown\\-style subscripts and superscripts, which start with\na `\\(ti' or `\\(ha' character, respectively, and include the alphanumeric\nsequence that follows.\nFor example:\n.IP\n.EX\nx\\(ha2 = 4\n.EE\n.PP\nor\n.IP\n.EX\nOxygen is O\\(ti2.\n.EE\n.SS Extension: \\f[CR]wikilinks_title_after_pipe\\f[R]\nPandoc supports multiple Markdown wikilink syntaxes, regardless of\nwhether the title is before or after the pipe.\n.PP\nUsing \\f[CR]\\-\\-from=markdown+wikilinks_title_after_pipe\\f[R] results in\n.IP\n.EX\n[[URL|title]]\n.EE\n.PP\nwhile using \\f[CR]\\-\\-from=markdown+wikilinks_title_before_pipe\\f[R]\nresults in\n.IP\n.EX\n[[title|URL]]\n.EE\n.SS Markdown variants\nIn addition to pandoc\\(cqs extended Markdown, the following Markdown\nvariants are supported:\n.IP \\(bu 2\n\\f[CR]markdown_phpextra\\f[R] (PHP Markdown Extra)\n.IP \\(bu 2\n\\f[CR]markdown_github\\f[R] (deprecated GitHub\\-Flavored Markdown)\n.IP \\(bu 2\n\\f[CR]markdown_mmd\\f[R] (MultiMarkdown)\n.IP \\(bu 2\n\\f[CR]markdown_strict\\f[R] (Markdown.pl)\n.IP \\(bu 2\n\\f[CR]commonmark\\f[R] (CommonMark)\n.IP \\(bu 2\n\\f[CR]gfm\\f[R] (Github\\-Flavored Markdown)\n.IP \\(bu 2\n\\f[CR]commonmark_x\\f[R] (CommonMark with many pandoc extensions)\n.PP\nTo see which extensions are supported for a given format, and which are\nenabled by default, you can use the command\n.IP\n.EX\npandoc \\-\\-list\\-extensions=FORMAT\n.EE\n.PP\nwhere \\f[CR]FORMAT\\f[R] is replaced with the name of the format.\n.PP\nNote that the list of extensions for \\f[CR]commonmark\\f[R],\n\\f[CR]gfm\\f[R], and \\f[CR]commonmark_x\\f[R] are defined relative to\ndefault commonmark.\nSo, for example, \\f[CR]backtick_code_blocks\\f[R] does not appear as an\nextension, since it is enabled by default and cannot be disabled.\n.SH CITATIONS\nWhen the \\f[CR]\\-\\-citeproc\\f[R] option is used, pandoc can\nautomatically generate citations and a bibliography in a number of\nstyles.\nBasic usage is\n.IP\n.EX\npandoc \\-\\-citeproc myinput.txt\n.EE\n.PP\nTo use this feature, you will need to have\n.IP \\(bu 2\na document containing citations (see Citation syntax);\n.IP \\(bu 2\na source of bibliographic data: either an external bibliography file or\na list of \\f[CR]references\\f[R] in the document\\(cqs YAML metadata;\n.IP \\(bu 2\noptionally, a CSL citation style.\n.SS Specifying bibliographic data\nYou can specify an external bibliography using the\n\\f[CR]bibliography\\f[R] metadata field in a YAML metadata section or the\n\\f[CR]\\-\\-bibliography\\f[R] command line argument.\nIf you want to use multiple bibliography files, you can supply multiple\n\\f[CR]\\-\\-bibliography\\f[R] arguments or set \\f[CR]bibliography\\f[R]\nmetadata field to YAML array.\nA bibliography may have any of these formats:\n.RS -14n\n.IP\n.EX\n  Format     File extension\n  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n  BibLaTeX   .bib\n  BibTeX     .bibtex\n  CSL JSON   .json\n  CSL YAML   .yaml\n  RIS        .ris\n.EE\n.RE\n.PP\nNote that \\f[CR].bib\\f[R] can be used with both BibTeX and BibLaTeX\nfiles; use the extension \\f[CR].bibtex\\f[R] to force interpretation as\nBibTeX.\n.PP\nIn BibTeX and BibLaTeX databases, pandoc parses LaTeX markup inside\nfields such as \\f[CR]title\\f[R]; in CSL YAML databases, pandoc Markdown;\nand in CSL JSON databases, an HTML\\-like markup:\n.TP\n\\f[CR]<i>...</i>\\f[R]\nitalics\n.TP\n\\f[CR]<b>...</b>\\f[R]\nbold\n.TP\n\\f[CR]<span style=\\(dqfont\\-variant:small\\-caps;\\(dq>...</span>\\f[R] or \\f[CR]<sc>...</sc>\\f[R]\nsmall capitals\n.TP\n\\f[CR]<sub>...</sub>\\f[R]\nsubscript\n.TP\n\\f[CR]<sup>...</sup>\\f[R]\nsuperscript\n.TP\n\\f[CR]<span class=\\(dqnocase\\(dq>...</span>\\f[R]\nprevent a phrase from being capitalized as title case\n.PP\nAs an alternative to specifying a bibliography file using\n\\f[CR]\\-\\-bibliography\\f[R] or the YAML metadata field\n\\f[CR]bibliography\\f[R], you can include the citation data directly in\nthe \\f[CR]references\\f[R] field of the document\\(cqs YAML metadata.\nThe field should contain an array of YAML\\-encoded references, for\nexample:\n.IP\n.EX\n\\-\\-\\-\nreferences:\n\\- type: article\\-journal\n  id: WatsonCrick1953\n  author:\n  \\- family: Watson\n    given: J. D.\n  \\- family: Crick\n    given: F. H. C.\n  issued:\n    date\\-parts:\n    \\- \\- 1953\n      \\- 4\n      \\- 25\n  title: \\(aqMolecular structure of nucleic acids: a structure for\n    deoxyribose nucleic acid\\(aq\n  title\\-short: Molecular structure of nucleic acids\n  container\\-title: Nature\n  volume: 171\n  issue: 4356\n  page: 737\\-738\n  DOI: 10.1038/171737a0\n  URL: https://www.nature.com/articles/171737a0\n  language: en\\-GB\n\\&...\n.EE\n.PP\nIf both an external bibliography and inline (YAML metadata) references\nare provided, both will be used.\nIn case of conflicting \\f[CR]id\\f[R]s, the inline references will take\nprecedence.\n.PP\nNote that pandoc can be used to produce such a YAML metadata section\nfrom a BibTeX, BibLaTeX, or CSL JSON bibliography:\n.IP\n.EX\npandoc chem.bib \\-s \\-f biblatex \\-t markdown\npandoc chem.json \\-s \\-f csljson \\-t markdown\n.EE\n.PP\nIndeed, pandoc can convert between any of these citation formats:\n.IP\n.EX\npandoc chem.bib \\-s \\-f biblatex \\-t csljson\npandoc chem.yaml \\-s \\-f markdown \\-t biblatex\n.EE\n.PP\nRunning pandoc on a bibliography file with the \\f[CR]\\-\\-citeproc\\f[R]\noption will create a formatted bibliography in the format of your\nchoice:\n.IP\n.EX\npandoc chem.bib \\-s \\-\\-citeproc \\-o chem.html\npandoc chem.bib \\-s \\-\\-citeproc \\-o chem.pdf\n.EE\n.SS Capitalization in titles\nIf you are using a bibtex or biblatex bibliography, then observe the\nfollowing rules:\n.IP \\(bu 2\nEnglish titles should be in title case.\nNon\\-English titles should be in sentence case, and the\n\\f[CR]langid\\f[R] field in biblatex should be set to the relevant\nlanguage.\n(The following values are treated as English: \\f[CR]american\\f[R],\n\\f[CR]british\\f[R], \\f[CR]canadian\\f[R], \\f[CR]english\\f[R],\n\\f[CR]australian\\f[R], \\f[CR]newzealand\\f[R], \\f[CR]USenglish\\f[R], or\n\\f[CR]UKenglish\\f[R].)\n.IP \\(bu 2\nAs is standard with bibtex/biblatex, proper names should be protected\nwith curly braces so that they won\\(cqt be lowercased in styles that\ncall for sentence case.\nFor example:\n.RS 2\n.IP\n.EX\ntitle = {My Dinner with {Andre}}\n.EE\n.RE\n.IP \\(bu 2\nIn addition, words that should remain lowercase (or camelCase) should be\nprotected:\n.RS 2\n.IP\n.EX\ntitle = {Spin Wave Dispersion on the {nm} Scale}\n.EE\n.PP\nThough this is not necessary in bibtex/biblatex, it is necessary with\nciteproc, which stores titles internally in sentence case, and converts\nto title case in styles that require it.\nHere we protect \\(lqnm\\(rq so that it doesn\\(cqt get converted to\n\\(lqNm\\(rq at this stage.\n.RE\n.PP\nIf you are using a CSL bibliography (either JSON or YAML), then observe\nthe following rules:\n.IP \\(bu 2\nAll titles should be in sentence case.\n.IP \\(bu 2\nUse the \\f[CR]language\\f[R] field for non\\-English titles to prevent\ntheir conversion to title case in styles that call for this.\n(Conversion happens only if \\f[CR]language\\f[R] begins with\n\\f[CR]en\\f[R] or is left empty.)\n.IP \\(bu 2\nProtect words that should not be converted to title case using this\nsyntax:\n.RS 2\n.IP\n.EX\nSpin wave dispersion on the <span class=\\(dqnocase\\(dq>nm</span> scale\n.EE\n.RE\n.SS Conference Papers, Published vs.\\ Unpublished\nFor a formally published conference paper, use the biblatex entry type\n\\f[CR]inproceedings\\f[R] (which will be mapped to CSL\n\\f[CR]paper\\-conference\\f[R]).\n.PP\nFor an unpublished manuscript, use the biblatex entry type\n\\f[CR]unpublished\\f[R] without an \\f[CR]eventtitle\\f[R] field (this\nentry type will be mapped to CSL \\f[CR]manuscript\\f[R]).\n.PP\nFor a talk, an unpublished conference paper, or a poster presentation,\nuse the biblatex entry type \\f[CR]unpublished\\f[R] with an\n\\f[CR]eventtitle\\f[R] field (this entry type will be mapped to CSL\n\\f[CR]speech\\f[R]).\nUse the biblatex \\f[CR]type\\f[R] field to indicate the type,\ne.g.\\ \\(lqPaper\\(rq, or \\(lqPoster\\(rq.\n\\f[CR]venue\\f[R] and \\f[CR]eventdate\\f[R] may be useful too, though\n\\f[CR]eventdate\\f[R] will not be rendered by most CSL styles.\nNote that \\f[CR]venue\\f[R] is for the event\\(cqs venue, unlike\n\\f[CR]location\\f[R] which describes the publisher\\(cqs location; do not\nuse the latter for an unpublished conference paper.\n.SS Specifying a citation style\nCitations and references can be formatted using any style supported by\nthe Citation Style Language, listed in the Zotero Style Repository.\nThese files are specified using the \\f[CR]\\-\\-csl\\f[R] option or the\n\\f[CR]csl\\f[R] (or \\f[CR]citation\\-style\\f[R]) metadata field.\nBy default, pandoc will use the Chicago Manual of Style author\\-date\nformat.\n(You can override this default by copying a CSL style of your choice to\n\\f[CR]default.csl\\f[R] in your user data directory.)\nThe CSL project provides further information on finding and editing\nstyles.\n.PP\nThe \\f[CR]\\-\\-citation\\-abbreviations\\f[R] option (or the\n\\f[CR]citation\\-abbreviations\\f[R] metadata field) may be used to\nspecify a JSON file containing abbreviations of journals that should be\nused in formatted bibliographies when \\f[CR]form=\\(dqshort\\(dq\\f[R] is\nspecified.\nThe format of the file can be illustrated with an example:\n.IP\n.EX\n{ \\(dqdefault\\(dq: {\n    \\(dqcontainer\\-title\\(dq: {\n            \\(dqLloyd\\(aqs Law Reports\\(dq: \\(dqLloyd\\(aqs Rep\\(dq,\n            \\(dqEstates Gazette\\(dq: \\(dqEG\\(dq,\n            \\(dqScots Law Times\\(dq: \\(dqSLT\\(dq\n    }\n  }\n}\n.EE\n.SS Citations in note styles\nPandoc\\(cqs citation processing is designed to allow you to move between\nauthor\\-date, numerical, and note styles without modifying the Markdown\nsource.\nWhen you\\(cqre using a note style, avoid inserting footnotes manually.\nInstead, insert citations just as you would in an author\\-date\nstyle\\(emfor example,\n.IP\n.EX\nBlah blah [\\(atfoo, p. 33].\n.EE\n.PP\nThe footnote will be created automatically.\nPandoc will take care of removing the space and moving the note before\nor after the period, depending on the setting of\n\\f[CR]notes\\-after\\-punctuation\\f[R], as described below in Other\nrelevant metadata fields.\n.PP\nIn some cases you may need to put a citation inside a regular footnote.\nNormal citations in footnotes (such as \\f[CR][\\(atfoo, p. 33]\\f[R]) will\nbe rendered in parentheses.\nIn\\-text citations (such as \\f[CR]\\(atfoo [p. 33]\\f[R]) will be rendered\nwithout parentheses.\n(A comma will be added if appropriate.)\nThus:\n.IP\n.EX\n[\\(ha1]:  Some studies [\\(atfoo; \\(atbar, p. 33] show that\nfrubulicious zoosnaps are quantical.  For a survey\nof the literature, see \\(atbaz [chap. 1].\n.EE\n.SS Placement of the bibliography\nIf the style calls for a list of works cited, it will be placed in a div\nwith id \\f[CR]refs\\f[R], if one exists:\n.IP\n.EX\n::: {#refs}\n:::\n.EE\n.PP\nOtherwise, it will be placed at the end of the document.\nGeneration of the bibliography can be suppressed by setting\n\\f[CR]suppress\\-bibliography: true\\f[R] in the YAML metadata.\n.PP\nIf you wish the bibliography to have a section heading, you can set\n\\f[CR]reference\\-section\\-title\\f[R] in the metadata, or put the heading\nat the beginning of the div with id \\f[CR]refs\\f[R] (if you are using\nit) or at the end of your document:\n.IP\n.EX\nlast paragraph...\n\n# References\n.EE\n.PP\nThe bibliography will be inserted after this heading.\nNote that the \\f[CR]unnumbered\\f[R] class will be added to this heading,\nso that the section will not be numbered.\n.PP\nIf you want to put the bibliography into a variable in your template,\none way to do that is to put the div with id \\f[CR]refs\\f[R] into a\nmetadata field, e.g.\n.IP\n.EX\n\\-\\-\\-\nrefs: |\n   ::: {#refs}\n   :::\n\\&...\n.EE\n.PP\nYou can then put the variable \\f[CR]$refs$\\f[R] into your template where\nyou want the bibliography to be placed.\n.SS Including uncited items in the bibliography\nIf you want to include items in the bibliography without actually citing\nthem in the body text, you can define a dummy \\f[CR]nocite\\f[R] metadata\nfield and put the citations there:\n.IP\n.EX\n\\-\\-\\-\nnocite: |\n  \\(atitem1, \\(atitem2\n\\&...\n\n\\(atitem3\n.EE\n.PP\nIn this example, the document will contain a citation for\n\\f[CR]item3\\f[R] only, but the bibliography will contain entries for\n\\f[CR]item1\\f[R], \\f[CR]item2\\f[R], and \\f[CR]item3\\f[R].\n.PP\nIt is possible to create a bibliography with all the citations, whether\nor not they appear in the document, by using a wildcard:\n.IP\n.EX\n\\-\\-\\-\nnocite: |\n  \\(at*\n\\&...\n.EE\n.PP\nFor LaTeX output, you can also use \\f[CR]natbib\\f[R] or\n\\f[CR]biblatex\\f[R] to render the bibliography.\nIn order to do so, specify bibliography files as outlined above, and add\n\\f[CR]\\-\\-natbib\\f[R] or \\f[CR]\\-\\-biblatex\\f[R] argument to pandoc\ninvocation.\nBear in mind that bibliography files have to be in either BibTeX (for\n\\f[CR]\\-\\-natbib\\f[R]) or BibLaTeX (for \\f[CR]\\-\\-biblatex\\f[R]) format.\n.SS Other relevant metadata fields\nA few other metadata fields affect bibliography formatting:\n.TP\n\\f[CR]link\\-citations\\f[R]\nIf true, citations will be hyperlinked to the corresponding bibliography\nentries (for author\\-date and numerical styles only).\nDefaults to false.\n.TP\n\\f[CR]link\\-bibliography\\f[R]\nIf true, DOIs, PMCIDs, PMID, and URLs in bibliographies will be rendered\nas hyperlinks.\n(If an entry contains a DOI, PMCID, PMID, or URL, but none of these\nfields are rendered by the style, then the title, or in the absence of a\ntitle the whole entry, will be hyperlinked.)\nDefaults to true.\n.TP\n\\f[CR]lang\\f[R]\nThe \\f[CR]lang\\f[R] field will affect how the style is localized, for\nexample in the translation of labels, the use of quotation marks, and\nthe way items are sorted.\n(For backwards compatibility, \\f[CR]locale\\f[R] may be used instead of\n\\f[CR]lang\\f[R], but this use is deprecated.)\n.RS\nA BCP 47 language tag is expected: for example, \\f[CR]en\\f[R],\n\\f[CR]de\\f[R], \\f[CR]en\\-US\\f[R], \\f[CR]fr\\-CA\\f[R],\n\\f[CR]ug\\-Cyrl\\f[R].\nThe unicode extension syntax (after \\f[CR]\\-u\\-\\f[R]) may be used to\nspecify options for collation (sorting) more precisely.\nHere are some examples:\n.IP \\(bu 2\n\\f[CR]zh\\-u\\-co\\-pinyin\\f[R]: Chinese with the Pinyin collation.\n.IP \\(bu 2\n\\f[CR]es\\-u\\-co\\-trad\\f[R]: Spanish with the traditional collation (with\n\\f[CR]Ch\\f[R] sorting after \\f[CR]C\\f[R]).\n.IP \\(bu 2\n\\f[CR]fr\\-u\\-kb\\f[R]: French with \\(lqbackwards\\(rq accent sorting (with\n\\f[CR]coté\\f[R] sorting after \\f[CR]côte\\f[R]).\n.IP \\(bu 2\n\\f[CR]en\\-US\\-u\\-kf\\-upper\\f[R]: English with uppercase letters sorting\nbefore lower (default is lower before upper).\n.RE\n.TP\n\\f[CR]notes\\-after\\-punctuation\\f[R]\nIf true (the default for note styles), pandoc will put footnote\nreferences or superscripted numerical citations after following\npunctuation.\nFor example, if the source contains \\f[CR]blah blah [\\(atjones99].\\f[R],\nthe result will look like \\f[CR]blah blah.[\\(ha1]\\f[R], with the note\nmoved after the period and the space collapsed.\nIf false, the space will still be collapsed, but the footnote will not\nbe moved after the punctuation.\nThe option may also be used in numerical styles that use superscripts\nfor citation numbers (but for these styles the default is not to move\nthe citation).\n.SH SLIDE SHOWS\nYou can use pandoc to produce an HTML + JavaScript slide presentation\nthat can be viewed via a web browser.\nThere are five ways to do this, using S5, DZSlides, Slidy, Slideous, or\nreveal.js.\nYou can also produce a PDF slide show using LaTeX \\f[CR]beamer\\f[R], or\nslide shows in Microsoft PowerPoint format.\n.PP\nHere\\(cqs the Markdown source for a simple slide show,\n\\f[CR]habits.txt\\f[R]:\n.IP\n.EX\n% Habits\n% John Doe\n% March 22, 2005\n\n# In the morning\n\n## Getting up\n\n\\- Turn off alarm\n\\- Get out of bed\n\n## Breakfast\n\n\\- Eat eggs\n\\- Drink coffee\n\n# In the evening\n\n## Dinner\n\n\\- Eat spaghetti\n\\- Drink wine\n\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\n![picture of spaghetti](images/spaghetti.jpg)\n\n## Going to sleep\n\n\\- Get in bed\n\\- Count sheep\n.EE\n.PP\nTo produce an HTML/JavaScript slide show, simply type\n.IP\n.EX\npandoc \\-t FORMAT \\-s habits.txt \\-o habits.html\n.EE\n.PP\nwhere \\f[CR]FORMAT\\f[R] is either \\f[CR]s5\\f[R], \\f[CR]slidy\\f[R],\n\\f[CR]slideous\\f[R], \\f[CR]dzslides\\f[R], or \\f[CR]revealjs\\f[R].\n.PP\nFor Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with\nthe \\f[CR]\\-s/\\-\\-standalone\\f[R] option embeds a link to JavaScript and\nCSS files, which are assumed to be available at the relative path\n\\f[CR]s5/default\\f[R] (for S5), \\f[CR]slideous\\f[R] (for Slideous),\n\\f[CR]reveal.js\\f[R] (for reveal.js), or at the Slidy website at\n\\f[CR]w3.org\\f[R] (for Slidy).\n(These paths can be changed by setting the \\f[CR]slidy\\-url\\f[R],\n\\f[CR]slideous\\-url\\f[R], \\f[CR]revealjs\\-url\\f[R], or\n\\f[CR]s5\\-url\\f[R] variables; see Variables for HTML slides, above.)\nFor DZSlides, the (relatively short) JavaScript and CSS are included in\nthe file by default.\n.PP\nWith all HTML slide formats, the \\f[CR]\\-\\-self\\-contained\\f[R] option\ncan be used to produce a single file that contains all of the data\nnecessary to display the slide show, including linked scripts,\nstylesheets, images, and videos.\n.PP\nTo produce a PDF slide show using beamer, type\n.IP\n.EX\npandoc \\-t beamer habits.txt \\-o habits.pdf\n.EE\n.PP\nNote that a reveal.js slide show can also be converted to a PDF by\nprinting it to a file from the browser.\n.PP\nTo produce a PowerPoint slide show, type\n.IP\n.EX\npandoc habits.txt \\-o habits.pptx\n.EE\n.SS Structuring the slide show\nBy default, the \\f[I]slide level\\f[R] is the highest heading level in\nthe hierarchy that is followed immediately by content, and not another\nheading, somewhere in the document.\nIn the example above, level\\-1 headings are always followed by level\\-2\nheadings, which are followed by content, so the slide level is 2.\nThis default can be overridden using the \\f[CR]\\-\\-slide\\-level\\f[R]\noption.\n.PP\nThe document is carved up into slides according to the following rules:\n.IP \\(bu 2\nA horizontal rule always starts a new slide.\n.IP \\(bu 2\nA heading at the slide level always starts a new slide.\n.IP \\(bu 2\nHeadings \\f[I]below\\f[R] the slide level in the hierarchy create\nheadings \\f[I]within\\f[R] a slide.\n(In beamer, a \\(lqblock\\(rq will be created.\nIf the heading has the class \\f[CR]example\\f[R], an\n\\f[CR]exampleblock\\f[R] environment will be used; if it has the class\n\\f[CR]alert\\f[R], an \\f[CR]alertblock\\f[R] will be used; otherwise a\nregular \\f[CR]block\\f[R] will be used.)\n.IP \\(bu 2\nHeadings \\f[I]above\\f[R] the slide level in the hierarchy create\n\\(lqtitle slides,\\(rq which just contain the section title and help to\nbreak the slide show into sections.\nNon\\-slide content under these headings will be included on the title\nslide (for HTML slide shows) or in a subsequent slide with the same\ntitle (for beamer).\n.IP \\(bu 2\nA title page is constructed automatically from the document\\(cqs title\nblock, if present.\n(In the case of beamer, this can be disabled by commenting out some\nlines in the default template.)\n.PP\nThese rules are designed to support many different styles of slide show.\nIf you don\\(cqt care about structuring your slides into sections and\nsubsections, you can either just use level\\-1 headings for all slides\n(in that case, level 1 will be the slide level) or you can set\n\\f[CR]\\-\\-slide\\-level=0\\f[R].\n.PP\nNote: in reveal.js slide shows, if slide level is 2, a two\\-dimensional\nlayout will be produced, with level\\-1 headings building horizontally\nand level\\-2 headings building vertically.\nIt is not recommended that you use deeper nesting of section levels with\nreveal.js unless you set \\f[CR]\\-\\-slide\\-level=0\\f[R] (which lets\nreveal.js produce a one\\-dimensional layout and only interprets\nhorizontal rules as slide boundaries).\n.SS PowerPoint layout choice\nWhen creating slides, the pptx writer chooses from a number of\npre\\-defined layouts, based on the content of the slide:\n.TP\nTitle Slide\nThis layout is used for the initial slide, which is generated and filled\nfrom the metadata fields \\f[CR]date\\f[R], \\f[CR]author\\f[R], and\n\\f[CR]title\\f[R], if they are present.\n.TP\nSection Header\nThis layout is used for what pandoc calls \\(lqtitle slides\\(rq, i.e.\nslides which start with a header which is above the slide level in the\nhierarchy.\n.TP\nTwo Content\nThis layout is used for two\\-column slides, i.e.\\ slides containing a\ndiv with class \\f[CR]columns\\f[R] which contains at least two divs with\nclass \\f[CR]column\\f[R].\n.TP\nComparison\nThis layout is used instead of \\(lqTwo Content\\(rq for any two\\-column\nslides in which at least one column contains text followed by non\\-text\n(e.g.\\ an image or a table).\n.TP\nContent with Caption\nThis layout is used for any non\\-two\\-column slides which contain text\nfollowed by non\\-text (e.g.\\ an image or a table).\n.TP\nBlank\nThis layout is used for any slides which only contain blank content,\ne.g.\\ a slide containing only speaker notes, or a slide containing only\na non\\-breaking space.\n.TP\nTitle and Content\nThis layout is used for all slides which do not match the criteria for\nanother layout.\n.PP\nThese layouts are chosen from the default pptx reference doc included\nwith pandoc, unless an alternative reference doc is specified using\n\\f[CR]\\-\\-reference\\-doc\\f[R].\n.SS Incremental lists\nBy default, these writers produce lists that display \\(lqall at\nonce.\\(rq If you want your lists to display incrementally (one item at a\ntime), use the \\f[CR]\\-i\\f[R] option.\nIf you want a particular list to depart from the default, put it in a\n\\f[CR]div\\f[R] block with class \\f[CR]incremental\\f[R] or\n\\f[CR]nonincremental\\f[R].\nSo, for example, using the \\f[CR]fenced div\\f[R] syntax, the following\nwould be incremental regardless of the document default:\n.IP\n.EX\n::: incremental\n\n\\- Eat spaghetti\n\\- Drink wine\n\n:::\n.EE\n.PP\nor\n.IP\n.EX\n::: nonincremental\n\n\\- Eat spaghetti\n\\- Drink wine\n\n:::\n.EE\n.PP\nWhile using \\f[CR]incremental\\f[R] and \\f[CR]nonincremental\\f[R] divs is\nthe recommended method of setting incremental lists on a per\\-case\nbasis, an older method is also supported: putting lists inside a\nblockquote will depart from the document default (that is, it will\ndisplay incrementally without the \\f[CR]\\-i\\f[R] option and all at once\nwith the \\f[CR]\\-i\\f[R] option):\n.IP\n.EX\n> \\- Eat spaghetti\n> \\- Drink wine\n.EE\n.PP\nBoth methods allow incremental and nonincremental lists to be mixed in a\nsingle document.\n.PP\nIf you want to include a block\\-quoted list, you can work around this\nbehavior by putting the list inside a fenced div, so that it is not the\ndirect child of the block quote:\n.IP\n.EX\n> ::: wrapper\n> \\- a\n> \\- list in a quote\n> :::\n.EE\n.SS Inserting pauses\nYou can add \\(lqpauses\\(rq within a slide by including a paragraph\ncontaining three dots, separated by spaces:\n.IP\n.EX\n# Slide with a pause\n\ncontent before the pause\n\n\\&. . .\n\ncontent after the pause\n.EE\n.PP\nNote: this feature is not yet implemented for PowerPoint output.\n.SS Styling the slides\nYou can change the style of HTML slides by putting customized CSS files\nin \\f[CR]$DATADIR/s5/default\\f[R] (for S5), \\f[CR]$DATADIR/slidy\\f[R]\n(for Slidy), or \\f[CR]$DATADIR/slideous\\f[R] (for Slideous), where\n\\f[CR]$DATADIR\\f[R] is the user data directory (see\n\\f[CR]\\-\\-data\\-dir\\f[R], above).\nThe originals may be found in pandoc\\(cqs system data directory\n(generally \\f[CR]$CABALDIR/pandoc\\-VERSION/s5/default\\f[R]).\nPandoc will look there for any files it does not find in the user data\ndirectory.\n.PP\nFor dzslides, the CSS is included in the HTML file itself, and may be\nmodified there.\n.PP\nAll reveal.js configuration options can be set through variables.\nFor example, themes can be used by setting the \\f[CR]theme\\f[R]\nvariable:\n.IP\n.EX\n\\-V theme=moon\n.EE\n.PP\nOr you can specify a custom stylesheet using the \\f[CR]\\-\\-css\\f[R]\noption.\n.PP\nTo style beamer slides, you can specify a \\f[CR]theme\\f[R],\n\\f[CR]colortheme\\f[R], \\f[CR]fonttheme\\f[R], \\f[CR]innertheme\\f[R], and\n\\f[CR]outertheme\\f[R], using the \\f[CR]\\-V\\f[R] option:\n.IP\n.EX\npandoc \\-t beamer habits.txt \\-V theme:Warsaw \\-o habits.pdf\n.EE\n.PP\nNote that heading attributes will turn into slide attributes (on a\n\\f[CR]<div>\\f[R] or \\f[CR]<section>\\f[R]) in HTML slide formats,\nallowing you to style individual slides.\nIn beamer, a number of heading classes and attributes are recognized as\nframe options and will be passed through as options to the frame: see\nFrame attributes in beamer, below.\n.SS Speaker notes\nSpeaker notes are supported in reveal.js, PowerPoint (pptx), and beamer\noutput.\nYou can add notes to your Markdown document thus:\n.IP\n.EX\n::: notes\n\nThis is my note.\n\n\\- It can contain Markdown\n\\- like this list\n\n:::\n.EE\n.PP\nTo show the notes window in reveal.js, press \\f[CR]s\\f[R] while viewing\nthe presentation.\nSpeaker notes in PowerPoint will be available, as usual, in handouts and\npresenter view.\n.PP\nNotes are not yet supported for other slide formats, but the notes will\nnot appear on the slides themselves.\n.SS Speaker notes on the title slide (PowerPoint)\nFor PowerPoint output, the title slide is generated from the\ndocument\\(cqs YAML metadata block.\nTo add speaker notes to this slide, use a \\f[CR]notes\\f[R] field in the\nmetadata:\n.IP\n.EX\n\\-\\-\\-\ntitle: My Presentation\nauthor: Jane Doe\nnotes: |\n  Welcome everyone to this presentation.\n\n  Remember to introduce yourself and mention the key topics.\n\\-\\-\\-\n.EE\n.PP\nThe \\f[CR]notes\\f[R] field can contain multiple paragraphs and Markdown\nformatting.\n.SS Columns\nTo put material in side by side columns, you can use a native div\ncontainer with class \\f[CR]columns\\f[R], containing two or more div\ncontainers with class \\f[CR]column\\f[R] and a \\f[CR]width\\f[R]\nattribute:\n.IP\n.EX\n:::::::::::::: {.columns}\n::: {.column width=\\(dq40%\\(dq}\ncontents...\n:::\n::: {.column width=\\(dq60%\\(dq}\ncontents...\n:::\n::::::::::::::\n.EE\n.PP\nNote: Specifying column widths does not currently work for PowerPoint.\n.SS Additional columns attributes in beamer\nThe div containers with classes \\f[CR]columns\\f[R] and \\f[CR]column\\f[R]\ncan optionally have an \\f[CR]align\\f[R] attribute.\nThe class \\f[CR]columns\\f[R] can optionally have a \\f[CR]totalwidth\\f[R]\nattribute or an \\f[CR]onlytextwidth\\f[R] class.\n.IP\n.EX\n:::::::::::::: {.columns align=center totalwidth=8em}\n::: {.column width=\\(dq40%\\(dq}\ncontents...\n:::\n::: {.column width=\\(dq60%\\(dq align=bottom}\ncontents...\n:::\n::::::::::::::\n.EE\n.PP\nThe \\f[CR]align\\f[R] attributes on \\f[CR]columns\\f[R] and\n\\f[CR]column\\f[R] can be used with the values \\f[CR]top\\f[R],\n\\f[CR]top\\-baseline\\f[R], \\f[CR]center\\f[R] and \\f[CR]bottom\\f[R] to\nvertically align the columns.\nIt defaults to \\f[CR]top\\f[R] in \\f[CR]columns\\f[R].\n.PP\nThe \\f[CR]totalwidth\\f[R] attribute limits the width of the columns to\nthe given value.\n.IP\n.EX\n:::::::::::::: {.columns align=top .onlytextwidth}\n::: {.column width=\\(dq40%\\(dq align=center}\ncontents...\n:::\n::: {.column width=\\(dq60%\\(dq}\ncontents...\n:::\n::::::::::::::\n.EE\n.PP\nThe class \\f[CR]onlytextwidth\\f[R] sets the \\f[CR]totalwidth\\f[R] to\n\\f[CR]\\(rstextwidth\\f[R].\n.PP\nSee Section 12.7 of the Beamer User\\(cqs Guide for more details.\n.SS Frame attributes in beamer\nSometimes it is necessary to add the LaTeX \\f[CR][fragile]\\f[R] option\nto a frame in beamer (for example, when using the \\f[CR]minted\\f[R]\nenvironment).\nThis can be forced by adding the \\f[CR]fragile\\f[R] class to the heading\nintroducing the slide:\n.IP\n.EX\n# Fragile slide {.fragile}\n.EE\n.PP\nAll of the other frame attributes described in Section 8.1 of the Beamer\nUser\\(cqs Guide may also be used: \\f[CR]allowdisplaybreaks\\f[R],\n\\f[CR]allowframebreaks\\f[R], \\f[CR]b\\f[R], \\f[CR]c\\f[R], \\f[CR]s\\f[R],\n\\f[CR]t\\f[R], \\f[CR]environment\\f[R], \\f[CR]label\\f[R],\n\\f[CR]plain\\f[R], \\f[CR]shrink\\f[R], \\f[CR]standout\\f[R],\n\\f[CR]noframenumbering\\f[R], \\f[CR]squeeze\\f[R].\n\\f[CR]allowframebreaks\\f[R] is recommended especially for\nbibliographies, as it allows multiple slides to be created if the\ncontent overfills the frame:\n.IP\n.EX\n# References {.allowframebreaks}\n.EE\n.PP\nIn addition, the \\f[CR]frameoptions\\f[R] attribute may be used to pass\narbitrary frame options to a beamer slide:\n.IP\n.EX\n# Heading {frameoptions=\\(dqsqueeze,shrink,customoption=foobar\\(dq}\n.EE\n.SS Background in reveal.js, beamer, and pptx\nBackground images can be added to self\\-contained reveal.js slide shows,\nbeamer slide shows, and pptx slide shows.\n.SS On all slides (beamer, reveal.js, pptx)\nWith beamer and reveal.js, the configuration option\n\\f[CR]background\\-image\\f[R] can be used either in the YAML metadata\nblock or as a command\\-line variable to get the same image on every\nslide.\n.PP\nNote that for reveal.js, the \\f[CR]background\\-image\\f[R] will be used\nas a \\f[CR]parallaxBackgroundImage\\f[R] (see below).\n.PP\nFor pptx, you can use a \\f[CR]\\-\\-reference\\-doc\\f[R] in which\nbackground images have been set on the relevant layouts.\n.SS \\f[CR]parallaxBackgroundImage\\f[R] (reveal.js)\nFor reveal.js, there is also the reveal.js\\-native option\n\\f[CR]parallaxBackgroundImage\\f[R], which produces a parallax scrolling\nbackground.\nYou must also set \\f[CR]parallaxBackgroundSize\\f[R], and can optionally\nset \\f[CR]parallaxBackgroundHorizontal\\f[R] and\n\\f[CR]parallaxBackgroundVertical\\f[R] to configure the scrolling\nbehaviour.\nSee the reveal.js documentation for more details about the meaning of\nthese options.\n.PP\nIn reveal.js\\(cqs overview mode, the parallaxBackgroundImage will show\nup only on the first slide.\n.SS On individual slides (reveal.js, pptx)\nTo set an image for a particular reveal.js or pptx slide, add\n\\f[CR]{background\\-image=\\(dq/path/to/image\\(dq}\\f[R] to the first\nslide\\-level heading on the slide (which may even be empty).\n.PP\nAs the HTML writers pass unknown attributes through, other reveal.js\nbackground settings also work on individual slides, including\n\\f[CR]background\\-size\\f[R], \\f[CR]background\\-repeat\\f[R],\n\\f[CR]background\\-color\\f[R], \\f[CR]transition\\f[R], and\n\\f[CR]transition\\-speed\\f[R].\n(The \\f[CR]data\\-\\f[R] prefix will automatically be added.)\n.PP\nNote: \\f[CR]data\\-background\\-image\\f[R] is also supported in pptx for\nconsistency with reveal.js \\(en if \\f[CR]background\\-image\\f[R] isn\\(cqt\nfound, \\f[CR]data\\-background\\-image\\f[R] will be checked.\n.SS On the title slide (reveal.js, pptx)\nTo add a background image to the automatically generated title slide for\nreveal.js, use the \\f[CR]title\\-slide\\-attributes\\f[R] variable in the\nYAML metadata block.\nIt must contain a map of attribute names and values.\n(Note that the \\f[CR]data\\-\\f[R] prefix is required here, as it isn\\(cqt\nadded automatically.)\n.PP\nFor pptx, pass a \\f[CR]\\-\\-reference\\-doc\\f[R] with the background image\nset on the \\(lqTitle Slide\\(rq layout.\n.SS Example (reveal.js)\n.IP\n.EX\n\\-\\-\\-\ntitle: My Slide Show\nparallaxBackgroundImage: /path/to/my/background_image.png\ntitle\\-slide\\-attributes:\n    data\\-background\\-image: /path/to/title_image.png\n    data\\-background\\-size: contain\n\\-\\-\\-\n\n## Slide One\n\nSlide 1 has background_image.png as its background.\n\n## {background\\-image=\\(dq/path/to/special_image.jpg\\(dq}\n\nSlide 2 has a special image for its background, even though the heading has no content.\n.EE\n.SH EPUBS\n.SS EPUB Metadata\nThere are two ways to specify metadata for an EPUB.\nThe first is to use the \\f[CR]\\-\\-epub\\-metadata\\f[R] option, which\ntakes as its argument an XML file with Dublin Core elements.\n.PP\nThe second way is to use YAML, either in a YAML metadata block in a\nMarkdown document, or in a separate YAML file specified with\n\\f[CR]\\-\\-metadata\\-file\\f[R].\nHere is an example of a YAML metadata block with EPUB metadata:\n.IP\n.EX\n\\-\\-\\-\ntitle:\n\\- type: main\n  text: My Book\n\\- type: subtitle\n  text: An investigation of metadata\ncreator:\n\\- role: author\n  text: John Smith\n\\- role: editor\n  text: Sarah Jones\nidentifier:\n\\- scheme: DOI\n  text: doi:10.234234.234/33\npublisher:  My Press\nrights: © 2007 John Smith, CC BY\\-NC\nibooks:\n  version: 1.3.4\n\\&...\n.EE\n.PP\nThe following fields are recognized:\n.TP\n\\f[CR]identifier\\f[R]\nEither a string value or an object with fields \\f[CR]text\\f[R] and\n\\f[CR]scheme\\f[R].\nValid values for \\f[CR]scheme\\f[R] are \\f[CR]ISBN\\-10\\f[R],\n\\f[CR]GTIN\\-13\\f[R], \\f[CR]UPC\\f[R], \\f[CR]ISMN\\-10\\f[R],\n\\f[CR]DOI\\f[R], \\f[CR]LCCN\\f[R], \\f[CR]GTIN\\-14\\f[R],\n\\f[CR]ISBN\\-13\\f[R], \\f[CR]Legal deposit number\\f[R], \\f[CR]URN\\f[R],\n\\f[CR]OCLC number\\f[R], \\f[CR]Co\\-publisher\\(cqs ISBN\\-13\\f[R],\n\\f[CR]ISMN\\-13\\f[R], \\f[CR]ISBN\\-A\\f[R], \\f[CR]JP e\\-code\\f[R],\n\\f[CR]OLCC number\\f[R], \\f[CR]JP Magazine ID\\f[R], \\f[CR]UPC\\-12+5\\f[R],\n\\f[CR]BNF Control number\\f[R], \\f[CR]ISSN\\-13\\f[R], \\f[CR]ARK\\f[R],\n\\f[CR]Digital file internal version number\\f[R].\n.TP\n\\f[CR]title\\f[R]\nEither a string value, or an object with fields \\f[CR]file\\-as\\f[R] and\n\\f[CR]type\\f[R], or a list of such objects.\nValid values for \\f[CR]type\\f[R] are \\f[CR]main\\f[R],\n\\f[CR]subtitle\\f[R], \\f[CR]short\\f[R], \\f[CR]collection\\f[R],\n\\f[CR]edition\\f[R], \\f[CR]extended\\f[R].\n.TP\n\\f[CR]creator\\f[R]\nEither a string value, or an object with fields \\f[CR]role\\f[R],\n\\f[CR]file\\-as\\f[R], and \\f[CR]text\\f[R], or a list of such objects.\nValid values for \\f[CR]role\\f[R] are MARC relators, but pandoc will\nattempt to translate the human\\-readable versions (like \\(lqauthor\\(rq\nand \\(lqeditor\\(rq) to the appropriate marc relators.\n.TP\n\\f[CR]contributor\\f[R]\nSame format as \\f[CR]creator\\f[R].\n.TP\n\\f[CR]date\\f[R]\nA string value in \\f[CR]YYYY\\-MM\\-DD\\f[R] format.\n(Only the year is necessary.)\nPandoc will attempt to convert other common date formats.\n.TP\n\\f[CR]lang\\f[R] (or legacy: \\f[CR]language\\f[R])\nA string value in BCP 47 format.\nPandoc will default to the local language if nothing is specified.\n.TP\n\\f[CR]subject\\f[R]\nEither a string value, or an object with fields \\f[CR]text\\f[R],\n\\f[CR]authority\\f[R], and \\f[CR]term\\f[R], or a list of such objects.\nValid values for \\f[CR]authority\\f[R] are either a reserved authority\nvalue (currently \\f[CR]AAT\\f[R], \\f[CR]BIC\\f[R], \\f[CR]BISAC\\f[R],\n\\f[CR]CLC\\f[R], \\f[CR]DDC\\f[R], \\f[CR]CLIL\\f[R], \\f[CR]EuroVoc\\f[R],\n\\f[CR]MEDTOP\\f[R], \\f[CR]LCSH\\f[R], \\f[CR]NDC\\f[R], \\f[CR]Thema\\f[R],\n\\f[CR]UDC\\f[R], and \\f[CR]WGS\\f[R]) or an absolute IRI identifying a\ncustom scheme.\nValid values for \\f[CR]term\\f[R] are defined by the scheme.\n.TP\n\\f[CR]description\\f[R]\nA string value.\n.TP\n\\f[CR]type\\f[R]\nA string value.\n.TP\n\\f[CR]format\\f[R]\nA string value.\n.TP\n\\f[CR]relation\\f[R]\nA string value.\n.TP\n\\f[CR]coverage\\f[R]\nA string value.\n.TP\n\\f[CR]rights\\f[R]\nA string value.\n.TP\n\\f[CR]belongs\\-to\\-collection\\f[R]\nA string value.\nIdentifies the name of a collection to which the EPUB Publication\nbelongs.\n.TP\n\\f[CR]group\\-position\\f[R]\nThe \\f[CR]group\\-position\\f[R] field indicates the numeric position in\nwhich the EPUB Publication belongs relative to other works belonging to\nthe same \\f[CR]belongs\\-to\\-collection\\f[R] field.\n.TP\n\\f[CR]cover\\-image\\f[R]\nA string value (path to cover image).\n.TP\n\\f[CR]css\\f[R] (or legacy: \\f[CR]stylesheet\\f[R])\nA string value (path to CSS stylesheet).\n.TP\n\\f[CR]page\\-progression\\-direction\\f[R]\nEither \\f[CR]ltr\\f[R] or \\f[CR]rtl\\f[R].\nSpecifies the \\f[CR]page\\-progression\\-direction\\f[R] attribute for the\n\\f[CR]spine\\f[R] element.\n.TP\n\\f[CR]accessModes\\f[R]\nAn array of strings (schema).\nDefaults to \\f[CR][\\(dqtextual\\(dq]\\f[R].\n.TP\n\\f[CR]accessModeSufficient\\f[R]\nAn array of strings (schema).\nDefaults to \\f[CR][\\(dqtextual\\(dq]\\f[R].\n.TP\n\\f[CR]accessibilityHazards\\f[R]\nAn array of strings (schema).\nDefaults to \\f[CR][\\(dqnone\\(dq]\\f[R].\n.TP\n\\f[CR]accessibilityFeatures\\f[R]\nAn array of strings (schema).\nDefaults to\n.RS\n.IP\n.EX\n\\- \\(dqalternativeText\\(dq\n\\- \\(dqreadingOrder\\(dq\n\\- \\(dqstructuralNavigation\\(dq\n\\- \\(dqtableOfContents\\(dq\n.EE\n.RE\n.TP\n\\f[CR]accessibilitySummary\\f[R]\nA string value.\n.TP\n\\f[CR]ibooks\\f[R]\niBooks\\-specific metadata, with the following fields:\n.RS\n.IP \\(bu 2\n\\f[CR]version\\f[R]: (string)\n.IP \\(bu 2\n\\f[CR]specified\\-fonts\\f[R]: \\f[CR]true\\f[R]|\\f[CR]false\\f[R] (default\n\\f[CR]false\\f[R])\n.IP \\(bu 2\n\\f[CR]ipad\\-orientation\\-lock\\f[R]:\n\\f[CR]portrait\\-only\\f[R]|\\f[CR]landscape\\-only\\f[R]\n.IP \\(bu 2\n\\f[CR]iphone\\-orientation\\-lock\\f[R]:\n\\f[CR]portrait\\-only\\f[R]|\\f[CR]landscape\\-only\\f[R]\n.IP \\(bu 2\n\\f[CR]binding\\f[R]: \\f[CR]true\\f[R]|\\f[CR]false\\f[R] (default\n\\f[CR]true\\f[R])\n.IP \\(bu 2\n\\f[CR]scroll\\-axis\\f[R]:\n\\f[CR]vertical\\f[R]|\\f[CR]horizontal\\f[R]|\\f[CR]default\\f[R]\n.RE\n.SS The \\f[CR]epub:type\\f[R] attribute\nFor \\f[CR]epub3\\f[R] output, you can mark up the heading that\ncorresponds to an EPUB chapter using the \\f[CR]epub:type\\f[R] attribute.\nFor example, to set the attribute to the value \\f[CR]prologue\\f[R], use\nthis Markdown:\n.IP\n.EX\n# My chapter {epub:type=prologue}\n.EE\n.PP\nWhich will result in:\n.IP\n.EX\n<body epub:type=\\(dqfrontmatter\\(dq>\n  <section epub:type=\\(dqprologue\\(dq>\n    <h1>My chapter</h1>\n.EE\n.PP\nPandoc will output \\f[CR]<body epub:type=\\(dqbodymatter\\(dq>\\f[R],\nunless you use one of the following values, in which case either\n\\f[CR]frontmatter\\f[R] or \\f[CR]backmatter\\f[R] will be output.\n.RS -14n\n.IP\n.EX\n  epub:type of first section   epub:type of body\n  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n  prologue                     frontmatter\n  abstract                     frontmatter\n  acknowledgments              frontmatter\n  copyright\\-page               frontmatter\n  dedication                   frontmatter\n  credits                      frontmatter\n  keywords                     frontmatter\n  imprint                      frontmatter\n  contributors                 frontmatter\n  other\\-credits                frontmatter\n  errata                       frontmatter\n  revision\\-history             frontmatter\n  titlepage                    frontmatter\n  halftitlepage                frontmatter\n  seriespage                   frontmatter\n  foreword                     frontmatter\n  preface                      frontmatter\n  frontispiece                 frontmatter\n  appendix                     backmatter\n  colophon                     backmatter\n  bibliography                 backmatter\n  index                        backmatter\n.EE\n.RE\n.SS Linked media\nBy default, pandoc will download media referenced from any\n\\f[CR]<img>\\f[R], \\f[CR]<audio>\\f[R], \\f[CR]<video>\\f[R] or\n\\f[CR]<source>\\f[R] element present in the generated EPUB, and include\nit in the EPUB container, yielding a completely self\\-contained EPUB.\nIf you want to link to external media resources instead, use raw HTML in\nyour source and add \\f[CR]data\\-external=\\(dq1\\(dq\\f[R] to the tag with\nthe \\f[CR]src\\f[R] attribute.\nFor example:\n.IP\n.EX\n<audio controls=\\(dq1\\(dq>\n  <source src=\\(dqhttps://example.com/music/toccata.mp3\\(dq\n          data\\-external=\\(dq1\\(dq type=\\(dqaudio/mpeg\\(dq>\n  </source>\n</audio>\n.EE\n.PP\nIf the input format already is HTML then\n\\f[CR]data\\-external=\\(dq1\\(dq\\f[R] will work as expected for\n\\f[CR]<img>\\f[R] elements.\nSimilarly, for Markdown, external images can be declared with\n\\f[CR]![img](url){external=1}\\f[R].\nNote that this only works for images; the other media elements have no\nnative representation in pandoc\\(cqs AST and require the use of raw\nHTML.\n.SS EPUB styling\nBy default, pandoc will include some basic styling contained in its\n\\f[CR]epub.css\\f[R] data file.\n(To see this, use\n\\f[CR]pandoc \\-\\-print\\-default\\-data\\-file epub.css\\f[R].)\nTo use a different CSS file, just use the \\f[CR]\\-\\-css\\f[R] command\nline option.\nA few inline styles are defined in addition; these are essential for\ncorrect formatting of pandoc\\(cqs HTML output.\n.PP\nThe \\f[CR]document\\-css\\f[R] variable may be set if the more opinionated\nstyling of pandoc\\(cqs default HTML templates is desired (and in that\ncase the variables defined in Variables for HTML may be used to\nfine\\-tune the style).\n.SH CHUNKED HTML\n\\f[CR]pandoc \\-t chunkedhtml\\f[R] will produce a zip archive of linked\nHTML files, one for each section of the original document.\nInternal links will automatically be adjusted to point to the right\nplace, images linked to under the working directory will be\nincorporated, and navigation links will be added.\nIn addition, a JSON file \\f[CR]sitemap.json\\f[R] will be included\ndescribing the hierarchical structure of the files.\n.PP\nIf an output file without an extension is specified, then it will be\ninterpreted as a directory and the zip archive will be automatically\nunpacked into it (unless it already exists, in which case an error will\nbe raised).\nOtherwise a \\f[CR].zip\\f[R] file will be produced.\n.PP\nThe navigation links can be customized by adjusting the template.\nBy default, a table of contents is included only on the top page.\nTo include it on every page, set the \\f[CR]toc\\f[R] variable manually.\n.SH JUPYTER NOTEBOOKS\nWhen creating a Jupyter notebook, pandoc will try to infer the notebook\nstructure.\nCode blocks with the class \\f[CR]code\\f[R] will be taken as code cells,\nand intervening content will be taken as Markdown cells.\nAttachments will automatically be created for images in Markdown cells.\nMetadata will be taken from the \\f[CR]jupyter\\f[R] metadata field.\nFor example:\n.IP\n.EX\n\\-\\-\\-\ntitle: My notebook\njupyter:\n  nbformat: 4\n  nbformat_minor: 5\n  kernelspec:\n     display_name: Python 2\n     language: python\n     name: python2\n  language_info:\n     codemirror_mode:\n       name: ipython\n       version: 2\n     file_extension: \\(dq.py\\(dq\n     mimetype: \\(dqtext/x\\-python\\(dq\n     name: \\(dqpython\\(dq\n     nbconvert_exporter: \\(dqpython\\(dq\n     pygments_lexer: \\(dqipython2\\(dq\n     version: \\(dq2.7.15\\(dq\n\\-\\-\\-\n\n# Lorem ipsum\n\n**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\nbibendum felis dictum sodales.\n\n\\(ga\\(ga\\(ga code\nprint(\\(dqhello\\(dq)\n\\(ga\\(ga\\(ga\n\n## Pyout\n\n\\(ga\\(ga\\(ga code\nfrom IPython.display import HTML\nHTML(\\(dq\\(dq\\(dq\n<script>\nconsole.log(\\(dqhello\\(dq);\n</script>\n<b>HTML</b>\n\\(dq\\(dq\\(dq)\n\\(ga\\(ga\\(ga\n\n## Image\n\nThis image ![image](myimage.png) will be\nincluded as a cell attachment.\n.EE\n.PP\nIf you want to add cell attributes, group cells differently, or add\noutput to code cells, then you need to include divs to indicate the\nstructure.\nYou can use either fenced divs or native divs for this.\nHere is an example:\n.IP\n.EX\n:::::: {.cell .markdown}\n# Lorem\n\n**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\nbibendum felis dictum sodales.\n::::::\n\n:::::: {.cell .code execution_count=1}\n\\(ga\\(ga\\(ga {.python}\nprint(\\(dqhello\\(dq)\n\\(ga\\(ga\\(ga\n\n::: {.output .stream .stdout}\n\\(ga\\(ga\\(ga\nhello\n\\(ga\\(ga\\(ga\n:::\n::::::\n\n:::::: {.cell .code execution_count=2}\n\\(ga\\(ga\\(ga {.python}\nfrom IPython.display import HTML\nHTML(\\(dq\\(dq\\(dq\n<script>\nconsole.log(\\(dqhello\\(dq);\n</script>\n<b>HTML</b>\n\\(dq\\(dq\\(dq)\n\\(ga\\(ga\\(ga\n\n::: {.output .execute_result execution_count=2}\n\\(ga\\(ga\\(ga{=html}\n<script>\nconsole.log(\\(dqhello\\(dq);\n</script>\n<b>HTML</b>\nhello\n\\(ga\\(ga\\(ga\n:::\n::::::\n.EE\n.PP\nIf you include raw HTML or TeX in an output cell, use the raw attribute,\nas shown in the last cell of the example above.\nAlthough pandoc can process \\(lqbare\\(rq raw HTML and TeX, the result is\noften interspersed raw elements and normal textual elements, and in an\noutput cell pandoc expects a single, connected raw block.\nTo avoid using raw HTML or TeX except when marked explicitly using raw\nattributes, we recommend specifying the extensions\n\\f[CR]\\-raw_html\\-raw_tex+raw_attribute\\f[R] when translating between\nMarkdown and ipynb notebooks.\n.PP\nNote that options and extensions that affect reading and writing of\nMarkdown will also affect Markdown cells in ipynb notebooks.\nFor example, \\f[CR]\\-\\-wrap=preserve\\f[R] will preserve soft line breaks\nin Markdown cells; \\f[CR]\\-\\-markdown\\-headings=setext\\f[R] will cause\nSetext\\-style headings to be used; and \\f[CR]\\-\\-preserve\\-tabs\\f[R]\nwill prevent tabs from being turned to spaces.\n.SH VIMDOC\nVimdoc writer generates Vim help files and makes use of the following\nmetadata variables:\n.IP\n.EX\nabstract\\f[B]:\\f[R] \\(dqA short description\\(dq\nauthor\\f[B]:\\f[R] Author\ntitle\\f[B]:\\f[R] Title\n\n\\f[I]# Vimdoc\\-specific\\f[R]\nfilename\\f[B]:\\f[R] \\(dqdefinition\\-lists.txt\\(dq\nvimdoc\\-prefix\\f[B]:\\f[R] pandoc\n.EE\n.PP\nComplete header requires \\f[CR]abstract\\f[R], \\f[CR]author\\f[R],\n\\f[CR]title\\f[R] and \\f[CR]filename\\f[R] to be set.\nCompiling file with such metadata produces the following file (assumes\n\\f[CR]\\-\\-standalone\\f[R], see Templates):\n.IP\n.EX\n*definition\\-lists.txt*  A short description\n\n                            Title by Author\n\n\n                                 Type |gO| to see the table of contents.\n\n[...]\n\n vim:tw=72:sw=4:ts=4:ft=help:norl:et:\n.EE\n.PP\nIf \\f[CR]vimdoc\\-prefix\\f[R] is set, all non\\-command tags are prefixed\nwith its value, it is used to prevent tag collision: all headers have a\ntag (either inferred or explicit) and multiple help pages can have the\nsame header names, therefore collision is to be expected.\nLet our input be the following markdown file:\n.IP\n.EX\n## Header\n\n\\f[BI]\\(ga:[range]Fnl {expr}\\(ga\\f[R]{#:Fnl}\n:   Evaluates {expr} or range\n\n\\f[BI]\\(gavim.b\\(ga\\f[R]{#vim.b}\n:   Buffer\\-scoped (\\f[BI]\\(ga:h b:\\(ga\\f[R]) variables for the current buffer. Invalid or unset\n    key returns \\f[BI]\\(ganil\\(ga\\f[R]. Can be indexed with an integer to access variables for a\n    specific buffer.\n\n\\f[I][\\f[R]Span\\f[I]]\\f[R]{#span}\n:   generic inline container for phrasing content, which does not inherently\n    represent anything.\n.EE\n.PP\nConvert it to vimdoc:\n.IP\n.EX\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\nHeader                                                            *header*\n\n:[range]Fnl {expr}                                                  *:Fnl*\n    Evaluates {expr} or range\n\\(gavim.b\\(ga                                                            *vim.b*\n    Buffer\\-scoped (|b:|) variables for the current buffer. Invalid or\n    unset key returns \\(ganil\\(ga. Can be indexed with an integer to access\n    variables for a specific buffer.\nSpan                                                                *span*\n    generic inline container for phrasing content, which does not\n    inherently represent anything.\n.EE\n.PP\nConvert it to vimdoc with metadata variable set (e.g.\\ with\n\\f[CR]\\-M vimdoc\\-prefix=pandoc\\f[R])\n.IP\n.EX\n\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\nHeader                                                     *pandoc\\-header*\n\n:[range]Fnl {expr}                                                  *:Fnl*\n    Evaluates {expr} or range\n\\(gavim.b\\(ga                                                     *pandoc\\-vim.b*\n    Buffer\\-scoped (|b:|) variables for the current buffer. Invalid or\n    unset key returns \\(ganil\\(ga. Can be indexed with an integer to access\n    variables for a specific buffer.\nSpan                                                         *pandoc\\-span*\n    generic inline container for phrasing content, which does not\n    inherently represent anything.\n.EE\n.PP\n\\f[CR]vim.b\\f[R] and \\f[CR]Span\\f[R] got their prefixes but not\n\\f[CR]:Fnl\\f[R] because ex\\-commands (those starting with \\f[CR]:\\f[R])\ndon\\(cqt get a prefix, since they are considered unique across help\npages.\n.PP\nIn both cases \\f[CR]:help b:\\f[R] became reference \\f[CR]|b:|\\f[R] (also\nworks with \\f[CR]:h b:\\f[R]).\nLinks pointing to either https://vimhelp.org/ or\nhttps://neovim.io/doc/user become references too.\n.PP\nVim traditionally wraps at 78, but Pandoc defaults to 72.\nUse \\f[CR]\\-\\-columns 78\\f[R] to match Vim.\n.SH SYNTAX HIGHLIGHTING\nPandoc will automatically highlight syntax in fenced code blocks that\nare marked with a language name.\nThe Haskell library skylighting is used for highlighting.\nCurrently highlighting is supported only for HTML, EPUB, Docx, Ms, Man,\nTypst, and LaTeX/PDF output.\nTo see a list of language names that pandoc will recognize, type\n\\f[CR]pandoc \\-\\-list\\-highlight\\-languages\\f[R].\n.PP\nThe color scheme can be selected using the\n\\f[CR]\\-\\-syntax\\-highlighting\\f[R] option.\nThe default color scheme is \\f[CR]pygments\\f[R], which imitates the\ndefault color scheme used by the Python library pygments (though\npygments is not actually used to do the highlighting).\nTo see a list of highlight styles, type\n\\f[CR]pandoc \\-\\-list\\-highlight\\-styles\\f[R].\n.PP\nIf you are not satisfied with the predefined styles, you can use\n\\f[CR]\\-\\-print\\-highlight\\-style\\f[R] to generate a JSON\n\\f[CR].theme\\f[R] file which can be modified and used as the argument to\n\\f[CR]\\-\\-syntax\\-highlighting\\f[R].\nTo get a JSON version of the \\f[CR]pygments\\f[R] style, for example:\n.IP\n.EX\npandoc \\-o my.theme \\-\\-print\\-highlight\\-style pygments\n.EE\n.PP\nThen edit \\f[CR]my.theme\\f[R] and use it like this:\n.IP\n.EX\npandoc \\-\\-syntax\\-highlighting my.theme\n.EE\n.PP\nIf you are not satisfied with the built\\-in highlighting, or you want to\nhighlight a language that isn\\(cqt supported, you can use the\n\\f[CR]\\-\\-syntax\\-definition\\f[R] option to load a KDE\\-style XML syntax\ndefinition file.\nBefore writing your own, have a look at KDE\\(cqs repository of syntax\ndefinitions.\n.PP\nIf you receive an error that pandoc \\(lqCould not read highlighting\ntheme\\(rq, check that the JSON file is encoded with UTF\\-8 and has no\nByte\\-Order Mark (BOM).\n.PP\nTo disable highlighting, use \\f[CR]\\-\\-syntax\\-highlighting=none\\f[R].\n.PP\nTo use a format\\(cqs idiomatic syntax highlighting instead of\npandoc\\(cqs built\\-in highlighting, use\n\\f[CR]\\-\\-syntax\\-highlighting=idiomatic\\f[R].\nCurrently, \\f[CR]idiomatic\\f[R] only affects the following formats:\n.IP \\(bu 2\nIn reveal.js, it causes reveal.js\\(cqs highlighting plugin to be used\nfor source code highlighting.\nThe style may be customized by setting the \\f[CR]highlightjs\\-theme\\f[R]\nvariable.\n.IP \\(bu 2\nIn Typst, it causes Typst\\(cqs built\\-in highlighting to be used.\n(This is also the default for Typst.)\n.IP \\(bu 2\nIn LaTeX, it causes the \\f[CR]listings\\f[R] package to be used.\nNote that \\f[CR]listings\\f[R] does not support multi\\-byte encoding for\nsource code.\nTo handle UTF\\-8 you would need to use a custom template.\nThis issue is fully documented here: Encoding issue with the listings\npackage.\n.IP \\(bu 2\nIn other formats, \\f[CR]idiomatic\\f[R] will have the same result as\n\\f[CR]default\\f[R].\n.SH CUSTOM STYLES\nCustom styles can be used in the docx, odt and ICML formats.\n.SS Output\nBy default, pandoc\\(cqs odt, docx and ICML output applies a predefined\nset of styles for blocks such as paragraphs and block quotes, and uses\nlargely default formatting (italics, bold) for inlines.\nThis will work for most purposes, especially alongside a reference doc\nfile.\nHowever, if you need to apply your own styles to blocks, or match a\npreexisting set of styles, pandoc allows you to define custom styles for\nblocks and text using \\f[CR]div\\f[R]s and \\f[CR]span\\f[R]s,\nrespectively.\n.PP\nIf you define a Div, Span, or Table with the attribute\n\\f[CR]custom\\-style\\f[R], pandoc will apply your specified style to the\ncontained elements (with the exception of elements whose function\ndepends on a style, like headings, code blocks, block quotes, or links).\nSo, for example, using the \\f[CR]bracketed_spans\\f[R] syntax,\n.IP\n.EX\n[Get out]{custom\\-style=\\(dqEmphatically\\(dq}, he said.\n.EE\n.PP\nwould produce a file with \\(lqGet out\\(rq styled with character style\n\\f[CR]Emphatically\\f[R].\nSimilarly, using the \\f[CR]fenced_divs\\f[R] syntax,\n.IP\n.EX\nDickinson starts the poem simply:\n\n::: {custom\\-style=\\(dqPoetry\\(dq}\n| A Bird came down the Walk\\-\\-\\-\n| He did not know I saw\\-\\-\\-\n:::\n.EE\n.PP\nwould style the two contained lines with the \\f[CR]Poetry\\f[R] paragraph\nstyle.\n.PP\nStyles will be defined in the output file as inheriting from normal text\n(docx) or Default Paragraph Style (odt), if the styles are not yet in\nyour reference doc.\nIf they are already defined, pandoc will not alter the definition.\n.PP\nThis feature allows for greatest customization in conjunction with\npandoc filters.\nIf you want all paragraphs after block quotes to be indented, you can\nwrite a filter to apply the styles necessary.\nIf you want all italics to be transformed to the \\f[CR]Emphasis\\f[R]\ncharacter style (perhaps to change their color), you can write a filter\nwhich will transform all italicized inlines to inlines within an\n\\f[CR]Emphasis\\f[R] custom\\-style \\f[CR]span\\f[R].\n.PP\nFor docx or odt output, you don\\(cqt need to enable any extensions for\ncustom styles to work.\n.PP\nFor icml output, you can also set an \\f[CR]object\\-style\\f[R] in images:\n.IP\n.EX\n![Image with object style](myImage.jpg){object\\-style=\\(dqfixedSizeImage\\(dq}\n.EE\n.PP\nIn InDesign you\\(cqll see that object style given to the image, and\nyou\\(cqll be able to customize it, or load its definition from a\ntemplate of yours.\n.SS Input\nThe docx reader, by default, only reads those styles that it can convert\ninto pandoc elements, either by direct conversion or interpreting the\nderivation of the input document\\(cqs styles.\n.PP\nBy enabling the \\f[CR]styles\\f[R] extension in the docx reader\n(\\f[CR]\\-f docx+styles\\f[R]), you can produce output that maintains the\nstyles of the input document, using the \\f[CR]custom\\-style\\f[R] class.\nA \\f[CR]custom\\-style\\f[R] attribute will be added for each style.\nDivs will be created to hold the paragraph styles, and Spans to hold the\ncharacter styles.\nTable styles will be applied directly to the Table.\n.PP\nFor example, using the \\f[CR]custom\\-style\\-reference.docx\\f[R] file in\nthe test directory, we have the following different outputs:\n.PP\nWithout the \\f[CR]+styles\\f[R] extension:\n.IP\n.EX\n$ pandoc test/docx/custom\\-style\\-reference.docx \\-f docx \\-t markdown\nThis is some text.\n\nThis is text with an *emphasized* text style. And this is text with a\n**strengthened** text style.\n\n> Here is a styled paragraph that inherits from Block Text.\n.EE\n.PP\nAnd with the extension:\n.IP\n.EX\n$ pandoc test/docx/custom\\-style\\-reference.docx \\-f docx+styles \\-t markdown\n\n::: {custom\\-style=\\(dqFirst Paragraph\\(dq}\nThis is some text.\n:::\n\n::: {custom\\-style=\\(dqBody Text\\(dq}\nThis is text with an [emphasized]{custom\\-style=\\(dqEmphatic\\(dq} text style.\nAnd this is text with a [strengthened]{custom\\-style=\\(dqStrengthened\\(dq}\ntext style.\n:::\n\n::: {custom\\-style=\\(dqMy Block Style\\(dq}\n> Here is a styled paragraph that inherits from Block Text.\n:::\n.EE\n.PP\nWith these custom styles, you can use your input document as a\nreference\\-doc while creating docx output (see below), and maintain the\nsame styles in your input and output files.\n.SH CUSTOM READERS AND WRITERS\nPandoc can be extended with custom readers and writers written in Lua.\n(Pandoc includes a Lua interpreter, so Lua need not be installed\nseparately.)\n.PP\nTo use a custom reader or writer, simply specify the path to the Lua\nscript in place of the input or output format.\nFor example:\n.IP\n.EX\npandoc \\-t data/sample.lua\npandoc \\-f my_custom_markup_language.lua \\-t latex \\-s\n.EE\n.PP\nIf the script is not found relative to the working directory, it will be\nsought in the \\f[CR]custom\\f[R] subdirectory of the user data directory\n(see \\f[CR]\\-\\-data\\-dir\\f[R]).\n.PP\nA custom reader is a Lua script that defines one function, Reader, which\ntakes a string as input and returns a Pandoc AST.\nSee the Lua filters documentation for documentation of the functions\nthat are available for creating pandoc AST elements.\nFor parsing, the lpeg parsing library is available by default.\nTo see a sample custom reader:\n.IP\n.EX\npandoc \\-\\-print\\-default\\-data\\-file creole.lua\n.EE\n.PP\nIf you want your custom reader to have access to reader options\n(e.g.\\ the tab stop setting), you give your Reader function a second\n\\f[CR]options\\f[R] parameter.\n.PP\nA custom writer is a Lua script that defines a function that specifies\nhow to render each element in a Pandoc AST.\nSee the djot\\-writer.lua for a full\\-featured example.\n.PP\nNote that custom writers have no default template.\nIf you want to use \\f[CR]\\-\\-standalone\\f[R] with a custom writer, you\nwill need to specify a template manually using \\f[CR]\\-\\-template\\f[R]\nor add a new default template with the name\n\\f[CR]default.NAME_OF_CUSTOM_WRITER.lua\\f[R] to the \\f[CR]templates\\f[R]\nsubdirectory of your user data directory (see Templates).\n.SH REPRODUCIBLE BUILDS\nSome of the document formats pandoc targets (such as EPUB, docx, and\nODT) include build timestamps in the generated document.\nThat means that the files generated on successive builds will differ,\neven if the source does not.\nTo avoid this, set the \\f[CR]SOURCE_DATE_EPOCH\\f[R] environment\nvariable, and the timestamp will be taken from it instead of the current\ntime.\n\\f[CR]SOURCE_DATE_EPOCH\\f[R] should contain an integer unix timestamp\n(specifying the number of seconds since midnight UTC January 1, 1970).\n.PP\nFor reproducible builds with LaTeX, you can either specify the\n\\f[CR]pdf\\-trailer\\-id\\f[R] in the metadata or leave it undefined, in\nwhich case pandoc will create a trailer\\-id based on a hash of the\n\\f[CR]SOURCE_DATE_EPOCH\\f[R] and the document\\(cqs contents.\n.PP\nSome document formats also include a unique identifier.\nFor EPUB, this can be set explicitly by setting the\n\\f[CR]identifier\\f[R] metadata field (see EPUB Metadata, above).\n.SH ACCESSIBLE PDFS AND PDF ARCHIVING STANDARDS\nPDF is a flexible format, and using PDF in certain contexts requires\nadditional conventions.\nFor example, PDFs are not accessible by default; they define how\ncharacters are placed on a page but do not contain semantic information\non the content.\nHowever, it is possible to generate accessible PDFs, which use tagging\nto add semantic information to the document.\n.PP\nPandoc defaults to LaTeX to generate PDF.\nLaTeX\\(cqs \\f[CR]\\(rsDocumentMetadata\\f[R] interface supports PDF\nstandards and tagging when using LuaLaTeX; set the\n\\f[CR]pdfstandard\\f[R] variable to enable this (see below).\nFor older LaTeX installations, alternative engines must be used.\n.PP\nThe PDF standards PDF/A and PDF/UA define further restrictions intended\nto optimize PDFs for archiving and accessibility.\nTagging is commonly used in combination with these standards to ensure\nbest results.\n.PP\nNote, however, that standard compliance depends on many things,\nincluding the colorspace of embedded images.\nPandoc cannot check this, and external programs must be used to ensure\nthat generated PDFs are in compliance.\n.SS LaTeX\nSet the \\f[CR]pdfstandard\\f[R] variable to produce tagged PDFs\nconforming to PDF/A, PDF/X, or PDF/UA standards.\nFor example:\n.IP\n.EX\npandoc \\-V pdfstandard=ua\\-2 \\-\\-pdf\\-engine=lualatex doc.md \\-o doc.pdf\n.EE\n.PP\nMultiple standards can be combined:\n.IP\n.EX\n\\-\\-\\-\npdfstandard:\n  \\- ua\\-2\n  \\- a\\-4f\n\\-\\-\\-\n.EE\n.PP\nThe required PDF version is inferred automatically.\nThis feature requires LuaLaTeX in TeX Live 2025 with LaTeX kernel\n2025\\-06\\-01 or newer.\n.SS ConTeXt\nConTeXt always produces tagged PDFs, but the quality depends on the\ninput.\nThe default ConTeXt markup generated by pandoc is optimized for\nreadability and reuse, not tagging.\nEnable the \\f[CR]tagging\\f[R] format extension to force markup that is\noptimized for tagging.\nFor example:\n.IP\n.EX\npandoc \\-t context+tagging doc.md \\-o doc.pdf\n.EE\n.PP\nA recent \\f[CR]context\\f[R] version should be used, as older versions\ncontained a bug that lead to invalid PDF metadata.\n.SS WeasyPrint\nThe HTML\\-based engine WeasyPrint includes experimental support for\nPDF/A and PDF/UA since version 57.\nTagged PDFs can created with\n.IP\n.EX\npandoc \\-\\-pdf\\-engine=weasyprint \\(rs\n       \\-\\-pdf\\-engine\\-opt=\\-\\-pdf\\-variant=pdf/ua\\-1 ...\n.EE\n.PP\nThe feature is experimental and standard compliance should not be\nassumed.\n.SS Prince XML\nThe non\\-free HTML\\-to\\-PDF converter \\f[CR]prince\\f[R] has extensive\nsupport for various PDF standards as well as tagging.\nE.g.:\n.IP\n.EX\npandoc \\-\\-pdf\\-engine=prince \\(rs\n       \\-\\-pdf\\-engine\\-opt=\\-\\-tagged\\-pdf ...\n.EE\n.PP\nSee the prince documentation for more info.\n.SS Typst\nTypst 0.12 can produce PDF/A\\-2b:\n.IP\n.EX\npandoc \\-\\-pdf\\-engine=typst \\-\\-pdf\\-engine\\-opt=\\-\\-pdf\\-standard=a\\-2b ...\n.EE\n.SS Word Processors\nWord processors like LibreOffice and MS Word can also be used to\ngenerate standardized and tagged PDF output.\nPandoc does not support direct conversions via these tools.\nHowever, pandoc can convert a document to a \\f[CR]docx\\f[R] or\n\\f[CR]odt\\f[R] file, which can then be opened and converted to PDF with\nthe respective word processor.\nSee the documentation for Word and LibreOffice.\n.SH RUNNING PANDOC AS A WEB SERVER\nIf you rename (or symlink) the pandoc executable to\n\\f[CR]pandoc\\-server\\f[R], or if you call pandoc with \\f[CR]server\\f[R]\nas the first argument, it will start up a web server with a JSON API.\nThis server exposes most of the conversion functionality of pandoc.\nFor full documentation, see the pandoc\\-server man page.\n.PP\nIf you rename (or symlink) the pandoc executable to\n\\f[CR]pandoc\\-server.cgi\\f[R], it will function as a CGI program\nexposing the same API as \\f[CR]pandoc\\-server\\f[R].\n.PP\n\\f[CR]pandoc\\-server\\f[R] is designed to be maximally secure; it uses\nHaskell\\(cqs type system to provide strong guarantees that no I/O will\nbe performed on the server during pandoc conversions.\n.SH RUNNING PANDOC AS A LUA INTERPRETER\nCalling the pandoc executable under the name \\f[CR]pandoc\\-lua\\f[R] or\nwith \\f[CR]lua\\f[R] as the first argument will make it function as a\nstandalone Lua interpreter.\nThe behavior is mostly identical to that of the standalone\n\\f[CR]lua\\f[R] executable, version 5.4.\nAll \\f[CR]pandoc.*\\f[R] packages, as well as the packages \\f[CR]re\\f[R]\nand \\f[CR]lpeg\\f[R], are available via global variables.\nFurthermore, the globals \\f[CR]PANDOC_VERSION\\f[R],\n\\f[CR]PANDOC_STATE\\f[R], and \\f[CR]PANDOC_API_VERSION\\f[R] are set at\nstartup.\nFor full documentation, see the pandoc\\-lua man page.\n.SH A NOTE ON SECURITY\n.IP \"1.\" 3\nAlthough pandoc itself will not create or modify any files other than\nthose you explicitly ask it create (with the exception of temporary\nfiles used in producing PDFs), a filter or custom writer could in\nprinciple do anything on your file system.\nPlease audit filters and custom writers very carefully before using\nthem.\n.IP \"2.\" 3\nSeveral input formats (including LaTeX, Org, RST, and Typst) support\n\\f[CR]include\\f[R] directives that allow the contents of a file to be\nincluded in the output.\nAn untrusted attacker could use these to view the contents of files on\nthe file system.\n(Using the \\f[CR]\\-\\-sandbox\\f[R] option can protect against this\nthreat.)\n.IP \"3.\" 3\nSeveral output formats (including RTF, FB2, HTML with\n\\f[CR]\\-\\-self\\-contained\\f[R], EPUB, Docx, and ODT) will embed encoded\nor raw images into the output file.\nAn untrusted attacker could exploit this to view the contents of\nnon\\-image files on the file system.\n(Using the \\f[CR]\\-\\-sandbox\\f[R] option can protect against this\nthreat, but will also prevent including images in these formats.)\n.IP \"4.\" 3\nIn reading HTML files, pandoc will attempt to include the contents of\n\\f[CR]iframe\\f[R] elements by fetching content from the local file or\nURL specified by \\f[CR]src\\f[R].\nIf untrusted HTML is processed on a server, this has the potential to\nreveal anything readable by the process running the server.\nUsing the \\f[CR]\\-f html+raw_html\\f[R] will mitigate this threat by\ncausing the whole \\f[CR]iframe\\f[R] to be parsed as a raw HTML block.\nUsing \\f[CR]\\-\\-sandbox\\f[R] will also protect against the threat.\n.IP \"5.\" 3\nIf your application uses pandoc as a Haskell library (rather than\nshelling out to the executable), it is possible to use it in a mode that\nfully isolates pandoc from your file system, by running the pandoc\noperations in the \\f[CR]PandocPure\\f[R] monad.\nSee the document Using the pandoc API for more details.\n(This corresponds to the use of the \\f[CR]\\-\\-sandbox\\f[R] option on the\ncommand line.)\n.IP \"6.\" 3\nPandoc\\(cqs parsers can exhibit pathological performance on some corner\ncases.\nIt is wise to put any pandoc operations under a timeout, to avoid DOS\nattacks that exploit these issues.\nIf you are using the pandoc executable, you can add the command line\noptions \\f[CR]+RTS \\-M512M \\-RTS\\f[R] (for example) to limit the heap\nsize to 512MB.\nNote that the \\f[CR]commonmark\\f[R] parser (including\n\\f[CR]commonmark_x\\f[R] and \\f[CR]gfm\\f[R]) is much less vulnerable to\npathological performance than the \\f[CR]markdown\\f[R] parser, so it is a\nbetter choice when processing untrusted input.\n.IP \"7.\" 3\nThe HTML generated by pandoc is not guaranteed to be safe.\nIf \\f[CR]raw_html\\f[R] is enabled for the Markdown input, users can\ninject arbitrary HTML.\nEven if \\f[CR]raw_html\\f[R] is disabled, users can include dangerous\ncontent in URLs and attributes.\nTo be safe, you should run all HTML generated from untrusted user input\nthrough an HTML sanitizer.\n.SH AUTHORS\nCopyright 2006\\(en2024 John MacFarlane (jgm\\(atberkeley.edu).\nReleased under the GPL, version 2 or greater.\nThis software carries no warranty of any kind.\n(See COPYRIGHT for full copyright and warranty notices.)\nFor a full list of contributors, see the file AUTHORS.md in the pandoc\nsource code.\n.PP\nThe Pandoc source code may be downloaded\nfrom <https://hackage.haskell.org/package/pandoc> or\n<https://github.com/jgm/pandoc/releases>.  Further\ndocumentation is available at <https://pandoc.org>.\n"
  },
  {
    "path": "pandoc-cli/no-lua/PandocCLI/Lua.hs",
    "content": "{- |\n   Module      : PandocCLI.Lua\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nPlaceholder values to be used when pandoc is compiled without support\nfor the Lua scripting engine.\n-}\nmodule PandocCLI.Lua (runLuaInterpreter, getEngine) where\n\nimport Control.Monad.IO.Class (MonadIO)\nimport Text.Pandoc.Error (PandocError (PandocNoScriptingEngine), handleError)\nimport Text.Pandoc.Scripting (ScriptingEngine, noEngine)\n\n-- | Raises an error, reporting that the scripting engine is unavailable.\nrunLuaInterpreter :: String    -- ^ Program name\n                  -> [String]  -- ^ Command line arguments\n                  -> IO ()\nrunLuaInterpreter _progName _args = do\n  handleError (Left PandocNoScriptingEngine)\n\n-- | Placeholder scripting engine.\ngetEngine :: MonadIO m => m ScriptingEngine\ngetEngine = pure noEngine\n"
  },
  {
    "path": "pandoc-cli/no-server/PandocCLI/Server.hs",
    "content": "{- |\n   Module      : PandocCLI.Server\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n\nPlaceholder module to be used when pandoc is compiled without server\nsupport.\n-}\nmodule PandocCLI.Server\n  ( runCGI\n  , runServer\n  )\nwhere\n\nimport System.IO (hPutStrLn, stderr)\nimport System.Exit (exitWith, ExitCode(ExitFailure))\n\n-- | Placeholder function for the CGI server; prints an error message\n-- and exists with error code.\nrunCGI :: IO ()\nrunCGI = serverUnsupported\n\n-- | Placeholder function for the HTTP server; prints an error message\n-- and exists with error code.\nrunServer :: [String] -> IO ()\nrunServer _args = serverUnsupported\n\nserverUnsupported :: IO ()\nserverUnsupported = do\n  hPutStrLn stderr $ \"Server mode unsupported.\\n\" <>\n                     \"Pandoc was not compiled with the 'server' flag.\"\n  exitWith $ ExitFailure 4\n"
  },
  {
    "path": "pandoc-cli/pandoc-cli.cabal",
    "content": "cabal-version:   2.4\nname:            pandoc-cli\nversion:         3.9.0.2\nbuild-type:      Simple\nlicense:         GPL-2.0-or-later\nlicense-file:    COPYING.md\ncopyright:       (c) 2006-2024 John MacFarlane\nauthor:          John MacFarlane <jgm@berkeley.edu>\nmaintainer:      John MacFarlane <jgm@berkeley.edu>\nbug-reports:     https://github.com/jgm/pandoc/issues\nstability:       alpha\nhomepage:        https://pandoc.org\ncategory:        Text\nsynopsis:        Conversion between documentation formats\ndescription:     Pandoc-cli provides a command-line executable that uses the\n                 pandoc library to convert between markup formats.\nextra-source-files:\n                 man/pandoc.1\n                 man/pandoc-lua.1\n                 man/pandoc-server.1\nsource-repository head\n  type:          git\n  location:      https://github.com/jgm/pandoc.git\n\nflag lua\n  description:   Support custom modifications and conversions with the\n                 pandoc Lua scripting engine.\n  default:       True\n\nflag server\n  Description:   Include support for running pandoc as an HTTP server.\n  Default:       True\n\nflag repl\n  Description:   Include support for running a pandoc Lua repl.\n  Default:       True\n\nflag nightly\n  Description:   Add '-nightly-COMPILEDATE' to the output of '--version'.\n  Default:       False\n\ncommon common-options\n  default-language: Haskell2010\n  other-extensions: OverloadedStrings\n  build-depends:    base         >= 4.18 && < 5\n  ghc-options:      -Wall -fno-warn-unused-do-bind\n                    -Wincomplete-record-updates\n                    -Wnoncanonical-monad-instances\n                    -Wcpp-undef\n                    -Wincomplete-uni-patterns\n                    -Widentities\n                    -Wpartial-fields\n                    -Wmissing-signatures\n                    -fhide-source-paths\n                    -Wunused-packages\n                    -Winvalid-haddock\n\n  if os(windows)\n    cpp-options:      -D_WINDOWS\n\ncommon common-executable\n  import:           common-options\n  ghc-options:      -rtsopts -with-rtsopts=-A8m\n\nexecutable pandoc\n  import:          common-executable\n  main-is:         pandoc.hs\n  hs-source-dirs:  src\n  buildable:       True\n  -- Note: we always link to an exact version of pandoc, with the\n  -- same version as this package:\n  build-depends:   pandoc == 3.9.0.2, text\n  other-modules:   PandocCLI.Lua\n                 , PandocCLI.Server\n\n  if arch(wasm32)\n    hs-source-dirs: wasm\n    other-modules:  PandocWasm\n    cpp-options:    -DINCLUDE_WASM\n    build-depends:  aeson, containers, bytestring, skylighting, filepath, pandoc-lua-engine\n    ghc-options:    -optl-Wl,--export=__wasm_call_ctors,--export=hs_init_with_rtsopts,--export=malloc,--export=convert,--export=query\n  else\n    ghc-options: -threaded\n\n  if flag(nightly)\n    cpp-options:    -DNIGHTLY\n    build-depends:  template-haskell,\n                    time\n  if flag(server)\n    build-depends:   pandoc-server >= 0.1.1 && < 0.2,\n                     wai-extra >= 3.0.24,\n                     warp,\n                     safe\n    hs-source-dirs:  server\n  else\n    hs-source-dirs:  no-server\n\n  if flag(lua)\n    build-depends:   pandoc-lua-engine >= 0.5.1 && < 0.6\n    hs-source-dirs:  lua\n  else\n    hs-source-dirs:  no-lua\n\n  if flag(repl)\n     build-depends:    hslua-cli       >= 1.4.1   && < 1.5,\n                       temporary         >= 1.1 && < 1.4\n     cpp-options:      -DREPL\n"
  },
  {
    "path": "pandoc-cli/server/PandocCLI/Server.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Main\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n\nFunctions for the pandoc server CLI.\n-}\nmodule PandocCLI.Server\n  ( runCGI\n  , runServer\n  )\nwhere\nimport qualified Network.Wai.Handler.CGI as CGI\nimport qualified Network.Wai.Handler.Warp as Warp\nimport Network.Wai.Middleware.Timeout (timeout)\nimport Safe (readDef)\nimport System.Environment (lookupEnv)\nimport Text.Pandoc.Server (ServerOpts(..), parseServerOptsFromArgs, app)\nimport System.IO (stderr, hPutStrLn)\n\n-- | Runs the CGI server.\nrunCGI :: IO ()\nrunCGI = do\n  cgiTimeout <- maybe 2 (readDef 2) <$> lookupEnv \"PANDOC_SERVER_TIMEOUT\"\n  CGI.run (timeout cgiTimeout app)\n\n-- | Runs the HTTP server.\nrunServer :: [String] -> IO ()\nrunServer args = do\n  sopts <- parseServerOptsFromArgs args\n  hPutStrLn stderr $\n    \"Starting server on port \" <> show (serverPort sopts) <> \"...\"\n  Warp.run (serverPort sopts) (timeout (serverTimeout sopts) app)\n"
  },
  {
    "path": "pandoc-cli/src/pandoc.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TemplateHaskell #-}\n\n{- |\n   Module      : Main\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nParses command-line options and calls the appropriate readers and\nwriters.\n-}\nmodule Main where\nimport qualified Control.Exception as E\nimport System.Environment (getArgs, getProgName)\nimport Text.Pandoc.App ( convertWithOpts, defaultOpts, options\n                       , parseOptionsFromArgs, handleOptInfo, versionInfo )\nimport Text.Pandoc.Error (handleError)\nimport Data.Monoid (Any(..))\nimport PandocCLI.Lua\nimport PandocCLI.Server\nimport Text.Pandoc.Scripting (ScriptingEngine(..))\nimport qualified Data.Text as T\n#ifdef NIGHTLY\nimport qualified Language.Haskell.TH as TH\nimport Data.Time\n#endif\n#ifdef INCLUDE_WASM\nimport PandocWasm()\n#endif\n\n#ifdef NIGHTLY\nversionSuffix :: String\nversionSuffix = \"-nightly-\" ++\n  $(TH.stringE =<<\n    TH.runIO (formatTime defaultTimeLocale \"%F\" <$> Data.Time.getCurrentTime))\n#else\nversionSuffix :: String\nversionSuffix = \"\"\n#endif\n\nmain :: IO ()\nmain = E.handle (handleError . Left) $ do\n  prg <- getProgName\n  rawArgs <- getArgs\n  let hasVersion = getAny $ foldMap\n         (\\s -> Any (s == \"-v\" || s == \"--version\"))\n         (takeWhile (/= \"--\") rawArgs)\n  let versionOr action = if hasVersion then versionInfoCLI else action\n  case prg of\n    \"pandoc-server.cgi\" -> versionOr runCGI\n    \"pandoc-server\"     -> versionOr $ runServer rawArgs\n    \"pandoc-lua\"        -> runLuaInterpreter prg rawArgs\n    _ ->\n      case rawArgs of\n        \"lua\" : args   -> runLuaInterpreter \"pandoc lua\" args\n        \"server\": args -> versionOr $ runServer args\n        args           -> versionOr $ do\n          engine <- getEngine\n          res <- parseOptionsFromArgs options defaultOpts prg args\n          case res of\n            Left e -> handleOptInfo engine e\n            Right opts -> convertWithOpts engine opts\n\n\ngetFeatures :: [String]\ngetFeatures = [\n#ifdef VERSION_pandoc_server\n  \"+server\"\n#else\n  \"-server\"\n#endif\n  ,\n#ifdef VERSION_hslua_cli\n  \"+lua\"\n#else\n  \"-lua\"\n#endif\n  ]\n\nversionInfoCLI :: IO ()\nversionInfoCLI = do\n  scriptingEngine <- getEngine\n  versionInfo getFeatures\n              (Just $ T.unpack (engineName scriptingEngine))\n              versionSuffix\n"
  },
  {
    "path": "pandoc-cli/wasm/PandocWasm.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\n\n{- |\n   Module      : Main\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nExposes wasm functions to convert documents and get information\nfrom pandoc.\n-}\nmodule PandocWasm where\nimport qualified Data.Map as M\nimport qualified Control.Exception as E\nimport Data.List (sort)\nimport Data.Maybe (fromMaybe)\nimport Text.Pandoc.App ( convertWithOpts, Opt(..), defaultOpts )\nimport Text.Pandoc (Verbosity(ERROR), pandocVersion, Reader, Writer, PandocIO,\n                    readers, writers, runIO, setUserDataDir)\nimport Text.Pandoc.Highlighting (highlightingStyles)\nimport Text.Pandoc.Templates (getDefaultTemplate)\nimport Skylighting (defaultSyntaxMap, Syntax(..))\nimport Text.Pandoc.Extensions (extensionsToList, extensionEnabled, getAllExtensions,\n                               getDefaultExtensions)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Scripting (ScriptingEngine(..), customTemplate)\nimport System.FilePath (splitExtension)\nimport PandocCLI.Lua\nimport Control.Exception\nimport Foreign\nimport Foreign.C\nimport Data.Aeson as Aeson\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport Data.Version (showVersion)\n\nforeign export ccall \"convert\" convert :: Ptr CChar -> Int -> IO ()\n\n-- | Do a pandoc conversion. The parameters are a pointer and length\n-- for a C string containing JSON-encoded pandoc options (isomorphic\n-- to a defaults file). The calling program should set up a virtual\n-- file system containing @/stdin@ (input), @/stdout@ (output), and\n-- @/warnings@ (output). @/stdin@ can be used to pass input to pandoc.\nconvert :: Ptr CChar -> Int -> IO ()\nconvert ptr len =\n  E.catch act (\\(err :: SomeException) ->\n                 writeFile \"/stderr\" (\"ERROR: \" <> displayException err))\n  where\n    act = do\n      args <- getCString ptr len\n      engine <- getEngine\n      let aesonRes = Aeson.eitherDecode (UTF8.fromStringLazy args)\n      case aesonRes of\n        Left e -> error e\n        Right (f :: Opt -> Opt) -> do\n          let opts = f defaultOpts\n          let opts' = opts{ optInputFiles =\n                             Just $ fromMaybe [\"/stdin\"] (optInputFiles opts)\n                          , optOutputFile =\n                             Just $ fromMaybe \"/stdout\" (optOutputFile opts)\n                          , optLogFile =\n                             Just $ fromMaybe \"/warnings\" (optLogFile opts)\n                          , optVerbosity = ERROR -- only show errors to stderr\n                          }\n          convertWithOpts engine opts'\n\nforeign export ccall \"query\" query :: Ptr CChar -> Int -> IO ()\n\n-- | Retrieve information from pandoc. The parameters are a pointer\n-- and length for a C string containing a JSON-encoded query.\n-- The calling program should set up a virtual file system containing\n-- @/stdout@, which will be used to hold the output, and @/stderr@,\n-- which will be used to hold any error messages.\n-- The following queries can be used:\n-- * @{\"query\":\"version\"}@ returns the pandoc version as a JSON-encoded\n--   string.\n-- * @{\"query:\"input-formats\"}@ returns a JSON list of supported input\n--   formats.\n-- * @{\"query:\"output-formats\"}@ returns a JSON list of supported output\n--   formats.\n-- * @{\"query:\"highlight-languages\"}@ returns a JSON list of languages\n--   for which syntax highlighting is defined.\n-- * @{\"query:\"highlight-styles\"}@ returns a JSON list of defined syntax\n--   highlighting styles.\n-- * @{\"query\":\"default-template\",\"format\": FORMAT}@ returns\n--   the default template for the format as a JSON-encoded string.\n-- * @{\"query\":\"extensions-for-format\",\"format\": FORMAT}@ returns\n--   an object mapping extension names to true or false for all the\n--   extensions relevant for the format.\nquery :: Ptr CChar -> Int -> IO ()\nquery ptr len =\n  E.catch act (\\(err :: SomeException) ->\n                 writeFile \"/stderr\" (\"ERROR: \" <> displayException err))\n  where\n    jsonOut :: forall a . ToJSON a => a -> IO ()\n    jsonOut = BL.writeFile \"/stdout\" . Aeson.encode\n    act = do\n      args <- getCString ptr len\n      case Aeson.eitherDecode (UTF8.fromStringLazy args) of\n        Left e -> error e\n        Right PandocVersion -> jsonOut $ showVersion pandocVersion\n        Right HighlightStyles -> jsonOut $ map fst highlightingStyles\n        Right HighlightLanguages -> jsonOut $ sort $\n          [ T.toLower (sShortname s)\n            | s <- M.elems defaultSyntaxMap\n            , sShortname s `notElem` [\"Alert\", \"Alert_indent\"]\n          ]\n        Right (DefaultTemplate format) -> do\n          templ <- runIO $\n                     case splitExtension (T.unpack format) of\n                        (_, \"\") -> do\n                          -- built-in format\n                          setUserDataDir Nothing\n                          getDefaultTemplate format\n                        _ -> do\n                          -- format looks like a filepath => custom writer\n                          engine <- getEngine\n                          components <- engineLoadCustom engine (T.unpack format)\n                          case customTemplate components of\n                            Just t  -> pure t\n                            Nothing -> E.throw $ PandocNoTemplateError format\n          case templ of\n               Right t\n                 | T.null t -> -- e.g. for docx, odt, json:\n                     E.throwIO $ PandocCouldNotFindDataFileError $ T.pack\n                       (\"templates/default.\" ++ T.unpack format)\n                 | otherwise -> jsonOut t\n               Left e  -> E.throwIO e\n        Right InputFormats -> jsonOut readersNames\n        Right OutputFormats -> jsonOut writersNames\n        Right (ExtensionsForFormat format) -> do\n          let allExts = getAllExtensions format\n          let defExts = getDefaultExtensions format\n          let addExt x = M.insert (drop 4 (show x))\n                              (extensionEnabled x defExts)\n          jsonOut $ foldr addExt mempty (extensionsToList allExts)\n    readersNames = sort (map fst (readers :: [(T.Text, Reader PandocIO)]))\n    writersNames = sort\n      (\"pdf\" : map fst (writers :: [(T.Text, Writer PandocIO)]))\n\n\ndata Query =\n    PandocVersion\n  | InputFormats\n  | OutputFormats\n  | HighlightLanguages\n  | HighlightStyles\n  | ExtensionsForFormat T.Text\n  | DefaultTemplate T.Text\n  deriving (Show)\n\ninstance FromJSON Query where\n  parseJSON = withObject \"Query\" $ \\o -> do\n    queryType <- o .: \"query\"\n    case queryType of\n      \"version\" -> pure PandocVersion\n      \"input-formats\" -> pure InputFormats\n      \"output-formats\" -> pure OutputFormats\n      \"highlight-languages\" -> pure HighlightLanguages\n      \"highlight-styles\" -> pure HighlightStyles\n      \"default-template\" -> DefaultTemplate <$> o .: \"format\"\n      \"extensions-for-format\" -> ExtensionsForFormat <$> o .: \"format\"\n      _ -> fail $ \"Unknown query type \" <> queryType\n\ngetCString :: Ptr CChar -> Int -> IO String\ngetCString ptr len = peekCStringLen (ptr, len) <* free ptr\n"
  },
  {
    "path": "pandoc-lua-engine/README.md",
    "content": "# pandoc-lua-engine\n\nThis package provides a Lua pandoc scripting engine based. It\nallows to write filters, custom readers, and custom writers in\nLua.\n\n"
  },
  {
    "path": "pandoc-lua-engine/pandoc-lua-engine.cabal",
    "content": "cabal-version:       2.4\nname:                pandoc-lua-engine\nversion:             0.5.2\nbuild-type:          Simple\nlicense:             GPL-2.0-or-later\nlicense-file:        COPYING.md\ncopyright:           © 2006-2024 John MacFarlane, 2017-2024 Albert Krewinkel\nauthor:              John MacFarlane, Albert Krewinkel\nmaintainer:          Albert Krewinkel <albert@hslua.org>\nbug-reports:         https://github.com/jgm/pandoc/issues\nhomepage:            https://pandoc.org\ncategory:            Text\nsynopsis:            Lua engine to power custom pandoc conversions\ndescription:         This package provides a pandoc scripting engine based on\n                     Lua.\nextra-source-files:  README.md\n                   , test/bytestring.bin\n                   , test/bytestring.lua\n                   , test/bytestring-reader.lua\n                   , test/extensions.lua\n                   , test/lua/*.lua\n                   , test/lua/module/*.lua\n                   , test/lua/module/include.tex\n                   , test/lua/module/partial.test\n                   , test/lua/module/sample.svg\n                   , test/lua/module/sample.epub\n                   , test/lua/module/tiny.epub\n                   , test/sample.lua\n                   , test/tables.custom\n                   , test/tables.native\n                   , test/testsuite.native\n                   , test/writer.custom\n                   , test/writer-template.lua\n                   , test/writer-template.out.txt\n\nsource-repository head\n  type:                git\n  location:            https://github.com/jgm/pandoc.git\n  subdir:              pandoc-lua-engine\n\nflag repl\n  Description:   Include pandoc Lua repl.\n  Default:       True\n\ncommon common-options\n  default-language:    Haskell2010\n  build-depends:       base              >= 4.12 && < 5\n  ghc-options:         -Wall -fno-warn-unused-do-bind\n                       -Wincomplete-record-updates\n                       -Wnoncanonical-monad-instances\n                       -Wcpp-undef\n                       -Wincomplete-uni-patterns\n                       -Widentities\n                       -Wpartial-fields\n                       -Wmissing-export-lists\n                       -Wmissing-signatures\n                       -fhide-source-paths\n\n  if impl(ghc >= 8.10)\n    ghc-options:         -Wunused-packages\n\n  if impl(ghc >= 9.0)\n    ghc-options:         -Winvalid-haddock\n\nlibrary\n  import:              common-options\n  hs-source-dirs:      src\n  exposed-modules:     Text.Pandoc.Lua\n  other-modules:       Text.Pandoc.Lua.Custom\n                     , Text.Pandoc.Lua.Documentation\n                     , Text.Pandoc.Lua.Engine\n                     , Text.Pandoc.Lua.Filter\n                     , Text.Pandoc.Lua.Global\n                     , Text.Pandoc.Lua.Init\n                     , Text.Pandoc.Lua.Module\n                     , Text.Pandoc.Lua.Marshal.Chunks\n                     , Text.Pandoc.Lua.Marshal.CommonState\n                     , Text.Pandoc.Lua.Marshal.Context\n                     , Text.Pandoc.Lua.Marshal.Format\n                     , Text.Pandoc.Lua.Marshal.ImageSize\n                     , Text.Pandoc.Lua.Marshal.LogMessage\n                     , Text.Pandoc.Lua.Marshal.PandocError\n                     , Text.Pandoc.Lua.Marshal.ReaderOptions\n                     , Text.Pandoc.Lua.Marshal.Reference\n                     , Text.Pandoc.Lua.Marshal.Sources\n                     , Text.Pandoc.Lua.Marshal.Template\n                     , Text.Pandoc.Lua.Marshal.WriterOptions\n                     , Text.Pandoc.Lua.Module.CLI\n                     , Text.Pandoc.Lua.Module.Format\n                     , Text.Pandoc.Lua.Module.Image\n                     , Text.Pandoc.Lua.Module.JSON\n                     , Text.Pandoc.Lua.Module.Log\n                     , Text.Pandoc.Lua.Module.MediaBag\n                     , Text.Pandoc.Lua.Module.Pandoc\n                     , Text.Pandoc.Lua.Module.Path\n                     , Text.Pandoc.Lua.Module.Scaffolding\n                     , Text.Pandoc.Lua.Module.Structure\n                     , Text.Pandoc.Lua.Module.System\n                     , Text.Pandoc.Lua.Module.Template\n                     , Text.Pandoc.Lua.Module.Text\n                     , Text.Pandoc.Lua.Module.Types\n                     , Text.Pandoc.Lua.Module.Utils\n                     , Text.Pandoc.Lua.Orphans\n                     , Text.Pandoc.Lua.PandocLua\n                     , Text.Pandoc.Lua.Run\n                     , Text.Pandoc.Lua.SourcePos\n                     , Text.Pandoc.Lua.Writer.Classic\n                     , Text.Pandoc.Lua.Writer.Scaffolding\n\n  build-depends:       aeson\n                     , bytestring            >= 0.9     && < 0.13\n                     , crypton               >= 0.30    && < 1.2\n                     , citeproc              >= 0.8     && < 0.14\n                     , containers            >= 0.6.0.1 && < 0.9\n                     , data-default          >= 0.4     && < 0.9\n                     , doclayout             >= 0.5     && < 0.6\n                     , doctemplates          >= 0.11    && < 0.12\n                     , exceptions            >= 0.8     && < 0.11\n                     , hslua                 >= 2.5     && < 2.6\n                     , hslua-module-doclayout>= 1.2     && < 1.3\n                     , hslua-module-path     >= 1.2     && < 1.3\n                     , hslua-module-system   >= 1.3     && < 1.4\n                     , hslua-module-text     >= 1.2     && < 1.3\n                     , hslua-module-version  >= 1.2     && < 1.3\n                     , hslua-module-zip      >= 1.1.5   && < 1.3\n                     , lpeg                  >= 1.1     && < 1.2\n                     , mtl                   >= 2.2     && < 2.4\n                     , pandoc                >= 3.9     && < 3.10\n                     , pandoc-lua-marshal    >= 0.3     && < 0.4\n                     , pandoc-types          >= 1.22    && < 1.24\n                     , parsec                >= 3.1     && < 3.2\n                     , text                  >= 1.1.1   && < 2.2\n\n  if flag(repl)\n     build-depends:    hslua-repl            >= 0.1.1   && < 0.2\n     cpp-options:      -DINCLUDE_REPL\n\ntest-suite test-pandoc-lua-engine\n  import:              common-options\n  type:                exitcode-stdio-1.0\n  main-is:             test-pandoc-lua-engine.hs\n  hs-source-dirs:      test\n  build-depends:       pandoc-lua-engine\n                     , bytestring\n                     , directory\n                     , data-default\n                     , exceptions            >= 0.8     && < 0.11\n                     , filepath\n                     , hslua                 >= 2.5     && < 2.6\n                     , pandoc\n                     , pandoc-types          >= 1.22    && < 1.24\n                     , tasty\n                     , tasty-golden\n                     , tasty-hunit\n                     , tasty-lua             >= 1.1     && < 1.2\n                     , text                  >= 1.1.1   && < 2.2\n  other-modules:       Tests.Lua\n                     , Tests.Lua.Module\n                     , Tests.Lua.Reader\n                     , Tests.Lua.Writer\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Custom.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Custom\n   Copyright   : © 2021-2024 Albert Krewinkel, John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nSupports custom parsers written in Lua which produce a Pandoc AST.\n-}\nmodule Text.Pandoc.Lua.Custom ( loadCustom ) where\nimport Control.Exception\nimport Control.Monad ((<=<), (<$!>))\nimport Control.Monad.IO.Class (MonadIO)\nimport Data.Maybe (fromMaybe)\nimport HsLua as Lua hiding (Operation (Div))\nimport Text.Pandoc.Class (PandocMonad, findFileWithDataFallback)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Global (Global (..), setGlobals)\nimport Text.Pandoc.Lua.Marshal.Format (peekExtensionsConfig)\nimport Text.Pandoc.Lua.Marshal.Pandoc (peekPandoc)\nimport Text.Pandoc.Lua.Marshal.WriterOptions (pushWriterOptions)\nimport Text.Pandoc.Lua.PandocLua (unPandocLua)\nimport Text.Pandoc.Lua.Run (runLuaWith)\nimport Text.Pandoc.Readers (Reader (..))\nimport Text.Pandoc.Sources (ToSources(..))\nimport Text.Pandoc.Scripting (CustomComponents (..))\nimport Text.Pandoc.Writers (Writer (..))\nimport qualified Text.Pandoc.Lua.Writer.Classic as Classic\nimport qualified Text.Pandoc.Class as PandocMonad\n\n-- | Convert custom markup to Pandoc.\nloadCustom :: (PandocMonad m, MonadIO m)\n           => FilePath -> m (CustomComponents m)\nloadCustom luaFile = do\n  luaState <- liftIO newGCManagedState\n  luaFile' <- fromMaybe luaFile <$>\n              findFileWithDataFallback \"custom\"  luaFile\n  either throw pure <=< runLuaWith luaState $ do\n    let globals = [ PANDOC_SCRIPT_FILE luaFile' ]\n    setGlobals globals\n    dofileTrace (Just luaFile') >>= \\case\n      OK -> pure ()\n      _  -> throwErrorAsException\n\n    mextsConf <- rawgetglobal \"Extensions\" >>= \\case\n      TypeNil      -> pure Nothing\n      TypeFunction -> Just <$!> do\n        callTrace 0 1\n        forcePeek $ peekExtensionsConfig top `lastly` pop 1\n      _            -> Just <$!> do\n        forcePeek $ peekExtensionsConfig top `lastly` pop 1\n\n    mtemplate <- rawgetglobal \"Template\" >>= \\case\n      TypeNil   -> pure Nothing\n      TypeFunction -> Just <$!> do\n        callTrace 0 1\n        forcePeek $ peekText top `lastly` pop 1\n      _ -> Just <$!> do\n        forcePeek $ peekText top `lastly` pop 1\n\n    mreader <- rawgetglobal \"Reader\" >>= \\case\n      TypeNil -> do\n        pop 1\n        rawgetglobal \"ByteStringReader\" >>= \\case\n          TypeNil -> pure Nothing\n          _ -> do\n            setfield registryindex readerField\n            pure . Just $ byteStringReader luaState\n      _ -> do\n        setfield registryindex readerField\n        pure . Just $ textReader luaState\n\n    mwriter <- rawgetglobal \"Writer\" >>= \\case\n      TypeNil -> rawgetglobal \"ByteStringWriter\" >>= \\case\n        TypeNil -> do\n          -- Neither `Writer` nor `BinaryWriter` are defined. Check for\n          -- \"Doc\"; if present, use the file as a classic writer.\n          docType <- rawgetglobal \"Doc\"\n          pop 3  -- remove nils/value of \"Writer\", \"ByteStringWriter\", \"Doc\"\n          pure $\n            if docType /= TypeFunction\n            then Nothing\n            else Just . TextWriter $ \\opts doc -> do\n              -- See TextWriter below for why the state is updated\n              st <- PandocMonad.getCommonState\n              liftIO $ withGCManagedState luaState $\n                unPandocLua (PandocMonad.putCommonState st) >>\n                Classic.runCustom @PandocError opts doc\n        _ -> Just <$!> do\n          -- Binary writer. Writer function is on top of the stack.\n          setfield registryindex writerField\n          pure $ ByteStringWriter $ \\opts doc -> do\n            -- See TextWriter below for why the state is updated\n            st <- PandocMonad.getCommonState\n            -- Call writer with document and writer options as arguments.\n            liftIO $ withGCManagedState luaState $ do\n              unPandocLua (PandocMonad.putCommonState st)\n              getfield registryindex writerField\n              push doc\n              pushWriterOptions opts\n              callTrace 2 1\n              forcePeek @PandocError $ peekLazyByteString top\n      _ -> Just <$!> do\n        -- New-type text writer. Writer function is on top of the stack.\n        setfield registryindex writerField\n        pure $ TextWriter $ \\opts doc -> do\n          -- The CommonState might have changed since the Lua file was\n          -- loaded. That's why the state must be updated when the\n          -- writer is run. (#9229)\n          st <- PandocMonad.getCommonState\n          liftIO $ withGCManagedState luaState $ do\n            unPandocLua (PandocMonad.putCommonState st)\n            getfield registryindex writerField\n            push doc\n            pushWriterOptions opts\n            callTrace 2 1\n            forcePeek @PandocError $ peekText top\n\n    pure $ CustomComponents\n      { customReader = mreader\n      , customWriter = mwriter\n      , customTemplate = mtemplate\n      , customExtensions = mextsConf\n      }\n\n-- | \"Raw\", non-metatable lookup of a key in the global table.\n--\n-- Most classic writers contain code that throws an error if a global\n-- is not present. This would break our check for the existence of a\n-- \"Writer\" function. We resort to raw access for that reason, but\n-- could also catch the error instead.\n--\n-- TODO: This function ensures the proper behavior of legacy custom\n-- writers. It should be replaced with 'getglobal' in the future.\nrawgetglobal :: LuaError e => Name -> LuaE e Lua.Type\nrawgetglobal x = do\n  pushglobaltable\n  pushName x\n  rawget (nth 2) <* remove (nth 2) -- remove global table\n\n-- | Name under which the reader function is stored in the registry.\nreaderField :: Name\nreaderField = \"Pandoc Reader function\"\n\n-- | Name under which the writer function is stored in the registry.\nwriterField :: Name\nwriterField = \"Pandoc Writer function\"\n\n-- | Runs a Lua action in a continuable environment and transfers the common\n-- state after the Lua action has finished.\ninLua :: (PandocMonad m, MonadIO m)\n  => GCManagedState -> LuaE PandocError a -> m a\ninLua st luaAction = do\n  let inLua' = liftIO . withGCManagedState @PandocError st\n  result <- inLua' luaAction\n  cstate <- inLua' (unPandocLua PandocMonad.getCommonState)\n  PandocMonad.putCommonState cstate\n  return result\n\n-- | Returns the ByteStringReader function\nbyteStringReader :: (PandocMonad m, MonadIO m) => GCManagedState -> Reader m\nbyteStringReader st = ByteStringReader $ \\ropts input -> inLua st $ do\n  getfield registryindex readerField\n  push input\n  push ropts\n  pcallTrace 2 1 >>= \\case\n    OK -> forcePeek $ peekPandoc top\n    _ -> throwErrorAsException\n\n-- | Returns the TextReader function\ntextReader :: (PandocMonad m, MonadIO m) => GCManagedState -> Reader m\ntextReader st = TextReader $ \\ropts srcs -> inLua st $ do\n  let input = toSources srcs\n  getfield registryindex readerField\n  push input\n  push ropts\n  pcallTrace 2 1 >>= \\case\n    OK -> forcePeek (peekPandoc top)\n    _ -> throwErrorAsException\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Documentation.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RankNTypes        #-}\n{- |\n   Module      : Text.Pandoc.Lua.Documentation\n   Copyright   : Copyright © 2026 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nRender Lua documentation\n-}\nmodule Text.Pandoc.Lua.Documentation\n  ( renderDocumentation\n  ) where\n\nimport Data.Default (def)\nimport Data.List (intersperse)\nimport Data.Sequence (Seq ((:|>)))\nimport Data.Version (showVersion)\nimport HsLua as Lua\nimport Text.Pandoc.Class (runPure)\nimport Text.Pandoc.Definition (Pandoc (Pandoc))\nimport Text.Pandoc.Extensions (extensionsFromList, Extension (..))\nimport Text.Pandoc.Options (ReaderOptions (readerExtensions))\nimport Text.Pandoc.Readers (readCommonMark)\nimport Text.Pandoc.Shared (compactify)\nimport Text.Pandoc.Walk (walk)\n\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport qualified Text.Pandoc.UTF8 as UTF8\n\n-- | Render the documentation object as pandoc Blocks\nrenderDocumentation :: DocumentationObject -> B.Blocks\nrenderDocumentation = \\case\n  DocObjectFunction fn -> renderFunctionDoc Nothing fn\n  DocObjectModule mdl  -> renderModuleDoc mdl\n  DocObjectType tp     -> renderTypeDoc Nothing tp\n\nrenderTypeDoc :: Maybe T.Text -> TypeDoc -> B.Blocks\nrenderTypeDoc mbmodname td = mconcat\n  [ B.headerWith (ident, [], []) 1 (B.str $ typeDocName td)\n  , parseCommonMark $ typeDocDescription td\n  , if null $ typeDocMethods td\n    then mempty\n    else\n      B.header 2 \"Methods\" <>\n      (shiftHeadings 2 . mconcat . map (renderFunctionDoc Nothing) $\n       typeDocMethods td)\n  ]\n where\n  ident = case mbmodname of\n    Just modname  -> mconcat [ \"type-\", modname, \".\", typeDocName td ]\n    Nothing       -> mconcat [ \"type-\", typeDocName td ]\n\n-- Shift headings\nshiftHeadings :: Int -> B.Blocks -> B.Blocks\nshiftHeadings incr blks = flip walk blks $ \\case\n  B.Header level attr inner -> B.Header (level + incr) attr inner\n  x -> x\n\nrenderModuleDoc :: ModuleDoc -> B.Blocks\nrenderModuleDoc moddoc =\n  let modname = moduleDocName moddoc\n  in mconcat\n  [ B.headerWith (\"module-\" <> modname, [], []) 1\n      (B.str $ \"Module \" <> modname)\n  , parseCommonMark (moduleDocDescription moddoc)\n  , if null (moduleDocFields moddoc)\n    then mempty\n    else\n      let ident = modname <> \"-fields\"\n      in B.headerWith (ident, [], []) 2 (B.str \"Fields\") <>\n         shiftHeadings 0 (mconcat (map (renderFieldDoc modname)\n                                   (moduleDocFields moddoc)))\n  , if null (moduleDocFunctions moddoc)\n    then mempty\n    else\n      let ident = modname <> \"-functions\"\n      in B.headerWith (ident, [], []) 2 (B.str \"Functions\") <>\n         (shiftHeadings 2 . mconcat . map (renderFunctionDoc $ Just modname) $\n          moduleDocFunctions moddoc)\n  , if null (moduleDocTypes moddoc)\n    then mempty\n    else\n      let ident = modname <> \"-types\"\n      in B.headerWith (ident, [], []) 2 (B.str \"Types\") <>\n         (shiftHeadings 2 . mconcat . map (renderTypeDoc $ Just modname) .\n          reverse $ moduleDocTypes moddoc)\n  ]\n\nparseCommonMark :: T.Text -> B.Blocks\nparseCommonMark txt =\n  let exts = extensionsFromList\n        [ Ext_wikilinks_title_after_pipe\n        , Ext_smart\n        ]\n      result = runPure $ do\n        Pandoc _ blks <- readCommonMark (def {readerExtensions = exts}) txt\n        return $ B.fromList blks\n  in either mempty id result\n\nappendInlines :: B.Blocks -> B.Inlines -> B.Blocks\nappendInlines blks inlns = case B.unMany blks of\n  front :|> (B.Para xs) -> B.Many front <> B.para (addTo xs)\n  front :|> (B.Plain xs) -> B.Many front <> B.plain (addTo xs)\n  _ -> blks <> B.para inlns\n where addTo xs = B.fromList xs <> B.space <> inlns\n\nappendType :: B.Blocks -> TypeSpec -> B.Blocks\nappendType blks typespec =\n  appendInlines blks (B.str \"(\" <> typeToInlines typespec <> B.str \")\")\n\ntypeToInlines :: TypeSpec -> B.Inlines\ntypeToInlines = \\case\n  bt@BasicType{}   -> builtin $ tystr bt\n  NamedType \"integer\" -> builtin \"integer\"\n  NamedType name   -> B.linkWith (\"\", [\"documented-type\"], [])\n                        (\"#\" <> n2t name) mempty $ B.str (n2t name)\n  SeqType itemtype -> \"{\" <> typeToInlines itemtype <> \",...}\"\n  SumType summands -> mconcat . intersperse (B.str \"|\") $ map typeToInlines summands\n  AnyType          -> \"any\"\n  x                -> tystr x\n where\n  tystr = B.str . T.pack . typeSpecToString\n  n2t = UTF8.toText . fromName\n  builtin = B.spanWith (\"\", [\"builtin-lua-type\"], [])\n\nrenderFunctionDoc :: Maybe T.Text -> FunctionDoc -> B.Blocks\nrenderFunctionDoc mbmodule fndoc =\n  let name = case mbmodule of\n        Just _   ->  T.takeWhileEnd (/= '.') $ funDocName fndoc\n        Nothing  -> funDocName fndoc\n      ident = funDocName fndoc\n      level = 1\n      argsString = argslist (funDocParameters fndoc)\n      paramToDefItem p = ( B.code $ parameterName p\n                         , compactify\n                           [ appendType\n                               (parseCommonMark $ parameterDescription p)\n                               (parameterType p)\n                           ]\n                         )\n      paramlist = B.definitionList . map paramToDefItem $\n                  funDocParameters fndoc\n  in mconcat\n     [ B.headerWith (ident, [], []) level (B.str name)\n     , B.plain (B.code $ name <> \" (\" <> argsString <> \")\")\n     , parseCommonMark (funDocDescription fndoc)\n     , if null (funDocParameters fndoc)\n       then mempty\n       else B.para \"Parameters:\" <> paramlist\n     , if funDocResults fndoc == ResultsDocList []\n       then mempty\n       else B.para \"Returns:\" <> renderResults (funDocResults fndoc)\n     , case funDocSince fndoc of\n         Nothing -> mempty\n         Just version ->\n           B.para $ B.emph $ \"Since: \" <> (B.str . T.pack $ showVersion version)\n     ]\n\nrenderResults :: ResultsDoc -> B.Blocks\nrenderResults (ResultsDocMult descr) = parseCommonMark descr\nrenderResults (ResultsDocList rvd) = B.bulletList $ map renderResultVal rvd\n where\n   renderResultVal (ResultValueDoc typespec descr) =\n     parseCommonMark descr `appendType` typespec\n\nargslist :: [ParameterDoc] -> T.Text\nargslist params =\n  -- Expect optional values to come after required values.\n  let (required, optional') = break parameterIsOptional params\n      reqs = map parameterName required\n      opts = map parameterName optional'\n  in if null opts\n     then T.intercalate \", \" reqs\n     else T.intercalate \", \" reqs <>\n          (if null required then \"[\" else \"[, \") <>\n          T.intercalate \"[, \" opts <> T.replicate (length opts) \"]\"\n\nrenderFieldDoc :: T.Text -> FieldDoc -> B.Blocks\nrenderFieldDoc _modname fd =\n  B.headerWith (ident, [], []) 3 (B.str name) <>\n  appendType (parseCommonMark $ fieldDocDescription fd) (fieldDocType fd)\n where\n  ident = fieldDocName fd\n  name = T.takeWhileEnd (/= '.') $ fieldDocName fd\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Engine.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TypeApplications  #-}\n{- |\n   Module      : Text.Pandoc.Lua.Engine\n   Copyright   : Copyright © 2017-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nRunning pandoc Lua filters.\n-}\nmodule Text.Pandoc.Lua.Engine\n  ( getEngine\n  , applyFilter\n  ) where\n\nimport Control.Exception (throw)\nimport Control.Monad ((>=>))\nimport Control.Monad.IO.Class (MonadIO (liftIO))\nimport HsLua.Core (getglobal, openlibs, run, top, tostring)\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Filter (Environment (..))\nimport Text.Pandoc.Error (PandocError (PandocFilterError, PandocLuaError))\nimport Text.Pandoc.Lua.Custom (loadCustom)\nimport Text.Pandoc.Lua.Filter (runFilterFile)\nimport Text.Pandoc.Lua.Global (Global (..), setGlobals)\nimport Text.Pandoc.Lua.Run (runLua)\nimport Text.Pandoc.Lua.Orphans ()\nimport Text.Pandoc.Scripting (ScriptingEngine (..))\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Data.Text as T\n\n-- | Constructs the Lua scripting engine.\ngetEngine :: MonadIO m => m ScriptingEngine\ngetEngine = do\n  versionName <- liftIO . run @PandocError $ do\n    openlibs\n    getglobal \"_VERSION\"\n    tostring top\n  pure $ ScriptingEngine\n    { engineName = maybe \"Lua (unknown version)\" UTF8.toText versionName\n    , engineApplyFilter = applyFilter\n    , engineLoadCustom = loadCustom\n    }\n\n-- | Run the Lua filter in @filterPath@ for a transformation to the\n-- target format (first element in args). Pandoc uses Lua init files to\n-- setup the Lua interpreter.\napplyFilter :: (PandocMonad m, MonadIO m)\n            => Environment\n            -> [String]\n            -> FilePath\n            -> Pandoc\n            -> m Pandoc\napplyFilter fenv args fp doc = do\n  let globals = [ FORMAT $ case args of\n                    x:_ -> T.pack x\n                    _   -> \"\"\n                , PANDOC_READER_OPTIONS (envReaderOptions fenv)\n                , PANDOC_WRITER_OPTIONS (envWriterOptions fenv)\n                , PANDOC_SCRIPT_FILE fp\n                ]\n  runLua >=> forceResult fp $ do\n    setGlobals globals\n    runFilterFile fp doc\n\nforceResult :: (PandocMonad m, MonadIO m)\n            => FilePath -> Either PandocError Pandoc -> m Pandoc\nforceResult fp eitherResult = case eitherResult of\n  Right x  -> return x\n  Left err -> throw . PandocFilterError (T.pack fp) $ case err of\n    PandocLuaError msg -> msg\n    _                  -> T.pack $ show err\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Filter.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\nModule      : Text.Pandoc.Lua.Filter\nCopyright   : © 2012-2024 John MacFarlane,\n              © 2017-2024 Albert Krewinkel\nLicense     : GPL-2.0-or-later\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nTypes and functions for running Lua filters.\n-}\nmodule Text.Pandoc.Lua.Filter\n  ( runFilterFile\n  , runFilterFile'\n  ) where\nimport Control.Monad ((>=>), (<$!>))\nimport HsLua as Lua\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.AST\nimport Text.Pandoc.Lua.Marshal.Filter\nimport Text.Pandoc.Lua.PandocLua ()\n\n-- | Transform document using the filter defined in the given file.\n-- Runs the filter in the global environment.\nrunFilterFile :: FilePath -> Pandoc -> LuaE PandocError Pandoc\nrunFilterFile filterPath doc = do\n  Lua.pushglobaltable\n  runFilterFile' Lua.top filterPath doc <* Lua.pop 1\n\n-- | Like 'runFilterFile', but uses the table at the given index as the\n-- environment in which the filter is run.\nrunFilterFile' :: StackIndex -> FilePath -> Pandoc\n               -> LuaE PandocError Pandoc\nrunFilterFile' envIdx filterPath doc = do\n  oldtop <- gettop\n  stat <- dofileTrace' envIdx (Just filterPath)\n  if stat /= OK\n    then throwErrorAsException\n    else do\n      newtop <- gettop\n      -- Use the returned filters, or the implicitly defined global\n      -- filter if nothing was returned.\n      luaFilters <- forcePeek $\n        if newtop - oldtop >= 1\n        then liftLua (rawlen top) >>= \\case\n          -- explicitly returned filter, either a single one or a list\n          0 -> (:[]) <$!> peekFilter top  -- single filter\n          _ -> peekList peekFilter top    -- list of explicit filters\n        else (:[]) <$!> peekFilter envIdx -- get the implicit filter in _ENV\n      settop oldtop\n      runAll luaFilters doc\n\n-- | Apply Lua filters to a document\nrunAll :: [Filter] -> Pandoc -> LuaE PandocError Pandoc\nrunAll = foldr ((>=>) . applyFully) return\n\n-- | Like 'HsLua.Core.Trace.dofileTrace', but uses a local environment.\ndofileTrace' :: LuaError e\n             => StackIndex     -- ^ stack index of the environment table\n             -> Maybe FilePath -- ^ file to load (or @Nothing@ for stdin)\n             -> LuaE e Status\ndofileTrace' envIdx fp = do\n  absEnv <- Lua.absindex envIdx\n  loadfile fp >>= \\case\n    OK -> do\n      Lua.pushvalue absEnv\n      Just (Name \"_ENV\") <- Lua.setupvalue (Lua.nth 2) 1\n      pcallTrace 0 multret\n    s  -> pure s\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Global.hs",
    "content": "{-# LANGUAGE LambdaCase         #-}\n{-# LANGUAGE OverloadedStrings  #-}\n{- |\n   Module      : Text.Pandoc.Lua\n   Copyright   : Copyright © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nPandoc's Lua globals.\n-}\nmodule Text.Pandoc.Lua.Global\n  ( Global (..)\n  , setGlobals\n  ) where\n\nimport HsLua as Lua\nimport HsLua.Module.Version (pushVersion)\nimport Text.Pandoc.Class ( getInputFiles, getOutputFile, getLog\n                         , getRequestHeaders, getResourcePath, getSourceURL\n                         , getUserDataDir, getTrace, getVerbosity\n                         )\nimport Text.Pandoc.Definition (Pandoc, pandocTypesVersion)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList)\nimport Text.Pandoc.Lua.Marshal.LogMessage (pushLogMessage)\nimport Text.Pandoc.Lua.Marshal.Pandoc (pushPandoc)\nimport Text.Pandoc.Lua.Marshal.ReaderOptions (pushReaderOptionsReadonly)\nimport Text.Pandoc.Lua.Marshal.WriterOptions (pushWriterOptions)\nimport Text.Pandoc.Lua.PandocLua (unPandocLua)\nimport Text.Pandoc.Options (ReaderOptions, WriterOptions)\nimport Text.Pandoc.Version (pandocVersion)\n\nimport qualified Data.Text as Text\n\n-- | Permissible global Lua variables.\ndata Global =\n    FORMAT Text.Text\n  | PANDOC_API_VERSION\n  | PANDOC_DOCUMENT Pandoc\n  | PANDOC_READER_OPTIONS ReaderOptions\n  | PANDOC_WRITER_OPTIONS WriterOptions\n  | PANDOC_SCRIPT_FILE FilePath\n  | PANDOC_STATE\n  | PANDOC_VERSION\n  -- Cannot derive instance of Data because of CommonState\n\n-- | Set all given globals.\nsetGlobals :: [Global] -> LuaE PandocError ()\nsetGlobals = mapM_ setGlobal\n\nsetGlobal :: Global -> LuaE PandocError ()\nsetGlobal global = case global of\n  -- This could be simplified if Global was an instance of Data.\n  FORMAT format -> do\n    Lua.pushText format\n    Lua.setglobal \"FORMAT\"\n  PANDOC_API_VERSION -> do\n    pushVersion pandocTypesVersion\n    Lua.setglobal \"PANDOC_API_VERSION\"\n  PANDOC_DOCUMENT doc -> do\n    pushPandoc doc\n    Lua.setglobal \"PANDOC_DOCUMENT\"\n  PANDOC_READER_OPTIONS ropts -> do\n    pushReaderOptionsReadonly ropts\n    Lua.setglobal \"PANDOC_READER_OPTIONS\"\n  PANDOC_WRITER_OPTIONS wopts -> do\n    pushWriterOptions wopts\n    Lua.setglobal \"PANDOC_WRITER_OPTIONS\"\n  PANDOC_SCRIPT_FILE filePath -> do\n    Lua.pushString filePath\n    Lua.setglobal \"PANDOC_SCRIPT_FILE\"\n  PANDOC_STATE -> do\n    -- The common state is an opaque value. We provide a table that\n    -- contains the values accessible through the PandocMonad API. This\n    -- is for backwards compatibility, as the state used to be exposed\n    -- as a read-only object.\n    Lua.newtable\n    Lua.newmetatable \"CommonStateInterface\"\n    Lua.pushHaskellFunction $ do\n      Lua.forcePeek (peekText (Lua.nthBottom 2)) >>= \\case\n        \"input_files\" -> do\n          pushPandocList pushString =<< unPandocLua getInputFiles\n          return 1\n        \"output_file\" -> do\n          maybe pushnil pushString =<< unPandocLua getOutputFile\n          return 1\n        \"log\" -> do\n          pushPandocList pushLogMessage =<< unPandocLua getLog\n          return 1\n        \"request_headers\" -> do\n          pushPandocList (pushPair pushText pushText)\n                   =<< unPandocLua getRequestHeaders\n          return 1\n        \"resource_path\" -> do\n          pushPandocList pushString =<< unPandocLua getResourcePath\n          return 1\n        \"source_url\" -> do\n          maybe pushnil pushText =<< unPandocLua getSourceURL\n          return 1\n        \"user_data_dir\" -> do\n          maybe pushnil pushString =<< unPandocLua getUserDataDir\n          return 1\n        \"trace\" -> do\n          pushBool =<< unPandocLua getTrace\n          return 1\n        \"verbosity\" -> do\n          pushString . show =<< unPandocLua getVerbosity\n          return 1\n        _ ->\n          failLua \"Unknown key\"\n    Lua.setfield (Lua.nth 2) \"__index\"\n    Lua.setmetatable (Lua.nth 2)\n    Lua.setglobal \"PANDOC_STATE\"\n  PANDOC_VERSION              -> do\n    pushVersion pandocVersion\n    Lua.setglobal \"PANDOC_VERSION\"\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RankNTypes        #-}\n{- |\n   Module      : Text.Pandoc.Lua.Init\n   Copyright   : © 2017-2026 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nFunctions to initialize the Lua interpreter.\n-}\nmodule Text.Pandoc.Lua.Init\n  ( initLua\n  , userInit\n  ) where\n\nimport Control.Monad (when)\nimport Control.Monad.Catch (throwM)\nimport HsLua as Lua hiding (status)\nimport Text.Pandoc.Class (report)\nimport Text.Pandoc.Data (readDataFile)\nimport Text.Pandoc.Error (PandocError (PandocLuaError))\nimport Text.Pandoc.Logging (LogMessage (ScriptingWarning))\nimport Text.Pandoc.Lua.Module (initModules)\nimport Text.Pandoc.Lua.PandocLua (PandocLua (..), liftPandocLua)\nimport Text.Pandoc.Lua.SourcePos (luaSourcePos)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.UTF8 as UTF8\n\n-- | Initialize Lua with all default and pandoc-specific libraries and default\n-- globals.\ninitLua :: PandocLua ()\ninitLua = do\n  liftPandocLua Lua.openlibs\n  setWarnFunction\n  initModules\n  liftPandocLua userInit\n\n-- | User-controlled initialization, e.g., running the user's init script.\nuserInit :: LuaE PandocError ()\nuserInit = runInitScript\n\n-- | Run the @init.lua@ data file as a Lua script.\nrunInitScript :: LuaE PandocError ()\nrunInitScript = runDataFileScript \"init.lua\"\n\n-- | Get a data file and run it as a Lua script.\nrunDataFileScript :: FilePath -> LuaE PandocError ()\nrunDataFileScript scriptFile = do\n  script <- unPandocLua $ readDataFile scriptFile\n  status <- Lua.dostring script\n  when (status /= Lua.OK) $ do\n    err <- popException\n    let prefix = \"Couldn't load '\" <> T.pack scriptFile <> \"':\\n\"\n    throwM . PandocLuaError . (prefix <>) $ case err of\n      PandocLuaError msg -> msg\n      _                  -> T.pack $ show err\n\nsetWarnFunction :: PandocLua ()\nsetWarnFunction = liftPandocLua . setwarnf' $ \\msg -> do\n  -- reporting levels:\n  -- 0: this hook,\n  -- 1: userdata wrapper function for the hook,\n  -- 2: warn,\n  -- 3: function calling warn.\n  pos <- luaSourcePos 3\n  unPandocLua . report $ ScriptingWarning (UTF8.toText msg) pos\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Chunks.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshal.Chunks\n   Copyright   : © 2022 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nMarshaling chunks, i.e., pandoc subdocuments.\n-}\nmodule Text.Pandoc.Lua.Marshal.Chunks\n  ( peekChunk\n  , pushChunk\n  , peekChunkedDoc\n  , pushChunkedDoc\n  ) where\n\nimport Control.Monad ((<$!>))\nimport Data.Tree (Tree (..))\nimport HsLua\nimport Text.Pandoc.Chunks (Chunk (..), ChunkedDoc (..), SecInfo (..))\nimport Text.Pandoc.Lua.Marshal.AST\n\n-- | Retrieves a 'Chunk' from the Lua stack.\npeekChunk :: LuaError e => Peeker e Chunk\npeekChunk = peekUD typeChunk\n\n-- | Pushes a 'Chunk' to the top of the Lua stack.\npushChunk :: LuaError e => Pusher e Chunk\npushChunk = pushUD typeChunk\n\ntypeChunk :: LuaError e => DocumentedType e Chunk\ntypeChunk = deftype \"Chunk\"\n  [ operation Tostring $ lambda\n    ### liftPure show\n    <#> udparam typeChunk \"chunk\" \"chunk to print in native format\"\n    =#> functionResult pushString \"string\" \"Haskell representation\"\n  ]\n  [ property \"heading\"\n    \"heading text\"\n    (pushInlines, chunkHeading)\n    (peekInlinesFuzzy, \\chunk inlns -> chunk{ chunkHeading = inlns })\n\n  , property \"id\"\n    \"identifier\"\n    (pushText, chunkId)\n    (peekText, \\chunk ident -> chunk{ chunkId = ident })\n\n  , property \"level\"\n    \"level of topmost heading in chunk\"\n    (pushIntegral, chunkLevel)\n    (peekIntegral, \\chunk level -> chunk{ chunkLevel = level })\n\n  , property \"number\"\n    \"chunk number\"\n    (pushIntegral, chunkNumber)\n    (peekIntegral, \\chunk number -> chunk{ chunkNumber = number })\n\n  , property \"section_number\"\n    \"hierarchical section number\"\n    (pushMaybe pushText, chunkSectionNumber)\n    (peekMaybe peekText, \\chunk secnum -> chunk{ chunkSectionNumber = secnum })\n\n  , property \"path\"\n    \"target filepath for this chunk\"\n    (pushString, chunkPath)\n    (peekString, \\chunk path -> chunk{ chunkPath = path })\n\n  , property \"up\"\n    \"link to the enclosing section chunk, if any\"\n    (pushMaybe pushChunk, chunkUp)\n    (peekMaybe peekChunk, \\chunk up -> chunk{ chunkUp = up })\n\n  , property \"prev\"\n    \"link to the previous section, if any\"\n    (pushMaybe pushChunk, chunkPrev)\n    (peekMaybe peekChunk, \\chunk prev -> chunk{ chunkPrev = prev })\n\n  , property \"next\"\n    \"link to the next section, if any\"\n    (pushMaybe pushChunk, chunkNext)\n    (peekMaybe peekChunk, \\chunk next' -> chunk{ chunkNext = next' })\n\n  , property \"unlisted\"\n    ( \"whether the section in this chunk should be listed in the TOC\" <>\n      \"even if the chunk has no section number\" )\n    (pushBool, chunkUnlisted)\n    (peekBool, \\chunk unlisted -> chunk { chunkUnlisted = unlisted })\n\n  , property \"contents\"\n    \"the chunk's block contents\"\n    (pushBlocks, chunkContents)\n    (peekBlocksFuzzy, \\chunk blks -> chunk{ chunkContents = blks })\n  ]\n\n-- | Retrieves a 'ChunkedDoc' from the Lua stack.\npeekChunkedDoc :: LuaError e => Peeker e ChunkedDoc\npeekChunkedDoc = peekUD typeChunkedDoc\n\n-- | Pushes a 'ChunkedDoc to the top of the Lua stack.\npushChunkedDoc :: LuaError e => Pusher e ChunkedDoc\npushChunkedDoc = pushUD typeChunkedDoc\n\n-- | Lua type for 'ChunkedDoc' values.\ntypeChunkedDoc :: LuaError e => DocumentedType e ChunkedDoc\ntypeChunkedDoc = deftype \"ChunkedDoc\"\n  []\n  [ readonly \"chunks\"\n    \"list of chunks that make up the document\"\n    (pushList pushChunk, chunkedChunks)\n\n  , readonly \"meta\"\n    \"the document's metadata\"\n    (pushMeta, chunkedMeta)\n\n  , readonly \"toc\"\n    \"table of contents information\"\n    (pushTocTree, chunkedTOC)\n  ]\n\n-- | Pushes a TOC tree to the stack. The resulting object is a list with\n-- the top-level entry placed at index @0@ and all subentries as the\n-- rest of the list.\npushTocTree :: LuaError e => Pusher e (Tree SecInfo)\npushTocTree (Node secInfo subSecInfo) = do\n  pushList pushTocTree subSecInfo\n  pushSecInfo secInfo\n  rawseti (nth 2) 0\n\npushSecInfo :: LuaError e => Pusher e SecInfo\npushSecInfo = pushAsTable\n  [ (\"title\"  , pushInlines . secTitle)\n  , (\"number\" , maybe pushnil pushText . secNumber)\n  , (\"id\"     , pushText . secId)\n  , (\"path\"   , pushText . secPath)\n  , (\"level\"  , pushIntegral . secLevel)\n  ]\n\npeekMaybe :: LuaError e => Peeker e a -> Peeker e (Maybe a)\npeekMaybe p idx = liftLua (isnoneornil idx) >>= \\case\n  True  -> pure Nothing\n  False -> Just <$!> p idx\n\npushMaybe :: LuaError e => Pusher e a -> Pusher e (Maybe a)\npushMaybe = maybe pushnil\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/CommonState.hs",
    "content": "{-# LANGUAGE OverloadedStrings    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshal.CommonState\n   Copyright   : © 2012-2024 John MacFarlane\n                 © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nInstances to marshal (push) and unmarshal (peek) the common state.\n-}\nmodule Text.Pandoc.Lua.Marshal.CommonState\n  ( typeCommonState\n  , peekCommonState\n  , pushCommonState\n  ) where\n\nimport HsLua\nimport Text.Pandoc.Class (CommonState)\n\n-- | Lua type used for the @CommonState@ object.\n--\n-- This is an opaque value that is required for the Lua interpreter\n-- to become an instance of \"PandocMonad\".\n--\ntypeCommonState :: LuaError e => DocumentedType e CommonState\ntypeCommonState = deftype \"CommonState\" [] []\n\n-- | Retrieves the common state from Lua\npeekCommonState :: LuaError e => Peeker e CommonState\npeekCommonState = peekUD typeCommonState\n\n-- | Pushes the common pandoc state to the Lua stack.\npushCommonState :: LuaError e => Pusher e CommonState\npushCommonState = pushUD typeCommonState\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Context.hs",
    "content": "{-# LANGUAGE FlexibleInstances    #-}\n{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshaling.Context\n   Copyright   : © 2012-2024 John MacFarlane\n                 © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nMarshaling instance for doctemplates Context and its components.\n-}\nmodule Text.Pandoc.Lua.Marshal.Context\n  ( peekContext\n  , pushContext\n  ) where\n\nimport Control.Monad (when, (<$!>))\nimport Data.Text (Text)\nimport HsLua as Lua\nimport HsLua.Module.DocLayout (peekDoc, pushDoc)\nimport Text.DocTemplates (Context(..), Val(..))\n\ninstance Pushable (Context Text) where\n  push = pushContext\n\ninstance Pushable (Val Text) where\n  push = pushVal\n\n-- | Retrieves a template context from the Lua stack.\npeekContext :: LuaError e => Peeker e (Context Text)\npeekContext idx = Context <$!> peekMap peekText peekVal idx\n\n-- | Pushes a template context to the Lua stack.\npushContext :: LuaError e => Pusher e (Context Text)\npushContext ctx = do\n  pushMap pushText pushVal $ unContext ctx\n  created <- Lua.newmetatable \"pandoc Context\"\n  when created $ do\n    pushName \"__concat\"\n    pushHaskellFunction $ do\n      c1 <- forcePeek $ peekContext (nthBottom 1)\n      c2 <- forcePeek $ peekContext (nthBottom 2)\n      pushContext (c1 <> c2)\n      return 1\n    rawset (nth 3)\n  setmetatable (nth 2)\n\npushVal :: LuaError e => Pusher e (Val Text)\npushVal = \\case\n  NullVal     -> Lua.pushnil\n  BoolVal b   -> Lua.pushBool b\n  MapVal ctx  -> pushContext ctx\n  ListVal xs  -> pushList pushVal xs\n  SimpleVal d -> pushDoc d\n\npeekVal :: LuaError e => Peeker e (Val Text)\npeekVal idx = liftLua (ltype idx) >>= \\case\n  TypeNil      -> pure NullVal\n  TypeBoolean  -> BoolVal <$!> peekBool idx\n  TypeNumber   -> SimpleVal <$!> peekDoc idx\n  TypeString   -> SimpleVal <$!> peekDoc idx\n  TypeTable    -> do\n    len <- liftLua $ Lua.rawlen idx\n    if len <= 0\n      then MapVal <$!> peekContext idx\n      else ListVal <$!> peekList peekVal idx\n  TypeUserdata -> SimpleVal <$!> peekDoc idx\n  _ -> failPeek =<<\n       typeMismatchMessage \"Doc, string, boolean, table, or nil\" idx\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Format.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE TupleSections        #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshaling.Format\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nMarshaling functions and instance for format related types, including\n'Extensions' and 'ExtensionConfig'.\n-}\nmodule Text.Pandoc.Lua.Marshal.Format\n  ( peekExtensions\n  , pushExtensions\n  , peekExtensionsConfig\n  , pushExtensionsConfig\n  , peekFlavoredFormat\n  ) where\n\nimport Control.Applicative ((<|>))\nimport Control.Monad ((<$!>))\nimport Data.Maybe (fromMaybe)\nimport HsLua\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Extensions\n  ( Extension, Extensions, extensionsFromList, extensionsToList\n  , getDefaultExtensions, readExtension, showExtension )\nimport Text.Pandoc.Format\n  ( ExtensionsConfig (..), ExtensionsDiff (..), FlavoredFormat (..)\n  , diffExtensions, parseFlavoredFormat)\nimport Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua))\n\n-- | Retrieves a single 'Extension' from the Lua stack.\npeekExtension :: LuaError e => Peeker e Extension\npeekExtension idx = do\n  extString <- peekString idx\n  return $ readExtension extString\n{-# INLINE peekExtension #-}\n\n-- | Pushes an individual 'Extension' to the Lua stack.\npushExtension :: LuaError e => Pusher e Extension\npushExtension = pushText . showExtension\n{-# INLINE pushExtension #-}\n\n-- | Retrieves an 'Extensions' set from the Lua stack.\npeekExtensions :: LuaError e => Peeker e Extensions\npeekExtensions = fmap extensionsFromList . peekList peekExtension\n{-# INLINE peekExtensions #-}\n\n-- | Pushes a set of 'Extensions' to the top of the Lua stack.\npushExtensions :: LuaError e => Pusher e Extensions\npushExtensions = pushViaJSON\n{-# INLINE pushExtensions #-}\n\ninstance Peekable Extensions where\n  safepeek = peekExtensions\n\ninstance Pushable Extensions where\n  push = pushExtensions\n\n-- | Retrieves an 'ExtensionsConfig' value from the Lua stack.\npeekExtensionsConfig :: LuaError e => Peeker e ExtensionsConfig\npeekExtensionsConfig idx = do\n  diff <- peekExtensionsDiff idx\n  return $ ExtensionsConfig\n    { extsDefault   = extsToEnable diff\n    , extsSupported = extsToEnable diff <> extsToDisable diff\n    }\n\n-- | Pushes an 'ExtensionsConfig' value as a table with that maps\n-- extensions to their default enabled/disabled status.\npushExtensionsConfig :: LuaError e => Pusher e ExtensionsConfig\npushExtensionsConfig (ExtensionsConfig def supported) =\n  pushKeyValuePairs pushExtension pushBool $\n    map (,False) (extensionsToList supported) ++\n    map (,True)  (extensionsToList def)\n\ninstance Peekable ExtensionsConfig where\n  safepeek = peekExtensionsConfig\n\npeekExtensionsDiff :: LuaError e => Peeker e ExtensionsDiff\npeekExtensionsDiff = typeChecked \"table\" istable $ \\idx ->\n      (do\n          en <- peekFieldRaw (emptyOr (fmap Just . peekExtensions)) \"enable\" idx\n          di <- peekFieldRaw (emptyOr (fmap Just . peekExtensions)) \"disable\" idx\n          if (en, di) == (Nothing, Nothing)\n            then failPeek \"At least on of  'enable' and 'disable' must be set\"\n            else return $\n                 ExtensionsDiff (fromMaybe mempty en) (fromMaybe mempty di))\n  <|> -- two lists of extensions; the first is list assumed to contain those\n      -- extensions to be enabled\n      (uncurry ExtensionsDiff <$!> peekPair peekExtensions peekExtensions idx)\n  <|> (do\n          let\n          exts <- peekKeyValuePairs peekExtension peekEnabled idx\n          let enabled  = extensionsFromList . map fst $ filter snd exts\n          let disabled = extensionsFromList . map fst $ filter (not . snd) exts\n          return $ ExtensionsDiff enabled disabled)\n\n-- | Retrieves the activation status of an extension. True or the string\n-- @'enable'@ for activated, False or 'disable' for disabled.\npeekEnabled :: LuaError e => Peeker e Bool\npeekEnabled idx' = liftLua (ltype idx') >>= \\case\n  TypeBoolean -> peekBool idx'\n  TypeString  -> peekText idx' >>= \\case\n                   \"disable\" -> pure False\n                   \"enable\"  -> pure True\n                   _         -> failPeek \"expected 'disable' or 'enable'\"\n  _ -> failPeek \"expected boolean or string\"\n\n-- | Retrieves a flavored format from the Lua stack.\npeekFlavoredFormat :: Peeker PandocError FlavoredFormat\npeekFlavoredFormat idx = retrieving \"flavored format\" $\n  liftLua (ltype idx) >>= \\case\n  TypeString -> peekText idx >>= liftLua . unPandocLua . parseFlavoredFormat\n  TypeTable -> do\n    let diffFor format idx' = peekExtensionsDiff idx' <|>\n          (getDefaultExtensions format `diffExtensions`) <$>\n          (typeChecked \"table\" istable peekExtensions idx')\n    format   <- peekFieldRaw peekText \"format\" idx\n    extsDiff <- peekFieldRaw (emptyOr (diffFor format)) \"extensions\" idx\n    return (FlavoredFormat format extsDiff)\n  _ -> failPeek =<< typeMismatchMessage \"string or table\" idx\n\n-- | Returns 'mempty' if the given stack index is @nil@, and the result\n-- of the peeker otherwise.\nemptyOr :: Monoid a => Peeker e a -> Peeker e a\nemptyOr p idx = do\n  nil <- liftLua (isnil idx)\n  if nil\n    then pure mempty\n    else p idx\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/ImageSize.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshal.ImageSize\n   Copyright   : © 2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nMarshaling image properties.\n-}\nmodule Text.Pandoc.Lua.Marshal.ImageSize\n  ( pushImageType\n  , pushImageSize\n  ) where\n\nimport Data.Char (toLower)\nimport HsLua\nimport Text.Pandoc.ImageSize\n\n-- | Pushes an 'ImageType' as a string value.\npushImageType :: LuaError e => Pusher e ImageType\npushImageType = pushString . map toLower . show\n\n-- | Pushes a dimensional value.\npushImageSize :: LuaError e => Pusher e ImageSize\npushImageSize = pushAsTable\n  [ (\"width\", pushIntegral . pxX)\n  , (\"height\", pushIntegral . pxY)\n  , (\"dpi_horz\", pushIntegral . dpiX)\n  , (\"dpi_vert\", pushIntegral . dpiY)\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/LogMessage.hs",
    "content": "{-# LANGUAGE OverloadedStrings    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshal.LogMessage\n   Copyright   : © 2017-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nPushing and retrieving of pandoc log messages.\n-}\nmodule Text.Pandoc.Lua.Marshal.LogMessage\n  ( peekLogMessage\n  , pushLogMessage\n  , typeLogMessage\n  ) where\n\nimport Control.Applicative (optional)\nimport Data.Maybe (fromMaybe)\nimport HsLua\nimport Text.Pandoc.Logging (LogMessage, showLogMessage)\nimport qualified Data.Aeson as Aeson\n\n-- | Type definition for pandoc log messages.\ntypeLogMessage :: LuaError e => DocumentedType e LogMessage\ntypeLogMessage = deftype \"LogMessage\"\n  [ operation Index $ defun \"__tostring\"\n      ### liftPure showLogMessage\n      <#> udparam typeLogMessage \"msg\" \"object\"\n      =#> functionResult pushText \"string\" \"stringified log message\"\n  , operation Eq $ lambda\n      ### liftPure2 (\\a b -> fromMaybe False ((==) <$> a <*> b))\n      <#> parameter (optional . peekLogMessage) \"a\" \"LogMessage\" \"\"\n      <#> parameter (optional . peekLogMessage) \"b\" \"LogMessage\" \"\"\n      =#> functionResult pushBool \"boolean\" \"whether the two are equal\"\n  , operation (CustomOperation \"__tojson\") $ lambda\n      ### liftPure Aeson.encode\n      <#> udparam typeLogMessage \"msg\" \"object\"\n      =#> functionResult pushLazyByteString \"string\" \"JSON encoded object\"\n  ]\n  mempty -- no members\n\n-- | Pushes a LogMessage to the stack.\npushLogMessage :: LuaError e => Pusher e LogMessage\npushLogMessage = pushUD typeLogMessage\n\npeekLogMessage :: LuaError e => Peeker e LogMessage\npeekLogMessage  = peekUD typeLogMessage\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE ScopedTypeVariables  #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshal.PandocError\n   Copyright   : © 2020-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nMarshal of @'PandocError'@ values.\n-}\nmodule Text.Pandoc.Lua.Marshal.PandocError\n  ( peekPandocError\n  , pushPandocError\n  , typePandocError\n  )\n  where\n\nimport HsLua (LuaError, Peeker, Pusher, liftLua, pushText)\nimport HsLua.Packaging\nimport Text.Pandoc.Error (PandocError (PandocLuaError), renderError)\n\nimport qualified HsLua as Lua\nimport qualified HsLua.Core.Utf8 as UTF8\n\n-- | Lua userdata type definition for PandocError.\ntypePandocError :: LuaError e => DocumentedType e PandocError\ntypePandocError = deftype \"PandocError\"\n  [ operation Tostring $ defun \"__tostring\"\n    ### liftPure (\\case\n                     PandocLuaError e -> e\n                     err              -> renderError err)\n    <#> udparam typePandocError \"obj\" \"PandocError object\"\n    =#> functionResult pushText \"string\" \"string representation of error.\"\n  ]\n  mempty -- no members\n\n-- | Peek a @'PandocError'@ element to the Lua stack.\npushPandocError :: LuaError e => Pusher e PandocError\npushPandocError = pushUD typePandocError\n\n-- | Retrieve a @'PandocError'@ from the Lua stack.\npeekPandocError :: LuaError e => Peeker e PandocError\npeekPandocError idx = Lua.retrieving \"PandocError\" $\n  liftLua (Lua.ltype idx) >>= \\case\n    Lua.TypeUserdata -> peekUD typePandocError idx\n    _ -> do\n      msg <- liftLua $ do\n        Lua.pushvalue idx\n        Lua.state >>= \\l -> Lua.liftIO (Lua.popErrorMessage l)\n      return $ PandocLuaError (UTF8.toText msg)\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/ReaderOptions.hs",
    "content": "{-# LANGUAGE CPP                  #-}\n{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE ScopedTypeVariables  #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshaling.ReaderOptions\n   Copyright   : © 2012-2024 John MacFarlane\n                 © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nMarshaling instance for ReaderOptions and its components.\n-}\nmodule Text.Pandoc.Lua.Marshal.ReaderOptions\n  ( peekReaderOptions\n  , pushReaderOptions\n  , pushReaderOptionsReadonly\n  ) where\n\nimport Data.Default (def)\nimport HsLua as Lua\nimport Text.Pandoc.Lua.Marshal.Format (peekExtensions, pushExtensions)\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList)\nimport Text.Pandoc.Options (ReaderOptions (..))\n\n--\n-- Reader Options\n--\n\n-- | Retrieve a ReaderOptions value, either from a normal ReaderOptions\n-- value, from a read-only object, or from a table with the same\n-- keys as a ReaderOptions object.\npeekReaderOptions :: LuaError e => Peeker e ReaderOptions\npeekReaderOptions = retrieving \"ReaderOptions\" . \\idx ->\n  liftLua (ltype idx) >>= \\case\n    TypeUserdata -> choice [ peekUD typeReaderOptions\n                           , peekUD typeReaderOptionsReadonly\n                           ]\n                           idx\n    TypeTable    -> peekReaderOptionsTable idx\n    _            -> failPeek =<<\n                    typeMismatchMessage \"ReaderOptions userdata or table\" idx\n\n-- | Pushes a ReaderOptions value as userdata object.\npushReaderOptions :: LuaError e => Pusher e ReaderOptions\npushReaderOptions = pushUD typeReaderOptions\n\n-- | Pushes a ReaderOptions object, but makes it read-only.\npushReaderOptionsReadonly :: LuaError e => Pusher e ReaderOptions\npushReaderOptionsReadonly = pushUD typeReaderOptionsReadonly\n\n-- | ReaderOptions object type for read-only values.\ntypeReaderOptionsReadonly :: LuaError e => DocumentedType e ReaderOptions\ntypeReaderOptionsReadonly = deftype \"ReaderOptions (read-only)\"\n  [ operation Tostring $ lambda\n    ### liftPure show\n    <#> udparam typeReaderOptions \"opts\" \"options to print in native format\"\n    =#> functionResult pushString \"string\" \"Haskell representation\"\n  , operation Newindex $ lambda\n    ### (failLua \"This ReaderOptions value is read-only.\")\n    =?> \"Throws an error when called, i.e., an assignment is made.\"\n  ]\n  readerOptionsMembers\n\n-- | 'ReaderOptions' object type.\ntypeReaderOptions :: LuaError e => DocumentedType e ReaderOptions\ntypeReaderOptions = deftype \"ReaderOptions\"\n  [ operation Tostring $ lambda\n    ### liftPure show\n    <#> udparam typeReaderOptions \"opts\" \"options to print in native format\"\n    =#> functionResult pushString \"string\" \"Haskell representation\"\n  ]\n  readerOptionsMembers\n\n-- | Member properties of 'ReaderOptions' Lua values.\nreaderOptionsMembers :: LuaError e\n                     => [Member e (DocumentedFunction e) ReaderOptions]\nreaderOptionsMembers =\n  [ property \"abbreviations\" \"\"\n      (pushSet pushText, readerAbbreviations)\n      (peekSet peekText, \\opts x -> opts{ readerAbbreviations = x })\n  , property \"columns\" \"\"\n      (pushIntegral, readerColumns)\n      (peekIntegral, \\opts x -> opts{ readerColumns = x })\n  , property \"default_image_extension\" \"\"\n      (pushText, readerDefaultImageExtension)\n      (peekText, \\opts x -> opts{ readerDefaultImageExtension = x })\n  , property \"extensions\" \"\"\n      (pushExtensions, readerExtensions)\n      (peekExtensions, \\opts x -> opts{ readerExtensions = x })\n  , property \"indented_code_classes\" \"\"\n      (pushPandocList pushText, readerIndentedCodeClasses)\n      (peekList peekText, \\opts x -> opts{ readerIndentedCodeClasses = x })\n  , property \"standalone\" \"\"\n      (pushBool, readerStandalone)\n      (peekBool, \\opts x -> opts{ readerStandalone = x })\n  , property \"strip_comments\" \"\"\n      (pushBool, readerStripComments)\n      (peekBool, \\opts x -> opts{ readerStripComments = x })\n  , property \"tab_stop\" \"\"\n      (pushIntegral, readerTabStop)\n      (peekIntegral, \\opts x -> opts{ readerTabStop = x })\n  , property \"track_changes\" \"\"\n      (pushViaJSON, readerTrackChanges)\n      (choice [peekRead, peekViaJSON], \\opts x -> opts{ readerTrackChanges = x })\n  ]\n\n-- | Retrieves a 'ReaderOptions' object from a table on the stack, using\n-- the default values for all missing fields.\n--\n-- Internally, this pushes the default reader options, sets each\n-- key/value pair of the table in the userdata value, then retrieves the\n-- object again. This will update all fields and complain about unknown\n-- keys.\npeekReaderOptionsTable :: LuaError e => Peeker e ReaderOptions\npeekReaderOptionsTable idx = retrieving \"ReaderOptions (table)\" $ do\n  liftLua $ do\n    absidx <- absindex idx\n    pushUD typeReaderOptions def\n    let setFields = do\n          next absidx >>= \\case\n            False -> return () -- all fields were copied\n            True -> do\n              pushvalue (nth 2) *> insert (nth 2)\n              settable (nth 4) -- set in userdata object\n              setFields\n    pushnil -- first key\n    setFields\n  peekUD typeReaderOptions top `lastly` pop 1\n\ninstance Pushable ReaderOptions where\n  push = pushReaderOptions\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Reference.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE ScopedTypeVariables  #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshaling.ReaderOptions\n   Copyright   : © 2012-2024 John MacFarlane\n                 © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nMarshal citeproc 'Reference' values.\n-}\nmodule Text.Pandoc.Lua.Marshal.Reference\n  ( pushReference\n  ) where\n\nimport Citeproc.Types\n  ( Date (..), DateParts (..), ItemId (..), Name (..), Reference (..)\n  , Val (..), Variable, fromVariable\n  )\nimport Control.Monad (forM_)\nimport HsLua hiding (Name, Reference, pushName, peekName)\nimport Text.Pandoc.Builder (Inlines, toList)\nimport Text.Pandoc.Lua.Marshal.Inline (pushInlines)\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList)\n\nimport qualified Data.Map as Map\n\n-- | Pushes a ReaderOptions value as userdata object.\npushReference :: LuaError e => Pusher e (Reference Inlines)\npushReference reference = do\n  pushAsTable [ (\"id\", pushItemId . referenceId)\n              , (\"type\", pushText . referenceType)\n              ]\n              reference\n  forM_ (Map.toList $ referenceVariables reference) $ \\(var, val) -> do\n    pushVariable var\n    pushVal val\n    rawset (nth 3)\n\n-- | Pushes an 'ItemId' as a string.\npushItemId :: Pusher e ItemId\npushItemId = pushText . unItemId\n\n-- | Pushes a person's 'Name' as a table.\npushName :: LuaError e => Pusher e Name\npushName = pushAsTable\n  [ (\"family\"                , pushTextOrNil . nameFamily)\n  , (\"given\"                 , pushTextOrNil . nameGiven)\n  , (\"dropping-particle\"     , pushTextOrNil . nameDroppingParticle)\n  , (\"non-dropping-particle\" , pushTextOrNil . nameNonDroppingParticle)\n  , (\"suffix\"                , pushTextOrNil . nameSuffix)\n  , (\"literal\"               , pushTextOrNil . nameLiteral)\n  , (\"comma-suffix\"          , pushBoolOrNil . nameCommaSuffix)\n  , (\"static-ordering\"       , pushBoolOrNil . nameStaticOrdering)\n  ]\n  where\n    pushTextOrNil = \\case\n      Nothing -> pushnil\n      Just xs -> pushText xs\n\n-- | Pushes a boolean, but uses @nil@ instead of @false@; table fields\n-- are not set unless the value is true.\npushBoolOrNil :: Pusher e Bool\npushBoolOrNil = \\case\n  False -> pushnil\n  True  -> pushBool True\n\n-- | Pushes a 'Variable' as string.\npushVariable :: Pusher e Variable\npushVariable = pushText . fromVariable\n\n-- | Pushes a 'Val', i.e., a variable value.\npushVal :: LuaError e => Pusher e (Val Inlines)\npushVal = \\case\n  TextVal t -> pushText t\n  FancyVal inlns -> pushInlines $ toList inlns\n  NumVal i       -> pushIntegral i\n  NamesVal names -> pushPandocList pushName names\n  DateVal date   -> pushDate date\n  _              -> pushText mempty\n\n-- | Pushes a 'Date' as table.\npushDate :: LuaError e => Pusher e Date\npushDate = pushAsTable\n  [ (\"date-parts\", pushPandocList pushDateParts . dateParts)\n  , (\"circa\", pushBoolOrNil . dateCirca)\n  , (\"season\", maybe pushnil pushIntegral . dateSeason)\n  , (\"literal\", maybe pushnil pushText . dateLiteral)\n  ]\n where\n   -- date parts are lists of Int values\n   pushDateParts (DateParts dp) = pushPandocList pushIntegral dp\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Sources.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE TupleSections        #-}\n{- |\nModule      : Text.Pandoc.Lua.Marshaling.Sources\nCopyright   : © 2021-2026 Albert Krewinkel <albert+pandoc@tarleb.com>\nLicense     : GPL-2.0-or-later\n\nMarshal 'Sources'.\n-}\nmodule Text.Pandoc.Lua.Marshal.Sources\n  ( peekSources\n  , pushSources\n  , typeSource\n  ) where\n\nimport Control.Monad ((<$!>))\nimport Data.Text (Text)\nimport HsLua as Lua\nimport Text.Pandoc.Lua.Marshal.List (newListMetatable)\nimport Text.Pandoc.Sources (Sources (..), toSources)\nimport Text.Parsec (SourcePos, sourceName)\n\n-- | Pushes the 'Sources' as a list of lazy Lua objects.\npushSources :: LuaError e => Pusher e Sources\npushSources (Sources srcs) = do\n  pushList (pushUD typeSource) srcs\n  newListMetatable \"Sources\" $ do\n    pushName \"__tostring\"\n    pushHaskellFunction $ do\n      sources <- forcePeek $ peekList (peekUD typeSource) (nthBottom 1)\n      pushText . mconcat $ map snd sources\n      return 1\n    rawset (nth 3)\n  setmetatable (nth 2)\n\n-- | Retrieves sources from the stack.\npeekSources :: LuaError e => Peeker e Sources\npeekSources idx = liftLua (ltype idx) >>= \\case\n  TypeTable  -> mconcat <$!> peekList peekSourcesSingleton idx\n  _          -> peekSourcesSingleton idx\n\n-- | Retrieves a Sources singleton, i.e., a list with exactly one item.\npeekSourcesSingleton :: LuaError e => Peeker e Sources\npeekSourcesSingleton = choice\n  [ fmap toSources . peekText\n  , fmap (Sources . (:[])) . peekUD typeSource\n  , fmap (toSources . (:[])) . peekPair peekString peekText\n  , fmap (toSources . (:[])) .\n    (\\idx -> (,)\n      <$> peekFieldRaw peekString \"name\" idx\n      <*> peekFieldRaw peekText \"text\" idx)\n  ]\n\n-- | A @Sources@ item.\ntype Source = (SourcePos, Text)\n\n-- | Source object type.\ntypeSource :: LuaError e => DocumentedType e Source\ntypeSource = deftype \"Source\"\n  [ operation Tostring $ lambda\n    ### liftPure snd\n    <#> udparam typeSource \"srcs\" \"Source to print in native format\"\n    =#> functionResult pushText \"string\" \"source contents\"\n  ]\n  [ readonly \"name\" \"source name\"\n      (pushString, sourceName . fst)\n  , readonly \"text\" \"source text\"\n      (pushText, snd)\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Template.hs",
    "content": "{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\nModule      : Text.Pandoc.Lua.Marshal.Template\nCopyright   : © 2021-2024 Albert Krewinkel\nLicense     : GNU GPL, version 2 or above\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nMarshal 'Template' 'Text'.\n-}\nmodule Text.Pandoc.Lua.Marshal.Template\n  ( pushTemplate\n  , peekTemplate\n  , typeTemplate\n  ) where\n\nimport Data.Text (Text)\nimport HsLua as Lua\nimport HsLua.Core.Utf8 as Lua\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.PandocLua (unPandocLua)\nimport Text.Pandoc.Templates (Template, compileTemplate, runWithDefaultPartials)\n\n-- | Pushes a 'Template' as a an opaque userdata value.\npushTemplate :: LuaError e => Pusher e (Template Text)\npushTemplate = pushUD typeTemplate\n\n-- | Retrieves a 'Template' 'Text' value from the stack.\npeekTemplate :: Peeker PandocError (Template Text)\npeekTemplate idx = liftLua (ltype idx) >>= \\case\n  TypeString -> do\n    let path = \"templates/default.custom\"\n    let liftPM = liftLua . unPandocLua\n    tmpl <- peekText idx\n    liftPM (runWithDefaultPartials (compileTemplate path tmpl)) >>= \\case\n      Left e  -> failPeek (Lua.fromString e)\n      Right t -> pure t\n  _ -> peekUD typeTemplate idx\n\n-- | Template object type.\ntypeTemplate :: LuaError e => DocumentedType e (Template Text)\ntypeTemplate = deftype \"Template\" [] []\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs",
    "content": "{-# LANGUAGE CPP                  #-}\n{-# LANGUAGE LambdaCase           #-}\n{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE ScopedTypeVariables  #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\n   Module      : Text.Pandoc.Lua.Marshaling.WriterOptions\n   Copyright   : © 2021-2024 Albert Krewinkel, John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nMarshaling instance for WriterOptions and its components.\n-}\nmodule Text.Pandoc.Lua.Marshal.WriterOptions\n  ( peekWriterOptions\n  , pushWriterOptions\n  ) where\n\nimport Control.Applicative (optional)\nimport Data.Default (def)\nimport HsLua as Lua\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.Context (peekContext, pushContext)\nimport Text.Pandoc.Lua.Marshal.Format (peekExtensions, pushExtensions)\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList)\nimport Text.Pandoc.Lua.Marshal.Template (peekTemplate, pushTemplate)\nimport Text.Pandoc.Options (WriterOptions (..))\n\n--\n-- Writer Options\n--\n\n-- | Retrieve a WriterOptions value, either from a normal WriterOptions\n-- value, from a read-only object, or from a table with the same\n-- keys as a WriterOptions object.\npeekWriterOptions :: Peeker PandocError WriterOptions\npeekWriterOptions = retrieving \"WriterOptions\" . \\idx ->\n  liftLua (ltype idx) >>= \\case\n    TypeUserdata -> peekUD typeWriterOptions idx\n    TypeTable    -> peekWriterOptionsTable idx\n    _            -> failPeek =<<\n                    typeMismatchMessage \"WriterOptions userdata or table\" idx\n\n-- | Pushes a WriterOptions value as userdata object.\npushWriterOptions :: Pusher PandocError WriterOptions\npushWriterOptions = pushUD typeWriterOptions\n\n-- | 'WriterOptions' object type.\ntypeWriterOptions :: DocumentedType PandocError WriterOptions\ntypeWriterOptions = deftype \"WriterOptions\"\n  [ operation Tostring $ lambda\n    ### liftPure show\n    <#> udparam typeWriterOptions \"opts\" \"options to print in native format\"\n    =#> functionResult pushString \"string\" \"Haskell representation\"\n  ]\n  [ property \"chunk_template\"\n    \"Templates used to generate chunked HTML filenames (string)\"\n    (pushViaJSON, writerChunkTemplate)\n    (peekViaJSON, \\opts x -> opts{ writerChunkTemplate = x })\n\n  , property \"cite_method\"\n    \"How to print cites\"\n    (pushViaJSON, writerCiteMethod)\n    (peekViaJSON, \\opts x -> opts{ writerCiteMethod = x })\n\n  , property \"columns\"\n    \"Characters in a line (for text wrapping)\"\n    (pushIntegral, writerColumns)\n    (peekIntegral, \\opts x -> opts{ writerColumns = x })\n\n  , property \"dpi\"\n    \"DPI for pixel to/from inch/cm conversions\"\n    (pushIntegral, writerDpi)\n    (peekIntegral, \\opts x -> opts{ writerDpi = x })\n\n  , property \"email_obfuscation\"\n    \"How to obfuscate emails\"\n    (pushViaJSON, writerEmailObfuscation)\n    (peekViaJSON, \\opts x -> opts{ writerEmailObfuscation = x })\n\n  , property \"split_level\"\n    \"Level at which EPUB or chunked HTML documents are split into files\"\n    (pushIntegral, writerSplitLevel)\n    (peekIntegral, \\opts x -> opts{ writerSplitLevel = x })\n\n  , property \"epub_chapter_level\"\n    \"Deprecated synonym for split_level\"\n    (pushIntegral, writerSplitLevel)\n    (peekIntegral, \\opts x -> opts{ writerSplitLevel = x })\n\n  , property \"epub_fonts\"\n    \"Paths to fonts to embed\"\n    (pushPandocList pushString, writerEpubFonts)\n    (peekList peekString, \\opts x -> opts{ writerEpubFonts = x })\n\n  , property \"epub_title_page\"\n    \"Determines whether a title page is included in EPUB\"\n    (pushBool, writerEpubTitlePage)\n    (peekBool, \\opts x -> opts{ writerEpubTitlePage = x })\n\n  , property \"epub_metadata\"\n    \"Metadata to include in EPUB\"\n    (maybe pushnil pushText, writerEpubMetadata)\n    (optional . peekText, \\opts x -> opts{ writerEpubMetadata = x })\n\n  , property \"epub_subdirectory\"\n    \"Subdir for epub in OCF\"\n    (pushText, writerEpubSubdirectory)\n    (peekText, \\opts x -> opts{ writerEpubSubdirectory = x })\n\n  , property \"extensions\"\n    \"Markdown extensions that can be used\"\n    (pushExtensions, writerExtensions)\n    (peekExtensions, \\opts x -> opts{ writerExtensions = x })\n\n  , property \"highlight_method\"\n    \"Method to use for code highlighting ('none'|'default'|'idiomatic'|style)\"\n    (pushViaJSON, writerHighlightMethod)\n    (peekViaJSON, \\opts x -> opts{ writerHighlightMethod = x })\n\n  , property \"html_math_method\"\n    \"How to print math in HTML\"\n    (pushViaJSON, writerHTMLMathMethod)\n    (peekViaJSON, \\opts x -> opts{ writerHTMLMathMethod = x })\n\n  , property \"link_images\"\n    \"Include links to images instead of embedding in ODT\"\n    (pushBool, writerLinkImages)\n    (peekBool, \\opts x -> opts{ writerLinkImages = x })\n\n  , property \"html_q_tags\"\n    \"Use @<q>@ tags for quotes in HTML\"\n    (pushBool, writerHtmlQTags)\n    (peekBool, \\opts x -> opts{ writerHtmlQTags = x })\n\n  , property \"identifier_prefix\"\n    \"Prefix for section & note ids in HTML and for footnote marks in markdown\"\n    (pushText, writerIdentifierPrefix)\n    (peekText, \\opts x -> opts{ writerIdentifierPrefix = x })\n\n  , property \"incremental\"\n    \"True if lists should be incremental\"\n    (pushBool, writerIncremental)\n    (peekBool, \\opts x -> opts{ writerIncremental = x })\n\n  , property \"list_of_figures\"\n    \"Include list of figures\"\n    (pushBool, writerListOfFigures)\n    (peekBool, \\opts x -> opts{ writerListOfFigures = x })\n\n  , property \"list_of_tables\"\n    \"Include list of tables\"\n    (pushBool, writerListOfTables)\n    (peekBool, \\opts x -> opts{ writerListOfTables = x })\n\n  , property \"number_offset\"\n    \"Starting number for section, subsection, ...\"\n    (pushPandocList pushIntegral, writerNumberOffset)\n    (peekList peekIntegral, \\opts x -> opts{ writerNumberOffset = x })\n\n  , property \"number_sections\"\n    \"Number sections in LaTeX\"\n    (pushBool, writerNumberSections)\n    (peekBool, \\opts x -> opts{ writerNumberSections = x })\n\n  , property \"prefer_ascii\"\n    \"Prefer ASCII representations of characters when possible\"\n    (pushBool, writerPreferAscii)\n    (peekBool, \\opts x -> opts{ writerPreferAscii = x })\n\n  , property \"reference_doc\"\n    \"Path to reference document if specified\"\n    (maybe pushnil pushString, writerReferenceDoc)\n    (optional . peekString, \\opts x -> opts{ writerReferenceDoc = x })\n\n  , property \"reference_links\"\n    \"Use reference links in writing markdown, rst\"\n    (pushBool, writerReferenceLinks)\n    (peekBool, \\opts x -> opts{ writerReferenceLinks = x })\n\n  , property \"reference_location\"\n    \"Location of footnotes and references for writing markdown\"\n    (pushViaJSON, writerReferenceLocation)\n    (peekViaJSON, \\opts x -> opts{ writerReferenceLocation = x })\n\n  , property \"figure_caption_position\"\n    \"Location of caption relative to the figure\"\n    (pushViaJSON, writerFigureCaptionPosition)\n    (peekViaJSON, \\opts x -> opts{ writerFigureCaptionPosition = x })\n\n  , property \"table_caption_position\"\n    \"Location of caption relative to the table\"\n    (pushViaJSON, writerTableCaptionPosition)\n    (peekViaJSON, \\opts x -> opts{ writerTableCaptionPosition = x })\n\n  , property \"section_divs\"\n    \"Put sections in div tags in HTML\"\n    (pushBool, writerSectionDivs)\n    (peekBool, \\opts x -> opts{ writerSectionDivs = x })\n\n  , property \"setext_headers\"\n    \"Use setext headers for levels 1-2 in markdown\"\n    (pushBool, writerSetextHeaders)\n    (peekBool, \\opts x -> opts{ writerSetextHeaders = x })\n\n  , property \"list_tables\"\n    \"Render tables using list tables in RST output\"\n    (pushBool, writerListTables)\n    (peekBool, \\opts x -> opts{ writerListTables = x })\n\n  , property \"slide_level\"\n    \"Force header level of slides\"\n    (maybe pushnil pushIntegral, writerSlideLevel)\n    (optional . peekIntegral, \\opts x -> opts{ writerSlideLevel = x })\n\n  -- , property \"syntax_map\" \"Syntax highlighting definition\"\n  --   (pushViaJSON, writerSyntaxMap)\n  --   (peekViaJSON, \\opts x -> opts{ writerSyntaxMap = x })\n    -- :: SyntaxMap\n\n  , property \"tab_stop\"\n    \"Tabstop for conversion btw spaces and tabs\"\n    (pushIntegral, writerTabStop)\n    (peekIntegral, \\opts x -> opts{ writerTabStop = x })\n\n  , property \"table_of_contents\"\n    \"Include table of contents\"\n    (pushBool, writerTableOfContents)\n    (peekBool, \\opts x -> opts{ writerTableOfContents = x })\n\n  , property \"template\"\n    \"Template to use\"\n    (maybe pushnil pushTemplate, writerTemplate)\n    (optional . peekTemplate, \\opts x -> opts{ writerTemplate = x })\n    -- :: Maybe (Template Text)\n\n  , property \"toc_depth\"\n    \"Number of levels to include in TOC\"\n    (pushIntegral, writerTOCDepth)\n    (peekIntegral, \\opts x -> opts{ writerTOCDepth = x })\n\n  , property \"top_level_division\"\n    \"Type of top-level divisions\"\n    (pushViaJSON, writerTopLevelDivision)\n    (peekViaJSON, \\opts x -> opts{ writerTopLevelDivision = x })\n\n  , property \"variables\"\n    \"Variables to set in template\"\n    (pushContext, writerVariables)\n    (peekContext, \\opts x -> opts{ writerVariables = x })\n\n  , property \"wrap_text\"\n    \"Option for wrapping text\"\n    (pushViaJSON, writerWrapText)\n    (peekViaJSON, \\opts x -> opts{ writerWrapText = x })\n  ]\n\n-- | Retrieves a 'WriterOptions' object from a table on the stack, using\n-- the default values for all missing fields.\n--\n-- Internally, this pushes the default writer options, sets each\n-- key/value pair of the table in the userdata value, then retrieves the\n-- object again. This will update all fields and complain about unknown\n-- keys.\npeekWriterOptionsTable :: Peeker PandocError WriterOptions\npeekWriterOptionsTable idx = retrieving \"WriterOptions (table)\" $ do\n  liftLua $ do\n    absidx <- absindex idx\n    pushUD typeWriterOptions def\n    let setFields = do\n          next absidx >>= \\case\n            False -> return () -- all fields were copied\n            True -> do\n              pushvalue (nth 2) *> insert (nth 2)\n              settable (nth 4) -- set in userdata object\n              setFields\n    pushnil -- first key\n    setFields\n  peekUD typeWriterOptions top `lastly` pop 1\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/CLI.hs",
    "content": "{-# LANGUAGE CPP               #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.CLI\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nCommand line helpers\n-}\nmodule Text.Pandoc.Lua.Module.CLI\n  ( documentedModule\n  ) where\n\nimport Control.Applicative ((<|>))\nimport Data.Version (makeVersion)\nimport HsLua\nimport Text.Pandoc.App (defaultOpts, options, parseOptionsFromArgs)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.PandocLua ()\nimport qualified Data.Text as T\n#ifdef INCLUDE_REPL\nimport HsLua.REPL (defaultConfig, replWithEnv, setup)\n#endif\n\n-- | Push the pandoc.types module on the Lua stack.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.cli\"\n  `withDescription`\n      \"Command line options and argument parsing.\"\n  `withFields`\n      [ deffield \"default_options\"\n        `withType` \"table\"\n        `withDescription`\n          \"Default CLI options, using a JSON-like representation.\"\n        `withValue` pushViaJSON defaultOpts\n      ]\n  `withFunctions`\n      [ defun \"parse_options\"\n        ### parseOptions\n        <#> parameter peekArgs \"{string,...}\" \"args\"\n              \"list of command line arguments\"\n        =#> functionResult pushViaJSON \"table\"\n              \"parsed options, using their JSON-like representation.\"\n        #? T.unlines\n           [ \"Parses command line arguments into pandoc options.\"\n           , \"Typically this function will be used in stand-alone pandoc Lua\"\n           , \"scripts, taking the list of arguments from the global `arg`.\"\n           ]\n        `since` makeVersion [3, 0]\n#ifdef INCLUDE_REPL\n      , repl `since` makeVersion [3, 1, 2]\n#endif\n      ]\n where\n  peekArgs idx =\n    (,)\n    <$> (liftLua (rawgeti idx 0) *> (peekString top <|> pure \"\") `lastly` pop 1)\n    <*> peekList peekString idx\n\n  parseOptions (prg, args) =\n    liftIO (parseOptionsFromArgs options defaultOpts prg args) >>=\n    \\case\n      Left e     -> failLua $ \"Cannot process info option: \" ++ show e\n      Right opts -> pure opts\n\n#ifdef INCLUDE_REPL\n-- | Starts a REPL.\nrepl :: DocumentedFunction PandocError\nrepl = defun \"repl\"\n  ### (\\menvIdx -> do\n          let repl' = case menvIdx of\n                        Nothing -> replWithEnv Nothing\n                        Just envIdx -> do\n                          settop envIdx\n                          fillWithGlobals envIdx\n                          replWithEnv . Just =<< ref registryindex\n          setup defaultConfig\n          repl')\n  <#> opt (parameter (typeChecked \"table\" istable pure) \"table\" \"env\"\n           (\"Extra environment; the global environment is merged into this\" <>\n           \" table.\"))\n  =?> T.unlines\n      [ \"The result(s) of the last evaluated input, or nothing if the last\"\n      , \"input resulted in an error.\"\n      ]\n  #? T.unlines\n  [ \"Starts a read-eval-print loop (REPL). The function returns all\"\n  , \"values of the last evaluated input. Exit the REPL by pressing\"\n  , \"`ctrl-d` or `ctrl-c`; press `F1` to get a list of all key\"\n  , \"bindings.\"\n  , \"\"\n  , \"The REPL is started in the global namespace, unless the `env`\"\n  , \"parameter is specified. In that case, the global namespace is\"\n  , \"merged into the given table and the result is used as `_ENV` value\"\n  , \"for the repl.\"\n  , \"\"\n  , \"Specifically, local variables *cannot* be accessed, unless they\"\n  , \"are explicitly passed via the `env` parameter; e.g.\"\n  , \"\"\n  , \"    function Pandoc (doc)\"\n  , \"      -- start repl, allow to access the `doc` parameter\"\n  , \"      -- in the repl\"\n  , \"      return pandoc.cli.repl{ doc = doc }\"\n  , \"    end\"\n  , \"\"\n  , \"**Note**: it seems that the function exits immediately on Windows,\"\n  , \"without prompting for user input.\"\n  ]\n where\n  fillWithGlobals idx = do\n    -- Copy all global values into the table\n    pushglobaltable\n    pushnil\n    let copyval = next (nth 2) >>= \\case\n          False -> return ()\n          True -> do\n            pushvalue (nth 2)\n            insert (nth 2)\n            rawset idx\n            copyval\n    copyval\n    pop 1  -- global table\n#endif\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Format.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Format\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nLua module to handle pandoc templates.\n-}\nmodule Text.Pandoc.Lua.Module.Format\n  ( documentedModule\n  ) where\n\nimport Data.Version (makeVersion)\nimport HsLua\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Extensions (getAllExtensions, getDefaultExtensions)\nimport Text.Pandoc.Format (formatFromFilePaths, formatName, getExtensionsConfig)\nimport Text.Pandoc.Lua.Marshal.Format (pushExtensions, pushExtensionsConfig)\nimport Text.Pandoc.Lua.PandocLua ()\n\nimport qualified Data.Text as T\n\n-- | The \"pandoc.format\" module.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.format\"\n  `withDescription` T.unlines\n    [ \"Information about the formats supported by pandoc.\"\n    ]\n  `withFunctions` functions\n\n-- | Extension module functions.\nfunctions :: [DocumentedFunction PandocError]\nfunctions =\n  [ defun \"all_extensions\"\n     ### liftPure getAllExtensions\n     <#> parameter peekText \"string\" \"format\" \"format name\"\n     =#> functionResult pushExtensions \"FormatExtensions\"\n           \"all extensions supported for `format`\"\n     #? T.unlines\n        [ \"Returns the list of all valid extensions for a format.\"\n        , \"No distinction is made between input and output; an extension\"\n        , \"can have an effect when reading a format but not when\"\n        , \"writing it, or *vice versa*.\"\n        ]\n     `since` makeVersion [3,0]\n\n  , defun \"default_extensions\"\n     ### liftPure getDefaultExtensions\n     <#> parameter peekText \"string\" \"format\" \"format name\"\n     =#> functionResult pushExtensions \"FormatExtensions\"\n           \"default extensions enabled for `format`\"\n     #? T.unlines\n        [ \"Returns the list of default extensions of the given format; this\"\n        , \"function does not check if the format is supported, it will return\"\n        , \"a fallback list of extensions even for unknown formats.\"\n        ]\n     `since` makeVersion [3,0]\n\n  , defun \"extensions\"\n     ### liftPure getExtensionsConfig\n     <#> textParam \"format\" \"format identifier\"\n     =#> functionResult pushExtensionsConfig \"table\" \"extensions config\"\n     #? T.unlines\n        [ \"Returns the extension configuration for the given format.\"\n        , \"The configuration is represented as a table with all supported\"\n        , \"extensions as keys and their default status as value, with\"\n        , \"`true` indicating that the extension is enabled by default,\"\n        , \"while `false` marks a supported extension that's disabled.\"\n        , \"\"\n        , \"This function can be used to assign a value to the `Extensions`\"\n        , \"global in custom readers and writers.\"\n        ]\n     `since` makeVersion [3,0]\n\n  , defun \"from_path\"\n      ### liftPure formatFromFilePaths\n      <#> parameter (choice [ fmap (:[]) . peekString, peekList peekString])\n            \"string|{string,...}\" \"path\" \"file path, or list of paths\"\n      =#> functionResult (maybe pushnil (pushText . formatName))\n            \"string|nil\"\n            \"format determined by heuristic\"\n      `since` makeVersion [3,1,2]\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Image.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-|\nModule      : Text.Pandoc.Lua.Module.Image\nCopyright   : © 2024 Albert Krewinkel\nLicense     : MIT\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nLua module for basic image operations.\n-}\nmodule Text.Pandoc.Lua.Module.Image (\n  -- * Module\n    documentedModule\n\n  -- ** Functions\n  , size\n  , format\n  )\nwhere\n\nimport Prelude hiding (null)\nimport Data.Default (Default (def))\nimport Data.Maybe (fromMaybe)\nimport Data.Version (makeVersion)\nimport HsLua.Core\nimport HsLua.Marshalling\nimport HsLua.Packaging\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.ImageSize (imageType, imageSize)\nimport Text.Pandoc.Lua.PandocLua ()\nimport Text.Pandoc.Lua.Marshal.ImageSize (pushImageType, pushImageSize)\nimport Text.Pandoc.Lua.Marshal.WriterOptions (peekWriterOptions)\n\nimport qualified Data.Text as T\n\n-- | The @pandoc.image@ module specification.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.image\"\n  `withDescription` \"Basic image querying functions.\"\n  `withFunctions` functions\n\n--\n-- Functions\n--\n\nfunctions :: [DocumentedFunction PandocError]\nfunctions =\n  [ size `since` makeVersion [3, 1, 13]\n  , format `since` makeVersion [3, 1, 13]\n  ]\n\n-- | Find the size of an image.\nsize :: DocumentedFunction PandocError\nsize = defun \"size\"\n  ### liftPure2 (\\img mwriterOpts -> imageSize (fromMaybe def mwriterOpts) img)\n  <#> parameter peekByteString \"string\" \"image\" \"image data\"\n  <#> opt (parameter peekWriterOptions \"WriterOptions|table\" \"opts\"\n           \"writer options\")\n  =#> functionResult (either (failLua . T.unpack) pushImageSize) \"table\"\n        \"image size information or error message\"\n  #? T.unlines\n     [ \"Returns a table containing the size and resolution of an image;\"\n     , \"throws an error if the given string is not an image, or if the size\"\n     , \"of the image cannot be determined.\"\n     , \"\"\n     , \"The resulting table has four entries: *width*, *height*, *dpi\\\\_horz*,\"\n     , \"and *dpi\\\\_vert*.\"\n     , \"\"\n     , \"The `opts` parameter, when given, should be either a WriterOptions\"\n     , \"object such as `PANDOC_WRITER_OPTIONS`, or a table with a `dpi` entry.\"\n     , \"It affects the calculation for vector image formats such as SVG.\"\n     ]\n\n-- | Returns the format of an image.\nformat :: LuaError e => DocumentedFunction e\nformat = defun \"format\"\n  ### liftPure imageType\n  <#> parameter peekByteString \"string\" \"image\" \"binary image data\"\n  =#> functionResult (maybe pushnil pushImageType) \"string|nil\"\n        \"image format, or nil if the format cannot be determined\"\n  #? T.unlines\n     [ \"Returns the format of an image as a lowercase string.\"\n     , \"\"\n     , \"Formats recognized by pandoc include *png*, *gif*, *tiff*, *jpeg*,\"\n     , \"*pdf*, *svg*, *eps*, and *emf*.\"\n     ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-|\nModule      : Text.Pandoc.Lua.Module.JSON\nCopyright   : © 2022-2024 Albert Krewinkel\nLicense     : MIT\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nLua module to work with JSON.\n-}\nmodule Text.Pandoc.Lua.Module.JSON (\n  -- * Module\n    documentedModule\n\n  -- ** Functions\n  , decode\n  , encode\n  )\nwhere\n\nimport Prelude hiding (null)\nimport Data.Maybe (fromMaybe)\nimport Data.Monoid (Alt (..))\nimport Data.Version (makeVersion)\nimport HsLua.Aeson\nimport HsLua.Core\nimport HsLua.Marshalling\nimport HsLua.Packaging\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.PandocLua ()\nimport Text.Pandoc.Lua.Marshal.AST\n\nimport qualified Data.Aeson as Aeson\nimport qualified Data.Text as T\n\n-- | The @aeson@ module specification.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.json\"\n  `withDescription`\n    \"JSON module to work with JSON; based on the Aeson Haskell package.\"\n  `withFields` fields\n  `withFunctions` functions\n\n--\n-- Fields\n--\n\n-- | Exported fields.\nfields :: LuaError e => [Field e]\nfields =\n  [ null\n  ]\n\n-- | The value used to represent the JSON @null@.\nnull :: LuaError e => Field e\nnull = deffield \"null\"\n  `withType` \"light userdata\"\n  `withDescription` \"Value used to represent the `null` JSON value.\"\n  `withValue` pushValue Aeson.Null\n\n--\n-- Functions\n--\n\nfunctions :: [DocumentedFunction PandocError]\nfunctions =\n  [ decode `since` makeVersion [3, 1, 1]\n  , encode `since` makeVersion [3, 1, 1]\n  ]\n\n-- | Decode a JSON string into a Lua object.\ndecode :: DocumentedFunction PandocError\ndecode = defun \"decode\"\n  ### (\\str usePandocTypes ->\n         fromMaybe pushnil . getAlt . mconcat . map Alt $\n         (if usePandocTypes == Just False\n          then []\n          else [ pushInline  <$> Aeson.decode str\n               , pushBlock   <$> Aeson.decode str\n               , pushPandoc  <$> Aeson.decode str\n               , pushInlines <$> Aeson.decode str\n               , pushBlocks  <$> Aeson.decode str\n               ])\n         ++ [pushValue <$> Aeson.decode str])\n  <#> parameter peekLazyByteString \"string\" \"str\" \"JSON string\"\n  <#> opt (parameter peekBool \"boolean\" \"pandoc_types\"\n           \"whether to use pandoc types when possible.\")\n  =#> functionResult pure \"any\" \"decoded object\"\n  #? T.unlines\n     [ \"Creates a Lua object from a JSON string. If the input can be decoded\"\n     , \"as representing an [[Inline]], [[Block]], [[Pandoc]], [[Inlines]],\"\n     , \"or [[Blocks]] element the function will return an object of the\"\n     , \"appropriate type. Otherwise, if the input does not represent any\"\n     , \"of the AST types, the default decoding is applied: Objects and\"\n     , \"arrays are represented as tables, the JSON `null` value becomes\"\n     , \"[null](#pandoc.json.null), and JSON booleans, strings, and numbers\"\n     , \"are converted using the Lua types of the same name.\"\n     , \"\"\n     , \"The special handling of AST elements can be disabled by setting\"\n     , \"`pandoc_types` to `false`.\"\n     ]\n\n-- | Encode a Lua object as JSON.\nencode :: LuaError e => DocumentedFunction e\nencode = defun \"encode\"\n  ### liftPure Aeson.encode\n  <#> parameter peekValue \"any\" \"object\" \"object to convert\"\n  =#> functionResult pushLazyByteString \"string\"\n        \"JSON encoding of the given `object`\"\n  #? T.unlines\n     [\"Encodes a Lua object as JSON string.\"\n     , \"\"\n     , \"If the object has a metamethod with name `__tojson`, then the\"\n     , \"result is that of a call to that method with `object` passed as\"\n     , \"the sole argument. The result of that call is expected to be a\"\n     , \"valid JSON string, but this is not checked.\"\n     ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Log.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TypeApplications  #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Log\n   Copyright   : © 2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nLogging module.\n-}\nmodule Text.Pandoc.Lua.Module.Log\n  ( documentedModule\n  ) where\n\nimport Data.Version (makeVersion)\nimport HsLua\nimport Text.Pandoc.Class (report, runSilently)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Logging (LogMessage (ScriptingInfo, ScriptingWarning))\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList)\nimport Text.Pandoc.Lua.Marshal.LogMessage (pushLogMessage)\nimport Text.Pandoc.Lua.PandocLua (liftPandocLua, unPandocLua)\nimport Text.Pandoc.Lua.SourcePos (luaSourcePos)\nimport qualified Data.Text as T\nimport qualified HsLua.Core.Utf8 as UTF8\n\n-- | Push the pandoc.log module on the Lua stack.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.log\"\n  `withDescription`\n      \"Access to pandoc's logging system.\"\n  `withFields` []\n  `withFunctions`\n      [ defun \"info\"\n        ### (\\msg -> do\n                -- reporting levels:\n                -- 0: this function,\n                -- 1: userdata wrapper function for the function,\n                -- 2: function calling warn.\n                pos <- luaSourcePos 2\n                unPandocLua $ report $ ScriptingInfo (UTF8.toText msg) pos)\n        <#> parameter peekByteString \"string\" \"message\" \"the info message\"\n        =#> []\n        #? \"Reports a ScriptingInfo message to pandoc's logging system.\"\n        `since` makeVersion [3, 2]\n\n      , defun \"silence\"\n        ### const silence\n        <#> parameter pure \"function\" \"fn\"\n              \"function to be silenced\"\n        =?> (\"List of log messages triggered during the function call, \" <>\n             \"and any value returned by the function.\")\n        #? T.unlines\n           [ \"Applies the function to the given arguments while\"\n           , \"preventing log messages from being added to the log.\"\n           , \"The warnings and info messages reported during the function\"\n           , \"call are returned as the first return value, with the\"\n           , \"results of the function call following thereafter.\"\n           ]\n        `since` makeVersion [3, 2]\n\n      , defun \"warn\"\n        ### (\\msg -> do\n                -- reporting levels:\n                -- 0: this function,\n                -- 1: userdata wrapper function for the function,\n                -- 2: function calling warn.\n                pos <- luaSourcePos 2\n                unPandocLua $ report $ ScriptingWarning (UTF8.toText msg) pos)\n        <#> parameter peekByteString \"string\" \"message\"\n              \"the warning message\"\n        =#> []\n        #? T.unlines\n           [ \"Reports a ScriptingWarning to pandoc's logging system.\"\n           , \"The warning will be printed to stderr unless logging\"\n           , \"verbosity has been set to *ERROR*.\"\n           ]\n        `since` makeVersion [3, 2]\n      ]\n\n-- | Calls the function given as the first argument, but suppresses logging.\n-- Returns the list of generated log messages as the first result, and the other\n-- results of the function call after that.\nsilence :: LuaE PandocError NumResults\nsilence = unPandocLua $ do\n  -- call function given as the first argument\n  ((), messages) <- runSilently . liftPandocLua $ do\n    nargs <- (NumArgs . subtract 1 . fromStackIndex) <$> gettop\n    call @PandocError nargs multret\n\n  liftPandocLua $ do\n    pushPandocList pushLogMessage messages\n    insert 1\n    (NumResults . fromStackIndex) <$> gettop\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/MediaBag.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.MediaBag\n   Copyright   : Copyright © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nThe Lua module @pandoc.mediabag@.\n-}\nmodule Text.Pandoc.Lua.Module.MediaBag\n  ( documentedModule\n  ) where\n\nimport Prelude hiding (lookup)\nimport Data.Maybe (fromMaybe)\nimport Data.Version (makeVersion)\nimport HsLua ( LuaE, DocumentedFunction, Module (..)\n             , (<#>), (###), (=#>), (=?>), (#?), defun, functionResult\n             , opt, parameter, since, stringParam, textParam)\nimport Text.Pandoc.Class ( fetchItem, fillMediaBag, getMediaBag, setMediaBag )\nimport Text.Pandoc.Class.IO (writeMedia)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.Pandoc (peekPandoc, pushPandoc)\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList)\nimport Text.Pandoc.Lua.Orphans ()\nimport Text.Pandoc.Lua.PandocLua (unPandocLua)\nimport Text.Pandoc.MIME (MimeType)\nimport Text.Pandoc.SelfContained (makeDataURI)\n\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport qualified HsLua as Lua\nimport qualified Text.Pandoc.MediaBag as MB\n\n--\n-- MediaBag submodule\n--\ndocumentedModule :: Module PandocError\ndocumentedModule = Lua.defmodule \"pandoc.mediabag\"\n  `Lua.withDescription` T.unlines\n    [ \"The `pandoc.mediabag` module allows accessing pandoc's media\"\n    , \"storage. The \\\"media bag\\\" is used when pandoc is called with the\"\n    , \"`--extract-media` or (for HTML only) `--embed-resources` option.\"\n    , \"\"\n    , \"The module is loaded as part of module `pandoc` and can either\"\n    , \"be accessed via the `pandoc.mediabag` field, or explicitly\"\n    , \"required, e.g.:\"\n    , \"\"\n    , \"    local mb = require 'pandoc.mediabag'\"\n    ]\n  `Lua.withFunctions`\n      [ delete  `since` makeVersion [2,7,3]\n      , empty   `since` makeVersion [2,7,3]\n      , fetch   `since` makeVersion [2,0]\n      , fill    `since` makeVersion [2,19]\n      , insert  `since` makeVersion [2,0]\n      , items   `since` makeVersion [2,7,3]\n      , list    `since` makeVersion [2,0]\n      , lookup  `since` makeVersion [2,0]\n      , make_data_uri `since` makeVersion [3,7,1]\n      , write   `since` makeVersion [3,0]\n      ]\n\n-- | Delete a single item from the media bag.\ndelete :: DocumentedFunction PandocError\ndelete = defun \"delete\"\n  ### (\\fp -> unPandocLua $ do\n          mb <- getMediaBag\n          setMediaBag $ MB.deleteMedia fp mb)\n  <#> stringParam \"filepath\"\n      (\"Filename of the item to deleted. The media bag will be \" <>\n       \"left unchanged if no entry with the given filename exists.\")\n  =#> []\n  #? \"Removes a single entry from the media bag.\"\n\n-- | Delete all items from the media bag.\nempty :: DocumentedFunction PandocError\nempty = defun \"empty\"\n  ### unPandocLua (setMediaBag mempty)\n  =#> []\n  #? \"Clear-out the media bag, deleting all items.\"\n\n-- | Fill the mediabag with all images in the document that aren't\n-- present yet.\nfill :: DocumentedFunction PandocError\nfill = defun \"fill\"\n  ### unPandocLua . fillMediaBag\n  <#> parameter peekPandoc \"Pandoc\" \"doc\"\n        \"document from which to fill the mediabag\"\n  =#> functionResult pushPandoc \"Pandoc\" \"modified document\"\n  #? (\"Fills the mediabag with the images in the given document.\\n\" <>\n      \"An image that cannot be retrieved will be replaced with a Span\\n\" <>\n      \"of class \\\"image\\\" that contains the image description.\\n\" <>\n      \"\\n\" <>\n      \"Images for which the mediabag already contains an item will\\n\" <>\n      \"not be processed again.\")\n\n-- | Insert a new item into the media bag.\ninsert :: DocumentedFunction PandocError\ninsert = defun \"insert\"\n  ### (\\fp mmime contents -> unPandocLua $ do\n          mb <- getMediaBag\n          setMediaBag $ MB.insertMedia fp mmime contents mb\n          return (Lua.NumResults 0))\n  <#> stringParam \"filepath\" \"filename and path relative to the output folder.\"\n  <#> parameter (Lua.peekNilOr Lua.peekText) \"string|nil\" \"mimetype\"\n        \"the item's MIME type; use `nil` if the MIME type is\\\n        \\ unknown or unavailable.\"\n  <#> parameter Lua.peekLazyByteString \"string\" \"contents\"\n        \"the binary contents of the file.\"\n  =#> []\n  #? T.unlines\n  [ \"Adds a new entry to pandoc's media bag. Replaces any existing\"\n  , \"media bag entry the same `filepath`.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    local fp = 'media/hello.txt'\"\n  , \"    local mt = 'text/plain'\"\n  , \"    local contents = 'Hello, World!'\"\n  , \"    pandoc.mediabag.insert(fp, mt, contents)\"\n  ]\n\n-- | Returns iterator values to be used with a Lua @for@ loop.\nitems :: DocumentedFunction PandocError\nitems = defun \"items\"\n  ### (do\n          mb <- unPandocLua getMediaBag\n          let pushItem (fp, mimetype, contents) = do\n                Lua.pushString fp\n                Lua.pushText mimetype\n                Lua.pushByteString $ BL.toStrict contents\n                return (Lua.NumResults 3)\n          Lua.pushIterator pushItem (MB.mediaItems mb))\n  =?> T.unlines\n  [ \"Iterator triple:\"\n  , \"\"\n  , \"-   The iterator function; must be called with the iterator\"\n  , \"    state and the current iterator value.\"\n  , \"-   Iterator state -- an opaque value to be passed to the\"\n  , \"    iterator function.\"\n  , \"-   Initial iterator value.\"\n  ]\n  #? T.unlines\n  [ \"Returns an iterator triple to be used with Lua's generic `for`\"\n  , \"statement. The iterator returns the filepath, MIME type, and\"\n  , \"content of a media bag item on each invocation. Items are\"\n  , \"processed one-by-one to avoid excessive memory use.\"\n  , \"\"\n  , \"This function should be used only when full access to all items,\"\n  , \"including their contents, is required. For all other cases,\"\n  , \"[`list`](#pandoc.mediabag.list) should be preferred.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    for fp, mt, contents in pandoc.mediabag.items() do\"\n  , \"      -- print(fp, mt, contents)\"\n  , \"    end\"\n  ]\n\n-- | Function to lookup a value in the mediabag.\nlookup :: DocumentedFunction PandocError\nlookup = defun \"lookup\"\n  ### (\\fp -> unPandocLua (MB.lookupMedia fp <$> getMediaBag))\n  <#> stringParam \"filepath\" \"name of the file to look up.\"\n  =#> mconcat\n      [ functionResult\n          (maybe Lua.pushnil (Lua.pushText . MB.mediaMimeType))\n          \"string\"\n          \"The entry's MIME type, or nil if the file was not found.\"\n      , functionResult\n          (maybe Lua.pushnil (Lua.pushLazyByteString . MB.mediaContents))\n          \"string\"\n          \"Contents of the file, or nil if the file was not found.\"\n      ]\n  #? T.unlines\n  [ \"Lookup a media item in the media bag, and return its MIME type\"\n  , \"and contents.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    local filename = 'media/diagram.png'\"\n  , \"    local mt, contents = pandoc.mediabag.lookup(filename)\"\n  ]\n\n-- | Function listing all mediabag items.\nlist :: DocumentedFunction PandocError\nlist = defun \"list\"\n  ### (unPandocLua (MB.mediaDirectory <$> getMediaBag))\n  =#> functionResult (pushPandocList pushEntry) \"table\"\n        (\"A list of elements summarizing each entry in the media\\n\" <>\n         \"bag. The summary item contains the keys `path`, `type`, and\\n\" <>\n         \"`length`, giving the filepath, MIME type, and length of\\n\" <>\n         \"contents in bytes, respectively.\")\n  #? T.unlines\n  [ \"Get a summary of the current media bag contents.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    -- calculate the size of the media bag.\"\n  , \"    local mb_items = pandoc.mediabag.list()\"\n  , \"    local sum = 0\"\n  , \"    for i = 1, #mb_items do\"\n  , \"        sum = sum + mb_items[i].length\"\n  , \"    end\"\n  , \"    print(sum)\"\n  ]\n where\n  pushEntry :: (FilePath, MimeType, Int) -> LuaE PandocError ()\n  pushEntry (fp, mimeType, contentLength) = do\n    Lua.newtable\n    Lua.pushName \"path\"   *> Lua.pushString fp              *> Lua.rawset (-3)\n    Lua.pushName \"type\"   *> Lua.pushText mimeType          *> Lua.rawset (-3)\n    Lua.pushName \"length\" *> Lua.pushIntegral contentLength *> Lua.rawset (-3)\n\n-- | Lua function to retrieve a new item.\nfetch :: DocumentedFunction PandocError\nfetch = defun \"fetch\"\n  ### (unPandocLua . fetchItem)\n  <#> textParam \"source\" \"path to a resource; either a local file path or URI\"\n  =#> ( functionResult (Lua.pushText . fromMaybe \"\" . snd) \"string\"\n        \"The entry's MIME type, or `nil` if the file was not found.\"\n        <>\n        functionResult (Lua.pushByteString . fst) \"string\"\n        \"Contents of the file, or `nil` if the file was not found.\"\n      )\n  #? T.unlines\n  [ \"Fetches the given source from a URL or local file. Returns two\"\n  , \"values: the contents of the file and the MIME type (or an empty\"\n  , \"string).\"\n  , \"\"\n  , \"The function will first try to retrieve `source` from the\"\n  , \"mediabag; if that fails, it will try to download it or read it\"\n  , \"from the local file system while respecting pandoc's \\\"resource\"\n  , \"path\\\" setting.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    local diagram_url = 'https://pandoc.org/diagram.jpg'\"\n  , \"    local mt, contents = pandoc.mediabag.fetch(diagram_url)\"\n  ]\n\nmake_data_uri :: DocumentedFunction PandocError\nmake_data_uri = defun \"make_data_uri\"\n  ### (\\mime raw -> pure $ makeDataURI (mime, raw))\n  <#> parameter Lua.peekText \"string\" \"mime_type\" \"MIME type of the data\"\n  <#> parameter Lua.peekByteString \"string\" \"raw_data\" \"data to encode\"\n  =#> functionResult Lua.pushText \"string\" \"data uri\"\n  #? T.unlines\n  [ \"Convert the input data into a data URI as defined by RFC 2397.\"\n  , \"\"\n  , \"Example:\"\n  , \"\"\n  , \"    -- Embed an unofficial pandoc logo\"\n  , \"    local pandoc_logo_url = 'https://raw.githubusercontent.com/'\"\n  , \"      .. 'tarleb/pandoc-logo/main/pandoc.svg'\"\n  , \"\"\n  , \"    local datauri = pandoc.mediabag.make_data_uri(\"\n  , \"      pandoc.mediabag.fetch(pandoc_logo_url)\"\n  , \"    )\"\n  , \"\"\n  , \"    local image = pandoc.Image('Logo', datauri)\"\n  ]\n\n\n-- | Extract the mediabag or just a single entry.\nwrite :: DocumentedFunction PandocError\nwrite = defun \"write\"\n  ### (\\dir mfp -> do\n          mb <- unPandocLua getMediaBag\n          case mfp of\n            Nothing -> unPandocLua $ mapM_ (writeMedia dir) (MB.mediaItems mb)\n            Just fp -> do\n              case MB.lookupMedia fp mb of\n                Nothing   -> Lua.failLua (\"Resource not in mediabag: \" <> fp)\n                Just item -> unPandocLua $ do\n                  let triple = ( MB.mediaPath item\n                               , MB.mediaMimeType item\n                               , MB.mediaContents item\n                               )\n                  writeMedia dir triple)\n  <#> stringParam \"dir\" \"path of the target directory\"\n  <#> opt (stringParam \"fp\" \"canonical name (relative path) of resource\")\n  =#> []\n  #? T.unlines\n     [ \"Writes the contents of  mediabag to the given target directory. If\"\n     , \"`fp` is given, then only the resource with the given name will be\"\n     , \"extracted. Omitting that parameter means that the whole mediabag\"\n     , \"gets extracted. An error is thrown if `fp` is given but cannot be\"\n     , \"found in the mediabag.\"\n     ]\n  `since` makeVersion [3, 0]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Pandoc.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications  #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Pandoc\n   Copyright   : Copyright © 2017-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nMain @pandoc@ module, containing element constructors and central functions.\n-}\nmodule Text.Pandoc.Lua.Module.Pandoc\n  ( documentedModule\n  ) where\n\nimport Prelude hiding (read)\nimport Control.Applicative ((<|>))\nimport Control.Monad (foldM, forM_, when)\nimport Control.Monad.Catch (catch, handle, throwM)\nimport Control.Monad.Except (MonadError (throwError))\nimport Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr)\nimport Data.Default (Default (..))\nimport Data.Maybe (fromMaybe)\nimport Data.Proxy (Proxy (Proxy))\nimport Data.Text.Encoding.Error (UnicodeException)\nimport Data.Version (makeVersion)\nimport HsLua\nimport System.Exit (ExitCode (..))\nimport Text.Pandoc.Class ( PandocMonad, FileInfo (..), FileTree\n                         , addToFileTree, getCurrentTime\n                         , getRequestHeaders, getResourcePath, getUserDataDir\n                         , setRequestHeaders, setResourcePath, setUserDataDir\n                         , insertInFileTree, sandboxWithFileTree\n                         )\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Format (FlavoredFormat, parseFlavoredFormat)\nimport Text.Pandoc.Lua.Orphans ()\nimport Text.Pandoc.Lua.Marshal.AST\nimport Text.Pandoc.Lua.Marshal.Format (peekFlavoredFormat)\nimport Text.Pandoc.Lua.Marshal.Filter (peekFilter)\nimport Text.Pandoc.Lua.Marshal.ReaderOptions ( peekReaderOptions\n                                             , pushReaderOptions)\nimport Text.Pandoc.Lua.Marshal.Sources (peekSources)\nimport Text.Pandoc.Lua.Marshal.WriterOptions ( peekWriterOptions\n                                             , pushWriterOptions)\nimport Text.Pandoc.Lua.Module.Utils (sha1)\nimport Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua))\nimport Text.Pandoc.Lua.Writer.Classic (runCustom)\nimport Text.Pandoc.Options ( ReaderOptions (readerExtensions)\n                           , WriterOptions (writerExtensions) )\nimport Text.Pandoc.Process (pipeProcess)\nimport Text.Pandoc.Readers (Reader (..), getReader, readers)\nimport Text.Pandoc.Sources (toSources)\nimport Text.Pandoc.Writers (Writer (..), getWriter, writers)\n\nimport qualified HsLua as Lua\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.ByteString.Lazy.Char8 as BSL\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.UTF8 as UTF8\n\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc\"\n  `withDescription` T.unlines\n    [ \"Fields and functions for pandoc scripts; includes constructors for\"\n    , \"document tree elements, functions to parse text in a given\"\n    , \"format, and functions to filter and modify a subtree.\"\n    ]\n  `withFields` readersField : writersField :\n                   stringConstants ++ [inlineField, blockField]\n  `withFunctions` mconcat\n      [ [mkPandoc, mkMeta]\n      , metaValueConstructors\n      , blockConstructors\n      , [mkBlocks]\n      , inlineConstructors\n      , [mkInlines]\n      , otherConstructors\n      , functions\n      ]\n  `associateType` typePandoc\n  `associateType` typeBlock\n  `associateType` typeInline\n\n-- | Set of input formats accepted by @read@.\nreadersField :: Field PandocError\nreadersField = deffield \"readers\"\n  `withType` \"table\"\n  `withDescription` T.unlines\n    [ \"Set of formats that pandoc can parse. All keys in this table can\"\n    , \"be used as the `format` value in `pandoc.read`.\"\n    ]\n  `withValue` pushKeyValuePairs pushText (pushText . readerType)\n                     (readers @PandocLua)\n where\n  readerType = \\case\n    TextReader {} -> \"text\"\n    ByteStringReader {} -> \"bytestring\"\n\n-- | Set of input formats accepted by @write@.\nwritersField :: Field PandocError\nwritersField = deffield \"writers\"\n  `withType` \"table\"\n  `withDescription` T.unlines\n    [ \"Set of formats that pandoc can generate. All keys in this table\"\n    , \"can be used as the `format` value in `pandoc.write`.\"\n    ]\n  `withValue` pushKeyValuePairs pushText (pushText . writerType)\n                     (writers @PandocLua)\n where\n  writerType = \\case\n    TextWriter {} -> \"text\"\n    ByteStringWriter {} -> \"bytestring\"\n\n-- | Inline table field\ninlineField :: Field PandocError\ninlineField = deffield \"Inline\"\n  `withType` \"table\"\n  `withDescription` \"Inline constructors, nested under 'constructors'.\"\n  -- the nesting happens for historical reasons and should probably be\n  -- changed.\n  `withValue` pushWithConstructorsSubtable inlineConstructors\n\n-- | @Block@ module field\nblockField :: Field PandocError\nblockField = deffield \"Block\"\n  `withType` \"table\"\n  `withDescription` \"Inline constructors, nested under 'constructors'.\"\n  -- the nesting happens for historical reasons and should probably be\n  -- changed.\n  `withValue` pushWithConstructorsSubtable blockConstructors\n\npushWithConstructorsSubtable :: [DocumentedFunction PandocError]\n                             -> LuaE PandocError ()\npushWithConstructorsSubtable constructors = do\n  newtable -- Field table\n  newtable -- constructor table\n  pushName \"constructor\" *> pushvalue (nth 2) *> rawset (nth 4)\n  forM_ constructors $ \\fn -> do\n    pushName (functionName fn)\n    pushDocumentedFunction fn\n    rawset (nth 3)\n  pop 1 -- pop constructor table\n\notherConstructors :: [DocumentedFunction PandocError]\notherConstructors =\n  [ mkAttr\n  , mkCaption `since` makeVersion [3,6,1]\n  , mkCell\n  , mkAttributeList\n  , mkCitation\n  , mkListAttributes\n  , mkRow\n  , mkTableFoot\n  , mkTableHead\n  , mkSimpleTable\n\n  , defun \"ReaderOptions\"\n    ### liftPure id\n    <#> parameter peekReaderOptions \"ReaderOptions|table\" \"opts\"\n        (T.unlines\n         [ \"Either a table with a subset of the properties of a\"\n         , \"[[ReaderOptions]] object, or another ReaderOptions object.\"\n         , \"Uses the defaults specified in the manual for all\"\n         , \"properties that are not explicitly specified. Throws an\"\n         , \"error if a table contains properties which are not present\"\n         , \"in a ReaderOptions object.\"\n        ]\n        )\n    =#> functionResult pushReaderOptions \"ReaderOptions\" \"new object\"\n    #? T.unlines\n    [ \"Creates a new ReaderOptions value.\"\n    , \"\"\n    , \"Usage:\"\n    , \"\"\n    , \"    -- copy of the reader options that were defined on the command line.\"\n    , \"    local cli_opts = pandoc.ReaderOptions(PANDOC_READER_OPTIONS)\"\n    , \"    -- default reader options, but columns set to 66.\"\n    , \"    local short_colums_opts = pandoc.ReaderOptions {columns = 66}\"\n    ]\n\n  , defun \"WriterOptions\"\n    ### liftPure id\n    <#> parameter peekWriterOptions \"WriterOptions|table\" \"opts\"\n        (T.unlines\n        [ \"Either a table with a subset of the properties of a\"\n        , \"[[WriterOptions]] object, or another WriterOptions object.\"\n        , \"Uses the defaults specified in the manual for all\"\n        , \"properties that are not explicitly specified. Throws an\"\n        , \"error if a table contains properties which are not present\"\n        , \"in a WriterOptions object.\"\n        ])\n    =#> functionResult pushWriterOptions \"WriterOptions\" \"new object\"\n    #? \"Creates a new WriterOptions value.\"\n  ]\n\nstringConstants :: [Field e]\nstringConstants =\n  let constrs :: forall a. Data a => Proxy a -> [String]\n      constrs _ = map showConstr . dataTypeConstrs . dataTypeOf @a $ undefined\n      nullaryConstructors = mconcat\n        [ constrs (Proxy @ListNumberStyle)\n        , constrs (Proxy @ListNumberDelim)\n        , constrs (Proxy @QuoteType)\n        , constrs (Proxy @MathType)\n        , constrs (Proxy @Alignment)\n        , constrs (Proxy @CitationMode)\n        ]\n      toField s = deffield (Name $ UTF8.fromString s)\n        `withType` \"string\"\n        `withDescription` T.pack s\n        `withValue` pushString s\n  in map toField nullaryConstructors\n\nfunctions :: [DocumentedFunction PandocError]\nfunctions =\n  [ defun \"pipe\"\n    ### (\\command args input -> do\n            (ec, output) <- Lua.liftIO $ pipeProcess Nothing command args input\n                            `catch` (throwM . PandocIOError \"pipe\")\n            case ec of\n              ExitSuccess -> 1 <$ Lua.pushLazyByteString output\n              ExitFailure n -> do\n                pushPipeError (PipeError (T.pack command) n output)\n                Lua.error)\n    <#> parameter peekString \"string\" \"command\" \"path to executable\"\n    <#> parameter (peekList peekString) \"{string,...}\" \"args\"\n          \"list of arguments\"\n    <#> parameter peekLazyByteString \"string\" \"input\"\n          \"input passed to process via stdin\"\n    =?> \"output string, or error triple\"\n\n  , defun \"read\"\n    ### (\\content mformatspec mreaderOptions mreadEnv -> do\n            let readerOpts = fromMaybe def mreaderOptions\n\n                readAction :: PandocMonad m => FlavoredFormat -> m Pandoc\n                readAction flvrd = getReader flvrd >>= \\case\n                  (TextReader r, es)       ->\n                    r readerOpts{readerExtensions = es} $\n                    case content of\n                      Left bs       -> toSources $ UTF8.toText bs\n                      Right sources -> sources\n                  (ByteStringReader r, es) ->\n                    case content of\n                      Left bs -> r readerOpts{readerExtensions = es}\n                                 (BSL.fromStrict bs)\n                      Right _ -> throwError $ PandocLuaError\n                                 \"Cannot use bytestring reader with Sources\"\n\n            handle (failLua . show @UnicodeException) . unPandocLua $ do\n              flvrd <- maybe (parseFlavoredFormat \"markdown\") pure mformatspec\n              case mreadEnv of\n                Nothing   -> readAction flvrd\n                Just tree -> sandboxWithFileTree tree (readAction flvrd))\n    <#> parameter (\\idx -> (Left  <$> peekByteString idx)\n                       <|> (Right <$> peekSources idx))\n          \"string|Sources\" \"content\" \"text to parse\"\n    <#> opt (parameter peekFlavoredFormat \"string|table\"\n                       \"formatspec\" \"format and extensions\")\n    <#> opt (parameter peekReaderOptions \"ReaderOptions\" \"reader_options\"\n             \"reader options\")\n    <#> opt (parameter peekReadEnv \"table\" \"read_env\" $ T.unlines\n            [ \"If the value is not given or `nil`, then the global environment\"\n            , \"is used. Passing a list of filenames causes the reader to\"\n            , \"be run in a sandbox. The given files are read from the file\"\n            , \"system and provided to the sandbox via an ersatz file system.\"\n            , \"The table can also contain mappings from filenames to\"\n            , \"contents, which will be used to populate the ersatz file\"\n            , \"system.\"\n            ])\n    =#> functionResult pushPandoc \"Pandoc\" \"result document\"\n\n  , sha1\n\n  , defun \"walk_block\"\n    ### walkElement\n    <#> parameter peekBlockFuzzy \"Block\" \"block\" \"element to traverse\"\n    <#> parameter peekFilter \"Filter\" \"lua_filter\" \"filter functions\"\n    =#> functionResult pushBlock \"Block\" \"modified Block\"\n\n  , defun \"walk_inline\"\n    ### walkElement\n    <#> parameter peekInlineFuzzy \"Inline\" \"inline\" \"element to traverse\"\n    <#> parameter peekFilter \"Filter\" \"lua_filter\" \"filter functions\"\n    =#> functionResult pushInline \"Inline\" \"modified Inline\"\n\n  , defun \"with_state\"\n    ### with_state\n    <#> parameter peekStateOptions \"table\" \"options\" \"state options\"\n    <#> parameter pure \"function\" \"callback\"\n          \"The action to run with the given state.\"\n    =?> \"The results of the call to *callback*.\"\n    #? \"Runs a function with a modified pandoc state.\\n\\\n       \\\\n\\\n       \\The given callback is invoked after setting the pandoc state to the\\\n       \\ given values. The modifiable options are restored to their original\\\n       \\ values once the callback has returned.\\n\\\n       \\\\n\\\n       \\The following state variables can be controlled:\\n\\\n       \\\\n\\\n       \\  - `request_headers` (list of key-value tuples)\\n\\\n       \\  - `resource_path` (list of filepaths)\\n\\\n       \\  - `user_data_dir` (string)\\n\\\n       \\\\n\\\n       \\Other options are ignored, and the rest of the state is not modified.\\n\\\n       \\\\n\\\n       \\Usage:\\n\\\n       \\\\n\\\n       \\    local opts = {\\n\\\n       \\      request_headers = {\\n\\\n       \\        {'Authorization', 'Basic my-secret'}\\n\\\n       \\      }\\n\\\n       \\    }\\n\\\n       \\    pandoc.with_state(opts, function ()\\n\\\n       \\      local mime, contents = pandoc.mediabag.fetch(image_url)\\n\\\n       \\    )\\n\"\n\n  , defun \"write\"\n    ### (\\doc mformatspec mwriterOpts -> unPandocLua $ do\n            flvrd <- maybe (parseFlavoredFormat \"markdown\") pure mformatspec\n            let writerOpts = fromMaybe def mwriterOpts\n            getWriter flvrd >>= \\case\n              (TextWriter w, es)      -> Right <$>\n                w writerOpts{ writerExtensions = es } doc\n              (ByteStringWriter w, es) -> Left <$>\n                w writerOpts{ writerExtensions = es } doc)\n    <#> parameter peekPandoc \"Pandoc\" \"doc\" \"document to convert\"\n    <#> opt (parameter peekFlavoredFormat \"string|table\" \"formatspec\"\n             (T.unlines\n              [ \"format specification; defaults to `\\\"html\\\"`. See the\"\n              , \"documentation of [`pandoc.read`](#pandoc.read) for a complete\"\n              , \"description of this parameter.\"\n              ]))\n    <#> opt (parameter peekWriterOptions \"WriterOptions|table\" \"writer_options\"\n            (T.unlines\n            [ \"options passed to the writer; may be a WriterOptions object\"\n            , \"or a table with a subset of the keys and values of a\"\n            , \"WriterOptions object; defaults to the default values\"\n            , \"documented in the manual.\"\n            ])\n            )\n    =#> functionResult (either pushLazyByteString pushText) \"string\"\n          \"result document\"\n    #? T.unlines\n    [ \"Converts a document to the given target format.\"\n    , \"\"\n    , \"Usage:\"\n    , \"\"\n    , \"    local doc = pandoc.Pandoc(\"\n    , \"      {pandoc.Para {pandoc.Strong 'Tea'}}\"\n    , \"    )\"\n    , \"    local html = pandoc.write(doc, 'html')\"\n    , \"    assert(html == '<p><strong>Tea</strong></p>')\"\n    ]\n\n  , defun \"write_classic\"\n    ### (\\doc mwopts -> runCustom (fromMaybe def mwopts) doc)\n    <#> parameter peekPandoc \"Pandoc\" \"doc\" \"document to convert\"\n    <#> opt (parameter peekWriterOptions \"WriterOptions\" \"writer_options\"\n             (T.unlines\n              [ \"options passed to the writer; may be a WriterOptions object\"\n              , \"or a table with a subset of the keys and values of a\"\n              , \"WriterOptions object; defaults to the default values\"\n              , \"documented in the manual.\"\n              ]))\n    =#> functionResult pushText \"string\" \"rendered document\"\n    #? (T.unlines\n       [ \"Runs a classic custom Lua writer, using the functions defined\"\n       , \"in the current environment.\"\n       , \"\"\n       , \"Usage:\"\n       , \"\"\n       , \"    -- Adding this function converts a classic writer into a\"\n       , \"    -- new-style custom writer.\"\n       , \"    function Writer (doc, opts)\"\n       , \"      PANDOC_DOCUMENT = doc\"\n       , \"      PANDOC_WRITER_OPTIONS = opts\"\n       , \"      loadfile(PANDOC_SCRIPT_FILE)()\"\n       , \"      return pandoc.write_classic(doc, opts)\"\n       , \"    end\"\n       ])\n  ]\n where\n  walkElement x f =\n        walkInlineSplicing f x\n    >>= walkInlinesStraight f\n    >>= walkBlockSplicing f\n    >>= walkBlocksStraight f\n\ndata PipeError = PipeError\n  { pipeErrorCommand :: T.Text\n  , pipeErrorCode :: Int\n  , pipeErrorOutput :: BL.ByteString\n  }\n\npeekPipeError :: LuaError e => StackIndex -> LuaE e PipeError\npeekPipeError idx =\n  PipeError\n  <$> (Lua.getfield idx \"command\"    *> Lua.peek (-1) <* Lua.pop 1)\n  <*> (Lua.getfield idx \"error_code\" *> Lua.peek (-1) <* Lua.pop 1)\n  <*> (Lua.getfield idx \"output\"     *> Lua.peek (-1) <* Lua.pop 1)\n\npushPipeError :: LuaError e => Pusher e PipeError\npushPipeError pipeErr = do\n  pushAsTable [ (\"command\"    , pushText . pipeErrorCommand)\n              , (\"error_code\" , pushIntegral . pipeErrorCode)\n              , (\"output\"     , pushLazyByteString . pipeErrorOutput)\n              ] pipeErr\n  pushPipeErrorMetaTable\n  Lua.setmetatable (nth 2)\n    where\n      pushPipeErrorMetaTable :: LuaError e => LuaE e ()\n      pushPipeErrorMetaTable = do\n        v <- Lua.newmetatable \"pandoc pipe error\"\n        when v $ do\n          pushName \"__tostring\"\n          pushHaskellFunction pipeErrorMessage\n          rawset (nth 3)\n\n      pipeErrorMessage :: LuaError e => LuaE e NumResults\n      pipeErrorMessage = do\n        (PipeError cmd errorCode output) <- peekPipeError (nthBottom 1)\n        pushByteString . BSL.toStrict . BSL.concat $\n          [ BSL.pack \"Error running \"\n          , BSL.pack $ T.unpack cmd\n          , BSL.pack \" (error code \"\n          , BSL.pack $ show errorCode\n          , BSL.pack \"): \"\n          , if output == mempty then BSL.pack \"<no output>\" else output\n          ]\n        return (NumResults 1)\n\n-- | Peek the environment in which the `read` function operates.\npeekReadEnv :: Peeker PandocError FileTree\npeekReadEnv idx = do\n  mtime <- liftLua . unPandocLua $ getCurrentTime\n\n  -- Add files from file system\n  files <- peekList peekString idx\n  tree1 <- liftLua $\n           foldM (\\tree fp -> liftIO $ addToFileTree tree fp) mempty files\n\n  -- Add files from key-value pairs\n  let toFileInfo contents = FileInfo\n        { infoFileMTime = mtime\n        , infoFileContents = contents\n        }\n  pairs <- peekKeyValuePairs peekString (fmap toFileInfo . peekByteString) idx\n  let tree2 = foldr (uncurry insertInFileTree) tree1 pairs\n\n  -- Return ersatz file system.\n  pure tree2\n\n-- | Helper type that holds all common state values that can be controlled.\n--\n-- This is closely related to \"CommonState\", but that's an opaque value\n-- that can only be read and modified through accessor functions. All\n-- fields in this type can be modified through accessors.\ndata StateOptions = StateOptions\n  { stateOptsRequestHeaders :: [(T.Text, T.Text)]\n  , stateOptsResourcePath :: [String]\n  , stateOptsUserDataDir :: Maybe String\n  }\n\n-- | Peek pandoc state options; the current state properties are used for\n-- unspecified values.\npeekStateOptions :: Peeker PandocError StateOptions\npeekStateOptions idx = do\n  absidx <- liftLua $ absindex idx\n  let setOptions opts = do\n        liftLua (next absidx) >>= \\case\n          False -> return opts\n          True -> do\n            key <- peekByteString (nth 2)\n            case key of\n              \"request_headers\" -> do\n                let peekHeaderPair = peekPair peekText peekText\n                value <- peekList peekHeaderPair top `lastly` pop 1\n                setOptions $ opts { stateOptsRequestHeaders = value }\n              \"resource_path\" -> do\n                value <- peekList peekString top `lastly` pop 1\n                setOptions $ opts { stateOptsResourcePath = value }\n              \"user_data_dir\" -> do\n                value <- peekNilOr peekString top `lastly` pop 1\n                setOptions $ opts { stateOptsUserDataDir = value }\n              _ -> do\n                liftLua $ pop 2 -- remove key and value\n                failPeek $ \"Unknown or unsupported state option: \" <> key\n\n  liftLua pushnil -- first \"key\"\n  liftLua getStateOptions >>= setOptions\n\n-- | Get the current options values from the pandoc state.\ngetStateOptions :: LuaE PandocError StateOptions\ngetStateOptions = unPandocLua $ StateOptions\n  <$> getRequestHeaders\n  <*> getResourcePath\n  <*> getUserDataDir\n\n-- | Update the pandoc state with the new options.\nsetStateOptions :: StateOptions -> LuaE PandocError ()\nsetStateOptions opts = unPandocLua $ do\n  setRequestHeaders $ stateOptsRequestHeaders opts\n  setResourcePath $ stateOptsResourcePath opts\n  setUserDataDir $ stateOptsUserDataDir opts\n\n-- | Run a callback with a modified pandoc state.\nwith_state :: StateOptions -> StackIndex -> LuaE PandocError NumResults\nwith_state options callback_idx = do\n  origState <- getStateOptions\n  setStateOptions options\n  -- Invoke the callback\n  oldTop <- gettop\n  pushvalue callback_idx\n  call 0 multret\n  newTop <- gettop\n  setStateOptions origState\n  return . NumResults . fromStackIndex $ newTop - oldTop\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Path.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Path\n   Copyright   : © 2019-2026 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nPandoc's system Lua module.\n-}\nmodule Text.Pandoc.Lua.Module.Path\n  ( documentedModule\n  ) where\n\nimport Data.Version (makeVersion)\nimport HsLua\nimport qualified HsLua.Module.Path   as MPath\nimport qualified HsLua.Module.System as MSystem\n\n-- | Push the pandoc.system module on the Lua stack.\ndocumentedModule :: forall e. LuaError e => Module e\ndocumentedModule = defmodule \"pandoc.path\"\n  `withDescription` moduleDescription @e MPath.documentedModule\n  `withFields`\n      [ MPath.separator\n      , MPath.search_path_separator\n      ]\n  `withFunctions`\n      [ MPath.directory              `since` v[2,12]\n      , MSystem.exists               `since` v[3,7,1]\n      , MPath.filename               `since` v[2,12]\n      , MPath.is_absolute            `since` v[2,12]\n      , MPath.is_relative            `since` v[2,12]\n      , MPath.join                   `since` v[2,12]\n      , MPath.make_relative          `since` v[2,12]\n      , MPath.normalize              `since` v[2,12]\n      , MPath.split                  `since` v[2,12]\n      , MPath.split_extension        `since` v[2,12]\n      , MPath.split_search_path      `since` v[2,12]\n      , MPath.treat_strings_as_paths `since` v[2,12]\n      ]\n where\n  v = makeVersion\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Scaffolding.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Scaffolding\n   Copyright   : Copyright © 2022-2026 Albert Krewinkel, John MacFarlane\n   License     : GNU GPL, version 2 or above\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nScaffolding for custom Writers.\n-}\nmodule Text.Pandoc.Lua.Module.Scaffolding\n  ( documentedModule\n  ) where\n\nimport HsLua\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Writer.Scaffolding (pushWriterScaffolding)\nimport qualified Data.Text as T\n\n-- | The \"pandoc.template\" module.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.scaffolding\"\n  `withDescription` \"Scaffolding for custom writers.\"\n  `withFields` [writerScaffolding]\n\n-- | Template module functions.\nwriterScaffolding :: Field PandocError\nwriterScaffolding = deffield \"Writer\"\n  `withType` \"table\"\n  `withDescription` T.unlines\n    [ \"An object to be used as a `Writer` function; the construct handles\"\n    , \"most of the boilerplate, expecting only render functions for all\"\n    , \"AST elements\"\n    ]\n  `withValue` do\n      pushWriterScaffolding\n      -- pretend that it's a submodule so we get better error messages\n      getfield registryindex loaded\n      pushvalue (nth 2)\n      setfield (nth 2) (submod \"Writer\")\n      -- same for fields \"Block\" and \"Inline\"\n      getfield (nth 2) \"Inline\" *> setfield (nth 2) (submod \"Writer.Inline\")\n      getfield (nth 2) \"Block\" *> setfield (nth 2) (submod \"Writer.Block\")\n\n      pop 1 -- remove \"LOADED_TABLE\"\n where submod x = moduleName documentedModule <> \".\" <> x\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Structure.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Structure\n   Copyright   : © 2023-2026 Albert Krewinkel <albert+pandoc@tarleb.com>\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nCommand line helpers\n-}\nmodule Text.Pandoc.Lua.Module.Structure\n  ( documentedModule\n  ) where\n\nimport Control.Applicative ((<|>), optional)\nimport Data.Default (Default (..))\nimport Data.Maybe (fromMaybe)\nimport Data.Version (makeVersion)\nimport HsLua ( DocumentedFunction, LuaError, Module (..), Peeker\n             , (###), (<#>), (=#>), (#?), defmodule\n             , defun, functionResult, getfield, isnil, lastly, liftLua\n             , opt, liftPure, parameter , peekBool, peekIntegral\n             , peekFieldRaw, peekSet, peekText, pop, pushIntegral\n             , pushText, since, top, withDescription, withFunctions )\nimport Text.Pandoc.Chunks ( ChunkedDoc (..), PathTemplate (..)\n                          , tocToList, splitIntoChunks )\nimport Text.Pandoc.Definition (Pandoc (..), Block)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.PandocLua ()\nimport Text.Pandoc.Lua.Marshal.AST ( peekBlocksFuzzy, peekInlinesFuzzy\n                                   , peekPandoc, pushBlock, pushBlocks )\nimport Text.Pandoc.Lua.Marshal.Chunks\nimport Text.Pandoc.Lua.Marshal.Format (peekExtensions)\nimport Text.Pandoc.Lua.Marshal.WriterOptions ( peekWriterOptions )\nimport Text.Pandoc.Options (WriterOptions (writerTOCDepth,\n                                           writerNumberSections))\nimport Text.Pandoc.Slides (getSlideLevel, prepSlides)\nimport Text.Pandoc.Writers.Shared (toTableOfContents)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Shared as Shared\n\n-- | Push the pandoc.structure module on the Lua stack.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.structure\"\n  `withDescription`\n    \"Access to the higher-level document structure, including \" <>\n    \"hierarchical sections and the table of contents.\"\n  `withFunctions`\n      [ make_sections     `since` makeVersion [3,0]\n      , slide_level       `since` makeVersion [3,0]\n      , split_into_chunks `since` makeVersion [3,0]\n      , table_of_contents `since` makeVersion [3,0]\n      , unique_identifier `since` makeVersion [3,8]\n      ]\n\nmake_sections :: LuaError e => DocumentedFunction e\nmake_sections = defun \"make_sections\"\n  ### (\\blks mopts ->\n         let (numSects, baseLevel, mslideLevel) =\n               fromMaybe (defNumSec, Nothing, Nothing) mopts\n             blks' = case mslideLevel of\n                       Just l | l <= 0 -> prepSlides (getSlideLevel blks) blks\n                       Just sl -> prepSlides sl blks\n                       Nothing -> blks\n         in pure $ Shared.makeSections numSects baseLevel blks')\n  <#> parameter peekBodyBlocks \"Blocks|Pandoc\" \"blocks\"\n        \"document blocks to process\"\n  <#> opt (parameter peekOpts \"table\" \"opts\" \"options\")\n  =#> functionResult pushBlocks \"Blocks\"\n        \"processed blocks\"\n  #? T.unlines\n     [ \"Puts [[Blocks]] into a hierarchical structure: a list of sections\"\n     , \"(each a Div with class \\\"section\\\" and first element a Header).\"\n     , \"\"\n     , \"The optional `opts` argument can be a table; two settings are\"\n     , \"recognized: If `number_sections` is true, a `number` attribute\"\n     , \"containing the section number will be added to each `Header`. If\"\n     , \"`base_level` is an integer, then `Header` levels will be\"\n     , \"reorganized so that there are no gaps, with numbering levels\"\n     , \"shifted by the given value. Finally, an integer `slide_level`\"\n     , \"value triggers the creation of slides at that heading level.\"\n     , \"\"\n     , \"Note that a [[WriterOptions]] object can be passed as the opts\"\n     , \"table; this will set the `number_section` and `slide_level` values\"\n     , \"to those defined on the command line.\"\n     , \"\"\n     , \"Usage:\"\n     , \"\"\n     , \"    local blocks = {\"\n     , \"      pandoc.Header(2, pandoc.Str 'first'),\"\n     , \"      pandoc.Header(2, pandoc.Str 'second'),\"\n     , \"    }\"\n     , \"    local opts = PANDOC_WRITER_OPTIONS\"\n     , \"    local newblocks = pandoc.structure.make_sections(blocks, opts)\"\n     ]\n  where\n    defNumSec = False\n    peekOpts idx = do\n      numberSections <- fromMaybe defNumSec <$> do\n        liftLua $ getfield idx \"number_sections\"\n        optional (peekBool top `lastly` pop 1)\n      baseLevel <- do\n        liftLua $ getfield idx \"base_level\"\n        optional (peekIntegral top `lastly` pop 1)\n      slideLevel <- do\n        liftLua $ getfield idx \"slide_level\"\n        optional (peekIntegral top `lastly` pop 1)\n      return (numberSections, baseLevel, slideLevel)\n\nslide_level :: LuaError e => DocumentedFunction e\nslide_level = defun \"slide_level\"\n  ### liftPure getSlideLevel\n  <#> parameter peekBodyBlocks \"Blocks|Pandoc\" \"blocks\" \"document body\"\n  =#> functionResult pushIntegral \"integer\" \"slide level\"\n  #? T.unlines\n  [ \"Find level of header that starts slides (defined as the least\"\n  , \"header level that occurs before a non-header/non-hrule in the\"\n  , \"blocks).\"\n  ]\n\n-- | Split 'Pandoc' into 'Chunk's.\nsplit_into_chunks :: LuaError e => DocumentedFunction e\nsplit_into_chunks = defun \"split_into_chunks\"\n  ### (\\doc mopts -> pure $\n          let defOpts = (defPathTmpl, defNumSects, Nothing, defLvl)\n              (pathTempl, numberSect, mbBaseLevel, chunkLevel) =\n                fromMaybe defOpts mopts\n          in splitIntoChunks pathTempl numberSect mbBaseLevel chunkLevel doc)\n  <#> parameter peekPandoc \"Pandoc\" \"doc\" \"document to split\"\n  <#> opt (parameter peekSplitOpts \"table\" \"opts\" optionsDescr)\n  =#> functionResult pushChunkedDoc \"ChunkedDoc\" \"\"\n  #? T.unlines\n     [ \"Converts a [[Pandoc]] document into a [[ChunkedDoc]].\" ]\n where\n  defPathTmpl = PathTemplate \"chunk-%n\"\n  defNumSects = False\n  defLvl = 1\n  peekSplitOpts idx = (,,,)\n    <$> peekFieldRaw ((fmap PathTemplate . peekText) `orDefault` defPathTmpl)\n                     \"path_template\" idx\n    <*> peekFieldRaw (peekBool `orDefault` defNumSects) \"number_sections\" idx\n    <*> peekFieldRaw (optional . peekIntegral) \"base_heading_level\" idx\n    <*> peekFieldRaw (peekIntegral `orDefault` defLvl) \"chunk_level\" idx\n  orDefault p defaultValue idx' = liftLua (isnil idx') >>= \\case\n    True  -> pure defaultValue\n    False -> p idx'\n  optionsDescr = T.unlines\n    [ \"Splitting options.\"\n    , \"\"\n    , \"The following options are supported:\"\n    , \"\"\n    , \"    `path_template`\"\n    , \"    :   template used to generate the chunks' filepaths\"\n    , \"        `%n` will be replaced with the chunk number (padded with\"\n    , \"        leading 0s to 3 digits), `%s` with the section number of\"\n    , \"        the heading, `%h` with the (stringified) heading text,\"\n    , \"        `%i` with the section identifier. For example,\"\n    , \"        `\\\"section-%s-%i.html\\\"` might be resolved to\"\n    , \"        `\\\"section-1.2-introduction.html\\\"`.\"\n    , \"\"\n    , \"        Default is `\\\"chunk-%n\\\"` (string)\"\n    , \"\"\n    , \"    `number_sections`\"\n    , \"    :   whether sections should be numbered; default is `false`\"\n    , \"        (boolean)\"\n    , \"\"\n    , \"    `chunk_level`\"\n    , \"    :   The heading level the document should be split into\"\n    , \"        chunks. The default is to split at the top-level, i.e.,\"\n    , \"        `1`. (integer)\"\n    , \"\"\n    , \"    `base_heading_level`\"\n    , \"    :   The base level to be used for numbering. Default is `nil`\"\n    , \"        (integer|nil)\"\n    ]\n\n-- | Generate a table of contents.\ntable_of_contents :: DocumentedFunction PandocError\ntable_of_contents = defun \"table_of_contents\"\n  ### (\\tocSource mwriterOpts -> pure $\n          let writerOpts = fromMaybe def mwriterOpts\n          in case tocSource of\n               Left blks  -> toTableOfContents writerOpts blks\n               Right tree -> tocToList (writerNumberSections writerOpts)\n                                       (writerTOCDepth writerOpts) tree\n      )\n  <#> parameter peekTocSource \"Blocks|Pandoc|ChunkedDoc\" \"toc_source\"\n        \"list of command line arguments\"\n  <#> opt (parameter peekWriterOptions \"WriterOptions\" \"opts\" \"options\")\n  =#> functionResult pushBlock \"Block\"\n        \"Table of contents as a BulletList object\"\n  #? T.unlines\n     [ \"Generates a table of contents for the given object.\" ]\n where\n  peekTocSource idx =\n    (Left <$> peekBodyBlocks idx) <|>\n    (Right . chunkedTOC <$> peekChunkedDoc idx)\n\n-- | Generate a unique ID from a list of inlines.\nunique_identifier :: LuaError e => DocumentedFunction e\nunique_identifier = defun \"unique_identifier\"\n  ### (\\inlns mUsedIdents mExts -> do\n          let usedIdents = fromMaybe mempty mUsedIdents\n          let exts       = fromMaybe mempty mExts\n          pure $ Shared.uniqueIdent exts inlns usedIdents)\n  <#> parameter peekInlinesFuzzy \"Inlines\" \"inlines\" \"base for identifier\"\n  <#> opt (parameter (peekSet peekText) \"table\" \"used\"\n           \"set of identifiers (string keys, boolean values) that\\\n           \\ have already been used.\")\n  <#> opt (parameter peekExtensions \"{string,...}\" \"exts\"\n           \"list of format extensions\")\n  =#> functionResult pushText \"string\" \"unique identifier\"\n  #? \"Generates a unique identifier from a list of inlines, similar to\\\n     \\ what's generated by the `auto_identifiers` extension.\\n\\\n     \\\\n\\\n     \\ The method used to generated identifiers can be modified through\\\n     \\ `ext`, which is a list of format extensions.\\n\\\n     \\\\n\\\n     \\ It can be used to generate IDs similar to what the `auto_identifiers`\\\n     \\ extension provides.\\n\\\n     \\\\n\\\n     \\ Example:\\n\\\n     \\\\n\\\n     \\     local used_ids = {}\\n\\\n     \\     function Header (h)\\n\\\n     \\       local id =\\n\\\n     \\         pandoc.structure.unique_identifier(h.content, used_ids)\\n\\\n     \\       used_ids[id] = true\\n\\\n     \\       h.identifier = id\\n\\\n     \\       return h\\n\\\n     \\     end\"\n\n-- | Retrieves the body blocks of a 'Pandoc' object or from a list of\n-- blocks.\npeekBodyBlocks :: LuaError e => Peeker e [Block]\npeekBodyBlocks idx =\n  ((\\(Pandoc _ blks) -> blks) <$> peekPandoc idx) <|>\n  peekBlocksFuzzy idx\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.System\n   Copyright   : © 2019-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nPandoc's system Lua module.\n-}\nmodule Text.Pandoc.Lua.Module.System\n  ( documentedModule\n  ) where\n\nimport Data.Version (makeVersion)\nimport HsLua\nimport HsLua.Module.System\n  ( arch, cmd, cp, cputime, env, getwd, ls, mkdir, os, read_file\n  , rename, rm, rmdir, times, with_env, with_tmpdir, with_wd\n  , write_file, xdg\n  )\nimport qualified HsLua.Module.System as MSys\n\n-- | Push the pandoc.system module on the Lua stack.\ndocumentedModule :: forall e. LuaError e => Module e\ndocumentedModule = defmodule \"pandoc.system\"\n  `withDescription` moduleDescription @e MSys.documentedModule\n  `withFields` [arch, os]\n  `withFunctions`\n      [         cputime                                `since` v[3,1,1]\n      , setName cmd         \"command\"                  `since` v[3,7,1]\n      , setName cp          \"copy\"                     `since` v[3,7,1]\n      , setName env         \"environment\"              `since` v[2,7,3]\n      , setName getwd       \"get_working_directory\"    `since` v[2,8]\n      , setName ls          \"list_directory\"           `since` v[2,19]\n      , setName mkdir       \"make_directory\"           `since` v[2,19]\n      ,         read_file                              `since` v[3,7,1]\n      ,         rename                                 `since` v[3,7,1]\n      , setName rm          \"remove\"                   `since` v[3,7,1]\n      , setName rmdir       \"remove_directory\"         `since` v[2,19]\n      ,         times                                  `since` v[3,7,1]\n      , setName with_env    \"with_environment\"         `since` v[2,7,3]\n      , setName with_tmpdir \"with_temporary_directory\" `since` v[2,8]\n      , setName with_wd     \"with_working_directory\"   `since` v[2,7,3]\n      ,         write_file                             `since` v[3,7,1]\n      ,         xdg                                    `since` v[3,7,1]\n      ]\n where\n  v = makeVersion\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Template.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Template\n   Copyright   : Copyright © 2022-2026 Albert Krewinkel, John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nLua module to handle pandoc templates.\n-}\nmodule Text.Pandoc.Lua.Module.Template\n  ( documentedModule\n  ) where\n\nimport Data.Version (makeVersion)\nimport HsLua\nimport HsLua.Module.DocLayout (peekDoc, pushDoc)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.AST (peekMeta, pushBlocks, pushInlines)\nimport Text.Pandoc.Lua.Marshal.Context (peekContext, pushContext)\nimport Text.Pandoc.Lua.Marshal.Template (typeTemplate, peekTemplate, pushTemplate)\nimport Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua), liftPandocLua)\nimport Text.Pandoc.Writers.Shared (metaToContext')\nimport Text.Pandoc.Templates\n  ( compileTemplate, getDefaultTemplate, getTemplate, renderTemplate\n  , runWithPartials, runWithDefaultPartials )\n\nimport qualified Data.Text as T\n\n-- | The \"pandoc.template\" module.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.template\"\n  `withDescription` \"Handle pandoc templates.\"\n  `withFunctions` functions\n  `associateType` typeTemplate\n\n-- | Template module functions.\nfunctions :: [DocumentedFunction PandocError]\nfunctions =\n  [ defun \"apply\"\n     ### liftPure2 renderTemplate\n     <#> parameter peekTemplate \"Template\" \"template\" \"template to apply\"\n     <#> parameter peekContext \"table\" \"context\" \"variable values\"\n     =#> functionResult pushDoc \"Doc\" \"rendered template\"\n     #? T.unlines\n     [ \"Applies a context with variable assignments to a template,\"\n     , \"returning the rendered template. The `context` parameter must be a\"\n     , \"table with variable names as keys and [[Doc]], string, boolean, or\"\n     , \"table as values, where the table can be either be a list of the\"\n     , \"aforementioned types, or a nested context.\"\n     ]\n    `since` makeVersion [3,0]\n\n  , defun \"compile\"\n     ### (\\template mfilepath -> unPandocLua $\n           case mfilepath of\n             Just fp -> runWithPartials (compileTemplate fp template)\n             Nothing -> runWithDefaultPartials\n                        (compileTemplate \"templates/default\" template))\n     <#> parameter peekText \"string\" \"template\" \"template string\"\n     <#> opt (stringParam \"templates_path\"\n              (\"parameter to determine a default path and extension for \" <>\n               \"partials; uses the data files templates path by default.\"))\n     =#> functionResult (either failLua pushTemplate) \"Template\"\n           \"compiled template\"\n     #? T.unlines\n     [ \"Compiles a template string into a [[Template]] object usable by\"\n     , \"pandoc.\"\n     , \"\"\n     , \"If the `templates_path` parameter is specified, then it should be the\"\n     , \"file path associated with the template. It is used when checking\"\n     , \"for partials. Partials will be taken only from the default data\"\n     , \"files if this parameter is omitted.\"\n     , \"\"\n     , \"An error is raised if compilation fails.\"\n     ]\n    `since` makeVersion [2,17]\n\n  , defun \"default\"\n     ### (\\mformat -> unPandocLua $ do\n           let getFORMAT = liftPandocLua $ do\n                 getglobal \"FORMAT\"\n                 forcePeek $ peekText top `lastly` pop 1\n           format <- maybe getFORMAT pure mformat\n           getDefaultTemplate format)\n     <#> opt (textParam \"writer\"\n              (\"name of the writer for which the template should be \" <>\n               \"retrieved; defaults to the global `FORMAT`.\"))\n     =#> functionResult pushText \"string\" \"raw template\"\n    #? T.unlines\n    [ \"Returns the default template for a given writer as a string. An\"\n    , \"error is thrown if no such template can be found.\"\n    ]\n    `since` makeVersion [2,17]\n\n  , defun \"get\"\n     ### (unPandocLua . getTemplate)\n     <#> stringParam \"filename\" \"name of the template\"\n     =#> textResult \"content of template file\"\n     #? T.unlines\n     [ \"Retrieve text for a template.\"\n     , \"\"\n     , \"This function first checks the resource paths for a file of this\"\n     , \"name; if none is found, the `templates` directory in the user data\"\n     , \"directory is checked.  Returns the content of the file, or throws\"\n     , \"an error if no file is found.\"\n     ]\n    `since` makeVersion [3,2,1]\n\n  , defun \"meta_to_context\"\n     ### (\\meta blockWriterIdx inlineWriterIdx -> unPandocLua $ do\n             let blockWriter blks = liftPandocLua $ do\n                   pushvalue blockWriterIdx\n                   pushBlocks blks\n                   callTrace 1 1\n                   forcePeek $ peekDoc top\n             let inlineWriter blks = liftPandocLua $ do\n                   pushvalue inlineWriterIdx\n                   pushInlines blks\n                   callTrace 1 1\n                   forcePeek $ peekDoc top\n             metaToContext' blockWriter inlineWriter meta)\n     <#> parameter peekMeta \"Meta\" \"meta\" \"document metadata\"\n     <#> parameter pure \"function\" \"blocks_writer\"\n           \"converter from [[Blocks]] to [[Doc]] values\"\n     <#> parameter pure \"function\" \"inlines_writer\"\n           \"converter from [[Inlines]] to [[Doc]] values\"\n     =#> functionResult pushContext \"table\" \"template context\"\n     #? T.unlines\n     [ \"Creates template context from the document's [[Meta]] data, using the\"\n     , \"given functions to convert [[Blocks]] and [[Inlines]] to [[Doc]]\"\n     , \"values.\"\n     ]\n    `since` makeVersion [3,0]\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Text.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-|\nModule      : Text.Pandoc.Lua.Module.Text\nCopyright   : © 2023 Albert Krewinkel\nLicense     : MIT\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nLua module to work with UTF-8 strings.\n-}\nmodule Text.Pandoc.Lua.Module.Text\n  ( documentedModule\n  ) where\n\nimport Data.Version (makeVersion)\nimport HsLua\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.PandocLua ()\nimport Text.Pandoc.Writers.Shared (toSubscript, toSuperscript)\n\nimport qualified Data.Text as T\nimport qualified HsLua.Module.Text as TM\n\n-- | The @aeson@ module specification.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.text\"\n  `withFunctions`\n    [ TM.fromencoding `since` v[3,0]\n    , TM.len          `since` v[2,0,3]\n    , TM.lower        `since` v[2,0,3]\n    , TM.reverse      `since` v[2,0,3]\n    , TM.sub          `since` v[2,0,3]\n    , subscript       `since` v[3,8]\n    , superscript     `since` v[3,8]\n    , TM.toencoding   `since` v[3,0]\n    , TM.upper        `since` v[2,0,3]\n    ]\n  `withDescription` T.unlines\n    [ \"UTF-8 aware text manipulation functions, implemented in Haskell.\"\n    , \"\"\n    , \"The text module can also be loaded under the name `text`, although\"\n    , \"this is discouraged and deprecated.\"\n    , \"\"\n    , \"``` lua\"\n    , \"-- uppercase all regular text in a document:\"\n    , \"function Str (s)\"\n    , \"  s.text = pandoc.text.upper(s.text)\"\n    , \"  return s\"\n    , \"end\"\n    , \"```\"\n    ]\n where\n  v = makeVersion\n\n-- | Convert all chars in a string to Unicode subscript.\nsubscript :: LuaError e => DocumentedFunction e\nsubscript = defun \"subscript\"\n  ### pure . traverse toSubscript\n  <#> stringParam \"input\" \"string to convert to subscript characters\"\n  =#> functionResult (maybe pushnil pushString) \"string|nil\"\n      \"Subscript version of the input, or `nil` if not all characters\\\n      \\ could be converted.\"\n  #? \"Tries to convert the string into a Unicode subscript version of the\\\n     \\ string.  Returns `nil` if not all characters of the input can be\\\n     \\ mapped to a subscript Unicode character.\\\n     \\ Supported characters include numbers, parentheses, and plus/minus.\"\n\n-- | Convert all chars in a string to Unicode superscript.\nsuperscript :: LuaError e => DocumentedFunction e\nsuperscript = defun \"superscript\"\n  ### pure . traverse toSuperscript\n  <#> stringParam \"input\" \"string to convert to superscript characters\"\n  =#> functionResult (maybe pushnil pushString) \"string|nil\"\n      \"Superscript version of the input, or `nil` if not all characters\\\n      \\ could be converted.\"\n  #? \"Tries to convert the string into a Unicode superscript version of the\\\n     \\ string.  Returns `nil` if not all characters of the input can be\\\n     \\ mapped to a superscript Unicode character.\\\n     \\ Supported characters include numbers, parentheses, and plus/minus.\"\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Types.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Types\n   Copyright   : © 2019-2026 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nPandoc data type constructors.\n-}\nmodule Text.Pandoc.Lua.Module.Types\n  ( documentedModule\n  ) where\n\nimport Data.Version (Version, makeVersion)\nimport HsLua ( DocumentedFunction, Module (..)\n             , (###), (<#>), (=#>), (#?), associateType\n             , defmodule, defun, functionResult, parameter, since\n             , withDescription, withFunctions\n             )\nimport HsLua.Module.Version (peekVersionFuzzy, pushVersion, typeVersion)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.Sources (peekSources, pushSources, typeSource)\nimport Text.Pandoc.Lua.PandocLua ()\n\n-- | Push the pandoc.types module on the Lua stack.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.types\"\n  `withDescription`\n      \"Constructors for types that are not part of the pandoc AST.\"\n  `withFunctions`\n    [ mkVersion `since` v[2,7,3]\n    , mkSources `since` v[3,9,1]\n    ]\n  `associateType` typeSource\n  `associateType` typeVersion\n where\n  v :: [Int] -> Version\n  v = makeVersion\n\nmkVersion :: DocumentedFunction PandocError\nmkVersion = defun \"Version\"\n  ### return\n  <#> parameter peekVersionFuzzy \"string|number|{integer,...}|Version\"\n        \"version_specifier\"\n        (mconcat [ \"A version string like `'2.7.3'`, \"\n                 , \"a Lua number like `2.0`, \"\n                 , \"a list of integers like `{2,7,3}`, \"\n                 , \"or a Version object.\"\n                 ])\n  =#> functionResult pushVersion \"Version\" \"New Version object.\"\n\nmkSources :: DocumentedFunction PandocError\nmkSources = defun \"Sources\"\n  ### pure\n  <#> parameter peekSources \"string|{string,...}|table\" \"srcs\"\n        \"sources\"\n  =#> functionResult pushSources \"{Source,...}\" \"new Sources object\"\n  #?\n    \"Creates a new Sources element, i.e., a list of [[Source]] items.\\n\\\n    \\\\n\\\n    \\ Pandoc's text readers expect the input text to be paired\\\n    \\ with information on where the text originated, e.g., a\\\n    \\ file name. This abstraction is provided via the `Sources` type.\\n\\\n    \\\\n\\\n    \\Pandoc accepts a range of objects wherever a *Sources* list is\\\n    \\ expected:\\n\\\n    \\\\n\\\n    \\  - a list of [[Source]] items;\\n\\\n    \\  - a simple string, which becomes an unnamed source;\\n\\\n    \\  - a list of table objects, where each table contains the fields\\n\\\n    \\    `name` (the filepath) and `text` (the file contents)\\n\\\n    \\\\n\\\n    \\A Sources list can be converted to a string via the default `tostring`\\\n    \\ Lua function. This will concatenate all source items.\"\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module.Utils\n   Copyright   : © 2017-2026 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nUtility module for Lua, exposing internal helper functions.\n-}\nmodule Text.Pandoc.Lua.Module.Utils\n  ( documentedModule\n  , sha1\n  ) where\n\nimport Control.Applicative ((<|>))\nimport Control.Monad ((<$!>))\nimport Control.Monad.Except (MonadError (throwError))\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport Data.Data (showConstr, toConstr)\nimport Data.Default (def)\nimport Data.Maybe (fromMaybe)\nimport Data.Version (Version, makeVersion)\nimport HsLua as Lua\nimport HsLua.Module.Version (peekVersionFuzzy, pushVersion)\nimport Text.Pandoc.Citeproc (getReferences, processCitations)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError (PandocLuaError))\nimport Text.Pandoc.Filter (applyJSONFilter)\nimport Text.Pandoc.Format (FlavoredFormat (formatName), parseFlavoredFormat)\nimport Text.Pandoc.Lua.Documentation (renderDocumentation)\nimport Text.Pandoc.Lua.Filter (runFilterFile')\nimport Text.Pandoc.Lua.Marshal.AST\nimport Text.Pandoc.Lua.Marshal.Format (peekFlavoredFormat)\nimport Text.Pandoc.Lua.Marshal.Reference\nimport Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua))\nimport Text.Pandoc.Options (WriterOptions (writerExtensions))\nimport Text.Pandoc.Writers (Writer (..), getWriter)\n\nimport qualified Data.Map as Map\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport qualified Text.Pandoc.Shared as Shared\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Text.Pandoc.Writers.Shared as Shared\n\n-- | Push the \"pandoc.utils\" module to the Lua stack.\ndocumentedModule :: Module PandocError\ndocumentedModule = defmodule \"pandoc.utils\"\n  `withDescription` T.unlines\n    [ \"This module exposes internal pandoc functions and utility\"\n    , \"functions.\"\n    ]\n  `withFunctions`\n    [ blocks_to_inlines `since` v[2,2,3]\n    , citeproc          `since` v[2,19,1]\n    , documentation     `since` v[3,8,4]\n    , equals            `since` v[2,5]\n    , from_simple_table `since` v[2,11]\n    , make_sections     `since` v[2,8]\n    , normalize_date    `since` v[2,0,6]\n    , references        `since` v[2,17]\n    , run_json_filter   `since` v[2,1,1]\n    , run_lua_filter    `since` v[3,2,1]\n    , sha1              `since` v[2,0,6]\n    , stringify         `since` v[2,0,6]\n    , to_roman_numeral  `since` v[2,0,6]\n    , to_simple_table   `since` v[2,11]\n    , type'             `since` v[2,17]\n\n    , defun \"Version\"\n      ### liftPure (id @Version)\n      <#> parameter peekVersionFuzzy \"Version|string|{integer,...}|number\"\n            \"v\" \"version description\"\n      =#> functionResult pushVersion \"Version\" \"new Version object\"\n      #? \"Creates a Version object.\"\n    ]\n where\n  v = makeVersion\n\nblocks_to_inlines :: LuaError e => DocumentedFunction e\nblocks_to_inlines = defun \"blocks_to_inlines\"\n  ### (\\blks mSep -> do\n          let sep = maybe Shared.defaultBlocksSeparator B.fromList mSep\n          return $ B.toList (Shared.blocksToInlinesWithSep sep blks))\n  <#> parameter (peekList peekBlock) \"Blocks\"\n        \"blocks\"\n        \"List of [[Block]] elements to be flattened.\"\n  <#> opt (parameter (peekList peekInline) \"Inlines\" \"sep\"\n           (\"List of [[Inline]] elements inserted as separator between\\n\" <>\n            \"two consecutive blocks; defaults to `{pandoc.LineBreak()}`.\"))\n  =#> functionResult pushInlines \"Inlines\" \"\"\n  #? T.unlines\n  [ \"Squash a list of blocks into a list of inlines.\"\n  , \"\"\n  , \"Usage\"\n  , \"\"\n  , \"    local blocks = {\"\n  , \"      pandoc.Para{ pandoc.Str 'Paragraph1' },\"\n  , \"      pandoc.Para{ pandoc.Emph 'Paragraph2' }\"\n  , \"    }\"\n  , \"    local inlines = pandoc.utils.blocks_to_inlines(blocks)\"\n  , \"    assert(\"\n  , \"      inlines == pandoc.Inlines {\"\n  , \"        pandoc.Str 'Paragraph1',\"\n  , \"        pandoc.Linebreak(),\"\n  , \"        pandoc.Emph{ pandoc.Str 'Paragraph2' }\"\n  , \"      }\"\n  , \"    )\"\n  ]\n\nciteproc :: DocumentedFunction PandocError\nciteproc = defun \"citeproc\"\n  ### unPandocLua . processCitations\n  <#> parameter peekPandoc \"Pandoc\" \"doc\" \"document\"\n  =#> functionResult pushPandoc \"Pandoc\" \"processed document\"\n  #?  T.unlines\n      [ \"Process the citations in the file, replacing them with \"\n      , \"rendered citations and adding a bibliography. \"\n      , \"See the manual section on citation rendering for details.\"\n      , \"\"\n      , \"Usage:\"\n      , \"\"\n      , \"    -- Lua filter that behaves like `--citeproc`\"\n      , \"    function Pandoc (doc)\"\n      , \"      return pandoc.utils.citeproc(doc)\"\n      , \"    end\"\n      ]\n\ndocumentation :: DocumentedFunction PandocError\ndocumentation = defun \"documentation\"\n  ### (\\idx mformat -> do\n          docobj <- getdocumentation idx >>= \\case\n            TypeNil -> fail \"Undocumented object\"\n            _ -> forcePeek $ peekDocumentationObject top\n          let blocks = renderDocumentation docobj\n          if maybe mempty formatName mformat == \"blocks\"\n            then pure . Left $ B.toList blocks\n            else unPandocLua $ do\n              flvrd <- maybe (parseFlavoredFormat \"ansi\") pure mformat\n              getWriter flvrd >>= \\case\n                (TextWriter w, es) -> Right <$>\n                  w def{ writerExtensions = es } (B.doc blocks)\n                _ -> throwError $ PandocLuaError\n                  \"ByteString writers are not supported here.\")\n  <#> parameter pure \"any\" \"object\" \"Retrieve documentation for this object\"\n  <#> opt (parameter peekFlavoredFormat \"string|table\" \"format\"\n            \"result format; defaults to `'ansi'`\")\n  =#> functionResult (either pushBlocks pushText) \"string|Blocks\"\n        \"rendered documentation\"\n  #? \"Return the documentation for a function or module defined by pandoc.\\\n     \\ Throws an error if there is no documentation for the given object.\\n\\\n     \\\\n\\\n     \\The result format can be any textual format accepted by `pandoc.write`,\\\n     \\ and the documentation will be returned in that format.\\\n     \\ Additionally, the special format `blocks` is accepted, in which case\\\n     \\ the documentation is returned as [[Blocks]].\"\n\nequals :: LuaError e => DocumentedFunction e\nequals = defun \"equals\"\n  ### equal\n  <#> parameter pure \"any\" \"element1\" \"\"\n  <#> parameter pure \"any\" \"element2\" \"\"\n  =#> functionResult pushBool \"boolean\"\n        \"Whether the two objects represent the same element\"\n  #? T.unlines\n  [ \"Test equality of AST elements. Elements in Lua are considered\"\n  , \"equal if and only if the objects obtained by unmarshaling are\"\n  , \"equal.\"\n  , \"\"\n  , \"**This function is deprecated.** Use the normal Lua `==` equality\"\n  , \"operator instead.\"\n  ]\n\n-- | Converts an old/simple table into a normal table block element.\nfrom_simple_table :: LuaError e => DocumentedFunction e\nfrom_simple_table = defun \"from_simple_table\"\n  ### liftPure\n      (\\(SimpleTable capt aligns widths head' body) ->\n          Table\n          nullAttr\n          (Caption Nothing [Plain capt | not (null capt)])\n          (zipWith (\\a w -> (a, toColWidth w)) aligns widths)\n          (TableHead nullAttr [blockListToRow head' | not (null head') ])\n          [TableBody nullAttr 0 [] $ map blockListToRow body | not (null body)]\n          (TableFoot nullAttr []))\n  <#> parameter peekSimpleTable \"SimpleTable\" \"simple_tbl\" \"\"\n  =#> functionResult pushBlock \"Block\" \"table block element\"\n  #? T.unlines\n  [ \"Creates a [[Table]] block element from a [[SimpleTable]]. This is\"\n  , \"useful for dealing with legacy code which was written for pandoc\"\n  , \"versions older than 2.10.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    local simple = pandoc.SimpleTable(table)\"\n  , \"    -- modify, using pre pandoc 2.10 methods\"\n  , \"    simple.caption = pandoc.SmallCaps(simple.caption)\"\n  , \"    -- create normal table block again\"\n  , \"    table = pandoc.utils.from_simple_table(simple)\"\n  ]\n where\n  blockListToRow :: [[Block]] -> Row\n  blockListToRow = Row nullAttr . map (B.simpleCell . B.fromList)\n\n  toColWidth :: Double -> ColWidth\n  toColWidth 0 = ColWidthDefault\n  toColWidth w = ColWidth w\n\nmake_sections :: LuaError e => DocumentedFunction e\nmake_sections = defun \"make_sections\"\n  ### liftPure3 Shared.makeSections\n  <#> parameter peekBool \"boolean\" \"number_sections\"\n      (\"whether section divs should get an additional `number`\\n\" <>\n       \"attribute containing the section number.\")\n  <#> parameter (\\i -> (Nothing <$ peekNil i) <|> (Just <$!> peekIntegral i))\n        \"integer|nil\" \"baselevel\"\n        \"shift top-level headings to this level\"\n  <#> parameter (peekList peekBlock) \"Blocks\"\n        \"blocks\" \"list of blocks to process\"\n  =#> functionResult pushBlocks \"Blocks\"\n        \"blocks with sections\"\n  #? T.unlines\n  [ \"Converts a list of [[Block]] elements into sections.\"\n  , \"`Div`s will be created beginning at each `Header`\"\n  , \"and containing following content until the next `Header`\"\n  , \"of comparable level.  If `number_sections` is true,\"\n  , \"a `number` attribute will be added to each `Header`\"\n  , \"containing the section number. If `base_level` is\"\n  , \"non-null, `Header` levels will be reorganized so\"\n  , \"that there are no gaps, and so that the base level\"\n  , \"is the level specified.\"\n  ]\n\nnormalize_date :: DocumentedFunction e\nnormalize_date = defun \"normalize_date\"\n  ### liftPure Shared.normalizeDate\n  <#> parameter peekText \"string\" \"date\" \"the date string\"\n  =#> functionResult (maybe pushnil pushText) \"string|nil\"\n        \"normalized date, or nil if normalization failed.\"\n  #? T.unwords\n  [ \"Parse a date and convert (if possible) to \\\"YYYY-MM-DD\\\" format. We\"\n  , \"limit years to the range 1601-9999 (ISO 8601 accepts greater than\"\n  , \"or equal to 1583, but MS Word only accepts dates starting 1601).\"\n  , \"Returns nil instead of a string if the conversion failed.\"\n  ]\n\n-- | List of references in CSL format.\nreferences :: DocumentedFunction PandocError\nreferences = defun \"references\"\n  ### (unPandocLua . getReferences Nothing)\n  <#> parameter peekPandoc \"Pandoc\" \"doc\" \"document\"\n  =#> functionResult (pushPandocList pushReference) \"table\"\n       \"lift of references.\"\n  #? T.unlines\n  [ \"Get references defined inline in the metadata and via an external\"\n  , \"bibliography. Only references that are actually cited in the\"\n  , \"document (either with a genuine citation or with `nocite`) are\"\n  , \"returned. URL variables are converted to links.\"\n  , \"\"\n  , \"The structure used represent reference values corresponds to that\"\n  , \"used in CSL JSON; the return value can be use as `references`\"\n  , \"metadata, which is one of the values used by pandoc and citeproc\"\n  , \"when generating bibliographies.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    -- Include all cited references in document\"\n  , \"    function Pandoc (doc)\"\n  , \"      doc.meta.references = pandoc.utils.references(doc)\"\n  , \"      doc.meta.bibliography = nil\"\n  , \"      return doc\"\n  , \"    end\"\n  ]\n\n-- | Run a filter from a file.\nrun_lua_filter :: DocumentedFunction PandocError\nrun_lua_filter = defun \"run_lua_filter\"\n  ### (\\doc fp mbenv -> do\n         envIdx <- maybe copyOfGlobalTable pure mbenv\n         runFilterFile' envIdx fp doc)\n  <#> parameter peekPandoc \"Pandoc\" \"doc\" \"the Pandoc document to filter\"\n  <#> parameter peekString \"string\" \"filter\" \"filepath of the filter to run\"\n  <#> opt (parameter (typeChecked \"table\" istable pure) \"table\" \"env\"\n            \"environment to load and run the filter in\")\n  =#> functionResult pushPandoc \"Pandoc\" \"filtered document\"\n  #? ( \"Filter the given doc by passing it through a Lua filter.\" <>\n       \"\\n\\nThe filter will be run in the current Lua process.\" <>\n       \"\\n\"\n     )\n  where\n    copynext :: LuaError e => StackIndex -> LuaE e StackIndex\n    copynext to =\n      Lua.next (nth 2) >>= \\case\n        False -> pure to\n        True -> do\n          pushvalue (nth 2)\n          insert (nth 2)\n          rawset to\n          copynext to\n    copyOfGlobalTable :: LuaError e => LuaE e StackIndex\n    copyOfGlobalTable = do\n      newtable\n      pushglobaltable\n      pushnil\n      (copynext =<< absindex (nth 3)) <* pop 1 -- pop source table\n\n-- | Process the document with a JSON filter.\nrun_json_filter :: DocumentedFunction PandocError\nrun_json_filter = defun \"run_json_filter\"\n  ### (\\doc filterPath margs -> do\n          args <- case margs of\n                    Just xs -> return xs\n                    Nothing -> do\n                      Lua.getglobal \"FORMAT\"\n                      (forcePeek ((:[]) <$!> peekString top) <* pop 1)\n          applyJSONFilter def args filterPath doc\n      )\n  <#> parameter peekPandoc \"Pandoc\" \"doc\" \"the Pandoc document to filter\"\n  <#> parameter peekString \"string\" \"filter\" \"filter to run\"\n  <#> opt (parameter (peekList peekString) \"{string,...}\" \"args\"\n           \"list of arguments passed to the filter. Defaults to `{FORMAT}`.\")\n  =#> functionResult pushPandoc \"Pandoc\" \"filtered document\"\n  #? \"Filter the given doc by passing it through a JSON filter.\"\n\n-- | Documented Lua function to compute the hash of a string.\nsha1 :: DocumentedFunction e\nsha1 = defun \"sha1\"\n  ### liftPure (show . hashWith SHA1)\n  <#> parameter peekByteString \"string\" \"input\" \"\"\n  =#> functionResult pushString \"string\" \"hexadecimal hash value\"\n  #? \"Computes the SHA1 hash of the given string input.\"\n\n-- | Convert pandoc structure to a string with formatting removed.\n-- Footnotes are skipped (since we don't want their contents in link\n-- labels).\nstringify :: LuaError e => DocumentedFunction e\nstringify = defun \"stringify\"\n  ### (\\idx ->\n         forcePeek . retrieving \"stringifyable element\" $\n         choice\n         [ (fmap Shared.stringify . peekPandoc)\n         , (fmap Shared.stringify . peekInline)\n         , (fmap Shared.stringify . peekBlock)\n         , (fmap Shared.stringify . peekCaption)\n         , (fmap Shared.stringify . peekCell)\n         , (fmap Shared.stringify . peekCitation)\n         , (fmap Shared.stringify . peekTableHead)\n         , (fmap Shared.stringify . peekTableFoot)\n         , (fmap stringifyMetaValue . peekMetaValue)\n         , (fmap (const \"\") . peekAttr)\n         , (fmap (const \"\") . peekListAttributes)\n         ] idx)\n  <#> parameter pure \"Pandoc|Block|Inline|Caption|Cell|MetaValue\"\n        \"element\" \"some pandoc AST element\"\n  =#> functionResult pushText \"string\"\n        \"A plain string representation of the given element.\"\n  #? T.unlines\n  [ \"Converts the given element (Pandoc, Meta, Block, or Inline) into\"\n  , \"a string with all formatting removed.\"\n  ]\n where\n  stringifyMetaValue :: MetaValue -> T.Text\n  stringifyMetaValue mv = case mv of\n    MetaBool b   -> T.toLower $ T.pack (show b)\n    MetaString s -> s\n    MetaList xs  -> mconcat $ map stringifyMetaValue xs\n    MetaMap m    -> mconcat $ map (stringifyMetaValue . snd) (Map.toList m)\n    _            -> Shared.stringify mv\n\n\nto_roman_numeral :: LuaError e => DocumentedFunction e\nto_roman_numeral = defun \"to_roman_numeral\"\n  ### liftPure Shared.toRomanNumeral\n  <#> parameter (peekIntegral @Int) \"integer\" \"n\"\n        \"positive integer below 4000\"\n  =#> functionResult pushText \"string\" \"A roman numeral.\"\n  #? T.unlines\n  [ \"Converts an integer < 4000 to uppercase roman numeral.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    local to_roman_numeral = pandoc.utils.to_roman_numeral\"\n  , \"    local pandoc_birth_year = to_roman_numeral(2006)\"\n  , \"    -- pandoc_birth_year == 'MMVI'\"\n  ]\n\n-- | Converts a table into an old/simple table.\nto_simple_table :: DocumentedFunction PandocError\nto_simple_table = defun \"to_simple_table\"\n  ### (\\case\n          Table _attr caption specs thead tbodies tfoot -> do\n            let (capt, aligns, widths, headers, rows) =\n                  Shared.toLegacyTable caption specs thead tbodies tfoot\n            return $ SimpleTable capt aligns widths headers rows\n          blk -> Lua.failLua $ mconcat\n                 [ \"Expected Table, got \", showConstr (toConstr blk), \".\" ])\n  <#> parameter peekTable \"Block\" \"tbl\" \"a table\"\n  =#> functionResult pushSimpleTable \"SimpleTable\" \"SimpleTable object\"\n  #? T.unlines\n  [ \"Converts a table into an old/simple table.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    local simple = pandoc.utils.to_simple_table(table)\"\n  , \"    -- modify, using pre pandoc 2.10 methods\"\n  , \"    simple.caption = pandoc.SmallCaps(simple.caption)\"\n  , \"    -- create normal table block again\"\n  , \"    table = pandoc.utils.from_simple_table(simple)\"\n  ]\n where\n  peekTable :: LuaError e => Peeker e Block\n  peekTable idx = peekBlock idx >>= \\case\n    t@(Table {}) -> return t\n    b -> Lua.failPeek $ mconcat\n         [ \"Expected Table, got \"\n         , UTF8.fromString $ showConstr (toConstr b)\n         , \".\" ]\n\ntype' :: DocumentedFunction e\ntype' = defun \"type\"\n  ### (\\idx -> getmetafield idx \"__name\" >>= \\case\n          TypeString -> fromMaybe mempty <$> tostring top\n          _ -> ltype idx >>= typename)\n  <#> parameter pure \"any\" \"value\" \"any Lua value\"\n  =#> functionResult pushByteString \"string\" \"type of the given value\"\n  #? T.unlines\n  [ \"Pandoc-friendly version of Lua's default `type` function, returning\"\n  , \"type information similar to what is presented in the manual.\"\n  , \"\"\n  , \"The function works by checking the metafield `__name`. If the\"\n  , \"argument has a string-valued metafield `__name`, then it returns\"\n  , \"that string. Otherwise it behaves just like the normal `type`\"\n  , \"function.\"\n  , \"\"\n  , \"Usage:\"\n  , \"\"\n  , \"    -- Prints one of 'string', 'boolean', 'Inlines', 'Blocks',\"\n  , \"    -- 'table', and 'nil', corresponding to the Haskell constructors\"\n  , \"    -- MetaString, MetaBool, MetaInlines, MetaBlocks, MetaMap,\"\n  , \"    -- and an unset value, respectively.\"\n  , \"\"\n  , \"    function Meta (meta)\"\n  , \"      print('type of metavalue `author`:', pandoc.utils.type(meta.author))\"\n  , \"    end\"\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Module.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.Module\n   Copyright   : © 2017-2026 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nSetting up and initializing Lua modules.\n-}\n\nmodule Text.Pandoc.Lua.Module\n  ( initModules\n  ) where\n\nimport Control.Monad (forM_, when)\nimport Data.Version (makeVersion)\nimport HsLua as Lua\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Marshal.List (pushPandocList, pushListModule)\nimport Text.Pandoc.Lua.PandocLua (PandocLua (..), liftPandocLua)\nimport qualified Data.ByteString.Char8 as Char8\nimport qualified Lua.LPeg as LPeg\nimport qualified HsLua.Aeson\nimport qualified HsLua.Module.DocLayout as Module.Layout\nimport qualified HsLua.Module.Zip as Module.Zip\nimport qualified Text.Pandoc.Lua.Module.CLI as Pandoc.CLI\nimport qualified Text.Pandoc.Lua.Module.Format as Pandoc.Format\nimport qualified Text.Pandoc.Lua.Module.Image as Pandoc.Image\nimport qualified Text.Pandoc.Lua.Module.JSON as Pandoc.JSON\nimport qualified Text.Pandoc.Lua.Module.Log as Pandoc.Log\nimport qualified Text.Pandoc.Lua.Module.MediaBag as Pandoc.MediaBag\nimport qualified Text.Pandoc.Lua.Module.Pandoc as Module.Pandoc\nimport qualified Text.Pandoc.Lua.Module.Path as Pandoc.Path\nimport qualified Text.Pandoc.Lua.Module.Scaffolding as Pandoc.Scaffolding\nimport qualified Text.Pandoc.Lua.Module.Structure as Pandoc.Structure\nimport qualified Text.Pandoc.Lua.Module.System as Pandoc.System\nimport qualified Text.Pandoc.Lua.Module.Template as Pandoc.Template\nimport qualified Text.Pandoc.Lua.Module.Text as Pandoc.Text\nimport qualified Text.Pandoc.Lua.Module.Types as Pandoc.Types\nimport qualified Text.Pandoc.Lua.Module.Utils as Pandoc.Utils\n\ninitModules :: PandocLua ()\ninitModules = do\n  initPandocModule\n  initJsonMetatable\n  installLpegSearcher\n  setGlobalModules\n\ninitPandocModule :: PandocLua ()\ninitPandocModule = liftPandocLua $ do\n  -- Push module table\n  registerModule Module.Pandoc.documentedModule\n  -- load modules and add them to the `pandoc` module table.\n  forM_ submodules $ \\mdl -> do\n    registerModule mdl\n    -- pandoc.text must be require-able as 'text' for backwards compat.\n    when (moduleName mdl == \"pandoc.text\") $ do\n      getfield registryindex loaded\n      pushvalue (nth  2)\n      setfield (nth 2) \"text\"\n      pop 1 -- _LOADED\n    -- Shorten name, drop everything before the first dot (if any).\n    let fieldname (Name mdlname) = Name .\n          maybe mdlname snd . Char8.uncons . snd $\n          Char8.break (== '.') mdlname\n    Lua.setfield (nth 2) (fieldname $ moduleName mdl)\n  -- pandoc.List is low-level and must be opened differently.\n  requirehs \"pandoc.List\" (const pushListModule)\n  setfield (nth 2) \"List\"\n  -- assign module to global variable\n  Lua.setglobal \"pandoc\"\n\n-- | Modules that are loaded at startup and assigned to fields in the\n-- pandoc module.\n--\n-- Note that @pandoc.List@ is not included here for technical reasons;\n-- it must be handled separately.\nsubmodules :: [Module PandocError]\nsubmodules =\n  [ Pandoc.CLI.documentedModule\n  , Pandoc.Format.documentedModule\n  , Pandoc.Image.documentedModule\n  , Pandoc.JSON.documentedModule\n  , Pandoc.Log.documentedModule\n  , Pandoc.MediaBag.documentedModule\n  , Pandoc.Path.documentedModule\n  , Pandoc.Scaffolding.documentedModule\n  , Pandoc.Structure.documentedModule\n  , Pandoc.System.documentedModule\n  , Pandoc.Template.documentedModule\n  , Pandoc.Text.documentedModule\n  , Pandoc.Types.documentedModule\n  , Pandoc.Utils.documentedModule\n  , ((Module.Layout.documentedModule { moduleName = \"pandoc.layout\" }\n      `allSince` [2,18])\n     `functionsSince` [\"bold\", \"italic\", \"underlined\", \"strikeout\", \"fg\", \"bg\"])\n    [3, 4, 1]\n  , Module.Zip.documentedModule { moduleName = \"pandoc.zip\" }\n    `allSince` [3,0]\n  ]\n where\n  allSince mdl version = mdl\n    { moduleFunctions = map (`since` makeVersion version) $ moduleFunctions mdl\n    }\n  functionsSince mdl fns version = mdl\n    { moduleFunctions = map (\\fn ->\n                               if (functionName fn) `elem` fns\n                               then fn `since` makeVersion version\n                               else fn) $ moduleFunctions mdl\n    }\n\n-- | Load all global modules and set them to their global variables.\nsetGlobalModules :: PandocLua ()\nsetGlobalModules = liftPandocLua $ do\n  let globalModules =\n        [ (\"lpeg\", LPeg.luaopen_lpeg_ptr)  -- must be loaded first\n        , (\"re\", LPeg.luaopen_re_ptr)      -- re depends on lpeg\n        ]\n  forM_ globalModules $\n    \\(pkgname, luaopen) -> do\n      Lua.pushcfunction luaopen\n      Lua.pcall 0 1 Nothing >>= \\case\n        OK -> do               -- all good, loading succeeded\n          -- register as loaded module so later modules can rely on this\n          Lua.getfield Lua.registryindex Lua.loaded\n          Lua.pushvalue (Lua.nth 2)\n          Lua.setfield (Lua.nth 2) pkgname\n          Lua.pop 1  -- pop _LOADED\n        _  -> do               -- built-in library failed, load system lib\n          Lua.pop 1  -- ignore error message\n          -- Try loading via the normal package loading mechanism.\n          Lua.getglobal \"require\"\n          Lua.pushName pkgname\n          Lua.call 1 1  -- Throws an exception if loading failed again!\n\n      -- Module on top of stack. Register as global\n      Lua.setglobal pkgname\n\ninstallLpegSearcher :: PandocLua ()\ninstallLpegSearcher = liftPandocLua $ do\n  Lua.getglobal' \"package.searchers\"\n  Lua.pushHaskellFunction $ Lua.state >>= liftIO . LPeg.lpeg_searcher\n  Lua.rawseti (Lua.nth 2) . (+1) . fromIntegral =<< Lua.rawlen (Lua.nth 2)\n  Lua.pop 1  -- remove 'package.searchers' from stack\n\n-- | Setup the metatable that's assigned to Lua tables that were created\n-- from/via JSON arrays.\ninitJsonMetatable :: PandocLua ()\ninitJsonMetatable = liftPandocLua $ do\n  pushPandocList (const pushnil) []\n  getmetatable top\n  setfield registryindex HsLua.Aeson.jsonarray\n  Lua.pop 1\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Orphans.hs",
    "content": "{-# OPTIONS_GHC -fno-warn-orphans #-}\n{-# LANGUAGE FlexibleInstances    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Orphans\n   Copyright   : © 2012-2024 John MacFarlane\n                 © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nOrphan instances for Lua's Pushable and Peekable type classes.\n-}\nmodule Text.Pandoc.Lua.Orphans () where\n\nimport Data.Version (Version)\nimport HsLua\nimport HsLua.Module.Version (peekVersionFuzzy)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Lua.Marshal.AST\nimport Text.Pandoc.Lua.Marshal.CommonState ()\nimport Text.Pandoc.Lua.Marshal.Context ()\nimport Text.Pandoc.Lua.Marshal.PandocError()\nimport Text.Pandoc.Lua.Marshal.ReaderOptions ()\nimport Text.Pandoc.Lua.Marshal.Sources (pushSources)\nimport Text.Pandoc.Sources (Sources)\n\ninstance Pushable Pandoc where\n  push = pushPandoc\n\ninstance Pushable Meta where\n  push = pushMeta\n\ninstance Pushable MetaValue where\n  push = pushMetaValue\n\ninstance Pushable Block where\n  push = pushBlock\n\ninstance {-# OVERLAPPING #-} Pushable [Block] where\n  push = pushBlocks\n\ninstance Pushable Alignment where\n  push = pushString . show\n\ninstance Pushable CitationMode where\n  push = pushCitationMode\n\ninstance Pushable Format where\n  push = pushFormat\n\ninstance Pushable ListNumberDelim where\n  push = pushString . show\n\ninstance Pushable ListNumberStyle where\n  push = pushString . show\n\ninstance Pushable MathType where\n  push = pushMathType\n\ninstance Pushable QuoteType where\n  push = pushQuoteType\n\ninstance Pushable Cell where\n  push = pushCell\n\ninstance Pushable Inline where\n  push = pushInline\n\ninstance {-# OVERLAPPING #-} Pushable [Inline] where\n  push = pushInlines\n\ninstance Pushable Citation where\n  push = pushCitation\n\ninstance Pushable Row where\n  push = pushRow\n\ninstance Pushable TableBody where\n  push = pushTableBody\n\ninstance Pushable TableFoot where\n  push = pushTableFoot\n\ninstance Pushable TableHead where\n  push = pushTableHead\n\n-- These instances exist only for testing. It's a hack to avoid making\n-- the marshalling modules public.\ninstance Peekable Inline where\n  safepeek = peekInline\n\ninstance Peekable Block where\n  safepeek = peekBlock\n\ninstance Peekable Cell where\n  safepeek = peekCell\n\ninstance Peekable Meta where\n  safepeek = peekMeta\n\ninstance Peekable Pandoc where\n  safepeek = peekPandoc\n\ninstance Peekable Row where\n  safepeek = peekRow\n\ninstance Peekable Version where\n  safepeek = peekVersionFuzzy\n\ninstance {-# OVERLAPPING #-} Peekable Attr where\n  safepeek = peekAttr\n\ninstance Pushable Sources where\n  push = pushSources\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/PandocLua.hs",
    "content": "{-# LANGUAGE DeriveFunctor #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n{- |\n   Module      : Text.Pandoc.Lua.PandocLua\n   Copyright   : © 2020-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nPandocMonad instance which allows execution of Lua operations and which\nuses Lua to handle state.\n-}\nmodule Text.Pandoc.Lua.PandocLua\n  ( PandocLua (..)\n  , liftPandocLua\n  ) where\n\nimport Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow)\nimport Control.Monad.Except (MonadError (catchError, throwError))\nimport Control.Monad.IO.Class (MonadIO)\nimport HsLua as Lua\nimport Text.Pandoc.Class (PandocMonad (..))\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Lua.Marshal.CommonState (peekCommonState, pushCommonState)\nimport Text.Pandoc.Lua.Marshal.PandocError (peekPandocError, pushPandocError)\n\nimport qualified Control.Monad.Catch as Catch\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Class.IO as IO\n\n-- | Type providing access to both, pandoc and Lua operations.\nnewtype PandocLua a = PandocLua { unPandocLua :: LuaE PandocError a }\n  deriving\n    ( Applicative\n    , Functor\n    , Monad\n    , MonadCatch\n    , MonadIO\n    , MonadMask\n    , MonadThrow\n    )\n\n-- | Lift a @'Lua'@ operation into the @'PandocLua'@ type.\nliftPandocLua :: LuaE PandocError a -> PandocLua a\nliftPandocLua = PandocLua\n\ninstance {-# OVERLAPPING #-} Exposable PandocError (PandocLua NumResults) where\n  partialApply _narg = liftLua . unPandocLua\n\ninstance Pushable a => Exposable PandocError (PandocLua a) where\n  partialApply _narg x = 1 <$ (liftLua (unPandocLua x >>= Lua.push))\n\ninstance MonadError PandocError PandocLua where\n  catchError = Catch.catch\n  throwError = Catch.throwM\n\ninstance PandocMonad PandocLua where\n  lookupEnv = IO.lookupEnv\n  getCurrentTime = IO.getCurrentTime\n  getCurrentTimeZone = IO.getCurrentTimeZone\n  newStdGen = IO.newStdGen\n  newUniqueHash = IO.newUniqueHash\n\n  openURL = IO.openURL\n\n  readFileLazy = IO.readFileLazy\n  readFileStrict = IO.readFileStrict\n  readStdinStrict = IO.readStdinStrict\n\n  glob = IO.glob\n  fileExists = IO.fileExists\n  getDataFileName = IO.getDataFileName\n  getModificationTime = IO.getModificationTime\n\n  getCommonState = PandocLua $ do\n    Lua.getfield registryindex \"PANDOC_STATE\"\n    forcePeek $ peekCommonState Lua.top `lastly` pop 1\n  putCommonState cst = PandocLua $ do\n    pushCommonState cst\n    Lua.setfield registryindex \"PANDOC_STATE\"\n\n  logOutput = IO.logOutput\n\n-- | Retrieve a @'PandocError'@ from the Lua stack.\npopPandocError :: LuaE PandocError PandocError\npopPandocError = do\n  errResult <- runPeek $ peekPandocError top `lastly` pop 1\n  case resultToEither errResult of\n    Right x  -> return x\n    Left err -> return $ PandocLuaError (T.pack err)\n\n-- | Conversions between Lua errors and 'PandocError' exceptions.\ninstance LuaError PandocError where\n  popException = popPandocError\n  pushException = pushPandocError\n  luaException = PandocLuaError . T.pack\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Run.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RankNTypes        #-}\n{- |\n   Module      : Text.Pandoc.Lua.Run\n   Copyright   : Copyright © 2017-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nRun code in the Lua interpreter.\n-}\nmodule Text.Pandoc.Lua.Run\n  ( runLua\n  , runLuaNoEnv\n  , runLuaWith\n  ) where\n\nimport Control.Monad.Catch (try)\nimport Control.Monad.Trans (MonadIO (..))\nimport HsLua as Lua hiding (try)\nimport Text.Pandoc.Class (PandocMonad (..))\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Lua.Global (Global (..), setGlobals)\nimport Text.Pandoc.Lua.Init (initLua)\nimport Text.Pandoc.Lua.PandocLua (PandocLua (..), liftPandocLua)\n\n-- | Run the Lua interpreter, using pandoc's default way of environment\n-- initialization.\nrunLua :: (PandocMonad m, MonadIO m)\n       => LuaE PandocError a -> m (Either PandocError a)\nrunLua action = do\n  runPandocLuaWith Lua.run . try $ do\n    initLua\n    liftPandocLua action\n\nrunLuaWith :: (PandocMonad m, MonadIO m)\n           => GCManagedState -> LuaE PandocError a -> m (Either PandocError a)\nrunLuaWith luaState action = do\n  runPandocLuaWith (withGCManagedState luaState) . try $ do\n    initLua\n    liftPandocLua action\n\n-- | Like 'runLua', but ignores all environment variables like @LUA_PATH@.\nrunLuaNoEnv :: (PandocMonad m, MonadIO m)\n            => LuaE PandocError a -> m (Either PandocError a)\nrunLuaNoEnv action = do\n  runPandocLuaWith Lua.run . try $ do\n    liftPandocLua $ do\n      -- This is undocumented, but works -- the code is adapted from the\n      -- `lua.c` sources for the default interpreter.\n      Lua.pushboolean True\n      Lua.setfield Lua.registryindex \"LUA_NOENV\"\n    initLua\n    liftPandocLua action\n\n-- | Evaluate a @'PandocLua'@ computation, running all contained Lua\n-- operations.\nrunPandocLuaWith :: (PandocMonad m, MonadIO m)\n                 => (forall b. LuaE PandocError b -> IO b)\n                 -> PandocLua a\n                 -> m a\nrunPandocLuaWith runner pLua = do\n  origState <- getCommonState\n  let globals = defaultGlobals\n  (result, newState) <- liftIO . runner . unPandocLua $ do\n    putCommonState origState\n    liftPandocLua $ setGlobals globals\n    r <- pLua\n    c <- getCommonState\n    return (r, c)\n  putCommonState newState\n  return result\n\n-- | Global variables which should always be set.\ndefaultGlobals :: [Global]\ndefaultGlobals =\n  [ PANDOC_API_VERSION\n  , PANDOC_STATE\n  , PANDOC_VERSION\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/SourcePos.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Lua.SourcePos\n   Copyright   : © 2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nHelper function to retrieve the 'SourcePos' in a Lua script.\n-}\nmodule Text.Pandoc.Lua.SourcePos\n  ( luaSourcePos\n  ) where\n\nimport HsLua\nimport Text.Parsec.Pos (SourcePos, newPos)\nimport Text.Read (readMaybe)\nimport qualified Data.Text as T\nimport qualified HsLua.Core.Utf8 as UTF8\n\n-- | Returns the current position in a Lua script.\n--\n-- The reporting level is the level of the call stack, for which the\n-- position should be reported. There might not always be a position\n-- available, e.g., in C functions.\nluaSourcePos :: LuaError e\n             => Int                -- ^ reporting level\n             -> LuaE e (Maybe SourcePos)\nluaSourcePos lvl = do\n  -- reporting levels:\n  -- 0: this hook,\n  -- 1: userdata wrapper function for the hook,\n  -- 2: warn,\n  -- 3: function calling warn.\n  where' lvl\n  locStr <- UTF8.toText <$> tostring' top\n  return $ do\n    (prfx, sfx) <- T.breakOnEnd \":\" <$> T.stripSuffix \": \" locStr\n    (source, _) <- T.unsnoc prfx\n    line <- readMaybe (T.unpack sfx)\n    -- We have no column information, so always use column 1\n    Just $ newPos (T.unpack source) line 1\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Writer/Classic.hs",
    "content": "{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE FlexibleInstances   #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Text.Pandoc.Lua.Writer.Classic\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of Pandoc documents using a \\\"classic\\\" custom Lua writer.\n-}\nmodule Text.Pandoc.Lua.Writer.Classic\n  ( runCustom\n  ) where\nimport Control.Applicative (optional)\nimport Control.Arrow ((***))\nimport Data.List (intersperse)\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Text as T\nimport Data.Text (Text, pack)\nimport HsLua as Lua hiding (Operation (Div))\n#if !MIN_VERSION_hslua(2,2,0)\nimport HsLua.Aeson (peekViaJSON)\n#endif\nimport Text.DocLayout (literal, render)\nimport Text.DocTemplates (Context)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Lua.Marshal.Attr (pushAttributeList)\nimport Text.Pandoc.Lua.Orphans ()\nimport Text.Pandoc.Options\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\n\n-- | List of key-value pairs that is pushed to Lua as AttributeList\n-- userdata.\nnewtype AttributeList = AttributeList [(Text, Text)]\ninstance Pushable AttributeList where\n  push (AttributeList kvs) = pushAttributeList kvs\n\nattrToMap :: Attr -> AttributeList\nattrToMap (id',classes,keyvals) = AttributeList\n    $ (\"id\", id')\n    : (\"class\", T.unwords classes)\n    : keyvals\n\nnewtype Stringify a = Stringify a\n\ninstance Pushable (Stringify Format) where\n  push (Stringify (Format f)) = Lua.push (T.toLower f)\n\ninstance Pushable (Stringify [Inline]) where\n  push (Stringify ils) = Lua.push =<< inlineListToCustom ils\n\ninstance Pushable (Stringify [Block]) where\n  push (Stringify blks) = Lua.push =<< blockListToCustom blks\n\ninstance Pushable (Stringify MetaValue) where\n  push (Stringify (MetaMap m))       = Lua.push (fmap Stringify m)\n  push (Stringify (MetaList xs))     = Lua.push (map Stringify xs)\n  push (Stringify (MetaBool x))      = Lua.push x\n  push (Stringify (MetaString s))    = Lua.push s\n  push (Stringify (MetaInlines ils)) = Lua.push (Stringify ils)\n  push (Stringify (MetaBlocks bs))   = Lua.push (Stringify bs)\n\ninstance Pushable (Stringify Citation) where\n  push (Stringify cit) = pushAsTable\n    [ (\"citationId\", push . citationId)\n    , (\"citationPrefix\",  push . Stringify . citationPrefix)\n    , (\"citationSuffix\",  push . Stringify . citationSuffix)\n    , (\"citationMode\",    push . citationMode)\n    , (\"citationNoteNum\", push . citationNoteNum)\n    , (\"citationHash\",    push . citationHash)\n    ]\n    cit\n\n-- | Key-value pair, pushed as a table with @a@ as the only key and @v@ as the\n-- associated value.\nnewtype KeyValue a b = KeyValue (a, b)\n\ninstance (Pushable a, Pushable b) => Pushable (KeyValue a b) where\n  push (KeyValue (k, v)) = do\n    Lua.newtable\n    Lua.push k\n    Lua.push v\n    Lua.rawset (Lua.nth 3)\n\n-- | Convert Pandoc to custom markup using a classic Lua writer.\nrunCustom :: LuaError e\n          => WriterOptions\n          -> Pandoc\n          -> LuaE e Text\nrunCustom opts doc@(Pandoc meta _) = do\n  (body, context) <- docToCustom opts doc\n  -- convert metavalues to a template context (variables)\n  metaContext <- metaToContext opts\n                   (fmap (literal . pack) . blockListToCustom)\n                   (fmap (literal . pack) . inlineListToCustom)\n                   meta\n  -- merge contexts from metadata and variables\n  let renderContext = context <> metaContext\n  return $ case writerTemplate opts of\n    Nothing  -> body\n    Just tpl -> render Nothing $\n                renderTemplate tpl $ setField \"body\" body renderContext\n\n-- | Converts a Pandoc value to custom markup using a classic Lua writer.\ndocToCustom :: forall e. LuaError e\n            => WriterOptions -> Pandoc -> LuaE e (Text, Context Text)\ndocToCustom opts (Pandoc (Meta metamap) blocks) = do\n  body <- blockListToCustom blocks\n  -- invoke doesn't work with multiple return values, so we have to call\n  -- `Doc` manually.\n  Lua.getglobal \"Doc\"                 -- function\n  push body                           -- argument 1\n  push (fmap Stringify  metamap)      -- argument 2\n  push (writerVariables opts)         -- argument 3\n  call 3 2\n  rendered  <- peek (nth 2)       -- first return value\n  context <- forcePeek . optional $ peekViaJSON top  -- snd return value\n  return (rendered, fromMaybe mempty context)\n\n\n-- | Convert Pandoc block element to Custom.\nblockToCustom :: forall e. LuaError e\n              => Block         -- ^ Block element\n              -> LuaE e String\n\nblockToCustom (Plain inlines) = invoke \"Plain\" (Stringify inlines)\n\nblockToCustom (Para [Image attr txt (src,tit)]) =\n  invoke \"CaptionedImage\" src tit (Stringify txt) (attrToMap attr)\n\nblockToCustom (Para inlines) = invoke \"Para\" (Stringify inlines)\n\nblockToCustom (LineBlock linesList) =\n  invoke \"LineBlock\" (map (Stringify) linesList)\n\nblockToCustom (RawBlock format str) =\n  invoke \"RawBlock\" (Stringify format) str\n\nblockToCustom HorizontalRule = invoke \"HorizontalRule\"\n\nblockToCustom (Header level attr inlines) =\n  invoke \"Header\" level (Stringify inlines) (attrToMap attr)\n\nblockToCustom (CodeBlock attr str) =\n  invoke \"CodeBlock\" str (attrToMap attr)\n\nblockToCustom (BlockQuote blocks) =\n  invoke \"BlockQuote\" (Stringify blocks)\n\nblockToCustom (Figure attr (Caption _ cbody) content) =\n  invoke \"Figure\"\n    (Stringify cbody)\n    (Stringify content)\n    (attrToMap attr)\n\nblockToCustom (Table _ blkCapt specs thead tbody tfoot) =\n  let (capt, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n      aligns' = map show aligns\n      capt' = Stringify capt\n      headers' = map (Stringify) headers\n      rows' = map (map (Stringify)) rows\n  in invoke \"Table\" capt' aligns' widths headers' rows'\n\nblockToCustom (BulletList items) =\n  invoke \"BulletList\" (map (Stringify) items)\n\nblockToCustom (OrderedList (num,sty,delim) items) =\n  invoke \"OrderedList\" (map (Stringify) items) num (show sty) (show delim)\n\nblockToCustom (DefinitionList items) =\n  invoke \"DefinitionList\"\n               (map (KeyValue . (Stringify *** map (Stringify))) items)\n\nblockToCustom (Div attr items) =\n  invoke \"Div\" (Stringify items) (attrToMap attr)\n\n-- | Convert list of Pandoc block elements to Custom.\nblockListToCustom :: forall e. LuaError e\n                  => [Block]       -- ^ List of block elements\n                  -> LuaE e String\nblockListToCustom xs = do\n  blocksep <- invoke \"Blocksep\"\n  bs <- mapM blockToCustom xs\n  return $ mconcat $ intersperse blocksep bs\n\n-- | Convert list of Pandoc inline elements to Custom.\ninlineListToCustom :: forall e. LuaError e => [Inline] -> LuaE e String\ninlineListToCustom lst = do\n  xs <- mapM (inlineToCustom @e) lst\n  return $ mconcat xs\n\n-- | Convert Pandoc inline element to Custom.\ninlineToCustom :: forall e. LuaError e => Inline -> LuaE e String\n\ninlineToCustom (Str str) = invoke \"Str\" str\n\ninlineToCustom Space = invoke \"Space\"\n\ninlineToCustom SoftBreak = invoke \"SoftBreak\"\n\ninlineToCustom (Emph lst) = invoke \"Emph\" (Stringify lst)\n\ninlineToCustom (Underline lst) = invoke \"Underline\" (Stringify lst)\n\ninlineToCustom (Strong lst) = invoke \"Strong\" (Stringify lst)\n\ninlineToCustom (Strikeout lst) = invoke \"Strikeout\" (Stringify lst)\n\ninlineToCustom (Superscript lst) = invoke \"Superscript\" (Stringify lst)\n\ninlineToCustom (Subscript lst) = invoke \"Subscript\" (Stringify lst)\n\ninlineToCustom (SmallCaps lst) = invoke \"SmallCaps\" (Stringify lst)\n\ninlineToCustom (Quoted SingleQuote lst) =\n  invoke \"SingleQuoted\" (Stringify lst)\n\ninlineToCustom (Quoted DoubleQuote lst) =\n  invoke \"DoubleQuoted\" (Stringify lst)\n\ninlineToCustom (Cite cs lst) =\n  invoke \"Cite\" (Stringify lst) (map (Stringify) cs)\n\ninlineToCustom (Code attr str) =\n  invoke \"Code\" str (attrToMap attr)\n\ninlineToCustom (Math DisplayMath str) =\n  invoke \"DisplayMath\" str\n\ninlineToCustom (Math InlineMath str) =\n  invoke \"InlineMath\" str\n\ninlineToCustom (RawInline format str) =\n  invoke \"RawInline\" (Stringify format) str\n\ninlineToCustom LineBreak = invoke \"LineBreak\"\n\ninlineToCustom (Link attr txt (src,tit)) =\n  invoke \"Link\" (Stringify txt) src tit (attrToMap attr)\n\ninlineToCustom (Image attr alt (src,tit)) =\n  invoke \"Image\" (Stringify alt) src tit (attrToMap attr)\n\ninlineToCustom (Note contents) = invoke \"Note\" (Stringify contents)\n\ninlineToCustom (Span attr items) =\n  invoke \"Span\" (Stringify items) (attrToMap attr)\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua/Writer/Scaffolding.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Lua.Writer.Scaffolding\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nConversion of Pandoc documents using a custom Lua writer.\n-}\nmodule Text.Pandoc.Lua.Writer.Scaffolding\n  ( pushWriterScaffolding\n  ) where\n\nimport Control.Monad ((<$!>), void)\nimport Data.ByteString (ByteString)\nimport Data.Data (dataTypeConstrs, dataTypeOf, showConstr, toConstr)\nimport Data.Default (def)\nimport Data.List (intersperse)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport Data.String (IsString (fromString))\nimport HsLua\nimport HsLua.Module.DocLayout (peekDoc, pushDoc)\nimport Text.DocLayout (Doc, blankline, render)\nimport Text.DocTemplates (Context)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Options (WriterOptions (..), WrapOption(..))\nimport Text.Pandoc.Lua.PandocLua ()\nimport Text.Pandoc.Lua.Marshal.AST\nimport Text.Pandoc.Lua.Marshal.Context (peekContext)\nimport Text.Pandoc.Lua.Marshal.WriterOptions ( peekWriterOptions\n                                             , pushWriterOptions)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared (metaToContext, setField)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.UTF8 as UTF8\n\n-- | Convert Pandoc to custom markup.\npushWriterScaffolding :: LuaE PandocError NumResults\npushWriterScaffolding = do\n  newtable\n    *> pushWriterMT *> setmetatable (nth 2)\n  writer <- toWriterTable top\n  addField \"Blocks\"  $ pushDocumentedFunction (blocksFn writer)\n  addField \"Inlines\" $ pushDocumentedFunction (inlinesFn writer)\n  addField \"Block\"   $ newtable *> pushBlockMT  writer *> setmetatable (nth 2)\n  addField \"Inline\"  $ newtable *> pushInlineMT writer *> setmetatable (nth 2)\n  addField \"Pandoc\"  $ pushDocumentedFunction $ lambda\n    ### (\\(Pandoc _ blks) -> do\n            pushWriterTable writer\n            getfield' top \"Blocks\"\n            pushBlocks blks\n            callTrace 1 1\n            pure (NumResults 1))\n    <#> parameter peekPandoc \"Pandoc\" \"doc\" \"\"\n    =?> \"rendered doc\"\n  freeWriter writer\n  return 1\n where\n  blocksFn w = lambda\n    ### (\\blocks msep -> blockListToCustom w msep blocks)\n    <#> parameter peekBlocks \"Blocks\" \"blocks\" \"\"\n    <#> opt (parameter peekDocFuzzy \"Doc\" \"sep\" \"\")\n    =#> functionResult pushDoc \"Doc\" \"\"\n  inlinesFn w = lambda\n    ### inlineListToCustom w\n    <#> parameter peekInlines \"Inlines\" \"inlines\" \"\"\n    =#> functionResult pushDoc \"Doc\" \"\"\n  pushBlockMT writer = do\n    newtable\n    addField \"__call\" $ pushDocumentedFunction $ lambda\n      ### blockToCustom\n      <#> parameter peekWriter \"table\" \"writer\" \"\"\n      <#> parameter peekBlockFuzzy \"Block\" \"block\" \"\"\n      =#> functionResult pushDoc \"Doc\" \"rendered blocks\"\n    addField \"__index\" $\n      -- lookup missing fields in the main Writer table\n      pushWriterTable writer\n  pushInlineMT writer = do\n    newtable\n    addField \"__call\" $ pushDocumentedFunction $ lambda\n      ### inlineToCustom\n      <#> parameter peekWriter \"table\" \"writer\" \"\"\n      <#> parameter peekInlineFuzzy \"Inline\" \"inline\" \"\"\n      =#> functionResult pushDoc \"Doc\" \"rendered inline\"\n    addField \"__index\" $ do\n      -- lookup missing fields in the main Writer table\n      pushWriterTable writer\n\npushWriterMT :: LuaE PandocError ()\npushWriterMT = do\n  newtable\n  addField \"__call\" $ pushDocumentedFunction $ lambda\n    ### (\\writer doc mopts -> runWriter writer doc mopts)\n    <#> parameter peekWriter \"table\" \"writer\" \"\"\n    <#> parameter peekPandoc \"Pandoc\" \"doc\" \"\"\n    <#> opt (parameter peekWriterOptions \"WriterOptions\" \"opts\" \"\")\n    =#> functionResult pushText \"string\" \"rendered document\"\n  addField \"__index\" . pushDocumentedFunction $ lambda\n    ### (\\_writer key -> handleMissingField key)\n    <#> parameter pure \"table\"  \"writer\" \"\"\n    <#> parameter (liftLua . tostring') \"string\" \"key\" \"\"\n    =#> functionResult (const pushnil) \"string\" \"\"\n\n\naddField :: LuaError e => Name -> LuaE e a -> LuaE e ()\naddField name action = do\n  pushName name\n  action\n  rawset (nth 3)\n\ngetfield' :: LuaError e => StackIndex -> Name -> LuaE e HsLua.Type\ngetfield' idx name = do\n  aidx <- absindex idx\n  pushName name\n  rawget aidx >>= \\case\n    TypeNil -> pop 1 *> getfield aidx name\n    ty      -> pure ty\n\n-- | A writer table is just an absolute stack index.\nnewtype WriterTable = WriterTable Reference\n\ntoWriterTable :: LuaError e => StackIndex -> LuaE e WriterTable\ntoWriterTable idx = WriterTable <$!> do\n  pushvalue idx\n  ref registryindex\n\npeekWriter :: LuaError e => Peeker e WriterTable\npeekWriter = liftLua . toWriterTable\n\npushWriterTable :: LuaError e => Pusher e WriterTable\npushWriterTable (WriterTable wref) = void $ getref registryindex wref\n\nwriterOptionsField :: Name\nwriterOptionsField = \"Pandoc Writer WriterOptions\"\n\nfreeWriter :: WriterTable -> LuaE e ()\nfreeWriter (WriterTable wref) = unref registryindex wref\n\npushOpts :: LuaE PandocError ()\npushOpts = void $ getfield' registryindex writerOptionsField\n\nrunWriter :: WriterTable -> Pandoc -> Maybe WriterOptions\n          -> LuaE PandocError Text\nrunWriter writer doc@(Pandoc meta _blks) mopts = do\n  let opts = fromMaybe def mopts\n  pushWriterOptions opts *>\n    setfield registryindex writerOptionsField\n\n  (body, mcontext) <- runPeek (pandocToCustom writer doc) >>= force . \\case\n    Failure msg contexts -> Failure (cleanupTrace msg) contexts\n    s -> s\n\n  -- convert metavalues to a template context (variables)\n  defaultContext <- metaToContext opts\n                    (blockListToCustom writer Nothing)\n                    (inlineListToCustom writer)\n                    meta\n  let context = setField \"body\" body\n              $ fromMaybe defaultContext mcontext\n\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> body\n       Just tpl -> renderTemplate tpl context\n\n-- | Keep exactly one traceback and clean it up. This wouldn't be\n-- necessary if the @pcallTrace@ function would do nothing whenever the\n-- error already included a trace, but that would require some bigger\n-- changes; removing the additional traces in this post-process step is\n-- much easier (for now).\ncleanupTrace :: ByteString -> ByteString\ncleanupTrace msg = UTF8.fromText . T.intercalate \"\\n\" $\n  let tmsg = T.lines $ UTF8.toText msg\n      traceStart = (== \"stack traceback:\")\n  in case break traceStart tmsg of\n        (x, t:traces) -> (x <>) . (t:) $\n                         let (firstTrace, rest) = break traceStart traces\n                             isPeekContext = (\"\\twhile \" `T.isPrefixOf`)\n                             isUnknownCFn = (== \"\\t[C]: in ?\")\n                         in filter (not . isUnknownCFn) firstTrace <>\n                            filter isPeekContext rest\n        _ -> tmsg\n\n-- | Pushes the field in the writer table.\ngetWriterField :: LuaError e\n               => WriterTable -> Name -> LuaE e HsLua.Type\ngetWriterField writer name = do\n  pushWriterTable writer\n  getfield' top name <* remove (nth 2)\n\n-- | Looks up @Writer.subtable.field@; tries @Writer.field@ as a fallback if the\n-- subtable field is @nil@.\ngetNestedWriterField :: LuaError e\n                     => WriterTable -> Name -> Name -> LuaE e HsLua.Type\ngetNestedWriterField writer subtable field = do\n  pushWriterTable writer\n  getfield' top subtable >>= \\case\n    TypeNil -> TypeNil <$ remove (nth 2) -- remove Writer table\n    _       -> getfield' top field\n               -- remove Writer and subtable\n               <* remove (nth 3) <* remove (nth 2)\n\npandocToCustom :: WriterTable -> Pandoc\n               -> Peek PandocError (Doc Text, Maybe (Context Text))\npandocToCustom writer doc = withContext \"rendering Pandoc\" $ do\n  callStatus <- liftLua $ do\n    getWriterField writer \"Pandoc\"\n    pushPandoc doc\n    pushOpts\n    pcallTrace 2 2\n  case callStatus of\n    OK -> ((,) <$> peekDocFuzzy (nth 2) <*> orNil peekContext top)\n          `lastly` pop 2\n    _  -> failPeek =<< liftLua (tostring' top)\n\nblockToCustom :: WriterTable -> Block -> LuaE PandocError (Doc Text)\nblockToCustom writer blk = forcePeek $ renderBlock writer blk\n\nrenderBlock :: WriterTable -> Block -> Peek PandocError (Doc Text)\nrenderBlock writer blk = do\n  let constrName = fromString . showConstr . toConstr $ blk\n  withContext (\"rendering Block `\" <> constrName <> \"`\") $\n    liftLua (getNestedWriterField writer \"Block\" constrName) >>= \\case\n      TypeNil -> failPeek =<< typeMismatchMessage \"function or Doc\" top\n      _       -> callOrDoc (pushBlock blk)\n\ninlineToCustom :: WriterTable -> Inline -> LuaE PandocError (Doc Text)\ninlineToCustom writer inln = forcePeek $ renderInline writer inln\n\nrenderInline :: WriterTable -> Inline -> Peek PandocError (Doc Text)\nrenderInline writer inln = do\n  let constrName = fromString . showConstr . toConstr $ inln\n  withContext (\"rendering Inline `\" <> constrName <> \"`\") $ do\n    liftLua (getNestedWriterField writer \"Inline\" constrName) >>= \\case\n      TypeNil -> failPeek =<< typeMismatchMessage \"function or Doc\" top\n      _       -> callOrDoc (pushInline inln)\n\n-- | If the value at the top of the stack can be called as a function,\n-- then push the element and writer options to the stack and call it;\n-- otherwise treat it as a plain Doc value\ncallOrDoc :: LuaE PandocError ()\n          -> Peek PandocError (Doc Text)\ncallOrDoc pushElement = do\n  liftLua (ltype top) >>= \\case\n    TypeFunction -> peekCall\n    _            ->\n      liftLua (getmetafield top \"__call\") >>= \\case\n        TypeNil -> peekDocFuzzy top\n        _       -> liftLua (pop 1) *> peekCall\n where\n   peekCall :: Peek PandocError (Doc Text)\n   peekCall =\n     liftLua (pushElement *> pushOpts *> pcallTrace 2 1) >>= \\case\n       OK -> peekDocFuzzy top\n       _  -> failPeek =<< liftLua (tostring' top)\n\nblockListToCustom :: WriterTable -> Maybe (Doc Text) -> [Block]\n                  -> LuaE PandocError (Doc Text)\nblockListToCustom writer msep blocks = forcePeek $\n  renderBlockList writer msep blocks\n\ninlineListToCustom :: WriterTable -> [Inline] -> LuaE PandocError (Doc Text)\ninlineListToCustom writer inlines = forcePeek $\n  renderInlineList writer inlines\n\nrenderBlockList :: WriterTable -> Maybe (Doc Text) -> [Block]\n                -> Peek PandocError (Doc Text)\nrenderBlockList writer msep blocks = withContext \"rendering Blocks\" $ do\n  let addSeps = intersperse $ fromMaybe blankline msep\n  mconcat . addSeps <$> mapM (renderBlock writer) blocks\n\nrenderInlineList :: WriterTable -> [Inline] -> Peek PandocError (Doc Text)\nrenderInlineList writer inlines = withContext \"rendering Inlines\" $ do\n  mconcat <$> mapM (renderInline writer) inlines\n\norNil :: Peeker e a -> Peeker e (Maybe a)\norNil p idx = liftLua (ltype idx) >>= \\case\n  TypeNil  -> pure Nothing\n  TypeNone -> pure Nothing\n  _        -> Just <$> p idx\n\npeekDocFuzzy :: LuaError e => Peeker e (Doc Text)\npeekDocFuzzy idx = liftLua (ltype idx) >>= \\case\n  TypeTable -> mconcat <$!> peekList peekDoc idx\n  _         -> peekDoc idx\n\nhandleMissingField :: LuaError e => ByteString -> LuaE e ()\nhandleMissingField key' =\n  let key = UTF8.toString key'\n      blockNames  = map (fromString . show) . dataTypeConstrs . dataTypeOf\n                      $ HorizontalRule\n      inlineNames = map (fromString . show) . dataTypeConstrs . dataTypeOf\n                      $ Space\n      mtypeName = case () of\n       _ | key `elem` blockNames  -> Just \"Block\"\n       _ | key `elem` inlineNames -> Just \"Inline\"\n       _                          -> Nothing\n  in case mtypeName of\n       Just typeName  -> failLua $\n                         \"No render function for \" <> typeName <> \" value \" <>\n                         \"'\" <> key <> \"';\\ndefine a function `Writer.\" <>\n                         typeName <> \".\" <> key <> \"` that returns \" <>\n                         \"a string or Doc.\"\n       _ -> pure ()\n"
  },
  {
    "path": "pandoc-lua-engine/src/Text/Pandoc/Lua.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Lua\n   Copyright   : Copyright © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n\nRunning pandoc Lua filters.\n-}\nmodule Text.Pandoc.Lua\n  ( -- * High-level functions\n    applyFilter\n  , loadCustom\n  -- * Low-level functions\n  , Global(..)\n  , setGlobals\n  , runLua\n  , runLuaNoEnv\n  -- * Engine\n  , getEngine\n  ) where\n\nimport Text.Pandoc.Lua.Custom (loadCustom)\nimport Text.Pandoc.Lua.Engine (getEngine, applyFilter)\nimport Text.Pandoc.Lua.Global (Global (..), setGlobals)\nimport Text.Pandoc.Lua.Run (runLua, runLuaNoEnv)\nimport Text.Pandoc.Lua.Orphans ()\n"
  },
  {
    "path": "pandoc-lua-engine/test/Tests/Lua/Module.hs",
    "content": "{- |\nModule      : Tests.Lua.Module\nCopyright   : © 2019-2024 Albert Krewinkel\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\nStability   : alpha\nPortability : portable\n\nLua module tests\n-}\nmodule Tests.Lua.Module (tests) where\n\nimport System.FilePath ((</>))\nimport Test.Tasty (TestName, TestTree)\nimport Test.Tasty.Lua (testLuaFile)\n\nimport Tests.Lua (runLuaTest)\n\ntests :: [TestTree]\ntests =\n  [ testPandocLua \"pandoc\"\n                  (\"lua\" </> \"module\" </> \"pandoc.lua\")\n  , testPandocLua \"pandoc.List\"\n                  (\"lua\" </> \"module\" </> \"pandoc-list.lua\")\n  , testPandocLua \"pandoc.format\"\n                  (\"lua\" </> \"module\" </> \"pandoc-format.lua\")\n  , testPandocLua \"pandoc.image\"\n                  (\"lua\" </> \"module\" </> \"pandoc-image.lua\")\n  , testPandocLua \"pandoc.json\"\n                  (\"lua\" </> \"module\" </> \"pandoc-json.lua\")\n  , testPandocLua \"pandoc.log\"\n                  (\"lua\" </> \"module\" </> \"pandoc-log.lua\")\n  , testPandocLua \"pandoc.mediabag\"\n                  (\"lua\" </> \"module\" </> \"pandoc-mediabag.lua\")\n  , testPandocLua \"pandoc.path\"\n                  (\"lua\" </> \"module\" </> \"pandoc-path.lua\")\n  , testPandocLua \"pandoc.structure\"\n                  (\"lua\" </> \"module\" </> \"pandoc-structure.lua\")\n  , testPandocLua \"pandoc.template\"\n                  (\"lua\" </> \"module\" </> \"pandoc-template.lua\")\n  , testPandocLua \"pandoc.text\"\n                  (\"lua\" </> \"module\" </> \"pandoc-text.lua\")\n  , testPandocLua \"pandoc.types\"\n                  (\"lua\" </> \"module\" </> \"pandoc-types.lua\")\n  , testPandocLua \"pandoc.utils\"\n                  (\"lua\" </> \"module\" </> \"pandoc-utils.lua\")\n  , testPandocLua \"globals\"\n                  (\"lua\" </> \"module\" </> \"globals.lua\")\n  ]\n\ntestPandocLua :: TestName -> FilePath -> TestTree\ntestPandocLua = testLuaFile runLuaTest\n"
  },
  {
    "path": "pandoc-lua-engine/test/Tests/Lua/Reader.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{- |\nModule      : Tests.Lua.Reader\nCopyright   : © 2022-2024 Albert Krewinkel\nLicense     : GPL-2.0-or-later\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nTests for custom Lua readers.\n-}\nmodule Tests.Lua.Reader (tests) where\n\nimport Control.Arrow ((>>>))\nimport Data.Char (chr)\nimport Data.Default (Default (def))\nimport Text.Pandoc.Class (runIOorExplode)\nimport Text.Pandoc.Lua (loadCustom)\nimport Text.Pandoc.Readers (Reader (ByteStringReader))\nimport Text.Pandoc.Scripting (customReader)\nimport Test.Tasty (TestTree)\nimport Test.Tasty.HUnit ((@?=), testCase)\n\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\n\ntests :: [TestTree]\ntests =\n  [ testCase \"read binary to code block\" $ do\n    input <- BL.readFile \"bytestring.bin\"\n    doc <- runIOorExplode $\n      loadCustom \"bytestring-reader.lua\" >>= (customReader >>> \\case\n        Just (ByteStringReader f) -> f def input\n        _                         -> error \"Expected a bytestring reader\")\n    let bytes = mconcat $ map (B.str . T.singleton . chr) [0..255]\n    doc @?= B.doc (B.plain bytes)\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/test/Tests/Lua/Writer.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\nModule      : Tests.Lua.Writer\nCopyright   : © 2019-2024 Albert Krewinkel\nLicense     : GNU GPL, version 2 or above\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nTests for custom Lua writers.\n-}\nmodule Tests.Lua.Writer (tests) where\n\nimport Data.Default (Default (def))\nimport Data.Maybe (fromMaybe)\nimport Text.Pandoc.Class (runIOorExplode, readFileStrict)\nimport Text.Pandoc.Extensions (Extension (..), extensionsFromList)\nimport Text.Pandoc.Format (ExtensionsDiff (..), FlavoredFormat (..),\n                           applyExtensionsDiff)\nimport Text.Pandoc.Lua (loadCustom)\nimport Text.Pandoc.Options (WriterOptions (..))\nimport Text.Pandoc.Readers (readNative)\nimport Text.Pandoc.Scripting (CustomComponents (..))\nimport Text.Pandoc.Writers (Writer (ByteStringWriter, TextWriter))\nimport Test.Tasty (TestTree)\nimport Test.Tasty.Golden (goldenVsString)\nimport Test.Tasty.HUnit (testCase, (@?=))\n\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Text.Pandoc.Builder as B\nimport qualified Text.Pandoc.UTF8 as UTF8\n\ntests :: [TestTree]\ntests =\n  [ goldenVsString \"default testsuite\"\n    \"writer.custom\"\n    (runIOorExplode $ do\n        source <- UTF8.toText <$> readFileStrict \"testsuite.native\"\n        doc <- readNative def source\n        txt <- customWriter <$> loadCustom \"sample.lua\" >>= \\case\n          Just (TextWriter f) -> f def doc\n          _                   -> error \"Expected a text writer\"\n        pure $ BL.fromStrict (UTF8.fromText txt))\n\n  , goldenVsString \"tables testsuite\"\n    \"tables.custom\"\n    (runIOorExplode $ do\n        source <- UTF8.toText <$> readFileStrict \"tables.native\"\n        doc <- readNative def source\n        txt <- writeCustom \"sample.lua\" >>= \\case\n          (TextWriter f, _, _) -> f def doc\n          _            -> error \"Expected a text writer\"\n        pure $ BL.fromStrict (UTF8.fromText txt))\n\n  , goldenVsString \"bytestring writer\"\n    \"bytestring.bin\"\n    (runIOorExplode $\n        writeCustom \"bytestring.lua\" >>= \\case\n          (ByteStringWriter f, _, _) -> f def mempty\n          _                       -> error \"Expected a bytestring writer\")\n\n  , goldenVsString \"template\"\n    \"writer-template.out.txt\"\n    (runIOorExplode $ do\n        (_, _, template) <- writeCustom \"writer-template.lua\"\n        pure . BL.fromStrict . UTF8.fromText $ fromMaybe \"\" template)\n\n  , testCase \"preset extensions\" $ do\n      let format = FlavoredFormat \"extensions.lua\" mempty\n      result <- runIOorExplode $ writeCustom \"extensions.lua\" >>= \\case\n          (TextWriter write, extsConf, _) -> do\n            exts <- applyExtensionsDiff extsConf format\n            write def{writerExtensions = exts} (B.doc mempty)\n          _                        -> error \"Expected a text writer\"\n      result @?= \"smart extension is enabled;\\ncitations extension is disabled\\n\"\n  , testCase \"modified extensions\" $ do\n      let ediff = ExtensionsDiff\n            { extsToEnable = extensionsFromList [Ext_citations]\n            , extsToDisable = mempty\n            }\n      let format = FlavoredFormat \"extensions.lua\" ediff\n      result <- runIOorExplode $ writeCustom \"extensions.lua\" >>= \\case\n          (TextWriter write, extsConf, _) -> do\n            exts <- applyExtensionsDiff extsConf format\n            write def{writerExtensions = exts} (B.doc mempty)\n          _                        -> error \"Expected a text writer\"\n      result @?= \"smart extension is enabled;\\ncitations extension is enabled\\n\"\n  ]\n where\n  writeCustom fp = do\n    components <- loadCustom fp\n    let exts = fromMaybe mempty (customExtensions components)\n    case customWriter components of\n      Nothing -> error \"Expected a writer to be defined\"\n      Just w  -> return (w, exts, customTemplate components)\n"
  },
  {
    "path": "pandoc-lua-engine/test/Tests/Lua.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Tests.Lua\n   Copyright   : © 2017-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nUnit and integration tests for pandoc's Lua subsystem.\n-}\nmodule Tests.Lua ( runLuaTest, tests ) where\n\nimport HsLua as Lua hiding (Operation (Div), error)\nimport System.FilePath ((</>))\nimport Test.Tasty (TestTree, testGroup)\nimport Test.Tasty.HUnit ((@=?), Assertion, HasCallStack, assertEqual, testCase)\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder (bulletList, definitionList, displayMath, divWith,\n                            doc, doubleQuoted, emph, header, lineBlock,\n                            linebreak, math, orderedList, para, plain, rawBlock,\n                            singleQuoted, space, str, strong,\n                            HasMeta (setMeta))\nimport Text.Pandoc.Class ( runIOorExplode, setUserDataDir, setVerbosity )\nimport Text.Pandoc.Definition (Attr, Block (BlockQuote, Div, Para), Pandoc,\n                               Inline (Emph, Str), pandocTypesVersion)\nimport Text.Pandoc.Error (PandocError (PandocLuaError))\nimport Text.Pandoc.Logging (Verbosity (ERROR))\nimport Text.Pandoc.Lua (Global (..), applyFilter, runLua, setGlobals)\nimport Text.Pandoc.Options (def)\nimport Text.Pandoc.Version (pandocVersionText)\n\nimport qualified Control.Monad.Catch as Catch\nimport qualified Data.Text as T\nimport qualified Data.Text.Encoding as TE\n\ntests :: [TestTree]\ntests =\n  [ testCase \"macro expansion via filter\" $\n    assertFilterConversion \"a '{{helloworld}}' string is expanded\"\n      \"strmacro.lua\"\n      (doc . para $ str \"{{helloworld}}\")\n      (doc . para . emph $ str \"Hello, World\")\n\n  , testCase \"convert all plains to paras\" $\n    assertFilterConversion \"plains become para\"\n      \"plain-to-para.lua\"\n      (doc $ bulletList [plain (str \"alfa\"), plain (str \"bravo\")])\n      (doc $ bulletList [para (str \"alfa\"), para (str \"bravo\")])\n\n  , testCase \"convert display math to inline math\" $\n    assertFilterConversion \"display math becomes inline math\"\n      \"math.lua\"\n      (doc $ para (displayMath \"5+5\"))\n      (doc $ para (math \"5+5\"))\n\n  , testCase \"make hello world document\" $\n    assertFilterConversion \"Document contains 'Hello, World!'\"\n      \"hello-world-doc.lua\"\n      (doc . para $ str \"Hey!\" <> linebreak <> str \"What's up?\")\n      (doc . para $ str \"Hello,\" <> space <> str \"World!\")\n\n  , testCase \"implicit doc filter\" $\n    assertFilterConversion \"Document contains 'Hello, World!'\"\n      \"implicit-doc-filter.lua\"\n      (doc . plain $ linebreak)\n      (doc . para $ str \"Hello,\" <> space <> str \"World!\")\n\n  , testCase \"parse raw markdown blocks\" $\n    assertFilterConversion \"raw markdown block is converted\"\n      \"markdown-reader.lua\"\n      (doc $ rawBlock \"markdown\" \"*charly* **delta**\")\n      (doc . para $ emph \"charly\" <> space <> strong \"delta\")\n\n  , testCase \"allow shorthand functions for quote types\" $\n    assertFilterConversion \"single quoted becomes double quoted string\"\n      \"single-to-double-quoted.lua\"\n      (doc . para . singleQuoted $ str \"simple\")\n      (doc . para . doubleQuoted $ str \"simple\")\n\n  , testCase \"Count inlines via metatable catch-all\" $\n    assertFilterConversion \"filtering with metatable catch-all failed\"\n      \"metatable-catch-all.lua\"\n      (doc . para $ \"four words, three spaces\")\n      (doc . para $ str \"7\")\n\n  , testCase \"Count blocks via Block-specific catch-all\" $\n    assertFilterConversion \"filtering with Block catch-all failed\"\n      \"block-count.lua\"\n      (doc $ para \"one\" <> para \"two\")\n      (doc $ para \"2\")\n\n  , testCase \"Smart constructors\" $\n    assertFilterConversion \"smart constructors returned a wrong result\"\n      \"smart-constructors.lua\"\n      (doc $ para \"\")\n      (doc $ mconcat\n       [ bulletList [para \"Hello\", para \"World\"]\n       , definitionList [(\"foo\", [para \"placeholder\"])]\n       , lineBlock [\"Moin\", \"Welt\"]\n       , orderedList [plain \"one\", plain \"two\"]\n       ])\n\n  , testCase \"Convert header upper case\" $\n    assertFilterConversion \"converting header to upper case failed\"\n      \"uppercase-header.lua\"\n      (doc $ header 1 \"les états-unis\" <> para \"text\")\n      (doc $ header 1 \"LES ÉTATS-UNIS\" <> para \"text\")\n\n  , testCase \"Attribute lists are convenient to use\" $\n    let kv_before = [(\"one\", \"1\"), (\"two\", \"2\"), (\"three\", \"3\")]\n        kv_after  = [(\"one\", \"eins\"), (\"three\", \"3\"), (\"five\", \"5\")]\n    in assertFilterConversion \"Attr doesn't behave as expected\"\n      \"attr-test.lua\"\n      (doc $ divWith (\"\", [], kv_before) (para \"nil\"))\n      (doc $ divWith (\"\", [], kv_after) (para \"nil\"))\n\n  , testCase \"Filter list of inlines\" $\n      assertFilterConversion \"List of inlines\"\n      \"inlines-filter.lua\"\n      (doc $ para (\"Hello,\" <> linebreak <> \"World! Wassup?\"))\n      (doc $ para \"Hello, World! Wassup?\")\n\n  , testCase \"Filter list of blocks\" $\n      assertFilterConversion \"List of blocks\"\n      \"blocks-filter.lua\"\n      (doc $ para \"one.\" <> para \"two.\" <> para \"three.\")\n      (doc $ plain \"3\")\n\n  , testCase \"Filter Meta\" $\n    let setMetaBefore = setMeta \"old\" (\"old\" :: T.Text)\n                      . setMeta \"bool\" False\n        setMetaAfter  = setMeta \"new\" (\"new\" :: T.Text)\n                      . setMeta \"bool\" True\n    in assertFilterConversion \"Meta filtering\"\n      \"meta.lua\"\n      (setMetaBefore . doc $ mempty)\n      (setMetaAfter . doc $ mempty)\n\n  , testCase \"Script filename is set\" $\n    assertFilterConversion \"unexpected script name\"\n      \"script-name.lua\"\n      (doc $ para \"ignored\")\n      (doc $ para (str $ T.pack $ \"lua\" </> \"script-name.lua\"))\n\n  , testCase \"Pandoc version is set\" . runLuaTest $ do\n      Lua.getglobal \"PANDOC_VERSION\"\n      Lua.liftIO .\n        assertEqual \"pandoc version is wrong\" (TE.encodeUtf8 pandocVersionText)\n        =<< Lua.tostring' Lua.top\n\n  , testCase \"Pandoc types version is set\" . runLuaTest $ do\n      Lua.getglobal \"PANDOC_API_VERSION\"\n      Lua.liftIO . assertEqual \"pandoc-types version is wrong\" pandocTypesVersion\n        =<< Lua.peek Lua.top\n\n  , testCase \"require file\" $\n    assertFilterConversion \"requiring file failed\"\n      \"require-file.lua\"\n      (doc $ para \"ignored\")\n      (doc $ para (str . T.pack $ \"lua\" </> \"require-file.lua\"))\n\n  , testCase \"Allow singleton inline in constructors\" . runLuaTest $ do\n      Lua.liftIO . assertEqual \"Not the expected Emph\"\n        (Emph [Str \"test\"]) =<< do\n        Lua.OK <- Lua.dostring \"return pandoc.Emph\"\n        Lua.push @Inline (Str \"test\")\n        Lua.call 1 1\n        Lua.peek @Inline top\n      Lua.liftIO . assertEqual \"Unexpected element\"\n        (Para [Str \"test\"]) =<< do\n        Lua.getglobal' \"pandoc.Para\"\n        Lua.pushString \"test\"\n        Lua.call 1 1\n        Lua.peek @Block top\n      Lua.liftIO . assertEqual \"Unexptected element\"\n        (BlockQuote [Para [Str \"foo\"]]) =<< (\n        do\n          Lua.getglobal' \"pandoc.BlockQuote\"\n          Lua.push (Para [Str \"foo\"])\n          _ <- Lua.call 1 1\n          Lua.peek @Block Lua.top\n        )\n\n  , testCase \"Elements with Attr have `attr` accessor\" . runLuaTest $ do\n      Lua.push (Div (\"hi\", [\"moin\"], [])\n                [Para [Str \"ignored\"]])\n      Lua.getfield Lua.top \"attr\"\n      Lua.liftIO . assertEqual \"no accessor\" ((\"hi\", [\"moin\"], []) :: Attr)\n        =<< Lua.peek @Attr Lua.top\n\n  , testCase \"module `pandoc.system` is present\" . runLuaTest $ do\n      Lua.getglobal' \"pandoc.system\"\n      ty <- Lua.ltype Lua.top\n      Lua.liftIO $ assertEqual \"module should be a table\" Lua.TypeTable ty\n\n  , testGroup \"global modules\"\n    [ testCase \"module 'lpeg' is loaded into a global\" . runLuaTest $ do\n        s <- Lua.dostring \"assert(type(lpeg)=='table')\"\n        Lua.liftIO $ Lua.OK @=? s\n\n    , testCase \"module 're' is loaded into a global\" . runLuaTest $ do\n        s <- Lua.dostring \"assert(type(re)=='table')\"\n        Lua.liftIO $ Lua.OK @=? s\n\n    , testCase \"module 'lpeg' is available via `require`\" . runLuaTest $ do\n        s <- Lua.dostring\n              \"package.path = ''; package.cpath = ''; require 'lpeg'\"\n        Lua.liftIO $ Lua.OK @=? s\n\n    , testCase \"module 're' is available via `require`\" . runLuaTest $ do\n        s <- Lua.dostring\n               \"package.path = ''; package.cpath = ''; require 're'\"\n        Lua.liftIO $ Lua.OK @=? s\n    ]\n\n  , testCase \"informative error messages\" . runLuaTest $ do\n      Lua.pushboolean True\n      -- Lua.newtable\n      eitherPandoc <- Catch.try (peek @Pandoc Lua.top)\n      case eitherPandoc of\n        Left (PandocLuaError msg) -> do\n          let expectedMsg = \"Pandoc expected, got boolean\\n\"\n                <> \"\\twhile retrieving Pandoc\"\n          Lua.liftIO $ assertEqual \"unexpected error message\" expectedMsg msg\n        Left e -> error (\"Expected a Lua error, but got \" <> show e)\n        Right _ -> error \"Getting a Pandoc element from a bool should fail.\"\n  ]\n\nassertFilterConversion :: String -> FilePath -> Pandoc -> Pandoc -> Assertion\nassertFilterConversion msg filterPath docIn expectedDoc = do\n  actualDoc <- runIOorExplode $ do\n    setUserDataDir (Just \"../data\")\n    applyFilter def [\"HTML\"] (\"lua\" </> filterPath) docIn\n  assertEqual msg expectedDoc actualDoc\n\nrunLuaTest :: HasCallStack => Lua.LuaE PandocError a -> IO a\nrunLuaTest op = runIOorExplode $ do\n  -- Disable printing of warnings on stderr: some tests will generate\n  -- warnings, we don't want to see those messages.\n  setVerbosity ERROR\n  res <- runLua $ do\n    setGlobals [ PANDOC_WRITER_OPTIONS def ]\n    op\n  case res of\n    Left e -> error (show e)\n    Right x -> return x\n"
  },
  {
    "path": "pandoc-lua-engine/test/bytestring-reader.lua",
    "content": "function ByteStringReader (input, opts)\n  local chars = pandoc.List{}\n  for i = 1, #input do\n    chars:insert(utf8.char(input:byte(i,i)))\n  end\n  return pandoc.Pandoc(pandoc.Plain(pandoc.Str(table.concat(chars))))\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/bytestring.lua",
    "content": "function ByteStringWriter (doc, opts)\n  local buffer = {}\n  for i=0, 255 do\n    table.insert(buffer, string.char(i))\n  end\n  return table.concat(buffer, '')\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/extensions.lua",
    "content": "function Writer (doc, opts)\n  local output = 'smart extension is %s;\\ncitations extension is %s\\n'\n  local status = function (ext)\n    return opts.extensions:includes(ext) and 'enabled' or 'disabled'\n  end\n  return output:format(status('smart'), status('citations'))\nend\n\nExtensions = {\n  smart = true,\n  citations = false,\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/attr-test.lua",
    "content": "function Div (div)\n  div.attributes.five = (\"%d\"):format(div.attributes.two + div.attributes.three)\n  div.attributes.two = nil\n  div.attributes.one = \"eins\"\n  return div\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/block-count.lua",
    "content": "local num_blocks = 0\n\nfunction Block(el)\n  num_blocks = num_blocks + 1\nend\n\nfunction Pandoc(blocks, meta)\n  return pandoc.Pandoc {\n    pandoc.Para{pandoc.Str(num_blocks)}\n  }\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/blocks-filter.lua",
    "content": "function Blocks (blks)\n  -- verify that this looks like a `pandoc.List`\n  if not blks.find or not blks.map or not blks.filter then\n    error(\"table doesn't seem to be an instance of pandoc.List\")\n  end\n  -- return plain block containing the number of elements in the list\n  return {pandoc.Plain {pandoc.Str(tostring(#blks))}}\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/hello-world-doc.lua",
    "content": "return {\n  {\n    Pandoc = function(doc)\n      local meta = {}\n      local hello = { pandoc.Str \"Hello,\", pandoc.Space(), pandoc.Str \"World!\" }\n      local blocks = { pandoc.Para(hello) }\n      return pandoc.Pandoc(blocks, meta)\n    end\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/implicit-doc-filter.lua",
    "content": "function Pandoc (doc)\n  local meta = {}\n  local hello = { pandoc.Str \"Hello,\", pandoc.Space(), pandoc.Str \"World!\" }\n  local blocks = { pandoc.Para(hello) }\n  return pandoc.Pandoc(blocks, meta)\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/inlines-filter.lua",
    "content": "function isWorldAfterSpace (fst, snd)\n  return fst and fst.t == 'LineBreak'\n   and snd and snd.t == 'Str' and snd.text == 'World!'\nend\n\nfunction Inlines (inlns)\n  -- verify that this looks like a `pandoc.List`\n  if not inlns.find or not inlns.map or not inlns.filter then\n    error(\"table doesn't seem to be an instance of pandoc.List\")\n  end\n\n  -- Remove spaces before string \"World\"\n  for i = #inlns-1,1,-1 do\n    if isWorldAfterSpace(inlns[i], inlns[i+1]) then\n      inlns[i] = pandoc.Space()\n    end\n  end\n  return inlns\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/markdown-reader.lua",
    "content": "return {\n  {\n    RawBlock = function (elem)\n      if elem.format == \"markdown\" then\n        local pd = pandoc.read(elem.text, \"markdown\")\n        return pd.blocks[1]\n      else\n        return elem\n      end\n    end,\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/math.lua",
    "content": "return {\n  {\n    Math = function (elem)\n      if elem.mathtype == \"DisplayMath\" then\n        elem.mathtype = \"InlineMath\"\n      end\n      return elem\n    end,\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/meta.lua",
    "content": "function Meta (meta)\n  meta.old = nil\n  meta.new = \"new\"\n  meta.bool = (meta.bool == false)\n  return meta\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/metatable-catch-all.lua",
    "content": "local num_inlines = 0\n\nfunction catch_all(el)\n  if el.tag and pandoc.Inline.constructor[el.tag] then\n    num_inlines = num_inlines + 1\n  end\nend\n\nfunction Pandoc(blocks, meta)\n  return pandoc.Pandoc {\n    pandoc.Para{pandoc.Str(num_inlines)}\n  }\nend\n\nreturn {\n  setmetatable(\n    {Pandoc = Pandoc},\n    {__index = function(_) return catch_all end}\n  )\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/globals.lua",
    "content": "local tasty = require 'tasty'\n\nlocal test = tasty.test_case\nlocal group = tasty.test_group\nlocal assert = tasty.assert\n\n-- These tests exist mainly to catch changes to the JSON representation of\n-- WriterOptions and its components. UPDATE THE DOCS if anything changes.\nreturn {\n  group 'PANDOC_WRITER_OPTIONS' {\n    test('chunk_template', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.chunk_template), 'string')\n    end),\n    test('cite_method', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.cite_method), 'string')\n    end),\n    test('columns', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.columns), 'number')\n    end),\n    test('dpi', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.dpi), 'number')\n    end),\n    test('email_obfuscation', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.email_obfuscation), 'string')\n    end),\n    test('split_level', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.split_level), 'number')\n    end),\n    test('epub_fonts', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.epub_fonts), 'table')\n    end),\n    test('epub_metadata', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.epub_metadata), 'nil')\n    end),\n    test('epub_subdirectory', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.epub_subdirectory), 'string')\n    end),\n    test('extensions', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.extensions), 'table')\n      for _, v in ipairs(PANDOC_WRITER_OPTIONS.extensions) do\n        assert.are_equal(type(v), 'string')\n      end\n    end),\n    test('highlight_method', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.highlight_method), 'string')\n    end),\n    test('html_math_method', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.html_math_method), 'string')\n    end),\n    test('html_q_tags', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.html_q_tags), 'boolean')\n    end),\n    test('identifier_prefix', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.identifier_prefix), 'string')\n    end),\n    test('incremental', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.incremental), 'boolean')\n    end),\n    test('number_offset', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.number_offset), 'table')\n      for _, v in ipairs(PANDOC_WRITER_OPTIONS.number_offset) do\n        assert.are_equal(type(v), 'number')\n      end\n    end),\n    test('number_sections', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.number_sections), 'boolean')\n    end),\n    test('prefer_ascii', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.prefer_ascii), 'boolean')\n    end),\n    test('reference_doc', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.reference_doc), 'nil')\n    end),\n    test('reference_links', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.reference_links), 'boolean')\n    end),\n    test('reference_location', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.reference_location), 'string')\n    end),\n    test('section_divs', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.section_divs), 'boolean')\n    end),\n    test('setext_headers', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.setext_headers), 'boolean')\n    end),\n    test('slide_level', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.slide_level), 'nil')\n    end),\n    test('tab_stop', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.tab_stop), 'number')\n    end),\n    test('table_of_contents', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.table_of_contents), 'boolean')\n    end),\n    test('toc_depth', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.toc_depth), 'number')\n    end),\n    test('top_level_division', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.top_level_division), 'string')\n    end),\n    test('variables', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.variables), 'table')\n    end),\n    test('wrap_text', function ()\n      assert.are_equal(type(PANDOC_WRITER_OPTIONS.wrap_text), 'string')\n    end),\n  },\n\n  group 'PANDOC_STATE' {\n    test('is a table object', function ()\n      assert.are_equal(type(PANDOC_STATE), 'table')\n    end),\n    test('has property \"input_files\"', function ()\n      assert.are_equal(type(PANDOC_STATE.input_files), 'table')\n    end),\n    test('has optional property \"output_file\"', function ()\n      -- property may be nil\n      if PANDOC_STATE.output_file then\n        assert.are_equal(type(PANDOC_STATE.output_file), 'string')\n      end\n    end),\n    test('has property \"log\"', function ()\n      assert.are_equal(type(PANDOC_STATE.log), 'table')\n    end),\n    test('has property \"request_headers\"', function ()\n      assert.are_equal(type(PANDOC_STATE.request_headers), 'table')\n    end),\n    test('has property \"resource_path\"', function ()\n      assert.are_equal(type(PANDOC_STATE.resource_path), 'table')\n    end),\n    test('has optional property \"source_url\"', function ()\n      if PANDOC_STATE.source_url then\n        assert.are_equal(type(PANDOC_STATE.source_url), 'string')\n      end\n    end),\n    test('has property \"trace\"', function ()\n      assert.are_equal(type(PANDOC_STATE.trace), 'boolean')\n    end),\n    test('has optional property \"user_data_dir\"', function ()\n      if PANDOC_STATE.user_data_dir then\n        assert.are_equal(type(PANDOC_STATE.user_data_dir), 'string')\n      end\n    end),\n    test('has property \"verbosity\"', function ()\n      assert.are_equal(type(PANDOC_STATE.verbosity), 'string')\n    end),\n    test('can be deleted without breaking PandocLua monad functions', function()\n      local state = PANDOC_STATE\n      PANDOC_STATE = nil\n      assert.is_nil(pandoc.mediabag.lookup('does-not-exist'))\n      PANDOC_STATE = state\n    end),\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/include.tex",
    "content": "included\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-format.lua",
    "content": "local tasty = require 'tasty'\n\nlocal test = tasty.test_case\nlocal group = tasty.test_group\nlocal assert = tasty.assert\n\nlocal format = require 'pandoc.format'\n\nreturn {\n  group 'default_extensions' {\n    test('docx', function ()\n      local docx_default_exts = {\n        'auto_identifiers',\n      }\n      assert.are_same(format.default_extensions('docx'), docx_default_exts)\n    end),\n  },\n\n  group 'all_extensions' {\n    test('docx', function ()\n      local docx_default_exts = {\n        'ascii_identifiers',\n        'auto_identifiers',\n        'citations',\n        'east_asian_line_breaks',\n        'empty_paragraphs',\n        'gfm_auto_identifiers',\n        'native_numbering',\n        'styles',\n      }\n      assert.are_same(format.all_extensions('docx'), docx_default_exts)\n    end),\n  },\n\n  group 'extensions' {\n    test('org', function ()\n      local org_default_exts = {\n        ascii_identifiers = false,\n        auto_identifiers = true,\n        citations = true,\n        east_asian_line_breaks = false,\n        fancy_lists = false,\n        gfm_auto_identifiers = false,\n        smart = false,\n        smart_quotes = false,\n        special_strings = true,\n        task_lists = true,\n      }\n      assert.are_same(format.extensions 'org', org_default_exts)\n    end),\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-image.lua",
    "content": "--\n-- Tests for the system module\n--\nlocal image = require 'pandoc.image'\nlocal tasty = require 'tasty'\n\nlocal group = tasty.test_group\nlocal test = tasty.test_case\nlocal assert = tasty.assert\n\nlocal svg_image = [==[<?xml version=\"1.0\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\"\n     xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n     height=\"70\" width=\"70\"\n     viewBox=\"-35 -35 70 70\">\n  <title>test</title>\n  <!-- document shape -->\n  <polygon points=\"-10,-31.53 -10,-3.25 0,0 10,-3.25 10,-23.53 2,-31.53\" />\n</svg>\n]==]\n\nreturn {\n  -- Check existence of static fields\n  group 'static fields' {\n  },\n\n  group 'size' {\n    test('returns a table', function ()\n      local imgsize = {\n        width = 70,\n        height = 70,\n        dpi_horz = 96,\n        dpi_vert = 96,\n      }\n      assert.are_same(image.size(svg_image), imgsize)\n    end),\n    test('fails on faulty eps', function ()\n      assert.error_matches(\n        function () image.size('%!PS EPSF') end,\n        'could not determine EPS size'\n      )\n    end),\n    test('fails if input is not an image', function ()\n      assert.error_matches(\n        function () image.size('not an image') end,\n        'could not determine image type'\n      )\n    end),\n    test('respects the dpi setting', function ()\n      local imgsize = {\n        width = 70,\n        height = 70,\n        dpi_horz = 300,\n        dpi_vert = 300,\n      }\n      assert.are_same(image.size(svg_image, {dpi=300}), imgsize)\n    end),\n  },\n\n  group 'format' {\n    test('SVG', function ()\n      assert.are_equal(image.format(svg_image), 'svg')\n    end),\n    test('returns nil if input is not an image', function ()\n      assert.is_nil(image.format('not an image'))\n    end),\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-json.lua",
    "content": "--\n-- Tests for the system module\n--\nlocal pandoc = require 'pandoc'\nlocal json = require 'pandoc.json'\nlocal tasty = require 'tasty'\n\nlocal group = tasty.test_group\nlocal test = tasty.test_case\nlocal assert = tasty.assert\n\nreturn {\n  -- Check existence of static fields\n  group 'static fields' {\n    test('null', function ()\n      assert.are_equal(type(json.null), 'userdata')\n    end),\n  },\n\n  group 'encode' {\n    test('string', function ()\n      assert.are_equal(json.encode 'one\\ntwo', '\"one\\\\ntwo\"')\n    end),\n    test('null', function ()\n      assert.are_equal(json.encode(json.null), 'null')\n    end),\n    test('number', function ()\n      assert.are_equal(json.encode(42), '42')\n    end),\n    test('object', function ()\n      assert.are_same(json.encode{a = 5}, '{\"a\":5}')\n    end),\n    test('object with metamethod', function ()\n      local obj = setmetatable(\n        {title = 23},\n        {\n          __tojson = function (_)\n            return '\"Nichts ist so wie es scheint\"'\n          end\n        }\n      )\n      assert.are_same(json.encode(obj), [[\"Nichts ist so wie es scheint\"]])\n    end),\n    test('pandoc.List', function ()\n      local list = pandoc.List {'foo', 'bar', 'baz'}\n      assert.are_equal(\n        json.encode(list),\n        '[\"foo\",\"bar\",\"baz\"]'\n      )\n    end),\n    test('Inline (Space)', function ()\n           assert.are_equal(\n             json.encode(pandoc.Space()),\n             '{\"t\":\"Space\"}'\n           )\n    end),\n    test('Block (HorizontalRule)', function ()\n      assert.are_equal(\n        json.encode(pandoc.HorizontalRule()),\n        '{\"t\":\"HorizontalRule\"}'\n      )\n    end),\n    test('Inlines list', function ()\n      assert.are_equal(\n        json.encode(pandoc.Inlines{pandoc.Space()}),\n        '[{\"t\":\"Space\"}]'\n      )\n    end),\n    test('Pandoc', function ()\n      assert.are_equal(\n        type(json.encode(pandoc.Pandoc{'Hello from Lua!'})),\n        'string'\n      )\n    end),\n    test('Nested Inline', function ()\n      assert.are_equal(\n        json.encode({spc = pandoc.Space()}),\n        '{\"spc\":{\"t\":\"Space\"}}'\n      )\n    end)\n  },\n\n  group 'decode' {\n    test('string', function ()\n      assert.are_equal(json.decode '\"one\\\\ntwo\"', 'one\\ntwo')\n    end),\n    test('null', function ()\n      assert.are_equal(json.decode 'null', json.null)\n    end),\n    test('number', function ()\n      assert.are_equal(json.decode '42', 42)\n    end),\n    test('object', function ()\n      assert.are_same(json.decode '{\"a\":5}', {a = 5})\n    end),\n    test('list of strings', function ()\n      assert.are_equal(json.decode '[\"foo\", \"bar\"]', pandoc.List{\"foo\", \"bar\"})\n    end),\n    test('Inline (Space)', function ()\n      assert.are_equal(json.decode '{\"t\":\"Space\"}', pandoc.Space())\n    end),\n    test('Inline (Str)', function ()\n      assert.are_equal(json.decode '{\"t\":\"Str\", \"c\":\"a\"}', pandoc.Str 'a')\n    end),\n    test('disabled AST check', function ()\n      assert.are_same(\n        json.decode('{\"t\":\"Str\", \"c\":\"a\"}', false),\n        {t = 'Str', c = 'a'}\n      )\n    end),\n    test('Inlines list', function ()\n      assert.are_equal(\n        json.decode '[{\"t\":\"Space\"}]',\n        pandoc.Inlines{pandoc.Space()}\n      )\n    end)\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-list.lua",
    "content": "local tasty = require 'tasty'\nlocal List = require 'pandoc.List'\n\nlocal assert = tasty.assert\nlocal test = tasty.test_case\nlocal group = tasty.test_group\n\nreturn {\n  group 'List as function' {\n    test('equivalent to List:new', function (x)\n      local new = List:new {'ramen'}\n      local list = List {'ramen'}\n      assert.are_same(new, list)\n      assert.are_equal(getmetatable(new), getmetatable(list))\n    end)\n  },\n\n  group 'clone' {\n    test('changing the clone does not affect original', function ()\n      local orig = List:new {23, 42}\n      local copy = orig:clone()\n      copy[1] = 5\n      assert.are_same({23, 42}, orig)\n      assert.are_same({5, 42}, copy)\n    end),\n    test('result is a list', function ()\n      local orig = List:new {23, 42}\n      assert.are_equal(List, getmetatable(orig:clone()))\n    end),\n  },\n\n  group 'extend' {\n    test('extends list with other list', function ()\n      local primes = List:new {2, 3, 5, 7}\n      primes:extend {11, 13, 17}\n      assert.are_same({2, 3, 5, 7, 11, 13, 17}, primes)\n    end)\n  },\n\n  group 'filter' {\n    test('keep elements for which property is truthy', function ()\n      local is_small_prime = function (x)\n        return List.includes({2, 3, 5, 7}, x)\n      end\n      local numbers = List:new {4, 7, 2, 9, 5, 11}\n      assert.are_same({7, 2, 5}, numbers:filter(is_small_prime))\n    end),\n  },\n\n  group 'find' {\n    test('returns element and index if found', function ()\n      local list = List:new {5, 23, 71}\n      local elem, idx = list:find(71)\n      assert.are_same(71, elem)\n      assert.are_same(3, idx)\n    end),\n    test('respects start index', function ()\n      local list = List:new {19, 23, 29, 71}\n      assert.are_equal(23, list:find(23, 1))\n      assert.are_equal(23, list:find(23, 2))\n      assert.is_nil(list:find(23, 3))\n    end),\n    test('returns nil if element not found', function ()\n      assert.is_nil((List:new {18, 20, 22, 0, 24}):find('0'))\n    end),\n  },\n\n  group 'find_if' {\n    test('returns element and index if found', function ()\n      local perm_prime = List:new {2, 3, 5, 7, 11, 13, 17, 31, 37, 71}\n      local elem, idx = perm_prime:find_if(function (x) return x >= 10 end)\n      assert.are_same(11, elem)\n      assert.are_same(5, idx)\n    end),\n    test('returns nil if element not found', function ()\n      local is_null = function (n) return List.includes({23,35,46,59}, n) end\n      assert.is_nil((List:new {18, 20, 22, 24, 27}):find_if(is_null))\n    end),\n  },\n\n  group 'includes' {\n    test('finds elements in list', function ()\n      local lst = List:new {'one', 'two', 'three'}\n      assert.is_truthy(lst:includes('one'))\n      assert.is_truthy(lst:includes('two'))\n      assert.is_truthy(lst:includes('three'))\n      assert.is_falsy(lst:includes('four'))\n    end)\n  },\n\n  group 'insert' {\n    test('insert value at end of list.', function ()\n      local count_norsk = List {'en', 'to', 'tre'}\n      count_norsk:insert('fire')\n      assert.are_same({'en', 'to', 'tre', 'fire'}, count_norsk)\n    end),\n    test('insert value in the middle of list.', function ()\n      local count_norsk = List {'fem', 'syv'}\n      count_norsk:insert(2, 'seks')\n      assert.are_same({'fem', 'seks', 'syv'}, count_norsk)\n    end)\n  },\n\n  group 'map' {\n    test('applies function to elements', function ()\n      local primes = List:new {2, 3, 5, 7}\n      local squares = primes:map(function (x) return x^2 end)\n      assert.are_same({4, 9, 25, 49}, squares)\n    end),\n    test('leaves original list unchanged', function ()\n      local primes = List:new {2, 3, 5, 7}\n      local squares = primes:map(function (x) return x^2 end)\n      assert.are_same({2, 3, 5, 7}, primes)\n    end)\n  },\n\n  group 'new' {\n    test('make table usable as list', function ()\n      local test = List:new{1, 1, 2, 3, 5}\n      assert.are_same(\n        {1, 1, 4, 9, 25},\n        test:map(function (x) return x^2 end)\n      )\n    end),\n    test('return empty list if no argument is given', function ()\n       assert.are_same({}, List:new())\n    end),\n    test('metatable of result is pandoc.List', function ()\n      local test = List:new{5}\n      assert.are_equal(List, getmetatable(test))\n    end)\n  },\n\n  group 'remove' {\n    test('remove value at end of list.', function ()\n      local understand = List {'jeg', 'forstår', 'ikke'}\n      local norsk_not = understand:remove()\n      assert.are_same({'jeg', 'forstår'}, understand)\n      assert.are_equal('ikke', norsk_not)\n    end),\n    test('remove value at beginning of list.', function ()\n      local count_norsk = List {'en', 'to', 'tre'}\n      count_norsk:remove(1)\n      assert.are_same({'to', 'tre'}, count_norsk)\n    end)\n  },\n\n  group 'sort' {\n    test('sort numeric list', function ()\n      local numbers = List {71, 5, -1, 42, 23, 0, 1}\n      numbers:sort()\n      assert.are_same({-1, 0, 1, 5, 23, 42, 71}, numbers)\n    end),\n    test('reverse-sort numeric', function ()\n      local numbers = List {71, 5, -1, 42, 23, 0, 1}\n      numbers:sort(function (x, y) return x > y end)\n      assert.are_same({71, 42, 23, 5, 1, 0, -1}, numbers)\n    end)\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-log.lua",
    "content": "--\n-- Tests for the pandoc.log module\n--\n-- =========================================\n-- PLEASE BE CAREFUL WHEN UPDATING THE TESTS\n-- =========================================\n--\n-- Some tests here are very, very fragile, as their correctness depends on the\n-- correct line number in this file.\nlocal log = require 'pandoc.log'\nlocal json = require 'pandoc.json'\nlocal tasty = require 'tasty'\n\nlocal group = tasty.test_group\nlocal test = tasty.test_case\nlocal assert = tasty.assert\n\nreturn {\n  group 'info' {\n    test('is a function', function ()\n           assert.are_equal(type(log.info), 'function')\n    end),\n    test('reports a warning', function ()\n      log.info('info test')\n      local msg = json.decode(json.encode(PANDOC_STATE.log:at(-1)))\n      assert.are_equal(msg.message, 'info test')\n      assert.are_equal(msg.type, 'ScriptingInfo')\n    end),\n    test('info includes the correct number', function ()\n      log.info('line number test')\n      local msg = json.decode(json.encode(PANDOC_STATE.log:at(-1)))\n      -- THIS NEEDS UPDATING if lines above are shifted.\n      assert.are_equal(msg.line, 30)\n    end),\n  },\n\n  group 'warn' {\n    test('is a function', function ()\n      assert.are_equal(type(log.warn), 'function')\n    end),\n    test('reports a warning', function ()\n      log.warn('testing')\n      local msg = json.decode(json.encode(PANDOC_STATE.log:at(-1)))\n      assert.are_equal(msg.message, 'testing')\n      assert.are_equal(msg.type, 'ScriptingWarning')\n    end),\n  },\n\n  group 'silence' {\n    test('prevents info from being logged', function ()\n      local current_messages = PANDOC_STATE.log\n      log.silence(log.info, 'Just so you know')\n      assert.are_same(#current_messages, #PANDOC_STATE.log)\n      for i = 1, #current_messages do\n        assert.are_equal(\n          json.encode(current_messages[i]),\n          json.encode(PANDOC_STATE.log[i])\n        )\n      end\n    end),\n    test('returns the messages raised by the called function', function ()\n           local msgs = log.silence(log.info, 'Just so you know')\n           local msg = json.decode(json.encode(msgs[1]))\n           assert.are_equal(msg.message, 'Just so you know')\n    end),\n    test('returns function application results as additional return values',\n         function ()\n           local l, x, y = log.silence(function (a, b) return b, a + b end, 5, 8)\n           assert.are_same(l, {})\n           assert.are_equal(x, 8)\n        assert.are_equal(y, 13)\n      end\n    )\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-mediabag.lua",
    "content": "local tasty = require 'tasty'\n\nlocal test = tasty.test_case\nlocal group = tasty.test_group\nlocal assert = tasty.assert\n\nlocal mediabag = require 'pandoc.mediabag'\n\nreturn {\n  group 'insert' {\n    test('insert adds an item to the mediabag', function ()\n      local fp = \"media/hello.txt\"\n      local mt = \"text/plain\"\n      local contents = \"Hello, World!\"\n      assert.are_same(mediabag.list(), {})\n      mediabag.insert(fp, mt, contents)\n      assert.are_same(\n        mediabag.list(),\n        {{['path'] = fp, ['type'] = mt, ['length'] = 13}}\n      )\n      mediabag.empty() -- clean up\n    end),\n    test('is idempotent', function ()\n      local fp = \"media/hello.txt\"\n      local mt = \"text/plain\"\n      local contents = \"Hello, World!\"\n      mediabag.insert(fp, mt, contents)\n      mediabag.insert(fp, mt, contents)\n      assert.are_same(\n        mediabag.list(),\n        {{['path'] = fp, ['type'] = mt, ['length'] = 13}}\n      )\n      mediabag.empty() -- clean up\n    end),\n  },\n\n  group 'delete' {\n    test('removes an item', function ()\n      assert.are_same(mediabag.list(), {})\n      mediabag.insert('test.html', 'text/html', '<aside>Who cares?</aside>')\n      mediabag.insert('test.css', 'text/plain', 'aside { color: red; }')\n      assert.are_equal(#mediabag.list(), 2)\n      mediabag.delete('test.html')\n      assert.are_same(\n        mediabag.list(),\n        {{['path'] = 'test.css', ['type'] = 'text/plain', ['length'] = 21}}\n      )\n      mediabag.empty() -- clean up\n    end),\n  },\n\n  group 'fetch' {\n    test('populates media bag', function ()\n      local filename = 'lua/module/sample.svg'\n      local mime, contents = mediabag.fetch(filename)\n      assert.are_equal(mime, 'image/svg+xml')\n      assert.are_equal(contents:sub(1,5), '<?xml')\n      mediabag.empty() -- clean up\n    end),\n  },\n\n  group 'fill' {\n    test('populates media bag', function ()\n      local filename = 'lua/module/sample.svg'\n      local doc = pandoc.Pandoc {\n        pandoc.Image('testing', filename)\n      }\n      mediabag.fill(doc)\n      local mime, contents = mediabag.lookup(filename)\n      assert.are_equal(mime, 'image/svg+xml')\n      assert.are_equal(contents:sub(1,5), '<?xml')\n      mediabag.empty() -- clean up\n    end),\n  },\n\n  group 'items' {\n    test('iterates over all items', function ()\n      local input_items = {\n        ['test.html'] = {'text/html', '<aside>Really?</aside>'},\n        ['test.css'] = {'text/plain', 'aside { color: red; }'},\n        ['test.js'] = {'application/javascript', 'alert(\"HI MOM!\")'}\n      }\n      -- fill mediabag\n      for name, v in pairs(input_items) do\n        mediabag.insert(name, v[1], v[2])\n      end\n\n      local seen_items = {}\n      for fp, mt, c in mediabag.items() do\n        seen_items[fp] = {mt, c}\n      end\n      assert.are_same(seen_items, input_items)\n      mediabag.empty() -- clean up\n    end)\n  },\n\n  group 'lookup' {\n    test('returns MIME type and contents', function ()\n      mediabag.insert('test.html', 'text/html', '<aside>Who cares?</aside>')\n      local mime, contents = mediabag.lookup('test.html')\n      assert.are_equal(mime, 'text/html')\n      assert.are_equal(contents, '<aside>Who cares?</aside>')\n      mediabag.empty() -- clean up\n    end),\n  },\n\n  group 'make_data_uri' {\n    test('returns a data URI', function ()\n      local uri = mediabag.make_data_uri('text/plain', 'foo')\n      assert.are_equal(uri:sub(1,5), 'data:')\n    end),\n    test('URI specifies the given MIME type', function ()\n      local mimetype = 'text/plain'\n      local uri = mediabag.make_data_uri(mimetype, 'foo')\n      assert.are_equal(uri:sub(6, 5 + #mimetype), mimetype)\n    end),\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-path.lua",
    "content": "local tasty = require 'tasty'\nlocal path = require 'pandoc.path'\n\nlocal assert = tasty.assert\nlocal test = tasty.test_case\nlocal group = tasty.test_group\n\nreturn {\n  group 'path separator' {\n    test('is string', function ()\n      assert.are_same(type(path.separator), 'string')\n    end),\n    test('is slash or backslash', function ()\n      assert.is_truthy(path.separator:match '^[/\\\\]$')\n    end),\n  },\n  group 'search path separator' {\n    test('is string', function ()\n      assert.are_same(type(path.search_path_separator), 'string')\n    end),\n    test('is colon or semicolon', function ()\n      assert.is_truthy(path.search_path_separator:match '^[:;]$')\n    end)\n  },\n  group 'module' {\n    test('check function existence', function ()\n      local functions = {\n        'directory',\n        'filename',\n        'is_absolute',\n        'is_relative',\n        'join',\n        'make_relative',\n        'normalize',\n        'split',\n        'split_extension',\n        'split_search_path',\n      }\n      for _, f in ipairs(functions) do\n        assert.are_equal(type(path[f]), 'function')\n      end\n    end)\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-structure.lua",
    "content": "local tasty = require 'tasty'\nlocal structure = require 'pandoc.structure'\nlocal path = require 'pandoc.path'\nlocal system = require 'pandoc.system'\n\nlocal assert = tasty.assert\nlocal test = tasty.test_case\nlocal group = tasty.test_group\n\nreturn {\n  test('is table', function ()\n    assert.are_equal(type(structure), 'table')\n  end),\n\n  group 'make_sections' {\n    test('sanity check', function ()\n      local blks = {\n        pandoc.Header(1, {pandoc.Str 'First'}),\n        pandoc.Header(2, {pandoc.Str 'Second'}),\n        pandoc.Header(2, {pandoc.Str 'Third'}),\n      }\n      local opts = PANDOC_WRITER_OPTIONS\n      local hblks = structure.make_sections(blks, opts)\n      assert.are_equal('Div', hblks[1].t)\n      assert.are_equal('Header', hblks[1].content[1].t)\n    end),\n    test('respects number_sections', function ()\n      local blks = {\n        pandoc.Header(1, {pandoc.Str 'First'}),\n        pandoc.Para 'Vestibulum convallis, lorem a tempus semper.'\n      }\n      local hblks = structure.make_sections(blks, {number_sections = true})\n      assert.are_equal('Div', hblks[1].t)\n      assert.are_equal('Header', hblks[1].content[1].t)\n      assert.are_equal('1', hblks[1].content[1].attributes['number'])\n    end),\n    test('respects base_level', function ()\n      local blks = {\n        pandoc.Header(1, {pandoc.Str 'First'}),\n        pandoc.Para 'Curabitur lacinia pulvinar nibh.',\n        pandoc.Header(3, {pandoc.Str 'First'}), -- Skipping level 2\n      }\n      local opts = {\n        number_sections = true,\n        base_level = 1\n      }\n      local hblks = structure.make_sections(blks, opts)\n      assert.are_equal('Div', hblks[1].t)\n      assert.are_equal('Header', hblks[1].content[1].t)\n      assert.are_equal('1',   hblks[1].content[1].attributes['number'])\n      assert.are_equal('1.0.1', hblks[1].content[3].attributes['number'])\n    end)\n  },\n\n  group 'split_into_chunks' {\n    test('is function', function ()\n      assert.are_equal(type(structure.split_into_chunks), 'function')\n    end),\n    test('returns a chunked doc', function ()\n      assert.are_equal(\n        pandoc.utils.type(structure.split_into_chunks(pandoc.Pandoc{})),\n        'ChunkedDoc'\n      )\n    end),\n  },\n\n  group 'table_of_contents' {\n    test('is function', function ()\n      assert.are_equal(type(structure.table_of_contents), 'function')\n    end),\n    test('returns a bullet list', function ()\n      assert.are_equal(\n        pandoc.utils.type(structure.table_of_contents{}),\n        'Block'\n      )\n      assert.are_equal(\n        structure.table_of_contents{}.t,\n        'BulletList'\n      )\n    end),\n    test('returns a toc for a list of blocks', function ()\n      local body = pandoc.Blocks{\n        pandoc.Header(1, 'First'),\n        pandoc.Para('A sentence placed below the first structure.'),\n        pandoc.Header(2, 'Subsection'),\n        pandoc.Para('Mauris ac felis vel velit tristique imperdiet.'),\n        pandoc.Header(1, 'Second'),\n        pandoc.Para('Integer placerat tristique nisl.')\n      }\n      assert.are_equal(\n        structure.table_of_contents(body),\n        pandoc.BulletList{\n          {pandoc.Plain('First'),\n           pandoc.BulletList{{pandoc.Plain 'Subsection'}}\n          },\n          {pandoc.Plain('Second')}\n        }\n      )\n    end),\n    test('returns a toc for a chunked doc', function ()\n      local doc = pandoc.Pandoc {\n        pandoc.Header(1, 'First', {id='first'}),\n        pandoc.Para('A sentence placed below the first structure.'),\n        pandoc.Header(2, 'Subsection', {id='subsection'}),\n        pandoc.Para('Mauris ac felis vel velit tristique imperdiet.'),\n        pandoc.Header(1, 'Second', {id='second'}),\n        pandoc.Para('Integer placerat tristique nisl.')\n      }\n      local chunked = structure.split_into_chunks(doc, {chunk_level = 2})\n      assert.are_equal(\n        structure.table_of_contents(chunked),\n        pandoc.BulletList{\n          {pandoc.Plain({pandoc.Link('First', 'chunk-001#first', '', {id='toc-first'})}),\n           pandoc.BulletList{{pandoc.Plain({pandoc.Link('Subsection', 'chunk-002#subsection', '', {id='toc-subsection'})})}}\n          },\n          {pandoc.Plain({pandoc.Link('Second', 'chunk-003#second', '', {id='toc-second'})})}\n        }\n      )\n    end),\n    test('respects toc-depth option', function ()\n      local doc = pandoc.Pandoc {\n        pandoc.Header(1, 'First', {id='first'}),\n        pandoc.Para('A sentence placed below the first structure.'),\n        pandoc.Header(2, 'Subsection', {id='subsection'}),\n        pandoc.Para('Mauris ac felis vel velit tristique imperdiet.'),\n        pandoc.Header(1, 'Second', {id='second'}),\n        pandoc.Para('Integer placerat tristique nisl.')\n      }\n      local chunked = structure.split_into_chunks(doc)\n      assert.are_equal(\n        structure.table_of_contents(chunked, {toc_depth = 1}),\n        pandoc.BulletList{\n          {pandoc.Plain({pandoc.Link('First', 'chunk-001#first', '', {id='toc-first'})})},\n          {pandoc.Plain({pandoc.Link('Second', 'chunk-002#second', '', {id='toc-second'})})}\n        }\n      )\n    end),\n  },\n  group 'unique_identifier' {\n    test('returns an identifier based on the input', function ()\n      local inlines = pandoc.Inlines{pandoc.Emph{'This'}, ' is nice'}\n      local id = structure.unique_identifier(inlines)\n      assert.are_equal('this-is-nice', id)\n    end),\n    test('respects the list of used IDs', function ()\n      local inlines = pandoc.Inlines('Hello, World!')\n      local used = {['hello-world'] = true}\n      local id = structure.unique_identifier(inlines, used)\n      assert.are_equal('hello-world-1', id)\n    end),\n    test('defaults to pandoc Markdown identifiers', function ()\n      local inlines = pandoc.Inlines('Mr. Jones')\n      local id = structure.unique_identifier(inlines, {})\n      assert.are_equal('mr.-jones', id)\n    end),\n    test('can generate gfm identifiers', function ()\n      local inlines = pandoc.Inlines('Mr. Jones')\n      local exts = {'gfm_auto_identifiers'}\n      local id = structure.unique_identifier(inlines, {}, exts)\n      assert.are_equal('mr-jones', id)\n    end),\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-template.lua",
    "content": "local tasty = require 'tasty'\nlocal pandoc = require 'pandoc'\nlocal template = require 'pandoc.template'\n\nlocal assert = tasty.assert\nlocal test = tasty.test_case\nlocal group = tasty.test_group\n\nreturn {\n  test('is table', function ()\n    assert.are_equal(type(template), 'table')\n  end),\n  group 'default' {\n    test('is function', function ()\n      assert.are_equal(type(template.default), 'function')\n    end),\n    test('returns a string for known format', function ()\n      assert.are_equal(\n        pandoc.utils.type(template.default 'json'),\n        'string'\n      )\n      assert.are_equal(\n        pandoc.utils.type(template.default 'markdown'),\n        'string'\n      )\n    end),\n    test('fails on unknown format', function ()\n           local success, msg = pcall(function ()\n               return pandoc.utils.type(template.default 'nosuchformat')\n           end)\n           assert.is_falsy(success)\n    end),\n                  },\n  group 'get' {\n    test('is function', function ()\n           assert.are_equal(type(template.get), 'function')\n    end),\n    test('searches the template data directory', function ()\n      assert.are_equal(\n        template.default 'html5',\n        template.get 'default.html5'\n      )\n    end),\n    test('fails on non-existent file', function ()\n      local success, msg = pcall(function ()\n        return pandoc.utils.type(template.get 'nosuchfile.nope')\n      end)\n      assert.is_falsy(success)\n    end),\n  },\n  group 'compile' {\n    test('is function', function ()\n      assert.are_equal(type(template.compile), 'function')\n    end),\n    test('returns a Template', function ()\n      assert.are_equal(\n        pandoc.utils.type(template.compile('$title$')),\n        'Template'\n      )\n    end),\n    test('returns a Template', function ()\n      local templ_path = pandoc.path.join{'lua', 'module', 'default.test'}\n      assert.are_equal(\n        pandoc.utils.type(template.compile('${ partial() }', templ_path)),\n        'Template'\n      )\n    end),\n    test('fails if template has non-existing partial', function ()\n      assert.error_matches(\n        function () return template.compile('${ nosuchpartial() }') end,\n        'Could not find data file'\n      )\n    end),\n    test('works with default template that uses partials', function ()\n      local jats_template = template.default 'jats'\n      assert.are_equal(type(jats_template), 'string')\n      assert.are_equal(\n        pandoc.utils.type(template.compile(jats_template)),\n        'Template'\n      )\n    end),\n  },\n  group 'apply' {\n    test('is function', function ()\n      assert.are_equal(type(template.apply), 'function')\n    end),\n    test('returns a Doc value', function ()\n      local tmpl = template.compile('placeholder')\n      assert.are_equal(\n        pandoc.utils.type(template.apply(tmpl, {})),\n        'Doc'\n      )\n    end),\n    test('applies the given context', function ()\n      local tmpl = template.compile('song: $title$')\n      local context = {title = 'Along Comes Mary'}\n      assert.are_equal(\n        template.apply(tmpl, context):render(),\n        'song: Along Comes Mary'\n      )\n    end),\n    test('accepts string as template', function ()\n      local context = {number = '2'}\n      assert.are_equal(\n        template.apply('Song $number$', context):render(),\n        'Song 2'\n      )\n    end)\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-text.lua",
    "content": "--\n-- Tests for the pandoc.text module\n--\nlocal text = require 'pandoc.text'\nlocal tasty = require 'tasty'\n\nlocal group = tasty.test_group\nlocal test = tasty.test_case\nlocal assert = tasty.assert\n\nassert.is_function = function (x)\n  assert.are_equal(type(x), 'function')\nend\n-- We rely mostly on the tests in the `hslua-module-text` module. The\n-- only thing we need to test is whether `pandoc.text` is available,\n-- whether all functions are defined, and whether `require 'text'` works\n-- (for backwards compatibility).\nreturn {\n  group 'module' {\n    test('is table', function ()\n      assert.are_equal(type(text), 'table')\n    end),\n    test('can be required as \"text\"', function ()\n      assert.are_equal(require 'text', require 'pandoc.text')\n    end)\n  },\n\n  group 'functions' {\n    test('fromencoding', function ()\n      assert.is_function(text.fromencoding)\n    end),\n    test('len', function ()\n      assert.is_function(text.len)\n    end),\n    test('lower', function ()\n      assert.is_function(text.lower)\n    end),\n    test('reverse', function ()\n      assert.is_function(text.reverse)\n    end),\n    test('sub', function ()\n      assert.is_function(text.sub)\n    end),\n    group 'subscript' {\n      test('is a function', function ()\n        assert.is_function(text.subscript)\n      end),\n      test('converts a string to Unicode subscript chars', function ()\n        assert.are_equal(text.subscript '1+(9-7)', '₁₊₍₉₋₇₎')\n      end),\n      test('returns nil if the input contains unsupported chars', function ()\n        assert.is_nil(text.subscript '00ä')\n      end),\n    },\n    group 'superscript' {\n      test('is a function', function ()\n        assert.is_function(text.superscript)\n      end),\n      test('converts a string to Unicode superscript chars', function ()\n        assert.are_equal(text.superscript '1+(9-7)', '¹⁺⁽⁹⁻⁷⁾')\n      end),\n      test('returns nil if the input contains unsupported chars', function ()\n        assert.is_nil(text.superscript '00ä')\n      end),\n    },\n    test('toencoding', function ()\n      assert.is_function(text.toencoding)\n    end),\n    test('upper', function ()\n      assert.is_function(text.upper)\n    end),\n  },\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-types.lua",
    "content": "local tasty = require 'tasty'\nlocal system = require 'pandoc.system'\nlocal types = require 'pandoc.types'\nlocal Sources = types.Sources\nlocal Version = types.Version\n\nlocal assert = tasty.assert\nlocal test = tasty.test_case\nlocal group = tasty.test_group\n\nreturn {\n  group 'Sources' {\n    group 'constructor' {\n      test('has type `table`', function ()\n        assert.are_same(type(Sources \"\"), 'table')\n      end),\n      test('accepts a single string', function ()\n        assert.are_same(type(Sources('a')), 'table')\n      end),\n      test('accepts a list of strings', function ()\n        local srcs = Sources{'first text\\n', 'second text\\n'}\n        assert.are_equal(srcs[1].name, '')\n        assert.are_equal(srcs[1].text, 'first text\\n')\n      end),\n      test('accepts list of filepath/content tuples', function ()\n        local srcs = Sources{{'test.txt', 'semi-random content'}}\n        assert.are_equal(srcs[1].name, 'test.txt')\n        assert.are_equal(srcs[1].text, 'semi-random content\\n')\n      end),\n      test('accepts lists of Source-like tables', function ()\n        local srcs = Sources{{name = 'test.txt', text = 'semi-random content'}}\n        assert.are_equal(srcs[1].name, 'test.txt')\n        assert.are_equal(srcs[1].text, 'semi-random content\\n')\n      end),\n    },\n  },\n\n  group 'Version' {\n\n    group 'constructor' {\n      test('has type `userdata`', function ()\n        assert.are_same(type(Version {2}), 'userdata')\n      end),\n      test('accepts list of integers', function ()\n        assert.are_same(type(Version {2, 7, 3}), 'userdata')\n      end),\n      test('accepts a single integer', function ()\n        assert.are_same(Version(5), Version {5})\n      end),\n      test('accepts version as string', function ()\n        assert.are_same(\n          Version '4.45.1',\n          Version {4, 45, 1}\n        )\n      end),\n      test('non-version string is rejected', function ()\n        local success, msg = pcall(function () Version '11friends' end)\n        assert.is_falsy(success)\n        assert.is_truthy(tostring(msg):match('11friends'))\n      end)\n    },\n\n    group 'comparison' {\n      test('smaller (equal) than', function ()\n        assert.is_truthy(Version {2, 58, 3} < Version {2, 58, 4})\n        assert.is_falsy(Version {2, 60, 1} < Version {2, 59, 2})\n        assert.is_truthy(Version {0, 14, 3} < Version {0, 14, 3, 1})\n        assert.is_truthy(Version {3, 58, 3} <= Version {4})\n        assert.is_truthy(Version {0, 14, 3} <= Version {0, 14, 3, 1})\n      end),\n      test('larger (equal) than', function ()\n        assert.is_truthy(Version{2,58,3} > Version {2, 57, 4})\n        assert.is_truthy(Version{2,58,3} > Version {2, 58, 2})\n        assert.is_truthy(Version {0, 8} >= Version {0, 8})\n        assert.is_falsy(Version {0, 8} >= Version {0, 8, 2})\n      end),\n      test('equality', function ()\n        assert.is_truthy(Version '8.8', Version {8, 8})\n      end),\n      test('second argument can be a version string', function ()\n        assert.is_truthy(Version '8' < '9.1')\n        assert.is_falsy(Version '8.8' < '8.7')\n      end),\n    },\n\n    group 'conversion to string' {\n      test('converting from and to string is a noop', function ()\n        local version_string = '1.19.4'\n        assert.are_equal(tostring(Version(version_string)), version_string)\n      end)\n    },\n\n    group 'convenience functions' {\n      test('throws error if version is too old', function ()\n        local actual = Version {2, 8}\n        local expected = Version {2, 9}\n        assert.error_matches(\n          function () actual:must_be_at_least(expected) end,\n          'expected version 2.9 or newer, got 2.8'\n        )\n      end),\n      test('does nothing if expected version is older than actual', function ()\n        local actual = Version '2.9'\n        local expected = Version '2.8'\n        actual:must_be_at_least(expected)\n      end),\n      test('does nothing if expected version equals to actual', function ()\n        local actual = Version '2.8'\n        local expected = Version '2.8'\n        actual:must_be_at_least(expected)\n      end)\n    }\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc-utils.lua",
    "content": "local tasty = require 'tasty'\nlocal pandoc = require 'pandoc'\nlocal utils = require 'pandoc.utils'\nlocal io = require 'io'\n\nlocal assert = tasty.assert\nlocal test = tasty.test_case\nlocal group = tasty.test_group\n\nreturn {\n  group 'blocks_to_inlines' {\n    test('default separator', function ()\n      local blocks = {\n        pandoc.Para { pandoc.Str 'Paragraph1' },\n        pandoc.Para { pandoc.Emph { pandoc.Str 'Paragraph2' } }\n      }\n      local expected = {\n        pandoc.Str 'Paragraph1',\n        pandoc.LineBreak(),\n        pandoc.Emph { pandoc.Str 'Paragraph2' }\n      }\n      assert.are_same(\n        expected,\n        utils.blocks_to_inlines(blocks)\n      )\n    end),\n    test('custom separator', function ()\n      local blocks = {\n        pandoc.Para{ pandoc.Str 'Paragraph1' },\n        pandoc.Para{ pandoc.Emph 'Paragraph2' }\n      }\n      local expected = {\n        pandoc.Str 'Paragraph1',\n        pandoc.LineBreak(),\n        pandoc.Emph { pandoc.Str 'Paragraph2' }\n      }\n      assert.are_same(\n        expected,\n        utils.blocks_to_inlines(blocks, { pandoc.LineBreak() })\n      )\n    end)\n  },\n\n  group 'equals' {\n    test('compares Pandoc elements', function ()\n      assert.is_truthy(\n        utils.equals(pandoc.Pandoc{'foo'}, pandoc.Pandoc{'foo'})\n      )\n    end),\n    test('compares Block elements', function ()\n      assert.is_truthy(\n        utils.equals(pandoc.Plain{'foo'}, pandoc.Plain{'foo'})\n      )\n      assert.is_falsy(\n        utils.equals(pandoc.Para{'foo'}, pandoc.Plain{'foo'})\n      )\n    end),\n    test('compares Inline elements', function ()\n      assert.is_truthy(\n        utils.equals(pandoc.Emph{'foo'}, pandoc.Emph{'foo'})\n      )\n      assert.is_falsy(\n        utils.equals(pandoc.Emph{'foo'}, pandoc.Strong{'foo'})\n      )\n    end),\n    test('compares Inline with Block elements', function ()\n      assert.is_falsy(\n        utils.equals(pandoc.Emph{'foo'}, pandoc.Plain{'foo'})\n      )\n      assert.is_falsy(\n        utils.equals(pandoc.Para{'foo'}, pandoc.Strong{'foo'})\n      )\n    end),\n    test('compares Pandoc with Block elements', function ()\n      assert.is_falsy(\n        utils.equals(pandoc.Pandoc{'foo'}, pandoc.Plain{'foo'})\n      )\n      assert.is_falsy(\n        utils.equals(pandoc.Para{'foo'}, pandoc.Pandoc{'foo'})\n      )\n    end),\n  },\n\n  group 'make_sections' {\n    test('sanity check', function ()\n      local blks = {\n        pandoc.Header(1, {pandoc.Str 'First'}),\n        pandoc.Header(2, {pandoc.Str 'Second'}),\n        pandoc.Header(2, {pandoc.Str 'Third'}),\n      }\n      local hblks = utils.make_sections(true, 1, blks)\n      assert.are_equal('Div', hblks[1].t)\n      assert.are_equal('Header', hblks[1].content[1].t)\n      assert.are_equal('1', hblks[1].content[1].attributes['number'])\n    end)\n  },\n\n  group 'normalize_date' {\n    test('09 Nov 1989', function ()\n      assert.are_equal('1989-11-09', utils.normalize_date '09 Nov 1989')\n    end),\n    test('12/31/2017', function ()\n      assert.are_equal('2017-12-31', utils.normalize_date '12/31/2017')\n    end),\n  },\n\n  group 'references' {\n    test('gets references from doc', function ()\n      local ref = {\n        ['author'] = {\n          {given = 'Max', family = 'Mustermann'}\n        },\n        ['container-title'] = pandoc.Inlines('JOSS'),\n        ['id']     = 'test',\n        ['issued'] = {['date-parts'] = {{2021}}},\n        ['title']  = pandoc.Inlines{\n          pandoc.Quoted('DoubleQuote', 'Interesting'),\n          pandoc.Space(),\n          'work'\n        },\n        ['type']   = 'article-journal',\n      }\n      local nocite = pandoc.Cite(\n        '@test',\n        {pandoc.Citation('test', 'NormalCitation')}\n      )\n      local doc = pandoc.Pandoc({}, {nocite = nocite, references = {ref}})\n      assert.are_same({ref}, pandoc.utils.references(doc))\n    end)\n  },\n\n  group 'run_lua_filter' {\n    test('runs a filter', function ()\n      local doc = pandoc.Pandoc(\"indivisible words\")\n      pandoc.system.with_temporary_directory('lua-filter', function (dir)\n        local filter_path = pandoc.path.join{dir, 'test.lua'}\n        local filter = 'function Space() return \" \" end'\n        local fh = io.open(filter_path, 'wb')\n        fh:write(filter)\n        fh:close()\n        assert.are_equal(\n          utils.run_lua_filter(doc, filter_path),\n          pandoc.Pandoc(\n            pandoc.Plain(pandoc.Inlines{\"indivisible\", \" \", \"words\"})\n          )\n        )\n      end)\n    end),\n    test(\"doesn't change the local environment by default\", function ()\n      pandoc.system.with_temporary_directory('lua-filter', function (dir)\n        local filter_path = pandoc.path.join{dir, 'test.lua'}\n        local foo\n        local filter = 'foo = 42'\n        local fh = io.open(filter_path, 'wb')\n        fh:write(filter)\n        fh:close()\n        utils.run_lua_filter(pandoc.Pandoc{}, filter_path)\n        assert.is_nil(foo)\n      end)\n    end),\n    test(\"accepts an environment in which the filter is executed\", function ()\n      pandoc.system.with_temporary_directory('lua-filter', function (dir)\n        local filter_path = pandoc.path.join{dir, 'test.lua'}\n        local filter = 'foo = 42'\n        local fh = io.open(filter_path, 'wb')\n        fh:write(filter)\n        fh:close()\n        utils.run_lua_filter(pandoc.Pandoc{}, filter_path, _ENV)\n        assert.are_equal(_ENV.foo, 42)\n      end)\n    end)\n  },\n\n  group 'sha1' {\n    test('hashing', function ()\n      local ref_hash = '0a0a9f2a6772942557ab5355d76af442f8f65e01'\n      assert.are_equal(ref_hash, utils.sha1 'Hello, World!')\n    end)\n  },\n\n  group 'stringify' {\n    test('Inline', function ()\n      local inline = pandoc.Emph{\n        pandoc.Str 'Cogito',\n        pandoc.Space(),\n        pandoc.Str 'ergo',\n        pandoc.Space(),\n        pandoc.Str 'sum.',\n      }\n      assert.are_equal('Cogito ergo sum.', utils.stringify(inline))\n    end),\n    test('Block', function ()\n      local block = pandoc.Para{\n        pandoc.Str 'Make',\n        pandoc.Space(),\n        pandoc.Str 'it',\n        pandoc.Space(),\n        pandoc.Str 'so.',\n      }\n      assert.are_equal('Make it so.', utils.stringify(block))\n    end),\n    test('boolean', function ()\n      assert.are_equal('true', utils.stringify(true))\n      assert.are_equal('false', utils.stringify(false))\n    end),\n    test('number', function ()\n      assert.are_equal('5', utils.stringify(5))\n      assert.are_equal('23.23', utils.stringify(23.23))\n    end),\n    test('Attr', function ()\n      local attr = pandoc.Attr('foo', {'bar'}, {a = 'b'})\n      assert.are_equal('', utils.stringify(attr))\n    end),\n    test('List', function ()\n      local list = pandoc.List{pandoc.Str 'a', pandoc.Blocks('b')}\n      assert.are_equal('ab', utils.stringify(list))\n    end),\n    test('Blocks', function ()\n      local blocks = pandoc.Blocks{pandoc.Para 'a', pandoc.Header(1, 'b')}\n      assert.are_equal('ab', utils.stringify(blocks))\n    end),\n    test('Inlines', function ()\n      local inlines = pandoc.Inlines{pandoc.Str 'a', pandoc.Subscript('b')}\n      assert.are_equal('ab', utils.stringify(inlines))\n    end),\n    test('Caption', function ()\n      local capt = pandoc.Caption(pandoc.Para{pandoc.Str 'a', pandoc.Emph('b')})\n      assert.are_equal('ab', utils.stringify(capt))\n    end),\n    test('Cell', function ()\n      local cell = pandoc.Cell(pandoc.Para{pandoc.Str 'a', pandoc.Emph('b')})\n      assert.are_equal('ab', utils.stringify(cell))\n    end),\n    test('TableFoot', function ()\n      local tf = pandoc.TableFoot{pandoc.Row{pandoc.Cell{pandoc.Plain \"x y\"}}}\n      assert.are_equal('x y', utils.stringify(tf))\n    end),\n    test('TableHead', function ()\n      local th = pandoc.TableHead{pandoc.Row{pandoc.Cell{pandoc.Plain \"head1\"}}}\n      assert.are_equal('head1', utils.stringify(th))\n    end),\n    test('Meta', function ()\n      local meta = pandoc.Meta{\n        a = pandoc.Inlines 'funny and ',\n        b = 'good movie',\n        c = pandoc.List{pandoc.Inlines{pandoc.Str '!'}}\n      }\n      assert.are_equal('funny and good movie!', utils.stringify(meta))\n    end),\n  },\n\n  group 'to_roman_numeral' {\n    test('convertes number', function ()\n      assert.are_equal('MDCCCLXXXVIII', utils.to_roman_numeral(1888))\n    end),\n    test('fails on non-convertible argument', function ()\n      assert.is_falsy(pcall(utils.to_roman_numeral, 'not a number'))\n    end)\n  },\n\n  group 'type' {\n    test('nil', function ()\n      assert.are_equal(utils.type(nil), 'nil')\n    end),\n    test('boolean', function ()\n      assert.are_equal(utils.type(true), 'boolean')\n      assert.are_equal(utils.type(false), 'boolean')\n    end),\n    test('number', function ()\n      assert.are_equal(utils.type(5), 'number')\n      assert.are_equal(utils.type(-3.02), 'number')\n    end),\n    test('string', function ()\n      assert.are_equal(utils.type(''), 'string')\n      assert.are_equal(utils.type('asdf'), 'string')\n    end),\n    test('plain table', function ()\n      assert.are_equal(utils.type({}), 'table')\n    end),\n    test('List', function ()\n      assert.are_equal(utils.type(pandoc.List{}), 'List')\n    end),\n    test('Inline', function ()\n      assert.are_equal(utils.type(pandoc.Str 'a'), 'Inline')\n      assert.are_equal(utils.type(pandoc.Emph 'emphasized'), 'Inline')\n    end),\n    test('Inlines', function ()\n      assert.are_equal(utils.type(pandoc.Inlines{pandoc.Str 'a'}), 'Inlines')\n      assert.are_equal(utils.type(pandoc.Inlines{pandoc.Emph 'b'}), 'Inlines')\n    end),\n    test('Blocks', function ()\n      assert.are_equal(utils.type(pandoc.Para 'a'), 'Block')\n      assert.are_equal(utils.type(pandoc.CodeBlock 'true'), 'Block')\n    end),\n    test('Inlines', function ()\n      assert.are_equal(utils.type(pandoc.Blocks{'a'}), 'Blocks')\n      assert.are_equal(utils.type(pandoc.Blocks{pandoc.CodeBlock 'b'}), 'Blocks')\n    end),\n  },\n\n  group 'to_simple_table' {\n    test('convertes Table', function ()\n      function simple_cell (blocks)\n        return {\n          attr = pandoc.Attr(),\n          alignment = \"AlignDefault\",\n          contents = blocks,\n          col_span = 1,\n          row_span = 1,\n        }\n      end\n      local tbl = pandoc.Table(\n        {long = {pandoc.Plain {\n                   pandoc.Str \"the\", pandoc.Space(), pandoc.Str \"caption\"}}},\n        {{pandoc.AlignDefault, nil}},\n        pandoc.TableHead{pandoc.Row{simple_cell{pandoc.Plain \"head1\"}}},\n        {{\n            attr = pandoc.Attr(),\n            body = {pandoc.Row{simple_cell{pandoc.Plain \"cell1\"}}},\n            head = {},\n            row_head_columns = 0\n        }},\n        pandoc.TableFoot(),\n        pandoc.Attr()\n      )\n      local stbl = utils.to_simple_table(tbl)\n      assert.are_equal('SimpleTable', stbl.t)\n      assert.are_equal('head1', utils.stringify(stbl.headers[1]))\n      assert.are_equal('cell1', utils.stringify(stbl.rows[1][1]))\n      assert.are_equal('the caption', utils.stringify(pandoc.Span(stbl.caption)))\n    end),\n    test('fails on para', function ()\n      assert.is_falsy(pcall(utils.to_simple_table, pandoc.Para \"nope\"))\n    end),\n  },\n  group 'from_simple_table' {\n    test('converts SimpleTable to Table', function ()\n      local caption = {pandoc.Str \"Overview\"}\n      local aligns = {pandoc.AlignDefault, pandoc.AlignDefault}\n      local widths = {0, 0} -- let pandoc determine col widths\n      local headers = {\n        {pandoc.Plain \"Language\"},\n        {pandoc.Plain \"Typing\"}\n      }\n      local rows = {\n        {{pandoc.Plain \"Haskell\"}, {pandoc.Plain \"static\"}},\n        {{pandoc.Plain \"Lua\"}, {pandoc.Plain \"Dynamic\"}},\n      }\n      local simple_table = pandoc.SimpleTable(\n        caption,\n        aligns,\n        widths,\n        headers,\n        rows\n      )\n      local tbl = utils.from_simple_table(simple_table)\n      assert.are_equal(\"Table\", tbl.t)\n      assert.are_same(\n        {pandoc.Plain(caption)},\n        tbl.caption.long\n      )\n      -- reversible\n      assert.are_same(simple_table, utils.to_simple_table(tbl))\n    end),\n    test('empty caption', function ()\n      local simple_table = pandoc.SimpleTable(\n        {},\n        {pandoc.AlignDefault},\n        {0},\n        {{pandoc.Plain 'a'}},\n        {{{pandoc.Plain 'b'}}}\n      )\n      local tbl = utils.from_simple_table(simple_table)\n      assert.are_equal(\n        pandoc.Blocks{},\n        tbl.caption.long\n      )\n      assert.is_nil(tbl.caption.short)\n    end),\n    test('empty body', function ()\n      local simple_table = pandoc.SimpleTable(\n        pandoc.Inlines('a nice caption'),\n        {pandoc.AlignDefault},\n        {0},\n        {{pandoc.Plain 'a'}},\n        {}\n      )\n      local tbl = utils.from_simple_table(simple_table)\n      tbl.bodies:map(print)\n      assert.are_same(pandoc.List(), tbl.bodies)\n    end),\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/pandoc.lua",
    "content": "local tasty = require 'tasty'\n\nlocal test = tasty.test_case\nlocal group = tasty.test_group\nlocal assert = tasty.assert\n\nfunction os_is_windows ()\n  return package.config:sub(1,1) == '\\\\'\nend\n\n-- Constructor behavior is tested in the hslua-pandoc-types module, so\n-- we just make sure the functions are present.\nreturn {\n  group 'Constructors' {\n    group 'Misc' {\n      test('pandoc.Attr is a function', function ()\n        assert.are_equal(type(pandoc.Attr), 'function')\n      end),\n      test('pandoc.AttributeList is a function', function ()\n        assert.are_equal(type(pandoc.AttributeList), 'function')\n      end),\n      test('pandoc.Blocks is a function', function ()\n        assert.are_equal(type(pandoc.Blocks), 'function')\n      end),\n      test('pandoc.Citation is a function', function ()\n        assert.are_equal(type(pandoc.Citation), 'function')\n      end),\n      test('pandoc.Inlines is a function', function ()\n        assert.are_equal(type(pandoc.Inlines), 'function')\n      end),\n      test('pandoc.SimpleTable is a function', function ()\n        assert.are_equal(type(pandoc.SimpleTable), 'function')\n      end),\n      test('pandoc.Meta is a function', function ()\n        assert.are_equal(type(pandoc.Meta), 'function')\n      end),\n      test('pandoc.Pandoc is a function', function ()\n        assert.are_equal(type(pandoc.Pandoc), 'function')\n      end),\n    },\n    group \"Inline elements\" {\n      test('pandoc.AttributeList is a function', function ()\n        assert.are_equal(type(pandoc.Cite), 'function')\n      end),\n      test('pandoc.AttributeList is a function', function ()\n        assert.are_equal(type(pandoc.Code), 'function')\n      end),\n      test('pandoc.Emph is a function', function ()\n        assert.are_equal(type(pandoc.Emph), 'function')\n      end),\n      test('pandoc.Image is a function', function ()\n        assert.are_equal(type(pandoc.Image), 'function')\n      end),\n      test('pandoc.Link is a function', function ()\n        assert.are_equal(type(pandoc.Link), 'function')\n      end),\n      test('pandoc.Math is a function', function ()\n        assert.are_equal(type(pandoc.Math), 'function')\n      end),\n      test('pandoc.Note is a function', function ()\n        assert.are_equal(type(pandoc.Note), 'function')\n      end),\n      test('pandoc.Quoted is a function', function ()\n        assert.are_equal(type(pandoc.Quoted), 'function')\n      end),\n      test('pandoc.SmallCaps is a function', function ()\n        assert.are_equal(type(pandoc.SmallCaps), 'function')\n      end),\n      test('pandoc.SoftBreak is a function', function ()\n        assert.are_equal(type(pandoc.SoftBreak), 'function')\n      end),\n      test('pandoc.Span is a function', function ()\n        assert.are_equal(type(pandoc.Span), 'function')\n      end),\n      test('pandoc.Str is a function', function ()\n        assert.are_equal(type(pandoc.Str), 'function')\n      end),\n      test('pandoc.Strikeout is a function', function ()\n      assert.are_equal(type(pandoc.Strikeout), 'function')\n      end),\n      test('pandoc.Strong is a function', function ()\n        assert.are_equal(type(pandoc.Strong), 'function')\n      end),\n      test('pandoc.Subscript is a function', function ()\n        assert.are_equal(type(pandoc.Subscript), 'function')\n      end),\n      test('pandoc.Superscript is a function', function ()\n        assert.are_equal(type(pandoc.Superscript), 'function')\n      end),\n      test('pandoc.Underline is a function', function ()\n        assert.are_equal(type(pandoc.Underline), 'function')\n      end),\n    },\n    group \"Block elements\" {\n      test('pandoc.BlockQuote is a function', function ()\n        assert.are_equal(type(pandoc.BlockQuote), 'function')\n      end),\n      test('pandoc.BulletList is a function', function ()\n        assert.are_equal(type(pandoc.BulletList), 'function')\n      end),\n      test('pandoc.CodeBlock is a function', function ()\n        assert.are_equal(type(pandoc.CodeBlock), 'function')\n      end),\n      test('pandoc.DefinitionList is a function', function ()\n        assert.are_equal(type(pandoc.DefinitionList), 'function')\n      end),\n      test('pandoc.Div is a function', function ()\n        assert.are_equal(type(pandoc.Div), 'function')\n      end),\n      test('pandoc.Header is a function', function ()\n        assert.are_equal(type(pandoc.Header), 'function')\n      end),\n      test('pandoc.LineBlock is a function', function ()\n        assert.are_equal(type(pandoc.LineBlock), 'function')\n      end),\n      test('pandoc.Figure is a function', function ()\n        assert.are_equal(type(pandoc.Figure), 'function')\n      end),\n      test('pandoc.OrderedList is a function', function ()\n        assert.are_equal(type(pandoc.OrderedList), 'function')\n      end),\n      test('pandoc.Para is a function', function ()\n        assert.are_equal(type(pandoc.Para), 'function')\n      end),\n      test('pandoc.Plain is a function', function ()\n        assert.are_equal(type(pandoc.Plain), 'function')\n      end),\n      test('pandoc.RawBlock is a function', function ()\n        assert.are_equal(type(pandoc.Plain), 'function')\n      end),\n      test('pandoc.Table is a function', function ()\n        assert.are_equal(type(pandoc.Table), 'function')\n      end),\n    }\n  },\n  group 'MetaValue elements' {\n    test('MetaList elements behave like lists', function ()\n      local metalist = pandoc.MetaList{}\n      assert.are_equal(type(metalist.insert), 'function')\n      assert.are_equal(type(metalist.remove), 'function')\n    end),\n    test('`tag` is an alias for `t``', function ()\n      assert.are_equal((pandoc.MetaList{}).tag, (pandoc.MetaList{}).t)\n      assert.are_equal((pandoc.MetaMap{}).tag, (pandoc.MetaMap{}).t)\n      assert.are_equal((pandoc.MetaInlines{}).tag, (pandoc.MetaInlines{}).t)\n      assert.are_equal((pandoc.MetaBlocks{}).tag, (pandoc.MetaBlocks{}).t)\n    end),\n  },\n  group 'Meta' {\n    test('inline list is treated as MetaInlines', function ()\n      local meta = pandoc.Pandoc({}, {test = {pandoc.Emph 'check'}}).meta\n      assert.are_same(meta.test, {pandoc.Emph{pandoc.Str 'check'}})\n    end),\n    test('inline element is treated as MetaInlines singleton', function ()\n      local meta = pandoc.Pandoc({}, {test = pandoc.Emph 'check'}).meta\n      assert.are_same(meta.test, {pandoc.Emph{pandoc.Str 'check'}})\n    end),\n    test('block list is treated as MetaBlocks', function ()\n      local meta = pandoc.Pandoc({}, {test = {pandoc.Plain 'check'}}).meta\n      assert.are_same(meta.test, {pandoc.Plain{pandoc.Str 'check'}})\n    end),\n    test('block element is treated as MetaBlocks singleton', function ()\n      local meta = pandoc.Pandoc({}, {test = pandoc.Plain 'check'}).meta\n      assert.are_same(meta.test, {pandoc.Plain{pandoc.Str 'check'}})\n    end),\n  },\n  group 'Pandoc' {\n    test('normalize', function ()\n      local doc = pandoc.Pandoc({{'a', pandoc.Space(), pandoc.Space(), 'b'}})\n      local normalized = pandoc.Pandoc({{'a', pandoc.Space(), 'b'}})\n      assert.are_equal(normalized, doc:normalize())\n    end),\n  },\n  group 'Other types' {\n    group 'ReaderOptions' {\n      test('returns a userdata value', function ()\n        local opts = pandoc.ReaderOptions {}\n        assert.are_equal(type(opts), 'userdata')\n      end),\n      test('can construct from table', function ()\n        local opts = pandoc.ReaderOptions {columns = 66}\n        assert.are_equal(opts.columns, 66)\n      end),\n      test('can construct from other ReaderOptions value', function ()\n        local orig = pandoc.ReaderOptions{columns = 65}\n        local copy = pandoc.ReaderOptions(orig)\n        for k, v in pairs(orig) do\n          assert.are_same(copy[k], v)\n        end\n        assert.are_equal(copy.columns, 65)\n      end),\n    },\n  },\n\n  group 'clone' {\n    test('clones Attr', function ()\n      local attr = pandoc.Attr('test', {'my-class'}, {foo = 'bar'})\n      local cloned = attr:clone()\n      attr.identifier = ''\n      attr.classes = {}\n      attr.attributes = {}\n      assert.are_same(cloned.identifier, 'test')\n      assert.are_same(cloned.classes, {'my-class'})\n      assert.are_same(cloned.attributes.foo, 'bar')\n    end),\n    test('clones ListAttributes', function ()\n      local la = pandoc.ListAttributes(2, pandoc.DefaultStyle, pandoc.Period)\n      local cloned = la:clone()\n      la.start = 9\n      assert.are_same(cloned.start, 2)\n    end),\n    test('clones Para', function ()\n      local para = pandoc.Para {pandoc.Str 'Hello'}\n      local cloned = para:clone()\n      para.content[1].text = 'bye'\n      assert.are_same(cloned, pandoc.Para {pandoc.Str 'Hello'})\n    end),\n    test('clones Str', function ()\n      local str = pandoc.Str 'Hello'\n      local cloned = str:clone()\n      str.text = 'bye'\n      assert.are_same(cloned.text, 'Hello')\n    end),\n    test('clones Citation', function ()\n      local cite = pandoc.Citation('leibniz', pandoc.AuthorInText)\n      local cloned = cite:clone()\n      cite.id = 'newton'\n      assert.are_same(cloned.id, 'leibniz')\n      assert.are_same(cite.id, 'newton')\n      assert.are_same(cite.mode, cloned.mode)\n    end),\n  },\n\n  group 'pipe' {\n    test('external string processing', function ()\n      if os_is_windows() then\n        local pipe_result = pandoc.pipe('find', {'hi'}, 'hi')\n        assert.are_equal('hi', pipe_result:match '%a+')\n      else\n        local pipe_result = pandoc.pipe('tr', {'a', 'b'}, 'abc')\n        assert.are_equal('bbc', pipe_result:match '%a+')\n      end\n    end),\n    test('failing pipe', function ()\n      if os_is_windows() then\n        local success, err = pcall(pandoc.pipe, 'find', {'/a'}, 'hi')\n        assert.is_falsy(success)\n        assert.are_equal('find', err.command)\n        assert.is_truthy(err.error_code ~= 0)\n      else\n        local success, err = pcall(pandoc.pipe, 'false', {}, 'abc')\n        assert.is_falsy(success)\n        assert.are_equal('false', err.command)\n        assert.are_equal(1, err.error_code)\n        assert.are_equal('', err.output)\n      end\n    end)\n  },\n\n  group 'read' {\n    test('Markdown', function ()\n      local valid_markdown = '*Hello*, World!\\n'\n      local expected = pandoc.Pandoc({\n          pandoc.Para {\n            pandoc.Emph { pandoc.Str 'Hello' },\n            pandoc.Str ',',\n            pandoc.Space(),\n            pandoc.Str 'World!'\n          }\n      })\n      assert.are_same(expected, pandoc.read(valid_markdown))\n    end),\n    test('unsupported extension', function ()\n      assert.error_matches(\n        function () pandoc.read('foo', 'gfm+empty_paragraphs') end,\n        'The extension empty_paragraphs is not supported for gfm'\n      )\n    end),\n    test('read with other indented code classes', function()\n      local indented_code = '    return true'\n      local expected = pandoc.Pandoc({\n          pandoc.CodeBlock('return true', {class='foo'})\n      })\n      assert.are_same(\n        expected,\n        pandoc.read(indented_code, 'markdown', {indented_code_classes={'foo'}})\n      )\n    end),\n    test('can read epub', function ()\n      local epub = io.open('lua/module/tiny.epub', 'rb')\n      local blocks = pandoc.read(epub:read'a', 'epub').blocks\n      assert.are_equal(\n        blocks[#blocks],\n        pandoc.Para { pandoc.Emph 'EPUB' }\n      )\n    end),\n    test('failing read', function ()\n      assert.error_matches(\n        function () pandoc.read('foo', 'nosuchreader') end,\n        'Unknown input format nosuchreader'\n      )\n    end),\n    group 'read_env' {\n      test('images are added to the mediabag', function ()\n        local epub = io.open('lua/module/sample.epub', 'rb'):read('a')\n        local _ = pandoc.read(epub, 'epub')\n        assert.are_equal(#pandoc.mediabag.list(), 1)\n      end),\n      test('images from EPUB are added when using the sandbox', function ()\n        local epub = io.open('lua/module/sample.epub', 'rb'):read('a')\n        local _ = pandoc.read(epub, 'epub', nil, {})\n        assert.are_equal(#pandoc.mediabag.list(), 1)\n      end),\n      test('includes work in global env', function ()\n        local tex = '\\\\include{lua/module/include.tex}'\n        local doc = pandoc.read(tex, 'latex')\n        assert.are_equal(\n          doc.blocks,\n          pandoc.Blocks{pandoc.Para 'included'}\n        )\n      end),\n      test('sandbox disallows access to the filesystem', function ()\n        local tex = '\\\\include{lua/module/include.tex}'\n        local doc = pandoc.read(tex, 'latex', nil, {})\n        assert.are_equal(doc.blocks, pandoc.Blocks{})\n      end),\n      test('files can be added to the sandbox', function ()\n        local tex = '\\\\include{lua/module/include.tex}'\n        local doc = pandoc.read(tex, 'latex', nil, {'lua/module/include.tex'})\n        assert.are_equal(\n          doc.blocks,\n          pandoc.Blocks{pandoc.Para 'included'}\n        )\n      end),\n      test('sandbox files can be given as key-value pairs', function ()\n        local tex = '\\\\include{lua/module/include.tex}'\n        local files = {\n          ['lua/module/include.tex'] = 'Hello'\n        }\n        local doc = pandoc.read(tex, 'latex', nil, files)\n        assert.are_equal(\n          doc.blocks,\n          pandoc.Blocks{pandoc.Para 'Hello'}\n        )\n      end),\n      test('kv-pairs override contents read from file system', function ()\n        local tex = '\\\\include{lua/module/include.tex}'\n        local files = {\n          'lua/module/include.tex',\n          ['lua/module/include.tex'] = 'Hello'\n        }\n        local doc = pandoc.read(tex, 'latex', nil, files)\n        assert.are_equal(\n          doc.blocks,\n          pandoc.Blocks{pandoc.Para 'Hello'}\n        )\n      end),\n    },\n    group 'extensions' {\n      test('string spec', function ()\n        local doc = pandoc.read('\"vice versa\"', 'markdown-smart')\n        assert.are_equal(doc, pandoc.Pandoc{pandoc.Para '\"vice versa\"'})\n      end),\n      test('unsupported extension', function ()\n        assert.error_matches(\n          function () pandoc.read('foo', 'gfm+empty_paragraphs') end,\n          'The extension empty_paragraphs is not supported for gfm'\n        )\n      end),\n      test('unknown extension', function ()\n        local format_spec = { format = 'markdown', extensions = {'nope'}}\n        assert.error_matches(\n          function () pandoc.read('x', format_spec) end,\n          'The extension nope is not supported for markdown'\n        )\n      end),\n      test('fails on invalid extension', function ()\n        local format_spec = { format = 'markdown', extensions = {'nope'}}\n        assert.error_matches(\n          function () pandoc.read('nu-uh', format_spec) end,\n          'The extension nope is not supported for markdown'\n        )\n      end),\n    },\n  },\n\n  group 'walk_block' {\n    test('block walking order', function ()\n     local acc = {}\n     local nested_nums = pandoc.Div {\n       pandoc.Para{pandoc.Str'1'},\n       pandoc.Div{\n         pandoc.Para{pandoc.Str'2'},\n         pandoc.Para{pandoc.Str'3'}\n       },\n       pandoc.Para{pandoc.Str'4'}\n     }\n     pandoc.walk_block(\n       nested_nums,\n       {Para = function (p) table.insert(acc, p.content[1].text) end}\n     )\n     assert.are_equal('1234', table.concat(acc))\n    end)\n  },\n\n  group 'walk_inline' {\n    test('inline walking order', function ()\n      local acc = {}\n      local nested_nums = pandoc.Span {\n        pandoc.Str'1',\n        pandoc.Emph {\n          pandoc.Str'2',\n          pandoc.Str'3'\n        },\n        pandoc.Str'4'\n      }\n      pandoc.walk_inline(\n        nested_nums,\n        {Str = function (s) table.insert(acc, s.text) end}\n      )\n      assert.are_equal('1234', table.concat(acc))\n    end)\n  },\n\n  group 'write' {\n    test('string spec', function ()\n      local doc = pandoc.Pandoc{pandoc.Quoted('DoubleQuote', 'vice versa')}\n      local plain = pandoc.write(doc, 'plain+smart')\n      assert.are_equal(plain, '\"vice versa\"\\n')\n    end),\n    test('table format spec with extensions list', function ()\n      local doc = pandoc.Pandoc{pandoc.Quoted('DoubleQuote', 'vice versa')}\n      local format_spec = { format = 'plain', extensions = {'smart'}}\n      local plain = pandoc.write(doc, format_spec)\n      assert.are_equal(plain, '\"vice versa\"\\n')\n    end),\n    test('table format spec with `enable`/`disable` diff', function ()\n      local diff = {\n        enable = {'smart'}\n      }\n      local doc = pandoc.Pandoc{pandoc.Quoted('DoubleQuote', 'vice versa')}\n      local format_spec = { format = 'plain', extensions = diff}\n      local plain = pandoc.write(doc, format_spec)\n      assert.are_equal(plain, '\"vice versa\"\\n')\n    end),\n    test('table format spec with set-like diff', function ()\n      local diff = {\n        smart = true,\n        auto_identifiers = false\n      }\n      local doc = pandoc.Pandoc{pandoc.Quoted('DoubleQuote', 'vice versa')}\n      local format_spec = { format = 'plain', extensions = diff}\n      local plain = pandoc.write(doc, format_spec)\n      assert.are_equal(plain, '\"vice versa\"\\n')\n    end),\n    test('fails on invalid extension', function ()\n      local doc = pandoc.Pandoc{'nope'}\n      local format_spec = { format = 'plain', extensions = {'nope'}}\n      assert.error_matches(\n        function () pandoc.write(doc, format_spec) end,\n        'The extension nope is not supported for plain'\n      )\n    end),\n  },\n\n  group 'with_state' {\n    test('request_headers can be modified', function ()\n      local headers = {\n        {\"Authorization\", \"Basic my-secret\"}\n      }\n      pandoc.with_state({request_headers = headers}, function ()\n        assert.are_same(PANDOC_STATE.request_headers, headers)\n      end)\n    end),\n    test('resource_path can be modified', function ()\n      local paths = {'.', '/test/resource/path' }\n      pandoc.with_state({resource_path = paths}, function ()\n        assert.are_same(PANDOC_STATE.resource_path, paths)\n      end)\n    end),\n    test('user_data_dir can be modified', function ()\n      local opts = {user_data_dir = '/my/test/path'}\n      pandoc.with_state(opts, function ()\n        assert.are_equal(PANDOC_STATE.user_data_dir, '/my/test/path')\n      end)\n    end),\n    test('original value is restored afterwards', function ()\n      local orig_user_data_dir = PANDOC_STATE.user_data_dir\n      local opts = {user_data_dir = '/my/test/path'}\n      pandoc.with_state(opts, function () end)\n      assert.are_equal(PANDOC_STATE.user_data_dir, orig_user_data_dir)\n    end),\n    test('unsupported options trigger an error', function ()\n      local orig_log = PANDOC_STATE.log\n      local opts = {log = 'nonsense'}\n      assert.error_matches(\n        function ()\n          pandoc.with_state(opts, function ()\n            assert.are_same(PANDOC_STATE.log, orig_log)\n          end)\n        end,\n        \"Unknown or unsupported\"\n      )\n      assert.are_same(PANDOC_STATE.log, orig_log)\n    end),\n  },\n\n  group 'Marshal' {\n    group 'Inlines' {\n      test('Strings are broken into words', function ()\n        assert.are_equal(\n          pandoc.Emph 'Nice, init?',\n          pandoc.Emph{pandoc.Str 'Nice,', pandoc.Space(), pandoc.Str 'init?'}\n        )\n      end)\n    },\n    group 'Blocks' {\n      test('Strings are broken into words and wrapped in Plain', function ()\n        assert.are_equal(\n          pandoc.Div{\n            pandoc.Plain{pandoc.Str 'Nice,', pandoc.Space(), pandoc.Str 'init?'}\n          },\n          pandoc.Div{'Nice, init?'}\n        )\n      end)\n    }\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/module/partial.test",
    "content": ""
  },
  {
    "path": "pandoc-lua-engine/test/lua/plain-to-para.lua",
    "content": "return {\n  { Plain = function (elem)\n      return pandoc.Para(elem.content)\n  end,\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/require-file.lua",
    "content": "package.path = package.path .. ';lua/?.lua'\nrequire 'script-name'\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/script-name.lua",
    "content": "function Para (_)\n  return pandoc.Para{pandoc.Str(PANDOC_SCRIPT_FILE)}\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/single-to-double-quoted.lua",
    "content": "return {\n    Quoted = function (elem)\n      if elem.quotetype == \"SingleQuote\" then\n        elem.quotetype = \"DoubleQuote\"\n      end\n      return elem\n    end,\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/smallcaps-title.lua",
    "content": "return {\n  {\n    Meta = function(meta)\n      -- The call to `MetaInlines` is redundant and used for testing purposes\n      -- only. The explicit use of a MetaValue constructor is only useful when\n      -- used with an empty table: `MetaInlines{}` is read differently than\n      -- `MetaBlocks{}`.\n      meta.title = pandoc.MetaInlines{pandoc.SmallCaps(meta.title)}\n      return meta\n    end\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/smart-constructors.lua",
    "content": "-- Test that constructors are \"smart\" in that they autoconvert\n-- types where sensible.\nfunction Para (_)\n  return {\n    pandoc.BulletList{pandoc.Para \"Hello\", pandoc.Para \"World\"},\n    pandoc.DefinitionList{{\"foo\", pandoc.Para \"placeholder\"}},\n    pandoc.LineBlock{\"Moin\", \"Welt\"},\n    pandoc.OrderedList{pandoc.Plain{pandoc.Str \"one\"}, pandoc.Plain \"two\"}\n  }\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/strmacro.lua",
    "content": "return {\n  {\n    Str = function (elem)\n      if elem.text == \"{{helloworld}}\" then\n        return pandoc.Emph {pandoc.Str \"Hello, World\"}\n      else\n        return elem\n      end\n    end,\n  }\n}\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/undiv.lua",
    "content": "function Div(el)\n  return el.content\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/lua/uppercase-header.lua",
    "content": "local text = require 'text'\n\nlocal function str_to_uppercase (s)\n  return pandoc.Str(text.upper(s.text))\nend\n\nfunction Header (el)\n  return pandoc.walk_block(el, {Str = str_to_uppercase})\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/sample.lua",
    "content": "-- This is a sample custom writer for pandoc.  It produces output\n-- that is very similar to that of pandoc's HTML writer.\n-- There is one new feature: code blocks marked with class 'dot'\n-- are piped through graphviz and images are included in the HTML\n-- output using 'data:' URLs. The image format can be controlled\n-- via the `image_format` metadata field.\n--\n-- Invoke with: pandoc -t sample.lua\n--\n-- Note:  you need not have lua installed on your system to use this\n-- custom writer.  However, if you do have lua installed, you can\n-- use it to test changes to the script.  'lua sample.lua' will\n-- produce informative error messages if your code contains\n-- syntax errors.\n\nfunction Writer (doc, opts)\n  PANDOC_DOCUMENT = doc\n  PANDOC_WRITER_OPTIONS = opts\n  loadfile(PANDOC_SCRIPT_FILE)()\n  return pandoc.write_classic(doc, opts)\nend\n\nlocal pipe = pandoc.pipe\nlocal stringify = (require 'pandoc.utils').stringify\n\n-- Choose the image format based on the value of the\n-- `image_format` environment variable.\nlocal image_format = os.getenv 'image_format' or 'png'\nlocal image_mime_type = ({\n    jpeg = 'image/jpeg',\n    jpg = 'image/jpeg',\n    gif = 'image/gif',\n    png = 'image/png',\n    svg = 'image/svg+xml',\n  })[image_format]\n  or error('unsupported image format `' .. image_format .. '`')\n\n-- Character escaping\nlocal function escape(s, in_attribute)\n  return s:gsub('[<>&\"\\']',\n    function(x)\n      if x == '<' then\n        return '&lt;'\n      elseif x == '>' then\n        return '&gt;'\n      elseif x == '&' then\n        return '&amp;'\n      elseif in_attribute and x == '\"' then\n        return '&quot;'\n      elseif in_attribute and x == \"'\" then\n        return '&#39;'\n      else\n        return x\n      end\n    end)\nend\n\n-- Helper function to convert an attributes table into\n-- a string that can be put into HTML tags.\nlocal function attributes(attr)\n  local attr_table = {}\n  for x,y in pairs(attr) do\n    if y and y ~= '' then\n      table.insert(attr_table, ' ' .. x .. '=\"' .. escape(y,true) .. '\"')\n    end\n  end\n  return table.concat(attr_table)\nend\n\n-- Table to store footnotes, so they can be included at the end.\nlocal notes = {}\n\n-- Blocksep is used to separate block elements.\nfunction Blocksep()\n  return '\\n\\n'\nend\n\n-- This function is called once for the whole document. Parameters:\n-- body is a string, metadata is a table, variables is a table.\n-- This gives you a fragment.  You could use the metadata table to\n-- fill variables in a custom lua template.  Or, pass `--template=...`\n-- to pandoc, and pandoc will do the template processing as usual.\nfunction Doc(body, metadata, variables)\n  local buffer = {}\n  local function add(s)\n    table.insert(buffer, s)\n  end\n  add(body)\n  if #notes > 0 then\n    add('<ol class=\"footnotes\">')\n    for _,note in pairs(notes) do\n      add(note)\n    end\n    add('</ol>')\n  end\n  return table.concat(buffer,'\\n') .. '\\n'\nend\n\n-- The functions that follow render corresponding pandoc elements.\n-- s is always a string, attr is always a table of attributes, and\n-- items is always an array of strings (the items in a list).\n-- Comments indicate the types of other variables.\n\nfunction Str(s)\n  return escape(s)\nend\n\nfunction Space()\n  return ' '\nend\n\nfunction SoftBreak()\n  return '\\n'\nend\n\nfunction LineBreak()\n  return '<br/>'\nend\n\nfunction Emph(s)\n  return '<em>' .. s .. '</em>'\nend\n\nfunction Strong(s)\n  return '<strong>' .. s .. '</strong>'\nend\n\nfunction Subscript(s)\n  return '<sub>' .. s .. '</sub>'\nend\n\nfunction Superscript(s)\n  return '<sup>' .. s .. '</sup>'\nend\n\nfunction SmallCaps(s)\n  return '<span style=\"font-variant: small-caps;\">' .. s .. '</span>'\nend\n\nfunction Strikeout(s)\n  return '<del>' .. s .. '</del>'\nend\n\nfunction Link(s, tgt, tit, attr)\n  return '<a href=\"' .. escape(tgt,true) .. '\" title=\"' ..\n         escape(tit,true) .. '\"' .. attributes(attr) .. '>' .. s .. '</a>'\nend\n\nfunction Image(s, src, tit, attr)\n  return '<img src=\"' .. escape(src,true) .. '\" title=\"' ..\n         escape(tit,true) .. '\"/>'\nend\n\nfunction Code(s, attr)\n  return '<code' .. attributes(attr) .. '>' .. escape(s) .. '</code>'\nend\n\nfunction InlineMath(s)\n  return '\\\\(' .. escape(s) .. '\\\\)'\nend\n\nfunction DisplayMath(s)\n  return '\\\\[' .. escape(s) .. '\\\\]'\nend\n\nfunction SingleQuoted(s)\n  return '&lsquo;' .. s .. '&rsquo;'\nend\n\nfunction DoubleQuoted(s)\n  return '&ldquo;' .. s .. '&rdquo;'\nend\n\nfunction Note(s)\n  local num = #notes + 1\n  -- insert the back reference right before the final closing tag.\n  s = string.gsub(s,\n          '(.*)</', '%1 <a href=\"#fnref' .. num ..  '\">&#8617;</a></')\n  -- add a list item with the note to the note table.\n  table.insert(notes, '<li id=\"fn' .. num .. '\">' .. s .. '</li>')\n  -- return the footnote reference, linked to the note.\n  return '<a id=\"fnref' .. num .. '\" href=\"#fn' .. num ..\n            '\"><sup>' .. num .. '</sup></a>'\nend\n\nfunction Span(s, attr)\n  return '<span' .. attributes(attr) .. '>' .. s .. '</span>'\nend\n\nfunction RawInline(format, str)\n  if format == 'html' then\n    return str\n  else\n    return ''\n  end\nend\n\nfunction Cite(s, cs)\n  local ids = {}\n  for _,cit in ipairs(cs) do\n    table.insert(ids, cit.citationId)\n  end\n  return '<span class=\"cite\" data-citation-ids=\"' .. table.concat(ids, ',') ..\n    '\">' .. s .. '</span>'\nend\n\nfunction Plain(s)\n  return s\nend\n\nfunction Para(s)\n  return '<p>' .. s .. '</p>'\nend\n\n-- lev is an integer, the header level.\nfunction Header(lev, s, attr)\n  return '<h' .. lev .. attributes(attr) ..  '>' .. s .. '</h' .. lev .. '>'\nend\n\nfunction BlockQuote(s)\n  return '<blockquote>\\n' .. s .. '\\n</blockquote>'\nend\n\nfunction HorizontalRule()\n  return \"<hr/>\"\nend\n\nfunction LineBlock(ls)\n  return '<div style=\"white-space: pre-line;\">' .. table.concat(ls, '\\n') ..\n         '</div>'\nend\n\nfunction CodeBlock(s, attr)\n  -- If code block has class 'dot', pipe the contents through dot\n  -- and base64, and include the base64-encoded png as a data: URL.\n  if attr.class and string.match(' ' .. attr.class .. ' ',' dot ') then\n    local img = pipe('base64', {}, pipe('dot', {'-T' .. image_format}, s))\n    return '<img src=\"data:' .. image_mime_type .. ';base64,' .. img .. '\"/>'\n  -- otherwise treat as code (one could pipe through a highlighter)\n  else\n    return '<pre><code' .. attributes(attr) .. '>' .. escape(s) ..\n           '</code></pre>'\n  end\nend\n\nfunction BulletList(items)\n  local buffer = {}\n  for _, item in pairs(items) do\n    table.insert(buffer, '<li>' .. item .. '</li>')\n  end\n  return '<ul>\\n' .. table.concat(buffer, '\\n') .. '\\n</ul>'\nend\n\nfunction OrderedList(items)\n  local buffer = {}\n  for _, item in pairs(items) do\n    table.insert(buffer, '<li>' .. item .. '</li>')\n  end\n  return '<ol>\\n' .. table.concat(buffer, '\\n') .. '\\n</ol>'\nend\n\nfunction DefinitionList(items)\n  local buffer = {}\n  for _,item in pairs(items) do\n    local k, v = next(item)\n    table.insert(buffer, '<dt>' .. k .. '</dt>\\n<dd>' ..\n                   table.concat(v, '</dd>\\n<dd>') .. '</dd>')\n  end\n  return '<dl>\\n' .. table.concat(buffer, '\\n') .. '\\n</dl>'\nend\n\n-- Convert pandoc alignment to something HTML can use.\n-- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.\nlocal function html_align(align)\n  if align == 'AlignLeft' then\n    return 'left'\n  elseif align == 'AlignRight' then\n    return 'right'\n  elseif align == 'AlignCenter' then\n    return 'center'\n  else\n    return 'left'\n  end\nend\n\nfunction CaptionedImage(src, tit, caption, attr)\n  if #caption == 0 then\n    return '<p><img src=\"' .. escape(src,true) .. '\" id=\"' .. attr.id ..\n      '\"/></p>'\n  else\n    local ecaption = escape(caption)\n    return '<figure>\\n<img src=\"' .. escape(src,true) ..\n        '\" id=\"' .. attr.id .. '\" alt=\"' .. ecaption  .. '\"/>' ..\n        '<figcaption>' .. ecaption .. '</figcaption>\\n</figure>'\n  end\nend\n\nfunction Figure(caption, contents, attr)\n  return '<figure' .. attributes(attr) .. '>\\n' .. contents ..\n    '\\n<figcaption>' .. caption .. '</figcaption>\\n' ..\n    '</figure>'\nend\n\n-- Caption is a string, aligns is an array of strings,\n-- widths is an array of floats, headers is an array of\n-- strings, rows is an array of arrays of strings.\nfunction Table(caption, aligns, widths, headers, rows)\n  local buffer = {}\n  local function add(s)\n    table.insert(buffer, s)\n  end\n  add('<table>')\n  if caption ~= '' then\n    add('<caption>' .. escape(caption) .. '</caption>')\n  end\n  if widths and widths[1] ~= 0 then\n    for _, w in pairs(widths) do\n      add('<col width=\"' .. string.format('%.0f%%', w * 100) .. '\" />')\n    end\n  end\n  local header_row = {}\n  local empty_header = true\n  for i, h in pairs(headers) do\n    local align = html_align(aligns[i])\n    table.insert(header_row,'<th align=\"' .. align .. '\">' .. h .. '</th>')\n    empty_header = empty_header and h == ''\n  end\n  if not empty_header then\n    add('<tr class=\"header\">')\n    for _,h in pairs(header_row) do\n      add(h)\n    end\n    add('</tr>')\n  end\n  local class = 'even'\n  for _, row in pairs(rows) do\n    class = (class == 'even' and 'odd') or 'even'\n    add('<tr class=\"' .. class .. '\">')\n    for i,c in pairs(row) do\n      add('<td align=\"' .. html_align(aligns[i]) .. '\">' .. c .. '</td>')\n    end\n    add('</tr>')\n  end\n  add('</table>')\n  return table.concat(buffer,'\\n')\nend\n\nfunction RawBlock(format, str)\n  if format == 'html' then\n    return str\n  else\n    return ''\n  end\nend\n\nfunction Div(s, attr)\n  return '<div' .. attributes(attr) .. '>\\n' .. s .. '</div>'\nend\n\n-- The following code will produce runtime warnings when you haven't defined\n-- all of the functions you need for the custom writer, so it's useful\n-- to include when you're working on a writer.\nlocal meta = {}\nmeta.__index =\n  function(_, key)\n    io.stderr:write(string.format(\"WARNING: Undefined function '%s'\\n\",key))\n    return function() return '' end\n  end\nsetmetatable(_G, meta)\n"
  },
  {
    "path": "pandoc-lua-engine/test/tables.custom",
    "content": "<p>Simple table with caption:</p>\n\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<tr class=\"header\">\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th align=\"left\">Default</th>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"left\">12</td>\n</tr>\n<tr class=\"even\">\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"left\">123</td>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"left\">1</td>\n</tr>\n</table>\n\n<p>Simple table without caption:</p>\n\n<table>\n<tr class=\"header\">\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th align=\"left\">Default</th>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"left\">12</td>\n</tr>\n<tr class=\"even\">\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"left\">123</td>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"left\">1</td>\n</tr>\n</table>\n\n<p>Simple table indented two spaces:</p>\n\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<tr class=\"header\">\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th align=\"left\">Default</th>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"left\">12</td>\n</tr>\n<tr class=\"even\">\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"left\">123</td>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"left\">1</td>\n</tr>\n</table>\n\n<p>Multiline table with caption:</p>\n\n<table>\n<caption>Here’s the caption.\nIt may span multiple lines.</caption>\n<col width=\"15%\" />\n<col width=\"14%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n<tr class=\"header\">\n<th align=\"center\">Centered\nHeader</th>\n<th align=\"left\">Left\nAligned</th>\n<th align=\"right\">Right\nAligned</th>\n<th align=\"left\">Default aligned</th>\n</tr>\n<tr class=\"odd\">\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans\nmultiple lines.</td>\n</tr>\n<tr class=\"even\">\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here’s another one. Note\nthe blank line between rows.</td>\n</tr>\n</table>\n\n<p>Multiline table without caption:</p>\n\n<table>\n<col width=\"15%\" />\n<col width=\"14%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n<tr class=\"header\">\n<th align=\"center\">Centered\nHeader</th>\n<th align=\"left\">Left\nAligned</th>\n<th align=\"right\">Right\nAligned</th>\n<th align=\"left\">Default aligned</th>\n</tr>\n<tr class=\"odd\">\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans\nmultiple lines.</td>\n</tr>\n<tr class=\"even\">\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here’s another one. Note\nthe blank line between rows.</td>\n</tr>\n</table>\n\n<p>Table without column headers:</p>\n\n<table>\n<tr class=\"odd\">\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"right\">12</td>\n</tr>\n<tr class=\"even\">\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"right\">123</td>\n</tr>\n<tr class=\"odd\">\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"right\">1</td>\n</tr>\n</table>\n\n<p>Multiline table without column headers:</p>\n\n<table>\n<col width=\"15%\" />\n<col width=\"14%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n<tr class=\"odd\">\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans\nmultiple lines.</td>\n</tr>\n<tr class=\"even\">\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here’s another one. Note\nthe blank line between rows.</td>\n</tr>\n</table>\n"
  },
  {
    "path": "pandoc-lua-engine/test/test-pandoc-lua-engine.hs",
    "content": "module Main (main) where\nimport Test.Tasty (TestTree, defaultMain, testGroup)\nimport qualified Tests.Lua\nimport qualified Tests.Lua.Module\nimport qualified Tests.Lua.Reader\nimport qualified Tests.Lua.Writer\nimport System.Directory (withCurrentDirectory)\n\nmain :: IO ()\nmain = withCurrentDirectory \"test\" $ defaultMain tests\n\ntests :: TestTree\ntests = testGroup \"pandoc Lua engine\"\n  [ testGroup \"Lua filters\" Tests.Lua.tests\n  , testGroup \"Lua modules\" Tests.Lua.Module.tests\n  , testGroup \"Custom writers\" Tests.Lua.Writer.tests\n  , testGroup \"Custom readers\" Tests.Lua.Reader.tests\n  ]\n"
  },
  {
    "path": "pandoc-lua-engine/test/writer-template.lua",
    "content": "function Writer (doc, opts)\n  return pandoc.write(doc, 'gfm', opts)\nend\n\nfunction Template ()\n  return '<!-- start -->\\n$body$\\n<!-- stop -->\\n'\nend\n"
  },
  {
    "path": "pandoc-lua-engine/test/writer-template.out.txt",
    "content": "<!-- start -->\n$body$\n<!-- stop -->\n"
  },
  {
    "path": "pandoc-lua-engine/test/writer.custom",
    "content": "<p>This is a set of tests for pandoc. Most of them are adapted from\nJohn Gruber’s markdown test suite.</p>\n\n<hr/>\n\n<h1 id=\"headers\">Headers</h1>\n\n<h2 id=\"level-2-with-an-embedded-link\">Level 2 with an <a href=\"/url\" title=\"\">embedded link</a></h2>\n\n<h3 id=\"level-3-with-emphasis\">Level 3 with <em>emphasis</em></h3>\n\n<h4 id=\"level-4\">Level 4</h4>\n\n<h5 id=\"level-5\">Level 5</h5>\n\n<h1 id=\"level-1\">Level 1</h1>\n\n<h2 id=\"level-2-with-emphasis\">Level 2 with <em>emphasis</em></h2>\n\n<h3 id=\"level-3\">Level 3</h3>\n\n<p>with no blank line</p>\n\n<h2 id=\"level-2\">Level 2</h2>\n\n<p>with no blank line</p>\n\n<hr/>\n\n<h1 id=\"paragraphs\">Paragraphs</h1>\n\n<p>Here’s a regular paragraph.</p>\n\n<p>In Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.</p>\n\n<p>Here’s one with a bullet.\n* criminey.</p>\n\n<p>There should be a hard line break<br/>here.</p>\n\n<hr/>\n\n<h1 id=\"block-quotes\">Block Quotes</h1>\n\n<p>E-mail style:</p>\n\n<blockquote>\n<p>This is a block quote.\nIt is pretty short.</p>\n</blockquote>\n\n<blockquote>\n<p>Code in a block quote:</p>\n\n<pre><code>sub status {\n    print \"working\";\n}</code></pre>\n\n<p>A list:</p>\n\n<ol>\n<li>item one</li>\n<li>item two</li>\n</ol>\n\n<p>Nested block quotes:</p>\n\n<blockquote>\n<p>nested</p>\n</blockquote>\n\n<blockquote>\n<p>nested</p>\n</blockquote>\n</blockquote>\n\n<p>This should not be a block quote: 2\n&gt; 1.</p>\n\n<p>And a following paragraph.</p>\n\n<hr/>\n\n<h1 id=\"code-blocks\">Code Blocks</h1>\n\n<p>Code:</p>\n\n<pre><code>---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab</code></pre>\n\n<p>And:</p>\n\n<pre><code>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</code></pre>\n\n<hr/>\n\n<h1 id=\"lists\">Lists</h1>\n\n<h2 id=\"unordered\">Unordered</h2>\n\n<p>Asterisks tight:</p>\n\n<ul>\n<li>asterisk 1</li>\n<li>asterisk 2</li>\n<li>asterisk 3</li>\n</ul>\n\n<p>Asterisks loose:</p>\n\n<ul>\n<li><p>asterisk 1</p></li>\n<li><p>asterisk 2</p></li>\n<li><p>asterisk 3</p></li>\n</ul>\n\n<p>Pluses tight:</p>\n\n<ul>\n<li>Plus 1</li>\n<li>Plus 2</li>\n<li>Plus 3</li>\n</ul>\n\n<p>Pluses loose:</p>\n\n<ul>\n<li><p>Plus 1</p></li>\n<li><p>Plus 2</p></li>\n<li><p>Plus 3</p></li>\n</ul>\n\n<p>Minuses tight:</p>\n\n<ul>\n<li>Minus 1</li>\n<li>Minus 2</li>\n<li>Minus 3</li>\n</ul>\n\n<p>Minuses loose:</p>\n\n<ul>\n<li><p>Minus 1</p></li>\n<li><p>Minus 2</p></li>\n<li><p>Minus 3</p></li>\n</ul>\n\n<h2 id=\"ordered\">Ordered</h2>\n\n<p>Tight:</p>\n\n<ol>\n<li>First</li>\n<li>Second</li>\n<li>Third</li>\n</ol>\n\n<p>and:</p>\n\n<ol>\n<li>One</li>\n<li>Two</li>\n<li>Three</li>\n</ol>\n\n<p>Loose using tabs:</p>\n\n<ol>\n<li><p>First</p></li>\n<li><p>Second</p></li>\n<li><p>Third</p></li>\n</ol>\n\n<p>and using spaces:</p>\n\n<ol>\n<li><p>One</p></li>\n<li><p>Two</p></li>\n<li><p>Three</p></li>\n</ol>\n\n<p>Multiple paragraphs:</p>\n\n<ol>\n<li><p>Item 1, graf one.</p>\n\n<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\nback.</p></li>\n<li><p>Item 2.</p></li>\n<li><p>Item 3.</p></li>\n</ol>\n\n<h2 id=\"nested\">Nested</h2>\n\n<ul>\n<li>Tab\n\n<ul>\n<li>Tab\n\n<ul>\n<li>Tab</li>\n</ul></li>\n</ul></li>\n</ul>\n\n<p>Here’s another:</p>\n\n<ol>\n<li>First</li>\n<li>Second:\n\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li>Third</li>\n</ol>\n\n<p>Same thing but with paragraphs:</p>\n\n<ol>\n<li><p>First</p></li>\n<li><p>Second:</p>\n\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li><p>Third</p></li>\n</ol>\n\n<h2 id=\"tabs-and-spaces\">Tabs and spaces</h2>\n\n<ul>\n<li><p>this is a list item\nindented with tabs</p></li>\n<li><p>this is a list item\nindented with spaces</p>\n\n<ul>\n<li><p>this is an example list item\nindented with tabs</p></li>\n<li><p>this is an example list item\nindented with spaces</p></li>\n</ul></li>\n</ul>\n\n<h2 id=\"fancy-list-markers\">Fancy list markers</h2>\n\n<ol>\n<li><p>begins with 2</p></li>\n<li><p>and now 3</p>\n\n<p>with a continuation</p>\n\n<ol>\n<li>sublist with roman numerals,\nstarting with 4</li>\n<li>more items\n\n<ol>\n<li>a subsublist</li>\n<li>a subsublist</li>\n</ol></li>\n</ol></li>\n</ol>\n\n<p>Nesting:</p>\n\n<ol>\n<li>Upper Alpha\n\n<ol>\n<li>Upper Roman.\n\n<ol>\n<li>Decimal start with 6\n\n<ol>\n<li>Lower alpha with paren</li>\n</ol></li>\n</ol></li>\n</ol></li>\n</ol>\n\n<p>Autonumbering:</p>\n\n<ol>\n<li>Autonumber.</li>\n<li>More.\n\n<ol>\n<li>Nested.</li>\n</ol></li>\n</ol>\n\n<p>Should not be a list item:</p>\n\n<p>M.A. 2007</p>\n\n<p>B. Williams</p>\n\n<hr/>\n\n<h1 id=\"definition-lists\">Definition Lists</h1>\n\n<p>Tight using spaces:</p>\n\n<dl>\n<dt>apple</dt>\n<dd>red fruit</dd>\n<dt>orange</dt>\n<dd>orange fruit</dd>\n<dt>banana</dt>\n<dd>yellow fruit</dd>\n</dl>\n\n<p>Tight using tabs:</p>\n\n<dl>\n<dt>apple</dt>\n<dd>red fruit</dd>\n<dt>orange</dt>\n<dd>orange fruit</dd>\n<dt>banana</dt>\n<dd>yellow fruit</dd>\n</dl>\n\n<p>Loose:</p>\n\n<dl>\n<dt>apple</dt>\n<dd><p>red fruit</p></dd>\n<dt>orange</dt>\n<dd><p>orange fruit</p></dd>\n<dt>banana</dt>\n<dd><p>yellow fruit</p></dd>\n</dl>\n\n<p>Multiple blocks with italics:</p>\n\n<dl>\n<dt><em>apple</em></dt>\n<dd><p>red fruit</p>\n\n<p>contains seeds,\ncrisp, pleasant to taste</p></dd>\n<dt><em>orange</em></dt>\n<dd><p>orange fruit</p>\n\n<pre><code>{ orange code block }</code></pre>\n\n<blockquote>\n<p>orange block quote</p>\n</blockquote></dd>\n</dl>\n\n<p>Multiple definitions, tight:</p>\n\n<dl>\n<dt>apple</dt>\n<dd>red fruit</dd>\n<dd>computer</dd>\n<dt>orange</dt>\n<dd>orange fruit</dd>\n<dd>bank</dd>\n</dl>\n\n<p>Multiple definitions, loose:</p>\n\n<dl>\n<dt>apple</dt>\n<dd><p>red fruit</p></dd>\n<dd><p>computer</p></dd>\n<dt>orange</dt>\n<dd><p>orange fruit</p></dd>\n<dd><p>bank</p></dd>\n</dl>\n\n<p>Blank line after term, indented marker, alternate markers:</p>\n\n<dl>\n<dt>apple</dt>\n<dd><p>red fruit</p></dd>\n<dd><p>computer</p></dd>\n<dt>orange</dt>\n<dd><p>orange fruit</p>\n\n<ol>\n<li>sublist</li>\n<li>sublist</li>\n</ol></dd>\n</dl>\n\n<h1 id=\"html-blocks\">HTML Blocks</h1>\n\n<p>Simple block on one line:</p>\n\n<div>\nfoo</div>\n\n<p>And nested without indentation:</p>\n\n<div>\n<div>\n<div>\n<p>foo</p></div></div>\n\n<div>\nbar</div></div>\n\n<p>Interpreted markdown in a table:</p>\n\n<table>\n\n<tr>\n\n<td>\n\nThis is <em>emphasized</em>\n\n</td>\n\n<td>\n\nAnd this is <strong>strong</strong>\n\n</td>\n\n</tr>\n\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n\n<p>Here’s a simple block:</p>\n\n<div>\n<p>foo</p></div>\n\n<p>This should be a code block, though:</p>\n\n<pre><code>&lt;div&gt;\n    foo\n&lt;/div&gt;</code></pre>\n\n<p>As should this:</p>\n\n<pre><code>&lt;div&gt;foo&lt;/div&gt;</code></pre>\n\n<p>Now, nested:</p>\n\n<div>\n<div>\n<div>\nfoo</div></div></div>\n\n<p>This should just be an HTML comment:</p>\n\n<!-- Comment -->\n\n<p>Multiline:</p>\n\n<!--\nBlah\nBlah\n-->\n\n<!--\n    This is another comment.\n-->\n\n<p>Code block:</p>\n\n<pre><code>&lt;!-- Comment --&gt;</code></pre>\n\n<p>Just plain comment, with trailing spaces on the line:</p>\n\n<!-- foo -->\n\n<p>Code:</p>\n\n<pre><code>&lt;hr /&gt;</code></pre>\n\n<p>Hr’s:</p>\n\n<hr>\n\n<hr />\n\n<hr />\n\n<hr>\n\n<hr />\n\n<hr />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n\n<hr/>\n\n<h1 id=\"inline-markup\">Inline Markup</h1>\n\n<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>\n\n<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>\n\n<p>An <em><a href=\"/url\" title=\"\">emphasized link</a></em>.</p>\n\n<p><strong><em>This is strong and em.</em></strong></p>\n\n<p>So is <strong><em>this</em></strong> word.</p>\n\n<p><strong><em>This is strong and em.</em></strong></p>\n\n<p>So is <strong><em>this</em></strong> word.</p>\n\n<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\\</code>, <code>\\$</code>, <code>&lt;html&gt;</code>.</p>\n\n<p><del>This is <em>strikeout</em>.</del></p>\n\n<p>Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup> a<sup>hello there</sup>.</p>\n\n<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n\n<p>These should not be superscripts or subscripts,\nbecause of the unescaped spaces: a^b c^d, a~b c~d.</p>\n\n<hr/>\n\n<h1 id=\"smart-quotes-ellipses-dashes\">Smart quotes, ellipses, dashes</h1>\n\n<p>&ldquo;Hello,&rdquo; said the spider. &ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;</p>\n\n<p>&lsquo;A&rsquo;, &lsquo;B&rsquo;, and &lsquo;C&rsquo; are letters.</p>\n\n<p>&lsquo;Oak,&rsquo; &lsquo;elm,&rsquo; and &lsquo;beech&rsquo; are names of trees.\nSo is &lsquo;pine.&rsquo;</p>\n\n<p>&lsquo;He said, &ldquo;I want to go.&rdquo;&rsquo; Were you alive in the\n70’s?</p>\n\n<p>Here is some quoted &lsquo;<code>code</code>&rsquo; and a &ldquo;<a href=\"http://example.com/?foo=1&amp;bar=2\" title=\"\">quoted link</a>&rdquo;.</p>\n\n<p>Some dashes: one—two — three—four — five.</p>\n\n<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n\n<p>Ellipses…and…and….</p>\n\n<hr/>\n\n<h1 id=\"latex\">LaTeX</h1>\n\n<ul>\n<li></li>\n<li>\\(2+2=4\\)</li>\n<li>\\(x \\in y\\)</li>\n<li>\\(\\alpha \\wedge \\omega\\)</li>\n<li>\\(223\\)</li>\n<li>\\(p\\)-Tree</li>\n<li>Here’s some display math:\n\\[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\\]</li>\n<li>Here’s one that has a line break in it: \\(\\alpha + \\omega \\times x^2\\).</li>\n</ul>\n\n<p>These shouldn’t be math:</p>\n\n<ul>\n<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>\n<li>$22,000 is a <em>lot</em> of money. So is $34,000.\n(It worked if &ldquo;lot&rdquo; is emphasized.)</li>\n<li>Shoes ($20) and socks ($5).</li>\n<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>\n</ul>\n\n<p>Here’s a LaTeX table:</p>\n\n\n\n<hr/>\n\n<h1 id=\"special-characters\">Special Characters</h1>\n\n<p>Here is some unicode:</p>\n\n<ul>\n<li>I hat: Î</li>\n<li>o umlaut: ö</li>\n<li>section: §</li>\n<li>set membership: ∈</li>\n<li>copyright: ©</li>\n</ul>\n\n<p>AT&amp;T has an ampersand in their name.</p>\n\n<p>AT&amp;T is another way to write it.</p>\n\n<p>This &amp; that.</p>\n\n<p>4 &lt; 5.</p>\n\n<p>6 &gt; 5.</p>\n\n<p>Backslash: \\</p>\n\n<p>Backtick: `</p>\n\n<p>Asterisk: *</p>\n\n<p>Underscore: _</p>\n\n<p>Left brace: {</p>\n\n<p>Right brace: }</p>\n\n<p>Left bracket: [</p>\n\n<p>Right bracket: ]</p>\n\n<p>Left paren: (</p>\n\n<p>Right paren: )</p>\n\n<p>Greater-than: &gt;</p>\n\n<p>Hash: #</p>\n\n<p>Period: .</p>\n\n<p>Bang: !</p>\n\n<p>Plus: +</p>\n\n<p>Minus: -</p>\n\n<hr/>\n\n<h1 id=\"links\">Links</h1>\n\n<h2 id=\"explicit\">Explicit</h2>\n\n<p>Just a <a href=\"/url/\" title=\"\">URL</a>.</p>\n\n<p><a href=\"/url/\" title=\"title\">URL and title</a>.</p>\n\n<p><a href=\"/url/\" title=\"title preceded by two spaces\">URL and title</a>.</p>\n\n<p><a href=\"/url/\" title=\"title preceded by a tab\">URL and title</a>.</p>\n\n<p><a href=\"/url/\" title=\"title with &quot;quotes&quot; in it\">URL and title</a></p>\n\n<p><a href=\"/url/\" title=\"title with single quotes\">URL and title</a></p>\n\n<p><a href=\"/url/with_underscore\" title=\"\">with_underscore</a></p>\n\n<p><a href=\"mailto:nobody@nowhere.net\" title=\"\">Email link</a></p>\n\n<p><a href=\"\" title=\"\">Empty</a>.</p>\n\n<h2 id=\"reference\">Reference</h2>\n\n<p>Foo <a href=\"/url/\" title=\"\">bar</a>.</p>\n\n<p>With <a href=\"/url/\" title=\"\">embedded [brackets]</a>.</p>\n\n<p><a href=\"/url/\" title=\"\">b</a> by itself should be a link.</p>\n\n<p>Indented <a href=\"/url\" title=\"\">once</a>.</p>\n\n<p>Indented <a href=\"/url\" title=\"\">twice</a>.</p>\n\n<p>Indented <a href=\"/url\" title=\"\">thrice</a>.</p>\n\n<p>This should [not][] be a link.</p>\n\n<pre><code>[not]: /url</code></pre>\n\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quotes&quot; inside\">bar</a>.</p>\n\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quote&quot; inside\">biz</a>.</p>\n\n<h2 id=\"with-ampersands\">With ampersands</h2>\n\n<p>Here’s a <a href=\"http://example.com/?foo=1&amp;bar=2\" title=\"\">link with an ampersand in the URL</a>.</p>\n\n<p>Here’s a link with an amersand in the link text: <a href=\"http://att.com/\" title=\"AT&amp;T\">AT&amp;T</a>.</p>\n\n<p>Here’s an <a href=\"/script?foo=1&amp;bar=2\" title=\"\">inline link</a>.</p>\n\n<p>Here’s an <a href=\"/script?foo=1&amp;bar=2\" title=\"\">inline link in pointy braces</a>.</p>\n\n<h2 id=\"autolinks\">Autolinks</h2>\n\n<p>With an ampersand: <a href=\"http://example.com/?foo=1&amp;bar=2\" title=\"\" class=\"uri\">http://example.com/?foo=1&amp;bar=2</a></p>\n\n<ul>\n<li>In a list?</li>\n<li><a href=\"http://example.com/\" title=\"\" class=\"uri\">http://example.com/</a></li>\n<li>It should.</li>\n</ul>\n\n<p>An e-mail address: <a href=\"mailto:nobody@nowhere.net\" title=\"\" class=\"email\">nobody@nowhere.net</a></p>\n\n<blockquote>\n<p>Blockquoted: <a href=\"http://example.com/\" title=\"\" class=\"uri\">http://example.com/</a></p>\n</blockquote>\n\n<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>\n\n<pre><code>or here: &lt;http://example.com/&gt;</code></pre>\n\n<hr/>\n\n<h1 id=\"images\">Images</h1>\n\n<p>From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):</p>\n\n<figure>\n<img src=\"lalune.jpg\" title=\"Voyage dans la Lune\"/>\n<figcaption>lalune</figcaption>\n</figure>\n\n<p>Here is a movie <img src=\"movie.jpg\" title=\"\"/> icon.</p>\n\n<hr/>\n\n<h1 id=\"footnotes\">Footnotes</h1>\n\n<p>Here is a footnote reference,<a id=\"fnref1\" href=\"#fn1\"><sup>1</sup></a> and another.<a id=\"fnref2\" href=\"#fn2\"><sup>2</sup></a>\nThis should <em>not</em> be a footnote reference, because it\ncontains a space.[^my note] Here is an inline note.<a id=\"fnref3\" href=\"#fn3\"><sup>3</sup></a></p>\n\n<blockquote>\n<p>Notes can go in quotes.<a id=\"fnref4\" href=\"#fn4\"><sup>4</sup></a></p>\n</blockquote>\n\n<ol>\n<li>And in list items.<a id=\"fnref5\" href=\"#fn5\"><sup>5</sup></a></li>\n</ol>\n\n<p>This paragraph should not be part of the note, as it is not indented.</p>\n<ol class=\"footnotes\">\n<li id=\"fn1\"><p>Here is the footnote. It can go anywhere after the footnote\nreference. It need not be placed at the end of the document. <a href=\"#fnref1\">&#8617;</a></p></li>\n<li id=\"fn2\"><p>Here’s the long note. This one contains multiple\nblocks.</p>\n\n<p>Subsequent blocks are indented to show that they belong to the\nfootnote (as with list items).</p>\n\n<pre><code>  { &lt;code&gt; }</code></pre>\n\n<p>If you want, you can indent every line, but you can also be\nlazy and just indent the first line of each block. <a href=\"#fnref2\">&#8617;</a></p></li>\n<li id=\"fn3\"><p>This\nis <em>easier</em> to type. Inline notes may contain\n<a href=\"http://google.com\" title=\"\">links</a> and <code>]</code> verbatim characters,\nas well as [bracketed text]. <a href=\"#fnref3\">&#8617;</a></p></li>\n<li id=\"fn4\"><p>In quote. <a href=\"#fnref4\">&#8617;</a></p></li>\n<li id=\"fn5\"><p>In list. <a href=\"#fnref5\">&#8617;</a></p></li>\n</ol>\n"
  },
  {
    "path": "pandoc-server/README.md",
    "content": "# pandoc-server\n\n`pandoc-server` is a Haskell library providing access to\npandoc's document conversions as an HTTP server.\n\nFor a description of the API, see\n[pandoc-server.md](https://github.com/jgm/pandoc/blob/master/doc/pandoc-server.md)\nin the pandoc source repository.\n\nExample of use:\n\n``` hs\nmodule Main where\nimport Text.Pandoc.Server (app)\nimport qualified Network.Wai.Handler.Warp as Warp\n\nmain :: IO ()\nmain = Warp.run 3000 app\n```\n\n## License\n\n© 2006-2024 John MacFarlane (jgm@berkeley.edu). Released under the\n[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html \"GNU General Public License\"),\nversion 2 or greater. This software carries no warranty of any kind.\n(See COPYRIGHT for full copyright and warranty notices.)\n"
  },
  {
    "path": "pandoc-server/pandoc-server.cabal",
    "content": "cabal-version:   2.4\nname:            pandoc-server\nversion:         0.1.2\nbuild-type:      Simple\nlicense:         GPL-2.0-or-later\nlicense-file:    COPYING.md\ncopyright:       (c) 2006-2024 John MacFarlane\nauthor:          John MacFarlane <jgm@berkeley.edu>\nmaintainer:      John MacFarlane <jgm@berkeley.edu>\nbug-reports:     https://github.com/jgm/pandoc/issues\nstability:       alpha\nhomepage:        https://pandoc.org\ncategory:        Text\ntested-with:     GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2,\n                 GHC == 9.2.5, GHC == 9.4.4\nsynopsis:        Pandoc document conversion as an HTTP servant-server\ndescription:     Pandoc-server provides pandoc's document conversion functions\n                 in an HTTP server.\nsource-repository head\n  type:          git\n  location:      https://github.com/jgm/pandoc.git\n\ncommon common-options\n  default-language: Haskell2010\n  build-depends:    base         >= 4.12 && < 5\n  ghc-options:      -Wall -fno-warn-unused-do-bind\n                    -Wincomplete-record-updates\n                    -Wnoncanonical-monad-instances\n                    -Wcpp-undef\n                    -Wincomplete-uni-patterns\n                    -Widentities\n                    -Wpartial-fields\n                    -Wmissing-signatures\n                    -fhide-source-paths\n                    -- -Wmissing-export-lists\n\n  if impl(ghc >= 8.10)\n    ghc-options:    -Wunused-packages\n\n  if impl(ghc >= 9.0)\n    ghc-options:    -Winvalid-haddock\n\n  if os(windows)\n    cpp-options:      -D_WINDOWS\n\ncommon common-executable\n  import:           common-options\n  ghc-options:      -rtsopts -with-rtsopts=-A8m -threaded\n\nlibrary\n  import:        common-options\n  build-depends: pandoc                >= 3.9      && < 3.10,\n                 pandoc-types          >= 1.22     && < 1.24,\n                 containers            >= 0.6.0.1  && < 0.9,\n                 aeson                 >= 2.0      && < 2.3,\n                 bytestring            >= 0.9      && < 0.13,\n                 base64-bytestring     >= 0.1      && < 1.3,\n                 doctemplates          >= 0.11     && < 0.12,\n                 data-default          >= 0.4      && < 0.9,\n                 text                  >= 1.1.1.0  && < 2.2,\n                 unicode-collation     >= 0.1.1    && < 0.2,\n                 servant-server        >= 0.19     && < 0.21,\n                 skylighting           >= 0.13     && < 0.15,\n                 wai                   >= 3.2      && < 3.3,\n                 wai-cors              >= 0.2.7    && < 0.3\n\n  hs-source-dirs:  src\n\n  exposed-modules: Text.Pandoc.Server\n  buildable:       True\n"
  },
  {
    "path": "pandoc-server/src/Text/Pandoc/Server.hs",
    "content": "{-# LANGUAGE DataKinds       #-}\n{-# LANGUAGE DeriveGeneric   #-}\n{-# LANGUAGE TypeOperators   #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Server\n    ( app\n    , API\n    , ServerOpts(..)\n    , Params(..)\n    , Blob(..)\n    , parseServerOptsFromArgs\n    ) where\n\nimport Data.Aeson\nimport qualified Data.Aeson.KeyMap as KeyMap\nimport Network.Wai\nimport Servant\nimport Text.DocTemplates as DocTemplates\nimport Text.Pandoc\nimport Text.Pandoc.Writers.Shared (lookupMetaString)\nimport Text.Pandoc.Citeproc (processCitations)\nimport Text.Pandoc.Highlighting (lookupHighlightingStyle)\nimport Text.Pandoc.Chunks (PathTemplate(..))\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Lazy.Encoding as TLE\nimport Data.Maybe (fromMaybe)\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.ByteString.Base64 as Base64 (decodeLenient, encode)\nimport Data.Default\nimport Control.Monad (when, unless, foldM)\nimport qualified Data.Set as Set\nimport Skylighting (defaultSyntaxMap)\nimport qualified Data.Map as M\nimport Text.Collate.Lang (Lang (..), parseLang)\nimport System.Console.GetOpt\nimport System.Environment (getProgName)\nimport qualified Control.Exception as E\nimport Text.Pandoc.Shared (safeStrRead)\nimport Text.Pandoc.App ( IpynbOutput (..), Opt(..), defaultOpts )\nimport Text.Pandoc.Builder (setMeta)\nimport Text.Pandoc.Format (parseFlavoredFormat, formatName)\nimport Text.Pandoc.SelfContained (makeSelfContained)\nimport Text.Pandoc.Transforms (headerShift, filterIpynbOutput,\n                               eastAsianLineBreakFilter)\nimport System.Exit\nimport GHC.Generics (Generic)\nimport Network.Wai.Middleware.Cors ( cors,\n           simpleCorsResourcePolicy, CorsResourcePolicy(corsRequestHeaders) )\n\ndata ServerOpts =\n  ServerOpts\n    { serverPort    :: Int\n    , serverTimeout :: Int }\n  deriving (Show)\n\ndefaultServerOpts :: ServerOpts\ndefaultServerOpts = ServerOpts { serverPort = 3030, serverTimeout = 2 }\n\ncliOptions :: [OptDescr (ServerOpts -> IO ServerOpts)]\ncliOptions =\n  [ Option ['p'] [\"port\"]\n      (ReqArg (\\s opts -> case safeStrRead s of\n                            Just i -> return opts{ serverPort = i }\n                            Nothing ->\n                              E.throwIO $ PandocOptionError $ T.pack\n                                s <> \" is not a number\") \"NUMBER\")\n      \"port number\"\n  , Option ['t'] [\"timeout\"]\n      (ReqArg (\\s opts -> case safeStrRead s of\n                            Just i -> return opts{ serverTimeout = i }\n                            Nothing ->\n                              E.throwIO $ PandocOptionError $ T.pack\n                                s <> \" is not a number\") \"NUMBER\")\n      \"timeout (seconds)\"\n\n  , Option ['h'] [\"help\"]\n      (NoArg (\\_ -> do\n        prg <- getProgName\n        let header = \"Usage: \" <> prg <> \" [OPTION...]\"\n        putStrLn $ usageInfo header cliOptions\n        exitSuccess))\n      \"help message\"\n\n  , Option ['v'] [\"version\"]\n      (NoArg (\\_ -> do\n        prg <- getProgName\n        putStrLn $ prg <> \" \" <> T.unpack pandocVersionText\n        exitSuccess))\n      \"version info\"\n\n  ]\n\nparseServerOptsFromArgs :: [String] -> IO ServerOpts\nparseServerOptsFromArgs args = do\n  let handleUnknownOpt x = \"Unknown option: \" <> x\n  case getOpt' Permute cliOptions args of\n    (os, ns, unrecognizedOpts, es) -> do\n      when (not (null es) || not (null unrecognizedOpts)) $\n        E.throwIO $ PandocOptionError $ T.pack $\n          concat es ++ unlines (map handleUnknownOpt unrecognizedOpts) ++\n          (\"Try --help for more information.\")\n      unless (null ns) $\n        E.throwIO $ PandocOptionError $ T.pack $\n                     \"Unknown arguments: \" <> unwords ns\n      foldM (flip ($)) defaultServerOpts os\n\nnewtype Blob = Blob BL.ByteString\n  deriving (Show, Eq)\n\ninstance ToJSON Blob where\n  toJSON (Blob bs) = toJSON (UTF8.toText . Base64.encode $ BL.toStrict bs)\n\ninstance FromJSON Blob where\n parseJSON = withText \"Blob\" $\n   pure . Blob . BL.fromStrict . Base64.decodeLenient . UTF8.fromText\n\n-- This is the data to be supplied by the JSON payload\n-- of requests.  Maybe values may be omitted and will be\n-- given default values.\ndata Params = Params\n  { options               :: Opt\n  , text                  :: Text\n  , files                 :: Maybe (M.Map FilePath Blob)\n  , citeproc              :: Maybe Bool\n  } deriving (Show)\n\ninstance Default Params where\n  def = Params\n    { options = defaultOpts\n    , text = mempty\n    , files = Nothing\n    , citeproc = Nothing\n    }\n\n-- Automatically derive code to convert to/from JSON.\ninstance FromJSON Params where\n parseJSON = withObject \"Params\" $ \\o ->\n   Params\n     <$> parseJSON (Object o)\n     <*> o .: \"text\"\n     <*> o .:? \"files\"\n     <*> o .:? \"citeproc\"\n\ninstance ToJSON Params where\n toJSON params =\n   case toJSON (options params) of\n     (Object o) -> Object $\n       KeyMap.insert \"text\" (toJSON $ text params)\n       . KeyMap.insert \"files\" (toJSON $ files params)\n       . KeyMap.insert \"citeproc\" (toJSON $ citeproc params)\n       $ o\n     x -> x\n\ndata Message =\n  Message\n  { verbosity :: Verbosity\n  , message   :: Text }\n  deriving (Generic, Show)\n\ninstance ToJSON Message where\n toEncoding = genericToEncoding defaultOptions\n\ntype Base64 = Bool\n\ndata Output = Succeeded Text Base64 [Message]\n            | Failed Text\n  deriving (Generic, Show)\n\ninstance ToJSON Output where\n  toEncoding (Succeeded o b m) = pairs\n    ( \"output\" .= o  <>\n      \"base64\" .= b  <>\n      \"messages\" .= m )\n  toEncoding (Failed errmsg) = pairs\n    ( \"error\" .= errmsg )\n\n-- This is the API.  The \"/convert\" endpoint takes a request body\n-- consisting of a JSON-encoded Params structure and responds to\n-- Get requests with either plain text or JSON, depending on the\n-- Accept header.\ntype API =\n  ReqBody '[JSON] Params :> Post '[OctetStream] BS.ByteString\n  :<|>\n  ReqBody '[JSON] Params :> Post '[PlainText] Text\n  :<|>\n  ReqBody '[JSON] Params :> Post '[JSON] Output\n  :<|>\n  \"batch\" :> ReqBody '[JSON] [Params] :> Post '[JSON] [Output]\n  :<|>\n  \"babelmark\" :> QueryParam' '[Required] \"text\" Text :> QueryParam \"from\" Text :> QueryParam \"to\" Text :> QueryFlag \"standalone\" :> Get '[JSON] Value\n  :<|>\n  \"version\" :> Get '[PlainText, JSON] Text\n\napp :: Application\napp = corsWithContentType $ serve api server\n\n-- | Allow Content-Type header with values other then allowed by simpleCors.\ncorsWithContentType :: Middleware\ncorsWithContentType = cors (const $ Just policy)\n    where\n      policy = simpleCorsResourcePolicy\n        { corsRequestHeaders = [\"Content-Type\"] }\n\napi :: Proxy API\napi = Proxy\n\nserver :: Server API\nserver = convertBytes\n    :<|> convertText\n    :<|> convertJSON\n    :<|> mapM convertJSON\n    :<|> babelmark  -- for babelmark which expects {\"html\": \"\", \"version\": \"\"}\n    :<|> pure pandocVersionText\n where\n  babelmark text' from' to' standalone' = do\n    res <- convertText def{\n                        text = text',\n                        options = defaultOpts{\n                          optFrom = from',\n                          optTo = to',\n                          optStandalone = standalone' }\n                      }\n    return $ toJSON $ object [ \"html\" .= res, \"version\" .= pandocVersion ]\n\n  -- We use runPure for the pandoc conversions, which ensures that\n  -- they will do no IO.  This makes the server safe to use.  However,\n  -- it will mean that features requiring IO, like RST includes, will not work.\n  -- Changing this to\n  --    handleErr =<< liftIO (runIO (convert' params))\n  -- will allow the IO operations.\n  convertText params = handleErr $\n    runPure (convert' return (return . UTF8.toText .\n                               Base64.encode . BL.toStrict) params)\n\n  convertBytes params = handleErr $\n    runPure (convert' (return . UTF8.fromText) (return . BL.toStrict) params)\n\n  convertJSON params = handleErrJSON $\n    runPure\n      (convert'\n        (\\t -> Succeeded t False . map toMessage <$> getLog)\n        (\\bs -> Succeeded (UTF8.toText $ Base64.encode (BL.toStrict bs)) True\n                 . map toMessage <$> getLog)\n        params)\n\n  toMessage m = Message { verbosity = messageVerbosity m\n                        , message = showLogMessage m }\n\n  convert' :: (Text -> PandocPure a)\n           -> (BL.ByteString -> PandocPure a)\n           -> Params -> PandocPure a\n  convert' textHandler bsHandler params = do\n    curtime <- getCurrentTime\n    -- put files params in ersatz file system\n    let addFile :: FilePath -> Blob -> FileTree -> FileTree\n        addFile fp (Blob lbs) =\n          insertInFileTree fp FileInfo{ infoFileMTime = curtime\n                                      , infoFileContents = BL.toStrict lbs }\n    case files params of\n      Nothing -> return ()\n      Just fs -> do\n        let filetree = M.foldrWithKey addFile mempty fs\n        modifyPureState $ \\st -> st{ stFiles = filetree }\n\n    let opts = options params\n    readerFormat <- parseFlavoredFormat <$> fromMaybe \"markdown\" $ optFrom opts\n    writerFormat <- parseFlavoredFormat <$> fromMaybe \"html\" $ optTo opts\n    (readerSpec, readerExts) <- getReader readerFormat\n    (writerSpec, writerExts) <- getWriter writerFormat\n\n    let isStandalone = optStandalone opts\n    let toformat = formatName writerFormat\n    hlStyle <- case optSyntaxHighlighting opts of\n      \"none\"      -> pure NoHighlighting\n      \"idiomatic\" -> pure IdiomaticHighlighting\n      \"default\"   -> pure DefaultHighlighting\n      s           -> Skylighting <$> lookupHighlightingStyle (T.unpack s)\n\n    mbTemplate <- if isStandalone\n                     then case optTemplate opts of\n                            Nothing -> Just <$>\n                              compileDefaultTemplate toformat\n                            Just t  -> Just <$>\n                              compileCustomTemplate toformat t\n                     else return Nothing\n\n    abbrevs <- Set.fromList . filter (not . T.null) . T.lines . UTF8.toText <$>\n                 case optAbbreviations opts of\n                      Nothing -> readDataFile \"abbreviations\"\n                      Just f  -> readFileStrict f\n\n    let readeropts = def{ readerExtensions = readerExts\n                        , readerStandalone = isStandalone\n                        , readerTabStop = optTabStop opts\n                        , readerIndentedCodeClasses =\n                            optIndentedCodeClasses opts\n                        , readerAbbreviations = abbrevs\n                        , readerDefaultImageExtension =\n                            optDefaultImageExtension opts\n                        , readerTrackChanges = optTrackChanges opts\n                        , readerStripComments = optStripComments opts\n                        }\n\n    let writeropts = WriterOptions\n             { writerExtensions = writerExts\n             , writerTabStop = optTabStop opts\n             , writerWrapText = optWrap opts\n             , writerColumns = optColumns opts\n             , writerTemplate = mbTemplate\n             , writerSyntaxMap = defaultSyntaxMap\n             , writerVariables = optVariables opts\n             , writerTableOfContents = optTableOfContents opts\n             , writerListOfFigures = optListOfFigures opts\n             , writerListOfTables = optListOfTables opts\n             , writerIncremental = optIncremental opts\n             , writerHTMLMathMethod = optHTMLMathMethod opts\n             , writerNumberSections = optNumberSections opts\n             , writerNumberOffset = optNumberOffset opts\n             , writerSectionDivs = optSectionDivs opts\n             , writerReferenceLinks = optReferenceLinks opts\n             , writerDpi = optDpi opts\n             , writerEmailObfuscation = optEmailObfuscation opts\n             , writerIdentifierPrefix = optIdentifierPrefix opts\n             , writerCiteMethod = optCiteMethod opts\n             , writerHtmlQTags = optHtmlQTags opts\n             , writerSlideLevel = optSlideLevel opts\n             , writerTopLevelDivision = optTopLevelDivision opts\n             , writerHighlightMethod = hlStyle\n             , writerSetextHeaders = optSetextHeaders opts\n             , writerListTables = optListTables opts\n             , writerEpubSubdirectory = T.pack $ optEpubSubdirectory opts\n             , writerEpubMetadata = T.pack <$> optEpubMetadata opts\n             , writerEpubFonts = optEpubFonts opts\n             , writerEpubTitlePage    = optEpubTitlePage opts\n             , writerSplitLevel = optSplitLevel opts\n             , writerChunkTemplate = maybe (PathTemplate \"%s-%i.html\")\n                                         PathTemplate\n                                         (optChunkTemplate opts)\n             , writerTOCDepth = optTOCDepth opts\n             , writerReferenceDoc = optReferenceDoc opts\n             , writerReferenceLocation = optReferenceLocation opts\n             , writerFigureCaptionPosition = optFigureCaptionPosition opts\n             , writerTableCaptionPosition = optTableCaptionPosition opts\n             , writerPreferAscii = optAscii opts\n             , writerLinkImages = optLinkImages opts\n             }\n\n    let reader = case readerSpec of\n                TextReader r -> r readeropts\n                ByteStringReader r ->\n                  r readeropts . BL.fromStrict . Base64.decodeLenient\n                    . UTF8.fromText\n\n    let writer d@(Pandoc meta _) = do\n          case lookupMetaString \"lang\" meta of\n              \"\"      -> setTranslations $\n                            Lang \"en\" Nothing (Just \"US\") [] [] []\n              l       -> case parseLang l of\n                              Left _   -> report $ InvalidLang l\n                              Right l' -> setTranslations l'\n          case writerSpec of\n                TextWriter w ->\n                  w writeropts d >>=\n                    (if optEmbedResources opts && htmlFormat (optTo opts)\n                        then makeSelfContained\n                        else return) >>=\n                    textHandler\n                ByteStringWriter w ->\n                  w writeropts d >>= bsHandler\n\n    let transforms :: Pandoc -> Pandoc\n        transforms = (case optShiftHeadingLevelBy opts of\n                        0             -> id\n                        x             -> headerShift x) .\n                   (if extensionEnabled Ext_east_asian_line_breaks\n                          readerExts &&\n                       not (extensionEnabled Ext_east_asian_line_breaks\n                              writerExts &&\n                            optWrap opts == WrapPreserve)\n                       then eastAsianLineBreakFilter\n                       else id) .\n                   (case optIpynbOutput opts of\n                     IpynbOutputAll  -> id\n                     IpynbOutputNone -> filterIpynbOutput Nothing\n                     IpynbOutputBest -> filterIpynbOutput (Just $\n                       case optTo opts of\n                            Just \"latex\"  -> Format \"latex\"\n                            Just \"beamer\" -> Format \"latex\"\n                            Nothing       -> Format \"html\"\n                            Just f\n                              | htmlFormat (optTo opts) -> Format \"html\"\n                              | otherwise -> Format f))\n\n    let meta =   (case optBibliography opts of\n                   [] -> id\n                   fs -> setMeta \"bibliography\" (MetaList\n                            (map (MetaString . T.pack) fs))) .\n                 maybe id (setMeta \"csl\" . MetaString . T.pack)\n                   (optCSL opts) .\n                 maybe id (setMeta \"citation-abbreviations\" . MetaString .\n                              T.pack)\n                   (optCitationAbbreviations opts) $\n                 optMetadata opts\n\n    let addMetadata m' (Pandoc m bs) = Pandoc (m <> m') bs\n\n    reader (text params) >>=\n      return . transforms . addMetadata meta >>=\n        (case citeproc params of\n          Just True -> processCitations\n          _ -> return) >>=\n      writer\n\n  htmlFormat :: Maybe Text -> Bool\n  htmlFormat Nothing = True\n  htmlFormat (Just f) =\n    any (`T.isPrefixOf` f)\n      [\"html\",\"html4\",\"html5\",\"s5\",\"slidy\", \"slideous\",\"dzslides\",\"revealjs\"]\n\n  handleErr (Right t) = return t\n  handleErr (Left err) = throwError $\n    err500 { errBody = TLE.encodeUtf8 $ TL.fromStrict $ renderError err }\n\n  handleErrJSON (Right o) = return o\n  handleErrJSON (Left err) =\n    return $ Failed (renderError err)\n\n  compileCustomTemplate toformat t = do\n    res <- runWithPartials $ compileTemplate (\"custom.\" <> T.unpack toformat)\n               (T.pack t)\n    case res of\n      Left e -> throwError $ PandocTemplateError (T.pack e)\n      Right tpl -> return tpl\n"
  },
  {
    "path": "pandoc.cabal",
    "content": "cabal-version:   2.4\nname:            pandoc\nversion:         3.9.0.2\nbuild-type:      Simple\nlicense:         GPL-2.0-or-later\nlicense-file:    COPYING.md\ncopyright:       (c) 2006-2024 John MacFarlane\nauthor:          John MacFarlane <jgm@berkeley.edu>\nmaintainer:      John MacFarlane <jgm@berkeley.edu>\nbug-reports:     https://github.com/jgm/pandoc/issues\nstability:       alpha\nhomepage:        https://pandoc.org\ncategory:        Text\ntested-with:     GHC == 9.6.7, GHC == 9.8.4, GHC == 9.10.3, GHC == 9.12.2\nsynopsis:        Conversion between markup formats\ndescription:     Pandoc is a Haskell library for converting from one markup\n                 format to another.  The formats it can handle include\n                 .\n                 - light markup formats (many variants of Markdown,\n                   reStructuredText, AsciiDoc, Org-mode, Muse, Textile,\n                   txt2tags, djot)\n                 - HTML formats (HTML 4 and 5)\n                 - Ebook formats (EPUB v2 and v3, FB2)\n                 - Documentation formats (GNU TexInfo, Haddock, Vimdoc)\n                 - Roff formats (man, ms)\n                 - TeX formats (LaTeX, ConTeXt)\n                 - Typst\n                 - XML formats (DocBook 4 and 5, JATS, TEI Simple, OpenDocument)\n                 - Outline formats (OPML)\n                 - Bibliography formats (BibTeX, BibLaTeX, CSL JSON, CSL YAML,\n                   RIS)\n                 - Word processor formats (Docx, RTF, ODT)\n                 - Interactive notebook formats (Jupyter notebook ipynb)\n                 - Page layout formats (InDesign ICML)\n                 - Wiki markup formats (MediaWiki, DokuWiki, TikiWiki, TWiki,\n                   Vimwiki, XWiki, ZimWiki, Jira wiki, Creole)\n                 - Slide show formats (LaTeX Beamer, PowerPoint, Slidy,\n                   reveal.js, Slideous, S5, DZSlides)\n                 - Data formats (CSV and TSV tables, Excel spreadsheets)\n                 - PDF (via external programs such as pdflatex or wkhtmltopdf)\n                 .\n                 Pandoc can convert mathematical content in documents\n                 between TeX, MathML, Word equations, roff eqn, typst,\n                 and plain text. It includes a powerful system for automatic\n                 citations and bibliographies, and it can be customized\n                 extensively using templates, filters, and custom readers\n                 and writers written in Lua.\n                 .\n                 For the pandoc command-line program, see the\n                 @pandoc-cli@ package.\ndata-files:\n                 -- templates\n                 data/templates/styles.html\n                 data/templates/styles.citations.html\n                 data/templates/default.html4\n                 data/templates/default.html5\n                 data/templates/default.chunkedhtml\n                 data/templates/default.djot\n                 data/templates/default.docbook4\n                 data/templates/default.docbook5\n                 data/templates/default.jats_archiving\n                 data/templates/default.jats_articleauthoring\n                 data/templates/default.jats_publishing\n                 data/templates/default.tei\n                 data/templates/default.opendocument\n                 data/templates/default.openxml\n                 data/templates/default.icml\n                 data/templates/default.opml\n                 data/templates/default.beamer\n                 data/templates/default.latex\n                 data/templates/default.bibtex\n                 data/templates/default.biblatex\n                 data/templates/default.context\n                 data/templates/default.texinfo\n                 data/templates/default.jira\n                 data/templates/default.man\n                 data/templates/default.ms\n                 data/templates/default.markdown\n                 data/templates/default.muse\n                 data/templates/default.commonmark\n                 data/templates/default.rst\n                 data/templates/default.plain\n                 data/templates/default.mediawiki\n                 data/templates/default.dokuwiki\n                 data/templates/default.xwiki\n                 data/templates/default.zimwiki\n                 data/templates/default.rtf\n                 data/templates/default.s5\n                 data/templates/default.slidy\n                 data/templates/default.slideous\n                 data/templates/default.revealjs\n                 data/templates/default.dzslides\n                 data/templates/default.asciidoc\n                 data/templates/default.haddock\n                 data/templates/default.textile\n                 data/templates/default.org\n                 data/templates/default.epub2\n                 data/templates/default.epub3\n                 data/templates/default.ansi\n                 data/templates/article.jats_publishing\n                 data/templates/affiliations.jats\n                 data/templates/default.markua\n                 data/templates/default.typst\n                 data/templates/document-metadata.latex\n                 data/templates/template.typst\n                 data/templates/common.latex\n                 data/templates/hypersetup.latex\n                 data/templates/passoptions.latex\n                 data/templates/fonts.latex\n                 data/templates/font-settings.latex\n                 data/templates/after-header-includes.latex\n                 data/templates/default.vimdoc\n                 data/templates/default.bbcode\n\n                 -- translations\n                 data/translations/*.yaml\n                 -- entities\n                 data/docbook-entities.txt\n                 -- source files for reference.docx\n                 data/docx/[Content_Types].xml\n                 data/docx/_rels/.rels\n                 data/docx/docProps/app.xml\n                 data/docx/docProps/core.xml\n                 data/docx/docProps/custom.xml\n                 data/docx/word/document.xml\n                 data/docx/word/fontTable.xml\n                 data/docx/word/comments.xml\n                 data/docx/word/footnotes.xml\n                 data/docx/word/numbering.xml\n                 data/docx/word/settings.xml\n                 data/docx/word/webSettings.xml\n                 data/docx/word/styles.xml\n                 data/docx/word/_rels/document.xml.rels\n                 data/docx/word/_rels/footnotes.xml.rels\n                 data/docx/word/theme/theme1.xml\n                 -- source files for reference.odt\n                 data/odt/mimetype\n                 data/odt/manifest.rdf\n                 data/odt/styles.xml\n                 data/odt/content.xml\n                 data/odt/meta.xml\n                 data/odt/META-INF/manifest.xml\n                 -- source files for reference.pptx\n                 data/pptx/_rels/.rels\n                 data/pptx/docProps/app.xml\n                 data/pptx/docProps/core.xml\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout1.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout2.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout3.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout4.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout5.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout6.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout7.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout8.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout9.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout10.xml.rels\n                 data/pptx/ppt/slideLayouts/_rels/slideLayout11.xml.rels\n                 data/pptx/ppt/slideLayouts/slideLayout1.xml\n                 data/pptx/ppt/slideLayouts/slideLayout2.xml\n                 data/pptx/ppt/slideLayouts/slideLayout3.xml\n                 data/pptx/ppt/slideLayouts/slideLayout4.xml\n                 data/pptx/ppt/slideLayouts/slideLayout5.xml\n                 data/pptx/ppt/slideLayouts/slideLayout6.xml\n                 data/pptx/ppt/slideLayouts/slideLayout7.xml\n                 data/pptx/ppt/slideLayouts/slideLayout8.xml\n                 data/pptx/ppt/slideLayouts/slideLayout9.xml\n                 data/pptx/ppt/slideLayouts/slideLayout10.xml\n                 data/pptx/ppt/slideLayouts/slideLayout11.xml\n                 data/pptx/ppt/_rels/presentation.xml.rels\n                 data/pptx/ppt/theme/theme1.xml\n                 data/pptx/ppt/presProps.xml\n                 data/pptx/ppt/slides/_rels/slide1.xml.rels\n                 data/pptx/ppt/slides/_rels/slide2.xml.rels\n                 data/pptx/ppt/slides/slide2.xml\n                 data/pptx/ppt/slides/slide1.xml\n                 data/pptx/ppt/slides/_rels/slide3.xml.rels\n                 data/pptx/ppt/slides/_rels/slide4.xml.rels\n                 data/pptx/ppt/slides/slide3.xml\n                 data/pptx/ppt/slides/slide4.xml\n                 data/pptx/ppt/viewProps.xml\n                 data/pptx/ppt/tableStyles.xml\n                 data/pptx/ppt/slideMasters/_rels/slideMaster1.xml.rels\n                 data/pptx/ppt/slideMasters/slideMaster1.xml\n                 data/pptx/ppt/presentation.xml\n                 data/pptx/ppt/notesMasters/_rels/notesMaster1.xml.rels\n                 data/pptx/ppt/notesMasters/notesMaster1.xml\n                 data/pptx/ppt/notesSlides/_rels/notesSlide1.xml.rels\n                 data/pptx/ppt/notesSlides/notesSlide1.xml\n                 data/pptx/ppt/notesSlides/_rels/notesSlide2.xml.rels\n                 data/pptx/ppt/notesSlides/notesSlide2.xml\n                 data/pptx/ppt/theme/theme2.xml\n                 data/pptx/[Content_Types].xml\n                  -- stylesheet for EPUB writer\n                 data/epub.css\n                 -- data for dzslides writer\n                 data/dzslides/template.html\n                 -- default abbreviations file\n                 data/abbreviations\n                 -- sample lua custom reader\n                 data/creole.lua\n                 -- lua init script\n                 data/init.lua\n                 -- bash completion template\n                 data/bash_completion.tpl\n                 -- citeproc\n                 data/default.csl\n                 citeproc/biblatex-localization/*.lbx.strings\n                 -- documentation\n                 MANUAL.txt, COPYRIGHT\nextra-doc-files: changelog.md,\n                 AUTHORS.md,\n                 INSTALL.md,\n                 README.md,\n                 CONTRIBUTING.md,\n                 BUGS\nextra-source-files:\n                 -- tests\n                 test/bodybg.gif\n                 test/*.native\n                 test/command/*.md\n                 test/command/*.csl\n                 test/command/*.svg\n                 test/command/7691.docx\n                 test/command/9391.docx\n                 test/command/9358.docx\n                 test/command/9002.docx\n                 test/command/9603.docx\n                 test/command/11113.docx\n                 test/command/biblio.bib\n                 test/command/averroes.bib\n                 test/command/A.txt\n                 test/command/B.txt\n                 test/command/C.txt\n                 test/command/D.txt\n                 test/command/file1.txt\n                 test/command/file2.txt\n                 test/command/three.txt\n                 test/command/11090/ch1.typ\n                 test/command/01.csv\n                 test/command/chap1/spider.png\n                 test/command/chap2/spider.png\n                 test/command/chap1/text.md\n                 test/command/chap2/text.md\n                 test/command/defaults1.yaml\n                 test/command/defaults2.yaml\n                 test/command/defaults3.yaml\n                 test/command/defaults4.yaml\n                 test/command/defaults5.yaml\n                 test/command/defaults6.yaml\n                 test/command/defaults7.yaml\n                 test/command/defaults8.yaml\n                 test/command/defaults9.yaml\n                 test/command/8024a.yaml\n                 test/command/8024b.yaml\n                 test/command/3533-rst-csv-tables.csv\n                 test/command/3880.txt\n                 test/command/5182.txt\n                 test/command/5700-metadata-file-1.yml\n                 test/command/5700-metadata-file-2.yml\n                 test/command/abbrevs\n                 test/command/sub-file-chapter-1.tex\n                 test/command/sub-file-chapter-2.tex\n                 test/command/bar.tex\n                 test/command/bar-endinput.tex\n                 test/command/yaml-metadata.yaml\n                 test/command/7813-meta.yaml\n                 test/command/3510-subdoc.org\n                 test/command/3510-export.latex\n                 test/command/3510-src.hs\n                 test/command/3971b.tex\n                 test/command/5876.yaml\n                 test/command/5876/metadata/5876.yaml\n                 test/command/5876/metadata/command/5876.yaml\n                 test/command/6466-beg.hs\n                 test/command/6466-end.hs\n                 test/command/6466-mid.hs\n                 test/command/6466-whole.hs\n                 test/command/7861.yaml\n                 test/command/7861/metadata/placeholder\n                 test/command/11486/scroll.revealjs\n                 test/command/11498.png\n                 test/asciidoc-reader.adoc\n                 test/asciidoc-reader.native\n                 test/asciidoc-reader-include.rb\n                 test/asciidoc-reader-include.adoc\n                 test/docbook-chapter.docbook\n                 test/docbook-reader.docbook\n                 test/docbook-xref.docbook\n                 test/endnotexml-reader.xml\n                 test/html-reader.html\n                 test/opml-reader.opml\n                 test/org-select-tags.org\n                 test/haddock-reader.haddock\n                 test/insert\n                 test/lalune.jpg\n                 test/man-reader.man\n                 test/movie.jpg\n                 test/media/rId25.jpg\n                 test/media/rId26.jpg\n                 test/media/rId27.jpg\n                 test/typst-reader.typ\n                 test/undergradmath.typ\n                 test/djot-reader.djot\n                 test/latex-reader.latex\n                 test/textile-reader.textile\n                 test/markdown-reader-more.txt\n                 test/markdown-citations.txt\n                 test/textile-reader.textile\n                 test/mediawiki-reader.wiki\n                 test/vimwiki-reader.wiki\n                 test/creole-reader.txt\n                 test/rst-reader.rst\n                 test/jats-reader.xml\n                 test/jira-reader.jira\n                 test/s5-basic.html\n                 test/s5-fancy.html\n                 test/s5-fragment.html\n                 test/s5-inserts.html\n                 test/tables.context\n                 test/tables.docbook4\n                 test/tables.docbook5\n                 test/tables.jats_archiving\n                 test/tables.jats_articleauthoring\n                 test/tables.jats_publishing\n                 test/tables.jira\n                 test/tables.djot\n                 test/tables.dokuwiki\n                 test/tables.zimwiki\n                 test/tables.icml\n                 test/tables.html4\n                 test/tables.html5\n                 test/tables.latex\n                 test/tables.man\n                 test/tables.ms\n                 test/tables.plain\n                 test/tables.markdown\n                 test/tables.markua\n                 test/tables.mediawiki\n                 test/tables.tei\n                 test/tables.textile\n                 test/tables.opendocument\n                 test/tables.org\n                 test/tables.asciidoc\n                 test/tables.asciidoc_legacy\n                 test/tables.haddock\n                 test/tables.texinfo\n                 test/tables.typst\n                 test/tables.rst\n                 test/tables.rtf\n                 test/tables.txt\n                 test/tables.fb2\n                 test/tables.muse\n                 test/tables.vimdoc\n                 test/tables.bbcode\n                 test/tables.xwiki\n                 test/tables/*.html4\n                 test/tables/*.html5\n                 test/tables/*.latex\n                 test/tables/*.typst\n                 test/tables/*.native\n                 test/tables/*.mediawiki\n                 test/tables/*.jats_archiving\n                 test/tables/*.markdown\n                 test/testsuite.txt\n                 test/ansi-test.txt\n                 test/writer.latex\n                 test/writer.context\n                 test/writer.djot\n                 test/writer.docbook4\n                 test/writer.docbook5\n                 test/writer.jats_archiving\n                 test/writer.jats_articleauthoring\n                 test/writer.jats_publishing\n                 test/writer.jira\n                 test/writer.html4\n                 test/writer.html5\n                 test/writer.man\n                 test/writer.ms\n                 test/writer.markdown\n                 test/writer.markua\n                 test/writer.plain\n                 test/writer.mediawiki\n                 test/writer.textile\n                 test/writer.typst\n                 test/writer.opendocument\n                 test/writer.org\n                 test/writer.asciidoc\n                 test/writer.asciidoc_legacy\n                 test/writer.haddock\n                 test/writer.rst\n                 test/writer.icml\n                 test/writer.rtf\n                 test/writer.tei\n                 test/writer.texinfo\n                 test/writer.fb2\n                 test/writer.opml\n                 test/writer.dokuwiki\n                 test/writer.zimwiki\n                 test/writer.xwiki\n                 test/writer.muse\n                 test/writer.vimdoc\n                 test/writer.bbcode\n                 test/ansi-test.ansi\n                 test/writers-lang-and-dir.latex\n                 test/writers-lang-and-dir.context\n                 test/dokuwiki_inline_formatting.dokuwiki\n                 test/lhs-test.markdown\n                 test/lhs-test.markdown+lhs\n                 test/lhs-test.rst\n                 test/lhs-test.rst+lhs\n                 test/lhs-test.latex\n                 test/lhs-test.latex+lhs\n                 test/lhs-test.html\n                 test/lhs-test.html+lhs\n                 test/lhs-test.fragment.html+lhs\n                 test/pipe-tables.txt\n                 test/dokuwiki_external_images.dokuwiki\n                 test/dokuwiki_multiblock_table.dokuwiki\n                 test/fb2/*.markdown\n                 test/fb2/*.fb2\n                 test/fb2/images-embedded.html\n                 test/fb2/images-embedded.fb2\n                 test/fb2/test-small.png\n                 test/fb2/reader/*.fb2\n                 test/fb2/reader/*.native\n                 test/fb2/test.jpg\n                 test/docx/*.docx\n                 test/docx/golden/*.docx\n                 test/docx/*.native\n                 test/epub/*.epub\n                 test/epub/*.native\n                 test/rtf/*.native\n                 test/rtf/*.rtf\n                 test/pptx/*.pptx\n                 test/pptx/**/*.pptx\n                 test/pptx/**/*.native\n                 test/pptx-reader/basic.pptx\n                 test/pptx-reader/basic.native\n                 test/ipynb/*.native\n                 test/ipynb/*.in.native\n                 test/ipynb/*.out.native\n                 test/ipynb/*.ipynb\n                 test/ipynb/*.out.ipynb\n                 test/ipynb/*.out.html\n                 test/txt2tags.t2t\n                 test/twiki-reader.twiki\n                 test/tikiwiki-reader.tikiwiki\n                 test/odt/odt/*.odt\n                 test/odt/markdown/*.md\n                 test/odt/native/*.native\n                 test/xlsx-reader/*.xlsx\n                 test/xlsx-reader/*.native\n                 test/pod-reader.pod\n                 test/vimdoc/*.markdown\n                 test/vimdoc/*.vimdoc\nsource-repository head\n  type:          git\n  location:      https://github.com/jgm/pandoc.git\n\nflag embed_data_files\n  Description:   Embed data files in binary for relocatable executable.\n  Default:       False\n\nflag http\n  Description:   Support for fetching resources using HTTP.\n  Default:       True\n\ncommon common-options\n  default-language: Haskell2010\n  build-depends:    base         >= 4.18 && < 5\n  ghc-options:      -Wall -fno-warn-unused-do-bind\n                    -Wincomplete-record-updates\n                    -Wnoncanonical-monad-instances\n                    -Wcpp-undef\n                    -Wincomplete-uni-patterns\n                    -Widentities\n                    -Wpartial-fields\n                    -Wmissing-signatures\n                    -fhide-source-paths\n                    -Wmissing-export-lists\n                    -Wunused-packages\n                    -Winvalid-haddock\n\n  if impl(ghc >= 9.12)\n    ghc-options:    -Wno-deriving-typeable\n\n  if os(windows)\n    cpp-options:      -D_WINDOWS\n\ncommon common-executable\n  import:           common-options\n  build-depends:    pandoc\n  ghc-options:      -rtsopts -with-rtsopts=-A8m -threaded\n\nlibrary xml-light\n  import:        common-options\n  build-depends: xml                   >= 1.3.12   && < 1.4,\n                 xml-conduit           >= 1.9.1.1  && < 1.11,\n                 xml-types             >= 0.3      && < 0.4,\n                 containers            >= 0.6.0.1  && < 0.9,\n                 text                  >= 1.1.1.0  && < 2.2\n\n  hs-source-dirs:  xml-light\n  exposed-modules: Text.Pandoc.XML.Light,\n                   Text.Pandoc.XML.Light.Types,\n                   Text.Pandoc.XML.Light.Proc,\n                   Text.Pandoc.XML.Light.Output\n\nlibrary\n  import:        common-options\n  build-depends: xml-light,\n                 Glob                  >= 0.7      && < 0.11,\n                 JuicyPixels           >= 3.1.6.1  && < 3.4,\n                 aeson                 >= 2.0.1.0  && < 2.3,\n                 aeson-pretty          >= 0.8.9    && < 0.9,\n                 array                 >= 0.5      && < 0.6,\n                 attoparsec            >= 0.12     && < 0.15,\n                 base64-bytestring     >= 0.1      && < 1.3,\n                 binary                >= 0.7      && < 0.11,\n                 blaze-html            >= 0.9      && < 0.10,\n                 blaze-markup          >= 0.8      && < 0.9,\n                 bytestring            >= 0.9      && < 0.13,\n                 case-insensitive      >= 1.2      && < 1.3,\n                 citeproc              >= 0.13     && < 0.14,\n                 commonmark            >= 0.2.6.1  && < 0.3,\n                 commonmark-extensions >= 0.2.6    && < 0.3,\n                 commonmark-pandoc     >= 0.2.3    && < 0.3,\n                 containers            >= 0.6.0.1  && < 0.9,\n                 crypton               >= 0.30     && < 1.2,\n                 data-default          >= 0.4      && < 0.9,\n                 deepseq               >= 1.3      && < 1.6,\n                 directory             >= 1.2.3    && < 1.4,\n                 doclayout             >= 0.5.0.1  && < 0.6,\n                 doctemplates          >= 0.11     && < 0.12,\n                 emojis                >= 0.1.4.1  && < 0.2,\n                 exceptions            >= 0.8      && < 0.11,\n                 file-embed            >= 0.0      && < 0.1,\n                 filepath              >= 1.1      && < 1.6,\n                 gridtables            >= 0.1      && < 0.2,\n                 haddock-library       >= 1.10     && < 1.12,\n                 http-types            >= 0.8      && < 0.13,\n                 ipynb                 >= 0.2      && < 0.3,\n                 jira-wiki-markup      >= 1.5.1    && < 1.6,\n                 mime-types            >= 0.1.1    && < 0.2,\n                 mtl                   >= 2.2      && < 2.4,\n                 network-uri           >= 2.6      && < 2.8,\n                 pandoc-types          >= 1.23.1   && < 1.24,\n                 parsec                >= 3.1      && < 3.2,\n                 pretty                >= 1.1      && < 1.2,\n                 pretty-show           >= 1.10     && < 1.11,\n                 process               >= 1.2.3    && < 1.7,\n                 random                >= 1.2      && < 1.4,\n                 safe                  >= 0.3.18   && < 0.4,\n                 scientific            >= 0.3      && < 0.4,\n                 skylighting           >= 0.14.7   && < 0.15,\n                 skylighting-core      >= 0.14.7   && < 0.15,\n                 split                 >= 0.2      && < 0.3,\n                 syb                   >= 0.1      && < 0.8,\n                 tagsoup               >= 0.14.6   && < 0.15,\n                 temporary             >= 1.1      && < 1.4,\n                 texmath               >= 0.13.1.1 && < 0.14,\n                 text                  >= 1.1.1.0  && < 2.2,\n                 text-conversions      >= 0.3      && < 0.4,\n                 time                  >= 1.5      && < 1.16,\n                 unicode-collation     >= 0.1.1    && < 0.2,\n                 unicode-data          >= 0.6      && < 0.9,\n                 unicode-transforms    >= 0.3      && < 0.5,\n                 yaml                  >= 0.11     && < 0.12,\n                 libyaml               >= 0.1.4    && < 0.2,\n                 zip-archive           >= 0.4.3.1  && < 0.5,\n                 zlib                  >= 0.5      && < 0.8,\n                 xml                   >= 1.3.12   && < 1.4,\n                 typst                 >= 0.9.0.1  && < 0.10,\n                 vector                >= 0.12     && < 0.14,\n                 djot                  >= 0.1.4    && < 0.2,\n                 asciidoc              >= 0.1.0.2  && < 0.2\n\n  if !os(windows)\n    build-depends:  unix >= 2.4 && < 2.9\n  if flag(embed_data_files)\n     cpp-options:   -DEMBED_DATA_FILES\n     other-modules: Text.Pandoc.Data.BakedIn\n  if flag(http)\n     cpp-options:   -DPANDOC_HTTP_SUPPORT\n     build-depends:\n                 crypton-connection    >= 0.3.1    && < 0.5,\n                 crypton-x509-system   >= 1.6.7    && < 1.10,\n                 http-client           >= 0.4.30   && < 0.8,\n                 http-client-tls       >= 0.2.4    && < 0.5,\n                 network               >= 2.6      && < 3.3,\n                 tls                   >= 2.0.1    && < 2.4\n  hs-source-dirs:  src\n\n  exposed-modules: Text.Pandoc,\n                   Text.Pandoc.App,\n                   Text.Pandoc.Data,\n                   Text.Pandoc.Options,\n                   Text.Pandoc.Extensions,\n                   Text.Pandoc.Format,\n                   Text.Pandoc.Shared,\n                   Text.Pandoc.Sources,\n                   Text.Pandoc.MediaBag,\n                   Text.Pandoc.Error,\n                   Text.Pandoc.Filter,\n                   Text.Pandoc.Translations,\n                   Text.Pandoc.Translations.Types,\n                   Text.Pandoc.Readers,\n                   Text.Pandoc.Readers.AsciiDoc,\n                   Text.Pandoc.Readers.HTML,\n                   Text.Pandoc.Readers.LaTeX,\n                   Text.Pandoc.Readers.Markdown,\n                   Text.Pandoc.Readers.CommonMark,\n                   Text.Pandoc.Readers.Creole,\n                   Text.Pandoc.Readers.BibTeX,\n                   Text.Pandoc.Readers.EndNote,\n                   Text.Pandoc.Readers.RIS,\n                   Text.Pandoc.Readers.CslJson,\n                   Text.Pandoc.Readers.MediaWiki,\n                   Text.Pandoc.Readers.Vimwiki,\n                   Text.Pandoc.Readers.RST,\n                   Text.Pandoc.Readers.Org,\n                   Text.Pandoc.Readers.DocBook,\n                   Text.Pandoc.Readers.JATS,\n                   Text.Pandoc.Readers.Jira,\n                   Text.Pandoc.Readers.OPML,\n                   Text.Pandoc.Readers.Textile,\n                   Text.Pandoc.Readers.Native,\n                   Text.Pandoc.Readers.Haddock,\n                   Text.Pandoc.Readers.TWiki,\n                   Text.Pandoc.Readers.TikiWiki,\n                   Text.Pandoc.Readers.Txt2Tags,\n                   Text.Pandoc.Readers.Docx,\n                   Text.Pandoc.Readers.Pptx,\n                   Text.Pandoc.Readers.Xlsx,\n                   Text.Pandoc.Readers.ODT,\n                   Text.Pandoc.Readers.EPUB,\n                   Text.Pandoc.Readers.Muse,\n                   Text.Pandoc.Readers.Man,\n                   Text.Pandoc.Readers.Mdoc,\n                   Text.Pandoc.Readers.FB2,\n                   Text.Pandoc.Readers.DokuWiki,\n                   Text.Pandoc.Readers.Ipynb,\n                   Text.Pandoc.Readers.CSV,\n                   Text.Pandoc.Readers.RTF,\n                   Text.Pandoc.Readers.Typst,\n                   Text.Pandoc.Readers.Djot,\n                   Text.Pandoc.Readers.Pod,\n                   Text.Pandoc.Writers,\n                   Text.Pandoc.Writers.Native,\n                   Text.Pandoc.Writers.XML,\n                   Text.Pandoc.Writers.DocBook,\n                   Text.Pandoc.Writers.JATS,\n                   Text.Pandoc.Writers.OPML,\n                   Text.Pandoc.Writers.HTML,\n                   Text.Pandoc.Writers.ChunkedHTML,\n                   Text.Pandoc.Writers.Ipynb,\n                   Text.Pandoc.Writers.ICML,\n                   Text.Pandoc.Writers.Jira,\n                   Text.Pandoc.Writers.LaTeX,\n                   Text.Pandoc.Writers.ConTeXt,\n                   Text.Pandoc.Writers.Djot,\n                   Text.Pandoc.Writers.Typst,\n                   Text.Pandoc.Writers.OpenDocument,\n                   Text.Pandoc.Writers.Texinfo,\n                   Text.Pandoc.Writers.Man,\n                   Text.Pandoc.Writers.Ms,\n                   Text.Pandoc.Writers.Markdown,\n                   Text.Pandoc.Writers.CommonMark,\n                   Text.Pandoc.Writers.Haddock,\n                   Text.Pandoc.Writers.RST,\n                   Text.Pandoc.Writers.Org,\n                   Text.Pandoc.Writers.AsciiDoc,\n                   Text.Pandoc.Writers.Textile,\n                   Text.Pandoc.Writers.MediaWiki,\n                   Text.Pandoc.Writers.DokuWiki,\n                   Text.Pandoc.Writers.XWiki,\n                   Text.Pandoc.Writers.ZimWiki,\n                   Text.Pandoc.Writers.RTF,\n                   Text.Pandoc.Writers.ODT,\n                   Text.Pandoc.Writers.Docx,\n                   Text.Pandoc.Writers.Powerpoint,\n                   Text.Pandoc.Writers.EPUB,\n                   Text.Pandoc.Writers.FB2,\n                   Text.Pandoc.Writers.TEI,\n                   Text.Pandoc.Writers.Muse,\n                   Text.Pandoc.Writers.CslJson,\n                   Text.Pandoc.Writers.Math,\n                   Text.Pandoc.Writers.Shared,\n                   Text.Pandoc.Writers.OOXML,\n                   Text.Pandoc.Writers.AnnotatedTable,\n                   Text.Pandoc.Writers.BibTeX,\n                   Text.Pandoc.Writers.ANSI,\n                   Text.Pandoc.Writers.Vimdoc,\n                   Text.Pandoc.Writers.BBCode,\n                   Text.Pandoc.PDF,\n                   Text.Pandoc.UTF8,\n                   Text.Pandoc.Scripting,\n                   Text.Pandoc.Slides,\n                   Text.Pandoc.Templates,\n                   Text.Pandoc.XML,\n                   Text.Pandoc.SelfContained,\n                   Text.Pandoc.Highlighting,\n                   Text.Pandoc.Logging,\n                   Text.Pandoc.Process,\n                   Text.Pandoc.MIME,\n                   Text.Pandoc.Parsing,\n                   Text.Pandoc.Asciify,\n                   Text.Pandoc.Emoji,\n                   Text.Pandoc.ImageSize,\n                   Text.Pandoc.Class,\n                   Text.Pandoc.Class.IO,\n                   Text.Pandoc.Citeproc,\n                   Text.Pandoc.Chunks,\n                   Text.Pandoc.Transforms,\n                   Text.Pandoc.Version\n  other-modules:   Text.Pandoc.App.CommandLineOptions,\n                   Text.Pandoc.App.Input,\n                   Text.Pandoc.App.Opt,\n                   Text.Pandoc.App.OutputSettings,\n                   Text.Pandoc.Class.CommonState,\n                   Text.Pandoc.Class.PandocMonad,\n                   Text.Pandoc.Class.PandocIO,\n                   Text.Pandoc.Class.PandocPure,\n                   Text.Pandoc.Class.Sandbox,\n                   Text.Pandoc.Filter.Environment,\n                   Text.Pandoc.Filter.JSON,\n                   Text.Pandoc.Parsing.Capabilities,\n                   Text.Pandoc.Parsing.Citations,\n                   Text.Pandoc.Parsing.General,\n                   Text.Pandoc.Parsing.GridTable,\n                   Text.Pandoc.Parsing.Lists,\n                   Text.Pandoc.Parsing.Math,\n                   Text.Pandoc.Parsing.Smart,\n                   Text.Pandoc.Parsing.State,\n                   Text.Pandoc.Parsing.Future,\n                   Text.Pandoc.Readers.Docx.Lists,\n                   Text.Pandoc.Readers.Docx.Combine,\n                   Text.Pandoc.Readers.Docx.Parse,\n                   Text.Pandoc.Readers.Docx.Parse.Styles,\n                   Text.Pandoc.Readers.Docx.Util,\n                   Text.Pandoc.Readers.Docx.Symbols,\n                   Text.Pandoc.Readers.Docx.Fields,\n                   Text.Pandoc.Readers.OOXML.Shared,\n                   Text.Pandoc.Readers.Pptx.Parse,\n                   Text.Pandoc.Readers.Pptx.Shapes,\n                   Text.Pandoc.Readers.Pptx.Slides,\n                   Text.Pandoc.Readers.Pptx.SmartArt,\n                   Text.Pandoc.Readers.Xlsx.Parse,\n                   Text.Pandoc.Readers.Xlsx.Cells,\n                   Text.Pandoc.Readers.Xlsx.Sheets,\n                   Text.Pandoc.Readers.HTML.Parsing,\n                   Text.Pandoc.Readers.HTML.Table,\n                   Text.Pandoc.Readers.HTML.TagCategories,\n                   Text.Pandoc.Readers.HTML.Types,\n                   Text.Pandoc.Readers.LaTeX.Inline,\n                   Text.Pandoc.Readers.LaTeX.Citation,\n                   Text.Pandoc.Readers.LaTeX.Lang,\n                   Text.Pandoc.Readers.LaTeX.Macro,\n                   Text.Pandoc.Readers.LaTeX.Math,\n                   Text.Pandoc.Readers.LaTeX.Parsing,\n                   Text.Pandoc.Readers.LaTeX.SIunitx,\n                   Text.Pandoc.Readers.LaTeX.Table,\n                   Text.Pandoc.Readers.Mdoc.Lex,\n                   Text.Pandoc.Readers.Mdoc.Macros,\n                   Text.Pandoc.Readers.Mdoc.Standards,\n                   Text.Pandoc.Readers.Typst.Parsing,\n                   Text.Pandoc.Readers.Typst.Math,\n                   Text.Pandoc.Readers.ODT.Base,\n                   Text.Pandoc.Readers.ODT.Namespaces,\n                   Text.Pandoc.Readers.ODT.StyleReader,\n                   Text.Pandoc.Readers.ODT.ContentReader,\n                   Text.Pandoc.Readers.ODT.Generic.Fallible,\n                   Text.Pandoc.Readers.ODT.Generic.SetMap,\n                   Text.Pandoc.Readers.ODT.Generic.Utils,\n                   Text.Pandoc.Readers.ODT.Generic.Namespaces,\n                   Text.Pandoc.Readers.ODT.Generic.XMLConverter,\n                   Text.Pandoc.Readers.ODT.Arrows.State,\n                   Text.Pandoc.Readers.ODT.Arrows.Utils,\n                   Text.Pandoc.Readers.Org.BlockStarts,\n                   Text.Pandoc.Readers.Org.Blocks,\n                   Text.Pandoc.Readers.Org.DocumentTree,\n                   Text.Pandoc.Readers.Org.ExportSettings,\n                   Text.Pandoc.Readers.Org.Inlines,\n                   Text.Pandoc.Readers.Org.Meta,\n                   Text.Pandoc.Readers.Org.ParserState,\n                   Text.Pandoc.Readers.Org.Parsing,\n                   Text.Pandoc.Readers.Org.Shared,\n                   Text.Pandoc.Readers.Metadata,\n                   Text.Pandoc.Readers.Roff,\n                   Text.Pandoc.Readers.Roff.Escape,\n                   Text.Pandoc.Readers.XML,\n                   Text.Pandoc.Writers.Docx.OpenXML,\n                   Text.Pandoc.Writers.Docx.StyleMap,\n                   Text.Pandoc.Writers.Docx.Table,\n                   Text.Pandoc.Writers.Docx.Types,\n                   Text.Pandoc.Writers.GridTable\n                   Text.Pandoc.Writers.JATS.References,\n                   Text.Pandoc.Writers.JATS.Table,\n                   Text.Pandoc.Writers.JATS.Types,\n                   Text.Pandoc.Writers.LaTeX.Caption,\n                   Text.Pandoc.Writers.LaTeX.Notes,\n                   Text.Pandoc.Writers.LaTeX.Table,\n                   Text.Pandoc.Writers.LaTeX.Lang,\n                   Text.Pandoc.Writers.LaTeX.Types,\n                   Text.Pandoc.Writers.LaTeX.Citation,\n                   Text.Pandoc.Writers.LaTeX.Util,\n                   Text.Pandoc.Writers.Markdown.Table,\n                   Text.Pandoc.Writers.Markdown.Types,\n                   Text.Pandoc.Writers.Markdown.Inline,\n                   Text.Pandoc.Writers.Roff,\n                   Text.Pandoc.Writers.Blaze,\n                   Text.Pandoc.Writers.Powerpoint.Presentation,\n                   Text.Pandoc.Writers.Powerpoint.Output,\n                   Text.Pandoc.Char,\n                   Text.Pandoc.TeX,\n                   Text.Pandoc.URI,\n                   Text.Pandoc.XMLFormat,\n                   Text.Pandoc.CSS,\n                   Text.Pandoc.CSV,\n                   Text.Pandoc.RoffChar,\n                   Text.Pandoc.UUID,\n                   Text.Pandoc.Image,\n                   Text.Pandoc.Citeproc.BibTeX,\n                   Text.Pandoc.Citeproc.Name,\n                   Text.Pandoc.Citeproc.CslJson,\n                   Text.Pandoc.Citeproc.Data,\n                   Text.Pandoc.Citeproc.Locator,\n                   Text.Pandoc.Citeproc.MetaValue,\n                   Text.Pandoc.Citeproc.Util,\n                   Paths_pandoc\n  autogen-modules: Paths_pandoc\n  buildable:       True\n\ntest-suite test-pandoc\n  import:         common-executable\n  type:           exitcode-stdio-1.0\n  main-is:        test-pandoc.hs\n  hs-source-dirs: test\n  build-depends:  pandoc,\n                  Diff              >= 0.2     && < 1.1,\n                  Glob              >= 0.7     && < 0.11,\n                  bytestring        >= 0.9     && < 0.13,\n                  containers        >= 0.4.2.1 && < 0.9,\n                  directory         >= 1.2.3   && < 1.4,\n                  doctemplates      >= 0.11    && < 0.12,\n                  filepath          >= 1.1     && < 1.6,\n                  mtl               >= 2.2     && < 2.4,\n                  pandoc-types      >= 1.23.1  && < 1.24,\n                  process           >= 1.2.3   && < 1.7,\n                  tasty             >= 0.11    && < 1.6,\n                  tasty-golden      >= 2.3     && < 2.4,\n                  tasty-hunit       >= 0.9     && < 0.11,\n                  tasty-quickcheck  >= 0.8     && < 0.12,\n                  text              >= 1.1.1.0 && < 2.2,\n                  temporary         >= 1.1     && < 1.4,\n                  time              >= 1.5     && < 1.16,\n                  xml               >= 1.3.12  && < 1.4,\n                  zip-archive       >= 0.4.3   && < 0.5\n  other-modules:  Tests.Old\n                  Tests.Command\n                  Tests.Helpers\n                  Tests.Shared\n                  Tests.MediaBag\n                  Tests.XML\n                  Tests.Readers.LaTeX\n                  Tests.Readers.HTML\n                  Tests.Readers.JATS\n                  Tests.Readers.Jira\n                  Tests.Readers.Markdown\n                  Tests.Readers.Org\n                  Tests.Readers.Org.Block\n                  Tests.Readers.Org.Block.CodeBlock\n                  Tests.Readers.Org.Block.Figure\n                  Tests.Readers.Org.Block.Header\n                  Tests.Readers.Org.Block.List\n                  Tests.Readers.Org.Block.Table\n                  Tests.Readers.Org.Directive\n                  Tests.Readers.Org.Inline\n                  Tests.Readers.Org.Inline.Citation\n                  Tests.Readers.Org.Inline.Note\n                  Tests.Readers.Org.Inline.Smart\n                  Tests.Readers.Org.Meta\n                  Tests.Readers.Org.Shared\n                  Tests.Readers.RST\n                  Tests.Readers.RTF\n                  Tests.Readers.Docx\n                  Tests.Readers.Pptx\n                  Tests.Readers.Xlsx\n                  Tests.Readers.ODT\n                  Tests.Readers.Txt2Tags\n                  Tests.Readers.EPUB\n                  Tests.Readers.Muse\n                  Tests.Readers.Creole\n                  Tests.Readers.Man\n                  Tests.Readers.Mdoc\n                  Tests.Readers.FB2\n                  Tests.Readers.Pod\n                  Tests.Readers.DokuWiki\n                  Tests.Writers.Native\n                  Tests.Writers.ConTeXt\n                  Tests.Writers.DocBook\n                  Tests.Writers.HTML\n                  Tests.Writers.JATS\n                  Tests.Writers.Jira\n                  Tests.Writers.Markdown\n                  Tests.Writers.Org\n                  Tests.Writers.Plain\n                  Tests.Writers.AsciiDoc\n                  Tests.Writers.LaTeX\n                  Tests.Writers.Docx\n                  Tests.Writers.RST\n                  Tests.Writers.TEI\n                  Tests.Writers.Markua\n                  Tests.Writers.Muse\n                  Tests.Writers.FB2\n                  Tests.Writers.Powerpoint\n                  Tests.Writers.OOXML\n                  Tests.Writers.Ms\n                  Tests.Writers.AnnotatedTable\n                  Tests.Writers.BBCode\n\nbenchmark benchmark-pandoc\n  import:          common-executable\n  type:            exitcode-stdio-1.0\n  main-is:         benchmark-pandoc.hs\n  hs-source-dirs:  benchmark\n  build-depends:   bytestring,\n                   tasty-bench >= 0.4     && <= 0.5,\n                   mtl         >= 2.2     && < 2.4,\n                   text        >= 1.1.1.0 && < 2.2,\n                   deepseq\n  -- we increase heap size to avoid benchmarking garbage collection:\n  ghc-options:     -rtsopts -with-rtsopts=-A8m -threaded\n"
  },
  {
    "path": "release.nix",
    "content": "let\n  pkgs = import <nixpkgs> { };\nin\n  pkgs.haskellPackages.callPackage ./project.nix { }\n"
  },
  {
    "path": "shell.nix",
    "content": "# based on https://gist.github.com/TikhonJelvis/be42400fc31bac0cd1736740fe5eb83b\n{ nixpkgs ? import <nixpkgs> {}, compiler ? \"default\" }:\n\nlet\n\n  inherit (nixpkgs) pkgs;\n\n  # Build a default.nix file from our .cabal file:\n  here = ./.;\n  project = pkgs.stdenv.mkDerivation ({\n    name = \"default.nix\";\n\n    buildCommand = ''\n    ${pkgs.cabal2nix}/bin/cabal2nix file://${here} > $out\n    '';\n  });\n\n  # Use the package set for our compiler:\n  haskellPackages = if compiler == \"default\"\n                       then pkgs.haskellPackages\n                       else pkgs.haskell.packages.${compiler};\n\n  # Helper function that gets Nix-packaged dependencies off GitHub.\n  # GitHub project needs a default.nix file for this to work.\n  fetchHaskell = { url, rev, sha256 }:\n    haskellPackages.callPackage (pkgs.fetchgit { inherit url rev sha256; }) {};\n\n  # Note: fetchHaskell shouldn't download the package if you already\n  # have it in the system.\n\n    base = haskellPackages.callPackage project {\n    ## Specify GitHub dependencies here.\n    ## You can get url, rev and sha256 by running 'nix-prefetch-git git@...'\n    # extraPackage = fetchHaskell {\n    #   url = \"git@...\";\n    #   rev = \"<commit hash>\";\n    #   sha256 = \"<sha256 hash>\";\n    # };\n  };\n\nin\n\n  if pkgs.lib.inNixShell then base.env else base\n"
  },
  {
    "path": "src/Text/Pandoc/App/CommandLineOptions.hs",
    "content": "{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections       #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{- |\n   Module      : Text.Pandoc.App.CommandLineOptions\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nDoes a pandoc conversion based on command-line options.\n-}\nmodule Text.Pandoc.App.CommandLineOptions (\n            parseOptions\n          , parseOptionsFromArgs\n          , handleOptInfo\n          , options\n          , engines\n          , setVariable\n          , versionInfo\n          ) where\nimport Control.Monad.Trans\nimport Control.Monad.State.Strict\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Aeson (eitherDecode)\nimport Data.Aeson.Encode.Pretty (encodePretty', Config(..), keyOrder,\n         defConfig, Indent(..), NumberFormat(..))\nimport Data.Bifunctor (second)\nimport Data.Char (toLower)\nimport Data.List (intercalate, sort)\nimport qualified Data.List as L\n#ifdef _WINDOWS\nimport Data.List (isPrefixOf)\n#endif\nimport Data.Maybe (fromMaybe, isJust)\nimport Data.Text (Text)\nimport Safe (tailDef)\nimport Skylighting (Syntax (..), defaultSyntaxMap)\nimport System.Console.GetOpt\nimport System.Environment (getArgs, getProgName)\nimport System.Exit (exitSuccess)\nimport System.FilePath\nimport System.IO (stdout)\nimport Text.DocTemplates (Context (..), ToContext (toVal), Val (..))\nimport Text.Pandoc\nimport Text.Pandoc.Builder (setMeta)\nimport Data.Version (showVersion)\nimport Text.Pandoc.App.Opt (Opt (..), LineEnding (..), IpynbOutput (..),\n                            DefaultsState (..), applyDefaults,\n                            fullDefaultsPath, OptInfo(..))\nimport Text.Pandoc.Filter (Filter (..))\nimport Text.Pandoc.Highlighting (highlightingStyles, lookupHighlightingStyle)\nimport Text.Pandoc.Scripting (ScriptingEngine (..), customTemplate)\nimport Text.Pandoc.Shared (safeStrRead)\nimport Text.Printf\nimport qualified Control.Exception as E\nimport Control.Monad.Except (ExceptT(..), runExceptT, throwError)\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as B\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.UTF8 as UTF8\n\nparseOptions :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]\n             -> Opt -> IO (Either OptInfo Opt)\nparseOptions options' defaults = do\n  rawArgs <- liftIO getArgs\n  prg <- liftIO getProgName\n  parseOptionsFromArgs options' defaults prg rawArgs\n\nparseOptionsFromArgs\n  :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]\n  -> Opt -> String -> [String] -> IO (Either OptInfo Opt)\nparseOptionsFromArgs options' defaults prg rawArgs = do\n  let (actions, args, unrecognizedOpts, errors) =\n           getOpt' Permute options' (preprocessArgs rawArgs)\n\n  let unknownOptionErrors =\n       foldr (handleUnrecognizedOption . takeWhile (/= '=')) []\n       unrecognizedOpts\n\n  let mbArgs = case args of\n                 [] -> Nothing\n                 xs -> Just xs\n\n  let adjustOpts opts =\n           opts{ optInputFiles =\n                   map normalizePath <$> (optInputFiles opts <> mbArgs)\n               , optStandalone = -- certain other options imply standalone\n                   optStandalone opts ||\n                     isJust (optTemplate opts) ||\n                     optSelfContained opts ||\n                     not (null (optIncludeInHeader opts)) ||\n                     not (null (optIncludeBeforeBody opts)) ||\n                     not (null (optIncludeAfterBody opts)) }\n\n  if (null errors && null unknownOptionErrors)\n     then -- thread option data structure through all supplied option actions\n       runExceptT $ adjustOpts <$> (L.foldl' (>>=) (return defaults) actions)\n     else return $ Left $ OptError $ PandocOptionError $ T.pack $\n             concat errors ++ unlines unknownOptionErrors ++\n             (\"Try \" ++ prg ++ \" --help for more information.\")\n\n-- | React to an 'OptInfo' by printing the requested information\n-- and exiting or (if there was a parsing error) raising an error.\nhandleOptInfo :: ScriptingEngine -> OptInfo -> IO ()\nhandleOptInfo engine info = E.handle (handleError . Left) $ do\n  case info of\n    BashCompletion -> do\n      datafiles <- getDataFileNames\n      tpl <- runIOorExplode $\n               UTF8.toString <$>\n                 readDefaultDataFile \"bash_completion.tpl\"\n      let optnames (Option shorts longs _ _) =\n            map (\\c -> ['-',c]) shorts ++\n            map (\"--\" ++) longs\n      let allopts = unwords (concatMap optnames options)\n      UTF8.hPutStrLn stdout $ T.pack $ printf tpl allopts\n          (T.unpack $ T.unwords readersNames)\n          (T.unpack $ T.unwords writersNames)\n          (T.unpack $ T.unwords $ map fst highlightingStyles)\n          (unwords datafiles)\n    ListInputFormats -> mapM_ (UTF8.hPutStrLn stdout) readersNames\n    ListOutputFormats -> mapM_ (UTF8.hPutStrLn stdout) writersNames\n    ListExtensions mbfmt -> do\n      let formatName = fromMaybe \"markdown\" mbfmt\n      let allExts = getAllExtensions formatName\n      if formatName `notElem`\n          (map fst (readers :: [(Text, Reader PandocPure)]) ++\n           map fst (writers :: [(Text, Writer PandocPure)]))\n         then E.throwIO $ PandocOptionError $ formatName <>\n                \" is not a recognized reader or writer format\"\n         else do\n           let defExts = getDefaultExtensions formatName\n           let showExt x =\n                (if extensionEnabled x defExts\n                    then '+'\n                    else if extensionEnabled x allExts\n                            then '-'\n                            else ' ') : drop 4 (show x)\n           mapM_ (UTF8.hPutStrLn stdout . T.pack . showExt)\n              (extensionsToList allExts)\n    ListHighlightLanguages -> do\n      let langs = [ T.unpack (T.toLower (sShortname s))\n                  | s <- M.elems defaultSyntaxMap\n                  , sShortname s `notElem`\n                     [T.pack \"Alert\", T.pack \"Alert_indent\"]\n                  ]\n      mapM_ (UTF8.hPutStrLn stdout . T.pack) (sort langs)\n    ListHighlightStyles -> do\n      mapM_ (UTF8.hPutStrLn stdout . fst) highlightingStyles\n    PrintDefaultTemplate mbout fmt -> do\n      let write = maybe (UTF8.hPutStr stdout) (UTF8.writeFile) mbout\n\n      templ <- runIO $\n               case splitExtension (T.unpack fmt) of\n                    (_, \"\") -> do\n                      -- built-in format\n                      setUserDataDir Nothing\n                      getDefaultTemplate fmt\n                    _ -> do\n                      -- format looks like a filepath => custom writer\n                      components <- engineLoadCustom engine (T.unpack fmt)\n                      case customTemplate components of\n                        Just t  -> pure t\n                        Nothing -> E.throw $ PandocNoTemplateError fmt\n      case templ of\n           Right t\n             | T.null t -> -- e.g. for docx, odt, json:\n                 E.throwIO $ PandocCouldNotFindDataFileError $ T.pack\n                   (\"templates/default.\" ++ T.unpack fmt)\n             | otherwise -> write t\n           Left e  -> E.throwIO e\n    PrintDefaultDataFile mbout f -> do\n      let write = maybe BS.putStr BS.writeFile mbout\n      runIOorExplode $ readDefaultDataFile (T.unpack f) >>= liftIO . write\n    PrintHighlightStyle mbout styleName -> do\n       let write = maybe B.putStr B.writeFile mbout\n       sty <- runIOorExplode $ lookupHighlightingStyle (T.unpack styleName)\n       write $ encodePretty'\n         defConfig{confIndent = Spaces 4\n                  ,confCompare = keyOrder\n                    (map T.pack\n                     [\"text-color\"\n                     ,\"background-color\"\n                     ,\"line-number-color\"\n                     ,\"line-number-background-color\"\n                     ,\"bold\"\n                     ,\"italic\"\n                     ,\"underline\"\n                     ,\"text-styles\"])\n                  ,confNumFormat = Generic\n                  ,confTrailingNewline = True} sty\n    VersionInfo -> versionInfo [] Nothing \"\"\n    Help -> do\n      prg <- getProgName\n      UTF8.hPutStr stdout (T.pack $ usageMessage prg options)\n    OptError e -> E.throwIO e\n  exitSuccess\n\n-- | Supported LaTeX engines; the first item is used as default engine\n-- when going through LaTeX.\nlatexEngines :: [String]\nlatexEngines  = [ \"pdflatex\", \"lualatex\", \"xelatex\", \"latexmk\", \"tectonic\"\n                , \"pdflatex-dev\", \"lualatex-dev\" ]\n\n-- | Supported HTML PDF engines; the first item is used as default\n-- engine when going through HTML.\nhtmlEngines :: [String]\nhtmlEngines  = [\"weasyprint\", \"wkhtmltopdf\", \"pagedjs-cli\", \"prince\"]\n\nengines :: [(Text, String)]\nengines = map (\"html\",) htmlEngines ++\n          map (\"html5\",) htmlEngines ++\n          map (\"latex\",) latexEngines ++\n          map (\"beamer\",) latexEngines ++\n          [ (\"ms\", \"pdfroff\")\n          , (\"ms\", \"groff\")\n          , (\"typst\", \"typst\")\n          , (\"context\", \"context\")\n          ]\n\npdfEngines :: [String]\npdfEngines = nubOrd $ map snd engines\n\n-- For motivation see #8956.  We want to allow things like `-si` without\n-- causing the `i` to be parsed as an optional boolean argument of `-s`.\n-- This is for backwards compatibility given the addition of optional\n-- boolean arguments in #8879.\npreprocessArgs :: [String] -> [String]\npreprocessArgs [] = []\npreprocessArgs (\"--\":xs) = \"--\" : xs -- a bare '--' ends option parsing\n-- note that -strue is interpreted as -strue while\n-- -stmarkdown is interpreted as -s -tmarkdown\npreprocessArgs (('-':c:d:cs):xs)\n  | isShortBooleanOpt c\n  , case toLower <$> (d:cs) of\n      \"true\" -> True\n      \"false\" -> True\n      _ -> False\n    = ('-':c:d:cs) : preprocessArgs xs\n  | isShortBooleanOpt c\n  , isShortOpt d = splitArg (c:d:cs) ++ preprocessArgs xs\npreprocessArgs (x:xs) = x : preprocessArgs xs\n\nisShortBooleanOpt :: Char -> Bool\nisShortBooleanOpt = (`Set.member` shortBooleanOpts)\n where\n  shortBooleanOpts =\n     Set.fromList [c | Option [c] _ (OptArg _ \"true|false\") _ <- options]\n\nisShortOpt :: Char -> Bool\nisShortOpt = (`Set.member` shortOpts)\n where\n  shortOpts = Set.fromList $ concat [cs | Option cs _ _ _ <- options]\n\nsplitArg :: String -> [String]\nsplitArg (c:d:cs)\n  | isShortBooleanOpt c\n  , isShortOpt d\n  = ['-',c] : splitArg (d:cs)\nsplitArg (c:cs) = ['-':c:cs]\nsplitArg [] = []\n\n-- | A list of functions, each transforming the options data structure\n--   in response to a command-line option.\noptions :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]\noptions =\n    [ Option \"fr\" [\"from\",\"read\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optFrom = Just $ T.pack arg })\n                  \"FORMAT\")\n                 \"\"\n\n    , Option \"tw\" [\"to\",\"write\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optTo = Just $ T.pack arg })\n                  \"FORMAT\")\n                 \"\"\n\n    , Option \"o\" [\"output\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optOutputFile =\n                                             Just (normalizePath arg) })\n                  \"FILE\")\n                 \"\" -- \"Name of output file\"\n\n    , Option \"\" [\"data-dir\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optDataDir =\n                                  Just (normalizePath arg) })\n                 \"DIRECTORY\") -- \"Directory containing pandoc data files.\"\n                \"\"\n\n    , Option \"M\" [\"metadata\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     let (key, val) = splitField arg\n                     return opt{ optMetadata = addMeta key val $\n                                                 optMetadata opt })\n                  \"KEY[:VALUE]\")\n                 \"\"\n\n    , Option \"\" [\"metadata-file\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optMetadataFiles =\n                      optMetadataFiles opt ++ [normalizePath arg] })\n                  \"FILE\")\n                 \"\"\n\n    , Option \"d\" [\"defaults\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     res <- liftIO $ runIO $ do\n                       let defsState =\n                             DefaultsState { curDefaults = Nothing,\n                                             inheritanceGraph = [] }\n                       fp <- fullDefaultsPath (optDataDir opt) arg\n                       evalStateT (applyDefaults opt fp) defsState\n                     case res of\n                       Left e -> optError e\n                       Right x -> return x\n                  )\n                  \"FILE\")\n                \"\"\n\n    , Option \"\" [\"file-scope\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--file-scope\" arg\n                        return opt { optFileScope = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Parse input files before combining\"\n\n    , Option \"\" [\"sandbox\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--sandbox\" arg\n                        return opt { optSandbox = boolValue })\n                  \"true|false\")\n                 \"\"\n\n    , Option \"s\" [\"standalone\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--standalone/-s\" arg\n                        return opt { optStandalone = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Include needed header and footer on output\"\n\n    , Option \"\" [\"template\"]\n                 (ReqArg\n                  (\\arg opt ->\n                     return opt{ optTemplate = Just (normalizePath arg) })\n                  \"FILE\")\n                 \"\" -- \"Use custom template\"\n\n    , Option \"V\" [\"variable\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     let (key, val) = splitField arg\n                     return opt{ optVariables =\n                                  setVariable (T.pack key) (T.pack val) $\n                                    optVariables opt })\n                  \"KEY[:VALUE]\")\n                 \"\"\n\n    , Option \"\" [\"variable-json\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     let (key, json) = splitField arg\n                     case eitherDecode (B.fromStrict . UTF8.fromString $ json) of\n                       Right (val :: Val Text) ->\n                         return opt{ optVariables =\n                                      let Context m = optVariables opt\n                                       in Context $ M.insert (T.pack key) val m }\n                           -- note that this replaces any existing value, which\n                           -- is different from what --variable does\n                       Left err'  -> optError $ PandocOptionError $\n                          \"Could not parse '\" <> T.pack json <> \"' as JSON:\\n\" <>\n                           T.pack err')\n                  \"KEY[:JSON]\")\n                 \"\"\n\n    , Option \"\" [\"wrap\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    case arg of\n                      \"auto\" -> return opt{ optWrap = WrapAuto }\n                      \"none\" -> return opt{ optWrap = WrapNone }\n                      \"preserve\" -> return opt{ optWrap = WrapPreserve }\n                      _      -> optError $ PandocOptionError\n                                 \"--wrap must be auto, none, or preserve\")\n                 \"auto|none|preserve\")\n                 \"\" -- \"Option for wrapping text in output\"\n\n    , Option \"\" [\"ascii\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--ascii\" arg\n                        return opt { optAscii = boolValue })\n                  \"true|false\")\n                 \"\"  -- \"Prefer ASCII output\"\n\n    , Option \"\" [\"toc\", \"table-of-contents\"]\n                (OptArg\n                 (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--toc/--table-of-contents\" arg\n                        return opt { optTableOfContents = boolValue })\n                 \"true|false\")\n               \"\" -- \"Include table of contents\"\n\n    , Option \"\" [\"toc-depth\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead arg of\n                           Just t | t >= 1 && t <= 6 ->\n                                    return opt { optTOCDepth = t }\n                           _ -> optError $ PandocOptionError\n                                \"Argument of --toc-depth must be a number 1-6\")\n                 \"NUMBER\")\n                 \"\" -- \"Number of levels to include in TOC\"\n\n    , Option \"\" [\"lof\", \"list-of-figures\"]\n                (OptArg\n                 (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--lof/--list-of-figures\" arg\n                        return opt { optListOfFigures = boolValue })\n                 \"true|false\")\n               \"\" -- \"Include list of figures\"\n\n    , Option \"\" [\"lot\", \"list-of-tables\"]\n                (OptArg\n                 (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--lot/--list-of-tables\" arg\n                        return opt { optListOfTables = boolValue })\n                 \"true|false\")\n               \"\" -- \"Include list of tables\"\n\n    , Option \"N\" [\"number-sections\"]\n                  (OptArg\n                   (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--number-sections/-N\" arg\n                        return opt { optNumberSections = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Number sections\"\n\n    , Option \"\" [\"number-offset\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead (\"[\" <> arg <> \"]\") of\n                           Just ns -> return opt { optNumberOffset = ns,\n                                                   optNumberSections = True }\n                           _      -> optError $ PandocOptionError\n                                       \"could not parse argument of --number-offset\")\n                 \"NUMBERS\")\n                 \"\" -- \"Starting number for sections, subsections, etc.\"\n\n    , Option \"\" [\"top-level-division\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case arg of\n                        \"section\" -> return opt{ optTopLevelDivision =\n                                        TopLevelSection }\n                        \"chapter\" -> return opt{ optTopLevelDivision =\n                                        TopLevelChapter }\n                        \"part\"    -> return opt{ optTopLevelDivision =\n                                        TopLevelPart }\n                        \"default\" -> return opt{ optTopLevelDivision =\n                                        TopLevelDefault }\n                        _ -> optError $ PandocOptionError $\n                                \"Argument of --top-level division must be \" <>\n                                \"section,  chapter, part, or default\" )\n                   \"section|chapter|part\")\n                 \"\" -- \"Use top-level division type in LaTeX, ConTeXt, DocBook\"\n\n    , Option \"\" [\"extract-media\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    return opt { optExtractMedia =\n                                  Just (normalizePath arg) })\n                  \"PATH\")\n                 \"\" -- \"Directory to which to extract embedded media\"\n\n    , Option \"\" [\"resource-path\"]\n                (ReqArg\n                  (\\arg opt -> return opt { optResourcePath =\n                                   splitSearchPath arg ++\n                                    optResourcePath opt })\n                   \"SEARCHPATH\")\n                  \"\" -- \"Paths to search for images and other resources\"\n\n    , Option \"H\" [\"include-in-header\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optIncludeInHeader =\n                                             optIncludeInHeader opt ++\n                                             [normalizePath arg] })\n                  \"FILE\")\n                 \"\" -- \"File to include at end of header (implies -s)\"\n\n    , Option \"B\" [\"include-before-body\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optIncludeBeforeBody =\n                                            optIncludeBeforeBody opt ++\n                                            [normalizePath arg] })\n                  \"FILE\")\n                 \"\" -- \"File to include before document body\"\n\n    , Option \"A\" [\"include-after-body\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optIncludeAfterBody =\n                                            optIncludeAfterBody opt ++\n                                            [normalizePath arg] })\n                  \"FILE\")\n                 \"\" -- \"File to include after document body\"\n\n    , Option \"\" [\"no-highlight\"]\n                (NoArg\n                 (\\opt -> do\n                     deprecatedOption \"--no-highlight\"\n                       \"Use --syntax-highlighting=none instead.\"\n                     return opt { optSyntaxHighlighting = NoHighlightingString }))\n                 \"\" -- \"Don't highlight source code\"\n\n    , Option \"\" [\"highlight-style\"]\n                (ReqArg\n                 (\\arg opt -> do\n                     deprecatedOption \"--highlight-style\"\n                       \"Use --syntax-highlighting instead.\"\n                     return opt{ optSyntaxHighlighting =\n                                 T.pack $ normalizePath arg })\n                 \"STYLE|FILE\")\n                 \"\" -- \"Style for highlighted code\"\n\n    , Option \"\" [\"syntax-definition\"]\n                (ReqArg\n                 (\\arg opt ->\n                   return opt{ optSyntaxDefinitions = normalizePath arg :\n                                optSyntaxDefinitions opt })\n                 \"FILE\")\n                \"\" -- \"Syntax definition (xml) file\"\n\n    , Option \"\" [\"syntax-highlighting\"]\n                (ReqArg\n                 (\\arg opt -> return opt{ optSyntaxHighlighting =\n                                 T.pack $ normalizePath arg })\n                 \"none|default|idiomatic|<stylename>|<themepath>\")\n                 \"\" -- \"syntax highlighting method for code\"\n\n\n    , Option \"\" [\"dpi\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    case safeStrRead arg of\n                         Just t | t > 0 -> return opt { optDpi = t }\n                         _              -> optError $ PandocOptionError\n                                        \"Argument of --dpi must be a number greater than 0\")\n                  \"NUMBER\")\n                 \"\" -- \"Dpi (default 96)\"\n\n    , Option \"\" [\"eol\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    case toLower <$> arg of\n                      \"crlf\"   -> return opt { optEol = CRLF }\n                      \"lf\"     -> return opt { optEol = LF }\n                      \"native\" -> return opt { optEol = Native }\n                      -- mac-syntax (cr) is not supported in ghc-base.\n                      _      -> optError $ PandocOptionError\n                                \"Argument of --eol must be crlf, lf, or native\")\n                  \"crlf|lf|native\")\n                 \"\" -- \"EOL (default OS-dependent)\"\n\n    , Option \"\" [\"columns\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead arg of\n                           Just t | t > 0 -> return opt { optColumns = t }\n                           _              -> optError $ PandocOptionError\n                                   \"Argument of --columns must be a number greater than 0\")\n                 \"NUMBER\")\n                 \"\" -- \"Length of line in characters\"\n\n    , Option \"p\" [\"preserve-tabs\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--preserve-tabs/-p\" arg\n                        return opt { optPreserveTabs = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Preserve tabs instead of converting to spaces\"\n\n    , Option \"\" [\"tab-stop\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead arg of\n                           Just t | t > 0 -> return opt { optTabStop = t }\n                           _              -> optError $ PandocOptionError\n                                  \"Argument of --tab-stop must be a number greater than 0\")\n                  \"NUMBER\")\n                 \"\" -- \"Tab stop (default 4)\"\n\n    , Option \"\" [\"pdf-engine\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     let b = takeBaseName arg\n                     if b `elem` pdfEngines\n                        then return opt { optPdfEngine = Just arg }\n                        else optError $\n                              PandocOptionError $ T.pack $\n                              \"Argument of --pdf-engine must be one of\\n\"\n                               ++ concatMap (\\e -> \"\\t\" <> e <> \"\\n\") pdfEngines)\n                  \"PROGRAM\")\n                 \"\" -- \"Name of program to use in generating PDF\"\n\n    , Option \"\" [\"pdf-engine-opt\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                      let oldArgs = optPdfEngineOpts opt\n                      return opt { optPdfEngineOpts = oldArgs ++ [arg]})\n                  \"STRING\")\n                 \"\" -- \"Flags to pass to the PDF-engine, all instances of this option are accumulated and used\"\n\n    , Option \"\" [\"reference-doc\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    return opt { optReferenceDoc = Just $ normalizePath arg })\n                  \"FILE\")\n                 \"\" -- \"Path of custom reference doc\"\n\n    , Option \"\" [\"self-contained\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        deprecatedOption \"--self-contained\" \"use --embed-resources --standalone\"\n                        boolValue <- readBoolFromOptArg \"--self-contained\" arg\n                        return opt { optSelfContained = boolValue })\n                    \"true|false\")\n                 \"\" -- \"Make slide shows include all the needed js and css (deprecated)\"\n\n    , Option \"\" [\"embed-resources\"] -- maybe True (\\argStr -> argStr == \"true\") arg\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--embed-resources\" arg\n                        return opt { optEmbedResources =  boolValue })\n                  \"true|false\")\n                 \"\" -- \"Make slide shows include all the needed js and css\"\n\n    , Option \"\" [\"link-images\"] -- maybe True (\\argStr -> argStr == \"true\") arg\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--link-images\" arg\n                        return opt { optLinkImages =  boolValue })\n                  \"true|false\")\n                 \"\" -- \"Link images in ODT rather than embedding them\"\n\n    , Option \"\" [\"request-header\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     let (key, val) = splitField arg\n                     return opt{ optRequestHeaders =\n                       (T.pack key, T.pack val) : optRequestHeaders opt })\n                  \"NAME:VALUE\")\n                 \"\"\n\n    , Option \"\" [\"no-check-certificate\"]\n                (OptArg\n                 (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--no-check-certificate\" arg\n                        return opt { optNoCheckCertificate = boolValue })\n                 \"true|false\")\n                \"\" -- \"Disable certificate validation\"\n\n    , Option \"\" [\"abbreviations\"]\n                (ReqArg\n                 (\\arg opt -> return opt { optAbbreviations =\n                                            Just $ normalizePath arg })\n                \"FILE\")\n                \"\" -- \"Specify file for custom abbreviations\"\n\n    , Option \"\" [\"indented-code-classes\"]\n                  (ReqArg\n                   (\\arg opt -> return opt { optIndentedCodeClasses = T.words $\n                                             T.map (\\c -> if c == ',' then ' ' else c) $\n                                             T.pack arg })\n                   \"STRING\")\n                  \"\" -- \"Classes (whitespace- or comma-separated) to use for indented code-blocks\"\n\n    , Option \"\" [\"default-image-extension\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optDefaultImageExtension = T.pack arg })\n                   \"extension\")\n                  \"\" -- \"Default extension for extensionless images\"\n\n    , Option \"F\" [\"filter\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optFilters =\n                      optFilters opt ++ [JSONFilter (normalizePath arg)] })\n                  \"PROGRAM\")\n                 \"\" -- \"External JSON filter\"\n\n    , Option \"L\" [\"lua-filter\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optFilters =\n                      optFilters opt ++ [LuaFilter (normalizePath arg)] })\n                  \"SCRIPTPATH\")\n                 \"\" -- \"Lua filter\"\n\n    , Option \"\" [\"shift-heading-level-by\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead arg of\n                           Just t ->\n                               return opt{ optShiftHeadingLevelBy = t }\n                           _              -> optError $ PandocOptionError\n                                               \"Argument of --shift-heading-level-by must be an integer\")\n                  \"NUMBER\")\n                 \"\" -- \"Shift heading level\"\n\n    , Option \"\" [\"base-header-level\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                      deprecatedOption \"--base-header-level\"\n                        \"Use --shift-heading-level-by instead.\"\n                      case safeStrRead arg of\n                           Just t | t > 0 && t < 6 ->\n                               return opt{ optShiftHeadingLevelBy = t - 1 }\n                           _              -> optError $ PandocOptionError\n                                               \"Argument of --base-header-level must be 1-5\")\n                  \"NUMBER\")\n                 \"\" -- \"Headers base level\"\n\n    , Option \"\" [\"track-changes\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     action <- case arg of\n                            \"accept\" -> return AcceptChanges\n                            \"reject\" -> return RejectChanges\n                            \"all\"    -> return AllChanges\n                            _        -> optError $ PandocOptionError $ T.pack\n                               \"Argument of --track-changes must be accept, reject, or all\"\n                     return opt { optTrackChanges = action })\n                  \"accept|reject|all\")\n                 \"\" -- \"Accepting or reject MS Word track-changes.\"\"\n\n    , Option \"\" [\"strip-comments\"]\n                (OptArg\n                 (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--strip-comments\" arg\n                        return opt { optStripComments = boolValue })\n                 \"true|false\")\n               \"\" -- \"Strip HTML comments\"\n\n    , Option \"\" [\"reference-links\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--reference-links\" arg\n                        return opt { optReferenceLinks = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Use reference links in parsing HTML\"\n\n    , Option \"\" [\"reference-location\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     action <- case arg of\n                            \"block\"    -> return EndOfBlock\n                            \"section\"  -> return EndOfSection\n                            \"document\" -> return EndOfDocument\n                            _        -> optError $ PandocOptionError $ T.pack\n                               \"Argument of --reference-location must be block, section, or document\"\n                     return opt { optReferenceLocation = action })\n                  \"block|section|document\")\n                 \"\" -- \"Specify where reference links and footnotes go\"\n\n    , Option \"\" [\"figure-caption-position\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     pos <- case arg of\n                            \"above\"  -> return CaptionAbove\n                            \"below\"  -> return CaptionBelow\n                            _        -> optError $ PandocOptionError $ T.pack\n                               \"Argument of --figure-caption-position must be above or below\"\n                     return opt { optFigureCaptionPosition = pos })\n                  \"above|below\")\n                 \"\" -- \"Specify where figure captions go\"\n\n    , Option \"\" [\"table-caption-position\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     pos <- case arg of\n                            \"above\"  -> return CaptionAbove\n                            \"below\"  -> return CaptionBelow\n                            _        -> optError $ PandocOptionError $ T.pack\n                               \"Argument of --table-caption-position must be above or below\"\n                     return opt { optTableCaptionPosition = pos })\n                  \"above|below\")\n                 \"\" -- \"Specify where table captions go\"\n\n    , Option \"\" [\"markdown-headings\"]\n                  (ReqArg\n                    (\\arg opt -> do\n                      headingFormat <- case arg of\n                        \"setext\" -> pure True\n                        \"atx\" -> pure False\n                        _ -> optError $ PandocOptionError $ T.pack\n                          \"Argument of --markdown-headings must be setext or atx\"\n                      pure opt { optSetextHeaders = headingFormat }\n                    )\n                  \"setext|atx\")\n                  \"\"\n\n    , Option \"\" [\"list-tables\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--list-tables\" arg\n                        return opt { optListTables = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Use list tables for RST\"\n\n    , Option \"\" [\"listings\"]\n                 (OptArg\n                  (\\arg opt -> do\n                      deprecatedOption \"--listings\"\n                        \"Use --syntax-highlighting=idiomatic instead.\"\n                      boolValue <- readBoolFromOptArg \"--listings\" arg\n                      return $\n                        if boolValue\n                        then opt { optSyntaxHighlighting =\n                                   IdiomaticHighlightingString }\n                        else opt)\n                  \"true|false\")\n                 \"\" -- \"Use listings package for LaTeX code blocks\"\n\n    , Option \"i\" [\"incremental\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--incremental/-i\" arg\n                        return opt { optIncremental = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Make list items display incrementally in Slidy/Slideous/S5\"\n\n    , Option \"\" [\"slide-level\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead arg of\n                           Just t | t >= 0 && t <= 6 ->\n                                    return opt { optSlideLevel = Just t }\n                           _      -> optError $ PandocOptionError\n                                    \"Argument of --slide-level must be a number between 0 and 6\")\n                 \"NUMBER\")\n                 \"\" -- \"Force header level for slides\"\n\n    , Option \"\" [\"section-divs\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--section-divs\" arg\n                        return opt { optSectionDivs = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Put sections in div tags in HTML\"\n\n    , Option \"\" [\"html-q-tags\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--html-q-tags\" arg\n                        return opt { optHtmlQTags = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Use <q> tags for quotes in HTML\"\n\n    , Option \"\" [\"email-obfuscation\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                     method <- case arg of\n                            \"references\" -> return ReferenceObfuscation\n                            \"javascript\" -> return JavascriptObfuscation\n                            \"none\"       -> return NoObfuscation\n                            _            -> optError $ PandocOptionError $ T.pack\n                               \"Argument of --email-obfuscation must be references, javascript, or none\"\n                     return opt { optEmailObfuscation = method })\n                  \"none|javascript|references\")\n                 \"\" -- \"Method for obfuscating email in HTML\"\n\n     , Option \"\" [\"id-prefix\"]\n                  (ReqArg\n                   (\\arg opt -> return opt { optIdentifierPrefix = T.pack arg })\n                   \"STRING\")\n                  \"\" -- \"Prefix to add to automatically generated HTML identifiers\"\n\n    , Option \"T\" [\"title-prefix\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    return opt {\n                       optVariables =\n                         setVariable \"title-prefix\" (T.pack arg) $\n                           optVariables opt,\n                       optStandalone = True })\n                  \"STRING\")\n                 \"\" -- \"String to prefix to HTML window title\"\n\n    , Option \"c\" [\"css\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optCss = optCss opt ++ [arg] })\n                  -- add new link to end, so it is included in proper order\n                  \"URL\")\n                 \"\" -- \"Link to CSS style sheet\"\n\n    , Option \"\" [\"epub-subdirectory\"]\n             (ReqArg\n                  (\\arg opt ->\n                     return opt { optEpubSubdirectory = arg })\n                  \"DIRNAME\")\n                 \"\" -- \"Name of subdirectory for epub content in OCF container\"\n\n    , Option \"\" [\"epub-cover-image\"]\n                 (ReqArg\n                  (\\arg opt ->\n                     return opt { optVariables =\n                       setVariable \"epub-cover-image\"\n                         (T.pack $ normalizePath arg) $\n                         optVariables opt })\n                  \"FILE\")\n                 \"\" -- \"Path of epub cover image\"\n\n    , Option \"\" [\"epub-title-page\"]\n                 (OptArg\n                  (\\arg opt -> do\n                     boolValue <- readBoolFromOptArg \"--epub-title-page\" arg\n                     return opt{ optEpubTitlePage = boolValue })\n                 \"true|false\")\n                 \"\"\n\n    , Option \"\" [\"epub-metadata\"]\n                 (ReqArg\n                  (\\arg opt -> return opt { optEpubMetadata = Just $\n                                             normalizePath arg })\n                  \"FILE\")\n                 \"\" -- \"Path of epub metadata file\"\n\n    , Option \"\" [\"epub-embed-font\"]\n                 (ReqArg\n                  (\\arg opt ->\n                     return opt{ optEpubFonts = normalizePath arg :\n                                                optEpubFonts opt })\n                  \"FILE\")\n                 \"\" -- \"Directory of fonts to embed\"\n\n    , Option \"\" [\"split-level\"]\n                 (ReqArg\n                  (\\arg opt ->\n                      case safeStrRead arg of\n                           Just t | t >= 1 && t <= 6 ->\n                                    return opt { optSplitLevel = t }\n                           _      -> optError $ PandocOptionError\n                                    \"Argument of --split-level must be a number between 1 and 6\")\n                 \"NUMBER\")\n                 \"\" -- \"Header level at which to split documents in chunked HTML or EPUB\"\n\n    , Option \"\" [\"chunk-template\"]\n                 (ReqArg\n                  (\\arg opt ->\n                     return opt{ optChunkTemplate = Just (T.pack arg) })\n                 \"PATHTEMPLATE\")\n                 \"\" -- \"Template for file paths in chunkedhtml\"\n\n    , Option \"\" [\"epub-chapter-level\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                      deprecatedOption \"--epub-chapter-level\"\n                                       \"use --split-level\"\n                      case safeStrRead arg of\n                           Just t | t >= 1 && t <= 6 ->\n                                    return opt { optSplitLevel = t }\n                           _      -> optError $ PandocOptionError\n                                    \"Argument of --epub-chapter-level must be a number between 1 and 6\")\n                 \"NUMBER\")\n                 \"\" -- \"Header level at which to split documents in chunked HTML or EPUB\"\n\n    , Option \"\" [\"ipynb-output\"]\n                 (ReqArg\n                  (\\arg opt ->\n                    case arg of\n                      \"all\" -> return opt{ optIpynbOutput = IpynbOutputAll }\n                      \"best\" -> return opt{ optIpynbOutput = IpynbOutputBest }\n                      \"none\" -> return opt{ optIpynbOutput = IpynbOutputNone }\n                      _ -> optError $ PandocOptionError\n                             \"Argument of --ipynb-output must be all, none, or best\")\n                 \"all|none|best\")\n                 \"\" -- \"Starting number for sections, subsections, etc.\"\n\n    , Option \"C\" [\"citeproc\"]\n                 (NoArg\n                  (\\opt -> return opt { optFilters =\n                      optFilters opt ++ [CiteprocFilter] }))\n                 \"\" -- \"Process citations\"\n\n    , Option \"\" [\"bibliography\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optMetadata =\n                                            addMeta \"bibliography\"\n                                              (normalizePath arg) $\n                                              optMetadata opt })\n                   \"FILE\")\n                 \"\"\n\n     , Option \"\" [\"csl\"]\n                 (ReqArg\n                  (\\arg opt -> do\n                    case lookupMeta (T.pack \"csl\") $ optMetadata opt of\n                      Just _ -> optError $ PandocOptionError\n                                   \"--csl option can only be used once\"\n                      Nothing -> return opt{ optMetadata = addMeta \"csl\" (normalizePath arg) $\n                      optMetadata opt })\n                   \"FILE\")\n                 \"\"\n\n     , Option \"\" [\"citation-abbreviations\"]\n                 (ReqArg\n                  (\\arg opt ->\n                     return opt{ optMetadata =\n                                  addMeta \"citation-abbreviations\"\n                                    (normalizePath arg) $ optMetadata opt })\n                   \"FILE\")\n                 \"\"\n\n    , Option \"\" [\"natbib\"]\n                 (NoArg\n                  (\\opt -> return opt { optCiteMethod = Natbib }))\n                 \"\" -- \"Use natbib cite commands in LaTeX output\"\n\n    , Option \"\" [\"biblatex\"]\n                 (NoArg\n                  (\\opt -> return opt { optCiteMethod = Biblatex }))\n                 \"\" -- \"Use biblatex cite commands in LaTeX output\"\n\n    , Option \"\" [\"mathml\"]\n                 (NoArg\n                  (\\opt ->\n                      return opt { optHTMLMathMethod = MathML }))\n                 \"\" -- \"Use mathml for HTML math\"\n\n    , Option \"\" [\"webtex\"]\n                 (OptArg\n                  (\\arg opt -> do\n                      let url' = maybe defaultWebTeXURL T.pack arg\n                      return opt { optHTMLMathMethod = WebTeX url' })\n                  \"URL\")\n                 \"\" -- \"Use web service for HTML math\"\n\n    , Option \"\" [\"mathjax\"]\n                 (OptArg\n                  (\\arg opt -> do\n                      let url' = maybe defaultMathJaxURL T.pack arg\n                      return opt { optHTMLMathMethod = MathJax url'})\n                  \"URL\")\n                 \"\" -- \"Use MathJax for HTML math\"\n\n    , Option \"\" [\"katex\"]\n                 (OptArg\n                  (\\arg opt ->\n                      return opt\n                        { optHTMLMathMethod = KaTeX $\n                           maybe defaultKaTeXURL T.pack arg })\n                  \"URL\")\n                  \"\" -- Use KaTeX for HTML Math\n\n    , Option \"\" [\"gladtex\"]\n                 (NoArg\n                  (\\opt ->\n                      return opt { optHTMLMathMethod = GladTeX }))\n                 \"\" -- \"Use gladtex for HTML math\"\n\n    , Option \"\" [\"trace\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--trace\" arg\n                        return opt { optTrace = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Turn on diagnostic tracing in readers.\"\n\n    , Option \"\" [\"dump-args\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--dump-args\" arg\n                        return opt { optDumpArgs = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Print output filename and arguments to stdout.\"\n\n    , Option \"\" [\"ignore-args\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--ignore-args\" arg\n                        return opt { optIgnoreArgs = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Ignore command-line arguments.\"\n\n    , Option \"\" [\"verbose\"]\n                 (NoArg\n                  (\\opt -> return opt { optVerbosity = INFO }))\n                 \"\" -- \"Verbose diagnostic output.\"\n\n    , Option \"\" [\"quiet\"]\n                 (NoArg\n                  (\\opt -> return opt { optVerbosity = ERROR }))\n                 \"\" -- \"Suppress warnings.\"\n\n    , Option \"\" [\"fail-if-warnings\"]\n                 (OptArg\n                  (\\arg opt -> do\n                        boolValue <- readBoolFromOptArg \"--fail-if-warnings\" arg\n                        return opt { optFailIfWarnings = boolValue })\n                  \"true|false\")\n                 \"\" -- \"Exit with error status if there were  warnings.\"\n\n    , Option \"\" [\"log\"]\n                 (ReqArg\n                  (\\arg opt -> return opt{ optLogFile = Just $\n                                            normalizePath arg })\n                \"FILE\")\n                \"\" -- \"Log messages in JSON format to this file.\"\n\n    , Option \"\" [\"bash-completion\"]\n                 (NoArg (\\_ -> optInfo BashCompletion))\n                 \"\" -- \"Print bash completion script\"\n\n    , Option \"\" [\"list-input-formats\"]\n                 (NoArg (\\_ -> optInfo ListInputFormats))\n                 \"\"\n\n    , Option \"\" [\"list-output-formats\"]\n                 (NoArg (\\_ -> optInfo ListOutputFormats))\n                 \"\"\n\n    , Option \"\" [\"list-extensions\"]\n                 (OptArg (\\arg _ -> optInfo $ ListExtensions $ T.pack <$> arg)\n                 \"FORMAT\")\n                 \"\"\n\n    , Option \"\" [\"list-highlight-languages\"]\n                 (NoArg (\\_ -> optInfo ListHighlightLanguages))\n                 \"\"\n\n    , Option \"\" [\"list-highlight-styles\"]\n                 (NoArg (\\_ -> optInfo ListHighlightStyles))\n                 \"\"\n\n    , Option \"D\" [\"print-default-template\"]\n                 (ReqArg\n                  (\\arg opts -> optInfo $\n                    PrintDefaultTemplate (optOutputFile opts) (T.pack arg))\n                 \"FORMAT\")\n                 \"\" -- \"Print default template for FORMAT\"\n\n    , Option \"\" [\"print-default-data-file\"]\n                 (ReqArg\n                  (\\arg opts -> optInfo $\n                    PrintDefaultDataFile (optOutputFile opts) (T.pack arg))\n                 \"FILE\")\n                  \"\" -- \"Print default data file\"\n\n    , Option \"\" [\"print-highlight-style\"]\n                 (ReqArg\n                  (\\arg opts ->\n                    optInfo $ PrintHighlightStyle (optOutputFile opts)\n                               (T.pack arg))\n                  \"STYLE|FILE\")\n                 \"\" -- \"Print default template for FORMAT\"\n\n    , Option \"v\" [\"version\"]\n                 (NoArg (\\_ -> optInfo VersionInfo))\n                 \"\" -- \"Print version\"\n\n    , Option \"h\" [\"help\"]\n                 (NoArg (\\_ -> optInfo Help))\n                 \"\" -- \"Show help\"\n    ]\n\noptError :: PandocError -> ExceptT OptInfo IO a\noptError = throwError . OptError\n\noptInfo :: OptInfo -> ExceptT OptInfo IO a\noptInfo = throwError\n\n-- Returns usage message\nusageMessage :: String -> [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> String\nusageMessage programName = usageInfo (programName ++ \" [OPTIONS] [FILES]\")\n\ncopyrightMessage :: String\ncopyrightMessage = intercalate \"\\n\" [\n \"Copyright (C) 2006-2025 John MacFarlane. Web:  https://pandoc.org\",\n \"This is free software; see the source for copying conditions. There is no\",\n \"warranty, not even for merchantability or fitness for a particular purpose.\" ]\n\nhandleUnrecognizedOption :: String -> [String] -> [String]\nhandleUnrecognizedOption \"--smart\" =\n  ((\"--smart/-S has been removed.  Use +smart or -smart extension instead.\\n\" ++\n    \"For example: pandoc -f markdown+smart -t markdown-smart.\") :)\nhandleUnrecognizedOption \"--normalize\" =\n  (\"--normalize has been removed.  Normalization is now automatic.\" :)\nhandleUnrecognizedOption \"-S\" = handleUnrecognizedOption \"--smart\"\nhandleUnrecognizedOption \"--old-dashes\" =\n  (\"--old-dashes has been removed.  Use +old_dashes extension instead.\" :)\nhandleUnrecognizedOption \"--no-wrap\" =\n  (\"--no-wrap has been removed.  Use --wrap=none instead.\" :)\nhandleUnrecognizedOption \"--latex-engine\" =\n  (\"--latex-engine has been removed.  Use --pdf-engine instead.\" :)\nhandleUnrecognizedOption \"--latex-engine-opt\" =\n  (\"--latex-engine-opt has been removed.  Use --pdf-engine-opt instead.\" :)\nhandleUnrecognizedOption \"--chapters\" =\n  (\"--chapters has been removed. Use --top-level-division=chapter instead.\" :)\nhandleUnrecognizedOption \"--reference-docx\" =\n  (\"--reference-docx has been removed. Use --reference-doc instead.\" :)\nhandleUnrecognizedOption \"--reference-odt\" =\n  (\"--reference-odt has been removed. Use --reference-doc instead.\" :)\nhandleUnrecognizedOption \"--parse-raw\" =\n  (\"--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.\\n\" :)\nhandleUnrecognizedOption \"--epub-stylesheet\" =\n  (\"--epub-stylesheet has been removed. Use --css instead.\\n\" :)\nhandleUnrecognizedOption \"-R\" = handleUnrecognizedOption \"--parse-raw\"\nhandleUnrecognizedOption x =\n  ((\"Unknown option \" ++ x ++ \".\") :)\n\nreadersNames :: [Text]\nreadersNames = sort (map fst (readers :: [(Text, Reader PandocIO)]))\n\nwritersNames :: [Text]\nwritersNames = sort\n  (\"pdf\" : map fst (writers :: [(Text, Writer PandocIO)]))\n\nsplitField :: String -> (String, String)\nsplitField = second (tailDef \"true\") . break (\\c -> c == ':' || c == '=')\n\ndeprecatedOption :: String -> String -> ExceptT OptInfo IO ()\ndeprecatedOption o msg = do\n  res <- liftIO $ runIO (report $ Deprecated (T.pack o) (T.pack msg))\n  case res of\n       Right () -> return ()\n       Left e   -> optError e\n\n-- | Set text value in text context.  Create list if it has a value already,\n-- or add to a list value.\nsetVariable :: Text -> Text -> Context Text -> Context Text\nsetVariable key val (Context ctx) = Context $ M.alter go key ctx\n  where go Nothing             = Just $ toVal val\n        go (Just (ListVal xs)) = Just $ ListVal $ xs ++ [toVal val]\n        go (Just x)            = Just $ ListVal [x, toVal val]\n\naddMeta :: String -> String -> Meta -> Meta\naddMeta k v meta =\n  case lookupMeta k' meta of\n       Nothing -> setMeta k' v' meta\n       Just (MetaList xs) ->\n                  setMeta k' (MetaList (xs ++ [v'])) meta\n       Just x  -> setMeta k' (MetaList [x, v']) meta\n where\n  v' = readMetaValue v\n  k' = T.pack k\n\nreadMetaValue :: String -> MetaValue\nreadMetaValue s\n  | s == \"true\"  = MetaBool True\n  | s == \"True\"  = MetaBool True\n  | s == \"TRUE\"  = MetaBool True\n  | s == \"false\" = MetaBool False\n  | s == \"False\" = MetaBool False\n  | s == \"FALSE\" = MetaBool False\n  | otherwise    = MetaString $ T.pack s\n\nreadBoolFromOptArg ::  Text -> Maybe String -> ExceptT OptInfo IO Bool\nreadBoolFromOptArg opt = maybe (return True) readBoolFromArg\n    where readBoolFromArg arg = case toLower <$> arg of\n            \"true\"  -> return True\n            \"false\" -> return False\n            _       -> optError $ PandocOptionError $\n                        \"Argument of \" <> opt <> \" must be either true or false\"\n\n-- On Windows with ghc 8.6+, we need to rewrite paths\n-- beginning with \\\\ to \\\\?\\UNC\\. -- See #5127.\nnormalizePath :: FilePath -> FilePath\n#ifdef _WINDOWS\nnormalizePath fp =\n  if \"\\\\\\\\\" `isPrefixOf` fp && not (\"\\\\\\\\?\\\\\" `isPrefixOf` fp)\n    then \"\\\\\\\\?\\\\UNC\\\\\" ++ drop 2 fp\n    else fp\n#else\nnormalizePath = id\n#endif\n\n-- | Print version information with customizable features and scripting engine\nversionInfo :: [String] -> Maybe String -> String -> IO ()\nversionInfo features mbScriptingEngineName suffix = do\n  defaultDatadir <- defaultUserDataDir\n  let featuresLine = if null features\n                       then []\n                       else [\"Features: \" ++ unwords features]\n  let scriptingLine = case mbScriptingEngineName of\n                        Nothing -> []\n                        Just name -> [\"Scripting engine: \" ++ name]\n  UTF8.putStr $ T.unlines $ map T.pack $\n    [\"pandoc \" ++ showVersion pandocVersion ++ suffix] ++\n    featuresLine ++\n    scriptingLine ++\n    [\"User data directory: \" ++ defaultDatadir,\n     copyrightMessage]\n  exitSuccess\n"
  },
  {
    "path": "src/Text/Pandoc/App/Input.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE TupleSections       #-}\n{- |\n   Module      : Text.Pandoc.App.Input\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n\nRead from the file system into a pandoc document.\n-}\nmodule Text.Pandoc.App.Input\n  ( InputParameters (..)\n  , readInput\n  ) where\n\nimport Control.Monad ((>=>), when)\nimport Control.Monad.Except (throwError, catchError)\nimport Data.Text (Text)\nimport Network.URI (URI (..), parseURI)\nimport Text.Pandoc.Transforms (adjustLinksAndIds)\nimport Text.Pandoc.Class ( PandocMonad, openURL, toTextM\n                         , readFileStrict, readStdinStrict, report)\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Logging (LogMessage (..))\nimport Text.Pandoc.MIME (getCharset, MimeType)\nimport Text.Pandoc.Options (ReaderOptions (..))\nimport Text.Pandoc.Readers (Reader (..))\nimport Text.Pandoc.Shared (tabFilter)\nimport Text.Pandoc.URI (uriPathToPath)\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Char8 as B8\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\n\n-- | Settings specifying how and which input should be processed.\ndata InputParameters m = InputParameters\n  { inputReader         :: Reader m\n  , inputReaderName     :: Text\n  , inputReaderOptions  :: ReaderOptions\n  , inputSources        :: [FilePath]\n  , inputSpacesPerTab   :: Maybe Int\n  , inputFileScope      :: Bool\n  }\n\n-- | Read all input into a pandoc document.\nreadInput :: PandocMonad m => InputParameters m -> m Pandoc\nreadInput params = do\n  let sources = inputSources params\n  let readerName = inputReaderName params\n  let readerOpts = inputReaderOptions params\n  let convertTabs :: Text -> Text\n      convertTabs = tabFilter $ case inputSpacesPerTab params of\n        Nothing -> 0\n        Just ts -> if readerName `elem` [\"t2t\", \"man\", \"tsv\"]\n                   then 0\n                   else ts\n\n  inputs <- readSources sources\n\n  case inputReader params of\n    TextReader r\n      | readerName == \"json\" ->\n          mconcat <$> mapM (inputToText convertTabs >=> r readerOpts . (:[]))\n                           inputs\n      | inputFileScope params ->\n          mconcat <$> mapM\n              (\\source -> do\n                  (fp, txt) <- inputToText convertTabs source\n                  adjustLinksAndIds (readerExtensions readerOpts)\n                    (T.pack fp) (map (T.pack . fst) inputs)\n                    <$> r readerOpts [(fp, txt)])\n              inputs\n      | otherwise -> mapM (inputToText convertTabs) inputs >>= r readerOpts\n    ByteStringReader r ->\n      mconcat <$> mapM (r readerOpts . inputToLazyByteString) inputs\n\nreadSources :: PandocMonad m\n            => [FilePath] -> m [(FilePath, (BS.ByteString, Maybe MimeType))]\nreadSources srcs =\n  mapM (\\fp -> do t <- readSource fp\n                  return (if fp == \"-\" then \"\" else fp, t)) srcs\n\n-- | Read input from a resource, i.e., either a file, a URL, or stdin\n-- (@-@).\nreadSource :: PandocMonad m\n           => FilePath -> m (BS.ByteString, Maybe MimeType)\nreadSource \"-\" = (,Nothing) <$> readStdinStrict\nreadSource src =\n  case parseURI src of\n    Just u | uriScheme u `elem` [\"http:\",\"https:\"] -> openURL (T.pack src)\n           | uriScheme u == \"file:\" ->\n               (,Nothing) <$>\n                 readFileStrict (uriPathToPath $ T.pack $ uriPath u)\n    _       -> (,Nothing) <$> readFileStrict src\n\ninputToText :: PandocMonad m\n            => (Text -> Text)\n            -> (FilePath, (BS.ByteString, Maybe MimeType))\n            -> m (FilePath, Text)\ninputToText convTabs (fp, (bs,mt)) =\n  (fp,) . convTabs . T.filter (/='\\r') <$>\n  case mt >>= getCharset of\n    Just \"UTF-8\"      -> toTextM fp bs\n    Just \"ISO-8859-1\" -> return $ T.pack $ B8.unpack bs\n    Just charset      -> throwError $ PandocUnsupportedCharsetError charset\n    Nothing           -> catchError\n                           (toTextM fp bs)\n                           (\\case\n                              PandocUTF8DecodingError{} -> do\n                                when (hasKnownSignature bs) $\n                                  throwError $\n                                    PandocInputNotTextError (T.pack fp)\n                                report $ NotUTF8Encoded\n                                  (if null fp\n                                      then \"input\"\n                                      else fp)\n                                return $ T.pack $ B8.unpack bs\n                              e -> throwError e)\n where\n  -- \"50 4B 03 04\" is zip file signature\n  isZip bs' = \"\\x50\\x4B\\x03\\x04\" `BS.isPrefixOf` bs'\n  -- \"25 50 44 46 2D\" is PDF file signature\n  isPDF bs' = \"\\x25\\x50\\x44\\x46\\x2D\" `BS.isPrefixOf` bs'\n  -- \"D0 CF 11 E0 A1 B1 1A E1\" is Compound File Binary Format signature used in\n  -- variety of old Microsoft formats (.doc and .xls among others)\n  isCFBF bs' = \"\\xD0\\xCF\\x11\\xE0\\xA1\\xB1\\x1A\\xE1\" `BS.isPrefixOf` bs'\n  -- \"41 54 26 54 46 4F 52 4D ?? ?? ?? ?? 44 4A 56\" is DjVu signature\n  isDjVu bs' = case BS.stripPrefix \"\\x41\\x54\\x26\\x54\\x46\\x4F\\x52\\x4D\" bs' of\n    Nothing -> False\n    Just x -> BS.isPrefixOf \"\\x44\\x4A\\x56\" $ BS.drop 4 x\n\n  hasKnownSignature bs' = any ($ bs') [isZip, isPDF, isCFBF, isDjVu]\n\ninputToLazyByteString :: (FilePath, (BS.ByteString, Maybe MimeType))\n                      -> BL.ByteString\ninputToLazyByteString (_, (bs,_)) = BL.fromStrict bs\n"
  },
  {
    "path": "src/Text/Pandoc/App/Opt.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE DeriveGeneric       #-}\n{-# LANGUAGE PatternSynonyms     #-}\n{-# LANGUAGE TemplateHaskell     #-}\n{-# LANGUAGE FlexibleInstances   #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{- |\n   Module      : Text.Pandoc.App.Opt\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nOptions for pandoc when used as an app.\n-}\nmodule Text.Pandoc.App.Opt (\n            Opt(..)\n          , OptInfo(..)\n          , LineEnding (..)\n          , IpynbOutput (..)\n          , DefaultsState (..)\n          , defaultOpts\n          , applyDefaults\n          , fullDefaultsPath\n          ) where\nimport Control.Monad.Except (throwError)\nimport Control.Monad.Trans (MonadIO, liftIO, lift)\nimport Control.Monad ((>=>), foldM)\nimport Control.Monad.State.Strict (StateT, modify, gets)\nimport System.FilePath ( addExtension, (</>), takeExtension, takeDirectory )\nimport System.Directory ( canonicalizePath )\nimport Data.Char (toLower, isSpace)\nimport Data.Maybe (fromMaybe)\nimport GHC.Generics hiding (Meta)\nimport Text.Pandoc.Filter (Filter (..))\nimport Text.Pandoc.Logging (Verbosity (WARNING), LogMessage(..))\nimport Text.Pandoc.Options (TopLevelDivision (TopLevelDefault),\n                            TrackChanges (AcceptChanges),\n                            WrapOption (WrapAuto), HTMLMathMethod (PlainMath),\n                            ReferenceLocation (EndOfDocument),\n                            CaptionPosition (..),\n                            ObfuscationMethod (NoObfuscation),\n                            CiteMethod (Citeproc),\n                            pattern DefaultHighlightingString)\nimport Text.Pandoc.Class (readFileStrict, fileExists, setVerbosity, report,\n                          PandocMonad(lookupEnv), getUserDataDir)\nimport Text.Pandoc.Error (PandocError (PandocParseError, PandocSomeError))\nimport Data.Containers.ListUtils (nubOrd)\nimport Text.Pandoc.Data (defaultUserDataDir)\nimport qualified Text.Pandoc.Parsing as P\nimport Text.Pandoc.Readers.Metadata (yamlMap)\nimport Text.Pandoc.Class.PandocPure\nimport Text.DocTemplates (Context(..))\nimport Data.Text (Text, unpack)\nimport Data.Default (def)\nimport qualified Data.Text as T\nimport qualified Data.Map as M\nimport qualified Data.ByteString.Char8 as B8\nimport Text.Pandoc.Definition (Meta(..), MetaValue(..))\nimport Data.Aeson (defaultOptions, Options(..), Result(..),\n                   genericToJSON, fromJSON, camelTo2, eitherDecodeStrict)\nimport Data.Aeson.TH (deriveJSON)\nimport Control.Applicative ((<|>))\nimport Data.Yaml\n\n-- | The type of line-endings to be used when writing plain-text.\ndata LineEnding = LF | CRLF | Native deriving (Show, Generic)\n\n-- see https://github.com/jgm/pandoc/pull/4083\n-- using generic deriving caused long compilation times\n$(deriveJSON\n   defaultOptions{ constructorTagModifier = map toLower } ''LineEnding)\n\n-- | How to handle output blocks in ipynb.\ndata IpynbOutput =\n    IpynbOutputAll\n  | IpynbOutputNone\n  | IpynbOutputBest\n  deriving (Show, Generic)\n\n$(deriveJSON\n   defaultOptions{ fieldLabelModifier = map toLower . drop 11 } ''IpynbOutput)\n\n-- | Option parser results requesting informational output.\ndata OptInfo =\n     BashCompletion\n   | ListInputFormats\n   | ListOutputFormats\n   | ListExtensions (Maybe Text)\n   | ListHighlightLanguages\n   | ListHighlightStyles\n   | PrintDefaultTemplate (Maybe FilePath) Text\n   | PrintDefaultDataFile (Maybe FilePath) Text\n   | PrintHighlightStyle (Maybe FilePath) Text\n   | VersionInfo\n   | Help\n   | OptError PandocError\n   deriving (Show, Generic)\n\n-- | Data structure for command line options.\ndata Opt = Opt\n    { optTabStop               :: Int     -- ^ Number of spaces per tab\n    , optPreserveTabs          :: Bool    -- ^ Preserve tabs instead of converting to spaces\n    , optStandalone            :: Bool    -- ^ Include header, footer\n    , optFrom                  :: Maybe Text  -- ^ Reader format\n    , optTo                    :: Maybe Text  -- ^ Writer format\n    , optTableOfContents       :: Bool    -- ^ Include table of contents\n    , optListOfFigures         :: Bool    -- ^ Include list of figures\n    , optListOfTables          :: Bool    -- ^ Include list of tables\n    , optShiftHeadingLevelBy   :: Int     -- ^ Shift heading level by\n    , optTemplate              :: Maybe FilePath  -- ^ Custom template\n    , optVariables             :: Context Text    -- ^ Template variables to set\n    , optMetadata              :: Meta -- ^ Metadata fields to set\n    , optMetadataFiles         :: [FilePath]  -- ^ Name of YAML metadata files\n    , optOutputFile            :: Maybe FilePath  -- ^ Name of output file\n    , optInputFiles            :: Maybe [FilePath] -- ^ Names of input files\n    , optNumberSections        :: Bool    -- ^ Number sections in LaTeX\n    , optNumberOffset          :: [Int]   -- ^ Starting number for sections\n    , optSectionDivs           :: Bool    -- ^ Put sections in div tags in HTML\n    , optIncremental           :: Bool    -- ^ Use incremental lists in Slidy/Slideous/S5\n    , optSelfContained         :: Bool    -- ^ Make HTML accessible offline (deprecated)\n    , optEmbedResources        :: Bool    -- ^ Make HTML accessible offline\n    , optLinkImages            :: Bool    -- ^ Link ODT images rather than embedding\n    , optHtmlQTags             :: Bool    -- ^ Use <q> tags in HTML\n    , optSyntaxDefinitions     :: [FilePath]  -- ^ xml syntax defs to load\n    , optSyntaxHighlighting    :: Text -- ^ Syntax highlighting method for code\n    , optTopLevelDivision      :: TopLevelDivision -- ^ Type of the top-level divisions\n    , optHTMLMathMethod        :: HTMLMathMethod -- ^ Method to print HTML math\n    , optAbbreviations         :: Maybe FilePath -- ^ Path to abbrevs file\n    , optReferenceDoc          :: Maybe FilePath -- ^ Path of reference doc\n    , optSplitLevel            :: Int     -- ^ Header level at which to split documents in epub and chunkedhtml\n    , optChunkTemplate         :: Maybe Text -- ^ Template to use for chunk filenames\n    , optEpubSubdirectory      :: String -- ^ EPUB subdir in OCF container\n    , optEpubMetadata          :: Maybe FilePath   -- ^ EPUB metadata\n    , optEpubFonts             :: [FilePath] -- ^ EPUB fonts to embed\n    , optEpubCoverImage        :: Maybe FilePath -- ^ Cover image for epub\n    , optEpubTitlePage         :: Bool -- ^ INclude title page in EPUB\n    , optTOCDepth              :: Int     -- ^ Number of levels to include in TOC\n    , optDumpArgs              :: Bool    -- ^ Output command-line arguments\n    , optIgnoreArgs            :: Bool    -- ^ Ignore command-line arguments\n    , optVerbosity             :: Verbosity  -- ^ Verbosity of diagnostic output\n    , optTrace                 :: Bool  -- ^ Enable tracing\n    , optLogFile               :: Maybe FilePath -- ^ File to write JSON log output\n    , optFailIfWarnings        :: Bool    -- ^ Fail on warnings\n    , optReferenceLinks        :: Bool    -- ^ Use reference links in writing markdown, rst\n    , optReferenceLocation     :: ReferenceLocation -- ^ location for footnotes and link references in markdown output\n    , optFigureCaptionPosition :: CaptionPosition -- ^ position for figure caption\n    , optTableCaptionPosition  :: CaptionPosition -- ^ position for table caption\n    , optDpi                   :: Int     -- ^ Dpi\n    , optWrap                  :: WrapOption  -- ^ Options for wrapping text\n    , optColumns               :: Int     -- ^ Line length in characters\n    , optFilters               :: [Filter] -- ^ Filters to apply\n    , optEmailObfuscation      :: ObfuscationMethod\n    , optIdentifierPrefix      :: Text\n    , optIndentedCodeClasses   :: [Text] -- ^ Default classes for indented code blocks\n    , optDataDir               :: Maybe FilePath\n    , optCiteMethod            :: CiteMethod -- ^ Method to output cites\n    , optPdfEngine             :: Maybe String -- ^ Program to use for latex/html -> pdf\n    , optPdfEngineOpts         :: [String]   -- ^ Flags to pass to the engine\n    , optSlideLevel            :: Maybe Int  -- ^ Header level that creates slides\n    , optSetextHeaders         :: Bool       -- ^ Use atx headers for markdown level 1-2\n    , optListTables            :: Bool       -- ^ Use list tables for RST\n    , optAscii                 :: Bool       -- ^ Prefer ascii output\n    , optDefaultImageExtension :: Text       -- ^ Default image extension\n    , optExtractMedia          :: Maybe FilePath -- ^ Path to extract embedded media\n    , optTrackChanges          :: TrackChanges -- ^ Accept or reject MS Word track-changes.\n    , optFileScope             :: Bool         -- ^ Parse input files before combining\n    , optTitlePrefix           :: Maybe Text     -- ^ Prefix for title\n    , optCss                   :: [FilePath]       -- ^ CSS files to link to\n    , optIpynbOutput           :: IpynbOutput      -- ^ How to treat ipynb output blocks\n    , optIncludeBeforeBody     :: [FilePath]       -- ^ Files to include before\n    , optIncludeAfterBody      :: [FilePath]       -- ^ Files to include after body\n    , optIncludeInHeader       :: [FilePath]       -- ^ Files to include in header\n    , optResourcePath          :: [FilePath] -- ^ Path to search for images etc\n    , optRequestHeaders        :: [(Text, Text)] -- ^ Headers for HTTP requests\n    , optNoCheckCertificate    :: Bool       -- ^ Disable certificate validation\n    , optEol                   :: LineEnding -- ^ Style of line-endings to use\n    , optStripComments         :: Bool       -- ^ Skip HTML comments\n    , optCSL                   :: Maybe FilePath -- ^ CSL stylesheet\n    , optBibliography          :: [FilePath]  -- ^ Bibliography files\n    , optCitationAbbreviations :: Maybe FilePath -- ^ Citation abbreviations\n    , optSandbox               :: Bool\n    } deriving (Generic, Show)\n\ninstance FromJSON Opt where\n   parseJSON = withObject \"Opt\" $ \\o ->\n     Opt\n       <$> o .:? \"tab-stop\" .!= optTabStop defaultOpts\n       <*> o .:? \"preserve-tabs\" .!= optPreserveTabs defaultOpts\n       <*> o .:? \"standalone\" .!= optStandalone defaultOpts\n       <*> o .:? \"from\"\n       <*> o .:? \"to\"\n       <*> o .:? \"table-of-contents\" .!= optTableOfContents defaultOpts\n       <*> o .:? \"list-of-figures\" .!= optListOfFigures defaultOpts\n       <*> o .:? \"list-of-tables\" .!= optListOfTables defaultOpts\n       <*> o .:? \"shift-heading-level-by\" .!= optShiftHeadingLevelBy defaultOpts\n       <*> o .:? \"template\"\n       <*> o .:? \"variables\" .!= optVariables defaultOpts\n       <*> o .:? \"metadata\" .!= optMetadata defaultOpts\n       <*> o .:? \"metadata-files\" .!= optMetadataFiles defaultOpts\n       <*> o .:? \"output-file\"\n       <*> o .:? \"input-files\"\n       <*> o .:? \"number-sections\" .!= optNumberSections defaultOpts\n       <*> o .:? \"number-offset\" .!= optNumberOffset defaultOpts\n       <*> o .:? \"section-divs\" .!= optSectionDivs defaultOpts\n       <*> o .:? \"incremental\" .!= optIncremental defaultOpts\n       <*> o .:? \"self-contained\" .!= optSelfContained defaultOpts\n       <*> o .:? \"embed-resources\" .!= optEmbedResources defaultOpts\n       <*> o .:? \"link-images\" .!= optLinkImages defaultOpts\n       <*> o .:? \"html-q-tags\" .!= optHtmlQTags defaultOpts\n       <*> o .:? \"syntax-definitions\" .!= optSyntaxDefinitions defaultOpts\n       <*> o .:? \"syntax-highlighting\" .!= optSyntaxHighlighting defaultOpts\n       <*> o .:? \"top-level-division\" .!= optTopLevelDivision defaultOpts\n       <*> o .:? \"html-math-method\" .!= optHTMLMathMethod defaultOpts\n       <*> o .:? \"abbreviations\"\n       <*> o .:? \"reference-doc\"\n       <*> ((o .:? \"split-level\") <|> (o .:? \"epub-chapter-level\"))\n             .!= optSplitLevel defaultOpts\n       <*> o .:? \"chunk-template\"\n       <*> o .:? \"epub-subdirectory\" .!= optEpubSubdirectory defaultOpts\n       <*> o .:? \"epub-metadata\"\n       <*> o .:? \"epub-fonts\" .!= optEpubFonts defaultOpts\n       <*> o .:? \"epub-cover-image\"\n       <*> o .:? \"epub-title-page\" .!= optEpubTitlePage defaultOpts\n       <*> o .:? \"toc-depth\" .!= optTOCDepth defaultOpts\n       <*> o .:? \"dump-args\" .!= optDumpArgs defaultOpts\n       <*> o .:? \"ignore-args\" .!= optIgnoreArgs defaultOpts\n       <*> o .:? \"verbosity\" .!= optVerbosity defaultOpts\n       <*> o .:? \"trace\" .!= optTrace defaultOpts\n       <*> o .:? \"log-file\"\n       <*> o .:? \"fail-if-warnings\" .!= optFailIfWarnings defaultOpts\n       <*> o .:? \"reference-links\" .!= optReferenceLinks defaultOpts\n       <*> o .:? \"reference-location\" .!= optReferenceLocation defaultOpts\n       <*> o .:? \"figure-caption-position\" .!= optFigureCaptionPosition defaultOpts\n       <*> o .:? \"table-caption-position\" .!= optTableCaptionPosition defaultOpts\n       <*> o .:? \"dpi\" .!= optDpi defaultOpts\n       <*> o .:? \"wrap\" .!= optWrap defaultOpts\n       <*> o .:? \"columns\" .!= optColumns defaultOpts\n       <*> o .:? \"filters\" .!= optFilters defaultOpts\n       <*> o .:? \"email-obfuscation\" .!= optEmailObfuscation defaultOpts\n       <*> o .:? \"identifier-prefix\" .!= optIdentifierPrefix defaultOpts\n       <*> o .:? \"indented-code-classes\" .!= optIndentedCodeClasses defaultOpts\n       <*> o .:? \"data-dir\"\n       <*> o .:? \"cite-method\" .!= optCiteMethod defaultOpts\n       <*> o .:? \"pdf-engine\"\n       <*> o .:? \"pdf-engine-opts\" .!= optPdfEngineOpts defaultOpts\n       <*> o .:? \"slide-level\"\n       <*> o .:? \"setext-headers\" .!= optSetextHeaders defaultOpts\n       <*> o .:? \"list-tables\" .!= optListTables defaultOpts\n       <*> o .:? \"ascii\" .!= optAscii defaultOpts\n       <*> o .:? \"default-image-extension\" .!= optDefaultImageExtension defaultOpts\n       <*> o .:? \"extract-media\"\n       <*> o .:? \"track-changes\" .!= optTrackChanges defaultOpts\n       <*> o .:? \"file-scope\" .!= optFileScope defaultOpts\n       <*> o .:? \"title-prefix\" .!= optTitlePrefix defaultOpts\n       <*> o .:? \"css\" .!= optCss defaultOpts\n       <*> o .:? \"ipynb-output\" .!= optIpynbOutput defaultOpts\n       <*> o .:? \"include-before-body\" .!= optIncludeBeforeBody defaultOpts\n       <*> o .:? \"include-after-body\" .!= optIncludeAfterBody defaultOpts\n       <*> o .:? \"include-in-header\" .!= optIncludeInHeader defaultOpts\n       <*> o .:? \"resource-path\" .!= optResourcePath defaultOpts\n       <*> o .:? \"request-headers\" .!= optRequestHeaders defaultOpts\n       <*> o .:? \"no-check-certificate\" .!= optNoCheckCertificate defaultOpts\n       <*> o .:? \"eol\" .!= optEol defaultOpts\n       <*> o .:? \"strip-comments\" .!= optStripComments defaultOpts\n       <*> o .:? \"csl\"\n       <*> o .:? \"bibliography\" .!= optBibliography defaultOpts\n       <*> o .:? \"citation-abbreviations\"\n       <*> o .:? \"sandbox\" .!= optSandbox defaultOpts\n\ninstance ToJSON Opt where\n toJSON = genericToJSON defaultOptions{\n                                 fieldLabelModifier = camelTo2 '-' . drop 3,\n                                 omitNothingFields = True }\n\n\ninstance FromJSON (Opt -> Opt) where\n  parseJSON (Object m) =\n    case fromJSON (Object m) of\n      Error err' -> fail err'\n      Success (m' :: M.Map Text Value) -> chain doOpt (M.toList m')\n  parseJSON _ = fail \"Expected a mapping\"\n\ndata DefaultsState = DefaultsState\n    {\n      curDefaults      :: Maybe FilePath -- currently parsed file\n    , inheritanceGraph :: [[FilePath]]   -- defaults file inheritance graph\n    } deriving (Show)\n\ninstance (PandocMonad m, MonadIO m)\n      => FromJSON (Opt -> StateT DefaultsState m Opt) where\n  parseJSON (Object o) =\n    case fromJSON (Object o) of\n      Error err' -> fail err'\n      Success (opts :: M.Map Text Value) -> do\n        dataDir <- case M.lookup \"data-dir\" opts of\n          Nothing -> return Nothing\n          Just v -> Just . unpack <$> parseJSON v\n        f <- parseOptions (M.toList opts)\n        case M.lookup \"defaults\" opts of\n          Just v -> do\n            g <- parseDefaults v dataDir\n            return  $ g >=> f >=> resolveVarsInOpt\n          Nothing -> return $ f >=> resolveVarsInOpt\n  parseJSON _ = fail \"Expected a mapping\"\n\nresolveVarsInOpt :: forall m. (PandocMonad m, MonadIO m)\n                 => Opt -> StateT DefaultsState m Opt\nresolveVarsInOpt\n    opt@Opt\n    { optTo                    = oTo\n    , optFrom                  = oFrom\n    , optTemplate              = oTemplate\n    , optMetadataFiles         = oMetadataFiles\n    , optOutputFile            = oOutputFile\n    , optInputFiles            = oInputFiles\n    , optSyntaxDefinitions     = oSyntaxDefinitions\n    , optSyntaxHighlighting    = oSyntaxHighlighting\n    , optAbbreviations         = oAbbreviations\n    , optReferenceDoc          = oReferenceDoc\n    , optEpubMetadata          = oEpubMetadata\n    , optEpubFonts             = oEpubFonts\n    , optEpubCoverImage        = oEpubCoverImage\n    , optLogFile               = oLogFile\n    , optFilters               = oFilters\n    , optDataDir               = oDataDir\n    , optExtractMedia          = oExtractMedia\n    , optCss                   = oCss\n    , optIncludeBeforeBody     = oIncludeBeforeBody\n    , optIncludeAfterBody      = oIncludeAfterBody\n    , optIncludeInHeader       = oIncludeInHeader\n    , optResourcePath          = oResourcePath\n    , optCSL                   = oCSL\n    , optBibliography          = oBibliography\n    , optCitationAbbreviations = oCitationAbbreviations\n    , optPdfEngine             = oPdfEngine\n    }\n  = do\n      oTo' <- mapM (fmap T.pack . resolveVars . T.unpack) oTo\n      oFrom' <- mapM (fmap T.pack . resolveVars . T.unpack) oFrom\n      oTemplate' <- mapM resolveVars oTemplate\n      oMetadataFiles' <- mapM resolveVars oMetadataFiles\n      oOutputFile' <- mapM resolveVars oOutputFile\n      oInputFiles' <- mapM (mapM resolveVars) oInputFiles\n      oSyntaxDefinitions' <- mapM resolveVars oSyntaxDefinitions\n      oAbbreviations' <- mapM resolveVars oAbbreviations\n      oReferenceDoc' <- mapM resolveVars oReferenceDoc\n      oEpubMetadata' <- mapM resolveVars oEpubMetadata\n      oEpubFonts' <- mapM resolveVars oEpubFonts\n      oEpubCoverImage' <- mapM resolveVars oEpubCoverImage\n      oLogFile' <- mapM resolveVars oLogFile\n      oFilters' <- mapM resolveVarsInFilter oFilters\n      oDataDir' <- mapM resolveVars oDataDir\n      oExtractMedia' <- mapM resolveVars oExtractMedia\n      oCss' <- mapM resolveVars oCss\n      oIncludeBeforeBody' <- mapM resolveVars oIncludeBeforeBody\n      oIncludeAfterBody' <- mapM resolveVars oIncludeAfterBody\n      oIncludeInHeader' <- mapM resolveVars oIncludeInHeader\n      oResourcePath' <- mapM resolveVars oResourcePath\n      oCSL' <- mapM resolveVars oCSL\n      oBibliography' <- mapM resolveVars oBibliography\n      oCitationAbbreviations' <- mapM resolveVars oCitationAbbreviations\n      oPdfEngine' <- mapM resolveVars oPdfEngine\n      oSyntaxHighlighting' <- T.pack <$> resolveVars (T.unpack oSyntaxHighlighting)\n      return opt{ optTo                    = oTo'\n                , optFrom                  = oFrom'\n                , optTemplate              = oTemplate'\n                , optMetadataFiles         = oMetadataFiles'\n                , optOutputFile            = oOutputFile'\n                , optInputFiles            = oInputFiles'\n                , optSyntaxDefinitions     = oSyntaxDefinitions'\n                , optSyntaxHighlighting    = oSyntaxHighlighting'\n                , optAbbreviations         = oAbbreviations'\n                , optReferenceDoc          = oReferenceDoc'\n                , optEpubMetadata          = oEpubMetadata'\n                , optEpubFonts             = oEpubFonts'\n                , optEpubCoverImage        = oEpubCoverImage'\n                , optLogFile               = oLogFile'\n                , optFilters               = oFilters'\n                , optDataDir               = oDataDir'\n                , optExtractMedia          = oExtractMedia'\n                , optCss                   = oCss'\n                , optIncludeBeforeBody     = oIncludeBeforeBody'\n                , optIncludeAfterBody      = oIncludeAfterBody'\n                , optIncludeInHeader       = oIncludeInHeader'\n                , optResourcePath          = oResourcePath'\n                , optCSL                   = oCSL'\n                , optBibliography          = oBibliography'\n                , optCitationAbbreviations = oCitationAbbreviations'\n                , optPdfEngine             = oPdfEngine'\n                }\n\n where\n  resolveVars = expandVars (optDataDir opt)\n  resolveVarsInFilter (JSONFilter fp) =\n    JSONFilter <$> resolveVars fp\n  resolveVarsInFilter (LuaFilter fp) =\n    LuaFilter <$> resolveVars fp\n  resolveVarsInFilter CiteprocFilter = return CiteprocFilter\n\n\nexpandVars :: (PandocMonad m, MonadIO m)\n           => Maybe FilePath\n           -> FilePath\n           -> StateT DefaultsState m FilePath\nexpandVars _ [] = return []\nexpandVars mbDataDir ('$':'{':xs) =\n    let (ys, zs) = break (=='}') xs\n     in if null zs\n           then return $ '$':'{':xs\n           else do\n             val <- expandEnv mbDataDir ys\n             (val ++) <$> expandVars mbDataDir (drop 1 zs)\nexpandVars mbDataDir (c:cs) = (c:) <$> expandVars mbDataDir cs\n\nexpandEnv :: (PandocMonad m, MonadIO m)\n          => Maybe FilePath\n          -> String\n          -> StateT DefaultsState m String\nexpandEnv _ \".\" = do\n    mbCurDefaults <- gets curDefaults\n    maybe (return \"\")\n          (fmap takeDirectory . liftIO . canonicalizePath)\n          mbCurDefaults\nexpandEnv mbDataDir \"USERDATA\" = do\n    mbodatadir <- mapM (expandVars mbDataDir) mbDataDir\n    mbdatadir'  <- getUserDataDir\n    defdatadir <- liftIO defaultUserDataDir\n    return $ fromMaybe defdatadir (mbodatadir <|> mbdatadir')\nexpandEnv _ v = do\n    mbval <- fmap T.unpack <$> lookupEnv (T.pack v)\n    case mbval of\n      Nothing -> do\n        report $ EnvironmentVariableUndefined (T.pack v)\n        return mempty\n      Just x  -> return x\n\n\n\nparseDefaults :: (PandocMonad m, MonadIO m)\n              => Value\n              -> Maybe FilePath\n              -> Parser (Opt -> StateT DefaultsState m Opt)\nparseDefaults n dataDir = parseDefsNames n >>= \\ds -> return $ \\o -> do\n  -- get parent defaults:\n  defsParent <- gets $ fromMaybe \"\" . curDefaults\n  expandedDataDir <- mapM (expandVars dataDir) dataDir\n  -- get child defaults:\n  defsChildren <- mapM (\\d -> expandVars expandedDataDir d >>= lift . fullDefaultsPath expandedDataDir) ds\n  -- expand parent in defaults inheritance graph by children:\n  defsGraph <- gets inheritanceGraph\n  let defsGraphExp = expand defsGraph defsChildren defsParent\n  modify $ \\defsState -> defsState{ inheritanceGraph = defsGraphExp }\n  -- check for cyclic inheritance:\n  if cyclic defsGraphExp\n    then throwError $\n      PandocSomeError $ T.pack $\n        \"Error: Circular defaults file reference in \" ++\n        \"'\" ++ defsParent ++ \"'\"\n    else foldM applyDefaults o defsChildren\n  where parseDefsNames x = (parseJSON x >>= \\xs -> return $ map unpack xs)\n                       <|> (parseJSON x >>= \\x' -> return [unpack x'])\n\nparseOptions :: Monad m\n             => [(Text, Value)]\n             -> Parser (Opt -> StateT DefaultsState m Opt)\nparseOptions ns = do\n  f <- chain doOpt' ns\n  return $ return . f\n\nchain :: Monad m => (a -> m (b -> b)) -> [a] -> m (b -> b)\nchain f = foldM g id\n  where g o n = f n >>= \\o' -> return $ o' . o\n\ndoOpt' :: (Text, Value) -> Parser (Opt -> Opt)\ndoOpt' (k,v) = do\n  case k of\n    \"defaults\" -> return id\n    _ -> doOpt (k,v)\n\ndoOpt :: (Text, Value) -> Parser (Opt -> Opt)\ndoOpt (k,v) = do\n  case k of\n    \"tab-stop\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTabStop = x })\n    \"preserve-tabs\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optPreserveTabs = x })\n    \"standalone\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optStandalone = x })\n    \"table-of-contents\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTableOfContents = x })\n    \"toc\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTableOfContents = x })\n    \"list-of-figures\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optListOfFigures = x })\n    \"lof\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optListOfFigures = x })\n    \"list-of-tables\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optListOfTables = x })\n    \"lot\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optListOfTables = x })\n    \"from\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optFrom = x })\n    \"reader\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optFrom = x })\n    \"to\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTo = x })\n    \"writer\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTo = x })\n    \"shift-heading-level-by\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optShiftHeadingLevelBy = x })\n    \"template\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTemplate = unpack <$> x })\n    \"variables\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optVariables =\n                                               x <> optVariables o })\n      -- Note: x comes first because <> for Context is left-biased union\n      -- and we want to favor later default files. See #5988.\n    \"metadata\" ->\n      yamlToMeta v >>= \\x -> return (\\o -> o{ optMetadata = optMetadata o <> x })\n    \"metadata-files\" ->\n      parseJSON v >>= \\x ->\n                        return (\\o -> o{ optMetadataFiles =\n                                           optMetadataFiles o <>\n                                           map unpack x })\n    \"metadata-file\" -> -- allow either a list or a single value\n      (parseJSON v >>= \\x -> return (\\o -> o{ optMetadataFiles =\n                                                optMetadataFiles o <>\n                                                map unpack x }))\n      <|>\n      (parseJSON v >>= \\x ->\n                        return (\\o -> o{ optMetadataFiles =\n                                           optMetadataFiles o <>[unpack x] }))\n    \"output-file\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optOutputFile = unpack <$> x })\n    \"input-files\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optInputFiles =\n                                              optInputFiles o <>\n                                                (map unpack <$> x) })\n    \"input-file\" -> -- allow either a list or a single value\n      (parseJSON v >>= \\x -> return (\\o -> o{ optInputFiles =\n                                                optInputFiles o <>\n                                                  (map unpack <$> x) }))\n      <|>\n      (parseJSON v >>= \\x -> return (\\o -> o{ optInputFiles =\n                                                optInputFiles o <>\n                                                ((\\z -> [unpack z]) <$> x)\n                                            }))\n    \"number-sections\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optNumberSections = x })\n    \"number-offset\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optNumberOffset = x })\n    \"section-divs\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSectionDivs = x })\n    \"incremental\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optIncremental = x })\n    \"self-contained\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSelfContained = x })\n    \"embed-resources\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optEmbedResources = x })\n    \"link-images\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optLinkImages = x })\n    \"html-q-tags\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optHtmlQTags = x })\n    -- Deprecated\n    \"highlight-style\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSyntaxHighlighting = x })\n    \"syntax-definition\" ->\n      (parseJSON v >>= \\x ->\n                return (\\o -> o{ optSyntaxDefinitions =\n                                   optSyntaxDefinitions o <> map unpack x }))\n      <|>\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optSyntaxDefinitions =\n                                 optSyntaxDefinitions o <> [unpack x] }))\n    \"syntax-definitions\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optSyntaxDefinitions =\n                                optSyntaxDefinitions o <> map unpack x })\n    \"syntax-highlighting\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSyntaxHighlighting = x })\n    \"top-level-division\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTopLevelDivision = x })\n    \"html-math-method\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optHTMLMathMethod = x })\n    \"abbreviations\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optAbbreviations = unpack <$> x })\n    \"reference-doc\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optReferenceDoc = unpack <$> x })\n    \"epub-subdirectory\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optEpubSubdirectory = unpack x })\n    \"epub-metadata\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optEpubMetadata = unpack <$> x })\n    \"epub-fonts\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optEpubFonts = optEpubFonts o <>\n                                               map unpack x })\n    \"epub-chapter-level\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSplitLevel = x })\n    \"split-level\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSplitLevel = x })\n    \"chunk-template\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optChunkTemplate = Just x })\n    \"epub-cover-image\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optEpubCoverImage = unpack <$> x })\n    \"epub-title-page\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optEpubTitlePage = x })\n    \"toc-depth\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTOCDepth = x })\n    \"dump-args\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optDumpArgs = x })\n    \"ignore-args\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optIgnoreArgs = x })\n    \"verbosity\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optVerbosity = x })\n    \"trace\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTrace = x })\n    \"log-file\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optLogFile = unpack <$> x })\n    \"fail-if-warnings\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optFailIfWarnings = x })\n    \"reference-links\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optReferenceLinks = x })\n    \"reference-location\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optReferenceLocation = x })\n    \"figure-caption-position\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optFigureCaptionPosition = x })\n    \"table-caption-position\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTableCaptionPosition = x })\n    \"dpi\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optDpi = x })\n    \"wrap\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optWrap = x })\n    \"columns\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optColumns = x })\n    \"filters\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optFilters = optFilters o <> x })\n    \"citeproc\" ->\n      parseJSON v >>= \\x ->\n        if x\n           then return (\\o -> o{ optFilters = CiteprocFilter : optFilters o })\n           else return id\n    \"email-obfuscation\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optEmailObfuscation = x })\n    \"identifier-prefix\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optIdentifierPrefix = x })\n    \"indented-code-classes\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optIndentedCodeClasses = x })\n    \"data-dir\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optDataDir = unpack <$> x })\n    \"cite-method\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optCiteMethod = x })\n    \"listings\" ->\n      parseJSON v >>= \\x ->\n        if x\n        then return (\\o -> o{ optSyntaxHighlighting = \"idiomatic\" })\n        else return id\n    \"pdf-engine\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optPdfEngine = unpack <$> x })\n    \"pdf-engine-opts\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optPdfEngineOpts = map unpack x })\n    \"pdf-engine-opt\" ->\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optPdfEngineOpts = map unpack x }))\n      <|>\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optPdfEngineOpts = [unpack x] }))\n    \"slide-level\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optSlideLevel = x })\n    \"markdown-headings\" ->\n      parseJSON v >>= \\x -> return (\\o ->\n        case T.toLower x of\n          \"atx\"    -> o{ optSetextHeaders = False }\n          \"setext\" -> o{ optSetextHeaders = True }\n          _        -> o)\n    \"list-tables\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optListTables = x })\n    \"ascii\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optAscii = x })\n    \"default-image-extension\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optDefaultImageExtension = x })\n    \"extract-media\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optExtractMedia = unpack <$> x })\n    \"track-changes\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTrackChanges = x })\n    \"file-scope\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optFileScope = x })\n    \"title-prefix\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optTitlePrefix = x,\n                                             optStandalone = True })\n    \"css\" ->\n      (parseJSON v >>= \\x -> return (\\o -> o{ optCss = optCss o <>\n                                                 map unpack x }))\n      <|>\n      (parseJSON v >>= \\x -> return (\\o -> o{ optCss = optCss o <>\n                                                [unpack x] }))\n    \"bibliography\" ->\n      (parseJSON v >>= \\x -> return (\\o ->\n                               o{ optBibliography = optBibliography o <>\n                                                      map unpack x }))\n      <|>\n      (parseJSON v >>= \\x -> return (\\o ->\n                               o{ optBibliography = optBibliography o <>\n                                                       [unpack x] }))\n    \"csl\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optCSL = unpack <$> x })\n    \"citation-abbreviations\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optCitationAbbreviations =\n                                                  unpack <$> x })\n    \"ipynb-output\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optIpynbOutput = x })\n    \"include-before-body\" ->\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optIncludeBeforeBody =\n                                optIncludeBeforeBody o <> map unpack x }))\n      <|>\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optIncludeBeforeBody =\n                                optIncludeBeforeBody o <> [unpack x] }))\n    \"include-after-body\" ->\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optIncludeAfterBody =\n                                optIncludeAfterBody o <> map unpack x }))\n      <|>\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optIncludeAfterBody =\n                                optIncludeAfterBody o <> [unpack x] }))\n    \"include-in-header\" ->\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optIncludeInHeader =\n                                optIncludeInHeader o <> map unpack x }))\n      <|>\n      (parseJSON v >>= \\x ->\n             return (\\o -> o{ optIncludeInHeader =\n                                optIncludeInHeader o <> [unpack x] }))\n    \"resource-path\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optResourcePath = map unpack x <>\n                                 optResourcePath o })\n    \"request-headers\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optRequestHeaders = x })\n    \"no-check-certificate\" ->\n      parseJSON v >>= \\x ->\n             return (\\o -> o{ optNoCheckCertificate = x })\n    \"eol\" ->\n      parseJSON v >>= \\x -> return (\\o -> o{ optEol = x })\n    \"strip-comments\" ->\n      parseJSON v >>= \\x -> return (\\o -> o  { optStripComments = x })\n    \"sandbox\" ->\n      parseJSON v >>= \\x -> return (\\o -> o  { optSandbox = x })\n    _ -> fail $ \"Unknown option \" ++ show k\n\n-- | Defaults for command-line options.\ndefaultOpts :: Opt\ndefaultOpts = Opt\n    { optTabStop               = 4\n    , optPreserveTabs          = False\n    , optStandalone            = False\n    , optFrom                  = Nothing\n    , optTo                    = Nothing\n    , optTableOfContents       = False\n    , optListOfFigures         = False\n    , optListOfTables          = False\n    , optShiftHeadingLevelBy   = 0\n    , optTemplate              = Nothing\n    , optVariables             = mempty\n    , optMetadata              = mempty\n    , optMetadataFiles         = []\n    , optOutputFile            = Nothing\n    , optInputFiles            = Nothing\n    , optNumberSections        = False\n    , optNumberOffset          = []\n    , optSectionDivs           = False\n    , optIncremental           = False\n    , optSelfContained         = False\n    , optEmbedResources        = False\n    , optLinkImages            = False\n    , optHtmlQTags             = False\n    , optSyntaxDefinitions     = []\n    , optSyntaxHighlighting    = DefaultHighlightingString\n    , optTopLevelDivision      = TopLevelDefault\n    , optHTMLMathMethod        = PlainMath\n    , optAbbreviations         = Nothing\n    , optReferenceDoc          = Nothing\n    , optSplitLevel            = 1\n    , optChunkTemplate         = Nothing\n    , optEpubSubdirectory      = \"EPUB\"\n    , optEpubMetadata          = Nothing\n    , optEpubFonts             = []\n    , optEpubCoverImage        = Nothing\n    , optEpubTitlePage         = True\n    , optTOCDepth              = 3\n    , optDumpArgs              = False\n    , optIgnoreArgs            = False\n    , optVerbosity             = WARNING\n    , optTrace                 = False\n    , optLogFile               = Nothing\n    , optFailIfWarnings        = False\n    , optReferenceLinks        = False\n    , optReferenceLocation     = EndOfDocument\n    , optFigureCaptionPosition = CaptionBelow\n    , optTableCaptionPosition  = CaptionAbove\n    , optDpi                   = 96\n    , optWrap                  = WrapAuto\n    , optColumns               = 72\n    , optFilters               = []\n    , optEmailObfuscation      = NoObfuscation\n    , optIdentifierPrefix      = \"\"\n    , optIndentedCodeClasses   = []\n    , optDataDir               = Nothing\n    , optCiteMethod            = Citeproc\n    , optPdfEngine             = Nothing\n    , optPdfEngineOpts         = []\n    , optSlideLevel            = Nothing\n    , optSetextHeaders         = False\n    , optListTables            = False\n    , optAscii                 = False\n    , optDefaultImageExtension = \"\"\n    , optExtractMedia          = Nothing\n    , optTrackChanges          = AcceptChanges\n    , optFileScope             = False\n    , optTitlePrefix           = Nothing\n    , optCss                   = []\n    , optIpynbOutput           = IpynbOutputBest\n    , optIncludeBeforeBody     = []\n    , optIncludeAfterBody      = []\n    , optIncludeInHeader       = []\n    , optResourcePath          = [\".\"]\n    , optRequestHeaders        = []\n    , optNoCheckCertificate    = False\n    , optEol                   = Native\n    , optStripComments         = False\n    , optCSL                   = Nothing\n    , optBibliography          = []\n    , optCitationAbbreviations = Nothing\n    , optSandbox               = False\n    }\n\nyamlToMeta :: Value -> Parser Meta\nyamlToMeta (Object o) =\n  either (fail . show) return $ runEverything (yamlMap pMetaString o)\n where\n  pMetaString = pure . MetaString <$> P.manyChar P.anyChar\n  runEverything p =\n      runPure (P.readWithM p (def :: P.ParserState) (\"\" :: Text))\n      >>= fmap (Meta . flip P.runF def)\nyamlToMeta _ = return mempty\n\n-- | Apply defaults from --defaults file.\napplyDefaults :: (PandocMonad m, MonadIO m)\n              => Opt\n              -> FilePath\n              -> StateT DefaultsState m Opt\napplyDefaults opt file = do\n  setVerbosity $ optVerbosity opt\n  modify $ \\defsState -> defsState{ curDefaults = Just file }\n  inp <- readFileStrict file\n  let isJSON = B8.take 1 (B8.dropWhile isSpace inp) == \"{\"\n  if isJSON\n     then\n       case eitherDecodeStrict inp of\n         Right f -> f opt\n         Left err' -> throwError $ PandocParseError $ T.pack $\n            \"Error parsing \" <> file <> \":\\n\" <> err'\n     else\n       case decodeEither' (B8.unlines . takeWhile (/= \"...\") . B8.lines $ inp) of\n           Right f -> f opt\n           Left err'  -> throwError $ PandocParseError $ T.pack $\n                  \"Error parsing \" <> file <> \":\\n\" <>\n                  Data.Yaml.prettyPrintParseException err'\n\nfullDefaultsPath :: (PandocMonad m, MonadIO m)\n                 => Maybe FilePath\n                 -> FilePath\n                 -> m FilePath\nfullDefaultsPath dataDir file = do\n  let fp = if null (takeExtension file)\n              then addExtension file \"yaml\"\n              else file\n  defaultDataDir <- liftIO defaultUserDataDir\n  let defaultFp = fromMaybe defaultDataDir dataDir </> \"defaults\" </> fp\n  fpExists <- fileExists fp\n  if fpExists\n     then return fp\n     else do\n       defaultFpExists <- fileExists defaultFp\n       if defaultFpExists\n          then return defaultFp\n          else return fp\n\n-- | In a list of lists, append another list in front of every list which\n-- starts with specific element.\nexpand :: Ord a => [[a]] -> [a] -> a -> [[a]]\nexpand [] ns n = fmap (\\x -> x : [n]) ns\nexpand ps ns n = concatMap (ext n ns) ps\n  where\n    ext x xs p = case p of\n      (l : _) | x == l -> fmap (: p) xs\n      _ -> [p]\n\ncyclic :: Ord a => [[a]] -> Bool\ncyclic = any hasDuplicate\n  where\n    hasDuplicate xs = length (nubOrd xs) /= length xs\n"
  },
  {
    "path": "src/Text/Pandoc/App/OutputSettings.hs",
    "content": "{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE PatternSynonyms     #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections       #-}\n{- |\n   Module      : Text.Pandoc.App\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nDoes a pandoc conversion based on command-line options.\n-}\nmodule Text.Pandoc.App.OutputSettings\n  ( OutputSettings (..)\n  , optToOutputSettings\n  , sandbox'\n  ) where\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Text.DocTemplates (toVal, Context(..), Val(..))\nimport qualified Control.Exception as E\nimport Control.Monad\nimport Control.Monad.Except (throwError, catchError)\nimport Control.Monad.Trans\nimport Data.Char (toLower)\nimport Data.List (find)\nimport Data.Maybe (catMaybes, fromMaybe)\nimport Skylighting (defaultSyntaxMap)\nimport Skylighting.Parser (addSyntaxDefinition, parseSyntaxDefinition)\nimport System.Directory (getCurrentDirectory)\nimport System.Exit (exitSuccess)\nimport System.FilePath\nimport System.IO (stdout)\nimport Text.Pandoc.Chunks (PathTemplate(..))\nimport Text.Pandoc\nimport Text.Pandoc.Filter (Filter(CiteprocFilter))\nimport Text.Pandoc.App.Opt (Opt (..))\nimport Text.Pandoc.App.CommandLineOptions (engines)\nimport Text.Pandoc.Format (FlavoredFormat (..), applyExtensionsDiff,\n                           parseFlavoredFormat, formatFromFilePaths)\nimport Text.Pandoc.Highlighting (lookupHighlightingStyle)\nimport Text.Pandoc.Scripting (ScriptingEngine (engineLoadCustom),\n                              CustomComponents(..))\nimport qualified Text.Pandoc.UTF8 as UTF8\n\nreadUtf8File :: PandocMonad m => FilePath -> m T.Text\nreadUtf8File fp = readFileStrict fp >>= toTextM fp\n\n-- | Settings specifying how document output should be produced.\ndata OutputSettings m = OutputSettings\n  { outputFormat :: T.Text\n  , outputWriter :: Writer m\n  , outputWriterOptions :: WriterOptions\n  , outputPdfProgram :: Maybe String\n  }\n\n-- | Get output settings from command line options.\noptToOutputSettings :: (PandocMonad m, MonadIO m)\n                    => ScriptingEngine -> Opt -> m (OutputSettings m)\noptToOutputSettings scriptingEngine opts = do\n  let outputFile = fromMaybe \"-\" (optOutputFile opts)\n\n  when (optDumpArgs opts) . liftIO $ do\n    UTF8.hPutStrLn stdout (T.pack outputFile)\n    mapM_ (UTF8.hPutStrLn stdout . T.pack) (fromMaybe [] $ optInputFiles opts)\n    exitSuccess\n\n  epubMetadata <- traverse readUtf8File $ optEpubMetadata opts\n\n  let pdfOutput = map toLower (takeExtension outputFile) == \".pdf\" ||\n                  optTo opts == Just \"pdf\"\n  let defaultOutput = \"html\"\n  defaultOutputFlavor <- parseFlavoredFormat defaultOutput\n  (flvrd@(FlavoredFormat format _extsDiff), maybePdfProg) <-\n    if pdfOutput\n       then do\n         outflavor <- case optTo opts of\n                        Just x | x /= \"pdf\" -> Just <$> parseFlavoredFormat x\n                        _ -> pure Nothing\n         liftIO $ pdfWriterAndProg outflavor (optPdfEngine opts)\n       else case optTo opts of\n              Just f -> (, optPdfEngine opts) <$> parseFlavoredFormat f\n              Nothing\n               | outputFile == \"-\" ->\n                   return (defaultOutputFlavor, optPdfEngine opts)\n               | otherwise -> case formatFromFilePaths [outputFile] of\n                   Nothing -> do\n                     report $ CouldNotDeduceFormat\n                       [T.pack $ takeExtension outputFile] defaultOutput\n                     return (defaultOutputFlavor, optPdfEngine opts)\n                   Just f  -> return (f, optPdfEngine opts)\n\n  when (format == \"asciidoctor\") $ do\n    report $ Deprecated \"asciidoctor\" \"use asciidoc instead\"\n\n  let makeSandboxed pureWriter =\n        case pureWriter of\n             TextWriter w -> TextWriter $ \\o d -> sandbox' opts (w o d)\n             ByteStringWriter w -> ByteStringWriter $ \\o d -> sandbox' opts (w o d)\n\n  let standalone = optStandalone opts || isBinaryFormat format || pdfOutput\n  let templateOrThrow = \\case\n        Left  e -> throwError $ PandocTemplateError (T.pack e)\n        Right t -> pure t\n  let processCustomTemplate getDefault =\n        case optTemplate opts of\n          _ | not standalone -> return Nothing\n          Nothing -> Just <$> getDefault\n          Just tp -> do\n            let getAndCompile fp =\n                   getTemplate fp >>= runWithPartials . compileTemplate fp >>=\n                      fmap Just . templateOrThrow\n            catchError\n              (getAndCompile tp)\n              (\\e ->\n                  if null (takeExtension tp)\n                     then getAndCompile (tp <.> T.unpack format)\n                     else throwError e)\n\n  (writer, writerExts', mtemplate) <-\n    if \"lua\" `T.isSuffixOf` format\n    then do\n      let path = T.unpack format\n      components <- engineLoadCustom scriptingEngine path\n      w <- case customWriter components of\n             Nothing -> throwError $ PandocAppError $\n                         format <> \" does not contain a custom writer\"\n             Just w -> return w\n      let extsConf = fromMaybe mempty $ customExtensions components\n      wexts <- applyExtensionsDiff extsConf flvrd\n      templ <- processCustomTemplate $\n               case customTemplate components of\n                 Nothing -> throwError $ PandocNoTemplateError format\n                 Just t -> runWithDefaultPartials (compileTemplate path t) >>=\n                           templateOrThrow\n      return (w, wexts, templ)\n    else\n      if optSandbox opts\n      then do\n        tmpl <- processCustomTemplate (compileDefaultTemplate format)\n        case runPure (getWriter flvrd) of\n             Right (w, wexts) -> return (makeSandboxed w, wexts, tmpl)\n             Left e           -> throwError e\n      else do\n        (w, wexts) <- getWriter flvrd\n        tmpl <- processCustomTemplate (compileDefaultTemplate format)\n        return (w, wexts, tmpl)\n\n  -- see #10662:\n  let writerExts = if CiteprocFilter `elem` optFilters opts\n                      then disableExtension Ext_citations writerExts'\n                      else writerExts'\n\n  let addSyntaxMap existingmap f = do\n        res <- liftIO (parseSyntaxDefinition f)\n        case res of\n              Left errstr -> throwError $ PandocSyntaxMapError $ T.pack errstr\n              Right syn   -> return $ addSyntaxDefinition syn existingmap\n\n  syntaxMap <- foldM addSyntaxMap defaultSyntaxMap\n                     (optSyntaxDefinitions opts)\n\n  hlStyle <- case optSyntaxHighlighting opts of\n    NoHighlightingString        -> pure NoHighlighting\n    DefaultHighlightingString   -> pure DefaultHighlighting\n    IdiomaticHighlightingString -> pure IdiomaticHighlighting\n    style       -> Skylighting <$> lookupHighlightingStyle (T.unpack style)\n\n  let setListVariableM _ [] ctx = return ctx\n      setListVariableM k vs ctx = do\n        let ctxMap = unContext ctx\n        return $ Context $\n          case M.lookup k ctxMap of\n              Just (ListVal xs) -> M.insert k\n                                  (ListVal $ xs ++ map toVal vs) ctxMap\n              Just v -> M.insert k\n                         (ListVal $ v : map toVal vs) ctxMap\n              Nothing -> M.insert k (toVal vs) ctxMap\n\n  let getTextContents fp = (fst <$> fetchItem (T.pack fp)) >>= toTextM fp\n\n  let setFilesVariableM k fps ctx = do\n        xs <- mapM getTextContents fps\n        setListVariableM k xs ctx\n\n  curdir <- liftIO getCurrentDirectory\n\n  variables <-\n    return (optVariables opts)\n    >>=\n    setListVariableM \"sourcefile\"\n      (maybe [\"-\"] (fmap T.pack) (optInputFiles opts))\n    >>=\n    setVariableM \"outputfile\" (T.pack outputFile)\n    >>=\n    setVariableM \"pandoc-version\" pandocVersionText\n    >>=\n    maybe return (setVariableM \"pdf-engine\" . T.pack) maybePdfProg\n    >>=\n    setFilesVariableM \"include-before\" (optIncludeBeforeBody opts)\n    >>=\n    setFilesVariableM \"include-after\" (optIncludeAfterBody opts)\n    >>=\n    setFilesVariableM \"header-includes\" (optIncludeInHeader opts)\n    >>=\n    setListVariableM \"css\" (map T.pack $ optCss opts)\n    >>=\n    maybe return (setVariableM \"title-prefix\") (optTitlePrefix opts)\n    >>=\n    maybe return (setVariableM \"epub-cover-image\" . T.pack)\n                 (optEpubCoverImage opts)\n    >>=\n    setVariableM \"curdir\" (T.pack curdir)\n    >>=\n    (\\vars ->  if format == \"dzslides\"\n                  then do\n                      dztempl <-\n                        let fp = \"dzslides\" </> \"template.html\"\n                         in readDataFile fp >>= toTextM fp\n                      let dzline = \"<!-- {{{{ dzslides core\"\n                      let dzcore = T.unlines\n                                 $ dropWhile (not . (dzline `T.isPrefixOf`))\n                                 $ T.lines dztempl\n                      setVariableM \"dzslides-core\" dzcore vars\n                  else return vars)\n\n  let writerOpts = WriterOptions\n        { writerTemplate         = mtemplate\n        , writerVariables        = variables\n        , writerTabStop          = optTabStop opts\n        , writerTableOfContents  = optTableOfContents opts\n        , writerListOfFigures    = optListOfFigures opts\n        , writerListOfTables     = optListOfTables opts\n        , writerHTMLMathMethod   = optHTMLMathMethod opts\n        , writerIncremental      = optIncremental opts\n        , writerCiteMethod       = optCiteMethod opts\n        , writerNumberSections   = optNumberSections opts\n        , writerNumberOffset     = optNumberOffset opts\n        , writerSectionDivs      = optSectionDivs opts\n        , writerExtensions       = writerExts\n        , writerReferenceLinks   = optReferenceLinks opts\n        , writerReferenceLocation = optReferenceLocation opts\n        , writerFigureCaptionPosition = optFigureCaptionPosition opts\n        , writerTableCaptionPosition = optTableCaptionPosition opts\n        , writerDpi              = optDpi opts\n        , writerWrapText         = optWrap opts\n        , writerColumns          = optColumns opts\n        , writerEmailObfuscation = optEmailObfuscation opts\n        , writerIdentifierPrefix = optIdentifierPrefix opts\n        , writerHtmlQTags        = optHtmlQTags opts\n        , writerTopLevelDivision = optTopLevelDivision opts\n        , writerSlideLevel       = optSlideLevel opts\n        , writerHighlightMethod  = hlStyle\n        , writerSetextHeaders    = optSetextHeaders opts\n        , writerListTables       = optListTables opts\n        , writerEpubSubdirectory = T.pack $ optEpubSubdirectory opts\n        , writerEpubMetadata     = epubMetadata\n        , writerEpubFonts        = optEpubFonts opts\n        , writerEpubTitlePage    = optEpubTitlePage opts\n        , writerSplitLevel       = optSplitLevel opts\n        , writerChunkTemplate    = maybe (PathTemplate \"%s-%i.html\")\n                                     PathTemplate\n                                     (optChunkTemplate opts)\n        , writerTOCDepth         = optTOCDepth opts\n        , writerReferenceDoc     = optReferenceDoc opts\n        , writerSyntaxMap        = syntaxMap\n        , writerPreferAscii      = optAscii opts\n        , writerLinkImages       = optLinkImages opts\n        }\n  return $ OutputSettings\n    { outputFormat = format\n    , outputWriter = writer\n    , outputWriterOptions = writerOpts\n    , outputPdfProgram = maybePdfProg\n    }\n\n-- | Set text value in text context unless it is already set.\nsetVariableM :: Monad m\n             => T.Text -> T.Text -> Context T.Text -> m (Context T.Text)\nsetVariableM key val (Context ctx) = return $ Context $ M.alter go key ctx\n  where go Nothing             = Just $ toVal val\n        go (Just x)            = Just x\n\npdfWriterAndProg :: Maybe FlavoredFormat      -- ^ user-specified format\n                 -> Maybe String              -- ^ user-specified pdf-engine\n                 -> IO (FlavoredFormat, Maybe String) -- ^ format, pdf-engine\npdfWriterAndProg mWriter mEngine =\n  case go mWriter mEngine of\n      Right (writ, prog) -> return (writ, Just prog)\n      Left err           -> liftIO $ E.throwIO $ PandocAppError err\n    where\n      go Nothing Nothing       = Right\n                                 (FlavoredFormat \"latex\" mempty, \"pdflatex\")\n      go (Just writer) Nothing = (writer,) <$> engineForWriter writer\n      go Nothing (Just engine) = (,engine) <$> writerForEngine (takeBaseName engine)\n      go (Just writer) (Just engine) | isCustomWriter writer =\n           -- custom writers can produce any format, so assume the user knows\n           -- what they are doing.\n           Right (writer, engine)\n      go (Just writer) (Just engine) =\n           case find (== (formatName writer, takeBaseName engine)) engines of\n                Just _  -> Right (writer, engine)\n                Nothing -> Left $ \"pdf-engine \" <> T.pack engine <>\n                           \" is not compatible with output format \" <>\n                           formatName writer\n\n      writerForEngine eng = case [f | (f,e) <- engines, e == eng] of\n                                 fmt : _ -> Right (FlavoredFormat fmt mempty)\n                                 []      -> Left $\n                                   \"pdf-engine \" <> T.pack eng <> \" not known\"\n\n      engineForWriter (FlavoredFormat \"pdf\" _) = Left \"pdf writer\"\n      engineForWriter w = case [e | (f,e) <- engines, f == formatName w] of\n                                eng : _ -> Right eng\n                                []      -> Left $\n                                   \"cannot produce pdf output from \" <>\n                                   formatName w\n\n      isCustomWriter w = \".lua\" `T.isSuffixOf` formatName w\n\nisBinaryFormat :: T.Text -> Bool\nisBinaryFormat s =\n  s `elem` [\"odt\",\"docx\",\"epub2\",\"epub3\",\"epub\",\"pptx\",\"pdf\",\"chunkedhtml\"]\n\n-- Like 'sandbox', but computes the list of files to preserve from\n-- 'Opt'.\nsandbox' :: (PandocMonad m, MonadIO m) => Opt -> PandocPure a -> m a\nsandbox' opts = sandbox sandboxedFiles\n where\n   sandboxedFiles = catMaybes [ optReferenceDoc opts\n                              , optEpubMetadata opts\n                              , optEpubCoverImage opts\n                              , optCSL opts\n                              , optCitationAbbreviations opts\n                              ] ++\n                    optEpubFonts opts ++\n                    optBibliography opts\n"
  },
  {
    "path": "src/Text/Pandoc/App.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.App\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nDoes a pandoc conversion based on command-line options.\n-}\nmodule Text.Pandoc.App (\n            convertWithOpts\n          , handleOptInfo\n          , Opt(..)\n          , OptInfo(..)\n          , LineEnding(..)\n          , IpynbOutput (..)\n          , Filter(..)\n          , defaultOpts\n          , parseOptions\n          , parseOptionsFromArgs\n          , options\n          , applyFilters\n          , versionInfo\n          ) where\nimport qualified Control.Exception as E\nimport Control.Monad ( (>=>), when, forM, forM_ )\nimport Control.Monad.Trans ( MonadIO(..) )\nimport Control.Monad.Catch ( MonadMask )\nimport Control.Monad.Except (throwError)\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Maybe (fromMaybe, isJust, isNothing)\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Lazy.Encoding as TE\nimport qualified Data.Text.Encoding.Error as TE\nimport Data.Char (toLower)\nimport System.Directory (doesDirectoryExist, createDirectory,\n                         createDirectoryIfMissing)\nimport Codec.Archive.Zip (toArchiveOrFail,\n                          extractFilesFromArchive, ZipOption(..))\nimport System.Exit (exitSuccess)\nimport System.FilePath ( takeBaseName, takeExtension, takeDirectory)\nimport System.IO (nativeNewline, stdout)\nimport qualified System.IO as IO (Newline (..))\nimport Text.Pandoc\nimport Text.Pandoc.Builder (setMeta)\nimport Text.Pandoc.MediaBag (mediaItems)\nimport Text.Pandoc.Image (svgToPng)\nimport Text.Pandoc.App.Opt (Opt (..), LineEnding (..), defaultOpts,\n                            IpynbOutput (..), OptInfo(..))\nimport Text.Pandoc.App.CommandLineOptions (parseOptions, parseOptionsFromArgs,\n                                           options, handleOptInfo, versionInfo)\nimport Text.Pandoc.App.Input (InputParameters (..), readInput)\nimport Text.Pandoc.App.OutputSettings (OutputSettings (..), optToOutputSettings,\n                                       sandbox')\nimport Text.Pandoc.Transforms (applyTransforms, filterIpynbOutput,\n                               headerShift, eastAsianLineBreakFilter)\nimport Text.Collate.Lang (Lang (..), parseLang)\nimport Text.Pandoc.Filter (Filter (JSONFilter, LuaFilter), Environment (..),\n                           applyFilters)\nimport qualified Text.Pandoc.Format as Format\nimport Text.Pandoc.PDF (makePDF)\nimport Text.Pandoc.Scripting (ScriptingEngine (..), CustomComponents(..))\nimport Text.Pandoc.SelfContained (makeSelfContained)\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.Writers.Shared (lookupMetaString)\nimport Text.Pandoc.Readers.Markdown (yamlToMeta)\nimport qualified Text.Pandoc.UTF8 as UTF8\n#ifndef _WINDOWS\nimport System.Posix.IO (stdOutput)\nimport System.Posix.Terminal (queryTerminal)\n#endif\n\nconvertWithOpts :: ScriptingEngine -> Opt -> IO ()\nconvertWithOpts scriptingEngine opts = do\n  let outputFile = fromMaybe \"-\" (optOutputFile opts)\n  datadir <- case optDataDir opts of\n                  Nothing   -> do\n                    d <- defaultUserDataDir\n                    exists <- doesDirectoryExist d\n                    return $ if exists\n                                then Just d\n                                else Nothing\n                  mdatadir  -> return mdatadir\n\n  when (optDumpArgs opts) $\n    do UTF8.hPutStrLn stdout (T.pack outputFile)\n       mapM_ (UTF8.hPutStrLn stdout . T.pack)\n             (fromMaybe [\"-\"] $ optInputFiles opts)\n       exitSuccess\n\n#ifdef _WINDOWS\n  let istty = True\n#else\n  istty <- liftIO $ queryTerminal stdOutput\n#endif\n\n  res <- runIO $ convertWithOpts' scriptingEngine istty datadir opts\n  case res of\n    Left e -> E.throwIO e\n    Right (output, reports) -> do\n      case optLogFile opts of\n           Nothing      -> return ()\n           Just logfile -> BL.writeFile logfile (encodeLogMessages reports)\n      let isWarning msg = messageVerbosity msg == WARNING\n      when (optFailIfWarnings opts && any isWarning reports) $\n          E.throwIO PandocFailOnWarningError\n      let eol = case optEol opts of\n                     CRLF   -> IO.CRLF\n                     LF     -> IO.LF\n                     Native -> nativeNewline\n      let outputFileDir = takeDirectory outputFile\n      createDirectoryIfMissing True outputFileDir\n      case output of\n        TextOutput t    -> writerFn eol outputFile t\n        BinaryOutput bs -> writeFnBinary outputFile bs\n        ZipOutput bs\n          | null (takeExtension outputFile)\n          , outputFile /= \"-\" -> do\n             -- create directory and unzip\n             createDirectory outputFile -- will fail if directory exists\n             let zipopts = [OptRecursive, OptDestination outputFile] ++\n                           [OptVerbose | optVerbosity opts == INFO]\n             case toArchiveOrFail bs of\n               Right archive -> extractFilesFromArchive zipopts archive\n               Left e -> E.throwIO $ PandocShouldNeverHappenError $ T.pack e\n          | otherwise -> writeFnBinary outputFile bs\n\nconvertWithOpts' :: (PandocMonad m, MonadIO m, MonadMask m)\n                 => ScriptingEngine\n                 -> Bool\n                 -> Maybe FilePath\n                 -> Opt\n                 -> m (PandocOutput, [LogMessage])\nconvertWithOpts' scriptingEngine istty datadir opts = do\n  configureCommonState datadir opts\n  let outputFile = fromMaybe \"-\" (optOutputFile opts)\n  let filters = optFilters opts\n  let sources = case optInputFiles opts of\n                     Just xs | not (optIgnoreArgs opts) -> xs\n                     _ -> [\"-\"]\n\n  let defFlavor fmt = Format.FlavoredFormat fmt mempty\n  -- assign reader and writer based on options and filenames\n  flvrd@(Format.FlavoredFormat readerNameBase _extsDiff) <-\n    case optFrom opts of\n      Just f  -> Format.parseFlavoredFormat f\n      Nothing -> case Format.formatFromFilePaths sources of\n        Just f' -> return f'\n        Nothing | sources == [\"-\"] -> return $ defFlavor \"markdown\"\n                | otherwise -> do\n                    report $ CouldNotDeduceFormat\n                      (map (T.pack . takeExtension) sources) \"markdown\"\n                    return $ defFlavor \"markdown\"\n\n  let makeSandboxed pureReader =\n       case pureReader of\n            TextReader r\n              -> TextReader $ \\o t -> sandbox' opts (r o t)\n            ByteStringReader r\n              -> ByteStringReader $ \\o t -> sandbox' opts (r o t)\n\n  (reader, readerExts) <-\n    if \".lua\" `T.isSuffixOf` readerNameBase\n       then do\n            let scriptPath = T.unpack readerNameBase\n            components <- engineLoadCustom scriptingEngine scriptPath\n            r <- case customReader components of\n                   Nothing -> throwError $ PandocAppError $\n                               readerNameBase <> \" does not contain a custom reader\"\n                   Just r -> return r\n            let extsConf = fromMaybe mempty (customExtensions components)\n            rexts <- Format.applyExtensionsDiff extsConf flvrd\n            return (r, rexts)\n       else if optSandbox opts\n               then case runPure (getReader flvrd) of\n                      Left e -> throwError e\n                      Right (r, rexts) -> return (makeSandboxed r, rexts)\n               else getReader flvrd\n\n  outputSettings <- optToOutputSettings scriptingEngine opts\n  let format = outputFormat outputSettings\n  let writer = outputWriter outputSettings\n  let writerOptions = outputWriterOptions outputSettings\n\n  -- whether we are targeting PDF.\n  let pdfOutput = map toLower (takeExtension outputFile) == \".pdf\" ||\n                  optTo opts == Just \"pdf\"\n  -- whether standalone output should be produced.\n  let bibOutput = format `elem` [\"bibtex\", \"biblatex\", \"csljson\"]\n  let standalone = isJust (writerTemplate writerOptions) || bibOutput\n\n  --\n  -- Sanity checks\n  --\n  when (pdfOutput && readerNameBase == \"latex\") $\n    case optInputFiles opts of\n      Just (inputFile:_) -> report $ UnusualConversion $ T.pack $\n        \"to convert a .tex file to PDF, you get better results by using pdflatex \"\n          <> \"(or lualatex or xelatex) directly, try `pdflatex \" <> inputFile\n          <> \"` instead of `pandoc \" <> inputFile <> \" -o \" <> outputFile <> \"`.\"\n      _ -> return ()\n\n  -- We don't want to send output to the terminal if the user\n  -- does 'pandoc -t docx input.txt'; though we allow them to\n  -- force this with '-o -'.  On posix systems, we detect\n  -- when stdout is being piped and allow output to stdout\n  -- in that case, but on Windows we can't.\n  when ((pdfOutput || not (isTextFormat format)) &&\n           istty && isNothing ( optOutputFile opts)) $\n    throwError $ PandocAppError $\n            \"Cannot write \" <> (if pdfOutput then \"pdf\" else format) <>\n            \" output to terminal.\\n\" <>\n            \"Specify an output file using the -o option, or \" <>\n            \"use '-o -' to force output to stdout.\"\n\n  when (readerNameBase == \"markdown_github\" ||\n        format == \"markdown_github\") $\n    report $ Deprecated \"markdown_github\" \"Use gfm instead.\"\n\n  abbrevs <- readAbbreviations (optAbbreviations opts)\n  let readerOpts = def{\n          readerStandalone = standalone\n        , readerColumns = optColumns opts\n        , readerTabStop = optTabStop opts\n        , readerIndentedCodeClasses = optIndentedCodeClasses opts\n        , readerDefaultImageExtension = optDefaultImageExtension opts\n        , readerTrackChanges = optTrackChanges opts\n        , readerAbbreviations = abbrevs\n        , readerExtensions = readerExts\n        , readerStripComments = optStripComments opts\n        }\n\n  metadataFromFile <- getMetadataFromFiles readerNameBase readerOpts\n                         (optMetadataFiles opts)\n\n  let transforms = (case optShiftHeadingLevelBy opts of\n                        0             -> id\n                        x             -> (headerShift x :)) .\n                   (if extensionEnabled Ext_east_asian_line_breaks\n                          readerExts &&\n                       not (extensionEnabled Ext_east_asian_line_breaks\n                            (writerExtensions writerOptions) &&\n                            writerWrapText writerOptions == WrapPreserve)\n                       then (eastAsianLineBreakFilter :)\n                       else id) .\n                   (case optIpynbOutput opts of\n                     _ | readerNameBase /= \"ipynb\" -> id\n                     IpynbOutputAll  -> id\n                     IpynbOutputNone -> (filterIpynbOutput Nothing :)\n                     IpynbOutputBest -> (filterIpynbOutput (Just $\n                                   if htmlFormat format\n                                      then Format \"html\"\n                                      else\n                                        case format of\n                                          \"latex\"  -> Format \"latex\"\n                                          \"beamer\" -> Format \"latex\"\n                                          _        -> Format format) :))\n                   $ []\n\n  let isPandocCiteproc (JSONFilter f) = takeBaseName f == \"pandoc-citeproc\"\n      isPandocCiteproc _              = False\n\n  when (any isPandocCiteproc filters) $\n    report $ Deprecated \"pandoc-citeproc filter\"\n             \"Use --citeproc instead.\"\n\n  let cslMetadata =\n        maybe id (setMeta \"csl\") (optCSL opts) .\n        (case optBibliography opts of\n           [] -> id\n           xs -> setMeta \"bibliography\" xs) .\n        maybe id (setMeta \"citation-abbreviations\")\n                       (optCitationAbbreviations opts) $ mempty\n\n  let filterEnv = Environment readerOpts writerOptions\n\n  let inputParams = InputParameters\n        { inputReader = reader\n        , inputReaderName = readerNameBase\n        , inputReaderOptions = readerOpts\n        , inputSources = sources\n        , inputFileScope = optFileScope opts\n        , inputSpacesPerTab = if optPreserveTabs opts\n                              then Nothing\n                              else Just (optTabStop opts)\n        }\n\n  doc <- readInput inputParams\n          >>= ( return . adjustMetadata (metadataFromFile <>)\n            >=> return . adjustMetadata (<> optMetadata opts)\n            >=> return . adjustMetadata (<> cslMetadata)\n            >=> applyFilters scriptingEngine filterEnv filters [T.unpack format]\n            >=> applyTransforms transforms\n            >=> (if not (optSandbox opts) &&\n                    (isJust (optExtractMedia opts)\n                     || format == \"docx\") -- for fallback pngs\n                 then fillMediaBag\n                 else return)\n            >=> maybe return extractMedia (optExtractMedia opts)\n            )\n\n  when (format == \"docx\" && not (optSandbox opts)) $ do\n    createPngFallbacks (writerDpi writerOptions)\n\n  output <- case writer of\n    ByteStringWriter f\n      | format == \"chunkedhtml\" -> ZipOutput <$> f writerOptions doc\n      | otherwise -> BinaryOutput <$> f writerOptions doc\n    TextWriter f -> case outputPdfProgram outputSettings of\n      Just pdfProg | pdfOutput -> do\n              res <- makePDF pdfProg (optPdfEngineOpts opts) f\n                      writerOptions doc\n              case res of\n                   Right pdf -> return $ BinaryOutput pdf\n                   Left err' -> throwError $ PandocPDFError $\n                                   TL.toStrict (TE.decodeUtf8With TE.lenientDecode err')\n\n      _ -> do\n              let ensureNl t\n                    | standalone = t\n                    | T.null t || T.last t /= '\\n' = t <> T.singleton '\\n'\n                    | otherwise = t\n              textOutput <- ensureNl <$> f writerOptions doc\n              if htmlFormat format &&\n                  (optSelfContained opts || optEmbedResources opts)\n                 then if optSandbox opts\n                         then sandbox' opts $\n                              TextOutput <$> makeSelfContained textOutput\n                         else TextOutput <$> makeSelfContained textOutput\n                 else return $ TextOutput textOutput\n  reports <- getLog\n  return (output, reports)\n\ndata PandocOutput =\n      TextOutput Text\n    | BinaryOutput BL.ByteString\n    | ZipOutput BL.ByteString\n  deriving (Show)\n\n-- | Configure the common state\nconfigureCommonState :: PandocMonad m => Maybe FilePath -> Opt -> m ()\nconfigureCommonState datadir opts = do\n  setUserDataDir datadir\n  setTrace (optTrace opts)\n  setVerbosity (optVerbosity opts)\n  setResourcePath (optResourcePath opts)\n  setInputFiles (fromMaybe [\"-\"] (optInputFiles opts))\n  setOutputFile (optOutputFile opts)\n  setNoCheckCertificate (optNoCheckCertificate opts)\n\n  mapM_ (uncurry setRequestHeader) (optRequestHeaders opts)\n\n  case lookupMetaString \"lang\" (optMetadata opts) of\n    \"\"      -> setTranslations $ Lang \"en\" Nothing (Just \"US\") [] [] []\n    l       -> case parseLang l of\n                 Left _   -> report $ InvalidLang l\n                 Right l' -> setTranslations l'\n\n-- | Retrieves the set of abbreviations to be used by pandoc. These currently\n-- only affect the Markdown reader.\nreadAbbreviations :: PandocMonad m => Maybe FilePath -> m (Set.Set Text)\nreadAbbreviations mbfilepath =\n  (case mbfilepath of\n    Nothing -> readDataFile \"abbreviations\"\n    Just f  -> readFileStrict f)\n    >>= fmap (Set.fromList . filter (not . T.null) . T.lines) .\n         toTextM (fromMaybe mempty mbfilepath)\n\ncreatePngFallbacks :: (PandocMonad m, MonadIO m) => Int -> m ()\ncreatePngFallbacks dpi = do\n  -- create fallback pngs for svgs\n  items <- mediaItems <$> getMediaBag\n  forM_ items $ \\(fp, mt, bs) ->\n    case T.takeWhile (/=';') mt of\n      \"image/svg+xml\" -> do\n        res <- svgToPng dpi bs\n        case res of\n          Right bs' -> do\n            let fp' = fp <> \".png\"\n            insertMedia fp' (Just \"image/png\") bs'\n          Left e -> report $ CouldNotConvertImage (T.pack fp) (tshow e)\n      _ -> return ()\n\ngetMetadataFromFiles :: PandocMonad m\n                     => Text -> ReaderOptions -> [FilePath] -> m Meta\ngetMetadataFromFiles readerFormat readerOpts = \\case\n  []    -> return mempty\n  paths -> mconcat <$> do\n    -- If format is markdown or commonmark, use the enabled extensions,\n    -- otherwise treat metadata as pandoc markdown (see #7926, #6832)\n    let readerOptsMeta =\n          if readerFormat `elem` [\"markdown\", \"commonmark\"]\n          then readerOpts\n          else readerOpts{ readerExtensions = pandocExtensions }\n    forM paths $ \\path -> do\n      raw <- readMetadataFile path\n      yamlToMeta readerOptsMeta (Just path) raw\n\nhtmlFormat :: Text -> Bool\nhtmlFormat = (`elem` [\"html\",\"html4\",\"html5\",\"s5\",\"slidy\",\n                      \"slideous\",\"dzslides\",\"revealjs\"])\n\nisTextFormat :: Text -> Bool\nisTextFormat s = s `notElem` [\"odt\",\"docx\",\"epub2\",\"epub3\",\"epub\",\"pptx\"]\n\nadjustMetadata :: (Meta -> Meta) -> Pandoc -> Pandoc\nadjustMetadata f (Pandoc meta bs) = Pandoc (f meta) bs\n\nwriteFnBinary :: FilePath -> BL.ByteString -> IO ()\nwriteFnBinary \"-\" = BL.putStr\nwriteFnBinary f   = BL.writeFile (UTF8.encodePath f)\n\nwriterFn :: IO.Newline -> FilePath -> Text -> IO ()\nwriterFn eol \"-\" = UTF8.putStrWith eol\nwriterFn eol f   = UTF8.writeFileWith eol f\n"
  },
  {
    "path": "src/Text/Pandoc/Asciify.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Asciify\n   Copyright   : Copyright (C) 2013-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunction to convert accented latin letters to their unaccented\nascii equivalents (used in constructing HTML identifiers).\n-}\nmodule Text.Pandoc.Asciify (toAsciiChar, toAsciiText)\nwhere\nimport Data.Char (isAscii, isMark)\nimport qualified Data.Text.Normalize as TN\nimport Data.Text (Text)\nimport qualified Data.Text as T\n\ntoAsciiText :: Text -> Text\ntoAsciiText = T.filter isAscii . T.map specialCase . TN.normalize (TN.NFD)\n where\n  specialCase '\\x131' = 'i' -- Turkish undotted i\n  specialCase c = c\n\ntoAsciiChar :: Char -> Maybe Char\ntoAsciiChar c = case T.unpack (TN.normalize TN.NFD (T.singleton c)) of\n                  (x:xs) | isAscii x\n                         , all isMark xs\n                         -> Just x\n                  ['\\x131'] -> Just 'i'  -- Turkish undotted i\n                  _      -> Nothing\n"
  },
  {
    "path": "src/Text/Pandoc/CSS.hs",
    "content": "{- |\nModule      : Text.Pandoc.CSS\nCopyright   : © 2006-2024 John MacFarlane <jgm@berkeley.edu>,\n                2015-2016 Mauro Bieg,\n                2015      Ophir Lifshitz <hangfromthefloor@gmail.com>\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane <jgm@berkeley@edu>\nStability   : alpha\nPortability : portable\n\nTools for working with CSS.\n-}\nmodule Text.Pandoc.CSS\n  ( cssAttributes\n  , pickStyleAttrProps\n  , pickStylesToKVs\n  )\nwhere\n\nimport Data.Either (fromRight)\nimport Data.Maybe (mapMaybe, listToMaybe)\nimport Data.Text (Text, pack)\nimport Text.Pandoc.Shared (trim)\nimport Text.Pandoc.Parsing\n\ntype Parser = Parsec Text ()\n\nruleParser :: Parser (Text, Text)\nruleParser = do\n    p <- many1 (noneOf \":\")  <* char ':'\n    v <- many1 (noneOf \":;\") <* optional (char ';') <* spaces\n    return (trim $ pack p, trim $ pack v)\n\nstyleAttrParser :: Parser [(Text, Text)]\nstyleAttrParser = many1 ruleParser\n\n-- | Parses a style string, returning the CSS attributes.\n-- Returns an empty list on failure.\ncssAttributes :: Text -> [(Text, Text)]\ncssAttributes styleString =\n  fromRight [] $ parse styleAttrParser \"\" styleString\n\n-- | takes a list of keys/properties and a CSS string and\n-- returns the corresponding key-value-pairs.\npickStylesToKVs :: [Text] -> Text -> [(Text, Text)]\npickStylesToKVs props styleAttr =\n  filter (\\s -> fst s `elem` props) $ cssAttributes styleAttr\n\n-- | takes a list of key/property synonyms and a CSS string and maybe\n-- returns the value of the first match (in order of the supplied list)\npickStyleAttrProps :: [Text] -> Text -> Maybe Text\npickStyleAttrProps lookupProps styleAttr = do\n    styles <- either (const Nothing) Just $ parse styleAttrParser \"\" styleAttr\n    listToMaybe $ mapMaybe (`lookup` styles) lookupProps\n"
  },
  {
    "path": "src/Text/Pandoc/CSV.hs",
    "content": "{- |\n   Module      : Text.Pandoc.CSV\n   Copyright   : Copyright (C) 2017-2024 John MacFarlane <jgm@berkeley.edu>\n   License     : GNU GPL, version 2 or above\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nSimple CSV parser.\n-}\n\nmodule Text.Pandoc.CSV (\n  CSVOptions(..),\n  defaultCSVOptions,\n  parseCSV,\n  ParseError\n) where\n\nimport Control.Monad (unless, void, mzero)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Parsing hiding (escaped)\n\ntype Parser = Parsec Text ()\n\ndata CSVOptions = CSVOptions{\n    csvDelim     :: Char\n  , csvQuote     :: Maybe Char\n  , csvKeepSpace :: Bool -- treat whitespace following delim as significant\n  , csvEscape    :: Maybe Char -- default is to double up quote\n} deriving (Read, Show)\n\ndefaultCSVOptions :: CSVOptions\ndefaultCSVOptions = CSVOptions{\n    csvDelim = ','\n  , csvQuote = Just '\"'\n  , csvKeepSpace = False\n  , csvEscape = Nothing }\n\nparseCSV :: CSVOptions -> Text -> Either ParseError [[Text]]\nparseCSV opts t = parse (pCSV opts) \"csv\" t\n\npCSV :: CSVOptions -> Parser [[Text]]\npCSV opts =\n  (pCSVRow opts `sepEndBy` endline) <* (spaces *> eof)\n\npCSVRow :: CSVOptions -> Parser [Text]\npCSVRow opts = do\n  x <- pCSVCell opts\n  xs <- (if T.null x then many1 else many) $ pCSVDelim opts *> pCSVCell opts\n  return (x:xs)\n\npCSVCell :: CSVOptions -> Parser Text\npCSVCell opts = pCSVQuotedCell opts <|> pCSVUnquotedCell opts\n\npCSVQuotedCell :: CSVOptions -> Parser Text\npCSVQuotedCell opts =\n  case csvQuote opts of\n    Nothing -> mzero\n    Just quotechar -> do\n      char quotechar\n      res <- many (satisfy (\\c -> c /= quotechar &&\n                                  Just c /= csvEscape opts) <|> escaped opts)\n      char quotechar\n      return $ T.pack res\n\nescaped :: CSVOptions -> Parser Char\nescaped opts =\n  case csvEscape opts of\n    Nothing ->\n      case csvQuote opts of\n        Nothing -> mzero\n        Just q -> try $ char q >> char q\n    Just c  -> try $ char c >> noneOf \"\\r\\n\"\n\npCSVUnquotedCell :: CSVOptions -> Parser Text\npCSVUnquotedCell opts = T.pack <$>\n  many (satisfy (\\c -> c /= csvDelim opts && c /= '\\r' && c /= '\\n'))\n\npCSVDelim :: CSVOptions -> Parser ()\npCSVDelim opts = do\n  char (csvDelim opts)\n  let sp = case csvDelim opts of\n              '\\t' -> char ' '\n              _    -> oneOf \" \\t\"\n  unless (csvKeepSpace opts) $ skipMany sp\n\nendline :: Parser ()\nendline = do\n  optional (void $ char '\\r')\n  void $ char '\\n'\n"
  },
  {
    "path": "src/Text/Pandoc/Char.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Char\n   Copyright   : Copyright (C) 2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nCharacter functions not defined in Data.Char.\n-}\nmodule Text.Pandoc.Char ( isCJK )\nwhere\n\n-- | Returns True if character is CJK. Matches anything in:\n--\n-- * CJK Unified Ideographs Basic Block: U+4E00 - U+9FFF\n-- * CJK Unified Ideographs Extension A: U+3400 - U+4DBF\n-- * CJK Unified Ideographs Extension B: U+20000 - U+2A6DF\n-- * CJK Unified Ideographs Extension C: U+2A700 - U+2B73F\n-- * CJK Unified Ideographs Extension D: U+2B740 - U+2B81F\n-- * CJK Compatibility Ideographs: U+F900 - U+FAFF\n-- * CJK Compatibility Ideographs Supplement: U+2F800 - U+2FA1F\nisCJK :: Char -> Bool\nisCJK c =\n  c >= '\\x4e00' &&\n  (    (c >= '\\x2e80' && c <= '\\x2eff') -- CJK Radicals Supplement\n    || (c >= '\\x2f00' && c <= '\\x2fdf') -- Kangxi Radicals\n    || (c >= '\\x2ff0' && c <= '\\x2fff') -- Ideographic Description Characters\n    || (c >= '\\x3000' && c <= '\\x303f') -- JK Symbols and Punctuation\n    || (c >= '\\x3040' && c <= '\\x309f') -- Hiragana\n    || (c >= '\\x30a0' && c <= '\\x30ff') -- Katakana\n    || (c >= '\\x3100' && c <= '\\x312f') -- Bopomofo\n    || (c >= '\\x3130' && c <= '\\x318f') -- Kanbun\n    || (c >= '\\x3190' && c <= '\\x319f') -- Kanbun\n    || (c >= '\\x31c0' && c <= '\\x31ef') -- CJK Strokes\n    || (c >= '\\x31f0' && c <= '\\x31ff') -- Katakana Phonetic Extensions\n    || (c >= '\\x3200' && c <= '\\x32ff') -- Enclosed CJK Letters & Months\n    || (c >= '\\x3300' && c <= '\\x33ff') -- CJK Compatibility\n    || (c >= '\\x3400' && c <= '\\x4dbf') -- CJK Unified Ideographs Extension A\n    || (c >= '\\x4e00' && c <= '\\x9fff') -- CJK Unified Ideographs\n    || (c >= '\\xa000' && c <= '\\xa48f') -- Yi Syllables\n    || (c >= '\\xa490' && c <= '\\xa4cf') -- Yi Radicals\n    || (c >= '\\xf900' && c <= '\\xfaff') -- CJK Compatibility Ideographs\n    || (c >= '\\xfe10' && c <= '\\xfe1f') -- Vertical forms\n    || (c >= '\\xfe30' && c <= '\\xfe4f') -- CJK Compatibility Forms\n    || (c >= '\\xFE50' && c <= '\\xFE6F') -- Small Form Variants\n    || (c >= '\\xFF00' && c <= '\\xFFEE') -- Halfwidth and Fullwidth Forms\n    || (c >= '\\x1B000' && c <= '\\x1B0FF') -- Kana Supplement\n    || (c >= '\\x1B100' && c <= '\\x1B12F') -- Kana Extended-A\n    || (c >= '\\x1B130' && c <= '\\x1B16F') -- Small Kana Extension\n    || (c >= '\\x20000' && c <= '\\x2A6DF') -- CJK Unified Ideographs Extension B\n    || (c >= '\\x2A700' && c <= '\\x2B73F') -- CJK Unified Ideographs Extension C\n    || (c >= '\\x2B740' && c <= '\\x2B81F') -- CJK Unified Ideographs Extension D\n    || (c >= '\\x2B820' && c <= '\\x2CEAF') -- CJK Unified Ideographs Extension E\n    || (c >= '\\x2CEB0' && c <= '\\x2EBEF') -- CJK Unified Ideographs Extension F\n    || (c >= '\\x2F800' && c <= '\\x2FA1F') -- CJK Compatibility Ideographs Supp\n    || (c >= '\\x30000' && c <= '\\x3134F') -- CJK Unified Ideographs Exten\n  )\n"
  },
  {
    "path": "src/Text/Pandoc/Chunks.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE DeriveDataTypeable #-}\n{-# LANGUAGE DeriveGeneric #-}\n{- |\n   Module      : Text.Pandoc.Chunks\n   Copyright   : Copyright (C) 2022-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions and types for splitting a Pandoc into subdocuments,\ne.g. for conversion into a set of HTML pages.\n-}\nmodule Text.Pandoc.Chunks\n  ( Chunk(..)\n  , ChunkedDoc(..)\n  , PathTemplate(..)\n  , splitIntoChunks\n  , toTOCTree\n  , tocToList\n  , SecInfo(..)\n  ) where\n\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Shared (makeSections, stringify, inlineListToIdentifier,\n                           tshow, uniqueIdent)\nimport Text.Pandoc.Walk (Walkable(..), query)\nimport Data.Aeson (FromJSON, ToJSON)\nimport Data.Text (Text)\nimport Text.Printf (printf)\nimport Data.Maybe (fromMaybe, isNothing)\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.String (IsString)\nimport GHC.Generics (Generic)\nimport Text.HTML.TagSoup (Tag (TagOpen), fromAttrib, parseTags)\nimport Data.Tree (Tree(..))\nimport Data.Data (Data)\nimport Data.Typeable (Typeable)\nimport qualified Data.Set as Set\nimport Control.Monad.State\n\n-- | Split 'Pandoc' into 'Chunk's, e.g. for conversion into\n-- a set of HTML pages or EPUB chapters.\nsplitIntoChunks :: PathTemplate -- ^ Template for filepath\n                -> Bool -- ^ Number sections\n                -> Maybe Int -- ^ Base heading level\n                -> Int -- ^ Chunk level -- level of section to split at\n                -> Pandoc\n                -> ChunkedDoc\nsplitIntoChunks pathTemplate numberSections mbBaseLevel\n                chunklev (Pandoc meta blocks) =\n   addNav .\n   fixInternalReferences .\n   walk rmNavAttrs $\n   ChunkedDoc{ chunkedMeta = meta\n             , chunkedChunks = chunks\n             , chunkedTOC = tocTree }\n where\n  tocTree = fixTOCTreePaths chunks $ toTOCTree sections\n  chunks = makeChunks chunklev pathTemplate meta $ sections\n  sections = ensureIds $ makeSections numberSections mbBaseLevel blocks\n\n-- The TOC won't work if we don't have unique identifiers for all sections.\nensureIds :: [Block] -> [Block]\nensureIds bs = evalState (walkM go bs) mempty\n where\n   go :: Block -> State (Set.Set Text) Block\n   go b@(Div (ident,\"section\":cls,kvs) bs'@(Header _ _ ils : _))\n     | T.null ident\n       = do ids <- get\n            let newid = uniqueIdent mempty ils ids\n            modify $ Set.insert newid\n            pure $ Div (newid,\"section\":cls,kvs) bs'\n     | otherwise\n       = do modify $ Set.insert ident\n            pure b\n   go b = pure b\n\n-- | Add chunkNext, chunkPrev, chunkUp\naddNav :: ChunkedDoc -> ChunkedDoc\naddNav chunkedDoc =\n  chunkedDoc{ chunkedChunks =\n     addNext . addPrev . addUp $ chunkedChunks chunkedDoc }\n\naddUp :: [Chunk] -> [Chunk]\naddUp (c : d : ds)\n  | chunkLevel c < chunkLevel d\n    = c : addUp (d{ chunkUp = Just c } : ds)\n  | chunkLevel c == chunkLevel d\n    = c : addUp (d{ chunkUp = chunkUp c} : ds)\naddUp (c:cs) = c : addUp cs\naddUp [] = []\n\naddNext :: [Chunk] -> [Chunk]\naddNext cs = zipWith go cs (map Just (drop 1 cs) ++ [Nothing])\n where\n  go c nxt = c{ chunkNext = nxt }\n\naddPrev :: [Chunk] -> [Chunk]\naddPrev cs = zipWith go cs (Nothing : map Just cs)\n where\n  go c prev = c{ chunkPrev = prev }\n\n-- | Fix internal references so they point to the path of the chunk.\nfixInternalReferences :: ChunkedDoc -> ChunkedDoc\nfixInternalReferences chunkedDoc = walk fixInternalRefs chunkedDoc\n where\n  fixInternalRefs :: Inline -> Inline\n  fixInternalRefs il@(Link attr ils (src,tit))\n    = case T.uncons src of\n        Just ('#', ident) -> Link attr ils (src', tit)\n          where src' = case M.lookup ident refMap of\n                         Just chunk -> T.pack (chunkPath chunk) <> src\n                         Nothing -> src\n        _ -> il\n  fixInternalRefs il = il\n\n  refMap = foldr chunkToRefs mempty (chunkedChunks chunkedDoc)\n\n  chunkToRefs chunk m =\n    let idents = chunkId chunk : getIdents (chunkContents chunk)\n    in  foldr (\\ident -> M.insert ident chunk) m idents\n\n  getIdents bs = query getBlockIdent bs ++ query getInlineIdent bs\n\n  getBlockIdent :: Block -> [Text]\n  getBlockIdent (Div (ident, _, _) _)\n    | not (T.null ident) = [ident]\n  getBlockIdent (Header _ (ident, _, _) _)\n    | not (T.null ident) = [ident]\n  getBlockIdent (Table (ident,_,_) _ _ _ _ _)\n    | not (T.null ident) = [ident]\n  getBlockIdent (RawBlock fmt raw)\n    | isHtmlFormat fmt\n    = foldr (\\tag ->\n                case tag of\n                  TagOpen{} ->\n                    case fromAttrib \"id\" tag of\n                      \"\" -> id\n                      x  -> (x:)\n                  _ -> id)\n        [] (parseTags raw)\n  getBlockIdent _ = []\n\n  getInlineIdent :: Inline -> [Text]\n  getInlineIdent (Span (ident, _, _) _)\n    | not (T.null ident) = [ident]\n  getInlineIdent (Link (ident, _, _) _ _)\n    | not (T.null ident) = [ident]\n  getInlineIdent (Image (ident, _, _) _ _)\n    | not (T.null ident) = [ident]\n  getInlineIdent (RawInline fmt raw)\n    | isHtmlFormat fmt\n    = foldr (\\tag ->\n                case tag of\n                  TagOpen{} ->\n                    case fromAttrib \"id\" tag of\n                      \"\" -> id\n                      x  -> (x:)\n                  _ -> id)\n        [] (parseTags raw)\n  getInlineIdent _ = []\n\n  isHtmlFormat :: Format -> Bool\n  isHtmlFormat (Format \"html\") = True\n  isHtmlFormat (Format \"html4\") = True\n  isHtmlFormat (Format \"html5\") = True\n  isHtmlFormat _ = False\n\n\nmakeChunks :: Int -> PathTemplate -> Meta -> [Block] -> [Chunk]\nmakeChunks chunklev pathTemplate meta = secsToChunks 1\n where\n  isChunkHeader :: Block -> Bool\n  isChunkHeader (Div (_,\"section\":_,_) (Header n _ _:_)) = n <= chunklev\n  isChunkHeader _ = False\n\n  secsToChunks :: Int -> [Block] -> [Chunk]\n  secsToChunks chunknum bs =\n    case break isChunkHeader bs of\n      ([], []) -> []\n      ([], (d@(Div attr@(_,\"section\":_,_) (h@(Header lvl _ _) : bs')) : rest))\n        | chunklev == lvl ->\n          -- If the header is of the same level as chunks, create a chunk\n          toChunk chunknum d :\n            secsToChunks (chunknum + 1) rest\n        | chunklev > lvl ->\n          case break isChunkHeader bs' of\n            (xs, ys) -> toChunk chunknum (Div attr (h:xs)) :\n                          secsToChunks (chunknum + 1) (ys ++ rest)\n      (xs, ys) -> toChunk chunknum\n                     (Div (\"\",[\"preamble\"],[]) xs) :\n                    secsToChunks (chunknum + 1) ys\n\n  toChunk :: Int -> Block -> Chunk\n  toChunk chunknum\n    (Div (divid,\"section\":classes,kvs) (h@(Header lvl _ ils) : bs)) =\n    Chunk\n      { chunkHeading = ils\n      , chunkId = divid\n      , chunkLevel = lvl\n      , chunkNumber = chunknum\n      , chunkSectionNumber = secnum\n      , chunkPath = chunkpath\n      , chunkUp = Nothing\n      , chunkNext = Nothing\n      , chunkPrev = Nothing\n      , chunkUnlisted = \"unlisted\" `elem` classes\n      , chunkContents =\n         [Div (divid,\"section\":classes,kvs') (h : bs)]\n      }\n     where kvs' = kvs ++ [(\"nav-path\", T.pack chunkpath)]\n           secnum = lookup \"number\" kvs\n           chunkpath = resolvePathTemplate pathTemplate chunknum\n                        (stringify ils)\n                        divid\n                        (fromMaybe \"\" secnum)\n  toChunk chunknum (Div (\"\",[\"preamble\"],[]) bs) =\n      Chunk\n      { chunkHeading = docTitle meta\n      , chunkId = chunkid\n      , chunkLevel = 0\n      , chunkNumber = chunknum\n      , chunkSectionNumber = Nothing\n      , chunkPath = chunkpath\n      , chunkUp = Nothing\n      , chunkPrev = Nothing\n      , chunkNext = Nothing\n      , chunkUnlisted = False\n      , chunkContents = bs\n      }\n    where\n      chunkpath = resolvePathTemplate pathTemplate chunknum\n                        (stringify (docTitle meta))\n                        chunkid\n                        \"0\"\n      chunkid = inlineListToIdentifier mempty (docTitle meta) <>\n                      \"-\" <> tshow chunknum\n  toChunk _ b = error $ \"toChunk called on inappropriate block \" <> show b\n  -- should not happen\n\n\n-- Remove some attributes we added just to construct chunkNext etc.\nrmNavAttrs :: Block -> Block\nrmNavAttrs (Div (ident,classes,kvs) bs) =\n  Div (ident,classes,filter (not . isNavAttr) kvs) bs\n where\n  isNavAttr (k,_) = \"nav-\" `T.isPrefixOf` k\nrmNavAttrs b = b\n\nresolvePathTemplate :: PathTemplate\n                    -> Int -- ^ Chunk number\n                    -> Text -- ^ Stringified heading text\n                    -> Text -- ^ Section identifier\n                    -> Text -- ^ Section number\n                    -> FilePath\nresolvePathTemplate (PathTemplate templ) chunknum headingText ident secnum =\n  T.unpack .\n  T.filter (\\c -> c /= '/' && c /= '\\\\') .\n  T.replace \"%n\" (T.pack $ printf \"%03d\" chunknum) .\n  T.replace \"%s\" secnum .\n  T.replace \"%h\" headingText .\n  T.replace \"%i\" ident $\n  templ\n\n-- | A 'PathTemplate' is a FilePath in which certain codes\n-- will be substituted with information from a 'Chunk'.\n-- @%n@ will be replaced with the chunk number\n-- (padded with leading 0s to 3 digits),\n-- @%s@ with the section number of the heading,\n-- @%h@ with the (stringified) heading text,\n-- @%i@ with the section identifier.\n-- For example, @\"section-%s-%i.html\"@ might be resolved to\n-- @\"section-1.2-introduction.html\"@.\nnewtype PathTemplate =\n  PathTemplate { unPathTemplate :: Text }\n  deriving (Show, IsString, Data, Typeable, Generic, ToJSON, FromJSON)\n\n-- | A part of a document (typically a chapter or section, or\n-- the part of a section before its subsections).\ndata Chunk =\n  Chunk\n  { chunkHeading :: [Inline]\n  , chunkId :: Text\n  , chunkLevel :: Int\n  , chunkNumber :: Int\n  , chunkSectionNumber :: Maybe Text\n  , chunkPath :: FilePath\n  , chunkUp :: Maybe Chunk\n  , chunkPrev :: Maybe Chunk\n  , chunkNext :: Maybe Chunk\n  , chunkUnlisted :: Bool\n  , chunkContents :: [Block]\n  }\n  deriving (Show, Eq, Generic)\n\ninstance Walkable Inline Chunk where\n  query f chunk = query f (chunkContents chunk)\n  walk f chunk = chunk{ chunkContents = walk f (chunkContents chunk) }\n  walkM f chunk = do\n    contents <- walkM f (chunkContents chunk)\n    return chunk{ chunkContents = contents }\n\ninstance Walkable Block Chunk where\n  query f chunk = query f (chunkContents chunk)\n  walk f chunk = chunk{ chunkContents = walk f (chunkContents chunk) }\n  walkM f chunk = do\n    contents <- walkM f (chunkContents chunk)\n    return chunk{ chunkContents = contents }\n\n-- | A 'Pandoc' broken into 'Chunk's for writing to separate files.\ndata ChunkedDoc =\n  ChunkedDoc\n  { chunkedMeta :: Meta\n  , chunkedTOC :: Tree SecInfo\n  , chunkedChunks :: [Chunk]\n  } deriving (Show, Eq, Generic)\n\ninstance Walkable Inline ChunkedDoc where\n  query f doc = query f (chunkedChunks doc) <> query f (chunkedMeta doc)\n  walk f doc = doc{ chunkedMeta = walk f (chunkedMeta doc)\n                  , chunkedChunks = walk f (chunkedChunks doc)\n                  }\n  walkM f doc = do\n    meta' <- walkM f (chunkedMeta doc)\n    chunks' <- walkM f (chunkedChunks doc)\n    return $ doc{ chunkedMeta = meta'\n                , chunkedChunks = chunks' }\n\ninstance Walkable Block ChunkedDoc where\n  query f doc = query f (chunkedChunks doc) <> query f (chunkedMeta doc)\n  walk f doc = doc{ chunkedMeta = walk f (chunkedMeta doc)\n                  , chunkedChunks = walk f (chunkedChunks doc)\n                  }\n  walkM f doc = do\n    meta' <- walkM f (chunkedMeta doc)\n    chunks' <- walkM f (chunkedChunks doc)\n    return $ doc{ chunkedMeta = meta'\n                , chunkedChunks = chunks' }\n\n-- | Data for a section in a hierarchical document.\ndata SecInfo =\n  SecInfo\n  { secTitle :: [Inline]\n  , secNumber :: Maybe Text\n  , secId :: Text\n  , secPath :: Text -- including fragment, e.g. chunk001.html#section-one\n  , secLevel :: Int\n  } deriving (Show, Eq, Generic)\n\ninstance Walkable Inline SecInfo where\n  query f sec = query f (secTitle sec)\n  walk f sec = sec{ secTitle = walk f (secTitle sec) }\n  walkM f sec = do\n    st <- walkM f (secTitle sec)\n    return sec{ secTitle = st }\n\n-- | Create tree of sections with titles, links, and numbers,\n-- in a form that can be turned into a table of contents.\n-- Presupposes that the '[Block]' is the output of 'makeSections'.\ntoTOCTree :: [Block] -> Tree SecInfo\ntoTOCTree =\n  Node SecInfo{ secTitle = []\n              , secNumber = Nothing\n              , secId = \"\"\n              , secPath = \"\"\n              , secLevel = 0 } . foldr go []\n where\n  go :: Block -> [Tree SecInfo] -> [Tree SecInfo]\n  go (Div (ident,_,_) (Header lev (_,classes,kvs) ils : subsecs))\n    | not (isNothing (lookup \"number\" kvs) && \"unlisted\" `elem` classes)\n    = ((Node SecInfo{ secTitle = ils\n                    , secNumber = lookup \"number\" kvs\n                    , secId = ident\n                    , secPath = \"\"\n                    , secLevel = lev } (foldr go [] subsecs)) :)\n  go (Div _ [d@Div{}]) = go d -- #8402\n  go _ = id\n\n-- | Adjusts paths in the TOC tree generated by 'toTOCTree'\n-- to reflect division into Chunks.\nfixTOCTreePaths :: [Chunk] -> Tree SecInfo -> Tree SecInfo\nfixTOCTreePaths chunks = go \"\"\n where\n  idMap = foldr (\\chunk m ->\n                   let ids = filter (not . T.null)\n                               (chunkId chunk :\n                                  query getIds (chunkContents chunk))\n                    in foldr (\\i -> M.insert i (chunkPath chunk)) m ids)\n                mempty chunks\n  getIds :: Block -> [Text]\n  getIds (Div (i,\"section\":_,_) _) = [i]\n  getIds _ = []\n  go :: FilePath -> Tree SecInfo -> Tree SecInfo\n  go fp (Node secinfo subtrees) =\n    let newpath = M.lookup (secId secinfo) idMap\n        fp' = fromMaybe fp newpath\n        fragment = \"#\" <> secId secinfo\n     in Node secinfo{ secPath = T.pack fp' <> fragment }\n             (map (go fp') subtrees)\n\n-- | Creates a TOC link to the respective document section.\ntocEntryToLink :: Bool -> SecInfo -> [Inline]\ntocEntryToLink includeNumbers secinfo = headerLink\n where\n  addNumber  = case secNumber secinfo of\n                 Just num | includeNumbers\n                        -> (Span (\"\",[\"toc-section-number\"],[])\n                               [Str num] :) . (Space :)\n                 _ -> id\n  clean (Link _ xs _) = xs\n  clean (Note _) = []\n  clean x = [x]\n  anchor = if T.null (secPath secinfo)\n              then if T.null (secId secinfo)\n                      then \"\"\n                      else \"#\" <> secId secinfo\n              else secPath secinfo\n  headerText = addNumber $ walk (concatMap clean) (secTitle secinfo)\n  headerLink = if T.null anchor\n                  then headerText\n                  else [Link ((if T.null (secId secinfo)\n                                  then \"\"\n                                  else \"toc-\" <> secId secinfo), [], [])\n                         headerText (anchor, \"\")]\n\n-- | Generate a table of contents of the given depth.\ntocToList :: Bool -> Int -> Tree SecInfo -> Block\ntocToList includeNumbers tocDepth (Node _ subtrees) = BulletList (toItems subtrees)\n where\n  toItems = map go . filter isBelowTocDepth\n  isBelowTocDepth (Node sec _) = secLevel sec <= tocDepth\n  go (Node secinfo xs) =\n    Plain (tocEntryToLink includeNumbers secinfo) :\n      case toItems xs of\n        [] -> []\n        ys -> [BulletList ys]\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/BibTeX.hs",
    "content": "{-# LANGUAGE ViewPatterns      #-}\n{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}\n-----------------------------------------------------------------------------\n-- |\n-- Module      :  Text.CSL.Input.Bibtex\n-- Copyright   :  (c) John MacFarlane\n-- License     :  BSD-style (see LICENSE)\n--\n-- Maintainer  :  John MacFarlane <fiddlosopher@gmail.com>\n-- Stability   :  unstable\n-- Portability :  portable\n--\n-----------------------------------------------------------------------------\n\nmodule Text.Pandoc.Citeproc.BibTeX\n    ( Variant(..)\n    , readBibtexString\n    , writeBibtexString\n    )\n    where\n\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Readers.LaTeX (readLaTeX)\nimport Text.Pandoc.Extensions (Extension(..), extensionsFromList)\nimport Text.Pandoc.Options (ReaderOptions(..), WriterOptions)\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Shared (stringify)\nimport Text.Pandoc.Writers.LaTeX (writeLaTeX)\nimport Text.Pandoc.Class (runPure)\nimport qualified Text.Pandoc.Walk       as Walk\nimport Citeproc.Types\nimport Citeproc.Pandoc ()\nimport Data.List.Split (splitOn)\nimport Text.Pandoc.Citeproc.Util (toIETF, splitStrWhen)\nimport Text.Pandoc.Citeproc.Data (biblatexStringMap)\nimport Text.Pandoc.Citeproc.Name (toName, NameOpts(..), emptyName)\nimport Data.Default\nimport           Data.Text              (Text)\nimport qualified Data.Text              as T\nimport qualified Data.Map               as Map\nimport           Data.Maybe\nimport           Text.Pandoc.Parsing hiding ((<|>), many)\nimport           Control.Applicative\nimport           Control.Monad ( guard, MonadPlus(..), void )\nimport Control.Monad.RWS ( asks, RWST, gets, modify, evalRWST )\nimport qualified Data.Sequence          as Seq\nimport           Data.Char              (isAlphaNum, isDigit, isLetter,\n                                         isUpper, toLower, toUpper,\n                                         isLower, isPunctuation, isSpace)\nimport           Data.List              (intercalate, intersperse)\nimport qualified Data.List as L\nimport           Safe                   (readMay)\nimport           Text.Printf            (printf)\nimport           Text.DocLayout         (literal, hsep, nest, hang, Doc(..),\n                                         braces, ($$), cr)\n\ndata Variant = Bibtex | Biblatex\n  deriving (Show, Eq, Ord)\n\n-- | Parse BibTeX or BibLaTeX into a list of 'Reference's.\nreadBibtexString :: ToSources a\n                 => Variant           -- ^ bibtex or biblatex\n                 -> Locale            -- ^ Locale\n                 -> (Text -> Bool)    -- ^ Filter on citation ids\n                 -> a                 -- ^ bibtex/biblatex text\n                 -> Either ParseError [Reference Inlines]\nreadBibtexString variant locale idpred contents = do\n  case runParser (((resolveCrossRefs variant <$> bibEntries) <* eof) >>=\n                   mapM (itemToReference locale variant) .\n                      filter (\\item -> idpred (identifier item) &&\n                                        entryType item /= \"xdata\"))\n           (fromMaybe defaultLang $ localeLanguage locale, Map.empty)\n           (initialSourceName sources) sources of\n          Left err -> Left err\n          Right xs -> return xs\n where\n  sources = toSources contents\n\n-- | Write BibTeX or BibLaTeX given given a 'Reference'.\nwriteBibtexString :: WriterOptions       -- ^ options (for writing LaTex)\n                  -> Variant             -- ^ bibtex or biblatex\n                  -> Maybe Lang          -- ^ Language\n                  -> Reference Inlines   -- ^ Reference to write\n                  -> Doc Text\nwriteBibtexString opts variant mblang ref =\n  \"@\" <> bibtexType <> \"{\" <> literal (unItemId (referenceId ref)) <> \",\"\n  $$ nest 2 (renderFields fs)\n  $$ \"}\" <> cr\n\n where\n  bibtexType =\n    case referenceType ref of\n      \"article-magazine\"  -> \"article\"\n      \"article-newspaper\" -> \"article\"\n      \"article-journal\"   -> \"article\"\n      \"book\"              -> \"book\"\n      \"pamphlet\"          -> \"booklet\"\n      \"dataset\" | variant == Biblatex -> \"dataset\"\n      \"webpage\" | variant == Biblatex -> \"online\"\n      \"chapter\"           -> case getVariable \"editor\" of\n                                Just _  -> \"incollection\"\n                                Nothing -> \"inbook\"\n      \"entry-encyclopedia\" | variant == Biblatex -> \"inreference\"\n                           | otherwise -> \"inbook\"\n      \"paper-conference\"  -> \"inproceedings\"\n      \"thesis\" -> case getVariableAsText \"genre\" of\n                    Just \"mathesis\" -> \"mastersthesis\"\n                    _               -> \"phdthesis\"\n      \"patent\"            | variant == Biblatex -> \"patent\"\n      \"report\"            | variant == Biblatex -> \"report\"\n                          | otherwise -> \"techreport\"\n      \"speech\"            -> \"unpublished\"\n      \"manuscript\"        -> \"unpublished\"\n      \"graphic\"           | variant == Biblatex -> \"artwork\"\n      \"song\"              | variant == Biblatex -> \"music\"\n      \"legal_case\"        | variant == Biblatex -> \"jurisdiction\"\n      \"legislation\"       | variant == Biblatex -> \"legislation\"\n      \"treaty\"            | variant == Biblatex -> \"legal\"\n      \"personal_communication\" | variant == Biblatex -> \"letter\"\n      \"motion_picture\"    | variant == Biblatex -> \"movie\"\n      \"review\"            | variant == Biblatex -> \"review\"\n      \"software\"          | variant == Biblatex -> \"software\"\n      _                   -> \"misc\"\n\n  mbSubtype =\n    case referenceType ref of\n      \"article-magazine\"  -> Just \"magazine\"\n      \"article-newspaper\" -> Just \"newspaper\"\n      _ -> Nothing\n\n  fs =\n    case variant of\n      Biblatex ->\n           [ \"author\"\n           , \"editor\"\n           , \"translator\"\n           , \"publisher\"\n           , \"title\"\n           , \"booktitle\"\n           , \"journal\"\n           , \"series\"\n           , \"edition\"\n           , \"volume\"\n           , \"volumes\"\n           , \"number\"\n           , \"pages\"\n           , \"pagetotal\"\n           , \"version\"\n           , \"date\"\n           , \"eventdate\"\n           , \"urldate\"\n           , \"address\"\n           , \"url\"\n           , \"doi\"\n           , \"isbn\"\n           , \"issn\"\n           , \"type\"\n           , \"entrysubtype\"\n           , \"note\"\n           , \"langid\"\n           , \"abstract\"\n           , \"keywords\"\n           , \"annote\"\n           ]\n      Bibtex ->\n           [ \"author\"\n           , \"editor\"\n           , \"translator\"\n           , \"publisher\"\n           , \"title\"\n           , \"booktitle\"\n           , \"journal\"\n           , \"series\"\n           , \"edition\"\n           , \"volume\"\n           , \"number\"\n           , \"pages\"\n           , \"year\"\n           , \"month\"\n           , \"address\"\n           , \"type\"\n           , \"note\"\n           , \"annote\"\n           , \"url\" -- not officially supported, but supported by\n                   -- some styles (#8287)\n           ]\n\n  valToInlines (TextVal t) = B.text t\n  valToInlines (FancyVal ils) = ils\n  valToInlines (NumVal n) = B.text (T.pack $ show n)\n  valToInlines (NamesVal names) =\n    mconcat $ intersperse (B.space <> B.text \"and\" <> B.space)\n            $ map renderName names\n  valToInlines (DateVal date) = B.text $\n    case dateLiteral date of\n      Just t  -> t\n      Nothing -> T.intercalate \"/\" (map renderDatePart (dateParts date)) <>\n                    (if dateCirca date then \"~\" else mempty)\n  valToInlines SubstitutedVal = mempty\n\n  renderDatePart (DateParts xs) = T.intercalate \"-\" $\n                                    map (T.pack . printf \"%02d\") xs\n\n  renderName name =\n    case nameLiteral name of\n      Just t  -> B.spanWith (\"\",[],[]) $ B.text t\n      Nothing -> spacedMaybes\n                  [ nameNonDroppingParticle name\n                  , nameFamily name\n                  , if nameCommaSuffix name\n                        then (\", \" <>) <$> nameSuffix name\n                        else nameSuffix name ]\n                  <>\n                  spacedMaybes\n                   [ (\", \" <>) <$> nameGiven name,\n                     nameDroppingParticle name ]\n\n  mblang' = case getVariableAsText \"language\" of\n              Just l  -> either (const Nothing) Just $ parseLang l\n              Nothing -> mblang\n\n  titlecase = case mblang' of\n                Just lang | langLanguage lang == \"en\"\n                                   -> titlecase'\n                Nothing            -> titlecase'\n                _                  ->\n                  case variant of\n                    Bibtex         -> B.spanWith nullAttr\n                     -- BibTex lacks a language field, so we wrap non-English\n                     -- titles in {} to protect case.\n                    Biblatex       -> id\n\n  titlecase' = addTextCase mblang' TitleCase .\n    (\\ils -> B.fromList\n               (case B.toList ils of\n                  Str t : xs -> Str t : Walk.walk spanAroundCapitalizedWords xs\n                  xs         -> Walk.walk spanAroundCapitalizedWords xs))\n\n  -- protect capitalized words when we titlecase\n  spanAroundCapitalizedWords (Str t)\n    | not (T.all (\\c -> isLower c || not (isLetter c)) t) =\n       Span (\"\",[\"nocase\"],[]) [Str t]\n  spanAroundCapitalizedWords x = x\n\n  spacedMaybes = mconcat . intersperse B.space . mapMaybe (fmap B.text)\n\n  toLaTeX x =\n    case runPure (writeLaTeX opts $ doc (B.plain x)) of\n           Left _  -> Nothing\n           Right t -> Just $ hsep . map literal $ T.words t\n\n  renderField :: Text -> Maybe (Doc Text)\n  renderField name =\n    (((literal name) <>) . hang 2 \" = \" . braces)\n      <$> getContentsFor name\n\n  getVariable v = lookupVariable (toVariable v) ref\n\n  getVariableAsText v = (stringify . valToInlines) <$> getVariable v\n\n  getYear val =\n    case val of\n       DateVal date ->\n         case dateLiteral date of\n           Just t -> toLaTeX (B.text t)\n           Nothing ->\n             case dateParts date of\n               [DateParts (y1:_), DateParts (y2:_)] ->\n                 Just $ literal (T.pack (printf \"%04d\" y1) <> \"--\" <>\n                        T.pack (printf \"%04d\" y2))\n               [DateParts (y1:_)] ->\n                 Just $ literal (T.pack (printf \"%04d\" y1))\n               _ -> Nothing\n       _ -> Nothing\n\n  toMonth 1 = \"jan\"\n  toMonth 2 = \"feb\"\n  toMonth 3 = \"mar\"\n  toMonth 4 = \"apr\"\n  toMonth 5 = \"may\"\n  toMonth 6 = \"jun\"\n  toMonth 7 = \"jul\"\n  toMonth 8 = \"aug\"\n  toMonth 9 = \"sep\"\n  toMonth 10 = \"oct\"\n  toMonth 11 = \"nov\"\n  toMonth 12 = \"dec\"\n  toMonth x  = T.pack $ show x\n\n  getMonth val =\n    case val of\n       DateVal date ->\n         case dateParts date of\n           [DateParts (_:m1:_), DateParts (_:m2:_)] ->\n             Just $ literal (toMonth m1 <> \"--\" <> toMonth m2)\n           [DateParts (_:m1:_)] -> Just $ literal (toMonth m1)\n           _ -> Nothing\n       _ -> Nothing\n\n  getContentsFor :: Text -> Maybe (Doc Text)\n  getContentsFor \"type\" =\n    getVariableAsText \"genre\" >>=\n       \\case\n          \"mathesis\"  -> Just \"mastersthesis\"\n          \"phdthesis\" -> Just \"phdthesis\"\n          _           -> Nothing\n  getContentsFor \"entrysubtype\" = literal <$> mbSubtype\n  getContentsFor \"journal\"\n    | bibtexType `elem` [\"article\", \"periodical\", \"suppperiodical\", \"review\"]\n      = getVariable \"container-title\" >>= toLaTeX . valToInlines\n    | otherwise = Nothing\n  getContentsFor \"booktitle\"\n    | bibtexType `elem`\n       [\"inbook\",\"incollection\",\"inproceedings\",\"inreference\",\"bookinbook\"]\n    = (getVariable \"volume-title\" <|> getVariable \"container-title\")\n                               >>= toLaTeX . valToInlines\n    | otherwise = Nothing\n  getContentsFor \"series\" = getVariable \"collection-title\"\n                               >>= toLaTeX . valToInlines\n  getContentsFor \"address\" = getVariable \"publisher-place\"\n                               >>= toLaTeX . valToInlines\n  getContentsFor \"date\"  = getVariable \"issued\" >>= toLaTeX . valToInlines\n  getContentsFor \"eventdate\" = getVariable \"event-date\" >>= toLaTeX . valToInlines\n  getContentsFor \"urldate\"  = getVariable \"accessed\" >>= toLaTeX . valToInlines\n  getContentsFor \"year\"  = getVariable \"issued\" >>= getYear\n  getContentsFor \"month\"  = getVariable \"issued\" >>= getMonth\n  getContentsFor \"pages\"  = getVariable \"page\" >>= toLaTeX . valToInlines\n  getContentsFor \"pagetotal\" = getVariable \"number-of-pages\"\n                                  >>= toLaTeX . valToInlines\n  getContentsFor \"langid\"  = getVariable \"language\" >>= toLaTeX . valToInlines\n  getContentsFor \"number\" = (getVariable \"number\"\n                         <|> getVariable \"collection-number\"\n                         <|> getVariable \"issue\") >>= toLaTeX . valToInlines\n\n  getContentsFor x = getVariable x >>=\n    if isURL x\n       then Just . literal . stringify . valToInlines\n       else toLaTeX .\n            (if x == \"title\"\n                then titlecase\n                else id) .\n            valToInlines\n\n  isURL x = x `elem` [\"url\",\"doi\",\"issn\",\"isbn\"]\n\n  renderFields = mconcat . intersperse (\",\" <> cr) . mapMaybe renderField\n\ndefaultLang :: Lang\ndefaultLang = Lang \"en\" Nothing (Just \"US\") [] [] []\n\n-- a map of bibtex \"string\" macros\ntype StringMap = Map.Map Text Text\n\ntype BibParser = Parsec Sources (Lang, StringMap)\n\ndata Item = Item{ identifier :: Text\n                , sourcePos  :: SourcePos\n                , entryType  :: Text\n                , fields     :: Map.Map Text Text\n                }\n                deriving (Show, Ord, Eq)\n\nitemToReference :: Locale -> Variant -> Item -> BibParser (Reference Inlines)\nitemToReference locale variant item = do\n  setPosition (sourcePos item)\n  bib item $ do\n    let lang = fromMaybe defaultLang $ localeLanguage locale\n    modify $ \\st -> st{ localeLang = lang,\n                        untitlecase = langLanguage lang == \"en\" }\n\n    id' <- asks identifier\n    otherIds <- (Just <$> getRawField \"ids\")\n                  <|> return Nothing\n    (reftype, genre) <- getTypeAndGenre\n    -- hyphenation:\n    let getLangId = do\n             langid <- T.strip . T.toLower <$> getRawField \"langid\"\n             idopts <- T.strip . T.toLower . stringify <$>\n                           getField \"langidopts\" <|> return \"\"\n             case (langid, idopts) of\n                  (\"english\",\"variant=british\")    -> return \"british\"\n                  (\"english\",\"variant=american\")   -> return \"american\"\n                  (\"english\",\"variant=us\")         -> return \"american\"\n                  (\"english\",\"variant=usmax\")      -> return \"american\"\n                  (\"english\",\"variant=uk\")         -> return \"british\"\n                  (\"english\",\"variant=australian\") -> return \"australian\"\n                  (\"english\",\"variant=newzealand\") -> return \"newzealand\"\n                  (x,_)                            -> return x\n    hyphenation <- (Just . toIETF . T.toLower <$>\n                     (getLangId <|> getRawField \"hyphenation\"))\n                  <|> return Nothing\n    modify $ \\s -> s{ untitlecase = untitlecase s &&\n                                      case hyphenation of\n                                        Just x ->\n                                          \"en-\" `T.isPrefixOf` x || x == \"en\"\n                                        _ -> True }\n\n\n    opts <- (parseOptions <$> getRawField \"options\") <|> return []\n\n    et <- asks entryType\n\n    -- titles\n    let isArticle = et `elem`\n                     [\"article\", \"periodical\", \"suppperiodical\", \"review\"]\n    let isPeriodical = et == \"periodical\"\n    let isChapterlike = et `elem`\n           [\"inbook\",\"incollection\",\"inproceedings\",\"inreference\",\"bookinbook\"]\n\n    let getFieldMaybe f = (Just <$> getField f) <|> return Nothing\n\n    -- names\n    let getNameList' f = Just <$>\n         getNameList opts f\n\n    author' <- getNameList' \"author\" <|> return Nothing\n    containerAuthor' <- getNameList' \"bookauthor\" <|> return Nothing\n    translator' <- getNameList' \"translator\" <|> return Nothing\n    editortype <- getRawField \"editortype\" <|> return mempty\n    editor'' <- getNameList' \"editor\" <|> return Nothing\n    director'' <- getNameList' \"director\" <|> return Nothing\n    let (editor', director') = case editortype of\n                                    \"director\" -> (Nothing, editor'')\n                                    _          -> (editor'', director'')\n    -- FIXME: add same for editora, editorb, editorc\n\n    -- dates\n    issued' <- (Just <$> (getDate \"date\" <|> getOldDate mempty)) <|>\n               return Nothing\n    eventDate' <- (Just <$> (getDate \"eventdate\" <|> getOldDate \"event\")) <|>\n                   return Nothing\n    origDate' <- (Just <$> (getDate \"origdate\" <|> getOldDate \"orig\")) <|>\n                   return Nothing\n    accessed' <- (Just <$> (getDate \"urldate\" <|> getOldDate \"url\")) <|>\n                    return Nothing\n\n    -- locators\n    pages' <- getFieldMaybe \"pages\"\n    volume' <- getFieldMaybe \"volume\"\n    part' <- getFieldMaybe \"part\"\n    volumes' <- getFieldMaybe \"volumes\"\n    pagetotal' <- getFieldMaybe \"pagetotal\"\n    chapter' <- getFieldMaybe \"chapter\"\n    edition' <- getFieldMaybe \"edition\"\n    version' <- getFieldMaybe \"version\"\n    (number', collectionNumber', issue') <-\n       (getField \"number\" >>= \\x ->\n         if et `elem` [\"book\",\"collection\",\"proceedings\",\"reference\",\n                       \"mvbook\",\"mvcollection\",\"mvproceedings\", \"mvreference\",\n                       \"bookinbook\",\"inbook\", \"incollection\",\"inproceedings\",\n                       \"inreference\", \"suppbook\",\"suppcollection\"]\n         then return (Nothing, Just x, Nothing)\n         else if isArticle\n              then (getField \"issue\" >>= \\y ->\n                      return (Nothing, Nothing, Just $ concatWith ',' [x,y]))\n                 <|> return (Nothing, Nothing, Just x)\n              else return (Just x, Nothing, Nothing))\n        <|> return (Nothing, Nothing, Nothing)\n\n    -- titles\n    hasMaintitle <- (True <$ getRawField \"maintitle\") <|> return False\n\n    title' <- Just <$>\n              ((guard isPeriodical >> getTitle \"issuetitle\")\n              <|> (guard hasMaintitle >>\n                   guard (not isChapterlike) >>\n                   getTitle \"maintitle\")\n              <|> getTitle \"title\")\n              <|> return Nothing\n\n    subtitle' <- (guard isPeriodical >> getTitle \"issuesubtitle\")\n                  <|> (guard hasMaintitle >>\n                       guard (not isChapterlike) >>\n                       getTitle \"mainsubtitle\")\n                  <|> getTitle \"subtitle\"\n                  <|> return mempty\n    titleaddon' <- (guard hasMaintitle >>\n                     guard (not isChapterlike) >>\n                     getTitle \"maintitleaddon\")\n                    <|> getTitle \"titleaddon\"\n                    <|> return mempty\n\n    volumeTitle' <- Just <$>\n                    ((guard hasMaintitle >>\n                      guard (not isChapterlike) >>\n                      getTitle \"title\")\n                     <|> (guard hasMaintitle >>\n                          guard isChapterlike >>\n                          getTitle \"booktitle\"))\n                    <|> return Nothing\n    volumeSubtitle' <- (guard hasMaintitle >>\n                        guard (not isChapterlike) >>\n                        getTitle \"subtitle\")\n                       <|> (guard hasMaintitle >>\n                            guard isChapterlike >>\n                            getTitle \"booksubtitle\")\n                       <|> return mempty\n    volumeTitleAddon' <- (guard hasMaintitle >>\n                          guard (not isChapterlike) >>\n                          getTitle \"titleaddon\")\n                         <|> (guard hasMaintitle >>\n                              guard isChapterlike >>\n                              getTitle \"booktitleaddon\")\n                         <|> return mempty\n\n    containerTitle' <- Just <$>\n                       ((guard isPeriodical >> getPeriodicalTitle \"title\")\n                       <|> (guard isChapterlike >> getTitle \"maintitle\")\n                       <|> (guard isChapterlike >> getTitle \"booktitle\")\n                       <|> getPeriodicalTitle \"journaltitle\"\n                       <|> getPeriodicalTitle \"journal\")\n                       <|> return Nothing\n    containerSubtitle' <- (guard isPeriodical >> getPeriodicalTitle \"subtitle\")\n                          <|> (guard isChapterlike >> getTitle \"mainsubtitle\")\n                          <|> (guard isChapterlike >> getTitle \"booksubtitle\")\n                          <|> getPeriodicalTitle \"journalsubtitle\"\n                          <|> return mempty\n    containerTitleAddon' <- (guard isPeriodical >>\n                             getPeriodicalTitle \"titleaddon\")\n                            <|> (guard isChapterlike >>\n                                 getTitle \"maintitleaddon\")\n                            <|> (guard isChapterlike >>\n                                 getTitle \"booktitleaddon\")\n                            <|> return mempty\n    containerTitleShort' <- Just <$>\n                            ((guard isPeriodical >>\n                              guard (not hasMaintitle) >>\n                              getField \"shorttitle\")\n                            <|> getPeriodicalTitle \"shortjournal\")\n                           <|> return Nothing\n\n    -- change numerical series title to e.g. 'series 3'\n    let fixSeriesTitle [Str xs] | isNumber xs =\n          [Str (ordinalize locale xs), Space, Str (resolveKey' lang \"jourser\")]\n        fixSeriesTitle xs = xs\n\n    seriesTitle' <- (Just . B.fromList . fixSeriesTitle . B.toList\n                       <$> getTitle \"series\") <|>\n                    return Nothing\n    shortTitle' <- (Just <$> (guard (not hasMaintitle || isChapterlike) >>\n                              getTitle \"shorttitle\"))\n                 <|> (if (subtitle' /= mempty || titleaddon' /= mempty) &&\n                          not hasMaintitle\n                          then getShortTitle False \"title\"\n                          else getShortTitle True  \"title\")\n                 <|> return Nothing\n\n    eventTitle' <- Just <$> getTitle \"eventtitle\" <|> return Nothing\n    origTitle' <- Just <$> getTitle \"origtitle\" <|> return Nothing\n\n    -- publisher\n    pubfields <- mapM (\\f -> Just `fmap`\n                         (if variant == Bibtex || f == \"howpublished\"\n                          then getField f\n                          else getLiteralList' f)\n                        <|> return Nothing)\n           [\"school\",\"institution\",\"organization\", \"howpublished\",\"publisher\"]\n    let publisher' = case catMaybes pubfields of\n                       [] -> Nothing\n                       xs -> Just $ concatWith ';' xs\n    origpublisher' <- (Just <$> getField \"origpublisher\") <|> return Nothing\n\n    -- places\n    venue' <- (Just <$> getField \"venue\") <|> return Nothing\n    address' <- Just <$>\n                  (if variant == Bibtex\n                      then getField \"address\"\n                      else getLiteralList' \"address\"\n                         <|> (guard (et /= \"patent\") >>\n                              getLiteralList' \"location\"))\n                <|> return Nothing\n    origLocation' <- Just <$>\n                  (if variant == Bibtex\n                      then getField \"origlocation\"\n                      else getLiteralList' \"origlocation\")\n                    <|> return Nothing\n    jurisdiction' <- if reftype == \"patent\"\n                     then Just <$>\n                        (concatWith ';' . map (resolveKey lang) <$>\n                             getLiteralList \"location\") <|> return Nothing\n                     else return Nothing\n\n    -- url, doi, isbn, etc.:\n    -- note that with eprinttype = arxiv, we take eprint to be a partial url\n    -- archivePrefix is an alias for eprinttype\n    url' <- (guard (et == \"online\" || lookup \"url\" opts /= Just \"false\")\n             >> Just <$> getRawField \"url\")\n         <|> (do etype <- getRawField \"eprinttype\"\n                 eprint <- getRawField \"eprint\"\n                 let baseUrl =\n                       case T.toLower etype of\n                         \"arxiv\"       -> \"https://arxiv.org/abs/\"\n                         \"jstor\"       -> \"https://www.jstor.org/stable/\"\n                         \"pubmed\"      -> \"https://www.ncbi.nlm.nih.gov/pubmed/\"\n                         \"googlebooks\" -> \"https://books.google.com?id=\"\n                         _             -> \"\"\n                 if T.null baseUrl\n                    then mzero\n                    else return $ Just $ baseUrl <> eprint)\n         <|> return Nothing\n    doi' <- (guard (lookup \"doi\" opts /= Just \"false\") >>\n             Just <$> getRawField \"doi\")\n           <|> return Nothing\n    isbn' <- Just <$> getRawField \"isbn\" <|> return Nothing\n    issn' <- Just <$> getRawField \"issn\" <|> return Nothing\n    pmid' <- Just <$> getRawField  \"pmid\" <|> return Nothing\n    pmcid' <- Just <$> getRawField \"pmcid\" <|> return Nothing\n    callNumber' <- Just <$> getRawField \"library\" <|> return Nothing\n\n    -- notes\n    annotation' <- Just <$>\n                   (getField \"annotation\" <|> getField \"annote\")\n                     <|> return Nothing\n    abstract' <- Just <$> getField \"abstract\" <|> return Nothing\n    keywords' <- Just <$> getField \"keywords\" <|> return Nothing\n    note' <- if et == \"periodical\"\n             then return Nothing\n             else Just <$> getField \"note\" <|> return Nothing\n    addendum' <- if variant == Bibtex\n                    then return Nothing\n                    else Just <$> getField \"addendum\"\n                 <|> return Nothing\n    pubstate' <- (  (Just . resolveKey lang <$> getField \"pubstate\")\n                  <|> case dateLiteral <$> issued' of\n                           Just (Just \"forthcoming\") ->\n                             return $ Just $ B.str \"forthcoming\"\n                           _ -> return Nothing\n                   )\n\n\n\n\n    let addField (_, Nothing) = id\n        addField (f, Just x)  = Map.insert f x\n    let vars = foldr addField mempty\n                [ (\"other-ids\", TextVal <$> otherIds)\n                , (\"genre\", TextVal <$> genre)\n                , (\"language\", TextVal <$> hyphenation)\n                -- dates\n                , (\"accessed\", DateVal <$> accessed')\n                , (\"event-date\", DateVal <$> eventDate')\n                , (\"issued\", DateVal <$> issued')\n                , (\"original-date\", DateVal <$> origDate')\n                -- names\n                , (\"author\", NamesVal <$> author')\n                , (\"editor\", NamesVal <$> editor')\n                , (\"translator\", NamesVal <$> translator')\n                , (\"director\", NamesVal <$> director')\n                , (\"container-author\", NamesVal <$> containerAuthor')\n                -- locators\n                , (\"page\", FancyVal . Walk.walk convertEnDash <$> pages')\n                , (\"number-of-pages\", FancyVal <$> pagetotal')\n                , (\"volume\", case (volume', part') of\n                               (Nothing, Nothing) -> Nothing\n                               (Just v, Nothing) -> Just $ FancyVal v\n                               (Nothing, Just p) -> Just $ FancyVal p\n                               (Just v, Just p)  ->\n                                 Just $ FancyVal $ v <> B.str \".\" <> p)\n                , (\"number-of-volumes\", FancyVal <$> volumes')\n                , (\"chapter-number\", FancyVal <$> chapter')\n                , (\"edition\", FancyVal <$> edition')\n                , (\"version\", FancyVal <$> version')\n                , (\"number\", FancyVal <$> number')\n                , (\"collection-number\", FancyVal <$> collectionNumber')\n                , (\"issue\", FancyVal <$> issue')\n                -- title\n                , (\"original-title\", FancyVal <$> origTitle')\n                , (\"event\", FancyVal <$> eventTitle')\n                , (\"title\", case title' of\n                              Just t -> Just $ FancyVal $\n                                         concatWith '.' [\n                                             concatWith ':' [t, subtitle']\n                                           , titleaddon' ]\n                              Nothing -> Nothing)\n                , (\"volume-title\",\n                            case volumeTitle' of\n                              Just t -> Just $ FancyVal $\n                                         concatWith '.' [\n                                             concatWith ':' [t, volumeSubtitle']\n                                           , volumeTitleAddon' ]\n                              Nothing -> Nothing)\n                , (\"container-title\",\n                            case containerTitle' of\n                              Just t -> Just $ FancyVal $\n                                         concatWith '.' [\n                                             concatWith ':' [t,\n                                               containerSubtitle']\n                                           , containerTitleAddon' ]\n                              Nothing -> Nothing)\n                , (\"container-title-short\", FancyVal <$> containerTitleShort')\n                , (\"collection-title\", FancyVal <$> seriesTitle')\n                , (\"title-short\", FancyVal <$> shortTitle')\n                -- publisher\n                , (\"publisher\", FancyVal <$> publisher')\n                , (\"original-publisher\", FancyVal <$> origpublisher')\n                -- places\n                , (\"jurisdiction\", FancyVal <$> jurisdiction')\n                , (\"event-place\",  FancyVal <$> venue')\n                , (\"publisher-place\", FancyVal <$> address')\n                , (\"original-publisher-place\", FancyVal <$> origLocation')\n                -- urls\n                , (\"url\", TextVal <$> url')\n                , (\"doi\", TextVal <$> doi')\n                , (\"isbn\", TextVal <$> isbn')\n                , (\"issn\", TextVal <$> issn')\n                , (\"pmcid\", TextVal <$> pmcid')\n                , (\"pmid\", TextVal <$> pmid')\n                , (\"call-number\", TextVal <$> callNumber')\n                -- notes\n                , (\"note\", case catMaybes [note', addendum'] of\n                             [] -> Nothing\n                             xs -> return $ FancyVal $ concatWith '.' xs)\n                , (\"annote\", FancyVal <$> annotation')\n                , (\"abstract\", FancyVal <$> abstract')\n                , (\"keyword\", FancyVal <$> keywords')\n                , (\"status\", FancyVal <$> pubstate')\n                ]\n    return $ Reference\n      { referenceId             = ItemId id'\n      , referenceType           = reftype\n      , referenceDisambiguation = Nothing\n      , referenceVariables      = vars }\n\n\nbib :: Item -> Bib a -> BibParser a\nbib entry m = fst <$> evalRWST m entry (BibState True defaultLang)\n\nresolveCrossRefs :: Variant -> [Item] -> [Item]\nresolveCrossRefs variant entries =\n  map (resolveCrossRef variant entries) entries\n\nresolveCrossRef :: Variant -> [Item] -> Item -> Item\nresolveCrossRef variant entries entry =\n  Map.foldrWithKey go entry (fields entry)\n  where go key val entry' =\n          if key == \"crossref\" || key == \"xdata\"\n          then entry'{ fields = fields entry' <>\n                          Map.fromList (getXrefFields variant\n                                        entry entries val) }\n          else entry'\n\ngetXrefFields :: Variant -> Item -> [Item] -> Text -> [(Text, Text)]\ngetXrefFields variant baseEntry entries keys = do\n  let keys' = splitKeys keys\n  xrefEntry <- [e | e <- entries, identifier e `elem` keys']\n  (k, v) <- Map.toList $ fields xrefEntry\n  if k == \"crossref\" || k == \"xdata\"\n     then do\n       xs <- mapM (getXrefFields variant baseEntry entries)\n                   (splitKeys v)\n       (x, y) <- xs\n       guard $ isNothing $ Map.lookup x $ fields xrefEntry\n       return (x, y)\n     else do\n       k' <- case variant of\n               Bibtex -> return k\n               Biblatex -> transformKey\n                            (entryType xrefEntry) (entryType baseEntry) k\n       guard $ isNothing $ Map.lookup k' $ fields baseEntry\n       return (k',v)\n\n\n\ndata BibState = BibState{\n           untitlecase    :: Bool\n         , localeLang     :: Lang\n         }\n\ntype Bib = RWST Item () BibState BibParser\n\nblocksToInlines :: [Block] -> Inlines\nblocksToInlines bs =\n  case bs of\n       [Plain xs] -> B.fromList xs\n       [Para  xs] -> B.fromList xs\n       _          -> B.fromList $ Walk.query (:[]) bs\n\nadjustSpans :: Lang -> Inline -> Inline\nadjustSpans lang (Span (\"\",[],[(\"bibstring\",s)]) _) = Str $ resolveKey' lang s\nadjustSpans _ SoftBreak = Space\nadjustSpans _ x = x\n\nlatex' :: Text -> Bib [Block]\nlatex' t = do\n  lang <- gets localeLang\n  case parseLaTeX lang t of\n    Left _   -> mzero\n    Right bs -> return bs\n\nparseLaTeX :: Lang -> Text -> Either PandocError [Block]\nparseLaTeX lang t =\n  case runPure (readLaTeX\n                def{ readerExtensions =\n                      extensionsFromList [Ext_raw_tex, Ext_smart] } t) of\n    Left e              -> Left e\n    Right (Pandoc _ bs) -> Right $ Walk.walk (adjustSpans lang) bs\n\nlatex :: Text -> Bib Inlines\nlatex = fmap blocksToInlines . latex' . T.strip\n\nbibEntries :: BibParser [Item]\nbibEntries = do\n  skipMany nonEntry\n  many (bibItem <* skipMany nonEntry)\n where nonEntry = bibSkip <|>\n                  comment <|>\n                  try (char '@' >>\n                       (bibComment <|> bibPreamble <|> bibString))\n\nbibSkip :: BibParser ()\nbibSkip = skipMany1 (satisfy (\\c -> c /='@' && c /='%'))\n\ncomment :: BibParser ()\ncomment = char '%' *> void anyLine\n\nbibComment :: BibParser ()\nbibComment = do\n  cistring \"comment\"\n  spaces'\n  void inBraces\n\nbibPreamble :: BibParser ()\nbibPreamble = do\n  cistring \"preamble\"\n  spaces'\n  void inBraces\n\nbibString :: BibParser ()\nbibString = do\n  cistring \"string\"\n  spaces'\n  char '{'\n  spaces'\n  (k,v) <- entField\n  char '}'\n  updateState (\\(l,m) -> (l, Map.insert k v m))\n  return ()\n\ntake1WhileP :: Monad m => (Char -> Bool) -> ParsecT Sources u m Text\ntake1WhileP f = T.pack <$> many1 (satisfy f)\n\ninBraces :: BibParser Text\ninBraces = do\n  char '{'\n  res <- manyTill\n         (  take1WhileP (\\c -> c /= '{' && c /= '}' && c /= '\\\\')\n        <|> (char '\\\\' >> T.cons '\\\\' . T.singleton <$> anyChar)\n        <|> (braced <$> inBraces)\n         ) (char '}')\n  return $ T.concat res\n\nbraced :: Text -> Text\nbraced = T.cons '{' . flip T.snoc '}'\n\ninQuotes :: BibParser Text\ninQuotes = do\n  char '\"'\n  T.concat <$> manyTill\n             ( take1WhileP (\\c -> c /= '{' && c /= '\"' && c /= '\\\\')\n               <|> (char '\\\\' >> T.cons '\\\\' . T.singleton <$> anyChar)\n               <|> braced <$> inBraces\n            ) (char '\"')\n\nfieldName :: BibParser Text\nfieldName = resolveAlias . T.toLower\n  <$> take1WhileP (\\c ->\n         isAlphaNum c || c == '-' || c == '_' || c == ':' || c == '+')\n\nisBibtexKeyChar :: Char -> Bool\nisBibtexKeyChar c =\n  isAlphaNum c || c `elem` (\".:;?!`'()$/*@_+=-[]*&\" :: [Char])\n\nspaces' :: BibParser ()\nspaces' = skipMany (void (satisfy isSpace) <|> comment)\n\nbibItem :: BibParser Item\nbibItem = do\n  char '@'\n  pos <- getPosition\n  enttype <- T.toLower <$> take1WhileP isLetter\n  spaces'\n  char '{'\n  spaces'\n  entid <- take1WhileP isBibtexKeyChar\n  spaces'\n  char ','\n  spaces'\n  entfields <- entField `sepEndBy` (char ',' >> spaces')\n  spaces'\n  char '}'\n  return $ Item entid pos enttype (Map.fromList entfields)\n\nentField :: BibParser (Text, Text)\nentField = do\n  k <- fieldName\n  spaces'\n  char '='\n  spaces'\n  vs <- (expandString <|> inQuotes <|> inBraces <|> rawWord) `sepBy`\n            try (spaces' >> char '#' >> spaces')\n  spaces'\n  return (k, T.concat vs)\n\nresolveAlias :: Text -> Text\nresolveAlias \"archiveprefix\" = \"eprinttype\"\nresolveAlias \"primaryclass\" = \"eprintclass\"\nresolveAlias s = s\n\nrawWord :: BibParser Text\nrawWord = take1WhileP isAlphaNum\n\nexpandString :: BibParser Text\nexpandString = do\n  k <- fieldName\n  (lang, strs) <- getState\n  case Map.lookup k strs of\n       Just v  -> return v\n       Nothing -> return $ resolveKey' lang k\n\ncistring :: Text -> BibParser Text\ncistring s = try (go s)\n where go t = case T.uncons t of\n         Nothing     -> return \"\"\n         Just (c,cs) -> do\n           x <- char (toLower c) <|> char (toUpper c)\n           xs <- go cs\n           return (T.cons x xs)\n\nsplitKeys :: Text -> [Text]\nsplitKeys = filter (not . T.null) . T.split (\\c -> c == ' ' || c == ',')\n\n-- Biblatex Localization Keys (see Biblatex manual)\n-- Currently we only map a subset likely to be used in Biblatex *databases*\n-- (in fields such as `type`, and via `\\bibstring{}` commands).\n\nparseMonth :: Text -> Maybe Int\nparseMonth s =\n  case T.toLower s of\n         \"jan\" -> Just 1\n         \"feb\" -> Just 2\n         \"mar\" -> Just 3\n         \"apr\" -> Just 4\n         \"may\" -> Just 5\n         \"jun\" -> Just 6\n         \"jul\" -> Just 7\n         \"aug\" -> Just 8\n         \"sep\" -> Just 9\n         \"oct\" -> Just 10\n         \"nov\" -> Just 11\n         \"dec\" -> Just 12\n         _     -> readMay (T.unpack s)\n\nnotFound :: Text -> Bib a\nnotFound f = Prelude.fail $ T.unpack f ++ \" not found\"\n\ngetField :: Text -> Bib Inlines\ngetField f = do\n  fs <- asks fields\n  case Map.lookup f fs of\n       Just x  -> latex x\n       Nothing -> notFound f\n\n\ngetPeriodicalTitle :: Text -> Bib Inlines\ngetPeriodicalTitle f = do\n  ils <- getField f\n  return $ protectCase id ils\n\nprotectCase :: (Inlines -> Inlines) -> (Inlines -> Inlines)\nprotectCase f = Walk.walk unprotect . f . Walk.walk protect\n where\n  protect (Span (\"\",[],[]) xs) = Span (\"\",[\"nocase\"],[]) xs\n  protect  x = x\n  unprotect (Span (\"\",[\"nocase\"],[]) xs)\n    | hasLowercaseWord xs = Span (\"\",[\"nocase\"],[]) xs\n    | otherwise           = Span (\"\",[],[]) xs\n  unprotect x = x\n  hasLowercaseWord = any startsWithLowercase . splitStrWhen isPunctuation\n  startsWithLowercase (Str (T.uncons -> Just (x,_))) = isLower x\n  startsWithLowercase _           = False\n\nunTitlecase :: Maybe Lang -> Inlines -> Inlines\nunTitlecase mblang = protectCase (addTextCase mblang SentenceCase)\n\ngetTitle :: Text -> Bib Inlines\ngetTitle f = do\n  ils <- getField f\n  utc <- gets untitlecase\n  lang <- gets localeLang\n  let ils' =\n        if f == \"series\"\n           then resolveKey lang ils\n           else ils\n  let processTitle = if utc then unTitlecase (Just lang) else id\n  return $ processTitle ils'\n\ngetShortTitle :: Bool -> Text -> Bib (Maybe Inlines)\ngetShortTitle requireColon f = do\n  ils <- splitStrWhen (==':') . B.toList <$> getTitle f\n  if not requireColon || containsColon ils\n     then return $ Just $ B.fromList $ upToColon ils\n     else return Nothing\n\ncontainsColon :: [Inline] -> Bool\ncontainsColon xs = Str \":\" `elem` xs\n\nupToColon :: [Inline] -> [Inline]\nupToColon xs = takeWhile (/= Str \":\") xs\n\nisNumber :: Text -> Bool\nisNumber t = case T.uncons t of\n  Just ('-', ds) -> T.all isDigit ds\n  Just _         -> T.all isDigit t\n  Nothing        -> False\n\ngetDate :: Text -> Bib Date\ngetDate f = do\n  -- the ~ can used for approx dates, but the latex reader\n  -- parses this as a nonbreaking space, so we need to convert it back!\n  let nbspToTilde '\\160' = '~'\n      nbspToTilde c      = c\n  mbd <- rawDateEDTF . T.map nbspToTilde <$> getRawField f\n  case mbd of\n    Nothing -> Prelude.fail \"expected date\"\n    Just d  -> return d\n\n-- A negative (BC) year might be written with -- or --- in bibtex:\nfixLeadingDash :: Text -> Text\nfixLeadingDash t = case T.uncons t of\n  Just (c, ds) | (c == '–' || c == '—') && firstIsDigit ds -> T.cons '–' ds\n  _ -> t\n where firstIsDigit = maybe False (isDigit . fst) . T.uncons\n\ngetOldDate :: Text -> Bib Date\ngetOldDate prefix = do\n  year' <- (readMay . T.unpack . fixLeadingDash . stringify\n              <$> getField (prefix <> \"year\")) <|> return Nothing\n  month' <- (parseMonth <$> getRawField (prefix <> \"month\"))\n            <|> return Nothing\n  day' <- (readMay . T.unpack <$> getRawField (prefix <> \"day\"))\n          <|> return Nothing\n  endyear' <- (readMay . T.unpack . fixLeadingDash . stringify\n              <$> getField (prefix <> \"endyear\")) <|> return Nothing\n  endmonth' <- (parseMonth . stringify\n                 <$> getField (prefix <> \"endmonth\")) <|> return Nothing\n  endday' <- (readMay . T.unpack . stringify <$>\n                 getField (prefix <> \"endday\")) <|> return Nothing\n  let toDateParts (y', m', d') =\n              DateParts $\n                 case y' of\n                   Nothing -> []\n                   Just y  ->\n                     case m' of\n                       Nothing -> [y]\n                       Just m  ->\n                         case d' of\n                           Nothing -> [y,m]\n                           Just d  -> [y,m,d]\n  let dateparts = filter (\\x -> x /= DateParts [])\n                  $ map toDateParts [(year',month',day'),\n                                     (endyear',endmonth',endday')]\n  literal' <- if null dateparts\n                 then Just <$> getRawField (prefix <> \"year\")\n                 else return Nothing\n  return $\n    Date { dateParts = dateparts\n         , dateCirca = False\n         , dateSeason = Nothing\n         , dateLiteral = literal' }\n\ngetRawField :: Text -> Bib Text\ngetRawField f = do\n  fs <- asks fields\n  case Map.lookup f fs of\n       Just x  -> return x\n       Nothing -> notFound f\n\ngetLiteralList :: Text -> Bib [Inlines]\ngetLiteralList f = do\n  fs <- asks fields\n  case Map.lookup f fs of\n       Just x  -> latex' x >>= toLiteralList\n       Nothing -> notFound f\n\n-- separates items with semicolons\ngetLiteralList' :: Text -> Bib Inlines\ngetLiteralList' f = do\n  fs <- asks fields\n  case Map.lookup f fs of\n    Just x    -> do\n      x' <- latex' x\n      case x' of\n        [Para xs]  ->\n          return $ B.fromList\n                 $ intercalate [Str \";\", Space]\n                 $ splitByAnd xs\n        [Plain xs] ->\n          return $ B.fromList\n                 $ intercalate [Str \";\", Space]\n                 $ splitByAnd xs\n        _          -> mzero\n    Nothing   -> notFound f\n\nsplitByAnd :: [Inline] -> [[Inline]]\nsplitByAnd = splitOn [Space, Str \"and\", Space]\n\ntoLiteralList :: [Block] -> Bib [Inlines]\ntoLiteralList [Para xs] =\n  return $ map B.fromList $ splitByAnd xs\ntoLiteralList [Plain xs] = toLiteralList [Para xs]\ntoLiteralList _ = mzero\n\nconcatWith :: Char -> [Inlines] -> Inlines\nconcatWith sep = L.foldl' go mempty\n  where go :: Inlines -> Inlines -> Inlines\n        go accum s\n          | s == mempty = accum\n          | otherwise   =\n              case Seq.viewr (B.unMany accum) of\n                     Seq.EmptyR -> s\n                     _ Seq.:> Str x\n                       | not (T.null x) &&\n                         T.last x `elem` (\"!?.,:;\" :: String)\n                                    -> accum <> B.space <> s\n                     _ -> accum <> B.str (T.singleton sep) <>\n                                                B.space <> s\n\n\nparseOptions :: Text -> [(Text, Text)]\nparseOptions = map breakOpt . T.splitOn \",\"\n  where breakOpt x = case T.break (=='=') x of\n                          (w,v) -> (T.toLower $ T.strip w,\n                                    T.toLower $ T.strip $ T.drop 1 v)\n\noptionSet :: Text -> [(Text, Text)] -> Bool\noptionSet key opts = case lookup key opts of\n                      Just \"true\" -> True\n                      Just s      -> s == mempty\n                      _           -> False\n\ngetNameList :: [(Text, Text)] -> Text -> Bib [Name]\ngetNameList opts  f = do\n  fs <- asks fields\n  case Map.lookup f fs of\n       Just x  -> latexNames nameopts x\n       Nothing -> notFound f\n where\n  nameopts = NameOpts{\n                 nameOptsPrefixIsNonDroppingParticle = optionSet \"useprefix\" opts,\n                 nameOptsUseJuniorComma = optionSet \"juniorcomma\" opts}\n\ntoNameList :: NameOpts -> [Block] -> Bib [Name]\ntoNameList opts [Para xs] =\n  filter (/= emptyName) <$> mapM (toName opts . addSpaceAfterPeriod)\n                                    (splitByAnd xs)\ntoNameList opts [Plain xs] = toNameList opts [Para xs]\ntoNameList _ _ = mzero\n\nlatexNames :: NameOpts -> Text -> Bib [Name]\nlatexNames opts t = latex' (T.strip t) >>= toNameList opts\n\n-- see issue 392 for motivation.  We want to treat\n-- \"J.G. Smith\" and \"J. G. Smith\" the same.\naddSpaceAfterPeriod :: [Inline] -> [Inline]\naddSpaceAfterPeriod = go . splitStrWhen (=='.')\n  where\n    go [] = []\n    go (Str (T.unpack -> [c]):Str \".\":Str (T.unpack -> [d]):xs)\n      | isLetter d\n      , isLetter c\n      , isUpper c\n      , isUpper d\n        = Str (T.singleton c):Str \".\":Space:go (Str (T.singleton d):xs)\n    go (x:xs) = x:go xs\n\nordinalize :: Locale -> Text -> Text\nordinalize locale n =\n  let terms = localeTerms locale\n      pad0 t = case T.length t of\n                 0 -> \"00\"\n                 1 -> \"0\" <> t\n                 _ -> t\n   in case Map.lookup (\"ordinal-\" <> pad0 n) terms <|>\n           Map.lookup \"ordinal\" terms of\n        Nothing    -> n\n        Just []    -> n\n        Just (t:_) -> n <> snd t\n\ngetTypeAndGenre :: Bib (Text, Maybe Text)\ngetTypeAndGenre = do\n  lang <- gets localeLang\n  et <- asks entryType\n  reftype' <- resolveKey' lang <$> getRawField \"type\"\n         <|> return mempty\n  st <- getRawField \"entrysubtype\" <|> return mempty\n  isEvent <- (True <$ (getRawField \"eventdate\"\n                     <|> getRawField \"eventtitle\"\n                     <|> getRawField \"venue\")) <|> return False\n  let reftype =\n        case et of\n           \"article\"\n             | st == \"magazine\"  -> \"article-magazine\"\n             | st == \"newspaper\" -> \"article-newspaper\"\n             | otherwise         -> \"article-journal\"\n           \"book\"                -> \"book\"\n           \"booklet\"             -> \"pamphlet\"\n           \"bookinbook\"          -> \"chapter\"\n           \"collection\"          -> \"book\"\n           \"dataset\"             -> \"dataset\"\n           \"electronic\"          -> \"webpage\"\n           \"inbook\"              -> \"chapter\"\n           \"incollection\"        -> \"chapter\"\n           \"inreference\"         -> \"entry-encyclopedia\"\n           \"inproceedings\"       -> \"paper-conference\"\n           \"manual\"              -> \"book\"\n           \"mastersthesis\"       -> \"thesis\"\n           \"misc\"                -> \"\"\n           \"mvbook\"              -> \"book\"\n           \"mvcollection\"        -> \"book\"\n           \"mvproceedings\"       -> \"book\"\n           \"mvreference\"         -> \"book\"\n           \"online\"              -> \"webpage\"\n           \"patent\"              -> \"patent\"\n           \"periodical\"\n             | st == \"magazine\"  -> \"article-magazine\"\n             | st == \"newspaper\" -> \"article-newspaper\"\n             | otherwise         -> \"article-journal\"\n           \"phdthesis\"           -> \"thesis\"\n           \"proceedings\"         -> \"book\"\n           \"reference\"           -> \"book\"\n           \"report\"              -> \"report\"\n           \"software\"            -> \"software\"\n           \"suppbook\"            -> \"chapter\"\n           \"suppcollection\"      -> \"chapter\"\n           \"suppperiodical\"\n             | st == \"magazine\"  -> \"article-magazine\"\n             | st == \"newspaper\" -> \"article-newspaper\"\n             | otherwise         -> \"article-journal\"\n           \"techreport\"          -> \"report\"\n           \"thesis\"              -> \"thesis\"\n           \"unpublished\"         -> if isEvent then \"speech\" else \"manuscript\"\n           \"www\"                 -> \"webpage\"\n           -- biblatex, \"unsupported\"\n           \"artwork\"             -> \"graphic\"\n           \"audio\"               -> \"song\"    -- for audio *recordings*\n           \"commentary\"          -> \"book\"\n           \"image\"               -> \"graphic\"   -- or \"figure\" ?\n           \"jurisdiction\"        -> \"legal_case\"\n           \"legislation\"         -> \"legislation\"  -- or \"bill\" ?\n           \"legal\"               -> \"treaty\"\n           \"letter\"              -> \"personal_communication\"\n           \"movie\"               -> \"motion_picture\"\n           \"music\"               -> \"song\"        -- for musical *recordings*\n           \"performance\"         -> \"speech\"\n           \"review\"              -> \"review\"      -- or \"review-book\" ?\n           \"standard\"            -> \"legislation\"\n           \"video\"               -> \"motion_picture\"\n           -- biblatex-apa:\n           \"data\"                -> \"dataset\"\n           \"letters\"             -> \"personal_communication\"\n           \"newsarticle\"         -> \"article-newspaper\"\n           _                     -> \"\"\n\n  let refgenre =\n        case et of\n          \"mastersthesis\"  -> if T.null reftype'\n                                 then Just $ resolveKey' lang \"mathesis\"\n                                 else Just reftype'\n          \"phdthesis\"      -> if T.null reftype'\n                                 then Just $ resolveKey' lang \"phdthesis\"\n                                 else Just reftype'\n          _                -> if T.null reftype'\n                                 then Nothing\n                                 else Just reftype'\n  return (reftype, refgenre)\n\n\n-- transformKey source target key\n-- derived from Appendix C of bibtex manual\ntransformKey :: Text -> Text -> Text -> [Text]\ntransformKey _ _ \"ids\"            = []\ntransformKey _ _ \"crossref\"       = []\ntransformKey _ _ \"xref\"           = []\ntransformKey _ _ \"entryset\"       = []\ntransformKey _ _ \"entrysubtype\"   = []\ntransformKey _ _ \"execute\"        = []\ntransformKey _ _ \"label\"          = []\ntransformKey _ _ \"options\"        = []\ntransformKey _ _ \"presort\"        = []\ntransformKey _ _ \"related\"        = []\ntransformKey _ _ \"relatedoptions\" = []\ntransformKey _ _ \"relatedstring\"  = []\ntransformKey _ _ \"relatedtype\"    = []\ntransformKey _ _ \"shorthand\"      = []\ntransformKey _ _ \"shorthandintro\" = []\ntransformKey _ _ \"sortkey\"        = []\ntransformKey x y \"author\"\n  | x `elem` [\"mvbook\", \"book\"] &&\n    y `elem` [\"inbook\", \"bookinbook\", \"suppbook\"] = [\"bookauthor\", \"author\"]\n-- note: this next clause is not in the biblatex manual, but it makes\n-- sense in the context of CSL conversion:\ntransformKey x y \"author\"\n  | x == \"mvbook\" && y == \"book\" = [\"bookauthor\", \"author\"]\ntransformKey \"mvbook\" y z\n  | y `elem` [\"book\", \"inbook\", \"bookinbook\", \"suppbook\"] = standardTrans z\ntransformKey x y z\n  | x `elem` [\"mvcollection\", \"mvreference\"] &&\n    y `elem` [\"collection\", \"reference\", \"incollection\", \"inreference\",\n               \"suppcollection\"] = standardTrans z\ntransformKey \"mvproceedings\" y z\n  | y `elem` [\"proceedings\", \"inproceedings\"] = standardTrans z\ntransformKey \"book\" y z\n  | y `elem` [\"inbook\", \"bookinbook\", \"suppbook\"] = bookTrans z\ntransformKey x y z\n  | x `elem` [\"collection\", \"reference\"] &&\n    y `elem` [\"incollection\", \"inreference\", \"suppcollection\"] = bookTrans z\ntransformKey \"proceedings\" \"inproceedings\" z = bookTrans z\ntransformKey \"periodical\" y z\n  | y `elem` [\"article\", \"suppperiodical\"] =\n  case z of\n       \"title\"          -> [\"journaltitle\"]\n       \"subtitle\"       -> [\"journalsubtitle\"]\n       \"shorttitle\"     -> []\n       \"sorttitle\"      -> []\n       \"indextitle\"     -> []\n       \"indexsorttitle\" -> []\n       _                -> [z]\ntransformKey _ _ x                = [x]\n\nstandardTrans :: Text -> [Text]\nstandardTrans z =\n  case z of\n       \"title\"          -> [\"maintitle\"]\n       \"subtitle\"       -> [\"mainsubtitle\"]\n       \"titleaddon\"     -> [\"maintitleaddon\"]\n       \"shorttitle\"     -> []\n       \"sorttitle\"      -> []\n       \"indextitle\"     -> []\n       \"indexsorttitle\" -> []\n       _                -> [z]\n\nbookTrans :: Text -> [Text]\nbookTrans z =\n  case z of\n       \"title\"          -> [\"booktitle\"]\n       \"subtitle\"       -> [\"booksubtitle\"]\n       \"titleaddon\"     -> [\"booktitleaddon\"]\n       \"shorttitle\"     -> []\n       \"sorttitle\"      -> []\n       \"indextitle\"     -> []\n       \"indexsorttitle\" -> []\n       _                -> [z]\n\nresolveKey :: Lang -> Inlines -> Inlines\nresolveKey lang (Many ils) = Many $ fmap go ils\n  where go (Str s) = Str $ resolveKey' lang s\n        go x       = x\n\nresolveKey' :: Lang -> Text -> Text\nresolveKey' lang k =\n  case Map.lookup (langLanguage lang) biblatexStringMap >>=\n        Map.lookup k of\n    Nothing     -> k\n    Just (x, _) -> either (const k) stringify $ parseLaTeX lang x\n\nconvertEnDash :: Inline -> Inline\nconvertEnDash (Str s) = Str (T.map (\\c -> if c == '–' then '-' else c) s)\nconvertEnDash x       = x\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/CslJson.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Citeproc.CslJson\n  ( cslJsonToReferences )\nwhere\n\nimport Citeproc.CslJson\nimport Citeproc.Types\nimport Control.Monad.Identity (runIdentity)\nimport Data.Aeson (eitherDecodeStrict', FromJSON(parseJSON), (.:), Value(..))\nimport Data.Aeson.Types (parseEither)\nimport Data.ByteString (ByteString)\nimport Text.Pandoc.Builder as B\nimport Data.Text (Text)\n\nfromCslJson :: CslJson Text -> Inlines\nfromCslJson (CslText t) = B.text t\nfromCslJson CslEmpty = mempty\nfromCslJson (CslConcat x y) = fromCslJson x <> fromCslJson y\nfromCslJson (CslQuoted x) = B.doubleQuoted (fromCslJson x)\nfromCslJson (CslItalic x) = B.emph (fromCslJson x)\nfromCslJson (CslNormal x) = fromCslJson x  -- TODO?\nfromCslJson (CslBold x) = B.strong (fromCslJson x)\nfromCslJson (CslUnderline x) = B.underline (fromCslJson x)\nfromCslJson (CslNoDecoration x) =\n  B.spanWith (\"\",[\"nodecoration\"],[]) (fromCslJson x)\nfromCslJson (CslSmallCaps x) = B.smallcaps (fromCslJson x)\nfromCslJson (CslBaseline x) = fromCslJson x\nfromCslJson (CslSub x) = B.subscript (fromCslJson x)\nfromCslJson (CslSup x) = B.superscript (fromCslJson x)\nfromCslJson (CslNoCase x) = B.spanWith (\"\",[\"nocase\"],[]) (fromCslJson x)\nfromCslJson (CslDiv t x) = B.spanWith (\"\",[\"csl-\" <> t],[]) (fromCslJson x)\nfromCslJson (CslLink u x) = B.link u \"\" (fromCslJson x)\n\ncslJsonToReferences :: ByteString -> Either String [Reference Inlines]\ncslJsonToReferences raw = do\n  items <-\n    case eitherDecodeStrict' raw of\n      Left e -> Left e\n      Right (Object o) -> parseEither (.: \"items\") o\n      Right val@(Array _) -> parseEither parseJSON val\n      Right _ -> Left \"expecting Object or Array\"\n  pure $ map (runIdentity . traverse (return . fromCslJson)) items\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/Data.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TemplateHaskell #-}\nmodule Text.Pandoc.Citeproc.Data\n  (biblatexStringMap)\nwhere\nimport Data.FileEmbed\nimport Data.ByteString (ByteString)\nimport qualified Data.Map as M\nimport qualified Data.Text.Encoding as TE\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Pandoc.Citeproc.Util (toIETF)\nimport Text.Collate.Lang (Lang(..), parseLang)\n\nbiblatexLocalizations :: [(FilePath, ByteString)]\nbiblatexLocalizations = $(embedDir \"citeproc/biblatex-localization\")\n\n-- biblatex localization keys, from files at\n-- http://github.com/plk/biblatex/tree/master/tex/latex/biblatex/lbx\nbiblatexStringMap :: M.Map Text (M.Map Text (Text, Text))\nbiblatexStringMap = foldr go mempty biblatexLocalizations\n where\n  go (fp, bs) =\n    let ls = T.lines $ TE.decodeUtf8 bs\n     in case parseLang (toIETF $ T.takeWhile (/= '.') $ T.pack fp) of\n          Right lang | length ls > 4\n            -> M.insert (langLanguage lang)\n                        (toStringMap $ map (T.splitOn \"|\") ls)\n          _ -> id\n  toStringMap = foldr go' mempty\n  go' [term, x, y] = M.insert term (x, y)\n  go' _ = id\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/Locator.hs",
    "content": "{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE ViewPatterns #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Citeproc.Locator\n  ( parseLocator\n  , toLocatorMap\n  , LocatorInfo(..)\n  , LocatorMap(..) )\nwhere\nimport Citeproc.Types\nimport Text.Pandoc.Citeproc.Util (splitStrWhen)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.List as L\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Shared (stringify)\nimport Control.Monad (mzero)\nimport qualified Data.Map as M\nimport Data.Char (isSpace, isPunctuation, isDigit)\n\n\ndata LocatorInfo =\n  LocatorInfo{ locatorRaw :: Text\n             , locatorLabel :: Text\n             , locatorLoc :: Text\n             }\n  deriving (Show)\n\nparseLocator :: LocatorMap -> [Inline] -> (Maybe LocatorInfo, [Inline])\nparseLocator locmap inp =\n  case parse (pLocatorWords locmap) \"suffix\" $ splitInp inp of\n       Right r -> r\n       Left _  -> (Nothing, maybeAddComma inp)\n\nsplitInp :: [Inline] -> [Inline]\nsplitInp = splitStrWhen (\\c -> isSpace c || (isPunctuation c && c /= ':'))\n\n--\n-- Locator parsing\n--\n\ntype LocatorParser = Parsec [Inline] ()\n\npLocatorWords :: LocatorMap\n              -> LocatorParser (Maybe LocatorInfo, [Inline])\npLocatorWords locMap = do\n  optional $ pMatchChar \",\" (== ',')\n  optional pSpace\n  info <- pLocatorDelimited locMap <|> pLocatorIntegrated locMap\n  s <- getInput -- rest is suffix\n  return $\n    if T.null (locatorLabel info) && T.null (locatorLoc info)\n       then (Nothing, maybeAddComma s)\n       else (Just info, s)\n\nmaybeAddComma :: [Inline] -> [Inline]\nmaybeAddComma [] = []\nmaybeAddComma ils@(Space : _) = ils\nmaybeAddComma ils@(Str t : _)\n  | Just (c, _) <- T.uncons t\n  , isPunctuation c = ils\nmaybeAddComma ils = Str \",\" : Space : ils\n\npLocatorDelimited :: LocatorMap -> LocatorParser LocatorInfo\npLocatorDelimited locMap = try $ do\n  _ <- pMatchChar \"{\" (== '{')\n  skipMany pSpace -- gobble pre-spaces so label doesn't try to include them\n  (rawlab, la, _) <- pLocatorLabelDelimited locMap\n  -- we only care about balancing {} and [] (because of the outer [] scope);\n  -- the rest can be anything\n  let inner = do { t <- anyToken; return (True, cslJsonify t) }\n  gs <- many (pBalancedBraces [('{','}'), ('[',']')] inner)\n  _ <- pMatchChar \"}\" (== '}')\n  let lo = mconcat $ map snd gs\n  return $ LocatorInfo{ locatorLoc = lo,\n                        locatorLabel = la,\n                        locatorRaw = rawlab <> \"{\" <> lo <> \"}\" }\n\n-- a variant of stringify that preserves formatting using CSL JSON\n-- conventions\ncslJsonify :: Inline -> Text\ncslJsonify = go\n  where goMany :: [Inline] -> T.Text\n        goMany = mconcat . map go\n        go :: Inline -> T.Text\n        go (Str t) = t\n        go Space = \" \"\n        go SoftBreak = \" \"\n        go LineBreak = \" \"\n        go (Emph ils) = \"<i>\" <> goMany ils <> \"</i>\"\n        go (Underline ils) = \"<u>\" <> goMany ils <> \"</u>\"\n        go (Strong ils) = \"<b>\" <> goMany ils <> \"</b>\"\n        go (Strikeout ils) = goMany ils\n        go (Superscript ils) = \"<sup>\" <> goMany ils <> \"</sup>\"\n        go (Subscript ils) = \"<sub>\" <> goMany ils <> \"</sub>\"\n        go (SmallCaps ils) = \"<span style=\\\"font-variant:small-caps;\\\">\" <>\n                              goMany ils <> \"</span>\"\n        go (Quoted SingleQuote ils) = \"'\" <> goMany ils <> \"'\"\n        go (Quoted DoubleQuote ils) = \"\\\"\" <> goMany ils <> \"\\\"\"\n        go (Cite _ ils) = goMany ils\n        go (Code _ t) = t\n        go (Math _ t) = t\n        go (RawInline _ _) = \"\"\n        go (Link _ ils _) = goMany ils\n        go (Image _ ils _) = goMany ils\n        go (Note _) = \"\"\n        go (Span (_,cls@(_:_),_) ils) =\n          \"<span class=\\\"\" <> T.unwords cls <> \"\\\">\" <> goMany ils <> \"</span>\"\n        go (Span (_,[],[(\"style\",\"baseline\")]) ils) =\n          \"<span style=\\\"baseline\\\">\" <> goMany ils <> \"</span>\"\n        go (Span _ ils) = goMany ils\n\npLocatorLabelDelimited :: LocatorMap -> LocatorParser (Text, Text, Bool)\npLocatorLabelDelimited locMap\n  = pLocatorLabel' locMap (stringify <$> anyToken)\n      <|> ((\"\", \"page\", True) <$ lookAhead (pMatchChar \"digit\" isDigit))\n      <|> (pure (\"\", \"\", True))\n\npLocatorIntegrated :: LocatorMap -> LocatorParser LocatorInfo\npLocatorIntegrated locMap = try $ do\n  (rawlab, la, wasImplicit) <- pLocatorLabelIntegrated locMap\n  -- if we got the label implicitly, we have presupposed the first one is\n  -- going to have a digit, so guarantee that. You _can_ have p. (a)\n  -- because you specified it.\n  let modifier = if wasImplicit\n                    then requireDigits\n                    else requireRomansOrDigits\n  g <- try $ pLocatorWordIntegrated (not wasImplicit) >>= modifier\n  gs <- many (try $ pLocatorWordIntegrated False >>= modifier)\n  let lo = T.concat (g:gs)\n  return $ LocatorInfo{ locatorLabel = la,\n                        locatorLoc = lo,\n                        locatorRaw = rawlab <> lo }\n\npLocatorLabelIntegrated :: LocatorMap -> LocatorParser (Text, Text, Bool)\npLocatorLabelIntegrated locMap\n  = pLocatorLabel' locMap lim <|>\n     (lookAhead digital >> return (\"\", \"page\", True))\n    where\n      lim = try $ pLocatorWordIntegrated True >>= requireRomansOrDigits\n      digital = try $ pLocatorWordIntegrated True >>= requireDigits\n\npLocatorLabel' :: LocatorMap -> LocatorParser Text\n               -> LocatorParser (Text, Text, Bool)\npLocatorLabel' locMap lim = go \"\"\n    where\n      -- grow the match string until we hit the end\n      -- trying to find the largest match for a label\n      go acc = try $ do\n          -- advance at least one token each time\n          -- the pathological case is \"p.3\"\n          t <- anyToken\n          ts <- manyTill anyToken (try $ lookAhead lim)\n          let s = acc <> stringify (t:ts)\n          case M.lookup (T.toCaseFold $ T.strip s) (unLocatorMap locMap) of\n            -- try to find a longer one, or return this one\n            Just l -> go s <|> return (s, l, False)\n            Nothing -> go s\n\n-- hard requirement for a locator to have some real digits in it\nrequireDigits :: (Bool, Text) -> LocatorParser Text\nrequireDigits (_, s) = if not (T.any isDigit s)\n                          then Prelude.fail \"requireDigits\"\n                          else return s\n\n-- soft requirement for a sequence with some roman or arabic parts\n-- (a)(iv) -- because iv is roman\n-- 1(a)  -- because 1 is an actual digit\n-- NOT: a, (a)-(b), hello, (some text in brackets)\nrequireRomansOrDigits :: (Bool, Text) -> LocatorParser Text\nrequireRomansOrDigits (d, s) = if not d\n                                  then Prelude.fail \"requireRomansOrDigits\"\n                                  else return s\n\npLocatorWordIntegrated :: Bool -> LocatorParser (Bool, Text)\npLocatorWordIntegrated isFirst = try $ do\n  punct <- if isFirst\n              then return \"\"\n              else (stringify <$> pLocatorSep) <|> return \"\"\n  sp <- option \"\" (pSpace >> return \" \")\n  (dig, s) <- pBalancedBraces [('(',')'), ('[',']'), ('{','}')] pPageSeq\n  return (dig, punct <> sp <> s)\n\n-- we want to capture:  123, 123A, C22, XVII, 33-44, 22-33; 22-11\n--                      34(1), 34A(A), 34(1)(i)(i), (1)(a)\n--                      [17], [17]-[18], '591 [84]'\n--                      (because CSL cannot pull out individual pages/sections\n--                      to wrap in braces on a per-style basis)\npBalancedBraces :: [(Char, Char)]\n                -> LocatorParser (Bool, Text)\n                -> LocatorParser (Bool, Text)\npBalancedBraces braces p = try $ do\n  ss <- many1 surround\n  return $ anyWereDigitLike ss\n  where\n      except = notFollowedBy pBraces >> p\n      -- outer and inner\n      surround = L.foldl' (\\a (open, close) -> sur open close except <|> a)\n                       except\n                       braces\n\n      isc c = stringify <$> pMatchChar [c] (== c)\n\n      sur c c' m = try $ do\n          (d, mid) <- isc c *> option (False, \"\") m <* isc c'\n          return (d, T.cons c . flip T.snoc c' $  mid)\n\n      flattened = concatMap (\\(o, c) -> [o, c]) braces\n      pBraces = pMatchChar \"braces\" (`elem` flattened)\n\n\n-- YES 1, 1.2, 1.2.3\n-- NO  1., 1.2. a.6\n-- can't use sepBy because we want to leave trailing .s\npPageSeq :: LocatorParser (Bool, Text)\npPageSeq = oneDotTwo <|> withPeriod\n  where\n      oneDotTwo = do\n          u <- pPageUnit\n          us <- many withPeriod\n          return $ anyWereDigitLike (u:us)\n      withPeriod = try $ do\n          -- .2\n          p <- pMatchChar \".\" (== '.')\n          u <- try pPageUnit\n          return (fst u, stringify p <> snd u)\n\nanyWereDigitLike :: [(Bool, Text)] -> (Bool, Text)\nanyWereDigitLike as = (any fst as, T.concat $ map snd as)\n\npPageUnit :: LocatorParser (Bool, Text)\npPageUnit = roman <|> plainUnit\n  where\n      -- roman is a 'digit'\n      roman = (True,) <$> pRoman\n      plainUnit = do\n          ts <- many1 (notFollowedBy pSpace >>\n                       notFollowedBy pLocatorPunct >>\n                       notFollowedBy pMath >>\n                       anyToken)\n          let s = stringify ts\n          -- otherwise look for actual digits or -s\n          return (T.any isDigit s, s)\n\npRoman :: LocatorParser Text\npRoman = try $ do\n  tok <- anyToken\n  case tok of\n       Str t -> case parse (romanNumeral True *> eof)\n                   \"roman numeral\" (T.toUpper t) of\n                      Left _    -> mzero\n                      Right ()  -> return t\n       _      -> mzero\n\npLocatorPunct :: LocatorParser Inline\npLocatorPunct = pMatchChar \"punctuation\" isLocatorPunct\n\npLocatorSep :: LocatorParser Inline\npLocatorSep = pMatchChar \"locator separator\" isLocatorSep\n\npMatchChar :: String -> (Char -> Bool) -> LocatorParser Inline\npMatchChar msg f = satisfyTok f' <?> msg\n    where\n        f' (Str (T.unpack -> [c])) = f c\n        f' _                       = False\n\npSpace :: LocatorParser Inline\npSpace = satisfyTok (\\t -> isSpacey t || t == Str \"\\160\") <?> \"space\"\n\npMath :: LocatorParser Inline\npMath = satisfyTok isMath\n where\n  isMath (Math{}) = True\n  isMath _ = False\n\nsatisfyTok :: (Inline -> Bool) -> LocatorParser Inline\nsatisfyTok f = tokenPrim show (\\sp _ _ -> sp) (\\tok -> if f tok\n                                                          then Just tok\n                                                          else Nothing)\n\nisSpacey :: Inline -> Bool\nisSpacey Space     = True\nisSpacey SoftBreak = True\nisSpacey _         = False\n\nisLocatorPunct :: Char -> Bool\nisLocatorPunct '-' = False -- page range\nisLocatorPunct '–' = False -- page range, en dash\nisLocatorPunct ':' = False -- vol:page-range hack\nisLocatorPunct c   = isPunctuation c -- includes [{()}]\n\nisLocatorSep :: Char -> Bool\nisLocatorSep ',' = True\nisLocatorSep ';' = True\nisLocatorSep _   = False\n\n--\n-- Locator Map\n--\n\nnewtype LocatorMap = LocatorMap { unLocatorMap :: M.Map Text Text }\n  deriving (Show)\n\ntoLocatorMap :: Locale -> LocatorMap\ntoLocatorMap locale =\n  LocatorMap $ foldr go mempty locatorTerms\n where\n  go tname locmap =\n    case M.lookup tname (localeTerms locale) of\n      Nothing -> locmap\n      Just ts -> foldr (\\x -> M.insert (T.toCaseFold $ snd x) tname) locmap ts\n-- we store keys in \"case-folded\" (lowercase) form, so that both\n-- \"Chap.\" and \"chap.\" will match, for example.\n\nlocatorTerms :: [Text]\nlocatorTerms =\n  [ \"book\"\n  , \"chapter\"\n  , \"column\"\n  , \"figure\"\n  , \"folio\"\n  , \"issue\"\n  , \"line\"\n  , \"note\"\n  , \"opus\"\n  , \"page\"\n  , \"number-of-pages\"\n  , \"paragraph\"\n  , \"part\"\n  , \"section\"\n  , \"sub-verbo\"\n  , \"verse\"\n  , \"volume\" ]\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/MetaValue.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Citeproc.MetaValue\n  ( referenceToMetaValue\n  , metaValueToReference\n  , metaValueToText\n  )\nwhere\n\nimport Citeproc.Types\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Shared (stringify, blocksToInlines')\nimport Data.Maybe\nimport Safe\nimport qualified Data.Set as Set\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Printf (printf)\nimport Control.Applicative ((<|>))\n\nmetaValueToText :: MetaValue -> Maybe Text\nmetaValueToText (MetaString t) = Just t\nmetaValueToText (MetaInlines ils) = Just $ stringify ils\nmetaValueToText (MetaBlocks bls) = Just $ stringify bls\nmetaValueToText (MetaList xs) = T.unwords <$> mapM metaValueToText xs\nmetaValueToText _ = Nothing\n\nmetaValueToBool :: MetaValue -> Maybe Bool\nmetaValueToBool (MetaBool b) = Just b\nmetaValueToBool (MetaString \"true\") = Just True\nmetaValueToBool (MetaString \"false\") = Just False\nmetaValueToBool (MetaInlines ils) =\n  metaValueToBool (MetaString (stringify ils))\nmetaValueToBool _ = Nothing\n\nreferenceToMetaValue :: Reference Inlines -> MetaValue\nreferenceToMetaValue ref =\n  let ItemId id' = referenceId ref\n      type' = referenceType ref\n   in MetaMap $ M.insert \"id\" (MetaString id')\n              $ M.insert \"type\" (MetaString type')\n              $ M.map valToMetaValue\n              $ M.mapKeys fromVariable\n              $ referenceVariables ref\n\n\nvalToMetaValue :: Val Inlines -> MetaValue\nvalToMetaValue (TextVal t) = MetaString t\nvalToMetaValue (FancyVal ils) = MetaInlines (B.toList ils)\nvalToMetaValue (NumVal n) = MetaString (T.pack $ show n)\nvalToMetaValue (NamesVal ns) = MetaList $ map nameToMetaValue ns\nvalToMetaValue (DateVal d) = dateToMetaValue d\nvalToMetaValue _ = MetaString mempty\n\nnameToMetaValue :: Name -> MetaValue\nnameToMetaValue name =\n  MetaMap $\n    (maybe id (M.insert \"family\" . MetaString) (nameFamily name)) .\n    (maybe id (M.insert \"given\" . MetaString) (nameGiven name)) .\n    (maybe id (M.insert \"dropping-particle\" . MetaString)\n       (nameDroppingParticle name)) .\n    (maybe id (M.insert \"non-dropping-particle\" . MetaString)\n       (nameNonDroppingParticle name)) .\n    (maybe id (M.insert \"suffix\" . MetaString) (nameSuffix name)) .\n    (maybe id (M.insert \"literal\" . MetaString) (nameLiteral name)) .\n    (if nameCommaSuffix name\n        then M.insert \"comma-suffix\" (MetaBool True)\n        else id) .\n    (if nameStaticOrdering name\n        then M.insert \"static-ordering\" (MetaBool True)\n        else id)\n    $ mempty\n\ndateToMetaValue :: Date -> MetaValue\ndateToMetaValue date =\n  MetaString $\n    (case dateLiteral date of\n       Just l  -> l\n       Nothing -> T.intercalate \"/\" $ map datePartsToEDTF $ dateParts date)\n    <> (if dateCirca date then \"~\" else \"\")\n where\n  datePartsToEDTF (DateParts dps) =\n    T.pack $\n     (case dps of\n        (y:_) | y > 9999 || y < -10000 -> ('y':)\n        _ -> id) $\n    case dps of\n      (y:m:d:_)\n       | y < -1     -> printf \"%05d-%02d-%02d\" (y+1) m d\n       | otherwise  -> printf \"%04d-%02d-%02d\" y m d\n      (y:m:[])\n       | y < -1     -> printf \"%05d-%02d\" (y+1) m\n       | otherwise  -> printf \"%04d-%02d\" y m\n      (y:[])\n       | y == 0     -> printf \"\" -- used for open range\n       | y < -1     -> printf \"%05d\" (y+1)\n       | otherwise  -> printf \"%04d\" y\n      _             -> mempty\n\nmetaValueToReference :: MetaValue\n                     -> Maybe (Reference Inlines)\nmetaValueToReference (MetaMap m) = do\n  let m' = M.mapKeys normalizeKey m\n  id' <- M.lookup \"id\" m' >>= metaValueToText\n  type' <- (M.lookup \"type\" m' >>= metaValueToText) <|> pure \"\"\n  let m'' = M.delete \"id\" $ M.delete \"type\" m'\n  let vars = M.mapKeys toVariable $ M.mapWithKey metaValueToVal m''\n  return $ Reference { referenceId = ItemId id'\n                     , referenceType = type'\n                     , referenceDisambiguation = Nothing\n                     , referenceVariables = vars }\nmetaValueToReference _ = Nothing\n\nmetaValueToVal :: Text -> MetaValue -> Val Inlines\nmetaValueToVal k v\n  | k `Set.member` dateVariables\n       = DateVal $ metaValueToDate v\n  | k `Set.member` nameVariables\n       = NamesVal $ metaValueToNames v\n  | k == \"other-ids\"\n       = TextVal $ fromMaybe mempty $ metaValueToText v\n         -- will create space-separated list\n  | otherwise =\n    case v of\n      MetaString t -> TextVal t\n      MetaInlines ils -> FancyVal (B.fromList ils)\n      MetaBlocks bs   -> FancyVal (blocksToInlines' bs)\n      MetaBool b   -> TextVal (if b then \"true\" else \"false\")\n      MetaList _   -> TextVal mempty\n      MetaMap  _   -> TextVal mempty\n\nmetaValueToDate :: MetaValue -> Date\nmetaValueToDate (MetaMap m) = fromMaybe\n  (Date\n   { dateParts = dateparts\n   , dateCirca = circa\n   , dateSeason = season\n   , dateLiteral = literal })\n  rawdate\n where\n  dateparts = case M.lookup \"date-parts\" m of\n                Just (MetaList xs) ->\n                  mapMaybe metaValueToDateParts xs\n                Just _ -> []\n                Nothing ->\n                  maybeToList $ metaValueToDateParts (MetaMap m)\n  circa = fromMaybe False $\n            M.lookup \"circa\" m >>= metaValueToBool\n  season = M.lookup \"season\" m >>= metaValueToInt\n  literal = M.lookup \"literal\" m >>= metaValueToText\n  rawdate = M.lookup \"raw\" m >>= metaValueToText >>= rawDateEDTF\nmetaValueToDate (MetaList xs) =\n  Date{ dateParts = mapMaybe metaValueToDateParts xs\n      , dateCirca = False\n      , dateSeason = Nothing\n      , dateLiteral = Nothing }\nmetaValueToDate x =\n  fromMaybe emptyDate $ metaValueToText x >>= rawDateEDTF\n\n\nmetaValueToInt :: MetaValue -> Maybe Int\nmetaValueToInt x = metaValueToText x >>= readMay . T.unpack\n\nmetaValueToDateParts :: MetaValue -> Maybe DateParts\nmetaValueToDateParts (MetaList xs) =\n  Just $ DateParts $ map (fromMaybe 0 . metaValueToInt) xs\nmetaValueToDateParts (MetaMap m) =\n  case (M.lookup \"year\" m >>= metaValueToInt,\n        ((M.lookup \"month\" m >>= metaValueToInt)\n          <|>\n        ((+ 20) <$> (M.lookup \"season\" m >>= metaValueToInt))),\n        M.lookup \"day\" m >>= metaValueToInt) of\n    (Just y, Just mo, Just d)  -> Just $ DateParts [y, mo, d]\n    (Just y, Just mo, Nothing) -> Just $ DateParts [y, mo]\n    (Just y, Nothing, _)       -> Just $ DateParts [y]\n    _                          -> Nothing\nmetaValueToDateParts _ = Nothing\n\nemptyDate :: Date\nemptyDate = Date { dateParts = []\n                 , dateCirca = False\n                 , dateSeason = Nothing\n                 , dateLiteral = Nothing }\n\nmetaValueToNames :: MetaValue -> [Name]\nmetaValueToNames (MetaList xs) = mapMaybe metaValueToName xs\nmetaValueToNames x = maybeToList $ metaValueToName x\n\nmetaValueToName :: MetaValue -> Maybe Name\nmetaValueToName (MetaMap m) = extractParticles <$>\n  Just Name\n    { nameFamily = family\n    , nameGiven = given\n    , nameDroppingParticle = dropping\n    , nameNonDroppingParticle = nondropping\n    , nameSuffix = suffix\n    , nameCommaSuffix = commasuffix\n    , nameStaticOrdering = staticordering\n    , nameLiteral = literal\n    }\n where\n  family = M.lookup \"family\" m >>= metaValueToText\n  given  = M.lookup \"given\" m >>= metaValueToText\n  dropping = M.lookup \"dropping-particle\" m\n                >>= metaValueToText\n  nondropping = M.lookup \"non-dropping-particle\" m\n                >>= metaValueToText\n  suffix = M.lookup \"suffix\" m >>= metaValueToText\n  commasuffix = fromMaybe False $\n    M.lookup \"comma-suffix\" m >>= metaValueToBool\n  staticordering = fromMaybe False $\n    M.lookup \"static-ordering\" m >>= metaValueToBool\n  literal = M.lookup \"literal\" m >>= metaValueToText\nmetaValueToName x = extractParticles <$>\n  case metaValueToText x of\n    Nothing -> Nothing\n    Just lit -> Just Name\n                     { nameFamily = Nothing\n                     , nameGiven = Nothing\n                     , nameDroppingParticle = Nothing\n                     , nameNonDroppingParticle = Nothing\n                     , nameSuffix = Nothing\n                     , nameCommaSuffix = False\n                     , nameStaticOrdering = False\n                     , nameLiteral = Just lit }\n\ndateVariables :: Set.Set Text\ndateVariables = Set.fromList\n  [ \"accessed\", \"container\", \"event-date\", \"issued\",\n    \"original-date\", \"submitted\" ]\n\nnameVariables :: Set.Set Text\nnameVariables = Set.fromList\n  [ \"author\", \"collection-editor\", \"composer\",\n    \"container-author\", \"director\", \"editor\",\n    \"editorial-director\", \"illustrator\",\n    \"interviewer\", \"original-author\",\n    \"recipient\", \"reviewed-author\",\n    \"translator\" ]\n\nnormalizeKey :: Text -> Text\nnormalizeKey k =\n  case T.toLower k of\n    \"doi\"   -> \"DOI\"\n    \"isbn\"  -> \"ISBN\"\n    \"issn\"  -> \"ISSN\"\n    \"pmcid\" -> \"PMCID\"\n    \"pmid\"  -> \"PMID\"\n    \"url\"   -> \"URL\"\n    x       -> x\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/Name.hs",
    "content": "{-# LANGUAGE ViewPatterns      #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}\n-----------------------------------------------------------------------------\n-- |\n-- Module      :  Text.CSL.Input.Name\n-- Copyright   :  (c) John MacFarlane\n-- License     :  BSD-style (see LICENSE)\n--\n-- Maintainer  :  John MacFarlane <fiddlosopher@gmail.com>\n-- Stability   :  unstable\n-- Portability :  portable\n--\n-----------------------------------------------------------------------------\n\nmodule Text.Pandoc.Citeproc.Name\n    ( toName\n    , NameOpts(..)\n    , emptyName\n    )\n    where\n\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Shared (stringify)\nimport Citeproc.Types\nimport Citeproc.Pandoc ()\nimport Text.Pandoc.Citeproc.Util (splitStrWhen)\nimport qualified Data.Text              as T\nimport           Data.List.Split        (splitWhen, wordsBy)\nimport Data.Char (isUpper, isDigit)\nimport qualified Data.List as L\n\nemptyName :: Name\nemptyName =\n    Name {  nameFamily              = Nothing\n          , nameGiven               = Nothing\n          , nameDroppingParticle    = Nothing\n          , nameNonDroppingParticle = Nothing\n          , nameSuffix              = Nothing\n          , nameLiteral             = Nothing\n          , nameCommaSuffix         = False\n          , nameStaticOrdering      = False\n          }\n\n-- | Options for 'toName'.\ndata NameOpts =\n  NameOpts\n    { nameOptsPrefixIsNonDroppingParticle :: Bool\n        -- ^ Treat a prefix on the last name as a non-dropping particle\n        -- (default is to treat it as a dropping particle). This corresponds\n        -- to the biblatex option @useprefix@.\n    , nameOptsUseJuniorComma              :: Bool\n        -- ^ Put a comma before a suffix like \"Jr.\" This corresponds to the\n        -- biblatex option @juniorcomma@.\n    } deriving (Show)\n\n-- | Parse a list of 'Inline's into a citeproc 'Name', identifying\n-- first and last name, particles, suffixes.\ntoName :: Monad m => NameOpts -> [Inline] -> m Name\ntoName _ [Str \"others\"] =\n  return emptyName{ nameLiteral = Just \"others\" }\ntoName _ [Span (\"\",[],[]) ils] = -- corporate author\n  return emptyName{ nameLiteral = Just $ stringify ils }\n-- extended BibLaTeX name format - see #266\ntoName _ ils@(Str ys:_) | T.any (== '=') ys = do\n  let commaParts = splitWhen (== Str \",\")\n                   . splitStrWhen (\\c -> c == ',' || c == '=' || c == '\\160')\n                   $ ils\n  let addPart ag (Str \"given\" : Str \"=\" : xs) =\n        ag{ nameGiven = case nameGiven ag of\n                          Nothing -> Just $ stringify xs\n                          Just t  -> Just $ t <> \" \" <> stringify xs }\n      addPart ag (Str \"family\" : Str \"=\" : xs) =\n        ag{ nameFamily = Just $ stringify xs }\n      addPart ag (Str \"prefix\" : Str \"=\" : xs) =\n        ag{ nameDroppingParticle =  Just $ stringify xs }\n      addPart ag (Str \"useprefix\" : Str \"=\" : Str \"true\" : _) =\n        ag{ nameNonDroppingParticle = nameDroppingParticle ag\n          , nameDroppingParticle    = Nothing }\n      addPart ag (Str \"suffix\" : Str \"=\" : xs) =\n        ag{ nameSuffix = Just $ stringify xs }\n      addPart ag (Space : xs) = addPart ag xs\n      addPart ag _ = ag\n  return $ L.foldl' addPart emptyName commaParts\n-- First von Last\n-- von Last, First\n-- von Last, Jr ,First\n-- NOTE: biblatex and bibtex differ on:\n-- Drummond de Andrade, Carlos\n-- bibtex takes \"Drummond de\" as the von;\n-- biblatex takes the whole as a last name.\n-- See https://github.com/plk/biblatex/issues/236\n-- Here we implement the more sensible biblatex behavior.\ntoName opts ils = do\n  let words' = wordsBy (\\x -> x == Space || x == Str \"\\160\")\n  let commaParts = map words' $ splitWhen (== Str \",\")\n                              $ splitStrWhen\n                                   (\\c -> c == ',' || c == '\\160') ils\n  let (first, vonlast, jr) =\n          case commaParts of\n               --- First is the longest sequence of white-space separated\n               -- words starting with an uppercase and that is not the\n               -- whole string. von is the longest sequence of whitespace\n               -- separated words whose last word starts with lower case\n               -- and that is not the whole string.\n               [fvl]      -> let (caps', rest') = span isCapitalized fvl\n                             in  if null rest' && not (null caps')\n                                 then (init caps', [last caps'], [])\n                                 else (caps', rest', [])\n               [vl,f]     -> (f, vl, [])\n               (vl:j:f:_) -> (f, vl, j )\n               []         -> ([], [], [])\n\n  let (von, lastname) =\n                 case break isCapitalized vonlast of\n                        (vs@(_:_), []) -> (init vs, [last vs])\n                        (vs, ws)       -> (vs, ws)\n  let prefix = T.unwords $ map stringify von\n  let family = T.unwords $ map stringify lastname\n  let suffix = T.unwords $ map stringify jr\n  let given = T.unwords $ map stringify first\n  return\n    Name {  nameFamily              = if T.null family\n                                         then Nothing\n                                         else Just family\n          , nameGiven               = if T.null given\n                                         then Nothing\n                                         else Just given\n          , nameDroppingParticle    = if nameOptsPrefixIsNonDroppingParticle opts ||\n                                          T.null prefix\n                                         then Nothing\n                                         else Just prefix\n          , nameNonDroppingParticle = if nameOptsPrefixIsNonDroppingParticle opts &&\n                                          not (T.null prefix)\n                                         then Just prefix\n                                         else Nothing\n          , nameSuffix              = if T.null suffix\n                                         then Nothing\n                                         else Just suffix\n          , nameLiteral             = Nothing\n          , nameCommaSuffix         = nameOptsUseJuniorComma opts\n          , nameStaticOrdering      = False\n          }\n\nisCapitalized :: [Inline] -> Bool\nisCapitalized (Str (T.uncons -> Just (c,cs)) : rest)\n  | isUpper c = True\n  | isDigit c = isCapitalized (Str cs : rest)\n  | otherwise = False\nisCapitalized (_:rest) = isCapitalized rest\nisCapitalized [] = True\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc/Util.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Citeproc.Util\n ( splitStrWhen\n , toIETF )\nwhere\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Pandoc.Definition\n\n-- Split Str elements so that characters satisfying the\n-- predicate each have their own Str.\nsplitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline]\nsplitStrWhen p = foldr go []\n where\n  go (Str t) = (map Str (T.groupBy goesTogether t) ++)\n  go x = (x :)\n  goesTogether c d   = not (p c || p d)\n\ntoIETF :: Text -> Text\ntoIETF \"english\"         = \"en-US\" -- \"en-EN\" unavailable in CSL\ntoIETF \"usenglish\"       = \"en-US\"\ntoIETF \"american\"        = \"en-US\"\ntoIETF \"british\"         = \"en-GB\"\ntoIETF \"ukenglish\"       = \"en-GB\"\ntoIETF \"canadian\"        = \"en-US\" -- \"en-CA\" unavailable in CSL\ntoIETF \"australian\"      = \"en-GB\" -- \"en-AU\" unavailable in CSL\ntoIETF \"newzealand\"      = \"en-GB\" -- \"en-NZ\" unavailable in CSL\ntoIETF \"afrikaans\"       = \"af-ZA\"\ntoIETF \"arabic\"          = \"ar\"\ntoIETF \"basque\"          = \"eu\"\ntoIETF \"bulgarian\"       = \"bg-BG\"\ntoIETF \"catalan\"         = \"ca-AD\"\ntoIETF \"croatian\"        = \"hr-HR\"\ntoIETF \"czech\"           = \"cs-CZ\"\ntoIETF \"danish\"          = \"da-DK\"\ntoIETF \"dutch\"           = \"nl-NL\"\ntoIETF \"estonian\"        = \"et-EE\"\ntoIETF \"finnish\"         = \"fi-FI\"\ntoIETF \"canadien\"        = \"fr-CA\"\ntoIETF \"acadian\"         = \"fr-CA\"\ntoIETF \"french\"          = \"fr-FR\"\ntoIETF \"francais\"        = \"fr-FR\"\ntoIETF \"austrian\"        = \"de-AT\"\ntoIETF \"naustrian\"       = \"de-AT\"\ntoIETF \"german\"          = \"de-DE\"\ntoIETF \"germanb\"         = \"de-DE\"\ntoIETF \"ngerman\"         = \"de-DE\"\ntoIETF \"greek\"           = \"el-GR\"\ntoIETF \"polutonikogreek\" = \"el-GR\"\ntoIETF \"polytonicgreek\"  = \"el-GR\"\ntoIETF \"hebrew\"          = \"he-IL\"\ntoIETF \"hungarian\"       = \"hu-HU\"\ntoIETF \"icelandic\"       = \"is-IS\"\ntoIETF \"italian\"         = \"it-IT\"\ntoIETF \"japanese\"        = \"ja-JP\"\ntoIETF \"latvian\"         = \"lv-LV\"\ntoIETF \"lithuanian\"      = \"lt-LT\"\ntoIETF \"magyar\"          = \"hu-HU\"\ntoIETF \"mongolian\"       = \"mn-MN\"\ntoIETF \"norsk\"           = \"nb-NO\"\ntoIETF \"nynorsk\"         = \"nn-NO\"\ntoIETF \"farsi\"           = \"fa-IR\"\ntoIETF \"polish\"          = \"pl-PL\"\ntoIETF \"brazil\"          = \"pt-BR\"\ntoIETF \"brazilian\"       = \"pt-BR\"\ntoIETF \"portugues\"       = \"pt-PT\"\ntoIETF \"portuguese\"      = \"pt-PT\"\ntoIETF \"romanian\"        = \"ro-RO\"\ntoIETF \"russian\"         = \"ru-RU\"\ntoIETF \"serbian\"         = \"sr-RS\"\ntoIETF \"serbianc\"        = \"sr-RS\"\ntoIETF \"slovak\"          = \"sk-SK\"\ntoIETF \"slovene\"         = \"sl-SL\"\ntoIETF \"spanish\"         = \"es-ES\"\ntoIETF \"swedish\"         = \"sv-SE\"\ntoIETF \"thai\"            = \"th-TH\"\ntoIETF \"turkish\"         = \"tr-TR\"\ntoIETF \"ukrainian\"       = \"uk-UA\"\ntoIETF \"vietnamese\"      = \"vi-VN\"\ntoIETF \"latin\"           = \"la\"\ntoIETF x                 = x\n"
  },
  {
    "path": "src/Text/Pandoc/Citeproc.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE StrictData #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Citeproc\n  ( processCitations,\n    getReferences,\n  )\nwhere\n\nimport Citeproc\nimport Citeproc.Pandoc ()\nimport Text.Pandoc.Citeproc.Locator (parseLocator, toLocatorMap,\n                                     LocatorInfo(..))\nimport Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)\nimport Text.Pandoc.Citeproc.BibTeX (readBibtexString, Variant(..))\nimport Text.Pandoc.MIME (MimeType)\nimport Text.Pandoc.Readers.RIS (readRIS)\nimport Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText)\nimport Text.Pandoc.Readers.Markdown (yamlToRefs)\nimport Text.Pandoc.Builder (Inlines, Many(..), deleteMeta, setMeta)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Definition as Pandoc\nimport Text.Pandoc.Class (PandocMonad(..), getResourcePath, getUserDataDir,\n                          fetchItem, report, setResourcePath, toTextM)\nimport Text.Pandoc.Data (readDataFile)\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Extensions (pandocExtensions)\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Text.Pandoc.Options (ReaderOptions(..))\nimport Text.Pandoc.Shared (stringify, tshow, makeSections)\nimport Data.Containers.ListUtils (nubOrd)\nimport Text.Pandoc.Walk (query, walk, walkM)\nimport Control.Applicative ((<|>))\nimport Control.Monad.Except (catchError, throwError)\nimport Control.Monad.State (State, evalState, get, put, runState)\nimport Data.Aeson (eitherDecode)\nimport Data.ByteString (ByteString)\nimport qualified Data.ByteString.Lazy as L\nimport Data.Char (isPunctuation, isUpper)\nimport Data.Default (Default(def))\nimport qualified Data.Foldable as Foldable\nimport qualified Data.Map as M\nimport Data.Maybe (mapMaybe, fromMaybe)\nimport Data.Ord ()\nimport qualified Data.Sequence as Seq\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport System.FilePath (takeExtension)\nimport Safe (lastMay, initSafe)\n\nprocessCitations  :: PandocMonad m => Pandoc -> m Pandoc\nprocessCitations (Pandoc meta bs) = do\n  style <- getStyle (Pandoc meta bs)\n  mblang <- getCiteprocLang meta\n  let locale = Citeproc.mergeLocales mblang style\n\n  let addQuoteSpan (Quoted _ xs) = Span (\"\",[\"csl-quoted\"],[]) xs\n      addQuoteSpan x = x\n  refs <- map (walk addQuoteSpan) <$>\n          getReferences (Just locale) (Pandoc meta bs)\n\n  let otherIdsMap = foldr (\\ref m ->\n                             case T.words . extractText <$>\n                                  M.lookup \"other-ids\"\n                                      (referenceVariables ref) of\n                                Nothing  -> m\n                                Just ids -> foldr\n                                  (\\id' ->\n                                    M.insert id' (referenceId ref)) m ids)\n                          M.empty refs\n  let meta' = deleteMeta \"nocite\" meta\n  let citations = getCitations locale otherIdsMap $ Pandoc meta' bs\n\n\n  let linkCites = maybe False truish (lookupMeta \"link-citations\" meta) &&\n                  -- don't link citations if no bibliography to link to:\n             not (maybe False truish (lookupMeta \"suppress-bibliography\" meta))\n  let linkBib = maybe True truish $ lookupMeta \"link-bibliography\" meta\n  let opts = defaultCiteprocOptions{ linkCitations = linkCites\n                                   , linkBibliography = linkBib }\n  let result = Citeproc.citeproc opts style mblang refs citations\n  mapM_ (report . CiteprocWarning) (resultWarnings result)\n  let sopts = styleOptions style\n  let classes = \"references\" : -- TODO remove this or keep for compatibility?\n                \"csl-bib-body\" :\n                [\"hanging-indent\" | styleHangingIndent sopts]\n  let refkvs = (case styleEntrySpacing sopts of\n                   Just es -> ((\"entry-spacing\",T.pack $ show es):)\n                   _ -> id) .\n               (case styleLineSpacing sopts of\n                   Just ls | ls > 1 -> ((\"line-spacing\",T.pack $ show ls):)\n                   _ -> id) $ []\n  let bibs = mconcat $ map (\\(ident, out) ->\n                     B.divWith (\"ref-\" <> ident,[\"csl-entry\"],[]) . B.para .\n                         insertSpace $ out)\n                      (resultBibliography result)\n  let moveNotes = maybe (styleIsNoteStyle sopts) truish\n                   (lookupMeta \"notes-after-punctuation\" meta)\n  let cits = resultCitations result\n\n  let metanocites = lookupMeta \"nocite\" meta\n  let Pandoc meta'' bs' =\n         maybe id (setMeta \"nocite\") metanocites .\n         walk (mvPunct moveNotes locale) .\n         (if styleIsNoteStyle sopts\n             then walk addNote .  walk deNote\n             else id) .\n         evalState (walkM insertResolvedCitations $ Pandoc meta' bs)\n         $ cits\n  return $ walk removeQuoteSpan\n         $ insertRefs refkvs classes (B.toList bibs)\n         $ Pandoc meta'' bs'\n\nremoveQuoteSpan :: Inline -> Inline\nremoveQuoteSpan (Span (\"\",[\"csl-quoted\"],[]) xs) = Span nullAttr xs\nremoveQuoteSpan x = x\n\n-- | Retrieve the CSL style specified by the csl or citation-style\n-- metadata field in a pandoc document, or the default CSL style\n-- if none is specified.  Retrieve the parent style\n-- if the style is a dependent style.  Add abbreviations defined\n-- in an abbreviation file if one has been specified.\ngetStyle :: PandocMonad m => Pandoc -> m (Style Inlines)\ngetStyle (Pandoc meta _) = do\n  let cslfile = (lookupMeta \"csl\" meta <|> lookupMeta \"citation-style\" meta)\n                >>= metaValueToText\n\n  let getFile defaultExtension fp = do\n        oldRp <- getResourcePath\n        mbUdd <- getUserDataDir\n        setResourcePath $ oldRp ++ maybe []\n                                   (\\u -> [u <> \"/csl\",\n                                           u <> \"/csl/dependent\"]) mbUdd\n        let fp' = if T.any (=='.') fp || \"data:\" `T.isPrefixOf` fp\n                     then fp\n                     else fp <> defaultExtension\n        (result, _) <- fetchItem fp'\n        setResourcePath oldRp\n        return result\n\n  let getCslDefault = readDataFile \"default.csl\"\n\n  cslContents <- maybe getCslDefault (getFile \".csl\") cslfile >>=\n                   toTextM (maybe mempty T.unpack cslfile)\n\n  let abbrevFile = lookupMeta \"citation-abbreviations\" meta >>= metaValueToText\n\n  mbAbbrevs <- case abbrevFile of\n                 Nothing -> return Nothing\n                 Just fp -> do\n                   rawAbbr <- getFile \".json\" fp\n                   case eitherDecode (L.fromStrict rawAbbr) of\n                     Left err -> throwError $ PandocCiteprocError $\n                                 CiteprocParseError $\n                                 \"Could not parse abbreviations file \" <> fp\n                                 <> \"\\n\" <> T.pack err\n                     Right abbr -> return $ Just abbr\n\n  let getParentStyle url = do\n        -- first, try to retrieve the style locally, then use HTTP.\n        let basename = T.takeWhileEnd (/='/') url\n        catchError (getFile \".csl\" basename) (\\_ -> fst <$> fetchItem url)\n          >>= toTextM (T.unpack url)\n\n  styleRes <- Citeproc.parseStyle getParentStyle cslContents\n  case styleRes of\n     Left err    -> throwError $ PandocAppError $ prettyCiteprocError err\n     Right style -> return style{ styleAbbreviations = mbAbbrevs }\n\n\n-- Retrieve citeproc lang based on metadata.\ngetCiteprocLang :: PandocMonad m => Meta -> m (Maybe Lang)\ngetCiteprocLang meta = maybe (return Nothing) bcp47LangToIETF\n  ((lookupMeta \"lang\" meta <|> lookupMeta \"locale\" meta) >>= metaValueToText)\n\n-- | Get references defined inline in the metadata and via an external\n-- bibliography.  Only references that are actually cited in the document\n-- (either with a genuine citation or with `nocite`) are returned.\n-- URL variables are converted to links.\ngetReferences :: PandocMonad m\n              => Maybe Locale -> Pandoc -> m [Reference Inlines]\ngetReferences mblocale (Pandoc meta bs) = do\n  locale <- case mblocale of\n                Just l  -> return l\n                Nothing -> do\n                  mblang <- getCiteprocLang meta\n                  case mblang of\n                    Just lang -> return $ either mempty id $ getLocale lang\n                    Nothing   -> return mempty\n\n  let getCiteId (Cite cs _) = Set.fromList $ map B.citationId cs\n      getCiteId _ = mempty\n  let metanocites = lookupMeta \"nocite\" meta\n  let nocites = maybe mempty (query getCiteId) metanocites\n  let citeIds = query getCiteId (Pandoc meta bs)\n  let idpred = if \"*\" `Set.member` nocites\n                  then const True\n                  else (`Set.member` citeIds)\n  let inlineRefs = case lookupMeta \"references\" meta of\n                    Just (MetaList rs) ->\n                      filter (idpred . unItemId . referenceId)\n                         $  mapMaybe metaValueToReference rs\n                    _                  -> []\n  externalRefs <- case lookupMeta \"bibliography\" meta of\n                    Just (MetaList xs) ->\n                      mconcat <$>\n                        mapM (getRefsFromBib locale idpred)\n                          (mapMaybe metaValueToText xs)\n                    Just x ->\n                      case metaValueToText x of\n                        Just fp -> getRefsFromBib locale idpred fp\n                        Nothing -> return []\n                    Nothing -> return []\n  return $ map legacyDateRanges (externalRefs ++ inlineRefs)\n            -- note that inlineRefs can override externalRefs\n\n\n\n-- If we have a span.csl-left-margin followed by span.csl-right-inline,\n-- we insert a space. This ensures that they will be separated by a space,\n-- even in formats that don't have special handling for the display spans.\ninsertSpace :: Inlines -> Inlines\ninsertSpace ils =\n  case Seq.viewl (unMany ils) of\n    (Span (\"\",[\"csl-left-margin\"],[]) xs) Seq.:< rest ->\n      case Seq.lookup 0 rest of\n        Just (Span (\"\",[\"csl-right-inline\"],[]) _) ->\n          Many $\n            Span (\"\",[\"csl-left-margin\"],[]) (xs ++ case lastMay xs of\n                                                      Just Space -> []\n                                                      _          -> [Space])\n            Seq.<| rest\n        _ -> ils\n    _ -> ils\n\ngetRefsFromBib :: PandocMonad m\n               => Locale -> (Text -> Bool) -> Text -> m [Reference Inlines]\ngetRefsFromBib locale idpred fp = do\n  (raw, mt) <- fetchItem fp\n  case getBibliographyFormat (T.unpack fp) mt of\n    Just f -> getRefs locale f idpred (Just fp) raw\n    Nothing -> throwError $ PandocAppError $\n                 \"Could not determine bibliography format for \" <> fp\n\ngetRefs :: PandocMonad m\n        => Locale\n        -> BibFormat\n        -> (Text -> Bool)\n        -> Maybe Text\n        -> ByteString\n        -> m [Reference Inlines]\ngetRefs locale format idpred mbfp raw = do\n  let err' = throwError .\n             PandocBibliographyError (fromMaybe mempty mbfp)\n  let fp = maybe mempty T.unpack mbfp\n  case format of\n    Format_bibtex ->\n      toTextM fp raw >>=\n        either (err' . tshow) return . readBibtexString Bibtex locale idpred\n    Format_biblatex ->\n      toTextM fp raw >>=\n      either (err' . tshow) return . readBibtexString Biblatex locale idpred\n    Format_json ->\n      either (err' . T.pack)\n             (return . filter (idpred . unItemId . referenceId)) .\n        cslJsonToReferences $ raw\n    Format_yaml -> do\n      rs <- yamlToRefs idpred\n              def{ readerExtensions = pandocExtensions }\n              (T.unpack <$> mbfp)\n              raw\n      return $ mapMaybe metaValueToReference rs\n    Format_ris -> do\n      Pandoc meta _ <- toTextM fp raw >>= readRIS def\n      case lookupMeta \"references\" meta of\n        Just (MetaList rs) -> return $ mapMaybe metaValueToReference rs\n        _ -> return []\n\n-- assumes we walk in same order as query\ninsertResolvedCitations :: Inline -> State [Inlines] Inline\ninsertResolvedCitations (Cite cs ils) = do\n  resolved <- get\n  case resolved of\n    [] -> return (Cite cs ils)\n    (x:xs) -> do\n      put xs\n      return $ Cite cs (B.toList x)\ninsertResolvedCitations x = return x\n\ngetCitations :: Locale\n             -> M.Map Text ItemId\n             -> Pandoc\n             -> [Citeproc.Citation Inlines]\ngetCitations locale otherIdsMap (Pandoc meta blocks) =\n  Foldable.toList (query getCitation meta <>\n                   foldMap handleBlock (makeSections False Nothing blocks))\n where\n  handleBlock :: Block -> Seq.Seq (Citeproc.Citation Inlines)\n  handleBlock b@(Div (_,cls,_) _)\n    | \"section\" `elem` cls\n    , \"reset-citation-positions\" `elem` cls =\n      case Seq.viewl (query getCitation b) of\n        x Seq.:< xs -> addResetTo x Seq.<| xs\n        Seq.EmptyL -> mempty\n  handleBlock b = query getCitation b\n  addResetTo citation = citation{ Citeproc.citationResetPosition = True }\n  getCitation (Cite cs _fallback) = Seq.singleton $\n    Citeproc.Citation { Citeproc.citationId = Nothing\n                      , Citeproc.citationResetPosition = False\n                      , Citeproc.citationPrefix = Nothing\n                      , Citeproc.citationSuffix = Nothing\n                      , Citeproc.citationNoteNumber =\n                          case cs of\n                            []    -> Nothing\n                            (Pandoc.Citation{ Pandoc.citationNoteNum = n }:\n                               _) | n > 0     -> Just n\n                                  | otherwise -> Nothing\n                      , Citeproc.citationItems =\n                           fromPandocCitations locale otherIdsMap cs\n                      }\n  getCitation _ = mempty\n\nfromPandocCitations :: Locale\n                    -> M.Map Text ItemId\n                    -> [Pandoc.Citation]\n                    -> [CitationItem Inlines]\nfromPandocCitations locale otherIdsMap = concatMap go\n where\n  locmap = toLocatorMap locale\n  go c =\n    let (mblocinfo, suffix) = parseLocator locmap (Pandoc.citationSuffix c)\n        cit = CitationItem\n               { citationItemId = fromMaybe\n                   (ItemId $ Pandoc.citationId c)\n                   (M.lookup (Pandoc.citationId c) otherIdsMap)\n               , citationItemLabel = locatorLabel <$> mblocinfo\n               , citationItemLocator = locatorLoc <$> mblocinfo\n               , citationItemType = NormalCite\n               , citationItemPrefix = case Pandoc.citationPrefix c of\n                                        [] -> Nothing\n                                        ils -> Just $ B.fromList ils <>\n                                                      B.space\n               , citationItemSuffix = case suffix of\n                                        [] -> Nothing\n                                        ils -> Just $ B.fromList ils\n               , citationItemData = Nothing }\n     in if Pandoc.citationId c == \"*\"\n           then []\n           else\n             case citationMode c of\n                  AuthorInText   -> [ cit{ citationItemType = AuthorOnly\n                                         , citationItemSuffix = Nothing }\n                                    , cit{ citationItemType =\n                                              Citeproc.SuppressAuthor\n                                         , citationItemPrefix = Nothing } ]\n                  NormalCitation -> [ cit ]\n                  Pandoc.SuppressAuthor\n                                 -> [ cit{ citationItemType =\n                                              Citeproc.SuppressAuthor } ]\n\n\n\ndata BibFormat =\n    Format_biblatex\n  | Format_bibtex\n  | Format_json\n  | Format_yaml\n  | Format_ris\n  deriving (Show, Eq, Ord)\n\ngetBibliographyFormat :: FilePath -> Maybe MimeType -> Maybe BibFormat\ngetBibliographyFormat fp mbmime = do\n  let ext = takeExtension fp\n  case ext of\n    \".biblatex\" -> pure Format_biblatex\n    \".bibtex\"   -> pure Format_bibtex\n    \".bib\"      -> pure Format_biblatex\n    \".json\"     -> pure Format_json\n    \".yaml\"     -> pure Format_yaml\n    \".yml\"      -> pure Format_yaml\n    \".ris\"      -> pure Format_ris\n    _ -> do\n      mime <- mbmime\n      case T.takeWhile (/= ';') mime of\n            \"application/x-bibtex\" -> pure Format_biblatex\n            \"application/x-reseach-info-systems\" -> pure Format_ris\n            \"application/vnd.citationstyles.csl+json\" -> pure Format_json\n            \"application/json\" -> pure Format_json\n            \"application/x-yaml\" -> pure Format_yaml\n            \"text/x-yaml\" -> pure Format_yaml\n            \"text/yaml\" -> pure Format_yaml\n            _ -> Nothing\n\nisNote :: Inline -> Bool\nisNote (Note _) = True\n-- the following allows citation styles that are \"in-text\" but use superscript\n-- references to be treated as if they are \"notes\" for the purposes of moving\n-- the citations after trailing punctuation (see <https://github.com/jgm/pandoc-citeproc/issues/382>):\nisNote (Superscript _) = True\nisNote _ = False\n\nisSpacy :: Inline -> Bool\nisSpacy Space     = True\nisSpacy SoftBreak = True\nisSpacy _         = False\n\nmovePunctInsideQuotes :: Locale -> [Inline] -> [Inline]\nmovePunctInsideQuotes locale\n  | localePunctuationInQuote locale == Just True\n    = B.toList . movePunctuationInsideQuotes . B.fromList\n  | otherwise\n    = id\n\nmvPunct :: Bool -> Locale -> [Inline] -> [Inline]\nmvPunct moveNotes locale (x : xs)\n  | isSpacy x = x : mvPunct moveNotes locale xs\n-- 'x [^1],' -> 'x,[^1]'\nmvPunct moveNotes locale (q : s : x@(Cite _ [il]) : ys)\n  | isSpacy s\n  , isNote il\n  = let spunct = T.takeWhile isPunct $ stringify ys\n    in  if moveNotes\n           then if T.null spunct\n                   then q : x : mvPunct moveNotes locale ys\n                   else movePunctInsideQuotes locale\n                        [q , Str spunct , x] ++ mvPunct moveNotes locale\n                        (B.toList\n                          (dropTextWhile isPunct (B.fromList ys)))\n           else q : x : mvPunct moveNotes locale ys\n-- 'x[^1],' -> 'x,[^1]'\nmvPunct moveNotes locale (Cite cs ils@(_:_) : ys)\n   | isNote (last ils)\n   , startWithPunct ys\n   , moveNotes\n   = let s = stringify ys\n         spunct = T.takeWhile isPunct s\n     in  Cite cs (movePunctInsideQuotes locale $\n                    init ils\n                    ++ [Str spunct | not (endWithPunct False (init ils))]\n                    ++ [last ils]) :\n         mvPunct moveNotes locale\n           (B.toList (dropTextWhile isPunct (B.fromList ys)))\nmvPunct moveNotes locale (s : x@(Cite _ [il]) : ys)\n  | isSpacy s\n  , isNote il\n  = x : mvPunct moveNotes locale ys\nmvPunct moveNotes locale (s : x@(Cite _ (Superscript _ : _)) : ys)\n  | isSpacy s = x : mvPunct moveNotes locale ys\nmvPunct moveNotes locale (Cite cs ils : Str \".\" : ys)\n  | \".\" `T.isSuffixOf` (stringify ils)\n  = Cite cs ils : mvPunct moveNotes locale ys\nmvPunct moveNotes locale (x:xs) = x : mvPunct moveNotes locale xs\nmvPunct _ _ [] = []\n\n-- We don't treat an em-dash or en-dash as punctuation here, because we don't\n-- want notes and quotes to move around them.\nisPunct :: Char -> Bool\nisPunct c = isPunctuation c && c /= '\\x2014' && c /= '\\x2013'\n\nendWithPunct :: Bool -> [Inline] -> Bool\nendWithPunct _ [] = False\nendWithPunct onlyFinal xs@(_:_) =\n  case reverse (T.unpack $ stringify xs) of\n       []                       -> True\n       -- covers .), .\", etc.:\n       (d:c:_) | isPunct d\n                 && not onlyFinal\n                 && isEndPunct c -> True\n       (c:_) | isEndPunct c      -> True\n             | otherwise         -> False\n  where isEndPunct c = c `elem` (\".,;:!?\" :: String)\n\n\n\nstartWithPunct :: [Inline] -> Bool\nstartWithPunct ils =\n  case T.uncons (stringify ils) of\n    Just (c,_) -> c `elem` (\".,;:!?\" :: [Char])\n    Nothing -> False\n\ntruish :: MetaValue -> Bool\ntruish (MetaBool t) = t\ntruish (MetaString s) = isYesValue (T.toLower s)\ntruish (MetaInlines ils) = isYesValue (T.toLower (stringify ils))\ntruish (MetaBlocks [Plain ils]) = isYesValue (T.toLower (stringify ils))\ntruish _ = False\n\nisYesValue :: Text -> Bool\nisYesValue \"t\" = True\nisYesValue \"true\" = True\nisYesValue \"yes\" = True\nisYesValue _ = False\n\n-- if document contains a Div with id=\"refs\", insert\n-- references as its contents.  Otherwise, insert references\n-- at the end of the document in a Div with id=\"refs\" or\n-- id=\".*__refs\" (where .* stands for any string -- this is\n-- because --file-scope will add such a prefix based on the filename,\n-- see #11072.)\ninsertRefs :: [(Text,Text)] -> [Text] -> [Block] -> Pandoc -> Pandoc\ninsertRefs _ _ [] d = d\ninsertRefs refkvs refclasses refs (Pandoc meta bs) =\n  case lookupMeta \"suppress-bibliography\" meta of\n    Just x | truish x -> Pandoc meta bs\n    _ -> case runState (walkM go (Pandoc meta bs)) False of\n               (d', True) -> d'\n               (Pandoc meta' bs', False)\n                 -> Pandoc meta' $\n                    case refTitle meta of\n                      Nothing ->\n                        case reverse bs' of\n                          Header lev (id',classes,kvs) ys : xs ->\n                            reverse xs ++\n                            [Header lev (id',addUnNumbered classes,kvs) ys,\n                             Div (\"refs\",refclasses,refkvs) refs]\n                          _ -> bs' ++ [refDiv]\n                      Just ils -> bs' ++\n                        [Header 1 (\"bibliography\", [\"unnumbered\"], []) ils,\n                         refDiv]\n  where\n   refDiv = Div (\"refs\", refclasses, refkvs) refs\n   addUnNumbered cs = \"unnumbered\" : [c | c <- cs, c /= \"unnumbered\"]\n   go :: Block -> State Bool Block\n   go (Div (ident,cs,kvs) xs)\n     | ident == \"refs\" || \"__refs\" `T.isSuffixOf` ident = do\n       put True\n       -- refHeader isn't used if you have an explicit references div\n       let cs' = nubOrd $ cs ++ refclasses\n       let kvs' = nubOrd $ kvs ++ refkvs\n       return $ Div (ident,cs',kvs') (xs ++ refs)\n   go x = return x\n\nrefTitle :: Meta -> Maybe [Inline]\nrefTitle meta =\n  case lookupMeta \"reference-section-title\" meta of\n    Just (MetaString s)           -> Just [Str s]\n    Just (MetaInlines ils)        -> Just ils\n    Just (MetaBlocks [Plain ils]) -> Just ils\n    Just (MetaBlocks [Para ils])  -> Just ils\n    _                             -> Nothing\n\nlegacyDateRanges :: Reference Inlines -> Reference Inlines\nlegacyDateRanges ref =\n  ref{ referenceVariables = M.map go $ referenceVariables ref }\n where\n  go (DateVal d)\n    | null (dateParts d)\n    , Just lit <- dateLiteral d\n    = case T.splitOn \"_\" lit of\n        [x,y] -> case Citeproc.rawDateEDTF (x <> \"/\" <> y) of\n                   Just d' -> DateVal d'\n                   Nothing -> DateVal d\n        _ -> DateVal d\n  go x = x\n\nextractText :: Val Inlines -> Text\nextractText (TextVal x)  = x\nextractText (FancyVal x) = toText x\nextractText (NumVal n)   = T.pack (show n)\nextractText _            = mempty\n\n-- Here we take the Spans with class csl-note that are left\n-- after deNote has removed nested ones, and convert them\n-- into real notes.\naddNote :: Inline -> Inline\naddNote (Span (\"\",[\"csl-note\"],[]) ils) =\n  Note [Para $\n         B.toList . addTextCase Nothing CapitalizeFirst . B.fromList $ ils]\naddNote x = x\n\n-- Here we handle citation notes that occur inside footnotes\n-- or other citation notes, in a note style.  We don't want\n-- notes inside notes, so we convert these to parenthesized\n-- or comma-separated citations.\ndeNote :: Inline -> Inline\ndeNote (Note bs) =\n  case bs of\n    [Para (cit@(Cite (c:_) _) : ils)]\n       | citationMode c /= AuthorInText ->\n         -- if citation is first in note, no need to parenthesize.\n         Note [Para (walk removeNotes $ cit : walk addParens ils)]\n    _ -> Note (walk removeNotes . walk addParens $ bs)\n\n where\n  addParens [] = []\n  addParens (Cite (c:cs) ils : zs)\n    | citationMode c == AuthorInText\n      = Cite (c:cs) (addCommas (needsPeriod zs) ils) :\n        addParens zs\n    | otherwise\n      = Cite (c:cs) (dropWhile (== Space) (concatMap noteInParens ils))\n         : addParens zs\n  addParens (x:xs) = x : addParens xs\n\n  removeNotes (Span (\"\",[\"csl-note\"],[]) ils) = Span (\"\",[],[]) ils\n  removeNotes x = x\n\n  needsPeriod [] = True\n  needsPeriod (Str t:_) = case T.uncons t of\n                            Nothing    -> False\n                            Just (c,_) -> isUpper c\n  needsPeriod (Space:zs) = needsPeriod zs\n  needsPeriod _ = False\n\n  noteInParens (Span (\"\",[\"csl-note\"],[]) ils)\n       = Space : Str \"(\" :\n         removeFinalPeriod ils ++ [Str \")\"]\n  noteInParens x = [x]\n\n  -- We want to add a comma before a CSL note citation, but not\n  -- before the author name, and not before the first citation\n  -- if it doesn't begin with an author name.\n  addCommas = addCommas' True -- boolean == \"at beginning\"\n\n  addCommas' _ _ [] = []\n  addCommas' atBeginning needsPer\n    (Span (\"\",[\"csl-note\"],[]) ils : rest)\n      | not (null ils)\n       = (if atBeginning then id else ([Str \",\" , Space] ++)) $\n         (if needsPer then ils else removeFinalPeriod ils) ++\n         addCommas' False needsPer rest\n  addCommas' _ needsPer (il : rest) = il : addCommas' False needsPer rest\n\ndeNote x = x\n\n-- Note: we can't use dropTextWhileEnd indiscriminately,\n-- because this would remove the final period on abbreviations like Ibid.\n-- But it turns out that when the note citation ends with Ibid.\n-- (or Ed. etc.), the last inline will be Str \"\" as a result of\n-- the punctuation-fixing mechanism that removes the double '.'.\nremoveFinalPeriod :: [Inline] -> [Inline]\nremoveFinalPeriod ils =\n  case lastMay ils of\n    Just (Span attr ils')\n      -> initSafe ils ++ [Span attr (removeFinalPeriod ils')]\n    Just (Emph ils')\n      -> initSafe ils ++ [Emph (removeFinalPeriod ils')]\n    Just (Strong ils')\n      -> initSafe ils ++ [Strong (removeFinalPeriod ils')]\n    Just (SmallCaps ils')\n      -> initSafe ils ++ [SmallCaps (removeFinalPeriod ils')]\n    Just (Str t)\n      | T.takeEnd 1 t == \".\" -> initSafe ils ++ [Str (T.dropEnd 1 t)]\n      | isRightQuote (T.takeEnd 1 t)\n        -> removeFinalPeriod\n             (initSafe ils ++ [Str tInit | not (T.null tInit)]) ++ [Str tEnd]\n             where\n               tEnd  = T.takeEnd 1 t\n               tInit = T.dropEnd 1 t\n    _ -> ils\n where\n  isRightQuote \"\\8221\" = True\n  isRightQuote \"\\8217\" = True\n  isRightQuote \"\\187\"  = True\n  isRightQuote _       = False\n\nbcp47LangToIETF :: PandocMonad m => Text -> m (Maybe Lang)\nbcp47LangToIETF bcplang =\n  case parseLang bcplang of\n    Left _ -> do\n      report $ InvalidLang bcplang\n      return Nothing\n    Right lang -> return $ Just lang\n"
  },
  {
    "path": "src/Text/Pandoc/Class/CommonState.hs",
    "content": "{-# LANGUAGE CPP #-}\n{- |\nModule      : Text.Pandoc.Class.CommonState\nCopyright   : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\nStability   : alpha\nPortability : portable\n\nCommon state shared by all pandoc-specific operations, including\nthose in readers, writers, and Lua filters.\n-}\n\nmodule Text.Pandoc.Class.CommonState\n  ( CommonState(..)\n  , defaultCommonState\n  )\nwhere\n\nimport Data.Default (Default (def))\nimport Data.Text (Text)\nimport Text.Collate.Lang (Lang)\nimport Text.Pandoc.MediaBag (MediaBag)\nimport Text.Pandoc.Logging (LogMessage, Verbosity (WARNING))\nimport Text.Pandoc.Translations.Types (Translations)\n#ifdef PANDOC_HTTP_SUPPORT\nimport Network.HTTP.Client (Manager)\n#endif\n\n-- | 'CommonState' represents state that is used by all\n-- instances of 'PandocMonad'.  Normally users should not\n-- need to interact with it directly; instead, auxiliary\n-- functions like 'setVerbosity' and 'withMediaBag' should be used.\ndata CommonState = CommonState\n  { stLog          :: [LogMessage]\n    -- ^ A list of log messages in reverse order\n  , stUserDataDir  :: Maybe FilePath\n    -- ^ Directory to search for data files\n  , stSourceURL    :: Maybe Text\n    -- ^ Absolute URL + dir of 1st source file\n  , stRequestHeaders :: [(Text, Text)]\n    -- ^ Headers to add for HTTP requests\n  , stNoCheckCertificate :: Bool\n    -- ^ Controls whether certificate validation is disabled\n  , stMediaBag     :: MediaBag\n    -- ^ Media parsed from binary containers\n  , stTranslations :: Maybe (Lang, Maybe Translations)\n    -- ^ Translations for localization\n  , stInputFiles   :: [FilePath]\n    -- ^ List of input files from command line\n  , stOutputFile   :: Maybe FilePath\n    -- ^ Output file from command line\n  , stResourcePath :: [FilePath]\n    -- ^ Path to search for resources like\n    -- included images\n#ifdef PANDOC_HTTP_SUPPORT\n  , stManager      :: Maybe Manager\n    -- ^ Manager for HTTP client; this needs to persist across many requests\n    -- for efficiency.\n#endif\n  , stVerbosity    :: Verbosity\n    -- ^ Verbosity level\n  , stTrace        :: Bool\n    -- ^ Controls whether tracing messages are\n    -- issued.\n  }\n\n-- | The default @'CommonState'@. All fields are initialized as the\n-- monoid identity of their resprective type, except for:\n--\n--   * @'stResourcePath'@, which is set to @[\".\"]@,\n--   * @'stTrace'@, which is set to @'False'@, and\n--   * @'stVerbosity'@, which is set to @WARNING@.\ndefaultCommonState :: CommonState\ndefaultCommonState = CommonState\n  { stLog = []\n  , stUserDataDir = Nothing\n  , stSourceURL = Nothing\n  , stRequestHeaders = []\n  , stNoCheckCertificate = False\n  , stMediaBag = mempty\n  , stTranslations = Nothing\n  , stInputFiles = []\n  , stOutputFile = Nothing\n  , stResourcePath = [\".\"]\n#ifdef PANDOC_HTTP_SUPPORT\n  , stManager = Nothing\n#endif\n  , stVerbosity = WARNING\n  , stTrace = False\n  }\n\ninstance Default CommonState where\n  def = defaultCommonState\n"
  },
  {
    "path": "src/Text/Pandoc/Class/IO/HTTP.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\nModule      : Text.Pandoc.Class.IO.HTTP\nCopyright   : Copyright (C) 2025 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\nStability   : alpha\nPortability : portable\n\nHTTP fetching functionality for pandoc.\n-}\nmodule Text.Pandoc.Class.IO.HTTP\n  ( openURL\n  ) where\n\nimport Network.URI (URI(..), parseURI)\nimport Data.Text (Text)\nimport Control.Monad.IO.Class (MonadIO)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, extractURIData)\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.MIME (MimeType)\nimport qualified Data.ByteString as B\nimport qualified Data.Text as T\nimport Control.Monad.Except (throwError)\n#ifdef PANDOC_HTTP_SUPPORT\nimport Data.ByteString.Lazy (toChunks)\nimport Control.Monad.IO.Class (liftIO)\nimport System.Environment (getEnv)\nimport Data.Default (def)\nimport Network.Connection (TLSSettings(..))\nimport qualified Network.TLS as TLS\nimport qualified Network.TLS.Extra as TLS\nimport System.X509 (getSystemCertificateStore)\nimport Network.HTTP.Client\n       (httpLbs, Manager, responseBody, responseHeaders,\n        Request(port, host, requestHeaders), parseUrlThrow, newManager, HttpException)\nimport Network.HTTP.Client.Internal (addProxy)\nimport Network.HTTP.Client.TLS (mkManagerSettings)\nimport Network.HTTP.Types.Header ( hContentType )\nimport Network.Socket (withSocketsDo)\nimport Text.Pandoc.Class.CommonState (CommonState (..))\nimport Text.Pandoc.Class.PandocMonad ( getsCommonState, modifyCommonState, report )\nimport qualified Data.CaseInsensitive as CI\nimport System.IO.Error\nimport Text.Pandoc.Logging (LogMessage (..))\nimport qualified Control.Exception as E\nimport qualified Text.Pandoc.UTF8 as UTF8\n#endif\n\n#ifdef PANDOC_HTTP_SUPPORT\ngetManager :: (PandocMonad m, MonadIO m) => m Manager\ngetManager = do\n  mbManager <- getsCommonState stManager\n  disableCertificateValidation <- getsCommonState stNoCheckCertificate\n  case mbManager of\n    Just manager -> pure manager\n    Nothing -> do\n      manager <- liftIO $ do\n        certificateStore <- getSystemCertificateStore\n        let tlsSettings = TLSSettings $\n               (TLS.defaultParamsClient \"localhost.localdomain\" \"80\")\n                  { TLS.clientSupported = def{ TLS.supportedCiphers =\n                                               TLS.ciphersuite_default\n                                             , TLS.supportedExtendedMainSecret =\n                                                TLS.AllowEMS }\n                  , TLS.clientShared = def\n                      { TLS.sharedCAStore = certificateStore\n                      , TLS.sharedValidationCache =\n                          if disableCertificateValidation\n                             then TLS.ValidationCache\n                                   (\\_ _ _ -> return TLS.ValidationCachePass)\n                                   (\\_ _ _ -> return ())\n                             else def\n                      }\n                  }\n        let tlsManagerSettings = mkManagerSettings tlsSettings  Nothing\n        newManager tlsManagerSettings\n      modifyCommonState $ \\st -> st{ stManager = Just manager }\n      pure manager\n#endif\n\nopenURL :: (PandocMonad m, MonadIO m) => Text -> m (B.ByteString, Maybe MimeType)\nopenURL u\n | Just (URI{ uriScheme = \"data:\",\n              uriPath = upath }) <- parseURI (T.unpack u)\n     = pure $ extractURIData upath\n#ifdef PANDOC_HTTP_SUPPORT\n | otherwise = do\n     let toReqHeader (n, v) = (CI.mk (UTF8.fromText n), UTF8.fromText v)\n     customHeaders <- map toReqHeader <$> getsCommonState stRequestHeaders\n     report $ Fetching u\n     manager <- getManager\n     res <- liftIO $ E.try $ withSocketsDo $ do\n       proxy <- tryIOError (getEnv \"http_proxy\")\n       let addProxy' x = case proxy of\n                            Left _ -> return x\n                            Right pr -> parseUrlThrow pr >>= \\r ->\n                                return (addProxy (host r) (port r) x)\n       req <- parseUrlThrow (T.unpack u) >>= addProxy'\n       let req' = req{requestHeaders = customHeaders ++ requestHeaders req}\n       resp <- httpLbs req' manager\n       return (B.concat $ toChunks $ responseBody resp,\n               UTF8.toText `fmap` lookup hContentType (responseHeaders resp))\n\n     case res of\n          Right r -> return r\n          Left (e :: HttpException)\n                  -> throwError $ PandocHttpError u (T.pack (show e))\n#else\n | otherwise =\n     throwError $ PandocHttpError u \"pandoc was compiled without HTTP support\"\n#endif\n"
  },
  {
    "path": "src/Text/Pandoc/Class/IO.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\nModule      : Text.Pandoc.Class.IO\nCopyright   : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\nStability   : alpha\nPortability : portable\n\nDefault ways to perform @'PandocMonad'@ actions in a @'MonadIO'@ type.\n\nThese functions are used to make the @'PandocIO'@ type an instance of\n@'PandocMonad'@, but can be reused for any other MonadIO-conforming\ntypes.\n-}\nmodule Text.Pandoc.Class.IO\n  ( fileExists\n  , getCurrentTime\n  , getCurrentTimeZone\n  , getDataFileName\n  , getModificationTime\n  , glob\n  , logOutput\n  , logIOError\n  , lookupEnv\n  , newStdGen\n  , newUniqueHash\n  , openURL\n  , readFileLazy\n  , readFileStrict\n  , readStdinStrict\n  , extractMedia\n  , writeMedia\n ) where\n\nimport Control.Monad.Except (throwError)\nimport Control.Monad.IO.Class (MonadIO, liftIO)\nimport Data.Text (Text, pack, unpack)\nimport Data.Time (TimeZone, UTCTime)\nimport Data.Unique (hashUnique)\n#ifdef PANDOC_HTTP_SUPPORT\nimport Data.ByteString.Lazy (toChunks)\nimport System.Environment (getEnv)\nimport Data.Default (def)\nimport Network.Connection (TLSSettings(..))\nimport qualified Network.TLS as TLS\nimport qualified Network.TLS.Extra as TLS\nimport System.X509 (getSystemCertificateStore)\nimport Network.HTTP.Client\n       (httpLbs, Manager, responseBody, responseHeaders,\n        Request(port, host, requestHeaders), parseUrlThrow, newManager, HttpException)\nimport Network.HTTP.Client.Internal (addProxy)\nimport Network.HTTP.Client.TLS (mkManagerSettings)\nimport Network.HTTP.Types.Header ( hContentType )\nimport Network.Socket (withSocketsDo)\nimport Text.Pandoc.Class.CommonState (CommonState (..))\nimport Text.Pandoc.Class.PandocMonad ( getsCommonState, modifyCommonState )\nimport qualified Data.CaseInsensitive as CI\n#endif\nimport Network.URI (URI(..), parseURI, unEscapeString)\nimport System.Directory (createDirectoryIfMissing)\nimport System.FilePath ((</>), takeDirectory, takeFileName, normalise, takeExtension)\nimport qualified System.FilePath.Posix as Posix\nimport System.IO (stderr)\nimport System.IO.Error\nimport System.Random (StdGen)\nimport Text.Pandoc.Class.PandocMonad\n       (PandocMonad,\n        getMediaBag, report, extractURIData)\nimport Text.Pandoc.Definition (Pandoc, Inline (Image))\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Logging (LogMessage (..), messageVerbosity, showLogMessage)\nimport Text.Pandoc.MIME (MimeType)\nimport Text.Pandoc.MediaBag (MediaBag, MediaItem(..), lookupMedia, mediaItems)\nimport Text.Pandoc.Walk (walk)\nimport qualified Control.Exception as E\nimport qualified Data.ByteString as B\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport qualified Data.Time\nimport qualified Data.Time.LocalTime\nimport qualified Data.Unique\nimport qualified System.Directory\nimport qualified System.Environment as Env\nimport qualified System.FilePath.Glob\nimport qualified System.Random\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Codec.Archive.Zip\n#ifndef EMBED_DATA_FILES\nimport qualified Paths_pandoc as Paths\n#endif\n\n-- | Utility function to lift IO errors into 'PandocError's.\nliftIOError :: (PandocMonad m, MonadIO m) => (String -> IO a) -> String -> m a\nliftIOError f u = do\n  res <- liftIO $ tryIOError $ f u\n  case res of\n         Left e  -> throwError $ PandocIOError (pack u) e\n         Right r -> return r\n\n-- | Show potential IO errors to the user continuing execution anyway\nlogIOError :: (PandocMonad m, MonadIO m) => IO () -> m ()\nlogIOError f = do\n  res <- liftIO $ tryIOError f\n  case res of\n    Left e -> report $ IgnoredIOError $ pack $ E.displayException e\n    Right _ -> pure ()\n\n-- | Lookup an environment variable in the programs environment.\nlookupEnv :: MonadIO m => Text -> m (Maybe Text)\nlookupEnv = fmap (fmap pack) . liftIO . Env.lookupEnv . unpack\n\n-- | Get the current (UTC) time.\ngetCurrentTime :: MonadIO m => m UTCTime\ngetCurrentTime = liftIO Data.Time.getCurrentTime\n\n-- | Get the locale's time zone.\ngetCurrentTimeZone :: MonadIO m => m TimeZone\ngetCurrentTimeZone = liftIO Data.Time.LocalTime.getCurrentTimeZone\n\n-- | Return a new generator for random numbers.\nnewStdGen :: MonadIO m => m StdGen\nnewStdGen = liftIO System.Random.newStdGen\n\n-- | Return a new unique integer.\nnewUniqueHash :: MonadIO m => m Int\nnewUniqueHash = hashUnique <$> liftIO Data.Unique.newUnique\n\n#ifdef PANDOC_HTTP_SUPPORT\ngetManager :: (PandocMonad m, MonadIO m) => m Manager\ngetManager = do\n  mbManager <- getsCommonState stManager\n  disableCertificateValidation <- getsCommonState stNoCheckCertificate\n  case mbManager of\n    Just manager -> pure manager\n    Nothing -> do\n      manager <- liftIO $ do\n        certificateStore <- getSystemCertificateStore\n        let tlsSettings = TLSSettings $\n               (TLS.defaultParamsClient \"localhost.localdomain\" \"80\")\n                  { TLS.clientSupported = def{ TLS.supportedCiphers =\n                                               TLS.ciphersuite_default\n                                             , TLS.supportedExtendedMainSecret =\n                                                TLS.AllowEMS }\n                  , TLS.clientShared = def\n                      { TLS.sharedCAStore = certificateStore\n                      , TLS.sharedValidationCache =\n                          if disableCertificateValidation\n                             then TLS.ValidationCache\n                                   (\\_ _ _ -> return TLS.ValidationCachePass)\n                                   (\\_ _ _ -> return ())\n                             else def\n                      }\n                  }\n        let tlsManagerSettings = mkManagerSettings tlsSettings  Nothing\n        newManager tlsManagerSettings\n      modifyCommonState $ \\st -> st{ stManager = Just manager }\n      pure manager\n#endif\n\nopenURL :: (PandocMonad m, MonadIO m) => Text -> m (B.ByteString, Maybe MimeType)\nopenURL u\n | Just (URI{ uriScheme = \"data:\",\n              uriPath = upath }) <- parseURI (T.unpack u)\n     = pure $ extractURIData upath\n#ifdef PANDOC_HTTP_SUPPORT\n | otherwise = do\n     let toReqHeader (n, v) = (CI.mk (UTF8.fromText n), UTF8.fromText v)\n     customHeaders <- map toReqHeader <$> getsCommonState stRequestHeaders\n     report $ Fetching u\n     manager <- getManager\n     res <- liftIO $ E.try $ withSocketsDo $ do\n       proxy <- tryIOError (getEnv \"http_proxy\")\n       let addProxy' x = case proxy of\n                            Left _ -> return x\n                            Right pr -> parseUrlThrow pr >>= \\r ->\n                                return (addProxy (host r) (port r) x)\n       req <- parseUrlThrow (unpack u) >>= addProxy'\n       let req' = req{requestHeaders = customHeaders ++ requestHeaders req}\n       resp <- httpLbs req' manager\n       return (B.concat $ toChunks $ responseBody resp,\n               UTF8.toText `fmap` lookup hContentType (responseHeaders resp))\n\n     case res of\n          Right r -> return r\n          Left (e :: HttpException)\n                  -> throwError $ PandocHttpError u (T.pack (show e))\n#else\n | otherwise =\n     throwError $ PandocHttpError u \"pandoc was compiled without HTTP support\"\n#endif\n\n-- | Read the lazy ByteString contents from a file path, raising an error on\n-- failure.\nreadFileLazy :: (PandocMonad m, MonadIO m) => FilePath -> m BL.ByteString\nreadFileLazy s = liftIOError BL.readFile s\n\n-- | Read the strict ByteString contents from a file path,\n-- raising an error on failure.\nreadFileStrict :: (PandocMonad m, MonadIO m) => FilePath -> m B.ByteString\nreadFileStrict s = liftIOError B.readFile s\n\n-- | Read the strict ByteString contents from stdin, raising\n-- an error on failure.\nreadStdinStrict :: (PandocMonad m, MonadIO m) => m B.ByteString\nreadStdinStrict = liftIOError (const B.getContents) \"stdin\"\n\n-- | Return a list of paths that match a glob, relative to the working\n-- directory. See 'System.FilePath.Glob' for the glob syntax.\nglob :: (PandocMonad m, MonadIO m) => String -> m [FilePath]\nglob = liftIOError System.FilePath.Glob.glob\n\n-- | Returns True if file exists.\nfileExists :: (PandocMonad m, MonadIO m) => FilePath -> m Bool\nfileExists = liftIOError System.Directory.doesFileExist\n\n-- | Returns the path of data file.\ngetDataFileName :: (PandocMonad m, MonadIO m) => FilePath -> m FilePath\n#ifdef EMBED_DATA_FILES\ngetDataFileName = return\n#else\ngetDataFileName = liftIOError Paths.getDataFileName\n#endif\n\n-- | Return the modification time of a file.\ngetModificationTime :: (PandocMonad m, MonadIO m) => FilePath -> m UTCTime\ngetModificationTime = liftIOError System.Directory.getModificationTime\n\n-- | Output a log message.\nlogOutput :: (PandocMonad m, MonadIO m) => LogMessage -> m ()\nlogOutput msg = liftIO $ do\n  UTF8.hPutStr stderr $\n      \"[\" <> T.pack (show (messageVerbosity msg)) <> \"] \"\n  alertIndent $ T.lines $ showLogMessage msg\n\n-- | Prints the list of lines to @stderr@, indenting every but the first\n-- line by two spaces.\nalertIndent :: [Text] -> IO ()\nalertIndent [] = return ()\nalertIndent (l:ls) = do\n  UTF8.hPutStrLn stderr l\n  mapM_ go ls\n  where go l' = do UTF8.hPutStr stderr \"  \"\n                   UTF8.hPutStrLn stderr l'\n\n-- | Extract media from the mediabag into a directory (or a zip archive if the\n-- path supplied ends in @.zip@.\nextractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc\nextractMedia path d = do\n  media <- getMediaBag\n  let items = mediaItems media\n  let (dir, mbZip) = case takeExtension path of\n                       \".zip\" -> (takeDirectory path, Just (takeFileName path))\n                       _ -> (path, Nothing)\n  if null items\n    then return d\n    else do\n      let archive = foldr addEntry emptyArchive items\n      case mbZip of\n        Just fname -> writeMedia dir\n                        (fname, \"application/zip\", fromArchive archive)\n        Nothing -> mapM_ (writeMedia dir) items\n      return $ walk (adjustImagePath dir media) d\n where\n  addEntry (fp, _mime, content) = addEntryToArchive (toEntry fp 0 content)\n\n-- | Write the contents of a media bag to a path.\n-- If the path contains URI escape sequences (percent-encoding),\n-- these are resolved.\nwriteMedia :: (PandocMonad m, MonadIO m)\n           => FilePath\n           -> (FilePath, MimeType, BL.ByteString)\n           -> m ()\nwriteMedia dir (fp, _mt, bs) = do\n  -- we normalize to get proper path separators for the platform\n  -- we unescape URI encoding, but given how insertMedia\n  -- is written, we shouldn't have any % in a canonical media name...\n  let fullpath = normalise $ dir </> unEscapeString fp\n  liftIOError (createDirectoryIfMissing True) (takeDirectory fullpath)\n  report $ Extracting (T.pack fullpath)\n  logIOError $ BL.writeFile fullpath bs\n\n-- | If the given Inline element is an image with a @src@ path equal to\n-- one in the list of @paths@, then prepends @dir@ to the image source;\n-- returns the element unchanged otherwise.\nadjustImagePath :: FilePath -> MediaBag -> Inline -> Inline\nadjustImagePath dir mediabag (Image attr lab (src, tit)) =\n  case lookupMedia (T.unpack src) mediabag of\n    Nothing -> Image attr lab (src, tit)\n    Just item ->\n      let fullpath = dir Posix.</> mediaPath item\n      in  Image attr lab (T.pack fullpath, tit)\nadjustImagePath _ _ x = x\n"
  },
  {
    "path": "src/Text/Pandoc/Class/PandocIO.hs",
    "content": "{-# LANGUAGE DeriveFunctor #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{- |\nModule      : Text.Pandoc.Class.PandocIO\nCopyright   : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\nStability   : alpha\nPortability : portable\n\nThis module defines @'PandocIO'@, an IO-based instance of the\n@'PandocMonad'@ type class. File, data, and network access all are run\nusing IO operators.\n-}\nmodule Text.Pandoc.Class.PandocIO\n  ( PandocIO(..)\n  , runIO\n  , runIOorExplode\n  , extractMedia\n ) where\n\nimport Control.Monad.Except (ExceptT, MonadError, runExceptT)\nimport Control.Monad.IO.Class (MonadIO)\nimport Control.Monad.State (StateT, evalStateT, lift, get, put)\nimport Data.Default (Default (def))\nimport Text.Pandoc.Class.CommonState (CommonState (..))\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport qualified Text.Pandoc.Class.IO as IO\nimport Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow)\n\n-- | Evaluate a 'PandocIO' operation.\nrunIO :: PandocIO a -> IO (Either PandocError a)\nrunIO ma = flip evalStateT def $ runExceptT $ unPandocIO ma\n\n-- | Evaluate a 'PandocIO' operation, handling any errors\n-- by exiting with an appropriate message and error status.\nrunIOorExplode :: PandocIO a -> IO a\nrunIOorExplode ma = runIO ma >>= handleError\n\nnewtype PandocIO a = PandocIO {\n  unPandocIO :: ExceptT PandocError (StateT CommonState IO) a\n  } deriving ( MonadIO\n             , Functor\n             , Applicative\n             , Monad\n             , MonadCatch\n             , MonadMask\n             , MonadThrow\n             , MonadError PandocError\n             )\n\ninstance PandocMonad PandocIO where\n  lookupEnv = IO.lookupEnv\n  getCurrentTime = IO.getCurrentTime\n  getCurrentTimeZone = IO.getCurrentTimeZone\n  newStdGen = IO.newStdGen\n  newUniqueHash = IO.newUniqueHash\n\n  openURL = IO.openURL\n  readFileLazy = IO.readFileLazy\n  readFileStrict = IO.readFileStrict\n  readStdinStrict = IO.readStdinStrict\n\n  glob = IO.glob\n  fileExists = IO.fileExists\n  getDataFileName = IO.getDataFileName\n  getModificationTime = IO.getModificationTime\n\n  getCommonState = PandocIO $ lift get\n  putCommonState = PandocIO . lift . put\n\n  logOutput = IO.logOutput\n\n-- | Extract media from the mediabag into a directory.\nextractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc\nextractMedia = IO.extractMedia\n"
  },
  {
    "path": "src/Text/Pandoc/Class/PandocMonad.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE UndecidableInstances #-}\n{-# LANGUAGE ViewPatterns #-}\n{- |\nModule      : Text.Pandoc.Class.PandocMonad\nCopyright   : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\nStability   : alpha\nPortability : portable\n\nThis module defines a type class, 'PandocMonad', for pandoc readers\nand writers.\n-}\n\nmodule Text.Pandoc.Class.PandocMonad\n  ( PandocMonad(..)\n  , getTimestamp\n  , getPOSIXTime\n  , getZonedTime\n  , readFileFromDirs\n  , report\n  , runSilently\n  , setRequestHeader\n  , setNoCheckCertificate\n  , getLog\n  , setVerbosity\n  , getVerbosity\n  , setTrace\n  , getTrace\n  , getMediaBag\n  , setMediaBag\n  , insertMedia\n  , setUserDataDir\n  , getUserDataDir\n  , fetchItem\n  , extractURIData\n  , getInputFiles\n  , setInputFiles\n  , getOutputFile\n  , setOutputFile\n  , setResourcePath\n  , getResourcePath\n  , setRequestHeaders\n  , getRequestHeaders\n  , getSourceURL\n  , readMetadataFile\n  , toTextM\n  , fillMediaBag\n  , toLang\n  , makeCanonical\n  , findFileWithDataFallback\n  , checkUserDataDir\n  ) where\n\nimport Control.Monad.Except (MonadError (catchError, throwError))\nimport Control.Monad.Trans (MonadTrans, lift)\nimport Control.Monad (when)\nimport Data.Time (UTCTime)\nimport Data.Time.Clock.POSIX (POSIXTime, utcTimeToPOSIXSeconds,\n                             posixSecondsToUTCTime)\nimport Data.Time.LocalTime (TimeZone, ZonedTime, utcToZonedTime)\nimport Network.URI ( escapeURIString, nonStrictRelativeTo,\n                     unEscapeString, parseURIReference, isAllowedInURI,\n                     parseURI, URI(..) )\nimport System.FilePath ((</>), takeExtension, dropExtension,\n                        isRelative, makeRelative)\nimport System.Random (StdGen)\nimport Text.Collate.Lang (Lang(..), parseLang)\nimport Text.Pandoc.Class.CommonState (CommonState (..))\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.Logging\nimport Text.Pandoc.MIME (MimeType, getMimeType)\nimport Text.Pandoc.MediaBag (MediaBag, lookupMedia, MediaItem(..))\nimport Text.Pandoc.Shared (safeRead, makeCanonical, tshow)\nimport Text.Pandoc.URI (uriPathToPath, pBase64DataURI)\nimport qualified Data.Attoparsec.Text as A\nimport Text.Pandoc.Walk (walkM)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Data.ByteString.Base64 (decodeLenient)\nimport Text.Parsec (ParsecT, getPosition, sourceLine, sourceName)\nimport qualified Data.ByteString as B\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport qualified Debug.Trace\nimport qualified Text.Pandoc.MediaBag as MB\nimport qualified Data.Text.Encoding as TSE\nimport qualified Data.Text.Encoding.Error as TSE\n\n-- | The PandocMonad typeclass contains all the potentially\n-- IO-related functions used in pandoc's readers and writers.\n-- Instances of this typeclass may implement these functions\n-- in IO (as in 'PandocIO') or using an internal state that\n-- represents a file system, time, and so on (as in 'PandocPure').\nclass (Functor m, Applicative m, Monad m, MonadError PandocError m)\n      => PandocMonad m where\n  -- | Lookup an environment variable.\n  lookupEnv :: T.Text -> m (Maybe T.Text)\n  -- | Get the current (UTC) time.\n  getCurrentTime :: m UTCTime\n  -- | Get the locale's time zone.\n  getCurrentTimeZone :: m TimeZone\n  -- | Return a new generator for random numbers.\n  newStdGen :: m StdGen\n  -- | Return a new unique integer.\n  newUniqueHash :: m Int\n  -- | Retrieve contents and mime type from a URL, raising\n  -- an error on failure.\n  openURL :: T.Text -> m (B.ByteString, Maybe MimeType)\n  -- | Read the lazy ByteString contents from a file path,\n  -- raising an error on failure.\n  readFileLazy :: FilePath -> m BL.ByteString\n  -- | Read the strict ByteString contents from a file path,\n  -- raising an error on failure.\n  readFileStrict :: FilePath -> m B.ByteString\n  -- | Read the contents of stdin as a strict ByteString, raising\n  -- an error on failure.\n  readStdinStrict :: m B.ByteString\n  -- | Return a list of paths that match a glob, relative to\n  -- the working directory.  See 'System.FilePath.Glob' for\n  -- the glob syntax.\n  glob :: String -> m [FilePath]\n  -- | Returns True if file exists.\n  fileExists :: FilePath -> m Bool\n  -- | Returns the path of data file.\n  getDataFileName :: FilePath -> m FilePath\n  -- | Return the modification time of a file.\n  getModificationTime :: FilePath -> m UTCTime\n  -- | Get the value of the 'CommonState' used by all instances\n  -- of 'PandocMonad'.\n  getCommonState :: m CommonState\n  -- | Set the value of the 'CommonState' used by all instances\n  -- of 'PandocMonad'.\n  -- | Get the value of a specific field of 'CommonState'.\n  putCommonState :: CommonState -> m ()\n  -- | Get the value of a specific field of 'CommonState'.\n  getsCommonState :: (CommonState -> a) -> m a\n  getsCommonState f = f <$> getCommonState\n  -- | Modify the 'CommonState'.\n  modifyCommonState :: (CommonState -> CommonState) -> m ()\n  modifyCommonState f = getCommonState >>= putCommonState . f\n  -- | Output a log message.\n  logOutput :: LogMessage -> m ()\n  -- | Output a debug message to sterr, using 'Debug.Trace.trace',\n  -- if tracing is enabled.  Note: this writes to stderr even in\n  -- pure instances.\n  trace :: T.Text -> m ()\n  trace msg = do\n    tracing <- getsCommonState stTrace\n    when tracing $ Debug.Trace.trace (\"[trace] \" ++ T.unpack msg) (return ())\n\n-- * Functions defined for all PandocMonad instances\n\n-- | Set the verbosity level.\nsetVerbosity :: PandocMonad m => Verbosity -> m ()\nsetVerbosity verbosity =\n  modifyCommonState $ \\st -> st{ stVerbosity = verbosity }\n\n-- | Get the verbosity level.\ngetVerbosity :: PandocMonad m => m Verbosity\ngetVerbosity = getsCommonState stVerbosity\n\n-- | Set tracing. This affects the behavior of 'trace'. If tracing\n-- is not enabled, 'trace' does nothing.\nsetTrace :: PandocMonad m => Bool -> m ()\nsetTrace enabled = modifyCommonState $ \\st -> st{ stTrace = enabled }\n\n-- | Get tracing status.\ngetTrace :: PandocMonad m => m Bool\ngetTrace = getsCommonState stTrace\n\n-- | Get the accumulated log messages (in temporal order).\ngetLog :: PandocMonad m => m [LogMessage]\ngetLog = reverse <$> getsCommonState stLog\n\n-- | Log a message using 'logOutput'.  Note that 'logOutput' is\n-- called only if the verbosity level exceeds the level of the\n-- message, but the message is added to the list of log messages\n-- that will be retrieved by 'getLog' regardless of its verbosity level.\nreport :: PandocMonad m => LogMessage -> m ()\nreport msg = do\n  verbosity <- getsCommonState stVerbosity\n  let level = messageVerbosity msg\n  when (level <= verbosity) $ logOutput msg\n  modifyCommonState $ \\st -> st{ stLog = msg : stLog st }\n\n-- | Run an action, but suppress the output of any log messages;\n-- instead, all messages reported by @action@ are returned separately\n-- and not added to the main log.\nrunSilently :: PandocMonad m => m a -> m (a, [LogMessage])\nrunSilently action = do\n  -- get current settings\n  origLog <- getsCommonState stLog\n  origVerbosity <- getVerbosity\n  -- reset log level and set verbosity to the minimum\n  modifyCommonState (\\st -> st { stVerbosity = ERROR, stLog = []})\n  result <- action\n  -- get log messages reported while running `action`\n  newLog <- getsCommonState stLog\n  modifyCommonState (\\st -> st { stVerbosity = origVerbosity, stLog = origLog})\n\n  return (result, newLog)\n\n-- | Set request header to use in HTTP requests.\nsetRequestHeader :: PandocMonad m\n                 => T.Text  -- ^ Header name\n                 -> T.Text  -- ^ Value\n                 -> m ()\nsetRequestHeader name val = modifyCommonState $ \\st ->\n  st{ stRequestHeaders =\n       (name, val) : filter (\\(n,_) -> n /= name) (stRequestHeaders st)  }\n\n-- | Determine whether certificate validation is disabled\nsetNoCheckCertificate :: PandocMonad m => Bool -> m ()\nsetNoCheckCertificate noCheckCertificate = modifyCommonState $ \\st -> st{stNoCheckCertificate = noCheckCertificate}\n\n-- | Initialize the media bag.\nsetMediaBag :: PandocMonad m => MediaBag -> m ()\nsetMediaBag mb = modifyCommonState $ \\st -> st{stMediaBag = mb}\n\n-- | Retrieve the media bag.\ngetMediaBag :: PandocMonad m => m MediaBag\ngetMediaBag = getsCommonState stMediaBag\n\n-- | Insert an item into the media bag.\ninsertMedia :: PandocMonad m => FilePath -> Maybe MimeType -> BL.ByteString -> m ()\ninsertMedia fp mime bs = do\n  mb <- getMediaBag\n  let mb' = MB.insertMedia fp mime bs mb\n  setMediaBag mb'\n\n-- | Retrieve the input filenames.\ngetInputFiles :: PandocMonad m => m [FilePath]\ngetInputFiles = getsCommonState stInputFiles\n\n-- | Set the input filenames.\nsetInputFiles :: PandocMonad m => [FilePath] -> m ()\nsetInputFiles fs = do\n  let sourceURL = case fs of\n                    []    -> Nothing\n                    (x:_) -> case parseURI x of\n                                Just u\n                                  | uriScheme u `elem` [\"http:\",\"https:\"] ->\n                                      Just $ show u{ uriQuery = \"\",\n                                                     uriFragment = \"\" }\n                                _ -> Nothing\n\n  modifyCommonState $ \\st -> st{ stInputFiles = fs\n                               , stSourceURL = T.pack <$> sourceURL }\n\n-- | Retrieve the output filename.\ngetOutputFile :: PandocMonad m => m (Maybe FilePath)\ngetOutputFile = getsCommonState stOutputFile\n\n-- | Set the output filename.\nsetOutputFile :: PandocMonad m => Maybe FilePath -> m ()\nsetOutputFile mbf = modifyCommonState $ \\st -> st{ stOutputFile = mbf }\n\n-- | Retrieve the resource path searched by 'fetchItem'.\ngetResourcePath :: PandocMonad m => m [FilePath]\ngetResourcePath = getsCommonState stResourcePath\n\n-- | Set the resource path searched by 'fetchItem'.\nsetResourcePath :: PandocMonad m => [FilePath] -> m ()\nsetResourcePath ps = modifyCommonState $ \\st -> st{stResourcePath = ps}\n\n-- | Retrieve the request headers to add for HTTP requests.\ngetRequestHeaders :: PandocMonad m => m [(T.Text, T.Text)]\ngetRequestHeaders = getsCommonState stRequestHeaders\n\n-- | Set the request headers to add for HTTP requests.\nsetRequestHeaders :: PandocMonad m => [(T.Text, T.Text)] -> m ()\nsetRequestHeaders hs = modifyCommonState $ \\st -> st{ stRequestHeaders = hs }\n\n-- | Get the absolute UL or directory of first source file.\ngetSourceURL :: PandocMonad m => m (Maybe T.Text)\ngetSourceURL = getsCommonState stSourceURL\n\n-- | Get the current UTC time. If the @SOURCE_DATE_EPOCH@ environment\n-- variable is set to a unix time (number of seconds since midnight\n-- Jan 01 1970 UTC), it is used instead of the current time, to support\n-- reproducible builds.\ngetTimestamp :: PandocMonad m => m UTCTime\ngetTimestamp = do\n  mbSourceDateEpoch <- lookupEnv \"SOURCE_DATE_EPOCH\"\n  case mbSourceDateEpoch >>= safeRead of\n    Just (epoch :: Integer) ->\n      return $ posixSecondsToUTCTime $ fromIntegral epoch\n    Nothing -> getCurrentTime\n\n-- | Get the POSIX time. If @SOURCE_DATE_EPOCH@ is set to a unix time,\n-- it is used instead of the current time.\ngetPOSIXTime :: PandocMonad m => m POSIXTime\ngetPOSIXTime = utcTimeToPOSIXSeconds <$> getTimestamp\n\n-- | Get the zoned time. If @SOURCE_DATE_EPOCH@ is set to a unix time,\n-- value (POSIX time), it is used instead of the current time.\ngetZonedTime :: PandocMonad m => m ZonedTime\ngetZonedTime = do\n  t <- getTimestamp\n  tz <- getCurrentTimeZone\n  return $ utcToZonedTime tz t\n\n-- | Read file, checking in any number of directories.\nreadFileFromDirs :: PandocMonad m => [FilePath] -> FilePath -> m (Maybe T.Text)\nreadFileFromDirs [] _ = return Nothing\nreadFileFromDirs (d:ds) f = catchError\n    (Just <$> (readFileStrict (d </> f) >>= toTextM (d </> f)))\n    (\\_ -> readFileFromDirs ds f)\n\n-- | Convert BCP47 string to a Lang, issuing warning\n-- if there are problems.\ntoLang :: PandocMonad m => Maybe T.Text -> m (Maybe Lang)\ntoLang Nothing = return Nothing\ntoLang (Just s) =\n  case parseLang s of\n       Left _ -> do\n         report $ InvalidLang s\n         return Nothing\n       Right l -> return (Just l)\n\n-- | Specialized version of parseURIReference that disallows\n-- single-letter schemes.  Reason:  these are usually windows absolute\n-- paths.\nparseURIReference' :: T.Text -> Maybe URI\nparseURIReference' s = do\n  u <- parseURIReference (T.unpack s)\n  case uriScheme u of\n       [_] -> Nothing\n       _   -> Just u\n\n-- | Set the user data directory in common state.\nsetUserDataDir :: PandocMonad m\n               => Maybe FilePath\n               -> m ()\nsetUserDataDir mbfp = modifyCommonState $ \\st -> st{ stUserDataDir = mbfp }\n\n-- | Get the user data directory from common state.\ngetUserDataDir :: PandocMonad m\n               => m (Maybe FilePath)\ngetUserDataDir = getsCommonState stUserDataDir\n\n-- | Fetch an image or other item from the local filesystem or the net.\n-- Returns raw content and maybe mime type.\nfetchItem :: PandocMonad m\n          => T.Text\n          -> m (B.ByteString, Maybe MimeType)\nfetchItem s = do\n  mediabag <- getMediaBag\n  case lookupMedia (T.unpack s) mediabag of\n    Just item -> return (BL.toStrict (mediaContents item),\n                         Just (mediaMimeType item))\n    Nothing -> downloadOrRead s\n\n-- | Returns the content and, if available, the MIME type of a resource.\n-- If the given resource location is a valid URI, then download the\n-- resource from that URI. Otherwise, treat the resource identifier as a\n-- local file name.\n--\n-- Note that resources are treated relative to the URL of the first\n-- input source, if any.\ndownloadOrRead :: PandocMonad m\n               => T.Text\n               -> m (B.ByteString, Maybe MimeType)\ndownloadOrRead s\n | \"data:\" `T.isPrefixOf` s,\n   Right (bs, mt) <- A.parseOnly (pBase64DataURI <* A.endOfInput) s\n   = pure (bs, Just mt)\n | otherwise = do\n  sourceURL <- getsCommonState stSourceURL\n  case (sourceURL >>= parseURIReference' . ensureEscaped, ensureEscaped s) of\n    (Just u, s') -> -- try fetching from relative path at source\n       case parseURIReference' s' of\n            Just u' -> openURL $ T.pack $ show $ u' `nonStrictRelativeTo` u\n            Nothing -> openURL s' -- will throw error\n    (Nothing, s'@(T.unpack -> ('/':'/':c:_))) | c /= '?' ->  -- protocol-relative URI\n                -- we exclude //? because of //?UNC/ on Windows\n       case parseURIReference' s' of\n            Just u' -> openURL $ T.pack $ show $ u' `nonStrictRelativeTo` httpcolon\n            Nothing -> openURL s' -- will throw error\n    (Nothing, s') ->\n       case parseURI (T.unpack s') of  -- requires absolute URI\n            Just URI{ uriScheme = \"file:\", uriPath = upath}\n              -> readLocalFile $ uriPathToPath (T.pack upath)\n            Just URI{ uriScheme = \"data:\", uriPath = upath}\n              -> pure $ extractURIData upath\n            -- We don't want to treat C:/ as a scheme:\n            Just u' | length (uriScheme u') > 2 -> openURL (T.pack $ show u')\n            _ -> readLocalFile fp -- get from local file system\n   where readLocalFile f = do\n             resourcePath <- getResourcePath\n             (fp', cont) <- if isRelative f\n                               then withPaths resourcePath readFileStrict f\n                               else (f,) <$> readFileStrict f\n             report $ LoadedResource f (makeRelative \".\" fp')\n             return (cont, mime)\n         httpcolon = URI{ uriScheme = \"http:\",\n                          uriAuthority = Nothing,\n                          uriPath = \"\",\n                          uriQuery = \"\",\n                          uriFragment = \"\" }\n         fp = unEscapeString $ T.unpack s\n         mime = getMimeType $ case takeExtension fp of\n                     \".gz\" -> dropExtension fp\n                     \".svgz\" -> dropExtension fp ++ \".svg\"\n                     x     -> x\n         ensureEscaped = T.pack . escapeURIString isAllowedInURI . T.unpack . T.map convertSlash\n         convertSlash '\\\\' = '/'\n         convertSlash x    = x\n\n-- Extract data from a data URI's path component.\nextractURIData :: String -> (B.ByteString, Maybe MimeType)\nextractURIData upath =\n  case break (== ';') (filter (/= ' ') mimespec) of\n     (mime', \";base64\") -> (decodeLenient contents, Just (T.pack mime'))\n     (mime', _) -> (contents, Just (T.pack mime'))\n  where\n    (mimespec, rest) = break (== ',') $ unEscapeString upath\n    contents = UTF8.fromString $ drop 1 rest\n\n-- | Checks if the file path is relative to a parent directory.\nisRelativeToParentDir :: FilePath -> Bool\nisRelativeToParentDir fname =\n  let canonical = makeCanonical fname\n   in length canonical >= 2 && take 2 canonical == \"..\"\n\n-- | Returns possible user data directory if the file path refers to a file or\n-- subdirectory within it.\ncheckUserDataDir :: PandocMonad m => FilePath -> m (Maybe FilePath)\ncheckUserDataDir fname =\n  if isRelative fname && not (isRelativeToParentDir fname)\n     then getUserDataDir\n     else return Nothing\n\n-- | Read metadata file from the working directory or, if not found there, from\n-- the metadata subdirectory of the user data directory.\nreadMetadataFile :: PandocMonad m => FilePath -> m B.ByteString\nreadMetadataFile fname = findFileWithDataFallback \"metadata\" fname >>= \\case\n  Nothing -> throwError $ PandocCouldNotFindMetadataFileError (T.pack fname)\n  Just metadataFile -> readFileStrict metadataFile\n\n-- | Tries to run an action on a file: for each directory given, a\n-- filepath is created from the given filename, and the action is run on\n-- that filepath. Returns the result of the first successful execution\n-- of the action, or throws a @PandocResourceNotFound@ exception if the\n-- action errors for all filepaths.\nwithPaths :: PandocMonad m\n          => [FilePath] -> (FilePath -> m a) -> FilePath -> m (FilePath, a)\nwithPaths [] _ fp = throwError $ PandocResourceNotFound $ T.pack fp\nwithPaths (p:ps) action fp =\n  catchError ((p </> fp,) <$> action (p </> fp))\n             (\\_ -> withPaths ps action fp)\n\n-- | A variant of Text.Pandoc.UTF8.toText that takes a FilePath\n-- as well as the file's contents as parameter, and traps UTF8\n-- decoding errors so it can issue a more informative PandocUTF8DecodingError\n-- with source position.\ntoTextM :: PandocMonad m => FilePath -> B.ByteString -> m T.Text\ntoTextM fp bs =\n  case TSE.decodeUtf8' . filterCRs . dropBOM $ bs of\n    Left (TSE.DecodeError _ (Just w)) ->\n      case B.elemIndex w bs of\n        Just offset ->\n          throwError $ PandocUTF8DecodingError (T.pack fp) offset w\n        Nothing -> throwError $ PandocUTF8DecodingError (T.pack fp) 0 w\n    Left e -> throwError $ PandocAppError (tshow e)\n    Right t -> return t\n where\n   dropBOM bs' =\n     if \"\\xEF\\xBB\\xBF\" `B.isPrefixOf` bs'\n        then B.drop 3 bs'\n        else bs'\n   filterCRs = B.filter (/=13)\n\n-- | Returns @fp@ if the file exists in the current directory; otherwise\n-- searches for the data file relative to @/subdir/@. Returns @Nothing@\n-- if neither file exists.\nfindFileWithDataFallback :: PandocMonad m\n                         => FilePath  -- ^ subdir\n                         -> FilePath  -- ^ fp\n                         -> m (Maybe FilePath)\nfindFileWithDataFallback subdir fp = do\n  -- First we check to see if the file is found. If not, and if it's not\n  -- an absolute path, we check to see whether it's in @userdir/@. If\n  -- not, we leave it unchanged.\n  existsInWorkingDir <- fileExists fp\n  if existsInWorkingDir\n     then return $ Just fp\n     else do\n       mbDataDir <- checkUserDataDir fp\n       case mbDataDir of\n         Nothing -> return Nothing\n         Just datadir -> do\n           let datafp = datadir </> subdir </> fp\n           existsInDataDir <- fileExists datafp\n           return $ if existsInDataDir\n                    then Just datafp\n                    else Nothing\n\n-- | Traverse tree, filling media bag for any images that\n-- aren't already in the media bag.\nfillMediaBag :: PandocMonad m => Pandoc -> m Pandoc\nfillMediaBag d = walkM handleImage d\n  where handleImage :: PandocMonad m => Inline -> m Inline\n        handleImage (Image attr lab (src, tit)) = catchError\n          (do mediabag <- getMediaBag\n              let fp = T.unpack src\n              case lookupMedia fp mediabag of\n                Just _ -> return ()\n                Nothing -> do\n                  (bs, mt) <- fetchItem src\n                  insertMedia fp mt (BL.fromStrict bs)\n              return $ Image attr lab (src, tit))\n          (\\e ->\n              case e of\n                PandocIOError text err -> do\n                  report $ CouldNotFetchResource text . T.pack $\n                            (show err ++ \"\\nReplacing image with description.\")\n                  -- emit alt text\n                  return $ replacementSpan attr src tit lab\n                PandocResourceNotFound _ -> do\n                  report $ CouldNotFetchResource src\n                            \"replacing image with description\"\n                  -- emit alt text\n                  return $ replacementSpan attr src tit lab\n                PandocHttpError u er -> do\n                  report $ CouldNotFetchResource u\n                            (er <> \"\\nReplacing image with description.\")\n                  -- emit alt text\n                  return $ replacementSpan attr src tit lab\n                _ -> throwError e)\n        handleImage x = return x\n\n        replacementSpan (ident, classes, attribs) src title descr =\n          Span ( ident\n               , \"image\":\"placeholder\":classes\n               , (\"original-image-src\", src) :\n                 (\"original-image-title\", title) :\n                 attribs\n               )\n               descr\n\n-- This requires UndecidableInstances.  We could avoid that\n-- by repeating the definitions below for every monad transformer\n-- we use: ReaderT, WriterT, StateT, RWST.  But this seems to\n-- be harmless.\ninstance (MonadTrans t, PandocMonad m, Functor (t m),\n          MonadError PandocError (t m), Monad (t m),\n          Applicative (t m)) => PandocMonad (t m) where\n  lookupEnv = lift . lookupEnv\n  getCurrentTime = lift getCurrentTime\n  getCurrentTimeZone = lift getCurrentTimeZone\n  newStdGen = lift newStdGen\n  newUniqueHash = lift newUniqueHash\n  openURL = lift . openURL\n  readFileLazy = lift . readFileLazy\n  readFileStrict = lift . readFileStrict\n  readStdinStrict = lift readStdinStrict\n  glob = lift . glob\n  fileExists = lift . fileExists\n  getDataFileName = lift . getDataFileName\n  getModificationTime = lift . getModificationTime\n  getCommonState = lift getCommonState\n  putCommonState = lift . putCommonState\n  logOutput = lift . logOutput\n\ninstance {-# OVERLAPS #-} PandocMonad m => PandocMonad (ParsecT s st m) where\n  lookupEnv = lift . lookupEnv\n  getCurrentTime = lift getCurrentTime\n  getCurrentTimeZone = lift getCurrentTimeZone\n  newStdGen = lift newStdGen\n  newUniqueHash = lift newUniqueHash\n  openURL = lift . openURL\n  readFileLazy = lift . readFileLazy\n  readFileStrict = lift . readFileStrict\n  readStdinStrict = lift readStdinStrict\n  glob = lift . glob\n  fileExists = lift . fileExists\n  getDataFileName = lift . getDataFileName\n  getModificationTime = lift . getModificationTime\n  getCommonState = lift getCommonState\n  putCommonState = lift . putCommonState\n  trace msg = do\n    tracing <- getsCommonState stTrace\n    when tracing $ do\n      pos <- getPosition\n      Debug.Trace.trace\n        (\"[trace] Parsed \" ++ T.unpack msg ++ \" at line \" ++\n            show (sourceLine pos) ++\n            if sourceName pos == \"chunk\"\n               then \" of chunk\"\n               else \"\")\n        (return ())\n  logOutput = lift . logOutput\n"
  },
  {
    "path": "src/Text/Pandoc/Class/PandocPure.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE DeriveFunctor #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\nModule      : Text.Pandoc.Class.PandocPure\nCopyright   : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\nStability   : alpha\nPortability : portable\n\nThis module defines a pure instance 'PandocPure' of the @'PandocMonad'@\ntypeclass. This instance is useful for testing, or when all IO access is\nprohibited for security reasons.\n-}\nmodule Text.Pandoc.Class.PandocPure\n  ( PureState(..)\n  , getPureState\n  , getsPureState\n  , putPureState\n  , modifyPureState\n  , PandocPure(..)\n  , FileTree\n  , FileInfo(..)\n  , addToFileTree\n  , insertInFileTree\n  , runPure\n  ) where\n\nimport Codec.Archive.Zip\nimport Control.Monad.Trans ( MonadTrans(lift) )\nimport Control.Monad.Except\n    ( ExceptT(..), MonadError(throwError), runExceptT )\nimport Control.Monad.State.Strict\n    ( StateT(StateT),\n      State,\n      MonadState(put, get),\n      modify,\n      evalState,\n      evalStateT )\nimport Control.Monad (foldM)\nimport Data.Default\nimport Data.Text (Text)\nimport Data.Time (UTCTime)\nimport Data.Time.Clock.POSIX ( posixSecondsToUTCTime )\nimport Data.Time.LocalTime (TimeZone, utc)\nimport Data.Word (Word8)\nimport System.Directory (doesDirectoryExist, getDirectoryContents)\nimport System.FilePath ((</>))\nimport System.FilePath.Glob (match, compile)\nimport System.Random (StdGen, mkStdGen)\nimport Text.Pandoc.Class.CommonState (CommonState (..))\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Error\nimport qualified Data.ByteString as B\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport qualified System.Directory as Directory (getModificationTime)\n\n#if MIN_VERSION_random(1,3,0)\nimport System.Random (splitGen, SplitGen)\n\nsplit :: SplitGen g => g -> (g, g)\nsplit = splitGen\n#else\nimport System.Random (split)\n#endif\n\n-- | The 'PureState' contains ersatz representations\n-- of things that would normally be obtained through IO.\ndata PureState = PureState\n  { stStdGen     :: StdGen\n  , stWord8Store :: [Word8]    -- ^ should be infinite, i.e. [1..]\n  , stUniqStore  :: [Int]      -- ^ should be infinite and contain every\n                               -- element at most once, e.g. [1..]\n  , stEnv :: [(Text, Text)]\n  , stTime :: UTCTime\n  , stTimeZone :: TimeZone\n  , stReferenceDocx :: Archive\n  , stReferencePptx :: Archive\n  , stReferenceODT :: Archive\n  , stFiles :: FileTree\n  , stStdin :: B.ByteString\n  , stUserDataFiles :: FileTree\n  , stCabalDataFiles :: FileTree\n  }\n\ninstance Default PureState where\n  def = PureState\n        { stStdGen = mkStdGen 1848\n        , stWord8Store = [1..]\n        , stUniqStore = [1..]\n        , stEnv = [(\"USER\", \"pandoc-user\")]\n        , stTime = posixSecondsToUTCTime 0\n        , stTimeZone = utc\n        , stReferenceDocx = emptyArchive\n        , stReferencePptx = emptyArchive\n        , stReferenceODT = emptyArchive\n        , stFiles = mempty\n        , stStdin = mempty\n        , stUserDataFiles = mempty\n        , stCabalDataFiles = mempty\n        }\n\n\n-- | Retrieve the underlying state of the @'PandocPure'@ type.\ngetPureState :: PandocPure PureState\ngetPureState = PandocPure $ lift $ lift get\n\n-- | Retrieve a value from the underlying state of the @'PandocPure'@\n-- type.\ngetsPureState :: (PureState -> a) -> PandocPure a\ngetsPureState f = f <$> getPureState\n\n-- | Set a new state for the @'PandocPure'@ type.\nputPureState :: PureState -> PandocPure ()\nputPureState ps= PandocPure $ lift $ lift $ put ps\n\n-- | Modify the underlying state of the @'PandocPure'@ type.\nmodifyPureState :: (PureState -> PureState) -> PandocPure ()\nmodifyPureState f = PandocPure $ lift $ lift $ modify f\n\n-- | Captures all file-level information necessary for a @'PandocMonad'@\n-- conforming mock file system.\ndata FileInfo = FileInfo\n  { infoFileMTime :: UTCTime\n  , infoFileContents :: B.ByteString\n  }\n\n-- | Basis of the mock file system used by @'PandocPure'@.\nnewtype FileTree = FileTree { unFileTree :: M.Map FilePath FileInfo }\n  deriving (Semigroup, Monoid)\n\n-- | Retrieve @'FileInfo'@ of the given @'FilePath'@ from a\n-- @'FileTree'@.\ngetFileInfo :: FilePath -> FileTree -> Maybe FileInfo\ngetFileInfo fp tree =\n  M.lookup (makeCanonical fp) (unFileTree tree)\n\n-- | Add the specified file to the FileTree. If file\n-- is a directory, add its contents recursively.\naddToFileTree :: FileTree -> FilePath -> IO FileTree\naddToFileTree tree fp = do\n  isdir <- doesDirectoryExist fp\n  if isdir\n     then do -- recursively add contents of directories\n       let isSpecial \"..\" = True\n           isSpecial \".\"  = True\n           isSpecial _    = False\n       fs <- map (fp </>) . filter (not . isSpecial) <$> getDirectoryContents fp\n       foldM addToFileTree tree fs\n     else do\n       contents <- B.readFile fp\n       mtime <- Directory.getModificationTime fp\n       return $ insertInFileTree fp FileInfo{ infoFileMTime = mtime\n                                            , infoFileContents = contents } tree\n\n-- | Insert an ersatz file into the 'FileTree'.\ninsertInFileTree :: FilePath -> FileInfo -> FileTree -> FileTree\ninsertInFileTree fp info (FileTree treemap) =\n  FileTree $ M.insert (makeCanonical fp) info treemap\n\nnewtype PandocPure a = PandocPure {\n  unPandocPure :: ExceptT PandocError\n                  (StateT CommonState (State PureState)) a\n  } deriving ( Functor\n             , Applicative\n             , Monad\n             , MonadError PandocError\n             )\n\n-- | Run a 'PandocPure' operation.\nrunPure :: PandocPure a -> Either PandocError a\nrunPure x = flip evalState def $\n            flip evalStateT def $\n            runExceptT $\n            unPandocPure x\n\ninstance PandocMonad PandocPure where\n  lookupEnv s = do\n    env <- getsPureState stEnv\n    return (lookup s env)\n\n  getCurrentTime = getsPureState stTime\n\n  getCurrentTimeZone = getsPureState stTimeZone\n\n  newStdGen = do\n    oldGen <- getsPureState stStdGen\n    let (genToStore, genToReturn) = split oldGen\n    modifyPureState $ \\st -> st { stStdGen = genToStore }\n    return genToReturn\n\n  newUniqueHash = do\n    uniqs <- getsPureState stUniqStore\n    case uniqs of\n      u : us -> do\n        modifyPureState $ \\st -> st { stUniqStore = us }\n        return u\n      _ -> throwError $ PandocShouldNeverHappenError\n                        \"uniq store ran out of elements\"\n  openURL u = throwError $ PandocResourceNotFound u\n  readFileLazy fp = do\n    fps <- getsPureState stFiles\n    case infoFileContents <$> getFileInfo fp fps of\n      Just bs -> return (BL.fromStrict bs)\n      Nothing -> throwError $ PandocResourceNotFound $ T.pack fp\n  readFileStrict fp = do\n    fps <- getsPureState stFiles\n    case infoFileContents <$> getFileInfo fp fps of\n      Just bs -> return bs\n      Nothing -> throwError $ PandocResourceNotFound $ T.pack fp\n\n  readStdinStrict = getsPureState stStdin\n\n  glob s = do\n    FileTree ftmap <- getsPureState stFiles\n    return $ filter (match (compile s)) $ M.keys ftmap\n\n  fileExists fp = do\n    fps <- getsPureState stFiles\n    case getFileInfo fp fps of\n         Nothing -> return False\n         Just _  -> return True\n\n  getDataFileName fp = return $ \"data/\" ++ fp\n\n  getModificationTime fp = do\n    fps <- getsPureState stFiles\n    case infoFileMTime <$> getFileInfo fp fps of\n      Just tm -> return tm\n      Nothing -> throwError $ PandocIOError (T.pack fp)\n                    (userError \"Can't get modification time\")\n\n  getCommonState = PandocPure $ lift get\n  putCommonState x = PandocPure $ lift $ put x\n\n  logOutput _msg = return ()\n"
  },
  {
    "path": "src/Text/Pandoc/Class/Sandbox.hs",
    "content": "{- |\nModule      : Text.Pandoc.Class.Sandbox\nCopyright   : Copyright (C) 2021-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane (<jgm@berkeley.edu>)\nStability   : alpha\nPortability : portable\n\nThis module provides a way to run PandocMonad actions in a sandbox\n(pure context, with no IO allowed and access only to designated files).\n-}\n\nmodule Text.Pandoc.Class.Sandbox\n  ( sandbox\n  , sandboxWithFileTree\n  )\nwhere\n\nimport Control.Monad (foldM)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.IO.Class (MonadIO (liftIO))\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Class.PandocPure\nimport Text.Pandoc.Class.CommonState (CommonState(..))\nimport Text.Pandoc.Logging (messageVerbosity)\n\n-- | Lift a PandocPure action into any instance of PandocMonad.\n-- The main computation is done purely, but CommonState is preserved\n-- continuously, and warnings are emitted after the action completes.\n-- The parameter is a list of FilePaths which will be added to the\n-- ersatz file system and be available for reading.\nsandbox :: (PandocMonad m, MonadIO m) => [FilePath] -> PandocPure a -> m a\nsandbox files action = do\n  tree <- liftIO $ foldM addToFileTree mempty files\n  sandboxWithFileTree tree action\n\n-- | Lift a PandocPure action into any instance of PandocMonad.\n-- The main computation is done purely, but CommonState is preserved\n-- continuously, and warnings are emitted after the action completes.\n-- The parameter is an ersatz file system which will be available for\n-- reading.\nsandboxWithFileTree :: (PandocMonad m, MonadIO m)\n                    => FileTree -> PandocPure a -> m a\nsandboxWithFileTree tree action = do\n  oldState <- getCommonState\n  case runPure (do putCommonState oldState\n                   modifyPureState $ \\ps -> ps{ stFiles = tree }\n                   result <- action\n                   st <- getCommonState\n                   return (st, result)) of\n          Left e -> throwError e\n          Right (st, result) -> do\n            putCommonState st\n            let verbosity = stVerbosity st\n            -- emit warnings, since these are not printed in runPure\n            let newMessages = reverse $ take\n                  (length (stLog st) - length (stLog oldState)) (stLog st)\n            mapM_ logOutput\n              (filter ((<= verbosity) . messageVerbosity) newMessages)\n            return result\n"
  },
  {
    "path": "src/Text/Pandoc/Class.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Class\n   Copyright   : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nThis module defines a type class, 'PandocMonad', for pandoc readers\nand writers. A pure instance 'PandocPure' and an impure instance\n'PandocIO' are provided.  This allows users of the library to choose\nwhether they want conversions to perform IO operations (such as\nreading include files or images).\n-}\n\nmodule Text.Pandoc.Class\n  ( module Text.Pandoc.Class.CommonState\n  , module Text.Pandoc.Class.PandocIO\n  , module Text.Pandoc.Class.PandocMonad\n  , module Text.Pandoc.Class.PandocPure\n  , module Text.Pandoc.Class.Sandbox\n  , Translations\n  ) where\n\n-- We export CommonState as an opaque object.  Accessors for\n-- its fields are provided in Text.Pandoc.Class.PandocMonad.\nimport Text.Pandoc.Class.CommonState (CommonState)\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Class.PandocIO\nimport Text.Pandoc.Class.PandocPure\nimport Text.Pandoc.Translations.Types (Translations)\nimport Text.Pandoc.Class.Sandbox\n"
  },
  {
    "path": "src/Text/Pandoc/Data/BakedIn.hs",
    "content": "{-# LANGUAGE TemplateHaskell #-}\n{- |\nModule      : Text.Pandoc.Data.BakedIn\nCopyright   : Copyright (C) 2013-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane <jgm@berkeley@edu>\nStability   : alpha\nPortability : portable\n\nProvide contents data files as Haskell values.\n-}\nmodule Text.Pandoc.Data.BakedIn (dataFiles) where\n\nimport qualified Data.ByteString as B\nimport Data.FileEmbed\nimport System.FilePath (splitDirectories)\nimport qualified System.FilePath.Posix as Posix\n\n-- We ensure that the data files are stored using Posix\n-- path separators (/), even on Windows.\ndataFiles :: [(FilePath, B.ByteString)]\ndataFiles = map (\\(fp, contents) ->\n  (Posix.joinPath (splitDirectories fp), contents)) dataFiles'\n\ndataFiles' :: [(FilePath, B.ByteString)]\ndataFiles' = (\"MANUAL.txt\", $(embedFile \"MANUAL.txt\")) :\n             -- handle the hidden file separately, since embedDir doesn't\n             -- include it:\n             (\"docx/_rels/.rels\", $(embedFile \"data/docx/_rels/.rels\")) :\n             (\"pptx/_rels/.rels\", $(embedFile \"data/pptx/_rels/.rels\")) :\n             $(embedDir \"data\")\n"
  },
  {
    "path": "src/Text/Pandoc/Data.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n#ifdef EMBED_DATA_FILES\n{-# LANGUAGE TemplateHaskell #-}\n#endif\n{- |\nModule      : Text.Pandoc.Data\nCopyright   : Copyright (C) 2013-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane <jgm@berkeley@edu>\nStability   : alpha\nPortability : portable\n\nAccess to pandoc's data files.\n-}\nmodule Text.Pandoc.Data ( readDefaultDataFile\n                        , readDataFile\n                        , getDataFileNames\n                        , defaultUserDataDir\n                        ) where\nimport Text.Pandoc.Class (PandocMonad(..), checkUserDataDir, getTimestamp,\n                          getUserDataDir, getPOSIXTime)\nimport Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.ByteString as B\nimport Codec.Archive.Zip\nimport qualified Data.Text as T\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Error (PandocError(..))\nimport System.FilePath\nimport System.Directory\nimport qualified Control.Exception as E\n#ifdef EMBED_DATA_FILES\nimport Text.Pandoc.Data.BakedIn (dataFiles)\nimport Text.Pandoc.Shared (makeCanonical)\n#else\nimport Paths_pandoc (getDataDir)\n#endif\n\n-- | Read file from the default data files.\nreadDefaultDataFile :: PandocMonad m => FilePath -> m B.ByteString\nreadDefaultDataFile \"reference.docx\" =\n  B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceDocx\nreadDefaultDataFile \"reference.pptx\" =\n  B.concat . BL.toChunks . fromArchive <$> getDefaultReferencePptx\nreadDefaultDataFile \"reference.odt\" =\n  B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceODT\nreadDefaultDataFile fname =\n#ifdef EMBED_DATA_FILES\n  case lookup (makeCanonical fname) dataFiles of\n    Nothing       -> throwError $ PandocCouldNotFindDataFileError $ T.pack fname\n    Just contents -> return contents\n#else\n  getDataFileName fname' >>= checkExistence >>= readFileStrict\n    where fname' = if fname == \"MANUAL.txt\" then fname else \"data\" </> fname\n\n-- | Returns the input filename unchanged if the file exits, and throws\n-- a `PandocCouldNotFindDataFileError` if it doesn't.\ncheckExistence :: PandocMonad m => FilePath -> m FilePath\ncheckExistence fn = do\n  exists <- fileExists fn\n  if exists\n     then return fn\n     else throwError $ PandocCouldNotFindDataFileError $ T.pack fn\n#endif\n\n--- | Read file from user data directory or,\n--- if not found there, from the default data files.\nreadDataFile :: PandocMonad m => FilePath -> m B.ByteString\nreadDataFile fname = do\n  datadir <- checkUserDataDir fname\n  case datadir of\n       Nothing -> readDefaultDataFile fname\n       Just userDir -> do\n         exists <- fileExists (userDir </> fname)\n         if exists\n            then readFileStrict (userDir </> fname)\n            else readDefaultDataFile fname\n\n-- | Retrieve default reference.docx.\ngetDefaultReferenceDocx :: PandocMonad m => m Archive\ngetDefaultReferenceDocx = do\n  let paths = [\"[Content_Types].xml\",\n               \"_rels/.rels\",\n               \"docProps/app.xml\",\n               \"docProps/core.xml\",\n               \"docProps/custom.xml\",\n               \"word/document.xml\",\n               \"word/fontTable.xml\",\n               \"word/footnotes.xml\",\n               \"word/comments.xml\",\n               \"word/numbering.xml\",\n               \"word/settings.xml\",\n               \"word/webSettings.xml\",\n               \"word/styles.xml\",\n               \"word/_rels/document.xml.rels\",\n               \"word/_rels/footnotes.xml.rels\",\n               \"word/theme/theme1.xml\"]\n  let toLazy = BL.fromChunks . (:[])\n  let pathToEntry path = do\n        epochtime <- floor . utcTimeToPOSIXSeconds <$> getTimestamp\n        contents <- toLazy <$> readDataFile (\"docx/\" ++ path)\n        return $ toEntry path epochtime contents\n  datadir <- getUserDataDir\n  mbArchive <- case datadir of\n                    Nothing   -> return Nothing\n                    Just d    -> do\n                       exists <- fileExists (d </> \"reference.docx\")\n                       if exists\n                          then return (Just (d </> \"reference.docx\"))\n                          else return Nothing\n  case mbArchive of\n     Just arch -> toArchive <$> readFileLazy arch\n     Nothing   -> foldr addEntryToArchive emptyArchive <$>\n                     mapM pathToEntry paths\n\n-- | Retrieve default reference.odt.\ngetDefaultReferenceODT :: PandocMonad m => m Archive\ngetDefaultReferenceODT = do\n  let paths = [\"mimetype\",\n               \"manifest.rdf\",\n               \"styles.xml\",\n               \"content.xml\",\n               \"meta.xml\",\n               \"META-INF/manifest.xml\"]\n  let pathToEntry path = do epochtime <- floor `fmap` getPOSIXTime\n                            contents <- (BL.fromChunks . (:[])) `fmap`\n                                          readDataFile (\"odt/\" ++ path)\n                            return $ toEntry path epochtime contents\n  datadir <- getUserDataDir\n  mbArchive <- case datadir of\n                    Nothing   -> return Nothing\n                    Just d    -> do\n                       exists <- fileExists (d </> \"reference.odt\")\n                       if exists\n                          then return (Just (d </> \"reference.odt\"))\n                          else return Nothing\n  case mbArchive of\n     Just arch -> toArchive <$> readFileLazy arch\n     Nothing   -> foldr addEntryToArchive emptyArchive <$>\n                     mapM pathToEntry paths\n\n-- | Retrieve default reference.pptx.\ngetDefaultReferencePptx :: PandocMonad m => m Archive\ngetDefaultReferencePptx = do\n  -- We're going to narrow this down substantially once we get it\n  -- working.\n  let paths = [ \"[Content_Types].xml\"\n              , \"_rels/.rels\"\n              , \"docProps/app.xml\"\n              , \"docProps/core.xml\"\n              , \"ppt/_rels/presentation.xml.rels\"\n              , \"ppt/presProps.xml\"\n              , \"ppt/presentation.xml\"\n              , \"ppt/slideLayouts/_rels/slideLayout1.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout2.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout3.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout4.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout5.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout6.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout7.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout8.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout9.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout10.xml.rels\"\n              , \"ppt/slideLayouts/_rels/slideLayout11.xml.rels\"\n              , \"ppt/slideLayouts/slideLayout1.xml\"\n              , \"ppt/slideLayouts/slideLayout10.xml\"\n              , \"ppt/slideLayouts/slideLayout11.xml\"\n              , \"ppt/slideLayouts/slideLayout2.xml\"\n              , \"ppt/slideLayouts/slideLayout3.xml\"\n              , \"ppt/slideLayouts/slideLayout4.xml\"\n              , \"ppt/slideLayouts/slideLayout5.xml\"\n              , \"ppt/slideLayouts/slideLayout6.xml\"\n              , \"ppt/slideLayouts/slideLayout7.xml\"\n              , \"ppt/slideLayouts/slideLayout8.xml\"\n              , \"ppt/slideLayouts/slideLayout9.xml\"\n              , \"ppt/slideMasters/_rels/slideMaster1.xml.rels\"\n              , \"ppt/slideMasters/slideMaster1.xml\"\n              , \"ppt/slides/_rels/slide1.xml.rels\"\n              , \"ppt/slides/slide1.xml\"\n              , \"ppt/slides/_rels/slide2.xml.rels\"\n              , \"ppt/slides/slide2.xml\"\n              , \"ppt/slides/_rels/slide3.xml.rels\"\n              , \"ppt/slides/slide3.xml\"\n              , \"ppt/slides/_rels/slide4.xml.rels\"\n              , \"ppt/slides/slide4.xml\"\n              , \"ppt/tableStyles.xml\"\n              , \"ppt/theme/theme1.xml\"\n              , \"ppt/viewProps.xml\"\n              -- These relate to notes slides.\n              , \"ppt/notesMasters/notesMaster1.xml\"\n              , \"ppt/notesMasters/_rels/notesMaster1.xml.rels\"\n              , \"ppt/notesSlides/notesSlide1.xml\"\n              , \"ppt/notesSlides/_rels/notesSlide1.xml.rels\"\n              , \"ppt/notesSlides/notesSlide2.xml\"\n              , \"ppt/notesSlides/_rels/notesSlide2.xml.rels\"\n              , \"ppt/theme/theme2.xml\"\n              ]\n  let toLazy = BL.fromChunks . (:[])\n  let pathToEntry path = do\n        epochtime <- floor <$> getPOSIXTime\n        contents <- toLazy <$> readDataFile (\"pptx/\" ++ path)\n        return $ toEntry path epochtime contents\n  datadir <- getUserDataDir\n  mbArchive <- case datadir of\n                    Nothing   -> return Nothing\n                    Just d    -> do\n                       exists <- fileExists (d </> \"reference.pptx\")\n                       if exists\n                          then return (Just (d </> \"reference.pptx\"))\n                          else return Nothing\n  case mbArchive of\n     Just arch -> toArchive <$> readFileLazy arch\n     Nothing   -> foldr addEntryToArchive emptyArchive <$>\n                     mapM pathToEntry paths\n\ngetDataFileNames :: IO [FilePath]\ngetDataFileNames = do\n#ifdef EMBED_DATA_FILES\n  let allDataFiles = map fst dataFiles\n#else\n  allDataFiles <- filter (\\x -> x /= \".\" && x /= \"..\") <$>\n                      (getDataDir >>= getDirectoryContents)\n#endif\n  return $ \"reference.docx\" : \"reference.odt\" : \"reference.pptx\" : allDataFiles\n\n-- | Return appropriate user data directory for platform.  We use\n-- XDG_DATA_HOME (or its default value), but for backwards compatibility,\n-- we fall back to the legacy user data directory ($HOME/.pandoc on *nix)\n-- if the XDG_DATA_HOME is missing and this exists.  If neither directory\n-- is present, we return the XDG data directory.  If the XDG data directory\n-- is not defined (e.g. because we are in an environment where $HOME is\n-- not defined), we return the empty string.\ndefaultUserDataDir :: IO FilePath\ndefaultUserDataDir = do\n  xdgDir <- E.catch (getXdgDirectory XdgData \"pandoc\")\n               (\\(_ :: E.SomeException) -> return mempty)\n  xdgExists <- doesDirectoryExist xdgDir\n  legacyDir <- E.catch (getAppUserDataDirectory \"pandoc\")\n                (\\(_ :: E.SomeException) -> return mempty)\n  legacyDirExists <- doesDirectoryExist legacyDir\n  if not xdgExists && legacyDirExists\n     then return legacyDir\n     else return xdgDir\n"
  },
  {
    "path": "src/Text/Pandoc/Emoji.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Emoji\n   Copyright   : Copyright (C) 2015 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nEmoji symbol lookup from canonical string identifier.\n-}\nmodule Text.Pandoc.Emoji ( emojis, emojiToInline ) where\nimport qualified Text.Emoji as E\nimport Text.Pandoc.Definition (Inline (Span, Str))\nimport Data.Text (Text)\nimport qualified Data.Map as M\n\nemojis :: M.Map Text Text\nemojis = M.fromList E.emojis\n\nemojiToInline :: Text -> Maybe Inline\nemojiToInline emojikey = makeSpan <$> E.emojiFromAlias emojikey\n  where makeSpan = Span (\"\", [\"emoji\"], [(\"data-emoji\", emojikey)]) . (:[]) . Str\n"
  },
  {
    "path": "src/Text/Pandoc/Error.hs",
    "content": "{-# LANGUAGE DeriveDataTypeable #-}\n{-# LANGUAGE DeriveGeneric      #-}\n{-# LANGUAGE OverloadedStrings  #-}\n{- |\n   Module      : Text.Pandoc.Error\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nThis module provides a standard way to deal with possible errors\nencountered during parsing.\n\n-}\nmodule Text.Pandoc.Error (\n  PandocError(..),\n  renderError,\n  handleError) where\n\nimport Control.Exception (Exception, displayException)\nimport Data.Typeable (Typeable)\nimport Data.Word (Word8)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport GHC.Generics (Generic)\nimport System.Exit (ExitCode (..), exitWith)\nimport System.IO (stderr)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Printf (printf)\nimport Text.Pandoc.Shared (tshow)\nimport Citeproc (CiteprocError, prettyCiteprocError)\n\ndata PandocError = PandocIOError Text IOError\n                 | PandocHttpError Text Text\n                 | PandocShouldNeverHappenError Text\n                 | PandocSomeError Text\n                 | PandocParseError Text\n                 | PandocMakePDFError Text\n                 | PandocOptionError Text\n                 | PandocSyntaxMapError Text\n                 | PandocFailOnWarningError\n                 | PandocPDFProgramNotFoundError Text\n                 | PandocPDFError Text\n                 | PandocXMLError Text Text\n                 | PandocFilterError Text Text\n                 | PandocLuaError Text\n                 | PandocNoScriptingEngine\n                 | PandocCouldNotFindDataFileError Text\n                 | PandocCouldNotFindMetadataFileError Text\n                 | PandocResourceNotFound Text\n                 | PandocTemplateError Text\n                 | PandocNoTemplateError Text\n                 | PandocAppError Text\n                 | PandocEpubSubdirectoryError Text\n                 | PandocMacroLoop Text\n                 | PandocUTF8DecodingError Text Int Word8\n                 | PandocIpynbDecodingError Text\n                 | PandocUnsupportedCharsetError Text\n                 | PandocFormatError Text Text\n                 | PandocUnknownReaderError Text\n                 | PandocUnknownWriterError Text\n                 | PandocUnsupportedExtensionError Text Text\n                 | PandocCiteprocError CiteprocError\n                 | PandocBibliographyError Text Text\n                 | PandocInputNotTextError Text\n                 deriving (Show, Typeable, Generic)\n\ninstance Exception PandocError\n where\n   displayException = T.unpack . renderError\n\nrenderError :: PandocError -> Text\nrenderError e =\n  case e of\n    PandocIOError _ err' -> T.pack $ displayException err'\n    PandocHttpError u err' -> \"Could not fetch \" <> u <> \"\\n\" <> err'\n    PandocShouldNeverHappenError s ->\n      \"Something we thought was impossible happened!\\n\" <>\n      \"Please report this to pandoc's developers: \" <> s\n    PandocSomeError s -> s\n    PandocParseError s -> s\n    PandocMakePDFError s -> s\n    PandocOptionError s -> s\n    PandocSyntaxMapError s -> s\n    PandocFailOnWarningError -> \"Failing because there were warnings.\"\n    PandocPDFProgramNotFoundError pdfprog ->\n        pdfprog <> \" not found. Please select a different --pdf-engine or install \" <> pdfprog\n    PandocPDFError logmsg -> \"Error producing PDF.\\n\" <> logmsg\n    PandocXMLError fp logmsg -> \"Invalid XML\" <>\n        (if T.null fp then \"\" else \" in \" <> fp) <> \":\\n\" <> logmsg\n    PandocFilterError filtername msg -> \"Error running filter \" <>\n        filtername <> \":\\n\" <> msg\n    PandocLuaError msg -> \"Error running Lua:\\n\" <> msg\n    PandocNoScriptingEngine -> \"This version of pandoc has been compiled \" <>\n                               \"without Lua support.\"\n    PandocCouldNotFindDataFileError fn ->\n        \"Could not find data file \" <> fn\n    PandocCouldNotFindMetadataFileError fn ->\n        \"Could not find metadata file \" <> fn\n    PandocResourceNotFound fn ->\n        \"File \" <> fn <> \" not found in resource path\"\n    PandocTemplateError s -> \"Error compiling template \" <> s\n    PandocNoTemplateError fp -> \"No template defined in \" <> fp\n    PandocAppError s -> s\n    PandocEpubSubdirectoryError s ->\n      \"EPUB subdirectory name '\" <> s <> \"' contains illegal characters\"\n    PandocMacroLoop s ->\n      \"Loop encountered in expanding macro \" <> s\n    PandocUTF8DecodingError f offset w ->\n      \"UTF-8 decoding error in \" <> f <> \" at byte offset \" <> tshow offset <>\n      \" (\" <> T.pack (printf \"%2x\" w) <> \").\\n\" <>\n      \"The input must be a UTF-8 encoded text.\"\n    PandocIpynbDecodingError w ->\n      \"ipynb decoding error: \" <> w\n    PandocUnsupportedCharsetError charset ->\n      \"Unsupported charset \" <> charset\n    PandocFormatError format s ->\n      \"Error parsing format \" <> tshow format <> \": \" <> s\n    PandocUnknownReaderError r ->\n      \"Unknown input format \" <> r <>\n      case r of\n        \"doc\" -> \"\\nPandoc can convert from DOCX, but not from DOC.\" <>\n                 \"\\nTry using Word to save your DOC file as DOCX,\" <>\n                 \" and convert that with pandoc.\"\n        \"pdf\" -> \"\\nPandoc can convert to PDF, but not from PDF.\"\n        _     -> \"\"\n    PandocUnknownWriterError w ->\n       \"Unknown output format \" <> w <>\n       case w of\n         \"pdf\" -> \"To create a pdf using pandoc, use\" <>\n                  \" -t latex|beamer|context|ms|html5|typst\" <>\n                 \"\\nand specify an output file with \" <>\n                 \".pdf extension (-o filename.pdf).\"\n         \"doc\" -> \"\\nPandoc can convert to DOCX, but not to DOC.\"\n         _     -> \"\"\n    PandocUnsupportedExtensionError ext f ->\n      \"The extension \" <> ext <> \" is not supported \" <>\n      \"for \" <> f <> \".\\nUse --list-extensions=\" <> f <> \" to \" <>\n      \"list supported extensions.\"\n    PandocCiteprocError e' ->\n      prettyCiteprocError e'\n    PandocBibliographyError fp msg ->\n      \"Error reading bibliography file \" <> fp <> \":\\n\" <> msg\n    PandocInputNotTextError fp ->\n      \"Expected text as an input, but received binary data from \" <>\n      (if T.null fp\n        then \"stdin\"\n        else \"file \" <> fp) <>\n      \".\\nIf you intended to convert from binary format, verify that it's \" <>\n      \"supported and use\\nexplicit -f FORMAT.\"\n\n\n-- | Handle PandocError by exiting with an error message.\nhandleError :: Either PandocError a -> IO a\nhandleError (Right r) = return r\nhandleError (Left e) =\n  case e of\n    PandocIOError _ err' -> ioError err'\n    _ -> err exitCode (renderError e)\n where\n  exitCode =\n    case e of\n      PandocIOError{} -> 1\n      PandocFailOnWarningError{} -> 3\n      PandocAppError{} -> 4\n      PandocTemplateError{} -> 5\n      PandocOptionError{} -> 6\n      PandocFormatError{} -> 20\n      PandocUnknownReaderError{} -> 21\n      PandocUnknownWriterError{} -> 22\n      PandocUnsupportedExtensionError{} -> 23\n      PandocCiteprocError{} -> 24\n      PandocBibliographyError{} -> 25\n      PandocEpubSubdirectoryError{} -> 31\n      PandocPDFError{} -> 43\n      PandocXMLError{} -> 44\n      PandocPDFProgramNotFoundError{} -> 47\n      PandocHttpError{} -> 61\n      PandocShouldNeverHappenError{} -> 62\n      PandocSomeError{} -> 63\n      PandocParseError{} -> 64\n      PandocMakePDFError{} -> 66\n      PandocSyntaxMapError{} -> 67\n      PandocFilterError{} -> 83\n      PandocLuaError{} -> 84\n      PandocNoTemplateError{} -> 87\n      PandocNoScriptingEngine -> 89\n      PandocMacroLoop{} -> 91\n      PandocUTF8DecodingError{} -> 92\n      PandocIpynbDecodingError{} -> 93\n      PandocUnsupportedCharsetError{} -> 94\n      PandocInputNotTextError{} -> 95\n      PandocCouldNotFindDataFileError{} -> 97\n      PandocCouldNotFindMetadataFileError{} -> 98\n      PandocResourceNotFound{} -> 99\n\nerr :: Int -> Text -> IO a\nerr exitCode msg = do\n  UTF8.hPutStrLn stderr msg\n  exitWith $ ExitFailure exitCode\n  return undefined\n"
  },
  {
    "path": "src/Text/Pandoc/Extensions.hs",
    "content": "{-# LANGUAGE CPP                        #-}\n{-# LANGUAGE DeriveDataTypeable         #-}\n{-# LANGUAGE DeriveGeneric              #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\n   Module      : Text.Pandoc.Extensions\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nData structures and functions for representing markup extensions.\n-}\nmodule Text.Pandoc.Extensions ( Extension(..)\n                              , readExtension\n                              , showExtension\n                              , Extensions\n                              , emptyExtensions\n                              , extensionsFromList\n                              , extensionsToList\n                              , extensionEnabled\n                              , enableExtension\n                              , disableExtension\n                              , disableExtensions\n                              , getDefaultExtensions\n                              , getAllExtensions\n                              , pandocExtensions\n                              , plainExtensions\n                              , strictExtensions\n                              , phpMarkdownExtraExtensions\n                              , githubMarkdownExtensions\n                              , multimarkdownExtensions )\nwhere\nimport Data.Data (Data)\nimport qualified Data.Text as T\nimport Data.Typeable (Typeable)\nimport GHC.Generics (Generic)\nimport Text.Read (readMaybe)\nimport Data.Aeson\nimport Data.List (sort)\nimport qualified Data.Set as Set\n\n-- | Individually selectable syntax extensions.\ndata Extension =\n      Ext_abbreviations       -- ^ PHP markdown extra abbreviation definitions\n    | Ext_alerts              -- ^ Special block quotes become alerts\n    | Ext_all_symbols_escapable  -- ^ Make all non-alphanumerics escapable\n    | Ext_amuse -- ^ Enable Text::Amuse extensions to Emacs Muse markup\n    | Ext_angle_brackets_escapable  -- ^ Make < and > escapable\n    | Ext_ascii_identifiers   -- ^ ascii-only identifiers for headers;\n                              -- presupposes Ext_auto_identifiers\n    | Ext_attributes          -- ^ Generic attribute syntax\n    | Ext_auto_identifiers    -- ^ Automatic identifiers for headers\n    | Ext_autolink_bare_uris  -- ^ Make all absolute URIs into links\n    | Ext_backtick_code_blocks    -- ^ GitHub style ``` code blocks\n    | Ext_blank_before_blockquote -- ^ Require blank line before a blockquote\n    | Ext_blank_before_header     -- ^ Require blank line before a header\n    | Ext_bracketed_spans         -- ^ Bracketed spans with attributes\n    | Ext_citations           -- ^ Pandoc/citeproc citations\n    | Ext_definition_lists    -- ^ Definition lists as in pandoc, mmd, php\n    | Ext_east_asian_line_breaks  -- ^ Newlines in paragraphs are ignored between\n                                  --   East Asian wide characters. Note: this extension\n                                  --   does not affect readers/writers directly; it causes\n                                  --   the eastAsianLineBreakFilter to be applied after\n                                  --   parsing, in Text.Pandoc.App.convertWithOpts.\n    | Ext_element_citations   -- ^ Use element-citation elements for JATS citations\n    | Ext_emoji               -- ^ Support emoji like :smile:\n    | Ext_empty_paragraphs -- ^ Allow empty paragraphs\n    | Ext_epub_html_exts      -- ^ Recognise the EPUB extended version of HTML\n    | Ext_escaped_line_breaks     -- ^ Treat a backslash at EOL as linebreak\n    | Ext_example_lists       -- ^ Markdown-style numbered examples\n    | Ext_fancy_lists         -- ^ Enable fancy list numbers and delimiters\n    | Ext_fenced_code_attributes  -- ^ Allow attributes on fenced code blocks\n    | Ext_fenced_code_blocks  -- ^ Parse fenced code blocks\n    | Ext_fenced_divs             -- ^ Allow fenced div syntax :::\n    | Ext_footnotes           -- ^ Pandoc\\/PHP\\/MMD style footnotes\n    | Ext_four_space_rule     -- ^ Require 4-space indent for list contents\n    | Ext_gfm_auto_identifiers  -- ^ Use GitHub's method for generating\n                              -- header identifiers; presupposes\n                              -- Ext_auto_identifiers\n    | Ext_grid_tables         -- ^ Grid tables (pandoc, reST)\n    | Ext_gutenberg           -- ^ Use Project Gutenberg conventions for plain\n    | Ext_hard_line_breaks    -- ^ All newlines become hard line breaks\n    | Ext_header_attributes   -- ^ Explicit header attributes {#id .class k=v}\n    | Ext_table_attributes    -- ^ Explicit table attributes after caption\n    | Ext_ignore_line_breaks  -- ^ Newlines in paragraphs are ignored\n    | Ext_implicit_figures    -- ^ A paragraph with just an image is a figure\n    | Ext_implicit_header_references -- ^ Implicit reference links for headers\n    | Ext_inline_code_attributes  -- ^ Allow attributes on inline code\n    | Ext_inline_notes        -- ^ Pandoc-style inline notes\n    | Ext_intraword_underscores  -- ^ Treat underscore inside word as literal\n    | Ext_latex_macros        -- ^ Parse LaTeX macro definitions (for math only)\n    | Ext_line_blocks         -- ^ RST style line blocks\n    | Ext_link_attributes         -- ^ link and image attributes\n    | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank\n    | Ext_literate_haskell    -- ^ Enable literate Haskell conventions\n    | Ext_mark                -- ^ Enable ==mark== syntax to highlight text\n    | Ext_markdown_attribute      -- ^ Interpret text inside HTML as markdown iff\n                                  --   container has attribute 'markdown'\n    | Ext_markdown_in_html_blocks -- ^ Interpret as markdown inside HTML blocks\n    | Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid]\n    | Ext_mmd_link_attributes     -- ^ MMD style reference link attributes\n    | Ext_mmd_title_block     -- ^ Multimarkdown metadata block\n    | Ext_multiline_tables    -- ^ Pandoc-style multiline tables\n    | Ext_native_divs             -- ^ Use Div blocks for contents of <div> tags\n    | Ext_native_spans            -- ^ Use Span inlines for contents of <span>\n    | Ext_native_numbering    -- ^ Use output format's native numbering for figures and tables\n    | Ext_ntb                 -- ^ ConTeXt Natural Tables\n    | Ext_old_dashes          -- ^ -- = em, - before number = en\n    | Ext_pandoc_title_block  -- ^ Pandoc title block\n    | Ext_pipe_tables         -- ^ Pipe tables (as in PHP markdown extra)\n    | Ext_raw_attribute           -- ^ Allow explicit raw blocks/inlines\n    | Ext_raw_html            -- ^ Allow raw HTML\n    | Ext_raw_tex             -- ^ Allow raw TeX (other than math)\n    | Ext_raw_markdown        -- ^ Parse markdown in ipynb as raw markdown\n    | Ext_rebase_relative_paths -- ^ Rebase relative image and link paths,\n                                -- relative to directory of containing file\n    | Ext_short_subsuperscripts -- ^ sub-&superscripts w/o closing char (v~i)\n    | Ext_shortcut_reference_links -- ^ Shortcut reference links\n    | Ext_simple_tables       -- ^ Pandoc-style simple tables\n    | Ext_smart               -- ^ \"Smart\" quotes, apostrophes, ellipses, dashes\n    | Ext_smart_quotes        -- ^ \"Smart\" quotes\n    | Ext_special_strings     -- ^ Treat certain strings like special characters\n    | Ext_sourcepos           -- ^ Include source position attributes\n    | Ext_space_in_atx_header -- ^ Require space between # and header text\n    | Ext_spaced_reference_links -- ^ Allow space between two parts of ref link\n    | Ext_startnum            -- ^ Make start number of ordered list significant\n    | Ext_strikeout           -- ^ Strikeout using ~~this~~ syntax\n    | Ext_subscript           -- ^ Subscript using ~this~ syntax\n    | Ext_superscript         -- ^ Superscript using ^this^ syntax\n    | Ext_styles              -- ^ Read styles that pandoc doesn't know\n    | Ext_tagging             -- ^ Output optimized for PDF tagging\n    | Ext_task_lists          -- ^ Parse certain list items as task list items\n    | Ext_table_captions      -- ^ Pandoc-style table captions\n    | Ext_tex_math_dollars    -- ^ TeX math between $..$ or $$..$$\n    | Ext_tex_math_gfm        -- ^ Additional TeX math style used in GFM\n    | Ext_tex_math_double_backslash  -- ^ TeX math btw \\\\(..\\\\) \\\\[..\\\\]\n    | Ext_tex_math_single_backslash  -- ^ TeX math btw \\(..\\) \\[..\\]\n    | Ext_wikilinks_title_after_pipe -- ^ Support wikilinks of style\n                                     -- [[target|title]]\n    | Ext_wikilinks_title_before_pipe  -- ^ Support wikilinks of style\n                                       -- [[title|target]]\n    | Ext_xrefs_name          -- ^ Use xrefs with names\n    | Ext_xrefs_number        -- ^ Use xrefs with numbers\n    | Ext_yaml_metadata_block -- ^ YAML metadata block\n    | CustomExtension T.Text  -- ^ Custom extension\n    deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)\n\ninstance FromJSON Extension where\n  parseJSON = withText \"Extension\" (pure . readExtension . T.unpack)\n\ninstance ToJSON Extension where\n toJSON = String . showExtension\n\nnewtype Extensions = Extensions (Set.Set Extension)\n  deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)\n\ninstance Semigroup Extensions where\n  (Extensions a) <> (Extensions b) = Extensions (a <> b)\ninstance Monoid Extensions where\n  mempty = Extensions mempty\n  mappend = (<>)\n\ninstance FromJSON Extensions where\n  parseJSON = fmap extensionsFromList . parseJSON\n\ninstance ToJSON Extensions where\n  toJSON (Extensions exts) = toJSON exts\n\n-- | Reads a single extension from a string.\nreadExtension :: String -> Extension\nreadExtension \"lhs\" = Ext_literate_haskell\nreadExtension name =\n  case readMaybe (\"Ext_\" ++ name) of\n    Just ext -> ext\n    Nothing -> CustomExtension (T.pack name)\n\n-- | Show an extension in human-readable form.\nshowExtension :: Extension -> T.Text\nshowExtension ext =\n  case ext of\n    CustomExtension t -> t\n    _ -> T.drop 4 $ T.pack $ show ext\n\nextensionsFromList :: [Extension] -> Extensions\nextensionsFromList = Extensions . Set.fromList\n\nextensionsToList :: Extensions -> [Extension]\nextensionsToList (Extensions extset) = sort $ Set.toList extset\n\nemptyExtensions :: Extensions\nemptyExtensions = Extensions mempty\n\nextensionEnabled :: Extension -> Extensions -> Bool\nextensionEnabled x (Extensions exts) = x `Set.member` exts\n\nenableExtension :: Extension -> Extensions -> Extensions\nenableExtension x (Extensions exts) = Extensions (Set.insert x exts)\n\ndisableExtension :: Extension -> Extensions -> Extensions\ndisableExtension x (Extensions exts) = Extensions (Set.delete x exts)\n\n-- | Removes the extensions in the second set from those in the first.\ndisableExtensions :: Extensions  -- ^ base set\n                  -> Extensions  -- ^ extensions to remove\n                  -> Extensions\ndisableExtensions (Extensions base) (Extensions remove) = Extensions $\n  -- keep only those extensions that are in `base` but not in `remove`.\n  base `Set.difference` remove\n\n-- | Extensions to be used with pandoc-flavored markdown.\npandocExtensions :: Extensions\npandocExtensions = extensionsFromList\n  [ Ext_footnotes\n  , Ext_inline_notes\n  , Ext_pandoc_title_block\n  , Ext_yaml_metadata_block\n  , Ext_table_captions\n  , Ext_implicit_figures\n  , Ext_simple_tables\n  , Ext_multiline_tables\n  , Ext_grid_tables\n  , Ext_pipe_tables\n  , Ext_citations\n  , Ext_raw_tex\n  , Ext_raw_html\n  , Ext_tex_math_dollars\n  , Ext_latex_macros\n  , Ext_fenced_code_blocks\n  , Ext_fenced_code_attributes\n  , Ext_backtick_code_blocks\n  , Ext_inline_code_attributes\n  , Ext_raw_attribute\n  , Ext_markdown_in_html_blocks\n  , Ext_native_divs\n  , Ext_fenced_divs\n  , Ext_native_spans\n  , Ext_bracketed_spans\n  , Ext_escaped_line_breaks\n  , Ext_fancy_lists\n  , Ext_startnum\n  , Ext_definition_lists\n  , Ext_example_lists\n  , Ext_all_symbols_escapable\n  , Ext_intraword_underscores\n  , Ext_blank_before_blockquote\n  , Ext_blank_before_header\n  , Ext_space_in_atx_header\n  , Ext_strikeout\n  , Ext_superscript\n  , Ext_subscript\n  , Ext_task_lists\n  , Ext_auto_identifiers\n  , Ext_header_attributes\n  , Ext_table_attributes\n  , Ext_link_attributes\n  , Ext_implicit_header_references\n  , Ext_line_blocks\n  , Ext_shortcut_reference_links\n  , Ext_smart\n  ]\n\n-- | Extensions to be used with plain text output.\nplainExtensions :: Extensions\nplainExtensions = extensionsFromList\n  [ Ext_table_captions\n  , Ext_implicit_figures\n  , Ext_simple_tables\n  , Ext_multiline_tables\n  , Ext_grid_tables\n  , Ext_latex_macros\n  , Ext_fancy_lists\n  , Ext_startnum\n  , Ext_definition_lists\n  , Ext_example_lists\n  , Ext_intraword_underscores\n  , Ext_blank_before_blockquote\n  , Ext_blank_before_header\n  , Ext_strikeout\n  ]\n\n-- | Extensions to be used with PHP Markdown Extra.\nphpMarkdownExtraExtensions :: Extensions\nphpMarkdownExtraExtensions = extensionsFromList\n  [ Ext_footnotes\n  , Ext_pipe_tables\n  , Ext_raw_html\n  , Ext_markdown_attribute\n  , Ext_fenced_code_blocks\n  , Ext_definition_lists\n  , Ext_intraword_underscores\n  , Ext_header_attributes\n  , Ext_link_attributes\n  , Ext_abbreviations\n  , Ext_shortcut_reference_links\n  , Ext_spaced_reference_links\n  ]\n\n-- | Extensions to be used with github-flavored markdown.\ngithubMarkdownExtensions :: Extensions\ngithubMarkdownExtensions = extensionsFromList\n  [ Ext_pipe_tables\n  , Ext_raw_html\n  , Ext_auto_identifiers\n  , Ext_gfm_auto_identifiers\n  , Ext_autolink_bare_uris\n  , Ext_strikeout\n  , Ext_task_lists\n  , Ext_emoji\n  , Ext_fenced_code_blocks\n  , Ext_backtick_code_blocks\n  , Ext_footnotes\n  , Ext_alerts\n  ]\n\n-- | Extensions to be used with multimarkdown.\nmultimarkdownExtensions :: Extensions\nmultimarkdownExtensions = extensionsFromList\n  [ Ext_pipe_tables\n  , Ext_raw_html\n  , Ext_markdown_attribute\n  , Ext_mmd_link_attributes\n  -- , Ext_raw_tex\n  -- Note: MMD's raw TeX syntax requires raw TeX to be\n  -- enclosed in HTML comment\n  , Ext_tex_math_double_backslash\n  , Ext_tex_math_dollars\n  , Ext_intraword_underscores\n  , Ext_mmd_title_block\n  , Ext_footnotes\n  , Ext_definition_lists\n  , Ext_all_symbols_escapable\n  , Ext_implicit_header_references\n  , Ext_shortcut_reference_links\n  , Ext_auto_identifiers\n  , Ext_mmd_header_identifiers\n  , Ext_implicit_figures\n  , Ext_short_subsuperscripts\n  , Ext_subscript\n  , Ext_superscript\n  , Ext_backtick_code_blocks\n  , Ext_spaced_reference_links\n  -- So far only in dev version of mmd:\n  , Ext_raw_attribute\n  ]\n\n-- | Language extensions to be used with strict markdown.\nstrictExtensions :: Extensions\nstrictExtensions = extensionsFromList\n  [ Ext_raw_html\n  , Ext_shortcut_reference_links\n  , Ext_spaced_reference_links\n  ]\n\n-- | Default extensions from format-describing string.\ngetDefaultExtensions :: T.Text -> Extensions\ngetDefaultExtensions \"markdown_strict\"   = strictExtensions\ngetDefaultExtensions \"markdown_phpextra\" = phpMarkdownExtraExtensions\ngetDefaultExtensions \"markdown_mmd\"      = multimarkdownExtensions\ngetDefaultExtensions \"markdown_github\"   = githubMarkdownExtensions <>\n  extensionsFromList\n    [ Ext_all_symbols_escapable\n    , Ext_backtick_code_blocks\n    , Ext_fenced_code_blocks\n    , Ext_space_in_atx_header\n    , Ext_intraword_underscores\n    , Ext_lists_without_preceding_blankline\n    , Ext_shortcut_reference_links\n    ]\ngetDefaultExtensions \"markdown\"          = pandocExtensions\ngetDefaultExtensions \"ipynb\"             =\n  extensionsFromList\n    [ Ext_all_symbols_escapable\n    , Ext_pipe_tables\n    , Ext_raw_html\n    , Ext_fenced_code_blocks\n    , Ext_auto_identifiers\n    , Ext_gfm_auto_identifiers\n    , Ext_backtick_code_blocks\n    , Ext_autolink_bare_uris\n    , Ext_space_in_atx_header\n    , Ext_intraword_underscores\n    , Ext_strikeout\n    , Ext_task_lists\n    , Ext_lists_without_preceding_blankline\n    , Ext_shortcut_reference_links\n    , Ext_tex_math_dollars\n    ]\ngetDefaultExtensions \"muse\"            = extensionsFromList\n                                           [Ext_amuse,\n                                            Ext_auto_identifiers]\ngetDefaultExtensions \"plain\"           = plainExtensions\ngetDefaultExtensions \"gfm\"             = extensionsFromList\n  [ Ext_pipe_tables\n  , Ext_raw_html\n  , Ext_auto_identifiers\n  , Ext_gfm_auto_identifiers\n  , Ext_autolink_bare_uris\n  , Ext_strikeout\n  , Ext_task_lists\n  , Ext_emoji\n  , Ext_yaml_metadata_block\n  , Ext_footnotes\n  , Ext_tex_math_dollars\n  , Ext_tex_math_gfm\n  , Ext_alerts\n  ]\ngetDefaultExtensions \"commonmark\"      = extensionsFromList\n                                          [Ext_raw_html]\ngetDefaultExtensions \"commonmark_x\"    = extensionsFromList\n  [ Ext_pipe_tables\n  , Ext_raw_html\n  , Ext_gfm_auto_identifiers\n  , Ext_strikeout\n  , Ext_task_lists\n  , Ext_emoji\n  , Ext_smart\n  , Ext_tex_math_dollars\n  , Ext_superscript\n  , Ext_subscript\n  , Ext_definition_lists\n  , Ext_footnotes\n  , Ext_fancy_lists\n  , Ext_fenced_divs\n  , Ext_bracketed_spans\n  , Ext_raw_attribute\n  , Ext_implicit_header_references\n  , Ext_attributes\n  , Ext_alerts\n  , Ext_yaml_metadata_block\n  ]\ngetDefaultExtensions \"org\"             = extensionsFromList\n                                          [Ext_citations,\n                                           Ext_special_strings,\n                                           Ext_task_lists,\n                                           Ext_auto_identifiers]\ngetDefaultExtensions \"html\"            = extensionsFromList\n                                          [Ext_auto_identifiers,\n                                           Ext_native_divs,\n                                           Ext_line_blocks,\n                                           Ext_native_spans]\ngetDefaultExtensions \"html4\"           = getDefaultExtensions \"html\"\ngetDefaultExtensions \"html5\"           = getDefaultExtensions \"html\"\ngetDefaultExtensions \"epub\"            = extensionsFromList\n                                          [Ext_raw_html,\n                                           Ext_native_divs,\n                                           Ext_native_spans,\n                                           Ext_epub_html_exts]\ngetDefaultExtensions \"epub2\"           = getDefaultExtensions \"epub\"\ngetDefaultExtensions \"epub3\"           = getDefaultExtensions \"epub\"\ngetDefaultExtensions \"latex\"           = extensionsFromList\n                                          [Ext_smart,\n                                           Ext_latex_macros,\n                                           Ext_auto_identifiers]\ngetDefaultExtensions \"beamer\"          = extensionsFromList\n                                          [Ext_smart,\n                                           Ext_latex_macros,\n                                           Ext_auto_identifiers]\ngetDefaultExtensions \"context\"         = extensionsFromList\n                                          [Ext_smart,\n                                           Ext_auto_identifiers]\ngetDefaultExtensions \"textile\"         = extensionsFromList\n                                          [Ext_old_dashes,\n                                           Ext_smart,\n                                           Ext_raw_html,\n                                           Ext_auto_identifiers]\ngetDefaultExtensions \"jats\"            = extensionsFromList\n                                          [Ext_auto_identifiers]\ngetDefaultExtensions \"jats_archiving\"  = getDefaultExtensions \"jats\"\ngetDefaultExtensions \"jats_publishing\" = getDefaultExtensions \"jats\"\ngetDefaultExtensions \"jats_articleauthoring\" = getDefaultExtensions \"jats\"\ngetDefaultExtensions \"opml\"            = pandocExtensions -- affects notes\ngetDefaultExtensions \"markua\"          = extensionsFromList\n                                          []\ngetDefaultExtensions \"typst\"           = extensionsFromList [Ext_citations,\n                                                             Ext_smart]\ngetDefaultExtensions \"dokuwiki\"        = extensionsFromList [Ext_smart]\ngetDefaultExtensions _                 = extensionsFromList\n                                          [Ext_auto_identifiers]\n\n\n-- | Get all valid extensions for a format. This is used\n-- mainly in checking format specifications for validity.\ngetAllExtensions :: T.Text -> Extensions\ngetAllExtensions f = universalExtensions <> getAll f\n where\n  autoIdExtensions           = extensionsFromList\n    [ Ext_auto_identifiers\n    , Ext_gfm_auto_identifiers\n    , Ext_ascii_identifiers\n    ]\n  universalExtensions        = extensionsFromList\n    [ Ext_east_asian_line_breaks ]\n  allMarkdownExtensions =\n    pandocExtensions <> autoIdExtensions <>\n      extensionsFromList\n       [ Ext_old_dashes\n       , Ext_angle_brackets_escapable\n       , Ext_lists_without_preceding_blankline\n       , Ext_four_space_rule\n       , Ext_spaced_reference_links\n       , Ext_hard_line_breaks\n       , Ext_ignore_line_breaks\n       , Ext_east_asian_line_breaks\n       , Ext_emoji\n       , Ext_tex_math_single_backslash\n       , Ext_tex_math_double_backslash\n       , Ext_markdown_attribute\n       , Ext_mmd_title_block\n       , Ext_abbreviations\n       , Ext_autolink_bare_uris\n       , Ext_mark\n       , Ext_mmd_link_attributes\n       , Ext_mmd_header_identifiers\n       , Ext_gutenberg\n       , Ext_smart\n       , Ext_literate_haskell\n       , Ext_short_subsuperscripts\n       , Ext_rebase_relative_paths\n       , Ext_wikilinks_title_after_pipe\n       , Ext_wikilinks_title_before_pipe\n       , Ext_alerts\n       ]\n  getAll \"markdown_strict\"   = allMarkdownExtensions\n  getAll \"markdown_phpextra\" = allMarkdownExtensions\n  getAll \"markdown_mmd\"      = allMarkdownExtensions\n  getAll \"markdown_github\"   = allMarkdownExtensions\n  getAll \"markdown\"          = allMarkdownExtensions\n  getAll \"ipynb\"             = allMarkdownExtensions <> extensionsFromList\n    [ Ext_raw_markdown ]\n  getAll \"docx\"            = autoIdExtensions <> extensionsFromList\n    [ Ext_empty_paragraphs\n    , Ext_native_numbering\n    , Ext_styles\n    , Ext_citations\n    ]\n  getAll \"opendocument\"    = extensionsFromList\n    [ Ext_empty_paragraphs\n    , Ext_native_numbering\n    , Ext_xrefs_name\n    , Ext_xrefs_number\n    ]\n  getAll \"odt\"             = getAll \"opendocument\" <> autoIdExtensions\n  getAll \"muse\"            = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_amuse ]\n  getAll \"asciidoc\"        = autoIdExtensions\n  getAll \"plain\"           = allMarkdownExtensions\n  getAll \"gfm\"             = getAll \"commonmark\"\n  getAll \"commonmark\"      =\n    extensionsFromList\n    [ Ext_gfm_auto_identifiers\n    , Ext_ascii_identifiers\n    , Ext_pipe_tables\n    , Ext_autolink_bare_uris\n    , Ext_strikeout\n    , Ext_task_lists\n    , Ext_emoji\n    , Ext_raw_html\n    , Ext_alerts\n    , Ext_implicit_figures\n    , Ext_hard_line_breaks\n    , Ext_smart\n    , Ext_tex_math_dollars\n    , Ext_tex_math_gfm\n    , Ext_superscript\n    , Ext_subscript\n    , Ext_definition_lists\n    , Ext_footnotes\n    , Ext_fancy_lists\n    , Ext_fenced_divs\n    , Ext_bracketed_spans\n    , Ext_raw_attribute\n    , Ext_implicit_header_references\n    , Ext_attributes\n    , Ext_sourcepos\n    , Ext_wikilinks_title_after_pipe\n    , Ext_wikilinks_title_before_pipe\n    , Ext_yaml_metadata_block\n    , Ext_rebase_relative_paths\n    ]\n  getAll \"commonmark_x\"    = getAll \"commonmark\"\n  getAll \"org\"             = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_citations\n    , Ext_smart\n    , Ext_smart_quotes\n    , Ext_special_strings\n    , Ext_fancy_lists\n    , Ext_task_lists\n    ]\n  getAll \"html\"            = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_native_divs\n    , Ext_line_blocks\n    , Ext_native_spans\n    , Ext_empty_paragraphs\n    , Ext_raw_html\n    , Ext_raw_tex\n    , Ext_task_lists\n    , Ext_tex_math_dollars\n    , Ext_tex_math_single_backslash\n    , Ext_tex_math_double_backslash\n    , Ext_literate_haskell\n    , Ext_epub_html_exts\n    , Ext_smart\n    ]\n  getAll \"html4\"           = getAll \"html\"\n  getAll \"html5\"           = getAll \"html\"\n  getAll \"epub\"            = getAll \"html\"\n  getAll \"epub2\"           = getAll \"epub\"\n  getAll \"epub3\"           = getAll \"epub\"\n  getAll \"latex\"           = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_smart\n    , Ext_latex_macros\n    , Ext_raw_tex\n    , Ext_task_lists\n    , Ext_literate_haskell\n    , Ext_empty_paragraphs\n    ]\n  getAll \"beamer\"          = getAll \"latex\"\n  getAll \"context\"         = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_smart\n    , Ext_raw_tex\n    , Ext_ntb\n    , Ext_tagging\n    ]\n  getAll \"textile\"         = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_old_dashes\n    , Ext_smart\n    , Ext_raw_tex\n    ]\n  getAll \"jats\"            =\n    extensionsFromList\n    [ Ext_auto_identifiers\n    , Ext_element_citations\n    ]\n  getAll \"jats_archiving\"  = getAll \"jats\"\n  getAll \"jats_publishing\" = getAll \"jats\"\n  getAll \"jats_articleauthoring\" = getAll \"jats\"\n  getAll \"opml\"            = allMarkdownExtensions -- affects notes\n  getAll \"twiki\"           = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_smart ]\n  getAll \"vimwiki\"         = autoIdExtensions\n  getAll \"dokuwiki\"        = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_tex_math_dollars\n    , Ext_raw_html\n    , Ext_smart ]\n  getAll \"tikiwiki\"        = autoIdExtensions\n  getAll \"rst\"             = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_smart\n    , Ext_literate_haskell\n    ]\n  getAll \"mediawiki\"       = autoIdExtensions <>\n    extensionsFromList\n    [ Ext_smart ]\n  getAll \"typst\"           = extensionsFromList [Ext_citations, Ext_smart]\n  getAll \"djot\"            = extensionsFromList [Ext_sourcepos]\n  getAll _                 = mempty\n"
  },
  {
    "path": "src/Text/Pandoc/Filter/Environment.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Filter.Environment\n   Copyright   : ©2020-2021 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nEnvironment for pandoc filters.\n-}\nmodule Text.Pandoc.Filter.Environment\n  ( Environment (..)\n  ) where\n\nimport Data.Default (Default (def))\nimport Text.Pandoc.Options (ReaderOptions, WriterOptions)\n\n-- | Environment in which a filter is run. This includes reader and\n-- writer options.\ndata Environment = Environment\n  { envReaderOptions :: ReaderOptions\n  , envWriterOptions :: WriterOptions\n  }\n\ninstance Default Environment where\n  def = Environment def def\n"
  },
  {
    "path": "src/Text/Pandoc/Filter/JSON.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Filter\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nProgrammatically modifications of pandoc documents via JSON filters.\n-}\nmodule Text.Pandoc.Filter.JSON (apply) where\n\nimport Control.Monad (unless, when)\nimport Control.Monad.Trans (MonadIO (liftIO))\nimport Data.Aeson (eitherDecode', encode)\nimport Data.Char (toLower)\nimport Data.Maybe (isNothing)\nimport qualified Data.Text as T\nimport System.Directory (executable, doesFileExist, findExecutable,\n                         getPermissions)\nimport System.Environment (getEnvironment)\nimport System.Exit (ExitCode (..))\nimport System.FilePath ((</>), takeExtension)\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Error (PandocError (PandocFilterError))\nimport Text.Pandoc.Filter.Environment (Environment (..))\nimport Text.Pandoc.Process (pipeProcess)\nimport Text.Pandoc.Version (pandocVersionText)\nimport Text.Pandoc.Shared (tshow)\nimport qualified Control.Exception as E\nimport qualified Text.Pandoc.UTF8 as UTF8\n\napply :: MonadIO m\n      => Environment\n      -> [String]\n      -> FilePath\n      -> Pandoc\n      -> m Pandoc\napply ropts args f = liftIO . externalFilter ropts f args\n\nexternalFilter :: MonadIO m\n               => Environment -> FilePath -> [String] -> Pandoc -> m Pandoc\nexternalFilter fenv f args' d = liftIO $ do\n  exists <- doesFileExist f\n  isExecutable <- if exists\n                     then executable <$> getPermissions f\n                     else return True\n  let (f', args'') = if exists\n                        then case map toLower (takeExtension f) of\n                                  _      | isExecutable -> (\".\" </> f, args')\n                                  \".py\"  -> (\"python\", f:args')\n                                  \".hs\"  -> (\"runhaskell\", f:args')\n                                  \".pl\"  -> (\"perl\", f:args')\n                                  \".rb\"  -> (\"ruby\", f:args')\n                                  \".php\" -> (\"php\", f:args')\n                                  \".js\"  -> (\"node\", f:args')\n                                  \".r\"   -> (\"Rscript\", f:args')\n                                  _      -> (f, args')\n                        else (f, args')\n  unless (exists && isExecutable) $ do\n    mbExe <- findExecutable f'\n    when (isNothing mbExe) $\n      E.throwIO $ PandocFilterError fText (T.pack $ \"Could not find executable \" <> f')\n  let ropts = envReaderOptions fenv\n  env <- getEnvironment\n  let env' = Just\n           ( (\"PANDOC_VERSION\", T.unpack pandocVersionText)\n           : (\"PANDOC_READER_OPTIONS\", UTF8.toStringLazy (encode ropts))\n           : env )\n  (exitcode, outbs) <- E.handle filterException $\n                              pipeProcess env' f' args'' $ encode d\n  case exitcode of\n       ExitSuccess    -> either (E.throwIO . PandocFilterError fText . T.pack)\n                                   return $ eitherDecode' outbs\n       ExitFailure ec -> E.throwIO $ PandocFilterError fText\n                           (\"Filter returned error status \" <> tshow ec)\n where fText = T.pack f\n\n       filterException :: E.SomeException -> IO a\n       filterException e = E.throwIO $ PandocFilterError fText $ tshow e\n"
  },
  {
    "path": "src/Text/Pandoc/Filter.hs",
    "content": "{-# LANGUAGE CPP               #-}\n{-# LANGUAGE DeriveGeneric     #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Filter\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nProgrammatically modifications of pandoc documents.\n-}\nmodule Text.Pandoc.Filter\n  ( Filter (..)\n  , Environment (..)\n  , applyFilters\n  , applyJSONFilter\n  ) where\n\nimport System.CPUTime (getCPUTime)\nimport Data.Aeson\nimport Data.Maybe (fromMaybe)\nimport GHC.Generics (Generic)\nimport Text.Pandoc.Class (PandocMonad, findFileWithDataFallback, getVerbosity,\n                          report)\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Filter.Environment (Environment (..))\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Citeproc (processCitations)\nimport Text.Pandoc.Scripting (ScriptingEngine (engineApplyFilter))\nimport qualified Text.Pandoc.Filter.JSON as JSONFilter\nimport qualified Data.Text as T\nimport System.FilePath (takeExtension)\nimport Control.Applicative ((<|>))\nimport Control.Monad.Trans (MonadIO (liftIO))\nimport Control.Monad (foldM, when)\n\n-- | Type of filter and path to filter file.\ndata Filter = LuaFilter FilePath\n            | JSONFilter FilePath\n            | CiteprocFilter -- built-in citeproc\n            deriving (Show, Generic, Eq)\n\ninstance FromJSON Filter where\n parseJSON node =\n  (withObject \"Filter\" $ \\m -> do\n    ty <- m .: \"type\"\n    fp <- m .:? \"path\"\n    let missingPath = fail $ \"Expected 'path' for filter of type \" ++ show ty\n    let filterWithPath constr = maybe missingPath (return . constr . T.unpack)\n    case ty of\n      \"citeproc\" -> return CiteprocFilter\n      \"lua\"  -> filterWithPath LuaFilter fp\n      \"json\" -> filterWithPath JSONFilter fp\n      _      -> fail $ \"Unknown filter type \" ++ show (ty :: T.Text)) node\n  <|>\n  (withText \"Filter\" $ \\t -> do\n    let fp = T.unpack t\n    if fp == \"citeproc\"\n       then return CiteprocFilter\n       else return $\n         case takeExtension fp of\n           \".lua\"  -> LuaFilter fp\n           _       -> JSONFilter fp) node\n\ninstance ToJSON Filter where\n toJSON CiteprocFilter = object [ \"type\" .= String \"citeproc\" ]\n toJSON (LuaFilter fp) = object [ \"type\" .= String \"lua\",\n                                  \"path\" .= String (T.pack fp) ]\n toJSON (JSONFilter fp) = object [ \"type\" .= String \"json\",\n                                   \"path\" .= String (T.pack fp) ]\n\n-- | Modify the given document using a filter.\napplyFilters :: (PandocMonad m, MonadIO m)\n             => ScriptingEngine\n             -> Environment\n             -> [Filter]\n             -> [String]\n             -> Pandoc\n             -> m Pandoc\napplyFilters scrngin fenv filters args d = do\n  expandedFilters <- mapM expandFilterPath filters\n  foldM applyFilter d expandedFilters\n where\n  applyFilter doc (JSONFilter f) =\n    withMessages f $ JSONFilter.apply fenv args f doc\n  applyFilter doc (LuaFilter f)  =\n    withMessages f $ engineApplyFilter scrngin fenv args f doc\n  applyFilter doc CiteprocFilter =\n    withMessages \"citeproc\" $ processCitations doc\n  withMessages f action = do\n    verbosity <- getVerbosity\n    when (verbosity == INFO) $ report $ RunningFilter f\n    starttime <- liftIO getCPUTime\n    res <- action\n    endtime <- liftIO getCPUTime\n    when (verbosity == INFO) $ report $ FilterCompleted f $ toMilliseconds $ endtime - starttime\n    return res\n  toMilliseconds picoseconds = picoseconds `div` 1000000000\n\n-- | Expand paths of filters, searching the data directory.\nexpandFilterPath :: (PandocMonad m, MonadIO m) => Filter -> m Filter\nexpandFilterPath (LuaFilter fp) = LuaFilter <$> filterPath fp\nexpandFilterPath (JSONFilter fp) = JSONFilter <$> filterPath fp\nexpandFilterPath CiteprocFilter = return CiteprocFilter\n\nfilterPath :: PandocMonad m => FilePath -> m FilePath\nfilterPath fp = fromMaybe fp <$> findFileWithDataFallback \"filters\" fp\n\napplyJSONFilter :: MonadIO m\n                => Environment\n                -> [String]\n                -> FilePath\n                -> Pandoc\n                -> m Pandoc\napplyJSONFilter = JSONFilter.apply\n"
  },
  {
    "path": "src/Text/Pandoc/Format.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Format\n   Copyright   : © 2022-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nHandling of format specifiers for input and output.\n-}\nmodule Text.Pandoc.Format\n  ( FlavoredFormat (..)\n  , ExtensionsConfig (..)\n  , ExtensionsDiff (..)\n  , diffExtensions\n  , parseFlavoredFormat\n  , applyExtensionsDiff\n  , getExtensionsConfig\n  , formatFromFilePaths\n  ) where\n\nimport Control.Monad.Except (throwError)\nimport Data.Char (toLower)\nimport Data.Foldable (asum)\nimport qualified Data.List as L\nimport System.FilePath (splitExtension, takeExtension)\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Extensions\n  ( Extension (Ext_literate_haskell)\n  , Extensions\n  , disableExtensions\n  , enableExtension\n  , extensionsFromList\n  , extensionsToList\n  , getAllExtensions\n  , getDefaultExtensions\n  , showExtension\n  , readExtension\n  )\nimport Network.URI (URI (..), parseURI)\nimport Text.Pandoc.Parsing\nimport qualified Data.Text as T\n\n-- | Format specifier with the format's name and the lists of extensions\n-- to be enabled or disabled.\ndata FlavoredFormat = FlavoredFormat\n  { formatName     :: T.Text\n  , formatExtsDiff :: ExtensionsDiff\n  } deriving (Show)\n\n-- | Changes to a set of extensions, i.e., list of extensions to be\n-- enabled or disabled.\ndata ExtensionsDiff = ExtensionsDiff\n  { extsToEnable  :: Extensions\n  , extsToDisable :: Extensions\n  } deriving (Show)\n\ninstance Semigroup ExtensionsDiff where\n  ExtensionsDiff enA disA <> ExtensionsDiff enB disB =\n    ExtensionsDiff\n    ((enA `disableExtensions` disB) <> enB)\n    ((disA `disableExtensions` enB) <> disB)\n\ninstance Monoid ExtensionsDiff where\n  mempty = ExtensionsDiff mempty mempty\n  mappend = (<>)\n\n-- | Calculate the change set to get from one set of extensions to\n-- another.\ndiffExtensions :: Extensions -> Extensions -> ExtensionsDiff\ndiffExtensions def actual = ExtensionsDiff\n  { extsToEnable = actual `disableExtensions` def\n  , extsToDisable = def `disableExtensions` actual\n  }\n\n-- | Describes the properties of a format.\ndata ExtensionsConfig = ExtensionsConfig\n  { extsDefault   :: Extensions -- ^ Extensions enabled by default\n  , extsSupported :: Extensions -- ^ Extensions that can be enabled or disabled.\n  } deriving (Show)\n\n-- | Returns the extensions configuration of a format.\ngetExtensionsConfig :: T.Text -> ExtensionsConfig\ngetExtensionsConfig fmt = ExtensionsConfig\n  { extsDefault = getDefaultExtensions fmt\n  , extsSupported = getAllExtensions fmt\n  }\n\ninstance Semigroup ExtensionsConfig where\n  ExtensionsConfig x1 y1 <> ExtensionsConfig x2 y2 =\n    ExtensionsConfig (x1 <> x2) (y1 <> y2)\n\ninstance Monoid ExtensionsConfig where\n  mappend = (<>)\n  mempty = ExtensionsConfig mempty mempty\n\n-- | Apply the extension changes in the format spec to the extensions\n-- given in the format's extensions configuration. Throws an error in\n-- case of an unknown or unsupported extension.\napplyExtensionsDiff :: PandocMonad m\n                    => ExtensionsConfig\n                    -> FlavoredFormat\n                    -> m Extensions\napplyExtensionsDiff extConf (FlavoredFormat fname extsDiff) = do\n  let extsInDiff  = extsToEnable extsDiff <> extsToDisable extsDiff\n  let unsupported = extsInDiff `disableExtensions` (extsSupported extConf)\n  case extensionsToList unsupported of\n    ext:_ -> throwError $ PandocUnsupportedExtensionError\n             (showExtension ext) fname\n    []    -> pure ((extsDefault extConf `disableExtensions`\n                    extsToDisable extsDiff) <> extsToEnable extsDiff)\n\n-- | Parse a format-specifying string into a markup format and the\n-- change set to the format's extensions. Throws an error if the spec\n-- cannot be parsed or contains an unknown extension.\nparseFlavoredFormat :: PandocMonad m\n                    => T.Text\n                    -> m FlavoredFormat\nparseFlavoredFormat spec =\n  -- Paths like `latex-foo-bar.lua` or `latex-smart-citations.lua`\n  -- should be parsed as the format name. The `-` (or `+`) in the\n  -- filename would confuse the extensions parser, so, if `spec` looks\n  -- like a filename, the file's basename is split off into the prefix.\n  -- Only the remaining part is parsed, and the prefix is appended back\n  -- to the format after parsing.\n  case parse (fixSourcePos *> formatSpec) \"\" spec' of\n    Right (fname, extsDiff) -> pure (FlavoredFormat (prefix <> fname) extsDiff)\n    Left err -> throwError $ PandocFormatError spec (T.pack $ show err)\n  where\n    fixSourcePos = do\n      pos <- getPosition\n      setPosition (incSourceColumn pos (T.length prefix))\n    formatSpec = do\n      name <- parseFormatName\n      extsDiff <- pExtensionsDiff\n      return ( T.pack name, extsDiff )\n    parseFormatName = many1 $ noneOf \"-+\"\n    (prefix, spec') = case splitExtension (T.unpack spec) of\n                        (_, \"\") -> (\"\", T.toLower spec) -- no extension\n                        (p,s)   -> (T.pack p, T.pack s)\n\npExtensionsDiff :: (UpdateSourcePos s Char, Stream s m Char)\n                => ParsecT s u m ExtensionsDiff\npExtensionsDiff = L.foldl' (flip ($)) mempty <$> many extMod\n  where\n    extMod = do\n      polarity <- oneOf \"-+\"\n      name <- many $ noneOf \"-+\"\n      let ext = readExtension name\n      return $ \\extsDiff ->\n        case polarity of\n          '+' -> extsDiff{extsToEnable  = enableExtension ext $\n                                          extsToEnable extsDiff}\n          _   -> extsDiff{extsToDisable = enableExtension ext $\n                                          extsToDisable extsDiff}\n\n-- | Determines default format based on file extensions; uses the format\n-- of the first extension that's associated with a format.\n--\n-- Examples:\n--\n-- > formatFromFilePaths [\"text.unknown\", \"no-extension\"]\n-- Nothing\n--\n-- > formatFromFilePaths [\"my.md\", \"other.rst\"]\n-- Just \"markdown\"\nformatFromFilePaths :: [FilePath] -> (Maybe FlavoredFormat)\nformatFromFilePaths = asum . map formatFromFilePath\n\n-- | Determines format based on file extension.\nformatFromFilePath :: FilePath -> Maybe FlavoredFormat\nformatFromFilePath x =\n  case takeExtension (map toLower fpath) of\n    \".Rmd\"      -> defFlavor \"markdown\"\n    \".adoc\"     -> defFlavor \"asciidoc\"\n    \".asciidoc\" -> defFlavor \"asciidoc\"\n    \".bib\"      -> defFlavor \"biblatex\"\n    \".context\"  -> defFlavor \"context\"\n    \".csv\"      -> defFlavor \"csv\"\n    \".ctx\"      -> defFlavor \"context\"\n    \".db\"       -> defFlavor \"docbook\"\n    \".dj\"       -> defFlavor \"djot\"\n    \".djvu\"     -> defFlavor \"djvu\" -- so we get an \"unknown reader\" error\n    \".doc\"      -> defFlavor \"doc\"  -- so we get an \"unknown reader\" error\n    \".docx\"     -> defFlavor \"docx\"\n    \".dokuwiki\" -> defFlavor \"dokuwiki\"\n    \".epub\"     -> defFlavor \"epub\"\n    \".fb2\"      -> defFlavor \"fb2\"\n    \".htm\"      -> defFlavor \"html\"\n    \".html\"     -> defFlavor \"html\"\n    \".icml\"     -> defFlavor \"icml\"\n    \".ipynb\"    -> defFlavor \"ipynb\"\n    \".json\"     -> defFlavor \"json\"\n    \".latex\"    -> defFlavor \"latex\"\n    \".lhs\"      -> defFlavor \"markdown\" `withExtension` Ext_literate_haskell\n    \".ltx\"      -> defFlavor \"latex\"\n    \".markdown\" -> defFlavor \"markdown\"\n    \".markua\"   -> defFlavor \"markua\"\n    \".md\"       -> defFlavor \"markdown\"\n    \".mdown\"    -> defFlavor \"markdown\"\n    \".mdwn\"     -> defFlavor \"markdown\"\n    \".mkd\"      -> defFlavor \"markdown\"\n    \".mkdn\"     -> defFlavor \"markdown\"\n    \".ms\"       -> defFlavor \"ms\"\n    \".muse\"     -> defFlavor \"muse\"\n    \".native\"   -> defFlavor \"native\"\n    \".ods\"      -> defFlavor \"ods\"  -- so we get an \"unknown reader\" error\n    \".odp\"      -> defFlavor \"odp\"  -- so we get an \"unknown reader\" error\n    \".odf\"      -> defFlavor \"odf\"  -- so we get an \"unknown reader\" error\n    \".odt\"      -> defFlavor \"odt\"\n    \".opml\"     -> defFlavor \"opml\"\n    \".org\"      -> defFlavor \"org\"\n    \".pdf\"      -> defFlavor \"pdf\"  -- so we get an \"unknown reader\" error\n    \".pl\"       -> defFlavor \"pod\"\n    \".pm\"       -> defFlavor \"pod\"\n    \".pod\"      -> defFlavor \"pod\"\n    \".pptx\"     -> defFlavor \"pptx\"\n    \".ris\"      -> defFlavor \"ris\"\n    \".roff\"     -> defFlavor \"ms\"\n    \".rst\"      -> defFlavor \"rst\"\n    \".rtf\"      -> defFlavor \"rtf\"\n    \".s5\"       -> defFlavor \"s5\"\n    \".t2t\"      -> defFlavor \"t2t\"\n    \".tei\"      -> defFlavor \"tei\"\n    \".tex\"      -> defFlavor \"latex\"\n    \".texi\"     -> defFlavor \"texinfo\"\n    \".texinfo\"  -> defFlavor \"texinfo\"\n    \".text\"     -> defFlavor \"markdown\"\n    \".textile\"  -> defFlavor \"textile\"\n    \".tsv\"      -> defFlavor \"tsv\"\n    \".txt\"      -> defFlavor \"markdown\"\n    \".typ\"      -> defFlavor \"typst\"\n    \".wiki\"     -> defFlavor \"mediawiki\"\n    \".xhtml\"    -> defFlavor \"html\"\n    \".xls\"      -> defFlavor \"xls\"   -- so we get an \"unknown reader\" error\n    \".xlsx\"     -> defFlavor \"xlsx\"  -- so we get an \"unknown reader\" error\n    \".xml\"      -> defFlavor \"xml\"\n    \".zip\"      -> defFlavor \"zip\"  -- so we get an \"unknown reader\" error\n    ['.',y]     | y `elem` ['1'..'9'] -> defFlavor \"man\"\n    _           -> Nothing\n where\n  defFlavor f = Just (FlavoredFormat f mempty)\n  withExtension Nothing _ = Nothing\n  withExtension (Just (FlavoredFormat f ed)) ext = Just $\n    FlavoredFormat f (ed <> ExtensionsDiff (extensionsFromList [ext]) mempty)\n  fpath = case parseURI x of\n            Nothing -> x\n            Just URI{ uriPath = \"\" } -> \"index.html\"\n            Just URI{ uriPath = \"/\" } -> \"index.html\"\n            Just URI{ uriPath = up } -> up\n"
  },
  {
    "path": "src/Text/Pandoc/Highlighting.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Highlighting\n   Copyright   : Copyright (C) 2008-2025 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nExports functions for syntax highlighting.\n-}\n\nmodule Text.Pandoc.Highlighting ( highlightingStyles\n                                , languages\n                                , languagesByExtension\n                                , highlight\n                                -- * Formats\n                                -- ** LaTeX\n                                , formatLaTeXInline\n                                , formatLaTeXBlock\n                                , styleToLaTeX\n                                -- ** HTML\n                                , formatHtmlInline\n                                , formatHtmlBlock\n                                , formatHtml4Block\n                                , styleToCss\n                                -- ** ConTeXt\n                                , formatConTeXtInline\n                                , formatConTeXtBlock\n                                , styleToConTeXt\n                                , formatANSI\n                                -- ** Typst\n                                , formatTypstBlock\n                                , formatTypstInline\n                                , styleToTypst\n                                -- * Styles\n                                , defaultStyle\n                                , pygments\n                                , espresso\n                                , zenburn\n                                , tango\n                                , kate\n                                , monochrome\n                                , breezeDark\n                                , haddock\n                                , Style\n                                , lookupHighlightingStyle\n                                , fromListingsLanguage\n                                , toListingsLanguage\n                                ) where\nimport Control.Monad ( msum )\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Text as T\nimport Skylighting\n    ( SyntaxMap,\n      breezeDark,\n      espresso,\n      haddock,\n      kate,\n      monochrome,\n      pygments,\n      tango,\n      zenburn,\n      formatHtml4Block,\n      formatHtmlBlock,\n      formatHtmlInline,\n      styleToCss,\n      formatConTeXtBlock,\n      formatConTeXtInline,\n      styleToConTeXt,\n      formatLaTeXBlock,\n      formatLaTeXInline,\n      styleToLaTeX,\n      formatTypstBlock,\n      formatTypstInline,\n      styleToTypst,\n      formatANSI,\n      Style,\n      FormatOptions(containerClasses, startNumber, lineAnchors,\n                    numberLines, lineIdPrefix, codeClasses),\n      SourceLine,\n      lookupSyntax,\n      syntaxesByExtension,\n      parseTheme,\n      tokenize,\n      defaultFormatOpts,\n      TokenizerConfig(traceOutput, TokenizerConfig, syntaxMap),\n      Syntax(sShortname, sName),\n      TokenType(NormalTok) )\nimport Text.Pandoc.Definition ( Attr )\nimport Text.Pandoc.Class (PandocMonad, readFileLazy)\nimport Text.Pandoc.Error (PandocError(..))\nimport Control.Monad.Except (throwError)\nimport System.FilePath (takeExtension)\nimport Text.Pandoc.Shared (safeRead)\n\n-- | The default highlighting style used by pandoc (pygments).\ndefaultStyle :: Style\ndefaultStyle = pygments\n\nhighlightingStyles :: [(T.Text, Style)]\nhighlightingStyles =\n  [(\"pygments\", pygments),\n   (\"tango\", tango),\n   (\"espresso\", espresso),\n   (\"zenburn\", zenburn),\n   (\"kate\", kate),\n   (\"monochrome\", monochrome),\n   (\"breezedark\", breezeDark),\n   (\"haddock\", haddock)]\n\nlanguages :: SyntaxMap -> [T.Text]\nlanguages syntaxmap = [T.toLower (sName s) | s <- M.elems syntaxmap]\n\nlanguagesByExtension :: SyntaxMap -> T.Text -> [T.Text]\nlanguagesByExtension syntaxmap ext =\n  [T.toLower (sName s) | s <- syntaxesByExtension syntaxmap (T.unpack ext)]\n\nhighlight :: SyntaxMap\n          -> (FormatOptions -> [SourceLine] -> a) -- ^ Formatter\n          -> Attr   -- ^ Attributes of the CodeBlock\n          -> T.Text -- ^ Raw contents of the CodeBlock\n          -> Either T.Text a\nhighlight syntaxmap formatter (ident, classes, keyvals) rawCode =\n  let firstNum = fromMaybe 1 (safeRead (fromMaybe \"1\" $ lookup \"startFrom\" keyvals))\n      fmtOpts = defaultFormatOpts{\n                  startNumber = firstNum,\n                  lineAnchors = any (`elem`\n                        [\"line-anchors\", \"lineAnchors\"]) classes,\n                  numberLines = any (`elem`\n                        [\"number\",\"numberLines\", \"number-lines\"]) classes,\n                  lineIdPrefix = if T.null ident\n                                    then mempty\n                                    else ident <> \"-\" }\n      tokenizeOpts = TokenizerConfig{ syntaxMap = syntaxmap\n                                    , traceOutput = False }\n  in  case msum (map (`lookupSyntax` syntaxmap) classes) of\n            Nothing\n              | numberLines fmtOpts -> Right\n                              $ formatter fmtOpts{ codeClasses = [],\n                                                   containerClasses = classes }\n                              $ map (\\ln -> [(NormalTok, ln)])\n                              $ T.lines rawCode\n              | otherwise  -> Left \"\"\n            Just syntax  -> either (Left . T.pack) Right $\n              formatter fmtOpts{ codeClasses =\n                                   [T.toLower (sShortname syntax)],\n                                  containerClasses = classes } <$>\n                tokenize tokenizeOpts syntax rawCode\n\n-- Functions for correlating latex listings package's language names\n-- with skylighting language names:\n\nlangToListingsMap :: M.Map T.Text T.Text\nlangToListingsMap = M.fromList langsList\n\nlistingsToLangMap :: M.Map T.Text T.Text\nlistingsToLangMap = M.fromList $ map switch langsList\n  where switch (a,b) = (b,a)\n\nlangsList :: [(T.Text, T.Text)]\nlangsList =\n  [(\"abap\",\"ABAP\"),\n  (\"acm\",\"ACM\"),\n  (\"acmscript\",\"ACMscript\"),\n  (\"acsl\",\"ACSL\"),\n  (\"ada\",\"Ada\"),\n  (\"algol\",\"Algol\"),\n  (\"ant\",\"Ant\"),\n  (\"assembler\",\"Assembler\"),\n  (\"gnuassembler\",\"Assembler\"),\n  (\"awk\",\"Awk\"),\n  (\"bash\",\"bash\"),\n  (\"monobasic\",\"Basic\"),\n  (\"purebasic\",\"Basic\"),\n  (\"c\",\"C\"),\n  (\"cs\",\"C\"),\n  (\"objectivec\",\"C\"),\n  (\"cpp\",\"C++\"),\n  (\"c++\",\"C++\"),\n  (\"ocaml\",\"Caml\"),\n  (\"cil\",\"CIL\"),\n  (\"clean\",\"Clean\"),\n  (\"cobol\",\"Cobol\"),\n  (\"comal80\",\"Comal80\"),\n  (\"command.com\",\"command.com\"),\n  (\"comsol\",\"Comsol\"),\n  (\"csh\",\"csh\"),\n  (\"delphi\",\"Delphi\"),\n  (\"eiffel\",\"Eiffel\"),\n  (\"elan\",\"Elan\"),\n  (\"elisp\",\"elisp\"),\n  (\"erlang\",\"erlang\"),\n  (\"euphoria\",\"Euphoria\"),\n  (\"fortran\",\"Fortran\"),\n  (\"gap\",\"GAP\"),\n  (\"gcl\",\"GCL\"),\n  (\"gnuplot\",\"Gnuplot\"),\n  (\"go\",\"Go\"),\n  (\"hansl\",\"hansl\"),\n  (\"haskell\",\"Haskell\"),\n  (\"html\",\"HTML\"),\n  (\"idl\",\"IDL\"),\n  (\"inform\",\"inform\"),\n  (\"java\",\"Java\"),\n  (\"jvmis\",\"JVMIS\"),\n  (\"ksh\",\"ksh\"),\n  (\"lingo\",\"Lingo\"),\n  (\"lisp\",\"Lisp\"),\n  (\"commonlisp\",\"Lisp\"),\n  (\"llvm\",\"LLVM\"),\n  (\"logo\",\"Logo\"),\n  (\"lua\",\"Lua\"),\n  (\"make\",\"make\"),\n  (\"makefile\",\"make\"),\n  (\"mathematica\",\"Mathematica\"),\n  (\"matlab\",\"Matlab\"),\n  (\"mercury\",\"Mercury\"),\n  (\"metapost\",\"MetaPost\"),\n  (\"miranda\",\"Miranda\"),\n  (\"mizar\",\"Mizar\"),\n  (\"ml\",\"ML\"),\n  (\"modula2\",\"Modula-2\"),\n  (\"mupad\",\"MuPAD\"),\n  (\"nastran\",\"NASTRAN\"),\n  (\"oberon2\",\"Oberon-2\"),\n  (\"ocl\",\"OCL\"),\n  (\"octave\",\"Octave\"),\n  (\"oorexx\",\"OORexx\"),\n  (\"oz\",\"Oz\"),\n  (\"pascal\",\"Pascal\"),\n  (\"perl\",\"Perl\"),\n  (\"php\",\"PHP\"),\n  (\"pli\",\"PL/I\"),\n  (\"plasm\",\"Plasm\"),\n  (\"postscript\",\"PostScript\"),\n  (\"pov\",\"POV\"),\n  (\"prolog\",\"Prolog\"),\n  (\"promela\",\"Promela\"),\n  (\"pstricks\",\"PSTricks\"),\n  (\"python\",\"Python\"),\n  (\"r\",\"R\"),\n  (\"reduce\",\"Reduce\"),\n  (\"rexx\",\"Rexx\"),\n  (\"rsl\",\"RSL\"),\n  (\"ruby\",\"Ruby\"),\n  (\"s\",\"S\"),\n  (\"sas\",\"SAS\"),\n  (\"scala\",\"Scala\"),\n  (\"scilab\",\"Scilab\"),\n  (\"sh\",\"sh\"),\n  (\"shelxl\",\"SHELXL\"),\n  (\"simula\",\"Simula\"),\n  (\"sparql\",\"SPARQL\"),\n  (\"sql\",\"SQL\"),\n  (\"swift\",\"Swift\"),\n  (\"tcl\",\"tcl\"),\n  (\"tex\",\"TeX\"),\n  (\"latex\",\"TeX\"),\n  (\"vbscript\",\"VBScript\"),\n  (\"verilog\",\"Verilog\"),\n  (\"vhdl\",\"VHDL\"),\n  (\"vrml\",\"VRML\"),\n  (\"xml\",\"XML\"),\n  (\"xslt\",\"XSLT\")]\n\n-- | Determine listings language name from skylighting language name.\ntoListingsLanguage :: T.Text -> Maybe T.Text\ntoListingsLanguage lang = M.lookup (T.toLower lang) langToListingsMap\n\n-- | Determine skylighting language name from listings language name.\nfromListingsLanguage :: T.Text -> Maybe T.Text\nfromListingsLanguage lang = M.lookup lang listingsToLangMap\n\n-- | Lookup style from a name. If the name is a standard style,\n-- load it; if it ends in \".theme\", attempt to load a KDE theme\n-- from the file path specified.\nlookupHighlightingStyle :: PandocMonad m => String -> m Style\nlookupHighlightingStyle s\n  | takeExtension s == \".theme\" = -- attempt to load KDE theme\n    do contents <- readFileLazy s\n       case parseTheme contents of\n            Left _    -> throwError $ PandocOptionError $ T.pack $\n                           \"Could not read highlighting theme \" ++ s\n            Right sty -> return sty\n  | otherwise =\n  case lookup (T.toLower $ T.pack s) highlightingStyles of\n       Just sty -> return sty\n       Nothing  -> throwError $ PandocOptionError $ T.pack $\n                      \"Unknown highlight-style \" ++ s\n"
  },
  {
    "path": "src/Text/Pandoc/Image.hs",
    "content": "{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, CPP #-}\n{- |\nModule      : Text.Pandoc.Image\nCopyright   : Copyright (C) 2020-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\nStability   : alpha\nPortability : portable\n\nFunctions for converting images.\n-}\nmodule Text.Pandoc.Image ( svgToPng ) where\nimport Text.Pandoc.Process (pipeProcess)\nimport qualified Data.ByteString.Lazy as L\nimport System.Exit\nimport Data.Text (Text)\nimport Text.Pandoc.Shared (tshow)\nimport qualified Control.Exception as E\nimport Control.Monad.IO.Class (MonadIO(liftIO))\n\n-- | Convert svg image to png. rsvg-convert\n-- is used and must be available on the path.\nsvgToPng :: MonadIO m\n         => Int           -- ^ DPI\n         -> L.ByteString  -- ^ Input image as bytestring\n         -> m (Either Text L.ByteString)\nsvgToPng dpi bs = do\n  let dpi' = show dpi\n  liftIO $ E.catch\n       (do (exit, out) <- pipeProcess Nothing \"rsvg-convert\"\n                          [\"-f\",\"png\",\"-a\",\"--dpi-x\",dpi',\"--dpi-y\",dpi']\n                          bs\n           return $ if exit == ExitSuccess\n              then Right out\n              else Left \"conversion from SVG failed\")\n       (\\(e :: E.SomeException) -> return $ Left $\n           \"check that rsvg-convert is in path.\\n\" <> tshow e)\n"
  },
  {
    "path": "src/Text/Pandoc/ImageSize.hs",
    "content": "{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}\n{-# LANGUAGE ViewPatterns      #-}\n{-# OPTIONS_GHC -fno-warn-type-defaults #-}\n{- |\nModule      : Text.Pandoc.ImageSize\nCopyright   : Copyright (C) 2011-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\nStability   : alpha\nPortability : portable\n\nFunctions for determining the size of a PNG, JPEG, or GIF image.\n-}\nmodule Text.Pandoc.ImageSize ( ImageType(..)\n                             , ImageSize(..)\n                             , imageType\n                             , imageSize\n                             , sizeInPixels\n                             , sizeInPoints\n                             , desiredSizeInPoints\n                             , Dimension(..)\n                             , Direction(..)\n                             , dimension\n                             , lengthToDim\n                             , scaleDimension\n                             , inInch\n                             , inPixel\n                             , inPoints\n                             , inEm\n                             , numUnit\n                             , showInInch\n                             , showInPixel\n                             , showFl\n                             ) where\nimport Data.ByteString (ByteString)\nimport qualified Data.ByteString.Char8 as B\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Binary.Get\nimport Data.Bits ((.&.), shiftR, shiftL)\nimport Data.Word (bitReverse32, Word32)\nimport Data.Maybe (isJust, fromJust)\nimport Data.Char (isDigit)\nimport Control.Monad\nimport Text.Pandoc.Shared (safeRead)\nimport Data.Default (Default)\nimport Numeric (showFFloat)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.XML.Light hiding (Attr)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Encoding as TE\nimport Control.Applicative\nimport qualified Data.Attoparsec.ByteString as AW\nimport qualified Data.Attoparsec.ByteString.Char8 as A\nimport qualified Codec.Picture.Metadata as Metadata\nimport Codec.Picture (decodeImageWithMetadata)\nimport Codec.Compression.Zlib (decompress)\n-- import Debug.Trace\n\n-- quick and dirty functions to get image sizes\n\ndata ImageType = Png | Gif | Jpeg | Svg | Pdf | Eps | Emf | Tiff | Webp | Avif\n                 deriving Show\ndata Direction = Width | Height\ninstance Show Direction where\n  show Width  = \"width\"\n  show Height = \"height\"\n\ndata Dimension = Pixel Integer\n               | Centimeter Double\n               | Millimeter Double\n               | Inch Double\n               | Point Double\n               | Pica Double\n               | Percent Double\n               | Em Double\n               deriving Eq\n\ninstance Show Dimension where\n  show (Pixel a)      = show a              ++ \"px\"\n  show (Centimeter a) = T.unpack (showFl a) ++ \"cm\"\n  show (Millimeter a) = T.unpack (showFl a) ++ \"mm\"\n  show (Inch a)       = T.unpack (showFl a) ++ \"in\"\n  show (Point a)      = T.unpack (showFl a) ++ \"pt\"\n  show (Pica a)       = T.unpack (showFl a) ++ \"pc\"\n  show (Percent a)    = show a              ++ \"%\"\n  show (Em a)         = T.unpack (showFl a) ++ \"em\"\n\ndata ImageSize = ImageSize{\n                     pxX   :: Integer\n                   , pxY   :: Integer\n                   , dpiX  :: Integer\n                   , dpiY  :: Integer\n                   } deriving (Read, Show, Eq)\ninstance Default ImageSize where\n  def = ImageSize 300 200 72 72\n\nshowFl :: (RealFloat a) => a -> T.Text\nshowFl a = removeExtra0s $ T.pack $ showFFloat (Just 5) a \"\"\n\nremoveExtra0s :: T.Text -> T.Text\nremoveExtra0s s = case T.dropWhileEnd (=='0') s of\n  (T.unsnoc -> Just (xs, '.')) -> xs\n  xs                           -> xs\n\ndropBOM :: ByteString -> ByteString\ndropBOM bs =\n if \"\\xEF\\xBB\\xBF\" `B.isPrefixOf` bs\n    then B.drop 3 bs\n    else bs\n\nimageType :: ByteString -> Maybe ImageType\nimageType img = case B.take 4 img of\n                     \"\\x89\\x50\\x4e\\x47\" -> return Png\n                     \"\\x47\\x49\\x46\\x38\" -> return Gif\n                     \"\\x49\\x49\\x2a\\x00\" -> return Tiff\n                     \"\\x4D\\x4D\\x00\\x2a\" -> return Tiff\n                     \"\\xff\\xd8\\xff\\xbd\" -> return Jpeg  -- JPEG without application segment -- see p.32 in https://www.w3.org/Graphics/JPEG/itu-t81.pdf (and https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5?permalink_comment_id=3863054#gistcomment-3863054)\n                     _ | B.take 3 img == \"\\xff\\xd8\\xff\"\n                          && (let byte4 = B.take 1 (B.drop 3 img)\n                              in byte4 >= \"\\xe0\" && byte4 <= \"\\xef\")  -- JPEG with application segment\n                                        -> return Jpeg\n                     \"%PDF\"             -> return Pdf\n                     \"<svg\"             -> return Svg\n                     \"<?xm\"\n                       | findSvgTag img\n                                        -> return Svg\n                     \"%!PS\"\n                       |  B.take 4 (B.drop 1 $ B.dropWhile (/=' ') img) == \"EPSF\"\n                                        -> return Eps\n                     \"\\x01\\x00\\x00\\x00\"\n                       | B.take 4 (B.drop 40 img) == \" EMF\"\n                                        -> return Emf\n                     \"\\xEF\\xBB\\xBF<\" -- BOM before svg\n                          -> imageType (B.drop 3 img)\n                     \"RIFF\"\n                       | B.take 4 (B.drop 8 img) == \"WEBP\"\n                                        -> return Webp\n                     _ | B.take 4 (B.drop 4 img) == \"ftyp\" -> return Avif\n                     _ -> mzero\n\nfindSvgTag :: ByteString -> Bool\nfindSvgTag img = \"<svg\" `B.isInfixOf` img || \"<SVG\" `B.isInfixOf` img\n\nimageSize :: WriterOptions -> ByteString -> Either T.Text ImageSize\nimageSize opts img = checkDpi <$>\n  case imageType img of\n       Just Png  -> getSize img\n       Just Gif  -> getSize img\n       Just Jpeg -> getSize img\n       Just Tiff -> getSize img\n       Just Svg  -> mbToEither \"could not determine SVG size\" $ svgSize opts img\n       Just Eps  -> mbToEither \"could not determine EPS size\" $ epsSize img\n       Just Pdf  -> mbToEither \"could not determine PDF size\" $ pdfSize img\n       Just Emf  -> mbToEither \"could not determine EMF size\" $ emfSize img\n       Just Webp -> mbToEither \"could not determine WebP size\" $ webpSize opts img\n       Just Avif -> mbToEither \"could not determine AVIF size\" $ avifSize opts img\n       Nothing   -> Left \"could not determine image type\"\n  where mbToEither msg Nothing  = Left msg\n        mbToEither _   (Just x) = Right x\n        -- see #6880, some defective JPEGs may encode dpi 0, so default to 72\n        -- if that value is 0\n        checkDpi size =\n          size{ dpiX = if dpiX size == 0 then 72 else dpiX size\n              , dpiY = if dpiY size == 0 then 72 else dpiY size }\n\n\nsizeInPixels :: ImageSize -> (Integer, Integer)\nsizeInPixels s = (pxX s, pxY s)\n\n-- | Calculate (height, width) in points using the image file's dpi metadata,\n-- using 72 Points == 1 Inch.\nsizeInPoints :: ImageSize -> (Double, Double)\nsizeInPoints s = (pxXf * 72 / dpiXf, pxYf * 72 / dpiYf)\n  where\n    pxXf  = fromIntegral $ pxX s\n    pxYf  = fromIntegral $ pxY s\n    dpiXf = fromIntegral $ dpiX s\n    dpiYf = fromIntegral $ dpiY s\n\n-- | Calculate (height, width) in points, considering the desired dimensions in the\n-- attribute, while falling back on the image file's dpi metadata if no dimensions\n-- are specified in the attribute (or only dimensions in percentages).\ndesiredSizeInPoints :: WriterOptions -> Attr -> ImageSize -> (Double, Double)\ndesiredSizeInPoints opts attr s =\n  case (getDim Width, getDim Height) of\n    (Just w, Just h)   -> (w, h)\n    (Just w, Nothing)  -> (w, w / ratio)\n    (Nothing, Just h)  -> (h * ratio, h)\n    (Nothing, Nothing) -> sizeInPoints s\n  where\n    ratio = fromIntegral (pxX s) / fromIntegral (pxY s)\n    getDim dir = case dimension dir attr of\n                   Just (Percent _) -> Nothing\n                   Just dim         -> Just $ inPoints opts dim\n                   Nothing          -> Nothing\n\ninPoints :: WriterOptions -> Dimension -> Double\ninPoints opts dim = 72 * inInch opts dim\n\ninEm :: WriterOptions -> Dimension -> Double\ninEm opts dim = (64/11) * inInch opts dim\n\ninInch :: WriterOptions -> Dimension -> Double\ninInch opts dim =\n  case dim of\n    (Pixel a)      -> fromIntegral a / fromIntegral (writerDpi opts)\n    (Centimeter a) -> a * 0.3937007874\n    (Millimeter a) -> a * 0.03937007874\n    (Inch a)       -> a\n    (Point a)      -> (a / 72)\n    (Pica a)       -> (a / 6)\n    (Percent _)    -> 0\n    (Em a)         -> a * (11/64)\n\ninPixel :: WriterOptions -> Dimension -> Integer\ninPixel opts dim =\n  case dim of\n    (Pixel a)      -> a\n    _              -> floor (dpi * inInch opts dim)\n  where\n    dpi = fromIntegral $ writerDpi opts\n\n-- | Convert a Dimension to Text denoting its equivalent in inches, for example \"2.00000\".\n-- Note: Dimensions in percentages are converted to the empty string.\nshowInInch :: WriterOptions -> Dimension -> T.Text\nshowInInch _ (Percent _) = \"\"\nshowInInch opts dim = showFl $ inInch opts dim\n\n-- | Convert a Dimension to Text denoting its equivalent in pixels, for example \"600\".\n-- Note: Dimensions in percentages are converted to the empty string.\nshowInPixel :: WriterOptions -> Dimension -> T.Text\nshowInPixel _ (Percent _) = \"\"\nshowInPixel opts dim = T.pack $ show $ inPixel opts dim\n\n-- | Maybe split a string into a leading number and trailing unit, e.g. \"3cm\" to Just (3.0, \"cm\")\nnumUnit :: T.Text -> Maybe (Double, T.Text)\nnumUnit s =\n  let (nums, unit) = T.span (\\c -> isDigit c || ('.'==c)) s\n  in (\\n -> (n, unit)) <$> safeRead nums\n\n-- | Scale a dimension by a factor.\nscaleDimension :: Double -> Dimension -> Dimension\nscaleDimension factor dim =\n  case dim of\n        Pixel x      -> Pixel (round $ factor * fromIntegral x)\n        Centimeter x -> Centimeter (factor * x)\n        Millimeter x -> Millimeter (factor * x)\n        Inch x       -> Inch (factor * x)\n        Point x      -> Point (factor * x)\n        Pica x       -> Pica (factor * x)\n        Percent x    -> Percent (factor * x)\n        Em x         -> Em (factor * x)\n\n-- | Read a Dimension from an Attr attribute.\n-- `dimension Width attr` might return `Just (Pixel 3)` or for example `Just (Centimeter 2.0)`, etc.\ndimension :: Direction -> Attr -> Maybe Dimension\ndimension dir (_, _, kvs) =\n  case dir of\n    Width  -> extractDim \"width\"\n    Height -> extractDim \"height\"\n  where\n    extractDim key = lookup key kvs >>= lengthToDim\n\nlengthToDim :: T.Text -> Maybe Dimension\nlengthToDim s = numUnit s >>= uncurry toDim\n  where\n    toDim a \"cm\"   = Just $ Centimeter a\n    toDim a \"mm\"   = Just $ Millimeter a\n    toDim a \"in\"   = Just $ Inch a\n    toDim a \"inch\" = Just $ Inch a\n    toDim a \"%\"    = Just $ Percent a\n    toDim a \"px\"   = Just $ Pixel (floor a::Integer)\n    toDim a \"\"     = Just $ Pixel (floor a::Integer)\n    toDim a \"pt\"   = Just $ Point a\n    toDim a \"pc\"   = Just $ Pica a\n    toDim a \"em\"   = Just $ Em a\n    toDim _ _      = Nothing\n\nepsSize :: ByteString -> Maybe ImageSize\nepsSize img = do\n  let ls = takeWhile (\"%\" `B.isPrefixOf`) $ B.lines img\n  let ls' = dropWhile (not . (\"%%BoundingBox:\" `B.isPrefixOf`)) ls\n  case ls' of\n       []    -> mzero\n       (x:_) -> case B.words x of\n                     [_, _, _, ux, uy] -> do\n                        ux' <- safeRead $ TE.decodeUtf8 ux\n                        uy' <- safeRead $ TE.decodeUtf8 uy\n                        return ImageSize{\n                            pxX  = ux'\n                          , pxY  = uy'\n                          , dpiX = 72\n                          , dpiY = 72 }\n                     _ -> mzero\n\npdfSize :: ByteString -> Maybe ImageSize\npdfSize img =\n  case A.parseOnly pPdfSize img of\n    Left _   -> Nothing\n    Right sz -> Just sz\n\npPdfSize :: A.Parser ImageSize\npPdfSize =\n  (A.takeWhile1 (/= '/') *> pPdfSize)\n  <|>\n  (do A.string \"/MediaBox\"\n      A.skipSpace\n      A.char8 '['\n      A.skipSpace\n      [x1,y1,x2,y2] <- A.count 4 $ do\n        A.skipSpace\n        raw <- A.many1 $ A.satisfy (\\c -> isDigit c || c == '.')\n        case safeRead $ T.pack raw of\n          Just (r :: Double) -> return $ floor r\n          Nothing            -> mzero\n      A.skipSpace\n      A.char8 ']'\n      return $ ImageSize{\n              pxX  = x2 - x1\n            , pxY  = y2 - y1\n            , dpiX = 72\n            , dpiY = 72 }\n  )\n  <|> -- if we encounter a compressed object stream, uncompress it (#10902)\n  (do A.string \"/Type\"\n      A.skipSpace\n      A.string \"/ObjStm\"\n      _ <- A.manyTill pLine (A.string \"stream\" *> pEol)\n      stream <- BL.pack <$> A.manyTill\n                        (AW.satisfy (const True))\n                        (pEol *> A.string \"endstream\" *> pEol)\n      let contents = BL.toStrict (decompress stream)\n      case A.parseOnly pPdfSize contents of\n        Left _ -> pPdfSize\n        Right is -> pure is)\n  <|>\n  (A.char '/' *> pPdfSize)\n where\n   iseol '\\r' = True\n   iseol '\\n' = True\n   iseol _ = False\n   pEol = A.satisfy iseol *> A.skipMany (A.satisfy iseol)\n   pLine = A.takeWhile (not . iseol) <* pEol\n\ngetSize :: ByteString -> Either T.Text ImageSize\ngetSize img =\n  case decodeImageWithMetadata img of\n    Left e -> Left (T.pack e)\n    Right (_, meta) -> do\n      pxx <- maybe (Left \"Could not determine width\") Right $\n                   Metadata.lookup Metadata.Width meta\n      pxy <- maybe (Left \"Could not determine height\") Right $\n                   Metadata.lookup Metadata.Height meta\n      dpix <- maybe (Right 72) Right $ Metadata.lookup Metadata.DpiX meta\n      dpiy <- maybe (Right 72) Right $ Metadata.lookup Metadata.DpiY meta\n      return $ ImageSize\n                { pxX = fromIntegral pxx\n                , pxY = fromIntegral pxy\n                , dpiX = fromIntegral dpix\n                , dpiY = fromIntegral dpiy }\n\nsvgSize :: WriterOptions -> ByteString -> Maybe ImageSize\nsvgSize opts img = do\n  doc <- either (const mzero) return $ parseXMLElement\n                                     $ TL.fromStrict $ UTF8.toText $ dropBOM img\n  let viewboxSize = do\n        vb <- findAttrBy (== QName \"viewBox\" Nothing Nothing) doc\n        [_,_,w,h] <- mapM safeRead (T.words vb)\n        return (w,h)\n  let dpi = fromIntegral $ writerDpi opts\n  let dirToInt dir = do\n        dim <- findAttrBy (== QName dir Nothing Nothing) doc >>= lengthToDim\n        case dim of\n           Percent _ -> mzero\n           _ -> pure $ inPixel opts dim\n  w <- dirToInt \"width\" <|> (fst <$> viewboxSize)\n  h <- dirToInt \"height\" <|> (snd <$> viewboxSize)\n  return ImageSize {\n    pxX  = w\n  , pxY  = h\n  , dpiX = dpi\n  , dpiY = dpi\n  }\n\nemfSize :: ByteString -> Maybe ImageSize\nemfSize img =\n  let\n    parseheader = runGetOrFail $ do\n      skip 0x18             -- 0x00\n      frameL <- getWord32le -- 0x18  measured in 1/100 of a millimetre\n      frameT <- getWord32le -- 0x1C\n      frameR <- getWord32le -- 0x20\n      frameB <- getWord32le -- 0x24\n      skip 0x20             -- 0x28\n      deviceX <- getWord32le  -- 0x48 pixels of reference device\n      deviceY <- getWord32le  -- 0x4C\n      mmX <- getWord32le      -- 0x50 real mm of reference device (always 320*240?)\n      mmY <- getWord32le      -- 0x58\n      -- end of header\n      let\n        w = (deviceX * (frameR - frameL)) `quot` (mmX * 100)\n        h = (deviceY * (frameB - frameT)) `quot` (mmY * 100)\n        dpiW = (deviceX * 254) `quot` (mmX * 10)\n        dpiH = (deviceY * 254) `quot` (mmY * 10)\n      return $ ImageSize\n        { pxX = fromIntegral w\n        , pxY = fromIntegral h\n        , dpiX = fromIntegral dpiW\n        , dpiY = fromIntegral dpiH\n        }\n  in\n    case parseheader . BL.fromStrict $ img of\n      Left _ -> Nothing\n      Right (_, _, size) -> Just size\n\n-- See https://developers.google.com/speed/webp/docs/riff_container\n-- and RFC 6386\npWebpSize :: AW.Parser ImageSize\npWebpSize = do\n  AW.string \"RIFF\"\n  AW.take 4\n  AW.string \"WEBP\"\n  (w, h) <- lossy <|> lossless <|> extended\n  return $ def\n    { pxX = w\n    , pxY = h\n    }\n  where\n    bitsToMaybe = either (const Nothing) (\\((_, _, s)) -> Just s)\n    decode d = bitsToMaybe . d . BL.fromStrict\n    lossySize = runGetOrFail $ do\n      word <- getWord16le\n      return $ word .&. 0x3FFF\n    lossy = do\n      AW.string \"VP8 \"\n      AW.take 4 -- length in bytes of VP8 Lossy stream size\n      keyFrame <-  AW.anyWord8\n      guard $ keyFrame .&. 1 == 0\n      AW.take 2 -- remaining bytes of frame header\n      AW.word8 0x9d  -- VP8 keyframe magic\n      AW.word8 0x01\n      AW.word8 0x2a\n      width16 <- AW.take 2\n      height16 <- AW.take 2\n      let w = toInteger <$> decode lossySize width16\n          h = toInteger <$> decode lossySize height16\n      guard $ isJust w && isJust h\n      return (fromJust w, fromJust h)\n    losslessSizes = runGetOrFail $ do\n      bitReverse32 <$> getWord32le\n    losslessSize word = 1 + (word .&. 0x3FFF)\n    lossless = do\n      AW.string \"VP8L\"\n      AW.take 4 -- length in bytes of VP8 Lossless chunk size\n      AW.word8 0x2f  -- webp lossless stream magic\n      sizes <- AW.take 4\n      let mbword = decode losslessSizes sizes\n      guard $ isJust mbword\n      let word = fromJust mbword\n      let w = toInteger $ losslessSize word\n          h = toInteger $ losslessSize (word `shiftR` 14)\n      return (w, h)\n    extendedSize = runGetOrFail $ do\n      low <- toInteger <$> getWord16le\n      high <- toInteger <$> getWord8\n      return $ 1 + (high `shiftL` 16) + (low)\n    extended = do\n      AW.string \"VP8X\"\n      AW.take 8  -- VP8X chunk length, flags and reserved area\n      width24 <- AW.take 3\n      height24 <- AW.take 3\n      let w = decode extendedSize width24\n          h = decode extendedSize height24\n      guard $ isJust w && isJust h\n      return (fromJust w, fromJust h)\n\nwebpSize :: WriterOptions -> ByteString -> Maybe ImageSize\nwebpSize opts img =\n  case AW.parseOnly pWebpSize img of\n    Left _   -> Nothing\n    Right sz -> Just sz { dpiX = fromIntegral $ writerDpi opts, dpiY = fromIntegral $ writerDpi opts}\n\navifSize :: WriterOptions -> ByteString -> Maybe ImageSize\navifSize _opts img =\n  case runGetOrFail (verifyFtyp >> findAvifDimensions) (BL.fromStrict img) of\n    Left (_, _, _err) -> Nothing\n    Right (_, _, (width, height)) ->\n      Just $ ImageSize { pxX = fromIntegral width\n                       , pxY = fromIntegral height\n                       , dpiX = 72\n                       , dpiY = 72 }\n\n---- AVIF parsing:\n\nverifyFtyp :: Get ()\nverifyFtyp = do\n  ftypSize <- getWord32be\n  when (ftypSize < 16) $ fail \"Invalid ftyp size\"\n\n  ftyp <- getByteString 4\n  unless (ftyp == \"ftyp\") $ fail \"ftyp signature not found\"\n\n  brand <- getByteString 4\n  unless (brand == \"avif\" || brand == \"avis\") $ fail \"Not an AVIF file\"\n\n  -- Skip minor version and compatible brands\n  -- (we've read 12 bytes: size+type+brand)\n  let remaining_ftyp = fromIntegral ftypSize - 12\n  when (remaining_ftyp > 0) $ skip remaining_ftyp\n\nfindAvifDimensions :: Get (Word32, Word32)\nfindAvifDimensions = searchAvifBoxes []\n\nsearchAvifBoxes :: [B.ByteString] -> Get (Word32, Word32)\nsearchAvifBoxes path = do\n  isempty <- isEmpty\n  if isempty\n    then fail $ \"No dimensions found. Searched: \" ++ show (reverse path)\n    else do\n      boxSize <- getWord32be\n      boxType <- getByteString 4\n\n      let contentSize = fromIntegral boxSize - 8\n      let newPath = boxType : path\n\n      -- If it's a container box, search inside it\n      if isContainerBox boxType\n        then searchInsideBox contentSize newPath\n        else do\n          -- Try to parse dimensions from this box\n          result <- tryParseDimensions boxType contentSize\n          case result of\n            Just dims -> return dims\n            Nothing -> do\n              -- Skip this box and continue\n              when (contentSize > 0 && contentSize < 10000000) $\n                skip contentSize\n              searchAvifBoxes path\n\ntryParseDimensions :: B.ByteString -> Int -> Get (Maybe (Word32, Word32))\ntryParseDimensions boxType size = do\n  pos <- bytesRead\n  result <- case boxType of\n    \"ispe\" -> parseIspeBox\n    \"tkhd\" -> parseTkhdBox\n    \"stsd\" -> parseStsdBox\n    \"av01\" -> parseAv01Box\n    _ -> return Nothing\n\n  -- Reset position if we didn't find dimensions\n  case result of\n    Nothing -> do\n      newPos <- bytesRead\n      let consumed = fromIntegral (newPos - pos)\n      case size - consumed of\n        n | n > 0 -> skip n\n        _ -> return ()\n    Just _ -> return ()\n\n  return result\n\nparseIspeBox :: Get (Maybe (Word32, Word32))\nparseIspeBox = do\n  skip 4  -- version/flags\n  width <- getWord32be\n  height <- getWord32be\n  return $ Just (width, height)\n\nparseTkhdBox :: Get (Maybe (Word32, Word32))\nparseTkhdBox = do\n  version <- getWord8\n  skip 3  -- flags\n\n  -- Skip to width/height based on version\n  let skipBytes = if version == 1 then 76 else 64\n  skip skipBytes\n\n  width <- getWord32be\n  height <- getWord32be\n  -- Convert from 16.16 fixed point\n  return $ Just (width `shiftR` 16, height `shiftR` 16)\n\nparseStsdBox :: Get (Maybe (Word32, Word32))\nparseStsdBox = do\n  skip 8  -- version, flags, entry count\n  findAv01Entry\n\nfindAv01Entry :: Get (Maybe (Word32, Word32))\nfindAv01Entry = do\n  entrySize <- getWord32be\n  codec <- getByteString 4\n\n  if codec == \"av01\"\n    then do\n      skip 6  -- reserved\n      skip 2  -- data reference index\n      skip 16 -- pre-defined + reserved\n      width <- getWord16be\n      height <- getWord16be\n      return $ Just (fromIntegral width, fromIntegral height)\n    else do\n      let skipSize = fromIntegral entrySize - 8\n      when (skipSize > 0) $ skip skipSize\n      findAv01Entry\n\nparseAv01Box :: Get (Maybe (Word32, Word32))\nparseAv01Box = do\n  skip 6   -- reserved\n  skip 2   -- data reference index\n  skip 16  -- predefined/reserved\n  width <- getWord16be\n  height <- getWord16be\n  return $ Just (fromIntegral width, fromIntegral height)\n\nsearchInsideBox :: Int -> [B.ByteString] -> Get (Word32, Word32)\nsearchInsideBox size path = do\n  -- For meta boxes, skip version/flags\n  let isMeta = case path of\n                 \"meta\":_ -> True\n                 _ -> False\n  when isMeta $ skip 4\n\n  let searchSize = if isMeta then size - 4 else size\n  searchAvifBoxesInRange searchSize path\n\nsearchAvifBoxesInRange :: Int -> [B.ByteString] -> Get (Word32, Word32)\nsearchAvifBoxesInRange remaining' path\n  | remaining' < 8 = searchAvifBoxes path\n  | otherwise = do\n      boxSize <- getWord32be\n      boxType <- getByteString 4\n\n      let contentSize = fromIntegral boxSize - 8\n      let newPath = boxType : path\n\n      when (contentSize < 0 || fromIntegral boxSize > remaining') $ do\n        fail $ \"Malformed box at path: \" ++ show (reverse newPath)\n\n      if isContainerBox boxType\n        then searchInsideBox contentSize newPath\n        else do\n          result <- tryParseDimensions boxType contentSize\n          case result of\n            Just dims -> return dims\n            Nothing -> do\n              -- Don't skip here - tryParseDimensions already handled it\n              searchAvifBoxesInRange (remaining' - fromIntegral boxSize) path\n\nisContainerBox :: B.ByteString -> Bool\nisContainerBox boxType = boxType `elem`\n  [\"moov\", \"trak\", \"mdia\", \"minf\", \"stbl\", \"meta\", \"dinf\", \"ipco\", \"iprp\"]\n"
  },
  {
    "path": "src/Text/Pandoc/Logging.hs",
    "content": "{-# LANGUAGE DeriveDataTypeable #-}\n{-# LANGUAGE DeriveGeneric      #-}\n{-# LANGUAGE OverloadedStrings  #-}\n{- |\n   Module      : Text.Pandoc.Logging\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nThis module provides data types and functions for warnings\nand info messages.\n\n-}\nmodule Text.Pandoc.Logging (\n    Verbosity(..)\n  , LogMessage(..)\n  , encodeLogMessages\n  , showLogMessage\n  , messageVerbosity\n  ) where\n\nimport Control.Monad (mzero)\nimport Data.Aeson\nimport Data.Aeson.Encode.Pretty (Config (..), defConfig, encodePretty',\n                                 keyOrder)\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Data (Data, toConstr)\nimport qualified Data.Text as Text\nimport Data.Text (Text)\nimport Data.Typeable (Typeable)\nimport GHC.Generics (Generic)\nimport Text.Pandoc.Definition\nimport Text.Parsec.Pos\nimport Text.Pandoc.Shared (tshow)\n\n-- | Verbosity level.\ndata Verbosity = ERROR | WARNING | INFO\n     deriving (Show, Read, Eq, Data, Enum, Ord, Bounded, Typeable, Generic)\n\ninstance ToJSON Verbosity where\n  toJSON x = toJSON (show x)\ninstance FromJSON Verbosity where\n  parseJSON (String t) =\n    case t of\n         \"ERROR\"   -> return ERROR\n         \"WARNING\" -> return WARNING\n         \"INFO\"    -> return INFO\n         _         -> mzero\n  parseJSON _      =  mzero\n\ndata LogMessage =\n    SkippedContent Text SourcePos\n  | IgnoredElement Text\n  | DuplicateLinkReference Text SourcePos\n  | DuplicateNoteReference Text SourcePos\n  | NoteDefinedButNotUsed Text SourcePos\n  | DuplicateIdentifier Text SourcePos\n  | ReferenceNotFound Text SourcePos\n  | CircularReference Text SourcePos\n  | UndefinedToggle Text SourcePos\n  | ParsingUnescaped Text SourcePos\n  | CouldNotLoadIncludeFile Text SourcePos\n  | CouldNotParseIncludeFile Text SourcePos\n  | MacroAlreadyDefined Text SourcePos\n  | InlineNotRendered Inline\n  | BlockNotRendered Block\n  | DocxParserWarning Text\n  | PowerpointTemplateWarning Text\n  | IgnoredIOError Text\n  | CouldNotFetchResource Text Text\n  | CouldNotDetermineImageSize Text Text\n  | CouldNotConvertImage Text Text\n  | CouldNotDetermineMimeType Text\n  | CouldNotConvertTeXMath Text Text\n  | CouldNotParseCSS Text\n  | Fetching Text\n  | Extracting Text\n  | LoadedResource FilePath FilePath\n  | ScriptingInfo Text (Maybe SourcePos)\n  | ScriptingWarning Text (Maybe SourcePos)\n  | NoTitleElement Text\n  | NoLangSpecified\n  | InvalidLang Text\n  | CouldNotHighlight Text\n  | MissingCharacter Text\n  | Deprecated Text Text\n  | NoTranslation Text\n  | CouldNotLoadTranslations Text Text\n  | UnusualConversion Text\n  | UnexpectedXmlElement Text Text\n  | UnknownOrgExportOption Text\n  | CouldNotDeduceFormat [Text] Text\n  | RunningFilter FilePath\n  | FilterCompleted FilePath Integer\n  | CiteprocWarning Text\n  | ATXHeadingInLHS Int Text\n  | EnvironmentVariableUndefined Text\n  | DuplicateAttribute Text Text\n  | NotUTF8Encoded FilePath\n  | MakePDFInfo Text Text\n  | MakePDFWarning Text\n  | UnclosedDiv SourcePos SourcePos\n  | UnsupportedCodePage Int\n  | YamlWarning SourcePos Text\n  | UnsupportedPdfStandard Text\n  deriving (Show, Eq, Data, Ord, Typeable, Generic)\n\ninstance ToJSON LogMessage where\n  toJSON x = object $\n    \"verbosity\" .= toJSON (messageVerbosity x) :\n    \"type\" .= toJSON (show $ toConstr x) :\n    \"pretty\" .= toJSON (showLogMessage x) :\n    case x of\n      SkippedContent s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= sourceLine pos,\n            \"column\" .= sourceColumn pos]\n      IgnoredElement s ->\n           [\"contents\" .= s]\n      DuplicateLinkReference s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      NoteDefinedButNotUsed s pos ->\n           [\"key\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      DuplicateNoteReference s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      DuplicateIdentifier s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      ReferenceNotFound s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      CircularReference s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      UndefinedToggle s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      ParsingUnescaped s pos ->\n           [\"contents\" .= s,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      CouldNotLoadIncludeFile fp pos ->\n           [\"path\" .= fp,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      CouldNotParseIncludeFile fp pos ->\n           [\"path\" .= fp,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      MacroAlreadyDefined name pos ->\n           [\"name\" .= name,\n            \"source\" .= sourceName pos,\n            \"line\" .= toJSON (sourceLine pos),\n            \"column\" .= toJSON (sourceColumn pos)]\n      InlineNotRendered il ->\n           [\"contents\" .= toJSON il]\n      BlockNotRendered bl ->\n           [\"contents\" .= toJSON bl]\n      DocxParserWarning s ->\n           [\"contents\" .= s]\n      PowerpointTemplateWarning s ->\n           [\"contents\" .= s]\n      IgnoredIOError s ->\n           [\"contents\" .= s]\n      CouldNotFetchResource fp s ->\n           [\"path\" .= fp,\n            \"message\" .= s]\n      CouldNotDetermineImageSize fp s ->\n           [\"path\" .= fp,\n            \"message\" .= s]\n      CouldNotConvertImage fp s ->\n           [\"path\" .= fp,\n            \"message\" .= s]\n      CouldNotDetermineMimeType fp ->\n           [\"path\" .= fp]\n      CouldNotConvertTeXMath s msg ->\n           [\"contents\" .= s,\n            \"message\" .= msg]\n      CouldNotParseCSS msg ->\n           [\"message\" .= msg]\n      Fetching fp ->\n           [\"path\" .= fp]\n      Extracting fp ->\n           [\"path\" .= fp]\n      LoadedResource orig found ->\n           [\"for\"  .= orig\n           ,\"from\" .= found]\n      ScriptingInfo msg mbpos ->\n           [\"message\" .= msg] <>\n           case mbpos of\n             Nothing  -> []\n             Just pos -> [\"source\" .= sourceName pos\n                         ,\"line\" .= toJSON (sourceLine pos)\n                         ,\"column\" .= toJSON (sourceColumn pos)\n                         ]\n      ScriptingWarning msg mbpos ->\n           [\"message\" .= msg] <>\n           case mbpos of\n             Nothing  -> []\n             Just pos -> [\"source\" .= sourceName pos\n                         ,\"line\" .= toJSON (sourceLine pos)\n                         ,\"column\" .= toJSON (sourceColumn pos)\n                         ]\n      NoTitleElement fallback ->\n           [\"fallback\" .= fallback]\n      NoLangSpecified -> []\n      InvalidLang s ->\n           [\"lang\" .= s]\n      CouldNotHighlight msg ->\n           [\"message\" .= msg]\n      MissingCharacter msg ->\n           [\"message\" .= msg]\n      Deprecated thing msg ->\n           [\"thing\" .= thing,\n            \"message\" .= msg]\n      NoTranslation term ->\n           [\"term\" .= term]\n      CouldNotLoadTranslations lang msg ->\n           [\"lang\" .= lang,\n            \"message\" .= msg]\n      UnusualConversion msg ->\n           [\"message\" .= msg]\n      UnexpectedXmlElement element parent ->\n           [\"element\" .= element,\n            \"parent\" .= parent]\n      UnknownOrgExportOption option ->\n           [\"option\" .= option]\n      CouldNotDeduceFormat exts format ->\n           [\"extensions\" .= exts\n           ,\"format\" .= format]\n      RunningFilter fp ->\n           [\"path\" .= Text.pack fp ]\n      FilterCompleted fp ms ->\n           [\"path\" .= Text.pack fp\n           ,\"milliseconds\" .= Text.pack (show ms) ]\n      CiteprocWarning msg ->\n           [\"message\" .= msg]\n      ATXHeadingInLHS lvl contents ->\n           [\"level\" .= lvl\n           ,\"contents\" .= contents]\n      EnvironmentVariableUndefined var ->\n           [\"variable\" .= var ]\n      DuplicateAttribute attr val ->\n           [\"attribute\" .= attr\n           ,\"value\" .= val]\n      NotUTF8Encoded src ->\n           [\"source\" .= src]\n      MakePDFInfo description contents ->\n           [\"description\" .= description\n           ,\"contents\" .= contents]\n      MakePDFWarning message ->\n           [\"message\" .= message]\n      UnclosedDiv openpos closepos ->\n           [\"openpos\" .= object\n             [ \"source\" .= sourceName openpos,\n               \"line\" .= toJSON (sourceLine openpos),\n               \"column\" .= toJSON (sourceColumn openpos)]\n           ,\"closepos\" .= object\n             [ \"source\" .= sourceName closepos,\n               \"line\" .= toJSON (sourceLine closepos),\n               \"column\" .= toJSON (sourceColumn closepos)]\n           ]\n      UnsupportedCodePage cpg ->\n           [\"codepage\" .= cpg]\n      YamlWarning pos msg ->\n           [ \"source\" .= sourceName pos\n           , \"line\" .= toJSON (sourceLine pos)\n           , \"column\" .= toJSON (sourceColumn pos)\n           , \"message\" .= msg\n           ]\n      UnsupportedPdfStandard s ->\n           [\"contents\" .= s]\n\nshowPos :: SourcePos -> Text\nshowPos pos = Text.pack $ sn ++ \"line \" ++\n     show (sourceLine pos) ++ \" column \" ++ show (sourceColumn pos)\n  where\n    sn' = sourceName pos\n    sn = if sn' == \"source\" || sn' == \"\" || sn' == \"-\"\n            then \"\"\n            else sn' ++ \" \"\n\nencodeLogMessages :: [LogMessage] -> BL.ByteString\nencodeLogMessages ms =\n  encodePretty' defConfig{ confCompare =\n      keyOrder [ \"type\", \"verbosity\", \"contents\", \"message\", \"path\",\n                 \"source\", \"line\", \"column\" ] } ms\n\nshowLogMessage :: LogMessage -> Text\nshowLogMessage msg =\n  case msg of\n       SkippedContent s pos ->\n         \"Skipped '\" <> s <> \"' at \" <> showPos pos\n       IgnoredElement s ->\n         \"Ignored element \" <> s\n       DuplicateLinkReference s pos ->\n         \"Duplicate link reference '\" <> s <> \"' at \" <> showPos pos\n       DuplicateNoteReference s pos ->\n         \"Duplicate note reference '\" <> s <> \"' at \" <> showPos pos\n       NoteDefinedButNotUsed s pos ->\n         \"Note with key '\" <> s <> \"' defined at \" <> showPos pos <>\n           \" but not used.\"\n       DuplicateIdentifier s pos ->\n         \"Duplicate identifier '\" <> s <> \"' at \" <> showPos pos\n       ReferenceNotFound s pos ->\n         \"Reference not found for '\" <> s <> \"' at \" <> showPos pos\n       CircularReference s pos ->\n         \"Circular reference '\" <> s <> \"' at \" <> showPos pos\n       UndefinedToggle s pos ->\n         \"Undefined toggle '\" <> s <> \"' at \" <> showPos pos\n       ParsingUnescaped s pos ->\n         \"Parsing unescaped '\" <> s <> \"' at \" <> showPos pos\n       CouldNotLoadIncludeFile fp pos ->\n         \"Could not load include file \" <> fp <> \" at \" <> showPos pos\n       CouldNotParseIncludeFile fp pos ->\n         \"Parsing include file \" <> fp <> \" failed at \" <> showPos pos\n       MacroAlreadyDefined name pos ->\n         \"Macro '\" <> name <> \"' already defined, ignoring at \" <> showPos pos\n       InlineNotRendered il ->\n         \"Not rendering \" <> Text.pack (show il)\n       BlockNotRendered bl ->\n         \"Not rendering \" <> Text.pack (show bl)\n       DocxParserWarning s ->\n         \"Docx parser warning: \" <> s\n       PowerpointTemplateWarning s ->\n         \"Powerpoint template warning: \" <> s\n       IgnoredIOError s ->\n         \"IO Error (ignored): \" <> s\n       CouldNotFetchResource fp s ->\n         \"Could not fetch resource \" <> fp <>\n           if Text.null s then \"\" else \": \" <> s\n       CouldNotDetermineImageSize fp s ->\n         \"Could not determine image size for \" <> fp <>\n           if Text.null s then \"\" else \": \" <> s\n       CouldNotConvertImage fp s ->\n         \"Could not convert image \" <> fp <>\n           if Text.null s then \"\" else \": \" <> s\n       CouldNotDetermineMimeType fp ->\n         \"Could not determine mime type for \" <> fp\n       CouldNotConvertTeXMath s m ->\n         \"Could not convert TeX math \" <> s <> \", rendering as TeX\" <>\n           if Text.null m then \"\" else \":\\n\" <> m\n       CouldNotParseCSS m ->\n         \"Could not parse CSS\" <> if Text.null m then \"\" else \":\\n\" <> m\n       Fetching fp ->\n         \"Fetching \" <> fp <> \"...\"\n       Extracting fp ->\n         \"Extracting \" <> fp <> \"...\"\n       LoadedResource orig found ->\n         \"Loaded \" <> Text.pack orig <> \" from \" <> Text.pack found\n       ScriptingInfo s mbpos ->\n         \"Scripting info\" <>\n         maybe \"\" (\\pos -> \" at \" <> showPos pos) mbpos  <> \": \" <> s\n       ScriptingWarning s mbpos ->\n         \"Scripting warning\" <>\n         maybe \"\" (\\pos -> \" at \" <> showPos pos) mbpos  <> \": \" <> s\n       NoTitleElement fallback ->\n         \"This document format requires a nonempty <title> element.\\n\" <>\n         \"Defaulting to '\" <> fallback <> \"' as the title.\\n\" <>\n         \"To specify a title, use --variable pagetitle=\\\"...\\\".\"\n       NoLangSpecified ->\n         \"No value for 'lang' was specified in the metadata.\\n\" <>\n         \"It is recommended that lang be specified for this format.\"\n       InvalidLang s ->\n         \"Invalid 'lang' value '\" <> s <> \"'.\\n\" <>\n         \"Use an IETF language tag like 'en-US'.\"\n       CouldNotHighlight m ->\n         \"Could not highlight code block:\\n\" <> m\n       MissingCharacter m ->\n         \"Missing character: \" <> m\n       Deprecated t m ->\n         \"Deprecated: \" <> t <>\n         if Text.null m\n            then \"\"\n            else \". \" <> m\n       NoTranslation t ->\n         \"The term \" <> t <> \" has no translation defined.\"\n       CouldNotLoadTranslations lang m ->\n         \"Could not load translations for \" <> lang <>\n           if Text.null m then \"\" else \"\\n\" <> m\n       UnusualConversion m ->\n         \"Unusual conversion: \" <> m\n       UnexpectedXmlElement element parent ->\n         \"Unexpected XML element \" <> element <> \" in \" <> parent\n       UnknownOrgExportOption option ->\n         \"Ignoring unknown Org export option: \" <> option\n       CouldNotDeduceFormat exts format ->\n         \"Could not deduce format from file extension \" <>\n         Text.intercalate \" or \" exts <> \"\\n\" <>\n         \"Defaulting to \" <> format\n       RunningFilter fp -> \"Running filter \" <> Text.pack fp\n       FilterCompleted fp ms -> \"Completed filter \" <> Text.pack fp <>\n          \" in \" <> Text.pack (show ms) <> \" ms\"\n       CiteprocWarning ms -> \"Citeproc: \" <> ms\n       ATXHeadingInLHS lvl contents ->\n         \"Rendering heading '\" <> contents <> \"' as a paragraph.\\n\" <>\n         \"ATX headings cannot be used in literate Haskell, because \" <>\n         \"'#' is not\\nallowed in column 1.\" <>\n         if lvl < 3\n            then \" Consider using --markdown-headings=setext.\"\n            else \"\"\n       EnvironmentVariableUndefined var ->\n         \"Undefined environment variable \" <> var <> \" in defaults file.\"\n       DuplicateAttribute attr val ->\n         \"Ignoring duplicate attribute \" <> attr <> \"=\" <> tshow val <> \".\"\n       NotUTF8Encoded src ->\n         Text.pack src <>\n           \" is not UTF-8 encoded: falling back to latin1.\"\n       MakePDFInfo description contents ->\n         \"[makePDF] \" <> description <>\n          if Text.null contents\n             then mempty\n             else \"\\n\" <> contents\n       MakePDFWarning message -> \"[makePDF] \" <> message\n       UnclosedDiv openpos closepos -> \"Div at \" <> showPos openpos <>\n          \" unclosed at \" <> showPos closepos <> \", closing implicitly.\"\n       UnsupportedCodePage cpg -> \"Unsupported code page \" <> tshow cpg <>\n          \". Text will likely be garbled.\"\n       YamlWarning pos m -> \"YAML warning (\" <> showPos pos <> \"): \" <> m\n       UnsupportedPdfStandard s ->\n         \"PDF standard '\" <> s <> \"' is not supported by LaTeX and will be ignored.\"\n\nmessageVerbosity :: LogMessage -> Verbosity\nmessageVerbosity msg =\n  case msg of\n       SkippedContent{}              -> INFO\n       IgnoredElement{}              -> INFO\n       DuplicateLinkReference{}      -> WARNING\n       DuplicateNoteReference{}      -> WARNING\n       NoteDefinedButNotUsed{}       -> WARNING\n       DuplicateIdentifier{}         -> WARNING\n       ReferenceNotFound{}           -> WARNING\n       CircularReference{}           -> WARNING\n       UndefinedToggle{}             -> WARNING\n       CouldNotLoadIncludeFile f _\n        | \".sty\" `Text.isSuffixOf` f -> INFO\n        | otherwise                  -> WARNING\n       CouldNotParseIncludeFile{}    -> WARNING\n       MacroAlreadyDefined{}         -> WARNING\n       ParsingUnescaped{}            -> INFO\n       InlineNotRendered{}           -> INFO\n       BlockNotRendered{}            -> INFO\n       DocxParserWarning{}           -> WARNING\n       PowerpointTemplateWarning{}   -> WARNING\n       IgnoredIOError{}              -> WARNING\n       CouldNotFetchResource{}       -> WARNING\n       CouldNotDetermineImageSize{}  -> WARNING\n       CouldNotConvertImage{}        -> WARNING\n       CouldNotDetermineMimeType{}   -> WARNING\n       CouldNotConvertTeXMath{}      -> WARNING\n       CouldNotParseCSS{}            -> WARNING\n       Fetching{}                    -> INFO\n       Extracting{}                  -> INFO\n       LoadedResource{}              -> INFO\n       ScriptingInfo{}               -> INFO\n       ScriptingWarning{}            -> WARNING\n       NoTitleElement{}              -> INFO\n       NoLangSpecified               -> INFO\n       InvalidLang{}                 -> WARNING\n       CouldNotHighlight{}           -> WARNING\n       MissingCharacter{}            -> WARNING\n       Deprecated{}                  -> WARNING\n       NoTranslation{}               -> WARNING\n       CouldNotLoadTranslations{}    -> WARNING\n       UnusualConversion {}          -> WARNING\n       UnexpectedXmlElement {}       -> WARNING\n       UnknownOrgExportOption {}     -> WARNING\n       CouldNotDeduceFormat{}        -> WARNING\n       RunningFilter{}               -> INFO\n       FilterCompleted{}             -> INFO\n       CiteprocWarning{}             -> WARNING\n       ATXHeadingInLHS{}             -> WARNING\n       EnvironmentVariableUndefined{}-> WARNING\n       DuplicateAttribute{}          -> WARNING\n       NotUTF8Encoded{}              -> WARNING\n       MakePDFInfo{}                 -> INFO\n       MakePDFWarning{}              -> WARNING\n       UnclosedDiv{}                 -> WARNING\n       UnsupportedCodePage{}         -> WARNING\n       YamlWarning{}                 -> WARNING\n       UnsupportedPdfStandard{}      -> WARNING\n"
  },
  {
    "path": "src/Text/Pandoc/MIME.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.MIME\n   Copyright   : Copyright (C) 2011-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nMime type lookup.\n-}\nmodule Text.Pandoc.MIME (\n  MimeType,\n  getMimeType,\n  getMimeTypeDef,\n  getCharset,\n  extensionFromMimeType,\n  mediaCategory ) where\nimport Data.List (isPrefixOf, isSuffixOf)\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport qualified Data.Text.Encoding as T\nimport Data.Maybe (fromMaybe, listToMaybe)\nimport Data.Tuple (swap)\nimport qualified Network.Mime\nimport System.FilePath\n\ntype MimeType = T.Text\n\n-- | Determine mime type appropriate for file path.\ngetMimeType :: FilePath -> Maybe MimeType\ngetMimeType fp\n  -- ODT\n  | fp == \"layout-cache\" =\n        Just \"application/binary\"\n  | \"Formula-\" `isPrefixOf` fp && \"/\" `isSuffixOf` fp =\n        Just \"application/vnd.oasis.opendocument.formula\"\n  -- generic\n  | otherwise = M.lookup (T.toLower $ T.drop 1 $ T.pack $ takeExtension fp) mimeTypes\n\n-- | Determime mime type appropriate for file path, defaulting to\n-- “application/octet-stream” if nothing else fits.\ngetMimeTypeDef :: FilePath -> MimeType\ngetMimeTypeDef = fromMaybe \"application/octet-stream\" . getMimeType\n\nextensionFromMimeType :: MimeType -> Maybe T.Text\nextensionFromMimeType mimetype =\n  -- note:  we just look up the basic mime type, dropping the content-encoding etc.\n  case T.takeWhile (/=';') mimetype of\n    -- handle a few special cases, where there are multiple options:\n    \"text/plain\" -> Just \"txt\"\n    \"video/quicktime\" -> Just \"mov\"\n    \"video/mpeg\" -> Just \"mpeg\"\n    \"video/dv\" -> Just \"dv\"\n    \"image/vnd.djvu\" -> Just \"djvu\"\n    \"image/tiff\" -> Just \"tiff\"\n    \"image/jpeg\" -> Just \"jpg\"\n    \"application/xml\" -> Just \"xml\"\n    \"application/ogg\" -> Just \"ogg\"\n    \"image/svg+xml\" -> Just \"svg\" -- avoid svgz\n    mt -> M.lookup mt reverseMimeTypes\n\n-- | Determine general media category for file path, e.g.\n--\n-- prop> mediaCategory \"foo.jpg\" = Just \"image\"\nmediaCategory :: FilePath -> Maybe T.Text\nmediaCategory fp = getMimeType fp >>= listToMaybe . T.splitOn \"/\"\n\nreverseMimeTypes :: M.Map MimeType T.Text\nreverseMimeTypes = M.fromList $ map swap mimeTypesList\n\nmimeTypes :: M.Map T.Text MimeType\nmimeTypes = M.fromList mimeTypesList\n\n-- | Get the charset from a mime type, if one is present.\ngetCharset :: MimeType -> Maybe T.Text\ngetCharset mt =\n  let (_,y) = T.breakOn \"charset=\" mt\n   in if T.null y\n         then Nothing\n         else Just $ T.toUpper $ T.takeWhile (/= ';') $ T.drop 8 y\n\n-- | Collection of common mime types.\n-- Except for first entry, list borrowed from\n-- <https://github.com/Happstack/happstack-server/blob/master/src/Happstack/Server/FileServe/BuildingBlocks.hs happstack-server>\nmimeTypesList :: [(T.Text, MimeType)]\nmimeTypesList = M.toList (M.map T.decodeUtf8 Network.Mime.defaultMimeMap) ++\n           [(\"%\",\"application/x-trash\")\n           ,(\"323\",\"text/h323\")\n           ,(\"alc\",\"chemical/x-alchemy\")\n           ,(\"apng\",\"image/apng\")\n           ,(\"art\",\"image/x-jg\")\n           ,(\"asn\",\"chemical/x-ncbi-asn1\")\n           ,(\"aso\",\"chemical/x-ncbi-asn1-binary\")\n           ,(\"atomsrv\",\"application/atomserv+xml\")\n           ,(\"avif\", \"image/avif\")\n           ,(\"b\",\"chemical/x-molconn-Z\")\n           ,(\"bak\",\"application/x-trash\")\n           ,(\"bat\",\"application/x-msdos-program\")\n           ,(\"bmp\",\"image/x-ms-bmp\")\n           ,(\"boo\",\"text/x-boo\")\n           ,(\"book\",\"application/x-maker\")\n           ,(\"bsd\",\"chemical/x-crossfire\")\n           ,(\"c\",\"text/x-csrc\")\n           ,(\"c++\",\"text/x-c++src\")\n           ,(\"c3d\",\"chemical/x-chem3d\")\n           ,(\"cabal\",\"application/x-cabal\")\n           ,(\"cac\",\"chemical/x-cache\")\n           ,(\"cache\",\"chemical/x-cache\")\n           ,(\"cascii\",\"chemical/x-cactvs-binary\")\n           ,(\"cbin\",\"chemical/x-cactvs-binary\")\n           ,(\"cbz\",\"application/x-cbz\")\n           ,(\"cc\",\"text/x-c++src\")\n           ,(\"cdf\",\"application/x-cdf\")\n           ,(\"cdr\",\"image/x-coreldraw\")\n           ,(\"cdt\",\"image/x-coreldrawtemplate\")\n           ,(\"cef\",\"chemical/x-cxf\")\n           ,(\"cer\",\"chemical/x-cerius\")\n           ,(\"chm\",\"chemical/x-chemdraw\")\n           ,(\"chrt\",\"application/x-kchart\")\n           ,(\"com\",\"application/x-msdos-program\")\n           ,(\"cpa\",\"chemical/x-compass\")\n           ,(\"cpp\",\"text/x-c++src\")\n           ,(\"cpt\",\"image/x-corelphotopaint\")\n           ,(\"crl\",\"application/x-pkcs7-crl\")\n           ,(\"csf\",\"chemical/x-cache-csf\")\n           ,(\"csm\",\"chemical/x-csml\")\n           ,(\"ctab\",\"chemical/x-cactvs-binary\")\n           ,(\"ctx\",\"chemical/x-ctx\")\n           ,(\"cub\",\"chemical/x-gaussian-cube\")\n           ,(\"cxf\",\"chemical/x-cxf\")\n           ,(\"cxx\",\"text/x-c++src\")\n           ,(\"d\",\"text/x-dsrc\")\n           ,(\"dat\",\"chemical/x-mopac-input\")\n           ,(\"dif\",\"video/dv\")\n           ,(\"diff\",\"text/x-diff\")\n           ,(\"dl\",\"video/dl\")\n           ,(\"dll\",\"application/x-msdos-program\")\n           ,(\"dms\",\"application/x-dms\")\n           ,(\"dx\",\"chemical/x-jcamp-dx\")\n           ,(\"emb\",\"chemical/x-embl-dl-nucleotide\")\n           ,(\"embl\",\"chemical/x-embl-dl-nucleotide\")\n           ,(\"emf\",\"image/x-emf\")\n           ,(\"ent\",\"chemical/x-ncbi-asn1-ascii\")\n\n           -- The type used in mime-types is `application/postscript`,\n           -- but code in Text.Pandoc.PDF relies on the type being\n           -- `application/eps`. Do not remove without updating that\n           -- module.\n           ,(\"eps\",\"application/eps\")\n\n           ,(\"fb\",\"application/x-maker\")\n           ,(\"fbdoc\",\"application/x-maker\")\n           ,(\"fch\",\"chemical/x-gaussian-checkpoint\")\n           ,(\"fchk\",\"chemical/x-gaussian-checkpoint\")\n           ,(\"frm\",\"application/x-maker\")\n           ,(\"fs\",\"text/plain\")\n           ,(\"gal\",\"chemical/x-gaussian-log\")\n           ,(\"gam\",\"chemical/x-gamess-input\")\n           ,(\"gamin\",\"chemical/x-gamess-input\")\n           ,(\"gau\",\"chemical/x-gaussian-input\")\n           ,(\"gcd\",\"text/x-pcs-gcd\")\n           ,(\"gcf\",\"application/x-graphing-calculator\")\n           ,(\"gcg\",\"chemical/x-gcg8-sequence\")\n           ,(\"gen\",\"chemical/x-genbank\")\n           ,(\"gjc\",\"chemical/x-gaussian-input\")\n           ,(\"gjf\",\"chemical/x-gaussian-input\")\n           ,(\"gl\",\"video/gl\")\n           ,(\"glsl\",\"text/plain\")\n           ,(\"gpt\",\"chemical/x-mopac-graph\")\n           ,(\"gsm\",\"audio/x-gsm\")\n           ,(\"h\",\"text/x-chdr\")\n           ,(\"h++\",\"text/x-c++hdr\")\n           ,(\"hh\",\"text/x-c++hdr\")\n           ,(\"hin\",\"chemical/x-hin\")\n           ,(\"hpp\",\"text/x-c++hdr\")\n           ,(\"hs\",\"text/x-haskell\")\n           ,(\"hta\",\"application/hta\")\n           ,(\"hxx\",\"text/x-c++hdr\")\n           ,(\"ica\",\"application/x-ica\")\n           ,(\"icz\",\"text/calendar\")\n           ,(\"iii\",\"application/x-iphone\")\n           ,(\"inp\",\"chemical/x-gamess-input\")\n           ,(\"ins\",\"application/x-internet-signup\")\n           ,(\"isp\",\"application/x-internet-signup\")\n           ,(\"ist\",\"chemical/x-isostar\")\n           ,(\"istr\",\"chemical/x-isostar\")\n           ,(\"jdx\",\"chemical/x-jcamp-dx\")\n           ,(\"jfif\",\"image/jpeg\")\n           ,(\"jxl\",\"image/jxl\")\n           ,(\"jmz\",\"application/x-jmol\")\n           ,(\"key\",\"application/pgp-keys\")\n           ,(\"kil\",\"application/x-killustrator\")\n           ,(\"kin\",\"chemical/x-kinemage\")\n           ,(\"lhs\",\"text/x-literate-haskell\")\n           ,(\"lsf\",\"video/x-la-asf\")\n           ,(\"lsx\",\"video/x-la-asf\")\n           ,(\"lyx\",\"application/x-lyx\")\n           ,(\"lzh\",\"application/x-lzh\")\n           ,(\"lzx\",\"application/x-lzx\")\n           ,(\"man\",\"application/x-troff-man\")\n           ,(\"mcif\",\"chemical/x-mmcif\")\n           ,(\"mcm\",\"chemical/x-macmolecule\")\n           ,(\"mdb\",\"application/msaccess\")\n           ,(\"me\",\"application/x-troff-me\")\n           ,(\"mm\",\"application/x-freemind\")\n           ,(\"mmd\",\"chemical/x-macromodel-input\")\n           ,(\"mmod\",\"chemical/x-macromodel-input\")\n           ,(\"moc\",\"text/x-moc\")\n           ,(\"mol\",\"chemical/x-mdl-molfile\")\n           ,(\"mol2\",\"chemical/x-mol2\")\n           ,(\"moo\",\"chemical/x-mopac-out\")\n           ,(\"mop\",\"chemical/x-mopac-input\")\n           ,(\"mopcrt\",\"chemical/x-mopac-input\")\n           ,(\"mpc\",\"chemical/x-mopac-input\")\n           ,(\"mpega\",\"audio/mpeg\")\n           ,(\"ms\",\"application/x-troff-ms\")\n           ,(\"msi\",\"application/x-msi\")\n           ,(\"mvb\",\"chemical/x-mopac-vib\")\n           ,(\"nwc\",\"application/x-nwc\")\n           ,(\"o\",\"application/x-object\")\n           ,(\"old\",\"application/x-trash\")\n           ,(\"oza\",\"application/x-oz-application\")\n           ,(\"pat\",\"image/x-coreldrawpattern\")\n           ,(\"patch\",\"text/x-diff\")\n           ,(\"pdb\",\"chemical/x-pdb\")\n           ,(\"php\",\"application/x-httpd-php\")\n           ,(\"php3\",\"application/x-httpd-php3\")\n           ,(\"php3p\",\"application/x-httpd-php3-preprocessed\")\n           ,(\"php4\",\"application/x-httpd-php4\")\n           ,(\"phps\",\"application/x-httpd-php-source\")\n           ,(\"pht\",\"application/x-httpd-php\")\n           ,(\"phtml\",\"application/x-httpd-php\")\n           ,(\"pk\",\"application/x-tex-pk\")\n           ,(\"pls\",\"audio/x-scpls\")\n           ,(\"pot\",\"text/plain\")\n           ,(\"prt\",\"chemical/x-ncbi-asn1-ascii\")\n           ,(\"py\",\"text/x-python\")\n           ,(\"pyc\",\"application/x-python-code\")\n           ,(\"pyo\",\"application/x-python-code\")\n           ,(\"qtl\",\"application/x-quicktimeplayer\")\n           ,(\"rd\",\"chemical/x-mdl-rdfile\")\n           ,(\"rhtml\",\"application/x-httpd-eruby\")\n           ,(\"rm\",\"audio/x-pn-realaudio\")\n           ,(\"ros\",\"chemical/x-rosdal\")\n           ,(\"rxn\",\"chemical/x-mdl-rxnfile\")\n           ,(\"sct\",\"text/scriptlet\")\n           ,(\"sd\",\"chemical/x-mdl-sdfile\")\n           ,(\"sd2\",\"audio/x-sd2\")\n           ,(\"sdf\",\"application/vnd.stardivision.math\")\n           ,(\"sds\",\"application/vnd.stardivision.chart\")\n           ,(\"sgf\",\"application/x-go-sgf\")\n           ,(\"sid\",\"audio/prs.sid\")\n           ,(\"sik\",\"application/x-trash\")\n           ,(\"spc\",\"chemical/x-galactic-spc\")\n           ,(\"sw\",\"chemical/x-swissprot\")\n           ,(\"swfl\",\"application/x-shockwave-flash\")\n           ,(\"taz\",\"application/x-gtar\")\n           ,(\"tgf\",\"chemical/x-mdl-tgf\")\n           ,(\"tm\",\"text/texmacs\")\n           ,(\"ts\",\"text/texmacs\")\n           ,(\"tsp\",\"application/dsptype\")\n           ,(\"val\",\"chemical/x-ncbi-asn1-binary\")\n           ,(\"vmd\",\"chemical/x-vmd\")\n           ,(\"vms\",\"chemical/x-vamas-iso14976\")\n           ,(\"vrm\",\"x-world/x-vrml\")\n           ,(\"vs\",\"text/plain\")\n           ,(\"wk\",\"application/x-123\")\n           ,(\"wmf\",\"image/x-wmf\")\n           ,(\"wmz\",\"application/x-ms-wmz\")\n           ,(\"wp5\",\"application/wordperfect5.1\")\n           ,(\"wsc\",\"text/scriptlet\")\n           ,(\"wz\",\"application/x-wingz\")\n           ,(\"xlb\",\"application/vnd.ms-excel\")\n           ,(\"xtel\",\"chemical/x-xtel\")\n           ,(\"zmt\",\"chemical/x-mopac-input\")\n           ]\n"
  },
  {
    "path": "src/Text/Pandoc/MediaBag.hs",
    "content": "{-# LANGUAGE CPP                        #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{-# LANGUAGE DeriveDataTypeable         #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{- |\n   Module      : Text.Pandoc.MediaBag\n   Copyright   : Copyright (C) 2014-2015, 2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nDefinition of a MediaBag object to hold binary resources, and an\ninterface for interacting with it.\n-}\nmodule Text.Pandoc.MediaBag (\n                     MediaItem(..),\n                     MediaBag,\n                     deleteMedia,\n                     lookupMedia,\n                     insertMedia,\n                     mediaDirectory,\n                     mediaItems\n                     ) where\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Data (Data)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, isNothing)\nimport Data.Typeable (Typeable)\nimport System.FilePath\nimport qualified System.FilePath.Posix as Posix\nimport qualified System.FilePath.Windows as Windows\nimport Text.Pandoc.MIME (MimeType, getMimeTypeDef, extensionFromMimeType)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Network.URI (URI (..), isURI, parseURI, unEscapeString)\nimport Data.List (isInfixOf)\n\ndata MediaItem =\n  MediaItem\n  { mediaMimeType :: MimeType\n  , mediaPath :: FilePath\n  , mediaContents :: BL.ByteString\n  } deriving (Eq, Ord, Show, Data, Typeable)\n\n-- | A container for a collection of binary resources, with names and\n-- mime types.  Note that a 'MediaBag' is a Monoid, so 'mempty'\n-- can be used for an empty 'MediaBag', and '<>' can be used to append\n-- two 'MediaBag's.\nnewtype MediaBag = MediaBag (M.Map Text MediaItem)\n        deriving (Semigroup, Monoid, Data, Typeable)\n\ninstance Show MediaBag where\n  show bag = \"MediaBag \" ++ show (mediaDirectory bag)\n\n-- | We represent paths with /, in normalized form.  Percent-encoding\n-- is not resolved.\ncanonicalize :: FilePath -> Text\n-- avoid an expensive call to isURI for data URIs:\ncanonicalize fp@('d':'a':'t':'a':':':_) = T.pack fp\ncanonicalize fp\n  | isURI fp = T.pack fp\n  | otherwise = T.replace \"\\\\\" \"/\" . T.pack . normalise $ fp\n\n-- | Delete a media item from a 'MediaBag', or do nothing if no item corresponds\n-- to the given path.\ndeleteMedia :: FilePath       -- ^ relative path and canonical name of resource\n            -> MediaBag\n            -> MediaBag\ndeleteMedia fp (MediaBag mediamap) =\n  MediaBag $ M.delete (canonicalize fp) mediamap\n\n-- | Insert a media item into a 'MediaBag', replacing any existing\n-- value with the same name.\ninsertMedia :: FilePath       -- ^ relative path and canonical name of resource\n            -> Maybe MimeType -- ^ mime type (Nothing = determine from extension)\n            -> BL.ByteString  -- ^ contents of resource\n            -> MediaBag\n            -> MediaBag\ninsertMedia fp mbMime contents (MediaBag mediamap)\n | 'd':'a':'t':'a':':':_ <- fp\n , Just mt' <- mbMime\n   = MediaBag (M.insert fp'\n               MediaItem{ mediaPath = hashpath\n                        , mediaContents = contents\n                        , mediaMimeType = mt' } mediamap)\n | otherwise = MediaBag (M.insert fp' mediaItem mediamap)\n where\n  mediaItem = MediaItem{ mediaPath = newpath\n                       , mediaContents = contents\n                       , mediaMimeType = mt }\n  fp' = canonicalize fp\n  fp'' = unEscapeString $ T.unpack fp'\n  uri = parseURI fp\n  hashpath = show (hashWith SHA1 (BL.toStrict contents)) <> ext\n  newpath = if Posix.isRelative fp''\n                 && Windows.isRelative fp''\n                 && isNothing uri\n                 && not (\"..\" `isInfixOf` fp'')\n                 && '%' `notElem` fp''\n               then fp''\n               else hashpath\n  fallback = case takeExtension fp'' of\n                  \".gz\" -> getMimeTypeDef $ dropExtension fp''\n                  _     -> getMimeTypeDef fp''\n  mt = fromMaybe fallback mbMime\n  path = maybe fp'' (unEscapeString . uriPath) uri\n  ext = case extensionFromMimeType mt of\n             Just e -> '.':T.unpack e\n             Nothing -> case takeExtension path of\n                             '.':e | '%' `notElem` e -> '.':e\n                             _ -> \"\"\n\n-- | Lookup a media item in a 'MediaBag', returning mime type and contents.\nlookupMedia :: FilePath\n            -> MediaBag\n            -> Maybe MediaItem\nlookupMedia fp (MediaBag mediamap) = M.lookup (canonicalize fp) mediamap\n\n-- | Get a list of the file paths stored in a 'MediaBag', with\n-- their corresponding mime types and the lengths in bytes of the contents.\nmediaDirectory :: MediaBag -> [(FilePath, MimeType, Int)]\nmediaDirectory mediabag =\n  map (\\(fp, mt, bs) -> (fp, mt, fromIntegral (BL.length bs)))\n    (mediaItems mediabag)\n\nmediaItems :: MediaBag -> [(FilePath, MimeType, BL.ByteString)]\nmediaItems (MediaBag mediamap) =\n  map (\\item -> (mediaPath item, mediaMimeType item, mediaContents item))\n      (M.elems mediamap)\n"
  },
  {
    "path": "src/Text/Pandoc/Options.hs",
    "content": "{-# LANGUAGE CPP                #-}\n{-# LANGUAGE DeriveDataTypeable #-}\n{-# LANGUAGE DeriveGeneric      #-}\n{-# LANGUAGE LambdaCase         #-}\n{-# LANGUAGE OverloadedStrings  #-}\n{-# LANGUAGE PatternSynonyms    #-}\n{-# LANGUAGE TemplateHaskell    #-}\n{- |\n   Module      : Text.Pandoc.Options\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nData structures and functions for representing parser and writer\noptions.\n-}\nmodule Text.Pandoc.Options ( module Text.Pandoc.Extensions\n                           , ReaderOptions(..)\n                           , HTMLMathMethod (..)\n                           , CiteMethod (..)\n                           , ObfuscationMethod (..)\n                           , HighlightMethod (..)\n                           , pattern NoHighlightingString\n                           , pattern DefaultHighlightingString\n                           , pattern IdiomaticHighlightingString\n                           , HTMLSlideVariant (..)\n                           , EPUBVersion (..)\n                           , WrapOption (..)\n                           , TopLevelDivision (..)\n                           , WriterOptions (..)\n                           , TrackChanges (..)\n                           , ReferenceLocation (..)\n                           , CaptionPosition (..)\n                           , def\n                           , isEnabled\n                           , defaultMathJaxURL\n                           , defaultWebTeXURL\n                           , defaultKaTeXURL\n                           ) where\nimport Control.Applicative ((<|>))\nimport Data.Maybe (fromMaybe)\nimport Data.Data (Data)\nimport Data.Default\nimport Data.Char (toLower)\nimport Data.Text (Text)\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport Data.Typeable (Typeable)\nimport GHC.Generics (Generic)\nimport Skylighting (SyntaxMap, defaultSyntaxMap)\nimport Text.DocTemplates (Context(..), Template)\nimport Text.Pandoc.Extensions\nimport Text.Pandoc.Chunks (PathTemplate)\nimport Text.Pandoc.Highlighting (Style)\nimport Text.Pandoc.UTF8 (toStringLazy)\nimport Data.Aeson.TH (deriveJSON)\nimport Data.Aeson\n\nclass HasSyntaxExtensions a where\n  getExtensions :: a -> Extensions\n\ndata ReaderOptions = ReaderOptions{\n         readerExtensions            :: Extensions  -- ^ Syntax extensions\n       , readerStandalone            :: Bool -- ^ Standalone document with header\n       , readerColumns               :: Int  -- ^ Number of columns in terminal\n       , readerTabStop               :: Int  -- ^ Tab stop\n       , readerIndentedCodeClasses   :: [Text] -- ^ Default classes for\n                                       -- indented code blocks\n       , readerAbbreviations         :: Set.Set Text -- ^ Strings to treat as abbreviations\n       , readerDefaultImageExtension :: Text -- ^ Default extension for images\n       , readerTrackChanges          :: TrackChanges -- ^ Track changes setting for docx\n       , readerStripComments         :: Bool -- ^ Strip HTML comments instead of parsing as raw HTML\n                                             -- (only implemented in commonmark)\n} deriving (Show, Read, Data, Typeable, Generic)\n\ninstance HasSyntaxExtensions ReaderOptions where\n  getExtensions opts = readerExtensions opts\n\ninstance Default ReaderOptions\n  where def = ReaderOptions{\n                 readerExtensions            = emptyExtensions\n               , readerStandalone            = False\n               , readerColumns               = 80\n               , readerTabStop               = 4\n               , readerIndentedCodeClasses   = []\n               , readerAbbreviations         = defaultAbbrevs\n               , readerDefaultImageExtension = \"\"\n               , readerTrackChanges          = AcceptChanges\n               , readerStripComments         = False\n               }\n\ndefaultAbbrevs :: Set.Set Text\ndefaultAbbrevs = Set.fromList\n                 [ \"Mr.\", \"Mrs.\", \"Ms.\", \"Capt.\", \"Dr.\", \"Prof.\",\n                   \"Gen.\", \"Gov.\", \"e.g.\", \"i.e.\", \"Sgt.\", \"St.\",\n                   \"vol.\", \"vs.\", \"Sen.\", \"Rep.\", \"Pres.\", \"Hon.\",\n                   \"Rev.\", \"Ph.D.\", \"M.D.\", \"M.A.\", \"p.\", \"pp.\",\n                   \"ch.\", \"sec.\", \"cf.\", \"cp.\"]\n\n--\n-- Writer options\n--\n\ndata EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable, Generic)\n\ndata HTMLMathMethod = PlainMath\n                    | WebTeX Text               -- url of TeX->image script.\n                    | GladTeX\n                    | MathML\n                    | MathJax Text              -- url of MathJax.js\n                    | KaTeX Text                -- url of KaTeX files\n                    deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON HTMLMathMethod where\n   parseJSON node =\n     (withObject \"HTMLMathMethod\" $ \\m -> do\n        method <- m .: \"method\"\n        mburl <- m .:? \"url\"\n        case method :: Text of\n          \"plain\" -> return PlainMath\n          \"webtex\" -> return $ WebTeX $\n                         fromMaybe defaultWebTeXURL mburl\n          \"gladtex\" -> return GladTeX\n          \"mathml\" -> return MathML\n          \"mathjax\" -> return $ MathJax $\n                         fromMaybe defaultMathJaxURL mburl\n          \"katex\" -> return $ KaTeX $\n                         fromMaybe defaultKaTeXURL mburl\n          _ -> fail $ \"Unknown HTML math method \" ++ show method) node\n       <|> (case node of\n               String \"plain\" -> return PlainMath\n               String \"webtex\" -> return $ WebTeX defaultWebTeXURL\n               String \"gladtex\" -> return GladTeX\n               String \"mathml\" -> return MathML\n               String \"mathjax\" -> return $ MathJax defaultMathJaxURL\n               String \"katex\" -> return $ KaTeX defaultKaTeXURL\n               _ -> fail $ \"Unknown HTML math method \" <>\n                             toStringLazy (encode node))\n\ninstance ToJSON HTMLMathMethod where\n  toJSON PlainMath = String \"plain\"\n  toJSON (WebTeX \"\") = String \"webtex\"\n  toJSON (WebTeX url) = object [\"method\" .= String \"webtex\",\n                                \"url\" .= String url]\n  toJSON GladTeX = String \"gladtex\"\n  toJSON MathML = String \"mathml\"\n  toJSON (MathJax \"\") = String \"mathjax\"\n  toJSON (MathJax url) = object [\"method\" .= String \"mathjax\",\n                                 \"url\" .= String url]\n  toJSON (KaTeX \"\") = String \"katex\"\n  toJSON (KaTeX url) = object [\"method\" .= String \"katex\",\n                               \"url\" .= String url]\n\ndata CiteMethod = Citeproc                        -- use citeproc to render them\n                  | Natbib                        -- output natbib cite commands\n                  | Biblatex                      -- output biblatex cite commands\n                deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON CiteMethod where\n  parseJSON v =\n    case v of\n      String \"citeproc\" -> return Citeproc\n      String \"natbib\"   -> return Natbib\n      String \"biblatex\" -> return Biblatex\n      _                 -> fail $ \"Unknown citation method: \" <>\n                                    toStringLazy (encode v)\n\ninstance ToJSON CiteMethod where\n  toJSON Citeproc = String \"citeproc\"\n  toJSON Natbib = String \"natbib\"\n  toJSON Biblatex = String \"biblatex\"\n\n-- | Methods for obfuscating email addresses in HTML.\ndata ObfuscationMethod = NoObfuscation\n                       | ReferenceObfuscation\n                       | JavascriptObfuscation\n                       deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON ObfuscationMethod where\n  parseJSON v =\n    case v of\n      String \"none\"       -> return NoObfuscation\n      String \"references\" -> return ReferenceObfuscation\n      String \"javascript\" -> return JavascriptObfuscation\n      _ -> fail $ \"Unknown obfuscation method \" ++ toStringLazy (encode v)\n\ninstance ToJSON ObfuscationMethod where\n   toJSON NoObfuscation = String \"none\"\n   toJSON ReferenceObfuscation = String \"references\"\n   toJSON JavascriptObfuscation = String \"javascript\"\n\n-- | Method to provide code highlighting.\ndata HighlightMethod =\n    Skylighting Style\n  | IdiomaticHighlighting\n  | DefaultHighlighting\n  | NoHighlighting\n  deriving (Show, Read, Eq, Data, Typeable, Generic)\n\n-- | String representation of the idiomatic highlighting option.\npattern IdiomaticHighlightingString :: Text\npattern IdiomaticHighlightingString = \"idiomatic\"\n\n-- | String representation of the default highlighting option.\npattern DefaultHighlightingString :: Text\npattern DefaultHighlightingString = \"default\"\n\n-- | String representation of the no highlighting option\npattern NoHighlightingString :: Text\npattern NoHighlightingString = \"none\"\n\ninstance ToJSON HighlightMethod where\n  toJSON NoHighlighting        = String NoHighlightingString\n  toJSON IdiomaticHighlighting = String IdiomaticHighlightingString\n  toJSON DefaultHighlighting   = String DefaultHighlightingString\n  toJSON (Skylighting style)   = toJSON style\n\ninstance FromJSON HighlightMethod where\n  parseJSON = \\case\n    String NoHighlightingString        -> pure NoHighlighting\n    String IdiomaticHighlightingString -> pure IdiomaticHighlighting\n    String DefaultHighlightingString   -> pure DefaultHighlighting\n    String x           -> fail $ \"Unknown highlighting method \" <> T.unpack x\n    Bool True          -> pure DefaultHighlighting\n    Bool False         -> pure NoHighlighting\n    Null               -> pure NoHighlighting\n    v                  -> Skylighting <$> parseJSON v\n\n-- | Varieties of HTML slide shows.\ndata HTMLSlideVariant = S5Slides\n                      | SlidySlides\n                      | SlideousSlides\n                      | DZSlides\n                      | RevealJsSlides\n                      | NoSlides\n                      deriving (Show, Read, Eq, Data, Typeable, Generic)\n\n-- | Options for accepting or rejecting MS Word track-changes.\ndata TrackChanges = AcceptChanges\n                  | RejectChanges\n                  | AllChanges\n                  deriving (Show, Read, Eq, Data, Typeable, Generic)\n\n-- update in doc/filters.md if this changes:\ninstance FromJSON TrackChanges where\n  parseJSON v =\n    case v of\n      String \"accept\"     -> return AcceptChanges\n      String \"reject\"     -> return RejectChanges\n      String \"all\"        -> return AllChanges\n      String \"accept-changes\" -> return AcceptChanges\n      String \"reject-changes\" -> return RejectChanges\n      String \"all-changes\"    -> return AllChanges\n      _  -> fail $ \"Unknown track changes method \" <> toStringLazy (encode v)\n\ninstance ToJSON TrackChanges where\n  toJSON AcceptChanges = String \"accept-changes\"\n  toJSON RejectChanges = String \"reject-changes\"\n  toJSON AllChanges = String \"all-changes\"\n\n-- | Options for wrapping text in the output.\ndata WrapOption = WrapAuto        -- ^ Automatically wrap to width\n                | WrapNone        -- ^ No non-semantic newlines\n                | WrapPreserve    -- ^ Preserve wrapping of input source\n                deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON WrapOption where\n  parseJSON v =\n    case v of\n      String \"auto\"      -> return WrapAuto\n      String \"wrap-auto\" -> return WrapAuto\n      String \"none\"      -> return WrapNone\n      String \"wrap-none\" -> return WrapNone\n      String \"preserve\"  -> return WrapPreserve\n      String \"wrap-preserve\" -> return WrapPreserve\n      _ -> fail $ \"Unknown wrap method \" <> toStringLazy (encode v)\n\ninstance ToJSON WrapOption where\n  toJSON WrapAuto = \"wrap-auto\"\n  toJSON WrapNone = \"wrap-none\"\n  toJSON WrapPreserve = \"wrap-preserve\"\n\n-- | Options defining the type of top-level headers.\ndata TopLevelDivision = TopLevelPart      -- ^ Top-level headers become parts\n                      | TopLevelChapter   -- ^ Top-level headers become chapters\n                      | TopLevelSection   -- ^ Top-level headers become sections\n                      | TopLevelDefault   -- ^ Top-level type is determined via\n                                          --   heuristics\n                      deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON TopLevelDivision where\n  parseJSON v =\n      case v of\n        String \"part\"              -> return TopLevelPart\n        String \"top-level-part\"    -> return TopLevelPart\n        String \"chapter\"           -> return TopLevelChapter\n        String \"top-level-chapter\" -> return TopLevelChapter\n        String \"section\"           -> return TopLevelSection\n        String \"top-level-section\" -> return TopLevelSection\n        String \"default\"           -> return TopLevelDefault\n        String \"top-level-default\" -> return TopLevelDefault\n        _ -> fail $ \"Unknown top level division \" <> toStringLazy (encode v)\n\ninstance ToJSON TopLevelDivision where\n  toJSON TopLevelPart = \"top-level-part\"\n  toJSON TopLevelChapter = \"top-level-chapter\"\n  toJSON TopLevelSection = \"top-level-section\"\n  toJSON TopLevelDefault = \"top-level-default\"\n\n-- | Locations for footnotes and references in markdown output\ndata ReferenceLocation = EndOfBlock    -- ^ End of block\n                       | EndOfSection  -- ^ prior to next section header (or end of document)\n                       | EndOfDocument -- ^ at end of document\n                       deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON ReferenceLocation where\n  parseJSON v =\n    case v of\n      String \"block\"           -> return EndOfBlock\n      String \"end-of-block\"    -> return EndOfBlock\n      String \"section\"         -> return EndOfSection\n      String \"end-of-section\"  -> return EndOfSection\n      String \"document\"        -> return EndOfDocument\n      String \"end-of-document\" -> return EndOfDocument\n      _ -> fail $ \"Unknown reference location \" <> toStringLazy (encode v)\n\ninstance ToJSON ReferenceLocation where\n   toJSON EndOfBlock = \"end-of-block\"\n   toJSON EndOfSection = \"end-of-section\"\n   toJSON EndOfDocument = \"end-of-document\"\n\n-- | Positions for figure and table captions\ndata CaptionPosition = CaptionAbove -- ^ above figure or table\n                     | CaptionBelow -- ^ below figure or table\n                     deriving (Show, Read, Eq, Data, Typeable, Generic)\n\ninstance FromJSON CaptionPosition where\n  parseJSON v =\n    case v of\n      String \"above\" -> return CaptionAbove\n      String \"below\" -> return CaptionBelow\n      _ -> fail $ \"Unknown caption position \" <> toStringLazy (encode v)\n\ninstance ToJSON CaptionPosition where\n   toJSON CaptionAbove = \"above\"\n   toJSON CaptionBelow = \"below\"\n\n-- | Options for writers\ndata WriterOptions = WriterOptions\n  { writerTemplate          :: Maybe (Template Text) -- ^ Template to use\n  , writerVariables         :: Context Text -- ^ Variables to set in template\n  , writerTabStop           :: Int    -- ^ Tabstop for conversion btw spaces and tabs\n  , writerTableOfContents   :: Bool   -- ^ Include table of contents\n  , writerListOfFigures     :: Bool   -- ^ Include list of figures\n  , writerListOfTables      :: Bool   -- ^ Include list of tables\n  , writerIncremental       :: Bool   -- ^ True if lists should be incremental\n  , writerHTMLMathMethod    :: HTMLMathMethod  -- ^ How to print math in HTML\n  , writerNumberSections    :: Bool   -- ^ Number sections in LaTeX\n  , writerNumberOffset      :: [Int]  -- ^ Starting number for section, subsection, ...\n  , writerSectionDivs       :: Bool   -- ^ Put sections in div tags in HTML\n  , writerExtensions        :: Extensions -- ^ Markdown extensions that can be used\n  , writerReferenceLinks    :: Bool   -- ^ Use reference links in writing markdown, rst\n  , writerDpi               :: Int    -- ^ Dpi for pixel to\\/from inch\\/cm conversions\n  , writerWrapText          :: WrapOption  -- ^ Option for wrapping text\n  , writerColumns           :: Int    -- ^ Characters in a line (for text wrapping)\n  , writerEmailObfuscation  :: ObfuscationMethod -- ^ How to obfuscate emails\n  , writerIdentifierPrefix  :: Text -- ^ Prefix for section & note ids in HTML\n                                     -- and for footnote marks in markdown\n  , writerCiteMethod        :: CiteMethod -- ^ How to print cites\n  , writerHtmlQTags         :: Bool       -- ^ Use @<q>@ tags for quotes in HTML\n  , writerSlideLevel        :: Maybe Int  -- ^ Force header level of slides\n  , writerTopLevelDivision  :: TopLevelDivision -- ^ Type of top-level divisions\n  , writerHighlightMethod   :: HighlightMethod  -- ^ Style to use for highlighting\n  , writerSetextHeaders     :: Bool       -- ^ Use setext headers for levels 1-2 in markdown\n  , writerListTables        :: Bool       -- ^ Use list tables for RST tables\n  , writerEpubSubdirectory  :: Text       -- ^ Subdir for epub in OCF\n  , writerEpubMetadata      :: Maybe Text -- ^ Metadata to include in EPUB\n  , writerEpubFonts         :: [FilePath] -- ^ Paths to fonts to embed\n  , writerEpubTitlePage     :: Bool           -- ^ Include title page in epub\n  , writerSplitLevel        :: Int        -- ^ Header level at which to split EPUB or chunked HTML into separate files\n  , writerChunkTemplate     :: PathTemplate  -- ^ Template for filenames in chunked HTML\n  , writerTOCDepth          :: Int            -- ^ Number of levels to include in TOC\n  , writerReferenceDoc      :: Maybe FilePath -- ^ Path to reference document if specified\n  , writerReferenceLocation :: ReferenceLocation    -- ^ Location of footnotes and references for writing markdown\n  , writerFigureCaptionPosition :: CaptionPosition -- ^ Position of figure caption\n  , writerTableCaptionPosition :: CaptionPosition -- ^ Position of table caption\n  , writerSyntaxMap         :: SyntaxMap\n  , writerPreferAscii       :: Bool           -- ^ Prefer ASCII representations of characters when possible\n  , writerLinkImages        :: Bool           -- ^ Use links rather than embedding ODT images\n  } deriving (Show, Data, Typeable, Generic)\n\ninstance Default WriterOptions where\n  def = WriterOptions { writerTemplate         = Nothing\n                      , writerVariables        = mempty\n                      , writerTabStop          = 4\n                      , writerTableOfContents  = False\n                      , writerListOfFigures    = False\n                      , writerListOfTables     = False\n                      , writerIncremental      = False\n                      , writerHTMLMathMethod   = PlainMath\n                      , writerNumberSections   = False\n                      , writerNumberOffset     = [0,0,0,0,0,0]\n                      , writerSectionDivs      = False\n                      , writerExtensions       = emptyExtensions\n                      , writerReferenceLinks   = False\n                      , writerDpi              = 96\n                      , writerWrapText         = WrapAuto\n                      , writerColumns          = 72\n                      , writerEmailObfuscation = NoObfuscation\n                      , writerIdentifierPrefix = \"\"\n                      , writerCiteMethod       = Citeproc\n                      , writerHtmlQTags        = False\n                      , writerSlideLevel       = Nothing\n                      , writerTopLevelDivision = TopLevelDefault\n                      , writerHighlightMethod  = DefaultHighlighting\n                      , writerSetextHeaders    = False\n                      , writerListTables       = False\n                      , writerEpubSubdirectory = \"EPUB\"\n                      , writerEpubMetadata     = Nothing\n                      , writerEpubFonts        = []\n                      , writerEpubTitlePage    = True\n                      , writerSplitLevel       = 1\n                      , writerChunkTemplate    = \"%s-%i.html\"\n                      , writerTOCDepth         = 3\n                      , writerReferenceDoc     = Nothing\n                      , writerReferenceLocation = EndOfDocument\n                      , writerFigureCaptionPosition = CaptionBelow\n                      , writerTableCaptionPosition  = CaptionAbove\n                      , writerSyntaxMap        = defaultSyntaxMap\n                      , writerPreferAscii      = False\n                      , writerLinkImages       = False\n                      }\n\ninstance HasSyntaxExtensions WriterOptions where\n  getExtensions opts = writerExtensions opts\n\n-- | Returns True if the given extension is enabled.\nisEnabled :: HasSyntaxExtensions a => Extension -> a -> Bool\nisEnabled ext opts = ext `extensionEnabled` getExtensions opts\n\ndefaultMathJaxURL :: Text\ndefaultMathJaxURL = \"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js\"\n\ndefaultWebTeXURL :: Text\ndefaultWebTeXURL = \"https://latex.codecogs.com/png.latex?\"\n\ndefaultKaTeXURL :: Text\ndefaultKaTeXURL = \"https://cdn.jsdelivr.net/npm/katex@latest/dist/\"\n\n-- Update documentation in doc/filters.md if this is changed.\n$(deriveJSON defaultOptions{ fieldLabelModifier =\n                               camelTo2 '-' . drop 6 }\n                            ''ReaderOptions)\n\n$(deriveJSON defaultOptions{ constructorTagModifier = map toLower }\n  ''HTMLSlideVariant)\n"
  },
  {
    "path": "src/Text/Pandoc/PDF.hs",
    "content": "{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{- |\n   Module      : Text.Pandoc.PDF\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of LaTeX documents to PDF.\n-}\nmodule Text.Pandoc.PDF ( makePDF ) where\n\nimport qualified Codec.Picture as JP\nimport qualified Control.Exception as E\nimport Control.Monad.Trans (MonadIO (..))\nimport Control.Monad (foldM_)\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport qualified Data.ByteString as BS\nimport Data.ByteString.Lazy (ByteString)\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.ByteString.Lazy.Char8 as BC\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Data.Text.Lazy.Encoding (decodeUtf8')\nimport Text.Printf (printf)\nimport Data.Char (ord, isAscii, isSpace)\nimport System.Directory\nimport System.Environment\nimport System.Exit (ExitCode (..))\nimport System.FilePath\nimport System.IO (hClose)\nimport System.IO.Temp (withSystemTempDirectory, withTempDirectory,\n                       withTempFile)\nimport qualified System.IO.Error as IE\nimport Text.DocLayout (literal, render, hsep)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError (PandocPDFProgramNotFoundError))\nimport Text.Pandoc.SelfContained (makeSelfContained)\nimport Text.Pandoc.MIME (getMimeType)\nimport Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..))\nimport Text.Pandoc.Extensions (disableExtension, Extension(Ext_smart))\nimport Text.Pandoc.Process (pipeProcess)\nimport System.Process (readProcessWithExitCode)\nimport Text.Pandoc.Shared (inDirectory, stringify, tshow)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Walk (walkM)\nimport Text.Pandoc.Writers.Shared (getField, metaToContext)\nimport Control.Monad.Catch (MonadMask)\n#ifdef _WINDOWS\nimport Data.List (intercalate)\n#endif\nimport Data.List (isPrefixOf, find)\nimport Text.Pandoc.MediaBag (mediaItems)\nimport Text.Pandoc.Class (fillMediaBag, getMediaBag, getVerbosity, setVerbosity,\n                          readFileStrict, fileExists,\n                          report, extractMedia, PandocMonad, runIOorExplode)\nimport Text.Pandoc.Logging\nimport Text.DocTemplates ( FromContext(lookupContext) )\n\n#ifdef _WINDOWS\nchangePathSeparators :: FilePath -> FilePath\nchangePathSeparators =\n  -- We filter out backslashes because an initial `C:\\` gets\n  -- retained by `splitDirectories`, see #6173:\n  intercalate \"/\" . map (filter (/='\\\\')) . splitDirectories\n#endif\n\nmakePDF :: (PandocMonad m, MonadIO m, MonadMask m)\n        => String              -- ^ pdf creator (pdflatex, lualatex, xelatex,\n                               -- wkhtmltopdf, weasyprint, prince, context,\n                               -- pdfroff, pagedjs,\n                               -- or path to executable)\n        -> [String]            -- ^ arguments to pass to pdf creator\n        -> (WriterOptions -> Pandoc -> m Text)  -- ^ writer\n        -> WriterOptions       -- ^ options\n        -> Pandoc              -- ^ document\n        -> m (Either ByteString ByteString)\nmakePDF program pdfargs writer opts doc = withTempDir (program == \"typst\") \"media\" $ \\mediaDir -> do\n#ifdef _WINDOWS\n  -- note:  we want / even on Windows, for TexLive\n  let tmpdir = changePathSeparators mediaDir\n#else\n  let tmpdir = mediaDir\n#endif\n  let isTeXFormat \"context\" = True\n      isTeXFormat \"tectonic\" = True\n      isTeXFormat \"latexmk\" = True\n      isTeXFormat \"lualatex\" = True\n      isTeXFormat \"lualatex-dev\" = True\n      isTeXFormat \"pdflatex\" = True\n      isTeXFormat \"pdflatex-dev\" = True\n      isTeXFormat \"xelatex\" = True\n      isTeXFormat _ = False\n  let opts' = if isTeXFormat program\n                 then -- disable quote ligatures to avoid bad ligatures like ?`\n                      opts{ writerExtensions = disableExtension Ext_smart\n                                (writerExtensions opts) }\n                 else opts\n  source <- fillMediaBag doc\n              >>= extractMedia tmpdir\n              >>= (if isTeXFormat program\n                      then walkM (convertImages opts' tmpdir)\n                      else return)\n              >>= writer opts'\n\n  verbosity <- getVerbosity\n  let compileHTML mkOutArgs = do\n        -- check to see if there is anything in mediabag, and if so,\n        -- make the HTML self contained\n        mediabag <- getMediaBag\n        source' <- case mediaItems mediabag of\n                      [] -> pure source\n                      _ -> makeSelfContained source\n        liftIO $\n          toPdfViaTempFile verbosity program pdfargs mkOutArgs \".html\" source'\n  case takeBaseName program of\n    \"wkhtmltopdf\" -> makeWithWkhtmltopdf program pdfargs writer opts' doc\n    \"pagedjs-cli\" -> compileHTML (\\f -> [\"-o\", f])\n    \"prince\"      -> compileHTML (\\f -> [\"-o\", f])\n    \"weasyprint\"  -> compileHTML (:[])\n    \"typst\" -> liftIO $\n        toPdfViaTempFile verbosity program (\"compile\":pdfargs) (:[]) \".typ\" source\n    \"pdfroff\" -> do\n      let paperargs =\n            case lookupContext \"papersize\" (writerVariables opts') of\n              Just s\n                | T.takeEnd 1 s == \"l\" -> [\"-P-p\" <>\n                                           T.unpack (T.dropEnd 1 s), \"-P-l\"]\n                | otherwise -> [\"-P-p\" <> T.unpack s]\n              Nothing -> []\n      let args   = [\"-ms\", \"-mpdfmark\", \"-mspdf\",\n                    \"-e\", \"-t\", \"-k\", \"-KUTF-8\", \"-i\"] ++\n                   [\"-U\" | \".PDFPIC\" `T.isInfixOf` source] ++\n                    paperargs ++ pdfargs\n      generic2pdf program args source\n    \"groff\" -> do\n      let paperargs =\n            case lookupContext \"papersize\" (writerVariables opts') of\n              Just s\n                | T.takeEnd 1 s == \"l\" -> [\"-P-p\" <>\n                                           T.unpack (T.dropEnd 1 s), \"-P-l\"]\n                | otherwise -> [\"-P-p\" <> T.unpack s]\n              Nothing -> []\n      let args   = [\"-ms\", \"-Tpdf\",\n                    \"-e\", \"-t\", \"-k\", \"-KUTF-8\"] ++\n                   [\"-U\" | \".PDFPIC\" `T.isInfixOf` source] ++\n                    paperargs ++ pdfargs\n      generic2pdf program args source\n    \"context\"      -> context2pdf program pdfargs tmpdir source\n    \"tectonic\"     -> tectonic2pdf program pdfargs tmpdir source\n    \"latexmk\"      -> tex2pdf program pdfargs tmpdir source\n    \"lualatex\"     -> tex2pdf program pdfargs tmpdir source\n    \"lualatex-dev\" -> tex2pdf program pdfargs tmpdir source\n    \"pdflatex\"     -> tex2pdf program pdfargs tmpdir source\n    \"pdflatex-dev\" -> tex2pdf program pdfargs tmpdir source\n    \"xelatex\"      -> tex2pdf program pdfargs tmpdir source\n    _ -> return $ Left $ UTF8.fromStringLazy $ \"Unknown program \" ++ program\n\n-- latex has trouble with tildes in paths, which\n-- you find in Windows temp dir paths with longer\n-- user names (see #777)\nwithTempDir :: (PandocMonad m, MonadMask m, MonadIO m)\n            => Bool -> FilePath -> (FilePath -> m a) -> m a\nwithTempDir useWorkingDirectory templ action = do\n  tmp <- liftIO getTemporaryDirectory\n  uname <- liftIO $ E.catch\n    (do (ec, sout, _) <- readProcessWithExitCode \"uname\" [\"-o\"] \"\"\n        if ec == ExitSuccess\n           then return $ Just $ filter (not . isSpace) sout\n           else return Nothing)\n    (\\(_  :: E.SomeException) -> return Nothing)\n  if useWorkingDirectory || '~' `elem` tmp || uname == Just \"Cygwin\" -- see #5451\n     then withTempDirectory \".\" templ action\n     else withSystemTempDirectory templ action\n\nmakeWithWkhtmltopdf :: (PandocMonad m, MonadIO m)\n                    => String              -- ^ wkhtmltopdf or path\n                    -> [String]            -- ^ arguments\n                    -> (WriterOptions -> Pandoc -> m Text)  -- ^ writer\n                    -> WriterOptions       -- ^ options\n                    -> Pandoc              -- ^ document\n                    -> m (Either ByteString ByteString)\nmakeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do\n  let mathArgs = case writerHTMLMathMethod opts of\n                 -- with MathJax, wait til all math is rendered:\n                      MathJax _ -> [\"--run-script\", \"MathJax.Hub.Register.StartupHook('End Typeset', function() { window.status = 'mathjax_loaded' });\",\n                                    \"--window-status\", \"mathjax_loaded\"]\n                      _ -> []\n  meta' <- metaToContext opts\n             (return . literal . stringify)\n             (return . literal . stringify)\n             meta\n  let toArgs (f, mbd) = maybe [] (\\d -> [\"--\" <> f, T.unpack d]) mbd\n  let args   = mathArgs ++ concatMap toArgs\n                 [(\"page-size\", getField \"papersize\" meta')\n                 ,(\"title\", getField \"title\" meta')\n                 ,(\"margin-bottom\", Just $ fromMaybe \"1.2in\"\n                            (getField \"margin-bottom\" meta'))\n                 ,(\"margin-top\", Just $ fromMaybe \"1.25in\"\n                            (getField \"margin-top\" meta'))\n                 ,(\"margin-right\", Just $ fromMaybe \"1.25in\"\n                            (getField \"margin-right\" meta'))\n                 ,(\"margin-left\", Just $ fromMaybe \"1.25in\"\n                            (getField \"margin-left\" meta'))\n                 ,(\"footer-html\", getField \"footer-html\" meta')\n                 ,(\"header-html\", getField \"header-html\" meta')\n                 ] ++ (\"--enable-local-file-access\" : pdfargs)\n                 -- see #6474\n  source <- writer opts doc\n  verbosity <- getVerbosity\n  liftIO $ toPdfViaTempFile verbosity program args (:[]) \".html\" source\n\n-- convert SVG to PDF, and pixel formats to PNG or JPEG, for TeX formats\nconvertImages :: (PandocMonad m, MonadIO m)\n              => WriterOptions -> FilePath -> Inline -> m Inline\nconvertImages opts tmpdir (Image attr ils (src, tit)) = do\n  img <- liftIO $ convertImage opts tmpdir $ T.unpack src\n  newPath <-\n    case img of\n      Left e -> do\n        report $ CouldNotConvertImage src e\n        return src\n      Right fp -> return $ T.pack fp\n  return (Image attr ils (newPath, tit))\nconvertImages _ _ x = return x\n\n-- Convert formats which do not work well in pdf to png\nconvertImage :: WriterOptions -> FilePath -> FilePath\n             -> IO (Either Text FilePath)\nconvertImage opts tmpdir fname = do\n  let dpi = show $ writerDpi opts\n  case mime of\n    Just \"image/png\" -> doNothing\n    Just \"image/jpeg\" -> doNothing\n    Just \"application/pdf\" -> doNothing\n    -- Note: eps is converted by pdflatex using epstopdf.pl\n    Just \"application/eps\" -> doNothing\n    Just \"image/svg+xml\" -> E.catch (do\n      (exit, _) <- pipeProcess Nothing \"rsvg-convert\"\n                     [\"-f\",\"pdf\",\"-a\",\"--dpi-x\",dpi,\"--dpi-y\",dpi,\n                      \"-o\",pdfOut,svgIn] BL.empty\n      if exit == ExitSuccess\n         then return $ Right pdfOut\n         else return $ Left \"conversion from SVG failed\")\n      (\\(e :: E.SomeException) -> return $ Left $\n          \"check that rsvg-convert is in path.\\n\" <>\n          tshow e)\n    _ -> JP.readImage fname >>= \\case\n               Left e    -> return $ Left $ T.pack e\n               Right img ->\n                 E.catch (Right pngOut <$ JP.savePngImage pngOut img) $\n                     \\(e :: E.SomeException) -> return (Left (tshow e))\n  where\n    sha = show (hashWith SHA1 (UTF8.fromString fname))\n    pngOut = normalise $ tmpdir </> sha <.> \"png\"\n    pdfOut = normalise $ tmpdir </> sha <.> \"pdf\"\n    svgIn = normalise fname\n    mime = getMimeType fname\n    doNothing = return (Right fname)\n\ntectonic2pdf :: (PandocMonad m, MonadIO m)\n             => String                          -- ^ tex program\n             -> [String]                        -- ^ Arguments to the latex-engine\n             -> FilePath                        -- ^ temp directory for output\n             -> Text                            -- ^ tex source\n             -> m (Either ByteString ByteString)\ntectonic2pdf program args tmpDir source = do\n  (exit, log', mbPdf) <- runTectonic program args tmpDir source\n  case (exit, mbPdf) of\n       (ExitFailure _, _)      -> return $ Left $ extractMsg log'\n       (ExitSuccess, Nothing)  -> return $ Left \"\"\n       (ExitSuccess, Just pdf) -> do\n          missingCharacterWarnings log'\n          return $ Right pdf\n\ntex2pdf :: (PandocMonad m, MonadIO m)\n        => String                          -- ^ tex program\n        -> [String]                        -- ^ Arguments to the latex-engine\n        -> FilePath                        -- ^ temp directory for output\n        -> Text                            -- ^ tex source\n        -> m (Either ByteString ByteString)\ntex2pdf program args tmpDir source = do\n  let isOutdirArg x = \"-outdir=\" `isPrefixOf` x ||\n                      \"-output-directory=\" `isPrefixOf` x\n  let outDir =\n        case find isOutdirArg args of\n          Just x  -> drop 1 $ dropWhile (/='=') x\n          Nothing -> tmpDir\n  let file = tmpDir ++ \"/input.tex\"  -- note: tmpDir has / path separators\n  liftIO $ BS.writeFile file $ UTF8.fromText source\n  (exit, log', mbPdf) <- runTeXProgram program args tmpDir outDir\n  case (exit, mbPdf) of\n       (ExitFailure _, _)      -> do\n          let logmsg = extractMsg log'\n          let extramsg =\n                case logmsg of\n                     x | \"! Package inputenc Error\" `BC.isPrefixOf` x\n                           && program /= \"xelatex\"\n                       -> \"\\nTry running pandoc with --pdf-engine=xelatex.\"\n                     _ -> \"\"\n          return $ Left $ logmsg <> extramsg\n       (ExitSuccess, Nothing)  -> return $ Left \"\"\n       (ExitSuccess, Just pdf) -> do\n          latexWarnings log'\n          missingCharacterWarnings log'\n          return $ Right pdf\n\nmissingCharacterWarnings :: PandocMonad m => ByteString -> m ()\nmissingCharacterWarnings log' = do\n  let ls = BC.lines log'\n  let isMissingCharacterWarning = BC.isPrefixOf \"Missing character:\"\n  let toCodePoint c\n        | isAscii c   = T.singleton c\n        | otherwise   = T.pack $ c : \" (U+\" ++ printf \"%04X\" (ord c) ++ \")\"\n  let addCodePoint = T.concatMap toCodePoint\n  let warnings = [ addCodePoint (utf8ToText (BC.drop 19 l))\n                 | l <- ls\n                 , isMissingCharacterWarning l\n                 ]\n  mapM_ (report . MissingCharacter) warnings\n\nlatexWarnings :: PandocMonad m => ByteString -> m ()\nlatexWarnings log' = foldM_ go Nothing (BC.lines log')\n where\n   go Nothing ln\n     | BC.isPrefixOf \"LaTeX Warning:\" ln =\n       pure $ Just ln\n     | otherwise = pure Nothing\n   go (Just msg) ln\n     | ln == \"\" = do -- emit report and reset accumulator\n         report $ MakePDFWarning $ render (Just 60) $\n            hsep $ map literal $ T.words $ utf8ToText msg\n         pure Nothing\n     | otherwise = pure $ Just (msg <> ln)\n\n-- parsing output\n\nextractMsg :: ByteString -> ByteString\nextractMsg log' = do\n  let msg'  = dropWhile (not . (\"!\" `BC.isPrefixOf`)) $ BC.lines log'\n  let (msg'',rest) = break (\"l.\" `BC.isPrefixOf`) msg'\n  let lineno = take 1 rest\n  if null msg'\n     then log'\n     else BC.unlines (msg'' ++ lineno)\n\nextractConTeXtMsg :: ByteString -> ByteString\nextractConTeXtMsg log' = do\n  let msg'  = take 1 $\n              dropWhile (not . (\"tex error\" `BC.isPrefixOf`)) $ BC.lines log'\n  if null msg'\n     then log'\n     else BC.unlines msg'\n\n-- running tex programs\n\nrunTectonic :: (PandocMonad m, MonadIO m)\n            => String -> [String] -> FilePath\n              -> Text -> m (ExitCode, ByteString, Maybe ByteString)\nrunTectonic program args' tmpDir' source = do\n    let getOutDir acc (a:b:xs) = if a `elem` [\"-o\", \"--outdir\"]\n                                    then (reverse acc ++ xs, Just b)\n                                    else getOutDir (b:a:acc) xs\n        getOutDir acc xs = (reverse acc ++ xs, Nothing)\n        (args, outDir) = getOutDir [] args'\n        tmpDir = fromMaybe tmpDir' outDir\n    liftIO $ createDirectoryIfMissing True tmpDir\n    -- run tectonic on stdin so it reads \\include commands from $PWD instead of a temp directory\n    let sourceBL = BL.fromStrict $ UTF8.fromText source\n    let programArgs = [\"--outdir\", tmpDir] ++ args ++ [\"-\"]\n    env <- liftIO getEnvironment\n    showVerboseInfo (Just tmpDir) program programArgs env (utf8ToText sourceBL)\n    (exit, out) <- liftIO $ E.catch\n      (pipeProcess (Just env) program programArgs sourceBL)\n      (handlePDFProgramNotFound program)\n    report $ MakePDFInfo \"tectonic output\" (utf8ToText out)\n    let pdfFile = tmpDir ++ \"/texput.pdf\"\n    (_, pdf) <- getResultingPDF Nothing pdfFile\n    return (exit, out, pdf)\n\n-- read a pdf that has been written to a temporary directory, and optionally read\n-- logs\ngetResultingPDF :: (PandocMonad m, MonadIO m)\n                => Maybe String -> String\n                -> m (Maybe ByteString, Maybe ByteString)\ngetResultingPDF logFile pdfFile = do\n    pdfExists <- fileExists pdfFile\n    pdf <- if pdfExists\n              -- We read PDF as a strict bytestring to make sure that the\n              -- temp directory is removed on Windows.\n              -- See https://github.com/jgm/pandoc/issues/1192.\n              then (Just . BL.fromChunks . (:[])) `fmap`\n                   (readFileStrict pdfFile)\n              else return Nothing\n    -- Note that some things like Missing character warnings\n    -- appear in the log but not on stderr, so we prefer the log:\n    log' <- case logFile of\n              Just logFile' -> do\n                logExists <- fileExists logFile'\n                if logExists\n                  then Just . BL.fromStrict <$> readFileStrict logFile'\n                  else return Nothing\n              Nothing -> return Nothing\n    return (log', pdf)\n\n-- Run a TeX program once in a temp directory (on input.tex) and return (exit code,\n-- contents of stdout, contents of produced PDF if any).\nrunTeXProgram :: (PandocMonad m, MonadIO m)\n              => String -> [String] -> FilePath -> FilePath\n              -> m (ExitCode, ByteString, Maybe ByteString)\nrunTeXProgram program args tmpDir outDir = do\n    let isLatexMk = takeBaseName program == \"latexmk\"\n        programArgs | isLatexMk =\n                      [\"-interaction=batchmode\", \"-halt-on-error\", \"-pdf\",\n                       \"-quiet\", \"-outdir=\" ++ outDir] ++ args ++ [file]\n                    | otherwise =\n                      [\"-halt-on-error\", \"-interaction\", \"nonstopmode\",\n                       \"-output-directory\", outDir] ++ args ++ [file]\n    env' <- liftIO getEnvironment\n    let sep = [searchPathSeparator]\n    let texinputs = maybe (tmpDir ++ sep) ((tmpDir ++ sep) ++)\n          $ lookup \"TEXINPUTS\" env'\n    let env'' = (\"TEXINPUTS\", texinputs) :\n                (\"TEXMFOUTPUT\", outDir) :\n                  [(k,v) | (k,v) <- env'\n                         , k /= \"TEXINPUTS\" && k /= \"TEXMFOUTPUT\"]\n    liftIO (UTF8.readFile file) >>=\n      showVerboseInfo (Just tmpDir) program programArgs env''\n    go env'' programArgs (1 :: Int)\n where\n   file = tmpDir ++ \"/input.tex\"\n   outfile = outDir ++ \"/input.pdf\"\n   go env'' programArgs runNumber = do\n     let maxruns = 4 -- stop if warnings present after 4 runs\n     report $ MakePDFInfo (\"LaTeX run number \" <> tshow runNumber) mempty\n     (exit, out) <- liftIO $ E.catch\n       (pipeProcess (Just env'') program programArgs BL.empty)\n       (handlePDFProgramNotFound program)\n     report $ MakePDFInfo \"LaTeX output\" (utf8ToText out)\n     -- parse log to see if we need to rerun LaTeX\n     let logFile = replaceExtension outfile \".log\"\n     logExists <- fileExists logFile\n     logContents <- if logExists\n                       then BL.fromStrict <$> readFileStrict logFile\n                       else return mempty\n     let rerunWarnings = checkForRerun logContents\n     tocFileExists <- fileExists (replaceExtension outfile \".toc\")\n       -- if we have a TOC we always need 3 runs, see #10308\n     let rerunWarnings' = rerunWarnings ++ [\"TOC is present\" | tocFileExists]\n     if not (null rerunWarnings') && runNumber < maxruns\n        then do\n          report $ MakePDFInfo \"Rerun needed\"\n                    (T.intercalate \"\\n\" (map utf8ToText rerunWarnings'))\n          go env'' programArgs (runNumber + 1)\n       else do\n          (log', pdf) <- getResultingPDF (Just logFile) outfile\n          return (exit, fromMaybe out log', pdf)\n\n   checkForRerun log' = filter isRerunWarning $ BC.lines log'\n\n   isRerunWarning ln =\n     let ln' = BL.toStrict ln\n       in BS.isInfixOf \"Warning:\" ln' && BS.isInfixOf \"Rerun\" ln'\n\ngeneric2pdf :: (PandocMonad m, MonadIO m)\n            => String\n            -> [String]\n            -> Text\n            -> m (Either ByteString ByteString)\ngeneric2pdf program args source = do\n  env' <- liftIO getEnvironment\n  showVerboseInfo Nothing program args env' source\n  (exit, out) <- liftIO $ E.catch\n    (pipeProcess (Just env') program args\n                     (BL.fromStrict $ UTF8.fromText source))\n    (handlePDFProgramNotFound program)\n  return $ case exit of\n             ExitFailure _ -> Left out\n             ExitSuccess   -> Right out\n\ntoPdfViaTempFile  ::\n             Verbosity    -- ^ Verbosity level\n          -> String       -- ^ Program (program name or path)\n          -> [String]     -- ^ Args to program\n          -> (String -> [String]) -- ^ Construct args for output file\n          -> String       -- ^ extension to use for input file (e.g. '.html')\n          -> Text         -- ^ Source\n          -> IO (Either ByteString ByteString)\ntoPdfViaTempFile verbosity program args mkOutArgs extension source =\n  withTempFile \".\" (\"toPdfViaTempFile\" <> extension) $ \\file h1 ->\n    withTempFile \".\" \"toPdfViaTempFile.pdf\" $ \\pdfFile h2 -> do\n      hClose h1\n      hClose h2\n      BS.writeFile file $ UTF8.fromText source\n      let programArgs = args ++ [file] ++ mkOutArgs pdfFile\n      env' <- getEnvironment\n      fileContents <- UTF8.readFile file\n      runIOorExplode $ do\n        setVerbosity verbosity\n        showVerboseInfo Nothing program programArgs env' fileContents\n      (exit, out) <- E.catch\n        (pipeProcess (Just env') program programArgs BL.empty)\n        (handlePDFProgramNotFound program)\n      runIOorExplode $ do\n        setVerbosity verbosity\n        report $ MakePDFInfo \"pdf-engine output\" (utf8ToText out)\n      pdfExists <- doesFileExist pdfFile\n      mbPdf <- if pdfExists\n                -- We read PDF as a strict bytestring to make sure that the\n                -- temp directory is removed on Windows.\n                -- See https://github.com/jgm/pandoc/issues/1192.\n                then Just . BL.fromChunks . (:[]) <$> BS.readFile pdfFile\n                else return Nothing\n      return $ case (exit, mbPdf) of\n                 (ExitFailure _, _)      -> Left out\n                 (ExitSuccess, Nothing)  -> Left \"\"\n                 (ExitSuccess, Just pdf) -> Right pdf\n\ncontext2pdf :: (PandocMonad m, MonadIO m)\n            => String       -- ^ \"context\" or path to it\n            -> [String]     -- ^ extra arguments\n            -> FilePath     -- ^ temp directory for output\n            -> Text         -- ^ ConTeXt source\n            -> m (Either ByteString ByteString)\ncontext2pdf program pdfargs tmpDir source = do\n  let file = \"input.tex\"\n  let programArgs = \"--batchmode\" : pdfargs ++ [file]\n  env' <- liftIO getEnvironment\n  verbosity <- getVerbosity\n  liftIO $ BS.writeFile (tmpDir </> file) $ UTF8.fromText source\n  liftIO (UTF8.readFile (tmpDir </> file)) >>=\n    showVerboseInfo (Just tmpDir) program programArgs env'\n  liftIO $ inDirectory tmpDir $ do\n    (exit, out) <- E.catch\n      (pipeProcess (Just env') program programArgs BL.empty)\n      (handlePDFProgramNotFound program)\n    runIOorExplode $ do\n      setVerbosity verbosity\n      report $ MakePDFInfo \"ConTeXt run output\" (utf8ToText out)\n    let pdfFile = replaceExtension file \".pdf\"\n    pdfExists <- doesFileExist pdfFile\n    mbPdf <- if pdfExists\n              -- We read PDF as a strict bytestring to make sure that the\n              -- temp directory is removed on Windows.\n              -- See https://github.com/jgm/pandoc/issues/1192.\n              then (Just . BL.fromChunks . (:[])) `fmap` BS.readFile pdfFile\n              else return Nothing\n    case (exit, mbPdf) of\n         (ExitFailure _, _)      -> do\n            let logmsg = extractConTeXtMsg out\n            return $ Left logmsg\n         (ExitSuccess, Nothing)  -> return $ Left \"\"\n         (ExitSuccess, Just pdf) -> return $ Right pdf\n\n\nshowVerboseInfo :: PandocMonad m\n                => Maybe FilePath\n                -> String\n                -> [String]\n                -> [(String, String)]\n                -> Text\n                -> m ()\nshowVerboseInfo mbTmpDir program programArgs env source = do\n  case mbTmpDir of\n    Just tmpDir -> report $ MakePDFInfo \"Temp dir:\" (T.pack tmpDir)\n    Nothing -> return ()\n  report $ MakePDFInfo \"Command line:\"\n           (T.pack program <> \" \" <> T.pack (unwords (map show programArgs)))\n  -- we filter out irrelevant stuff to avoid leaking passwords and keys!\n  let isRelevant e = (e `elem` [ \"PKFONTS\"\n                               , \"AFMFONTS\"\n                               , \"BIBINPUTS\"\n                               , \"BLTXMLINPUTS\"\n                               , \"BSTINPUTS\"\n                               , \"CLUAINPUTS\"\n                               , \"CMAPFONTS\"\n                               , \"CWEBINPUTS\"\n                               , \"DVIPSHEADERS\"\n                               , \"ENCFONTS\"\n                               , \"FONTCIDMAPS\"\n                               , \"FONTFEATURES\"\n                               , \"GFFONTS\"\n                               , \"GLYPHFONTS\"\n                               , \"HOME\"\n                               , \"INDEXSTYLE\"\n                               , \"KPATHSEA_DEBUG\"\n                               , \"KPATHSEA_WARNING\"\n                               , \"LANG\"\n                               , \"LIGFONTS\"\n                               , \"LUAINPUTS\"\n                               , \"LUA_CPATH\"\n                               , \"LUA_PATH\"\n                               , \"MFBASES\"\n                               , \"MFINPUTS\"\n                               , \"MFPOOL\"\n                               , \"MFTINPUTS\"\n                               , \"MISCFONTS\"\n                               , \"MISSFONT_LOG\"\n                               , \"MLBIBINPUTS\"\n                               , \"MLBSTINPUTS\"\n                               , \"MPINPUTS\"\n                               , \"MPMEMS\"\n                               , \"MPPOOL\"\n                               , \"MPSUPPORT\"\n                               , \"OCPINPUTS\"\n                               , \"OFMFONTS\"\n                               , \"OPENTYPEFONTS\"\n                               , \"OPLFONTS\"\n                               , \"OTPINPUTS\"\n                               , \"OVFFONTS\"\n                               , \"OVPFONTS\"\n                               , \"PATH\"\n                               , \"PDFTEXCONFIG\"\n                               , \"PROGRAMFONTS\"\n                               , \"PSHEADERS\"\n                               , \"PWD\"\n                               , \"RISINPUTS\"\n                               , \"SELFAUTODIR\"\n                               , \"SELFAUTOLOC\"\n                               , \"SELFAUTOPARENT\"\n                               , \"SFDFONTS\"\n                               , \"SHELL\"\n                               , \"SOURCE_DATE_EPOCH\"\n                               , \"T1FONTS\"\n                               , \"T1INPUTS\"\n                               , \"T42FONTS\"\n                               , \"TEXBIB\"\n                               , \"TEXCONFIG\"\n                               , \"TEXDOCS\"\n                               , \"TEXFONTMAPS\"\n                               , \"TEXFONTS\"\n                               , \"TEXFORMATS\"\n                               , \"TEXINDEXSTYLE\"\n                               , \"TEXINPUTS\"\n                               , \"TEXMFCNF\"\n                               , \"TEXMFDBS\"\n                               , \"TEXMFINI\"\n                               , \"TEXMFSCRIPTS\"\n                               , \"TEXMFVAR\"\n                               , \"TEXPICTS\"\n                               , \"TEXPKS\"\n                               , \"TEXPOOL\"\n                               , \"TEXPSHEADERS\"\n                               , \"TEXSOURCES\"\n                               , \"TEX_HUSH\"\n                               , \"TFMFONTS\"\n                               , \"TMPDIR\"\n                               , \"TRFONTS\"\n                               , \"TTFONTS\"\n                               , \"USERPROFILE\"\n                               , \"USE_TEXMFVAR\"\n                               , \"USE_VARTEXFONTS\"\n                               , \"VARTEXFONTS\"\n                               , \"VFFONTS\"\n                               , \"WEB2C\"\n                               , \"WEBINPUTS\"\n                               ]) || \"TEXMF\" `isPrefixOf` e\n  report $ MakePDFInfo \"Relevant environment variables:\"\n             (T.intercalate \"\\n\" $ map tshow $ filter (isRelevant . fst) env)\n  report $ MakePDFInfo \"Source:\" source\n\nhandlePDFProgramNotFound :: String -> IE.IOError -> IO a\nhandlePDFProgramNotFound program e\n  | IE.isDoesNotExistError e =\n      E.throwIO $ PandocPDFProgramNotFoundError $ T.pack program\n  | otherwise = E.throwIO e\n\nutf8ToText :: ByteString -> Text\nutf8ToText lbs =\n  case decodeUtf8' lbs of\n    Left _  -> T.pack $ BC.unpack lbs  -- if decoding fails, treat as latin1\n    Right t -> TL.toStrict t\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/Capabilities.hs",
    "content": "{-# LANGUAGE MultiParamTypeClasses      #-}\n{- |\n   Module      : Text.Pandoc.Parsing\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n\nParser state capabilities.\n-}\nmodule Text.Pandoc.Parsing.Capabilities\n  ( -- * Capabilities\n\n    -- ** Element identifiers\n    HasIdentifierList (..)\n\n    -- ** Include files\n  , HasIncludeFiles (..)\n\n    -- ** String/Word boundaries\n  , HasLastStrPosition (..)\n  , updateLastStrPos\n  , notAfterString\n\n    -- ** Logging\n  , HasLogMessages (..)\n  , logMessage\n  , reportLogMessages\n\n    -- ** Macros\n  , HasMacros (..)\n\n    -- ** Quote context\n  , QuoteContext (..)\n  , HasQuoteContext (..)\n  , failIfInQuoteContext\n\n    -- ** Reader options\n  , HasReaderOptions (..)\n  , guardEnabled\n  , guardDisabled\n  )\nwhere\n\nimport Control.Monad (guard, when)\nimport Data.Text (Text)\nimport Text.Parsec (SourcePos, Stream, ParsecT,\n                     getPosition, getState, updateState)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Logging (LogMessage)\nimport Text.Pandoc.Options\n  ( Extension\n  , ReaderOptions(readerExtensions)\n  , extensionEnabled\n  )\nimport Text.Pandoc.TeX (Macro)\n\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\n\nclass HasReaderOptions st where\n  extractReaderOptions :: st -> ReaderOptions\n  getOption            :: (Stream s m t) => (ReaderOptions -> b) -> ParsecT s st m b\n  -- default\n  getOption  f         = f . extractReaderOptions <$> getState\n\nclass HasQuoteContext st m where\n  getQuoteContext :: (Stream s m t) => ParsecT s st m QuoteContext\n  withQuoteContext :: QuoteContext -> ParsecT s st m a -> ParsecT s st m a\n\nfailIfInQuoteContext :: (HasQuoteContext st m, Stream s m t)\n                     => QuoteContext\n                     -> ParsecT s st m ()\nfailIfInQuoteContext context = do\n  context' <- getQuoteContext\n  when (context' == context) $ Prelude.fail \"already inside quotes\"\n\nclass HasIdentifierList st where\n  extractIdentifierList  :: st -> Set.Set Text\n  updateIdentifierList   :: (Set.Set Text -> Set.Set Text) -> st -> st\n\nclass HasMacros st where\n  extractMacros          :: st -> M.Map Text Macro\n  updateMacros           :: (M.Map Text Macro -> M.Map Text Macro) -> st -> st\n\nclass HasLastStrPosition st where\n  setLastStrPos  :: Maybe SourcePos -> st -> st\n  getLastStrPos  :: st -> Maybe SourcePos\n\nclass HasLogMessages st where\n  addLogMessage :: LogMessage -> st -> st\n  getLogMessages :: st -> [LogMessage]\n\nclass HasIncludeFiles st where\n  getIncludeFiles :: st -> [Text]\n  addIncludeFile :: Text -> st -> st\n  dropLatestIncludeFile :: st -> st\n\n-- | Add a log message.\nlogMessage :: (Stream s m a, HasLogMessages st)\n           => LogMessage -> ParsecT s st m ()\nlogMessage msg = updateState (addLogMessage msg)\n\n-- | Report all the accumulated log messages, according to verbosity level.\nreportLogMessages :: (PandocMonad m, HasLogMessages st) => ParsecT s st m ()\nreportLogMessages = do\n  msgs <- getLogMessages <$> getState\n  mapM_ report msgs\n\n-- | Succeed only if the extension is enabled.\nguardEnabled :: (Stream s m a,  HasReaderOptions st)\n             => Extension -> ParsecT s st m ()\nguardEnabled ext =\n  getOption readerExtensions >>= guard . extensionEnabled ext\n\n-- | Succeed only if the extension is disabled.\nguardDisabled :: (Stream s m a, HasReaderOptions st)\n              => Extension -> ParsecT s st m ()\nguardDisabled ext =\n  getOption readerExtensions >>= guard . not . extensionEnabled ext\n\n-- | Update the position on which the last string ended.\nupdateLastStrPos :: (Stream s m a, HasLastStrPosition st)\n                 => ParsecT s st m ()\nupdateLastStrPos = getPosition >>= updateState . setLastStrPos . Just\n\n-- | Whether we are right after the end of a string.\nnotAfterString :: (Stream s m a, HasLastStrPosition st) => ParsecT s st m Bool\nnotAfterString = do\n  pos <- getPosition\n  st  <- getState\n  return $ getLastStrPos st /= Just pos\n\ndata QuoteContext\n    = InSingleQuote   -- ^ Used when parsing inside single quotes\n    | InDoubleQuote   -- ^ Used when parsing inside double quotes\n    | NoQuote         -- ^ Used when not parsing inside quotes\n    deriving (Eq, Show)\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/Citations.hs",
    "content": "{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\nModule      : Text.Pandoc.Parsing.Citations\nCopyright   : © 2006-2024 John MacFarlane\nLicense     : GPL-2.0-or-later\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nCitation parsing.\n-}\n\nmodule Text.Pandoc.Parsing.Citations\n  ( citeKey\n  )\nwhere\n\nimport Control.Monad (guard, MonadPlus(mzero))\nimport Data.Char (isAlphaNum , isSpace)\nimport Data.Text (Text)\nimport Text.Pandoc.Sources\nimport Text.Parsec\n  ( (<|>)\n  , Stream(..)\n  , ParsecT\n  , lookAhead\n  , many\n  , option\n  , try\n  )\nimport Text.Pandoc.Parsing.Capabilities (HasLastStrPosition, notAfterString)\nimport Text.Pandoc.Parsing.General\n\nimport qualified Data.Text as T\n\nciteKey :: (Stream s m Char, UpdateSourcePos s Char, HasLastStrPosition st)\n        => Bool -- ^ If True, allow expanded @{..} syntax.\n        -> ParsecT s st m (Bool, Text)\nciteKey allowBraced = try $ do\n  guard =<< notAfterString\n  suppress_author <- option False (True <$ char '-')\n  char '@'\n  key <- simpleCiteIdentifier\n        <|> if allowBraced\n               then charsInBalanced '{' '}'\n                     (T.singleton <$> (satisfy (not . isSpace)))\n               else mzero\n  return (suppress_author, key)\n\nsimpleCiteIdentifier :: (Stream s m Char, UpdateSourcePos s Char)\n                      => ParsecT s st m Text\nsimpleCiteIdentifier = do\n  firstChar <- alphaNum <|> char '_' <|> char '*' -- @* for wildcard in nocite\n  let regchar = satisfy (\\c -> isAlphaNum c || c == '_')\n  let internal p = try $ p <* lookAhead regchar\n  rest <- many $ regchar <|> internal (oneOf \":.#$%&-+?<>~/\") <|>\n                 try (oneOf \":/\" <* lookAhead (char '/'))\n  return $ T.pack $ firstChar:rest\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/Future.hs",
    "content": "{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{- |\n   Module      : Text.Pandoc.Parsing.Future\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n\nFuture type for parsing.\n-}\n\nmodule Text.Pandoc.Parsing.Future\n  ( Future (..)\n  , runF\n  , askF\n  , asksF\n  , returnF\n  )\nwhere\n\nimport Prelude hiding (Applicative(..))\nimport Control.Applicative (Applicative(..))\nimport Control.Monad.Reader\n  ( asks, runReader, MonadReader(ask), Reader, ReaderT(ReaderT) )\n\n-- | Reader monad wrapping the parser state. This is used to possibly\n-- delay evaluation until all relevant information has been parsed and\n-- made available in the parser state.\nnewtype Future s a = Future { runDelayed :: Reader s a }\n  deriving (Monad, Applicative, Functor)\n\ninstance Semigroup a => Semigroup (Future s a) where\n  (<>) = liftA2 (<>)\n\ninstance (Semigroup a, Monoid a) => Monoid (Future s a) where\n  mempty = return mempty\n  mappend = (<>)\n\n-- | Run a delayed action with the given state.\nrunF :: Future s a -> s -> a\nrunF = runReader . runDelayed\n\naskF :: Future s s\naskF = Future ask\n\nasksF :: (s -> a) -> Future s a\nasksF f = Future $ asks f\n\nreturnF :: Monad m => a -> m (Future s a)\nreturnF = return . return\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/General.hs",
    "content": "{-# LANGUAGE BangPatterns               #-}\n{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\nModule      : Text.Pandoc.Parsing.General\nCopyright   : © 2006-2024 John MacFarlane\nLicense     : GPL-2.0-or-later\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nParser combinators for pandoc format readers.\n-}\n\nmodule Text.Pandoc.Parsing.General\n  ( (<+?>)\n  , anyLine\n  , anyLineNewline\n  , blankline\n  , blanklines\n  , charRef\n  , characterReference\n  , charsInBalanced\n  , countChar\n  , emailAddress\n  , enclosed\n  , escaped\n  , extractIdClass\n  , gobbleAtMostSpaces\n  , gobbleSpaces\n  , indentWith\n  , insertIncludedFile\n  , isSpaceChar          -- not re-exported from T.P.Parsing\n  , lineBlockLines\n  , lineClump\n  , many1Char\n  , many1Till\n  , many1TillChar\n  , manyChar\n  , manyTillChar\n  , manyUntil\n  , manyUntilChar\n  , nonspaceChar\n  , notFollowedBy'\n  , oneOfStrings\n  , oneOfStringsCI\n  , parseFromString\n  , parseFromString'\n  , readWith\n  , readWithM\n  , registerHeader\n  , sepBy1'\n  , skipSpaces\n  , spaceChar\n  , stringAnyCase\n  , testStringWith\n  , textStr\n  , token\n  , trimInlinesF\n  , uri\n  , withHorizDisplacement\n  , withRaw\n  , fromParsecError\n  )\nwhere\n\nimport Control.Monad\n  ( join\n  , liftM\n  , unless\n  , void\n  , when\n  , MonadPlus(mzero)\n  )\nimport Control.Monad.Except ( MonadError(throwError) )\nimport Control.Monad.Identity ( Identity(..) )\nimport Data.Char\n  ( chr\n  , isAlphaNum\n  , isAscii\n  , isAsciiUpper\n  , isSpace\n  , ord\n  , toLower\n  , toUpper\n  )\nimport Data.Functor (($>))\nimport Data.List (intercalate, sortOn)\nimport Data.Ord (Down(..))\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text.Lazy.Builder as TB\nimport qualified Data.Text.Lazy as TL\nimport Text.Pandoc.Asciify (toAsciiText)\nimport Text.Pandoc.Builder (Attr, Inline(Str), Inlines, trimInlines)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, readFileFromDirs, report)\nimport Text.Pandoc.Logging\n  ( LogMessage(CouldNotLoadIncludeFile, DuplicateIdentifier) )\nimport Text.Pandoc.Options\n  ( extensionEnabled\n  , Extension(Ext_auto_identifiers, Ext_ascii_identifiers)\n  , ReaderOptions(readerTabStop, readerExtensions) )\nimport Text.Pandoc.Shared (tshow, uniqueIdent)\nimport Text.Pandoc.URI (schemes, escapeURI)\nimport Text.Pandoc.Sources\nimport Text.Pandoc.XML (fromEntities, lookupEntity)\nimport Text.Parsec\n  ( (<|>)\n  , Parsec\n  , ParsecT\n  , SourcePos\n  , sourceLine\n  , sourceColumn\n  , sourceName\n  , ParseError\n  , errorPos\n  , Stream(..)\n  , between\n  , choice\n  , count\n  , getInput\n  , getPosition\n  , getState\n  , lookAhead\n  , many\n  , many1\n  , manyTill\n  , notFollowedBy\n  , option\n  , runParserT\n  , setInput\n  , setPosition\n  , skipMany\n  , sourceColumn\n  , sourceName\n  , tokenPrim\n  , try\n  , unexpected\n  , updateState\n  )\nimport Text.Parsec.Pos (initialPos, newPos)\nimport Text.Pandoc.Error\n  ( PandocError(PandocParseError) )\nimport Text.Pandoc.Parsing.Capabilities\nimport Text.Pandoc.Parsing.State\nimport Text.Pandoc.Parsing.Future (Future (..))\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)\nimport qualified Data.Bifunctor as Bifunctor\n\n-- | Remove whitespace from start and end; just like @'trimInlines'@,\n-- but lifted into the 'Future' type.\ntrimInlinesF :: Future s Inlines -> Future s Inlines\ntrimInlinesF = liftM trimInlines\n\n-- | Like @count@, but packs its result\ncountChar :: (Stream s m Char, UpdateSourcePos s Char, Monad m)\n          => Int\n          -> ParsecT s st m Char\n          -> ParsecT s st m Text\ncountChar n = fmap T.pack . count n\n\n-- | Like @string@, but uses @Text@.\ntextStr :: (Stream s m Char, UpdateSourcePos s Char)\n        => Text -> ParsecT s u m Text\ntextStr t = string (T.unpack t) $> t\n\n\n-- | Parse any line of text, returning the contents without the\n-- final newline.\nanyLine :: Monad m => ParsecT Sources st m Text\nanyLine = do\n  -- This is much faster than:\n  -- manyTill anyChar newline\n  inp <- getInput\n  case inp of\n    Sources [] -> mzero\n    Sources ((fp,t):inps) ->\n      -- we assume that lines don't span different input files\n      case T.break (=='\\n') t of\n           (this, rest)\n             | T.null rest\n             , not (null inps) ->\n                -- line may span different input files, so do it\n                 -- character by character\n                 T.pack <$> manyTill anyChar newline\n             | otherwise -> do --  either end of inputs or newline in rest\n                 setInput $ Sources ((fp, rest):inps)\n                 char '\\n' -- needed so parsec knows we won't match empty string\n                           -- and so source pos is updated\n                 return this\n\n-- | Parse any line, include the final newline in the output\nanyLineNewline :: Monad m => ParsecT Sources st m Text\nanyLineNewline = (<> \"\\n\") <$> anyLine\n\n-- | Parse indent by specified number of spaces (or equiv. tabs)\nindentWith :: (Stream s m Char, UpdateSourcePos s Char)\n           => HasReaderOptions st\n           => Int -> ParsecT s st m Text\nindentWith num = do\n  tabStop <- getOption readerTabStop\n  if num < tabStop\n     then countChar num (char ' ')\n     else choice [ try (countChar num (char ' '))\n                 , try (char '\\t' >> indentWith (num - tabStop)) ]\n\n-- | Like @many@, but packs its result.\nmanyChar :: Stream s m t\n         => ParsecT s st m Char\n         -> ParsecT s st m Text\nmanyChar = fmap T.pack . many\n\n-- | Like @many1@, but packs its result.\nmany1Char :: Stream s m t\n          => ParsecT s st m Char\n          -> ParsecT s st m Text\nmany1Char = fmap T.pack . many1\n\n-- | Like @manyTill@, but packs its result.\nmanyTillChar :: Stream s m t\n             => ParsecT s st m Char\n             -> ParsecT s st m a\n             -> ParsecT s st m Text\nmanyTillChar p = fmap T.pack . manyTill p\n\n-- | Like @manyTill@, but reads at least one item.\nmany1Till :: (Show end, Stream s m t)\n          => ParsecT s st m a\n          -> ParsecT s st m end\n          -> ParsecT s st m [a]\nmany1Till p end = do\n         notFollowedBy' end\n         first <- p\n         rest <- manyTill p end\n         return (first:rest)\n\n-- | Like @many1Till@, but packs its result\nmany1TillChar :: (Show end, Stream s m t)\n              => ParsecT s st m Char\n              -> ParsecT s st m end\n              -> ParsecT s st m Text\nmany1TillChar p = fmap T.pack . many1Till p\n\n-- | Like @manyTill@, but also returns the result of end parser.\nmanyUntil :: ParsecT s u m a\n          -> ParsecT s u m b\n          -> ParsecT s u m ([a], b)\nmanyUntil p end = scan\n  where scan =\n          (do e <- end\n              return ([], e)\n          ) <|>\n          (do x <- p\n              (xs, e) <- scan\n              return (x:xs, e))\n\n-- | Like @manyUntil@, but also packs its result.\nmanyUntilChar :: ParsecT s u m Char\n              -> ParsecT s u m b\n              -> ParsecT s u m (Text, b)\nmanyUntilChar p = fmap go . manyUntil p\n  where\n    go (x, y) = (T.pack x, y)\n\n-- | Like @sepBy1@ from Parsec,\n-- but does not fail if it @sep@ succeeds and @p@ fails.\nsepBy1' :: ParsecT s u m a\n        -> ParsecT s u m sep\n        -> ParsecT s u m [a]\nsepBy1' p sep = (:) <$> p <*> many (try $ sep >> p)\n\n-- | A more general form of @notFollowedBy@.  This one allows any\n-- type of parser to be specified, and succeeds only if that parser fails.\n-- It does not consume any input.\nnotFollowedBy' :: (Show b, Stream s m a) => ParsecT s st m b -> ParsecT s st m ()\nnotFollowedBy' p  = try $ join $  do  a <- try p\n                                      return (unexpected (show a))\n                                  <|>\n                                  return (return ())\n-- (This version due to Andrew Pimlott on the Haskell mailing list.)\n\noneOfStrings' :: (Stream s m Char, UpdateSourcePos s Char)\n               => (Char -> Char -> Bool) -> [Text] -> ParsecT s st m Text\noneOfStrings' _ [] = Prelude.fail \"no strings to match\"\noneOfStrings' matches strs =\n  TL.toStrict . TB.toLazyText <$> try (go (TB.fromText mempty) strs)\n where\n   go acc strs' = do\n     c <- anyChar\n     let strs'' = [t | Just (d, t) <- map T.uncons strs', matches c d]\n     let !acc' = acc <> TB.singleton c\n     case strs'' of\n       []  -> Prelude.fail \"not found\"\n       _   -> if any T.null strs''\n                 then option acc' (try (go acc' strs''))\n                 else go acc' strs''\n\n-- | Parses one of a list of strings.  If the list contains\n-- two strings one of which is a prefix of the other, the longer\n-- string will be matched if possible.\noneOfStrings :: (Stream s m Char, UpdateSourcePos s Char)\n             => [Text] -> ParsecT s st m Text\noneOfStrings = oneOfStrings' (==)\n\n-- | Parses one of a list of strings (tried in order), case insensitive.\n\n-- TODO: This will not be accurate with general Unicode (neither\n-- Text.toLower nor Text.toCaseFold can be implemented with a map)\noneOfStringsCI :: (Stream s m Char, UpdateSourcePos s Char)\n               => [Text] -> ParsecT s st m Text\noneOfStringsCI = oneOfStrings' ciMatch\n  where ciMatch x y = toLower' x == toLower' y\n        -- this optimizes toLower by checking common ASCII case\n        -- first, before calling the expensive unicode-aware\n        -- function:\n        toLower' c | isAsciiUpper c = chr (ord c + 32)\n                   | isAscii c = c\n                   | otherwise = toLower c\n\n-- | Parses a space or tab.\nspaceChar :: (Stream s m Char, UpdateSourcePos s Char)\n          => ParsecT s st m Char\nspaceChar = satisfy $ \\c -> c == ' ' || c == '\\t'\n\n-- | Parses a nonspace, nonnewline character.\nnonspaceChar :: (Stream s m Char, UpdateSourcePos s Char)\n             => ParsecT s st m Char\nnonspaceChar = satisfy (not . isSpaceChar)\n\nisSpaceChar :: Char -> Bool\nisSpaceChar ' '  = True\nisSpaceChar '\\t' = True\nisSpaceChar '\\n' = True\nisSpaceChar '\\r' = True\nisSpaceChar _    = False\n\n-- | Skips zero or more spaces or tabs.\nskipSpaces :: (Stream s m Char, UpdateSourcePos s Char)\n           => ParsecT s st m ()\nskipSpaces = skipMany spaceChar\n\n-- | Skips zero or more spaces or tabs, then reads a newline.\nblankline :: (Stream s m Char, UpdateSourcePos s Char)\n          => ParsecT s st m Char\nblankline = try $ skipSpaces >> newline\n\n-- | Parses one or more blank lines and returns a string of newlines.\nblanklines :: (Stream s m Char, UpdateSourcePos s Char)\n           => ParsecT s st m Text\nblanklines = T.pack <$> many1 blankline\n\n-- | Gobble n spaces; if tabs are encountered, expand them\n-- and gobble some or all of their spaces, leaving the rest.\ngobbleSpaces :: (HasReaderOptions st, Monad m)\n             => Int -> ParsecT Sources st m ()\ngobbleSpaces 0 = return ()\ngobbleSpaces n\n  | n < 0     = error \"gobbleSpaces called with negative number\"\n  | otherwise = try $ do\n      char ' ' <|> eatOneSpaceOfTab\n      gobbleSpaces (n - 1)\n\neatOneSpaceOfTab :: (HasReaderOptions st, Monad m) => ParsecT Sources st m Char\neatOneSpaceOfTab = do\n  lookAhead (char '\\t')\n  pos <- getPosition\n  tabstop <- getOption readerTabStop\n  -- replace the tab on the input stream with spaces\n  let numSpaces = tabstop - ((sourceColumn pos - 1) `mod` tabstop)\n  inp <- getInput\n  setInput $\n    case inp of\n      Sources [] -> error \"eatOneSpaceOfTab - empty Sources list\"\n      Sources ((fp,t):rest) ->\n        -- drop the tab and add spaces\n        Sources ((fp, T.replicate numSpaces \" \" <> T.drop 1 t):rest)\n  char ' '\n\n-- | Gobble up to n spaces; if tabs are encountered, expand them\n-- and gobble some or all of their spaces, leaving the rest.\ngobbleAtMostSpaces :: (HasReaderOptions st, Monad m)\n                   => Int -> ParsecT Sources st m Int\ngobbleAtMostSpaces 0 = return 0\ngobbleAtMostSpaces n\n  | n < 0     = error \"gobbleAtMostSpaces called with negative number\"\n  | otherwise = option 0 $ do\n      char ' ' <|> eatOneSpaceOfTab\n      (+ 1) <$> gobbleAtMostSpaces (n - 1)\n\n-- | Parses material enclosed between start and end parsers.\nenclosed :: (Show end, Stream s m Char, UpdateSourcePos s Char)\n         => ParsecT s st m t   -- ^ start parser\n         -> ParsecT s st m end  -- ^ end parser\n         -> ParsecT s st m a    -- ^ content parser (to be used repeatedly)\n         -> ParsecT s st m [a]\nenclosed start end parser = try $\n  start >> notFollowedBy space >> many1Till parser end\n\n-- | Parse string, case insensitive.\nstringAnyCase :: (Stream s m Char, UpdateSourcePos s Char)\n              => Text -> ParsecT s st m Text\nstringAnyCase = fmap T.pack . stringAnyCase' . T.unpack\n\nstringAnyCase' :: (Stream s m Char, UpdateSourcePos s Char)\n               => String -> ParsecT s st m String\nstringAnyCase' [] = string \"\"\nstringAnyCase' (x:xs) = do\n  firstChar <- char (toUpper x) <|> char (toLower x)\n  rest <- stringAnyCase' xs\n  return (firstChar:rest)\n\n-- TODO rewrite by just adding to Sources stream?\n-- | Parse contents of 'str' using 'parser' and return result.\nparseFromString :: Monad m\n                => ParsecT Sources st m r\n                -> Text\n                -> ParsecT Sources st m r\nparseFromString parser str = do\n  oldPos <- getPosition\n  oldInput <- getInput\n  setInput $ toSources str\n  setPosition $ initialPos $ sourceName oldPos <> \"_chunk\"\n  result <- parser\n  setInput oldInput\n  setPosition oldPos\n  return result\n\n-- | Like 'parseFromString' but specialized for 'ParserState'.\n-- This resets 'stateLastStrPos', which is almost always what we want.\nparseFromString' :: (Monad m, HasLastStrPosition u)\n                 => ParsecT Sources u m a\n                 -> Text\n                 -> ParsecT Sources u m a\nparseFromString' parser str = do\n  oldLastStrPos <- getLastStrPos <$> getState\n  updateState $ setLastStrPos Nothing\n  res <- parseFromString parser str\n  updateState $ setLastStrPos oldLastStrPos\n  return res\n\n-- | Parse raw line block up to and including blank lines.\nlineClump :: Monad m => ParsecT Sources st m Text\nlineClump = blanklines\n          <|> (T.unlines <$> many1 (notFollowedBy blankline >> anyLine))\n\n-- | Parse a string of characters between an open character\n-- and a close character, including text between balanced\n-- pairs of open and close, which must be different. For example,\n-- @charsInBalanced '(' ')' (Data.Text.singleton <$> anyChar)@ will parse\n-- \"(hello (there))\" and return \"hello (there)\".\ncharsInBalanced :: (Stream s m Char, UpdateSourcePos s Char)\n                => Char -> Char -> ParsecT s st m Text -> ParsecT s st m Text\ncharsInBalanced open close parser = try $ do\n  char open\n  let isDelim c = c == open || c == close\n  raw <- many $ mconcat <$> many1 (notFollowedBy (satisfy isDelim) >> parser)\n             <|> (do res <- charsInBalanced open close parser\n                     return $ T.singleton open <> res <> T.singleton close)\n  char close\n  return $ mconcat raw\n\n-- Parsers for email addresses and URIs\n\n-- | Parses an email address; returns original and corresponding\n-- escaped mailto: URI.\nemailAddress :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (Text, Text)\nemailAddress = try $ toResult <$> mailbox <*> (char '@' *> domain)\n where toResult mbox dom = let full = fromEntities $ T.pack $ mbox ++ '@':dom\n                           in  (full, escapeURI $ \"mailto:\" <> full)\n       mailbox           = intercalate \".\" <$> (emailWord `sepBy1'` dot)\n       domain            = intercalate \".\" <$> (subdomain `sepBy1'` dot)\n       dot               = char '.'\n       subdomain         = many1 $ alphaNum <|> innerPunct (=='-')\n       -- this excludes some valid email addresses, since an\n       -- email could contain e.g. '__', but gives better results\n       -- for our purposes, when combined with markdown parsing:\n       innerPunct f      = try (satisfy f\n                                 <* notFollowedBy (satisfy (not . isAlphaNum)))\n       -- technically an email address could begin with a symbol,\n       -- but allowing this creates too many problems.\n       -- See e.g. https://github.com/jgm/pandoc/issues/2940\n       emailWord         = do x <- satisfy isAlphaNum\n                              xs <- many (satisfy isEmailChar)\n                              return (x:xs)\n       isEmailChar c     = isAlphaNum c || isEmailPunct c\n       isEmailPunct c    = T.any (== c) \"!\\\"#$%&'*+-/=?^_{|}~;\"\n\n\nuriScheme :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Text\nuriScheme = oneOfStringsCI (Set.toList schemes)\n\n-- | Parses a URI. Returns pair of original and URI-escaped version.\nuri :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (Text, Text)\nuri = try $ do\n  scheme <- uriScheme\n  char ':'\n  -- Avoid parsing e.g. \"**Notes:**\" as a raw URI:\n  notFollowedBy $ satisfy (\\c -> c == '*' || c == '_' || c == ']')\n  -- We allow sentence punctuation except at the end, since\n  -- we don't want the trailing '.' in 'http://google.com.' We want to allow\n  -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation)\n  -- as a URL, while NOT picking up the closing paren in\n  -- (http://wikipedia.org). So we include balanced parens in the URL.\n  str <- T.concat <$> many1 (uriChunkBetween '(' ')'\n                        <|> uriChunkBetween '{' '}'\n                        <|> uriChunkBetween '[' ']'\n                        <|> T.pack <$> uriChunk)\n  str' <- option str $ char '/' >> return (str <> \"/\")\n  let uri' = scheme <> \":\" <> fromEntities str'\n  return (uri', escapeURI uri')\n  where\n    isWordChar '#' = True\n    isWordChar '$' = True\n    isWordChar '%' = True\n    isWordChar '+' = True\n    isWordChar '/' = True\n    isWordChar '@' = True\n    isWordChar '\\\\' = True\n    isWordChar '_' = True\n    isWordChar '-' = True\n    isWordChar '&' = True\n    isWordChar '=' = True\n    isWordChar c   = isAlphaNum c\n\n    wordChar = satisfy isWordChar\n    percentEscaped = try $ (:) <$> char '%' <*> many1 hexDigit\n    entity = try $ T.unpack <$> characterReference\n    punct = try $ many1 (char ',') <|> fmap pure (satisfy (\\c -> not (isSpace c) && c /= '<' && c /= '>'))\n    uriChunk = many1 wordChar\n           <|> percentEscaped\n           <|> entity\n           <|> try (punct <* lookAhead (void wordChar <|> void percentEscaped))\n    uriChunkBetween l r = try $ do chunk <- between (char l) (char r) uriChunk\n                                   return (T.pack $ [l] ++ chunk ++ [r])\n\n-- | Applies a parser, returns tuple of its results and its horizontal\n-- displacement (the difference between the source column at the end\n-- and the source column at the beginning). Vertical displacement\n-- (source row) is ignored.\nwithHorizDisplacement :: (Stream s m Char, UpdateSourcePos s Char)\n                      => ParsecT s st m a  -- ^ Parsec to apply\n                      -> ParsecT s st m (a, Int) -- ^ (result, displacement)\nwithHorizDisplacement parser = do\n  pos1 <- getPosition\n  result <- parser\n  pos2 <- getPosition\n  return (result, sourceColumn pos2 - sourceColumn pos1)\n\n-- | Applies a parser and returns the raw string that was parsed,\n-- along with the value produced by the parser.\nwithRaw :: Monad m\n        => ParsecT Sources st m a\n        -> ParsecT Sources st m (a, Text)\nwithRaw parser = do\n  inps1 <- getInput\n  result <- parser\n  inps2 <- getInput\n  -- 'raw' is the difference between inps1 and inps2\n  return (result, sourcesDifference inps1 inps2)\n\nsourcesDifference :: Sources -> Sources -> Text\nsourcesDifference (Sources is1) (Sources is2) = go is1 is2\n where\n   go inps1 inps2 =\n    case (inps1, inps2) of\n      ([], _) -> mempty\n      (_, []) -> mconcat $ map snd inps1\n      ((p1,t1):rest1, (p2, t2):rest2)\n        | p1 == p2\n        , t1 == t2  -> go rest1 rest2\n        | p1 == p2\n        , t1 /= t2  -> fromMaybe mempty $ T.stripSuffix t2 t1\n        | otherwise -> t1 <> go rest1 inps2\n\n-- | Parses backslash, then applies character parser.\nescaped :: (Stream s m Char, UpdateSourcePos s Char)\n        => ParsecT s st m Char  -- ^ Parsec for character to escape\n        -> ParsecT s st m Char\nescaped parser = try $ char '\\\\' >> parser\n\n-- | Parse character entity.\ncharacterReference :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Text\ncharacterReference = try $ do\n  char '&'\n  ent <- many1TillChar nonspaceChar (char ';')\n  case lookupEntity (ent <> \";\") of\n       Just t       -> return t\n       _            -> Prelude.fail \"entity not found\"\n\n-- | Parses a character reference and returns a Str element.\ncharRef :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Inline\ncharRef = Str <$> characterReference\n\nlineBlockLine :: Monad m => ParsecT Sources st m Text\nlineBlockLine = try $ do\n  char '|'\n  char ' '\n  white <- T.pack <$> many (spaceChar >> return '\\160')\n  notFollowedBy newline\n  line <- anyLine\n  continuations <- many (try $ char ' ' >> anyLine)\n  return $ white <> T.unwords (line : continuations)\n\nblankLineBlockLine :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Char\nblankLineBlockLine = try (char '|' >> blankline)\n\n-- | Parses an RST-style line block and returns a list of strings.\nlineBlockLines :: Monad m => ParsecT Sources st m [Text]\nlineBlockLines = try $ do\n  lines' <- many1 (lineBlockLine <|> (T.singleton <$> blankLineBlockLine))\n  skipMany blankline\n  return lines'\n\n\n-- | Removes the ParsecT layer from the monad transformer stack\nreadWithM :: (Monad m, ToSources t)\n          => ParsecT Sources st m a  -- ^ parser\n          -> st                      -- ^ initial state\n          -> t                       -- ^ input\n          -> m (Either PandocError a)\nreadWithM parser state input =\n    Bifunctor.first (fromParsecError sources)\n      <$> runParserT parser state (initialSourceName sources) sources\n where\n   sources = toSources input\n\n\n-- | Parse a string with a given parser and state\nreadWith :: ToSources t\n         => Parsec Sources st a\n         -> st\n         -> t\n         -> Either PandocError a\nreadWith p t inp = runIdentity $ readWithM p t inp\n\n-- | Parse a string with @parser@ (for testing).\ntestStringWith :: Show a\n               => ParsecT Sources ParserState Identity a\n               -> Text\n               -> IO ()\ntestStringWith parser str = UTF8.putStrLn $ tshow $\n                            readWith parser defaultParserState (toSources str)\n\n-- | Add header to the list of headers in state, together\n--  with its associated identifier.  If the identifier is null\n--  and the auto_identifiers extension is set, generate a new\n--  unique identifier, and update the list of identifiers\n--  in state.  Issue a warning if an explicit identifier\n--  is encountered that duplicates an earlier identifier\n--  (explicit or automatically generated).\nregisterHeader :: (Stream s m a, HasReaderOptions st,\n                   HasLogMessages st, HasIdentifierList st)\n               => Attr -> Inlines -> ParsecT s st m Attr\nregisterHeader (ident,classes,kvs) header' = do\n  ids <- extractIdentifierList <$> getState\n  exts <- getOption readerExtensions\n  if T.null ident && Ext_auto_identifiers `extensionEnabled` exts\n     then do\n       let id' = uniqueIdent exts (B.toList header') ids\n       let id'' = if Ext_ascii_identifiers `extensionEnabled` exts\n                     then toAsciiText id'\n                     else id'\n       updateState $ updateIdentifierList $ Set.insert id'\n       updateState $ updateIdentifierList $ Set.insert id''\n       return (id'',classes,kvs)\n     else do\n        unless (T.null ident) $ do\n          when (ident `Set.member` ids) $ do\n            pos <- getPosition\n            logMessage $ DuplicateIdentifier ident pos\n          updateState $ updateIdentifierList $ Set.insert ident\n        return (ident,classes,kvs)\n\ntoken :: (Stream s m t)\n      => (t -> Text)\n      -> (t -> SourcePos)\n      -> (t -> Maybe a)\n      -> ParsecT s st m a\ntoken pp pos match = tokenPrim (T.unpack . pp) (\\_ t _ -> pos t) match\n\ninfixr 5 <+?>\n(<+?>) :: (Monoid a) => ParsecT s st m a -> ParsecT s st m a -> ParsecT s st m a\na <+?> b = a >>= flip fmap (try b <|> return mempty) . mappend\n\nextractIdClass :: Attr -> Attr\nextractIdClass (ident, cls, kvs) = (ident', cls', kvs')\n  where\n    ident' = fromMaybe ident (lookup \"id\" kvs)\n    cls'   = maybe cls T.words $ lookup \"class\" kvs\n    kvs'   = filter (\\(k,_) -> k /= \"id\" || k /= \"class\") kvs\n\ninsertIncludedFile :: (PandocMonad m, HasIncludeFiles st)\n                   => ParsecT a st m b -- ^ parser to apply\n                   -> (Text -> a) -- ^ convert Text to stream type\n                   -> [FilePath]  -- ^ search path (directories)\n                   -> FilePath    -- ^ path of file to include\n                   -> Maybe Int   -- ^ start line (negative counts from end)\n                   -> Maybe Int   -- ^ end line (negative counts from end)\n                   -> ParsecT a st m b\ninsertIncludedFile parser toStream dirs f mbstartline mbendline = do\n  oldPos <- getPosition\n  oldInput <- getInput\n  containers <- getIncludeFiles <$> getState\n  when (T.pack f `elem` containers) $\n    throwError $ PandocParseError $ T.pack $ \"Include file loop at \" ++ show oldPos\n  updateState $ addIncludeFile $ T.pack f\n  mbcontents <- readFileFromDirs dirs f\n  contents <- case mbcontents of\n                   Just s -> return $ exciseLines mbstartline mbendline s\n                   Nothing -> do\n                     report $ CouldNotLoadIncludeFile (T.pack f) oldPos\n                     return \"\"\n  setInput $ toStream contents\n  setPosition $ newPos f (fromMaybe 1 mbstartline) 1\n  result <- parser\n  setInput oldInput\n  setPosition oldPos\n  updateState dropLatestIncludeFile\n  return result\n\nexciseLines :: Maybe Int -> Maybe Int -> Text -> Text\nexciseLines Nothing Nothing t = t\nexciseLines mbstartline mbendline t =\n  T.unlines $ take (endline' - (startline' - 1))\n            $ drop (startline' - 1) contentLines\n where\n  contentLines = T.lines t\n  numLines = length contentLines\n  startline' = case mbstartline of\n                 Nothing -> 1\n                 Just x | x >= 0 -> x\n                        | otherwise -> numLines + x -- negative from end\n  endline' = case mbendline of\n                 Nothing -> numLines\n                 Just x | x >= 0 -> x\n                        | otherwise -> numLines + x -- negative from end\n\nfromParsecError :: Sources -> ParseError -> PandocError\nfromParsecError (Sources inputs) err' = PandocParseError msg\n where\n  msg = \"Error at \" <> tshow  err' <> errorContext\n  errPos = errorPos err'\n  errLine = sourceLine errPos\n  errColumn = sourceColumn errPos\n  errFile = sourceName errPos\n  errorContext =\n    case sortOn (Down . sourceLine . fst)\n            [ (pos,t)\n              | (pos,t) <- inputs\n              , sourceName pos == errFile\n              , sourceLine pos <= errLine\n            ] of\n      []  -> \"\"\n      ((pos,txt):_) ->\n        let ls = T.lines txt <> [\"\"]\n            ln = (errLine - sourceLine pos) + 1\n         in if length ls > ln && ln >= 1\n               then T.concat [\"\\n\", ls !! (ln - 1)\n                             ,\"\\n\", T.replicate (errColumn - 1) \" \"\n                             ,\"^\"]\n               else \"\"\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/GridTable.hs",
    "content": "{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE LambdaCase                 #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\n   Module      : Text.Pandoc.Parsing.GridTable\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n\nShared parsers for plaintext tables.\n-}\nmodule Text.Pandoc.Parsing.GridTable\n  ( gridTableWith\n  , gridTableWith'\n  , tableWith\n  , tableWith'\n  , tableWithSpans\n  , tableWithSpans'\n  , widthsFromIndices\n    -- * Components of a plain-text table\n  , TableComponents (..)\n  , TableNormalization (..)\n  , toTableComponents\n  , toTableComponents'\n  , toTableComponentsWithSpans\n  , toTableComponentsWithSpans'\n  , singleRowSpans\n  , singleColumnSpans\n  )\nwhere\n\nimport Data.Array (elems)\nimport Data.Text (Text)\nimport Safe (lastDef)\nimport Text.Pandoc.Options (ReaderOptions (readerColumns))\nimport Text.Pandoc.Builder (Blocks)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Parsing.Capabilities\nimport Text.Pandoc.Parsing.General\nimport Text.Pandoc.Sources\nimport Text.Parsec (Stream (..), ParsecT, optional, sepEndBy1, try)\n\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport qualified Text.GridTable as GT\nimport qualified Text.Pandoc.Builder as B\n\n-- | Collection of components making up a Table block.\ndata TableComponents = TableComponents\n  { tableAttr     :: Attr\n  , tableCaption  :: Caption\n  , tableColSpecs :: [ColSpec]\n  , tableHead     :: TableHead\n  , tableBodies   :: [TableBody]\n  , tableFoot     :: TableFoot\n  }\n\n-- | Creates a table block from the collection of table parts.\ntableFromComponents :: TableComponents -> Blocks\ntableFromComponents (TableComponents attr capt colspecs th tb tf) =\n  B.tableWith attr capt colspecs th tb tf\n\n-- | Bundles basic table components into a single value.\ntoTableComponents :: [Alignment] -> [Double] -> [[Blocks]] -> [[Blocks]]\n                  -> TableComponents\ntoTableComponents = toTableComponents' NoNormalization\n\n-- | Bundles basic table components into a single value, performing\n-- normalizations as necessary.\ntoTableComponents' :: TableNormalization\n                   -> [Alignment] -> [Double] -> [[Blocks]] -> [[Blocks]]\n                   -> TableComponents\ntoTableComponents' normalization aligns widths heads rows =\n  toTableComponentsWithSpans' normalization aligns widths (singleSpansBlocks heads) (singleSpansBlocks rows)\n\n-- | Bundles basic table components with span information into a single value.\ntoTableComponentsWithSpans :: [Alignment] -> [Double] -> [[(Blocks, RowSpan, ColSpan)]] -> [[(Blocks, RowSpan, ColSpan)]]\n                           -> TableComponents\ntoTableComponentsWithSpans = toTableComponentsWithSpans' NoNormalization\n\n-- | Bundles basic table components with span information into a single value,\n-- performing normalizations as necessary.\ntoTableComponentsWithSpans' :: TableNormalization\n                            -> [Alignment] -> [Double] -> [[(Blocks, RowSpan, ColSpan)]] -> [[(Blocks, RowSpan, ColSpan)]]\n                            -> TableComponents\ntoTableComponentsWithSpans' normalization aligns widths heads rows =\n  let th = TableHead nullAttr (mapMaybe (toHeaderRow normalization) heads)\n      tb = TableBody nullAttr 0 [] (map toRow rows)\n      tf = TableFoot nullAttr []\n      colspecs = toColSpecs aligns widths\n  in TableComponents nullAttr B.emptyCaption colspecs th [tb] tf\n\n-- | Combine a list of column alignments and column widths into a list\n-- of column specifiers. Both input lists should have the same length.\ntoColSpecs :: [Alignment]   -- ^ column alignments\n           -> [Double]      -- ^ column widths\n           -> [ColSpec]\ntoColSpecs aligns widths = zip aligns (map fromWidth widths')\n  where\n    fromWidth n\n      | n > 0     = ColWidth n\n      | otherwise = ColWidthDefault\n\n    -- renormalize widths if greater than 100%:\n    totalWidth = sum widths\n    widths' = if totalWidth < 1\n              then widths\n              else map (/ totalWidth) widths\n\n-- | Whether the table header should be normalized, i.e., whether an header row\n-- with only empty cells should be omitted.\ndata TableNormalization\n  = NoNormalization\n  | NormalizeHeader\n\n--\n-- Grid Tables\n--\n\n-- | Parse a grid table: starts with row of '-' on top, then header\n-- (which may be grid), then the rows, which may be grid, separated by\n-- blank lines, and ending with a footer (dashed line followed by blank\n-- line).\ngridTableWith :: (Monad m, Monad mf, HasLastStrPosition st, HasReaderOptions st)\n              => ParsecT Sources st m (mf Blocks)  -- ^ Block list parser\n              -> ParsecT Sources st m (mf Blocks)\ngridTableWith blocks = fmap tableFromComponents <$>\n  gridTableWith' NoNormalization blocks\n\n-- | Like @'gridTableWith'@, but returns 'TableComponents' instead of a\n-- Table.\ngridTableWith' :: (Monad m, Monad mf,\n                   HasReaderOptions st, HasLastStrPosition st)\n               => TableNormalization\n               -> ParsecT Sources st m (mf Blocks) -- ^ Block list parser\n               -> ParsecT Sources st m (mf TableComponents)\ngridTableWith' normalization blocks = do\n  tbl <- GT.gridTable <* optional blanklines\n  let blkTbl = GT.mapCells\n               (\\lns -> parseFromString' blocks\n                        . flip T.snoc '\\n'  -- ensure proper block parsing\n                        . T.unlines\n                        . removeOneLeadingSpace\n                        $ map T.stripEnd lns)\n               tbl\n  let rows = GT.rows blkTbl\n  let toPandocCell (GT.Cell c (GT.RowSpan rs) (GT.ColSpan cs)) =\n        fmap (B.cell AlignDefault (B.RowSpan rs) (B.ColSpan cs) . plainify) <$> c\n  rows' <- mapM (mapM toPandocCell) rows\n  columns <- getOption readerColumns\n  let colspecs = zipWith (\\cs w -> (convAlign $ fst cs, B.ColWidth w))\n                         (elems $ GT.arrayTableColSpecs tbl)\n                         (fractionalColumnWidths tbl columns)\n  let caption = B.emptyCaption\n  return $ do\n    rows'' <- mapM sequence rows'\n    let headLen = maybe 0 GT.fromRowIndex $ GT.arrayTableHead tbl\n    let (hRows, bRows') =\n          splitAt headLen (map (B.Row B.nullAttr) rows'')\n    let (bRows, fRows) =\n          case GT.arrayTableFoot tbl of\n            Just fIdx -> splitAt (GT.fromRowIndex fIdx - headLen - 1) bRows'\n            Nothing   -> (bRows', [])\n    let thead = B.TableHead B.nullAttr $ case (hRows, normalization) of\n          -- normalize header if necessary: remove header if it contains\n          -- only a single row in which all cells are empty.\n          ([hrow], NormalizeHeader) ->\n            let Row _attr cells = hrow\n                simple = \\case\n                  Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [] ->\n                    True\n                  _ ->\n                    False\n            in [B.Row nullAttr cells | not (null cells) &&\n                                       not (all simple cells)]\n          _ -> hRows\n    let tfoot = B.TableFoot B.nullAttr fRows\n    let tbody = B.TableBody B.nullAttr 0 [] bRows\n    return $ TableComponents nullAttr caption colspecs thead [tbody] tfoot\n\nremoveOneLeadingSpace :: [Text] -> [Text]\nremoveOneLeadingSpace xs =\n  if all startsWithSpace xs\n     then map (T.drop 1) xs\n     else xs\n   where startsWithSpace t = case T.uncons t of\n           Nothing     -> True\n           Just (c, _) -> c == ' '\n\nplainify :: B.Blocks -> B.Blocks\nplainify blks = case B.toList blks of\n  [Para x] -> B.fromList [Plain x]\n  _        -> blks\n\nconvAlign :: GT.Alignment -> B.Alignment\nconvAlign GT.AlignLeft    = B.AlignLeft\nconvAlign GT.AlignRight   = B.AlignRight\nconvAlign GT.AlignCenter  = B.AlignCenter\nconvAlign GT.AlignDefault = B.AlignDefault\n\nfractionalColumnWidths :: GT.ArrayTable a -> Int -> [Double]\nfractionalColumnWidths gt charColumns =\n  let widths = map ((+1) . snd) -- include width of separator\n               (elems $ GT.arrayTableColSpecs gt)\n      norm = fromIntegral $ max (sum widths + length widths - 2) charColumns\n  in map (\\w -> fromIntegral w / norm) widths\n\n---\n\n-- | Parse a table using 'headerParser', 'rowParser',\n-- 'lineParser', and 'footerParser'.\ntableWith :: (Stream s m Char, UpdateSourcePos s Char,\n              HasReaderOptions st, Monad mf)\n          => ParsecT s st m (mf [[Blocks]], [Alignment], [Int]) -- ^ header parser\n          -> ([Int] -> ParsecT s st m (mf [Blocks]))  -- ^ row parser\n          -> ParsecT s st m sep                       -- ^ line parser\n          -> ParsecT s st m end                       -- ^ footer parser\n          -> ParsecT s st m (mf Blocks)\ntableWith hp rp lp fp = fmap tableFromComponents <$>\n  tableWith' NoNormalization hp rp lp fp\n\ntableWith' :: (Stream s m Char, UpdateSourcePos s Char,\n               HasReaderOptions st, Monad mf)\n           => TableNormalization\n           -> ParsecT s st m (mf [[Blocks]], [Alignment], [Int]) -- ^ header parser\n           -> ([Int] -> ParsecT s st m (mf [Blocks]))  -- ^ row parser\n           -> ParsecT s st m sep                       -- ^ line parser\n           -> ParsecT s st m end                       -- ^ footer parser\n           -> ParsecT s st m (mf TableComponents)\ntableWith' n11n headerParser rowParser lineParser footerParser =\n  tableWithSpans' n11n headerParser' rowParser' lineParser footerParser\n    where\n      headerParser' = fmap (\\(heads, aligns, indices) -> (fmap singleSpansBlocks heads, aligns, indices)) headerParser\n      rowParser' indices = fmap (\\row -> zip3 row (repeat 1) (repeat 1)) <$> rowParser indices\n\ntableWithSpans :: (Stream s m Char, UpdateSourcePos s Char,\n              HasReaderOptions st, Monad mf)\n               => ParsecT s st m (mf [[(Blocks, RowSpan, ColSpan)]], [Alignment], [Int]) -- ^ header parser\n               -> ([Int] -> ParsecT s st m (mf [(Blocks, RowSpan, ColSpan)]))  -- ^ row parser\n               -> ParsecT s st m sep                       -- ^ line parser\n               -> ParsecT s st m end                       -- ^ footer parser\n               -> ParsecT s st m (mf Blocks)\ntableWithSpans hp rp lp fp = fmap tableFromComponents <$>\n  tableWithSpans' NoNormalization hp rp lp fp\n\ntableWithSpans' :: (Stream s m Char, UpdateSourcePos s Char,\n               HasReaderOptions st, Monad mf)\n                => TableNormalization\n                -> ParsecT s st m (mf [[(Blocks, RowSpan, ColSpan)]], [Alignment], [Int]) -- ^ header parser\n                -> ([Int] -> ParsecT s st m (mf [(Blocks, RowSpan, ColSpan)]))  -- ^ row parser\n                -> ParsecT s st m sep                       -- ^ line parser\n                -> ParsecT s st m end                       -- ^ footer parser\n                -> ParsecT s st m (mf TableComponents)\ntableWithSpans' n11n headerParser rowParser lineParser footerParser = try $ do\n  (heads, aligns, indices) <- headerParser\n  lines' <- sequence <$> rowParser indices `sepEndBy1` lineParser\n  footerParser\n  numColumns <- getOption readerColumns\n  let widths = if null indices\n               then replicate (length aligns) 0.0\n               else widthsFromIndices numColumns indices\n  return $ toTableComponentsWithSpans' n11n aligns widths <$> heads <*> lines'\n\ntoRow :: [(Blocks, RowSpan, ColSpan)] -> Row\ntoRow =  Row nullAttr . map (\\(blocks, rowSpan, columnSpan) -> B.cell AlignDefault rowSpan columnSpan blocks)\n\ntoHeaderRow :: TableNormalization -> [(Blocks, RowSpan, ColSpan)] -> Maybe Row\ntoHeaderRow = \\case\n  NoNormalization -> \\l -> if not (null l) then Just (toRow l) else Nothing\n  NormalizeHeader -> \\l -> if not (all nullHeaderRow l) then Just (toRow l) else Nothing\n  where\n    nullHeaderRow (l, _, _) = null l\n\n-- | Calculate relative widths of table columns, based on indices\nwidthsFromIndices :: Int      -- Number of columns on terminal\n                  -> [Int]    -- Indices\n                  -> [Double] -- Fractional relative sizes of columns\nwidthsFromIndices _ [] = []\nwidthsFromIndices numColumns' indices =\n  let numColumns = max numColumns' (lastDef 0 indices)\n      lengths' = zipWith (-) indices (0:indices)\n      lengths  = reverse $\n                 case reverse lengths' of\n                      []       -> []\n                      [x]      -> [x]\n                      -- compensate for the fact that intercolumn\n                      -- spaces are counted in widths of all columns\n                      -- but the last...\n                      (x:y:zs) -> if x < y && y - x <= 2\n                                     then y:y:zs\n                                     else x:y:zs\n      totLength = sum lengths\n      quotient = if totLength > numColumns\n                   then fromIntegral totLength\n                   else fromIntegral numColumns\n      fracs = map (\\l -> fromIntegral l / quotient) lengths in\n  drop 1 fracs\n\n-- | List of lists of `RowSpan` of 1.\nsingleRowSpans :: [[RowSpan]]\nsingleRowSpans = repeat $ repeat 1\n\n-- | List of lists of `ColsSpan` of 1.\nsingleColumnSpans :: [[ColSpan]]\nsingleColumnSpans = repeat $ repeat 1\n\nsingleSpansBlocks :: [[Blocks]] -> [[(Blocks, RowSpan, ColSpan)]]\nsingleSpansBlocks blocks = zipWith3 zip3 blocks singleRowSpans singleColumnSpans\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/Lists.hs",
    "content": "{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\nModule      : Text.Pandoc.Parsing.Lists\nCopyright   : © 2006-2024 John MacFarlane\nLicense     : GPL-2.0-or-later\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nParsers for list markers.\n-}\n\nmodule Text.Pandoc.Parsing.Lists\n  ( anyOrderedListMarker\n  , decimal\n  , lowerAlpha\n  , lowerRoman\n  , orderedListMarker\n  , romanNumeral\n  , upperAlpha\n  , upperRoman\n  )\nwhere\n\nimport Data.Char\n  ( isAsciiUpper\n  , isAsciiLower\n  , ord\n  , toLower\n  )\nimport Data.Maybe (fromMaybe)\nimport Text.Pandoc.Definition\n  ( ListNumberDelim(..)\n  , ListAttributes\n  , ListNumberStyle(..)\n  )\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.Sources\nimport Text.Parsec\n  ( (<|>)\n  , ParsecT\n  , Stream(..)\n  , choice\n  , getState\n  , lookAhead\n  , many\n  , many1\n  , option\n  , try\n  , updateState\n  )\nimport Text.Pandoc.Parsing.State\n\nimport qualified Data.Map as M\nimport qualified Data.Text as T\n\n-- | Parses a roman numeral (uppercase or lowercase), returns number.\nromanNumeral :: (Stream s m Char, UpdateSourcePos s Char)\n             => Bool                  -- ^ Uppercase if true\n             -> ParsecT s st m Int\nromanNumeral upperCase = do\n    let rchar uc = char $ if upperCase then uc else toLower uc\n    let one         = rchar 'I'\n    let five        = rchar 'V'\n    let ten         = rchar 'X'\n    let fifty       = rchar 'L'\n    let hundred     = rchar 'C'\n    let fivehundred = rchar 'D'\n    let thousand    = rchar 'M'\n    lookAhead $ choice [one, five, ten, fifty, hundred, fivehundred, thousand]\n    thousands <- (1000 *) . length <$> many thousand\n    ninehundreds <- option 0 $ try $ hundred >> thousand >> return 900\n    fivehundreds <- option 0 $ 500 <$ fivehundred\n    fourhundreds <- option 0 $ try $ hundred >> fivehundred >> return 400\n    hundreds <- (100 *) . length <$> many hundred\n    nineties <- option 0 $ try $ ten >> hundred >> return 90\n    fifties <- option 0 (50 <$ fifty)\n    forties <- option 0 $ try $ ten >> fifty >> return 40\n    tens <- (10 *) . length <$> many ten\n    nines <- option 0 $ try $ one >> ten >> return 9\n    fives <- option 0 (5 <$ five)\n    fours <- option 0 $ try $ one >> five >> return 4\n    ones <- length <$> many one\n    let total = thousands + ninehundreds + fivehundreds + fourhundreds +\n                hundreds + nineties + fifties + forties + tens + nines +\n                fives + fours + ones\n    if total == 0\n       then Prelude.fail \"not a roman numeral\"\n       else return total\n\n-- | Parses an uppercase roman numeral and returns (UpperRoman, number).\nupperRoman :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\nupperRoman = do\n  num <- romanNumeral True\n  return (UpperRoman, num)\n\n-- | Parses a lowercase roman numeral and returns (LowerRoman, number).\nlowerRoman :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\nlowerRoman = do\n  num <- romanNumeral False\n  return (LowerRoman, num)\n\n-- | Parses a decimal numeral and returns (Decimal, number).\ndecimal :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\ndecimal = do\n  num <- many1 digit\n  return (Decimal, fromMaybe 1 $ safeRead $ T.pack num)\n\n-- | Parses a '@' and optional label and\n-- returns (DefaultStyle, [next example number]).  The next\n-- example number is incremented in parser state, and the label\n-- (if present) is added to the label table.\nexampleNum :: (Stream s m Char, UpdateSourcePos s Char)\n           => ParsecT s ParserState m (ListNumberStyle, Int)\nexampleNum = do\n  char '@'\n  lab <- mconcat . map T.pack <$>\n                    many (many1 alphaNum <|>\n                          try (do c <- char '_' <|> char '-'\n                                  cs <- many1 alphaNum\n                                  return (c:cs)))\n  st <- getState\n  case M.lookup lab (stateExamples st) of\n    Nothing -> do -- new label\n      let num = stateNextExample st\n      let newlabels = if T.null lab\n                         then stateExamples st\n                         else M.insert lab num $ stateExamples st\n      updateState $ \\s -> s{ stateNextExample = num + 1\n                           , stateExamples    = newlabels }\n      return (Example, num)\n    Just num -> -- reuse existing label\n      return (Example, num)\n\n-- | Parses a '#' returns (DefaultStyle, 1).\ndefaultNum :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\ndefaultNum = do\n  char '#'\n  return (DefaultStyle, 1)\n\n-- | Parses a lowercase letter and returns (LowerAlpha, number).\nlowerAlpha :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\nlowerAlpha = do\n  ch <- satisfy isAsciiLower\n  return (LowerAlpha, ord ch - ord 'a' + 1)\n\n-- | Parses an uppercase letter and returns (UpperAlpha, number).\nupperAlpha :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\nupperAlpha = do\n  ch <- satisfy isAsciiUpper\n  return (UpperAlpha, ord ch - ord 'A' + 1)\n\n-- | Parses a roman numeral i or I\nromanOne :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)\nromanOne = (char 'i' >> return (LowerRoman, 1)) <|>\n           (char 'I' >> return (UpperRoman, 1))\n\n-- | Parses an ordered list marker and returns list attributes.\nanyOrderedListMarker :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s ParserState m ListAttributes\nanyOrderedListMarker = choice\n  [delimParser numParser | delimParser <- [inPeriod, inOneParen, inTwoParens],\n                           numParser <- [decimal, exampleNum, defaultNum, romanOne,\n                           lowerAlpha, lowerRoman, upperAlpha, upperRoman]]\n\n-- | Parses a list number (num) followed by a period, returns list attributes.\ninPeriod :: (Stream s m Char, UpdateSourcePos s Char)\n         => ParsecT s st m (ListNumberStyle, Int)\n         -> ParsecT s st m ListAttributes\ninPeriod num = try $ do\n  (style, start) <- num\n  char '.'\n  let delim = if style == DefaultStyle\n                 then DefaultDelim\n                 else Period\n  return (start, style, delim)\n\n-- | Parses a list number (num) followed by a paren, returns list attributes.\ninOneParen :: (Stream s m Char, UpdateSourcePos s Char)\n           => ParsecT s st m (ListNumberStyle, Int)\n           -> ParsecT s st m ListAttributes\ninOneParen num = try $ do\n  (style, start) <- num\n  char ')'\n  return (start, style, OneParen)\n\n-- | Parses a list number (num) enclosed in parens, returns list attributes.\ninTwoParens :: (Stream s m Char, UpdateSourcePos s Char)\n            => ParsecT s st m (ListNumberStyle, Int)\n            -> ParsecT s st m ListAttributes\ninTwoParens num = try $ do\n  char '('\n  (style, start) <- num\n  char ')'\n  return (start, style, TwoParens)\n\n-- | Parses an ordered list marker with a given style and delimiter,\n-- returns number.\norderedListMarker :: (Stream s m Char, UpdateSourcePos s Char)\n                  => ListNumberStyle\n                  -> ListNumberDelim\n                  -> ParsecT s ParserState m Int\norderedListMarker style delim = do\n  let num = defaultNum <|>  -- # can continue any kind of list\n            case style of\n               DefaultStyle -> decimal\n               Example      -> exampleNum\n               Decimal      -> decimal\n               UpperRoman   -> upperRoman\n               LowerRoman   -> lowerRoman\n               UpperAlpha   -> upperAlpha\n               LowerAlpha   -> lowerAlpha\n  let context = case delim of\n               DefaultDelim -> inPeriod\n               Period       -> inPeriod\n               OneParen     -> inOneParen\n               TwoParens    -> inTwoParens\n  (start, _, _) <- context num\n  return start\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/Math.hs",
    "content": "{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\nModule      : Text.Pandoc.Parsing.Math\nCopyright   : © 2006-2024 John MacFarlane\nLicense     : GPL-2.0-or-later\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nParsing of LaTeX math.\n-}\n\nmodule Text.Pandoc.Parsing.Math\n  ( mathDisplay\n  , mathInline\n  )\nwhere\n\nimport Control.Monad (mzero, when)\nimport Data.Text (Text)\nimport Text.Parsec ((<|>), ParsecT, Stream(..), notFollowedBy, many1, try)\nimport Text.Pandoc.Options\n  ( Extension(Ext_tex_math_dollars, Ext_tex_math_single_backslash,\n              Ext_tex_math_double_backslash) )\nimport Text.Pandoc.Parsing.Capabilities (HasReaderOptions, guardEnabled)\nimport Text.Pandoc.Parsing.General\nimport Text.Pandoc.Shared (trimMath)\nimport Text.Pandoc.Sources\n  (UpdateSourcePos, anyChar, char, digit, newline, satisfy, space, string)\n\nimport qualified Data.Text as T\n\nmathInlineWith :: (Stream s m Char, UpdateSourcePos s Char)  => Text -> Text -> ParsecT s st m Text\nmathInlineWith op cl = try $ do\n  textStr op\n  when (op == \"$\") $ notFollowedBy space\n  words' <- many1Till (\n                       (T.singleton <$>\n                          satisfy (\\c -> not (isSpaceChar c || c == '\\\\')))\n                   <|> (char '\\\\' >>\n                           -- This next clause is needed because \\text{..} can\n                           -- contain $, \\(\\), etc.\n                           (try (string \"text\" >>\n                                 ((\"\\\\text\" <>) <$> inBalancedBraces 0 \"\"))\n                            <|>  (\\c -> T.pack ['\\\\',c]) <$> anyChar))\n                   <|> (\"\\n\" <$ blankline <* notFollowedBy' blankline <* notFollowedBy (char '$'))\n                   <|> (T.pack <$> many1 spaceChar <* notFollowedBy (char '$'))\n                    ) (try $ textStr cl)\n  notFollowedBy digit  -- to prevent capture of $5\n  return $ trimMath $ T.concat words'\n where\n  inBalancedBraces :: (Stream s m Char, UpdateSourcePos s Char) => Int -> Text -> ParsecT s st m Text\n  inBalancedBraces n = fmap T.pack . inBalancedBraces' n . T.unpack\n\n  inBalancedBraces' :: (Stream s m Char, UpdateSourcePos s Char) => Int -> String -> ParsecT s st m String\n  inBalancedBraces' 0 \"\" = do\n    c <- anyChar\n    if c == '{'\n       then inBalancedBraces' 1 \"{\"\n       else mzero\n  inBalancedBraces' 0 s = return $ reverse s\n  inBalancedBraces' numOpen ('\\\\':xs) = do\n    c <- anyChar\n    inBalancedBraces' numOpen (c:'\\\\':xs)\n  inBalancedBraces' numOpen xs = do\n    c <- anyChar\n    case c of\n         '}' -> inBalancedBraces' (numOpen - 1) (c:xs)\n         '{' -> inBalancedBraces' (numOpen + 1) (c:xs)\n         _   -> inBalancedBraces' numOpen (c:xs)\n\nmathDisplayWith :: (Stream s m Char, UpdateSourcePos s Char) => Text -> Text -> ParsecT s st m Text\nmathDisplayWith op cl = try $ fmap T.pack $ do\n  textStr op\n  many1Till (satisfy (/= '\\n') <|> (newline <* notFollowedBy' blankline))\n            (try $ textStr cl)\n\nmathDisplay :: (HasReaderOptions st, Stream s m Char, UpdateSourcePos s Char)\n            => ParsecT s st m Text\nmathDisplay =\n      (guardEnabled Ext_tex_math_dollars >> mathDisplayWith \"$$\" \"$$\")\n  <|> (guardEnabled Ext_tex_math_single_backslash >>\n       mathDisplayWith \"\\\\[\" \"\\\\]\")\n  <|> (guardEnabled Ext_tex_math_double_backslash >>\n       mathDisplayWith \"\\\\\\\\[\" \"\\\\\\\\]\")\n\nmathInline :: (HasReaderOptions st, Stream s m Char, UpdateSourcePos s Char)\n           => ParsecT s st m Text\nmathInline =\n      (guardEnabled Ext_tex_math_dollars >> mathInlineWith \"$\" \"$\")\n  <|> (guardEnabled Ext_tex_math_single_backslash >>\n       mathInlineWith \"\\\\(\" \"\\\\)\")\n  <|> (guardEnabled Ext_tex_math_double_backslash >>\n       mathInlineWith \"\\\\\\\\(\" \"\\\\\\\\)\")\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/Smart.hs",
    "content": "{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\nModule      : Text.Pandoc.Parsing.Smart\nCopyright   : © 2006-2024 John MacFarlane\nLicense     : GPL-2.0-or-later\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nSmart parsing of quotes, dashes, and other character combinations.\n-}\n\nmodule Text.Pandoc.Parsing.Smart\n  ( apostrophe\n  , dash\n  , doubleCloseQuote\n  , doubleQuoteEnd\n  , doubleQuoteStart\n  , doubleQuoted\n  , ellipses\n  , singleQuoteEnd\n  , singleQuoteStart\n  , singleQuoted\n  , smartPunctuation\n  )\nwhere\n\nimport Control.Monad (guard , void)\nimport Text.Pandoc.Builder (Inlines)\nimport Text.Pandoc.Options\n  ( extensionEnabled\n  , Extension(Ext_old_dashes, Ext_smart)\n  , ReaderOptions(readerExtensions) )\nimport Text.Pandoc.Sources\nimport Text.Pandoc.Parsing.Capabilities\nimport Text.Pandoc.Parsing.General\nimport Text.Parsec\n  ( (<|>)\n  , Stream(..)\n  , ParsecT\n  , choice\n  , lookAhead\n  , manyTill\n  , notFollowedBy\n  , try\n  )\nimport qualified Text.Pandoc.Builder as B\n\n-- | Parses various ASCII punctuation, quotes, and apostrophe in a smart\n-- way, inferring their semantic meaning.\n--\n-- Fails unless the 'Ext_smart' extension has been enabled.\nsmartPunctuation :: (HasReaderOptions st, HasLastStrPosition st,\n                     HasQuoteContext st m,\n                     Stream s m Char, UpdateSourcePos s Char)\n                 => ParsecT s st m Inlines\n                 -> ParsecT s st m Inlines\nsmartPunctuation inlineParser = do\n  guardEnabled Ext_smart\n  choice [ quoted inlineParser, apostrophe, doubleCloseQuote, dash, ellipses ]\n\n-- | Parses inline text in single or double quotes, assumes English\n-- quoting conventions.\nquoted :: (HasLastStrPosition st, HasQuoteContext st m,\n           Stream s m Char, UpdateSourcePos s Char)\n       => ParsecT s st m Inlines\n       -> ParsecT s st m Inlines\nquoted inlineParser = doubleQuoted inlineParser <|> singleQuoted inlineParser\n\n-- | Parses inline text in single quotes, assumes English quoting\n-- conventions.\nsingleQuoted :: (HasLastStrPosition st, HasQuoteContext st m,\n                 Stream s m Char, UpdateSourcePos s Char)\n             => ParsecT s st m Inlines\n             -> ParsecT s st m Inlines\nsingleQuoted inlineParser = do\n  singleQuoteStart\n  (B.singleQuoted . mconcat <$>\n    try\n     (withQuoteContext InSingleQuote (many1Till inlineParser singleQuoteEnd)))\n   <|> pure \"\\8217\"\n\n-- | Parses inline text in double quotes; assumes English quoting\n-- conventions.\ndoubleQuoted :: (HasQuoteContext st m, HasLastStrPosition st,\n                 Stream s m Char, UpdateSourcePos s Char)\n             => ParsecT s st m Inlines\n             -> ParsecT s st m Inlines\ndoubleQuoted inlineParser = do\n  doubleQuoteStart\n  (B.doubleQuoted . mconcat <$>\n    try\n     (withQuoteContext InDoubleQuote (manyTill inlineParser doubleQuoteEnd)))\n   <|> pure (B.str \"\\8220\")\n\n-- | Succeeds if the parser is\n--\n-- * not within single quoted text;\n-- * not directly after a word; and\n-- * looking at an opening single quote char that's not followed by a\n--   space.\n--\n-- Gobbles the quote character on success.\nsingleQuoteStart :: (HasLastStrPosition st, HasQuoteContext st m,\n                     Stream s m Char, UpdateSourcePos s Char)\n                 => ParsecT s st m ()\nsingleQuoteStart = do\n  failIfInQuoteContext InSingleQuote\n  -- single quote start can't be right after str\n  guard =<< notAfterString\n  try $ do\n    char '\\''\n    void $ lookAhead (satisfy (not . isSpaceChar))\n\nsingleQuoteEnd :: (Stream s m Char, UpdateSourcePos s Char)\n               => ParsecT s st m ()\nsingleQuoteEnd = try $ do\n  char '\\''\n  notFollowedBy alphaNum\n\n-- | Succeeds if the parser is\n--\n-- * not within a double quoted text;\n--\n-- * not directly after a word; and\n--\n-- * looking at an opening double quote char that's not followed by a\n--   space.\n--\n-- Gobbles the quote character on success.\ndoubleQuoteStart :: (HasLastStrPosition st,\n                     HasQuoteContext st m,\n                     Stream s m Char, UpdateSourcePos s Char)\n                 => ParsecT s st m ()\ndoubleQuoteStart = do\n  failIfInQuoteContext InDoubleQuote\n  guard =<< notAfterString\n  try $ do char '\"'\n           void $ lookAhead (satisfy (not . isSpaceChar))\n\n-- | Parses a closing quote character.\ndoubleQuoteEnd :: (Stream s m Char, UpdateSourcePos s Char)\n               => ParsecT s st m ()\ndoubleQuoteEnd = void (char '\"')\n\n-- | Parses an ASCII apostrophe (@'@) or right single quotation mark and\n-- returns a RIGHT SINGLE QUOtatiON MARK character.\napostrophe :: (Stream s m Char, UpdateSourcePos s Char)\n           => ParsecT s st m Inlines\napostrophe = (char '\\'' <|> char '\\8217') >> return (B.str \"\\8217\")\n\n-- | Parses an ASCII quotation mark character and returns a RIGHT DOUBLE\n-- QUOTATION MARK.\ndoubleCloseQuote :: (Stream s m Char, UpdateSourcePos s Char)\n                 => ParsecT s st m Inlines\ndoubleCloseQuote = B.str \"\\8221\" <$ char '\"'\n\n-- | Parses three dots as HORIZONTAL ELLIPSIS.\nellipses :: (Stream s m Char, UpdateSourcePos s Char)\n         => ParsecT s st m Inlines\nellipses = try (string \"...\" >> return (B.str \"\\8230\"))\n\n-- | Parses two hyphens as EN DASH and three as EM DASH.\n--\n-- If the extension @'Ext_old_dashes'@ is enabled, then two hyphens are\n-- parsed as EM DASH, and one hyphen is parsed as EN DASH if it is\n-- followed by a digit.\ndash :: (HasReaderOptions st, Stream s m Char, UpdateSourcePos s Char)\n     => ParsecT s st m Inlines\ndash = try $ do\n  oldDashes <- extensionEnabled Ext_old_dashes <$> getOption readerExtensions\n  if oldDashes\n     then do\n       char '-'\n       (char '-' >> return (B.str \"\\8212\"))\n         <|> (lookAhead digit >> return (B.str \"\\8211\"))\n     else do\n       string \"--\"\n       (char '-' >> return (B.str \"\\8212\"))\n         <|> return (B.str \"\\8211\")\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing/State.hs",
    "content": "{-# LANGUAGE FlexibleInstances          #-}\n{-# LANGUAGE MultiParamTypeClasses      #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\n   Module      : Text.Pandoc.Parsing\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n\nA default parser state with commonly used properties.\n-}\n\nmodule Text.Pandoc.Parsing.State\n  ( ParserState (..)\n  , ParserContext (..)\n  , HeaderType (..)\n  , NoteTable\n  , NoteTable'\n  , Key (..)\n  , KeyTable\n  , SubstTable\n  , defaultParserState\n  , toKey\n  )\nwhere\n\nimport Data.Default (Default (def))\nimport Data.Text (Text)\nimport Text.Parsec (SourcePos, getState, setState)\nimport Text.Pandoc.Builder (Blocks, HasMeta (..), Inlines)\nimport Text.Pandoc.Definition (Attr, Meta, Target, nullMeta)\nimport Text.Pandoc.Logging (LogMessage)\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Parsing.Capabilities\nimport Text.Pandoc.Parsing.Future\nimport Text.Pandoc.TeX (Macro)\n\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\n\n-- | Parsing options.\ndata ParserState = ParserState\n  { stateOptions         :: ReaderOptions -- ^ User options\n  , stateParserContext   :: ParserContext -- ^ Inside list?\n  , stateQuoteContext    :: QuoteContext  -- ^ Inside quoted environment?\n  , stateAllowLinks      :: Bool          -- ^ Allow parsing of links\n  , stateAllowLineBreaks :: Bool          -- ^ Allow parsing of line breaks\n  , stateLastStrPos      :: Maybe SourcePos -- ^ Position after last str parsed\n  , stateKeys            :: KeyTable      -- ^ List of reference keys\n  , stateHeaderKeys      :: KeyTable      -- ^ List of implicit header ref keys\n  , stateSubstitutions   :: SubstTable    -- ^ List of substitution references\n  , stateNotes           :: NoteTable     -- ^ List of notes (raw bodies)\n  , stateNotes'          :: NoteTable'    -- ^ List of notes (parsed bodies)\n  , stateNoteRefs        :: Set.Set Text  -- ^ List of note references used\n  , stateInNote          :: Bool          -- ^ True if parsing note contents\n  , stateNoteNumber      :: Int           -- ^ Last note number for citations\n  , stateMeta            :: Meta          -- ^ Document metadata\n  , stateMeta'           :: Future ParserState Meta -- ^ Document metadata\n  , stateCitations       :: M.Map Text Text -- ^ RST-style citations\n  , stateHeaderTable     :: [HeaderType]  -- ^ Ordered list of header types used\n  , stateIdentifiers     :: Set.Set Text  -- ^ Header identifiers used\n  , stateNextExample     :: Int           -- ^ Number of next example\n  , stateExamples        :: M.Map Text Int -- ^ Map from example labels to numbers\n  , stateMacros          :: M.Map Text Macro -- ^ Table of macros defined so far\n  , stateRstDefaultRole  :: Text          -- ^ Current rST default\n                                           -- interpreted text role\n  , stateRstHighlight    :: Maybe Text    -- ^ Current rST literal block\n                                           -- language\n  , stateRstCustomRoles  :: M.Map Text (Text, Maybe Text, Attr)\n    -- ^ Current rST cust text roles;\n    -- Triple represents:) Base role 2) Optional format (only for :raw:\n    -- roles) 3) Addition classes (rest of Attr is unused)).\n  , stateCaption         :: Maybe Inlines -- ^ Caption in current environment\n  , stateInHtmlBlock     :: Maybe Text    -- ^ Tag type of HTML block being parsed\n  , stateFencedDivLevel  :: Int           -- ^ Depth of fenced div\n  , stateContainers      :: [Text]        -- ^ parent include files\n  , stateLogMessages     :: [LogMessage]  -- ^ log messages\n  , stateMarkdownAttribute :: Bool        -- ^ True if in markdown=1 context\n  }\n\ninstance Default ParserState where\n  def = defaultParserState\n\ninstance HasMeta ParserState where\n  setMeta field val st =\n    st{ stateMeta = setMeta field val $ stateMeta st }\n  deleteMeta field st =\n    st{ stateMeta = deleteMeta field $ stateMeta st }\n\ninstance HasReaderOptions ParserState where\n  extractReaderOptions = stateOptions\n\ninstance Monad m => HasQuoteContext ParserState m where\n  getQuoteContext = stateQuoteContext <$> getState\n  withQuoteContext context parser = do\n    oldState <- getState\n    let oldQuoteContext = stateQuoteContext oldState\n    setState oldState { stateQuoteContext = context }\n    result <- parser\n    newState <- getState\n    setState newState { stateQuoteContext = oldQuoteContext }\n    return result\n\ninstance HasIdentifierList ParserState where\n  extractIdentifierList     = stateIdentifiers\n  updateIdentifierList f st = st{ stateIdentifiers = f $ stateIdentifiers st }\n\ninstance HasMacros ParserState where\n  extractMacros        = stateMacros\n  updateMacros f st    = st{ stateMacros = f $ stateMacros st }\n\ninstance HasLastStrPosition ParserState where\n  setLastStrPos pos st = st{ stateLastStrPos = pos }\n  getLastStrPos st     = stateLastStrPos st\n\ninstance HasLogMessages ParserState where\n  addLogMessage msg st = st{ stateLogMessages = msg : stateLogMessages st }\n  getLogMessages st = reverse $ stateLogMessages st\n\ninstance HasIncludeFiles ParserState where\n  getIncludeFiles = stateContainers\n  addIncludeFile f s = s{ stateContainers = f : stateContainers s }\n  dropLatestIncludeFile s = s { stateContainers = drop 1 $ stateContainers s }\n\ndata ParserContext\n    = ListItemState   -- ^ Used when running parser on list item contents\n    | NullState       -- ^ Default state\n    deriving (Eq, Show)\n\ndata HeaderType\n    = SingleHeader Char  -- ^ Single line of characters underneath\n    | DoubleHeader Char  -- ^ Lines of characters above and below\n    deriving (Eq, Show)\n\ndefaultParserState :: ParserState\ndefaultParserState = ParserState\n  { stateOptions         = def\n  , stateParserContext   = NullState\n  , stateQuoteContext    = NoQuote\n  , stateAllowLinks      = True\n  , stateAllowLineBreaks = True\n  , stateLastStrPos      = Nothing\n  , stateKeys            = M.empty\n  , stateHeaderKeys      = M.empty\n  , stateSubstitutions   = M.empty\n  , stateNotes           = []\n  , stateNotes'          = M.empty\n  , stateNoteRefs        = Set.empty\n  , stateInNote          = False\n  , stateNoteNumber      = 0\n  , stateMeta            = nullMeta\n  , stateMeta'           = return nullMeta\n  , stateCitations       = M.empty\n  , stateHeaderTable     = []\n  , stateIdentifiers     = Set.empty\n  , stateNextExample     = 1\n  , stateExamples        = M.empty\n  , stateMacros          = M.empty\n  , stateRstDefaultRole  = \"title-reference\"\n  , stateRstHighlight    = Nothing\n  , stateRstCustomRoles  = M.empty\n  , stateCaption         = Nothing\n  , stateInHtmlBlock     = Nothing\n  , stateFencedDivLevel  = 0\n  , stateContainers      = []\n  , stateLogMessages     = []\n  , stateMarkdownAttribute = False\n  }\n\ntype NoteTable = [(Text, Text)]\n\ntype NoteTable' = M.Map Text (SourcePos, Future ParserState Blocks)\n-- used in markdown reader\n\nnewtype Key = Key Text deriving (Show, Read, Eq, Ord)\n\ntoKey :: Text -> Key\ntoKey = Key . T.toLower . T.unwords . T.words . unbracket\n  where unbracket t\n          | Just ('[', t') <- T.uncons t\n          , Just (t'', ']') <- T.unsnoc t'\n          = t''\n          | otherwise\n          = t\n\ntype KeyTable = M.Map Key (Target, Attr)\n\ntype SubstTable = M.Map Key Blocks\n"
  },
  {
    "path": "src/Text/Pandoc/Parsing.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Parsing\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nA utility library with parsers used in pandoc readers.\n-}\n\nmodule Text.Pandoc.Parsing ( module Text.Pandoc.Sources,\n                             countChar,\n                             textStr,\n                             anyLine,\n                             anyLineNewline,\n                             indentWith,\n                             manyChar,\n                             many1Char,\n                             manyTillChar,\n                             many1TillChar,\n                             many1Till,\n                             manyUntil,\n                             manyUntilChar,\n                             sepBy1',\n                             notFollowedBy',\n                             oneOfStrings,\n                             oneOfStringsCI,\n                             spaceChar,\n                             nonspaceChar,\n                             skipSpaces,\n                             blankline,\n                             blanklines,\n                             gobbleSpaces,\n                             gobbleAtMostSpaces,\n                             enclosed,\n                             stringAnyCase,\n                             parseFromString,\n                             parseFromString',\n                             lineClump,\n                             charsInBalanced,\n                             romanNumeral,\n                             emailAddress,\n                             uri,\n                             mathInline,\n                             mathDisplay,\n                             withHorizDisplacement,\n                             withRaw,\n                             fromParsecError,\n                             escaped,\n                             characterReference,\n                             upperRoman,\n                             lowerRoman,\n                             decimal,\n                             lowerAlpha,\n                             upperAlpha,\n                             anyOrderedListMarker,\n                             orderedListMarker,\n                             charRef,\n                             lineBlockLines,\n                             tableWith,\n                             tableWith',\n                             tableWithSpans,\n                             tableWithSpans',\n                             widthsFromIndices,\n                             gridTableWith,\n                             gridTableWith',\n                             TableComponents (..),\n                             TableNormalization (..),\n                             toTableComponents,\n                             toTableComponents',\n                             toTableComponentsWithSpans,\n                             toTableComponentsWithSpans',\n                             singleRowSpans,\n                             singleColumnSpans,\n                             readWith,\n                             readWithM,\n                             testStringWith,\n                             guardEnabled,\n                             guardDisabled,\n                             updateLastStrPos,\n                             notAfterString,\n                             logMessage,\n                             reportLogMessages,\n                             ParserState (..),\n                             HasReaderOptions (..),\n                             HasIdentifierList (..),\n                             HasMacros (..),\n                             HasLogMessages (..),\n                             HasLastStrPosition (..),\n                             HasIncludeFiles (..),\n                             defaultParserState,\n                             HeaderType (..),\n                             ParserContext (..),\n                             QuoteContext (..),\n                             HasQuoteContext (..),\n                             NoteTable,\n                             NoteTable',\n                             KeyTable,\n                             SubstTable,\n                             Key (..),\n                             toKey,\n                             registerHeader,\n                             smartPunctuation,\n                             singleQuoteStart,\n                             singleQuoteEnd,\n                             doubleQuoteStart,\n                             doubleQuoteEnd,\n                             apostrophe,\n                             doubleCloseQuote,\n                             ellipses,\n                             dash,\n                             citeKey,\n                             Parsec,\n                             ParsecT,\n                             Future(..),\n                             runF,\n                             askF,\n                             asksF,\n                             returnF,\n                             trimInlinesF,\n                             token,\n                             (<+?>),\n                             extractIdClass,\n                             insertIncludedFile,\n                             -- * Re-exports from Text.Parsec\n                             Stream(..),\n                             runParser,\n                             runParserT,\n                             parse,\n                             tokenPrim,\n                             anyToken,\n                             getInput,\n                             setInput,\n                             unexpected,\n                             skipMany,\n                             skipMany1,\n                             count,\n                             eof,\n                             lookAhead,\n                             notFollowedBy,\n                             many,\n                             many1,\n                             manyTill,\n                             (<|>),\n                             (<?>),\n                             choice,\n                             try,\n                             sepBy,\n                             sepBy1,\n                             sepEndBy,\n                             sepEndBy1,\n                             endBy,\n                             endBy1,\n                             option,\n                             optional,\n                             optionMaybe,\n                             getState,\n                             setState,\n                             updateState,\n                             SourcePos,\n                             SourceName,\n                             updatePosString,\n                             getPosition,\n                             setPosition,\n                             sourceName,\n                             setSourceName,\n                             sourceColumn,\n                             sourceLine,\n                             setSourceColumn,\n                             setSourceLine,\n                             incSourceColumn,\n                             incSourceLine,\n                             newPos,\n                             initialPos,\n                             Line,\n                             Column,\n                             ParseError,\n                             errorMessages,\n                             messageString\n                             )\nwhere\n\nimport Text.Pandoc.Sources\nimport Text.Parsec\n    ( Parsec,\n      ParsecT,\n      SourcePos,\n      SourceName,\n      setSourceName,\n      Column,\n      Line,\n      incSourceLine,\n      incSourceColumn,\n      setSourceLine,\n      setSourceColumn,\n      sourceLine,\n      sourceColumn,\n      sourceName,\n      setSourceName,\n      setPosition,\n      getPosition,\n      updateState,\n      setState,\n      getState,\n      optionMaybe,\n      optional,\n      option,\n      endBy1,\n      endBy,\n      sepEndBy1,\n      sepEndBy,\n      sepBy1,\n      sepBy,\n      try,\n      choice,\n      (<?>),\n      (<|>),\n      manyTill,\n      many1,\n      many,\n      notFollowedBy,\n      lookAhead,\n      eof,\n      count,\n      skipMany1,\n      skipMany,\n      unexpected,\n      setInput,\n      getInput,\n      anyToken,\n      tokenPrim,\n      parse,\n      runParserT,\n      runParser,\n      ParseError,\n      Stream(..) )\nimport Text.Parsec.Error (\n      errorMessages,\n      messageString )\nimport Text.Parsec.Pos (initialPos, newPos, updatePosString)\nimport Text.Pandoc.Parsing.Capabilities\n    ( guardDisabled,\n      guardEnabled,\n      logMessage,\n      notAfterString,\n      reportLogMessages,\n      updateLastStrPos,\n      HasIdentifierList(..),\n      HasIncludeFiles(..),\n      HasLastStrPosition(..),\n      HasLogMessages(..),\n      HasMacros(..),\n      HasQuoteContext(..),\n      HasReaderOptions(..),\n      QuoteContext(..) )\nimport Text.Pandoc.Parsing.Citations ( citeKey )\nimport Text.Pandoc.Parsing.General\n    ( readWithM,\n      (<+?>),\n      anyLine,\n      anyLineNewline,\n      blankline,\n      blanklines,\n      charRef,\n      characterReference,\n      charsInBalanced,\n      countChar,\n      emailAddress,\n      enclosed,\n      escaped,\n      extractIdClass,\n      gobbleAtMostSpaces,\n      gobbleSpaces,\n      indentWith,\n      insertIncludedFile,\n      lineBlockLines,\n      lineClump,\n      many1Char,\n      many1Till,\n      many1TillChar,\n      manyChar,\n      manyTillChar,\n      manyUntil,\n      manyUntilChar,\n      nonspaceChar,\n      notFollowedBy',\n      oneOfStrings,\n      oneOfStringsCI,\n      parseFromString,\n      parseFromString',\n      readWith,\n      registerHeader,\n      sepBy1',\n      skipSpaces,\n      spaceChar,\n      stringAnyCase,\n      testStringWith,\n      textStr,\n      token,\n      trimInlinesF,\n      uri,\n      withHorizDisplacement,\n      withRaw,\n      fromParsecError )\nimport Text.Pandoc.Parsing.GridTable\n    ( gridTableWith,\n      gridTableWith',\n      tableWith,\n      tableWith',\n      tableWithSpans,\n      tableWithSpans',\n      toTableComponents,\n      toTableComponents',\n      toTableComponentsWithSpans,\n      toTableComponentsWithSpans',\n      singleRowSpans,\n      singleColumnSpans,\n      widthsFromIndices,\n      TableComponents(..),\n      TableNormalization(..) )\nimport Text.Pandoc.Parsing.Lists\n    ( anyOrderedListMarker,\n      decimal,\n      lowerAlpha,\n      lowerRoman,\n      orderedListMarker,\n      romanNumeral,\n      upperAlpha,\n      upperRoman )\nimport Text.Pandoc.Parsing.Math ( mathDisplay, mathInline )\nimport Text.Pandoc.Parsing.Smart\n    ( apostrophe,\n      dash,\n      doubleCloseQuote,\n      doubleQuoteEnd,\n      doubleQuoteStart,\n      ellipses,\n      singleQuoteEnd,\n      singleQuoteStart,\n      smartPunctuation )\nimport Text.Pandoc.Parsing.State\n    ( defaultParserState,\n      toKey,\n      HeaderType(..),\n      Key(..),\n      KeyTable,\n      NoteTable,\n      NoteTable',\n      ParserContext(..),\n      ParserState(..),\n      SubstTable )\nimport Text.Pandoc.Parsing.Future\n    ( askF, asksF, returnF, runF, Future(..) )\n"
  },
  {
    "path": "src/Text/Pandoc/Process.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Process\n   Copyright   : Copyright (C) 2013-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nByteString variant of 'readProcessWithExitCode'.\n-}\nmodule Text.Pandoc.Process (pipeProcess)\nwhere\nimport Control.Concurrent (MVar, forkIO, killThread, newEmptyMVar, putMVar,\n                           takeMVar)\nimport Control.Exception (SomeException (..))\nimport qualified Control.Exception as E\nimport Control.Monad (unless)\nimport Control.DeepSeq (rnf)\nimport qualified Data.ByteString.Lazy as BL\nimport Foreign.C (Errno (Errno), ePIPE)\nimport GHC.IO.Exception (IOErrorType(..), IOException(..))\nimport System.Exit (ExitCode (..))\nimport System.IO (hClose)\nimport System.Process\n\n{- |\nVersion of 'System.Process.readProcessWithExitCode' that uses lazy bytestrings\ninstead of strings and allows setting environment variables.\n\n@readProcessWithExitCode@ creates an external process, reads its\nstandard output strictly, waits until the process\nterminates, and then returns the 'ExitCode' of the process\nand the standard output.  stderr is inherited from the parent.\n\nIf an asynchronous exception is thrown to the thread executing\n@readProcessWithExitCode@, the forked process will be terminated and\n@readProcessWithExitCode@ will wait (block) until the process has been\nterminated.\n\nThis function was adapted from @readProcessWithExitCode@ of module\nSystem.Process, package process-1.6.3.0. The original code is BSD\nlicensed and © University of Glasgow 2004-2008.\n-}\npipeProcess\n    :: Maybe [(String, String)] -- ^ environment variables\n    -> FilePath                 -- ^ Filename of the executable (see 'proc' for details)\n    -> [String]                 -- ^ any arguments\n    -> BL.ByteString            -- ^ standard input\n    -> IO (ExitCode,BL.ByteString) -- ^ exitcode, stdout\npipeProcess mbenv cmd args input = do\n    let cp_opts = (proc cmd args)\n                  { env     = mbenv\n                  , std_in  = CreatePipe\n                  , std_out = CreatePipe\n                  , std_err = Inherit\n                  }\n    withCreateProcess cp_opts $\n      \\mbInh mbOuth _ pid -> do\n        let (inh, outh) =\n             case (mbInh, mbOuth) of\n                  (Just i, Just o) -> (i, o)\n                  (Nothing, _)     -> error \"withCreateProcess no inh\"\n                  (_, Nothing)     -> error \"withCreateProcess no outh\"\n\n        out <- BL.hGetContents outh\n\n        -- fork off threads to start consuming stdout & stderr\n        withForkWait (E.evaluate $ rnf out) $ \\waitOut -> do\n\n          -- now write any input\n          unless (BL.null input) $\n            ignoreSigPipe $ BL.hPutStr inh input\n          -- hClose performs implicit hFlush, and thus may trigger a SIGPIPE\n          ignoreSigPipe $ hClose inh\n\n          -- wait on the output\n          waitOut\n\n          hClose outh\n\n        -- wait on the process\n        ex <- waitForProcess pid\n\n        return (ex, out)\n\n-- | Fork a thread while doing something else, but kill it if there's an\n-- exception.\n--\n-- This is important in the cases above because we want to kill the thread\n-- that is holding the Handle lock, because when we clean up the process we\n-- try to close that handle, which could otherwise deadlock.\n--\n-- This function was copied verbatim from module System.Process of package\n-- process-1.6.3.0.\nwithForkWait :: IO () -> (IO () ->  IO a) -> IO a\nwithForkWait async body = do\n  waitVar <- newEmptyMVar :: IO (MVar (Either SomeException ()))\n  E.mask $ \\restore -> do\n    tid <- forkIO $ E.try (restore async) >>= putMVar waitVar\n    let wait = takeMVar waitVar >>= either E.throwIO return\n    restore (body wait) `E.onException` killThread tid\n\n-- This function was copied verbatim from module System.Process of package\n-- process-1.6.3.0.\nignoreSigPipe :: IO () -> IO ()\nignoreSigPipe = E.handle $ \\e ->\n  case e of\n    IOError { ioe_type  = ResourceVanished\n            , ioe_errno = Just ioe }\n      | Errno ioe == ePIPE -> return ()\n    _ -> E.throwIO e\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/AsciiDoc.hs",
    "content": "{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE FlexibleContexts #-}\n\n{- |\n   Module      : Text.Pandoc.Readers.AsciiDoc\n   Copyright   : Copyright (C) 2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nReads and evaluates a AsciiDoc document as a Pandoc AST.\n-}\nmodule Text.Pandoc.Readers.AsciiDoc\n  ( readAsciiDoc\n  )\nwhere\n\nimport Text.Pandoc.Class\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Shared (addPandocAttributes, blocksToInlines, safeRead,\n                           tshow)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified AsciiDoc as A\nimport Text.Pandoc.Error\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Readers.HTML (readHtml)\nimport Control.Monad.Except (throwError)\nimport Control.Monad\nimport Text.Pandoc.Parsing (newPos, sourceName)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Sources\nimport Control.Monad.State\nimport qualified Data.List as L\nimport Data.Char (chr, ord)\nimport qualified Data.Text as T\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe)\n\n-- import Debug.Trace\n\n-- | Read AsciiDoc from an input string and return a Pandoc document.\nreadAsciiDoc :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc\nreadAsciiDoc _opts inp = do\n  let Sources sources = toSources inp\n  (mconcat <$> mapM\n   (\\(sourcepos, t) ->\n     A.parseDocument getIncludeFile raiseError (sourceName sourcepos) t)\n    sources)\n   >>= resolveFootnotes\n   >>= resolveStem\n   >>= resolveIcons\n   >>= toPandoc\n where\n  getIncludeFile fp = UTF8.toText <$> readFileStrict fp\n  raiseError fp pos msg = throwError $ PandocParseError $ T.pack\n                            $ msg <> \" at \" <> show fp <>\n                              \" char \" <> show pos\n\ntoPandoc :: PandocMonad m => A.Document -> m Pandoc\ntoPandoc doc =\n  Pandoc <$> doMeta (A.docMeta doc)\n         <*> (B.toList <$> doBlocks (A.docBlocks doc))\n\nresolveFootnotes :: Monad m => A.Document -> m A.Document\nresolveFootnotes doc = do\n  evalStateT (A.mapInlines go doc) (mempty :: M.Map T.Text [A.Inline])\n where\n   go (A.Inline attr (A.Footnote (Just (A.FootnoteId fnid)) ils)) = do\n     fnmap <- get\n     case M.lookup fnid fnmap of\n       Just ils' ->\n         pure $ A.Inline attr (A.Footnote (Just (A.FootnoteId fnid)) ils')\n       Nothing -> do\n         put $ M.insert fnid ils fnmap\n         pure $ A.Inline attr (A.Footnote (Just (A.FootnoteId fnid)) ils)\n   go x = pure x\n\nresolveStem :: Monad m => A.Document -> m A.Document\nresolveStem doc = do\n  let defaultType = case M.lookup \"stem\" (A.docAttributes (A.docMeta doc)) of\n                      Just \"asciimath\" -> A.AsciiMath\n                      _ -> A.LaTeXMath\n  let doInlineStem (A.Inline attr (A.Math Nothing t)) =\n        pure $ A.Inline attr (A.Math (Just defaultType) t)\n      doInlineStem x = pure x\n  let doBlockStem (A.Block attr mbtit (A.MathBlock Nothing t)) =\n        pure $ A.Block attr mbtit (A.MathBlock (Just defaultType) t)\n      doBlockStem x = A.mapInlines doInlineStem x\n  A.mapBlocks doBlockStem doc\n\n-- resolve icons as either characters in an icon font or images\nresolveIcons :: Monad m => A.Document -> m A.Document\nresolveIcons doc = A.mapInlines fromIcon doc\n where\n   docattrs = A.docAttributes (A.docMeta doc)\n   iconFont = case M.lookup \"icons\" docattrs of\n                Just \"font\" -> True\n                _ -> False\n   iconsdir = fromMaybe \"./images/icons\" $ M.lookup \"iconsdir\" docattrs\n   icontype = fromMaybe \"png\" $ M.lookup \"icontype\" docattrs\n   addClasses cls (A.Attr ps kvs) =\n     A.Attr ps $\n      case M.lookup \"role\" kvs of\n       Just r -> M.insert \"role\" (T.unwords (r : cls)) kvs\n       Nothing -> M.insert \"role\" (T.unwords cls) kvs\n   fromIcon (A.Inline attr (A.Icon name)) =\n     if iconFont\n        then pure $\n              A.Inline (addClasses [\"fa\", \"fa-\" <> name] attr) (A.Span [])\n        else pure $ -- default is to use an image\n              A.Inline (addClasses [\"icon\"] attr)\n                 (A.InlineImage\n                   (A.Target\n                      (iconsdir <> \"/\" <> name <> \".\" <> icontype))\n                      Nothing Nothing Nothing)\n   fromIcon x = pure x\n\naddAttribution :: Maybe A.Attribution -> B.Blocks -> B.Blocks\naddAttribution Nothing bs = bs\naddAttribution (Just (A.Attribution t)) bs = B.fromList $\n  case B.toList bs of\n    [B.Div attr bls] -> [B.Div attr (bls ++ [attrBlock])]\n    [B.BlockQuote bls] -> [B.BlockQuote (bls ++ [attrBlock])]\n    xs -> xs ++ [attrBlock]\n where\n   attrBlock = Para (B.toList $ B.text $ \"\\x2014 \" <> t)\n\ndoMeta :: PandocMonad m => A.Meta -> m B.Meta\ndoMeta meta = do\n  tit' <- doInlines (A.docTitle meta)\n  pure $\n    (if tit' == mempty\n        then id\n        else B.setMeta \"title\" tit') .\n    (case A.docAuthors meta of\n       [] -> id\n       as -> B.setMeta \"author\" (map fromAuthor as)) .\n    (case A.docRevision meta of\n       Nothing -> id\n       Just (A.Revision vers mbdate mbremark) ->\n         B.setMeta \"version\" vers .\n         maybe id (B.setMeta \"date\") mbdate .\n         maybe id (B.setMeta \"remark\") mbremark) .\n    flip (L.foldl' (\\m (k,v) ->\n                    -- leave out flags that are set just for processing\n                    if k == \"sectids\" || k == \"stem\"\n                       then m\n                       else if T.null v\n                               then B.setMeta k True m\n                               else B.setMeta k v m))\n      (M.toList (A.docAttributes meta))\n    $ mempty\n\nfromAuthor :: A.Author -> B.Inlines\nfromAuthor au = B.text (A.authorName au) <>\n  maybe mempty (\\email ->\n    \" (\" <> B.link (\"mailto:\" <> email) \"\" (B.str email) <> \")\")\n    (A.authorEmail au)\n\ndoBlocks :: PandocMonad m => [A.Block] -> m B.Blocks\ndoBlocks = fmap mconcat . mapM doBlock\n\naddBlockAttr :: A.Attr -> B.Blocks -> B.Blocks\naddBlockAttr (A.Attr _ kvs') bs =\n  case B.toList bs of\n    x@(B.OrderedList{}) : xs -> -- \"start\" is handled in list attribs\n      addPandocAttributes (M.toList $ M.delete \"start\" kvs)\n             (B.singleton x) <> B.fromList xs\n    x:xs -> addPandocAttributes (M.toList kvs) (B.singleton x)\n                <> B.fromList xs\n    [] -> mempty\n where\n  kvs = M.mapKeys (\\k -> if k == \"role\" then \"class\" else k) kvs'\n\naddBlockTitle :: B.Inlines -> B.Blocks -> B.Blocks\naddBlockTitle tit' bs =\n  let tit = B.toList tit'\n  in case B.toList bs of\n    [B.Table attr _ colspecs thead tbody tfoot] ->\n      B.singleton $ B.Table attr (B.Caption Nothing [B.Plain tit])\n                     colspecs thead tbody tfoot\n    [B.Figure attr _ bs'] ->\n      B.singleton $ B.Figure attr (B.Caption Nothing [B.Plain tit]) bs'\n    [B.Div attr (B.Div (\"\",[\"title\"],[]) [Para _] : bs')] ->\n      -- replace existing title, which might be e.g. \"Note\"\n      B.singleton $ B.Div attr (B.Div (\"\",[\"title\"],[]) [B.Para tit] : bs')\n    [B.Div attr bs'] -> -- put title Div inside\n      B.singleton $ B.Div attr (B.Div (\"\",[\"title\"],[]) [B.Para tit] : bs')\n    _ -> B.divWith B.nullAttr (B.divWith (\"\",[\"title\"],[]) (B.para tit') <> bs)\n\ndoBlock :: PandocMonad m => A.Block -> m B.Blocks\ndoBlock (A.Block attr@(A.Attr ps kvs) mbtitle bt) = do\n  mbtitle' <- case mbtitle of\n                Nothing -> pure Nothing\n                Just (A.BlockTitle ils) -> Just <$> doInlines ils\n  addBlockAttr attr . maybe id addBlockTitle mbtitle' <$>\n   case bt of\n    A.Section (A.Level lev) ils bs -> do\n      ils' <- doInlines ils\n      bs' <- doBlocks bs\n      pure $ (B.header lev ils') <> bs'\n    A.DiscreteHeading (A.Level lev) ils ->\n      B.header lev <$> doInlines ils\n    A.Paragraph ils -> B.para <$> doInlines ils\n    A.LiteralBlock t -> pure $ B.codeBlock t\n    A.Listing mblang lns -> do\n      let fromCallout (A.Callout i)\n            | i <= 20 = T.pack [' ', chr (0x2460 + i - 1)]\n            | otherwise = \"<\" <> tshow i <> \">\"\n      let fromSourceLine (A.SourceLine t callouts) =\n            t <> mconcat (map fromCallout callouts)\n      let code = T.intercalate \"\\n\" $ map fromSourceLine lns\n      let classes = case mblang of\n                      Nothing -> []\n                      Just (A.Language l) -> [l]\n      pure $ B.codeBlockWith (\"\", classes, []) code\n    A.IncludeListing _ _ Nothing -> pure mempty\n    A.IncludeListing mblang _fp (Just lns) ->\n      doBlock (A.Block mempty mbtitle (A.Listing mblang lns))\n    A.ExampleBlock bs -> B.divWith (\"\",[\"example\"],[]) <$> doBlocks bs\n    A.Sidebar bs -> B.divWith (\"\",[\"sidebar\"],[]) <$> doBlocks bs\n    A.OpenBlock bs -> B.divWith (\"\",[],[]) <$> doBlocks bs\n    A.QuoteBlock mbattrib bs ->\n      addAttribution mbattrib . B.blockQuote <$> doBlocks bs\n    A.Verse mbattrib bs ->\n      addAttribution mbattrib . B.blockQuote <$> doBlocks bs\n    -- TODO when texmath's asciimath parser works, convert:\n    A.MathBlock (Just A.AsciiMath) t -> pure $ B.para $ B.displayMath t\n    A.MathBlock (Just A.LaTeXMath) t -> pure $ B.para $ B.displayMath t\n    A.MathBlock Nothing _ ->\n      throwError $ PandocParseError \"Encountered math type Nothing\"\n    A.List (A.BulletList _) items ->\n      B.bulletList <$> mapM doItem items\n    A.List A.CheckList items ->\n      B.bulletList <$> mapM doItem items\n    A.List (A.OrderedList _ mbstart) items -> do\n      let start = fromMaybe (1 :: Int)\n                    (mbstart `mplus` (M.lookup \"start\" kvs >>= safeRead))\n      let getStyle xs = case xs of\n                  \"arabic\":_ -> Decimal\n                  \"decimal\":_ -> Decimal\n                  \"loweralpha\":_ -> LowerAlpha\n                  \"upperalpha\":_ -> UpperAlpha\n                  \"lowerroman\":_ -> LowerRoman\n                  \"upperroman\":_ -> UpperRoman\n                  _:rest -> getStyle rest\n                  [] -> DefaultStyle\n      let sty = getStyle ps\n      let delim = DefaultDelim\n      B.orderedListWith (start, sty, delim) <$> mapM doItem items\n    A.List A.CalloutList items ->\n      B.divWith (\"\",[\"callout-list\"],[]) . B.orderedList <$> mapM doItem items\n    A.DefinitionList items\n      | \"ordered\" `elem` ps ->\n          B.orderedList <$>\n             mapM (fmap (B.definitionList . (:[])) . doDefListItem) items\n      | otherwise -> B.definitionList <$> mapM doDefListItem items\n    A.Table specs mbHeader rows mbFooter -> do\n      let toAlign A.AlignLeft = B.AlignLeft\n          toAlign A.AlignCenter = B.AlignCenter\n          toAlign A.AlignRight = B.AlignRight\n      let fromCell (A.TableCell bs mbHorizAlign _mbVertAlign colspan rowspan) =\n            B.Cell B.nullAttr (maybe B.AlignDefault toAlign mbHorizAlign)\n                        (B.RowSpan rowspan) (B.ColSpan colspan) . B.toList\n                   <$> doBlocks bs\n      let fromRow (A.TableRow cs) = B.Row B.nullAttr <$> mapM fromCell cs\n      tbody <- B.TableBody B.nullAttr (B.RowHeadColumns 0) [] <$> mapM fromRow rows\n      thead <- B.TableHead B.nullAttr <$> maybe (pure []) (mapM fromRow) mbHeader\n      tfoot <- B.TableFoot B.nullAttr <$> maybe (pure []) (mapM fromRow) mbFooter\n      let totalWidth = sum $ map (fromMaybe 1 . A.colWidth) specs\n      let toColSpec spec = (maybe B.AlignDefault toAlign (A.colHorizAlign spec),\n                             maybe B.ColWidthDefault\n                               (B.ColWidth . (\\x ->\n                                   fromIntegral x / fromIntegral totalWidth))\n                               (A.colWidth spec))\n      let colspecs = map toColSpec specs\n      pure $ B.table (B.Caption Nothing mempty) -- added by addBlockTitle\n                colspecs thead [tbody] tfoot\n    A.BlockImage target mbalt mbw mbh -> do\n      img' <- doInline (A.Inline mempty (A.InlineImage target mbalt mbw mbh))\n      -- TODO have a global function that adds the title to caption here:\n      pure $ B.figure (Caption Nothing mempty) -- added by addBlockTitle\n                      (B.plain img')\n    -- TODO alt text?\n    A.BlockAudio (A.Target t) ->\n      pure $ B.plain $ B.image t \"\" (B.str t)\n    -- TODO alt text?\n    A.BlockVideo (A.Target t) ->\n      pure $ B.plain $ B.image t \"\" (B.str t)\n    A.TOC -> pure $ B.divWith (\"toc\",[],[]) mempty\n    A.Admonition admonitionType bs -> do\n      let admon = T.pack $ show admonitionType\n      bs' <- doBlocks bs\n      pure $ B.divWith (\"\",[T.toLower admon],[])\n           $ B.divWith (\"\",[\"title\"],[]) (B.para (B.str admon)) <> bs'\n    A.PageBreak ->\n      pure $ B.divWith (\"\", [\"page-break\"], [(\"wrapper\", \"1\")]) B.horizontalRule\n    A.ThematicBreak -> pure $ B.horizontalRule\n    A.Include fp (Just bs) ->\n      B.divWith (\"\",[\"included\"],[(\"path\",T.pack fp)]) <$> doBlocks bs\n    A.Include fp Nothing -> do\n      report $ CouldNotLoadIncludeFile (T.pack fp) (newPos \"\" 0 0)\n      pure mempty\n    A.PassthroughBlock t ->\n         case runPure (readHtml def{\n                               readerExtensions = extensionsFromList [Ext_raw_html]\n                               } t) of\n        Left _ -> pure $ B.rawBlock \"html\" t\n        Right (Pandoc _ bs) -> pure $ B.fromList bs\n\ndoItem :: PandocMonad m => A.ListItem -> m B.Blocks\ndoItem (A.ListItem Nothing bs) = doBlocks bs\ndoItem (A.ListItem (Just checkstate) bs) = do\n  bs' <- doBlocks bs\n  let check = case checkstate of\n                A.Checked -> Str \"\\9746\"\n                A.Unchecked -> Str \"\\9744\"\n  pure $ B.fromList\n       $ case B.toList bs' of\n           (B.Para ils : rest) -> B.Para (check : B.Space : ils) : rest\n           (B.Plain ils : rest) -> B.Plain (check : B.Space : ils) : rest\n           rest -> B.Para [check] : rest\n\ndoDefListItem :: PandocMonad m\n              => ([A.Inline], [A.Block]) -> m (B.Inlines , [B.Blocks])\ndoDefListItem (lab, bs) = do\n  lab' <- doInlines lab\n  bs' <- doBlocks bs\n  pure (lab', [bs'])\n\ndoInlines :: PandocMonad m => [A.Inline] -> m B.Inlines\ndoInlines = fmap mconcat . mapM doInline\n\ndoInline :: PandocMonad m => A.Inline -> m B.Inlines\ndoInline (A.Inline (A.Attr _ps kvs') it) = do\n  let kvs = M.mapKeys (\\k -> if k == \"role\" then \"class\" else k) kvs'\n  addPandocAttributes (M.toList kvs) <$>\n   case it of\n    A.Str t -> pure $ B.text t\n    A.HardBreak -> pure B.linebreak\n    A.Bold ils -> B.strong <$> doInlines ils\n    A.Italic ils -> B.emph <$> doInlines ils\n    A.Monospace ils -> walk monospaceStr <$> doInlines ils\n    A.Superscript ils -> B.superscript <$> doInlines ils\n    A.Subscript ils -> B.subscript <$> doInlines ils\n    A.Highlight ils -> B.spanWith (\"\",[\"mark\"],[]) <$> doInlines ils\n    A.Strikethrough ils -> B.strikeout <$> doInlines ils\n    A.DoubleQuoted ils -> B.doubleQuoted <$> doInlines ils\n    A.SingleQuoted ils -> B.singleQuoted <$> doInlines ils\n    -- TODO when texmath's asciimath parser works, convert:\n    A.Math (Just A.AsciiMath) t -> pure $ B.math t\n    A.Math (Just A.LaTeXMath) t -> pure $ B.math t\n    A.Math Nothing _ ->\n      throwError $ PandocParseError \"Encountered math type Nothing\"\n    A.Icon t -> pure $ B.spanWith (\"\",[\"icon\"],[(\"name\",t)])\n                         (B.str (\"[\" <> t <> \"]\"))\n    A.Button t -> pure $ B.spanWith (\"\",[\"button\"],[])\n                         (B.strong $ B.str (\"[\" <> t <> \"]\"))\n    A.Kbd ts -> pure $ mconcat $ L.intersperse (B.str \"+\") $\n         map (B.spanWith (\"\",[\"kbd\"],[]) . B.strong . B.str) ts\n    A.Menu ts -> pure $ B.spanWith (\"\",[\"menu\"],[]) $\n        B.strong $ B.text $ T.intercalate \" › \" ts\n    -- TODO do we need linktype?\n    A.Link _linkType (A.Target t) ils -> B.link t \"\" <$> doInlines ils\n    A.InlineImage (A.Target url) mbalt mbwidth mbheight -> do\n      let alt = case mbalt of\n                  Just (A.AltText t) -> B.text t\n                  Nothing -> mempty\n          width = case mbwidth of\n                  Just (A.Width n) -> [(\"width\", T.pack $ show n <> \"px\")]\n                  Nothing -> []\n          height = case mbheight of\n                  Just (A.Height n) -> [(\"height\", T.pack $ show n <> \"px\")]\n                  Nothing -> []\n      pure $ B.imageWith (\"\",[], width ++ height) url \"\" alt\n    A.Footnote _ ils -> B.note . B.para <$> doInlines ils\n    A.InlineAnchor t _ -> pure $ B.spanWith (t, [], []) mempty\n    A.BibliographyAnchor t _ -> pure $ B.spanWith (t, [], []) mempty\n    A.CrossReference t Nothing ->\n      pure $ B.linkWith (\"\",[\"cross-reference\"],[]) (\"#\" <> t) \"\" (B.str t)\n    A.CrossReference t (Just ils) -> do\n      B.linkWith (\"\",[\"cross-reference\"],[]) (\"#\" <> t) \"\" <$> doInlines ils\n    A.AttributeReference (A.AttributeName t) -> -- if this is here, it's unresolved\n      pure $ B.str (\"{\" <> t <> \"}\")\n    A.Span ils -> B.spanWith B.nullAttr <$> doInlines ils\n    A.IndexEntry (A.TermInText t) ->\n      pure $ B.spanWith (\"\",[\"index\"],[(\"term\",t)]) (B.text t)\n    A.IndexEntry (A.TermConcealed ts) ->\n      pure $ B.spanWith (\"\",[\"index\"],[(\"term\",T.intercalate \",\" ts)]) mempty\n    A.Counter name ctype val ->\n      pure $ B.spanWith (\"\",[\"counter\"],[(\"name\",name)]) $ B.str $\n        case ctype of\n          A.DecimalCounter -> tshow val\n          A.UpperAlphaCounter -> T.singleton $ chr (ord 'A' + val - 1)\n          A.LowerAlphaCounter -> T.singleton $ chr (ord 'a' + val - 1)\n    -- Passthrough is hard to get right, because pandoc's RawInline needs\n    -- a format specifier. Often in asciidoc passthrough is used as a form\n    -- of escaping, so the best approach seems to be treating it as HTML\n    -- and parsing it:\n    A.Passthrough t -> do\n      case runPure (readHtml def{\n                               readerExtensions = extensionsFromList [Ext_raw_html]\n                               } t) of\n        Left _ -> pure $ B.rawInline \"html\" t\n        Right (Pandoc _ bs) -> pure $ B.fromList . blocksToInlines $ bs\n\nmonospaceStr :: Inline -> Inline\nmonospaceStr (Str t) = Code B.nullAttr t\nmonospaceStr x = x\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/BibTeX.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.BibTeX\n   Copyright   : Copyright (C) 2020-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nParses BibTeX or BibLaTeX bibliographies into a Pandoc document\nwith empty body and `references` and `nocite` fields\nin the metadata.  A wildcard `nocite` is used so that\nif the document is rendered in another format, the\nentire bibliography will be printed.\n-}\nmodule Text.Pandoc.Readers.BibTeX\n  ( readBibTeX\n  , readBibLaTeX\n  )\nwhere\n\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Builder (setMeta, cite, str)\nimport Text.Pandoc.Parsing (fromParsecError)\nimport Citeproc (Lang(..), parseLang)\nimport Citeproc.Locale (getLocale)\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Class (PandocMonad, lookupEnv)\nimport Text.Pandoc.Citeproc.BibTeX as BibTeX\nimport Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)\nimport Text.Pandoc.Sources (ToSources(..))\nimport Control.Monad.Except (throwError)\n\n-- | Read BibTeX from an input string and return a Pandoc document.\n-- The document will have only metadata, with an empty body.\n-- The metadata will contain a `references` field with the\n-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.\nreadBibTeX :: (PandocMonad m, ToSources a)\n           => ReaderOptions -> a -> m Pandoc\nreadBibTeX = readBibTeX' BibTeX.Bibtex\n\n-- | Read BibLaTeX from an input string and return a Pandoc document.\n-- The document will have only metadata, with an empty body.\n-- The metadata will contain a `references` field with the\n-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.\nreadBibLaTeX :: (PandocMonad m, ToSources a)\n             => ReaderOptions -> a -> m Pandoc\nreadBibLaTeX = readBibTeX' BibTeX.Biblatex\n\nreadBibTeX' :: (PandocMonad m, ToSources a)\n            => Variant -> ReaderOptions -> a -> m Pandoc\nreadBibTeX' variant _opts t = do\n  mblangEnv <- lookupEnv \"LANG\"\n  let defaultLang = Lang \"en\" Nothing (Just \"US\") [] [] []\n  let lang = case mblangEnv of\n              Nothing  -> defaultLang\n              Just l   -> either (const defaultLang) id $ parseLang l\n  locale <- case getLocale lang of\n               Left e  ->\n                 case getLocale (Lang \"en\" Nothing (Just \"US\") [] [] []) of\n                   Right l -> return l\n                   Left _  -> throwError $ PandocCiteprocError e\n               Right l -> return l\n  case BibTeX.readBibtexString variant locale (const True) t of\n    Left e -> throwError $ fromParsecError (toSources t) e\n    Right refs -> return $ setMeta \"references\"\n                              (map referenceToMetaValue refs)\n                         . setMeta \"nocite\"\n                            (cite [Citation {citationId = \"*\"\n                                            , citationPrefix = []\n                                            , citationSuffix = []\n                                            , citationMode = NormalCitation\n                                            , citationNoteNum = 0\n                                            , citationHash = 0}]\n                                            (str \"[@*]\"))\n                        $ Pandoc nullMeta []\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/CSV.hs",
    "content": "{-# LANGUAGE FlexibleContexts    #-}\n\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Readers.CSV\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion from CSV or TSV to a 'Pandoc' table.\n-}\nmodule Text.Pandoc.Readers.CSV (\n  readCSV,\n  readTSV\n) where\nimport qualified Data.Text as T\nimport Text.Pandoc.CSV (parseCSV, defaultCSVOptions, CSVOptions(..))\nimport Text.Pandoc.Definition\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\nimport Text.Pandoc.Options (ReaderOptions)\nimport Control.Monad.Except (throwError)\nimport Data.Text (Text)\nimport Data.List (intersperse)\nimport Text.Pandoc.Parsing (fromParsecError)\n\nreadCSV :: (PandocMonad m, ToSources a)\n        => ReaderOptions -- ^ Reader options\n        -> a\n        -> m Pandoc\nreadCSV _opts s = do\n  readCSVWith defaultCSVOptions $ sourcesToText $ toSources s\n\nreadTSV :: (PandocMonad m, ToSources a)\n        => ReaderOptions -- ^ Reader options\n        -> a\n        -> m Pandoc\nreadTSV _opts s = do\n  readCSVWith tsvOpts $ sourcesToText $ toSources s\n where\n  tsvOpts = CSVOptions{\n    csvDelim = '\\t',\n    csvQuote = Nothing,\n    csvKeepSpace = False,\n    csvEscape = Nothing }\n\nreadCSVWith :: PandocMonad m\n            => CSVOptions\n            -> Text\n            -> m Pandoc\nreadCSVWith csvopts txt = do\n  case parseCSV csvopts txt of\n    Right (r:rs) -> return $ B.doc $ B.table capt\n                                             (zip aligns widths)\n                                             (TableHead nullAttr hdrs)\n                                             [TableBody nullAttr 0 [] rows]\n                                             (TableFoot nullAttr [])\n       where capt = B.emptyCaption\n             numcols = length r\n             toplain = B.simpleCell . B.plain . mconcat .\n                       intersperse B.linebreak . map B.text . T.lines\n             toRow = Row nullAttr . map toplain\n             toHeaderRow l = [toRow l | not (null l)]\n             hdrs = toHeaderRow r\n             rows = map toRow rs\n             aligns = replicate numcols AlignDefault\n             widths = replicate numcols ColWidthDefault\n    Right []     -> return $ B.doc mempty\n    Left e       -> throwError $ fromParsecError (toSources [(\"\",txt)]) e\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/CommonMark.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Readers.CommonMark\n   Copyright   : Copyright (C) 2015-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of CommonMark-formatted plain text to 'Pandoc' document.\n\nCommonMark is a strongly specified variant of Markdown: http://commonmark.org.\n-}\nmodule Text.Pandoc.Readers.CommonMark (readCommonMark)\nwhere\n\nimport Commonmark\nimport Commonmark.Extensions\nimport Commonmark.Pandoc\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Options\nimport Text.Pandoc.Readers.Metadata (yamlMetaBlock)\nimport Control.Monad (MonadPlus(mzero))\nimport Control.Monad.Except (  MonadError(throwError) )\nimport Data.Functor.Identity (runIdentity)\nimport Data.Typeable\nimport Text.Pandoc.Parsing (runParserT, getInput, getPosition,\n                            runF, defaultParserState, option, many1, anyChar,\n                            Sources(..), ToSources(..), ParsecT, Future,\n                            incSourceLine, fromParsecError)\nimport Text.Pandoc.Walk (walk)\nimport qualified Data.Text as T\nimport qualified Data.Attoparsec.Text as A\nimport Control.Applicative ((<|>))\n\n-- | Parse a CommonMark formatted string into a 'Pandoc' structure.\nreadCommonMark :: (PandocMonad m, ToSources a)\n               => ReaderOptions -> a -> m Pandoc\nreadCommonMark opts s\n  | isEnabled Ext_yaml_metadata_block opts = do\n    let sources = toSources s\n    let firstSourceName = case unSources sources of\n                               ((pos,_):_) -> sourceName pos\n                               _ -> \"\"\n    let toks = concatMap sourceToToks (unSources sources)\n    res <- runParserT (do meta <- yamlMetaBlock (metaValueParser opts)\n                          pos <- getPosition\n                          rest <- getInput\n                          let rest' = case rest of\n                                -- update position of first source (#7863):\n                                Sources ((_,t):xs) -> Sources ((pos,t):xs)\n                                _ -> rest\n                          return (meta, rest'))\n                      defaultParserState firstSourceName sources\n    case res of\n      Left _ -> readCommonMarkBody opts sources toks\n      Right (meta, rest) -> do\n        -- strip off metadata section and parse body\n        let body = concatMap sourceToToks (unSources rest)\n        Pandoc _ bs <- readCommonMarkBody opts sources body\n        return $ Pandoc (runF meta defaultParserState) bs\n  | otherwise = do\n    let sources = toSources s\n    let toks = concatMap sourceToToks (unSources sources)\n    readCommonMarkBody opts sources toks\n\nmakeFigures :: Block -> Block\nmakeFigures (Para [Image (ident,classes,kvs) alt (src,tit)])\n  | not (null alt) =\n  Figure (ident,[],[])\n    (Caption Nothing [Plain alt])\n    [Plain [Image (\"\",classes,kvs) alt (src,tit)]]\nmakeFigures b = b\n\nsourceToToks :: (SourcePos, Text) -> [Tok]\nsourceToToks (pos, s) = map adjust $ tokenize (sourceName pos) s\n where\n   adjust = case sourceLine pos of\n              1 -> id\n              n -> \\tok -> tok{ tokPos =\n                                  incSourceLine (tokPos tok) (n - 1) }\n\n\nmetaValueParser :: Monad m\n                => ReaderOptions -> ParsecT Sources st m (Future st MetaValue)\nmetaValueParser opts = do\n  inp <- option \"\" $ T.pack <$> many1 anyChar\n  let toks = concatMap sourceToToks (unSources (toSources inp))\n  case runIdentity (parseCommonmarkWith (specFor opts) toks) of\n     Left _ -> mzero\n     Right (Cm bls :: Cm () Blocks) -> return $ return $ B.toMetaValue bls\n\nreadCommonMarkBody :: PandocMonad m => ReaderOptions -> Sources -> [Tok] -> m Pandoc\nreadCommonMarkBody opts s toks =\n  (if isEnabled Ext_implicit_figures opts\n      then walk makeFigures\n      else id) .\n  (if isEnabled Ext_tex_math_gfm opts\n      then walk handleGfmMath\n      else id) .\n  (if readerStripComments opts\n      then walk stripBlockComments . walk stripInlineComments\n      else id) <$>\n  if isEnabled Ext_sourcepos opts\n     then case runIdentity (parseCommonmarkWith (specFor opts) toks) of\n            Left err -> throwError $ fromParsecError s err\n            Right (Cm bls :: Cm SourceRange Blocks) -> return $ B.doc bls\n     else case runIdentity (parseCommonmarkWith (specFor opts) toks) of\n            Left err -> throwError $ fromParsecError s err\n            Right (Cm bls :: Cm () Blocks) -> return $ B.doc bls\n\nhandleGfmMath :: Block -> Block\nhandleGfmMath (CodeBlock (\"\",[\"math\"],[]) raw) = Para [Math DisplayMath raw]\nhandleGfmMath x = walk handleGfmMathInline x\n\nhandleGfmMathInline :: Inline -> Inline\nhandleGfmMathInline (Math InlineMath math'') =\n  let math' = T.replace \"\\\\\\\\{\" \"\\\\{\" . T.replace \"\\\\\\\\}\" \"\\\\}\" $ math''\n              -- see #10631\n      (ticks, rest) = T.span (== '`') math'\n  in  if T.null ticks\n         then Math InlineMath math'\n         else case T.stripSuffix ticks rest of\n                Just middle | not (T.null middle) && (T.last middle /= '`')\n                             -> Math InlineMath middle\n                _ -> Math InlineMath math'\nhandleGfmMathInline x = x\n\nstripBlockComments :: Block -> Block\nstripBlockComments (RawBlock (B.Format \"html\") s) =\n  RawBlock (B.Format \"html\") (removeComments s)\nstripBlockComments x = x\n\nstripInlineComments :: Inline -> Inline\nstripInlineComments (RawInline (B.Format \"html\") s) =\n  RawInline (B.Format \"html\") (removeComments s)\nstripInlineComments x = x\n\nremoveComments :: Text -> Text\nremoveComments s =\n  either (const s) id $ A.parseOnly pRemoveComments s\n where\n  pRemoveComments = mconcat <$> A.many'\n    (\"\" <$ (A.string \"<!--\" *> A.scan (0 :: Int) scanChar <* A.char '>') <|>\n     (A.takeWhile1 (/= '<')) <|>\n     (A.string \"<\"))\n  scanChar st c =\n    case c of\n      '-' -> Just (st + 1)\n      '>' | st >= 2 -> Nothing\n      _ -> Just 0\n\nspecFor :: (Monad m, Typeable m, Typeable a,\n            Rangeable (Cm a Inlines), Rangeable (Cm a Blocks))\n        => ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)\nspecFor opts = foldr ($) defaultSyntaxSpec exts\n where\n  exts = [ (hardLineBreaksSpec <>) | isEnabled Ext_hard_line_breaks opts ] ++\n         [ (smartPunctuationSpec <>) | isEnabled Ext_smart opts ] ++\n         [ (strikethroughSpec <>) | isEnabled Ext_strikeout opts ] ++\n         [ (superscriptSpec <>) | isEnabled Ext_superscript opts ] ++\n         [ (subscriptSpec <>) | isEnabled Ext_subscript opts ] ++\n         [ (mathSpec <>) | isEnabled Ext_tex_math_dollars opts ] ++\n         [ (fancyListSpec <>) | isEnabled Ext_fancy_lists opts ] ++\n         [ (fencedDivSpec <>) | isEnabled Ext_fenced_divs opts ] ++\n         [ (bracketedSpanSpec <>) | isEnabled Ext_bracketed_spans opts ] ++\n         [ (rawAttributeSpec <>) | isEnabled Ext_raw_attribute opts ] ++\n         [ (attributesSpec <>) | isEnabled Ext_attributes opts ] ++\n         [ (alertSpec <>) | isEnabled Ext_alerts opts ] ++\n         [ (<> pipeTableSpec) | isEnabled Ext_pipe_tables opts ] ++\n            -- see #6739\n         [ (autolinkSpec <>) | isEnabled Ext_autolink_bare_uris opts ] ++\n         [ (emojiSpec <>) | isEnabled Ext_emoji opts ] ++\n         [ (autoIdentifiersSpec <>)\n           | isEnabled Ext_gfm_auto_identifiers opts\n           , not (isEnabled Ext_ascii_identifiers opts) ] ++\n         [ (autoIdentifiersAsciiSpec <>)\n           | isEnabled Ext_gfm_auto_identifiers opts\n           , isEnabled Ext_ascii_identifiers opts ] ++\n         [ (implicitHeadingReferencesSpec <>)\n           | isEnabled Ext_implicit_header_references opts ] ++\n         [ (footnoteSpec <>) | isEnabled Ext_footnotes opts ] ++\n         [ (definitionListSpec <>) | isEnabled Ext_definition_lists opts ] ++\n         [ (taskListSpec <>) | isEnabled Ext_task_lists opts ] ++\n         [ (wikilinksSpec TitleAfterPipe <>)\n           | isEnabled Ext_wikilinks_title_after_pipe opts ] ++\n         [ (wikilinksSpec TitleBeforePipe <>)\n           | isEnabled Ext_wikilinks_title_before_pipe opts ] ++\n         [ (rebaseRelativePathsSpec <>)\n           | isEnabled Ext_rebase_relative_paths opts ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Creole.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Creole\n   Copyright   : Copyright (C) 2017 Sascha Wilde\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Sascha Wilde <wilde@sha-bang.de>\n   Stability   : alpha\n   Portability : portable\n\nConversion of creole text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Creole ( readCreole\n                                  ) where\n\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport qualified Data.Foldable as F\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (enclosed)\n\n-- | Read creole from an input string and return a Pandoc document.\nreadCreole :: (PandocMonad m, ToSources a)\n          => ReaderOptions\n          -> a\n          -> m Pandoc\nreadCreole opts s = do\n  let sources = ensureFinalNewlines 2 (toSources s)\n  res <- readWithM parseCreole def{ stateOptions = opts } sources\n  case res of\n       Left e  -> throwError e\n       Right d -> return d\n\ntype CRLParser = ParsecT Sources ParserState\n\n--\n-- Utility functions\n--\n\n(<+>) :: (Monad m, Semigroup a) => m a -> m a -> m a\n(<+>) = liftM2 (<>)\n\n-- we have to redefine `enclosed' from Text.Pandoc.Parsing, because it\n-- assumes, that there can't be a space after the start parser, but\n-- with creole this is possible.\nenclosed :: (Show end, PandocMonad m) => CRLParser m start   -- ^ start parser\n         -> CRLParser m end  -- ^ end parser\n         -> CRLParser m a    -- ^ content parser (to be used repeatedly)\n         -> CRLParser m [a]\nenclosed start end parser = try $ start >> many1Till parser end\n\n--\n-- main parser\n--\n\nspecialChars :: [Char]\nspecialChars = \"*/~{}\\\\|[]()<>\\\"'\"\n\nparseCreole :: PandocMonad m => CRLParser m Pandoc\nparseCreole = do\n  bs <- mconcat <$> many block\n  spaces\n  eof\n  return $ B.doc bs\n\n--\n-- block parsers\n--\n\nblock :: PandocMonad m => CRLParser m B.Blocks\nblock = do\n  res <- mempty <$ skipMany1 blankline\n         <|> nowiki\n         <|> header\n         <|> horizontalRule\n         <|> anyList 1\n         <|> table\n         <|> para\n  skipMany blankline\n  return res\n\nnowiki :: PandocMonad m => CRLParser m B.Blocks\nnowiki = try $ fmap (B.codeBlock . mconcat) (nowikiStart\n                                             >> manyTill content nowikiEnd)\n  where\n    content = brackets <|> line\n    brackets = try $ option \"\" (T.singleton <$> newline)\n               <+> (char ' ' >> (manyChar (char ' ') <+> textStr \"}}}\") <* eol)\n    line = option \"\" (T.singleton <$> newline) <+> manyTillChar anyChar eol\n    eol = lookAhead $ try $ nowikiEnd <|> newline\n    nowikiStart = optional newline >> string \"{{{\" >> skipMany spaceChar >> newline\n    nowikiEnd = try $ linebreak >> string \"}}}\" >> skipMany spaceChar >> newline\n\nheader :: PandocMonad m => CRLParser m B.Blocks\nheader = try $ do\n  skipSpaces\n  level <-\n    fmap length (many1 (char '='))\n  guard $ level <= 6\n  skipSpaces\n  content <- B.str <$> manyTillChar (noneOf \"\\n\") headerEnd\n  return $ B.header level content\n  where\n    headerEnd = try $ skipSpaces >> many (char '=') >> skipSpaces >> newline\n\nunorderedList :: PandocMonad m => Int -> CRLParser m B.Blocks\nunorderedList = list '*' B.bulletList\n\norderedList :: PandocMonad m => Int -> CRLParser m B.Blocks\norderedList = list '#' B.orderedList\n\nanyList :: PandocMonad m => Int -> CRLParser m B.Blocks\nanyList n = unorderedList n <|> orderedList n\n\nanyListItem :: PandocMonad m => Int -> CRLParser m B.Blocks\nanyListItem n = listItem '*' n <|> listItem '#' n\n\nlist :: PandocMonad m => Char -> ([B.Blocks] -> B.Blocks) -> Int -> CRLParser m B.Blocks\nlist c f n =\n  fmap f (many1 (itemPlusSublist <|> listItem c n))\n  where itemPlusSublist = try $ listItem c n <+> anyList (n+1)\n\nlistItem :: PandocMonad m => Char -> Int -> CRLParser m B.Blocks\nlistItem c n =\n  fmap (B.plain . B.trimInlines .mconcat) (listStart >> many1Till inline itemEnd)\n  where\n    listStart = try $ skipSpaces >> optional newline >> skipSpaces\n                >> count n (char c)\n                >> lookAhead (noneOf [c]) >> skipSpaces\n    itemEnd = endOfParaElement <|> nextItem n\n              <|> if n < 3 then nextItem (n+1)\n                  else nextItem (n+1) <|> nextItem (n-1)\n    nextItem x = lookAhead $ try $ blankline >> anyListItem x >> return mempty\n\ntable :: PandocMonad m => CRLParser m B.Blocks\ntable = try $ do\n  headers <- optionMaybe headerRow\n  rows <- many1 row\n  return $ B.simpleTable (fromMaybe [mempty] headers) rows\n  where\n    headerRow = try $ skipSpaces >> many1Till headerCell rowEnd\n    headerCell = B.plain . B.trimInlines . mconcat\n                 <$> (string \"|=\" >> many1Till inline cellEnd)\n    row = try $ skipSpaces >> many1Till cell rowEnd\n    cell = B.plain . B.trimInlines . mconcat\n           <$> (char '|' >> manyTill inline cellEnd)\n    rowEnd = try $ optional (char '|') >> skipSpaces >> newline\n    cellEnd = lookAhead $ try $ char '|' <|> rowEnd\n\npara :: PandocMonad m => CRLParser m B.Blocks\npara = fmap (result . mconcat) (many1Till inline endOfParaElement)\n where\n   result content   = if F.all (==Space) content\n                      then mempty\n                      else B.para $ B.trimInlines content\n\nendOfParaElement :: PandocMonad m => CRLParser m ()\nendOfParaElement = lookAhead $ endOfInput <|> endOfPara\n                   <|> startOfList <|> startOfTable\n                   <|> startOfHeader <|> hr <|> startOfNowiki\n  where\n   endOfInput    = try $ skipMany blankline >> skipSpaces >> eof\n   endOfPara     = try $ blankline >> skipMany1 blankline\n   startOf      :: PandocMonad m => CRLParser m a -> CRLParser m ()\n   startOf p     = try $ blankline >> p >> return mempty\n   startOfList   = startOf $ anyListItem 1\n   startOfTable  = startOf table\n   startOfHeader = startOf header\n   startOfNowiki = startOf nowiki\n   hr            = startOf horizontalRule\n\nhorizontalRule :: PandocMonad m => CRLParser m B.Blocks\nhorizontalRule = try $ skipSpaces >> string \"----\" >> skipSpaces >> newline\n                 >> return B.horizontalRule\n\n--\n-- inline parsers\n--\n\ninline :: PandocMonad m => CRLParser m B.Inlines\ninline = choice [ whitespace\n                , escapedLink\n                , escapedChar\n                , link\n                , inlineNowiki\n                , placeholder\n                , image\n                , forcedLinebreak\n                , bold\n                , finalBold\n                , italics\n                , finalItalics\n                , str\n                , symbol\n                ] <?> \"inline\"\n\nescapedChar :: PandocMonad m => CRLParser m B.Inlines\nescapedChar =\n  fmap (B.str . T.singleton) (try $ char '~' >> noneOf \"\\t\\n \")\n\nescapedLink :: PandocMonad m => CRLParser m B.Inlines\nescapedLink = try $ do\n  char '~'\n  (orig, _) <- uri\n  return $ B.str orig\n\nimage :: PandocMonad m => CRLParser m B.Inlines\nimage = try $ do\n  (orig, src) <- wikiImg\n  return $ B.image src \"\" (B.str orig)\n  where\n    linkSrc = manyChar $ noneOf \"|}\\n\\r\\t\"\n    linkDsc = char '|' >> manyChar (noneOf \"}\\n\\r\\t\")\n    wikiImg = try $ do\n      string \"{{\"\n      src <- linkSrc\n      dsc <- option \"\" linkDsc\n      string \"}}\"\n      return (dsc, src)\n\nlink :: PandocMonad m => CRLParser m B.Inlines\nlink = try $ do\n  (orig, src) <- uriLink <|> wikiLink\n  return $ B.link src \"\" orig\n  where\n    linkSrc = manyChar $ noneOf \"|]\\n\\r\\t\"\n    linkDsc :: PandocMonad m => Text -> CRLParser m B.Inlines\n    linkDsc otxt = B.str\n                   <$> try (option otxt\n                         (char '|' >> manyChar (noneOf \"]\\n\\r\\t\")))\n    linkImg = try $ char '|' >> image\n    wikiLink = try $ do\n      string \"[[\"\n      src <- linkSrc\n      dsc <- linkImg <|> linkDsc src\n      string \"]]\"\n      return (dsc, src)\n    uriLink = try $ do\n      (orig, src) <- uri\n      return (B.str orig, src)\n\ninlineNowiki :: PandocMonad m => CRLParser m B.Inlines\ninlineNowiki = B.code <$> (start >> manyTillChar (noneOf \"\\n\\r\") end)\n  where\n    start = try $ string \"{{{\"\n    end = try $ string \"}}}\" >> lookAhead (noneOf \"}\")\n\nplaceholder :: PandocMonad m => CRLParser m B.Inlines\n-- The semantics of the placeholder is basically implementation\n-- dependent, so there is no way to DTRT for all cases.\n-- So for now we just drop them.\nplaceholder = B.text <$> try (string \"<<<\" >> manyTill anyChar (string \">>>\")\n              >> return \"\")\n\nwhitespace :: PandocMonad m => CRLParser m B.Inlines\nwhitespace = lb <|> regsp\n  where lb = try $ skipMany spaceChar >> linebreak >> return B.space\n        regsp = try $ skipMany1 spaceChar >> return B.space\n\nlinebreak :: PandocMonad m => CRLParser m B.Inlines\nlinebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)\n  where lastNewline  = eof >> return mempty\n        innerNewline = return B.space\n\nsymbol :: PandocMonad m => CRLParser m B.Inlines\nsymbol = fmap (B.str . T.singleton) (oneOf specialChars)\n\nstr :: PandocMonad m => CRLParser m B.Inlines\nstr = let strChar = noneOf (\"\\t\\n \" ++ specialChars) in\n        fmap B.str (many1Char strChar)\n\nbold :: PandocMonad m => CRLParser m B.Inlines\nbold = B.strong . mconcat <$>\n       enclosed (string \"**\") (try $ string \"**\") inline\n\nitalics :: PandocMonad m => CRLParser m B.Inlines\nitalics = B.emph . mconcat <$>\n          enclosed (string \"//\") (try $ string \"//\") inline\n\nfinalBold :: PandocMonad m => CRLParser m B.Inlines\nfinalBold = B.strong . mconcat <$>\n            try (string \"**\" >> many1Till inline endOfParaElement)\n\nfinalItalics :: PandocMonad m => CRLParser m B.Inlines\nfinalItalics = B.emph . mconcat <$>\n               try (string \"//\" >> many1Till inline endOfParaElement)\n\nforcedLinebreak :: PandocMonad m => CRLParser m B.Inlines\nforcedLinebreak = try $ string \"\\\\\\\\\" >> return B.linebreak\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/CslJson.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.CslJson\n   Copyright   : Copyright (C) 2020-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nParses CSL JSON bibliographies into a Pandoc document\nwith empty body and `references` and `nocite` fields\nin the metadata.  A wildcard `nocite` is used so that\nif the document is rendered in another format, the\nentire bibliography will be printed.\n\n<https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html>.\n-}\nmodule Text.Pandoc.Readers.CslJson\n  ( readCslJson )\nwhere\n\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Builder (setMeta, cite, str)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Data.Text as T\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)\nimport Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\n\n-- | Read CSL JSON from an input string and return a Pandoc document.\n-- The document will have only metadata, with an empty body.\n-- The metadata will contain a `references` field with the\n-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.\nreadCslJson :: (PandocMonad m, ToSources a)\n            => ReaderOptions -> a -> m Pandoc\nreadCslJson _opts x =\n  case cslJsonToReferences (UTF8.fromText $ sourcesToText $ toSources x) of\n    Left e -> throwError $ PandocParseError $ T.pack e\n    Right refs -> return $ setMeta \"references\"\n                              (map referenceToMetaValue refs)\n                         . setMeta \"nocite\"\n                            (cite [Citation {citationId = \"*\"\n                                            , citationPrefix = []\n                                            , citationSuffix = []\n                                            , citationMode = NormalCitation\n                                            , citationNoteNum = 0\n                                            , citationHash = 0}]\n                                            (str \"[@*]\"))\n                         $ Pandoc nullMeta []\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Djot.hs",
    "content": "{-# LANGUAGE RankNTypes #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE UndecidableInstances #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\n{- |\n   Module      : Text.Pandoc.Readers.Djot\n   Copyright   : Copyright (C) 2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nReads and evaluates a Djot document as a Pandoc AST.\n-}\nmodule Text.Pandoc.Readers.Djot\n  ( readDjot\n  )\nwhere\n\nimport Text.Pandoc.Class\nimport Text.Pandoc.Sources\nimport Text.Parsec.Pos (newPos)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Shared (addPandocAttributes, tshow)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Djot (ParseOptions(..), SourcePosOption(..), parseDoc, Pos(..))\nimport qualified Djot.AST as D\nimport Text.Pandoc.Error (PandocError(..))\nimport Control.Monad.Except (throwError)\nimport qualified Data.Text as T\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Emoji (emojiToInline)\nimport Control.Monad.Reader\nimport qualified Data.Foldable as F\nimport Data.ByteString (ByteString)\n-- import Debug.Trace\n\n-- | Read Djot from an input string and return a Pandoc document.\nreadDjot :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc\nreadDjot opts inp = do\n  let sources = toSources inp\n  case parseDoc ParseOptions{ sourcePositions =\n                              if isEnabled Ext_sourcepos opts\n                                 then AllSourcePos\n                                 else NoSourcePos }\n          (UTF8.fromText $ sourcesToText sources) of\n    Left e -> throwError $ PandocParseError $ T.pack $ show e\n    Right d ->\n      runReaderT (doc <$> convertBlocks (D.docBlocks d))\n        Env{ references = D.docReferences d <> D.docAutoReferences d\n           , footnotes = D.docFootnotes d\n           }\n\ndata Env =\n  Env{ references :: D.ReferenceMap\n     , footnotes :: D.NoteMap\n     }\n  deriving (Show, Ord, Eq)\n\nconvertBlocks :: PandocMonad m => D.Blocks -> ReaderT Env m Blocks\nconvertBlocks =  fmap mconcat . mapM convertBlock . F.toList . D.unMany\n\nconvertBlock :: PandocMonad m => D.Node D.Block -> ReaderT Env m Blocks\nconvertBlock (D.Node pos attr bl) =  addAttrToBlock pos attr <$>\n  case bl of\n    D.Para ils -> para <$> convertInlines ils\n    D.Section bls -> divWith (\"\",[\"section\"],[]) <$> convertBlocks bls\n    D.Heading lev ils -> header lev <$> convertInlines ils\n    D.BlockQuote bls -> blockQuote <$> convertBlocks bls\n    D.CodeBlock lang bs -> pure $\n      codeBlockWith (\"\", [UTF8.toText lang], []) $ UTF8.toText bs\n    D.Div bls -> divWith nullAttr <$> convertBlocks bls\n    D.OrderedList olattr listSpacing items ->\n      orderedListWith olattr' .\n        (case listSpacing of\n           D.Tight -> map toTight\n           D.Loose -> id) <$> mapM convertBlocks items\n     where\n       olattr' = ( D.orderedListStart olattr\n                 , case D.orderedListStyle olattr of\n                     D.Decimal -> Decimal\n                     D.LetterUpper -> UpperAlpha\n                     D.LetterLower -> LowerAlpha\n                     D.RomanUpper -> UpperRoman\n                     D.RomanLower -> LowerRoman\n                 , case D.orderedListDelim olattr of\n                     D.RightPeriod -> Period\n                     D.RightParen -> OneParen\n                     D.LeftRightParen -> TwoParens\n                 )\n    D.BulletList listSpacing items ->\n        bulletList .\n        (case listSpacing of\n           D.Tight -> map toTight\n           D.Loose -> id) <$> mapM convertBlocks items\n    D.TaskList listSpacing items ->\n        bulletList .\n        (case listSpacing of\n           D.Tight -> map toTight\n           D.Loose -> id) <$> mapM toTaskListItem items\n    D.DefinitionList listSpacing items ->\n      definitionList .\n        (case listSpacing of\n           D.Tight -> map (\\(t,d) -> (t, map toTight d))\n           D.Loose -> id) <$> mapM toDlItem items\n     where\n       toDlItem (ils,bls) = (,) <$> convertInlines ils\n                                <*> ((:[]) <$> convertBlocks bls)\n    D.ThematicBreak -> pure horizontalRule\n    D.Table mbCaption rows -> do\n      capt <- case mbCaption of\n                Just (D.Caption bls') ->\n                  Caption Nothing . toList <$> convertBlocks bls'\n                Nothing -> pure $ Caption Nothing mempty\n      let toAlign D.AlignLeft = AlignLeft\n          toAlign D.AlignRight = AlignRight\n          toAlign D.AlignCenter = AlignCenter\n          toAlign D.AlignDefault = AlignDefault\n      let toColSpec (D.Cell _ align _) = (toAlign align, ColWidthDefault)\n      let colspecs = case rows of\n                      [] -> []\n                      (cells:_) -> map toColSpec cells\n      let (headrow, rest) =\n            case rows of\n              (r@(D.Cell D.HeadCell _ _ : _) : rs) -> (r, rs)\n              _ -> ([],rows)\n      let getBody bods row =\n            case row of\n              (D.Cell D.HeadCell _ _ : _) ->\n                   case bods of\n                     [] -> [([row],[])]\n                     ([],_):_ -> (([row],[]):bods)\n                     (hs,bs):rs -> (hs,row:bs):rs\n              _ -> case bods of\n                     (hs,bs):rs -> (hs,row:bs):rs\n                     [] -> [([],[row])]\n      let reverseSnd (as,bs) = (as,reverse bs)\n      let bodies = reverse $ map reverseSnd $ F.foldl' getBody [] rest\n      let toCell (D.Cell _ al ils) =\n            Cell nullAttr (toAlign al) (RowSpan 1) (ColSpan 1)\n                   . (\\is -> [Para $ toList is]) <$> convertInlines ils\n      let toRow = fmap (Row nullAttr) . mapM toCell\n      thead <- TableHead mempty <$> mapM toRow [headrow]\n      let toTableBody (hs, rs) =\n            TableBody mempty (RowHeadColumns 0) <$>\n              mapM toRow hs <*> mapM toRow rs\n      tbodies <- mapM toTableBody bodies\n      let tfoot = TableFoot mempty []\n      pure $ singleton $ Table mempty capt colspecs thead tbodies tfoot\n    D.RawBlock (D.Format fmt) bs -> pure $\n      rawBlock (UTF8.toText fmt) (UTF8.toText bs)\n\naddAttrToBlock :: Pos -> D.Attr -> Blocks -> Blocks\naddAttrToBlock pos (D.Attr as) =\n  addPandocAttributes $\n    case pos of\n        NoPos -> textkvs\n        Pos sl sc el ec ->\n          (\"data-pos\", tshow sl <> \":\" <> tshow sc <>\n                 \"-\" <> tshow el <> \":\" <> tshow ec) : textkvs\n     where\n       textkvs = (map (\\(k,v) -> (UTF8.toText k, UTF8.toText v))\n                    (filter (not . internalAttribute) as))\n\naddAttrToInline :: Pos -> D.Attr -> Inlines -> Inlines\naddAttrToInline pos (D.Attr as) =\n  addPandocAttributes $\n    case pos of\n        NoPos -> textkvs\n        Pos sl sc el ec ->\n          (\"data-pos\", tshow sl <> \":\" <> tshow sc <>\n                 \"-\" <> tshow el <> \":\" <> tshow ec) : textkvs\n     where\n       textkvs = (map (\\(k,v) -> (UTF8.toText k, UTF8.toText v))\n                    (filter (not . internalAttribute) as))\n\nconvertInlines :: PandocMonad m => D.Inlines -> ReaderT Env m Inlines\nconvertInlines = fmap mconcat . mapM convertInline . F.toList . D.unMany\n\nconvertInline :: PandocMonad m => D.Node D.Inline -> ReaderT Env m Inlines\nconvertInline (D.Node pos attr il) = addAttrToInline pos attr <$>\n  case il of\n    D.Str bs -> pure $ text (UTF8.toText bs)\n    D.Emph ils -> emph <$> convertInlines ils\n    D.Strong ils -> strong <$> convertInlines ils\n    D.Highlight ils -> spanWith (\"\",[\"mark\"],[]) <$> convertInlines ils\n    D.Insert ils -> spanWith (\"\",[\"inserted\"],[]) <$> convertInlines ils\n    D.Delete ils -> spanWith (\"\",[\"deleted\"],[]) <$> convertInlines ils\n    D.Subscript ils -> subscript <$> convertInlines ils\n    D.Superscript ils -> superscript <$> convertInlines ils\n    D.Span ils -> spanWith nullAttr <$> convertInlines ils\n    D.Quoted D.DoubleQuotes ils -> doubleQuoted <$> convertInlines ils\n    D.Quoted D.SingleQuotes ils -> singleQuoted <$> convertInlines ils\n    D.Verbatim bs -> pure $ code (UTF8.toText bs)\n    D.Symbol bs -> pure $\n      let s = UTF8.toText bs\n       in maybe (spanWith (\"\",[\"symbol\"],[]) (str s)) singleton $ emojiToInline s\n    D.Math sty bs -> pure $\n      (case sty of\n        D.DisplayMath -> displayMath\n        D.InlineMath -> math) (UTF8.toText bs)\n    D.Link ils target ->\n      case target of\n        D.Direct url -> link (UTF8.toText url) \"\" <$> convertInlines ils\n        D.Reference label -> do\n          refs <- asks references\n          case D.lookupReference label refs of\n            Just (url, lattr) ->\n              addAttrToInline pos lattr .\n                link (UTF8.toText url) \"\" <$> convertInlines ils\n            Nothing -> do\n              report $ ReferenceNotFound (UTF8.toText label) (newPos \"\" 0 0)\n              link \"\" \"\" <$> convertInlines ils\n    D.Image ils target ->\n      case target of\n        D.Direct url -> image (UTF8.toText url) \"\" <$> convertInlines ils\n        D.Reference label -> do\n          refs <- asks references\n          case D.lookupReference label refs of\n            Just (url, lattr) ->\n              addAttrToInline pos lattr .\n                image (UTF8.toText url) \"\" <$> convertInlines ils\n            Nothing -> do\n              report $ ReferenceNotFound (UTF8.toText label) (newPos \"\" 0 0)\n              image \"\" \"\" <$> convertInlines ils\n    D.FootnoteReference bs -> do\n      notes <- asks footnotes\n      case D.lookupNote bs notes of\n        Just bls -> note <$> convertBlocks bls\n        Nothing -> do\n          -- TODO consider new warning for this?\n          report $ IgnoredElement (\"Undefined footnote reference \" <> tshow bs)\n          pure mempty\n    D.UrlLink bs -> do\n      let url = UTF8.toText bs\n      pure $ linkWith (\"\",[\"uri\"],[]) url \"\" (str url)\n    D.EmailLink bs -> do\n      let email = UTF8.toText bs\n      pure $ linkWith (\"\",[\"email\"],[]) (\"mailto:\" <> email) \"\" (str email)\n    D.RawInline (D.Format fbs) bs -> pure $\n      rawInline (UTF8.toText fbs) (UTF8.toText bs)\n    D.NonBreakingSpace -> pure $ str \"\\160\"\n    D.SoftBreak -> pure softbreak\n    D.HardBreak -> pure linebreak\n\ninternalAttribute :: (ByteString, ByteString) -> Bool\ninternalAttribute (\"_implicit\",_) = True\ninternalAttribute (\"_autogen\",_) = True\ninternalAttribute _ = False\n\ntoTight :: Blocks -> Blocks\ntoTight (Many bls) = Many $ paraToPlain <$> bls\n where\n   paraToPlain (Para ils) = Plain ils\n   paraToPlain x = x\n\ntoTaskListItem :: PandocMonad m\n               => (D.TaskStatus, D.Blocks) -> ReaderT Env m Blocks\ntoTaskListItem (status, bls) = do\n  bls' <- convertBlocks bls\n  case toList bls' of\n    (Para ils : rest) -> pure $\n      fromList $ Para (Str taskmarker : Space : ils) : rest\n    _ -> pure $ para (str taskmarker) <> bls'\n where\n   taskmarker\n     | status == D.Complete = \"[X]\"\n     | otherwise = \"[ ]\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/DocBook.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE TemplateHaskell #-}\n{- |\n   Module      : Text.Pandoc.Readers.DocBook\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of DocBook XML to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.DocBook ( readDocBook ) where\nimport Control.Monad (MonadPlus(mplus))\nimport Control.Applicative ()\nimport Control.Monad.State.Strict\n    ( MonadTrans(lift),\n      StateT(runStateT),\n      MonadState(get),\n      gets,\n      modify )\nimport Data.ByteString (ByteString)\nimport Data.FileEmbed\nimport Data.Char (isSpace, isLetter, chr)\nimport Data.Default\nimport Data.List.Split (splitWhen)\nimport Data.Either (rights)\nimport Data.Foldable (asum)\nimport Data.Generics\nimport Data.List (intersperse,elemIndex)\nimport qualified Data.Set as Set\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Maybe (catMaybes,fromMaybe,mapMaybe,maybeToList)\nimport Data.Text (Text)\nimport Data.Text.Read as TR\nimport Data.Text.Encoding (decodeUtf8)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.XML (lookupEntity)\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Text.Pandoc.Shared (safeRead, addPandocAttributes)\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\nimport Text.Pandoc.Transforms (headerShift)\nimport Text.TeXMath (readMathML, writeTeX)\nimport qualified Data.Map as M\nimport Text.Pandoc.XML.Light\nimport Text.Pandoc.Walk (query)\nimport Text.Read (readMaybe)\n\n{-\n\nList of all DocBook tags, with [x] indicating implemented,\n[o] meaning intentionally left unimplemented (pass through):\n\n[o] abbrev - An abbreviation, especially one followed by a period\n[x] abstract - A summary\n[o] accel - A graphical user interface (GUI) keyboard shortcut\n[x] ackno - Acknowledgements in an Article\n[o] acronym - An often pronounceable word made from the initial\n[o] action - A response to a user event\n[o] address - A real-world address, generally a postal address\n[ ] affiliation - The institutional affiliation of an individual\n[ ] alt - Text representation for a graphical element\n[x] anchor - A spot in the document\n[x] answer - An answer to a question posed in a QandASet\n[x] appendix - An appendix in a Book or Article\n[x] appendixinfo - Meta-information for an Appendix\n[o] application - The name of a software program\n[x] area - A region defined for a Callout in a graphic or code example\n[x] areaset - A set of related areas in a graphic or code example\n[x] areaspec - A collection of regions in a graphic or code example\n[ ] arg - An argument in a CmdSynopsis\n[x] article - An article\n[x] articleinfo - Meta-information for an Article\n[ ] artpagenums - The page numbers of an article as published\n[x] attribution - The source of a block quote or epigraph\n[ ] audiodata - Pointer to external audio data\n[ ] audioobject - A wrapper for audio data and its associated meta-information\n[x] author - The name of an individual author\n[ ] authorblurb - A short description or note about an author\n[x] authorgroup - Wrapper for author information when a document has\n    multiple authors or collaborators\n[x] authorinitials - The initials or other short identifier for an author\n[o] beginpage - The location of a page break in a print version of the document\n[ ] bibliocoverage - The spatial or temporal coverage of a document\n[x] bibliodiv - A section of a Bibliography\n[x] biblioentry - An entry in a Bibliography\n[x] bibliography - A bibliography\n[ ] bibliographyinfo - Meta-information for a Bibliography\n[ ] biblioid - An identifier for a document\n[o] bibliolist - A wrapper for a set of bibliography entries\n[x] bibliomisc - Untyped bibliographic information\n[x] bibliomixed - An entry in a Bibliography\n[ ] bibliomset - A cooked container for related bibliographic information\n[ ] biblioref - A cross reference to a bibliographic entry\n[ ] bibliorelation - The relationship of a document to another\n[ ] biblioset - A raw container for related bibliographic information\n[ ] bibliosource - The source of a document\n[ ] blockinfo - Meta-information for a block element\n[x] blockquote - A quotation set off from the main text\n[x] book - A book\n[x] bookinfo - Meta-information for a Book\n[x] bridgehead - A free-floating heading\n[x] callout - A “called out” description of a marked Area\n[x] calloutlist - A list of Callouts\n[x] caption - A caption\n[x] caution - A note of caution\n[x] chapter - A chapter, as of a book\n[x] chapterinfo - Meta-information for a Chapter\n[ ] citation - An inline bibliographic reference to another published work\n[ ] citebiblioid - A citation of a bibliographic identifier\n[x] citerefentry - A citation to a reference page\n[ ] citetitle - The title of a cited work\n[ ] city - The name of a city in an address\n[x] classname - The name of a class, in the object-oriented programming sense\n[ ] classsynopsis - The syntax summary for a class definition\n[ ] classsynopsisinfo - Information supplementing the contents of\n    a ClassSynopsis\n[ ] cmdsynopsis - A syntax summary for a software command\n[ ] co - The location of a callout embedded in text\n[x] code - An inline code fragment\n[x] col - Specifications for a column in an HTML table\n[x] colgroup - A group of columns in an HTML table\n[ ] collab - Identifies a collaborator\n[ ] collabname - The name of a collaborator\n[ ] colophon - Text at the back of a book describing facts about its production\n[x] colspec - Specifications for a column in a table\n[x] command - The name of an executable program or other software command\n[x] computeroutput - Data, generally text, displayed or presented by a computer\n[ ] confdates - The dates of a conference for which a document was written\n[ ] confgroup - A wrapper for document meta-information about a conference\n[ ] confnum - An identifier, frequently numerical, associated with a conference for which a document was written\n[ ] confsponsor - The sponsor of a conference for which a document was written\n[ ] conftitle - The title of a conference for which a document was written\n[x] constant - A programming or system constant\n[ ] constraint - A constraint in an EBNF production\n[ ] constraintdef - The definition of a constraint in an EBNF production\n[ ] constructorsynopsis - A syntax summary for a constructor\n[ ] contractnum - The contract number of a document\n[ ] contractsponsor - The sponsor of a contract\n[ ] contrib - A summary of the contributions made to a document by a\n    credited source\n[ ] copyright - Copyright information about a document\n[ ] coref - A cross reference to a co\n[ ] corpauthor - A corporate author, as opposed to an individual\n[ ] corpcredit - A corporation or organization credited in a document\n[ ] corpname - The name of a corporation\n[ ] country - The name of a country\n[x] danger - An admonition set off from the text indicating hazardous situation\n[ ] database - The name of a database, or part of a database\n[x] date - The date of publication or revision of a document\n[ ] dedication - A wrapper for the dedication section of a book\n[ ] destructorsynopsis - A syntax summary for a destructor\n[ ] edition - The name or number of an edition of a document\n[ ] editor - The name of the editor of a document\n[x] email - An email address\n[x] emphasis - Emphasized text\n[x] entry - A cell in a table\n[ ] entrytbl - A subtable appearing in place of an Entry in a table\n[x] envar - A software environment variable\n[x] epigraph - A short inscription at the beginning of a document or component\n    note:  also handle embedded attribution tag\n[x] equation - A displayed mathematical equation\n[ ] errorcode - An error code\n[ ] errorname - An error name\n[ ] errortext - An error message.\n[ ] errortype - The classification of an error message\n[x] example - A formal example, with a title\n[ ] exceptionname - The name of an exception\n[ ] fax - A fax number\n[ ] fieldsynopsis - The name of a field in a class definition\n[x] figure - A formal figure, generally an illustration, with a title\n[x] filename - The name of a file\n[ ] firstname - The first name of a person\n[ ] firstterm - The first occurrence of a term\n[x] footnote - A footnote\n[ ] footnoteref - A cross reference to a footnote (a footnote mark)\n[x] foreignphrase - A word or phrase in a language other than the primary\n    language of the document\n[x] formalpara - A paragraph with a title\n[ ] funcdef - A function (subroutine) name and its return type\n[ ] funcparams - Parameters for a function referenced through a function\n    pointer in a synopsis\n[ ] funcprototype - The prototype of a function\n[ ] funcsynopsis - The syntax summary for a function definition\n[ ] funcsynopsisinfo - Information supplementing the FuncDefs of a FuncSynopsis\n[x] function - The name of a function or subroutine, as in a\n    programming language\n[x] glossary - A glossary\n[x] glossaryinfo - Meta-information for a Glossary\n[x] glossdef - A definition in a GlossEntry\n[x] glossdiv - A division in a Glossary\n[x] glossentry - An entry in a Glossary or GlossList\n[x] glosslist - A wrapper for a set of GlossEntrys\n[x] glosssee - A cross-reference from one GlossEntry to another\n[x] glossseealso - A cross-reference from one GlossEntry to another\n[x] glossterm - A glossary term\n[ ] graphic - A displayed graphical object (not an inline)\n    Note: in DocBook v5 `graphic` is discarded\n[ ] graphicco - A graphic that contains callout areas\n    Note: in DocBook v5 `graphicco` is discarded\n[ ] group - A group of elements in a CmdSynopsis\n[ ] guibutton - The text on a button in a GUI\n[ ] guiicon - Graphic and/or text appearing as a icon in a GUI\n[ ] guilabel - The text of a label in a GUI\n[x] guimenu - The name of a menu in a GUI\n[x] guimenuitem - The name of a terminal menu item in a GUI\n[x] guisubmenu - The name of a submenu in a GUI\n[ ] hardware - A physical part of a computer system\n[ ] highlights - A summary of the main points of the discussed component\n[ ] holder - The name of the individual or organization that holds a copyright\n[o] honorific - The title of a person\n[ ] html:form - An HTML form\n[x] imagedata - Pointer to external image data (only `fileref` attribute\n    implemented but not `entityref` which would require parsing of the DTD)\n[x] imageobject - A wrapper for image data and its associated meta-information\n[ ] imageobjectco - A wrapper for an image object with callouts\n[x] important - An admonition set off from the text\n[x] index - An index\n[x] indexdiv - A division in an index\n[x] indexentry - An entry in an index\n[x] indexinfo - Meta-information for an Index\n[x] indexterm - A wrapper for terms to be indexed\n[x] info - A wrapper for information about a component or other block. (DocBook v5)\n[x] informalequation - A displayed mathematical equation without a title\n[x] informalexample - A displayed example without a title\n[x] informalfigure - An untitled figure\n[ ] informaltable - A table without a title\n[ ] initializer - The initializer for a FieldSynopsis\n[x] inlineequation - A mathematical equation or expression occurring inline\n[ ] inlinegraphic - An object containing or pointing to graphical data\n    that will be rendered inline\n[x] inlinemediaobject - An inline media object (video, audio, image, and so on)\n[ ] interface - An element of a GUI\n[ ] interfacename - The name of an interface\n[ ] invpartnumber - An inventory part number\n[ ] isbn - The International Standard Book Number of a document\n[ ] issn - The International Standard Serial Number of a periodical\n[ ] issuenum - The number of an issue of a journal\n[x] itemizedlist - A list in which each entry is marked with a bullet or\n    other dingbat\n[ ] itermset - A set of index terms in the meta-information of a document\n[ ] jobtitle - The title of an individual in an organization\n[x] keycap - The text printed on a key on a keyboard\n[ ] keycode - The internal, frequently numeric, identifier for a key\n    on a keyboard\n[x] keycombo - A combination of input actions\n[ ] keysym - The symbolic name of a key on a keyboard\n[ ] keyword - One of a set of keywords describing the content of a document\n[ ] keywordset - A set of keywords describing the content of a document\n[ ] label - A label on a Question or Answer\n[ ] legalnotice - A statement of legal obligations or requirements\n[ ] lhs - The left-hand side of an EBNF production\n[ ] lineage - The portion of a person's name indicating a relationship to\n    ancestors\n[ ] lineannotation - A comment on a line in a verbatim listing\n[x] link - A hypertext link\n[x] listitem - A wrapper for the elements of a list item\n[x] literal - Inline text that is some literal value\n[x] literallayout - A block of text in which line breaks and white space are\n    to be reproduced faithfully\n[ ] lot - A list of the titles of formal objects (as tables or figures) in\n    a document\n[ ] lotentry - An entry in a list of titles\n[ ] manvolnum - A reference volume number\n[x] markup - A string of formatting markup in text that is to be\n    represented literally\n[x] mathphrase - A mathematical phrase, an expression that can be represented\n    with ordinary text and a small amount of markup\n[ ] medialabel - A name that identifies the physical medium on which some\n    information resides\n[x] mediaobject - A displayed media object (video, audio, image, etc.)\n[ ] mediaobjectco - A media object that contains callouts\n[x] member - An element of a simple list\n[x] menuchoice - A selection or series of selections from a menu\n[ ] methodname - The name of a method\n[ ] methodparam - Parameters to a method\n[ ] methodsynopsis - A syntax summary for a method\n[x] mml:math - A MathML equation\n[ ] modespec - Application-specific information necessary for the\n    completion of an OLink\n[ ] modifier - Modifiers in a synopsis\n[ ] mousebutton - The conventional name of a mouse button\n[ ] msg - A message in a message set\n[ ] msgaud - The audience to which a message in a message set is relevant\n[ ] msgentry - A wrapper for an entry in a message set\n[ ] msgexplan - Explanatory material relating to a message in a message set\n[ ] msginfo - Information about a message in a message set\n[ ] msglevel - The level of importance or severity of a message in a message set\n[ ] msgmain - The primary component of a message in a message set\n[ ] msgorig - The origin of a message in a message set\n[ ] msgrel - A related component of a message in a message set\n[ ] msgset - A detailed set of messages, usually error messages\n[ ] msgsub - A subcomponent of a message in a message set\n[ ] msgtext - The actual text of a message component in a message set\n[ ] nonterminal - A non-terminal in an EBNF production\n[x] note - A message set off from the text\n[ ] objectinfo - Meta-information for an object\n[ ] olink - A link that addresses its target indirectly, through an entity\n[ ] ooclass - A class in an object-oriented programming language\n[ ] ooexception - An exception in an object-oriented programming language\n[ ] oointerface - An interface in an object-oriented programming language\n[x] option - An option for a software command\n[x] optional - Optional information\n[x] orderedlist - A list in which each entry is marked with a sequentially\n    incremented label\n[ ] orgdiv - A division of an organization\n[ ] orgname - The name of an organization other than a corporation\n[ ] otheraddr - Uncategorized information in address\n[ ] othercredit - A person or entity, other than an author or editor,\n    credited in a document\n[ ] othername - A component of a persons name that is not a first name,\n    surname, or lineage\n[ ] package - A package\n[ ] pagenums - The numbers of the pages in a book, for use in a bibliographic\n    entry\n[x] para - A paragraph\n[ ] paramdef - Information about a function parameter in a programming language\n[x] parameter - A value or a symbolic reference to a value\n[x] part - A division in a book\n[ ] partinfo - Meta-information for a Part\n[ ] partintro - An introduction to the contents of a part\n[ ] personblurb - A short description or note about a person\n[ ] personname - The personal name of an individual\n[ ] phone - A telephone number\n[x] phrase - A span of text\n[ ] pob - A post office box in an address\n[ ] postcode - A postal code in an address\n[x] preface - Introductory matter preceding the first chapter of a book\n[ ] prefaceinfo - Meta-information for a Preface\n[x] primary - The primary word or phrase under which an index term should be\n    sorted\n[ ] primaryie - A primary term in an index entry, not in the text\n[ ] printhistory - The printing history of a document\n[x] procedure - A list of operations to be performed in a well-defined sequence\n[ ] production - A production in a set of EBNF productions\n[ ] productionrecap - A cross-reference to an EBNF production\n[ ] productionset - A set of EBNF productions\n[ ] productname - The formal name of a product\n[ ] productnumber - A number assigned to a product\n[x] programlisting - A literal listing of all or part of a program\n[ ] programlistingco - A program listing with associated areas used in callouts\n[x] prompt - A character or string indicating the start of an input field in\n    a computer display\n[ ] property - A unit of data associated with some part of a computer system\n[ ] pubdate - The date of publication of a document\n[ ] publisher - The publisher of a document\n[ ] publishername - The name of the publisher of a document\n[ ] pubsnumber - A number assigned to a publication other than an ISBN or ISSN\n    or inventory part number\n[x] qandadiv - A titled division in a QandASet\n[o] qandaentry - A question/answer set within a QandASet\n[o] qandaset - A question-and-answer set\n[x] question - A question in a QandASet\n[x] quote - An inline quotation\n[ ] refclass - The scope or other indication of applicability of a\n    reference entry\n[ ] refdescriptor - A description of the topic of a reference page\n[ ] refentry - A reference page (originally a UNIX man-style reference page)\n[ ] refentryinfo - Meta-information for a Refentry\n[ ] refentrytitle - The title of a reference page\n[ ] reference - A collection of reference entries\n[ ] referenceinfo - Meta-information for a Reference\n[ ] refmeta - Meta-information for a reference entry\n[ ] refmiscinfo - Meta-information for a reference entry other than the title\n    and volume number\n[ ] refname - The name of (one of) the subject(s) of a reference page\n[ ] refnamediv - The name, purpose, and classification of a reference page\n[ ] refpurpose - A short (one sentence) synopsis of the topic of a reference\n    page\n[x] refsect1 - A major subsection of a reference entry\n[x] refsect1info - Meta-information for a RefSect1\n[x] refsect2 - A subsection of a RefSect1\n[x] refsect2info - Meta-information for a RefSect2\n[x] refsect3 - A subsection of a RefSect2\n[x] refsect3info - Meta-information for a RefSect3\n[x] refsection - A recursive section in a refentry\n[x] refsectioninfo - Meta-information for a refsection\n[ ] refsynopsisdiv - A syntactic synopsis of the subject of the reference page\n[ ] refsynopsisdivinfo - Meta-information for a RefSynopsisDiv\n[ ] releaseinfo - Information about a particular release of a document\n[ ] remark - A remark (or comment) intended for presentation in a draft\n    manuscript\n[x] replaceable - Content that may or must be replaced by the user\n[ ] returnvalue - The value returned by a function\n[ ] revdescription - A extended description of a revision to a document\n[ ] revhistory - A history of the revisions to a document\n[ ] revision - An entry describing a single revision in the history of the\n    revisions to a document\n[ ] revnumber - A document revision number\n[ ] revremark - A description of a revision to a document\n[ ] rhs - The right-hand side of an EBNF production\n[x] row - A row in a table\n[ ] sbr - An explicit line break in a command synopsis\n[x] screen - Text that a user sees or might see on a computer screen\n[o] screenco - A screen with associated areas used in callouts\n[o] screeninfo - Information about how a screen shot was produced\n[ ] screenshot - A representation of what the user sees or might see on a\n    computer screen\n[x] secondary - A secondary word or phrase in an index term\n[ ] secondaryie - A secondary term in an index entry, rather than in the text\n[x] sect1 - A top-level section of document\n[x] sect1info - Meta-information for a Sect1\n[x] sect2 - A subsection within a Sect1\n[x] sect2info - Meta-information for a Sect2\n[x] sect3 - A subsection within a Sect2\n[x] sect3info - Meta-information for a Sect3\n[x] sect4 - A subsection within a Sect3\n[x] sect4info - Meta-information for a Sect4\n[x] sect5 - A subsection within a Sect4\n[x] sect5info - Meta-information for a Sect5\n[x] section - A recursive section\n[x] sectioninfo - Meta-information for a recursive section\n[x] see - Part of an index term directing the reader instead to another entry\n    in the index\n[x] seealso - Part of an index term directing the reader also to another entry\n    in the index\n[ ] seealsoie - A See also entry in an index, rather than in the text\n[ ] seeie - A See entry in an index, rather than in the text\n[x] seg - An element of a list item in a segmented list\n[x] seglistitem - A list item in a segmented list\n[x] segmentedlist - A segmented list, a list of sets of elements\n[x] segtitle - The title of an element of a list item in a segmented list\n[ ] seriesvolnums - Numbers of the volumes in a series of books\n[ ] set - A collection of books\n[ ] setindex - An index to a set of books\n[ ] setindexinfo - Meta-information for a SetIndex\n[ ] setinfo - Meta-information for a Set\n[ ] sgmltag - A component of SGML markup\n[ ] shortaffil - A brief description of an affiliation\n[ ] shortcut - A key combination for an action that is also accessible through\n    a menu\n[x] sidebar - A portion of a document that is isolated from the main\n    narrative flow\n[ ] sidebarinfo - Meta-information for a Sidebar\n[x] simpara - A paragraph that contains only text and inline markup, no block\n    elements\n[x] simplelist - An undecorated list of single words or short phrases\n[ ] simplemsgentry - A wrapper for a simpler entry in a message set\n[x] simplesect - A section of a document with no subdivisions\n[ ] spanspec - Formatting information for a spanned column in a table\n[ ] state - A state or province in an address\n[x] step - A unit of action in a procedure\n[ ] stepalternatives - Alternative steps in a procedure\n[ ] street - A street address in an address\n[ ] structfield - A field in a structure (in the programming language sense)\n[ ] structname - The name of a structure (in the programming language sense)\n[ ] subject - One of a group of terms describing the subject matter of a\n    document\n[ ] subjectset - A set of terms describing the subject matter of a document\n[ ] subjectterm - A term in a group of terms describing the subject matter of\n    a document\n[x] subscript - A subscript (as in H2O, the molecular formula for water)\n[x] substeps - A wrapper for steps that occur within steps in a procedure\n[x] subtitle - The subtitle of a document\n[x] superscript - A superscript (as in x2, the mathematical notation for x\n    multiplied by itself)\n[ ] surname - A family name; in western cultures the last name\n[ ] svg:svg - An SVG graphic\n[x] symbol - A name that is replaced by a value before processing\n[ ] synopfragment - A portion of a CmdSynopsis broken out from the main body\n    of the synopsis\n[ ] synopfragmentref - A reference to a fragment of a command synopsis\n[ ] synopsis - A general-purpose element for representing the syntax of\n    commands or functions\n[x] systemitem - A system-related item or term\n[ ] table - A formal table in a document\n[ ] task - A task to be completed\n[ ] taskprerequisites - The prerequisites for a task\n[ ] taskrelated - Information related to a task\n[ ] tasksummary - A summary of a task\n[x] tbody - A wrapper for the rows of a table or informal table\n[x] td - A table entry in an HTML table\n[x] term - The word or phrase being defined or described in a variable list\n[ ] termdef - An inline term definition\n[x] tertiary - A tertiary word or phrase in an index term\n[ ] tertiaryie - A tertiary term in an index entry, rather than in the text\n[ ] textdata - Pointer to external text data\n[ ] textobject - A wrapper for a text description of an object and its\n    associated meta-information\n[ ] tfoot - A table footer consisting of one or more rows\n[x] tgroup - A wrapper for the main content of a table, or part of a table\n[x] th - A table header entry in an HTML table\n[x] thead - A table header consisting of one or more rows\n[x] tip - A suggestion to the user, set off from the text\n[x] title - The text of the title of a section of a document or of a formal\n    block-level element\n[x] titleabbrev - The abbreviation of a Title\n[x] toc - A table of contents\n[x] tocback - An entry in a table of contents for a back matter component\n[x] tocchap - An entry in a table of contents for a component in the body of\n    a document\n[x] tocentry - A component title in a table of contents\n[x] tocfront - An entry in a table of contents for a front matter component\n[x] toclevel1 - A top-level entry within a table of contents entry for a\n    chapter-like component\n[x] toclevel2 - A second-level entry within a table of contents entry for a\n    chapter-like component\n[x] toclevel3 - A third-level entry within a table of contents entry for a\n    chapter-like component\n[x] toclevel4 - A fourth-level entry within a table of contents entry for a\n    chapter-like component\n[x] toclevel5 - A fifth-level entry within a table of contents entry for a\n    chapter-like component\n[x] tocpart - An entry in a table of contents for a part of a book\n[ ] token - A unit of information\n[x] tr - A row in an HTML table\n[ ] trademark - A trademark\n[x] type - The classification of a value\n[x] ulink - A link that addresses its target by means of a URL\n    (Uniform Resource Locator)\n[x] uri - A Uniform Resource Identifier\n[x] userinput - Data entered by the user\n[x] varargs - An empty element in a function synopsis indicating a variable\n    number of arguments\n[x] variablelist - A list in which each entry is composed of a set of one or\n    more terms and an associated description\n[x] varlistentry - A wrapper for a set of terms and the associated description\n    in a variable list\n[x] varname - The name of a variable\n[ ] videodata - Pointer to external video data\n[ ] videoobject - A wrapper for video data and its associated meta-information\n[ ] void - An empty element in a function synopsis indicating that the\n    function in question takes no arguments\n[ ] volumenum - The volume number of a document in a set (as of books in a set\n    or articles in a journal)\n[x] warning - An admonition set off from the text\n[x] wordasword - A word meant specifically as a word and not representing\n    anything else\n[x] xref - A cross reference to another part of the document\n[ ] year - The year of publication of a document\n[x] ?asciidoc-br? - line break from asciidoc docbook output\n-}\n\ntype DB m = StateT DBState m\n\ndata DBState = DBState{ dbSectionLevel  :: Int\n                      , dbQuoteType     :: QuoteType\n                      , dbMeta          :: Meta\n                      , dbBook          :: Bool\n                      , dbContent       :: [Content]\n                      , dbLiteralLayout :: Bool\n                      , dbElementStack  :: [Text]\n                      } deriving Show\n\ninstance Default DBState where\n  def = DBState{ dbSectionLevel = 0\n               , dbQuoteType = DoubleQuote\n               , dbMeta = mempty\n               , dbBook = False\n               , dbContent = []\n               , dbLiteralLayout = False\n               , dbElementStack = []\n               }\n\n\nreadDocBook :: (PandocMonad m, ToSources a)\n            => ReaderOptions\n            -> a\n            -> m Pandoc\nreadDocBook _ inp = do\n  let sources = toSources inp\n  tree <- either (throwError . PandocXMLError \"\") return $\n            parseXMLContentsWithEntities\n            docbookEntityMap\n              (TL.fromStrict . handleInstructions . sourcesToText $ sources)\n  (bs, st') <- flip runStateT (def{ dbContent = tree }) $ mapM parseBlock tree\n  let headerLevel (Header n _ _) = [n]\n      headerLevel _              = []\n  let bottomLevel = maybe 1 minimum $ nonEmpty $ query headerLevel bs\n  return $\n    -- handle the case where you have <part> or <chapter>\n    (if bottomLevel < 1\n        then headerShift (1 - bottomLevel)\n        else id) $ Pandoc (dbMeta st') $ toList $ mconcat bs\n\n-- We treat certain processing instructions by converting them to tags\n-- beginning \"pi-\".\nhandleInstructions :: Text -> Text\nhandleInstructions t =\n  let (x,y) = T.breakOn \"<?\" t\n   in if T.null y\n         then x\n         else\n           let (w,z) = T.breakOn \"?>\" y\n            in (if T.takeWhile (\\c -> isLetter c || c == '-')\n                    (T.drop 2 w) `elem` [\"asciidoc-br\", \"dbfo\"]\n                   then x <> \"<pi-\" <> T.drop 2 w <> \"/>\"\n                   else x <> w <> T.take 2 z) <>\n               handleInstructions (T.drop 2 z)\n\ngetFigure :: PandocMonad m => Element -> DB m Blocks\ngetFigure e = do\n  tit <- case filterChild (named \"title\") e of\n              Just t  -> getInlines t\n              Nothing -> return mempty\n  contents <- getBlocks e\n  let contents' =\n        case toList contents of\n          [Para [img@Image{}]] -> plain (fromList [img])\n          _ -> contents\n  return $ figureWith\n             (attrValue \"id\" e, [], [])\n             (simpleCaption $ plain tit)\n             contents'\n\n-- convenience function to get an attribute value, defaulting to \"\"\nattrValue :: Text -> Element -> Text\nattrValue attr elt =\n  fromMaybe \"\" (lookupAttrBy (\\x -> qName x == attr) (elAttribs elt))\n\n-- convenience function\nnamed :: Text -> Element -> Bool\nnamed s e = qName (elName e) == s\n\n--\n\naddMetadataFromElement :: PandocMonad m => Element -> DB m Blocks\naddMetadataFromElement e = do\n  -- Add metadata if at root or appropriate parent element\n  elementStack <- gets dbElementStack\n  if take 1 elementStack `elem` [[], [\"book\"], [\"article\"]]\n    then mempty <$ mapM_ handleMetadataElement\n                  (filterChildren ((isMetadataField . qName . elName)) e)\n    else return mempty\n where\n  handleMetadataElement elt =\n    case qName (elName elt) of\n      \"title\" -> addContentsToMetadata \"title\" elt\n      \"subtitle\" -> addContentsToMetadata \"subtitle\" elt\n      \"abstract\" -> addContentsToMetadata \"abstract\" elt\n      \"date\" -> addContentsToMetadata \"date\" elt\n      \"release\" -> addContentsToMetadata \"release\" elt\n      \"releaseinfo\" -> addContentsToMetadata \"releaseinfo\" elt\n      \"address\" -> addContentsToMetadata \"address\" elt\n      \"copyright\" -> addContentsToMetadata \"copyright\" elt\n      \"author\" -> fromAuthor elt >>= addMeta \"author\"\n      \"authorgroup\" ->\n        mapM fromAuthor (filterChildren (named \"author\") elt) >>= addMeta \"author\"\n      _ -> report . IgnoredElement . qName . elName $ elt\n\n  fromAuthor elt =\n    mconcat . intersperse space . filter (not . null)\n      <$> mapM getInlines (elChildren elt)\n\n  addContentsToMetadata fieldname elt =\n    if any ((`Set.member` blockTags) . qName . elName) (elChildren elt)\n       then getBlocks elt >>= addMeta fieldname\n       else getInlines elt >>= addMeta fieldname\n\n  isMetadataField \"abstract\" = True\n  isMetadataField \"address\" = True\n  isMetadataField \"annotation\" = True\n  isMetadataField \"artpagenums\" = True\n  isMetadataField \"author\" = True\n  isMetadataField \"authorgroup\" = True\n  isMetadataField \"authorinitials\" = True\n  isMetadataField \"bibliocoverage\" = True\n  isMetadataField \"biblioid\" = True\n  isMetadataField \"bibliomisc\" = True\n  isMetadataField \"bibliomset\" = True\n  isMetadataField \"bibliorelation\" = True\n  isMetadataField \"biblioset\" = True\n  isMetadataField \"bibliosource\" = True\n  isMetadataField \"collab\" = True\n  isMetadataField \"confgroup\" = True\n  isMetadataField \"contractnum\" = True\n  isMetadataField \"contractsponsor\" = True\n  isMetadataField \"copyright\" = True\n  isMetadataField \"cover\" = True\n  isMetadataField \"date\" = True\n  isMetadataField \"edition\" = True\n  isMetadataField \"editor\" = True\n  isMetadataField \"extendedlink\" = True\n  isMetadataField \"issuenum\" = True\n  isMetadataField \"itermset\" = True\n  isMetadataField \"keywordset\" = True\n  isMetadataField \"legalnotice\" = True\n  isMetadataField \"mediaobject\" = True\n  isMetadataField \"org\" = True\n  isMetadataField \"orgname\" = True\n  isMetadataField \"othercredit\" = True\n  isMetadataField \"pagenums\" = True\n  isMetadataField \"printhistory\" = True\n  isMetadataField \"productname\" = True\n  isMetadataField \"productnumber\" = True\n  isMetadataField \"pubdate\" = True\n  isMetadataField \"publisher\" = True\n  isMetadataField \"publishername\" = True\n  isMetadataField \"releaseinfo\" = True\n  isMetadataField \"revhistory\" = True\n  isMetadataField \"seriesvolnums\" = True\n  isMetadataField \"subjectset\" = True\n  isMetadataField \"subtitle\" = True\n  isMetadataField \"title\" = True\n  isMetadataField \"titleabbrev\" = True\n  isMetadataField \"volumenum\" = True\n  isMetadataField _ = False\n\n\naddMeta :: PandocMonad m => ToMetaValue a => Text -> a -> DB m ()\naddMeta field val = modify (setMeta field val)\n\ninstance HasMeta DBState where\n  setMeta field v s =  s {dbMeta = setMeta field v (dbMeta s)}\n  deleteMeta field s = s {dbMeta = deleteMeta field (dbMeta s)}\n\nisBlockElement :: Content -> Bool\nisBlockElement (Elem e) = qName (elName e) `Set.member` blockTags\nisBlockElement _ = False\n\nblockTags :: Set.Set Text\nblockTags = Set.fromList $\n  [ \"abstract\"\n  , \"ackno\"\n  , \"answer\"\n  , \"appendix\"\n  , \"appendixinfo\"\n  , \"area\"\n  , \"areaset\"\n  , \"areaspec\"\n  , \"article\"\n  , \"articleinfo\"\n  , \"attribution\"\n  , \"authorinitials\"\n  , \"biblioentry\"\n  , \"bibliomisc\"\n  , \"bibliomixed\"\n  , \"blockquote\"\n  , \"book\"\n  , \"bookinfo\"\n  , \"bridgehead\"\n  , \"calloutlist\"\n  , \"caption\"\n  , \"chapter\"\n  , \"chapterinfo\"\n  , \"epigraph\"\n  , \"example\"\n  , \"figure\"\n  , \"formalpara\"\n  , \"glossary\"\n  , \"glossaryinfo\"\n  , \"glossdiv\"\n  , \"glossee\"\n  , \"glosseealso\"\n  , \"glosslist\"\n  , \"glosssee\"\n  , \"glossseealso\"\n  , \"index\"\n  , \"info\"\n  , \"informalexample\"\n  , \"informalfigure\"\n  , \"informaltable\"\n  , \"itemizedlist\"\n  , \"linegroup\"\n  , \"literallayout\"\n  , \"mediaobject\"\n  , \"orderedlist\"\n  , \"para\"\n  , \"part\"\n  , \"partinfo\"\n  , \"preface\"\n  , \"procedure\"\n  , \"programlisting\"\n  , \"question\"\n  , \"refsect1info\"\n  , \"refsect2info\"\n  , \"refsect3info\"\n  , \"refsectioninfo\"\n  , \"screen\"\n  , \"sect1info\"\n  , \"sect2info\"\n  , \"sect3info\"\n  , \"sect4info\"\n  , \"sect5info\"\n  , \"sectioninfo\"\n  , \"simpara\"\n  , \"substeps\"\n  , \"subtitle\"\n  , \"table\"\n  , \"title\"\n  , \"titleabbrev\"\n  , \"toc\"\n  , \"variablelist\"\n  ] ++ sectionTags ++ admonitionTags\n\nsectionTags :: [Text]\nsectionTags = [\"bibliography\", \"bibliodiv\"\n              , \"sect1\", \"sect2\", \"sect3\", \"sect4\", \"sect5\", \"section\", \"simplesect\"\n              , \"refsect1\", \"refsect2\", \"refsect3\", \"refsection\", \"qandadiv\"\n              ]\n\nadmonitionTags :: [Text]\nadmonitionTags = [\"caution\",\"danger\",\"important\",\"note\",\"tip\",\"warning\"]\n\ntitledBlockElements :: [Text]\ntitledBlockElements = [\"example\", \"formalpara\", \"sidebar\"]\n\n-- Trim leading and trailing newline characters\ntrimNl :: Text -> Text\ntrimNl = T.dropAround (== '\\n')\n\n-- meld text into beginning of first paragraph of Blocks.\n-- assumes Blocks start with a Para; if not, does nothing.\naddToStart :: Inlines -> Blocks -> Blocks\naddToStart toadd bs =\n  case toList bs of\n    (Para xs : rest) -> para (toadd <> fromList xs) <> fromList rest\n    _                -> bs\n\n-- function that is used by both mediaobject (in parseBlock)\n-- and inlinemediaobject (in parseInline)\n-- A DocBook mediaobject is a wrapper around a set of alternative presentations\ngetMediaobject :: PandocMonad m => Element -> DB m Inlines\ngetMediaobject e = do\n  let (imageUrl, tit, attr) =\n        case filterElements (named \"imageobject\") e of\n          []  -> (mempty, mempty, nullAttr)\n          (z:_) ->\n            let tit' = maybe \"\" strContent $\n                         filterChild (named \"objectinfo\") z >>=\n                         filterChild (named \"title\")\n                (imageUrl', attr') =\n                  case filterChild (named \"imagedata\") z of\n                        Nothing -> (mempty, nullAttr)\n                        Just i  -> let atVal a = attrValue a i\n                                       w = case atVal \"width\" of\n                                             \"\" -> []\n                                             d  -> [(\"width\", d)]\n                                       h = case atVal \"depth\" of\n                                             \"\" -> []\n                                             d  -> [(\"height\", d)]\n                                       id' = atVal \"id\"\n                                       cs = T.words $ atVal \"role\"\n                                       atr = (id', cs, w ++ h)\n                                   in  (atVal \"fileref\", atr)\n            in  (imageUrl', tit', attr')\n  let capt = case filterChild (\\x -> named \"caption\" x\n                                            || named \"textobject\" x\n                                            || named \"alt\" x) e of\n                        Nothing -> return mempty\n                        Just z  -> trimInlines . mconcat <$>\n                                         mapM parseInline (elContent z)\n  fmap (imageWith attr imageUrl tit) capt\n\ngetBlocks :: PandocMonad m => Element -> DB m Blocks\ngetBlocks e = do\n  modify (\\st -> st{ dbElementStack = qName (elName e) : dbElementStack st })\n  blocks <- mconcat <$> mapM parseBlock (elContent e)\n  modify (\\st -> st{ dbElementStack = drop 1 $ dbElementStack st })\n  return blocks\n\ngetRoleAttr :: Element -> [(Text, Text)] -- extract role attribute and add it to the attribute list\ngetRoleAttr e = case attrValue \"role\" e of\n                  \"\" -> []\n                  r  -> [(\"role\", r)]\n\nparseBlock :: PandocMonad m => Content -> DB m Blocks\nparseBlock (Text (CData CDataRaw _ _)) = return mempty -- DOCTYPE\nparseBlock (Text (CData _ s _)) = if T.all isSpace s\n                                     then return mempty\n                                     else return $ plain $ trimInlines $ text s\nparseBlock (CRef x) = return $ plain $ str $ T.toUpper x\nparseBlock (Elem e) = do\n  parsedBlock <- case qName (elName e) of\n        \"toc\"   -> skip -- skip TOC, since in pandoc it's autogenerated\n        \"index\" -> skip -- skip index, since page numbers meaningless\n        \"para\"  -> parseMixed para (elContent e)\n        \"simpara\"  -> parseMixed para (elContent e)\n        \"ackno\"  -> parseMixed para (elContent e)\n        \"epigraph\" -> parseBlockquote\n        \"blockquote\" -> withOptionalTitle parseBlockquote\n        \"attribution\" -> skip\n        \"titleabbrev\" -> skip\n        \"authorinitials\" -> skip\n        \"bibliography\" -> sect 0\n        \"bibliodiv\" ->\n          case filterChild (named \"title\") e of\n            Just _  -> sect 1\n            Nothing -> return mempty\n        \"biblioentry\" -> parseMixed para (elContent e)\n        \"bibliomisc\" -> parseMixed para (elContent e)\n        \"bibliomixed\" -> parseMixed para (elContent e)\n        \"equation\"         -> para <$> equation e displayMath\n        \"informalequation\" -> divWith (attrValue \"id\" e,[\"informalequation\"],[]) .\n                              para <$> equation e displayMath\n        \"glosssee\" -> para . (\\ils -> text \"See \" <> ils <> str \".\")\n                         <$> getInlines e\n        \"glossseealso\" -> para . (\\ils -> text \"See also \" <> ils <> str \".\")\n                         <$> getInlines e\n        \"glossary\" -> sect 0\n        \"glossdiv\" -> definitionList <$>\n                  mapM parseGlossEntry (filterChildren (named \"glossentry\") e)\n        \"glosslist\" -> definitionList <$>\n                  mapM parseGlossEntry (filterChildren (named \"glossentry\") e)\n        \"chapter\" -> modify (\\st -> st{ dbBook = True}) >> sect 0\n        \"part\" -> modify (\\st -> st{ dbBook = True}) >> sect (-1)\n        \"appendix\" -> sect 0\n        \"preface\" -> sect 0\n        \"bridgehead\" -> para . strong <$> getInlines e\n        \"sect1\" -> sect 1\n        \"sect2\" -> sect 2\n        \"sect3\" -> sect 3\n        \"sect4\" -> sect 4\n        \"sect5\" -> sect 5\n        \"section\" -> gets dbSectionLevel >>= sect . (+1)\n        \"simplesect\" ->\n          gets dbSectionLevel >>=\n          sectWith(attrValue \"id\" e) [\"unnumbered\"] [] . (+1)\n        \"refsect1\" -> sect 1\n        \"refsect2\" -> sect 2\n        \"refsect3\" -> sect 3\n        \"refsection\" -> gets dbSectionLevel >>= sect . (+1)\n        l | l `elem` titledBlockElements -> parseAdmonition False l\n        l | l `elem` admonitionTags -> parseAdmonition True l\n        \"area\" -> skip\n        \"areaset\" -> skip\n        \"areaspec\" -> skip\n        \"qandadiv\" -> gets dbSectionLevel >>= sect . (+1)\n        \"question\" -> addToStart (strong (str \"Q:\") <> str \" \") <$> getBlocks e\n        \"answer\" -> addToStart (strong (str \"A:\") <> str \" \") <$> getBlocks e\n        \"abstract\" -> blockQuote <$> getBlocks e\n        \"calloutlist\" -> withOptionalTitle $ bulletList <$> callouts\n        \"itemizedlist\" -> withOptionalTitle $\n                            bulletList . handleCompact <$> listitems\n        \"orderedlist\" -> withOptionalTitle $ do\n          let listStyle = case attrValue \"numeration\" e of\n                               \"arabic\"     -> Decimal\n                               \"loweralpha\" -> LowerAlpha\n                               \"upperalpha\" -> UpperAlpha\n                               \"lowerroman\" -> LowerRoman\n                               \"upperroman\" -> UpperRoman\n                               _            -> Decimal\n          let start = fromMaybe 1 $ safeRead $ attrValue \"startingnumber\" e\n          orderedListWith (start,listStyle,DefaultDelim) . handleCompact\n            <$> listitems\n        \"variablelist\" -> definitionList <$> deflistitems\n        \"procedure\" -> orderedList <$> steps\n        \"substeps\" -> orderedList <$> steps\n        \"figure\" -> getFigure e\n        \"informalfigure\" -> getFigure e\n        \"mediaobject\" -> para <$> getMediaobject e\n        \"caption\" -> skip\n        \"info\" -> addMetadataFromElement e\n        \"articleinfo\" -> addMetadataFromElement e\n        \"sectioninfo\" -> skip -- keywords & other metadata\n        \"refsectioninfo\" -> skip -- keywords & other metadata\n        \"refsect1info\" -> skip -- keywords & other metadata\n        \"refsect2info\" -> skip -- keywords & other metadata\n        \"refsect3info\" -> skip -- keywords & other metadata\n        \"sect1info\" -> skip  -- keywords & other metadata\n        \"sect2info\" -> skip  -- keywords & other metadata\n        \"sect3info\" -> skip  -- keywords & other metadata\n        \"sect4info\" -> skip  -- keywords & other metadata\n        \"sect5info\" -> skip  -- keywords & other metadata\n        \"chapterinfo\" -> skip -- keywords & other metadata\n        \"partinfo\" -> skip -- keywords & other metadata\n        \"glossaryinfo\" -> skip  -- keywords & other metadata\n        \"appendixinfo\" -> skip  -- keywords & other metadata\n        \"bookinfo\" -> addMetadataFromElement e\n        \"article\" -> modify (\\st -> st{ dbBook = False }) >>\n                           addMetadataFromElement e >> getBlocks e\n        \"book\" -> modify (\\st -> st{ dbBook = True }) >>\n                    addMetadataFromElement e >> getBlocks e\n        \"table\" -> parseTable\n        \"informaltable\" -> parseTable\n        \"informalexample\" -> divWith (\"\", [\"informalexample\"], []) <$>\n                             getBlocks e\n        \"linegroup\" -> lineBlock <$> lineItems\n        \"literallayout\" -> literalLayout\n        \"screen\" -> codeBlockWithLang\n        \"programlisting\" -> codeBlockWithLang\n        \"?xml\"  -> return mempty\n        \"title\" -> return mempty     -- handled in parent element\n        \"subtitle\" -> return mempty  -- handled in parent element\n        _ -> skip >> getBlocks e\n  if qName (elName e) `elem` sectionTags\n     then return parsedBlock\n     else return $ addPandocAttributes (getRoleAttr e) parsedBlock\n   where skip = do\n           let qn = qName $ elName e\n           let name = if \"pi-\" `T.isPrefixOf` qn\n                         then \"<?\" <> qn <> \"?>\"\n                         else qn\n           lift $ report $ IgnoredElement name\n           return mempty\n\n\n         compactSpacing = case attrValue \"spacing\" e of\n                            \"compact\" -> True\n                            _         -> False\n\n         handleCompact = if compactSpacing\n                            then map (fmap paraToPlain)\n                            else id\n\n         literalLayout\n           | \"monospaced\" `elem` (T.words (attrValue \"class\" e))\n               = codeBlockWithLang\n           | otherwise = do\n               oldLiteralLayout <- gets dbLiteralLayout\n               modify $ \\st -> st{ dbLiteralLayout = True }\n               content <- mconcat <$> mapM parseInline (elContent e)\n               let ls = map fromList . splitWhen (== LineBreak) . toList $ content\n               modify $ \\st -> st{ dbLiteralLayout = oldLiteralLayout }\n               return $ lineBlock ls\n\n         codeBlockWithLang = do\n           let classes' = case attrValue \"language\" e of\n                                \"\" -> []\n                                x  -> [x]\n                ++ [\"numberLines\" | attrValue \"linenumbering\" e == \"numbered\"]\n           return $ codeBlockWith (attrValue \"id\" e, classes', [])\n                  $ trimNl $ strContentRecursive e\n         parseBlockquote = do\n            attrib <- case filterChild (named \"attribution\") e of\n                             Nothing  -> return mempty\n                             Just z   -> para . (str \"— \" <>) . mconcat\n                                         <$>\n                                              mapM parseInline (elContent z)\n            contents <- getBlocks e\n            return $ blockQuote (contents <> attrib)\n         listitems = mapM getBlocks $ filterChildren (named \"listitem\") e\n         callouts = mapM getBlocks $ filterChildren (named \"callout\") e\n         deflistitems = mapM parseVarListEntry $ filterChildren\n                     (named \"varlistentry\") e\n         steps = mapM getBlocks $ filterChildren (named \"step\") e\n         parseVarListEntry e' = do\n                     let terms = filterChildren (named \"term\") e'\n                     let items = filterChildren (named \"listitem\") e'\n                     terms' <- mapM getInlines terms\n                     items' <- mapM getBlocks items\n                     return (mconcat $ intersperse (str \"; \") terms', items')\n         parseGlossEntry e' = do\n                     let terms = filterChildren (named \"glossterm\") e'\n                     let items = filterChildren (named \"glossdef\") e'\n                     terms' <- mapM getInlines terms\n                     items' <- mapM getBlocks items\n                     return (mconcat $ intersperse (str \"; \") terms', items')\n         parseTable = do\n                      let elId = attrValue \"id\" e\n                      let attrs = case attrValue \"tabstyle\" e of\n                                    \"\" -> []\n                                    x  -> [(\"custom-style\", x)]\n                      let classes = T.words $ attrValue \"class\" e\n                      let isCaption x = named \"title\" x || named \"caption\" x\n                      capt <- case filterChild isCaption e of\n                                    Just t  -> getInlines t\n                                    Nothing -> return mempty\n                      let e' = fromMaybe e $ filterChild (named \"tgroup\") e\n                      let isColspec x = named \"colspec\" x || named \"col\" x\n                      let colspecs = case filterChild (named \"colgroup\") e' of\n                                           Just c -> filterChildren isColspec c\n                                           _      -> filterChildren isColspec e'\n                      let colnames = case colspecs of\n                                       [] -> []\n                                       cs -> mapMaybe (findAttr (unqual \"colname\" )) cs\n                      let isRow x = named \"row\" x || named \"tr\" x\n                      headrows <- case filterChild (named \"thead\") e' of\n                                       Just h  -> mapM (parseRow colnames)\n                                                  $ filterChildren isRow h\n                                       Nothing -> return []\n                      bodyrows <- case filterChild (named \"tbody\") e' of\n                                       Just b  -> mapM (parseRow colnames)\n                                                  $ filterChildren isRow b\n                                       Nothing -> mapM (parseRow colnames)\n                                                  $ filterChildren isRow e'\n                      let toWidth c = do\n                            w <- findAttr (unqual \"colwidth\") c\n                            n <- safeRead $ \"0\" <> T.filter (\\x ->\n                                                     (x >= '0' && x <= '9')\n                                                      || x == '.') w\n                            if n > 0 then Just n else Nothing\n                      let numrows = maybe 0 maximum $ nonEmpty\n                                                    $ map length (bodyrows ++ headrows)\n                      let aligns = case colspecs of\n                                     [] -> replicate numrows AlignDefault\n                                     cs -> map toAlignment cs\n                      let parseWidth s = safeRead (T.filter (\\x -> (x >= '0' && x <= '9')\n                                                                   || x == '.') s)\n                      let textWidth = case filterChild (named \"pi-dbfo\") e of\n                                        Just d  -> case attrValue \"table-width\" d of\n                                                     \"\" -> 1.0\n                                                     w  -> fromMaybe 100.0 (parseWidth w) / 100.0\n                                        Nothing -> 1.0\n                      let widths = case colspecs of\n                                     [] -> replicate numrows ColWidthDefault\n                                     cs -> let ws = map toWidth cs\n                                           in case sequence ws of\n                                                Just ws' -> let colTot = sum ws'\n                                                                scale\n                                                                  | textWidth == 1.0 = (/ colTot)\n                                                                  | otherwise = (* (textWidth / colTot) )\n                                                            in  ColWidth . scale <$> ws'\n                                                Nothing  -> replicate numrows ColWidthDefault\n                      let toRow = Row nullAttr\n                      return $ tableWith (elId,classes,attrs)\n                                     (simpleCaption $ plain capt)\n                                     (zip aligns widths)\n                                     (TableHead nullAttr $ map toRow headrows)\n                                     [TableBody nullAttr 0 [] $ map toRow bodyrows]\n                                     (TableFoot nullAttr [])\n         sect n = sectWith(attrValue \"id\" e) [] [] n\n         sectWith elId classes attrs n = do\n           isbook <- gets dbBook\n           let n' = if isbook || n == 0 then n + 1 else n\n           headerText <- case filterChild (named \"title\") e `mplus`\n                              (filterChild (named \"info\") e >>=\n                                  filterChild (named \"title\")) of\n                            Just t  -> getInlines t\n                            Nothing -> return mempty\n           modify $ \\st -> st{ dbSectionLevel = n }\n           b <- getBlocks e\n           modify $ \\st -> st{ dbSectionLevel = n - 1 }\n           let hdr = addPandocAttributes (getRoleAttr e)\n                        $ headerWith (elId, classes, maybeToList titleabbrevElAsAttr ++ attrs)\n                                      n' headerText\n           return $ hdr <> b\n         titleabbrevElAsAttr =\n           case filterChild (named \"titleabbrev\") e `mplus`\n                (filterChild (named \"info\") e >>=\n                 filterChild (named \"titleabbrev\")) of\n             Just t  -> Just (\"titleabbrev\", strContentRecursive t)\n             Nothing -> Nothing\n         lineItems = mapM getInlines $ filterChildren (named \"line\") e\n\n         -- <title> elements can be directly nested inside an admonition block, use\n         -- it if it's there. It is unclear whether we should include the label in\n         -- the title: docbook references are ambiguous on that, and some implementations of admonitions\n         -- (e.g. asciidoctor) just use an icon in all cases. To be conservative, we don't\n         -- include the label and leave it to styling.\n         --\n         getTitle = case filterChild (named \"title\") e of\n                        Just t  -> Just <$> getInlines t\n                        Nothing -> return Nothing\n         withOptionalTitle p = do\n           mbt <- getTitle\n           b <- p\n           case mbt of\n             Nothing -> return b\n             Just t -> return $ divWith (attrValue \"id\" e, [], getRoleAttr e)\n                         (divWith (\"\", [\"title\"], []) (plain t) <> b)\n\n         -- Admonitions are parsed into a div. Following other Docbook tools that output HTML,\n         -- we parse the optional title as a div with the @title@ class, and give the\n         -- block itself a class corresponding to the admonition name.\n         parseAdmonition alwaysIncludeTitle label = do\n           mbt <- getTitle\n           -- this will ignore the title element if it is present:\n           b <- getBlocks e\n           let t = maybe mempty (divWith (\"\", [\"title\"], []) . plain)\n                        (case mbt of\n                           Nothing | alwaysIncludeTitle -> Just mempty\n                           _ -> mbt)\n           -- we also attach the label as a class, so it can be styled properly\n           return $ divWith (attrValue \"id\" e,[label],[]) (t <> b)\n\ntoAlignment :: Element -> Alignment\ntoAlignment c = case findAttr (unqual \"align\") c of\n                  Just \"left\"   -> AlignLeft\n                  Just \"right\"  -> AlignRight\n                  Just \"center\" -> AlignCenter\n                  _             -> AlignDefault\n\n\nparseMixed :: PandocMonad m => (Inlines -> Blocks) -> [Content] -> DB m Blocks\nparseMixed container conts = do\n  let (ils,rest) = break isBlockElement conts\n  ils' <- trimInlines . mconcat <$> mapM parseInline ils\n  let p = if ils' == mempty then mempty else container ils'\n  case rest of\n    [] -> return p\n    (r:rs) -> do\n      b <- parseBlock r\n      x <- parseMixed container rs\n      return $ p <> b <> x\n\nparseRow :: PandocMonad m => [Text] -> Element -> DB m [Cell]\nparseRow cn = do\n  let isEntry x = named \"entry\" x || named \"td\" x || named \"th\" x\n  mapM (parseEntry cn) . filterChildren isEntry\n\nparseEntry :: PandocMonad m => [Text] -> Element -> DB m Cell\nparseEntry cn el = do\n  let colDistance sa ea = do\n        let iStrt = elemIndex sa cn\n        let iEnd = elemIndex ea cn\n        case (iStrt, iEnd) of\n          (Just start, Just end) -> ColSpan $ end - start + 1\n          _ -> 1\n  let toColSpan en = do\n        let mStrt = findAttr (unqual \"namest\") en\n        let mEnd = findAttr (unqual \"nameend\") en\n        case (mStrt, mEnd) of\n          (Just start, Just end) -> colDistance start end\n          _ -> 1\n  let rowDistance mr = do\n        case readMaybe $ T.unpack mr :: Maybe Int of\n          Just moreRow -> RowSpan $ moreRow + 1\n          _ -> 1\n  let toRowSpan en = do\n        case findAttr (unqual \"morerows\") en of\n          Just moreRow -> rowDistance moreRow\n          _ -> 1\n  let colSpan = toColSpan el\n  let rowSpan = toRowSpan el\n  let align = toAlignment el\n  (fmap (cell align rowSpan colSpan) . parseMixed plain . elContent) el\n\ngetInlines :: PandocMonad m => Element -> DB m Inlines\ngetInlines e' = trimInlines . mconcat <$>\n                 mapM parseInline (elContent e')\n\nstrContentRecursive :: Element -> Text\nstrContentRecursive = strContent .\n  (\\e' -> e'{ elContent = map elementToStr $ elContent e' })\n\nelementToStr :: Content -> Content\nelementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing\nelementToStr x = x\n\nchildElTextAsAttr :: Text -> Element -> Maybe (Text, Text)\nchildElTextAsAttr n e = case findChild q e of\n        Nothing -> Nothing\n        Just childEl -> Just (n, strContentRecursive childEl)\n        where q = QName n (Just \"http://docbook.org/ns/docbook\") Nothing\n\nattrValueAsOptionalAttr :: Text -> Element -> Maybe (Text, Text)\nattrValueAsOptionalAttr n e = case attrValue n e of\n        \"\" -> Nothing\n        _ -> Just (n, attrValue n e)\n\nparseInline :: PandocMonad m => Content -> DB m Inlines\nparseInline (Text (CData _ s _)) = do\n  literalLayout <- gets dbLiteralLayout\n  if literalLayout\n     then do\n       let ls = T.splitOn \"\\n\" s\n       let toLiteralLine = str . T.map (\\c -> if c == ' ' then '\\xa0' else c)\n       return $ mconcat $ intersperse linebreak $ map toLiteralLine ls\n     else return $ text s\nparseInline (CRef ref) =\n  return $ text $ fromMaybe (T.toUpper ref) $ lookupEntity ref\nparseInline (Elem e) = do\n  parsedInline <- case qName (elName e) of\n        \"anchor\" -> do\n           return $ spanWith (attrValue \"id\" e, [], []) mempty\n        \"phrase\" -> do\n          let ident = attrValue \"id\" e\n          let classes = T.words $ attrValue \"role\" e\n          if ident /= \"\" || classes /= []\n            then innerInlines (spanWith (ident,classes,[]))\n            else innerInlines id\n        \"indexterm\" -> do\n          let ident = attrValue \"id\" e\n          let classes = T.words $ attrValue \"role\" e\n          let attrs =\n                -- In DocBook, <primary>, <secondary>, <tertiary>, <see>, and <seealso>\n                -- have mixed content models. However, because we're representing these\n                -- elements in Pandoc's AST as attributes of a phrase, we flatten all\n                -- the descendant content of these elements.\n                [ childElTextAsAttr \"primary\" e\n                , childElTextAsAttr \"secondary\" e\n                , childElTextAsAttr \"tertiary\" e\n                , childElTextAsAttr \"see\" e\n                , childElTextAsAttr \"seealso\" e\n                , attrValueAsOptionalAttr \"significance\" e\n                , attrValueAsOptionalAttr \"startref\" e\n                , attrValueAsOptionalAttr \"scope\" e\n                , attrValueAsOptionalAttr \"class\" e\n                -- We don't do anything with the \"pagenum\" attribute, because these only\n                -- occur within literal <index> sections, which is not supported by Pandoc,\n                -- because Pandoc has no concept of pages.\n                ]\n          return $ spanWith (ident, (\"indexterm\" : classes), (catMaybes attrs)) mempty\n        \"equation\" -> equation e displayMath\n        \"informalequation\" -> equation e displayMath\n        \"inlineequation\" -> equation e math\n        \"subscript\" -> innerInlines subscript\n        \"superscript\" -> innerInlines superscript\n        \"inlinemediaobject\" -> getMediaobject e\n        \"quote\" -> do\n            qt <- gets dbQuoteType\n            let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote\n            modify $ \\st -> st{ dbQuoteType = qt' }\n            contents <- innerInlines id\n            modify $ \\st -> st{ dbQuoteType = qt }\n            return $ if qt == SingleQuote\n                        then singleQuoted contents\n                        else doubleQuoted contents\n        \"simplelist\" -> simpleList\n        \"segmentedlist\" -> segmentedList\n        \"classname\" -> codeWithLang\n        \"code\" -> codeWithLang\n        \"citerefentry\" -> do\n             let title = maybe mempty strContent $ filterChild (named \"refentrytitle\") e\n             let manvolnum = maybe mempty (\\el -> \"(\" <> strContent el <> \")\") $ filterChild (named \"manvolnum\") e\n             return $ codeWith (\"\",[\"citerefentry\"],[]) (title <> manvolnum)\n        \"filename\" -> codeWithLang\n        \"envar\" -> codeWithLang\n        \"literal\" -> codeWithLang\n        \"computeroutput\" -> codeWithLang\n        \"prompt\" -> codeWithLang\n        \"parameter\" -> codeWithLang\n        \"option\" -> codeWithLang\n        \"optional\" -> do x <- getInlines e\n                         return $ str \"[\" <> x <> str \"]\"\n        \"replaceable\" -> do x <- getInlines e\n                            return $ str \"<\" <> x <> str \">\"\n        \"markup\" -> codeWithLang\n        \"wordasword\" -> innerInlines emph\n        \"command\" -> codeWithLang\n        \"varname\" -> codeWithLang\n        \"function\" -> codeWithLang\n        \"type\"    -> codeWithLang\n        \"symbol\"  -> codeWithLang\n        \"constant\" -> codeWithLang\n        \"userinput\" -> codeWithLang\n        \"systemitem\" -> codeWithLang\n        \"varargs\" -> return $ code \"(...)\"\n        \"keycap\" -> return (str $ strContent e)\n        \"keycombo\" -> keycombo <$>\n                         mapM parseInline (elContent e)\n        \"menuchoice\" -> menuchoice <$>\n                         mapM parseInline (\n                                        filter isGuiMenu $ elContent e)\n        \"xref\" -> do\n            content <- dbContent <$> get\n            let linkend = attrValue \"linkend\" e\n            let title = case attrValue \"endterm\" e of\n                            \"\"      -> maybe \"???\" xrefTitleByElem\n                                         (findElementById linkend content)\n                            endterm -> maybe \"???\" strContent\n                                         (findElementById endterm content)\n            return $ link (\"#\" <> linkend) \"\" (text title)\n        \"email\" -> return $ link (\"mailto:\" <> strContent e) \"\"\n                          $ str $ strContent e\n        \"uri\" -> return $ link (strContent e) \"\" $ str $ strContent e\n        \"ulink\" -> innerInlines (link (attrValue \"url\" e) \"\")\n        \"link\" -> do\n             ils <- innerInlines id\n             let href = case findAttrBy\n                               (\\case\n                                 QName \"href\" _ _ -> True\n                                 _ -> False) e of\n                               Just h -> h\n                               _      -> \"#\" <> attrValue \"linkend\" e\n             let ils' = if ils == mempty then str href else ils\n             let attr = (attrValue \"id\" e, T.words $ attrValue \"role\" e, [])\n             return $ linkWith attr href \"\" ils'\n        \"foreignphrase\" -> innerInlines emph\n        \"emphasis\" -> case attrValue \"role\" e of\n                             \"bf\"            -> innerInlines strong\n                             \"bold\"          -> innerInlines strong\n                             \"strong\"        -> innerInlines strong\n                             \"strikethrough\" -> innerInlines strikeout\n                             \"underline\"     -> innerInlines underline\n                             _               -> innerInlines emph\n        \"footnote\" -> note . mconcat <$>\n                         mapM parseBlock (elContent e)\n        \"title\" -> return mempty\n        \"affiliation\" -> skip\n        -- Note: this isn't a real docbook tag; it's what we convert\n        -- <?asciidor-br?> to in handleInstructions, above.\n        \"pi-asciidoc-br\" -> return linebreak\n        _          -> skip >> innerInlines id\n  return $ case qName (elName e) of\n    \"emphasis\" -> parsedInline\n    _ -> addPandocAttributes (getRoleAttr e) parsedInline\n   where skip = do\n           let qn = qName $ elName e\n           let name = if \"pi-\" `T.isPrefixOf` qn\n                         then \"<?\" <> qn <> \"?>\"\n                         else qn\n           lift $ report $ IgnoredElement name\n           return mempty\n\n         innerInlines f = f . mconcat <$> mapM parseInline (elContent e)\n         codeWithLang = do\n           let classes' = case attrValue \"language\" e of\n                               \"\" -> []\n                               l  -> [l]\n           return $ codeWith (attrValue \"id\" e,classes',[]) $\n             T.unwords $ T.words $ strContentRecursive e\n             -- collapse internal spaces/newlines, see #7821\n         simpleList = mconcat . intersperse (str \",\" <> space) <$> mapM getInlines\n                         (filterChildren (named \"member\") e)\n         segmentedList = do\n           tit <- maybe (return mempty) getInlines $ filterChild (named \"title\") e\n           segtits <- mapM getInlines $ filterChildren (named \"segtitle\") e\n           segitems <- mapM (mapM getInlines . filterChildren (named \"seg\"))\n                          $ filterChildren (named \"seglistitem\") e\n           let toSeg = mconcat . zipWith (\\x y -> strong (x <> str \":\") <> space <>\n                                  y <> linebreak) segtits\n           let segs = mconcat $ map toSeg segitems\n           let tit' = if tit == mempty\n                         then mempty\n                         else strong tit <> linebreak\n           return $ linebreak <> tit' <> segs\n         keycombo = spanWith (\"\",[\"keycombo\"],[]) .\n                    mconcat . intersperse (str \"+\")\n         menuchoice = spanWith (\"\",[\"menuchoice\"],[]) .\n                    mconcat . intersperse (text \" > \")\n         isGuiMenu (Elem x) = named \"guimenu\" x || named \"guisubmenu\" x ||\n                              named \"guimenuitem\" x\n         isGuiMenu _        = False\n\n         findElementById idString content\n            = asum [filterElement (\\x -> attrValue \"id\" x == idString) el | Elem el <- content]\n\n         -- Use the 'xreflabel' attribute for getting the title of a xref link;\n         -- if there's no such attribute, employ some heuristics based on what\n         -- docbook-xsl does.\n         xrefTitleByElem el\n             | not (T.null xrefLabel) = xrefLabel\n             | otherwise              = case qName (elName el) of\n                  \"book\"         -> descendantContent \"title\" el\n                  \"part\"         -> descendantContent \"title\" el\n                  \"chapter\"      -> descendantContent \"title\" el\n                  \"section\"      -> descendantContent \"title\" el\n                  \"sect1\"        -> descendantContent \"title\" el\n                  \"sect2\"        -> descendantContent \"title\" el\n                  \"sect3\"        -> descendantContent \"title\" el\n                  \"sect4\"        -> descendantContent \"title\" el\n                  \"sect5\"        -> descendantContent \"title\" el\n                  \"cmdsynopsis\"  -> descendantContent \"command\" el\n                  \"funcsynopsis\" -> descendantContent \"function\" el\n                  \"figure\"       -> descendantContent \"title\" el\n                  \"table\"        -> descendantContent \"title\" el\n                  _              -> qName (elName el) <> \"_title\"\n          where\n            xrefLabel = attrValue \"xreflabel\" el\n            descendantContent name = maybe \"???\" strContent\n                                   . filterElementName (\\n -> qName n == name)\n\n-- | Extract a math equation from an element\n--\n-- asciidoc can generate Latex math in CDATA sections.\n--\n-- Note that if some MathML can't be parsed it is silently ignored!\nequation\n  :: Monad m\n  => Element\n  -- ^ The element from which to extract a mathematical equation\n  -> (Text -> Inlines)\n  -- ^ A constructor for some Inlines, taking the TeX code as input\n  -> m Inlines\nequation e constructor =\n  return $ mconcat $ map constructor $ mathMLEquations <> latexEquations\n  where\n    mathMLEquations :: [Text]\n    mathMLEquations = map writeTeX $ rights $ readMath\n      (\\x -> qName (elName x) == \"math\" &&\n             qURI (elName x) == Just \"http://www.w3.org/1998/Math/MathML\")\n      (readMathML . showElement)\n\n    latexEquations :: [Text]\n    latexEquations = readMath (\\x -> qName (elName x) == \"mathphrase\")\n                              (T.concat . fmap showVerbatimCData . elContent)\n\n    readMath :: (Element -> Bool) -> (Element -> b) -> [b]\n    readMath childPredicate fromElement =\n      map (fromElement . everywhere (mkT removePrefix))\n      $ filterChildren childPredicate e\n\n-- | Get the actual text stored in a CData block. 'showContent'\n-- returns the text still surrounded by the [[CDATA]] tags.\nshowVerbatimCData :: Content -> Text\nshowVerbatimCData (Text (CData _ d _)) = d\nshowVerbatimCData c = showContent c\n\n\n-- | Set the prefix of a name to 'Nothing'\nremovePrefix :: QName -> QName\nremovePrefix elname = elname { qPrefix = Nothing }\n\nparaToPlain :: Block -> Block\nparaToPlain (Para ils) = Plain ils\nparaToPlain x = x\n\ndocbookEntityMap :: M.Map Text Text\ndocbookEntityMap = M.fromList\n  (map lineToPair (T.lines (decodeUtf8 docbookEntities)))\n where\n   lineToPair l =\n     case T.words l of\n       (x:ys) -> (x, T.pack (mapMaybe readHex ys))\n       [] -> (\"\",\"\")\n   readHex t = case TR.hexadecimal t of\n                 Left _ -> Nothing\n                 Right (n,_) -> Just (chr n)\n\ndocbookEntities :: ByteString\ndocbookEntities = $(embedFile \"data/docbook-entities.txt\")\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Combine.hs",
    "content": "{-# LANGUAGE OverloadedStrings    #-}\n{- |\n   Module      : Text.Pandoc.Readers.Docx.Combine\n   Copyright   : © 2014-2020 Jesse Rosenthal <jrosenthal@jhu.edu>,\n                   2014-2024 John MacFarlane <jgm@berkeley.edu>,\n                   2020 Nikolay Yakimov <root@livid.pp.ru>\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nFlatten sequences of elements.\n-}\n\n{-\nThe purpose of this module is to combine the formatting of separate\nruns, which have *non-nesting* formatting. Because the formatting\ndoesn't nest, you can't actually tell the nesting order until you\ncombine with the runs that follow.\n\nFor example, say you have a something like `<em><strong>foo</strong>\nbar</em>`. Then in ooxml, you'll get these two runs:\n\n~~~\n<w:r>\n <w:rPr>\n  <w:b />\n  <w:i />\n </w:rPr>\n <w:t>Foo</w:t>\n</w:r>\n<w:r>\n <w:rPr>\n  <w:i />\n </w:rPr>\n <w:t> Bar</w:t>\n</w:r>\n~~~\n\nNote that this is an ideal situation. In practice, it will probably be\nmore---if, for example, the user turned italics\noff and then on.\n\nSo, when you get the first run, which is marked as both bold and italic,\nyou have no idea whether it's `Strong [Emph [Str \"Foo\"]]` or `Emph\n[Strong [Str \"Foo\"]]`.\n\nWe combine two runs, then, by taking off the formatting that modifies an\ninline, seeing what is shared between them, and rebuilding an inline. We\nfold this to combine the inlines.\n\n-}\n\nmodule Text.Pandoc.Readers.Docx.Combine ( combineBlocks\n                                        , smushInlines\n                                        , smushBlocks\n                                        )\n       where\n\nimport qualified Data.List as L\nimport Data.Bifunctor\nimport Data.Sequence ( ViewL (..), ViewR (..), viewl, viewr, spanr, spanl\n                     , (><), (|>) )\nimport Text.Pandoc.Builder as B\n\ndata Modifier a = Modifier (a -> a)\n                | AttrModifier (Attr -> a -> a) Attr\n\nspaceOutInlinesL :: Inlines -> (Inlines, Inlines)\nspaceOutInlinesL ms = (l, stackInlines fs (m' <> r))\n  where (l, (fs, m'), r) = spaceOutInlines ms\n\nspaceOutInlinesR :: Inlines -> (Inlines, Inlines)\nspaceOutInlinesR ms = (stackInlines fs (l <> m'), r)\n  where (l, (fs, m'), r) = spaceOutInlines ms\n\nspaceOutInlines :: Inlines -> (Inlines, ([Modifier Inlines], Inlines), Inlines)\nspaceOutInlines ils =\n  let (fs, ils') = unstackInlines ils\n      (left, (right, contents')) = second (spanr isSpace) $ spanl isSpace $ unMany ils'\n      -- NOTE: spanr counterintuitively returns suffix as the FIRST tuple element\n  in (Many left, (fs, Many contents'), Many right)\n\nisSpace :: Inline -> Bool\nisSpace Space = True\nisSpace SoftBreak = True\nisSpace _ = False\n\nstackInlines :: [Modifier Inlines] -> Inlines -> Inlines\nstackInlines [] ms = ms\nstackInlines (Modifier f : fs) ms =\n  if null ms\n  then stackInlines fs ms\n  else f $ stackInlines fs ms\nstackInlines (AttrModifier f attr : fs) ms = f attr $ stackInlines fs ms\n\nunstackInlines :: Inlines -> ([Modifier Inlines], Inlines)\nunstackInlines ms = case ilModifierAndInnards ms of\n  Nothing         -> ([], ms)\n  Just (f, inner) -> first (f :) $ unstackInlines inner\n\nilModifierAndInnards :: Inlines -> Maybe (Modifier Inlines, Inlines)\nilModifierAndInnards ils = case viewl $ unMany ils of\n  x :< xs | null xs -> second fromList <$> case x of\n    Emph lst          -> Just (Modifier emph, lst)\n    Strong lst        -> Just (Modifier strong, lst)\n    SmallCaps lst     -> Just (Modifier smallcaps, lst)\n    Strikeout lst     -> Just (Modifier strikeout, lst)\n    Underline lst     -> Just (Modifier underline, lst)\n    Superscript lst   -> Just (Modifier superscript, lst)\n    Subscript lst     -> Just (Modifier subscript, lst)\n    Link attr lst tgt -> Just (Modifier $ uncurry (linkWith attr) tgt, lst)\n    Span attr lst     -> Just (AttrModifier spanWith attr, lst)\n    _                 -> Nothing\n  _ -> Nothing\n\ninlinesL :: Inlines -> (Inlines, Inlines)\ninlinesL ils = case viewl $ unMany ils of\n  (s :< sq) -> (B.singleton s, Many sq)\n  _         -> (mempty, ils)\n\ninlinesR :: Inlines -> (Inlines, Inlines)\ninlinesR ils = case viewr $ unMany ils of\n  (sq :> s) -> (Many sq, B.singleton s)\n  _         -> (ils, mempty)\n\ncombineInlines :: Inlines -> Inlines -> Inlines\ncombineInlines x y =\n  let (xs', x') = inlinesR x\n      (y', ys') = inlinesL y\n  in\n   xs' <> combineSingletonInlines x' y' <> ys'\n\ncombineSingletonInlines :: Inlines -> Inlines -> Inlines\ncombineSingletonInlines x y =\n  let (xfs, xs) = unstackInlines x\n      (yfs, ys) = unstackInlines y\n      shared = xfs `L.intersect` yfs\n      x_remaining = xfs L.\\\\ shared\n      y_remaining = yfs L.\\\\ shared\n      x_rem_attr = filter isAttrModifier x_remaining\n      y_rem_attr = filter isAttrModifier y_remaining\n  in\n   case null shared of\n     True | null xs && null ys ->\n            stackInlines (x_rem_attr <> y_rem_attr) mempty\n          | null xs ->\n            let (sp, y') = spaceOutInlinesL y in\n            stackInlines x_rem_attr mempty <> sp <> y'\n          | null ys ->\n            let (x', sp) = spaceOutInlinesR x in\n            x' <> sp <> stackInlines y_rem_attr mempty\n          | otherwise ->\n              let (x', xsp) = spaceOutInlinesR x\n                  (ysp, y') = spaceOutInlinesL y\n              in\n               x' <> xsp <> ysp <> y'\n     False -> stackInlines shared $\n              combineInlines\n              (stackInlines x_remaining xs)\n              (stackInlines y_remaining ys)\n\ncombineBlocks :: Blocks -> Blocks -> Blocks\ncombineBlocks bs cs\n  | bs' :> BlockQuote bs'' <- viewr (unMany bs)\n  , BlockQuote cs'' :< cs' <- viewl (unMany cs) =\n      Many $ (bs' |> BlockQuote (bs'' <> cs'')) >< cs'\n  | bs' :> CodeBlock attr codeStr <- viewr (unMany bs)\n  , CodeBlock attr' codeStr' :< cs' <- viewl (unMany cs)\n  , attr == attr' =\n      Many $ (bs' |> CodeBlock attr (codeStr <> \"\\n\" <> codeStr')) >< cs'\ncombineBlocks bs cs = bs <> cs\n\ninstance (Monoid a, Eq a) => Eq (Modifier a) where\n  (Modifier f) == (Modifier g) = f mempty == g mempty\n  (AttrModifier f attr) == (AttrModifier g attr') = f attr mempty == g attr' mempty\n  _ == _ = False\n\nisAttrModifier :: Modifier a -> Bool\nisAttrModifier (AttrModifier _ _) = True\nisAttrModifier _                  = False\n\nsmushInlines :: [Inlines] -> Inlines\nsmushInlines xs = combineInlines xs' mempty\n  where xs' = L.foldl' combineInlines mempty xs\n\nsmushBlocks :: [Blocks] -> Blocks\nsmushBlocks xs = L.foldl' combineBlocks mempty xs\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Fields.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Docx.Fields\n   Copyright   : Copyright (C) 2014-2020 Jesse Rosenthal\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nFor parsing Field definitions in instText tags, as described in\nECMA-376-1:2016, §17.16.5 -}\n\nmodule Text.Pandoc.Readers.Docx.Fields ( FieldInfo(..)\n                                       , IndexEntry(..)\n                                       , parseFieldInfo\n                                       ) where\n\nimport Data.Functor (($>), void)\nimport qualified Data.Text as T\nimport Text.Pandoc.Parsing\nimport Data.Maybe (isJust)\n\ntype URL = T.Text\ntype Anchor = T.Text\n\ndata IndexEntry = IndexEntry\n  { entryTitle :: T.Text\n  , entrySee :: Maybe T.Text\n  , entryYomi :: Maybe T.Text\n  , entryBold :: Bool\n  , entryItalic :: Bool }\n  deriving (Show)\n\ndata FieldInfo = HyperlinkField URL\n                -- The boolean indicates whether the field is a hyperlink.\n               | PagerefField Anchor Bool\n               | CrossrefField Anchor Bool\n               | IndexrefField IndexEntry\n               | CslCitation T.Text\n               | CslBibliography\n               | EndNoteCite T.Text\n               | EndNoteRefList\n               | UnknownField\n               deriving (Show)\n\ntype Parser = Parsec T.Text ()\n\nparseFieldInfo :: T.Text -> Either ParseError FieldInfo\nparseFieldInfo = parse fieldInfo \"\"\n\nfieldInfo :: Parser FieldInfo\nfieldInfo = do\n  spaces\n  hyperlink\n    <|>\n    pageref\n    <|>\n    indexref\n    <|>\n    crossref\n    <|>\n    addIn\n    <|>\n    return UnknownField\n\naddIn :: Parser FieldInfo\naddIn = do\n  string \"ADDIN\"\n  spaces\n  try cslCitation <|> cslBibliography <|> endnoteCite <|> endnoteRefList\n\ncslCitation :: Parser FieldInfo\ncslCitation = do\n  optional (string \"ZOTERO_ITEM\" *> spaces)\n  string \"CSL_CITATION\"\n  spaces\n  CslCitation <$> getInput\n\ncslBibliography :: Parser FieldInfo\ncslBibliography = do\n  string \"ZOTERO_BIBL\" <|> string \"Mendeley Bibliography CSL_BIBLIOGRAPHY\"\n  return CslBibliography\n\nendnoteCite :: Parser FieldInfo\nendnoteCite = try $ do\n  string \"EN.CITE\"\n  spaces\n  EndNoteCite <$> getInput\n\nendnoteRefList :: Parser FieldInfo\nendnoteRefList = try $ do\n  string \"EN.REFLIST\"\n  return EndNoteRefList\n\n\nescapedQuote :: Parser T.Text\nescapedQuote = string \"\\\\\\\"\" $> \"\\\\\\\"\"\n\ninQuotes :: Parser T.Text\ninQuotes =\n  try escapedQuote <|> (T.singleton <$> anyChar)\n\nquotedString :: Parser T.Text\nquotedString = do\n  char '\"'\n  T.concat <$> manyTill inQuotes (try (char '\"'))\n\nunquotedString :: Parser T.Text\nunquotedString = T.pack <$> manyTill anyChar (try $ void (lookAhead space) <|> eof)\n\nfieldArgument :: Parser T.Text\nfieldArgument = do\n  notFollowedBy (char '\\\\') -- switch\n  quotedString <|> unquotedString\n\nhyperlink :: Parser FieldInfo\nhyperlink = do\n  string \"HYPERLINK\"\n  spaces\n  farg <- option \"\" $ notFollowedBy (char '\\\\') *> fieldArgument\n  switches <- many fieldSwitch\n  let url = case [s | ('l',s) <- switches] of\n              [s] -> farg <> \"#\" <> s\n              _   -> farg\n  return $ HyperlinkField url\n\n-- See §17.16.5.45\nfieldSwitch :: Parser (Char, T.Text)\nfieldSwitch = try $ do\n  spaces\n  char '\\\\'\n  c <- anyChar\n  spaces\n  farg <- option mempty fieldArgument\n  return (c, farg)\n\npageref :: Parser FieldInfo\npageref = do\n  string \"PAGEREF\"\n  spaces\n  farg <- fieldArgument\n  switches <- many fieldSwitch\n  let isLink = any ((== 'h') . fst) switches\n  return $ PagerefField farg isLink\n\ncrossref :: Parser FieldInfo\ncrossref = do\n  string \"REF\"\n  spaces\n  farg <- fieldArgument\n  switches <- many fieldSwitch\n  let isLink = any ((== 'h') . fst) switches\n  return $ CrossrefField farg isLink\n\n-- second element of tuple is optional \"see\".\nindexref :: Parser FieldInfo\nindexref = do\n  string \"XE\"\n  spaces\n  farg <- fieldArgument\n  switches <- spaces *> many fieldSwitch\n  return $ IndexrefField $ IndexEntry{ entryTitle = farg\n                                     , entrySee = lookup 't' switches\n                                     , entryYomi = lookup 'y' switches\n                                     , entryBold = isJust (lookup 'b' switches)\n                                     , entryItalic = isJust (lookup 'i' switches) }\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Lists.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Docx.Lists\n   Copyright   : Copyright (C) 2014-2020 Jesse Rosenthal\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions for converting flat docx paragraphs into nested lists.\n-}\n\nmodule Text.Pandoc.Readers.Docx.Lists ( blocksToBullets\n                                      , blocksToDefinitions\n                                      , listParagraphDivs\n                                      , listParagraphStyles\n                                      ) where\n\nimport Data.List\nimport Data.Char (isDigit)\nimport Data.Maybe\nimport Data.String (fromString)\nimport qualified Data.Text as T\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.JSON\nimport Text.Pandoc.Readers.Docx.Parse (ParaStyleName)\nimport Text.Pandoc.Shared (trim, safeRead)\n\nisListItem :: Block -> Bool\nisListItem (Div (_, classes, _) _) | \"list-item\" `elem` classes = True\nisListItem _                       = False\n\ngetLevel :: Block -> Maybe Integer\ngetLevel (Div (_, _, kvs) _) =  lookup \"level\" kvs >>= safeRead\ngetLevel _                   = Nothing\n\ngetLevelN :: Block -> Integer\ngetLevelN b = fromMaybe (-1) (getLevel b)\n\ngetNumId :: Block -> Maybe Integer\ngetNumId (Div (_, _, kvs) _) =  lookup \"num-id\" kvs >>= safeRead\ngetNumId _                   = Nothing\n\ngetNumIdN :: Block -> Integer\ngetNumIdN b = fromMaybe (-1) (getNumId b)\n\ngetText :: Block -> Maybe T.Text\ngetText (Div (_, _, kvs) _) = lookup \"text\" kvs\ngetText _                   = Nothing\n\ndata ListType = Itemized | Enumerated ListAttributes\n\nlistStyleMap :: [(T.Text, ListNumberStyle)]\nlistStyleMap = [(\"upperLetter\", UpperAlpha),\n                (\"lowerLetter\", LowerAlpha),\n                (\"upperRoman\", UpperRoman),\n                (\"lowerRoman\", LowerRoman),\n                (\"decimal\", Decimal)]\n\nlistDelimMap :: [(T.Text, ListNumberDelim)]\nlistDelimMap = [(\"%)\", OneParen),\n                (\"(%)\", TwoParens),\n                (\"%.\", Period)]\n\ngetListType :: Block -> Maybe ListType\ngetListType b@(Div (_, _, kvs) _) | isListItem b =\n  let\n    start = lookup \"start\" kvs\n    frmt = lookup \"format\" kvs\n    txt  = lookup \"text\" kvs\n  in\n   case frmt of\n     Just \"bullet\" -> Just Itemized\n     Just f        ->\n       case T.filter (not . isDigit) <$> txt of\n         Just t -> Just $ Enumerated (\n                  fromMaybe 1 (start >>= safeRead) :: Int,\n                  fromMaybe DefaultStyle (lookup f listStyleMap),\n                  fromMaybe DefaultDelim (lookup t listDelimMap))\n         Nothing -> Nothing\n     _ -> Nothing\ngetListType _ = Nothing\n\nlistParagraphDivs :: [T.Text]\nlistParagraphDivs = [\"list-paragraph\"]\n\nlistParagraphStyles :: [ParaStyleName]\nlistParagraphStyles = map (fromString . T.unpack) listParagraphDivs\n\n-- This is a first stab at going through and attaching meaning to list\n-- paragraphs, without an item marker, following a list item. We\n-- assume that these are paragraphs in the same item.\n\nhandleListParagraphs :: [Block] -> [Block]\nhandleListParagraphs [] = []\nhandleListParagraphs (\n  Div attr1@(_, classes1, _) blks1 :\n  Div (ident2, classes2, kvs2) blks2 :\n  blks\n  ) | \"list-item\" `elem` classes1 &&\n    notElem \"list-item\" classes2 &&\n    (not . null) (listParagraphDivs `intersect` classes2) =\n      -- We don't want to keep this indent.\n      let newDiv2 =\n            Div (ident2, classes2, filter (\\kv -> fst kv /= \"indent\") kvs2) blks2\n      in\n       handleListParagraphs (Div attr1 (blks1 ++ [newDiv2]) : blks)\nhandleListParagraphs (blk:blks) = blk : handleListParagraphs blks\n\nseparateBlocks' :: Block -> [[Block]] -> [[Block]]\nseparateBlocks' blk [[]] = [[blk]]\nseparateBlocks' b@(BulletList _) acc = init acc ++ [last acc ++ [b]]\nseparateBlocks' b@(OrderedList _ _) acc = init acc ++ [last acc ++ [b]]\n-- The following is for the invisible bullet lists. This is how\n-- pandoc-generated ooxml does multiparagraph item lists.\nseparateBlocks' b acc | fmap trim (getText b) == Just \"\" =\n  init acc ++ [last acc ++ [b]]\nseparateBlocks' b acc = acc ++ [[b]]\n\nseparateBlocks :: [Block] -> [[Block]]\nseparateBlocks blks = foldr separateBlocks' [[]] (reverse blks)\n\nflatToBullets' :: Integer -> [Block] -> [Block]\nflatToBullets' _ [] = []\nflatToBullets' num xs@(b : elems) =\n  if getLevelN b == num\n     then (case bCheckmark of\n             Just checked -> addCheckmark checked b\n             Nothing -> b) : flatToBullets' num elems\n     else case getListType b of\n            Just (Enumerated attr) ->\n              OrderedList attr (separateBlocks $ flatToBullets' bLevel children) :\n              flatToBullets' num remaining\n            _ ->\n              BulletList (separateBlocks $ flatToBullets' bLevel children) :\n              flatToBullets' num remaining\n where\n  bNumId = getNumIdN b\n  bLevel = getLevelN b\n  isCheckmark (Just \"\\9744\") = Just False\n  isCheckmark (Just \"\\9746\") = Just True\n  isCheckmark _ = Nothing\n  bCheckmark =\n    case getListType b of\n      Just Itemized -> isCheckmark (getText b)\n      _ -> Nothing\n  addCheckmark checked (Div attrs [Para ils]) =\n    Div attrs [Para (Str (if checked then \"\\9746\" else \"\\9744\") : Space : ils)]\n  addCheckmark checked (Div attrs [Plain ils]) =\n    Div attrs [Plain (Str (if checked then \"\\9746\" else \"\\9744\") : Space : ils)]\n  addCheckmark _ x = x\n  (children, remaining) =\n    span\n    (\\b' ->\n      getLevelN b' > bLevel ||\n       (getLevelN b' == bLevel &&\n          (getNumIdN b' == bNumId ||\n            (case bCheckmark of\n               Just _ ->\n                 case getText b' of\n                   Just \"\" -> True\n                   Just \" \" -> True\n                   Just x -> isJust (isCheckmark (Just x))\n                   Nothing -> False\n               Nothing -> False))))\n    xs\n\nflatToBullets :: [Block] -> [Block]\nflatToBullets elems = flatToBullets' (-1) elems\n\nsingleItemHeaderToHeader :: Block -> Block\nsingleItemHeaderToHeader (OrderedList _ [[h@Header{}]]) = h\nsingleItemHeaderToHeader blk                            = blk\n\n\nblocksToBullets :: [Block] -> [Block]\nblocksToBullets blks =\n  map singleItemHeaderToHeader $\n  walk removeListDivs $ flatToBullets (handleListParagraphs blks)\n\nplainParaInlines :: Block -> [Inline]\nplainParaInlines (Plain ils) = ils\nplainParaInlines (Para ils)  = ils\nplainParaInlines _           = []\n\nblocksToDefinitions' :: [([Inline], [[Block]])] -> [Block] -> [Block] -> [Block]\nblocksToDefinitions' []     acc [] = reverse acc\nblocksToDefinitions' defAcc acc [] =\n  reverse $ DefinitionList (reverse defAcc) : acc\nblocksToDefinitions' defAcc acc\n  (Div (_, classes1, _) blks1 : Div (ident2, classes2, kvs2) blks2 : blks)\n  | \"Definition-Term\" `elem` classes1 && \"Definition\"  `elem` classes2 =\n    let remainingAttr2 = (ident2, delete \"Definition\" classes2, kvs2)\n        pair = if remainingAttr2 == (\"\", [], []) then (concatMap plainParaInlines blks1, [blks2]) else (concatMap plainParaInlines blks1, [[Div remainingAttr2 blks2]])\n    in\n     blocksToDefinitions' (pair : defAcc) acc blks\nblocksToDefinitions' ((defTerm, defItems):defs) acc\n  (Div (ident2, classes2, kvs2) blks2 : blks)\n  | \"Definition\"  `elem` classes2 =\n    let remainingAttr2 = (ident2, delete \"Definition\" classes2, kvs2)\n        defItems2 = if remainingAttr2 == (\"\", [], [])\n          then blks2\n          else [Div remainingAttr2 blks2]\n        defAcc' = if null defItems\n          then (defTerm, [defItems2]) : defs\n          else (defTerm, init defItems ++ [last defItems ++ defItems2]) : defs\n    in\n     blocksToDefinitions' defAcc' acc blks\nblocksToDefinitions' [] acc (b:blks) =\n  blocksToDefinitions' [] (b:acc) blks\nblocksToDefinitions' defAcc acc (b:blks) =\n  blocksToDefinitions' [] (b : DefinitionList (reverse defAcc) : acc) blks\n\nremoveListDivs' :: Block -> [Block]\nremoveListDivs' (Div (ident, classes, kvs) blks)\n  | \"list-item\" `elem` classes =\n    case delete \"list-item\" classes of\n      []       -> blks\n      classes' -> [Div (ident, classes', kvs) blks]\nremoveListDivs' (Div (ident, classes, kvs) blks)\n  | not $ null $ listParagraphDivs `intersect` classes =\n    case classes \\\\ listParagraphDivs of\n      []       -> blks\n      classes' -> [Div (ident, classes', kvs) blks]\nremoveListDivs' blk = [blk]\n\nremoveListDivs :: [Block] -> [Block]\nremoveListDivs = concatMap removeListDivs'\n\nblocksToDefinitions :: [Block] -> [Block]\nblocksToDefinitions = blocksToDefinitions' [] []\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Parse/Styles.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE TypeFamilies      #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n Module : Text.Pandoc.Readers.Docx.Parse.Styles\n Copyright : Copyright (C) 2014-2020 Jesse Rosenthal\n                           2019 Nikolay Yakimov <root@livid.pp.ru>\n License : GNU GPL, version 2 or above\n\n Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>\n Stability : alpha\n Portability : portable\n\nType machinery and code for extraction and manipulation of docx styles\n-}\n\nmodule Text.Pandoc.Readers.Docx.Parse.Styles (\n    CharStyleId(..)\n  , CharStyle\n  , ParaStyleId(..)\n  , ParStyle(..)\n  , ParIndentation(..)\n  , RunStyle(..)\n  , HasStyleName\n  , StyleName\n  , ParaStyleName\n  , CharStyleName\n  , FromStyleName\n  , VertAlign(..)\n  , StyleId\n  , HasStyleId\n  , archiveToStyles'\n  , getStyleId\n  , getStyleName\n  , cStyleData\n  , fromStyleName\n  , fromStyleId\n  , stringToInteger\n  , getIndentation\n  , getNumInfo\n  , elemToRunStyle\n  , defaultRunStyle\n  , checkOnOff\n  ) where\nimport Codec.Archive.Zip\nimport Control.Applicative ((<|>))\nimport Data.Function (on)\nimport Data.String (IsString(..))\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport qualified Data.Text.Read\nimport Data.Text (Text)\nimport Data.Maybe\nimport Data.Coerce\nimport Text.Pandoc.Readers.Docx.Util\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.XML.Light\n\nnewtype CharStyleId   = CharStyleId T.Text\n  deriving (Show, Eq, Ord, IsString, FromStyleId)\nnewtype ParaStyleId   = ParaStyleId T.Text\n  deriving (Show, Eq, Ord, IsString, FromStyleId)\n\nnewtype CharStyleName = CharStyleName CIString\n  deriving (Show, Eq, Ord, IsString, FromStyleName)\nnewtype ParaStyleName = ParaStyleName CIString\n  deriving (Show, Eq, Ord, IsString, FromStyleName)\n\n-- Case-insensitive comparisons\nnewtype CIString = CIString T.Text deriving (Show, IsString, FromStyleName)\n\nclass FromStyleName a where\n  fromStyleName :: a -> T.Text\n\ninstance FromStyleName String where\n  fromStyleName = T.pack\n\ninstance FromStyleName T.Text where\n  fromStyleName = id\n\nclass FromStyleId a where\n  fromStyleId :: a -> T.Text\n\ninstance FromStyleId String where\n  fromStyleId = T.pack\n\ninstance FromStyleId T.Text where\n  fromStyleId = id\n\ninstance Eq CIString where\n   (==) = (==) `on` T.toCaseFold . coerce\n\ninstance Ord CIString where\n  compare = compare `on` T.toCaseFold . coerce\n\ndata VertAlign = BaseLn | SupScrpt | SubScrpt\n               deriving Show\n\ndata CharStyle = CharStyle { cStyleId   :: CharStyleId\n                           , cStyleName :: CharStyleName\n                           , cStyleData :: RunStyle\n                           } deriving (Show)\n\ndata RunStyle = RunStyle { isBold       :: Maybe Bool\n                         , isBoldCTL    :: Maybe Bool\n                         , isItalic     :: Maybe Bool\n                         , isItalicCTL  :: Maybe Bool\n                         , isSmallCaps  :: Maybe Bool\n                         , isStrike     :: Maybe Bool\n                         , isRTL        :: Maybe Bool\n                         , isForceCTL   :: Maybe Bool\n                         , rHighlight   :: Maybe Text\n                         , rVertAlign   :: Maybe VertAlign\n                         , rUnderline   :: Maybe Text\n                         , rParentStyle :: Maybe CharStyle\n                         }\n                deriving Show\n\ndata ParIndentation = ParIndentation { leftParIndent    :: Maybe Integer\n                                     , rightParIndent   :: Maybe Integer\n                                     , hangingParIndent :: Maybe Integer}\n                      deriving Show\n\ndata ParStyle = ParStyle { headingLev    :: Maybe (ParaStyleName, Int)\n                         , indent        :: Maybe ParIndentation\n                         , numInfo       :: Maybe (T.Text, T.Text)\n                         , psParentStyle :: Maybe ParStyle\n                         , pStyleName    :: ParaStyleName\n                         , pStyleId      :: ParaStyleId\n                         }\n                    deriving Show\n\ndefaultRunStyle :: RunStyle\ndefaultRunStyle = RunStyle { isBold = Nothing\n                           , isBoldCTL = Nothing\n                           , isItalic = Nothing\n                           , isItalicCTL = Nothing\n                           , isSmallCaps = Nothing\n                           , isStrike = Nothing\n                           , isRTL = Nothing\n                           , isForceCTL = Nothing\n                           , rHighlight = Nothing\n                           , rVertAlign = Nothing\n                           , rUnderline = Nothing\n                           , rParentStyle = Nothing\n                           }\n\narchiveToStyles'\n  :: (Ord k1, Ord k2, ElemToStyle a1, ElemToStyle a2)\n  => (a1 -> k1) -> (a2 -> k2) -> Archive -> (M.Map k1 a1, M.Map k2 a2)\narchiveToStyles' conv1 conv2 zf =\n  case findEntryByPath \"word/styles.xml\" zf of\n    Nothing -> (M.empty, M.empty)\n    Just entry ->\n      case parseXMLElement . UTF8.toTextLazy . fromEntry $ entry of\n        Left _ -> (M.empty, M.empty)\n        Right styElem ->\n          let namespaces = elemToNameSpaces styElem\n          in\n           ( M.fromList $ map (\\r -> (conv1 r, r)) $\n               buildBasedOnList namespaces styElem Nothing,\n             M.fromList $ map (\\p -> (conv2 p, p)) $\n               buildBasedOnList namespaces styElem Nothing)\n\nisBasedOnStyle :: (ElemToStyle a, FromStyleId (StyleId a)) => NameSpaces -> Element -> Maybe a -> Bool\nisBasedOnStyle ns element parentStyle\n  | isElem ns \"w\" \"style\" element\n  , Just styleType <- findAttrByName ns \"w\" \"type\" element\n  , styleType == cStyleType parentStyle\n  , Just basedOnVal <- findChildByName ns \"w\" \"basedOn\" element >>=\n                       findAttrByName ns \"w\" \"val\"\n  , Just ps <- parentStyle = basedOnVal == fromStyleId (getStyleId ps)\n  | isElem ns \"w\" \"style\" element\n  , Just styleType <- findAttrByName ns \"w\" \"type\" element\n  , styleType == cStyleType parentStyle\n  , Nothing <- findChildByName ns \"w\" \"basedOn\" element\n  , Nothing <- parentStyle = True\n  | otherwise = False\n\nclass HasStyleId a => ElemToStyle a where\n  cStyleType  :: Maybe a -> Text\n  elemToStyle :: NameSpaces -> Element -> Maybe a -> Maybe a\n\nclass FromStyleId (StyleId a) => HasStyleId a where\n  type StyleId a\n  getStyleId :: a -> StyleId a\n\nclass FromStyleName (StyleName a) => HasStyleName a where\n  type StyleName a\n  getStyleName :: a -> StyleName a\n\ninstance ElemToStyle CharStyle where\n  cStyleType _ = \"character\"\n  elemToStyle ns element parentStyle\n    | isElem ns \"w\" \"style\" element\n    , Just \"character\" <- findAttrByName ns \"w\" \"type\" element =\n      elemToCharStyle ns element parentStyle\n    | otherwise = Nothing\n\ninstance HasStyleId CharStyle where\n  type StyleId CharStyle = CharStyleId\n  getStyleId = cStyleId\n\ninstance HasStyleName CharStyle where\n  type StyleName CharStyle = CharStyleName\n  getStyleName = cStyleName\n\ninstance ElemToStyle ParStyle where\n  cStyleType _ = \"paragraph\"\n  elemToStyle ns element parentStyle\n    | isElem ns \"w\" \"style\" element\n    , Just \"paragraph\" <- findAttrByName ns \"w\" \"type\" element\n    = elemToParStyleData ns element parentStyle\n    | otherwise = Nothing\n\ninstance HasStyleId ParStyle where\n  type StyleId ParStyle = ParaStyleId\n  getStyleId = pStyleId\n\ninstance HasStyleName ParStyle where\n  type StyleName ParStyle = ParaStyleName\n  getStyleName = pStyleName\n\ngetStyleChildren :: (ElemToStyle a) => NameSpaces -> Element -> Maybe a -> [a]\ngetStyleChildren ns element parentStyle\n  | isElem ns \"w\" \"styles\" element =\n    mapMaybe (\\e -> elemToStyle ns e parentStyle) $\n    filterChildren (\\e' -> isBasedOnStyle ns e' parentStyle) element\n  | otherwise = []\n\nbuildBasedOnList :: (ElemToStyle a) => NameSpaces -> Element -> Maybe a -> [a]\nbuildBasedOnList ns element rootStyle =\n  case getStyleChildren ns element rootStyle of\n    [] -> []\n    stys -> stys ++\n            concatMap (buildBasedOnList ns element . Just) stys\n\nstringToInteger :: Text -> Maybe Integer\nstringToInteger s = case Data.Text.Read.decimal s of\n                      Right (x,t) | T.null t -> Just x\n                      _                      -> Nothing\n\ncheckOnOff :: NameSpaces -> Element -> QName -> Maybe Bool\ncheckOnOff ns rPr tag\n  | Just t <-  findChild tag rPr\n  , Just val <- findAttrByName ns \"w\" \"val\" t =\n    Just $ case val of\n      \"true\"  -> True\n      \"false\" -> False\n      \"on\"    -> True\n      \"off\"   -> False\n      \"1\"     -> True\n      \"0\"     -> False\n      _       -> False\n  | Just _ <- findChild tag rPr = Just True\ncheckOnOff _ _ _ = Nothing\n\nelemToCharStyle :: NameSpaces\n                -> Element -> Maybe CharStyle -> Maybe CharStyle\nelemToCharStyle ns element parentStyle\n  = CharStyle <$> (CharStyleId <$> findAttrByName ns \"w\" \"styleId\" element)\n              <*> getElementStyleName ns element\n              <*> Just (elemToRunStyle ns element parentStyle)\n\nelemToRunStyle :: NameSpaces -> Element -> Maybe CharStyle -> RunStyle\nelemToRunStyle ns element parentStyle\n  | Just rPr <- findChildByName ns \"w\" \"rPr\" element =\n    RunStyle\n      {\n        isBold = checkOnOff ns rPr (elemName ns \"w\" \"b\")\n      , isBoldCTL = checkOnOff ns rPr (elemName ns \"w\" \"bCs\")\n      , isItalic = checkOnOff ns rPr (elemName ns \"w\" \"i\")\n      , isItalicCTL = checkOnOff ns rPr (elemName ns \"w\" \"iCs\")\n      , isSmallCaps = checkOnOff ns rPr (elemName ns \"w\" \"smallCaps\")\n      , isStrike = checkOnOff ns rPr (elemName ns \"w\" \"strike\")\n      , isRTL = checkOnOff ns rPr (elemName ns \"w\" \"rtl\")\n      , isForceCTL = checkOnOff ns rPr (elemName ns \"w\" \"cs\")\n      , rHighlight =\n          findChildByName ns \"w\" \"highlight\" rPr >>=\n            findAttrByName ns \"w\" \"val\"\n      , rVertAlign =\n           findChildByName ns \"w\" \"vertAlign\" rPr >>=\n           findAttrByName ns \"w\" \"val\" >>=\n           \\v -> Just $ case v of\n             \"superscript\" -> SupScrpt\n             \"subscript\"   -> SubScrpt\n             _             -> BaseLn\n      , rUnderline =\n          findChildByName ns \"w\" \"u\" rPr >>=\n          findAttrByName ns \"w\" \"val\"\n      , rParentStyle = parentStyle\n      }\nelemToRunStyle _ _ _ = defaultRunStyle\n\ngetHeaderLevel :: NameSpaces -> Element -> Maybe (ParaStyleName, Int)\ngetHeaderLevel ns element\n  | Just styleName <- getElementStyleName ns element\n  , Just n <- stringToInteger =<<\n              (T.stripPrefix \"heading \" . T.toLower $\n                fromStyleName styleName)\n  , n > 0 = Just (styleName, fromInteger n)\ngetHeaderLevel _ _ = Nothing\n\ngetIndentation :: NameSpaces -> Element -> Maybe ParIndentation\ngetIndentation ns el = do\n  indElement <- findChildByName ns \"w\" \"pPr\" el >>=\n                findChildByName ns \"w\" \"ind\"\n  return $ ParIndentation\n    {\n      leftParIndent = findAttrByName ns \"w\" \"left\" indElement <|>\n                      findAttrByName ns \"w\" \"start\" indElement >>=\n                      stringToInteger\n    , rightParIndent = findAttrByName ns \"w\" \"right\" indElement <|>\n                       findAttrByName ns \"w\" \"end\" indElement >>=\n                       stringToInteger\n    , hangingParIndent = findAttrByName ns \"w\" \"hanging\" indElement >>=\n                         stringToInteger\n    }\n\ngetElementStyleName :: Coercible T.Text a => NameSpaces -> Element -> Maybe a\ngetElementStyleName ns el = coerce <$>\n  ((findChildByName ns \"w\" \"name\" el >>= findAttrByName ns \"w\" \"val\")\n  <|> findAttrByName ns \"w\" \"styleId\" el)\n\ngetNumInfo :: NameSpaces -> Element -> Maybe (T.Text, T.Text)\ngetNumInfo ns element = do\n  let numPr = findChildByName ns \"w\" \"pPr\" element >>=\n              findChildByName ns \"w\" \"numPr\"\n      lvl = fromMaybe \"0\" (numPr >>=\n                           findChildByName ns \"w\" \"ilvl\" >>=\n                           findAttrByName ns \"w\" \"val\")\n  numId <- numPr >>=\n           findChildByName ns \"w\" \"numId\" >>=\n           findAttrByName ns \"w\" \"val\"\n  return (numId, lvl)\n\nelemToParStyleData :: NameSpaces -> Element -> Maybe ParStyle -> Maybe ParStyle\nelemToParStyleData ns element parentStyle\n  | Just styleId <- findAttrByName ns \"w\" \"styleId\" element\n  , Just styleName <- getElementStyleName ns element\n  = Just $ ParStyle\n      {\n        headingLev = getHeaderLevel ns element\n      , indent = getIndentation ns element\n      , numInfo = getNumInfo ns element\n      , psParentStyle = parentStyle\n      , pStyleName = styleName\n      , pStyleId = ParaStyleId styleId\n      }\nelemToParStyleData _ _ _ = Nothing\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Parse.hs",
    "content": "{-# LANGUAGE TupleSections     #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n Module : Text.Pandoc.Readers.Docx.Parse\n Copyright : Copyright (C) 2014-2020 Jesse Rosenthal\n                           2019 Nikolay Yakimov <root@livid.pp.ru>\n License : GNU GPL, version 2 or above\n\n Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>\n Stability : alpha\n Portability : portable\n\nConversion of docx archive into Docx haskell type\n-}\n\nmodule Text.Pandoc.Readers.Docx.Parse ( Docx(..)\n                                      , Document(..)\n                                      , Body(..)\n                                      , BodyPart(..)\n                                      , TblLook(..)\n                                      , Extent\n                                      , ParPart(..)\n                                      , Run(..)\n                                      , RunElem(..)\n                                      , Notes\n                                      , Numbering\n                                      , Relationship\n                                      , Media\n                                      , RunStyle(..)\n                                      , VertAlign(..)\n                                      , ParIndentation(..)\n                                      , Justification(..)\n                                      , ParagraphStyle(..)\n                                      , ParStyle\n                                      , CharStyle(cStyleData)\n                                      , Row(..)\n                                      , TblHeader(..)\n                                      , Align(..)\n                                      , Cell(..)\n                                      , VMerge(..)\n                                      , TrackedChange(..)\n                                      , ChangeType(..)\n                                      , ChangeInfo(..)\n                                      , FieldInfo(..)\n                                      , IndexEntry(..)\n                                      , Level(..)\n                                      , ParaStyleName\n                                      , CharStyleName\n                                      , FromStyleName(..)\n                                      , HasStyleName(..)\n                                      , HasParentStyle(..)\n                                      , archiveToDocx\n                                      , archiveToDocxWithWarnings\n                                      , getStyleNames\n                                      , pHeading\n                                      , pStyleIndentation\n                                      , constructBogusParStyleData\n                                      , leftBiasedMergeRunStyle\n                                      , rowsToRowspans\n                                      , extractTarget\n                                      ) where\nimport Text.Pandoc.Readers.Docx.Parse.Styles\nimport Codec.Archive.Zip\nimport Control.Applicative ((<|>))\nimport Control.Monad\nimport Control.Monad.Except\nimport Control.Monad.Reader\nimport Control.Monad.State.Strict\nimport Data.Bits ((.|.))\nimport qualified Data.ByteString.Lazy as B\nimport Data.Char (chr, ord, readLitChar)\nimport Data.List\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Data.Maybe\nimport System.FilePath\nimport Text.Pandoc.Readers.Docx.Util\nimport Text.Pandoc.Readers.Docx.Fields\nimport Text.Pandoc.Shared (filteredFilesFromArchive, safeRead)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.TeXMath (Exp)\nimport Text.TeXMath.Readers.OMML (readOMML)\nimport Text.Pandoc.Readers.Docx.Symbols (symbolMap, Font(..), textToFont)\nimport Text.Pandoc.XML.Light\n    ( filterChild,\n      findElement,\n      strContent,\n      showElement,\n      findAttr,\n      filterChild,\n      filterChildrenName,\n      filterElementName,\n      filterElementsName,\n      lookupAttrBy,\n      parseXMLElement,\n      elChildren,\n      QName(QName, qName),\n      Content(Elem),\n      Element(..))\n\ndata ReaderEnv = ReaderEnv { envNotes         :: Notes\n                           , envComments      :: Comments\n                           , envNumbering     :: Numbering\n                           , envRelationships :: [Relationship]\n                           , envMedia         :: Media\n                           , envFont          :: Maybe Font\n                           , envCharStyles    :: CharStyleMap\n                           , envParStyles     :: ParStyleMap\n                           , envLocation      :: DocumentLocation\n                           , envDocXmlPath    :: FilePath\n                           , envTextWidth     :: Int\n                           }\n               deriving Show\n\ndata ReaderState = ReaderState { stateWarnings :: [T.Text]\n                               , stateFldCharState :: [FldCharState]\n                               }\n                 deriving Show\n\ndata FldCharState = FldCharOpen\n                  | FldCharFieldInfo T.Text\n                  | FldCharContent FieldInfo [ParPart]\n                  deriving (Show)\n\ndata DocxError = DocxError\n               | WrongElem\n               deriving Show\n\ntype D = ExceptT DocxError (ReaderT ReaderEnv (State ReaderState))\n\nrunD :: D a -> ReaderEnv -> ReaderState -> (Either DocxError a, ReaderState)\nrunD dx re rs = runState (runReaderT (runExceptT dx) re) rs\n\nmaybeToD :: Maybe a -> D a\nmaybeToD (Just a) = return a\nmaybeToD Nothing  = throwError DocxError\n\neitherToD :: Either a b -> D b\neitherToD (Right b) = return b\neitherToD (Left _)  = throwError DocxError\n\nconcatMapM        :: (Monad m) => (a -> m [b]) -> [a] -> m [b]\nconcatMapM f xs   =  liftM concat (mapM f xs)\n\n-- This is similar to `mapMaybe`: it maps a function returning the D\n-- monad over a list, and only keeps the non-erroring return values.\nmapD :: (a -> D b) -> [a] -> D [b]\nmapD f xs =\n  let handler x = (f x >>= (\\y-> return [y])) `catchError` (\\_ -> return [])\n  in\n   concatMapM handler xs\n\nunwrapElement :: NameSpaces -> Element -> [Element]\nunwrapElement ns element\n  | isElem ns \"w\" \"sdt\" element\n  , Just sdtContent <- findChildByName ns \"w\" \"sdtContent\" element\n  = concatMap (unwrapElement ns) (elChildren sdtContent)\n  | isElem ns \"w\" \"smartTag\" element\n  = concatMap (unwrapElement ns) (elChildren element)\n  | isElem ns \"w\" \"p\" element\n  , _:_ <- findChildrenByName ns \"w\" \"r\" element >>= findTextboxes\n  = let result = splitP (elContent element) [] -- handle #9214, #11053\n    in [element{ elName = QName \"textbox-image\" Nothing Nothing\n              , elContent = map Elem result }]\n  | isElem ns \"w\" \"r\" element\n  , Just fallback <- findChildByName ns \"mc\" \"AlternateContent\" element >>=\n                     findChildByName ns \"mc\" \"Fallback\"\n  = [element{ elContent = concatMap (unwrapContent ns) (elContent fallback) }]\n  | otherwise\n  = [element{ elContent = concatMap (unwrapContent ns) (elContent element) }]\n  where\n    -- Split a w:p's children around textbox-bearing runs, preserving order.\n    -- Non-textbox content is grouped into a copy of the original w:p;\n    -- textbox content is unwrapped into sibling elements in place.\n    splitP [] acc = [wrapP acc | hasContent acc]\n    splitP (c:cs) acc\n      | Elem el <- c\n      , isElem ns \"w\" \"r\" el\n      , tbs@(_:_) <- findTextboxes el\n      = [wrapP acc | hasContent acc]\n        ++ concatMap (unwrapElement ns) (concatMap elChildren tbs)\n        ++ splitP cs []\n      | otherwise\n      = splitP cs (acc ++ [c])\n    wrapP cs = element{ elContent = concatMap (unwrapContent ns) cs }\n    hasContent = any (\\case Elem el -> isElem ns \"w\" \"r\" el\n                                                  && any (isContentElem . elName)\n                                                         (elChildren el)\n                            _ -> False)\n    isContentElem n = qName n `elem`\n      [\"t\", \"drawing\", \"pict\", \"br\", \"tab\", \"sym\", \"fldChar\", \"instrText\"]\n    -- Search textbox content in the run's effective children.\n    -- If AlternateContent is present, use only the fallback branch,\n    -- matching the w:r unwrapping logic and avoiding duplicate textbox\n    -- extraction when both direct and fallback encodings are present.\n    findRunFallback run =\n      findChildByName ns \"mc\" \"AlternateContent\" run >>=\n      findChildByName ns \"mc\" \"Fallback\"\n    findTextboxes run =\n      findTextboxContent =<<\n      case findRunFallback run of\n        Just fallback -> findChildrenByName ns \"w\" \"pict\" fallback\n        Nothing -> findChildrenByName ns \"w\" \"pict\" run\n    findTextboxContent pict =\n      (findChildrenByName ns \"v\" \"shape\" pict <>\n       findChildrenByName ns \"v\" \"rect\" pict) >>=\n      findChildrenByName ns \"v\" \"textbox\" >>=\n      findChildrenByName ns \"w\" \"txbxContent\"\n\nunwrapContent :: NameSpaces -> Content -> [Content]\nunwrapContent ns (Elem element) = map Elem $ unwrapElement ns element\nunwrapContent _ content = [content]\n\nwalkDocument :: NameSpaces -> Element -> Element\nwalkDocument ns element =\n  element{ elContent = concatMap (unwrapContent ns) (elContent element) }\n\nnewtype Docx = Docx Document\n          deriving Show\n\ndata Document = Document NameSpaces Body\n          deriving Show\n\nnewtype Body = Body [BodyPart]\n          deriving Show\n\ntype Media = [(FilePath, B.ByteString)]\n\ntype CharStyleMap = M.Map CharStyleId CharStyle\n\ntype ParStyleMap = M.Map ParaStyleId ParStyle\n\ndata Numbering = Numbering NameSpaces [Numb] [AbstractNumb]\n                 deriving Show\n\ndata Numb = Numb T.Text T.Text [LevelOverride]\n            deriving Show\n\n--                                 ilvl    startOverride   lvl\ndata LevelOverride = LevelOverride T.Text (Maybe Integer) (Maybe Level)\n  deriving Show\n\ndata AbstractNumb = AbstractNumb T.Text [Level]\n                    deriving Show\n\n--                 ilvl   format string  start\ndata Level = Level T.Text T.Text T.Text (Maybe Integer)\n  deriving Show\n\ndata DocumentLocation = InDocument | InFootnote | InEndnote\n                      deriving (Eq,Show)\n\ndata Relationship = Relationship DocumentLocation RelId Target\n                  deriving Show\n\ndata Notes = Notes NameSpaces\n             (Maybe (M.Map T.Text Element))\n             (Maybe (M.Map T.Text Element))\n           deriving Show\n\ndata Comments = Comments NameSpaces (M.Map T.Text Element)\n              deriving Show\n\ndata ChangeType = Insertion | Deletion\n                deriving Show\n\ndata ChangeInfo = ChangeInfo ChangeId Author (Maybe ChangeDate)\n                deriving Show\n\ndata TrackedChange = TrackedChange ChangeType ChangeInfo\n                   deriving Show\n\ndata Justification = JustifyBoth | JustifyLeft | JustifyRight | JustifyCenter\n  deriving (Show, Eq)\n\ndata ParagraphStyle = ParagraphStyle { pStyle        :: [ParStyle]\n                                     , indentation   :: Maybe ParIndentation\n                                     , justification :: Maybe Justification\n                                     , numbered      :: Bool\n                                     , dropCap       :: Bool\n                                     , pChange       :: Maybe TrackedChange\n                                     , pBidi         :: Maybe Bool\n                                     , pKeepNext     :: Bool\n                                     }\n                      deriving Show\n\ndefaultParagraphStyle :: ParagraphStyle\ndefaultParagraphStyle = ParagraphStyle { pStyle = []\n                                       , indentation = Nothing\n                                       , justification = Nothing\n                                       , numbered = False\n                                       , dropCap = False\n                                       , pChange = Nothing\n                                       , pBidi = Just False\n                                       , pKeepNext = False\n                                       }\n\n\ndata BodyPart = Paragraph ParagraphStyle [ParPart]\n              | Heading Int ParaStyleName ParagraphStyle T.Text T.Text (Maybe Level)\n                 [ParPart]\n              | ListItem ParagraphStyle T.Text T.Text (Maybe Level) [ParPart]\n              | Tbl (Maybe T.Text) T.Text TblGrid TblLook [Row]\n              | Captioned ParagraphStyle [ParPart] BodyPart\n              | HRule\n              deriving Show\n\ntype TblGrid = [Double]\n\nnewtype TblLook = TblLook {firstRowFormatting::Bool}\n              deriving Show\n\ndefaultTblLook :: TblLook\ndefaultTblLook = TblLook{firstRowFormatting = False}\n\ndata Row = Row TblHeader [Cell] deriving Show\n\ndata TblHeader = HasTblHeader | NoTblHeader deriving (Show, Eq)\n\ndata Align = AlignDefault | AlignLeft | AlignRight | AlignCenter\n  deriving (Show, Eq)\n\ndata Cell = Cell Align GridSpan VMerge [BodyPart]\n            deriving Show\n\nemptyCell :: Cell\nemptyCell = Cell AlignDefault 1 Restart []\n\ntype GridSpan = Integer\n\ndata VMerge = Continue\n            -- ^ This cell should be merged with the one above it\n            | Restart\n            -- ^ This cell should not be merged with the one above it\n            deriving (Show, Eq)\n\nrowsToRowspans :: [Row] -> [[(Int, Cell)]]\nrowsToRowspans rows = let\n  removeMergedCells = fmap (filter (\\(_, Cell _ _ vmerge _) -> vmerge == Restart))\n  in removeMergedCells (foldr f [] rows)\n  where\n    f :: Row -> [[(Int, Cell)]] -> [[(Int, Cell)]]\n    f (Row _ cells) acc = let\n      spans = g cells Nothing (listToMaybe acc)\n      in spans : acc\n\n    g :: [Cell] -- the current row\n      -> Maybe Integer -- Number of columns left below\n      -> Maybe [(Int, Cell)] -- (rowspan so far, cell) for the row below this one\n      -> [(Int, Cell)] -- (rowspan so far, cell) for this row\n    g cells _ Nothing = map (1,) cells\n    g cells columnsLeftBelow (Just rowBelow) =\n        case cells of\n          [] -> []\n          thisCell@(Cell _ thisGridSpan _ _) : restOfRow -> case rowBelow of\n            [] -> map (1,) cells\n            (spanSoFarBelow, Cell _ gridSpanBelow vmerge _) : _ ->\n              let spanSoFar = case vmerge of\n                    Restart -> 1\n                    Continue -> 1 + spanSoFarBelow\n                  columnsToDrop = thisGridSpan + (gridSpanBelow - fromMaybe gridSpanBelow columnsLeftBelow)\n                  (newColumnsLeftBelow, restOfRowBelow) = dropColumns columnsToDrop rowBelow\n              in (spanSoFar, thisCell) : g restOfRow (Just newColumnsLeftBelow) (Just restOfRowBelow)\n\n    dropColumns :: Integer -> [(a, Cell)] -> (Integer, [(a, Cell)])\n    dropColumns n [] = (n, [])\n    dropColumns n cells@((_, Cell _ gridSpan _ _) : otherCells) =\n      if n < gridSpan\n      then (gridSpan - n, cells)\n      else dropColumns (n - gridSpan) otherCells\n\nleftBiasedMergeRunStyle :: RunStyle -> RunStyle -> RunStyle\nleftBiasedMergeRunStyle a b = RunStyle\n    { isBold = isBold a <|> isBold b\n    , isBoldCTL = isBoldCTL a <|> isBoldCTL b\n    , isItalic = isItalic a <|> isItalic b\n    , isItalicCTL = isItalicCTL a <|> isItalicCTL b\n    , isSmallCaps = isSmallCaps a <|> isSmallCaps b\n    , isStrike = isStrike a <|> isStrike b\n    , isRTL = isRTL a <|> isRTL b\n    , isForceCTL = isForceCTL a <|> isForceCTL b\n    , rHighlight = rHighlight a <|> rHighlight b\n    , rVertAlign = rVertAlign a <|> rVertAlign b\n    , rUnderline = rUnderline a <|> rUnderline b\n    , rParentStyle = rParentStyle a\n    }\n\n-- (width, height) in EMUs\ntype Extent = Maybe (Double, Double)\n\ndata ParPart = PlainRun Run\n             | ChangedRuns TrackedChange [ParPart]\n             | CommentStart CommentId Author (Maybe CommentDate) [BodyPart]\n             | CommentEnd CommentId\n             | BookMark BookMarkId Anchor\n             | InternalHyperLink Anchor [ParPart]\n             | ExternalHyperLink URL [ParPart]\n             | Drawing FilePath T.Text T.Text B.ByteString Extent -- title, alt\n             | Chart                                              -- placeholder for now\n             | Diagram                                            -- placeholder for now\n             | PlainOMath [Exp]\n             | OMathPara [Exp]\n             | Field FieldInfo [ParPart]\n             deriving Show\n\ndata Run = Run RunStyle [RunElem]\n         | Footnote [BodyPart]\n         | Endnote [BodyPart]\n         | InlineDrawing FilePath T.Text T.Text B.ByteString Extent -- title, alt\n         | InlineChart          -- placeholder\n         | InlineDiagram        -- placeholder\n           deriving Show\n\ndata RunElem = TextRun T.Text | LnBrk | Tab | SoftHyphen | NoBreakHyphen\n             deriving Show\n\ntype Target = T.Text\ntype Anchor = T.Text\ntype URL = T.Text\ntype BookMarkId = T.Text\ntype RelId = T.Text\ntype ChangeId = T.Text\ntype CommentId = T.Text\ntype Author = T.Text\ntype ChangeDate = T.Text\ntype CommentDate = T.Text\n\narchiveToDocx :: Archive -> Either DocxError Docx\narchiveToDocx archive = fst <$> archiveToDocxWithWarnings archive\n\narchiveToDocxWithWarnings :: Archive -> Either DocxError (Docx, [T.Text])\narchiveToDocxWithWarnings archive = do\n  docXmlPath <- case getDocumentXmlPath archive of\n    Just fp -> Right fp\n    Nothing -> Left DocxError\n  let notes     = archiveToNotes archive\n      comments  = archiveToComments archive\n      numbering = archiveToNumbering archive\n      rels      = archiveToRelationships archive docXmlPath\n      media     = filteredFilesFromArchive archive filePathIsMedia\n      (styles, parstyles) = archiveToStyles archive\n      textWidth = archiveToTextWidth archive\n      rEnv = ReaderEnv { envNotes = notes\n                       , envComments = comments\n                       , envNumbering = numbering\n                       , envRelationships = rels\n                       , envMedia = media\n                       , envFont = Nothing\n                       , envCharStyles = styles\n                       , envParStyles = parstyles\n                       , envLocation = InDocument\n                       , envDocXmlPath = docXmlPath\n                       , envTextWidth = fromMaybe 9360 textWidth\n                       }\n      rState = ReaderState { stateWarnings = []\n                           , stateFldCharState = []\n                           }\n      (eitherDoc, st) = runD (archiveToDocument archive) rEnv rState\n  case eitherDoc of\n    Right doc -> Right (Docx doc, stateWarnings st)\n    Left e    -> Left e\n\nparseXMLFromEntry :: Entry -> Maybe Element\nparseXMLFromEntry entry =\n  case parseXMLElement (UTF8.toTextLazy (fromEntry entry)) of\n    Left _   -> Nothing\n    Right el -> Just el\n\ngetDocumentXmlPath :: Archive -> Maybe FilePath\ngetDocumentXmlPath zf = do\n  entry <- findEntryByPath \"_rels/.rels\" zf\n  relsElem <- parseXMLFromEntry entry\n  let rels = filterChildrenName (\\n -> qName n == \"Relationship\") relsElem\n  rel <- find (\\e ->\n                 case findAttr (QName \"Type\" Nothing Nothing) e of\n                   Just u -> isNamespace \"officeDocument\" \"relationships/officeDocument\" u\n                   Nothing -> False)\n         rels\n  fp <- findAttr (QName \"Target\" Nothing Nothing) rel\n  -- sometimes there will be a leading slash, which windows seems to\n  -- have trouble with.\n  return $ case T.unpack fp of\n    '/' : fp' -> fp'\n    fp'       -> fp'\n\narchiveToDocument :: Archive -> D Document\narchiveToDocument zf = do\n  docPath <- asks envDocXmlPath\n  entry <- maybeToD $ findEntryByPath docPath zf\n  docElem <- maybeToD $ parseXMLFromEntry entry\n  let namespaces = elemToNameSpaces docElem\n  bodyElem <- maybeToD $ findChildByName namespaces \"w\" \"body\" docElem\n  let bodyElem' = walkDocument namespaces bodyElem\n  body <- elemToBody namespaces bodyElem'\n  return $ Document namespaces body\n\nelemToBody :: NameSpaces -> Element -> D Body\nelemToBody ns element\n  | isElem ns \"w\" \"body\" element =\n      Body . addCaptioned <$> concatMapM (elemToBodyParts ns) (elChildren element)\n  | otherwise = throwError WrongElem\n  where\n    elemToBodyParts ns' el\n      | qName (elName el) == \"textbox-image\"\n      = addSplitGroupCaptioned . splitMixedParagraphs\n          <$> mapD (elemToBodyPart ns') (elChildren el)\n      | otherwise\n      = ((:[]) <$> elemToBodyPart ns' el) `catchError` (\\_ -> return [])\n\narchiveToStyles :: Archive -> (CharStyleMap, ParStyleMap)\narchiveToStyles = archiveToStyles' getStyleId getStyleId\n\nclass HasParentStyle a where\n  getParentStyle :: a -> Maybe a\n\ninstance HasParentStyle CharStyle where\n  getParentStyle = rParentStyle . cStyleData\n\ninstance HasParentStyle ParStyle where\n  getParentStyle = psParentStyle\n\ngetStyleNames :: (Functor t, HasStyleName a) => t a -> t (StyleName a)\ngetStyleNames = fmap getStyleName\n\nconstructBogusParStyleData :: ParaStyleName -> ParStyle\nconstructBogusParStyleData stName = ParStyle\n  { headingLev = Nothing\n  , indent = Nothing\n  , numInfo = Nothing\n  , psParentStyle = Nothing\n  , pStyleName = stName\n  , pStyleId = ParaStyleId . T.filter (/=' ') . fromStyleName $ stName\n  }\n\narchiveToNotes :: Archive -> Notes\narchiveToNotes zf =\n  let fnElem = findEntryByPath \"word/footnotes.xml\" zf\n               >>= parseXMLFromEntry\n      enElem = findEntryByPath \"word/endnotes.xml\" zf\n               >>= parseXMLFromEntry\n      fn_namespaces = maybe mempty elemToNameSpaces fnElem\n      en_namespaces = maybe mempty elemToNameSpaces enElem\n      ns = M.union fn_namespaces en_namespaces\n      fn = fnElem >>= elemToNotes ns \"footnote\" . walkDocument ns\n      en = enElem >>= elemToNotes ns \"endnote\" . walkDocument ns\n  in\n   Notes ns fn en\n\narchiveToComments :: Archive -> Comments\narchiveToComments zf =\n  let cmtsElem = findEntryByPath \"word/comments.xml\" zf\n               >>= parseXMLFromEntry\n      cmts_namespaces = maybe mempty elemToNameSpaces cmtsElem\n      cmts = elemToComments cmts_namespaces . walkDocument cmts_namespaces <$>\n               cmtsElem\n  in\n    case cmts of\n      Just c  -> Comments cmts_namespaces c\n      Nothing -> Comments cmts_namespaces M.empty\n\nfilePathToRelType :: FilePath -> FilePath -> Maybe DocumentLocation\nfilePathToRelType \"word/_rels/footnotes.xml.rels\" _ = Just InFootnote\nfilePathToRelType \"word/_rels/endnotes.xml.rels\" _ = Just InEndnote\n-- -- to see if it's a documentPath, we have to check against the dynamic\n-- -- docPath specified in \"_rels/.rels\"\nfilePathToRelType path docXmlPath =\n  if path == \"word/_rels/\" ++ takeFileName docXmlPath ++ \".rels\"\n  then Just InDocument\n  else Nothing\n\nrelElemToRelationship :: DocumentLocation -> Element\n                      -> Maybe Relationship\nrelElemToRelationship relType element | qName (elName element) == \"Relationship\" =\n  do\n    relId <- findAttr (QName \"Id\" Nothing Nothing) element\n    target <- findAttr (QName \"Target\" Nothing Nothing) element\n    -- target may be relative (media/image1.jpeg) or absolute (/word/media/image1.jpg)\n    return $ Relationship relType relId target\nrelElemToRelationship _ _ = Nothing\n\nextractTarget :: Element -> Maybe Target\nextractTarget element = do (Relationship _ _ target) <- relElemToRelationship InDocument element\n                           return target\n\nfilePathToRelationships :: Archive -> FilePath -> FilePath ->  [Relationship]\nfilePathToRelationships ar docXmlPath fp\n  | Just relType <- filePathToRelType fp docXmlPath\n  , Just entry <- findEntryByPath fp ar\n  , Just relElems <- parseXMLFromEntry entry =\n  mapMaybe (relElemToRelationship relType) $ elChildren relElems\nfilePathToRelationships _ _ _ = []\n\narchiveToRelationships :: Archive -> FilePath -> [Relationship]\narchiveToRelationships archive docXmlPath =\n  concatMap (filePathToRelationships archive docXmlPath) $ filesInArchive archive\n\nfilePathIsMedia :: FilePath -> Bool\nfilePathIsMedia fp =\n  \"media\" `elem` splitDirectories (takeDirectory fp)\n\nlookupLevel :: T.Text -> T.Text -> Numbering -> Maybe Level\nlookupLevel numId ilvl (Numbering _ numbs absNumbs) = do\n  (absNumId, ovrrides) <- lookup numId $\n                          map (\\(Numb nid absnumid ovrRides) -> (nid, (absnumid, ovrRides))) numbs\n  lvls <- lookup absNumId $\n    map (\\(AbstractNumb aid ls) -> (aid, ls)) absNumbs\n  -- this can be a maybe, so we do a let\n  let lvlOverride = lookup ilvl $\n                    map (\\lo@(LevelOverride ilvl' _ _) -> (ilvl', lo)) ovrrides\n  case lvlOverride of\n    Just (LevelOverride _ _ (Just lvl')) -> Just lvl'\n    Just (LevelOverride _ (Just strt) _) ->\n      lookup ilvl $ map (\\(Level i fmt s _) -> (i, Level i fmt s (Just strt))) lvls\n    _ ->\n      lookup ilvl $ map (\\l@(Level i _ _ _) -> (i, l)) lvls\n\nloElemToLevelOverride :: NameSpaces -> Element -> Maybe LevelOverride\nloElemToLevelOverride ns element\n  | isElem ns \"w\" \"lvlOverride\" element = do\n      ilvl <- findAttrByName ns \"w\" \"ilvl\" element\n      let startOverride = findChildByName ns \"w\" \"startOverride\" element\n                          >>= findAttrByName ns \"w\" \"val\"\n                          >>= stringToInteger\n          lvl = findChildByName ns \"w\" \"lvl\" element\n                >>= levelElemToLevel ns\n      return $ LevelOverride ilvl startOverride lvl\nloElemToLevelOverride _ _ = Nothing\n\nnumElemToNum :: NameSpaces -> Element -> Maybe Numb\nnumElemToNum ns element\n  | isElem ns \"w\" \"num\" element = do\n      numId <- findAttrByName ns \"w\" \"numId\" element\n      absNumId <- findChildByName ns \"w\" \"abstractNumId\" element\n                  >>= findAttrByName ns \"w\" \"val\"\n      let lvlOverrides = mapMaybe\n                         (loElemToLevelOverride ns)\n                         (findChildrenByName ns \"w\" \"lvlOverride\" element)\n      return $ Numb numId absNumId lvlOverrides\nnumElemToNum _ _ = Nothing\n\nabsNumElemToAbsNum :: NameSpaces -> Element -> Maybe AbstractNumb\nabsNumElemToAbsNum ns element\n  | isElem ns \"w\" \"abstractNum\" element = do\n      absNumId <- findAttrByName ns \"w\" \"abstractNumId\" element\n      let levelElems = findChildrenByName ns \"w\" \"lvl\" element\n          levels = mapMaybe (levelElemToLevel ns) levelElems\n      return $ AbstractNumb absNumId levels\nabsNumElemToAbsNum _ _ = Nothing\n\nlevelElemToLevel :: NameSpaces -> Element -> Maybe Level\nlevelElemToLevel ns element\n  | isElem ns \"w\" \"lvl\" element = do\n      ilvl <- findAttrByName ns \"w\" \"ilvl\" element\n      fmt <- findChildByName ns \"w\" \"numFmt\" element\n             >>= findAttrByName ns \"w\" \"val\"\n      txt <- findChildByName ns \"w\" \"lvlText\" element\n             >>= findAttrByName ns \"w\" \"val\"\n      let start = findChildByName ns \"w\" \"start\" element\n                  >>= findAttrByName ns \"w\" \"val\"\n                  >>= stringToInteger\n      return (Level ilvl fmt txt start)\nlevelElemToLevel _ _ = Nothing\n\narchiveToNumbering' :: Archive -> Maybe Numbering\narchiveToNumbering' zf =\n  case findEntryByPath \"word/numbering.xml\" zf of\n    Nothing -> Just $ Numbering mempty [] []\n    Just entry -> do\n      numberingElem <- parseXMLFromEntry entry\n      let namespaces = elemToNameSpaces numberingElem\n          numElems = findChildrenByName namespaces \"w\" \"num\" numberingElem\n          absNumElems = findChildrenByName namespaces \"w\" \"abstractNum\" numberingElem\n          nums = mapMaybe (numElemToNum namespaces) numElems\n          absNums = mapMaybe (absNumElemToAbsNum namespaces) absNumElems\n      return $ Numbering namespaces nums absNums\n\narchiveToNumbering :: Archive -> Numbering\narchiveToNumbering archive =\n  fromMaybe (Numbering mempty [] []) (archiveToNumbering' archive)\n\narchiveToTextWidth :: Archive -> Maybe Int\narchiveToTextWidth zf = do\n  entry <- findEntryByPath \"word/document.xml\" zf\n  docElem <- parseXMLFromEntry entry\n  let ns = elemToNameSpaces docElem\n  sectElem <- findChildByName ns \"w\" \"body\" docElem >>= findChildByName ns \"w\" \"sectPr\"\n  pgWidth <- findChildByName ns \"w\" \"pgSz\" sectElem\n               >>= findAttrByName ns \"w\" \"w\" >>= safeRead\n  pgMar <- findChildByName ns \"w\" \"pgMar\" sectElem\n  leftMargin <- findAttrByName ns \"w\" \"left\" pgMar >>= safeRead\n  rightMargin <- findAttrByName ns \"w\" \"right\" pgMar >>= safeRead\n  gutter <- findAttrByName ns \"w\" \"gutter\" pgMar >>= safeRead\n  return $ pgWidth - (leftMargin + rightMargin + gutter)\n\nelemToNotes :: NameSpaces -> Text -> Element -> Maybe (M.Map T.Text Element)\nelemToNotes ns notetype element\n  | isElem ns \"w\" (notetype <> \"s\") element =\n      let pairs = mapMaybe\n                  (\\e -> findAttrByName ns \"w\" \"id\" e >>=\n                         (\\a -> Just (a, e)))\n                  (findChildrenByName ns \"w\" notetype element)\n      in\n       Just $\n       M.fromList pairs\nelemToNotes _ _ _ = Nothing\n\nelemToComments :: NameSpaces -> Element -> M.Map T.Text Element\nelemToComments ns element\n  | isElem ns \"w\" \"comments\" element =\n      let pairs = mapMaybe\n                  (\\e -> findAttrByName ns \"w\" \"id\" e >>=\n                         (\\a -> Just (a, e)))\n                  (findChildrenByName ns \"w\" \"comment\" element)\n      in\n       M.fromList pairs\nelemToComments _ _ = M.empty\n\n\n---------------------------------------------\n---------------------------------------------\n\nelemToTblGrid :: NameSpaces -> Element -> D TblGrid\nelemToTblGrid ns element | isElem ns \"w\" \"tblGrid\" element = do\n  let cols = findChildrenByName ns \"w\" \"gridCol\" element\n  textWidth <- asks envTextWidth\n  -- space between cols is 10 twips, so we subtract this:\n  let totalWidth = textWidth - (10 * (length cols - 1))\n  let toFraction :: Int -> Double\n      toFraction x = fromIntegral x / fromIntegral totalWidth\n  let normalizeFractions xs =\n        case sum xs of\n          tot | tot > 1.0 -> map (/ tot) xs\n          _ -> xs\n  normalizeFractions <$>\n    mapD (\\e -> maybeToD (findAttrByName ns \"w\" \"w\" e >>=\n                          fmap toFraction . safeRead)) cols\nelemToTblGrid _ _ = throwError WrongElem\n\nelemToTblLook :: NameSpaces -> Element -> D TblLook\nelemToTblLook ns element | isElem ns \"w\" \"tblLook\" element =\n  let firstRow = findAttrByName ns \"w\" \"firstRow\" element\n      val = findAttrByName ns \"w\" \"val\" element\n      firstRowFmt =\n        case firstRow of\n          Just \"1\" -> True\n          Just  _  -> False\n          Nothing -> case val of\n            Just bitMask -> testBitMask bitMask 0x020\n            Nothing      -> False\n  in\n   return TblLook{firstRowFormatting = firstRowFmt}\nelemToTblLook _ _ = throwError WrongElem\n\nelemToRow :: NameSpaces -> Element -> D Row\nelemToRow ns element | isElem ns \"w\" \"tr\" element =\n  do\n    let properties = findChildByName ns \"w\" \"trPr\" element\n    let gridBefore = properties\n                     >>= findChildByName ns \"w\" \"gridBefore\"\n                     >>= findAttrByName ns \"w\" \"val\"\n                     >>= stringToInteger\n    let cellElems = findChildrenByName ns \"w\" \"tc\" element\n    let beforeCells = genericReplicate (fromMaybe 0 gridBefore) emptyCell\n    cells <- mapD (elemToCell ns) cellElems\n    let hasTblHeader = maybe NoTblHeader (const HasTblHeader)\n          (properties\n           >>= findChildByName ns \"w\" \"tblHeader\")\n    return $ Row hasTblHeader (beforeCells ++ cells)\nelemToRow _ _ = throwError WrongElem\n\nelemToCell :: NameSpaces -> Element -> D Cell\nelemToCell ns element | isElem ns \"w\" \"tc\" element =\n  do\n    let properties = findChildByName ns \"w\" \"tcPr\" element\n    let gridSpan = properties\n                     >>= findChildByName ns \"w\" \"gridSpan\"\n                     >>= findAttrByName ns \"w\" \"val\"\n                     >>= stringToInteger\n    let vMerge = case properties >>= findChildByName ns \"w\" \"vMerge\" of\n                   Nothing -> Restart\n                   Just e ->\n                     fromMaybe Continue $ do\n                       s <- findAttrByName ns \"w\" \"val\" e\n                       case s of\n                         \"continue\" -> Just Continue\n                         \"restart\" -> Just Restart\n                         _ -> Nothing\n    cellContents <- mapD (elemToBodyPart ns) (elChildren element)\n    let align = case cellContents of -- take alignment from first paragraph\n                  Paragraph pstyle _ : _ ->\n                    case justification pstyle of\n                      Just JustifyBoth -> AlignLeft\n                      Just JustifyLeft -> AlignLeft\n                      Just JustifyRight -> AlignRight\n                      Just JustifyCenter -> AlignCenter\n                      Nothing -> AlignDefault\n                  _ -> AlignDefault\n    return $ Cell align (fromMaybe 1 gridSpan) vMerge cellContents\nelemToCell _ _ = throwError WrongElem\n\ntestBitMask :: Text -> Int -> Bool\ntestBitMask bitMaskS n =\n  case (reads (\"0x\" ++ T.unpack bitMaskS) :: [(Int, String)]) of\n    []            -> False\n    ((n', _) : _) -> (n' .|. n) /= 0\n\npHeading :: ParagraphStyle -> Maybe (ParaStyleName, Int)\npHeading = getParStyleField headingLev . pStyle\n\npNumInfo :: ParagraphStyle -> Maybe (T.Text, T.Text)\npNumInfo = getParStyleField numInfo . pStyle\n\nmkListItem :: ParagraphStyle -> Text -> Text -> [ParPart] -> D BodyPart\nmkListItem parstyle numId lvl parparts = do\n  lvlInfo <- lookupLevel numId lvl <$> asks envNumbering\n  return $ ListItem parstyle numId lvl lvlInfo parparts\n\npStyleIndentation :: ParagraphStyle -> Maybe ParIndentation\npStyleIndentation style = (getParStyleField indent . pStyle) style\n\naddCaptioned :: [BodyPart] -> [BodyPart]\naddCaptioned [] = []\naddCaptioned (Paragraph parstyle parparts : x : xs)\n  | hasCaptionStyle parstyle\n  , isCaptionable x\n    = Captioned parstyle parparts x : addCaptioned xs\naddCaptioned (x : Paragraph parstyle parparts : xs)\n  | hasCaptionStyle parstyle\n  , not (pKeepNext parstyle)\n  , isCaptionable x\n    = Captioned parstyle parparts x : addCaptioned xs\naddCaptioned (x:xs) = x : addCaptioned xs\n\n-- Split paragraphs that contain both a Drawing and text into two body parts,\n-- so that the captioning logic can combine them.\nsplitMixedParagraphs :: [BodyPart] -> [BodyPart]\nsplitMixedParagraphs [] = []\nsplitMixedParagraphs (Paragraph ps parts : rest)\n  | (drawings@(_:_), texts@(_:_)) <- partition isDrawingPart parts\n  = Paragraph ps drawings : Paragraph ps texts : splitMixedParagraphs rest\n  where isDrawingPart Drawing{} = True\n        isDrawingPart _         = False\nsplitMixedParagraphs (x:xs) = x : splitMixedParagraphs xs\n\n-- For textbox-image groups: combine image + any adjacent text into Captioned\naddSplitGroupCaptioned :: [BodyPart] -> [BodyPart]\naddSplitGroupCaptioned [] = []\naddSplitGroupCaptioned (Paragraph parstyle parparts : x : xs)\n  | isCaptionable x\n  = Captioned parstyle parparts x : addSplitGroupCaptioned xs\naddSplitGroupCaptioned (x : Paragraph parstyle parparts : xs)\n  | isCaptionable x\n  = Captioned parstyle parparts x : addSplitGroupCaptioned xs\naddSplitGroupCaptioned (x:xs) = x : addSplitGroupCaptioned xs\n\nisCaptionable :: BodyPart -> Bool\nisCaptionable (Paragraph _ [Drawing{}]) = True\nisCaptionable (Tbl{}) = True\nisCaptionable _ = False\n\nelemToBodyPart :: NameSpaces -> Element -> D BodyPart\nelemToBodyPart ns element\n  | isElem ns \"m\" \"oMathPara\" element = do\n      expsLst <- eitherToD $ readOMML $ showElement element\n      parstyle <- elemToParagraphStyle ns element\n                  <$> asks envParStyles\n                  <*> asks envNumbering\n      return $ Paragraph parstyle [OMathPara expsLst]\nelemToBodyPart ns element\n  | isElem ns \"w\" \"p\" element\n  , Just (numId, lvl) <- getNumInfo ns element = do\n    lvlInfo <- lookupLevel numId lvl <$> asks envNumbering\n    parstyle <- elemToParagraphStyle ns element\n                <$> asks envParStyles\n                <*> asks envNumbering\n    parparts <- mconcat <$> mapD (elemToParPart ns) (elChildren element)\n    case pHeading parstyle of\n      Nothing -> mkListItem parstyle numId lvl parparts\n      Just (parstylename, lev)\n        -> return $ Heading lev parstylename parstyle numId lvl lvlInfo parparts\nelemToBodyPart ns element\n  | isElem ns \"w\" \"p\" element\n  , [Elem ppr] <- elContent element\n  , isElem ns \"w\" \"pPr\" ppr\n  , [Elem pbdr] <- elContent ppr\n  , isElem ns \"w\" \"pBdr\" pbdr\n    = return HRule\n      -- for this style of horizontal rule, see\n      -- https://support.microsoft.com/en-us/office/insert-a-horizontal-line-9bf172f6-5908-4791-9bb9-2c952197b1a9\nelemToBodyPart ns element -- pandoc-style horizontal rule\n  | isElem ns \"w\" \"p\" element\n  , [Elem r] <- elContent element\n  , isElem ns \"w\" \"r\" r\n  , [Elem pict] <- elContent r\n  , isElem ns \"w\" \"pict\" pict\n  , [Elem rect] <- elContent pict\n  , isElem ns \"v\" \"rect\" rect\n    = return HRule\nelemToBodyPart ns element\n  | isElem ns \"w\" \"p\" element = do\n      parstyle <- elemToParagraphStyle ns element\n                  <$> asks envParStyles\n                  <*> asks envNumbering\n\n      let children =\n            (if hasCaptionStyle parstyle\n                then stripCaptionLabel\n                else id) (elChildren element)\n\n      parparts' <- mconcat <$> mapD (elemToParPart ns) children\n      fldCharState <- gets stateFldCharState\n      modify $ \\st -> st {stateFldCharState = emptyFldCharContents fldCharState}\n      -- Word uses list enumeration for numbered headings, so we only\n      -- want to infer a list from the styles if it is NOT a heading.\n      let parparts = parparts' ++ openFldCharsToParParts fldCharState\n      case pHeading parstyle of\n        Nothing | Just (numId, lvl) <- pNumInfo parstyle -> do\n                    mkListItem parstyle numId lvl parparts\n        Just (parstylename, lev) -> do\n          let (numId, lvl) = fromMaybe (\"\",\"\") $ pNumInfo parstyle\n          lvlInfo <- lookupLevel numId lvl <$> asks envNumbering\n          return $ Heading lev parstylename parstyle numId lvl lvlInfo parparts\n        Nothing -> return $ Paragraph parstyle parparts\nelemToBodyPart ns element\n  | isElem ns \"w\" \"tbl\" element = do\n    let tblProperties = findChildByName ns \"w\" \"tblPr\" element\n        caption = fromMaybe \"\" $ tblProperties\n                   >>= findChildByName ns \"w\" \"tblCaption\"\n                   >>= findAttrByName ns \"w\" \"val\"\n        description = fromMaybe \"\" $ tblProperties\n                       >>= findChildByName ns \"w\" \"tblDescription\"\n                       >>= findAttrByName ns \"w\" \"val\"\n        mbstyle = tblProperties\n                       >>= findChildByName ns \"w\" \"tblStyle\"\n                       >>= findAttrByName ns \"w\" \"val\"\n        grid' = case findChildByName ns \"w\" \"tblGrid\" element of\n          Just g  -> elemToTblGrid ns g\n          Nothing -> return []\n        tblLook' = case findChildByName ns \"w\" \"tblPr\" element >>=\n                          findChildByName ns \"w\" \"tblLook\"\n                     of\n                       Just l  -> elemToTblLook ns l\n                       Nothing -> return defaultTblLook\n\n    grid'' <- grid'\n    tblLook <- tblLook'\n    rows <- mapD (elemToRow ns) (elChildren element)\n    let grid = if null grid''\n                  then let numcols = case rowsToRowspans rows of\n                                       (cs@(_:_):_) -> sum (map fst cs)\n                                       _ -> 0\n                       in replicate numcols 0.0\n                  else grid''\n    return $ Tbl mbstyle (caption <> description) grid tblLook rows\nelemToBodyPart _ _ = throwError WrongElem\n\nlookupRelationship :: DocumentLocation -> RelId -> [Relationship] -> Maybe Target\nlookupRelationship docLocation relid rels =\n  lookup (docLocation, relid) pairs\n  where\n    pairs = map (\\(Relationship loc relid' target) -> ((loc, relid'), target)) rels\n\nopenFldCharsToParParts :: [FldCharState] -> [ParPart]\nopenFldCharsToParParts [] = []\nopenFldCharsToParParts (FldCharContent info children : ancestors) = case openFldCharsToParParts ancestors of\n  Field parentInfo siblings : _ -> [Field parentInfo $ siblings ++ [Field info $ reverse children]]\n  _ -> [Field info $ reverse children]\nopenFldCharsToParParts (_ : ancestors) = openFldCharsToParParts ancestors\n\nemptyFldCharContents :: [FldCharState] -> [FldCharState]\nemptyFldCharContents = map\n  (\\x -> case x of\n    FldCharContent info _ -> FldCharContent info []\n    _ -> x)\n\nexpandDrawingId :: T.Text -> D (FilePath, B.ByteString)\nexpandDrawingId s = do\n  location <- asks envLocation\n  target <- asks (fmap T.unpack . lookupRelationship location s . envRelationships)\n  case target of\n    Just filepath -> do\n      media <- asks envMedia\n      -- the mediaName is the name we store it under in the mediabag.\n      -- This is derived from the path, which might be absolute, e.g. /media/foo.jpg,\n      -- or relative, media/foo.jpg (interpreted as /word/media/foo.jpg).\n      -- The mediaName will strip off any leading `/` or `word/`.\n      -- We assume here that the media will not be stored *both* in\n      -- /media and in /word/media, which would lead to a name conflict\n      -- given the scheme here for generating a mediaName.\n      let (filepath', mediaName) =\n            case filepath of\n               ('/':rest)  -- absolute path e.g. /media/foo.jpg\n                  -> (rest, case stripPrefix \"word/\" rest of\n                              Just rest' -> rest'\n                              Nothing -> rest)\n               _  -- rel path to word, e.g. media/foo.jpg\n                 -> (\"word/\" ++ filepath, filepath)\n      case lookup filepath' media of\n        Just bs -> return (mediaName, bs)\n        Nothing -> throwError DocxError\n    Nothing -> throwError DocxError\n\ngetTitleAndAlt :: NameSpaces -> Element -> (T.Text, T.Text)\ngetTitleAndAlt ns element =\n  let mbDocPr = (findChildByName ns \"wp\" \"inline\" element <|>   -- Word\n                 findChildByName ns \"wp\" \"anchor\" element) >>=  -- LibreOffice\n                findChildByName ns \"wp\" \"docPr\"\n      title = fromMaybe \"\" (mbDocPr >>= findAttrByName ns \"\" \"title\")\n      alt = fromMaybe \"\" (mbDocPr >>= findAttrByName ns \"\" \"descr\")\n  in (title, alt)\n\nelemToParPart :: NameSpaces -> Element -> D [ParPart]\n{-\nThe next one is a bit complicated. fldChar fields work by first\nhaving a <w:fldChar fldCharType=\"begin\"> in a run, then a run with\n<w:instrText>, then a <w:fldChar fldCharType=\"separate\"> run, then the\ncontent runs, and finally a <w:fldChar fldCharType=\"end\"> run. For\nexample (omissions and my comments in brackets):\n\n      <w:r>\n        [...]\n        <w:fldChar w:fldCharType=\"begin\"/>\n      </w:r>\n      <w:r>\n        [...]\n        <w:instrText xml:space=\"preserve\"> HYPERLINK [hyperlink url] </w:instrText>\n      </w:r>\n      <w:r>\n        [...]\n        <w:fldChar w:fldCharType=\"separate\"/>\n      </w:r>\n      <w:r w:rsidRPr=[...]>\n        [...]\n        <w:t>Foundations of Analysis, 2nd Edition</w:t>\n      </w:r>\n      <w:r>\n        [...]\n        <w:fldChar w:fldCharType=\"end\"/>\n      </w:r>\n\nNote that there may be mulitple w:instrText elements in a row.\nFor example, you might first have ` XE \"`, then `Kay, Alan`, then `\"`.\nThe texts in all of them should be concatenated before it is processed!\n\nSo we do this in a number of steps. If we encounter the fldchar begin\ntag, we start open a fldchar state variable (see state above). We add\nthe instrtext to it as FieldInfo. Then we close that and start adding\nthe children when we get to separate. Then when we get to end, we produce\nthe Field type with appropriate FieldInfo and ParParts.\n\nSince there can be nested fields, the fldchar state needs to be a stack,\nso we can have multiple fldchars open at the same time. When a fldchar is\nclosed, we either add the resulting field to its parent or we return it if\nthere is no parent.\n-}\nelemToParPart ns element\n  | isElem ns \"w\" \"r\" element\n  , Just fldChar <- findChildByName ns \"w\" \"fldChar\" element\n  , Just fldCharType <- findAttrByName ns \"w\" \"fldCharType\" fldChar = do\n      fldCharState <- gets stateFldCharState\n      case fldCharState of\n        _ | fldCharType == \"begin\" -> do\n          modify $ \\st -> st {stateFldCharState = FldCharOpen : fldCharState}\n          return []\n        FldCharFieldInfo t : ancestors | fldCharType == \"separate\" -> do\n          info <- eitherToD $ parseFieldInfo t\n          modify $ \\st -> st {stateFldCharState = FldCharContent info [] : ancestors}\n          return []\n        -- Some fields have no content, e.g. index XE:\n        FldCharFieldInfo t : ancestors | fldCharType == \"end\" -> do\n          modify $ \\st -> st {stateFldCharState = ancestors}\n          info <- eitherToD $ parseFieldInfo t\n          return [Field info []]\n        [FldCharContent info children] | fldCharType == \"end\" -> do\n          modify $ \\st -> st {stateFldCharState = []}\n          return [Field info $ reverse children]\n        FldCharContent info children : FldCharContent parentInfo siblings : ancestors | fldCharType == \"end\" ->\n          let parent = FldCharContent parentInfo $ (Field info (reverse children)) : siblings in do\n            modify $ \\st -> st {stateFldCharState = parent : ancestors}\n            return []\n        _ -> throwError WrongElem\nelemToParPart ns element\n  | isElem ns \"w\" \"r\" element\n  , Just instrText <- findChildByName ns \"w\" \"instrText\" element = do\n      fldCharState <- gets stateFldCharState\n      case fldCharState of\n        FldCharOpen : ancestors -> do\n          modify $ \\st -> st {stateFldCharState =\n                               FldCharFieldInfo (strContent instrText) : ancestors}\n          return []\n        FldCharFieldInfo t : ancestors -> do\n          modify $ \\st -> st {stateFldCharState =\n                               FldCharFieldInfo (t <> strContent instrText) :\n                                ancestors}\n          return []\n        _ -> return []\n{-\nThere is an open fldchar, so we calculate the element and add it to the\nchildren. For this we need to first change the fldchar state to an empty\nstack to avoid descendants of children simply being added to the state instead\nof to their direct parent element. This would happen in the case of a\nw:hyperlink element for example.\n-}\nelemToParPart ns element = do\n  fldCharState <- gets stateFldCharState\n  case fldCharState of\n    FldCharContent info children : ancestors -> do\n      modify $ \\st -> st {stateFldCharState = []}\n      parParts <- elemToParPart' ns element `catchError` \\_ -> return []\n      modify $ \\st -> st{stateFldCharState = FldCharContent info (parParts ++ children) : ancestors}\n      return []\n    _ -> elemToParPart' ns element\n\nelemToParPart' :: NameSpaces -> Element -> D [ParPart]\nelemToParPart' ns element\n  | isElem ns \"w\" \"r\" element\n  , Just drawingElem <- findChildByName ns \"w\" \"drawing\" element\n  , picElems <- filterElementsName\n                 (matchQName \"drawingml\" \"picture\" (Just \"pic\") \"pic\") drawingElem\n  = let (title, alt) = getTitleAndAlt ns drawingElem\n        drawings = map (\\el ->\n                        ((findBlip el >>= findAttrByName ns \"r\" \"embed\"), el))\n                       picElems\n    in mapM (\\case\n                (Just s, el) -> do\n                  (fp, bs) <- expandDrawingId s\n                  let extent = elemToExtent el <|> elemToExtent element\n                  return $ Drawing fp title alt bs extent\n                (Nothing, _) -> throwError WrongElem)\n            drawings\n-- The two cases below are an attempt to deal with images in deprecated vml format.\n-- Todo: check out title and attr for deprecated format.\nelemToParPart' ns element\n  | isElem ns \"w\" \"r\" element\n  , Just _ <- findChildByName ns \"w\" \"pict\" element =\n    let drawing = findElement (elemName ns \"v\" \"imagedata\") element\n                  >>= findAttrByName ns \"r\" \"id\"\n    in\n     case drawing of\n       Just s -> expandDrawingId s >>= (\\(fp, bs) -> return [Drawing fp \"\" \"\" bs Nothing])\n       Nothing -> throwError WrongElem\nelemToParPart' ns element\n  | isElem ns \"w\" \"r\" element\n  , Just objectElem <- findChildByName ns \"w\" \"object\" element\n  , Just shapeElem <- findChildByName ns \"v\" \"shape\" objectElem\n  , Just imagedataElem <- findChildByName ns \"v\" \"imagedata\" shapeElem\n  , Just drawingId <- findAttrByName ns \"r\" \"id\" imagedataElem\n  = expandDrawingId drawingId >>= (\\(fp, bs) -> return [Drawing fp \"\" \"\" bs Nothing])\n-- Diagram\nelemToParPart' ns element\n  | isElem ns \"w\" \"r\" element\n  , Just drawingElem <- findChildByName ns \"w\" \"drawing\" element\n  , Just _ <- filterElementName\n                 (matchQName \"drawingml\" \"diagram\" (Just \"dgm\") \"relIds\") drawingElem\n  = return [Diagram]\n-- Chart\nelemToParPart' ns element\n  | isElem ns \"w\" \"r\" element\n  , Just drawingElem <- findChildByName ns \"w\" \"drawing\" element\n  , Just _ <- filterElementName\n                (matchQName \"drawingml\" \"chart\" (Just \"c\") \"chart\") drawingElem\n  = return [Chart]\nelemToParPart' ns element\n  | isElem ns \"w\" \"r\" element = do\n    runs <- elemToRun ns element\n    return $ map PlainRun runs\nelemToParPart' ns element\n  | Just change <- getTrackedChange ns element = do\n      runs <- mconcat <$> mapD (elemToParPart' ns) (elChildren element)\n      return [ChangedRuns change runs]\nelemToParPart' ns element\n  | isElem ns \"w\" \"bookmarkStart\" element\n  , Just bmId <- findAttrByName ns \"w\" \"id\" element\n  , Just bmName <- findAttrByName ns \"w\" \"name\" element =\n    return [BookMark bmId bmName]\nelemToParPart' ns element\n  | isElem ns \"w\" \"hyperlink\" element\n  , Just relId <- findAttrByName ns \"r\" \"id\" element = do\n    location <- asks envLocation\n    children <- mconcat <$> mapD (elemToParPart ns) (elChildren element)\n    rels <- asks envRelationships\n    case lookupRelationship location relId rels of\n      Just target ->\n         case findAttrByName ns \"w\" \"anchor\" element of\n             Just anchor -> return\n               [ExternalHyperLink (target <> \"#\" <> anchor) children]\n             Nothing -> return [ExternalHyperLink target children]\n      Nothing     -> return [ExternalHyperLink \"\" children]\nelemToParPart' ns element\n  | isElem ns \"w\" \"hyperlink\" element\n  , Just anchor <- findAttrByName ns \"w\" \"anchor\" element = do\n    children <- mconcat <$> mapD (elemToParPart ns) (elChildren element)\n    return [InternalHyperLink anchor children]\nelemToParPart' ns element\n  | isElem ns \"w\" \"commentRangeStart\" element\n  , Just cmtId <- findAttrByName ns \"w\" \"id\" element = do\n      (Comments _ commentMap) <- asks envComments\n      case M.lookup cmtId commentMap of\n        Just cmtElem -> elemToCommentStart ns cmtElem\n        Nothing      -> throwError WrongElem\nelemToParPart' ns element\n  | isElem ns \"w\" \"commentRangeEnd\" element\n  , Just cmtId <- findAttrByName ns \"w\" \"id\" element =\n    return [CommentEnd cmtId]\nelemToParPart' ns element\n  | isElem ns \"m\" \"oMath\" element =\n    fmap (return . PlainOMath) (eitherToD $ readOMML $ showElement element)\nelemToParPart' ns element\n  | isElem ns \"m\" \"oMathPara\" element =\n    fmap (return . OMathPara) (eitherToD $ readOMML $ showElement element)\nelemToParPart' _ _ = throwError WrongElem\n\nelemToCommentStart :: NameSpaces -> Element -> D [ParPart]\nelemToCommentStart ns element\n  | isElem ns \"w\" \"comment\" element\n  , Just cmtId <- findAttrByName ns \"w\" \"id\" element\n  , Just cmtAuthor <- findAttrByName ns \"w\" \"author\" element\n  , cmtDate <- findAttrByName ns \"w\" \"date\" element = do\n      bps <- mapD (elemToBodyPart ns) (elChildren element)\n      return [CommentStart cmtId cmtAuthor cmtDate bps]\nelemToCommentStart _ _ = throwError WrongElem\n\nlookupFootnote :: T.Text -> Notes -> Maybe Element\nlookupFootnote s (Notes _ fns _) = fns >>= M.lookup s\n\nlookupEndnote :: T.Text -> Notes -> Maybe Element\nlookupEndnote s (Notes _ _ ens) = ens >>= M.lookup s\n\nelemToExtent :: Element -> Extent\nelemToExtent el =\n  case (getDim \"cx\", getDim \"cy\") of\n    (Just w, Just h) -> Just (w, h)\n    _                -> Nothing\n where\n  getDim at = filterElementName (\\n -> qName n `elem` [\"extent\", \"ext\"]) el\n              >>= findAttr (QName at Nothing Nothing) >>= safeRead\n\n\nchildElemToRun :: NameSpaces -> Element -> D [Run]\nchildElemToRun ns element\n  | isElem ns \"w\" \"drawing\" element\n  , picElems <- filterElementsName\n                 (matchQName \"drawingml\" \"picture\" (Just \"pic\") \"pic\") element\n  = let (title, alt) = getTitleAndAlt ns element\n        drawings = map (\\el ->\n                         ((findBlip el >>= findAttrByName ns \"r\" \"embed\"), el))\n                   picElems\n    in mapM (\\case\n                (Just s, el) -> do\n                  (fp, bs) <- expandDrawingId s\n                  let extent = elemToExtent el <|> elemToExtent element\n                  return $ InlineDrawing fp title alt bs extent\n                (Nothing, _) -> throwError WrongElem)\n       drawings\nchildElemToRun ns element\n  | isElem ns \"w\" \"drawing\" element\n  , Just _ <- filterElementName\n                 (matchQName \"drawingml\" \"chart\" (Just \"c\") \"chart\") element\n  = return [InlineChart]\nchildElemToRun ns element\n  | isElem ns \"w\" \"drawing\" element\n  , Just _ <- filterElementName\n                 (matchQName \"drawingml\" \"diagram\" (Just \"dgm\") \"relIds\") element\n  = return [InlineDiagram]\nchildElemToRun ns element\n  | isElem ns \"w\" \"footnoteReference\" element\n  , Just fnId <- findAttrByName ns \"w\" \"id\" element = do\n    notes <- asks envNotes\n    case lookupFootnote fnId notes of\n      Just e -> do bps <- local (\\r -> r {envLocation=InFootnote}) $ mapD (elemToBodyPart ns) (elChildren e)\n                   return [Footnote bps]\n      Nothing  -> return [Footnote []]\nchildElemToRun ns element\n  | isElem ns \"w\" \"endnoteReference\" element\n  , Just enId <- findAttrByName ns \"w\" \"id\" element = do\n    notes <- asks envNotes\n    case lookupEndnote enId notes of\n      Just e -> do bps <- local (\\r -> r {envLocation=InEndnote}) $ mapD (elemToBodyPart ns) (elChildren e)\n                   return [Endnote bps]\n      Nothing  -> return [Endnote []]\nchildElemToRun _ _ = throwError WrongElem\n\nelemToRun :: NameSpaces -> Element -> D [Run]\nelemToRun ns element\n  | isElem ns \"w\" \"r\" element\n  , Just drawingElem <- findChildByName ns \"w\" \"drawing\" element =\n    childElemToRun ns drawingElem\nelemToRun ns element\n  | isElem ns \"w\" \"r\" element\n  , Just ref <- findChildByName ns \"w\" \"footnoteReference\" element =\n    childElemToRun ns ref\nelemToRun ns element\n  | isElem ns \"w\" \"r\" element\n  , Just ref <- findChildByName ns \"w\" \"endnoteReference\" element =\n    childElemToRun ns ref\nelemToRun ns element\n  | isElem ns \"w\" \"r\" element = do\n    runElems <- elemToRunElems ns element\n    runStyle <- elemToRunStyleD ns element\n    return [Run runStyle runElems]\nelemToRun _ _ = throwError WrongElem\n\ngetParentStyleValue :: (ParStyle -> Maybe a) -> ParStyle -> Maybe a\ngetParentStyleValue field style\n  | Just value <- field style = Just value\n  | Just parentStyle <- psParentStyle style\n                      = getParentStyleValue field parentStyle\ngetParentStyleValue _ _ = Nothing\n\ngetParStyleField :: (ParStyle -> Maybe a) -> [ParStyle] -> Maybe a\ngetParStyleField field styles\n  | (y:_) <- mapMaybe (getParentStyleValue field) styles\n           = Just y\ngetParStyleField _ _ = Nothing\n\ngetTrackedChange :: NameSpaces -> Element -> Maybe TrackedChange\ngetTrackedChange ns element\n  | isElem ns \"w\" \"ins\" element || isElem ns \"w\" \"moveTo\" element\n  , Just cId <- findAttrByName ns \"w\" \"id\" element\n  , Just cAuthor <- findAttrByName ns \"w\" \"author\" element\n  , mcDate <- findAttrByName ns \"w\" \"date\" element =\n      Just $ TrackedChange Insertion (ChangeInfo cId cAuthor mcDate)\ngetTrackedChange ns element\n  | isElem ns \"w\" \"del\" element || isElem ns \"w\" \"moveFrom\" element\n  , Just cId <- findAttrByName ns \"w\" \"id\" element\n  , Just cAuthor <- findAttrByName ns \"w\" \"author\" element\n  , mcDate <- findAttrByName ns \"w\" \"date\" element =\n      Just $ TrackedChange Deletion (ChangeInfo cId cAuthor mcDate)\ngetTrackedChange _ _ = Nothing\n\nelemToParagraphStyle :: NameSpaces -> Element\n                     -> ParStyleMap\n                     -> Numbering\n                     -> ParagraphStyle\nelemToParagraphStyle ns element sty numbering\n  | Just pPr <- findChildByName ns \"w\" \"pPr\" element =\n    let style =\n          mapMaybe\n          (fmap ParaStyleId . findAttrByName ns \"w\" \"val\")\n          (findChildrenByName ns \"w\" \"pStyle\" pPr)\n        pStyle' = mapMaybe (`M.lookup` sty) style\n    in ParagraphStyle\n      {pStyle = pStyle'\n      , numbered = case getNumInfo ns element of\n          Just (numId, lvl) -> isJust $ lookupLevel numId lvl numbering\n          Nothing -> isJust $ getParStyleField numInfo pStyle'\n      , justification =\n          case findChildByName ns \"w\" \"jc\" pPr >>= findAttrByName ns \"w\" \"val\" of\n            Nothing -> Nothing\n            Just \"both\" -> Just JustifyBoth\n            Just \"center\" -> Just JustifyCenter\n            Just \"left\" -> Just JustifyLeft\n            Just \"right\" -> Just JustifyRight\n            _ -> Nothing\n      , indentation =\n          getIndentation ns element\n      , dropCap =\n          case\n            findChildByName ns \"w\" \"framePr\" pPr >>=\n            findAttrByName ns \"w\" \"dropCap\"\n          of\n            Just \"none\" -> False\n            Just _      -> True\n            Nothing     -> False\n      , pChange     = findChildByName ns \"w\" \"rPr\" pPr >>=\n                      filterChild (\\e -> isElem ns \"w\" \"ins\" e ||\n                                         isElem ns \"w\" \"moveTo\" e ||\n                                         isElem ns \"w\" \"del\" e ||\n                                         isElem ns \"w\" \"moveFrom\" e\n                                  ) >>=\n                      getTrackedChange ns\n      , pBidi = checkOnOff ns pPr (elemName ns \"w\" \"bidi\")\n      , pKeepNext = isJust $ findChildByName ns \"w\" \"keepNext\" pPr\n      }\n  | otherwise = defaultParagraphStyle\n\nelemToRunStyleD :: NameSpaces -> Element -> D RunStyle\nelemToRunStyleD ns element\n  | Just rPr <- findChildByName ns \"w\" \"rPr\" element = do\n    charStyles <- asks envCharStyles\n    let parentSty =\n          findChildByName ns \"w\" \"rStyle\" rPr >>=\n          findAttrByName ns \"w\" \"val\" >>=\n          flip M.lookup charStyles . CharStyleId\n    return $ elemToRunStyle ns element parentSty\nelemToRunStyleD _ _ = return defaultRunStyle\n\nelemToRunElem :: NameSpaces -> Element -> D RunElem\nelemToRunElem ns element\n  | isElem ns \"w\" \"t\" element\n    || isElem ns \"w\" \"delText\" element\n    || isElem ns \"m\" \"t\" element = do\n    let str = strContent element\n    font <- asks envFont\n    case font of\n      Nothing -> return $ TextRun str\n      Just f  -> return . TextRun $\n                   T.map (\\c -> fromMaybe c (getFontChar f c)) str\n  | isElem ns \"w\" \"br\" element = return LnBrk\n  | isElem ns \"w\" \"tab\" element = return Tab\n  | isElem ns \"w\" \"softHyphen\" element = return SoftHyphen\n  | isElem ns \"w\" \"noBreakHyphen\" element = return NoBreakHyphen\n  | isElem ns \"w\" \"sym\" element = return (getSymChar ns element)\n  | otherwise = throwError WrongElem\n\n-- The char attribute is a hex string\ngetSymChar :: NameSpaces -> Element -> RunElem\ngetSymChar ns element\n  | Just s <- getCodepoint\n  , Just font <- getFont =\n    case readLitChar (\"\\\\x\" ++ T.unpack s) of\n         [(ch, _)] ->\n              TextRun $ T.singleton $ fromMaybe ch $ getFontChar font ch\n         _ -> TextRun \"\"\n  where\n    getCodepoint = findAttrByName ns \"w\" \"char\" element\n    getFont = findAttrByName ns \"w\" \"font\" element >>= textToFont\ngetSymChar _ _ = TextRun \"\"\n\ngetFontChar :: Font -> Char -> Maybe Char\ngetFontChar font ch = chr <$> M.lookup (font, point) symbolMap\n where\n   point  -- sometimes F000 is added to put char in private range:\n      | ch >= '\\xF000' = ord ch - 0xF000\n      | otherwise = ord ch\n\nelemToRunElems :: NameSpaces -> Element -> D [RunElem]\nelemToRunElems ns element\n  |  isElem ns \"w\" \"r\" element\n     || isElem ns \"m\" \"r\" element = do\n       let qualName = elemName ns \"w\"\n       let font = do\n                    fontElem <- findElement (qualName \"rFonts\") element\n                    foldr ((<|>) . (flip findAttr fontElem . qualName))\n                         Nothing [\"ascii\", \"hAnsi\"]\n                      >>= textToFont\n       local (setFont font) (mapD (elemToRunElem ns) (elChildren element))\nelemToRunElems _ _ = throwError WrongElem\n\nsetFont :: Maybe Font -> ReaderEnv -> ReaderEnv\nsetFont f s = s{envFont = f}\n\nfindBlip :: Element -> Maybe Element\nfindBlip el = do\n  blip <- filterElementName (matchQName \"drawingml\" \"main\" (Just \"a\") \"blip\") el\n  -- return svg if present:\n  filterElementName (\\(QName tag _ _) -> tag == \"svgBlip\") el `mplus` pure blip\n\n-- | Checks if any style in the style hierarchy is a caption style.\nhasCaptionStyle :: ParagraphStyle -> Bool\nhasCaptionStyle =\n  any (isCaptionStyleName . pStyleName) . concatMap nestedStyles . pStyle\n where -- note that these are case insensitive:\n   isCaptionStyleName \"caption\" = True\n   isCaptionStyleName \"table caption\" = True\n   isCaptionStyleName \"image caption\" = True\n   isCaptionStyleName _ = False\n\n   -- Gets all the style names in the style hierarchy\n   nestedStyles :: ParStyle -> [ParStyle]\n   nestedStyles ps = ps : maybe [] nestedStyles (psParentStyle ps)\n\nstripCaptionLabel :: [Element] -> [Element]\nstripCaptionLabel els =\n  if any isNumberElt els\n     then dropWhile (not . isNumberElt) els\n     else els\n  where\n    isNumberElt el@(Element name attribs _ _) =\n       (qName name == \"fldSimple\" &&\n             case lookupAttrBy ((== \"instr\") . qName) attribs of\n               Nothing -> False\n               Just instr -> \"Table\" `elem` T.words instr ||\n                             \"Figure\" `elem` T.words instr) ||\n       (qName name == \"instrText\" &&\n          let ws = T.words (strContent el)\n          in  (\"Table\" `elem` ws || \"Figure\" `elem` ws))\n\nisNamespace :: Text -> Text -> Text -> Bool\nisNamespace primary secondary url =\n  -- first try transitional:\n  case T.stripPrefix \"http://schemas.openxmlformats.org/\" url of\n    Just path -> path == primary <> \"/2006/\" <> secondary\n    Nothing -> -- then try strict:\n      case T.stripPrefix \"http://purl.oclc.org/ooxml/\" url of\n        Just path -> path == primary <> \"/\" <> snakeToCamel secondary\n        Nothing -> False\n where\n   snakeToCamel \"custom-properties\" = \"customProperties\"\n   snakeToCamel \"extended-properties\" = \"extendedProperties\"\n   snakeToCamel x = x\n\nmatchQName :: Text -> Text -> Maybe Text -> Text -> QName -> Bool\nmatchQName primary secondary mbprefix name (QName name' mbns' mbprefix') =\n  name == name' &&\n  (isNothing mbprefix || mbprefix' == mbprefix) &&\n  maybe True (isNamespace primary secondary) mbns'\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Symbols.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Docx.Symbols\n   Copyright   : © 2023 John MacFarlane <jgm@berkeley.edu>\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nSymbol tables for MS symbol fonts. This is needed for w:sym.\n-}\nmodule Text.Pandoc.Readers.Docx.Symbols ( Font(..),\n                                          textToFont,\n                                          symbolMap ) where\n\nimport Data.Text (Text)\nimport qualified Data.Map as M\n\ndata Font = Symbol | Wingdings | Wingdings2 | Wingdings3 | Webdings\n  deriving (Show, Ord, Eq)\n\ntextToFont :: Text -> Maybe Font\ntextToFont \"Symbol\" = Just Symbol\ntextToFont \"Wingdings\" = Just Wingdings\ntextToFont \"Wingdings 2\" = Just Wingdings2\ntextToFont \"Wingdings 3\" = Just Wingdings3\ntextToFont \"Webdings\" = Just Webdings\ntextToFont _ = Nothing\n\n-- \\ Maps font and internal character number to Unicode code point.\nsymbolMap :: M.Map (Font, Int) Int\nsymbolMap = M.fromList\n  [((Wingdings, 0x21), 0x1F589)\n  ,((Wingdings, 0x22), 0x2702)\n  ,((Wingdings, 0x23), 0x2701)\n  ,((Wingdings, 0x24), 0x1F453)\n  ,((Wingdings, 0x25), 0x1F56D)\n  ,((Wingdings, 0x26), 0x1F56E)\n  ,((Wingdings, 0x27), 0x1F56F)\n  ,((Wingdings, 0x28), 0x1F57F)\n  ,((Wingdings, 0x29), 0x2706)\n  ,((Wingdings, 0x2A), 0x1F582)\n  ,((Wingdings, 0x2B), 0x1F583)\n  ,((Wingdings, 0x2C), 0x1F4EA)\n  ,((Wingdings, 0x2D), 0x1F4EB)\n  ,((Wingdings, 0x2E), 0x1F4EC)\n  ,((Wingdings, 0x2F), 0x1F4ED)\n  ,((Wingdings, 0x30), 0x1F4C1)\n  ,((Wingdings, 0x31), 0x1F4C2)\n  ,((Wingdings, 0x32), 0x1F4C4)\n  ,((Wingdings, 0x33), 0x1F5CF)\n  ,((Wingdings, 0x34), 0x1F5D0)\n  ,((Wingdings, 0x35), 0x1F5C4)\n  ,((Wingdings, 0x36), 0x231B)\n  ,((Wingdings, 0x37), 0x1F5AE)\n  ,((Wingdings, 0x38), 0x1F5B0)\n  ,((Wingdings, 0x39), 0x1F5B2)\n  ,((Wingdings, 0x3A), 0x1F5B3)\n  ,((Wingdings, 0x3B), 0x1F5B4)\n  ,((Wingdings, 0x3C), 0x1F5AB)\n  ,((Wingdings, 0x3D), 0x1F5AC)\n  ,((Wingdings, 0x3E), 0x2707)\n  ,((Wingdings, 0x3F), 0x270D)\n  ,((Wingdings, 0x40), 0x1F58E)\n  ,((Wingdings, 0x41), 0x270C)\n  ,((Wingdings, 0x42), 0x1F44C)\n  ,((Wingdings, 0x43), 0x1F44D)\n  ,((Wingdings, 0x44), 0x1F44E)\n  ,((Wingdings, 0x45), 0x261C)\n  ,((Wingdings, 0x46), 0x261E)\n  ,((Wingdings, 0x47), 0x261D)\n  ,((Wingdings, 0x48), 0x261F)\n  ,((Wingdings, 0x49), 0x1F590)\n  ,((Wingdings, 0x4A), 0x263A)\n  ,((Wingdings, 0x4B), 0x1F610)\n  ,((Wingdings, 0x4C), 0x2639)\n  ,((Wingdings, 0x4D), 0x1F4A3)\n  ,((Wingdings, 0x4E), 0x2620)\n  ,((Wingdings, 0x4F), 0x1F3F3)\n  ,((Wingdings, 0x50), 0x1F3F1)\n  ,((Wingdings, 0x51), 0x2708)\n  ,((Wingdings, 0x52), 0x263C)\n  ,((Wingdings, 0x53), 0x1F4A7)\n  ,((Wingdings, 0x54), 0x2744)\n  ,((Wingdings, 0x55), 0x1F546)\n  ,((Wingdings, 0x56), 0x271E)\n  ,((Wingdings, 0x57), 0x1F548)\n  ,((Wingdings, 0x58), 0x2720)\n  ,((Wingdings, 0x59), 0x2721)\n  ,((Wingdings, 0x5A), 0x262A)\n  ,((Wingdings, 0x5B), 0x262F)\n  ,((Wingdings, 0x5C), 0x0950)\n  ,((Wingdings, 0x5D), 0x2638)\n  ,((Wingdings, 0x5E), 0x2648)\n  ,((Wingdings, 0x5F), 0x2649)\n  ,((Wingdings, 0x60), 0x264A)\n  ,((Wingdings, 0x61), 0x264B)\n  ,((Wingdings, 0x62), 0x264C)\n  ,((Wingdings, 0x63), 0x264D)\n  ,((Wingdings, 0x64), 0x264E)\n  ,((Wingdings, 0x65), 0x264F)\n  ,((Wingdings, 0x66), 0x2650)\n  ,((Wingdings, 0x67), 0x2651)\n  ,((Wingdings, 0x68), 0x2652)\n  ,((Wingdings, 0x69), 0x2653)\n  ,((Wingdings, 0x6A), 0x1F670)\n  ,((Wingdings, 0x6B), 0x1F675)\n  ,((Wingdings, 0x6C), 0x25CF)\n  ,((Wingdings, 0x6D), 0x1F53E)\n  ,((Wingdings, 0x6E), 0x25A0)\n  ,((Wingdings, 0x6F), 0x25A1)\n  ,((Wingdings, 0x70), 0x1F790)\n  ,((Wingdings, 0x71), 0x2751)\n  ,((Wingdings, 0x72), 0x2752)\n  ,((Wingdings, 0x73), 0x2B27)\n  ,((Wingdings, 0x74), 0x29EB)\n  ,((Wingdings, 0x75), 0x25C6)\n  ,((Wingdings, 0x76), 0x2756)\n  ,((Wingdings, 0x77), 0x2B25)\n  ,((Wingdings, 0x78), 0x2327)\n  ,((Wingdings, 0x79), 0x2BB9)\n  ,((Wingdings, 0x7A), 0x2318)\n  ,((Wingdings, 0x7B), 0x1F3F5)\n  ,((Wingdings, 0x7C), 0x1F3F6)\n  ,((Wingdings, 0x7D), 0x1F676)\n  ,((Wingdings, 0x7E), 0x1F677)\n  ,((Wingdings, 0x80), 0x24EA)\n  ,((Wingdings, 0x81), 0x2460)\n  ,((Wingdings, 0x82), 0x2461)\n  ,((Wingdings, 0x83), 0x2462)\n  ,((Wingdings, 0x84), 0x2463)\n  ,((Wingdings, 0x85), 0x2464)\n  ,((Wingdings, 0x86), 0x2465)\n  ,((Wingdings, 0x87), 0x2466)\n  ,((Wingdings, 0x88), 0x2467)\n  ,((Wingdings, 0x89), 0x2468)\n  ,((Wingdings, 0x8A), 0x2469)\n  ,((Wingdings, 0x8B), 0x24FF)\n  ,((Wingdings, 0x8C), 0x2776)\n  ,((Wingdings, 0x8D), 0x2777)\n  ,((Wingdings, 0x8E), 0x2778)\n  ,((Wingdings, 0x8F), 0x2779)\n  ,((Wingdings, 0x90), 0x277A)\n  ,((Wingdings, 0x91), 0x277B)\n  ,((Wingdings, 0x92), 0x277C)\n  ,((Wingdings, 0x93), 0x277D)\n  ,((Wingdings, 0x94), 0x277E)\n  ,((Wingdings, 0x95), 0x277F)\n  ,((Wingdings, 0x96), 0x1F662)\n  ,((Wingdings, 0x97), 0x1F660)\n  ,((Wingdings, 0x98), 0x1F661)\n  ,((Wingdings, 0x99), 0x1F663)\n  ,((Wingdings, 0x9A), 0x1F65E)\n  ,((Wingdings, 0x9B), 0x1F65C)\n  ,((Wingdings, 0x9C), 0x1F65D)\n  ,((Wingdings, 0x9D), 0x1F65F)\n  ,((Wingdings, 0x9E), 0x00B7)\n  ,((Wingdings, 0x9F), 0x2022)\n  ,((Wingdings, 0xA1), 0x26AA)\n  ,((Wingdings, 0xA2), 0x1F786)\n  ,((Wingdings, 0xA3), 0x1F788)\n  ,((Wingdings, 0xA4), 0x25C9)\n  ,((Wingdings, 0xA5), 0x25CE)\n  ,((Wingdings, 0xA6), 0x1F53F)\n  ,((Wingdings, 0xA7), 0x25AA)\n  ,((Wingdings, 0xA8), 0x25FB)\n  ,((Wingdings, 0xA9), 0x1F7C2)\n  ,((Wingdings, 0xAA), 0x2726)\n  ,((Wingdings, 0xAB), 0x2605)\n  ,((Wingdings, 0xAC), 0x2736)\n  ,((Wingdings, 0xAD), 0x2734)\n  ,((Wingdings, 0xAE), 0x2739)\n  ,((Wingdings, 0xAF), 0x2735)\n  ,((Wingdings, 0xB0), 0x2BD0)\n  ,((Wingdings, 0xB1), 0x2316)\n  ,((Wingdings, 0xB2), 0x27E1)\n  ,((Wingdings, 0xB3), 0x2311)\n  ,((Wingdings, 0xB4), 0x2BD1)\n  ,((Wingdings, 0xB5), 0x272A)\n  ,((Wingdings, 0xB6), 0x2730)\n  ,((Wingdings, 0xB7), 0x1F550)\n  ,((Wingdings, 0xB8), 0x1F551)\n  ,((Wingdings, 0xB9), 0x1F552)\n  ,((Wingdings, 0xBA), 0x1F553)\n  ,((Wingdings, 0xBB), 0x1F554)\n  ,((Wingdings, 0xBC), 0x1F555)\n  ,((Wingdings, 0xBD), 0x1F556)\n  ,((Wingdings, 0xBE), 0x1F557)\n  ,((Wingdings, 0xBF), 0x1F558)\n  ,((Wingdings, 0xC0), 0x1F559)\n  ,((Wingdings, 0xC1), 0x1F55A)\n  ,((Wingdings, 0xC2), 0x1F55B)\n  ,((Wingdings, 0xC3), 0x2BB0)\n  ,((Wingdings, 0xC4), 0x2BB1)\n  ,((Wingdings, 0xC5), 0x2BB2)\n  ,((Wingdings, 0xC6), 0x2BB3)\n  ,((Wingdings, 0xC7), 0x2BB4)\n  ,((Wingdings, 0xC8), 0x2BB5)\n  ,((Wingdings, 0xC9), 0x2BB6)\n  ,((Wingdings, 0xCA), 0x2BB7)\n  ,((Wingdings, 0xCB), 0x1F66A)\n  ,((Wingdings, 0xCC), 0x1F66B)\n  ,((Wingdings, 0xCD), 0x1F655)\n  ,((Wingdings, 0xCE), 0x1F654)\n  ,((Wingdings, 0xCF), 0x1F657)\n  ,((Wingdings, 0xD0), 0x1F656)\n  ,((Wingdings, 0xD1), 0x1F650)\n  ,((Wingdings, 0xD2), 0x1F651)\n  ,((Wingdings, 0xD3), 0x1F652)\n  ,((Wingdings, 0xD4), 0x1F653)\n  ,((Wingdings, 0xD5), 0x232B)\n  ,((Wingdings, 0xD6), 0x2326)\n  ,((Wingdings, 0xD7), 0x2B98)\n  ,((Wingdings, 0xD8), 0x2B9A)\n  ,((Wingdings, 0xD9), 0x2B99)\n  ,((Wingdings, 0xDA), 0x2B9B)\n  ,((Wingdings, 0xDB), 0x2B88)\n  ,((Wingdings, 0xDC), 0x2B8A)\n  ,((Wingdings, 0xDD), 0x2B89)\n  ,((Wingdings, 0xDE), 0x2B8B)\n  ,((Wingdings, 0xDF), 0x1F868)\n  ,((Wingdings, 0xE0), 0x1F86A)\n  ,((Wingdings, 0xE1), 0x1F869)\n  ,((Wingdings, 0xE2), 0x1F86B)\n  ,((Wingdings, 0xE3), 0x1F86C)\n  ,((Wingdings, 0xE4), 0x1F86D)\n  ,((Wingdings, 0xE5), 0x1F86F)\n  ,((Wingdings, 0xE6), 0x1F86E)\n  ,((Wingdings, 0xE7), 0x1F878)\n  ,((Wingdings, 0xE8), 0x1F87A)\n  ,((Wingdings, 0xE9), 0x1F879)\n  ,((Wingdings, 0xEA), 0x1F87B)\n  ,((Wingdings, 0xEB), 0x1F87C)\n  ,((Wingdings, 0xEC), 0x1F87D)\n  ,((Wingdings, 0xED), 0x1F87F)\n  ,((Wingdings, 0xEE), 0x1F87E)\n  ,((Wingdings, 0xEF), 0x21E6)\n  ,((Wingdings, 0xF0), 0x21E8)\n  ,((Wingdings, 0xF1), 0x21E7)\n  ,((Wingdings, 0xF2), 0x21E9)\n  ,((Wingdings, 0xF3), 0x2B04)\n  ,((Wingdings, 0xF4), 0x21F3)\n  ,((Wingdings, 0xF5), 0x2B00)\n  ,((Wingdings, 0xF6), 0x2B01)\n  ,((Wingdings, 0xF7), 0x2B03)\n  ,((Wingdings, 0xF8), 0x2B02)\n  ,((Wingdings, 0xF9), 0x1F8AC)\n  ,((Wingdings, 0xFA), 0x1F8AD)\n  ,((Wingdings, 0xFB), 0x1F5F6)\n  ,((Wingdings, 0xFC), 0x2714)\n  ,((Wingdings, 0xFD), 0x1F5F7)\n  ,((Wingdings, 0xFE), 0x1F5F9)\n  ,((Wingdings2, 0x21), 0x1F58A)\n  ,((Wingdings2, 0x22), 0x1F58B)\n  ,((Wingdings2, 0x23), 0x1F58C)\n  ,((Wingdings2, 0x24), 0x1F58D)\n  ,((Wingdings2, 0x25), 0x2704)\n  ,((Wingdings2, 0x26), 0x2700)\n  ,((Wingdings2, 0x27), 0x1F57E)\n  ,((Wingdings2, 0x28), 0x1F57D)\n  ,((Wingdings2, 0x29), 0x1F5C5)\n  ,((Wingdings2, 0x2A), 0x1F5C6)\n  ,((Wingdings2, 0x2B), 0x1F5C7)\n  ,((Wingdings2, 0x2C), 0x1F5C8)\n  ,((Wingdings2, 0x2D), 0x1F5C9)\n  ,((Wingdings2, 0x2E), 0x1F5CA)\n  ,((Wingdings2, 0x2F), 0x1F5CB)\n  ,((Wingdings2, 0x30), 0x1F5CC)\n  ,((Wingdings2, 0x31), 0x1F5CD)\n  ,((Wingdings2, 0x32), 0x1F4CB)\n  ,((Wingdings2, 0x33), 0x1F5D1)\n  ,((Wingdings2, 0x34), 0x1F5D4)\n  ,((Wingdings2, 0x35), 0x1F5B5)\n  ,((Wingdings2, 0x36), 0x1F5B6)\n  ,((Wingdings2, 0x37), 0x1F5B7)\n  ,((Wingdings2, 0x38), 0x1F5B8)\n  ,((Wingdings2, 0x39), 0x1F5AD)\n  ,((Wingdings2, 0x3A), 0x1F5AF)\n  ,((Wingdings2, 0x3B), 0x1F5B1)\n  ,((Wingdings2, 0x3C), 0x1F592)\n  ,((Wingdings2, 0x3D), 0x1F593)\n  ,((Wingdings2, 0x3E), 0x1F598)\n  ,((Wingdings2, 0x3F), 0x1F599)\n  ,((Wingdings2, 0x40), 0x1F59A)\n  ,((Wingdings2, 0x41), 0x1F59B)\n  ,((Wingdings2, 0x42), 0x1F448)\n  ,((Wingdings2, 0x43), 0x1F449)\n  ,((Wingdings2, 0x44), 0x1F59C)\n  ,((Wingdings2, 0x45), 0x1F59D)\n  ,((Wingdings2, 0x46), 0x1F59E)\n  ,((Wingdings2, 0x47), 0x1F59F)\n  ,((Wingdings2, 0x48), 0x1F5A0)\n  ,((Wingdings2, 0x49), 0x1F5A1)\n  ,((Wingdings2, 0x4A), 0x1F446)\n  ,((Wingdings2, 0x4B), 0x1F447)\n  ,((Wingdings2, 0x4C), 0x1F5A2)\n  ,((Wingdings2, 0x4D), 0x1F5A3)\n  ,((Wingdings2, 0x4E), 0x1F591)\n  ,((Wingdings2, 0x4F), 0x1F5F4)\n  ,((Wingdings2, 0x50), 0x2713)\n  ,((Wingdings2, 0x51), 0x1F5F5)\n  ,((Wingdings2, 0x52), 0x2611)\n  ,((Wingdings2, 0x53), 0x2612)\n  ,((Wingdings2, 0x54), 0x2612)\n  ,((Wingdings2, 0x55), 0x2BBE)\n  ,((Wingdings2, 0x56), 0x2BBF)\n  ,((Wingdings2, 0x57), 0x29B8)\n  ,((Wingdings2, 0x58), 0x29B8)\n  ,((Wingdings2, 0x59), 0x1F671)\n  ,((Wingdings2, 0x5A), 0x1F674)\n  ,((Wingdings2, 0x5B), 0x1F672)\n  ,((Wingdings2, 0x5C), 0x1F673)\n  ,((Wingdings2, 0x5D), 0x203D)\n  ,((Wingdings2, 0x5E), 0x1F679)\n  ,((Wingdings2, 0x5F), 0x1F67A)\n  ,((Wingdings2, 0x60), 0x1F67B)\n  ,((Wingdings2, 0x61), 0x1F666)\n  ,((Wingdings2, 0x62), 0x1F664)\n  ,((Wingdings2, 0x63), 0x1F665)\n  ,((Wingdings2, 0x64), 0x1F667)\n  ,((Wingdings2, 0x65), 0x1F65A)\n  ,((Wingdings2, 0x66), 0x1F658)\n  ,((Wingdings2, 0x67), 0x1F659)\n  ,((Wingdings2, 0x68), 0x1F65B)\n  ,((Wingdings2, 0x69), 0x24EA)\n  ,((Wingdings2, 0x6A), 0x2460)\n  ,((Wingdings2, 0x6B), 0x2461)\n  ,((Wingdings2, 0x6C), 0x2462)\n  ,((Wingdings2, 0x6D), 0x2463)\n  ,((Wingdings2, 0x6E), 0x2464)\n  ,((Wingdings2, 0x6F), 0x2465)\n  ,((Wingdings2, 0x70), 0x2466)\n  ,((Wingdings2, 0x71), 0x2467)\n  ,((Wingdings2, 0x72), 0x2468)\n  ,((Wingdings2, 0x73), 0x2469)\n  ,((Wingdings2, 0x74), 0x24FF)\n  ,((Wingdings2, 0x75), 0x2776)\n  ,((Wingdings2, 0x76), 0x2777)\n  ,((Wingdings2, 0x77), 0x2778)\n  ,((Wingdings2, 0x78), 0x2779)\n  ,((Wingdings2, 0x79), 0x277A)\n  ,((Wingdings2, 0x7A), 0x277B)\n  ,((Wingdings2, 0x7B), 0x277C)\n  ,((Wingdings2, 0x7C), 0x277D)\n  ,((Wingdings2, 0x7D), 0x277E)\n  ,((Wingdings2, 0x7E), 0x277F)\n  ,((Wingdings2, 0x80), 0x2609)\n  ,((Wingdings2, 0x81), 0x1F315)\n  ,((Wingdings2, 0x82), 0x263D)\n  ,((Wingdings2, 0x83), 0x263E)\n  ,((Wingdings2, 0x84), 0x2E3F)\n  ,((Wingdings2, 0x85), 0x271D)\n  ,((Wingdings2, 0x86), 0x1F547)\n  ,((Wingdings2, 0x87), 0x1F55C)\n  ,((Wingdings2, 0x88), 0x1F55D)\n  ,((Wingdings2, 0x89), 0x1F55E)\n  ,((Wingdings2, 0x8A), 0x1F55F)\n  ,((Wingdings2, 0x8B), 0x1F560)\n  ,((Wingdings2, 0x8C), 0x1F561)\n  ,((Wingdings2, 0x8D), 0x1F562)\n  ,((Wingdings2, 0x8E), 0x1F563)\n  ,((Wingdings2, 0x8F), 0x1F564)\n  ,((Wingdings2, 0x90), 0x1F565)\n  ,((Wingdings2, 0x91), 0x1F566)\n  ,((Wingdings2, 0x92), 0x1F567)\n  ,((Wingdings2, 0x93), 0x1F668)\n  ,((Wingdings2, 0x94), 0x1F669)\n  ,((Wingdings2, 0x95), 0x2022)\n  ,((Wingdings2, 0x96), 0x25CF)\n  ,((Wingdings2, 0x97), 0x26AB)\n  ,((Wingdings2, 0x98), 0x2B24)\n  ,((Wingdings2, 0x99), 0x1F785)\n  ,((Wingdings2, 0x9A), 0x1F786)\n  ,((Wingdings2, 0x9B), 0x1F787)\n  ,((Wingdings2, 0x9C), 0x1F788)\n  ,((Wingdings2, 0x9D), 0x1F78A)\n  ,((Wingdings2, 0x9E), 0x29BF)\n  ,((Wingdings2, 0x9F), 0x25FE)\n  ,((Wingdings2, 0xA1), 0x25FC)\n  ,((Wingdings2, 0xA2), 0x2B1B)\n  ,((Wingdings2, 0xA3), 0x2B1C)\n  ,((Wingdings2, 0xA4), 0x1F791)\n  ,((Wingdings2, 0xA5), 0x1F792)\n  ,((Wingdings2, 0xA6), 0x1F793)\n  ,((Wingdings2, 0xA7), 0x1F794)\n  ,((Wingdings2, 0xA8), 0x25A3)\n  ,((Wingdings2, 0xA9), 0x1F795)\n  ,((Wingdings2, 0xAA), 0x1F796)\n  ,((Wingdings2, 0xAB), 0x1F797)\n  ,((Wingdings2, 0xAC), 0x2B29)\n  ,((Wingdings2, 0xAD), 0x2B25)\n  ,((Wingdings2, 0xAE), 0x25C6)\n  ,((Wingdings2, 0xAF), 0x25C7)\n  ,((Wingdings2, 0xB0), 0x1F79A)\n  ,((Wingdings2, 0xB1), 0x25C8)\n  ,((Wingdings2, 0xB2), 0x1F79B)\n  ,((Wingdings2, 0xB3), 0x1F79C)\n  ,((Wingdings2, 0xB4), 0x1F79D)\n  ,((Wingdings2, 0xB5), 0x2B2A)\n  ,((Wingdings2, 0xB6), 0x2B27)\n  ,((Wingdings2, 0xB7), 0x29EB)\n  ,((Wingdings2, 0xB8), 0x25CA)\n  ,((Wingdings2, 0xB9), 0x1F7A0)\n  ,((Wingdings2, 0xBA), 0x25D6)\n  ,((Wingdings2, 0xBB), 0x25D7)\n  ,((Wingdings2, 0xBC), 0x2BCA)\n  ,((Wingdings2, 0xBD), 0x2BCB)\n  ,((Wingdings2, 0xBE), 0x25FC)\n  ,((Wingdings2, 0xBF), 0x2B25)\n  ,((Wingdings2, 0xC0), 0x2B1F)\n  ,((Wingdings2, 0xC1), 0x2BC2)\n  ,((Wingdings2, 0xC2), 0x2B23)\n  ,((Wingdings2, 0xC3), 0x2B22)\n  ,((Wingdings2, 0xC4), 0x2BC3)\n  ,((Wingdings2, 0xC5), 0x2BC4)\n  ,((Wingdings2, 0xC6), 0x1F7A1)\n  ,((Wingdings2, 0xC7), 0x1F7A2)\n  ,((Wingdings2, 0xC8), 0x1F7A3)\n  ,((Wingdings2, 0xC9), 0x1F7A4)\n  ,((Wingdings2, 0xCA), 0x1F7A5)\n  ,((Wingdings2, 0xCB), 0x1F7A6)\n  ,((Wingdings2, 0xCC), 0x1F7A7)\n  ,((Wingdings2, 0xCD), 0x1F7A8)\n  ,((Wingdings2, 0xCE), 0x1F7A9)\n  ,((Wingdings2, 0xCF), 0x1F7AA)\n  ,((Wingdings2, 0xD0), 0x1F7AB)\n  ,((Wingdings2, 0xD1), 0x1F7AC)\n  ,((Wingdings2, 0xD2), 0x1F7AD)\n  ,((Wingdings2, 0xD3), 0x1F7AE)\n  ,((Wingdings2, 0xD4), 0x1F7AF)\n  ,((Wingdings2, 0xD5), 0x1F7B0)\n  ,((Wingdings2, 0xD6), 0x1F7B1)\n  ,((Wingdings2, 0xD7), 0x1F7B2)\n  ,((Wingdings2, 0xD8), 0x1F7B3)\n  ,((Wingdings2, 0xD9), 0x1F7B4)\n  ,((Wingdings2, 0xDA), 0x1F7B5)\n  ,((Wingdings2, 0xDB), 0x1F7B6)\n  ,((Wingdings2, 0xDC), 0x1F7B7)\n  ,((Wingdings2, 0xDD), 0x1F7B8)\n  ,((Wingdings2, 0xDE), 0x1F7B9)\n  ,((Wingdings2, 0xDF), 0x1F7BA)\n  ,((Wingdings2, 0xE0), 0x1F7BB)\n  ,((Wingdings2, 0xE1), 0x1F7BC)\n  ,((Wingdings2, 0xE2), 0x1F7BD)\n  ,((Wingdings2, 0xE3), 0x1F7BE)\n  ,((Wingdings2, 0xE4), 0x1F7BF)\n  ,((Wingdings2, 0xE5), 0x1F7C0)\n  ,((Wingdings2, 0xE6), 0x1F7C2)\n  ,((Wingdings2, 0xE7), 0x1F7C4)\n  ,((Wingdings2, 0xE8), 0x2726)\n  ,((Wingdings2, 0xE9), 0x1F7C9)\n  ,((Wingdings2, 0xEA), 0x2605)\n  ,((Wingdings2, 0xEB), 0x2736)\n  ,((Wingdings2, 0xEC), 0x1F7CB)\n  ,((Wingdings2, 0xED), 0x2737)\n  ,((Wingdings2, 0xEE), 0x1F7CF)\n  ,((Wingdings2, 0xEF), 0x1F7D2)\n  ,((Wingdings2, 0xF0), 0x2739)\n  ,((Wingdings2, 0xF1), 0x1F7C3)\n  ,((Wingdings2, 0xF2), 0x1F7C7)\n  ,((Wingdings2, 0xF3), 0x272F)\n  ,((Wingdings2, 0xF4), 0x1F7CD)\n  ,((Wingdings2, 0xF5), 0x1F7D4)\n  ,((Wingdings2, 0xF6), 0x2BCC)\n  ,((Wingdings2, 0xF7), 0x2BCD)\n  ,((Wingdings2, 0xF8), 0x203B)\n  ,((Wingdings2, 0xF9), 0x2042)\n  ,((Wingdings3, 0x21), 0x2B60)\n  ,((Wingdings3, 0x22), 0x2B62)\n  ,((Wingdings3, 0x23), 0x2B61)\n  ,((Wingdings3, 0x24), 0x2B63)\n  ,((Wingdings3, 0x25), 0x2B66)\n  ,((Wingdings3, 0x26), 0x2B67)\n  ,((Wingdings3, 0x27), 0x2B69)\n  ,((Wingdings3, 0x28), 0x2B68)\n  ,((Wingdings3, 0x29), 0x2B70)\n  ,((Wingdings3, 0x2A), 0x2B72)\n  ,((Wingdings3, 0x2B), 0x2B71)\n  ,((Wingdings3, 0x2C), 0x2B73)\n  ,((Wingdings3, 0x2D), 0x2B76)\n  ,((Wingdings3, 0x2E), 0x2B78)\n  ,((Wingdings3, 0x2F), 0x2B7B)\n  ,((Wingdings3, 0x30), 0x2B7D)\n  ,((Wingdings3, 0x31), 0x2B64)\n  ,((Wingdings3, 0x32), 0x2B65)\n  ,((Wingdings3, 0x33), 0x2B6A)\n  ,((Wingdings3, 0x34), 0x2B6C)\n  ,((Wingdings3, 0x35), 0x2B6B)\n  ,((Wingdings3, 0x36), 0x2B6D)\n  ,((Wingdings3, 0x37), 0x2B4D)\n  ,((Wingdings3, 0x38), 0x2BA0)\n  ,((Wingdings3, 0x39), 0x2BA1)\n  ,((Wingdings3, 0x3A), 0x2BA2)\n  ,((Wingdings3, 0x3B), 0x2BA3)\n  ,((Wingdings3, 0x3C), 0x2BA4)\n  ,((Wingdings3, 0x3D), 0x2BA5)\n  ,((Wingdings3, 0x3E), 0x2BA6)\n  ,((Wingdings3, 0x3F), 0x2BA7)\n  ,((Wingdings3, 0x40), 0x2B90)\n  ,((Wingdings3, 0x41), 0x2B91)\n  ,((Wingdings3, 0x42), 0x2B92)\n  ,((Wingdings3, 0x43), 0x2B93)\n  ,((Wingdings3, 0x44), 0x2B80)\n  ,((Wingdings3, 0x45), 0x2B83)\n  ,((Wingdings3, 0x46), 0x2B7E)\n  ,((Wingdings3, 0x47), 0x2B7F)\n  ,((Wingdings3, 0x48), 0x2B84)\n  ,((Wingdings3, 0x49), 0x2B86)\n  ,((Wingdings3, 0x4A), 0x2B85)\n  ,((Wingdings3, 0x4B), 0x2B87)\n  ,((Wingdings3, 0x4C), 0x2B8F)\n  ,((Wingdings3, 0x4D), 0x2B8D)\n  ,((Wingdings3, 0x4E), 0x2B8E)\n  ,((Wingdings3, 0x4F), 0x2B8C)\n  ,((Wingdings3, 0x50), 0x2B6E)\n  ,((Wingdings3, 0x51), 0x2B6F)\n  ,((Wingdings3, 0x52), 0x238B)\n  ,((Wingdings3, 0x53), 0x2324)\n  ,((Wingdings3, 0x54), 0x2303)\n  ,((Wingdings3, 0x55), 0x2325)\n  ,((Wingdings3, 0x56), 0x23B5)\n  ,((Wingdings3, 0x57), 0x237D)\n  ,((Wingdings3, 0x58), 0x21EA)\n  ,((Wingdings3, 0x59), 0x2BB8)\n  ,((Wingdings3, 0x5A), 0x1F8A0)\n  ,((Wingdings3, 0x5B), 0x1F8A1)\n  ,((Wingdings3, 0x5C), 0x1F8A2)\n  ,((Wingdings3, 0x5D), 0x1F8A3)\n  ,((Wingdings3, 0x5E), 0x1F8A4)\n  ,((Wingdings3, 0x5F), 0x1F8A5)\n  ,((Wingdings3, 0x60), 0x1F8A6)\n  ,((Wingdings3, 0x61), 0x1F8A7)\n  ,((Wingdings3, 0x62), 0x1F8A8)\n  ,((Wingdings3, 0x63), 0x1F8A9)\n  ,((Wingdings3, 0x64), 0x1F8AA)\n  ,((Wingdings3, 0x65), 0x1F8AB)\n  ,((Wingdings3, 0x66), 0x2190)\n  ,((Wingdings3, 0x67), 0x2192)\n  ,((Wingdings3, 0x68), 0x2191)\n  ,((Wingdings3, 0x69), 0x2193)\n  ,((Wingdings3, 0x6A), 0x2196)\n  ,((Wingdings3, 0x6B), 0x2197)\n  ,((Wingdings3, 0x6C), 0x2199)\n  ,((Wingdings3, 0x6D), 0x2198)\n  ,((Wingdings3, 0x6E), 0x1F858)\n  ,((Wingdings3, 0x6F), 0x1F859)\n  ,((Wingdings3, 0x70), 0x25B2)\n  ,((Wingdings3, 0x71), 0x25BC)\n  ,((Wingdings3, 0x72), 0x25B3)\n  ,((Wingdings3, 0x73), 0x25BD)\n  ,((Wingdings3, 0x74), 0x25C4)\n  ,((Wingdings3, 0x75), 0x25BA)\n  ,((Wingdings3, 0x76), 0x25C1)\n  ,((Wingdings3, 0x77), 0x25B7)\n  ,((Wingdings3, 0x78), 0x25E3)\n  ,((Wingdings3, 0x79), 0x25E2)\n  ,((Wingdings3, 0x7A), 0x25E4)\n  ,((Wingdings3, 0x7B), 0x25E5)\n  ,((Wingdings3, 0x7C), 0x1F780)\n  ,((Wingdings3, 0x7D), 0x1F782)\n  ,((Wingdings3, 0x7E), 0x1F781)\n  ,((Wingdings3, 0x80), 0x1F783)\n  ,((Wingdings3, 0x81), 0x25B2)\n  ,((Wingdings3, 0x82), 0x25BC)\n  ,((Wingdings3, 0x83), 0x25C0)\n  ,((Wingdings3, 0x84), 0x25B6)\n  ,((Wingdings3, 0x85), 0x2B9C)\n  ,((Wingdings3, 0x86), 0x2B9E)\n  ,((Wingdings3, 0x87), 0x2B9D)\n  ,((Wingdings3, 0x88), 0x2B9F)\n  ,((Wingdings3, 0x89), 0x1F810)\n  ,((Wingdings3, 0x8A), 0x1F812)\n  ,((Wingdings3, 0x8B), 0x1F811)\n  ,((Wingdings3, 0x8C), 0x1F813)\n  ,((Wingdings3, 0x8D), 0x1F814)\n  ,((Wingdings3, 0x8E), 0x1F816)\n  ,((Wingdings3, 0x8F), 0x1F815)\n  ,((Wingdings3, 0x90), 0x1F817)\n  ,((Wingdings3, 0x91), 0x1F818)\n  ,((Wingdings3, 0x92), 0x1F81A)\n  ,((Wingdings3, 0x93), 0x1F819)\n  ,((Wingdings3, 0x94), 0x1F81B)\n  ,((Wingdings3, 0x95), 0x1F81C)\n  ,((Wingdings3, 0x96), 0x1F81E)\n  ,((Wingdings3, 0x97), 0x1F81D)\n  ,((Wingdings3, 0x98), 0x1F81F)\n  ,((Wingdings3, 0x99), 0x1F800)\n  ,((Wingdings3, 0x9A), 0x1F802)\n  ,((Wingdings3, 0x9B), 0x1F801)\n  ,((Wingdings3, 0x9C), 0x1F803)\n  ,((Wingdings3, 0x9D), 0x1F804)\n  ,((Wingdings3, 0x9E), 0x1F806)\n  ,((Wingdings3, 0x9F), 0x1F805)\n  ,((Wingdings3, 0xA1), 0x1F808)\n  ,((Wingdings3, 0xA2), 0x1F80A)\n  ,((Wingdings3, 0xA3), 0x1F809)\n  ,((Wingdings3, 0xA4), 0x1F80B)\n  ,((Wingdings3, 0xA5), 0x1F820)\n  ,((Wingdings3, 0xA6), 0x1F822)\n  ,((Wingdings3, 0xA7), 0x1F824)\n  ,((Wingdings3, 0xA8), 0x1F826)\n  ,((Wingdings3, 0xA9), 0x1F828)\n  ,((Wingdings3, 0xAA), 0x1F82A)\n  ,((Wingdings3, 0xAB), 0x1F82C)\n  ,((Wingdings3, 0xAC), 0x1F89C)\n  ,((Wingdings3, 0xAD), 0x1F89D)\n  ,((Wingdings3, 0xAE), 0x1F89E)\n  ,((Wingdings3, 0xAF), 0x1F89F)\n  ,((Wingdings3, 0xB0), 0x1F82E)\n  ,((Wingdings3, 0xB1), 0x1F830)\n  ,((Wingdings3, 0xB2), 0x1F832)\n  ,((Wingdings3, 0xB3), 0x1F834)\n  ,((Wingdings3, 0xB4), 0x1F836)\n  ,((Wingdings3, 0xB5), 0x1F838)\n  ,((Wingdings3, 0xB6), 0x1F83A)\n  ,((Wingdings3, 0xB7), 0x1F839)\n  ,((Wingdings3, 0xB8), 0x1F83B)\n  ,((Wingdings3, 0xB9), 0x1F898)\n  ,((Wingdings3, 0xBA), 0x1F89A)\n  ,((Wingdings3, 0xBB), 0x1F899)\n  ,((Wingdings3, 0xBC), 0x1F89B)\n  ,((Wingdings3, 0xBD), 0x1F83C)\n  ,((Wingdings3, 0xBE), 0x1F83E)\n  ,((Wingdings3, 0xBF), 0x1F83D)\n  ,((Wingdings3, 0xC0), 0x1F83F)\n  ,((Wingdings3, 0xC1), 0x1F840)\n  ,((Wingdings3, 0xC2), 0x1F842)\n  ,((Wingdings3, 0xC3), 0x1F841)\n  ,((Wingdings3, 0xC4), 0x1F843)\n  ,((Wingdings3, 0xC5), 0x1F844)\n  ,((Wingdings3, 0xC6), 0x1F846)\n  ,((Wingdings3, 0xC7), 0x1F845)\n  ,((Wingdings3, 0xC8), 0x1F847)\n  ,((Wingdings3, 0xC9), 0x2BA8)\n  ,((Wingdings3, 0xCA), 0x2BA9)\n  ,((Wingdings3, 0xCB), 0x2BAA)\n  ,((Wingdings3, 0xCC), 0x2BAB)\n  ,((Wingdings3, 0xCD), 0x2BAC)\n  ,((Wingdings3, 0xCE), 0x2BAD)\n  ,((Wingdings3, 0xCF), 0x2BAE)\n  ,((Wingdings3, 0xD0), 0x2BAF)\n  ,((Wingdings3, 0xD1), 0x1F860)\n  ,((Wingdings3, 0xD2), 0x1F862)\n  ,((Wingdings3, 0xD3), 0x1F861)\n  ,((Wingdings3, 0xD4), 0x1F863)\n  ,((Wingdings3, 0xD5), 0x1F864)\n  ,((Wingdings3, 0xD6), 0x1F865)\n  ,((Wingdings3, 0xD7), 0x1F867)\n  ,((Wingdings3, 0xD8), 0x1F866)\n  ,((Wingdings3, 0xD9), 0x1F870)\n  ,((Wingdings3, 0xDA), 0x1F872)\n  ,((Wingdings3, 0xDB), 0x1F871)\n  ,((Wingdings3, 0xDC), 0x1F873)\n  ,((Wingdings3, 0xDD), 0x1F874)\n  ,((Wingdings3, 0xDE), 0x1F875)\n  ,((Wingdings3, 0xDF), 0x1F877)\n  ,((Wingdings3, 0xE0), 0x1F876)\n  ,((Wingdings3, 0xE1), 0x1F880)\n  ,((Wingdings3, 0xE2), 0x1F882)\n  ,((Wingdings3, 0xE3), 0x1F881)\n  ,((Wingdings3, 0xE4), 0x1F883)\n  ,((Wingdings3, 0xE5), 0x1F884)\n  ,((Wingdings3, 0xE6), 0x1F885)\n  ,((Wingdings3, 0xE7), 0x1F887)\n  ,((Wingdings3, 0xE8), 0x1F886)\n  ,((Wingdings3, 0xE9), 0x1F890)\n  ,((Wingdings3, 0xEA), 0x1F892)\n  ,((Wingdings3, 0xEB), 0x1F891)\n  ,((Wingdings3, 0xEC), 0x1F893)\n  ,((Wingdings3, 0xED), 0x1F894)\n  ,((Wingdings3, 0xEE), 0x1F896)\n  ,((Wingdings3, 0xEF), 0x1F895)\n  ,((Wingdings3, 0xF0), 0x1F897)\n  ,((Webdings, 0x21), 0x1F577)\n  ,((Webdings, 0x22), 0x1F578)\n  ,((Webdings, 0x23), 0x1F572)\n  ,((Webdings, 0x24), 0x1F576)\n  ,((Webdings, 0x25), 0x1F3C6)\n  ,((Webdings, 0x26), 0x1F396)\n  ,((Webdings, 0x27), 0x1F587)\n  ,((Webdings, 0x28), 0x1F5E8)\n  ,((Webdings, 0x29), 0x1F5E9)\n  ,((Webdings, 0x2A), 0x1F5F0)\n  ,((Webdings, 0x2B), 0x1F5F1)\n  ,((Webdings, 0x2C), 0x1F336)\n  ,((Webdings, 0x2D), 0x1F397)\n  ,((Webdings, 0x2E), 0x1F67E)\n  ,((Webdings, 0x2F), 0x1F67C)\n  ,((Webdings, 0x30), 0x1F5D5)\n  ,((Webdings, 0x31), 0x1F5D6)\n  ,((Webdings, 0x32), 0x1F5D7)\n  ,((Webdings, 0x33), 0x23F4)\n  ,((Webdings, 0x34), 0x23F5)\n  ,((Webdings, 0x35), 0x23F6)\n  ,((Webdings, 0x36), 0x23F7)\n  ,((Webdings, 0x37), 0x23EA)\n  ,((Webdings, 0x38), 0x23E9)\n  ,((Webdings, 0x39), 0x23EE)\n  ,((Webdings, 0x3A), 0x23ED)\n  ,((Webdings, 0x3B), 0x23F8)\n  ,((Webdings, 0x3C), 0x23F9)\n  ,((Webdings, 0x3D), 0x23FA)\n  ,((Webdings, 0x3E), 0x1F5DA)\n  ,((Webdings, 0x3F), 0x1F5F3)\n  ,((Webdings, 0x40), 0x1F6E0)\n  ,((Webdings, 0x41), 0x1F3D7)\n  ,((Webdings, 0x42), 0x1F3D8)\n  ,((Webdings, 0x43), 0x1F3D9)\n  ,((Webdings, 0x44), 0x1F3DA)\n  ,((Webdings, 0x45), 0x1F3DC)\n  ,((Webdings, 0x46), 0x1F3ED)\n  ,((Webdings, 0x47), 0x1F3DB)\n  ,((Webdings, 0x48), 0x1F3E0)\n  ,((Webdings, 0x49), 0x1F3D6)\n  ,((Webdings, 0x4A), 0x1F3DD)\n  ,((Webdings, 0x4B), 0x1F6E3)\n  ,((Webdings, 0x4C), 0x1F50D)\n  ,((Webdings, 0x4D), 0x1F3D4)\n  ,((Webdings, 0x4E), 0x1F441)\n  ,((Webdings, 0x4F), 0x1F442)\n  ,((Webdings, 0x50), 0x1F3DE)\n  ,((Webdings, 0x51), 0x1F3D5)\n  ,((Webdings, 0x52), 0x1F6E4)\n  ,((Webdings, 0x53), 0x1F3DF)\n  ,((Webdings, 0x54), 0x1F6F3)\n  ,((Webdings, 0x55), 0x1F56C)\n  ,((Webdings, 0x56), 0x1F56B)\n  ,((Webdings, 0x57), 0x1F568)\n  ,((Webdings, 0x58), 0x1F508)\n  ,((Webdings, 0x59), 0x1F394)\n  ,((Webdings, 0x5A), 0x1F395)\n  ,((Webdings, 0x5B), 0x1F5EC)\n  ,((Webdings, 0x5C), 0x1F67D)\n  ,((Webdings, 0x5D), 0x1F5ED)\n  ,((Webdings, 0x5E), 0x1F5EA)\n  ,((Webdings, 0x5F), 0x1F5EB)\n  ,((Webdings, 0x60), 0x2B94)\n  ,((Webdings, 0x61), 0x2714)\n  ,((Webdings, 0x62), 0x1F6B2)\n  ,((Webdings, 0x63), 0x25A1)\n  ,((Webdings, 0x64), 0x1F6E1)\n  ,((Webdings, 0x65), 0x1F4E6)\n  ,((Webdings, 0x66), 0x1F6F1)\n  ,((Webdings, 0x67), 0x25A0)\n  ,((Webdings, 0x68), 0x1F691)\n  ,((Webdings, 0x69), 0x1F6C8)\n  ,((Webdings, 0x6A), 0x1F6E9)\n  ,((Webdings, 0x6B), 0x1F6F0)\n  ,((Webdings, 0x6C), 0x1F7C8)\n  ,((Webdings, 0x6D), 0x1F574)\n  ,((Webdings, 0x6E), 0x26AB)\n  ,((Webdings, 0x6F), 0x1F6E5)\n  ,((Webdings, 0x70), 0x1F694)\n  ,((Webdings, 0x71), 0x1F5D8)\n  ,((Webdings, 0x72), 0x1F5D9)\n  ,((Webdings, 0x73), 0x2753)\n  ,((Webdings, 0x74), 0x1F6F2)\n  ,((Webdings, 0x75), 0x1F687)\n  ,((Webdings, 0x76), 0x1F68D)\n  ,((Webdings, 0x77), 0x26F3)\n  ,((Webdings, 0x78), 0x1F6C7)\n  ,((Webdings, 0x79), 0x2296)\n  ,((Webdings, 0x7A), 0x1F6AD)\n  ,((Webdings, 0x7B), 0x1F5EE)\n  ,((Webdings, 0x7C), 0x007C)\n  ,((Webdings, 0x7D), 0x1F5EF)\n  ,((Webdings, 0x7E), 0x1F5F2)\n  ,((Webdings, 0x80), 0x1F6B9)\n  ,((Webdings, 0x81), 0x1F6BA)\n  ,((Webdings, 0x82), 0x1F6C9)\n  ,((Webdings, 0x83), 0x1F6CA)\n  ,((Webdings, 0x84), 0x1F6BC)\n  ,((Webdings, 0x85), 0x1F47D)\n  ,((Webdings, 0x86), 0x1F3CB)\n  ,((Webdings, 0x87), 0x26F7)\n  ,((Webdings, 0x88), 0x1F3C2)\n  ,((Webdings, 0x89), 0x1F3CC)\n  ,((Webdings, 0x8A), 0x1F3CA)\n  ,((Webdings, 0x8B), 0x1F3C4)\n  ,((Webdings, 0x8C), 0x1F3CD)\n  ,((Webdings, 0x8D), 0x1F3CE)\n  ,((Webdings, 0x8E), 0x1F698)\n  ,((Webdings, 0x8F), 0x1F5E0)\n  ,((Webdings, 0x90), 0x1F6E2)\n  ,((Webdings, 0x91), 0x1F4B0)\n  ,((Webdings, 0x92), 0x1F3F7)\n  ,((Webdings, 0x93), 0x1F4B3)\n  ,((Webdings, 0x94), 0x1F46A)\n  ,((Webdings, 0x95), 0x1F5E1)\n  ,((Webdings, 0x96), 0x1F5E2)\n  ,((Webdings, 0x97), 0x1F5E3)\n  ,((Webdings, 0x98), 0x272F)\n  ,((Webdings, 0x99), 0x1F584)\n  ,((Webdings, 0x9A), 0x1F585)\n  ,((Webdings, 0x9B), 0x1F583)\n  ,((Webdings, 0x9C), 0x1F586)\n  ,((Webdings, 0x9D), 0x1F5B9)\n  ,((Webdings, 0x9E), 0x1F5BA)\n  ,((Webdings, 0x9F), 0x1F5BB)\n  ,((Webdings, 0xA1), 0x1F570)\n  ,((Webdings, 0xA2), 0x1F5BD)\n  ,((Webdings, 0xA3), 0x1F5BE)\n  ,((Webdings, 0xA4), 0x1F4CB)\n  ,((Webdings, 0xA5), 0x1F5D2)\n  ,((Webdings, 0xA6), 0x1F5D3)\n  ,((Webdings, 0xA7), 0x1F4D6)\n  ,((Webdings, 0xA8), 0x1F4DA)\n  ,((Webdings, 0xA9), 0x1F5DE)\n  ,((Webdings, 0xAA), 0x1F5DF)\n  ,((Webdings, 0xAB), 0x1F5C3)\n  ,((Webdings, 0xAC), 0x1F5C2)\n  ,((Webdings, 0xAD), 0x1F5BC)\n  ,((Webdings, 0xAE), 0x1F3AD)\n  ,((Webdings, 0xAF), 0x1F39C)\n  ,((Webdings, 0xB0), 0x1F398)\n  ,((Webdings, 0xB1), 0x1F399)\n  ,((Webdings, 0xB2), 0x1F3A7)\n  ,((Webdings, 0xB3), 0x1F4BF)\n  ,((Webdings, 0xB4), 0x1F39E)\n  ,((Webdings, 0xB5), 0x1F4F7)\n  ,((Webdings, 0xB6), 0x1F39F)\n  ,((Webdings, 0xB7), 0x1F3AC)\n  ,((Webdings, 0xB8), 0x1F4FD)\n  ,((Webdings, 0xB9), 0x1F4F9)\n  ,((Webdings, 0xBA), 0x1F4FE)\n  ,((Webdings, 0xBB), 0x1F4FB)\n  ,((Webdings, 0xBC), 0x1F39A)\n  ,((Webdings, 0xBD), 0x1F39B)\n  ,((Webdings, 0xBE), 0x1F4FA)\n  ,((Webdings, 0xBF), 0x1F4BB)\n  ,((Webdings, 0xC0), 0x1F5A5)\n  ,((Webdings, 0xC1), 0x1F5A6)\n  ,((Webdings, 0xC2), 0x1F5A7)\n  ,((Webdings, 0xC3), 0x1F579)\n  ,((Webdings, 0xC4), 0x1F3AE)\n  ,((Webdings, 0xC5), 0x1F57B)\n  ,((Webdings, 0xC6), 0x1F57C)\n  ,((Webdings, 0xC7), 0x1F4DF)\n  ,((Webdings, 0xC8), 0x1F581)\n  ,((Webdings, 0xC9), 0x1F580)\n  ,((Webdings, 0xCA), 0x1F5A8)\n  ,((Webdings, 0xCB), 0x1F5A9)\n  ,((Webdings, 0xCC), 0x1F5BF)\n  ,((Webdings, 0xCD), 0x1F5AA)\n  ,((Webdings, 0xCE), 0x1F5DC)\n  ,((Webdings, 0xCF), 0x1F512)\n  ,((Webdings, 0xD0), 0x1F513)\n  ,((Webdings, 0xD1), 0x1F5DD)\n  ,((Webdings, 0xD2), 0x1F4E5)\n  ,((Webdings, 0xD3), 0x1F4E4)\n  ,((Webdings, 0xD4), 0x1F573)\n  ,((Webdings, 0xD5), 0x1F323)\n  ,((Webdings, 0xD6), 0x1F324)\n  ,((Webdings, 0xD7), 0x1F325)\n  ,((Webdings, 0xD8), 0x1F326)\n  ,((Webdings, 0xD9), 0x2601)\n  ,((Webdings, 0xDA), 0x1F327)\n  ,((Webdings, 0xDB), 0x1F328)\n  ,((Webdings, 0xDC), 0x1F329)\n  ,((Webdings, 0xDD), 0x1F32A)\n  ,((Webdings, 0xDE), 0x1F32C)\n  ,((Webdings, 0xDF), 0x1F32B)\n  ,((Webdings, 0xE0), 0x1F31C)\n  ,((Webdings, 0xE1), 0x1F321)\n  ,((Webdings, 0xE2), 0x1F6CB)\n  ,((Webdings, 0xE3), 0x1F6CF)\n  ,((Webdings, 0xE4), 0x1F37D)\n  ,((Webdings, 0xE5), 0x1F378)\n  ,((Webdings, 0xE6), 0x1F6CE)\n  ,((Webdings, 0xE7), 0x1F6CD)\n  ,((Webdings, 0xE8), 0x24C5)\n  ,((Webdings, 0xE9), 0x267F)\n  ,((Webdings, 0xEA), 0x1F6C6)\n  ,((Webdings, 0xEB), 0x1F588)\n  ,((Webdings, 0xEC), 0x1F393)\n  ,((Webdings, 0xED), 0x1F5E4)\n  ,((Webdings, 0xEE), 0x1F5E5)\n  ,((Webdings, 0xEF), 0x1F5E6)\n  ,((Webdings, 0xF0), 0x1F5E7)\n  ,((Webdings, 0xF1), 0x1F6EA)\n  ,((Webdings, 0xF2), 0x1F43F)\n  ,((Webdings, 0xF3), 0x1F426)\n  ,((Webdings, 0xF4), 0x1F41F)\n  ,((Webdings, 0xF5), 0x1F415)\n  ,((Webdings, 0xF6), 0x1F408)\n  ,((Webdings, 0xF7), 0x1F66C)\n  ,((Webdings, 0xF8), 0x1F66E)\n  ,((Webdings, 0xF9), 0x1F66D)\n  ,((Webdings, 0xFA), 0x1F66F)\n  ,((Webdings, 0xFB), 0x1F5FA)\n  ,((Webdings, 0xFC), 0x1F30D)\n  ,((Webdings, 0xFD), 0x1F30F)\n  ,((Webdings, 0xFE), 0x1F30E)\n  ,((Webdings, 0xFF), 0x1F54A)\n  ,((Symbol,0x20), 0xA0)\n  ,((Symbol,0x21), 0x21)\n  ,((Symbol,0x22), 0x2200)\n  ,((Symbol,0x23), 0x23)\n  ,((Symbol,0x24), 0x2203)\n  ,((Symbol,0x25), 0x25)\n  ,((Symbol,0x26), 0x26)\n  ,((Symbol,0x27), 0x220B)\n  ,((Symbol,0x28), 0x28)\n  ,((Symbol,0x29), 0x29)\n  ,((Symbol,0x2A), 0x2217)\n  ,((Symbol,0x2B), 0x2B)\n  ,((Symbol,0x2C), 0x2C)\n  ,((Symbol,0x2D), 0x2212)\n  ,((Symbol,0x2E), 0x2E)\n  ,((Symbol,0x2F), 0x2F)\n  ,((Symbol,0x30), 0x30)\n  ,((Symbol,0x31), 0x31)\n  ,((Symbol,0x32), 0x32)\n  ,((Symbol,0x33), 0x33)\n  ,((Symbol,0x34), 0x34)\n  ,((Symbol,0x35), 0x35)\n  ,((Symbol,0x36), 0x36)\n  ,((Symbol,0x37), 0x37)\n  ,((Symbol,0x38), 0x38)\n  ,((Symbol,0x39), 0x39)\n  ,((Symbol,0x3A), 0x3A)\n  ,((Symbol,0x3B), 0x3B)\n  ,((Symbol,0x3C), 0x3C)\n  ,((Symbol,0x3D), 0x3D)\n  ,((Symbol,0x3E), 0x3E)\n  ,((Symbol,0x3F), 0x3F)\n  ,((Symbol,0x40), 0x2245)\n  ,((Symbol,0x41), 0x391)\n  ,((Symbol,0x42), 0x392)\n  ,((Symbol,0x43), 0x3A7)\n  ,((Symbol,0x44), 0x2206)\n  ,((Symbol,0x45), 0x395)\n  ,((Symbol,0x46), 0x3A6)\n  ,((Symbol,0x47), 0x393)\n  ,((Symbol,0x48), 0x397)\n  ,((Symbol,0x49), 0x399)\n  ,((Symbol,0x4A), 0x3D1)\n  ,((Symbol,0x4B), 0x39A)\n  ,((Symbol,0x4C), 0x39B)\n  ,((Symbol,0x4D), 0x39C)\n  ,((Symbol,0x4E), 0x39D)\n  ,((Symbol,0x4F), 0x39F)\n  ,((Symbol,0x50), 0x3A0)\n  ,((Symbol,0x51), 0x398)\n  ,((Symbol,0x52), 0x3A1)\n  ,((Symbol,0x53), 0x3A3)\n  ,((Symbol,0x54), 0x3A4)\n  ,((Symbol,0x55), 0x3A5)\n  ,((Symbol,0x56), 0x3C2)\n  ,((Symbol,0x57), 0x2126)\n  ,((Symbol,0x58), 0x39E)\n  ,((Symbol,0x59), 0x3A8)\n  ,((Symbol,0x5A), 0x396)\n  ,((Symbol,0x5B), 0x5B)\n  ,((Symbol,0x5C), 0x2234)\n  ,((Symbol,0x5D), 0x5D)\n  ,((Symbol,0x5E), 0x22A5)\n  ,((Symbol,0x5F), 0x5F)\n  ,((Symbol,0x60), 0xF8E5)\n  ,((Symbol,0x61), 0x3B1)\n  ,((Symbol,0x62), 0x3B2)\n  ,((Symbol,0x63), 0x3C7)\n  ,((Symbol,0x64), 0x3B4)\n  ,((Symbol,0x65), 0x3B5)\n  ,((Symbol,0x66), 0x3C6)\n  ,((Symbol,0x67), 0x3B3)\n  ,((Symbol,0x68), 0x3B7)\n  ,((Symbol,0x69), 0x3B9)\n  ,((Symbol,0x6A), 0x3D5)\n  ,((Symbol,0x6B), 0x3BA)\n  ,((Symbol,0x6C), 0x3BB)\n  ,((Symbol,0x6D), 0x3BC)\n  ,((Symbol,0x6E), 0x3BD)\n  ,((Symbol,0x6F), 0x3BF)\n  ,((Symbol,0x70), 0x3C0)\n  ,((Symbol,0x71), 0x3B8)\n  ,((Symbol,0x72), 0x3C1)\n  ,((Symbol,0x73), 0x3C3)\n  ,((Symbol,0x74), 0x3C4)\n  ,((Symbol,0x75), 0x3C5)\n  ,((Symbol,0x76), 0x3D6)\n  ,((Symbol,0x77), 0x3C9)\n  ,((Symbol,0x78), 0x3BE)\n  ,((Symbol,0x79), 0x3C8)\n  ,((Symbol,0x7A), 0x3B6)\n  ,((Symbol,0x7B), 0x7B)\n  ,((Symbol,0x7C), 0x7C)\n  ,((Symbol,0x7D), 0x7D)\n  ,((Symbol,0x7E), 0x223C)\n  ,((Symbol,0xA0), 0x20AC)\n  ,((Symbol,0xA1), 0x3D2)\n  ,((Symbol,0xA2), 0x2032)\n  ,((Symbol,0xA3), 0x2264)\n  ,((Symbol,0xA4), 0x2215)\n  ,((Symbol,0xA5), 0x221E)\n  ,((Symbol,0xA6), 0x192)\n  ,((Symbol,0xA7), 0x2663)\n  ,((Symbol,0xA8), 0x2666)\n  ,((Symbol,0xA9), 0x2665)\n  ,((Symbol,0xAA), 0x2660)\n  ,((Symbol,0xAB), 0x2194)\n  ,((Symbol,0xAC), 0x2190)\n  ,((Symbol,0xAD), 0x2191)\n  ,((Symbol,0xAE), 0x2192)\n  ,((Symbol,0xAF), 0x2193)\n  ,((Symbol,0xB0), 0xB0)\n  ,((Symbol,0xB1), 0xB1)\n  ,((Symbol,0xB2), 0x2033)\n  ,((Symbol,0xB3), 0x2265)\n  ,((Symbol,0xB4), 0xD7)\n  ,((Symbol,0xB5), 0x221D)\n  ,((Symbol,0xB6), 0x2202)\n  ,((Symbol,0xB7), 0x2022)\n  ,((Symbol,0xB8), 0xF7)\n  ,((Symbol,0xB9), 0x2260)\n  ,((Symbol,0xBA), 0x2261)\n  ,((Symbol,0xBB), 0x2248)\n  ,((Symbol,0xBC), 0x2026)\n  ,((Symbol,0xBD), 0xF8E6)\n  ,((Symbol,0xBE), 0xF8E7)\n  ,((Symbol,0xBF), 0x21B5)\n  ,((Symbol,0xC0), 0x2135)\n  ,((Symbol,0xC1), 0x2111)\n  ,((Symbol,0xC2), 0x211C)\n  ,((Symbol,0xC3), 0x2118)\n  ,((Symbol,0xC4), 0x2297)\n  ,((Symbol,0xC5), 0x2295)\n  ,((Symbol,0xC6), 0x2205)\n  ,((Symbol,0xC7), 0x2229)\n  ,((Symbol,0xC8), 0x222A)\n  ,((Symbol,0xC9), 0x2283)\n  ,((Symbol,0xCA), 0x2287)\n  ,((Symbol,0xCB), 0x2284)\n  ,((Symbol,0xCC), 0x2282)\n  ,((Symbol,0xCD), 0x2286)\n  ,((Symbol,0xCE), 0x2208)\n  ,((Symbol,0xCF), 0x2209)\n  ,((Symbol,0xD0), 0x2220)\n  ,((Symbol,0xD1), 0x2207)\n  ,((Symbol,0xD2), 0xF6DA)\n  ,((Symbol,0xD3), 0xF6D9)\n  ,((Symbol,0xD4), 0xF6DB)\n  ,((Symbol,0xD5), 0x220F)\n  ,((Symbol,0xD6), 0x221A)\n  ,((Symbol,0xD7), 0x22C5)\n  ,((Symbol,0xD8), 0xAC)\n  ,((Symbol,0xD9), 0x2227)\n  ,((Symbol,0xDA), 0x2228)\n  ,((Symbol,0xDB), 0x21D4)\n  ,((Symbol,0xDC), 0x21D0)\n  ,((Symbol,0xDD), 0x21D1)\n  ,((Symbol,0xDE), 0x21D2)\n  ,((Symbol,0xDF), 0x21D3)\n  ,((Symbol,0xE0), 0x25CA)\n  ,((Symbol,0xE1), 0x2329)\n  ,((Symbol,0xE2), 0xF8E8)\n  ,((Symbol,0xE3), 0xF8E9)\n  ,((Symbol,0xE4), 0xF8EA)\n  ,((Symbol,0xE5), 0x2211)\n  ,((Symbol,0xE6), 0xF8EB)\n  ,((Symbol,0xE7), 0xF8EC)\n  ,((Symbol,0xE8), 0xF8ED)\n  ,((Symbol,0xE9), 0xF8EE)\n  ,((Symbol,0xEA), 0xF8EF)\n  ,((Symbol,0xEB), 0xF8F0)\n  ,((Symbol,0xEC), 0xF8F1)\n  ,((Symbol,0xED), 0xF8F2)\n  ,((Symbol,0xEE), 0xF8F3)\n  ,((Symbol,0xEF), 0xF8F4)\n  ,((Symbol,0xF1), 0x232A)\n  ,((Symbol,0xF2), 0x222B)\n  ,((Symbol,0xF3), 0x2320)\n  ,((Symbol,0xF4), 0xF8F5)\n  ,((Symbol,0xF5), 0x2321)\n  ,((Symbol,0xF6), 0xF8F6)\n  ,((Symbol,0xF7), 0xF8F7)\n  ,((Symbol,0xF8), 0xF8F8)\n  ,((Symbol,0xF9), 0xF8F9)\n  ,((Symbol,0xFA), 0xF8FA)\n  ,((Symbol,0xFB), 0xF8FB)\n  ,((Symbol,0xFC), 0xF8FC)\n  ,((Symbol,0xFD), 0xF8FD)\n  ,((Symbol,0xFE), 0xF8FE)\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx/Util.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Docx.Util\n   Copyright   : © 2014-2020 Jesse Rosenthal <jrosenthal@jhu.edu>,\n                   2014-2024 John MacFarlane <jgm@berkeley.edu>,\n                   2015 Nikolay Yakimov <root@livid.pp.ru>\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nDocx reader utility functions.\n-}\nmodule Text.Pandoc.Readers.Docx.Util (\n                                        NameSpaces\n                                      , elemName\n                                      , isElem\n                                      , elemToNameSpaces\n                                      , findChildByName\n                                      , findChildrenByName\n                                      , findElementByName\n                                      , findAttrByName\n                                      , extractChildren\n                                      ) where\n\nimport Data.List (partition)\nimport Text.Pandoc.XML.Light\nimport Text.Pandoc.Readers.OOXML.Shared\n  (NameSpaces, elemName, isElem, elemToNameSpaces,\n   findChildByName, findChildrenByName, findElementByName, findAttrByName)\n\n\n-- | Removes child elements that satisfy a given condition.\n-- Returns the modified element and the list of removed children.\nextractChildren :: Element -> (Element -> Bool) -> Maybe (Element, [Element])\nextractChildren el condition\n  | null removedChildren = Nothing  -- No children removed, return Nothing\n  | otherwise = Just (modifiedElement, removedChildren)  -- Children removed, return Just\n  where\n    -- Separate the children based on the condition\n    (removedChildren, keptChildren) = partition condition (onlyElems $ elContent el)\n\n    -- Reconstruct the element with the kept children\n    modifiedElement = el { elContent = map Elem keptChildren }\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Docx.hs",
    "content": "{-# LANGUAGE CPP               #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards     #-}\n{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Readers.Docx\n   Copyright   : Copyright (C) 2014-2020 Jesse Rosenthal\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of Docx type (defined in Text.Pandoc.Readers.Docx.Parse)\nto 'Pandoc' document.  -}\n\n{-\nCurrent state of implementation of Docx entities ([x] means\nimplemented, [-] means partially implemented):\n\n* Blocks\n\n  - [X] Para\n  - [X] CodeBlock (styled with `SourceCode`)\n  - [X] BlockQuote (styled with `Quote`, `BlockQuote`, `Intense Quote` or, optionally,\n        indented)\n  - [X] OrderedList\n  - [X] BulletList\n  - [X] DefinitionList (styled with adjacent `DefinitionTerm` and `Definition`)\n  - [X] Header (styled with `Heading#`)\n  - [ ] HorizontalRule\n  - [-] Table (column widths and alignments not yet implemented)\n\n* Inlines\n\n  - [X] Str\n  - [X] Emph\n  - [X] Strong\n  - [X] Strikeout\n  - [X] Superscript\n  - [X] Subscript\n  - [X] SmallCaps\n  - [-] Underline (was previously converted to Emph)\n  - [ ] Quoted\n  - [ ] Cite\n  - [X] Code (styled with `VerbatimChar`)\n  - [X] Space\n  - [X] LineBreak (these are invisible in Word: entered with Shift-Return)\n  - [X] Math\n  - [X] Link (links to an arbitrary bookmark create a span with the target as\n        id and \"anchor\" class)\n  - [X] Image\n  - [X] Note (Footnotes and Endnotes are silently combined.)\n-}\n\nmodule Text.Pandoc.Readers.Docx\n       ( readDocx\n       ) where\n\nimport Codec.Archive.Zip\nimport Control.Monad ( liftM, unless )\nimport Control.Monad.Reader\n    ( asks,\n      MonadReader(local),\n      MonadTrans(lift),\n      ReaderT(runReaderT) )\nimport Control.Monad.State.Strict\n    ( StateT,\n      gets,\n      modify,\n      evalStateT )\nimport Data.Bifunctor (bimap, first)\nimport qualified Data.ByteString.Lazy as B\nimport Data.Default (Default)\nimport Data.List (delete, intersect)\nimport qualified Data.List as L\nimport Data.Char (isSpace)\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.Maybe (isJust, fromMaybe, mapMaybe)\nimport Data.Sequence (ViewL (..), viewl)\nimport qualified Data.Sequence as Seq\nimport qualified Data.Set as Set\nimport Citeproc (ItemId(..), Reference(..), CitationItem(..))\nimport qualified Citeproc\nimport Text.Pandoc.Builder as Pandoc\nimport Text.Pandoc.MediaBag (MediaBag)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Readers.Docx.Combine\nimport Text.Pandoc.Readers.Docx.Lists\nimport Text.Pandoc.Readers.Docx.Parse as Docx\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Walk\nimport Text.TeXMath (writeTeX)\nimport Control.Monad.Except (throwError, catchError)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Error\nimport Text.Pandoc.Logging\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Aeson (eitherDecode)\nimport qualified Data.Text.Lazy as TL\nimport Text.Pandoc.UTF8 (fromTextLazy)\nimport Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)\nimport Text.Pandoc.Readers.EndNote (readEndNoteXMLCitation)\n\nreadDocx :: PandocMonad m\n         => ReaderOptions\n         -> B.ByteString\n         -> m Pandoc\nreadDocx opts bytes =\n  case toArchiveOrFail bytes of\n    Right archive ->\n      case archiveToDocxWithWarnings archive of\n        Right (docx, parserWarnings) -> do\n          mapM_ (P.report . DocxParserWarning) parserWarnings\n          (meta, blks) <- docxToOutput opts docx\n          return $ Pandoc meta blks\n        Left docxerr -> throwError $ PandocSomeError $\n                         \"couldn't parse docx file: \" <> T.pack (show docxerr)\n    Left err -> throwError $ PandocSomeError $\n                  \"couldn't unpack docx container: \" <> T.pack err\n\ndata DState = DState { docxAnchorMap :: M.Map T.Text T.Text\n                     , docxAnchorSet :: Set.Set T.Text\n                     , docxImmedPrevAnchor :: Maybe T.Text\n                     , docxMediaBag  :: MediaBag\n                     , docxNumberedHeadings :: Bool\n                     , docxDropCap   :: Inlines\n                     -- keep track of (numId, lvl) values for\n                     -- restarting\n                     , docxListState :: M.Map (T.Text, T.Text) Integer\n                     , docxPrevPara  :: Inlines\n                     , docxReferences :: M.Map ItemId (Reference Inlines)\n                     }\n\ninstance Default DState where\n  def = DState { docxAnchorMap = M.empty\n               , docxAnchorSet = mempty\n               , docxImmedPrevAnchor = Nothing\n               , docxMediaBag  = mempty\n               , docxNumberedHeadings = False\n               , docxDropCap   = mempty\n               , docxListState = M.empty\n               , docxPrevPara  = mempty\n               , docxReferences = mempty\n               }\n\ndata DEnv = DEnv { docxOptions       :: ReaderOptions\n                 , docxInHeaderBlock :: Bool\n                 , docxInBidi        :: Bool\n                 }\n\ninstance Default DEnv where\n  def = DEnv def False False\n\ntype DocxContext m = ReaderT DEnv (StateT DState m)\n\nevalDocxContext :: PandocMonad m => DocxContext m a -> DEnv -> DState -> m a\nevalDocxContext ctx env st = flip evalStateT st $ runReaderT ctx env\n\n-- This is empty, but we put it in for future-proofing.\nspansToKeep :: [CharStyleName]\nspansToKeep = []\n\ndivsToKeep :: [ParaStyleName]\ndivsToKeep = [\"Definition\", \"Definition Term\"]\n\nmetaStyles :: M.Map ParaStyleName T.Text\nmetaStyles = M.fromList [ (\"Title\", \"title\")\n                        , (\"Subtitle\", \"subtitle\")\n                        , (\"Author\", \"author\")\n                        , (\"Date\", \"date\")\n                        , (\"Abstract\", \"abstract\")]\n\nsepBodyParts :: [BodyPart] -> ([BodyPart], [BodyPart])\nsepBodyParts = span (\\bp -> isMetaPar bp || isEmptyPar bp)\n\nisMetaPar :: BodyPart -> Bool\nisMetaPar (Paragraph pPr _) =\n  not $ null $ intersect (getStyleNames $ pStyle pPr) (M.keys metaStyles)\nisMetaPar _ = False\n\nisEmptyPar :: BodyPart -> Bool\nisEmptyPar (Paragraph _ parParts) =\n  all isEmptyParPart parParts\n  where\n    isEmptyParPart (PlainRun (Run _ runElems)) = all isEmptyElem runElems\n    isEmptyParPart _                           = False\n    isEmptyElem (TextRun s) = trim s == \"\"\n    isEmptyElem _           = True\nisEmptyPar _ = False\n\nbodyPartsToMeta' :: PandocMonad m => [BodyPart] -> DocxContext m (M.Map T.Text MetaValue)\nbodyPartsToMeta' [] = return M.empty\nbodyPartsToMeta' (bp : bps)\n  | (Paragraph pPr parParts) <- bp\n  , (c : _)<- getStyleNames (pStyle pPr) `intersect` M.keys metaStyles\n  , (Just metaField) <- M.lookup c metaStyles = do\n    inlines <- smushInlines <$> mapM parPartToInlines parParts\n    remaining <- bodyPartsToMeta' bps\n    let\n      -- for titles, we just take the first one and ignore the rest, #10359:\n      f _ x | metaField == \"title\" || metaField == \"subtitle\" = x\n      f (MetaInlines ils) (MetaInlines ils') = MetaBlocks [Para ils, Para ils']\n      f (MetaInlines ils) (MetaBlocks blks) = MetaBlocks (Para ils : blks)\n      f m (MetaList mv) = MetaList (m : mv)\n      f m n             = MetaList [m, n]\n    return $ M.insertWith f metaField (MetaInlines (toList inlines)) remaining\nbodyPartsToMeta' (_ : bps) = bodyPartsToMeta' bps\n\nbodyPartsToMeta :: PandocMonad m => [BodyPart] -> DocxContext m Meta\nbodyPartsToMeta bps = do\n  mp <- bodyPartsToMeta' bps\n  let mp' =\n        case M.lookup \"author\" mp of\n          Just mv -> M.insert \"author\" (fixAuthors mv) mp\n          Nothing -> mp\n  return $ Meta mp'\n\nfixAuthors :: MetaValue -> MetaValue\nfixAuthors (MetaBlocks blks) = MetaList [MetaInlines ils | Para ils <- blks]\nfixAuthors mv = mv\n\nisInheritedFromStyles :: (Eq (StyleName s), HasStyleName s, HasParentStyle s) => [StyleName s] -> s -> Bool\nisInheritedFromStyles names sty\n  | getStyleName sty `elem` names = True\n  | Just psty <- getParentStyle sty = isInheritedFromStyles names psty\n  | otherwise = False\n\nhasStylesInheritedFrom :: [ParaStyleName] -> ParagraphStyle -> Bool\nhasStylesInheritedFrom ns s = any (isInheritedFromStyles ns) $ pStyle s\n\nremoveStyleNamed :: ParaStyleName -> ParagraphStyle -> ParagraphStyle\nremoveStyleNamed sn ps = ps{pStyle = filter (\\psd -> getStyleName psd /= sn) $ pStyle ps}\n\nisCodeCharStyle :: CharStyle -> Bool\nisCodeCharStyle = isInheritedFromStyles [\"Verbatim Char\"]\n\nisCodeDiv :: ParagraphStyle -> Bool\nisCodeDiv = hasStylesInheritedFrom [\"Source Code\", \"SourceCode\", \"source_code\"]\n\nisBlockQuote :: ParStyle -> Bool\nisBlockQuote =\n  isInheritedFromStyles [\n    \"Quote\", \"Block Text\", \"Block Quote\", \"Block Quotation\", \"Intense Quote\"\n    ]\n\nrunElemToInlines :: RunElem -> Inlines\nrunElemToInlines (TextRun s)   = text s\nrunElemToInlines LnBrk         = linebreak\nrunElemToInlines Tab           = space\nrunElemToInlines SoftHyphen    = text \"\\xad\"\nrunElemToInlines NoBreakHyphen = text \"\\x2011\"\n\nrunElemToText :: RunElem -> T.Text\nrunElemToText (TextRun s)   = s\nrunElemToText LnBrk         = T.singleton '\\n'\nrunElemToText Tab           = T.singleton '\\t'\nrunElemToText SoftHyphen    = T.singleton '\\xad'\nrunElemToText NoBreakHyphen = T.singleton '\\x2011'\n\nrunToText :: Run -> T.Text\nrunToText (Run _ runElems) = T.concat $ map runElemToText runElems\nrunToText _                = \"\"\n\nparPartToText :: ParPart -> T.Text\nparPartToText (PlainRun run)             = runToText run\nparPartToText (InternalHyperLink _ children) = T.concat $ map parPartToText children\nparPartToText (ExternalHyperLink _ children) = T.concat $ map parPartToText children\nparPartToText _                          = \"\"\n\nblacklistedCharStyles :: [CharStyleName]\nblacklistedCharStyles = [\"Hyperlink\"]\n\nresolveDependentRunStyle :: PandocMonad m => RunStyle -> DocxContext m RunStyle\nresolveDependentRunStyle rPr\n  | Just s  <- rParentStyle rPr\n  , getStyleName s `notElem` blacklistedCharStyles = do\n      opts <- asks docxOptions\n      if isEnabled Ext_styles opts\n        then return rPr\n        else leftBiasedMergeRunStyle rPr <$> resolveDependentRunStyle (cStyleData s)\n  | otherwise = return rPr\n\nrunStyleToTransform :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> Inlines)\nrunStyleToTransform rPr' = do\n  opts <- asks docxOptions\n  inBidi <- asks docxInBidi\n  let styles = isEnabled Ext_styles opts\n      ctl = (Just True == isRTL rPr') || (Just True == isForceCTL rPr')\n      italic rPr | ctl = isItalicCTL rPr\n                 | otherwise = isItalic rPr\n      bold rPr | ctl = isBoldCTL rPr\n               | otherwise = isBold rPr\n      go rPr\n        | Just sn <- getStyleName <$> rParentStyle rPr\n        , sn `elem` spansToKeep =\n            spanWith (\"\", [normalizeToClassName sn], [])\n            . go rPr{rParentStyle = Nothing}\n        | styles, Just s <- rParentStyle rPr =\n             spanWith (extraAttr s) . go rPr{rParentStyle = Nothing}\n        | Just True <- italic rPr =\n            emph . go rPr{isItalic = Nothing, isItalicCTL = Nothing}\n        | Just True <- bold rPr =\n            strong . go rPr{isBold = Nothing, isBoldCTL = Nothing}\n        | Just v <- rHighlight rPr\n        , v /= \"none\" =\n            spanWith (\"\",[\"mark\"],[]) . go rPr{rHighlight = Nothing}\n        | Just True <- isSmallCaps rPr =\n            smallcaps . go rPr{isSmallCaps = Nothing}\n        | Just True <- isStrike rPr =\n            strikeout . go rPr{isStrike = Nothing}\n        | Just True <- isRTL rPr =\n            spanWith (\"\",[],[(\"dir\",\"rtl\")]) . go rPr{isRTL = Nothing}\n        | inBidi, Just False <- isRTL rPr =\n            spanWith (\"\",[],[(\"dir\",\"ltr\")]) . go rPr{isRTL = Nothing}\n        | Just SupScrpt <- rVertAlign rPr =\n            superscript . go rPr{rVertAlign = Nothing}\n        | Just SubScrpt <- rVertAlign rPr =\n            subscript . go rPr{rVertAlign = Nothing}\n        | Just \"single\" <- rUnderline rPr =\n            Pandoc.underline . go rPr{rUnderline = Nothing}\n        | otherwise = id\n  return $ go rPr'\n\n\nrunToInlines :: PandocMonad m => Run -> DocxContext m Inlines\nrunToInlines (Run rs runElems)\n  | maybe False isCodeCharStyle $ rParentStyle rs = do\n      rPr <- resolveDependentRunStyle rs\n      let codeString = code $ T.concat $ map runElemToText runElems\n      return $ case rVertAlign rPr of\n        Just SupScrpt -> superscript codeString\n        Just SubScrpt -> subscript codeString\n        _             -> codeString\n  | otherwise = do\n      rPr <- resolveDependentRunStyle rs\n      let ils = smushInlines (map runElemToInlines runElems)\n      transform <- runStyleToTransform rPr\n      return $ transform ils\nrunToInlines (Footnote bps) = note . smushBlocks <$> mapM bodyPartToBlocks bps\nrunToInlines (Endnote bps) = note . smushBlocks <$> mapM bodyPartToBlocks bps\nrunToInlines (InlineDrawing fp title alt bs ext) = do\n  (lift . lift) $ P.insertMedia fp Nothing bs\n  return $ imageWith (extentToAttr ext) (T.pack fp) title $ text alt\nrunToInlines InlineChart = return $ spanWith (\"\", [\"chart\"], []) $ text \"[CHART]\"\nrunToInlines InlineDiagram = return $ spanWith (\"\", [\"diagram\"], []) $ text \"[DIAGRAM]\"\n\nextentToAttr :: Extent -> Attr\nextentToAttr (Just (w, h)) =\n  (\"\", [], [(\"width\", showDim w), (\"height\", showDim h)] )\n  where\n    showDim d = tshow (d / 914400) <> \"in\"\nextentToAttr _ = nullAttr\n\nblocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines\nblocksToInlinesWarn cmtId blks = do\n  let paraOrPlain :: Block -> Bool\n      paraOrPlain (Para _)       = True\n      paraOrPlain (Plain _)      = True\n      paraOrPlain (Div _ nested) = all paraOrPlain nested\n      paraOrPlain _              = False\n  unless (all paraOrPlain blks) $\n    lift $ P.report $ DocxParserWarning $\n      \"Docx comment \" <> cmtId <> \" will not retain formatting\"\n  return $ blocksToInlines' (toList blks)\n\n-- The majority of work in this function is done in the primed\n-- subfunction `partPartToInlines'`. We make this wrapper so that we\n-- don't have to modify `docxImmedPrevAnchor` state after every function.\nparPartToInlines :: PandocMonad m => ParPart -> DocxContext m Inlines\nparPartToInlines parPart =\n  case parPart of\n    (BookMark _ anchor) | anchor `notElem` dummyAnchors -> do\n      inHdrBool <- asks docxInHeaderBlock\n      ils <- parPartToInlines' parPart\n      immedPrevAnchor <- gets docxImmedPrevAnchor\n      unless (isJust immedPrevAnchor || inHdrBool)\n        (modify $ \\s -> s{ docxImmedPrevAnchor = Just anchor})\n      return ils\n    _ -> do\n      ils <- parPartToInlines' parPart\n      modify $ \\s -> s{ docxImmedPrevAnchor = Nothing}\n      return ils\n\nparPartToInlines' :: PandocMonad m => ParPart -> DocxContext m Inlines\nparPartToInlines' (PlainRun r) = runToInlines r\nparPartToInlines' (ChangedRuns (TrackedChange Insertion (ChangeInfo _ author date)) pparts) = do\n  opts <- asks docxOptions\n  case readerTrackChanges opts of\n    AcceptChanges -> smushInlines <$> mapM parPartToInlines pparts\n    RejectChanges -> return mempty\n    AllChanges    -> do\n      ils <- smushInlines <$> mapM parPartToInlines pparts\n      let attr = (\"\", [\"insertion\"], addAuthorAndDate author date)\n      return $ spanWith attr ils\nparPartToInlines' (ChangedRuns (TrackedChange Deletion (ChangeInfo _ author date)) pparts) = do\n  opts <- asks docxOptions\n  case readerTrackChanges opts of\n    AcceptChanges -> return mempty\n    RejectChanges -> smushInlines <$> mapM parPartToInlines pparts\n    AllChanges    -> do\n      ils <- smushInlines <$> mapM parPartToInlines pparts\n      let attr = (\"\", [\"deletion\"], addAuthorAndDate author date)\n      return $ spanWith attr ils\nparPartToInlines' (CommentStart cmtId author date bodyParts) = do\n  opts <- asks docxOptions\n  case readerTrackChanges opts of\n    AllChanges -> do\n      blks <- smushBlocks <$> mapM bodyPartToBlocks bodyParts\n      ils <- blocksToInlinesWarn cmtId blks\n      let attr = (\"\", [\"comment-start\"], (\"id\", cmtId) : addAuthorAndDate author date)\n      return $ spanWith attr ils\n    _ -> return mempty\nparPartToInlines' (CommentEnd cmtId) = do\n  opts <- asks docxOptions\n  case readerTrackChanges opts of\n    AllChanges -> do\n      let attr = (\"\", [\"comment-end\"], [(\"id\", cmtId)])\n      return $ spanWith attr mempty\n    _ -> return mempty\nparPartToInlines' (BookMark _ anchor) | anchor `elem` dummyAnchors =\n  return mempty\nparPartToInlines' (BookMark _ anchor) =\n  -- We record these, so we can make sure not to overwrite\n  -- user-defined anchor links with header auto ids.\n  do\n    -- get whether we're in a header.\n    inHdrBool <- asks docxInHeaderBlock\n    -- Get the anchor map.\n    anchorMap <- gets docxAnchorMap\n    -- We don't want to rewrite if we're in a header, since we'll take\n    -- care of that later, when we make the header anchor. If the\n    -- bookmark were already in uniqueIdent form, this would lead to a\n    -- duplication. Otherwise, we check to see if the id is already in\n    -- there. Rewrite if necessary. This will have the possible effect\n    -- of rewriting user-defined anchor links. However, since these\n    -- are not defined in pandoc, it seems like a necessary evil to\n    -- avoid an extra pass.\n    immedPrevAnchor <- gets docxImmedPrevAnchor\n    case immedPrevAnchor of\n      Just prevAnchor | not inHdrBool -> do\n        (modify $ \\s -> s { docxAnchorMap = M.insert anchor prevAnchor anchorMap})\n        return mempty\n      _ -> do\n        exts <- asks (readerExtensions . docxOptions)\n        let newAnchor =\n              if not inHdrBool && anchor `elem` M.elems anchorMap\n              then uniqueIdent exts [Str anchor]\n                     (Set.fromList $ M.elems anchorMap)\n              else anchor\n        unless inHdrBool\n          (modify $ \\s -> s { docxAnchorMap = M.insert anchor newAnchor anchorMap})\n        return $ spanWith (newAnchor, [\"anchor\"], []) mempty\nparPartToInlines' (Drawing fp title alt bs ext) = do\n  (lift . lift) $ P.insertMedia fp Nothing bs\n  return $ imageWith (extentToAttr ext) (T.pack fp) title $ text alt\nparPartToInlines' Chart =\n  return $ spanWith (\"\", [\"chart\"], []) $ text \"[CHART]\"\nparPartToInlines' Diagram =\n  return $ spanWith (\"\", [\"diagram\"], []) $ text \"[DIAGRAM]\"\nparPartToInlines' (InternalHyperLink anchor children) = do\n  ils <- smushInlines <$> mapM parPartToInlines' children\n  return $ link (\"#\" <> anchor) \"\" ils\nparPartToInlines' (ExternalHyperLink target children) = do\n  ils <- smushInlines <$> mapM parPartToInlines' children\n  return $ link target \"\" ils\nparPartToInlines' (PlainOMath exps) =\n  return $ math $ writeTeX exps\nparPartToInlines' (OMathPara exps) =\n  return $ displayMath $ writeTeX exps\nparPartToInlines' (Field info children) =\n  case info of\n    HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url children\n    IndexrefField ie ->\n      pure $ spanWith (\"\",[\"indexref\"],\n                           ((\"entry\", entryTitle ie) :\n                             maybe [] (\\x -> [(\"crossref\",x)]) (entrySee ie)\n                          ++ maybe [] (\\x -> [(\"yomi\",x)]) (entryYomi ie)\n                          ++ [(\"bold\",\"\") | entryBold ie]\n                          ++ [(\"italic\",\"\") | entryItalic ie])) mempty\n    PagerefField fieldAnchor True -> parPartToInlines' $ InternalHyperLink fieldAnchor children\n    CrossrefField fieldAnchor True -> parPartToInlines' $ InternalHyperLink fieldAnchor children\n    EndNoteCite t -> do\n      formattedCite <- smushInlines <$> mapM parPartToInlines' children\n      opts <- asks docxOptions\n      if isEnabled Ext_citations opts\n         then catchError\n              (do citation <- readEndNoteXMLCitation t\n                  cs <- handleCitation citation\n                  return $ cite cs formattedCite)\n              (\\case\n                  PandocXMLError _ msg -> do\n                    P.report $ DocxParserWarning\n                             (\"Cannot parse EndNote citation: \" <> msg)\n                    return formattedCite\n                  e -> throwError e)\n         else return formattedCite\n    CslCitation t -> do\n      formattedCite <- smushInlines <$> mapM parPartToInlines' children\n      opts <- asks docxOptions\n      if isEnabled Ext_citations opts\n         then do\n           let bs = fromTextLazy $ TL.fromStrict t\n           case eitherDecode bs of\n             Left _err -> return formattedCite\n             Right citation -> do\n               cs <- handleCitation citation\n               return $ cite cs formattedCite\n         else return formattedCite\n    CslBibliography -> do\n      opts <- asks docxOptions\n      if isEnabled Ext_citations opts\n         then return mempty -- omit Zotero-generated bibliography\n         else smushInlines <$> mapM parPartToInlines' children\n    EndNoteRefList -> do\n      opts <- asks docxOptions\n      if isEnabled Ext_citations opts\n         then return mempty -- omit EndNote-generated bibliography\n         else smushInlines <$> mapM parPartToInlines' children\n    _ -> smushInlines <$> mapM parPartToInlines' children\n\n-- Helper function to convert CitationItemType to CitationMode\nconvertCitationMode :: Citeproc.CitationItemType -> CitationMode\nconvertCitationMode itemType = case itemType of\n                                 Citeproc.NormalCite -> NormalCitation\n                                 Citeproc.SuppressAuthor -> SuppressAuthor\n                                 Citeproc.AuthorOnly -> AuthorInText\n\n-- Turn a 'Citeproc.Citation' into a list of 'Text.Pandoc.Definition.Citation',\n-- and store the embedded bibliographic data in state.\nhandleCitation :: PandocMonad m\n               => Citeproc.Citation T.Text\n               -> DocxContext m [Citation]\nhandleCitation citation = do\n  let toPandocCitation item =\n        Citation{ citationId = unItemId (Citeproc.citationItemId item)\n                , citationPrefix = maybe [] (toList . text) $\n                                     Citeproc.citationItemPrefix item\n                , citationSuffix = (toList . text) $\n                    maybe mempty (\\x -> \", \" <>\n                       maybe \"\" (<>\" \") (Citeproc.citationItemLabel item)\n                         <> x <> \" \")\n                     (Citeproc.citationItemLocator item)\n                    <> fromMaybe mempty (Citeproc.citationItemSuffix item)\n                , citationMode = convertCitationMode (Citeproc.citationItemType item)\n                , citationNoteNum = 0\n                , citationHash = 0 }\n  let items = Citeproc.citationItems citation\n  let cs = map toPandocCitation items\n  let refs = mapMaybe (\\item -> fmap (\\itemData -> text <$>\n                                        -- see #10366, sometimes itemData has a different\n                                        -- id and we need to use the same one:\n                                        itemData{ referenceId =\n                                                    Citeproc.citationItemId item })\n                                  (Citeproc.citationItemData item)) items\n  modify $ \\st ->\n    st{ docxReferences = foldr\n          (\\ref -> M.insert (referenceId ref) ref)\n          (docxReferences st)\n          refs }\n  return cs\n\nisAnchorSpan :: Inline -> Bool\nisAnchorSpan (Span (_, [\"anchor\"], []) _) = True\nisAnchorSpan _ = False\n\ndummyAnchors :: [T.Text]\ndummyAnchors = [\"_GoBack\"]\n\nmakeHeaderAnchor :: PandocMonad m => Blocks -> DocxContext m Blocks\nmakeHeaderAnchor bs = traverse makeHeaderAnchor' bs\n\nmakeHeaderAnchor' :: PandocMonad m => Block -> DocxContext m Block\n-- If there is an anchor already there (an anchor span in the header,\n-- to be exact), we rename and associate the new id with the old one.\nmakeHeaderAnchor' (Header n (ident, classes, kvs) ils)\n  | (c:_) <- filter isAnchorSpan ils\n  , (Span (anchIdent, [\"anchor\"], _) cIls) <- c = do\n    hdrIDMap <- gets docxAnchorMap\n    exts <- asks (readerExtensions . docxOptions)\n    let newIdent = if T.null ident\n                   then uniqueIdent exts ils (Set.fromList $ M.elems hdrIDMap)\n                   else ident\n        newIls = concatMap f ils where f il | il == c   = cIls\n                                            | otherwise = [il]\n    modify $ \\s -> s {docxAnchorMap = M.insert anchIdent newIdent hdrIDMap}\n    makeHeaderAnchor' $ Header n (newIdent, classes, kvs) newIls\n-- Otherwise we just give it a name, and register that name (associate\n-- it with itself.)\nmakeHeaderAnchor' (Header n (ident, classes, kvs) ils) =\n  do\n    hdrIDMap <- gets docxAnchorMap\n    exts <- asks (readerExtensions . docxOptions)\n    let newIdent = if T.null ident\n                   then uniqueIdent exts ils (Set.fromList $ M.elems hdrIDMap)\n                   else ident\n    modify $ \\s -> s {docxAnchorMap = M.insert newIdent newIdent hdrIDMap}\n    return $ Header n (newIdent, classes, kvs) ils\nmakeHeaderAnchor' blk = return blk\n\n-- Rewrite a standalone paragraph block as a plain\nsingleParaToPlain :: Blocks -> Blocks\nsingleParaToPlain blks\n  | (Para ils :< seeq) <- viewl $ unMany blks\n  , Seq.null seeq =\n      singleton $ Plain ils\nsingleParaToPlain blks = blks\n\ncellToCell :: PandocMonad m => RowSpan -> Docx.Cell -> DocxContext m Pandoc.Cell\ncellToCell rowSpan (Docx.Cell align gridSpan _ bps) = do\n  blks <- smushBlocks <$> mapM bodyPartToBlocks bps\n  let blks' = singleParaToPlain $ fromList $ blocksToDefinitions $ blocksToBullets $ toList blks\n  return (cell (convertAlign align)\n          rowSpan (ColSpan (fromIntegral gridSpan)) blks')\n\nrowsToRows :: PandocMonad m => [Docx.Row] -> DocxContext m [Pandoc.Row]\nrowsToRows rows = do\n  let rowspans = (fmap . fmap) (first RowSpan) (Docx.rowsToRowspans rows)\n  cells <- traverse (traverse (uncurry cellToCell)) rowspans\n  return (fmap (Pandoc.Row nullAttr) cells)\n\nsplitHeaderRows :: Bool -> [Docx.Row] -> ([Docx.Row], [Docx.Row])\nsplitHeaderRows hasFirstRowFormatting rs = bimap reverse reverse $ fst\n  $ if hasFirstRowFormatting\n    then L.foldl' f ((take 1 rs, []), True) (drop 1 rs)\n    else L.foldl' f (([], []), False) rs\n  where\n    f ((headerRows, bodyRows), previousRowWasHeader) r@(Docx.Row h cs)\n      | h == HasTblHeader || (previousRowWasHeader && any isContinuationCell cs)\n        = ((r : headerRows, bodyRows), True)\n      | otherwise\n        = ((headerRows, r : bodyRows), False)\n\n    isContinuationCell (Docx.Cell _ _ vm _) = vm == Docx.Continue\n\n\n-- like trimInlines, but also take out linebreaks\ntrimSps :: Inlines -> Inlines\ntrimSps (Many ils) = Many $ Seq.dropWhileL isSp $ Seq.dropWhileR isSp ils\n  where isSp Space     = True\n        isSp SoftBreak = True\n        isSp LineBreak = True\n        isSp _         = False\n\nextraAttr :: (Eq (StyleName a), HasStyleName a) => a -> Attr\nextraAttr s = (\"\", [], [(\"custom-style\", fromStyleName $ getStyleName s)])\n\nparagraphStyleToTransform :: PandocMonad m => ParagraphStyle -> DocxContext m (Blocks -> Blocks)\nparagraphStyleToTransform pPr =\n  let transform = if relativeIndent pPr > 0 && not (numbered pPr) &&\n                        not (any ((`elem` listParagraphStyles) . getStyleName) (pStyle pPr))\n                  then blockQuote\n                  else id\n  in do\n    extStylesEnabled <- asks (isEnabled Ext_styles . docxOptions)\n    return $ foldr (\\parStyle transform' ->\n        (parStyleToTransform extStylesEnabled parStyle) . transform'\n      ) transform (pStyle pPr)\n\nparStyleToTransform :: Bool -> ParStyle -> Blocks -> Blocks\nparStyleToTransform extStylesEnabled parStyle@(getStyleName -> styleName)\n  | (styleName `elem` divsToKeep) || (styleName `elem` listParagraphStyles) =\n      divWith (\"\", [normalizeToClassName styleName], [])\n  | otherwise =\n      (if extStylesEnabled then divWith (extraAttr parStyle) else id)\n      . (if isBlockQuote parStyle then blockQuote else id)\n\n-- The relative indent is the indentation minus the indentation of the parent style.\n-- This tells us whether this paragraph in particular was indented more and thus\n-- should be considered a block quote.\nrelativeIndent :: ParagraphStyle -> Integer\nrelativeIndent pPr =\n  let pStyleLeft = fromMaybe 0 $ pStyleIndentation pPr >>= leftParIndent\n      pStyleHang = fromMaybe 0 $ pStyleIndentation pPr >>= hangingParIndent\n      left = fromMaybe pStyleLeft $ indentation pPr >>= leftParIndent\n      hang = fromMaybe pStyleHang $ indentation pPr >>= hangingParIndent\n  in (left - hang) - (pStyleLeft - pStyleHang)\n\nnormalizeToClassName :: (FromStyleName a) => a -> T.Text\nnormalizeToClassName = T.map go . fromStyleName\n  where go c | isSpace c = '-'\n             | otherwise = c\n\nbodyPartToBlocks :: PandocMonad m => BodyPart -> DocxContext m Blocks\nbodyPartToBlocks (Heading n style pPr numId lvl mblvlInfo parparts) = do\n    ils <- local (\\s-> s{docxInHeaderBlock=True})\n           (smushInlines <$> mapM parPartToInlines parparts)\n    let classes = map normalizeToClassName . delete style\n                $ getStyleNames (pStyle pPr)\n    hasNumbering <- gets docxNumberedHeadings\n    let addNum = if hasNumbering && not (numbered pPr)\n                 then (++ [\"unnumbered\"])\n                 else id\n    if T.null numId\n       then pure ()\n       else do\n         -- We check whether this current numId has previously been used,\n         -- since Docx expects us to pick up where we left off.\n         listState <- gets docxListState\n         let start = case M.lookup (numId, lvl) listState of\n                       Nothing -> case mblvlInfo of\n                         Nothing -> 1\n                         Just (Level _ _ _ z) -> fromMaybe 1 z\n                       Just z -> z + 1\n         modify $ \\st -> st{ docxListState =\n             -- expire all the continuation data for lists of level > this one:\n             -- a new level 1 list item resets continuation for level 2+\n             -- see #10258\n             let notExpired (_, lvl') _ = lvl' <= lvl\n             in M.insert (numId, lvl) start\n                  (M.filterWithKey notExpired listState) }\n    makeHeaderAnchor $ headerWith (\"\", addNum classes, []) n ils\nbodyPartToBlocks (Paragraph pPr parparts)\n  | Just True <- pBidi pPr = do\n      let pPr' = pPr { pBidi = Nothing }\n      local (\\s -> s{ docxInBidi = True })\n        (bodyPartToBlocks (Paragraph pPr' parparts))\n  | isCodeDiv pPr = do\n      transform <- paragraphStyleToTransform pPr\n      return $\n        transform $\n        codeBlock $\n        T.concat $\n        map parPartToText parparts\n  | otherwise = do\n    ils <- trimSps . smushInlines <$> mapM parPartToInlines parparts\n    prevParaIls <- gets docxPrevPara\n    dropIls <- gets docxDropCap\n    let ils' = dropIls <> ils\n    let (paraOrPlain, pPr')\n          | hasStylesInheritedFrom [\"Compact\"] pPr = (plain, removeStyleNamed \"Compact\" pPr)\n          | otherwise = (para, pPr)\n    if dropCap pPr'\n      then do modify $ \\s -> s { docxDropCap = ils' }\n              return mempty\n      else do modify $ \\s -> s { docxDropCap = mempty }\n              let ils'' = (if null prevParaIls then mempty\n                          else prevParaIls <> space) <> ils'\n                  handleInsertion = do\n                    modify $ \\s -> s {docxPrevPara = mempty}\n                    transform <- paragraphStyleToTransform pPr'\n                    return $ transform $ paraOrPlain ils''\n              opts <- asks docxOptions\n              case (pChange pPr', readerTrackChanges opts) of\n                  _ | null ils'', not (isEnabled Ext_empty_paragraphs opts) ->\n                    return mempty\n                  (Just (TrackedChange Insertion _), AcceptChanges) ->\n                      handleInsertion\n                  (Just (TrackedChange Insertion _), RejectChanges) -> do\n                      modify $ \\s -> s {docxPrevPara = ils''}\n                      return mempty\n                  (Just (TrackedChange Insertion (ChangeInfo _ cAuthor cDate))\n                   , AllChanges) -> do\n                      let attr = (\"\", [\"paragraph-insertion\"], addAuthorAndDate cAuthor cDate)\n                          insertMark = spanWith attr mempty\n                      transform <- paragraphStyleToTransform pPr'\n                      return $ transform $\n                        paraOrPlain $ ils'' <> insertMark\n                  (Just (TrackedChange Deletion _), AcceptChanges) -> do\n                      modify $ \\s -> s {docxPrevPara = ils''}\n                      return mempty\n                  (Just (TrackedChange Deletion _), RejectChanges) ->\n                      handleInsertion\n                  (Just (TrackedChange Deletion (ChangeInfo _ cAuthor cDate))\n                   , AllChanges) -> do\n                      let attr = (\"\", [\"paragraph-deletion\"], addAuthorAndDate cAuthor cDate)\n                          insertMark = spanWith attr mempty\n                      transform <- paragraphStyleToTransform pPr'\n                      return $ transform $\n                        paraOrPlain $ ils'' <> insertMark\n                  _ -> handleInsertion\nbodyPartToBlocks (ListItem pPr numId lvl (Just levelInfo) parparts) = do\n  -- We check whether this current numId has previously been used,\n  -- since Docx expects us to pick up where we left off.\n  listState <- gets docxListState\n  let startFromState = M.lookup (numId, lvl) listState\n      Level _ fmt txt startFromLevelInfo = levelInfo\n      start = case startFromState of\n        Just n -> n + 1\n        Nothing -> fromMaybe 1 startFromLevelInfo\n      kvs = [ (\"level\", lvl)\n            , (\"num-id\", numId)\n            , (\"format\", fmt)\n            , (\"text\", txt)\n            , (\"start\", tshow start)\n            ]\n  modify $ \\st -> st{ docxListState =\n    -- expire all the continuation data for lists of level > this one:\n    -- a new level 1 list item resets continuation for level 2+\n    let notExpired (_, lvl') _ = lvl' <= lvl\n    in M.insert (numId, lvl) start (M.filterWithKey notExpired listState) }\n  blks <- bodyPartToBlocks (Paragraph pPr parparts)\n  return $ divWith (\"\", [\"list-item\"], kvs) blks\nbodyPartToBlocks (ListItem pPr _ _ _ parparts) =\n  let pPr' = pPr {pStyle = constructBogusParStyleData \"list-paragraph\": pStyle pPr}\n  in\n    bodyPartToBlocks $ Paragraph pPr' parparts\nbodyPartToBlocks (Captioned parstyle parparts bpart) = do\n  bs <- bodyPartToBlocks bpart\n  captContents <- bodyPartToBlocks (Paragraph parstyle parparts)\n  let capt = Caption Nothing (toList captContents)\n  let toCaptioned attr' bls = case bls of\n        [Table attr _cap colspecs thead tbodies tfoot]\n          -> singleton $ Table (attr <> attr') capt colspecs thead tbodies tfoot\n        [Figure attr _cap blks]\n          -> singleton $ Figure (attr <> attr') capt blks\n        [Para im@[Image{}]]\n          -> singleton $ Figure attr' capt [Plain im]\n        [Div attr bls']\n          -> toCaptioned (attr <> attr') bls'\n        [BlockQuote bls']\n          -> toCaptioned attr' bls'\n        _ -> captContents\n  pure $ toCaptioned nullAttr (toList bs)\nbodyPartToBlocks (Tbl _ _ _ _ []) =\n  return mempty\nbodyPartToBlocks (Tbl mbsty cap grid look parts) = do\n  let fullCaption = if T.null cap then mempty else plain (text cap)\n  let shortCaption = if T.null cap then Nothing else Just (toList (text cap))\n      cap' = caption shortCaption fullCaption\n      (hdr, rows) = splitHeaderRows (firstRowFormatting look) parts\n\n  let width = maybe 0 maximum $ nonEmpty $ map rowLength parts\n      rowLength :: Docx.Row -> Int\n      rowLength (Docx.Row _ c) = sum (fmap (\\(Docx.Cell _ gridSpan _ _) -> fromIntegral gridSpan) c)\n\n  headerCells <- rowsToRows hdr\n  bodyCells <- rowsToRows rows\n\n      -- Horizontal column alignment is taken from the first row's cells.\n  let getAlignment (Docx.Cell al colspan _ _) = replicate (fromIntegral colspan)\n                   $ convertAlign al\n      alignments = case rows of\n                     [] -> replicate width Pandoc.AlignDefault\n                     Docx.Row _ cs : _ -> concatMap getAlignment cs\n      widths = map (\\n -> if n == 0\n                             then ColWidthDefault\n                             else ColWidth n) grid\n\n  extStylesEnabled <- asks (isEnabled Ext_styles . docxOptions)\n  let attr = case mbsty of\n                Just sty | extStylesEnabled -> (\"\", [], [(\"custom-style\", sty)])\n                _ -> nullAttr\n  return $ tableWith attr cap'\n                 (zip alignments widths)\n                 (TableHead nullAttr headerCells)\n                 [TableBody nullAttr 0 [] bodyCells]\n                 (TableFoot nullAttr [])\nbodyPartToBlocks HRule = pure Pandoc.horizontalRule\n\n-- replace targets with generated anchors.\nrewriteLink' :: PandocMonad m => Inline -> DocxContext m Inline\nrewriteLink' l@(Link attr ils (T.uncons -> Just ('#',target), title)) = do\n  anchorMap <- gets docxAnchorMap\n  case M.lookup target anchorMap of\n    Just newTarget -> do\n      modify $ \\s -> s{docxAnchorSet = Set.insert newTarget (docxAnchorSet s)}\n      return $ Link attr ils (\"#\" <> newTarget, title)\n    Nothing        -> do\n      modify $ \\s -> s{docxAnchorSet = Set.insert target (docxAnchorSet s)}\n      return l\nrewriteLink' il = return il\n\nrewriteLinks :: PandocMonad m => [Block] -> DocxContext m [Block]\nrewriteLinks = mapM (walkM rewriteLink')\n\nremoveOrphanAnchors'' :: PandocMonad m => Inline -> DocxContext m [Inline]\nremoveOrphanAnchors'' s@(Span (ident, classes, _) ils)\n  | \"anchor\" `elem` classes = do\n      anchorSet <- gets docxAnchorSet\n      return $ if ident `Set.member` anchorSet\n               then [s]\n               else ils\nremoveOrphanAnchors'' il = return [il]\n\nremoveOrphanAnchors' :: PandocMonad m => [Inline] -> DocxContext m [Inline]\nremoveOrphanAnchors' ils = liftM concat $ mapM removeOrphanAnchors'' ils\n\nremoveOrphanAnchors :: PandocMonad m => [Block] -> DocxContext m [Block]\nremoveOrphanAnchors = mapM (walkM removeOrphanAnchors')\n\nbodyToOutput :: PandocMonad m => Body -> DocxContext m (Meta, [Block])\nbodyToOutput (Body bps) = do\n  let (metabps, blkbps) = sepBodyParts bps\n  meta <- bodyPartsToMeta metabps\n  let isNumberedPara (Paragraph pPr _) = numbered pPr\n      isNumberedPara _                 = False\n  modify (\\s -> s { docxNumberedHeadings = any isNumberedPara blkbps })\n  blks <- smushBlocks <$> mapM bodyPartToBlocks blkbps\n  blks' <- rewriteLinks $ blocksToDefinitions $ blocksToBullets $ toList blks\n  blks'' <- removeOrphanAnchors blks'\n  refs <- gets (map referenceToMetaValue . M.elems . docxReferences)\n  let meta' = if null refs\n                 then meta\n                 else setMeta \"references\" refs meta\n  return (meta', blks'')\n\ndocxToOutput :: PandocMonad m\n             => ReaderOptions\n             -> Docx\n             -> m (Meta, [Block])\ndocxToOutput opts (Docx (Document _ body)) =\n  let dEnv   = def { docxOptions  = opts} in\n   evalDocxContext (bodyToOutput body) dEnv def\n\naddAuthorAndDate :: T.Text -> Maybe T.Text -> [(T.Text, T.Text)]\naddAuthorAndDate author mdate =\n  (\"author\", author) : maybe [] (\\date -> [(\"date\", date)]) mdate\n\nconvertAlign :: Docx.Align -> Pandoc.Alignment\nconvertAlign al = case al of\n                       Docx.AlignDefault -> Pandoc.AlignDefault\n                       Docx.AlignLeft -> Pandoc.AlignLeft\n                       Docx.AlignCenter -> Pandoc.AlignCenter\n                       Docx.AlignRight -> Pandoc.AlignRight\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/DokuWiki.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TupleSections     #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Readers.DokuWiki\n   Copyright   : Copyright (C) 2018-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Krotov <ilabdsf@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of DokuWiki text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.DokuWiki (readDokuWiki) where\n\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport Data.Char (isAlphaNum, isDigit)\nimport qualified Data.Foldable as F\nimport Data.Maybe (fromMaybe, catMaybes)\nimport Data.Bifunctor (second)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (enclosed)\nimport Text.Pandoc.Shared (trim, stringify, tshow)\nimport Data.List (isPrefixOf, isSuffixOf, groupBy)\nimport qualified Safe\n\n-- | Read DokuWiki from an input string and return a Pandoc document.\nreadDokuWiki :: (PandocMonad m, ToSources a)\n             => ReaderOptions\n             -> a\n             -> m Pandoc\nreadDokuWiki opts s = do\n  let sources = toSources s\n  res <- runParserT parseDokuWiki def {stateOptions = opts }\n           (initialSourceName sources) sources\n  case res of\n       Left e  -> throwError $ fromParsecError sources e\n       Right d -> return d\n\ntype DWParser = ParsecT Sources ParserState\n\n-- * Utility functions\n\n-- | Parse end-of-line, which can be either a newline or end-of-file.\neol :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m ()\neol = void newline <|> eof\n\nguardColumnOne :: PandocMonad m => DWParser m ()\nguardColumnOne = getPosition >>= \\pos -> guard (sourceColumn pos == 1)\n\n-- | Parse DokuWiki document.\nparseDokuWiki :: PandocMonad m => DWParser m Pandoc\nparseDokuWiki =\n  B.doc . mconcat <$> many block <* spaces <* eof\n\n-- | Parse <code> and <file> attributes\ncodeLanguage :: PandocMonad m => DWParser m (Text, [Text], [(Text, Text)])\ncodeLanguage = try $ do\n  rawLang <- option \"-\" (spaceChar *> manyTillChar anyChar (lookAhead (spaceChar <|> char '>')))\n  let attr = case rawLang of\n               \"-\" -> []\n               l -> [l]\n  return (\"\", attr, [])\n\n-- | Generic parser for <code> and <file> tags\ncodeTag :: PandocMonad m\n        => ((Text, [Text], [(Text, Text)]) -> Text -> a)\n        -> Text\n        -> DWParser m a\ncodeTag f tag = try $ f\n  <$  char '<'\n  <*  textStr tag\n  <*> codeLanguage\n  <*  manyTill anyChar (char '>')\n  <*  optional (manyTill spaceChar eol)\n  <*> manyTillChar anyChar (try $ string \"</\" <* textStr tag <* char '>')\n\n-- * Inline parsers\n\n-- | Parse any inline element but softbreak.\ninline' :: PandocMonad m => DWParser m B.Inlines\ninline' = whitespace\n      <|> inline''\n\n-- | Parse any inline element but whitespace.\ninline'' :: PandocMonad m => DWParser m B.Inlines\ninline'' = br\n      <|> bold\n      <|> italic\n      <|> underlined\n      <|> nowiki\n      <|> percent\n      <|> link\n      <|> image\n      <|> monospaced\n      <|> subscript\n      <|> superscript\n      <|> deleted\n      <|> footnote\n      <|> inlineRaw\n      <|> math\n      <|> autoLink\n      <|> autoEmail\n      <|> notoc\n      <|> nocache\n      <|> smartPunctuation inline\n      <|> str\n      <|> symbol\n      <?> \"inline\"\n\n-- | Parse any inline element but soft breaks and do not consolidate spaces.\ninlineUnconsolidatedWhitespace :: PandocMonad m => DWParser m B.Inlines\ninlineUnconsolidatedWhitespace = (B.space <$ spaceChar) <|> inline'\n\n-- | Parse any inline element, including soft break.\ninline :: PandocMonad m => DWParser m B.Inlines\ninline = endline <|> inline'\n\nendline :: PandocMonad m => DWParser m B.Inlines\nendline = try $ B.softbreak <$ skipMany spaceChar <* linebreak\n\nwhitespace :: PandocMonad m => DWParser m B.Inlines\nwhitespace = try $ B.space <$ skipMany1 spaceChar\n\nbr :: PandocMonad m => DWParser m B.Inlines\nbr = try $ B.linebreak <$ string \"\\\\\\\\\" <* space\n\nlinebreak :: PandocMonad m => DWParser m B.Inlines\nlinebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)\n  where lastNewline  = mempty <$ eof\n        innerNewline = pure B.space\n\nbetween :: (Monoid c, PandocMonad m, Show b)\n        => DWParser m a -> DWParser m b -> (DWParser m b -> DWParser m c)\n        -> DWParser m c\nbetween start end p =\n  mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)\n\nenclosed :: (Monoid b, PandocMonad m, Show a)\n         => DWParser m a -> (DWParser m a -> DWParser m b) -> DWParser m b\nenclosed sep p = between sep (try sep) p\n\nnestedInlines :: (Show a, PandocMonad m)\n              => DWParser m a -> DWParser m B.Inlines\nnestedInlines end = innerSpace <|> nestedInline\n  where\n    innerSpace   = try $ whitespace <* notFollowedBy end\n    nestedInline = notFollowedBy whitespace >> inline\n\nbold :: PandocMonad m => DWParser m B.Inlines\nbold = try $ B.strong <$> enclosed (string \"**\") nestedInlines\n\nitalic :: PandocMonad m => DWParser m B.Inlines\nitalic = try $ B.emph <$> enclosed (string \"//\") nestedInlines\n\nunderlined :: PandocMonad m => DWParser m B.Inlines\nunderlined = try $ B.underline <$> enclosed (string \"__\") nestedInlines\n\nnowiki :: PandocMonad m => DWParser m B.Inlines\nnowiki = try $ B.text <$ string \"<nowiki>\" <*> manyTillChar anyChar (try $ string \"</nowiki>\")\n\npercent :: PandocMonad m => DWParser m B.Inlines\npercent = try $ B.text <$> enclosed (string \"%%\") nestedText\n\nnestedText :: (Show a, PandocMonad m)\n             => DWParser m a -> DWParser m Text\nnestedText end = innerSpace <|> countChar 1 nonspaceChar\n  where\n    innerSpace = try $ many1Char spaceChar <* notFollowedBy end\n\nmonospaced :: PandocMonad m => DWParser m B.Inlines\nmonospaced = try $ B.code . (T.concat . map stringify . B.toList) <$> enclosed (string \"''\") nestedInlines\n\nsubscript :: PandocMonad m => DWParser m B.Inlines\nsubscript = try $ B.subscript <$> between (string \"<sub>\") (try $ string \"</sub>\") nestedInlines\n\nsuperscript :: PandocMonad m => DWParser m B.Inlines\nsuperscript = try $ B.superscript <$> between (string \"<sup>\") (try $ string \"</sup>\") nestedInlines\n\ndeleted :: PandocMonad m => DWParser m B.Inlines\ndeleted = try $ B.strikeout <$> between (string \"<del>\") (try $ string \"</del>\") nestedInlines\n\n-- | Parse a footnote.\nfootnote :: PandocMonad m => DWParser m B.Inlines\nfootnote = try $ B.note . B.para <$> between (string \"((\") (try $ string \"))\") nestedInlines\n\ninlineRaw :: PandocMonad m => DWParser m B.Inlines\ninlineRaw = try $ do\n  char '<'\n  fmt <- oneOfStrings [\"html\", \"php\", \"latex\"]\n  -- LaTeX via https://www.dokuwiki.org/plugin:latex\n  char '>'\n  contents <- manyTillChar anyChar\n                (try $ string \"</\" *> string (T.unpack fmt) *> char '>')\n  return $\n    case T.toLower fmt of\n         \"php\" -> B.rawInline \"html\" $ \"<?php \" <> contents <> \" ?>\"\n         f -> B.rawInline f contents\n\n-- see https://www.dokuwiki.org/plugin:latex\nmath :: PandocMonad m => DWParser m B.Inlines\nmath = (B.displayMath <$> mathDisplay) <|> (B.math <$> mathInline)\n\nmakeLink :: (Text, Text) -> B.Inlines\nmakeLink (text, url) = B.link url \"\" $ B.str text\n\nautoEmail :: PandocMonad m => DWParser m B.Inlines\nautoEmail = try $ do\n  state <- getState\n  guard $ stateAllowLinks state\n  makeLink <$ char '<' <*> emailAddress <* char '>'\n\nautoLink :: PandocMonad m => DWParser m B.Inlines\nautoLink = try $ do\n  state <- getState\n  guard $ stateAllowLinks state\n  (text, url) <- uri\n  guard $ not $ T.isInfixOf \"%%//%%\" text  -- see #9153\n  guard $ checkLink (T.last url)\n  return $ makeLink (text, url)\n  where\n    checkLink c\n      | c == '/' = True\n      | otherwise = isAlphaNum c\n\nnotoc :: PandocMonad m => DWParser m B.Inlines\nnotoc = try $ mempty <$ string \"~~NOTOC~~\"\n\nnocache :: PandocMonad m => DWParser m B.Inlines\nnocache = try $ mempty <$ string \"~~NOCACHE~~\"\n\nstr :: PandocMonad m => DWParser m B.Inlines\nstr = B.str <$> (many1Char alphaNum <|> characterReference)\n\nsymbol :: PandocMonad m => DWParser m B.Inlines\nsymbol = B.str <$> (notFollowedBy' blockCode *> countChar 1 nonspaceChar)\n\nlink :: PandocMonad m => DWParser m B.Inlines\nlink = try $ do\n  st <- getState\n  guard $ stateAllowLinks st\n  setState $ st{ stateAllowLinks = False }\n  l <- linkText\n  setState $ st{ stateAllowLinks = True }\n  return l\n\nisExternalLink :: Text -> Bool\nisExternalLink s = \"://\" `T.isPrefixOf` sSuff\n  where\n    sSuff = T.dropWhile (\\c -> isAlphaNum c || (c `elem` ['-', '.', '+'])) s\n\nisAbsolutePath :: Text -> Bool\nisAbsolutePath (T.uncons -> Just ('.', _)) = False\nisAbsolutePath s = T.any (== ':') s\n\nnormalizeDots :: Text -> Text\nnormalizeDots path\n  | not (T.null pref) = case T.uncons suff of\n      Just (':', _) -> path\n      _             -> pref <> \":\" <> suff\n  | otherwise = path\n  where\n    (pref, suff) = T.span (== '.') path\n\nnormalizeInternalPath :: Text -> Text\nnormalizeInternalPath path =\n  if isAbsolutePath path\n    then ensureAbsolute normalizedPath\n    else normalizedPath\n  where\n    normalizedPath = T.intercalate \"/\" $ dropWhile (== \".\") $ T.splitOn \":\" $ normalizeDots path\n    ensureAbsolute s@(T.uncons -> Just ('/', _)) = s\n    ensureAbsolute s = \"/\" <> s\n\nnormalizePath :: Text -> Text\nnormalizePath path =\n  if isExternalLink path\n    then path\n    else normalizeInternalPath path\n\nurlToText :: Text -> Text\nurlToText url =\n  if isExternalLink url\n    then url\n    else T.takeWhileEnd (/= ':') url\n\n-- Parse link or image\nparseLink :: PandocMonad m\n          => (Text -> Maybe B.Inlines -> B.Inlines)\n          -> Text\n          -> Text\n          -> DWParser m B.Inlines\nparseLink f l r = f\n  <$  textStr l\n  <*> many1TillChar anyChar (lookAhead (void (char '|') <|> try (void $ textStr r)))\n  <*> ( (char '|' *> optionMaybe (B.trimInlines . B.text . T.pack <$>\n                       many1Till anyChar (lookAhead (try (textStr r)))))\n       <|> pure Nothing\n      )\n  <* textStr r\n\n-- | Split Interwiki link into left and right part\n-- | Return Nothing if it is not Interwiki link\nsplitInterwiki :: Text -> Maybe (Text, Text)\nsplitInterwiki path =\n  case T.span (\\c -> isAlphaNum c || c == '.') path of\n    (l, T.uncons -> Just ('>', r)) -> Just (l, r)\n    _ -> Nothing\n\ninterwikiToUrl :: Text -> Text -> Text\ninterwikiToUrl \"callto\" page = \"callto://\" <> page\ninterwikiToUrl \"doku\" page = \"https://www.dokuwiki.org/\" <> page\ninterwikiToUrl \"phpfn\" page = \"https://secure.php.net/\" <> page\ninterwikiToUrl \"tel\" page = \"tel:\" <> page\ninterwikiToUrl \"wp\" page = \"https://en.wikipedia.org/wiki/\" <> page\ninterwikiToUrl \"wpde\" page = \"https://de.wikipedia.org/wiki/\" <> page\ninterwikiToUrl \"wpes\" page = \"https://es.wikipedia.org/wiki/\" <> page\ninterwikiToUrl \"wpfr\" page = \"https://fr.wikipedia.org/wiki/\" <> page\ninterwikiToUrl \"wpjp\" page = \"https://jp.wikipedia.org/wiki/\" <> page\ninterwikiToUrl \"wppl\" page = \"https://pl.wikipedia.org/wiki/\" <> page\ninterwikiToUrl unknown page = unknown <> \">\" <> page\n\nlinkText :: PandocMonad m => DWParser m B.Inlines\nlinkText = parseLink fromRaw \"[[\" \"]]\"\n  where\n    fromRaw path description =\n      B.link normalizedPath \"\" (fromMaybe (B.str defaultDescription) description)\n      where\n        path' = trim path\n        interwiki = splitInterwiki path'\n        normalizedPath =\n          case interwiki of\n            Nothing -> normalizePath path'\n            Just (l, r) -> interwikiToUrl l r\n        defaultDescription =\n          case interwiki of\n            Nothing -> urlToText path'\n            Just (_, r) -> r\n\n-- Matches strings like \"100x100\" (width x height) and \"50\" (width)\nisWidthHeightParameter :: Text -> Bool\nisWidthHeightParameter s =\n  case T.uncons s of\n    Just (x, xs) ->\n      isDigit x && case T.uncons $ T.dropWhile isDigit xs of\n                     Just ('x', ys) | not (T.null ys) -> T.all isDigit ys\n                     Nothing -> True\n                     _ -> False\n    _ -> False\n\nparseWidthHeight :: Text -> (Maybe Text, Maybe Text)\nparseWidthHeight s = (width, height)\n  where\n    width = Just $ T.takeWhile isDigit s\n    height =\n      case T.uncons $ T.dropWhile isDigit s of\n        Just ('x', xs) -> Just xs\n        _ -> Nothing\n\nimage :: PandocMonad m => DWParser m B.Inlines\nimage = try $ parseLink fromRaw \"{{\" \"}}\"\n  where\n    fromRaw path description =\n      if linkOnly\n        then B.link normalizedPath \"\" (fromMaybe defaultDescription description)\n        else B.imageWith (\"\", classes, attributes) normalizedPath \"\" (fromMaybe defaultDescription description)\n      where\n        (path', parameters) = T.span (/= '?') $ trim path\n        normalizedPath = normalizePath path'\n        leftPadding = \" \" `T.isPrefixOf` path\n        rightPadding = \" \" `T.isSuffixOf` path\n        classes =\n          case (leftPadding, rightPadding) of\n            (False, False) -> []\n            (False, True) -> [\"align-left\"]\n            (True, False) -> [\"align-right\"]\n            (True, True) -> [\"align-center\"]\n        parameterList = T.splitOn \"&\" $ T.drop 1 parameters\n        linkOnly = \"linkonly\" `elem` parameterList\n        (width, height) = maybe (Nothing, Nothing) parseWidthHeight (F.find isWidthHeightParameter parameterList)\n        attributes = catMaybes [\n                fmap (\"width\",) width,\n                fmap (\"height\",) height,\n                fmap (\"query\",) (if T.null parameters then Nothing else Just parameters)\n            ]\n        defaultDescription = B.str $ urlToText path'\n\n-- * Block parsers\n\nblock :: PandocMonad m => DWParser m B.Blocks\nblock = do\n  res <- mempty <$ skipMany1 blankline\n         <|> blockElements\n         <|> para\n  skipMany blankline\n  trace (T.take 60 $ tshow $ B.toList res)\n  return res\n\nblockElements :: PandocMonad m => DWParser m B.Blocks\nblockElements = horizontalLine\n            <|> header\n            <|> list \"  \"\n            <|> indentedCode\n            <|> quote\n            <|> blockCode\n            <|> blockRaw\n            <|> table\n\nhorizontalLine :: PandocMonad m => DWParser m B.Blocks\nhorizontalLine = try $ B.horizontalRule <$ string \"---\" <* many1 (char '-') <* eol\n\nheader :: PandocMonad m => DWParser m B.Blocks\nheader = try $ do\n  guardColumnOne\n  eqs <- many1 (char '=')\n  let lev = length eqs\n  guard $ lev < 7\n  contents <- B.trimInlines . mconcat <$> manyTill inline (try $ char '=' *> many1 (char '='))\n  attr <- registerHeader nullAttr contents\n  return $ B.headerWith attr (7 - lev) contents\n\nlist :: PandocMonad m => Text -> DWParser m B.Blocks\nlist prefix = bulletList prefix <|> orderedList prefix\n\nbulletList :: PandocMonad m => Text -> DWParser m B.Blocks\nbulletList prefix = try $ B.bulletList <$> parseList prefix '*'\n\norderedList :: PandocMonad m => Text -> DWParser m B.Blocks\norderedList prefix = try $ B.orderedList <$> parseList prefix '-'\n\nparseList :: PandocMonad m\n          => Text\n          -> Char\n          -> DWParser m [B.Blocks]\nparseList prefix marker =\n  many1 ((<>) <$> item <*> fmap mconcat (many continuation))\n  where\n    continuation = try $ list (\"  \" <> prefix)\n    item = try $ textStr prefix *>\n                   optional (char ' ') *>  -- see #8863\n                   char marker *> char ' ' *>\n                   (mconcat <$> many1 itemContents <* eol)\n    itemContents = (B.plain . mconcat <$> many1 inline') <|>\n                   blockCode\n\nindentedCode :: PandocMonad m => DWParser m B.Blocks\nindentedCode = try $ B.codeBlock . T.unlines <$> many1 indentedLine\n where\n   indentedLine = try $ string \"  \" *> manyTillChar anyChar eol\n\n-- Note that block quotes in dokuwiki parse as lists of hard-break\n-- separated lines; see #6461.\nquote :: PandocMonad m => DWParser m B.Blocks\nquote = go <$> many1 blockQuoteLine\n where\n   blockQuoteLine = try $ do\n     lev <- length <$> many1 (char '>')\n     skipMany spaceChar\n     contents <- (blockCode <* skipMany spaceChar <* optional eol) <|>\n       (B.plain . B.trimInlines . mconcat <$> many1Till inline' eol)\n     pure (lev, contents)\n   go [] = mempty\n   go xs = mconcat $ map go' (groupBy (\\(x,_) (y,_) -> (x == 0 && y == 0) ||\n                                                        (x > 0 && y > 0)) xs)\n   go' [] = mempty\n   go' xs@((0,_):_) =\n        let (lns, bls) = F.foldl' consolidatePlains (mempty,mempty) (map snd xs)\n         in bls <> if lns == mempty\n                      then mempty\n                      else B.plain lns\n   go' xs = B.blockQuote (go $ map (\\(x,y) -> (x - 1, y)) xs)\n   consolidatePlains (lns, bls) b =\n     case B.toList b of\n       [Plain ils] -> ((if lns == mempty\n                           then B.fromList ils\n                           else lns <> B.linebreak <> B.fromList ils), bls)\n       _ -> (mempty, bls <>\n                     (if lns == lns\n                         then mempty\n                         else B.plain lns)\n                      <> b)\n\nblockRaw :: PandocMonad m => DWParser m B.Blocks\nblockRaw = try $ do\n  char '<'\n  fmt <- oneOfStrings [\"HTML\", \"PHP\", \"LATEX\"]\n  -- LaTeX via https://www.dokuwiki.org/plugin:latex\n  char '>'\n  optional (manyTill spaceChar eol)\n  contents <- manyTillChar anyChar\n               (try $ string \"</\" *> string (T.unpack fmt) *> char '>')\n  return $\n    case T.toLower fmt of\n         \"php\" -> B.rawBlock \"html\" $ \"<?php \" <> contents <> \" ?>\"\n         f -> B.rawBlock f contents\n\ntable :: PandocMonad m => DWParser m B.Blocks\ntable = do\n  firstSeparator <- lookAhead tableCellSeparator\n  rows <- tableRows\n  let firstRow = fromMaybe [] . Safe.headMay $ rows\n  let (headerRow, body) = if firstSeparator == '^'\n                            then (firstRow, drop 1 rows)\n                            else ([], rows)\n  -- Since Pandoc only has column level alignment, we have to make an arbitrary\n  -- choice of how to reconcile potentially different alignments in the row.\n  -- Here we end up assuming that the alignment of the header / first row is\n  -- what the user wants to apply to the whole thing.\n  let attrs =  map (\\(a, _) -> (a, ColWidthDefault)) firstRow\n  let toRow = Row nullAttr . map B.simpleCell\n      toHeaderRow l = [toRow l | not (null l)]\n  pure $ B.table B.emptyCaption\n                 attrs\n                 (TableHead nullAttr $ toHeaderRow (map snd headerRow))\n                 [TableBody nullAttr 0 [] $ map (toRow . (map snd)) body]\n                 (TableFoot nullAttr [])\n\n\ntableRows :: PandocMonad m => DWParser m [[(Alignment, B.Blocks)]]\ntableRows = many1 tableRow\n\ntableRow :: PandocMonad m => DWParser m [(Alignment, B.Blocks)]\ntableRow = many1Till tableCell tableRowEnd\n\ntableRowEnd :: PandocMonad m => DWParser m Char\ntableRowEnd = try $ tableCellSeparator <* manyTill spaceChar eol\n\ntableCellSeparator :: PandocMonad m => DWParser m Char\ntableCellSeparator = char '|' <|> char '^'\n\ntableCell :: PandocMonad m => DWParser m (Alignment, B.Blocks)\ntableCell = try $ (second (B.plain . B.trimInlines . mconcat)) <$> cellContent\n  where\n    cellContent = do\n      -- https://www.dokuwiki.org/wiki:syntax#tables\n      -- DokuWiki represents the alignment of cells with two spaces padding.\n      tableCellSeparator\n      cellInline <- manyTill inlineUnconsolidatedWhitespace (lookAhead tableCellSeparator)\n      let left  = [B.space, B.space] `isPrefixOf` cellInline\n      let right = [B.space, B.space] `isSuffixOf` cellInline\n      let alignment = case (left, right) of\n                           (True, True)   -> AlignCenter\n                           (True, False)  -> AlignRight\n                           (False, True)  -> AlignLeft\n                           (False, False) -> AlignDefault\n      return (alignment, cellInline)\n\n\nblockCode :: PandocMonad m => DWParser m B.Blocks\nblockCode = codeTag B.codeBlockWith \"code\" <|>\n            codeTag B.codeBlockWith \"file\"\n\npara :: PandocMonad m => DWParser m B.Blocks\npara = result . mconcat <$> many1Till inline endOfParaElement\n where\n   endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement\n   endOfInput       = try $ skipMany blankline >> skipSpaces >> eof\n   endOfPara        = try $ blankline >> skipMany1 blankline\n   newBlockElement  = try (blankline >> void blockElements)\n                       <|> lookAhead (void blockCode)\n   result content   = if F.all (==Space) content\n                      then mempty\n                      else B.para $ B.trimInlines content\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/EPUB.hs",
    "content": "{-# LANGUAGE TupleSections     #-}\n{-# LANGUAGE ViewPatterns      #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.EPUB\n   Copyright   : Copyright (C) 2014-2020 Matthew Pickering\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of EPUB to 'Pandoc' document.\n-}\n\nmodule Text.Pandoc.Readers.EPUB\n  (readEPUB)\n  where\n\nimport Codec.Archive.Zip (Archive (..), Entry(..), findEntryByPath, fromEntry,\n                          toArchiveOrFail)\nimport Control.DeepSeq (NFData, deepseq)\nimport Control.Monad (guard, liftM, liftM2, mplus)\nimport Control.Monad.Except (throwError)\nimport qualified Data.ByteString.Lazy as BL (ByteString)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport qualified Data.Map as M (Map, elems, fromList, lookup)\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Lazy.Encoding as TL\nimport Network.URI (unEscapeString, parseRelativeReference, URI(..))\nimport System.FilePath (dropFileName, dropFileName, normalise, splitFileName,\n                        takeFileName, (</>))\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, insertMedia)\nimport Text.Pandoc.Definition hiding (Attr)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Extensions (Extension (Ext_raw_html), enableExtension)\nimport Text.Pandoc.MIME (MimeType)\nimport Text.Pandoc.Options (ReaderOptions (..))\nimport Text.Pandoc.Readers.HTML (readHtml)\nimport Text.Pandoc.Shared (addMetaField, collapseFilePath, tshow)\nimport Text.Pandoc.URI (escapeURI)\nimport qualified Text.Pandoc.UTF8 as UTF8 (toTextLazy)\nimport Text.Pandoc.Walk (query, walk)\nimport Text.Pandoc.XML.Light\n\ntype Items = M.Map Text (FilePath, MimeType)\n\nreadEPUB :: PandocMonad m => ReaderOptions -> BL.ByteString -> m Pandoc\nreadEPUB opts bytes = case toArchiveOrFail bytes of\n  Right archive -> archiveToEPUB opts archive\n  Left  e       -> throwError $ PandocParseError $\n                     \"Couldn't extract ePub file: \" <> T.pack e\n\n-- runEPUB :: Except PandocError a -> Either PandocError a\n-- runEPUB = runExcept\n\n-- Note that internal reference are aggressively normalised so that all ids\n-- are of the form \"filename#id\"\n--\narchiveToEPUB :: (PandocMonad m) => ReaderOptions -> Archive -> m Pandoc\narchiveToEPUB os archive = do\n  -- root is path to folder with manifest file in\n  (root, content) <- getManifest archive\n  (coverId, meta) <- parseMeta content\n  (cover, items)  <- parseManifest content coverId\n  -- No need to collapse here as the image path is from the manifest file\n  let coverDoc = maybe mempty imageToPandoc cover\n  spine <- parseSpine items content\n  let escapedSpine = map (escapeURI . T.pack . takeFileName . fst) spine\n  Pandoc _ bs <-\n      foldM' (\\a b -> ((a <>) . walk (prependHash escapedSpine))\n        `liftM` parseSpineElem root b) mempty spine\n  let ast = coverDoc <> Pandoc meta bs\n  fetchImages (M.elems items) root archive ast\n  return ast\n  where\n    os' = os {readerExtensions = enableExtension Ext_raw_html (readerExtensions os)}\n    parseSpineElem :: PandocMonad m => FilePath -> (FilePath, MimeType) -> m Pandoc\n    parseSpineElem (normalise -> r) (normalise -> path, mime) = do\n      doc <- mimeToReader mime r path\n      let docSpan = B.doc $ B.para $ B.spanWith (T.pack $ takeFileName path, [], []) mempty\n      return $ docSpan <> doc\n    mimeToReader :: PandocMonad m => MimeType -> FilePath -> FilePath -> m Pandoc\n    mimeToReader \"application/xhtml+xml\" (unEscapeString -> root)\n                                         (unEscapeString -> path) = do\n      fname <- findEntryByPathE (root </> path) archive\n      html <- readHtml os' . TL.toStrict . TL.decodeUtf8 $ fromEntry fname\n      return $ fixInternalReferences path html\n    mimeToReader s _ (unEscapeString -> path)\n      | s `elem` imageMimes = return $ imageToPandoc path\n      | otherwise = return mempty\n\n-- paths should be absolute when this function is called\n-- renameImages should do this\nfetchImages :: PandocMonad m\n            => [(FilePath, MimeType)]\n            -> FilePath -- ^ Root\n            -> Archive\n            -> Pandoc\n            -> m ()\nfetchImages mimes root arc (query iq -> links) =\n    mapM_ (uncurry3 insertMedia) (mapMaybe getEntry links)\n  where\n    getEntry link =\n        let abslink = normalise (unEscapeString (root </> link)) in\n        (link , lookup link mimes, ) . fromEntry\n          <$> findEntryByPath abslink arc\n\niq :: Inline -> [FilePath]\niq (Image _ _ (url, _)) = [T.unpack url]\niq _                    = []\n\n-- Remove relative paths\nrenameImages :: FilePath -> Inline -> Inline\nrenameImages root img@(Image attr a (url, b))\n  | \"data:\" `T.isPrefixOf` url = img\n  | otherwise                  = Image attr a ( T.pack $ collapseFilePath (root </> T.unpack url)\n                                              , b)\nrenameImages _ x = x\n\nimageToPandoc :: FilePath -> Pandoc\nimageToPandoc s = B.doc . B.para $ B.image (T.pack s) \"\" mempty\n\nimageMimes :: [MimeType]\nimageMimes = [\"image/gif\", \"image/jpeg\", \"image/png\"]\n\ntype CoverId = Text\n\ntype CoverImage = FilePath\n\nparseManifest :: (PandocMonad m)\n              => Element -> Maybe CoverId -> m (Maybe CoverImage, Items)\nparseManifest content coverId = do\n  manifest <- findElementE (dfName \"manifest\") content\n  let items = findChildren (dfName \"item\") manifest\n  r <- mapM parseItem items\n  let cover = findAttr (emptyName \"href\") =<< filterChild findCover manifest\n  return (T.unpack <$> (cover `mplus` coverId), M.fromList r)\n  where\n    findCover e = maybe False (T.isInfixOf \"cover-image\")\n                  (findAttr (emptyName \"properties\") e)\n               || Just True == liftM2 (==) coverId (findAttr (emptyName \"id\") e)\n    parseItem e = do\n      uid <- findAttrE (emptyName \"id\") e\n      href <- findAttrE (emptyName \"href\") e\n      mime <- findAttrE (emptyName \"media-type\") e\n      return (uid, (T.unpack href, mime))\n\nparseSpine :: PandocMonad m => Items -> Element -> m [(FilePath, MimeType)]\nparseSpine is e = do\n  spine <- findElementE (dfName \"spine\") e\n  let itemRefs = findChildren (dfName \"itemref\") spine\n  mapM (mkE \"parseSpine\" . flip M.lookup is) $ mapMaybe parseItemRef itemRefs\n  where\n    parseItemRef ref = do\n      let linear = maybe True (== \"yes\") (findAttr (emptyName \"linear\") ref)\n      guard linear\n      findAttr (emptyName \"idref\") ref\n\nparseMeta :: PandocMonad m => Element -> m (Maybe CoverId, Meta)\nparseMeta content = do\n  meta <- findElementE (dfName \"metadata\") content\n  let dcspace (QName _ (Just \"http://purl.org/dc/elements/1.1/\") (Just \"dc\")) = True\n      dcspace _ = False\n  let dcs = filterChildrenName dcspace meta\n  let r = foldr parseMetaItem nullMeta dcs\n  let coverId = findAttr (emptyName \"content\") =<< filterChild findCover meta\n  return (coverId, r)\n  where\n    findCover e = findAttr (emptyName \"name\") e == Just \"cover\"\n\n-- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem\nparseMetaItem :: Element -> Meta -> Meta\nparseMetaItem e@(stripNamespace . elName -> field) meta =\n  addMetaField (renameMeta field) (B.str $ strContent e) meta\n\nrenameMeta :: Text -> Text\nrenameMeta \"creator\" = \"author\"\nrenameMeta s         = s\n\ngetManifest :: PandocMonad m => Archive -> m (String, Element)\ngetManifest archive = do\n  metaEntry <- findEntryByPathE (\"META-INF\" </> \"container.xml\") archive\n  docElem <- parseXMLDocE metaEntry\n  let namespaces = mapMaybe attrToNSPair (elAttribs docElem)\n  ns <- mkE \"xmlns not in namespaces\" (lookup \"xmlns\" namespaces)\n  as <- fmap (map attrToPair . elAttribs)\n    (findElementE (QName \"rootfile\" (Just ns) Nothing) docElem)\n  manifestFile <- T.unpack <$> mkE \"Root not found\" (lookup \"full-path\" as)\n  let rootdir = dropFileName manifestFile\n  --mime <- lookup \"media-type\" as\n  manifest <- findEntryByPathE manifestFile archive\n  (rootdir,) <$> parseXMLDocE manifest\n\n-- Fixup\n\nfixInternalReferences :: FilePath -> Pandoc -> Pandoc\nfixInternalReferences pathToFile =\n   walk (renameImages root)\n  . walk (fixBlockIRs filename)\n  . walk (fixInlineIRs filename)\n  where\n    (root, T.unpack . escapeURI . T.pack -> filename) =\n      splitFileName pathToFile\n\nfixInlineIRs :: String -> Inline -> Inline\nfixInlineIRs s (Span as v) =\n  Span (fixAttrs s as) v\nfixInlineIRs s (Code as code) =\n  Code (fixAttrs s as) code\nfixInlineIRs s (Link as is (url, tit)) =\n  case parseRelativeReference (T.unpack url) of\n    Just URI{ uriScheme = \"\"\n            , uriAuthority = Nothing\n            , uriPath = upath\n            , uriQuery = \"\"\n            , uriFragment = '#':ufrag } ->\n         Link (fixAttrs s as) is (addHash (if null upath\n                                              then s\n                                              else upath) (T.pack ufrag), tit)\n    _ -> Link (fixAttrs s as) is (url, tit)\nfixInlineIRs _ v = v\n\nprependHash :: [Text] -> Inline -> Inline\nprependHash ps l@(Link attr is (url, tit))\n  | or [s `T.isPrefixOf` url | s <- ps] =\n    Link attr is (\"#\" <> url, tit)\n  | otherwise = l\nprependHash _ i = i\n\nfixBlockIRs :: String -> Block -> Block\nfixBlockIRs s (Div as b) =\n  Div (fixAttrs s as) b\nfixBlockIRs s (Header i as b) =\n  Header i (fixAttrs s as) b\nfixBlockIRs s (CodeBlock as code) =\n  CodeBlock (fixAttrs s as) code\nfixBlockIRs _ b = b\n\nfixAttrs :: FilePath -> B.Attr -> B.Attr\nfixAttrs s (ident, cs, kvs) =\n  (addHash s ident, filter (not . T.null) cs, removeEPUBAttrs kvs)\n\naddHash :: FilePath -> Text -> Text\naddHash _ \"\"    = \"\"\naddHash s ident = T.pack (takeFileName s) <> \"_\" <> ident\n\nremoveEPUBAttrs :: [(Text, Text)] -> [(Text, Text)]\nremoveEPUBAttrs kvs = filter (not . isEPUBAttr) kvs\n\nisEPUBAttr :: (Text, a) -> Bool\nisEPUBAttr (k, _) = \"epub:\" `T.isPrefixOf` k\n\n-- Library\n\n-- Strict version of foldM\nfoldM' :: (Monad m, NFData a) => (a -> b -> m a) -> a -> [b] -> m a\nfoldM' _ z [] = return z\nfoldM' f z (x:xs) = do\n  z' <- f z x\n  z' `deepseq` foldM' f z' xs\n\nuncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d\nuncurry3 f (a, b, c) = f a b c\n\n-- Utility\n\nstripNamespace :: QName -> Text\nstripNamespace (QName v _ _) = v\n\nattrToNSPair :: Attr -> Maybe (Text, Text)\nattrToNSPair (Attr (QName \"xmlns\" _ _) val) = Just (\"xmlns\", val)\nattrToNSPair _                              = Nothing\n\nattrToPair :: Attr -> (Text, Text)\nattrToPair (Attr (QName name _ _) val) = (name, val)\n\ndefaultNameSpace :: Maybe Text\ndefaultNameSpace = Just \"http://www.idpf.org/2007/opf\"\n\ndfName :: Text -> QName\ndfName s = QName s defaultNameSpace Nothing\n\nemptyName :: Text -> QName\nemptyName s = QName s Nothing Nothing\n\n-- Convert Maybe interface to Either\n\nfindAttrE :: PandocMonad m => QName -> Element -> m Text\nfindAttrE q e = mkE \"findAttr\" $ findAttr q e\n\nfindEntryByPathE :: PandocMonad m => FilePath -> Archive -> m Entry\nfindEntryByPathE (normalise . unEscapeString -> path) a =\n  mkE (\"No entry on path: \" <> T.pack path) $ findEntryByPath path a\n\nparseXMLDocE :: PandocMonad m => Entry -> m Element\nparseXMLDocE entry =\n  either (throwError . PandocXMLError fp) return $ parseXMLElement doc\n where\n  doc = UTF8.toTextLazy . fromEntry $ entry\n  fp  = T.pack $ eRelativePath entry\n\nfindElementE :: PandocMonad m => QName -> Element -> m Element\nfindElementE e x =\n  mkE (\"Unable to find element: \" <> tshow e) $ findElement e x\n\nmkE :: PandocMonad m => Text -> Maybe a -> m a\nmkE s = maybe (throwError . PandocParseError $ s) return\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/EndNote.hs",
    "content": "{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.EndNote\n   Copyright   : Copyright (C) 2022-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nParses EndNote XML bibliographies into a Pandoc document\nwith empty body and `references` and `nocite` fields\nin the metadata.  A wildcard `nocite` is used so that\nif the document is rendered in another format, the\nentire bibliography will be printed.\n-}\nmodule Text.Pandoc.Readers.EndNote\n  ( readEndNoteXML\n  , readEndNoteXMLCitation\n  )\nwhere\n\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Citeproc (Reference(..), ItemId(..), Val(..), Date(..), DateParts(..))\nimport qualified Citeproc\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)\nimport Text.Pandoc.Sources (Sources(..), ToSources(..), sourcesToText)\nimport Text.Pandoc.Citeproc.Name (toName, NameOpts(..))\nimport Control.Applicative ((<|>))\nimport Control.Monad.Except (throwError)\nimport Control.Monad (mzero, unless)\nimport Text.Pandoc.XML.Light\n    ( filterElementName,\n      strContent,\n      QName(qName),\n      Element(..),\n      Content(..),\n      CData(..),\n      filterElementsName,\n      filterChildName,\n      filterChildrenName,\n      findAttrBy,\n      parseXMLElement )\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport qualified Data.Map as M\nimport Safe (readMay)\n\n-- | Read EndNote XML from an input string and return a Pandoc document.\n-- The document will have only metadata, with an empty body.\n-- The metadata will contain a `references` field with the\n-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.\nreadEndNoteXML :: (PandocMonad m, ToSources a)\n               => ReaderOptions -> a -> m Pandoc\nreadEndNoteXML _opts inp = do\n  let sources = toSources inp\n  refs <- readEndNoteXMLReferences sources >>= mapM (traverse (return . text))\n  return $\n    setMeta \"nocite\" (cite [Citation {citationId = \"*\"\n                                     , citationPrefix = []\n                                     , citationSuffix = []\n                                     , citationMode = NormalCitation\n                                     , citationNoteNum = 0\n                                     , citationHash = 0}] (str \"[@*]\")) $\n    setMeta \"references\" (map referenceToMetaValue refs) $\n    B.doc mempty\n\nreadEndNoteXMLCitation :: PandocMonad m\n                    => Text -> m (Citeproc.Citation Text)\nreadEndNoteXMLCitation xml = do\n  tree <- either (throwError . PandocXMLError \"EndNote references\") return $\n              parseXMLElement (TL.fromStrict xml)\n  unless (qName (elName tree) == \"EndNote\") $\n    throwError $ PandocXMLError \"EndNote references\" \"Expected EndNote element\"\n  let items = map toCitationItem $ filterElementsName (name \"Cite\") tree\n  return $ Citeproc.Citation{\n                     Citeproc.citationId = Nothing\n                   , Citeproc.citationResetPosition = False\n                   , Citeproc.citationPrefix = Nothing\n                   , Citeproc.citationSuffix = Nothing\n                   , Citeproc.citationNoteNumber = Nothing\n                   , Citeproc.citationItems = items\n                   }\n\nreadEndNoteXMLReferences :: PandocMonad m\n                         => Sources -> m [Reference Text]\nreadEndNoteXMLReferences sources = do\n  tree <- either (throwError . PandocXMLError \"EndNote references\") return $\n              parseXMLElement (TL.fromStrict . sourcesToText $ sources)\n  let records = filterElementsName (name \"record\") tree\n  return $ map recordToReference records\n\n\ntoCitationItem :: Element -> Citeproc.CitationItem Text\ntoCitationItem el =\n    Citeproc.CitationItem{ Citeproc.citationItemId =\n                              maybe mempty referenceId mbref\n                         , Citeproc.citationItemLabel = Nothing\n                         , Citeproc.citationItemLocator = mbpages\n                         , Citeproc.citationItemType = Citeproc.NormalCite\n                         , Citeproc.citationItemPrefix = mbprefix\n                         , Citeproc.citationItemSuffix = mbsuffix\n                         , Citeproc.citationItemData = mbref\n                         }\n where\n  mbref = recordToReference <$> filterChildName (name \"record\") el\n  mbprefix = getText <$> filterChildName (name \"Prefix\") el\n  mbsuffix = getText <$> filterChildName (name \"Suffix\") el\n  mbpages  = getText <$> filterChildName (name \"Pages\") el\n\nname :: Text -> (QName -> Bool)\nname t = (== t) . qName\n\ngetText :: Element -> Text\ngetText el = getText' (Elem el)\n where\n  getText' (Elem el') = mconcat $ map getText' $ elContent el'\n  getText' (Text cd) = cdData cd\n  getText' (CRef _) = mempty\n\nrecordToReference :: Element -> Reference Text\nrecordToReference e =\n  Reference{ referenceId = ItemId refid,\n             referenceType = reftype,\n             referenceDisambiguation = Nothing,\n             referenceVariables = refvars }\n\n where\n   -- get strContent, recursing inside style elements:\n   refid = maybe mempty (T.strip . strContent)\n           (filterElementName (name \"key\") e\n            <|> filterElementName (name \"rec-number\") e)\n   reftype = maybe \"document\" toCslReferenceType\n              (filterElementName (name \"ref-type\") e >>=\n                findAttrBy (name \"name\"))\n   authors =\n     filterChildrenName (name \"contributors\") e >>=\n     filterChildrenName (name \"authors\") >>=\n     filterChildrenName (name \"author\") >>=\n          toName NameOpts{ nameOptsPrefixIsNonDroppingParticle = False\n                         , nameOptsUseJuniorComma = False }\n             . B.toList .  B.text . T.strip . getText\n   titles = do\n     x <- filterChildrenName (name \"titles\") e\n     (key, name') <- [(\"title\", \"title\"),\n                      (\"container-title\", \"secondary-title\")]\n     (key,) . FancyVal . T.strip . getText <$>\n                    filterChildrenName (name name') x\n   pages = (\"pages\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"pages\") e\n   volume = (\"volume\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"volume\") e\n   number = (\"number\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"number\") e\n   isbn = (\"isbn\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"isbn\") e\n   publisher = (\"publisher\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"publisher\") e\n   originalPublisher =\n     (\"original-publisher\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"orig-pub\") e\n   publisherPlace =\n     (\"publisher-place\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"pub-location\") e\n   abstract = (\"abstract\",) . FancyVal . T.strip . getText <$>\n                filterChildrenName (name \"abstract\") e\n   dates = (\"issued\",) . toDate <$> filterChildrenName (name \"dates\") e\n   toDate e' = DateVal $\n    Date { dateParts = toDateParts e'\n         , dateCirca = False\n         , dateSeason = Nothing\n         , dateLiteral = Nothing }\n   toDateParts e' = do\n    x <- filterChildrenName (name \"year\") e'\n    case readMay . T.unpack . T.strip . getText $ x of\n      Nothing -> mzero\n      Just y  -> return $ DateParts [y]\n\n   refvars = M.fromList $\n     [ (\"author\", NamesVal authors) | not (null authors) ] ++\n     titles ++\n     pages ++\n     volume ++\n     number ++\n     isbn ++\n     dates ++\n     publisher ++\n     originalPublisher ++\n     publisherPlace ++\n     abstract\n\ntoCslReferenceType :: Text -> Text\ntoCslReferenceType t =\n  case t of\n    \"Aggregated Database\" -> \"dataset\"\n    \"Ancient Text\" -> \"classic\"\n    \"Artwork\" -> \"graphic\"\n    \"Audiovisual Material\" -> \"graphic\"\n    \"Bill\" -> \"legislation\"\n    \"Blog\" -> \"post-weblog\"\n    \"Book\" -> \"book\"\n    \"Book Section\" -> \"chapter\"\n    \"Case\" -> \"legal_case\"\n    \"Catalog\" -> \"document\"\n    \"Chart or Table\" -> \"graphic\"\n    \"Classical Work\" -> \"classic\"\n    \"Computer program\" -> \"software\"\n    \"Conference Paper\" -> \"article\"\n    \"Conference Proceedings\" -> \"periodical\"\n    \"Dataset\" -> \"dataset\"\n    \"Dictionary\" -> \"book\"\n    \"Edited Book\" -> \"book\"\n    \"Electronic Article\" -> \"article\"\n    \"Electronic Book\" -> \"book\"\n    \"Electronic Book Section\" -> \"chapter\"\n    \"Encyclopedia\" -> \"book\"\n    \"Equation\" -> \"document\"\n    \"Figure\" -> \"graphic\"\n    \"Film or Broadcast\" -> \"motion_picture\"\n    \"Government Document\" -> \"document\"\n    \"Grant\" -> \"document\"\n    \"Hearing\" -> \"hearing\"\n    \"Interview\" -> \"interview\"\n    \"Journal Article\" -> \"article-journal\"\n    \"Legal Rule or Regulation\" -> \"regulation\"\n    \"Magazine Article\" -> \"article-magazine\"\n    \"Manuscript\" -> \"manuscript\"\n    \"Map\" -> \"map\"\n    \"Music\" -> \"musical_score\"\n    \"Newspaper Article\" -> \"article-newspaper\"\n    \"Online Database\" -> \"dataset\"\n    \"Online Multimedia\" -> \"webpage\"\n    \"Pamphlet\" -> \"pamphlet\"\n    \"Patent\" -> \"patent\"\n    \"Personal Communication\" -> \"personal_communication\"\n    \"Podcast\" -> \"document\"\n    \"Press Release\" -> \"report\"\n    \"Report\" -> \"report\"\n    \"Serial\" -> \"periodical\"\n    \"Standard\" -> \"standard\"\n    \"Statute\" -> \"legislation\"\n    \"Thesis\" -> \"thesis\"\n    \"Unpublished Work\" -> \"unpublished\"\n    \"Web Page\" -> \"webpage\"\n    _ -> \"document\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/FB2.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.FB2\n   Copyright   : Copyright (C) 2018-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Krotov <ilabdsf@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of FB2 to 'Pandoc' document.\n-}\n\n{-\n\nTODO:\n - Tables\n - Named styles\n - Parse ID attribute for all elements that have it\n\n-}\n\nmodule Text.Pandoc.Readers.FB2 ( readFB2 ) where\nimport Control.Monad.Except (throwError)\nimport Control.Monad.State.Strict\nimport Data.ByteString.Base64.Lazy\nimport Data.Functor\nimport Data.List (intersperse)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Data.Default\nimport Data.Maybe\nimport Text.Pandoc.XML (lookupEntity)\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, insertMedia, report)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.XML.Light\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\n\ntype FB2 m = StateT FB2State m\n\ndata FB2State = FB2State{ fb2SectionLevel :: Int\n                        , fb2Meta :: Meta\n                        , fb2Authors :: [Text]\n                        , fb2Notes :: M.Map Text Blocks\n                        } deriving Show\n\ninstance Default FB2State where\n  def = FB2State{ fb2SectionLevel = 1\n                , fb2Meta = mempty\n                , fb2Authors = []\n                , fb2Notes = M.empty\n                }\n\ninstance HasMeta FB2State where\n  setMeta field v s = s {fb2Meta = setMeta field v (fb2Meta s)}\n  deleteMeta field s = s {fb2Meta = deleteMeta field (fb2Meta s)}\n\nreadFB2 :: (PandocMonad m, ToSources a)\n        => ReaderOptions\n        -> a\n        -> m Pandoc\nreadFB2 _ inp =\n  case parseXMLElement $ TL.fromStrict $ sourcesToText $ toSources inp of\n    Left msg -> throwError $ PandocXMLError \"\" msg\n    Right el ->  do\n      (bs, st) <- runStateT (parseRootElement el) def\n      let authors = if null $ fb2Authors st\n                    then id\n                    else setMeta \"author\" (map text $ reverse $ fb2Authors st)\n      pure $ Pandoc (authors $ fb2Meta st) $ toList bs\n\n-- * Utility functions\n\ntrim :: Text -> Text\ntrim = T.strip\n\nremoveHash :: Text -> Text\nremoveHash t = case T.uncons t of\n  Just ('#', xs) -> xs\n  _              -> t\n\nconvertEntity :: Text -> Text\nconvertEntity e = fromMaybe (T.toUpper e) $ lookupEntity e\n\nparseInline :: PandocMonad m => Content -> FB2 m Inlines\nparseInline (Elem e) =\n  case qName $ elName e of\n    \"strong\" -> strong <$> parseStyleType e\n    \"emphasis\" -> emph <$> parseStyleType e\n    \"style\" -> parseNamedStyle e\n    \"a\" -> parseLinkType e\n    \"strikethrough\" -> strikeout <$> parseStyleType e\n    \"sub\" -> subscript <$> parseStyleType e\n    \"sup\" -> superscript <$> parseStyleType e\n    \"code\" -> pure $ code $ strContent e\n    \"image\" -> parseInlineImageElement e\n    name -> do\n      report $ IgnoredElement name\n      pure mempty\nparseInline (Text x) = pure $ text $ cdData x\nparseInline (CRef r) = pure $ str $ convertEntity r\n\nparseSubtitle :: PandocMonad m => Element -> FB2 m Blocks\nparseSubtitle e = headerWith (\"\", [\"unnumbered\"], []) <$> gets fb2SectionLevel <*> parsePType e\n\n-- * Root element parser\n\nparseRootElement :: PandocMonad m => Element -> FB2 m Blocks\nparseRootElement e =\n  case qName $ elName e of\n    \"FictionBook\" -> do\n      -- Parse notes before parsing the rest of the content.\n      case filterChild isNotesBody e of\n        Nothing -> pure ()\n        Just notesBody -> parseNotesBody notesBody\n      -- Parse metadata and content\n      mconcat <$> mapM parseFictionBookChild (elChildren e)\n    name -> report (UnexpectedXmlElement name \"root\") $> mempty\n\n-- | Parse notes\nparseNotesBody :: PandocMonad m => Element -> FB2 m ()\nparseNotesBody e = mempty <$ mapM parseNotesBodyChild (elChildren e)\n\n-- | Parse a child of @\\<body name=\"notes\">@ element.\nparseNotesBodyChild :: PandocMonad m => Element -> FB2 m ()\nparseNotesBodyChild e =\n  case qName $ elName e of\n    \"section\" -> parseNote e\n    _ -> pure ()\n\nisNotesBody :: Element -> Bool\nisNotesBody e =\n  qName (elName e) == \"body\" &&\n  findAttr (unqual \"name\") e == Just \"notes\"\n\nparseNote :: PandocMonad m => Element -> FB2 m ()\nparseNote e =\n  case findAttr (unqual \"id\") e of\n    Nothing -> pure ()\n    Just sectionId -> do\n      content <- mconcat <$> mapM parseSectionChild (dropTitle $ elChildren e)\n      oldNotes <- gets fb2Notes\n      modify $ \\s -> s { fb2Notes = M.insert (\"#\" <> sectionId) content oldNotes }\n      pure ()\n  where\n    isTitle x = qName (elName x) == \"title\"\n    dropTitle (x:xs) = if isTitle x\n                         then xs -- Drop note section <title> if present\n                         else x:xs\n    dropTitle [] = []\n\n-- | Parse a child of @\\<FictionBook>@ element.\nparseFictionBookChild :: PandocMonad m => Element -> FB2 m Blocks\nparseFictionBookChild e =\n  case qName $ elName e of\n    \"stylesheet\" -> pure mempty -- stylesheet is ignored\n    \"description\" -> mempty <$ mapM_ parseDescriptionChild (elChildren e)\n    \"body\" -> if isNotesBody e\n                then pure mempty\n                else mconcat <$> mapM parseBodyChild (elChildren e)\n    \"binary\" -> mempty <$ parseBinaryElement e\n    name -> report (UnexpectedXmlElement name \"FictionBook\") $> mempty\n\n-- | Parse a child of @\\<description>@ element.\nparseDescriptionChild :: PandocMonad m => Element -> FB2 m ()\nparseDescriptionChild e =\n  case qName $ elName e of\n    \"title-info\" -> mapM_ parseTitleInfoChild (elChildren e)\n    \"src-title-info\" -> pure () -- ignore\n    \"document-info\" -> pure ()\n    \"publish-info\" -> pure ()\n    \"custom-info\" -> pure ()\n    \"output\" -> pure ()\n    name -> do\n      report $ IgnoredElement $ name <> \" in description\"\n      pure mempty\n\n-- | Parse a child of @\\<body>@ element.\nparseBodyChild :: PandocMonad m => Element -> FB2 m Blocks\nparseBodyChild e =\n  case qName $ elName e of\n    \"image\" -> parseImageElement e\n    \"title\" -> header <$> gets fb2SectionLevel <*> parseTitleType (elContent e)\n    \"epigraph\" -> parseEpigraph e\n    \"section\" -> parseSection e\n    name -> report (UnexpectedXmlElement name \"body\") $> mempty\n\n-- | Parse a @\\<binary>@ element.\nparseBinaryElement :: PandocMonad m => Element -> FB2 m ()\nparseBinaryElement e =\n  case (findAttr (unqual \"id\") e, findAttr (unqual \"content-type\") e) of\n    (Nothing, _) -> report $ IgnoredElement \"binary without id attribute\"\n    (Just _, Nothing) ->\n      report $ IgnoredElement \"binary without content-type attribute\"\n    (Just filename, contentType) ->\n      insertMedia (T.unpack filename) contentType\n                    (decodeLenient\n                      (UTF8.fromTextLazy . TL.fromStrict . strContent $ e))\n\n-- * Type parsers\n\n-- | Parse @authorType@\nparseAuthor :: PandocMonad m => Element -> FB2 m Text\nparseAuthor e = T.unwords . catMaybes <$> mapM parseAuthorChild (elChildren e)\n\nparseAuthorChild :: PandocMonad m => Element -> FB2 m (Maybe Text)\nparseAuthorChild e =\n  case qName $ elName e of\n    \"first-name\" -> pure $ Just $ strContent e\n    \"middle-name\" -> pure $ Just $ strContent e\n    \"last-name\" -> pure $ Just $ strContent e\n    \"nickname\" -> pure $ Just $ strContent e\n    \"home-page\" -> pure $ Just $ strContent e\n    \"email\" -> pure $ Just $ strContent e\n    name -> do\n      report $ IgnoredElement $ name <> \" in author\"\n      pure Nothing\n\n-- | Parse @titleType@\nparseTitle :: PandocMonad m => Element -> FB2 m Blocks\nparseTitle e = header <$> gets fb2SectionLevel <*> parseTitleType (elContent e)\n\nparseTitleType :: PandocMonad m => [Content] -> FB2 m Inlines\nparseTitleType c = mconcat . intersperse linebreak . catMaybes <$> mapM parseTitleContent c\n\nparseTitleContent :: PandocMonad m => Content -> FB2 m (Maybe Inlines)\nparseTitleContent (Elem e) =\n  case qName $ elName e of\n    \"p\" -> Just <$> parsePType e\n    \"empty-line\" -> pure $ Just mempty\n    _ -> pure mempty\nparseTitleContent _ = pure Nothing\n\n-- | Parse @imageType@\nparseImageElement :: PandocMonad m => Element -> FB2 m Blocks\nparseImageElement e =\n  case href of\n    Just src -> pure $ para $ imageWith (imgId, [], []) (removeHash src) title alt\n    Nothing -> do\n      report $ IgnoredElement \" image without href\"\n      pure mempty\n  where alt = maybe mempty str $ findAttr (unqual \"alt\") e\n        title = fromMaybe \"\" $ findAttr (unqual \"title\") e\n        imgId = fromMaybe \"\" $ findAttr (unqual \"id\") e\n        href = findAttr (QName \"href\" (Just \"http://www.w3.org/1999/xlink\") Nothing) e\n\n-- | Parse @pType@\nparsePType :: PandocMonad m => Element -> FB2 m Inlines\nparsePType = parseStyleType -- TODO add support for optional \"id\" and \"style\" attributes\n\n-- | Parse @citeType@\nparseCite :: PandocMonad m => Element -> FB2 m Blocks\nparseCite e = blockQuote . mconcat <$> mapM parseCiteChild (elChildren e)\n\n-- | Parse @citeType@ child\nparseCiteChild :: PandocMonad m => Element -> FB2 m Blocks\nparseCiteChild e =\n  case qName $ elName e of\n    \"p\" -> para <$> parsePType e\n    \"poem\" -> parsePoem e\n    \"empty-line\" -> pure horizontalRule\n    \"subtitle\" -> parseSubtitle e\n    \"table\" -> parseTable e\n    \"text-author\" -> para <$> parsePType e\n    name -> report (UnexpectedXmlElement name \"cite\") $> mempty\n\n-- | Parse @poemType@\nparsePoem :: PandocMonad m => Element -> FB2 m Blocks\nparsePoem e = mconcat <$> mapM parsePoemChild (elChildren e)\n\nparsePoemChild :: PandocMonad m => Element -> FB2 m Blocks\nparsePoemChild e =\n  case qName $ elName e of\n    \"title\" -> parseTitle e\n    \"subtitle\" -> parseSubtitle e\n    \"epigraph\" -> parseEpigraph e\n    \"stanza\" -> parseStanza e\n    \"text-author\" -> para <$> parsePType e\n    \"date\" -> pure $ para $ text $ strContent e\n    name -> report (UnexpectedXmlElement name \"poem\") $> mempty\n\nparseStanza :: PandocMonad m => Element -> FB2 m Blocks\nparseStanza e = fromList . joinLineBlocks . toList . mconcat <$> mapM parseStanzaChild (elChildren e)\n\njoinLineBlocks :: [Block] -> [Block]\njoinLineBlocks (LineBlock xs:LineBlock ys:zs) = joinLineBlocks (LineBlock (xs ++ ys) : zs)\njoinLineBlocks (x:xs) = x:joinLineBlocks xs\njoinLineBlocks [] = []\n\nparseStanzaChild :: PandocMonad m => Element -> FB2 m Blocks\nparseStanzaChild e =\n  case qName $ elName e of\n    \"title\" -> parseTitle e\n    \"subtitle\" -> parseSubtitle e\n    \"v\" -> lineBlock . (:[]) <$> parsePType e\n    name -> report (UnexpectedXmlElement name \"stanza\") $> mempty\n\n-- | Parse @epigraphType@\nparseEpigraph :: PandocMonad m => Element -> FB2 m Blocks\nparseEpigraph e =\n  divWith (divId, [\"epigraph\"], []) . mconcat <$> mapM parseEpigraphChild (elChildren e)\n  where divId = fromMaybe \"\" $ findAttr (unqual \"id\") e\n\nparseEpigraphChild :: PandocMonad m => Element -> FB2 m Blocks\nparseEpigraphChild e =\n  case qName $ elName e of\n    \"p\" -> para <$> parsePType e\n    \"poem\" -> parsePoem e\n    \"cite\" -> parseCite e\n    \"empty-line\" -> pure horizontalRule\n    \"text-author\" -> para <$> parsePType e\n    name -> report (UnexpectedXmlElement name \"epigraph\") $> mempty\n\n-- | Parse @annotationType@\nparseAnnotation :: PandocMonad m => Element -> FB2 m Blocks\nparseAnnotation e = mconcat <$> mapM parseAnnotationChild (elChildren e)\n\nparseAnnotationChild :: PandocMonad m => Element -> FB2 m Blocks\nparseAnnotationChild e =\n  case qName $ elName e of\n    \"p\" -> para <$> parsePType e\n    \"poem\" -> parsePoem e\n    \"cite\" -> parseCite e\n    \"subtitle\" -> parseSubtitle e\n    \"table\" -> parseTable e\n    \"empty-line\" -> pure horizontalRule\n    name -> report (UnexpectedXmlElement name \"annotation\") $> mempty\n\n-- | Parse @sectionType@\nparseSection :: PandocMonad m => Element -> FB2 m Blocks\nparseSection e = do\n  n <- gets fb2SectionLevel\n  modify $ \\st -> st{ fb2SectionLevel = n + 1 }\n  let sectionId = fromMaybe \"\" $ findAttr (unqual \"id\") e\n  bs <- divWith (sectionId, [\"section\"], []) . mconcat <$> mapM parseSectionChild (elChildren e)\n  modify $ \\st -> st{ fb2SectionLevel = n }\n  pure bs\n\nparseSectionChild :: PandocMonad m => Element -> FB2 m Blocks\nparseSectionChild e =\n  case qName $ elName e of\n    \"title\" -> parseBodyChild e\n    \"epigraph\" -> parseEpigraph e\n    \"image\" -> parseImageElement e\n    \"annotation\" -> parseAnnotation e\n    \"poem\" -> parsePoem e\n    \"cite\" -> parseCite e\n    \"empty-line\" -> pure horizontalRule\n    \"table\" -> parseTable e\n    \"subtitle\" -> parseSubtitle e\n    \"p\" -> para <$> parsePType e\n    \"section\" -> parseSection e\n    name -> report (UnexpectedXmlElement name \"section\") $> mempty\n\n-- | parse @styleType@\nparseStyleType :: PandocMonad m => Element -> FB2 m Inlines\nparseStyleType e = mconcat <$> mapM parseInline (elContent e)\n\n-- | Parse @namedStyleType@\nparseNamedStyle :: PandocMonad m => Element -> FB2 m Inlines\nparseNamedStyle e = do\n  content <- mconcat <$> mapM parseNamedStyleChild (elContent e)\n  let lang = maybeToList $ (\"lang\",) <$> findAttr (QName \"lang\" Nothing (Just \"xml\")) e\n  case findAttr (unqual \"name\") e of\n    Just name -> pure $ spanWith (\"\", [name], lang) content\n    Nothing -> do\n      report $ IgnoredElement \"link without required name\"\n      pure mempty\n\nparseNamedStyleChild :: PandocMonad m => Content -> FB2 m Inlines\nparseNamedStyleChild (Elem e) =\n  case qName (elName e) of\n    \"strong\" -> strong <$> parseStyleType e\n    \"emphasis\" -> emph <$> parseStyleType e\n    \"style\" -> parseNamedStyle e\n    \"a\" -> parseLinkType e\n    \"strikethrough\" -> strikeout <$> parseStyleType e\n    \"sub\" -> subscript <$> parseStyleType e\n    \"sup\" -> superscript <$> parseStyleType e\n    \"code\" -> pure $ code $ strContent e\n    \"image\" -> parseInlineImageElement e\n    name -> do\n      report $ IgnoredElement $ name <> \" in style\"\n      pure mempty\nparseNamedStyleChild x = parseInline x\n\n-- | Parse @linkType@\nparseLinkType :: PandocMonad m => Element -> FB2 m Inlines\nparseLinkType e = do\n  content <- mconcat <$> mapM parseStyleLinkType (elContent e)\n  notes <- gets fb2Notes\n  case findAttr (QName \"href\" (Just \"http://www.w3.org/1999/xlink\") Nothing) e of\n    Just href -> case findAttr (QName \"type\" Nothing Nothing) e of\n                   Just \"note\" -> case M.lookup href notes of\n                                    Nothing -> pure $ link href \"\" content\n                                    Just contents -> pure $ note contents\n                   _ -> pure $ link href \"\" content\n    Nothing -> do\n      report $ IgnoredElement \"link without required href\"\n      pure mempty\n\n-- | Parse @styleLinkType@\nparseStyleLinkType :: PandocMonad m => Content -> FB2 m Inlines\nparseStyleLinkType x@(Elem e) =\n  case qName (elName e) of\n    \"a\" -> do\n      report $ IgnoredElement \"nested link\"\n      pure mempty\n    _ -> parseInline x\nparseStyleLinkType x = parseInline x\n\n-- | Parse @tableType@\nparseTable :: PandocMonad m => Element -> FB2 m Blocks\nparseTable _ = pure mempty -- TODO: tables are not supported yet\n\n-- | Parse @title-infoType@\nparseTitleInfoChild :: PandocMonad m => Element -> FB2 m ()\nparseTitleInfoChild e =\n  case qName (elName e) of\n    \"genre\" -> pure ()\n    \"author\" -> parseAuthor e >>= \\author -> modify (\\st -> st {fb2Authors = author:fb2Authors st})\n    \"book-title\" -> modify (setMeta \"title\" (text $ strContent e))\n    \"annotation\" -> parseAnnotation e >>= modify . setMeta \"abstract\"\n    \"keywords\" -> modify (setMeta \"keywords\" (map (MetaString . trim) $ T.splitOn \",\"\n                                                                      $ strContent e))\n    \"date\" -> modify (setMeta \"date\" (text $ strContent e))\n    \"coverpage\" -> parseCoverPage e\n    \"lang\" -> pure ()\n    \"src-lang\" -> pure ()\n    \"translator\" -> pure ()\n    \"sequence\" -> pure ()\n    name -> report $ IgnoredElement $ name <> \" in title-info\"\n\nparseCoverPage :: PandocMonad m => Element -> FB2 m ()\nparseCoverPage e =\n  case findChild (QName \"image\" (Just \"http://www.gribuser.ru/xml/fictionbook/2.0\") Nothing) e of\n    Just img -> case href of\n                  Just src -> modify (setMeta \"cover-image\" (MetaString $ removeHash src))\n                  Nothing -> pure ()\n                where href = findAttr (QName \"href\" (Just \"http://www.w3.org/1999/xlink\") Nothing) img\n    Nothing -> pure ()\n\n-- | Parse @inlineImageType@ element\nparseInlineImageElement :: PandocMonad m\n                        => Element\n                        -> FB2 m Inlines\nparseInlineImageElement e =\n  case href of\n    Just src -> pure $ imageWith (\"\", [], []) (removeHash src) \"\" alt\n    Nothing -> do\n      report $ IgnoredElement \"inline image without href\"\n      pure mempty\n  where alt = maybe mempty str $ findAttr (unqual \"alt\") e\n        href = findAttr (QName \"href\" (Just \"http://www.w3.org/1999/xlink\") Nothing) e\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/HTML/Parsing.hs",
    "content": "{-# LANGUAGE LambdaCase            #-}\n{-# LANGUAGE OverloadedStrings     #-}\n{- |\n   Module      : Text.Pandoc.Readers.HTML.Parsing\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nParsing functions and utilities.\n-}\nmodule Text.Pandoc.Readers.HTML.Parsing\n  ( TagOmission (..)\n  , pInTags\n  , pInTags'\n  , pInTag\n  , pInTagWithAttribs\n  , pAny\n  , pCloses\n  , pSatisfy\n  , pBlank\n  , matchTagClose\n  , matchTagOpen\n  , isSpace\n  , maybeFromAttrib\n  , toAttr\n  , toStringAttr\n  )\nwhere\n\nimport Control.Monad (void, mzero, mplus)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport Text.HTML.TagSoup\n  ( Attribute, Tag (..), isTagPosition, isTagOpen, isTagClose, (~==) )\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition (Attr)\nimport Text.Pandoc.Parsing\n  ( (<|>), eof, getPosition, lookAhead, manyTill, newPos, option, optional\n  , skipMany, setPosition, token, try)\nimport Text.Pandoc.Readers.HTML.TagCategories\nimport Text.Pandoc.Readers.HTML.Types\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.XML (html5Attributes, html4Attributes, rdfaAttributes)\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\n\n-- | Whether no tag, the closing tag, or both tags can be omitted.\ndata TagOmission\n  = TagsRequired       -- ^ Opening and closing tags are both required\n  | ClosingTagOptional -- ^ The closing tag can be omitted\n  | TagsOmittable      -- ^ Both tags, opening and closing, can be omitted.\n  deriving (Eq)\n\npInTags :: (PandocMonad m, Monoid a) => Text -> TagParser m a -> TagParser m a\npInTags tagtype parser = pInTags' tagtype (const True) parser\n\npInTags' :: (PandocMonad m, Monoid a)\n         => Text\n         -> (Tag Text -> Bool)\n         -> TagParser m a\n         -> TagParser m a\npInTags' tagtype tagtest parser = try $ do\n  pSatisfy $ \\t -> matchTagOpen tagtype [] t && tagtest t\n  mconcat <$> manyTill parser (pCloses tagtype <|> eof)\n\npInTag :: PandocMonad m\n       => TagOmission    -- ^ Whether some tags can be omitted\n       -> Text           -- ^ @tagtype@ Tag name\n       -> TagParser m a  -- ^ @p@ Content parser\n       -> TagParser m a\npInTag tagOmission tagtype = fmap snd . pInTagWithAttribs tagOmission tagtype\n\n-- | Returns the contents of a tag together with its attributes; parses\n-- @p@, preceded by an opening tag (optional if TagsOmittable) and\n-- followed by a closing tag (optional unless TagsRequired).\npInTagWithAttribs :: PandocMonad m\n                  => TagOmission    -- ^ Whether some tags can be omitted\n                  -> Text           -- ^ @tagtype@ Tag name\n                  -> TagParser m a  -- ^ @p@ Content parser\n                  -> TagParser m ([Attribute Text], a)\npInTagWithAttribs tagOmission tagtype p = try $ do\n  let openingOptional = tagOmission == TagsOmittable\n  let closingOptional = tagOmission /= TagsRequired\n  skipMany pBlank\n  attribs <- (if openingOptional then option [] else id)\n             (getAttribs <$> pSatisfy (matchTagOpen tagtype []))\n  skipMany pBlank\n  x <- p\n  skipMany pBlank\n  (if closingOptional then optional else void) $\n    pSatisfy (matchTagClose tagtype)\n  skipMany pBlank\n  return (attribs, x)\n  where\n    getAttribs = \\case\n      TagOpen _ attribs -> attribs\n      _                 -> []\n\npCloses :: PandocMonad m => Text -> TagParser m ()\npCloses tagtype = try $ do\n  t <- lookAhead $ pSatisfy $ \\tag -> isTagClose tag || isTagOpen tag\n  case t of\n       (TagClose t') | t' == tagtype -> void pAny\n       (TagClose \"th\") | tagtype == \"td\" -> void pAny -- see #9090\n       (TagClose \"td\") | tagtype == \"th\" -> void pAny\n       (TagOpen t' _) | t' `closes` tagtype -> return ()\n       (TagClose \"ul\") | tagtype == \"li\" -> return ()\n       (TagClose \"ol\") | tagtype == \"li\" -> return ()\n       (TagClose \"dl\") | tagtype == \"dd\" -> return ()\n       (TagClose \"table\") | tagtype == \"td\" -> return ()\n       (TagClose \"table\") | tagtype == \"th\" -> return ()\n       (TagClose \"table\") | tagtype == \"tr\" -> return ()\n       (TagClose \"td\") | tagtype `Set.member` blockHtmlTags -> return ()\n       (TagClose \"th\") | tagtype `Set.member` blockHtmlTags -> return ()\n       (TagClose t') | tagtype == \"p\" && t' `Set.member` blockHtmlTags\n                                            -> return () -- see #3794\n       _ -> mzero\n\npBlank :: PandocMonad m => TagParser m ()\npBlank = void $ pSatisfy isBlank\n where\n  isBlank (TagText t) = T.all isSpace t\n  isBlank (TagComment _) = True\n  isBlank _ = False\n\npLocation :: PandocMonad m => TagParser m ()\npLocation = do\n  (TagPosition r c) <- pSat isTagPosition\n  setPosition $ newPos \"input\" r c\n\npSat :: PandocMonad m => (Tag Text -> Bool) -> TagParser m (Tag Text)\npSat f = do\n  pos <- getPosition\n  token tshow (const pos) (\\x -> if f x then Just x else Nothing)\n\npSatisfy :: PandocMonad m => (Tag Text -> Bool) -> TagParser m (Tag Text)\npSatisfy f = try $ optional pLocation >> pSat f\n\nmatchTagClose :: Text -> (Tag Text -> Bool)\nmatchTagClose t = (~== TagClose t)\n\nmatchTagOpen :: Text -> [(Text, Text)] -> (Tag Text -> Bool)\nmatchTagOpen t as = (~== TagOpen t as)\n\npAny :: PandocMonad m => TagParser m (Tag Text)\npAny = pSatisfy (const True)\n\nisSpace :: Char -> Bool\nisSpace ' '  = True\nisSpace '\\t' = True\nisSpace '\\n' = True\nisSpace '\\r' = True\nisSpace _    = False\n\n-- taken from HXT and extended\n-- See http://www.w3.org/TR/html5/syntax.html sec 8.1.2.4 optional tags\ncloses :: Text -> Text -> Bool\n_ `closes` \"body\" = False\n_ `closes` \"html\" = False\n\"body\" `closes` \"head\" = True\n\"a\" `closes` \"a\" = True\n\"li\" `closes` \"li\" = True\n\"th\" `closes` t | t `elem` [\"th\",\"td\"] = True\n\"td\" `closes` t | t `elem` [\"th\",\"td\"] = True\n\"tr\" `closes` t | t `elem` [\"th\",\"td\",\"tr\",\"colgroup\"] = True\n\"dd\" `closes` t | t `elem` [\"dt\", \"dd\"] = True\n\"dt\" `closes` t | t `elem` [\"dt\",\"dd\"] = True\n\"rt\" `closes` t | t `elem` [\"rb\", \"rt\", \"rtc\"] = True\n\"col\" `closes` \"col\" = True\n\"colgroup\" `closes` \"col\" = True\n\"optgroup\" `closes` \"optgroup\" = True\n\"optgroup\" `closes` \"option\" = True\n\"option\" `closes` \"option\" = True\n-- https://html.spec.whatwg.org/multipage/syntax.html#optional-tags\nx `closes` \"p\" | x `elem` [\"address\", \"article\", \"aside\", \"blockquote\",\n   \"dir\", \"div\", \"dl\", \"fieldset\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\",\n   \"h5\", \"h6\", \"header\", \"hr\", \"main\", \"menu\", \"nav\", \"ol\", \"p\", \"pre\", \"section\",\n   \"table\", \"ul\"] = True\n_ `closes` \"meta\" = True\n\"form\" `closes` \"form\" = True\n\"label\" `closes` \"label\" = True\n\"map\" `closes` \"map\" = True\n\"object\" `closes` \"object\" = True\n_ `closes` t | t `elem` [\"option\",\"style\",\"script\",\"textarea\",\"title\"] = True\nt `closes` \"select\" | t /= \"option\" = True\n\"thead\" `closes` \"colgroup\" = True\n\"tfoot\" `closes` t | t `elem` [\"thead\",\"colgroup\"] = True\n\"tbody\" `closes` t | t `elem` [\"tbody\",\"tfoot\",\"thead\",\"colgroup\"] = True\nt `closes` t2 |\n   t `elem` [\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"dl\",\"ol\",\"ul\",\"table\",\"div\",\"main\",\"p\"] &&\n   t2 `elem` [\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\" ] = True -- not \"div\" or \"main\"\nt1 `closes` t2 |\n   t1 `Set.member` blockTags &&\n   t2 `Set.notMember` blockTags &&\n   t2 `Set.notMember` eitherBlockOrInline = True\n_ `closes` _ = False\n\ntoStringAttr :: [(Text, Text)] -> [(Text, Text)]\ntoStringAttr = foldr go []\n  where\n   go :: (Text, Text) -> [(Text, Text)] -> [(Text, Text)]\n   -- treat xml:lang as lang\n   go (\"xml:lang\",y) ats = go (\"lang\",y) ats\n   -- prevent duplicate attributes\n   go (x,y) ats\n     | any (\\(x',_) -> x == x') ats = ats\n     | otherwise      =\n        case T.stripPrefix \"data-\" x of\n          Just x' | x' `Set.notMember` (html5Attributes <>\n                                        html4Attributes <> rdfaAttributes)\n            -> go (x',y) ats\n          _ -> (x,y):ats\n\n-- Unlike fromAttrib from tagsoup, this distinguishes\n-- between a missing attribute and an attribute with empty content.\nmaybeFromAttrib :: Text -> Tag Text -> Maybe Text\nmaybeFromAttrib name (TagOpen _ attrs) = lookup name attrs\nmaybeFromAttrib _ _ = Nothing\n\nmkAttr :: [(Text, Text)] -> Attr\nmkAttr attr = (attribsId, attribsClasses, attribsKV)\n  where attribsId = fromMaybe \"\" $ lookup \"id\" attr `mplus` lookup \"name\" attr\n        attribsClasses = T.words (fromMaybe \"\" $ lookup \"class\" attr) <> epubTypes\n        attribsKV = filter (\\(k,_) -> k /= \"class\" && k /= \"id\" && k /= \"name\")\n                           attr\n        epubTypes = T.words $ fromMaybe \"\" $ lookup \"epub:type\" attr\n\ntoAttr :: [(Text, Text)] -> Attr\ntoAttr = mkAttr . toStringAttr\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/HTML/Table.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Readers.HTML.Table\n   Copyright   : © 2006-2024 John MacFarlane,\n                   2020-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nHTML table parser.\n-}\nmodule Text.Pandoc.Readers.HTML.Table (pTable) where\n\nimport qualified Data.Vector as V\nimport Control.Applicative ((<|>))\nimport Data.Maybe (fromMaybe, isJust)\nimport Data.Either (lefts, rights)\nimport Data.List.NonEmpty (nonEmpty)\nimport qualified Data.List as L\nimport Data.Text (Text)\nimport Text.HTML.TagSoup\nimport Text.Pandoc.Builder (Blocks)\nimport Text.Pandoc.CSS (cssAttributes)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Parsing\n  ( eof, lookAhead, many, many1, manyTill, option, optional\n  , optionMaybe, skipMany, try )\nimport Text.Pandoc.Readers.HTML.Parsing\nimport Text.Pandoc.Readers.HTML.Types (TagParser)\nimport Text.Pandoc.Shared (onlySimpleTableCells, safeRead)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Control.Monad (guard)\n\n-- | Parses a @<col>@ element, returning the column's width.\n-- An Either value is used:  Left i means a \"relative length\" with\n-- integral value i (see https://www.w3.org/TR/html4/types.html#h-6.6);\n-- Right w means a regular width.  Defaults to @'Right ColWidthDefault'@\n-- if the width is not set or cannot be determined.\npCol :: PandocMonad m => TagParser m (Either Int ColWidth)\npCol = try $ do\n  TagOpen _ attribs' <- pSatisfy (matchTagOpen \"col\" [])\n  let attribs = toStringAttr attribs'\n  skipMany pBlank\n  optional $ pSatisfy (matchTagClose \"col\")\n  skipMany pBlank\n  return $ case lookup \"width\" attribs of\n                Nothing -> case lookup \"style\" attribs of\n                  Just (T.stripPrefix \"width:\" -> Just xs) | T.any (== '%') xs ->\n                    maybe (Right ColWidthDefault) (Right . ColWidth . (/ 100.0))\n                      $ safeRead (T.filter\n                                   (`notElem` (\" \\t\\r\\n%'\\\";\" :: [Char])) xs)\n                  _ -> Right ColWidthDefault\n                Just (T.unsnoc -> Just (xs, '*')) ->\n                  maybe (Left 1) Left $ safeRead xs\n                Just (T.unsnoc -> Just (xs, '%')) ->\n                  maybe (Right ColWidthDefault)\n                        (Right . ColWidth . (/ 100.0)) $ safeRead xs\n                _ -> Right ColWidthDefault\n\npColgroup :: PandocMonad m => TagParser m [Either Int ColWidth]\npColgroup = try $ do\n  pSatisfy (matchTagOpen \"colgroup\" [])\n  skipMany pBlank\n  manyTill pCol (pCloses \"colgroup\" <|> eof) <* skipMany pBlank\n\nresolveRelativeLengths :: [Either Int ColWidth] -> [ColWidth]\nresolveRelativeLengths ws =\n  let remaining = 1 - sum (map getColWidth $ rights ws)\n      relatives = sum $ lefts ws\n      relUnit = remaining / fromIntegral relatives\n      toColWidth (Right x) = x\n      toColWidth (Left i) = ColWidth (fromIntegral i * relUnit)\n  in  map toColWidth ws\n\ngetColWidth :: ColWidth -> Double\ngetColWidth ColWidthDefault = 0\ngetColWidth (ColWidth w) = w\n\ndata CellType\n  = HeaderCell\n  | BodyCell\n  deriving Eq\n\npCell :: PandocMonad m\n      => TagParser m Blocks\n      -> CellType\n      -> TagParser m (CellType, Cell)\npCell block celltype = try $ do\n  let celltype' = case celltype of\n        HeaderCell -> \"th\"\n        BodyCell   -> \"td\"\n  skipMany pBlank\n  TagOpen _ attribs <- lookAhead $ pSatisfy (matchTagOpen celltype' [])\n  let cssAttribs = maybe [] cssAttributes $ lookup \"style\" attribs\n  let align = case lookup \"align\" attribs <|>\n                   lookup \"text-align\" cssAttribs of\n                Just \"left\"   -> AlignLeft\n                Just \"right\"  -> AlignRight\n                Just \"center\" -> AlignCenter\n                _             -> AlignDefault\n  let rowspan = RowSpan . fromMaybe 1 $\n                safeRead =<< lookup \"rowspan\" attribs\n  let colspan = ColSpan . fromMaybe 1 $\n                safeRead =<< lookup \"colspan\" attribs\n  res <- pInTags celltype' block\n  skipMany pBlank\n  let handledAttribs = [\"align\", \"colspan\", \"rowspan\", \"text-align\"]\n      attribs' = foldr go [] attribs\n      go kv@(k, _) acc = case k of\n        \"style\" -> case filter ((/= \"text-align\") . fst) cssAttribs of\n                     [] -> acc\n                     cs -> (\"style\", toStyleString cs) : acc\n        -- drop attrib if it's already handled\n        _ | k `elem` handledAttribs -> acc\n        _ -> kv : acc\n  return (celltype, B.cellWith (toAttr attribs') align rowspan colspan res)\n\n-- | Create a style attribute string from a list of CSS attributes\ntoStyleString :: [(Text, Text)] -> Text\ntoStyleString = T.intercalate \"; \" . map (\\(k, v) -> k <> \": \" <> v)\n\n-- | Parses a normal table row; returns the row and the number\n-- of cells at the beginning that are header cells.\npRow :: PandocMonad m\n     => TagParser m Blocks\n     -> TagParser m (Int, B.Row)\npRow block = try $ do\n  skipMany pBlank\n  TagOpen _ attribs <- pSatisfy (matchTagOpen \"tr\" []) <* skipMany pBlank\n  cells <- many (pCell block BodyCell <|> pCell block HeaderCell)\n  TagClose _ <- pSatisfy (matchTagClose \"tr\")\n  let numheadcells = length $ takeWhile (\\(ct,_) -> ct == HeaderCell) cells\n  return (numheadcells, Row (toAttr attribs) $ map snd cells)\n\n-- | Parses a header row, i.e., a row which containing nothing but\n-- @<th>@ elements.\npHeaderRow :: PandocMonad m\n           => TagParser m Blocks\n           -> TagParser m B.Row\npHeaderRow block = try $ do\n  skipMany pBlank\n  let pThs = many (snd <$> pCell block HeaderCell)\n  let mkRow (attribs, cells) = Row (toAttr attribs) cells\n  mkRow <$> pInTagWithAttribs TagsRequired \"tr\" pThs\n\n-- | Parses a table head. If there is no @thead@ element, this looks for\n-- a row of @<th>@-only elements as the first line of the table.\npTableHead :: PandocMonad m\n           => TagParser m Blocks\n           -> TagParser m TableHead\npTableHead block = try $ do\n  skipMany pBlank\n  let pRows = many (pRow block)\n  let pThead = pInTagWithAttribs ClosingTagOptional \"thead\" pRows\n  optionMaybe pThead >>= \\case\n    Just (attribs, rows) ->\n      return $ TableHead (toAttr attribs) $ map snd rows\n    Nothing -> mkTableHead <$> optionMaybe (pHeaderRow block)\n               where\n                 mkTableHead = TableHead nullAttr . \\case\n                   -- Use row as header only if it's non-empty\n                   Just row@(Row _ (_:_)) -> [row]\n                   _                      -> []\n\n-- | Parses a table foot\npTableFoot :: PandocMonad m\n           => TagParser m Blocks\n           -> TagParser m TableFoot\npTableFoot block = try $ do\n  skipMany pBlank\n  TagOpen _ attribs <- pSatisfy (matchTagOpen \"tfoot\" []) <* skipMany pBlank\n  rows <- many $ snd <$> (pRow block <* skipMany pBlank)\n  optional $ pSatisfy (matchTagClose \"tfoot\")\n  return $ TableFoot (toAttr attribs) rows\n\n-- | Parses a table body\npTableBody :: PandocMonad m\n           => TagParser m Blocks\n           -> TagParser m TableBody\npTableBody block = try $ do\n  skipMany pBlank\n  mbattribs <- option Nothing $ Just . getAttribs <$>\n                 pSatisfy (matchTagOpen \"tbody\" []) <* skipMany pBlank\n  bodyheads <- many (pHeaderRow block)\n  rows <- many (pRow block <* skipMany pBlank)\n  optional $ pSatisfy (matchTagClose \"tbody\")\n  guard $ isJust mbattribs || not (null bodyheads && null rows)\n  let attribs = fromMaybe [] mbattribs\n  -- we only set row head columns if all rows agree;\n  -- if some rows have headings but others not, we use 0; see #8984, #8634:\n  let numrows = length rows\n  let adjustRowHeadColsForCell currentrow headcolsv\n                    (Cell _ _ (RowSpan rowspan) (ColSpan colspan) _) =\n        V.imap (\\i x -> if i >= currentrow &&\n                           i < currentrow + rowspan\n                           then x + colspan\n                           else x) headcolsv\n  let adjustRowHeadCols\n        headcolsv\n        (currentrow, (numheads, Row _ cells)) =\n          L.foldl' (adjustRowHeadColsForCell currentrow) headcolsv\n            (take numheads cells)\n  let headcols = L.foldl' adjustRowHeadCols\n                         (V.replicate numrows (0 :: Int))\n                         (zip [(0 :: Int)..] rows)\n  let rowHeadCols = case V.uncons headcols of\n                       Just (x, v) | all (== x) v -> RowHeadColumns x\n                       _ -> RowHeadColumns 0\n  return $ TableBody (toAttr attribs) rowHeadCols bodyheads (map snd rows)\n  where\n    getAttribs (TagOpen _ attribs) = attribs\n    getAttribs _ = []\n\n-- | Parses a simple HTML table\npTable :: PandocMonad m\n       => TagParser m Blocks -- ^ Caption and cell contents parser\n       -> TagParser m Blocks\npTable block = try $ do\n  TagOpen _ attribs <- pSatisfy (matchTagOpen \"table\" [])  <* skipMany pBlank\n  caption <- option mempty $ pInTags \"caption\" block       <* skipMany pBlank\n  widths <- resolveRelativeLengths <$>\n              ((mconcat <$> many1 pColgroup) <|> many pCol) <* skipMany pBlank\n  thead   <- pTableHead block               <* skipMany pBlank\n  topfoot <- optionMaybe (pTableFoot block) <* skipMany pBlank\n  tbodies <- many (pTableBody block)        <* skipMany pBlank\n  botfoot <- optionMaybe (pTableFoot block) <* skipMany pBlank\n  TagClose _ <- pSatisfy (matchTagClose \"table\")\n  let tfoot = fromMaybe (TableFoot nullAttr []) $ topfoot <|> botfoot\n  case normalize widths thead tbodies tfoot of\n    Left err -> fail err\n    Right (colspecs, thead', tbodies', tfoot') -> return $\n      B.tableWith (toAttr attribs)\n                  (B.simpleCaption caption)\n                  colspecs\n                  thead'\n                  tbodies'\n                  tfoot'\ndata TableType\n  = SimpleTable\n  | NormalTable\n\ntableType :: [[Cell]] -> TableType\ntableType cells =\n  if onlySimpleTableCells $ map (map cellContents) cells\n  then SimpleTable\n  else NormalTable\n  where\n    cellContents :: Cell -> [Block]\n    cellContents (Cell _ _ _ _ bs) = bs\n\nnormalize :: [ColWidth] -> TableHead -> [TableBody] -> TableFoot\n          -> Either String ([ColSpec], TableHead, [TableBody], TableFoot)\nnormalize widths head' bodies foot = do\n  let rows = headRows head' <> concatMap bodyRows bodies <> footRows foot\n  let cellWidth (Cell _ _ _ (ColSpan cs) _) = cs\n  let rowLength = foldr (\\cell acc -> cellWidth cell + acc) 0 . rowCells\n  let ncols = maybe 0 maximum $ nonEmpty $ map rowLength rows\n  let tblType = tableType (map rowCells rows)\n  -- fail on empty table\n  if null rows\n    then Left \"empty table\"\n    else Right\n         ( zip (calculateAlignments ncols bodies)\n               (normalizeColWidths ncols tblType widths)\n         , head'\n         , bodies\n         , foot\n         )\n\nnormalizeColWidths :: Int -> TableType -> [ColWidth] -> [ColWidth]\nnormalizeColWidths ncols tblType = \\case\n  [] -> case tblType of\n          SimpleTable -> replicate ncols ColWidthDefault\n          NormalTable -> replicate ncols (ColWidth $ 1 / fromIntegral ncols)\n  widths -> widths\n\ncalculateAlignments :: Int -> [TableBody] -> [Alignment]\ncalculateAlignments cols tbodies =\n  case cells of\n    cs:_ -> take cols $ concatMap cellAligns cs ++ repeat AlignDefault\n    _    -> replicate cols AlignDefault\n  where\n    cells :: [[Cell]]\n    cells = concatMap bodyRowCells tbodies\n    cellAligns :: Cell -> [Alignment]\n    cellAligns (Cell _ align _ (ColSpan cs) _) = replicate cs align\n\nbodyRowCells :: TableBody -> [[Cell]]\nbodyRowCells = map rowCells . bodyRows\n\nheadRows :: TableHead -> [B.Row]\nheadRows (TableHead _ rows) = rows\n\nbodyRows :: TableBody -> [B.Row]\nbodyRows (TableBody _ _ headerRows bodyRows') = headerRows <> bodyRows'\n\nfootRows :: TableFoot -> [B.Row]\nfootRows (TableFoot _ rows) = rows\n\nrowCells :: B.Row -> [Cell]\nrowCells (Row _ cells) = cells\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/HTML/TagCategories.hs",
    "content": "{-# LANGUAGE OverloadedStrings     #-}\n{- |\n   Module      : Text.Pandoc.Readers.HTML.TagCategories\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nCategories of tags.\n-}\nmodule Text.Pandoc.Readers.HTML.TagCategories\n  ( blockHtmlTags\n  , blockDocBookTags\n  , eitherBlockOrInline\n  , epubTags\n  , blockTags\n  , sectioningContent\n  , groupingContent\n  )\nwhere\n\nimport Data.Set (Set, fromList, unions)\nimport Data.Text (Text)\n\neitherBlockOrInline :: Set Text\neitherBlockOrInline = fromList\n  [\"audio\", \"applet\", \"button\", \"iframe\", \"embed\",\n   \"del\", \"ins\", \"progress\", \"map\", \"area\", \"noscript\", \"script\",\n   \"object\", \"svg\", \"video\", \"source\", \"track\"]\n\nblockHtmlTags :: Set Text\nblockHtmlTags = fromList\n   [\"?xml\", \"!DOCTYPE\", \"address\", \"article\", \"aside\",\n    \"blockquote\", \"body\", \"canvas\",\n    \"caption\", \"center\", \"col\", \"colgroup\", \"dd\", \"details\",\n    \"dir\", \"div\", \"dl\", \"dt\", \"fieldset\", \"figcaption\", \"figure\",\n    \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\",\n    \"h5\", \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\",\n    \"isindex\", \"main\", \"menu\", \"meta\", \"noframes\", \"nav\",\n    \"ol\", \"output\", \"p\", \"pre\",\n    \"section\", \"summary\", \"table\", \"tbody\", \"textarea\",\n    \"thead\", \"tfoot\", \"ul\", \"dd\",\n    \"dt\", \"frameset\", \"li\", \"tbody\", \"td\", \"tfoot\",\n    \"th\", \"thead\", \"tr\", \"script\", \"style\"]\n\n-- We want to allow raw docbook in markdown documents, so we\n-- include docbook block tags here too.\nblockDocBookTags :: Set Text\nblockDocBookTags = fromList\n   [\"calloutlist\", \"bibliolist\", \"glosslist\", \"itemizedlist\",\n    \"orderedlist\", \"segmentedlist\", \"simplelist\",\n    \"variablelist\", \"caution\", \"important\", \"note\", \"tip\",\n    \"warning\", \"address\", \"literallayout\", \"programlisting\",\n    \"programlistingco\", \"screen\", \"screenco\", \"screenshot\",\n    \"synopsis\", \"example\", \"informalexample\", \"figure\",\n    \"informalfigure\", \"table\", \"informaltable\", \"para\",\n    \"simpara\", \"formalpara\", \"equation\", \"informalequation\",\n    \"figure\", \"screenshot\", \"mediaobject\", \"qandaset\",\n    \"procedure\", \"task\", \"cmdsynopsis\", \"funcsynopsis\",\n    \"classsynopsis\", \"blockquote\", \"epigraph\", \"msgset\",\n    \"sidebar\", \"title\"]\n\nepubTags :: Set Text\nepubTags = fromList [\"case\", \"switch\", \"default\"]\n\nblockTags :: Set Text\nblockTags = unions [blockHtmlTags, blockDocBookTags, epubTags]\n\nsectioningContent :: [Text]\nsectioningContent = [\"article\", \"aside\", \"nav\", \"section\"]\n\n\ngroupingContent :: [Text]\ngroupingContent = [\"p\", \"hr\", \"pre\", \"blockquote\", \"ol\"\n                  , \"ul\", \"li\", \"dl\", \"dt\", \"dt\", \"dd\"\n                  , \"figure\", \"figcaption\", \"div\", \"main\"]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/HTML/Types.hs",
    "content": "{-# LANGUAGE FlexibleInstances     #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{- |\n   Module      : Text.Pandoc.Readers.HTML.Types\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTypes for pandoc's HTML reader.\n-}\nmodule Text.Pandoc.Readers.HTML.Types\n  ( TagParser\n  , HTMLParser\n  , HTMLState (..)\n  , HTMLLocal (..)\n  )\nwhere\n\nimport Control.Monad.Reader (ReaderT, asks, local)\nimport Data.Default (Default (def))\nimport Data.Map (Map)\nimport Data.Set (Set)\nimport Data.Text (Text)\nimport Network.URI (URI)\nimport Text.HTML.TagSoup\nimport Text.Pandoc.Builder (Blocks, HasMeta (..))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Logging (LogMessage)\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Parsing\n  ( HasIdentifierList (..), HasLastStrPosition (..), HasLogMessages (..)\n  , HasMacros (..), HasQuoteContext (..), HasReaderOptions (..)\n  , ParsecT, ParserState, QuoteContext (NoQuote)\n  )\nimport Text.Pandoc.TeX (Macro)\n\n-- | HTML parser type\ntype HTMLParser m s = ParsecT s HTMLState (ReaderT HTMLLocal m)\n\n-- | HTML parser, expecting @Tag Text@ as tokens.\ntype TagParser m = HTMLParser m [Tag Text]\n\n-- | Global HTML parser state\ndata HTMLState = HTMLState\n  { parserState :: ParserState\n  , noteTable   :: [(Text, Blocks)]\n  , baseHref    :: Maybe URI\n  , identifiers :: Set Text\n  , logMessages :: [LogMessage]\n  , macros      :: Map Text Macro\n  , readerOpts  :: ReaderOptions\n  , inFootnotes :: Bool\n  }\n\n-- | Local HTML parser state\ndata HTMLLocal = HTMLLocal\n  { quoteContext :: QuoteContext\n  , inChapter    :: Bool -- ^ Set if in chapter section\n  , inPlain      :: Bool -- ^ Set if in pPlain\n  , inListItem   :: Bool -- ^ Set if in <li> tag\n  }\n\n\n-- Instances\n\ninstance HasMacros HTMLState where\n  extractMacros        = macros\n  updateMacros f st    = st{ macros = f $ macros st }\n\ninstance HasIdentifierList HTMLState where\n  extractIdentifierList = identifiers\n  updateIdentifierList f s = s{ identifiers = f (identifiers s) }\n\ninstance HasLogMessages HTMLState where\n  addLogMessage m s = s{ logMessages = m : logMessages s }\n  getLogMessages = reverse . logMessages\n\n-- This signature should be more general\n-- MonadReader HTMLLocal m => HasQuoteContext st m\ninstance PandocMonad m => HasQuoteContext HTMLState (ReaderT HTMLLocal m) where\n  getQuoteContext = asks quoteContext\n  withQuoteContext q = local (\\s -> s{quoteContext = q})\n\ninstance HasReaderOptions HTMLState where\n    extractReaderOptions = extractReaderOptions . parserState\n\ninstance HasMeta HTMLState where\n  setMeta s b st = st {parserState = setMeta s b $ parserState st}\n  deleteMeta s st = st {parserState = deleteMeta s $ parserState st}\n\ninstance Default HTMLLocal where\n  def = HTMLLocal NoQuote False False False\n\ninstance HasLastStrPosition HTMLState where\n  setLastStrPos s st = st {parserState = setLastStrPos s (parserState st)}\n  getLastStrPos = getLastStrPos . parserState\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/HTML.hs",
    "content": "{-# LANGUAGE FlexibleContexts     #-}\n{-# LANGUAGE FlexibleInstances     #-}\n{-# LANGUAGE LambdaCase            #-}\n{-# LANGUAGE OverloadedStrings     #-}\n{-# LANGUAGE ViewPatterns          #-}\n{- |\n   Module      : Text.Pandoc.Readers.HTML\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of HTML to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.HTML ( readHtml\n                                , htmlTag\n                                , htmlInBalanced\n                                , isInlineTag\n                                , isBlockTag\n                                , isTextTag\n                                , isCommentTag\n                                , toAttr\n                                ) where\n\nimport Control.Applicative ((<|>))\nimport Control.Monad (guard, mzero, unless, void)\nimport Control.Monad.Except (throwError, catchError)\nimport Control.Monad.Reader (ask, asks, lift, local, runReaderT)\nimport Data.ByteString.Base64 (encode)\nimport Data.Char (isAlphaNum, isLetter)\nimport Data.Default (Default (..), def)\nimport Data.Foldable (for_)\nimport Data.List.Split (splitWhen)\nimport qualified Data.List as L\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, isJust, isNothing)\nimport Data.Either (partitionEithers)\nimport Data.Monoid (First (..))\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Network.URI (nonStrictRelativeTo, parseURIReference)\nimport Text.HTML.TagSoup\nimport Text.HTML.TagSoup.Match\nimport Text.Pandoc.Builder (Blocks, Inlines, trimInlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.CSS (pickStyleAttrProps)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Readers.HTML.Parsing\nimport Text.Pandoc.Readers.HTML.Table (pTable)\nimport Text.Pandoc.Readers.HTML.TagCategories\nimport Text.Pandoc.Readers.HTML.Types\nimport Text.Pandoc.Readers.LaTeX (rawLaTeXInline)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options (\n    Extension (Ext_epub_html_exts, Ext_empty_paragraphs, Ext_native_divs,\n               Ext_native_spans, Ext_raw_html, Ext_line_blocks, Ext_raw_tex),\n    ReaderOptions (readerExtensions, readerStripComments),\n    extensionEnabled)\nimport Text.Pandoc.Parsing hiding ((<|>))\nimport Text.Pandoc.Shared (\n    addMetaField, extractSpaces, htmlSpanLikeElements, renderTags',\n    safeRead, tshow, formatCode)\nimport Text.Pandoc.URI (escapeURI)\nimport Text.Pandoc.Walk\nimport Text.TeXMath (readMathML, writeTeX)\nimport qualified Data.Sequence as Seq\n\n-- | Convert HTML-formatted string to 'Pandoc' document.\nreadHtml :: (PandocMonad m, ToSources a)\n         => ReaderOptions -- ^ Reader options\n         -> a             -- ^ Input to parse\n         -> m Pandoc\nreadHtml opts inp = do\n  let tags = stripPrefixes $ canonicalizeTags $\n             parseTagsOptions parseOptions{ optTagPosition = True }\n             (sourcesToText $ toSources inp)\n      parseDoc = do\n        blocks <- fixPlains False . mconcat <$> manyTill block eof\n        meta <- stateMeta . parserState <$> getState\n        bs' <- replaceNotes (B.toList blocks)\n        reportLogMessages\n        return $ Pandoc meta $ extractMain bs'\n      getError (errorMessages -> ms) = case ms of\n                                         []    -> \"\"\n                                         (m:_) -> messageString m\n  result <- flip runReaderT def $\n       runParserT parseDoc\n       (HTMLState def{ stateOptions = opts }\n         [] Nothing Set.empty [] M.empty opts False)\n       \"source\" tags\n  case result of\n    Right doc -> return doc\n    Left  err -> throwError $ PandocParseError $ T.pack $ getError err\n\n-- Extract contents of main element if exactly one is present; otherwise\n-- return all blocks.\nextractMain :: [Block] -> [Block]\nextractMain bs =\n  case query getMain bs of\n    [] -> bs\n    [Div (\"\",[],_) bs'] -> bs'\n    bs' -> bs'\n where\n   getMain :: Block -> [Block]\n   getMain b@(Div (_,_,kvs) _)\n     | Just \"main\" <- lookup \"role\" kvs = [b]\n   getMain _ = []\n\n-- Strip namespace prefixes on tags (not attributes)\nstripPrefixes :: [Tag Text] -> [Tag Text]\nstripPrefixes = map stripPrefix\n\nstripPrefix :: Tag Text -> Tag Text\nstripPrefix (TagOpen s as) = TagOpen (T.takeWhileEnd (/=':') s) as\nstripPrefix (TagClose s)   = TagClose (T.takeWhileEnd (/=':') s)\nstripPrefix x = x\n\nreplaceNotes :: PandocMonad m => [Block] -> TagParser m [Block]\nreplaceNotes bs = do\n  notes <- noteTable <$> getState\n  walkM (replaceNotes' notes) bs\n\nreplaceNotes' :: PandocMonad m\n              => [(Text, Blocks)] -> Inline -> TagParser m Inline\nreplaceNotes' noteTbl (RawInline (Format \"noteref\") ref) =\n  maybe warnNotFound (pure . Note . B.toList) $ lookup ref noteTbl\n where\n  warnNotFound = do\n    pos <- getPosition\n    logMessage $ ReferenceNotFound ref pos\n    pure (Note [])\nreplaceNotes' _ x = pure x\n\nsetInChapter :: PandocMonad m => HTMLParser m s a -> HTMLParser m s a\nsetInChapter = local (\\s -> s {inChapter = True})\n\nsetInPlain :: PandocMonad m => HTMLParser m s a -> HTMLParser m s a\nsetInPlain = local (\\s -> s {inPlain = True})\n\n-- Some items should be handled differently when in a list item tag, e.g. checkbox\nsetInListItem :: PandocMonad m => HTMLParser m s a -> HTMLParser m s a\nsetInListItem = local (\\s -> s {inListItem = True})\n\npHtml :: PandocMonad m => TagParser m Blocks\npHtml = do\n  (TagOpen \"html\" attr) <- lookAhead pAny\n  for_ (lookup \"lang\" attr <|> lookup \"xml:lang\" attr) $\n    updateState . B.setMeta \"lang\" . B.text\n  pInTags \"html\" block\n\npBody :: PandocMonad m => TagParser m Blocks\npBody = do\n  (TagOpen \"body\" attr) <- lookAhead pAny\n  for_ (lookup \"lang\" attr <|> lookup \"xml:lang\" attr) $\n    updateState . B.setMeta \"lang\" . B.text\n  pInTags \"body\" block\n\npHead :: PandocMonad m => TagParser m Blocks\npHead = pInTags \"head\" $ pTitle <|> pMetaTag <|> pBaseTag <|> (mempty <$ pAny)\n  where pTitle = pInTags \"title\" inline >>= setTitle . trimInlines\n        setTitle t = mempty <$ updateState (B.setMeta \"title\" t)\n        pMetaTag = do\n          mt <- pSatisfy (matchTagOpen \"meta\" [])\n          let name = fromAttrib \"name\" mt\n          if T.null name\n             then return mempty\n             else do\n               let content = fromAttrib \"content\" mt\n               updateState $ \\s ->\n                 let ps = parserState s in\n                 s{ parserState = ps{\n                      stateMeta = addMetaField name (B.text content)\n                                   (stateMeta ps) } }\n               return mempty\n        pBaseTag = do\n          bt <- pSatisfy (matchTagOpen \"base\" [])\n          updateState $ \\st -> st{ baseHref =\n               parseURIReference $ T.unpack $ fromAttrib \"href\" bt }\n          return mempty\n\nblock :: PandocMonad m => TagParser m Blocks\nblock = ((do\n  tag <- lookAhead (pSatisfy isBlockTag)\n  exts <- getOption readerExtensions\n  case tag of\n    TagOpen name attr ->\n      let type' = fromMaybe \"\" $\n                     lookup \"type\" attr <|> lookup \"epub:type\" attr\n          role = fromMaybe \"\" $ lookup \"role\" attr\n          epubExts = extensionEnabled Ext_epub_html_exts exts\n      in\n      case name of\n        _ | name `elem` sectioningContent\n          , epubExts\n          , \"chapter\" `T.isInfixOf` type'\n          -> eSection\n        _ | epubExts\n          , type' `elem` [\"footnotes\", \"rearnotes\"]\n          -> eFootnotes\n        _ | epubExts\n          , type' `elem` [\"footnote\", \"rearnote\"]\n          -> mempty <$ eFootnote\n        _ | epubExts\n          , type' == \"toc\"\n          -> mempty <$ eTOC\n        _ | \"titlepage\" `T.isInfixOf` type'\n          , name `elem` (\"section\" : groupingContent)\n          -> mempty <$ eTitlePage\n        _ | role == \"doc-endnotes\"\n          -> eFootnotes\n        \"p\" -> pPara\n        \"h1\" -> pHeader\n        \"h2\" -> pHeader\n        \"h3\" -> pHeader\n        \"h4\" -> pHeader\n        \"h5\" -> pHeader\n        \"h6\" -> pHeader\n        \"blockquote\" -> pBlockQuote\n        \"pre\" -> pCodeBlock\n        \"ul\" -> pBulletList\n        \"ol\" -> pOrderedList\n        \"dl\" -> pDefinitionList\n        \"table\" -> pTable block\n        \"hr\" -> pHrule\n        \"html\" -> pHtml\n        \"head\" -> pHead\n        \"body\" -> pBody\n        \"div\"\n          | extensionEnabled Ext_line_blocks exts\n          , Just \"line-block\" <- lookup \"class\" attr\n          -> pLineBlock\n          | otherwise\n          -> pDiv\n        \"section\" -> pDiv\n        \"header\" -> pDiv\n        \"main\" -> pDiv\n        \"figure\" -> pFigure\n        \"iframe\" -> pIframe\n        \"style\" -> pRawHtmlBlock\n        \"textarea\" -> pRawHtmlBlock\n        \"switch\"\n          | epubExts\n          -> eSwitch B.para block\n        _ -> mzero\n    _ -> mzero) <|> pPlain <|> pRawHtmlBlock) >>= \\res ->\n        res <$ trace (T.take 60 $ tshow $ B.toList res)\n\nnamespaces :: PandocMonad m => [(Text, TagParser m Inlines)]\nnamespaces = [(mathMLNamespace, pMath True)]\n\nmathMLNamespace :: Text\nmathMLNamespace = \"http://www.w3.org/1998/Math/MathML\"\n\neSwitch :: (PandocMonad m, Monoid a)\n        => (Inlines -> a)\n        -> TagParser m a\n        -> TagParser m a\neSwitch constructor parser = try $ do\n  guardEnabled Ext_epub_html_exts\n  pSatisfy (matchTagOpen \"switch\" [])\n  cases <- getFirst . mconcat <$>\n            manyTill (First <$> (eCase <* skipMany pBlank) )\n              (lookAhead $ try $ pSatisfy (matchTagOpen \"default\" []))\n  skipMany pBlank\n  fallback <- pInTags \"default\" (skipMany pBlank *> parser <* skipMany pBlank)\n  skipMany pBlank\n  pSatisfy (matchTagClose \"switch\")\n  return $ maybe fallback constructor cases\n\neCase :: PandocMonad m => TagParser m (Maybe Inlines)\neCase = do\n  skipMany pBlank\n  TagOpen _ attr' <- lookAhead $ pSatisfy (matchTagOpen \"case\" [])\n  let attr = toStringAttr attr'\n  case flip lookup namespaces =<< lookup \"required-namespace\" attr of\n    Just p -> Just <$> pInTags \"case\" (skipMany pBlank *> p <* skipMany pBlank)\n    Nothing -> Nothing <$ manyTill pAny (pSatisfy (matchTagClose \"case\"))\n\neFootnote :: PandocMonad m => TagParser m ()\neFootnote = do\n  inNotes <- inFootnotes <$> getState\n  TagOpen tag attr' <- lookAhead $ pSatisfy\n    (\\case\n       TagOpen _ attr'\n         -> case lookup \"type\" attr' <|> lookup \"epub:type\" attr' of\n              Just \"footnote\" -> True\n              Just \"rearnote\" -> True\n              _ -> inNotes\n       _ -> False)\n  let attr = toStringAttr attr'\n  let ident = fromMaybe \"\" (lookup \"id\" attr)\n  content <- pInTags tag block\n  updateState $ \\s ->\n    s {noteTable = (ident, content) : noteTable s}\n\neFootnotes :: PandocMonad m => TagParser m Blocks\neFootnotes = try $ do\n  let notes = [\"footnotes\", \"rearnotes\"]\n  (TagOpen tag attr') <- lookAhead pAny\n  let attr = toStringAttr attr'\n  guard (lookup \"role\" attr == Just \"doc-endnotes\") <|>\n    (guardEnabled Ext_epub_html_exts >>\n     guard (maybe False (`elem` notes)\n             (lookup \"type\" attr <|> lookup \"epub:type\" attr)))\n  updateState $ \\s -> s{ inFootnotes = True }\n  result <- pInTags tag block\n  updateState $ \\s -> s{ inFootnotes = False }\n  if null result\n     -- if it just contains notes, we don't need the container:\n     then return result\n     -- but there might be content other than notes, in which case\n     -- we want a div:\n     else return $ B.divWith (toAttr attr') result\n\neNoteref :: PandocMonad m => TagParser m Inlines\neNoteref = try $ do\n  TagOpen tag attr <-\n    pSatisfy (\\case\n                 TagOpen _ as\n                    -> (lookup \"type\" as <|> lookup \"epub:type\" as)\n                        == Just \"noteref\" ||\n                        lookup \"role\" as == Just \"doc-noteref\"\n                 _  -> False)\n  ident <- case lookup \"href\" attr >>= T.uncons of\n             Just ('#', rest) -> return rest\n             _ -> mzero\n  _ <- manyTill pAny (pSatisfy (\\case\n                                   TagClose t -> t == tag\n                                   _          -> False))\n  return $ B.rawInline \"noteref\" ident\n\n-- Strip TOC if there is one, better to generate again\neTOC :: PandocMonad m => TagParser m ()\neTOC = try $ do\n  guardEnabled Ext_epub_html_exts\n  (TagOpen tag attr) <- lookAhead pAny\n  guard $ (lookup \"type\" attr <|> lookup \"epub:type\" attr) == Just \"toc\"\n  void (pInTags tag block)\n\npBulletList :: PandocMonad m => TagParser m Blocks\npBulletList = try $ do\n  pSatisfy (matchTagOpen \"ul\" [])\n  -- note: if they have an <ol> or <ul> not in scope of a <li>,\n  -- treat it as a list item, though it's not valid xhtml...\n  skipMany pBlank\n  orphans <- many (do notFollowedBy (pSatisfy (matchTagOpen \"li\" []))\n                      notFollowedBy (pSatisfy isTagClose)\n                      block) -- e.g. <ul>, see #9187\n  items <- manyTill pListItem (pCloses \"ul\")\n  let items' = case orphans of\n                 [] -> items\n                 xs -> mconcat xs : items\n  return $ B.bulletList $ map (fixPlains True) items'\n\npListItem :: PandocMonad m => TagParser m Blocks\npListItem = setInListItem $ do\n  TagOpen _ attr' <- lookAhead $ pSatisfy (matchTagOpen \"li\" [])\n  let attr = toStringAttr attr'\n  let addId ident bs = case B.toList bs of\n                           (Plain ils:xs) -> B.fromList (Plain\n                                [Span (ident, [], []) ils] : xs)\n                           _ -> B.divWith (ident, [], []) bs\n  item <- pInTags \"li\" block\n  skipMany pBlank\n  orphans <- many (do notFollowedBy (pSatisfy (matchTagOpen \"li\" []))\n                      notFollowedBy (pSatisfy isTagClose)\n                      block) -- e.g. <ul>, see #9187\n  skipMany pBlank\n  return $ maybe id addId (lookup \"id\" attr) $ item <> mconcat orphans\n\npCheckbox :: PandocMonad m => TagParser m Inlines\npCheckbox = do\n  TagOpen _ attr' <- pSatisfy $ matchTagOpen \"input\" [(\"type\",\"checkbox\")]\n  TagClose _ <- pSatisfy (matchTagClose \"input\")\n  let attr = toStringAttr attr'\n  let isChecked = isJust $ lookup \"checked\" attr\n  let escapeSequence = B.str $ if isChecked then \"\\9746\" else \"\\9744\"\n  return $ escapeSequence <> B.space\n\n\nparseListStyleType :: Text -> ListNumberStyle\nparseListStyleType \"lower-roman\" = LowerRoman\nparseListStyleType \"upper-roman\" = UpperRoman\nparseListStyleType \"lower-alpha\" = LowerAlpha\nparseListStyleType \"upper-alpha\" = UpperAlpha\nparseListStyleType \"decimal\"     = Decimal\nparseListStyleType _             = DefaultStyle\n\nparseTypeAttr :: Text -> ListNumberStyle\nparseTypeAttr \"i\" = LowerRoman\nparseTypeAttr \"I\" = UpperRoman\nparseTypeAttr \"a\" = LowerAlpha\nparseTypeAttr \"A\" = UpperAlpha\nparseTypeAttr \"1\" = Decimal\nparseTypeAttr _   = DefaultStyle\n\npOrderedList :: PandocMonad m => TagParser m Blocks\npOrderedList = try $ do\n  TagOpen _ attribs' <- pSatisfy (matchTagOpen \"ol\" [])\n  isNoteList <- inFootnotes <$> getState\n  let attribs = toStringAttr attribs'\n  let start = fromMaybe 1 $ lookup \"start\" attribs >>= safeRead\n  let style = fromMaybe DefaultStyle\n         $  (parseTypeAttr      <$> lookup \"type\" attribs)\n        <|> (parseListStyleType <$> lookup \"class\" attribs)\n        <|> (parseListStyleType <$> (lookup \"style\" attribs >>= pickListStyle))\n        where\n          pickListStyle = pickStyleAttrProps [\"list-style-type\", \"list-style\"]\n\n  -- note: if they have an <ol> or <ul> not in scope of a <li>,\n  -- treat it as a list item, though it's not valid xhtml...\n  skipMany pBlank\n  orphans <- many (do notFollowedBy (pSatisfy (matchTagOpen \"li\" []))\n                      notFollowedBy (pSatisfy isTagClose)\n                      block) -- e.g. <ul>, see #9187\n  if isNoteList\n     then do\n       _ <- manyTill (eFootnote <|> pBlank) (pCloses \"ol\")\n       return mempty\n     else do\n       items <- manyTill pListItem (pCloses \"ol\")\n       let items' = case orphans of\n                      [] -> items\n                      xs -> mconcat xs : items\n       return $ B.orderedListWith (start, style, DefaultDelim) $\n                map (fixPlains True) items'\n\npDefinitionList :: PandocMonad m => TagParser m Blocks\npDefinitionList = try $ do\n  pSatisfy (matchTagOpen \"dl\" [])\n  items <- manyTill pDefListItem (pCloses \"dl\")\n  return $ B.definitionList items\n\npDefListItem :: PandocMonad m => TagParser m (Inlines, [Blocks])\npDefListItem = try $ do\n  let nonItem = pSatisfy (\\t -> not (matchTagOpen \"dt\" [] t) &&\n                  not (matchTagOpen \"dd\" [] t) && not (matchTagClose \"dl\" t))\n  terms <- many1 (try $ skipMany nonItem >> pInTags \"dt\" inline)\n  defs  <- many1 (try $ skipMany nonItem >> pInTags \"dd\" block)\n  skipMany nonItem\n  let term = L.foldl' (\\x y -> if null x\n                                  then trimInlines y\n                                  else x <> B.linebreak <> trimInlines y)\n                    mempty terms\n  return (term, map (fixPlains True) defs)\n\nfixPlains :: Bool -> Blocks -> Blocks\nfixPlains inList bs = if any isParaish bs'\n                         then B.fromList $ map plainToPara bs'\n                         else bs\n  where isParaish Para{}           = True\n        isParaish CodeBlock{}      = True\n        isParaish Header{}         = True\n        isParaish BlockQuote{}     = True\n        isParaish BulletList{}     = not inList\n        isParaish OrderedList{}    = not inList\n        isParaish DefinitionList{} = not inList\n        isParaish _                = False\n        plainToPara (Plain xs) = Para xs\n        plainToPara x          = x\n        bs' = B.toList bs\n\npRawTag :: PandocMonad m => TagParser m Text\npRawTag = do\n  tag <- pAny\n  let ignorable x = x `elem` [\"html\",\"head\",\"body\",\"!DOCTYPE\",\"?xml\"]\n  if tagOpen ignorable (const True) tag || tagClose ignorable tag\n     then return mempty\n     else return $ renderTags' [tag]\n\npLineBlock :: PandocMonad m => TagParser m Blocks\npLineBlock = try $ do\n  guardEnabled Ext_line_blocks\n  _ <- pSatisfy $ tagOpen (==\"div\") (== [(\"class\",\"line-block\")])\n  ils <- trimInlines . mconcat <$> manyTill inline (pSatisfy (tagClose (==\"div\")))\n  let lns = map B.fromList $\n            splitWhen (== LineBreak) $ filter (/= SoftBreak) $\n            B.toList ils\n  return $ B.lineBlock lns\n\nisDivLike :: Text -> Bool\nisDivLike \"div\"     = True\nisDivLike \"section\" = True\nisDivLike \"header\"  = True\nisDivLike \"main\"    = True\nisDivLike _         = False\n\npDiv :: PandocMonad m => TagParser m Blocks\npDiv = try $ do\n  guardEnabled Ext_native_divs\n  TagOpen tag attr' <- lookAhead $ pSatisfy $ tagOpen isDivLike (const True)\n  let (ident, classes, kvs) = toAttr attr'\n  contents <- pInTags tag block\n  let contents' = case B.unMany contents of\n                    Header lev (hident,hclasses,hkvs) ils Seq.:<| rest\n                        | hident == ident ->\n                          B.Many $ Header lev (\"\",hclasses,hkvs) ils Seq.<| rest\n                    _ -> contents\n  let classes' = if tag == \"section\"\n                    then \"section\":classes\n                    else classes\n      kvs' = if tag == \"main\" && isNothing (lookup \"role\" kvs)\n               then (\"role\", \"main\"):kvs\n               else kvs\n  return $ B.divWith (ident, classes', kvs') contents'\n\npIframe :: PandocMonad m => TagParser m Blocks\npIframe = try $ do\n  guardDisabled Ext_raw_html\n  tag <- pSatisfy (tagOpen (==\"iframe\") (isJust . lookup \"src\"))\n  skipMany pBlank\n  pCloses \"iframe\" <|> eof\n  url <- canonicalizeUrl $ fromAttrib \"src\" tag\n  if T.null url\n     then ignore $ renderTags' [tag, TagClose \"iframe\"]\n     else catchError\n       (do (bs, mbMime) <- openURL url\n           case mbMime of\n             Just mt\n               | \"text/html\" `T.isPrefixOf` mt -> do\n                    let inp = UTF8.toText bs\n                    opts <- readerOpts <$> getState\n                    Pandoc _ contents <- readHtml opts inp\n                    return $ B.divWith (\"\",[\"iframe\"],[]) $ B.fromList contents\n               | \"image/\" `T.isPrefixOf` mt -> do\n                    return $ B.divWith (\"\",[\"iframe\"],[]) $\n                      B.plain $ B.image url \"\" mempty\n             _ -> return $ B.divWith (\"\",[\"iframe\"],[(\"src\", url)]) mempty)\n       (\\e -> do\n         logMessage $ CouldNotFetchResource url (renderError e)\n         ignore $ renderTags' [tag, TagClose \"iframe\"])\n\npRawHtmlBlock :: PandocMonad m => TagParser m Blocks\npRawHtmlBlock = do\n  raw <- pHtmlBlock \"script\" <|> pHtmlBlock \"style\" <|> pHtmlBlock \"textarea\"\n          <|> pRawTag\n  exts <- getOption readerExtensions\n  if extensionEnabled Ext_raw_html exts && not (T.null raw)\n     then return $ B.rawBlock \"html\" raw\n     else ignore raw\n\nignore :: (Monoid a, PandocMonad m) => Text -> TagParser m a\nignore raw = do\n  pos <- getPosition\n  -- raw can be null for tags like <!DOCTYPE>; see paRawTag\n  -- in this case we don't want a warning:\n  unless (T.null raw) $\n    logMessage $ SkippedContent raw pos\n  return mempty\n\npHtmlBlock :: PandocMonad m => Text -> TagParser m Text\npHtmlBlock t = try $ do\n  open <- pSatisfy (matchTagOpen t [])\n  contents <- manyTill pAny (pSatisfy (matchTagClose t))\n  return $ renderTags' $ [open] <> contents <> [TagClose t]\n\n-- Sets chapter context\neSection :: PandocMonad m => TagParser m Blocks\neSection = try $ do\n  let matchChapter as = maybe False (T.isInfixOf \"chapter\")\n                        (lookup \"type\" as <|> lookup \"epub:type\" as)\n  let sectTag = tagOpen (`elem` sectioningContent) matchChapter\n  TagOpen tag _ <- lookAhead $ pSatisfy sectTag\n  setInChapter (pInTags tag block)\n\nheaderLevel :: Text -> TagParser m Int\nheaderLevel tagtype =\n  case safeRead (T.drop 1 tagtype) of\n        Just level ->\n--          try (do\n--            guardEnabled Ext_epub_html_exts\n--            asks inChapter >>= guard\n--            return (level - 1))\n--            <|>\n              return level\n        Nothing -> Prelude.fail \"Could not retrieve header level\"\n\neTitlePage :: PandocMonad m => TagParser m ()\neTitlePage = try $ do\n  let isTitlePage as = maybe False (T.isInfixOf \"titlepage\")\n       (lookup \"type\" as <|> lookup \"epub:type\" as)\n  let groupTag = tagOpen (\\x -> x `elem` groupingContent || x == \"section\")\n                          isTitlePage\n  TagOpen tag _ <- lookAhead $ pSatisfy groupTag\n  () <$ pInTags tag block\n\npHeader :: PandocMonad m => TagParser m Blocks\npHeader = try $ do\n  TagOpen tagtype attr' <- pSatisfy $\n                           tagOpen (`elem` [\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"])\n                           (const True)\n  let attr = toStringAttr attr'\n  level <- headerLevel tagtype\n  contents <- trimInlines . mconcat <$> manyTill inline (pCloses tagtype <|> eof)\n  let ident = fromMaybe \"\" $ lookup \"id\" attr\n  let classes = maybe [] T.words $ lookup \"class\" attr\n  let keyvals = [(k,v) | (k,v) <- attr, k /= \"class\", k /= \"id\"]\n  attr'' <- registerHeader (ident, classes, keyvals) contents\n  return $ B.headerWith attr'' level contents\n\npHrule :: PandocMonad m => TagParser m Blocks\npHrule = do\n  pSelfClosing (==\"hr\") (const True)\n  inNotes <- inFootnotes <$> getState\n  return $ if inNotes\n              then mempty\n              else B.horizontalRule\n\npBlockQuote :: PandocMonad m => TagParser m Blocks\npBlockQuote = do\n  contents <- pInTags \"blockquote\" block\n  return $ B.blockQuote $ fixPlains False contents\n\npPlain :: PandocMonad m => TagParser m Blocks\npPlain = do\n  contents <- setInPlain $ trimInlines . mconcat <$> many1 inline\n  if null contents\n     then return mempty\n     else return $ B.plain contents\n\npPara :: PandocMonad m => TagParser m Blocks\npPara = do\n  contents <- trimInlines <$> pInTags \"p\" inline\n  (do guardDisabled Ext_empty_paragraphs\n      guard (null contents)\n      return mempty)\n    <|> return (B.para contents)\n\npFigure :: PandocMonad m => TagParser m Blocks\npFigure = do\n  TagOpen tag attrList <- pSatisfy $ matchTagOpen \"figure\" []\n  let parser = Left <$> pInTags \"figcaption\" block <|>\n             (Right <$> block)\n  (captions, rest) <- partitionEithers <$> manyTill parser (pCloses tag <|> eof)\n  -- Concatenate all captions together\n  return $ B.figureWith (toAttr attrList)\n                        (B.simpleCaption (mconcat captions))\n                        (mconcat rest)\n\npCodeBlock :: PandocMonad m => TagParser m Blocks\npCodeBlock = try $ do\n  TagOpen _ attr' <- pSatisfy (matchTagOpen \"pre\" [])\n  -- if the `pre` has no attributes, try if it is followed by a `code`\n  -- element and use those attributes if possible.\n  attr <- case attr' of\n    _:_ -> pure (toAttr attr')\n    []  -> option nullAttr $ do\n      TagOpen _ codeAttr <- pSatisfy (matchTagOpen \"code\" [])\n      pure $ toAttr\n        [ (k, v') | (k, v) <- codeAttr\n                    -- strip language from class\n                  , let v' = if k == \"class\"\n                             then fromMaybe v (T.stripPrefix \"language-\" v)\n                             else v ]\n  contents <- manyTill pAny (pCloses \"pre\" <|> eof)\n  let rawText = T.concat $ map tagToText contents\n  -- drop trailing newline if any\n  let result = case T.unsnoc rawText of\n                    Just (result'', '\\n') -> result''\n                    _                     -> rawText\n  return $ B.codeBlockWith attr result\n\ntagToText :: Tag Text -> Text\ntagToText (TagText s)      = s\ntagToText (TagOpen \"br\" _) = \"\\n\"\ntagToText _                = \"\"\n\ninline :: PandocMonad m => TagParser m Inlines\ninline = pTagText <|> do\n  tag <- lookAhead (pSatisfy isInlineTag)\n  exts <- getOption readerExtensions\n  case tag of\n    TagOpen name attr ->\n      case name of\n        \"a\" | extensionEnabled Ext_epub_html_exts exts\n          , Just \"noteref\" <- lookup \"type\" attr <|> lookup \"epub:type\" attr\n          , Just ('#',_) <- lookup \"href\" attr >>= T.uncons\n            -> eNoteref\n          | Just \"doc-noteref\" <- lookup \"role\" attr\n          , Just ('#',_) <- lookup \"href\" attr >>= T.uncons\n            -> eNoteref\n            | otherwise -> pLink\n        \"switch\" -> eSwitch id inline\n        \"q\" -> pQ\n        \"em\" -> pEmph\n        \"i\"  -> pEmph\n        \"strong\" -> pStrong\n        \"b\" -> pStrong\n        \"sup\" -> pSuperscript\n        \"sub\" -> pSubscript\n        \"small\" -> pSmall\n        \"s\" -> pStrikeout\n        \"strike\" -> pStrikeout\n        \"del\" -> pStrikeout\n        \"u\" -> pUnderline\n        \"ins\" -> pUnderline\n        \"br\" -> pLineBreak\n        \"img\" -> pImage\n        \"svg\" -> pSvg\n        \"bdo\" -> pBdo\n        \"tt\" -> pCode\n        \"code\" -> pCode\n        \"samp\" -> pCodeWithClass \"samp\" \"sample\"\n        \"var\" -> pCodeWithClass \"var\" \"variable\"\n        \"span\" -> pSpan\n        \"math\" -> pMath False\n        \"input\"\n          | lookup \"type\" attr == Just \"checkbox\"\n          -> asks inListItem >>= guard >> pCheckbox\n        \"style\" -> B.rawInline \"html\" <$> pHtmlBlock \"style\"\n        \"script\"\n          | Just x <- lookup \"type\" attr\n          , \"math/tex\" `T.isPrefixOf` x -> pScriptMath\n        _ | name `elem` htmlSpanLikeElements -> pSpanLike\n        _ -> pRawHtmlInline\n    TagText _ -> pTagText\n    _ -> pRawHtmlInline\n\npSelfClosing :: PandocMonad m\n             => (Text -> Bool) -> ([Attribute Text] -> Bool)\n             -> TagParser m (Tag Text)\npSelfClosing f g = do\n  open <- pSatisfy (tagOpen f g)\n  optional $ pSatisfy (tagClose f)\n  return open\n\npQ :: PandocMonad m => TagParser m Inlines\npQ = do\n  TagOpen _ attrs <- pSatisfy $ tagOpenLit \"q\" (const True)\n  case lookup \"cite\" attrs of\n    Just url -> do\n      let uid = fromMaybe mempty $\n                   lookup \"name\" attrs <|> lookup \"id\" attrs\n      let cls = maybe [] T.words $ lookup \"class\" attrs\n      url' <- canonicalizeUrl url\n      makeQuote $ B.spanWith (uid, cls, [(\"cite\", escapeURI url')])\n    Nothing -> makeQuote id\n where\n  makeQuote wrapper = do\n    ctx <- asks quoteContext\n    let (constructor, innerContext) = case ctx of\n                  InDoubleQuote -> (B.singleQuoted, InSingleQuote)\n                  _             -> (B.doubleQuoted, InDoubleQuote)\n    content <- withQuoteContext innerContext\n                  (mconcat <$> manyTill inline (pCloses \"q\"))\n    return $ extractSpaces (constructor . wrapper) content\n\npEmph :: PandocMonad m => TagParser m Inlines\npEmph = pInlinesInTags \"em\" B.emph <|> pInlinesInTags \"i\" B.emph\n\npStrong :: PandocMonad m => TagParser m Inlines\npStrong = pInlinesInTags \"strong\" B.strong <|> pInlinesInTags \"b\" B.strong\n\npSuperscript :: PandocMonad m => TagParser m Inlines\npSuperscript = pInlinesInTags \"sup\" B.superscript\n\npSubscript :: PandocMonad m => TagParser m Inlines\npSubscript = pInlinesInTags \"sub\" B.subscript\n\npSpanLike :: PandocMonad m => TagParser m Inlines\npSpanLike =\n  Set.foldr\n    (\\tagName acc -> acc <|> parseTag tagName)\n    mzero\n    htmlSpanLikeElements\n  where\n    parseTag tagName = do\n      TagOpen _ attrs <- pSatisfy $ tagOpenLit tagName (const True)\n      let (ids, cs, kvs) = toAttr attrs\n      content <- mconcat <$> manyTill inline (pCloses tagName <|> eof)\n      return $ B.spanWith (ids, tagName : cs, kvs) content\n\npSmall :: PandocMonad m => TagParser m Inlines\npSmall = pInlinesInTags \"small\" (B.spanWith (\"\",[\"small\"],[]))\n\npStrikeout :: PandocMonad m => TagParser m Inlines\npStrikeout =\n  pInlinesInTags \"s\" B.strikeout <|>\n    pInlinesInTags \"strike\" B.strikeout <|>\n    pInlinesInTags \"del\" B.strikeout <|>\n    try (do pSatisfy (matchTagOpen \"span\" [(\"class\",\"strikeout\")])\n            contents <- mconcat <$> manyTill inline (pCloses \"span\")\n            return $ B.strikeout contents)\n\npUnderline :: PandocMonad m => TagParser m Inlines\npUnderline = pInlinesInTags \"u\" B.underline <|> pInlinesInTags \"ins\" B.underline\n\npLineBreak :: PandocMonad m => TagParser m Inlines\npLineBreak = do\n  pSelfClosing (==\"br\") (const True)\n  return B.linebreak\n\npLink :: PandocMonad m => TagParser m Inlines\npLink = try $ do\n  tag@(TagOpen _ attr') <- pSatisfy $ tagOpenLit \"a\" (const True)\n  let title = fromAttrib \"title\" tag\n  let attr = toAttr $ filter (\\(k,_) -> k /= \"title\" && k /= \"href\") attr'\n  lab <- mconcat <$> manyTill inline (pCloses \"a\")\n  st <- getState\n  if inFootnotes st && maybeFromAttrib \"role\" tag == Just \"doc-backlink\"\n     then return mempty\n     else do\n       -- check for href; if href, then a link, otherwise a span\n       case maybeFromAttrib \"href\" tag of\n            Nothing   ->\n              return $ extractSpaces (B.spanWith attr) lab\n            Just url' -> do\n              url <- canonicalizeUrl url'\n              return $ extractSpaces\n                        (B.linkWith attr (escapeURI url) title) lab\n\npImage :: PandocMonad m => TagParser m Inlines\npImage = do\n  tag@(TagOpen _ attr') <- pSelfClosing (==\"img\") (isJust . lookup \"src\")\n  url <- canonicalizeUrl $ fromAttrib \"src\" tag\n  let title = fromAttrib \"title\" tag\n  let alt = fromAttrib \"alt\" tag\n  let attr = toAttr $ filter (\\(k,_) -> k /= \"alt\" && k /= \"title\" && k /= \"src\") attr'\n  return $ B.imageWith attr (escapeURI url) title (B.text alt)\n\npSvg :: PandocMonad m => TagParser m Inlines\npSvg = do\n  guardDisabled Ext_raw_html\n  -- if raw_html enabled, parse svg tag as raw\n  opent@(TagOpen _ attr') <- pSatisfy (matchTagOpen \"svg\" [])\n  let (ident,cls,_) = toAttr attr'\n  contents <- many (notFollowedBy (pCloses \"svg\") >> pAny)\n  closet <- TagClose \"svg\" <$ (pCloses \"svg\" <|> eof)\n  let rawText = T.strip $ renderTags' (opent : contents ++ [closet])\n  let svgData = \"data:image/svg+xml;base64,\" <>\n                   UTF8.toText (encode $ UTF8.fromText rawText)\n  let kvs = [(\"width\", \"1em\") | \"fa-w-14\" `elem` cls ||\n                                \"fa-w-16\" `elem` cls ||\n                                \"fa-fw\" `elem` cls] -- #10134\n  return $ B.imageWith (ident,cls,kvs) svgData mempty mempty\n\npCodeWithClass :: PandocMonad m => Text -> Text -> TagParser m Inlines\npCodeWithClass name class' = try $ do\n  TagOpen open attr' <- pSatisfy $ tagOpen (== name) (const True)\n  let (ids,cs,kvs) = toAttr attr'\n      cs'          = class' : cs\n  code open (ids,cs',kvs)\n\npCode :: PandocMonad m => TagParser m Inlines\npCode = try $ do\n  (TagOpen open attr') <- pSatisfy $ tagOpen (`elem` [\"code\",\"tt\"]) (const True)\n  let attr = toAttr attr'\n  code open attr\n\ncode :: PandocMonad m => Text -> Attr -> TagParser m Inlines\ncode open attr = do\n  result <- mconcat <$> manyTill inline (pCloses open)\n  return $ formatCode attr result\n\n-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo\n-- Bidirectional Text Override\npBdo :: PandocMonad m => TagParser m Inlines\npBdo = try $ do\n  TagOpen _ attr' <- lookAhead $ pSatisfy $ tagOpen (==\"bdo\") (const True)\n  let attr = toStringAttr attr'\n  contents <- pInTags \"bdo\" inline\n  return $ case lookup \"dir\" attr of\n    -- Only bdo with a direction matters\n    Just dir -> B.spanWith (\"\", [], [(\"dir\",T.toLower dir)]) contents\n    Nothing  -> contents\n\npSpan :: PandocMonad m => TagParser m Inlines\npSpan = do\n  (TagOpen _ attr') <- lookAhead (pSatisfy $ tagOpen (==\"span\") (const True))\n  exts <- getOption readerExtensions\n  let attr = toAttr attr'\n  case attr of\n     (_,cls,_) -- skip MathJaX-generated HTML; see #10673\n       | \"mjx-chtml\" `elem` cls -> mempty <$ pInTags \"span\" inline\n       | \"MathJax_CHTML\" `elem` cls -> mempty <$ pInTags \"span\" inline\n       | \"MathJax_Preview\" `elem` cls -> mempty <$ pInTags \"span\" inline\n       | \"MJX_Assistive_MathML\" `elem` cls -> pInTags \"span\" inline\n     (_,[\"katex-html\"],_) -> mempty <$ pInTags \"span\" inline\n       -- skip HTML generated by KaTeX, since we get\n       -- the math by parsing mathml (#9971)\n     _ | extensionEnabled Ext_native_spans exts -> do\n           contents <- pInTags \"span\" inline\n           let classes = maybe [] T.words $ lookup \"class\" attr'\n           let styleAttr   = fromMaybe \"\" $ lookup \"style\" attr'\n           let fontVariant = fromMaybe \"\" $\n                              pickStyleAttrProps [\"font-variant\"] styleAttr\n           let isSmallCaps = fontVariant == \"small-caps\" ||\n                               \"smallcaps\" `elem` classes\n           let tag = if isSmallCaps then B.smallcaps else B.spanWith attr\n           return $ tag contents\n       | extensionEnabled Ext_raw_html exts -> do\n            tag <- pSatisfy $ tagOpen (==\"span\") (const True)\n            return $ B.rawInline \"html\" $ renderTags' [tag]\n       | otherwise  -> pInTags \"span\" inline -- just contents\n\npRawHtmlInline :: PandocMonad m => TagParser m Inlines\npRawHtmlInline = do\n  inplain <- asks inPlain\n  result <- pSatisfy (tagComment (const True))\n            <|> if inplain\n                   then pSatisfy (not . isBlockTag)\n                   else pSatisfy isInlineTag\n  exts <- getOption readerExtensions\n  let raw = renderTags' [result]\n  if extensionEnabled Ext_raw_html exts\n     then return $ B.rawInline \"html\" raw\n     else ignore raw\n\nmathMLToTeXMath :: Text -> Either Text Text\nmathMLToTeXMath s = writeTeX <$> readMathML s\n\npScriptMath :: PandocMonad m => TagParser m Inlines\npScriptMath = try $ do\n  TagOpen _ attr' <- pSatisfy $ tagOpen (==\"script\") (const True)\n  isdisplay <- case lookup \"type\" attr' of\n                    Just x | \"math/tex\" `T.isPrefixOf` x\n                      -> return $ \"display\" `T.isSuffixOf` x\n                    _ -> mzero\n  contents <- innerText <$> manyTill pAny (pSatisfy (matchTagClose \"script\"))\n  return $ (if isdisplay then B.displayMath else B.math) contents\n\npMath :: PandocMonad m => Bool -> TagParser m Inlines\npMath inCase = try $ do\n  open@(TagOpen _ attr') <- pSatisfy $ tagOpen (==\"math\") (const True)\n  -- we'll assume math tags are MathML unless specially marked\n  -- otherwise...\n  let attr = toStringAttr attr'\n  unless inCase $\n    guard (maybe True (== mathMLNamespace) (lookup \"xmlns\" attr))\n  let constructor = case lookup \"display\" attr of\n                       Just \"block\" -> B.displayMath\n                       _ -> B.math\n  contents <- manyTill pAny (pSatisfy (matchTagClose \"math\"))\n  -- KaTeX and others include original TeX in annotation tag;\n  -- just use this if present rather than parsing MathML:\n  case extractTeXAnnotation contents of\n    Just x -> return $ constructor x\n    Nothing ->\n      case mathMLToTeXMath (renderTags $\n              [open] <> contents <> [TagClose \"math\"]) of\n           Left _   -> return $ B.spanWith (\"\",[\"math\"],attr) $ B.text $\n                                 innerText contents\n           Right \"\" -> return mempty\n           Right x  -> return $ constructor x\n\nextractTeXAnnotation :: [Tag Text] -> Maybe Text\nextractTeXAnnotation [] = Nothing\nextractTeXAnnotation (TagOpen \"annotation\" [(\"encoding\",\"application/x-tex\")]\n                       : ts) =\n  Just $ innerText $ takeWhile (~/= TagClose (\"annotation\" :: Text)) ts\nextractTeXAnnotation (_:ts) = extractTeXAnnotation ts\n\n\npInlinesInTags :: PandocMonad m => Text -> (Inlines -> Inlines)\n               -> TagParser m Inlines\npInlinesInTags tagtype f = extractSpaces f <$> pInTags tagtype inline\n\npTagText :: PandocMonad m => TagParser m Inlines\npTagText = try $ do\n  pos <- getPosition\n  (TagText str) <- pSatisfy isTagText\n  st <- getState\n  qu <- ask\n  parsed <- lift $ lift $\n            flip runReaderT qu $ runParserT (many pTagContents) st \"text\"\n               (Sources [(pos, str)])\n  case parsed of\n       Left _        -> throwError $ PandocParseError $\n                        \"Could not parse `\" <> str <> \"'\"\n       Right result  -> return $ mconcat result\n\ntype InlinesParser m = HTMLParser m Sources\n\npTagContents :: PandocMonad m => InlinesParser m Inlines\npTagContents =\n      B.displayMath <$> mathDisplay\n  <|> B.math        <$> mathInline\n  <|> pStr\n  <|> pSpace\n  <|> smartPunctuation pTagContents\n  <|> pRawTeX\n  <|> pSymbol\n  <|> pBad\n\npRawTeX :: PandocMonad m => InlinesParser m Inlines\npRawTeX = do\n  lookAhead $ try $ do\n    char '\\\\'\n    choice $ map (try . string) [\"begin\", \"eqref\", \"ref\"]\n  guardEnabled Ext_raw_tex\n  inp <- getInput\n  st <- getState\n  res <- lift $ runParserT (withRaw rawLaTeXInline) st \"chunk\" inp\n  case res of\n       Left _                -> mzero\n       Right (contents, raw) -> do\n         _ <- count (T.length raw) anyChar\n         return $ B.rawInline \"tex\" contents\n\npStr :: PandocMonad m => InlinesParser m Inlines\npStr = do\n  result <- many1 $ satisfy $ \\c ->\n                     not (isSpace c) && not (isSpecial c) && not (isBad c)\n  updateLastStrPos\n  return $ B.str $ T.pack result\n\nisSpecial :: Char -> Bool\nisSpecial '\"'     = True\nisSpecial '\\''    = True\nisSpecial '.'     = True\nisSpecial '-'     = True\nisSpecial '$'     = True\nisSpecial '\\\\'    = True\nisSpecial '\\8216' = True\nisSpecial '\\8217' = True\nisSpecial '\\8220' = True\nisSpecial '\\8221' = True\nisSpecial _       = False\n\npSymbol :: PandocMonad m => InlinesParser m Inlines\npSymbol = B.str . T.singleton <$> satisfy isSpecial\n\nisBad :: Char -> Bool\nisBad c = c >= '\\128' && c <= '\\159' -- not allowed in HTML\n\npBad :: PandocMonad m => InlinesParser m Inlines\npBad = do\n  c <- satisfy isBad\n  let c' = case c of\n                '\\128' -> '\\8364'\n                '\\130' -> '\\8218'\n                '\\131' -> '\\402'\n                '\\132' -> '\\8222'\n                '\\133' -> '\\8230'\n                '\\134' -> '\\8224'\n                '\\135' -> '\\8225'\n                '\\136' -> '\\710'\n                '\\137' -> '\\8240'\n                '\\138' -> '\\352'\n                '\\139' -> '\\8249'\n                '\\140' -> '\\338'\n                '\\142' -> '\\381'\n                '\\145' -> '\\8216'\n                '\\146' -> '\\8217'\n                '\\147' -> '\\8220'\n                '\\148' -> '\\8221'\n                '\\149' -> '\\8226'\n                '\\150' -> '\\8211'\n                '\\151' -> '\\8212'\n                '\\152' -> '\\732'\n                '\\153' -> '\\8482'\n                '\\154' -> '\\353'\n                '\\155' -> '\\8250'\n                '\\156' -> '\\339'\n                '\\158' -> '\\382'\n                '\\159' -> '\\376'\n                _      -> '?'\n  return $ B.str $ T.singleton c'\n\npSpace :: PandocMonad m => InlinesParser m Inlines\npSpace = many1 (satisfy isSpace) >>= \\xs ->\n            if '\\n' `elem` xs\n               then return B.softbreak\n               else return B.space\n\ngetTagName :: Tag Text -> Maybe Text\ngetTagName (TagOpen t _) = Just t\ngetTagName (TagClose t)  = Just t\ngetTagName _             = Nothing\n\nisInlineTag :: Tag Text -> Bool\nisInlineTag t = isCommentTag t || case t of\n  TagOpen \"script\" _ -> \"math/tex\" `T.isPrefixOf` fromAttrib \"type\" t\n  TagClose \"script\"  -> True\n  TagOpen \"style\" _  -> True -- see #10643, invalid but it happens\n  TagClose \"style\"   -> True\n  TagOpen name _     -> isInlineTagName name\n  TagClose name      -> isInlineTagName name\n  _                  -> False\n where isInlineTagName x =\n         x `Set.notMember` blockTags ||\n         T.take 1 x == \"?\" -- processing instr.\n\nisBlockTag :: Tag Text -> Bool\nisBlockTag t = isBlockTagName || isTagComment t\n                 where isBlockTagName =\n                         case getTagName t of\n                              Just x\n                                | \"?\" `T.isPrefixOf` x -> True\n                                | \"!\" `T.isPrefixOf` x -> True\n                                | otherwise -> x `Set.member` blockTags\n                                    || x `Set.member` eitherBlockOrInline\n                              Nothing -> False\n\nisTextTag :: Tag Text -> Bool\nisTextTag = tagText (const True)\n\nisCommentTag :: Tag Text -> Bool\nisCommentTag = tagComment (const True)\n\n--- parsers for use in markdown, textile readers\n\n-- | Matches a stretch of HTML in balanced tags.\nhtmlInBalanced :: Monad m\n               => (Tag Text -> Bool)\n               -> ParsecT Sources st m Text\nhtmlInBalanced f = try $ do\n  lookAhead (char '<')\n  sources <- getInput\n  let ts = canonicalizeTags\n        $ parseTagsOptions parseOptions{ optTagWarning = True,\n                                         optTagPosition = True }\n        $ sourcesToText sources\n  case ts of\n    (TagPosition sr sc : t@(TagOpen tn _) : rest) -> do\n       guard $ f t\n       guard $ not $ hasTagWarning (t : take 1 rest)\n       case htmlInBalanced' tn (t:rest) of\n            []  -> mzero\n            xs  -> case reverse xs of\n                        (TagClose _ : TagPosition er ec : _) -> do\n                          let ls = er - sr\n                          let cs = ec - sc\n                          lscontents <- T.unlines <$> count ls anyLine\n                          cscontents <- count cs anyChar\n                          closetag <- do\n                            x <- many (satisfy (/='>'))\n                            char '>'\n                            return (x <> \">\")\n                          return $ lscontents <> T.pack cscontents <> T.pack closetag\n                        _ -> mzero\n    _ -> mzero\n\nhtmlInBalanced' :: Text\n                -> [Tag Text]\n                -> [Tag Text]\nhtmlInBalanced' tagname ts = fromMaybe [] $ go 0 ts\n  where go :: Int -> [Tag Text] -> Maybe [Tag Text]\n        go n (t@(TagOpen tn' _):rest) | tn' == tagname =\n              (t :) <$> go (n + 1) rest\n        go 1 (t@(TagClose tn'):_) | tn' == tagname =\n              return [t]\n        go n (t@(TagClose tn'):rest)  | tn' == tagname =\n              (t :) <$> go (n - 1) rest\n        go n (t:ts') = (t :) <$> go n ts'\n        go _ [] = mzero\n\nhasTagWarning :: [Tag Text] -> Bool\nhasTagWarning (TagWarning _:_) = True\nhasTagWarning _                = False\n\n-- | Matches a tag meeting a certain condition.\nhtmlTag :: (HasReaderOptions st, Monad m)\n        => (Tag Text -> Bool)\n        -> ParsecT Sources st m (Tag Text, Text)\nhtmlTag f = try $ do\n  lookAhead (char '<')\n  startpos <- getPosition\n  sources <- getInput\n  let inp = sourcesToText sources\n  let ts = canonicalizeTags $ parseTagsOptions\n                               parseOptions{ optTagWarning = False\n                                           , optTagPosition = True }\n                               (inp <> \" \")\n                               -- add space to ensure that\n                               -- we get a TagPosition after the tag\n  (next, ln, col) <- case ts of\n                      (TagPosition{} : next : TagPosition ln col : _)\n                        | f next -> return (next, ln, col)\n                      _ -> mzero\n\n  -- <www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>\n  -- should NOT be parsed as an HTML tag, see #2277,\n  -- so we exclude . even though it's a valid character\n  -- in XML element names\n  let isNameChar c = isAlphaNum c || c == ':' || c == '-' || c == '_'\n  let isName s = case T.uncons s of\n                   Nothing      -> False\n                   Just (c, cs) -> isLetter c && T.all isNameChar cs\n  let isPI s = case T.uncons s of\n                 Just ('?', _) -> True -- processing instruction\n                 _             -> False\n  let endpos = if ln == 1\n                  then setSourceColumn startpos\n                         (sourceColumn startpos + (col - 1))\n                  else setSourceColumn (setSourceLine startpos\n                                        (sourceLine startpos + (ln - 1)))\n                         col\n  let endAngle = try $\n        do char '>'\n           pos <- getPosition\n           guard $ pos >= endpos\n\n  let handleTag tagname = do\n       -- basic sanity check, since the parser is very forgiving\n       -- and finds tags in stuff like x<y)\n       guard $ isName tagname || isPI tagname\n       guard $ not $ T.null tagname\n       -- <https://example.org> should NOT be a tag either.\n       -- tagsoup will parse it as TagOpen \"https:\" [(\"example.org\",\"\")]\n       guard $ T.last tagname /= ':'\n       char '<'\n       rendered <- manyTill anyChar endAngle\n       return (next, T.pack $ \"<\" ++ rendered ++ \">\")\n  case next of\n       TagComment s\n         | \"<!--\" `T.isPrefixOf` inp -> do\n          string \"<!--\"\n          count (T.length s) anyChar\n          string \"-->\"\n          stripComments <- getOption readerStripComments\n          if stripComments\n             then return (next, \"\")\n             else return (next, \"<!--\" <> s <> \"-->\")\n         | otherwise -> Prelude.fail \"bogus comment mode, HTML5 parse error\"\n       TagOpen tagname attr -> do\n         guard $ isPI tagname || all (isName . fst) attr\n         handleTag tagname\n       TagClose tagname ->\n         handleTag tagname\n       _ -> mzero\n\n-- Utilities\n\n-- | Adjusts a url according to the document's base URL.\ncanonicalizeUrl :: PandocMonad m => Text -> TagParser m Text\ncanonicalizeUrl url\n  | \"data:\" `T.isPrefixOf` url = return url\n  | otherwise = do\n     mbBaseHref <- baseHref <$> getState\n     return $ case (parseURIReference (T.unpack url), mbBaseHref) of\n                   (Just rel, Just bs) -> tshow (rel `nonStrictRelativeTo` bs)\n                   _                   -> url\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Haddock.hs",
    "content": "{-# LANGUAGE CPP               #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Haddock\n   Copyright   : Copyright (C) 2013 David Lazar\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : David Lazar <lazar6@illinois.edu>,\n                 John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n\nConversion of Haddock markup to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Haddock\n    ( readHaddock\n    ) where\n\nimport Control.Monad.Except (throwError)\nimport Data.List (intersperse)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (unpack)\nimport qualified Data.Text as T\nimport Documentation.Haddock.Parser\nimport Documentation.Haddock.Types as H\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.Options\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\nimport Text.Pandoc.Shared (splitTextBy, trim)\n\n\n-- | Parse Haddock markup and return a 'Pandoc' document.\nreadHaddock :: (PandocMonad m, ToSources a)\n            => ReaderOptions\n            -> a\n            -> m Pandoc\nreadHaddock opts s = case readHaddockEither opts\n                           (unpack . sourcesToText . toSources $ s) of\n  Right result -> return result\n  Left e       -> throwError e\n\nreadHaddockEither :: ReaderOptions -- ^ Reader options\n                  -> String        -- ^ String to parse\n                  -> Either PandocError Pandoc\nreadHaddockEither _opts =\n  Right . B.doc . docHToBlocks . _doc . parseParas Nothing\n\ndocHToBlocks :: DocH String Identifier -> Blocks\ndocHToBlocks d' =\n  case d' of\n    DocEmpty -> mempty\n    DocAppend (DocParagraph (DocHeader h)) (DocParagraph (DocAName ident)) ->\n         B.headerWith (T.pack ident,[],[]) (headerLevel h)\n            (docHToInlines False $ headerTitle h)\n    DocAppend d1 d2 -> mappend (docHToBlocks d1) (docHToBlocks d2)\n    DocString _ -> inlineFallback\n    DocParagraph (DocAName h) -> B.plain $ docHToInlines False $ DocAName h\n    DocParagraph x -> B.para $ docHToInlines False x\n    DocIdentifier _ -> inlineFallback\n    DocIdentifierUnchecked _ -> inlineFallback\n    DocModule s -> B.plain $ docHToInlines False $ DocModule s\n    DocWarning _ -> mempty -- TODO\n    DocEmphasis _ -> inlineFallback\n    DocMonospaced _ -> inlineFallback\n    DocBold _ -> inlineFallback\n    DocMathInline _ -> inlineFallback\n    DocMathDisplay _ -> inlineFallback\n    DocHeader h -> B.header (headerLevel h)\n                           (docHToInlines False $ headerTitle h)\n    DocUnorderedList items -> B.bulletList (map docHToBlocks items)\n#if MIN_VERSION_haddock_library(1,11,0)\n    DocOrderedList items ->\n      B.orderedListWith attr (map (docHToBlocks . snd) items)\n     where\n      attr = (start, DefaultStyle, DefaultDelim)\n      start = case items of\n                [] -> 1\n                ((n,_):_) -> n\n#else\n    DocOrderedList items -> B.orderedList (map docHToBlocks items)\n#endif\n    DocDefList items -> B.definitionList (map (\\(d,t) ->\n                               (docHToInlines False d,\n                                [consolidatePlains $ docHToBlocks t])) items)\n    DocCodeBlock (DocString s) -> B.codeBlockWith (\"\",[],[]) $ T.pack s\n    DocCodeBlock d -> B.para $ docHToInlines True d\n    DocHyperlink _ -> inlineFallback\n    DocPic _ -> inlineFallback\n    DocAName _ -> inlineFallback\n    DocProperty s -> B.codeBlockWith (\"\",[\"property\",\"haskell\"],[]) (trim $ T.pack s)\n    DocExamples es -> mconcat $ map (\\e ->\n       makeExample \">>>\" (exampleExpression e) (exampleResult e)) es\n    DocTable H.Table{ tableHeaderRows = headerRows\n                    , tableBodyRows = bodyRows\n                    }\n      -> let toCells = map (docHToBlocks . tableCellContents) . tableRowCells\n             toRow = Row nullAttr . map B.simpleCell\n             toHeaderRow l = [toRow l | not (null l)]\n             (header, body) =\n               case headerRows of\n                  [] -> ([], map toCells bodyRows)\n                  (x:xs) -> (toCells x, map toCells (xs ++ bodyRows))\n             colspecs = replicate (maybe 0 maximum (nonEmpty (map length body)))\n                             (AlignDefault, ColWidthDefault)\n         in  B.table B.emptyCaption\n                     colspecs\n                     (TableHead nullAttr $ toHeaderRow header)\n                     [TableBody nullAttr 0 [] $ map toRow body]\n                     (TableFoot nullAttr [])\n\n  where inlineFallback = B.plain $ docHToInlines False d'\n        consolidatePlains = B.fromList . consolidatePlains' . B.toList\n        consolidatePlains' zs@(Plain _ : _) =\n          let (xs, ys) = span isPlain zs in\n          Para (concatMap extractContents xs) : consolidatePlains' ys\n        consolidatePlains' (x : xs) = x : consolidatePlains' xs\n        consolidatePlains' [] = []\n        isPlain (Plain _) = True\n        isPlain _         = False\n        extractContents (Plain xs) = xs\n        extractContents _          = []\n\ndocHToInlines :: Bool -> DocH String Identifier -> Inlines\ndocHToInlines isCode d' =\n  case d' of\n    DocEmpty -> mempty\n    DocAppend d1 d2 -> mappend (docHToInlines isCode d1)\n                               (docHToInlines isCode d2)\n    DocString s\n      | isCode -> mconcat $ intersperse B.linebreak\n                              $ map B.code $ splitTextBy (=='\\n') $ T.pack s\n      | otherwise  -> B.text $ T.pack s\n    DocParagraph _ -> mempty\n    DocIdentifier ident ->\n        case toRegular (DocIdentifier ident) of\n          DocIdentifier s -> B.codeWith (\"\",[\"haskell\",\"identifier\"],[]) $ T.pack s\n          _               -> mempty\n    DocIdentifierUnchecked s -> B.codeWith (\"\",[\"haskell\",\"identifier\"],[]) $ T.pack s\n    DocModule s -> B.codeWith (\"\",[\"haskell\",\"module\"],[]) $\n                   T.pack (modLinkName s)\n    DocWarning _ -> mempty -- TODO\n    DocEmphasis d -> B.emph (docHToInlines isCode d)\n    DocMonospaced (DocString s) -> B.code $ T.pack s\n    DocMonospaced d -> docHToInlines True d\n    DocBold d -> B.strong (docHToInlines isCode d)\n    DocMathInline s -> B.math $ T.pack s\n    DocMathDisplay s -> B.displayMath $ T.pack s\n    DocHeader _ -> mempty\n    DocUnorderedList _ -> mempty\n    DocOrderedList _ -> mempty\n    DocDefList _ -> mempty\n    DocCodeBlock _ -> mempty\n    DocHyperlink h -> B.link (T.pack $ hyperlinkUrl h) (T.pack $ hyperlinkUrl h)\n             (maybe (B.text $ T.pack $ hyperlinkUrl h) (docHToInlines isCode)\n               (hyperlinkLabel h))\n    DocPic p -> B.image (T.pack $ pictureUri p) (T.pack $ fromMaybe (pictureUri p) $ pictureTitle p)\n                        (maybe mempty (B.text . T.pack) $ pictureTitle p)\n    DocAName s -> B.spanWith (T.pack s,[\"anchor\"],[]) mempty\n    DocProperty _ -> mempty\n    DocExamples _ -> mempty\n    DocTable _ -> mempty\n\n-- | Create an 'Example', stripping superfluous characters as appropriate\nmakeExample :: T.Text -> String -> [String] -> Blocks\nmakeExample prompt expression result =\n    B.para $ B.codeWith (\"\",[\"prompt\"],[]) prompt\n        <> B.space\n        <> B.codeWith (\"\", [\"haskell\",\"expr\"], []) (trim $ T.pack expression)\n        <> B.linebreak\n        <> mconcat (intersperse B.linebreak $ map coder result')\n  where\n    -- 1. drop trailing whitespace from the prompt, remember the prefix\n    prefix = T.takeWhile (`elem` (\" \\t\" :: String)) prompt\n\n    -- 2. drop, if possible, the exact same sequence of whitespace\n    -- characters from each result line\n    --\n    -- 3. interpret lines that only contain the string \"<BLANKLINE>\" as an\n    -- empty line\n    result' = map (substituteBlankLine . tryStripPrefix prefix . T.pack) result\n      where\n        tryStripPrefix xs ys = fromMaybe ys $ T.stripPrefix xs ys\n\n        substituteBlankLine \"<BLANKLINE>\" = \"\"\n        substituteBlankLine line          = line\n    coder = B.codeWith (\"\", [\"result\"], [])\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Ipynb.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Readers.Ipynb\n   Copyright   : Copyright (C) 2019-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nIpynb (Jupyter notebook JSON format) reader for pandoc.\n-}\nmodule Text.Pandoc.Readers.Ipynb ( readIpynb )\nwhere\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport Data.Char (isDigit)\nimport Data.Maybe (fromMaybe)\nimport Text.Pandoc.Options\nimport Control.Applicative ((<|>))\nimport qualified Data.Scientific as Scientific\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Definition\nimport Data.Ipynb as Ipynb\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.MIME (extensionFromMimeType)\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.UTF8\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.Error\nimport Data.Text (Text)\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport qualified Data.Text.Encoding as TE\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Aeson as Aeson\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Readers.Markdown (readMarkdown)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\n\nreadIpynb :: (PandocMonad m, ToSources a)\n          => ReaderOptions -> a -> m Pandoc\nreadIpynb opts x = do\n  let src = BL.fromStrict . TE.encodeUtf8 . sourcesToText $ toSources x\n  case eitherDecode src of\n    Right (notebook4 :: Notebook NbV4) -> notebookToPandoc opts notebook4\n    Left _ ->\n      case eitherDecode src of\n        Right (notebook3 :: Notebook NbV3) -> notebookToPandoc opts notebook3\n        Left err -> throwError $ PandocIpynbDecodingError $ T.pack err\n\nnotebookToPandoc :: PandocMonad m\n                 => ReaderOptions -> Notebook a -> m Pandoc\nnotebookToPandoc opts notebook = do\n  let cells = notebookCells notebook\n  let (fmt,fmtminor) = notebookFormat notebook\n  let m = M.insert \"nbformat\" (MetaString $ tshow fmt) $\n          M.insert \"nbformat_minor\" (MetaString $ tshow fmtminor) $\n          jsonMetaToMeta (notebookMetadata notebook)\n  let lang = case M.lookup \"kernelspec\" m of\n                   Just (MetaMap ks) ->\n                      case M.lookup \"language\" ks of\n                         Just (MetaString l) -> l\n                         _ -> \"python\"\n                   _ -> \"python\"\n  bs <- mconcat <$> mapM (cellToBlocks opts lang) cells\n  let Pandoc _ blocks = B.doc bs\n  return $ Pandoc (Meta $ M.insert \"jupyter\" (MetaMap m) mempty) blocks\n\ncellToBlocks :: PandocMonad m\n             => ReaderOptions -> Text -> Ipynb.Cell a -> m B.Blocks\ncellToBlocks opts lang c = do\n  let Source ts = cellSource c\n  let source = mconcat ts\n  let kvs = jsonMetaToPairs (cellMetadata c)\n  let attachments = case cellAttachments c of\n                      Nothing -> mempty\n                      Just (MimeAttachments m) -> M.toList m\n  let ident = fromMaybe mempty $ cellId c\n  mapM_ (addAttachment (cellId c)) attachments\n  case cellType c of\n    Ipynb.Markdown -> do\n      bs <- if isEnabled Ext_raw_markdown opts\n               then return [RawBlock (Format \"markdown\") source]\n               else do\n                 Pandoc _ bs <- walk (fixImage (cellId c)) <$> readMarkdown opts source\n                 return bs\n      return $ B.divWith (ident,[\"cell\",\"markdown\"],kvs)\n             $ B.fromList bs\n    Ipynb.Heading lev -> do\n      Pandoc _ bs <- readMarkdown opts\n        (T.replicate lev \"#\" <> \" \" <> source)\n      return $ B.divWith (ident,[\"cell\",\"markdown\"],kvs)\n             $ B.fromList bs\n    Ipynb.Raw -> do\n      -- we use ipynb to indicate no format given (a wildcard in nbformat)\n      let format = fromMaybe \"ipynb\" $ lookup \"raw_mimetype\" kvs <|> lookup \"format\" kvs\n      let format' =\n            case format of\n              \"text/html\"             -> \"html\"\n              \"slides\"                -> \"html\"\n              \"text/latex\"            -> \"latex\"\n              \"application/pdf\"       -> \"latex\"\n              \"pdf\"                   -> \"latex\"\n              \"text/markdown\"         -> \"markdown\"\n              \"text/x-rst\"            -> \"rst\"\n              \"text/restructuredtext\" -> \"rst\"\n              \"text/asciidoc\"         -> \"asciidoc\"\n              _                       -> format\n      return $ B.divWith (ident,[\"cell\",\"raw\"],kvs)\n             $ B.rawBlock format' source\n    Ipynb.Code{ codeOutputs = outputs, codeExecutionCount = ec } -> do\n      outputBlocks <- mconcat <$> mapM outputToBlock outputs\n      let kvs' = maybe kvs (\\x -> (\"execution_count\", tshow x):kvs) ec\n      return $ B.divWith (ident,[\"cell\",\"code\"],kvs') $\n        B.codeBlockWith (\"\",[lang],[]) source\n        <> outputBlocks\n\n-- Remove attachment: prefix from images...\nfixImage :: Maybe Text -> Inline -> Inline\nfixImage mbident (Image attr lab (src,tit))\n  | \"attachment:\" `T.isPrefixOf` src =\n     let src' = T.drop 11 src\n         qualifiedSrc = maybe src' (<> (\"-\" <> src')) mbident\n      in Image attr lab (qualifiedSrc, tit)\nfixImage _ x = x\n\naddAttachment :: PandocMonad m => Maybe Text -> (Text, MimeBundle) -> m ()\naddAttachment mbident (fname, mimeBundle) = do\n  let fp = T.unpack $ maybe fname (<> (\"-\" <> fname)) mbident\n  case M.toList (unMimeBundle mimeBundle) of\n    (mimeType, BinaryData bs):_ ->\n      insertMedia fp (Just mimeType) (BL.fromStrict bs)\n    (mimeType, TextualData t):_ ->\n      insertMedia fp (Just mimeType)\n          (BL.fromStrict $ TE.encodeUtf8 t)\n    (mimeType, JsonData v):_ ->\n      insertMedia fp (Just mimeType) (encode v)\n    [] -> report $ CouldNotFetchResource fname \"no attachment\"\n\noutputToBlock :: PandocMonad m => Output a -> m B.Blocks\noutputToBlock Stream{ streamName = sName,\n                      streamText = Source text } =\n  return $ B.divWith (\"\",[\"output\",\"stream\",sName],[])\n         $ B.codeBlock $ T.concat text\noutputToBlock DisplayData{ displayData = data',\n                            displayMetadata = metadata' } =\n  B.divWith (\"\",[\"output\", \"display_data\"],[]) <$>\n    handleData metadata' data'\noutputToBlock ExecuteResult{ executeCount = ec,\n                              executeData = data',\n                              executeMetadata = metadata' } =\n  B.divWith (\"\",[\"output\", \"execute_result\"],[(\"execution_count\",tshow ec)])\n    <$> handleData metadata' data'\noutputToBlock Err{ errName = ename,\n                   errValue = evalue,\n                   errTraceback = traceback } =\n  return $ B.divWith (\"\",[\"output\",\"error\"],\n                         [(\"ename\",ename),\n                          (\"evalue\",evalue)])\n         $ B.codeBlock $ T.unlines traceback\n\n-- We want to display the richest output possible given\n-- the output format.\nhandleData :: PandocMonad m\n           => JSONMeta -> MimeBundle -> m B.Blocks\nhandleData (JSONMeta metadata) (MimeBundle mb) =\n  mconcat <$> mapM dataBlock (M.toList mb)\n\n  where\n\n    dataBlock :: PandocMonad m => (MimeType, MimeData) -> m B.Blocks\n    dataBlock (mt, d)\n     | \"image/\" `T.isPrefixOf` mt || mt == \"application/pdf\"\n      = do\n      -- normally metadata maps from mime types to key-value map;\n      -- but not always...\n      let meta = case M.lookup mt metadata of\n                   Just v@Object{} ->\n                     case fromJSON v of\n                       Success m' -> m'\n                       Error _   -> mempty\n                   _ -> mempty\n      let metaPairs = jsonMetaToPairs meta\n      let bs = case d of\n                 BinaryData bs' -> bs'\n                 TextualData t  -> UTF8.fromText t\n                 JsonData v     -> BL.toStrict $ encode v\n      -- SHA1 hash for filename\n      let fname = T.pack (show (hashWith SHA1 bs)) <>\n            case extensionFromMimeType mt of\n              Nothing  -> \"\"\n              Just ext -> \".\" <> ext\n      insertMedia (T.unpack fname) (Just mt) (BL.fromStrict bs)\n      return $ B.para $ B.imageWith (\"\",[],metaPairs) fname \"\" mempty\n\n    dataBlock (\"text/html\", TextualData t)\n      = return $ B.rawBlock \"html\" t\n\n    dataBlock (\"text/latex\", TextualData t)\n      = return $ B.rawBlock \"latex\" t\n\n    dataBlock (\"text/markdown\", TextualData t)\n      = return $ B.rawBlock \"markdown\" t\n\n    dataBlock (\"text/plain\", TextualData t) =\n      return $ B.codeBlock t\n\n    dataBlock (_, JsonData v) =\n      return $ B.codeBlockWith (\"\",[\"json\"],[]) $ T.pack $ toStringLazy $ encode v\n\n    dataBlock _ = return mempty\n\njsonMetaToMeta :: JSONMeta -> M.Map Text MetaValue\njsonMetaToMeta (JSONMeta m) = M.map valueToMetaValue m\n  where\n    valueToMetaValue :: Value -> MetaValue\n    valueToMetaValue x@Object{} =\n      case fromJSON x of\n        Error s -> MetaString $ T.pack s\n        Success jm' -> MetaMap $ jsonMetaToMeta jm'\n    valueToMetaValue x@Array{} =\n      case fromJSON x of\n        Error s -> MetaString $ T.pack s\n        Success xs -> MetaList $ map valueToMetaValue xs\n    valueToMetaValue (Bool b) = MetaBool b\n    valueToMetaValue (String t) = MetaString t\n    valueToMetaValue (Number n)\n      | Scientific.isInteger n = MetaString (tshow (floor n :: Integer))\n      | otherwise              = MetaString (tshow n)\n    valueToMetaValue Aeson.Null = MetaString \"\"\n\njsonMetaToPairs :: JSONMeta -> [(Text, Text)]\njsonMetaToPairs (JSONMeta m) = M.toList . M.map\n  (\\case\n      String t\n        | not (T.all isDigit t)\n        , t /= \"true\"\n        , t /= \"false\"\n                 -> t\n      x          -> T.pack $ UTF8.toStringLazy $ Aeson.encode x) $ m\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/JATS.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.JATS\n   Copyright   : Copyright (C) 2017-2020 Hamish Mackenzie\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of JATS XML to 'Pandoc' document.\n-}\n\nmodule Text.Pandoc.Readers.JATS ( readJATS ) where\nimport Control.Monad.State.Strict ( StateT(runStateT), gets, modify )\nimport Control.Monad (forM_,  when, unless)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Error (PandocError(..))\nimport Data.Char (isDigit, isSpace)\nimport Data.Default\nimport Data.Generics\nimport qualified Data.List as L\nimport qualified Data.Map as Map\nimport Data.Maybe (maybeToList, fromMaybe, catMaybes)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Text.Pandoc.XML (lookupEntity)\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.XML.Light\nimport Text.TeXMath (readMathML, writeTeX)\nimport qualified Data.Set as S (fromList, member)\nimport Data.Set ((\\\\))\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\nimport Safe (headMay)\nimport Text.Printf (printf)\n\ntype JATS m = StateT JATSState m\n\ndata JATSState = JATSState{ jatsSectionLevel :: Int\n                          , jatsQuoteType    :: QuoteType\n                          , jatsMeta         :: Meta\n                          , jatsBook         :: Bool\n                          , jatsFootnotes    :: Map.Map Text Blocks\n                          , jatsContent      :: [Content]\n                          , jatsInFigure     :: Bool\n                          } deriving Show\n\ninstance Default JATSState where\n  def = JATSState{ jatsSectionLevel = 0\n                 , jatsQuoteType = DoubleQuote\n                 , jatsMeta = mempty\n                 , jatsBook = False\n                 , jatsFootnotes = mempty\n                 , jatsContent = []\n                 , jatsInFigure = False }\n\n\nreadJATS :: (PandocMonad m, ToSources a)\n         => ReaderOptions\n         -> a\n         -> m Pandoc\nreadJATS _ inp = do\n  let sources = toSources inp\n  tree <- either (throwError . PandocXMLError \"\") return $\n            parseXMLContents (TL.fromStrict . sourcesToText $ sources)\n  (bs, st') <- flip runStateT (def{ jatsContent = tree }) $ mapM parseBlock tree\n  let footnotes = jatsFootnotes st'\n  let blockList = toList $ mconcat bs\n  let linkToFootnotes :: Inline -> Inline\n      linkToFootnotes link'@(Link _attr _txt (href, _title)) =\n        case T.uncons href of\n          Just ('#', rid) -> case Map.lookup rid footnotes of\n                               Just footnote -> Note (toList footnote)\n                               Nothing       -> link'\n          _               -> link'\n      linkToFootnotes inline = inline\n  return $ Pandoc (jatsMeta st') (walk linkToFootnotes blockList)\n\n-- convenience function to get an attribute value, defaulting to \"\"\nattrValue :: Text -> Element -> Text\nattrValue attr =\n  fromMaybe \"\" . maybeAttrValue attr\n\nmaybeAttrValue :: Text -> Element -> Maybe Text\nmaybeAttrValue attr elt =\n  lookupAttrBy (\\x -> qName x == attr) (elAttribs elt)\n\n-- convenience function\nnamed :: Text -> Element -> Bool\nnamed s e = qName (elName e) == s\n\n--\n\naddMeta :: PandocMonad m => ToMetaValue a => Text -> a -> JATS m ()\naddMeta field val = modify (setMeta field val)\n\ninstance HasMeta JATSState where\n  setMeta field v s =  s {jatsMeta = setMeta field v (jatsMeta s)}\n  deleteMeta field s = s {jatsMeta = deleteMeta field (jatsMeta s)}\n\nisBlockElement :: Content -> Bool\nisBlockElement (Elem e) = case qName (elName e) of\n            \"disp-formula\" -> if onlyOneChild e\n                                  then if hasFormulaChild e\n                                          then False\n                                          else case filterChild (named \"alternatives\") e of\n                                            Just a -> if hasFormulaChild a then False else True\n                                            Nothing -> True\n                                  else True\n            \"alternatives\" -> if hasFormulaChild e then False else True\n            _ -> qName (elName e) `S.member` blocktags\n\n  where blocktags = S.fromList (paragraphLevel ++ lists ++ formulae ++ other) \\\\ S.fromList canBeInline\n        paragraphLevel = [\"address\", \"answer\", \"answer-set\", \"array\", \"boxed-text\", \"chem-struct-wrap\",\n            \"code\", \"explanation\", \"fig\", \"fig-group\", \"graphic\", \"media\", \"preformat\", \"question\", \"question-wrap\", \"question-wrap-group\",\n            \"supplementary-material\", \"table-wrap\", \"table-wrap-group\",\n            \"alternatives\", \"disp-formula\", \"disp-formula-group\"]\n        lists = [\"def-list\", \"list\"]\n        formulae = [\"tex-math\", \"mml:math\"]\n        other = [\"p\", \"related-article\", \"related-object\", \"ack\", \"disp-quote\",\n            \"speech\", \"statement\", \"verse-group\", \"x\"]\n        canBeInline = [\"tex-math\", \"mml:math\", \"related-object\", \"x\"]\n        onlyOneChild x = length (allChildren x) == 1\n        allChildren x = filterChildren (const True) x\n\nisBlockElement _ = False\n\n-- Trim leading and trailing newline characters\ntrimNl :: Text -> Text\ntrimNl = T.dropAround (== '\\n')\n\n-- function that is used by both graphic (in parseBlock)\n-- and inline-graphic (in parseInline)\ngetGraphic :: PandocMonad m => Element -> JATS m Inlines\ngetGraphic e = do\n  let atVal a = attrValue a e\n  let altText = case filterElement (named \"alt-text\") e of\n         Just alt -> textContent alt\n         Nothing -> mempty\n      (ident, title, altText') = (atVal \"id\", atVal \"title\", text altText)\n      attr = (ident, T.words $ atVal \"role\", [])\n      imageUrl = atVal \"href\"\n  return $ imageWith attr imageUrl title altText'\n\ngetBlocks :: PandocMonad m => Element -> JATS m Blocks\ngetBlocks e =  mconcat <$>\n                 mapM parseBlock (elContent e)\n\n\nparseBlock :: PandocMonad m => Content -> JATS m Blocks\nparseBlock (Text (CData CDataRaw _ _)) = return mempty -- DOCTYPE\nparseBlock (Text (CData _ s _)) = if T.all isSpace s\n                                     then return mempty\n                                     else return $ plain $ trimInlines $ text s\nparseBlock (CRef x) = return $ plain $ str $ T.toUpper x\nparseBlock (Elem e) = do\n  sectionLevel <- gets jatsSectionLevel\n  let parseBlockWithHeader = wrapWithHeader (sectionLevel+1) (getBlocks e)\n\n  case qName (elName e) of\n        \"book\" -> parseBook\n        \"book-part-wrapper\" -> parseBook\n        \"p\" -> parseMixed para (elContent e)\n        \"code\" -> codeBlockWithLang\n        \"preformat\" -> codeBlockWithLang\n        \"disp-quote\" -> wrapWithHeader (sectionLevel+1) parseBlockquote\n        \"list\" ->  wrapWithHeader (sectionLevel+1) parseList\n        \"def-list\" -> wrapWithHeader (sectionLevel+1) (definitionList <$> deflistitems)\n        \"sec\" -> parseBlockWithHeader\n        \"abstract\" -> parseBlockWithHeader\n        \"ack\" -> parseBlockWithHeader\n        \"answer\" -> parseBlockWithHeader\n        \"answer-set\" -> parseBlockWithHeader\n        \"app\" -> parseBlockWithHeader\n        \"app-group\" -> parseBlockWithHeader\n        \"author-comment\" -> parseBlockWithHeader\n        \"author-notes\" -> parseBlockWithHeader\n        \"back\" -> parseBlockWithHeader\n        \"bio\" -> parseBlockWithHeader\n        \"explanation\" -> parseBlockWithHeader\n        \"glossary\" -> parseBlockWithHeader\n        \"kwd-group\" -> parseBlockWithHeader\n        \"list-item\" -> parseBlockWithHeader\n        \"notes\" -> parseBlockWithHeader\n        \"option\" -> parseBlockWithHeader\n        \"question\" -> parseBlockWithHeader\n        \"question-preamble\" -> parseBlockWithHeader\n        \"question-wrap-group\" -> parseBlockWithHeader\n        \"statement\" -> parseBlockWithHeader\n        \"supplement\" -> parseBlockWithHeader\n        \"table-wrap-foot\" -> parseBlockWithHeader\n        \"trans-abstract\" -> parseBlockWithHeader\n        \"verse-group\" -> parseBlockWithHeader\n        \"graphic\" -> para <$> getGraphic e\n        \"journal-meta\" -> parseMetadata e\n        \"article-meta\" -> parseMetadata e\n        \"custom-meta\" -> parseMetadata e\n        \"processing-meta\" -> return mempty\n        \"book-meta\" -> parseMetadata e\n        \"title\" -> return mempty -- processed by header\n        \"label\" -> return mempty -- processed by header\n        \"table\" -> parseTable\n        \"fig\" -> parseFigure\n        \"fig-group\" -> divWith (attrValue \"id\" e, [\"fig-group\"], [])\n                          <$> getBlocks e\n        \"table-wrap\" -> divWith (attrValue \"id\" e, [\"table-wrap\"], [])\n                          <$> getBlocks e\n        \"caption\" -> do\n          inFigure <- gets jatsInFigure\n          if inFigure -- handled by parseFigure\n             then return mempty\n             else divWith (attrValue \"id\" e, [\"caption\"], []) <$> wrapWithHeader 6 (getBlocks e)\n        \"fn-group\" -> parseFootnoteGroup\n        \"ref-list\" -> parseRefList e\n        \"alternatives\" -> if hasFormulaChild e\n                            then blockFormula displayMath e\n                            else getBlocks e\n        \"disp-formula\" -> if hasFormulaChild e\n                            then blockFormula displayMath e\n                            else divWith (attrValue \"id\" e, [\"disp-formula\"], [])\n                                    <$> getBlocks e\n        \"index\" -> parseBlockWithHeader\n        \"index-div\" -> parseBlockWithHeader\n        \"index-group\" -> parseBlockWithHeader\n        \"index-title-group\" -> return mempty -- handled by index and index-div\n        \"toc\" -> parseBlockWithHeader\n        \"toc-div\" -> parseBlockWithHeader\n        \"toc-entry\" -> parseBlockWithHeader\n        \"toc-group\" -> parseBlockWithHeader\n        \"toc-title-group\" -> return mempty -- handled by toc\n        \"legend\" -> parseBlockWithHeader\n        \"dedication\" -> parseBlockWithHeader\n        \"foreword\" -> parseBlockWithHeader\n        \"preface\" -> parseBlockWithHeader\n        \"?xml\"  -> return mempty\n        _       -> getBlocks e\n   where parseMixed container conts = do\n           let (ils,rest) = break isBlockElement conts\n           ils' <- trimInlines . mconcat <$> mapM parseInline ils\n           let p = if ils' == mempty then mempty else container ils'\n           case rest of\n                 []     -> return p\n                 (r:rs) -> do\n                    b <- parseBlock r\n                    x <- parseMixed container rs\n                    return $ p <> b <> x\n         codeBlockWithLang = do\n           let classes' = case attrValue \"language\" e of\n                                \"\" -> []\n                                x  -> [x]\n           return $ codeBlockWith (attrValue \"id\" e, classes', [])\n                  $ trimNl $ strContentRecursive e\n         parseBlockquote = do\n            attrib <- case filterChild (named \"attrib\") e of\n                             Nothing  -> return mempty\n                             Just z   -> para . (str \"— \" <>) . mconcat\n                                         <$>\n                                              mapM parseInline (elContent z)\n            contents <- getBlocks e\n            return $ blockQuote (contents <> attrib)\n         parseList = do\n            case attrValue \"list-type\" e of\n              \"bullet\" -> bulletList <$> listitems\n              listType -> do\n                let start =\n                      fromMaybe 1 $\n                        ( filterElement (named \"list-item\") e\n                            >>= filterElement (named \"label\")\n                        )\n                          >>= safeRead . textContent\n                orderedListWith (start, parseListStyleType listType, DefaultDelim)\n                  <$> listitems\n         parseListStyleType \"roman-lower\" = LowerRoman\n         parseListStyleType \"roman-upper\" = UpperRoman\n         parseListStyleType \"alpha-lower\" = LowerAlpha\n         parseListStyleType \"alpha-upper\" = UpperAlpha\n         parseListStyleType _             = DefaultStyle\n         listitems = mapM getBlocks $ filterChildren (named \"list-item\") e\n         deflistitems = mapM parseVarListEntry $ filterChildren\n                     (named \"def-item\") e\n         parseVarListEntry e' = do\n                     let terms = filterChildren (named \"term\") e'\n                     let items = filterChildren (named \"def\") e'\n                     terms' <- mapM getInlines terms\n                     items' <- mapM getBlocks items\n                     return (mconcat $ L.intersperse (str \"; \") terms', items')\n         parseFigure = do\n           modify $ \\st -> st{ jatsInFigure = True }\n           capt <- case filterChild (named \"caption\") e of\n                     Just t  -> mconcat . L.intersperse linebreak <$>\n                                mapM getInlines (filterChildren (const True) t)\n                     Nothing -> return mempty\n           contents <- getBlocks e\n           modify $ \\st -> st{ jatsInFigure = False }\n           return $ figureWith\n             (attrValue \"id\" e, [], [])\n             (simpleCaption $ plain capt)\n             contents\n         parseFootnoteGroup = do\n           forM_ (filterChildren (named \"fn\") e) $ \\fn -> do\n             let id' = attrValue \"id\" fn\n             contents <- getBlocks fn\n             modify $ \\st ->\n               st { jatsFootnotes = Map.insert id' contents (jatsFootnotes st) }\n           return mempty\n\n         parseTable = do\n                      let isCaption x = named \"title\" x || named \"caption\" x\n                      capt <- case filterChild isCaption e of\n                                    Just t  -> getInlines t\n                                    Nothing -> return mempty\n                      let e' = fromMaybe e $ filterChild (named \"tgroup\") e\n                      let isColspec x = named \"colspec\" x || named \"col\" x\n                      let colspecs = case filterChild (named \"colgroup\") e' of\n                                           Just c -> filterChildren isColspec c\n                                           _      -> filterChildren isColspec e'\n                      let isRow x = named \"row\" x || named \"tr\" x\n\n                      let parseRows elementWithRows =\n                            map parseElement $ filterChildren isRow elementWithRows\n\n                      -- list of list of body cell elements\n                      let multipleBodyRowElements =\n                            map parseRows $ filterChildren (named \"tbody\") e'\n\n                      -- list of list header cell elements\n                      let headRowElements = maybe [] parseRows (filterChild (named \"thead\") e')\n\n                      -- list of foot cell elements\n                      let footRowElements = maybe [] parseRows (filterChild (named \"tfoot\") e')\n\n                      let toAlignment c = case findAttr (unqual \"align\") c of\n                                                Just \"left\"   -> AlignLeft\n                                                Just \"right\"  -> AlignRight\n                                                Just \"center\" -> AlignCenter\n                                                _             -> AlignDefault\n                      let toColSpan element = fromMaybe 1 $\n                            findAttr (unqual \"colspan\") element >>= safeRead\n                      let toRowSpan element =  fromMaybe 1 $\n                            findAttr (unqual \"rowspan\") element >>= safeRead\n                      let toWidth c = do\n                            w <- findAttr (unqual \"colwidth\") c\n                            n <- safeRead $ \"0\" <> T.filter (\\x -> isDigit x || x == '.') w\n                            if n > 0 then Just n else Nothing\n                      let firstBody = fromMaybe [] (headMay multipleBodyRowElements)\n                      let numrows = L.foldl' max 0 $ map length firstBody\n                      let aligns = case colspecs of\n                                     [] -> replicate numrows AlignDefault\n                                     cs -> map toAlignment cs\n                      let widths = case colspecs of\n                                     [] -> replicate numrows ColWidthDefault\n                                     cs -> let ws = map toWidth cs\n                                           in case sequence ws of\n                                                Just ws' -> let tot = sum ws'\n                                                            in  ColWidth . (/ tot) <$> ws'\n                                                Nothing  -> replicate numrows ColWidthDefault\n                      let parseCell = parseMixed plain . elContent\n                      let elementToCell element = cell\n                            (toAlignment element)\n                            (RowSpan $ toRowSpan element)\n                            (ColSpan $ toColSpan element)\n                            <$> (parseCell element)\n                      let rowElementsToCells elements = mapM elementToCell elements\n                      let toRow = fmap (Row nullAttr) . rowElementsToCells\n                          toRows elements = mapM toRow elements\n\n                      headerRows <- toRows headRowElements\n                      footerRows <- toRows footRowElements\n                      bodyRows <- mapM toRows multipleBodyRowElements\n\n                      return $ table (simpleCaption $ plain capt)\n                                     (zip aligns widths)\n                                     (TableHead nullAttr headerRows)\n                                     (map (TableBody nullAttr 0 []) bodyRows)\n                                     (TableFoot nullAttr footerRows)\n         isEntry x  = named \"entry\" x || named \"td\" x || named \"th\" x\n         parseElement = filterChildren isEntry\n         wrapWithHeader n mBlocks = do\n                      isBook <- gets jatsBook\n                      let n' = case (filterChild (named \"title\") e >>= maybeAttrValue \"display-as\") of\n                                  Just t -> read $ T.unpack t\n                                  Nothing -> if isBook || n == 0 then n + 1 else n\n                      headerText <- case filterChild (named \"title\") e of\n                                       Just t  -> case maybeAttrValue \"suppress\" t of\n                                                     Just s -> if s == \"no\"\n                                                                 then getInlines t\n                                                                 else return mempty\n                                                     Nothing -> getInlines t\n                                       Nothing -> do\n                                           let name = qName (elName e)\n                                           if (name == \"dedication\" || name == \"foreword\" || name == \"preface\")\n                                             then return $ str $ T.toTitle name\n                                             else case filterChild (named \"index-title-group\") e >>= filterChild (named \"title\") of\n                                                     Just i -> getInlines i\n                                                     Nothing -> case filterChild (named \"toc-title-group\") e >>= filterChild (named \"title\") of\n                                                                   Just t -> getInlines t\n                                                                   Nothing -> return mempty\n                      oldN <- gets jatsSectionLevel\n                      modify $ \\st -> st{ jatsSectionLevel = n }\n                      blocks <- mBlocks\n                      let ident = attrValue \"id\" e\n                      modify $ \\st -> st{ jatsSectionLevel = oldN }\n                      return $ (if headerText == mempty\n                                  then mempty\n                                  else headerWith (ident,[],[]) n' headerText) <> blocks\n         parseBook = do\n           modify $ \\st -> st{ jatsBook = True }\n           getBlocks e\n\ngetInlines :: PandocMonad m => Element -> JATS m Inlines\ngetInlines e' = trimInlines . mconcat <$>\n                 mapM parseInline (elContent e')\n\nparseMetadata :: PandocMonad m => Element -> JATS m Blocks\nparseMetadata e = do\n  isBook <- gets jatsBook\n  if isBook then getBookTitle e else getArticleTitle e\n  if isBook then getBookAuthors e else getArticleAuthors e\n  getAffiliations e\n  getAbstract e\n  getPubDate e\n  getPermissions e\n  return mempty\n\ngetArticleTitle :: PandocMonad m => Element -> JATS m ()\ngetArticleTitle e = do\n  tit <-  case filterElement (named \"article-title\") e of\n               Just s  -> getInlines s\n               Nothing -> return mempty\n  subtit <-  case filterElement (named \"subtitle\") e of\n               Just s  -> (text \": \" <>) <$>\n                           getInlines s\n               Nothing -> return mempty\n  when (tit /= mempty) $ addMeta \"title\" tit\n  when (subtit /= mempty) $ addMeta \"subtitle\" subtit\n\n\ngetBookTitle :: PandocMonad m => Element -> JATS m ()\ngetBookTitle e = do\n  tit <-  case (filterElement (named \"book-title-group\") e >>= filterElement (named \"book-title\")) of\n               Just s  -> getInlines s\n               Nothing -> return mempty\n  subtit <-  case (filterElement (named \"book-title-group\") e >>= filterElement (named \"subtitle\")) of\n               Just s  -> (text \": \" <>) <$>\n                           getInlines s\n               Nothing -> return mempty\n  when (tit /= mempty) $ addMeta \"title\" tit\n  when (subtit /= mempty) $ addMeta \"subtitle\" subtit\n\ngetArticleAuthors :: PandocMonad m => Element -> JATS m ()\ngetArticleAuthors e = do\n  authors <- mapM getContrib $ filterElements\n              (\\x -> named \"contrib\" x &&\n                     attrValue \"contrib-type\" x == \"author\") e\n  authorNotes <- mapM getInlines $ filterElements (named \"author-notes\") e\n  let authors' = case (reverse authors, authorNotes) of\n                   ([], _)    -> []\n                   (_, [])    -> authors\n                   (a:as, ns) -> reverse as ++ [a <> mconcat ns]\n  unless (null authors) $ addMeta \"author\" authors'\n\ngetBookAuthors :: PandocMonad m => Element -> JATS m ()\ngetBookAuthors e = do\n  authors <- mapM getContrib $ filterElements (\\x -> named \"contrib-group\" x) e\n              >>= filterElements (\\x -> named \"contrib\" x &&\n                     attrValue \"contrib-type\" x == \"author\")\n  authorNotes <- mapM getInlines $ filterElements (named \"author-notes\") e\n  let authors' = case (reverse authors, authorNotes) of\n                   ([], _)    -> []\n                   (_, [])    -> authors\n                   (a:as, ns) -> reverse as ++ [a <> mconcat ns]\n  unless (null authors) $ addMeta \"author\" authors'\n\ngetAffiliations :: PandocMonad m => Element -> JATS m ()\ngetAffiliations x = do\n  affs <- mapM getInlines $ filterChildren (named \"aff\") x\n  unless (null affs) $ addMeta \"institute\" affs\n\ngetAbstract :: PandocMonad m => Element -> JATS m ()\ngetAbstract e =\n  case filterElement (named \"abstract\") e of\n    Just s -> do\n      blks <- getBlocks s\n      addMeta \"abstract\" blks\n    Nothing -> pure ()\n\ngetPubDate :: PandocMonad m => Element -> JATS m ()\ngetPubDate e =\n  case filterElement (named \"pub-date\") e of\n    Just d -> getDate d >>= addMeta \"date\" . text\n    Nothing -> pure ()\n\n-- extract a structured date and create an ISO-8901 string date from it\ngetDate :: PandocMonad m => Element -> JATS m Text\ngetDate e =\n  case maybeAttrValue \"iso-8601-date\" e of\n    Just isod -> pure isod\n    Nothing -> do\n      let extractDate :: Element -> Maybe Int\n          extractDate = safeRead . strContent\n      let yr = filterElement (named \"year\") e >>= extractDate\n      let mon = filterElement (named \"month\") e >>= extractDate\n      let day = filterElement (named \"day\") e >>= extractDate\n      let stringDate = strContent <$> filterElement (named \"string-date\") e\n      pure $\n        case (yr, mon, day) of\n          (Just y, Just m, Just d) -> T.pack $ printf \"%04d-%02d-%02d\" y m d\n          (Just y, Just m, Nothing) -> T.pack $ printf \"%04d-%02d\" y m\n          (Just y, Nothing, Nothing) -> T.pack $ printf \"%04d\" y\n          _ -> fromMaybe mempty stringDate\n\ngetPermissions :: PandocMonad m => Element -> JATS m ()\ngetPermissions e = do\n  copyright <- getCopyright e\n  license <-  case filterElement (named \"license\") e of\n               Just s  -> getLicense s\n               Nothing -> return mempty\n  when (copyright /= mempty) $ addMeta \"copyright\" copyright\n  when (license /= mempty) $ addMeta \"license\" license\n\ngetCopyright :: PandocMonad m => Element -> JATS m (Map.Map Text MetaValue)\ngetCopyright e = do\n  let holder = metaElement e \"copyright-holder\" \"holder\"\n  let statement = metaElement e \"copyright-statement\" \"statement\"\n  let year = metaElement e \"copyright-year\" \"year\"\n  return $ Map.fromList (catMaybes $ [holder, statement, year])\n\ngetLicense :: PandocMonad m => Element -> JATS m (Map.Map Text MetaValue)\ngetLicense e = do\n  let licenseType = metaAttribute e \"license-type\" \"type\"\n  let licenseLink = metaElementAliRef e \"link\"\n  let licenseText = metaElement e \"license-p\" \"text\"\n  return $ Map.fromList (catMaybes $ [licenseType, licenseLink, licenseText])\n\nmetaElement :: Element -> Text -> Text -> Maybe (Text, MetaValue)\nmetaElement e child key =\n  case filterElement (named child) e of\n    Just content -> Just (key, toMetaValue $ strContent content)\n    Nothing -> Nothing\n\nmetaElementAliRef :: Element -> Text -> Maybe (Text, MetaValue)\nmetaElementAliRef e key =\n  case filterElement isAliLicenseRef e of\n    Just content -> Just (key, toMetaValue $ strContent content)\n    Nothing -> Nothing\n\nmetaAttribute :: Element -> Text -> Text -> Maybe (Text, MetaValue)\nmetaAttribute e attr key =\n  case maybeAttrValue attr e of\n    Just content -> Just (key, toMetaValue content)\n    Nothing -> Nothing\n\ngetContrib :: PandocMonad m => Element -> JATS m Inlines\ngetContrib x = do\n  given <- maybe (return mempty) getInlines\n            $ filterElement (named \"given-names\") x\n  family <- maybe (return mempty) getInlines\n            $ filterElement (named \"surname\") x\n  if given == mempty && family == mempty\n     then return mempty\n     else if given == mempty || family == mempty\n          then return $ given <> family\n          else return $ given <> space <> family\n\nparseRefList :: PandocMonad m => Element -> JATS m Blocks\nparseRefList e = do\n  refs <- mapM parseRef $ filterChildren (named \"ref\") e\n  let mbtitle = filterChild (named \"title\") e\n  title <- case mbtitle of\n    Nothing -> pure mempty\n    Just te -> header 1 <$> parseInline (Elem te)\n  addMeta \"references\" refs\n  return $ title <> divWith (\"refs\",[],[]) mempty\n\nparseRef :: PandocMonad m\n         => Element -> JATS m (Map.Map Text MetaValue)\nparseRef e = do\n  let combineWithDash x y = x <> text \"-\" <> y\n  let getName nm = do\n        given <- maybe (return mempty) getInlines\n                  $ filterChild (named \"given-names\") nm\n        family <- maybe (return mempty) getInlines\n                  $ filterChild (named \"surname\") nm\n        return $ toMetaValue $ Map.fromList [\n            (\"given\" :: Text, given)\n          , (\"family\", family)\n          ]\n  let refElement :: PandocMonad m\n                 => Element -> Element -> JATS m (Maybe (Text, MetaValue))\n      refElement c el =\n        case qName (elName el) of\n          \"article-title\" -> Just . (\"title\",) . toMetaValue <$> getInlines el\n          \"source\" ->\n            case filterChild (named \"article-title\") c of\n              Just _ -> Just . (\"container-title\",) . toMetaValue <$> getInlines el\n              Nothing -> Just . (\"title\",) . toMetaValue <$> getInlines el\n          \"label\" -> Just . (\"citation-label\",) . toMetaValue <$> getInlines el\n          \"year\" -> case filterChild (named \"month\") c of\n                      Just m -> Just . (\"issued\",) . toMetaValue <$>\n                                 (combineWithDash\n                                    <$> getInlines el <*> getInlines m)\n                      Nothing -> Just . (\"issued\",) . toMetaValue <$> getInlines el\n          \"volume\" -> Just . (\"volume\",) . toMetaValue <$> getInlines el\n          \"issue\" -> Just . (\"issue\",) . toMetaValue <$> getInlines el\n          \"isbn\" -> Just . (\"ISBN\",) . toMetaValue <$> getInlines el\n          \"issn\" -> Just . (\"ISSN\",) . toMetaValue <$> getInlines el\n          \"uri\" -> Just . (\"url\",) . toMetaValue <$> getInlines el\n          \"fpage\" ->\n            case filterChild (named \"lpage\") c of\n              Just lp -> Just . (\"page\",) . toMetaValue <$>\n                          (combineWithDash <$> getInlines el <*> getInlines lp)\n              Nothing -> Just . (\"page-first\",) . toMetaValue <$> getInlines el\n          \"publisher-name\" -> Just . (\"publisher\",) . toMetaValue <$> getInlines el\n          \"publisher-loc\" -> Just . (\"publisher-place\",) . toMetaValue\n                                <$> getInlines el\n          \"edition\" -> pure $ Just (\"edition\",\n                               toMetaValue . T.filter isDigit $ strContent el)\n          \"person-group\" -> do names <- mapM getName\n                                            (filterChildren (named \"name\") el)\n                               pure $ Just (attrValue \"person-group-type\" el,\n                                            toMetaValue names)\n          \"pub-id\" -> case attrValue \"pub-id-type\" el of\n                         \"doi\"  -> pure $ Just (\"DOI\",  toMetaValue $ strContent el)\n                         \"pmid\" -> pure $ Just (\"PMID\", toMetaValue $ strContent el)\n                         _      -> pure Nothing\n          \"object-id\" -> case attrValue \"pub-id-type\" el of\n                         \"doi\"  -> pure $ Just (\"DOI\",  toMetaValue $ strContent el)\n                         \"pmid\" -> pure $ Just (\"PMID\", toMetaValue $ strContent el)\n                         _      -> pure Nothing\n\n\n          _ -> pure Nothing\n  refVariables <-\n    case filterChild (named \"element-citation\") e of\n      Just c -> ((\"type\", toMetaValue $ case attrValue \"publication-type\" c of\n                            \"journal\" -> \"article-journal\"\n                            x -> x) :) .\n                  catMaybes <$> mapM (refElement c) (elChildren c)\n      Nothing -> pure []   -- TODO handle mixed-citation\n  -- allows round-tripping, since JATS writer puts ref- in front of citation ids:\n  let stripPref t = fromMaybe t $ T.stripPrefix \"ref-\" t\n  return $ Map.fromList ((\"id\", toMetaValue $ stripPref $ attrValue \"id\" e)\n                        : refVariables)\n\ntextContent :: Element -> Text\ntextContent = strContent\n\nstrContentRecursive :: Element -> Text\nstrContentRecursive = strContent .\n  (\\e' -> e'{ elContent = map elementToStr $ elContent e' })\n\nelementToStr :: Content -> Content\nelementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing\nelementToStr x = x\n\nparseInline :: PandocMonad m => Content -> JATS m Inlines\nparseInline (Text (CData _ s _)) = return $ text s\nparseInline (CRef ref) = return $ maybe (text $ T.toUpper ref) text\n                                $ lookupEntity ref\nparseInline (Elem e) =\n  case qName (elName e) of\n        \"italic\" -> innerInlines emph\n        \"bold\" -> innerInlines strong\n        \"strike\" -> innerInlines strikeout\n        \"sub\" -> innerInlines subscript\n        \"sup\" -> innerInlines superscript\n        \"underline\" -> innerInlines underline\n        \"break\" -> return linebreak\n        \"sc\" -> innerInlines smallcaps\n\n        \"code\" -> codeWithLang\n        \"monospace\" -> codeWithLang\n\n        \"inline-graphic\" -> getGraphic e\n        \"disp-quote\" -> do\n            qt <- gets jatsQuoteType\n            let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote\n            modify $ \\st -> st{ jatsQuoteType = qt' }\n            contents <- innerInlines id\n            modify $ \\st -> st{ jatsQuoteType = qt }\n            return $ if qt == SingleQuote\n                        then singleQuoted contents\n                        else doubleQuoted contents\n\n        \"xref\" -> do\n            ils <- innerInlines id\n            let rid = attrValue \"rid\" e\n            let rids = T.words rid\n            let refType = (\"ref-type\",) <$> maybeAttrValue \"ref-type\" e\n            let attr = (attrValue \"id\" e, [], maybeToList refType)\n            return $ if refType == Just (\"ref-type\",\"bibr\")\n                        then cite\n                             (map (\\id' ->\n                               let id'' = fromMaybe id' $\n                                           T.stripPrefix \"ref-\" id'\n                                 in Citation { citationId = id''\n                                             , citationPrefix = []\n                                             , citationSuffix = []\n                                             , citationMode = NormalCitation\n                                             , citationNoteNum = 0\n                                             , citationHash = 0}) rids)\n                             ils\n                        else linkWith attr (\"#\" <> rid) \"\" ils\n        \"ext-link\" -> do\n             ils <- innerInlines id\n             let title = fromMaybe \"\" $ findAttr (QName \"title\" (Just \"http://www.w3.org/1999/xlink\") Nothing) e\n             let href = case findAttr (QName \"href\" (Just \"http://www.w3.org/1999/xlink\") Nothing) e of\n                               Just h -> h\n                               _      -> \"#\" <> attrValue \"rid\" e\n             let ils' = if ils == mempty then str href else ils\n             let attr = (attrValue \"id\" e, [], [])\n             return $ linkWith attr href title ils'\n\n        \"alternatives\" -> if hasFormulaChild e\n                            then inlineFormula math e\n                            else innerInlines id\n        \"disp-formula\" -> inlineFormula displayMath e\n        \"inline-formula\" -> inlineFormula math e\n        \"math\" | qURI (elName e) == Just \"http://www.w3.org/1998/Math/MathML\"\n                   -> return . math $ mathML e\n        \"tex-math\" -> return . math $ textContent e\n\n        \"email\" -> return $ link (\"mailto:\" <> textContent e) \"\"\n                          $ str $ textContent e\n        \"uri\" -> return $ link (textContent e) \"\" $ str $ textContent e\n        \"fn\" -> note . mconcat <$>\n                         mapM parseBlock (elContent e)\n        _          -> innerInlines id\n   where innerInlines f = f . mconcat <$> mapM parseInline (elContent e)\n         codeWithLang = do\n           let classes' = case attrValue \"language\" e of\n                               \"\" -> []\n                               l  -> [l]\n           return $ codeWith (attrValue \"id\" e,classes',[]) $ strContentRecursive e\n\ninlineFormula ::  PandocMonad m => (Text->Inlines) -> Element -> JATS m Inlines\ninlineFormula constructor e = do\n            let whereToLook = fromMaybe e $ filterElement (named \"alternatives\") e\n                texMaths = map textContent $\n                            filterChildren (named  \"tex-math\") whereToLook\n                mathMLs = map mathML $\n                            filterChildren isMathML whereToLook\n            return . mconcat . take 1 . map constructor $ texMaths ++ mathMLs\n\nblockFormula ::  PandocMonad m => (Text->Inlines) -> Element -> JATS m Blocks\nblockFormula constructor e = do\n            let whereToLook = fromMaybe e $ filterElement (named \"alternatives\") e\n                texMaths = map textContent $\n                            filterChildren (named  \"tex-math\") whereToLook\n                mathMLs = map mathML $\n                            filterChildren isMathML whereToLook\n            case texMaths ++ mathMLs of\n              [] -> return mempty\n              (m:_) -> return $ para (constructor m)\n\nmathML :: Element -> Text\nmathML x =\n          case readMathML . showElement $ everywhere (mkT removePrefix) x of\n                Left _ -> mempty\n                Right m -> writeTeX m\n          where removePrefix elname = elname { qPrefix = Nothing }\n\nisMathML :: Element -> Bool\nisMathML x = qName (elName x) == \"math\" &&\n                      qURI  (elName x) ==\n                                      Just \"http://www.w3.org/1998/Math/MathML\"\n\nformulaChildren :: Element -> [Element]\nformulaChildren x = filterChildren isMathML x ++ filterChildren (named \"tex-math\") x\n\nhasFormulaChild :: Element -> Bool\nhasFormulaChild x = length (formulaChildren x) > 0\n\nisAliLicenseRef :: Element -> Bool\nisAliLicenseRef x = qName (elName x) == \"license_ref\" &&\n                      qURI  (elName x) ==\n                                      Just \"http://www.niso.org/schemas/ali/1.0/\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Jira.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Jira\n   Copyright   : © 2019-2024 Albert Krewinkel\n   License     : GPL-2.0-or-later\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nConversion of jira wiki formatted plain text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Jira ( readJira ) where\n\nimport Control.Monad.Except (throwError)\nimport Data.List (partition)\nimport Data.Text (Text, append, pack, singleton)\nimport Text.Pandoc.XML (lookupEntity)\nimport Text.Jira.Parser (parse)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Builder hiding (cell)\nimport Text.Pandoc.Error (PandocError (PandocParseError))\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Shared (stringify)\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\nimport qualified Text.Jira.Markup as Jira\n\n-- | Read Jira wiki markup.\nreadJira :: (PandocMonad m, ToSources a)\n         => ReaderOptions\n         -> a\n         -> m Pandoc\nreadJira _opts inp = do\n  let sources = toSources inp\n  case parse (sourcesToText sources) of\n    Right d -> return $ jiraToPandoc d\n    Left e  -> throwError . PandocParseError $\n               \"Jira parse error\" `append` pack (show e)\n\njiraToPandoc :: Jira.Doc -> Pandoc\njiraToPandoc (Jira.Doc blks) = doc $ foldMap jiraToPandocBlocks blks\n\n--\n-- Blocks\n--\n\n-- | Converts a Jira block to a Pandoc block.\njiraToPandocBlocks :: Jira.Block -> Blocks\njiraToPandocBlocks = \\case\n  Jira.BlockQuote blcks -> blockQuote $ foldMap jiraToPandocBlocks blcks\n  Jira.Code lang ps txt -> toPandocCodeBlocks (Just lang) ps txt\n  Jira.Color c blcks    -> divWith (mempty, mempty, [(\"color\", colorName c)]) $\n                           foldMap jiraToPandocBlocks blcks\n  Jira.Header lvl inlns -> header lvl $ foldMap jiraToPandocInlines inlns\n  Jira.HorizontalRule   -> horizontalRule\n  Jira.List style items -> toPandocList style items\n  Jira.NoFormat ps txt  -> toPandocCodeBlocks Nothing ps txt\n  Jira.Panel ps blcks   -> toPandocDiv ps blcks\n  Jira.Para inlns       -> para $ foldMap jiraToPandocInlines inlns\n  Jira.Table rows       -> toPandocTable rows\n\n-- | Create a pandoc list – either to a @'BulletList'@ or an @'OrderedList'@.\ntoPandocList :: Jira.ListStyle -> [[Jira.Block]] -> Blocks\ntoPandocList style items =\n  let items' = map (foldMap jiraToPandocBlocks) items\n  in if style == Jira.Enumeration\n     then orderedList items'\n     else bulletList items'\n\n-- | Create a pandoc @'CodeBlock'@\ntoPandocCodeBlocks :: Maybe Jira.Language -> [Jira.Parameter] -> Text -> Blocks\ntoPandocCodeBlocks langMay params txt =\n  let classes = case langMay of\n                  Just (Jira.Language lang) -> [lang]\n                  Nothing                   -> []\n  in codeBlockWith (\"\", classes, map paramToPair params) txt\n\n-- | Create a pandoc @'Div'@ from a panel.\ntoPandocDiv :: [Jira.Parameter] -> [Jira.Block] -> Blocks\ntoPandocDiv params =\n  let (titles, params') = partition ((== \"title\") . Jira.parameterKey) params\n      addTitle = case titles of\n        [] ->\n          id\n        (title:_) -> \\blks ->\n          (divWith (\"\", [\"panelheader\"], []) . plain . strong $\n           text (Jira.parameterValue title)) <> blks\n  in divWith (\"\", [\"panel\"], map paramToPair params')\n     . addTitle\n     . foldMap jiraToPandocBlocks\n\nparamToPair :: Jira.Parameter -> (Text, Text)\nparamToPair (Jira.Parameter key value) = (key, value)\n\n-- | Give textual representation of a color.\ncolorName :: Jira.ColorName -> Text\ncolorName (Jira.ColorName name) = name\n\n-- | Create a pandoc @'Table'@.\n-- This relies on 'simpleTable' to sanitize the table.\ntoPandocTable :: [Jira.Row] -> Blocks\ntoPandocTable rows =\n  let (headerRow, bodyRows) = splitIntoHeaderAndBody rows\n  in simpleTable\n       (rowToBlocksList headerRow)\n       (map rowToBlocksList bodyRows)\n\nrowToBlocksList :: Jira.Row -> [Blocks]\nrowToBlocksList (Jira.Row cells) =\n  map cellContent cells\n  where\n    cellContent cell = let content = case cell of\n                             Jira.HeaderCell x -> x\n                             Jira.BodyCell x   -> x\n                       in foldMap jiraToPandocBlocks content\n\nsplitIntoHeaderAndBody :: [Jira.Row] -> (Jira.Row, [Jira.Row])\nsplitIntoHeaderAndBody [] = (Jira.Row [], [])\nsplitIntoHeaderAndBody rows@(first@(Jira.Row cells) : rest) =\n  let isHeaderCell Jira.HeaderCell{} = True\n      isHeaderCell Jira.BodyCell{}   = False\n  in if all isHeaderCell cells\n     then (first, rest)\n     else (Jira.Row [], rows)\n\n--\n-- Inlines\n--\n\n-- | Converts a Jira inline to a Pandoc block.\njiraToPandocInlines :: Jira.Inline -> Inlines\njiraToPandocInlines = \\case\n  Jira.Anchor t          -> spanWith (t, [], []) mempty\n  Jira.AutoLink url      -> link (Jira.fromURL url) \"\" (str (Jira.fromURL url))\n  Jira.Citation ils      -> str \"—\" <> space <> emph (fromInlines ils)\n  Jira.ColorInline c ils -> spanWith (\"\", [], [(\"color\", colorName c)]) $\n                                     fromInlines ils\n  Jira.Emoji icon        -> str . iconUnicode $ icon\n  Jira.Entity entity     -> str . fromEntity $ entity\n  Jira.Image params url  -> let (title, attr) = imgParams params\n                            in imageWith attr (Jira.fromURL url) title mempty\n  Jira.Link lt alias url -> jiraLinkToPandoc lt alias url\n  Jira.Linebreak         -> linebreak\n  Jira.Monospaced inlns  -> code . stringify . toList . fromInlines $ inlns\n  Jira.Space             -> space\n  Jira.SpecialChar c     -> str (Data.Text.singleton c)\n  Jira.Str t             -> str t\n  Jira.Styled style inlns -> fromStyle style $ fromInlines inlns\n  where\n    fromInlines  = foldMap jiraToPandocInlines\n    fromEntity e = case lookupEntity (e <> \";\") of\n                     Nothing -> \"&\" `append` e `append` \";\"\n                     Just t ->t\n\n    fromStyle = \\case\n      Jira.Emphasis    -> emph\n      Jira.Insert      -> underline\n      Jira.Strikeout   -> strikeout\n      Jira.Strong      -> strong\n      Jira.Subscript   -> subscript\n      Jira.Superscript -> superscript\n\n    imgParams :: [Jira.Parameter] -> (Text, Attr)\n    imgParams = foldr addImgParam (\"\", (\"\", [], []))\n\n    addImgParam :: Jira.Parameter -> (Text, Attr) -> (Text, Attr)\n    addImgParam p (title, attr@(ident, classes, kvs)) =\n      case Jira.parameterKey p of\n        \"title\"     -> (Jira.parameterValue p, attr)\n        \"thumbnail\" -> (title, (ident, \"thumbnail\":classes, kvs))\n        _           -> let kv = (Jira.parameterKey p, Jira.parameterValue p)\n                       in (title, (ident, classes, kv:kvs))\n\n-- | Convert a Jira link to pandoc inlines.\njiraLinkToPandoc :: Jira.LinkType -> [Jira.Inline] -> Jira.URL -> Inlines\njiraLinkToPandoc linkType alias url =\n  let url' = (if linkType == Jira.User then (\"~\" <>) else id) $ Jira.fromURL url\n      alias' = case alias of\n                 [] -> str url'\n                 _  -> foldMap jiraToPandocInlines alias\n  in case linkType of\n    Jira.External   -> link url' \"\" alias'\n    Jira.Email      -> link (\"mailto:\" <> url') \"\" alias'\n    Jira.Attachment -> linkWith (\"\", [\"attachment\"], []) url' \"\" alias'\n    Jira.User       -> linkWith (\"\", [\"user-account\"], []) url' \"\" alias'\n    Jira.SmartCard  -> linkWith (\"\", [\"smart-card\"], []) url' \"\" alias'\n    Jira.SmartLink  -> linkWith (\"\", [\"smart-link\"], []) url' \"\" alias'\n\n-- | Get unicode representation of a Jira icon.\niconUnicode :: Jira.Icon -> Text\niconUnicode = \\case\n  Jira.IconSlightlySmiling -> \"🙂\"\n  Jira.IconFrowning        -> \"🙁\"\n  Jira.IconTongue          -> \"😛\"\n  Jira.IconSmiling         -> \"😃\"\n  Jira.IconWinking         -> \"😉\"\n  Jira.IconThumbsUp        -> \"👍\"\n  Jira.IconThumbsDown      -> \"👎\"\n  Jira.IconInfo            -> \"ℹ\"\n  Jira.IconCheckmark       -> \"✔\"\n  Jira.IconX               -> \"❌\"\n  Jira.IconAttention       -> \"❗\"\n  Jira.IconPlus            -> \"➕\"\n  Jira.IconMinus           -> \"➖\"\n  Jira.IconQuestionmark    -> \"❓\"\n  Jira.IconOn              -> \"💡\"\n  Jira.IconOff             -> \"🌙\"\n  Jira.IconStar            -> \"⭐\"\n  Jira.IconStarRed         -> \"⭐\"\n  Jira.IconStarGreen       -> \"⭐\"\n  Jira.IconStarBlue        -> \"⭐\"\n  Jira.IconStarYellow      -> \"⭐\"\n  Jira.IconFlag            -> \"⚑\"\n  Jira.IconFlagOff         -> \"⚐\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Citation.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Readers.LaTeX.Citation\n  ( citationCommands\n  , cites\n  )\nwhere\n\nimport Text.Pandoc.Class\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.Builder as B\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport Control.Applicative ((<|>), optional, many)\nimport Control.Monad (mzero)\nimport Control.Monad.Trans (lift)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Parsing hiding (blankline, many, mathDisplay, mathInline,\n                            optional, space, spaces, withRaw, (<|>))\n\ncitationCommands :: PandocMonad m => LP m Inlines -> M.Map Text (LP m Inlines)\ncitationCommands inline =\n  let citation = citationWith inline\n      tok = spaces *> grouped inline\n   in M.fromList\n  [ (\"cite\", citation \"cite\" NormalCitation False)\n  , (\"Cite\", citation \"Cite\" NormalCitation False)\n  , (\"citep\", citation \"citep\" NormalCitation False)\n  , (\"citep*\", citation \"citep*\" NormalCitation False)\n  , (\"citeal\", citation \"citeal\" NormalCitation False)\n  , (\"citealp\", citation \"citealp\" NormalCitation False)\n  , (\"citealp*\", citation \"citealp*\" NormalCitation False)\n  , (\"autocite\", citation \"autocite\" NormalCitation False)\n  , (\"smartcite\", citation \"smartcite\" NormalCitation False)\n  , (\"footcite\", inNote <$> citation \"footcite\" NormalCitation False)\n  , (\"parencite\", citation \"parencite\" NormalCitation False)\n  , (\"supercite\", citation \"supercite\" NormalCitation False)\n  , (\"footcitetext\", inNote <$> citation \"footcitetext\" NormalCitation False)\n  , (\"citeyearpar\", citation \"citeyearpar\" SuppressAuthor False)\n  , (\"citeyear\", citation \"citeyear\" SuppressAuthor False)\n  , (\"autocite*\", citation \"autocite*\" SuppressAuthor False)\n  , (\"cite*\", citation \"cite*\" SuppressAuthor False)\n  , (\"parencite*\", citation \"parencite*\" SuppressAuthor False)\n  , (\"textcite\", citation \"textcite\" AuthorInText False)\n  , (\"citet\", citation \"citet\" AuthorInText False)\n  , (\"citet*\", citation \"citet*\" AuthorInText False)\n  , (\"citealt\", citation \"citealt\" AuthorInText False)\n  , (\"citealt*\", citation \"citealt*\" AuthorInText False)\n  , (\"textcites\", citation \"textcites\" AuthorInText True)\n  , (\"cites\", citation \"cites\" NormalCitation True)\n  , (\"autocites\", citation \"autocites\" NormalCitation True)\n  , (\"footcites\", inNote <$> citation \"footcites\" NormalCitation True)\n  , (\"parencites\", citation \"parencites\" NormalCitation True)\n  , (\"supercites\", citation \"supercites\" NormalCitation True)\n  , (\"footcitetexts\", inNote <$> citation \"footcitetexts\" NormalCitation True)\n  , (\"Autocite\", citation \"Autocite\" NormalCitation False)\n  , (\"Smartcite\", citation \"Smartcite\" NormalCitation False)\n  , (\"Footcite\", inNote <$> citation \"Footcite\" NormalCitation False)\n  , (\"Parencite\", citation \"Parencite\" NormalCitation False)\n  , (\"Supercite\", citation \"Supercite\" NormalCitation False)\n  , (\"Footcitetext\", inNote <$> citation \"Footcitetext\" NormalCitation False)\n  , (\"Citeyearpar\", citation \"Citeyearpar\" SuppressAuthor False)\n  , (\"Citeyear\", citation \"Citeyear\" SuppressAuthor False)\n  , (\"Autocite*\", citation \"Autocite*\" SuppressAuthor False)\n  , (\"Cite*\", citation \"Cite*\" SuppressAuthor False)\n  , (\"Parencite*\", citation \"Parencite*\" SuppressAuthor False)\n  , (\"Textcite\", citation \"Textcite\" AuthorInText False)\n  , (\"Textcites\", citation \"Textcites\" AuthorInText True)\n  , (\"Cites\", citation \"Cites\" NormalCitation True)\n  , (\"Autocites\", citation \"Autocites\" NormalCitation True)\n  , (\"Footcites\", inNote <$> citation \"Footcites\" NormalCitation True)\n  , (\"Parencites\", citation \"Parencites\" NormalCitation True)\n  , (\"Supercites\", citation \"Supercites\" NormalCitation True)\n  , (\"Footcitetexts\", inNote <$> citation \"Footcitetexts\" NormalCitation True)\n  , (\"citetext\", complexNatbibCitation inline NormalCitation)\n  , (\"citeauthor\", (try (tok *> sp *> controlSeq \"citetext\") *>\n                        complexNatbibCitation inline AuthorInText)\n                   <|> citation \"citeauthor\" AuthorInText False)\n  , (\"nocite\", mempty <$ (citation \"nocite\" NormalCitation False >>=\n                          addMeta \"nocite\"))\n  ]\n\n-- citations\n\naddPrefix :: [Inline] -> [Citation] -> [Citation]\naddPrefix p (k:ks) = k {citationPrefix = p ++ citationPrefix k} : ks\naddPrefix _ _      = []\n\naddSuffix :: [Inline] -> [Citation] -> [Citation]\naddSuffix s ks@(_:_) =\n  let k = last ks\n  in  init ks ++ [k {citationSuffix = citationSuffix k ++ s}]\naddSuffix _ _ = []\n\nsimpleCiteArgs :: forall m . PandocMonad m => LP m Inlines -> LP m [Citation]\nsimpleCiteArgs inline = try $ do\n  first  <- optionMaybe $ toList <$> opt\n  second <- optionMaybe $ toList <$> opt\n  keys <- try $ bgroup *> manyTill citationLabel egroup\n  let (pre, suf) = case (first  , second ) of\n        (Just s , Nothing) -> (mempty, s )\n        (Just s , Just t ) -> (s , t )\n        _                  -> (mempty, mempty)\n      conv k = Citation { citationId      = k\n                        , citationPrefix  = []\n                        , citationSuffix  = []\n                        , citationMode    = NormalCitation\n                        , citationHash    = 0\n                        , citationNoteNum = 0\n                        }\n  return $ addPrefix pre $ addSuffix suf $ map conv keys\n where\n  opt :: PandocMonad m => LP m Inlines\n  opt = do\n    toks <- try (sp *> bracketedToks <* sp)\n    -- now parse the toks as inlines\n    st <- getState\n    parsed <- lift $\n      runParserT (mconcat <$> many inline) st \"bracketed option\"\n       (TokStream False toks)\n    case parsed of\n      Right result -> return result\n      Left e       -> throwError $ fromParsecError (toSources toks) e\n\n\n\ncitationLabel :: PandocMonad m => LP m Text\ncitationLabel  = do\n  sp\n  untokenize <$>\n    (many1 (satisfyTok isWordTok <|> symbolIn bibtexKeyChar)\n          <* sp\n          <* optional (symbol ',')\n          <* sp)\n  where bibtexKeyChar = \".:;?!`'()/*@_+=-&[]\" :: [Char]\n\ncites :: PandocMonad m\n      => LP m Inlines -> CitationMode -> Bool -> LP m [Citation]\ncites inline mode multi = try $ do\n  let paropt = parenWrapped inline\n  cits <- if multi\n             then do\n               multiprenote <- optionMaybe $ toList <$> paropt\n               multipostnote <- optionMaybe $ toList <$> paropt\n               let (pre, suf) = case (multiprenote, multipostnote) of\n                     (Just s , Nothing) -> (mempty, s)\n                     (Nothing , Just t) -> (mempty, t)\n                     (Just s , Just t ) -> (s, t)\n                     _                  -> (mempty, mempty)\n               tempCits <- many1 $ simpleCiteArgs inline\n               case tempCits of\n                 (k:ks) -> case ks of\n                             (_:_) -> return $ (addMprenote pre k : init ks) ++\n                                                 [addMpostnote suf (last ks)]\n                             _ -> return [addMprenote pre (addMpostnote suf k)]\n                 _ -> return [[]]\n             else count 1 $ simpleCiteArgs inline\n  let cs = concat cits\n  return $ case mode of\n        AuthorInText -> case cs of\n                             (c:rest) -> c {citationMode = mode} : rest\n                             []       -> []\n        _            -> map (\\a -> a {citationMode = mode}) cs\n  where mprenote (k:ks) = (k:ks) ++ [Space]\n        mprenote _ = mempty\n        mpostnote (k:ks) = [Str \",\", Space] ++ (k:ks)\n        mpostnote _ = mempty\n        addMprenote mpn (k:ks) =\n          let mpnfinal = case citationPrefix k of\n                           (_:_) -> mprenote mpn\n                           _ -> mpn\n          in addPrefix mpnfinal (k:ks)\n        addMprenote _ _ = []\n        addMpostnote = addSuffix . mpostnote\n\ncitationWith :: PandocMonad m\n             => LP m Inlines -> Text -> CitationMode -> Bool -> LP m Inlines\ncitationWith inline name mode multi = do\n  (c,raw) <- withRaw $ cites inline mode multi\n  return $ cite c (rawInline \"latex\" $ \"\\\\\" <> name <> untokenize raw)\n\nhandleCitationPart :: Inlines -> [Citation]\nhandleCitationPart ils =\n  let isCite Cite{} = True\n      isCite _      = False\n      (pref, rest) = break isCite (toList ils)\n  in case rest of\n          (Cite cs _:suff) -> addPrefix pref $ addSuffix suff cs\n          _                -> []\n\ncomplexNatbibCitation :: PandocMonad m\n                      => LP m Inlines -> CitationMode -> LP m Inlines\ncomplexNatbibCitation inline mode = try $ do\n  (cs, raw) <-\n    withRaw $ concat <$> do\n      bgroup\n      items <- mconcat <$>\n                many1 (notFollowedBy (symbol ';') >> inline)\n                  `sepBy1` symbol ';'\n      egroup\n      return $ map handleCitationPart items\n  case cs of\n       []       -> mzero\n       (c:cits) -> return $ cite (c{ citationMode = mode }:cits)\n                      (rawInline \"latex\" $ \"\\\\citetext\" <> untokenize raw)\n\ninNote :: Inlines -> Inlines\ninNote ils =\n  note $ para $ ils <> str \".\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Inline.hs",
    "content": "{-# LANGUAGE OverloadedStrings     #-}\n{-# LANGUAGE ViewPatterns          #-}\n{- |\n   Module      : Text.Pandoc.Readers.LaTeX.Inline\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.Readers.LaTeX.Inline\n  ( acronymCommands\n  , verbCommands\n  , charCommands\n  , accentCommands\n  , miscCommands\n  , nameCommands\n  , biblatexInlineCommands\n  , refCommands\n  , rawInlineOr\n  , listingsLanguage\n  )\nwhere\n\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Shared (toRomanNumeral, safeRead)\nimport Text.Pandoc.TeX (Tok (..), TokType (..))\nimport Control.Applicative (optional, (<|>))\nimport Control.Monad (guard, mzero, mplus, unless)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Translations (translateTerm)\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.Extensions (extensionEnabled, Extension(..))\nimport Text.Pandoc.Parsing (getOption, updateState, getState, notFollowedBy,\n                            manyTill, getInput, setInput, incSourceColumn,\n                            option, many1)\nimport Data.Char (isDigit)\nimport Text.Pandoc.Highlighting (fromListingsLanguage,)\nimport Data.Maybe (maybeToList, fromMaybe)\nimport Text.Pandoc.Options (ReaderOptions(..))\nimport qualified Data.Text.Normalize as Normalize\nimport qualified Text.Pandoc.Translations as Translations\n\nrawInlineOr :: PandocMonad m => Text -> LP m Inlines -> LP m Inlines\nrawInlineOr name' fallback = do\n  parseRaw <- extensionEnabled Ext_raw_tex <$> getOption readerExtensions\n  if parseRaw\n     then rawInline \"latex\" <$> getRawCommand name' (\"\\\\\" <> name')\n     else fallback\n\ndolabel :: PandocMonad m => LP m Inlines\ndolabel = do\n  v <- braced\n  let refstr = untokenize v\n  updateState $ \\st ->\n    st{ sLastLabel = Just refstr }\n  return $ spanWith (refstr,[],[(\"label\", refstr)]) mempty\n\ndoref :: PandocMonad m => Text -> LP m Inlines\ndoref cls = do\n  v <- braced\n  let refstr = untokenize v\n  return $ linkWith (\"\",[],[ (\"reference-type\", cls)\n                           , (\"reference\", refstr)])\n                    (\"#\" <> refstr)\n                    \"\"\n                    (inBrackets $ str refstr)\n\ninBrackets :: Inlines -> Inlines\ninBrackets x = str \"[\" <> x <> str \"]\"\n\ndoTerm :: PandocMonad m => Translations.Term -> LP m Inlines\ndoTerm term = str <$> translateTerm term\n\nlit :: Text -> LP m Inlines\nlit = pure . str\n\ndoverb :: PandocMonad m => LP m Inlines\ndoverb = do\n  Tok _ Symbol t <- anySymbol\n  marker <- case T.uncons t of\n              Just (c, ts) | T.null ts -> return c\n              _            -> mzero\n  withVerbatimMode $\n    code . untokenize <$>\n      manyTill (notFollowedBy newlineTok >> verbTok marker) (symbol marker)\n\nverbTok :: PandocMonad m => Char -> LP m Tok\nverbTok stopchar = do\n  t@(Tok pos toktype txt) <- anyTok\n  case T.findIndex (== stopchar) txt of\n       Nothing -> return t\n       Just i  -> do\n         let (t1, t2) = T.splitAt i txt\n         TokStream macrosExpanded inp <- getInput\n         setInput $ TokStream macrosExpanded\n                  $ Tok (incSourceColumn pos i) Symbol (T.singleton stopchar)\n                  : tokenize (incSourceColumn pos (i + 1)) (T.drop 1 t2) ++ inp\n         return $ Tok pos toktype t1\n\nlistingsLanguage :: [(Text, Text)] -> Maybe Text\nlistingsLanguage opts =\n  case lookup \"language\" opts of\n    Nothing  -> Nothing\n    Just l   -> fromListingsLanguage l `mplus` Just l\n\ndolstinline :: PandocMonad m => LP m Inlines\ndolstinline = do\n  options <- option [] keyvals\n  let classes = maybeToList $ listingsLanguage options\n  doinlinecode classes\n\ndomintinline :: PandocMonad m => LP m Inlines\ndomintinline = do\n  skipopts\n  cls <- untokenize <$> braced\n  doinlinecode [cls]\n\ndoinlinecode :: PandocMonad m => [Text] -> LP m Inlines\ndoinlinecode classes = do\n  Tok _ Symbol t <- anySymbol\n  marker <- case T.uncons t of\n              Just (c, ts) | T.null ts -> return c\n              _            -> mzero\n  let stopchar = if marker == '{' then '}' else marker\n  withVerbatimMode $\n    codeWith (\"\",classes,[]) . T.map nlToSpace . untokenize <$>\n      manyTill (verbTok stopchar) (symbol stopchar)\n\nnlToSpace :: Char -> Char\nnlToSpace '\\n' = ' '\nnlToSpace x    = x\n\nromanNumeralUpper :: (PandocMonad m) => LP m Inlines\nromanNumeralUpper =\n  str . toRomanNumeral <$> romanNumeralArg\n\nromanNumeralLower :: (PandocMonad m) => LP m Inlines\nromanNumeralLower =\n  str . T.toLower . toRomanNumeral <$> romanNumeralArg\n\nromanNumeralArg :: (PandocMonad m) => LP m Int\nromanNumeralArg = spaces *> (parser <|> inBraces)\n  where\n    inBraces = do\n      symbol '{'\n      spaces\n      res <- parser\n      spaces\n      symbol '}'\n      return res\n    parser = do\n      s <- untokenize <$> many1 (satisfyTok isWordTok)\n      let (digits, rest) = T.span isDigit s\n      unless (T.null rest) $\n        Prelude.fail \"Non-digits in argument to \\\\Rn or \\\\RN\"\n      safeRead digits\n\naccentWith :: PandocMonad m\n           => LP m Inlines -> Char -> Maybe Char -> LP m Inlines\naccentWith tok combiningAccent fallBack = do\n  ils <- option mempty tok\n  case toList ils of\n       (Str (T.uncons -> Just (x, xs)) : ys) -> return $ fromList $\n         -- try to normalize to the combined character:\n         Str (Normalize.normalize Normalize.NFC\n               (T.pack [x, combiningAccent]) <> xs) : ys\n       [Space] -> return $ str $ T.singleton\n                         $ fromMaybe combiningAccent fallBack\n       []      -> return $ str $ T.singleton\n                         $ fromMaybe combiningAccent fallBack\n       _       -> return ils\n\n\nverbCommands :: PandocMonad m => M.Map Text (LP m Inlines)\nverbCommands = M.fromList\n  [ (\"verb\", doverb)\n  , (\"lstinline\", dolstinline)\n  , (\"mintinline\", domintinline)\n  , (\"Verb\", doverb)\n  ]\n\nmiscCommands :: PandocMonad m => M.Map Text (LP m Inlines)\nmiscCommands =\n  M.fromList\n  [ (\"pounds\", lit \"£\")\n  , (\"euro\", lit \"€\")\n  , (\"copyright\", lit \"©\")\n  , (\"textasciicircum\", lit \"^\")\n  , (\"textasciitilde\", lit \"~\")\n  , (\"textbaht\", lit \"฿\")\n  , (\"textblank\", lit \"␢\")\n  , (\"textbigcircle\", lit \"○\")\n  , (\"textbrokenbar\", lit \"¦\")\n  , (\"textbullet\", lit \"•\")\n  , (\"textcentoldstyle\", lit \"¢\")\n  , (\"textcopyright\", lit \"©\")\n  , (\"textdagger\", lit \"†\")\n  , (\"textdegree\", lit \"°\")\n  , (\"textdollar\", lit \"$\")\n  , (\"textdong\", lit \"₫\")\n  , (\"textlira\", lit \"₤\")\n  , (\"textmu\", lit \"μ\")\n  , (\"textmusicalnote\", lit \"♪\")\n  , (\"textonehalf\", lit \"½\")\n  , (\"textonequarter\", lit \"¼\")\n  , (\"textparagraph\", lit \"¶\")\n  , (\"textpertenthousand\", lit \"‱\")\n  , (\"textpeso\", lit \"₱\")\n  , (\"textquotesingle\", lit \"'\")\n  , (\"textregistered\", lit \"®\")\n  , (\"textsection\", lit \"§\")\n  , (\"textsterling\", lit \"£\")\n  , (\"textthreequarters\", lit \"¾\")\n  , (\"textthreesuperior\", lit \"³\")\n  , (\"texttwosuperior\", lit \"²\")\n  , (\"textyen\", lit \"¥\")\n  ]\n\naccentCommands :: PandocMonad m => LP m Inlines -> M.Map Text (LP m Inlines)\naccentCommands tok =\n  let accent = accentWith tok\n  in  M.fromList\n  [ (\"aa\", lit \"å\")\n  , (\"AA\", lit \"Å\")\n  , (\"ss\", lit \"ß\")\n  , (\"o\", lit \"ø\")\n  , (\"O\", lit \"Ø\")\n  , (\"L\", lit \"Ł\")\n  , (\"l\", lit \"ł\")\n  , (\"ae\", lit \"æ\")\n  , (\"AE\", lit \"Æ\")\n  , (\"oe\", lit \"œ\")\n  , (\"OE\", lit \"Œ\")\n  , (\"H\", accent '\\779' Nothing) -- hungarumlaut\n  , (\"`\", accent '\\768' (Just '`')) -- grave\n  , (\"'\", accent '\\769' (Just '\\'')) -- acute\n  , (\"^\", accent '\\770' (Just '^')) -- circ\n  , (\"~\", accent '\\771' (Just '~')) -- tilde\n  , (\"\\\"\", accent '\\776' Nothing) -- umlaut\n  , (\".\", accent '\\775' Nothing) -- dot\n  , (\"=\", accent '\\772' Nothing) -- macron\n  , (\"|\", accent '\\781' Nothing) -- vertical line above\n  , (\"b\", accent '\\817' Nothing) -- macron below\n  , (\"c\", accent '\\807' Nothing) -- cedilla\n  , (\"G\", accent '\\783' Nothing) -- doublegrave\n  , (\"h\", accent '\\777' Nothing) -- hookabove\n  , (\"d\", accent '\\803' Nothing) -- dotbelow\n  , (\"f\", accent '\\785' Nothing)  -- inverted breve\n  , (\"r\", accent '\\778' Nothing)  -- ringabove\n  , (\"t\", accent '\\865' Nothing)  -- double inverted breve\n  , (\"U\", accent '\\782' Nothing)  -- double vertical line above\n  , (\"v\", accent '\\780' Nothing) -- hacek\n  , (\"u\", accent '\\774' Nothing) -- breve\n  , (\"k\", accent '\\808' Nothing) -- ogonek\n  , (\"textogonekcentered\", accent '\\808' Nothing) -- ogonek\n  , (\"i\", lit \"ı\")  -- dotless i\n  , (\"j\", lit \"ȷ\")  -- dotless j\n  , (\"newtie\", accent '\\785' Nothing) -- inverted breve\n  , (\"textcircled\", accent '\\8413' Nothing) -- combining circle\n  ]\n\ncharCommands :: PandocMonad m => M.Map Text (LP m Inlines)\ncharCommands = M.fromList\n  [ (\"ldots\", lit \"…\")\n  , (\"vdots\", lit \"\\8942\")\n  , (\"dots\", lit \"…\")\n  , (\"mdots\", lit \"…\")\n  , (\"sim\", lit \"~\")\n  , (\"sep\", lit \",\")\n  , (\"P\", lit \"¶\")\n  , (\"S\", lit \"§\")\n  , (\"$\", lit \"$\")\n  , (\"%\", lit \"%\")\n  , (\"&\", lit \"&\")\n  , (\"#\", lit \"#\")\n  , (\"_\", lit \"_\")\n  , (\"{\", lit \"{\")\n  , (\"}\", lit \"}\")\n  , (\"-\", lit \"\\x00ad\") -- soft hyphen\n  , (\"qed\", lit \"\\a0\\x25FB\")\n  , (\"lq\", return (str \"‘\"))\n  , (\"rq\", return (str \"’\"))\n  , (\"textquoteleft\", return (str \"‘\"))\n  , (\"textquoteright\", return (str \"’\"))\n  , (\"textquotedblleft\", return (str \"“\"))\n  , (\"textquotedblright\", return (str \"”\"))\n  , (\"/\", pure mempty) -- italic correction\n  , (\"\\\\\", linebreak <$ (do inTableCell <- sInTableCell <$> getState\n                            guard $ not inTableCell\n                            optional rawopt\n                            spaces))\n  , (\",\", lit \"\\8198\")\n  , (\"@\", pure mempty)\n  , (\" \", lit \"\\160\")\n  , (\"ps\", pure $ str \"PS.\" <> space)\n  , (\"TeX\", lit \"TeX\")\n  , (\"LaTeX\", lit \"LaTeX\")\n  , (\"bar\", lit \"|\")\n  , (\"textless\", lit \"<\")\n  , (\"textgreater\", lit \">\")\n  , (\"textbackslash\", lit \"\\\\\")\n  , (\"backslash\", lit \"\\\\\")\n  , (\"slash\", lit \"/\")\n  -- fontawesome\n  , (\"faCheck\", lit \"\\10003\")\n  , (\"faClose\", lit \"\\10007\")\n  -- hyphenat\n  , (\"bshyp\", lit \"\\\\\\173\")\n  , (\"fshyp\", lit \"/\\173\")\n  , (\"dothyp\", lit \".\\173\")\n  , (\"colonhyp\", lit \":\\173\")\n  , (\"hyp\", lit \"-\")\n  -- ngerman (babel)\n  , (\"glq\", lit \"‚\")\n  , (\"grq\", lit \"‘\")\n  , (\"glqq\", lit \"„\")\n  , (\"grqq\", lit \"“\")\n  , (\"flq\", lit \"‹\")\n  , (\"frq\", lit \"›\")\n  , (\"flqq\", lit \"«\")\n  , (\"frqq\", lit \"»\")\n  , (\"dq\", lit \"\\\"\")\n  -- fontspec\n  , (\"guillemetleft\", lit \"«\")\n  , (\"guillemotleft\", lit \"«\")\n  , (\"guillemetright\", lit \"»\")\n  , (\"guillemotright\", lit \"»\")\n  , (\"guilsinglleft\", lit \"‹\")\n  , (\"guilsinglright\", lit \"›\")\n  , (\"quotedblbase\", lit \"„\")\n  , (\"quotesinglbase\", lit \",\")\n  , (\"textquotedbl\", lit \"\\\"\")\n  ]\n\nbiblatexInlineCommands :: PandocMonad m\n                       => LP m Inlines -> M.Map Text (LP m Inlines)\nbiblatexInlineCommands tok = M.fromList\n  -- biblatex misc\n  [ (\"RN\", romanNumeralUpper)\n  , (\"Rn\", romanNumeralLower)\n  , (\"mkbibquote\", spanWith nullAttr . doubleQuoted <$> tok)\n  , (\"mkbibemph\", spanWith nullAttr . emph <$> tok)\n  , (\"mkbibitalic\", spanWith nullAttr . emph <$> tok)\n  , (\"mkbibbold\", spanWith nullAttr . strong <$> tok)\n  , (\"mkbibparens\",\n       spanWith nullAttr . (\\x -> str \"(\" <> x <> str \")\") <$> tok)\n  , (\"mkbibbrackets\",\n       spanWith nullAttr . (\\x -> str \"[\" <> x <> str \"]\") <$> tok)\n  , (\"autocap\", spanWith nullAttr <$> tok)\n  , (\"textnormal\", spanWith (\"\",[\"nodecor\"],[]) <$> tok)\n  , (\"bibstring\",\n       (\\x -> spanWith (\"\",[],[(\"bibstring\",x)]) (str x)) . untokenize\n         <$> braced)\n  , (\"adddot\", pure (str \".\"))\n  , (\"adddotspace\", pure (spanWith nullAttr (str \".\" <> space)))\n  , (\"addabbrvspace\", pure space)\n  , (\"hyphen\", pure (str \"-\"))\n  ]\n\nnameCommands :: PandocMonad m => M.Map Text (LP m Inlines)\nnameCommands = M.fromList\n  [ (\"figurename\", doTerm Translations.Figure)\n  , (\"prefacename\", doTerm Translations.Preface)\n  , (\"refname\", doTerm Translations.References)\n  , (\"bibname\", doTerm Translations.Bibliography)\n  , (\"chaptername\", doTerm Translations.Chapter)\n  , (\"partname\", doTerm Translations.Part)\n  , (\"contentsname\", doTerm Translations.Contents)\n  , (\"listfigurename\", doTerm Translations.ListOfFigures)\n  , (\"listtablename\", doTerm Translations.ListOfTables)\n  , (\"indexname\", doTerm Translations.Index)\n  , (\"abstractname\", doTerm Translations.Abstract)\n  , (\"tablename\", doTerm Translations.Table)\n  , (\"enclname\", doTerm Translations.Encl)\n  , (\"ccname\", doTerm Translations.Cc)\n  , (\"headtoname\", doTerm Translations.To)\n  , (\"pagename\", doTerm Translations.Page)\n  , (\"seename\", doTerm Translations.See)\n  , (\"seealsoname\", doTerm Translations.SeeAlso)\n  , (\"proofname\", doTerm Translations.Proof)\n  , (\"glossaryname\", doTerm Translations.Glossary)\n  , (\"lstlistingname\", doTerm Translations.Listing)\n  ]\n\nrefCommands :: PandocMonad m => M.Map Text (LP m Inlines)\nrefCommands = M.fromList\n  [ (\"label\", rawInlineOr \"label\" dolabel)\n  , (\"ref\", rawInlineOr \"ref\" $ doref \"ref\")\n  , (\"cref\", rawInlineOr \"cref\" $ doref \"ref+label\")       -- from cleveref.sty\n  , (\"Cref\", rawInlineOr \"Cref\" $ doref \"ref+Label\")       -- from cleveref.sty\n  , (\"vref\", rawInlineOr \"vref\" $ doref \"ref\")  -- from varioref.sty\n  , (\"eqref\", rawInlineOr \"eqref\" $ doref \"eqref\")   -- from amsmath.sty\n  , (\"autoref\", rawInlineOr \"autoref\" $ doref \"ref+label\") -- from hyperref.sty\n  ]\n\nacronymCommands :: PandocMonad m => M.Map Text (LP m Inlines)\nacronymCommands = M.fromList\n  -- glossaries package\n  [ (\"gls\", doAcronym \"short\")\n  , (\"Gls\", doAcronym \"short\")\n  , (\"glsdesc\", doAcronym \"long\")\n  , (\"Glsdesc\", doAcronym \"long\")\n  , (\"GLSdesc\", doAcronym \"long\")\n  , (\"acrlong\", doAcronym \"long\")\n  , (\"Acrlong\", doAcronym \"long\")\n  , (\"acrfull\", doAcronym \"full\")\n  , (\"Acrfull\", doAcronym \"full\")\n  , (\"acrshort\", doAcronym \"abbrv\")\n  , (\"Acrshort\", doAcronym \"abbrv\")\n  , (\"glspl\", doAcronymPlural \"short\")\n  , (\"Glspl\", doAcronymPlural \"short\")\n  , (\"glsdescplural\", doAcronymPlural \"long\")\n  , (\"Glsdescplural\", doAcronymPlural \"long\")\n  , (\"GLSdescplural\", doAcronymPlural \"long\")\n  -- acronyms package\n  , (\"ac\", doAcronym \"short\")\n  , (\"acf\", doAcronym \"full\")\n  , (\"acs\", doAcronym \"abbrv\")\n  , (\"acl\", doAcronym \"long\")\n  , (\"acp\", doAcronymPlural \"short\")\n  , (\"acfp\", doAcronymPlural \"full\")\n  , (\"acsp\", doAcronymPlural \"abbrv\")\n  , (\"aclp\", doAcronymPlural \"long\")\n  , (\"Ac\", doAcronym \"short\")\n  , (\"Acf\", doAcronym \"full\")\n  , (\"Acs\", doAcronym \"abbrv\")\n  , (\"Acl\", doAcronym \"long\")\n  , (\"Acp\", doAcronymPlural \"short\")\n  , (\"Acfp\", doAcronymPlural \"full\")\n  , (\"Acsp\", doAcronymPlural \"abbrv\")\n  , (\"Aclp\", doAcronymPlural \"long\")\n  ]\n\ndoAcronym :: PandocMonad m => Text -> LP m Inlines\ndoAcronym form = do\n  acro <- braced\n  return . mconcat $ [spanWith (\"\",[],[(\"acronym-label\", untokenize acro),\n    (\"acronym-form\", \"singular+\" <> form)])\n    $ str $ untokenize acro]\n\ndoAcronymPlural :: PandocMonad m => Text -> LP m Inlines\ndoAcronymPlural form = do\n  acro <- braced\n  let plural = str \"s\"\n  return . mconcat $ [spanWith (\"\",[],[(\"acronym-label\", untokenize acro),\n    (\"acronym-form\", \"plural+\" <> form)]) $\n   mconcat [str $ untokenize acro, plural]]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Lang.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.LaTeX.Lang\n   Copyright   : Copyright (C) 2018-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions for parsing polyglossia and babel language specifiers to\nBCP47 'Lang'.\n-}\nmodule Text.Pandoc.Readers.LaTeX.Lang\n  ( setDefaultLanguage\n  , polyglossiaLangToBCP47\n  , babelLangToBCP47\n  , enquoteCommands\n  , inlineLanguageCommands\n  )\nwhere\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Shared (extractSpaces)\nimport Text.Collate.Lang (Lang(..), renderLang)\nimport Text.Pandoc.Class (PandocMonad(..))\nimport Text.Pandoc.Translations (setTranslations)\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.Parsing (updateState, option, getState, QuoteContext(..),\n                            withQuoteContext)\nimport Text.Pandoc.Builder (Blocks, Inlines, setMeta, str, spanWith,\n                            singleQuoted, doubleQuoted)\n\nenquote :: PandocMonad m\n        => LP m Inlines\n        -> Bool -> Maybe Text -> LP m Inlines\nenquote tok starred mblang = do\n  skipopts\n  let lang = mblang >>= babelLangToBCP47\n  let langspan = case lang of\n                      Nothing -> id\n                      Just l  -> spanWith (\"\",[],[(\"lang\", renderLang l)])\n  quoteContext <- sQuoteContext <$> getState\n  if starred || quoteContext == InDoubleQuote\n     then singleQuoted . langspan <$> withQuoteContext InSingleQuote tok\n     else doubleQuoted . langspan <$> withQuoteContext InDoubleQuote tok\n\nenquoteCommands :: PandocMonad m\n                => LP m Inlines -> M.Map Text (LP m Inlines)\nenquoteCommands tok = M.fromList\n  [ (\"enquote*\", enquote tok True Nothing)\n  , (\"enquote\", enquote tok False Nothing)\n  -- foreignquote is supposed to use native quote marks\n  , (\"foreignquote*\", braced >>= enquote tok True . Just . untokenize)\n  , (\"foreignquote\", braced >>= enquote tok False . Just . untokenize)\n  -- hypehnquote uses regular quotes\n  , (\"hyphenquote*\", braced >>= enquote tok True . Just . untokenize)\n  , (\"hyphenquote\", braced >>= enquote tok False . Just . untokenize)\n  ]\n\nforeignlanguage :: PandocMonad m => LP m Inlines -> LP m Inlines\nforeignlanguage tok = do\n  babelLang <- untokenize <$> braced\n  case babelLangToBCP47 babelLang of\n       Just lang -> spanWith (\"\", [], [(\"lang\",  renderLang lang)]) <$> tok\n       _ -> tok\n\ninlineLanguageCommands :: PandocMonad m\n                       => LP m Inlines -> M.Map Text (LP m Inlines)\ninlineLanguageCommands tok =\n  M.fromList $\n    (\"foreignlanguage\", foreignlanguage tok) :\n    (mk <$> M.toList polyglossiaLangToBCP47)\n  where\n    mk (polyglossia, bcp47Func) =\n      (\"text\" <> polyglossia, inlineLanguage tok bcp47Func)\n\ninlineLanguage :: PandocMonad m\n               => LP m Inlines -> (Text -> Lang) -> LP m Inlines\ninlineLanguage tok bcp47Func = do\n  o <- option \"\" $ T.filter (\\c -> c /= '[' && c /= ']')\n                <$> rawopt\n  let lang = renderLang $ bcp47Func o\n  extractSpaces (spanWith (\"\", [], [(\"lang\", lang)])) <$> tok\n\nsetDefaultLanguage :: PandocMonad m => LP m Blocks\nsetDefaultLanguage = do\n  o <- option \"\" $ T.filter (\\c -> c /= '[' && c /= ']')\n                <$> rawopt\n  polylang <- untokenize <$> braced\n  case M.lookup polylang polyglossiaLangToBCP47 of\n       Nothing -> return mempty -- TODO mzero? warning?\n       Just langFunc -> do\n         let l = langFunc o\n         setTranslations l\n         updateState $ setMeta \"lang\" $ str (renderLang l)\n         return mempty\n\npolyglossiaLangToBCP47 :: M.Map T.Text (T.Text -> Lang)\npolyglossiaLangToBCP47 = M.fromList\n  [ (\"arabic\", \\o -> case T.filter (/=' ') o of\n       \"locale=algeria\"    -> Lang \"ar\" Nothing (Just \"DZ\") [] [] []\n       \"locale=mashriq\"    -> Lang \"ar\" Nothing (Just \"SY\") [] [] []\n       \"locale=libya\"      -> Lang \"ar\" Nothing (Just \"LY\") [] [] []\n       \"locale=morocco\"    -> Lang \"ar\" Nothing (Just \"MA\") [] [] []\n       \"locale=mauritania\" -> Lang \"ar\" Nothing (Just \"MR\") [] [] []\n       \"locale=tunisia\"    -> Lang \"ar\" Nothing (Just \"TN\") [] [] []\n       _                   -> Lang \"ar\" Nothing Nothing     [] [] [])\n  , (\"german\", \\o -> case T.filter (/=' ') o of\n       \"spelling=old\" -> Lang \"de\" Nothing (Just \"DE\") [\"1901\"] [] []\n       \"variant=austrian,spelling=old\"\n                       -> Lang \"de\" Nothing (Just \"AT\") [\"1901\"] [] []\n       \"variant=austrian\" -> Lang \"de\" Nothing (Just \"AT\") [] [] []\n       \"variant=swiss,spelling=old\"\n                       -> Lang \"de\" Nothing (Just \"CH\") [\"1901\"] [] []\n       \"variant=swiss\" -> Lang \"de\" Nothing (Just \"CH\") [] [] []\n       _ -> Lang \"de\" Nothing Nothing [] [] [])\n  , (\"lsorbian\", \\_ -> Lang \"dsb\" Nothing Nothing [] [] [])\n  , (\"greek\", \\o -> case T.filter (/=' ') o of\n       \"variant=poly\"    -> Lang \"el\" Nothing (Just \"polyton\") [] [] []\n       \"variant=ancient\" -> Lang \"grc\" Nothing Nothing [] [] []\n       _                 -> Lang \"el\" Nothing Nothing [] [] [])\n  , (\"english\", \\o -> case T.filter (/=' ') o of\n       \"variant=australian\" -> Lang \"en\" Nothing (Just \"AU\") [] [] []\n       \"variant=canadian\"   -> Lang \"en\" Nothing (Just \"CA\") [] [] []\n       \"variant=british\"    -> Lang \"en\" Nothing (Just \"GB\") [] [] []\n       \"variant=newzealand\" -> Lang \"en\" Nothing (Just \"NZ\") [] [] []\n       \"variant=american\"   -> Lang \"en\" Nothing (Just \"US\") [] [] []\n       _                    -> Lang \"en\" Nothing Nothing     [] [] [])\n  , (\"usorbian\", \\_ -> Lang \"hsb\" Nothing Nothing [] [] [])\n  , (\"latin\", \\o -> case T.filter (/=' ') o of\n       \"variant=classic\" -> Lang \"la\" Nothing Nothing [\"x-classic\"] [] []\n       _                 -> Lang \"la\" Nothing Nothing [] [] [])\n  , (\"slovenian\", \\_ -> Lang \"sl\" Nothing Nothing [] [] [])\n  , (\"serbianc\", \\_ -> Lang \"sr\" (Just \"Cyrl\") Nothing [] [] [])\n  , (\"pinyin\", \\_ -> Lang \"zh\" (Just \"Latn\") Nothing [\"pinyin\"] [] [])\n  , (\"afrikaans\", \\_ -> simpleLang \"af\")\n  , (\"amharic\", \\_ -> simpleLang \"am\")\n  , (\"assamese\", \\_ -> simpleLang \"as\")\n  , (\"asturian\", \\_ -> simpleLang \"ast\")\n  , (\"bulgarian\", \\_ -> simpleLang \"bg\")\n  , (\"bengali\", \\_ -> simpleLang \"bn\")\n  , (\"tibetan\", \\_ -> simpleLang \"bo\")\n  , (\"breton\", \\_ -> simpleLang \"br\")\n  , (\"catalan\", \\_ -> simpleLang \"ca\")\n  , (\"welsh\", \\_ -> simpleLang \"cy\")\n  , (\"czech\", \\_ -> simpleLang \"cs\")\n  , (\"coptic\", \\_ -> simpleLang \"cop\")\n  , (\"danish\", \\_ -> simpleLang \"da\")\n  , (\"divehi\", \\_ -> simpleLang \"dv\")\n  , (\"esperanto\", \\_ -> simpleLang \"eo\")\n  , (\"spanish\", \\_ -> simpleLang \"es\")\n  , (\"estonian\", \\_ -> simpleLang \"et\")\n  , (\"basque\", \\_ -> simpleLang \"eu\")\n  , (\"farsi\", \\_ -> simpleLang \"fa\")\n  , (\"finnish\", \\_ -> simpleLang \"fi\")\n  , (\"french\", \\_ -> simpleLang \"fr\")\n  , (\"friulan\", \\_ -> simpleLang \"fur\")\n  , (\"irish\", \\_ -> simpleLang \"ga\")\n  , (\"scottish\", \\_ -> simpleLang \"gd\")\n  , (\"ethiopic\", \\_ -> simpleLang \"gez\")\n  , (\"galician\", \\_ -> simpleLang \"gl\")\n  , (\"hebrew\", \\_ -> simpleLang \"he\")\n  , (\"hindi\", \\_ -> simpleLang \"hi\")\n  , (\"croatian\", \\_ -> simpleLang \"hr\")\n  , (\"magyar\", \\_ -> simpleLang \"hu\")\n  , (\"armenian\", \\_ -> simpleLang \"hy\")\n  , (\"gujarati\", \\_ -> simpleLang \"gu\")\n  , (\"interlingua\", \\_ -> simpleLang \"ia\")\n  , (\"indonesian\", \\_ -> simpleLang \"id\")\n  , (\"icelandic\", \\_ -> simpleLang \"is\")\n  , (\"italian\", \\_ -> simpleLang \"it\")\n  , (\"japanese\", \\_ -> simpleLang \"ja\")\n  , (\"khmer\", \\_ -> simpleLang \"km\")\n  , (\"kurmanji\", \\_ -> simpleLang \"kmr\")\n  , (\"kannada\", \\_ -> simpleLang \"kn\")\n  , (\"korean\", \\_ -> simpleLang \"ko\")\n  , (\"lao\", \\_ -> simpleLang \"lo\")\n  , (\"lithuanian\", \\_ -> simpleLang \"lt\")\n  , (\"latvian\", \\_ -> simpleLang \"lv\")\n  , (\"malayalam\", \\_ -> simpleLang \"ml\")\n  , (\"mongolian\", \\_ -> simpleLang \"mn\")\n  , (\"marathi\", \\_ -> simpleLang \"mr\")\n  , (\"dutch\", \\_ -> simpleLang \"nl\")\n  , (\"nynorsk\", \\_ -> simpleLang \"nn\")\n  , (\"norsk\", \\_ -> simpleLang \"no\")\n  , (\"nko\", \\_ -> simpleLang \"nqo\")\n  , (\"occitan\", \\_ -> simpleLang \"oc\")\n  , (\"oriya\", \\_ -> simpleLang \"or\")\n  , (\"punjabi\", \\_ -> simpleLang \"pa\")\n  , (\"polish\", \\_ -> simpleLang \"pl\")\n  , (\"piedmontese\", \\_ -> simpleLang \"pms\")\n  , (\"portuguese\", \\_ -> simpleLang \"pt\")\n  , (\"romansh\", \\_ -> simpleLang \"rm\")\n  , (\"romanian\", \\_ -> simpleLang \"ro\")\n  , (\"russian\", \\_ -> simpleLang \"ru\")\n  , (\"sanskrit\", \\_ -> simpleLang \"sa\")\n  , (\"samin\", \\_ -> simpleLang \"se\")\n  , (\"slovak\", \\_ -> simpleLang \"sk\")\n  , (\"albanian\", \\_ -> simpleLang \"sq\")\n  , (\"serbian\", \\_ -> simpleLang \"sr\")\n  , (\"swedish\", \\_ -> simpleLang \"sv\")\n  , (\"syriac\", \\_ -> simpleLang \"syr\")\n  , (\"tamil\", \\_ -> simpleLang \"ta\")\n  , (\"telugu\", \\_ -> simpleLang \"te\")\n  , (\"thai\", \\_ -> simpleLang \"th\")\n  , (\"turkmen\", \\_ -> simpleLang \"tk\")\n  , (\"turkish\", \\_ -> simpleLang \"tr\")\n  , (\"ukrainian\", \\_ -> simpleLang \"uk\")\n  , (\"urdu\", \\_ -> simpleLang \"ur\")\n  , (\"vietnamese\", \\_ -> simpleLang \"vi\")\n  ]\n\nsimpleLang :: Text -> Lang\nsimpleLang l = Lang l Nothing Nothing [] [] []\n\nbabelLangToBCP47 :: T.Text -> Maybe Lang\nbabelLangToBCP47 s =\n  case s of\n       \"austrian\" -> Just $ Lang \"de\" Nothing (Just \"AT\") [\"1901\"] [] []\n       \"naustrian\" -> Just $ Lang \"de\" Nothing (Just \"AT\") [] [] []\n       \"swissgerman\" -> Just $ Lang \"de\" Nothing (Just \"CH\") [\"1901\"] [] []\n       \"nswissgerman\" -> Just $ Lang \"de\" Nothing (Just \"CH\") [] [] []\n       \"german\" -> Just $ Lang \"de\" Nothing (Just \"DE\") [\"1901\"] [] []\n       \"ngerman\" -> Just $ Lang \"de\" Nothing (Just \"DE\") [] [] []\n       \"lowersorbian\" -> Just $ Lang \"dsb\" Nothing Nothing [] [] []\n       \"uppersorbian\" -> Just $ Lang \"hsb\" Nothing Nothing [] [] []\n       \"polytonicgreek\" -> Just $ Lang \"el\" Nothing Nothing [\"polyton\"] [] []\n       \"polutonikogreek\" -> Just $ Lang \"el\" Nothing Nothing [\"polyton\"] [] []\n       \"slovene\" -> Just $ simpleLang \"sl\"\n       \"australian\" -> Just $ Lang \"en\" Nothing (Just \"AU\") [] [] []\n       \"canadian\" -> Just $ Lang \"en\" Nothing (Just \"CA\") [] [] []\n       \"british\" -> Just $ Lang \"en\" Nothing (Just \"GB\") [] [] []\n       \"newzealand\" -> Just $ Lang \"en\" Nothing (Just \"NZ\") [] [] []\n       \"american\" -> Just $ Lang \"en\" Nothing (Just \"US\") [] [] []\n       \"classiclatin\" -> Just $ Lang \"la\" Nothing Nothing [\"x-classic\"] [] []\n       _ -> ($ \"\") <$> M.lookup s polyglossiaLangToBCP47\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Macro.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Readers.LaTeX.Macro\n  ( macroDef\n  )\nwhere\nimport Text.Pandoc.Extensions (Extension(..))\nimport Text.Pandoc.Logging (LogMessage(MacroAlreadyDefined))\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.TeX\nimport Text.Pandoc.Class\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.Parsing hiding (blankline, mathDisplay, mathInline,\n                            optional, space, spaces, withRaw, (<|>))\nimport Control.Applicative ((<|>), optional)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.List.NonEmpty as NonEmpty\nimport Data.List.NonEmpty (NonEmpty(..))\n\nmacroDef :: (PandocMonad m, Monoid a) => (Text -> a) -> LP m a\nmacroDef constructor = do\n    (_, s) <- withRaw (commandDef <|> environmentDef)\n    (constructor (untokenize s) <$\n      guardDisabled Ext_latex_macros)\n     <|> return mempty\n  where commandDef = do\n          nameMacroPairs <- newcommand <|>\n            checkGlobal (letmacro <|> edefmacro <|> defmacro <|> newif)\n          guardDisabled Ext_latex_macros <|>\n            mapM_ insertMacro nameMacroPairs\n        environmentDef = do\n          mbenv <- newenvironment\n          case mbenv of\n            Nothing -> return ()\n            Just (name, macro1, macro2) ->\n              guardDisabled Ext_latex_macros <|>\n                do insertMacro (name, macro1)\n                   insertMacro (\"end\" <> name, macro2)\n        -- @\\newenvironment{envname}[n-args][default]{begin}{end}@\n        -- is equivalent to\n        -- @\\newcommand{\\envname}[n-args][default]{begin}@\n        -- @\\newcommand{\\endenvname}@\n\ninsertMacro :: PandocMonad m => (Text, Macro) -> LP m ()\ninsertMacro (name, macro'@(Macro GlobalScope _ _ _ _)) =\n  updateState $ \\s ->\n     s{ sMacros = NonEmpty.map (M.insert name macro') (sMacros s) }\ninsertMacro (name, macro'@(Macro GroupScope _ _ _ _)) =\n  updateState $ \\s ->\n     s{ sMacros = M.insert name macro' (NonEmpty.head (sMacros s)) :|\n                      NonEmpty.tail (sMacros s) }\n\nlookupMacro :: PandocMonad m => Text -> LP m Macro\nlookupMacro name = do\n   macros :| _ <- sMacros <$> getState\n   case M.lookup name macros of\n     Just m -> return m\n     Nothing -> fail \"Macro not found\"\n\nletmacro :: PandocMonad m => LP m [(Text, Macro)]\nletmacro = do\n  controlSeq \"let\"\n  withVerbatimMode $ do\n    Tok _ (CtrlSeq name) _ <- anyControlSeq\n    optional $ symbol '='\n    spaces\n    -- we first parse in verbatim mode, and then expand macros,\n    -- because we don't want \\let\\foo\\bar to turn into\n    -- \\let\\foo hello if we have previously \\def\\bar{hello}\n    target <- anyControlSeq <|> singleChar\n    case target of\n      (Tok _ (CtrlSeq name') _) ->\n         (do m <- lookupMacro name'\n             pure [(name, m)])\n         <|> pure [(name,\n                    Macro GroupScope ExpandWhenDefined [] Nothing [target])]\n      _ -> pure [(name, Macro GroupScope ExpandWhenDefined [] Nothing [target])]\n\ncheckGlobal :: PandocMonad m => LP m [(Text, Macro)] -> LP m [(Text, Macro)]\ncheckGlobal p =\n  (controlSeq \"global\" *>\n      (map (\\(n, Macro _ expand arg optarg contents) ->\n                (n, Macro GlobalScope expand arg optarg contents)) <$> p))\n   <|> p\n\nedefmacro :: PandocMonad m => LP m [(Text, Macro)]\nedefmacro = do\n  scope <- (GroupScope <$ controlSeq \"edef\")\n       <|> (GlobalScope <$ controlSeq \"xdef\")\n  (name, contents) <- withVerbatimMode $ do\n    Tok _ (CtrlSeq name) _ <- anyControlSeq\n    -- we first parse in verbatim mode, and then expand macros,\n    -- because we don't want \\let\\foo\\bar to turn into\n    -- \\let\\foo hello if we have previously \\def\\bar{hello}\n    contents <- bracedOrToken\n    return (name, contents)\n  -- expand macros\n  contents' <- parseFromToks (many anyTok) contents\n  return [(name, Macro scope ExpandWhenDefined [] Nothing contents')]\n\ndefmacro :: PandocMonad m => LP m [(Text, Macro)]\ndefmacro = do\n  -- we use withVerbatimMode, because macros are to be expanded\n  -- at point of use, not point of definition\n  scope <- (GroupScope <$ controlSeq \"def\")\n       <|> (GlobalScope <$ controlSeq \"gdef\")\n  withVerbatimMode $ do\n    Tok _ (CtrlSeq name) _ <- anyControlSeq\n    argspecs <- many (argspecArg <|> argspecPattern)\n    contents <- bracedOrToken\n    return [(name, Macro scope ExpandWhenUsed argspecs Nothing contents)]\n\n-- \\newif\\iffoo' defines:\n-- \\iffoo to be \\iffalse\n-- \\footrue to be a command that defines \\iffoo to be \\iftrue\n-- \\foofalse to be a command that defines \\iffoo to be \\iffalse\nnewif :: PandocMonad m => LP m [(Text, Macro)]\nnewif = do\n  controlSeq \"newif\"\n  withVerbatimMode $ do\n    Tok pos (CtrlSeq name) _ <- anyControlSeq\n    -- \\def\\iffoo\\iffalse\n    -- \\def\\footrue{\\def\\iffoo\\iftrue}\n    -- \\def\\foofalse{\\def\\iffoo\\iffalse}\n    let base = T.drop 2 name\n    return [ (name, Macro GroupScope ExpandWhenUsed [] Nothing\n                    [Tok pos (CtrlSeq \"iffalse\") \"\\\\iffalse\"])\n           , (base <> \"true\",\n                   Macro GroupScope ExpandWhenUsed [] Nothing\n                   [ Tok pos (CtrlSeq \"def\") \"\\\\def\"\n                   , Tok pos (CtrlSeq name) (\"\\\\\" <> name)\n                   , Tok pos Symbol \"{\"\n                   , Tok pos (CtrlSeq \"iftrue\") \"\\\\iftrue\"\n                   , Tok pos Symbol \"}\"\n                   ])\n           , (base <> \"false\",\n                   Macro GroupScope ExpandWhenUsed [] Nothing\n                   [ Tok pos (CtrlSeq \"def\") \"\\\\def\"\n                   , Tok pos (CtrlSeq name) (\"\\\\\" <> name)\n                   , Tok pos Symbol \"{\"\n                   , Tok pos (CtrlSeq \"iffalse\") \"\\\\iffalse\"\n                   , Tok pos Symbol \"}\"\n                   ])\n           ]\n\nargspecArg :: PandocMonad m => LP m ArgSpec\nargspecArg = do\n  Tok _ (Arg i) _ <- satisfyTok isArgTok\n  return $ ArgNum i\n\nargspecPattern :: PandocMonad m => LP m ArgSpec\nargspecPattern =\n  Pattern <$> many1 (satisfyTok (\\(Tok _ toktype' txt) ->\n                              (toktype' == Symbol || toktype' == Word) &&\n                              (txt /= \"{\" && txt /= \"\\\\\" && txt /= \"}\")))\n\nnewcommand :: PandocMonad m => LP m [(Text, Macro)]\nnewcommand = do\n  Tok pos (CtrlSeq mtype) _ <- controlSeq \"newcommand\" <|>\n                             controlSeq \"renewcommand\" <|>\n                             controlSeq \"providecommand\" <|>\n                             controlSeq \"DeclareMathOperator\" <|>\n                             controlSeq \"DeclareRobustCommand\"\n  withVerbatimMode $ do\n    Tok _ (CtrlSeq name) txt <- do\n      optional (symbol '*')\n      anyControlSeq <|>\n        (symbol '{' *> spaces *> anyControlSeq <* spaces <* symbol '}')\n    spaces\n    numargs <- option 0 $ try bracketedNum\n    let argspecs = map ArgNum [1..numargs]\n    spaces\n    optarg <- option Nothing $ Just <$> try bracketedToks\n    spaces\n    contents' <- bracedOrToken\n    let contents =\n         case mtype of\n              \"DeclareMathOperator\" ->\n                 Tok pos (CtrlSeq \"mathop\") \"\\\\mathop\"\n                 : Tok pos Symbol \"{\"\n                 : Tok pos (CtrlSeq \"mathrm\") \"\\\\mathrm\"\n                 : Tok pos Symbol \"{\"\n                 : (contents' ++\n                   [ Tok pos Symbol \"}\", Tok pos Symbol \"}\" ])\n              _                     -> contents'\n    let macro = Macro GroupScope ExpandWhenUsed argspecs optarg contents\n    (do lookupMacro name\n        case mtype of\n          \"providecommand\" -> return []\n          \"renewcommand\" -> return [(name, macro)]\n          _ -> [] <$ report (MacroAlreadyDefined txt pos))\n      <|> pure [(name, macro)]\n\nnewenvironment :: PandocMonad m => LP m (Maybe (Text, Macro, Macro))\nnewenvironment = do\n  pos <- getPosition\n  Tok _ (CtrlSeq mtype) _ <- controlSeq \"newenvironment\" <|>\n                             controlSeq \"renewenvironment\" <|>\n                             controlSeq \"provideenvironment\"\n  withVerbatimMode $ do\n    optional $ symbol '*'\n    spaces\n    name <- untokenize <$> braced\n    spaces\n    numargs <- option 0 $ try bracketedNum\n    spaces\n    optarg <- option Nothing $ Just <$> try bracketedToks\n    let argspecs = map (\\i -> ArgNum i) [1..numargs]\n    startcontents <- spaces >> bracedOrToken\n    endcontents <- spaces >> bracedOrToken\n    -- we need the environment to be in a group so macros defined\n    -- inside behave correctly:\n    let bg = Tok pos (CtrlSeq \"bgroup\") \"\\\\bgroup \"\n    let eg = Tok pos (CtrlSeq \"egroup\") \"\\\\egroup \"\n    let result = (name,\n                    Macro GroupScope ExpandWhenUsed argspecs optarg\n                      (bg:startcontents),\n                    Macro GroupScope ExpandWhenUsed [] Nothing\n                      (endcontents ++ [eg]))\n    (do lookupMacro name\n        case mtype of\n          \"provideenvironment\" -> return Nothing\n          \"renewenvironment\" -> return (Just result)\n          _ -> do\n             report $ MacroAlreadyDefined name pos\n             return Nothing)\n      <|> return (Just result)\n\nbracketedNum :: PandocMonad m => LP m Int\nbracketedNum = do\n  ds <- untokenize <$> bracketedToks\n  case safeRead ds of\n       Just i -> return i\n       _      -> return 0\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Math.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Readers.LaTeX.Math\n  ( withMathMode\n  , dollarsMath\n  , inlineEnvironments\n  , inlineEnvironmentNames\n  , inlineEnvironment\n  , mathInline\n  , mathDisplay\n  , theoremstyle\n  , theoremEnvironment\n  , newtheorem\n  , proof\n  )\nwhere\nimport Data.Maybe (fromMaybe, mapMaybe, listToMaybe)\nimport qualified Data.List as L\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.Builder as B\nimport qualified Data.Sequence as Seq\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.TeX\nimport Text.Pandoc.Class\nimport Text.Pandoc.Shared (trimMath, trimr)\nimport Text.Pandoc.Parsing hiding (blankline, mathDisplay, mathInline,\n                            optional, space, spaces, withRaw, (<|>))\nimport Control.Applicative ((<|>), optional)\nimport Control.Monad (guard, mzero)\nimport qualified Data.Map as M\nimport Data.Text (Text)\n\nwithMathMode :: PandocMonad m => LP m a -> LP m a\nwithMathMode p = do\n  oldMathMode <- sMathMode <$> getState\n  updateState $ \\s -> s{ sMathMode = True }\n  result <- p\n  updateState $ \\s -> s{ sMathMode = oldMathMode }\n  return result\n\ndollarsMath :: PandocMonad m => LP m Inlines\ndollarsMath = do\n  symbol '$'\n  display <- option False (True <$ symbol '$')\n  (do contents <- try $ untokenize <$> withMathMode (pDollarsMath 0)\n      if display\n         then mathDisplay contents <$ symbol '$'\n         else return $ mathInline contents)\n   <|> (guard display >> return (mathInline \"\"))\n\n-- Int is number of embedded groupings\npDollarsMath :: PandocMonad m => Int -> LP m [Tok]\npDollarsMath n = do\n  tk@(Tok _ toktype t) <- anyTok\n  case toktype of\n       Symbol | t == \"$\"\n              , n == 0 -> return []\n              | t == \"\\\\\" -> do\n                  tk' <- anyTok\n                  (tk :) . (tk' :) <$> pDollarsMath n\n              | t == \"{\" -> (tk :) <$> pDollarsMath (n+1)\n              | t == \"}\" ->\n                if n > 0\n                then (tk :) <$> pDollarsMath (n-1)\n                else mzero\n       _ -> (tk :) <$> pDollarsMath n\n\nmathDisplay :: Text -> Inlines\nmathDisplay = displayMath . trimMath\n\nmathInline :: Text -> Inlines\nmathInline = math . trimMath\n\nmathEnvWith :: PandocMonad m\n            => (Inlines -> a) -> Maybe Text -> Text -> LP m a\nmathEnvWith f innerEnv name = f . mathDisplay . inner <$> mathEnv name\n   where inner x = case innerEnv of\n                        Nothing -> x\n                        Just y  -> \"\\\\begin{\" <> y <> \"}\\n\" <> x <>\n                                   \"\\n\\\\end{\" <> y <> \"}\"\n\nmathEnv :: PandocMonad m => Text -> LP m Text\nmathEnv name = withMathMode $ do\n  optional blankline\n  res <- manyTill anyTok (end_ name)\n  return $ trimr $ untokenize res\n\ninlineEnvironment :: PandocMonad m => LP m Inlines\ninlineEnvironment = try $ do\n  controlSeq \"begin\"\n  name <- untokenize <$> braced\n  M.findWithDefault mzero name inlineEnvironments\n\ninlineEnvironmentNames :: [Text]\ninlineEnvironmentNames =\n  M.keys (inlineEnvironments :: M.Map Text (LP PandocPure Inlines))\n\ninlineEnvironments :: PandocMonad m => M.Map Text (LP m Inlines)\ninlineEnvironments = M.fromList [\n    (\"displaymath\", mathEnvWith id Nothing \"displaymath\")\n  , (\"math\", math <$> mathEnv \"math\")\n  , (\"equation\", mathEnvWith id (Just \"equation\") \"equation\")\n  , (\"equation*\", mathEnvWith id (Just \"equation*\") \"equation*\")\n  , (\"gather\", mathEnvWith id (Just \"gather\") \"gather\")\n  , (\"gather*\", mathEnvWith id (Just \"gather*\") \"gather*\")\n  , (\"multline\", mathEnvWith id (Just \"multline\") \"multline\")\n  , (\"multline*\", mathEnvWith id (Just \"multline*\") \"multline*\")\n  , (\"eqnarray\", mathEnvWith id (Just \"eqnarray\") \"eqnarray\")\n  , (\"eqnarray*\", mathEnvWith id (Just \"eqnarray*\") \"eqnarray*\")\n  , (\"align\", mathEnvWith id (Just \"align\") \"align\")\n  , (\"align*\", mathEnvWith id (Just \"align*\") \"align*\")\n  , (\"alignat\", mathEnvWith id (Just \"alignat\") \"alignat\")\n  , (\"alignat*\", mathEnvWith id (Just \"alignat*\") \"alignat*\")\n  , (\"flalign\", mathEnvWith id (Just \"flalign\") \"flalign\")\n  , (\"flalign*\", mathEnvWith id (Just \"flalign*\") \"flalign*\")\n  -- the following are not yet handled by texmath, so we use substitutes:\n  , (\"dmath\", mathEnvWith id Nothing \"dmath\")\n  , (\"dmath*\", mathEnvWith id Nothing \"dmath*\")\n  , (\"dgroup\", mathEnvWith id (Just \"aligned\") \"dgroup\")\n  , (\"dgroup*\", mathEnvWith id (Just \"aligned\") \"dgroup*\")\n  , (\"darray\", mathEnvWith id (Just \"aligned\") \"darray\")\n  , (\"darray*\", mathEnvWith id (Just \"aligned\") \"darray*\")\n  , (\"subequations\", mathEnvWith id Nothing \"subequations\")\n  ]\n\ntheoremstyle :: PandocMonad m => LP m Blocks\ntheoremstyle = do\n  stylename <- untokenize <$> braced\n  let mbstyle = case stylename of\n                  \"plain\"      -> Just PlainStyle\n                  \"definition\" -> Just DefinitionStyle\n                  \"remark\"     -> Just RemarkStyle\n                  _            -> Nothing\n  case mbstyle of\n    Nothing  -> return ()\n    Just sty -> updateState $ \\s -> s{ sLastTheoremStyle = sty }\n  return mempty\n\nnewtheorem :: PandocMonad m => LP m Inlines -> LP m Blocks\nnewtheorem inline = do\n  number <- option True (False <$ symbol '*' <* sp)\n  name <- untokenize <$> braced\n  sp\n  series <- option Nothing $ Just . untokenize <$> bracketedToks\n  sp\n  showName <- tokWith inline\n  sp\n  syncTo <- option Nothing $ Just . untokenize <$> bracketedToks\n  sty <- sLastTheoremStyle <$> getState\n  let spec = TheoremSpec { theoremName = showName\n                         , theoremStyle = sty\n                         , theoremSeries = series\n                         , theoremSyncTo = syncTo\n                         , theoremNumber = number\n                         , theoremLastNum = DottedNum [0] }\n  tmap <- sTheoremMap <$> getState\n  updateState $ \\s -> s{ sTheoremMap =\n                            M.insert name spec tmap }\n  return mempty\n\nextractLabelFromBlock :: Block -> Maybe Text\nextractLabelFromBlock (Para inlines) = extractLabel Nothing inlines\n  where\n    extractLabel = L.foldl' go\n    go :: Maybe Text -> Inline -> Maybe Text\n    go (Just t) _ = Just t\n    go Nothing (Span (_, _, attrs) _) = lookup \"label\" attrs\n    go Nothing _ = Nothing\nextractLabelFromBlock _ = Nothing\n\ntheoremEnvironment :: PandocMonad m\n                   => LP m Blocks -> LP m Inlines -> Text -> LP m Blocks\ntheoremEnvironment blocks opt name = do\n  resetCaption\n  tmap <- sTheoremMap <$> getState\n  case M.lookup name tmap of\n    Nothing -> mzero\n    Just tspec -> do\n       optTitle <- option mempty $ (\\x -> space <> \"(\" <> x <> \")\") <$> opt\n       bs <- env name blocks\n       let mblabel = listToMaybe $ mapMaybe extractLabelFromBlock (toList bs)\n\n       number <-\n         if theoremNumber tspec\n            then do\n               let name' = fromMaybe name $ theoremSeries tspec\n               num <- getNextNumber\n                   (maybe (DottedNum [0]) theoremLastNum .\n                    M.lookup name' . sTheoremMap)\n               updateState $ \\s ->\n                 s{ sTheoremMap =\n                       M.adjust\n                       (\\spec -> spec{ theoremLastNum = num })\n                       name'\n                       (sTheoremMap s)\n                  }\n\n               case mblabel of\n                 Just ident ->\n                   updateState $ \\s ->\n                     s{ sLabels = M.insert ident\n                         (B.toList $ str (renderDottedNum num)) (sLabels s) }\n                 Nothing -> return ()\n               return $ space <> B.text (renderDottedNum num)\n            else return mempty\n       let titleEmph = case theoremStyle tspec of\n                         PlainStyle      -> B.strong\n                         DefinitionStyle -> B.strong\n                         RemarkStyle     -> B.emph\n       let title = titleEmph (theoremName tspec <> number)\n                      <> optTitle <> \".\" <> space\n       return $ divWith (fromMaybe \"\" mblabel, [name], [])\n              $ addTitle title\n              $ maybe id removeLabel mblabel\n              $ case theoremStyle tspec of\n                  PlainStyle -> walk italicize bs\n                  _          -> bs\n\n\nproof :: PandocMonad m => LP m Blocks -> LP m Inlines -> LP m Blocks\nproof blocks opt = do\n  title <- option (B.text \"Proof\") opt\n  bs <- env \"proof\" blocks\n  return $\n    B.divWith (\"\", [\"proof\"], []) $\n      addQed $ addTitle (B.emph (title <> \".\")) bs\n\naddTitle :: Inlines -> Blocks -> Blocks\naddTitle ils bs =\n  case B.toList bs of\n    (Para xs : rest)\n      -> B.fromList (Para (B.toList ils ++ (Space : xs)) : rest)\n    _ -> B.para ils <> bs\n\naddQed :: Blocks -> Blocks\naddQed bs =\n  case Seq.viewr (B.unMany bs) of\n    s Seq.:> Para ils\n      -> B.Many (s Seq.|> Para (ils ++ B.toList qedSign))\n    _ -> bs <> B.para qedSign\n where\n  qedSign = B.str \"\\xa0\\x25FB\"\n\nitalicize :: Block -> Block\nitalicize x@(Para [Image{}])  = x -- see #6925\nitalicize x@(Plain [Image{}]) = x -- ditto\nitalicize (Para ils) = Para [Emph ils]\nitalicize (Plain ils) = Plain [Emph ils]\nitalicize x = x\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Parsing.hs",
    "content": "{-# LANGUAGE FlexibleInstances     #-}\n{-# LANGUAGE FlexibleContexts      #-}\n{-# LANGUAGE LambdaCase            #-}\n{-# LANGUAGE BangPatterns          #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE OverloadedStrings     #-}\n{-# LANGUAGE ScopedTypeVariables   #-}\n{- |\n   Module      : Text.Pandoc.Readers.LaTeX.Parsing\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nGeneral parsing types and functions for LaTeX.\n-}\nmodule Text.Pandoc.Readers.LaTeX.Parsing\n  ( DottedNum(..)\n  , renderDottedNum\n  , incrementDottedNum\n  , TheoremSpec(..)\n  , TheoremStyle(..)\n  , LaTeXState(..)\n  , defaultLaTeXState\n  , LP\n  , TokStream(..)\n  , withVerbatimMode\n  , rawLaTeXParser\n  , applyMacros\n  , tokenize\n  , tokenizeSources\n  , getInputTokens\n  , untokenize\n  , untoken\n  , satisfyTok\n  , peekTok\n  , parseFromToks\n  , disablingWithRaw\n  , doMacros\n  , doMacros'\n  , setpos\n  , anyControlSeq\n  , anySymbol\n  , isNewlineTok\n  , isWordTok\n  , isArgTok\n  , infile\n  , spaces\n  , spaces1\n  , tokTypeIn\n  , controlSeq\n  , symbol\n  , symbolIn\n  , sp\n  , whitespace\n  , newlineTok\n  , comment\n  , anyTok\n  , singleChar\n  , tokWith\n  , specialChars\n  , endline\n  , blankline\n  , primEscape\n  , bgroup\n  , egroup\n  , grouped\n  , braced\n  , braced'\n  , bracedUrl\n  , bracedOrToken\n  , bracketed\n  , bracketedToks\n  , parenWrapped\n  , dimenarg\n  , ignore\n  , withRaw\n  , keyvals\n  , verbEnv\n  , begin_\n  , end_\n  , getRawCommand\n  , skipopts\n  , rawopt\n  , overlaySpecification\n  , getNextNumber\n  , label\n  , setCaption\n  , resetCaption\n  , env\n  , addMeta\n  , removeLabel\n  ) where\n\nimport Control.Applicative (many, (<|>))\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport Control.Monad.Trans (lift)\nimport Data.Char (chr, isAlphaNum, isDigit, isLetter, ord)\nimport Data.Default\nimport Data.List (intercalate)\nimport qualified Data.IntMap as IntMap\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport Data.Maybe (fromMaybe)\nimport Data.List.NonEmpty (NonEmpty(..))\nimport qualified Data.List.NonEmpty as NonEmpty\nimport qualified Data.Text as T\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Error\n         (PandocError (PandocMacroLoop,PandocShouldNeverHappenError))\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (blankline, many, mathDisplay, mathInline,\n                            space, spaces, withRaw, (<|>))\nimport Text.Pandoc.TeX (ExpansionPoint (..), Macro (..),\n                                        ArgSpec (..), Tok (..), TokType (..))\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Walk\n\nnewtype DottedNum = DottedNum [Int]\n  deriving (Show, Eq)\n\nrenderDottedNum :: DottedNum -> T.Text\nrenderDottedNum (DottedNum xs) = T.pack $\n  intercalate \".\" (map show xs)\n\nincrementDottedNum :: Int -> DottedNum -> DottedNum\nincrementDottedNum level (DottedNum ns) = DottedNum $\n  case reverse (take level (ns ++ repeat 0)) of\n       (x:xs) -> reverse (x+1 : xs)\n       []     -> []  -- shouldn't happen\n\ndata TheoremStyle =\n  PlainStyle | DefinitionStyle | RemarkStyle\n  deriving (Show, Eq)\n\ndata TheoremSpec =\n  TheoremSpec\n    { theoremName    :: Inlines\n    , theoremStyle   :: TheoremStyle\n    , theoremSeries  :: Maybe Text\n    , theoremSyncTo  :: Maybe Text\n    , theoremNumber  :: Bool\n    , theoremLastNum :: DottedNum }\n    deriving (Show, Eq)\n\ndata LaTeXState = LaTeXState{ sOptions       :: ReaderOptions\n                            , sMeta          :: Meta\n                            , sQuoteContext  :: QuoteContext\n                            , sMacros        :: NonEmpty (M.Map Text Macro)\n                            , sContainers    :: [Text]\n                            , sLogMessages   :: [LogMessage]\n                            , sIdentifiers   :: Set.Set Text\n                            , sVerbatimMode  :: Bool\n                            , sMathMode      :: Bool\n                            , sCaption       :: Maybe Caption\n                            , sInListItem    :: Bool\n                            , sInTableCell   :: Bool\n                            , sLastHeaderNum :: DottedNum\n                            , sLastFigureNum :: DottedNum\n                            , sLastTableNum  :: DottedNum\n                            , sLastNoteNum   :: Int\n                            , sFootnoteTexts :: M.Map Int Blocks\n                            , sTheoremMap    :: M.Map Text TheoremSpec\n                            , sLastTheoremStyle :: TheoremStyle\n                            , sLastLabel     :: Maybe Text\n                            , sLabels        :: M.Map Text [Inline]\n                            , sHasChapters   :: Bool\n                            , sToggles       :: M.Map Text Bool\n                            , sFileContents  :: M.Map Text Text\n                            , sEnableWithRaw :: Bool\n                            , sRawTokens     :: IntMap.IntMap [Tok]\n                            , sLigatures     :: Bool\n                            }\n     deriving Show\n\ndefaultLaTeXState :: LaTeXState\ndefaultLaTeXState = LaTeXState{ sOptions       = def\n                              , sMeta          = nullMeta\n                              , sQuoteContext  = NoQuote\n                              , sMacros        = M.empty :| []\n                              , sContainers    = []\n                              , sLogMessages   = []\n                              , sIdentifiers   = Set.empty\n                              , sVerbatimMode  = False\n                              , sMathMode      = False\n                              , sCaption       = Nothing\n                              , sInListItem    = False\n                              , sInTableCell   = False\n                              , sLastHeaderNum = DottedNum []\n                              , sLastFigureNum = DottedNum []\n                              , sLastTableNum  = DottedNum []\n                              , sLastNoteNum   = 0\n                              , sFootnoteTexts = M.empty\n                              , sTheoremMap    = M.empty\n                              , sLastTheoremStyle = PlainStyle\n                              , sLastLabel     = Nothing\n                              , sLabels        = M.empty\n                              , sHasChapters   = False\n                              , sToggles       = M.empty\n                              , sFileContents  = M.empty\n                              , sEnableWithRaw = True\n                              , sRawTokens     = IntMap.empty\n                              , sLigatures     = True\n                              }\n\ninstance PandocMonad m => HasQuoteContext LaTeXState m where\n  getQuoteContext = sQuoteContext <$> getState\n  withQuoteContext context parser = do\n    oldState <- getState\n    let oldQuoteContext = sQuoteContext oldState\n    setState oldState { sQuoteContext = context }\n    result <- parser\n    newState <- getState\n    setState newState { sQuoteContext = oldQuoteContext }\n    return result\n\ninstance HasLogMessages LaTeXState where\n  addLogMessage msg st = st{ sLogMessages = msg : sLogMessages st }\n  getLogMessages st = reverse $ sLogMessages st\n\ninstance HasIdentifierList LaTeXState where\n  extractIdentifierList     = sIdentifiers\n  updateIdentifierList f st = st{ sIdentifiers = f $ sIdentifiers st }\n\ninstance HasIncludeFiles LaTeXState where\n  getIncludeFiles = sContainers\n  addIncludeFile f s = s{ sContainers = f : sContainers s }\n  dropLatestIncludeFile s = s { sContainers = drop 1 $ sContainers s }\n\ninstance HasMacros LaTeXState where\n  extractMacros  st  = NonEmpty.head $ sMacros st\n  updateMacros f st  = st{ sMacros = f (NonEmpty.head (sMacros st))\n                                     :| NonEmpty.tail (sMacros st) }\n\ninstance HasReaderOptions LaTeXState where\n  extractReaderOptions = sOptions\n\ninstance HasMeta LaTeXState where\n  setMeta field val st =\n    st{ sMeta = setMeta field val $ sMeta st }\n  deleteMeta field st =\n    st{ sMeta = deleteMeta field $ sMeta st }\n\ninstance Default LaTeXState where\n  def = defaultLaTeXState\n\n-- The Boolean is True if macros have already been expanded,\n-- False if they need expanding.\ndata TokStream = TokStream !Bool [Tok]\n  deriving (Show)\n\ninstance Semigroup TokStream where\n  (TokStream exp1 ts1) <> (TokStream exp2 ts2) =\n    TokStream (if null ts1 then exp2 else exp1) (ts1 <> ts2)\n\ninstance Monoid TokStream where\n  mempty = TokStream False mempty\n  mappend = (<>)\n\ninstance Monad m => Stream TokStream m Tok where\n  uncons (TokStream _ []) = return Nothing\n  uncons (TokStream _ (t:ts)) = return $ Just (t, TokStream False ts)\n\ntype LP m = ParsecT TokStream LaTeXState m\n\nwithVerbatimMode :: PandocMonad m => LP m a -> LP m a\nwithVerbatimMode parser = do\n  alreadyVerbatimMode <- sVerbatimMode <$> getState\n  if alreadyVerbatimMode\n     then parser\n     else do\n       updateState $ \\st -> st{ sVerbatimMode = True }\n       result <- parser\n       updateState $ \\st -> st{ sVerbatimMode = False }\n       return result\n\nrawLaTeXParser :: (PandocMonad m, HasMacros s, HasReaderOptions s, Show a)\n               => [Tok] -> LP m () -> LP m a\n               -> ParsecT Sources s m (a, Text)\nrawLaTeXParser toks parser valParser = do\n  pstate <- getState\n  let lstate = def{ sOptions = extractReaderOptions pstate }\n  let lstate' = lstate { sMacros = extractMacros pstate :| [] }\n  let setStartPos = case toks of\n                      Tok pos _ _ : _ -> setPosition pos\n                      _ -> return ()\n  let preparser = setStartPos >> parser\n  let rawparser = (,) <$> withRaw valParser <*> getState\n  res' <- lift $ runParserT (withRaw (preparser >> getPosition))\n                            lstate \"chunk\" $ TokStream False toks\n  case res' of\n       Left _    -> mzero\n       Right (endpos, toks') -> do\n         res <- lift $ runParserT rawparser lstate' \"chunk\"\n                     $ TokStream False toks'\n         case res of\n              Left _    -> mzero\n              Right ((val, raw), st) -> do\n                updateState (updateMacros ((NonEmpty.head (sMacros st)) <>))\n                let rawChar = do\n                      pos <- getPosition\n                      if pos >= endpos\n                         then mzero\n                         else anyChar\n                result <- (guardEnabled Ext_latex_macros\n                             >> (untokenize raw <$ skipMany rawChar))\n                          <|> T.pack <$> many rawChar\n                -- ensure we end with space if input did, see #4442\n                let result' =\n                      case reverse toks' of\n                        (Tok _ (CtrlSeq _) t : _)\n                         | \" \" `T.isSuffixOf` t\n                         , not (\" \" `T.isSuffixOf` result)\n                          -> result <> \" \"\n                        _ -> result\n                return (val, result')\n\napplyMacros :: (PandocMonad m, HasMacros s, HasReaderOptions s)\n            => Text -> ParsecT Sources s m Text\napplyMacros s = (guardDisabled Ext_latex_macros >> return s) <|>\n   do let retokenize = untokenize <$> many anyTok\n      pstate <- getState\n      let lstate = def{ sOptions = extractReaderOptions pstate\n                      , sMacros  = extractMacros pstate :| [] }\n      res <- runParserT retokenize lstate \"math\" $\n                 TokStream False (tokenize (initialPos \"math\") s)\n      case res of\n           Left e   -> Prelude.fail (show e)\n           Right s' -> return s'\n\n{-\nWhen tokenize or untokenize change, test with this\nQuickCheck property:\n\n> tokUntokRoundtrip :: String -> Bool\n> tokUntokRoundtrip s =\n>   let t = T.pack s in untokenize (tokenize \"random\" t) == t\n-}\n\ntokenizeSources :: Sources -> [Tok]\ntokenizeSources = concatMap tokenizeSource . unSources\n where\n   tokenizeSource (pos, t) = tokenize pos t\n\n-- Return tokens from input sources. Ensure that starting position is\n-- correct.\ngetInputTokens :: PandocMonad m => ParsecT Sources s m [Tok]\ngetInputTokens = do\n  pos <- getPosition\n  ss <- getInput\n  return $\n    case ss of\n      Sources [] -> []\n      Sources ((_,t):rest) -> tokenizeSources $ Sources ((pos,t):rest)\n\ntokenize :: SourcePos -> Text -> [Tok]\ntokenize = totoks False\n where\n  totoks atIsLetter pos t =\n    case T.uncons t of\n       Nothing        -> []\n       Just (c, rest)\n         | c == '\\n' ->\n           Tok pos Newline \"\\n\"\n           : totoks atIsLetter (setSourceColumn (incSourceLine pos 1) 1) rest\n         | isSpaceOrTab c ->\n           let (sps, rest') = T.span isSpaceOrTab t\n           in  Tok pos Spaces sps\n               : totoks atIsLetter (incSourceColumn pos (T.length sps))\n                 rest'\n         | isAlphaNum c ->\n           let (ws, rest') = T.span isAlphaNum t\n           in  Tok pos Word ws\n               : totoks atIsLetter (incSourceColumn pos (T.length ws)) rest'\n         | c == '%' ->\n           let (cs, rest') = T.break (== '\\n') rest\n           in  Tok pos Comment (\"%\" <> cs)\n               : totoks atIsLetter (incSourceColumn pos (1 + T.length cs)) rest'\n         | c == '\\\\' ->\n           case T.uncons rest of\n                Nothing -> [Tok pos (CtrlSeq \" \") \"\\\\\"]\n                Just (d, rest')\n                  | isLetter' atIsLetter d ->\n                      let (ws, rest'') = T.span (isLetter' atIsLetter) rest\n                          (ss, rest''') = T.span isSpaceOrTab rest''\n                          atIsLetter' = case ws of\n                                          \"makeatletter\" -> True\n                                          \"makeatother\" -> False\n                                          _ -> atIsLetter\n                      in  Tok pos (CtrlSeq ws) (\"\\\\\" <> ws <> ss)\n                          : totoks atIsLetter' (incSourceColumn pos\n                               (1 + T.length ws + T.length ss)) rest'''\n                  | isSpaceOrTab d || d == '\\n' ->\n                      let (w1, r1) = T.span isSpaceOrTab rest\n                          (w2, (w3, r3)) = case T.uncons r1 of\n                                          Just ('\\n', r2)\n                                                  -> (T.pack \"\\n\",\n                                                        T.span isSpaceOrTab r2)\n                                          _ -> (mempty, (mempty, r1))\n                          ws = \"\\\\\" <> w1 <> w2 <> w3\n                      in  case T.uncons r3 of\n                               Just ('\\n', _) ->\n                                 Tok pos (CtrlSeq \" \") (\"\\\\\" <> w1)\n                                 : totoks atIsLetter\n                                    (incSourceColumn pos (T.length ws)) r1\n                               _ ->\n                                 Tok pos (CtrlSeq \" \") ws\n                                 : totoks atIsLetter\n                                    (incSourceColumn pos (T.length ws)) r3\n                  | otherwise  ->\n                      Tok pos (CtrlSeq (T.singleton d)) (T.pack [c,d])\n                      : totoks atIsLetter (incSourceColumn pos 2) rest'\n         | c == '#' ->\n           case T.uncons rest of\n             Just ('#', t3) ->\n               let (t1, t2) = T.span (\\d -> d >= '0' && d <= '9') t3\n               in  case safeRead t1 of\n                        Just i ->\n                           Tok pos (DeferredArg i) (\"##\" <> t1)\n                           : totoks atIsLetter\n                              (incSourceColumn pos (2 + T.length t1)) t2\n                        Nothing -> Tok pos Symbol \"#\"\n                                  : Tok (incSourceColumn pos 1) Symbol \"#\"\n                                  : totoks atIsLetter (incSourceColumn pos 1) t3\n             _ ->\n               let (t1, t2) = T.span (\\d -> d >= '0' && d <= '9') rest\n               in  case safeRead t1 of\n                        Just i ->\n                           Tok pos (Arg i) (\"#\" <> t1)\n                           : totoks atIsLetter\n                               (incSourceColumn pos (1 + T.length t1)) t2\n                        Nothing -> Tok pos Symbol \"#\"\n                                  : totoks atIsLetter (incSourceColumn pos 1) rest\n         | c == '^' ->\n           case T.uncons rest of\n                Just ('^', rest') ->\n                  case T.uncons rest' of\n                       Just (d, rest'')\n                         | isLowerHex d ->\n                           case T.uncons rest'' of\n                                Just (e, rest''') | isLowerHex e ->\n                                  Tok pos Esc2 (T.pack ['^','^',d,e])\n                                  : totoks atIsLetter\n                                     (incSourceColumn pos 4) rest'''\n                                _ ->\n                                  Tok pos Esc1 (T.pack ['^','^',d])\n                                  : totoks atIsLetter\n                                      (incSourceColumn pos 3) rest''\n                         | d < '\\128' ->\n                                  Tok pos Esc1 (T.pack ['^','^',d])\n                                  : totoks atIsLetter\n                                     (incSourceColumn pos 3) rest''\n                       _ -> Tok pos Symbol \"^\" :\n                            Tok (incSourceColumn pos 1) Symbol \"^\" :\n                            totoks atIsLetter (incSourceColumn pos 2) rest'\n                _ -> Tok pos Symbol \"^\"\n                     : totoks atIsLetter (incSourceColumn pos 1) rest\n         | otherwise ->\n           Tok pos Symbol (T.singleton c) :\n             totoks atIsLetter (incSourceColumn pos 1) rest\n\nisSpaceOrTab :: Char -> Bool\nisSpaceOrTab ' '  = True\nisSpaceOrTab '\\t' = True\nisSpaceOrTab _    = False\n\n-- First parameter is True if @ is letter\nisLetter' :: Bool -> Char -> Bool\nisLetter' True '@' = True\nisLetter' _ c = isLetter c\n\nisLetterOrAt :: Char -> Bool\nisLetterOrAt '@' = True\nisLetterOrAt c   = isLetter c\n\nisLowerHex :: Char -> Bool\nisLowerHex x = x >= '0' && x <= '9' || x >= 'a' && x <= 'f'\n\nuntokenize :: [Tok] -> Text\nuntokenize = foldr untokenAccum mempty\n\nuntokenAccum :: Tok -> Text -> Text\nuntokenAccum (Tok _ (CtrlSeq _) t) accum =\n  -- insert space to prevent breaking a control sequence; see #5836\n  case (T.unsnoc t, T.uncons accum) of\n    (Just (_,c), Just (d,_))\n      | isLetter c\n      , isLetter d\n      -> t <> \" \" <> accum\n    _ -> t <> accum\nuntokenAccum (Tok _ _ t) accum = t <> accum\n\nuntoken :: Tok -> Text\nuntoken t = untokenAccum t mempty\n\nparseFromToks :: PandocMonad m => LP m a -> [Tok] -> LP m a\nparseFromToks parser toks = do\n  oldInput <- getInput\n  setInput $ TokStream False toks\n  oldpos <- getPosition\n  case toks of\n     Tok pos _ _ : _ -> setPosition pos\n     _ -> return ()\n  -- we ignore existing raw tokens maps (see #9517)\n  oldRawTokens <- sRawTokens <$> getState\n  updateState $ \\st -> st{ sRawTokens = mempty }\n  result <- parser\n  updateState $ \\st -> st{ sRawTokens = oldRawTokens }\n  setInput oldInput\n  setPosition oldpos\n  return result\n\ndisablingWithRaw :: PandocMonad m => LP m a -> LP m a\ndisablingWithRaw parser = do\n  oldEnableWithRaw <- sEnableWithRaw <$> getState\n  updateState $ \\st -> st{ sEnableWithRaw = False }\n  result <- parser\n  updateState $ \\st -> st{ sEnableWithRaw = oldEnableWithRaw }\n  return result\n\nsatisfyTok :: PandocMonad m => (Tok -> Bool) -> LP m Tok\nsatisfyTok f = do\n    doMacros -- apply macros on remaining input stream\n    res <- tokenPrim (T.unpack . untoken) updatePos matcher\n    updateState $ \\st ->\n      if sEnableWithRaw st\n         then\n           let !newraws = IntMap.map (res:) $! sRawTokens st\n            in  st{ sRawTokens = newraws }\n         else st\n    return $! res\n  where matcher t | f t       = Just t\n                  | otherwise = Nothing\n        updatePos :: SourcePos -> Tok -> TokStream -> SourcePos\n        updatePos _spos _ (TokStream _ (Tok pos _ _ : _)) = pos\n        updatePos spos (Tok _ _ t) _ = incSourceColumn spos (T.length t)\n\npeekTok :: PandocMonad m => LP m Tok\npeekTok = do\n  doMacros\n  lookAhead (satisfyTok (const True))\n\ndoMacros :: PandocMonad m => LP m ()\ndoMacros = do\n  TokStream macrosExpanded toks <- getInput\n  unless macrosExpanded $ do\n    st <- getState\n    unless (sVerbatimMode st) $\n      doMacros' 1 toks >>= setInput . TokStream True\n\ndoMacros' :: PandocMonad m => Int -> [Tok] -> LP m [Tok]\ndoMacros' n inp =\n  case inp of\n     Tok spos (CtrlSeq \"begin\") _ : Tok _ Symbol \"{\" :\n      Tok _ Word name : Tok _ Symbol \"}\" : ts\n        -> handleMacros n spos name ts <|> return inp\n     Tok spos (CtrlSeq \"end\") _ : Tok _ Symbol \"{\" :\n      Tok _ Word name : Tok _ Symbol \"}\" : ts\n        -> handleMacros n spos (\"end\" <> name) ts <|> return inp\n     Tok _ (CtrlSeq \"expandafter\") _ : t : ts\n        -> combineTok t <$> doMacros' n ts\n     Tok spos (CtrlSeq name) _ : ts\n        -> handleMacros n spos name ts <|> return inp\n     _ -> return inp\n\n  where\n    combineTok (Tok spos (CtrlSeq name) x) (Tok _ Word w : ts)\n      | T.all isLetterOrAt w =\n        Tok spos (CtrlSeq (name <> w)) (x1 <> w <> x2) : ts\n          where (x1, x2) = T.break isSpaceOrTab x\n    combineTok t ts = t:ts\n\n    matchTok (Tok _ toktype txt) =\n      satisfyTok (\\(Tok _ toktype' txt') ->\n                    toktype == toktype' &&\n                    txt == txt')\n\n    matchPattern toks = try $ mapM_ matchTok toks\n\n    getargs argmap [] = return argmap\n    getargs argmap (Pattern toks : rest) = try $ do\n       matchPattern toks\n       getargs argmap rest\n    getargs argmap (ArgNum i : Pattern toks : rest) =\n      try $ do\n        x <- mconcat <$> manyTill (braced <|> ((:[]) <$> anyTok))\n                  (matchPattern toks)\n        getargs (M.insert i x argmap) rest\n    getargs argmap (ArgNum i : rest) = do\n      x <- try $ spaces >> bracedOrToken\n      getargs (M.insert i x argmap) rest\n\n    addTok False _args spos (Tok _ (DeferredArg i) txt) acc =\n      Tok spos (Arg i) txt : acc\n    addTok False args spos (Tok _ (Arg i) _) acc =\n       case M.lookup i args of\n            Nothing -> mzero\n            Just xs -> foldr (addTok True args spos) acc xs\n    -- see #4007\n    addTok _ _ spos (Tok _ (CtrlSeq x) txt)\n           acc@(Tok _ Word _ : _)\n      | not (T.null txt)\n      , isLetter (T.last txt) =\n        Tok spos (CtrlSeq x) (txt <> \" \") : acc\n    addTok _ _ spos t acc = setpos spos t : acc\n\n    handleMacros n' spos name ts = do\n      when (n' > 20)  -- detect macro expansion loops\n        $ throwError $ PandocMacroLoop name\n      (macros :| _ ) <- sMacros <$> getState\n      case M.lookup name macros of\n           Nothing -> trySpecialMacro name ts\n           Just (Macro _scope expansionPoint argspecs optarg newtoks) -> do\n             let getargs' = do\n                   args <-\n                     (case expansionPoint of\n                        ExpandWhenUsed    -> withVerbatimMode\n                        ExpandWhenDefined -> id)\n                     $ case optarg of\n                             Nothing -> getargs M.empty argspecs\n                             Just o  -> do\n                                x <- option o bracketedToks\n                                getargs (M.singleton 1 x) $ drop 1 argspecs\n                   TokStream _ rest <- getInput\n                   return (args, rest)\n             lstate <- getState\n             res <- lift $ runParserT getargs' lstate \"args\" $ TokStream False ts\n             case res of\n               Left _ -> Prelude.fail $ \"Could not parse arguments for \" ++\n                                T.unpack name\n               Right (args, rest) -> do\n                 -- first boolean param is true if we're tokenizing\n                 -- an argument (in which case we don't want to\n                 -- expand #1 etc.)\n                 let result = foldr (addTok False args spos) rest newtoks\n                 case expansionPoint of\n                   ExpandWhenUsed    -> doMacros' (n' + 1) result\n                   ExpandWhenDefined -> return result\n\n-- | Certain macros do low-level tex manipulations that can't\n-- be represented in our Macro type, so we handle them here.\ntrySpecialMacro :: PandocMonad m => Text -> [Tok] -> LP m [Tok]\ntrySpecialMacro \"xspace\" ts = do\n  ts' <- doMacros' 1 ts\n  case ts' of\n    Tok pos Word t : _\n      | startsWithAlphaNum t -> return $ Tok pos Spaces \" \" : ts'\n    _ -> return ts'\ntrySpecialMacro \"iftrue\" ts = handleIf (ifParser True) ts\ntrySpecialMacro \"iffalse\" ts = handleIf (ifParser False) ts\ntrySpecialMacro \"ifmmode\" ts = do\n  mathMode <- sMathMode <$> getState\n  handleIf (ifParser mathMode) ts\ntrySpecialMacro \"ifstrequal\" ts = do\n  handleIf ifStrequalParser ts\ntrySpecialMacro _ _ = mzero\n\nifStrequalParser :: PandocMonad m => LP m [Tok]\nifStrequalParser = do\n  str1 <- braced <|> count 1 anyTok\n  str2 <- braced <|> count 1 anyTok\n  ifequal <- withVerbatimMode (braced <|> count 1 anyTok)\n  ifnotequal <- withVerbatimMode (braced <|> count 1 anyTok)\n  TokStream _ ts <- getInput\n  return $\n    if untokenize str1 == untokenize str2\n       then ifequal ++ ts\n       else ifnotequal ++ ts\n\nhandleIf :: PandocMonad m => LP m [Tok] -> [Tok] -> LP m [Tok]\nhandleIf parser ts = do\n  res' <- lift $ runParserT parser defaultLaTeXState \"tokens\"\n               $ TokStream False ts\n  case res' of\n    Left _ -> Prelude.fail \"Could not parse conditional\"\n    Right ts' -> return ts'\n\nifParser :: PandocMonad m => Bool -> LP m [Tok]\nifParser b = do\n  ifToks <- many (notFollowedBy (controlSeq \"else\" <|> controlSeq \"fi\")\n                    *> anyTok)\n  elseToks <- (controlSeq \"else\" >> manyTill anyTok (controlSeq \"fi\"))\n                 <|> ([] <$ controlSeq \"fi\")\n  TokStream _ rest <- getInput\n  return $ (if b then ifToks else elseToks) ++ rest\n\nstartsWithAlphaNum :: Text -> Bool\nstartsWithAlphaNum t =\n  case T.uncons t of\n       Just (c, _) | isAlphaNum c -> True\n       _           -> False\n\nsetpos :: SourcePos -> Tok -> Tok\nsetpos spos (Tok _ tt txt) = Tok spos tt txt\n\nanyControlSeq :: PandocMonad m => LP m Tok\nanyControlSeq = satisfyTok isCtrlSeq\n\nisCtrlSeq :: Tok -> Bool\nisCtrlSeq (Tok _ (CtrlSeq _) _) = True\nisCtrlSeq _                     = False\n\nanySymbol :: PandocMonad m => LP m Tok\nanySymbol = satisfyTok isSymbolTok\n\nisSymbolTok :: Tok -> Bool\nisSymbolTok (Tok _ Symbol _) = True\nisSymbolTok _                = False\n\nisWordTok :: Tok -> Bool\nisWordTok (Tok _ Word _) = True\nisWordTok _              = False\n\nisArgTok :: Tok -> Bool\nisArgTok (Tok _ (Arg _) _) = True\nisArgTok _                 = False\n\ninfile :: PandocMonad m => SourceName -> LP m Tok\ninfile reference = satisfyTok (\\(Tok source _ _) -> (sourceName source) == reference)\n\nspaces :: PandocMonad m => LP m ()\nspaces = skipMany (satisfyTok (tokTypeIn [Comment, Spaces, Newline]))\n\nspaces1 :: PandocMonad m => LP m ()\nspaces1 = skipMany1 (satisfyTok (tokTypeIn [Comment, Spaces, Newline]))\n\ntokTypeIn :: [TokType] -> Tok -> Bool\ntokTypeIn toktypes (Tok _ tt _) = tt `elem` toktypes\n\ncontrolSeq :: PandocMonad m => Text -> LP m Tok\ncontrolSeq name = satisfyTok isNamed\n  where isNamed (Tok _ (CtrlSeq n) _) = n == name\n        isNamed _                     = False\n\nsymbol :: PandocMonad m => Char -> LP m Tok\nsymbol c = satisfyTok isc\n  where isc (Tok _ Symbol d) = case T.uncons d of\n                                    Just (c',_) -> c == c'\n                                    _           -> False\n        isc _ = False\n\nsymbolIn :: PandocMonad m => [Char] -> LP m Tok\nsymbolIn cs = satisfyTok isInCs\n  where isInCs (Tok _ Symbol d) = case T.uncons d of\n                                       Just (c,_) -> c `elem` cs\n                                       _          -> False\n        isInCs _ = False\n\nsp :: PandocMonad m => LP m ()\nsp = do\n  optional $ skipMany (whitespace <|> comment)\n  optional $ endline  *> skipMany (whitespace <|> comment)\n\nwhitespace :: PandocMonad m => LP m ()\nwhitespace = () <$ satisfyTok isSpaceTok\n\nisSpaceTok :: Tok -> Bool\nisSpaceTok (Tok _ Spaces _) = True\nisSpaceTok _                = False\n\nnewlineTok :: PandocMonad m => LP m ()\nnewlineTok = () <$ satisfyTok isNewlineTok\n\nisNewlineTok :: Tok -> Bool\nisNewlineTok (Tok _ Newline _) = True\nisNewlineTok _                 = False\n\ncomment :: PandocMonad m => LP m ()\ncomment = () <$ satisfyTok isCommentTok\n\nisCommentTok :: Tok -> Bool\nisCommentTok (Tok _ Comment _) = True\nisCommentTok _                 = False\n\nanyTok :: PandocMonad m => LP m Tok\nanyTok = satisfyTok (const True)\n\nsingleCharTok :: PandocMonad m => LP m Tok\nsingleCharTok =\n  satisfyTok $ \\case\n     Tok _ Word  t   -> T.length t == 1\n     Tok _ Symbol t  -> not (T.any (`Set.member` specialChars) t)\n     _               -> False\n\nsingleChar :: PandocMonad m => LP m Tok\nsingleChar = singleCharTok <|> singleCharFromWord\n where\n  singleCharFromWord = do\n    Tok pos toktype t <- disablingWithRaw $ satisfyTok isWordTok\n    let (t1, t2) = (T.take 1 t, T.drop 1 t)\n    TokStream macrosExpanded inp <- getInput\n    setInput $ TokStream macrosExpanded\n             $ Tok pos toktype t1 : Tok (incSourceColumn pos 1) toktype t2 : inp\n    anyTok\n\nspecialChars :: Set.Set Char\nspecialChars = Set.fromList \"#$%&~_^\\\\{}\"\n\nendline :: PandocMonad m => LP m ()\nendline = try $ do\n  newlineTok\n  lookAhead anyTok\n  notFollowedBy blankline\n\nblankline :: PandocMonad m => LP m ()\nblankline = try $ skipMany whitespace *> newlineTok\n\nprimEscape :: PandocMonad m => LP m Char\nprimEscape = do\n  Tok _ toktype t <- satisfyTok (tokTypeIn [Esc1, Esc2])\n  case toktype of\n       Esc1 -> case T.uncons (T.drop 2 t) of\n                    Just (c, _)\n                      | c >= '\\64' && c <= '\\127' -> return (chr (ord c - 64))\n                      | otherwise                 -> return (chr (ord c + 64))\n                    Nothing -> Prelude.fail \"Empty content of Esc1\"\n       Esc2 -> case safeRead (\"0x\" <> T.drop 2 t) of\n                    Just x  -> return (chr x)\n                    Nothing -> Prelude.fail $ \"Could not read: \" ++ T.unpack t\n       _    -> Prelude.fail \"Expected an Esc1 or Esc2 token\" -- should not happen\n\nbgroup :: PandocMonad m => LP m Tok\nbgroup = try $ do\n  optional sp\n  t <- symbol '{' <|> controlSeq \"bgroup\" <|> controlSeq \"begingroup\"\n  -- Add a copy of the macro table to the top of the macro stack,\n  -- private for this group. We inherit all the macros defined in\n  -- the parent group.\n  updateState $ \\s -> s{ sMacros = NonEmpty.cons (NonEmpty.head (sMacros s))\n                                                 (sMacros s) }\n  return t\n\n\negroup :: PandocMonad m => LP m Tok\negroup = do\n  t <- symbol '}' <|> controlSeq \"egroup\" <|> controlSeq \"endgroup\"\n  -- remove the group's macro table from the stack\n  updateState $ \\s -> s{ sMacros = fromMaybe (sMacros s) $\n      NonEmpty.nonEmpty (NonEmpty.tail (sMacros s)) }\n  return t\n\ngrouped :: (PandocMonad m,  Monoid a) => LP m a -> LP m a\ngrouped parser = try $ do\n  bgroup\n  -- first we check for an inner 'grouped', because\n  -- {{a,b}} should be parsed the same as {a,b}\n  try (grouped parser <* egroup) <|> (mconcat <$> manyTill parser egroup)\n\nbraced' :: PandocMonad m => LP m Tok -> LP m [Tok]\nbraced' getTok = symbol '{' *> go (1 :: Int)\n where\n  go n = do\n    t <- getTok\n    case t of\n      Tok _ Symbol \"}\"\n        | n > 1     -> (t:) <$> go (n - 1)\n        | otherwise -> return []\n      Tok _ Symbol \"{\" -> (t:) <$> go (n + 1)\n      _ -> (t:) <$> go n\n\nbraced :: PandocMonad m => LP m [Tok]\nbraced = braced' anyTok\n\n-- URLs require special handling, because they can contain %\n-- characters.  So we retonenize comments as we go...\nbracedUrl :: PandocMonad m => LP m [Tok]\nbracedUrl = braced' (retokenizeComment >> anyTok)\n\n-- For handling URLs, which allow literal % characters...\nretokenizeComment :: PandocMonad m => LP m ()\nretokenizeComment = (do\n  Tok pos Comment txt <- satisfyTok isCommentTok\n  let updPos (Tok pos' toktype' txt') =\n        Tok (incSourceColumn (incSourceLine pos' (sourceLine pos - 1))\n             (sourceColumn pos)) toktype' txt'\n  let newtoks = map updPos $ tokenize pos $ T.tail txt\n  TokStream macrosExpanded ts <- getInput\n  setInput $ TokStream macrosExpanded ((Tok pos Symbol \"%\" : newtoks) ++ ts))\n    <|> return ()\n\nbracedOrToken :: PandocMonad m => LP m [Tok]\nbracedOrToken = braced <|> ((:[]) <$> (anyControlSeq <|> singleChar))\n\nbracketed :: PandocMonad m => Monoid a => LP m a -> LP m a\nbracketed parser = try $ do\n  symbol '['\n  mconcat <$> manyTill parser (symbol ']')\n\nbracketedToks :: PandocMonad m => LP m [Tok]\nbracketedToks = do\n  symbol '['\n  concat <$> manyTill ((snd <$> withRaw (try braced)) <|> count 1 anyTok)\n                      (symbol ']')\n\nparenWrapped :: PandocMonad m => Monoid a => LP m a -> LP m a\nparenWrapped parser = try $ do\n  symbol '('\n  mconcat <$> manyTill parser (symbol ')')\n\ndimenarg :: PandocMonad m => LP m Text\ndimenarg = try $ do\n  optional sp\n  ch  <- option False $ True <$ symbol '='\n  minus <- option \"\" $ \"-\" <$ symbol '-'\n  s1 <- option \"\"\n        (do Tok _ _ s1 <- satisfyTok isWordTok\n            guard (case T.uncons s1 of\n                     Just (c,_) -> isDigit c\n                     Nothing -> False)\n            pure s1)\n  s2 <- option \"\" $ try $ do\n          symbol '.'\n          Tok _ _ t <-  satisfyTok isWordTok\n          return (\".\" <> t)\n  let s = s1 <> s2\n  let (num, rest) = T.span (\\c -> isDigit c || c == '.') s\n  guard $ T.length num > 0\n  guard $ rest `elem`\n    [\"\", \"pt\",\"pc\",\"in\",\"bp\",\"cm\",\"mm\",\"dd\",\"cc\",\"sp\",\"ex\",\"em\",\n     \"mu\", -- \"mu\" in math mode only\n     \"px\" -- \"px\" with pdftex and luatex only\n    ]\n  return $ T.pack ['=' | ch] <> minus <> s\n\nignore :: (Monoid a, PandocMonad m) => Text -> ParsecT s u m a\nignore raw = do\n  pos <- getPosition\n  report $ SkippedContent raw pos\n  return mempty\n\nwithRaw :: PandocMonad m => LP m a -> LP m (a, [Tok])\nwithRaw parser = do\n  rawTokensMap <- sRawTokens <$> getState\n  let key = case IntMap.lookupMax rawTokensMap of\n               Nothing     -> 0\n               Just (n,_)  -> n + 1\n  -- insert empty list at key\n  updateState $ \\st -> st{ sRawTokens =\n                             IntMap.insert key [] $ sRawTokens st }\n  result <- parser\n  mbRevToks <- IntMap.lookup key . sRawTokens <$> getState\n  raw <- case mbRevToks of\n           Just revtoks -> do\n             updateState $ \\st -> st{ sRawTokens =\n                                        IntMap.delete key $ sRawTokens st}\n             return $ reverse revtoks\n           Nothing      ->\n             throwError $ PandocShouldNeverHappenError $\n                \"sRawTokens has nothing at key \" <> T.pack (show key)\n  return (result, raw)\n\nkeyval :: PandocMonad m => LP m (Text, Text)\nkeyval = try $ do\n  sp\n  key <- untokenize <$> many1 (notFollowedBy (symbol '=') >>\n                         (symbol '-' <|> symbol '_' <|> satisfyTok isWordTok))\n  sp\n  val <- option mempty $ do\n           symbol '='\n           sp\n           (untokenize <$> braced) <|>\n             (mconcat <$> many1 (\n                 (untokenize . snd <$> withRaw braced)\n                 <|>\n                 (untokenize <$> many1\n                      (satisfyTok\n                         (\\case\n                                Tok _ Symbol \"]\" -> False\n                                Tok _ Symbol \",\" -> False\n                                Tok _ Symbol \"{\" -> False\n                                Tok _ Symbol \"}\" -> False\n                                _                -> True)))))\n  sp\n  optional (symbol ',')\n  sp\n  return (key, T.strip val)\n\nkeyvals :: PandocMonad m => LP m [(Text, Text)]\nkeyvals = try $ symbol '[' >> manyTill keyval (symbol ']') <* sp\n\nverbEnv :: PandocMonad m => Text -> LP m Text\nverbEnv name = withVerbatimMode $ do\n  optional blankline\n  res <- manyTill anyTok (end_ name)\n  return $ stripTrailingNewline\n         $ untokenize res\n\n-- Strip single final newline and any spaces following it.\n-- Input is unchanged if it doesn't end with newline +\n-- optional spaces.\nstripTrailingNewline :: Text -> Text\nstripTrailingNewline t =\n  let (b, e) = T.breakOnEnd \"\\n\" t\n  in  if T.all (== ' ') e\n         then T.dropEnd 1 b\n         else t\n\nbegin_ :: PandocMonad m => Text -> LP m ()\nbegin_ t = try (do\n  controlSeq \"begin\"\n  spaces\n  txt <- untokenize <$> braced\n  guard (t == txt)) <?> (\"\\\\begin{\" ++ T.unpack t ++ \"}\")\n\nend_ :: PandocMonad m => Text -> LP m ()\nend_ t = try (do\n  controlSeq \"end\"\n  spaces\n  txt <- untokenize <$> braced\n  guard $ t == txt) <?> (\"\\\\end{\" ++ T.unpack t ++ \"}\")\n\ngetRawCommand :: PandocMonad m => Text -> Text -> LP m Text\ngetRawCommand name txt = do\n  (_, rawargs) <- withRaw $\n      case name of\n           \"write\" -> do\n             void $ many $ satisfyTok isDigitTok -- digits\n             void braced\n           \"titleformat\" -> do\n             void braced\n             skipopts\n             void $ count 4 braced\n           \"def\" ->\n             void $ manyTill anyTok braced\n           \"vadjust\" ->\n             void (manyTill anyTok braced) <|>\n                void (satisfyTok isPreTok) -- see #7531\n           _ | isFontSizeCommand name -> return ()\n             | name `elem` [\"hfil\", \"hfill\", \"vfil\", \"vfill\",\n                            \"hfilneg\", \"vfilneg\"] -> return ()\n             | name `elem` [\"hskip\", \"vskip\", \"mskip\"] -> do\n                 dimenarg\n                 skipMany $ try $ do\n                   sp\n                   satisfyTok $\n                     \\case\n                       Tok _ Word \"plus\" -> True\n                       Tok _ Word \"minus\" -> True\n                       _ -> False\n                   dimenarg\n             | otherwise -> do\n               skipopts\n               option \"\" (try dimenarg)\n               void $ many braced\n  return $ txt <> untokenize rawargs\n\nisPreTok :: Tok -> Bool\nisPreTok (Tok _ Word \"pre\") = True\nisPreTok _ = False\n\nisDigitTok :: Tok -> Bool\nisDigitTok (Tok _ Word t) = T.all isDigit t\nisDigitTok _              = False\n\nskipopts :: PandocMonad m => LP m ()\nskipopts = skipMany (void overlaySpecification <|> void rawopt)\n\n-- opts in angle brackets are used in beamer\noverlaySpecification :: PandocMonad m => LP m Text\noverlaySpecification = try $ do\n  symbol '<'\n  t <- untokenize <$> manyTill overlayTok (symbol '>')\n  -- see issue #3368\n  guard $ not (T.all isLetter t) ||\n          t `elem` [\"beamer\",\"presentation\", \"trans\",\n                    \"handout\",\"article\", \"second\"]\n  return $ \"<\" <> t <> \">\"\n\noverlayTok :: PandocMonad m => LP m Tok\noverlayTok =\n  satisfyTok (\\case\n                    Tok _ Word _       -> True\n                    Tok _ Spaces _     -> True\n                    Tok _ Symbol c     -> c `elem` [\"-\",\"+\",\"@\",\"|\",\":\",\",\"]\n                    _                  -> False)\n\nrawopt :: PandocMonad m => LP m Text\nrawopt = try $ do\n  sp\n  inner <- untokenize <$> bracketedToks\n  sp\n  return $ \"[\" <> inner <> \"]\"\n\nisFontSizeCommand :: Text -> Bool\nisFontSizeCommand \"tiny\" = True\nisFontSizeCommand \"scriptsize\" = True\nisFontSizeCommand \"footnotesize\" = True\nisFontSizeCommand \"small\" = True\nisFontSizeCommand \"normalsize\" = True\nisFontSizeCommand \"large\" = True\nisFontSizeCommand \"Large\" = True\nisFontSizeCommand \"LARGE\" = True\nisFontSizeCommand \"huge\" = True\nisFontSizeCommand \"Huge\" = True\nisFontSizeCommand _ = False\n\ngetNextNumber :: Monad m\n              => (LaTeXState -> DottedNum) -> LP m DottedNum\ngetNextNumber getCurrentNum = do\n  st <- getState\n  let chapnum =\n        case sLastHeaderNum st of\n             DottedNum (n:_) | sHasChapters st -> Just n\n             _                                 -> Nothing\n  return . DottedNum $\n    case getCurrentNum st of\n       DottedNum [m,n]  ->\n         case chapnum of\n              Just m' | m' == m   -> [m, n+1]\n                      | otherwise -> [m', 1]\n              Nothing             -> [1]\n                                      -- shouldn't happen\n       DottedNum [n]   ->\n         case chapnum of\n              Just m  -> [m, 1]\n              Nothing -> [n + 1]\n       _               ->\n         case chapnum of\n               Just n  -> [n, 1]\n               Nothing -> [1]\n\nlabel :: PandocMonad m => LP m ()\nlabel = do\n  controlSeq \"label\"\n  t <- braced\n  updateState $ \\st -> st{ sLastLabel = Just $ untokenize t }\n\nsetCaption :: PandocMonad m => LP m Inlines -> LP m ()\nsetCaption inline = try $ do\n  mbshort <- Just . toList <$> bracketed inline <|> pure Nothing\n  ils <- tokWith inline\n  optional $ try $ spaces *> label\n  updateState $ \\st -> st{ sCaption = Just $\n                              Caption mbshort [Plain $ toList ils] }\n\nresetCaption :: PandocMonad m => LP m ()\nresetCaption = updateState $ \\st -> st{ sCaption   = Nothing\n                                      , sLastLabel = Nothing }\n\nenv :: PandocMonad m => Text -> LP m a -> LP m a\nenv name p = do\n  -- environments are groups as far as macros are concerned,\n  -- so we need a local copy of the macro table (see above, bgroup, egroup):\n  updateState $ \\s -> s{ sMacros = NonEmpty.cons (NonEmpty.head (sMacros s))\n                                                 (sMacros s) }\n  result <- p\n  updateState $ \\s -> s{ sMacros = fromMaybe (sMacros s) $\n      NonEmpty.nonEmpty (NonEmpty.tail (sMacros s)) }\n  end_ name\n  return result\n\ntokWith :: PandocMonad m => LP m Inlines -> LP m Inlines\ntokWith inlineParser = try $ spaces >>\n                                 grouped inlineParser\n                            <|> (lookAhead anyControlSeq >> inlineParser)\n                            <|> singleChar'\n  where singleChar' = do\n          Tok _ _ t <- singleChar\n          return $ str t\n\naddMeta :: PandocMonad m => ToMetaValue a => Text -> a -> LP m ()\naddMeta field val = updateState $ \\st ->\n   st{ sMeta = addMetaField field val $ sMeta st }\n\n-- remove label spans to avoid duplicated identifier\nremoveLabel :: Walkable [Inline] a => Text -> a -> a\nremoveLabel lbl = walk go\n where\n  go (Span (_,_,kvs) _ : rest)\n    | Just lbl' <- lookup \"label\" kvs\n    , lbl' == lbl = go (dropWhile isSpaceOrSoftBreak rest)\n  go (x:xs) = x : go xs\n  go [] = []\n  isSpaceOrSoftBreak Space = True\n  isSpaceOrSoftBreak SoftBreak = True\n  isSpaceOrSoftBreak _ = False\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/SIunitx.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Readers.LaTeX.SIunitx\n  ( siunitxCommands )\nwhere\nimport Text.Pandoc.Builder\n    ( space,\n      subscript,\n      superscript,\n      emph,\n      str,\n      fromList,\n      text,\n      Many(Many, unMany),\n      Inline(Superscript, Str),\n      Inlines )\nimport Text.Pandoc.Readers.LaTeX.Parsing\n    ( anyControlSeq,\n      braced,\n      bracketed,\n      controlSeq,\n      grouped,\n      isWordTok,\n      keyvals,\n      satisfyTok,\n      skipopts,\n      spaces1,\n      symbol,\n      untokenize,\n      LP )\nimport Text.Pandoc.TeX\n    ( Tok(Tok), TokType(Word, CtrlSeq) )\nimport Text.Pandoc.Class.PandocMonad ( PandocMonad )\nimport Text.Pandoc.Parsing\n    ( many1,\n      eof,\n      string,\n      satisfy,\n      skipMany,\n      option,\n      many,\n      char,\n      try,\n      skipMany1,\n      runParser,\n      Parsec )\nimport Control.Applicative ((<|>))\nimport Control.Monad (void)\nimport qualified Data.Map as M\nimport Data.Char (isDigit)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.List (intersperse)\nimport qualified Data.Sequence as Seq\nimport Text.Pandoc.Walk (walk)\n\nsiunitxCommands :: PandocMonad m\n                 => LP m Inlines -> M.Map Text (LP m Inlines)\nsiunitxCommands tok = M.fromList\n  [ (\"si\", dosi tok)\n  , (\"unit\", dosi tok) -- v3 version of si\n  , (\"SI\", doSI tok)\n  , (\"qty\", doSI tok) -- v3 version of SI\n  , (\"SIrange\", doSIrange True tok)\n  , (\"qtyrange\", doSIrange True tok) -- v3 version of SIrange\n  , (\"SIlist\", doSIlist tok)\n  , (\"qtylist\", doSIlist tok) -- v3 version of SIlist\n  , (\"numrange\", doSIrange False tok)\n  , (\"numlist\", doSInumlist)\n  , (\"num\", doSInum)\n  , (\"ang\", doSIang)\n  ]\n\ndosi :: PandocMonad m => LP m Inlines -> LP m Inlines\ndosi tok = do\n  options <- option [] keyvals\n  grouped (siUnit options tok) <|> siUnit options tok\n\n-- converts e.g. \\SI{1}[\\$]{} to \"$ 1\" or \\SI{1}{\\euro} to \"1 €\"\ndoSI :: PandocMonad m => LP m Inlines -> LP m Inlines\ndoSI tok = do\n  skipopts\n  value <- doSInum\n  valueprefix <- option \"\" $ bracketed tok\n  unit <- dosi tok\n  return . mconcat $ [valueprefix,\n                      emptyOr160 valueprefix,\n                      value,\n                      emptyOr160 unit,\n                      unit]\n\ndoSInum :: PandocMonad m => LP m Inlines\ndoSInum = skipopts *> (tonum . untokenize <$> braced)\n\ntonum :: Text -> Inlines\ntonum value =\n  case runParser parseNum () \"\" value of\n    Left _    -> text value\n    Right num -> num\n\ndoSInumlist :: PandocMonad m => LP m Inlines\ndoSInumlist = do\n  skipopts\n  xs <- map tonum . T.splitOn \";\" . untokenize <$> braced\n  case xs of\n    []  -> return mempty\n    [x] -> return x\n    _   -> return $\n             mconcat (intersperse (str \",\" <> space) (init xs)) <>\n             text \", & \" <> last xs\n\ndoSIlist :: PandocMonad m => LP m Inlines -> LP m Inlines\ndoSIlist tok = do\n  options <- option [] keyvals\n  nums <- map tonum . T.splitOn \";\" . untokenize <$> braced\n  unit <- grouped (siUnit options tok) <|> siUnit options tok\n  let xs = map (<> (str \"\\xa0\" <> unit)) nums\n  case xs of\n    []  -> return mempty\n    [x] -> return x\n    _   -> return $\n             mconcat (intersperse (str \",\" <> space) (init xs)) <>\n             text \", & \" <> last xs\n\nparseNum :: Parsec Text () Inlines\nparseNum = (mconcat <$> many parseNumPart) <* eof\n\nminus :: Text\nminus = \"\\x2212\"\n\nhyphenToMinus :: Inline -> Inline\nhyphenToMinus (Str t) = Str (T.replace \"-\" minus t)\nhyphenToMinus x = x\n\nparseNumPart :: Parsec Text () Inlines\nparseNumPart =\n  parseDecimalNum <|>\n  parseComma <|>\n  parsePlusMinus <|>\n  parsePM <|>\n  parseI <|>\n  parseExp <|>\n  parseX <|>\n  parseSpace\n where\n  parseDecimalNum, parsePlusMinus, parsePM,\n    parseComma, parseI, parseX,\n    parseExp, parseSpace :: Parsec Text () Inlines\n  parseDecimalNum = try $ do\n    pref <- option mempty $ (mempty <$ char '+') <|> (minus <$ char '-')\n    basenum' <- many1 (satisfy (\\c -> isDigit c || c == '.'))\n    let basenum = pref <> T.pack\n                    (case basenum' of\n                      '.':_ -> '0':basenum'\n                      _ -> basenum')\n    uncertainty <- option mempty $ T.pack <$> parseParens\n    if T.null uncertainty\n       then return $ str basenum\n       else return $ str $ basenum <> \"\\xa0\\xb1\\xa0\" <>\n             let (_,ys) = T.break (=='.') basenum\n              in case (T.length ys - 1, T.length uncertainty) of\n                   (0,_) -> uncertainty\n                   (x,y)\n                     | x > y  -> \"0.\" <> T.replicate (x - y) \"0\" <>\n                                      T.dropWhileEnd (=='0') uncertainty\n                     | otherwise -> T.take (y - x) uncertainty <>\n                                      case T.dropWhileEnd (=='0')\n                                             (T.drop (y - x) uncertainty) of\n                                             t | T.null t -> mempty\n                                               | otherwise -> \".\" <> t\n  parseComma = str \".\" <$ char ','\n  parsePlusMinus = str \"\\xa0\\xb1\\xa0\" <$ try (string \"+-\")\n  parsePM = str \"\\xa0\\xb1\\xa0\" <$ try (string \"\\\\pm\")\n  parseParens =\n    char '(' *> many1 (satisfy (\\c -> isDigit c || c == '.')) <* char ')'\n  parseI = str \"i\" <$ char 'i'\n  parseX = str \"\\xa0\\xd7\\xa0\" <$ char 'x'\n  parseExp = (\\n -> str (\"\\xa0\\xd7\\xa0\" <> \"10\") <> superscript n)\n               <$> (char 'e' *> parseDecimalNum)\n  parseSpace = mempty <$ skipMany1 (char ' ')\n\ndoSIang :: PandocMonad m => LP m Inlines\ndoSIang = do\n  skipopts\n  ps <- T.splitOn \";\" . untokenize <$> braced\n  let dropPlus t = case T.uncons t of\n                     Just ('+',t') -> t'\n                     _ -> t\n  case ps ++ repeat \"\" of\n    (d:m:s:_) -> return $\n      (if T.null d then mempty else str (dropPlus d) <> str \"\\xb0\") <>\n      (if T.null m then mempty else str (dropPlus m) <> str \"\\x2032\") <>\n      (if T.null s then mempty else str (dropPlus s) <> str \"\\x2033\")\n    _ -> return mempty\n\n-- converts e.g. \\SIrange{100}{200}{\\ms} to \"100 ms--200 ms\"\ndoSIrange :: PandocMonad m => Bool -> LP m Inlines -> LP m Inlines\ndoSIrange includeUnits tok = do\n  skipopts\n  startvalue <- doSInum\n  startvalueprefix <- option \"\" $ bracketed tok\n  stopvalue <- doSInum\n  stopvalueprefix <- option \"\" $ bracketed tok\n  unit <- if includeUnits\n             then dosi tok\n             else return mempty\n  return . mconcat $ [startvalueprefix,\n                      emptyOr160 startvalueprefix,\n                      startvalue,\n                      emptyOr160 unit,\n                      unit,\n                      \"\\8211\", -- An en-dash\n                      stopvalueprefix,\n                      emptyOr160 stopvalueprefix,\n                      stopvalue,\n                      emptyOr160 unit,\n                      unit]\n\nemptyOr160 :: Inlines -> Inlines\nemptyOr160 x = if x == mempty then x else str \"\\160\"\n\nsiUnit :: forall m. PandocMonad m => [(Text,Text)] -> LP m Inlines -> LP m Inlines\nsiUnit options tok = mconcat . intersperse (str \"\\xa0\") <$> many1 siUnitPart\n where\n  siUnitPart :: LP m Inlines\n  siUnitPart = try $ do\n    skipMany (void (symbol '.') <|> void (symbol '~') <|> spaces1)\n    x <- ((siPrefix <*> siBase)\n            <|> (do u <- siBase <|> tok\n                    option u $ siSuffix <*> pure u))\n    option x (siInfix x)\n  siInfix :: Inlines -> LP m Inlines\n  siInfix u1 = try $\n       (do _ <- controlSeq \"per\"\n           u2 <- siUnitPart\n           let useSlash = lookup \"per-mode\" options == Just \"symbol\"\n           if useSlash\n              then return (u1 <> str \"/\" <> u2)\n              else return (u1 <> str \"\\xa0\" <> negateExponent u2))\n   <|> (do _ <- symbol '/'\n           u2 <- siUnitPart\n           return (u1 <> str \"/\" <> u2))\n  siPrefix :: LP m (Inlines -> Inlines)\n  siPrefix =\n       (do _ <- controlSeq \"square\"\n           skipopts\n           return (<> superscript \"2\"))\n   <|> (do _ <- controlSeq \"cubic\"\n           skipopts\n           return (<> superscript \"3\"))\n   <|> (do _ <- controlSeq \"raisetothe\"\n           skipopts\n           n <- walk hyphenToMinus <$> tok\n           return (<> superscript n))\n  siSuffix :: LP m (Inlines -> Inlines)\n  siSuffix =\n       (do _ <- controlSeq \"squared\"\n           skipopts\n           return (<> superscript \"2\"))\n   <|> (do _ <- controlSeq \"cubed\"\n           skipopts\n           return (<> superscript \"3\"))\n   <|> (do _ <- controlSeq \"tothe\"\n           skipopts\n           n <- walk hyphenToMinus <$> tok\n           return (<> superscript n))\n   <|> (symbol '^' *> (do n <- walk hyphenToMinus <$> tok\n                          return (<> superscript n)))\n   <|> (symbol '_' *> (do n <- walk hyphenToMinus <$> tok\n                          return (<> subscript n)))\n  negateExponent :: Inlines -> Inlines\n  negateExponent ils =\n    case Seq.viewr (unMany ils) of\n      xs Seq.:> Superscript ss -> (Many xs) <>\n                                     superscript (str minus <> fromList ss)\n      _ -> ils <> superscript (str (minus <> \"1\"))\n  siBase :: LP m Inlines\n  siBase =\n    ((try\n       (do Tok _ (CtrlSeq name) _ <- anyControlSeq\n           case M.lookup name siUnitModifierMap of\n              Just il -> (il <>) <$> siBase\n              Nothing ->\n                case M.lookup name siUnitMap of\n                   Just il -> pure il\n                   Nothing -> fail \"not a unit command\"))\n    <|> (do Tok _ Word t <- satisfyTok isWordTok\n            return $ str t)\n     )\n\nsiUnitModifierMap :: M.Map Text Inlines\nsiUnitModifierMap = M.fromList\n  [ (\"atto\", str \"a\")\n  , (\"centi\", str \"c\")\n  , (\"deca\", str \"d\")\n  , (\"deci\", str \"d\")\n  , (\"deka\", str \"d\")\n  , (\"exa\", str \"E\")\n  , (\"femto\", str \"f\")\n  , (\"giga\", str \"G\")\n  , (\"hecto\", str \"h\")\n  , (\"kilo\", str \"k\")\n  , (\"mega\", str \"M\")\n  , (\"micro\", str \"μ\")\n  , (\"milli\", str \"m\")\n  , (\"nano\", str \"n\")\n  , (\"peta\", str \"P\")\n  , (\"pico\", str \"p\")\n  , (\"tera\", str \"T\")\n  , (\"yocto\", str \"y\")\n  , (\"yotta\", str \"Y\")\n  , (\"zepto\", str \"z\")\n  , (\"zetta\", str \"Z\")\n  ]\n\nsiUnitMap :: M.Map Text Inlines\nsiUnitMap = M.fromList\n  [ (\"fg\", str \"fg\")\n  , (\"pg\", str \"pg\")\n  , (\"ng\", str \"ng\")\n  , (\"ug\", str \"μg\")\n  , (\"mg\", str \"mg\")\n  , (\"g\", str \"g\")\n  , (\"kg\", str \"kg\")\n  , (\"amu\", str \"u\")\n  , (\"pm\", str \"pm\")\n  , (\"nm\", str \"nm\")\n  , (\"um\", str \"μm\")\n  , (\"mm\", str \"mm\")\n  , (\"cm\", str \"cm\")\n  , (\"dm\", str \"dm\")\n  , (\"m\", str \"m\")\n  , (\"km\", str \"km\")\n  , (\"as\", str \"as\")\n  , (\"fs\", str \"fs\")\n  , (\"ps\", str \"ps\")\n  , (\"ns\", str \"ns\")\n  , (\"us\", str \"μs\")\n  , (\"ms\", str \"ms\")\n  , (\"s\", str \"s\")\n  , (\"fmol\", str \"fmol\")\n  , (\"pmol\", str \"pmol\")\n  , (\"nmol\", str \"nmol\")\n  , (\"umol\", str \"μmol\")\n  , (\"mmol\", str \"mmol\")\n  , (\"mol\", str \"mol\")\n  , (\"kmol\", str \"kmol\")\n  , (\"pA\", str \"pA\")\n  , (\"nA\", str \"nA\")\n  , (\"uA\", str \"μA\")\n  , (\"mA\", str \"mA\")\n  , (\"A\", str \"A\")\n  , (\"kA\", str \"kA\")\n  , (\"ul\", str \"μl\")\n  , (\"ml\", str \"ml\")\n  , (\"l\", str \"l\")\n  , (\"hl\", str \"hl\")\n  , (\"uL\", str \"μL\")\n  , (\"mL\", str \"mL\")\n  , (\"L\", str \"L\")\n  , (\"hL\", str \"hL\")\n  , (\"mHz\", str \"mHz\")\n  , (\"Hz\", str \"Hz\")\n  , (\"kHz\", str \"kHz\")\n  , (\"MHz\", str \"MHz\")\n  , (\"GHz\", str \"GHz\")\n  , (\"THz\", str \"THz\")\n  , (\"mN\", str \"mN\")\n  , (\"N\", str \"N\")\n  , (\"kN\", str \"kN\")\n  , (\"MN\", str \"MN\")\n  , (\"Pa\", str \"Pa\")\n  , (\"kPa\", str \"kPa\")\n  , (\"MPa\", str \"MPa\")\n  , (\"GPa\", str \"GPa\")\n  , (\"mohm\", str \"mΩ\")\n  , (\"kohm\", str \"kΩ\")\n  , (\"Mohm\", str \"MΩ\")\n  , (\"pV\", str \"pV\")\n  , (\"nV\", str \"nV\")\n  , (\"uV\", str \"μV\")\n  , (\"mV\", str \"mV\")\n  , (\"V\", str \"V\")\n  , (\"kV\", str \"kV\")\n  , (\"W\", str \"W\")\n  , (\"uW\", str \"μW\")\n  , (\"mW\", str \"mW\")\n  , (\"kW\", str \"kW\")\n  , (\"MW\", str \"MW\")\n  , (\"GW\", str \"GW\")\n  , (\"J\", str \"J\")\n  , (\"uJ\", str \"μJ\")\n  , (\"mJ\", str \"mJ\")\n  , (\"kJ\", str \"kJ\")\n  , (\"eV\", str \"eV\")\n  , (\"meV\", str \"meV\")\n  , (\"keV\", str \"keV\")\n  , (\"MeV\", str \"MeV\")\n  , (\"GeV\", str \"GeV\")\n  , (\"TeV\", str \"TeV\")\n  , (\"kWh\", str \"kWh\")\n  , (\"F\", str \"F\")\n  , (\"fF\", str \"fF\")\n  , (\"pF\", str \"pF\")\n  , (\"K\", str \"K\")\n  , (\"dB\", str \"dB\")\n  , (\"ampere\", str \"A\")\n  , (\"angstrom\", str \"Å\")\n  , (\"arcmin\", str \"′\")\n  , (\"arcminute\", str \"′\")\n  , (\"arcsecond\", str \"″\")\n  , (\"astronomicalunit\", str \"au\")\n  , (\"atomicmassunit\", str \"u\")\n  , (\"bar\", str \"bar\")\n  , (\"barn\", str \"b\")\n  , (\"becquerel\", str \"Bq\")\n  , (\"bel\", str \"B\")\n  , (\"bohr\", emph (str \"a\") <> subscript (str \"0\"))\n  , (\"candela\", str \"cd\")\n  , (\"celsius\", str \"°C\")\n  , (\"clight\", emph (str \"c\") <> subscript (str \"0\"))\n  , (\"coulomb\", str \"C\")\n  , (\"dalton\", str \"Da\")\n  , (\"day\", str \"d\")\n  , (\"decibel\", str \"db\")\n  , (\"degreeCelsius\",str \"°C\")\n  , (\"degree\", str \"°\")\n  , (\"electronmass\", emph (str \"m\") <> subscript (str \"e\"))\n  , (\"electronvolt\", str \"eV\")\n  , (\"elementarycharge\", emph (str \"e\"))\n  , (\"farad\", str \"F\")\n  , (\"gram\", str \"g\")\n  , (\"gray\", str \"Gy\")\n  , (\"hartree\", emph (str \"E\") <> subscript (str \"h\"))\n  , (\"hectare\", str \"ha\")\n  , (\"henry\", str \"H\")\n  , (\"hertz\", str \"Hz\")\n  , (\"hour\", str \"h\")\n  , (\"joule\", str \"J\")\n  , (\"katal\", str \"kat\")\n  , (\"kelvin\", str \"K\")\n  , (\"kilogram\", str \"kg\")\n  , (\"knot\", str \"kn\")\n  , (\"liter\", str \"L\")\n  , (\"litre\", str \"l\")\n  , (\"lumen\", str \"lm\")\n  , (\"lux\", str \"lx\")\n  , (\"meter\", str \"m\")\n  , (\"metre\", str \"m\")\n  , (\"minute\", str \"min\")\n  , (\"mmHg\", str \"mmHg\")\n  , (\"mole\", str \"mol\")\n  , (\"nauticalmile\", str \"M\")\n  , (\"neper\", str \"Np\")\n  , (\"newton\", str \"N\")\n  , (\"ohm\", str \"Ω\")\n  , (\"Pa\", str \"Pa\")\n  , (\"pascal\", str \"Pa\")\n  , (\"percent\", str \"%\")\n  , (\"planckbar\", emph (str \"\\x210f\"))\n  , (\"radian\", str \"rad\")\n  , (\"second\", str \"s\")\n  , (\"siemens\", str \"S\")\n  , (\"sievert\", str \"Sv\")\n  , (\"steradian\", str \"sr\")\n  , (\"tesla\", str \"T\")\n  , (\"tonne\", str \"t\")\n  , (\"volt\", str \"V\")\n  , (\"watt\", str \"W\")\n  , (\"weber\", str \"Wb\")\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX/Table.hs",
    "content": "{-# LANGUAGE BangPatterns #-}\n{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Readers.LaTeX.Table\n  ( tableEnvironments )\nwhere\n\nimport Data.Functor (($>))\nimport Text.Pandoc.Class\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.TeX\nimport Text.Pandoc.Builder as B\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Text as T\nimport Control.Applicative ((<|>), optional, many)\nimport Control.Monad (when, void)\nimport Text.Pandoc.Shared (safeRead, trim)\nimport Text.Pandoc.Logging (LogMessage(SkippedContent))\nimport Text.Pandoc.Walk (walkM)\nimport Text.Pandoc.Parsing hiding (blankline, many, mathDisplay, mathInline,\n                            optional, space, spaces, withRaw, (<|>))\n\ntableEnvironments :: PandocMonad m\n                  => LP m Blocks\n                  -> LP m Inlines\n                  -> M.Map Text (LP m Blocks)\ntableEnvironments block inline =\n  M.fromList\n  [ (\"longtable\",  env \"longtable\" $\n          resetCaption *>\n            simpTable block inline \"longtable\" False >>= addTableCaption)\n  , (\"table\",  env \"table\" $\n          skipopts *> resetCaption *> blocks >>= addTableCaption)\n  , (\"tabular*\", env \"tabular*\" $ simpTable block inline \"tabular*\" True)\n  , (\"tabularx\", env \"tabularx\" $ simpTable block inline \"tabularx\" True)\n  , (\"tabular\", env \"tabular\"  $ simpTable block inline \"tabular\" False)\n  , (\"supertabular\", env \"supertabular\" $ simpTable block inline \"supertabular\" False)\n  , (\"supertabular*\", env \"supertabular*\" $ simpTable block inline \"supertabular*\" False)\n  ]\n where\n   blocks = mconcat <$> many block\n\nhline :: PandocMonad m => LP m ()\nhline = try $ do\n  spaces\n  hasParenArg <-\n      (False <$ controlSeq \"hline\") <|>\n      (False <$ controlSeq \"cline\") <|>\n      (True <$ controlSeq \"cmidrule\") <|>\n      -- booktabs rules:\n      (True <$ controlSeq \"toprule\") <|>\n      (True <$ controlSeq \"bottomrule\") <|>\n      (True <$ controlSeq \"midrule\") <|>\n      (True <$ controlSeq \"endhead\") <|>\n      (True <$ controlSeq \"endfirsthead\")\n  optional rawopt\n  when hasParenArg $ void $ optional (parenWrapped (() <$ singleChar))\n\nlbreak :: PandocMonad m => LP m Tok\nlbreak = (controlSeq \"\\\\\" <|> controlSeq \"tabularnewline\")\n         <* optional (void rawopt) <* spaces\n\namp :: PandocMonad m => LP m Tok\namp = symbol '&'\n\n-- Split a Word into individual Symbols (for parseAligns)\nsplitWordTok :: PandocMonad m => LP m ()\nsplitWordTok = do\n  TokStream macrosExpanded inp <- getInput\n  case inp of\n       (Tok spos Word t : rest) ->\n         setInput $ TokStream macrosExpanded\n                  $ map (Tok spos Symbol . T.singleton) (T.unpack t) <> rest\n       _ -> return ()\n\nparseAligns :: PandocMonad m => LP m [(Alignment, ColWidth, ([Tok], [Tok]))]\nparseAligns = try $ do\n  let maybeBar = skipMany\n        (try $ sp *> (() <$ symbol '|' <|> () <$ (symbol '@' >> braced)))\n  let cAlign = AlignCenter <$ symbol 'c'\n  let lAlign = AlignLeft <$ symbol 'l'\n  let rAlign = AlignRight <$ symbol 'r'\n  let parAlign = AlignLeft <$ symbol 'p'\n  -- aligns from tabularx\n  let xAlign = AlignLeft <$ symbol 'X'\n  let mAlign = AlignLeft <$ symbol 'm'\n  let bAlign = AlignLeft <$ symbol 'b'\n  let alignChar = splitWordTok *> (  cAlign <|> lAlign <|> rAlign <|> parAlign\n                                 <|> xAlign <|> mAlign <|> bAlign )\n  let alignPrefix = symbol '>' >> braced\n  let alignSuffix = symbol '<' >> braced\n  let colWidth = try $ do\n        ts <- braced\n        let isLinewidth (Tok _ (CtrlSeq \"linewidth\") _) = True\n            isLinewidth _ = False\n        case break isLinewidth ts of\n          (ds, _:_) -> return $ safeRead $ trim $ untokenize ds\n          _ -> return Nothing\n  let alignSpec = do\n        pref <- option [] alignPrefix\n        spaces\n        al <- alignChar\n        width <- colWidth <|> option Nothing (do s <- untokenize <$> braced\n                                                 pos <- getPosition\n                                                 report $ SkippedContent s pos\n                                                 return Nothing)\n        spaces\n        suff <- option [] alignSuffix\n        return (al, width, (pref, suff))\n  let starAlign = do -- '*{2}{r}' == 'rr', we just expand like a macro\n        symbol '*'\n        spaces\n        ds <- trim . untokenize <$> bracedOrToken\n        spaces\n        spec <- bracedOrToken\n        case safeRead ds of\n             Just n  -> do\n               TokStream _ ts <- getInput\n               setInput $ TokStream False (mconcat (replicate n spec) ++ ts)\n             Nothing -> Prelude.fail $ \"Could not parse \" <> T.unpack ds <> \" as number\"\n  bgroup\n  spaces\n  maybeBar\n  aligns' <- many $ try $ spaces >> optional starAlign >>\n                            (alignSpec <* maybeBar)\n  spaces\n  egroup\n  spaces\n  return $ map toSpec aligns'\n  where\n    toColWidth (Just w) | w > 0 = ColWidth w\n    toColWidth _                = ColWidthDefault\n    toSpec (x, y, z) = (x, toColWidth y, z)\n\n-- N.B. this parser returns a Row that may have erroneous empty cells\n-- in it. See the note above fixTableHead for details.\nparseTableRow :: PandocMonad m\n              => LP m Blocks -- ^ block parser\n              -> LP m Inlines -- ^ inline parser\n              -> Text   -- ^ table environment name\n              -> [([Tok], [Tok])] -- ^ pref/suffixes\n              -> LP m Row\nparseTableRow block inline envname prefsufs = do\n  notFollowedBy (spaces *> end_ envname)\n  -- contexts that can contain & that is not colsep:\n  let canContainAmp (Tok _ (CtrlSeq \"begin\") _) = True\n      canContainAmp (Tok _ (CtrlSeq \"verb\") _)  = True\n      canContainAmp (Tok _ (CtrlSeq \"Verb\") _)  = True\n      canContainAmp _       = False\n  -- add prefixes and suffixes in token stream:\n  let celltoks (pref, suff) = do\n        prefpos <- getPosition\n        contents <- mconcat <$>\n            many ( snd <$> withRaw\n                     ((lookAhead (controlSeq \"parbox\") >>\n                       void block) -- #5711\n                      <|>\n                      (lookAhead (satisfyTok canContainAmp) >> void inline)\n                      <|>\n                      (lookAhead (controlSeq \"begin\") >>\n                       void block) -- #4746\n                      <|>\n                      (lookAhead (symbol '$') >> void inline))\n                  <|>\n                   (do notFollowedBy\n                         (() <$ amp <|> () <$ lbreak <|> end_ envname)\n                       count 1 anyTok) )\n\n        suffpos <- getPosition\n        option [] (count 1 amp)\n        return $ map (setpos prefpos) pref ++ contents ++ map (setpos suffpos) suff\n  rawcells <- mapM celltoks prefsufs\n  cells <- mapM (parseFromToks (parseTableCell block)) rawcells\n  spaces\n  return $ Row nullAttr cells\n\nparseTableCell :: PandocMonad m => LP m Blocks -> LP m Cell\nparseTableCell block = do\n  spaces\n  updateState $ \\st -> st{ sInTableCell = True }\n  cell' <-   multicolumnCell block\n         <|> multirowCell block\n         <|> parseSimpleCell\n         <|> parseEmptyCell\n  updateState $ \\st -> st{ sInTableCell = False }\n  spaces\n  return cell'\n  where\n    -- The parsing of empty cells is important in LaTeX, especially when dealing\n    -- with multirow/multicolumn. See #6603.\n    parseEmptyCell = spaces $> emptyCell\n    parseSimpleCell = simpleCell <$> (plainify . mconcat <$> many block)\n\n\ncellAlignment :: PandocMonad m => LP m Alignment\ncellAlignment = skipMany (symbol '|') *> alignment <* skipMany (symbol '|')\n  where\n    alignment = do\n      c <- untoken <$> singleChar <* optional braced -- ignore args\n      return $ case c of\n        \"l\" -> AlignLeft\n        \"r\" -> AlignRight\n        \"c\" -> AlignCenter\n        \"*\" -> AlignDefault\n        _   -> AlignDefault\n\nplainify :: Blocks -> Blocks\nplainify bs = case toList bs of\n                [Para ils] -> plain (fromList ils)\n                _          -> bs\n\nmultirowCell :: PandocMonad m => LP m Blocks -> LP m Cell\nmultirowCell block = controlSeq \"multirow\" >> do\n  -- Full prototype for \\multirow macro is:\n  --     \\multirow[vpos]{nrows}[bigstruts]{width}[vmove]{text}\n  -- However, everything except `nrows` and `text` make\n  -- sense in the context of the Pandoc AST\n  _ <- optional $ symbol '[' *> cellAlignment <* symbol ']'   -- vertical position\n  nrows <- fmap (fromMaybe 1 . safeRead . untokenize) braced\n  _ <- optional $ symbol '[' *> manyTill anyTok (symbol ']')  -- bigstrut-related\n  _ <- symbol '{' *> manyTill anyTok (symbol '}')             -- Cell width\n  _ <- optional $ symbol '[' *> manyTill anyTok (symbol ']')  -- Length used for fine-tuning\n  content <- symbol '{' *> (plainify . mconcat <$> many block) <* symbol '}'\n  return $ cell AlignDefault (RowSpan nrows) (ColSpan 1) content\n\nmulticolumnCell :: PandocMonad m => LP m Blocks -> LP m Cell\nmulticolumnCell block = controlSeq \"multicolumn\" >> do\n  span' <- fmap (fromMaybe 1 . safeRead . untokenize) braced\n  alignment <- symbol '{' *> cellAlignment <* symbol '}'\n\n  let singleCell = do\n        content <- plainify . mconcat <$> many block\n        return $ cell alignment (RowSpan 1) (ColSpan span') content\n\n  -- Two possible contents: either a \\multirow cell, or content.\n  -- E.g. \\multicol{1}{c}{\\multirow{2}{1em}{content}}\n  -- Note that a \\multirow cell can be nested in a \\multicolumn,\n  -- but not the other way around. See #6603\n  let nestedCell = do\n        (Cell _ _ (RowSpan rs) _ bs) <- multirowCell block\n        return $ cell\n                  alignment\n                  (RowSpan rs)\n                  (ColSpan span')\n                  (fromList bs)\n\n  symbol '{' *> (nestedCell <|> singleCell) <* symbol '}'\n\n-- LaTeX tables are stored with empty cells underneath multirow cells\n-- denoting the grid spaces taken up by them. More specifically, if a\n-- cell spans m rows, then it will overwrite all the cells in the\n-- columns it spans for (m-1) rows underneath it, requiring padding\n-- cells in these places. These padding cells need to be removed for\n-- proper table reading. See #6603.\n--\n-- These fixTable functions do not otherwise fix up malformed\n-- input tables: that is left to the table builder.\nfixTableHead :: TableHead -> TableHead\nfixTableHead (TableHead attr rows) = TableHead attr rows'\n  where\n    rows' = fixTableRows rows\n\nfixTableBody :: TableBody -> TableBody\nfixTableBody (TableBody attr rhc th tb)\n  = TableBody attr rhc th' tb'\n  where\n    th' = fixTableRows th\n    tb' = fixTableRows tb\n\nfixTableRows :: [Row] -> [Row]\nfixTableRows = fixTableRows' $ repeat Nothing\n  where\n    fixTableRows' oldHang (Row attr cells : rs)\n      = let (newHang, cells') = fixTableRow oldHang cells\n            rs'               = fixTableRows' newHang rs\n        in Row attr cells' : rs'\n    fixTableRows' _ [] = []\n\n-- The overhang is represented as Just (relative cell dimensions) or\n-- Nothing for an empty grid space.\nfixTableRow :: [Maybe (ColSpan, RowSpan)] -> [Cell] -> ([Maybe (ColSpan, RowSpan)], [Cell])\nfixTableRow oldHang cells\n  -- If there's overhang, drop cells until their total width meets the\n  -- width of the occupied grid spaces (or we run out)\n  | (n, prefHang, restHang) <- splitHang oldHang\n  , n > 0\n  = let cells' = dropToWidth getCellW n cells\n        (restHang', cells'') = fixTableRow restHang cells'\n    in (prefHang restHang', cells'')\n  -- Otherwise record the overhang of a pending cell and fix the rest\n  -- of the row\n  | c@(Cell _ _ h w _):cells' <- cells\n  = let h' = max 1 h\n        w' = max 1 w\n        oldHang' = dropToWidth getHangW w' oldHang\n        (newHang, cells'') = fixTableRow oldHang' cells'\n    in (toHang w' h' <> newHang, c : cells'')\n  | otherwise\n  = (oldHang, [])\n  where\n    getCellW (Cell _ _ _ w _) = w\n    getHangW = maybe 1 fst\n    getCS (ColSpan n) = n\n\n    toHang c r\n      | r > 1     = [Just (c, r)]\n      | otherwise = replicate (getCS c) Nothing\n\n    -- Take the prefix of the overhang list representing filled grid\n    -- spaces. Also return the remainder and the length of this prefix.\n    splitHang = splitHang' 0 id\n\n    splitHang' !n l (Just (c, r):xs)\n      = splitHang' (n + c) (l . (toHang c (r-1) ++)) xs\n    splitHang' n l xs = (n, l, xs)\n\n    -- Drop list items until the total width of the dropped items\n    -- exceeds the passed width.\n    dropToWidth _     n l | n < 1 = l\n    dropToWidth wproj n (c:cs)    = dropToWidth wproj (n - wproj c) cs\n    dropToWidth _     _ []        = []\n\nsimpTable :: PandocMonad m\n          => LP m Blocks\n          -> LP m Inlines\n          -> Text\n          -> Bool\n          -> LP m Blocks\nsimpTable block inline envname hasWidthParameter = try $ do\n  when hasWidthParameter $ () <$ tokWith inline\n  skipopts\n  colspecs <- parseAligns\n  let (aligns, widths, prefsufs) = unzip3 colspecs\n  optional $ controlSeq \"caption\" *> setCaption inline\n  spaces\n  optional label\n  spaces\n  optional lbreak\n  spaces\n  skipMany hline\n  spaces\n  header' <- option [] . try . fmap (:[]) $\n             parseTableRow block inline envname prefsufs <*\n               lbreak <* many1 hline\n  spaces\n  rows <- sepEndBy (parseTableRow block inline envname prefsufs)\n                    (lbreak <* optional (skipMany hline))\n  spaces\n  optional $ controlSeq \"caption\" *> setCaption inline\n  spaces\n  optional label\n  spaces\n  optional lbreak\n  spaces\n  lookAhead $ controlSeq \"end\" -- make sure we're at end\n  let th  = fixTableHead $ TableHead nullAttr header'\n  let tbs = [fixTableBody $ TableBody nullAttr 0 [] rows]\n  let tf  = TableFoot nullAttr []\n  return $ table emptyCaption (zip aligns widths) th tbs tf\n\naddTableCaption :: PandocMonad m => Blocks -> LP m Blocks\naddTableCaption = walkM go\n  where go (Table attr c spec th tb tf) = do\n          st <- getState\n          let capt = fromMaybe c $ sCaption st\n          let mblabel = sLastLabel st\n          case mblabel of\n            Nothing -> return ()\n            Just lab -> do\n                     num <- getNextNumber sLastTableNum\n                     setState\n                       st{ sLastTableNum = num\n                         , sLabels = M.insert lab\n                                    [Str (renderDottedNum num)]\n                                    (sLabels st) }\n          -- add num to caption?\n          let attr' = case (attr, mblabel) of\n                        ((_,classes,kvs), Just ident) ->\n                           (ident,classes,kvs)\n                        _ -> attr\n          return $ addAttrDiv attr'\n                 $ maybe id removeLabel mblabel\n                 $ Table nullAttr capt spec th tb tf\n        go x = return x\n\n-- TODO: For now we add a Div to contain table attributes, since\n-- most writers don't do anything yet with attributes on Table.\n-- This can be removed when that changes.\naddAttrDiv :: Attr -> Block -> Block\naddAttrDiv (\"\",[],[]) b = b\naddAttrDiv attr b       = Div attr [b]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/LaTeX.hs",
    "content": "{-# LANGUAGE OverloadedStrings     #-}\n{-# LANGUAGE PatternGuards         #-}\n{-# LANGUAGE ScopedTypeVariables   #-}\n{-# LANGUAGE ViewPatterns          #-}\n{- |\n   Module      : Text.Pandoc.Readers.LaTeX\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of LaTeX to 'Pandoc' document.\n\n-}\nmodule Text.Pandoc.Readers.LaTeX ( readLaTeX,\n                                   applyMacros,\n                                   rawLaTeXInline,\n                                   rawLaTeXBlock,\n                                   inlineCommand\n                                 ) where\n\nimport Control.Applicative (many, optional, (<|>))\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Char (isDigit, isLetter, isAlphaNum, toUpper, chr)\nimport Data.Default\nimport Data.List (intercalate)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, maybeToList)\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.Either (partitionEithers)\nimport Skylighting (defaultSyntaxMap)\nimport System.FilePath (addExtension, replaceExtension, takeExtension)\nimport Text.Collate.Lang (renderLang)\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Class (PandocPure, PandocMonad (..), getResourcePath,\n                          readFileFromDirs, report,\n                          setResourcePath, getZonedTime)\nimport Data.Time (ZonedTime(..), LocalTime(..), showGregorian)\nimport Text.Pandoc.Error (PandocError (PandocParseError))\nimport Text.Pandoc.Highlighting (languagesByExtension)\nimport Text.Pandoc.ImageSize (numUnit, showFl)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (blankline, many, mathDisplay, mathInline,\n                            optional, space, spaces, withRaw, (<|>))\nimport Text.Pandoc.TeX (Tok (..), TokType (..))\nimport Text.Pandoc.Readers.LaTeX.Parsing\nimport Text.Pandoc.Readers.LaTeX.Citation (citationCommands, cites)\nimport Text.Pandoc.Readers.LaTeX.Math (withMathMode, dollarsMath,\n                                       inlineEnvironments, inlineEnvironment,\n                                       mathDisplay, mathInline,\n                                       newtheorem, theoremstyle, proof,\n                                       theoremEnvironment)\nimport Text.Pandoc.Readers.LaTeX.Table (tableEnvironments)\nimport Text.Pandoc.Readers.LaTeX.Macro (macroDef)\nimport Text.Pandoc.Readers.LaTeX.Lang (inlineLanguageCommands,\n                                       enquoteCommands,\n                                       babelLangToBCP47,\n                                       setDefaultLanguage)\nimport Text.Pandoc.Readers.LaTeX.SIunitx (siunitxCommands)\nimport Text.Pandoc.Readers.LaTeX.Inline (acronymCommands, refCommands,\n                                         nameCommands, charCommands,\n                                         accentCommands,\n                                         miscCommands,\n                                         biblatexInlineCommands,\n                                         verbCommands, rawInlineOr,\n                                         listingsLanguage)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Walk\nimport Data.List.NonEmpty (nonEmpty)\n\n-- for debugging:\n-- import Text.Pandoc.Extensions (getDefaultExtensions)\n-- import Text.Pandoc.Class.PandocIO (runIOorExplode, PandocIO)\n-- import Debug.Trace (traceShowId)\n\n-- | Parse LaTeX from string and return 'Pandoc' document.\nreadLaTeX :: (PandocMonad m, ToSources a)\n          => ReaderOptions -- ^ Reader options\n          -> a             -- ^ Input to parse\n          -> m Pandoc\nreadLaTeX opts ltx = do\n  let sources = toSources ltx\n  parsed <- runParserT parseLaTeX def{ sOptions = opts } \"source\"\n               (TokStream False (tokenizeSources sources))\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError $ fromParsecError sources e\n\nparseLaTeX :: PandocMonad m => LP m Pandoc\nparseLaTeX = do\n  bs <- blocks\n  eof\n  st <- getState\n  let meta = sMeta st\n  let doc' = doc bs\n  let headerLevel (Header n _ _) = [n]\n      headerLevel _              = []\n  let bottomLevel = maybe 1 minimum $ nonEmpty $ query headerLevel doc'\n  let adjustHeaders m (Header n attr ils) = Header (n+m) attr ils\n      adjustHeaders _ x                   = x\n  let (Pandoc _ bs') =\n       -- handle the case where you have \\part or \\chapter\n       (if bottomLevel < 1\n           then walk (adjustHeaders (1 - bottomLevel))\n           else id) $\n       walk (resolveFootnoteMarks (sFootnoteTexts st)) $\n       walk (resolveRefs (sLabels st)) doc'\n  return $ Pandoc meta bs'\n\nresolveRefs :: M.Map Text [Inline] -> Inline -> Inline\nresolveRefs labels x@(Link (ident,classes,kvs) _ _) =\n  case (T.takeWhile (/='+') <$> lookup \"reference-type\" kvs,\n        lookup \"reference\" kvs) of\n        (Just \"ref\", Just lab) -> -- TODO special treatment of ref+label\n          case M.lookup lab labels of\n               Just txt -> Link (ident,classes,kvs) txt (\"#\" <> lab, \"\")\n               Nothing  -> x\n        _ -> x\nresolveRefs _ x = x\n\n-- | Resolve footnote marks (\\footnotemark) to actual notes using\n-- the footnote texts collected from \\footnotetext commands.\nresolveFootnoteMarks :: M.Map Int Blocks -> Inline -> Inline\nresolveFootnoteMarks fnTexts (Span (_, classes, kvs) _)\n  | \"footnote-mark\" `elem` classes\n  , Just numText <- lookup \"note-num\" kvs\n  , [(n, \"\")] <- reads (T.unpack numText)\n  = case M.lookup n fnTexts of\n      Just contents -> Note (toList contents)\n      Nothing       -> Str \"\"  -- No matching footnotetext found\nresolveFootnoteMarks _ x = x\n\n\n-- testParser :: LP PandocIO a -> Text -> IO a\n-- testParser p t = do\n--   res <- runIOorExplode (runParserT p defaultLaTeXState{\n--             sOptions = def{ readerExtensions =\n--               enableExtension Ext_raw_tex $\n--                 getDefaultExtensions \"latex\" }} \"source\"\n--                   (tokenize (initialPos \"source\") t))\n--   case res of\n--        Left e  -> error (show e)\n--        Right r -> return r\n\n\nrawLaTeXBlock :: (PandocMonad m, HasMacros s, HasReaderOptions s)\n              => ParsecT Sources s m Text\nrawLaTeXBlock = do\n  lookAhead (try (char '\\\\' >> letter))\n  toks <- getInputTokens\n  snd <$> (\n          rawLaTeXParser toks\n             (makeAtLetterSection <|>\n              macroDef (const mempty) <|>\n              do choice (map controlSeq\n                   [\"include\", \"input\", \"subfile\", \"usepackage\"])\n                 skipMany opt\n                 braced\n                 return mempty) blocks\n      <|> rawLaTeXParser toks\n           (void (environment <|> blockCommand))\n           (mconcat <$> many (block <|> beginOrEndCommand)))\n\nmakeAtLetterSection :: PandocMonad m => LP m ()\nmakeAtLetterSection = try $ do\n  controlSeq \"makeatletter\"\n  void $ manyTill\n    (   whitespace\n    <|> newlineTok\n    <|> macroDef (const ())\n    <|> void environment\n    <|> void blockCommand\n    ) (controlSeq \"makeatother\")\n\n-- See #4667 for motivation; sometimes people write macros\n-- that just evaluate to a begin or end command, which blockCommand\n-- won't accept.\nbeginOrEndCommand :: PandocMonad m => LP m Blocks\nbeginOrEndCommand = try $ do\n  Tok _ (CtrlSeq name) txt <- anyControlSeq\n  guard $ name == \"begin\" || name == \"end\"\n  (envname, rawargs) <- withRaw braced\n  if M.member (untokenize envname)\n      (inlineEnvironments :: M.Map Text (LP PandocPure Inlines))\n     then mzero\n     else return $ rawBlock \"latex\"\n                    (txt <> untokenize rawargs)\n\nrawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s)\n               => ParsecT Sources s m Text\nrawLaTeXInline = do\n  lookAhead (try (char '\\\\' >> letter))\n  toks <- getInputTokens\n  raw <- snd <$>\n          (   rawLaTeXParser toks\n              (mempty <$ (controlSeq \"input\" >> skipMany rawopt >> braced))\n              inlines\n          <|> rawLaTeXParser toks (void inline) inlines\n          )\n  finalbraces <- mconcat <$> many (try (string \"{}\")) -- see #5439\n  return $ raw <> T.pack finalbraces\n\ninlineCommand :: PandocMonad m => ParsecT Sources ParserState m Inlines\ninlineCommand = do\n  lookAhead (try (char '\\\\' >> letter))\n  toks <- getInputTokens\n  fst <$> rawLaTeXParser toks (void (inlineEnvironment <|> inlineCommand'))\n          inlines\n\n-- inline elements:\n\ninlineGroup :: PandocMonad m => LP m Inlines\ninlineGroup = do\n  ils <- grouped inline\n  if null ils\n     then return mempty\n     else return $ spanWith nullAttr ils\n          -- we need the span so we can detitlecase bibtex entries;\n          -- we need to know when something is {C}apitalized\n\ndoLHSverb :: PandocMonad m => LP m Inlines\ndoLHSverb =\n  codeWith (\"\",[\"haskell\"],[]) . untokenize\n    <$> manyTill (satisfyTok (not . isNewlineTok)) (symbol '|')\n\nmkImage :: PandocMonad m => [(Text, Text)] -> Text -> LP m Inlines\nmkImage options (T.unpack -> src) = do\n   let replaceRelative (k,v) =\n         case numUnit v of\n              Just (num, \"\\\\textwidth\") -> (k, showFl (num * 100) <> \"%\")\n              Just (num, \"\\\\linewidth\") -> (k, showFl (num * 100) <> \"%\")\n              Just (num, \"\\\\textheight\") -> (k, showFl (num * 100) <> \"%\")\n              _                         -> (k, v)\n   let kvs = map replaceRelative\n             $ filter (\\(k,_) -> k `elem` [\"width\", \"height\"]) options\n   let attr = (\"\",[], kvs)\n   let alt = maybe (str \"image\") str $ lookup \"alt\" options\n   defaultExt <- getOption readerDefaultImageExtension\n   let exts' = [\".pdf\", \".png\", \".jpg\", \".mps\", \".jpeg\", \".jbig2\", \".jb2\"]\n   let exts  = exts' ++ map (map toUpper) exts'\n   let findFile s [] = return s\n       findFile s (e:es) = do\n         let s' = addExtension s e\n         exists <- fileExists s'\n         if exists\n            then return s'\n            else findFile s es\n   src' <- case takeExtension src of\n               \"\" | not (T.null defaultExt) -> return $ addExtension src $ T.unpack defaultExt\n                  | otherwise -> findFile src exts\n               _  -> return src\n   return $ imageWith attr (T.pack src') \"\" alt\n\nremoveDoubleQuotes :: Text -> Text\nremoveDoubleQuotes t =\n  Data.Maybe.fromMaybe t $ T.stripPrefix \"\\\"\" t >>= T.stripSuffix \"\\\"\"\n\ndoubleQuote :: PandocMonad m => LP m Inlines\ndoubleQuote =\n       quoted' doubleQuoted (try $ count 2 $ symbol '`')\n                     (void $ try $ count 2 $ symbol '\\'')\n   <|> quoted' doubleQuoted ((:[]) <$> symbol '“') (void $ symbol '”')\n   -- the following is used by babel for localized quotes:\n   <|> quoted' doubleQuoted (try $ sequence [symbol '\"', symbol '`'])\n                            (void $ try $ sequence [symbol '\"', symbol '\\''])\n\nsingleQuote :: PandocMonad m => LP m Inlines\nsingleQuote =\n       quoted' singleQuoted ((:[]) <$> symbol '`')\n                     (try $ symbol '\\'' >>\n                           notFollowedBy (satisfyTok startsWithLetter))\n   <|> quoted' singleQuoted ((:[]) <$> symbol '‘')\n                            (try $ symbol '’' >>\n                                  notFollowedBy (satisfyTok startsWithLetter))\n  where startsWithLetter (Tok _ Word t) =\n          case T.uncons t of\n               Just (c, _) | isLetter c -> True\n               _           -> False\n        startsWithLetter _ = False\n\nquoted' :: PandocMonad m\n        => (Inlines -> Inlines)\n        -> LP m [Tok]\n        -> LP m ()\n        -> LP m Inlines\nquoted' f starter ender = do\n  startchs <- untokenize <$> starter\n  smart <- extensionEnabled Ext_smart <$> getOption readerExtensions\n  if smart\n     then do\n       ils <- many (notFollowedBy ender >> inline)\n       (ender >> return (f (mconcat ils))) <|>\n            (<> mconcat ils) <$>\n                    lit (case startchs of\n                              \"``\" -> \"“\"\n                              \"`\"  -> \"‘\"\n                              cs   -> cs)\n     else lit startchs\n\nlit :: Text -> LP m Inlines\nlit = pure . str\n\nblockquote :: PandocMonad m => Bool -> Maybe Text -> LP m Blocks\nblockquote cvariant mblang = do\n  citepar <- if cvariant\n                then (\\xs -> para (cite xs mempty))\n                       <$> cites inline NormalCitation False\n                else option mempty $ para <$> bracketed inline\n  let lang = mblang >>= babelLangToBCP47\n  let langdiv = case lang of\n                      Nothing -> id\n                      Just l  -> divWith (\"\",[],[(\"lang\", renderLang l)])\n  _closingPunct <- option mempty $ bracketed inline -- currently ignored\n  bs <- grouped block\n  optional $ symbolIn (\".:;?!\" :: [Char])  -- currently ignored\n  return $ blockQuote . langdiv $ (bs <> citepar)\n\ninlineCommand' :: PandocMonad m => LP m Inlines\ninlineCommand' = try $ do\n  Tok _ (CtrlSeq name) cmd <- anyControlSeq\n  guard $ name /= \"begin\" && name /= \"end\" && name /= \"and\"\n  star <- if T.all isAlphaNum name\n             then option \"\" (\"*\" <$ symbol '*' <* sp)\n             else pure \"\"\n  overlay <- option \"\" overlaySpecification\n  let name' = name <> star <> overlay\n  let names = nubOrd [name', name] -- check non-starred as fallback\n  let raw = do\n       guard $ isInlineCommand name || not (isBlockCommand name)\n       rawcommand <- getRawCommand name (cmd <> star)\n       (guardEnabled Ext_raw_tex >> return (rawInline \"latex\" rawcommand))\n         <|> ignore rawcommand\n  lookupListDefault raw names inlineCommands\n\ntok :: PandocMonad m => LP m Inlines\ntok = tokWith inline\n\nunescapeURL :: Text -> Text\nunescapeURL = T.concat . go . T.splitOn \"\\\\\"\n  where\n    isEscapable c = T.any (== c) \"#$%&~_^\\\\{}\"\n    go (x:xs) = x : map unescapeInterior xs\n    go []     = []\n    unescapeInterior t\n      | Just (c, _) <- T.uncons t\n      , isEscapable c = t\n      | otherwise = \"\\\\\" <> t\n\ninlineCommands :: PandocMonad m => M.Map Text (LP m Inlines)\ninlineCommands = M.unions\n  [ accentCommands tok\n  , miscCommands\n  , citationCommands inline\n  , siunitxCommands tok\n  , acronymCommands\n  , refCommands\n  , nameCommands\n  , verbCommands\n  , charCommands\n  , enquoteCommands tok\n  , inlineLanguageCommands tok\n  , biblatexInlineCommands tok\n  , rest ]\n where\n  disableLigatures p = do\n    oldLigatures <- sLigatures <$> getState\n    updateState (\\s -> s{ sLigatures = False })\n    res <- p\n    updateState (\\s -> s{ sLigatures = oldLigatures })\n    pure res\n  rest = M.fromList\n    [ (\"emph\", extractSpaces emph <$> tok)\n    , (\"textit\", extractSpaces emph <$> tok)\n    , (\"textsl\", extractSpaces emph <$> tok)\n    , (\"textsc\", extractSpaces smallcaps <$> tok)\n    , (\"textsf\", extractSpaces (spanWith (\"\",[\"sans-serif\"],[])) <$> tok)\n    , (\"textmd\", extractSpaces (spanWith (\"\",[\"medium\"],[])) <$> tok)\n    , (\"textrm\", extractSpaces (spanWith (\"\",[\"roman\"],[])) <$> tok)\n    , (\"textup\", extractSpaces (spanWith (\"\",[\"upright\"],[])) <$> tok)\n    , (\"texttt\", formatCode nullAttr <$> disableLigatures tok)\n    , (\"alert\", skipopts >> spanWith (\"\",[\"alert\"],[]) <$> tok) -- beamer\n    , (\"textsuperscript\", extractSpaces superscript <$> tok)\n    , (\"textsubscript\", extractSpaces subscript <$> tok)\n    , (\"textbf\", extractSpaces strong <$> tok)\n    , (\"textnormal\", extractSpaces (spanWith (\"\",[\"nodecor\"],[])) <$> tok)\n    , (\"underline\", underline <$> tok)\n    , (\"mbox\", rawInlineOr \"mbox\" $ processHBox <$> tok)\n    , (\"hbox\", rawInlineOr \"hbox\" $ processHBox <$> tok)\n    , (\"vbox\", rawInlineOr \"vbox\" tok)\n    , (\"lettrine\", rawInlineOr \"lettrine\" lettrine)\n    , (\"(\", withMathMode\n        (mathInline . untokenize <$> manyTill anyTok (controlSeq \")\")))\n    , (\"[\", withMathMode\n        (mathDisplay . untokenize <$> manyTill anyTok (controlSeq \"]\")))\n    , (\"ensuremath\", withMathMode (mathInline . untokenize <$> braced))\n    , (\"texorpdfstring\", const <$> tok <*> tok)\n    -- old TeX commands\n    , (\"em\", extractSpaces emph <$> inlines)\n    , (\"it\", extractSpaces emph <$> inlines)\n    , (\"sl\", extractSpaces emph <$> inlines)\n    , (\"bf\", extractSpaces strong <$> inlines)\n    , (\"tt\", formatCode nullAttr <$> inlines)\n    , (\"rm\", inlines)\n    , (\"itshape\", extractSpaces emph <$> inlines)\n    , (\"slshape\", extractSpaces emph <$> inlines)\n    , (\"scshape\", extractSpaces smallcaps <$> inlines)\n    , (\"bfseries\", extractSpaces strong <$> inlines)\n    , (\"MakeUppercase\", makeUppercase <$> tok)\n    , (\"MakeTextUppercase\", makeUppercase <$> tok) -- textcase\n    , (\"uppercase\", makeUppercase <$> tok)\n    , (\"MakeLowercase\", makeLowercase <$> tok)\n    , (\"MakeTextLowercase\", makeLowercase <$> tok)\n    , (\"lowercase\", makeLowercase <$> tok)\n    , (\"thanks\", skipopts >> note <$> grouped block)\n    , (\"footnote\", skipopts >> footnote)\n    , (\"footnotemark\", footnotemark)\n    , (\"footnotetext\", footnotetext)\n    , (\"newline\", pure B.linebreak)\n    , (\"passthrough\", fixPassthroughEscapes <$> tok)\n    -- \\passthrough macro used by latex writer\n                           -- for listings\n    , (\"includegraphics\", do options <- option [] keyvals\n                             src <- bracedFilename\n                             mkImage options . unescapeURL $ src)\n    -- svg\n    , (\"includesvg\",      do options <- option [] keyvals\n                             src <- bracedFilename\n                             mkImage options . unescapeURL $ src)\n    -- hyperref\n    , (\"url\", (\\url -> linkWith (\"\",[\"uri\"],[]) url \"\" (str url))\n                        . unescapeURL . untokenize <$> bracedUrl)\n    , (\"nolinkurl\", code . unescapeURL . untokenize <$> bracedUrl)\n    , (\"href\", do url <- bracedUrl\n                  sp\n                  link (unescapeURL $ untokenize url) \"\" <$> tok)\n    , (\"hyperlink\", hyperlink)\n    , (\"hyperref\", hyperref)\n    , (\"hypertarget\", hypertargetInline)\n    -- hyphenat\n    , (\"nohyphens\", tok)\n    , (\"textnhtt\", formatCode nullAttr <$> tok)\n    , (\"nhttfamily\", formatCode nullAttr <$> tok)\n    -- LaTeX colors\n    , (\"textcolor\", coloredInline \"color\")\n    , (\"colorbox\", coloredInline \"background-color\")\n    -- etoolbox\n    , (\"newtoggle\", braced >>= newToggle)\n    , (\"toggletrue\", braced >>= setToggle True)\n    , (\"togglefalse\", braced >>= setToggle False)\n    , (\"iftoggle\", try $ ifToggle >> inline)\n    -- include\n    , (\"input\", rawInlineOr \"input\" $ include \"input\")\n    -- soul package\n    , (\"st\", extractSpaces strikeout <$> tok)\n    , (\"ul\", underline <$> tok)\n    , (\"hl\", extractSpaces (spanWith (\"\",[\"mark\"],[])) <$> tok)\n    -- ulem package\n    , (\"sout\", extractSpaces strikeout <$> tok)\n    , (\"uline\", underline <$> tok)\n    -- plain tex stuff that should just be passed through as raw tex\n    , (\"ifdim\", ifdim)\n    -- generally only used in \\date\n    , (\"today\", today)\n    -- this is used internally by pandoc but the definition is too complicated\n    -- for pandoc to handle (see #11140):\n    , (\"pandocbounded\", tok)\n    ]\n\nbracedFilename :: PandocMonad m => LP m Text\nbracedFilename =\n  removeDoubleQuotes . T.strip . untokenize . filter (not . isComment) <$> braced\n\nisComment :: Tok -> Bool\nisComment (Tok _ Comment _) = True\nisComment _ = False\n\ntoday :: PandocMonad m => LP m Inlines\ntoday =\n  text . T.pack . showGregorian . localDay . zonedTimeToLocalTime\n    <$> getZonedTime\n\nfootnote :: PandocMonad m => LP m Inlines\nfootnote = do\n  updateState $ \\st -> st{ sLastNoteNum = sLastNoteNum st + 1 }\n  contents <- grouped block >>= walkM resolveNoteLabel\n  return $ note contents\n\n-- | Parse \\footnotemark[n]. If n is not given, increment the counter.\n-- Returns a span marker that will be resolved to a Note later.\nfootnotemark :: PandocMonad m => LP m Inlines\nfootnotemark = do\n  mbNum <- optionalFootnoteNum\n  noteNum <- case mbNum of\n    Just n  -> return n\n    Nothing -> do\n      updateState $ \\st -> st{ sLastNoteNum = sLastNoteNum st + 1 }\n      sLastNoteNum <$> getState\n  return $ B.spanWith (\"\", [\"footnote-mark\"], [(\"note-num\", tshow noteNum)]) mempty\n\n-- | Parse \\footnotetext[n]{text}. If n is not given, use current counter.\n-- Stores the text in state to be resolved later.\nfootnotetext :: PandocMonad m => LP m Inlines\nfootnotetext = do\n  mbNum <- optionalFootnoteNum\n  noteNum <- case mbNum of\n    Just n  -> return n\n    Nothing -> sLastNoteNum <$> getState\n  contents <- grouped block >>= walkM resolveNoteLabel\n  updateState $ \\st -> st{\n    sFootnoteTexts = M.insert noteNum contents (sFootnoteTexts st) }\n  return mempty\n\n-- | Parse optional footnote number argument [n]\noptionalFootnoteNum :: PandocMonad m => LP m (Maybe Int)\noptionalFootnoteNum = option Nothing $ do\n  t <- bracketedToks\n  case reads (T.unpack $ untokenize t) of\n    [(n, \"\")] -> return $ Just n\n    _         -> return Nothing\n\nresolveNoteLabel :: PandocMonad m => Inline -> LP m Inline\nresolveNoteLabel (Span (_,cls,kvs) _)\n  | Just lab <- lookup \"label\" kvs = do\n      updateState $ \\st -> st{\n        sLabels = M.insert lab (toList . text . tshow $ sLastNoteNum st)\n                      $ sLabels st }\n      return $ Span (lab,cls,kvs) []\nresolveNoteLabel il = return il\n\n\nlettrine :: PandocMonad m => LP m Inlines\nlettrine = do\n  optional rawopt\n  x <- tok\n  y <- tok\n  return $ extractSpaces (spanWith (\"\",[\"lettrine\"],[])) x <> smallcaps y\n\nifdim :: PandocMonad m => LP m Inlines\nifdim = do\n  contents <- manyTill anyTok (controlSeq \"fi\")\n  return $ rawInline \"latex\" $ \"\\\\ifdim\" <> untokenize contents <> \"\\\\fi\"\n\nmakeUppercase :: Inlines -> Inlines\nmakeUppercase = fromList . walk (alterStr T.toUpper) . toList\n\nmakeLowercase :: Inlines -> Inlines\nmakeLowercase = fromList . walk (alterStr T.toLower) . toList\n\nalterStr :: (Text -> Text) -> Inline -> Inline\nalterStr f (Str xs) = Str (f xs)\nalterStr _ x = x\n\nfixPassthroughEscapes :: Inlines -> Inlines\nfixPassthroughEscapes = walk go\n where\n  go (Code attr txt) = Code attr (T.pack $ unescapePassthrough $ T.unpack txt)\n  go x = x\n  unescapePassthrough [] = []\n  unescapePassthrough ('\\\\':c:cs)\n    | c `elem` ['%','{','}','\\\\'] = c : unescapePassthrough cs\n  unescapePassthrough (c:cs) = c : unescapePassthrough cs\n\nhyperlink :: PandocMonad m => LP m Inlines\nhyperlink = try $ do\n  src <- untokenize <$> braced\n  lab <- tok\n  return $ link (\"#\" <> src) \"\" lab\n\nhyperref :: PandocMonad m => LP m Inlines\nhyperref = try $ do\n  url <- ((\"#\" <>) . untokenize <$> try (sp *> bracketedToks <* sp))\n       <|> untokenize <$> (bracedUrl <* bracedUrl <* bracedUrl)\n  link url \"\" <$> tok\n\nhypertargetBlock :: PandocMonad m => LP m Blocks\nhypertargetBlock = try $ do\n  ref <- untokenize <$> braced\n  bs <- grouped block\n  case toList bs of\n       [Header 1 (ident,_,_) _] | ident == ref -> return bs\n       _                        -> return $ divWith (ref, [], []) bs\n\nhypertargetInline :: PandocMonad m => LP m Inlines\nhypertargetInline = try $ do\n  ref <- untokenize <$> braced\n  ils <- grouped inline\n  return $ spanWith (ref, [], []) ils\n\nnewToggle :: (Monoid a, PandocMonad m) => [Tok] -> LP m a\nnewToggle name = do\n  updateState $ \\st ->\n    st{ sToggles = M.insert (untokenize name) False (sToggles st) }\n  return mempty\n\nsetToggle :: (Monoid a, PandocMonad m) => Bool -> [Tok] -> LP m a\nsetToggle on name = do\n  updateState $ \\st ->\n    st{ sToggles = M.adjust (const on) (untokenize name) (sToggles st) }\n  return mempty\n\nifToggle :: PandocMonad m => LP m ()\nifToggle = do\n  name <- braced\n  spaces\n  yes <- withVerbatimMode braced\n  spaces\n  no <- withVerbatimMode braced\n  toggles <- sToggles <$> getState\n  TokStream _ inp <- getInput\n  let name' = untokenize name\n  case M.lookup name' toggles of\n                Just True  -> setInput $ TokStream False (yes ++ inp)\n                Just False -> setInput $ TokStream False (no  ++ inp)\n                Nothing    -> do\n                  pos <- getPosition\n                  report $ UndefinedToggle name' pos\n  return ()\n\ncoloredInline :: PandocMonad m => Text -> LP m Inlines\ncoloredInline stylename = do\n  skipopts\n  color <- braced\n  spanWith (\"\",[],[(\"style\",stylename <> \": \" <> untokenize color)]) <$> tok\n\nprocessHBox :: Inlines -> Inlines\nprocessHBox = walk convert\n  where\n    convert Space     = Str $ T.singleton $ chr 160 -- non-breakable space\n    convert SoftBreak = Str $ T.singleton $ chr 160 -- non-breakable space\n    convert LineBreak = Str \"\"\n    convert x         = x\n\nisBlockCommand :: Text -> Bool\nisBlockCommand s =\n  s `M.member` (blockCommands :: M.Map Text (LP PandocPure Blocks))\n  || s `Set.member` treatAsBlock\n\ntreatAsBlock :: Set.Set Text\ntreatAsBlock = Set.fromList\n   [ \"special\", \"pdfannot\", \"pdfstringdef\"\n   , \"bibliographystyle\"\n   , \"maketitle\", \"makeindex\", \"makeglossary\"\n   , \"addcontentsline\", \"addtocontents\", \"addtocounter\"\n      -- \\ignore{} is used conventionally in literate haskell for definitions\n      -- that are to be processed by the compiler but not printed.\n   , \"ignore\"\n   , \"hyperdef\"\n   , \"markboth\", \"markright\", \"markleft\"\n   , \"hspace\", \"vspace\"\n   , \"newpage\"\n   , \"clearpage\"\n   , \"pagebreak\"\n   , \"titleformat\"\n   , \"listoffigures\"\n   , \"listoftables\"\n   , \"write\"\n   ]\n\nisInlineCommand :: Text -> Bool\nisInlineCommand s =\n  s `M.member` (inlineCommands :: M.Map Text (LP PandocPure Inlines))\n  || s `Set.member` treatAsInline\n\ntreatAsInline :: Set.Set Text\ntreatAsInline = Set.fromList\n  [ \"index\"\n  , \"hspace\"\n  , \"vspace\"\n  , \"noindent\"\n  , \"newpage\"\n  , \"clearpage\"\n  , \"pagebreak\"\n  ]\n\nlookupListDefault :: (Ord k) => v -> [k] -> M.Map k v -> v\nlookupListDefault d = (fromMaybe d .) . lookupList\n  where lookupList l m = msum $ map (`M.lookup` m) l\n\ninline :: PandocMonad m => LP m Inlines\ninline = do\n  Tok pos toktype t <- peekTok\n  let eatOneToken = satisfyTok (const True)\n  let symbolAsString = str t <$ eatOneToken\n  let unescapedSymbolAsString =\n        do eatOneToken\n           report $ ParsingUnescaped t pos\n           return $ str t\n  ligatures <- sLigatures <$> getState\n  case toktype of\n    Comment     -> mempty <$ eatOneToken\n    Spaces      -> space <$ eatOneToken\n    Newline     -> softbreak <$ endline\n    Word        -> str t <$ eatOneToken\n    Symbol      ->\n      case t of\n        \"-\" | ligatures\n                -> eatOneToken *>\n                    option (str \"-\") (symbol '-' *>\n                      option (str \"–\") (str \"—\" <$ symbol '-'))\n        \"'\"     -> eatOneToken *>\n                    option (str \"’\") (str  \"”\" <$ (guard ligatures *> symbol '\\''))\n        \"~\"     -> str \"\\160\" <$ eatOneToken\n        \"`\" | ligatures\n                -> doubleQuote <|> singleQuote <|> (str \"‘\" <$ symbol '`')\n            | otherwise\n                -> str \"‘\" <$ symbol '`'\n        \"\\\"\" | ligatures\n                -> doubleQuote <|> singleQuote <|> symbolAsString\n        \"“\"     -> doubleQuote <|> symbolAsString\n        \"‘\"     -> singleQuote <|> symbolAsString\n        \"$\"     -> dollarsMath <|> unescapedSymbolAsString\n        \"|\"     -> (guardEnabled Ext_literate_haskell *>\n                    eatOneToken *> doLHSverb) <|> symbolAsString\n        \"{\"     -> inlineGroup\n        \"#\"     -> unescapedSymbolAsString\n        \"&\"     -> unescapedSymbolAsString\n        \"_\"     -> unescapedSymbolAsString\n        \"^\"     -> unescapedSymbolAsString\n        \"\\\\\"    -> mzero\n        \"}\"     -> mzero\n        _       -> symbolAsString\n    CtrlSeq _   -> macroDef (rawInline \"latex\")\n                  <|> inlineGroup\n                  <|> inlineCommand'\n                  <|> inlineEnvironment\n    Esc1        -> str . T.singleton <$> primEscape\n    Esc2        -> str . T.singleton <$> primEscape\n    _           -> mzero\n\ninlines :: PandocMonad m => LP m Inlines\ninlines = mconcat <$> many inline\n\nopt :: PandocMonad m => LP m Inlines\nopt = do\n  toks <- try (sp *> bracketedToks <* sp)\n  -- now parse the toks as inlines\n  st <- getState\n  parsed <- runParserT (mconcat <$> many inline) st \"bracketed option\"\n              (TokStream False toks)\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError $ fromParsecError (toSources toks) e\n\n-- block elements:\n\npreamble :: PandocMonad m => LP m Blocks\npreamble = mconcat <$> many preambleBlock\n  where preambleBlock =  (mempty <$ spaces1)\n                     <|> macroDef (rawBlock \"latex\")\n                     <|> filecontents\n                     <|> (mempty <$ blockCommand)\n                     <|> (mempty <$ braced)\n                     <|> (do notFollowedBy (begin_ \"document\")\n                             anyTok\n                             return mempty)\n\nrule :: PandocMonad m => LP m Blocks\nrule = do\n  skipopts\n  width <- T.takeWhile (\\c -> isDigit c || c == '.') . stringify <$> tok\n  _thickness <- tok\n  -- 0-width rules are used to fix spacing issues:\n  case safeRead width of\n    Just (0 :: Double) -> return mempty\n    _ -> return horizontalRule\n\nparagraph :: PandocMonad m => LP m Blocks\nparagraph = do\n  x <- trimInlines . mconcat <$> many1 inline\n  if x == mempty\n     then return mempty\n     else return $ para x\n\nrawBlockOr :: PandocMonad m => Text -> LP m Blocks -> LP m Blocks\nrawBlockOr name fallback = do\n  -- if raw_tex allowed, don't process\n  parseRaw <- extensionEnabled Ext_raw_tex <$> getOption readerExtensions\n  if parseRaw\n     then rawBlock \"latex\" <$> getRawCommand name (\"\\\\\" <> name)\n     else fallback\n\ndoSubfile :: PandocMonad m => LP m Blocks\ndoSubfile = do\n  skipMany opt\n  f <- T.unpack <$> bracedFilename\n  oldToks <- getInput\n  setInput $ TokStream False []\n  insertIncluded (ensureExtension (/= \"\") \".tex\" f)\n  bs <- blocks\n  eof\n  setInput oldToks\n  return bs\n\ninclude :: (PandocMonad m, Monoid a) => Text -> LP m a\ninclude name = do\n  let isAllowed =\n        case name of\n          \"include\" -> (== \".tex\")\n          \"input\" -> (/= \"\")\n          _ -> const False\n  skipMany opt\n  fs <- map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn \",\" .\n         untokenize . filter (not . isComment) <$> braced\n  mapM_ (insertIncluded . ensureExtension isAllowed \".tex\") fs\n  return mempty\n\nusepackage :: (PandocMonad m, Monoid a) => LP m a\nusepackage = do\n  skipMany opt\n  fs <- map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn \",\" .\n           untokenize . filter (not . isComment) <$> braced\n  let parsePackage f = do\n        TokStream _ ts <- getIncludedToks (ensureExtension (== \".sty\") \".sty\" f)\n        parseFromToks (do _ <- blocks\n                          eof <|>\n                            do pos <- getPosition\n                               report $ CouldNotParseIncludeFile (T.pack f) pos)\n                      ts\n  mapM_ parsePackage fs\n  return mempty\n\nreadFileFromTexinputs :: PandocMonad m => FilePath -> LP m (Maybe Text)\nreadFileFromTexinputs fp = do\n  fileContentsMap <- sFileContents <$> getState\n  case M.lookup (T.pack fp) fileContentsMap of\n    Just t -> return (Just t)\n    Nothing -> do\n      dirs <- map (\\t -> if T.null t\n                            then \".\"\n                            else T.unpack t)\n               . T.split (==':') . fromMaybe \"\"\n              <$> lookupEnv \"TEXINPUTS\"\n      readFileFromDirs dirs fp\n\nensureExtension :: (FilePath -> Bool) -> FilePath -> FilePath -> FilePath\nensureExtension isAllowed defaultExt fp =\n  let ext = takeExtension fp\n   in if isAllowed ext\n         then fp\n         else addExtension fp defaultExt\n\ngetIncludedToks :: PandocMonad m\n                => FilePath\n                -> LP m TokStream\ngetIncludedToks f = do\n  pos <- getPosition\n  containers <- getIncludeFiles <$> getState\n  when (T.pack f `elem` containers) $\n    throwError $ PandocParseError $ T.pack $ \"Include file loop at \" ++ show pos\n  updateState $ addIncludeFile $ T.pack f\n  mbcontents <- readFileFromTexinputs f\n  contents <- case mbcontents of\n                   Just s -> return s\n                   Nothing -> do\n                     report $ CouldNotLoadIncludeFile (T.pack f) pos\n                     return \"\"\n  updateState dropLatestIncludeFile\n  return $ TokStream False $ tokenize (initialPos f) contents\n\ninsertIncluded :: PandocMonad m\n               => FilePath\n               -> LP m ()\ninsertIncluded f = do\n  contents <- getIncludedToks f\n  ts <- getInput\n  setInput $ contents <> ts\n\nauthors :: PandocMonad m => LP m ()\nauthors = try $ do\n  bgroup\n  let oneAuthor = blocksToInlines' . B.toList . mconcat <$> many1 block\n  auths <- sepBy oneAuthor (controlSeq \"and\")\n  egroup\n  addMeta \"author\" (map trimInlines auths)\n\nlooseItem :: PandocMonad m => LP m Blocks\nlooseItem = do\n  inListItem <- sInListItem <$> getState\n  guard $ not inListItem\n  skipopts\n  return mempty\n\nepigraph :: PandocMonad m => LP m Blocks\nepigraph = do\n  p1 <- grouped block\n  p2 <- grouped block\n  return $ divWith (\"\", [\"epigraph\"], []) (p1 <> p2)\n\nsection :: PandocMonad m => Attr -> Int -> LP m Blocks\nsection (ident, classes, kvs) lvl = do\n  skipopts\n  contents <- grouped inline\n  lab <- option ident $\n          try (spaces >> controlSeq \"label\"\n               >> spaces >> untokenize <$> braced)\n  when (lvl == 0) $\n    updateState $ \\st -> st{ sHasChapters = True }\n  unless (\"unnumbered\" `elem` classes) $ do\n    hn <- sLastHeaderNum <$> getState\n    hasChapters <- sHasChapters <$> getState\n    let lvl' = lvl + if hasChapters then 1 else 0\n    let num = incrementDottedNum lvl' hn\n    updateState $ \\st -> st{ sLastHeaderNum = num\n                           , sLabels = M.insert lab\n                              [Str (renderDottedNum num)]\n                              (sLabels st) }\n  attr' <- registerHeader (lab, classes, kvs) contents\n  return $ headerWith attr' lvl contents\n\nblockCommand :: PandocMonad m => LP m Blocks\nblockCommand = try $ do\n  Tok _ (CtrlSeq name) txt <- anyControlSeq\n  guard $ name /= \"begin\" && name /= \"end\" && name /= \"and\"\n  star <- option \"\" (\"*\" <$ symbol '*' <* sp)\n  let name' = name <> star\n  let names = nubOrd [name', name]\n  let rawDefiniteBlock = do\n        guard $ isBlockCommand name\n        rawcontents <- getRawCommand name (txt <> star)\n        (guardEnabled Ext_raw_tex >> return (rawBlock \"latex\" rawcontents))\n          <|> ignore rawcontents\n  -- heuristic:  if it could be either block or inline, we\n  -- treat it if block if we have a sequence of block\n  -- commands followed by a newline.  But we stop if we\n  -- hit a \\startXXX, since this might start a raw ConTeXt\n  -- environment (this is important because this parser is\n  -- used by the Markdown reader).\n  let startCommand = try $ do\n        Tok _ (CtrlSeq n) _ <- anyControlSeq\n        guard $ \"start\" `T.isPrefixOf` n\n  let rawMaybeBlock = try $ do\n        guard $ not $ isInlineCommand name\n        rawcontents <- getRawCommand name (txt <> star)\n        curr <- (guardEnabled Ext_raw_tex >>\n                    return (rawBlock \"latex\" rawcontents))\n                   <|> ignore rawcontents\n        rest <- many $ notFollowedBy startCommand *> blockCommand\n        lookAhead $ blankline <|> startCommand\n        return $ curr <> mconcat rest\n  let raw = rawDefiniteBlock <|> rawMaybeBlock\n  lookupListDefault raw names blockCommands\n\nclosing :: PandocMonad m => LP m Blocks\nclosing = do\n  contents <- tok\n  st <- getState\n  let extractInlines (MetaBlocks [Plain ys]) = ys\n      extractInlines (MetaBlocks [Para ys ]) = ys\n      extractInlines _                       = []\n  let sigs = case lookupMeta \"author\" (sMeta st) of\n                  Just (MetaList xs) ->\n                    para $ trimInlines $ fromList $\n                      intercalate [LineBreak] $ map extractInlines xs\n                  _ -> mempty\n  return $ para (trimInlines contents) <> sigs\n\nparbox :: PandocMonad m => LP m Blocks\nparbox = try $ do\n  skipopts\n  braced -- size\n  oldInTableCell <- sInTableCell <$> getState\n  -- see #5711\n  updateState $ \\st -> st{ sInTableCell = False }\n  res <- grouped block\n  updateState $ \\st -> st{ sInTableCell = oldInTableCell }\n  return res\n\nblockCommands :: PandocMonad m => M.Map Text (LP m Blocks)\nblockCommands = M.fromList\n   [ (\"par\", mempty <$ skipopts)\n   , (\"parbox\",  parbox)\n   , (\"title\", mempty <$ (skipopts *>\n                             (grouped inline >>= addMeta \"title\")\n                         <|> (grouped block >>= addMeta \"title\")))\n   , (\"subtitle\", mempty <$ (skipopts *> tok >>= addMeta \"subtitle\"))\n   , (\"author\", mempty <$ (skipopts *> authors))\n   -- -- in letter class, temp. store address & sig as title, author\n   , (\"address\", mempty <$ (skipopts *> tok >>= addMeta \"address\"))\n   , (\"signature\", mempty <$ (skipopts *> authors))\n   , (\"date\", mempty <$ (skipopts *> tok >>= addMeta \"date\"))\n   , (\"newtheorem\", newtheorem inline)\n   , (\"theoremstyle\", theoremstyle)\n   -- KOMA-Script metadata commands\n   , (\"extratitle\", mempty <$ (skipopts *> tok >>= addMeta \"extratitle\"))\n   , (\"frontispiece\", mempty <$ (skipopts *> tok >>= addMeta \"frontispiece\"))\n   , (\"titlehead\", mempty <$ (skipopts *> tok >>= addMeta \"titlehead\"))\n   , (\"subject\", mempty <$ (skipopts *> tok >>= addMeta \"subject\"))\n   , (\"publishers\", mempty <$ (skipopts *> tok >>= addMeta \"publishers\"))\n   , (\"uppertitleback\", mempty <$ (skipopts *> tok >>= addMeta \"uppertitleback\"))\n   , (\"lowertitleback\", mempty <$ (skipopts *> tok >>= addMeta \"lowertitleback\"))\n   , (\"dedication\", mempty <$ (skipopts *> tok >>= addMeta \"dedication\"))\n   -- sectioning\n   , (\"part\", section nullAttr (-1))\n   , (\"part*\", section (\"\",[\"unnumbered\"],[]) (-1))\n   , (\"chapter\", section nullAttr 0)\n   , (\"chapter*\", section (\"\",[\"unnumbered\"],[]) 0)\n   , (\"section\", section nullAttr 1)\n   , (\"section*\", section (\"\",[\"unnumbered\"],[]) 1)\n   , (\"subsection\", section nullAttr 2)\n   , (\"subsection*\", section (\"\",[\"unnumbered\"],[]) 2)\n   , (\"subsubsection\", section nullAttr 3)\n   , (\"subsubsection*\", section (\"\",[\"unnumbered\"],[]) 3)\n   , (\"paragraph\", section nullAttr 4)\n   , (\"paragraph*\", section (\"\",[\"unnumbered\"],[]) 4)\n   , (\"subparagraph\", section nullAttr 5)\n   , (\"subparagraph*\", section (\"\",[\"unnumbered\"],[]) 5)\n   , (\"minisec\", section (\"\",[\"unnumbered\",\"unlisted\"],[]) 6) -- from KOMA\n   -- beamer slides\n   , (\"frametitle\", section nullAttr 3)\n   , (\"framesubtitle\", section nullAttr 4)\n   -- letters\n   , (\"opening\", para . trimInlines <$> (skipopts *> tok))\n   , (\"closing\", skipopts *> closing)\n   -- memoir\n   , (\"plainbreak\", braced >> pure horizontalRule)\n   , (\"plainbreak*\", braced >> pure horizontalRule)\n   , (\"fancybreak\", braced >> pure horizontalRule)\n   , (\"fancybreak*\", braced >> pure horizontalRule)\n   , (\"plainfancybreak\", braced >> braced >> braced >> pure horizontalRule)\n   , (\"plainfancybreak*\", braced >> braced >> braced >> pure horizontalRule)\n   , (\"pfbreak\", pure horizontalRule)\n   , (\"pfbreak*\", pure horizontalRule)\n   --\n   , (\"hrule\", pure horizontalRule)\n   , (\"strut\", pure mempty)\n   , (\"rule\", rule)\n   , (\"item\", looseItem)\n   , (\"documentclass\", skipopts *> braced *> preamble)\n   , (\"centerline\", para . trimInlines <$> (skipopts *> tok))\n   , (\"caption\", mempty <$ setCaption inline)\n   , (\"bibliography\", mempty <$ (skipopts *> braced >>=\n         addMeta \"bibliography\" . splitBibs . untokenize))\n   , (\"addbibresource\", mempty <$ (skipopts *> braced >>=\n         addMeta \"bibliography\" . splitBibs . untokenize))\n   , (\"endinput\", mempty <$ skipSameFileToks)\n   -- includes\n   , (\"lstinputlisting\", inputListing)\n   , (\"inputminted\", inputMinted)\n   , (\"graphicspath\", graphicsPath)\n   -- polyglossia\n   , (\"setdefaultlanguage\", setDefaultLanguage)\n   , (\"setmainlanguage\", setDefaultLanguage)\n   -- hyperlink\n   , (\"hypertarget\", hypertargetBlock)\n   -- LaTeX colors\n   , (\"textcolor\", coloredBlock \"color\")\n   , (\"colorbox\", coloredBlock \"background-color\")\n   -- csquotes\n   , (\"blockquote\", blockquote False Nothing)\n   , (\"blockcquote\", blockquote True Nothing)\n   , (\"foreignblockquote\", braced >>= blockquote False . Just . untokenize)\n   , (\"foreignblockcquote\", braced >>= blockquote True . Just . untokenize)\n   , (\"hyphenblockquote\", braced >>= blockquote False . Just . untokenize)\n   , (\"hyphenblockcquote\", braced >>= blockquote True . Just . untokenize)\n   -- include\n   , (\"include\", rawBlockOr \"include\" $ include \"include\")\n   , (\"input\", rawBlockOr \"input\" $ include \"input\")\n   , (\"subfile\", rawBlockOr \"subfile\" doSubfile)\n   , (\"usepackage\", rawBlockOr \"usepackage\" usepackage)\n   -- preamble\n   , (\"PackageError\", mempty <$ (braced >> braced >> braced))\n   -- epigraph package\n   , (\"epigraph\", epigraph)\n   -- alignment\n   , (\"raggedright\", pure mempty)\n   -- etoolbox\n   , (\"newtoggle\", braced >>= newToggle)\n   , (\"toggletrue\", braced >>= setToggle True)\n   , (\"togglefalse\", braced >>= setToggle False)\n   , (\"iftoggle\", try $ ifToggle >> block)\n   ]\n\nskipSameFileToks :: PandocMonad m => LP m ()\nskipSameFileToks = do\n    pos <- getPosition\n    skipMany $ infile (sourceName pos)\n\nenvironments :: PandocMonad m => M.Map Text (LP m Blocks)\nenvironments = M.union (tableEnvironments block inline) $\n   M.fromList\n   [ (\"document\", env \"document\" blocks <* skipMany anyTok)\n   , (\"abstract\", mempty <$ (env \"abstract\" blocks >>= addMeta \"abstract\"))\n   , (\"sloppypar\", env \"sloppypar\" blocks)\n   , (\"letter\", env \"letter\" letterContents)\n   , (\"minipage\", divWith (\"\",[\"minipage\"],[]) <$>\n       env \"minipage\" (skipopts *> spaces *> optional braced *> spaces *> blocks))\n   , (\"figure\", env \"figure\" figure')\n   , (\"figure*\", env \"figure*\" figure')\n   , (\"subfigure\", env \"subfigure\" $ skipopts *> tok *> figure')\n   , (\"center\", divWith (\"\", [\"center\"], []) <$> env \"center\" blocks)\n   , (\"quote\", blockQuote <$> env \"quote\" blocks)\n   , (\"quotation\", blockQuote <$> env \"quotation\" blocks)\n   , (\"verse\", blockQuote <$> env \"verse\" blocks)\n   , (\"itemize\", bulletList <$> listenv \"itemize\" (many item))\n   , (\"description\", definitionList <$> listenv \"description\" (many descItem))\n   , (\"enumerate\", orderedList')\n   , (\"alltt\", alltt <$> env \"alltt\" blocks)\n   , (\"code\", guardEnabled Ext_literate_haskell *>\n       (codeBlockWith (\"\",[\"haskell\",\"literate\"],[]) <$> verbEnv \"code\"))\n   , (\"comment\", mempty <$ verbEnv \"comment\")\n   , (\"verbatim\", codeBlock <$> verbEnv \"verbatim\")\n   , (\"Verbatim\", fancyverbEnv \"Verbatim\")\n   , (\"BVerbatim\", fancyverbEnv \"BVerbatim\")\n   , (\"lstlisting\", do attr <- parseListingsOptions <$> option [] keyvals\n                       codeBlockWith attr <$> verbEnv \"lstlisting\")\n   , (\"minted\", minted)\n   , (\"obeylines\", obeylines)\n   , (\"tikzpicture\", rawVerbEnv \"tikzpicture\")\n   , (\"tikzcd\", rawVerbEnv \"tikzcd\")\n   , (\"lilypond\", rawVerbEnv \"lilypond\")\n   , (\"ly\", rawVerbEnv \"ly\")\n   -- amsthm\n   , (\"proof\", proof blocks opt)\n   -- other\n   , (\"CSLReferences\", braced >> braced >> env \"CSLReferences\" blocks)\n   , (\"otherlanguage\", env \"otherlanguage\" otherlanguageEnv)\n   ]\n\notherlanguageEnv :: PandocMonad m => LP m Blocks\notherlanguageEnv = do\n  skipopts\n  babelLang <- untokenize <$> braced\n  case babelLangToBCP47 babelLang of\n    Just lang -> divWith (\"\", [], [(\"lang\", renderLang lang)]) <$> blocks\n    Nothing -> blocks\n\nlangEnvironment :: PandocMonad m => Text -> LP m Blocks\nlangEnvironment name =\n  case babelLangToBCP47 name of\n    Just lang ->\n      env name (divWith (\"\", [], [(\"lang\", renderLang lang)]) <$> blocks)\n    Nothing -> mzero -- fall through to raw environment\n\nfilecontents :: PandocMonad m => LP m Blocks\nfilecontents = try $ do\n  controlSeq \"begin\"\n  name <- untokenize <$> braced\n  guard $ name == \"filecontents\" || name == \"filecontents*\"\n  skipopts\n  fp <- untokenize <$> braced\n  txt <- verbEnv name\n  updateState $ \\st ->\n    st{ sFileContents = M.insert fp txt (sFileContents st) }\n  return mempty\n\nenvironment :: PandocMonad m => LP m Blocks\nenvironment = try $ do\n  controlSeq \"begin\"\n  name <- untokenize <$> braced\n  M.findWithDefault mzero name environments <|>\n    langEnvironment name <|>\n    theoremEnvironment blocks opt name <|>\n    if M.member name (inlineEnvironments\n                       :: M.Map Text (LP PandocPure Inlines))\n       then mzero\n       else try (rawEnv name) <|> rawVerbEnv name\n\nrawEnv :: PandocMonad m => Text -> LP m Blocks\nrawEnv name = do\n  exts <- getOption readerExtensions\n  let parseRaw = extensionEnabled Ext_raw_tex exts\n  rawOptions <- mconcat <$> many rawopt\n  let beginCommand = \"\\\\begin{\" <> name <> \"}\" <> rawOptions\n  pos1 <- getPosition\n  if parseRaw\n     then do\n       (_, raw) <- withRaw $ env name blocks\n       return $ rawBlock \"latex\"\n                 $ beginCommand <> untokenize raw\n     else do\n       bs <- env name blocks\n       report $ SkippedContent beginCommand pos1\n       pos2 <- getPosition\n       report $ SkippedContent (\"\\\\end{\" <> name <> \"}\") pos2\n       return $ divWith (\"\",[name],[]) bs\n\nrawVerbEnv :: PandocMonad m => Text -> LP m Blocks\nrawVerbEnv name = do\n  pos <- getPosition\n  (_, raw) <- withRaw $ verbEnv name\n  let raw' = \"\\\\begin{\" <> name <> \"}\" <> untokenize raw\n  exts <- getOption readerExtensions\n  let parseRaw = extensionEnabled Ext_raw_tex exts\n  if parseRaw\n     then return $ rawBlock \"latex\" raw'\n     else do\n       report $ SkippedContent raw' pos\n       return mempty\n\nfancyverbEnv :: PandocMonad m => Text -> LP m Blocks\nfancyverbEnv name = do\n  options <- option [] keyvals\n  let kvs = [ (if k == \"firstnumber\"\n                  then \"startFrom\"\n                  else k, v) | (k,v) <- options ]\n  let classes = [ \"numberLines\" |\n                  lookup \"numbers\" options == Just \"left\" ]\n  let attr = (\"\",classes,kvs)\n  codeBlockWith attr <$> verbEnv name\n\nobeylines :: PandocMonad m => LP m Blocks\nobeylines =\n  para . fromList . removeLeadingTrailingBreaks .\n   walk softBreakToHard . toList <$> env \"obeylines\" inlines\n  where softBreakToHard SoftBreak = LineBreak\n        softBreakToHard x         = x\n        removeLeadingTrailingBreaks = reverse . dropWhile isLineBreak .\n                                      reverse . dropWhile isLineBreak\n        isLineBreak LineBreak = True\n        isLineBreak _         = False\n\nminted :: PandocMonad m => LP m Blocks\nminted = do\n  attr <- mintedAttr\n  codeBlockWith attr <$> verbEnv \"minted\"\n\nmintedAttr :: PandocMonad m => LP m Attr\nmintedAttr = do\n  options <- option [] keyvals\n  lang <- untokenize <$> braced\n  let kvs = [ (if k == \"firstnumber\"\n                  then \"startFrom\"\n                  else k, v) | (k,v) <- options ]\n  let classes = [ lang | not (T.null lang) ] ++\n                [ \"numberLines\" |\n                  lookup \"linenos\" options == Just \"true\" ]\n  return (\"\",classes,kvs)\n\ninputMinted :: PandocMonad m => LP m Blocks\ninputMinted = do\n  pos <- getPosition\n  attr <- mintedAttr\n  f <- T.filter (/='\"') . untokenize <$> braced\n  mbCode <- readFileFromTexinputs (T.unpack f)\n  rawcode <- case mbCode of\n                  Just s -> return s\n                  Nothing -> do\n                    report $ CouldNotLoadIncludeFile f pos\n                    return \"\"\n  return $ B.codeBlockWith attr rawcode\n\nletterContents :: PandocMonad m => LP m Blocks\nletterContents = do\n  bs <- blocks\n  st <- getState\n  -- add signature (author) and address (title)\n  let addr = case lookupMeta \"address\" (sMeta st) of\n                  Just (MetaBlocks [Plain xs]) ->\n                     para $ trimInlines $ fromList xs\n                  _ -> mempty\n  return $ addr <> bs -- sig added by \\closing\n\nfigure' :: PandocMonad m => LP m Blocks\nfigure' = try $ do\n  sp\n  poshint <- option \"\" $ untokenize <$> bracketedToks\n  sp\n  resetCaption\n  innerContent <- many $ try (Left <$> label) <|> (Right <$> block)\n  let content = walk go $ mconcat $ snd $ partitionEithers innerContent\n  st <- getState\n  let caption' = fromMaybe B.emptyCaption $ sCaption st\n  let mblabel  = sLastLabel st\n  let kvs = [(\"latex-placement\", poshint) | not (T.null poshint)]\n  let ident = fromMaybe \"\" mblabel\n  let attr  = (ident, [], kvs)\n  case mblabel of\n    Nothing   -> pure ()\n    Just lab  -> do\n      num <- getNextNumber sLastFigureNum\n      setState\n        st { sLastFigureNum = num\n           , sLabels = M.insert lab [Str (renderDottedNum num)] (sLabels st)\n           }\n  return $ B.figureWith attr caption' content\n\n  where\n  -- Remove the `Image` caption b.c. it's on the `Figure`\n  go (Para [Image attr [Str \"image\"] target]) = Plain [Image attr [] target]\n  go x = x\n\ncoloredBlock :: PandocMonad m => Text -> LP m Blocks\ncoloredBlock stylename = try $ do\n  skipopts\n  color <- braced\n  notFollowedBy (grouped inline)\n  let constructor = divWith (\"\",[],[(\"style\",stylename <> \": \" <> untokenize color)])\n  constructor <$> grouped block\n\ngraphicsPath :: PandocMonad m => LP m Blocks\ngraphicsPath = do\n  ps <- map (T.unpack . untokenize) <$>\n          (bgroup *> spaces *> manyTill (braced <* spaces) egroup)\n  getResourcePath >>= setResourcePath . (<> ps)\n  return mempty\n\nsplitBibs :: Text -> [Inlines]\nsplitBibs = map (str . T.pack . flip replaceExtension \"bib\" . T.unpack . trim) . splitTextBy (==',')\n\nalltt :: Blocks -> Blocks\nalltt = walk strToCode\n  where strToCode (Str s)   = Code nullAttr s\n        strToCode Space     = RawInline (Format \"latex\") \"\\\\ \"\n        strToCode SoftBreak = LineBreak\n        strToCode x         = x\n\nparseListingsOptions :: [(Text, Text)] -> Attr\nparseListingsOptions options =\n  let kvs = [ (if k == \"firstnumber\"\n                  then \"startFrom\"\n                  else k, v) | (k,v) <- options ]\n      classes = [ \"numberLines\" |\n                  lookup \"numbers\" options == Just \"left\" ]\n             ++ maybeToList (listingsLanguage options)\n  in  (fromMaybe \"\" (lookup \"label\" options), classes, kvs)\n\ninputListing :: PandocMonad m => LP m Blocks\ninputListing = do\n  pos <- getPosition\n  options <- option [] keyvals\n  f <- T.filter (/='\"') . untokenize <$> braced\n  mbCode <- readFileFromTexinputs (T.unpack f)\n  codeLines <- case mbCode of\n                      Just s -> return $ T.lines s\n                      Nothing -> do\n                        report $ CouldNotLoadIncludeFile f pos\n                        return []\n  let (ident,classes,kvs) = parseListingsOptions options\n  let classes' =\n        (case listingsLanguage options of\n           Nothing -> (take 1 (languagesByExtension defaultSyntaxMap\n                                (T.pack $ takeExtension $ T.unpack f)) <>)\n           Just _  -> id) classes\n  let firstline = fromMaybe 1 $ lookup \"firstline\" options >>= safeRead\n  let lastline = fromMaybe (length codeLines) $\n                       lookup \"lastline\" options >>= safeRead\n  let codeContents = T.intercalate \"\\n\" $ take (1 + lastline - firstline) $\n                       drop (firstline - 1) codeLines\n  return $ codeBlockWith (ident,classes',kvs) codeContents\n\n-- lists\n\nitem :: PandocMonad m => LP m Blocks\nitem = void blocks *> controlSeq \"item\" *> skipopts *> blocks\n\ndescItem :: PandocMonad m => LP m (Inlines, [Blocks])\ndescItem = do\n  optional spaces1\n  controlSeq \"item\"\n  sp\n  ils <- opt\n  bs <- blocks\n  return (ils, [bs])\n\nlistenv :: PandocMonad m => Text -> LP m a -> LP m a\nlistenv name p = try $ do\n  oldInListItem <- sInListItem `fmap` getState\n  updateState $ \\st -> st{ sInListItem = True }\n  res <- env name p\n  updateState $ \\st -> st{ sInListItem = oldInListItem }\n  return res\n\norderedList' :: PandocMonad m => LP m Blocks\norderedList' = try $ do\n  spaces\n  let markerSpec = do\n        symbol '['\n        ts <- untokenize <$> manyTill anyTok (symbol ']')\n        case runParser anyOrderedListMarker def \"option\" ts of\n             Right r -> return r\n             Left _  -> do\n               pos <- getPosition\n               report $ SkippedContent (\"[\" <> ts <> \"]\") pos\n               return (1, DefaultStyle, DefaultDelim)\n  (_, style, delim) <- option (1, DefaultStyle, DefaultDelim) markerSpec\n  spaces\n  optional $ try $ controlSeq \"setlength\"\n                   *> grouped (count 1 $ controlSeq \"itemindent\")\n                   *> braced\n  spaces\n  start <- option 1 $ try $ do pos <- getPosition\n                               controlSeq \"setcounter\"\n                               ctr <- untokenize <$> braced\n                               guard $ \"enum\" `T.isPrefixOf` ctr\n                               guard $ T.all (`elem` ['i','v']) (T.drop 4 ctr)\n                               sp\n                               num <- untokenize <$> braced\n                               case safeRead num of\n                                    Just i -> return (i + 1 :: Int)\n                                    Nothing -> do\n                                      report $ SkippedContent\n                                        (\"\\\\setcounter{\" <> ctr <>\n                                         \"}{\" <> num <> \"}\") pos\n                                      return 1\n  bs <- listenv \"enumerate\" (many item)\n  return $ orderedListWith (start, style, delim) bs\n\nblock :: PandocMonad m => LP m Blocks\nblock = do\n  Tok _ toktype _ <- peekTok\n  res <- (case toktype of\n            Newline           -> mempty <$ spaces1\n            Spaces            -> mempty <$ spaces1\n            Comment           -> mempty <$ spaces1\n            Word              -> paragraph\n            CtrlSeq \"begin\"   -> environment\n            CtrlSeq _         -> macroDef (rawBlock \"latex\")\n                               <|> blockCommand\n            _                 -> mzero)\n          <|> paragraph\n          <|> grouped block\n  trace (T.take 60 $ tshow $ B.toList res)\n  return res\n\nblocks :: PandocMonad m => LP m Blocks\nblocks = mconcat <$> many block\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Man.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE ViewPatterns      #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Man\n   Copyright   : Copyright (C) 2018-2020 Yan Pashkovsky and John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Yan Pashkovsky <yanp.bugz@gmail.com>\n   Stability   : WIP\n   Portability : portable\n\nConversion of man to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Man (readMan) where\n\nimport Data.Char (toLower)\nimport Data.Default (Default)\nimport Control.Monad (mzero, guard, void)\nimport Control.Monad.Trans (lift)\nimport Control.Monad.Except (throwError)\nimport Data.Maybe (catMaybes, isJust)\nimport Data.List (intersperse)\nimport qualified Data.Text as T\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad(..), report)\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Walk (query)\nimport Text.Pandoc.Readers.Roff  -- TODO explicit imports\nimport qualified Text.Pandoc.Parsing as P\nimport qualified Data.Foldable as Foldable\nimport Text.Pandoc.Shared (extractSpaces)\n\ndata ManState = ManState { readerOptions   :: ReaderOptions\n                         , metadata        :: Meta\n                         , tableCellsPlain :: Bool\n                         } deriving Show\n\ninstance Default ManState where\n  def = ManState { readerOptions   = def\n                 , metadata        = nullMeta\n                 , tableCellsPlain = True }\n\ntype ManParser m = P.ParsecT [RoffToken] ManState m\n\n\n-- | Read man (troff) from an input string and return a Pandoc document.\nreadMan :: (PandocMonad m, ToSources a)\n        => ReaderOptions\n        -> a\n        -> m Pandoc\nreadMan opts s = do\n  let Sources inps = toSources s\n  tokenz <- mconcat <$> mapM (uncurry lexRoff) inps\n  let state = def {readerOptions = opts} :: ManState\n  eitherdoc <- readWithMTokens parseMan state\n     (Foldable.toList . unRoffTokens $ tokenz)\n  either (throwError . fromParsecError (Sources inps)) return eitherdoc\n\n\nreadWithMTokens :: PandocMonad m\n        => ParsecT [RoffToken] ManState m a  -- ^ parser\n        -> ManState                         -- ^ initial state\n        -> [RoffToken]                       -- ^ input\n        -> m (Either ParseError a)\nreadWithMTokens parser state input =\n  runParserT parser state \"source\" input\n\n\nparseMan :: PandocMonad m => ManParser m Pandoc\nparseMan = do\n  bs <- many parseBlock <* eof\n  meta <- metadata <$> getState\n  let (Pandoc _ blocks) = doc $ mconcat bs\n  return $ Pandoc meta blocks\n\nparseBlock :: PandocMonad m => ManParser m Blocks\nparseBlock = choice [ parseList\n                    , parseDefinitionList\n                    , parseHeader\n                    , parseTable\n                    , parseTitle\n                    , parseCodeBlock\n                    , parseBlockQuote\n                    , parseNewParagraph\n                    , parsePara\n                    , skipUnknownMacro\n                    ]\n\nparseTable :: PandocMonad m => ManParser m Blocks\nparseTable = do\n  updateState $ \\st -> st { tableCellsPlain = True }\n  let isTbl Tbl{} = True\n      isTbl _     = False\n  Tbl _opts rows pos <- msatisfy isTbl\n  case rows of\n    ((as,_):_) -> try (do\n      let as' = map (columnTypeToAlignment . columnType) as\n      guard $ all isJust as'\n      let alignments = catMaybes as'\n      let (headerRow', bodyRows') =\n            case rows of\n              (h:x:bs)\n               | isHrule x -> (h, bs)\n              _ -> (([],[]), rows)\n      headerRow <- mapM parseTableCell $ snd headerRow'\n      bodyRows <- mapM (mapM parseTableCell . snd) bodyRows'\n      isPlainTable <- tableCellsPlain <$> getState\n      let widths = if isPlainTable\n                      then repeat ColWidthDefault\n                      else repeat $ ColWidth (1.0 / fromIntegral (length alignments))\n      return $ B.table B.emptyCaption (zip alignments widths)\n                  (TableHead nullAttr $ toHeaderRow headerRow)\n                  [TableBody nullAttr 0 [] $ map toRow bodyRows]\n                  (TableFoot nullAttr [])) <|> fallback pos\n    [] -> fallback pos\n\n where\n\n  parseTableCell ts = do\n    st <- getState\n    let ts' = Foldable.toList $ unRoffTokens ts\n    let plaintcell = try $ do\n          skipMany memptyLine\n          plain . trimInlines <$> (parseInlines <* eof)\n    let blockstcell = try $ do\n          skipMany memptyLine\n          mconcat <$> many parseBlock <* eof\n    res <- if null ts'\n              then return $ Right mempty\n              else lift $ readWithMTokens plaintcell st ts'\n    case res of\n      Left _  -> do\n        res' <- lift $ readWithMTokens blockstcell st ts'\n        case res' of\n          Left _  -> Prelude.fail \"Could not parse table cell\"\n          Right x -> do\n            updateState $ \\s -> s{ tableCellsPlain = False }\n            return x\n      Right x -> return x\n\n  isHrule :: TableRow -> Bool\n  isHrule ([cellfmt], _) = columnType cellfmt `elem` ['_','-','=']\n  isHrule (_, [RoffTokens ss]) =\n    case Foldable.toList ss of\n      [TextLine [RoffStr (T.unpack -> [c])]] -> c `elem` ['_','-','=']\n      _                     -> False\n  isHrule _ = False\n\n  fallback pos = do\n    report $ SkippedContent \"TABLE\" pos\n    return $ B.para (B.text \"TABLE\")\n\n  columnTypeToAlignment :: Char -> Maybe Alignment\n  columnTypeToAlignment c =\n    case toLower c of\n      'a' -> Just AlignLeft\n      'c' -> Just AlignCenter\n      'l' -> Just AlignLeft\n      'n' -> Just AlignRight\n      'r' -> Just AlignRight\n      _   -> Nothing\n\n  toRow = Row nullAttr . map simpleCell\n  toHeaderRow l = [toRow l | not (null l)]\n\nparseNewParagraph :: PandocMonad m => ManParser m Blocks\nparseNewParagraph = do\n  mmacro \"P\" <|> mmacro \"PP\" <|> mmacro \"LP\" <|> memptyLine\n  return mempty\n\n--\n-- Parser: [RoffToken] -> Pandoc\n--\n\nmsatisfy :: Monad m\n         => (RoffToken -> Bool) -> P.ParsecT [RoffToken] st m RoffToken\nmsatisfy predic = P.tokenPrim show nextPos testTok\n  where\n    testTok t     = if predic t then Just t else Nothing\n    nextPos _pos _x (ControlLine _ _ pos':_) = pos'\n    nextPos pos _x _xs  = P.updatePosString\n                             (P.setSourceColumn\n                               (P.setSourceLine pos $\n                                 P.sourceLine pos + 1) 1) \"\"\n\nmtoken :: PandocMonad m => ManParser m RoffToken\nmtoken = msatisfy (const True)\n\nmline :: PandocMonad m => ManParser m RoffToken\nmline = msatisfy isTextLine where\n  isTextLine (TextLine _) = True\n  isTextLine _ = False\n\nmemptyLine :: PandocMonad m => ManParser m RoffToken\nmemptyLine = msatisfy isEmptyLine where\n  isEmptyLine EmptyLine = True\n  isEmptyLine _ = False\n\nmmacro :: PandocMonad m => T.Text -> ManParser m RoffToken\nmmacro mk = msatisfy isControlLine where\n  isControlLine (ControlLine mk' _ _) | mk == mk' = True\n                            | otherwise = False\n  isControlLine _ = False\n\nmmacroAny :: PandocMonad m => ManParser m RoffToken\nmmacroAny = msatisfy isControlLine where\n  isControlLine ControlLine{} = True\n  isControlLine _ = False\n\n--\n-- RoffToken -> Block functions\n--\n\nparseTitle :: PandocMonad m => ManParser m Blocks\nparseTitle = do\n  (ControlLine _ args _) <- mmacro \"TH\"\n  let adjustMeta =\n       case args of\n         (x:y:z:a:b:_) -> setMeta \"title\" (linePartsToInlines x) .\n                          setMeta \"section\" (linePartsToInlines y) .\n                          setMeta \"date\" (linePartsToInlines z) .\n                          setMeta \"footer\" (linePartsToInlines a) .\n                          setMeta \"header\" (linePartsToInlines b)\n         [x,y,z,a] -> setMeta \"title\" (linePartsToInlines x) .\n                      setMeta \"section\" (linePartsToInlines y) .\n                      setMeta \"date\" (linePartsToInlines z) .\n                      setMeta \"footer\" (linePartsToInlines a)\n         [x,y,z]   -> setMeta \"title\" (linePartsToInlines x) .\n                      setMeta \"section\" (linePartsToInlines y) .\n                      setMeta \"date\" (linePartsToInlines z)\n         [x,y]     -> setMeta \"title\" (linePartsToInlines x) .\n                      setMeta \"section\" (linePartsToInlines y)\n         [x]       -> setMeta \"title\" (linePartsToInlines x)\n         []        -> id\n  updateState $ \\st -> st{ metadata = adjustMeta $ metadata st }\n  return mempty\n\nlinePartsToInlines :: [LinePart] -> Inlines\nlinePartsToInlines = go False\n\n  where\n  go :: Bool -> [LinePart] -> Inlines\n  go _ [] = mempty\n  go mono (MacroArg _:xs) = go mono xs -- shouldn't happen\n  go mono (RoffStr s : RoffStr t : xs) = go mono (RoffStr (s <> t):xs)\n  go mono (RoffStr s : xs)\n    | mono      = code s <> go mono xs\n    | otherwise = text s <> go mono xs\n  go mono (Font fs: xs)\n    | litals > 0 && litals >= lbolds && litals >= lmonos\n       = extractSpaces emph (go mono (Font fs{ fontItalic = False } :\n                   map (adjustFontSpec (\\s -> s{ fontItalic = False }))\n                   itals)) <>\n            go mono italsrest\n    | lbolds > 0 && lbolds >= lmonos\n       = extractSpaces strong (go mono (Font fs{ fontBold = False } :\n              map (adjustFontSpec (\\s -> s{ fontBold = False }))\n              bolds)) <>\n            go mono boldsrest\n    | lmonos > 0\n       = go True (Font fs{ fontMonospace = False } :\n          map (adjustFontSpec (\\s -> s { fontMonospace = False }))\n          monos) <> go mono monosrest\n    | otherwise = go mono xs\n    where\n      adjustFontSpec f (Font fspec) = Font (f fspec)\n      adjustFontSpec _ x            = x\n      withFont f (Font fspec) = f fspec\n      withFont _ _            = False\n      litals = length itals\n      lbolds = length bolds\n      lmonos = length monos\n      (itals, italsrest) =\n        if fontItalic fs\n           then break (withFont (not . fontItalic)) xs\n           else ([], xs)\n      (bolds, boldsrest) =\n        if fontBold fs\n           then break (withFont (not . fontBold)) xs\n           else ([], xs)\n      (monos, monosrest) =\n        if fontMonospace fs\n           then break (withFont (not . fontMonospace)) xs\n           else ([], xs)\n\nparsePara :: PandocMonad m => ManParser m Blocks\nparsePara = para . trimInlines <$> parseInlines\n\nparseInlines :: PandocMonad m => ManParser m Inlines\nparseInlines = mconcat . intersperse B.space <$> many1 parseInline\n\nparseInline :: PandocMonad m => ManParser m Inlines\nparseInline = try $ do\n  tok <- mtoken\n  case tok of\n    TextLine lparts -> return $ linePartsToInlines lparts\n    ControlLine mname args pos -> handleInlineMacro mname args pos\n    _ -> mzero\n\nhandleInlineMacro :: PandocMonad m\n                  => T.Text -> [Arg] -> SourcePos -> ManParser m Inlines\nhandleInlineMacro mname args _pos =\n  case mname of\n    \"UR\" -> parseLink args\n    \"MT\" -> parseEmailLink args\n    \"B\"  -> parseBold args\n    \"I\"  -> parseItalic args\n    \"br\" -> return linebreak\n    \"BI\" -> parseAlternatingFonts [strong, emph] args\n    \"IB\" -> parseAlternatingFonts [emph, strong] args\n    \"IR\" -> parseAlternatingFonts [emph, id] args\n    \"RI\" -> parseAlternatingFonts [id, emph] args\n    \"BR\" -> parseAlternatingFonts [strong, id] args\n    \"RB\" -> parseAlternatingFonts [id, strong] args\n    \"SY\" -> return $ extractSpaces strong $ mconcat $ intersperse B.space\n                   $ map linePartsToInlines args\n    \"YS\" -> return mempty\n    \"OP\" -> case args of\n              (x:ys) -> return $ B.space <> str \"[\" <> B.space <>\n                         mconcat (extractSpaces strong (linePartsToInlines x) :\n                           map ((B.space <>) . linePartsToInlines) ys)\n                         <> B.space <> str \"]\"\n              []     -> return mempty\n    _ -> mzero\n\nparseBold :: PandocMonad m => [Arg] -> ManParser m Inlines\nparseBold [] = do\n  TextLine lparts <- mline\n  return $ extractSpaces strong $ linePartsToInlines lparts\nparseBold args = return $\n  extractSpaces strong $\n  mconcat $ intersperse B.space $ map linePartsToInlines args\n\nparseItalic :: PandocMonad m => [Arg] -> ManParser m Inlines\nparseItalic [] = do\n  TextLine lparts <- mline\n  return $ extractSpaces emph $ linePartsToInlines lparts\nparseItalic args = return $\n  extractSpaces emph $\n  mconcat $ intersperse B.space $ map linePartsToInlines args\n\nparseAlternatingFonts :: [Inlines -> Inlines]\n                      -> [Arg]\n                      -> ManParser m Inlines\nparseAlternatingFonts constructors args = return $ mconcat $\n  zipWith (\\f arg -> f (linePartsToInlines arg)) (cycle constructors) args\n\nlineInl :: PandocMonad m => ManParser m Inlines\nlineInl = do\n  (TextLine fragments) <- mline\n  return $ linePartsToInlines fragments\n\nbareIP :: PandocMonad m => ManParser m RoffToken\nbareIP = msatisfy isBareIP where\n  isBareIP (ControlLine \"IP\" [] _) = True\n  isBareIP _                  = False\n\nendmacro :: PandocMonad m => T.Text -> ManParser m ()\nendmacro name = void (mmacro name)\n             <|> lookAhead (void newBlockMacro)\n             <|> lookAhead eof\n  where\n    newBlockMacro = msatisfy isNewBlockMacro\n    isNewBlockMacro (ControlLine \"SH\" _ _) = True\n    isNewBlockMacro (ControlLine \"SS\" _ _) = True\n    isNewBlockMacro _ = False\n\nparseCodeBlock :: PandocMonad m => ManParser m Blocks\nparseCodeBlock = try $ do\n  optional bareIP\n  optional (mmacro \"in\") -- some people indent their code\n  toks <- (mmacro \"nf\" *> manyTill codeline (endmacro \"fi\"))\n      <|> (mmacro \"EX\" *> manyTill codeline (endmacro \"EE\"))\n  optional (mmacro \"in\")\n  return $ codeBlock (T.intercalate \"\\n\" $ catMaybes toks)\n\n  where\n\n  codeline = do\n    tok <- mtoken\n    case tok of\n      ControlLine \"PP\" _ _ -> return $ Just \"\" -- .PP sometimes used for blank line\n      ControlLine mname args pos ->\n        (Just . query getText <$> handleInlineMacro mname args pos) <|>\n          do report $ SkippedContent (\".\" <> mname) pos\n             return Nothing\n      Tbl _ _ pos     -> do\n        report $ SkippedContent \"TABLE\" pos\n        return $ Just \"TABLE\"\n      EmptyLine -> return $ Just \"\"\n      TextLine ss\n        | not (null ss)\n        , all isFontToken ss -> return Nothing\n        | otherwise -> return $ Just $ linePartsToText ss\n\n  isFontToken Font{}     = True\n  isFontToken _            = False\n\n  getText :: Inline -> T.Text\n  getText (Str s)    = s\n  getText Space      = \" \"\n  getText (Code _ s) = s\n  getText SoftBreak  = \"\\n\"\n  getText LineBreak  = \"\\n\"\n  getText _          = \"\"\n\nparseHeader :: PandocMonad m => ManParser m Blocks\nparseHeader = do\n  ControlLine name args _ <- mmacro \"SH\" <|> mmacro \"SS\"\n  contents <- if null args\n                 then option mempty lineInl\n                 else return $ mconcat $ intersperse B.space\n                             $ map linePartsToInlines args\n  let lvl = if name == \"SH\" then 1 else 2\n  return $ header lvl contents\n\nparseBlockQuote :: PandocMonad m => ManParser m Blocks\nparseBlockQuote = blockQuote <$>\n   (  (mmacro \"RS\" *> (mconcat <$> manyTill parseBlock (endmacro \"RE\")))\n  <|> parseIndentedParagraphs\n   )\n where\n  parseIndentedParagraphs = try $ do\n    bareIP\n    first <- parsePara <|> parseCodeBlock\n    rest <- many $ try (memptyLine *> (parsePara <|> parseCodeBlock))\n    pure (first <> mconcat rest)\n\ndata ListType = Ordered ListAttributes\n              | Bullet\n              | Definition T.Text\n\nlistTypeMatches :: Maybe ListType -> ListType -> Bool\nlistTypeMatches Nothing _            = True\nlistTypeMatches (Just Bullet) Bullet = True\nlistTypeMatches (Just (Ordered (_,x,y))) (Ordered (_,x',y'))\n                                     = x == x' && y == y'\nlistTypeMatches (Just (Definition _)) (Definition _) = True\nlistTypeMatches (Just _) _           = False\n\nlistItem :: PandocMonad m => Maybe ListType -> ManParser m (ListType, Blocks)\nlistItem mbListType = try $ do\n  (ControlLine _ args _) <- mmacro \"IP\"\n  case args of\n    (arg1 : _)  -> do\n      let cs = linePartsToText arg1\n      let cs' = if not (T.any (== '.') cs || T.any (== ')') cs) then cs <> \".\" else cs\n      let lt = case P.runParser anyOrderedListMarker defaultParserState\n                     \"list marker\" cs' of\n                  Right (start, listtype, listdelim)\n                    | cs == cs' -> Ordered (start, listtype, listdelim)\n                    | otherwise -> Ordered (start, listtype, DefaultDelim)\n                  Left _\n                    | cs == \"\\183\" || cs == \"-\" || cs == \"*\" || cs == \"+\"\n                                   -> Bullet\n                    | otherwise    -> Definition cs\n      guard $ listTypeMatches mbListType lt\n      skipMany memptyLine\n      inls <- option mempty parseInlines\n      skipMany memptyLine\n      continuations <- mconcat <$> many continuation\n      return (lt, para inls <> continuations)\n    []          -> mzero\n\nparseList :: PandocMonad m => ManParser m Blocks\nparseList = try $ do\n  x@(lt, _) <- listItem Nothing\n  xs <- many (listItem (Just lt))\n  let toDefItem (Definition t, bs) = (B.text t, [bs])\n      toDefItem _ = mempty\n  return $ case lt of\n             Bullet        -> bulletList $ map snd (x:xs)\n             Ordered lattr -> orderedListWith lattr $ map snd (x:xs)\n             Definition _  -> definitionList $ map toDefItem (x:xs)\n\ncontinuation :: PandocMonad m => ManParser m Blocks\ncontinuation =\n      (mmacro \"RS\" *> (mconcat <$> manyTill parseBlock (endmacro \"RE\")))\n  <|> try ((memptyLine <|> bareIP) *> (parsePara <|> parseCodeBlock))\n\ndefinitionListItem :: PandocMonad m\n                   => ManParser m (Inlines, [Blocks])\ndefinitionListItem = try $ do\n  mmacro \"TP\"  -- args specify indent level, can ignore\n  skipMany memptyLine\n  term <- parseInline\n  skipMany memptyLine\n  moreterms <- many $ try $ do\n                 mmacro \"TQ\"\n                 parseInline\n  skipMany memptyLine\n  firstBlock <- parseBlock\n  otherBlocks <- mconcat <$> many continuation\n  return ( mconcat (intersperse B.linebreak (term:moreterms))\n         , [firstBlock <> otherBlocks])\n\nparseDefinitionList :: PandocMonad m => ManParser m Blocks\nparseDefinitionList = definitionList <$> many1 definitionListItem\n\nparseLink :: PandocMonad m => [Arg] -> ManParser m Inlines\nparseLink args = do\n  contents <- mconcat <$> many lineInl\n  ControlLine _ endargs _ <- mmacro \"UE\"\n  let url = case args of\n              [] -> \"\"\n              (x:_) -> linePartsToText x\n  return $ link url \"\" contents <>\n    case endargs of\n      []    -> mempty\n      (x:_) -> linePartsToInlines x\n\nparseEmailLink :: PandocMonad m => [Arg] -> ManParser m Inlines\nparseEmailLink args = do\n  contents <- mconcat <$> many lineInl\n  ControlLine _ endargs _ <- mmacro \"ME\"\n  let url = case args of\n              [] -> \"\"\n              (x:_) -> \"mailto:\" <> linePartsToText x\n  return $ link url \"\" contents <>\n    case endargs of\n      []    -> mempty\n      (x:_) -> linePartsToInlines x\n\nskipUnknownMacro :: PandocMonad m => ManParser m Blocks\nskipUnknownMacro = do\n  tok <- mmacroAny\n  case tok of\n    ControlLine mkind _ pos -> do\n      report $ SkippedContent (\".\" <> mkind) pos\n      return mempty\n    _                 -> Prelude.fail \"the impossible happened\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Markdown.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE BangPatterns        #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE TupleSections       #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Readers.Markdown\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of markdown-formatted plain text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Markdown (\n  readMarkdown,\n  yamlToMeta,\n  yamlToRefs ) where\n\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport qualified Data.Bifunctor as Bifunctor\nimport Data.Char (isAlphaNum, isPunctuation, isSpace)\nimport Data.List (transpose, elemIndex, sortOn)\nimport qualified Data.List as L\nimport qualified Data.Map as M\nimport Data.Maybe\nimport qualified Data.Set as Set\nimport qualified Data.Attoparsec.Text as A\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.ByteString as BS\nimport System.FilePath (addExtension, takeExtension, takeDirectory)\nimport qualified System.FilePath.Windows as Windows\nimport qualified System.FilePath.Posix as Posix\nimport Text.DocLayout (realLength)\nimport Text.HTML.TagSoup hiding (Row)\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..), report)\nimport Text.Pandoc.Definition as Pandoc\nimport Text.Pandoc.Emoji (emojiToInline)\nimport Text.Pandoc.Error\nimport Safe.Foldable (maximumBounded)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.Parsing hiding (tableCaption)\nimport Text.Pandoc.Readers.HTML (htmlInBalanced, htmlTag, isBlockTag,\n                                 isInlineTag, isTextTag)\nimport Text.Pandoc.Readers.LaTeX (applyMacros, rawLaTeXBlock, rawLaTeXInline)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI (escapeURI, isURI, pBase64DataURI)\nimport Text.Pandoc.XML (fromEntities)\nimport Text.Pandoc.Readers.Metadata (yamlBsToMeta, yamlBsToRefs, yamlMetaBlock)\n-- import Debug.Trace (traceShowId)\n\ntype MarkdownParser m = ParsecT Sources ParserState m\n\ntype F = Future ParserState\n\n-- | Read markdown from an input string and return a Pandoc document.\nreadMarkdown :: (PandocMonad m, ToSources a)\n             => ReaderOptions -- ^ Reader options\n             -> a             -- ^ Input\n             -> m Pandoc\nreadMarkdown opts s = do\n  parsed <- readWithM parseMarkdown def{ stateOptions = opts }\n                (ensureFinalNewlines 3 (toSources s))\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError e\n\n-- | Read a YAML string and convert it to pandoc metadata.\n-- String scalars in the YAML are parsed as Markdown.\nyamlToMeta :: PandocMonad m\n           => ReaderOptions\n           -> Maybe FilePath\n           -> BS.ByteString\n           -> m Meta\nyamlToMeta opts mbfp bstr = do\n  let parser = do\n        oldPos <- getPosition\n        setPosition $ initialPos (fromMaybe \"\" mbfp)\n        meta <- yamlBsToMeta (fmap B.toMetaValue <$> parseBlocks) bstr\n        checkNotes\n        setPosition oldPos\n        st <- getState\n        let result = runF meta st\n        reportLogMessages\n        return result\n  parsed <- readWithM parser def{ stateOptions = opts } (\"\" :: Text)\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError e\n\n-- | Read a YAML string and extract references from the\n-- 'references' field, filter using an id predicate and\n-- parsing fields as Markdown.\nyamlToRefs :: PandocMonad m\n           => (Text -> Bool)\n           -> ReaderOptions\n           -> Maybe FilePath\n           -> BS.ByteString\n           -> m [MetaValue]\nyamlToRefs idpred opts mbfp bstr = do\n  let parser = do\n        case mbfp of\n          Nothing -> return ()\n          Just fp -> setPosition $ initialPos fp\n        refs <- yamlBsToRefs (fmap B.toMetaValue <$> parseBlocks) idpred bstr\n        checkNotes\n        st <- getState\n        let result = runF refs st\n        reportLogMessages\n        return result\n  parsed <- readWithM parser def{ stateOptions = opts } (\"\" :: Text)\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError e\n\n\n\n\n--\n-- Constants and data structure definitions\n--\n\nisBulletListMarker :: Char -> Bool\nisBulletListMarker '*' = True\nisBulletListMarker '+' = True\nisBulletListMarker '-' = True\nisBulletListMarker _   = False\n\nisHruleChar :: Char -> Bool\nisHruleChar '*' = True\nisHruleChar '-' = True\nisHruleChar '_' = True\nisHruleChar _   = False\n\nsetextHChars :: [Char]\nsetextHChars = \"=-\"\n\n--\n-- auxiliary functions\n--\n\n-- | Succeeds when we're in list context.\ninList :: PandocMonad m => MarkdownParser m ()\ninList = do\n  ctx <- stateParserContext <$> getState\n  guard (ctx == ListItemState)\n\nspnl :: PandocMonad m => ParsecT Sources st m ()\nspnl = try $ do\n  skipSpaces\n  optional newline\n  skipSpaces\n  notFollowedBy (char '\\n')\n\nspnl' :: PandocMonad m => ParsecT Sources st m Text\nspnl' = try $ do\n  xs <- many spaceChar\n  ys <- option \"\" $ try $ (:) <$> newline\n                              <*> (many spaceChar <* notFollowedBy (char '\\n'))\n  return $ T.pack $ xs ++ ys\n\nindentSpaces :: PandocMonad m => MarkdownParser m Text\nindentSpaces = try $ do\n  tabStop <- getOption readerTabStop\n  countChar tabStop (char ' ') <|>\n    textStr \"\\t\" <?> \"indentation\"\n\nnonindentSpaces :: PandocMonad m => MarkdownParser m Text\nnonindentSpaces = do\n  n <- skipNonindentSpaces\n  return $ T.replicate n \" \"\n\n-- returns number of spaces parsed\nskipNonindentSpaces :: PandocMonad m => MarkdownParser m Int\nskipNonindentSpaces = do\n  tabStop <- getOption readerTabStop\n  gobbleAtMostSpaces (tabStop - 1) <* notFollowedBy spaceChar\n\nlitChar :: PandocMonad m => MarkdownParser m Text\nlitChar = T.singleton <$> escapedChar'\n       <|> characterReference\n       <|> T.singleton <$> noneOf \"\\n\"\n       <|> try (newline >> notFollowedBy blankline >> return \" \")\n\nlitBetween :: PandocMonad m => Char -> Char -> MarkdownParser m Text\nlitBetween op cl = try $ do\n  char op\n  mconcat <$> (manyTill litChar (char cl))\n\nlitCharNoSpace :: PandocMonad m => MarkdownParser m Text\nlitCharNoSpace = T.singleton <$> escapedChar''\n       <|> characterReference\n       <|> T.singleton <$> noneOf \"\\n \\r\\t\"\n where\n   escapedChar'' = do\n     c <- escapedChar'\n     pure $ case c of\n       ' ' -> '\\160'\n       _ -> c\n\nlitBetweenNoSpace :: PandocMonad m => Char -> Char -> MarkdownParser m Text\nlitBetweenNoSpace op cl = try $ do\n  char op\n  mconcat <$> (manyTill litCharNoSpace (char cl))\n\n-- | Parse a sequence of elements between square brackets,\n-- including between balanced pairs of square brackets.\n-- Skip brackets in standard inline escapes, code, raw HTML or LaTeX.\ninBalancedBrackets :: PandocMonad m\n                   => MarkdownParser m (F a)\n                   -> MarkdownParser m (F a)\ninBalancedBrackets innerParser =\n  try $ char '[' >> withRaw (go 1) >>=\n          parseFromString innerParser . stripBracket . snd\n  where stripBracket t = case T.unsnoc t of\n          Just (t', ']') -> t'\n          _              -> t\n        go :: PandocMonad m => Int -> MarkdownParser m ()\n        go 0 = return ()\n        go openBrackets =\n          (() <$ (escapedChar <|>\n                code <|>\n                math <|>\n                endline <|>\n                rawHtmlInline <|>\n                rawLaTeXInline') >> go openBrackets)\n          <|>\n          (do char ']'\n              Control.Monad.when (openBrackets > 1) $ go (openBrackets - 1))\n          <|>\n          (char '[' >> go (openBrackets + 1))\n          <|>\n          (satisfy (/= '\\n') >> go openBrackets)\n\n--\n-- document structure\n--\n\nrawTitleBlockLine :: PandocMonad m => MarkdownParser m Text\nrawTitleBlockLine = do\n  char '%'\n  skipSpaces\n  first <- anyLine\n  rest <- many $ try $ do spaceChar\n                          notFollowedBy blankline\n                          skipSpaces\n                          anyLine\n  return $ trim $ T.unlines (first:rest)\n\ntitleLine :: PandocMonad m => MarkdownParser m (F Inlines)\ntitleLine = try $ do\n  raw <- rawTitleBlockLine\n  res <- parseFromString' inlines raw\n  return $ trimInlinesF res\n\nauthorsLine :: PandocMonad m => MarkdownParser m (F [Inlines])\nauthorsLine = try $ do\n  raw <- rawTitleBlockLine\n  let sep = (char ';' <* spaces) <|> newline\n  let pAuthors = sepEndBy\n            (trimInlinesF . mconcat <$> many\n                 (try $ notFollowedBy sep >> inline))\n            sep\n  sequence <$> parseFromString' pAuthors raw\n\ndateLine :: PandocMonad m => MarkdownParser m (F Inlines)\ndateLine = try $ do\n  raw <- rawTitleBlockLine\n  res <- parseFromString' inlines raw\n  return $ trimInlinesF res\n\ntitleBlock :: PandocMonad m => MarkdownParser m ()\ntitleBlock = pandocTitleBlock <|> mmdTitleBlock\n\npandocTitleBlock :: PandocMonad m => MarkdownParser m ()\npandocTitleBlock = do\n  guardEnabled Ext_pandoc_title_block\n  lookAhead (char '%')\n  try $ do\n    title <- option mempty titleLine\n    author <- option (return []) authorsLine\n    date <- option mempty dateLine\n    optional blanklines\n    let meta' = do title' <- title\n                   author' <- author\n                   date' <- date\n                   return $\n                       (if null title'\n                           then id\n                           else B.setMeta \"title\" title')\n                     . (if null author'\n                           then id\n                           else B.setMeta \"author\" author')\n                     . (if null date'\n                           then id\n                           else B.setMeta \"date\" date')\n                     $ nullMeta\n    updateState $ \\st -> st{ stateMeta' = stateMeta' st <> meta' }\n\nyamlMetaBlock' :: PandocMonad m => MarkdownParser m (F Blocks)\nyamlMetaBlock' = do\n  guardEnabled Ext_yaml_metadata_block\n  newMetaF <- yamlMetaBlock (fmap B.toMetaValue <$> parseBlocks)\n  -- Since `<>` is left-biased, existing values are not touched:\n  updateState $ \\st -> st{ stateMeta' = stateMeta' st <> newMetaF }\n  return mempty\n\nmmdTitleBlock :: PandocMonad m => MarkdownParser m ()\nmmdTitleBlock = do\n  guardEnabled Ext_mmd_title_block\n  try $ do\n    firstPair <- kvPair False\n    restPairs <- many (kvPair True)\n    let kvPairs = firstPair : restPairs\n    blanklines\n    updateState $ \\st -> st{ stateMeta' = stateMeta' st <>\n                               return (Meta $ M.fromList kvPairs) }\n\nkvPair :: PandocMonad m => Bool -> MarkdownParser m (Text, MetaValue)\nkvPair allowEmpty = try $ do\n  key <- many1TillChar (alphaNum <|> oneOf \"_- \") (char ':')\n  val <- trim <$> manyTillChar anyChar\n          (try $ newline >> lookAhead (blankline <|> nonspaceChar))\n  guard $ allowEmpty || not (T.null val)\n  let key' = T.concat $ T.words $ T.toLower key\n  let val' = MetaInlines $ B.toList $ B.text val\n  return (key',val')\n\nparseMarkdown :: PandocMonad m => MarkdownParser m Pandoc\nparseMarkdown = do\n  optional titleBlock\n  blocks <- parseBlocks\n  st <- getState\n  checkNotes\n  let doc = runF (do Pandoc _ bs <- B.doc <$> blocks\n                     meta <- stateMeta' st\n                     return $ Pandoc meta bs) st\n  reportLogMessages\n  return doc\n\n-- check for notes with no corresponding note references\ncheckNotes :: PandocMonad m => MarkdownParser m ()\ncheckNotes = do\n  st <- getState\n  let notesUsed = stateNoteRefs st\n  let notesDefined = M.keys (stateNotes' st)\n  mapM_ (\\n -> unless (n `Set.member` notesUsed) $\n                case M.lookup n (stateNotes' st) of\n                   Just (pos, _) -> report (NoteDefinedButNotUsed n pos)\n                   Nothing -> throwError $\n                     PandocShouldNeverHappenError \"note not found\")\n         notesDefined\n\n\nreferenceKey :: PandocMonad m => MarkdownParser m (F Blocks)\nreferenceKey = try $ do\n  pos <- getPosition\n  skipNonindentSpaces\n  notFollowedBy (void cite)\n  (_,raw) <- reference\n  char ':'\n  skipSpaces >> optional newline >> skipSpaces >> notFollowedBy (char '[')\n  let sourceURL = fmap T.unwords $ many $ try $ do\n                    skipMany spaceChar\n                    notFollowedBy' referenceTitle\n                    notFollowedBy' $ guardEnabled Ext_link_attributes >>\n                                     attributes\n                    notFollowedBy' $ guardEnabled Ext_mmd_link_attributes >>\n                                     try (spnl <* keyValAttr)\n                    notFollowedBy' (() <$ reference)\n                    mconcat <$> many1 (notFollowedBy space *> litChar)\n  rebase <- option False (True <$ guardEnabled Ext_rebase_relative_paths)\n  src <- (if rebase then rebasePath pos else id) <$>\n             (try (litBetween '<' '>') <|> sourceURL)\n  tit <- option \"\" referenceTitle\n  attr   <- option nullAttr $ try $\n              do guardEnabled Ext_link_attributes\n                 skipSpaces >> optional newline >> skipSpaces\n                 attributes\n  addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes\n                          >> many (try $ spnl >> keyValAttr)\n  blanklines\n  let attr'  = extractIdClass $ L.foldl' (\\x f -> f x) attr addKvs\n      target = (escapeURI $ trimr src, tit)\n  st <- getState\n  let oldkeys = stateKeys st\n  let key = toKey raw\n  case M.lookup key oldkeys of\n    Just (t,a) | not (t == target && a == attr') ->\n      -- We don't warn on two duplicate keys if the targets are also\n      -- the same. This can happen naturally with --reference-location=block\n      -- or section. See #3701.\n      logMessage $ DuplicateLinkReference raw pos\n    _ -> return ()\n  updateState $ \\s -> s { stateKeys = M.insert key (target, attr') oldkeys }\n  return $ return mempty\n\nreferenceTitle :: PandocMonad m => MarkdownParser m Text\nreferenceTitle = try $ do\n  skipSpaces >> optional newline >> skipSpaces\n  quotedTitle '\"' <|> quotedTitle '\\'' <|> charsInBalanced '(' ')' litChar\n\n-- A link title in quotes\nquotedTitle :: PandocMonad m => Char -> MarkdownParser m Text\nquotedTitle c = try $ do\n  char c\n  notFollowedBy spaces\n  let pEnder = try $ char c >> notFollowedBy (satisfy isAlphaNum)\n  let regChunk = many1Char (noneOf ['\\\\','\\n','&',c]) <|> litChar\n  let nestedChunk = (\\x -> (c `T.cons` x) `T.snoc` c) <$> quotedTitle c\n  T.unwords . T.words . T.concat <$> manyTill (nestedChunk <|> regChunk) pEnder\n\n-- | PHP Markdown Extra style abbreviation key.  Currently\n-- we just skip them, since Pandoc doesn't have an element for\n-- an abbreviation.\nabbrevKey :: PandocMonad m => MarkdownParser m (F Blocks)\nabbrevKey = do\n  guardEnabled Ext_abbreviations\n  try $ do\n    char '*'\n    reference\n    char ':'\n    skipMany (satisfy (/= '\\n'))\n    blanklines\n    return $ return mempty\n\nnoteMarker :: PandocMonad m => MarkdownParser m Text\nnoteMarker = string \"[^\" >>\n  many1TillChar (satisfy (`notElem` ['\\r','\\n','\\t',' ','^','[',']']))\n                (char ']')\n\nrawLine :: PandocMonad m => MarkdownParser m Text\nrawLine = try $ do\n  notFollowedBy blankline\n  notFollowedByDivCloser\n  notFollowedBy' $ try $ skipNonindentSpaces >> noteMarker\n  optional indentSpaces\n  anyLine\n\nrawLines :: PandocMonad m => MarkdownParser m Text\nrawLines = do\n  first <- anyLine\n  rest <- many rawLine\n  return $ T.unlines (first:rest)\n\nnoteBlock :: PandocMonad m => MarkdownParser m (F Blocks)\nnoteBlock = do\n  guardEnabled Ext_footnotes\n  try $ do\n     pos <- getPosition\n     skipNonindentSpaces\n     ref <- noteMarker\n     char ':'\n     optional blankline\n     optional indentSpaces\n     updateState $ \\st -> st{ stateInNote = True }\n     first <- rawLines\n     rest <- many $ try $ blanklines >> indentSpaces >> rawLines\n     let raw = T.unlines (first:rest) <> \"\\n\"\n     optional blanklines\n     parsed <- parseFromString' parseBlocks raw\n     oldnotes <- stateNotes' <$> getState\n     case M.lookup ref oldnotes of\n       Just _  -> logMessage $ DuplicateNoteReference ref pos\n       Nothing -> return ()\n     updateState $ \\s -> s { stateNotes' =\n       M.insert ref (pos, parsed) oldnotes,\n                             stateInNote = False }\n     return mempty\n\n--\n-- parsing blocks\n--\n\nparseBlocks :: PandocMonad m => MarkdownParser m (F Blocks)\nparseBlocks = mconcat <$> manyTill block eof\n\nblock :: PandocMonad m => MarkdownParser m (F Blocks)\nblock = do\n  res <- choice [ mempty <$ blanklines\n               , codeBlockFenced\n               , yamlMetaBlock'\n               -- note: bulletList needs to be before header because of\n               -- the possibility of empty list items: -\n               , bulletList\n               , divHtml\n               , divFenced\n               , header\n               , lhsCodeBlock\n               , htmlBlock\n               , table\n               , codeBlockIndented\n               , rawTeXBlock\n               , lineBlock\n               , blockQuote\n               , hrule\n               , orderedList\n               , definitionList\n               , noteBlock\n               , referenceKey\n               , abbrevKey\n               , para\n               , plain\n               ] <?> \"block\"\n  trace (T.take 60 $ tshow $ B.toList $ runF res defaultParserState)\n  return res\n\n--\n-- header blocks\n--\n\nheader :: PandocMonad m => MarkdownParser m (F Blocks)\nheader = setextHeader <|> atxHeader <?> \"header\"\n\natxChar :: PandocMonad m => MarkdownParser m Char\natxChar = do\n  exts <- getOption readerExtensions\n  return $ if extensionEnabled Ext_literate_haskell exts\n              then '='\n              else '#'\n\natxHeader :: PandocMonad m => MarkdownParser m (F Blocks)\natxHeader = try $ do\n  level <- fmap length (atxChar >>= many1 . char)\n  notFollowedBy $ guardEnabled Ext_fancy_lists >>\n                  (char '.' <|> char ')') -- this would be a list\n  guardDisabled Ext_space_in_atx_header <|> notFollowedBy nonspaceChar\n  skipSpaces\n  (text, raw) <- withRaw $ do\n    oldAllowLineBreaks <- stateAllowLineBreaks <$> getState\n    updateState $ \\st -> st{ stateAllowLineBreaks = False }\n    res <- trimInlinesF . mconcat <$>\n               many (notFollowedBy atxClosing >> inline)\n    updateState $ \\st -> st{ stateAllowLineBreaks = oldAllowLineBreaks }\n    return res\n  attr <- atxClosing\n  attr' <- registerHeader attr (runF text defaultParserState)\n  guardDisabled Ext_implicit_header_references\n    <|> registerImplicitHeader raw attr'\n  return $ B.headerWith attr' level <$> text\n\natxClosing :: PandocMonad m => MarkdownParser m Attr\natxClosing = try $ do\n  attr' <- option nullAttr\n             (guardEnabled Ext_mmd_header_identifiers >> mmdHeaderIdentifier)\n  skipMany . char =<< atxChar\n  skipSpaces\n  attr <- option attr'\n             (guardEnabled Ext_header_attributes >> attributes)\n  blanklines\n  return attr\n\nsetextHeaderEnd :: PandocMonad m => MarkdownParser m Attr\nsetextHeaderEnd = try $ do\n  attr <- option nullAttr\n          $ (guardEnabled Ext_mmd_header_identifiers >> mmdHeaderIdentifier)\n           <|> (guardEnabled Ext_header_attributes >> attributes)\n  blanklines\n  return attr\n\nmmdHeaderIdentifier :: PandocMonad m => MarkdownParser m Attr\nmmdHeaderIdentifier = do\n  (_, raw) <- reference\n  let raw' = trim $ stripFirstAndLast raw\n  let ident = T.concat $ T.words $ T.toLower raw'\n  let attr = (ident, [], [])\n  guardDisabled Ext_implicit_header_references\n    <|> registerImplicitHeader raw' attr\n  skipSpaces\n  return attr\n\nsetextHeader :: PandocMonad m => MarkdownParser m (F Blocks)\nsetextHeader = try $ do\n  -- This lookahead prevents us from wasting time parsing Inlines\n  -- unless necessary -- it gives a significant performance boost.\n  lookAhead $ anyLine >> many1 (oneOf setextHChars) >> blankline\n  skipSpaces\n  (text, raw) <- withRaw $ do\n    oldAllowLineBreaks <- stateAllowLineBreaks <$> getState\n    updateState $ \\st -> st{ stateAllowLineBreaks = False }\n    res <- trimInlinesF . mconcat <$>\n               many (notFollowedBy setextHeaderEnd >> inline)\n    updateState $ \\st -> st{ stateAllowLineBreaks = oldAllowLineBreaks }\n    return res\n  attr <- setextHeaderEnd\n  underlineChar <- oneOf setextHChars\n  many (char underlineChar)\n  blanklines\n  let level = fromMaybe 0 (elemIndex underlineChar setextHChars) + 1\n  attr' <- registerHeader attr (runF text defaultParserState)\n  guardDisabled Ext_implicit_header_references\n    <|> registerImplicitHeader raw attr'\n  return $ B.headerWith attr' level <$> text\n\nregisterImplicitHeader :: PandocMonad m => Text -> Attr -> MarkdownParser m ()\nregisterImplicitHeader raw attr@(ident, _, _)\n  | T.null raw = return ()\n  | otherwise = do\n      let key = toKey $ \"[\" <> raw <> \"]\"\n      updateState $ \\s ->  -- don't override existing headers\n        s { stateHeaderKeys = M.insertWith (\\_new old -> old)\n                                     key ((\"#\" <> ident,\"\"), attr)\n                                     (stateHeaderKeys s) }\n\n--\n-- hrule block\n--\n\nhrule :: PandocMonad m => ParsecT Sources st m (F Blocks)\nhrule = try $ do\n  skipSpaces\n  start <- satisfy isHruleChar\n  count 2 (skipSpaces >> char start)\n  skipMany (spaceChar <|> char start)\n  newline\n  optional blanklines\n  return $ return B.horizontalRule\n\n--\n-- code blocks\n--\n\nindentedLine :: PandocMonad m => MarkdownParser m Text\nindentedLine = indentSpaces >> anyLineNewline\n\nblockDelimiter :: PandocMonad m\n               => (Char -> Bool)\n               -> Maybe Int\n               -> ParsecT Sources ParserState m Int\nblockDelimiter f len = try $ do\n  skipNonindentSpaces\n  c <- lookAhead (satisfy f)\n  case len of\n      Just l  -> count l (char c) >> many (char c) >> return l\n      Nothing -> fmap ((+ 3) . length) (count 3 (char c) >> many (char c))\n\nattributes :: PandocMonad m => MarkdownParser m Attr\nattributes = try $ do\n  char '{'\n  spnl\n  attrs <- many (attribute <* spnl)\n  char '}'\n  return $ L.foldl' (\\x f -> f x) nullAttr attrs\n\nattribute :: PandocMonad m => MarkdownParser m (Attr -> Attr)\nattribute = identifierAttr <|> classAttr <|> keyValAttr <|> specialAttr\n\nidentifier :: PandocMonad m => MarkdownParser m Text\nidentifier = do\n  first <- letter\n  rest <- many $ alphaNum <|> oneOf \"-_:.\"\n  return $ T.pack (first:rest)\n\nidentifierAttr :: PandocMonad m => MarkdownParser m (Attr -> Attr)\nidentifierAttr = try $ do\n  char '#'\n  result <- T.pack <$> many1 (alphaNum <|> oneOf \"-_:.\") -- see #7920\n  return $ \\(_,cs,kvs) -> (result,cs,kvs)\n\nclassAttr :: PandocMonad m => MarkdownParser m (Attr -> Attr)\nclassAttr = try $ do\n  char '.'\n  result <- identifier\n  return $ \\(id',cs,kvs) -> (id',cs ++ [result],kvs)\n\nkeyValAttr :: PandocMonad m => MarkdownParser m (Attr -> Attr)\nkeyValAttr = try $ do\n  key <- identifier\n  char '='\n  val <- mconcat <$> enclosed (char '\"') (char '\"') litChar\n     <|> mconcat <$> enclosed (char '\\'') (char '\\'') litChar\n     <|> (\"\" <$ try (string \"\\\"\\\"\"))\n     <|> (\"\" <$ try (string \"''\"))\n     <|> manyChar (escapedChar' <|> noneOf \" \\t\\n\\r}\")\n  return $ \\(id',cs,kvs) ->\n    case key of\n         \"id\"    -> (val,cs,kvs)\n         \"class\" -> (id',cs ++ T.words val,kvs)\n         _       -> (id',cs,kvs ++ [(key,val)])\n\nspecialAttr :: PandocMonad m => MarkdownParser m (Attr -> Attr)\nspecialAttr = do\n  char '-'\n  return $ \\(id',cs,kvs) -> (id',cs ++ [\"unnumbered\"],kvs)\n\nrawAttribute :: PandocMonad m => MarkdownParser m Text\nrawAttribute = do\n  char '{'\n  skipMany spaceChar\n  char '='\n  format <- many1Char $ satisfy (\\c -> isAlphaNum c || c `elem` ['-', '_'])\n  skipMany spaceChar\n  char '}'\n  return format\n\ncodeBlockFenced :: PandocMonad m => MarkdownParser m (F Blocks)\ncodeBlockFenced = try $ do\n  indentchars <- nonindentSpaces\n  let indentLevel = T.length indentchars\n  c <- (guardEnabled Ext_fenced_code_blocks >> lookAhead (char '~'))\n     <|> (guardEnabled Ext_backtick_code_blocks >> lookAhead (char '`'))\n  size <- blockDelimiter (== c) Nothing\n  skipMany spaceChar\n  rawattr <-\n     (Left <$> (guardEnabled Ext_raw_attribute >> try rawAttribute))\n    <|>\n     (Right <$> do\n         let pLangId = many1Char . satisfy $ \\x ->\n               x `notElem` ['`', '{', '}'] && not (isSpace x)\n         mbLanguageId <- optionMaybe (toLanguageId <$> pLangId)\n         skipMany spaceChar\n         mbAttr <- optionMaybe\n                   (guardEnabled Ext_fenced_code_attributes *> try attributes)\n         return $ case mbAttr of\n           Nothing -> (\"\", maybeToList mbLanguageId, [])\n           Just (elementId, classes, attrs) ->\n             (elementId, (maybe id (:) mbLanguageId) classes, attrs))\n  blankline\n  contents <- T.intercalate \"\\n\" <$>\n                 manyTill (gobbleAtMostSpaces indentLevel >> anyLine)\n                          (try $ do\n                            blockDelimiter (== c) (Just size)\n                            blanklines)\n  return $ return $\n    case rawattr of\n          Left syn   -> B.rawBlock syn contents\n          Right attr -> B.codeBlockWith attr contents\n\n-- correctly handle github language identifiers\ntoLanguageId :: Text -> Text\ntoLanguageId = T.toLower . go\n  where go \"c++\"         = \"cpp\"\n        go \"objective-c\" = \"objectivec\"\n        go x             = x\n\ncodeBlockIndented :: PandocMonad m => MarkdownParser m (F Blocks)\ncodeBlockIndented = do\n  contents <- many1 (indentedLine <|>\n                     try (do b <- blanklines\n                             l <- indentedLine\n                             return $ b <> l))\n  optional blanklines\n  classes <- getOption readerIndentedCodeClasses\n  return $ return $ B.codeBlockWith (\"\", classes, []) $\n           stripTrailingNewlines $ T.concat contents\n\nlhsCodeBlock :: PandocMonad m => MarkdownParser m (F Blocks)\nlhsCodeBlock = do\n  guardEnabled Ext_literate_haskell\n  (return . B.codeBlockWith (\"\",[\"haskell\",\"literate\"],[]) <$>\n          (lhsCodeBlockBird <|> lhsCodeBlockLaTeX))\n    <|> (return . B.codeBlockWith (\"\",[\"haskell\"],[]) <$>\n          lhsCodeBlockInverseBird)\n\nlhsCodeBlockLaTeX :: PandocMonad m => MarkdownParser m Text\nlhsCodeBlockLaTeX = try $ do\n  string \"\\\\begin{code}\"\n  manyTill spaceChar newline\n  contents <- many1TillChar anyChar (try $ string \"\\\\end{code}\")\n  blanklines\n  return $ stripTrailingNewlines contents\n\nlhsCodeBlockBird :: PandocMonad m => MarkdownParser m Text\nlhsCodeBlockBird = lhsCodeBlockBirdWith '>'\n\nlhsCodeBlockInverseBird :: PandocMonad m => MarkdownParser m Text\nlhsCodeBlockInverseBird = lhsCodeBlockBirdWith '<'\n\nlhsCodeBlockBirdWith :: PandocMonad m => Char -> MarkdownParser m Text\nlhsCodeBlockBirdWith c = try $ do\n  pos <- getPosition\n  when (sourceColumn pos /= 1) $ Prelude.fail \"Not in first column\"\n  lns <- many1 $ birdTrackLine c\n  -- if (as is normal) there is always a space after >, drop it\n  let lns' = if all (\\ln -> T.null ln || T.take 1 ln == \" \") lns\n                then map (T.drop 1) lns\n                else lns\n  blanklines\n  return $ T.intercalate \"\\n\" lns'\n\nbirdTrackLine :: PandocMonad m => Char -> ParsecT Sources st m Text\nbirdTrackLine c = try $ do\n  char c\n  -- allow html tags on left margin:\n  when (c == '<') $ notFollowedBy letter\n  anyLine\n\n--\n-- block quotes\n--\n\nemailBlockQuoteStart :: PandocMonad m => MarkdownParser m Char\nemailBlockQuoteStart = try $ skipNonindentSpaces >> char '>' <* optional (char ' ')\n\nemailBlockQuote :: PandocMonad m => MarkdownParser m [Text]\nemailBlockQuote = try $ do\n  emailBlockQuoteStart\n  let emailLine = manyChar $ nonEndline <|> try\n                              (endline >> notFollowedBy emailBlockQuoteStart >>\n                               return '\\n')\n  let emailSep = try (newline >> emailBlockQuoteStart)\n  first <- emailLine\n  rest <- many $ try $ emailSep >> emailLine\n  let raw = first:rest\n  newline <|> (eof >> return '\\n')\n  optional blanklines\n  return raw\n\nblockQuote :: PandocMonad m => MarkdownParser m (F Blocks)\nblockQuote = do\n  raw <- emailBlockQuote\n  (mbAlert, raw') <-\n    (do guardEnabled Ext_alerts\n        case raw of\n          (t:ts) | \"[!\" `T.isPrefixOf` t ->\n              case T.strip t of\n                \"[!TIP]\" -> pure (Just \"tip\", ts)\n                \"[!WARNING]\" -> pure (Just \"warning\", ts)\n                \"[!IMPORTANT]\" -> pure (Just \"important\", ts)\n                \"[!CAUTION]\" -> pure (Just \"caution\", ts)\n                \"[!NOTE]\" -> pure (Just \"note\", ts)\n                _ -> pure (Nothing, raw)\n          _ -> pure (Nothing, raw))\n      <|> pure (Nothing, raw)\n  -- parse the extracted block, which may contain various block elements:\n  contents <- parseFromString' parseBlocks $ T.intercalate \"\\n\" raw' <> \"\\n\\n\"\n  return $\n    case mbAlert of\n      Nothing -> B.blockQuote <$> contents\n      Just alert ->\n        (B.divWith (\"\", [alert], [])\n          . (B.divWith (\"\", [\"title\"], []) (B.para (B.str (T.toTitle alert))) <>))\n           <$> contents\n\n--\n-- list blocks\n--\n\nbulletListStart :: PandocMonad m => MarkdownParser m ()\nbulletListStart = try $ do\n  optional newline -- if preceded by a Plain block in a list context\n  skipNonindentSpaces\n  notFollowedBy' (() <$ hrule)     -- because hrules start out just like lists\n  satisfy isBulletListMarker\n  gobbleSpaces 1 <|> () <$ lookAhead newline\n  try (gobbleAtMostSpaces 3 >> notFollowedBy spaceChar) <|> return ()\n\norderedListStart :: PandocMonad m\n                 => Maybe (ListNumberStyle, ListNumberDelim)\n                 -> MarkdownParser m (Int, ListNumberStyle, ListNumberDelim)\norderedListStart mbstydelim = try $ do\n  optional newline -- if preceded by a Plain block in a list context\n  skipNonindentSpaces\n  notFollowedBy $ string \"p.\" >> spaceChar >> digit  -- page number\n  (do guardDisabled Ext_fancy_lists\n      start <- many1Char digit >>= safeRead\n      char '.'\n      gobbleSpaces 1 <|> () <$ lookAhead newline\n      optional $ try (gobbleAtMostSpaces 3 >> notFollowedBy spaceChar)\n      return (start, DefaultStyle, DefaultDelim))\n   <|>\n   (do (num, style, delim) <- maybe\n          anyOrderedListMarker\n          (\\(sty,delim) -> (\\start -> (start,sty,delim)) <$>\n               orderedListMarker sty delim)\n          mbstydelim\n       gobbleSpaces 1 <|> () <$ lookAhead newline\n       -- if it could be an abbreviated first name,\n       -- insist on more than one space\n       when (delim == Period && (style == UpperAlpha ||\n            (style == UpperRoman &&\n             num `elem` [1, 5, 10, 50, 100, 500, 1000]))) $\n              () <$ lookAhead (newline <|> spaceChar)\n       optional $ try (gobbleAtMostSpaces 3 >> notFollowedBy spaceChar)\n       return (num, style, delim))\n\nlistStart :: PandocMonad m => MarkdownParser m ()\nlistStart = bulletListStart\n        <|> Control.Monad.void (orderedListStart Nothing)\n        <|> defListStart\n\nlistLine :: PandocMonad m => Int -> MarkdownParser m Text\nlistLine continuationIndent = try $ do\n  notFollowedBy' (do gobbleSpaces continuationIndent\n                     skipMany spaceChar\n                     listStart)\n  notFollowedByHtmlCloser\n  notFollowedByDivCloser\n  optional (() <$ gobbleSpaces continuationIndent)\n  anyLine\n\n-- parse raw text for one list item, excluding start marker and continuations\nrawListItem :: PandocMonad m\n            => Bool -- four space rule\n            -> MarkdownParser m a\n            -> MarkdownParser m (Text, Int)\nrawListItem fourSpaceRule start = try $ do\n  pos1 <- getPosition\n  start\n  pos2 <- getPosition\n  let continuationIndent = if fourSpaceRule\n                              then 4\n                              else sourceColumn pos2 - sourceColumn pos1\n  first <- anyLine\n  rest <- many (do notFollowedBy listStart\n                   notFollowedBy (() <$ codeBlockFenced)\n                   notFollowedBy blankline\n                   listLine continuationIndent)\n  blanks <- manyChar blankline\n  let result = T.unlines (first:rest) <> blanks\n  return (result, continuationIndent)\n\n-- continuation of a list item - indented and separated by blankline\n-- or (in compact lists) endline.\n-- note: nested lists are parsed as continuations\nlistContinuation :: PandocMonad m => Int -> MarkdownParser m Text\nlistContinuation continuationIndent = try $ do\n  x <- try $ do\n         notFollowedBy blankline\n         notFollowedByHtmlCloser\n         notFollowedByDivCloser\n         gobbleSpaces continuationIndent\n         anyLineNewline\n  xs <- many $ try $ do\n         notFollowedBy blankline\n         notFollowedByHtmlCloser\n         notFollowedByDivCloser\n         gobbleSpaces continuationIndent <|> notFollowedBy' listStart\n         anyLineNewline\n  blanks <- manyChar blankline\n  return $ T.concat (x:xs) <> blanks\n\n-- Variant of blanklines that doesn't require blank lines\n-- before a fence or eof.\nblanklines' :: PandocMonad m => MarkdownParser m Text\nblanklines' = blanklines <|> try checkDivCloser\n  where checkDivCloser = do\n          guardEnabled Ext_fenced_divs\n          divLevel <- stateFencedDivLevel <$> getState\n          guard (divLevel >= 1)\n          lookAhead divFenceEnd\n          return \"\"\n\nnotFollowedByDivCloser :: PandocMonad m => MarkdownParser m ()\nnotFollowedByDivCloser =\n  guardDisabled Ext_fenced_divs <|>\n  do divLevel <- stateFencedDivLevel <$> getState\n     guard (divLevel < 1) <|> notFollowedBy divFenceEnd\n\nnotFollowedByHtmlCloser :: PandocMonad m => MarkdownParser m ()\nnotFollowedByHtmlCloser = do\n  inHtmlBlock <- stateInHtmlBlock <$> getState\n  case inHtmlBlock of\n        Just t  -> notFollowedBy' $ htmlTag (~== TagClose t)\n        Nothing -> return ()\n\nlistItem :: PandocMonad m\n         => Bool -- four-space rule\n         -> MarkdownParser m a\n         -> MarkdownParser m (F Blocks)\nlistItem fourSpaceRule start = try $ do\n  -- parsing with ListItemState forces markers at beginning of lines to\n  -- count as list item markers, even if not separated by blank space.\n  -- see definition of \"endline\"\n  state <- getState\n  let oldContext = stateParserContext state\n  setState $ state {stateParserContext = ListItemState}\n  (first, continuationIndent) <- rawListItem fourSpaceRule start\n  continuations <- many (listContinuation continuationIndent)\n  -- parse the extracted block, which may contain various block elements:\n  let raw = T.concat (first:continuations)\n  contents <- parseFromString' parseBlocks raw\n  updateState (\\st -> st {stateParserContext = oldContext})\n  exts <- getOption readerExtensions\n  return $ B.fromList . taskListItemFromAscii exts . B.toList <$> contents\n\norderedList :: PandocMonad m => MarkdownParser m (F Blocks)\norderedList = try $ do\n  (start, style, delim) <- lookAhead (orderedListStart Nothing)\n  unless (style `elem` [DefaultStyle, Decimal, Example] &&\n          delim `elem` [DefaultDelim, Period]) $\n    guardEnabled Ext_fancy_lists\n  when (style == Example) $ guardEnabled Ext_example_lists\n  fourSpaceRule <- (True <$ guardEnabled Ext_four_space_rule)\n               <|> return (style == Example)\n  items <- fmap sequence $ many1 $ listItem fourSpaceRule\n                 (orderedListStart (Just (style, delim)))\n  start' <- if style == Example\n               then return start\n               else (start <$ guardEnabled Ext_startnum) <|> return 1\n  return $ B.orderedListWith (start', style, delim) <$> fmap compactify items\n\nbulletList :: PandocMonad m => MarkdownParser m (F Blocks)\nbulletList = do\n  fourSpaceRule <- (True <$ guardEnabled Ext_four_space_rule)\n               <|> return False\n  items <- fmap sequence $ many1 $ listItem fourSpaceRule bulletListStart\n  return $ B.bulletList <$> fmap compactify items\n\n-- definition lists\n\ndefListStart :: PandocMonad m => MarkdownParser m ()\ndefListStart = do\n  nonindentSpaces\n  char ':' <|> char '~'\n  gobbleSpaces 1 <|> () <$ lookAhead newline\n  try (gobbleAtMostSpaces 3 >> notFollowedBy spaceChar) <|> return ()\n\ndefinitionListItem :: PandocMonad m => MarkdownParser m (F (Inlines, [Blocks]))\ndefinitionListItem = try $ do\n  rawLine' <- anyLine\n  term <- parseFromString' (trimInlinesF <$> inlines) rawLine'\n  isTight <- (False <$ blanklines) <|> pure True\n  fourSpaceRule <- (True <$ guardEnabled Ext_four_space_rule) <|> pure False\n  contents <- many1 $ listItem fourSpaceRule defListStart\n  optional blanklines\n  return $ liftM2 (,)\n              term\n              ((if isTight\n                   then fmap (fmap (fmap paraToPlain))\n                   else id) (sequence contents))\n\nparaToPlain :: Block -> Block\nparaToPlain (Para ils) = Plain ils\nparaToPlain x = x\n\ndefinitionList :: PandocMonad m => MarkdownParser m (F Blocks)\ndefinitionList = try $ do\n  guardEnabled Ext_definition_lists\n  lookAhead (anyLine >>\n             optional (blankline >> notFollowedBy (Control.Monad.void table)) >>\n             -- don't capture table caption as def list!\n             defListStart)\n  items <- fmap sequence $ many1 definitionListItem\n  return $ B.definitionList <$> items\n\n--\n-- paragraph block\n--\n\npara :: PandocMonad m => MarkdownParser m (F Blocks)\npara = try $ do\n  exts <- getOption readerExtensions\n\n  result <- trimInlinesF <$> inlines1\n  let figureOr constr inlns =\n        case B.toList inlns of\n          [Image attr figCaption (src, tit)]\n            | extensionEnabled Ext_implicit_figures exts\n            , not (null figCaption) -> do\n                implicitFigure attr (B.fromList figCaption) src tit\n\n          _ -> constr inlns\n\n  option (figureOr B.plain <$> result)\n    $ try $ do\n            newline\n            (mempty <$ blanklines)\n              <|> (guardDisabled Ext_blank_before_blockquote\n                   <* lookAhead blockQuote)\n              <|> (guardEnabled Ext_backtick_code_blocks\n                   <* lookAhead codeBlockFenced)\n              <|> (guardDisabled Ext_blank_before_header\n                   <* lookAhead header)\n              <|> (guardEnabled Ext_lists_without_preceding_blankline\n                    -- Avoid creating a paragraph in a nested list.\n                    <* notFollowedBy' (inList <* listStart))\n              <|> do guardEnabled Ext_native_divs\n                     inHtmlBlock <- stateInHtmlBlock <$> getState\n                     case inHtmlBlock of\n                       Just \"div\" -> () <$\n                         lookAhead (htmlTag (~== TagClose (\"div\" :: Text)))\n                       _          -> mzero\n              <|> do guardEnabled Ext_fenced_divs\n                     divLevel <- stateFencedDivLevel <$> getState\n                     if divLevel > 0\n                        then lookAhead divFenceEnd\n                        else mzero\n            return $ figureOr B.para <$> result\n\nplain :: PandocMonad m => MarkdownParser m (F Blocks)\nplain = fmap B.plain . trimInlinesF <$> inlines1\n\nimplicitFigure :: Attr -> Inlines -> Text -> Text -> Blocks\nimplicitFigure (ident, classes, attribs) capt url title =\n  let alt = case \"alt\" `lookup` attribs of\n              Just alt'       -> B.text alt'\n              _               -> capt\n      attribs' = filter ((/= \"latex-placement\") . fst)\n                    (filter ((/= \"alt\") . fst) attribs)\n      figattribs = case lookup \"latex-placement\" attribs of\n        Just p -> [(\"latex-placement\", p)]\n        _      -> mempty\n      figattr = (ident, mempty, figattribs)\n      caption = B.simpleCaption $ B.plain capt\n      figbody = B.plain $ B.imageWith (\"\", classes, attribs') url title alt\n  in B.figureWith figattr caption figbody\n\n--\n-- raw html\n--\n\nhtmlElement :: PandocMonad m => MarkdownParser m Text\nhtmlElement = rawVerbatimBlock\n          <|> strictHtmlBlock\n          <|> fmap snd (htmlTag isBlockTag)\n\nhtmlBlock :: PandocMonad m => MarkdownParser m (F Blocks)\nhtmlBlock = do\n  guardEnabled Ext_raw_html\n  try (do\n      (TagOpen _ attrs) <- lookAhead $ fst <$> htmlTag isBlockTag\n      return . B.rawBlock \"html\" <$> rawVerbatimBlock\n        <|> (do guardEnabled Ext_markdown_attribute\n                oldMarkdownAttribute <- stateMarkdownAttribute <$> getState\n                markdownAttribute <-\n                   case lookup \"markdown\" attrs of\n                        Just \"0\" -> False <$ updateState (\\st -> st{\n                                       stateMarkdownAttribute = False })\n                        Just _   -> True <$ updateState (\\st -> st{\n                                       stateMarkdownAttribute = True })\n                        Nothing  -> return oldMarkdownAttribute\n                res <- if markdownAttribute\n                          then rawHtmlBlocks\n                          else htmlBlock'\n                updateState $ \\st -> st{ stateMarkdownAttribute =\n                                         oldMarkdownAttribute }\n                return res)\n        <|> (guardEnabled Ext_markdown_in_html_blocks >> rawHtmlBlocks))\n    <|> htmlBlock'\n\nhtmlBlock' :: PandocMonad m => MarkdownParser m (F Blocks)\nhtmlBlock' = try $ do\n    first <- htmlElement\n    skipMany spaceChar\n    optional blanklines\n    return $ if T.null first\n                then mempty\n                else return $ B.rawBlock \"html\" first\n\nstrictHtmlBlock :: PandocMonad m => MarkdownParser m Text\nstrictHtmlBlock = htmlInBalanced (not . isInlineTag)\n\nrawVerbatimBlock :: PandocMonad m => MarkdownParser m Text\nrawVerbatimBlock = htmlInBalanced isVerbTag\n  where isVerbTag (TagOpen \"pre\" _)      = True\n        isVerbTag (TagOpen \"style\" _)    = True\n        isVerbTag (TagOpen \"script\" _)   = True\n        isVerbTag (TagOpen \"textarea\" _) = True\n        isVerbTag _                      = False\n\nrawTeXBlock :: PandocMonad m => MarkdownParser m (F Blocks)\nrawTeXBlock = do\n  guardEnabled Ext_raw_tex\n  result <- (B.rawBlock \"tex\" . trim . T.concat <$>\n                many1 ((<>) <$> rawConTeXtEnvironment <*> spnl'))\n          <|> (B.rawBlock \"tex\" . trim . T.concat <$>\n                many1 ((<>) <$> rawLaTeXBlock <*> spnl'))\n  return $ case B.toList result of\n                [RawBlock _ cs]\n                  | T.all (`elem` [' ','\\t','\\n']) cs -> return mempty\n                -- don't create a raw block for suppressed macro defs\n                _ -> return result\n\nrawHtmlBlocks :: PandocMonad m => MarkdownParser m (F Blocks)\nrawHtmlBlocks = do\n  (TagOpen tagtype _, raw) <- htmlTag isBlockTag\n  let selfClosing = \"/>\" `T.isSuffixOf` raw\n  -- we don't want '<td>    text' to be a code block:\n  skipMany spaceChar\n  tabStop <- getOption readerTabStop\n  indentlevel <- option 0 $\n                 do blankline\n                    sum <$> many ( (1 <$ char ' ')\n                                   <|>\n                                   (tabStop <$ char '\\t') )\n  -- try to find closing tag\n  -- we set stateInHtmlBlock so that closing tags that can be either block or\n  -- inline will not be parsed as inline tags\n  oldInHtmlBlock <- stateInHtmlBlock <$> getState\n  updateState $ \\st -> st{ stateInHtmlBlock = Just tagtype }\n  let closer = htmlTag (~== TagClose tagtype)\n  let block' = try $ do\n                 gobbleAtMostSpaces indentlevel\n                 notFollowedBy' closer\n                 block\n  contents <- if selfClosing\n                 then return mempty\n                 else mconcat <$> many block'\n  result <-\n    try\n    (do gobbleAtMostSpaces indentlevel\n        (_, rawcloser) <- closer\n        return (return (B.rawBlock \"html\" $ stripMarkdownAttribute raw) <>\n                contents <>\n                return (B.rawBlock \"html\" rawcloser)))\n      <|> return (return (B.rawBlock \"html\" raw) <> contents)\n  updateState $ \\st -> st{ stateInHtmlBlock = oldInHtmlBlock }\n  return result\n\n-- remove markdown=\"1\" attribute\nstripMarkdownAttribute :: Text -> Text\nstripMarkdownAttribute s = renderTags' $ map filterAttrib $ parseTags s\n  where filterAttrib (TagOpen t as) = TagOpen t\n                                        [(k,v) | (k,v) <- as, k /= \"markdown\"]\n        filterAttrib              x = x\n\n--\n-- line block\n--\n\nlineBlock :: PandocMonad m => MarkdownParser m (F Blocks)\nlineBlock = do\n  guardEnabled Ext_line_blocks\n  try $ do\n    lines' <- lineBlockLines >>=\n              mapM (parseFromString' (trimInlinesF <$> inlines))\n    return $ B.lineBlock <$> sequence lines'\n\n--\n-- Tables\n--\n\n-- Parse a dashed line with optional trailing spaces; return its length\n-- and the length including trailing space.\ndashedLine :: PandocMonad m\n           => Char\n           -> ParsecT Sources st m (Int, Int)\ndashedLine ch = do\n  dashes <- many1 (char ch)\n  sp     <- many spaceChar\n  let lengthDashes = length dashes\n      lengthSp     = length sp\n  return (lengthDashes, lengthDashes + lengthSp)\n\n-- Parse a table header with dashed lines of '-' preceded by\n-- one (or zero) line of text.\nsimpleTableHeader :: PandocMonad m\n                  => Bool  -- ^ Headerless table\n                  -> MarkdownParser m (F [[Blocks]], [Alignment], [Int])\nsimpleTableHeader headless = try $ do\n  rawContent  <- if headless\n                    then return \"\"\n                    else anyLine\n  initSp      <- nonindentSpaces\n  dashes      <- many1 (dashedLine '-')\n  newline\n  let (lengths, lines') = unzip dashes\n  let indices  = scanl (+) (T.length initSp) lines'\n  -- If no header, calculate alignment on basis of first row of text\n  rawHeads <- fmap (drop 1 . splitTextByIndices (init indices)) $\n              if headless\n                 then lookAhead anyLine\n                 else return rawContent\n  let aligns   = zipWith alignType (map (: []) rawHeads) lengths\n  let rawHeads' = if headless\n                     then []\n                     else rawHeads\n  heads <- fmap sequence\n           $\n            mapM (parseFromString' (mconcat <$> many plain).trim) rawHeads'\n  return (fmap (:[]) heads, aligns, indices)\n\n-- Returns an alignment type for a table, based on a list of strings\n-- (the rows of the column header) and a number (the length of the\n-- dashed line under the rows.\nalignType :: [Text]\n          -> Int\n          -> Alignment\nalignType [] _ = AlignDefault\nalignType strLst len =\n  let nonempties = filter (not . T.null) $ map trimr strLst\n      (leftSpace, rightSpace) =\n           case sortOn T.length nonempties of\n                 (x:_) -> (T.head x `elem` [' ', '\\t'], realLength x < len)\n                 []    -> (False, False)\n  in  case (leftSpace, rightSpace) of\n        (True,  False) -> AlignRight\n        (False, True)  -> AlignLeft\n        (True,  True)  -> AlignCenter\n        (False, False) -> AlignDefault\n\n-- Parse a table footer - dashed lines followed by blank line.\ntableFooter :: PandocMonad m => MarkdownParser m Text\ntableFooter = try $ skipNonindentSpaces >> many1 (dashedLine '-') >> blanklines'\n\n-- Parse a table separator - dashed line.\ntableSep :: PandocMonad m => MarkdownParser m Char\ntableSep = try $ skipNonindentSpaces >> many1 (dashedLine '-') >> char '\\n'\n\n-- Parse a raw line and split it into chunks by indices.\nrawTableLine :: PandocMonad m\n             => [Int]\n             -> MarkdownParser m [Text]\nrawTableLine indices = do\n  notFollowedBy' (blanklines' <|> tableFooter)\n  line <- anyLine\n  return $ map trim $ drop 1 $ splitTextByIndices (init indices) line\n\n-- Parse a table line and return a list of lists of blocks (columns).\ntableLine :: PandocMonad m\n          => [Int]\n          -> MarkdownParser m (F [Blocks])\ntableLine indices = rawTableLine indices >>=\n  fmap sequence . mapM (parseFromString' (mconcat <$> many plain))\n\n-- Parse a multiline table row and return a list of blocks (columns).\nmultilineRow :: PandocMonad m\n             => [Int]\n             -> MarkdownParser m (F [Blocks])\nmultilineRow indices = do\n  colLines <- many1 (rawTableLine indices)\n  let cols = map T.unlines $ transpose colLines\n  fmap sequence $ mapM (parseFromString' (mconcat <$> many plain)) cols\n\n-- Parses a table caption:  inlines beginning with 'Table:'\n-- and followed by blank lines.\ntableCaption :: PandocMonad m => MarkdownParser m (F Inlines, Attr)\ntableCaption = do\n  guardEnabled Ext_table_captions\n  try $ do\n    skipNonindentSpaces\n    (string \":\" <* notFollowedBy (satisfy isPunctuation)) <|>\n      (oneOf ['T','t'] >> string \"able:\")\n    let attributes' = guardEnabled Ext_table_attributes *> attributes\n    ils <- trimInlinesF . mconcat <$>\n               many (notFollowedBy (attributes' *> blanklines) *> inline)\n    attr <- option nullAttr attributes'\n    blanklines\n    pure (ils, attr)\n\n-- Parse a simple table with '---' header and one line per row.\nsimpleTable :: PandocMonad m\n            => Bool  -- ^ Headerless table\n            -> MarkdownParser m (F TableComponents)\nsimpleTable headless = do\n  tableComponents <-\n       tableWith' NormalizeHeader\n              (simpleTableHeader headless) tableLine\n              (return ())\n              (if headless then tableFooter else tableFooter <|> blanklines')\n  -- All columns in simple tables have default widths.\n  let useDefaultColumnWidths tc =\n        let cs' = map (Bifunctor.second (const ColWidthDefault)) $\n                   tableColSpecs tc\n        in tc {tableColSpecs = cs'}\n  return $ useDefaultColumnWidths <$> tableComponents\n\n-- Parse a multiline table:  starts with row of '-' on top, then header\n-- (which may be multiline), then the rows,\n-- which may be multiline, separated by blank lines, and\n-- ending with a footer (dashed line followed by blank line).\nmultilineTable :: PandocMonad m\n               => Bool -- ^ Headerless table\n               -> MarkdownParser m (F TableComponents)\nmultilineTable headless =\n  tableWith' NormalizeHeader (multilineTableHeader headless)\n             multilineRow blanklines tableFooter\n\nmultilineTableHeader :: PandocMonad m\n                     => Bool -- ^ Headerless table\n                     -> MarkdownParser m (F [[Blocks]], [Alignment], [Int])\nmultilineTableHeader headless = try $ do\n  unless headless $\n     tableSep >> notFollowedBy blankline\n  rawContent  <- if headless\n                    then return $ repeat \"\"\n                    else many1 $ notFollowedBy tableSep >> anyLine\n  initSp      <- nonindentSpaces\n  dashes      <- many1 (dashedLine '-')\n  newline\n  let (lengths, lines') = unzip dashes\n  let indices  = scanl (+) (T.length initSp) lines'\n  -- compensate for the fact that intercolumn spaces are\n  -- not included in the last index:\n  let indices' = case reverse indices of\n                      []     -> []\n                      (x:xs) -> reverse (x+1:xs)\n  rawHeadsList <- if headless\n                     then map (:[]) . drop 1 . splitTextByIndices (init indices')\n                          <$> lookAhead anyLine\n                     else return $ transpose $ map\n                           (drop 1 . splitTextByIndices (init indices'))\n                           rawContent\n  let aligns   = zipWith alignType rawHeadsList lengths\n  let rawHeads = if headless\n                    then []\n                    else map (T.unlines . map trim) rawHeadsList\n  heads <- fmap sequence $\n            mapM (parseFromString' (mconcat <$> many plain).trim) rawHeads\n  return (fmap (:[]) heads, aligns, indices')\n\n-- Parse a grid table:  starts with row of '-' on top, then header\n-- (which may be grid), then the rows,\n-- which may be grid, separated by blank lines, and\n-- ending with a footer (dashed line followed by blank line).\ngridTable :: PandocMonad m\n          => MarkdownParser m (F TableComponents)\ngridTable = gridTableWith' NormalizeHeader parseBlocks\n\npipeBreak :: PandocMonad m => MarkdownParser m ([Alignment], [Int])\npipeBreak = try $ do\n  nonindentSpaces\n  openPipe <- (True <$ char '|') <|> return False\n  first <- pipeTableHeaderPart\n  rest <- many $ sepPipe *> pipeTableHeaderPart\n  closePipe <- (True <$ char '|') <|> return False\n  -- at least one pipe needed for a one-column table:\n  guard $ not (null rest && not (openPipe || closePipe))\n  blankline\n  return $ unzip (first:rest)\n\npipeTable :: PandocMonad m => MarkdownParser m (F TableComponents)\npipeTable = try $ do\n  nonindentSpaces\n  lookAhead nonspaceChar\n  (heads,(aligns, seplengths)) <- (,) <$> pipeTableRow <*> pipeBreak\n  let cellContents = parseFromString' pipeTableCell . trim\n  let numcols = length aligns\n  let heads' = take numcols heads\n  lines' <- many pipeTableRow\n  let lines'' = map (take numcols) lines'\n  let lineWidths = map (sum . map realLength) (heads' : lines'')\n  columns <- getOption readerColumns\n  -- add numcols + 1 for the pipes themselves\n  let widths = if maximumBounded (sum seplengths : lineWidths) + (numcols + 1)\n                  > columns\n                  then map (\\len ->\n                         fromIntegral len / fromIntegral (sum seplengths))\n                         seplengths\n                  else replicate (length aligns) 0.0\n  (headCells :: F [Blocks]) <- sequence <$> mapM cellContents heads'\n  (rows :: F [[Blocks]]) <- sequence <$>\n                            mapM (fmap sequence . mapM cellContents) lines''\n  return $\n    toTableComponents' NormalizeHeader aligns widths <$> fmap (:[]) headCells <*> rows\n\nsepPipe :: PandocMonad m => MarkdownParser m ()\nsepPipe = try $ do\n  char '|' <|> char '+'\n  notFollowedBy blankline\n\n-- parse a row, returning raw cell contents\npipeTableRow :: PandocMonad m => MarkdownParser m [Text]\npipeTableRow = try $ do\n  scanForPipe\n  skipMany spaceChar\n  openPipe <- (True <$ char '|') <|> return False\n  -- split into cells\n  let chunk = void (code <|> math <|> rawHtmlInline <|>\n                    escapedChar <|> rawLaTeXInline')\n       <|> void (noneOf \"|\\n\\r\")\n  cells <- (snd <$> withRaw (many chunk)) `sepBy1` char '|'\n  closePipe <- (True <$ char '|') <|> return False\n  -- at least one pipe needed for a one-column table:\n  guard $ not (length cells == 1 && not (openPipe || closePipe))\n  blankline\n  return cells\n\npipeTableCell :: PandocMonad m => MarkdownParser m (F Blocks)\npipeTableCell =\n  (do result <- inlines1\n      return $ B.plain <$> result)\n    <|> return mempty\n\npipeTableHeaderPart :: PandocMonad m => ParsecT Sources st m (Alignment, Int)\npipeTableHeaderPart = try $ do\n  skipMany spaceChar\n  left <- optionMaybe (char ':')\n  pipe <- many1 (char '-')\n  right <- optionMaybe (char ':')\n  skipMany spaceChar\n  let len = length pipe + maybe 0 (const 1) left + maybe 0 (const 1) right\n  return\n    (case (left,right) of\n      (Nothing,Nothing) -> AlignDefault\n      (Just _,Nothing)  -> AlignLeft\n      (Nothing,Just _)  -> AlignRight\n      (Just _,Just _)   -> AlignCenter, len)\n\n-- Succeed only if current line contains a pipe.\nscanForPipe :: PandocMonad m => ParsecT Sources st m ()\nscanForPipe = do\n  Sources inps <- getInput\n  let ln = case inps of\n             [] -> \"\"\n             ((_,t):(_,t'):_) | T.null t -> t'\n             ((_,t):_) -> t\n  case T.break (\\c -> c == '\\n' || c == '|') ln of\n       (_, T.uncons -> Just ('|', _)) -> return ()\n       _                              -> mzero\n\ntable :: PandocMonad m => MarkdownParser m (F Blocks)\ntable = try $ do\n  (frontCaption, frontAttr) <- option (Nothing, nullAttr)\n                               (Bifunctor.first Just <$> tableCaption)\n  tableComponents <-\n         (guardEnabled Ext_pipe_tables >> try (scanForPipe >> pipeTable)) <|>\n         (guardEnabled Ext_multiline_tables >> try (multilineTable False)) <|>\n         (guardEnabled Ext_simple_tables >>\n                try (simpleTable True <|> simpleTable False)) <|>\n         (guardEnabled Ext_multiline_tables >>\n                try (multilineTable True)) <|>\n         (guardEnabled Ext_grid_tables >>\n                try gridTable) <?> \"table\"\n  optional blanklines\n  (caption, attr) <- case frontCaption of\n                        Nothing -> option (return mempty, nullAttr) tableCaption\n                        Just c  -> return (c, frontAttr)\n  return $ do\n    caption' <- caption\n    (TableComponents _attr _capt colspecs th tb tf) <- tableComponents\n    return $ B.tableWith attr\n                (B.simpleCaption $ B.plain caption') colspecs th tb tf\n\n--\n-- inline\n--\n\ninlines :: PandocMonad m => MarkdownParser m (F Inlines)\ninlines = mconcat <$> many inline\n\ninlines1 :: PandocMonad m => MarkdownParser m (F Inlines)\ninlines1 = mconcat <$> many1 inline\n\ninline :: PandocMonad m => MarkdownParser m (F Inlines)\ninline = do\n  c <- lookAhead anyChar\n  ((case c of\n     ' '     -> whitespace\n     '\\t'    -> whitespace\n     '\\n'    -> endline\n     '`'     -> code\n     '_'     -> strongOrEmph\n     '*'     -> strongOrEmph\n     '^'     -> inlineNote <|> superscript\n     '['     -> note <|> cite <|> bracketedSpan <|> wikilink B.linkWith <|> link\n     '!'     -> image\n     '$'     -> math\n     '~'     -> strikeout <|> subscript\n     '='     -> mark\n     '<'     -> autoLink <|> spanHtml <|> rawHtmlInline <|> ltSign\n     '\\\\'    -> math <|> escapedNewline <|> escapedChar <|> rawLaTeXInline'\n     '@'     -> cite <|> exampleRef\n     '\"'     -> smart\n     '\\''    -> smart\n     '\\8216' -> smart\n     '\\145'  -> smart\n     '\\8220' -> smart\n     '\\147'  -> smart\n     '-'     -> cite <|> smart\n     '.'     -> smart\n     '&'     -> return . B.singleton <$> charRef\n     ':'     -> emoji\n     _       -> mzero)\n   <|> bareURL\n   <|> str\n   <|> symbol) <?> \"inline\"\n\nescapedChar' :: PandocMonad m => MarkdownParser m Char\nescapedChar' = try $ do\n  char '\\\\'\n  (guardEnabled Ext_all_symbols_escapable >>\n     satisfy (\\c -> c /= '\\n' && c /= '\\r' && not (isAlphaNum c)))\n     <|> (guardEnabled Ext_angle_brackets_escapable >>\n            oneOf \"\\\\`*_{}[]()>#+-.!~\\\"<>\")\n     <|> oneOf \"\\\\`*_{}[]()>#+-.!\"\n\nescapedNewline :: PandocMonad m => MarkdownParser m (F Inlines)\nescapedNewline = do\n  guardEnabled Ext_escaped_line_breaks\n  try $ do\n    char '\\\\'\n    lookAhead (char '\\n') -- don't consume the newline (see #3730)\n    return $ return B.linebreak\n\nescapedChar :: PandocMonad m => MarkdownParser m (F Inlines)\nescapedChar = do\n  result <- escapedChar'\n  case result of\n       ' ' -> return $ return $ B.str \"\\160\" -- \"\\ \" is a nonbreaking space\n       _   -> return $ return $ B.str $ T.singleton result\n\nltSign :: PandocMonad m => MarkdownParser m (F Inlines)\nltSign = do\n  guardDisabled Ext_raw_html\n    <|> (notFollowedByHtmlCloser >> notFollowedBy' (htmlTag isBlockTag))\n  char '<'\n  return $ return $ B.str \"<\"\n\n-- Note that if the citations extension is enabled, example refs will be\n-- parsed as citations, and handled by a clause in the parser for citations,\n-- since we won't know whether we have an example ref until the\n-- whole document has been parsed.  But we need this parser\n-- here in case citations is disabled.\nexampleRef :: PandocMonad m => MarkdownParser m (F Inlines)\nexampleRef = do\n  guardEnabled Ext_example_lists\n  try $ do\n    char '@'\n    lab <- mconcat . map T.pack <$>\n                      many (many1 alphaNum <|>\n                            try (do c <- char '_' <|> char '-'\n                                    cs <- many1 alphaNum\n                                    return (c:cs)))\n    return $ do\n      st <- askF\n      return $ case M.lookup lab (stateExamples st) of\n                    Just n  -> B.str $ tshow n\n                    Nothing -> B.str $ \"@\" <> lab\n\nsymbol :: PandocMonad m => MarkdownParser m (F Inlines)\nsymbol = do\n  result <- noneOf \"<\\\\\\n\\t \"\n         <|> try (do lookAhead $ char '\\\\'\n                     notFollowedBy' (() <$ rawTeXBlock)\n                     char '\\\\')\n  return $ return $ B.str $! T.singleton result\n\n-- parses inline code, between n `s and n `s\ncode :: PandocMonad m => MarkdownParser m (F Inlines)\ncode = try $ do\n  starts <- many1 (char '`')\n  skipSpaces\n  result <- trim . T.concat\n        <$> manyTill\n              (   many1Char (noneOf \"`\\n\")\n              <|> many1Char (char '`')\n              <|> (char '\\n'\n                    >> notFollowedBy (inList >> listStart)\n                    >> notFollowedBy' blankline\n                    >> return \" \"))\n              (try $ skipSpaces\n                  >> count (length starts) (char '`')\n                  >> notFollowedBy (char '`'))\n  rawattr <-\n     (Left <$> (guardEnabled Ext_raw_attribute >> try rawAttribute))\n    <|>\n     (Right <$> option (\"\",[],[])\n         (guardEnabled Ext_inline_code_attributes >> try attributes))\n  return $ return $\n    case rawattr of\n         Left syn   -> B.rawInline syn $! result\n         Right attr -> B.codeWith attr $! result\n\nmath :: PandocMonad m => MarkdownParser m (F Inlines)\nmath =  (return . B.displayMath <$> (mathDisplay >>= applyMacros))\n     <|> (return . B.math <$> (mathInline >>= applyMacros)) <+?>\n               (guardEnabled Ext_smart *> (return <$> apostrophe)\n                <* notFollowedBy (space <|> satisfy isPunctuation))\n\n-- Parses material enclosed in *s, **s, _s, or __s.\n-- Designed to avoid backtracking.\nenclosure :: PandocMonad m\n          => Char\n          -> MarkdownParser m (F Inlines)\nenclosure c = do\n  -- we can't start an enclosure with _ if after a string and\n  -- the intraword_underscores extension is enabled:\n  guardDisabled Ext_intraword_underscores\n    <|> guard (c == '*')\n    <|> (guard =<< notAfterString)\n  cs <- many1Char (char c)\n  (return (B.str cs) <>) <$> whitespace\n    <|>\n        case T.length cs of\n             3 -> three c\n             2 -> two   c mempty\n             1 -> one   c mempty\n             _ -> return (return $ B.str cs)\n\nender :: PandocMonad m => Char -> Int -> MarkdownParser m ()\nender c n = try $ do\n  count n (char c)\n  guard (c == '*')\n    <|> guardDisabled Ext_intraword_underscores\n    <|> notFollowedBy alphaNum\n\n-- Parse inlines til you hit one c or a sequence of two cs.\n-- If one c, emit emph and then parse two.\n-- If two cs, emit strong and then parse one.\n-- Otherwise, emit ccc then the results.\nthree :: PandocMonad m => Char -> MarkdownParser m (F Inlines)\nthree c = do\n  contents <- mconcat <$> many (notFollowedBy (ender c 1) >> inline)\n  (ender c 3 >> updateLastStrPos >> return (B.strong . B.emph <$> contents))\n    <|> (ender c 2 >> updateLastStrPos >> one c (B.strong <$> contents))\n    <|> (ender c 1 >> updateLastStrPos >> two c (B.emph <$> contents))\n    <|> return (return (B.str $ T.pack [c,c,c]) <> contents)\n\n-- Parse inlines til you hit two c's, and emit strong.\n-- If you never do hit two cs, emit ** plus inlines parsed.\ntwo :: PandocMonad m => Char -> F Inlines -> MarkdownParser m (F Inlines)\ntwo c prefix' = do\n  contents <- mconcat <$> many (try $ notFollowedBy (ender c 2) >> inline)\n  (ender c 2 >> updateLastStrPos >>\n                return (B.strong <$> (prefix' <> contents)))\n    <|> return (return (B.str $ T.pack [c,c]) <> (prefix' <> contents))\n\n-- Parse inlines til you hit a c, and emit emph.\n-- If you never hit a c, emit * plus inlines parsed.\none :: PandocMonad m => Char -> F Inlines -> MarkdownParser m (F Inlines)\none c prefix' = do\n  contents <- mconcat <$> many (  (notFollowedBy (ender c 1) >> inline)\n                           <|> try (string [c,c] >>\n                                    notFollowedBy (ender c 1) >>\n                                    two c mempty) )\n  (ender c 1 >> updateLastStrPos >> return (B.emph <$> (prefix' <> contents)))\n    <|> return (return (B.str $ T.singleton c) <> (prefix' <> contents))\n\nstrongOrEmph :: PandocMonad m => MarkdownParser m (F Inlines)\nstrongOrEmph =  enclosure '*' <|> enclosure '_'\n\n-- | Parses a list of inlines between start and end delimiters.\ninlinesBetween :: PandocMonad m\n               => (Show b)\n               => MarkdownParser m a\n               -> MarkdownParser m b\n               -> MarkdownParser m (F Inlines)\ninlinesBetween start end =\n  trimInlinesF . mconcat <$> try (start >> many1Till inner end)\n    where inner      = innerSpace <|>\n                       (notFollowedBy' (() <$ whitespace) >> inline)\n          innerSpace = try $ whitespace <* notFollowedBy' end\n\nstrikeout :: PandocMonad m => MarkdownParser m (F Inlines)\nstrikeout = fmap B.strikeout <$>\n (guardEnabled Ext_strikeout >> inlinesBetween strikeStart strikeEnd)\n    where strikeStart = string \"~~\" >> lookAhead nonspaceChar\n                        >> notFollowedBy (char '~')\n          strikeEnd   = try $ string \"~~\"\n\nmark :: PandocMonad m => MarkdownParser m (F Inlines)\nmark = fmap (B.spanWith (\"\",[\"mark\"],[])) <$>\n (guardEnabled Ext_mark >> inlinesBetween markStart markEnd)\n    where markStart = string \"==\" >> lookAhead nonspaceChar\n                        >> notFollowedBy (char '=')\n          markEnd   = try $ string \"==\"\n\nsuperscript :: PandocMonad m => MarkdownParser m (F Inlines)\nsuperscript = do\n  fmap B.superscript <$> (regularSuperscript <|> mmdShortSuperscript)\n      where\n        regularSuperscript = do\n          guardEnabled Ext_superscript\n          litBetweenNoSpace '^' '^' >>= parseFromString inlines\n        mmdShortSuperscript = try $ do\n          guardEnabled Ext_short_subsuperscripts\n          char '^'\n          result <- T.pack <$> many1 alphaNum\n          return $ return $ B.str result\n\nsubscript :: PandocMonad m => MarkdownParser m (F Inlines)\nsubscript = do\n  fmap B.subscript <$> (regularSubscript <|> mmdShortSubscript)\n      where\n        regularSubscript = do\n          guardEnabled Ext_subscript\n          litBetweenNoSpace '~' '~' >>= parseFromString inlines\n        mmdShortSubscript = try $ do\n          guardEnabled Ext_short_subsuperscripts\n          char '~'\n          result <- T.pack <$> many1 alphaNum\n          return $ return $ B.str result\n\nwhitespace :: PandocMonad m => MarkdownParser m (F Inlines)\nwhitespace = spaceChar >> return <$> (lb <|> regsp) <?> \"whitespace\"\n  where lb = spaceChar >> skipMany spaceChar\n                       >> option B.space (endline >> return B.linebreak)\n        regsp = skipMany spaceChar >> return B.space\n\nnonEndline :: PandocMonad m => ParsecT Sources st m Char\nnonEndline = satisfy (/='\\n')\n\nstr :: PandocMonad m => MarkdownParser m (F Inlines)\nstr = do\n  !result <- mconcat <$> many1\n             ( T.pack <$> (many1 alphaNum)\n              <|> \".\" <$ try (char '.' <* notFollowedBy (char '.')) )\n  updateLastStrPos\n  (do guardEnabled Ext_smart\n      abbrevs <- getOption readerAbbreviations\n      if result `Set.member` abbrevs\n         then try (do ils <- whitespace\n                      notFollowedBy (() <$ cite <|> () <$ note)\n                      -- ?? lookAhead alphaNum\n                      -- replace space after with nonbreaking space\n                      -- if softbreak, move before abbrev if possible (#4635)\n                      return $ do\n                        ils' <- ils\n                        case B.toList ils' of\n                             [Space] ->\n                                 return $! (B.str result <> B.str \"\\160\")\n                             _ -> return $! (B.str result <> ils'))\n                <|> return (return $! B.str result)\n         else return (return $! B.str result))\n     <|> return (return $! B.str result)\n\n-- an endline character that can be treated as a space, not a structural break\nendline :: PandocMonad m => MarkdownParser m (F Inlines)\nendline = try $ do\n  newline\n  notFollowedBy blankline\n  getState >>= guard . stateAllowLineBreaks\n  -- parse potential list-starts differently if in a list:\n  notFollowedBy (inList >> listStart)\n  guardDisabled Ext_lists_without_preceding_blankline <|> notFollowedBy listStart\n  guardEnabled Ext_blank_before_blockquote <|> notFollowedBy emailBlockQuoteStart\n  guardEnabled Ext_blank_before_header <|> (notFollowedBy . char =<< atxChar) -- atx header\n  guardDisabled Ext_backtick_code_blocks <|>\n     notFollowedBy (() <$ (lookAhead (char '`') >> codeBlockFenced))\n  notFollowedByHtmlCloser\n  notFollowedByDivCloser\n  (eof >> return mempty)\n    <|> (guardEnabled Ext_hard_line_breaks >> return (return B.linebreak))\n    <|> (guardEnabled Ext_ignore_line_breaks >> return mempty)\n    <|> (skipMany spaceChar >> return (return B.softbreak))\n\n--\n-- links\n--\n\n-- a reference label for a link\nreference :: PandocMonad m => MarkdownParser m (F Inlines, Text)\nreference = do\n  guardDisabled Ext_footnotes <|> notFollowedBy' noteMarker\n  withRaw $ trimInlinesF <$> inBalancedBrackets inlines\n\n-- source for a link, with optional title\nsource :: PandocMonad m => MarkdownParser m (Text, Text)\nsource = do\n  char '('\n  skipSpaces\n  let parenthesizedChars = do\n        result <- charsInBalanced '(' ')' litChar\n        return $ \"(\" <> result <> \")\"\n  let linkTitle' = try $ spnl >> linkTitle\n  let urlChunk = do\n        try parenthesizedChars\n          <|> (notFollowedBy (oneOf \"\\n\\r )\") >> litChar)\n          <|> (lookAhead (oneOf \"\\n\\r\") >> notFollowedBy linkTitle' >> litChar)\n          <|> try (many1Char spaceChar <* notFollowedBy (oneOf \"\\\"')\"))\n  let sourceURL = T.unwords . T.words . T.concat <$> many urlChunk\n  src <- try (litBetween '<' '>') <|> try base64DataURI <|> sourceURL\n  tit <- option \"\" linkTitle'\n  skipSpaces\n  char ')'\n  return (escapeURI $ trimr src, tit)\n\nbase64DataURI :: PandocMonad m => ParsecT Sources s m Text\nbase64DataURI = do\n  Sources ((pos, txt):rest) <- getInput\n  let r = A.parse (fst <$> A.match pBase64DataURI) txt\n  case r of\n    A.Done remaining consumed -> do\n      let pos' = incSourceColumn pos (T.length consumed)\n      setInput $ Sources ((pos', remaining):rest)\n      return consumed\n    _ -> mzero\n\nlinkTitle :: PandocMonad m => MarkdownParser m Text\nlinkTitle = quotedTitle '\"' <|> quotedTitle '\\''\n\nwikilink :: PandocMonad m\n  => (Attr -> Text -> Text -> Inlines -> Inlines)\n  -> MarkdownParser m (F Inlines)\nwikilink constructor = do\n  let attr = (mempty, [\"wikilink\"], mempty)\n  titleAfter <-\n    (True <$ guardEnabled Ext_wikilinks_title_after_pipe) <|>\n    (False <$ guardEnabled Ext_wikilinks_title_before_pipe)\n  try $ do\n    string \"[[\" *> notFollowedBy' (char '[')\n    raw <- many1TillChar anyChar (try $ string \"]]\")\n    let (title, url) = case T.break (== '|') raw of\n          (before, \"\") -> (before, before)\n          (before, after)\n            | titleAfter -> (T.drop 1 after, before)\n            | otherwise -> (before, T.drop 1 after)\n    guard $ T.all (`notElem` ['\\n','\\r','\\f','\\t']) url\n    return . pure . constructor attr url \"\" $\n       B.text $ fromEntities title\n\nlink :: PandocMonad m => MarkdownParser m (F Inlines)\nlink = try $ do\n  st <- getState\n  guard $ stateAllowLinks st\n  setState $ st{ stateAllowLinks = False }\n  (lab,raw) <- reference\n  setState $ st{ stateAllowLinks = True }\n  regLink B.linkWith lab <|> referenceLink B.linkWith (lab,raw)\n\nbracketedSpan :: PandocMonad m => MarkdownParser m (F Inlines)\nbracketedSpan = do\n  guardEnabled Ext_bracketed_spans\n  try $ do\n    (lab,_) <- reference\n    attr <- attributes\n    return $ wrapSpan attr <$> lab\n\n-- | Given an @Attr@ value, this returns a function to wrap the contents\n-- of a span. Handles special classes (@smallcaps@, @ul@, @underline@)\n-- and uses the respective constructors to handle them.\nwrapSpan :: Attr -> Inlines -> Inlines\nwrapSpan (ident, classes, kvs) =\n  let (initConst, kvs') = case lookup \"style\" kvs of\n        Just s | isSmallCapsFontVariant s ->\n                   let kvsNoStyle =  [(k, v) | (k, v) <- kvs, k /= \"style\"]\n                   in (Just B.smallcaps, kvsNoStyle)\n        _ -> (Nothing, kvs)\n      (mConstr, remainingClasses) = foldr go (initConst, []) classes\n      wrapInConstr c = maybe c (c .)\n      go cls (accConstr, other) =\n        case cls of\n          \"smallcaps\" -> (Just $ wrapInConstr B.smallcaps accConstr, other)\n          \"ul\"        -> (Just $ wrapInConstr B.underline accConstr, other)\n          \"underline\" -> (Just $ wrapInConstr B.underline accConstr, other)\n          _           -> (accConstr, cls:other)\n  in case (ident, remainingClasses, kvs') of\n       (\"\", [], []) -> fromMaybe (B.spanWith nullAttr) mConstr\n       attr         -> wrapInConstr (B.spanWith attr) mConstr\n\nisSmallCapsFontVariant :: Text -> Bool\nisSmallCapsFontVariant s =\n  T.toLower (T.filter (`notElem` [' ', '\\t', ';']) s) ==\n  \"font-variant:small-caps\"\n\nregLink :: PandocMonad m\n        => (Attr -> Text -> Text -> Inlines -> Inlines)\n        -> F Inlines\n        -> MarkdownParser m (F Inlines)\nregLink constructor lab = try $ do\n  (!src, !tit) <- source\n  rebase <- option False (True <$ guardEnabled Ext_rebase_relative_paths)\n  pos <- getPosition\n  let !src' = if rebase then rebasePath pos src else src\n  !attr <- option nullAttr $ guardEnabled Ext_link_attributes >> attributes\n  return $ constructor attr src' tit <$> lab\n\n-- a link like [this][ref] or [this][] or [this]\nreferenceLink :: PandocMonad m\n              => (Attr -> Text -> Text -> Inlines -> Inlines)\n              -> (F Inlines, Text)\n              -> MarkdownParser m (F Inlines)\nreferenceLink constructor (lab, raw) = do\n  sp <- (True <$ lookAhead (char ' ')) <|> return False\n  (_,!raw') <- option (mempty, \"\") $\n      lookAhead (try (do guardEnabled Ext_citations\n                         guardDisabled Ext_spaced_reference_links <|> spnl\n                         normalCite\n                         return (mempty, \"\")))\n      <|>\n      try ((guardDisabled Ext_spaced_reference_links <|> spnl) >> reference)\n  when (raw' == \"\") $ guardEnabled Ext_shortcut_reference_links\n  !attr <- option nullAttr $ guardEnabled Ext_link_attributes >> attributes\n  let !labIsRef = raw' == \"\" || raw' == \"[]\"\n  let (exclam, rawsuffix) =\n        case T.uncons raw of\n          Just ('!', rest) -> (True, rest)\n          _ -> (False, raw)\n  let !key = toKey $ if labIsRef then rawsuffix else raw'\n  parsedRaw <- parseFromString' inlines raw'\n  fallback  <- parseFromString' inlines $ if exclam\n                                             then rawsuffix\n                                             else dropBrackets rawsuffix\n  implicitHeaderRefs <- option False $\n                         True <$ guardEnabled Ext_implicit_header_references\n  let makeFallback = do\n       parsedRaw' <- parsedRaw\n       fallback' <- fallback\n       return $ (if exclam\n                    then \"!\" <> fallback'\n                    else B.str \"[\" <> fallback' <> B.str \"]\") <>\n                (if sp && not (T.null raw) then B.space else mempty) <>\n                parsedRaw'\n  return $ do\n    keys <- asksF stateKeys\n    case M.lookup key keys of\n       Nothing        ->\n         if implicitHeaderRefs\n            then do\n              headerKeys <- asksF stateHeaderKeys\n              case M.lookup key headerKeys of\n                   Just ((src, tit), _) -> constructor attr src tit <$> lab\n                   Nothing              -> makeFallback\n            else makeFallback\n       Just ((src,tit), defattr) ->\n           constructor (combineAttr attr defattr) src tit <$> lab\n\ndropBrackets :: Text -> Text\ndropBrackets = dropRB . dropLB\n  where dropRB (T.unsnoc -> Just (xs,']')) = xs\n        dropRB xs                          = xs\n        dropLB (T.uncons -> Just ('[',xs)) = xs\n        dropLB xs                          = xs\n\nbareURL :: PandocMonad m => MarkdownParser m (F Inlines)\nbareURL = do\n  guardEnabled Ext_autolink_bare_uris\n  getState >>= guard . stateAllowLinks\n  try $ do\n    (cls, (orig, src)) <- ((\"uri\",) <$> uri) <|> ((\"email\",) <$> emailAddress)\n    notFollowedBy $ try $ spaces >> htmlTag (~== TagClose (\"a\" :: Text))\n    return $ return $ B.linkWith (\"\",[cls],[]) src \"\" (B.str orig)\n\nautoLink :: PandocMonad m => MarkdownParser m (F Inlines)\nautoLink = try $ do\n  getState >>= guard . stateAllowLinks\n  char '<'\n  (cls, (orig, src)) <- ((\"uri\",) <$> uri) <|> ((\"email\",) <$> emailAddress)\n  -- in rare cases, something may remain after the uri parser\n  -- is finished, because the uri parser tries to avoid parsing\n  -- final punctuation.  for example:  in `<http://hi---there>`,\n  -- the URI parser will stop before the dashes.\n  extra <- fromEntities <$> manyTillChar nonspaceChar (char '>')\n  attr  <- option (\"\", [cls], []) $ try $\n            guardEnabled Ext_link_attributes >> attributes\n  return $ return $ B.linkWith attr (src <> escapeURI extra) \"\"\n                     (B.str $ orig <> extra)\n\n-- | Rebase a relative path, by adding the (relative) directory\n-- of the containing source position.  Absolute links and URLs\n-- are untouched.\nrebasePath :: SourcePos -> Text -> Text\nrebasePath pos path = do\n  let fp = sourceName pos\n      isFragment = T.take 1 path == \"#\"\n      path' = T.unpack path\n      isAbsolutePath = Posix.isAbsolute path' || Windows.isAbsolute path'\n   in if T.null path || isFragment || isAbsolutePath || isURI path\n         then path\n         else\n           case takeDirectory fp of\n             \"\"  -> path\n             \".\" -> path\n             d   -> T.pack d <> \"/\" <> path\n\nimage :: PandocMonad m => MarkdownParser m (F Inlines)\nimage = try $ do\n  char '!'\n  wikilink B.imageWith <|>\n    do (lab,raw) <- reference\n       defaultExt <- getOption readerDefaultImageExtension\n       let constructor attr' src\n             | \"data:\" `T.isPrefixOf` src = B.imageWith attr' src  -- see #9118\n             | otherwise =\n                case takeExtension (T.unpack src) of\n                   \"\" -> B.imageWith attr' (T.pack $ addExtension (T.unpack src)\n                                                   $ T.unpack defaultExt)\n                   _  -> B.imageWith attr' src\n       regLink constructor lab <|> referenceLink constructor (lab, \"!\" <> raw)\n\nnote :: PandocMonad m => MarkdownParser m (F Inlines)\nnote = try $ do\n  guardEnabled Ext_footnotes\n  ref <- noteMarker\n  updateState $ \\st -> st{ stateNoteRefs = Set.insert ref (stateNoteRefs st)\n                         , stateNoteNumber = stateNoteNumber st + 1 }\n  noteNum <- stateNoteNumber <$> getState\n  return $ do\n    notes <- asksF stateNotes'\n    case M.lookup ref notes of\n        Nothing       -> return $ B.str $ \"[^\" <> ref <> \"]\"\n        Just (_pos, contents) -> do\n          st <- askF\n          -- process the note in a context that doesn't resolve\n          -- notes, to avoid infinite looping with notes inside\n          -- notes:\n          let contents' = runF contents st{ stateNotes' = M.empty }\n          let addCitationNoteNum c@Citation{} =\n                c{ citationNoteNum = noteNum }\n          let adjustCite (Cite cs ils) =\n                Cite (map addCitationNoteNum cs) ils\n              adjustCite x = x\n          return $ B.note $ walk adjustCite contents'\n\ninlineNote :: PandocMonad m => MarkdownParser m (F Inlines)\ninlineNote = do\n  guardEnabled Ext_inline_notes\n  try $ do\n    char '^'\n    updateState $ \\st -> st{ stateInNote = True\n                           , stateNoteNumber = stateNoteNumber st + 1 }\n    contents <- inBalancedBrackets inlines\n    notFollowedBy (char '(' <|> char '[' <|> ('{' <$ attributes))\n      -- ^[link](foo)^ is superscript\n    updateState $ \\st -> st{ stateInNote = False }\n    return $ B.note . B.para <$> contents\n\nrawLaTeXInline' :: PandocMonad m => MarkdownParser m (F Inlines)\nrawLaTeXInline' = do\n  guardEnabled Ext_raw_tex\n  notFollowedBy' rawConTeXtEnvironment\n  !s <- rawLaTeXInline\n  return $ return $ B.rawInline \"tex\" s -- \"tex\" because it might be context\n\nrawConTeXtEnvironment :: PandocMonad m => ParsecT Sources st m Text\nrawConTeXtEnvironment = try $ do\n  string \"\\\\start\"\n  completion <- inBrackets (letter <|> digit <|> spaceChar)\n               <|> many1Char letter\n  !contents <- manyTill (rawConTeXtEnvironment <|> countChar 1 anyChar)\n                       (try $ string \"\\\\stop\" >> textStr completion)\n  return $! \"\\\\start\" <> completion <> T.concat contents <> \"\\\\stop\" <> completion\n\ninBrackets :: PandocMonad m => ParsecT Sources st m Char -> ParsecT Sources st m Text\ninBrackets parser = do\n  char '['\n  contents <- manyChar parser\n  char ']'\n  return $! \"[\" <> contents <> \"]\"\n\nspanHtml :: PandocMonad m => MarkdownParser m (F Inlines)\nspanHtml = do\n  guardEnabled Ext_native_spans\n  try $ do\n    (TagOpen _ attrs, _) <- htmlTag (~== TagOpen (\"span\" :: Text) [])\n    contents <- mconcat <$> manyTill inline (htmlTag (~== TagClose (\"span\" :: Text)))\n    let ident = fromMaybe \"\" $ lookup \"id\" attrs\n    let classes = maybe [] T.words $ lookup \"class\" attrs\n    let keyvals = [(k,v) | (k,v) <- attrs, k /= \"id\" && k /= \"class\"]\n    return $ wrapSpan (ident, classes, keyvals) <$> contents\n\ndivHtml :: PandocMonad m => MarkdownParser m (F Blocks)\ndivHtml = do\n  guardEnabled Ext_native_divs\n  try $ do\n    openpos <- getPosition\n    (TagOpen _ attrs, _) <- htmlTag (~== TagOpen (\"div\" :: Text) [])\n    -- we set stateInHtmlBlock so that closing tags that can be either block\n    -- or inline will not be parsed as inline tags\n    oldInHtmlBlock <- stateInHtmlBlock <$> getState\n    updateState $ \\st -> st{ stateInHtmlBlock = Just \"div\" }\n    optional blanklines\n    contents <- mconcat <$>\n                many (notFollowedBy' (htmlTag (~== TagClose (\"div\" :: Text)))\n                      >> block)\n    void (htmlTag (~== TagClose (\"div\" :: Text))) <|>\n       (getPosition >>= report . UnclosedDiv openpos)\n    let ident = fromMaybe \"\" $ lookup \"id\" attrs\n    let classes = maybe [] T.words $ lookup \"class\" attrs\n    let keyvals = [(k,v) | (k,v) <- attrs, k /= \"id\" && k /= \"class\"]\n    updateState $ \\st -> st{ stateInHtmlBlock = oldInHtmlBlock }\n    return $ B.divWith (ident, classes, keyvals) <$> contents\n\ndivFenced :: PandocMonad m => MarkdownParser m (F Blocks)\ndivFenced = do\n  guardEnabled Ext_fenced_divs\n  try $ do\n    openpos <- getPosition\n    string \":::\"\n    skipMany (char ':')\n    skipMany spaceChar\n    attribs <- attributes <|> ((\\x -> (\"\",[x],[])) <$> many1Char nonspaceChar)\n    skipMany spaceChar\n    skipMany (char ':')\n    blankline\n    updateState $ \\st ->\n      st{ stateFencedDivLevel = stateFencedDivLevel st + 1 }\n    bs <- mconcat <$> many (notFollowedBy divFenceEnd >> block)\n    divFenceEnd <|> (getPosition >>= report . UnclosedDiv openpos)\n    updateState $ \\st ->\n      st{ stateFencedDivLevel = stateFencedDivLevel st - 1 }\n    return $ B.divWith attribs <$> bs\n\ndivFenceEnd :: PandocMonad m => MarkdownParser m ()\ndivFenceEnd = try $ do\n  string \":::\"\n  skipMany (char ':')\n  blanklines\n  return ()\n\nrawHtmlInline :: PandocMonad m => MarkdownParser m (F Inlines)\nrawHtmlInline = do\n  guardEnabled Ext_raw_html\n  inHtmlBlock <- stateInHtmlBlock <$> getState\n  let isCloseBlockTag t = case inHtmlBlock of\n                               Just t' -> t ~== TagClose t'\n                               Nothing -> False\n  mdInHtml <- option False $\n                (    guardEnabled Ext_markdown_in_html_blocks\n                 <|> guardEnabled Ext_markdown_attribute\n                ) >> return True\n  (_,result) <- htmlTag $ if mdInHtml\n                             then (\\x -> isInlineTag x &&\n                                         not (isCloseBlockTag x))\n                             else not . isTextTag\n  return $ return $ B.rawInline \"html\" result\n\n-- Emoji\n\nemoji :: PandocMonad m => MarkdownParser m (F Inlines)\nemoji = do\n  guardEnabled Ext_emoji\n  try $ do\n    char ':'\n    emojikey <- many1Char (alphaNum <|> oneOf \"_+-\")\n    char ':'\n    case emojiToInline emojikey of\n      Just i -> return (return $ B.singleton i)\n      Nothing -> mzero\n\n-- Citations\n\ncite :: PandocMonad m => MarkdownParser m (F Inlines)\ncite = do\n  guardEnabled Ext_citations\n  -- We only use stateNoteNumber for assigning citationNoteNum,\n  -- so we just assume that all citations produce notes.\n  -- citationNoteNum doesn't affect non-note styles.\n  inNote <- stateInNote <$> getState\n  unless inNote $\n    updateState $ \\st -> st{ stateNoteNumber = stateNoteNumber st + 1 }\n  textualCite\n            <|> do (cs, raw) <- withRaw normalCite\n                   return $ flip B.cite (B.text raw) <$> cs\n\ntextualCite :: PandocMonad m => MarkdownParser m (F Inlines)\ntextualCite = try $ do\n  (suppressAuthor, key) <- citeKey True\n  -- If this is a reference to an earlier example list item,\n  -- then don't parse it as a citation.  If the example list\n  -- item comes later, we'll parse it here and figure out in\n  -- the runF stage if it's a citation.  But it helps with\n  -- issue #6836 to filter out known example list references\n  -- at this stage, so that we don't increment stateNoteNumber.\n  getState >>= guard . isNothing . M.lookup key . stateExamples\n  noteNum <- stateNoteNumber <$> getState\n  let first = Citation{ citationId      = key\n                      , citationPrefix  = []\n                      , citationSuffix  = []\n                      , citationMode    = if suppressAuthor\n                                             then SuppressAuthor\n                                             else AuthorInText\n                      , citationNoteNum = noteNum\n                      , citationHash    = 0\n                      }\n  (do -- parse [braced] material after author-in-text cite\n      (cs, raw) <- withRaw $\n                        (fmap (first:) <$> try (spnl *> normalCite))\n                    <|> bareloc first\n      let (spaces',raw') = T.span isSpace raw\n          spc | T.null spaces' = mempty\n              | otherwise      = B.space\n      lab <- parseFromString' inlines $ dropBrackets raw'\n      fallback <- referenceLink B.linkWith (lab,raw')\n      -- undo any incrementing of stateNoteNumber from last step:\n      updateState $ \\st -> st{ stateNoteNumber = noteNum }\n      return $ do\n        fallback' <- fallback\n        cs' <- cs\n        return $\n          case B.toList fallback' of\n            Link{}:_ -> B.cite [first] (B.str $ \"@\" <> key) <> spc <> fallback'\n            _        -> B.cite cs' (B.text $ \"@\" <> key <> \" \" <> raw))\n    <|> -- no braced material\n        return (do st <- askF\n                   return $ case M.lookup key (stateExamples st) of\n                            Just n -> B.str $ tshow n\n                            _      -> B.cite [first] $ B.str $ \"@\" <> key)\n\nbareloc :: PandocMonad m => Citation -> MarkdownParser m (F [Citation])\nbareloc c = try $ do\n  spnl\n  char '['\n  notFollowedBy $ char '^'\n  suff <- suffix\n  rest <- option (return []) $ try $ char ';' >> spnl >> citeList\n  spnl\n  char ']'\n  notFollowedBy $ oneOf \"[({\"\n  return $ do\n    suff' <- suff\n    rest' <- rest\n    return $ c{ citationSuffix = B.toList suff' } : rest'\n\nnormalCite :: PandocMonad m => MarkdownParser m (F [Citation])\nnormalCite = try $ do\n  char '['\n  spnl\n  citations <- citeList\n  spnl\n  char ']'\n  -- not a link or a bracketed span\n  notFollowedBy (try (void source) <|>\n                  (guardEnabled Ext_bracketed_spans *> void attributes) <|>\n                  void reference)\n  return citations\n\nsuffix :: PandocMonad m => MarkdownParser m (F Inlines)\nsuffix = try $ do\n  hasSpace <- option False (notFollowedBy nonspaceChar >> return True)\n  spnl\n  ils <- many (notFollowedBy (oneOf \";]\") >> inline)\n  let rest = trimInlinesF (mconcat ils)\n  return $ if hasSpace && not (null ils)\n              then (B.space <>) <$> rest\n              else rest\n\nprefix :: PandocMonad m => MarkdownParser m (F Inlines)\nprefix = trimInlinesF . mconcat <$>\n  manyTill (notFollowedBy (char ';') >> inline) (char ']'\n   <|> lookAhead\n         (try $ do optional (try (char ';' >> spnl))\n                   citeKey True\n                   return ']'))\n\nciteList :: PandocMonad m => MarkdownParser m (F [Citation])\nciteList = fmap sequence $ sepBy1 citation (try $ char ';' >> spnl)\n\ncitation :: PandocMonad m => MarkdownParser m (F Citation)\ncitation = try $ do\n  pref <- prefix\n  (suppress_author, key) <- citeKey True\n  suff <- suffix\n  noteNum <- stateNoteNumber <$> getState\n  return $ do\n    x <- pref\n    y <- suff\n    return Citation{ citationId      = key\n                   , citationPrefix  = B.toList x\n                   , citationSuffix  = B.toList y\n                   , citationMode    = if suppress_author\n                                          then SuppressAuthor\n                                          else NormalCitation\n                   , citationNoteNum = noteNum\n                   , citationHash    = 0\n                   }\n\nsmart :: PandocMonad m => MarkdownParser m (F Inlines)\nsmart = do\n  guardEnabled Ext_smart\n  doubleQuoted <|> singleQuoted <|> (return <$> doubleCloseQuote) <|>\n    (return <$> apostrophe) <|> (return <$> dash) <|> (return <$> ellipses)\n\nsingleQuoted :: PandocMonad m => MarkdownParser m (F Inlines)\nsingleQuoted = do\n  singleQuoteStart\n  (try (withQuoteContext InSingleQuote $\n    fmap B.singleQuoted . trimInlinesF . mconcat <$>\n      many1Till inline singleQuoteEnd))\n    <|> (return (return (B.str \"\\8217\")))\n\n-- doubleQuoted will handle regular double-quoted sections, as well\n-- as dialogues with an open double-quote without a close double-quote\n-- in the same paragraph.\ndoubleQuoted :: PandocMonad m => MarkdownParser m (F Inlines)\ndoubleQuoted = do\n  doubleQuoteStart\n  (try (withQuoteContext InDoubleQuote $\n    fmap B.doubleQuoted . trimInlinesF . mconcat <$>\n      many1Till inline doubleQuoteEnd))\n    <|> (return (return (B.str \"\\8220\")))\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Mdoc/Lex.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TypeFamilies #-}\n{- |\n   Module      : Text.Pandoc.Readers.Mdoc.Lex\n   Copyright   : Copyright (C) 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Evan Silberman <evan@jklol.net>\n   Stability   : WIP\n   Portability : portable\n\nTokenizer for mdoc\n-}\nmodule Text.Pandoc.Readers.Mdoc.Lex\n  ( MdocToken(..)\n  , MdocTokens(..)\n  , DelimSide(..)\n  , lexMdoc\n  , toString\n  )\nwhere\n\nimport Control.Monad (void, guard, when)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad(..))\nimport Data.Char (isAlphaNum)\nimport Data.Maybe (isJust)\nimport qualified Data.Text as T\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Readers.Roff.Escape\nimport Text.Pandoc.Readers.Mdoc.Macros\nimport qualified Data.Sequence as Seq\n\n-- As a higher level language with a wealth of semantic macros, mdoc\n-- discourages authors from falling back to low-level roff features like font\n-- selection, custom macros, defined strings, etc. Pandoc's mdoc reader is\n-- accordingly implemented as a high-level interpreter of mdoc's semantic macros\n-- and almost no raw roff requests are supported.\n--\n-- tbl(7) and eqn(7) macros are rare but not completely unseen in mdoc manuals.\n-- they are not yet implemented. most use of tbl macros in mdoc could probably\n-- be replaced with .Bl -column\n\ndata DelimSide = Open | Middle | Close deriving (Show, Eq)\n\n-- | Tokens for Mdoc documents\ndata MdocToken = Str T.Text SourcePos -- ^ The contents of a text line\n               | Macro T.Text SourcePos  -- ^ A macro to be processed\n               | Lit T.Text SourcePos  -- ^ Literal text on a control line\n               | Blank SourcePos  -- ^ A blank line\n               | Delim DelimSide T.Text SourcePos  -- ^ A delimiter character\n               | Eol  -- ^ The end of a control line\n               deriving Show\n\ntoString :: MdocToken -> T.Text\ntoString (Str x _) = x\ntoString (Macro x _) = x\ntoString (Lit x _) = x\ntoString (Delim _ x _) = x\ntoString Blank{} = mempty\ntoString Eol = mempty\n\nnewtype MdocTokens = MdocTokens { unMdocTokens :: Seq.Seq MdocToken }\n        deriving (Show, Semigroup, Monoid)\n\nsingleTok :: MdocToken -> MdocTokens\nsingleTok t = MdocTokens (Seq.singleton t)\n\ntype Lexer m = ParsecT Sources () m\n\ninstance RoffLikeLexer MdocTokens where\n  -- This is a bit confusing. We're lexing to MdocTokens, but for escaping\n  -- purposes we just want Texts.\n  type Token MdocTokens = T.Text\n  -- We don't need a state\n  type State MdocTokens = ()\n  -- We don't support predefined string expansion\n  expandString = return ()\n  escString = return mempty\n  -- what token type the unescaped text gets wrapped in is decided by other\n  -- parts of the lexer.\n  emit = id\n  -- All escapes are resolved in the lexer and we never need to emit anything,\n  -- vs. the roff lexer which has to push the backlashes to the output while\n  -- in copy mode.\n  backslash = (mempty <* char '\\\\') <|> (mempty <* string \"\\\\E\")\n  -- We don't support macro definition and we don't output anything for \\A\n  checkDefined = const mempty\n  -- We don't support copy mode and \\E is treated as backslash\n  escE = return mempty\n  -- We don't support low-level font selection\n  escFont = escIgnore 'f' [escapeArg, countChar 1 (satisfy (/='\\n'))]\n\neofline :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s u m MdocToken\neofline = do\n  void newline <|> eof\n  return Eol\n\nlexComment :: PandocMonad m => Lexer m MdocTokens\nlexComment = do\n  try $ string \".\\\\\\\"\"\n  skipMany $ noneOf \"\\n\"\n  eofline\n  return mempty\n\nargText :: PandocMonad m => Lexer m T.Text\nargText = do\n  beg <- escape <|> regularText\n  end <- mconcat <$> many (escape <|> regularText <|> quoteChar)\n  return $ beg <> end\n\nspaceTabChar :: PandocMonad m => Lexer m T.Text\nspaceTabChar = T.singleton <$> spaceChar\n\nquotedArg :: PandocMonad m => Lexer m T.Text\nquotedArg = do\n  quoteChar\n  t <- mconcat <$> many (try innerQuote <|> escape <|> regularText <|> spaceTabChar)\n  quoteChar\n  notFollowedBy quoteChar\n  return t\n  where\n    innerQuote = do\n      string \"\\\"\\\"\"\n      return \"\\\"\"\n\nanyText :: PandocMonad m => Lexer m T.Text\nanyText = escape <|> regularText <|> quoteChar <|> spaceTabChar\n\nregularText :: PandocMonad m => Lexer m T.Text\nregularText = many1Char $ noneOf \"\\n\\r\\t \\\\\\\"\"\n\nquoteChar :: PandocMonad m => Lexer m T.Text\nquoteChar = T.singleton <$> char '\"'\n\nmdocToken :: PandocMonad m => Lexer m MdocTokens\nmdocToken = lexComment <|> lexControlLine <|> lexTextLine\n\nlexMacroName :: PandocMonad m => Lexer m T.Text\nlexMacroName = many1Char (satisfy isMacroChar)\n  where\n    isMacroChar '%' = True\n    isMacroChar x = isAlphaNum x\n\nlexMacro :: PandocMonad m => Lexer m MdocToken\nlexMacro = do\n  pos <- getPosition\n  name <- lexMacroName\n  eof <|> void (lookAhead (spaceChar <|> newline))\n  skipSpaces\n  return $ Macro name pos\n\nlexCallableMacro :: PandocMonad m => Lexer m MdocToken\nlexCallableMacro = do\n  pos <- getPosition\n  q <- optionMaybe quoteChar\n  name <- lexMacroName\n  when (isJust q) (void quoteChar)\n  eof <|> void (lookAhead (spaceChar <|> newline))\n  skipSpaces\n  guard $ isCallableMacro name\n  return $ Macro name pos\n\nlexDelim :: (PandocMonad m) => Lexer m MdocToken\nlexDelim = do\n  pos <- getPosition\n  q <- optionMaybe quoteChar\n  t <-\n    Delim Open <$> oneOfStrings [\"(\", \"[\"]\n      <|> Delim Close <$> oneOfStrings [\".\", \",\", \":\", \";\", \")\", \"]\", \"?\", \"!\"]\n      <|> Delim Middle <$> textStr \"|\"\n  when (isJust q) (void quoteChar)\n  eof <|> void (lookAhead (spaceChar <|> newline))\n  skipSpaces\n  return $ t pos\n\nlexLit :: PandocMonad m => Lexer m MdocToken\nlexLit = do\n  pos <- getPosition\n  t <- argText <|> quotedArg\n  skipSpaces\n  return $ Lit t pos\n\nlexTextLine :: PandocMonad m => Lexer m MdocTokens\nlexTextLine = do\n  pos <- getPosition\n  guard $ sourceColumn pos == 1\n  t <- mconcat <$> many anyText\n  eofline\n  if T.null $ T.strip t\n     then return $ singleTok $ Blank pos\n     else return $ singleTok $ Str t pos\n\nlexControlLine :: PandocMonad m => Lexer m MdocTokens\nlexControlLine = do\n  pos <- getPosition\n  guard $ sourceColumn pos == 1\n  char '.'\n  eofline *> mempty <|> do\n    m@(Macro name _) <- lexMacro\n    -- .Ns macros at the start of a line are ignored. We'd have to look behind\n    -- to keep track of the \"start of the line\" in the parser, so we'll drop\n    -- those macros in lexing.\n    let start | name == \"Ns\" = []\n              | otherwise = [m]\n    let parsed = isParsedMacro name\n    (wds, e) <- manyUntil (l parsed) eofline\n    return $ MdocTokens $ Seq.fromList $ start <> wds <> [e]\n      where\n        l True = try lexDelim <|> try lexCallableMacro <|> lexLit\n        l False = try lexDelim <|> lexLit\n\n-- | Tokenize a string as a sequence of mdoc tokens.\nlexMdoc :: PandocMonad m => SourcePos -> T.Text -> m MdocTokens\nlexMdoc pos txt = do\n  eithertokens <- readWithM (do setPosition pos\n                                mconcat <$> manyTill mdocToken eof) def txt\n  case eithertokens of\n    Left e       -> throwError e\n    Right tokenz -> return tokenz\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Mdoc/Macros.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Mdoc.Macros\n   Copyright   : © 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Evan Silberman <evan@jklol.net>\n   Stability   : WIP\n   Portability : portable\n\n-}\nmodule Text.Pandoc.Readers.Mdoc.Macros (isParsedMacro, isCallableMacro) where\n\nimport Data.Set (member, fromList, Set)\nimport Data.Text\n\nisParsedMacro :: Text -> Bool\nisParsedMacro a = member a parsedMacros\n\nisCallableMacro :: Text -> Bool\nisCallableMacro a = member a callableMacros\n\nparsedMacros :: Set Text\nparsedMacros = fromList [\n  \"Ac\",\n  \"Ad\",\n  \"An\",\n  \"Ao\",\n  \"Ap\",\n  \"Aq\",\n  \"Ar\",\n  \"At\",\n  \"Bc\",\n  \"Bo\",\n  \"Bq\",\n  \"Brc\",\n  \"Bro\",\n  \"Brq\",\n  \"Bsx\",\n  \"Bx\",\n  \"Cd\",\n  \"Cm\",\n  \"D1\",\n  \"Dc\",\n  \"Dl\",\n  \"Do\",\n  \"Dq\",\n  \"Dv\",\n  \"Dx\",\n  \"Ec\",\n  \"Em\",\n  \"En\",\n  \"Eo\",\n  \"Er\",\n  \"Es\",\n  \"Ev\",\n  \"Fa\",\n  \"Fc\",\n  \"Fl\",\n  \"Fn\",\n  \"Fr\",\n  \"Ft\",\n  \"Fx\",\n  \"Ic\",\n  \"In\",\n  \"It\",\n  \"Li\",\n  \"Lk\",\n  \"Ms\",\n  \"Mt\",\n  \"Nm\",\n  \"No\",\n  \"Ns\",\n  \"Nx\",\n  \"Oc\",\n  \"Oo\",\n  \"Op\",\n  \"Ot\",\n  \"Ox\",\n  \"Pa\",\n  \"Pc\",\n  \"Pf\",\n  \"Po\",\n  \"Pq\",\n  \"Qc\",\n  \"Ql\",\n  \"Qo\",\n  \"Qq\",\n  \"Sc\",\n  \"Sh\",\n  \"So\",\n  \"Sq\",\n  \"Ss\",\n  \"St\",\n  \"Sx\",\n  \"Sy\",\n  \"Ta\",\n  \"Tn\",\n  \"Ux\",\n  \"Va\",\n  \"Vt\",\n  \"Xc\",\n  \"Xo\",\n  \"Xr\"]\n\ncallableMacros :: Set Text\ncallableMacros = fromList [\n  \"Ac\",\n  \"Ad\",\n  \"An\",\n  \"Ao\",\n  \"Ap\",\n  \"Aq\",\n  \"Ar\",\n  \"At\",\n  \"Bc\",\n  \"Bo\",\n  \"Bq\",\n  \"Brc\",\n  \"Bro\",\n  \"Brq\",\n  \"Bsx\",\n  \"Bx\",\n  \"Cd\",\n  \"Cm\",\n  \"Dc\",\n  \"Do\",\n  \"Dq\",\n  \"Dv\",\n  \"Dx\",\n  \"Ec\",\n  \"Em\",\n  \"En\",\n  \"Eo\",\n  \"Er\",\n  \"Es\",\n  \"Ev\",\n  \"Fa\",\n  \"Fc\",\n  \"Fl\",\n  \"Fn\",\n  \"Fo\",\n  \"Fr\",\n  \"Ft\",\n  \"Fx\",\n  \"Ic\",\n  \"In\",\n  \"Li\",\n  \"Lk\",\n  \"Ms\",\n  \"Mt\",\n  \"Nm\",\n  \"No\",\n  \"Ns\",\n  \"Nx\",\n  \"Oc\",\n  \"Oo\",\n  \"Op\",\n  \"Ot\",\n  \"Ox\",\n  \"Pa\",\n  \"Pc\",\n  \"Pf\",\n  \"Po\",\n  \"Pq\",\n  \"Qc\",\n  \"Ql\",\n  \"Qo\",\n  \"Qq\",\n  \"Sc\",\n  \"So\",\n  \"Sq\",\n  \"St\",\n  \"Sx\",\n  \"Sy\",\n  \"Ta\",\n  \"Tn\",\n  \"Ux\",\n  \"Va\",\n  \"Vt\",\n  \"Xc\",\n  \"Xo\",\n  \"Xr\"]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Mdoc/Standards.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Mdoc.Standards\n   Copyright   : © 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Evan Silberman <evan@jklol.net>\n   Stability   : WIP\n   Portability : portable\n\n-}\nmodule Text.Pandoc.Readers.Mdoc.Standards (standard) where\n\nimport Data.Map (fromList, Map)\nimport qualified Data.Map as M\nimport Data.Text\n\nstandard :: Text -> Maybe Text\nstandard = flip M.lookup standards\n\nstandards :: Map Text Text\nstandards = fromList [\n  (\"-p1003.1-88\",    \"IEEE Std 1003.1-1988 (“POSIX.1”)\"),\n  (\"-p1003.1-90\",    \"IEEE Std 1003.1-1990 (“POSIX.1”)\"),\n  (\"-p1003.1-96\",    \"ISO/IEC 9945-1:1996 (“POSIX.1”)\"),\n  (\"-p1003.1-2001\",  \"IEEE Std 1003.1-2001 (“POSIX.1”)\"),\n  (\"-p1003.1-2004\",  \"IEEE Std 1003.1-2004 (“POSIX.1”)\"),\n  (\"-p1003.1-2008\",  \"IEEE Std 1003.1-2008 (“POSIX.1”)\"),\n  (\"-p1003.1-2024\",  \"IEEE Std 1003.1-2024 (“POSIX.1”)\"),\n  (\"-p1003.1\",       \"IEEE Std 1003.1 (“POSIX.1”)\"),\n  (\"-p1003.1b\",      \"IEEE Std 1003.1b (“POSIX.1b”)\"),\n  (\"-p1003.1b-93\",   \"IEEE Std 1003.1b-1993 (“POSIX.1b”)\"),\n  (\"-p1003.1c-95\",   \"IEEE Std 1003.1c-1995 (“POSIX.1c”)\"),\n  (\"-p1003.1g-2000\", \"IEEE Std 1003.1g-2000 (“POSIX.1g”)\"),\n  (\"-p1003.1i-95\",   \"IEEE Std 1003.1i-1995 (“POSIX.1i”)\"),\n  (\"-p1003.2\",       \"IEEE Std 1003.2 (“POSIX.2”)\"),\n  (\"-p1003.2-92\",    \"IEEE Std 1003.2-1992 (“POSIX.2”)\"),\n  (\"-p1003.2a-92\",   \"IEEE Std 1003.2a-1992 (“POSIX.2”)\"),\n  (\"-isoC\",          \"ISO/IEC 9899:1990 (“ISO C90”)\"),\n  (\"-isoC-90\",       \"ISO/IEC 9899:1990 (“ISO C90”)\"),\n  (\"-isoC-amd1\",     \"ISO/IEC 9899/AMD1:1995 (“ISO C90, Amendment 1”)\"),\n  (\"-isoC-tcor1\",    \"ISO/IEC 9899/TCOR1:1994 (“ISO C90, Technical Corrigendum 1”)\"),\n  (\"-isoC-tcor2\",    \"ISO/IEC 9899/TCOR2:1995 (“ISO C90, Technical Corrigendum 2”)\"),\n  (\"-isoC-99\",       \"ISO/IEC 9899:1999 (“ISO C99”)\"),\n  (\"-isoC-2011\",     \"ISO/IEC 9899:2011 (“ISO C11”)\"),\n  (\"-isoC-2023\",     \"ISO/IEC 9899:2024 (“ISO C23”)\"),\n  (\"-iso9945-1-90\",  \"ISO/IEC 9945-1:1990 (“POSIX.1”)\"),\n  (\"-iso9945-1-96\",  \"ISO/IEC 9945-1:1996 (“POSIX.1”)\"),\n  (\"-iso9945-2-93\",  \"ISO/IEC 9945-2:1993 (“POSIX.2”)\"),\n  (\"-ansiC\",         \"ANSI X3.159-1989 (“ANSI C89”)\"),\n  (\"-ansiC-89\",      \"ANSI X3.159-1989 (“ANSI C89”)\"),\n  (\"-ieee754\",       \"IEEE Std 754-1985\"),\n  (\"-iso8802-3\",     \"ISO 8802-3: 1989\"),\n  (\"-iso8601\",       \"ISO 8601\"),\n  (\"-ieee1275-94\",   \"IEEE Std 1275-1994 (“Open Firmware”)\"),\n  (\"-xpg3\",          \"X/Open Portability Guide Issue 3 (“XPG3”)\"),\n  (\"-xpg4\",          \"X/Open Portability Guide Issue 4 (“XPG4”)\"),\n  (\"-xpg4.2\",        \"X/Open Portability Guide Issue 4, Version 2 (“XPG4.2”)\"),\n  (\"-xbd5\",          \"X/Open Base Definitions Issue 5 (“XBD5”)\"),\n  (\"-xcu5\",          \"X/Open Commands and Utilities Issue 5 (“XCU5”)\"),\n  (\"-xsh5\",          \"X/Open System Interfaces and Headers Issue 5 (“XSH5”)\"),\n  (\"-xns5\",          \"X/Open Networking Services Issue 5 (“XNS5”)\"),\n  (\"-xns5.2\",        \"X/Open Networking Services Issue 5.2 (“XNS5.2”)\"),\n  (\"-xcurses4.2\",    \"X/Open Curses Issue 4, Version 2 (“XCURSES4.2”)\"),\n  (\"-susv1\",         \"Version 1 of the Single UNIX Specification (“SUSv1”)\"),\n  (\"-susv2\",         \"Version 2 of the Single UNIX Specification (“SUSv2”)\"),\n  (\"-susv3\",         \"Version 3 of the Single UNIX Specification (“SUSv3”)\"),\n  (\"-susv4\",         \"Version 4 of the Single UNIX Specification (“SUSv4”)\"),\n  (\"-svid4\",         \"System V Interface Definition, Fourth Edition (“SVID4”)\")\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Mdoc.hs",
    "content": "{-# LANGUAGE CPP  #-}\n{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE ViewPatterns #-}\n{- |\n   Module      : Text.Pandoc.Readers.Mdoc\n   Copyright   : © 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Evan Silberman <evan@jklol.net>\n   Stability   : WIP\n   Portability : portable\n\nConversion of mdoc to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Mdoc (readMdoc) where\n\nimport Data.Char (isAsciiLower, toUpper)\nimport Data.Default (Default)\nimport Data.Either (fromRight)\nimport Data.Functor (($>))\nimport Data.Maybe (catMaybes)\nimport Control.Monad (mplus, guard, void, when, unless)\nimport Control.Monad.Except (throwError)\n#if MIN_VERSION_base(4,19,0)\nimport Data.List (intersperse, unsnoc)\n#else\nimport Data.List (intersperse)\n#endif\nimport qualified Data.Map.Strict as M\nimport qualified Data.Text as T\nimport Text.Pandoc.Definition (Pandoc(Pandoc), Meta)\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad(..))\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (uncons)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Readers.Mdoc.Lex\nimport Text.Pandoc.Readers.Mdoc.Standards\nimport Text.Parsec (modifyState)\nimport qualified Text.Pandoc.Parsing as P\nimport qualified Data.Foldable as Foldable\nimport Text.Pandoc.Shared (stringify)\n\n#if !MIN_VERSION_base(4,19,0)\nunsnoc :: [a] -> Maybe ([a], a)\nunsnoc = foldr (\\x -> Just . maybe ([], x) (\\(~(a, b)) -> (x : a, b))) Nothing\n#endif\n\n  {- As a general principle, if mandoc -T lint issues a WARNING admonition\n     or worse about a construct, I consider it fair game for this reader to\n     do something different than what mandoc does with it, including bailing\n     out instead of recovering. -}\n\ndata MdocSection\n  = ShName\n  | ShSynopsis\n  | ShAuthors\n  | ShSeeAlso\n  | ShOther\n  deriving (Show, Eq)\n\n-- Declaration order is important: this is the order fields of a reference\n-- are printed by mandoc\ndata ReferenceField =\n  Author\n  | ArticleTitle\n  | BookTitle\n  | Publisher\n  | Journal\n  | TechReportTitle\n  | IssueNumber\n  | VolumeNumber\n  | Url\n  | Pages\n  | Institution\n  | PubLocation\n  | PubDate\n  | Optional\n  deriving (Show, Eq, Ord, Enum)\n\n-- mandoc allows specifying multiple of _any_ reference field, and just\n-- prints them all out in document order, even though authors are the only\n-- field where this is the documented behavior. There's no lint warning\n-- about this either. I'd prefer to do last-one-wins for the non-author\n-- fields, which would presumably make it easier to transform the\n-- bibliographic data into something else, but for now all I'm doing is\n-- printing the references out the same way mandoc does.\ntype MdocReference = M.Map ReferenceField [T.Text]\n\ndata MdocState = MdocState\n    { readerOptions :: ReaderOptions\n    , metadata :: Meta\n    , tableCellsPlain :: Bool\n    , spacingMode :: Bool\n    , authorNameSplit :: Bool\n    , inLineEnclosure :: Bool\n    , progName :: Maybe T.Text\n    , currentSection :: MdocSection\n    , currentReference :: MdocReference\n    , logMessages :: [LogMessage]\n    }\n    deriving (Show)\n\ninstance Default MdocState where\n    def =\n        MdocState\n            { readerOptions = def\n            , metadata = B.nullMeta\n            , tableCellsPlain = True\n            , spacingMode = True\n            , authorNameSplit = False\n            , inLineEnclosure = False\n            , currentSection = ShOther\n            , currentReference = M.empty\n            , progName = Nothing\n            , logMessages = []\n            }\n\ninstance HasLogMessages MdocState where\n  addLogMessage msg st = st{ logMessages = msg : logMessages st }\n  getLogMessages st = reverse $ logMessages st\n\ntype MdocParser m = P.ParsecT [MdocToken] MdocState m\n\n\n-- | Read mdoc from an input string and return a Pandoc document.\nreadMdoc :: (PandocMonad m, ToSources a)\n        => ReaderOptions\n        -> a\n        -> m Pandoc\nreadMdoc opts s = do\n  let Sources inps = toSources s\n  tokenz <- mconcat <$> mapM (uncurry lexMdoc) inps\n  let state = def {readerOptions = opts} :: MdocState\n  eitherdoc <- readWithMTokens parseMdoc state\n     (Foldable.toList . unMdocTokens $ tokenz)\n  either (throwError . fromParsecError (Sources inps)) return eitherdoc\n\n\nreadWithMTokens :: PandocMonad m\n        => ParsecT [MdocToken] MdocState m a  -- ^ parser\n        -> MdocState                         -- ^ initial state\n        -> [MdocToken]                       -- ^ input\n        -> m (Either ParseError a)\nreadWithMTokens parser state input =\n  runParserT parser state \"source\" input\n\n\nparseMdoc :: PandocMonad m => MdocParser m Pandoc\nparseMdoc = do\n  optional parsePrologue\n  bs <- many parseBlock <* eof\n  meta <- metadata <$> getState\n  let (Pandoc _ blocks) = B.doc $ mconcat bs\n  reportLogMessages\n  return $ Pandoc meta blocks\n\nmsatisfy :: Monad m\n         => (MdocToken -> Bool) -> P.ParsecT [MdocToken] st m MdocToken\nmsatisfy predic = P.tokenPrim show nextPos testTok\n  where\n    testTok t     = if predic t then Just t else Nothing\n    nextPos _ _ (Macro _ pos':_) = pos'\n    nextPos _ _ (Lit _ pos':_) = pos'\n    nextPos _ _ (Str _ pos':_) = pos'\n    nextPos _ _ (Delim _ _ pos':_) = pos'\n    nextPos _ _ (Blank pos':_) = pos'\n    nextPos a _ (Eol{}:x:xs) = nextPos a x xs\n    nextPos pos _ [Eol] = pos\n    nextPos pos _ [] = pos\n\nmacro :: PandocMonad m => T.Text -> MdocParser m MdocToken\nmacro name = msatisfy t where\n  t (Macro n _) = n == name\n  t _ = False\n\nanyMacro :: PandocMonad m => MdocParser m MdocToken\nanyMacro = msatisfy t where\n  t (Macro _ _) = True\n  t _ = False\n\nemptyMacro :: PandocMonad m => T.Text -> MdocParser m MdocToken\nemptyMacro n = macro n <* eol\n\ndelim :: PandocMonad m => DelimSide -> MdocParser m MdocToken\ndelim side = msatisfy t where\n  t (Delim s _ _) = side == s\n  t _ = False\n\nstr :: PandocMonad m => MdocParser m MdocToken\nstr = msatisfy t where\n  t Str{} = True\n  t _ = False\n\nlit :: PandocMonad m => MdocParser m MdocToken\nlit = msatisfy t where\n  t Lit{} = True\n  t _ = False\n\narg :: PandocMonad m => MdocParser m MdocToken\narg = msatisfy t where\n  t Lit{} = True\n  t Macro{} = True\n  t _ = False\n\nliteral :: PandocMonad m => T.Text -> MdocParser m MdocToken\nliteral n = msatisfy t where\n  t (Lit n' _) = n == n'\n  t _ = False\n\nblank :: PandocMonad m => MdocParser m MdocToken\nblank = msatisfy t where\n  t Blank{} = True\n  t _ = False\n\neol :: PandocMonad m => MdocParser m ()\neol = void $ msatisfy t where\n  t Eol{} = True\n  t _ = False\n\nnewControlContext :: MdocToken -> Bool\nnewControlContext Eol{} = True\nnewControlContext Macro{} = True\nnewControlContext Str{} = True\nnewControlContext Blank{} = True\nnewControlContext Lit{} = False\nnewControlContext Delim{} = False\n\n\ninlineContextEnd :: PandocMonad m => MdocParser m ()\ninlineContextEnd = eof <|> (void . lookAhead $ msatisfy newControlContext)\n\nsectionEnd :: PandocMonad m => MdocParser m ()\nsectionEnd = eof <|> (void . lookAhead $ macro \"Sh\")\n\nargsToInlines :: PandocMonad m => MdocParser m Inlines\nargsToInlines = do\n  ls <- manyTill arg eol\n  let strs = map (B.str . toString) ls\n  spacify strs\n\nparsePrologue :: PandocMonad m => MdocParser m ()\nparsePrologue = do\n  macro \"Dd\"\n  date <- argsToInlines\n  macro \"Dt\"\n  (Lit title _) <- lit\n  (Lit section _) <- lit\n  arch <- optionMaybe (toString <$> lit)\n  eol\n  emptyMacro \"Os\"\n  let adjust = B.setMeta \"title\" (B.str title)\n             . B.setMeta \"date\" date\n             . B.setMeta \"section\" (B.str section)\n             . maybe id (B.setMeta \"architecture\" . B.str) arch\n  modifyState $ \\s -> s{metadata = adjust $ metadata s}\n\nshToSectionMode :: T.Text -> MdocSection\nshToSectionMode \"NAME\" = ShName\nshToSectionMode \"SYNOPSIS\" = ShSynopsis\nshToSectionMode \"AUTHORS\" = ShAuthors\nshToSectionMode \"SEE ALSO\" = ShSeeAlso\nshToSectionMode _ = ShOther\n\nparseHeader :: PandocMonad m => MdocParser m Blocks\nparseHeader = do\n  (Macro m _) <- lookAhead $ macro \"Sh\" <|> macro \"Ss\"\n  txt <- lineEnclosure m id\n  let lvl = if m == \"Sh\" then 1 else 2\n  when (lvl == 1) $ modifyState $ \\s -> s{currentSection = (shToSectionMode . stringify) txt}\n  return $ B.header lvl txt\n\nparseNameSection :: PandocMonad m => MdocParser m Blocks\nparseNameSection = do\n  sec <- currentSection <$> getState\n  guard $ sec == ShName\n  nms <- mconcat . intersperse B.space <$> many nameNm\n  macro \"Nd\"\n  desc <- argsToInlines\n  return $ B.para $ nms <> B.space <> \"—\" <> B.space <> desc\n where\n   nameNm = do\n     macro \"Nm\"\n     nms <- many1 aNm\n     eol\n     return $ mconcat $ intersperse B.space nms\n   comma = msatisfy $ \\case\n     (Delim _ \",\" _) -> True\n     _ -> False\n   aNm = do\n     nm <- toString <$> lit\n     c <- option mempty (toString <$> comma)\n     modifyState $ \\s -> s{progName = mplus (progName s) (Just nm)}\n     return $ B.code nm <> B.str c\n\nparseSynopsisSection :: PandocMonad m => MdocParser m Blocks\nparseSynopsisSection = do\n  sec <- currentSection <$> getState\n  guard $ sec == ShSynopsis\n  parseSynopsis sectionEnd\n\nparseMiniSynopsis :: PandocMonad m => MdocParser m Blocks\nparseMiniSynopsis = do\n  macro \"nr\"\n  literal \"nS\"\n  literal \"1\"\n  eol\n  parseSynopsis (sectionEnd <|> end)\n  where\n    end = do\n      macro \"nr\"\n      literal \"nS\"\n      literal \"0\"\n      eol\n      return ()\n\nparseSynopsis :: PandocMonad m => MdocParser m () -> MdocParser m Blocks\nparseSynopsis end = do\n  bs <- manyTill synopsisBlock end\n  return $ mconcat bs\n  where\n    synopsisGroup p = B.lineBlock <$> many1 p <* optional (emptyMacro \"Pp\")\n    synopsisBlock = synopsisGroup parseInvocation\n                <|> synopsisGroup (parseCd <* optional eol)\n                <|> synopsisGroup (parseIn <* optional eol)\n                <|> synopsisGroup (parseFd <* optional eol)\n                <|> synopsisGroup (parseVt <* optional eol)\n                <|> try parseSignature\n                <|> parseWeirdSignature\n                <|> parseRegularBlock\n    parseInvocation = do\n      nm <- parseNm\n      optional eol\n      rest <- many synopsisInline\n      spacify (nm:rest)\n    parseSignature = do\n      ft <- parseFt <* optional eol\n      sig <- (parseFn <|> parseFo) <* optional eol\n      return $ B.lineBlock [ft, sig <> \";\"]\n    -- e.g. OpenBSD MB_CUR_MAX(3), mild abuse of notation for Ft\n    parseWeirdSignature = do\n      ft <- parseFt <* optional eol\n      rest <- many synopsisInline\n      line <- spacify (ft:rest)\n      return $ B.lineBlock [line]\n    synopsisInline = parseSmToggle <|> parseStrs <|> (controlLine >>= spacify) <?> \"synopsis inlines\"\n    safeEol = do\n      amNested <- inLineEnclosure <$> getState\n      unless amNested $ optional eol\n    controlLine = many1 ((choice otherInlineMacros <|> litsAndDelimsToInlines) <* safeEol)\n\nparseSeeAlsoSection :: PandocMonad m => MdocParser m Blocks\nparseSeeAlsoSection = do\n  sec <- currentSection <$> getState\n  guard $ sec == ShSeeAlso\n  blocks <- many1Till parseSeeAlsoBlock sectionEnd\n  return $ mconcat blocks\n  where\n    parseSeeAlsoBlock = parseRegularBlock <|> (B.para <$> parseRs)\n\n-- roff(7) says \"In text lines, whitespace is preserved within a line.\" I\n-- considered following this rule but it really cuts against the grain of what\n-- Pandoc writers want to work with, for no clear benefit. This isn't wholly\n-- inconsistent with mandoc, because it makes no effort to render multiple\n-- consecutive spaces from the source document in HTML. Hence I call B.text\n-- instead of B.str\nparseStr :: PandocMonad m => MdocParser m Inlines\nparseStr = do\n  (Str txt _) <- str\n  return $ B.text txt\n\n-- It's unclear whether consecutive text lines ought to be affected by the\n-- spacing mode. mdoc(7) claims that:\n--\n-- > By default, spacing is on. When switched off, no white space is\n-- > inserted between macro arguments and between the output generated from\n-- > adjacent macros, but text lines still get normal spacing between words\n-- > **and sentences.**\n--\n-- (emphasis added)\n-- This implied to me that while spacing is off, consecutive text lines\n-- would have spacing between them as normal. In fact, in mandoc's\n-- implementation, they do not:\n--\n--     text\n--     .Sm off\n--     text.\n--     text\n--     .Sm on\n--     text\n--\n-- renders as\n--\n--     text text.text text\n--\n-- (The \".\" is in there since the allusion in the documentation to\n-- sentences made me wonder if that made a difference; it doesn't.)\n--\n-- I've chosen to adopt my interpretation of the documented behavior, rather\n-- than mandoc's implementation. Multiple consecutive strs within a block get\n-- spaces between them and then packed up together, and text lines are not\n-- affected by the spacing mode.\n--\n-- Reported at https://inbox.vuxu.org/mandoc-discuss/369KFE6SHMXSE.3PS4387AYEFB5@silby.fyi/T/\nparseStrs :: PandocMonad m => MdocParser m Inlines\nparseStrs = do\n  txt <- many1 parseStr\n  return $ mconcat $ intersperse B.space txt\n\nparseDelim :: PandocMonad m => DelimSide -> MdocParser m Inlines\nparseDelim pos = do\n  (Delim _ txt _) <- delim pos\n  return $ B.str txt\n\nlitsToText :: PandocMonad m => MdocParser m [T.Text]\nlitsToText = do\n  ls <- many1 lit\n  return $ map toString ls\n\nlitsToInlines :: PandocMonad m => MdocParser m Inlines\nlitsToInlines = do\n  ls <- many1 lit\n  let strs = map (B.str . toString) ls\n  spacify strs\n\nlitsAndDelimsToInlines :: PandocMonad m => MdocParser m Inlines\nlitsAndDelimsToInlines = do\n  (o, ls, c) <- delimitedArgs $ many lit\n  guard $ not (null o && null ls && null c)\n  strs <- spacify $ map (B.str . toString) ls\n  return $ o <> strs <> c\n\nopeningDelimiters :: PandocMonad m => MdocParser m Inlines\nopeningDelimiters = do\n    openDelim <- mconcat <$> many (parseDelim Open)\n    omids <- pipes\n    addSpace <- spacingMode <$> getState\n    let omid | null omids = mempty\n             | addSpace = omids <> B.space\n             | otherwise = omids\n    return $ openDelim <> omid\n\npipes :: PandocMonad m => MdocParser m Inlines\npipes = many (parseDelim Middle) >>= spacify\n\nclosingDelimiters :: PandocMonad m => MdocParser m Inlines\nclosingDelimiters = do\n    cmids <- pipes\n    addSpace <- spacingMode <$> getState\n    let cmid | null cmids = mempty\n             | addSpace = B.space <> cmids\n             | otherwise = cmids\n    closeDelim <- mconcat <$> many (parseDelim Close)\n    return $ cmid <> closeDelim\n\ndelimitedArgs :: PandocMonad m => MdocParser m x -> MdocParser m (Inlines, x, Inlines)\ndelimitedArgs p = do\n    openDelim <- openingDelimiters\n    inlines <- p\n    closeDelim <- closingDelimiters\n    return (openDelim, inlines, closeDelim)\n\nsimpleInline :: PandocMonad m => T.Text -> (Inlines -> Inlines) -> MdocParser m Inlines\nsimpleInline nm xform = do\n  macro nm\n  segs <- manyTill segment inlineContextEnd\n  spacify segs\n where\n   segment = do\n      (openDelim, inlines, closeDelim) <- delimitedArgs $ option mempty litsToInlines\n      return $ openDelim <> xform inlines <> closeDelim\n\ncodeLikeInline' :: PandocMonad m => T.Text -> T.Text -> MdocParser m Inlines\ncodeLikeInline' nm cl = simpleInline nm (eliminateEmpty (B.codeWith (cls cl) . stringify))\n\ncodeLikeInline :: PandocMonad m => T.Text -> MdocParser m Inlines\ncodeLikeInline nm = codeLikeInline' nm nm\n\nspanLikeInline :: PandocMonad m => T.Text -> MdocParser m Inlines\nspanLikeInline nm = simpleInline nm (eliminateEmpty (B.spanWith (cls nm)))\n\n-- One-line enclosures need a little bit of state so that we don't parse\n-- the closing delimiters that follow nested one-line or multiline\n-- enclosures; the closing delimiters are meant to go after the close of\n-- the outermost enclosure. Hence we respect and set inLineEnclosure.\nlineEnclosure :: PandocMonad m => T.Text -> (Inlines -> Inlines) -> MdocParser m Inlines\nlineEnclosure nm xform = do\n  macro nm\n  amNested <- inLineEnclosure <$> getState\n  modifyState $ \\s -> s{inLineEnclosure = True}\n  first <- openingDelimiters\n  further <-\n    (manyTill\n      (parseInlineMacro\n        <|> (try (litsAndDelimsToInlines <* notFollowedBy eol))\n        <|> litsToInlines\n        <|> openingDelimiters)\n      lineEnclosureContextEnd)\n  further' <- spacify further\n  finally <- if amNested then mempty else closingDelimiters <* optional eol\n  modifyState $ \\s -> s{inLineEnclosure = amNested}\n  return $ first <> xform further' <> finally\n  where\n    lineEnclosureContextEnd =\n      try $\n        void (lookAhead (macro \"Ta\"))\n        <|> lookAhead (many (macro \"Ns\" <|> delim Close) *> eol)\n\n\n-- The Ns, Ap, and Sm macros affect the automatic insertion of spaces between\n-- macro arguments that occurs by default. We parse these macros to RawInlines\n-- that we then eliminate in foldNoSpaces. If any of these macros end up\n-- in the final AST returned by readMdoc, it's a bug.\n\nnoSpace :: Inlines\nnoSpace = B.rawInline \"mdoc\" \"Ns\"\n\napMacro :: Inlines\napMacro = B.rawInline \"mdoc\" \"Ap\"\n\nsmOff :: Inlines\nsmOff = B.rawInline \"mdoc\" \"Sm off\"\n\nsmOn :: Inlines\nsmOn = B.rawInline \"mdoc\" \"Sm on\"\n\n-- Accumulator for eliminating of Ns, Ap, and Sm macros from a list of 'Inlines'\ndata SpacifyState = SpacifyState\n  { accum :: [Inlines],  -- already-folded 'Inlines'\n    prev :: Inlines,  -- content we might be appending further content to\n    ns :: Bool,  -- True when we've read an Ns and are waiting to concatenate content to prev\n    sm :: Bool  -- True when spacing mode is on\n  }\n\ninstance Default SpacifyState where\n  def = SpacifyState [] mempty False True\n\n-- Given a list of 'Inlines'es, concatenate consecutive elements that shouldn't\n-- have a 'Space' inserted between them based on changes to the spacing mode,\n-- Ap macros, and Ns macros.\nfoldNoSpaces :: [Inlines] -> [Inlines]\nfoldNoSpaces xs = (finalize . foldl go def) xs\n  where\n    go :: SpacifyState -> Inlines -> SpacifyState\n    go s x\n      | ns s && x == noSpace = s\n      |         x == apMacro = s{prev = prev s <> \"'\", ns = True}\n      |         x == noSpace = s{ns = True}\n      |         x == smOn    = s{sm = True}\n      | sm s && x == smOff   = s{accum = accum s <> [prev s], prev = mempty, sm = False}\n      | ns s                 = s{prev = prev s <> x, ns = False}\n      | not (sm s)           = s{prev = prev s <> x}\n      | null (prev s)        = s{prev = x}\n      | otherwise            = s{accum = accum s <> [prev s], prev = x}\n    finalize s\n      | null (prev s) = accum s\n      | otherwise     = accum s <> [prev s]\n\n-- Add any necessary spaces between individual 'Inlines' in a list.\n-- Respects the spacing mode status. This should more or less\n-- always get applied to any list of 'Inlines' before doing anything\n-- else with it.\nspacify :: PandocMonad m => [Inlines] -> MdocParser m Inlines\nspacify x = do\n  mode <- spacingMode <$> getState\n  return (go mode x)\n  where\n    go True = mconcat . intersperse B.space . foldNoSpaces\n    go False = mconcat . foldNoSpaces\n\n-- Compatibility note: mandoc permits, and doesn't warn on, \"vertical\" macros\n-- (Pp, Bl/El, Bd/Ed) inside of \"horizontal\" block partial-explicit quotations\n-- like Do/Dc. However there are no OpenBSD manual pages that employ such markup\n-- and it doesn't look right when rendered. We don't attempt to consume anything\n-- but pandoc inlines inside of these multiline enclosures.\nmultilineEnclosure :: PandocMonad m => T.Text -> T.Text -> (Inlines -> Inlines) -> MdocParser m Inlines\nmultilineEnclosure op cl xform = do\n  macro op\n  amNested <- inLineEnclosure <$> getState\n  -- we're now \"protected\" from any outer enclosure or .It\n  modifyState $ \\s -> s{inLineEnclosure = False}\n  openDelim <- mconcat <$> many (parseDelim Open)\n  optional eol\n  contents <- parseInlines\n  (macro cl <?> show cl)\n  closeDelim <-\n    if amNested\n       then mempty\n       else mconcat <$> many (parseDelim Close) <* optional eol\n  modifyState $ \\s -> s{inLineEnclosure = amNested}\n  return $ openDelim <> xform contents <> closeDelim\n\nparseEo :: PandocMonad m => MdocParser m Inlines\nparseEo = do\n  macro \"Eo\"\n  odel <- del\n  optional eol\n  inner <- parseInlines\n  macro \"Ec\"\n  cdel <- del\n  optional eol\n  return $ odel <> inner <> cdel\n  where\n    del = B.str . toString <$> (arg <|> delim Open <|> delim Middle <|> delim Close)\n\neliminateEmpty :: (Inlines -> Inlines) -> Inlines -> Inlines\neliminateEmpty x y = if null y then mempty else x y\n\ncls :: T.Text -> B.Attr\ncls x = (mempty, [x], mempty)\n\n-- mandoc -T html formats Sy with a <b> tag, since it's not really\n-- semantically <strong>, but Strong is our best option in Pandoc\nparseSy :: PandocMonad m => MdocParser m Inlines\nparseSy = simpleInline \"Sy\" (eliminateEmpty B.strong)\n\nparseEm :: PandocMonad m => MdocParser m Inlines\nparseEm = simpleInline \"Em\" (eliminateEmpty B.emph)\n\nparseNo :: PandocMonad m => MdocParser m Inlines\nparseNo = simpleInline \"No\" (eliminateEmpty id)\n\n-- Deprecated, mandoc doesn't style this at all\nparseTn :: PandocMonad m => MdocParser m Inlines\nparseTn = simpleInline \"Tn\" (eliminateEmpty id)\n\nparseLi :: PandocMonad m => MdocParser m Inlines\nparseLi = codeLikeInline \"Li\"\n\nparseEv :: PandocMonad m => MdocParser m Inlines\nparseEv = codeLikeInline \"Ev\"\n\nparseDv :: PandocMonad m => MdocParser m Inlines\nparseDv = codeLikeInline \"Dv\"\n\nparseAd :: PandocMonad m => MdocParser m Inlines\nparseAd = spanLikeInline \"Ad\"\n\nparseVa :: PandocMonad m => MdocParser m Inlines\nparseVa = codeLikeInline' \"Va\" \"variable\"\n\nparseVt :: PandocMonad m => MdocParser m Inlines\nparseVt = codeLikeInline' \"Vt\" \"variable\"\n\nparseAn :: PandocMonad m => MdocParser m Inlines\nparseAn = try anSplit <|> anRegular\n  where\n    anSplit = do\n      macro \"An\"\n      mode <- literal \"-split\" $> True <|> literal \"-nosplit\" $> False\n      modifyState $ \\s -> s{authorNameSplit = mode}\n      return mempty\n    anRegular = do\n      an <- spanLikeInline \"An\"\n      spl <- authorNameSplit <$> getState\n      return $ (if spl then B.linebreak else mempty) <> an\n\nparseMs :: PandocMonad m => MdocParser m Inlines\nparseMs = spanLikeInline \"Ms\"\n\n-- TODO implement internal reference links\nparseSx :: PandocMonad m => MdocParser m Inlines\nparseSx = spanLikeInline \"Sx\"\n\n-- I'm not sure why mandoc inserts a ~ when Mt is missing an argument,\n-- but it does, and it doesn't issue a warning, so that quirk is\n-- retained.\nparseMt :: PandocMonad m => MdocParser m Inlines\nparseMt = simpleInline \"Mt\" mailto\n  where mailto x | null x = B.link (\"mailto:~\") \"\" \"~\"\n                 | otherwise = B.link (\"mailto:\" <> stringify x) \"\" x\n\nparsePa :: PandocMonad m => MdocParser m Inlines\nparsePa = simpleInline \"Pa\" p\n  where p x | null x = B.spanWith (cls \"Pa\") \"~\"\n            | otherwise = B.spanWith (cls \"Pa\") x\n\n-- There's a number of unique-looking cases for Fl parsing so I am just\n-- handling them very explicitly instead of trying to generalize anything\n-- enough to handle it. Could conceivably be better.\nparseFl :: PandocMonad m => MdocParser m Inlines\nparseFl = do\n  macro \"Fl\"\n  start <- option mempty (emptyWithDelim <|> flfl <|> emptyWithMacro <|> emptyEmpty)\n  segs <- manyTill segment inlineContextEnd\n  spacify ([start] <> segs)\n where\n   emptyWithDelim = do\n     lookAhead $ many1 (delim Middle <|> delim Close)\n     ds <- closingDelimiters\n     return $ fl \"-\" <> ds\n   flfl = do\n     lookAhead (macro \"Fl\")\n     x:xs <- B.toList <$> parseFl\n     let xx = B.codeWith (cls \"Fl\") $ \"-\" <> stringify x\n     return $ xx <> B.fromList xs\n   emptyWithMacro = do\n     lookAhead anyMacro\n     rest <- parseInline\n     return $ fl \"-\" <> rest\n   emptyEmpty = lookAhead eol $> fl \"-\"\n   segment = do\n      (openDelim, inlines, closeDelim) <- delimitedArgs $ option mempty litsToText\n      inner <- (spacify . (map fl) . flags) inlines\n      return $ openDelim <> inner <> closeDelim\n   fl = B.codeWith (cls \"Fl\")\n   flags [] = [\"-\"]\n   flags xs = map (\"-\" <>) xs\n\nparseAr :: PandocMonad m => MdocParser m Inlines\nparseAr = simpleInline \"Ar\" ar\n  where ar x | null x = B.codeWith (cls \"variable\") \"file ...\"\n             | otherwise = B.codeWith (cls \"variable\") $ stringify x\n\n\nparseCm :: PandocMonad m => MdocParser m Inlines\nparseCm = codeLikeInline \"Cm\"\n\nparseIc :: PandocMonad m => MdocParser m Inlines\nparseIc = codeLikeInline \"Ic\"\n\nparseEr :: PandocMonad m => MdocParser m Inlines\nparseEr = codeLikeInline \"Er\"\n\nparseCd :: PandocMonad m => MdocParser m Inlines\nparseCd = codeLikeInline \"Cd\"\n\nparseQl :: PandocMonad m => MdocParser m Inlines\nparseQl = lineEnclosure \"Ql\" $ B.codeWith (cls \"Ql\") . stringify\n\nparseDq :: PandocMonad m => MdocParser m Inlines\nparseDq = lineEnclosure \"Dq\" B.doubleQuoted\n\nparseDo :: PandocMonad m => MdocParser m Inlines\nparseDo = multilineEnclosure \"Do\" \"Dc\" B.doubleQuoted\n\nparseSq :: PandocMonad m => MdocParser m Inlines\nparseSq = lineEnclosure \"Sq\" B.singleQuoted\n\nparseSo :: PandocMonad m => MdocParser m Inlines\nparseSo = multilineEnclosure \"So\" \"Sc\" B.singleQuoted\n\nparseQq :: PandocMonad m => MdocParser m Inlines\nparseQq = lineEnclosure \"Qq\" $ \\x -> \"\\\"\" <> x <> \"\\\"\"\n\nparseQo :: PandocMonad m => MdocParser m Inlines\nparseQo = multilineEnclosure \"Qo\" \"Qc\" $ \\x -> \"\\\"\" <> x <> \"\\\"\"\n\nparsePq :: PandocMonad m => MdocParser m Inlines\nparsePq = lineEnclosure \"Pq\" $ \\x -> \"(\" <> x <> \")\"\n\nparsePo :: PandocMonad m => MdocParser m Inlines\nparsePo = multilineEnclosure \"Po\" \"Pc\" $ \\x -> \"(\" <> x <> \")\"\n\nparseBq :: PandocMonad m => MdocParser m Inlines\nparseBq = lineEnclosure \"Bq\" $ \\x -> \"[\" <> x <> \"]\"\n\nparseBo :: PandocMonad m => MdocParser m Inlines\nparseBo = multilineEnclosure \"Bo\" \"Bc\" $ \\x -> \"[\" <> x <> \"]\"\n\n-- For our purposes this probably behaves identically to Bq\n-- in most circumstances but I might need to do something\n-- special with it in SYNOPSIS\nparseOp :: PandocMonad m => MdocParser m Inlines\nparseOp = lineEnclosure \"Op\" $ \\x -> \"[\" <> x <> \"]\"\n\nparseOo :: PandocMonad m => MdocParser m Inlines\nparseOo =  multilineEnclosure \"Oo\" \"Oc\" $ \\x -> \"[\" <> x <> \"]\"\n\nparseBrq :: PandocMonad m => MdocParser m Inlines\nparseBrq = lineEnclosure \"Brq\" $ \\x -> \"{\" <> x <> \"}\"\n\nparseBro :: PandocMonad m => MdocParser m Inlines\nparseBro = multilineEnclosure \"Bro\" \"Brc\" $ \\x -> \"{\" <> x <> \"}\"\n\nparseAq :: PandocMonad m => MdocParser m Inlines\nparseAq = lineEnclosure \"Aq\" $ \\x -> \"⟨\" <> x <> \"⟩\"\n\nparseAo :: PandocMonad m => MdocParser m Inlines\nparseAo = multilineEnclosure \"Ao\" \"Ac\" $ \\x -> \"⟨\" <> x <> \"⟩\"\n\nparseDl :: PandocMonad m => MdocParser m Blocks\nparseDl = do\n  inner <- lineEnclosure \"Dl\" id\n  return $ B.codeBlock (stringify inner)\n\nparseD1 :: PandocMonad m => MdocParser m Blocks\nparseD1 = do\n  inner <- lineEnclosure \"D1\" id\n  return $ B.divWith (cls \"display\") $ B.plain inner\n\nparseNm :: PandocMonad m => MdocParser m Inlines\nparseNm = do\n  macro \"Nm\"\n  mnm <- (progName <$> getState)\n  (op, rg, cl) <- delimitedArgs $ option mempty litsToInlines\n  return $ case (mnm, rg) of\n    (Just nm, x) | null x ->\n      op <> ok nm <> cl\n    (_, x) ->\n      op <> (ok . stringify) x <> cl\n  where\n    ok = B.codeWith (cls \"Nm\")\n\n\nparseXr :: PandocMonad m => MdocParser m Inlines\nparseXr = do\n  macro \"Xr\"\n  (open, (name, section), close) <- delimitedArgs f\n  let ref = name <> \"(\" <> section <> \")\"\n  return $ open <> B.spanWith (cls \"Xr\") (B.str ref) <> close\n    where\n      f = do\n        n <- lit <?> \"Xr manual name\"\n        s <- lit <?> \"Xr manual section\"\n        return (toString n, toString s)\n\nparseIn :: PandocMonad m => MdocParser m Inlines\nparseIn = do\n  macro \"In\"\n  openClose <- closingDelimiters\n  openOpen <- openingDelimiters\n  header <- toString <$> lit\n  close <- closingDelimiters\n  return $ open openClose openOpen <> B.codeWith (cls \"In\") (\"<\" <> header <> \">\") <> close\n  where\n    open a b\n      | null a = b\n      | null b = a\n      | otherwise = a <> B.space <> b\n\nparseFd :: PandocMonad m => MdocParser m Inlines\nparseFd = codeLikeInline \"Fd\"\n\nparseFt :: PandocMonad m => MdocParser m Inlines\nparseFt = codeLikeInline' \"Ft\" \"variable\"\n\n-- The output here is comparable to mandoc's HTML output, which doesn't tag\n-- the commas/parentheses. Is this questionable from a pandoc POV?\nformatFunction :: T.Text -> [Inlines] -> Inlines\nformatFunction nm args = B.codeWith (cls \"Fn\") nm <> \"(\" <> args' <> \")\"\n  where\n    args' = mconcat $ intersperse (\", \") args\n\nparseFn :: PandocMonad m => MdocParser m Inlines\nparseFn = do\n  macro \"Fn\"\n  (op, (nm, args), cl) <- delimitedArgs f\n  return $ op <> formatFunction nm (fmap (B.codeWith (cls \"variable\")) args) <> cl\n  where\n    f = do\n      nm <- toString <$> lit\n      args <- option [] litsToText\n      return (nm, args)\n\nparseFa :: PandocMonad m => MdocParser m Inlines\nparseFa = codeLikeInline' \"Fa\" \"variable\"\n\nparseFo :: PandocMonad m => MdocParser m Inlines\nparseFo = do\n  macro \"Fo\"\n  nm <- toString <$> lit\n  eol\n  args <- many (parseFa <* eol)\n  macro \"Fc\"\n  return $ formatFunction nm args\n\nparseLk :: PandocMonad m => MdocParser m Inlines\nparseLk = do\n  macro \"Lk\"\n  openClose <- closingDelimiters\n  openOpen <- openingDelimiters\n  url <- toString <$> lit\n  inner <- many segment >>= spacify\n  close <- closingDelimiters\n  let label | null inner = B.str url\n            | otherwise = inner\n  return $ open openClose openOpen <> B.link url \"\" label <> close\n  where\n    open a b\n      | null a = b\n      | null b = a\n      | otherwise = a <> B.space <> b\n    end = msatisfy newControlContext\n    segment = do\n      a <- openingDelimiters\n      m <- option mempty litsToInlines\n      z <-\n        try (closingDelimiters <* notFollowedBy end)\n          <|> option mempty pipes\n      guard $ not $ all null [a, m, z]\n      return $ a <> m <> z\n\n-- This is a raw roff request but it appears sometimes in mdoc\n-- manuals and is easy enough to handle\nparsebr :: PandocMonad m => MdocParser m Inlines\nparsebr = emptyMacro \"br\" >> return B.linebreak\n\nparseNs :: PandocMonad m => MdocParser m Inlines\nparseNs = macro \"Ns\" >> return noSpace\n\n-- Per mdoc(7), Pf prefix macro [argument ...] is equivalent to\n-- No \\&prefix Ns macro [argument ...] and because of the way\n-- spacify works, the easiest thing to do is just push an Ns onto\n-- the input\nparsePf :: PandocMonad m => MdocParser m Inlines\nparsePf = do\n  macro \"Pf\"\n  t <- toString <$> anyToken\n  rest <- getInput\n  pos <- getPosition\n  setInput $ (Macro \"Ns\" pos):rest\n  return $ B.str t\n\nparseAp :: PandocMonad m => MdocParser m Inlines\nparseAp = macro \"Ap\" >> return apMacro\n\nparseEx :: PandocMonad m => MdocParser m Inlines\nparseEx = do\n  macro \"Ex\"\n  literal \"-std\"\n  args <- fmap toString <$> many lit\n  pn <- progName <$> getState\n  eol\n  return $ \"The\"\n          <> B.space\n          <> utils pn args\n          <> B.space\n          <> \"0 on success, and >0 if an error occurs.\"\n  where\n    nm = B.codeWith (cls \"Nm\")\n    sing = \"utility exits\"\n    plur = \"utilities exit\"\n    utils (Just x) [] = nm x <> B.space <> sing\n    utils _ [x] = nm x <> B.space <> sing\n    utils _ [x,y] = nm x <> B.space <> \"and\" <> B.space <> nm y <> B.space <> plur\n    utils pn xs =\n      case (pn, unsnoc xs) of\n        (Nothing, Nothing) -> sing\n        (_, Just (hd, end)) -> mconcat ((intersperse (\", \") . fmap nm) hd) <> \", and \" <> nm end <> B.space <> plur\n        (Just p, Nothing) -> nm p <> B.space <> sing\n\n\nparseRv :: (PandocMonad m) => MdocParser m Inlines\nparseRv = do\n  macro \"Rv\"\n  literal \"-std\"\n  args <- fmap toString <$> many lit\n  pn <- progName <$> getState\n  eol\n  return $ go pn args\n  where\n    nm a = B.codeWith (cls \"Fn\") a <> \"()\"\n    nothing = \"Upon successful completion, the value 0 is returned;\"\n    sing = \"function returns\"\n    plur = \"functions return\"\n    success = \"the value 0 if successful;\"\n    errno =\n      \"otherwise the value -1 is returned and the global variable\"\n        <> B.codeWith (cls \"variable\") \"errno\"\n        <> \"is set to indicate the error.\"\n    message conj =\n      \"The\"\n        <> B.space\n        <> conj\n        <> B.space\n        <> success\n        <> B.space\n        <> errno\n    go (Just x) [] = message (nm x <> B.space <> sing)\n    go _ [x] = message (nm x <> B.space <> sing)\n    go _ [x, y] = message (nm x <> B.space <> \"and\" <> B.space <> nm y <> B.space <> plur)\n    go pn xs =\n      case (pn, unsnoc xs) of\n        (Nothing, Nothing) -> nothing <> B.space <> errno\n        (_, Just (hd, end)) -> message (mconcat ((intersperse (\", \") . fmap nm) hd) <> \", and \" <> nm end <> B.space <> plur)\n        (Just p, Nothing) -> message (nm p <> B.space <> sing)\n\nparseSt :: PandocMonad m => MdocParser m Inlines\nparseSt = do\n  macro \"St\"\n  (Lit std pos) <- lit\n  case standard std of\n    Nothing -> do\n      logMessage $ SkippedContent (\"unrecognized argument to St: \" <> std) pos\n      return mempty\n    Just t -> return $ B.text t\n\n-- TODO incorporate well-known library description and linker options\n-- from mandoc lib.in expected in FreeBSD LIBRARY section, at minimum.\nparseLb :: PandocMonad m => MdocParser m Inlines\nparseLb = do\n  macro \"Lb\"\n  library <- toString <$> lit\n  return $ \"library\" <> B.space <> B.doubleQuoted (B.str library)\n\nunixVersion :: PandocMonad m => T.Text -> T.Text -> MdocParser m Inlines\nunixVersion m s = do\n  macro m\n  (o, v, c) <- delimitedArgs (option mempty (toString <$> lit))\n  return $ o <> B.str s <> f v <> c\n  where\n    f v | T.null v = mempty\n        | otherwise = B.space <> B.str v\n\nparseAt :: PandocMonad m => MdocParser m Inlines\nparseAt = do\n  macro \"At\"\n  (o, v, c) <-  delimitedArgs (optionMaybe (toString <$> lit))\n  let v' = maybe \"AT&T UNIX\" attVer v\n  return $ o <> B.text v' <> c\n  where\n    isVersion x = x `elem` [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"]\n    isRelease x = x `elem` [\"1\", \"2\", \"3\", \"4\"]\n    attVer (T.stripPrefix \"v\" -> Just ver)\n      | isVersion ver = \"Version \" <> ver <> \" AT&T UNIX\"\n    attVer \"32v\" = \"Version 7 AT&T UNIX/32V\"\n    attVer \"III\" = \"AT&T System III UNIX\"\n    attVer (T.stripPrefix \"V.\" -> Just release)\n      | isRelease release = \"AT&T System V Release \" <> release <> \" UNIX\"\n    attVer \"V\" = \"AT&T System V UNIX\"\n    attVer x = \"AT&T UNIX \" <> x\n\nparseBsx :: PandocMonad m => MdocParser m Inlines\nparseBsx = unixVersion \"Bsx\" \"BSD/OS\"\n\nparseBx :: PandocMonad m => MdocParser m Inlines\nparseBx = do\n  macro \"Bx\"\n  (o, v, c) <- delimitedArgs zeroToTwoLits\n  return $ o <> bsd v <> c\n  where\n    zeroToTwoLits = do\n      toks <- try (count 2 lit) <|> count 1 lit <|> count 0 lit\n      return $ toString <$> toks\n    bsd [] = B.str \"BSD\"\n    bsd [x] = B.str $ x <> \"BSD\"\n    bsd (x:y:_) = B.str (x <> \"BSD\" <> \"-\" <> T.toTitle y)\n\nparseDx :: PandocMonad m => MdocParser m Inlines\nparseDx = unixVersion \"Dx\" \"DragonFly\"\n\nparseFx :: PandocMonad m => MdocParser m Inlines\nparseFx = unixVersion \"Fx\" \"FreeBSD\"\n\n-- This dance to capitalize a letter at the end of a NetBSD\n-- version matches what mandoc does to the argument of .Nx.\n-- See mandoc mdoc_validate.c r1.350\n-- Curiously, there's little easy-to-find evidence of what\n-- these lettered releases actually are, other than\n-- references in man page history sections to 0.9A etc.\nparseNx :: PandocMonad m => MdocParser m Inlines\nparseNx = do\n  macro \"Nx\"\n  (o, v, c) <-  delimitedArgs (option mempty (toString <$> lit))\n  return $ o <> \"NetBSD\" <> f v <> c\n  where\n    f v | T.null v = mempty\n        | otherwise = B.space <> B.str (fromRight v $ readWith earlyNetBSDVersion () v)\n    earlyNetBSDVersion = do\n      major <- oneOf \"01\"\n      dot <- char '.'\n      minor <- digit\n      ltr <- satisfy isAsciiLower\n      return $ T.pack [major, dot, minor, toUpper ltr]\n\nparseOx :: PandocMonad m => MdocParser m Inlines\nparseOx = unixVersion \"Ox\" \"OpenBSD\"\n\nparseUx :: PandocMonad m => MdocParser m Inlines\nparseUx = macro \"Ux\" >> return (B.str \"UNIX\")\n\nparseInlineMacro :: PandocMonad m => MdocParser m Inlines\nparseInlineMacro = choice (synopsisTopicMacros <> otherInlineMacros) <?> \"inline macro\"\n\n-- These macros always start a new line in SYNOPSIS\nsynopsisTopicMacros :: PandocMonad m => [MdocParser m Inlines]\nsynopsisTopicMacros =\n    [parseNm, parseCd, parseFd, parseFn, parseFo, parseIn, parseVt, parseFt]\n\notherInlineMacros :: PandocMonad m => [MdocParser m Inlines]\notherInlineMacros =\n    [ parseSy,\n      parseEm,\n      parseLk,\n      parseLi,\n      parseEv,\n      parseDv,\n      parseMt,\n      parsePa,\n      parseFl,\n      parseCm,\n      parseIc,\n      parseEr,\n      parseAd,\n      parseVa,\n      parseAn,\n      parseMs,\n      parseSx,\n      parseAr,\n      parseFa,\n      parseNo,\n      parseTn,\n      parseXr,\n      parseQl,\n      parseOp,\n      parseSq,\n      parseDq,\n      parseQq,\n      parsePq,\n      parseBq,\n      parseBrq,\n      parseAq,\n      parseEo,\n      parseSo,\n      parseDo,\n      parseQo,\n      parsePo,\n      parseBo,\n      parseBro,\n      parseAo,\n      parseOo,\n      parseBf,\n      parseRsInline,\n      parseEx,\n      parseRv,\n      parseSt,\n      parseLb,\n      parseAt,\n      parseBsx,\n      parseBx,\n      parseDx,\n      parseFx,\n      parseNx,\n      parseOx,\n      parseUx,\n      parsebr,\n      parseAp,\n      parsePf,\n      parseNs,\n      skipUnsupportedInlines\n    ]\n\nparseInline :: PandocMonad m => MdocParser m Inlines\nparseInline = parseStrs <|> (controlLine >>= spacify) <?> \"text lines or inline macros\"\n  where\n    safeEol = do\n      amNested <- inLineEnclosure <$> getState\n      unless amNested $ optional eol\n    controlLine = many1 ((parseInlineMacro <|> litsAndDelimsToInlines) <* safeEol)\n\nparseInlines :: PandocMonad m => MdocParser m Inlines\nparseInlines = many1 (parseSmToggle <|> parseInline) >>= spacify\n\n-- Lp is a deprecated synonym for Pp\nparsePara :: PandocMonad m => MdocParser m Blocks\nparsePara = B.para . B.trimInlines <$> parseInlines <*\n    optional (emptyMacro \"Pp\" <|> emptyMacro \"Lp\")\n\n-- Indented display blocks are visually similar to block quotes\n-- but rarely carry those semantics. I'm just putting things in\n-- divs. Centered is discouraged and rarely seen.\nparseDisplay :: PandocMonad m => MdocParser m Blocks\nparseDisplay = do\n  literal \"-filled\" <|> literal \"-ragged\" <|> literal \"-centered\"\n  many $ (literal \"-offset\" *> lit) <|> (literal \"-compact\")\n  eol\n  B.divWith (cls \"display\") . mconcat <$> many parseRegularBlock\n\n-- This is something of a best-effort interpretation of the -unfilled\n-- display block type. The main difference with mandoc is probably\n-- that newlines inside of multiline enclosures won't be preserved.\nparseUnfilled :: PandocMonad m => MdocParser m Blocks\nparseUnfilled = do\n  literal \"-unfilled\"\n  many $ (literal \"-offset\" *> lit) <|> (literal \"-compact\")\n  eol\n  lns <- many $ Just <$> parseStrPreserveSpace\n            <|> Nothing <$ parseSmToggle\n            <|> Just <$> parseInline\n            <|> Just \"\" <$ emptyMacro \"Pp\"\n  return $ B.lineBlock (catMaybes lns)\n  where\n    parseStrPreserveSpace = (B.str . toString) <$> str <|> (blank *> mempty)\n\nparseCodeBlock :: PandocMonad m => MdocParser m Blocks\nparseCodeBlock = do\n  literal \"-literal\"\n  many $ (literal \"-offset\" *> lit) <|> (literal \"-compact\")\n  eol\n  lns <- many $ Just . toString <$> (str <|> blank)\n            <|> Nothing <$ parseSmToggle\n            <|> Just . stringify <$> parseInline\n            <|> Just \"\" <$ emptyMacro \"Pp\"\n  return $ B.codeBlock (T.unlines (catMaybes lns))\n\nparseBd :: PandocMonad m => MdocParser m Blocks\nparseBd = do\n  macro \"Bd\"\n  blk <- parseCodeBlock <|> parseDisplay <|> parseUnfilled\n  emptyMacro \"Ed\"\n  return blk\n\n-- This is a bit of a best effort version. Hypothetically multiple blocks\n-- could occur inside a Bf and this should be a stateful thing but I don't\n-- know if that's observed in the wild.\nparseBf :: PandocMonad m => MdocParser m Inlines\nparseBf = do\n  macro \"Bf\"\n  xform <-   B.strong <$ (literal \"Sy\" <|> literal \"-symbolic\")\n         <|> B.emph   <$ (literal \"Em\" <|> literal \"-emphasis\")\n         <|> code     <$ (literal \"Li\" <|> literal \"-literal\")\n  eol\n  ins <- parseInlines\n  emptyMacro \"Ef\"\n  return $ xform ins\n  where\n    code = B.code . stringify\n\nskipListArgument :: (PandocMonad m) => MdocParser m ()\nskipListArgument =\n  void $ choice\n    [ literal \"-width\" *> lit,\n      literal \"-offset\" *> lit,\n      literal \"-compact\"\n    ]\n\nparseItemList :: PandocMonad m => MdocParser m Blocks\nparseItemList = do\n  f <- (choice (map literal [\"-bullet\", \"-dash\", \"-hyphen\", \"-item\"]) $> B.bulletList)\n       <|> literal \"-enum\" $> B.orderedList\n  many skipListArgument\n  eol\n  items <- many bulletItem\n  return $ f items\n  where\n    bulletItem = do\n      emptyMacro \"It\"\n      mconcat <$> many parseRegularBlock\n\n-- Despite some ambiguous documentation to the contrary the Xo/Xc macros\n-- only seem genuinely useful in an .It head, and it's not clear what if\n-- anything it means to use them somewhere else in a contemporary mdoc manual.\n-- See https://inbox.vuxu.org/mandoc-discuss/2UKLZW0DL8BSM.2IIO9W4HSUSRR@silby.fyi/T/\n-- for more blathering.\nparseDefinitionList :: PandocMonad m => MdocParser m Blocks\nparseDefinitionList = do\n  headParser <- (choice . map literal) [\"-hang\", \"-inset\", \"-ohang\", \"-tag\"] $> parsedHead <|> literal \"-diag\" $> diagHead\n  many skipListArgument\n  eol\n  items <- many (parseSmToggle *> mempty <|> dlItem headParser)\n  return $ B.definitionList items\n  where\n    parsedHead = try xoListHead <|> eolListHead\n    eolListHead = do\n      modifyState $ \\s -> s{inLineEnclosure = True}\n      inner <- parseInlines\n      eol\n      modifyState $ \\s -> s{inLineEnclosure = False}\n      return inner\n    diagHead = argsToInlines\n    dlItem hed = do\n      -- Some manuals have an evidently useless .Pp before .It\n      -- e.g. OpenBSD ld(1), just deal with it.\n      many ((void . emptyMacro) \"Pp\" <|> skipUnsupportedMacro \"Tg\")\n      macro \"It\"\n      dt <- hed\n      dd <- mconcat <$> many parseRegularBlock\n      return (dt, [dd])\n    xoListHead = do\n      before <- option mempty parseInline\n      macro \"Xo\"\n      optional eol\n      after <- many1Till parseInlines (emptyMacro \"Xc\")\n      spacify (before:after)\n\n-- TODO support implicit rows:\n--   If the first line of the body of a -column list is not an It macro line,\n--   It contexts spanning one input line each are implied until an It macro\n--   line is encountered\n-- and support literal tabs\nparseColumnList :: PandocMonad m => MdocParser m Blocks\nparseColumnList = do\n  literal \"-column\"\n  many skipListArgument\n  many $ arg <|> delim Open <|> delim Middle <|> delim Close\n  eol\n  rows <- many listRow\n  return $ B.simpleTable [] rows\n  where\n    listRow = do\n      optional (emptyMacro \"Pp\")\n      macro \"It\"\n      fmap B.plain <$> sepBy (parseInlines <|> pure mempty) (macro \"Ta\" <* optional eol)\n\nparseBl :: PandocMonad m => MdocParser m Blocks\nparseBl = do\n  macro \"Bl\"\n  blk <- parseItemList <|> parseDefinitionList <|> parseColumnList\n  emptyMacro \"El\"\n  return blk\n\nreferenceField :: PandocMonad m => T.Text -> ReferenceField -> MdocParser m ()\nreferenceField m field = do\n  macro m\n  reference <- currentReference <$> getState\n  contents <- stringify <$> litsAndDelimsToInlines\n  eol\n  modifyState $ \\s -> s{currentReference = M.insertWith (++) field [contents] reference}\n  return ()\n\nparsePercentA :: PandocMonad m => MdocParser m ()\nparsePercentA = referenceField \"%A\" Author\n\nparsePercentB :: PandocMonad m => MdocParser m ()\nparsePercentB = referenceField \"%B\" BookTitle\n\nparsePercentC :: PandocMonad m => MdocParser m ()\nparsePercentC = referenceField \"%C\" PubLocation\n\nparsePercentD :: PandocMonad m => MdocParser m ()\nparsePercentD = referenceField \"%D\" PubDate\n\nparsePercentI :: PandocMonad m => MdocParser m ()\nparsePercentI = referenceField \"%I\" Publisher\n\nparsePercentJ :: PandocMonad m => MdocParser m ()\nparsePercentJ = referenceField \"%J\" Journal\n\nparsePercentN :: PandocMonad m => MdocParser m ()\nparsePercentN = referenceField \"%N\" IssueNumber\n\nparsePercentO :: PandocMonad m => MdocParser m ()\nparsePercentO = referenceField \"%O\" Optional\n\nparsePercentP :: PandocMonad m => MdocParser m ()\nparsePercentP = referenceField \"%P\" Pages\n\nparsePercentQ :: PandocMonad m => MdocParser m ()\nparsePercentQ = referenceField \"%Q\" Institution\n\nparsePercentR :: PandocMonad m => MdocParser m ()\nparsePercentR = referenceField \"%R\" TechReportTitle\n\nparsePercentT :: PandocMonad m => MdocParser m ()\nparsePercentT = referenceField \"%T\" ArticleTitle\n\nparsePercentU :: PandocMonad m => MdocParser m ()\nparsePercentU = referenceField \"%U\" Url\n\nparsePercentV :: PandocMonad m => MdocParser m ()\nparsePercentV = referenceField \"%V\" VolumeNumber\n\nparseReferenceField :: PandocMonad m => MdocParser m ()\nparseReferenceField =\n  choice [\n      parsePercentA,\n      parsePercentB,\n      parsePercentC,\n      parsePercentD,\n      parsePercentI,\n      parsePercentJ,\n      parsePercentN,\n      parsePercentO,\n      parsePercentP,\n      parsePercentQ,\n      parsePercentR,\n      parsePercentT,\n      parsePercentU,\n      parsePercentV\n    ]\n\nparseRsInline :: PandocMonad m => MdocParser m Inlines\nparseRsInline = do\n  sec <- currentSection <$> getState\n  guard $ sec /= ShSeeAlso\n  parseRs\n\nparseRs :: PandocMonad m => MdocParser m Inlines\nparseRs = do\n  emptyMacro \"Rs\"\n  modifyState $ \\s -> s{currentReference = M.empty}\n  many1 parseReferenceField\n  emptyMacro \"Re\"\n  ref <- currentReference <$> getState\n  -- TODO formatting fields correctly\n  return $ B.text $ (M.foldl f mempty ref) <> \".\"\n  where join v = T.concat (intersperse \", \" v)\n        f a v | T.null a = join v\n              | otherwise = a <> \", \" <> join v\n\n-- mandoc's roff(7) says \"Blank text lines, which may include whitespace,\n-- are only permitted within literal contexts.\" mandoc -T lint warns about\n-- blank lines and inserts a roff `sp` request, which is handled\n-- differently depending on the output format. My read is that mandoc\n-- considers the handling of a blank line in non-literal context in mdoc(7)\n-- to be undefined. The Mdoc reader thus ignores blank input lines outside\n-- of -literal and -unfilled displays.\nskipBlanks :: PandocMonad m => MdocParser m Blocks\nskipBlanks = many1 blank *> mempty\n\n-- By default, mdoc is in \"spacing mode\", where horizontal space is added\n-- between macro contents. The Sm macro turns it off and on. When we encounter\n-- the Sm macro, we both modify the parser state and we emit a sentinel value\n-- that spacify/foldNoSpaces uses to handle cases where spacing mode gets\n-- turned off and on within a stretch of inlines.\nparseSmToggle :: PandocMonad m => MdocParser m Inlines\nparseSmToggle = do\n  macro \"Sm\"\n  cur <- spacingMode <$> getState\n  mode <- optionMaybe (literal \"on\" $> True <|> literal \"off\" $> False)\n  eol\n  let newMode = update mode cur\n  modifyState $ \\s -> s{spacingMode = newMode}\n  return $ if newMode then smOn else smOff\n  where\n    update = \\case\n      Nothing -> not\n      Just x -> const x\n\nskipUnsupportedMacro :: PandocMonad m => T.Text -> MdocParser m ()\nskipUnsupportedMacro nm = do\n  (Macro _ pos) <- macro nm\n  manyTill anyToken eol\n  logMessage $ SkippedContent (\"unsupported macro: \" <> nm) pos\n\n\nskipUnsupportedInlines :: PandocMonad m => MdocParser m Inlines\nskipUnsupportedInlines = choice\n      [ skipUnsupportedMacro \"Tg\",\n        skipUnsupportedMacro \"Bk\",\n        skipUnsupportedMacro \"Ek\"\n      ] *> mempty\n\nskipUnknownMacro :: PandocMonad m => MdocParser m Blocks\nskipUnknownMacro = do\n  pos <- getPosition\n  m <- anyMacro\n  manyTill anyToken eol\n  logMessage $ SkippedContent (\"unsupported macro: \" <> toString m) pos\n  return mempty\n\n\nparseRegularBlock :: PandocMonad m => MdocParser m Blocks\nparseRegularBlock =\n  choice\n    [ parseDl\n    , parseD1\n    , parsePara\n    , emptyMacro \"Pp\" *> mempty\n    , parseBd\n    , parseBl\n    , skipBlanks\n    ]\n\nparseBlock :: (PandocMonad m) => MdocParser m Blocks\nparseBlock =\n  choice\n    [ parseHeader\n    , parseNameSection\n    , parseSynopsisSection\n    , parseSeeAlsoSection\n    , parseMiniSynopsis\n    , parseRegularBlock\n    , skipUnknownMacro\n    ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/MediaWiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.MediaWiki\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of mediawiki text to 'Pandoc' document.\n-}\n{-\nTODO:\n_ correctly handle tables within tables\n_ parse templates(?) and built-in magic words\n-}\nmodule Text.Pandoc.Readers.MediaWiki ( readMediaWiki ) where\n\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport Data.Char (isDigit, isLetter, isSpace)\nimport qualified Data.Foldable as F\nimport Data.List (intersperse)\nimport Data.Maybe (fromMaybe, maybeToList)\nimport Data.Sequence (ViewL (..), viewl, (<|))\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.HTML.TagSoup\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Builder (Blocks, Inlines, trimInlines)\nimport Text.Pandoc.Char (isCJK)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (tableCaption)\nimport Text.Pandoc.Readers.HTML (htmlTag, isCommentTag, toAttr)\nimport Text.Pandoc.Shared (formatCode, safeRead, splitTextBy, stringify,\n                           stripTrailingNewlines, trim, tshow)\nimport Text.Pandoc.XML (fromEntities)\n\n-- | Read mediawiki from an input string and return a Pandoc document.\nreadMediaWiki :: (PandocMonad m, ToSources a)\n              => ReaderOptions\n              -> a\n              -> m Pandoc\nreadMediaWiki opts s = do\n  let sources = toSources s\n  parsed <- readWithM parseMediaWiki MWState{ mwOptions = opts\n                                            , mwMaxNestingLevel = 4\n                                            , mwNextLinkNumber  = 1\n                                            , mwCategoryLinks = []\n                                            , mwIdentifierList = Set.empty\n                                            , mwLogMessages = []\n                                            , mwInTT = False\n                                            , mwAllowNewlines = True\n                                            , mwMeta = nullMeta\n                                            }\n            sources\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError e\n\ndata MWState = MWState { mwOptions         :: ReaderOptions\n                       , mwMaxNestingLevel :: Int\n                       , mwNextLinkNumber  :: Int\n                       , mwCategoryLinks   :: [Inlines]\n                       , mwIdentifierList  :: Set.Set Text\n                       , mwLogMessages     :: [LogMessage]\n                       , mwInTT            :: Bool\n                       , mwAllowNewlines   :: Bool\n                       , mwMeta            :: Meta\n                       }\n\ntype MWParser m = ParsecT Sources MWState m\n\ninstance HasReaderOptions MWState where\n  extractReaderOptions = mwOptions\n\ninstance HasIdentifierList MWState where\n  extractIdentifierList     = mwIdentifierList\n  updateIdentifierList f st = st{ mwIdentifierList = f $ mwIdentifierList st }\n\ninstance HasLogMessages MWState where\n  addLogMessage m s = s{ mwLogMessages = m : mwLogMessages s }\n  getLogMessages = reverse . mwLogMessages\n\n--\n-- auxiliary functions\n--\n\nspecialChars :: [Char]\nspecialChars = \"'[]<=&*{}|\\\":\\\\_\"\n\nspaceChars :: [Char]\nspaceChars = \" \\n\\t\"\n\nsym :: PandocMonad m => Text -> MWParser m ()\nsym s = () <$ try (string $ T.unpack s)\n\nnewBlockTags :: [Text]\nnewBlockTags = [\"haskell\",\"syntaxhighlight\",\"source\",\"gallery\",\"references\"]\n\nisBlockTag' :: Tag Text -> Bool\nisBlockTag' (TagOpen t _) = isBlockTagName t\nisBlockTag' (TagClose t) = isBlockTagName t\nisBlockTag' _ = False\n\nisBlockTagName :: Text -> Bool\nisBlockTagName t =\n  t `elem` [ \"blockquote\"\n           , \"caption\"\n           , \"col\"\n           , \"colgroup\"\n           , \"dd\"\n           , \"div\"\n           , \"dl\"\n           , \"dt\"\n           , \"h1\"\n           , \"h2\"\n           , \"h3\"\n           , \"h4\"\n           , \"h5\"\n           , \"h6\"\n           , \"hr\"\n           , \"li\"\n           , \"meta\"\n           , \"ol\"\n           , \"p\"\n           , \"pre\"\n           , \"rp\"\n           , \"table\"\n           , \"td\"\n           , \"th\"\n           , \"time\"\n           , \"tr\"\n           , \"ul\"\n           , \"center\"\n           ] || t `elem` newBlockTags\n\nisInlineTag' :: Tag Text -> Bool\nisInlineTag' (TagComment _) = True\nisInlineTag' (TagOpen t _) = isInlineTagName t\nisInlineTag' (TagClose t) = isInlineTagName t\nisInlineTag' _ = False\n\nisInlineTagName :: Text -> Bool\nisInlineTagName t =\n  t `elem` [ \"abbr\"\n           , \"b\"\n           , \"bdi\"\n           , \"bdo\"\n           , \"big\"\n           , \"br\"\n           , \"cite\"\n           , \"code\"\n           , \"data\"\n           , \"del\"\n           , \"dfn\"\n           , \"em\"\n           , \"i\"\n           , \"ins\"\n           , \"kbd\"\n           , \"link\"\n           , \"mark\"\n           , \"q\"\n           , \"rt\"\n           , \"ruby\"\n           , \"s\"\n           , \"samp\"\n           , \"small\"\n           , \"span\"\n           , \"strong\"\n           , \"sub\"\n           , \"sup\"\n           , \"u\"\n           , \"var\"\n           , \"wbr\"\n           , \"font\"\n           , \"rb\"\n           , \"rtc\"\n           , \"strike\"\n           , \"tt\"\n           ]\n\nhtmlComment :: PandocMonad m => MWParser m ()\nhtmlComment = () <$ htmlTag isCommentTag\n\ninlinesInTags :: PandocMonad m => Text -> MWParser m Inlines\ninlinesInTags tag = try $ do\n  (_,raw) <- htmlTag (~== TagOpen tag [])\n  if T.any (== '/') raw   -- self-closing tag\n     then return mempty\n     else trimInlines . mconcat <$>\n            manyTill inline (htmlTag (~== TagClose tag))\n\nblocksInTags :: PandocMonad m => Text -> MWParser m Blocks\nblocksInTags tag = try $ do\n  (_,raw) <- htmlTag (~== TagOpen tag [])\n  let closer = if tag == \"li\"\n                  then htmlTag (~== TagClose (\"li\" :: Text))\n                     <|> lookAhead (\n                              htmlTag (~== TagOpen (\"li\" :: Text) [])\n                          <|> htmlTag (~== TagClose (\"ol\" :: Text))\n                          <|> htmlTag (~== TagClose (\"ul\" :: Text)))\n                  else htmlTag (~== TagClose tag)\n  if T.any (== '/') raw   -- self-closing tag\n     then return mempty\n     else mconcat <$> manyTill block closer\n\ntextInTags :: PandocMonad m => Text -> MWParser m Text\ntextInTags tag = try $ do\n  (_,raw) <- htmlTag (~== TagOpen tag [])\n  if T.any (== '/') raw   -- self-closing tag\n     then return \"\"\n     else T.pack <$> manyTill anyChar (htmlTag (~== TagClose tag))\n\n--\n-- main parser\n--\n\nparseMediaWiki :: PandocMonad m => MWParser m Pandoc\nparseMediaWiki = do\n  bs <- mconcat <$> many block\n  spaces\n  eof\n  categoryLinks <- reverse . mwCategoryLinks <$> getState\n  meta <- mwMeta <$> getState\n  let categories = if null categoryLinks\n                      then mempty\n                      else B.para $ mconcat $ intersperse B.space categoryLinks\n  reportLogMessages\n  return $ Pandoc meta (B.toList bs <> B.toList categories)\n\n--\n-- block parsers\n--\n\nblock :: PandocMonad m => MWParser m Blocks\nblock = do\n  res <- mempty <$ skipMany1 blankline\n     <|> table\n     <|> header\n     <|> hrule\n     <|> orderedList\n     <|> bulletList\n     <|> definitionList\n     <|> mempty <$ try (spaces *> htmlComment)\n     <|> preformatted\n     <|> blockTag\n     <|> (B.rawBlock \"mediawiki\" <$> template)\n     <|> para\n  trace (T.take 60 $ tshow $ B.toList res)\n  return res\n\npara :: PandocMonad m => MWParser m Blocks\npara = do\n  contents <- trimInlines . mconcat <$> many1 inline\n  if F.all (==Space) contents\n     then return mempty\n     else case B.toList contents of\n         -- For the MediaWiki format all images are considered figures\n         [Image attr figureCaption (src, title)] ->\n             return $ B.simpleFigureWith\n                 attr (B.fromList figureCaption) src title\n         _ -> return $ B.para contents\n\ntable :: PandocMonad m => MWParser m Blocks\ntable = do\n  tableStart\n  styles <- option [] $\n               parseAttrs <* skipMany spaceChar <* optional (char '|')\n  skipMany spaceChar\n  optional $ template >> skipMany spaceChar\n  optional blanklines\n  let tableWidth = case lookup \"width\" styles of\n                         Just w  -> fromMaybe 1.0 $ parseWidth w\n                         Nothing -> 1.0\n  caption <- option mempty tableCaption\n  optional newline\n  optional rowsep\n  hasheader <- option False $ True <$ lookAhead (skipSpaces *> char '!')\n  (cellwidths,hdr) <- unzip <$> tableRow\n  let widths = map (tableWidth *) (concat cellwidths)\n  let restwidth = tableWidth - sum widths\n  let zerocols = length $ filter (==0.0) widths\n  let defaultwidth = if zerocols == 0 || zerocols == length widths\n                        then ColWidthDefault\n                        else ColWidth $ restwidth / fromIntegral zerocols\n  let widths' = map (\\w -> if w > 0 then ColWidth w else defaultwidth) widths\n  let cellspecs = zip (calculateAlignments hdr) widths'\n  rows' <- many $ try $ rowsep *> (map snd <$> tableRow)\n  optional blanklines\n  tableEnd\n  let (headers,rows) = if hasheader\n                          then (hdr, rows')\n                          else ([], hdr:rows')\n  let toRow = Row nullAttr\n      toHeaderRow l = [toRow l | not (null l)]\n  return $ B.table (B.simpleCaption $ B.plain caption)\n                   cellspecs\n                   (TableHead nullAttr $ toHeaderRow headers)\n                   [TableBody nullAttr 0 [] $ map toRow rows]\n                   (TableFoot nullAttr [])\n\ncalculateAlignments :: [Cell] -> [Alignment]\ncalculateAlignments = concatMap cellAligns\n  where\n    cellAligns :: Cell -> [Alignment]\n    cellAligns (Cell _ align _ (ColSpan colspan) _) = replicate colspan align\n\nparseAttrs :: PandocMonad m => MWParser m [(Text,Text)]\nparseAttrs = many1 parseAttr\n\nparseAttr :: PandocMonad m => MWParser m (Text, Text)\nparseAttr = try $ do\n  skipMany spaceChar\n  kFirst <- letter\n  kRest <- many (alphaNum <|> oneOf \"_-:.\")\n  let k = T.pack (kFirst : kRest)\n  skipMany spaceChar\n  char '='\n  skipMany spaceChar\n  v <- (char '\"' >> manyTillChar (satisfy (/='\\n')) (char '\"'))\n       <|> many1Char (satisfy $ \\c -> not (isSpace c) && c /= '|')\n  return (k,v)\n\ntableStart :: PandocMonad m => MWParser m ()\ntableStart = try $ guardColumnOne *> skipSpaces *> sym \"{|\"\n\ntableEnd :: PandocMonad m => MWParser m ()\ntableEnd = try $ guardColumnOne *> skipSpaces *> sym \"|}\"\n\nrowsep :: PandocMonad m => MWParser m ()\nrowsep = try $ guardColumnOne *> skipSpaces *> sym \"|-\" <*\n               many (char '-') <* optional parseAttrs\n                               <* skipSpaces\n                               <* skipMany htmlComment\n                               <* blanklines\n\ncellsep :: PandocMonad m => MWParser m [(Text,Text)]\ncellsep = try $ do\n  col <- sourceColumn <$> getPosition\n  skipMany spaceChar\n  c <- oneOf \"|!\"\n  when (col > 1) $ void $ char c\n  notFollowedBy (oneOf \"-}\")\n  attribs <- option [] (parseAttrs <* skipMany spaceChar <* char '|')\n  skipMany spaceChar\n  pure attribs\n\ntableCaption :: PandocMonad m => MWParser m Inlines\ntableCaption = try $ do\n  optional rowsep\n  guardColumnOne\n  skipSpaces\n  sym \"|+\"\n  optional (try $ parseAttrs *> skipSpaces *> char '|' *> blanklines)\n  trimInlines . mconcat <$>\n    many (notFollowedBy (void cellsep <|> rowsep) *> inline)\n\ntableRow :: PandocMonad m => MWParser m [([Double], Cell)]\ntableRow = try $ skipMany htmlComment *> many tableCell\n\n-- multiple widths because cell might have colspan\ntableCell :: PandocMonad m => MWParser m ([Double], Cell)\ntableCell = try $ do\n  attribs <- cellsep\n  pos' <- getPosition\n  ls <- T.concat <$> many (notFollowedBy (void cellsep <|> rowsep <|> tableEnd) *>\n                            ((snd <$> withRaw table) <|> countChar 1 anyChar))\n  bs <- parseFromString (do setPosition pos'\n                            mconcat <$> many block) ls\n  let align = case lookup \"align\" attribs of\n                    Just \"left\"   -> AlignLeft\n                    Just \"right\"  -> AlignRight\n                    Just \"center\" -> AlignCenter\n                    _             -> AlignDefault\n  let rowspan = RowSpan . fromMaybe 1 $\n                safeRead =<< lookup \"rowspan\" attribs\n  let colspan = ColSpan . fromMaybe 1 $\n                safeRead =<< lookup \"colspan\" attribs\n  let ColSpan rawcolspan = colspan\n  let handledAttribs = [\"align\", \"colspan\", \"rowspan\"]\n      attribs' = [ (k, v) | (k, v) <- attribs\n                          , k `notElem` handledAttribs\n                 ]\n  let widths = case lookup \"width\" attribs of\n                    Just xs -> maybe (replicate rawcolspan 0.0)\n                                 (\\w -> replicate rawcolspan\n                                    (w / fromIntegral rawcolspan))\n                                 (parseWidth xs)\n                    Nothing -> replicate rawcolspan 0.0\n  return (widths, B.cellWith (toAttr attribs') align rowspan colspan bs)\n\nparseWidth :: Text -> Maybe Double\nparseWidth s =\n  case T.unsnoc s of\n    Just (ds, '%') | T.all isDigit ds -> safeRead $ \"0.\" <> ds\n    _ -> Nothing\n\ntemplate :: PandocMonad m => MWParser m Text\ntemplate = try $ do\n  string \"{{\"\n  notFollowedBy (char '{')\n  lookAhead $ letter <|> digit <|> char ':'\n  let chunk = template <|> variable <|> many1Char (noneOf \"{}\") <|> countChar 1 anyChar\n  contents <- manyTill chunk (try $ string \"}}\")\n  return $ \"{{\" <> T.concat contents <> \"}}\"\n\nblockTag :: PandocMonad m => MWParser m Blocks\nblockTag = do\n  (tag, _) <- lookAhead $ htmlTag isBlockTag'\n  case tag of\n      TagOpen \"blockquote\" _ -> B.blockQuote <$> blocksInTags \"blockquote\"\n      TagOpen \"pre\" _ -> B.codeBlock . trimCode <$> textInTags \"pre\"\n      TagOpen \"syntaxhighlight\" attrs -> syntaxhighlight \"syntaxhighlight\" attrs\n      TagOpen \"source\" attrs -> syntaxhighlight \"source\" attrs\n      TagOpen \"haskell\" _ -> B.codeBlockWith (\"\",[\"haskell\"],[]) . trimCode <$>\n                                textInTags \"haskell\"\n      TagOpen \"gallery\" _ -> blocksInTags \"gallery\"\n      TagOpen \"p\" _ -> mempty <$ htmlTag (~== tag)\n      TagClose \"p\"  -> mempty <$ htmlTag (~== tag)\n      _ -> B.rawBlock \"html\" . snd <$> htmlTag (~== tag)\n\ntrimCode :: Text -> Text\ntrimCode t = case T.uncons t of\n  Just ('\\n', xs) -> stripTrailingNewlines xs\n  _               -> stripTrailingNewlines t\n\nsyntaxhighlight :: PandocMonad m => Text -> [Attribute Text] -> MWParser m Blocks\nsyntaxhighlight tag attrs = try $ do\n  let mblang = lookup \"lang\" attrs\n  let mbstart = lookup \"start\" attrs\n  let mbline = lookup \"line\" attrs\n  let classes = maybeToList mblang ++ maybe [] (const [\"numberLines\"]) mbline\n  let kvs = maybe [] (\\x -> [(\"startFrom\",x)]) mbstart\n  contents <- textInTags tag\n  return $ B.codeBlockWith (\"\",classes,kvs) $ trimCode contents\n\nhrule :: PandocMonad m => MWParser m Blocks\nhrule = B.horizontalRule <$ try (string \"----\" *> many (char '-') *> newline)\n\nguardColumnOne :: PandocMonad m => MWParser m ()\nguardColumnOne = getPosition >>= \\pos -> guard (sourceColumn pos == 1)\n\npreformatted :: PandocMonad m => MWParser m Blocks\npreformatted = try $ do\n  guardColumnOne\n  char ' '\n  let endline' = B.linebreak <$ try (newline <* char ' ')\n  let whitespace' = B.str <$> many1Char ('\\160' <$ spaceChar)\n  let spToNbsp ' ' = '\\160'\n      spToNbsp x   = x\n  let nowiki' = mconcat . intersperse B.linebreak . map B.str .\n                T.lines . fromEntities . T.map spToNbsp <$> try\n                  (htmlTag (~== TagOpen (\"nowiki\" :: Text) []) *>\n                   manyTillChar anyChar (htmlTag (~== TagClose (\"nowiki\" :: Text))))\n  let inline' = whitespace' <|> endline' <|> nowiki'\n                  <|> try (notFollowedBy newline *> inline)\n  contents <- mconcat <$> many1 inline'\n  let spacesStr (Str xs) = T.all isSpace xs\n      spacesStr _        = False\n  if F.all spacesStr contents\n     then return mempty\n     else return $ B.para $ encode contents\n\nencode :: Inlines -> Inlines\nencode = formatCode nullAttr\n\nheader :: PandocMonad m => MWParser m Blocks\nheader = try $ do\n  guardColumnOne\n  lev <- length <$> many1 (char '=')\n  guard $ lev <= 6\n  contents <- trimInlines . mconcat <$> manyTill inline (count lev $ char '=')\n  opts <- mwOptions <$> getState\n  attr <- (if isEnabled Ext_gfm_auto_identifiers opts\n              then id\n              else modifyIdentifier) <$> registerHeader nullAttr contents\n  return $ B.headerWith attr lev contents\n\n-- See #4731:\nmodifyIdentifier :: Attr -> Attr\nmodifyIdentifier (ident,cl,kv) = (ident',cl,kv)\n  where ident' = T.map (\\c -> if c == '-' then '_' else c) ident\n\nbulletList :: PandocMonad m => MWParser m Blocks\nbulletList = B.bulletList <$>\n   (   many1 (listItem '*')\n   <|> (htmlTag (~== TagOpen (\"ul\" :: Text) []) *> spaces *> many (listItem '*' <|> li) <*\n        optional (htmlTag (~== TagClose (\"ul\" :: Text)))) )\n\norderedList :: PandocMonad m => MWParser m Blocks\norderedList =\n       (B.orderedList <$> many1 (listItem '#'))\n   <|> try\n       (do (tag,_) <- htmlTag (~== TagOpen (\"ol\" :: Text) [])\n           spaces\n           items <- many (listItem '#' <|> li)\n           optional (htmlTag (~== TagClose (\"ol\" :: Text)))\n           let start = fromMaybe 1 $ safeRead $ fromAttrib \"start\" tag\n           return $ B.orderedListWith (start, DefaultStyle, DefaultDelim) items)\n\ndefinitionList :: PandocMonad m => MWParser m Blocks\ndefinitionList = B.definitionList <$> many1 defListItem\n\ndefListItem :: PandocMonad m => MWParser m (Inlines, [Blocks])\ndefListItem = try $ do\n  terms <- mconcat . intersperse B.linebreak <$> many defListTerm\n  -- we allow dd with no dt, or dt with no dd\n  defs  <- if null terms\n              then notFollowedBy\n                    (try $ skipMany1 (char ':') >> string \"<math>\") *>\n                       many1 (listItem ':')\n              else many (listItem ':')\n  return (terms, defs)\n\ndefListTerm  :: PandocMonad m => MWParser m Inlines\ndefListTerm = do\n  guardColumnOne\n  char ';'\n  skipMany spaceChar\n  trimInlines . mconcat <$> many (notFollowedBy (oneOf \":\\r\\n\") *> inline) <*\n    optional newline\n\nlistStart :: PandocMonad m => Char -> MWParser m ()\nlistStart c = char c *> notFollowedBy listStartChar\n\nlistStartChar :: PandocMonad m => MWParser m Char\nlistStartChar = oneOf \"*#;:\"\n\nanyListStart :: PandocMonad m => MWParser m Char\nanyListStart = guardColumnOne >> oneOf \"*#:;\"\n\nli :: PandocMonad m => MWParser m Blocks\nli = lookAhead (htmlTag (~== TagOpen (\"li\" :: Text) [])) *>\n     (firstParaToPlain <$> blocksInTags \"li\") <* spaces\n\nlistItem :: PandocMonad m => Char -> MWParser m Blocks\nlistItem c = try $ do\n  guardColumnOne <|> guard (c == ':') -- def can start on same line as term\n  extras <- many (try $ char c <* lookAhead listStartChar)\n  if null extras\n     then listItem' c\n     else do\n       skipMany spaceChar\n       pos' <- getPosition\n       first <- T.concat <$> manyTill listChunk newline\n       rest <- many\n                (try $ string extras *> lookAhead listStartChar *>\n                       (T.concat <$> manyTill listChunk newline))\n       contents <- parseFromString (do setPosition pos'\n                                       many1 $ listItem' c)\n                          (T.unlines (first : rest))\n       case c of\n           '*' -> return $ B.bulletList contents\n           '#' -> return $ B.orderedList contents\n           ':' -> return $ B.definitionList [(mempty, contents)]\n           _   -> mzero\n\n-- The point of this is to handle stuff like\n-- * {{cite book\n-- | blah\n-- | blah\n-- }}\n-- * next list item\n-- which seems to be valid mediawiki.\n-- Also multiline math: see #9293.\nlistChunk :: PandocMonad m => MWParser m Text\nlistChunk = template <|> (snd <$> withRaw math) <|> countChar 1 anyChar\n\nlistItem' :: PandocMonad m => Char -> MWParser m Blocks\nlistItem' c = try $ do\n  listStart c\n  skipMany spaceChar\n  pos' <- getPosition\n  first <- T.concat <$> manyTill listChunk newline\n  rest <- many (try $ char c *> lookAhead listStartChar *>\n                   (T.concat <$> manyTill listChunk newline))\n  parseFromString (do setPosition pos'\n                      firstParaToPlain . mconcat <$> many1 block)\n      $ T.unlines $ first : rest\n\nfirstParaToPlain :: Blocks -> Blocks\nfirstParaToPlain contents =\n  case viewl (B.unMany contents) of\n       Para xs :< ys -> B.Many $ Plain xs <| ys\n       _             -> contents\n\n--\n-- inline parsers\n--\n\ninline :: PandocMonad m => MWParser m Inlines\ninline =  whitespace\n      <|> url\n      <|> str\n      <|> doubleQuotes\n      <|> strong\n      <|> emph\n      <|> behaviorSwitch\n      <|> image\n      <|> internalLink\n      <|> externalLink\n      <|> math\n      <|> inlineTag\n      <|> B.singleton <$> charRef\n      <|> inlineHtml\n      <|> (B.rawInline \"mediawiki\" <$> variable)\n      <|> (B.rawInline \"mediawiki\" <$> template)\n      <|> special\n\nstr :: PandocMonad m => MWParser m Inlines\nstr = B.str <$> many1Char (noneOf $ specialChars ++ spaceChars)\n\nmath :: PandocMonad m => MWParser m Inlines\nmath = (B.displayMath . trim <$> try (many1 (char ':') >> textInTags \"math\"))\n   <|> (B.math . trim <$> textInTags \"math\")\n   <|> (B.displayMath . trim <$> try (dmStart *> manyTillChar anyChar dmEnd))\n   <|> (B.math . trim <$> try (mStart *> manyTillChar (satisfy (/='\\n')) mEnd))\n where dmStart = string \"\\\\[\"\n       dmEnd   = try (string \"\\\\]\")\n       mStart  = string \"\\\\(\"\n       mEnd    = try (string \"\\\\)\")\n\nvariable :: PandocMonad m => MWParser m Text\nvariable = try $ do\n  string \"{{{\"\n  contents <- manyTillChar anyChar (try $ string \"}}}\")\n  return $ \"{{{\" <> contents <> \"}}}\"\n\nsingleParaToPlain :: Blocks -> Blocks\nsingleParaToPlain bs =\n  case B.toList bs of\n    [Para ils] -> B.fromList [Plain ils]\n    _ -> bs\n\ninlineTag :: PandocMonad m => MWParser m Inlines\ninlineTag = do\n  (tag, _) <- lookAhead $ htmlTag (\\tag -> case tag of\n                                      TagOpen \"hask\" _ -> True\n                                      TagOpen \"ref\" _ -> True\n                                      TagOpen \"nowiki\" _ -> True\n                                      _ -> isInlineTag' tag)\n  case tag of\n       TagOpen \"ref\" _ -> B.note . singleParaToPlain <$> blocksInTags \"ref\"\n       TagOpen \"nowiki\" _ -> try $ do\n          (_,raw) <- htmlTag (~== tag)\n          if T.any (== '/') raw\n             then return mempty\n             else B.text . fromEntities <$>\n                       manyTillChar anyChar (htmlTag (~== TagClose (\"nowiki\" :: Text)))\n       TagOpen \"br\" _ -> B.linebreak <$ (htmlTag (~== TagOpen (\"br\" :: Text) []) -- will get /> too\n                            *> optional blankline)\n       TagOpen \"strike\" _ -> B.strikeout <$> inlinesInTags \"strike\"\n       TagOpen \"del\" _ -> B.strikeout <$> inlinesInTags \"del\"\n       TagOpen \"sub\" _ -> B.subscript <$> inlinesInTags \"sub\"\n       TagOpen \"sup\" _ -> B.superscript <$> inlinesInTags \"sup\"\n       TagOpen \"var\" _ -> B.codeWith (\"\",[\"variable\"],[]) <$> textInTags \"var\"\n       TagOpen \"samp\" _ -> B.codeWith (\"\",[\"sample\"],[]) <$> textInTags \"samp\"\n       TagOpen \"kbd\" _ -> B.spanWith (\"\",[\"kbd\"],[]) <$> inlinesInTags \"kbd\"\n       TagOpen \"mark\" _ -> B.spanWith (\"\",[\"mark\"],[]) <$> inlinesInTags \"mark\"\n       TagOpen \"code\" _ -> encode <$> inlinesInTags \"code\"\n       TagOpen \"tt\" _ -> do\n         inTT <- mwInTT <$> getState\n         updateState $ \\st -> st{ mwInTT = True }\n         result <- encode <$> inlinesInTags \"tt\"\n         updateState $ \\st -> st{ mwInTT = inTT }\n         return result\n       TagOpen \"hask\" _ -> B.codeWith (\"\",[\"haskell\"],[]) <$> textInTags \"hask\"\n       _ -> B.rawInline \"html\" . snd <$> htmlTag (~== tag)\n\nspecial :: PandocMonad m => MWParser m Inlines\nspecial = B.str . T.singleton <$>\n  (notFollowedBy' (htmlTag (\\t -> isInlineTag' t ||\n                                  isBlockTag' t ||\n                                  case t of\n                                    TagClose \"ref\" -> True\n                                    TagClose \"hask\" -> True\n                                    TagClose \"nowiki\" -> True\n                                    _ -> False)\n                                  ) *> oneOf specialChars)\n\ninlineHtml :: PandocMonad m => MWParser m Inlines\ninlineHtml = B.rawInline \"html\" . snd <$> htmlTag isInlineTag'\n\nwhitespace :: PandocMonad m => MWParser m Inlines\nwhitespace = B.space <$ (skipMany1 spaceChar <|> htmlComment)\n         <|> B.softbreak <$ endline\n\nendline :: PandocMonad m => MWParser m ()\nendline = do\n getState >>= guard . mwAllowNewlines\n () <$ try (newline <* notFollowedBy spaceChar <*\n                       notFollowedBy newline <*\n                       notFollowedBy' hrule <*\n                       notFollowedBy tableStart <*\n                       notFollowedBy' header <*\n                       notFollowedBy anyListStart)\n\nimageIdentifier :: PandocMonad m => MWParser m ()\nimageIdentifier = try $ do\n  ident <- T.pack <$> many1Till letter (char ':')\n  guard $ T.toLower ident `elem`\n            [\"file\", \"image\", \"archivo\", \"datei\", \"fichier\", \"bild\"]\n\nimage :: PandocMonad m => MWParser m Inlines\nimage = try $ do\n  sym \"[[\"\n  imageIdentifier\n  fname <- addUnderscores <$> many1Char (noneOf \"|]\")\n  _ <- many imageOption\n  dims <- try (char '|' *> sepBy (manyChar digit) (char 'x') <* string \"px\")\n          <|> return []\n  _ <- many imageOption\n  let kvs = case dims of\n              [w]    -> [(\"width\", w)]\n              [w, h] -> [(\"width\", w), (\"height\", h)]\n              _      -> []\n  let attr = (\"\", [], kvs)\n  caption <-   (B.str fname <$ sym \"]]\")\n           <|> try (char '|' *> (mconcat <$> manyTill inline (sym \"]]\")))\n  return $ B.imageWith attr fname (stringify caption) caption\n\nimageOption :: PandocMonad m => MWParser m Text\nimageOption = try $ char '|' *> opt\n  where\n    opt = try (oneOfStrings [ \"border\", \"thumbnail\", \"frameless\"\n                            , \"thumb\", \"upright\", \"left\", \"right\"\n                            , \"center\", \"none\", \"baseline\", \"sub\"\n                            , \"super\", \"top\", \"text-top\", \"middle\"\n                            , \"bottom\", \"text-bottom\" ])\n      <|> try (textStr \"frame\")\n      <|> try (oneOfStrings [\"link=\",\"alt=\",\"page=\",\"class=\"] <* many (noneOf \"|]\"))\n\naddUnderscores :: Text -> Text\naddUnderscores = T.intercalate \"_\" . splitTextBy sep . T.strip\n  where\n    sep c = isSpace c || c == '_'\n\ninternalLink :: PandocMonad m => MWParser m Inlines\ninternalLink = try $ do\n  sym \"[[\"\n  pagename <- T.unwords . T.words <$> manyChar (noneOf \"|]\")\n  label <- option (B.text pagename) $ char '|' *>\n             (  (mconcat <$> many1 (notFollowedBy (char ']') *> inline))\n             -- the \"pipe trick\"\n             -- [[Help:Contents|] -> \"Contents\"\n             <|> return (B.text $ T.drop 1 $ T.dropWhile (/=':') pagename) )\n  sym \"]]\"\n  -- see #8525:\n  linktrail <- B.text <$> manyChar (satisfy (\\c -> isLetter c && not (isCJK c)))\n  let link = B.linkWith (mempty, [\"wikilink\"], mempty) (addUnderscores pagename) (stringify label) (label <> linktrail)\n  if \"Category:\" `T.isPrefixOf` pagename\n     then do\n       updateState $ \\st -> st{ mwCategoryLinks = link : mwCategoryLinks st }\n       return mempty\n     else return link\n\nexternalLink :: PandocMonad m => MWParser m Inlines\nexternalLink = try $ do\n  char '['\n  (_, src) <- uri\n  lab <- try (trimInlines . mconcat <$>\n              (skipMany1 spaceChar *> manyTill inline (char ']')))\n       <|> do char ']'\n              num <- mwNextLinkNumber <$> getState\n              updateState $ \\st -> st{ mwNextLinkNumber = num + 1 }\n              return $ B.str $ tshow num\n  return $ B.link src \"\" lab\n\nurl :: PandocMonad m => MWParser m Inlines\nurl = do\n  (orig, src) <- uri\n  return $ B.link src \"\" (B.str orig)\n\n-- | Parses a list of inlines between start and end delimiters.\ninlinesBetween :: (PandocMonad m, Show b) => MWParser m a -> MWParser m b -> MWParser m Inlines\ninlinesBetween start end =\n  trimInlines . mconcat <$> try (start >> many1Till inline end)\n\nemph :: PandocMonad m => MWParser m Inlines\nemph = B.emph <$> inlinesBetween start end\n    where start = sym \"''\"\n          end   = try $ notFollowedBy' (() <$ strong) >> sym \"''\"\n\nstrong :: PandocMonad m => MWParser m Inlines\nstrong = B.strong <$> inlinesBetween start end\n    where start = sym \"'''\"\n          end   = sym \"'''\"\n\ndoubleQuotes :: PandocMonad m => MWParser m Inlines\ndoubleQuotes = do\n  guardEnabled Ext_smart\n  inTT <- mwInTT <$> getState\n  guard (not inTT)\n  B.doubleQuoted <$> inlinesBetween openDoubleQuote closeDoubleQuote\n    where openDoubleQuote = sym \"\\\"\" >> lookAhead nonspaceChar\n          closeDoubleQuote = try $ sym \"\\\"\"\n\nbehaviorSwitch :: PandocMonad m => MWParser m Inlines\nbehaviorSwitch = try $ do\n  let reservedMagicWords = [ \"NOTOC\"\n              , \"FORCETOC\"\n              , \"TOC\"\n              , \"NOEDITSECTION\"\n              , \"NEWSECTIONLINK\"\n              , \"NONEWSECTIONLINK\"\n              , \"NOGALLERY\"\n              , \"HIDDENCAT\"\n              , \"EXPECTUNUSEDCATEGORY\"\n              , \"NOCONTENTCONVERT\"\n              , \"NOCC\"\n              , \"NOTITLECONVERT\"\n              , \"NOTC\"\n              , \"INDEX\"\n              , \"NOINDEX\"\n              , \"STATICREDIRECT\"\n              , \"EXPECTUNUSEDTEMPLATE\"\n              -- From popular extensions\n              , \"NOGLOBAL\"\n              , \"DISAMBIG\"\n              , \"ARCHIVEDTALK\"\n              , \"NOTALK\"\n              ]\n  string \"__\"\n  name <- many1 alphaNum\n  string \"__\"\n  case name `elem` reservedMagicWords of\n    True -> do\n      updateState $ \\st -> st{ mwMeta = B.setMeta (T.toLower $ T.pack name) True (mwMeta st) }\n      return mempty\n    False -> return $ B.str $ \"__\" <> T.pack name <> \"__\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Metadata.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Readers.Metadata\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nParse YAML/JSON metadata to 'Pandoc' 'Meta'.\n-}\nmodule Text.Pandoc.Readers.Metadata (\n  yamlBsToMeta,\n  yamlBsToRefs,\n  yamlMetaBlock,\n  yamlMap ) where\n\n\nimport Control.Monad.Except (throwError)\nimport qualified Data.ByteString as B\nimport qualified Data.Map as M\nimport qualified Data.Vector as V\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Yaml as Yaml\nimport qualified Data.Yaml.Internal as Yaml\nimport qualified Text.Libyaml as Y\nimport Data.Aeson (Value(..), Object, Result(..), fromJSON, (.:?), withObject,\n                   FromJSON)\nimport Data.Aeson.Types (formatRelativePath, parse)\nimport Text.Pandoc.Shared (tshow, blocksToInlines)\nimport Text.Pandoc.Class (PandocMonad (..), report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.Logging (LogMessage(YamlWarning))\nimport Text.Pandoc.Parsing hiding (tableWith, parse)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport System.IO.Unsafe (unsafePerformIO)\n\nyamlBsToMeta :: (PandocMonad m, HasLastStrPosition st)\n             => ParsecT Sources st m (Future st MetaValue)\n             -> B.ByteString\n             -> ParsecT Sources st m (Future st Meta)\nyamlBsToMeta pMetaValue bstr = do\n  pos <- getPosition\n  case decodeAllWithWarnings bstr of\n       Right (warnings, xs) -> do\n         mapM_ (\\(Yaml.DuplicateKey jpath) ->\n                          report (YamlWarning pos $ \"Duplicate key: \" <>\n                                  T.pack (formatRelativePath jpath)))\n           warnings\n         case xs of\n           (Object o : _) -> fmap Meta <$> yamlMap pMetaValue o\n           [Null] -> return . return $ mempty\n           [] -> return . return $ mempty\n           _  -> Prelude.fail \"expected YAML object\"\n       Left err' -> do\n         let msg = T.pack $ \"Error parsing YAML metadata at \" <>\n                             show pos <> \":\\n\" <>\n                             Yaml.prettyPrintParseException err'\n         throwError $ PandocParseError $\n           if \"did not find expected key\" `T.isInfixOf` msg\n              then msg <>\n                   \"\\nConsider enclosing the entire field in 'single quotes'\"\n              else msg\n\ndecodeAllWithWarnings :: FromJSON a\n                      => B.ByteString\n                      -> (Either Yaml.ParseException ([Yaml.Warning], [a]))\ndecodeAllWithWarnings = either Left (\\(ws,res)\n                       -> case res of\n                            Left s  -> Left (Yaml.AesonException s)\n                            Right v -> Right (ws, v))\n                   . unsafePerformIO\n                   . Yaml.decodeAllHelper\n                   . Y.decode\n\n-- Returns filtered list of references.\nyamlBsToRefs :: (PandocMonad m, HasLastStrPosition st)\n             => ParsecT Sources st m (Future st MetaValue)\n             -> (Text -> Bool) -- ^ Filter for id\n             -> B.ByteString\n             -> ParsecT Sources st m (Future st [MetaValue])\nyamlBsToRefs pMetaValue idpred bstr =\n  case Yaml.decodeAllEither' bstr of\n       Right (Object m : _) -> do\n         case parse (withObject \"metadata\" (.:? \"references\")) (Object m) of\n           Success (Just refs) -> sequence <$>\n                 mapM (yamlToMetaValue pMetaValue) (filter hasSelectedId refs)\n           _ -> return $ return []\n       Right (Array v : _) -> do\n         let refs = filter hasSelectedId $ V.toList v\n         sequence <$> mapM (yamlToMetaValue pMetaValue) (filter hasSelectedId refs)\n       Right _ -> return . return $ []\n       Left err' -> throwError $ PandocParseError\n                               $ T.pack $ Yaml.prettyPrintParseException err'\n where\n   isSelected (String t) = idpred t\n   isSelected _ = False\n   hasSelectedId (Object o) =\n     case parse (withObject \"ref\" (.:? \"id\")) (Object o) of\n       Success (Just id') -> isSelected id'\n       _ -> False\n   hasSelectedId _ = False\n\nnormalizeMetaValue :: (PandocMonad m, HasLastStrPosition st)\n                   => ParsecT Sources st m (Future st MetaValue)\n                   -> Text\n                   -> ParsecT Sources st m (Future st MetaValue)\nnormalizeMetaValue pMetaValue x =\n   -- Note: a standard quoted or unquoted YAML value will\n   -- not end in a newline, but a \"block\" set off with\n   -- `|` or `>` will.\n   if \"\\n\" `T.isSuffixOf` (T.dropWhileEnd isSpaceChar x) -- see #6823\n      then parseFromString' pMetaValue (x <> \"\\n\\n\")\n      else try (parseFromString' asInlines x') -- see #8358\n           <|> -- see #8465\n           parseFromString' asInlines (x' <> \"\\n\\n\")\n  where x' = T.dropWhile isSpaceOrNlChar x\n        asInlines = fmap b2i <$> pMetaValue\n        b2i (MetaBlocks bs) = MetaInlines (blocksToInlines bs)\n        b2i y = y\n        isSpaceChar ' '  = True\n        isSpaceChar '\\t' = True\n        isSpaceChar _    = False\n        isSpaceOrNlChar '\\r' = True\n        isSpaceOrNlChar '\\n' = True\n        isSpaceOrNlChar c = isSpaceChar c\n\nyamlToMetaValue :: (PandocMonad m, HasLastStrPosition st)\n                => ParsecT Sources st m (Future st MetaValue)\n                -> Value\n                -> ParsecT Sources st m (Future st MetaValue)\nyamlToMetaValue pMetaValue v =\n  case v of\n       String t -> normalizeMetaValue pMetaValue t\n       Bool b -> return $ return $ MetaBool b\n       Number d -> normalizeMetaValue pMetaValue $\n         case fromJSON v of\n           Success (x :: Int) -> tshow x\n           _ -> tshow d\n       Null -> return $ return $ MetaString \"\"\n       Array{} -> do\n         case fromJSON v of\n           Error err' -> throwError $ PandocParseError $ T.pack err'\n           Success xs -> fmap MetaList . sequence <$>\n                          mapM (yamlToMetaValue pMetaValue) xs\n       Object o -> fmap MetaMap <$> yamlMap pMetaValue o\n\nyamlMap :: (PandocMonad m, HasLastStrPosition st)\n        => ParsecT Sources st m (Future st MetaValue)\n        -> Object\n        -> ParsecT Sources st m (Future st (M.Map Text MetaValue))\nyamlMap pMetaValue o = do\n    case fromJSON (Object o) of\n      Error err' -> throwError $ PandocParseError $ T.pack err'\n      Success (m' :: M.Map Text Value) -> do\n        let kvs = filter (not . ignorable . fst) $ M.toList m'\n        fmap M.fromList . sequence <$> mapM toMeta kvs\n  where\n    ignorable t = \"_\" `T.isSuffixOf` t\n    toMeta (k, v) = do\n      fv <- yamlToMetaValue pMetaValue v\n      return $ do\n        v' <- fv\n        return (k, v')\n\n-- | Parse a YAML metadata block using the supplied 'MetaValue' parser.\nyamlMetaBlock :: (HasLastStrPosition st, PandocMonad m)\n              => ParsecT Sources st m (Future st MetaValue)\n              -> ParsecT Sources st m (Future st Meta)\nyamlMetaBlock parser = try $ do\n  pos <- getPosition\n  string \"---\"\n  blankline\n  notFollowedBy blankline  -- if --- is followed by a blank it's an HRULE\n  rawYamlLines <- manyTill anyLine stopLine\n  -- by including --- and ..., we allow yaml blocks with just comments:\n  let rawYaml = T.unlines (\"---\" : (rawYamlLines ++ [\"...\"]))\n  optional blanklines\n  oldPos <- getPosition\n  setPosition pos\n  res <- yamlBsToMeta parser $ UTF8.fromText rawYaml\n  setPosition oldPos\n  pure res\n\nstopLine :: Monad m => ParsecT Sources st m ()\nstopLine = try $ (string \"---\" <|> string \"...\") >> blankline >> return ()\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Muse.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE TupleSections     #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Muse\n   Copyright   : Copyright (C) 2017-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Krotov <ilabdsf@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of Muse text to 'Pandoc' document.\n-}\n{-\nTODO:\n- <cite> tag\n-}\nmodule Text.Pandoc.Readers.Muse (readMuse) where\n\nimport Control.Monad\nimport Control.Monad.Reader\nimport Control.Monad.Except (throwError)\nimport Data.Bifunctor\nimport Data.Default\nimport Data.List (transpose)\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport Data.Maybe (fromMaybe, isNothing, maybeToList)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Builder (Blocks, Inlines, underline)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Shared (trimr, tshow)\n\n-- | Read Muse from an input string and return a Pandoc document.\nreadMuse :: (PandocMonad m, ToSources a)\n         => ReaderOptions\n         -> a\n         -> m Pandoc\nreadMuse opts s = do\n  let sources = toSources s\n  res <- flip runReaderT def $ runParserT parseMuse def{ museOptions = opts }\n              (initialSourceName sources) sources\n  case res of\n       Left e  -> throwError $ fromParsecError sources e\n       Right d -> return d\n\ntype F = Future MuseState\n\ndata MuseState = MuseState { museMeta :: F Meta -- ^ Document metadata\n                           , museOptions :: ReaderOptions\n                           , museIdentifierList :: Set.Set Text\n                           , museLastSpacePos :: Maybe SourcePos -- ^ Position after last space or newline parsed\n                           , museLastStrPos :: Maybe SourcePos -- ^ Position after last str parsed\n                           , museLogMessages :: [LogMessage]\n                           , museNotes :: M.Map Text (SourcePos, F Blocks)\n                           }\n\ninstance Default MuseState where\n  def = MuseState { museMeta = return nullMeta\n                  , museOptions = def\n                  , museIdentifierList = Set.empty\n                  , museLastStrPos = Nothing\n                  , museLastSpacePos = Nothing\n                  , museLogMessages = []\n                  , museNotes = M.empty\n                  }\n\ndata MuseEnv =\n  MuseEnv { museInLink :: Bool -- ^ True when parsing a link description to avoid nested links\n          , museInPara :: Bool -- ^ True when parsing paragraph is not allowed\n          }\n\ninstance Default MuseEnv where\n  def = MuseEnv { museInLink = False\n                , museInPara = False\n                }\n\ntype MuseParser m = ParsecT Sources MuseState (ReaderT MuseEnv m)\n\ninstance HasReaderOptions MuseState where\n  extractReaderOptions = museOptions\n\ninstance HasIdentifierList MuseState where\n  extractIdentifierList     = museIdentifierList\n  updateIdentifierList f st = st{ museIdentifierList = f $ museIdentifierList st }\n\ninstance HasLastStrPosition MuseState where\n  setLastStrPos pos st = st{ museLastStrPos = pos }\n  getLastStrPos st     = museLastStrPos st\n\ninstance HasLogMessages MuseState where\n  addLogMessage m s = s{ museLogMessages = m : museLogMessages s }\n  getLogMessages = reverse . museLogMessages\n\nupdateLastSpacePos :: Monad m => MuseParser m ()\nupdateLastSpacePos = getPosition >>= \\pos ->\n  updateState $ \\s -> s { museLastSpacePos = Just pos }\n\n-- | Parse Muse document\nparseMuse :: PandocMonad m => MuseParser m Pandoc\nparseMuse = do\n  many directive\n  blocks <- (:) <$> parseBlocks <*> many parseSection\n  eof\n  st <- getState\n  runF (Pandoc <$> museMeta st <*> fmap B.toList (mconcat blocks)) st <$ reportLogMessages\n\n-- * Utility functions\n\n-- | Trim up to one newline from the beginning of the string.\nlchop :: Text -> Text\nlchop s = case T.uncons s of\n  Just ('\\n', xs) -> xs\n  _               -> s\n\n-- | Trim up to one newline from the end of the string.\nrchop :: Text -> Text\nrchop s = case T.unsnoc s of\n  Just (xs, '\\n') -> xs\n  _               -> s\n\nunindent :: Text -> Text\nunindent = rchop . T.intercalate \"\\n\" . dropSpacePrefix . T.splitOn \"\\n\" . lchop\n\ndropSpacePrefix :: [Text] -> [Text]\ndropSpacePrefix lns = T.drop maxIndent <$> lns\n  where isSpaceChar c = c == ' ' || c == '\\t'\n        maxIndent = length $ takeWhile (isSpaceChar . T.head) $ takeWhile same $ T.transpose lns\n        same t = case T.uncons t of\n          Just (c, cs) -> T.all (== c) cs\n          Nothing      -> True\n\natStart :: PandocMonad m => MuseParser m ()\natStart = do\n  pos <- getPosition\n  st <- getState\n  guard $ museLastStrPos st /= Just pos\n\nnoSpaceBefore :: PandocMonad m => MuseParser m ()\nnoSpaceBefore = do\n  pos <- getPosition\n  st <- getState\n  guard $ museLastSpacePos st /= Just pos\n\nfirstColumn :: PandocMonad m => MuseParser m ()\nfirstColumn = getPosition >>= \\pos -> guard (sourceColumn pos == 1)\n\n-- * Parsers\n\n-- | Parse end-of-line, which can be either a newline or end-of-file.\neol :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m ()\neol = void newline <|> eof\n\ngetIndent :: PandocMonad m\n          => MuseParser m Int\ngetIndent = subtract 1 . sourceColumn <$ many spaceChar <*> getPosition\n\n-- ** HTML parsers\n\nopenTag :: PandocMonad m => Text -> MuseParser m [(Text, Text)]\nopenTag tag = try $\n  char '<' *> textStr tag *> manyTill attr (char '>')\n  where\n    attr = try $ (,)\n      <$  many1 spaceChar\n      <*> many1Char (noneOf \"=\\n\")\n      <*  string \"=\\\"\"\n      <*> manyTillChar (noneOf \"\\\"\") (char '\"')\n\ncloseTag :: PandocMonad m => Text -> MuseParser m ()\ncloseTag tag = try $ string \"</\" *> textStr tag *> void (char '>')\n\n-- | Convert HTML attributes to Pandoc 'Attr'\nhtmlAttrToPandoc :: [(Text, Text)] -> Attr\nhtmlAttrToPandoc attrs = (ident, classes, keyvals)\n  where\n    ident   = fromMaybe \"\" $ lookup \"id\" attrs\n    classes = maybe [] T.words $ lookup \"class\" attrs\n    keyvals = [(k,v) | (k,v) <- attrs, k /= \"id\", k /= \"class\"]\n\nparseHtmlContent :: PandocMonad m\n                 => Text -- ^ Tag name\n                 -> MuseParser m (Attr, F Blocks)\nparseHtmlContent tag = try $ getIndent >>= \\indent -> (,)\n  <$> fmap htmlAttrToPandoc (openTag tag)\n  <*  manyTill spaceChar eol\n  <*> allowPara (parseBlocksTill (try $ indentWith indent *> closeTag tag))\n  <*  manyTill spaceChar eol -- closing tag must be followed by optional whitespace and newline\n\n-- ** Directive parsers\n\n-- While not documented, Emacs Muse allows \"-\" in directive name\nparseDirectiveKey :: PandocMonad m => MuseParser m Text\nparseDirectiveKey = char '#' *> manyChar (letter <|> char '-')\n\nparseEmacsDirective :: PandocMonad m => MuseParser m (Text, F Inlines)\nparseEmacsDirective = (,)\n  <$> parseDirectiveKey\n  <*  spaceChar\n  <*> (trimInlinesF . mconcat <$> manyTill inline' eol)\n\nparseAmuseDirective :: PandocMonad m => MuseParser m (Text, F Inlines)\nparseAmuseDirective = (,)\n  <$> parseDirectiveKey\n  <*  many1 spaceChar\n  <*> (trimInlinesF . mconcat <$> many1Till inline endOfDirective)\n  <*  many blankline\n  where\n    endOfDirective = lookAhead $ eof <|> try (newline *> (void blankline <|> void parseDirectiveKey))\n\ndirective :: PandocMonad m => MuseParser m ()\ndirective = do\n  ext <- getOption readerExtensions\n  (key, value) <- if extensionEnabled Ext_amuse ext then parseAmuseDirective else parseEmacsDirective\n  updateState $ \\st -> st { museMeta = B.setMeta (translateKey key) <$> value <*> museMeta st }\n  where translateKey \"cover\" = \"cover-image\"\n        translateKey x = x\n\n-- ** Block parsers\n\nallowPara :: MonadReader MuseEnv m => m a -> m a\nallowPara p = local (\\s -> s { museInPara = False }) p\n\n-- | Parse section contents until EOF or next header\nparseBlocks :: PandocMonad m\n            => MuseParser m (F Blocks)\nparseBlocks =\n  try (parseEnd <|>\n       nextSection <|>\n       listStart <|>\n       blockStart <|>\n       paraStart)\n  where\n    nextSection = mempty <$ lookAhead headingStart\n    parseEnd = mempty <$ eof\n    blockStart = (B.<>) <$> (blockElements <|> emacsNoteBlock)\n                        <*> allowPara parseBlocks\n    listStart =\n      uncurry (B.<>) <$> allowPara (anyListUntil parseBlocks <|> amuseNoteBlockUntil parseBlocks)\n    paraStart = do\n      indent <- length <$> many spaceChar\n      uncurry (B.<>) . first (p indent) <$> paraUntil parseBlocks\n      where p indent = if indent >= 2 && indent < 6 then fmap B.blockQuote else id\n\n-- | Parse section that starts with a header\nparseSection :: PandocMonad m\n             => MuseParser m (F Blocks)\nparseSection =\n  ((B.<>) <$> emacsHeading <*> parseBlocks) <|>\n  (uncurry (B.<>) <$> amuseHeadingUntil parseBlocks)\n\nparseBlocksTill :: PandocMonad m\n                => MuseParser m a\n                -> MuseParser m (F Blocks)\nparseBlocksTill end = continuation\n  where\n    parseEnd = mempty <$ end\n    blockStart = (B.<>) <$> blockElements <*> allowPara continuation\n    listStart = uncurry (B.<>) <$> allowPara (anyListUntil (parseEnd <|> continuation))\n    paraStart = uncurry (B.<>) <$> paraUntil (parseEnd <|> continuation)\n    continuation = try $ parseEnd <|> listStart <|> blockStart <|> paraStart\n\nlistItemContentsUntil :: PandocMonad m\n                      => Int\n                      -> MuseParser m a\n                      -> MuseParser m a\n                      -> MuseParser m (F Blocks, a)\nlistItemContentsUntil col pre end = p\n  where\n    p = try listStart <|> try blockStart <|> try paraStart\n    parsePre = (mempty,) <$> pre\n    parseEnd = (mempty,) <$> end\n    paraStart = do\n      (f, (r, e)) <- paraUntil (parsePre <|> continuation <|> parseEnd)\n      return (f B.<> r, e)\n    blockStart = first <$> ((B.<>) <$> blockElements)\n                       <*> allowPara (parsePre <|> continuation <|> parseEnd)\n    listStart = do\n      (f, (r, e)) <- allowPara $ anyListUntil (parsePre <|> continuation <|> parseEnd)\n      return (f B.<> r, e)\n    continuation = try $ do blank <- optionMaybe blankline\n                            skipMany blankline\n                            indentWith col\n                            local (\\s -> s { museInPara = museInPara s && isNothing blank }) p\n\nparseBlock :: PandocMonad m => MuseParser m (F Blocks)\nparseBlock = do\n  res <- blockElements <|> para\n  trace (T.take 60 $ tshow $ B.toList $ runF res def)\n  return res\n  where para = fst <$> paraUntil (try (eof <|> void (lookAhead blockElements)))\n\nblockElements :: PandocMonad m => MuseParser m (F Blocks)\nblockElements = (mempty <$ blankline)\n            <|> comment\n            <|> separator\n            <|> pagebreak\n            <|> example\n            <|> exampleTag\n            <|> literalTag\n            <|> centerTag\n            <|> rightTag\n            <|> quoteTag\n            <|> divTag\n            <|> biblioTag\n            <|> playTag\n            <|> verseTag\n            <|> lineBlock\n            <|> museGridTable\n            <|> table\n            <|> commentTag\n\n-- | Parse a line comment, starting with @;@ in the first column.\ncomment :: PandocMonad m => MuseParser m (F Blocks)\ncomment = try $ mempty\n  <$ firstColumn\n  <* char ';'\n  <* optional (spaceChar *> many (noneOf \"\\n\"))\n  <* eol\n\n-- | Parse a horizontal rule, consisting of 4 or more @\\'-\\'@ characters.\nseparator :: PandocMonad m => MuseParser m (F Blocks)\nseparator = try $ pure B.horizontalRule\n  <$ string \"----\"\n  <* many (char '-')\n  <* many spaceChar\n  <* eol\n\n-- | Parse a page break\npagebreak :: PandocMonad m => MuseParser m (F Blocks)\npagebreak = try $ pure (B.divWith (\"\", [], [(\"style\", \"page-break-before: always;\")]) mempty)\n  <$ count 6 spaceChar\n  <* many spaceChar\n  <* string \"* * * * *\"\n  <* manyTill spaceChar eol\n\nheadingStart :: PandocMonad m => MuseParser m (Text, Int)\nheadingStart = try $ (,)\n  <$> option \"\" (try (parseAnchor <* manyTill spaceChar eol))\n  <*  firstColumn\n  <*> fmap length (many1 $ char '*')\n  <*  spaceChar\n\n-- | Parse a single-line heading.\nemacsHeading :: PandocMonad m => MuseParser m (F Blocks)\nemacsHeading = try $ do\n  guardDisabled Ext_amuse\n  (anchorId, level) <- headingStart\n  content <- trimInlinesF . mconcat <$> manyTill inline eol\n  attr <- registerHeader (anchorId, [], []) (runF content def)\n  return $ B.headerWith attr level <$> content\n\n-- | Parse a multi-line heading.\n-- It is a Text::Amuse extension, Emacs Muse does not allow heading to span multiple lines.\namuseHeadingUntil :: PandocMonad m\n                  => MuseParser m a -- ^ Terminator parser\n                  -> MuseParser m (F Blocks, a)\namuseHeadingUntil end = try $ do\n  guardEnabled Ext_amuse\n  (anchorId, level) <- headingStart\n  (content, e) <- paraContentsUntil end\n  attr <- registerHeader (anchorId, [], []) (runF content def)\n  return (B.headerWith attr level <$> content, e)\n\n-- | Parse an example between @{{{@ and @}}}@.\n-- It is an Amusewiki extension influenced by Creole wiki, as described in @Text::Amuse@ documentation.\nexample :: PandocMonad m => MuseParser m (F Blocks)\nexample = try $ pure . B.codeBlock\n  <$  string \"{{{\"\n  <*  many spaceChar\n  <*> (unindent <$> manyTillChar anyChar (string \"}}}\"))\n\n-- | Parse an @\\<example>@ tag.\nexampleTag :: PandocMonad m => MuseParser m (F Blocks)\nexampleTag = try $ fmap pure $ B.codeBlockWith\n  <$  many spaceChar\n  <*> (htmlAttrToPandoc <$> openTag \"example\")\n  <*> (unindent <$> manyTillChar anyChar (closeTag \"example\"))\n  <*  manyTill spaceChar eol\n\n-- | Parse a @\\<literal>@ tag as a raw block.\n-- For 'RawInline' @\\<literal>@ parser, see 'inlineLiteralTag'.\nliteralTag :: PandocMonad m => MuseParser m (F Blocks)\nliteralTag = try $ fmap pure $ B.rawBlock\n  <$  many spaceChar\n  <*> (fromMaybe \"html\" . lookup \"style\" <$> openTag \"literal\") -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML\n  <*  manyTill spaceChar eol\n  <*> (unindent <$> manyTillChar anyChar (closeTag \"literal\"))\n  <*  manyTill spaceChar eol\n\n-- | Parse @\\<center>@ tag.\n-- Currently it is ignored as Pandoc cannot represent centered blocks.\ncenterTag :: PandocMonad m => MuseParser m (F Blocks)\ncenterTag = snd <$> parseHtmlContent \"center\"\n\n-- | Parse @\\<right>@ tag.\n-- Currently it is ignored as Pandoc cannot represent centered blocks.\nrightTag :: PandocMonad m => MuseParser m (F Blocks)\nrightTag = snd <$> parseHtmlContent \"right\"\n\n-- | Parse @\\<quote>@ tag.\nquoteTag :: PandocMonad m => MuseParser m (F Blocks)\nquoteTag = fmap B.blockQuote . snd <$> parseHtmlContent \"quote\"\n\n-- | Parse @\\<div>@ tag.\n-- @\\<div>@ tag is supported by Emacs Muse, but not Amusewiki 2.025.\ndivTag :: PandocMonad m => MuseParser m (F Blocks)\ndivTag = do\n  (attrs, content) <- parseHtmlContent \"div\"\n  return $ B.divWith attrs <$> content\n\n-- | Parse @\\<biblio>@ tag, the result is the same as @\\<div class=\"biblio\">@.\n-- @\\<biblio>@ tag is supported only in Text::Amuse mode.\nbiblioTag :: PandocMonad m => MuseParser m (F Blocks)\nbiblioTag = fmap (B.divWith (\"\", [\"biblio\"], [])) . snd\n  <$  guardEnabled Ext_amuse\n  <*> parseHtmlContent \"biblio\"\n\n-- | Parse @\\<play>@ tag, the result is the same as @\\<div class=\"play\">@.\n-- @\\<play>@ tag is supported only in Text::Amuse mode.\nplayTag :: PandocMonad m => MuseParser m (F Blocks)\nplayTag = do\n  guardEnabled Ext_amuse\n  fmap (B.divWith (\"\", [\"play\"], [])) . snd <$> parseHtmlContent \"play\"\n\nverseLine :: PandocMonad m => MuseParser m (F Inlines)\nverseLine = (<>)\n  <$> fmap pure (option mempty (B.str <$> many1Char ('\\160' <$ char ' ')))\n  <*> fmap (trimInlinesF . mconcat) (manyTill inline' eol)\n\n-- | Parse @\\<verse>@ tag.\nverseTag :: PandocMonad m => MuseParser m (F Blocks)\nverseTag = try $ getIndent >>= \\indent -> fmap B.lineBlock . sequence\n  <$  openTag \"verse\"\n  <*  manyTill spaceChar eol\n  <*> manyTill (indentWith indent *> verseLine) (try $ indentWith indent *> closeTag \"verse\")\n  <*  manyTill spaceChar eol\n\n-- | Parse @\\<comment>@ tag.\ncommentTag :: PandocMonad m => MuseParser m (F Blocks)\ncommentTag = try $ mempty\n  <$ many spaceChar\n  <* openTag \"comment\"\n  <* manyTill anyChar (closeTag \"comment\")\n  <* manyTill spaceChar eol\n\n-- | Parse paragraph contents.\nparaContentsUntil :: PandocMonad m\n                  => MuseParser m a -- ^ Terminator parser\n                  -> MuseParser m (F Inlines, a)\nparaContentsUntil end = first (trimInlinesF . mconcat)\n  <$> manyUntil inline (try (manyTill spaceChar eol *> local (\\s -> s { museInPara = True}) end))\n\n-- | Parse a paragraph.\nparaUntil :: PandocMonad m\n          => MuseParser m a -- ^ Terminator parser\n          -> MuseParser m (F Blocks, a)\nparaUntil end = do\n  inPara <- asks museInPara\n  guard $ not inPara\n  first (fmap B.para) <$> paraContentsUntil end\n\nnoteMarker' :: PandocMonad m\n            => Char\n            -> Char\n            -> MuseParser m Text\nnoteMarker' l r = try $ (\\x y -> T.pack $ l:x:y ++ [r])\n  <$ char l\n  <*> oneOf \"123456789\"\n  <*> manyTill digit (char r)\n\nnoteMarker :: PandocMonad m => MuseParser m Text\nnoteMarker = noteMarker' '[' ']' <|> noteMarker' '{' '}'\n\naddNote :: PandocMonad m\n        => Text\n        -> SourcePos\n        -> F Blocks\n        -> MuseParser m ()\naddNote ref pos content = do\n  oldnotes <- museNotes <$> getState\n  when (M.member ref oldnotes)\n    (logMessage $ DuplicateNoteReference ref pos)\n  updateState $ \\s -> s{ museNotes = M.insert ref (pos, content) oldnotes }\n\n-- Amusewiki version of note\n-- Parsing is similar to list item, except that note marker is used instead of list marker\namuseNoteBlockUntil :: PandocMonad m\n                    => MuseParser m a\n                    -> MuseParser m (F Blocks, a)\namuseNoteBlockUntil end = try $ do\n  guardEnabled Ext_amuse\n  ref <- noteMarker\n  pos <- getPosition\n  void spaceChar <|> lookAhead eol\n  (content, e) <- allowPara $ listItemContentsUntil (sourceColumn pos) (Prelude.fail \"x\") end\n  addNote ref pos content\n  return (mempty, e)\n\n-- Emacs version of note\n-- Notes are allowed only at the end of text, no indentation is required.\nemacsNoteBlock :: PandocMonad m => MuseParser m (F Blocks)\nemacsNoteBlock = try $ do\n  guardDisabled Ext_amuse\n  ref <- noteMarker\n  pos <- getPosition\n  content <- fmap mconcat blocksTillNote\n  addNote ref pos content\n  return mempty\n  where\n    blocksTillNote =\n      many1Till parseBlock (eof <|> () <$ lookAhead noteMarker)\n\n--\n-- Verse markup\n--\n\n-- | Parse a line block indicated by @\\'>\\'@ characters.\nlineBlock :: PandocMonad m => MuseParser m (F Blocks)\nlineBlock = try $ getIndent >>= \\indent -> fmap B.lineBlock . sequence\n  <$> (blankVerseLine <|> nonblankVerseLine) `sepBy1'` try (indentWith indent)\n  where\n    blankVerseLine = try $ mempty <$ char '>' <* blankline\n    nonblankVerseLine = try (string \"> \") *> verseLine\n\n-- *** List parsers\n\nbulletListItemsUntil :: PandocMonad m\n                     => Int -- ^ Indentation\n                     -> MuseParser m a -- ^ Terminator parser\n                     -> MuseParser m ([F Blocks], a)\nbulletListItemsUntil indent end = try $ do\n  char '-'\n  void spaceChar <|> lookAhead eol\n  (x, (xs, e)) <- allowPara $ listItemContentsUntil (indent + 2) (try (optional blankline *> indentWith indent *> bulletListItemsUntil indent end)) (([],) <$> end)\n  return (x:xs, e)\n\n-- | Parse a bullet list.\nbulletListUntil :: PandocMonad m\n                => MuseParser m a\n                -> MuseParser m (F Blocks, a)\nbulletListUntil end = try $ do\n  indent <- getIndent\n  guard $ indent /= 0\n  first (fmap B.bulletList . sequence) <$> bulletListItemsUntil indent end\n\nmuseOrderedListMarker :: PandocMonad m\n                      => ListNumberStyle\n                      -> MuseParser m Int\nmuseOrderedListMarker style =\n  snd <$> p <* char '.'\n  where p = case style of\n              Decimal    -> decimal\n              UpperRoman -> upperRoman\n              LowerRoman -> lowerRoman\n              UpperAlpha -> upperAlpha\n              LowerAlpha -> lowerAlpha\n              _          -> Prelude.fail \"Unhandled case\"\n\norderedListItemsUntil :: PandocMonad m\n                      => Int\n                      -> ListNumberStyle\n                      -> MuseParser m a\n                      -> MuseParser m ([F Blocks], a)\norderedListItemsUntil indent style end =\n  continuation\n  where\n    continuation = try $ do\n      pos <- getPosition\n      void spaceChar <|> lookAhead eol\n      (x, (xs, e)) <- allowPara $ listItemContentsUntil (sourceColumn pos) (try (optional blankline *> indentWith indent *> museOrderedListMarker style *> continuation)) (([],) <$> end)\n      return (x:xs, e)\n\n-- | Parse an ordered list.\norderedListUntil :: PandocMonad m\n                 => MuseParser m a\n                 -> MuseParser m (F Blocks, a)\norderedListUntil end = try $ do\n  indent <- getIndent\n  guard $ indent /= 0\n  (style, start) <- decimal <|> lowerRoman <|> upperRoman <|> lowerAlpha <|> upperAlpha\n  char '.'\n  first (fmap (B.orderedListWith (start, style, Period)) . sequence)\n    <$> orderedListItemsUntil indent style end\n\ndescriptionsUntil :: PandocMonad m\n                  => Int\n                  -> MuseParser m a\n                  -> MuseParser m ([F Blocks], a)\ndescriptionsUntil indent end = do\n  void spaceChar <|> lookAhead eol\n  (x, (xs, e)) <- allowPara $ listItemContentsUntil indent (try (optional blankline *> indentWith indent *> manyTill spaceChar (string \"::\") *> descriptionsUntil indent end)) (([],) <$> end)\n  return (x:xs, e)\n\ndefinitionListItemsUntil :: PandocMonad m\n                         => Int\n                         -> MuseParser m a\n                         -> MuseParser m ([F (Inlines, [Blocks])], a)\ndefinitionListItemsUntil indent end =\n  continuation\n  where\n    continuation = try $ do\n      pos <- getPosition\n      term <- trimInlinesF . mconcat <$> manyTill inline' (try $ string \"::\")\n      (x, (xs, e)) <- descriptionsUntil (sourceColumn pos) (try (optional blankline *> indentWith indent *> continuation) <|> (([],) <$> end))\n      let xx = (,) <$> term <*> sequence x\n      return (xx:xs, e)\n\n-- | Parse a definition list.\ndefinitionListUntil :: PandocMonad m\n                    => MuseParser m a -- ^ Terminator parser\n                    -> MuseParser m (F Blocks, a)\ndefinitionListUntil end = try $ do\n  indent <- getIndent\n  guardDisabled Ext_amuse <|> guard (indent /= 0) -- Initial space is required by Amusewiki, but not Emacs Muse\n  first (fmap B.definitionList . sequence) <$> definitionListItemsUntil indent end\n\nanyListUntil :: PandocMonad m\n             => MuseParser m a -- ^ Terminator parser\n             -> MuseParser m (F Blocks, a)\nanyListUntil end =\n  bulletListUntil end <|> orderedListUntil end <|> definitionListUntil end\n\n-- *** Table parsers\n\n-- | Internal Muse table representation.\ndata MuseTable = MuseTable\n  { museTableCaption :: Inlines\n  , museTableHeaders :: [[Blocks]]\n  , museTableRows    :: [[Blocks]]\n  , museTableFooters :: [[Blocks]]\n  }\n\ndata MuseTableElement = MuseHeaderRow [Blocks]\n                      | MuseBodyRow [Blocks]\n                      | MuseFooterRow [Blocks]\n                      | MuseCaption Inlines\n\nmuseToPandocTable :: MuseTable -> Blocks\nmuseToPandocTable (MuseTable caption headers body footers) =\n  B.table (B.simpleCaption $ B.plain caption)\n          attrs\n          (TableHead nullAttr $ toHeaderRow headRow)\n          [TableBody nullAttr 0 [] $ map toRow $ rows ++ body ++ footers]\n          (TableFoot nullAttr [])\n  where attrs = (AlignDefault, ColWidthDefault) <$ transpose (headers ++ body ++ footers)\n        (headRow, rows) =\n          case headers of\n            (r:rs) -> (r, rs)\n            []     -> ([], [])\n        toRow = Row nullAttr . map B.simpleCell\n        toHeaderRow l = [toRow l | not (null l)]\n\nmuseAppendElement :: MuseTableElement\n                  -> MuseTable\n                  -> MuseTable\nmuseAppendElement element tbl =\n  case element of\n    MuseHeaderRow row -> tbl{ museTableHeaders = row : museTableHeaders tbl }\n    MuseBodyRow row -> tbl{ museTableRows = row : museTableRows tbl }\n    MuseFooterRow row -> tbl{ museTableFooters = row : museTableFooters tbl }\n    MuseCaption inlines -> tbl{ museTableCaption = inlines }\n\ntableElements :: PandocMonad m => MuseParser m (F [MuseTableElement])\ntableElements = sequence <$> many1 tableParseElement\n\nelementsToTable :: [MuseTableElement] -> MuseTable\nelementsToTable = foldr museAppendElement emptyTable\n  where emptyTable = MuseTable mempty mempty mempty mempty\n\nmuseGridPart :: PandocMonad m => MuseParser m Int\nmuseGridPart = try $ length <$> many1 (char '-') <* char '+'\n\nmuseGridTableHeader :: PandocMonad m => MuseParser m [Int]\nmuseGridTableHeader = try $ char '+' *> many1 museGridPart <* manyTill spaceChar eol\n\nmuseGridTableRow :: PandocMonad m\n                 => Int\n                 -> [Int]\n                 -> MuseParser m (F [Blocks])\nmuseGridTableRow indent indices = try $ do\n  lns <- many1 $ try (indentWith indent *> museGridTableRawLine indices)\n  let cols = map (T.unlines . map trimr) $ transpose lns\n  indentWith indent *> museGridTableHeader\n  sequence <$> mapM (parseFromString' parseBlocks) cols\n\nmuseGridTableRawLine :: PandocMonad m\n                     => [Int]\n                     -> MuseParser m [Text]\nmuseGridTableRawLine indices =\n  char '|' *> forM indices (\\n -> countChar n anyChar <* char '|') <* manyTill spaceChar eol\n\nmuseGridTable :: PandocMonad m => MuseParser m (F Blocks)\nmuseGridTable = try $ do\n  indent <- getIndent\n  indices <- museGridTableHeader\n  fmap rowsToTable . sequence <$> many1 (museGridTableRow indent indices)\n  where rowsToTable rows = B.table B.emptyCaption\n                                   attrs\n                                   (TableHead nullAttr [])\n                                   [TableBody nullAttr 0 [] $ map toRow rows]\n                                   (TableFoot nullAttr [])\n                           where attrs = (AlignDefault, ColWidthDefault) <$ transpose rows\n                                 toRow = Row nullAttr . map B.simpleCell\n\n-- | Parse a table.\ntable :: PandocMonad m => MuseParser m (F Blocks)\ntable = try $ fmap (museToPandocTable . elementsToTable) <$> tableElements\n\ntableParseElement :: PandocMonad m => MuseParser m (F MuseTableElement)\ntableParseElement = tableParseHeader\n                <|> tableParseBody\n                <|> tableParseFooter\n                <|> tableParseCaption\n\ntableParseRow :: PandocMonad m\n              => Int -- ^ Number of separator characters\n              -> MuseParser m (F [Blocks])\ntableParseRow n = try $ sequence <$> tableCells\n  where tableCells = (:) <$> tableCell sep <*> (tableCells <|> fmap pure (tableCell eol))\n        tableCell p = try $ fmap B.plain . trimInlinesF . mconcat <$> manyTill inline' p\n        sep = try $ many1 spaceChar *> count n (char '|') *> lookAhead (void (many1 spaceChar) <|> void eol)\n\n-- | Parse a table header row.\ntableParseHeader :: PandocMonad m => MuseParser m (F MuseTableElement)\ntableParseHeader = fmap MuseHeaderRow <$> tableParseRow 2\n\n-- | Parse a table body row.\ntableParseBody :: PandocMonad m => MuseParser m (F MuseTableElement)\ntableParseBody = fmap MuseBodyRow <$> tableParseRow 1\n\n-- | Parse a table footer row.\ntableParseFooter :: PandocMonad m => MuseParser m (F MuseTableElement)\ntableParseFooter = fmap MuseFooterRow <$> tableParseRow 3\n\n-- | Parse table caption.\ntableParseCaption :: PandocMonad m => MuseParser m (F MuseTableElement)\ntableParseCaption = try $ fmap MuseCaption . trimInlinesF . mconcat\n  <$  many spaceChar\n  <*  string \"|+\"\n  <*> many1Till inline (try $ string \"+|\" *> eol)\n\n-- ** Inline parsers\n\ninline' :: PandocMonad m => MuseParser m (F Inlines)\ninline' = whitespace\n      <|> br\n      <|> anchor\n      <|> footnote\n      <|> strongEmph\n      <|> strong\n      <|> strongTag\n      <|> emph\n      <|> emphTag\n      <|> underlined\n      <|> superscriptTag\n      <|> subscriptTag\n      <|> strikeoutTag\n      <|> verbatimTag\n      <|> classTag\n      <|> inlineRtl\n      <|> inlineLtr\n      <|> nbsp\n      <|> linkOrImage\n      <|> code\n      <|> codeTag\n      <|> mathTag\n      <|> inlineLiteralTag\n      <|> str\n      <|> asterisks\n      <|> symbol\n      <?> \"inline\"\n\ninline :: PandocMonad m => MuseParser m (F Inlines)\ninline = endline <|> inline'\n\n-- | Parse a soft break.\nendline :: PandocMonad m => MuseParser m (F Inlines)\nendline = try $ pure B.softbreak <$ newline <* notFollowedBy blankline <* updateLastSpacePos\n\nparseAnchor :: PandocMonad m => MuseParser m Text\nparseAnchor = try $ T.cons\n  <$  firstColumn\n  <*  char '#'\n  <*> letter\n  <*> manyChar (letter <|> digit <|> char '-')\n\nanchor :: PandocMonad m => MuseParser m (F Inlines)\nanchor = try $ do\n  anchorId <- parseAnchor\n  skipMany spaceChar <|> void newline\n  return $ return $ B.spanWith (anchorId, [], []) mempty\n\n-- | Parse a footnote reference.\nfootnote :: PandocMonad m => MuseParser m (F Inlines)\nfootnote = try $ do\n  inLink <- asks museInLink\n  guard $ not inLink\n  ref <- noteMarker\n  return $ do\n    notes <- asksF museNotes\n    case M.lookup ref notes of\n      Nothing -> return $ B.str ref\n      Just (_pos, contents) -> do\n        st <- askF\n        let contents' = runF contents st { museNotes = M.delete ref (museNotes st) }\n        return $ B.note contents'\n\nwhitespace :: PandocMonad m => MuseParser m (F Inlines)\nwhitespace = try $ pure B.space <$ skipMany1 spaceChar <* updateLastSpacePos\n\n-- | Parse @\\<br>@ tag.\nbr :: PandocMonad m => MuseParser m (F Inlines)\nbr = try $ pure B.linebreak <$ string \"<br>\"\n\nemphasisBetween :: (PandocMonad m, Show a)\n                => MuseParser m a\n                -> MuseParser m (F Inlines)\nemphasisBetween p = try $ trimInlinesF . mconcat\n  <$  atStart\n  <*  p\n  <*  notFollowedBy space\n  <*> many1Till inline (try $ noSpaceBefore *> p <* notFollowedBy alphaNum)\n\n-- | Parse an inline tag, such as @\\<em>@ and @\\<strong>@.\ninlineTag :: PandocMonad m\n          => Text -- ^ Tag name\n          -> MuseParser m (F Inlines)\ninlineTag tag = try $ mconcat\n  <$  openTag tag\n  <*> manyTill inline (closeTag tag)\n\n-- | Parse strong emphasis inline markup, indicated by @***@.\nstrongEmph :: PandocMonad m => MuseParser m (F Inlines)\nstrongEmph = fmap (B.strong . B.emph) <$> emphasisBetween (string \"***\" <* notFollowedBy (char '*'))\n\n-- | Parse strong inline markup, indicated by @**@.\nstrong :: PandocMonad m => MuseParser m (F Inlines)\nstrong = fmap B.strong <$> emphasisBetween (string \"**\" <* notFollowedBy (char '*'))\n\n-- | Parse emphasis inline markup, indicated by @*@.\nemph :: PandocMonad m => MuseParser m (F Inlines)\nemph = fmap B.emph <$> emphasisBetween (char '*' <* notFollowedBy (char '*'))\n\n-- | Parse underline inline markup, indicated by @_@.\n-- Supported only in Emacs Muse mode, not Text::Amuse.\nunderlined :: PandocMonad m => MuseParser m (F Inlines)\nunderlined = fmap underline\n  <$  guardDisabled Ext_amuse -- Supported only by Emacs Muse\n  <*> emphasisBetween (char '_')\n\n-- | Parse @\\<strong>@ tag.\nstrongTag :: PandocMonad m => MuseParser m (F Inlines)\nstrongTag = fmap B.strong <$> inlineTag \"strong\"\n\n-- | Parse @\\<em>@ tag.\nemphTag :: PandocMonad m => MuseParser m (F Inlines)\nemphTag = fmap B.emph <$> inlineTag \"em\"\n\n-- | Parse @\\<sup>@ tag.\nsuperscriptTag :: PandocMonad m => MuseParser m (F Inlines)\nsuperscriptTag = fmap B.superscript <$> inlineTag \"sup\"\n\n-- | Parse @\\<sub>@ tag.\nsubscriptTag :: PandocMonad m => MuseParser m (F Inlines)\nsubscriptTag = fmap B.subscript <$> inlineTag \"sub\"\n\n-- | Parse @\\<del>@ tag.\nstrikeoutTag :: PandocMonad m => MuseParser m (F Inlines)\nstrikeoutTag = fmap B.strikeout <$> inlineTag \"del\"\n\n-- | Parse @\\<verbatim>@ tag.\nverbatimTag :: PandocMonad m => MuseParser m (F Inlines)\nverbatimTag = return . B.text\n  <$  openTag \"verbatim\"\n  <*> manyTillChar anyChar (closeTag \"verbatim\")\n\n-- | Parse @\\<class>@ tag.\nclassTag :: PandocMonad m => MuseParser m (F Inlines)\nclassTag = do\n  classes <- maybe [] T.words . lookup \"name\" <$> openTag \"class\"\n  fmap (B.spanWith (\"\", classes, [])) . mconcat <$> manyTill inline (closeTag \"class\")\n\n-- | Parse @\\<\\<\\<RTL>>>@ text.\ninlineRtl :: PandocMonad m => MuseParser m (F Inlines)\ninlineRtl = try $\n  fmap (B.spanWith (\"\", [], [(\"dir\", \"rtl\")])) . mconcat <$ string \"<<<\" <*> manyTill inline (string \">>>\")\n\n-- | Parse @\\<\\<\\<LTR>>>@ text.\ninlineLtr :: PandocMonad m => MuseParser m (F Inlines)\ninlineLtr = try $\n  fmap (B.spanWith (\"\", [], [(\"dir\", \"ltr\")])) . mconcat <$ string \">>>\" <*> manyTill inline (string \"<<<\")\n\n-- | Parse \"~~\" as nonbreaking space.\nnbsp :: PandocMonad m => MuseParser m (F Inlines)\nnbsp = try $ pure (B.str \"\\160\") <$ string \"~~\"\n\n-- | Parse code markup, indicated by @\\'=\\'@ characters.\ncode :: PandocMonad m => MuseParser m (F Inlines)\ncode = try $ fmap pure $ B.code . uncurry (<>)\n  <$  atStart\n  <*  char '='\n  <*  notFollowedBy (spaceChar <|> newline)\n  <*> manyUntilChar (noneOf \"\\n\\r\" <|> (newline <* notFollowedBy newline)) (try $ fmap T.singleton $ noneOf \" \\t\\n\\r=\" <* char '=')\n  <*  notFollowedBy alphaNum\n\n-- | Parse @\\<code>@ tag.\ncodeTag :: PandocMonad m => MuseParser m (F Inlines)\ncodeTag = fmap pure $ B.codeWith\n  <$> (htmlAttrToPandoc <$> openTag \"code\")\n  <*> manyTillChar anyChar (closeTag \"code\")\n\n-- | Parse @\\<math>@ tag.\n-- @\\<math>@ tag is an Emacs Muse extension enabled by @(require 'muse-latex2png)@\nmathTag :: PandocMonad m => MuseParser m (F Inlines)\nmathTag = return . B.math\n  <$  openTag \"math\"\n  <*> manyTillChar anyChar (closeTag \"math\")\n\n-- | Parse inline @\\<literal>@ tag as a raw inline.\ninlineLiteralTag :: PandocMonad m => MuseParser m (F Inlines)\ninlineLiteralTag = try $ fmap pure $ B.rawInline\n  <$> (fromMaybe \"html\" . lookup \"style\" <$> openTag \"literal\") -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML\n  <*> manyTillChar anyChar (closeTag \"literal\")\n\nstr :: PandocMonad m => MuseParser m (F Inlines)\nstr = return . B.str <$> many1Char alphaNum <* updateLastStrPos\n\n-- | Consume asterisks that were not used as emphasis opening.\n-- This prevents series of asterisks from being split into\n-- literal asterisk and emphasis opening.\nasterisks :: PandocMonad m => MuseParser m (F Inlines)\nasterisks = pure . B.str <$> many1Char (char '*')\n\nsymbol :: PandocMonad m => MuseParser m (F Inlines)\nsymbol = pure . B.str . T.singleton <$> nonspaceChar\n\n-- | Parse a link or image.\nlinkOrImage :: PandocMonad m => MuseParser m (F Inlines)\nlinkOrImage = try $ link \"URL:\" <|> image <|> link \"\"\n\nlinkContent :: PandocMonad m => MuseParser m (F Inlines)\nlinkContent = trimInlinesF . mconcat\n  <$  char '['\n  <*> manyTill inline (char ']')\n\n-- | Parse a link starting with (possibly null) prefix\nlink :: PandocMonad m => Text -> MuseParser m (F Inlines)\nlink prefix = try $ do\n  inLink <- asks museInLink\n  guard $ not inLink\n  textStr $ \"[[\" <> prefix\n  url <- manyTillChar anyChar $ char ']'\n  content <- option (pure $ B.str url) (local (\\s -> s { museInLink = True }) linkContent)\n  char ']'\n  return $ B.link url \"\" <$> content\n\nimage :: PandocMonad m => MuseParser m (F Inlines)\nimage = try $ do\n  string \"[[\"\n  (url, (ext, width, align)) <- manyUntilChar (noneOf \"]\") (imageExtensionAndOptions <* char ']')\n  content <- option mempty linkContent\n  char ']'\n  let widthAttr = case align of\n                    Just 'f' -> [(\"width\", fromMaybe \"100\" width <> \"%\"), (\"height\", \"75%\")]\n                    _ -> maybeToList ((\"width\",) . (<> \"%\") <$> width)\n  let alignClass = case align of\n                     Just 'r' -> [\"align-right\"]\n                     Just 'l' -> [\"align-left\"]\n                     Just 'f' -> []\n                     _        -> []\n  return $ B.imageWith (\"\", alignClass, widthAttr) (url <> ext) mempty <$> content\n  where -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el\n        imageExtensions = [\".eps\", \".gif\", \".jpg\", \".jpeg\", \".pbm\", \".png\", \".tiff\", \".xbm\", \".xpm\"]\n        imageExtension = choice (try . textStr <$> imageExtensions)\n        imageExtensionAndOptions = do\n          ext <- imageExtension\n          (width, align) <- option (Nothing, Nothing) imageAttrs\n          return (ext, width, align)\n        imageAttrs = (,)\n          <$  many1 spaceChar\n          <*> optionMaybe (many1Char digit)\n          <*  many spaceChar\n          <*> optionMaybe (oneOf \"rlf\")\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Native.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Native\n   Copyright   : Copyright (C) 2011-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of a string representation of a pandoc type (@Pandoc@,\n@[Block]@, @Block@, @[Inline]@, or @Inline@) to a @Pandoc@ document.\n-}\nmodule Text.Pandoc.Readers.Native ( readNative ) where\n\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Shared (safeRead)\n\nimport Control.Monad.Except (throwError)\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\n\n-- | Read native formatted text and return a Pandoc document.\n-- The input may be a full pandoc document, a block list, a block,\n-- an inline list, or an inline.  Thus, for example,\n--\n-- > Str \"hi\"\n--\n-- will be treated as if it were\n--\n-- > Pandoc nullMeta [Plain [Str \"hi\"]]\n--\nreadNative :: (PandocMonad m, ToSources a)\n           => ReaderOptions\n           -> a\n           -> m Pandoc\nreadNative _ s =\n  let t = sourcesToText . toSources $ s\n  in  case maybe (Pandoc nullMeta <$> readBlocks t) Right (safeRead t) of\n        Right doc -> return doc\n        Left _    -> throwError $ PandocParseError \"couldn't read native\"\n\nreadBlocks :: Text -> Either PandocError [Block]\nreadBlocks s = maybe ((:[]) <$> readBlock s) Right (safeRead s)\n\nreadBlock :: Text -> Either PandocError Block\nreadBlock s = maybe (Plain <$> readInlines s) Right (safeRead s)\n\nreadInlines :: Text -> Either PandocError [Inline]\nreadInlines s = maybe ((:[]) <$> readInline s) Right (safeRead s)\n\nreadInline :: Text -> Either PandocError Inline\nreadInline s = maybe (Left . PandocParseError $ \"Could not read: \" <> s) Right (safeRead s)\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Arrows/State.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE TupleSections     #-}\n{- |\n   Module      : Text.Pandoc.Readers.ODT.Arrows.State\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nAn arrow that transports a state. It is in essence a more powerful version of\nthe standard state monad. As it is such a simple extension, there are\nother version out there that do exactly the same.\nThe implementation is duplicated, though, to add some useful features.\nMost of these might be implemented without access to innards, but it's much\nfaster and easier to implement this way.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Arrows.State\n  ( ArrowState(..)\n  , withState\n  , modifyState\n  , ignoringState\n  , fromState\n  , extractFromState\n  , tryModifyState\n  , withSubStateF\n  , withSubStateF'\n  , foldS\n  , iterateS\n  , iterateSL\n  , iterateS'\n  ) where\n\nimport qualified Data.List as L\nimport Control.Arrow\nimport qualified Control.Category as Cat\nimport Control.Monad\nimport Text.Pandoc.Readers.ODT.Arrows.Utils\nimport Text.Pandoc.Readers.ODT.Generic.Fallible\n\n\nnewtype ArrowState state a b = ArrowState\n  { runArrowState :: (state, a) -> (state, b) }\n\n-- | Constructor\nwithState           :: (state -> a -> (state, b)) -> ArrowState state a b\nwithState            = ArrowState . uncurry\n\n-- | Constructor\nmodifyState         :: (state      ->  state    ) -> ArrowState state a a\nmodifyState          = ArrowState . first\n\n-- | Constructor\nignoringState       :: (         a ->         b ) -> ArrowState state a b\nignoringState        = ArrowState . second\n\n-- | Constructor\nfromState           :: (state      -> (state, b)) -> ArrowState state a b\nfromState            = ArrowState . (.fst)\n\n-- | Constructor\nextractFromState    :: (state      ->         b ) -> ArrowState state x b\nextractFromState   f = ArrowState $ \\(state,_) -> (state, f state)\n\n-- | Constructor\ntryModifyState      :: (state ->  Either f state)\n                    -> ArrowState state a (Either f a)\ntryModifyState     f = ArrowState $ \\(state,a)\n                                  -> (state,).Left ||| (,Right a) $ f state\n\ninstance Cat.Category (ArrowState s) where\n  id                = ArrowState id\n  arrow2 . arrow1   = ArrowState $ runArrowState arrow2 . runArrowState arrow1\n\ninstance Arrow (ArrowState state) where\n  arr               = ignoringState\n  first  a          = ArrowState $ \\(s,(aF,aS))\n                                    -> second (,aS) $ runArrowState a (s,aF)\n  second a          = ArrowState $ \\(s,(aF,aS))\n                                    -> second (aF,) $ runArrowState a (s,aS)\n\ninstance ArrowChoice (ArrowState state) where\n  left   a          = ArrowState $ \\(s,e) -> case e of\n                                 Left  l -> second Left  $ runArrowState a (s,l)\n                                 Right r -> (s, Right r)\n  right  a          = ArrowState $ \\(s,e) -> case e of\n                                 Left  l -> (s, Left l)\n                                 Right r -> second Right $ runArrowState a (s,r)\n\ninstance ArrowApply (ArrowState state) where\n   app             = ArrowState $ \\(s, (f,b)) -> runArrowState f (s,b)\n\n-- | Switches the type of the state temporarily.\n-- Drops the intermediate result state, behaving like a fallible\n-- identity arrow, save for side effects in the state.\nwithSubStateF  :: ArrowState s  x (Either f s')\n               -> ArrowState s' s (Either f s )\n               -> ArrowState s  x (Either f x )\nwithSubStateF  unlift a = keepingTheValue (withSubStateF' unlift a)\n                          >>^ spreadChoice\n                          >>^ fmap fst\n\n-- | Switches the type of the state temporarily.\n-- Returns the resulting sub-state.\nwithSubStateF' :: ArrowState s  x (Either f s')\n               -> ArrowState s' s (Either f s )\n               -> ArrowState s  x (Either f s')\nwithSubStateF' unlift a = ArrowState go\n  where go p@(s,_) = tryRunning unlift\n                                ( tryRunning a (second Right) )\n                                p\n          where tryRunning a' b v = case runArrowState a' v of\n                                      (_ , Left  f) -> (s, Left f)\n                                      (x , Right y) -> b (y,x)\n\n-- | Fold a state arrow through something 'Foldable'. Collect the results\n-- in a 'Monoid'.\n-- Intermediate form of a fold between one with \"only\" a 'Monoid'\n-- and one with any function.\nfoldS :: (Foldable f, Monoid m) => ArrowState s x m -> ArrowState s (f x) m\nfoldS a = ArrowState $ \\(s,f) -> foldr a' (s,mempty) f\n  where a' x (s',m) = second (mappend m)  $ runArrowState a (s',x)\n\n-- | Fold a state arrow through something 'Foldable'. Collect the results in a\n-- 'MonadPlus'.\niterateS :: (Foldable f, MonadPlus m)\n         => ArrowState s    x     y\n         -> ArrowState s (f x) (m y)\niterateS a = ArrowState $ \\(s,f) -> foldr a' (s,mzero) f\n  where a' x (s',m) = second (mplus m.return) $ runArrowState a (s',x)\n\n-- | Fold a state arrow through something 'Foldable'. Collect the results in a\n-- 'MonadPlus'.\niterateSL :: (Foldable f, MonadPlus m)\n          => ArrowState s    x     y\n          -> ArrowState s (f x) (m y)\niterateSL a = ArrowState $ \\(s,f) -> L.foldl' a' (s,mzero) f\n  where a' (s',m) x = second (mplus m.return) $ runArrowState a (s',x)\n\n\n-- | Fold a fallible state arrow through something 'Foldable'.\n-- Collect the results in a 'MonadPlus'.\n-- If the iteration fails, the state will be reset to the initial one.\niterateS' :: (Foldable f, MonadPlus m)\n          => ArrowState s    x  (Either e    y )\n          -> ArrowState s (f x) (Either e (m y))\niterateS' a = ArrowState $ \\(s,f) -> foldr (a' s) (s,Right mzero) f\n  where a' s x (s',Right m) = case runArrowState a (s',x) of\n                                (s'',Right m') -> (s'',Right $ mplus m $ return m')\n                                (_  ,Left  e ) -> (s  ,Left  e )\n        a' _ _   e          = e\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Arrows/Utils.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.ODT.Arrows.Utils\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nUtility functions for Arrows (Kleisli monads).\n\nSome general notes on notation:\n\n* \"^\" is meant to stand for a pure function that is lifted into an arrow\nbased on its usage for that purpose in \"Control.Arrow\".\n* \"?\" is meant to stand for the usage of a 'FallibleArrow' or a pure function\nwith an equivalent return value.\n* \"_\" stands for the dropping of a value.\n-}\n\n-- We export everything\nmodule Text.Pandoc.Readers.ODT.Arrows.Utils\n  ( and2\n  , and3\n  , and4\n  , and5\n  , and6\n  , liftA2\n  , liftA3\n  , liftA4\n  , liftA5\n  , liftA6\n  , liftA\n  , duplicate\n  , (>>%)\n  , keepingTheValue\n  , (^|||)\n  , (|||^)\n  , (^|||^)\n  , (^&&&)\n  , (&&&^)\n  , choiceToMaybe\n  , maybeToChoice\n  , returnV\n  , FallibleArrow\n  , liftAsSuccess\n  , (>>?)\n  , (>>?^)\n  , (>>?^?)\n  , (^>>?)\n  , (>>?!)\n  , (>>?%)\n  , (>>?%?)\n  , ifFailedDo\n  ) where\n\nimport Prelude hiding (Applicative(..))\nimport Control.Arrow\nimport Control.Monad (join)\n\nimport Text.Pandoc.Readers.ODT.Generic.Fallible\nimport Text.Pandoc.Readers.ODT.Generic.Utils\n\nand2 :: (Arrow a) => a b c -> a b c' -> a b (c,c')\nand2 = (&&&)\n\nand3 :: (Arrow a)\n     => a b c0->a b c1->a b c2\n     -> a b (c0,c1,c2               )\nand4 :: (Arrow a)\n     => a b c0->a b c1->a b c2->a b c3\n     -> a b (c0,c1,c2,c3            )\nand5 :: (Arrow a)\n     => a b c0->a b c1->a b c2->a b c3->a b c4\n     -> a b (c0,c1,c2,c3,c4         )\nand6 :: (Arrow a)\n     => a b c0->a b c1->a b c2->a b c3->a b c4->a b c5\n     -> a b (c0,c1,c2,c3,c4,c5      )\n\nand3 a b c           = and2 a b &&& c\n                       >>^ \\((z,y          ) , x) -> (z,y,x          )\nand4 a b c d         = and3 a b c &&& d\n                       >>^ \\((z,y,x        ) , w) -> (z,y,x,w        )\nand5 a b c d e       = and4 a b c d &&& e\n                       >>^ \\((z,y,x,w      ) , v) -> (z,y,x,w,v      )\nand6 a b c d e f     = and5 a b c d e &&& f\n                       >>^ \\((z,y,x,w,v    ) , u) -> (z,y,x,w,v,u    )\n\nliftA2 :: (Arrow a) => (x -> y -> z) -> a b x -> a b y -> a b z\nliftA2 f a b = a &&& b >>^ uncurry f\n\nliftA3 :: (Arrow a) => (z->y->x                -> r)\n                    -> a b z->a b y->a b x\n                    -> a b r\nliftA4 :: (Arrow a) => (z->y->x->w             -> r)\n                    -> a b z->a b y->a b x->a b w\n                    -> a b r\nliftA5 :: (Arrow a) => (z->y->x->w->v          -> r)\n                    -> a b z->a b y->a b x->a b w->a b v\n                    -> a b r\nliftA6 :: (Arrow a) => (z->y->x->w->v->u       -> r)\n                    -> a b z->a b y->a b x->a b w->a b v->a b u\n                    -> a b r\n\nliftA3 fun a b c           = and3 a b c           >>^ uncurry3 fun\nliftA4 fun a b c d         = and4 a b c d         >>^ uncurry4 fun\nliftA5 fun a b c d e       = and5 a b c d e       >>^ uncurry5 fun\nliftA6 fun a b c d e f     = and6 a b c d e f     >>^ uncurry6 fun\n\nliftA :: (Arrow a) => (y -> z) -> a b y -> a b z\nliftA  fun a = a >>^ fun\n\n\n-- | Duplicate a value to subsequently feed it into different arrows.\n-- Can almost always be replaced with '(&&&)', 'keepingTheValue',\n-- or even '(|||)'.\n-- Equivalent to\n-- > returnA &&& returnA\nduplicate :: (Arrow a) => a b (b,b)\nduplicate = arr $ join (,)\n\n-- | Applies a function to the uncurried result-pair of an arrow-application.\n-- (The %-symbol was chosen to evoke an association with pairs.)\n(>>%) :: (Arrow a) => a x (b,c) -> (b -> c -> d) -> a x d\na >>% f = a >>^ uncurry f\n\ninfixr 2 >>%\n\n\n-- | Duplicate a value and apply an arrow to the second instance.\n-- Equivalent to\n-- > \\a -> duplicate >>> second a\n-- or\n-- > \\a -> returnA &&& a\nkeepingTheValue :: (Arrow a) => a b c -> a b (b,c)\nkeepingTheValue a = returnA &&& a\n\n( ^|||  ) :: (ArrowChoice a) => (b -> d) ->  a c d   -> a (Either b c) d\n(  |||^ ) :: (ArrowChoice a) =>  a b d   -> (c -> d) -> a (Either b c) d\n( ^|||^ ) :: (ArrowChoice a) => (b -> d) -> (c -> d) -> a (Either b c) d\n\nl ^|||  r  = arr l |||     r\nl  |||^ r  =     l ||| arr r\nl ^|||^ r  = arr l ||| arr r\n\ninfixr 2 ^||| ,  |||^, ^|||^\n\n( ^&&&  ) :: (Arrow a) => (b -> c) ->  a b c'   -> a b (c,c')\n(  &&&^ ) :: (Arrow a) =>  a b c   -> (b -> c') -> a b (c,c')\n\nl ^&&&  r = arr l &&&     r\nl  &&&^ r =     l &&& arr r\n\ninfixr 3 ^&&&, &&&^\n\n\n-- | Converts @Right a@ into @Just a@ and @Left _@ into @Nothing@.\nchoiceToMaybe :: (ArrowChoice a) => a (Either l r) (Maybe r)\nchoiceToMaybe = arr eitherToMaybe\n\n-- | Converts @Nothing@ into @Left ()@ and @Just a@ into @Right a@.\nmaybeToChoice :: (ArrowChoice a) => a (Maybe b) (Fallible b)\nmaybeToChoice = arr maybeToEither\n\n-- | Lifts a constant value into an arrow\nreturnV :: (Arrow a) => c -> a x c\nreturnV = arr.const\n\n-- | Defines Left as failure, Right as success\ntype FallibleArrow a input failure success = a input (Either failure success)\n\n--\nliftAsSuccess     :: (ArrowChoice a)\n                  => a x success\n                  -> FallibleArrow a x failure success\nliftAsSuccess a   = a >>^ Right\n\n-- | Execute the second arrow if the first succeeds\n(>>?) :: (ArrowChoice a)\n            => FallibleArrow a x       failure success\n            -> FallibleArrow a success failure success'\n            -> FallibleArrow a x       failure success'\na >>? b = a >>> Left ^||| b\n\n-- | Execute the lifted second arrow if the first succeeds\n(>>?^) :: (ArrowChoice a)\n            => FallibleArrow a x       failure success\n            -> (success                     -> success')\n            -> FallibleArrow a x       failure success'\na >>?^ f = a >>^ Left ^|||^ Right . f\n\n-- | Execute the lifted second arrow if the first succeeds\n(>>?^?) :: (ArrowChoice a)\n            => FallibleArrow a x       failure success\n            -> (success      -> Either failure success')\n            -> FallibleArrow a x       failure success'\na >>?^? b = a >>> Left ^|||^ b\n\n-- | Execute the second arrow if the lifted first arrow succeeds\n(^>>?) :: (ArrowChoice a)\n            => (x            -> Either failure success)\n            -> FallibleArrow a success failure success'\n            -> FallibleArrow a x       failure success'\na ^>>? b = a ^>> Left ^||| b\n\n-- | Execute the second, non-fallible arrow if the first arrow succeeds\n(>>?!) :: (ArrowChoice a)\n            => FallibleArrow a x       failure success\n            ->               a success         success'\n            -> FallibleArrow a x       failure success'\na >>?! f = a >>> right f\n\n---\n(>>?%) :: (ArrowChoice a)\n          => FallibleArrow a x f (b,b')\n          -> (b -> b' -> c)\n          -> FallibleArrow a x f c\na >>?% f = a >>?^ uncurry f\n\n\n---\n(>>?%?) :: (ArrowChoice a)\n           => FallibleArrow a x f (b,b')\n           -> (b -> b' -> Either f c)\n           -> FallibleArrow a x f c\na >>?%? f = a >>?^? uncurry f\n\ninfixr 1  >>?,  >>?^,  >>?^?\ninfixr 1 ^>>?, >>?!\ninfixr 1 >>?%, >>?%?\n\n-- | An arrow version of a short-circuit (<|>)\nifFailedDo :: (ArrowChoice a)\n           => FallibleArrow a x f y\n           -> FallibleArrow a x f y\n           -> FallibleArrow a x f y\nifFailedDo a b = keepingTheValue a >>> repackage ^>> (b |||^ Right)\n  where repackage (x , Left  _) = Left  x\n        repackage (_ , Right y) = Right y\n\ninfixr 1 `ifFailedDo`\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Base.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.ODT.Base\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nCore types of the odt reader.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Base\n  ( ODTConverterState\n  , XMLReader\n  , XMLReaderSafe\n  ) where\n\nimport Text.Pandoc.Readers.ODT.Generic.XMLConverter\nimport Text.Pandoc.Readers.ODT.Namespaces\n\ntype ODTConverterState s = XMLConverterState Namespace s\n\ntype XMLReader     s a b = FallibleXMLConverter Namespace s a b\n\ntype XMLReaderSafe s a b =         XMLConverter Namespace s a b\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/ContentReader.hs",
    "content": "{-# LANGUAGE Arrows            #-}\n{-# LANGUAGE CPP               #-}\n{-# LANGUAGE DeriveFoldable    #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE PatternGuards     #-}\n{-# LANGUAGE RecordWildCards   #-}\n{-# LANGUAGE TupleSections     #-}\n{-# LANGUAGE ViewPatterns      #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.ODT.ContentReader\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nThe core of the odt reader that converts odt features into Pandoc types.\n-}\n\nmodule Text.Pandoc.Readers.ODT.ContentReader\n( readerState\n, read_body\n) where\n\nimport Prelude hiding (Applicative(..))\nimport Control.Applicative hiding (liftA, liftA2, liftA3)\nimport Control.Arrow\nimport Control.Monad ((<=<))\n\nimport qualified Data.ByteString.Lazy as B\nimport Data.Foldable (fold)\nimport Data.List (find)\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.Maybe\nimport Data.Monoid (Alt (..))\n\nimport Text.TeXMath (readMathML, writeTeX)\nimport qualified Text.Pandoc.XML.Light as XML\n\nimport Text.Pandoc.Builder hiding (underline)\nimport Text.Pandoc.MediaBag (MediaBag, insertMedia)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Extensions (extensionsFromList, Extension(..))\nimport qualified Text.Pandoc.UTF8 as UTF8\n\nimport Text.Pandoc.Readers.Docx.Combine (combineBlocks)\n\nimport Text.Pandoc.Readers.ODT.Base\nimport Text.Pandoc.Readers.ODT.Namespaces\nimport Text.Pandoc.Readers.ODT.StyleReader\n\nimport Text.Pandoc.Readers.ODT.Arrows.State (foldS)\nimport Text.Pandoc.Readers.ODT.Arrows.Utils\nimport Text.Pandoc.Readers.ODT.Generic.Fallible\nimport Text.Pandoc.Readers.ODT.Generic.Utils\nimport Text.Pandoc.Readers.ODT.Generic.XMLConverter\n\nimport Network.URI (parseRelativeReference, URI(uriPath))\nimport qualified Data.Set as Set\n\n--------------------------------------------------------------------------------\n-- State\n--------------------------------------------------------------------------------\n\ntype Anchor = T.Text\ntype Media = [(FilePath, B.ByteString)]\n\ndata ReaderState\n   = ReaderState { -- | A collection of styles read somewhere else.\n                   -- It is only queried here, not modified.\n                   styleSet         :: Styles\n                   -- | A stack of the styles of parent elements.\n                   -- Used to look up inherited style properties.\n                 , styleTrace       :: [Style]\n                   -- | Keeps track of the current depth in nested lists\n                 , currentListLevel :: ListLevel\n                   -- | Keeps track of the previous list start counters,\n                   -- so whenever a new list continues numbering,\n                   -- we know what number to start from.\n                   -- If  list does not continue numbering, the counter\n                   -- is being reset.\n                 , listContinuationStartCounters :: M.Map ListLevel Int\n                   -- | Lists may provide their own style, but they don't have\n                   -- to. If they do not, the style of a parent list may be used\n                   -- or even a default list style from the paragraph style.\n                   -- This value keeps track of the closest list style there\n                   -- currently is.\n                 , currentListStyle :: Maybe ListStyle\n                   -- | A map from internal anchor names to \"pretty\" ones.\n                   -- The mapping is a purely cosmetic one.\n                 , bookmarkAnchors  :: M.Map Anchor Anchor\n                   -- | A map of files / binary data from the archive\n                 , envMedia         :: Media\n                   -- | Hold binary resources used in the document\n                 , odtMediaBag      :: MediaBag\n                 }\n  deriving ( Show )\n\nreaderState :: Styles -> Media -> ReaderState\nreaderState styles media = ReaderState styles [] 0 M.empty Nothing M.empty media mempty\n\n--\npushStyle'  :: Style -> ReaderState -> ReaderState\npushStyle' style state = state { styleTrace = style : styleTrace state }\n\n--\npopStyle'   :: ReaderState -> ReaderState\npopStyle' state = case styleTrace state of\n                   _:trace -> state  { styleTrace = trace  }\n                   _       -> state\n--\nmodifyListLevel :: (ListLevel -> ListLevel) -> (ReaderState -> ReaderState)\nmodifyListLevel f state = state { currentListLevel = f (currentListLevel state) }\n\n--\nmodifyListContinuationStartCounter :: ListLevel -> Int -> (ReaderState -> ReaderState)\nmodifyListContinuationStartCounter listLevel count state =\n    state { listContinuationStartCounters = M.insert listLevel count (listContinuationStartCounters state) }\n\n--\nshiftListLevel :: ListLevel -> (ReaderState -> ReaderState)\nshiftListLevel diff = modifyListLevel (+ diff)\n\n--\nswapCurrentListStyle :: Maybe ListStyle -> ReaderState\n                     -> (ReaderState, Maybe ListStyle)\nswapCurrentListStyle mListStyle state = ( state { currentListStyle = mListStyle }\n                                        ,  currentListStyle state\n                                        )\n\n--\nlookupPrettyAnchor :: Anchor -> ReaderState -> Maybe Anchor\nlookupPrettyAnchor anchor ReaderState{..} = M.lookup anchor bookmarkAnchors\n\n--\nputPrettyAnchor :: Anchor -> Anchor -> ReaderState -> ReaderState\nputPrettyAnchor ugly pretty state@ReaderState{..}\n  = state { bookmarkAnchors = M.insert ugly pretty bookmarkAnchors }\n\n--\nusedAnchors :: ReaderState -> [Anchor]\nusedAnchors ReaderState{..} = M.elems bookmarkAnchors\n\ngetMediaBag :: ReaderState -> MediaBag\ngetMediaBag ReaderState{..} = odtMediaBag\n\ngetMediaEnv :: ReaderState -> Media\ngetMediaEnv ReaderState{..} = envMedia\n\ninsertMedia' :: (FilePath, B.ByteString) -> ReaderState ->  ReaderState\ninsertMedia' (fp, bs) state@ReaderState{..}\n  = state { odtMediaBag = insertMedia fp Nothing bs odtMediaBag }\n\n--------------------------------------------------------------------------------\n-- Reader type and associated tools\n--------------------------------------------------------------------------------\n\ntype ODTReader      a b = XMLReader     ReaderState a b\n\ntype ODTReaderSafe  a b = XMLReaderSafe ReaderState a b\n\n-- | Extract something from the styles\nfromStyles :: (a -> Styles -> b) -> ODTReaderSafe a b\nfromStyles f =     keepingTheValue\n                     (getExtraState >>^ styleSet)\n               >>% f\n\n--\ngetStyleByName :: ODTReader StyleName Style\ngetStyleByName = fromStyles lookupStyle >>^ maybeToChoice\n\n--\nfindStyleFamily :: ODTReader Style StyleFamily\nfindStyleFamily = fromStyles getStyleFamily >>^ maybeToChoice\n\n--\nlookupListStyle :: ODTReader StyleName ListStyle\nlookupListStyle = fromStyles lookupListStyleByName >>^ maybeToChoice\n\n--\nswitchCurrentListStyle :: ODTReaderSafe (Maybe ListStyle) (Maybe ListStyle)\nswitchCurrentListStyle =     keepingTheValue getExtraState\n                         >>% swapCurrentListStyle\n                         >>> first setExtraState\n                         >>^ snd\n\n--\npushStyle :: ODTReaderSafe Style Style\npushStyle =     keepingTheValue (\n                  (     keepingTheValue getExtraState\n                    >>% pushStyle'\n                  )\n                  >>> setExtraState\n                )\n            >>^ fst\n\n--\npopStyle :: ODTReaderSafe x x\npopStyle =     keepingTheValue (\n                     getExtraState\n                 >>> arr popStyle'\n                 >>> setExtraState\n               )\n           >>^ fst\n\n--\ngetCurrentListLevel :: ODTReaderSafe a ListLevel\ngetCurrentListLevel = getExtraState >>^ currentListLevel\n\n--\ngetListContinuationStartCounters :: ODTReaderSafe a (M.Map ListLevel Int)\ngetListContinuationStartCounters = getExtraState >>^ listContinuationStartCounters\n\n\n--\ngetPreviousListStartCounter :: ODTReaderSafe ListLevel Int\ngetPreviousListStartCounter = proc listLevel -> do\n    counts <- getListContinuationStartCounters -< ()\n    returnA -< M.findWithDefault 0 listLevel counts\n\n--\nupdateMediaWithResource :: ODTReaderSafe (FilePath, B.ByteString) (FilePath, B.ByteString)\nupdateMediaWithResource = keepingTheValue (\n                 (keepingTheValue getExtraState\n                  >>% insertMedia'\n                  )\n                 >>> setExtraState\n               )\n           >>^ fst\n\nlookupResource :: ODTReaderSafe FilePath (FilePath, B.ByteString)\nlookupResource = proc target -> do\n    state <- getExtraState -< ()\n    case lookup target (getMediaEnv state) of\n      Just bs -> returnV (target, bs) -<< ()\n      Nothing -> returnV (\"\", B.empty) -< ()\n\ntype AnchorPrefix = T.Text\n\n-- | An adaptation of 'uniqueIdent' from \"Text.Pandoc.Shared\" that generates a\n-- unique identifier but without assuming that the id should be for a header.\n-- Second argument is a list of already used identifiers.\nuniqueIdentFrom :: AnchorPrefix -> [Anchor] -> Anchor\nuniqueIdentFrom baseIdent usedIdents =\n  let  numIdent n = baseIdent <> \"-\" <> T.pack (show n)\n  in  if baseIdent `elem` usedIdents\n        then maybe baseIdent numIdent\n             $ find (\\x -> numIdent x `notElem` usedIdents) ([1..60000] :: [Int])\n               -- if we have more than 60,000, allow repeats\n        else baseIdent\n\n-- | First argument: basis for a new \"pretty\" anchor if none exists yet\n-- Second argument: a key (\"ugly\" anchor)\n-- Returns: saved \"pretty\" anchor or created new one\ngetPrettyAnchor :: ODTReaderSafe (AnchorPrefix, Anchor) Anchor\ngetPrettyAnchor = proc (baseIdent, uglyAnchor) -> do\n  state <- getExtraState -< ()\n  case lookupPrettyAnchor uglyAnchor state of\n    Just prettyAnchor -> returnA -< prettyAnchor\n    Nothing           -> do\n      let newPretty = uniqueIdentFrom baseIdent (usedAnchors state)\n      modifyExtraState (putPrettyAnchor uglyAnchor newPretty) -<< newPretty\n\n-- | Input: basis for a new header anchor\n-- Output: saved new anchor\ngetHeaderAnchor :: ODTReaderSafe Inlines Anchor\ngetHeaderAnchor = proc title -> do\n  state <- getExtraState -< ()\n  let exts = extensionsFromList [Ext_auto_identifiers]\n  let anchor = uniqueIdent exts (toList title)\n                (Set.fromList $ usedAnchors state)\n  modifyExtraState (putPrettyAnchor anchor anchor) -<< anchor\n\n\n--------------------------------------------------------------------------------\n-- Working with styles\n--------------------------------------------------------------------------------\n\n--\nreadStyleByName :: ODTReader a (StyleName, Style)\nreadStyleByName =\n  findAttr NsText \"style-name\" >>? keepingTheValue getStyleByName >>^ liftE\n  where\n    liftE :: (StyleName, Fallible Style) -> Fallible (StyleName, Style)\n    liftE (name, Right v) = Right (name, v)\n    liftE (_, Left v)     = Left v\n\n--\nisStyleToTrace :: ODTReader Style Bool\nisStyleToTrace = findStyleFamily >>?^ (==FaText)\n\n--\nwithNewStyle :: ODTReaderSafe x Inlines -> ODTReaderSafe x Inlines\nwithNewStyle a = proc x -> do\n  fStyle <- readStyleByName -< ()\n  case fStyle of\n    Right (styleName, _) | isCodeStyle styleName -> do\n      inlines <- a -< x\n      arr inlineCode -<< inlines\n    Right (_, style) -> do\n      mFamily    <- arr styleFamily -< style\n      fTextProps <- arr ( maybeToChoice\n                        . textProperties\n                        . styleProperties\n                        )           -< style\n      case fTextProps of\n        Right textProps -> do\n          state        <- getExtraState             -< ()\n          let triple = (state, textProps, mFamily)\n          modifier     <- arr modifierFromStyleDiff -< triple\n          fShouldTrace <- isStyleToTrace            -< style\n          case fShouldTrace of\n            Right shouldTrace ->\n              if shouldTrace\n                then do\n                  pushStyle      -< style\n                  inlines   <- a -< x\n                  popStyle       -< ()\n                  arr modifier   -<< inlines\n                else\n    -- In case anything goes wrong\n                      a -< x\n            Left _ -> a -< x\n        Left _     -> a -< x\n    Left _         -> a -< x\n  where\n    isCodeStyle :: StyleName -> Bool\n    isCodeStyle \"Source_Text\" = True\n    isCodeStyle \"Source_20_Text\" = True\n    isCodeStyle _             = False\n\n    inlineCode :: Inlines -> Inlines\n    inlineCode = code . T.concat . map stringify . toList\n\ntype PropertyTriple = (ReaderState, TextProperties, Maybe StyleFamily)\ntype InlineModifier = Inlines -> Inlines\n\n-- | Given data about the local style changes, calculates how to modify\n-- an instance of 'Inlines'\nmodifierFromStyleDiff :: PropertyTriple -> InlineModifier\nmodifierFromStyleDiff propertyTriple  =\n  composition $\n  getVPosModifier propertyTriple\n  : map (first ($ propertyTriple) >>> ifThen_else ignore)\n        [ (hasEmphChanged           , emph      )\n        , (hasChanged isStrong      , strong    )\n        , (hasChanged strikethrough , strikeout )\n        ]\n  where\n    ifThen_else else' (if',then') = if if' then then' else else'\n\n    ignore = id :: InlineModifier\n\n    getVPosModifier :: PropertyTriple -> InlineModifier\n    getVPosModifier triple@(_,textProps,_) =\n        let getVPos = Just . verticalPosition\n        in  case lookupPreviousValueM getVPos triple of\n              Nothing      -> ignore\n              Just oldVPos -> getVPosModifier' (oldVPos, verticalPosition textProps)\n\n    getVPosModifier' (oldVPos , newVPos   ) | oldVPos == newVPos = ignore\n    getVPosModifier' ( _      , VPosSub   ) = subscript\n    getVPosModifier' ( _      , VPosSuper ) = superscript\n    getVPosModifier' ( _      ,  _        ) = ignore\n\n    hasEmphChanged :: PropertyTriple -> Bool\n    hasEmphChanged = swing any [ hasChanged  isEmphasised\n                               , hasChangedM pitch\n                               , hasChanged  underline\n                               ]\n\n    hasChanged property triple@(_, property -> newProperty, _) =\n        (/= Just newProperty) (lookupPreviousValue property triple)\n\n    hasChangedM property triple@(_, textProps,_) =\n      fromMaybe False $ (/=) <$> property textProps <*> lookupPreviousValueM property triple\n\n    lookupPreviousValue f = lookupPreviousStyleValue (fmap f . textProperties)\n\n    lookupPreviousValueM f = lookupPreviousStyleValue (f <=< textProperties)\n\n    lookupPreviousStyleValue f (ReaderState{..},_,mFamily)\n      =     findBy f (extendedStylePropertyChain styleTrace styleSet)\n        <|> (f . lookupDefaultStyle' styleSet =<< mFamily)\n\n\ntype ParaModifier = Blocks -> Blocks\n\n_MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_MM_      :: Int\n_MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_PERCENT_ :: Int\n_MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_MM_      = 5\n_MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_PERCENT_ = 5\n\n-- | Returns either 'id' or 'blockQuote' depending if any of the StyleProperties\n-- are indented at quote level.\ngetParaModifier :: ListLevel -> [StyleProperties] -> ParaModifier\ngetParaModifier listLevel props\n  | listLevel > 0 = id -- see #9505, list paragraphs need indentation\n  | any isBlockQuote props = blockQuote\n  | otherwise = id\n  where\n  isBlockQuote SProps {..} | Just paraProps <- paraProperties\n                                    , isQuoteWidth (margin_left paraProps)\n                                    = True\n                                    | otherwise\n                                    = False\n  isQuoteWidth mMargin\n    | LengthValueMM margin <- mMargin\n    ,           margin > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_MM_\n     = True\n    | PercentValue  margin <- mMargin\n    ,           margin > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_PERCENT_\n     = True\n    | otherwise\n     = False\n\n--\nconstructPara :: ODTReaderSafe a Blocks -> ODTReaderSafe a Blocks\nconstructPara reader = proc blocks -> do\n  fStyle <- readStyleByName -< blocks\n  case fStyle of\n    Left   _    -> reader -< blocks\n    Right (styleName, _) | isTableCaptionStyle styleName -> do\n      blocks' <- reader   -< blocks\n      arr tableCaptionP  -< blocks'\n    Right (_, style) -> do\n      props <- fromStyles extendedStylePropertyChain -< [style]\n      listLevel <- getCurrentListLevel -< ()\n      let modifier = getParaModifier listLevel props\n      blocks' <- reader   -<  blocks\n      arr modifier        -<< blocks'\n  where\n    isTableCaptionStyle :: StyleName -> Bool\n    isTableCaptionStyle \"Table\" = True\n    isTableCaptionStyle _       = False\n    tableCaptionP b = divWith (\"\", [\"caption\"], []) b\n\ntype ListConstructor = [Blocks] -> Blocks\n\ngetListConstructor :: ListLevelStyle -> Int -> ListConstructor\ngetListConstructor ListLevelStyle{..} startNum =\n  case listLevelType of\n    LltBullet   -> bulletList\n    LltImage    -> bulletList\n    LltNumbered -> let listNumberStyle = toListNumberStyle listItemFormat\n                       listNumberDelim = toListNumberDelim listItemPrefix\n                                                           listItemSuffix\n                   in  orderedListWith (startNum, listNumberStyle, listNumberDelim)\n  where\n    toListNumberStyle  LinfNone      = DefaultStyle\n    toListNumberStyle  LinfNumber    = Decimal\n    toListNumberStyle  LinfRomanLC   = LowerRoman\n    toListNumberStyle  LinfRomanUC   = UpperRoman\n    toListNumberStyle  LinfAlphaLC   = LowerAlpha\n    toListNumberStyle  LinfAlphaUC   = UpperAlpha\n    toListNumberStyle (LinfString _) = Example\n\n    toListNumberDelim  Nothing   (Just \".\") = Period\n    toListNumberDelim (Just \"\" ) (Just \".\") = Period\n    toListNumberDelim  Nothing   (Just \")\") = OneParen\n    toListNumberDelim (Just \"\" ) (Just \")\") = OneParen\n    toListNumberDelim (Just \"(\") (Just \")\") = TwoParens\n    toListNumberDelim     _          _      = DefaultDelim\n\n-- | Determines which style to use for a list, which level to use of that\n-- style, and which type of list to create as a result of this information.\n-- Then prepares the state for eventual child lists and constructs the list from\n-- the results.\n-- Two main cases are handled: The list may provide its own style or it may\n-- rely on a parent list's style. I the former case the current style in the\n-- state must be switched before and after the call to the child converter\n-- while in the latter the child converter can be called directly.\n-- If anything goes wrong, a default ordered-list-constructor is used.\nconstructList :: ODTReaderSafe x [Blocks] -> ODTReaderSafe x Blocks\nconstructList reader = proc x -> do\n  modifyExtraState (shiftListLevel 1)                                  -< ()\n  listLevel                    <- getCurrentListLevel                  -< ()\n  listContinuationStartCounter <- getPreviousListStartCounter          -< listLevel\n  fStyleName                   <- findAttr NsText \"style-name\"         -< ()\n  fContNumbering               <- findAttr NsText \"continue-numbering\" -< ()\n  listItemCount                <- reader >>^ length                    -< x\n\n  let continueNumbering = case fContNumbering of\n                            Right \"true\" -> True\n                            _            -> False\n\n  let startNumForListLevelStyle = listStartingNumber continueNumbering listContinuationStartCounter\n  let defaultOrderedListConstructor = constructOrderedList (startNumForListLevelStyle Nothing) listLevel listItemCount\n\n  case fStyleName of\n    Right styleName -> do\n      fListStyle <- lookupListStyle -< styleName\n      case fListStyle of\n        Right listStyle -> do\n          fListLevelStyle <- arr (uncurry getListLevelStyle) -< (listLevel, listStyle)\n          case fListLevelStyle of\n            Just listLevelStyle -> do\n              let startNum = startNumForListLevelStyle $ Just listLevelStyle\n              oldListStyle <- switchCurrentListStyle                    -<  Just listStyle\n              blocks       <- constructListWith listLevelStyle startNum listLevel listItemCount -<< x\n              switchCurrentListStyle                                    -<  oldListStyle\n              returnA                                                   -<  blocks\n            Nothing             -> defaultOrderedListConstructor -<< x\n        Left _                  -> defaultOrderedListConstructor -<< x\n    Left _ -> do\n      state      <- getExtraState        -< ()\n      mListStyle <- arr currentListStyle -< state\n      case mListStyle of\n        Just listStyle -> do\n          fListLevelStyle <- arr (uncurry getListLevelStyle) -< (listLevel, listStyle)\n          case fListLevelStyle of\n            Just listLevelStyle -> do\n              let startNum = startNumForListLevelStyle $ Just listLevelStyle\n              constructListWith listLevelStyle startNum listLevel listItemCount -<< x\n            Nothing             -> defaultOrderedListConstructor -<< x\n        Nothing                 -> defaultOrderedListConstructor -<< x\n  where\n    listStartingNumber continueNumbering listContinuationStartCounter mListLevelStyle\n      | continueNumbering                = listContinuationStartCounter\n      | isJust mListLevelStyle           = listItemStart (fromJust mListLevelStyle)\n      | otherwise                        = 1\n    constructOrderedList startNum listLevel listItemCount =\n          reader\n      >>> modifyExtraState (shiftListLevel (-1))\n      >>> modifyExtraState (modifyListContinuationStartCounter listLevel (startNum + listItemCount))\n      >>^ orderedListWith (startNum, DefaultStyle, DefaultDelim)\n    constructListWith listLevelStyle startNum listLevel listItemCount =\n          reader\n      >>> getListConstructor listLevelStyle startNum\n      ^>> modifyExtraState (shiftListLevel (-1))\n      >>> modifyExtraState (modifyListContinuationStartCounter listLevel (startNum + listItemCount))\n\n--------------------------------------------------------------------------------\n-- Readers\n--------------------------------------------------------------------------------\n\ntype ElementMatcher result = (Namespace, ElementName, ODTReader result result)\n\ntype InlineMatcher = ElementMatcher Inlines\n\ntype BlockMatcher  = ElementMatcher Blocks\n\nnewtype FirstMatch a = FirstMatch (Alt Maybe a)\n  deriving (Foldable, Monoid, Semigroup)\n\nfirstMatch :: a -> FirstMatch a\nfirstMatch = FirstMatch . Alt . Just\n\nnewtype CombiningBlocks = CombiningBlocks { unCombiningBlocks :: Blocks }\n\ninstance Semigroup CombiningBlocks where\n  CombiningBlocks l <> CombiningBlocks r = CombiningBlocks (combineBlocks l r)\n\ninstance Monoid CombiningBlocks where\n  mempty = CombiningBlocks mempty\n\n--\nmatchingElement :: (Monoid e)\n                => Namespace -> ElementName\n                -> ODTReaderSafe  e e\n                -> ElementMatcher e\nmatchingElement ns name reader = (ns, name, asResultAccumulator reader)\n  where\n   asResultAccumulator :: (ArrowChoice a, Monoid m) => a m m -> a m (Fallible m)\n   asResultAccumulator a = liftAsSuccess $ keepingTheValue a >>% mappend\n\n--\nmatchChildContent'   :: (Monoid result)\n                     => [ElementMatcher result]\n                     ->  ODTReaderSafe a result\nmatchChildContent' ls = returnV mempty >>> matchContent' ls\n\n--\nmatchSmushedChildBlocks' :: [ElementMatcher CombiningBlocks] ->  ODTReaderSafe a Blocks\nmatchSmushedChildBlocks' ls = liftA unCombiningBlocks\n                              $ returnV mempty\n                                >>> matchContent' ls\n\n--\nmatchChildContent    :: (Monoid result)\n                     => [ElementMatcher result]\n                     ->  ODTReaderSafe  (result, XML.Content) result\n                     ->  ODTReaderSafe a result\nmatchChildContent ls fallback = returnV mempty >>> matchContent ls fallback\n\n--------------------------------------------\n-- Matchers\n--------------------------------------------\n\n----------------------\n-- Basics\n----------------------\n\n--\n-- | Open Document allows several consecutive spaces if they are marked up\nread_plain_text :: ODTReaderSafe (Inlines, XML.Content) Inlines\nread_plain_text =  fst ^&&& read_plain_text' >>% recover\n  where\n    -- fallible version\n    read_plain_text' :: ODTReader (Inlines, XML.Content) Inlines\n    read_plain_text' =      (     second ( arr extractText )\n                              >>^ spreadChoice >>?! second text\n                            )\n                       >>?% mappend\n    --\n    extractText     :: XML.Content -> Fallible T.Text\n    extractText (XML.Text cData) = succeedWith (XML.cdData cData)\n    extractText         _        = failEmpty\n\nread_text_seq :: InlineMatcher\nread_text_seq  = matchingElement NsText \"sequence\"\n                 $ matchChildContent [] read_plain_text\n\n\n-- specifically. I honor that, although the current implementation of 'mappend'\n-- for 'Inlines' in \"Text.Pandoc.Builder\" will collapse them again.\n-- The rational is to be prepared for future modifications.\nread_spaces      :: InlineMatcher\nread_spaces       = matchingElement NsText \"s\" (\n                          readAttrWithDefault NsText \"c\" 1 -- how many spaces?\n                      >>^ fromList.(`replicate` Space)\n                    )\n--\nread_line_break  :: InlineMatcher\nread_line_break   = matchingElement NsText \"line-break\"\n                    $ returnV linebreak\n--\nread_tab         :: InlineMatcher\nread_tab          = matchingElement NsText \"tab\"\n                    $ returnV space\n--\nread_span        :: InlineMatcher\nread_span         = matchingElement NsText \"span\"\n                    $ withNewStyle\n                    $ matchChildContent [ read_span\n                                        , read_spaces\n                                        , read_line_break\n                                        , read_tab\n                                        , read_link\n                                        , read_frame\n                                        , read_note\n                                        , read_citation\n                                        , read_bookmark\n                                        , read_bookmark_start\n                                        , read_reference_start\n                                        , read_bookmark_ref\n                                        , read_reference_ref\n                                        ] read_plain_text\n\n--\nread_paragraph   :: ElementMatcher CombiningBlocks\nread_paragraph    = matchingElement NsText \"p\" $\n                      liftA CombiningBlocks $ proc blocks -> do\n                        fStyle <- readStyleByName -< blocks\n                        case fStyle of\n                          Right style | isPreformattedStyle style -> do\n                            liftA (codeBlock . stringify) $ matchParagraphContent -< blocks\n                          _ ->\n                            constructPara $ liftA para $ withNewStyle matchParagraphContent -< blocks\n                        where\n                          isPreformattedStyle :: (StyleName, Style) -> Bool\n                          isPreformattedStyle (\"Preformatted_20_Text\", _) = True\n                          isPreformattedStyle (_, Style { styleParentName = Just \"Preformatted_20_Text\" }) = True\n                          isPreformattedStyle _ = False\n\n\nmatchParagraphContent :: ODTReaderSafe a Inlines\nmatchParagraphContent = matchChildContent [ read_span\n                                          , read_spaces\n                                          , read_line_break\n                                          , read_tab\n                                          , read_link\n                                          , read_note\n                                          , read_citation\n                                          , read_bookmark\n                                          , read_bookmark_start\n                                          , read_reference_start\n                                          , read_bookmark_ref\n                                          , read_reference_ref\n                                          , read_frame\n                                          , read_text_seq\n                                          ] read_plain_text\n\n\n----------------------\n-- Headers\n----------------------\n\n--\nread_header      :: ElementMatcher CombiningBlocks\nread_header       = matchingElement NsText \"h\"\n                    $  proc blocks -> do\n  level    <- ( readAttrWithDefault NsText \"outline-level\" 1\n              ) -< blocks\n  children <- ( matchChildContent [ read_span\n                                  , read_spaces\n                                  , read_line_break\n                                  , read_tab\n                                  , read_link\n                                  , read_note\n                                  , read_citation\n                                  , read_bookmark\n                                  , read_bookmark_start\n                                  , read_reference_start\n                                  , read_bookmark_ref\n                                  , read_reference_ref\n                                  , read_frame\n                                  ] read_plain_text\n              ) -< blocks\n  anchor   <- getHeaderAnchor -< children\n  let idAttr = (anchor, [], []) -- no classes, no key-value pairs\n  arr (CombiningBlocks . uncurry3 headerWith) -< (idAttr, level, children)\n\n----------------------\n-- Lists\n----------------------\n\n--\nread_list        :: ElementMatcher CombiningBlocks\nread_list         = matchingElement NsText \"list\"\n                    $ liftA CombiningBlocks\n                    $ constructList\n                    $ matchChildContent' [ read_list_item\n                                         , read_list_header\n                                         ]\n--\nread_list_item   :: ElementMatcher [Blocks]\nread_list_item    = read_list_element \"list-item\"\n\nread_list_header :: ElementMatcher [Blocks]\nread_list_header  = read_list_element \"list-header\"\n\nread_list_element               :: ElementName -> ElementMatcher [Blocks]\nread_list_element listElement   = matchingElement NsText listElement\n                                  $ liftA (compactify.(:[]))\n                                    ( matchSmushedChildBlocks' [ read_paragraph\n                                                               , read_header\n                                                               , read_list\n                                                               , read_section\n                                                               ]\n                                    )\n\n----------------------\n-- Sections\n----------------------\n\nread_section :: ElementMatcher CombiningBlocks\nread_section = matchingElement NsText \"section\"\n                 $ liftA (CombiningBlocks . divWith nullAttr)\n                 $ matchSmushedChildBlocks' [ read_paragraph\n                                            , read_header\n                                            , read_list\n                                            , read_table\n                                            , read_section\n                                            ]\n\n\n----------------------\n-- Links\n----------------------\n\nread_link        :: InlineMatcher\nread_link         = matchingElement NsText \"a\"\n                    $ liftA3 link\n                      ( findAttrTextWithDefault NsXLink  \"href\"  \"\"\n                        >>> arr fixRelativeLink                              )\n                      ( findAttrTextWithDefault NsOffice \"title\" \"\"          )\n                      ( matchChildContent [ read_span\n                                          , read_note\n                                          , read_citation\n                                          , read_bookmark\n                                          , read_bookmark_start\n                                          , read_reference_start\n                                          , read_bookmark_ref\n                                          , read_reference_ref\n                                          ] read_plain_text                  )\n\nfixRelativeLink :: T.Text -> T.Text\nfixRelativeLink uri =\n    case parseRelativeReference (T.unpack uri) of\n      Nothing -> uri\n      Just u  ->\n        case uriPath u of\n          '.':'.':'/':xs -> tshow $ u{ uriPath = xs }\n          _ -> uri\n\n-------------------------\n-- Footnotes\n-------------------------\n\nread_note        :: InlineMatcher\nread_note         = matchingElement NsText \"note\"\n                    $ liftA note\n                    $ matchChildContent' [ read_note_body ]\n\nread_note_body   :: BlockMatcher\nread_note_body    = matchingElement NsText \"note-body\"\n                    $ matchSmushedChildBlocks' [ read_paragraph ]\n\n-------------------------\n-- Citations\n-------------------------\n\nread_citation    :: InlineMatcher\nread_citation     = matchingElement NsText \"bibliography-mark\"\n                    $ liftA2 cite\n                      ( liftA2 makeCitation\n                        ( findAttrTextWithDefault NsText \"identifier\" \"\" )\n                        ( readAttrWithDefault NsText \"number\" 0          )\n                      )\n                      ( matchChildContent [] read_plain_text             )\n  where\n   makeCitation :: T.Text -> Int -> [Citation]\n   makeCitation citeId num = [Citation citeId [] [] NormalCitation num 0]\n\n\n----------------------\n-- Tables\n----------------------\n\n--\nread_table        :: ElementMatcher CombiningBlocks\nread_table         = matchingElement NsTable \"table\"\n                     $ liftA (CombiningBlocks . table')\n                     $ (matchChildContent' [read_table_header]) &&&\n                       (matchChildContent' [read_table_row])\n\n-- | A table without a caption.\ntable' :: ([[Cell]], [[Cell]]) -> Blocks\ntable' (headers, rows) =\n  table emptyCaption (replicate numcols defaults) th [tb] tf\n  where\n    defaults = (AlignDefault, ColWidthDefault)\n    numcols = maximum $ map length $ headers ++ rows\n    toRow = Row nullAttr\n    th = TableHead nullAttr $ map toRow headers\n    tb = TableBody nullAttr 0 [] $ map toRow rows\n    tf = TableFoot nullAttr []\n\n--\nread_table_header :: ElementMatcher [[Cell]]\nread_table_header = matchingElement NsTable \"table-header-rows\"\n                      $ matchChildContent' [ read_table_row\n                                           ]\n\n--\nread_table_row    :: ElementMatcher [[Cell]]\nread_table_row     = matchingElement NsTable \"table-row\"\n                     $ liftA (:[])\n                     $ matchChildContent'  [ read_table_cell\n                                           ]\n\n--\nread_table_cell   :: ElementMatcher [Cell]\nread_table_cell    = matchingElement NsTable \"table-cell\"\n                     $ liftA3 cell'\n                       (readAttrWithDefault NsTable \"number-rows-spanned\" 1 >>^ RowSpan)\n                       (readAttrWithDefault NsTable \"number-columns-spanned\" 1 >>^ ColSpan)\n                     $ matchSmushedChildBlocks' [ read_paragraph\n                                                , read_list\n                                                ]\n  where\n    cell' rowSpan colSpan blocks = map (cell AlignDefault rowSpan colSpan) $ compactify [blocks]\n\n----------------------\n-- Frames\n----------------------\n\n--\nread_frame :: InlineMatcher\nread_frame = matchingElement NsDraw \"frame\"\n             $ filterChildrenName' NsDraw (`elem` [\"image\", \"object\", \"text-box\"])\n           >>> foldS read_frame_child\n           >>> arr fold\n\nread_frame_child :: ODTReaderSafe XML.Element (FirstMatch Inlines)\nread_frame_child =\n  proc child -> case elName child of\n    \"image\"    -> read_frame_img      -< child\n    \"object\"   -> read_frame_mathml   -< child\n    \"text-box\" -> read_frame_text_box -< child\n    _          -> returnV mempty      -< ()\n\nread_frame_img :: ODTReaderSafe XML.Element (FirstMatch Inlines)\nread_frame_img =\n  proc img -> do\n    src <- executeIn (findAttr' NsXLink \"href\") -< img\n    case fold src of\n      \"\"   -> returnV mempty -< ()\n      src' -> do\n        let exts = extensionsFromList [Ext_auto_identifiers]\n            src'' = fixRelativeLink src'\n        resource   <- lookupResource                          -< T.unpack src''\n        _          <- updateMediaWithResource                 -< resource\n        w          <- findAttrText' NsSVG \"width\"             -< ()\n        h          <- findAttrText' NsSVG \"height\"            -< ()\n        titleNodes <- matchChildContent' [ read_frame_title ] -< ()\n        alt        <- matchChildContent [] read_plain_text    -< ()\n        arr (firstMatch . uncurry4 imageWith)                 -<\n          (image_attributes w h, src'', inlineListToIdentifier exts (toList titleNodes), alt)\n\nread_frame_title :: InlineMatcher\nread_frame_title = matchingElement NsSVG \"title\" (matchChildContent [] read_plain_text)\n\nimage_attributes :: Maybe T.Text -> Maybe T.Text -> Attr\nimage_attributes x y =\n  ( \"\", [], dim \"width\" x ++ dim \"height\" y)\n  where\n    dim _ (Just \"\")   = []\n    dim name (Just v) = [(name, v)]\n    dim _ Nothing     = []\n\nread_frame_mathml :: ODTReaderSafe XML.Element (FirstMatch Inlines)\nread_frame_mathml =\n  proc obj -> do\n    src <- executeIn (findAttr' NsXLink \"href\") -< obj\n    case fold src of\n      \"\"   -> returnV mempty -< ()\n      src' -> do\n        let path = T.unpack $\n                    fromMaybe src' (T.stripPrefix \"./\" src') <> \"/content.xml\"\n        (_, mathml) <- lookupResource -< path\n        case readMathML (UTF8.toText $ B.toStrict mathml) of\n          Left _     -> returnV mempty -< ()\n          Right exps -> arr (firstMatch . displayMath . writeTeX) -< exps\n\nread_frame_text_box :: ODTReaderSafe XML.Element (FirstMatch Inlines)\nread_frame_text_box = proc box -> do\n    paragraphs <- executeIn (matchSmushedChildBlocks' [ read_paragraph ]) -< box\n    arr read_img_with_caption -< toList paragraphs\n\nread_img_with_caption :: [Block] -> FirstMatch Inlines\nread_img_with_caption (Para [Image attr alt (src,title)] : _) =\n  firstMatch $ singleton (Image attr alt (src, \"fig:\" <> title))   -- no text, default caption\nread_img_with_caption (Para (Image attr _ (src,title) : txt) : _) =\n  firstMatch $ singleton (Image attr txt (src, \"fig:\" <> title) )  -- override caption with the text that follows\nread_img_with_caption  ( Para (_ : xs) : ys) =\n  read_img_with_caption (Para xs : ys)\nread_img_with_caption _ =\n  mempty\n\n----------------------\n-- Internal links\n----------------------\n\n_ANCHOR_PREFIX_ :: T.Text\n_ANCHOR_PREFIX_ = \"anchor\"\n\n--\nreadAnchorAttr :: ODTReader a Anchor\nreadAnchorAttr = findAttrText NsText \"name\"\n\n-- | Beware: may fail\nfindAnchorName :: ODTReader AnchorPrefix Anchor\nfindAnchorName = (      keepingTheValue readAnchorAttr\n                   >>^  spreadChoice\n                 ) >>?! getPrettyAnchor\n\n\n--\nmaybeAddAnchorFrom :: ODTReader Inlines AnchorPrefix\n                   -> ODTReaderSafe Inlines Inlines\nmaybeAddAnchorFrom anchorReader =\n  keepingTheValue (anchorReader >>? findAnchorName >>?^ toAnchorElem)\n  >>>\n  proc (inlines, fAnchorElem) -> do\n  case fAnchorElem of\n    Right anchorElem -> returnA -< anchorElem\n    Left _           -> returnA -< inlines\n  where\n    toAnchorElem :: Anchor -> Inlines\n    toAnchorElem anchorID = spanWith (anchorID, [], []) mempty\n                            -- no classes, no key-value pairs\n\n--\nread_bookmark     :: InlineMatcher\nread_bookmark      = matchingElement NsText \"bookmark\"\n                     $ maybeAddAnchorFrom (liftAsSuccess $ returnV _ANCHOR_PREFIX_)\n\n--\nread_bookmark_start :: InlineMatcher\nread_bookmark_start = matchingElement NsText \"bookmark-start\"\n                     $ maybeAddAnchorFrom (liftAsSuccess $ returnV _ANCHOR_PREFIX_)\n\n--\nread_reference_start :: InlineMatcher\nread_reference_start = matchingElement NsText \"reference-mark-start\"\n                     $ maybeAddAnchorFrom readAnchorAttr\n\n-- | Beware: may fail\nfindAnchorRef :: ODTReader a Anchor\nfindAnchorRef = (      findAttrText NsText \"ref-name\"\n                  >>?^ (_ANCHOR_PREFIX_,)\n                ) >>?! getPrettyAnchor\n\n\n--\nmaybeInAnchorRef :: ODTReaderSafe Inlines Inlines\nmaybeInAnchorRef = proc inlines -> do\n  fRef <- findAnchorRef -< ()\n  case fRef of\n    Right anchor ->\n      arr (toAnchorRef anchor) -<< inlines\n    Left _ -> returnA -< inlines\n  where\n    toAnchorRef :: Anchor -> Inlines -> Inlines\n    toAnchorRef anchor = link (\"#\" <> anchor) \"\" -- no title\n\n--\nread_bookmark_ref :: InlineMatcher\nread_bookmark_ref = matchingElement NsText \"bookmark-ref\"\n                    $    maybeInAnchorRef\n                     <<< matchChildContent [] read_plain_text\n\n--\nread_reference_ref :: InlineMatcher\nread_reference_ref = matchingElement NsText \"reference-ref\"\n                    $    maybeInAnchorRef\n                     <<< matchChildContent [] read_plain_text\n\n\n----------------------\n-- Entry point\n----------------------\n\nread_text :: ODTReaderSafe a Pandoc\nread_text = matchSmushedChildBlocks' [ read_header\n                                     , read_paragraph\n                                     , read_list\n                                     , read_section\n                                     , read_table\n                                     ]\n            >>^ doc\n\npost_process :: Pandoc -> Pandoc\npost_process (Pandoc m blocks) =\n  Pandoc m (post_process' blocks)\n\npost_process' :: [Block] -> [Block]\npost_process' (Table attr _ specs th tb tf : Div (\"\", [\"caption\"], _) blks : xs)\n  = Table attr (Caption Nothing blks) specs th tb tf : post_process' xs\npost_process' bs = bs\n\nread_body :: ODTReader a (Pandoc, MediaBag)\nread_body = executeInSub NsOffice \"body\"\n          $ executeInSub NsOffice \"text\"\n          $ liftAsSuccess\n          $ proc inlines -> do\n             txt   <- read_text     -< inlines\n             state <- getExtraState -< ()\n             returnA                -< (post_process txt, getMediaBag state)\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Generic/Fallible.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.ODT.Generic.Fallible\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nData types and utilities representing failure. Most of it is based on the\n\"Either\" type in its usual configuration (left represents failure).\n\nIn most cases, the failure type is implied or required to be a \"Monoid\".\n\nThe choice of \"Either\" instead of a custom type makes it easier to write\ncompatible instances of \"ArrowChoice\".\n-}\n\n-- We export everything\nmodule Text.Pandoc.Readers.ODT.Generic.Fallible\n  ( Failure\n  , Fallible\n  , maybeToEither\n  , eitherToMaybe\n  , recover\n  , failWith\n  , failEmpty\n  , succeedWith\n  , collapseEither\n  , chooseMax\n  , chooseMaxWith\n  , ChoiceVector(..)\n  , SuccessList(..)\n  ) where\n\n-- | Default for now. Will probably become a class at some point.\ntype Failure = ()\n\ntype Fallible a = Either Failure a\n\n\n--\nmaybeToEither :: Maybe a -> Fallible a\nmaybeToEither (Just a) = Right a\nmaybeToEither Nothing  = Left  ()\n\n--\neitherToMaybe :: Either _l a -> Maybe a\neitherToMaybe (Left  _) = Nothing\neitherToMaybe (Right a) = Just a\n\n-- | > recover a === either (const a) id\nrecover :: a -> Either _f a -> a\nrecover a (Left  _) = a\nrecover _ (Right a) = a\n\n-- | I would love to use 'fail'. Alas, 'Monad.fail'...\nfailWith :: failure -> Either failure _x\nfailWith f = Left f\n\n--\nfailEmpty :: (Monoid failure) => Either failure _x\nfailEmpty = failWith mempty\n\n--\nsucceedWith :: a -> Either _x a\nsucceedWith = Right\n\n--\ncollapseEither :: Either failure (Either failure x)\n               -> Either failure x\ncollapseEither (Left f         ) = Left f\ncollapseEither (Right (Left  f)) = Left f\ncollapseEither (Right (Right x)) = Right x\n\n-- | If either of the values represents a  non-error, the result is a\n-- (possibly combined) non-error. If both values represent an error, an error\n-- is returned.\nchooseMax :: (Monoid a, Monoid b) => Either a b -> Either a b -> Either a b\nchooseMax = chooseMaxWith mappend\n\n-- | If either of the values represents a non-error, the result is a\n-- (possibly combined) non-error. If both values represent an error, an error\n-- is returned.\nchooseMaxWith :: (Monoid a) => (b -> b -> b)\n                            -> Either a b\n                            -> Either a b\n                            -> Either a b\nchooseMaxWith (><) (Right a) (Right b) = Right $ a >< b\nchooseMaxWith  _   (Left  a) (Left  b) = Left  $ a `mappend` b\nchooseMaxWith  _   (Right a)     _     = Right a\nchooseMaxWith  _       _     (Right b) = Right b\n\n\n-- | Class of containers that can escalate contained 'Either's.\n-- The word \"Vector\" is meant in the sense of a disease transmitter.\nclass ChoiceVector v where\n  spreadChoice :: v (Either f a) -> Either f (v a)\n\ninstance ChoiceVector ((,) a) where\n  spreadChoice (_, Left  f) = Left  f\n  spreadChoice (x, Right y) = Right (x,y)\n  -- Wasn't there a newtype somewhere with the elements flipped?\n\n-- | Wrapper for a list. While the normal list instance of 'ChoiceVector'\n-- fails whenever it can, this type will never fail.\nnewtype SuccessList a = SuccessList { collectNonFailing :: [a] }\n  deriving ( Eq, Ord, Show )\n\ninstance ChoiceVector SuccessList  where\n  spreadChoice = Right . SuccessList . foldr unTagRight [] . collectNonFailing\n    where unTagRight (Right x) = (x:)\n          unTagRight _         = id\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Generic/Namespaces.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.ODT.Generic.Namespaces\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nA class containing a set of namespace identifiers. Used to convert between\ntypesafe Haskell namespace identifiers and unsafe \"real world\" namespaces.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Generic.Namespaces\n  ( NameSpaceIRI\n  , NameSpaceIRIs\n  , NameSpaceID(..)\n  ) where\n\nimport qualified Data.Map as M\nimport Data.Text (Text)\n\n--\ntype NameSpaceIRI          = Text\n\n--\ntype NameSpaceIRIs     nsID = M.Map nsID NameSpaceIRI\n\n--\nclass (Eq nsID, Ord nsID) => NameSpaceID nsID where\n\n  -- | Given a IRI, possibly update the map and return the id of the namespace.\n  -- May fail if the namespace is unknown and the application does not\n  -- allow unknown namespaces.\n  getNamespaceID   :: NameSpaceIRI\n                      -> NameSpaceIRIs nsID\n                      -> Maybe (NameSpaceIRIs nsID, nsID)\n  -- | Given a namespace id, lookup its IRI. May be overridden for performance.\n  getIRI           :: nsID\n                      -> NameSpaceIRIs nsID\n                      -> Maybe NameSpaceIRI\n  -- | The root element of an XML document has a namespace, too, and the\n  -- \"XML.Light-parser\" is eager to remove the corresponding namespace\n  -- attribute.\n  -- As a result, at least this root namespace must be provided.\n  getInitialIRImap :: NameSpaceIRIs nsID\n\n  getIRI           = M.lookup\n  getInitialIRImap = M.empty\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Generic/SetMap.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.ODT.Generic.SetMap\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nA map of values to sets of values.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Generic.SetMap\n  ( SetMap\n  , empty\n  , fromList\n  , insert\n  , union3\n  ) where\n\nimport qualified Data.Map as M\nimport qualified Data.Set as S\n\ntype SetMap k v = M.Map k (S.Set v)\n\nempty :: SetMap k v\nempty = M.empty\n\nfromList :: (Ord k, Ord v) => [(k,v)] -> SetMap k v\nfromList = foldr (uncurry insert) empty\n\ninsert :: (Ord k, Ord v) => k -> v -> SetMap k v -> SetMap k v\ninsert key value setMap = M.insertWith S.union key (S.singleton value) setMap\n\nunion3 :: (Ord k) => SetMap k v -> SetMap k v -> SetMap k v -> SetMap k v\nunion3 sm1 sm2 sm3 = sm1 `M.union` sm2 `M.union` sm3\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Generic/Utils.hs",
    "content": "{-# LANGUAGE ViewPatterns  #-}\n{- |\n   Module      : Text.Pandoc.Reader.ODT.Generic.Utils\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nGeneral utility functions for the odt reader.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Generic.Utils\n( uncurry3\n, uncurry4\n, uncurry5\n, uncurry6\n, swap\n, reverseComposition\n, tryToRead\n, Lookupable(..)\n, readLookupable\n, readPercent\n, findBy\n, swing\n, composition\n) where\n\nimport Control.Category (Category, (<<<), (>>>))\nimport qualified Control.Category as Cat (id)\nimport Data.Char (isSpace)\nimport qualified Data.Foldable as F (Foldable, foldr)\nimport Data.Maybe\nimport Data.Text (Text)\nimport qualified Data.Text as T\n\n-- | Equivalent to\n-- > foldr (.) id\n-- where '(.)' are 'id' are the ones from \"Control.Category\"\n-- and 'foldr' is the one from \"Data.Foldable\".\n-- The noun-form was chosen to be consistent with 'sum', 'product' etc\n-- based on the discussion at\n-- <https://groups.google.com/forum/#!topic/haskell-cafe/VkOZM1zaHOI>\n-- (that I was not part of)\ncomposition        :: (Category cat, F.Foldable f) => f (cat a a) -> cat a a\ncomposition        = F.foldr (<<<) Cat.id\n\n-- | Equivalent to\n-- > foldr (flip (.)) id\n-- where '(.)' are 'id' are the ones from \"Control.Category\"\n-- and 'foldr' is the one from \"Data.Foldable\".\n-- A reversed version of 'composition'.\nreverseComposition :: (Category cat, F.Foldable f) => f (cat a a) -> cat a a\nreverseComposition = F.foldr (>>>) Cat.id\n\n-- | This function often makes it possible to switch values with the functions\n-- that are applied to them.\n--\n-- Examples:\n-- > swing map :: [a -> b] -> a -> [b]\n-- > swing any :: [a -> Bool] -> a -> Bool\n-- > swing foldr :: b -> a -> [a -> b -> b] -> b\n-- > swing scanr :: c -> a -> [a -> c -> c] -> c\n-- > swing zipWith :: [a -> b -> c] -> a -> [b] -> [c]\n-- > swing find :: [a -> Bool] -> a -> Maybe (a -> Bool)\n--\n-- Stolen from <https://wiki.haskell.org/Pointfree>\nswing :: (((a -> b) -> b) -> c -> d) -> c -> a -> d\nswing = flip.(.flip id)\n-- swing f c a = f ($ a) c\n\n\n-- | Alternative to 'read'/'reads'. The former of these throws errors\n-- (nobody wants that) while the latter returns \"to much\" for simple purposes.\n-- This function instead applies 'reads' and returns the first match (if any)\n-- in a 'Maybe'.\ntryToRead :: (Read r) => Text -> Maybe r\ntryToRead = (reads . T.unpack) >>> listToMaybe >>> fmap fst\n\n-- | A version of 'reads' that requires a '%' sign after the number\nreadPercent :: ReadS Int\nreadPercent s = [ (i,s') | (i   , r ) <- reads s\n                         , (\"%\" , s') <- lex   r\n              ]\n\n-- | Data that can be looked up.\n-- This is mostly a utility to read data with kind *.\nclass Lookupable a where\n  lookupTable :: [(Text, a)]\n\n-- | Very similar to a simple 'lookup' in the 'lookupTable', but with a lexer.\nreadLookupable :: (Lookupable a) => Text -> Maybe a\nreadLookupable s =\n  lookup (T.takeWhile (not . isSpace) $ T.dropWhile isSpace s) lookupTable\n\nuncurry3 :: (a->b->c                -> z) -> (a,b,c          ) -> z\nuncurry4 :: (a->b->c->d             -> z) -> (a,b,c,d        ) -> z\nuncurry5 :: (a->b->c->d->e          -> z) -> (a,b,c,d,e      ) -> z\nuncurry6 :: (a->b->c->d->e->f       -> z) -> (a,b,c,d,e,f    ) -> z\n\nuncurry3 fun (a,b,c          ) = fun a b c\nuncurry4 fun (a,b,c,d        ) = fun a b c d\nuncurry5 fun (a,b,c,d,e      ) = fun a b c d e\nuncurry6 fun (a,b,c,d,e,f    ) = fun a b c d e f\n\nswap :: (a,b) -> (b,a)\nswap (a,b) = (b,a)\n\n-- | A version of \"Data.List.find\" that uses a converter to a Maybe instance.\n-- The returned value is the first which the converter returns in a 'Just'\n-- wrapper.\nfindBy :: (a -> Maybe b) -> [a] -> Maybe b\nfindBy _               []   = Nothing\nfindBy f ((f -> Just x):_ ) = Just x\nfindBy f (            _:xs) = findBy f xs\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Generic/XMLConverter.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TupleSections   #-}\n{-# LANGUAGE GADTs           #-}\n{-# LANGUAGE LambdaCase      #-}\n{-# LANGUAGE PatternGuards   #-}\n{- |\n   Module      : Text.Pandoc.Readers.ODT.Generic.XMLConverter\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nA generalized XML parser based on stateful arrows.\nIt might be sufficient to define this reader as a comonad, but there is\nnot a lot of use in trying.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Generic.XMLConverter\n( ElementName\n, XMLConverterState\n, XMLConverter\n, FallibleXMLConverter\n, runConverter'\n, getExtraState\n, setExtraState\n, modifyExtraState\n, producingExtraState\n, findChild'\n, filterChildrenName'\n, isSet'\n, isSetWithDefault\n, elName\n, searchAttr\n, lookupAttr\n, lookupAttr'\n, lookupDefaultingAttr\n, findAttr'\n, findAttrText'\n, findAttr\n, findAttrText\n, findAttrTextWithDefault\n, readAttr\n, readAttr'\n, readAttrWithDefault\n, getAttr\n, executeIn\n, executeInSub\n, withEveryL\n, tryAll\n, matchContent'\n, matchContent\n) where\n\nimport           Prelude hiding (Applicative(..))\nimport           Control.Applicative  hiding ( liftA, liftA2 )\nimport           Control.Monad               ( MonadPlus )\nimport           Control.Arrow\n\nimport           Data.Bool ( bool )\nimport           Data.Either ( rights )\nimport qualified Data.Map             as M\nimport           Data.Text (Text)\nimport           Data.Default\nimport           Data.Maybe\nimport qualified Data.List as L\nimport qualified Data.List.NonEmpty as NonEmpty\nimport           Data.List.NonEmpty (NonEmpty(..))\n\nimport qualified Text.Pandoc.XML.Light as XML\n\nimport           Text.Pandoc.Readers.ODT.Arrows.State\nimport           Text.Pandoc.Readers.ODT.Arrows.Utils\nimport           Text.Pandoc.Readers.ODT.Generic.Namespaces\nimport           Text.Pandoc.Readers.ODT.Generic.Utils\nimport           Text.Pandoc.Readers.ODT.Generic.Fallible\n\n--------------------------------------------------------------------------------\n--  Basis types for readability\n--------------------------------------------------------------------------------\n\n--\ntype ElementName           = Text\ntype AttributeName         = Text\ntype AttributeValue        = Text\ntype TextAttributeValue    = Text\n\n--\ntype NameSpacePrefix       = Text\n\n--\ntype NameSpacePrefixes nsID = M.Map nsID NameSpacePrefix\n\n--------------------------------------------------------------------------------\n-- Main converter state\n--------------------------------------------------------------------------------\n\n-- GADT so some of the NameSpaceID restrictions can be deduced\ndata XMLConverterState nsID extraState where\n  XMLConverterState :: NameSpaceID nsID\n    => { -- | A stack of parent elements. The top element is the current one.\n         -- Arguably, a real Zipper would be better. But that is an\n         -- optimization that can be made at a later time, e.g. when\n         -- replacing Text.XML.Light.\n         parentElements    :: NonEmpty XML.Element\n         -- | A map from internal namespace IDs to the namespace prefixes\n         -- used in XML elements\n       , namespacePrefixes :: NameSpacePrefixes nsID\n         -- | A map from internal namespace IDs to namespace IRIs\n         -- (Only necessary for matching namespace IDs and prefixes)\n       , namespaceIRIs     :: NameSpaceIRIs nsID\n         -- | A place to put \"something else\". This feature is used heavily\n         -- to keep the main code cleaner. More specifically, the main reader\n         -- is divided into different stages. Each stage lifts something up\n         -- here, which the next stage can then use. This could of course be\n         -- generalized to a state-tree or used for the namespace IRIs. The\n         -- border between states and values is an imaginary one, after all.\n         -- But the separation as it is seems to be enough for now.\n       , moreState         :: extraState\n       }\n    -> XMLConverterState nsID extraState\n\n--\ncreateStartState :: (NameSpaceID nsID)\n                    => XML.Element\n                    -> extraState\n                    -> XMLConverterState nsID extraState\ncreateStartState element extraState =\n  XMLConverterState\n       { parentElements    = element :| []\n       , namespacePrefixes = M.empty\n       , namespaceIRIs     = getInitialIRImap\n       , moreState         = extraState\n       }\n\n-- | Functor over extra state\ninstance Functor (XMLConverterState nsID) where\n  fmap f ( XMLConverterState parents prefixes iRIs    extraState  )\n       =   XMLConverterState parents prefixes iRIs (f extraState)\n\n--\nreplaceExtraState   :: extraState\n                    -> XMLConverterState nsID _x\n                    -> XMLConverterState nsID extraState\nreplaceExtraState x s\n                     = fmap (const x) s\n\n--\ncurrentElement      :: XMLConverterState nsID extraState\n                    -> XML.Element\ncurrentElement state = NonEmpty.head (parentElements state)\n\n-- | Replace the current position by another, modifying the extra state\n-- in the process\nswapStack'          :: XMLConverterState nsID extraState\n                    -> NonEmpty XML.Element\n                    -> ( XMLConverterState nsID extraState\n                       , NonEmpty XML.Element )\nswapStack' state stack\n                     = ( state { parentElements = stack }\n                       , parentElements state\n                       )\n\n--\npushElement         :: XML.Element\n                    -> XMLConverterState nsID extraState\n                    -> XMLConverterState nsID extraState\npushElement e state  = state { parentElements =\n                                 NonEmpty.cons e (parentElements state) }\n\n-- | Pop the top element from the call stack, unless it is the last one.\npopElement          :: XMLConverterState nsID extraState\n                    -> Maybe (XMLConverterState nsID extraState)\npopElement state\n  | _ :| (e:es) <- parentElements state\n                = Just $ state { parentElements = e :| es }\n  | otherwise   = Nothing\n\n--------------------------------------------------------------------------------\n-- Main type\n--------------------------------------------------------------------------------\n\n-- It might be a good idea to pack the converters in a GADT\n-- Downside: data instead of type\n-- Upside: 'Failure' could be made a parameter as well.\n\n--\ntype XMLConverter nsID extraState input output\n      = ArrowState (XMLConverterState nsID extraState ) input output\n\ntype FallibleXMLConverter nsID extraState input output\n     = XMLConverter nsID extraState input (Fallible output)\n\n--\nrunConverter     :: XMLConverter nsID extraState input output\n                 -> XMLConverterState nsID extraState\n                 -> input\n                 -> output\nrunConverter converter state input = snd $ runArrowState converter (state,input)\n\nrunConverter' :: (NameSpaceID nsID)\n              => FallibleXMLConverter nsID extraState () success\n              -> extraState\n              -> XML.Element\n              -> Fallible success\nrunConverter' converter extraState element = runConverter (readNSattributes >>? converter) (createStartState element extraState) ()\n\n--\ngetCurrentElement :: XMLConverter nsID extraState x XML.Element\ngetCurrentElement  = extractFromState currentElement\n\n--\ngetExtraState     :: XMLConverter nsID extraState x extraState\ngetExtraState      = extractFromState moreState\n\n--\nsetExtraState     :: XMLConverter nsID extraState extraState extraState\nsetExtraState      = withState $ \\state extra\n                                  -> (replaceExtraState extra state , extra)\n\n\n-- | Lifts a function to the extra state.\nmodifyExtraState  :: (extraState -> extraState)\n                  -> XMLConverter nsID extraState x x\nmodifyExtraState   = modifyState.fmap\n\n\n-- | First sets the extra state to the new value. Then modifies the original\n-- extra state with a converter that uses the new state. Finally, the\n-- intermediate state is dropped and the extra state is lifted into the\n-- state as it was at the beginning of the function.\n-- As a result, exactly the extra state and nothing else is changed.\n-- The resulting converter even behaves like an identity converter on the\n-- value level.\n--\n-- (The -ing form is meant to be mnemonic in a sequence of arrows as in\n--  convertingExtraState () converter >>> doOtherStuff)\n--\nconvertingExtraState :: extraState'\n                     -> FallibleXMLConverter nsID extraState' extraState extraState\n                     -> FallibleXMLConverter nsID extraState x x\nconvertingExtraState v a = withSubStateF setVAsExtraState modifyWithA\n  where\n    setVAsExtraState     = liftAsSuccess $ extractFromState id >>^ replaceExtraState v\n    modifyWithA          = keepingTheValue (moreState ^>> a)\n                           >>^ spreadChoice >>?% flip replaceExtraState\n\n-- | First sets the extra state to the new value. Then produces a new\n-- extra state with a converter that uses the new state. Finally, the\n-- intermediate state is dropped and the extra state is lifted into the\n-- state as it was at the beginning of the function.\n-- As a result, exactly the extra state and nothing else is changed.\n-- The resulting converter even behaves like an identity converter on the\n-- value level.\n--\n-- Equivalent to\n--\n-- > \\v x a -> convertingExtraState v (returnV x >>> a)\n--\n-- (The -ing form is meant to be mnemonic in a sequence of arrows as in\n--  producingExtraState () () producer >>> doOtherStuff)\n--\nproducingExtraState  :: extraState'\n                     -> a\n                     -> FallibleXMLConverter nsID extraState' a extraState\n                     -> FallibleXMLConverter nsID extraState x x\nproducingExtraState v x a = convertingExtraState v (returnV x >>> a)\n\n\n--------------------------------------------------------------------------------\n-- Work in namespaces\n--------------------------------------------------------------------------------\n\n-- | Arrow version of 'getIRI'\nlookupNSiri             :: (NameSpaceID nsID)\n                        => nsID\n                        -> XMLConverter nsID extraState x (Maybe NameSpaceIRI)\nlookupNSiri nsID        = extractFromState\n                          $ \\state -> getIRI nsID $ namespaceIRIs state\n\n--\nlookupNSprefix           :: (NameSpaceID nsID)\n                         => nsID\n                         -> XMLConverter nsID extraState x (Maybe NameSpacePrefix)\nlookupNSprefix nsID      = extractFromState\n                           $ \\state -> M.lookup nsID $ namespacePrefixes state\n\n-- | Extracts namespace attributes from the current element and tries to\n-- update the current mapping accordingly\nreadNSattributes         :: (NameSpaceID nsID)\n                         => FallibleXMLConverter nsID extraState x ()\nreadNSattributes         = fromState $ \\state -> maybe (state, failEmpty     )\n                                                       (     , succeedWith ())\n                                                       (extractNSAttrs state )\n  where\n    extractNSAttrs       :: (NameSpaceID nsID)\n                         => XMLConverterState nsID extraState\n                         -> Maybe (XMLConverterState nsID extraState)\n    extractNSAttrs startState\n                         = L.foldl' (\\state d -> state >>= addNS d)\n                                 (Just startState)\n                                 nsAttribs\n      where nsAttribs    = mapMaybe readNSattr (XML.elAttribs element)\n            element      = currentElement startState\n            readNSattr (XML.Attr (XML.QName name _ (Just \"xmlns\")) iri)\n                         = Just (name, iri)\n            readNSattr _ = Nothing\n    addNS  (prefix, iri) state = fmap updateState\n                                 $ getNamespaceID iri\n                                 $ namespaceIRIs state\n      where updateState (iris,nsID)\n                         = state { namespaceIRIs     = iris\n                                 , namespacePrefixes = M.insert nsID prefix\n                                                       $ namespacePrefixes state\n                                 }\n\n--------------------------------------------------------------------------------\n-- Common namespace accessors\n--------------------------------------------------------------------------------\n\n-- | Given a namespace id and an element name, creates a 'XML.QName' for\n-- internal use\nqualifyName              :: (NameSpaceID nsID)\n                         => nsID -> ElementName\n                         -> XMLConverter nsID extraState x XML.QName\nqualifyName nsID name    =         lookupNSiri nsID\n                               &&& lookupNSprefix nsID\n                           >>% XML.QName name\n\n-- | Checks if a given element matches both a specified namespace id\n-- and a predicate\nelemNameMatches          :: (NameSpaceID nsID)\n                         => nsID -> (ElementName -> Bool)\n                         -> XMLConverter nsID extraState XML.Element Bool\nelemNameMatches nsID f    = keepingTheValue (lookupNSiri nsID) >>% hasMatchingName\n  where hasMatchingName e iri = let name = XML.elName e\n                                in     f (XML.qName name)\n                                    && XML.qURI name == iri\n\n-- | Checks if a given element matches both a specified namespace id\n-- and a specified element name\nelemNameIs               :: (NameSpaceID nsID)\n                         => nsID -> ElementName\n                         -> XMLConverter nsID extraState XML.Element Bool\nelemNameIs nsID name     = elemNameMatches nsID (== name)\n\n--------------------------------------------------------------------------------\n-- General content\n--------------------------------------------------------------------------------\n\nelName :: XML.Element -> ElementName\nelName = XML.qName . XML.elName\n\n--\nelContent               :: XMLConverter nsID extraState x [XML.Content]\nelContent               =     getCurrentElement\n                           >>^ XML.elContent\n\n--------------------------------------------------------------------------------\n-- Children\n--------------------------------------------------------------------------------\n\n--\n--\nfindChildren             :: (NameSpaceID nsID)\n                         => nsID -> ElementName\n                         -> XMLConverter nsID extraState x [XML.Element]\nfindChildren nsID name   =         qualifyName nsID name\n                               &&& getCurrentElement\n                           >>% XML.findChildren\n\n--\nfindChild'              :: (NameSpaceID nsID)\n                        => nsID\n                        -> ElementName\n                        -> XMLConverter nsID extraState x (Maybe XML.Element)\nfindChild' nsID name    =         qualifyName nsID name\n                              &&& getCurrentElement\n                          >>% XML.findChild\n\n--\nfindChild              :: (NameSpaceID nsID)\n                       => nsID -> ElementName\n                       -> FallibleXMLConverter nsID extraState x XML.Element\nfindChild nsID name    =     findChild' nsID name\n                         >>> maybeToChoice\n\nfilterChildrenName'        :: (NameSpaceID nsID)\n                           => nsID\n                           -> (ElementName -> Bool)\n                           -> XMLConverter nsID extraState x [XML.Element]\nfilterChildrenName' nsID f =     getCurrentElement\n                             >>> arr XML.elChildren\n                             >>> iterateS (keepingTheValue (elemNameMatches nsID f))\n                             >>> arr (map fst . filter snd)\n\n--------------------------------------------------------------------------------\n-- Attributes\n--------------------------------------------------------------------------------\n\n--\nisSet'                   :: (NameSpaceID nsID)\n                         => nsID -> AttributeName\n                         -> XMLConverter nsID extraState x (Maybe Bool)\nisSet' nsID attrName     =     findAttr' nsID attrName\n                           >>^ (>>= stringToBool')\n\nisSetWithDefault         :: (NameSpaceID nsID)\n                         => nsID -> AttributeName\n                         -> Bool\n                         -> XMLConverter nsID extraState x Bool\nisSetWithDefault nsID attrName def'\n                         =     isSet' nsID attrName\n                           >>^ fromMaybe def'\n\n-- | Lookup value in a dictionary, fail if no attribute found or value\n-- not in dictionary\nsearchAttrIn             :: (NameSpaceID nsID)\n                         => nsID -> AttributeName\n                         -> [(AttributeValue,a)]\n                         -> FallibleXMLConverter nsID extraState x a\nsearchAttrIn nsID attrName dict\n                         =       findAttr nsID attrName\n                           >>?^? maybeToChoice.(`lookup` dict )\n\n-- | Lookup value in a dictionary. If attribute or value not found,\n-- return default value\nsearchAttr               :: (NameSpaceID nsID)\n                         => nsID -> AttributeName\n                         -> a\n                         -> [(AttributeValue,a)]\n                         -> XMLConverter nsID extraState x a\nsearchAttr nsID attrName defV dict\n                         =     searchAttrIn nsID attrName dict\n                           >>> const defV ^|||^ id\n\n-- | Read a 'Lookupable' attribute. Fail if no match.\nlookupAttr               :: (NameSpaceID nsID, Lookupable a)\n                         => nsID -> AttributeName\n                         -> FallibleXMLConverter nsID extraState x a\nlookupAttr nsID attrName =     lookupAttr' nsID attrName\n                           >>^ maybeToChoice\n\n\n-- | Read a 'Lookupable' attribute. Return the result as a 'Maybe'.\nlookupAttr'              :: (NameSpaceID nsID, Lookupable a)\n                         => nsID -> AttributeName\n                         -> XMLConverter nsID extraState x (Maybe a)\nlookupAttr' nsID attrName\n                         =     findAttr' nsID attrName\n                           >>^ (>>= readLookupable)\n\n-- | Read a 'Lookupable' attribute with explicit default\nlookupAttrWithDefault    :: (NameSpaceID nsID, Lookupable a)\n                         => nsID -> AttributeName\n                         -> a\n                         -> XMLConverter nsID extraState x a\nlookupAttrWithDefault nsID attrName deflt\n                         =     lookupAttr' nsID attrName\n                           >>^ fromMaybe deflt\n\n-- | Read a 'Lookupable' attribute with implicit default\nlookupDefaultingAttr     :: (NameSpaceID nsID, Lookupable a, Default a)\n                         => nsID -> AttributeName\n                         -> XMLConverter nsID extraState x a\nlookupDefaultingAttr nsID attrName\n                         = lookupAttrWithDefault nsID attrName def\n\n-- | Return value as a (Maybe Text)\nfindAttr'               :: (NameSpaceID nsID)\n                        => nsID -> AttributeName\n                        -> XMLConverter nsID extraState x (Maybe AttributeValue)\nfindAttr' nsID attrName =         qualifyName nsID attrName\n                              &&& getCurrentElement\n                          >>% XML.findAttr\n\n-- | Return value as a (Maybe Text)\nfindAttrText'           :: (NameSpaceID nsID)\n                        => nsID -> AttributeName\n                        -> XMLConverter nsID extraState x (Maybe TextAttributeValue)\nfindAttrText' nsID attrName\n                        =         qualifyName nsID attrName\n                              &&& getCurrentElement\n                          >>% XML.findAttr\n\n-- | Return value as string or fail\nfindAttr               :: (NameSpaceID nsID)\n                       => nsID -> AttributeName\n                       -> FallibleXMLConverter nsID extraState x AttributeValue\nfindAttr nsID attrName =     findAttr' nsID attrName\n                         >>> maybeToChoice\n\n-- | Return value as text or fail\nfindAttrText           :: (NameSpaceID nsID)\n                       => nsID -> AttributeName\n                       -> FallibleXMLConverter nsID extraState x TextAttributeValue\nfindAttrText nsID attrName\n                       = findAttr' nsID attrName\n                         >>> maybeToChoice\n\n-- | Return value as string or return provided default value\nfindAttrTextWithDefault :: (NameSpaceID nsID)\n                        => nsID -> AttributeName\n                        -> TextAttributeValue\n                        -> XMLConverter nsID extraState x TextAttributeValue\nfindAttrTextWithDefault nsID attrName deflt\n                       = findAttr' nsID attrName\n                         >>^ fromMaybe deflt\n\n-- | Read and return value or fail\nreadAttr               :: (NameSpaceID nsID, Read attrValue)\n                       => nsID -> AttributeName\n                       -> FallibleXMLConverter nsID extraState x attrValue\nreadAttr nsID attrName =     readAttr' nsID attrName\n                         >>> maybeToChoice\n\n-- | Read and return value or return Nothing\nreadAttr'              :: (NameSpaceID nsID, Read attrValue)\n                       => nsID -> AttributeName\n                       -> XMLConverter nsID extraState x (Maybe attrValue)\nreadAttr' nsID attrName =     findAttr' nsID attrName\n                          >>^ (>>= tryToRead)\n\n-- | Read and return value or return provided default value\nreadAttrWithDefault    :: (NameSpaceID nsID, Read attrValue)\n                       => nsID -> AttributeName\n                       -> attrValue\n                       -> XMLConverter nsID extraState x attrValue\nreadAttrWithDefault nsID attrName deflt\n                       =     findAttr' nsID attrName\n                         >>^ (>>= tryToRead)\n                         >>^ fromMaybe deflt\n\n-- | Read and return value or return default value from 'Default' instance\ngetAttr                :: (NameSpaceID nsID, Read attrValue, Default attrValue)\n                       => nsID -> AttributeName\n                       -> XMLConverter nsID extraState x attrValue\ngetAttr nsID attrName  = readAttrWithDefault nsID attrName def\n\n--------------------------------------------------------------------------------\n-- Movements\n--------------------------------------------------------------------------------\n\n--\njumpThere              :: XMLConverter nsID extraState XML.Element XML.Element\njumpThere              = withState (\\state element\n                                     -> ( pushElement element state , element )\n                                   )\n\n--\nswapStack             :: XMLConverter nsID extraState (NonEmpty XML.Element)\n                                                      (NonEmpty XML.Element)\nswapStack             = withState swapStack'\n\n--\njumpBack               :: FallibleXMLConverter nsID extraState _x _x\njumpBack               = tryModifyState (popElement >>> maybeToChoice)\n\n-- | Support function for \"procedural\" converters: jump to an element, execute\n-- a converter, jump back.\n-- This version is safer than 'executeThere', because it does not rely on the\n-- internal stack. As a result, the converter can not move around in arbitrary\n-- ways. The downside is of course that some of the environment is not\n-- accessible to the converter.\nswitchingTheStack      :: XMLConverter nsID moreState a b\n                       -> XMLConverter nsID moreState (a, XML.Element) b\nswitchingTheStack a    =     second ( (:| []) ^>> swapStack )\n                         >>> first  a\n                         >>> second swapStack\n                         >>^ fst\n\n-- | Support function for \"procedural\" converters: jumps to an element, executes\n-- a converter, jumps back.\n-- Make sure that the converter is well-behaved; that is it should\n-- return to the exact position it started from in /every possible path/ of\n-- execution, even if it \"fails\". If it does not, you may encounter\n-- strange bugs. If you are not sure about the behaviour or want to use\n-- shortcuts, you can often use 'switchingTheStack' instead.\nexecuteThere           :: FallibleXMLConverter nsID moreState a b\n                       -> FallibleXMLConverter nsID moreState (a, XML.Element) b\nexecuteThere a         =      second jumpThere\n                          >>> fst\n                          ^>> a\n                          >>> jumpBack -- >>? jumpBack  would not ensure the jump.\n                          >>^ collapseEither\n\n\n-- | Do something in a specific element, then come back\nexecuteIn   :: XMLConverter nsID extraState XML.Element s\n            -> XMLConverter nsID extraState XML.Element s\nexecuteIn a = duplicate >>> switchingTheStack a\n\n-- | Do something in a sub-element, then come back\nexecuteInSub              :: (NameSpaceID nsID)\n                          => nsID -> ElementName\n                          -> FallibleXMLConverter nsID extraState f s\n                          -> FallibleXMLConverter nsID extraState f s\nexecuteInSub nsID name a  =     keepingTheValue\n                                  (findChild nsID name)\n                            >>> ignoringState liftFailure\n                            >>? switchingTheStack a\n  where liftFailure (_, Left  f) = Left  f\n        liftFailure (x, Right e) = Right (x, e)\n\n--------------------------------------------------------------------------------\n-- Iterating over children\n--------------------------------------------------------------------------------\n\n-- Helper converter to prepare different types of iterations.\n-- It lifts the children (of a certain type) of the current element\n-- into the value level and pairs each one with the current input value.\nprepareIteration       :: (NameSpaceID nsID)\n                       => nsID -> ElementName\n                       -> XMLConverter nsID extraState b [(b, XML.Element)]\nprepareIteration nsID name =     keepingTheValue\n                                   (findChildren nsID name)\n                             >>% distributeValue\n\n--\nwithEveryL             :: (NameSpaceID nsID)\n                       => nsID -> ElementName\n                       -> FallibleXMLConverter nsID extraState a  b\n                       -> FallibleXMLConverter nsID extraState a [b]\nwithEveryL = withEvery\n\n-- | Applies a converter to every child element of a specific type.\n-- Collects results in a 'MonadPlus'.\n-- Fails completely if any conversion fails.\nwithEvery              :: (NameSpaceID nsID, MonadPlus m)\n                       => nsID -> ElementName\n                       -> FallibleXMLConverter nsID extraState a    b\n                       -> FallibleXMLConverter nsID extraState a (m b)\nwithEvery nsID name a      =     prepareIteration nsID name\n                             >>> iterateS' (switchingTheStack a)\n\n-- | Applies a converter to every child element of a specific type.\n-- Collects all successful results in a list.\ntryAll                 :: (NameSpaceID nsID)\n                       => nsID -> ElementName\n                       -> FallibleXMLConverter nsID extraState b  a\n                       ->         XMLConverter nsID extraState b [a]\ntryAll nsID name a         =     prepareIteration nsID name\n                             >>> iterateS (switchingTheStack a)\n                             >>^ rights\n\n--------------------------------------------------------------------------------\n-- Matching children\n--------------------------------------------------------------------------------\n\ntype IdXMLConverter nsID moreState x\n   = XMLConverter   nsID moreState x x\n\ntype MaybeCConverter nsID moreState x\n   = Maybe (IdXMLConverter nsID moreState (x, XML.Content))\n\n-- Chainable converter that helps deciding which converter to actually use.\ntype ContentMatchConverter nsID extraState x\n   = IdXMLConverter  nsID\n                     extraState\n                     (MaybeCConverter nsID extraState x, XML.Content)\n\n-- Helper function: The @c@ is actually a converter that is to be selected by\n-- matching XML content to the first two parameters.\n-- The fold used to match elements however is very simple, so to use it,\n-- this function wraps the converter in another converter that unifies\n-- the accumulator. Think of a lot of converters with the resulting type\n-- chained together. The accumulator not only transports the element\n-- unchanged to the next matcher, it also does the actual selecting by\n-- combining the intermediate results with '(<|>)'.\nmakeMatcherC           :: (NameSpaceID nsID)\n                       => nsID -> ElementName\n                       -> FallibleXMLConverter  nsID extraState a a\n                       -> ContentMatchConverter nsID extraState a\nmakeMatcherC nsID name c = (    second (    contentToElem\n                                         >>> returnV Nothing\n                                         ||| (    elemNameIs nsID name\n                                              >>^ bool Nothing (Just cWithJump)\n                                             )\n                                        )\n                             >>% (<|>)\n                           ) &&&^ snd\n  where cWithJump =      ( fst\n                           ^&&& (      second contentToElem\n                                  >>>  spreadChoice\n                                  ^>>? executeThere c\n                                )\n                            >>% recover)\n                    &&&^ snd\n        contentToElem :: FallibleXMLConverter nsID extraState XML.Content XML.Element\n        contentToElem = arr $ \\case\n                                     XML.Elem e' -> succeedWith e'\n                                     _           -> failEmpty\n\n-- Creates and chains a bunch of matchers\nprepareMatchersC      :: (NameSpaceID nsID)\n                       => [(nsID, ElementName, FallibleXMLConverter nsID extraState x x)]\n                       -> ContentMatchConverter nsID extraState x\n--prepareMatchersC      = foldSs . (map $ uncurry3  makeMatcherC)\nprepareMatchersC      = reverseComposition . map (uncurry3  makeMatcherC)\n\n-- | Takes a list of element-data - converter groups and\n-- * Finds all content of the current element\n-- * Matches each group to each piece of content in order\n--   (at most one group per piece of content)\n-- * Filters non-matched content\n-- * Chains all found converters in content-order\n-- * Applies the chain to the input element\nmatchContent'           :: (NameSpaceID nsID)\n                       => [(nsID, ElementName, FallibleXMLConverter nsID extraState a a)]\n                       -> XMLConverter nsID extraState a a\nmatchContent' lookups   = matchContent lookups (arr fst)\n\n-- | Takes a list of element-data - converter groups and\n-- * Finds all content of the current element\n-- * Matches each group to each piece of content in order\n--   (at most one group per piece of content)\n-- * Adds a default converter for all non-matched content\n-- * Chains all found converters in content-order\n-- * Applies the chain to the input element\nmatchContent          :: (NameSpaceID nsID)\n                       => [(nsID, ElementName, FallibleXMLConverter nsID extraState a a)]\n                       -> XMLConverter nsID extraState (a,XML.Content) a\n                       -> XMLConverter nsID extraState a a\nmatchContent lookups fallback\n                        = let matcher = prepareMatchersC lookups\n                          in  keepingTheValue (\n                                   elContent\n                               >>> map (Nothing,)\n                               ^>> iterateSL matcher\n                               >>^ map swallowOrFallback\n                              -- >>> foldSs\n                               >>> reverseComposition\n                             )\n                         >>> swap\n                         ^>> app\n  where\n        -- let the converter swallow the content and drop the content\n        -- in the return value\n        swallowOrFallback (Just converter,content) = (,content) ^>> converter >>^ fst\n        swallowOrFallback (Nothing       ,content) = (,content) ^>> fallback\n\n--------------------------------------------------------------------------------\n-- Internals\n--------------------------------------------------------------------------------\n\nstringToBool' :: Text -> Maybe Bool\nstringToBool' val | val `elem` trueValues  = Just True\n                  | val `elem` falseValues = Just False\n                  | otherwise              = Nothing\n  where trueValues  = [\"true\" ,\"on\" ,\"1\"]\n        falseValues = [\"false\",\"off\",\"0\"]\n\n\ndistributeValue ::  a -> [b] -> [(a,b)]\ndistributeValue = map.(,)\n\n--------------------------------------------------------------------------------\n\n{-\nNOTES\nIt might be a good idea to refactor the namespace stuff.\nE.g.: if a namespace constructor took a string as a parameter, things like\n> a ?>/< (NsText,\"body\")\nwould be nicer.\nTogether with a rename and some trickery, something like\n> |< NsText \"body\" >< NsText \"p\" ?> a </> </>|\nmight even be possible.\n\nSome day, XML.Light should be replaced by something better.\nWhile doing that, it might be useful to replace String as the type of element\nnames with something else, too. (Of course with OverloadedStrings).\nWhile doing that, maybe the types can be created in a way that something like\n> NsText:\"body\"\ncould be used. Overloading (:) does not sounds like the best idea, but if the\nelement name type was a list, this might be possible.\nOf course that would be a bit hackish, so the \"right\" way would probably be\nsomething like\n> InNS NsText \"body\"\nbut isn't that a bit boring? ;)\n-}\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/Namespaces.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Reader.ODT.Namespaces\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nNamespaces used in odt files.\n-}\n\nmodule Text.Pandoc.Readers.ODT.Namespaces ( Namespace (..)\n                                          ) where\n\nimport qualified Data.Map as M (empty, insert)\nimport Data.Maybe (fromMaybe, listToMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Readers.ODT.Generic.Namespaces\n\n\ninstance NameSpaceID Namespace where\n\n  getInitialIRImap     = nsIDmap\n\n  getNamespaceID \"\"  m = Just(m, NsXML)\n  getNamespaceID iri m = asPair $ fromMaybe (NsOther iri) (findID iri)\n    where asPair nsID = Just (M.insert nsID iri m, nsID)\n\n\nfindID :: NameSpaceIRI -> Maybe Namespace\nfindID iri = listToMaybe [nsID | (iri',nsID) <- nsIDs, iri' `T.isPrefixOf` iri]\n\nnsIDmap :: NameSpaceIRIs Namespace\nnsIDmap = foldr (uncurry $ flip M.insert) M.empty nsIDs\n\ndata Namespace = -- Open Document core\n                 NsOffice | NsStyle  | NsText   | NsTable  | NsForm\n               | NsDraw   | Ns3D     | NsAnim   | NsChart  | NsConfig\n               | NsDB     | NsMeta   | NsNumber | NsScript | NsManifest\n               | NsPresentation\n                 -- Metadata\n               | NsODF\n                 -- Compatible elements\n               | NsXSL_FO  | NsSVG    | NsSmil\n                 -- External standards\n               | NsMathML | NsXForms | NsXLink  | NsXHtml  | NsGRDDL\n               | NsDublinCore\n                 -- Metadata manifest\n               | NsPKG\n                 -- Others\n               | NsOpenFormula\n                 -- Core XML (basically only for the 'id'-attribute)\n               | NsXML\n                 -- Fallback\n               | NsOther Text\n  deriving ( Eq, Ord, Show )\n\n-- | Not the actual iri's, but large prefixes of them - this way there are\n-- less versioning problems and the like.\nnsIDs :: [(Text, Namespace)]\nnsIDs = [\n  (\"urn:oasis:names:tc:opendocument:xmlns:animation\"        , NsAnim         ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:chart\"            , NsChart        ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:config\"           , NsConfig       ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:database\"         , NsDB           ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:dr3d\"             , Ns3D           ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:drawing\"          , NsDraw         ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:form\"             , NsForm         ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:manifest\"         , NsManifest     ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:meta\"             , NsMeta         ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:datastyle\"        , NsNumber       ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:of\"               , NsOpenFormula  ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\"       , NsOffice       ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:presentation\"     , NsPresentation ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:script\"           , NsScript       ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:style\"            , NsStyle        ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:table\"            , NsTable        ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:text\"             , NsText         ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible\", NsXSL_FO       ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:smil-compatible\"  , NsSmil         ),\n  (\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible\"   , NsSVG          ),\n  (\"http://docs.oasis-open.org/ns/office/1.2/meta/odf\"      , NsODF          ),\n  (\"http://docs.oasis-open.org/ns/office/1.2/meta/pkg\"      , NsPKG          ),\n  (\"http://purl.org/dc/elements\"                            , NsDublinCore   ),\n  (\"http://www.w3.org/2003/g/data-view\"                     , NsGRDDL        ),\n  (\"http://www.w3.org/1998/Math/MathML\"                     , NsMathML       ),\n  (\"http://www.w3.org/1999/xhtml\"                           , NsXHtml        ),\n  (\"http://www.w3.org/2002/xforms\"                          , NsXForms       ),\n  (\"http://www.w3.org/1999/xlink\"                           , NsXLink        )\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT/StyleReader.hs",
    "content": "{-# LANGUAGE CPP             #-}\n{-# LANGUAGE Arrows          #-}\n{-# LANGUAGE RecordWildCards #-}\n{-# LANGUAGE TupleSections   #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.ODT.StyleReader\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nReader for the style information in an odt document.\n-}\n\nmodule Text.Pandoc.Readers.ODT.StyleReader\n( Style                (..)\n, StyleName\n, StyleFamily          (..)\n, Styles               (..)\n, StyleProperties      (..)\n, TextProperties       (..)\n, ParaProperties       (..)\n, VerticalTextPosition (..)\n, ListItemNumberFormat (..)\n, ListLevel\n, ListStyle            (..)\n, ListLevelStyle       (..)\n, ListLevelType        (..)\n, LengthOrPercent      (..)\n, lookupStyle\n, getListLevelStyle\n, getStyleFamily\n, lookupDefaultStyle'\n, lookupListStyleByName\n, extendedStylePropertyChain\n, readStylesAt\n) where\n\nimport Prelude hiding (Applicative(..))\nimport Control.Applicative hiding (liftA, liftA2, liftA3)\nimport Control.Arrow\n\nimport Data.Default\nimport qualified Data.Foldable as F\nimport qualified Data.List as L\nimport qualified Data.Map as M\nimport Data.Maybe\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Set as S\n\nimport qualified Text.Pandoc.XML.Light as XML\n\nimport Text.Pandoc.Shared (safeRead, tshow)\n\nimport Text.Pandoc.Readers.ODT.Arrows.Utils\n\nimport Text.Pandoc.Readers.ODT.Generic.Fallible\nimport qualified Text.Pandoc.Readers.ODT.Generic.SetMap as SM\nimport Text.Pandoc.Readers.ODT.Generic.Utils\nimport Text.Pandoc.Readers.ODT.Generic.XMLConverter\n\nimport Text.Pandoc.Readers.ODT.Base\nimport Text.Pandoc.Readers.ODT.Namespaces\n\nreadStylesAt :: XML.Element -> Fallible Styles\nreadStylesAt e = runConverter' readAllStyles mempty e\n\n--------------------------------------------------------------------------------\n-- Reader for font declarations and font pitches\n--------------------------------------------------------------------------------\n\n-- Pandoc has no support for different font pitches. Yet knowing them can be\n-- very helpful in cases where Pandoc has more semantics than OpenDocument.\n-- In these cases, the pitch can help deciding as what to define a block of\n-- text. So let's start with a type for font pitches:\n\ndata FontPitch    = PitchVariable | PitchFixed\n  deriving ( Eq, Show )\n\ninstance Lookupable FontPitch where\n  lookupTable = [ (\"variable\" , PitchVariable)\n                , (\"fixed\"    , PitchFixed   )\n                ]\n\ninstance Default FontPitch where\n  def = PitchVariable\n\n-- The font pitch can be specified in a style directly. Normally, however,\n-- it is defined in the font. That is also the specs' recommendation.\n--\n-- Thus, we want\n\ntype FontFaceName = Text\n\ntype FontPitches = M.Map FontFaceName FontPitch\n\n-- To get there, the fonts have to be read and the pitches extracted.\n-- But the resulting map are only needed at one later place, so it should not be\n-- transported on the value level, especially as we already use a state arrow.\n-- So instead, the resulting map is lifted into the state of the reader.\n-- (An alternative might be ImplicitParams, but again, we already have a state.)\n--\n-- So the main style readers will have the types\ntype StyleReader     a b  = XMLReader     FontPitches a b\n-- and\ntype StyleReaderSafe a b  = XMLReaderSafe FontPitches a b\n-- respectively.\n--\n-- But before we can work with these, we need to define the reader that reads\n-- the fonts:\n\n-- | A reader for font pitches\nfontPitchReader :: XMLReader s a FontPitches\nfontPitchReader = executeInSub NsOffice \"font-face-decls\" (\n                          withEveryL NsStyle \"font-face\" (liftAsSuccess (\n                              findAttr' NsStyle \"name\"\n                              &&&\n                              lookupDefaultingAttr NsStyle \"font-pitch\"\n                            ))\n                    >>?^ ( M.fromList . L.foldl' accumLegalPitches [] )\n                  ) `ifFailedDo` returnV (Right M.empty)\n  where accumLegalPitches ls (Nothing,_) = ls\n        accumLegalPitches ls (Just n,p)  = (n,p):ls\n\n\n-- | A wrapper around the font pitch reader that lifts the result into the\n-- state.\nreadFontPitches :: StyleReader a a\nreadFontPitches = producingExtraState () () fontPitchReader\n\n\n-- | Looking up a pitch in the state of the arrow.\n--\n-- The function does the following:\n-- * Look for the font pitch in an attribute.\n-- * If that fails, look for the font name, look up the font in the state\n--   and use the pitch from there.\n-- * Return the result in a Maybe\n--\nfindPitch :: XMLReaderSafe FontPitches a (Maybe FontPitch)\nfindPitch =     ( lookupAttr NsStyle \"font-pitch\"\n                  `ifFailedDo`     findAttr NsStyle \"font-name\"\n                               >>? (     keepingTheValue getExtraState\n                                     >>% M.lookup\n                                     >>^ maybeToChoice\n                                   )\n                )\n            >>> choiceToMaybe\n\n--------------------------------------------------------------------------------\n-- Definitions of main data\n--------------------------------------------------------------------------------\n\ntype StyleName        = Text\n\n-- | There are two types of styles: named styles with a style family and an\n-- optional style parent, and default styles for each style family,\n-- defining default style properties\ndata Styles           = Styles\n                          { stylesByName     :: M.Map StyleName   Style\n                          , listStylesByName :: M.Map StyleName   ListStyle\n                          , defaultStyleMap  :: M.Map StyleFamily StyleProperties\n                          }\n  deriving ( Show )\n\n-- Styles from a monoid under union\ninstance Semigroup Styles where\n  (Styles sBn1 dSm1 lsBn1) <> (Styles sBn2 dSm2 lsBn2)\n          = Styles (M.union sBn1  sBn2)\n                   (M.union dSm1  dSm2)\n                   (M.union lsBn1 lsBn2)\ninstance Monoid Styles where\n  mempty  = Styles M.empty M.empty M.empty\n  mappend = (<>)\n\n-- Not all families from the specifications are implemented, only those we need.\n-- But there are none that are not mentioned here.\ndata StyleFamily      = FaText    | FaParagraph\n--                    | FaTable   | FaTableCell | FaTableColumn | FaTableRow\n--                    | FaGraphic | FaDrawing   | FaChart\n--                    | FaPresentation\n--                    | FaRuby\n  deriving ( Eq, Ord, Show )\n\ninstance Lookupable StyleFamily where\n  lookupTable = [ ( \"text\"         , FaText         )\n                , ( \"paragraph\"    , FaParagraph    )\n--              , ( \"table\"        , FaTable        )\n--              , ( \"table-cell\"   , FaTableCell    )\n--              , ( \"table-column\" , FaTableColumn  )\n--              , ( \"table-row\"    , FaTableRow     )\n--              , ( \"graphic\"      , FaGraphic      )\n--              , ( \"drawing-page\" , FaDrawing      )\n--              , ( \"chart\"        , FaChart        )\n--              , ( \"presentation\" , FaPresentation )\n--              , ( \"ruby\"         , FaRuby         )\n                ]\n\n-- | A named style\ndata Style            = Style  { styleFamily     :: Maybe StyleFamily\n                               , styleParentName :: Maybe StyleName\n                               , listStyle       :: Maybe StyleName\n                               , styleProperties :: StyleProperties\n                               }\n  deriving ( Eq, Show )\n\ndata StyleProperties  = SProps { textProperties :: Maybe TextProperties\n                               , paraProperties :: Maybe ParaProperties\n--                             , tableColProperties  :: Maybe TColProperties\n--                             , tableRowProperties  :: Maybe TRowProperties\n--                             , tableCellProperties :: Maybe TCellProperties\n--                             , tableProperties     :: Maybe TableProperties\n--                             , graphicProperties   :: Maybe GraphProperties\n                               }\n  deriving ( Eq, Show )\n\ninstance  Default StyleProperties where\n  def =                SProps { textProperties       = Just def\n                               , paraProperties      = Just def\n                               }\n\ndata TextProperties   = PropT  { isEmphasised     :: Bool\n                               , isStrong         :: Bool\n                               , pitch            :: Maybe FontPitch\n                               , verticalPosition :: VerticalTextPosition\n                               , underline        :: Maybe UnderlineMode\n                               , strikethrough    :: Maybe UnderlineMode\n                               }\n  deriving ( Eq, Show )\n\ninstance Default TextProperties where\n  def =                 PropT  { isEmphasised     = False\n                               , isStrong         = False\n                               , pitch            = Just def\n                               , verticalPosition = def\n                               , underline        = Nothing\n                               , strikethrough    = Nothing\n                               }\n\ndata ParaProperties   = PropP { paraNumbering :: ParaNumbering\n                              , indentation   :: LengthOrPercent\n                              , margin_left   :: LengthOrPercent\n                              }\n  deriving ( Eq, Show )\n\ninstance Default ParaProperties where\n  def =                 PropP { paraNumbering = NumberingNone\n                              , indentation   = def\n                              , margin_left   = def\n                              }\n\n----\n-- All the little data types that make up the properties\n----\n\ndata VerticalTextPosition = VPosNormal | VPosSuper | VPosSub\n  deriving ( Eq, Show )\n\ninstance Default VerticalTextPosition where\n  def = VPosNormal\n\ninstance Read VerticalTextPosition where\n  readsPrec _ s =    [ (VPosSub        , s') | (\"sub\"   , s') <- lexS          ]\n                  ++ [ (VPosSuper      , s') | (\"super\" , s') <- lexS          ]\n                  ++ [ (signumToVPos n , s') | (  n     , s') <- readPercent s ]\n    where\n      lexS = lex s\n      signumToVPos n | n < 0     = VPosSub\n                     | n > 0     = VPosSuper\n                     | otherwise = VPosNormal\n\ndata UnderlineMode = UnderlineModeNormal | UnderlineModeSkipWhitespace\n  deriving ( Eq, Show )\n\ninstance Lookupable UnderlineMode where\n  lookupTable = [ ( \"continuous\"       , UnderlineModeNormal         )\n                , ( \"skip-white-space\" , UnderlineModeSkipWhitespace )\n                ]\n\n\ndata ParaNumbering = NumberingNone | NumberingKeep | NumberingRestart Int\n  deriving ( Eq, Show )\n\ndata LengthOrPercent = LengthValueMM Int | PercentValue Int\n  deriving ( Eq, Show )\n\ninstance Default LengthOrPercent where\n  def = LengthValueMM 0\n\ninstance Read LengthOrPercent where\n  readsPrec _ s =\n      [ (PercentValue  percent  , s' ) | (percent , s' ) <- readPercent s]\n   ++ [ (LengthValueMM lengthMM , s'') | (length' , s' ) <- reads s\n                                       , (unit    , s'') <- reads s'\n                                       , let lengthMM = estimateInMillimeter\n                                                                   length' unit\n                                       ]\n\ndata XslUnit = XslUnitMM | XslUnitCM\n             | XslUnitInch\n             | XslUnitPoints | XslUnitPica\n             | XslUnitPixel\n             | XslUnitEM\n\ninstance Show XslUnit where\n  show XslUnitMM     = \"mm\"\n  show XslUnitCM     = \"cm\"\n  show XslUnitInch   = \"in\"\n  show XslUnitPoints = \"pt\"\n  show XslUnitPica   = \"pc\"\n  show XslUnitPixel  = \"px\"\n  show XslUnitEM     = \"em\"\n\ninstance Read XslUnit where\n  readsPrec _ \"mm\" = [(XslUnitMM     , \"\")]\n  readsPrec _ \"cm\" = [(XslUnitCM     , \"\")]\n  readsPrec _ \"in\" = [(XslUnitInch   , \"\")]\n  readsPrec _ \"pt\" = [(XslUnitPoints , \"\")]\n  readsPrec _ \"pc\" = [(XslUnitPica   , \"\")]\n  readsPrec _ \"px\" = [(XslUnitPixel  , \"\")]\n  readsPrec _ \"em\" = [(XslUnitEM     , \"\")]\n  readsPrec _  _   = []\n\n-- | Rough conversion of measures into millimetres.\n-- Pixels and em's are actually implementation dependent/relative measures,\n-- so I could not really easily calculate anything exact here even if I wanted.\n-- But I do not care about exactness right now, as I only use measures\n-- to determine if a paragraph is \"indented\" or not.\nestimateInMillimeter :: Double -> XslUnit -> Int\nestimateInMillimeter n XslUnitMM     = round n\nestimateInMillimeter n XslUnitCM     = round $ n * 10\nestimateInMillimeter n XslUnitInch   = round $ n * 25.4\nestimateInMillimeter n XslUnitPoints = round $ n * (1/72) * 25.4\nestimateInMillimeter n XslUnitPica   = round $ n * 12 * (1/72) * 25.4\nestimateInMillimeter n XslUnitPixel  = round $ n * (1/72) * 25.4\nestimateInMillimeter n XslUnitEM     = round $ n * 16 * (1/72) * 25.4\n\n\n----\n-- List styles\n----\n\ntype ListLevel = Int\n\nnewtype ListStyle = ListStyle { levelStyles :: M.Map ListLevel ListLevelStyle\n                              }\n  deriving ( Eq, Show )\n\n--\ngetListLevelStyle :: ListLevel -> ListStyle -> Maybe ListLevelStyle\ngetListLevelStyle level ListStyle{..} =\n  let (lower , exactHit , _) = M.splitLookup level levelStyles\n  in  exactHit <|> fmap fst (M.maxView lower)\n  -- findBy (`M.lookup` levelStyles) [level, (level-1) .. 1]\n  -- \\^ simpler, but in general less efficient\n\ndata ListLevelStyle = ListLevelStyle { listLevelType  :: ListLevelType\n                                     , listItemPrefix :: Maybe Text\n                                     , listItemSuffix :: Maybe Text\n                                     , listItemFormat :: ListItemNumberFormat\n                                     , listItemStart  :: Int\n                                     }\n  deriving ( Eq, Ord )\n\ninstance Show ListLevelStyle where\n  show ListLevelStyle{..} =    \"<LLS|\"\n                            ++ show listLevelType\n                            ++ \"|\"\n                            ++ maybeToString (T.unpack <$> listItemPrefix)\n                            ++ show listItemFormat\n                            ++ maybeToString (T.unpack <$> listItemSuffix)\n                            ++ \">\"\n    where maybeToString = fromMaybe \"\"\n\ndata ListLevelType = LltBullet | LltImage | LltNumbered\n  deriving ( Eq, Ord, Show )\n\ndata ListItemNumberFormat = LinfNone\n                          | LinfNumber\n                          | LinfRomanLC | LinfRomanUC\n                          | LinfAlphaLC | LinfAlphaUC\n                          | LinfString String\n  deriving ( Eq, Ord )\n\ninstance Show ListItemNumberFormat where\n  show  LinfNone      = \"\"\n  show  LinfNumber    = \"1\"\n  show  LinfRomanLC   = \"i\"\n  show  LinfRomanUC   = \"I\"\n  show  LinfAlphaLC   = \"a\"\n  show  LinfAlphaUC   = \"A\"\n  show (LinfString s) =  s\n\ninstance Default ListItemNumberFormat where\n  def = LinfNone\n\ninstance Read ListItemNumberFormat where\n  readsPrec _ \"\"  = [(LinfNone     , \"\")]\n  readsPrec _ \"1\" = [(LinfNumber   , \"\")]\n  readsPrec _ \"i\" = [(LinfRomanLC  , \"\")]\n  readsPrec _ \"I\" = [(LinfRomanUC  , \"\")]\n  readsPrec _ \"a\" = [(LinfAlphaLC  , \"\")]\n  readsPrec _ \"A\" = [(LinfAlphaUC  , \"\")]\n  readsPrec _  s  = [(LinfString s , \"\")]\n\n--------------------------------------------------------------------------------\n-- Readers\n--\n-- ...it seems like a whole lot of this should be automatically derivable\n--    or at least moveable into a class. Most of this is data concealed in\n--    code.\n--------------------------------------------------------------------------------\n\n--\nreadAllStyles :: StyleReader a Styles\nreadAllStyles = (      readFontPitches\n                  >>?! (     readAutomaticStyles\n                         &&& readStyles ))\n                  >>?%? chooseMax\n -- all top elements are always on the same hierarchy level\n\n--\nreadStyles :: StyleReader a Styles\nreadStyles = executeInSub NsOffice \"styles\" $ liftAsSuccess\n  $ liftA3 Styles\n    ( tryAll NsStyle \"style\"         readStyle        >>^ M.fromList )\n    ( tryAll NsText  \"list-style\"    readListStyle    >>^ M.fromList )\n    ( tryAll NsStyle \"default-style\" readDefaultStyle >>^ M.fromList )\n\n--\nreadAutomaticStyles :: StyleReader a Styles\nreadAutomaticStyles = executeInSub NsOffice \"automatic-styles\" $ liftAsSuccess\n  $ liftA3 Styles\n    ( tryAll NsStyle \"style\"         readStyle        >>^ M.fromList )\n    ( tryAll NsText  \"list-style\"    readListStyle    >>^ M.fromList )\n    ( returnV M.empty                                                )\n\n--\nreadDefaultStyle :: StyleReader a (StyleFamily, StyleProperties)\nreadDefaultStyle =      lookupAttr NsStyle \"family\"\n                   >>?! keepingTheValue readStyleProperties\n\n--\nreadStyle :: StyleReader a (StyleName,Style)\nreadStyle =      findAttr NsStyle \"name\"\n            >>?! keepingTheValue\n                   ( liftA4 Style\n                       ( lookupAttr' NsStyle \"family\"            )\n                       ( findAttr'   NsStyle \"parent-style-name\" )\n                       ( findAttr'   NsStyle \"list-style-name\"   )\n                       readStyleProperties\n                   )\n\n--\nreadStyleProperties :: StyleReaderSafe a StyleProperties\nreadStyleProperties = liftA2 SProps\n                       ( readTextProperties >>> choiceToMaybe )\n                       ( readParaProperties >>> choiceToMaybe )\n\n--\nreadTextProperties :: StyleReader a TextProperties\nreadTextProperties =\n  executeInSub NsStyle \"text-properties\" $ liftAsSuccess\n    ( liftA6 PropT\n       ( searchAttr   NsXSL_FO \"font-style\"  False isFontEmphasised )\n       ( searchAttr   NsXSL_FO \"font-weight\" False isFontBold       )\n       findPitch\n       ( getAttr      NsStyle  \"text-position\"                      )\n       readUnderlineMode\n       readStrikeThroughMode\n     )\n  where isFontEmphasised = [(\"normal\",False),(\"italic\",True),(\"oblique\",True)]\n        isFontBold = (\"normal\",False):(\"bold\",True)\n                    :map ((,True) . tshow) ([100,200..900]::[Int])\n\nreadUnderlineMode     :: StyleReaderSafe a (Maybe UnderlineMode)\nreadUnderlineMode     = readLineMode \"text-underline-mode\"\n                                     \"text-underline-style\"\n\nreadStrikeThroughMode :: StyleReaderSafe a (Maybe UnderlineMode)\nreadStrikeThroughMode = readLineMode \"text-line-through-mode\"\n                                     \"text-line-through-style\"\n\nreadLineMode :: Text -> Text -> StyleReaderSafe a (Maybe UnderlineMode)\nreadLineMode modeAttr styleAttr = proc x -> do\n  isUL <- searchAttr  NsStyle styleAttr False isLinePresent -< x\n  mode <- lookupAttr' NsStyle  modeAttr                     -< x\n  if isUL\n    then case mode of\n           Just m  -> returnA -< Just m\n           Nothing -> returnA -< Just UnderlineModeNormal\n    else              returnA -< Nothing\n  where\n    isLinePresent = (\"none\",False) : map (,True)\n                    [ \"dash\"      , \"dot-dash\" , \"dot-dot-dash\" , \"dotted\"\n                    , \"long-dash\" , \"solid\"    , \"wave\"\n                    ]\n\n--\nreadParaProperties :: StyleReader a ParaProperties\nreadParaProperties =\n   executeInSub NsStyle \"paragraph-properties\" $ liftAsSuccess\n     ( liftA3 PropP\n       ( liftA2 readNumbering\n         ( isSet'           NsText   \"number-lines\"           )\n         ( readAttr'        NsText   \"line-number\"            )\n       )\n       ( liftA2 readIndentation\n         ( isSetWithDefault NsStyle  \"auto-text-indent\" False )\n         ( getAttr          NsXSL_FO \"text-indent\"            )\n       )\n       (   getAttr          NsXSL_FO \"margin-left\"            )\n     )\n  where readNumbering (Just True) (Just n) = NumberingRestart n\n        readNumbering (Just True)  _       = NumberingKeep\n        readNumbering      _       _       = NumberingNone\n\n        readIndentation False indent = indent\n        readIndentation True  _      = def\n\n----\n-- List styles\n----\n\n--\nreadListStyle :: StyleReader a (StyleName, ListStyle)\nreadListStyle =\n       findAttr NsStyle \"name\"\n  >>?! keepingTheValue\n       ( liftA ListStyle\n         $ liftA3 SM.union3\n             ( readListLevelStyles NsText \"list-level-style-number\" LltNumbered )\n             ( readListLevelStyles NsText \"list-level-style-bullet\" LltBullet   )\n             ( readListLevelStyles NsText \"list-level-style-image\"  LltImage    ) >>^ M.mapMaybe chooseMostSpecificListLevelStyle\n       )\n--\nreadListLevelStyles :: Namespace -> ElementName\n                    -> ListLevelType\n                    -> StyleReaderSafe a (SM.SetMap Int ListLevelStyle)\nreadListLevelStyles namespace elementName levelType =\n  tryAll namespace elementName (readListLevelStyle levelType)\n    >>^ SM.fromList\n\n--\nreadListLevelStyle :: ListLevelType -> StyleReader a (Int, ListLevelStyle)\nreadListLevelStyle levelType =      readAttr NsText \"level\"\n                               >>?! keepingTheValue\n                                    ( liftA5 toListLevelStyle\n                                      ( returnV       levelType             )\n                                      ( findAttr'     NsStyle \"num-prefix\"  )\n                                      ( findAttr'     NsStyle \"num-suffix\"  )\n                                      ( getAttr       NsStyle \"num-format\"  )\n                                      ( findAttrText' NsText  \"start-value\" )\n                                    )\n  where\n  toListLevelStyle _ p s LinfNone b         = ListLevelStyle LltBullet p s LinfNone (startValue b)\n  toListLevelStyle _ p s f@(LinfString _) b = ListLevelStyle LltBullet p s f (startValue b)\n  toListLevelStyle t p s f b                = ListLevelStyle t      p s f (startValue b)\n  startValue mbx = fromMaybe 1 (mbx >>= safeRead)\n\n--\nchooseMostSpecificListLevelStyle :: S.Set ListLevelStyle -> Maybe ListLevelStyle\nchooseMostSpecificListLevelStyle ls = F.foldr select Nothing ls\n  where\n   select l Nothing = Just l\n   select ( ListLevelStyle t1 p1 s1 f1 b1 )\n          ( Just ( ListLevelStyle t2 p2 s2 f2 _ ))\n        =   Just $ ListLevelStyle (select' t1 t2) (p1 <|> p2) (s1 <|> s2)\n                                  (selectLinf f1 f2) b1\n   select' LltNumbered _           = LltNumbered\n   select' _           LltNumbered = LltNumbered\n   select' _           _           = LltBullet\n   selectLinf LinfNone       f2             = f2\n   selectLinf f1             LinfNone       = f1\n   selectLinf (LinfString _) f2             = f2\n   selectLinf f1             (LinfString _) = f1\n   selectLinf f1             _              = f1\n\n\n--------------------------------------------------------------------------------\n-- Tools to access style data\n--------------------------------------------------------------------------------\n\n--\nlookupStyle           :: StyleName   -> Styles -> Maybe Style\nlookupStyle name Styles{..} = M.lookup name stylesByName\n\n--\nlookupDefaultStyle'   :: Styles -> StyleFamily -> StyleProperties\nlookupDefaultStyle' Styles{..} family = fromMaybe def\n                                        (M.lookup family defaultStyleMap)\n\n--\nlookupListStyleByName :: StyleName   -> Styles -> Maybe ListStyle\nlookupListStyleByName name Styles{..} = M.lookup name listStylesByName\n\n\n-- | Returns a chain of parent of the current style. The direct parent will\n-- be the first element of the list, followed by its parent and so on.\n-- The current style is not in the list.\nparents               :: Style       -> Styles ->      [Style]\nparents style styles = L.unfoldr findNextParent style -- Ha!\n  where findNextParent Style{..}\n          = fmap duplicate $ (`lookupStyle` styles) =<< styleParentName\n\n-- | Looks up the style family of the current style. Normally, every style\n-- should have one. But if not, all parents are searched.\ngetStyleFamily        :: Style       -> Styles -> Maybe StyleFamily\ngetStyleFamily style@Style{..} styles\n  =     styleFamily\n    <|> F.asum (map (`getStyleFamily` styles) $ parents style styles)\n\n-- | Each 'Style' has certain 'StyleProperties'. But sometimes not all property\n-- values are specified. Instead, a value might be inherited from a\n-- parent style. This function makes this chain of inheritance\n-- concrete and easily accessible by encapsulating the necessary lookups.\n-- The resulting list contains the direct properties of the style as the first\n-- element, the ones of the direct parent element as the next one, and so on.\n--\n-- Note: There should also be default properties for each style family. These\n--       are @not@ contained in this list because properties inherited from\n--       parent elements take precedence over default styles.\n--\n-- This function is primarily meant to be used through convenience wrappers.\n--\nstylePropertyChain    :: Style       -> Styles -> [StyleProperties]\nstylePropertyChain style styles\n  = map styleProperties (style : parents style styles)\n\n--\nextendedStylePropertyChain :: [Style] -> Styles -> [StyleProperties]\nextendedStylePropertyChain [] _ = []\nextendedStylePropertyChain [style]       styles =    stylePropertyChain style styles\n                                                  ++ maybeToList (fmap (lookupDefaultStyle' styles) (getStyleFamily style styles))\nextendedStylePropertyChain (style:trace) styles =    stylePropertyChain style styles\n                                                  ++ extendedStylePropertyChain trace styles\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/ODT.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Reader.ODT\n   Copyright   : Copyright (C) 2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Martin Linnemann <theCodingMarlin@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nEntry point to the odt reader.\n-}\n\nmodule Text.Pandoc.Readers.ODT ( readODT ) where\n\nimport Codec.Archive.Zip\nimport Text.Pandoc.XML.Light\nimport Text.Pandoc.Walk\n\nimport Data.Char (isDigit)\nimport qualified Data.ByteString.Lazy as B\n\nimport System.FilePath\n\nimport Control.Monad.Except (throwError)\n\nimport qualified Data.Text as T\n\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.MediaBag\nimport Text.Pandoc.Options\nimport qualified Text.Pandoc.UTF8 as UTF8\n\nimport Text.Pandoc.Readers.ODT.ContentReader\nimport Text.Pandoc.Readers.ODT.StyleReader\n\nimport Text.Pandoc.Readers.ODT.Generic.Fallible\nimport Text.Pandoc.Readers.ODT.Generic.XMLConverter\nimport Text.Pandoc.Shared (filteredFilesFromArchive)\n\nreadODT :: PandocMonad m\n        => ReaderOptions\n        -> B.ByteString\n        -> m Pandoc\nreadODT opts bytes = case readODT' opts bytes of\n  Right (doc, mb) -> do\n    P.setMediaBag mb\n    return $ walk makeFigure doc\n  Left e -> throwError e\n\n-- the ODT parser uses old-style figures: an image with title beginning\n-- \"fig:\" in a paragraph by itself.  Convert these to new Figure elements.\nmakeFigure :: Block -> Block\nmakeFigure (Para [ Image (ident, classes, kvs) capt (src, tit) ])\n  | \"fig:\" `T.isPrefixOf` tit\n  = Figure (ident, [], []) (Caption Nothing [Plain capt'])\n      [Plain [Image (\"\", classes, kvs) capt (src, \"\")]]\n   where\n     capt' = case capt of -- strip \"Figure 1:\" for consistency\n                 (Str _ : Space : Str t : Space : xs)\n                    | T.all (\\c -> isDigit c || c == ':') t\n                    , \":\" `T.isSuffixOf` t -> xs\n                 xs -> xs\nmakeFigure x = x\n\n--\nreadODT' :: ReaderOptions\n         -> B.ByteString\n         -> Either PandocError (Pandoc, MediaBag)\nreadODT' _ bytes = bytesToODT bytes-- of\n--                    Right (pandoc, mediaBag) -> Right (pandoc , mediaBag)\n--                    Left  err                -> Left err\n\n--\nbytesToODT :: B.ByteString -> Either PandocError (Pandoc, MediaBag)\nbytesToODT bytes = case toArchiveOrFail bytes of\n  Right archive -> archiveToODT archive\n  Left err      -> Left $ PandocParseError\n                        $ \"Could not unzip ODT: \" <> T.pack err\n\n--\narchiveToODT :: Archive -> Either PandocError (Pandoc, MediaBag)\narchiveToODT archive = do\n  let onFailure msg Nothing = Left $ PandocParseError msg\n      onFailure _   (Just x) = Right x\n  contentEntry <- onFailure \"Could not find content.xml\"\n                   (findEntryByPath \"content.xml\" archive)\n  stylesEntry <- onFailure \"Could not find styles.xml\"\n                   (findEntryByPath \"styles.xml\" archive)\n  contentElem <- entryToXmlElem contentEntry\n  stylesElem <- entryToXmlElem stylesEntry\n  styles <- either\n               (\\_ -> Left $ PandocParseError \"Could not read styles\")\n               Right\n               (chooseMax (readStylesAt stylesElem ) (readStylesAt contentElem))\n  let filePathIsODTMedia :: FilePath -> Bool\n      filePathIsODTMedia fp =\n        let (dir, name) = splitFileName fp\n        in  (dir == \"Pictures/\") || (dir /= \"./\" && name == \"content.xml\")\n  let media = filteredFilesFromArchive archive filePathIsODTMedia\n  let startState = readerState styles media\n  either (\\_ -> Left $ PandocParseError \"Could not convert opendocument\") Right\n    (runConverter' read_body startState contentElem)\n\n\n--\nentryToXmlElem :: Entry -> Either PandocError Element\nentryToXmlElem entry =\n  case parseXMLElement . UTF8.toTextLazy . fromEntry $ entry of\n    Right x  -> Right x\n    Left msg -> Left $ PandocXMLError (T.pack $ eRelativePath entry) msg\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/OOXML/Shared.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.OOXML.Shared\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nShared utilities for Office Open XML (OOXML) readers (DOCX, PPTX).\nProvides common functions for ZIP archive handling, XML parsing,\nnamespace management, and DrawingML parsing.\n-}\nmodule Text.Pandoc.Readers.OOXML.Shared\n  ( -- * Constants\n    emusPerInch\n  , emuToInches\n  , inchesToEmu\n    -- * Types\n  , NameSpaces\n  , elemName\n  , elemToNameSpaces\n  , isElem\n  , findChildByName\n  , findChildrenByName\n  , findElementByName\n  , findAttrByName\n  ) where\n\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Pandoc.XML.Light\n\n-- | Type alias for namespace mappings\ntype NameSpaces = M.Map Text Text\n\n-- | English Metric Units per inch\n-- 1 inch = 914400 EMUs (used in OOXML for dimensions)\nemusPerInch :: Integer\nemusPerInch = 914400\n\n-- | Convert EMUs to inches\nemuToInches :: Integer -> Double\nemuToInches n = fromIntegral n / fromIntegral emusPerInch\n\n-- | Convert inches to EMUs\ninchesToEmu :: Double -> Integer\ninchesToEmu n = round (n * fromIntegral emusPerInch)\n\n-- | Extract namespace declarations from element attributes\nelemToNameSpaces :: Element -> NameSpaces\nelemToNameSpaces = foldr (\\(Attr qn val) ->\n                            case qn of\n                              QName s _ (Just \"xmlns\") -> M.insert s val\n                              _ -> id) mempty . elAttribs\n\n-- | Create a qualified name from namespace map, prefix, and local name\nelemName :: NameSpaces -> Text -> Text -> QName\nelemName ns prefix name =\n  QName name\n        (M.lookup prefix ns)\n        (if T.null prefix then Nothing else Just prefix)\n\n-- | Check if element matches namespace prefix and local name\nisElem :: NameSpaces -> Text -> Text -> Element -> Bool\nisElem ns prefix name element =\n  let ns' = ns <> elemToNameSpaces element\n  in  qName (elName element) == name &&\n      qURI (elName element) == M.lookup prefix ns'\n\n-- | Find first child element matching namespace and name\nfindChildByName :: NameSpaces -> Text -> Text -> Element -> Maybe Element\nfindChildByName ns pref name el =\n  let ns' = ns <> elemToNameSpaces el\n  in  findChild (elemName ns' pref name) el\n\n-- | Find all children matching namespace and name\nfindChildrenByName :: NameSpaces -> Text -> Text -> Element -> [Element]\nfindChildrenByName ns pref name el =\n  let ns' = ns <> elemToNameSpaces el\n  in  findChildren (elemName ns' pref name) el\n\n-- | Find element anywhere in descendants matching namespace and name\nfindElementByName :: NameSpaces -> Text -> Text -> Element -> Maybe Element\nfindElementByName ns pref name el =\n  let ns' = ns <> elemToNameSpaces el\n  in  findElement (elemName ns' pref name) el\n\n-- | Find attribute value by namespace prefix and name\nfindAttrByName :: NameSpaces -> Text -> Text -> Element -> Maybe Text\nfindAttrByName ns pref name el =\n  let ns' = ns <> elemToNameSpaces el\n  in  findAttr (elemName ns' pref name) el\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/OPML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.OPML\n   Copyright   : Copyright (C) 2013-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of OPML to 'Pandoc' document.\n-}\n\nmodule Text.Pandoc.Readers.OPML ( readOPML ) where\nimport Control.Monad.State.Strict\nimport Data.Default\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Readers.HTML (readHtml)\nimport Text.Pandoc.Readers.Markdown (readMarkdown)\nimport Text.Pandoc.Shared (blocksToInlines')\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\nimport Text.Pandoc.XML.Light\nimport Control.Monad.Except (throwError)\n\ntype OPML m = StateT OPMLState m\n\ndata OPMLState = OPMLState{\n                        opmlSectionLevel :: Int\n                      , opmlDocTitle     :: Inlines\n                      , opmlDocAuthors   :: [Inlines]\n                      , opmlDocDate      :: Inlines\n                      , opmlOptions      :: ReaderOptions\n                      } deriving Show\n\ninstance Default OPMLState where\n  def = OPMLState{ opmlSectionLevel = 0\n                 , opmlDocTitle = mempty\n                 , opmlDocAuthors = []\n                 , opmlDocDate = mempty\n                 , opmlOptions = def\n                 }\n\nreadOPML :: (PandocMonad m, ToSources a)\n         => ReaderOptions\n         -> a\n         -> m Pandoc\nreadOPML opts inp  = do\n  let sources = toSources inp\n  (bs, st') <-\n    runStateT (case parseXMLContents (TL.fromStrict . sourcesToText $ sources) of\n                     Left msg -> throwError $ PandocXMLError \"\" msg\n                     Right ns -> mapM parseBlock ns)\n                 def{ opmlOptions = opts }\n  return $\n    setTitle (opmlDocTitle st') $\n    setAuthors (opmlDocAuthors st') $\n    setDate (opmlDocDate st') $\n    doc $ mconcat bs\n\n-- convenience function to get an attribute value, defaulting to \"\"\nattrValue :: Text -> Element -> Text\nattrValue attr elt =\n  fromMaybe \"\" (lookupAttrBy (\\x -> qName x == attr) (elAttribs elt))\n\n-- exceptT :: PandocMonad m => Either PandocError a -> OPML m a\n-- exceptT = either throwError return\n\nasHtml :: PandocMonad m => Text -> OPML m Inlines\nasHtml s = do\n  opts <- gets opmlOptions\n  Pandoc _ bs <- readHtml def{ readerExtensions = readerExtensions opts } s\n  return $ blocksToInlines' bs\n\nasMarkdown :: PandocMonad m => Text -> OPML m Blocks\nasMarkdown s = do\n  opts <- gets opmlOptions\n  Pandoc _ bs <- readMarkdown def{ readerExtensions = readerExtensions opts } s\n  return $ fromList bs\n\ngetBlocks :: PandocMonad m => Element -> OPML m Blocks\ngetBlocks e =  mconcat <$> mapM parseBlock (elContent e)\n\nparseBlock :: PandocMonad m => Content -> OPML m Blocks\nparseBlock (Elem e) =\n  case qName (elName e) of\n        \"ownerName\"    -> mempty <$ modify (\\st ->\n                              st{opmlDocAuthors = [text $ strContent e]})\n        \"dateModified\" -> mempty <$ modify (\\st ->\n                              st{opmlDocDate = text $ strContent e})\n        \"title\"        -> mempty <$ modify (\\st ->\n                              st{opmlDocTitle = text $ strContent e})\n        \"outline\" -> gets opmlSectionLevel >>= sect . (+1)\n        \"?xml\"  -> return mempty\n        _       -> getBlocks e\n   where sect n = do headerText <- asHtml $ attrValue \"text\" e\n                     noteBlocks <- asMarkdown $ attrValue \"_note\" e\n                     modify $ \\st -> st{ opmlSectionLevel = n }\n                     bs <- getBlocks e\n                     modify $ \\st -> st{ opmlSectionLevel = n - 1 }\n                     let headerText' = case T.toUpper (attrValue \"type\" e) of\n                                             \"LINK\"  -> link\n                                               (attrValue \"url\" e) \"\" headerText\n                                             _ -> headerText\n                     return $ header n headerText' <> noteBlocks <> bs\nparseBlock _ = return mempty\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/BlockStarts.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.BlockStarts\n   Copyright   : Copyright (C) 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nParsers for Org-mode inline elements.\n-}\nmodule Text.Pandoc.Readers.Org.BlockStarts\n  ( exampleLineStart\n  , hline\n  , noteMarker\n  , tableStart\n  , drawerStart\n  , headerStart\n  , metaLineStart\n  , latexEnvStart\n  , commentLineStart\n  , bulletListStart\n  , orderedListStart\n  , endOfBlock\n  ) where\n\nimport Control.Monad (void, guard)\nimport Data.Text (Text)\nimport Text.Pandoc.Readers.Org.Parsing\nimport Text.Pandoc.Definition as Pandoc\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.Parsing (lowerAlpha, upperAlpha)\nimport Text.Pandoc.Extensions\nimport Text.Pandoc.Readers.LaTeX.Math (inlineEnvironmentNames)\nimport Data.Functor (($>))\n\n-- | Horizontal Line (five -- dashes or more)\nhline :: Monad m => OrgParser m ()\nhline = try $ do\n  skipSpaces\n  string \"-----\"\n  many (char '-')\n  skipSpaces\n  newline\n  return ()\n\n-- | Read the start of a header line, return the header level\nheaderStart :: Monad m => OrgParser m Int\nheaderStart = try $\n  (length <$> many1 (char '*')) <* many1 (char ' ') <* updateLastPreCharPos\n\ntableStart :: Monad m => OrgParser m Char\ntableStart = try $ skipSpaces *> char '|'\n\ngridTableStart :: Monad m => OrgParser m ()\ngridTableStart = try $ skipSpaces <* char '+' <* char '-'\n\n\nlatexEnvStart :: Monad m => OrgParser m Text\nlatexEnvStart = try $ do\n  skipSpaces\n  string \"\\\\begin{\"\n  name <- latexEnvName\n  char '}'\n  guard $ name `notElem` inlineEnvironmentNames\n  pure name\n where\n   latexEnvName :: Monad m => OrgParser m Text\n   latexEnvName = try $ mappend <$> many1Char alphaNum <*> option \"\" (textStr \"*\")\n\nlistCounterCookie :: Monad m => OrgParser m Int\nlistCounterCookie = try $\n  string \"[@\"\n  *> parseNum\n  <* char ']'\n  <* (skipSpaces <|> lookAhead eol)\n  where parseNum = (safeRead =<< many1Char digit)\n                   <|> snd <$> (lowerAlpha <|> upperAlpha)\n\nbulletListStart :: Monad m => OrgParser m Int\nbulletListStart = try $ do\n  ind <- length <$> many spaceChar\n   -- Unindented lists cannot use '*' bullets.\n  oneOf (if ind == 0 then \"+-\" else \"*+-\")\n  skipSpaces1 <|> lookAhead eol\n  optionMaybe listCounterCookie\n  return (ind + 1)\n\neol :: Monad m => OrgParser m ()\neol = void (char '\\n')\n\norderedListStart :: Monad m => OrgParser m (Int, ListAttributes)\norderedListStart = try $ do\n  ind <- length <$> many spaceChar\n  fancy <- option False $ True <$ guardEnabled Ext_fancy_lists\n  -- Ordered list markers allowed in org-mode\n  let styles = (many1Char digit $> (if fancy\n                                       then Decimal\n                                       else DefaultStyle))\n               : if fancy\n                    then [ fst <$> lowerAlpha\n                         , fst <$> upperAlpha ]\n                    else []\n  let delims = [ char '.' $> (if fancy\n                                 then Period\n                                 else DefaultDelim)\n               , char ')' $> (if fancy\n                                 then OneParen\n                                 else DefaultDelim)\n               ]\n  style <- choice styles\n  delim <- choice delims\n  skipSpaces1 <|> lookAhead eol\n  start <- option 1 listCounterCookie\n  return (ind + 1, (start, style, delim))\n\ndrawerStart :: Monad m => OrgParser m Text\ndrawerStart = try $ skipSpaces *> drawerName <* skipSpaces <* newline\n where drawerName = char ':' *> manyTillChar nonspaceChar (char ':')\n\nmetaLineStart :: Monad m => OrgParser m ()\nmetaLineStart = try $ skipSpaces <* string \"#+\"\n\ncommentLineStart :: Monad m => OrgParser m ()\ncommentLineStart = try $\n  -- the first char after '#' must be a plain space character or a newline\n  skipSpaces <* string \"#\" <* lookAhead (oneOf \" \\n\")\n\nexampleLineStart :: Monad m => OrgParser m ()\nexampleLineStart = () <$ try (skipSpaces *> char ':' *> (void (char ' ') <|> lookAhead eol))\n\nnoteMarker :: Monad m => OrgParser m Text\nnoteMarker = try $ do\n  char '['\n  choice [ many1TillChar digit (char ']')\n         , (<>) <$> textStr \"fn:\"\n                <*> many1TillChar (noneOf \"\\n\\r\\t \") (char ']')\n         ]\n\n-- | Succeeds if the parser is at the end of a block.\nendOfBlock :: Monad m => OrgParser m ()\nendOfBlock = lookAhead . try $\n  void blankline <|> anyBlockStart\n where\n   -- Succeeds if there is a new block starting at this position.\n   anyBlockStart :: Monad m => OrgParser m ()\n   anyBlockStart = try . choice $\n     [ exampleLineStart\n     , hline\n     , metaLineStart\n     , commentLineStart\n     , gridTableStart\n     , void noteMarker\n     , void tableStart\n     , void drawerStart\n     , void headerStart\n     , void latexEnvStart\n     , void bulletListStart\n     , void orderedListStart\n     ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/Blocks.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RecordWildCards   #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.Blocks\n   Copyright   : Copyright (C) 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nParsers for Org-mode block elements.\n-}\nmodule Text.Pandoc.Readers.Org.Blocks\n  ( blockList\n  , meta\n  ) where\n\nimport Text.Pandoc.Readers.Org.BlockStarts\nimport Text.Pandoc.Readers.Org.DocumentTree (documentTree,\n                                             unprunedHeadlineToBlocks)\nimport Text.Pandoc.Readers.Org.Inlines\nimport Text.Pandoc.Readers.Org.Meta (metaExport, metaKey, metaLine)\nimport Text.Pandoc.Readers.Org.ParserState\nimport Text.Pandoc.Readers.Org.Parsing\nimport Text.Pandoc.Readers.Org.Shared (cleanLinkText, isImageFilename,\n                                       originalLang, translateLang, exportsCode)\nimport Text.Pandoc.Readers.LaTeX.Math (inlineEnvironmentNames)\nimport Text.Pandoc.Builder (Blocks, Inlines, Many(..))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared (compactify, compactifyDL, safeRead)\n\nimport Control.Monad (foldM, guard, mzero, void)\nimport Data.Bifunctor (bimap)\nimport Data.Char (isSpace)\nimport Data.Default (Default)\nimport Data.Functor (($>))\nimport qualified Data.List as L\nimport Data.Maybe (fromMaybe, isJust, isNothing)\nimport Data.Text (Text)\nimport Data.List.NonEmpty (nonEmpty)\nimport System.FilePath\nimport qualified Data.Foldable as F\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport qualified Text.Pandoc.Walk as Walk\nimport Text.Pandoc.Sources (ToSources(..))\n\n--\n-- parsing blocks\n--\n\n-- | Get a list of blocks.\nblockList :: PandocMonad m => OrgParser m [Block]\nblockList = do\n  fHeadlineTree  <- documentTree blocks inline\n  st             <- getState\n  let headlineTree = runF fHeadlineTree st\n  unprunedHeadlineToBlocks headlineTree st\n\n-- | Get the meta information saved in the state.\nmeta :: Monad m => OrgParser m Meta\nmeta = do\n  meta' <- metaExport\n  runF meta' <$> getState\n\nblocks :: PandocMonad m => OrgParser m (F Blocks)\nblocks = mconcat <$> manyTill block (void (lookAhead headerStart) <|> eof)\n\nblock :: PandocMonad m => OrgParser m (F Blocks)\nblock = choice [ mempty <$ blanklines\n               , table\n               , dynamicBlock\n               , orgBlock\n               , figure\n               , example\n               , genericDrawer\n               , include\n               , specialLine\n               , horizontalRule\n               , list\n               , latexFragment\n               , noteBlock\n               , rawOrgLine\n               , paraOrPlain\n               ] <?> \"block\"\n\n\n-- | Parse a horizontal rule into a block element\nhorizontalRule :: Monad m => OrgParser m (F Blocks)\nhorizontalRule = return B.horizontalRule <$ try hline\n\n\n--\n-- Block Attributes\n--\n\n-- | Attributes that may be added to figures (like a name or caption).\ndata BlockAttributes = BlockAttributes\n  { blockAttrName      :: Maybe Text\n  , blockAttrCaption   :: Maybe (F Inlines)\n  , blockAttrKeyValues :: [(Text, Text)]\n  }\n\n-- | Convert BlockAttributes into pandoc Attr\nattrFromBlockAttributes :: BlockAttributes -> Attr\nattrFromBlockAttributes BlockAttributes{..} =\n  let\n    ident   = fromMaybe mempty $ lookup \"id\" blockAttrKeyValues\n    classes = maybe [] T.words $ lookup \"class\" blockAttrKeyValues\n    kv      = filter ((`notElem` [\"id\", \"class\"]) . fst) blockAttrKeyValues\n  in (ident, classes, kv)\n\nstringyMetaAttribute :: Monad m => OrgParser m (Text, Text)\nstringyMetaAttribute = try $ do\n  metaLineStart *> notFollowedBy (stringAnyCase \"begin\" *> oneOf \":_\")\n  attrName <- T.toLower <$> many1TillChar nonspaceChar (char ':')\n  skipSpaces\n  attrValue <- anyLine <|> (\"\" <$ newline)\n  return (attrName, attrValue)\n\n-- | Parse a set of block attributes. Block attributes are given through\n-- lines like @#+caption: block caption@ or @#+attr_html: :width 20@.\n-- Parsing will fail if any line contains an attribute different from\n-- those attributes known to work on blocks.\nblockAttributes :: PandocMonad m => OrgParser m BlockAttributes\nblockAttributes = try $ do\n  kv <- many stringyMetaAttribute\n  guard $ all (isBlockAttr . fst) kv\n  let caption = L.foldl' (appendValues \"caption\") Nothing kv\n  let kvAttrs = L.foldl' (appendValues \"attr_html\") Nothing kv\n  let name    = snd <$> L.find ((`elem` [\"name\", \"label\"]) . fst) (reverse kv)\n  caption' <- traverse (parseFromString inlines . (<> \"\\n\")) caption\n  kvAttrs' <- parseFromString keyValues . (<> \"\\n\") $ fromMaybe mempty kvAttrs\n  return BlockAttributes\n           { blockAttrName = name\n           , blockAttrCaption = caption'\n           , blockAttrKeyValues = kvAttrs'\n           }\n where\n   isBlockAttr :: Text -> Bool\n   isBlockAttr = flip elem\n                 [ \"name\", \"label\", \"caption\"\n                 , \"attr_html\", \"attr_latex\"\n                 , \"results\"\n                 ]\n\n   appendValues :: Text -> Maybe Text -> (Text, Text) -> Maybe Text\n   appendValues attrName accValue (key, value) =\n     if key /= attrName\n     then accValue\n     else case accValue of\n            Just acc -> Just $ acc <> \" \" <> value\n            Nothing  -> Just value\n\n-- | Parse key-value pairs for HTML attributes\nkeyValues :: Monad m => OrgParser m [(Text, Text)]\nkeyValues = try $\n  manyTill ((,) <$> key <*> value) newline\n where\n   key :: Monad m => OrgParser m Text\n   key = try $ skipSpaces *> char ':' *> many1Char nonspaceChar\n\n   value :: Monad m => OrgParser m Text\n   value = skipSpaces *> manyTillChar anyChar endOfValue\n\n   endOfValue :: Monad m => OrgParser m ()\n   endOfValue = lookAhead (void $ try (many1 spaceChar <* key))\n            <|> try (skipSpaces <* lookAhead newline)\n\n\n--\n-- Org Blocks (#+begin_... / #+end_...)\n--\n\n-- | Read an org-mode block delimited by #+begin_type and #+end_type.\norgBlock :: PandocMonad m => OrgParser m (F Blocks)\norgBlock = try $ do\n  blockAttrs <- blockAttributes\n  blkType <- blockHeaderStart\n  ($ blkType) $\n    case T.toLower blkType of\n      \"export\"    -> exportBlock\n      \"comment\"   -> rawBlockLines (const mempty)\n      \"html\"      -> rawBlockLines (return . B.rawBlock (T.toLower blkType))\n      \"latex\"     -> rawBlockLines (return . B.rawBlock (T.toLower blkType))\n      \"ascii\"     -> rawBlockLines (return . B.rawBlock (T.toLower blkType))\n      \"example\"   -> exampleBlock blockAttrs\n      \"quote\"     -> \\x -> ignHeaders *> parseBlockLines (fmap B.blockQuote) x\n      \"verse\"     -> verseBlock\n      \"src\"       -> codeBlock blockAttrs\n      \"note\"      -> admonitionBlock \"note\" blockAttrs\n      \"warning\"   -> admonitionBlock \"warning\" blockAttrs\n      \"tip\"       -> admonitionBlock \"tip\" blockAttrs\n      \"caution\"   -> admonitionBlock \"caution\" blockAttrs\n      \"important\" -> admonitionBlock \"important\" blockAttrs\n      _           ->\n        -- case-sensitive checks\n        case blkType of\n          \"abstract\" -> metadataBlock\n          _ -> \\bt -> do\n            params <- blockParameters\n            let (ident, classes, kv) = attrFromBlockAttributes blockAttrs\n                toDiv = (B.divWith (ident, classes ++ [blkType], kv <> params))\n            parseBlockLines (fmap toDiv) bt\n where\n   blockHeaderStart :: Monad m => OrgParser m Text\n   blockHeaderStart = try $ do\n     skipSpaces\n     metaLineStart\n     stringAnyCase \"begin_\"\n     many1Char (satisfy (not . isSpace))\n\nadmonitionBlock :: PandocMonad m\n                => Text -> BlockAttributes -> Text -> OrgParser m (F Blocks)\nadmonitionBlock blockType blockAttrs rawtext = do\n  bls <- ignHeaders *> parseBlockLines id rawtext\n  let id' = fromMaybe mempty $ blockAttrName blockAttrs\n  pure $ fmap\n    (B.divWith (id', [blockType], []) .\n     (B.divWith (\"\", [\"title\"], []) (B.para (B.str (T.toTitle blockType))) <>))\n    bls\n\nexampleBlock :: PandocMonad m => BlockAttributes -> Text -> OrgParser m (F Blocks)\nexampleBlock blockAttrs _label = do\n  skipSpaces\n  (classes, kv) <- switchesAsAttributes\n  newline\n  content <- rawBlockContent \"example\"\n  let id' = fromMaybe mempty $ blockAttrName blockAttrs\n  let codeBlck = B.codeBlockWith (id', classes, kv) content\n  return . return $ codeBlck\n\nrawBlockLines :: Monad m => (Text   -> F Blocks) -> Text -> OrgParser m (F Blocks)\nrawBlockLines f blockType = ignHeaders *> (f <$> rawBlockContent blockType)\n\nparseBlockLines :: PandocMonad m => (F Blocks -> F Blocks) -> Text -> OrgParser m (F Blocks)\nparseBlockLines f blockType = (f <$> parsedBlockContent)\n where\n   parsedBlockContent :: PandocMonad m => OrgParser m (F Blocks)\n   parsedBlockContent = try $ do\n     raw <- rawBlockContent blockType\n     parseFromString blocks (raw <> \"\\n\")\n\n-- | Read the raw string content of a block\nrawBlockContent :: Monad m => Text -> OrgParser m Text\nrawBlockContent blockType = rawBlockContent' $\n   stringAnyCase (\"#+end_\" <> blockType)\n\n-- | Read the raw string content of a block\nrawBlockContent' :: Monad m => OrgParser m Text -> OrgParser m Text\nrawBlockContent' blockEnder = try $ do\n  blkLines <- manyTill rawLine (try $ skipSpaces <* blockEnder)\n  tabStop <- getOption readerTabStop\n  trimP <- orgStateTrimLeadBlkIndent <$> getState\n  -- split lines into indentation/contents tuples\n  let splitLines = map (T.span (\\c -> c == ' ' || c == '\\t')) blkLines\n  let countSpaces = T.foldr (\\case {'\\t' -> (tabStop +); _ -> (1 +)}) 0\n  let shortestIndent = foldr (min . countSpaces . fst) maxBound\n                     . filter (not . T.null . snd) -- ignore empty lines\n                     $ splitLines\n  let tabsToSpaces = T.replace \"\\t\" (T.replicate tabStop \" \")\n  let reIndent = if trimP\n                 then (T.drop shortestIndent . tabsToSpaces)\n                 else id\n\n  T.unlines (map (uncurry T.append . bimap reIndent commaEscaped) splitLines)\n   <$ updateState (\\s -> s { orgStateTrimLeadBlkIndent = True })\n where\n   rawLine :: Monad m => OrgParser m Text\n   rawLine = try $ (\"\" <$ blankline) <|> anyLine\n\n   commaEscaped suff = case T.uncons suff of\n     Just (',', cs)\n       | \"*\"  <- T.take 1 cs -> cs\n       | \"#+\" <- T.take 2 cs -> cs\n     _                       -> suff\n\n-- | Read but ignore all remaining block headers.\nignHeaders :: Monad m => OrgParser m ()\nignHeaders = (() <$ newline) <|> (() <$ anyLine)\n\n-- | Read a block containing code intended for export in specific backends\n-- only.\nexportBlock :: Monad m => Text -> OrgParser m (F Blocks)\nexportBlock blockType = try $ do\n  exportType <- skipSpaces *> orgArgWord <* ignHeaders\n  contents   <- rawBlockContent blockType\n  returnF (B.rawBlock (T.toLower exportType) contents)\n\nverseBlock :: PandocMonad m => Text -> OrgParser m (F Blocks)\nverseBlock blockType = try $ do\n  ignHeaders\n  content <- rawBlockContent blockType\n  fmap B.lineBlock . sequence\n    <$> mapM parseVerseLine (T.lines content)\n where\n   -- replace initial spaces with nonbreaking spaces to preserve\n   -- indentation, parse the rest as normal inline\n   parseVerseLine :: PandocMonad m => Text -> OrgParser m (F Inlines)\n   parseVerseLine cs = do\n     let (initialSpaces, indentedLine) = T.span isSpace cs\n     let nbspIndent = if T.null initialSpaces\n                      then mempty\n                      else B.str $ T.map (const '\\160') initialSpaces\n     line <- parseFromString inlines (indentedLine <> \"\\n\")\n     return (trimInlinesF $ pure nbspIndent <> line)\n\n-- | Parses an environment of the given name and adds the result to the document\n-- metadata under a key of the same name.\nmetadataBlock :: PandocMonad m => Text -> OrgParser m (F Blocks)\nmetadataBlock blockType = try $ do\n  ignHeaders\n  content <- parseBlockLines id blockType\n  meta'   <- orgStateMeta <$> getState\n  updateState $ \\st ->\n    st { orgStateMeta = B.setMeta blockType <$> content <*> meta' }\n  return mempty\n\n-- | Read a code block and the associated results block if present.  Which of\n-- the blocks is included in the output is determined using the \"exports\"\n-- argument in the block header.\ncodeBlock :: PandocMonad m => BlockAttributes -> Text -> OrgParser m (F Blocks)\ncodeBlock blockAttrs blockType = do\n  skipSpaces\n  (classes, kv)  <- codeHeaderArgs <|> (mempty <$ ignHeaders)\n  content        <- rawBlockContent blockType\n  resultsContent <- option mempty babelResultsBlock\n  let identifier = fromMaybe mempty $ blockAttrName blockAttrs\n  let classes'   = case classes of\n                     c:cs | Just c' <- T.stripPrefix \"jupyter-\" c ->\n                            c' : \"code\" : cs\n                     _ -> classes\n  let codeBlk    = B.codeBlockWith (identifier, classes', kv) content\n  let wrap       = maybe pure addCaption (blockAttrCaption blockAttrs)\n  return $\n    (if exportsCode kv    then wrap codeBlk   else mempty) <>\n    (if exportsResults kv then resultsContent else mempty)\n where\n   addCaption :: F Inlines -> Blocks -> F Blocks\n   addCaption caption blk = B.divWith (\"\", [\"captioned-content\"], [])\n                         <$> (mkCaptionBlock caption <> pure blk)\n\n   mkCaptionBlock :: F Inlines -> F Blocks\n   mkCaptionBlock = fmap (B.divWith (\"\", [\"caption\"], []) . B.plain)\n\n   exportsResults :: [(Text, Text)] -> Bool\n   exportsResults = maybe False (`elem` [\"results\", \"both\"]) . lookup \"exports\"\n\n-- | Parse the result of an evaluated babel code block.\nbabelResultsBlock :: PandocMonad m => OrgParser m (F Blocks)\nbabelResultsBlock = try $ do\n  blanklines\n  resultsMarker <|>\n    (lookAhead . void . try $\n      manyTill (metaLineStart *> anyLineNewline) resultsMarker)\n  block\n where\n  resultsMarker = try . void $ stringAnyCase \"#+RESULTS:\" *> blankline\n\n-- | Parse code block arguments\ncodeHeaderArgs :: Monad m => OrgParser m ([Text], [(Text, Text)])\ncodeHeaderArgs = try $ do\n  language   <- skipSpaces *> orgArgWord\n  (switchClasses, switchKv) <- switchesAsAttributes\n  parameters <- manyTill blockOption newline\n  return ( translateLang language : switchClasses\n         , originalLang language <> switchKv <> parameters\n         )\n\nswitchesAsAttributes :: Monad m => OrgParser m ([Text], [(Text, Text)])\nswitchesAsAttributes = try $ do\n  switches <- skipSpaces *> try (switch `sepBy` many1 spaceChar)\n  return $ foldr addToAttr ([], []) switches\n where\n  addToAttr :: (Char, Maybe Text, SwitchPolarity)\n            -> ([Text], [(Text, Text)])\n            -> ([Text], [(Text, Text)])\n  addToAttr ('n', lineNum, pol) (cls, kv) =\n    let kv' = case lineNum of\n                Just num -> (\"startFrom\", num):kv\n                Nothing  -> kv\n        cls' = case pol of\n                 SwitchPlus  -> \"continuedSourceBlock\":cls\n                 SwitchMinus -> cls\n    in (\"numberLines\":cls', kv')\n  addToAttr _ x = x\n\n-- | Whether a switch flag is specified with @+@ or @-@.\ndata SwitchPolarity = SwitchPlus | SwitchMinus\n  deriving (Show, Eq)\n\n-- | Parses a switch's polarity.\nswitchPolarity :: Monad m => OrgParser m SwitchPolarity\nswitchPolarity = (SwitchMinus <$ char '-') <|> (SwitchPlus <$ char '+')\n\n-- | Parses a source block switch option.\nswitch :: Monad m => OrgParser m (Char, Maybe Text, SwitchPolarity)\nswitch = try $ lineNumberSwitch <|> labelSwitch\n               <|> whitespaceSwitch <|> simpleSwitch\n where\n   simpleSwitch = (\\pol c -> (c, Nothing, pol)) <$> switchPolarity <*> letter\n   labelSwitch = genericSwitch 'l' $\n     char '\"' *> many1TillChar nonspaceChar (char '\"')\n\nwhitespaceSwitch :: Monad m => OrgParser m (Char, Maybe Text, SwitchPolarity)\nwhitespaceSwitch = do\n  string \"-i\"\n  updateState $ \\s -> s { orgStateTrimLeadBlkIndent = False }\n  return ('i', Nothing, SwitchMinus)\n\n-- | Generic source block switch-option parser.\ngenericSwitch :: Monad m\n              => Char\n              -> OrgParser m Text\n              -> OrgParser m (Char, Maybe Text, SwitchPolarity)\ngenericSwitch c p = try $ do\n  polarity <- switchPolarity <* char c <* skipSpaces\n  arg <- optionMaybe p\n  return (c, arg, polarity)\n\n-- | Reads a line number switch option. The line number switch can be used with\n-- example and source blocks.\nlineNumberSwitch :: Monad m => OrgParser m (Char, Maybe Text, SwitchPolarity)\nlineNumberSwitch = genericSwitch 'n' (manyChar digit)\n\nblockOption :: Monad m => OrgParser m (Text, Text)\nblockOption = try $ do\n  argKey <- orgArgKey\n  paramValue <- option \"yes\" orgParamValue\n  return (argKey, paramValue)\n\norgParamValue :: Monad m => OrgParser m Text\norgParamValue = try $\n  skipSpaces\n    *> notFollowedBy orgArgKey\n    *> ((char '\"' *> manyChar (noneOf \"\\n\\r\\\"\") <* char '\"') <|>\n        noneOf \"\\n\\r\" `many1TillChar` endOfValue)\n    <* skipSpaces\n where\n  endOfValue = lookAhead $  try (skipSpaces <* oneOf \"\\n\\r\")\n                        <|> try (skipSpaces1 <* orgArgKey)\n\n\n--\n-- Dynamic block (#+begin: ...  #+end:)\n--\n\n-- | Parses a Dynamic Block, i.e., a block delimited by #+BEGIN: and\n-- #+END:.\ndynamicBlock :: PandocMonad m => OrgParser m (F Blocks)\ndynamicBlock = try $ do\n  metaLineStart *> stringAnyCase \"begin:\" *> spaces\n  blockname <- optionMaybe orgArgWord\n  blockArgs <- blockParameters\n  contents <- do\n    raw <- rawBlockContent' $ metaLineStart *> stringAnyCase \"end:\"\n    parseFromString blocks (raw <> \"\\n\")\n  let attr = (\"\", maybe [] (:[]) blockname, blockArgs)\n  return $ B.divWith attr <$> contents\n\n-- | Parse block arguments; in order, this tries to parse a Lisp-style\n-- argument list, a set of key-value pairs using /equals/, and as a\n-- fallback the whole line as a single /parameters/ argument.\nblockParameters :: PandocMonad m => OrgParser m [(Text, Text)]\nblockParameters = choice\n  [ try $ manyTill ((,) <$> orgArgKey <*> orgParamValue) newline\n  , try $ manyTill ((,) <$> (spaces *> orgArgWord <* char '=') <*> orgArgWord)\n                   newline\n  , (\\x -> [ (\"parameters\", x) | not (T.null x)]) <$> (skipSpaces *> anyLine)\n  ]\n\n--\n-- Drawers\n--\n\n-- | A generic drawer which has no special meaning for org-mode.\n-- Whether or not this drawer is included in the output depends on the drawers\n-- export setting.\ngenericDrawer :: PandocMonad m => OrgParser m (F Blocks)\ngenericDrawer = try $ do\n  name    <- T.toUpper <$> drawerStart\n  content <- manyTill drawerLine (try drawerEnd)\n  state   <- getState\n  -- Include drawer if it is explicitly included in or not explicitly excluded\n  -- from the list of drawers that should be exported.  PROPERTIES drawers are\n  -- never exported.\n  case exportDrawers . orgStateExportSettings $ state of\n    _           | name == \"PROPERTIES\" -> return mempty\n    Left  names | name `elem`    names -> return mempty\n    Right names | name `notElem` names -> return mempty\n    _           -> drawerDiv name <$> parseLines content\n where\n  parseLines :: PandocMonad m => [Text] -> OrgParser m (F Blocks)\n  parseLines = parseFromString blocks . (<> \"\\n\") . T.unlines\n\n  drawerDiv :: Text -> F Blocks -> F Blocks\n  drawerDiv drawerName = fmap $ B.divWith (mempty, [drawerName, \"drawer\"], mempty)\n\ndrawerLine :: Monad m => OrgParser m Text\ndrawerLine = anyLine\n\ndrawerEnd :: Monad m => OrgParser m Text\ndrawerEnd = try $\n  skipSpaces *> stringAnyCase \":END:\" <* skipSpaces <* newline\n\n\n--\n-- Figures\n--\n\n-- | Figures or an image paragraph (i.e. an image on a line by itself). Only\n-- images with a caption attribute are interpreted as figures.\nfigure :: PandocMonad m => OrgParser m (F Blocks)\nfigure = try $ do\n  figAttrs <- blockAttributes\n  src <- skipSpaces *> selfTarget <* skipSpaces <* endOfParagraph\n  case cleanLinkText src of\n    Nothing     -> mzero\n    Just imgSrc -> do\n      guard (isImageFilename imgSrc)\n      let isFigure = isJust $ blockAttrCaption figAttrs\n      return $ imageBlock isFigure figAttrs imgSrc\n where\n   selfTarget :: PandocMonad m => OrgParser m Text\n   selfTarget = try $ char '[' *> linkTarget <* char ']'\n\n   imageBlock :: Bool -> BlockAttributes -> Text -> F Blocks\n   imageBlock isFigure figAttrs imgSrc =\n     let\n       figName    = fromMaybe mempty $ blockAttrName figAttrs\n       figCaption = fromMaybe mempty $ blockAttrCaption figAttrs\n       figKeyVals = blockAttrKeyValues figAttrs\n       attr       = (figName, mempty, figKeyVals)\n     in if isFigure\n           then (\\c -> B.figureWith attr (B.simpleCaption (B.plain c))\n                       (B.plain $ B.image imgSrc \"\" mempty))\n                <$> figCaption\n           else B.para . B.imageWith attr imgSrc figName <$> figCaption\n\n-- | Succeeds if looking at the end of the current paragraph\nendOfParagraph :: Monad m => OrgParser m ()\nendOfParagraph = try $ skipSpaces *> newline *> endOfBlock\n\n\n--\n-- Examples\n--\n\n-- | Example code marked up by a leading colon.\nexample :: Monad m => OrgParser m (F Blocks)\nexample = try $ returnF . exampleCode . T.unlines =<< many1 exampleLine\n where\n   exampleLine :: Monad m => OrgParser m Text\n   exampleLine = try $ exampleLineStart *> anyLine\n\nexampleCode :: Text -> Blocks\nexampleCode = B.codeBlockWith (\"\", [], [])\n\n\n--\n-- Comments, Options and Metadata\n--\n\nspecialLine :: PandocMonad m => OrgParser m (F Blocks)\nspecialLine = fmap return . try $\n  rawExportLine <|> printbibliographyLine <|> metaLine <|> commentLine\n\nprintbibliographyLine :: PandocMonad m => OrgParser m Blocks\nprintbibliographyLine = do\n  try $ skipSpaces <* string \"#+print_bibliography:\" <* anyLine\n  return $ B.divWith (\"refs\",[],[]) mempty\n\n-- | Include the content of a file.\ninclude :: PandocMonad m => OrgParser m (F Blocks)\ninclude = try $ do\n  metaLineStart <* stringAnyCase \"include:\" <* skipSpaces\n  filename <- includeTarget\n  includeArgs <- many (try $ skipSpaces *> many1Char alphaNum)\n  params <- keyValues\n  blocksParser <- case includeArgs of\n      (\"example\" : _) -> return $ pure . B.codeBlock <$> parseRaw\n      [\"export\"] -> return . returnF $ B.fromList []\n      [\"export\", format] -> return $ pure . B.rawBlock format <$> parseRaw\n      (\"src\" : rest) -> do\n        let attr = case rest of\n                     [lang] -> (mempty, [lang], mempty)\n                     _ -> nullAttr\n        return $ pure . B.codeBlockWith attr <$> parseRaw\n      _ -> return $ return . B.fromList . blockFilter params <$> blockList\n  currentDir <- takeDirectory . sourceName <$> getPosition\n  let (startLine, endLine) =\n        case lookup \"lines\" params of\n          Nothing -> (Nothing, Nothing)\n          Just bounds -> let boundStr = T.drop 1 (T.dropEnd 1 bounds)\n                             begStr = T.takeWhile (/= '-') boundStr\n                             endStr = T.takeWhileEnd (/= '-') boundStr\n                         in (safeRead begStr, pred <$> safeRead endStr)\n  insertIncludedFile blocksParser toSources\n                     [currentDir] filename startLine endLine\n where\n  includeTarget :: PandocMonad m => OrgParser m FilePath\n  includeTarget = do\n    char '\"'\n    manyTill (noneOf \"\\n\\r\\t\") (char '\"')\n\n  parseRaw :: PandocMonad m => OrgParser m Text\n  parseRaw = manyChar anyChar\n\n  blockFilter :: [(Text, Text)] -> [Block] -> [Block]\n  blockFilter params blks =\n    let minlvl = lookup \"minlevel\" params\n    in case (minlvl >>= safeRead :: Maybe Int) of\n         Nothing -> blks\n         Just lvl -> let levels = Walk.query headerLevel blks\n                         curMin = maybe 0 minimum $ nonEmpty levels\n                     in Walk.walk (shiftHeader (curMin - lvl)) blks\n\n  headerLevel :: Block -> [Int]\n  headerLevel (Header lvl _attr _content) = [lvl]\n  headerLevel _ = []\n\n  shiftHeader :: Int -> Block -> Block\n  shiftHeader shift blk =\n    case blk of\n      (Header lvl attr content)\n       | lvl - shift > 0  -> Header (lvl - shift) attr content\n       | otherwise        -> Para content\n      _ -> blk\n\n-- | Parses a meta line which defines a raw block. Currently recognized:\n-- @#+LATEX:@, @#+HTML:@, @#+TEXINFO:@, and @#+BEAMER@.\nrawExportLine :: PandocMonad m => OrgParser m Blocks\nrawExportLine = try $ do\n  metaLineStart\n  key <- metaKey\n  if key `elem` [\"latex\", \"html\", \"texinfo\", \"beamer\"]\n    then B.rawBlock key <$> anyLine\n    else mzero\n\n-- | Parses any meta line, i.e., a line starting with @#+@, into a raw\n-- org block. This should be the last resort when trying to parse\n-- keywords. Leading spaces are discarded.\nrawOrgLine :: PandocMonad m => OrgParser m (F Blocks)\nrawOrgLine = do\n  line <- metaLineStart *> anyLine\n  returnF $ B.rawBlock \"org\" $ \"#+\" <> line\n\ncommentLine :: Monad m => OrgParser m Blocks\ncommentLine = commentLineStart *> anyLine $> mempty\n\n\n--\n-- Tables\n--\ndata ColumnProperty = ColumnProperty\n  { columnAlignment :: Maybe Alignment\n  , columnRelWidth  :: Maybe Int\n  } deriving (Show, Eq)\n\ninstance Default ColumnProperty where\n  def = ColumnProperty Nothing Nothing\n\ndata OrgTableRow = OrgContentRow (F [Blocks])\n                 | OrgAlignRow [ColumnProperty]\n                 | OrgHlineRow\n\n-- OrgTable is strongly related to the pandoc table ADT.  Using the same\n-- (i.e. pandoc-global) ADT would mean that the reader would break if the\n-- global structure was to be changed, which would be bad.  The final table\n-- should be generated using a builder function.\ndata OrgTable = OrgTable\n  { orgTableColumnProperties :: [ColumnProperty]\n  , orgTableHeader           :: [Blocks]\n  , orgTableRows             :: [[Blocks]]\n  }\n\ntable :: PandocMonad m => OrgParser m (F Blocks)\ntable = try $ do\n  -- don't allow a table on the first line of a list item; org requires that\n  -- tables start at first non-space character on the line\n  let isFirstInListItem st = orgStateParserContext st == ListItemState &&\n                             isNothing (orgStateLastPreCharPos st)\n  guard . not . isFirstInListItem =<< getState\n  blockAttrs <- blockAttributes\n  let identMb = blockAttrName blockAttrs\n  tbl <- gridTableWith blocks <|> orgTable\n  withTables <- getExportSetting exportWithTables\n  return $ if withTables\n              then do\n                xs <- unMany <$> tbl\n                case F.toList xs of\n                  [Table _ _ cs th tb tf] -> do\n                    capt <- case blockAttrCaption blockAttrs of\n                              Nothing -> pure $ Caption Nothing []\n                              Just ils -> do\n                                ils' <- ils\n                                pure $ B.simpleCaption . B.plain $ ils'\n                    let attr = (fromMaybe mempty identMb, [],\n                                 blockAttrKeyValues blockAttrs)\n                    pure $ B.tableWith attr capt cs th tb tf\n                  _ -> tbl   -- should not happen\n              else mempty\n\n-- | A normal org table\norgTable :: PandocMonad m => OrgParser m (F Blocks)\norgTable = do\n  lookAhead tableStart\n  rows <- tableRows\n  let orgTbl = normalizeTable <$> rowsToTable rows\n  return $ orgToPandocTable <$> orgTbl\n\norgToPandocTable :: OrgTable -> Blocks\norgToPandocTable (OrgTable colProps heads lns) =\n  let totalWidth = if any (isJust . columnRelWidth) colProps\n                   then Just . sum $ map (fromMaybe 1 . columnRelWidth) colProps\n                   else Nothing\n  in B.tableWith nullAttr (Caption Nothing mempty)\n                 (map (convertColProp totalWidth) colProps)\n                 (TableHead nullAttr $ toHeaderRow heads)\n                 [TableBody nullAttr 0 [] $ map toRow lns]\n                 (TableFoot nullAttr [])\n where\n   toRow = Row nullAttr . map B.simpleCell\n   toHeaderRow l = [toRow l | not (null l)]\n   convertColProp :: Maybe Int -> ColumnProperty -> (Alignment, ColWidth)\n   convertColProp totalWidth colProp =\n     let\n       align' = fromMaybe AlignDefault $ columnAlignment colProp\n       width' = (\\w t -> fromIntegral w / fromIntegral t)\n                <$> columnRelWidth colProp\n                <*> totalWidth\n     in (align', maybe ColWidthDefault ColWidth width')\n\ntableRows :: PandocMonad m => OrgParser m [OrgTableRow]\ntableRows = try $ many (tableAlignRow <|> tableHline <|> tableContentRow)\n\ntableContentRow :: PandocMonad m => OrgParser m OrgTableRow\ntableContentRow = try $\n  OrgContentRow . sequence <$> (tableStart *> manyTill tableContentCell newline)\n\ntableContentCell :: PandocMonad m => OrgParser m (F Blocks)\ntableContentCell = try $\n  fmap B.plain . trimInlinesF . mconcat <$> manyTill inline endOfCell\n\ntableAlignRow :: Monad m => OrgParser m OrgTableRow\ntableAlignRow = try $ do\n  tableStart\n  colProps <- many1Till columnPropertyCell newline\n  -- Empty rows are regular (i.e. content) rows, not alignment rows.\n  guard $ any (/= def) colProps\n  return $ OrgAlignRow colProps\n\ncolumnPropertyCell :: Monad m => OrgParser m ColumnProperty\ncolumnPropertyCell = emptyOrgCell <|> propCell <?> \"alignment info\"\n where\n   emptyOrgCell = ColumnProperty Nothing Nothing <$ try (skipSpaces *> endOfCell)\n   propCell = try $ ColumnProperty\n                 <$> (skipSpaces\n                      *> char '<'\n                      *> optionMaybe tableAlignFromChar)\n                 <*> (optionMaybe (many1Char digit >>= safeRead)\n                      <* char '>'\n                      <* emptyOrgCell)\n\ntableAlignFromChar :: Monad m => OrgParser m Alignment\ntableAlignFromChar = try $\n  choice [ char 'l' $> AlignLeft\n         , char 'c' $> AlignCenter\n         , char 'r' $> AlignRight\n         ]\n\ntableHline :: Monad m => OrgParser m OrgTableRow\ntableHline = try $\n  OrgHlineRow <$ (tableStart *> char '-' *> anyLine)\n\nendOfCell :: Monad m => OrgParser m Char\nendOfCell = try $ char '|' <|> lookAhead newline\n\nrowsToTable :: [OrgTableRow]\n            -> F OrgTable\nrowsToTable = foldM rowToContent emptyTable\n where emptyTable = OrgTable mempty mempty mempty\n\nnormalizeTable :: OrgTable -> OrgTable\nnormalizeTable (OrgTable colProps heads rows) =\n  OrgTable colProps' heads rows\n where\n   refRow = if heads /= mempty\n            then heads\n            else case rows of\n                   (r:_) -> r\n                   _     -> mempty\n   cols = length refRow\n   fillColumns base padding = take cols $ base ++ repeat padding\n   colProps' = fillColumns colProps def\n\n-- One or more horizontal rules after the first content line mark the previous\n-- line as a header.  All other horizontal lines are discarded.\nrowToContent :: OrgTable\n             -> OrgTableRow\n             -> F OrgTable\nrowToContent tbl row =\n  case row of\n    OrgHlineRow       -> return singleRowPromotedToHeader\n    OrgAlignRow props -> return . setProperties $ props\n    OrgContentRow cs  -> appendToBody cs\n where\n   singleRowPromotedToHeader :: OrgTable\n   singleRowPromotedToHeader = case tbl of\n     OrgTable{ orgTableHeader = [], orgTableRows = [b] } ->\n            tbl{ orgTableHeader = b , orgTableRows = [] }\n     _   -> tbl\n\n   setProperties :: [ColumnProperty] -> OrgTable\n   setProperties ps = tbl{ orgTableColumnProperties = ps }\n\n   appendToBody :: F [Blocks] -> F OrgTable\n   appendToBody frow = do\n     newRow <- frow\n     let oldRows = orgTableRows tbl\n     -- NOTE: This is an inefficient O(n) operation.  This should be changed\n     -- if performance ever becomes a problem.\n     return tbl{ orgTableRows = oldRows ++ [newRow] }\n\n\n--\n-- LaTeX fragments\n--\nlatexFragment :: PandocMonad m => OrgParser m (F Blocks)\nlatexFragment = try $ do\n  envName <- latexEnvStart\n  guard $ envName `notElem` inlineEnvironmentNames\n  texOpt  <- getExportSetting exportWithLatex\n  let envStart = \"\\\\begin{\" <> envName <> \"}\"\n  let envEnd = \"\\\\end{\" <> envName <> \"}\"\n  envContent <- do\n    content <- manyTillChar anyChar (latexEnd envName)\n    return $ envStart <> content <> envEnd\n  returnF $ case texOpt of\n    TeXExport -> B.rawBlock \"latex\" (envContent <> \"\\n\")\n    TeXIgnore   -> mempty\n    TeXVerbatim -> B.para . B.text $ envContent\n where\n  latexEnd :: Monad m => Text -> OrgParser m ()\n  latexEnd envName = try . void\n     $ textStr (\"\\\\end{\" <> envName <> \"}\")\n    <* blankline\n\n\n--\n-- Footnote definitions\n--\nnoteBlock :: PandocMonad m => OrgParser m (F Blocks)\nnoteBlock = try $ do\n  ref <- noteMarker <* skipSpaces <* updateLastPreCharPos\n  content <- mconcat <$> many1Till block endOfFootnote\n  addToNotesTable (ref, content)\n  return mempty\n where\n   endOfFootnote =  eof\n                <|> () <$ lookAhead noteMarker\n                <|> () <$ lookAhead headerStart\n                <|> () <$ lookAhead (try $ blankline *> blankline)\n\n-- Paragraphs or Plain text\nparaOrPlain :: PandocMonad m => OrgParser m (F Blocks)\nparaOrPlain = try $ do\n  -- Make sure we are not looking at a headline\n  notFollowedBy' headerStart\n  ils <- inlines\n  nl <- option False (newline $> True)\n  -- Read block as paragraph, except if we are in a list context and the block\n  -- is directly followed by a list item, in which case the block is read as\n  -- plain text.\n  try (guard nl\n       *> notFollowedBy (inList *> (void orderedListStart <|> void bulletListStart))\n       $> (B.para <$> ils))\n    <|>  return (B.plain <$> ils)\n\n\n--\n-- list blocks\n--\n\nlist :: PandocMonad m => OrgParser m (F Blocks)\nlist = choice [ definitionList, bulletList, orderedList ] <?> \"list\"\n\ndefinitionList :: PandocMonad m => OrgParser m (F Blocks)\ndefinitionList = try $ do\n  indent <- lookAhead bulletListStart\n  fmap (B.definitionList . compactifyDL) . sequence\n    <$> many1 (definitionListItem (bulletListStart `indented` indent))\n\nbulletList :: PandocMonad m => OrgParser m (F Blocks)\nbulletList = try $ do\n  indent <- lookAhead bulletListStart\n  fmap (B.bulletList . compactify) . sequence\n    <$> many1 (listItem (bulletListStart `indented` indent))\n\nindented :: OrgParser m Int -> Int -> OrgParser m Int\nindented indentedMarker minIndent = try $ do\n  n <- indentedMarker\n  guard (minIndent <= n)\n  return n\n\norderedList :: PandocMonad m => OrgParser m (F Blocks)\norderedList = try $ do\n  (indent, attr) <- lookAhead orderedListStart\n  fmap (B.orderedListWith attr . compactify) . sequence\n    <$> many1 (listItem ((fst <$> orderedListStart) `indented` indent))\n\ndefinitionListItem :: PandocMonad m\n                   => OrgParser m Int\n                   -> OrgParser m (F (Inlines, [Blocks]))\ndefinitionListItem parseIndentedMarker = try $ do\n  markerLength <- parseIndentedMarker\n  term <- manyTillChar (noneOf \"\\n\\r\") (try definitionMarker)\n  line1 <- anyLineNewline\n  blank <- option \"\" (\"\\n\" <$ blankline)\n  cont <- T.concat <$> many (listContinuation markerLength)\n  term' <- parseFromString inlines term\n  contents' <- parseFromString blocks $ line1 <> blank <> cont\n  return $ (,) <$> term' <*> fmap (:[]) contents'\n where\n   definitionMarker =\n     spaceChar *> string \"::\" <* (spaceChar <|> lookAhead newline)\n\n-- | Checkbox for tasks.\ndata Checkbox\n  = UncheckedBox\n  | CheckedBox\n  | SemicheckedBox\n\n-- | Parses a checkbox in a plain list.\ncheckbox :: PandocMonad m\n         => OrgParser m Checkbox\ncheckbox = do\n  guardEnabled Ext_task_lists\n  try (char '[' *> status <* char ']') <?> \"checkbox\"\n  where\n    status = choice\n      [ UncheckedBox   <$ char ' '\n      , CheckedBox     <$ char 'X'\n      , SemicheckedBox <$ char '-'\n      ]\n\ncheckboxToInlines :: Checkbox -> Inline\ncheckboxToInlines = B.Str . \\case\n  UncheckedBox   -> \"☐\"\n  SemicheckedBox -> \"☐\"\n  CheckedBox     -> \"☒\"\n\n-- | parse raw text for one list item\nlistItem :: PandocMonad m\n         => OrgParser m Int\n         -> OrgParser m (F Blocks)\nlistItem parseIndentedMarker = try . withContext ListItemState $ do\n  markerLength <- try parseIndentedMarker\n  box <- optionMaybe checkbox\n  firstLine <- anyLineNewline\n  blank <- option \"\" (\"\\n\" <$ blankline)\n  rest <- T.concat <$> many (listContinuation markerLength)\n  contents <- parseFromString (do initial <- paraOrPlain <|> pure mempty\n                                  subsequent <- blocks\n                                  return $ initial <> subsequent)\n                (firstLine <> blank <> rest)\n  return (maybe id (prependInlines . checkboxToInlines) box <$> contents)\n\n-- | Prepend inlines to blocks, adding them to the first paragraph or\n-- creating a new Plain element if necessary.\nprependInlines :: Inline -> Blocks -> Blocks\nprependInlines inlns = B.fromList . prepend . B.toList\n  where\n    prepend (Plain is : bs) = Plain (inlns : Space : is) : bs\n    prepend (Para  is : bs) = Para  (inlns : Space : is) : bs\n    prepend bs              = Plain [inlns, Space] : bs\n\n-- continuation of a list item - indented and separated by blankline or endline.\n-- Note: nested lists are parsed as continuations.\nlistContinuation :: PandocMonad m => Int -> OrgParser m Text\nlistContinuation markerLength = try $ do\n  notFollowedBy' blankline\n  mappend <$> (T.concat <$> many1 (listContinuation' markerLength))\n          <*> manyChar blankline\n where\n   listContinuation' indentation =\n      blockLines indentation <|> listLine indentation\n   listLine indentation = try $ indentWith indentation *> anyLineNewline\n  -- The block attributes and start must be appropriately indented,\n  -- but the contents, and end do not.\n   blockLines indentation =\n      try $ lookAhead (indentWith indentation\n                       >> blockAttributes\n                       >>= (\\blockAttrs ->\n                              case attrFromBlockAttributes blockAttrs of\n                                (\"\", [], []) -> countChar 1 anyChar\n                                _ -> indentWith indentation))\n            >> (snd <$> withRaw orgBlock)\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/DocumentTree.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TupleSections     #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.DocumentTree\n   Copyright   : Copyright (C) 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nParsers for org-mode headlines and document subtrees\n-}\nmodule Text.Pandoc.Readers.Org.DocumentTree\n  ( documentTree\n  , unprunedHeadlineToBlocks\n  ) where\n\nimport Control.Arrow ((***), first)\nimport Control.Monad (guard, mplus)\nimport Data.List (intersperse)\nimport Data.Maybe (mapMaybe)\nimport Data.Text (Text)\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Readers.Org.BlockStarts\nimport Text.Pandoc.Readers.Org.ParserState\nimport Text.Pandoc.Readers.Org.Parsing\n\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\n\n--\n-- Org headers\n--\n\n-- | Parse input as org document tree.\ndocumentTree :: PandocMonad m\n             => OrgParser m (F Blocks)\n             -> OrgParser m (F Inlines)\n             -> OrgParser m (F Headline)\ndocumentTree blocks inline = do\n  many commentLine\n  properties <- option mempty propertiesDrawer\n  initialBlocks <- blocks\n  headlines <- sequence <$> manyTill (headline blocks inline 1) eof\n  title <- fmap docTitle . orgStateMeta <$> getState\n  return $ do\n    headlines' <- headlines\n    initialBlocks' <- initialBlocks\n    title' <- title\n    return Headline\n      { headlineLevel = 0\n      , headlineTodoMarker = Nothing\n      , headlineText = B.fromList title'\n      , headlineTags = mempty\n      , headlinePlanning = emptyPlanning\n      , headlineProperties = properties\n      , headlineContents = initialBlocks'\n      , headlineChildren = headlines'\n      }\n  where\n    commentLine :: Monad m => OrgParser m ()\n    commentLine = commentLineStart <* anyLine\n\n-- | Create a tag containing the given string.\ntoTag :: Text -> Tag\ntoTag = Tag\n\n-- | The key (also called name or type) of a property.\nnewtype PropertyKey = PropertyKey { fromKey :: Text }\n  deriving (Show, Eq, Ord)\n\n-- | Create a property key containing the given string.  Org mode keys are\n-- case insensitive and are hence converted to lower case.\ntoPropertyKey :: Text -> PropertyKey\ntoPropertyKey = PropertyKey . T.toLower\n\n-- | The value assigned to a property.\nnewtype PropertyValue = PropertyValue { fromValue :: Text }\n\n-- | Create a property value containing the given string.\ntoPropertyValue :: Text -> PropertyValue\ntoPropertyValue = PropertyValue\n\n-- | Check whether the property value is non-nil (i.e. truish).\nisNonNil :: PropertyValue -> Bool\nisNonNil p = T.toLower (fromValue p) `notElem` [\"()\", \"{}\", \"nil\"]\n\n-- | Key/value pairs from a PROPERTIES drawer\ntype Properties = [(PropertyKey, PropertyValue)]\n\n-- | Org mode headline (i.e. a document subtree).\ndata Headline = Headline\n  { headlineLevel      :: Int\n  , headlineTodoMarker :: Maybe TodoMarker\n  , headlineText       :: Inlines\n  , headlineTags       :: [Tag]\n  , headlinePlanning   :: PlanningInfo -- ^ subtree planning information\n  , headlineProperties :: Properties\n  , headlineContents   :: Blocks\n  , headlineChildren   :: [Headline]\n  }\n\n-- | Read an Org mode headline and its contents (i.e. a document subtree).\n-- @lvl@ gives the minimum acceptable level of the tree.\nheadline :: PandocMonad m\n         => OrgParser m (F Blocks)\n         -> OrgParser m (F Inlines)\n         -> Int\n         -> OrgParser m (F Headline)\nheadline blocks inline lvl = try $ do\n  level <- headerStart\n  guard (lvl <= level)\n  todoKw <- optionMaybe todoKeyword\n  (title, tags) <- manyThen inline endOfTitle\n  planning   <- option emptyPlanning planningInfo\n  properties <- option mempty propertiesDrawer\n  contents   <- blocks\n  children   <- many (headline blocks inline (level + 1))\n  return $ do\n    title'    <- trimInlinesF (mconcat title)\n    contents' <- contents\n    children' <- sequence children\n    return Headline\n      { headlineLevel = level\n      , headlineTodoMarker = todoKw\n      , headlineText = title'\n      , headlineTags = tags\n      , headlinePlanning = planning\n      , headlineProperties = properties\n      , headlineContents = contents'\n      , headlineChildren = children'\n      }\n where\n   endOfTitle :: Monad m => OrgParser m [Tag]\n   endOfTitle = try $ do\n     skipSpaces\n     tags <- option [] (headerTags <* skipSpaces)\n     newline\n     return tags\n\n   headerTags :: Monad m => OrgParser m [Tag]\n   headerTags = try $ do\n     char ':'\n     endBy1 (toTag <$> orgTagWord) (char ':')\n\n   manyThen :: Monad m\n            => OrgParser m a\n            -> OrgParser m b\n            -> OrgParser m ([a], b)\n   manyThen p end = (([],) <$> try end) <|> do\n     x <- p\n     first (x:) <$> manyThen p end\n\n   -- titleFollowedByTags :: Monad m => OrgParser m (Inlines, [Tag])\n   -- titleFollowedByTags = do\n\n\nunprunedHeadlineToBlocks :: Monad m => Headline -> OrgParserState -> OrgParser m [Block]\nunprunedHeadlineToBlocks hdln st =\n  let usingSelectedTags = docContainsSelectTags hdln st\n      rootNode = if not usingSelectedTags\n                   then hdln\n                   else includeRootAndSelected hdln st\n      rootNode' = removeExplicitlyExcludedNodes rootNode st\n  in if not usingSelectedTags ||\n        any (`Set.member` orgStateSelectTags st) (headlineTags rootNode')\n        then do headlineBlocks <- headlineToBlocks rootNode'\n                -- add metadata from root node :PROPERTIES:\n                updateState $ \\s ->\n                  s{ orgStateMeta = foldr\n                    (\\(PropertyKey k, PropertyValue v) m ->\n                        B.setMeta k v <$> m)\n                    (orgStateMeta s)\n                    (headlineProperties rootNode') }\n                -- ignore first headline, it's the document's title\n                return $ drop 1 $ B.toList headlineBlocks\n        else do headlineBlocks <- mconcat <$> mapM headlineToBlocks\n                                                   (headlineChildren rootNode')\n                return . B.toList $ headlineBlocks\n\n-- | Convert an Org mode headline (i.e. a document tree) into pandoc's Blocks\nheadlineToBlocks :: Monad m => Headline -> OrgParser m Blocks\nheadlineToBlocks hdln = do\n  maxLevel <- getExportSetting exportHeadlineLevels\n  let tags = headlineTags hdln\n  let text = headlineText hdln\n  let level = headlineLevel hdln\n  case () of\n    _ | any isArchiveTag  tags -> archivedHeadlineToBlocks hdln\n    _ | isCommentTitle text    -> return mempty\n    _ | maxLevel <= level      -> headlineToHeaderWithList hdln\n    _ | otherwise              -> headlineToHeaderWithContents hdln\n\nremoveExplicitlyExcludedNodes :: Headline -> OrgParserState -> Headline\nremoveExplicitlyExcludedNodes hdln st =\n  hdln { headlineChildren =\n           [removeExplicitlyExcludedNodes childHdln st |\n              childHdln <- headlineChildren hdln,\n              not $ headlineContainsExcludeTags childHdln st] }\n\nincludeRootAndSelected :: Headline -> OrgParserState -> Headline\nincludeRootAndSelected hdln st =\n  hdln { headlineChildren = mapMaybe (`includeAncestorsAndSelected` st)\n                                     (headlineChildren hdln)}\n\ndocContainsSelectTags :: Headline -> OrgParserState -> Bool\ndocContainsSelectTags hdln st =\n  headlineContainsSelectTags hdln st ||\n  any (`docContainsSelectTags` st) (headlineChildren hdln)\n\nincludeAncestorsAndSelected :: Headline -> OrgParserState -> Maybe Headline\nincludeAncestorsAndSelected hdln st =\n  if headlineContainsSelectTags hdln st\n    then Just hdln\n    else let children = mapMaybe (`includeAncestorsAndSelected` st)\n                                 (headlineChildren hdln)\n         in case children of\n              [] -> Nothing\n              _ -> Just $ hdln { headlineChildren = children }\n\nheadlineContainsSelectTags :: Headline -> OrgParserState -> Bool\nheadlineContainsSelectTags hdln st =\n  any (`Set.member` orgStateSelectTags st) (headlineTags hdln)\n\nheadlineContainsExcludeTags :: Headline -> OrgParserState -> Bool\nheadlineContainsExcludeTags hdln st =\n  any (`Set.member` orgStateExcludeTags st) (headlineTags hdln)\n\nisArchiveTag :: Tag -> Bool\nisArchiveTag = (== toTag \"ARCHIVE\")\n\n-- | Check if the title starts with COMMENT.\n-- FIXME: This accesses builder internals not intended for use in situations\n-- like these.  Replace once keyword parsing is supported.\nisCommentTitle :: Inlines -> Bool\nisCommentTitle inlns = case B.toList inlns of\n  (Str \"COMMENT\":_) -> True\n  _ -> False\n\narchivedHeadlineToBlocks :: Monad m => Headline -> OrgParser m Blocks\narchivedHeadlineToBlocks hdln = do\n  archivedTreesOption <- getExportSetting exportArchivedTrees\n  case archivedTreesOption of\n    ArchivedTreesNoExport     -> return mempty\n    ArchivedTreesExport       -> headlineToHeaderWithContents hdln\n    ArchivedTreesHeadlineOnly -> headlineToHeader hdln\n\nheadlineToHeaderWithList :: Monad m => Headline -> OrgParser m Blocks\nheadlineToHeaderWithList hdln = do\n  maxHeadlineLevels <- getExportSetting exportHeadlineLevels\n  header        <- headlineToHeader hdln\n  listElements  <- mapM headlineToBlocks (headlineChildren hdln)\n  planningBlock <- planningToBlock (headlinePlanning hdln)\n  let listBlock  = if null listElements\n                   then mempty\n                   else B.orderedList listElements\n  let headerText = if maxHeadlineLevels == headlineLevel hdln\n                   then header\n                   else flattenHeader header\n  return . mconcat $\n    [ headerText\n    , planningBlock\n    , headlineContents hdln\n    , listBlock\n    ]\n where\n   flattenHeader :: Blocks -> Blocks\n   flattenHeader blks =\n     case B.toList blks of\n       (Header _ _ inlns:_) -> B.para (B.fromList inlns)\n       _                    -> mempty\n\nheadlineToHeaderWithContents :: Monad m => Headline -> OrgParser m Blocks\nheadlineToHeaderWithContents hdln = do\n  header         <- headlineToHeader hdln\n  planningBlock <- planningToBlock (headlinePlanning hdln)\n  childrenBlocks <- mconcat <$> mapM headlineToBlocks (headlineChildren hdln)\n  return $ header <> planningBlock <> headlineContents hdln <> childrenBlocks\n\nheadlineToHeader :: Monad m => Headline -> OrgParser m Blocks\nheadlineToHeader hdln = do\n  exportTodoKeyword <- getExportSetting exportWithTodoKeywords\n  exportTags        <- getExportSetting exportWithTags\n  let todoText    = if exportTodoKeyword\n                    then case headlineTodoMarker hdln of\n                      Just kw -> todoKeywordToInlines kw <> B.space\n                      Nothing -> mempty\n                    else mempty\n  let text        = todoText <> headlineText hdln <>\n                    if exportTags\n                    then tagsToInlines (headlineTags hdln)\n                    else mempty\n  let propAttr    = propertiesToAttr (headlineProperties hdln)\n  attr           <- registerHeader propAttr (headlineText hdln)\n  return $ B.headerWith attr (headlineLevel hdln) text\n\ntodoKeyword :: Monad m => OrgParser m TodoMarker\ntodoKeyword = try $ do\n  taskStates <- activeTodoMarkers <$> getState\n  let kwParser tdm = try (tdm <$ textStr (todoMarkerName tdm)\n                              <* spaceChar\n                              <* updateLastPreCharPos)\n  choice (map kwParser taskStates)\n\ntodoKeywordToInlines :: TodoMarker -> Inlines\ntodoKeywordToInlines tdm =\n  let todoText  = todoMarkerName tdm\n      todoState = T.toLower . T.pack . show $ todoMarkerState tdm\n      classes = [todoState, todoText]\n  in B.spanWith (mempty, classes, mempty) (B.str todoText)\n\npropertiesToAttr :: Properties -> Attr\npropertiesToAttr properties =\n  let\n    toTextPair = fromKey *** fromValue\n    customIdKey = toPropertyKey \"custom_id\"\n    idKey = toPropertyKey \"id\"\n    classKey    = toPropertyKey \"class\"\n    unnumberedKey = toPropertyKey \"unnumbered\"\n    specialProperties = [customIdKey, idKey, classKey, unnumberedKey]\n    id'  = maybe mempty fromValue $\n              (lookup customIdKey properties `mplus` lookup idKey properties)\n    cls  = maybe mempty fromValue . lookup classKey    $ properties\n    kvs' = map toTextPair . filter ((`notElem` specialProperties) . fst)\n           $ properties\n    isUnnumbered =\n      maybe False isNonNil . lookup unnumberedKey $ properties\n  in\n    (id', T.words cls ++ [\"unnumbered\" | isUnnumbered], kvs')\n\ntagsToInlines :: [Tag] -> Inlines\ntagsToInlines [] = mempty\ntagsToInlines tags =\n  (B.space <>) . mconcat . intersperse (B.str \"\\160\") . map tagToInline $ tags\n where\n  tagToInline :: Tag -> Inlines\n  tagToInline t = tagSpan t . B.smallcaps . B.str $ fromTag t\n\n-- | Wrap the given inline in a span, marking it as a tag.\ntagSpan :: Tag -> Inlines -> Inlines\ntagSpan t = B.spanWith (\"\", [\"tag\"], [(\"tag-name\", fromTag t)])\n\n-- | Render planning info as a block iff the respective export setting is\n-- enabled.\nplanningToBlock :: Monad m => PlanningInfo -> OrgParser m Blocks\nplanningToBlock planning = do\n  includePlanning <- getExportSetting exportWithPlanning\n  return $\n    if includePlanning\n    then B.plain . mconcat . intersperse B.space . filter (/= mempty) $\n         [ datumInlines planningClosed \"CLOSED\"\n         , datumInlines planningDeadline \"DEADLINE\"\n         , datumInlines planningScheduled \"SCHEDULED\"\n         ]\n    else mempty\n where\n  datumInlines field name =\n    case field planning of\n      Nothing -> mempty\n      Just time ->   B.strong (B.str name <> B.str \":\")\n                  <> B.space\n                  <> B.emph (B.str time)\n\n-- | An Org timestamp, including repetition marks. TODO: improve\ntype Timestamp = Text\n\ntimestamp :: Monad m => OrgParser m Timestamp\ntimestamp = try $ do\n  openChar <- oneOf \"<[\"\n  let isActive = openChar == '<'\n  let closeChar = if isActive then '>' else ']'\n  content <- many1TillChar anyChar (char closeChar)\n  return $ T.cons openChar $ content `T.snoc` closeChar\n\n-- | Planning information for a subtree/headline.\ndata PlanningInfo = PlanningInfo\n  { planningClosed :: Maybe Timestamp\n  , planningDeadline :: Maybe Timestamp\n  , planningScheduled :: Maybe Timestamp\n  }\n\nemptyPlanning :: PlanningInfo\nemptyPlanning = PlanningInfo Nothing Nothing Nothing\n\n-- | Read a single planning-related and timestamped line.\nplanningInfo :: Monad m => OrgParser m PlanningInfo\nplanningInfo = try $ do\n  updaters <- many1 planningDatum <* skipSpaces <* newline\n  return $ foldr ($) emptyPlanning updaters\n where\n  planningDatum = skipSpaces *> choice\n    [ updateWith (\\s p -> p { planningScheduled = Just s}) \"SCHEDULED\"\n    , updateWith (\\d p -> p { planningDeadline = Just d}) \"DEADLINE\"\n    , updateWith (\\c p -> p { planningClosed = Just c}) \"CLOSED\"\n    ]\n  updateWith fn cs = fn <$> (string cs *> char ':' *> skipSpaces *> timestamp)\n\n-- | Read a :PROPERTIES: drawer and return the key/value pairs contained\n-- within.\npropertiesDrawer :: Monad m => OrgParser m Properties\npropertiesDrawer = try $ do\n  drawerType <- drawerStart\n  guard $ T.toUpper drawerType == \"PROPERTIES\"\n  manyTill property (try endOfDrawer)\n where\n   property :: Monad m => OrgParser m (PropertyKey, PropertyValue)\n   property = try $ (,) <$> key <*> value\n\n   key :: Monad m => OrgParser m PropertyKey\n   key = fmap toPropertyKey . try $\n         skipSpaces *> char ':' *>\n         many1TillChar nonspaceChar (try $ char ':' *> spaceChar)\n\n   value :: Monad m => OrgParser m PropertyValue\n   value = fmap toPropertyValue . try $\n           skipSpaces *> manyTillChar anyChar (try $ skipSpaces *> newline)\n\n   endOfDrawer :: Monad m => OrgParser m Text\n   endOfDrawer = try $\n     skipSpaces *> stringAnyCase \":END:\" <* skipSpaces <* newline\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/ExportSettings.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.ExportSettings\n   Copyright   : © 2016-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nParsers for Org-mode export options.\n-}\nmodule Text.Pandoc.Readers.Org.ExportSettings\n  ( exportSettings\n  ) where\n\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Logging (LogMessage (UnknownOrgExportOption))\nimport Text.Pandoc.Readers.Org.ParserState\nimport Text.Pandoc.Readers.Org.Parsing\n\nimport Control.Monad (mzero, void)\nimport Data.Char (toLower)\nimport Data.Maybe (listToMaybe)\nimport Data.Text (Text, unpack)\n\n-- | Read and handle space separated org-mode export settings.\nexportSettings :: PandocMonad m => OrgParser m ()\nexportSettings = void $ sepBy skipSpaces exportSetting\n\n-- | Setter function for export settings.\ntype ExportSettingSetter a = a -> ExportSettings -> ExportSettings\n\n-- | Read and process a single org-mode export option.\nexportSetting :: PandocMonad m => OrgParser m ()\nexportSetting = choice\n  [ booleanSetting \"^\" (\\val es -> es { exportSubSuperscripts = val })\n  , booleanSetting \"'\" (\\val es -> es { exportSmartQuotes = val })\n  , booleanSetting \"*\" (\\val es -> es { exportEmphasizedText = val })\n  , booleanSetting \"-\" (\\val es -> es { exportSpecialStrings = val })\n  , ignoredSetting \":\"\n  , ignoredSetting \"<\"\n  , booleanSetting \"\\\\n\" (\\val es -> es { exportPreserveBreaks = val })\n  , archivedTreeSetting \"arch\" (\\val es -> es { exportArchivedTrees = val })\n  , booleanSetting \"author\" (\\val es -> es { exportWithAuthor = val })\n  , ignoredSetting \"c\"\n  -- org-mode allows the special value `comment` for creator, which we'll\n  -- interpret as true as it doesn't make sense in the context of Pandoc.\n  , booleanSetting \"creator\" (\\val es -> es { exportWithCreator = val })\n  , complementableListSetting \"d\" (\\val es -> es { exportDrawers = val })\n  , ignoredSetting \"date\"\n  , booleanSetting \"e\" (\\val es -> es { exportWithEntities = val })\n  , booleanSetting \"email\" (\\val es -> es { exportWithEmail = val })\n  , booleanSetting \"f\" (\\val es -> es { exportWithFootnotes = val })\n  , integerSetting \"H\" (\\val es -> es { exportHeadlineLevels = val })\n  , ignoredSetting \"inline\"\n  , ignoredSetting \"num\"\n  , booleanSetting \"p\" (\\val es -> es { exportWithPlanning = val })\n  , ignoredSetting \"pri\"\n  , ignoredSetting \"prop\"\n  , ignoredSetting \"stat\"\n  , booleanSetting \"tags\" (\\val es -> es { exportWithTags = val })\n  , ignoredSetting \"tasks\"\n  , texSetting     \"tex\" (\\val es -> es { exportWithLatex = val })\n  , ignoredSetting \"timestamp\"\n  , ignoredSetting \"title\"\n  , ignoredSetting \"toc\"\n  , booleanSetting \"todo\" (\\val es -> es { exportWithTodoKeywords = val })\n  , booleanSetting \"|\" (\\val es -> es { exportWithTables = val })\n  , ignoreAndWarn\n  ] <?> \"export setting\"\n\n-- | Generic handler for export settings. Takes a parser which converts\n-- the plain option text into a data structure.\ngenericExportSetting :: Monad m\n                     => OrgParser m a\n                     -> Text\n                     -> ExportSettingSetter a\n                     -> OrgParser m ()\ngenericExportSetting optionParser settingIdentifier setter = try $ do\n  _     <- textStr settingIdentifier *> char ':'\n  value <- optionParser\n  updateState $ modifyExportSettings value\n where\n   modifyExportSettings val st =\n     st { orgStateExportSettings = setter val . orgStateExportSettings $ st }\n\n-- | A boolean option, either nil (False) or non-nil (True).\nbooleanSetting :: Monad m => Text ->  ExportSettingSetter Bool -> OrgParser m ()\nbooleanSetting = genericExportSetting elispBoolean\n\n-- | An integer-valued option.\nintegerSetting :: Monad m => Text -> ExportSettingSetter Int -> OrgParser m ()\nintegerSetting = genericExportSetting parseInt\n where\n   parseInt = try $\n     many1 digit >>= maybe mzero (return . fst) . listToMaybe . reads\n\n-- | Either the string \"headline\" or an elisp boolean and treated as an\n-- @ArchivedTreesOption@.\narchivedTreeSetting :: Monad m\n                    => Text\n                    -> ExportSettingSetter ArchivedTreesOption\n                    -> OrgParser m ()\narchivedTreeSetting =\n  genericExportSetting $ archivedTreesHeadlineSetting <|> archivedTreesBoolean\n where\n   archivedTreesHeadlineSetting =\n     ArchivedTreesHeadlineOnly <$ optionString \"headline\"\n\n   archivedTreesBoolean = try $ do\n     exportBool <- elispBoolean\n     return $\n       if exportBool\n       then ArchivedTreesExport\n       else ArchivedTreesNoExport\n\n-- | A list or a complement list (i.e. a list starting with `not`).\ncomplementableListSetting :: Monad m\n                          => Text\n                          -> ExportSettingSetter (Either [Text] [Text])\n                          -> OrgParser m ()\ncomplementableListSetting = genericExportSetting $ choice\n  [ Left  <$> complementTextList\n  , Right <$> stringList\n  , (\\b -> if b then Left [] else Right []) <$> elispBoolean\n  ]\n where\n   -- Read a plain list of strings.\n   stringList :: Monad m => OrgParser m [Text]\n   stringList = try $\n     char '('\n       *> sepBy elispText spaces\n       <* char ')'\n\n   -- Read an emacs lisp list specifying a complement set.\n   complementTextList :: Monad m => OrgParser m [Text]\n   complementTextList = try $\n     string \"(not \"\n       *> sepBy elispText spaces\n       <* char ')'\n\n   elispText :: Monad m => OrgParser m Text\n   elispText = try $\n     char '\"'\n       *> manyTillChar alphaNum (char '\"')\n\n-- | Parses either @t@, @nil@, or @verbatim@ into a 'TeXExport' value.\ntexSetting :: Monad m\n           => Text\n           -> ExportSettingSetter TeXExport\n           -> OrgParser m ()\ntexSetting = genericExportSetting $ texVerbatim <|> texBoolean\n where\n   texVerbatim = TeXVerbatim <$ optionString \"verbatim\"\n\n   texBoolean = try $ do\n     exportBool <- elispBoolean\n     return $\n       if exportBool\n       then TeXExport\n       else TeXIgnore\n\n-- | Read but ignore the export setting.\nignoredSetting :: Monad m => Text -> OrgParser m ()\nignoredSetting s = try (() <$ textStr s <* char ':' <* many1 nonspaceChar)\n\n-- | Read any setting string, but ignore it and emit a warning.\nignoreAndWarn :: PandocMonad m => OrgParser m ()\nignoreAndWarn = try $ do\n  opt <- many1Char nonspaceChar\n  report (UnknownOrgExportOption opt)\n  return ()\n\n-- | Read an elisp boolean.  Only NIL is treated as false, non-NIL values are\n-- interpreted as true.\nelispBoolean :: Monad m => OrgParser m Bool\nelispBoolean = try $ do\n  value <- many1 nonspaceChar\n  return $ case map toLower value of\n             \"nil\" -> False\n             \"{}\"  -> False\n             \"()\"  -> False\n             _     -> True\n\n-- | Try to parse a literal string as the option value. Returns the\n-- string on success.\noptionString :: Monad m => Text -> OrgParser m Text\noptionString s = try $ do\n  _ <- string (unpack s)\n  lookAhead (newline <|> spaceChar)\n  return s\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/Inlines.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.Inlines\n   Copyright   : Copyright (C) 2014-2025 Albert Krewinkel\n   License     : GPL-2.0-or-later\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nParsers for Org-mode inline elements.\n-}\nmodule Text.Pandoc.Readers.Org.Inlines\n  ( inline\n  , inlines\n  , addToNotesTable\n  , linkTarget\n  ) where\n\nimport Text.Pandoc.Readers.Org.BlockStarts (endOfBlock, noteMarker)\nimport Text.Pandoc.Readers.Org.ParserState\nimport Text.Pandoc.Readers.Org.Parsing\nimport Text.Pandoc.Readers.Org.Shared (cleanLinkText, isImageFilename,\n                                       originalLang, translateLang, exportsCode)\n\nimport Text.Pandoc.Builder (Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)\nimport Text.TeXMath (DisplayType (..), readTeX, writePandoc)\nimport Text.Pandoc.Sources (ToSources(..))\nimport qualified Text.TeXMath.Readers.MathML.EntityMap as MathMLEntityMap\nimport Safe (lastMay)\nimport Control.Monad (guard, mplus, mzero, unless, when, void)\nimport Control.Monad.Trans (lift)\nimport Data.Char (isAlphaNum, isSpace)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\n\n--\n-- Functions acting on the parser state\n--\npushToInlineCharStack :: PandocMonad m => Char -> OrgParser m ()\npushToInlineCharStack c = updateState $ \\s ->\n  s{ orgStateEmphasisCharStack = c:orgStateEmphasisCharStack s }\n\npopInlineCharStack :: PandocMonad m => OrgParser m ()\npopInlineCharStack = updateState $ \\s ->\n  s{ orgStateEmphasisCharStack = drop 1 . orgStateEmphasisCharStack $ s }\n\nsurroundingEmphasisChar :: PandocMonad m => OrgParser m [Char]\nsurroundingEmphasisChar =\n  take 1 . drop 1 . orgStateEmphasisCharStack <$> getState\n\nstartEmphasisNewlinesCounting :: PandocMonad m => Int -> OrgParser m ()\nstartEmphasisNewlinesCounting maxNewlines = updateState $ \\s ->\n  s{ orgStateEmphasisNewlines = Just maxNewlines }\n\ndecEmphasisNewlinesCount :: PandocMonad m => OrgParser m ()\ndecEmphasisNewlinesCount = updateState $ \\s ->\n  s{ orgStateEmphasisNewlines = (\\n -> n - 1) <$> orgStateEmphasisNewlines s }\n\nnewlinesCountWithinLimits :: PandocMonad m => OrgParser m Bool\nnewlinesCountWithinLimits = do\n  st <- getState\n  return $ ((< 0) <$> orgStateEmphasisNewlines st) /= Just True\n\nresetEmphasisNewlines :: PandocMonad m => OrgParser m ()\nresetEmphasisNewlines = updateState $ \\s ->\n  s{ orgStateEmphasisNewlines = Nothing }\n\naddToNotesTable :: PandocMonad m => OrgNoteRecord -> OrgParser m ()\naddToNotesTable note = do\n  oldnotes <- orgStateNotes' <$> getState\n  updateState $ \\s -> s{ orgStateNotes' = note:oldnotes }\n\n-- | Parse a single Org-mode inline element\ninline :: PandocMonad m => OrgParser m (F Inlines)\ninline =\n  choice [ whitespace\n         , linebreak\n         , cite\n         , footnote\n         , linkOrImage\n         , anchor\n         , inlineCodeBlock\n         , str\n         , endline\n         , subscript   -- takes precedence over underlined text\n         , superscript\n         , emphasizedText\n         , code\n         , math\n         , displayMath\n         , verbatim\n         , inlineLaTeX\n         , exportSnippet\n         , macro\n         , smartQuotes\n         , specialStrings\n         , symbol\n         ] <* (guard =<< newlinesCountWithinLimits)\n  <?> \"inline\"\n\n-- | Read the rest of the input as inlines.\ninlines :: PandocMonad m => OrgParser m (F Inlines)\ninlines = trimInlinesF . mconcat <$> many1 inline\n\n-- treat these as potentially non-text when parsing inline:\nspecialChars :: [Char]\nspecialChars = \"\\\"$'()*+-,./:;<=>@[\\\\]^_{|}~\"\n\n\nwhitespace :: PandocMonad m => OrgParser m (F Inlines)\nwhitespace = pure B.space <$ skipMany1 spaceChar\n                          <* updateLastPreCharPos\n                          <* updateLastForbiddenCharPos\n             <?> \"whitespace\"\n\nlinebreak :: PandocMonad m => OrgParser m (F Inlines)\nlinebreak = try $ pure B.linebreak <$ string \"\\\\\\\\\" <* skipSpaces <* newline\n\nstr :: PandocMonad m => OrgParser m (F Inlines)\nstr = return . B.str <$>\n      ( many1Char (noneOf $ specialChars ++ \"\\n\\r \") >>= updatePositions' )\n      <* updateLastStrPos\n  where\n    updatePositions' str' = str' <$\n      maybe mzero (updatePositions . snd) (T.unsnoc str')\n\n-- | An endline character that can be treated as a space, not a structural\n-- break.  This should reflect the values of the Emacs variable\n-- @org-element-pagaraph-separate@.\nendline :: PandocMonad m => OrgParser m (F Inlines)\nendline = try $ do\n  newline\n  notFollowedBy' endOfBlock\n  decEmphasisNewlinesCount\n  guard =<< newlinesCountWithinLimits\n  updateLastPreCharPos\n  useHardBreaks <- exportPreserveBreaks . orgStateExportSettings <$> getState\n  returnF (if useHardBreaks then B.linebreak else B.softbreak)\n\n\n--\n-- Citations\n--\n\n-- We first try to parse official org-cite citations, then fall\n-- back to org-ref citations (which are still in wide use).\n\n-- | A citation in org-cite style\norgCite :: PandocMonad m => OrgParser m (F [Citation])\norgCite = try $ do\n  string \"[cite\"\n  (sty, _variants) <- citeStyle\n  char ':'\n  spnl\n  globalPref <- option mempty (try (citePrefix <* char ';'))\n  items <- citeItems\n  globalSuff <- option mempty (try (char ';' *> citeSuffix))\n  spnl\n  char ']'\n  return $ adjustCiteStyle sty .\n           addPrefixToFirstItem globalPref .\n           addSuffixToLastItem globalSuff $ items\n\nadjustCiteStyle :: CiteStyle -> (F [Citation]) -> (F [Citation])\nadjustCiteStyle sty cs = do\n  cs' <- cs\n  case cs' of\n    [] -> return []\n    (d:ds)  -- TODO needs refinement\n      -> case sty of\n         TextStyle -> return $ d{ citationMode = AuthorInText\n                                , citationSuffix = dropWhile (== Space)\n                                    (citationSuffix d)} : ds\n         NoAuthorStyle -> return $ d{ citationMode = SuppressAuthor } : ds\n         _ -> return (d:ds)\n\naddPrefixToFirstItem :: (F Inlines) -> (F [Citation]) -> (F [Citation])\naddPrefixToFirstItem aff cs = do\n  cs' <- cs\n  aff' <- aff\n  case cs' of\n    [] -> return []\n    (d:ds) -> return (d{ citationPrefix =\n                          B.toList aff' <> citationPrefix d }:ds)\n\naddSuffixToLastItem :: (F Inlines) -> (F [Citation]) -> (F [Citation])\naddSuffixToLastItem aff cs = do\n  cs' <- cs\n  aff' <- aff\n  case lastMay cs' of\n    Nothing -> return cs'\n    Just d  ->\n      return (init cs' ++ [d{ citationSuffix =\n                                citationSuffix d <> B.toList aff' }])\n\nciteItems :: PandocMonad m => OrgParser m (F [Citation])\nciteItems = sequence <$> sepBy1' citeItem (char ';' <* void (many spaceChar))\n\nciteItem :: PandocMonad m => OrgParser m (F Citation)\nciteItem = try $ do\n  pref <- citePrefix\n  itemKey <- orgCiteKey\n  suff <- citeSuffix\n  return $ do\n    pre' <- pref\n    suf' <- suff\n    return Citation\n      { citationId      = itemKey\n      , citationPrefix  = B.toList pre'\n      , citationSuffix  = B.toList suf'\n      , citationMode    = NormalCitation\n      , citationNoteNum = 0\n      , citationHash    = 0\n      }\n\norgCiteKey :: PandocMonad m => OrgParser m Text\norgCiteKey = do\n  char '@'\n  T.pack <$> many1 (satisfy orgCiteKeyChar)\n\norgCiteKeyChar :: Char -> Bool\norgCiteKeyChar c =\n  isAlphaNum c || c `elem` ['.',':','?','!','`','\\'','/','*','@','+','|',\n                            '(',')','{','}','<','>','&','_','^','$','#',\n                            '%','~','-']\n\nrawAffix :: PandocMonad m => Bool -> OrgParser m Text\nrawAffix isPrefix = snd <$> withRaw\n  (many\n   (affixChar\n     <|>\n     try (void (char '[' >> rawAffix isPrefix >> char ']'))))\n where\n   affixChar = void $ satisfy $ \\c ->\n     not (c == '^' || c == ';' || c == '[' || c == ']') &&\n     (not isPrefix || c /= '@')\n\ncitePrefix :: PandocMonad m => OrgParser m (F Inlines)\ncitePrefix =\n  rawAffix True >>= parseFromString (trimInlinesF . mconcat <$> many inline)\n\nciteSuffix :: PandocMonad m => OrgParser m (F Inlines)\nciteSuffix =\n  rawAffix False >>= parseFromString (mconcat <$> many inline)\n\nciteStyle :: PandocMonad m => OrgParser m (CiteStyle, [CiteVariant])\nciteStyle = do\n  sty <- option NilStyle $ try $ char '/' *> orgCiteStyle\n  variants <- option [] $ try $ char '/' *> orgCiteVariants\n  return (sty, variants)\n\norgCiteStyle :: PandocMonad m => OrgParser m CiteStyle\norgCiteStyle = try $ do\n  s <- many1 letter\n  case s of\n    \"author\" -> pure AuthorStyle\n    \"a\" -> pure AuthorStyle\n    \"noauthor\" -> pure NoAuthorStyle\n    \"na\" -> pure NoAuthorStyle\n    \"nocite\" -> pure NociteStyle\n    \"n\" -> pure NociteStyle\n    \"text\" -> pure TextStyle\n    \"t\" -> pure TextStyle\n    \"note\" -> pure NoteStyle\n    \"ft\" -> pure NoteStyle\n    \"numeric\" -> pure NumericStyle\n    \"nb\" -> pure NumericStyle\n    \"nil\" -> pure NilStyle\n    _ -> fail $ \"Unknown org cite style \" <> show s\n\norgCiteVariants :: PandocMonad m => OrgParser m [CiteVariant]\norgCiteVariants =\n  (sepBy1' fullnameVariant (char '-')) <|> (many1 onecharVariant)\n where\n  fullnameVariant = choice $ map try\n     [ Bare <$ string \"bare\"\n     , Caps <$ string \"caps\"\n     , Full <$ string \"full\"\n     ]\n  onecharVariant = choice\n     [ Bare <$ char 'b'\n     , Caps <$ char 'c'\n     , Full <$ char 'f'\n     ]\n\ndata CiteStyle =\n    AuthorStyle\n  | NoAuthorStyle\n  | LocatorsStyle\n  | NociteStyle\n  | TextStyle\n  | NoteStyle\n  | NumericStyle\n  | NilStyle\n  deriving Show\n\ndata CiteVariant =\n    Caps\n  | Bare\n  | Full\n  deriving Show\n\n\nspnl :: PandocMonad m => OrgParser m ()\nspnl =\n  skipSpaces *> optional (newline *> notFollowedBy blankline *> skipSpaces)\n\ncite :: PandocMonad m => OrgParser m (F Inlines)\ncite = do\n  guardEnabled Ext_citations\n  (cs, raw) <- withRaw $ try $ choice\n               [ orgCite\n               , orgRefCite\n               ]\n  return $ flip B.cite (B.text raw) <$> cs\n\n-- org-ref\n\norgRefCite :: PandocMonad m => OrgParser m (F [Citation])\norgRefCite = try $ choice\n  [ normalOrgRefCite\n  , fmap (:[]) <$> linkLikeOrgRefCite\n  ]\n\nnormalOrgRefCite :: PandocMonad m => OrgParser m (F [Citation])\nnormalOrgRefCite = try $ do\n  mode <- orgRefCiteMode\n  firstCitation <- orgRefCiteList mode\n  moreCitations <- many (try $ char ',' *> orgRefCiteList mode)\n  return . sequence $ firstCitation : moreCitations\n where\n  -- A list of org-ref style citation keys, parsed as citation of the given\n  -- citation mode.\n  orgRefCiteList :: PandocMonad m => CitationMode -> OrgParser m (F Citation)\n  orgRefCiteList citeMode = try $ do\n    key <- orgRefCiteKey\n    returnF Citation\n     { citationId      = key\n     , citationPrefix  = mempty\n     , citationSuffix  = mempty\n     , citationMode    = citeMode\n     , citationNoteNum = 0\n     , citationHash    = 0\n     }\n\n-- | Read a link-like org-ref style citation.  The citation includes pre and\n-- post text.  However, multiple citations are not possible due to limitations\n-- in the syntax.\nlinkLikeOrgRefCite :: PandocMonad m => OrgParser m (F Citation)\nlinkLikeOrgRefCite = try $ do\n  _    <- string \"[[\"\n  mode <- orgRefCiteMode\n  key  <- orgRefCiteKey\n  _    <- string \"][\"\n  pre  <- trimInlinesF . mconcat <$> manyTill inline (try $ string \"::\")\n  spc  <- option False (True <$ spaceChar)\n  suf  <- trimInlinesF . mconcat <$> manyTill inline (try $ string \"]]\")\n  return $ do\n    pre' <- pre\n    suf' <- suf\n    return Citation\n      { citationId      = key\n      , citationPrefix  = B.toList pre'\n      , citationSuffix  = B.toList (if spc then B.space <> suf' else suf')\n      , citationMode    = mode\n      , citationNoteNum = 0\n      , citationHash    = 0\n      }\n\n-- | Read a citation key.  The characters allowed in citation keys are taken\n-- from the `org-ref-cite-re` variable in `org-ref.el`.\norgRefCiteKey :: PandocMonad m => OrgParser m Text\norgRefCiteKey =\n  let citeKeySpecialChars = \"-_:\\\\./\" :: String\n      isCiteKeySpecialChar c = c `elem` citeKeySpecialChars\n      isCiteKeyChar c = isAlphaNum c || isCiteKeySpecialChar c\n      endOfCitation = try $ do\n        many $ satisfy isCiteKeySpecialChar\n        satisfy $ not . isCiteKeyChar\n  in try $ do\n        optional (char '&') -- this is used in org-ref v3\n        satisfy isCiteKeyChar `many1TillChar` lookAhead endOfCitation\n\n-- | Supported citation types.  Only a small subset of org-ref types is\n-- supported for now.  TODO: rewrite this, use LaTeX reader as template.\norgRefCiteMode :: PandocMonad m => OrgParser m CitationMode\norgRefCiteMode =\n  choice $ map (\\(s, mode) -> mode <$ try (string s <* char ':'))\n    [ (\"cite\", AuthorInText)\n    , (\"citep\", NormalCitation)\n    , (\"citep*\", NormalCitation)\n    , (\"citet\", AuthorInText)\n    , (\"citet*\", AuthorInText)\n    , (\"citeyear\", SuppressAuthor)\n    ]\n\nfootnote :: PandocMonad m => OrgParser m (F Inlines)\nfootnote = try $ do\n  note <- inlineNote <|> referencedNote\n  withNote <- getExportSetting exportWithFootnotes\n  return $ if withNote then note else mempty\n\ninlineNote :: PandocMonad m => OrgParser m (F Inlines)\ninlineNote = try $ do\n  string \"[fn:\"\n  ref <- manyChar alphaNum\n  char ':'\n  note <- fmap B.para . trimInlinesF . mconcat <$> many1Till inline (char ']')\n  unless (T.null ref) $\n       addToNotesTable (\"fn:\" <> ref, note)\n  return $ B.note <$> note\n\nreferencedNote :: PandocMonad m => OrgParser m (F Inlines)\nreferencedNote = try $ do\n  ref <- noteMarker\n  return $ do\n    notes <- asksF orgStateNotes'\n    case lookup ref notes of\n      Nothing   -> return . B.str $ \"[\" <> ref <> \"]\"\n      Just contents  -> do\n        st <- askF\n        let contents' = runF contents st{ orgStateNotes' = [] }\n        return $ B.note contents'\n\nlinkOrImage :: PandocMonad m => OrgParser m (F Inlines)\nlinkOrImage = explicitOrImageLink\n              <|> selflinkOrImage\n              <|> angleLink\n              <|> plainLink\n              <?> \"link or image\"\n\nexplicitOrImageLink :: PandocMonad m => OrgParser m (F Inlines)\nexplicitOrImageLink = try $ do\n  char '['\n  srcF   <- applyCustomLinkFormat =<< possiblyEmptyLinkTarget\n  descr  <- enclosedRaw (char '[') (char ']')\n  titleF <- parseFromString (mconcat <$> many inline) descr\n  char ']'\n  return $ do\n    src <- srcF\n    title <- titleF\n    case cleanLinkText descr of\n      Just imgSrc | isImageFilename imgSrc ->\n        return . B.link src \"\" $ B.image imgSrc mempty mempty\n      _ ->\n        linkToInlinesF src title\n\nselflinkOrImage :: PandocMonad m => OrgParser m (F Inlines)\nselflinkOrImage = try $ do\n  target <- char '[' *> linkTarget <* char ']'\n  case cleanLinkText target of\n    Nothing        -> case T.uncons target of\n                        Just ('#', _) -> returnF $ B.link target \"\" (B.str target)\n                        _             -> return $ internalLink target (B.str target)\n    Just nonDocTgt -> if isImageFilename nonDocTgt\n                      then returnF $ B.image nonDocTgt \"\" \"\"\n                      else returnF $ B.link nonDocTgt \"\" (B.str target)\n\nplainLink :: PandocMonad m => OrgParser m (F Inlines)\nplainLink = try $ do\n  (orig, src) <- uri\n  returnF $ B.link src \"\" (B.str orig)\n\nangleLink :: PandocMonad m => OrgParser m (F Inlines)\nangleLink = try $ do\n  char '<'\n  link <- plainLink\n  char '>'\n  return link\n\nlinkTarget :: PandocMonad m => OrgParser m Text\nlinkTarget = T.pack <$> enclosedByPair1 '[' ']' (noneOf \"\\n\\r[]\")\n\npossiblyEmptyLinkTarget :: PandocMonad m => OrgParser m Text\npossiblyEmptyLinkTarget = try linkTarget <|> (\"\" <$ string \"[]\")\n\napplyCustomLinkFormat :: Text -> OrgParser m (F Text)\napplyCustomLinkFormat link = do\n  let (linkType, rest) = T.break (== ':') link\n  return $ do\n    formatter <- M.lookup linkType <$> asksF orgStateLinkFormatters\n    return $ maybe link ($ T.drop 1 rest) formatter\n\n-- | Take a link and return a function which produces new inlines when given\n-- description inlines.\nlinkToInlinesF :: Text -> Inlines -> F Inlines\nlinkToInlinesF linkStr =\n  case T.uncons linkStr of\n    Nothing       -> pure . B.link mempty \"\"       -- wiki link (empty by convention)\n    Just ('#', _) -> pure . B.link linkStr \"\"      -- document-local fraction\n    _             -> case cleanLinkText linkStr of\n      Just extTgt -> return . B.link extTgt \"\"\n      Nothing     -> internalLink linkStr  -- other internal link\n\ninternalLink :: Text -> Inlines -> F Inlines\ninternalLink link title = do\n  ids <- asksF orgStateAnchorIds\n  if link `elem` ids\n    then return $ B.link (\"#\" <> link) \"\" title\n    else let attr' = (\"\", [\"spurious-link\"] , [(\"target\", link)])\n         in return $ B.spanWith attr' (B.emph title)\n\n-- | Parse an anchor like @<<anchor-id>>@ and return an empty span with\n-- @anchor-id@ set as id.  Legal anchors in org-mode are defined through\n-- @org-target-regexp@, which is fairly liberal.  Since no link is created if\n-- @anchor-id@ contains spaces, we are more restrictive in what is accepted as\n-- an anchor.\nanchor :: PandocMonad m => OrgParser m (F Inlines)\nanchor =  do\n  anchorId <- orgAnchor\n  returnF $ B.spanWith (solidify anchorId, [], []) mempty\n\n-- | Replace every char but [a-zA-Z0-9_.-:] with a hyphen '-'.  This mirrors\n-- the org function @org-export-solidify-link-text@.\nsolidify :: Text -> Text\nsolidify = T.map replaceSpecialChar\n where replaceSpecialChar c\n           | isAlphaNum c    = c\n           | c `elem` (\"_.-:\" :: String) = c\n           | otherwise       = '-'\n\n-- | Parses an inline code block and marks it as an babel block.\ninlineCodeBlock :: PandocMonad m => OrgParser m (F Inlines)\ninlineCodeBlock = try $ do\n  string \"src_\"\n  lang <- many1Char orgArgWordChar\n  opts <- option [] $ enclosedByPair '[' ']' inlineBlockOption\n  inlineCode <- T.pack <$> enclosedByPair1 '{' '}' (noneOf \"\\n\\r\")\n  let attrClasses = [translateLang lang]\n  let attrKeyVal  = originalLang lang <> opts\n  let codeInlineBlck = B.codeWith (\"\", attrClasses, attrKeyVal) inlineCode\n  returnF $ if exportsCode opts then codeInlineBlck else mempty\n where\n   inlineBlockOption :: PandocMonad m => OrgParser m (Text, Text)\n   inlineBlockOption = try $ do\n     argKey <- orgArgKey\n     paramValue <- option \"yes\" orgInlineParamValue\n     return (argKey, paramValue)\n\n   orgInlineParamValue :: PandocMonad m => OrgParser m Text\n   orgInlineParamValue = try $\n     skipSpaces\n       *> notFollowedBy (char ':')\n       *> many1Char (noneOf \"\\t\\n\\r ]\")\n       <* skipSpaces\n\n\nemphasizedText :: PandocMonad m => OrgParser m (F Inlines)\nemphasizedText = do\n  state <- getState\n  guard . exportEmphasizedText . orgStateExportSettings $ state\n  try $ choice\n    [ emph\n    , strong\n    , strikeout\n    , underline\n    ]\n\nenclosedByPair :: PandocMonad m\n               => Char          -- ^ opening char\n               -> Char          -- ^ closing char\n               -> OrgParser m a   -- ^ parser\n               -> OrgParser m [a]\nenclosedByPair s e p = char s *> manyTill p (char e)\n\nenclosedByPair1 :: PandocMonad m\n               => Char          -- ^ opening char\n               -> Char          -- ^ closing char\n               -> OrgParser m a   -- ^ parser\n               -> OrgParser m [a]\nenclosedByPair1 s e p = char s *> many1Till p (char e)\n\nemph      :: PandocMonad m => OrgParser m (F Inlines)\nemph      = fmap B.emph         <$> emphasisBetween '/'\n\nstrong    :: PandocMonad m => OrgParser m (F Inlines)\nstrong    = fmap B.strong       <$> emphasisBetween '*'\n\nstrikeout :: PandocMonad m => OrgParser m (F Inlines)\nstrikeout = fmap B.strikeout    <$> emphasisBetween '+'\n\nunderline :: PandocMonad m => OrgParser m (F Inlines)\nunderline = fmap B.underline    <$> emphasisBetween '_'\n\nverbatim  :: PandocMonad m => OrgParser m (F Inlines)\nverbatim  = return . B.codeWith (\"\", [\"verbatim\"], []) <$> verbatimBetween '='\n\ncode      :: PandocMonad m => OrgParser m (F Inlines)\ncode      = return . B.code     <$> verbatimBetween '~'\n\n-- | Returns 'True' if the parser position right after a string, and 'False'\n-- otherwise.\nisAfterString :: PandocMonad m => OrgParser m Bool\nisAfterString = do\n  pos <- getPosition\n  st  <- getState\n  pure $ getLastStrPos st == Just pos\n\n-- | Parses subscript markup. Subscripts must be preceded by a string.\nsubscript   :: PandocMonad m => OrgParser m (F Inlines)\nsubscript   = do\n  guard =<< isAfterString\n  fmap B.subscript   <$> try (char '_' *> subOrSuperExpr)\n\n-- | Parses superscript markup. Superscript must be preceded by a string.\nsuperscript :: PandocMonad m => OrgParser m (F Inlines)\nsuperscript = do\n  guard =<< isAfterString\n  fmap B.superscript <$> try (char '^' *> subOrSuperExpr)\n\nmath      :: PandocMonad m => OrgParser m (F Inlines)\nmath      = return . B.math      <$> choice [ math1CharBetween '$'\n                                            , mathTextBetween '$'\n                                            , rawMathBetween \"\\\\(\" \"\\\\)\"\n                                            ]\n\ndisplayMath :: PandocMonad m => OrgParser m (F Inlines)\ndisplayMath = return . B.displayMath <$> choice [ rawMathBetween \"\\\\[\" \"\\\\]\"\n                                                , rawMathBetween \"$$\"  \"$$\"\n                                                ]\n\nupdatePositions :: PandocMonad m\n                => Char\n                -> OrgParser m Char\nupdatePositions c = do\n  st <- getState\n  let emphasisPreChars = orgStateEmphasisPreChars st\n  when (c `elem` emphasisPreChars) updateLastPreCharPos\n  when (c `elem` emphasisForbiddenBorderChars) updateLastForbiddenCharPos\n  return c\n\nsymbol :: PandocMonad m => OrgParser m (F Inlines)\nsymbol = return . B.str . T.singleton <$> (oneOf specialChars >>= updatePositions)\n\nemphasisBetween :: PandocMonad m\n                => Char\n                -> OrgParser m (F Inlines)\nemphasisBetween c = try $ do\n  startEmphasisNewlinesCounting emphasisAllowedNewlines\n  res <- enclosedInlines (emphasisStart c) (emphasisEnd c)\n  isTopLevelEmphasis <- null . orgStateEmphasisCharStack <$> getState\n  when isTopLevelEmphasis\n       resetEmphasisNewlines\n  return res\n\nverbatimBetween :: PandocMonad m\n                => Char\n                -> OrgParser m Text\nverbatimBetween c = newlinesToSpaces <$>\n  try (emphasisStart c *> many1TillNOrLessNewlines 1 verbatimChar (emphasisEnd c))\n where\n   verbatimChar = noneOf \"\\n\\r\" >>= updatePositions\n   newlinesToSpaces = T.map (\\d -> if d == '\\n' then ' ' else d)\n\n-- | Parses a raw string delimited by @c@ using Org's math rules\nmathTextBetween :: PandocMonad m\n                  => Char\n                  -> OrgParser m Text\nmathTextBetween c = try $ do\n  mathStart c\n  body <- many1TillNOrLessNewlines mathAllowedNewlines\n                                   (noneOf (c:\"\\n\\r\"))\n                                   (lookAhead $ mathEnd c)\n  final <- mathEnd c\n  return $ T.snoc body final\n\n-- | Parse a single character between @c@ using math rules\nmath1CharBetween :: PandocMonad m\n                 => Char\n                -> OrgParser m Text\nmath1CharBetween c = try $ do\n  char c\n  res <- noneOf $ c:mathForbiddenBorderChars\n  char c\n  eof <|> () <$ lookAhead (oneOf mathPostChars)\n  return $ T.singleton res\n\nrawMathBetween :: PandocMonad m\n               => Text\n               -> Text\n               -> OrgParser m Text\nrawMathBetween s e = try $ textStr s *> manyTillChar anyChar (try $ textStr e)\n\n-- | Parses the start (opening character) of emphasis\nemphasisStart :: PandocMonad m => Char -> OrgParser m Char\nemphasisStart c = try $ do\n  guard =<< afterEmphasisPreChar\n  char c\n  lookAhead (noneOf emphasisForbiddenBorderChars)\n  pushToInlineCharStack c\n  -- nested inlines are allowed, so mark this position as one which might be\n  -- followed by another inline.\n  updateLastPreCharPos\n  return c\n\n-- | Parses the closing character of emphasis\nemphasisEnd :: PandocMonad m => Char -> OrgParser m Char\nemphasisEnd c = try $ do\n  guard =<< notAfterForbiddenBorderChar\n  char c\n  eof <|> () <$ lookAhead acceptablePostChars\n  updateLastStrPos\n  popInlineCharStack\n  return c\n where\n  acceptablePostChars = do\n    emphasisPostChars <- orgStateEmphasisPostChars <$> getState\n    surroundingEmphasisChar >>= \\x -> oneOf (x ++ emphasisPostChars)\n\nmathStart :: PandocMonad m => Char -> OrgParser m Char\nmathStart c = try $\n  char c <* notFollowedBy' (oneOf (c:mathForbiddenBorderChars))\n\nmathEnd :: PandocMonad m => Char -> OrgParser m Char\nmathEnd c = try $ do\n  res <- noneOf (c:mathForbiddenBorderChars)\n  char c\n  eof <|> () <$ lookAhead (oneOf mathPostChars)\n  return res\n\n\nenclosedInlines :: (PandocMonad m, Show b) => OrgParser m a\n                -> OrgParser m b\n                -> OrgParser m (F Inlines)\nenclosedInlines start end = try $\n  trimInlinesF . mconcat <$> enclosed start end inline\n\nenclosedRaw :: (PandocMonad m, Show b) => OrgParser m a\n            -> OrgParser m b\n            -> OrgParser m Text\nenclosedRaw start end = try $\n  start *> (onSingleLine <|> spanningTwoLines)\n where onSingleLine = try $ many1TillChar (noneOf \"\\n\\r\") end\n       spanningTwoLines = try $\n         anyLine >>= \\f -> mappend (f <> \" \") <$> onSingleLine\n\n-- | Like many1Till, but parses at most @n+1@ lines.  @p@ must not consume\n--   newlines.\nmany1TillNOrLessNewlines :: PandocMonad m => Int\n                         -> OrgParser m Char\n                         -> OrgParser m a\n                         -> OrgParser m Text\nmany1TillNOrLessNewlines n p end = try $\n  nMoreLines (Just n) mempty >>= oneOrMore\n where\n   nMoreLines Nothing  cs = return cs\n   nMoreLines (Just 0) cs = try $ (cs ++) <$> finalLine\n   nMoreLines k        cs = try $ (final k cs <|> rest k cs)\n                                  >>= uncurry nMoreLines\n   final _ cs = (\\x -> (Nothing,      cs ++ x)) <$> try finalLine\n   rest  m cs = (\\x -> (minus1 <$> m, cs ++ x ++ \"\\n\")) <$> try (manyTill p newline)\n   finalLine = try $ manyTill p end\n   minus1 k = k - 1\n   oneOrMore cs = T.pack cs <$ guard (not $ null cs)\n\n-- Org allows customization of the way it reads emphasis.  We use the defaults\n-- here (see, e.g., the Emacs Lisp variable `org-emphasis-regexp-components`\n-- for details).\n\n-- | Chars not allowed at the (inner) border of emphasis\nemphasisForbiddenBorderChars :: [Char]\nemphasisForbiddenBorderChars = \"\\t\\n\\r \\x200B\"\n\n-- | The maximum number of newlines within\nemphasisAllowedNewlines :: Int\nemphasisAllowedNewlines = 1\n\n-- LaTeX-style math: see `org-latex-regexps` for details\n\n-- | Chars allowed after an inline ($...$) math statement\nmathPostChars :: [Char]\nmathPostChars = \"\\t\\n \\\"'),-.:;?\"\n\n-- | Chars not allowed at the (inner) border of math\nmathForbiddenBorderChars :: [Char]\nmathForbiddenBorderChars = \"\\t\\n\\r ,;.$\"\n\n-- | Maximum number of newlines in an inline math statement\nmathAllowedNewlines :: Int\nmathAllowedNewlines = 2\n\n-- | Whether we are right behind a char allowed before emphasis\nafterEmphasisPreChar :: PandocMonad m => OrgParser m Bool\nafterEmphasisPreChar = do\n  pos <- getPosition\n  lastPrePos <- orgStateLastPreCharPos <$> getState\n  return $ maybe True (== pos) lastPrePos\n\n-- | Whether the parser is right after a forbidden border char\nnotAfterForbiddenBorderChar :: PandocMonad m => OrgParser m Bool\nnotAfterForbiddenBorderChar = do\n  pos <- getPosition\n  lastFBCPos <- orgStateLastForbiddenCharPos <$> getState\n  return $ lastFBCPos /= Just pos\n\n-- | Read a sub- or superscript expression\nsubOrSuperExpr :: PandocMonad m => OrgParser m (F Inlines)\nsubOrSuperExpr = try $\n  simpleSubOrSuperText <|>\n  (choice [ charsInBalanced '{' '}' (T.singleton <$> noneOf \"\\n\\r\")\n          , enclosing ('(', ')') <$> charsInBalanced '(' ')' (T.singleton <$> noneOf \"\\n\\r\")\n          ] >>= parseFromString (mconcat <$> many inline))\n where enclosing (left, right) s = T.cons left $ T.snoc s right\n\nsimpleSubOrSuperText :: PandocMonad m => OrgParser m (F Inlines)\nsimpleSubOrSuperText = try $ do\n  state <- getState\n  guard . exportSubSuperscripts . orgStateExportSettings $ state\n  return . B.str <$>\n    choice [ textStr \"*\"\n           , mappend <$> option \"\" (T.singleton <$> oneOf \"+-\")\n                     <*> many1Char alphaNum\n           ]\n\ninlineLaTeX :: PandocMonad m => OrgParser m (F Inlines)\ninlineLaTeX = try $ do\n  cmd <- inlineLaTeXCommand\n  texOpt <- getExportSetting exportWithLatex\n  allowEntities <- getExportSetting exportWithEntities\n  ils <- parseAsInlineLaTeX cmd texOpt\n  maybe mzero returnF $\n    if \"\\\\begin{\" `T.isPrefixOf` cmd\n       then ils\n       else parseAsMathMLSym allowEntities cmd `mplus`\n            parseAsMath cmd texOpt `mplus`\n            ils\n where\n   parseAsInlineLaTeX :: PandocMonad m\n                      => Text -> TeXExport -> OrgParser m (Maybe Inlines)\n   parseAsInlineLaTeX cs = \\case\n     TeXExport -> maybeRight <$> runParserT\n                  (B.rawInline \"latex\" . snd <$> withRaw inlineCommand)\n                  state \"\" (toSources cs)\n     TeXIgnore -> return (Just mempty)\n     TeXVerbatim -> return (Just $ B.text cs)\n\n   parseAsMathMLSym :: Bool -> Text -> Maybe Inlines\n   parseAsMathMLSym allowEntities cs = do\n     -- drop initial backslash and any trailing \"{}\"\n     let clean = T.dropWhileEnd (`elem` (\"{}\" :: String)) . T.drop 1\n     -- If entities are disabled, then return the string as text, but\n     -- only if this *is* a MathML entity.\n     case B.str <$> MathMLEntityMap.getUnicode (clean cs) of\n       Just _ | not allowEntities -> Just $ B.str cs\n       x -> x\n\n   state :: ParserState\n   state = def{ stateOptions = def{ readerExtensions =\n                    enableExtension Ext_raw_tex (readerExtensions def) } }\n\n   parseAsMath :: Text -> TeXExport -> Maybe Inlines\n   parseAsMath cs = \\case\n     TeXExport -> maybeRight (readTeX cs) >>=\n                  fmap B.fromList . writePandoc DisplayInline\n     TeXIgnore -> Just mempty\n     TeXVerbatim -> Just $ B.str cs\n\nmaybeRight :: Either a b -> Maybe b\nmaybeRight = either (const Nothing) Just\n\ninlineLaTeXCommand :: PandocMonad m => OrgParser m Text\ninlineLaTeXCommand = try $ do\n  rest <- getInput\n  st <- getState\n  parsed <- (lift . lift) $ runParserT rawLaTeXInline st \"source\" rest\n  case parsed of\n    Right cs -> do\n      -- drop any trailing whitespace, those are not part of the command as\n      -- far as org mode is concerned.\n      let cmdNoSpc = T.dropWhileEnd isSpace cs\n      let len = T.length cmdNoSpc\n      count len anyChar\n      return cmdNoSpc\n    _ -> mzero\n\nexportSnippet :: PandocMonad m => OrgParser m (F Inlines)\nexportSnippet = try $ do\n  string \"@@\"\n  format <- many1TillChar (alphaNum <|> char '-') (char ':')\n  snippet <- manyTillChar anyChar (try $ string \"@@\")\n  returnF $ B.rawInline format snippet\n\nmacro :: PandocMonad m => OrgParser m (F Inlines)\nmacro = try $ do\n  recursionDepth <- orgStateMacroDepth <$> getState\n  guard $ recursionDepth < 15\n  string \"{{{\"\n  name <- manyChar alphaNum\n  args <- ([] <$ string \"}}}\")\n          <|> char '(' *> argument `sepBy` char ',' <* eoa\n  expander <- lookupMacro name <$> getState\n  case expander of\n    Nothing -> mzero\n    Just fn -> do\n      updateState $ \\s -> s { orgStateMacroDepth = recursionDepth + 1 }\n      res <- parseFromString (mconcat <$> many inline) $ fn args\n      updateState $ \\s -> s { orgStateMacroDepth = recursionDepth }\n      return res\n where\n  argument = manyChar $ notFollowedBy eoa *> (escapedComma <|> noneOf \",\")\n  escapedComma = try $ char '\\\\' *> oneOf \",\\\\\"\n  eoa = string \")}}}\"\n\nsmartQuotes :: PandocMonad m => OrgParser m (F Inlines)\nsmartQuotes = do\n  guard =<< getExportSetting exportSmartQuotes\n  choice [doubleQuoted, singleQuoted, orgApostrophe]\n  where\n    orgApostrophe = do\n      (char '\\'' <|> char '\\8217') <* updateLastPreCharPos\n                                   <* updateLastForbiddenCharPos\n      returnF (B.str \"\\x2019\")\n\nspecialStrings :: PandocMonad m => OrgParser m (F Inlines)\nspecialStrings = do\n  guard =<< getExportSetting exportSpecialStrings\n  choice [orgDash, orgEllipses, shyHyphen]\n  where\n    shyHyphen   = pure <$> (B.str \"\\173\" <$ string \"\\\\-\") <* updatePositions '-'\n    orgDash     = pure <$> dash <* updatePositions '-'\n    orgEllipses = pure <$> ellipses <* updatePositions '.'\n\nsingleQuoted :: PandocMonad m => OrgParser m (F Inlines)\nsingleQuoted = try $ do\n  singleQuoteStart\n  updatePositions '\\''\n  withQuoteContext InSingleQuote $\n    fmap B.singleQuoted . trimInlinesF . mconcat <$>\n      many1Till inline (singleQuoteEnd <* updatePositions '\\'')\n\n-- doubleQuoted will handle regular double-quoted sections, as well\n-- as dialogues with an open double-quote without a close double-quote\n-- in the same paragraph.\ndoubleQuoted :: PandocMonad m => OrgParser m (F Inlines)\ndoubleQuoted = try $ do\n  doubleQuoteStart\n  updatePositions '\"'\n  contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)\n  let doubleQuotedContent = withQuoteContext InDoubleQuote $ do\n        doubleQuoteEnd\n        updateLastForbiddenCharPos\n        return . fmap B.doubleQuoted . trimInlinesF $ contents\n  let leftQuoteAndContent = return $ pure (B.str \"\\8220\") <> contents\n  doubleQuotedContent <|> leftQuoteAndContent\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/Meta.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.Meta\n   Copyright   : Copyright (C) 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nParsers for Org-mode meta declarations.\n-}\nmodule Text.Pandoc.Readers.Org.Meta\n  ( metaExport\n  , metaKey\n  , metaLine\n  ) where\n\nimport Text.Pandoc.Readers.Org.BlockStarts\nimport Text.Pandoc.Readers.Org.ExportSettings (exportSettings)\nimport Text.Pandoc.Readers.Org.Inlines\nimport Text.Pandoc.Readers.Org.ParserState\nimport Text.Pandoc.Readers.Org.Parsing\n\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Shared (blocksToInlines, safeRead)\nimport Text.Pandoc.URI (urlEncode)\n\nimport Control.Monad (mzero, void)\nimport Data.List (intercalate, intersperse)\nimport Data.Map (Map)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\n\n-- | Returns the current meta, respecting export options.\nmetaExport :: Monad m => OrgParser m (F Meta)\nmetaExport = do\n  st <- getState\n  let settings = orgStateExportSettings st\n  return $ (if exportWithAuthor  settings then id else removeMeta \"author\")\n         . (if exportWithCreator settings then id else removeMeta \"creator\")\n         . (if exportWithEmail   settings then id else removeMeta \"email\")\n        <$> orgStateMeta st\n\nremoveMeta :: Text -> Meta -> Meta\nremoveMeta key meta' =\n  let metaMap = unMeta meta'\n  in Meta $ Map.delete key metaMap\n\n-- | Parse and handle a single line containing meta information\n-- The order, in which blocks are tried, makes sure that we're not looking at\n-- the beginning of a block, so we don't need to check for it\nmetaLine :: PandocMonad m => OrgParser m Blocks\nmetaLine = try $ mempty <$ metaLineStart <* keywordLine\n\nkeywordLine :: PandocMonad m => OrgParser m ()\nkeywordLine = try $ do\n  key   <- T.toLower <$> metaKey\n  case Map.lookup key keywordHandlers of\n    Nothing -> fail $ \"Unknown keyword: \" ++ T.unpack key\n    Just hd -> hd\n\nmetaKey :: Monad m => OrgParser m Text\nmetaKey = T.toLower <$> many1Char (noneOf \": \\n\\r\")\n                    <*  char ':'\n                    <*  skipSpaces\n\ninfix 0 ~~>\n(~~>) :: a -> b -> (a, b)\na ~~> b = (a, b)\n\nkeywordHandlers :: PandocMonad m => Map Text (OrgParser m ())\nkeywordHandlers = Map.fromList\n  [ \"author\" ~~> lineOfInlines `parseThen` collectLines \"author\"\n  , \"bibliography\" ~~> fmap pure anyLine `parseThen` collectAsList \"bibliography\"\n  , \"creator\" ~~> fmap pure anyLine `parseThen` B.setMeta \"creator\"\n  , \"date\" ~~> lineOfInlines `parseThen` B.setMeta \"date\"\n  , \"description\" ~~> lineOfInlines `parseThen` collectLines \"description\"\n  , \"email\" ~~> fmap pure anyLine `parseThen` B.setMeta \"email\"\n  , \"exclude_tags\" ~~> tagList >>= updateState . setExcludedTags\n  , \"header-includes\" ~~>\n    lineOfInlines `parseThen` collectLines \"header-includes\"\n  -- HTML-specifix export settings\n  , \"html_head\" ~~>\n    metaExportSnippet \"html\" `parseThen` collectAsList \"header-includes\"\n  , \"html_head_extra\" ~~>\n    metaExportSnippet \"html\" `parseThen` collectAsList \"header-includes\"\n  , \"institute\" ~~> lineOfInlines `parseThen` collectLines \"institute\"\n  -- topic keywords\n  , \"keywords\" ~~> lineOfInlines `parseThen` collectLines \"keywords\"\n  -- document language\n  , \"language\" ~~> fmap pure anyLine `parseThen` B.setMeta \"lang\"\n  -- LaTeX-specific export settings\n  , \"latex_class\" ~~> fmap pure anyLine `parseThen` B.setMeta \"documentclass\"\n  , \"latex_class_options\" ~~>\n      (pure . T.filter (`notElem` (\"[]\" :: String)) <$> anyLine)\n      `parseThen` B.setMeta \"classoption\"\n  , \"latex_header\" ~~>\n      metaExportSnippet \"latex\" `parseThen` collectAsList \"header-includes\"\n  , \"latex_header_extra\" ~~>\n      metaExportSnippet \"latex\" `parseThen` collectAsList \"header-includes\"\n  -- link and macro\n  , \"link\" ~~> addLinkFormatter\n  , \"macro\" ~~> macroDefinition >>= updateState . registerMacro\n  -- pandoc-specific way to include references in the bibliography\n  , \"nocite\" ~~> lineOfInlines `parseThen` collectLines \"nocite\"\n  -- compact way to set export settings\n  , \"options\"  ~~> exportSettings\n  -- pandoc-specific way to configure emphasis recognition\n  , \"pandoc-emphasis-post\" ~~> emphChars >>= updateState . setEmphasisPostChar\n  , \"pandoc-emphasis-pre\" ~~> emphChars >>= updateState . setEmphasisPreChar\n  -- result markers (ignored)\n  , \"result\" ~~> void anyLine\n  , \"select_tags\" ~~> tagList >>= updateState . setSelectedTags\n  , \"seq_todo\" ~~> todoSequence >>= updateState . registerTodoSequence\n  , \"subtitle\" ~~> lineOfInlines `parseThen` collectLines \"subtitle\"\n  , \"title\" ~~> lineOfInlines `parseThen` collectLines \"title\"\n  , \"todo\" ~~> todoSequence >>= updateState . registerTodoSequence\n  , \"typ_todo\" ~~> todoSequence >>= updateState . registerTodoSequence\n  ]\n\nparseThen :: PandocMonad m\n          => OrgParser m (F a)\n          -> (a -> Meta -> Meta)\n          -> OrgParser m ()\nparseThen p modMeta = do\n  value <- p\n  meta  <- orgStateMeta <$> getState\n  updateState (\\st -> st { orgStateMeta = modMeta <$> value <*> meta })\n\ncollectLines :: Text -> Inlines -> Meta -> Meta\ncollectLines key value meta =\n  let value' = appendValue meta (B.toList value)\n  in B.setMeta key value' meta\n where\n  appendValue :: Meta -> [Inline] -> MetaValue\n  appendValue m v = MetaInlines $ curInlines m <> v\n\n  curInlines m = case collectInlines <$> lookupMeta key m of\n    Nothing -> []\n    Just [] -> []\n    Just xs -> xs <> [B.SoftBreak]\n\n  collectInlines :: MetaValue -> [Inline]\n  collectInlines = \\case\n    MetaInlines inlns -> inlns\n    MetaList ml       -> intercalate [B.SoftBreak] $ map collectInlines ml\n    MetaString s      -> [B.Str s]\n    MetaBlocks blks   -> blocksToInlines blks\n    MetaMap _map      -> []\n    MetaBool _bool    -> []\n\n-- | Accumulate the result as a MetaList under the given key.\ncollectAsList :: B.ToMetaValue a => Text -> a -> Meta -> Meta\ncollectAsList key value meta =\n  let value' = metaListAppend meta (B.toMetaValue value)\n  in B.setMeta key value' meta\n where\n  metaListAppend m v = MetaList (curList m ++ [v])\n  curList m = case lookupMeta key m of\n                Just (MetaList ms) -> ms\n                Just x             -> [x]\n                _                  -> []\n\n-- | Read an format specific meta definition\nmetaExportSnippet :: Monad m => Text -> OrgParser m (F Inlines)\nmetaExportSnippet format = pure . B.rawInline format <$> anyLine\n\n-- | Parse a link type definition (like @wp https://en.wikipedia.org/wiki/@).\naddLinkFormatter :: Monad m => OrgParser m ()\naddLinkFormatter = try $ do\n  linkType <- T.cons <$> letter <*> manyChar (alphaNum <|> oneOf \"-_\") <* skipSpaces\n  formatter <- parseFormat\n  updateState $ \\s ->\n    let fs = orgStateLinkFormatters s\n    in s{ orgStateLinkFormatters = Map.insert linkType formatter fs }\n\n-- | An ad-hoc, single-argument-only implementation of a printf-style format\n-- parser.\nparseFormat :: Monad m => OrgParser m (Text -> Text)\nparseFormat = try $ replacePlain <|> replaceUrl <|> justAppend\n where\n   -- inefficient\n   replacePlain = try $ (\\x -> T.concat . flip intersperse x)\n                     <$> sequence [tillSpecifier 's', rest]\n   replaceUrl   = try $ (\\x -> T.concat . flip intersperse x . urlEncode)\n                     <$> sequence [tillSpecifier 'h', rest]\n   justAppend   = try $ (<>) <$> rest\n\n   rest            = manyTillChar anyChar         (eof <|> () <$ oneOf \"\\n\\r\")\n   tillSpecifier c = manyTillChar (noneOf \"\\n\\r\") (try $ string ('%':c:\"\"))\n\ntagList :: Monad m => OrgParser m [Tag]\ntagList = do\n  skipSpaces\n  map Tag <$> many (orgTagWord <* skipSpaces) <* newline\n\nsetExcludedTags :: [Tag] -> OrgParserState -> OrgParserState\nsetExcludedTags tags st =\n  let finalSet = if orgStateExcludeTagsChanged st\n                   then foldr Set.insert (orgStateExcludeTags st) tags\n                   else Set.fromList tags\n  in st { orgStateExcludeTags = finalSet, orgStateExcludeTagsChanged = True }\n\nsetSelectedTags :: [Tag] -> OrgParserState -> OrgParserState\nsetSelectedTags tags st =\n  let finalSet = if orgStateSelectTagsChanged st\n                   then foldr Set.insert (orgStateSelectTags st) tags\n                   else Set.fromList tags\n  in st { orgStateSelectTags = finalSet, orgStateSelectTagsChanged = True }\n\nsetEmphasisPreChar :: Maybe [Char] -> OrgParserState -> OrgParserState\nsetEmphasisPreChar csMb st =\n  let preChars = fromMaybe (orgStateEmphasisPreChars defaultOrgParserState) csMb\n  in st { orgStateEmphasisPreChars = preChars }\n\nsetEmphasisPostChar :: Maybe [Char] -> OrgParserState -> OrgParserState\nsetEmphasisPostChar csMb st =\n  let postChars = fromMaybe (orgStateEmphasisPostChars defaultOrgParserState) csMb\n  in st { orgStateEmphasisPostChars = postChars }\n\n-- | Parses emphasis border character like @\".,?!\"@\nemphChars :: Monad m => OrgParser m (Maybe [Char])\nemphChars = do\n  skipSpaces\n  safeRead <$> anyLine\n\nlineOfInlines :: PandocMonad m => OrgParser m (F Inlines)\nlineOfInlines = do\n  updateLastPreCharPos\n  trimInlinesF . mconcat <$> manyTill inline newline\n\n-- | Parses ToDo sequences / keywords like @TODO DOING | DONE@.\ntodoSequence :: Monad m => OrgParser m TodoSequence\ntodoSequence = try $ do\n  todoKws <- todoKeywords\n  doneKws <- optionMaybe $ todoDoneSep *> doneKeywords\n  newline\n  -- There must be at least one DONE keyword. The last TODO keyword is\n  -- taken if necessary.\n  case doneKws of\n    Just done  -> return $ keywordsToSequence todoKws done\n    Nothing    -> case reverse todoKws of\n                    []     -> mzero  -- no keywords present\n                    (x:xs) -> return $ keywordsToSequence (reverse xs) [x]\n\n where\n   todoKeyword :: Monad m => OrgParser m Text\n   todoKeyword = do\n     keyword <- many1Char nonspaceChar\n     let cleanKeyword = T.takeWhile (/= '(') keyword\n     skipSpaces\n     return cleanKeyword\n\n   todoKeywords :: Monad m => OrgParser m [Text]\n   todoKeywords = try $\n     let endOfKeywords = todoDoneSep <|> void newline\n     in manyTill todoKeyword (lookAhead endOfKeywords)\n\n   doneKeywords :: Monad m => OrgParser m [Text]\n   doneKeywords = try $\n     manyTill (todoKeyword <* optional todoDoneSep) (lookAhead newline)\n\n   todoDoneSep :: Monad m => OrgParser m ()\n   todoDoneSep = void . try $ skipSpaces *> char '|' <* skipSpaces1\n\n   keywordsToSequence :: [Text] -> [Text] -> TodoSequence\n   keywordsToSequence todo done =\n     let todoMarkers = map (TodoMarker Todo) todo\n         doneMarkers = map (TodoMarker Done) done\n     in todoMarkers ++ doneMarkers\n\nmacroDefinition :: Monad m => OrgParser m (Text, [Text] -> Text)\nmacroDefinition = try $ do\n  macroName <- many1Char nonspaceChar <* skipSpaces\n  firstPart <- expansionPart\n  (elemOrder, parts) <- unzip <$> many ((,) <$> placeholder <*> expansionPart)\n  let expander = mconcat . alternate (firstPart:parts) . reorder elemOrder\n  return (macroName, expander)\n where\n  placeholder :: Monad m => OrgParser m Int\n  placeholder = try . fmap (fromMaybe 1 . safeRead) $ char '$' *> many1Char digit\n\n  expansionPart :: Monad m => OrgParser m Text\n  expansionPart = try $ manyChar (notFollowedBy placeholder *> noneOf \"\\n\\r\")\n\n  alternate :: [a] -> [a] -> [a]\n  alternate []     ys     = ys\n  alternate xs     []     = xs\n  alternate (x:xs) (y:ys) = x : y : alternate xs ys\n\n  reorder :: [Int] -> [Text] -> [Text]\n  reorder perm xs =\n    let element n = take 1 $ drop (n - 1) xs\n    in concatMap element perm\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/ParserState.hs",
    "content": "{-# LANGUAGE FlexibleInstances     #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE OverloadedStrings     #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.ParserState\n   Copyright   : Copyright (C) 2014-2025 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nDefine the Org-mode parser state.\n-}\nmodule Text.Pandoc.Readers.Org.ParserState\n  ( OrgParserState (..)\n  , defaultOrgParserState\n  , OrgParserLocal (..)\n  , OrgNoteRecord\n  , Tag(..)\n  , HasReaderOptions (..)\n  , HasQuoteContext (..)\n  , HasMacros (..)\n  , TodoMarker (..)\n  , TodoSequence\n  , TodoState (..)\n  , activeTodoMarkers\n  , registerTodoSequence\n  , MacroExpander\n  , lookupMacro\n  , registerMacro\n  , F\n  , askF\n  , asksF\n  , trimInlinesF\n  , runF\n  , returnF\n  , ExportSettings (..)\n  , ArchivedTreesOption (..)\n  , TeXExport (..)\n  , optionsToParserState\n  ) where\n\nimport Control.Monad.Reader (ReaderT, asks, local)\n\nimport Data.Default (Default (..))\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport Data.Text (Text)\n\nimport Text.Pandoc.Builder (Blocks)\nimport Text.Pandoc.Definition (Meta (..), nullMeta)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options (ReaderOptions (..), Extension(..), isEnabled)\nimport Text.Pandoc.Parsing (Future, HasIdentifierList (..),\n                            HasIncludeFiles (..), HasLastStrPosition (..),\n                            HasLogMessages (..), HasMacros (..),\n                            HasQuoteContext (..), HasReaderOptions (..),\n                            ParserContext (..), QuoteContext (..), SourcePos,\n                            askF, asksF, returnF, runF, trimInlinesF)\nimport Text.Pandoc.TeX (Macro)\n\n-- | This is used to delay evaluation until all relevant information has been\n-- parsed and made available in the parser state.\ntype F = Future OrgParserState\n\n-- | An inline note / footnote containing the note key and its (inline) value.\ntype OrgNoteRecord = (Text, F Blocks)\n-- | Table of footnotes\ntype OrgNoteTable = [OrgNoteRecord]\n-- | Map of functions for link transformations.  The map key is refers to the\n-- link-type, the corresponding function transforms the given link string.\ntype OrgLinkFormatters = M.Map Text (Text -> Text)\n-- | Macro expander function\ntype MacroExpander = [Text] -> Text\n-- | Tag\nnewtype Tag = Tag { fromTag :: Text }\n  deriving (Show, Eq, Ord)\n\n-- | The states in which a todo item can be\ndata TodoState = Todo | Done\n  deriving (Eq, Ord, Show)\n\n-- | A ToDo keyword like @TODO@ or @DONE@.\ndata TodoMarker = TodoMarker\n  { todoMarkerState :: TodoState\n  , todoMarkerName  :: Text\n  }\n  deriving (Show, Eq)\n\n-- | Collection of todo markers in the order in which items should progress\ntype TodoSequence = [TodoMarker]\n\n-- | Org-mode parser state\ndata OrgParserState = OrgParserState\n  { orgStateAnchorIds            :: [Text]\n  , orgStateEmphasisCharStack    :: [Char]\n  , orgStateEmphasisPreChars     :: [Char] -- ^ Chars allowed to occur before\n                                           -- emphasis; spaces and newlines are\n                                           -- always ok in addition to what is\n                                           -- specified here.\n  , orgStateEmphasisPostChars    :: [Char] -- ^ Chars allowed at after emphasis\n  , orgStateEmphasisNewlines     :: Maybe Int\n  , orgStateExcludeTags          :: Set.Set Tag\n  , orgStateExcludeTagsChanged   :: Bool\n  , orgStateExportSettings       :: ExportSettings\n  , orgStateIdentifiers          :: Set.Set Text\n  , orgStateIncludeFiles         :: [Text]\n  , orgStateLastForbiddenCharPos :: Maybe SourcePos\n  , orgStateLastPreCharPos       :: Maybe SourcePos\n  , orgStateLastStrPos           :: Maybe SourcePos\n  , orgStateLinkFormatters       :: OrgLinkFormatters\n  , orgStateMacros               :: M.Map Text MacroExpander\n  , orgStateMacroDepth           :: Int\n  , orgStateMeta                 :: F Meta\n  , orgStateNotes'               :: OrgNoteTable\n  , orgStateOptions              :: ReaderOptions\n  , orgStateParserContext        :: ParserContext\n  , orgStateSelectTags           :: Set.Set Tag\n  , orgStateSelectTagsChanged    :: Bool\n  , orgStateTodoSequences        :: [TodoSequence]\n  , orgStateTrimLeadBlkIndent    :: Bool\n  , orgLogMessages               :: [LogMessage]\n  , orgMacros                    :: M.Map Text Macro\n  }\n\nnewtype OrgParserLocal = OrgParserLocal\n  { orgLocalQuoteContext :: QuoteContext\n  }\n\ninstance Default OrgParserLocal where\n  def = OrgParserLocal NoQuote\n\ninstance HasReaderOptions OrgParserState where\n  extractReaderOptions = orgStateOptions\n\ninstance HasLastStrPosition OrgParserState where\n  getLastStrPos = orgStateLastStrPos\n  setLastStrPos pos st = st{ orgStateLastStrPos = pos }\n\ninstance Monad m => HasQuoteContext st (ReaderT OrgParserLocal m) where\n  getQuoteContext = asks orgLocalQuoteContext\n  withQuoteContext q = local (\\s -> s{orgLocalQuoteContext = q})\n\ninstance HasIdentifierList OrgParserState where\n  extractIdentifierList = orgStateIdentifiers\n  updateIdentifierList f s = s{ orgStateIdentifiers = f (orgStateIdentifiers s) }\n\ninstance HasLogMessages OrgParserState where\n  addLogMessage msg st = st{ orgLogMessages = msg : orgLogMessages st }\n  getLogMessages st = reverse $ orgLogMessages st\n\ninstance HasMacros OrgParserState where\n  extractMacros st = orgMacros st\n  updateMacros f st = st{ orgMacros = f (orgMacros st) }\n\ninstance HasIncludeFiles OrgParserState where\n  getIncludeFiles = orgStateIncludeFiles\n  addIncludeFile f st = st { orgStateIncludeFiles = f : orgStateIncludeFiles st }\n  dropLatestIncludeFile st =\n    st { orgStateIncludeFiles = drop 1 $ orgStateIncludeFiles st }\n\ninstance Default OrgParserState where\n  def = defaultOrgParserState\n\ndefaultOrgParserState :: OrgParserState\ndefaultOrgParserState = OrgParserState\n  { orgStateAnchorIds = []\n  , orgStateEmphasisPreChars = \"-\\t ('\\\"{\\x200B\"\n  , orgStateEmphasisPostChars  = \"-\\t\\n .,:!?;'\\\")}[\\x200B\"\n  , orgStateEmphasisCharStack = []\n  , orgStateEmphasisNewlines = Nothing\n  , orgStateExportSettings = def\n  , orgStateExcludeTags = Set.singleton $ Tag \"noexport\"\n  , orgStateExcludeTagsChanged = False\n  , orgStateIdentifiers = Set.empty\n  , orgStateIncludeFiles = []\n  , orgStateLastForbiddenCharPos = Nothing\n  , orgStateLastPreCharPos = Nothing\n  , orgStateLastStrPos = Nothing\n  , orgStateLinkFormatters = M.empty\n  , orgStateMacros = M.empty\n  , orgStateMacroDepth = 0\n  , orgStateMeta = return nullMeta\n  , orgStateNotes' = []\n  , orgStateOptions = def\n  , orgStateParserContext = NullState\n  , orgStateSelectTags = Set.singleton $ Tag \"export\"\n  , orgStateSelectTagsChanged = False\n  , orgStateTrimLeadBlkIndent = True\n  , orgStateTodoSequences = []\n  , orgLogMessages = []\n  , orgMacros = M.empty\n  }\n\noptionsToParserState :: ReaderOptions -> OrgParserState\noptionsToParserState opts =\n  let exportSettings = defaultExportSettings\n        { exportSmartQuotes = isEnabled Ext_smart opts ||\n                              isEnabled Ext_smart_quotes opts\n        , exportSpecialStrings = isEnabled Ext_smart opts ||\n                                 isEnabled Ext_special_strings opts\n        }\n  in def { orgStateOptions = opts\n         , orgStateExportSettings = exportSettings\n         }\n\nregisterTodoSequence :: TodoSequence -> OrgParserState -> OrgParserState\nregisterTodoSequence todoSeq st =\n  let curSeqs = orgStateTodoSequences st\n  in st{ orgStateTodoSequences = todoSeq : curSeqs }\n\n-- | Get the current todo/done sequences. If no custom todo sequences have been\n-- defined, return a list containing just the default todo/done sequence.\nactiveTodoSequences :: OrgParserState -> [TodoSequence]\nactiveTodoSequences st =\n  let curSeqs = orgStateTodoSequences st\n  in if null curSeqs\n     then [[ TodoMarker Todo \"TODO\" , TodoMarker Done \"DONE\" ]]\n     else curSeqs\n\nactiveTodoMarkers :: OrgParserState -> TodoSequence\nactiveTodoMarkers = concat . activeTodoSequences\n\nlookupMacro :: Text -> OrgParserState -> Maybe MacroExpander\nlookupMacro macroName = M.lookup macroName . orgStateMacros\n\nregisterMacro :: (Text, MacroExpander) -> OrgParserState -> OrgParserState\nregisterMacro (name, expander) st =\n  let curMacros = orgStateMacros st\n  in st{ orgStateMacros = M.insert name expander curMacros }\n\n\n\n--\n-- Export Settings\n--\n\n-- | Options for the way archived trees are handled.\ndata ArchivedTreesOption =\n    ArchivedTreesExport       -- ^ Export the complete tree\n  | ArchivedTreesNoExport     -- ^ Exclude archived trees from exporting\n  | ArchivedTreesHeadlineOnly -- ^ Export only the headline, discard the contents\n\n-- | Options for the handling of LaTeX environments and fragments.\n-- Represents allowed values of Emacs variable @org-export-with-latex@.\ndata TeXExport\n  = TeXExport                 -- ^ Include raw TeX in the output\n  | TeXIgnore                 -- ^ Ignore raw TeX\n  | TeXVerbatim               -- ^ Keep everything in verbatim\n\n-- | Export settings <http://orgmode.org/manual/Export-settings.html>\n-- These settings can be changed via OPTIONS statements.\ndata ExportSettings = ExportSettings\n  { exportArchivedTrees    :: ArchivedTreesOption -- ^ How to treat archived trees\n  , exportDrawers          :: Either [Text] [Text]\n  -- ^ Specify drawer names which should be exported.  @Left@ names are\n  -- explicitly excluded from the resulting output while @Right@ means that\n  -- only the listed drawer names should be included.\n  , exportEmphasizedText   :: Bool -- ^ Parse emphasized text\n  , exportHeadlineLevels   :: Int\n  -- ^ Maximum depth of headlines, deeper headlines are convert to list\n  , exportPreserveBreaks   :: Bool -- ^ Whether to preserve linebreaks\n  , exportSmartQuotes      :: Bool -- ^ Parse quotes smartly\n  , exportSpecialStrings   :: Bool -- ^ Parse ellipses and dashes smartly\n  , exportSubSuperscripts  :: Bool -- ^ TeX-like syntax for sub- and superscripts\n  , exportWithAuthor       :: Bool -- ^ Include author in final meta-data\n  , exportWithCreator      :: Bool -- ^ Include creator in final meta-data\n  , exportWithEmail        :: Bool -- ^ Include email in final meta-data\n  , exportWithEntities     :: Bool -- ^ Include MathML-like entities\n  , exportWithFootnotes    :: Bool -- ^ Include footnotes\n  , exportWithLatex        :: TeXExport -- ^ Handling of raw TeX commands\n  , exportWithPlanning     :: Bool -- ^ Keep planning info after headlines\n  , exportWithTags         :: Bool -- ^ Keep tags as part of headlines\n  , exportWithTables       :: Bool -- ^ Include tables\n  , exportWithTodoKeywords :: Bool -- ^ Keep TODO keywords in headers\n  }\n\ninstance Default ExportSettings where\n  def = defaultExportSettings\n\ndefaultExportSettings :: ExportSettings\ndefaultExportSettings = ExportSettings\n  { exportArchivedTrees = ArchivedTreesHeadlineOnly\n  , exportDrawers = Left [\"LOGBOOK\"]\n  , exportEmphasizedText = True\n  , exportHeadlineLevels = 3\n  , exportPreserveBreaks = False\n  , exportSmartQuotes = False\n  , exportSpecialStrings = True\n  , exportSubSuperscripts = True\n  , exportWithAuthor = True\n  , exportWithCreator = True\n  , exportWithEmail = True\n  , exportWithEntities = True\n  , exportWithFootnotes = True\n  , exportWithLatex = TeXExport\n  , exportWithPlanning = False\n  , exportWithTags = True\n  , exportWithTables = True\n  , exportWithTodoKeywords = True\n  }\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/Parsing.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.Org.Parsing\n   Copyright   : Copyright (C) 2014-2025 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nOrg-mode parsing utilities.\n\nMost functions are simply re-exports from @Text.Pandoc.Parsing@, some\nfunctions are adapted to Org-mode specific functionality.\n-}\nmodule Text.Pandoc.Readers.Org.Parsing\n  ( OrgParser\n  , anyLine\n  , anyLineNewline\n  , indentWith\n  , blanklines\n  , newline\n  , parseFromString\n  , skipSpaces1\n  , inList\n  , withContext\n  , getExportSetting\n  , updateLastForbiddenCharPos\n  , updateLastPreCharPos\n  , orgArgKey\n  , orgArgWord\n  , orgArgWordChar\n  , orgTagWord\n  , orgTagWordChar\n  , orgAnchor\n  -- * Re-exports from Text.Pandoc.Parser\n  , ParserContext (..)\n  , textStr\n  , countChar\n  , manyChar\n  , many1Char\n  , manyTillChar\n  , many1Till\n  , many1TillChar\n  , notFollowedBy'\n  , sepBy1'\n  , spaceChar\n  , nonspaceChar\n  , skipSpaces\n  , blankline\n  , enclosed\n  , stringAnyCase\n  , charsInBalanced\n  , uri\n  , withRaw\n  , readWithM\n  , guardEnabled\n  , updateLastStrPos\n  , notAfterString\n  , getLastStrPos\n  , ParserState (..)\n  , registerHeader\n  , QuoteContext (..)\n  , singleQuoteStart\n  , singleQuoteEnd\n  , doubleQuoteStart\n  , doubleQuoteEnd\n  , dash\n  , ellipses\n  , citeKey\n  , gridTableWith\n  , insertIncludedFile\n  , runParser\n  , runParserT\n  , getInput\n  , char\n  , letter\n  , digit\n  , alphaNum\n  , skipMany1\n  , spaces\n  , anyChar\n  , satisfy\n  , string\n  , count\n  , eof\n  , noneOf\n  , oneOf\n  , lookAhead\n  , notFollowedBy\n  , many\n  , many1\n  , manyTill\n  , (<|>)\n  , (<?>)\n  , choice\n  , try\n  , sepBy\n  , sepBy1\n  , sepEndBy1\n  , endBy1\n  , option\n  , optional\n  , optionMaybe\n  , getState\n  , updateState\n  , SourcePos\n  , sourceName\n  , getPosition\n  ) where\n\nimport Data.Text (Text)\nimport Text.Pandoc.Readers.Org.ParserState\n\nimport Text.Pandoc.Parsing hiding (anyLine, blanklines, newline,\n                                   parseFromString)\nimport qualified Text.Pandoc.Parsing as P\n\nimport Control.Monad (guard)\nimport Control.Monad.Reader (ReaderT)\n\n-- | The parser used to read org files.\ntype OrgParser m = ParsecT Sources OrgParserState (ReaderT OrgParserLocal m)\n\n--\n-- Adaptions and specializations of parsing utilities\n--\n\n-- | Parse any line of text\nanyLine :: Monad m => OrgParser m Text\nanyLine =\n  P.anyLine\n    <* updateLastPreCharPos\n    <* updateLastForbiddenCharPos\n\n-- | Like @'Text.Pandoc.Parsing'@, but resets the position of the last character\n-- allowed before emphasised text.\nparseFromString :: Monad m => OrgParser m a -> Text -> OrgParser m a\nparseFromString parser str' = do\n  updateState $ \\s -> s{ orgStateLastPreCharPos = Nothing }\n  result <- P.parseFromString parser str'\n  updateState $ \\s -> s { orgStateLastPreCharPos = Nothing }\n  return result\n\n-- | Skip one or more tab or space characters.\nskipSpaces1 :: Monad m => OrgParser m ()\nskipSpaces1 = skipMany1 spaceChar\n\n-- | Like @Text.Parsec.Char.newline@, but causes additional state changes.\nnewline :: Monad m => OrgParser m Char\nnewline =\n  P.newline\n       <* updateLastPreCharPos\n       <* updateLastForbiddenCharPos\n\n-- | Like @Text.Parsec.Char.blanklines@, but causes additional state changes.\nblanklines :: Monad m => OrgParser m Text\nblanklines =\n  P.blanklines\n       <* updateLastPreCharPos\n       <* updateLastForbiddenCharPos\n\n-- | Succeeds when we're in list context.\ninList :: Monad m => OrgParser m ()\ninList = do\n  ctx <- orgStateParserContext <$> getState\n  guard (ctx == ListItemState)\n\n-- | Parse in different context\nwithContext :: Monad m\n            => ParserContext -- ^ New parser context\n            -> OrgParser m a   -- ^ Parsec to run in that context\n            -> OrgParser m a\nwithContext context parser = do\n  oldContext <- orgStateParserContext <$> getState\n  updateState $ \\s -> s{ orgStateParserContext = context }\n  result <- parser\n  updateState $ \\s -> s{ orgStateParserContext = oldContext }\n  return result\n\n--\n-- Parsec state functions\n--\n\n-- | Get an export setting.\ngetExportSetting :: Monad m =>  (ExportSettings -> a) -> OrgParser m a\ngetExportSetting s = s . orgStateExportSettings <$> getState\n\n-- | Set the current position as the last position at which a forbidden char\n-- was found (i.e. a character which is not allowed at the inner border of\n-- markup).\nupdateLastForbiddenCharPos :: Monad m => OrgParser m ()\nupdateLastForbiddenCharPos = getPosition >>= \\p ->\n  updateState $ \\s -> s{ orgStateLastForbiddenCharPos = Just p}\n\n-- | Set the current parser position as the position at which a character was\n-- seen which allows inline markup to follow.\nupdateLastPreCharPos :: Monad m => OrgParser m ()\nupdateLastPreCharPos = getPosition >>= \\p ->\n  updateState $ \\s -> s{ orgStateLastPreCharPos = Just p}\n\n--\n-- Org key-value parsing\n--\n\n-- | Read the key of a plist style key-value list.\norgArgKey :: Monad m => OrgParser m Text\norgArgKey = try $\n  skipSpaces *> char ':'\n             *> many1Char orgArgWordChar\n\n-- | Read the value of a plist style key-value list.\norgArgWord :: Monad m => OrgParser m Text\norgArgWord = many1Char orgArgWordChar\n\n-- | Chars treated as part of a word in plists.\norgArgWordChar :: Monad m => OrgParser m Char\norgArgWordChar = alphaNum <|> oneOf \"-_\"\n\norgTagWord :: Monad m => OrgParser m Text\norgTagWord = many1Char orgTagWordChar\n\norgTagWordChar :: Monad m => OrgParser m Char\norgTagWordChar = alphaNum <|> oneOf \"@%#_\"\n\norgAnchor :: Monad m => OrgParser m Text\norgAnchor = try $ do\n  string \"<<\"\n  anchorId <- many1Char (noneOf \"\\t\\n\\r<>\\\"' \")\n  string \">>\"\n  skipSpaces\n  recordAnchorId anchorId\n  return anchorId\n\nrecordAnchorId :: Monad m => Text -> OrgParser m ()\nrecordAnchorId i = updateState $ \\s ->\n  s{ orgStateAnchorIds = i : orgStateAnchorIds s }\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org/Shared.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Org.Shared\n   Copyright   : Copyright (C) 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nUtility functions used in other Pandoc Org modules.\n-}\nmodule Text.Pandoc.Readers.Org.Shared\n  ( cleanLinkText\n  , isImageFilename\n  , originalLang\n  , translateLang\n  , exportsCode\n  ) where\n\nimport Control.Applicative ((<|>))\nimport Data.Char (isAlphaNum)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport System.FilePath (isValid, takeExtension)\nimport qualified System.FilePath.Posix as Posix\nimport qualified System.FilePath.Windows as Windows\n\n-- | Check whether the given string looks like the path to of URL of an image.\nisImageFilename :: Text -> Bool\nisImageFilename fp = hasImageExtension && (isValid (T.unpack fp) || isKnownProtocolUri)\n where\n   hasImageExtension = takeExtension (T.unpack $ T.toLower fp)\n                       `elem` imageExtensions\n   isKnownProtocolUri = any (\\x -> (x <> \"://\") `T.isPrefixOf` fp) protocols\n\n   imageExtensions = [ \".jpeg\", \".jpg\", \".png\", \".gif\", \".svg\", \".webp\", \".jxl\", \".avif\" ]\n   protocols = [ \"file\", \"http\", \"https\" ]\n\n-- | Cleanup and canonicalize a string describing a link.  Return @Nothing@ if\n-- the string does not appear to be a link.\ncleanLinkText :: Text -> Maybe Text\ncleanLinkText s\n  | Just f <- toFileSchema s           = Just f                -- absolute path\n  | Just _ <- T.stripPrefix \"./\" s     = Just s                -- relative path\n  | Just _ <- T.stripPrefix \"../\" s    = Just s                -- relative path\n  -- Relative path or URL (file schema)\n  | Just s' <- T.stripPrefix \"file:\" s = if \"//\" `T.isPrefixOf` s'\n                                         then Just s\n                                         else  toFileSchema s' <|> Just s'\n  | isUrl s                            = Just s\n  | otherwise                          = Nothing\n  where\n    toFileSchema :: Text -> Maybe Text\n    toFileSchema t\n      | Windows.isAbsolute (T.unpack t) = Just (\"file:///\" <> t)\n      | Posix.isAbsolute (T.unpack t)   = Just (\"file://\" <> t)\n      | otherwise                       = Nothing\n    isUrl :: Text -> Bool\n    isUrl cs =\n      let (scheme, path) = T.break (== ':') cs\n      in T.all (\\c -> isAlphaNum c || T.any (== c) \".-\") scheme\n         && not (T.null path)\n\n-- | Creates an key-value pair marking the original language name specified for\n-- a piece of source code.\n\n-- | Creates an key-value attributes marking the original language name\n-- specified for a piece of source code.\noriginalLang :: Text -> [(Text, Text)]\noriginalLang lang =\n  let transLang = translateLang lang\n  in [(\"org-language\", lang) | transLang /= lang]\n\n-- | Translate from Org-mode's programming language identifiers to those used\n-- by Pandoc.  This is useful to allow for proper syntax highlighting in\n-- Pandoc output.\ntranslateLang :: Text -> Text\ntranslateLang cs =\n  case cs of\n    \"C\"          -> \"c\"\n    \"C++\"        -> \"cpp\"\n    \"emacs-lisp\" -> \"commonlisp\" -- emacs lisp is not supported\n    \"js\"         -> \"javascript\"\n    \"lisp\"       -> \"commonlisp\"\n    \"R\"          -> \"r\"\n    \"sh\"         -> \"bash\"\n    \"sqlite\"     -> \"sql\"\n    _            -> cs\n\nexportsCode :: [(Text, Text)] -> Bool\nexportsCode = maybe True (`elem` [\"code\", \"both\"]) . lookup \"exports\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Org.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Readers.Org\n   Copyright   : Copyright (C) 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nConversion of org-mode formatted plain text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Org ( readOrg ) where\n\nimport Text.Pandoc.Readers.Org.Blocks (blockList, meta)\nimport Text.Pandoc.Readers.Org.ParserState (optionsToParserState)\nimport Text.Pandoc.Readers.Org.Parsing (OrgParser, readWithM)\n\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing (reportLogMessages)\nimport Text.Pandoc.Sources (ToSources(..), ensureFinalNewlines)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.Reader (runReaderT)\n\n-- | Parse org-mode string and return a Pandoc document.\nreadOrg :: (PandocMonad m, ToSources a)\n        => ReaderOptions -- ^ Reader options\n        -> a\n        -> m Pandoc\nreadOrg opts s = do\n  parsed <- flip runReaderT def $\n            readWithM parseOrg (optionsToParserState opts)\n            (ensureFinalNewlines 2 (toSources s))\n  case parsed of\n    Right result -> return result\n    Left  e      -> throwError e\n\n--\n-- Parser\n--\nparseOrg :: PandocMonad m => OrgParser m Pandoc\nparseOrg = do\n  blocks' <- blockList\n  meta'   <- meta\n  reportLogMessages\n  return $ Pandoc meta' blocks'\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Pod.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns #-}\n{-# LANGUAGE TypeApplications #-}\n{- |\n   Module      : Text.Pandoc.Readers.Pod\n   Copyright   : © 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Evan Silberman <evan@jklol.net>\n   Stability   : WIP\n   Portability : portable\n\nConversion of Pod to 'Pandoc' documents\n-}\nmodule Text.Pandoc.Readers.Pod (readPod) where\n\nimport Control.Monad (void)\nimport Control.Monad.Except (throwError)\nimport Data.Char (isAsciiUpper, digitToInt)\nimport Data.Default (Default)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Parsing.General (isSpaceChar)\nimport Text.Pandoc.XML (lookupEntity)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad(..))\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport qualified Data.Text as T\nimport qualified Data.Text.Read as TR\nimport Text.Pandoc.Shared (stringify, textToIdentifier, tshow)\nimport Data.Set (Set)\nimport Data.Functor (($>))\nimport Data.Maybe (listToMaybe, fromMaybe)\nimport Numeric (readOct)\n\ndata PodState = PodState\n  { logMessages :: [LogMessage]\n  , headerIds :: Set T.Text\n  , options :: ReaderOptions\n} deriving (Show)\n\ninstance HasLogMessages PodState where\n  addLogMessage msg st = st{ logMessages = msg : logMessages st }\n  getLogMessages st = reverse $ logMessages st\n\ninstance HasIdentifierList PodState where\n  extractIdentifierList = headerIds\n  updateIdentifierList f st = st{headerIds = f (headerIds st)}\n\ninstance HasReaderOptions PodState where\n  extractReaderOptions = options\n\ninstance Default PodState where\n  def = PodState\n    { logMessages = []\n    , headerIds = mempty\n    , options = def\n    }\n\ndata PodLinkDestination = LinkUrl Inlines T.Text\n                        | LinkMan Inlines (Maybe Inlines)\n                        | LinkInternal Inlines\n                        deriving (Show)\n\ndefaultLinkName :: PodLinkDestination -> Inlines\ndefaultLinkName (LinkUrl inl _) = inl\ndefaultLinkName (LinkMan nm (Just sec)) = B.doubleQuoted sec <> \" in \" <> nm\ndefaultLinkName (LinkMan nm Nothing) = nm\ndefaultLinkName (LinkInternal sec) = B.doubleQuoted sec\n\ntype PodParser m = ParsecT Sources PodState m\n\nreadPod :: (PandocMonad m, ToSources a)\n        => ReaderOptions\n        -> a\n        -> m Pandoc\nreadPod _ s = do\n  let sources = toSources s\n  p <- readWithM parsePod def sources\n  case p of\n    Right result -> return result\n    Left e       -> throwError e\n\nparsePod :: PandocMonad m => PodParser m Pandoc\nparsePod = do\n  -- We don't actually start processing Pod until we encounter a Pod command.\n  -- If we never encounter a Pod command, the document is still valid Pod, it\n  -- just contains no content.\n  notPod\n  bs <- manyTill block eof\n  reportLogMessages\n  return $ B.doc $ mconcat bs\n\nblock :: PandocMonad m => PodParser m Blocks\nblock = verbatim  <|> paragraph <|> command <?> \"Pod paragraph\"\n\ncommand :: PandocMonad m => PodParser m Blocks\ncommand = do\n    try (char '=' >> notFollowedBy (string \"item\" <|> string \"back\" <|> string \"end\"))\n    header <|> pod <|> cut <|> over <|> for <|> begin <|> encoding <?> \"Pod command\"\n\ncmd :: PandocMonad m => T.Text -> PodParser m ()\ncmd nm = do\n  textStr nm\n  notFollowedBy nonspaceChar\n  void $ many spaceChar\n\nencoding :: PandocMonad m => PodParser m Blocks\nencoding = do\n  cmd \"encoding\"\n  anyLine\n  optional blanklines\n  logMessage $ IgnoredElement \"=encoding; Pandoc requires UTF-8 input\"\n  return mempty\n\nheader :: PandocMonad m => PodParser m Blocks\nheader = do\n  string \"head\"\n  dig <- oneOf \"123456\"\n  void blankline <|> skipMany1 spaceChar\n  ins <- inlines\n  attrs <- registerHeader B.nullAttr ins\n  optional blanklines\n  return $ B.headerWith attrs (digitToInt dig) ins\n\npod :: PandocMonad m => PodParser m Blocks\npod = do\n  cmd \"pod\"\n  optional (try inlines)\n  optional blanklines\n  return mempty\n\ncut :: PandocMonad m => PodParser m Blocks\ncut = cmd \"cut\" *> notPod\n\nnotPod :: PandocMonad m => PodParser m Blocks\nnotPod = do\n  manyTill anyLine (eof <|> void (try (lookAhead (char '=' *> letter))))\n  return mempty\n\nover :: PandocMonad m => PodParser m Blocks\nover = do\n  cmd \"over\"\n  anyLine\n  blanklines\n  optional $ try (char '=' *> cut)\n  bs <- list <|> blockquote\n  string \"=back\" <* blanklines\n  return bs\n\nlist :: PandocMonad m => PodParser m Blocks\nlist = try bulletList <|> try orderedList <|> definitionList\n\nbulletList :: PandocMonad m => PodParser m Blocks\nbulletList = B.bulletList <$> many1 (item (many spaceChar *> optional (char '*')))\n\norderedList :: PandocMonad m => PodParser m Blocks\norderedList = do\n  start <- item1\n  more <- many orderedItem\n  return $ B.orderedList (start : more)\n  where\n    item1 = item $ spaces *> char '1' *> optional (char '.')\n    orderedItem = item $ spaces *> many digit *> optional (char '.')\n\nitem :: PandocMonad m => PodParser m () -> PodParser m Blocks\nitem p = do\n  try (cmd \"=item\")\n  p\n  blanklines\n  mconcat <$> many block <?> \"runaway item\"\n\ndefinitionList :: PandocMonad m => PodParser m Blocks\ndefinitionList = B.definitionList <$> many1 dlItem\n  where\n    dlItem = do\n      try (cmd \"=item\")\n      spaces\n      term <- inlines\n      blanklines\n      -- perlpodspec sez the /section part of a link can refer to either\n      -- a header or a dl item, hence treating it as a \"header\" here\n      attrs <- registerHeader B.nullAttr term\n      defn <- mconcat <$> many block <?> \"runaway dlitem\"\n      return (B.spanWith attrs term, [defn])\n\nblockquote :: PandocMonad m => PodParser m Blocks\nblockquote = B.blockQuote . mconcat <$> many block <?> \"runaway blockquote\"\n\nparagraph :: PandocMonad m => PodParser m Blocks\nparagraph = do\n  try (notFollowedBy (char '=' *> letter))\n  inl <- inlines\n  optional blanklines\n  return $ B.para $ B.trimInlines inl\n\ninlines :: PandocMonad m => PodParser m Inlines\ninlines = mconcat <$> many1 (format <|> whitespace <|> str)\n\n-- perlpodspec sez:\n--   If a Pod processor sees any formatting code other than the ones listed,\n--   that processor must by default treat this as an error.\nformat :: PandocMonad m => PodParser m Inlines\nformat = try $ do\n  ctrl <- satisfy isAsciiUpper\n  p <- getPosition\n  lookAhead (char '<')\n  case ctrl of\n    'B' -> B.strong <$> argument\n    'C' -> B.code . stringify <$> argument\n    'F' -> B.spanWith (mempty, [\"filename\"], mempty) <$> argument\n    'I' -> B.emph <$> argument\n    'S' -> argument  -- TODO map nbsps\n    'X' -> argument $> mempty\n    'Z' -> argument $> mempty\n\n    'E' -> do\n      a <- stringify <$> argument\n      case entity a of\n             -- per spec:\n             --   Pod parsers, when faced with some unknown \"E<identifier>\" code,\n             --   shouldn't simply replace it with nullstring (by default, at\n             --   least), but may pass it through as a string consisting of the\n             --   literal characters E, less-than, identifier, greater-than.\n             Nothing -> do\n               logMessage $ SkippedContent (\"unknown entity \" <> a) p\n               return $ B.str $ \"E<\" <> a <> \">\"\n             Just e -> return $ B.str e\n\n    'L' -> link\n\n    x -> throwError $ PandocParseError $ T.snoc \"unknown Pod formatting code \" x\n  where\n    argument = try expandedArg <|> compactArg <?> \"argument\"\n    innerStr =  B.str <$> many1Char (podCharLess \">\")\n    compactArg = do\n      char '<'\n      mconcat <$> manyTill (format <|> whitespace <|> innerStr) (char '>')\n    expandedArg = do\n      openLen <- length <$> many1 (char '<')\n      let close = T.pack $ replicate openLen '>'\n      skipMany1 spaceChar <|> void blankline\n      arg <- mconcat <$> many (format <|> try (whitespace <* notFollowedBy (textStr close)) <|> str)\n      many1 spaceChar\n      textStr close\n      return arg\n    -- Some legacy entity names are required to be parsed by Pod formatters\n    oct = listToMaybe . readOct @Integer\n    entity \"apos\" = Just \"'\"\n    entity \"sol\" = Just \"/\"\n    entity \"verbar\" = Just \"|\"\n    entity \"lchevron\" = Just \"«\"\n    entity \"rchevron\" = Just \"»\"\n    entity (T.stripPrefix \"0x\" -> Just suf) = lookupEntity $ \"#x\" <> suf\n    entity (T.stripPrefix \"0\" -> Just suf)\n        | Just (n, \"\") <- oct (T.unpack suf) = lookupEntity $ \"#\" <> tshow n\n    entity (TR.decimal @Integer -> Right (x, \"\")) = lookupEntity $ \"#\" <> tshow x\n    -- named entities in Commonmark.Entity de facto have to be looked up with\n    -- the semicolon at the end. perlpodspec says arguments to E<> must be\n    -- alphanumeric, so an argument that already has a trailing semicolon\n    -- is bogus anyway, so just paste the semicolon on unconditionally.\n    entity x = lookupEntity (x <> \";\")\n\n-- god knows there must be a higher order way of writing this thing, where we\n-- have multiple different possible parser states within the link argument\n-- varying depending on whether the link is expanded or not, but at least I\n-- understand what I've done. This would be less wacky with a lexing step.\nlink :: PandocMonad m => PodParser m Inlines\nlink = do\n  identifier <- textToIdentifier <$> getOption readerExtensions\n  (name, dest) <- try expandedLinkArg <|> compactLinkArg\n  return $ mkLink identifier name dest\n  where\n    compactLinkArg = do\n      char '<'\n      name <- linkName whitespace \">\"\n      dest <- linkDest whitespace (char '>') \">\"\n      char '>'\n      return (mconcat <$> name, dest)\n    expandedLinkArg = do\n      openLen <- length <$> many1 (char '<')\n      let closeStr = textStr (T.pack $ replicate openLen '>')\n      let close = skipMany1 spaceChar *> closeStr\n      let sp = try $ many1 spaceChar *> notFollowedBy closeStr $> B.space\n      many1 spaceChar\n      name <- linkName sp \"\"\n      dest <- linkDest sp close \"\"\n      close\n      return (mconcat <$> name, dest)\n    mkLink identifier name dest =\n      let name' = fromMaybe (defaultLinkName dest) name in\n          case dest of\n            LinkUrl _ href -> B.link href \"\" name'\n            LinkMan nm Nothing ->  B.linkWith (mempty, mempty, [(\"manual\", stringify nm)]) \"\" \"\" name'\n            LinkMan nm (Just sc) -> B.linkWith (mempty, mempty, [(\"manual\", stringify nm), (\"section\", stringify sc)]) \"\" \"\" name'\n            LinkInternal sc -> B.link (\"#\" <> identifier (stringify sc)) \"\" name'\n\n    linkName sp ex = optionMaybe $ try $ many\n        (try format\n         <|> sp\n         <|> B.str <$> many1Char (podCharLess ('|':ex))) <* char '|'\n    linkDest sp close ex = try (url ex) <|> internal sp close ex <|> man sp close ex\n    -- perlpodspec sez:\n    --    Note that you can distinguish URL-links from anything else by the\n    --    fact that they match m/\\A\\w+:[^:\\s]\\S*\\z/.\n    -- This is obviously not an RFC-compliant matcher for a URI scheme, but\n    -- this is what the specification and the canonical implementation (Pod::Simple)\n    -- do for deciding that a link target \"looks like\" a URL, as opposed to a\n    -- manual page reference, so what we are doing here is roughly equivalent\n    -- even though it is nonsense\n    url ex = do\n      scheme <- many1Char (letter <|> digit <|> char '_')\n      colon <- T.singleton <$> char ':' <* notFollowedBy (char ':')\n      rst <- many (format <|> B.str <$> many1Char (podCharLess ex))\n      return $ LinkUrl\n                 (B.str scheme <> B.str colon <> mconcat rst)\n                 (scheme <> colon <> stringify rst)\n    quotedSection sp close ex = do\n      let mystr = B.str <$> many1Char (podCharLess ('\\\"':ex) <|> try (char '\"' <* notFollowedBy close))\n      char '\"'\n      ins <- mconcat <$> many1 (format <|> sp <|> mystr)\n      char '\"'\n      return ins\n    section sp close ex = try (quotedSection sp close ex) <|> mconcat <$> many1 (format <|> sp <|> B.str <$> many1Char (podCharLess ex))\n    internal sp close ex = do\n      char '/'\n      LinkInternal <$> section sp close ex\n    notSlash sp ex = format <|> sp <|> B.str <$> many1Char (podCharLess ('/':ex))\n    man sp close ex = do\n      page <- mconcat <$> many (notSlash sp ex)\n      sec <- optionMaybe $ char '/' *> section sp close ex\n      return $ LinkMan page sec\n\nwhitespace :: PandocMonad m => PodParser m Inlines\nwhitespace = try $ do\n  many1 spaceChar *> optional newline <|> many spaceChar *> void newline\n  notFollowedBy blankline\n  return B.space\n\npodCharLess :: PandocMonad m => String -> PodParser m Char\npodCharLess exclude = try (satisfy isAsciiUpper <* notFollowedBy (char '<'))\n                <|> satisfy (\\c -> not (isSpaceChar c || isAsciiUpper c || elem c exclude))\n\npodChar :: PandocMonad m => PodParser m Char\npodChar = try (satisfy isAsciiUpper <* notFollowedBy (char '<'))\n                <|> satisfy (\\c -> not (isSpaceChar c || isAsciiUpper c))\n\nstr :: PandocMonad m => PodParser m Inlines\nstr = B.str <$> many1Char podChar\n\nnonEmptyLine :: PandocMonad m => PodParser m T.Text\nnonEmptyLine = try $ do\n  pre <- manyChar spaceChar\n  something <- T.singleton <$> nonspaceChar\n  post <- anyLineNewline\n  return $ pre <> something <> post\n\nverbatim :: PandocMonad m => PodParser m Blocks\nverbatim = do\n  start <- startVerbatimLine\n  lns <- many (nonEmptyLine <|>\n                     try (do b <- blanklines\n                             l <- startVerbatimLine\n                             return $ b <> l))\n  optional blanklines\n  return $ B.codeBlock $ mconcat $ start:lns\n  where\n    startVerbatimLine = many1Char spaceChar <> nonEmptyLine\n\n-- =begin/=end/=for and data paragraphs\n-- The =begin/=end (and single-paragraph =for variant) markers in Pod are\n-- designed as an extension point for specific formatters\n--\n-- this doesn't strictly match the intent of \"=begin :ident\" pod blocks, which\n-- are still meant to be processed specially by the formatter, and only land in\n-- the output upon request, i.e. pod2html will process \"=begin :html\" blocks as\n-- Pod and include them in the regular output. Since the regions contain Pod\n-- markup it seems to me that the best thing to do is parse the markup and put\n-- a classname on it, allowing users to respond as desired with filters.\n-- Pandoc doesn't have a built-in concept of parsed Divs that are only rendered\n-- to certain formats, just raw blocks.\n--\n-- perlpodspec allows nesting of =begin/=end regions but we currently don't\n-- because it would be annoying and we have something somewhat useful we\n-- can do with these blocks which is treat them as RawBlocks, which matches\n-- the intent reasonably well, and that gets weirder if we parse a nested\n-- structure. It seems unlikely this would be encountered in the wild.\n\nregionIdentifier :: PandocMonad m => PodParser m T.Text\nregionIdentifier = many1Char (alphaNum <|> oneOf \"-_\")\n\nfor :: PandocMonad m => PodParser m Blocks\nfor = do\n  string \"for\"\n  many1 spaceChar\n  forDiv <|> forData\n\nforDiv :: PandocMonad m => PodParser m Blocks\nforDiv = do\n  char ':'\n  cls <- regionIdentifier\n  many1 spaceChar\n  B.divWith (mempty, [cls], mempty) <$> paragraph\n\nforData :: PandocMonad m => PodParser m Blocks\nforData = do\n  fmt <- regionIdentifier\n  ln1 <- anyLineNewline\n  lns <- many nonEmptyLine\n  optional blanklines\n  return $ B.rawBlock fmt (T.concat (ln1 : lns))\n\nbegin :: PandocMonad m => PodParser m Blocks\nbegin = do\n  cmd \"begin\"\n  beginDiv <|> beginData\n\nbeginDiv :: PandocMonad m => PodParser m Blocks\nbeginDiv = do\n  char ':'\n  cls <- regionIdentifier\n  anyLine  -- \"parameters\" may appear in this position\n  blanklines\n  bs <- mconcat <$> many block\n  textStr (\"=end :\" <> cls) <* blanklines\n  return $ B.divWith (mempty, [cls], mempty) bs\n\nbeginData :: PandocMonad m => PodParser m Blocks\nbeginData = do\n  fmt <- regionIdentifier\n  anyLine\n  blanklines\n  lns <- mconcat <$> many (try rawCut <|> rawLine)\n  textStr (\"=end \" <> fmt) <* blanklines\n  return $ B.rawBlock fmt lns\n  where\n    rawCut = do\n      char '=' *> cut\n      pod <?> \"=pod to close =cut within =begin/=end\"\n      return mempty\n    rawLine = do\n      try (notFollowedBy (char '=' *> letter))\n      anyLineNewline\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Pptx/Parse.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Pptx.Parse\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nParsing of PPTX archive to intermediate representation.\n-}\nmodule Text.Pandoc.Readers.Pptx.Parse\n  ( Pptx(..)\n  , PresentationDoc(..)\n  , PptxSlide(..)\n  , SlideId(..)\n  , archiveToPptx\n  ) where\n\nimport Codec.Archive.Zip (Archive, Entry, findEntryByPath, fromEntry)\nimport qualified Data.ByteString.Lazy as B\nimport Data.List (find)\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy.Encoding as TL\nimport Data.Text (Text)\nimport System.FilePath (splitFileName)\nimport Text.Pandoc.Readers.OOXML.Shared\nimport Text.Pandoc.XML.Light\nimport Text.Read (readMaybe)\n\n-- | Slide identifier\nnewtype SlideId = SlideId Int deriving (Show, Eq, Ord)\n\n-- | Complete PPTX document (intermediate representation)\ndata Pptx = Pptx\n  { pptxPresentation :: PresentationDoc\n  , pptxSlides       :: [PptxSlide]\n  , pptxArchive      :: Archive\n  } deriving (Show)\n\n-- | Individual slide data\ndata PptxSlide = PptxSlide\n  { slideId      :: SlideId\n  , slidePath    :: FilePath\n  , slideElement :: Element     -- The parsed p:sld element\n  , slideRels    :: [(Text, Text)]  -- Slide relationships\n  } deriving (Show)\n\n-- | Presentation-level information from presentation.xml\ndata PresentationDoc = PresentationDoc\n  { presNameSpaces   :: NameSpaces\n  , presSlideSize    :: (Integer, Integer)  -- (width, height) in pixels\n  , presSlideIds     :: [(SlideId, Text)]   -- (slideId, relationshipId)\n  } deriving (Show)\n\n-- | Parse PPTX archive to intermediate representation\narchiveToPptx :: Archive -> Either Text Pptx\narchiveToPptx archive = do\n  -- Find and parse presentation.xml\n  presPath <- getPresentationXmlPath archive\n  presElem <- loadXMLFromArchive archive presPath\n  presDoc <- elemToPresentation presElem\n\n  -- Load presentation relationships to resolve slide paths\n  presRelsPath <- getPresentationRelsPath archive presPath\n  presRels <- loadRelationships archive presRelsPath\n\n  -- Parse each slide\n  slides <- mapM (parseSlide archive presRels) (presSlideIds presDoc)\n\n  return $ Pptx presDoc slides archive\n\n-- | Find presentation.xml via root relationships\ngetPresentationXmlPath :: Archive -> Either Text FilePath\ngetPresentationXmlPath archive = do\n  -- Load _rels/.rels\n  relsEntry <- maybeToEither \"Missing _rels/.rels\" $\n               findEntryByPath \"_rels/.rels\" archive\n\n  relsElem <- parseXMLFromEntry relsEntry\n\n  -- The Relationships element has a default namespace, but Relationship children don't use prefix\n  -- We need to look at all children regardless of namespace\n  let relElems = onlyElems $ elContent relsElem\n\n  -- Look for relationship containing \"officeDocument\" in Type attribute\n  case find isOfficeDocRel relElems of\n    Nothing -> Left $ \"No presentation.xml relationship found. Found \" <>\n                     T.pack (show (length relElems)) <> \" relationships.\"\n    Just rel -> do\n      target <- maybeToEither \"Missing Target attribute\" $\n                findAttr (unqual \"Target\") rel\n      return $ T.unpack target  -- Convert Text to FilePath\n\n  where\n    isOfficeDocRel el =\n      case findAttr (unqual \"Type\") el of\n        -- Must end with \"/officeDocument\" to avoid matching \"/extended-properties\"\n        Just relType -> \"/officeDocument\" `T.isSuffixOf` relType\n        Nothing -> False\n\n-- | Load and parse XML from archive entry\nloadXMLFromArchive :: Archive -> FilePath -> Either Text Element\nloadXMLFromArchive archive path = do\n  entry <- maybeToEither (\"Entry not found: \" <> T.pack path) $\n           findEntryByPath path archive\n\n  let xmlBytes = fromEntry entry\n  parseXMLFromBS xmlBytes\n\n-- | Parse XML from ByteString\nparseXMLFromBS :: B.ByteString -> Either Text Element\nparseXMLFromBS = parseXMLElement . TL.decodeUtf8\n\n-- | Parse XML from Entry\nparseXMLFromEntry :: Entry -> Either Text Element\nparseXMLFromEntry = parseXMLFromBS . fromEntry\n\n-- | Parse presentation.xml element to PresentationDoc\nelemToPresentation :: Element -> Either Text PresentationDoc\nelemToPresentation presElem = do\n  let ns = elemToNameSpaces presElem\n\n  -- Extract slide size (with defaults)\n  let sizeElem = findChildByName ns \"p\" \"sldSz\" presElem\n      (widthEMU, heightEMU) = case sizeElem of\n        Just el ->\n          let cx = readAttrInt \"cx\" el\n              cy = readAttrInt \"cy\" el\n           in (cx, cy)\n        Nothing -> (9144000, 6858000)  -- Default 10\" x 7.5\"\n\n  -- Convert EMUs to pixels (approximate for metadata)\n  let width = widthEMU `div` emusPerInch\n      height = heightEMU `div` emusPerInch\n\n  -- Extract slide ID list (optional - some presentations may have no slides)\n  let sldIdLstElem = findChildByName ns \"p\" \"sldIdLst\" presElem\n\n  slideRefs <- case sldIdLstElem of\n    Nothing -> return []  -- No slides is valid for templates/masters-only presentations\n    Just el -> do\n      let sldIdElems = findChildren (elemName ns \"p\" \"sldId\") el\n      mapM (extractSlideRef ns) (zip [1..] sldIdElems)\n\n  return $ PresentationDoc\n    { presNameSpaces = ns\n    , presSlideSize = (width, height)\n    , presSlideIds = slideRefs\n    }\n\n-- | Extract slide ID and relationship ID from p:sldId element\nextractSlideRef :: NameSpaces -> (Int, Element) -> Either Text (SlideId, Text)\nextractSlideRef ns (idx, sldIdElem) = do\n  relId <- maybeToEither (\"Missing r:id in slide \" <> T.pack (show idx)) $\n           findAttrByName ns \"r\" \"id\" sldIdElem\n\n  return (SlideId idx, relId)\n\n-- | Safe read attribute as Integer (with default of 0)\nreadAttrInt :: Text -> Element -> Integer\nreadAttrInt attrName el =\n  case findAttr (unqual attrName) el of\n    Just str -> case readMaybe (T.unpack str) of\n      Just n -> n\n      Nothing -> 0\n    Nothing -> 0\n\n-- | Get presentation relationships path\ngetPresentationRelsPath :: Archive -> FilePath -> Either Text FilePath\ngetPresentationRelsPath _archive presPath =\n  -- ppt/presentation.xml → ppt/_rels/presentation.xml.rels\n  let (dir, file) = splitFileName presPath\n      relsPath = dir ++ \"/_rels/\" ++ file ++ \".rels\"\n   in Right relsPath\n\n-- | Load relationships from .rels file\nloadRelationships :: Archive -> FilePath -> Either Text [(Text, Text)]\nloadRelationships archive relsPath =\n  case findEntryByPath relsPath archive of\n    Nothing -> Right []  -- No relationships is OK\n    Just entry -> do\n      relsElem <- parseXMLFromEntry entry\n      let relElems = onlyElems $ elContent relsElem\n      return $ mapMaybe extractRelationship relElems\n  where\n    extractRelationship el = do\n      relId <- findAttr (unqual \"Id\") el\n      target <- findAttr (unqual \"Target\") el\n      return (relId, target)\n\n-- | Parse a single slide\nparseSlide :: Archive -> [(Text, Text)] -> (SlideId, Text) -> Either Text PptxSlide\nparseSlide archive rels (sid, relId) = do\n  -- Resolve relationship to get slide path\n  target <- maybeToEither (\"Relationship not found: \" <> relId) $\n            lookup relId rels\n\n  -- Resolve relative path: ppt/slides/slide1.xml\n  let slidePath' = \"ppt/\" <> T.unpack target\n\n  -- Load and parse slide XML\n  slideElem <- loadXMLFromArchive archive slidePath'\n\n  -- Load slide-specific relationships\n  slideRelsPath <- getPresentationRelsPath archive slidePath'\n  slideRels' <- loadRelationships archive slideRelsPath\n\n  return $ PptxSlide sid slidePath' slideElem slideRels'\n\n-- | Helper: Maybe a -> Either Text a\nmaybeToEither :: Text -> Maybe a -> Either Text a\nmaybeToEither err Nothing = Left err\nmaybeToEither _ (Just x) = Right x\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Pptx/Shapes.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# OPTIONS_GHC -Wno-partial-fields #-}\n{- |\n   Module      : Text.Pandoc.Readers.Pptx.Shapes\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nParsing of PPTX shapes (text boxes, images, tables, diagrams).\n-}\nmodule Text.Pandoc.Readers.Pptx.Shapes\n  ( PptxShape(..)\n  , PptxParagraph(..)\n  , BulletType(..)\n  , parseShapes\n  , parseShape\n  , shapeToBlocks\n  , isTitlePlaceholder\n  , extractDrawingMLText\n  ) where\n\nimport Codec.Archive.Zip (Archive, findEntryByPath, fromEntry)\nimport qualified Data.ByteString.Lazy as B\nimport Data.List (find, groupBy)\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Read (readMaybe)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Readers.OOXML.Shared\nimport Text.Pandoc.Readers.Pptx.SmartArt\nimport Text.Pandoc.XML.Light\n\n-- | Paragraph with bullet/numbering information\ndata PptxParagraph = PptxParagraph\n  { paraLevel   :: Int            -- Bullet level (0, 1, 2...)\n  , paraBullet  :: BulletType\n  , paraText    :: Text\n  } deriving (Show)\n\n-- | Bullet type\ndata BulletType\n  = NoBullet\n  | Bullet                        -- Has bullet (character detected or implicit)\n  | WingdingsBullet              -- Detected via Wingdings symbol\n  deriving (Show, Eq)\n\n-- | Shape types in PPTX slides\ndata PptxShape\n  = PptxTextBox [PptxParagraph]         -- Parsed paragraphs with bullet info\n  | PptxPicture\n      { picRelId  :: Text               -- Relationship ID (lazy loading)\n      , picTitle  :: Text\n      , picAlt    :: Text\n      }\n  | PptxTable [[Text]]                  -- Simple text cells for now\n  | PptxDiagramRef\n      { dgmDataRelId   :: Text          -- Relationship to data.xml\n      , dgmLayoutRelId :: Text          -- Relationship to layout.xml\n      }\n  | PptxGraphic Text                    -- Placeholder for other graphics\n  deriving (Show)\n\n-- | Parse all shapes from shape tree\nparseShapes :: NameSpaces -> Element -> [PptxShape]\nparseShapes ns spTreeElem =\n  let shapeElems = onlyElems $ elContent spTreeElem\n      -- Merge parent namespaces with element namespaces\n      ns' = ns <> elemToNameSpaces spTreeElem\n   in mapMaybe (parseShape ns') shapeElems\n\n-- | Parse individual shape element\nparseShape :: NameSpaces -> Element -> Maybe PptxShape\nparseShape ns el\n  -- Text box: <p:sp> with <p:txBody>\n  | isElem ns \"p\" \"sp\" el =\n      case findChildByName ns \"p\" \"txBody\" el of\n        Just txBody ->\n          let paras = parseParagraphs ns txBody\n           in if null paras\n              then Nothing\n              else Just $ PptxTextBox paras\n        Nothing -> Nothing\n\n  -- Picture: <p:pic>\n  | isElem ns \"p\" \"pic\" el = do\n      nvPicPr <- findChildByName ns \"p\" \"nvPicPr\" el\n      cNvPr <- findChildByName ns \"p\" \"cNvPr\" nvPicPr\n\n      let title = maybe \"\" id $ findAttr (unqual \"name\") cNvPr\n          alt = maybe \"\" id $ findAttr (unqual \"descr\") cNvPr\n\n      -- Get blip relationship ID\n      blipFill <- findChildByName ns \"p\" \"blipFill\" el\n      blip <- findChildByName ns \"a\" \"blip\" blipFill\n      relId <- findAttrByName ns \"r\" \"embed\" blip\n\n      return $ PptxPicture relId title alt\n\n  -- GraphicFrame: table or diagram\n  | isElem ns \"p\" \"graphicFrame\" el =\n      case findChildByName ns \"a\" \"graphic\" el >>=\n           findChildByName ns \"a\" \"graphicData\" of\n        Nothing -> Nothing\n        Just graphicData ->\n          case findAttr (unqual \"uri\") graphicData of\n            Nothing -> Just $ PptxGraphic \"no-uri\"\n            Just uri ->\n              if \"table\" `T.isInfixOf` uri\n                then\n                  -- Table\n                  case findChildByName ns \"a\" \"tbl\" graphicData of\n                    Just tbl ->\n                      let rows = parseTableRows ns tbl\n                       in Just $ PptxTable rows\n                    Nothing -> Nothing\n                else if \"diagram\" `T.isInfixOf` uri\n                  then\n                    -- SmartArt diagram - dgm namespace is declared inline on relIds element\n                    let dgmRelIds = find (\\e -> qName (elName e) == \"relIds\") (elChildren graphicData)\n                     in case dgmRelIds of\n                          Nothing -> Just $ PptxGraphic \"diagram-no-relIds\"\n                          Just relIdsElem ->\n                            -- Get r:dm and r:lo attributes (r namespace is in parent)\n                            let ns' = ns <> elemToNameSpaces relIdsElem\n                             in case (findAttrByName ns' \"r\" \"dm\" relIdsElem,\n                                      findAttrByName ns' \"r\" \"lo\" relIdsElem) of\n                                  (Just dataRelId, Just layoutRelId) ->\n                                    Just $ PptxDiagramRef dataRelId layoutRelId\n                                  _ -> Just $ PptxGraphic \"diagram-missing-rels\"\n                  else\n                    -- Other graphic (chart, etc.)\n                    Just $ PptxGraphic (\"other: \" <> uri)\n\n  -- Skip other shapes for now\n  | otherwise = Nothing\n\n-- | Parse table rows (simple text extraction)\nparseTableRows :: NameSpaces -> Element -> [[Text]]\nparseTableRows ns tblElem =\n  let trElems = findChildrenByName ns \"a\" \"tr\" tblElem\n   in map (parseTableRow ns) trElems\n\nparseTableRow :: NameSpaces -> Element -> [Text]\nparseTableRow ns trElem =\n  let tcElems = findChildrenByName ns \"a\" \"tc\" trElem\n   in map extractCellText tcElems\n  where\n    extractCellText tcElem =\n      -- Get text from txBody/a:p/a:r/a:t\n      case findChildByName ns \"a\" \"txBody\" tcElem of\n        Just txBody -> extractDrawingMLText txBody\n        Nothing -> \"\"\n\n-- | Convert shape to Pandoc blocks\nshapeToBlocks :: PandocMonad m => Archive -> [(Text, Text)] -> PptxShape -> m [Block]\nshapeToBlocks _archive _rels (PptxTextBox paras) =\n  return $ paragraphsToBlocks paras\nshapeToBlocks archive rels (PptxPicture relId title alt) = do\n  -- Resolve relationship to get media path\n  case lookup relId rels of\n    Nothing -> return []  -- Image not found\n    Just target -> do\n      let mediaPath = resolveMediaPath target\n\n      -- Load image bytes and add to MediaBag\n      case loadMediaFromArchive archive mediaPath of\n        Nothing -> return []\n        Just mediaBytes -> do\n          P.insertMedia (T.unpack mediaPath) Nothing mediaBytes\n\n          let altText = if T.null alt then [] else [Str alt]\n          return [Para [Image nullAttr altText (mediaPath, title)]]\n\nshapeToBlocks _archive _rels (PptxTable rows) =\n  -- Simple table representation for now\n  case rows of\n    [] -> return []\n    (headerRow:bodyRows) -> do\n      let makeCell text = Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str text]]\n          headerCells = map makeCell headerRow\n          bodyCells = map (map makeCell) bodyRows\n          caption = Caption Nothing []\n          colSpec = replicate (length headerRow) (AlignDefault, ColWidthDefault)\n          headerRow' = Row nullAttr headerCells\n          bodyRows' = map (Row nullAttr) bodyCells\n          thead = TableHead nullAttr [headerRow']\n          tbody = [TableBody nullAttr 0 [] bodyRows']\n          tfoot = TableFoot nullAttr []\n      return [Table nullAttr caption colSpec thead tbody tfoot]\n\nshapeToBlocks archive rels (PptxDiagramRef dataRelId layoutRelId) = do\n  -- Parse SmartArt diagram\n  case parseDiagram archive rels dataRelId layoutRelId of\n    Left err -> do\n      -- Failed to parse diagram, return placeholder\n      return [Para [Str $ \"[Diagram parse error: \" <> err <> \"]\"]]\n    Right diagram ->\n      return $ diagramToBlocks diagram\nshapeToBlocks _archive _rels (PptxGraphic text) =\n  -- Placeholder for other graphics (charts, etc.)\n  return [Para [Str $ \"[Graphic: \" <> text <> \"]\"]]\n\n-- | Resolve media path (handle relative paths)\nresolveMediaPath :: Text -> Text\nresolveMediaPath target =\n  if \"../media/\" `T.isPrefixOf` target\n    then \"ppt/media/\" <> T.drop 9 target  -- \"../media/\" = 9 chars\n    else if \"media/\" `T.isPrefixOf` target\n      then \"ppt/\" <> target\n      else target\n\n-- | Load media file from archive\nloadMediaFromArchive :: Archive -> Text -> Maybe B.ByteString\nloadMediaFromArchive archive path =\n  case findEntryByPath (T.unpack path) archive of\n    Just entry -> Just $ fromEntry entry\n    Nothing -> Nothing\n\n-- | Parse paragraphs from text box\nparseParagraphs :: NameSpaces -> Element -> [PptxParagraph]\nparseParagraphs ns txBody =\n  let pElems = findChildrenByName ns \"a\" \"p\" txBody\n   in map (parseParagraph ns) pElems\n\n-- | Parse individual paragraph\nparseParagraph :: NameSpaces -> Element -> PptxParagraph\nparseParagraph ns pElem =\n  let level = parseBulletLevel ns pElem\n      bullet = detectBulletType ns pElem\n      text = extractParagraphText ns pElem\n   in PptxParagraph level bullet text\n\n-- | Parse bullet level from paragraph properties\nparseBulletLevel :: NameSpaces -> Element -> Int\nparseBulletLevel ns pElem =\n  case findChildByName ns \"a\" \"pPr\" pElem >>=\n       findAttr (unqual \"lvl\") >>=\n       (\\s -> readMaybe (T.unpack s) :: Maybe Int) of\n    Just lvl -> lvl\n    Nothing -> 0  -- Default to level 0\n\n-- | Detect bullet type\ndetectBulletType :: NameSpaces -> Element -> BulletType\ndetectBulletType ns pElem =\n  -- Check for explicit <a:pPr><a:buChar>\n  case findChildByName ns \"a\" \"pPr\" pElem >>=\n       findChildByName ns \"a\" \"buChar\" of\n    Just _buCharElem -> Bullet\n    Nothing ->\n      -- Check for Wingdings symbol (common in PowerPoint)\n      if hasWingdingsSymbol ns pElem\n        then WingdingsBullet\n        else NoBullet\n\n-- | Check if paragraph starts with Wingdings symbol\nhasWingdingsSymbol :: NameSpaces -> Element -> Bool\nhasWingdingsSymbol ns pElem =\n  let runs = findChildrenByName ns \"a\" \"r\" pElem\n      checkRun r = case findChildByName ns \"a\" \"rPr\" r >>=\n                        findChildByName ns \"a\" \"sym\" of\n                     Just symElem ->\n                       case findAttr (unqual \"typeface\") symElem of\n                         Just typeface -> \"Wingdings\" `T.isInfixOf` typeface\n                         Nothing -> False\n                     Nothing -> False\n   in any checkRun runs\n\n-- | Extract text from paragraph\nextractParagraphText :: NameSpaces -> Element -> Text\nextractParagraphText _ns pElem =\n  -- Find all <a:t> elements and concatenate\n  let textElems = filterElementsName (\\qn -> qName qn == \"t\") pElem\n      texts = map strContent textElems\n   in T.unwords $ filter (not . T.null) texts\n\n-- | Extract text from DrawingML element (finds all <a:t> descendants)\nextractDrawingMLText :: Element -> Text\nextractDrawingMLText el =\n  let textElems = filterElementsName (\\qn -> qName qn == \"t\") el\n      texts = map strContent textElems\n   in T.unwords $ filter (not . T.null) texts\n\n-- | Convert paragraphs to blocks, grouping bullets into lists\nparagraphsToBlocks :: [PptxParagraph] -> [Block]\nparagraphsToBlocks paras =\n  -- If we have multiple paragraphs with bullets, group them\n  let hasBullets = any (\\p -> paraBullet p /= NoBullet) paras\n   in if hasBullets\n      then groupBulletParagraphs paras\n      else map (\\p -> Para [Str $ paraText p]) paras\n\n-- | Group bullet paragraphs into lists\ngroupBulletParagraphs :: [PptxParagraph] -> [Block]\ngroupBulletParagraphs paras =\n  let grouped = groupBy sameBulletLevel paras\n   in concatMap groupToBlock grouped\n  where\n    sameBulletLevel p1 p2 =\n      (paraBullet p1 /= NoBullet) &&\n      (paraBullet p2 /= NoBullet) &&\n      (paraLevel p1 == paraLevel p2)\n\n    groupToBlock :: [PptxParagraph] -> [Block]\n    groupToBlock [] = []\n    groupToBlock ps@(p:_)\n      | paraBullet p /= NoBullet =\n          -- Bullet list\n          let items = map (\\para -> [Plain [Str $ paraText para]]) ps\n           in [BulletList items]\n      | otherwise =\n          -- Plain paragraph\n          map (\\para -> Para [Str $ paraText para]) ps\n\n-- | Check if shape is title placeholder (also used in Slides module)\nisTitlePlaceholder :: NameSpaces -> Element -> Bool\nisTitlePlaceholder ns el =\n  case findChildByName ns \"p\" \"nvSpPr\" el >>=\n       findChildByName ns \"p\" \"nvPr\" >>=\n       findChildByName ns \"p\" \"ph\" of\n    Just phElem ->\n      case findAttr (unqual \"type\") phElem of\n        Just phType -> phType == \"title\" || phType == \"ctrTitle\"\n        Nothing -> False\n    Nothing -> False\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Pptx/Slides.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Pptx.Slides\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nConversion of PPTX slides to Pandoc AST blocks.\n-}\nmodule Text.Pandoc.Readers.Pptx.Slides\n  ( pptxToOutput\n  ) where\n\nimport Codec.Archive.Zip (Archive)\nimport Data.List (find)\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Readers.OOXML.Shared\nimport Text.Pandoc.Readers.Pptx.Parse\nimport Text.Pandoc.Readers.Pptx.Shapes\nimport Text.Pandoc.XML.Light\n\n-- | Convert Pptx intermediate representation to Pandoc AST\npptxToOutput :: PandocMonad m => ReaderOptions -> Pptx -> m (Meta, [Block])\npptxToOutput _opts pptx = do\n  let slides = pptxSlides pptx\n      archive = pptxArchive pptx\n\n  -- Convert each slide to blocks\n  slideBlocks <- concat <$> mapM (slideToBlocks archive) slides\n\n  return (mempty, slideBlocks)\n\n-- | Convert slide to blocks\nslideToBlocks :: PandocMonad m => Archive -> PptxSlide -> m [Block]\nslideToBlocks archive slide = do\n  let SlideId n = slideId slide\n      slideElem = slideElement slide\n      rels = slideRels slide\n      ns = elemToNameSpaces slideElem\n\n      -- Extract title from title placeholder\n      title = extractSlideTitle ns slideElem\n\n      -- Create header\n      slideIdent = \"slide-\" <> T.pack (show n)\n      headerText = if T.null title\n                   then \"Slide \" <> T.pack (show n)\n                   else title\n      header = Header 2 (slideIdent, [], []) [Str headerText]\n\n  -- Parse shapes and convert to blocks\n  case findChildByName ns \"p\" \"cSld\" slideElem >>=\n       findChildByName ns \"p\" \"spTree\" of\n    Nothing -> return [header]\n    Just spTree -> do\n      -- Filter out title placeholder shapes before parsing\n      let allShapeElems = onlyElems $ elContent spTree\n          nonTitleShapeElems = filter (not . isTitlePlaceholder ns) allShapeElems\n          shapes = mapMaybe (parseShape ns) nonTitleShapeElems\n      shapeBlocks <- concat <$> mapM (shapeToBlocks archive rels) shapes\n      return $ header : shapeBlocks\n\n-- | Extract title from title placeholder\nextractSlideTitle :: NameSpaces -> Element -> Text\nextractSlideTitle ns slideElem =\n  case findChildByName ns \"p\" \"cSld\" slideElem >>=\n       findChildByName ns \"p\" \"spTree\" of\n    Nothing -> \"\"\n    Just spTree ->\n      -- Find shape with ph type=\"title\"\n      let shapes = onlyElems $ elContent spTree\n          titleShape = find (isTitlePlaceholder ns) shapes\n       in maybe \"\" extractDrawingMLText titleShape\n\n-- isTitlePlaceholder is imported from Shapes module\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Pptx/SmartArt.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Pptx.SmartArt\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nSmartArt diagram parsing and text extraction for PPTX.\n-}\nmodule Text.Pandoc.Readers.Pptx.SmartArt\n  ( PptxDiagram(..)\n  , parseDiagram\n  , diagramToBlocks\n  ) where\n\nimport Codec.Archive.Zip (Archive, findEntryByPath, fromEntry)\nimport qualified Data.Map.Strict as M\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy.Encoding as TL\nimport Data.Text (Text)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Readers.OOXML.Shared\nimport Text.Pandoc.XML.Light\n\n-- | SmartArt diagram data\ndata PptxDiagram = PptxDiagram\n  { diagramType :: Text               -- Layout type (chevron, cycle, etc.)\n  , diagramNodes :: [(Text, [Text])]  -- (nodeText, childTexts)\n  } deriving (Show)\n\n-- | Parse SmartArt diagram from relationship IDs\nparseDiagram :: Archive\n             -> [(Text, Text)]  -- Slide relationships\n             -> Text            -- data relationship ID\n             -> Text            -- layout relationship ID\n             -> Either Text PptxDiagram\nparseDiagram archive rels dataRelId layoutRelId = do\n  -- Resolve relationships to file paths\n  dataTarget <- maybeToEither (\"Relationship not found: \" <> dataRelId) $\n                lookup dataRelId rels\n  layoutTarget <- maybeToEither (\"Relationship not found: \" <> layoutRelId) $\n                  lookup layoutRelId rels\n\n  -- Resolve relative paths (diagrams are in ../diagrams/ from slides/)\n  let dataPath = resolveDiagramPath dataTarget\n      layoutPath = resolveDiagramPath layoutTarget\n\n  -- Load XML files\n  dataElem <- loadXMLFromArchive archive dataPath\n  layoutElem <- loadXMLFromArchive archive layoutPath\n\n  -- Extract layout type\n  layoutType <- extractLayoutType layoutElem\n\n  -- Extract text nodes with hierarchy\n  nodes <- extractDiagramNodes dataElem\n\n  return $ PptxDiagram layoutType nodes\n\n-- | Resolve diagram path (handle ../diagrams/ relative paths)\nresolveDiagramPath :: Text -> FilePath\nresolveDiagramPath target =\n  if \"../diagrams/\" `T.isPrefixOf` target\n    then \"ppt/diagrams/\" ++ T.unpack (T.drop 12 target)  -- \"../diagrams/\" = 12 chars\n    else T.unpack target\n\n-- | Load XML from archive\nloadXMLFromArchive :: Archive -> FilePath -> Either Text Element\nloadXMLFromArchive archive path =\n  case findEntryByPath path archive of\n    Nothing -> Left $ \"File not found in archive: \" <> T.pack path\n    Just entry ->\n      let xmlBytes = fromEntry entry\n          lazyText = TL.decodeUtf8 xmlBytes\n       in parseXMLElement lazyText\n\n-- | Extract layout type from layout XML\nextractLayoutType :: Element -> Either Text Text\nextractLayoutType layoutElem = do\n  -- Look for uniqueId attribute: \"urn:.../layout/chevron2\"\n  case findAttr (unqual \"uniqueId\") layoutElem of\n    Just uid ->\n      -- Extract last part after last /\n      let layoutName = T.takeWhileEnd (/= '/') uid\n       in Right layoutName\n    Nothing ->\n      -- Fallback: look for title\n      case findChildByName ns \"dgm\" \"title\" layoutElem >>=\n           findAttr (unqual \"val\") of\n        Just title -> Right title\n        Nothing -> Right \"unknown\"\n  where\n    ns = elemToNameSpaces layoutElem\n\n-- | Extract text nodes from diagram data\nextractDiagramNodes :: Element -> Either Text [(Text, [Text])]\nextractDiagramNodes dataElem = do\n  let ns = elemToNameSpaces dataElem\n\n  -- Find point list\n  ptLst <- maybeToEither \"Missing dgm:ptLst\" $\n           findChildByName ns \"dgm\" \"ptLst\" dataElem\n\n  let ptElems = findChildrenByName ns \"dgm\" \"pt\" ptLst\n\n  -- Build node map: modelId → text\n  let nodeMap = M.fromList $ mapMaybe (extractNodeText ns) ptElems\n\n  -- Parse connections\n  let cxnLst = findChildByName ns \"dgm\" \"cxnLst\" dataElem\n      connections = maybe [] (parseConnections ns) cxnLst\n\n  -- Build parent-child map\n  let parentMap = buildParentMap connections\n\n  -- Find parent nodes (nodes that have children)\n  let parentIds = M.keys parentMap\n\n  -- Build hierarchy - only show nodes that are parents\n  -- (children are shown under their parents)\n  let hierarchy = map (buildNodeWithChildren nodeMap parentMap) parentIds\n      -- Filter out nodes with empty text (presentation nodes)\n      validHierarchy = filter (\\(nodeText, _) -> not $ T.null nodeText) hierarchy\n\n  return validHierarchy\n\n-- | Extract text from a point element (returns Nothing if no text)\nextractNodeText :: NameSpaces -> Element -> Maybe (Text, Text)\nextractNodeText ns ptElem = do\n  modelId <- findAttr (unqual \"modelId\") ptElem\n\n  -- Extract text from dgm:t element (which contains a:p/a:r/a:t)\n  let text = case findChildByName ns \"dgm\" \"t\" ptElem of\n        Just tElem ->\n          -- Recursively get ALL text content from all descendants\n          getAllText tElem\n        Nothing -> \"\"\n\n  -- Only return nodes with actual text\n  if T.null (T.strip text)\n    then Nothing\n    else return (modelId, text)\n\n-- | Connection between nodes\ndata Connection = Connection\n  { connType :: Text\n  , connSrc  :: Text\n  , connDest :: Text\n  } deriving (Show)\n\n-- | Parse connections\nparseConnections :: NameSpaces -> Element -> [Connection]\nparseConnections ns cxnLst =\n  let cxnElems = findChildrenByName ns \"dgm\" \"cxn\" cxnLst\n   in mapMaybe (parseConnection ns) cxnElems\n\nparseConnection :: NameSpaces -> Element -> Maybe Connection\nparseConnection _ns cxnElem = do\n  let cxnType = maybe \"\" id $ findAttr (unqual \"type\") cxnElem  -- Empty if no type\n  srcId <- findAttr (unqual \"srcId\") cxnElem\n  destId <- findAttr (unqual \"destId\") cxnElem\n  return $ Connection cxnType srcId destId\n\n-- | Build parent-child map from connections\n-- Use connections WITHOUT a type attribute (these are the data hierarchy)\nbuildParentMap :: [Connection] -> M.Map Text [Text]\nbuildParentMap connections =\n  let dataConnections = filter (\\c -> T.null (connType c)) connections\n   in foldr addConn M.empty dataConnections\n  where\n    addConn conn m = M.insertWith (++) (connSrc conn) [connDest conn] m\n\n-- | Build node with its children\nbuildNodeWithChildren :: M.Map Text Text -> M.Map Text [Text] -> Text -> (Text, [Text])\nbuildNodeWithChildren nodeMap parentMap nodeId =\n  let nodeText = M.findWithDefault \"\" nodeId nodeMap\n      childIds = M.findWithDefault [] nodeId parentMap\n      -- Only include children that have text\n      childTexts = filter (not . T.null) $\n                   map (\\cid -> M.findWithDefault \"\" cid nodeMap) childIds\n   in (nodeText, childTexts)\n\n-- | Convert diagram to Pandoc blocks\ndiagramToBlocks :: PptxDiagram -> [Block]\ndiagramToBlocks diagram =\n  let nodes = diagramNodes diagram\n      layoutType = diagramType diagram\n\n      -- Build content blocks\n      contentBlocks = concatMap nodeToBlocks nodes\n\n   in [Div (\"\", [\"smartart\", layoutType], [(\"layout\", layoutType)])\n           contentBlocks]\n\n-- | Convert node to blocks\nnodeToBlocks :: (Text, [Text]) -> [Block]\nnodeToBlocks (nodeText, childTexts) =\n  if null childTexts\n    then [Para [Strong [Str nodeText]]]\n    else [ Para [Strong [Str nodeText]]\n         , BulletList [[Plain [Str child]] | child <- childTexts]\n         ]\n\n-- | Recursively extract all text from an element and its descendants\ngetAllText :: Element -> Text\ngetAllText el =\n  let textFromContent (Text cdata) = cdData cdata\n      textFromContent (Elem e) = getAllText e\n      textFromContent _ = \"\"\n      texts = map textFromContent (elContent el)\n   in T.unwords $ filter (not . T.null) texts\n\n-- Helper functions\nmaybeToEither :: Text -> Maybe a -> Either Text a\nmaybeToEither err Nothing = Left err\nmaybeToEither _ (Just x) = Right x\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Pptx.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Pptx\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nConversion of PPTX (PowerPoint) documents to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Pptx (readPptx) where\n\nimport qualified Data.ByteString.Lazy as B\nimport qualified Data.Text as T\nimport Codec.Archive.Zip (toArchiveOrFail)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition (Pandoc(..))\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Readers.Pptx.Parse (archiveToPptx)\nimport Text.Pandoc.Readers.Pptx.Slides (pptxToOutput)\n\n-- | Read PPTX file into Pandoc AST\nreadPptx :: PandocMonad m => ReaderOptions -> B.ByteString -> m Pandoc\nreadPptx opts bytes =\n  case toArchiveOrFail bytes of\n    Right archive ->\n      case archiveToPptx archive of\n        Right pptx -> do\n          -- Convert Pptx intermediate to Pandoc AST\n          (meta, blocks) <- pptxToOutput opts pptx\n          return $ Pandoc meta blocks\n\n        Left err ->\n          throwError $ PandocParseError $\n            \"Failed to parse PPTX: \" <> err\n\n    Left err ->\n      throwError $ PandocParseError $\n        \"Failed to unpack PPTX archive: \" <> T.pack err\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/RIS.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.RIS\n   Copyright   : Copyright (C) 2022-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nParses RIS bibliographies into a Pandoc document\nwith empty body and `references` and `nocite` fields\nin the metadata.  A wildcard `nocite` is used so that\nif the document is rendered in another format, the\nentire bibliography will be printed.\n-}\nmodule Text.Pandoc.Readers.RIS\n  ( readRIS\n  )\nwhere\n\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Parsing\nimport Data.Char (isAsciiUpper, isDigit, isSpace, ord, chr)\nimport qualified Data.List as L\nimport Citeproc (Reference(..), ItemId(..), Val(..), Date(..), DateParts(..),\n                 toVariable)\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)\nimport Text.Pandoc.Citeproc.Name (toName, NameOpts(..))\nimport Control.Monad.Except (throwError)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Map as M\nimport Safe (readMay)\n\n-- | Read RIS from an input string and return a Pandoc document.\n-- The document will have only metadata, with an empty body.\n-- The metadata will contain a `references` field with the\n-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.\nreadRIS :: (PandocMonad m, ToSources a)\n        => ReaderOptions -> a -> m Pandoc\nreadRIS _opts inp = do\n  parsed <- readWithM risReferences () inp\n  case parsed of\n    Right refs -> do\n      refs' <- mapM (traverse (return . text)) refs\n      return $\n        setMeta \"nocite\" (cite [Citation {citationId = \"*\"\n                                         , citationPrefix = []\n                                         , citationSuffix = []\n                                         , citationMode = NormalCitation\n                                         , citationNoteNum = 0\n                                         , citationHash = 0}] (str \"[@*]\")) $\n        setMeta \"references\" (map referenceToMetaValue refs') $\n        B.doc mempty\n    Left e       -> throwError e\n\ntype RISParser m = ParsecT Sources () m\n\nrisLine :: PandocMonad m => RISParser m (Text, Text)\nrisLine = do\n  key <- T.pack <$> count 2 (satisfy (\\c -> isAsciiUpper c || isDigit c))\n  _ <- many1 spaceChar\n  char '-'\n  val <- (many1 spaceChar *> anyLine) <|> mempty <$ newline\n  return (key, T.strip val)\n\nrisSeparator :: PandocMonad m => RISParser m ()\nrisSeparator = do\n  try $ string \"ER\"\n  _ <- many1 spaceChar\n  char '-'\n  _ <- anyLine\n  optional blanklines\n\nrisRecord :: PandocMonad m => RISParser m [(Text, Text)]\nrisRecord = manyTill risLine risSeparator\n\nrisRecordToReference :: [(Text, Text)] -> Reference Text\nrisRecordToReference keys = addId $ foldr go defref keys\n where\n   go (key, val) =\n     case key of\n       \"TY\" -> \\ref -> ref{ referenceType =\n          fromMaybe \"misc\" (M.lookup val risTypes) }\n       \"ID\" -> \\ref -> ref{ referenceId = ItemId val }\n       \"VL\" -> addVar \"volume\" val\n       \"KW\" -> \\ref ->\n         ref{ referenceVariables =\n               M.alter (\\x -> case x of\n                           Nothing -> Just $ TextVal val\n                           Just (TextVal kws)\n                                   -> Just (TextVal (kws <> \", \" <> val))\n                           _ -> x)\n               \"keyword\"\n               (referenceVariables ref) }\n       \"PB\" -> addVar \"publisher\" val\n       \"PP\" -> addVar \"publisher-place\" val\n       \"DO\" -> addVar \"DOI\" val\n       \"SP\" -> \\ref ->\n         case M.lookup \"page\" (referenceVariables ref) of\n           Nothing -> addVar \"page\" val ref\n           Just (FancyVal eg) -> addVar \"page\" (val <> eg) ref\n           _ -> ref\n       \"EP\" -> \\ref ->\n         case M.lookup \"page\" (referenceVariables ref) of\n           Nothing -> addVar \"page\" (\"-\" <> val) ref\n           Just (FancyVal eg) -> addVar \"page\" (val <> \"-\" <> eg) ref\n           _ -> ref\n       \"AU\" -> addName \"author\" val\n       \"A1\" -> addName \"author\" val\n       \"ED\" -> addName \"editor\" val\n       \"A2\" -> addName \"editor\" val\n       \"TI\" -> addVar \"title\" val\n       \"T1\" -> addVar \"title\" val\n       \"CT\" -> addVar \"title\" val\n       \"BT\" -> \\ref ->\n         if referenceType ref == \"book\"\n            then addVar \"title\" val ref\n            else addVar \"container-title\" val ref\n       \"JO\" -> addVar \"container-title\" val\n       \"JF\" -> addVar \"container-title\" val\n       \"T2\" -> addVar \"container-title\" val\n       \"ET\" -> addVar \"edition\" val\n       \"NV\" -> addVar \"number-of-volumes\" val\n       \"AB\" -> addVar \"abstract\" val\n       \"PY\" -> addYear \"issued\" val\n       \"Y1\" -> addYear \"issued\" val\n       \"IS\" -> addVar \"issue\" val\n       \"SN\" -> addVar \"ISSN\" val\n       \"LA\" -> addVar \"language\" val\n       \"UR\" -> addVar \"url\" val\n       \"LK\" -> addVar \"url\" val\n       _ -> id -- TODO\n   addVar k v r = r{ referenceVariables =\n                       M.insert (toVariable k) (FancyVal v)\n                       (referenceVariables r) }\n   addName k v r =\n     let new = toName NameOpts{ nameOptsPrefixIsNonDroppingParticle = False\n                              , nameOptsUseJuniorComma = False }\n                . B.toList .  B.text $ v\n         f Nothing   = Just (NamesVal new)\n         f (Just (NamesVal ns)) = Just (NamesVal (new ++ ns))\n         f (Just x) = Just x\n      in r{ referenceVariables =\n              M.alter f k (referenceVariables r) }\n   addYear k v r =\n     let d = DateVal $\n              case readMay (T.unpack v) of\n                Nothing ->\n                  Date { dateParts = []\n                       , dateCirca = False\n                       , dateSeason = Nothing\n                       , dateLiteral = Just v }\n                Just y ->\n                  Date { dateParts = [DateParts [y]]\n                       , dateCirca = False\n                       , dateSeason = Nothing\n                       , dateLiteral = Nothing }\n      in r{ referenceVariables = M.insert k d (referenceVariables r) }\n\n   defref = Reference{\n       referenceId = mempty\n     , referenceType = mempty\n     , referenceDisambiguation = Nothing\n     , referenceVariables = mempty }\n   addId rec =\n     if referenceId rec == mempty\n        then rec{ referenceId = ItemId (authors <> pubdate) }\n        else rec\n   authors = T.intercalate \"_\" $\n               [T.takeWhile (\\c -> c /= ',' && not (isSpace c)) n\n                 | (k, n) <- keys, k == \"AU\" || k == \"A1\"]\n   pubdate = mconcat [\"_\" <> d | (k, d) <- keys, k == \"PY\" || k == \"Y1\"]\n\nrisReferences :: PandocMonad m => RISParser m [Reference Text]\nrisReferences = do\n  recs <- many risRecord\n  spaces\n  eof\n  return $ fixDuplicateIds $ map risRecordToReference recs\n\nfixDuplicateIds :: [Reference Text] -> [Reference Text]\nfixDuplicateIds = reverse . snd . L.foldl' go (mempty, [])\n where\n   go (ids_seen, refs) ref =\n     case M.lookup (referenceId ref) ids_seen of\n       Nothing -> (M.insert (referenceId ref) (ord 'a') ids_seen, ref:refs)\n       Just n  -> (M.insert (referenceId ref) (n+1) ids_seen,\n                     ref{ referenceId =\n                          ItemId . (<> T.singleton (chr n)) . unItemId $\n                           referenceId ref }\n                    : refs)\n\nrisTypes :: M.Map Text Text\nrisTypes = M.fromList\n    [ (\"ABST\", \"article\")\n    , (\"ADVS\", \"motion-picture\")\n    , (\"AGGR\", \"dataset\")\n    , (\"ANCIENT\", \"book\")\n    , (\"ART\", \"graphic\")\n    , (\"BILL\", \"bill\")\n    , (\"BLOG\", \"post-weblog\")\n    , (\"BOOK\", \"book\")\n    , (\"CASE\", \"legal_case\")\n    , (\"CHAP\", \"chapter\")\n    , (\"CHART\", \"graphic\")\n    , (\"CLSWK\", \"book\")\n    , (\"COMP\", \"program\")\n    , (\"CONF\", \"paper-conference\")\n    , (\"CPAPER\", \"paper-conference\")\n    , (\"CTLG\", \"catalog\")\n    , (\"DATA\", \"dataset\")\n    , (\"DBASE\", \"dataset\")\n    , (\"DICT\", \"book\")\n    , (\"EBOOK\", \"book\")\n    , (\"ECHAP\", \"chapter\")\n    , (\"EDBOOK\", \"book\")\n    , (\"EJOUR\", \"article\")\n    , (\"WEB\", \"webpage\")\n    , (\"ENCYC\", \"entry-encyclopedia\")\n    , (\"EQUA\", \"figure\")\n    , (\"FIGURE\", \"figure\")\n    , (\"GEN\", \"entry\")\n    , (\"GOVDOC\", \"report\")\n    , (\"GRANT\", \"report\")\n    , (\"HEAR\", \"report\")\n    , (\"ICOMM\", \"personal_communication\")\n    , (\"INPR\", \"article-journal\")\n    , (\"JFULL\", \"article-journal\")\n    , (\"JOUR\", \"article-journal\")\n    , (\"LEGAL\", \"legal_case\")\n    , (\"MANSCPT\", \"manuscript\")\n    , (\"MAP\", \"map\")\n    , (\"MGZN\", \"article-magazine\")\n    , (\"MPCT\", \"motion-picture\")\n    , (\"MULTI\", \"webpage\")\n    , (\"MUSIC\", \"musical_score\")\n    , (\"NEWS\", \"article-newspaper\")\n    , (\"PAMP\", \"pamphlet\")\n    , (\"PAT\", \"patent\")\n    , (\"PCOMM\", \"personal_communication\")\n    , (\"RPRT\", \"report\")\n    , (\"SER\", \"article\")\n    , (\"SLIDE\", \"graphic\")\n    , (\"SOUND\", \"musical_score\")\n    , (\"STAND\", \"report\")\n    , (\"STAT\", \"legislation\")\n    , (\"THES\", \"thesis\")\n    , (\"UNBILL\", \"bill\")\n    , (\"UNPB\", \"unpublished\")\n    , (\"VIDEO\", \"graphic\") ]\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/RST.hs",
    "content": "{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Readers.RST\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion from reStructuredText to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.RST ( readRST ) where\nimport Control.Arrow (second)\nimport Control.Monad (forM_, guard, liftM, mplus, mzero, when, unless, void)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.Identity (Identity (..))\nimport Data.Char (isHexDigit, isSpace, toUpper, isAlphaNum, generalCategory,\n                  GeneralCategory(OpenPunctuation, InitialQuote, FinalQuote,\n                                  DashPunctuation, OtherSymbol))\nimport Data.List (deleteFirstsBy, elemIndex, nub, partition, sort, transpose)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, maybeToList, isJust, isNothing, catMaybes)\nimport Data.Sequence (ViewR (..), viewr)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Printf (printf)\nimport Text.Pandoc.Builder (Blocks, Inlines, fromList, setMeta, trimInlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class (PandocMonad, readFileFromDirs, fetchItem, getTimestamp)\nimport Text.Pandoc.CSV (CSVOptions (..), defaultCSVOptions, parseCSV)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.ImageSize (lengthToDim, scaleDimension)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Walk (walkM)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Data.Time.Format\nimport System.FilePath (takeDirectory)\n\n-- TODO:\n-- [ ] .. parsed-literal\n\n-- | Parse reStructuredText string and return Pandoc document.\nreadRST :: (PandocMonad m, ToSources a)\n        => ReaderOptions -- ^ Reader options\n        -> a\n        -> m Pandoc\nreadRST opts s = do\n  parsed <- readWithM parseRST def{ stateOptions = opts }\n               (ensureFinalNewlines 2 (toSources s))\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError e\n\ntype RSTParser m = ParsecT Sources ParserState m\n\n--\n-- Constants and data structure definitions\n---\n\nbulletListMarkers :: [Char]\nbulletListMarkers = \"*+-•‣⁃\"\n\nunderlineChars :: [Char]\nunderlineChars = \"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\"\n\n-- treat these as potentially non-text when parsing inline:\nspecialChars :: [Char]\nspecialChars = \"\\\\`|*_<>$:/[]{}()-.\\\"'\\8216\\8217\\8220\\8221\"\n\n--\n-- parsing documents\n--\n\nisHeader :: Int -> Block -> Bool\nisHeader n (Header x _ _) = x == n\nisHeader _ _              = False\n\n-- | Promote all headers in a list of blocks.  (Part of\n-- title transformation for RST.)\npromoteHeaders :: Int -> [Block] -> [Block]\npromoteHeaders num (Header level attr text:rest) =\n    Header (level - num) attr text:promoteHeaders num rest\npromoteHeaders num (other:rest) = other:promoteHeaders num rest\npromoteHeaders _   [] = []\n\n-- | If list of blocks starts with a header (or a header and subheader)\n-- of level that are not found elsewhere, return it as a title and\n-- promote all the other headers.  Also process a definition list right\n-- after the title block as metadata.\ntitleTransform :: ([Block], Meta)  -- ^ list of blocks, metadata\n               -> ([Block], Meta)  -- ^ modified list of blocks, metadata\ntitleTransform (bs, meta) =\n  let (bs', meta') =\n       case bs of\n          (Header 1 _ head1:Header 2 _ head2:rest)\n           | not (any (isHeader 1) rest || any (isHeader 2) rest) -> -- tit/sub\n            (promoteHeaders 2 rest, setMeta \"title\" (fromList head1) $\n              setMeta \"subtitle\" (fromList head2) meta)\n          (Header 1 _ head1:rest)\n           | not (any (isHeader 1) rest) -> -- title only\n            (promoteHeaders 1 rest,\n                setMeta \"title\" (fromList head1) meta)\n          _ -> (bs, meta)\n  in   case bs' of\n          (DefinitionList ds : rest) ->\n            (rest, metaFromDefList ds meta')\n          _ -> (bs', meta')\n\nmetaFromDefList :: [([Inline], [[Block]])] -> Meta -> Meta\nmetaFromDefList ds meta = adjustAuthors $ foldr f meta ds\n where f (k,v) =\n         case v of\n           [[Plain ils]] ->  setMeta (T.toLower (stringify k)) $ MetaInlines ils\n           _ -> setMeta (T.toLower (stringify k)) $ mconcat $ map fromList v\n       adjustAuthors (Meta metamap) = Meta $ M.adjust splitAuthors \"author\"\n                                           $ M.mapKeys (\\k ->\n                                                 if k == \"authors\"\n                                                    then \"author\"\n                                                    else k) metamap\n       splitAuthors (MetaInlines xs)  = MetaList $ map MetaInlines\n                                                 $ splitAuthors' xs\n       splitAuthors x                 = x\n       splitAuthors'                  = map normalizeSpaces .\n                                         splitOnSemi . concatMap factorSemi\n       normalizeSpaces                = reverse . dropWhile isSp . reverse .\n                                         dropWhile isSp\n       isSp Space     = True\n       isSp SoftBreak = True\n       isSp LineBreak = True\n       isSp _         = False\n       splitOnSemi                    = splitBy (==Str \";\")\n       factorSemi (Str \"\")            = []\n       factorSemi (Str s)             = case T.break (==';') s of\n                                          (xs,\"\") -> [Str xs]\n                                          (xs,T.uncons -> Just (';',ys)) -> Str xs : Str \";\" :\n                                            factorSemi (Str ys)\n                                          (xs,ys) -> Str xs :\n                                            factorSemi (Str ys)\n       factorSemi x                   = [x]\n\nparseRST :: PandocMonad m => RSTParser m Pandoc\nparseRST = do\n  standalone <- getOption readerStandalone\n  optional blanklines -- skip blank lines at beginning of file\n  blocks <- B.toList <$> parseBlocks\n  citations <- sort . M.toList . stateCitations <$> getState\n  citationItems <- mapM parseCitation citations\n  let refBlock = [Div (\"citations\",[],[]) $\n                 B.toList $ B.definitionList citationItems | not (null citationItems)]\n  state <- getState\n  let meta = stateMeta state\n  let (blocks', meta') = if standalone\n                            then titleTransform (blocks, meta)\n                            else (blocks, meta)\n  let reversedNotes = stateNotes state\n  updateState $ \\s -> s { stateNotes = reverse reversedNotes }\n  doc <- walkM resolveReferences =<<\n         walkM resolveBlockSubstitutions\n         (Pandoc meta' (blocks' ++ refBlock))\n  reportLogMessages\n  return doc\n\nresolveBlockSubstitutions :: PandocMonad m => Block -> RSTParser m Block\nresolveBlockSubstitutions x@(Para [Link _attr _ (s,_)])\n  | Just ref <- T.stripPrefix \"##SUBST##\" s = do\n          substTable <- stateSubstitutions <$> getState\n          let key@(Key key') = toKey $ stripFirstAndLast ref\n          case M.lookup key substTable of\n               Nothing     -> do\n                 pos <- getPosition\n                 logMessage $ ReferenceNotFound (tshow key') pos\n                 return x\n               Just target -> case\n                 B.toList target of\n                   [bl] -> return bl\n                   bls -> return $ Div nullAttr bls\nresolveBlockSubstitutions x = return x\n\nresolveReferences :: PandocMonad m => Inline -> RSTParser m Inline\nresolveReferences x@(Link _ ils (s,_))\n  | Just ref <- T.stripPrefix \"##REF##\" s = do\n      let isAnonKey (Key (T.uncons -> Just ('_',_))) = True\n          isAnonKey _                                = False\n      state <- getState\n      let keyTable = stateKeys state\n      let anonKeys = sort $ filter isAnonKey $ M.keys keyTable\n      key <-  if ref == \"_\" -- anonymous key\n                then\n                  case anonKeys of\n                    []    -> mzero -- TODO log?\n                    (k:_) -> return k\n                else return $ toKey ref\n      ((src,tit), attr) <- lookupKey [] key\n      -- if anonymous link, remove key so it won't be used again\n      when (isAnonKey key) $ updateState $ \\st ->\n                              st{ stateKeys = M.delete key keyTable }\n      return $ Link attr ils (src, tit)\n  | Just ref <- T.stripPrefix \"##NOTE##\" s = do\n      state <- getState\n      let notes = stateNotes state\n      case lookup ref notes of\n        Nothing   -> do\n          pos <- getPosition\n          logMessage $ ReferenceNotFound ref pos\n          return x\n        Just raw  -> do\n          -- We temporarily empty the note list while parsing the note,\n          -- so that we don't get infinite loops with notes inside notes...\n          -- Note references inside other notes are allowed in reST, but\n          -- not yet in this implementation.\n          updateState $ \\st -> st{ stateNotes = [] }\n          contents <- parseFromString' parseBlocks raw\n          let newnotes = if ref == \"*\" || ref == \"#\" -- auto-numbered\n                            -- delete the note so the next auto-numbered note\n                            -- doesn't get the same contents:\n                            then deleteFirstsBy (==) notes [(ref,raw)]\n                            else notes\n          updateState $ \\st -> st{ stateNotes = newnotes }\n          return $ Note (B.toList contents)\n  | Just ref <- T.stripPrefix \"##SUBST##\" s = do\n          substTable <- stateSubstitutions <$> getState\n          let key@(Key key') = toKey $ stripFirstAndLast ref\n          case M.lookup key substTable of\n               Nothing     -> do\n                 pos <- getPosition\n                 logMessage $ ReferenceNotFound (tshow key') pos\n                 return x\n               Just target -> case\n                 B.toList target of\n                   [Para [t]] -> return t\n                   [Para xs] -> return $ Span nullAttr xs\n                   bls -> return $ Span nullAttr $ blocksToInlines bls\n  | otherwise = return x\nresolveReferences x = return x\n\nparseCitation :: PandocMonad m\n              => (Text, Text) -> RSTParser m (Inlines, [Blocks])\nparseCitation (ref, raw) = do\n  contents <- parseFromString' parseBlocks raw\n  return (B.spanWith (ref, [\"citation-label\"], []) (B.str ref),\n           [contents])\n\n\n--\n-- parsing blocks\n--\n\nparseBlocks :: PandocMonad m => RSTParser m Blocks\nparseBlocks = mconcat <$> manyTill block eof\n\nblock :: PandocMonad m => RSTParser m Blocks\nblock = choice [ codeBlock\n               , blockQuote\n               , fieldList\n               , optionList\n               , referenceKey\n               , noteBlock\n               , citationBlock\n               , directive\n               , anchor\n               , comment\n               , header\n               , hrule\n               , lineBlock     -- must go before definitionList\n               , table\n               , list\n               , lhsCodeBlock\n               , para\n               , mempty <$ blanklines\n               ] <?> \"block\"\n\n--\n-- field list\n--\n\nrawFieldListItem :: Monad m => Int -> RSTParser m (Text, Text)\nrawFieldListItem minIndent = try $ do\n  indent <- length <$> many (char ' ')\n  guard $ indent >= minIndent\n  char ':'\n  name <- many1TillChar (noneOf \"\\n\") (char ':')\n  (void (lookAhead newline)) <|> skipMany1 spaceChar\n  first <- anyLine\n  rest <- option \"\" $ try $ do lookAhead (count indent (char ' ') >> spaceChar)\n                               indentedBlock\n  let raw = (if T.null first then \"\" else first <> \"\\n\") <> rest <>\n            (if T.null first && T.null rest then \"\" else \"\\n\")\n  return (name, raw)\n\nfieldListItem :: PandocMonad m => Int -> RSTParser m (Inlines, [Blocks])\nfieldListItem minIndent = try $ do\n  (name, raw) <- rawFieldListItem minIndent\n  term <- parseInlineFromText name\n  contents <- parseFromString' parseBlocks raw\n  optional blanklines\n  let defn = case B.toList contents of\n                [Para ils] -> [B.plain $ B.fromList ils] -- see #7766\n                _ -> [contents]\n  return (term, defn)\n\nfieldList :: PandocMonad m => RSTParser m Blocks\nfieldList = try $ do\n  indent <- length <$> lookAhead (many spaceChar)\n  items <- many1 $ fieldListItem indent\n  case items of\n     []     -> return mempty\n     items' -> return $ B.definitionList items'\n\noptionList :: PandocMonad m => RSTParser m Blocks\noptionList = B.definitionList <$> many1 optionListItem\n\noptionListItem :: PandocMonad m => RSTParser m (Inlines, [Blocks])\noptionListItem = try $ do\n  opts <- snd <$> withRaw (do\n     let anyOpt = shortOpt <|> longOpt <|> dosOpt\n     anyOpt\n     many $ try (char ',' <* many spaceChar *> anyOpt))\n  -- at least two spaces\n  rawfirst <- try (char ' ' *> many1 (char ' ') *> anyLineNewline)\n                    <|> try (mempty <$ skipMany spaceChar <* newline)\n  bodyElements <- do\n    raw <- option \"\" indentedBlock\n    parseFromString' parseBlocks $ (rawfirst <> raw) <> \"\\n\\n\"\n  optional blanklines\n  pure (B.code opts, [bodyElements])\n\nshortOpt :: PandocMonad m => RSTParser m ()\nshortOpt = try $ do\n  char '-'\n  alphaNum\n  optional $ try (optional (char ' ') *> optArg)\n\noptArg :: PandocMonad m => RSTParser m ()\noptArg = do\n  c <- letter <|> char '<'\n  if c == '<'\n     then void $ manyTill (noneOf \"<>\") (char '>')\n     else skipMany (alphaNum <|> char '_' <|> char '-')\n\nlongOpt :: PandocMonad m => RSTParser m ()\nlongOpt = try $ do\n  char '-'\n  char '-'\n  alphaNum\n  skipMany1 (alphaNum <|> char '-' <|> char '_')\n  optional $ try (oneOf \" =\" *> optArg)\n\ndosOpt :: PandocMonad m => RSTParser m ()\ndosOpt = try $ do\n  char '/'\n  alphaNum <|> char '?'\n  optional $ try (char ' ' *> optArg)\n\n--\n-- line block\n--\n\nlineBlock :: PandocMonad m => RSTParser m Blocks\nlineBlock = try $ do\n  lines' <- lineBlockLines\n  lines'' <- mapM parseInlineFromText lines'\n  return $ B.lineBlock lines''\n\nlineBlockDirective :: PandocMonad m => Text -> RSTParser m Blocks\nlineBlockDirective body = do\n  lines' <- mapM parseInlineFromText $ T.lines $ stripTrailingNewlines body\n  return $ B.lineBlock lines'\n\n--\n-- paragraph block\n--\n\n-- note: paragraph can end in a :: starting a code block\npara :: PandocMonad m => RSTParser m Blocks\npara = try $ do\n  result <- trimInlines . mconcat <$> many1 inline\n  option (B.plain result) $ try $ do\n    newline\n    blanklines\n    case viewr (B.unMany result) of\n         ys :> Str xs | \"::\" `T.isSuffixOf` xs -> do\n              raw <- option mempty codeBlockBody\n              return $ B.para (B.Many ys <> B.str (T.take (T.length xs - 1) xs))\n                         <> raw\n         _ -> return (B.para result)\n\nplain :: PandocMonad m => RSTParser m Blocks\nplain = B.plain . trimInlines . mconcat <$> many1 inline\n\n--\n-- header blocks\n--\n\nheader :: PandocMonad m => RSTParser m Blocks\nheader = doubleHeader <|> singleHeader <?> \"header\"\n\n-- a header with lines on top and bottom\ndoubleHeader :: PandocMonad m => RSTParser m Blocks\ndoubleHeader = do\n  (txt, c) <- doubleHeader'\n  -- check to see if we've had this kind of header before.\n  -- if so, get appropriate level.  if not, add to list.\n  state <- getState\n  let headerTable = stateHeaderTable state\n  let (headerTable',level) = case elemIndex (DoubleHeader c) headerTable of\n        Just ind -> (headerTable, ind + 1)\n        Nothing  -> (headerTable ++ [DoubleHeader c], length headerTable + 1)\n  setState (state { stateHeaderTable = headerTable' })\n  attr@(ident,_,_) <- registerHeader nullAttr txt\n  let key = toKey (stringify txt)\n  updateState $ \\s ->\n    s { stateKeys = M.insert key ((\"#\" <> ident,\"\"), nullAttr) $ stateKeys s }\n  return $ B.headerWith attr level txt\n\ndoubleHeader' :: PandocMonad m => RSTParser m (Inlines, Char)\ndoubleHeader' = try $ do\n  c <- oneOf underlineChars\n  rest <- many (char c)  -- the top line\n  let lenTop = length (c:rest)\n  skipSpaces\n  newline\n  txt <- trimInlines . mconcat <$> many1 (notFollowedBy blankline >> inline)\n  pos <- getPosition\n  let len = sourceColumn pos - 1\n  when (len > lenTop) $ Prelude.fail \"title longer than border\"\n  blankline              -- spaces and newline\n  count lenTop (char c)  -- the bottom line\n  blanklines\n  return (txt, c)\n\n-- a header with line on the bottom only\nsingleHeader :: PandocMonad m => RSTParser m Blocks\nsingleHeader = do\n  (txt, c) <- singleHeader'\n  state <- getState\n  let headerTable = stateHeaderTable state\n  let (headerTable',level) = case elemIndex (SingleHeader c) headerTable of\n        Just ind -> (headerTable, ind + 1)\n        Nothing  -> (headerTable ++ [SingleHeader c], length headerTable + 1)\n  setState (state { stateHeaderTable = headerTable' })\n  attr@(ident,_,_) <- registerHeader nullAttr txt\n  let key = toKey (stringify txt)\n  updateState $ \\s ->\n    s { stateKeys = M.insert key ((\"#\" <> ident,\"\"), nullAttr) $ stateKeys s }\n  return $ B.headerWith attr level txt\n\nsingleHeader' :: PandocMonad m => RSTParser m (Inlines, Char)\nsingleHeader' = try $ do\n  notFollowedBy' whitespace\n  lookAhead $ anyLine >> oneOf underlineChars\n  txt <- trimInlines . mconcat <$> many1 (notFollowedBy blankline >> inline)\n  pos <- getPosition\n  let len = sourceColumn pos - 1\n  blankline\n  c <- oneOf underlineChars\n  count (len - 1) (char c)\n  many (char c)\n  blanklines\n  return (txt, c)\n\n--\n-- hrule block\n--\n\nhrule :: Monad m => ParsecT Sources st m Blocks\nhrule = try $ do\n  chr <- oneOf underlineChars\n  count 3 (char chr)\n  skipMany (char chr)\n  blankline\n  blanklines\n  return B.horizontalRule\n\n--\n-- code blocks\n--\n\n-- read a line indented by a given string\nindentedLine :: (HasReaderOptions st, Monad m)\n             => Int -> ParsecT Sources st m Text\nindentedLine indents = try $ do\n  lookAhead spaceChar\n  gobbleAtMostSpaces indents\n  anyLine\n\n-- one or more indented lines, possibly separated by blank lines.\n-- any amount of indentation will work.\nindentedBlock :: (HasReaderOptions st, Monad m)\n              => ParsecT Sources st m Text\nindentedBlock = try $ do\n  indents <- length <$> lookAhead (many1 spaceChar)\n  lns <- many1 $ try $ do b <- option \"\" blanklines\n                          l <- indentedLine indents\n                          return (b <> l)\n  optional blanklines\n  return $ T.unlines lns\n\nquotedBlock :: Monad m => ParsecT Sources st m Text\nquotedBlock = try $ do\n    quote <- lookAhead $ oneOf \"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\"\n    lns <- many1 $ lookAhead (char quote) >> anyLine\n    optional blanklines\n    return $ T.unlines lns\n\ncodeBlockStart :: Monad m => ParsecT Sources st m Char\ncodeBlockStart = string \"::\" >> blankline >> blankline\n\ncodeBlock :: Monad m => ParsecT Sources ParserState m Blocks\ncodeBlock = try $ codeBlockStart >> codeBlockBody\n\ncodeBlockBody :: Monad m => ParsecT Sources ParserState m Blocks\ncodeBlockBody = do\n  lang <- stateRstHighlight <$> getState\n  try $ B.codeBlockWith (\"\", maybeToList lang, []) . stripTrailingNewlines <$>\n                (indentedBlock <|> quotedBlock)\n\nlhsCodeBlock :: Monad m => RSTParser m Blocks\nlhsCodeBlock = try $ do\n  getPosition >>= guard . (==1) . sourceColumn\n  guardEnabled Ext_literate_haskell\n  optional codeBlockStart\n  lns <- latexCodeBlock <|> birdCodeBlock\n  blanklines\n  return $ B.codeBlockWith (\"\", [\"haskell\",\"literate\"], [])\n         $ T.intercalate \"\\n\" lns\n\nlatexCodeBlock :: Monad m => ParsecT Sources st m [Text]\nlatexCodeBlock = try $ do\n  try (latexBlockLine \"\\\\begin{code}\")\n  many1Till anyLine (try $ latexBlockLine \"\\\\end{code}\")\n where\n  latexBlockLine s = skipMany spaceChar >> string s >> blankline\n\nbirdCodeBlock :: Monad m => ParsecT Sources st m [Text]\nbirdCodeBlock = filterSpace <$> many1 birdTrackLine\n  where filterSpace lns =\n            -- if (as is normal) there is always a space after >, drop it\n            if all (\\ln -> T.null ln || T.take 1 ln == \" \") lns\n               then map (T.drop 1) lns\n               else lns\n\nbirdTrackLine :: Monad m => ParsecT Sources st m Text\nbirdTrackLine = char '>' >> anyLine\n\n--\n-- block quotes\n--\n\nblockQuote :: PandocMonad m => RSTParser m Blocks\nblockQuote = do\n  raw <- indentedBlock\n  -- parse the extracted block, which may contain various block elements:\n  contents <- parseFromString' parseBlocks $ raw <> \"\\n\\n\"\n  return $ B.blockQuote contents\n\n{-\nUnsupported options for include:\ntab-width\nencoding\n-}\n\nincludeDirective :: PandocMonad m\n                 => Text\n                 -> [(Text, Text)]\n                 -> Text\n                 -> RSTParser m Blocks\nincludeDirective top fields body = do\n  let f = T.unpack $ trim top\n  guard $ not $ null f\n  guard $ T.null (trim body)\n  let startLine = lookup \"start-line\" fields >>= safeRead\n  let endLine = lookup \"end-line\" fields >>= safeRead\n  let classes =  maybe [] T.words (lookup \"class\" fields)\n  let ident = maybe \"\" trimr $ lookup \"name\" fields\n  let parser =\n       case lookup \"code\" fields `mplus` lookup \"literal\" fields of\n         Just lang ->\n           (codeblock ident classes fields (trimr lang) False\n            . sourcesToText) <$> getInput\n         Nothing   -> parseBlocks\n  let isLiteral = isJust (lookup \"code\" fields `mplus` lookup \"literal\" fields)\n  let selectLines =\n        (case trim <$> lookup \"end-before\" fields of\n                         Just patt -> takeWhile (not . (patt `T.isInfixOf`))\n                         Nothing   -> id) .\n        (case trim <$> lookup \"start-after\" fields of\n                         Just patt -> drop 1 .\n                                        dropWhile (not . (patt `T.isInfixOf`))\n                         Nothing   -> id)\n\n  let toStream t =\n        Sources [(initialPos f,\n                   (T.unlines . selectLines . T.lines $ t) <>\n                    if isLiteral then mempty else \"\\n\")]  -- see #7436\n  currentDir <- takeDirectory . sourceName <$> getPosition\n  insertIncludedFile parser toStream [currentDir] f startLine endLine\n\n--\n-- list blocks\n--\n\nlist :: PandocMonad m => RSTParser m Blocks\nlist = choice [ bulletList, orderedList, definitionList ] <?> \"list\"\n\ndefinitionListItem :: PandocMonad m => RSTParser m (Inlines, [Blocks])\ndefinitionListItem = try $ do\n  -- avoid capturing a directive or comment\n  notFollowedBy (try $ char '.' >> char '.')\n  term <- trimInlines . mconcat <$> many1Till inline endline\n  raw <- indentedBlock\n  -- parse the extracted block, which may contain various block elements:\n  contents <- parseFromString' parseBlocks $ raw <> \"\\n\"\n  return (term, [contents])\n\ndefinitionList :: PandocMonad m => RSTParser m Blocks\ndefinitionList = B.definitionList <$> many1 definitionListItem\n\n-- parses bullet list start and returns its length (inc. following whitespace)\nbulletListStart :: Monad m => ParsecT Sources st m Int\nbulletListStart = try $ do\n  notFollowedBy' hrule  -- because hrules start out just like lists\n  marker <- oneOf bulletListMarkers\n  white <- many1 spaceChar <|> \"\" <$ lookAhead (char '\\n')\n  return $ length (marker:white)\n\n-- parses ordered list start and returns its length (inc following whitespace)\norderedListStart :: Monad m => ListNumberStyle\n                 -> ListNumberDelim\n                 -> RSTParser m Int\norderedListStart style delim = try $ do\n  (_, markerLen) <- withHorizDisplacement (orderedListMarker style delim)\n  white <- many1 spaceChar <|> \"\" <$ lookAhead (char '\\n')\n  return $ markerLen + length white\n\n-- parse a line of a list item\nlistLine :: Monad m => Int -> RSTParser m Text\nlistLine markerLength = try $ do\n  notFollowedBy blankline\n  indentWith markerLength\n  anyLineNewline\n\n-- parse raw text for one list item, excluding start marker and continuations\nrawListItem :: Monad m => RSTParser m Int\n            -> RSTParser m (Int, Text)\nrawListItem start = try $ do\n  markerLength <- start\n  firstLine <- anyLineNewline\n  restLines <- many (listLine markerLength)\n  return (markerLength, firstLine <> T.concat restLines)\n\n-- continuation of a list item - indented and separated by blankline or\n-- (in compact lists) endline.\n-- Note: nested lists are parsed as continuations.\nlistContinuation :: Monad m => Int -> RSTParser m Text\nlistContinuation markerLength = try $ do\n  blanks <- many1Char blankline\n  result <- many1 (listLine markerLength)\n  return $ blanks <> T.concat result\n\nlistItem :: PandocMonad m\n         => RSTParser m Int\n         -> RSTParser m Blocks\nlistItem start = try $ do\n  (markerLength, first) <- rawListItem start\n  rest <- many (listContinuation markerLength)\n  skipMany1 blankline <|> void (lookAhead start)\n  -- parsing with ListItemState forces markers at beginning of lines to\n  -- count as list item markers, even if not separated by blank space.\n  -- see definition of \"endline\"\n  state <- getState\n  let oldContext = stateParserContext state\n  setState $ state {stateParserContext = ListItemState}\n  -- parse the extracted block, which may itself contain block elements\n  parsed <- parseFromString' parseBlocks $ T.concat (first:rest) <> \"\\n\"\n  updateState (\\st -> st {stateParserContext = oldContext})\n  return $ case B.toList parsed of\n                [Para xs] ->\n                   B.singleton $ Plain xs\n                [Para xs, BulletList ys] ->\n                   B.fromList [Plain xs, BulletList ys]\n                [Para xs, OrderedList s ys] ->\n                   B.fromList [Plain xs, OrderedList s ys]\n                [Para xs, DefinitionList ys] ->\n                   B.fromList [Plain xs, DefinitionList ys]\n                _         -> parsed\n\norderedList :: PandocMonad m => RSTParser m Blocks\norderedList = try $ do\n  (start, style, delim) <- lookAhead (anyOrderedListMarker <* spaceChar)\n  items <- many1 (listItem (orderedListStart style delim))\n  let items' = compactify items\n  return $ B.orderedListWith (start, style, delim) items'\n\nbulletList :: PandocMonad m => RSTParser m Blocks\nbulletList = B.bulletList . compactify <$> many1 (listItem bulletListStart)\n\n--\n-- directive (e.g. comment, container, compound-paragraph)\n--\n\ncomment :: Monad m => RSTParser m Blocks\ncomment = try $ do\n  string \"..\"\n  skipMany1 spaceChar <|> void (lookAhead newline)\n  -- notFollowedBy' directiveLabel -- comment comes after directive so unnec.\n  _ <- anyLine\n  optional indentedBlock\n  optional blanklines\n  return mempty\n\ndirectiveLabel :: Monad m => RSTParser m Text\ndirectiveLabel = T.toLower\n  <$> many1TillChar (letter <|> char '-') (try $ string \"::\")\n\ndirective :: PandocMonad m => RSTParser m Blocks\ndirective = try $ do\n  string \"..\"\n  directive'\n\ndirective' :: PandocMonad m => RSTParser m Blocks\ndirective' = do\n  skipMany1 spaceChar\n  label <- directiveLabel\n  skipMany spaceChar\n  top <- manyChar $ satisfy (/='\\n')\n             <|> try (char '\\n' <*\n                      notFollowedBy' (rawFieldListItem 1) <*\n                      many1 (char ' ') <*\n                      notFollowedBy blankline)\n  newline\n  fields <- do\n    fieldIndent <- length <$> lookAhead (many (char ' '))\n    if fieldIndent == 0\n       then return []\n       else many $ rawFieldListItem fieldIndent\n  let mbfile = trim <$> lookup \"file\" fields\n  body <- case mbfile of\n            Just f | label == \"raw\" -> do\n               currentDir <- takeDirectory . sourceName <$> getPosition\n               fromMaybe mempty <$> readFileFromDirs [currentDir] (T.unpack f)\n            _ -> option \"\" $ try $ blanklines >> indentedBlock\n  optional blanklines\n  let body' = body <> \"\\n\\n\"\n      name = trim $ fromMaybe \"\" (lookup \"name\" fields)\n      classes = T.words $ maybe \"\" trim (lookup \"class\" fields)\n      keyvals = [(k, trim v) | (k, v) <- fields, k /= \"name\", k /= \"class\"]\n      imgAttr cl = (name, classes, alignClasses, widthAttr ++ heightAttr)\n        where\n          alignClasses = T.words $ maybe \"\" trim (lookup cl fields) <>\n                          maybe \"\" (\\x -> \"align-\" <> trim x)\n                          (lookup \"align\" fields)\n          scale = case trim <$> lookup \"scale\" fields of\n                    Just v -> case T.unsnoc v of\n                      Just (vv, '%') -> case safeRead vv of\n                                          Just (percent :: Double)\n                                            -> percent / 100.0\n                                          Nothing -> 1.0\n                      _ -> case safeRead v of\n                             Just (s :: Double) -> s\n                             Nothing            -> 1.0\n                    Nothing -> 1.0\n          widthAttr = maybe [] (\\x -> [(\"width\",\n                                        tshow $ scaleDimension scale x)])\n                        $ lookup \"width\" fields >>=\n                          (lengthToDim . T.filter (not . isSpace))\n          heightAttr = maybe [] (\\x -> [(\"height\",\n                                         tshow $ scaleDimension scale x)])\n                        $ lookup \"height\" fields >>=\n                          (lengthToDim . T.filter (not . isSpace))\n  case label of\n        \"include\" -> includeDirective top fields body'\n        \"table\" -> tableDirective top fields body'\n        \"list-table\" -> listTableDirective top fields body'\n        \"csv-table\" -> csvTableDirective top fields body'\n        \"line-block\" -> lineBlockDirective body'\n        \"raw\" -> return $ B.rawBlock (trim top) (stripTrailingNewlines body)\n        \"role\" -> addNewRole top $ map (second trim) fields\n        \"container\" -> B.divWith\n                         (name, \"container\" : T.words top ++ classes, []) <$>\n                          parseFromString' parseBlocks body'\n        \"replace\" -> B.para <$>  -- consumed by substKey\n                   parseInlineFromText (trim top)\n        \"date\" -> B.para <$> do  -- consumed by substKey\n                     t <- getTimestamp\n                     let format = case T.unpack (T.strip top) of\n                                    [] -> \"%Y-%m-%d\"\n                                    x  -> x\n                     return $ B.text $\n                              T.pack $ formatTime defaultTimeLocale format t\n        \"unicode\" -> B.para <$>  -- consumed by substKey\n                   parseInlineFromText (trim $ unicodeTransform top)\n        \"compound\" -> parseFromString' parseBlocks body'\n        \"pull-quote\" -> B.blockQuote <$> parseFromString' parseBlocks body'\n        \"epigraph\" -> B.blockQuote <$> parseFromString' parseBlocks body'\n        \"highlights\" -> B.blockQuote <$> parseFromString' parseBlocks body'\n        \"rubric\" -> B.para . B.strong <$> parseInlineFromText top\n        _ | label `elem` [\"attention\",\"caution\",\"danger\",\"error\",\"hint\",\n                          \"important\",\"note\",\"tip\",\"warning\",\"admonition\"] ->\n           do bod <- parseFromString' parseBlocks $ top <> \"\\n\\n\" <> body'\n              let lab = case label of\n                          \"admonition\" -> mempty\n                          (T.uncons -> Just (l, ls))\n                            -> B.divWith (\"\",[\"title\"],[])\n                                          (B.para (B.str $ T.cons (toUpper l)  ls))\n                          _ -> mempty\n              return $ B.divWith (name,label:classes,keyvals) (lab <> bod)\n        \"sidebar\" ->\n           do let subtit = maybe \"\" trim $ lookup \"subtitle\" fields\n              tit <- B.para . B.strong <$> parseInlineFromText\n                          (trim top <> if T.null subtit\n                                          then \"\"\n                                          else \":  \" <> subtit)\n              bod <- parseFromString' parseBlocks body'\n              return $ B.divWith (name,\"sidebar\":classes,keyvals) $ tit <> bod\n        \"topic\" ->\n           do tit <- B.para . B.strong <$> parseInlineFromText top\n              bod <- parseFromString' parseBlocks body'\n              return $ B.divWith (name,\"topic\":classes,keyvals) $ tit <> bod\n        \"default-role\" -> mempty <$ updateState (\\s ->\n                              s { stateRstDefaultRole =\n                                  case trim top of\n                                     \"\"   -> stateRstDefaultRole def\n                                     role -> role })\n        \"highlight\" -> mempty <$ updateState (\\s ->\n                              s { stateRstHighlight =\n                                  case trim top of\n                                     \"\"   -> stateRstHighlight def\n                                     lang -> Just lang })\n        x | x == \"code\" || x == \"code-block\" || x == \"sourcecode\" ->\n          return $ codeblock name classes (map (second trimr) fields)\n             (trim top) True body\n        \"aafig\" -> do\n          let attribs = (name, [\"aafig\"], map (second trimr) fields)\n          return $ B.codeBlockWith attribs $ stripTrailingNewlines body\n        \"math\" -> return $ B.para\n                  $ (case mkAttr name classes fields of\n                       attr | attr == nullAttr -> id\n                            | otherwise        -> B.spanWith attr)\n                  $ mconcat $ map B.displayMath\n                  $ toChunks $ top <> \"\\n\\n\" <> body\n        \"figure\" -> do\n           (caption, legend) <- parseFromString' extractCaption body'\n           let src = escapeURI $ trim top\n           let (imgident, imgcls, aligncls, imgkvs) = imgAttr \"class\"\n           let (figclasskv, _) = partition ((== \"figclass\") . fst) keyvals\n           let figcls = concatMap (T.words . snd) figclasskv\n           let figattr = (\"\", figcls ++ aligncls, [])\n           let capt = B.caption Nothing (B.plain caption <> legend)\n           let alt = maybe caption (B.text . trim) (lookup \"alt\" fields)\n           return $ B.figureWith figattr capt $\n             B.plain (B.imageWith (imgident, imgcls, imgkvs) src \"\" alt)\n        \"image\" -> do\n           let src = escapeURI $ trim top\n           let alt = B.str $ maybe \"image\" trim $ lookup \"alt\" fields\n           let attr = (ident, cls ++ align, dims) where\n                 (ident, cls, align, dims) = imgAttr \"class\"\n           return $ B.para\n                  $ case lookup \"target\" fields of\n                          Just t  -> B.link (escapeURI $ trim t) \"\"\n                                     $ B.imageWith attr src \"\" alt\n                          Nothing -> B.imageWith attr src \"\" alt\n        \"bibliography\" -> pure $ B.divWith (\"refs\",[],[]) mempty\n        \"class\" -> do\n            let attrs = (name, T.words (trim top), map (second trimr) fields)\n            --  directive content or the first immediately following element\n            children <- case body of\n                \"\" -> block\n                _  -> parseFromString' parseBlocks  body'\n            return $\n              case B.toList children of\n                [Header lev attrs' ils]\n                  | T.null body -> -- # see #6699\n                     B.headerWith (attrs' <> attrs) lev (B.fromList ils)\n                _ -> B.divWith attrs children\n        other     -> do\n            pos <- getPosition\n            logMessage $ SkippedContent (\".. \" <> other) pos\n            bod <- parseFromString' parseBlocks $ top <> \"\\n\\n\" <> body'\n            return $ B.divWith (name, other:classes, keyvals) bod\n\ntableDirective :: PandocMonad m\n               => Text -> [(Text, Text)] -> Text -> RSTParser m Blocks\ntableDirective top fields body = do\n  bs <- parseFromString' parseBlocks body\n  case B.toList bs of\n       [Table attr _ tspecs' thead@(TableHead _ thrs) tbody tfoot] -> do\n         let (aligns', widths') = unzip tspecs'\n         title <- parseFromString' (trimInlines . mconcat <$> many inline) top\n         columns <- getOption readerColumns\n         let numOfCols = case thrs of\n               [] -> 0\n               (r:_) -> rowLength r\n         let normWidths ws =\n                strictPos . (/ max 1.0 (fromIntegral (columns - numOfCols))) <$> ws\n         let widths = case trim <$> lookup \"widths\" fields of\n                           Just \"auto\" -> replicate numOfCols ColWidthDefault\n                           Just \"grid\" -> widths'\n                           Just specs -> normWidths\n                               $ map (fromMaybe (0 :: Double) . safeRead)\n                               $ splitTextBy (`elem` (\" ,\" :: String)) specs\n                           Nothing -> widths'\n         -- align is not applicable since we can't represent whole table align\n         let tspecs = zip aligns' widths\n         return $ B.singleton $ Table attr (B.caption Nothing (B.plain title))\n                                  tspecs thead tbody tfoot\n       _ -> do\n         pos <- getPosition\n         logMessage $ SkippedContent body pos\n         return mempty\n  where\n    -- only valid on the very first row of a table section\n    rowLength (Row _ rb) = sum $ cellLength <$> rb\n    cellLength (Cell _ _ _ (ColSpan w) _) = max 1 w\n    strictPos w\n      | w > 0     = ColWidth w\n      | otherwise = ColWidthDefault\n\n-- TODO: :stub-columns:.\n-- Only the first row becomes the header even if header-rows: > 1,\n-- since Pandoc doesn't support a table with multiple header rows.\n-- We don't need to parse :align: as it represents the whole table align.\nlistTableDirective :: PandocMonad m\n                   => Text -> [(Text, Text)] -> Text\n                   -> RSTParser m Blocks\nlistTableDirective top fields body = do\n  bs <- parseFromString' parseBlocks body\n  title <- parseFromString' (trimInlines . mconcat <$> many inline) top\n  let rows = takeRows $ B.toList bs\n      headerRowsNum = fromMaybe (0 :: Int) $\n         lookup \"header-rows\" fields >>= safeRead\n      (headerRow,bodyRows,numOfCols) = case rows of\n        x:xs -> if headerRowsNum > 0\n                   then (x, xs, length x)\n                   else ([], rows, length x)\n        _ -> ([],[],0)\n      widths = case trim <$> lookup \"widths\" fields of\n        Just \"auto\" -> replicate numOfCols ColWidthDefault\n        Just specs -> normWidths $ map (fromMaybe (0 :: Double) . safeRead) $\n                           splitTextBy (`elem` (\" ,\" :: String)) specs\n        _ -> replicate numOfCols ColWidthDefault\n      toRow = Row nullAttr . map B.simpleCell\n      toHeaderRow l = [toRow l | not (null l)]\n  return $ B.table (B.simpleCaption $ B.plain title)\n             (zip (replicate numOfCols AlignDefault) widths)\n             (TableHead nullAttr $ toHeaderRow headerRow)\n             [TableBody nullAttr 0 [] $ map toRow bodyRows]\n             (TableFoot nullAttr [])\n    where takeRows [BulletList rows] = map takeCells rows\n          takeRows _                 = []\n          takeCells [BulletList cells] = map B.fromList cells\n          takeCells _                  = []\n          normWidths ws = strictPos . (/ max 1 (sum ws)) <$> ws\n          strictPos w\n            | w > 0     = ColWidth w\n            | otherwise = ColWidthDefault\n\ncsvTableDirective :: PandocMonad m\n                   => Text -> [(Text, Text)] -> Text\n                   -> RSTParser m Blocks\ncsvTableDirective top fields rawcsv = do\n  let explicitHeader = trim <$> lookup \"header\" fields\n  let opts = defaultCSVOptions{\n                csvDelim = case trim <$> lookup \"delim\" fields of\n                                Just \"tab\"   -> '\\t'\n                                Just \"space\" -> ' '\n                                Just (T.unpack -> [c])\n                                             -> c\n                                _            -> ','\n              , csvQuote = case trim <$> lookup \"quote\" fields of\n                                Just (T.unpack -> [c])\n                                  -> Just c\n                                _ -> Just '\"'\n              , csvEscape = case trim <$> lookup \"escape\" fields of\n                                Just (T.unpack -> [c])\n                                  -> Just c\n                                _ -> Nothing\n              , csvKeepSpace = case trim <$> lookup \"keepspace\" fields of\n                                       Just \"true\" -> True\n                                       _           -> False\n              }\n  let headerRowsNum = fromMaybe (case explicitHeader of\n                                       Just _  -> 1 :: Int\n                                       Nothing -> 0 :: Int) $\n           lookup \"header-rows\" fields >>= safeRead\n  rawcsv' <- case trim <$>\n                    lookup \"file\" fields `mplus` lookup \"url\" fields of\n                  Just u  -> do\n                    (bs, _) <- fetchItem u\n                    return $ UTF8.toText bs\n                  Nothing -> return rawcsv\n  let header' = case explicitHeader of\n                  Just h  -> parseCSV defaultCSVOptions h\n                  Nothing -> Right []\n  let res = parseCSV opts rawcsv'\n  case (<>) <$> header' <*> res of\n       Left e  ->\n         throwError $ fromParsecError (toSources rawcsv') e\n       Right rawrows -> do\n         let parseRow = mapM parseCell\n         rows <- mapM parseRow rawrows\n         let (headerRow,bodyRows,numOfCols) =\n              case rows of\n                   x:xs -> if headerRowsNum > 0\n                          then (x, xs, length x)\n                          else ([], rows, length x)\n                   _ -> ([],[],0)\n         title <- parseFromString' (trimInlines . mconcat <$> many inline) top\n         let strictPos w\n               | w > 0     = ColWidth w\n               | otherwise = ColWidthDefault\n         let normWidths ws = strictPos . (/ max 1 (sum ws)) <$> ws\n         let widths =\n               case trim <$> lookup \"widths\" fields of\n                 Just \"auto\" -> replicate numOfCols ColWidthDefault\n                 Just specs -> normWidths\n                               $ map (fromMaybe (0 :: Double) . safeRead)\n                               $ splitTextBy (`elem` (\" ,\" :: String)) specs\n                 _ -> replicate numOfCols ColWidthDefault\n         let toRow = Row nullAttr . map B.simpleCell\n             toHeaderRow l = [toRow l | not (null l)]\n         return $ B.table (B.simpleCaption $ B.plain title)\n                          (zip (replicate numOfCols AlignDefault) widths)\n                          (TableHead nullAttr $ toHeaderRow headerRow)\n                          [TableBody nullAttr 0 [] $ map toRow bodyRows]\n                          (TableFoot nullAttr [])\n\nsingleParaToPlain :: Blocks -> Blocks\nsingleParaToPlain bs =\n  case B.toList bs of\n    [Para ils] -> B.fromList [Plain ils]\n    _          -> bs\n\nparseCell :: PandocMonad m => Text -> RSTParser m Blocks\nparseCell t = singleParaToPlain\n   <$> parseFromString' parseBlocks (trim t <> \"\\n\\n\")\n\n\n-- TODO:\n--  - Only supports :format: fields with a single format for :raw: roles,\n--    change Text.Pandoc.Definition.Format to fix\naddNewRole :: PandocMonad m\n           => Text -> [(Text, Text)] -> RSTParser m Blocks\naddNewRole roleText fields = do\n    pos <- getPosition\n    (role, parentRole) <- parseFromString' inheritedRole roleText\n    customRoles <- stateRstCustomRoles <$> getState\n    let getBaseRole (r, f, a) roles =\n            case M.lookup r roles of\n                 Just (r', f', a') -> getBaseRole (r', f', a') roles\n                 Nothing           -> (r, f, a)\n        (baseRole, baseFmt, baseAttr) =\n               getBaseRole (parentRole, Nothing, nullAttr) customRoles\n        fmt = if parentRole == \"raw\" then lookup \"format\" fields else baseFmt\n\n        updateClasses :: [Text] -> [Text]\n        updateClasses oldClasses = let\n\n          codeLanguageClass = if baseRole == \"code\"\n            then maybeToList (lookup \"language\" fields)\n            else []\n\n          -- if no \":class:\" field is given, the default is the role name\n          classFieldClasses = maybe [role] T.words (lookup \"class\" fields)\n\n          -- nub in case role name & language class are the same\n          in nub (classFieldClasses ++ codeLanguageClass ++ oldClasses)\n\n        attr = let (ident, baseClasses, keyValues) = baseAttr\n               in (ident, updateClasses baseClasses, keyValues)\n\n    -- warn about syntax we ignore\n    forM_ fields $ \\(key, _) -> case key of\n                 \"language\" -> when (baseRole /= \"code\") $ logMessage $\n                     SkippedContent \":language: [because parent of role is not :code:]\"\n                        pos\n                 \"format\" -> when (baseRole /= \"raw\") $ logMessage $\n                     SkippedContent \":format: [because parent of role is not :raw:]\" pos\n                 _ -> logMessage $ SkippedContent (\":\" <> key <> \":\") pos\n    when (parentRole == \"raw\" && countKeys \"format\" > 1) $\n        logMessage $ SkippedContent\n                  \":format: [after first in definition of role]\"\n                  pos\n    when (parentRole == \"code\" && countKeys \"language\" > 1) $\n        logMessage $ SkippedContent\n          \":language: [after first in definition of role]\" pos\n\n    updateState $ \\s -> s {\n        stateRstCustomRoles =\n          M.insert role (baseRole, fmt, attr) customRoles\n    }\n\n    return mempty\n  where\n    countKeys k = length . filter (== k) . map fst $ fields\n    inheritedRole =\n        (,) <$> roleName <*> ((char '(' *> roleName <* char ')')\n                            <|> pure \"span\")\n\n\n-- Can contain character codes as decimal numbers or\n-- hexadecimal numbers, prefixed by 0x, x, \\x, U+, u, or \\u\n-- or as XML-style hexadecimal character entities, e.g. &#x1a2b;\n-- or text, which is used as-is.  Comments start with ..\nunicodeTransform :: Text -> Text\nunicodeTransform t\n  | Just xs <- T.stripPrefix \"..\" t  = unicodeTransform $ T.dropWhile (/= '\\n') xs -- comment\n  | Just xs <- T.stripPrefix \"0x\" t  = go \"0x\" xs\n  | Just xs <- T.stripPrefix \"x\" t   = go \"x\" xs\n  | Just xs <- T.stripPrefix \"\\\\x\" t = go \"\\\\x\" xs\n  | Just xs <- T.stripPrefix \"U+\" t  = go \"U+\" xs\n  | Just xs <- T.stripPrefix \"u\" t   = go \"u\" xs\n  | Just xs <- T.stripPrefix \"\\\\u\" t = go \"\\\\u\" xs\n  | Just xs <- T.stripPrefix \"&#x\" t = maybe (\"&#x\" <> unicodeTransform xs)\n                                       -- drop semicolon\n                                       (\\(c,s) -> T.cons c $ unicodeTransform $ T.drop 1 s)\n                                       $ extractUnicodeChar xs\n  | Just (x, xs) <- T.uncons t       = T.cons x $ unicodeTransform xs\n  | otherwise                        = \"\"\n  where go pref zs = maybe (pref <> unicodeTransform zs)\n                     (\\(c,s) -> T.cons c $ unicodeTransform s)\n                     $ extractUnicodeChar zs\n\nextractUnicodeChar :: Text -> Maybe (Char, Text)\nextractUnicodeChar s = fmap (\\c -> (c,rest)) mbc\n  where (ds,rest) = T.span isHexDigit s\n        mbc = safeRead (\"'\\\\x\" <> ds <> \"'\")\n\nextractCaption :: PandocMonad m => RSTParser m (Inlines, Blocks)\nextractCaption = do\n  capt <- trimInlines . mconcat <$> many inline\n  legend <- optional blanklines >> (mconcat <$> many block)\n  return (capt,legend)\n\n-- divide string by blanklines, and surround with\n-- \\begin{aligned}...\\end{aligned} if needed.\ntoChunks :: Text -> [Text]\ntoChunks = dropWhile T.null\n           . map (addAligned . trim . T.unlines)\n           . splitBy (T.all (`elem` (\" \\t\" :: String))) . T.lines\n  -- we put this in an aligned environment if it contains \\\\, see #4254\n  where addAligned s = if \"\\\\\\\\\" `T.isInfixOf` s\n                          then \"\\\\begin{aligned}\\n\" <> s <> \"\\n\\\\end{aligned}\"\n                          else s\n\ncodeblock :: Text -> [Text] -> [(Text, Text)] -> Text -> Bool -> Text\n          -> Blocks\ncodeblock ident classes fields lang rmTrailingNewlines body =\n  B.codeBlockWith attribs $ stripTrailingNewlines' body\n    where stripTrailingNewlines' = if rmTrailingNewlines\n                                     then stripTrailingNewlines\n                                     else id\n          attribs = (ident, classes', kvs)\n          classes' = lang\n                    : [\"numberLines\" | isJust (lookup \"number-lines\" fields)]\n                    ++ classes\n          kvs = [(k,v) | (k,v) <- fields, k /= \"number-lines\", k /= \"class\",\n                                          k /= \"id\", k /= \"name\"]\n                ++ case lookup \"number-lines\" fields of\n                     Just v | not (T.null v) -> [(\"startFrom\", v)]\n                     _ -> []\n\n-- | Creates element attributes from a name, list of classes, and fields.\n-- Removes fields named @name@, @id@, or @class@.\nmkAttr :: Text -> [Text] -> [(Text, Text)] -> Attr\nmkAttr ident classes fields = (ident, classes, fields')\n  where fields' = [(k, v') | (k, v) <- fields\n                           , let v' = trimr v\n                           , k /= \"name\", k /= \"id\", k /= \"class\"]\n\n---\n--- note block\n---\n\nnoteBlock :: Monad m => RSTParser m Blocks\nnoteBlock = try $ do\n  (ref, raw) <- noteBlock' noteMarker\n  updateState $ \\s -> s { stateNotes = (ref, raw) : stateNotes s }\n  return mempty\n\ncitationBlock :: Monad m => RSTParser m Blocks\ncitationBlock = try $ do\n  (ref, raw) <- noteBlock' citationMarker\n  updateState $ \\s ->\n     s { stateCitations = M.insert ref raw (stateCitations s),\n         stateKeys = M.insert (toKey ref) ((\"#\" <> ref,\"\"), (\"\",[\"citation\"],[]))\n                               (stateKeys s) }\n  return mempty\n\nnoteBlock' :: Monad m\n           => RSTParser m Text -> RSTParser m (Text, Text)\nnoteBlock' marker = try $ do\n  string \"..\"\n  spaceChar >> skipMany spaceChar\n  ref <- marker\n  first <- (spaceChar >> skipMany spaceChar >> anyLine)\n        <|> (newline >> return \"\")\n  blanks <- option \"\" blanklines\n  rest <- option \"\" indentedBlock\n  let raw = first <> \"\\n\" <> blanks <> rest <> \"\\n\"\n  return (ref, raw)\n\ncitationMarker :: Monad m => RSTParser m Text\ncitationMarker = do\n  char '['\n  res <- simpleReferenceName\n  char ']'\n  return res\n\nnoteMarker :: Monad m => RSTParser m Text\nnoteMarker = do\n  char '['\n  res <- many1Char digit\n      <|>\n                  try (char '#' >> liftM (\"#\" <>) simpleReferenceName)\n      <|> countChar 1 (oneOf \"#*\")\n  char ']'\n  return res\n\n--\n-- reference key\n--\n\nquotedReferenceName :: PandocMonad m => RSTParser m Text\nquotedReferenceName = try $ do\n  char '`' >> notFollowedBy (char '`') -- `` means inline code!\n  manyTillChar anyChar (char '`')\n\n-- Simple reference names are single words consisting of alphanumerics\n-- plus isolated (no two adjacent) internal hyphens, underscores,\n-- periods, colons and plus signs; no whitespace or other characters\n-- are allowed.\nsimpleReferenceName :: Monad m => ParsecT Sources st m Text\nsimpleReferenceName = do\n  x <- alphaNum\n  xs <- many $  alphaNum\n            <|> try (oneOf \"-_:+.\" <* lookAhead alphaNum)\n  return $ T.pack (x:xs)\n\nreferenceName :: PandocMonad m => RSTParser m Text\nreferenceName = quotedReferenceName <|> simpleReferenceName\n\nreferenceKey :: PandocMonad m => RSTParser m Blocks\nreferenceKey = do\n  choice [substKey, anonymousKey, regularKey]\n  optional blanklines\n  return mempty\n\ntargetURI :: Monad m => ParsecT Sources st m Text\ntargetURI = do\n  skipSpaces\n  optional $ try $ newline >> notFollowedBy blankline\n  contents <- trim <$>\n     many1Char (satisfy (/='\\n')\n     <|> try (newline >> many1 spaceChar >> noneOf \" \\t\\n\"))\n  blanklines\n  return $ stripBackticks contents\n  where\n    stripBackticks t\n      | Just xs <- T.stripSuffix \"`_\" t = T.dropWhile (=='`') xs <> \"_\"\n      | Just _  <- T.stripSuffix \"_\"  t = t\n      | otherwise                       = escapeURI t\n\nsubstKey :: PandocMonad m => RSTParser m ()\nsubstKey = try $ do\n  string \"..\"\n  skipMany1 spaceChar\n  (alt,ref) <- withRaw $ trimInlines . mconcat\n                      <$> enclosed (char '|') (char '|') inline\n  res <- B.toList <$> directive'\n  bls <- case res of\n             -- use alt unless :alt: attribute on image:\n             [Para [Image attr [Str \"image\"] (src,tit)]] ->\n                return $ B.para $ B.imageWith attr src tit alt\n             [Para [Link _ [Image attr [Str \"image\"] (src,tit)] (src',tit')]] ->\n                return $ B.para $ B.link src' tit' (B.imageWith attr src tit alt)\n             _          -> return $ B.fromList res\n  let key = toKey $ stripFirstAndLast ref\n  updateState $ \\s -> s{ stateSubstitutions =\n                          M.insert key bls $ stateSubstitutions s }\n\nanonymousKey :: PandocMonad m => RSTParser m ()\nanonymousKey = try $ do\n  oneOfStrings [\".. __:\", \"__\"]\n  skipMany1 spaceChar\n  src <- targetURI\n  -- we need to ensure that the keys are ordered by occurrence in\n  -- the document.\n  numKeys <- M.size . stateKeys <$> getState\n  let key = toKey $ \"_\" <> T.pack (printf \"%04d\" numKeys)\n  updateState $ \\s -> s { stateKeys = M.insert key ((src,\"\"), nullAttr) $\n                          stateKeys s }\n\nreferenceNames :: PandocMonad m => RSTParser m [Text]\nreferenceNames = do\n  let rn = try $ do\n             string \".. _\"\n             ref <- quotedReferenceName\n                  <|> manyChar (  noneOf \"\\\\:\\n\"\n                              <|> try (char '\\n' <*\n                                       string \"   \" <*\n                                       notFollowedBy blankline)\n                              <|> try (char '\\\\' *> char ':')\n                              <|> try (char ':' <* lookAhead alphaNum)\n                               )\n             char ':'\n             return ref\n  first <- rn\n  rest  <- many (try (blanklines *> rn))\n  return (first:rest)\n\nregularKey :: PandocMonad m => RSTParser m ()\nregularKey = try $ do\n  -- we allow several references to the same URL, e.g.\n  -- .. _hello:\n  -- .. _goodbye: url.com\n  refs <- referenceNames\n  src <- targetURI\n  guard $ not (T.null src)\n  let keys = map toKey refs\n  forM_ keys $ \\key ->\n    updateState $ \\s -> s { stateKeys = M.insert key ((src,\"\"), nullAttr) $\n                            stateKeys s }\n\nanchor :: PandocMonad m => RSTParser m Blocks\nanchor = try $ do\n  refs <- referenceNames\n  blanklines\n  forM_ refs $ \\rawkey ->\n    updateState $ \\s -> s { stateKeys =\n       M.insert (toKey rawkey) ((\"#\" <> rawkey,\"\"), nullAttr)\n         (stateKeys s) }\n  b <- block\n  let addDiv ref = B.divWith (ref, [], [])\n  let emptySpanWithId id' = Span (id',[],[]) []\n  -- put identifier on next block:\n  case B.toList b of\n       [Header lev (_,classes,kvs) txt] ->\n         case reverse refs of\n              [] -> return b\n              (r:rs) -> return $ B.singleton $\n                           Header lev (r,classes,kvs)\n                             (txt ++ map emptySpanWithId rs)\n                -- we avoid generating divs for headers,\n                -- because it hides them from promoteHeader, see #4240\n       _ -> return $ foldr addDiv b refs\n\n--\n-- tables\n--\n\n-- General tables TODO:\n--  - figure out if leading spaces are acceptable and if so, add\n--    support for them\n--\n-- Simple tables TODO:\n--  - multiline support\n--  - ensure that rightmost column span does not need to reach end\n--  - require at least 2 columns\n\ndashedLine :: Monad m => Char -> ParsecT Sources st m (Int, Int)\ndashedLine ch = do\n  dashes <- many1 (char ch)\n  sp     <- many (char ' ')\n  return (length dashes, length sp)\n\nsimpleDashedLines :: Monad m => Char -> ParsecT Sources st m [(Int,Int)]\nsimpleDashedLines ch = try $ do\n  lines' <- many1 (dashedLine ch)\n  skipMany spaceChar\n  newline\n  return $ addSpaces lines'\n where\n  addSpaces [] = []\n  addSpaces [(dashes, _)] = [(dashes, dashes)] -- Don't count trailing whitespaces\n  addSpaces ((dashes, sp) : moreLines) =\n    (dashes, dashes + sp) : addSpaces moreLines\n\n-- Parse a table row separator\nsimpleTableSep :: Monad m => Char -> RSTParser m ()\nsimpleTableSep ch = void (simpleDashedLines ch)\n\n-- Parse a table footer\nsimpleTableFooter :: Monad m => RSTParser m ()\nsimpleTableFooter = try $ simpleTableSep '=' >> void blanklines\n\n-- Parse a raw line and split it into chunks by indices.\nsimpleTableRawLine :: Monad m => [Int] -> RSTParser m [(Text, ColSpan)]\nsimpleTableRawLine indices = do\n  row <- rowWithOptionalColSpan\n\n  case simpleTableSplitLine indices row of\n    Just rowLine -> return rowLine\n    Nothing -> Prelude.fail \"col spans don't match\"\n\nsimpleTableRawLineWithInitialEmptyCell :: Monad m => [Int] -> RSTParser m [(Text, ColSpan)]\nsimpleTableRawLineWithInitialEmptyCell indices = try $ do\n  cs <- simpleTableRawLine indices\n  let isEmptyCell = T.all (\\c -> c == ' ' || c == '\\t')\n  case cs of\n    c:_ | isEmptyCell (fst c) -> return cs\n    _ -> mzero\n\n-- Parse a table row and return a list of blocks (columns).\nsimpleTableRow :: PandocMonad m => [Int] -> RSTParser m [(Blocks, RowSpan, ColSpan)]\nsimpleTableRow indices = do\n  notFollowedBy' (void blanklines <|> simpleTableFooter)\n  firstLine <- simpleTableRawLine indices\n  conLines  <- many $ simpleTableRawLineWithInitialEmptyCell indices\n  let cols = map T.unlines . transpose $ (map fst firstLine) : (map (map fst) conLines) ++\n                                  [replicate (length indices) \"\"\n                                    | not (null conLines)]\n  let rowParser = mapM parseCell cols\n  fmap (\\blocks -> zip3 blocks (repeat 1) (map snd firstLine)) rowParser\n\nsimpleTableSplitLine :: [Int] -> (Text, Maybe [Int]) -> Maybe [(Text, ColSpan)]\nsimpleTableSplitLine indices (line, maybeColspanIndices) =\n  fmap (zip tableLines) columnSpans\n where\n  splitTableLines lineIndices = map trimr $ drop 1 $ splitTextByIndices (init lineIndices) line\n  (tableLines, columnSpans) = case maybeColspanIndices of\n      Nothing -> (splitTableLines indices, Just $ repeat 1)\n      Just colSpanIndices -> (splitTableLines colSpanIndices, colSpans indices colSpanIndices)\n\nsimpleTableHeader :: PandocMonad m\n                  => Bool  -- ^ Headerless table\n                  -> RSTParser m ([[(Blocks, RowSpan, ColSpan)]], [Alignment], [Int])\nsimpleTableHeader headless = try $ do\n  optional blanklines\n  dashes <- simpleDashedLines '='\n\n  rawContent  <- if headless\n                    then return [(\"\", Nothing)]\n                    else many1 $ notFollowedBy (simpleDashedLines '=') >> rowWithOptionalColSpan\n\n  unless headless $ simpleTableSep '='\n\n  let (lines', indices) = dashedLinesToLinesWithIndices dashes\n  let aligns   = replicate (length lines') AlignDefault\n  let rawHeads = if headless\n                    then []\n                    else map (simpleTableSplitLine indices) rawContent\n\n  when (any isNothing rawHeads) $ Prelude.fail \"col spans don't match\"\n\n  let justRawHeads  = catMaybes rawHeads\n  let rawHeads'     = map fst <$> justRawHeads\n  let columnSpans   = map snd <$> justRawHeads\n  heads <- mapM (mapM $ parseFromString' (mconcat <$> many plain) . trim) rawHeads'\n  let headsWithSpans = zipWith3 zip3 heads singleRowSpans columnSpans\n  return (headsWithSpans, aligns, indices)\n\nrowWithOptionalColSpan :: Monad m\n                       => RSTParser m (Text, Maybe [Int])\nrowWithOptionalColSpan = do\n  line <- anyLine\n  colSpanHyphens <- optionMaybe $ simpleDashedLines '-'\n\n  let colSpan = fmap colSpanFromHyphens colSpanHyphens\n  return (line, colSpan)\n where\n  colSpanFromHyphens colSpanHyphens = snd $ dashedLinesToLinesWithIndices colSpanHyphens\n\n-- Parse a simple table.\nsimpleTable :: PandocMonad m\n            => Bool  -- ^ Headerless table\n            -> RSTParser m Blocks\nsimpleTable headless = do\n  let wrapIdFst (a, b, c) = (Identity a, b, c)\n      wrapId = fmap Identity\n  tbl <- runIdentity <$> tableWithSpans\n           (wrapIdFst <$> simpleTableHeader headless)\n           (wrapId <$> simpleTableRow)\n           sep simpleTableFooter\n  -- Simple tables get 0s for relative column widths (i.e., use default)\n  case B.toList tbl of\n       [Table attr cap spec th tb tf] -> return $ B.singleton $\n                                         Table attr cap (rewidth spec) th tb tf\n       _ ->\n         throwError $ PandocShouldNeverHappenError\n            \"tableWith returned something unexpected\"\n where\n  sep = return () -- optional (simpleTableSep '-')\n  rewidth = fmap $ fmap $ const ColWidthDefault\n\ngridTable :: PandocMonad m\n          => RSTParser m Blocks\ngridTable = runIdentity <$>\n  gridTableWith (Identity <$> parseBlocks)\n\ntable :: PandocMonad m => RSTParser m Blocks\ntable = gridTable <|> simpleTable False <|> simpleTable True <?> \"table\"\n\n--\n-- inline\n--\n\ninline :: PandocMonad m => RSTParser m Inlines\ninline =\n  (note          -- can start with whitespace, so try before ws\n    <|> do notAfterString >>= guard\n           (link <|> inlineAnchor <|> strong <|> emph)\n    <|> code\n    <|> subst\n    <|> interpretedRole\n    <|> inlineContent) <?> \"inline\"\n\n-- strings, spaces and other characters that can appear either by\n-- themselves or within inline markup\ninlineContent :: PandocMonad m => RSTParser m Inlines\ninlineContent = choice [ whitespace\n                       , str\n                       , endline\n                       , smart\n                       , escapedChar\n                       , symbol ] <?> \"inline content\"\n\nparseInlineFromText :: PandocMonad m => Text -> RSTParser m Inlines\nparseInlineFromText = parseFromString' (trimInlines . mconcat <$> many inline)\n\nescapedChar :: Monad m => RSTParser m Inlines\nescapedChar = do c <- escaped anyChar\n                 if c == ' ' || c == '\\n' || c == '\\r'\n                    -- '\\ ' is null in RST\n                    then return mempty\n                    else do\n                      unless (canPrecedeOpener c) updateLastStrPos\n                      return $ B.str $ T.singleton c\n\ncanPrecedeOpener :: Char -> Bool\ncanPrecedeOpener c =\n  generalCategory c `elem`\n   [OpenPunctuation, InitialQuote, FinalQuote, DashPunctuation, OtherSymbol]\n\nsymbol :: Monad m => RSTParser m Inlines\nsymbol = do\n  c <- oneOf specialChars\n  unless (canPrecedeOpener c) updateLastStrPos\n  return $ B.str $ T.singleton c\n\n-- parses inline code, between codeStart and codeEnd\ncode :: Monad m => RSTParser m Inlines\ncode = try $ do\n  string \"``\"\n  result <- manyTillChar anyChar (try (string \"``\"))\n  return $ B.code\n         $ trim $ T.unwords $ T.lines result\n\n-- succeeds only if we're not right after a str (ie. in middle of word)\natStart :: Monad m => RSTParser m a -> RSTParser m a\natStart p = do\n  pos <- getPosition\n  st <- getState\n  -- single quote start can't be right after str\n  guard $ stateLastStrPos st /= Just pos\n  p\n\nemph :: PandocMonad m => RSTParser m Inlines\nemph = B.emph . trimInlines . mconcat <$>\n         enclosed (atStart $ char '*') (char '*') inlineContent\n\nstrong :: PandocMonad m => RSTParser m Inlines\nstrong = B.strong . trimInlines . mconcat <$>\n          enclosed (atStart $ string \"**\") (try $ string \"**\") inlineContent\n\n-- Note, this doesn't precisely implement the complex rule in\n-- http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules\n-- but it should be good enough for most purposes\n--\n-- TODO:\n--  - Classes are silently discarded in addNewRole\n--  - Allows direct use of the :raw: role, rST only allows inherited use.\ninterpretedRole :: PandocMonad m => RSTParser m Inlines\ninterpretedRole = try $ do\n  (role, contents) <- roleBefore <|> roleAfter\n  renderRole contents Nothing role nullAttr\n\nrenderRole :: PandocMonad m\n           => Text -> Maybe Text -> Text -> Attr -> RSTParser m Inlines\nrenderRole contents fmt role attr = case role of\n    \"sup\"  -> return $ B.superscript $ treatAsText contents\n    \"superscript\" -> return $ B.superscript $ treatAsText contents\n    \"sub\"  -> return $ B.subscript $ treatAsText contents\n    \"subscript\"  -> return $ B.subscript $ treatAsText contents\n    \"mark\"  -> return $ B.spanWith (\"\",[\"mark\"],[]) $ treatAsText contents\n    \"emphasis\" -> return $ B.emph $ treatAsText contents\n    \"strong\" -> return $ B.strong $ treatAsText contents\n    \"rfc-reference\" -> return $ rfcLink contents\n    \"RFC\" -> return $ rfcLink contents\n    \"pep-reference\" -> return $ pepLink contents\n    \"PEP\" -> return $ pepLink contents\n    \"literal\" -> return $ B.codeWith attr contents\n    \"math\" -> return $ B.math contents\n    \"title-reference\" -> titleRef contents\n    \"title\" -> titleRef contents\n    \"t\" -> titleRef contents\n    \"code\" -> return $ B.codeWith attr contents\n    \"span\" -> return $ B.spanWith attr $ treatAsText contents\n    \"raw\" -> return $ B.rawInline (fromMaybe \"\" fmt) contents\n    custom\n     | Just citeType <- T.stripPrefix \"cite\" custom\n       -> cite citeType contents\n     | otherwise -> do\n        customRoles <- stateRstCustomRoles <$> getState\n        case M.lookup custom customRoles of\n            Just (newRole, newFmt, newAttr) ->\n                renderRole contents newFmt newRole newAttr\n            Nothing -> -- undefined role\n                return $ B.codeWith (\"\",[\"interpreted-text\"],[(\"role\",role)])\n                          contents\n where\n   titleRef ref = return $ B.spanWith (\"\",[\"title-ref\"],[]) $ treatAsText ref\n   rfcLink rfcNo = B.link rfcUrl (\"RFC \" <> rfcNo) $ B.str (\"RFC \" <> rfcNo)\n     where rfcUrl = \"http://www.faqs.org/rfcs/rfc\" <> rfcNo <> \".html\"\n   pepLink pepNo = B.link pepUrl (\"PEP \" <> pepNo) $ B.str (\"PEP \" <> pepNo)\n     where padNo = T.replicate (4 - T.length pepNo) \"0\" <> pepNo\n           pepUrl = \"http://www.python.org/dev/peps/pep-\" <> padNo <> \"/\"\n   treatAsText = B.text . handleEscapes\n   handleEscapes = T.concat . removeSpace . T.splitOn \"\\\\\"\n     where headSpace t = fromMaybe t $ T.stripPrefix \" \" t\n           removeSpace (x:xs) = x : map headSpace xs\n           removeSpace []     = []\n\ncite :: PandocMonad m => Text -> Text -> RSTParser m Inlines\ncite citeType rawcite = do\n  let citations =\n        case map parseCite (T.splitOn \",\" rawcite) of\n                (c:cs)\n                  | citeType == \":t\" || citeType == \":ct\"\n                     -> c{ citationMode = AuthorInText } : cs\n                  | citeType == \":year\" || citeType == \":yearpar\"\n                     -> c{ citationMode = SuppressAuthor } : cs\n                cs -> cs\n  pure $ B.cite citations (B.str rawcite)\n\nparseCite :: Text -> Citation\nparseCite t =\n  let (_, pref, suff, ident) = T.foldl go (ParseStart, \"\", \"\", \"\") t\n  in  Citation{citationId = ident\n              ,citationPrefix = B.toList $ B.text pref\n              ,citationSuffix = B.toList $ B.text suff\n              ,citationMode = NormalCitation\n              ,citationNoteNum = 0\n              ,citationHash = 0}\n where\n   go (ParseStart, p, s, i) '{' = (ParsePrefix, p, s, i)\n   go (ParseStart, p, s, i) c = (ParseId, p, s, T.snoc i c)\n   go (ParsePrefix, p, s, i) '}' = (ParseId, p, s, i)\n   go (ParsePrefix, p, s, i) c = (ParsePrefix, T.snoc p c, s, i)\n   go (ParseId, p, s, i) '{' = (ParseSuffix, p, s, i)\n   go (ParseId, p, s, i) c = (ParseId, p, s, T.snoc i c)\n   go (ParseSuffix, p, s, i) '}' = (ParseSuffix, p, s, i)\n   go (ParseSuffix, p, s, i) c = (ParseSuffix, p, T.snoc s c, i)\n\ndata ParseCiteState = ParseStart | ParsePrefix | ParseSuffix | ParseId\n  deriving (Show)\n\n-- single words consisting of alphanumerics plus isolated (no two adjacent)\n-- internal hyphens, underscores, periods, colons and plus signs;\n-- no whitespace or other characters are allowed\nroleName :: PandocMonad m => RSTParser m Text\nroleName = many1Char (alphaNum <|> try (oneOf \"-_.:+\" <* lookAhead alphaNum))\n\nroleMarker :: PandocMonad m => RSTParser m Text\nroleMarker = char ':' *> roleName <* char ':'\n\nroleBefore :: PandocMonad m => RSTParser m (Text,Text)\nroleBefore = try $ do\n  role <- roleMarker\n  contents <- unmarkedInterpretedText\n  return (role,contents)\n\nroleAfter :: PandocMonad m => RSTParser m (Text,Text)\nroleAfter = try $ do\n  contents <- unmarkedInterpretedText\n  role <- roleMarker <|> (stateRstDefaultRole <$> getState)\n  return (role,contents)\n\nunmarkedInterpretedText :: PandocMonad m => RSTParser m Text\nunmarkedInterpretedText = try $ do\n  atStart (char '`')\n  contents <- mconcat <$> many1\n       (  many1 (noneOf \"`\\\\\\n\")\n      <|> (char '\\\\' >> ((\\c -> ['\\\\',c]) <$> noneOf \"\\n\"))\n      <|> (string \"\\n\" <* notFollowedBy blankline)\n      <|> try (string \"`\" <*\n                notFollowedBy (void roleMarker) <*\n                lookAhead (satisfy isAlphaNum))\n       )\n  char '`'\n  return $ T.pack contents\n\nwhitespace :: PandocMonad m => RSTParser m Inlines\nwhitespace = B.space <$ skipMany1 spaceChar <?> \"whitespace\"\n\nstr :: Monad m => RSTParser m Inlines\nstr = do\n  let strChar = noneOf (\"\\t\\n \" ++ specialChars)\n  result <- many1Char strChar\n  updateLastStrPos\n  return $ B.str result\n\n-- an endline character that can be treated as a space, not a structural break\nendline :: Monad m => RSTParser m Inlines\nendline = try $ do\n  newline\n  notFollowedBy blankline\n  -- parse potential list-starts at beginning of line differently in a list:\n  st <- getState\n  when (stateParserContext st == ListItemState) $ notFollowedBy (anyOrderedListMarker >> spaceChar) >>\n          notFollowedBy' bulletListStart\n  return B.softbreak\n\n--\n-- links\n--\n\nlink :: PandocMonad m => RSTParser m Inlines\nlink = choice [explicitLink, referenceLink, autoLink]  <?> \"link\"\n\nexplicitLink :: PandocMonad m => RSTParser m Inlines\nexplicitLink = try $ do\n  char '`'\n  notFollowedBy (char '`') -- `` marks start of inline code\n  label' <- trimInlines . mconcat <$>\n              manyTill (notFollowedBy (char '`') >> inlineContent) (char '<')\n  src <- trim . T.pack . filter (/= '\\n') <$> -- see #10279\n           manyTill (noneOf \">\\n\" <|> (char '\\n' <* notFollowedBy blankline))\n                    (char '>')\n  skipSpaces\n  string \"`_\"\n  optional $ char '_' -- anonymous form\n  let src' | isURI src = escapeURI src\n           | otherwise =\n              case T.unsnoc src of\n                 Just (xs, '_') -> \"##REF##\" <> xs\n                 _              -> src\n  let label'' = if label' == mempty\n                   then B.str src\n                   else label'\n  let key = toKey $ stringify label'\n  unless (key == Key mempty) $ do\n    updateState $ \\s -> s{\n      stateKeys = M.insert key ((src',\"\"), nullAttr) $ stateKeys s }\n  return $ B.linkWith nullAttr src' \"\" label''\n\ncitationName :: PandocMonad m => RSTParser m Text\ncitationName = do\n  raw <- citationMarker\n  return $ \"[\" <> raw <> \"]\"\n\n-- We store the reference link label as the link target,\n-- preceded by '##REF##'. This is replaced after the AST\n-- has been built by the resolved reference.\nreferenceLink :: PandocMonad m => RSTParser m Inlines\nreferenceLink = try $ do\n  ref <- (referenceName <|> citationName) <* char '_'\n  isAnonymous <- (True <$ char '_') <|> pure False\n  eof <|> notFollowedBy alphaNum\n  let ref' = if isAnonymous\n                then \"_\"\n                else ref\n  pure $ B.linkWith nullAttr (\"##REF##\" <> ref') \"\" (B.text ref)\n\n-- We keep a list of oldkeys so we can detect lookup loops.\nlookupKey :: PandocMonad m\n          => [Key] -> Key -> RSTParser m ((Text, Text), Attr)\nlookupKey oldkeys key = do\n  pos <- getPosition\n  state <- getState\n  let keyTable = stateKeys state\n  case M.lookup key keyTable of\n       Nothing  -> do\n         let Key key' = key\n         logMessage $ ReferenceNotFound key' pos\n         return ((\"\",\"\"),nullAttr)\n       -- check for keys of the form link_, which need to be resolved:\n       Just ((u, \"\"),_) | T.length u > 1, T.last u == '_', T.head u /= '#' -> do\n         let rawkey = T.init u\n         let newkey = toKey rawkey\n         if newkey `elem` oldkeys\n            then do\n              -- TODO the pos is not going to be accurate\n              -- because we're calling this after the AST is\n              -- constructed. Probably good to remove that\n              -- parameter form CircularReference at some point.\n              logMessage $ CircularReference rawkey pos\n              return ((\"\",\"\"),nullAttr)\n            else lookupKey (key:oldkeys) newkey\n       Just val -> return val\n\nautoURI :: Monad m => RSTParser m Inlines\nautoURI = do\n  (orig, src) <- uri\n  return $ B.link src \"\" $ B.str orig\n\nautoEmail :: Monad m => RSTParser m Inlines\nautoEmail = do\n  (orig, src) <- emailAddress\n  return $ B.link src \"\" $ B.str orig\n\nautoLink :: PandocMonad m => RSTParser m Inlines\nautoLink = autoURI <|> autoEmail\n\nsubst :: PandocMonad m => RSTParser m Inlines\nsubst = try $ do\n  (_,ref) <- withRaw $ enclosed (char '|') (char '|') inline\n  let substlink = B.linkWith nullAttr (\"##SUBST##\" <> ref) \"\" (B.text ref)\n  reflink <- option False (True <$ char '_')\n  if reflink\n     then do\n       let linkref = T.drop 1 $ T.dropEnd 1 ref\n       return $ B.linkWith nullAttr (\"##REF##\" <> linkref) \"\" substlink\n     else return substlink\n\nnote :: PandocMonad m => RSTParser m Inlines\nnote = try $ do\n  optional whitespace\n  ref <- noteMarker\n  char '_'\n  pure $ B.linkWith nullAttr (\"##NOTE##\" <> ref) \"\" (B.text ref)\n\nsmart :: PandocMonad m => RSTParser m Inlines\nsmart = smartPunctuation inline\n\ninlineAnchor :: PandocMonad m => RSTParser m Inlines\ninlineAnchor = try $ do\n  char '_'\n  name <- quotedReferenceName <|> simpleReferenceName\n  let ident = textToIdentifier mempty name\n  updateState $ \\s ->\n    s{ stateKeys = M.insert (toKey name) ((\"#\" <> ident, \"\"), nullAttr)\n                    (stateKeys s) }\n  pure $ B.spanWith (ident,[],[]) (B.text name)\n\ndashedLinesToLinesWithIndices :: [(Int, Int)] -> ([Int], [Int])\ndashedLinesToLinesWithIndices dashes =\n  let lines'  = map snd dashes\n      indices = scanl (+) 0 lines'\n  in  (lines', indices)\n\n-- | Determines column spans by appying indices of a table border with column span indices.\n--\n-- The indices need to align.\ncolSpans :: [Int] -> [Int] -> Maybe [ColSpan]\ncolSpans [] []  = Just []\ncolSpans [] _   = Nothing\ncolSpans _ []   = Nothing\ncolSpans (index : indices) colSpanIndices@(colIndex : colSpanIndicesTail)\n    | index /= colIndex = colSpans indices colSpanIndices\n    | otherwise =\n        -- For a matching index start counting the column spans.\n        let (spanCount, remainingIndices, remainingColSpanindices) = colSpanCount indices colSpanIndicesTail 1\n        in  (:) spanCount <$> colSpans remainingIndices remainingColSpanindices\n\n-- | Counts column spans by consuming all non-matching indices until a matching one is encountered.\n--\n-- If the indices match, the end of a column span has been encountered and the\n-- column count can be returned. Otherwise, if the indices don't match, add to\n-- the span count until a matching index is found.\ncolSpanCount :: [Int] -> [Int] -> ColSpan -> (ColSpan, [Int], [Int])\ncolSpanCount [] colSpanIndices spanCount = (spanCount, [], colSpanIndices)\ncolSpanCount _ [] spanCount = (spanCount, [], [])\ncolSpanCount indices@(index : indicesTail) colSpanIndices@(colIndex : colSpanIndicesTail) spanCount\n    | index == colIndex = case colSpanIndicesTail of\n        [] -> (spanCount, indicesTail, colSpanIndicesTail)\n        _ -> (spanCount, indices, colSpanIndices)\n    | otherwise = colSpanCount indicesTail colSpanIndices $ spanCount + 1\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/RTF.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE BangPatterns      #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.RTF\n   Copyright   : Copyright (C) 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane (<jgm@berkeley.edu>)\n   Stability   : alpha\n   Portability : portable\n\nConversion of RTF documents 'Pandoc' document.\nWe target version 1.5 of the RTF spec.\n-}\nmodule Text.Pandoc.Readers.RTF (readRTF) where\n\nimport qualified Data.IntMap as IntMap\nimport qualified Data.Sequence as Seq\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport qualified Data.List as L\nimport Data.Word (Word8, Word16)\nimport Data.Default\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Read as TR\nimport Text.Pandoc.Builder (Blocks, Inlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class (PandocMonad (..), insertMedia, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Logging (LogMessage(UnsupportedCodePage))\nimport Text.Pandoc.Shared (tshow)\nimport Data.Char (isAlphaNum, chr, isAscii, isLetter, isSpace, ord)\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Maybe (mapMaybe, fromMaybe)\nimport Safe (lastMay, initSafe, headDef)\n-- import Debug.Trace\n\n-- TODO:\n-- [ ] more complex table features\n--\n\n-- | Read RTF from an input string and return a Pandoc document.\nreadRTF  :: (PandocMonad m, ToSources a)\n         => ReaderOptions\n         -> a\n         -> m Pandoc\nreadRTF opts s = do\n  let sources = toSources s\n  parsed <- readWithM parseRTF def{ sOptions = opts } sources\n  case parsed of\n       Left e  -> throwError e\n       Right d -> return d\n\ndata CharSet = ANSI | Mac | Pc | Pca\n  deriving (Show, Eq)\n\n-- first index is the list (or override) id, second is the list level\ntype ListTable = IntMap.IntMap ListLevelTable\ntype ListLevelTable = IntMap.IntMap ListType\n\ndata RTFState = RTFState  { sOptions     :: ReaderOptions\n                          , sCharSet     :: CharSet\n                          , sGroupStack  :: [Properties]\n                          , sListStack   :: [List]\n                          , sCurrentCell :: Blocks\n                          , sTableRows   :: [TableRow] -- reverse order\n                          , sTextContent :: [(Properties, Text)]\n                          , sMetadata    :: [(Text, Inlines)]\n                          , sFontTable   :: FontTable\n                          , sStylesheet  :: Stylesheet\n                          , sListTable   :: ListTable\n                          , sListOverrideTable :: ListTable\n                          , sEatChars    :: Int\n                          } deriving (Show)\n\ninstance Default RTFState where\n def = RTFState { sOptions = def\n                , sCharSet = ANSI\n                , sGroupStack = []\n                , sListStack = []\n                , sCurrentCell = mempty\n                , sTableRows = []\n                , sTextContent = []\n                , sMetadata = []\n                , sFontTable = mempty\n                , sStylesheet = mempty\n                , sListTable = mempty\n                , sListOverrideTable = mempty\n                , sEatChars = 0\n                }\n\ntype FontTable = IntMap.IntMap FontFamily\n\ndata FontFamily =\n  Roman | Swiss | Modern | Script | Decor | Tech | Bidi\n  deriving (Show, Eq)\n\ndata StyleType = ParagraphStyle | SectionStyle | CharStyle | TableStyle\n  deriving (Show, Eq)\n\ndata Style =\n  Style { styleNum :: Int\n        , styleType :: StyleType\n        , styleBasedOn :: Maybe Int\n        , styleName :: Text\n        , styleFormatting :: [Tok]\n        } deriving (Show, Eq)\n\ntype Stylesheet = IntMap.IntMap Style\n\ndata PictType =\n  Emfblip | Pngblip | Jpegblip\n  deriving (Show, Eq)\n\ndata Pict =\n  Pict { picType :: Maybe PictType\n       , picWidth :: Maybe Int\n       , picHeight :: Maybe Int\n       , picWidthGoal :: Maybe Int\n       , picHeightGoal :: Maybe Int\n       , picBinary :: Bool\n       , picData :: Text\n       , picName :: Text\n       , picBytes :: BL.ByteString\n       } deriving (Show, Eq)\n\ninstance Default Pict where\n def = Pict { picType = Nothing\n            , picWidth = Nothing\n            , picHeight = Nothing\n            , picWidthGoal = Nothing\n            , picHeightGoal = Nothing\n            , picBinary = False\n            , picData = mempty\n            , picName = mempty\n            , picBytes = mempty }\n\ndata Properties =\n  Properties\n  { gBold :: Bool\n  , gItalic :: Bool\n  , gCaps :: Bool\n  , gDeleted :: Bool\n  , gSub :: Bool\n  , gSuper :: Bool\n  , gSmallCaps :: Bool\n  , gUnderline :: Bool\n  , gHyperlink :: Maybe Text\n  , gAnchor :: Maybe Text\n  , gImage :: Maybe Pict\n  , gFontFamily :: Maybe FontFamily\n  , gHidden :: Bool\n  , gUC :: Int -- number of ansi chars to skip after unicode char\n  , gFootnote :: Maybe Blocks\n  , gOutlineLevel :: Maybe ListLevel\n  , gListOverride :: Maybe Override\n  , gListLevel :: Maybe Int\n  , gInTable :: Bool\n  } deriving (Show, Eq)\n\ninstance Default Properties where\n   def = Properties { gBold = False\n                    , gItalic = False\n                    , gCaps = False\n                    , gDeleted = False\n                    , gSub = False\n                    , gSuper = False\n                    , gSmallCaps = False\n                    , gUnderline = False\n                    , gHyperlink = Nothing\n                    , gAnchor = Nothing\n                    , gImage = Nothing\n                    , gFontFamily = Nothing\n                    , gHidden = False\n                    , gUC = 1\n                    , gFootnote = Nothing\n                    , gOutlineLevel = Nothing\n                    , gListOverride = Nothing\n                    , gListLevel = Nothing\n                    , gInTable = False\n                    }\n\ntype RTFParser m = ParsecT Sources RTFState m\n\ndata ListType = Bullet | Ordered ListAttributes\n  deriving (Show, Eq)\n\ntype Override = Int\n\ntype ListLevel = Int\n\ndata List =\n    List Override ListLevel ListType [Blocks]  -- items in reverse order\n    deriving (Show, Eq)\n\nnewtype TableRow = TableRow [Blocks] -- cells in reverse order\n    deriving (Show, Eq)\n\nparseRTF :: PandocMonad m => RTFParser m Pandoc\nparseRTF = do\n  skipMany nl\n  bs <- many tok >>= foldM processTok mempty >>= emitBlocks\n  unclosed <- closeContainers\n  let doc = B.doc $ bs <> unclosed\n  kvs <- sMetadata <$> getState\n  pure $ foldr (uncurry B.setMeta) doc kvs\n\ndata Tok = Tok !SourcePos !TokContents\n  deriving (Show, Eq)\n\ndata TokContents =\n    ControlWord !Text !(Maybe Int)\n  | ControlSymbol !Char\n  | UnformattedText !Text\n  | BinData !BL.ByteString\n  | HexVals [Word8]\n  | Grouped [Tok]\n  deriving (Show, Eq)\n\ntok :: PandocMonad m => RTFParser m Tok\ntok = do\n  pos <- getPosition\n  Tok pos <$!> ((controlThing <|> unformattedText <|> grouped) <* skipMany nl)\n where\n  controlThing = do\n    char '\\\\' *>\n      ( controlWord\n     <|> (HexVals <$> many1 hexVal)\n     <|> (ControlSymbol <$> anyChar) )\n  controlWord = do\n    name <- letterSequence\n    param <- parameter <* optional delimChar\n    case name of\n      \"bin\" -> do\n        let n = fromMaybe 0 param\n        spaces\n        -- NOTE: We assume here that if the document contains binary\n        -- data, it will not be valid UTF-8 and hence it will have been\n        -- read as latin1, so we can recover the data in the following\n        -- way.  This is probably not completely reliable, but I don't\n        -- know if we can do better without making this reader take\n        -- a ByteString input.\n        dat <- BL.pack . map (fromIntegral . ord) <$> count n anyChar\n        return $! BinData dat\n      _ -> return $! ControlWord name param\n  parameter = do\n    hyph <- option False $ True <$ char '-'\n    rest <- many digit\n    if null rest\n       then return Nothing\n       else do\n         let pstr = T.pack rest\n         case TR.decimal pstr of\n           Right (!i,_) ->\n                return $! Just $! if hyph\n                                     then (-1) * i\n                                     else i\n           _ -> return Nothing\n  hexVal = do\n    char '\\''\n    x <- hexDigit\n    y <- hexDigit\n    return $ hexToWord (T.pack [x,y])\n  letterSequence = T.pack <$> many1 (satisfy (\\c -> isAscii c && isLetter c))\n  unformattedText = do\n    ts <-  filter (\\c -> c /= '\\r' && c /= '\\n') <$>\n           ( many1 (satisfy (\\c -> not (isSpecial c) || c == '\\r' || c == '\\n')))\n    return $! UnformattedText $! T.pack ts\n  grouped = do\n    char '{'\n    skipMany nl\n    ts <- manyTill tok (char '}')\n    case ts of\n       Tok _ (ControlWord \"rtf\" (Just 1)) : _ -> do\n         setInput mempty -- discard remaining input: content after the \\rtf1\n                         -- group can be non-RTF\n       _ -> return ()\n    return $! Grouped ts\n\nnl :: PandocMonad m => RTFParser m ()\nnl = void (char '\\n' <|> char '\\r')\n\nisSpecial :: Char -> Bool\nisSpecial '{' = True\nisSpecial '}' = True\nisSpecial '\\\\' = True\nisSpecial '\\n' = True\nisSpecial _ = False\n\ndelimChar :: PandocMonad m => RTFParser m Char\ndelimChar = satisfy (\\c -> not (isAlphaNum c || isSpecial c))\n\nmodifyGroup :: PandocMonad m\n            => (Properties -> Properties)\n            -> RTFParser m ()\nmodifyGroup f =\n  updateState $ \\st ->\n    st{ sGroupStack =\n          case sGroupStack st of\n            [] -> []\n            (x:xs) -> f x : xs }\n\naddFormatting :: (Properties, Text) -> Inlines\naddFormatting (_, \"\\n\") = B.linebreak\naddFormatting (props, _) | gHidden props = mempty\naddFormatting (props, _) | Just bs <- gFootnote props = B.note bs\naddFormatting (props, txt) =\n  (if gBold props then B.strong else id) .\n  (if gItalic props then B.emph else id) .\n  (if gDeleted props then B.strikeout else id) .\n  (if gSub props then B.subscript else id) .\n  (if gSuper props then B.superscript else id) .\n  (if gSmallCaps props then B.smallcaps else id) .\n  (if gUnderline props then B.underline else id) .\n  (case gHyperlink props of\n     Nothing -> id\n     Just linkdest -> B.link linkdest mempty) .\n  (case gAnchor props of\n     Nothing -> id\n     Just ident -> B.spanWith (ident,[],[])) .\n  (case gFontFamily props of\n     Just Modern -> B.code\n     _ -> case gImage props of\n            Just pict ->\n              let attr = (\"\",[],\n                         (case picWidthGoal pict of\n                           Nothing -> []\n                           Just w  -> [(\"width\", tshow (fromIntegral w / 1440\n                                                         :: Double)\n                                          <> \"in\")]) ++\n                         (case picHeightGoal pict of\n                            Nothing -> []\n                            Just h -> [(\"height\", tshow (fromIntegral h / 1440\n                                                         :: Double)\n                                          <> \"in\")]))\n              in  B.imageWith attr (picName pict) \"\" . B.text\n            Nothing -> B.text) .\n  (if gCaps props then T.toUpper else id)\n  $ txt\n\naddText :: PandocMonad m => Text -> RTFParser m ()\naddText t = do\n  gs <- sGroupStack <$> getState\n  let !props = case gs of\n                (x:_) -> x\n                _ -> def\n  updateState (\\s -> s{ sTextContent = (props, t) : sTextContent s })\n\ninGroup :: PandocMonad m => RTFParser m a -> RTFParser m a\ninGroup p = do\n  updateState $ \\st ->\n    st{ sGroupStack =\n        case sGroupStack st of\n          [] -> [def]\n          (x:xs) -> (x:x:xs) } -- inherit current group's properties\n  result <- p\n  updateState $ \\st ->\n    st{ sGroupStack =\n        case sGroupStack st of\n          [] -> [] -- should not happen\n          (_:xs) -> xs }\n  return result\n\ngetStyleFormatting :: PandocMonad m => Int -> RTFParser m [Tok]\ngetStyleFormatting stynum = do\n  stylesheet <- sStylesheet <$> getState\n  case IntMap.lookup stynum stylesheet of\n    Nothing -> return []\n    Just sty ->\n      case styleBasedOn sty of\n        Just i -> (<> styleFormatting sty)  <$> getStyleFormatting i\n        Nothing -> return $ styleFormatting sty\n\nisMetadataField :: Text -> Bool\nisMetadataField \"title\" = True\nisMetadataField \"subject\" = True\nisMetadataField \"author\" = True\nisMetadataField \"manager\" = True\nisMetadataField \"company\" = True\nisMetadataField \"operator\" = True\nisMetadataField \"category\" = True\nisMetadataField \"keywords\" = True\nisMetadataField \"comment\" = True\nisMetadataField \"doccomm\" = True\nisMetadataField \"hlinkbase\" = True\nisMetadataField \"generator\" = True\nisMetadataField _ = False\n\nisHeaderFooter :: Text -> Bool\nisHeaderFooter \"header\" = True\nisHeaderFooter \"headerl\" = True\nisHeaderFooter \"headerr\" = True\nisHeaderFooter \"headerf\" = True\nisHeaderFooter \"footer\" = True\nisHeaderFooter \"footerl\" = True\nisHeaderFooter \"footerr\" = True\nisHeaderFooter \"footerf\" = True\nisHeaderFooter _ = False\n\nboolParam :: Maybe Int -> Bool\nboolParam (Just 0) = False\nboolParam _ = True\n\nisUnderline :: Text -> Bool\nisUnderline \"ul\" = True\nisUnderline \"uld\" = True\nisUnderline \"uldash\" = True\nisUnderline \"uldashd\" = True\nisUnderline \"uldashdd\" = True\nisUnderline \"uldb\" = True\nisUnderline \"ulth\" = True\nisUnderline \"ulthd\" = True\nisUnderline \"ulthdash\" = True\nisUnderline \"ulw\" = True\nisUnderline \"ulwave\" = True\nisUnderline _ = False\n\nprocessTok :: PandocMonad m => Blocks -> Tok -> RTFParser m Blocks\nprocessTok bs (Tok pos tok') = do\n  setPosition pos\n  case tok' of\n    HexVals{} -> return ()\n    UnformattedText{} -> return ()\n    _ -> updateState $ \\s -> s{ sEatChars = 0 }\n  case tok' of\n    Grouped (Tok _ (ControlSymbol '*') : toks@(firsttok:_)) ->\n      case firsttok of\n        Tok _ (ControlWord \"shppict\" _) -> inGroup (foldM processTok bs toks)\n        Tok _ (ControlWord \"shpinst\" _) -> inGroup (foldM processTok bs toks)\n        _ -> bs <$ (do oldTextContent <- sTextContent <$> getState\n                       processTok mempty (Tok pos (Grouped toks))\n                       updateState $ \\st -> st{ sTextContent = oldTextContent })\n    Grouped (Tok _ (ControlWord \"shp\" _) : toks) ->\n      inGroup (foldM processTok bs toks)\n    Grouped [ Tok _ (ControlWord \"sp\" _)\n            , Tok _ (Grouped [Tok _ (ControlWord \"sn\" _),\n                      Tok _ (UnformattedText sn)])\n            , Tok _ (Grouped (Tok _ (ControlWord \"sv\" _) : svtoks))\n            ] ->\n      case sn of\n        \"pib\" -> inGroup (foldM processTok bs svtoks)\n        _ -> pure bs\n    Grouped (Tok _ (ControlWord \"fonttbl\" _) : toks) -> inGroup $ do\n      updateState $ \\s -> s{ sFontTable = processFontTable toks }\n      pure bs\n    Grouped (Tok _ (ControlWord \"field\" _) : toks) ->\n      inGroup $ handleField bs toks\n    Grouped (Tok _ (ControlWord \"pict\" _) : toks) ->\n      bs <$ inGroup (handlePict toks)\n    Grouped (Tok _ (ControlWord \"stylesheet\" _) : toks) ->\n      bs <$ inGroup (handleStylesheet toks)\n    Grouped (Tok _ (ControlWord \"listtext\" _) : _) -> do\n      -- eject any previous list items...sometimes TextEdit\n      -- doesn't put in a \\par\n      emitBlocks bs\n    Grouped (Tok _ (ControlWord \"pgdsc\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"colortbl\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"listtable\" _) : toks) ->\n      bs <$ inGroup (handleListTable toks)\n    Grouped (Tok _ (ControlWord \"listoverridetable\" _) : toks) ->\n      bs <$ inGroup (handleListOverrideTable toks)\n    Grouped (Tok _ (ControlWord \"wgrffmtfilter\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"themedata\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"colorschememapping\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"datastore\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"latentstyles\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"pntxta\" _) : _) -> pure bs -- TODO\n    Grouped (Tok _ (ControlWord \"pntxtb\" _) : _) -> pure bs -- TODO\n    Grouped (Tok _ (ControlWord \"xmlnstbl\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"filetbl\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"expandedcolortbl\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"listtables\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"revtbl\" _) : _) -> pure bs\n    Grouped (Tok _ (ControlWord \"bkmkstart\" _)\n             : Tok _ (UnformattedText t) : _) -> do\n      -- TODO ideally we'd put the span around bkmkstart/end, but this\n      -- is good for now:\n      modifyGroup (\\g -> g{ gAnchor = Just $ T.strip t })\n      pure bs\n    Grouped (Tok _ (ControlWord \"bkmkend\" _) : _) -> do\n      modifyGroup (\\g -> g{ gAnchor = Nothing })\n      pure bs\n    Grouped (Tok _ (ControlWord f _) : _) | isHeaderFooter f -> pure bs\n    Grouped (Tok _ (ControlWord \"footnote\" _) : toks) -> do\n      noteBs <- inGroup $ processDestinationToks toks\n      modifyGroup (\\g -> g{ gFootnote = Just noteBs })\n      addText \"*\"\n      modifyGroup (\\g -> g{ gFootnote = Nothing })\n      return bs\n    Grouped (Tok _ (ControlWord \"info\" _) : toks) ->\n      bs <$ inGroup (processDestinationToks toks)\n    Grouped (Tok _ (ControlWord f _) : toks) | isMetadataField f -> inGroup $ do\n      foldM_ processTok mempty toks\n      annotatedToks <- reverse . sTextContent <$> getState\n      updateState $ \\s -> s{ sTextContent = [] }\n      let ils = B.trimInlines . mconcat $ map addFormatting annotatedToks\n      updateState $ \\s -> s{ sMetadata = (f, ils) : sMetadata s }\n      pure bs\n    Grouped toks -> inGroup (foldM processTok bs toks)\n    UnformattedText t -> bs <$ do\n      -- return $! traceShowId $! (pos, t)\n      eatChars <- sEatChars <$> getState\n      case eatChars of\n        0 -> addText t\n        n | n < T.length t -> do\n             updateState $ \\s -> s{ sEatChars = 0 }\n             addText (T.drop n t)\n          | otherwise -> do\n             updateState $ \\s -> s{ sEatChars = n - T.length t }\n    HexVals ws -> bs <$ do\n      eatChars <- sEatChars <$> getState\n      let ws' = drop eatChars ws\n      updateState $ \\s -> s{ sEatChars = if null ws'\n                                            then eatChars - length ws\n                                            else 0 }\n      charset <- sCharSet <$> getState\n      case charset of\n        ANSI -> addText $ T.pack $ map defaultAnsiWordToChar ws'\n        Mac  -> addText $ T.pack $ map macToChar ws'\n        Pc   -> addText $ T.pack $ map pcToChar ws'\n        Pca  -> addText $ T.pack $ map pcaToChar ws'\n    ControlWord \"ansi\" _ -> bs <$\n      updateState (\\s -> s{ sCharSet = ANSI })\n    ControlWord \"ansicpg\" (Just cpg) | cpg /= 1252 -> bs <$\n      report (UnsupportedCodePage cpg)\n    ControlWord \"mac\" _ -> bs <$\n      updateState (\\s -> s{ sCharSet = Mac })\n    ControlWord \"pc\" _ -> bs <$\n      updateState (\\s -> s{ sCharSet = Pc })\n    ControlWord \"pca\" _ -> bs <$\n      updateState (\\s -> s{ sCharSet = Pca })\n    ControlWord \"outlinelevel\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gOutlineLevel = mbp })\n    ControlWord \"ls\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gListOverride = mbp })\n    ControlWord \"ilvl\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gListLevel = mbp })\n    ControlSymbol '\\\\' -> bs <$ addText \"\\\\\"\n    ControlSymbol '{' -> bs <$ addText \"{\"\n    ControlSymbol '}' -> bs <$ addText \"}\"\n    ControlSymbol '~' -> bs <$ addText \"\\x00a0\"\n    ControlSymbol '-' -> bs <$ addText \"\\x00ad\"\n    ControlSymbol '_' -> bs <$ addText \"\\x2011\"\n    ControlWord \"trowd\" _ -> bs <$ do -- add new row\n      updateState $ \\s -> s{ sTableRows = TableRow [] : sTableRows s\n                           , sCurrentCell = mempty }\n    ControlWord \"cell\" _ -> bs <$ do\n      new <- emitBlocks mempty\n      curCell <- (<> new) . sCurrentCell <$> getState\n      updateState $ \\s -> s{ sTableRows =\n                                case sTableRows s of\n                                  TableRow cs : rs ->\n                                    TableRow (curCell : cs) : rs\n                                  [] -> [TableRow [curCell]] -- shouldn't happen\n                           , sCurrentCell = mempty }\n    ControlWord \"intbl\" _ -> do\n      ls <- closeLists 0 -- see #11364\n      ((ls <>) <$> emitBlocks bs) <* modifyGroup (\\g -> g{ gInTable = True })\n    ControlWord \"plain\" _ -> bs <$ modifyGroup (const def)\n    ControlWord \"lquote\" _ -> bs <$ addText \"\\x2018\"\n    ControlWord \"rquote\" _ -> bs <$ addText \"\\x2019\"\n    ControlWord \"ldblquote\" _ -> bs <$ addText \"\\x201C\"\n    ControlWord \"rdblquote\" _ -> bs <$ addText \"\\x201D\"\n    ControlWord \"emdash\" _ -> bs <$ addText \"\\x2014\"\n    ControlWord \"emspace\" _ -> bs <$ addText \"\\x2003\"\n    ControlWord \"enspace\" _ -> bs <$ addText \"\\x2002\"\n    ControlWord \"endash\" _ -> bs <$ addText \"\\x2013\"\n    ControlWord \"bullet\" _ -> bs <$ addText \"\\x2022\"\n    ControlWord \"tab\" _ -> bs <$ addText \"\\t\"\n    ControlWord \"line\" _ -> bs <$ addText \"\\n\"\n    ControlSymbol '\\n' -> bs <$ addText \"\\n\"\n    ControlSymbol '\\r' -> bs <$ addText \"\\n\"\n    ControlWord \"uc\" (Just i) -> bs <$ modifyGroup (\\g -> g{ gUC = i })\n    ControlWord \"cs\" (Just n) -> do\n      getStyleFormatting n >>= foldM processTok bs\n    ControlWord \"s\" (Just n) -> do\n      getStyleFormatting n >>= foldM processTok bs\n    ControlWord \"ds\" (Just n) -> do\n      getStyleFormatting n >>= foldM processTok bs\n    ControlWord \"f\" (Just i) -> bs <$ do\n      fontTable <- sFontTable <$> getState\n      modifyGroup (\\g -> g{ gFontFamily = IntMap.lookup i fontTable })\n    ControlWord \"u\" (Just i) -> bs <$ do\n      st <- getState\n      let curgroup = case sGroupStack st of\n                       [] -> def\n                       (x:_) -> x\n      updateState $ \\s -> s{ sEatChars = gUC curgroup }\n      -- \"RTF control words generally accept signed 16-bit numbers as\n      -- arguments. For this reason, Unicode values greater than 32767\n      -- must be expressed as negative numbers.\"\n      let codepoint :: Word16\n          codepoint = fromIntegral i\n      addText (T.singleton (chr $ fromIntegral codepoint))\n    ControlWord \"caps\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gCaps = boolParam mbp })\n    ControlWord \"deleted\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gDeleted = boolParam mbp })\n    ControlWord \"b\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gBold = boolParam mbp })\n    ControlWord \"i\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gItalic = boolParam mbp })\n    ControlWord \"sub\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gSub = boolParam mbp })\n    ControlWord \"super\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gSuper = boolParam mbp })\n    ControlWord \"nosupersub\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gSuper = not $ boolParam mbp\n                          , gSub = not $ boolParam mbp })\n    ControlWord \"up\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gSuper = boolParam mbp })\n    ControlWord \"strike\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gDeleted = boolParam mbp })\n    ControlWord \"strikedl\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gDeleted = boolParam mbp })\n    ControlWord \"striked\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gDeleted = boolParam mbp })\n    ControlWord \"scaps\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gSmallCaps = boolParam mbp })\n    ControlWord \"v\" mbp -> bs <$\n      modifyGroup (\\g -> g{ gHidden = boolParam mbp })\n    ControlWord x mbp | isUnderline x -> bs <$\n      modifyGroup (\\g -> g{ gUnderline = boolParam mbp })\n    ControlWord \"ulnone\" _ -> bs <$\n      modifyGroup (\\g -> g{ gUnderline = False })\n    ControlWord \"pard\" _ -> do\n      newbs <- emitBlocks bs\n      modifyGroup (const def)\n      getStyleFormatting 0 >>= foldM processTok newbs\n    ControlWord \"par\" _ -> emitBlocks bs\n    _ -> pure bs\n\nprocessDestinationToks :: PandocMonad m => [Tok] -> RTFParser m Blocks\nprocessDestinationToks toks = do\n  textContent <- sTextContent <$> getState\n  liststack <- sListStack <$> getState\n  updateState $ \\s -> s{ sTextContent = mempty\n                       , sListStack = [] }\n  result <- inGroup $\n              foldM processTok mempty toks >>= emitBlocks\n  unclosed <- closeContainers\n  updateState $ \\s -> s{ sTextContent = textContent\n                       , sListStack = liststack }\n  return $ result <> unclosed\n\n-- close lists >= level\ncloseLists :: PandocMonad m => Int -> RTFParser m Blocks\ncloseLists lvl = do\n  lists <- sListStack <$> getState\n  case lists of\n    (List _ lvl' lt items : rest) | lvl' >= lvl -> do\n      let newlist = (case lt of\n                      Bullet -> B.bulletList\n                      Ordered listAttr -> B.orderedListWith listAttr)\n                    (reverse items)\n      updateState $ \\s -> s{ sListStack = rest }\n      case rest of\n        [] -> do\n          updateState $ \\s -> s{ sListStack = rest }\n          pure newlist\n        (List lo lvl'' lt' [] : rest') -> do -- should not happen\n          updateState $ \\s -> s{ sListStack =\n               List lo lvl'' lt' [newlist] : rest' }\n          closeLists lvl\n        (List lo lvl'' lt' (i:is) : rest') -> do\n          updateState $ \\s -> s{ sListStack =\n               List lo lvl'' lt' (i <> newlist : is) : rest' }\n          closeLists lvl\n    _ -> pure mempty\n\ncloseTable :: PandocMonad m => RTFParser m Blocks\ncloseTable = do\n  rawrows <- sTableRows <$> getState\n  if null rawrows\n     then return mempty\n     else do\n       let getCells (TableRow cs) = reverse cs\n       let rows = map getCells . reverse $ rawrows\n       updateState $ \\s -> s{ sCurrentCell = mempty\n                            , sTableRows = [] }\n       return $ B.simpleTable [] rows\n\ncloseContainers :: PandocMonad m => RTFParser m Blocks\ncloseContainers = do\n  tbl <- closeTable\n  lists <- closeLists 0\n  return $ tbl <> lists\n\ntrimFinalLineBreak :: Inlines -> Inlines\ntrimFinalLineBreak ils =\n  case Seq.viewr (B.unMany ils) of\n    rest Seq.:> LineBreak -> B.Many rest\n    _ -> ils\n\nemitBlocks :: PandocMonad m => Blocks -> RTFParser m Blocks\nemitBlocks bs = do\n  annotatedToks <- reverse . sTextContent <$> getState\n  updateState $ \\s -> s{ sTextContent = [] }\n  let justCode = def{ gFontFamily = Just Modern }\n  let prop = case annotatedToks of\n               [] -> def\n               ((p,_):_) -> p\n  tbl <- if gInTable prop || null annotatedToks\n            then pure mempty\n            else closeTable\n  new <-\n    case annotatedToks of\n      [] -> pure mempty\n      _ | Just lst <- gListOverride prop\n         -> do\n           let level = fromMaybe 0 $ gListLevel prop\n           listOverrideTable <- sListOverrideTable <$> getState\n           let listType = fromMaybe Bullet $\n                 IntMap.lookup lst listOverrideTable >>= IntMap.lookup level\n           lists <- sListStack <$> getState\n           -- get para contents of list item\n           let newbs = B.para . B.trimInlines . trimFinalLineBreak . mconcat $\n                        map addFormatting annotatedToks\n           case lists of\n             (List lo parentlevel _lt items : cs)\n               | lo == lst\n               , parentlevel == level\n               -- add another item to existing list\n               -> do updateState $ \\s ->\n                        s{ sListStack =\n                             List lo level listType (newbs:items) : cs }\n                     pure mempty\n               | lo /= lst || level < parentlevel\n               -- close parent list and add new list\n               -> do new <- closeLists level  -- close open lists > level\n                     updateState $ \\s ->\n                       s{ sListStack = List lst level listType [newbs] :\n                           sListStack s }\n                     pure new\n             _ -> do -- add new list (level > parentlevel)\n                  updateState $ \\s ->\n                    s{ sListStack = List lst level listType [newbs] :\n                         sListStack s }\n                  pure mempty\n        | Just lvl <- gOutlineLevel prop\n         -> do\n            lists <- closeLists 0\n            pure $ lists <>\n                   B.header (lvl + 1)\n                   (B.trimInlines . mconcat $ map addFormatting\n                                            $ removeCommonFormatting\n                                              annotatedToks)\n        | all ((== justCode) . fst) annotatedToks\n         -> do\n            lists <- closeLists 0\n            pure $ lists <>\n                    B.codeBlock (mconcat $ map snd annotatedToks)\n        | all (T.all isSpace . snd) annotatedToks\n         -> closeLists 0\n        | otherwise -> do\n            lists <- closeLists 0\n            pure $ lists <>\n              B.para (B.trimInlines . trimFinalLineBreak . mconcat\n                $ map addFormatting annotatedToks)\n  if gInTable prop\n     then do\n       updateState $ \\s -> s{ sCurrentCell = sCurrentCell s <> new }\n       pure bs\n     else do\n       pure $ bs <> tbl <> new\n\n-- Headers often have a style applied. We usually want to remove\n-- this, because headers will have their own styling in the target\n-- format.\nremoveCommonFormatting :: [(Properties, Text)] -> [(Properties, Text)]\nremoveCommonFormatting =\n  (\\ts ->\n    if all (gBold . fst) ts\n       then map (\\(p,t) -> (p{ gBold = False }, t)) ts\n       else ts) .\n  (\\ts ->\n    if all (gItalic . fst) ts\n       then map (\\(p,t) -> (p{ gItalic = False }, t)) ts\n       else ts)\n\n\n-- {\\field{\\*\\fldinst{HYPERLINK \"http://pandoc.org\"}}{\\fldrslt foo}}\nhandleField :: PandocMonad m => Blocks -> [Tok] -> RTFParser m Blocks\nhandleField bs ts = do\n  let isFieldMod (Tok _ (ControlWord w _)) =\n        w `elem` [\"flddirty\", \"fldedit\", \"fldlock\", \"fldpriv\"]\n      isFieldMod _ = False\n\n  let instructionTokens (Tok _ (Grouped toks)) = Just toks\n      instructionTokens unformattedTok@(Tok _ (UnformattedText _)) = Just [unformattedTok]\n      instructionTokens _ = Nothing\n  case dropWhile isFieldMod ts of\n    [Tok _ (Grouped\n       (Tok _ (ControlSymbol '*')\n       :Tok _ (ControlWord \"fldinst\" Nothing)\n       :instrtoks\n       :_)),\n     Tok _ (Grouped\n       (Tok _ (ControlWord \"fldrslt\" Nothing)\n       :resulttoks))] -> do\n         case instructionTokens instrtoks of\n           Nothing -> pure bs\n           Just instrtoks' ->\n             case getHyperlink instrtoks' of\n               Just linkdest -> do\n                 modifyGroup $ \\g -> g{ gHyperlink = Just linkdest }\n                 result <- foldM processTok bs resulttoks\n                 modifyGroup $ \\g -> g{ gHyperlink = Nothing }\n                 return result\n               Nothing -> foldM processTok bs resulttoks\n    _ -> pure bs\n\ngetHyperlink :: [Tok] -> Maybe Text\ngetHyperlink [] = Nothing\ngetHyperlink (Tok _ (UnformattedText w) : rest)\n  | Just w' <- unquote <$> T.stripPrefix \"HYPERLINK\" (T.strip w)\n    = if T.null w'\n         then case rest of\n                (Tok _ (ControlSymbol '\\\\') : Tok _ (UnformattedText b) : _)\n                  | Just bkmrk <- unquote <$> T.stripPrefix \"l \" (T.strip b)\n                    -> Just $ \"#\" <> bkmrk\n                _ -> Just mempty\n         else Just w'\ngetHyperlink (_:ts) = getHyperlink ts\n\nunquote :: Text -> Text\nunquote = T.dropWhile (=='\"') . T.dropWhileEnd (=='\"') . T.strip\n\nhandleListTable :: PandocMonad m => [Tok] -> RTFParser m ()\nhandleListTable toks = do\n  mapM_ handleList toks\n\nhandleList :: PandocMonad m => Tok -> RTFParser m ()\nhandleList (Tok _ (Grouped (Tok _ (ControlWord \"list\" _) : toks))) = do\n  let listid = headDef 0 [n | Tok _ (ControlWord \"listid\" (Just n)) <- toks]\n  let levels = [ts | Tok _ (Grouped (Tok _ (ControlWord \"listlevel\" _) : ts))\n                 <- toks]\n  tbl <- foldM handleListLevel mempty (zip [0..] levels)\n  updateState $ \\s -> s{ sListTable = IntMap.insert listid tbl $ sListTable s }\nhandleList _ = return ()\n\nhandleListLevel :: PandocMonad m\n                => ListLevelTable\n                -> (Int, [Tok])\n                -> RTFParser m ListLevelTable\nhandleListLevel levelTable (lvl, toks) = do\n  let start = headDef 1\n                [n | Tok _ (ControlWord \"levelstartat\" (Just n)) <- toks]\n  let mbNumberStyle =\n        case [n | Tok _ (ControlWord \"levelnfc\" (Just n)) <- toks] of\n          [] -> Nothing\n          (0:_) -> Just Decimal\n          (1:_) -> Just UpperRoman\n          (2:_) -> Just LowerRoman\n          (3:_) -> Just UpperAlpha\n          (4:_) -> Just LowerAlpha\n          (23:_) -> Nothing\n          (255:_) -> Nothing\n          _ -> Just DefaultStyle\n  let listType = case mbNumberStyle of\n                   Nothing -> Bullet\n                   Just numStyle -> Ordered (start,numStyle,Period)\n  return $ IntMap.insert lvl listType levelTable\n\nhandleListOverrideTable :: PandocMonad m => [Tok] -> RTFParser m ()\nhandleListOverrideTable toks = mapM_ handleListOverride toks\n\nhandleListOverride :: PandocMonad m => Tok -> RTFParser m ()\nhandleListOverride\n (Tok _ (Grouped (Tok _ (ControlWord \"listoverride\" _) : toks))) = do\n  let listid = headDef 0 [n | Tok _ (ControlWord \"listid\" (Just n)) <- toks]\n  let lsn = headDef 0 [n | Tok _ (ControlWord \"ls\" (Just n)) <- toks]\n  -- TODO override stuff, esp. start num -- for now we just handle indirection\n  listTable <- sListTable <$> getState\n  case IntMap.lookup listid listTable of\n    Nothing -> return ()\n    Just tbl -> updateState $ \\s ->\n                   s{ sListOverrideTable = IntMap.insert lsn tbl $\n                        sListOverrideTable s }\nhandleListOverride _ = return ()\n\nhandleStylesheet :: PandocMonad m => [Tok] -> RTFParser m ()\nhandleStylesheet toks = do\n  let styles = mapMaybe parseStyle toks\n  updateState $ \\s -> s{ sStylesheet = IntMap.fromList\n                                     $ zip (map styleNum styles) styles }\n\nparseStyle :: Tok -> Maybe Style\nparseStyle (Tok _ (Grouped toks)) = do\n  let (styType, styNum, rest) =\n        case toks of\n          Tok _ (ControlWord \"s\" (Just n)) : ts -> (ParagraphStyle, n, ts)\n          Tok _ (ControlWord \"ds\" (Just n)) : ts -> (SectionStyle, n, ts)\n          Tok _ (ControlWord \"cs\" (Just n)) : ts -> (CharStyle, n, ts)\n          Tok _ (ControlWord \"ts\" (Just n)) : ts -> (TableStyle, n, ts)\n          _ -> (ParagraphStyle, 0, toks)\n  let styName = case lastMay rest of\n                  Just (Tok _ (UnformattedText t)) -> T.dropWhileEnd (==';') t\n                  _ -> mempty\n  let isBasedOn (Tok _ (ControlWord \"sbasedon\" (Just _))) = True\n      isBasedOn _ = False\n  let styBasedOn = case L.find isBasedOn toks of\n                     Just (Tok _ (ControlWord \"sbasedon\" (Just i))) -> Just i\n                     _ -> Nothing\n  let isStyleControl (Tok _ (ControlWord x _)) =\n         x `elem` [\"cs\", \"s\", \"ds\", \"additive\", \"sbasedon\", \"snext\",\n                   \"sautoupd\", \"shidden\", \"keycode\", \"alt\", \"shift\",\n                   \"ctrl\", \"fn\"]\n      isStyleControl _ = False\n  let styFormatting = filter (not . isStyleControl) (initSafe rest)\n  return $ Style{ styleNum = styNum\n                , styleType = styType\n                , styleBasedOn = styBasedOn\n                , styleName = styName\n                , styleFormatting = styFormatting\n                }\nparseStyle _ = Nothing\n\nhexToWord  :: Text -> Word8\nhexToWord t = case TR.hexadecimal t of\n                Left _ -> 0\n                Right (x,_) -> x\n\n\nhandlePict :: PandocMonad m => [Tok] -> RTFParser m ()\nhandlePict toks = do\n  let pict = L.foldl' getPictData def toks\n  let altText = \"image\"\n  let bytes =\n        if picBinary pict\n           then picBytes pict\n           else BL.pack $ map hexToWord $ T.chunksOf 2 $ picData pict\n  let (mimetype, ext) =\n        case picType pict of\n          Just Emfblip -> (Just \"image/x-emf\", \".emf\")\n          Just Pngblip -> (Just \"image/png\", \".png\")\n          Just Jpegblip -> (Just \"image/jpeg\", \".jpg\")\n          Nothing -> (Nothing, \"\")\n  case mimetype of\n    Just mt -> do\n      let pictname = show (hashWith SHA1 $ BL.toStrict bytes) <> ext\n      insertMedia pictname (Just mt) bytes\n      modifyGroup $ \\g -> g{ gImage = Just pict{ picName = T.pack pictname,\n                                                 picBytes = bytes } }\n      addText altText\n      modifyGroup $ \\g -> g{ gImage = Nothing }\n    _ -> return ()\n where\n  getPictData :: Pict -> Tok -> Pict\n  getPictData pict (Tok _ tok') =\n    case tok' of\n      ControlWord \"emfblip\" _-> pict{ picType = Just Emfblip }\n      ControlWord \"pngblip\" _-> pict{ picType = Just Pngblip }\n      ControlWord \"jpegblip\" _-> pict{ picType = Just Jpegblip }\n      ControlWord \"picw\" (Just w) -> pict{ picWidth = Just w }\n      ControlWord \"pich\" (Just h) -> pict{ picHeight = Just h }\n      ControlWord \"picwgoal\" (Just w) -> pict{ picWidthGoal = Just w }\n      ControlWord \"pichgoal\" (Just h) -> pict{ picHeightGoal = Just h }\n      BinData d | not (BL.null d)\n                  -> pict{ picBinary = True, picBytes = picBytes pict <> d }\n      UnformattedText t -> pict{ picData = t }\n      _ -> pict\n\n\nprocessFontTable :: [Tok] -> FontTable\nprocessFontTable = snd . L.foldl' go (0, mempty)\n where\n  go (fontnum, tbl) (Tok _ tok') =\n    case tok' of\n     (ControlWord \"f\" (Just i)) -> (i, tbl)\n     (ControlWord \"fnil\" _) -> (fontnum, tbl)\n     (ControlWord \"froman\" _) -> (fontnum, IntMap.insert fontnum Roman tbl)\n     (ControlWord \"fswiss\" _) -> (fontnum, IntMap.insert fontnum Swiss tbl)\n     (ControlWord \"fmodern\" _) -> (fontnum, IntMap.insert fontnum Modern tbl)\n     (ControlWord \"fscript\" _) -> (fontnum, IntMap.insert fontnum Script tbl)\n     (ControlWord \"fdecor\" _) -> (fontnum, IntMap.insert fontnum Decor tbl)\n     (ControlWord \"ftech\" _) -> (fontnum, IntMap.insert fontnum Tech tbl)\n     (ControlWord \"fbidi\" _) -> (fontnum, IntMap.insert fontnum Bidi tbl)\n     (Grouped ts) -> L.foldl' go (fontnum, tbl) ts\n     _ -> (fontnum, tbl)\n\ndefaultAnsiWordToChar :: Word8 -> Char\ndefaultAnsiWordToChar i =\n  case i of\n    128 -> '\\8364'\n    130 -> '\\8218'\n    131 -> '\\402'\n    132 -> '\\8222'\n    133 -> '\\8230'\n    134 -> '\\8224'\n    135 -> '\\8225'\n    136 -> '\\710'\n    137 -> '\\8240'\n    138 -> '\\352'\n    139 -> '\\8249'\n    140 -> '\\338'\n    142 -> '\\381'\n    145 -> '\\8216'\n    146 -> '\\8217'\n    147 -> '\\8220'\n    148 -> '\\8221'\n    149 -> '\\8226'\n    150 -> '\\8211'\n    151 -> '\\8212'\n    152 -> '\\732'\n    153 -> '\\8482'\n    154 -> '\\353'\n    155 -> '\\8250'\n    156 -> '\\339'\n    158 -> '\\382'\n    159 -> '\\376'\n    173 -> '\\xAD'\n    _ -> chr (fromIntegral i)\n\nmacToChar :: Word8 -> Char\nmacToChar i = chr $\n  case i of\n    0x80 -> 0xC4\n    0x81 -> 0xC5\n    0x82 -> 0xC7\n    0x83 -> 0xC9\n    0x84 -> 0xD1\n    0x85 -> 0xD6\n    0x86 -> 0xDC\n    0x87 -> 0xE1\n    0x88 -> 0xE0\n    0x89 -> 0xE2\n    0x8A -> 0xE4\n    0x8B -> 0xE3\n    0x8C -> 0xE5\n    0x8D -> 0xE7\n    0x8E -> 0xE9\n    0x8F -> 0xE8\n    0x90 -> 0xEA\n    0x91 -> 0xEB\n    0x92 -> 0xED\n    0x93 -> 0xEC\n    0x94 -> 0xEE\n    0x95 -> 0xEF\n    0x96 -> 0xF1\n    0x97 -> 0xF3\n    0x98 -> 0xF2\n    0x99 -> 0xF4\n    0x9A -> 0xF6\n    0x9B -> 0xF5\n    0x9C -> 0xFA\n    0x9D -> 0xF9\n    0x9E -> 0xFB\n    0x9F -> 0xFC\n    0xA0 -> 0xDD\n    0xA1 -> 0xB0\n    0xA2 -> 0xA2\n    0xA3 -> 0xA3\n    0xA4 -> 0xA7\n    0xA5 -> 0xD7\n    0xA6 -> 0xB6\n    0xA7 -> 0xDF\n    0xA8 -> 0xAE\n    0xA9 -> 0xA9\n    0xAA -> 0xB2\n    0xAB -> 0xB4\n    0xAC -> 0xA8\n    0xAD -> 0xB3\n    0xAE -> 0xC6\n    0xAF -> 0xD8\n    0xB0 -> 0xB9\n    0xB1 -> 0xB1\n    0xB2 -> 0xBC\n    0xB3 -> 0xBD\n    0xB4 -> 0xA5\n    0xB5 -> 0xB5\n    0xBA -> 0xBE\n    0xBB -> 0xAA\n    0xBC -> 0xBA\n    0xBE -> 0xE6\n    0xBF -> 0xF8\n    0xC0 -> 0xBF\n    0xC1 -> 0xA1\n    0xC2 -> 0xAC\n    0xC3 -> 0x0141\n    0xC4 -> 0x0192\n    0xC5 -> 0x02CB\n    0xC7 -> 0xAB\n    0xC8 -> 0xBB\n    0xC9 -> 0xA6\n    0xCA -> 0xA0\n    0xCB -> 0xC0\n    0xCC -> 0xC3\n    0xCD -> 0xD5\n    0xCE -> 0x0152\n    0xCF -> 0x0153\n    0xD0 -> 0xAD\n    0xD4 -> 0x0142\n    0xD6 -> 0xF7\n    0xD8 -> 0xFF\n    0xD9 -> 0x0178\n    0xDB -> 0xA4\n    0xDC -> 0xD0\n    0xDD -> 0xF0\n    0xDE -> 0xDE\n    0xDF -> 0xFE\n    0xE0 -> 0xFD\n    0xE1 -> 0xB7\n    0xE5 -> 0xC2\n    0xE6 -> 0xCA\n    0xE7 -> 0xC1\n    0xE8 -> 0xCB\n    0xE9 -> 0xC8\n    0xEA -> 0xCD\n    0xEB -> 0xCE\n    0xEC -> 0xCF\n    0xED -> 0xCC\n    0xEE -> 0xD3\n    0xEF -> 0xD4\n    0xF1 -> 0xD2\n    0xF2 -> 0xDA\n    0xF3 -> 0xDB\n    0xF4 -> 0xD9\n    0xF5 -> 0x0131\n    0xF6 -> 0x02C6\n    0xF7 -> 0x02DC\n    0xF8 -> 0xAF\n    0xF9 -> 0x02D8\n    0xFA -> 0x02D9\n    0xFB -> 0x02DA\n    0xFC -> 0xB8\n    0xFD -> 0x02DD\n    0xFE -> 0x02DB\n    0xFF -> 0x02C7\n    _ -> fromIntegral i\n\npcToChar :: Word8 -> Char\npcToChar i = chr $\n  case i of\n    0x80 -> 0xc7\n    0x81 -> 0xfc\n    0x82 -> 0xe9\n    0x83 -> 0xe2\n    0x84 -> 0xe4\n    0x85 -> 0xe0\n    0x86 -> 0xe5\n    0x87 -> 0xe7\n    0x88 -> 0xea\n    0x89 -> 0xeb\n    0x8a -> 0xe8\n    0x8b -> 0xef\n    0x8c -> 0xee\n    0x8d -> 0xec\n    0x8e -> 0xc4\n    0x8f -> 0xc5\n    0x90 -> 0xc9\n    0x91 -> 0xe6\n    0x92 -> 0xc6\n    0x93 -> 0xf4\n    0x94 -> 0xf6\n    0x95 -> 0xf2\n    0x96 -> 0xfb\n    0x97 -> 0xf9\n    0x98 -> 0xff\n    0x99 -> 0xd6\n    0x9a -> 0xdc\n    0x9b -> 0xa2\n    0x9c -> 0xa3\n    0x9d -> 0xa5\n    0x9e -> 0x20a7\n    0x9f -> 0x0192\n    0xa0 -> 0xe1\n    0xa1 -> 0xed\n    0xa2 -> 0xf3\n    0xa3 -> 0xfa\n    0xa4 -> 0xf1\n    0xa5 -> 0xd1\n    0xa6 -> 0xaa\n    0xa7 -> 0xba\n    0xa8 -> 0xbf\n    0xa9 -> 0x2310\n    0xaa -> 0xac\n    0xab -> 0xbd\n    0xac -> 0xbc\n    0xad -> 0xa1\n    0xae -> 0xab\n    0xaf -> 0xbb\n    0xb0 -> 0x2591\n    0xb1 -> 0x2592\n    0xb2 -> 0x2593\n    0xb3 -> 0x2502\n    0xb4 -> 0x2524\n    0xb5 -> 0x2561\n    0xb6 -> 0x2562\n    0xb7 -> 0x2556\n    0xb8 -> 0x2555\n    0xb9 -> 0x2563\n    0xba -> 0x2551\n    0xbb -> 0x2557\n    0xbc -> 0x255d\n    0xbd -> 0x255c\n    0xbe -> 0x255b\n    0xbf -> 0x2510\n    0xc0 -> 0x2514\n    0xc1 -> 0x2534\n    0xc2 -> 0x252c\n    0xc3 -> 0x251c\n    0xc4 -> 0x2500\n    0xc5 -> 0x253c\n    0xc6 -> 0x255e\n    0xc7 -> 0x255f\n    0xc8 -> 0x255a\n    0xc9 -> 0x2554\n    0xca -> 0x2569\n    0xcb -> 0x2566\n    0xcc -> 0x2560\n    0xcd -> 0x2550\n    0xce -> 0x256c\n    0xcf -> 0x2567\n    0xd0 -> 0x2568\n    0xd1 -> 0x2564\n    0xd2 -> 0x2565\n    0xd3 -> 0x2559\n    0xd4 -> 0x2558\n    0xd5 -> 0x2552\n    0xd6 -> 0x2553\n    0xd7 -> 0x256b\n    0xd8 -> 0x256a\n    0xd9 -> 0x2518\n    0xda -> 0x250c\n    0xdb -> 0x2588\n    0xdc -> 0x2584\n    0xdd -> 0x258c\n    0xde -> 0x2590\n    0xdf -> 0x2580\n    0xe0 -> 0x03b1\n    0xe1 -> 0xdf\n    0xe2 -> 0x0393\n    0xe3 -> 0x03c0\n    0xe4 -> 0x03a3\n    0xe5 -> 0x03c3\n    0xe6 -> 0xb5\n    0xe7 -> 0x03c4\n    0xe8 -> 0x03a6\n    0xe9 -> 0x0398\n    0xea -> 0x03a9\n    0xeb -> 0x03b4\n    0xec -> 0x221e\n    0xed -> 0x03c6\n    0xee -> 0x03b5\n    0xef -> 0x2229\n    0xf0 -> 0x2261\n    0xf1 -> 0xb1\n    0xf2 -> 0x2265\n    0xf3 -> 0x2264\n    0xf4 -> 0x2320\n    0xf5 -> 0x2321\n    0xf6 -> 0xf7\n    0xf7 -> 0x2248\n    0xf8 -> 0xb0\n    0xf9 -> 0x2219\n    0xfa -> 0xb7\n    0xfb -> 0x221a\n    0xfc -> 0x207f\n    0xfd -> 0xb2\n    0xfe -> 0x25a0\n    0xff -> 0xa0\n    _    -> fromIntegral i\n\npcaToChar :: Word8 -> Char\npcaToChar i = chr $\n  case i of\n    0x80 -> 0x00c7\n    0x81 -> 0x00fc\n    0x82 -> 0x00e9\n    0x83 -> 0x00e2\n    0x84 -> 0x00e4\n    0x85 -> 0x00e0\n    0x86 -> 0x00e5\n    0x87 -> 0x00e7\n    0x88 -> 0x00ea\n    0x89 -> 0x00eb\n    0x8a -> 0x00e8\n    0x8b -> 0x00ef\n    0x8c -> 0x00ee\n    0x8d -> 0x00ec\n    0x8e -> 0x00c4\n    0x8f -> 0x00c5\n    0x90 -> 0x00c9\n    0x91 -> 0x00e6\n    0x92 -> 0x00c6\n    0x93 -> 0x00f4\n    0x94 -> 0x00f6\n    0x95 -> 0x00f2\n    0x96 -> 0x00fb\n    0x97 -> 0x00f9\n    0x98 -> 0x00ff\n    0x99 -> 0x00d6\n    0x9a -> 0x00dc\n    0x9b -> 0x00f8\n    0x9c -> 0x00a3\n    0x9d -> 0x00d8\n    0x9e -> 0x00d7\n    0x9f -> 0x0192\n    0xa0 -> 0x00e1\n    0xa1 -> 0x00ed\n    0xa2 -> 0x00f3\n    0xa3 -> 0x00fa\n    0xa4 -> 0x00f1\n    0xa5 -> 0x00d1\n    0xa6 -> 0x00aa\n    0xa7 -> 0x00ba\n    0xa8 -> 0x00bf\n    0xa9 -> 0x00ae\n    0xaa -> 0x00ac\n    0xab -> 0x00bd\n    0xac -> 0x00bc\n    0xad -> 0x00a1\n    0xae -> 0x00ab\n    0xaf -> 0x00bb\n    0xb0 -> 0x2591\n    0xb1 -> 0x2592\n    0xb2 -> 0x2593\n    0xb3 -> 0x2502\n    0xb4 -> 0x2524\n    0xb5 -> 0x00c1\n    0xb6 -> 0x00c2\n    0xb7 -> 0x00c0\n    0xb8 -> 0x00a9\n    0xb9 -> 0x2563\n    0xba -> 0x2551\n    0xbb -> 0x2557\n    0xbc -> 0x255d\n    0xbd -> 0x00a2\n    0xbe -> 0x00a5\n    0xbf -> 0x2510\n    0xc0 -> 0x2514\n    0xc1 -> 0x2534\n    0xc2 -> 0x252c\n    0xc3 -> 0x251c\n    0xc4 -> 0x2500\n    0xc5 -> 0x253c\n    0xc6 -> 0x00e3\n    0xc7 -> 0x00c3\n    0xc8 -> 0x255a\n    0xc9 -> 0x2554\n    0xca -> 0x2569\n    0xcb -> 0x2566\n    0xcc -> 0x2560\n    0xcd -> 0x2550\n    0xce -> 0x256c\n    0xcf -> 0x00a4\n    0xd0 -> 0x00f0\n    0xd1 -> 0x00d0\n    0xd2 -> 0x00ca\n    0xd3 -> 0x00cb\n    0xd4 -> 0x00c8\n    0xd5 -> 0x0131\n    0xd6 -> 0x00cd\n    0xd7 -> 0x00ce\n    0xd8 -> 0x00cf\n    0xd9 -> 0x2518\n    0xda -> 0x250c\n    0xdb -> 0x2588\n    0xdc -> 0x2584\n    0xdd -> 0x00a6\n    0xde -> 0x00cc\n    0xdf -> 0x2580\n    0xe0 -> 0x00d3\n    0xe1 -> 0x00df\n    0xe2 -> 0x00d4\n    0xe3 -> 0x00d2\n    0xe4 -> 0x00f5\n    0xe5 -> 0x00d5\n    0xe6 -> 0x00b5\n    0xe7 -> 0x00fe\n    0xe8 -> 0x00de\n    0xe9 -> 0x00da\n    0xea -> 0x00db\n    0xeb -> 0x00d9\n    0xec -> 0x00fd\n    0xed -> 0x00dd\n    0xee -> 0x00af\n    0xef -> 0x00b4\n    0xf0 -> 0x00ad\n    0xf1 -> 0x00b1\n    0xf2 -> 0x2017\n    0xf3 -> 0x00be\n    0xf4 -> 0x00b6\n    0xf5 -> 0x00a7\n    0xf6 -> 0x00f7\n    0xf7 -> 0x00b8\n    0xf8 -> 0x00b0\n    0xf9 -> 0x00a8\n    0xfa -> 0x00b7\n    0xfb -> 0x00b9\n    0xfc -> 0x00b3\n    0xfd -> 0x00b2\n    0xfe -> 0x25a0\n    0xff -> 0x00a0\n    _    -> fromIntegral i\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Roff/Escape.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE TypeFamilyDependencies #-}\nmodule Text.Pandoc.Readers.Roff.Escape\n  ( escape,\n    escapeArg,\n    escIgnore,\n    RoffLikeLexer(..),\n  )\nwhere\nimport Text.Pandoc.Class.PandocMonad\n    ( PandocMonad(..), report, PandocMonad(..), report )\nimport Control.Monad\n    ( mzero, mplus, mzero, mplus )\nimport Data.Char (chr, isAscii, isAlphaNum)\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Shared (safeRead)\nimport qualified Data.Text.Normalize as Normalize\nimport Text.Pandoc.RoffChar (characterCodes, combiningAccents)\n\n-- | Functions and typeclass for escaping special characters in languages\n-- that inherit the Roff syntax.\n--\n-- For various reasons, the mdoc reader doesn't directly reuse the previously\n-- existing roff lexer. The main one is to make it possible to simultaneously\n-- process roff escapes and to tokenize mdoc macros correctly based on the\n-- control line contents. The extracted interface here allows the same `escape`\n-- function to work with lexers that target different token types and support\n-- different subsets of the original roff language.\n\ntype Lexer m x = ParsecT Sources (State x) m\n\n-- | Lexers for Roff macro\nclass (Monoid (Token x)) => RoffLikeLexer x where\n  -- | Type family for the lexer state\n  type State x = a | a -> x\n  -- | Type family for the token type being lexed\n  type Token x = a | a -> x\n  -- | Turn a `T.Text` into a token of the output\n  emit :: T.Text -> Token x\n  -- | Attempt to parse a roff predefined string sequence and push its expansion\n  -- onto the input stream.\n  expandString :: PandocMonad m => Lexer m x ()\n  -- | Parse the name of a defined string and return its expansion as a `Token`\n  escString :: PandocMonad m => Lexer m x (Token x)\n  -- | Parse the escape character\n  backslash :: PandocMonad m => Lexer m x ()\n  -- | If the given custom macro is defined in this document, emit a\n  -- tokenized \"1\", otherwise emit a tokenized \"0\", implementing the roff\n  -- escape @\\A@.\n  checkDefined :: PandocMonad m => T.Text -> Lexer m x (Token x)\n  -- | Output an appropriate token for the @\\E@ escape sequence. In roff, @\\E@\n  -- is an \"escape character intended to not be interpreted in copy mode\".\n  -- If the lexer being defined doesn't implement copy mode, @\\E@ can just be\n  -- lexed by 'backslash'\n  escE :: PandocMonad m => Lexer m x (Token x)\n  -- | Lex the low-level roff font selection escape @\\f@.\n  escFont :: PandocMonad m => Lexer m x (Token x)\n\n\ncharacterCodeMap :: M.Map T.Text Char\ncharacterCodeMap =\n  M.fromList $ map (\\(x,y) -> (y,x)) characterCodes\n\ncombiningAccentsMap :: M.Map T.Text Char\ncombiningAccentsMap =\n  M.fromList $ map (\\(x,y) -> (y,x)) combiningAccents\n\nescape ::  (PandocMonad m, RoffLikeLexer x) => Lexer m x (Token x)\nescape = try $ do\n  backslash\n  escapeGlyph <|> escapeNormal\n\nescapeGlyph :: (PandocMonad m, RoffLikeLexer x) => Lexer m x (Token x)\nescapeGlyph = do\n  c <- lookAhead (oneOf ['[','('])\n  escapeArg >>= resolveGlyph c\n\nresolveGlyph :: (PandocMonad m, RoffLikeLexer x) => Char -> T.Text -> Lexer m x (Token x)\nresolveGlyph delimChar glyph = do\n  let cs = T.replace \"_u\" \" u\" glyph -- unicode glyphs separated by _\n  (case T.words cs of\n      []  -> mzero\n      [s] -> case M.lookup s characterCodeMap `mplus` readUnicodeChar s of\n               Nothing -> mzero\n               Just c  -> return $ emit $ T.singleton c\n      (s:ss) -> do\n        basechar <- case M.lookup s characterCodeMap `mplus`\n                         readUnicodeChar s of\n                      Nothing ->\n                        case T.unpack s of\n                          [ch] | isAscii ch && isAlphaNum ch ->\n                                 return ch\n                          _ -> mzero\n                      Just c  -> return c\n        let addAccents [] xs = return $ Normalize.normalize Normalize.NFC $\n                                        T.reverse xs\n            addAccents (a:as) xs =\n              case M.lookup a combiningAccentsMap `mplus` readUnicodeChar a of\n                Just x  -> addAccents as $ T.cons x xs\n                Nothing -> mzero\n        addAccents ss (T.singleton basechar) >>= \\xs -> return $ emit xs)\n      <|> case delimChar of\n            '['  -> escUnknown (\"\\\\[\" <> glyph <> \"]\")\n            '('  -> escUnknown (\"\\\\(\" <> glyph)\n            '\\'' -> escUnknown (\"\\\\C'\" <> glyph <> \"'\")\n            _    -> Prelude.fail \"resolveGlyph: unknown glyph delimiter\"\n\nreadUnicodeChar :: T.Text -> Maybe Char\nreadUnicodeChar t = case T.uncons t of\n  Just ('u', cs) | T.length cs > 3 -> chr <$> safeRead (\"0x\" <> cs)\n  _ -> Nothing\n\nescapeNormal :: (PandocMonad m, RoffLikeLexer x) => Lexer m x (Token x)\nescapeNormal = do\n  c <- noneOf \"{}\"\n  optional expandString\n  let groffSkip = [escapeArg, countChar 1 (satisfy (/='\\n'))]\n  case c of\n    ' ' -> return $ emit \" \" -- mandoc_char(7) says this should be a nonbreaking space\n    '\"' -> mempty <$ skipMany (satisfy (/='\\n')) -- line comment\n    '#' -> mempty <$ manyTill anyChar newline\n    '%' -> return mempty  -- optional hyphenation\n    '&' -> return mempty  -- nonprintable zero-width\n    ')' -> return mempty  -- nonprintable zero-width\n    '*' -> escString\n    ',' -> return mempty  -- to fix spacing after roman\n    '-' -> return $ emit \"-\"\n    '.' -> return $ emit \".\"\n    '/' -> return mempty  -- to fix spacing before roman\n    '0' -> return $ emit \"\\x2007\" -- digit-width space\n    ':' -> return mempty  -- zero-width break\n    'A' -> quoteArg >>= checkDefined\n    'B' -> escIgnore 'B' [quoteArg]\n    'C' -> quoteArg >>= resolveGlyph '\\''\n    'D' -> escIgnore 'D' [quoteArg]\n    'E' -> escE\n    'F' -> escIgnore 'F' groffSkip\n    'H' -> escIgnore 'H' [quoteArg]\n    'L' -> escIgnore 'L' [quoteArg]\n    'M' -> escIgnore 'M' groffSkip\n    'N' -> escIgnore 'N' [quoteArg]\n    'O' -> escIgnore 'O' [countChar 1 (oneOf ['0','1'])]\n    'R' -> escIgnore 'R' [quoteArg]\n    'S' -> escIgnore 'S' [quoteArg]\n    'V' -> escIgnore 'V' groffSkip\n    'X' -> escIgnore 'X' [quoteArg]\n    'Y' -> escIgnore 'Y' groffSkip\n    'Z' -> escIgnore 'Z' [quoteArg]\n    '\\'' -> return $ emit \"'\"\n    '\\n' -> return mempty  -- line continuation\n    '^' -> return $ emit \"\\x200A\" -- 1/12 em space\n    '_' -> return $ emit \"_\"\n    '`' -> return $ emit \"`\"\n    'a' -> return mempty  -- \"non-interpreted leader character\"\n    'b' -> escIgnore 'b' [quoteArg]\n    'c' -> return mempty  -- interrupt text processing\n    'd' -> escIgnore 'd' [] -- forward down 1/2em\n    'e' -> return $ emit \"\\\\\"\n    'f' -> escFont\n    'g' -> escIgnore 'g' groffSkip\n    'h' -> escIgnore 'h' [quoteArg]\n    'k' -> escIgnore 'k' groffSkip\n    'l' -> escIgnore 'l' [quoteArg]\n    'm' -> escIgnore 'm' groffSkip\n    'n' -> escIgnore 'm' groffSkip\n    'o' -> escIgnore 'o' [quoteArg]\n    'p' -> escIgnore 'p' []\n    'r' -> escIgnore 'r' []\n    's' -> escIgnore 's' [escapeArg, signedNumber]\n    't' -> return $ emit \"\\t\"\n    'u' -> escIgnore 'u' []\n    'v' -> escIgnore 'v' [quoteArg]\n    'w' -> escIgnore 'w' [quoteArg]\n    'x' -> escIgnore 'x' [quoteArg]\n    'z' -> escIgnore 'z' [countChar 1 anyChar]\n    '|' -> return $ emit \"\\x2006\" --1/6 em space\n    '~' -> return $ emit \"\\160\" -- nonbreaking space\n    '\\\\' -> return $ emit \"\\\\\"\n    _   -> return $ emit $ T.singleton c\n    -- man 7 groff: \"If  a  backslash  is followed by a character that\n    -- does not constitute a defined escape sequence, the backslash\n    -- is  silently  ignored  and  the character maps to itself.\"\n\nescIgnore :: (PandocMonad m, RoffLikeLexer x)\n          => Char\n          -> [Lexer m x T.Text]\n          -> Lexer m x (Token x)\nescIgnore c argparsers = do\n  pos <- getPosition\n  arg <- snd <$> withRaw (choice argparsers) <|> return \"\"\n  report $ SkippedContent (\"\\\\\" <> T.cons c arg) pos\n  return mempty\n\nescUnknown :: (PandocMonad m, RoffLikeLexer x) => T.Text -> Lexer m x (Token x)\nescUnknown s = do\n  pos <- getPosition\n  report $ SkippedContent s pos\n  return $ emit \"\\xFFFD\"\n\nsignedNumber :: (PandocMonad m, RoffLikeLexer x) => Lexer m x T.Text\nsignedNumber = try $ do\n  sign <- option \"\" (\"-\" <$ char '-' <|> \"\" <$ char '+')\n  ds <- many1Char digit\n  return (sign <> ds)\n\n-- Parses: [..] or (..\nescapeArg :: (PandocMonad m, RoffLikeLexer x) => Lexer m x T.Text\nescapeArg = choice\n    [ char '[' *> optional expandString *>\n                  manyTillChar (noneOf ['\\n',']']) (char ']')\n    , char '(' *> optional expandString *>\n                  countChar 2 (satisfy (/='\\n'))\n    ]\n\n-- Parses: '..'\nquoteArg :: (PandocMonad m, RoffLikeLexer x) => Lexer m x T.Text\nquoteArg = char '\\'' *> manyTillChar (noneOf ['\\n','\\'']) (char '\\'')\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Roff.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns #-}\n{-# LANGUAGE TypeFamilies #-}\n{- |\n   Module      : Text.Pandoc.Readers.Roff\n   Copyright   : Copyright (C) 2018-2020 Yan Pashkovsky and John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Yan Pashkovsky <yanp.bugz@gmail.com>\n   Stability   : WIP\n   Portability : portable\n\nTokenizer for roff formats (man, ms).\n-}\nmodule Text.Pandoc.Readers.Roff\n  ( FontSpec(..)\n  , defaultFontSpec\n  , LinePart(..)\n  , Arg\n  , TableOption\n  , CellFormat(..)\n  , TableRow\n  , RoffToken(..)\n  , RoffTokens(..)\n  , linePartsToText\n  , lexRoff\n  )\nwhere\n\nimport Safe (lastDef)\nimport Control.Monad (void, guard)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Class.PandocMonad\n       (getResourcePath, readFileFromDirs, PandocMonad(..), report)\nimport Data.Char (isLower, toLower, toUpper, isAlphaNum)\nimport Data.Default (Default)\nimport qualified Data.Map as M\nimport Data.List (intercalate)\nimport qualified Data.Text as T\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.Readers.Roff.Escape\nimport qualified Data.Sequence as Seq\nimport qualified Data.Foldable as Foldable\n\n-- import Debug.Trace (traceShowId)\n\n--\n-- Data Types\n--\ndata FontSpec = FontSpec{ fontBold      :: Bool\n                        , fontItalic    :: Bool\n                        , fontMonospace :: Bool\n                        } deriving (Show, Eq, Ord)\n\ndefaultFontSpec :: FontSpec\ndefaultFontSpec = FontSpec False False False\n\ndata LinePart = RoffStr T.Text\n              | Font FontSpec\n              | MacroArg Int\n              deriving Show\n\ninstance RoffLikeLexer RoffTokens where\n  -- The token stream is a list of 'LinePart's\n  type Token RoffTokens = [LinePart]\n  type State RoffTokens = RoffState\n  emit t = [RoffStr t]\n  expandString = try $ do\n    pos <- getPosition\n    char '\\\\'\n    char '*'\n    cs <- escapeArg <|> countChar 1 anyChar\n    s <- linePartsToText <$> resolveText cs pos\n    addToInput s\n  escString = try $ do\n    pos <- getPosition\n    (do cs <- escapeArg <|> countChar 1 anyChar\n        resolveText cs pos)\n      <|> mempty <$ char 'S'\n  backslash = do\n    char '\\\\'\n    mode <- roffMode <$> getState\n    case mode of\n      -- experimentally, it seems you don't always need to double\n      -- the backslash in macro defs.  It's essential with \\\\$1,\n      -- but not with \\\\f[I].  So we make the second one optional.\n      CopyMode   -> optional $ char '\\\\'\n      NormalMode -> return ()\n  checkDefined name = do\n    macros <- customMacros <$> getState\n    case M.lookup name macros of\n      Just _  -> return [RoffStr \"1\"]\n      Nothing -> return [RoffStr \"0\"]\n  -- \\E is ignored in copy mode\n  escE = do\n      mode <- roffMode <$> getState\n      case mode of\n        CopyMode   -> return mempty\n        NormalMode -> return [RoffStr \"\\\\\"]\n  escFont = do\n    font <- escapeArg <|> countChar 1 alphaNum\n    font' <- if T.null font || font == \"P\"\n                then prevFont <$> getState\n                else return $ foldr processFontLetter defaultFontSpec $ T.unpack font\n    updateState $ \\st -> st{ prevFont = currentFont st\n                           , currentFont = font' }\n    return [Font font']\n    where\n      processFontLetter c fs\n                | isLower c    = processFontLetter (toUpper c) fs\n      processFontLetter 'B' fs = fs{ fontBold = True }\n      processFontLetter 'I' fs = fs{ fontItalic = True }\n      processFontLetter 'C' fs = fs{ fontMonospace = True }\n      processFontLetter _   fs = fs -- do nothing\n\ntype Arg = [LinePart]\n\ntype TableOption = (T.Text, T.Text)\n\ndata CellFormat =\n  CellFormat\n  { columnType     :: Char\n  , pipePrefix     :: Bool\n  , pipeSuffix     :: Bool\n  , columnSuffixes :: [T.Text]\n  } deriving (Show, Eq, Ord)\n\ntype TableRow = ([CellFormat], [RoffTokens])\n\ndata RoffToken = TextLine [LinePart]\n               | EmptyLine\n               | ControlLine T.Text [Arg] SourcePos\n               | Tbl [TableOption] [TableRow] SourcePos\n               deriving Show\n\nnewtype RoffTokens = RoffTokens { unRoffTokens :: Seq.Seq RoffToken }\n        deriving (Show, Semigroup, Monoid)\n\nsingleTok :: RoffToken -> RoffTokens\nsingleTok t = RoffTokens (Seq.singleton t)\n\ndata RoffMode = NormalMode\n              | CopyMode\n              deriving Show\n\ndata RoffState = RoffState { customMacros     :: M.Map T.Text RoffTokens\n                           , prevFont         :: FontSpec\n                           , currentFont      :: FontSpec\n                           , tableTabChar     :: Char\n                           , roffMode         :: RoffMode\n                           , lastExpression   :: Maybe Bool\n                           , afterConditional :: Bool\n                           } deriving Show\n\ninstance Default RoffState where\n  def = RoffState { customMacros = M.fromList\n                       $ map (\\(n, s) ->\n                                (n, singleTok\n                                  (TextLine [RoffStr s])))\n                       [ (\"Tm\", \"\\x2122\")\n                       , (\"lq\", \"\\x201C\")\n                       , (\"rq\", \"\\x201D\")\n                       , (\"R\",  \"\\x00AE\") ]\n                  , prevFont = defaultFontSpec\n                  , currentFont = defaultFontSpec\n                  , tableTabChar = '\\t'\n                  , roffMode = NormalMode\n                  , lastExpression = Nothing\n                  , afterConditional = False\n                  }\n\ntype RoffLexer m = ParsecT Sources RoffState m\n\n--\n-- Lexer: T.Text -> RoffToken\n--\n\neofline :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s u m ()\neofline = void newline <|> eof <|> () <$ lookAhead (string \"\\\\}\")\n\nspacetab :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s u m Char\nspacetab = char ' ' <|> char '\\t'\n\n-- separate function from lexMacro since real man files sometimes do not\n-- follow the rules\nlexComment :: PandocMonad m => RoffLexer m RoffTokens\nlexComment = do\n  try $ string \".\\\\\\\"\"\n  skipMany $ noneOf \"\\n\"\n  eofline\n  return mempty\n\nlexMacro :: PandocMonad m => RoffLexer m RoffTokens\nlexMacro = do\n  pos <- getPosition\n  st <- getState\n  guard $ sourceColumn pos == 1 || afterConditional st\n  char '.' <|> char '\\''\n  skipMany spacetab\n  macroName <- manyChar (satisfy isAlphaNum)\n  case macroName of\n    \"nop\" -> return mempty\n    \"ie\"  -> lexConditional \"ie\"\n    \"if\"  -> lexConditional \"if\"\n    \"el\"  -> lexConditional \"el\"\n    \"while\" -> lexConditional \"while\"\n               -- this doesn't get the semantics right but\n               -- avoids parse errors\n\n    _ -> do\n       args <- lexArgs\n       case macroName of\n         \"\"     -> return mempty\n         \"TS\"   -> lexTable pos\n         \"de\"   -> lexMacroDef args\n         \"de1\"  -> lexMacroDef args\n         \"ds\"   -> lexStringDef args\n         \"ds1\"  -> lexStringDef args\n         \"sp\"   -> return $ singleTok EmptyLine\n         \"so\"   -> lexIncludeFile args\n         _      -> resolveMacro macroName args pos\n\nlexTable :: PandocMonad m => SourcePos -> RoffLexer m RoffTokens\nlexTable pos = do\n  skipMany lexComment\n  spaces\n  opts <- try tableOptions <|> [] <$ optional (char ';')\n  case lookup \"tab\" opts of\n    Just (T.uncons -> Just (c, _)) -> updateState $ \\st -> st{ tableTabChar = c }\n    _                              -> updateState $ \\st -> st{ tableTabChar = '\\t' }\n  spaces\n  skipMany lexComment\n  spaces\n  rows <- lexTableRows\n  morerows <- many $ try $ do\n    string \".T&\"\n    skipMany spacetab\n    newline\n    lexTableRows\n  string \".TE\"\n  skipMany spacetab\n  eofline\n  return $ singleTok $ Tbl opts (rows <> concat morerows) pos\n\nlexTableRows :: PandocMonad m => RoffLexer m [TableRow]\nlexTableRows = do\n  aligns <- tableFormatSpec\n  spaces\n  skipMany $ lexComment\n          <|> try (mempty <$ (string \".sp\" >> skipMany spaceChar >> newline))\n  spaces\n  rows <- many (notFollowedBy (try (string \".TE\") <|> try (string \".T&\")) >>\n                  tableRow)\n  return $ zip aligns rows\n\ntableCell :: PandocMonad m => RoffLexer m RoffTokens\ntableCell = do\n  pos <- getPosition\n  (enclosedCell <|> simpleCell) >>= lexRoff pos . T.pack\n  where\n  enclosedCell = do\n    try (string \"T{\")\n    manyTill anyChar (try (string \"T}\"))\n  simpleCell = do\n    tabChar <- tableTabChar <$> getState\n    many (notFollowedBy (char tabChar <|> newline) >> anyChar)\n\ntableRow :: PandocMonad m => RoffLexer m [RoffTokens]\ntableRow = do\n  tabChar <- tableTabChar <$> getState\n  c <- tableCell\n  cs <- many $ try (char tabChar >> tableCell)\n  skipMany spacetab\n  eofline\n  skipMany lexComment\n  return (c:cs)\n\ntableOptions :: PandocMonad m => RoffLexer m [TableOption]\ntableOptions = many1 tableOption <* spaces <* char ';'\n\ntableOption :: PandocMonad m => RoffLexer m TableOption\ntableOption = do\n  k <- many1Char letter\n  v <- option \"\" $ try $ do\n         skipMany spacetab\n         char '('\n         manyTillChar anyChar (char ')')\n  skipMany spacetab\n  optional (char ',' >> skipMany spacetab)\n  return (k,v)\n\ntableFormatSpec :: PandocMonad m => RoffLexer m [[CellFormat]]\ntableFormatSpec = do\n  first <- tableFormatSpecLine\n  rest <- many $ try $ (newline <|> char ',') *> tableFormatSpecLine\n  let speclines = first:rest\n  spaces\n  char '.'\n  return $ speclines <> repeat (lastDef [] speclines) -- last line is default\n\ntableFormatSpecLine :: PandocMonad m => RoffLexer m [CellFormat]\ntableFormatSpecLine =\n  many1 $ skipMany spacetab *> tableColFormat <* skipMany spacetab\n\ntableColFormat :: PandocMonad m => RoffLexer m CellFormat\ntableColFormat = do\n    pipePrefix' <- option False\n                   $ True <$ try (string \"|\" <* notFollowedBy spacetab)\n    c <- oneOf ['a','A','c','C','l','L','n','N','r','R','s','S','^','_','-',\n                '=','|']\n    suffixes <- many $ try (skipMany spacetab *> countChar 1 digit) <|>\n      (do x <- oneOf ['b','B','d','D','e','E','f','F','i','I','m','M',\n                  'p','P','t','T','u','U','v','V','w','W','x','X', 'z','Z']\n          num <- case toLower x of\n                   'w' -> many1 digit <|>\n                           (do char '('\n                               xs <- manyTill anyChar (char ')')\n                               return (\"(\" <> xs <> \")\")) <|>\n                           return \"\"\n                   'f' -> count 1 alphaNum <* skipMany spacetab\n                   'm' -> count 1 alphaNum <* skipMany spacetab\n                   _   -> return \"\"\n          return $ T.pack $ x : num)\n    pipeSuffix' <- option False $ True <$ string \"|\"\n    return $ CellFormat\n             { columnType     = c\n             , pipePrefix     = pipePrefix'\n             , pipeSuffix     = pipeSuffix'\n             , columnSuffixes = suffixes }\n\n-- We don't fully handle the conditional.  But we do\n-- include everything under '.ie n', which occurs commonly\n-- in man pages.\nlexConditional :: PandocMonad m => T.Text -> RoffLexer m RoffTokens\nlexConditional mname = do\n  pos <- getPosition\n  skipMany spacetab\n  mbtest <- if mname == \"el\"\n               then fmap not . lastExpression <$> getState\n               else expression\n  skipMany spacetab\n  st <- getState -- save state, so we can reset it\n  ifPart <- do\n      optional $ try $ char '\\\\' >> newline\n      lexGroup\n       <|> do updateState $ \\s -> s{ afterConditional = True }\n              t <- manToken\n              updateState $ \\s -> s{ afterConditional = False }\n              return t\n  case mbtest of\n    Nothing    -> do\n      setState st  -- reset state, so we don't record macros in skipped section\n      report $ SkippedContent (T.cons '.' mname) pos\n      return mempty\n    Just True  -> return ifPart\n    Just False -> do\n      setState st\n      return mempty\n\nexpression :: PandocMonad m => RoffLexer m (Maybe Bool)\nexpression = do\n  raw <- charsInBalanced '(' ')' (T.singleton <$> (satisfy (/= '\\n')))\n      <|> many1Char nonspaceChar\n  returnValue $\n    case raw of\n      \"1\"  -> Just True\n      \"n\"  -> Just True  -- nroff mode\n      \"t\"  -> Just False -- troff mode\n      _    -> Nothing\n  where\n    returnValue v = do\n      updateState $ \\st -> st{ lastExpression = v }\n      return v\n\nlexGroup :: PandocMonad m => RoffLexer m RoffTokens\nlexGroup = do\n  groupstart\n  mconcat <$> manyTill manToken groupend\n  where\n    groupstart = try $ string \"\\\\{\" <* optional (try (string \"\\\\\\n\"))\n    groupend   = try $ string \"\\\\}\"\n\nlexIncludeFile :: PandocMonad m => [Arg] -> RoffLexer m RoffTokens\nlexIncludeFile args = do\n  pos <- getPosition\n  case args of\n    (f:_) -> do\n      let fp = linePartsToText f\n      dirs <- getResourcePath\n      result <- readFileFromDirs dirs $ T.unpack fp\n      case result of\n        Nothing  -> report $ CouldNotLoadIncludeFile fp pos\n        Just s   -> addToInput s\n      return mempty\n    []    -> return mempty\n\nresolveMacro :: PandocMonad m\n             => T.Text -> [Arg] -> SourcePos -> RoffLexer m RoffTokens\nresolveMacro macroName args pos = do\n  macros <- customMacros <$> getState\n  case M.lookup macroName macros of\n    Nothing -> return $ singleTok $ ControlLine macroName args pos\n    Just ts -> do\n      let fillLP (MacroArg i)    zs =\n            case drop (i - 1) args of\n              []     -> zs\n              (ys:_) -> ys <> zs\n          fillLP z zs = z : zs\n      let fillMacroArg (TextLine lineparts) =\n            TextLine (foldr fillLP [] lineparts)\n          fillMacroArg x = x\n      return $ RoffTokens . fmap fillMacroArg . unRoffTokens $ ts\n\nlexStringDef :: PandocMonad m => [Arg] -> RoffLexer m RoffTokens\nlexStringDef args = do -- string definition\n   case args of\n     []     -> Prelude.fail \"No argument to .ds\"\n     (x:ys) -> do\n       let ts = singleTok $ TextLine (intercalate [RoffStr \" \" ] ys)\n       let stringName = linePartsToText x\n       updateState $ \\st ->\n         st{ customMacros = M.insert stringName ts (customMacros st) }\n   return mempty\n\nlexMacroDef :: PandocMonad m => [Arg] -> RoffLexer m RoffTokens\nlexMacroDef args = do -- macro definition\n   updateState $ \\st -> st{ roffMode = CopyMode }\n   (macroName, stopMacro) <-\n     case args of\n       (x : y : _) -> return (linePartsToText x, linePartsToText y)\n                      -- optional second arg\n       (x:_)       -> return (linePartsToText x, \".\")\n       []          -> Prelude.fail \"No argument to .de\"\n   let stop = try $ do\n         char '.' <|> char '\\''\n         skipMany spacetab\n         textStr stopMacro\n         _ <- lexArgs\n         return ()\n   ts <- mconcat <$> manyTill manToken stop\n   updateState $ \\st ->\n     st{ customMacros = M.insert macroName ts (customMacros st)\n       , roffMode = NormalMode }\n   return mempty\n\nlexArgs :: PandocMonad m => RoffLexer m [Arg]\nlexArgs = do\n  args <- many $ try oneArg\n  skipMany spacetab\n  eofline\n  return args\n\n  where\n\n  oneArg :: PandocMonad m => RoffLexer m [LinePart]\n  oneArg = do\n    skipMany $ try $ string \"\\\\\\n\"  -- continuation line\n    try quotedArg <|> plainArg\n    -- try, because there are some erroneous files, e.g. linux/bpf.2\n\n  plainArg :: PandocMonad m => RoffLexer m [LinePart]\n  plainArg = do\n    skipMany spacetab\n    mconcat <$> many1 (macroArg <|> escape <|> regularText <|> unescapedQuote)\n    where\n      unescapedQuote = char '\"' >> return [RoffStr \"\\\"\"]\n\n  quotedArg :: PandocMonad m => RoffLexer m [LinePart]\n  quotedArg = do\n    skipMany spacetab\n    char '\"'\n    xs <- mconcat <$>\n           many (macroArg <|> escape <|> regularText\n                 <|> spaceTabChar <|> escapedQuote)\n    char '\"'\n    return xs\n    where\n      escapedQuote = try $ do\n        char '\"'\n        char '\"'\n        return [RoffStr \"\\\"\"]\n\n-- strings and macros share namespace\nresolveText :: PandocMonad m\n              => T.Text -> SourcePos -> RoffLexer m [LinePart]\nresolveText stringname pos = do\n  RoffTokens ts <- resolveMacro stringname [] pos\n  case Foldable.toList ts of\n    [TextLine xs] -> return xs\n    _          -> do\n      report $ SkippedContent (\"unknown string \" <> stringname) pos\n      return mempty\n\nlexLine :: PandocMonad m => RoffLexer m RoffTokens\nlexLine = do\n  mode <- roffMode <$> getState\n  case mode of\n    CopyMode   -> optional $ try $ string \"\\\\&\"\n    NormalMode -> return ()\n  lnparts <- mconcat <$> many1 linePart\n  eofline\n  go lnparts\n  where  -- return empty line if we only have empty strings;\n         -- this can happen if the line just contains \\f[C], for example.\n    go [] = return mempty\n    go (RoffStr \"\" : xs) = go xs\n    go xs = return $ singleTok $ TextLine xs\n\nlinePart :: PandocMonad m => RoffLexer m [LinePart]\nlinePart = macroArg <|> escape <|>\n           regularText <|> quoteChar <|> spaceTabChar\n\nmacroArg :: PandocMonad m => RoffLexer m [LinePart]\nmacroArg = try $ do\n  pos <- getPosition\n  backslash\n  char '$'\n  x <- escapeArg <|> countChar 1 digit\n  case safeRead x of\n    Just i  -> return [MacroArg i]\n    Nothing -> do\n      report $ SkippedContent (\"illegal macro argument \" <> x) pos\n      return []\n\nregularText :: PandocMonad m => RoffLexer m [LinePart]\nregularText = do\n  s <- many1Char $ noneOf \"\\n\\r\\t \\\\\\\"\"\n  return [RoffStr s]\n\nquoteChar :: PandocMonad m => RoffLexer m [LinePart]\nquoteChar = do\n  char '\"'\n  return [RoffStr \"\\\"\"]\n\nspaceTabChar :: PandocMonad m => RoffLexer m [LinePart]\nspaceTabChar = do\n  c <- spacetab\n  return [RoffStr $ T.singleton c]\n\nlexEmptyLine :: PandocMonad m => RoffLexer m RoffTokens\nlexEmptyLine = newline >> return (singleTok EmptyLine)\n\nmanToken :: PandocMonad m => RoffLexer m RoffTokens\nmanToken = lexComment <|> lexMacro <|> lexLine <|> lexEmptyLine\n\nlinePartsToText :: [LinePart] -> T.Text\nlinePartsToText = mconcat . map go\n  where\n  go (RoffStr s) = s\n  go _ = mempty\n\n-- | Tokenize a string as a sequence of roff tokens.\nlexRoff :: PandocMonad m => SourcePos -> T.Text -> m RoffTokens\nlexRoff pos txt = do\n  eithertokens <- readWithM (do setPosition pos\n                                mconcat <$> many manToken) def txt\n  case eithertokens of\n    Left e       -> throwError e\n    Right tokenz -> return tokenz\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/TWiki.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.TWiki\n   Copyright   : Copyright (C) 2014 Alexander Sulfrian\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Sulfrian <alexander.sulfrian@fu-berlin.de>\n   Stability   : alpha\n   Portability : portable\n\nConversion of twiki text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.TWiki ( readTWiki\n                                 ) where\n\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport Data.Char (isAlphaNum, isDigit, isUpper, isLower, isLetter)\nimport qualified Data.Foldable as F\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.HTML.TagSoup\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (enclosed)\nimport Text.Pandoc.Readers.HTML (htmlTag, isCommentTag)\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.XML (fromEntities)\n\n-- | Read twiki from an input string and return a Pandoc document.\nreadTWiki :: (PandocMonad m, ToSources a)\n          => ReaderOptions\n          -> a\n          -> m Pandoc\nreadTWiki opts s = do\n  let sources = ensureFinalNewlines 2 (toSources s)\n  res <- readWithM parseTWiki def{ stateOptions = opts } sources\n  case res of\n       Left e  -> throwError e\n       Right d -> return d\n\ntype TWParser = ParsecT Sources ParserState\n\n--\n-- utility functions\n--\n\ntryMsg :: Text -> TWParser m a -> TWParser m a\ntryMsg msg p = try p <?> T.unpack msg\n\nhtmlElement :: PandocMonad m => Text -> TWParser m (Attr, Text)\nhtmlElement tag = tryMsg tag $ do\n  (TagOpen _ attr, _) <- htmlTag (~== TagOpen tag [])\n  content <- T.pack <$> manyTill anyChar (endtag <|> endofinput)\n  return (htmlAttrToPandoc attr, trim content)\n  where\n    endtag     = void $ htmlTag (~== TagClose tag)\n    endofinput = lookAhead $ try $ skipMany blankline >> skipSpaces >> eof\n    trim       = T.dropAround (=='\\n')\n\nhtmlAttrToPandoc :: [Attribute Text] -> Attr\nhtmlAttrToPandoc attrs = (ident, classes, keyvals)\n  where\n    ident   = fromMaybe \"\" $ lookup \"id\" attrs\n    classes = maybe [] T.words $ lookup \"class\" attrs\n    keyvals = [(k,v) | (k,v) <- attrs, k /= \"id\" && k /= \"class\"]\n\nparseHtmlContentWithAttrs :: PandocMonad m\n                          => Text -> TWParser m a -> TWParser m (Attr, [a])\nparseHtmlContentWithAttrs tag parser = do\n  (attr, content) <- htmlElement tag\n  parsedContent <- try $ parseContent content\n  return (attr, parsedContent)\n  where\n    parseContent = parseFromString' $ manyTill parser endOfContent\n    endOfContent = try $ skipMany blankline >> skipSpaces >> eof\n\nparseCharHtmlContentWithAttrs :: PandocMonad m\n                          => Text -> TWParser m Char -> TWParser m (Attr, Text)\nparseCharHtmlContentWithAttrs tag = fmap go . parseHtmlContentWithAttrs tag\n  where\n    go (x, y) = (x, T.pack y)\n\nparseHtmlContent :: PandocMonad m => Text -> TWParser m a -> TWParser m [a]\nparseHtmlContent tag p = snd <$> parseHtmlContentWithAttrs tag p\n\n--\n-- main parser\n--\n\nparseTWiki :: PandocMonad m => TWParser m Pandoc\nparseTWiki =\n  B.doc . mconcat <$> many block <* spaces <* eof\n\n\n--\n-- block parsers\n--\n\nblock :: PandocMonad m => TWParser m B.Blocks\nblock = do\n  res <- mempty <$ skipMany1 blankline\n         <|> blockElements\n         <|> para\n  skipMany blankline\n  trace (T.take 60 $ tshow $ B.toList res)\n  return res\n\nblockElements :: PandocMonad m => TWParser m B.Blocks\nblockElements = choice [ separator\n                       , header\n                       , verbatim\n                       , literal\n                       , list \"\"\n                       , table\n                       , blockQuote\n                       , noautolink\n                       ]\n\nseparator :: PandocMonad m => TWParser m B.Blocks\nseparator = tryMsg \"separator\" $ string \"---\" >> newline >> return B.horizontalRule\n\nheader :: PandocMonad m => TWParser m B.Blocks\nheader = tryMsg \"header\" $ do\n  string \"---\"\n  level <- length <$> many1 (char '+')\n  guard $ level <= 6\n  classes <- option [] $ string \"!!\" >> return [\"unnumbered\"]\n  skipSpaces\n  content <- B.trimInlines . mconcat <$> manyTill inline newline\n  attr <- registerHeader (\"\", classes, []) content\n  return $ B.headerWith attr level content\n\nverbatim :: PandocMonad m => TWParser m B.Blocks\nverbatim = uncurry B.codeBlockWith <$> (htmlElement \"verbatim\" <|> htmlElement \"pre\")\n\nliteral :: PandocMonad m => TWParser m B.Blocks\nliteral = rawBlock <$> htmlElement \"literal\"\n  where\n    format (_, _, kvs)        = fromMaybe \"html\" $ lookup \"format\" kvs\n    rawBlock (attrs, content) = B.rawBlock (format attrs) content\n\nlist :: PandocMonad m => Text -> TWParser m B.Blocks\nlist prefix = choice [ bulletList prefix\n                     , orderedList prefix\n                     , definitionList prefix]\n\ndefinitionList :: PandocMonad m => Text -> TWParser m B.Blocks\ndefinitionList prefix = tryMsg \"definitionList\" $ do\n  indent <- lookAhead $ textStr prefix *> many1 (textStr \"   \") <* textStr \"$ \"\n  elements <- many $ parseDefinitionListItem (prefix <> T.concat indent)\n  return $ B.definitionList elements\n  where\n    parseDefinitionListItem :: PandocMonad m\n                            => Text -> TWParser m (B.Inlines, [B.Blocks])\n    parseDefinitionListItem indent = do\n      textStr (indent <> \"$ \") >> skipSpaces\n      term <- many1Till inline $ string \": \"\n      line <- listItemLine indent $ string \"$ \"\n      return (mconcat term, [line])\n\nbulletList :: PandocMonad m => Text -> TWParser m B.Blocks\nbulletList prefix = tryMsg \"bulletList\" $\n                    parseList prefix (char '*') (char ' ')\n\norderedList :: PandocMonad m => Text -> TWParser m B.Blocks\norderedList prefix = tryMsg \"orderedList\" $\n                     parseList prefix (oneOf \"1iIaA\") (string \". \")\n\nparseList :: PandocMonad m\n          => Text -> TWParser m Char -> TWParser m a -> TWParser m B.Blocks\nparseList prefix marker delim = do\n  (indent, style) <- lookAhead $ textStr prefix *> listStyle <* delim\n  blocks <- many $ parseListItem (prefix <> indent) (char style <* delim)\n  return $ case style of\n    '1' -> B.orderedListWith (1, DefaultStyle, DefaultDelim) blocks\n    'i' -> B.orderedListWith (1, LowerRoman, DefaultDelim) blocks\n    'I' -> B.orderedListWith (1, UpperRoman, DefaultDelim) blocks\n    'a' -> B.orderedListWith (1, LowerAlpha, DefaultDelim) blocks\n    'A' -> B.orderedListWith (1, UpperAlpha, DefaultDelim) blocks\n    _   -> B.bulletList blocks\n  where\n    listStyle = do\n      indent <- many1 $ textStr \"   \"\n      style <- marker\n      return (T.concat indent, style)\n\nparseListItem :: (PandocMonad m, Show a)\n              => Text -> TWParser m a -> TWParser m B.Blocks\nparseListItem prefix marker = textStr prefix >> marker >> listItemLine prefix marker\n\nlistItemLine :: (PandocMonad m, Show a)\n             => Text -> TWParser m a -> TWParser m B.Blocks\nlistItemLine prefix marker = mconcat <$> (lineContent >>= parseContent)\n  where\n    lineContent = do\n      content <- anyLine\n      continuation <- optionMaybe listContinuation\n      return $ filterSpaces content <> \"\\n\" <> maybe \"\" (\"   \" <>) continuation\n    filterSpaces = T.dropWhileEnd (== ' ')\n    listContinuation = notFollowedBy (textStr prefix >> marker) >>\n                       string \"   \" >> lineContent\n    parseContent = parseFromString' $ many1 $ nestedList <|> parseInline\n    parseInline = B.plain . mconcat <$> many1Till inline (lastNewline <|> newlineBeforeNestedList)\n    nestedList = list prefix\n    lastNewline = try $ char '\\n' <* eof\n    newlineBeforeNestedList = try $ char '\\n' <* lookAhead nestedList\n\ntable :: PandocMonad m => TWParser m B.Blocks\ntable = try $ do\n  thead <- optionMaybe (unzip <$> many1Till tableParseHeader newline)\n  rows <- many1 tableParseRow\n  return $ buildTable mempty rows $ fromMaybe (align rows, columns rows) thead\n  where\n    buildTable caption rows (aligns, heads)\n                    = B.table (B.simpleCaption $ B.plain caption)\n                              aligns\n                              (TableHead nullAttr $ toHeaderRow heads)\n                              [TableBody nullAttr 0 [] $ map toRow rows]\n                              (TableFoot nullAttr [])\n    align rows      = replicate (columnCount rows)\n                         (AlignDefault, ColWidthDefault)\n    columns rows    = replicate (columnCount rows) mempty\n    columnCount (r:_) = length r\n    columnCount []  = 0\n    toRow           = Row nullAttr . map B.simpleCell\n    toHeaderRow l = [toRow l | not (null l)]\n\ntableParseHeader :: PandocMonad m => TWParser m ((Alignment, ColWidth), B.Blocks)\ntableParseHeader = try $ do\n  char '|'\n  leftSpaces <- length <$> many spaceChar\n  char '*'\n  content <- tableColumnContent (char '*' >> skipSpaces >> char '|')\n  char '*'\n  rightSpaces <- length <$> many spaceChar\n  optional tableEndOfRow\n  return (tableAlign leftSpaces rightSpaces, content)\n  where\n    tableAlign left right\n      | left >= 2 && left == right = (AlignCenter, ColWidthDefault)\n      | left > right = (AlignRight, ColWidthDefault)\n      | otherwise = (AlignLeft, ColWidthDefault)\n\ntableParseRow :: PandocMonad m => TWParser m [B.Blocks]\ntableParseRow = many1Till tableParseColumn newline\n\ntableParseColumn :: PandocMonad m => TWParser m B.Blocks\ntableParseColumn = char '|' *> skipSpaces *>\n                   tableColumnContent (skipSpaces >> char '|')\n                   <* skipSpaces <* optional tableEndOfRow\n\ntableEndOfRow :: PandocMonad m => TWParser m Char\ntableEndOfRow = lookAhead (try $ char '|' >> char '\\n') >> char '|'\n\ntableColumnContent :: PandocMonad m => TWParser m a -> TWParser m B.Blocks\ntableColumnContent end = B.plain . mconcat <$> manyTill content (lookAhead $ try end)\n  where\n    content = continuation <|> inline\n    continuation = try $ char '\\\\' >> newline >> return mempty\n\nblockQuote :: PandocMonad m => TWParser m B.Blocks\nblockQuote = B.blockQuote . mconcat <$> parseHtmlContent \"blockquote\" block\n\nnoautolink :: PandocMonad m => TWParser m B.Blocks\nnoautolink = do\n  (_, content) <- htmlElement \"noautolink\"\n  st <- getState\n  setState $ st{ stateAllowLinks = False }\n  blocks <- try $ parseContent content\n  setState $ st{ stateAllowLinks = True }\n  return $ mconcat blocks\n  where\n    parseContent = parseFromString' $ many block\n\npara :: PandocMonad m => TWParser m B.Blocks\npara = result . mconcat <$> many1Till inline endOfParaElement\n where\n   endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement\n   endOfInput       = try $ skipMany blankline >> skipSpaces >> eof\n   endOfPara        = try $ blankline >> skipMany1 blankline\n   newBlockElement  = try $ blankline >> void blockElements\n   result content   = if F.all (==Space) content\n                      then mempty\n                      else B.para $ B.trimInlines content\n\n\n--\n-- inline parsers\n--\n\ninline :: PandocMonad m => TWParser m B.Inlines\ninline = choice [ whitespace\n                , br\n                , macro\n                , strong\n                , strongHtml\n                , strongAndEmph\n                , emph\n                , emphHtml\n                , boldCode\n                , smart\n                , link\n                , htmlComment\n                , code\n                , codeHtml\n                , nop\n                , autoLink\n                , str\n                , symbol\n                ] <?> \"inline\"\n\nwhitespace :: PandocMonad m => TWParser m B.Inlines\nwhitespace = lb <|> regsp\n  where lb = try $ skipMany spaceChar >> linebreak >> return B.space\n        regsp = try $ skipMany1 spaceChar >> return B.space\n\nbr :: PandocMonad m => TWParser m B.Inlines\nbr = try $ string \"%BR%\" >> return B.linebreak\n\nlinebreak :: PandocMonad m => TWParser m B.Inlines\nlinebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)\n  where lastNewline  = eof >> return mempty\n        innerNewline = return B.space\n\nbetween :: (Monoid c, PandocMonad m, Show b)\n        => TWParser m a -> TWParser m b -> (TWParser m b -> TWParser m c)\n        -> TWParser m c\nbetween start end p =\n  mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)\n\nenclosed :: (Monoid b, PandocMonad m, Show a)\n         => TWParser m a -> (TWParser m a -> TWParser m b) -> TWParser m b\nenclosed sep p = between sep (try $ sep <* endMarker) p\n  where\n    endMarker   = lookAhead $ void endSpace <|> void (oneOf \".,!?:)|\") <|> eof\n    endSpace    = (spaceChar <|> newline) >> return B.space\n\nmacro :: PandocMonad m => TWParser m B.Inlines\nmacro = macroWithParameters <|> withoutParameters\n  where\n    withoutParameters = emptySpan <$> enclosed (char '%') (const macroName)\n    emptySpan name = buildSpan name [] mempty\n\nmacroWithParameters :: PandocMonad m => TWParser m B.Inlines\nmacroWithParameters = try $ do\n  char '%'\n  name <- macroName\n  (content, kvs) <- attributes\n  char '%'\n  return $ buildSpan name kvs $ B.str content\n\nbuildSpan :: Text -> [(Text, Text)] -> B.Inlines -> B.Inlines\nbuildSpan className kvs = B.spanWith attrs\n  where\n    attrs             = (\"\", [\"twiki-macro\", className] ++ additionalClasses, kvsWithoutClasses)\n    additionalClasses = maybe [] T.words $ lookup \"class\" kvs\n    kvsWithoutClasses = [(k,v) | (k,v) <- kvs, k /= \"class\"]\n\nmacroName :: PandocMonad m => TWParser m Text\nmacroName = do\n  first <- letter\n  rest <- many $ alphaNum <|> char '_'\n  return $ T.pack $ first:rest\n\nattributes :: PandocMonad m => TWParser m (Text, [(Text, Text)])\nattributes = foldr (either mkContent mkKvs) (\"\", [])\n  <$> (char '{' *> spnl *> many (attribute <* spnl) <* char '}')\n  where\n    spnl                      = skipMany (spaceChar <|> newline)\n    mkContent c  (\"\", kvs)    = (c, kvs)\n    mkContent c  (rest, kvs)  = (c <> \" \" <> rest, kvs)\n    mkKvs     kv (cont, rest) = (cont, kv : rest)\n\nattribute :: PandocMonad m => TWParser m (Either Text (Text, Text))\nattribute = withKey <|> withoutKey\n  where\n    withKey = try $ do\n      key <- macroName\n      char '='\n      curry Right key <$> parseValue False\n    withoutKey = try $ Left <$> parseValue True\n    parseValue allowSpaces = fromEntities <$> (withQuotes <|> withoutQuotes allowSpaces)\n    withQuotes             = between (char '\"') (char '\"') (\\_ -> countChar 1 $ noneOf ['\"'])\n    withoutQuotes allowSpaces\n      | allowSpaces = many1Char $ noneOf \"}\"\n      | otherwise   = many1Char $ noneOf \" }\"\n\nnestedInlines :: (Show a, PandocMonad m)\n              => TWParser m a -> TWParser m B.Inlines\nnestedInlines end = innerSpace <|> nestedInline\n  where\n    innerSpace   = try $ whitespace <* notFollowedBy end\n    nestedInline = notFollowedBy whitespace >> inline\n\nstrong :: PandocMonad m => TWParser m B.Inlines\nstrong = try $ B.strong <$> enclosed (char '*') nestedInlines\n\nstrongHtml :: PandocMonad m => TWParser m B.Inlines\nstrongHtml = B.strong . mconcat <$> (parseHtmlContent \"strong\" inline <|> parseHtmlContent \"b\" inline)\n\nstrongAndEmph :: PandocMonad m => TWParser m B.Inlines\nstrongAndEmph = try $ B.emph . B.strong <$> enclosed (string \"__\") nestedInlines\n\nemph :: PandocMonad m => TWParser m B.Inlines\nemph = try $ B.emph <$> enclosed (char '_')\n                        (\\p -> notFollowedBy (char '|') >> nestedInlines p)\n-- emphasis closers can't cross table cell boundaries, see #3921\n\nemphHtml :: PandocMonad m => TWParser m B.Inlines\nemphHtml = B.emph . mconcat <$> (parseHtmlContent \"em\" inline <|> parseHtmlContent \"i\" inline)\n\nnestedString :: (Show a, PandocMonad m)\n             => TWParser m a -> TWParser m Text\nnestedString end = innerSpace <|> countChar 1 nonspaceChar\n  where\n    innerSpace = try $ many1Char spaceChar <* notFollowedBy end\n\nboldCode :: PandocMonad m => TWParser m B.Inlines\nboldCode = try $ B.strong . B.code . fromEntities <$> enclosed (string \"==\") nestedString\n\nhtmlComment :: PandocMonad m => TWParser m B.Inlines\nhtmlComment = htmlTag isCommentTag >> return mempty\n\ncode :: PandocMonad m => TWParser m B.Inlines\ncode = try $ B.code . fromEntities <$> enclosed (char '=') nestedString\n\ncodeHtml :: PandocMonad m => TWParser m B.Inlines\ncodeHtml = do\n  (attrs, content) <- parseCharHtmlContentWithAttrs \"code\" anyChar\n  return $ B.codeWith attrs $ fromEntities content\n\nautoLink :: PandocMonad m => TWParser m B.Inlines\nautoLink = try $ do\n  state <- getState\n  guard $ stateAllowLinks state\n  (text, url) <- parseLink\n  guard $ checkLink (T.last url)\n  return $ makeLink (text, url)\n  where\n    parseLink            = notFollowedBy nop >> (uri <|> emailAddress)\n    makeLink (text, url) = B.link url \"\" $ B.str text\n    checkLink c\n      | c == '/' = True\n      | otherwise = isAlphaNum c\n\nstr :: PandocMonad m => TWParser m B.Inlines\nstr = B.str <$> (many1Char alphaNum <|> characterReference)\n\nnop :: PandocMonad m => TWParser m B.Inlines\nnop = try $ (void exclamation <|> void nopTag) >> followContent\n  where\n    exclamation   = char '!'\n    nopTag        = stringAnyCase \"<nop>\"\n    followContent = B.str . fromEntities <$> many1Char nonspaceChar\n\nsymbol :: PandocMonad m => TWParser m B.Inlines\nsymbol = B.str <$> countChar 1 nonspaceChar\n\nsmart :: PandocMonad m => TWParser m B.Inlines\nsmart = smartPunctuation inline\n\nlink :: PandocMonad m => TWParser m B.Inlines\nlink = try $ do\n  st <- getState\n  guard $ stateAllowLinks st\n  setState $ st{ stateAllowLinks = False }\n  (url, title, classes, content) <- linkText <|> simpleWikiLink\n  setState $ st{ stateAllowLinks = True }\n  return $ B.linkWith (\"\",classes,[]) url title content\n\nlinkText :: PandocMonad m => TWParser m (Text, Text, [Text], B.Inlines)\nlinkText = do\n  string \"[[\"\n  url <- T.pack <$> many1Till anyChar (char ']')\n  content <- option (B.str url) (mconcat <$> linkContent)\n  char ']'\n  return (url, \"\", [], content)\n  where\n    linkContent      = char '[' >> many1Till anyChar (char ']') >>= parseLinkContent . T.pack\n    parseLinkContent = parseFromString' $ many1 inline\n\nsimpleWikiLink :: PandocMonad m => TWParser m (Text, Text, [Text], B.Inlines)\nsimpleWikiLink = do\n  w <- wikiWord\n  return (w, \"\", [\"wikilink\"], B.str w)\n where\n   wikiWord = do\n     cs <- many1 $ satisfy (\\x -> isLetter x && isUpper x)\n     ds <- many1 $ satisfy (\\x -> isDigit x || (isLetter x && isLower x))\n     es <- many1 $ satisfy (\\x -> isLetter x && isUpper x)\n     fs <- many $ satisfy isAlphaNum\n     return $ T.pack $ cs ++ ds ++ es ++ fs\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Textile.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Readers.Textile\n   Copyright   : Copyright (C) 2010-2012 Paul Rivier\n                               2010-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Paul Rivier <paul*rivier#demotera*com>\n   Stability   : alpha\n   Portability : portable\n\nConversion from Textile to 'Pandoc' document, based on the spec\navailable at https://www.promptworks.com/textile/.\n\nImplemented and parsed:\n - Paragraphs\n - Code blocks\n - Lists\n - blockquote\n - Inlines : strong, emph, cite, code, deleted, superscript,\n   subscript, links\n - footnotes\n - HTML-specific and CSS-specific attributes on headers\n\nLeft to be implemented:\n - dimension sign\n - all caps\n - continued blocks (ex bq..)\n\nTODO : refactor common patterns across readers :\n - more ...\n\n-}\n\n\nmodule Text.Pandoc.Readers.Textile ( readTextile) where\nimport Control.Monad (guard, liftM)\nimport Control.Monad.Except (throwError)\nimport Data.Char (digitToInt, isUpper)\nimport Data.List (intersperse, transpose)\nimport qualified Data.List as L\nimport Data.List.NonEmpty (NonEmpty(..), nonEmpty)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.HTML.TagSoup (Tag (..), fromAttrib)\nimport Text.HTML.TagSoup.Match\nimport Text.Pandoc.Builder (Blocks, Inlines, trimInlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.CSS\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing\nimport Text.Pandoc.Readers.HTML (htmlTag, isBlockTag, isInlineTag)\nimport Text.Pandoc.Readers.LaTeX (rawLaTeXBlock, rawLaTeXInline)\nimport Text.Pandoc.Shared (trim, tshow)\nimport Text.Read (readMaybe)\n\n-- | Parse a Textile text and return a Pandoc document.\nreadTextile :: (PandocMonad m, ToSources a)\n            => ReaderOptions -- ^ Reader options\n            -> a\n            -> m Pandoc\nreadTextile opts s = do\n  let sources = ensureFinalNewlines 2 (toSources s)\n  parsed <- readWithM parseTextile def{ stateOptions = opts } sources\n  case parsed of\n     Right result -> return result\n     Left e       -> throwError e\n\ntype TextileParser = ParsecT Sources ParserState\n\n-- | Generate a Pandoc ADT from a textile document\nparseTextile :: PandocMonad m => TextileParser m Pandoc\nparseTextile = do\n  many blankline\n  startPos <- getPosition\n  -- go through once just to get list of reference keys and notes\n  -- docMinusKeys is the raw document with blanks where the keys/notes were...\n  let firstPassParser = do\n        pos <- getPosition\n        t <- noteBlock <|> referenceKey <|> lineClump\n        return (pos, t)\n  manyTill firstPassParser eof >>= setInput . Sources\n  setPosition startPos\n  st' <- getState\n  let reversedNotes = stateNotes st'\n  updateState $ \\s -> s { stateNotes = reverse reversedNotes }\n  -- now parse it for real...\n  Pandoc nullMeta . B.toList <$> parseBlocks -- FIXME\n\nnoteMarker :: PandocMonad m => TextileParser m Text\nnoteMarker = do\n  skipMany spaceChar\n  string \"fn\"\n  T.pack <$> manyTill digit (string \".\" <|> try (string \"^.\"))\n\nnoteBlock :: PandocMonad m => TextileParser m Text\nnoteBlock = try $ do\n  startPos <- getPosition\n  ref <- noteMarker\n  optional blankline\n  contents <- T.unlines <$> many1Till anyLine (blanklines <|> noteBlock)\n  endPos <- getPosition\n  let newnote = (ref, contents <> \"\\n\")\n  st <- getState\n  let oldnotes = stateNotes st\n  updateState $ \\s -> s { stateNotes = newnote : oldnotes }\n  -- return blanks so line count isn't affected\n  return $ T.replicate (sourceLine endPos - sourceLine startPos) \"\\n\"\n\nreferenceKey :: PandocMonad m => TextileParser m Text\nreferenceKey = try $ do\n  pos <- getPosition\n  char '['\n  refName <- T.pack <$> many1Till nonspaceChar (char ']')\n  refDestination <- T.pack <$> many1Till anyChar newline\n  st <- getState\n  let oldKeys = stateKeys st\n  let key = toKey refName\n  -- Textile doesn't support link titles on the reference\n  -- definition, so use the empty string\n  let target = (refDestination, \"\")\n  case M.lookup key oldKeys of\n    Just (t, _) | not (t == target) ->\n      -- similar to Markdown, only warn when the targets\n      -- for matching named references differ\n      logMessage $ DuplicateLinkReference refName pos\n    _ -> return ()\n  updateState $ \\s -> s {stateKeys = M.insert key (target, nullAttr) oldKeys }\n  return \"\\n\"\n\n-- | Parse document blocks\nparseBlocks :: PandocMonad m => TextileParser m Blocks\nparseBlocks = mconcat <$> manyTill block eof\n\n-- | Block parsers list tried in definition order\nblockParsers :: PandocMonad m => [TextileParser m Blocks]\nblockParsers = [ codeBlock\n               , header\n               , blockQuote\n               , hrule\n               , commentBlock\n               , anyList\n               , rawHtmlBlock\n               , rawLaTeXBlock'\n               , table\n               , explicitBlock \"p\" (para <|> pure (B.para mempty))\n               , para\n               , mempty <$ blanklines\n               ]\n\n-- | Any block in the order of definition of blockParsers\nblock :: PandocMonad m => TextileParser m Blocks\nblock = do\n  res <- choice blockParsers <?> \"block\"\n  trace (T.take 60 $ tshow $ B.toList res)\n  return res\n\ncommentBlock :: PandocMonad m => TextileParser m Blocks\ncommentBlock = try $ do\n  string \"###.\"\n  manyTill anyLine blanklines\n  return mempty\n\ncodeBlock :: PandocMonad m => TextileParser m Blocks\ncodeBlock = codeBlockTextile <|> codeBlockHtml\n\ncodeBlockTextile :: PandocMonad m => TextileParser m Blocks\ncodeBlockTextile = try $ do\n  string \"bc.\" <|> string \"pre.\"\n  extended <- option False (True <$ char '.')\n  char ' '\n  let starts = [\"p\", \"table\", \"bq\", \"bc\", \"pre\", \"h1\", \"h2\", \"h3\",\n                \"h4\", \"h5\", \"h6\", \"pre\", \"###\", \"notextile\"]\n  let ender = () <$ choice (map explicitBlockStart starts)\n  contents <- if extended\n                 then do\n                   f <- anyLine\n                   rest <- many (notFollowedBy ender *> anyLine)\n                   return (f:rest)\n                 else manyTill anyLine blanklines\n  return $ B.codeBlock (trimTrailingNewlines (T.unlines contents))\n\ntrimTrailingNewlines :: Text -> Text\ntrimTrailingNewlines = T.dropWhileEnd (=='\\n')\n\n-- | Code Blocks in Textile are between <pre> and </pre>\ncodeBlockHtml :: PandocMonad m => TextileParser m Blocks\ncodeBlockHtml = try $ do\n  (t@(TagOpen _ attrs),_) <- htmlTag (tagOpen (==\"pre\") (const True))\n  result' <- T.pack <$> manyTill anyChar (htmlTag (tagClose (==\"pre\")))\n  -- drop leading newline if any\n  let result'' = case T.uncons result' of\n                   Just ('\\n', xs) -> xs\n                   _               -> result'\n  -- drop trailing newline if any\n  let result''' = case T.unsnoc result'' of\n                    Just (xs, '\\n') -> xs\n                    _               -> result''\n  let classes = T.words $ fromAttrib \"class\" t\n  let ident = fromAttrib \"id\" t\n  let kvs = [(k,v) | (k,v) <- attrs, k /= \"id\" && k /= \"class\"]\n  return $ B.codeBlockWith (ident,classes,kvs) result'''\n\n-- | Header of the form \"hN. content\" with N in 1..6\nheader :: PandocMonad m => TextileParser m Blocks\nheader = try $ do\n  char 'h'\n  level <- digitToInt <$> oneOf \"123456\"\n  attr <- attributes\n  char '.'\n  lookAhead whitespace\n  name <- trimInlines . mconcat <$> many inline\n  attr' <- registerHeader attr name\n  return $ B.headerWith attr' level name\n\n-- | Blockquote of the form \"bq. content\"\nblockQuote :: PandocMonad m => TextileParser m Blocks\nblockQuote = try $ do\n  string \"bq\" >> attributes >> char '.' >> whitespace\n  B.blockQuote <$> para\n\n-- Horizontal rule\n\nhrule :: PandocMonad m => TextileParser m Blocks\nhrule = try $ do\n  skipSpaces\n  start <- oneOf \"-*\"\n  count 2 (skipSpaces >> char start)\n  skipMany (spaceChar <|> char start)\n  newline\n  optional blanklines\n  return B.horizontalRule\n\n-- Lists handling\n\n-- | Can be a bullet list or an ordered list. This implementation is\n-- strict in the nesting, sublist must start at exactly \"parent depth\n-- plus one\"\nanyList :: PandocMonad m => TextileParser m Blocks\nanyList = try $ anyListAtDepth 1 <* blanklines\n\n-- | This allow one type of list to be nested into an other type,\n-- provided correct nesting\nanyListAtDepth :: PandocMonad m => Int -> TextileParser m Blocks\nanyListAtDepth depth = choice [ bulletListAtDepth depth,\n                                orderedListAtDepth depth,\n                                definitionList ]\n\n-- | Bullet List of given depth, depth being the number of leading '*'\nbulletListAtDepth :: PandocMonad m => Int -> TextileParser m Blocks\nbulletListAtDepth depth = try $ B.bulletList  <$> many1 (bulletListItemAtDepth depth)\n\n-- | Bullet List Item of given depth, depth being the number of\n-- leading '*'\nbulletListItemAtDepth :: PandocMonad m => Int -> TextileParser m Blocks\nbulletListItemAtDepth depth = try $ do\n  bulletListStartAtDepth depth\n  genericListItemContentsAtDepth depth\n\n-- | Ordered List of given depth, depth being the number of\n-- leading '#'\n-- The first Ordered List Item may have a start attribute\norderedListAtDepth :: PandocMonad m => Int -> TextileParser m Blocks\norderedListAtDepth depth = try $ do\n  (startNum, firstItem) <- firstOrderedListItemAtDepth depth\n  moreItems <- many (orderedListItemAtDepth depth)\n  let listItems = firstItem : moreItems\n  return $ B.orderedListWith (startNum, DefaultStyle, DefaultDelim) listItems\n\n-- | The first Ordered List Item, which could have a start attribute\nfirstOrderedListItemAtDepth :: PandocMonad m => Int\n                                             -> TextileParser m (Int, Blocks)\nfirstOrderedListItemAtDepth depth = try $ do\n  startNum <- orderedListStartAtDepth depth\n  contents <- genericListItemContentsAtDepth depth\n  return (startNum, contents)\n\n-- | Ordered List Item of given depth, depth being the number of\n-- leading '#'\norderedListItemAtDepth :: PandocMonad m => Int -> TextileParser m Blocks\norderedListItemAtDepth depth = try $ do\n  orderedListStartAtDepth depth\n  genericListItemContentsAtDepth depth\n\n-- | Lists always start with a number of leading characters '#' or '*'\n-- Ordered list start characters '#' can be followed by the start attribute\n-- number, but bullet list characters '*' can not\norderedListStartAtDepth :: PandocMonad m => Int -> TextileParser m Int\norderedListStartAtDepth depth = count depth (char '#') >>\n  try orderedListStartAttr <* (attributes >> whitespace)\n\nbulletListStartAtDepth :: PandocMonad m => Int -> TextileParser m ()\nbulletListStartAtDepth depth =  () <$ (count depth (char '*') >>\n                                       attributes >> whitespace)\n\n-- | The leading characters and start attributes differ between ordered and\n-- unordered lists, but their contents have the same structure and can\n-- share a Parser\ngenericListItemContentsAtDepth :: PandocMonad m => Int\n                                                -> TextileParser m Blocks\ngenericListItemContentsAtDepth depth = do\n  contents <- mconcat <$> many ((B.plain . mconcat <$> many1 inline) <|>\n                                try (newline >> codeBlockHtml))\n  newline\n  sublist <- option mempty (anyListAtDepth (depth + 1))\n  return $ contents <> sublist\n\n\n-- | A definition list is a set of consecutive definition items\ndefinitionList :: PandocMonad m => TextileParser m Blocks\ndefinitionList = try $ B.definitionList <$> many1 definitionListItem\n\n-- | List start character.\nlistStart :: PandocMonad m => TextileParser m ()\nlistStart = genericListStart '*'\n        <|> () <$ orderedListStart\n        <|> () <$ definitionListStart\n\ngenericListStart :: PandocMonad m => Char -> TextileParser m ()\ngenericListStart c = () <$ try (many1 (char c) >> whitespace)\n\norderedListStart :: PandocMonad m => TextileParser m ()\norderedListStart = () <$ try (many1 (char '#') >>\n                              try orderedListStartAttr >>\n                              whitespace)\n\nbasicDLStart :: PandocMonad m => TextileParser m ()\nbasicDLStart = do\n  char '-'\n  whitespace\n  notFollowedBy newline\n\ndefinitionListStart :: PandocMonad m => TextileParser m Inlines\ndefinitionListStart = try $ do\n  basicDLStart\n  trimInlines . mconcat <$>\n    many1Till inline\n     (  try (newline *> lookAhead basicDLStart)\n    <|> try (lookAhead (() <$ string \":=\"))\n     )\n\n-- | A definition list item in textile begins with '- ', followed by\n-- the term defined, then spaces and \":=\". The definition follows, on\n-- the same single line, or spaned on multiple line, after a line\n-- break.\ndefinitionListItem :: PandocMonad m => TextileParser m (Inlines, [Blocks])\ndefinitionListItem = try $ do\n  term <- mconcat . intersperse B.linebreak <$> many1 definitionListStart\n  def' <- string \":=\" *> optional whitespace *> (multilineDef <|> inlineDef)\n  return (term, def')\n  where inlineDef :: PandocMonad m => TextileParser m [Blocks]\n        inlineDef = liftM (\\d -> [B.plain d])\n                    $ optional whitespace >> (trimInlines . mconcat <$> many inline) <* newline\n        multilineDef :: PandocMonad m => TextileParser m [Blocks]\n        multilineDef = try $ do\n          optional whitespace >> newline\n          s <- T.pack <$> many1Till anyChar (try (string \"=:\" >> newline))\n          -- this <> \"\\n\\n\" does not look very good\n          ds <- parseFromString' parseBlocks (s <> \"\\n\\n\")\n          return [ds]\n\n-- raw content\n\n-- | A raw Html Block, optionally followed by blanklines\nrawHtmlBlock :: PandocMonad m => TextileParser m Blocks\nrawHtmlBlock = try $ do\n  skipMany spaceChar\n  (_,b) <- htmlTag isBlockTag\n  optional blanklines\n  return $ B.rawBlock \"html\" b\n\n-- | Raw block of LaTeX content\nrawLaTeXBlock' :: PandocMonad m => TextileParser m Blocks\nrawLaTeXBlock' = do\n  guardEnabled Ext_raw_tex\n  B.rawBlock \"latex\" <$> (rawLaTeXBlock <* spaces)\n\n\n-- | In textile, paragraphs are separated by blank lines.\npara :: PandocMonad m => TextileParser m Blocks\npara = B.para . trimInlines . mconcat <$> many1 inline\n\n-- Tables\n\ntoAlignment :: Char -> Alignment\ntoAlignment '<' = AlignLeft\ntoAlignment '>' = AlignRight\ntoAlignment '=' = AlignCenter\ntoAlignment _   = AlignDefault\n\ncellAttributes :: PandocMonad m => TextileParser m (Bool, Alignment)\ncellAttributes = try $ do\n  isHeader <- option False (True <$ char '_')\n  -- we just ignore colspan and rowspan markers:\n  optional $ try $ oneOf \"/\\\\\" >> many1 digit\n  -- we pay attention to alignments:\n  alignment <- option AlignDefault $ toAlignment <$> oneOf \"<>=\"\n  -- ignore other attributes for now:\n  _ <- attributes\n  char '.'\n  return (isHeader, alignment)\n\n-- | A table cell spans until a pipe |\ntableCell :: PandocMonad m => TextileParser m ((Bool, Alignment), Blocks)\ntableCell = try $ do\n  char '|'\n  (isHeader, alignment) <- option (False, AlignDefault) cellAttributes\n  notFollowedBy blankline\n  raw <- trim . T.pack <$>\n         many (noneOf \"|\\n\" <|> try (char '\\n' <* notFollowedBy blankline))\n  content <- parseFromString' parseBlocks (raw <> \"\\n\\n\")\n  -- Convert lone Para to Plain for backward compatibility\n  let content' = case B.toList content of\n                   [Para ils] -> B.plain (B.fromList ils)\n                   _          -> content\n  return ((isHeader, alignment), content')\n\n-- | A table row is made of many table cells\ntableRow :: PandocMonad m => TextileParser m [((Bool, Alignment), Blocks)]\ntableRow = try $ do\n  -- skip optional row attributes\n  optional $ try $ do\n    _ <- attributes\n    char '.'\n    many1 spaceChar\n  many1 tableCell <* char '|' <* blankline\n\n-- | A table with an optional header.\ntable :: PandocMonad m => TextileParser m Blocks\ntable = try $ do\n  -- ignore table attributes\n  caption <- option mempty $ try $ do\n    string \"table\"\n    _ <- attributes\n    char '.'\n    rawcapt <- trim <$> anyLine\n    parseFromString' (mconcat <$> many inline) rawcapt\n  rawrows <- many1 $ skipMany ignorableRow >> tableRow\n  skipMany ignorableRow\n  blanklines\n  let (headers, rows) = case rawrows of\n                             (toprow:rest) | any (fst . fst) toprow ->\n                                (toprow, rest)\n                             _ -> (mempty, rawrows)\n  let nbOfCols = maximum $ fmap length (headers :| rows)\n  let aligns = map (maybe AlignDefault minimum . nonEmpty) $\n                transpose $ map (map (snd . fst)) (headers:rows)\n  let toRow = Row nullAttr . map B.simpleCell\n      toHeaderRow l = [toRow l | not (null l)]\n  return $ B.table (B.simpleCaption $ B.plain caption)\n    (zip aligns (replicate nbOfCols ColWidthDefault))\n    (TableHead nullAttr $ toHeaderRow $ map snd headers)\n    [TableBody nullAttr 0 [] $ map (toRow . map snd) rows]\n    (TableFoot nullAttr [])\n\n-- | Ignore markers for cols, thead, tfoot.\nignorableRow :: PandocMonad m => TextileParser m ()\nignorableRow = try $ do\n  char '|'\n  oneOf \":^-~\"\n  _ <- attributes\n  char '.'\n  _ <- anyLine\n  return ()\n\nexplicitBlockStart :: PandocMonad m => Text -> TextileParser m Attr\nexplicitBlockStart name = try $ do\n  string (T.unpack name)\n  attr <- attributes\n  char '.'\n  optional whitespace\n  optional endline\n  return attr\n\n-- | Blocks like 'p' and 'table' do not need explicit block tag.\n-- However, they can be used to set HTML/CSS attributes when needed.\nexplicitBlock :: PandocMonad m\n              => Text  -- ^ block tag name\n              -> TextileParser m Blocks -- ^ implicit block\n              -> TextileParser m Blocks\nexplicitBlock name blk = try $ do\n  attr <- explicitBlockStart name\n  contents <- blk\n  return $ if attr == nullAttr\n              then contents\n              else B.divWith attr contents\n\n----------\n-- Inlines\n----------\n\n\n-- | Any inline element\ninline :: PandocMonad m => TextileParser m Inlines\ninline = choice inlineParsers <?> \"inline\"\n\n-- | Inline parsers tried in order\ninlineParsers :: PandocMonad m => [TextileParser m Inlines]\ninlineParsers = [ str\n                , whitespace\n                , endline\n                , code\n                , escapedInline\n                , spanGroup\n                , inlineMarkup\n                , groupedInlineMarkup\n                , rawHtmlInline\n                , rawLaTeXInline'\n                , note\n                , link\n                , image\n                , mark\n                , B.str <$> characterReference\n                , smartPunctuation inline\n                , symbol\n                ]\n\n-- | Inline markups\ninlineMarkup :: PandocMonad m => TextileParser m Inlines\ninlineMarkup = choice [ simpleInline (string \"??\") (B.cite [])\n                      , simpleInline (string \"**\") B.strong\n                      , simpleInline (string \"__\") B.emph\n                      , simpleInline (char '*') B.strong\n                      , simpleInline (char '_') B.emph\n                      , simpleInline (char '+') B.underline\n                      , simpleInline (char '-' <* notFollowedBy (char '-')) B.strikeout\n                      , simpleInline (char '^') B.superscript\n                      , simpleInline (char '~') B.subscript\n                      ]\n\n-- \"The <span> tag is created by percent % signs between whitespaces.\"\n-- e.g. My mother has %{color:green;}green% eyes.\nspanGroup :: PandocMonad m => TextileParser m Inlines\nspanGroup = try $ do\n  notAfterString >>= guard\n  char '%' *> notFollowedBy whitespace\n  attr <- option nullAttr attributes\n  contents <- mconcat <$> manyTill\n   (try (((B.space <>) <$> try (whitespace *> notFollowedBy newline *> inline))\n         <|> try (notFollowedBy newline *> inline)))\n   (try (char '%' <* lookAhead (newline <|> ' ' <$ whitespace)))\n  pure $ B.spanWith attr contents\n\n-- | Trademark, registered, copyright\nmark :: PandocMonad m => TextileParser m Inlines\nmark = try $ char '(' >> (try tm <|> try reg <|> copy)\n\nreg :: PandocMonad m => TextileParser m Inlines\nreg = do\n  oneOf \"Rr\"\n  char ')'\n  return $ B.str \"\\174\"\n\ntm :: PandocMonad m => TextileParser m Inlines\ntm = do\n  oneOf \"Tt\"\n  oneOf \"Mm\"\n  char ')'\n  return $ B.str \"\\8482\"\n\ncopy :: PandocMonad m => TextileParser m Inlines\ncopy = do\n  oneOf \"Cc\"\n  char ')'\n  return $ B.str \"\\169\"\n\nnote :: PandocMonad m => TextileParser m Inlines\nnote = try $ do\n  ref <- char '[' *> many1 digit <* char ']'\n  notes <- stateNotes <$> getState\n  case lookup (T.pack ref) notes of\n    Nothing  -> Prelude.fail \"note not found\"\n    Just raw -> B.note <$> parseFromString' parseBlocks raw\n\n-- | Special chars\nmarkupChars :: [Char]\nmarkupChars = \"\\\\*#_@~-+^|%=[]&\"\n\n-- | Break strings on following chars. Space tab and newline break for\n--  inlines breaking. Open paren breaks for mark. Quote, dash and dot\n--  break for smart punctuation. Punctuation breaks for regular\n--  punctuation. Double quote breaks for named links. > and < break\n--  for inline html.\nstringBreakers :: [Char]\nstringBreakers = \" \\t\\n\\r.,\\\"'?!;:<>«»„“”‚‘’()[]\"\n\nwordBoundaries :: [Char]\nwordBoundaries = markupChars <> stringBreakers\n\n-- | Parse a hyphened sequence of words\nhyphenedWords :: PandocMonad m => TextileParser m Text\nhyphenedWords = do\n  x <- wordChunk\n  xs <-  many (try $ char '-' >> wordChunk)\n  return $ T.intercalate \"-\" (x:xs)\n\nwordChunk :: PandocMonad m => TextileParser m Text\nwordChunk = try $ do\n  hd <- noneOf wordBoundaries\n  tl <- many ( noneOf wordBoundaries <|>\n               try (notFollowedBy' note *> oneOf markupChars\n                     <* lookAhead (noneOf wordBoundaries) ) )\n  return $ T.pack $ hd:tl\n\n-- | Any string\nstr :: PandocMonad m => TextileParser m Inlines\nstr = do\n  baseStr <- hyphenedWords\n  -- RedCloth compliance : if parsed word is uppercase and immediately\n  -- followed by parens, parens content is unconditionally word acronym\n  fullStr <- option baseStr $ try $ do\n    guard $ T.all isUpper baseStr\n    acro <- T.pack <$> enclosed (char '(') (char ')') anyChar'\n    return $ T.concat [baseStr, \" (\", acro, \")\"]\n  updateLastStrPos\n  return $ B.str fullStr\n\n-- | Some number of space chars\nwhitespace :: PandocMonad m => TextileParser m Inlines\nwhitespace = many1 spaceChar >> return B.space <?> \"whitespace\"\n\n-- | In Textile, an isolated endline character is a line break\nendline :: PandocMonad m => TextileParser m Inlines\nendline = try $ do\n  newline\n  notFollowedBy blankline\n  notFollowedBy listStart\n  notFollowedBy rawHtmlBlock\n  return B.linebreak\n\nrawHtmlInline :: PandocMonad m => TextileParser m Inlines\nrawHtmlInline = B.rawInline \"html\" . snd <$> htmlTag isInlineTag\n\n-- | Raw LaTeX Inline\nrawLaTeXInline' :: PandocMonad m => TextileParser m Inlines\nrawLaTeXInline' = try $ do\n  guardEnabled Ext_raw_tex\n  B.rawInline \"latex\" <$> rawLaTeXInline\n\n-- | Textile standard link syntax is \"label\":target. But we\n-- can also have [\"label\":target].\nlink :: PandocMonad m => TextileParser m Inlines\nlink = try $ do\n  bracketed <- (True <$ char '[') <|> return False\n  char '\"' *> notFollowedBy (oneOf \" \\t\\n\\r\")\n  attr <- attributes\n  name <- trimInlines . mconcat <$>\n          withQuoteContext InDoubleQuote (many1Till inline (char '\"'))\n  url <- linkUrl bracketed\n  let name' = if B.toList name == [Str \"$\"] then B.str url else name\n  return $ if attr == nullAttr\n              then B.link url \"\" name'\n              else B.spanWith attr $ B.link url \"\" name'\n\nlinkUrl :: PandocMonad m => Bool -> TextileParser m Text\nlinkUrl bracketed = do\n  char ':'\n  let stop = if bracketed\n                then char ']'\n                else lookAhead $ space <|> eof' <|> oneOf \"[]\" <|>\n                       try (oneOf \"!.,;:*\" *>\n                              (space <|> newline <|> eof'))\n  rawLink <- T.pack <$> many1Till nonspaceChar stop\n  st <- getState\n  return $ case M.lookup (toKey rawLink) (stateKeys st) of\n    Nothing -> rawLink\n    Just ((src, _), _) -> src\n\n-- | image embedding\nimage :: PandocMonad m => TextileParser m Inlines\nimage = try $ do\n  char '!' >> notFollowedBy space\n  (ident, cls, kvs) <- attributes\n  let attr = case lookup \"style\" kvs of\n               Just stls -> (ident, cls, pickStylesToKVs [\"width\", \"height\"] stls)\n               Nothing   -> (ident, cls, kvs)\n  src <- T.pack <$> many1 (noneOf \" \\t\\n\\r!(\")\n  alt <- fmap T.pack $ option \"\" $ try $ char '(' *> manyTill anyChar (char ')')\n  char '!'\n  let img = B.imageWith attr src alt (B.str alt)\n  try (do -- image link\n         url <- linkUrl False\n         return (B.link url \"\" img))\n   <|> return img\n\nescapedInline :: PandocMonad m => TextileParser m Inlines\nescapedInline = escapedEqs <|> escapedTag\n\nescapedEqs :: PandocMonad m => TextileParser m Inlines\nescapedEqs = B.str . T.pack <$>\n  try (string \"==\" *> manyTill anyChar' (try $ string \"==\"))\n\n-- | literal text escaped btw <notextile> tags\nescapedTag :: PandocMonad m => TextileParser m Inlines\nescapedTag = B.str . T.pack <$>\n  try (string \"<notextile>\" *>\n         manyTill anyChar' (try $ string \"</notextile>\"))\n\n-- | Any special symbol defined in wordBoundaries\nsymbol :: PandocMonad m => TextileParser m Inlines\nsymbol = do\n  c <- notFollowedBy newline *>\n         notFollowedBy rawHtmlBlock *>\n         oneOf wordBoundaries\n  updateLastStrPos\n  pure $ B.str . T.singleton $ c\n\n-- | Inline code\ncode :: PandocMonad m => TextileParser m Inlines\ncode = code1 <|> code2\n\n-- any character except a newline before a blank line\nanyChar' :: PandocMonad m => TextileParser m Char\nanyChar' =\n  satisfy (/='\\n') <|>\n  try (char '\\n' <* notFollowedBy blankline)\n\ncode1 :: PandocMonad m => TextileParser m Inlines\ncode1 = B.code . T.pack <$> surrounded (char '@') anyChar'\n\ncode2 :: PandocMonad m => TextileParser m Inlines\ncode2 = do\n  htmlTag (tagOpen (==\"tt\") null)\n  B.code . T.pack <$> manyTill anyChar' (try $ htmlTag $ tagClose (==\"tt\"))\n\norderedListStartAttr :: PandocMonad m => TextileParser m Int\norderedListStartAttr = do\n  digits <- many digit\n  case readMaybe digits :: Maybe Int of\n    Nothing -> return 1\n    Just n  -> return n\n\n-- | Html / CSS attributes\nattributes :: PandocMonad m => TextileParser m Attr\nattributes = L.foldl' (flip ($)) (\"\",[],[]) <$>\n  try (do special <- option id specialAttribute\n          attrs <- many attribute\n          return (special : attrs))\n\nspecialAttribute :: PandocMonad m => TextileParser m (Attr -> Attr)\nspecialAttribute = do\n  alignStr <- (\"center\" <$ char '=') <|>\n    (\"justify\" <$ try (string \"<>\")) <|>\n    (\"right\" <$ char '>') <|>\n    (\"left\" <$ char '<')\n  notFollowedBy spaceChar\n  return $ addStyle $ T.pack $ \"text-align:\" ++ alignStr\n\nattribute :: PandocMonad m => TextileParser m (Attr -> Attr)\nattribute = try $\n  (classIdAttr <|> styleAttr <|> langAttr) <* notFollowedBy spaceChar\n\nclassIdAttr :: PandocMonad m => TextileParser m (Attr -> Attr)\nclassIdAttr = try $ do -- (class class #id)\n  char '('\n  ws <- T.words `fmap` T.pack <$> manyTill anyChar' (char ')')\n  case reverse ws of\n       []\n         -> return $ \\(_,_,keyvals) -> (\"\",[],keyvals)\n       ((T.uncons -> Just ('#', ident')):classes')\n         -> return $ \\(_,_,keyvals) -> (ident',classes',keyvals)\n       classes'\n         -> return $ \\(_,_,keyvals) -> (\"\",classes',keyvals)\n\nstyleAttr :: PandocMonad m => TextileParser m (Attr -> Attr)\nstyleAttr = do\n  style <- try $ enclosed (char '{') (char '}') anyChar'\n  return $ addStyle $ T.pack style\n\naddStyle :: Text -> Attr -> Attr\naddStyle style (id',classes,keyvals) =\n  (id',classes,keyvals')\n  where keyvals' = (\"style\", style') : [(k,v) | (k,v) <- keyvals, k /= \"style\"]\n        style' = style <> \";\" <> T.concat [v | (\"style\",v) <- keyvals]\n\nlangAttr :: PandocMonad m => TextileParser m (Attr -> Attr)\nlangAttr = do\n  lang <- try $ enclosed (char '[') (char ']') alphaNum\n  return $ \\(id',classes,keyvals) -> (id',classes,(\"lang\",T.pack lang):keyvals)\n\n-- | Parses material surrounded by a parser.\nsurrounded :: (PandocMonad m, Show t)\n           => ParsecT Sources st m t   -- ^ surrounding parser\n           -> ParsecT Sources st m a   -- ^ content parser (to be used repeatedly)\n           -> ParsecT Sources st m [a]\nsurrounded border =\n  enclosed (border *> notFollowedBy (oneOf \" \\t\\n\\r\")) (try border)\n\nsimpleInline :: PandocMonad m\n             => TextileParser m t        -- ^ surrounding parser\n             -> (Inlines -> Inlines)                  -- ^ Inline constructor\n             -> TextileParser m Inlines  -- ^ content parser (to be used repeatedly)\nsimpleInline border construct = try $ do\n  notAfterString >>= guard\n  border *> notFollowedBy (oneOf \" \\t\\n\\r\")\n  attr <- attributes\n  body <- trimInlines . mconcat <$>\n          withQuoteContext InSingleQuote\n            (manyTill (((B.space <>) <$>\n                         try (whitespace *> notFollowedBy newline >> inline))\n                     <|> try (notFollowedBy newline >> inline))\n             (try border <* notFollowedBy alphaNum))\n  return $ construct $\n        if attr == nullAttr\n           then body\n           else B.spanWith attr body\n\ngroupedInlineMarkup :: PandocMonad m => TextileParser m Inlines\ngroupedInlineMarkup = try $ do\n    char '['\n    sp1 <- option mempty $ B.space <$ whitespace\n    result <- withQuoteContext InSingleQuote inlineMarkup\n    sp2 <- option mempty $ B.space <$ whitespace\n    char ']'\n    return $ sp1 <> result <> sp2\n\neof' :: Monad m => ParsecT Sources s m Char\neof' = '\\n' <$ eof\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/TikiWiki.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE OverloadedStrings #-}\n\n{- |\n   Module      : Text.Pandoc.Readers.TikiWiki\n   Copyright   : Copyright (C) 2017 Robin Lee Powell\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Robin Lee Powell <robinleepowell@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of TikiWiki text to 'Pandoc' document.\n-}\n\nmodule Text.Pandoc.Readers.TikiWiki ( readTikiWiki\n                                    ) where\n\nimport Control.Monad\nimport Control.Monad.Except (throwError)\nimport qualified Data.Foldable as F\nimport Data.List (dropWhileEnd)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..), getVerbosity)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging (Verbosity (..))\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (enclosed)\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.XML (fromEntities)\nimport Text.Printf (printf)\n\n-- | Read TikiWiki from an input string and return a Pandoc document.\nreadTikiWiki :: (PandocMonad m, ToSources a)\n          => ReaderOptions\n          -> a\n          -> m Pandoc\nreadTikiWiki opts s = do\n  let sources = ensureFinalNewlines 2 (toSources s)\n  res <- readWithM parseTikiWiki def{ stateOptions = opts } sources\n  case res of\n       Left e  -> throwError e\n       Right d -> return d\n\ntype TikiWikiParser = ParsecT Sources ParserState\n\n--\n-- utility functions\n--\n\ntryMsg :: Text -> TikiWikiParser m a -> TikiWikiParser m a\ntryMsg msg p = try p <?> T.unpack msg\n\nskip :: TikiWikiParser m a -> TikiWikiParser m ()\nskip parser = Control.Monad.void parser\n\n--\n-- main parser\n--\n\nparseTikiWiki :: PandocMonad m => TikiWikiParser m Pandoc\nparseTikiWiki = do\n  bs <- mconcat <$> many block\n  spaces\n  eof\n  return $ B.doc bs\n\nblock :: PandocMonad m => TikiWikiParser m B.Blocks\nblock = do\n  verbosity <- getVerbosity\n  pos <- getPosition\n  res <- mempty <$ skipMany1 blankline\n         <|> blockElements\n         <|> para\n  skipMany blankline\n  when (verbosity >= INFO) $\n    trace (T.pack $ printf \"line %d: %s\" (sourceLine pos) (take 60 $ show $ B.toList res))\n  return res\n\nblockElements :: PandocMonad m => TikiWikiParser m B.Blocks\nblockElements = choice [ table\n                       , hr\n                       , header\n                       , mixedList\n                       , definitionList\n                       , codeMacro\n                       ]\n\n-- top\n-- ----\n-- bottom\n--\n-- ----\n--\nhr :: PandocMonad m => TikiWikiParser m B.Blocks\nhr = try $ do\n  string \"----\"\n  many (char '-')\n  newline\n  return B.horizontalRule\n\n-- ! header\n--\n-- !! header level two\n--\n-- !!! header level 3\n--\nheader :: PandocMonad m => TikiWikiParser m B.Blocks\nheader = tryMsg \"header\" $ do\n  level <- fmap length (many1 (char '!'))\n  guard $ level <= 6\n  skipSpaces\n  content <- B.trimInlines . mconcat <$> manyTill inline newline\n  attr <- registerHeader nullAttr content\n  return $ B.headerWith attr level content\n\ntableRow :: PandocMonad m => TikiWikiParser m [B.Blocks]\ntableRow = try $ do\n--  row <- sepBy1 (many1Till inline $ oneOf \"\\n|\") (try $ string \"|\" <* notFollowedBy (oneOf \"|\\n\"))\n--  return $ map (B.plain . mconcat) row\n  row <- sepBy1 (many1 (noneOf \"\\n|\") >>= parseColumn . T.pack) (try $ string \"|\" <* notFollowedBy (oneOf \"|\\n\"))\n  return $ map B.plain row\n  where\n    parseColumn x = do\n      parsed <- parseFromString (many1 inline) x\n      return $ mconcat parsed\n\n\n\n-- Tables:\n--\n-- ||foo||\n--\n-- ||row1-column1|row1-column2||row2-column1|row2-column2||\n--\n-- ||row1-column1|row1-column2\n-- row2-column1|row2-column2||\n--\n-- ||row1-column1|row1-column2\n-- row2-column1|row2-column2||row3-column1|row3-column2||\n--\n-- || Orange | Apple     | more\n--  Bread  | Pie       | more\n--  Butter | Ice cream | and more ||\n--\ntable :: PandocMonad m => TikiWikiParser m B.Blocks\ntable = try $ do\n  string \"||\"\n  rows <- sepBy1 tableRow (try $ string \"\\n\" <|> (string \"||\" <* notFollowedBy (string \"\\n\")))\n  string \"||\"\n  newline\n  -- return $ B.simpleTable (headers rows) $ trace (\"rows: \" ++ (show rows)) rows\n  return $ B.simpleTable (headers rows) rows\n  where\n    -- The headers are as many empty strings as the number of columns\n-- in the first row\n    headers [] = []\n    headers (r:_) = replicate (length r) ((B.plain . B.str) \"\")\n\npara :: PandocMonad m => TikiWikiParser m B.Blocks\npara =  fmap (result . mconcat) ( many1Till inline endOfParaElement)\n where\n   endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement\n   endOfInput       = try $ skipMany blankline >> skipSpaces >> eof\n   endOfPara        = try $ blankline >> skipMany1 blankline\n   newBlockElement  = try $ blankline >> skip blockElements\n   result content   = if F.all (==Space) content\n                      then mempty\n                      else B.para $ B.trimInlines content\n\n-- ;item 1: definition 1\n-- ;item 2: definition 2-1\n-- + definition 2-2\n-- ;item ''3'': definition ''3''\n--\ndefinitionList :: PandocMonad m => TikiWikiParser m B.Blocks\ndefinitionList = tryMsg \"definitionList\" $ do\n  elements <-many1 parseDefinitionListItem\n  return $ B.definitionList elements\n  where\n    parseDefinitionListItem :: PandocMonad m => TikiWikiParser m (B.Inlines, [B.Blocks])\n    parseDefinitionListItem = do\n      skipSpaces >> char ';' <* skipSpaces\n      term <- many1Till inline $ char ':' <* skipSpaces\n      line <- listItemLine 1\n      return (mconcat term, [B.plain line])\n\ndata ListType = None | Numbered | Bullet deriving (Ord, Eq, Show)\n\ndata ListNesting = LN { lntype :: ListType, lnnest :: Int } deriving (Ord, Eq, Show)\n\n-- The first argument is a stack (most recent == head) of our list\n-- nesting status; the list type and the nesting level; if we're in\n-- a number list in a bullet list it'd be\n-- [LN Numbered 2, LN Bullet 1]\n--\n-- Mixed list example:\n--\n-- # one\n-- # two\n-- ** two point one\n-- ** two point two\n-- # three\n-- # four\n--\nmixedList :: PandocMonad m => TikiWikiParser m B.Blocks\nmixedList = try $ do\n  items <- try $ many1 listItem\n  return $ mconcat $ fixListNesting $ spanFoldUpList (LN None 0) items\n\n-- See the \"Handling Lists\" section of DESIGN-CODE for why this\n-- function exists.  It's to post-process the lists and do some\n-- mappends.\n--\n-- We need to walk the tree two items at a time, so we can see what\n-- we're going to join *to* before we get there.\n--\n-- Because of that, it seemed easier to do it by hand than to try to\n-- figre out a fold or something.\nfixListNesting :: [B.Blocks] -> [B.Blocks]\nfixListNesting [] = []\nfixListNesting [first] = [recurseOnList first]\n-- fixListNesting nestall | trace (\"\\n\\nfixListNesting: \" ++ (show nestall)) False = undefined\n-- fixListNesting nestall@(first:second:rest) =\nfixListNesting (first:second:rest) =\n    case B.toList second of\n      (BulletList _ : _) -> fixListNesting $ mappend (recurseOnList first) (recurseOnList second) : rest\n      (OrderedList _ _ : _) -> fixListNesting $ mappend (recurseOnList first) (recurseOnList second) : rest\n      _ -> recurseOnList first : fixListNesting (second:rest)\n\n-- This function walks the Block structure for fixListNesting,\n-- because it's a bit complicated, what with converting to and from\n-- lists and so on.\nrecurseOnList :: B.Blocks -> B.Blocks\n-- recurseOnList item | trace (\"rOL: \" ++ (show $ length $ B.toList item) ++ \", \" ++ (show $ B.toList item)) False = undefined\nrecurseOnList items\n  | length (B.toList items) == 1 =\n      case B.toList items of\n        (BulletList listItems : _) -> B.bulletList $ fixListNesting $ map B.fromList listItems\n        (OrderedList _ listItems : _) -> B.orderedList $ fixListNesting $ map B.fromList listItems\n        _ -> items\n\n  -- The otherwise works because we constructed the blocks, and we\n  -- know for a fact that no mappends have been run on them; each\n  -- Blocks consists of exactly one Block.\n  --\n  -- Anything that's not like that has already been processed by\n  -- fixListNesting; don't bother to process it again.\n  | otherwise = items\n\n\n-- Turn the list if list items into a tree by breaking off the first\n-- item, splitting the remainder of the list into items that are in\n-- the tree of the first item and those that aren't, wrapping the\n-- tree of the first item in its list time, and recursing on both\n-- sections.\nspanFoldUpList :: ListNesting -> [(ListNesting, B.Blocks)] -> [B.Blocks]\nspanFoldUpList _ [] = []\nspanFoldUpList ln [first] =\n  listWrap ln (fst first) [snd first]\nspanFoldUpList ln (first:rest) =\n  let (span1, span2) = span (splitListNesting (fst first)) rest\n      newTree1 = listWrap ln (fst first) $ snd first : spanFoldUpList (fst first) span1\n      newTree2 = spanFoldUpList ln span2\n  in\n    newTree1 ++ newTree2\n\n-- Decide if the second item should be in the tree of the first\n-- item, which is true if the second item is at a deeper nesting\n-- level and of the same type.\nsplitListNesting :: ListNesting -> (ListNesting, B.Blocks) -> Bool\nsplitListNesting ln1 (ln2, _)\n  | lnnest ln1 < lnnest ln2 =\n  True\n  | ln1 == ln2 =\n  True\n  | otherwise =\n  False\n\n-- If we've moved to a deeper nesting level, wrap the new level in\n-- the appropriate type of list.\nlistWrap :: ListNesting -> ListNesting -> [B.Blocks] -> [B.Blocks]\nlistWrap upperLN curLN retTree =\n  if upperLN == curLN then\n    retTree\n  else\n    case lntype curLN of\n      None     -> []\n      Bullet   -> [B.bulletList retTree]\n      Numbered -> [B.orderedList retTree]\n\nlistItem :: PandocMonad m => TikiWikiParser m (ListNesting, B.Blocks)\nlistItem = choice [\n    bulletItem\n  , numberedItem\n  ]\n\n\n-- * Start each line\n-- * with an asterisk (*).\n-- ** More asterisks gives deeper\n-- *** and deeper levels.\n--\nbulletItem :: PandocMonad m => TikiWikiParser m (ListNesting, B.Blocks)\nbulletItem = try $ do\n  prefix <- many1 $ char '*'\n  many $ char ' '\n  content <- listItemLine (length prefix)\n  return (LN Bullet (length prefix), B.plain content)\n\n-- # Start each line\n-- # with a number (1.).\n-- ## More number signs gives deeper\n-- ### and deeper\n--\nnumberedItem :: PandocMonad m => TikiWikiParser m (ListNesting, B.Blocks)\nnumberedItem = try $ do\n  prefix <- many1 $ char '#'\n  many $ char ' '\n  content <- listItemLine (length prefix)\n  return (LN Numbered (length prefix), B.plain content)\n\nlistItemLine :: PandocMonad m => Int -> TikiWikiParser m B.Inlines\nlistItemLine nest = lineContent >>= parseContent\n  where\n    lineContent = do\n      content <- anyLine\n      continuation <- optionMaybe listContinuation\n      return $ filterSpaces content <> \"\\n\" <> Data.Maybe.fromMaybe \"\" continuation\n    filterSpaces = T.dropWhileEnd (== ' ')\n    listContinuation = string (replicate nest '+') >> lineContent\n    parseContent x = do\n      parsed <- parseFromString (many1 inline) x\n      return $ mconcat $ dropWhileEnd (== B.space) parsed\n\n-- Turn the CODE macro attributes into Pandoc code block attributes.\nmungeAttrs :: [(Text, Text)] -> (Text, [Text], [(Text, Text)])\nmungeAttrs rawAttrs = (\"\", classes, rawAttrs)\n  where\n    -- \"colors\" is TikiWiki CODE macro for \"name of language to do\n    -- highlighting for\"; turn the value into a class\n    color = fromMaybe \"\" $ lookup \"colors\" rawAttrs\n    -- ln = 1 means line numbering.  It's also the default.  So we\n    -- emit numberLines as a class unless ln = 0\n    lnRaw = fromMaybe \"1\" $ lookup \"ln\" rawAttrs\n    ln = if lnRaw == \"0\" then\n            \"\"\n         else\n            \"numberLines\"\n    classes = filter (/= \"\") [color, ln]\n\ncodeMacro :: PandocMonad m => TikiWikiParser m B.Blocks\ncodeMacro = try $ do\n  string \"{CODE(\"\n  rawAttrs <- macroAttrs\n  string \")}\"\n  body <- T.pack <$> manyTill anyChar (try (string \"{CODE}\"))\n  newline\n  if not (null rawAttrs)\n    then\n      return $ B.codeBlockWith (mungeAttrs rawAttrs) body\n    else\n      return $ B.codeBlock body\n\n\n--\n-- inline parsers\n--\n\ninline :: PandocMonad m => TikiWikiParser m B.Inlines\ninline = choice [ whitespace\n                , noparse\n                , strong\n                , emph\n                , nbsp\n                , image\n                , htmlComment\n                , strikeout\n                , code\n                , wikiLink\n                , notExternalLink\n                , externalLink\n                , superTag\n                , superMacro\n                , subTag\n                , subMacro\n                , escapedChar\n                , colored\n                , centered\n                , underlined\n                , boxed\n                , breakChars\n                , str\n                , symbol\n                ] <?> \"inline\"\n\nwhitespace :: PandocMonad m => TikiWikiParser m B.Inlines\nwhitespace = lb <|> regsp\n  where lb = try $ skipMany spaceChar >> linebreak >> return B.space\n        regsp = try $ skipMany1 spaceChar >> return B.space\n\n-- UNSUPPORTED, as there doesn't seem to be any facility in calibre\n-- for this\nnbsp :: PandocMonad m => TikiWikiParser m B.Inlines\nnbsp = try $ do\n  string \"~hs~\"\n  return $ B.str \" NOT SUPPORTED BEGIN: ~hs~ (non-breaking space) :END \"\n\n-- UNSUPPORTED, as the desired behaviour (that the data be\n-- *retained* and stored as a comment) doesn't exist in calibre, and\n-- silently throwing data out seemed bad.\nhtmlComment :: PandocMonad m => TikiWikiParser m B.Inlines\nhtmlComment = try $ do\n  string \"~hc~\"\n  inner <- fmap T.pack $ many1 $ noneOf \"~\"\n  string \"~/hc~\"\n  return $ B.str $ \" NOT SUPPORTED: ~hc~ (html comment opener) BEGIN: \" <> inner <> \" ~/hc~ :END \"\n\nlinebreak :: PandocMonad m => TikiWikiParser m B.Inlines\nlinebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)\n  where lastNewline  = eof >> return mempty\n        innerNewline = return B.space\n\nbetween :: (Monoid c, PandocMonad m, Show b) => TikiWikiParser m a -> TikiWikiParser m b -> (TikiWikiParser m b -> TikiWikiParser m c) -> TikiWikiParser m c\nbetween start end p =\n  mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)\n\nenclosed :: (Monoid b, PandocMonad m, Show a) => TikiWikiParser m a -> (TikiWikiParser m a -> TikiWikiParser m b) -> TikiWikiParser m b\nenclosed sep p = between sep (try $ sep <* endMarker) p\n  where\n    endMarker   = lookAhead $ skip endSpace <|> skip (oneOf \".,!?:)|'_\") <|> eof\n    endSpace    = (spaceChar <|> newline) >> return B.space\n\n\nnestedInlines :: (Show a, PandocMonad m) => TikiWikiParser m a -> TikiWikiParser m B.Inlines\nnestedInlines end = innerSpace <|> nestedInline\n  where\n    innerSpace   = try $ whitespace <* notFollowedBy end\n    nestedInline = notFollowedBy whitespace >> inline\n\n-- {img attId=\"39\" imalign=\"right\" link=\"http://info.tikiwiki.org\" alt=\"Panama Hat\"}\n--\n-- {img attId=\"37\", thumb=\"mouseover\", styleimage=\"border\", desc=\"150\"}\n--\n-- {img src=\"img/wiki_up/393px-Pears.jpg\" thumb=\"y\" imalign=\"center\" stylebox=\"border\" button=\"y\" desc=\"Pretty pears\" max=\"200\" rel=\"box\"}\n--\nimage :: PandocMonad m => TikiWikiParser m B.Inlines\nimage = try $ do\n  string \"{img \"\n  rawAttrs <- sepEndBy1 imageAttr spaces\n  string \"}\"\n  let src = fromMaybe \"\" $ lookup \"src\" rawAttrs\n  let title = fromMaybe src $ lookup \"desc\" rawAttrs\n  let alt = fromMaybe title $ lookup \"alt\" rawAttrs\n  let classes = map fst $ filter (\\(_,b) -> b == \"\" || b == \"y\") rawAttrs\n  if not (T.null src)\n    then\n      return $ B.imageWith (\"\", classes, rawAttrs) src title (B.str alt)\n    else\n      return $ B.str $ \" NOT SUPPORTED: image without src attribute BEGIN: {img \" <> printAttrs rawAttrs <> \"} :END \"\n  where\n    printAttrs attrs = T.unwords $ map (\\(a, b) -> a <> \"=\\\"\" <> b <> \"\\\"\") attrs\n\nimageAttr :: PandocMonad m => TikiWikiParser m (Text, Text)\nimageAttr = try $ do\n  key <- many1 (noneOf \"=} \\t\\n\")\n  char '='\n  optional $ char '\"'\n  value <- many1 (noneOf \"}\\\"\\n\")\n  optional $ char '\"'\n  optional $ char ','\n  return (T.pack key, T.pack value)\n\n\n-- __strong__\nstrong :: PandocMonad m => TikiWikiParser m B.Inlines\nstrong = try $ fmap B.strong (enclosed (string \"__\") nestedInlines)\n\n-- ''emph''\nemph :: PandocMonad m => TikiWikiParser m B.Inlines\nemph = try $ fmap B.emph (enclosed (string \"''\") nestedInlines)\n\n-- ~246~\nescapedChar :: PandocMonad m => TikiWikiParser m B.Inlines\nescapedChar = try $ do\n  string \"~\"\n  mNumber <- safeRead . T.pack <$> many1 digit\n  string \"~\"\n  return $ B.str $\n    case mNumber of\n      Just number -> T.singleton $ toEnum (number :: Int)\n      Nothing     -> \"\"\n\n-- UNSUPPORTED, as there doesn't seem to be any facility in calibre\n-- for this\ncentered :: PandocMonad m => TikiWikiParser m B.Inlines\ncentered = try $ do\n  string \"::\"\n  inner <- fmap T.pack $ many1 $ noneOf \":\\n\"\n  string \"::\"\n  return $ B.str $ \" NOT SUPPORTED: :: (centered) BEGIN: ::\" <> inner <> \":: :END \"\n\n-- UNSUPPORTED, as there doesn't seem to be any facility in calibre\n-- for this\ncolored :: PandocMonad m => TikiWikiParser m B.Inlines\ncolored = try $ do\n  string \"~~\"\n  inner <- fmap T.pack $ many1 $ noneOf \"~\\n\"\n  string \"~~\"\n  return $ B.str $ \" NOT SUPPORTED: ~~ (colored) BEGIN: ~~\" <> inner <> \"~~ :END \"\n\n-- ===underlined===\nunderlined :: PandocMonad m => TikiWikiParser m B.Inlines\nunderlined = try $ B.underline <$> enclosed (string \"===\") nestedInlines\n\n-- UNSUPPORTED, as there doesn't seem to be any facility in calibre\n-- for this\nboxed :: PandocMonad m => TikiWikiParser m B.Inlines\nboxed = try $ do\n  string \"^\"\n  inner <- fmap T.pack $ many1 $ noneOf \"^\\n\"\n  string \"^\"\n  return $ B.str $ \" NOT SUPPORTED: ^ (boxed) BEGIN: ^\" <> inner <> \"^ :END \"\n\n-- --text--\nstrikeout :: PandocMonad m => TikiWikiParser m B.Inlines\nstrikeout = try $ fmap B.strikeout (enclosed (string \"--\") nestedInlines)\n\nnestedString :: (Show a, PandocMonad m) => TikiWikiParser m a -> TikiWikiParser m Text\nnestedString end = innerSpace <|> countChar 1 nonspaceChar\n  where\n    innerSpace = try $ T.pack <$> many1 spaceChar <* notFollowedBy end\n\nbreakChars :: PandocMonad m => TikiWikiParser m B.Inlines\nbreakChars = try $ string \"%%%\" >> return B.linebreak\n\n-- superscript: foo{TAG(tag=>sup)}super{TAG}foo / bar{SUP()}super2{SUP}bar\nsuperTag :: PandocMonad m => TikiWikiParser m B.Inlines\nsuperTag = try $  fmap (B.superscript . B.text . fromEntities) ( between (string \"{TAG(tag=>sup)}\") (string \"{TAG}\") nestedString)\n\nsuperMacro :: PandocMonad m => TikiWikiParser m B.Inlines\nsuperMacro = try $ do\n  string \"{SUP(\"\n  manyTill anyChar (string \")}\")\n  body <- manyTill anyChar (string \"{SUP}\")\n  return $ B.superscript $ B.text $ T.pack body\n\n-- subscript: baz{TAG(tag=>sub)}sub{TAG}qux / qux{SUB()}sub2{SUB}qux\nsubTag :: PandocMonad m => TikiWikiParser m B.Inlines\nsubTag = try $  fmap (B.subscript . B.text . fromEntities) ( between (string \"{TAG(tag=>sub)}\") (string \"{TAG}\") nestedString)\n\nsubMacro :: PandocMonad m => TikiWikiParser m B.Inlines\nsubMacro = try $ do\n  string \"{SUB(\"\n  manyTill anyChar (string \")}\")\n  body <- manyTill anyChar (string \"{SUB}\")\n  return $ B.subscript $ B.text $ T.pack body\n\n-- -+text+-\ncode :: PandocMonad m => TikiWikiParser m B.Inlines\ncode = try $  fmap (B.code . fromEntities) ( between (string \"-+\") (string \"+-\") nestedString)\n\nmacroAttr :: PandocMonad m => TikiWikiParser m (Text, Text)\nmacroAttr = try $ do\n  key <- many1 (noneOf \"=)\")\n  char '='\n  optional $ char '\"'\n  value <- many1 (noneOf \" )\\\"\")\n  optional $ char '\"'\n  return (T.pack key, T.pack value)\n\nmacroAttrs :: PandocMonad m => TikiWikiParser m [(Text, Text)]\nmacroAttrs = try $ sepEndBy macroAttr spaces\n\n-- ~np~ __not bold__ ~/np~\nnoparse :: PandocMonad m => TikiWikiParser m B.Inlines\nnoparse = try $ do\n  string \"~np~\"\n  body <- manyTill anyChar (string \"~/np~\")\n  return $ B.str $ T.pack body\n\nstr :: PandocMonad m => TikiWikiParser m B.Inlines\nstr = fmap B.str (T.pack <$> many1 alphaNum <|> characterReference)\n\nsymbol :: PandocMonad m => TikiWikiParser m B.Inlines\nsymbol = fmap B.str (countChar 1 nonspaceChar)\n\n-- [[not a link]\nnotExternalLink :: PandocMonad m => TikiWikiParser m B.Inlines\nnotExternalLink = try $ do\n  start <- string \"[[\"\n  body <- many (noneOf \"\\n[]\")\n  end <- string \"]\"\n  return $ B.text $ T.pack $ start ++ body ++ end\n\n-- [http://www.somesite.org url|Some Site title]\n-- ((internal link))\n--\n-- The ((...)) wiki links and [...] external links are handled\n-- exactly the same; this abstracts that out\nmakeLink :: PandocMonad m => Text -> Text -> Text -> TikiWikiParser m B.Inlines\nmakeLink start middle end = try $ do\n  st <- getState\n  guard $ stateAllowLinks st\n  setState $ st{ stateAllowLinks = False }\n  (url, title, anchor) <- wikiLinkText start middle end\n  parsedTitle <- parseFromString (many1 inline) title\n  setState $ st{ stateAllowLinks = True }\n  return $ B.link (url <> anchor) \"\" $ mconcat parsedTitle\n\nwikiLinkText :: PandocMonad m => Text -> Text -> Text -> TikiWikiParser m (Text, Text, Text)\nwikiLinkText start middle end = do\n  string (T.unpack start)\n  url <- T.pack <$> many1 (noneOf $ T.unpack middle ++ \"\\n\")\n  seg1 <- option url linkContent\n  seg2 <- option \"\" linkContent\n  string (T.unpack end)\n  if seg2 /= \"\"\n    then\n      return (url, seg2, seg1)\n    else\n      return (url, seg1, \"\")\n  where\n    linkContent      = do\n      char '|'\n      T.pack <$> many (noneOf $ T.unpack middle)\n\nexternalLink :: PandocMonad m => TikiWikiParser m B.Inlines\nexternalLink = makeLink \"[\" \"]|\" \"]\"\n\n-- NB: this wiki linking is unlikely to work for anyone besides me\n-- (rlpowell); it happens to work for me because my Hakyll code has\n-- post-processing that treats pandoc .md titles as valid link\n-- targets, so something like\n-- [see also this other post](My Other Page) is perfectly valid.\nwikiLink :: PandocMonad m => TikiWikiParser m B.Inlines\nwikiLink = makeLink \"((\" \")|\" \"))\"\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Txt2Tags.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE LambdaCase #-}\n{- |\n   Module      : Text.Pandoc.Readers.Txt2Tags\n   Copyright   : Copyright (C) 2014 Matthew Pickering\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Matthew Pickering <matthewtpickering@gmail.com>\n\nConversion of txt2tags formatted plain text to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Txt2Tags ( readTxt2Tags\n                                    , getT2TMeta\n                                    , T2TMeta (..)\n                                    )\n                                    where\n\nimport Control.Monad (guard, void, when)\nimport Control.Monad.Except (catchError, throwError)\nimport Control.Monad.Reader (Reader, asks, runReader)\nimport Data.Default\nimport Data.List (intercalate, transpose)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.Time.Format (formatTime)\nimport Text.Pandoc.Builder (Blocks, Inlines, trimInlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Data.Time (defaultTimeLocale)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (space, spaces, uri)\nimport Text.Pandoc.Shared (compactify, compactifyDL)\nimport Text.Pandoc.URI (escapeURI)\n\ntype T2T = ParsecT Sources ParserState (Reader T2TMeta)\n\n-- | An object for the T2T macros meta information\n-- the contents of each field is simply substituted verbatim into the file\ndata  T2TMeta = T2TMeta {\n                 date    :: Text -- ^ Current date\n               , mtime   :: Text -- ^ Last modification time of infile\n               , infile  :: FilePath -- ^ Input file\n               , outfile :: FilePath -- ^ Output file\n               } deriving Show\n\ninstance Default T2TMeta where\n    def = T2TMeta \"\" \"\" \"\" \"\"\n\n-- | Get the meta information required by Txt2Tags macros\ngetT2TMeta :: PandocMonad m => m T2TMeta\ngetT2TMeta = do\n    inps <- P.getInputFiles\n    outp <- fromMaybe \"\" <$> P.getOutputFile\n    curDate <- formatTime defaultTimeLocale \"%F\" <$> P.getZonedTime\n    curMtime <- catchError\n                 (mapM P.getModificationTime inps >>=\n                   (\\case\n                       Nothing ->\n                         formatTime defaultTimeLocale \"%T\" <$> P.getZonedTime\n                       Just ts -> return $\n                         formatTime defaultTimeLocale \"%T\" $ maximum ts)\n                    . nonEmpty)\n                (const (return \"\"))\n    return $ T2TMeta (T.pack curDate) (T.pack curMtime)\n                     (intercalate \", \" inps) outp\n\n-- | Read Txt2Tags from an input string returning a Pandoc document\nreadTxt2Tags :: (PandocMonad m, ToSources a)\n             => ReaderOptions\n             -> a\n             -> m Pandoc\nreadTxt2Tags opts s = do\n  let sources = ensureFinalNewlines 2 (toSources s)\n  meta <- getT2TMeta\n  let parsed = flip runReader meta $\n        readWithM parseT2T (def {stateOptions = opts}) sources\n  case parsed of\n    Right result -> return result\n    Left e       -> throwError e\n\n-- | Read Txt2Tags (ignoring all macros) from an input string returning\n-- a Pandoc document\n-- readTxt2TagsNoMacros :: PandocMonad m => ReaderOptions -> Text -> m Pandoc\n-- readTxt2TagsNoMacros = readTxt2Tags\n\nparseT2T :: T2T Pandoc\nparseT2T = do\n  -- Parse header if standalone flag is set\n  standalone <- getOption readerStandalone\n  when standalone parseHeader\n  body <- mconcat <$>  manyTill block eof\n  meta' <- stateMeta <$> getState\n  return $ Pandoc meta' (B.toList body)\n\nparseHeader :: T2T ()\nparseHeader = do\n  () <$ try blankline <|> header\n  meta <- stateMeta <$> getState\n  optional blanklines\n  config <- manyTill setting (notFollowedBy setting)\n  -- TODO: Handle settings better\n  let settings = foldr (\\(k,v) -> B.setMeta k (MetaString v)) meta config\n  updateState (\\s -> s {stateMeta = settings}) <* optional blanklines\n\nheader :: T2T ()\nheader = titleline >> authorline >> dateline\n\nheaderline :: B.ToMetaValue a => Text -> T2T a -> T2T ()\nheaderline field p = (() <$ try blankline)\n                        <|> (p >>= updateState . B.setMeta field)\n\ntitleline :: T2T ()\ntitleline =\n  headerline \"title\" (trimInlines . mconcat <$> manyTill inline newline)\n\nauthorline :: T2T ()\nauthorline =\n  headerline \"author\" (sepBy author (char ';') <* newline)\n  where\n    author = trimInlines . mconcat <$> many (notFollowedBy (char ';' <|> newline) >> inline)\n\ndateline :: T2T ()\ndateline = headerline \"date\" (trimInlines . mconcat <$> manyTill inline newline)\n\ntype Keyword = Text\ntype Value = Text\n\nsetting :: T2T (Keyword, Value)\nsetting = do\n  string \"%!\"\n  keyword <- ignoreSpacesCap (many1Char alphaNum)\n  char ':'\n  value <- ignoreSpacesCap (manyTillChar anyChar newline)\n  return (keyword, value)\n\n-- Blocks\n\nparseBlocks :: T2T Blocks\nparseBlocks = mconcat <$> manyTill block eof\n\nblock :: T2T Blocks\nblock =\n  choice\n    [ mempty <$ blanklines\n    , quote\n    , hrule -- hrule must go above title\n    , title\n    , commentBlock\n    , verbatim\n    , rawBlock\n    , taggedBlock\n    , list\n    , table\n    , para\n    ]\n\ntitle :: T2T Blocks\ntitle = try $ balancedTitle '+' <|> balancedTitle '='\n\nbalancedTitle :: Char -> T2T Blocks\nbalancedTitle c = try $ do\n  spaces\n  level <- length <$> many1 (char c)\n  guard (level <= 5) -- Max header level 5\n  heading <- manyTillChar (noneOf \"\\n\\r\") (count level (char c))\n  label <- optionMaybe (enclosed (char '[') (char ']') (alphaNum <|> oneOf \"_-\"))\n  many spaceChar *> newline\n  let attr = maybe nullAttr (\\x -> (T.pack x, [], [])) label\n  return $ B.headerWith attr level (trimInlines $ B.text heading)\n\npara :: T2T Blocks\npara = try $ do\n  ils <- parseInlines\n  nl <- option False (True <$ newline)\n  option (B.plain ils) (guard nl >> notFollowedBy listStart >> return (B.para ils))\n  where\n    listStart = try bulletListStart <|> orderedListStart\n\ncommentBlock :: T2T Blocks\ncommentBlock = try (blockMarkupArea anyLine (const mempty) \"%%%\") <|> comment\n\n-- Separator and Strong line treated the same\nhrule :: T2T Blocks\nhrule = try $ do\n  spaces\n  line <- many1 (oneOf \"=-_\")\n  guard (length line >= 20)\n  B.horizontalRule <$ blankline\n\nquote :: T2T Blocks\nquote = try $ do\n  lookAhead tab\n  rawQuote <-  many1 (tab *> optional spaces *> anyLine)\n  contents <- parseFromString' parseBlocks (T.intercalate \"\\n\" rawQuote <> \"\\n\\n\")\n  return $ B.blockQuote contents\n\ncommentLine :: T2T Inlines\ncommentLine = comment\n\n-- List Parsing code from Org Reader\n\nlist :: T2T Blocks\nlist = choice [bulletList, orderedList, definitionList]\n\nbulletList :: T2T Blocks\nbulletList = B.bulletList . compactify\n             <$> many1 (listItem bulletListStart parseBlocks)\n\norderedList :: T2T Blocks\norderedList = B.orderedList . compactify\n              <$> many1 (listItem orderedListStart parseBlocks)\n\ndefinitionList :: T2T Blocks\ndefinitionList = try $\n  B.definitionList . compactifyDL <$>\n    many1 (listItem definitionListStart definitionListEnd)\n\ndefinitionListEnd :: T2T (Inlines, [Blocks])\ndefinitionListEnd = (,) <$> (mconcat <$> manyTill inline newline) <*> ((:[]) <$> parseBlocks)\n\ngenericListStart :: T2T Char\n                 -> T2T Int\ngenericListStart listMarker = try $\n  (2+) <$> (length <$> many spaceChar\n            <* listMarker <* space <* notFollowedBy space)\n\n-- parses bullet list \\start and returns its length (excl. following whitespace)\nbulletListStart :: T2T  Int\nbulletListStart = genericListStart (char '-')\n\norderedListStart :: T2T Int\norderedListStart = genericListStart (char '+' )\n\ndefinitionListStart :: T2T Int\ndefinitionListStart = genericListStart (char ':')\n\n-- parse raw text for one list item, excluding start marker and continuations\nlistItem :: T2T Int\n         -> T2T a\n         -> T2T a\nlistItem start end = try $ do\n  markerLength <- try start\n  firstLine <- anyLineNewline\n  blank <- option \"\" (\"\\n\" <$ blankline)\n  rest <- T.concat <$> many (listContinuation markerLength)\n  parseFromString' end $ firstLine <> blank <> rest\n\n-- continuation of a list item - indented and separated by blankline or endline.\n-- Note: nested lists are parsed as continuations.\nlistContinuation :: Int\n                 -> T2T Text\nlistContinuation markerLength = try $\n  notFollowedBy' (blankline >> blankline)\n  *> (mappend <$> (T.concat <$> many1 listLine)\n              <*> manyChar blankline)\n where listLine = try $ indentWith markerLength *> anyLineNewline\n\n-- Table\n\ntable :: T2T Blocks\ntable = try $ do\n  tableHeader <- fmap snd <$> option mempty (try headerRow)\n  rows <- many1 (many commentLine *> tableRow)\n  let columns = transpose rows\n  let ncolumns = length columns\n  let aligns = map (fromMaybe AlignDefault . foldr findAlign Nothing) columns\n  let rows' = map (map snd) rows\n  let size = maybe 0 maximum $ nonEmpty $ map length rows'\n  let rowsPadded = map (pad size) rows'\n  let headerPadded = if null tableHeader then mempty else pad size tableHeader\n  let toRow = Row nullAttr . map B.simpleCell\n      toHeaderRow l = [toRow l | not (null l)]\n  return $ B.table B.emptyCaption\n                    (zip aligns (replicate ncolumns ColWidthDefault))\n                      (TableHead nullAttr $ toHeaderRow headerPadded)\n                      [TableBody nullAttr 0 [] $ map toRow rowsPadded]\n                      (TableFoot nullAttr [])\n\npad :: (Monoid a) => Int -> [a] -> [a]\npad n xs = xs ++ replicate (n - length xs) mempty\n\n\nfindAlign :: (Alignment, a) -> Maybe Alignment -> Maybe Alignment\nfindAlign (x,_) (Just y)\n  | x == y = Just x\n  | otherwise = Just AlignDefault\nfindAlign (x,_) Nothing = Just x\n\nheaderRow :: T2T [(Alignment, Blocks)]\nheaderRow = genericRow (string \"||\")\n\ntableRow :: T2T [(Alignment, Blocks)]\ntableRow = genericRow (char '|')\n\ngenericRow :: T2T a -> T2T [(Alignment, Blocks)]\ngenericRow start = try $ do\n  spaces *> start\n  manyTill tableCell newline <?> \"genericRow\"\n\n\ntableCell :: T2T (Alignment, Blocks)\ntableCell = try $ do\n  leftSpaces <- length <$> lookAhead (many1 space) -- Case of empty cell means we must lookAhead\n  content <- manyTill inline (try $ lookAhead cellEnd)\n  rightSpaces <- length <$> many space\n  let align =\n        case compare leftSpaces rightSpaces of\n              LT -> AlignLeft\n              EQ -> AlignCenter\n              GT -> AlignRight\n  endOfCell\n  return (align, B.plain (B.trimInlines $ mconcat content))\n  where\n    cellEnd = void newline <|> (many1 space *> endOfCell)\n\nendOfCell :: T2T ()\nendOfCell = try (skipMany1 $ char '|') <|> ( () <$ lookAhead newline)\n\n-- Raw area\n\nverbatim :: T2T Blocks\nverbatim = genericBlock anyLineNewline B.codeBlock \"```\"\n\nrawBlock :: T2T Blocks\nrawBlock = genericBlock anyLineNewline (B.para . B.str) \"\\\"\\\"\\\"\"\n\ntaggedBlock :: T2T Blocks\ntaggedBlock = do\n  target <- getTarget\n  genericBlock anyLineNewline (B.rawBlock target) \"'''\"\n\n-- Generic\n\ngenericBlock :: Monoid a => T2T a -> (a -> Blocks) -> Text -> T2T Blocks\ngenericBlock p f s = blockMarkupArea p f s <|> blockMarkupLine p f s\n\nblockMarkupArea :: Monoid a => T2T a -> (a -> Blocks) -> Text -> T2T Blocks\nblockMarkupArea p f s = try (do\n  textStr s *> blankline\n  f . mconcat <$> manyTill p (eof <|> void (textStr s *> blankline)))\n\nblockMarkupLine :: T2T a -> (a -> Blocks) -> Text -> T2T Blocks\nblockMarkupLine p f s = try (f <$> (textStr s *> space *> p))\n\n-- Can be in either block or inline position\ncomment :: Monoid a => T2T a\ncomment = try $ do\n  atStart\n  notFollowedBy macro\n  mempty <$ (char '%' *> anyLine)\n\n-- Inline\n\nparseInlines :: T2T Inlines\nparseInlines = trimInlines . mconcat <$> many1 inline\n\ninline :: T2T Inlines\ninline =\n  choice\n    [ endline\n    , macro\n    , commentLine\n    , whitespace\n    , url\n    , link\n    , image\n    , bold\n    , underline\n    , code\n    , raw\n    , tagged\n    , strike\n    , italic\n    , code\n    , str\n    , symbol\n    ]\n\nbold :: T2T Inlines\nbold = inlineMarkup inline B.strong '*' B.str\n\nunderline :: T2T Inlines\nunderline = inlineMarkup inline B.underline '_' B.str\n\nstrike :: T2T Inlines\nstrike = inlineMarkup inline B.strikeout '-' B.str\n\nitalic :: T2T Inlines\nitalic = inlineMarkup inline B.emph '/' B.str\n\ncode :: T2T Inlines\ncode = inlineMarkup (T.singleton <$> anyChar) B.code '`' id\n\nraw :: T2T Inlines\nraw = inlineMarkup (T.singleton <$> anyChar) B.text '\"' id\n\ntagged :: T2T Inlines\ntagged = do\n  target <- getTarget\n  inlineMarkup (T.singleton <$> anyChar) (B.rawInline target) '\\'' id\n\n-- Parsec for markup indicated by a double character.\n-- Inline markup is greedy and glued\n-- Greedy meaning ***a*** = Bold [Str \"*a*\"]\n-- Glued meaning that markup must be tight to content\n-- Markup can't pass newlines\ninlineMarkup :: Monoid a\n             => T2T a -- Content parser\n             -> (a -> Inlines) -- Constructor\n             -> Char -- Fence\n             -> (Text -> a) -- Special Case to handle ******\n             -> T2T Inlines\ninlineMarkup p f c special = try $ do\n  start <- many1Char (char c)\n  let l = T.length start\n  guard (l >= 2)\n  when (l == 2) (void $ notFollowedBy space)\n  -- We must make sure that there is no space before the start of the\n  -- closing tags\n  body <-  optionMaybe (try $ manyTillChar (noneOf \"\\n\\r\")\n                (try $ lookAhead (noneOf \" \" >> string [c,c] )))\n  case body of\n    Just middle -> do\n      lastChar <- anyChar\n      end <- many1Char (char c)\n      let parser inp = parseFromString' (mconcat <$> many p) inp\n      let start' = case T.drop 2 start of\n                          \"\" -> mempty\n                          xs -> special xs\n      body' <- parser (middle <> T.singleton lastChar)\n      let end' = case T.drop 2 end of\n                          \"\" -> mempty\n                          xs -> special xs\n      return $ f (start' `mappend` body' `mappend` end')\n    Nothing -> do -- Either bad or case such as *****\n      guard (l >= 5)\n      let body' = T.replicate (l - 4) $ T.singleton c\n      return $ f (special body')\n\nlink :: T2T Inlines\nlink = try imageLink <|> titleLink\n\n-- Link with title\ntitleLink :: T2T Inlines\ntitleLink = try $ do\n  char '['\n  notFollowedBy space\n  tokens <- sepBy1 (manyChar $ noneOf \" ]\") space\n  guard (length tokens >= 2)\n  char ']'\n  let link' = last tokens\n  guard $ not $ T.null link'\n  let tit = T.unwords (init tokens)\n  return $ B.link link' \"\" (B.text tit)\n\n-- Link with image\nimageLink :: T2T Inlines\nimageLink = try $ do\n  char '['\n  body <- image\n  many1 space\n  l <- manyTillChar (noneOf \"\\n\\r \") (char ']')\n  return (B.link l \"\" body)\n\nmacro :: T2T Inlines\nmacro = try $ do\n  name <- string \"%%\" *> oneOfStringsCI (map fst commands)\n  optional (try $ enclosed (char '(') (char ')') anyChar)\n  lookAhead (spaceChar <|> oneOf specialChars <|> newline)\n  maybe (return mempty) (\\f -> asks (B.str . f)) (lookup name commands)\n  where\n    commands = [ (\"date\", date), (\"mtime\", mtime)\n               , (\"infile\", T.pack . infile), (\"outfile\", T.pack . outfile)]\n\n-- raw URLs in text are automatically linked\nurl :: T2T Inlines\nurl = try $ do\n  (rawUrl, escapedUrl) <- try uri <|> emailAddress'\n  return $ B.link rawUrl \"\" (B.str escapedUrl)\n\nemailAddress' :: T2T (Text, Text)\nemailAddress' = do\n  (base, mailURI) <- emailAddress\n  query <- option \"\" emailQuery\n  return (base <> query, mailURI <> query)\n\nemailQuery :: T2T Text\nemailQuery = do\n  char '?'\n  parts <- kv `sepBy1` (char '&')\n  return $ \"?\" <> T.intercalate \"&\" parts\n\nkv :: T2T Text\nkv = do\n  k <- T.pack <$> many1 alphaNum\n  char '='\n  let vchar = alphaNum <|> try (oneOf \"%._/~:,=$@&+-;*\" <* lookAhead alphaNum)\n  v <- T.pack <$> many1 vchar\n  return (k <> \"=\" <> v)\n\nuri :: T2T (Text, Text)\nuri = try $ do\n  address <- t2tURI\n  return (address, escapeURI address)\n\n-- The definition of a URI in the T2T source differs from the\n-- actual definition. This is a transcription of the definition in\n-- the source of v2.6\n--isT2TURI :: String -> Bool\n--isT2TURI (parse t2tURI \"\" -> Right _) = True\n--isT2TURI _ = False\n\nt2tURI :: T2T Text\nt2tURI = do\n  start <- try ((<>) <$> proto <*> urlLogin) <|> guess\n  domain <- many1Char chars\n  sep <- manyChar (char '/')\n  form' <- option mempty (T.cons <$> char '?' <*> many1Char form)\n  anchor' <- option mempty (T.cons <$> char '#' <*> manyChar anchor)\n  return (start <> domain <> sep <> form' <> anchor')\n  where\n    protos = [\"http\", \"https\", \"ftp\", \"telnet\", \"gopher\", \"wais\"]\n    proto = (<>) <$> oneOfStrings protos <*> textStr \"://\"\n    guess = (<>) <$> (((<>) <$> stringAnyCase \"www\" <*> option mempty (T.singleton <$> oneOf \"23\"))\n              <|> stringAnyCase \"ftp\") <*> (T.singleton <$> char '.')\n    login = alphaNum <|> oneOf \"_.-\"\n    pass = manyChar (noneOf \" @\")\n    chars = alphaNum <|> oneOf \"%._/~:,=$@&+-\"\n    anchor = alphaNum <|> oneOf \"%._0\"\n    form = chars <|> oneOf \";*\"\n    urlLogin = option mempty $ try ((\\x y z -> x <> y <> T.singleton z) <$> many1Char login <*> option mempty (T.cons <$> char ':' <*> pass) <*> char '@')\n\n\nimage :: T2T Inlines\nimage =  try $ do\n  -- List taken from txt2tags source\n  let extensions = [\".jpg\", \".jpeg\", \".gif\", \".png\", \".eps\", \".bmp\"]\n  char '['\n  (path, ext) <- manyUntilChar (noneOf \"\\n\\t\\r \") (oneOfStrings extensions)\n  char ']'\n  return $ B.image (path <> ext) \"\" mempty\n\n-- Characters used in markup\nspecialChars :: [Char]\nspecialChars = \"%*-_/|:+;\"\n\ntab :: T2T Char\ntab = char '\\t'\n\nspace :: T2T Char\nspace = char ' '\n\nspaces :: T2T Text\nspaces = manyChar space\n\nendline :: T2T Inlines\nendline = try $ do\n  newline\n  notFollowedBy blankline\n  notFollowedBy hrule\n  notFollowedBy title\n  notFollowedBy verbatim\n  notFollowedBy rawBlock\n  notFollowedBy taggedBlock\n  notFollowedBy quote\n  notFollowedBy list\n  notFollowedBy table\n  return B.softbreak\n\nstr :: T2T Inlines\nstr = try $ B.str <$> many1Char (noneOf $ specialChars ++ \"\\n\\r \")\n\nwhitespace :: T2T Inlines\nwhitespace = try $ B.space <$ spaceChar\n\nsymbol :: T2T Inlines\nsymbol = B.str . T.singleton <$> oneOf specialChars\n\n-- Utility\n\ngetTarget :: T2T Text\ngetTarget = do\n  mv <- lookupMeta \"target\" . stateMeta <$> getState\n  return $ case mv of\n              Just (MetaString target)        -> target\n              Just (MetaInlines [Str target]) -> target\n              _                               -> \"html\"\n\natStart :: T2T ()\natStart = getPosition >>= guard . (== 1) . sourceColumn\n\nignoreSpacesCap :: T2T Text -> T2T Text\nignoreSpacesCap p = T.toLower <$> (spaces *> p <* spaces)\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Typst/Math.hs",
    "content": "{-# LANGUAGE OverloadedLists #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\nmodule Text.Pandoc.Readers.Typst.Math\n  ( pMathMany\n  )\nwhere\n\nimport Control.Monad (MonadPlus (mplus))\nimport Data.Char (isAlphaNum, isDigit)\nimport Data.List (intercalate)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe)\nimport Data.Sequence (Seq)\nimport qualified Data.Sequence as Seq\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Vector as V\nimport Text.Pandoc.Parsing ( many )\nimport Text.Pandoc.Class ( PandocMonad )\nimport Text.TeXMath.Types\n  ( Alignment (..),\n    Exp (..),\n    FractionType (..),\n    TeXSymbolType (..),\n    TextType (..),\n  )\nimport Text.TeXMath.Unicode.ToTeX (getSymbolType)\nimport Text.Pandoc.Readers.Typst.Parsing\n    ( P, pTok, ignored, pWithContents, getField, chunks )\nimport Typst.Types\n\nwithGroup :: [Exp] -> Exp\nwithGroup [x] = x\nwithGroup xs = EGrouped xs\n\ndata AttachmentStyle = Limits | LimitsDisplay | Scripts\n  deriving (Eq, Show)\n\ngetAttachmentStyle :: PandocMonad m => M.Map Identifier Val -> P m (Maybe AttachmentStyle)\ngetAttachmentStyle fields = do\n  (base :: Seq Content) <- getField \"base\" fields\n  case base of\n    [Elt \"math.op\" _ fs] -> do\n      limits <- getField \"limits\" fs\n      if limits == VBoolean True\n         then pure $ Just Limits\n         else pure Nothing\n    [Elt \"math.limits\" _ fs] -> do\n      inl <- getField \"inline\" fs\n      if inl == VBoolean False\n         then pure $ Just LimitsDisplay\n         else pure $ Just Limits\n    [Elt \"math.scripts\" _ _] -> pure $ Just Scripts\n    _ -> pure Nothing\n\npMath :: PandocMonad m => P m Exp\npMath = pTok (const True) >>= handleMath\n\nhandleMath :: PandocMonad m => Content -> P m Exp\nhandleMath tok =\n  case tok of\n    Lab t -> do\n      ignored (\"label \" <> t)\n      pure (EGrouped [])\n    Txt t\n      | T.any isDigit t -> pure $ ENumber t\n      | T.length t == 1 ->\n          case T.unpack t of\n            [c] | not (isAlphaNum c) -> pure $ ESymbol (getSymbolType c) t\n            _ -> pure $ EIdentifier t\n      | otherwise -> pure $ EText TextNormal t\n    Elt \"math.dif\" _ _ -> pure $ EIdentifier \"d\"\n    Elt \"math.Dif\" _ _ -> pure $ EIdentifier \"D\"\n    Elt \"math.equation\" _ fields -> getField \"body\" fields >>= pMathGrouped\n    Elt \"text\" _ fields -> do\n      body <- getField \"body\" fields\n      (mbweight :: Maybe Text) <- getField \"weight\" fields\n      case mbweight of\n        Just \"bold\" -> EStyled TextBold <$> pMathMany body\n        _ -> pMathGrouped body\n    Elt \"math.op\" _ fields -> EMathOperator <$> getField \"text\" fields\n    Elt \"math.frac\" _ fields -> do\n      num <- getField \"num\" fields >>= pMathGrouped\n      denom <- getField \"denom\" fields >>= pMathGrouped\n      pure $ EFraction NormalFrac num denom\n    Elt \"math.accent\" _ fields -> do\n      base <- getField \"base\" fields >>= pMathGrouped\n      acc <- getField \"accent\" fields >>= pMathGrouped\n      let acc' = case acc of\n            ESymbol _ \"\\8901\" -> ESymbol Accent \"\\775\" -- \\dot\n            ESymbol _ \"\\168\" -> ESymbol Accent \"\\776\" -- \\ddot\n            ESymbol _ \"\\8764\" -> ESymbol Accent \"\\771\" -- \\tilde\n            ESymbol _ t -> ESymbol Accent t\n            _ -> acc\n      pure $ EOver False base acc'\n    Elt \"math.attach\" _ fields -> do\n      base <- getField \"base\" fields >>= pMathGrouped\n      t' <- getField \"t\" fields\n      b' <- getField \"b\" fields\n      tr' <- getField \"tr\" fields\n      tl' <- getField \"tl\" fields\n      br' <- getField \"br\" fields\n      bl' <- getField \"bl\" fields\n      attachmentStyle <- getAttachmentStyle fields\n      let limits = case attachmentStyle of\n                     Just Limits -> True\n                     Just LimitsDisplay -> True\n                     _ -> False\n      let convertible = attachmentStyle == Just LimitsDisplay\n      let (mbt, mbtr) =\n            case (t', tr') of\n              (Just top, Just topright) -> (Just top, Just topright)\n              (Just top, Nothing)\n                | limits -> (Just top, Nothing)\n                | otherwise -> (Nothing, Just top)\n              (Nothing, Just topright) -> (Nothing, Just topright)\n              (Nothing, Nothing) -> (Nothing, Nothing)\n      let (mbb, mbbr) =\n            case (b', br') of\n              (Just bot, Just botright) -> (Just bot, Just botright)\n              (Just bot, Nothing)\n                | limits -> (Just bot, Nothing)\n                | otherwise -> (Nothing, Just bot)\n              (Nothing, Just topright) -> (Nothing, Just topright)\n              (Nothing, Nothing) -> (Nothing, Nothing)\n      let dummy = EGrouped []\n      let addPrefix x =\n            case (tl', bl') of\n              (Nothing, Nothing) -> pure x\n              (Just top, Nothing) -> do\n                res <- ESuper dummy <$> pMathGrouped top\n                pure $ EGrouped [res, x]\n              (Nothing, Just bot) -> do\n                res <- ESub dummy <$> pMathGrouped bot\n                pure $ EGrouped [res, x]\n              (Just top, Just bot) -> do\n                res <- ESubsup dummy <$> pMathGrouped bot <*> pMathGrouped top\n                pure $ EGrouped [res, x]\n\n      base' <- case (mbtr, mbbr) of\n        (Nothing, Nothing) -> pure base\n        (Nothing, Just br) -> ESub base <$> pMathGrouped br\n        (Just tr, Nothing) -> ESuper base <$> pMathGrouped tr\n        (Just tr, Just br) -> ESubsup base <$> pMathGrouped br <*> pMathGrouped tr\n\n      suffix <- case (mbt, mbb) of\n        (Nothing, Nothing) -> pure base'\n        (Nothing, Just bot) -> EUnder convertible base' <$> pMathGrouped bot\n        (Just top, Nothing) -> EOver convertible base' <$> pMathGrouped top\n        (Just top, Just bot) -> EUnderover convertible base'\n                                  <$> pMathGrouped bot <*> pMathGrouped top\n\n      addPrefix suffix\n    Elt \"math.serif\" _ fields ->\n      EStyled TextNormal <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.sans\" _ fields ->\n      EStyled TextSansSerif <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.frak\" _ fields ->\n      EStyled TextFraktur <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.mono\" _ fields ->\n      EStyled TextMonospace <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.cal\" _ fields ->\n      EStyled TextScript <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.bb\" _ fields ->\n      EStyled TextDoubleStruck <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.upright\" _ fields ->\n      EStyled TextNormal <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.bold\" _ fields ->\n      EStyled TextBold <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.italic\" _ fields ->\n      EStyled TextItalic <$> (getField \"body\" fields >>= pMathMany)\n    Elt \"math.underline\" _ fields ->\n      EUnder False\n        <$> (getField \"body\" fields >>= pMathGrouped)\n        <*> pure (ESymbol TUnder \"_\")\n    Elt \"math.overline\" _ fields ->\n      EOver False\n        <$> (getField \"body\" fields >>= pMathGrouped)\n        <*> pure (ESymbol TOver \"\\175\")\n    Elt \"math.underbrace\" _ fields -> do\n      mbAnn <- getField \"annotation\" fields\n      body <- getField \"body\" fields >>= pMathGrouped\n      let x = EUnder False body (ESymbol TUnder \"\\9183\")\n      case mbAnn of\n        Nothing -> pure x\n        Just ann -> EUnder False x <$> pMathGrouped ann\n    Elt \"math.overbrace\" _ fields -> do\n      mbAnn <- getField \"annotation\" fields\n      body <- getField \"body\" fields >>= pMathGrouped\n      let x = EOver False body (ESymbol TOver \"\\9182\")\n      case mbAnn of\n        Nothing -> pure x\n        Just ann -> EOver False x <$> pMathGrouped ann\n    Elt \"math.underbracket\" _ fields -> do\n      mbAnn <- getField \"annotation\" fields\n      body <- getField \"body\" fields >>= pMathGrouped\n      let x = EUnder False body (ESymbol TUnder \"\\9141\")\n      case mbAnn of\n        Nothing -> pure x\n        Just ann -> EUnder False x <$> pMathGrouped ann\n    Elt \"math.overbracket\" _ fields -> do\n      mbAnn <- getField \"annotation\" fields\n      body <- getField \"body\" fields >>= pMathGrouped\n      let x = EOver False body (ESymbol TOver \"\\9140\")\n      case mbAnn of\n        Nothing -> pure x\n        Just ann -> EOver False x <$> pMathGrouped ann\n    Elt \"math.underparen\" _ fields -> do\n      mbAnn <- getField \"annotation\" fields\n      body <- getField \"body\" fields >>= pMathGrouped\n      let x = EUnder False body (ESymbol TUnder \"\\9181\")\n      case mbAnn of\n        Nothing -> pure x\n        Just ann -> EUnder False x <$> pMathGrouped ann\n    Elt \"math.overparen\" _ fields -> do\n      mbAnn <- getField \"annotation\" fields\n      body <- getField \"body\" fields >>= pMathGrouped\n      let x = EOver False body (ESymbol TOver \"\\9180\")\n      case mbAnn of\n        Nothing -> pure x\n        Just ann -> EOver False x <$> pMathGrouped ann\n    Elt \"math.scripts\" _ fields -> getField \"body\" fields >>= pMathGrouped\n    Elt \"math.limits\" _ fields -> getField \"body\" fields >>= pMathGrouped\n    Elt \"math.root\" _ fields -> do\n      mbindex <- getField \"index\" fields\n      radicand <- getField \"radicand\" fields >>= pMathGrouped\n      case mbindex of\n        Nothing -> pure $ ESqrt radicand\n        Just index -> do\n          index' <- pMathGrouped index\n          pure $ ERoot index' radicand\n    Elt \"math.sqrt\" _ fields ->\n      ESqrt <$> (getField \"radicand\" fields >>= pMathGrouped)\n    Elt \"math.abs\" _ fields -> do\n      body <- getField \"body\" fields >>= pMathGrouped\n      pure $ EDelimited \"|\" \"|\" [Right body]\n    Elt \"math.floor\" _ fields -> do\n      body <- getField \"body\" fields >>= pMathGrouped\n      pure $ EDelimited \"\\8970\" \"\\8971\" [Right body]\n    Elt \"math.ceil\" _ fields -> do\n      body <- getField \"body\" fields >>= pMathGrouped\n      pure $ EDelimited \"\\8968\" \"\\8969\" [Right body]\n    Elt \"math.norm\" _ fields -> do\n      body <- getField \"body\" fields >>= pMathGrouped\n      pure $ EDelimited \"\\8214\" \"\\8214\" [Right body]\n    Elt \"math.round\" _ fields -> do\n      body <- getField \"body\" fields >>= pMathGrouped\n      pure $ EDelimited \"\\8970\" \"\\8969\" [Right body]\n    Elt \"math.lr\" _ fields -> do\n      bodyparts <- getField \"body\" fields >>= mapM pMathMany . V.toList\n      let rawbody = intercalate [ESymbol Pun \",\"] bodyparts\n      let (op, rest) =\n            case rawbody of\n              (ESymbol _ t : xs) -> (t, xs)\n              _ -> (\"\", rawbody)\n      let (body, cl) =\n            case reverse rest of\n              (ESymbol _ t : _) -> (map Right (init rest), t)\n              _ -> (map Right rest, \"\")\n      pure $ EDelimited op cl body\n    Elt \"math.binom\" _ fields -> do\n      up <- getField \"upper\" fields >>= pMathGrouped\n      low <- getField \"lower\" fields >>= pMathGrouped\n      pure $ EDelimited \"(\" \")\" [Right (EFraction NoLineFrac up low)]\n    Elt \"math.cases\" _ fields -> do\n      (delim :: Maybe Text) <- getField \"delim\" fields\n      (children :: [Seq Content]) <-\n        map valToContent . V.toList <$> getField \"children\" fields\n      let isAlignPoint (Elt \"math.alignpoint\" _ _) = True\n          isAlignPoint _ = False\n      let formatRow vs = case Seq.breakl isAlignPoint vs of\n            (xs, ys) -> do\n              case Seq.viewl ys of\n                _ Seq.:< rest -> do\n                  xs' <- pMathMany xs\n                  ys' <- pMathMany rest\n                  pure [xs', ys']\n                _ -> (: []) <$> pMathMany vs\n      rows <- mapM formatRow children\n      pure $\n        EDelimited\n          (fromMaybe \"{\" delim)\n          \"\"\n          [Right (EArray [AlignLeft, AlignLeft] rows)]\n    Elt \"math.vec\" _ fields -> do\n      (op, cl) <- arrayDelims fields\n      rows <-\n        getField \"children\" fields\n          >>= mapM (fmap (: []) . pMathMany) . V.toList\n      pure $\n        EDelimited\n          op\n          cl\n          [Right (EArray [AlignCenter] rows)]\n    Elt \"math.mat\" _ fields -> do\n      (op, cl) <- arrayDelims fields\n      let formatCell x = do\n            let content = valToContent x\n            let align = case Seq.viewl content of\n                  Elt \"math.alignpoint\" _ _ Seq.:< _ -> AlignLeft\n                  _ -> case Seq.viewr content of\n                    _ Seq.:> Elt \"math.alignpoint\" _ _ -> AlignRight\n                    _ -> AlignCenter\n            exp' <- pMathMany content\n            pure (align, exp')\n      let formatRow (VArray vs) = mapM formatCell (V.toList vs)\n          formatRow _ = fail \"mat expected array\"\n      (rawrows :: V.Vector Val) <- getField \"rows\" fields\n      rows <- mapM formatRow (V.toList rawrows)\n      let aligns =\n            case rows of\n              [] -> []\n              (r : _) -> map fst r\n      pure $\n        EDelimited\n          op\n          cl\n          [Right (EArray aligns (map (map snd) rows))]\n    Elt \"hide\" _ fields -> do\n      EPhantom <$> (getField \"body\" fields >>= pMathGrouped)\n    Elt \"h\" _ fields -> do\n      amount <- getField \"amount\" fields\n      let em = case amount of\n            LExact x LEm -> toRational x\n            _ -> case amount <> LExact 0 LPt of -- force to Pt\n              LExact x LPt -> toRational x / 12\n              _ -> 1 / 3 -- guess!\n      pure $ ESpace em\n    Elt \"grid\" _ fields -> do\n      children <- getField \"children\" fields >>= mapM pMathMany . V.toList\n      (columns :: Val) <- getField \"columns\" fields\n      numcols <- case columns of\n        VInteger x -> pure $ fromIntegral x\n        VArray x -> pure $ V.length x\n        VNone -> pure 1\n        _ -> fail $ \"Could not determine number of columns: \" <> show columns\n      let rows = chunks numcols children\n      pure $ EArray (replicate numcols AlignLeft) rows\n    Elt \"table\" pos fields -> handleMath (Elt \"grid\" pos fields)\n    Elt \"link\" _ fields -> do\n      body <- getField \"body\" fields\n      ignored \"hyperlink in math\"\n      pMathGrouped body\n    Elt \"math.display\" _ fields -> do\n      content <- getField \"content\" fields\n      ignored \"display\"\n      pMathGrouped content\n    Elt \"math.inline\" _ fields -> do\n      content <- getField \"content\" fields\n      ignored \"inline\"\n      pMathGrouped content\n    Elt \"math.script\" _ fields -> do\n      content <- getField \"content\" fields\n      ignored \"script\"\n      pMathGrouped content\n    Elt \"math.sscript\" _ fields -> do\n      content <- getField \"content\" fields\n      ignored \"sscript\"\n      pMathGrouped content\n    Elt (Identifier name) _ fields -> do\n      body <- getField \"body\" fields `mplus` pure mempty\n      ignored name\n      pMathGrouped body\n\narrayDelims :: PandocMonad m => M.Map Identifier Val -> P m (Text, Text)\narrayDelims fields = do\n  (mbdelim :: Maybe Text) <- getField \"delim\" fields\n  pure $ case mbdelim of\n    Just \"(\" -> (\"(\", \")\")\n    Just \"[\" -> (\"[\", \"]\")\n    Just \"{\" -> (\"{\", \"}\")\n    Just \"|\" -> (\"|\", \"|\")\n    Just \"||\" -> (\"\\8741\", \"\\8741\")\n    _ -> (\"(\", \")\")\n\npMathMany :: PandocMonad m => Seq Content -> P m [Exp]\npMathMany cs = do\n  -- check for \"alignpoint\" and \"linebreak\" elements\n  -- and use an array structure for alignment\n  let lns = splitOnLinebreaks cs\n  case lns of\n    [] -> pure []\n    [ln] | not (any isAlignpoint ln) -> pWithContents (many pMath) ln\n    _ -> do\n      rows <- mapM (mapM (pWithContents (many pMath)) . splitOnAlignpoints) lns\n      let numcols = maximum $ map length rows\n      let cols = take numcols $ AlignRight : cycle [AlignLeft, AlignRight]\n      pure [EArray cols rows]\n\npMathGrouped :: PandocMonad m => Seq Content -> P m Exp\npMathGrouped = fmap withGroup . pMathMany\n\nsplitOnLinebreaks :: Seq Content -> [Seq Content]\nsplitOnLinebreaks xs =\n  if Seq.null bs\n    then\n      if null as\n        then []\n        else [as]\n    else as : splitOnLinebreaks (Seq.drop 1 bs)\n  where\n    (as, bs) = Seq.breakl isLinebreak xs\n    isLinebreak (Elt \"linebreak\" _ _) = True\n    isLinebreak _ = False\n\nsplitOnAlignpoints :: Seq Content -> [Seq Content]\nsplitOnAlignpoints xs =\n  if Seq.null bs\n    then\n      if null as\n        then []\n        else [as]\n    else as : splitOnAlignpoints (Seq.drop 1 bs)\n  where\n    (as, bs) = Seq.breakl isAlignpoint xs\n\nisAlignpoint :: Content -> Bool\nisAlignpoint (Elt \"math.alignpoint\" _ _) = True\nisAlignpoint _ = False\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Typst/Parsing.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedLists #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\nmodule Text.Pandoc.Readers.Typst.Parsing\n  ( P,\n    PState(..),\n    defaultPState,\n    pTok,\n    pWithContents,\n    ignored,\n    getField,\n    chunks,\n  )\nwhere\nimport Control.Monad (MonadPlus)\nimport Control.Monad.Reader (lift)\nimport qualified Data.Foldable as F\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe)\nimport Data.Sequence (Seq)\nimport Data.Text (Text)\nimport Text.Parsec\n    ( ParsecT, getInput, setInput, tokenPrim )\nimport Typst.Types\n    ( Identifier, Content(Elt), FromVal(..), Val(VNone) )\nimport Text.Pandoc.Class.PandocMonad ( PandocMonad, report )\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Text.Pandoc.Definition\n\ndata PState = PState\n        { sLabels :: [Text]\n        , sMeta :: Meta }\n        deriving (Show)\n\ndefaultPState :: PState\ndefaultPState =\n  PState\n  { sLabels = []\n  , sMeta = mempty }\n\ntype P m a = ParsecT [Content] PState m a\n-- state tracks a list of labels in the document\n\npTok :: PandocMonad m => (Content -> Bool) -> P m Content\npTok f = tokenPrim show showPos match\n  where\n    showPos _oldpos (Elt _ (Just pos) _) _ = pos\n    showPos oldpos _ _ = oldpos\n    match x | f x = Just x\n    match _ = Nothing\n\nignored :: PandocMonad m => Text -> P m ()\nignored msg = lift $ report $ IgnoredElement msg\n\npWithContents :: PandocMonad m => P m a -> Seq Content -> P m a\npWithContents pa cs = do\n  inp <- getInput\n  setInput $ F.toList cs\n  res <- pa\n  setInput inp\n  pure res\n\n-- | Get field value from element, defaulting to VNone.\ngetField ::\n  (MonadFail m, MonadPlus m, FromVal a) =>\n  Identifier ->\n  M.Map Identifier Val ->\n  m a\ngetField name fields = fromVal $ fromMaybe VNone $ M.lookup name fields\n\n-- | Split a list into chunks of a given size. The last chunk may be smaller.\nchunks :: Int -> [a] -> [[a]]\nchunks _ [] = []\nchunks n xs = take n xs : chunks n (drop n xs)\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Typst.hs",
    "content": "{-# LANGUAGE RankNTypes #-}\n{-# LANGUAGE BangPatterns #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE UndecidableInstances #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedLists #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\n{- |\n   Module      : Text.Pandoc.Readers.Typst\n   Copyright   : Copyright (C) 2023 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nReads and evaluates a Typst document as a Pandoc AST.\n-}\nmodule Text.Pandoc.Readers.Typst\n  ( readTypst\n  )\nwhere\n\nimport Text.Pandoc.Class\nimport Text.Pandoc.Sources\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Typst ( parseTypst, evaluateTypst )\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Translations (Term(References), translateTerm)\nimport Text.Pandoc.Shared (tshow, blocksToInlines)\nimport Control.Monad.Except (throwError)\nimport Control.Monad (MonadPlus (mplus), void, guard, foldM)\nimport Control.Monad.Trans (lift)\nimport qualified Data.Foldable as F\nimport qualified Data.Map as M\nimport Data.Maybe (catMaybes, fromMaybe, isJust)\nimport Data.Sequence (Seq)\nimport qualified Data.Sequence as Seq\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Walk\nimport Text.Parsec\nimport Text.TeXMath (writeTeX)\nimport Text.TeXMath.Shared (getSpaceChars)\nimport Text.Pandoc.Readers.Typst.Math (pMathMany)\nimport Text.Pandoc.Readers.Typst.Parsing (pTok, ignored, getField, P,\n                                          PState(..), defaultPState)\nimport Typst.Methods (formatNumber, applyPureFunction)\nimport Typst.Types\nimport qualified Data.Vector as V\nimport System.FilePath (takeDirectory)\nimport qualified System.FilePath.Windows as Windows\nimport qualified System.FilePath.Posix as Posix\n\n-- | Read Typst from an input string and return a Pandoc document.\nreadTypst :: (PandocMonad m, ToSources a)\n           => ReaderOptions -> a -> m Pandoc\nreadTypst _opts inp = do\n  let sources = toSources inp\n  let inputName = case sources of\n        Sources ((pos, _):_) -> sourceName pos\n        _ -> \"\"\n  case parseTypst inputName (sourcesToText sources) of\n    Left e -> throwError $ PandocParseError $ T.pack $ show e\n    Right parsed -> do\n      let ops = Operations {\n                  loadBytes = readFileStrict,\n                  currentUTCTime = getCurrentTime,\n                  lookupEnvVar = fmap (fmap T.unpack) . lookupEnv . T.pack,\n                  checkExistence = fileExists }\n      res <- evaluateTypst ops inputName parsed\n      case res of\n        Left e -> throwError $ PandocParseError $ tshow e\n        Right content -> do\n          let content' = fixNesting content\n          let labs = findLabels [content']\n          runParserT pPandoc defaultPState{ sLabels = labs }\n            inputName [content'] >>=\n              either (throwError . PandocParseError . T.pack . show) pure\n\npBlockElt :: PandocMonad m => P m B.Blocks\npBlockElt = try $ do\n  res <- pTok (\\t -> isBlock t || not (isInline t))\n  -- check for following label\n  mbident <- option Nothing $ Just <$> pLab\n  case res of\n    Elt name@(Identifier tname) pos fields -> do\n      case M.lookup name blockHandlers of\n        Nothing -> do\n          ignored (\"unknown block element \" <> tname <>\n                   \" at \" <> tshow pos)\n          pure mempty\n        Just handler -> handler pos mbident fields\n    _ -> pure mempty\n\npInline :: PandocMonad m => P m B.Inlines\npInline = try $ do\n  res <- pTok (\\t -> isInline t || not (isBlock t))\n  case res of\n    Txt t -> pure $ B.text t\n    Lab name -> pure $ B.spanWith (name, [], []) mempty\n    Elt (Identifier tname) _ _\n      | \"math.\" `T.isPrefixOf` tname\n      , tname /= \"math.equation\" ->\n          B.math . writeTeX <$> pMathMany (Seq.singleton res)\n    Elt name@(Identifier tname) pos fields -> do\n      labs <- sLabels <$> getState\n      labelTarget <- (do result <- getField \"target\" fields\n                         case result of\n                           VLabel t | t `elem` labs -> pure True\n                           _ -> pure False)\n                  <|> pure False\n      if tname == \"ref\" && not labelTarget\n         then do\n           -- @foo is a citation unless it links to a lab in the doc:\n           let targetToKey (Identifier \"target\") = Identifier \"key\"\n               targetToKey k = k\n           case M.lookup \"cite\" inlineHandlers of\n             Nothing -> do\n               ignored (\"unknown inline element \" <> tname <>\n                        \" at \" <> tshow pos)\n               pure mempty\n             Just handler -> handler pos Nothing (M.mapKeys targetToKey fields)\n         else do\n          case M.lookup name inlineHandlers of\n            Nothing -> do\n              ignored (\"unknown inline element \" <> tname <>\n                       \" at \" <> tshow pos)\n              pure mempty\n            Just handler -> handler pos Nothing fields\n\n-- Pull block elements out of inline elements, e.g.\n-- Elt \"smallcaps\" [ Elt \"heading\" [..] ] ->\n-- Elt \"heading\" [ Elt \"smallcaps\" [..]]. See #11017.\nfixNesting :: Content -> Content\nfixNesting el@(Elt name pos fields)\n  | Just (VContent elts) <- M.lookup \"body\" fields\n  = let elts' = fmap fixNesting elts\n        fields' = M.insert \"body\" (VContent elts') fields\n        in if isInline el\n              then case getField \"body\" fields' of\n                        Just ([el'@(Elt name' pos' fields'')] :: Seq Content)\n                          | isBlock el'\n                          , not (isInline el')\n                          , \"body\" `M.member` fields''\n                          -> Elt name' pos' $\n                               M.insert \"body\" (VContent\n                                                (Seq.singleton\n                                                  (Elt name pos fields'')))\n                                        fields'\n                        _ -> Elt name pos fields'\n              else Elt name pos fields'\nfixNesting x = x\n\npPandoc :: PandocMonad m => P m B.Pandoc\npPandoc = do\n  Elt \"document\" _ fields <- pTok isDocument\n  bs <- getField \"body\" fields >>= pWithContents pBlocks\n  title <- (getField \"title\" fields >>= pWithContents pInlines) <|>\n              pure mempty\n  authors <- (getField \"author\" fields >>=\n                          mapM (pWithContents pInlines) . V.toList) <|>\n             ((:[]) <$> (getField \"author\" fields >>=\n                           (\\x -> guard (not (null x)) *>\n                             pWithContents pInlines x))) <|>\n              pure []\n  date <- (getField \"date\" fields >>= pWithContents pInlines) <|>\n              pure mempty\n  keywords <- (getField \"keywords\" fields >>=\n                 mapM (pWithContents pInlines) . V.toList)\n                <|> pure []\n  meta <- sMeta <$> getState\n  let meta' =\n        (if title == mempty || isJust (lookupMeta \"title\" meta)\n            then id\n            else B.setMeta \"title\" title) .\n        (if null authors\n            then id\n            else B.setMeta \"author\" authors) .\n        (if null date\n            then id\n            else B.setMeta \"date\" date) .\n        (if null keywords\n            then id\n            else B.setMeta \"keywords\" keywords) $ meta\n  pure $ Pandoc meta' (B.toList bs)\n\npBlocks :: PandocMonad m => P m B.Blocks\npBlocks = mconcat <$> many pBlock\n\npBlock :: PandocMonad m => P m B.Blocks\npBlock = pPara <|> pBlockElt\n\npSpace :: PandocMonad m => P m Content\npSpace = pTok\n      ( \\case\n          Txt t | T.all (== ' ') t -> True\n          _ -> False )\n\npLab :: PandocMonad m => P m Text\npLab = try $ do\n  optional pSpace\n  Lab t <- pTok\n       ( \\case\n           Lab _ -> True\n           _ -> False\n       )\n  pure t\n\nisDocument :: Content -> Bool\nisDocument (Elt \"document\" _ _) = True\nisDocument _ = False\n\nisBlock :: Content -> Bool\nisBlock (Elt \"raw\" _ fields) = M.lookup \"block\" fields == Just (VBoolean True)\nisBlock (Elt name _ _) = name `Set.member` blockKeys\nisBlock Lab{} = True\nisBlock _ = False\n\nisInline :: Content -> Bool\nisInline (Elt \"raw\" _ fields) = M.lookup \"block\" fields /= Just (VBoolean True)\nisInline (Elt name _ _) = name `Set.member` inlineKeys\nisInline Lab{} = True\nisInline Txt{} = True\n\nblockKeys :: Set.Set Identifier\nblockKeys = Set.fromList $ M.keys\n  (blockHandlers :: M.Map Identifier\n     (Maybe SourcePos -> Maybe Text ->\n      M.Map Identifier Val -> P PandocPure B.Blocks))\n\ninlineKeys :: Set.Set Identifier\ninlineKeys = Set.fromList $ M.keys\n  (inlineHandlers :: M.Map Identifier\n     (Maybe SourcePos -> Maybe Text ->\n      M.Map Identifier Val -> P PandocPure B.Inlines))\n\nblockHandlers :: PandocMonad m =>\n                   M.Map Identifier\n                   (Maybe SourcePos -> Maybe Text ->\n                    M.Map Identifier Val -> P m B.Blocks)\nblockHandlers = M.fromList\n  [(\"text\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      -- sometimes text elements include para breaks\n      notFollowedBy $ void $ pWithContents pInlines body\n      pWithContents pBlocks body)\n  ,(\"title\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      case body of\n        VContent cs -> do\n          ils <- pWithContents pInlines cs <|> pure mempty\n          updateState $ \\s -> s{ sMeta = B.setMeta \"title\" ils (sMeta s) }\n          pure mempty\n        _ -> pure mempty)\n  ,(\"box\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.divWith (\"\", [\"box\"], []) <$> pWithContents pBlocks body)\n  ,(\"heading\", \\_ mbident fields -> do\n      body <- getField \"body\" fields\n      lev <- getField \"level\" fields <|> pure 1\n      B.headerWith (fromMaybe \"\" mbident,[],[]) lev\n         <$> pWithContents pInlines body)\n  ,(\"quote\", \\_ _ fields -> do\n      getField \"block\" fields >>= guard\n      body <- getField \"body\" fields >>= pWithContents pBlocks\n      attribution' <- getField \"attribution\" fields\n      attribution <- if attribution' == mempty\n                        then pure mempty\n                        else (\\x -> B.para (\"\\x2014\\xa0\" <> x)) <$>\n                              (pWithContents pInlines attribution')\n      pure $ B.blockQuote $ body <> attribution)\n  ,(\"list\", \\_ _ fields -> do\n      children <- V.toList <$> getField \"children\" fields\n      B.bulletList <$> mapM (pWithContents pBlocks) children)\n  ,(\"list.item\", \\_ _ fields -> getField \"body\" fields >>= pWithContents pBlocks)\n  ,(\"enum\", \\_ _ fields -> do\n      children <- V.toList <$> getField \"children\" fields\n      mbstart <- getField \"start\" fields\n      start <- case mbstart of\n        Nothing -> pure 1\n        Just x\n          | x >= 0 -> pure x\n          | otherwise -> fail \"number must be positive\"\n      (numbering :: Text) <- getField \"numbering\" fields `mplus` pure \"\"\n      let (sty, delim) =\n            case numbering of\n              \"1.\" -> (B.Decimal, B.Period)\n              \"1)\" -> (B.Decimal, B.OneParen)\n              \"(1)\" -> (B.Decimal, B.TwoParens)\n              \"a.\" -> (B.LowerAlpha, B.Period)\n              \"a)\" -> (B.LowerAlpha, B.OneParen)\n              \"(a)\" -> (B.LowerAlpha, B.TwoParens)\n              \"A.\" -> (B.UpperAlpha, B.Period)\n              \"A)\" -> (B.UpperAlpha, B.OneParen)\n              \"(A)\" -> (B.UpperAlpha, B.TwoParens)\n              \"i.\" -> (B.LowerRoman, B.Period)\n              \"i)\" -> (B.LowerRoman, B.OneParen)\n              \"(i)\" -> (B.LowerRoman, B.TwoParens)\n              \"I.\" -> (B.UpperRoman, B.Period)\n              \"I)\" -> (B.UpperRoman, B.OneParen)\n              \"(I)\" -> (B.UpperRoman, B.TwoParens)\n              _ -> (B.DefaultStyle, B.DefaultDelim)\n      let listAttr = (start, sty, delim)\n      B.orderedListWith listAttr <$> mapM (pWithContents pBlocks) children)\n  ,(\"enum.item\", \\_ _ fields -> getField \"body\" fields >>= pWithContents pBlocks)\n  ,(\"terms\", \\_ _ fields -> do\n      children <- V.toList <$> getField \"children\" fields\n      B.definitionList\n        <$> mapM\n          ( \\case\n              VTermItem t d -> do\n                t' <- pWithContents pInlines t\n                d' <- pWithContents pBlocks d\n                pure (t', [d'])\n              _ -> pure (mempty, [])\n          )\n          children)\n  ,(\"terms.item\", \\_ _ fields -> getField \"body\" fields >>= pWithContents pBlocks)\n  ,(\"raw\", \\_ mbident fields -> do\n      txt <- T.filter (/= '\\r') <$> getField \"text\" fields\n      mblang <- getField \"lang\" fields\n      let attr = (fromMaybe \"\" mbident, maybe [] (\\l -> [l]) mblang, [])\n      pure $ B.codeBlockWith attr txt)\n  ,(\"parbreak\", \\_ _ _ -> pure mempty)\n  ,(\"block\", \\_ mbident fields ->\n      maybe id (\\ident -> B.divWith (ident, [], [])) mbident\n        <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"place\", \\_ _ fields -> do\n      ignored \"parameters of place\"\n      getField \"body\" fields >>= pWithContents pBlocks)\n  ,(\"columns\", \\_ _ fields -> do\n      (cnt :: Integer) <- getField \"count\" fields\n      B.divWith (\"\", [\"columns-flow\"], [(\"count\", T.pack (show cnt))])\n        <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"rect\", \\_ _ fields ->\n      B.divWith (\"\", [\"rect\"], []) <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"circle\", \\_ _ fields ->\n      B.divWith (\"\", [\"circle\"], []) <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"ellipse\", \\_ _ fields ->\n      B.divWith (\"\", [\"ellipse\"], []) <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"polygon\", \\_ _ fields ->\n      B.divWith (\"\", [\"polygon\"], []) <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"square\", \\_ _ fields ->\n      B.divWith (\"\", [\"square\"], []) <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"align\", \\_ _ fields -> do\n      alignment <- getField \"alignment\" fields\n      B.divWith (\"\", [], [(\"align\", repr alignment)])\n        <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"stack\", \\_ _ fields -> do\n      (dir :: Direction) <- getField \"dir\" fields `mplus` pure Ltr\n      rawchildren <- getField \"children\" fields\n      children <-\n        mapM\n          ( \\case\n              val@(VFraction {}) ->\n                pure $ B.divWith (\"\", [], [(\"space\", repr val)]) mempty\n              val -> fromVal val >>= pWithContents pBlocks\n          )\n          (V.toList rawchildren)\n      pure $\n        B.divWith (\"\", [], [(\"stack\", repr (VDirection dir))]) $\n          mconcat $\n            map (B.divWith (\"\", [], [])) children)\n  ,(\"grid\", \\_ mbident fields -> parseTable mbident fields)\n  ,(\"table\", \\_ mbident fields -> parseTable mbident fields)\n  ,(\"figure\", \\_ mbident fields -> do\n      body <- getField \"body\" fields >>= pWithContents pBlocks\n      (mbCaption :: Maybe (Seq Content)) <- getField \"caption\" fields\n      (caption :: B.Blocks) <- maybe mempty (pWithContents pBlocks) mbCaption\n      pure $ case B.toList body of\n        [B.Table attr _ colspecs thead tbodies tfoot] ->\n          B.singleton\n            (B.Table attr (B.Caption Nothing (B.toList caption)) colspecs thead tbodies tfoot)\n        _ -> B.figureWith (fromMaybe \"\" mbident, [], [])\n                          (B.Caption Nothing (B.toList caption)) body)\n  ,(\"line\", \\_ _ fields ->\n      case ( M.lookup \"start\" fields\n              >> M.lookup \"end\" fields\n              >> M.lookup \"angle\" fields ) of\n        Nothing -> pure B.horizontalRule\n        _ -> pure mempty)\n  ,(\"numbering\", \\_ _ fields -> do\n      numStyle <- getField \"numbering\" fields\n      (nums :: V.Vector Integer) <- getField \"numbers\" fields\n      let toText v = fromMaybe \"\" $ fromVal v\n      let toNum n =\n            case numStyle of\n              VString t -> formatNumber t (fromIntegral n)\n              VFunction _ _ f ->\n                case applyPureFunction f [VInteger n] of\n                  Success x -> toText x\n                  Failure _ -> \"?\"\n              _ -> \"?\"\n      pure $ B.plain . B.text . mconcat . map toNum $ V.toList nums)\n  ,(\"footnote.entry\", \\_ _ fields ->\n      getField \"body\" fields >>= pWithContents pBlocks)\n  ,(\"pad\", \\_ _ fields ->  -- ignore paddingy\n      getField \"body\" fields >>= pWithContents pBlocks)\n  ,(\"pagebreak\", \\_ _ _ -> pure $ B.divWith (\"\", [\"page-break\"], [(\"wrapper\", \"1\")]) B.horizontalRule)\n  ,(\"bibliography\", \\_ _ fields -> do\n      let getSources v = case v of\n                      VString t -> MetaString t\n                      VArray xs -> MetaList $ map getSources $ V.toList xs\n                      _ -> MetaBool True -- should not occur\n      let mbSources = getSources <$> M.lookup \"sources\" fields\n\n      let updateBibliography x = updateState $ \\s ->\n             s{ sMeta = B.setMeta \"bibliography\" x (sMeta s) }\n      maybe (pure ()) updateBibliography mbSources\n\n      let title' = M.lookup \"title\" fields\n      mbTitle <- case title' of\n                   Just VNone -> pure Nothing\n                   Just (VContent cs) -> Just <$> pWithContents pInlines cs\n                   Just (VString t) -> pure $ Just $ B.text t\n                   _ -> Just . B.text <$> lift (translateTerm References)\n      let hdr = maybe mempty (B.header 1) mbTitle\n      pure $ hdr <> B.divWith (\"refs\", [], []) mempty)\n  ]\n\ninlineHandlers :: PandocMonad m =>\n    M.Map Identifier (Maybe SourcePos -> Maybe Text ->\n                      M.Map Identifier Val -> P m B.Inlines)\ninlineHandlers = M.fromList\n  [(\"ref\", \\_ _ fields -> do\n      VLabel target <- getField \"target\" fields\n      supplement' <- getField \"supplement\" fields\n      supplement <- case supplement' of\n                      VAuto -> -- TODO for now, until we can locate the element\n                        pure $ B.text (\"[\" <> target <> \"]\")\n                      VContent cs -> pWithContents pInlines cs\n                      VFunction _ _ _f -> -- TODO for now, until we can locate the element\n                           pure $ B.text (\"[\" <> target <> \"]\")\n                      _ -> pure mempty\n      pure $ B.linkWith (\"\", [\"ref\"], []) (\"#\" <> target) \"\" supplement)\n  ,(\"linebreak\", \\_ _ _ -> pure B.linebreak)\n  ,(\"text\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      (mbweight :: Maybe Text) <- getField \"weight\" fields\n      case mbweight of\n        Just \"bold\" -> B.strong <$> pWithContents pInlines body\n        _ -> pWithContents pInlines body)\n  ,(\"raw\", \\_ _ fields -> B.code . T.filter (/= '\\r') <$> getField \"text\" fields)\n  ,(\"footnote\", \\_ _ fields ->\n      B.note <$> (getField \"body\" fields >>= pWithContents pBlocks))\n  ,(\"cite\", \\_ _ fields -> do\n      VLabel key <- getField \"key\" fields\n      (form :: Text) <- getField \"form\" fields <|> pure \"normal\"\n      let citation =\n            B.Citation\n              { B.citationId = key,\n                B.citationPrefix = mempty,\n                B.citationSuffix = mempty,\n                B.citationMode = case form of\n                                    \"year\" -> B.SuppressAuthor\n                                    _ -> B.NormalCitation,\n                B.citationNoteNum = 0,\n                B.citationHash = 0\n              }\n      pure $ B.cite [citation] (B.text $ \"[\" <> key <> \"]\"))\n  ,(\"lower\", \\_ _ fields -> do\n      body <- getField \"text\" fields\n      walk (modString T.toLower) <$> pWithContents pInlines body)\n  ,(\"upper\", \\_ _ fields -> do\n      body <- getField \"text\" fields\n      walk (modString T.toUpper) <$> pWithContents pInlines body)\n  ,(\"emph\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.emph <$> pWithContents pInlines body)\n  ,(\"strong\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.strong <$> pWithContents pInlines body)\n  ,(\"sub\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.subscript <$> pWithContents pInlines body)\n  ,(\"super\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.superscript <$> pWithContents pInlines body)\n  ,(\"strike\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.strikeout <$> pWithContents pInlines body)\n  ,(\"smallcaps\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.smallcaps <$> pWithContents pInlines body)\n  ,(\"underline\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.underline <$> pWithContents pInlines body)\n  ,(\"quote\", \\_ _ fields -> do\n      (getField \"block\" fields <|> pure False) >>= guard . not\n      body <- getInlineBody fields >>= pWithContents pInlines\n      pure $ B.doubleQuoted $ B.trimInlines body)\n  ,(\"link\", \\_ _ fields -> do\n      dest <- getField \"dest\" fields\n      src <- case dest of\n        VString t -> pure t\n        VLabel t -> pure $ \"#\" <> t\n        VDict _ -> do\n          ignored \"link to location, linking to #\"\n          pure \"#\"\n        _ -> fail \"Expected string or label for dest\"\n      body <- getField \"body\" fields\n      description <-\n        if null body\n          then\n            pure $\n              B.text $\n                if \"mailto:\" `T.isPrefixOf` src\n                  then T.drop 7 src\n                  else\n                    if \"tel:\" `T.isPrefixOf` src\n                      then T.drop 4 src\n                      else src\n          else pWithContents pInlines body <|>\n               pWithContents\n                (B.fromList . blocksToInlines . B.toList <$> pBlocks) body\n      pure $ B.link src \"\" description)\n  ,(\"image\", \\mbpos _ fields -> do\n      path <- getField \"source\" fields <|> getField \"path\" fields\n      alt <- (B.text <$> getField \"alt\" fields) `mplus` pure mempty\n      let basedir = maybe \".\" (takeDirectory . sourceName) mbpos\n      let isAbsolutePath p = Posix.isAbsolute p || Windows.isAbsolute p\n      let path' = T.pack $\n                  if isAbsolutePath path || basedir == \".\"\n                     then path\n                     else basedir Posix.</> path\n      (mbwidth :: Maybe Text) <-\n        fmap (renderLength False) <$> getField \"width\" fields\n      (mbheight :: Maybe Text) <-\n        fmap (renderLength False) <$> getField \"height\" fields\n      let attr =\n            ( \"\",\n              [],\n              maybe [] (\\x -> [(\"width\", x)]) mbwidth\n                ++ maybe [] (\\x -> [(\"height\", x)]) mbheight\n            )\n      pure $ B.imageWith attr path' \"\" alt)\n  ,(\"box\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      B.spanWith (\"\", [\"box\"], []) <$> pWithContents pInlines body)\n  ,(\"h\", \\_ _ fields -> do\n      amount <- getField \"amount\" fields `mplus` pure (LExact 1 LEm)\n      let em = case amount of\n            LExact x LEm -> toRational x\n            _ -> case amount <> LExact 0 LPt of -- force to Pt\n              LExact x LPt -> toRational x / 12\n              _ -> 1 / 3 -- guess!\n      pure $ B.text $ getSpaceChars em)\n  ,(\"place\", \\_ _ fields -> do\n      ignored \"parameters of place\"\n      getField \"body\" fields >>= pWithContents pInlines)\n  ,(\"align\", \\_ _ fields -> do\n      alignment <- getField \"alignment\" fields\n      B.spanWith (\"\", [], [(\"align\", repr alignment)])\n        <$> (getField \"body\" fields >>= pWithContents pInlines))\n  ,(\"sys.version\", \\_ _ _ -> pure $ B.text \"typst-hs\")\n  ,(\"math.equation\", \\_ _ fields -> do\n      body <- getField \"body\" fields\n      display <- getField \"block\" fields\n      (if display then B.displayMath else B.math) . writeTeX <$> pMathMany body)\n  ,(\"pad\", \\_ _ fields ->  -- ignore paddingy\n      getField \"body\" fields >>= pWithContents pInlines)\n  ,(\"block\", \\_ mbident fields ->\n      maybe id (\\ident -> B.spanWith (ident, [], [])) mbident\n        <$> (getField \"body\" fields >>= pWithContents pInlines))\n  ]\n\ngetInlineBody :: PandocMonad m => M.Map Identifier Val -> P m (Seq Content)\ngetInlineBody fields =\n  parbreaksToLinebreaks <$> getField \"body\" fields\n\nparbreaksToLinebreaks :: Seq Content -> Seq Content\nparbreaksToLinebreaks =\n  fmap go . Seq.dropWhileL isParbreak . Seq.dropWhileR isParbreak\n where\n   go (Elt \"parbreak\" pos _) = Elt \"linebreak\" pos mempty\n   go x = x\n   isParbreak (Elt \"parbreak\" _ _) = True\n   isParbreak _ = False\n\npPara :: PandocMonad m => P m B.Blocks\npPara = do\n  ils <- B.trimInlines . collapseAdjacentCites . mconcat <$> many1 pInline\n  optional pParBreak\n  pure $ if ils == mempty\n         then mempty\n         else B.para ils\n\npParBreak :: PandocMonad m => P m ()\npParBreak =\n  void $\n    pTok\n      ( \\case\n          Elt \"parbreak\" _ _ -> True\n          _ -> False\n      )\n\npWithContents :: PandocMonad m => P m a -> Seq Content -> P m a\npWithContents pa cs = try $ do\n  inp <- getInput\n  setInput $ F.toList cs\n  res <- pa\n  eof\n  setInput inp\n  pure res\n\npInlines :: PandocMonad m => P m B.Inlines\npInlines =\n  mappend <$> (collapseAdjacentCites . mconcat <$> many pInline)\n          <*> ((B.softbreak <$ pParBreak) <|> pure mempty)\n\ncollapseAdjacentCites :: B.Inlines -> B.Inlines\ncollapseAdjacentCites = B.fromList . foldr go [] . B.toList\n where\n   go (Cite cs1 ils1) (Cite cs2 ils2 : xs) =\n     Cite (cs1 ++ cs2) (ils1 <> ils2) : xs\n   go (Cite cs1 ils1) (Space : Cite cs2 ils2 : xs) =\n     Cite (cs1 ++ cs2) (ils1 <> ils2) : xs\n   go x xs = x:xs\n\nmodString :: (Text -> Text) -> B.Inline -> B.Inline\nmodString f (B.Str t) = B.Str (f t)\nmodString _ x = x\n\nfindLabels :: Seq.Seq Content -> [Text]\nfindLabels = foldr go []\n where\n   go (Txt{}) = id\n   go (Lab t) = (t :)\n   go (Elt{ eltFields = fs }) = \\ts -> foldr go' ts fs\n   go' (VContent cs) = (findLabels cs ++)\n   go' _ = id\n\nparseTable :: PandocMonad m\n           => Maybe Text -> M.Map Identifier Val -> P m B.Blocks\nparseTable mbident fields = do\n  children <- V.toList <$> getField \"children\" fields\n  (columns :: Val) <- getField \"columns\" fields\n  let toWidth (VFraction f) = Just (floor $ 1000 * f)\n      toWidth _ = Nothing\n  let normalizeWidths xs =\n        let givenwidths = catMaybes xs\n            (totgivenwidth :: Int) = sum givenwidths\n            avgwidth = totgivenwidth `div` length givenwidths\n            totwidth = avgwidth * length xs\n         in if null givenwidths\n              then replicate (length xs) B.ColWidthDefault\n              else\n                map\n                  ( \\case\n                      Just x ->\n                        B.ColWidth (fromIntegral x / fromIntegral totwidth)\n                      Nothing ->\n                        B.ColWidth\n                        (fromIntegral avgwidth / fromIntegral totwidth)\n                  )\n                  xs\n  widths <- case columns of\n    VInteger x -> pure $ replicate (fromIntegral x) B.ColWidthDefault\n    VArray x -> pure $ normalizeWidths $ map toWidth (V.toList x)\n    VNone -> pure [B.ColWidthDefault]\n    _ -> fail $ \"Could not determine number of columns: \" <> show columns\n  let numcols = length widths\n  align <- getField \"align\" fields\n  let toAlign (VAlignment (Just horiz) _) =\n        case horiz of\n          HorizStart -> B.AlignLeft\n          HorizLeft -> B.AlignLeft\n          HorizEnd -> B.AlignRight\n          HorizRight -> B.AlignRight\n          HorizCenter -> B.AlignCenter\n      toAlign _ = B.AlignDefault\n  aligns <-\n    case align of\n      VAlignment {} -> pure $ replicate numcols (toAlign align)\n      VArray v -> pure $ map toAlign (V.toList v)\n      VFunction _ _ f -> do\n        mapM\n          ( \\colnum -> case applyPureFunction\n              f\n              [VInteger colnum, VInteger 0] of\n              Success x -> pure $ toAlign x\n              Failure e -> fail e\n          )\n          [0 .. (fromIntegral numcols - 1)]\n      _ -> pure $ replicate numcols B.AlignDefault\n  let colspecs = zip (aligns ++ repeat B.AlignDefault) widths\n  let addCell' cell Nothing = addCell' cell (Just ([], []))\n      addCell' cell@(B.Cell _ _ (B.RowSpan rowspan) (B.ColSpan colspan) _)\n       (Just (freecols, revrows))  =\n        let freecols' =\n              case (rowspan + 1) - length freecols of\n                n | n < 0 -> freecols\n                  | otherwise -> freecols ++ replicate n numcols\n        in case freecols' of\n             [] -> -- should not happen\n                   error \"empty freecols'\"\n             x:xs\n               | colspan <= x -- there is room on current row\n                 -> let (as, bs) = splitAt rowspan (x:xs)\n                    in  Just\n                        (map (\\z -> z - colspan) as ++ bs,\n                           case revrows of\n                             [] -> [[cell]]\n                             r:rs -> (cell:r):rs)\n               | otherwise ->\n                    let (as, bs) = splitAt rowspan xs\n                    in  Just (map (\\z -> z - colspan) as ++ bs, [cell]:revrows)\n  let addCell tableSection cell (TableData tdata) =\n        TableData (M.alter (addCell' cell) tableSection tdata)\n  let toCell tableSection tableData contents = do\n        case contents of\n          [Elt (Identifier \"grid.cell\") _pos fs] -> do\n            bs <- B.toList <$> (getField \"body\" fs >>= pWithContents pBlocks)\n            rowspan <- getField \"rowspan\" fs <|> pure 1\n            colspan <- getField \"colspan\" fs <|> pure 1\n            align' <- (toAlign <$> getField \"align\" fs) <|> pure B.AlignDefault\n            pure $ addCell tableSection\n              (B.Cell B.nullAttr align' (B.RowSpan rowspan)\n                (B.ColSpan colspan) bs) tableData\n          [Elt (Identifier \"table.cell\") pos fs] ->\n            toCell tableSection tableData [Elt (Identifier \"grid.cell\") pos fs]\n          [Elt (Identifier \"table.vline\") _pos _fs] -> pure tableData\n          [Elt (Identifier \"table.hline\") _pos _fs] -> pure tableData\n          [Elt (Identifier \"grid.vline\") _pos _fs] -> pure tableData\n          [Elt (Identifier \"grid.hline\") _pos _fs] -> pure tableData\n          [Elt (Identifier \"table.header\") _pos fs] ->\n            getField \"children\" fs >>=\n              foldM (toCell THeader) tableData . V.toList\n          [Elt (Identifier \"table.footer\") _pos fs] ->\n            getField \"children\" fs >>=\n              foldM (toCell TFooter) tableData . V.toList\n          _ -> do\n            bs <- B.toList <$> pWithContents pBlocks contents\n            pure $ addCell tableSection\n              (B.Cell B.nullAttr B.AlignDefault (B.RowSpan 1) (B.ColSpan 1) bs)\n              tableData\n  tableData <- foldM (toCell TBody) (TableData mempty) children\n  let getRows tablePart = map (B.Row B.nullAttr . reverse)\n                          . maybe [] (reverse . snd)\n                          . M.lookup tablePart . unTableData\n  let headRows = getRows THeader tableData\n  let bodyRows = getRows TBody tableData\n  let footRows = getRows TFooter tableData\n  pure $\n    B.tableWith\n      (fromMaybe \"\" mbident, [], [])\n      (B.Caption mempty mempty)\n      colspecs\n      (B.TableHead B.nullAttr headRows)\n      [B.TableBody B.nullAttr 0 [] bodyRows]\n      (B.TableFoot B.nullAttr footRows)\n\ndata TableSection = THeader | TBody | TFooter\n  deriving (Show, Ord, Eq)\n\nnewtype TableData =\n  TableData { unTableData :: M.Map TableSection ([Int], [[Cell]]) }\n  deriving (Show)\n  -- for each table section, we have a pair\n  -- the first element indicates the number of column spaces left\n  -- in [currentLine, nextLine, lineAfter, etc.]\n  -- the second element is a list of rows, in reverse order,\n  -- each of which is a list of cells, in reverse order\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Vimwiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE CPP #-}\n{- |\n   Module      : Text.Pandoc.Readers.Vimwiki\n   Copyright   : Copyright (C) 2017-2020 Yuchen Pei\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Yuchen Pei <me@ypei.me>\n   Stability   : alpha\n   Portability : portable\n\nConversion of vimwiki text to 'Pandoc' document.\n-}\n{--\n[X]: implemented\n[O]: not implemented\n* block parsers:\n    * [X] header\n    * [X] hrule\n    * [X] comment\n    * [X] blockquote\n    * [X] preformatted -- using codeblock\n    * [X] displaymath\n    * [X] bulletlist / orderedlist\n        * [X] todo lists -- using span.\n    * [X] table\n        * [X] centered table -- using div\n        * [O] colspan and rowspan -- see issue #1024\n    * [X] paragraph\n    * [X] definition list\n* inline parsers:\n    * [X] bareURL\n    * [X] strong\n    * [X] emph\n    * [X] strikeout\n    * [X] code\n    * [X] link\n    * [X] image\n    * [X] inline math\n    * [X] tag\n    * [X] sub- and super-scripts\n* misc:\n    * [X] `TODO:` mark\n    * [X] metadata placeholders: %title and %date\n    * [O] control placeholders: %template and %nohtml -- ignored\n--}\n\nmodule Text.Pandoc.Readers.Vimwiki ( readVimwiki\n                                 ) where\nimport Control.Monad (guard)\nimport Control.Monad.Except (throwError)\nimport Data.Default\nimport Data.List (isInfixOf)\nimport Data.Maybe\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Safe (lastMay)\nimport Text.Pandoc.Builder (Blocks, Inlines, fromList, toList, trimInlines)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..))\nimport Text.Pandoc.Definition (Attr, Block (BulletList, OrderedList),\n                               Inline (Space), ListNumberDelim (..),\n                               ListNumberStyle (..), Pandoc (..),\n                               nullMeta)\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Parsing (ParserState, ParsecT, blanklines, emailAddress,\n                            many1Till, orderedListMarker, readWithM,\n                            registerHeader, spaceChar, stateMeta,\n                            stateOptions, uri, manyTillChar, manyChar, textStr,\n                            many1Char, countChar, many1TillChar,\n                            alphaNum, anyChar, char, newline, noneOf, oneOf,\n                            space, spaces, string, choice, eof, lookAhead,\n                            many1, many, manyTill, notFollowedBy,\n                            skipMany1, try, option,\n                            updateState, getState, (<|>))\nimport Text.Pandoc.Sources (ToSources(..), Sources)\nimport Text.Pandoc.Shared (splitTextBy, stringify, stripFirstAndLast, tshow)\nimport Text.Pandoc.URI (isURI)\n\nreadVimwiki :: (PandocMonad m, ToSources a)\n            => ReaderOptions\n            -> a\n            -> m Pandoc\nreadVimwiki opts s = do\n  let sources = toSources s\n  res <- readWithM parseVimwiki def{ stateOptions = opts } sources\n  case res of\n       Left e       -> throwError e\n       Right result -> return result\n\ntype VwParser = ParsecT Sources ParserState\n\n\n-- constants\n\nspecialChars :: [Char]\nspecialChars = \"=*-#[]_~{}`$|:%^,\"\n\nspaceChars :: [Char]\nspaceChars = \" \\t\\n\"\n\n-- main parser\n\nparseVimwiki :: PandocMonad m => VwParser m Pandoc\nparseVimwiki = do\n  bs <- mconcat <$> many block\n  spaces\n  eof\n  st <- getState\n  let meta = stateMeta st\n  return $ Pandoc meta (toList bs)\n\n-- block parser\n\nblock :: PandocMonad m => VwParser m Blocks\nblock = do\n  res <- choice [ mempty <$ blanklines\n                , header\n                , hrule\n                , mempty <$ comment\n                , mixedList\n                , preformatted\n                , displayMath\n                , table\n                , mempty <$ placeholder\n                , blockQuote\n                , definitionList\n                , para\n                ]\n  trace (T.take 60 $ tshow $ toList res)\n  return res\n\nblockML :: PandocMonad m => VwParser m Blocks\nblockML = choice [preformatted, displayMath, table]\n\nheader :: PandocMonad m => VwParser m Blocks\nheader = try $ do\n  sp <- many spaceChar\n  eqs <- many1 (char '=')\n  spaceChar\n  let lev = length eqs\n  guard $ lev <= 6\n  contents <- trimInlines . mconcat <$> manyTill inline (try $ spaceChar\n    >> string eqs >> many spaceChar >> newline)\n  attr <- registerHeader (makeId contents,\n    [\"justcenter\" | not (null sp)], []) contents\n  return $ B.headerWith attr lev contents\n\npara :: PandocMonad m => VwParser m Blocks\npara = try $ do\n  contents <- trimInlines . mconcat <$> many1 inline\n  if all (==Space) (toList contents)\n     then return mempty\n     else return $ B.para contents\n\nhrule :: PandocMonad m => VwParser m Blocks\nhrule = try $ B.horizontalRule <$ (string \"----\" >> many (char '-') >> newline)\n\ncomment :: PandocMonad m => VwParser m ()\ncomment = try $ do\n  many spaceChar >> string \"%%\" >> many (noneOf \"\\n\")\n  return ()\n\nblockQuote :: PandocMonad m => VwParser m Blocks\nblockQuote = try $ do\n  string \"    \"\n  contents <- trimInlines . mconcat <$> many1 inlineBQ\n  if all (==Space) (toList contents)\n     then return mempty\n     else return $ B.blockQuote $ B.plain contents\n\ndefinitionList :: PandocMonad m => VwParser m Blocks\ndefinitionList = try $\n  B.definitionList <$> many1 (dlItemWithDT <|> dlItemWithoutDT)\n\ndlItemWithDT :: PandocMonad m => VwParser m (Inlines, [Blocks])\ndlItemWithDT = do\n  dt <- definitionTerm\n  dds <- many definitionDef\n  return (dt, dds)\n\ndlItemWithoutDT :: PandocMonad m => VwParser m (Inlines, [Blocks])\ndlItemWithoutDT = do\n  dds <- many1 definitionDef\n  return (mempty, dds)\n\ndefinitionDef :: PandocMonad m => VwParser m Blocks\ndefinitionDef = try $\n  notFollowedBy definitionTerm >> many spaceChar\n    >> (definitionDef1 <|> definitionDef2)\n\ndefinitionDef1 :: PandocMonad m => VwParser m Blocks\ndefinitionDef1 = try $ mempty <$ defMarkerE\n\ndefinitionDef2 :: PandocMonad m => VwParser m Blocks\ndefinitionDef2 = try $ B.plain <$>\n  (defMarkerM >> (trimInlines . mconcat <$> many inline') <* newline)\n\n\ndefinitionTerm :: PandocMonad m => VwParser m Inlines\ndefinitionTerm = try $ do\n  x <- definitionTerm1 <|> definitionTerm2\n  guard (stringify x /= \"\")\n  return x\n\ndefinitionTerm1 :: PandocMonad m => VwParser m Inlines\ndefinitionTerm1 = try $\n  trimInlines . mconcat <$> manyTill inline' (try defMarkerE)\n\ndefinitionTerm2 :: PandocMonad m => VwParser m Inlines\ndefinitionTerm2 = try $ trimInlines . mconcat <$> manyTill inline'\n  (try $ lookAhead (defMarkerM >> notFollowedBy hasDefMarkerM))\n\ndefMarkerM :: PandocMonad m => VwParser m Char\ndefMarkerM = string \"::\" >> spaceChar\n\ndefMarkerE :: PandocMonad m => VwParser m Char\ndefMarkerE = string \"::\" >> newline\n\nhasDefMarkerM :: PandocMonad m => VwParser m Text\nhasDefMarkerM = manyTillChar (noneOf \"\\n\") (try defMarkerM)\n\npreformatted :: PandocMonad m => VwParser m Blocks\npreformatted = try $ do\n  many spaceChar >> string \"{{{\"\n  attrText <- manyChar (noneOf \"\\n\")\n  lookAhead newline\n  contents <- manyTillChar anyChar (try (char '\\n' >> many spaceChar >> string \"}}}\"\n    >> many spaceChar >> newline))\n  if (contents /= \"\") && (T.head contents == '\\n')\n     then return $ B.codeBlockWith (makeAttr attrText) (T.tail contents)\n     else return $ B.codeBlockWith (makeAttr attrText) contents\n\nmakeAttr :: Text -> Attr\nmakeAttr s =\n  let xs = splitTextBy (`elem` (\" \\t\" :: String)) s in\n    (\"\", syntax xs, mapMaybe nameValue xs)\n\nsyntax :: [Text] -> [Text]\nsyntax (s:_) | not $ T.isInfixOf \"=\" s = [s]\nsyntax _ = []\n\nnameValue :: Text -> Maybe (Text, Text)\nnameValue s =\n  case splitTextBy (== '=') s of\n    [a,b]\n      | T.length b >= 2\n      , \"\\\"\" `T.isPrefixOf` b\n      , \"\\\"\" `T.isSuffixOf` b\n      -> Just (a, stripFirstAndLast b)\n    _ -> Nothing\n\ndisplayMath :: PandocMonad m => VwParser m Blocks\ndisplayMath = try $ do\n  many spaceChar >> string \"{{$\"\n  mathTag <- option \"\" mathTagParser\n  many space\n  contents <- manyTillChar anyChar (try (char '\\n' >> many spaceChar >> string \"}}$\"\n    >> many spaceChar >> newline))\n  let contentsWithTags\n        | mathTag == \"\" = contents\n        | otherwise     = \"\\\\begin{\" <> mathTag <> \"}\\n\" <> contents\n                          <> \"\\n\\\\end{\" <> mathTag <> \"}\"\n  return $ B.para $ B.displayMath contentsWithTags\n\n\nmathTagLaTeX :: Text -> Text\nmathTagLaTeX s = case s of\n   \"equation\"  -> \"\"\n   \"equation*\" -> \"\"\n   \"gather\"    -> \"gathered\"\n   \"gather*\"   -> \"gathered\"\n   \"multline\"  -> \"gathered\"\n   \"multline*\" -> \"gathered\"\n   \"eqnarray\"  -> \"aligned\"\n   \"eqnarray*\" -> \"aligned\"\n   \"align\"     -> \"aligned\"\n   \"align*\"    -> \"aligned\"\n   \"alignat\"   -> \"aligned\"\n   \"alignat*\"  -> \"aligned\"\n   _           -> s\n\n\nmixedList :: PandocMonad m => VwParser m Blocks\nmixedList = try $ do\n  ((bl:_), _) <- mixedList' (-1)\n  return bl\n\nmixedList' :: PandocMonad m => Int -> VwParser m ([Blocks], Int)\nmixedList' prevInd = do\n  (curInd, builder) <- option (-1, \"na\") (lookAhead listStart)\n  if curInd < prevInd\n     then return ([], curInd)\n     else do\n          listStart\n          curLine <- listItemContent\n          let listBuilder =\n                if builder == \"ul\" then B.bulletList else B.orderedList\n          (subList, lowInd) <- mixedList' curInd\n          if lowInd >= curInd\n             then do\n                  (sameIndList, endInd) <- mixedList' lowInd\n                  let curList = combineList curLine subList ++ sameIndList\n                  if curInd > prevInd\n                     then return ([listBuilder curList], endInd)\n                     else return (curList, endInd)\n             else do\n                  let (curList, endInd) = (combineList curLine subList,\n                                           lowInd)\n                  if curInd > prevInd\n                     then return ([listBuilder curList], endInd)\n                     else return (curList, endInd)\n\nplainInlineML' :: PandocMonad m => Inlines -> VwParser m Blocks\nplainInlineML' w = do\n  xs <- many inlineML\n  newline\n  return $ B.plain $ trimInlines $ mconcat $ w:xs\n\nplainInlineML :: PandocMonad m => VwParser m Blocks\nplainInlineML = notFollowedBy listStart >> spaceChar >> plainInlineML' mempty\n\n\nlistItemContent :: PandocMonad m => VwParser m Blocks\nlistItemContent = try $ do\n  w <- option mempty listTodoMarker\n  x <- plainInlineML' w\n  y <- many blocksThenInline\n  z <- many blockML\n  return $ mconcat $ x:y ++ z\n\nblocksThenInline :: PandocMonad m => VwParser m Blocks\nblocksThenInline = try $ do\n  y <- many1 blockML\n  x <- plainInlineML\n  return $ mconcat $ y ++ [x]\n\nlistTodoMarker :: PandocMonad m => VwParser m Inlines\nlistTodoMarker = try $ do\n  x <- (many spaceChar >> char '[')\n       *> oneOf \" .oOX\"\n       <* (char ']' >> spaceChar)\n  return $ makeListMarkerSpan x\n\nmakeListMarkerSpan :: Char -> Inlines\nmakeListMarkerSpan x =\n  let cl = case x of\n            ' ' -> \"done0\"\n            '.' -> \"done1\"\n            'o' -> \"done2\"\n            'O' -> \"done3\"\n            'X' -> \"done4\"\n            _   -> \"\"\n    in\n      B.spanWith (\"\", [cl], []) mempty\n\ncombineList :: Blocks -> [Blocks] -> [Blocks]\ncombineList x [y] = case toList y of\n                            [BulletList z] -> [fromList $ toList x\n                                              ++ [BulletList z]]\n                            [OrderedList attr z] -> [fromList $ toList x\n                                                    ++ [OrderedList attr z]]\n                            _ -> x:[y]\ncombineList x xs = x:xs\n\nlistStart :: PandocMonad m => VwParser m (Int, Text)\nlistStart = try $ do\n  s <- many spaceChar\n  listType <- bulletListMarkers <|> orderedListMarkers\n  spaceChar\n  return (length s, listType)\n\nbulletListMarkers :: PandocMonad m => VwParser m Text\nbulletListMarkers = \"ul\" <$ (char '*' <|> char '-')\n\norderedListMarkers :: PandocMonad m => VwParser m Text\norderedListMarkers =\n  (\"ol\" <$ choice (orderedListMarker Decimal Period:(($ OneParen) . orderedListMarker <$> [Decimal, LowerRoman, UpperRoman, LowerAlpha, UpperAlpha])))\n    <|> (\"ol\" <$ char '#')\n\n--many need trimInlines\ntable :: PandocMonad m => VwParser m Blocks\ntable = try $ do\n  indent <- lookAhead (many spaceChar)\n  (th, trs) <- table1 <|> table2\n  let tab = B.simpleTable th trs\n  if indent == \"\"\n    then return tab\n    else return $ B.divWith (\"\", [\"center\"], []) tab\n\n-- table with header\ntable1 :: PandocMonad m => VwParser m ([Blocks], [[Blocks]])\ntable1 = try $ do\n  th <- tableRow\n  many1 tableHeaderSeparator\n  trs <- many tableRow\n  return (th, trs)\n\n-- headerless table\ntable2 :: PandocMonad m => VwParser m ([Blocks], [[Blocks]])\ntable2 = try $ do\n  trs@(firstrow:_) <- many1 tableRow\n  return (replicate (length firstrow) mempty, trs)\n\ntableHeaderSeparator :: PandocMonad m => VwParser m ()\ntableHeaderSeparator = try $ do\n  many spaceChar >> char '|' >> many1 (many1 (char '-') >> char '|')\n    >> many spaceChar >> newline\n  return ()\n\ntableRow :: PandocMonad m => VwParser m [Blocks]\ntableRow = try $ do\n  many spaceChar >> char '|'\n  s <- lookAhead $ manyTill anyChar (try (char '|' >> many spaceChar\n    >> newline))\n  guard $ not $ \"||\" `isInfixOf` (\"|\" ++ s ++ \"|\")\n  many tableCell <* many spaceChar <* char '\\n'\n\ntableCell :: PandocMonad m => VwParser m Blocks\ntableCell = try $\n  B.plain . trimInlines . mconcat <$> manyTill inline' (char '|')\n\nplaceholder :: PandocMonad m => VwParser m ()\nplaceholder = try $\n  choice (ph <$> [\"title\", \"date\"]) <|> noHtmlPh <|> templatePh\n\nph :: PandocMonad m => Text -> VwParser m ()\nph s = try $ do\n  many spaceChar >> textStr (T.cons '%' s) >> spaceChar\n  contents <- trimInlines . mconcat <$> manyTill inline (lookAhead newline)\n    --use lookAhead because of placeholder in the whitespace parser\n  let meta' = B.setMeta s contents nullMeta\n  -- this order ensures that later values will be ignored in favor\n  -- of earlier ones:\n  updateState $ \\st -> st { stateMeta = meta' <> stateMeta st }\n\nnoHtmlPh :: PandocMonad m => VwParser m ()\nnoHtmlPh = try $\n  () <$ many spaceChar <* string \"%nohtml\" <* many spaceChar\n    <* lookAhead newline\n\ntemplatePh :: PandocMonad m => VwParser m ()\ntemplatePh = try $\n  () <$ many spaceChar <* string \"%template\" <* many (noneOf \"\\n\")\n    <* lookAhead newline\n\n-- inline parser\n\ninline :: PandocMonad m => VwParser m Inlines\ninline = choice $ whitespace endlineP:inlineList\n\ninlineList :: PandocMonad m => [VwParser m Inlines]\ninlineList = [  bareURL\n             ,  todoMark\n             ,  str\n             ,  strong\n             ,  emph\n             ,  strikeout\n             ,  code\n             ,  link\n             ,  image\n             ,  inlineMath\n             ,  tag\n             ,  superscript\n             ,  subscript\n             ,  special\n             ]\n\n-- inline parser without softbreaks or comment breaks\ninline' :: PandocMonad m => VwParser m Inlines\ninline' = choice $ whitespace':inlineList\n\n-- inline parser for blockquotes\ninlineBQ :: PandocMonad m => VwParser m Inlines\ninlineBQ = choice $ whitespace endlineBQ:inlineList\n\n-- inline parser for mixedlists\ninlineML :: PandocMonad m => VwParser m Inlines\ninlineML = choice $ whitespace endlineML:inlineList\n\nstr :: PandocMonad m => VwParser m Inlines\nstr = B.str <$> many1Char (noneOf $ spaceChars ++ specialChars)\n\nwhitespace :: PandocMonad m => VwParser m () -> VwParser m Inlines\nwhitespace endline = B.space <$ (skipMany1 spaceChar <|>\n                                 try (newline >> (comment <|> placeholder)))\n         <|> B.softbreak <$ endline\n\nwhitespace' :: PandocMonad m => VwParser m Inlines\nwhitespace' = B.space <$ skipMany1 spaceChar\n\nspecial :: PandocMonad m => VwParser m Inlines\nspecial = B.str <$> countChar 1 (oneOf specialChars)\n\nbareURL :: PandocMonad m => VwParser m Inlines\nbareURL = try $ do\n  (orig, src) <- uri <|> emailAddress\n  return $ B.link src \"\" (B.str orig)\n\nstrong :: PandocMonad m => VwParser m Inlines\nstrong = try $ do\n  char '*'\n  notFollowedBy (oneOf spaceChars)\n  contents <- mconcat <$> many1Till inline'\n                           (try (char '*' *> notFollowedBy alphaNum))\n  guard $ lastMay (toList contents) /= Just Space\n  return $ B.spanWith (makeId contents, [], []) mempty <> B.strong contents\n\nmakeId :: Inlines -> Text\nmakeId i = T.concat (stringify <$> toList i)\n\nemph :: PandocMonad m => VwParser m Inlines\nemph = try $ do\n  char '_'\n  notFollowedBy (oneOf spaceChars)\n  contents <- mconcat <$> many1Till inline'\n                           (try (char '_' *> notFollowedBy alphaNum))\n  guard $ lastMay (toList contents) /= Just Space\n  return $ B.emph contents\n\nstrikeout :: PandocMonad m => VwParser m Inlines\nstrikeout = try $ do\n  string \"~~\"\n  contents <- mconcat <$>many1Till inline' (string \"~~\")\n  return $ B.strikeout contents\n\ncode :: PandocMonad m => VwParser m Inlines\ncode = try $ do\n  char '`'\n  contents <- many1TillChar (noneOf \"\\n\") (char '`')\n  return $ B.code contents\n\nsuperscript :: PandocMonad m => VwParser m Inlines\nsuperscript = try $\n  B.superscript . mconcat <$> (char '^' >> many1Till inline' (char '^'))\n\nsubscript :: PandocMonad m => VwParser m Inlines\nsubscript = try $\n  B.subscript . mconcat <$> (string \",,\"\n    >> many1Till inline' (try $ string \",,\"))\n\nlink :: PandocMonad m => VwParser m Inlines\nlink = try $ do\n  string \"[[\"\n  contents <- lookAhead $ manyTillChar anyChar (string \"]]\")\n  if T.any (== '|') contents\n                  then do\n                    url <- manyTillChar anyChar $ char '|'\n                    lab <- mconcat <$> manyTill inline (string \"]]\")\n                    return $ B.linkWith (attr url) (procLink url) \"\" lab\n                  else do\n                    manyTill anyChar (string \"]]\")\n-- not using try here because [[hell]o]] is not rendered as a link in vimwiki\n                    return $ B.linkWith (attr contents) (procLink contents) \"\" (B.str contents)\n  where\n    attr t | isURI t = B.nullAttr\n           | otherwise = (mempty, [\"wikilink\"], mempty)\n\nimage :: PandocMonad m => VwParser m Inlines\nimage = try $ do\n  string \"{{\"\n  contentText <- lookAhead $ manyTill (noneOf \"\\n\") (try $ string \"}}\")\n  images $ length $ filter (== '|') contentText\n\nimages :: PandocMonad m => Int -> VwParser m Inlines\nimages k\n  | k == 0 = do\n           imgurl <- manyTillChar anyChar (try $ string \"}}\")\n           return $ B.image (procImgurl imgurl) \"\" (B.str \"\")\n  | k == 1 = do\n           imgurl <- manyTillChar anyChar (char '|')\n           alt <- mconcat <$> manyTill inline (try $ string \"}}\")\n           return $ B.image (procImgurl imgurl) \"\" alt\n  | k == 2 = do\n           imgurl <- manyTillChar anyChar (char '|')\n           alt <- mconcat <$> manyTill inline (char '|')\n           attrText <- manyTillChar anyChar (try $ string \"}}\")\n           return $ B.imageWith (makeAttr attrText) (procImgurl imgurl) \"\" alt\n  | otherwise = do\n           imgurl <- manyTillChar anyChar (char '|')\n           alt <- mconcat <$> manyTill inline (char '|')\n           attrText <- manyTillChar anyChar (char '|')\n           manyTill anyChar (try $ string \"}}\")\n           return $ B.imageWith (makeAttr attrText) (procImgurl imgurl) \"\" alt\n\nprocLink' :: Text -> Text\nprocLink' s\n  | T.take 6 s == \"local:\" = \"file\" <> T.drop 5 s\n  | T.take 6 s == \"diary:\" = \"diary/\" <> T.drop 6 s\n  | any (`T.isPrefixOf` s) [ \"http:\", \"https:\", \"ftp:\", \"file:\", \"mailto:\",\n                             \"news:\", \"telnet:\" ]\n                             = s\n  | s == \"\"                  = \"\"\n  | T.last s == '/'          = s\n  | otherwise                = s\n\nprocLink :: Text -> Text\nprocLink s = procLink' x <> y\n  where (x, y) = T.break (=='#') s\n\nprocImgurl :: Text -> Text\nprocImgurl s = if T.take 6 s == \"local:\" then \"file\" <> T.drop 5 s else s\n\ninlineMath :: PandocMonad m => VwParser m Inlines\ninlineMath = try $\n  B.math <$ char '$' <*> many1TillChar (noneOf \"\\n\") (char '$')\n\ntag :: PandocMonad m => VwParser m Inlines\ntag = try $ do\n  char ':'\n  s <- manyTillChar (noneOf spaceChars) (try (char ':' >> lookAhead space))\n  guard $ not $ \"::\" `T.isInfixOf` (\":\" <> s <> \":\")\n  case splitTextBy (==':') s of\n    [] -> fail \"tag doesn't contain :\"\n    (x:xs) -> return $ mconcat $ makeTagSpan' x : (makeTagSpan <$> xs)\n\ntodoMark :: PandocMonad m => VwParser m Inlines\ntodoMark = try $ do\n  string \"TODO:\"\n  return $ B.spanWith (\"\", [\"todo\"], []) (B.str \"TODO:\")\n\n-- helper functions and parsers\nendlineP :: PandocMonad m => VwParser m ()\nendlineP = () <$ try (newline <* nFBTTBSB <* notFollowedBy blockQuote)\n\nendlineBQ :: PandocMonad m => VwParser m ()\nendlineBQ = () <$ try (newline <* nFBTTBSB <* string \"    \")\n\nendlineML :: PandocMonad m => VwParser m ()\nendlineML = () <$ try (newline <* nFBTTBSB <* many1 spaceChar)\n\n--- nFBTTBSB is short for notFollowedByThingsThatBreakSoftBreaks\nnFBTTBSB :: PandocMonad m => VwParser m ()\nnFBTTBSB =\n    notFollowedBy newline <*\n    notFollowedBy hrule <*\n    notFollowedBy tableRow <*\n    notFollowedBy header <*\n    notFollowedBy listStart <*\n    notFollowedBy preformatted <*\n    notFollowedBy displayMath <*\n    notFollowedBy hasDefMarker\n\nhasDefMarker :: PandocMonad m => VwParser m ()\nhasDefMarker = () <$ manyTill (noneOf \"\\n\") (string \"::\" >> oneOf spaceChars)\n\nmakeTagSpan' :: Text -> Inlines\nmakeTagSpan' s = B.spanWith (T.cons '-' s, [], []) (B.str \"\") <>\n                  B.spanWith (s, [\"tag\"], []) (B.str s)\n\nmakeTagSpan :: Text -> Inlines\nmakeTagSpan s = B.space <> makeTagSpan' s\n\nmathTagParser :: PandocMonad m => VwParser m Text\nmathTagParser = do\n  s <- try $ lookAhead (char '%' >> manyTillChar (noneOf spaceChars)\n    (try $ char '%' >> many (noneOf $ '%':spaceChars) >> space))\n  char '%' >> textStr s >> char '%'\n  return $ mathTagLaTeX s\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/XML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\n-- |\n--   Module      : Text.Pandoc.Readers.XML\n--   Copyright   : Copyright (C) 2025- Massimiliano Farinella and John MacFarlane\n--   License     : GNU GPL, version 2 or above\n--\n--   Maintainer  : Massimiliano Farinella <massifrg@gmail.com>\n--   Stability   : WIP\n--   Portability : portable\n--\n-- Conversion of (Pandoc specific) xml to 'Pandoc' document.\nmodule Text.Pandoc.Readers.XML (readXML) where\n\nimport Control.Monad (msum)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.State.Strict (StateT (runStateT), modify)\nimport Data.Char (isSpace)\nimport Data.Default (Default (..))\nimport qualified Data.List as L\nimport qualified Data.Map as M\nimport Data.Maybe (catMaybes, fromMaybe, mapMaybe)\nimport qualified Data.Set as S (Set, fromList, member)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.Text.Lazy (fromStrict)\nimport Data.Version (Version, makeVersion)\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Error (PandocError (..))\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing (ToSources, toSources)\nimport Text.Pandoc.Sources (sourcesToText)\nimport Text.Pandoc.Version (pandocVersion)\nimport Text.Pandoc.XML (lookupEntity)\nimport Text.Pandoc.XML.Light\nimport Text.Pandoc.XMLFormat\nimport Text.Read (readMaybe)\n\n-- TODO: use xmlPath state to give better context when an error occurs\n\ntype XMLReader m = StateT XMLReaderState m\n\ndata XMLReaderState = XMLReaderState\n  { xmlApiVersion :: Version,\n    xmlMeta :: Meta,\n    xmlContent :: [Content],\n    xmlPath :: [Text]\n  }\n  deriving (Show)\n\ninstance Default XMLReaderState where\n  def =\n    XMLReaderState\n      { xmlApiVersion = pandocVersion,\n        xmlMeta = mempty,\n        xmlContent = [],\n        xmlPath = [\"root\"]\n      }\n\nreadXML :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc\nreadXML _ inp = do\n  let sources = toSources inp\n  tree <-\n    either (throwError . PandocXMLError \"\") return $\n      parseXMLContents (fromStrict . sourcesToText $ sources)\n  (bs, st') <- flip runStateT (def {xmlContent = tree}) $ mapM parseBlock tree\n  let blockList = toList $ concatMany bs\n  return $ Pandoc (xmlMeta st') blockList\n\nconcatMany :: [Many a] -> Many a\nconcatMany = Many . mconcat . map unMany\n\nparseBlocks :: (PandocMonad m) => [Content] -> XMLReader m Blocks\nparseBlocks contents = concatMany <$> mapM parseBlock contents\n\ngetBlocks :: (PandocMonad m) => Element -> XMLReader m Blocks\ngetBlocks e = parseBlocks (elContent e)\n\nelementName :: Element -> Text\nelementName e = qName $ elName e\n\nattrValue :: Text -> Element -> Text\nattrValue attr =\n  fromMaybe \"\" . maybeAttrValue attr\n\nmaybeAttrValue :: Text -> Element -> Maybe Text\nmaybeAttrValue attr elt =\n  lookupAttrBy (\\x -> qName x == attr) (elAttribs elt)\n\nparseBlock :: (PandocMonad m) => Content -> XMLReader m Blocks\nparseBlock (Text (CData CDataRaw _ _)) = return mempty -- DOCTYPE\nparseBlock (Text (CData _ s _)) =\n  if T.all isSpace s\n    then return mempty\n    else do\n      throwError $ PandocXMLError \"\" \"non-space characters out of inline context\"\nparseBlock (CRef x) = do\n  throwError $ PandocXMLError \"\" (\"reference \\\"\" <> x <> \"\\\" out of inline context\")\nparseBlock (Elem e) = do\n  let name = elementName e\n   in case (name) of\n        \"Pandoc\" -> parsePandoc\n        \"?xml\" -> return mempty\n        \"blocks\" -> getBlocks e\n        \"meta\" ->\n          let entry_els = childrenNamed tgNameMetaMapEntry e\n           in do\n                entries <- catMaybes <$> mapM parseMetaMapEntry entry_els\n                mapM_ (uncurry addMeta) entries\n                return mempty\n        \"Para\" -> para <$> getInlines (elContent e)\n        \"Plain\" -> do\n          ils <- getInlines (elContent e)\n          return $ singleton . Plain . toList $ ils\n        \"Header\" -> (headerWith attr level) <$> getInlines (elContent e)\n          where\n            level = textToInt (attrValue atNameLevel e) 1\n            attr = filterAttrAttributes [atNameLevel] $ attrFromElement e\n        \"HorizontalRule\" -> return horizontalRule\n        \"BlockQuote\" -> do\n          contents <- getBlocks e\n          return $ blockQuote contents\n        \"Div\" -> do\n          contents <- getBlocks e\n          return $ divWith (attrFromElement e) contents\n        \"BulletList\" -> do\n          items <- getListItems e\n          return $ bulletList items\n        \"OrderedList\" -> do\n          items <- getListItems e\n          return $ orderedListWith (getListAttributes e) items\n        \"DefinitionList\" -> do\n          let items_contents = getContentsOfElements (isElementNamed tgNameDefListItem) (elContent e)\n          items <- mapM parseDefinitionListItem items_contents\n          return $ definitionList items\n        \"Figure\" -> do\n          let attr = attrFromElement e\n              (maybe_caption_el, contents) = partitionFirstChildNamed \"Caption\" $ elContent e\n          figure_caption <- case (maybe_caption_el) of\n            Just (caption_el) -> parseCaption $ elContent caption_el\n            Nothing -> pure emptyCaption\n          blocks <- parseBlocks contents\n          return $ figureWith attr figure_caption blocks\n        \"CodeBlock\" -> do\n          let attr = attrFromElement e\n          return $ codeBlockWith attr $ strContentRecursive e\n        \"RawBlock\" -> do\n          let format = (attrValue atNameFormat e)\n          return $ rawBlock format $ strContentRecursive e\n        \"LineBlock\" -> do\n          lins <- mapM getInlines (contentsOfChildren tgNameLineItem (elContent e))\n          return $ lineBlock lins\n        \"Table\" -> do\n          -- TODO: check unexpected items\n          let attr = attrFromElement e\n              (maybe_caption_el, after_caption) = partitionFirstChildNamed \"Caption\" $ elContent e\n              children = elementsWithNames (S.fromList [tgNameColspecs, \"TableHead\", \"TableBody\", \"TableFoot\"]) after_caption\n              is_element tag el = tag == elementName el\n          colspecs <- getColspecs $ L.find (is_element tgNameColspecs) children\n          tbs <- getTableBodies $ filter (is_element \"TableBody\") children\n          th <- getTableHead $ L.find (is_element \"TableHead\") children\n          tf <- getTableFoot $ L.find (is_element \"TableFoot\") children\n          capt <- parseMaybeCaptionElement maybe_caption_el\n          case colspecs of\n            Nothing -> return mempty\n            Just cs -> return $ fromList [Table attr capt cs th tbs tf]\n        _ -> do\n          throwError $ PandocXMLError \"\" (\"unexpected element \\\"\" <> name <> \"\\\" in blocks context\")\n  where\n    parsePandoc = do\n      let version = maybeAttrValue atNameApiVersion e\n          apiversion = case (version) of\n            Just (v) -> makeVersion $ map (read . T.unpack) $ T.splitOn \",\" v\n            Nothing -> pandocVersion\n       in modify $ \\st -> st {xmlApiVersion = apiversion}\n      getBlocks e\n\ngetListItems :: (PandocMonad m) => Element -> XMLReader m [Blocks]\ngetListItems e =\n  let items_els = childrenNamed tgNameListItem e\n   in do\n        mapM getBlocks items_els\n\ngetContentsOfElements :: (Content -> Bool) -> [Content] -> [[Content]]\ngetContentsOfElements filter_element contents = mapMaybe element_contents $ filter filter_element contents\n  where\n    element_contents :: Content -> Maybe [Content]\n    element_contents c = case (c) of\n      Elem e -> Just (elContent e)\n      _ -> Nothing\n\nstrContentRecursive :: Element -> Text\nstrContentRecursive =\n  strContent\n    . (\\e' -> e' {elContent = map elementToStr $ elContent e'})\n\nelementToStr :: Content -> Content\nelementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing\nelementToStr x = x\n\ntextToInt :: Text -> Int -> Int\ntextToInt t deflt =\n  let safe_to_int :: Text -> Maybe Int\n      safe_to_int s = readMaybe $ T.unpack s\n   in case (safe_to_int t) of\n        Nothing -> deflt\n        Just (n) -> n\n\nparseInline :: (PandocMonad m) => Content -> XMLReader m Inlines\nparseInline (Text (CData _ s _)) =\n  return $ text s\nparseInline (CRef ref) =\n  return $\n    maybe (text $ T.toUpper ref) text $\n      lookupEntity ref\nparseInline (Elem e) =\n  let name = elementName e\n   in case (name) of\n        \"Space\" ->\n          let count = textToInt (attrValue atNameSpaceCount e) 1\n           in return $ fromList $ replicate count Space\n        \"Str\" -> return $ fromList [Str $ attrValue atNameStrContent e]\n        \"Emph\" -> innerInlines emph\n        \"Strong\" -> innerInlines strong\n        \"Strikeout\" -> innerInlines strikeout\n        \"Subscript\" -> innerInlines subscript\n        \"Superscript\" -> innerInlines superscript\n        \"Underline\" -> innerInlines underline\n        \"SoftBreak\" -> return softbreak\n        \"LineBreak\" -> return linebreak\n        \"SmallCaps\" -> innerInlines smallcaps\n        \"Quoted\" -> case (attrValue atNameQuoteType e) of\n          \"SingleQuote\" -> innerInlines singleQuoted\n          _ -> innerInlines doubleQuoted\n        \"Math\" -> case (attrValue atNameMathType e) of\n          \"DisplayMath\" -> pure $ displayMath $ strContentRecursive e\n          _ -> pure $ math $ strContentRecursive e\n        \"Span\" -> innerInlines $ spanWith (attrFromElement e)\n        \"Code\" -> do\n          let attr = attrFromElement e\n          return $ codeWith attr $ strContentRecursive e\n        \"Link\" -> innerInlines $ linkWith attr url title\n          where\n            url = attrValue atNameLinkUrl e\n            title = attrValue atNameTitle e\n            attr = filterAttrAttributes [atNameLinkUrl, atNameTitle] $ attrFromElement e\n        \"Image\" -> innerInlines $ imageWith attr url title\n          where\n            url = attrValue atNameImageUrl e\n            title = attrValue atNameTitle e\n            attr = filterAttrAttributes [atNameImageUrl, atNameTitle] $ attrFromElement e\n        \"RawInline\" -> do\n          let format = (attrValue atNameFormat e)\n          return $ rawInline format $ strContentRecursive e\n        \"Note\" -> do\n          contents <- getBlocks e\n          return $ note contents\n        \"Cite\" ->\n          let (maybe_citations_el, contents) = partitionFirstChildNamed tgNameCitations $ elContent e\n           in case (maybe_citations_el) of\n                Just citations_el -> do\n                  citations <- parseCitations $ elContent citations_el\n                  (innerInlines' contents) $ cite citations\n                Nothing -> getInlines contents\n        _ -> do\n          throwError $ PandocXMLError \"\" (\"unexpected element \\\"\" <> name <> \"\\\" in inline context\")\n  where\n    innerInlines' contents f =\n      f . concatMany\n        <$> mapM parseInline contents\n    innerInlines f = innerInlines' (elContent e) f\n\ngetInlines :: (PandocMonad m) => [Content] -> XMLReader m Inlines\ngetInlines contents = concatMany <$> mapM parseInline contents\n\ngetListAttributes :: Element -> ListAttributes\ngetListAttributes e = (start, style, delim)\n  where\n    start = textToInt (attrValue atNameStart e) 1\n    style = case (attrValue atNameNumberStyle e) of\n      \"Example\" -> Example\n      \"Decimal\" -> Decimal\n      \"LowerRoman\" -> LowerRoman\n      \"UpperRoman\" -> UpperRoman\n      \"LowerAlpha\" -> LowerAlpha\n      \"UpperAlpha\" -> UpperAlpha\n      _ -> DefaultStyle\n    delim = case (attrValue atNameNumberDelim e) of\n      \"Period\" -> Period\n      \"OneParen\" -> OneParen\n      \"TwoParens\" -> TwoParens\n      _ -> DefaultDelim\n\ncontentsOfChildren :: Text -> [Content] -> [[Content]]\ncontentsOfChildren tag contents = mapMaybe childrenElementWithTag contents\n  where\n    childrenElementWithTag :: Content -> Maybe [Content]\n    childrenElementWithTag c = case (c) of\n      (Elem e) -> if tag == elementName e then Just (elContent e) else Nothing\n      _ -> Nothing\n\nalignmentFromText :: Text -> Alignment\nalignmentFromText t = case t of\n  \"AlignLeft\" -> AlignLeft\n  \"AlignRight\" -> AlignRight\n  \"AlignCenter\" -> AlignCenter\n  _ -> AlignDefault\n\ngetColWidth :: Text -> ColWidth\ngetColWidth txt = case reads (T.unpack txt) of\n  [(value, \"\")] -> if value == 0.0 then ColWidthDefault else ColWidth value\n  _ -> ColWidthDefault\n\ngetColspecs :: (PandocMonad m) => Maybe Element -> XMLReader m (Maybe [ColSpec])\ngetColspecs Nothing = pure Nothing\ngetColspecs (Just cs) = do\n  return $ Just $ map elementToColSpec (childrenNamed \"ColSpec\" cs)\n  where\n    elementToColSpec e = (alignmentFromText $ attrValue atNameAlignment e, getColWidth $ attrValue atNameColWidth e)\n\ngetTableBody :: (PandocMonad m) => Element -> XMLReader m (Maybe TableBody)\ngetTableBody body_el = do\n  let attr = filterAttrAttributes [atNameRowHeadColumns] $ attrFromElement body_el\n      bh = childrenNamed tgNameBodyHeader body_el\n      bb = childrenNamed tgNameBodyBody body_el\n      headcols = textToInt (attrValue atNameRowHeadColumns body_el) 0\n  hrows <- mconcat <$> mapM getRows bh\n  brows <- mconcat <$> mapM getRows bb\n  return $ Just $ TableBody attr (RowHeadColumns headcols) hrows brows\n\ngetTableBodies :: (PandocMonad m) => [Element] -> XMLReader m [TableBody]\ngetTableBodies body_elements = do\n  catMaybes <$> mapM getTableBody body_elements\n\ngetTableHead :: (PandocMonad m) => Maybe Element -> XMLReader m TableHead\ngetTableHead maybe_e = case maybe_e of\n  Just e -> do\n    let attr = attrFromElement e\n    rows <- getRows e\n    return $ TableHead attr rows\n  Nothing -> return $ TableHead nullAttr []\n\ngetTableFoot :: (PandocMonad m) => Maybe Element -> XMLReader m TableFoot\ngetTableFoot maybe_e = case maybe_e of\n  Just e -> do\n    let attr = attrFromElement e\n    rows <- getRows e\n    return $ TableFoot attr rows\n  Nothing -> return $ TableFoot nullAttr []\n\ngetCell :: (PandocMonad m) => Element -> XMLReader m Cell\ngetCell c = do\n  let alignment = alignmentFromText $ attrValue atNameAlignment c\n      rowspan = RowSpan $ textToInt (attrValue atNameRowspan c) 1\n      colspan = ColSpan $ textToInt (attrValue atNameColspan c) 1\n      attr = filterAttrAttributes [atNameAlignment, atNameRowspan, atNameColspan] $ attrFromElement c\n  blocks <- getBlocks c\n  return $ Cell attr alignment rowspan colspan (toList blocks)\n\ngetRows :: (PandocMonad m) => Element -> XMLReader m [Row]\ngetRows e = mapM getRow $ childrenNamed \"Row\" e\n  where\n    getRow r = do\n      cells <- mapM getCell (childrenNamed \"Cell\" r)\n      return $ Row (attrFromElement r) cells\n\nparseCitations :: (PandocMonad m) => [Content] -> XMLReader m [Citation]\nparseCitations contents = do\n  maybecitations <- mapM getCitation contents\n  return $ catMaybes maybecitations\n  where\n    getCitation :: (PandocMonad m) => Content -> XMLReader m (Maybe Citation)\n    getCitation content = case (content) of\n      (Elem e) ->\n        if qName (elName e) == \"Citation\"\n          then do\n            p <- inlinesOfChildrenNamed tgNameCitationPrefix e\n            s <- inlinesOfChildrenNamed tgNameCitationSuffix e\n            return $\n              Just\n                ( Citation\n                    { citationId = attrValue \"id\" e,\n                      citationPrefix = toList p,\n                      citationSuffix = toList s,\n                      citationMode = case (attrValue atNameCitationMode e) of\n                        \"AuthorInText\" -> AuthorInText\n                        \"SuppressAuthor\" -> SuppressAuthor\n                        _ -> NormalCitation,\n                      citationNoteNum = textToInt (attrValue atNameCitationNoteNum e) 0,\n                      citationHash = textToInt (attrValue atNameCitationHash e) 0\n                    }\n                )\n          else do\n            return Nothing\n      _ -> do\n        return Nothing\n      where\n        inlinesOfChildrenNamed tag e = getInlines $ concatMap (\\e' -> elContent e') (childrenNamed tag e)\n\nparseMaybeCaptionElement :: (PandocMonad m) => Maybe Element -> XMLReader m Caption\nparseMaybeCaptionElement Nothing = pure emptyCaption\nparseMaybeCaptionElement (Just e) = parseCaption $ elContent e\n\nparseCaption :: (PandocMonad m) => [Content] -> XMLReader m Caption\nparseCaption contents =\n  let (maybe_shortcaption_el, caption_contents) = partitionFirstChildNamed tgNameShortCaption contents\n   in do\n        blocks <- parseBlocks caption_contents\n        case (maybe_shortcaption_el) of\n          Just shortcaption_el -> do\n            short_caption <- getInlines (elContent shortcaption_el)\n            return $ caption (Just $ toList short_caption) blocks\n          Nothing -> return $ caption Nothing blocks\n\nparseDefinitionListItem :: (PandocMonad m) => [Content] -> XMLReader m (Inlines, [Blocks])\nparseDefinitionListItem contents = do\n  let term_contents = getContentsOfElements (isElementNamed tgNameDefListTerm) contents\n      defs_elements = elementContents $ filter (isElementNamed tgNameDefListDef) contents\n  term_inlines <- getInlines (concat term_contents)\n  defs <- mapM getBlocks defs_elements\n  return (term_inlines, defs)\n\nelementContents :: [Content] -> [Element]\nelementContents contents = mapMaybe toElement contents\n  where\n    toElement :: Content -> Maybe Element\n    toElement (Elem e) = Just e\n    toElement _ = Nothing\n\nisElementNamed :: Text -> Content -> Bool\nisElementNamed t c = case (c) of\n  Elem e -> t == elementName e\n  _ -> False\n\nchildrenNamed :: Text -> Element -> [Element]\nchildrenNamed tag e = elementContents $ filter (isElementNamed tag) (elContent e)\n\nelementsWithNames :: S.Set Text -> [Content] -> [Element]\nelementsWithNames tags contents = mapMaybe isElementWithNameInSet contents\n  where\n    isElementWithNameInSet c = case (c) of\n      Elem el ->\n        if (elementName el) `S.member` tags\n          then Just el\n          else Nothing\n      _ -> Nothing\n\npartitionFirstChildNamed :: Text -> [Content] -> (Maybe Element, [Content])\npartitionFirstChildNamed tag contents = case (contents) of\n  (Text (CData _ s _) : rest) ->\n    if T.all isSpace s\n      then partitionFirstChildNamed tag rest\n      else (Nothing, contents)\n  (Elem e : rest) ->\n    if tag == elementName e\n      then (Just e, rest)\n      else (Nothing, contents)\n  _ -> (Nothing, contents)\n\ntype PandocAttr = (Text, [Text], [(Text, Text)])\n\nfilterAttributes :: S.Set Text -> [(Text, Text)] -> [(Text, Text)]\nfilterAttributes to_be_removed a = filter keep_attr a\n  where\n    keep_attr (k, _) = not (k `S.member` to_be_removed)\n\nfilterAttrAttributes :: [Text] -> PandocAttr -> PandocAttr\nfilterAttrAttributes to_be_removed (idn, classes, a) = (idn, classes, filtered)\n  where\n    filtered = filterAttributes (S.fromList to_be_removed) a\n\nattrFromElement :: Element -> PandocAttr\nattrFromElement e = filterAttrAttributes [\"id\", \"class\"] (idn, classes, attributes)\n  where\n    idn = attrValue \"id\" e\n    classes = T.words $ attrValue \"class\" e\n    attributes = map (\\a -> (qName $ attrKey a, attrVal a)) $ elAttribs e\n\naddMeta :: (PandocMonad m) => (ToMetaValue a) => Text -> a -> XMLReader m ()\naddMeta field val = modify (setMeta field val)\n\ninstance HasMeta XMLReaderState where\n  setMeta field v s = s {xmlMeta = setMeta field v (xmlMeta s)}\n\n  deleteMeta field s = s {xmlMeta = deleteMeta field (xmlMeta s)}\n\nparseMetaMapEntry :: (PandocMonad m) => Element -> XMLReader m (Maybe (Text, MetaValue))\nparseMetaMapEntry e =\n  let key = attrValue atNameMetaMapEntryKey e\n   in case (key) of\n        \"\" -> pure Nothing\n        k -> do\n          maybe_value <- parseMetaMapEntryContents $ elContent e\n          case (maybe_value) of\n            Nothing -> return Nothing\n            Just v -> return $ Just (k, v)\n\nparseMetaMapEntryContents :: (PandocMonad m) => [Content] -> XMLReader m (Maybe MetaValue)\nparseMetaMapEntryContents cs = msum <$> mapM parseMeta cs\n\ngetElementText :: Element -> T.Text\ngetElementText el = T.concat [cdData c | Text c <- elContent el]\n\nparseMeta :: (PandocMonad m) => Content -> XMLReader m (Maybe MetaValue)\nparseMeta (Text (CData CDataRaw _ _)) = return Nothing\nparseMeta (Text (CData _ s _)) =\n  if T.all isSpace s\n    then return Nothing\n    else do\n      throwError $ PandocXMLError \"\" \"non-space characters out of inline context in metadata\"\nparseMeta (CRef x) =\n  throwError $ PandocXMLError \"\" (\"reference \\\"\" <> x <> \"\\\" out of inline context\")\nparseMeta (Elem e) = do\n  let name = elementName e\n   in case (name) of\n        \"MetaBool\" -> case (attrValue atNameMetaBoolValue e) of\n          \"true\" -> return $ Just $ MetaBool True\n          _ -> return $ Just $ MetaBool False\n        \"MetaString\" -> return $ Just $ MetaString (getElementText e)\n        \"MetaInlines\" -> do\n          inlines <- getInlines (elContent e)\n          return $ Just $ MetaInlines $ toList inlines\n        \"MetaBlocks\" -> do\n          blocks <- getBlocks e\n          return $ Just $ MetaBlocks $ toList blocks\n        \"MetaList\" -> do\n          maybe_items <- mapM parseMeta $ elContent e\n          let items = catMaybes maybe_items\n           in -- TODO: report empty MetaList?\n              return $ Just $ MetaList items\n        \"MetaMap\" ->\n          let entry_els = childrenNamed tgNameMetaMapEntry e\n           in do\n                entries <- catMaybes <$> mapM parseMetaMapEntry entry_els\n                if null entries\n                  then\n                    -- TODO: report empty MetaMap\n                    return Nothing\n                  else return $ Just $ MetaMap $ M.fromList entries\n        _ -> do\n          throwError $ PandocXMLError \"\" (\"unexpected element \\\"\" <> name <> \"\\\" in metadata\")\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Xlsx/Cells.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Xlsx.Cells\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nCell types and parsing for XLSX.\n-}\nmodule Text.Pandoc.Readers.Xlsx.Cells\n  ( CellRef(..)\n  , XlsxCell(..)\n  , CellValue(..)\n  , parseCellRef\n  ) where\n\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Data.Char (ord, isAlpha)\nimport Text.Read (readMaybe)\n\n-- | Cell reference (A1 notation)\ndata CellRef = CellRef\n  { cellRefCol :: Int    -- 1-based (A=1, B=2, ..., AA=27)\n  , cellRefRow :: Int    -- 1-based\n  } deriving (Show, Eq, Ord)\n\n-- | Cell value types\ndata CellValue\n  = TextValue Text\n  | NumberValue Double\n  | EmptyValue\n  deriving (Show, Eq)\n\n-- | Parsed cell\ndata XlsxCell = XlsxCell\n  { cellRef :: CellRef\n  , cellValue :: CellValue\n  , cellBold :: Bool\n  , cellItalic :: Bool\n  } deriving (Show)\n\n-- | Parse cell reference (A1 → CellRef)\nparseCellRef :: Text -> Either Text CellRef\nparseCellRef ref = do\n  let (colStr, rowStr) = T.span isAlpha ref\n\n  row <- case readMaybe (T.unpack rowStr) of\n    Just r | r > 0 -> Right r\n    _ -> Left $ \"Invalid row: \" <> rowStr\n\n  col <- parseColumn colStr\n\n  return $ CellRef col row\n\n-- | Parse column (A=1, Z=26, AA=27, etc.)\nparseColumn :: Text -> Either Text Int\nparseColumn colStr\n  | T.null colStr = Left \"Empty column\"\n  | otherwise = Right $ T.foldl' (\\acc c -> acc * 26 + (ord c - ord 'A' + 1)) 0 colStr\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Xlsx/Parse.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Xlsx.Parse\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nParsing of XLSX archive to intermediate representation.\n-}\nmodule Text.Pandoc.Readers.Xlsx.Parse\n  ( Xlsx(..)\n  , XlsxWorkbook(..)\n  , XlsxSheet(..)\n  , SheetId(..)\n  , SharedStrings\n  , Styles(..)\n  , FontInfo(..)\n  , archiveToXlsx\n  ) where\n\nimport Codec.Archive.Zip (Archive, Entry, findEntryByPath, fromEntry)\nimport Data.List (find)\nimport qualified Data.Map.Strict as M\nimport Data.Maybe (mapMaybe, fromMaybe)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy.Encoding as TL\nimport Data.Text (Text)\nimport qualified Data.Vector as V\nimport System.FilePath (splitFileName)\nimport Text.Pandoc.Readers.OOXML.Shared\nimport Text.Pandoc.Readers.Xlsx.Cells\nimport Text.Pandoc.XML.Light\nimport Text.Read (readMaybe)\n\n-- | Sheet identifier\nnewtype SheetId = SheetId Int deriving (Show, Eq, Ord)\n\n-- | Shared strings table (Vector for O(1) lookup)\ntype SharedStrings = V.Vector Text\n\n-- | Font information\ndata FontInfo = FontInfo\n  { fontBold :: Bool\n  , fontItalic :: Bool\n  , fontUnderline :: Bool\n  } deriving (Show)\n\n-- | Style information\ndata Styles = Styles\n  { styleFonts :: V.Vector FontInfo\n  } deriving (Show)\n\n-- | Complete XLSX document\ndata Xlsx = Xlsx\n  { xlsxWorkbook :: XlsxWorkbook\n  , xlsxSheets :: [XlsxSheet]\n  , xlsxSharedStrings :: SharedStrings\n  , xlsxStyles :: Styles\n  } deriving (Show)\n\n-- | Workbook information\ndata XlsxWorkbook = XlsxWorkbook\n  { workbookSheetNames :: [(SheetId, Text, Text)]  -- (id, name, relId)\n  } deriving (Show)\n\n-- | Individual worksheet\ndata XlsxSheet = XlsxSheet\n  { sheetId :: SheetId\n  , sheetName :: Text\n  , sheetCells :: M.Map CellRef XlsxCell\n  } deriving (Show)\n\n-- | Parse XLSX archive\narchiveToXlsx :: Archive -> Either Text Xlsx\narchiveToXlsx archive = do\n  -- Find and parse workbook.xml\n  workbookPath <- getWorkbookXmlPath archive\n  workbookElem <- loadXMLFromArchive archive workbookPath\n  workbook <- parseWorkbook workbookElem\n    `addContext` (\"Parsing workbook.xml from: \" <> T.pack workbookPath)\n\n  -- Load workbook relationships\n  workbookRels <- loadRelationships archive (relsPathFor workbookPath)\n\n  -- Parse shared strings (look for sharedStrings relationship)\n  sharedStrings <- case findRelWithTarget workbookRels \"sharedStrings\" of\n    Just (_, target) -> do\n      let path = \"xl/\" ++ T.unpack target\n      el <- loadXMLFromArchive archive path\n      parseSharedStrings el\n    Nothing -> Right V.empty\n\n  -- Parse styles\n  styles <- case findRelWithTarget workbookRels \"styles\" of\n    Just (_, target) -> do\n      let path = \"xl/\" ++ T.unpack target\n      el <- loadXMLFromArchive archive path\n      parseStyles el\n    Nothing -> Right $ Styles V.empty\n\n  -- Parse worksheets\n  sheets <- mapM (\\sheetInfo -> parseSheet archive workbookRels sharedStrings styles sheetInfo)\n                 (workbookSheetNames workbook)\n\n  return $ Xlsx workbook sheets sharedStrings styles\n\n-- | Find workbook.xml via root relationships\ngetWorkbookXmlPath :: Archive -> Either Text FilePath\ngetWorkbookXmlPath archive = do\n  relsEntry <- maybeToEither \"Missing _rels/.rels\" $\n               findEntryByPath \"_rels/.rels\" archive\n  relsElem <- parseXMLFromEntry relsEntry\n\n  let relElems = onlyElems $ elContent relsElem\n  case find isOfficeDocRel relElems of\n    Nothing -> Left \"No workbook.xml relationship found\"\n    Just rel -> do\n      target <- maybeToEither \"Missing Target\" $ findAttr (unqual \"Target\") rel\n      return $ T.unpack target\n  where\n    isOfficeDocRel el =\n      case (findAttr (unqual \"Type\") el, findAttr (unqual \"Target\") el) of\n        (Just relType, Just target) ->\n          \"officeDocument\" `T.isInfixOf` relType && \"workbook\" `T.isInfixOf` target\n        _ -> False\n\n-- | Parse workbook.xml\nparseWorkbook :: Element -> Either Text XlsxWorkbook\nparseWorkbook wbElem = do\n  let ns = elemToNameSpaces wbElem\n\n  -- Find sheets element (match by local name only)\n  sheets <- maybeToEither \"Missing <sheets>\" $\n            find (\\e -> qName (elName e) == \"sheets\") (onlyElems $ elContent wbElem)\n\n  let sheetElems = filter (\\e -> qName (elName e) == \"sheet\") (onlyElems $ elContent sheets)\n  sheetRefs <- mapM (parseSheetRef ns) (zip [1..] sheetElems)\n\n  return $ XlsxWorkbook sheetRefs\n\nparseSheetRef :: NameSpaces -> (Int, Element) -> Either Text (SheetId, Text, Text)\nparseSheetRef ns (idx, sheetElem) = do\n  let name = fromMaybe (\"Sheet\" <> T.pack (show idx)) $\n             findAttr (unqual \"name\") sheetElem\n  relId <- maybeToEither \"Missing r:id\" $\n           findAttrByName ns \"r\" \"id\" sheetElem\n  return (SheetId idx, name, relId)\n\n-- | Parse shared strings\nparseSharedStrings :: Element -> Either Text SharedStrings\nparseSharedStrings sstElem = do\n  let siElems = filter (\\e -> qName (elName e) == \"si\") (onlyElems $ elContent sstElem)\n      strings = map extractString siElems\n  return $ V.fromList strings\n  where\n    extractString siElem =\n      case find (\\e -> qName (elName e) == \"t\") (onlyElems $ elContent siElem) of\n        Just tElem -> strContent tElem\n        Nothing -> getAllText siElem\n\n-- | Parse styles (fonts only for MVP)\nparseStyles :: Element -> Either Text Styles\nparseStyles stylesElem = do\n  -- Parse fonts (match by local name)\n  let fontsElem = find (\\e -> qName (elName e) == \"fonts\") (onlyElems $ elContent stylesElem)\n      fontElems = maybe [] (\\fe -> filter (\\e -> qName (elName e) == \"font\") (onlyElems $ elContent fe)) fontsElem\n      fonts = V.fromList $ map (parseFont mempty) fontElems\n\n  return $ Styles fonts\n\nparseFont :: NameSpaces -> Element -> FontInfo\nparseFont _ns fontElem =\n  FontInfo\n    { fontBold = any (\\e -> qName (elName e) == \"b\") (onlyElems $ elContent fontElem)\n    , fontItalic = any (\\e -> qName (elName e) == \"i\") (onlyElems $ elContent fontElem)\n    , fontUnderline = any (\\e -> qName (elName e) == \"u\") (onlyElems $ elContent fontElem)\n    }\n\n-- | Parse individual worksheet\nparseSheet :: Archive -> [(Text, Text)] -> SharedStrings -> Styles -> (SheetId, Text, Text) -> Either Text XlsxSheet\nparseSheet archive rels sharedStrings styles (sid, name, relId) = do\n  target <- maybeToEither (\"Sheet relationship not found: \" <> relId) $\n            lookup relId rels\n\n  let sheetPath = \"xl/\" ++ T.unpack target\n  sheetElem <- loadXMLFromArchive archive sheetPath\n\n  cells <- parseSheetCells sheetElem sharedStrings styles\n\n  return $ XlsxSheet sid name cells\n\n-- | Parse sheet cells\nparseSheetCells :: Element -> SharedStrings -> Styles -> Either Text (M.Map CellRef XlsxCell)\nparseSheetCells sheetElem sharedStrings styles = do\n  -- Find sheetData by local name\n  case find (\\e -> qName (elName e) == \"sheetData\") (onlyElems $ elContent sheetElem) of\n    Nothing -> return M.empty\n    Just sheetData -> do\n      let rowElems = filter (\\e -> qName (elName e) == \"row\") (onlyElems $ elContent sheetData)\n          cellElems = concatMap (\\r -> filter (\\e -> qName (elName e) == \"c\") (onlyElems $ elContent r)) rowElems\n          cells = mapMaybe (parseCell sharedStrings styles) cellElems\n      return $ M.fromList [(cellRef c, c) | c <- cells]\n\n-- | Parse individual cell\nparseCell :: SharedStrings -> Styles -> Element -> Maybe XlsxCell\nparseCell sharedStrings styles cElem = do\n  -- Get cell reference\n  refText <- findAttr (unqual \"r\") cElem\n  cellRefParsed <- either (const Nothing) Just $ parseCellRef refText\n\n  -- Get cell type (default to number if missing)\n  let cellType = fromMaybe \"\" $ findAttr (unqual \"t\") cElem\n      styleIdx = findAttr (unqual \"s\") cElem >>= readMaybe . T.unpack\n\n  -- Get value (match by local name)\n  let vElem = find (\\e -> qName (elName e) == \"v\") (onlyElems $ elContent cElem)\n      vText = maybe \"\" strContent vElem\n\n  -- Parse value based on type\n  let value = if cellType == \"s\"\n              then\n                -- Shared string\n                case readMaybe (T.unpack vText) of\n                  Just idx | idx >= 0 && idx < V.length sharedStrings ->\n                    TextValue (sharedStrings V.! idx)\n                  _ -> EmptyValue\n              else if T.null vText\n                then EmptyValue\n                else\n                  -- Number\n                  case readMaybe (T.unpack vText) of\n                    Just n -> NumberValue n\n                    Nothing -> TextValue vText\n\n  -- Get formatting from style\n  let (bold, italic) = case styleIdx of\n        Just idx | idx >= 0 && idx < V.length (styleFonts styles) ->\n          let font = styleFonts styles V.! idx\n           in (fontBold font, fontItalic font)\n        _ -> (False, False)\n\n  return $ XlsxCell cellRefParsed value bold italic\n\n-- Helper functions\nloadXMLFromArchive :: Archive -> FilePath -> Either Text Element\nloadXMLFromArchive archive path = do\n  entry <- maybeToEither (\"Entry not found: \" <> T.pack path) $\n           findEntryByPath path archive\n  parseXMLFromEntry entry\n\nparseXMLFromEntry :: Entry -> Either Text Element\nparseXMLFromEntry entry =\n  let lazyText = TL.decodeUtf8 $ fromEntry entry\n   in parseXMLElement lazyText\n\nloadRelationships :: Archive -> FilePath -> Either Text [(Text, Text)]\nloadRelationships archive relsPath =\n  case findEntryByPath relsPath archive of\n    Nothing -> Right []\n    Just entry -> do\n      relsElem <- parseXMLFromEntry entry\n      let relElems = onlyElems $ elContent relsElem\n      return $ mapMaybe extractRel relElems\n  where\n    extractRel el = do\n      relId <- findAttr (unqual \"Id\") el\n      target <- findAttr (unqual \"Target\") el\n      return (relId, target)\n\nrelsPathFor :: FilePath -> FilePath\nrelsPathFor path =\n  let (dir, file) = splitFileName path\n   in dir ++ \"/_rels/\" ++ file ++ \".rels\"\n\nfindRelWithTarget :: [(Text, Text)] -> Text -> Maybe (Text, Text)\nfindRelWithTarget rels targetName =\n  find (\\(_, target) -> targetName `T.isInfixOf` target) rels\n\nmaybeToEither :: Text -> Maybe a -> Either Text a\nmaybeToEither err Nothing = Left err\nmaybeToEither _ (Just x) = Right x\n\ngetAllText :: Element -> Text\ngetAllText el =\n  let textFromContent (Text cdata) = cdData cdata\n      textFromContent (Elem e) = getAllText e\n      textFromContent _ = \"\"\n      texts = map textFromContent (elContent el)\n   in T.unwords $ filter (not . T.null) texts\n\naddContext :: Either Text a -> Text -> Either Text a\naddContext (Right x) _ = Right x\naddContext (Left err) ctx = Left (err <> \" (context: \" <> ctx <> \")\")\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Xlsx/Sheets.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Xlsx.Sheets\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nConversion of XLSX sheets to Pandoc AST.\n-}\nmodule Text.Pandoc.Readers.Xlsx.Sheets\n  ( xlsxToOutput\n  ) where\n\nimport qualified Data.Map.Strict as M\nimport qualified Data.Text as T\nimport Data.List (sort, dropWhileEnd)\nimport Data.Char (isSpace)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Readers.Xlsx.Parse\nimport Text.Pandoc.Readers.Xlsx.Cells\nimport qualified Text.Pandoc.Builder as B\n\n-- | Convert XLSX to Pandoc output\nxlsxToOutput :: ReaderOptions -> Xlsx -> (Meta, [Block])\nxlsxToOutput _opts xlsx =\n  let sheets = xlsxSheets xlsx\n      sheetBlocks = concatMap sheetToBlocks sheets\n   in (mempty, sheetBlocks)\n\n-- | Convert sheet to blocks (header + table)\nsheetToBlocks :: XlsxSheet -> [Block]\nsheetToBlocks sheet =\n  let SheetId n = sheetId sheet\n      name = sheetName sheet\n      sheetIdent = \"sheet-\" <> T.pack (show n)\n      header = Header 2 (sheetIdent, [], []) (B.toList (B.text name))\n\n      -- Convert cells to table\n      tableBlock = case cellsToTable sheet of\n        Just tbl -> [tbl]\n        Nothing -> []  -- Empty sheet\n   in header : tableBlock\n\n-- | Convert cells to Pandoc Table\ncellsToTable :: XlsxSheet -> Maybe Block\ncellsToTable sheet\n  | M.null (sheetCells sheet) = Nothing\n  | otherwise =\n      let cells = sheetCells sheet\n          -- Get bounds\n          refs = sort $ M.keys cells\n          minCol = minimum $ map cellRefCol refs\n          maxCol = maximum $ map cellRefCol refs\n          minRow = minimum $ map cellRefRow refs\n          maxRow = maximum $ map cellRefRow refs\n\n          -- Build dense grid\n          grid = [ [ M.lookup (CellRef col row) cells\n                   | col <- [minCol..maxCol]\n                   ]\n                 | row <- [minRow..maxRow]\n                 ]\n\n          -- First row is header (simple heuristic)\n          (headerRow, bodyRows) = case grid of\n            (h:bs) -> (h, bs)\n            [] -> ([], [])\n\n          -- Filter out trailing empty rows (rows with only whitespace)\n          filteredBodyRows = dropWhileEnd isEmptyRow bodyRows\n\n          makeCell mcell = case mcell of\n            Just cell ->\n              let inlines = cellToInlines cell\n               in Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) [Plain inlines]\n            Nothing ->\n              Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) [Plain []]\n\n          numCols = length headerRow\n          colSpec = replicate numCols (AlignDefault, ColWidthDefault)\n          thead = TableHead nullAttr [Row nullAttr $ map makeCell headerRow]\n          tbody = [TableBody nullAttr 0 [] $ map (Row nullAttr . map makeCell) filteredBodyRows]\n          tfoot = TableFoot nullAttr []\n\n       in Just $ Table nullAttr (Caption Nothing []) colSpec thead tbody tfoot\n\n-- | Check if a row contains only whitespace or empty cells\nisEmptyRow :: [Maybe XlsxCell] -> Bool\nisEmptyRow = all isEmptyCell\n  where\n    isEmptyCell Nothing = True\n    isEmptyCell (Just cell) = case cellValue cell of\n      EmptyValue -> True\n      TextValue t -> T.all isSpace t\n      NumberValue _ -> False\n\n-- | Convert cell to Pandoc inlines\ncellToInlines :: XlsxCell -> [Inline]\ncellToInlines cell =\n  let base = case cellValue cell of\n        TextValue t -> B.toList $ B.text t\n        NumberValue n -> [Str $ T.pack $ show n]\n        EmptyValue -> []\n\n      applyBold inls = if cellBold cell then [Strong inls] else inls\n      applyItalic inls = if cellItalic cell then [Emph inls] else inls\n\n   in applyItalic $ applyBold base\n"
  },
  {
    "path": "src/Text/Pandoc/Readers/Xlsx.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Readers.Xlsx\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nConversion of XLSX (Excel spreadsheet) documents to 'Pandoc' document.\n-}\nmodule Text.Pandoc.Readers.Xlsx (readXlsx) where\n\nimport qualified Data.ByteString.Lazy as B\nimport qualified Data.Text as T\nimport Codec.Archive.Zip (toArchiveOrFail)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition (Pandoc(..))\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Options (ReaderOptions)\nimport Text.Pandoc.Readers.Xlsx.Parse (archiveToXlsx)\nimport Text.Pandoc.Readers.Xlsx.Sheets (xlsxToOutput)\n\n-- | Read XLSX file into Pandoc AST\nreadXlsx :: PandocMonad m => ReaderOptions -> B.ByteString -> m Pandoc\nreadXlsx opts bytes =\n  case toArchiveOrFail bytes of\n    Right archive ->\n      case archiveToXlsx archive of\n        Right xlsx -> do\n          let (meta, blocks) = xlsxToOutput opts xlsx\n          return $ Pandoc meta blocks\n        Left err ->\n          throwError $ PandocParseError $ \"Failed to parse XLSX: \" <> err\n\n    Left err ->\n      throwError $ PandocParseError $\n        \"Failed to unpack XLSX archive: \" <> T.pack err\n"
  },
  {
    "path": "src/Text/Pandoc/Readers.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE MonoLocalBinds      #-}\n{-# LANGUAGE RankNTypes          #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections       #-}\n{- |\n   Module      : Text.Pandoc.Readers\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nThis helper module exports the readers.\n\nNote:  all of the readers assume that the input text has @'\\n'@\nline endings.  So if you get your input text from a web form,\nyou should remove @'\\r'@ characters using @filter (/='\\r')@.\n\n-}\n\nmodule Text.Pandoc.Readers\n  (\n    -- * Readers: converting /to/ Pandoc format\n    Reader (..)\n  , readers\n  , readAsciiDoc\n  , readDocx\n  , readPptx\n  , readXlsx\n  , readODT\n  , readMarkdown\n  , readCommonMark\n  , readCreole\n  , readDokuWiki\n  , readMediaWiki\n  , readVimwiki\n  , readRST\n  , readOrg\n  , readLaTeX\n  , readHtml\n  , readJATS\n  , readJira\n  , readTextile\n  , readDocBook\n  , readOPML\n  , readHaddock\n  , readNative\n  , readJSON\n  , readTWiki\n  , readTikiWiki\n  , readTxt2Tags\n  , readEPUB\n  , readMuse\n  , readMan\n  , readMdoc\n  , readFB2\n  , readIpynb\n  , readCSV\n  , readTSV\n  , readCslJson\n  , readBibTeX\n  , readBibLaTeX\n  , readEndNoteXML\n  , readRIS\n  , readRTF\n  , readTypst\n  , readDjot\n  , readPod\n  , readXML\n  -- * Miscellaneous\n  , getReader\n  , getDefaultExtensions\n  ) where\n\nimport Control.Monad.Except (throwError)\nimport Data.Aeson\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.Extensions\nimport qualified Text.Pandoc.Format as Format\nimport Text.Pandoc.Options\nimport Text.Pandoc.Readers.AsciiDoc\nimport Text.Pandoc.Readers.CommonMark\nimport Text.Pandoc.Readers.Markdown\nimport Text.Pandoc.Readers.Creole\nimport Text.Pandoc.Readers.DocBook\nimport Text.Pandoc.Readers.Docx\nimport Text.Pandoc.Readers.Pptx\nimport Text.Pandoc.Readers.Xlsx\nimport Text.Pandoc.Readers.DokuWiki\nimport Text.Pandoc.Readers.EPUB\nimport Text.Pandoc.Readers.FB2\nimport Text.Pandoc.Readers.Ipynb\nimport Text.Pandoc.Readers.Haddock\nimport Text.Pandoc.Readers.HTML (readHtml)\nimport Text.Pandoc.Readers.JATS (readJATS)\nimport Text.Pandoc.Readers.Jira (readJira)\nimport Text.Pandoc.Readers.LaTeX\nimport Text.Pandoc.Readers.MediaWiki\nimport Text.Pandoc.Readers.Muse\nimport Text.Pandoc.Readers.Native\nimport Text.Pandoc.Readers.ODT\nimport Text.Pandoc.Readers.OPML\nimport Text.Pandoc.Readers.Org\nimport Text.Pandoc.Readers.Pod\nimport Text.Pandoc.Readers.RST\nimport Text.Pandoc.Readers.Textile\nimport Text.Pandoc.Readers.TikiWiki\nimport Text.Pandoc.Readers.TWiki\nimport Text.Pandoc.Readers.Txt2Tags\nimport Text.Pandoc.Readers.Vimwiki\nimport Text.Pandoc.Readers.Man\nimport Text.Pandoc.Readers.Mdoc\nimport Text.Pandoc.Readers.CSV\nimport Text.Pandoc.Readers.CslJson\nimport Text.Pandoc.Readers.BibTeX\nimport Text.Pandoc.Readers.EndNote\nimport Text.Pandoc.Readers.RIS\nimport Text.Pandoc.Readers.RTF\nimport Text.Pandoc.Readers.Typst\nimport Text.Pandoc.Readers.Djot\nimport Text.Pandoc.Readers.XML\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Sources (ToSources(..), sourcesToText)\n\ndata Reader m = TextReader (forall a . ToSources a =>\n                                ReaderOptions -> a -> m Pandoc)\n              | ByteStringReader (ReaderOptions -> BL.ByteString -> m Pandoc)\n\n-- | Association list of formats and readers.\nreaders :: PandocMonad m => [(Text, Reader m)]\nreaders = [(\"native\"       , TextReader readNative)\n          ,(\"json\"         , TextReader readJSON)\n          ,(\"markdown\"     , TextReader readMarkdown)\n          ,(\"markdown_strict\" , TextReader readMarkdown)\n          ,(\"markdown_phpextra\" , TextReader readMarkdown)\n          ,(\"markdown_github\" , TextReader readMarkdown)\n          ,(\"markdown_mmd\",  TextReader readMarkdown)\n          ,(\"commonmark\"   , TextReader readCommonMark)\n          ,(\"commonmark_x\" , TextReader readCommonMark)\n          ,(\"asciidoc\"     , TextReader readAsciiDoc)\n          ,(\"creole\"       , TextReader readCreole)\n          ,(\"dokuwiki\"     , TextReader readDokuWiki)\n          ,(\"gfm\"          , TextReader readCommonMark)\n          ,(\"rst\"          , TextReader readRST)\n          ,(\"mediawiki\"    , TextReader readMediaWiki)\n          ,(\"vimwiki\"      , TextReader readVimwiki)\n          ,(\"docbook\"      , TextReader readDocBook)\n          ,(\"opml\"         , TextReader readOPML)\n          ,(\"org\"          , TextReader readOrg)\n          ,(\"textile\"      , TextReader readTextile) -- TODO : textile+lhs\n          ,(\"html\"         , TextReader readHtml)\n          ,(\"bits\"         , TextReader readJATS)\n          ,(\"jats\"         , TextReader readJATS)\n          ,(\"jira\"         , TextReader readJira)\n          ,(\"latex\"        , TextReader readLaTeX)\n          ,(\"haddock\"      , TextReader readHaddock)\n          ,(\"twiki\"        , TextReader readTWiki)\n          ,(\"tikiwiki\"     , TextReader readTikiWiki)\n          ,(\"docx\"         , ByteStringReader readDocx)\n          ,(\"pptx\"         , ByteStringReader readPptx)\n          ,(\"xlsx\"         , ByteStringReader readXlsx)\n          ,(\"odt\"          , ByteStringReader readODT)\n          ,(\"t2t\"          , TextReader readTxt2Tags)\n          ,(\"epub\"         , ByteStringReader readEPUB)\n          ,(\"muse\"         , TextReader readMuse)\n          ,(\"man\"          , TextReader readMan)\n          ,(\"fb2\"          , TextReader readFB2)\n          ,(\"ipynb\"        , TextReader readIpynb)\n          ,(\"csv\"          , TextReader readCSV)\n          ,(\"tsv\"          , TextReader readTSV)\n          ,(\"csljson\"      , TextReader readCslJson)\n          ,(\"bibtex\"       , TextReader readBibTeX)\n          ,(\"biblatex\"     , TextReader readBibLaTeX)\n          ,(\"endnotexml\"   , TextReader readEndNoteXML)\n          ,(\"ris\"          , TextReader readRIS)\n          ,(\"rtf\"          , TextReader readRTF)\n          ,(\"typst\"        , TextReader readTypst)\n          ,(\"djot\"         , TextReader readDjot)\n          ,(\"mdoc\"         , TextReader readMdoc)\n          ,(\"pod\"          , TextReader readPod)\n          ,(\"xml\"          , TextReader readXML)\n          ]\n\n-- | Retrieve reader, extensions based on format spec (format+extensions).\ngetReader :: PandocMonad m => Format.FlavoredFormat -> m (Reader m, Extensions)\ngetReader flvrd = do\n  let readerName = Format.formatName flvrd\n  case lookup readerName readers of\n    Nothing  -> throwError $ PandocUnknownReaderError readerName\n    Just  r  -> (r,) <$>\n      Format.applyExtensionsDiff (Format.getExtensionsConfig readerName) flvrd\n\n-- | Read pandoc document from JSON format.\nreadJSON :: (PandocMonad m, ToSources a)\n         => ReaderOptions\n         -> a\n         -> m Pandoc\nreadJSON _ s =\n  case eitherDecode' . BL.fromStrict . UTF8.fromText\n                     . sourcesToText . toSources $ s of\n       Right doc -> return doc\n       Left e    -> throwError $ PandocParseError (\"JSON parse error: \"\n                                                   <> T.pack e)\n"
  },
  {
    "path": "src/Text/Pandoc/RoffChar.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.RoffChar\n   Copyright   : Copyright (C) 2007-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nRoff character escaping/unescaping.\n-}\n\nmodule Text.Pandoc.RoffChar (\n    standardEscapes\n  , characterCodes\n  , combiningAccents\n  ) where\nimport qualified Data.Text as T\n\n-- | These are the escapes specifically mentioned in groff_man(7),\n-- plus @ and ellipsis. We use the \\(aq form when possible (with\n-- two-letter escapes), because these are compatible with all forms\n-- of roff (#10716).\nstandardEscapes :: [(Char, T.Text)]\nstandardEscapes =\n  [ ('\\160', \"\\\\ \")\n  , ('\\'', \"\\\\(aq\")\n  , ('‘', \"\\\\(oq\")\n  , ('’', \"\\\\(cq\")\n  , ('\"', \"\\\\(dq\")\n  , ('“', \"\\\\(lq\")\n  , ('”', \"\\\\(rq\")\n  , ('—', \"\\\\(em\")\n  , ('–', \"\\\\(en\")\n  , ('`', \"\\\\(ga\")\n  , ('^', \"\\\\(ha\")\n  , ('~', \"\\\\(ti\")\n  , ('\\\\', \"\\\\(rs\")\n  , ('@', \"\\\\(at\") -- because we use @ as a table and math delimiter\n  , ('\\x2026', \"\\\\&...\")  -- because u2026 doesn't render on tty\n  ]\n\ncharacterCodes :: [(Char, T.Text)]\ncharacterCodes =\n  [ ('Ð', \"-D\")\n  , ('ð', \"Sd\")\n  , ('Þ', \"TP\")\n  , ('þ', \"Tp\")\n  , ('ß', \"ss\")\n  , ('ﬀ', \"ff\")\n  , ('ﬁ', \"fi\")\n  , ('ﬂ', \"fl\")\n  , ('ﬃ', \"Fi\")\n  , ('ﬄ', \"Fl\")\n  , ('Ł', \"/L\")\n  , ('ł', \"/l\")\n  , ('Ø', \"/O\")\n  , ('ø', \"/o\")\n  , ('Æ', \"AE\")\n  , ('æ', \"ae\")\n  , ('Œ', \"OE\")\n  , ('œ', \"oe\")\n  , ('Ĳ', \"IJ\")\n  , ('ĳ', \"ij\")\n  , ('ı', \".i\")\n  , ('ȷ', \".j\")\n  , ('Á', \"'A\")\n  , ('Ć', \"'C\")\n  , ('É', \"'E\")\n  , ('Í', \"'I\")\n  , ('Ó', \"'O\")\n  , ('Ú', \"'U\")\n  , ('Ý', \"'Y\")\n  , ('á', \"'a\")\n  , ('ć', \"'c\")\n  , ('é', \"'e\")\n  , ('í', \"'i\")\n  , ('ó', \"'o\")\n  , ('ú', \"'u\")\n  , ('ý', \"'y\")\n  , ('Ä', \":A\")\n  , ('Ë', \":E\")\n  , ('Ï', \":I\")\n  , ('Ö', \":O\")\n  , ('Ü', \":U\")\n  , ('Ÿ', \":Y\")\n  , ('ä', \":a\")\n  , ('ë', \":e\")\n  , ('ï', \":i\")\n  , ('ö', \":o\")\n  , ('ü', \":u\")\n  , ('ÿ', \":y\")\n  , ('Â', \"^A\")\n  , ('Ê', \"^E\")\n  , ('Î', \"^I\")\n  , ('Ô', \"^O\")\n  , ('Û', \"^U\")\n  , ('â', \"^a\")\n  , ('ê', \"^e\")\n  , ('î', \"^i\")\n  , ('ô', \"^o\")\n  , ('û', \"^u\")\n  , ('À', \"`A\")\n  , ('È', \"`E\")\n  , ('Ì', \"`I\")\n  , ('Ò', \"`O\")\n  , ('Ù', \"`U\")\n  , ('à', \"`a\")\n  , ('è', \"`e\")\n  , ('ì', \"`i\")\n  , ('ò', \"`o\")\n  , ('ù', \"`u\")\n  , ('Ã', \"~A\")\n  , ('Ñ', \"~N\")\n  , ('Õ', \"~O\")\n  , ('ã', \"~a\")\n  , ('ñ', \"~n\")\n  , ('õ', \"~o\")\n  , ('Š', \"vS\")\n  , ('š', \"vs\")\n  , ('Ž', \"vZ\")\n  , ('ž', \"vz\")\n  , ('Ç', \",C\")\n  , ('ç', \",c\")\n  , ('Å', \"oA\")\n  , ('å', \"oa\")\n  , ('˝', \"a\\\"\")\n  , ('¯', \"a-\")\n  , ('˙', \"a.\")\n  , ('^', \"a^\")\n  , ('´', \"aa\")\n  , ('`', \"ga\")\n  , ('˘', \"ab\")\n  , ('¸', \"ac\")\n  , ('¨', \"ad\")\n  , ('ˇ', \"ah\")\n  , ('˚', \"ao\")\n  , ('~', \"a~\")\n  , ('˛', \"ho\")\n  , ('^', \"ha\")\n  , ('~', \"ti\")\n  , ('„', \"Bq\")\n  , ('‚', \"bq\")\n  , ('“', \"lq\")\n  , ('”', \"rq\")\n  , ('‘', \"oq\")\n  , ('’', \"cq\")\n  , ('\\'', \"aq\")\n  , ('\"', \"dq\")\n  , ('«', \"Fo\")\n  , ('»', \"Fc\")\n  , ('‹', \"fo\")\n  , ('›', \"fc\")\n  , ('¡', \"r!\")\n  , ('¿', \"r?\")\n  , ('—', \"em\")\n  , ('–', \"en\")\n  , ('‐', \"hy\")\n  , ('[', \"lB\")\n  , (']', \"rB\")\n  , ('{', \"lC\")\n  , ('}', \"rC\")\n  , ('⟨', \"la\")\n  , ('⟩', \"ra\")\n  , ('⎪', \"bv\")\n  , ('⎪', \"braceex\")\n  , ('⎡', \"bracketlefttp\")\n  , ('⎣', \"bracketleftbt\")\n  , ('⎢', \"bracketleftex\")\n  , ('⎤', \"bracketrighttp\")\n  , ('⎦', \"bracketrightbt\")\n  , ('⎥', \"bracketrightex\")\n  , ('╭', \"lt\")\n  , ('⎧', \"bracelefttp\")\n  , ('┥', \"lk\")\n  , ('⎨', \"braceleftmid\")\n  , ('╰', \"lb\")\n  , ('⎩', \"braceleftbt\")\n  , ('⎪', \"braceleftex\")\n  , ('╮', \"rt\")\n  , ('⎫', \"bracerighttp\")\n  , ('┝', \"rk\")\n  , ('⎬', \"bracerightmid\")\n  , ('╯', \"rb\")\n  , ('⎭', \"bracerightbt\")\n  , ('⎪', \"bracerightex\")\n  , ('⎛', \"parenlefttp\")\n  , ('⎝', \"parenleftbt\")\n  , ('⎜', \"parenleftex\")\n  , ('⎞', \"parenrighttp\")\n  , ('⎠', \"parenrightbt\")\n  , ('⎟', \"parenrightex\")\n  , ('←', \"<-\")\n  , ('→', \"->\")\n  , ('↔', \"<>\")\n  , ('↓', \"da\")\n  , ('↑', \"ua\")\n  , ('↕', \"va\")\n  , ('⇐', \"lA\")\n  , ('⇒', \"rA\")\n  , ('⇔', \"hA\")\n  , ('⇓', \"dA\")\n  , ('⇑', \"uA\")\n  , ('⇕', \"vA\")\n  , ('⎯', \"an\")\n  , ('|', \"ba\")\n  , ('│', \"br\")\n  , ('_', \"ul\")\n  , ('‾', \"rn\")\n  , ('_', \"ru\")\n  , ('¦', \"bb\")\n  , ('/', \"sl\")\n  , ('\\\\', \"rs\")\n  , ('○', \"ci\")\n  , ('·', \"bu\")\n  , ('‡', \"dd\")\n  , ('†', \"dg\")\n  , ('◊', \"lz\")\n  , ('□', \"sq\")\n  , ('¶', \"ps\")\n  , ('§', \"sc\")\n  , ('☜', \"lh\")\n  , ('☞', \"rh\")\n  , ('@', \"at\")\n  , ('#', \"sh\")\n  , ('↵', \"CR\")\n  , ('✓', \"OK\")\n  , ('©', \"co\")\n  , ('®', \"rg\")\n  , ('™', \"tm\")\n  , ('$', \"Do\")\n  , ('¢', \"ct\")\n  , ('€', \"eu\")\n  , ('€', \"Eu\")\n  , ('¥', \"Ye\")\n  , ('£', \"Po\")\n  , ('¤', \"Cs\")\n  , ('ƒ', \"Fn\")\n  , ('°', \"de\")\n  , ('‰', \"%0\")\n  , ('′', \"fm\")\n  , ('″', \"sd\")\n  , ('µ', \"mc\")\n  , ('ª', \"Of\")\n  , ('º', \"Om\")\n  , ('∧', \"AN\")\n  , ('∨', \"OR\")\n  , ('¬', \"no\")\n  , ('¬', \"tno\")\n  , ('∃', \"te\")\n  , ('∀', \"fa\")\n  , ('∋', \"st\")\n  , ('∴', \"3d\")\n  , ('∴', \"tf\")\n  , ('|', \"or\")\n  , ('½', \"12\")\n  , ('¼', \"14\")\n  , ('¾', \"34\")\n  , ('⅛', \"18\")\n  , ('⅜', \"38\")\n  , ('⅝', \"58\")\n  , ('⅞', \"78\")\n  , ('¹', \"S1\")\n  , ('²', \"S2\")\n  , ('³', \"S3\")\n  , ('+', \"pl\")\n  , ('−', \"mi\")\n  , ('∓', \"-+\")\n  , ('±', \"+-\")\n  , ('±', \"t+-\")\n  , ('·', \"pc\")\n  , ('⋅', \"md\")\n  , ('×', \"mu\")\n  , ('×', \"tmu\")\n  , ('⊗', \"c*\")\n  , ('⊕', \"c+\")\n  , ('÷', \"di\")\n  , ('÷', \"tdi\")\n  , ('⁄', \"f/\")\n  , ('∗', \"**\")\n  , ('≤', \"<=\")\n  , ('≥', \">=\")\n  , ('≪', \"<<\")\n  , ('≫', \">>\")\n  , ('=', \"eq\")\n  , ('≠', \"!=\")\n  , ('≡', \"==\")\n  , ('≢', \"ne\")\n  , ('≅', \"=~\")\n  , ('≃', \"|=\")\n  , ('∼', \"ap\")\n  , ('≈', \"~~\")\n  , ('≈', \"~=\")\n  , ('∝', \"pt\")\n  , ('∅', \"es\")\n  , ('∈', \"mo\")\n  , ('∉', \"nm\")\n  , ('⊂', \"sb\")\n  , ('⊄', \"nb\")\n  , ('⊃', \"sp\")\n  , ('⊅', \"nc\")\n  , ('⊆', \"ib\")\n  , ('⊇', \"ip\")\n  , ('∩', \"ca\")\n  , ('∪', \"cu\")\n  , ('∠', \"/_\")\n  , ('⊥', \"pp\")\n  , ('∫', \"is\")\n  , ('∫', \"integral\")\n  , ('∑', \"sum\")\n  , ('∏', \"product\")\n  , ('∐', \"coproduct\")\n  , ('∇', \"gr\")\n  , ('√', \"sr\")\n  , ('√', \"sqrt\")\n  -- , \"radicalex\"\n  -- \"sqrtex\"\n  , ('⌈', \"lc\")\n  , ('⌉', \"rc\")\n  , ('⌊', \"lf\")\n  , ('⌋', \"rf\")\n  , ('∞', \"if\")\n  , ('ℵ', \"Ah\")\n  , ('ℑ', \"Im\")\n  , ('ℜ', \"Re\")\n  , ('℘', \"wp\")\n  , ('∂', \"pd\")\n  , ('ℏ', \"-h\")\n  , ('ℏ', \"hbar\")\n  , ('Α', \"*A\")\n  , ('Β', \"*B\")\n  , ('Γ', \"*G\")\n  , ('Δ', \"*D\")\n  , ('Ε', \"*E\")\n  , ('Ζ', \"*Z\")\n  , ('Η', \"*Y\")\n  , ('Θ', \"*H\")\n  , ('Ι', \"*I\")\n  , ('Κ', \"*K\")\n  , ('Λ', \"*L\")\n  , ('Μ', \"*M\")\n  , ('Ν', \"*N\")\n  , ('Ξ', \"*C\")\n  , ('Ο', \"*O\")\n  , ('Π', \"*P\")\n  , ('Ρ', \"*R\")\n  , ('Σ', \"*S\")\n  , ('Τ', \"*T\")\n  , ('Υ', \"*U\")\n  , ('Φ', \"*F\")\n  , ('Χ', \"*X\")\n  , ('Ψ', \"*Q\")\n  , ('Ω', \"*W\")\n  , ('α', \"*a\")\n  , ('β', \"*b\")\n  , ('γ', \"*g\")\n  , ('δ', \"*d\")\n  , ('ε', \"*e\")\n  , ('ζ', \"*z\")\n  , ('η', \"*y\")\n  , ('θ', \"*h\")\n  , ('ι', \"*i\")\n  , ('κ', \"*k\")\n  , ('λ', \"*l\")\n  , ('μ', \"*m\")\n  , ('ν', \"*n\")\n  , ('ξ', \"*c\")\n  , ('ο', \"*o\")\n  , ('π', \"*p\")\n  , ('ρ', \"*r\")\n  , ('ς', \"ts\")\n  , ('σ', \"*s\")\n  , ('τ', \"*t\")\n  , ('υ', \"*u\")\n  , ('ϕ', \"*f\")\n  , ('χ', \"*x\")\n  , ('ψ', \"*q\")\n  , ('ω', \"*w\")\n  , ('ϑ', \"+h\")\n  , ('φ', \"+f\")\n  , ('ϖ', \"+p\")\n  , ('ϵ', \"+e\")\n  , ('♣', \"CL\")\n  , ('♠', \"SP\")\n  , ('♥', \"HE\")\n  , ('♦', \"DI\")\n  , ('˝' , \"a\\\"\")\n  , ('¯', \"a-\")\n  , ('˙', \"a.\")\n  , ('^', \"a^\")\n  , ('´', \"aa\")\n  , ('`', \"ga\")\n  , ('˘', \"ab\")\n  , ('¸', \"ac\")\n  , ('¨', \"ad\")\n  , ('ˇ', \"ah\")\n  , ('˚', \"ao\")\n  , ('~', \"a~\")\n  , ('˛', \"ho\")\n  , ('^', \"ha\")\n  , ('~', \"ti\")\n  ]\n\n-- use like: \\\\[E a^ aa]\ncombiningAccents :: [(Char, T.Text)]\ncombiningAccents =\n  [ ('\\779' , \"a\\\"\")\n  , ('\\772', \"a-\")\n  , ('\\775', \"a.\")\n  , ('\\770', \"a^\")\n  , ('\\769', \"aa\")\n  , ('\\768', \"ga\")\n  , ('\\774', \"ab\")\n  , ('\\807', \"ac\")\n  , ('\\776', \"ad\")\n  , ('\\780', \"ah\")\n  , ('\\778', \"ao\")\n  , ('\\771', \"a~\")\n  , ('\\808', \"ho\")\n  , ('\\770', \"ha\")\n  , ('\\771', \"ti\")\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/Scripting.hs",
    "content": "{-# LANGUAGE OverloadedStrings    #-}\n{-# LANGUAGE ImpredicativeTypes   #-}\n{-# LANGUAGE ScopedTypeVariables  #-}\n{- |\nModule      : Text.Pandoc.Scripting\nCopyright   : © 2022-2024 Albert Krewinkel\nLicense     : GPL-2.0-or-later\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nCentral data structure for scripting engines.\n-}\nmodule Text.Pandoc.Scripting\n  ( ScriptingEngine (..)\n  , CustomComponents(..)\n  , noEngine\n  )\nwhere\n\nimport Control.Monad.Except (throwError)\nimport Control.Monad.IO.Class (MonadIO)\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition (Pandoc)\nimport Text.Pandoc.Error (PandocError (PandocNoScriptingEngine))\nimport Text.Pandoc.Filter.Environment (Environment)\nimport Text.Pandoc.Format (ExtensionsConfig)\nimport Text.Pandoc.Readers (Reader)\nimport Text.Pandoc.Writers (Writer)\n\n-- | A component of a custom reader/writer: a custom reader,\n-- a custom writer, a template for a custom writer, or a specification\n-- of the extensions used by a script and their default values.\n-- Note that a single script can contain all of these.\ndata CustomComponents m =\n  CustomComponents\n  { customReader :: Maybe (Reader m)\n  , customWriter :: Maybe (Writer m)\n  , customTemplate :: Maybe Text\n  , customExtensions :: Maybe ExtensionsConfig\n  }\n\n-- | Structure to define a scripting engine.\ndata ScriptingEngine = ScriptingEngine\n  { engineName :: Text   -- ^ Name of the engine.\n\n  , engineApplyFilter :: forall m. (PandocMonad m, MonadIO m)\n                      => Environment -> [String] -> FilePath\n                      -> Pandoc -> m Pandoc\n    -- ^ Use the scripting engine to run a filter.\n\n  , engineLoadCustom :: forall m. (PandocMonad m, MonadIO m)\n                     => FilePath -> m (CustomComponents m)\n    -- ^ Function to load a custom reader/writer from a script.\n  }\n\nnoEngine :: ScriptingEngine\nnoEngine = ScriptingEngine\n  { engineName = \"none\"\n  , engineApplyFilter = \\_env _args _fp _doc ->\n      throwError PandocNoScriptingEngine\n  , engineLoadCustom = \\_fp ->\n      throwError PandocNoScriptingEngine\n  }\n"
  },
  {
    "path": "src/Text/Pandoc/SelfContained.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE TupleSections     #-}\n{- |\n   Module      : Text.Pandoc.SelfContained\n   Copyright   : Copyright (C) 2011-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions for converting an HTML file into one that can be viewed\noffline, by incorporating linked images, CSS, and scripts into\nthe HTML using data URIs.\n-}\nmodule Text.Pandoc.SelfContained ( makeDataURI, makeSelfContained ) where\nimport Codec.Compression.GZip as Gzip\nimport Control.Applicative ((<|>))\nimport Data.ByteString (ByteString)\nimport Data.ByteString.Base64 (encode)\nimport qualified Data.ByteString.Char8 as B\nimport qualified Data.ByteString.Lazy as L\nimport qualified Data.Text as T\nimport Data.Char (isAlphaNum, isAscii)\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport Network.URI (escapeURIString)\nimport System.FilePath (takeDirectory, takeExtension, (</>))\nimport Text.HTML.TagSoup\nimport Text.Pandoc.Class.PandocMonad (PandocMonad (..), fetchItem,\n                                      getInputFiles, report, setInputFiles)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.MIME (MimeType)\nimport Text.Pandoc.Shared (renderTags', trim, tshow, safeRead)\nimport Text.Pandoc.URI (isURI)\nimport Text.Pandoc.UTF8 (toString, toText, fromText)\nimport Text.Pandoc.Parsing (ParsecT, runParserT)\nimport qualified Text.Pandoc.Parsing as P\nimport Control.Monad.Except (throwError, catchError)\nimport Data.Either (lefts, rights)\nimport Data.Maybe (isNothing)\nimport qualified Data.Map as M\nimport Control.Monad.State\n\nisOk :: Char -> Bool\nisOk c = isAscii c && isAlphaNum c\n\nmakeDataURI :: (MimeType, ByteString) -> T.Text\nmakeDataURI (mime, raw) =\n  if textual\n     then \"data:\" <> mime' <> \",\" <> T.pack (escapeURIString isOk (toString raw))\n     else \"data:\" <> mime' <> \";base64,\" <> toText (encode raw')\n  where textual = \"text/\" `T.isPrefixOf` mime\n        raw' = if \"+xml\" `T.isSuffixOf` mime\n                  then B.filter (/= '\\r') raw  -- strip off CRs\n                  else raw\n        mime' = if textual && T.any (== ';') mime\n                   then mime <> \";charset=utf-8\"\n                   else mime  -- mime type already has charset\n\nisSourceAttribute :: T.Text -> (T.Text, T.Text) -> Bool\nisSourceAttribute tagname (x,_) =\n  x == \"src\" ||\n  x == \"data-src\" ||\n  (x == \"href\" && tagname == \"link\") ||\n  x == \"poster\" ||\n  x == \"data-background-image\"\n\ndata ConvertState =\n  ConvertState\n  { isHtml5 :: Bool\n  , svgMap  :: M.Map T.Text (T.Text, [Attribute T.Text])\n    -- map from hash to (id, svg attributes)\n  } deriving (Show)\n\nconvertTags :: PandocMonad m =>\n               [Tag T.Text] -> StateT ConvertState m [Tag T.Text]\nconvertTags [] = return []\nconvertTags (t@TagOpen{}:ts)\n  | fromAttrib \"data-external\" t == \"1\" = (t:) <$> convertTags ts\nconvertTags (t@(TagOpen \"style\" _):ts) =\n  case span isTagText ts of\n    (xs,rest) -> do\n      xs' <- mapM (\\case\n                    TagText s -> TagText . toText <$> cssURLs \"\" (fromText s)\n                    tag -> return tag) xs\n      ((t:xs') ++) <$> convertTags rest\nconvertTags (t@(TagOpen \"script\" as):tc@(TagClose \"script\"):ts) =\n  case fromAttrib \"src\" t of\n       \"\"  -> ([t, tc] ++) <$> convertTags ts\n       src -> do\n           let typeAttr = fromAttrib \"type\" t\n           res <- getData typeAttr src\n           rest <- convertTags ts\n           case res of\n                AlreadyDataURI dataUri -> return $ TagOpen \"script\"\n                     ((\"src\",dataUri) : [(x,y) | (x,y) <- as, x /= \"src\"]) :\n                     TagClose \"script\" : rest\n                Fetched (mime, bs)\n                  | (\"text/javascript\" `T.isPrefixOf` mime ||\n                     \"application/javascript\" `T.isPrefixOf` mime ||\n                     \"application/x-javascript\" `T.isPrefixOf` mime) &&\n                     not (\"</script\" `B.isInfixOf` bs) ->\n                     return $\n                       TagOpen \"script\" [(k,v) | (k,v) <- as\n                                               , k == \"type\" ||\n                                                 \"data-\" `T.isPrefixOf` k]\n                       : TagText (toText bs)\n                       : TagClose \"script\"\n                       : rest\n                  | otherwise ->\n                       return  $ TagOpen \"script\"\n                         ((\"src\",makeDataURI (mime, bs)) :\n                          [(x,y) | (x,y) <- as, x /= \"src\"]) :\n                        TagClose \"script\" : rest\n                CouldNotFetch _ -> return $ t:tc:rest\nconvertTags (t@(TagOpen \"link\" as):ts) =\n  case fromAttrib \"href\" t of\n       \"\"  -> (t:) <$> convertTags ts\n       src -> do\n           res <- getData (fromAttrib \"type\" t) src\n           case res of\n                AlreadyDataURI dataUri -> do\n                  rest <- convertTags ts\n                  return $ TagOpen \"link\"\n                     ((\"href\",dataUri) : [(x,y) | (x,y) <- as, x /= \"href\"]) :\n                     rest\n                Fetched (mime, bs)\n                  | (\"text/css\" `T.isPrefixOf` mime ||\n                      fromAttrib \"rel\" t == \"stylesheet\")\n                    && T.null (fromAttrib \"media\" t)\n                    && not (\"</\" `B.isInfixOf` bs) -> do\n                      rest <- convertTags $\n                                 dropWhile (==TagClose \"link\") ts\n                      return $\n                       TagOpen \"style\" [(\"type\", \"text/css\")] -- see #5725\n                       : TagText (toText bs)\n                       : TagClose \"style\"\n                       : rest\n                  | otherwise -> do\n                      rest <- convertTags ts\n                      return $ TagOpen \"link\"\n                       ((\"href\",makeDataURI (mime, bs)) :\n                         [(x,y) | (x,y) <- as, x /= \"href\"]) : rest\n                CouldNotFetch _ -> do\n                      rest <- convertTags ts\n                      return $ t:rest\nconvertTags (t@(TagOpen tagname as):ts)\n  | any (isSourceAttribute tagname) as\n     = do\n       let inlineSvgs = tagname == \"img\" &&\n                        case T.words <$> lookup \"class\" as of\n                          Nothing -> False\n                          Just cs -> \"inline-svg\" `elem` cs\n       as' <- mapM (processAttribute inlineSvgs) as\n       let attrs = addRole \"img\" $ addAriaLabel $ rights as'\n       let svgContents = lefts as'\n       rest <- convertTags ts\n       case svgContents of\n         [] -> return $ TagOpen tagname attrs : rest\n         ((hash, tags) : _) -> do\n             -- drop \"</img>\" if present\n             let rest' = case rest of\n                           TagClose tn : xs | tn == tagname ->  xs\n                           _ -> rest\n             svgmap <- gets svgMap\n             case M.lookup hash svgmap of\n               Just (svgid, svgattrs) -> do\n                 let attrs' = [(k,v) | (k,v) <- combineSvgAttrs svgattrs attrs\n                                     , k /= \"id\"]\n                 return $ TagOpen \"svg\" attrs' :\n                          TagOpen \"use\" [(\"href\", \"#\" <> svgid),\n                                         (\"width\", \"100%\"),\n                                         (\"height\", \"100%\")] :\n                          TagClose \"use\" :\n                          TagClose \"svg\" :\n                          rest'\n               Nothing ->\n                  case dropWhile (not . isTagOpenName \"svg\") tags of\n                    TagOpen \"svg\" svgattrs : tags' -> do\n                      let attrs' = combineSvgAttrs svgattrs attrs\n                      let svgid = case lookup \"id\" attrs' of\n                                     Just id' -> id'\n                                     Nothing -> \"svg_\" <> hash\n                      let attrs'' = (\"id\", svgid) :\n                                    [(k,v) | (k,v) <- attrs', k /= \"id\"]\n                      modify $ \\st ->\n                        st{ svgMap = M.insert hash (svgid, attrs'') (svgMap st) }\n                      let fixUrl x =\n                            case T.breakOn \"url(#\" x of\n                              (_,\"\") -> x\n                              (before, after) -> before <>\n                                  \"url(#\" <> svgid <> \"_\" <> T.drop 5 after\n                      let addIdPrefix (\"id\", x) = (\"id\", svgid <> \"_\" <> x)\n                          addIdPrefix (k, x)\n                           | k == \"xlink:href\" || k == \"href\" =\n                            case T.uncons x of\n                              Just ('#', x') -> (k, \"#\" <> svgid <> \"_\" <> x')\n                              _ -> (k, x)\n                          -- this clause handles things like\n                          -- style=\"fill:url(#radialGradient46);stroke:none\",\n                          -- adding the svg id prefix to the anchor:\n                          addIdPrefix (k, x) = (k, fixUrl x)\n                      let ensureUniqueId (TagOpen tname ats) =\n                            TagOpen tname (map addIdPrefix ats)\n                          ensureUniqueId x = x\n                      return $ TagOpen \"svg\" attrs'' :\n                                 map ensureUniqueId tags' ++ rest'\n                    _ -> return $ TagOpen tagname attrs : rest\n  where processAttribute inlineSvgs (x,y) =\n           if isSourceAttribute tagname (x,y)\n              then do\n                res <- getData (fromAttrib \"type\" t) y\n                case res of\n                  AlreadyDataURI enc -> return $ Right (x, enc)\n                  Fetched (\"image/svg+xml\", bs) | inlineSvgs -> do\n                    -- we filter CR in the hash to ensure that Windows\n                    -- and non-Windows tests agree:\n                    let hash = T.pack $ take 20 $ show $ hashWith SHA1\n                                             $ B.filter (/='\\r') bs\n                    return $ Left (hash, getSvgTags (toText bs))\n                  Fetched (mt,bs) -> return $ Right (x, makeDataURI (mt,bs))\n                  CouldNotFetch _ -> return $ Right (x, y)\n              else return $ Right (x,y)\n\nconvertTags (t:ts) = (t:) <$> convertTags ts\n\naddRole :: T.Text -> [(T.Text, T.Text)] -> [(T.Text, T.Text)]\naddRole role attrs =\n  case lookup \"role\" attrs of\n    Nothing -> (\"role\", role) : attrs\n    Just _ -> attrs\n\naddAriaLabel :: [(T.Text, T.Text)] -> [(T.Text, T.Text)]\naddAriaLabel attrs =\n  case lookup \"aria-label\" attrs of\n    Just _ -> attrs\n    Nothing -> case lookup \"alt\" attrs of\n                 Just alt -> (\"aria-label\", alt) : attrs\n                 Nothing -> attrs\n\n-- we want to drop spaces, <?xml>, and comments before <svg>\n-- and anything after </svg>:\ngetSvgTags :: T.Text -> [Tag T.Text]\ngetSvgTags t =\n  case takeWhile (not . isTagCloseName \"svg\") .\n       dropWhile (not . isTagOpenName \"svg\") $ parseTags t of\n    [] -> []\n    xs -> xs ++ [TagClose \"svg\"]\n\ncombineSvgAttrs :: [(T.Text, T.Text)] -> [(T.Text, T.Text)] -> [(T.Text, T.Text)]\ncombineSvgAttrs svgAttrs imgAttrs =\n  case (mbViewBox, mbHeight, mbWidth) of\n    (Nothing, Just h, Just w) -> -- calculate viewBox\n      combinedAttrs ++ [(\"viewBox\", T.unwords [\"0\", \"0\", tshow w, tshow h])]\n    (Just (_minx,_miny,w,h), Nothing, Nothing) ->\n        combinedAttrs ++\n        [ (\"width\", dropPointZero (tshow w)) |\n            isNothing (lookup \"width\" combinedAttrs) ] ++\n        [ (\"height\", dropPointZero (tshow h)) |\n            isNothing (lookup \"height\" combinedAttrs) ]\n    _ -> combinedAttrs\n where\n  dropPointZero t = case T.stripSuffix \".0\" t of\n                       Nothing -> t\n                       Just t' -> t'\n  combinedAttrs =\n    [(k, v) | (k, v) <- imgAttrs\n            , k /= \"class\"] ++\n    [(k, v) | (k, v) <- svgAttrs\n            , isNothing (lookup k imgAttrs)\n            , k `notElem` [\"xmlns\", \"xmlns:xlink\", \"version\", \"class\"]] ++\n    mergedClasses\n  parseViewBox t =\n    case map (safeRead . addZero) $ T.words t of\n      [Just llx, Just lly, Just urx, Just ury] -> Just (llx, lly, urx, ury)\n      _ -> Nothing\n  addZero t =\n    if \"-.\" `T.isPrefixOf` t\n       then \"-0.\" <> T.drop 2 t -- safeRead fails on -.33, needs -0.33\n       else t\n  (mbViewBox :: Maybe (Double, Double, Double, Double)) =\n        lookup \"viewBox\" svgAttrs >>= parseViewBox\n  (mbHeight :: Maybe Int) = lookup \"height\" combinedAttrs >>= safeRead\n  (mbWidth :: Maybe Int) = lookup \"width\" combinedAttrs >>= safeRead\n  mergedClasses = case (lookup \"class\" imgAttrs, lookup \"class\" svgAttrs) of\n                    (Just c1, Just c2) -> [(\"class\", c1 <> \" \" <> c2)]\n                    _ -> []\n\ncssURLs :: PandocMonad m\n        => FilePath -> ByteString -> m ByteString\ncssURLs d orig = do\n  res <- runParserT (parseCSSUrls d) () \"css\" orig\n  case res of\n       Left e    -> do\n         report $ CouldNotParseCSS $ T.pack $ show e\n         return orig\n       Right bs  -> return bs\n\nparseCSSUrls :: PandocMonad m\n             => FilePath -> ParsecT ByteString () m ByteString\nparseCSSUrls d = B.concat <$> P.many\n  (pCSSWhite <|> pCSSComment <|> pCSSImport d <|> pCSSUrl d <|> pCSSOther)\n\npCSSImport :: PandocMonad m\n           => FilePath -> ParsecT ByteString () m ByteString\npCSSImport d = P.try $ do\n  P.string \"@import\"\n  P.spaces\n  res <- (pQuoted <|> pUrl) >>= handleCSSUrl d\n  P.spaces\n  P.char ';'\n  P.spaces\n  case res of\n       Left b       -> return $ B.pack \"@import \" <> b\n       Right (_, b) -> return b\n\n-- Note: some whitespace in CSS is significant, so we can't collapse it!\npCSSWhite :: PandocMonad m => ParsecT ByteString () m ByteString\npCSSWhite = B.singleton <$> P.space <* P.spaces\n\npCSSComment :: PandocMonad m => ParsecT ByteString () m ByteString\npCSSComment = P.try $ do\n  P.string \"/*\"\n  P.manyTill P.anyChar (P.try (P.string \"*/\"))\n  return B.empty\n\npCSSOther :: PandocMonad m => ParsecT ByteString () m ByteString\npCSSOther =\n  (B.pack <$> P.many1 (P.noneOf \"u/ \\n\\r\\t\")) <|>\n  (B.singleton <$> P.char 'u') <|>\n  (B.singleton <$> P.char '/')\n\npCSSUrl :: PandocMonad m\n        => FilePath -> ParsecT ByteString () m ByteString\npCSSUrl d = P.try $ do\n  res <- pUrl >>= handleCSSUrl d\n  case res of\n       Left b -> return b\n       Right (mt,b) -> do\n         let enc = makeDataURI (mt, b)\n         return $ fromText $ \"url(\" <> enc <> \")\"\n\npQuoted :: PandocMonad m\n        => ParsecT ByteString () m (T.Text, ByteString)\npQuoted = P.try $ do\n  quote <- P.oneOf \"\\\"'\"\n  url <- T.pack <$> P.manyTill P.anyChar (P.char quote)\n  let fallback = fromText $ T.singleton quote <> trim url <> T.singleton quote\n  return (url, fallback)\n\npUrl :: PandocMonad m\n     => ParsecT ByteString () m (T.Text, ByteString)\npUrl = P.try $ do\n  P.string \"url(\"\n  P.spaces\n  quote <- P.option Nothing (Just <$> P.oneOf \"\\\"'\")\n  url <- T.pack <$> P.manyTill P.anyChar (maybe (P.lookAhead (P.char ')')) P.char quote)\n  P.spaces\n  P.char ')'\n  let fallback = fromText (\"url(\" <> maybe \"\" T.singleton quote <> trim url <>\n                            maybe \"\" T.singleton quote <> \")\")\n  return (url, fallback)\n\nhandleCSSUrl :: PandocMonad m\n             => FilePath -> (T.Text, ByteString)\n             -> ParsecT ByteString () m\n                  (Either ByteString (MimeType, ByteString))\nhandleCSSUrl d (url, fallback) =\n  case escapeURIString (/='|') (T.unpack $ trim url) of\n      '#':_ -> return $ Left fallback\n      'd':'a':'t':'a':':':_ -> return $ Left fallback\n      u ->  do let url' = if isURI (T.pack u) then T.pack u else T.pack (d </> u)\n               res <- lift $ getData \"\" url'\n               case res of\n                    AlreadyDataURI uri -> return $ Left (fromText $ \"url(\" <> uri <> \")\")\n                    Fetched (mt', raw) -> do\n                      -- note that the downloaded CSS may\n                      -- itself contain url(...).\n                      (mt, b) <- if \"text/css\" `T.isPrefixOf` mt'\n                                    -- see #5725: in HTML5, content type\n                                    -- isn't allowed on style type attribute\n                                    then (\"text/css\",) <$> cssURLs d raw\n                                    else return (mt', raw)\n                      return $ Right (mt, b)\n                    CouldNotFetch _ -> return $ Left fallback\n\ndata GetDataResult =\n    AlreadyDataURI T.Text\n  | CouldNotFetch PandocError\n  | Fetched (MimeType, ByteString)\n  deriving (Show)\n\ngetData :: PandocMonad m\n        => MimeType -> T.Text\n        -> m GetDataResult\ngetData mimetype src\n  | \"data:\" `T.isPrefixOf` src = return $ AlreadyDataURI src -- already data: uri\n  | otherwise = catchError fetcher handler\n where\n   fetcher = do\n      let ext = T.toLower $ T.pack $ takeExtension $ T.unpack src\n      (raw, respMime) <- fetchItem src\n      let raw' = if ext `elem` [\".gz\", \".svgz\"]\n                 then B.concat $ L.toChunks $ Gzip.decompress $ L.fromChunks [raw]\n                 else raw\n      let mime = case (mimetype, respMime) of\n                  (\"\",Nothing) -> \"application/octet-stream\"\n                  (x, Nothing) -> x\n                  (_, Just x ) -> x\n      result <- if \"text/css\" `T.isPrefixOf` mime\n                then do\n                  oldInputs <- getInputFiles\n                  setInputFiles [T.unpack src]\n                  res <- cssURLs (takeDirectory $ T.unpack src) raw'\n                  setInputFiles oldInputs\n                  return res\n               else return raw'\n      return $ Fetched (mime, result)\n   handler e\n      -- If fetch failed and we have a fragment and/or query,\n      -- try the fetch again without these, since the resource\n      -- may be local (see #1477, #11021)\n     | T.any (\\c -> c == '?' || c == '#') src && not (isURI src)\n       = getData mimetype (removeQueryAndFragment src)\n     | otherwise\n       = case e of\n          PandocResourceNotFound r -> do\n            report $ CouldNotFetchResource r \"\"\n            return $ CouldNotFetch e\n          PandocHttpError u er -> do\n            report $ CouldNotFetchResource u er\n            return $ CouldNotFetch e\n          _ -> throwError e\n   removeQueryAndFragment = T.takeWhile (\\c -> c /= '#' && c /= '?')\n\n-- | Convert HTML into self-contained HTML, incorporating images,\n-- scripts, and CSS using data: URIs.\nmakeSelfContained :: PandocMonad m => T.Text -> m T.Text\nmakeSelfContained inp = do\n  let tags = parseTags inp\n  let html5 = case tags of\n                  (TagOpen \"!DOCTYPE\" [(\"html\",\"\")]:_) -> True\n                  _ -> False\n  let convertState = ConvertState { isHtml5 = html5,\n                                    svgMap = mempty }\n  out' <- evalStateT (convertTags tags) convertState\n  return $ renderTags' out'\n"
  },
  {
    "path": "src/Text/Pandoc/Shared.hs",
    "content": "{-# LANGUAGE CPP                   #-}\n{-# LANGUAGE FlexibleContexts      #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE ScopedTypeVariables   #-}\n{-# LANGUAGE ViewPatterns          #-}\n{-# LANGUAGE FlexibleInstances     #-}\n{-# LANGUAGE LambdaCase            #-}\n{-# LANGUAGE OverloadedStrings     #-}\n{- |\n   Module      : Text.Pandoc.Shared\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nUtility functions and definitions used by the various Pandoc modules.\n-}\nmodule Text.Pandoc.Shared (\n                     -- * List processing\n                     splitBy,\n                     splitTextBy,\n                     splitTextByIndices,\n                     -- * Text processing\n                     inquotes,\n                     tshow,\n                     stripTrailingNewlines,\n                     trim,\n                     triml,\n                     trimr,\n                     trimMath,\n                     stripFirstAndLast,\n                     camelCaseToHyphenated,\n                     camelCaseStrToHyphenated,\n                     toRomanNumeral,\n                     tabFilter,\n                     -- * Date/time\n                     normalizeDate,\n                     -- * Pandoc block and inline list processing\n                     addPandocAttributes,\n                     orderedListMarkers,\n                     extractSpaces,\n                     removeFormatting,\n                     deNote,\n                     stringify,\n                     capitalize,\n                     compactify,\n                     compactifyDL,\n                     linesToPara,\n                     figureDiv,\n                     makeSections,\n                     makeSectionsWithOffsets,\n                     combineAttr,\n                     uniqueIdent,\n                     inlineListToIdentifier,\n                     textToIdentifier,\n                     isHeaderBlock,\n                     hasLineBreaks,\n                     onlySimpleTableCells,\n                     isTightList,\n                     taskListItemFromAscii,\n                     taskListItemToAscii,\n                     handleTaskListItem,\n                     addMetaField,\n                     htmlSpanLikeElements,\n                     formatCode,\n                     -- * TagSoup HTML handling\n                     renderTags',\n                     -- * File handling\n                     inDirectory,\n                     makeCanonical,\n                     collapseFilePath,\n                     filteredFilesFromArchive,\n                     -- * for squashing blocks\n                     blocksToInlines,\n                     blocksToInlines',\n                     blocksToInlinesWithSep,\n                     defaultBlocksSeparator,\n                     -- * Safe read\n                     safeRead,\n                     safeStrRead\n                    ) where\n\nimport Codec.Archive.Zip\nimport qualified Control.Exception as E\nimport Control.Monad (MonadPlus (..), msum, unless)\nimport qualified Control.Monad.State.Strict as S\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Char (isAlpha, isLower, isSpace, isUpper, toLower, isAlphaNum,\n                  generalCategory, GeneralCategory(NonSpacingMark,\n                  SpacingCombiningMark, EnclosingMark, ConnectorPunctuation))\nimport Data.List (find, groupBy, intercalate, intersperse, union)\nimport qualified Data.List as L\nimport qualified Data.Map as M\nimport Data.Maybe (mapMaybe)\nimport Data.Monoid (Any (..) )\nimport Data.Semigroup (Min (..))\nimport Data.Sequence (ViewL (..), ViewR (..), viewl, viewr)\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport qualified Text.Emoji as Emoji\nimport System.Directory\nimport System.FilePath (isPathSeparator, splitDirectories)\nimport qualified System.FilePath.Posix as Posix\nimport Text.HTML.TagSoup (RenderOptions (..), Tag (..), renderOptions,\n                          renderTagsOptions)\nimport Text.Pandoc.Builder (Blocks, Inlines, ToMetaValue (..))\nimport qualified Text.Pandoc.Builder as B\nimport Data.Time\nimport Text.Pandoc.Asciify (toAsciiText)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Extensions (Extensions, Extension(..), extensionEnabled)\nimport Text.DocLayout (charWidth)\nimport Text.Pandoc.Walk\n-- for addPandocAttributes:\nimport Commonmark.Pandoc (Cm(..))\nimport Commonmark (HasAttributes(..))\n\n--\n-- List processing\n--\n\n-- | Split list by groups of one or more sep.\nsplitBy :: (a -> Bool) -> [a] -> [[a]]\nsplitBy _ [] = []\nsplitBy isSep lst =\n  let (first, rest) = break isSep lst\n  in  first:splitBy isSep (dropWhile isSep rest)\n\n-- | Split text by groups of one or more separator.\nsplitTextBy :: (Char -> Bool) -> T.Text -> [T.Text]\nsplitTextBy isSep t\n  | T.null t = []\n  | otherwise = let (first, rest) = T.break isSep t\n                in  first : splitTextBy isSep (T.dropWhile isSep rest)\n\n-- | Split text at the given widths. Note that the break points are\n-- /not/ indices but text widths, which will be different for East Asian\n-- characters, emojis, etc.\nsplitTextByIndices :: [Int] -> T.Text -> [T.Text]\nsplitTextByIndices ns = splitTextByRelIndices (zipWith (-) ns (0:ns)) . T.unpack\n where\n  splitTextByRelIndices [] cs = [T.pack cs]\n  splitTextByRelIndices (x:xs) cs =\n    let (first, rest) = splitAt' x cs\n     in T.pack first : splitTextByRelIndices xs rest\n\n-- | Returns a pair whose first element is a prefix of @t@ and that has\n-- width @n@, and whose second is the remainder of the string.\n--\n-- Note: Do *not* replace this with 'T.splitAt', which is not sensitive\n-- to character widths!\nsplitAt' :: Int {-^ n -} -> [Char] {-^ t -} -> ([Char],[Char])\nsplitAt' _ []          = ([],[])\nsplitAt' n xs | n <= 0 = ([],xs)\nsplitAt' n (x:xs)      = (x:ys,zs)\n  where (ys,zs) = splitAt' (n - charWidth x) xs\n\n--\n-- Text processing\n--\n\n-- | Wrap double quotes around a Text\ninquotes :: T.Text -> T.Text\ninquotes txt = T.cons '\\\"' (T.snoc txt '\\\"')\n\n-- | Like @'show'@, but returns a 'T.Text' instead of a 'String'.\ntshow :: Show a => a -> T.Text\ntshow = T.pack . show\n\n-- | Strip trailing newlines from string.\nstripTrailingNewlines :: T.Text -> T.Text\nstripTrailingNewlines = T.dropWhileEnd (== '\\n')\n\n-- | Returns 'True' for an ASCII whitespace character, viz. space,\n-- carriage return, newline, and horizontal tab.\nisWS :: Char -> Bool\nisWS ' '  = True\nisWS '\\r' = True\nisWS '\\n' = True\nisWS '\\t' = True\nisWS _    = False\n\n-- | Remove leading and trailing space (including newlines) from string.\ntrim :: T.Text -> T.Text\ntrim = T.dropAround isWS\n\n-- | Remove leading space (including newlines) from string.\ntriml :: T.Text -> T.Text\ntriml = T.dropWhile isWS\n\n-- | Remove trailing space (including newlines) from string.\ntrimr :: T.Text -> T.Text\ntrimr = T.dropWhileEnd isWS\n\n-- | Trim leading space and trailing space unless after \\.\ntrimMath :: T.Text -> T.Text\ntrimMath = triml . T.reverse . stripBeginSpace . T.reverse -- no Text.spanEnd\n  where\n    stripBeginSpace t\n      | T.null pref = t\n      | Just ('\\\\', _) <- T.uncons suff = T.cons (T.last pref) suff\n      | otherwise = suff\n      where\n        (pref, suff) = T.span isWS t\n\n-- | Strip leading and trailing characters from string\nstripFirstAndLast :: T.Text -> T.Text\nstripFirstAndLast t = case T.uncons t of\n  Just (_, t') -> case T.unsnoc t' of\n    Just (t'', _) -> t''\n    _             -> t'\n  _               -> \"\"\n\n-- | Change CamelCase word to hyphenated lowercase (e.g., camel-case).\ncamelCaseToHyphenated :: T.Text -> T.Text\ncamelCaseToHyphenated = T.pack . camelCaseStrToHyphenated . T.unpack\n\n-- This may not work as expected on general Unicode, if it contains\n-- letters with a longer lower case form than upper case. I don't know\n-- what the camel case practices of affected scripts are, though.\ncamelCaseStrToHyphenated :: String -> String\ncamelCaseStrToHyphenated [] = \"\"\ncamelCaseStrToHyphenated (a:b:rest)\n  | isLower a\n  , isUpper b = a:'-':toLower b:camelCaseStrToHyphenated rest\n-- handle ABCDef = abc-def\ncamelCaseStrToHyphenated (a:b:c:rest)\n  | isUpper a\n  , isUpper b\n  , isLower c = toLower a:'-':toLower b:camelCaseStrToHyphenated (c:rest)\ncamelCaseStrToHyphenated (a:rest) = toLower a:camelCaseStrToHyphenated rest\n\n-- | Convert number < 4000 to uppercase roman numeral.\ntoRomanNumeral :: Int -> T.Text\ntoRomanNumeral x\n  | x >= 4000 || x < 0 = \"?\"\n  | x >= 1000 = \"M\" <> toRomanNumeral (x - 1000)\n  | x >= 900  = \"CM\" <> toRomanNumeral (x - 900)\n  | x >= 500  = \"D\" <> toRomanNumeral (x - 500)\n  | x >= 400  = \"CD\" <> toRomanNumeral (x - 400)\n  | x >= 100  = \"C\" <> toRomanNumeral (x - 100)\n  | x >= 90   = \"XC\" <> toRomanNumeral (x - 90)\n  | x >= 50   = \"L\"  <> toRomanNumeral (x - 50)\n  | x >= 40   = \"XL\" <> toRomanNumeral (x - 40)\n  | x >= 10   = \"X\" <> toRomanNumeral (x - 10)\n  | x == 9    = \"IX\"\n  | x >= 5    = \"V\" <> toRomanNumeral (x - 5)\n  | x == 4    = \"IV\"\n  | x >= 1    = \"I\" <> toRomanNumeral (x - 1)\n  | otherwise = \"\"\n\n-- | Convert tabs to spaces. Tabs will be preserved if tab stop is set to 0.\ntabFilter :: Int       -- ^ Tab stop\n          -> T.Text    -- ^ Input\n          -> T.Text\ntabFilter 0 = id\ntabFilter tabStop = T.unlines . map go . T.lines\n  where go s =\n         let (s1, s2) = T.break (== '\\t') s\n         in  if T.null s2\n                then s1\n                else s1 <> T.replicate\n                       (tabStop - (T.length s1 `mod` tabStop)) (T.pack \" \")\n                       <> go (T.drop 1 s2)\n\n--\n-- Date/time\n--\n\n-- | Parse a date and convert (if possible) to \"YYYY-MM-DD\" format. We\n-- limit years to the range 1601-9999 (ISO 8601 accepts greater than\n-- or equal to 1583, but MS Word only accepts dates starting 1601).\nnormalizeDate :: T.Text -> Maybe T.Text\nnormalizeDate = fmap T.pack . normalizeDate' . T.unpack\n\n-- | Like @'normalizeDate'@, but acts on 'String' instead of 'T.Text'.\nnormalizeDate' :: String -> Maybe String\nnormalizeDate' s = fmap (formatTime defaultTimeLocale \"%F\")\n  (msum $ map (\\fs -> parsetimeWith fs s >>= rejectBadYear) formats :: Maybe Day)\n  where rejectBadYear day = case toGregorian day of\n          (y, _, _) | y >= 1601 && y <= 9999 -> Just day\n          _         -> Nothing\n        parsetimeWith = parseTimeM True defaultTimeLocale\n        formats = [\"%x\",\"%m/%d/%Y\", \"%D\",\"%F\", \"%d %b %Y\",\n                    \"%e %B %Y\", \"%b. %e, %Y\", \"%B %e, %Y\",\n                    \"%Y%m%d\", \"%Y%m\", \"%Y\"]\n\n--\n-- Pandoc block and inline list processing\n--\n\n-- | Add key-value attributes to a pandoc element. If the element\n-- does not have a slot for attributes, create an enclosing Span\n-- (for Inlines) or Div (for Blocks).  Note that both 'Cm () Inlines'\n-- and 'Cm () Blocks' are instances of 'HasAttributes'.\naddPandocAttributes\n  :: forall b . HasAttributes (Cm () b) => [(T.Text, T.Text)] -> b -> b\naddPandocAttributes [] bs = bs\naddPandocAttributes kvs bs =\n  unCm . addAttributes kvs $ (Cm bs :: Cm () b)\n\n-- | Generate infinite lazy list of markers for an ordered list,\n-- depending on list attributes.\norderedListMarkers :: (Int, ListNumberStyle, ListNumberDelim) -> [T.Text]\norderedListMarkers (start, numstyle, numdelim) =\n  let nums = case numstyle of\n                     DefaultStyle -> map tshow [start..]\n                     Example      -> map tshow [start..]\n                     Decimal      -> map tshow [start..]\n                     UpperAlpha   -> drop (start - 1) $ cycle $\n                                     map T.singleton ['A'..'Z']\n                     LowerAlpha   -> drop (start - 1) $ cycle $\n                                     map T.singleton ['a'..'z']\n                     UpperRoman   -> map toRomanNumeral [start..]\n                     LowerRoman   -> map (T.toLower . toRomanNumeral) [start..]\n      inDelim str = case numdelim of\n                            DefaultDelim -> str <> \".\"\n                            Period       -> str <> \".\"\n                            OneParen     -> str <> \")\"\n                            TwoParens    -> \"(\" <> str <> \")\"\n  in  map inDelim nums\n\n\n-- | Extract the leading and trailing spaces from inside an inline element\n-- and place them outside the element.  SoftBreaks count as Spaces for\n-- these purposes.\nextractSpaces :: (Inlines -> Inlines) -> Inlines -> Inlines\nextractSpaces f is =\n  let contents = B.unMany is\n      left  = case viewl contents of\n                    (Space :< _)     -> B.space\n                    (SoftBreak :< _) -> B.softbreak\n                    _                -> mempty\n      right = case viewr contents of\n                    (_ :> Space)     -> B.space\n                    (_ :> SoftBreak) -> B.softbreak\n                    _                -> mempty in\n  (left <> f (B.trimInlines . B.Many $ contents) <> right)\n\n-- | Extract inlines, removing formatting.\nremoveFormatting :: Walkable Inline a => a -> [Inline]\nremoveFormatting = query go . walk (deNote . deQuote)\n  where go :: Inline -> [Inline]\n        go (Str xs)   = [Str xs]\n        go Space      = [Space]\n        go SoftBreak  = [SoftBreak]\n        go (Code _ x) = [Str x]\n        go (Math _ x) = [Str x]\n        go LineBreak  = [Space]\n        go _          = []\n\n-- | Replaces 'Note' elements with empty strings.\ndeNote :: Inline -> Inline\ndeNote (Note _) = Str \"\"\ndeNote x        = x\n\n-- | Convert pandoc structure to a string with formatting removed.\n-- Footnotes are skipped (since we don't want their contents in link\n-- labels).\nstringify :: Walkable Inline a => a -> T.Text\nstringify = query go . walk fixInlines\n  where go :: Inline -> T.Text\n        go Space                                       = \" \"\n        go SoftBreak                                   = \" \"\n        go (Str x)                                     = x\n        go (Code _ x)                                  = x\n        go (Math _ x)                                  = x\n        go (RawInline (Format \"html\") (T.unpack -> ('<':'b':'r':_)))\n                                                       = \" \" -- see #2105\n        go LineBreak                                   = \" \"\n        go _                                           = \"\"\n\n        fixInlines :: Inline -> Inline\n        fixInlines (Cite _ ils) = Cite [] ils\n        fixInlines (Note _) = Note []\n        fixInlines (q@Quoted{}) = deQuote q\n        fixInlines x = x\n\n-- | Unwrap 'Quoted' inline elements, enclosing the contents with\n-- English-style Unicode quotes instead.\ndeQuote :: Inline -> Inline\ndeQuote (Quoted SingleQuote xs) =\n  Span (\"\",[],[]) (Str \"\\8216\" : xs ++ [Str \"\\8217\"])\ndeQuote (Quoted DoubleQuote xs) =\n  Span (\"\",[],[]) (Str \"\\8220\" : xs ++ [Str \"\\8221\"])\ndeQuote x = x\n\n-- | Bring all regular text in a pandoc structure to uppercase.\n--\n-- This function correctly handles cases where a lowercase character doesn't\n-- match to a single uppercase character – e.g. “Straße” would be converted\n-- to “STRASSE”, not “STRAßE”.\ncapitalize :: Walkable Inline a => a -> a\ncapitalize = walk go\n  where go :: Inline -> Inline\n        go (Str s) = Str $ T.toUpper s\n        go x       = x\n\n-- | Change final list item from @Para@ to @Plain@ if the list contains\n-- no other @Para@ blocks.  Otherwise (if the list items contain @Para@\n-- blocks besides possibly at the end), turn any @Plain@s into @Para@s (#5285).\ncompactify :: [Blocks]  -- ^ List of list items (each a list of blocks)\n           -> [Blocks]\ncompactify [] = []\ncompactify items =\n  let (others, final) = (init items, last items)\n  in  case reverse (B.toList final) of\n           (Para a:xs)\n             | null [Para x | Para x <- xs ++ concatMap B.toList others]\n             -> others ++ [B.fromList (reverse (Plain a : xs))]\n           _ | null [Para x | Para x <- concatMap B.toList items]\n             -> items\n           _ -> map (fmap plainToPara) items\n\nplainToPara :: Block -> Block\nplainToPara (Plain ils) = Para ils\nplainToPara x = x\n\n\n-- | Like @compactify@, but acts on items of definition lists.\ncompactifyDL :: [(Inlines, [Blocks])] -> [(Inlines, [Blocks])]\ncompactifyDL items =\n  case reverse items of\n        ((t,ds):ys) ->\n           case reverse (map (reverse . B.toList) ds) of\n             ((Para x:xs) : zs) | not (any isPara xs) ->\n                  reverse ys ++\n                    [(t, reverse (map B.fromList zs) ++\n                         [B.fromList (reverse (Plain x:xs))])]\n             _     -> items\n        _          -> items\n\n\n-- | Combine a list of lines by adding hard linebreaks.\ncombineLines :: [[Inline]] -> [Inline]\ncombineLines = intercalate [LineBreak]\n\n-- | Convert a list of lines into a paragraph with hard line breaks. This is\n--   useful e.g. for rudimentary support of LineBlock elements in writers.\nlinesToPara :: [[Inline]] -> Block\nlinesToPara = Para . combineLines\n\n-- | Creates a Div block from figure components. The intended use is in\n-- writers of formats that do not have markup support for figures.\n--\n-- The resulting div is given the class @figure@ and contains the figure\n-- body and the figure caption. The latter is wrapped in a 'Div' of\n-- class @caption@, with the stringified @short-caption@ as attribute.\nfigureDiv :: Attr -> Caption -> [Block] -> Block\nfigureDiv (ident, classes, kv) (Caption shortcapt longcapt) body =\n  let divattr = ( ident\n              , [\"figure\"] `union` classes\n              , kv\n              )\n      captkv = maybe mempty (\\s -> [(\"short-caption\", stringify s)]) shortcapt\n      capt = [Div (\"\", [\"caption\"], captkv) longcapt | not (null longcapt)]\n  in Div divattr (body ++ capt)\n\n-- | Returns 'True' iff the given element is a 'Para'.\nisPara :: Block -> Bool\nisPara (Para _) = True\nisPara _        = False\n\n-- | Convert Pandoc inline list to plain text identifier.\ninlineListToIdentifier :: Extensions -> [Inline] -> T.Text\ninlineListToIdentifier exts =\n  textToIdentifier exts . stringify . unEmojify\n  where\n    unEmojify :: [Inline] -> [Inline]\n    unEmojify\n      | extensionEnabled Ext_gfm_auto_identifiers exts ||\n        extensionEnabled Ext_ascii_identifiers exts = walk unEmoji\n      | otherwise = id\n    unEmoji (Span (\"\",[\"emoji\"],[(\"data-emoji\",ename)]) _) = Str ename\n    unEmoji (Str t) = Str (Emoji.replaceEmojis emojisToAliases t)\n    unEmoji x = x\n    emojisToAliases t [] = t\n    emojisToAliases _ (a:_) = a\n\n-- | Convert string to plain text identifier.\ntextToIdentifier :: Extensions -> T.Text -> T.Text\ntextToIdentifier exts =\n  dropNonLetter . filterAscii . toIdent\n  where\n    dropNonLetter\n      | extensionEnabled Ext_gfm_auto_identifiers exts = id\n      | otherwise = T.dropWhile (not . isAlpha)\n    filterAscii\n      | extensionEnabled Ext_ascii_identifiers exts\n        = toAsciiText\n      | otherwise = id\n    toIdent\n      | extensionEnabled Ext_gfm_auto_identifiers exts =\n        filterPunct . spaceToDash . T.toLower\n      | otherwise = T.intercalate \"-\" . T.words . filterPunct . T.toLower\n    filterPunct = T.filter (\\c -> isSpace c || isAlphaNum c || isAllowedPunct c)\n    isAllowedPunct c\n      | extensionEnabled Ext_gfm_auto_identifiers exts\n        = c == '-' || c == '_' ||\n          generalCategory c `elem` [NonSpacingMark, SpacingCombiningMark,\n                                    EnclosingMark, ConnectorPunctuation]\n      | otherwise = c == '_' || c == '-' || c == '.'\n    spaceToDash = T.map (\\c -> if isSpace c then '-' else c)\n\n\n-- | Put a list of Pandoc blocks into a hierarchical structure:\n-- a list of sections (each a Div with class \"section\" and first\n-- element a Header).  If the 'numbering' parameter is True, Header\n-- numbers are added via the number attribute on the header.\n-- If the baseLevel parameter is Just n, Header levels are\n-- adjusted so that the lowest header level is n.\n-- (There may still be gaps in header level if the author leaves them.)\nmakeSections :: Bool -> Maybe Int -> [Block] -> [Block]\nmakeSections = makeSectionsWithOffsets []\n\n-- | Like 'makeSections', but with a parameter for number offsets\n-- (a list of 'Int's, the first of which is added to the level 1\n-- section number, the second to the level 2, and so on).\nmakeSectionsWithOffsets :: [Int] -> Bool -> Maybe Int -> [Block] -> [Block]\nmakeSectionsWithOffsets numoffsets numbering mbBaseLevel bs =\n  S.evalState (go bs) numoffsets\n where\n  getLevel (Header level _ _) = Min level\n  getLevel _ = Min 99\n  minLevel = if all (== 0) numoffsets\n                then getMin $ query getLevel bs\n                else 1 -- see #5071, for backwards compatibility\n  go :: [Block] -> S.State [Int] [Block]\n  go (Header level (ident,classes,kvs) title':xs) = do\n    lastnum <- S.get\n    let level' = maybe level (\\n -> n + level - minLevel) mbBaseLevel\n    let adjustNum lev numComponent\n          | lev < level = numComponent\n          | lev == level = numComponent + 1\n          | otherwise = 0\n    let newnum = zipWith adjustNum [minLevel..level]\n                    (lastnum ++ repeat 0)\n    unless (null newnum || \"unnumbered\" `elem` classes) $ S.put newnum\n    let (sectionContents, rest) = break (headerLtEq level) xs\n    sectionContents' <- go sectionContents\n    rest' <- go rest\n    let kvs' = -- don't touch number if already present\n               case lookup \"number\" kvs of\n                  Nothing | numbering\n                          , \"unnumbered\" `notElem` classes ->\n                        (\"number\", T.intercalate \".\" (map tshow newnum)) : kvs\n                  _ -> kvs\n    let divattr = (ident, \"section\":classes, kvs')\n    let isHeadingAttr (\"epub:type\",_) = False\n        isHeadingAttr (\"role\",v) =\n          v `elem` [\"tab\", \"presentation\", \"none\", \"treeitem\",\n                    \"menuitem\", \"button\", \"heading\"]\n        isHeadingAttr _ = True\n    let hattr = (\"\",classes, filter isHeadingAttr kvs')\n    return $\n      Div divattr (Header level' hattr title' : sectionContents') : rest'\n  go (Div divattr@(dident,dclasses,_) (Header level hattr title':ys) : xs)\n      | all (\\case\n               Header level' _ _ -> level' > level\n               _                 -> True) ys\n      , \"column\" `notElem` dclasses\n      , \"columns\" `notElem` dclasses\n      , \"fragment\" `notElem` dclasses = do\n    inner <- go (Header level hattr title':ys)\n    rest <- go xs\n    return $\n      case inner of\n            [Div divattr'@(dident',_,_) zs]\n              | T.null dident || T.null dident' || dident == dident'\n              -> Div (combineAttr divattr' divattr) zs : rest\n            _ -> Div divattr inner : rest\n  go (Div attr xs : rest) = do\n    xs' <- go xs\n    rest' <- go rest\n    return $ Div attr xs' : rest'\n  go (x:xs) = (x :) <$> go xs\n  go [] = return []\n\n-- | Combine two 'Attr'. Classes are concatenated.  For the id and key-value\n-- attributes, the first one takes precedence in case of duplicates.\ncombineAttr :: Attr -> Attr -> Attr\ncombineAttr (id1, classes1, kvs1) (id2, classes2, kvs2) =\n  (if T.null id1 then id2 else id1,\n   nubOrd (classes1 ++ classes2),\n   foldr (\\(k,v) kvs -> case lookup k kvs of\n                           Nothing -> (k,v):kvs\n                           Just _  -> kvs) kvs1 kvs2)\n\nheaderLtEq :: Int -> Block -> Bool\nheaderLtEq level (Header l _ _)  = l <= level\nheaderLtEq level (Div _ (b:_))   = headerLtEq level b\nheaderLtEq _ _                   = False\n\n-- | Generate a unique identifier from a list of inlines.\n-- Second argument is a list of already used identifiers.\nuniqueIdent :: Extensions -> [Inline] -> Set.Set T.Text -> T.Text\nuniqueIdent exts title' usedIdents =\n  if baseIdent `Set.member` usedIdents\n     then maybe baseIdent numIdent\n          $ find (\\x -> numIdent x `Set.notMember` usedIdents) ([1..60000] :: [Int])\n          -- if we have more than 60,000, allow repeats\n     else baseIdent\n  where\n    baseIdent = case inlineListToIdentifier exts title' of\n                     \"\" -> \"section\"\n                     x  -> x\n    numIdent n = baseIdent <> \"-\" <> tshow n\n\n-- | True if inlines include a LineBreak (possibly embedded), with the exception\n-- of line breaks in Notes.\nhasLineBreaks :: [Inline] -> Bool\nhasLineBreaks = getAny . query isLineBreak . walk removeNote\n  where\n    removeNote :: Inline -> Inline\n    removeNote (Note _) = Str \"\"\n    removeNote x        = x\n    isLineBreak :: Inline -> Any\n    isLineBreak LineBreak = Any True\n    isLineBreak _         = Any False\n\n-- | True if block is a Header block.\nisHeaderBlock :: Block -> Bool\nisHeaderBlock Header{} = True\nisHeaderBlock _        = False\n\n-- | Detect if table rows contain only cells consisting of a single\n-- paragraph that has no @LineBreak@.\nonlySimpleTableCells :: [[[Block]]] -> Bool\nonlySimpleTableCells = all isSimpleCell . concat\n  where\n    isSimpleCell [Plain ils] = not (hasLineBreak ils)\n    isSimpleCell [Para ils ] = not (hasLineBreak ils)\n    isSimpleCell []          = True\n    isSimpleCell _           = False\n    hasLineBreak = getAny . query isLineBreak\n    isLineBreak LineBreak = Any True\n    isLineBreak _         = Any False\n\n-- | Detect if a list is tight.\nisTightList :: [[Block]] -> Bool\nisTightList = all isPlainItem\n  where\n    isPlainItem [] = True\n    isPlainItem (Plain _ : _) = True\n    isPlainItem [BulletList xs] = isTightList xs\n    isPlainItem [OrderedList _ xs] = isTightList xs\n    isPlainItem _ = False\n\n-- | Convert a list item containing tasklist syntax (e.g. @[x]@)\n-- to using @U+2610 BALLOT BOX@ or @U+2612 BALLOT BOX WITH X@.\ntaskListItemFromAscii :: Extensions -> [Block] -> [Block]\ntaskListItemFromAscii = handleTaskListItem fromMd\n  where\n    fromMd (Str \"[\" : Space : Str \"]\" : Space : is) = Str \"☐\" : Space : is\n    fromMd (Str \"[x]\"                 : Space : is) = Str \"☒\" : Space : is\n    fromMd (Str \"[X]\"                 : Space : is) = Str \"☒\" : Space : is\n    fromMd is = is\n\n-- | Convert a list item containing text starting with @U+2610 BALLOT BOX@\n-- or @U+2612 BALLOT BOX WITH X@ to tasklist syntax (e.g. @[x]@).\ntaskListItemToAscii :: Extensions -> [Block] -> [Block]\ntaskListItemToAscii = handleTaskListItem toMd\n  where\n    toMd (Str \"☐\" : Space : is) = rawMd \"[ ]\" : Space : is\n    toMd (Str \"☒\" : Space : is) = rawMd \"[x]\" : Space : is\n    toMd (Str \"❏\" : Space : is) = rawMd \"[ ]\" : Space : is\n    toMd (Str \"✓\" : Space : is) = rawMd \"[x]\" : Space : is\n    toMd is = is\n    rawMd = RawInline (Format \"markdown\")\n\nhandleTaskListItem :: ([Inline] -> [Inline]) -> Extensions -> [Block] -> [Block]\nhandleTaskListItem handleInlines exts bls =\n  if Ext_task_lists `extensionEnabled` exts\n  then handleItem bls\n  else bls\n  where\n    handleItem (Plain is : bs) = Plain (handleInlines is) : bs\n    handleItem (Para is  : bs) = Para  (handleInlines is) : bs\n    handleItem bs = bs\n\n-- | Set a field of a 'Meta' object.  If the field already has a value,\n-- convert it into a list with the new value appended to the old value(s).\naddMetaField :: ToMetaValue a\n             => T.Text\n             -> a\n             -> Meta\n             -> Meta\naddMetaField key val (Meta meta) =\n  Meta $ M.insertWith combine key (toMetaValue val) meta\n  where combine newval (MetaList xs) = MetaList (xs ++ tolist newval)\n        combine newval x             = MetaList [x, newval]\n        tolist (MetaList ys) = ys\n        tolist y             = [y]\n\n-- | Set of HTML elements that are represented as Span with a class equal as\n-- the element tag itself.\nhtmlSpanLikeElements :: Set.Set T.Text\nhtmlSpanLikeElements = Set.fromList [\"kbd\", \"mark\", \"dfn\", \"abbr\"]\n\n-- | Reformat 'Inlines' as code, putting the stringlike parts in 'Code'\n-- elements while bringing other inline formatting outside.\n-- The idea is that e.g. `[Str \"a\",Space,Strong [Str \"b\"]]` should turn\n-- into `[Code (\"\",[],[]) \"a \", Strong [Code (\"\",[],[]) \"b\"]]`.\n-- This helps work around the limitation that pandoc's Code element can\n-- only contain string content (see issue #7525).\nformatCode :: Attr -> Inlines -> Inlines\nformatCode attr = B.fromList . walk fmt . B.toList\n  where\n    isPlaintext (Str _) = True\n    isPlaintext Space = True\n    isPlaintext SoftBreak = True\n    isPlaintext (Quoted _ _) = True\n    isPlaintext _ = False\n    fmt = concatMap go . groupBy (\\a b -> isPlaintext a && isPlaintext b)\n      where\n        go xs\n          | all isPlaintext xs = B.toList $ B.codeWith attr $ stringify xs\n          | otherwise = xs\n\n--\n-- TagSoup HTML handling\n--\n\n-- | Render HTML tags.\nrenderTags' :: [Tag T.Text] -> T.Text\nrenderTags' = renderTagsOptions\n               renderOptions{ optMinimize = matchTags [\"hr\", \"br\", \"img\",\n                                                       \"meta\", \"link\", \"col\",\n                                                       \"use\", \"path\", \"rect\"]\n                            , optRawTag   = matchTags [\"script\", \"style\"] }\n              where matchTags tags = flip elem tags . T.toLower\n\n--\n-- File handling\n--\n\n-- | Perform an IO action in a directory, returning to starting directory.\ninDirectory :: FilePath -> IO a -> IO a\ninDirectory path action = E.bracket\n                             getCurrentDirectory\n                             setCurrentDirectory\n                             (const $ setCurrentDirectory path >> action)\n\n-- | Canonicalizes a file path by removing redundant @.@ and @..@.\nmakeCanonical :: FilePath -> FilePath\nmakeCanonical = Posix.joinPath . transformPathParts . splitDirectories\n where  transformPathParts = reverse . L.foldl' go []\n        go as        \".\"  = as\n        go (\"..\":as) \"..\" = [\"..\", \"..\"] <> as\n        go (_:as)    \"..\" = as\n        go as        x    = x : as\n\n-- | Remove intermediate \".\" and \"..\" directories from a path.\n--\n-- > collapseFilePath \"./foo\" == \"foo\"\n-- > collapseFilePath \"/bar/../baz\" == \"/baz\"\n-- > collapseFilePath \"/../baz\" == \"/../baz\"\n-- > collapseFilePath \"parent/foo/baz/../bar\" ==  \"parent/foo/bar\"\n-- > collapseFilePath \"parent/foo/baz/../../bar\" ==  \"parent/bar\"\n-- > collapseFilePath \"parent/foo/..\" ==  \"parent\"\n-- > collapseFilePath \"/parent/foo/../../bar\" ==  \"/bar\"\ncollapseFilePath :: FilePath -> FilePath\ncollapseFilePath = Posix.joinPath . reverse . L.foldl' go [] . splitDirectories\n  where\n    go rs \".\" = rs\n    go r@(p:rs) \"..\" = case p of\n                            \"..\"                              -> \"..\":r\n                            (checkPathSeperator -> Just True) -> \"..\":r\n                            _                                 -> rs\n    go _ (checkPathSeperator -> Just True) = [[Posix.pathSeparator]]\n    go rs x = x:rs\n    isSingleton []  = Nothing\n    isSingleton [x] = Just x\n    isSingleton _   = Nothing\n    checkPathSeperator = fmap isPathSeparator . isSingleton\n\n--\n-- File selection from the archive\n--\nfilteredFilesFromArchive :: Archive -> (FilePath -> Bool) -> [(FilePath, BL.ByteString)]\nfilteredFilesFromArchive zf f =\n  mapMaybe (fileAndBinary zf) (filter f (filesInArchive zf))\n  where\n    fileAndBinary :: Archive -> FilePath -> Maybe (FilePath, BL.ByteString)\n    fileAndBinary a fp = findEntryByPath fp a >>= \\e -> Just (fp, fromEntry e)\n\n---\n--- Squash blocks into inlines\n---\n\nblockToInlines :: Block -> Inlines\nblockToInlines (Plain ils) = B.fromList ils\nblockToInlines (Para ils) = B.fromList ils\nblockToInlines (LineBlock lns) = B.fromList $ combineLines lns\nblockToInlines (CodeBlock attr str) = B.codeWith attr str\nblockToInlines (RawBlock (Format fmt) str) = B.rawInline fmt str\nblockToInlines (BlockQuote blks) = blocksToInlines' blks\nblockToInlines (OrderedList _ blkslst) =\n  mconcat $ map blocksToInlines' blkslst\nblockToInlines (BulletList blkslst) =\n  mconcat $ map blocksToInlines' blkslst\nblockToInlines (DefinitionList pairslst) =\n  mconcat $ map f pairslst\n  where\n    f (ils, blkslst) = B.fromList ils <> B.str \":\" <> B.space <>\n      mconcat (map blocksToInlines' blkslst)\nblockToInlines (Header _ _  ils) = B.fromList ils\nblockToInlines HorizontalRule = mempty\nblockToInlines (Table _ _ _ (TableHead _ hbd) bodies (TableFoot _ fbd)) =\n  mconcat $ intersperse B.linebreak $\n    map (mconcat . map blocksToInlines') (plainRowBody <$> hbd <> unTableBodies bodies <> fbd)\n  where\n    plainRowBody (Row _ body) = cellBody <$> body\n    cellBody (Cell _ _ _ _ body) = body\n    unTableBody (TableBody _ _ hd bd) = hd <> bd\n    unTableBodies = concatMap unTableBody\nblockToInlines (Div _ blks) = blocksToInlines' blks\nblockToInlines (Figure _ _ body) = blocksToInlines' body\n\nblocksToInlinesWithSep :: Inlines -> [Block] -> Inlines\nblocksToInlinesWithSep sep =\n  mconcat . intersperse sep . map blockToInlines\n\nblocksToInlines' :: [Block] -> Inlines\nblocksToInlines' = blocksToInlinesWithSep defaultBlocksSeparator\n\nblocksToInlines :: [Block] -> [Inline]\nblocksToInlines = B.toList . blocksToInlines'\n\n-- | Inline elements used to separate blocks when squashing blocks into\n-- inlines.\ndefaultBlocksSeparator :: Inlines\ndefaultBlocksSeparator =\n  -- This is used in the pandoc.utils.blocks_to_inlines function. Docs\n  -- there should be updated if this is changed.\n  B.linebreak\n\n--\n-- Safe read\n--\n\nsafeRead :: (MonadPlus m, Read a) => T.Text -> m a\nsafeRead = safeStrRead . T.unpack\n\nsafeStrRead :: (MonadPlus m, Read a) => String -> m a\nsafeStrRead s = case reads s of\n                  (d,x):_\n                    | all isSpace x -> return d\n                  _                 -> mzero\n"
  },
  {
    "path": "src/Text/Pandoc/Slides.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Slides\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nUtility functions for splitting documents into slides for slide\nshow formats (dzslides, revealjs, s5, slidy, slideous, beamer).\n-}\nmodule Text.Pandoc.Slides ( getSlideLevel, prepSlides ) where\nimport Text.Pandoc.Definition\n\n-- | Find level of header that starts slides (defined as the least header\n-- level that occurs before a non-header/non-hrule in the blocks).\ngetSlideLevel :: [Block] -> Int\ngetSlideLevel = go 6\n  where go least (Header n _ _ : x : xs)\n                 | n < least && nonHOrHR x = go n xs\n                 | otherwise               = go least (x:xs)\n        go least (Div _ bs : xs) = min (go least bs) (go least xs)\n        go least (_ : xs) = go least xs\n        go least [] = least\n        nonHOrHR Header{}       = False\n        nonHOrHR HorizontalRule = False\n        nonHOrHR _              = True\n\n-- | Prepare a block list to be passed to makeSections.\nprepSlides :: Int -> [Block] -> [Block]\nprepSlides slideLevel = ensureStartWithH . splitHrule . extractRefsHeader\n  where splitHrule (HorizontalRule : Header n attr xs : ys)\n                       | n == slideLevel = Header slideLevel attr xs : splitHrule ys\n        splitHrule (HorizontalRule : xs) = Header slideLevel nullAttr [Str \"\\0\"] :\n                                           splitHrule xs\n        splitHrule (x : xs)              = x : splitHrule xs\n        splitHrule []                    = []\n        extractRefsHeader bs             =\n          case reverse bs of\n               (Div (\"refs\",classes,kvs) (Header n attrs xs : ys) : zs)\n                 -> reverse zs ++ [Header n attrs xs,\n                                   Div (\"refs\",classes,kvs) ys]\n               _ -> bs\n        ensureStartWithH bs@(Header n _ _:_)\n                       | n <= slideLevel = bs\n        ensureStartWithH bs@(Div _ (Header n _ _:_) : _)\n                       | n <= slideLevel = bs\n        ensureStartWithH bs              = Header slideLevel nullAttr [Str \"\\0\"] : bs\n"
  },
  {
    "path": "src/Text/Pandoc/Sources.hs",
    "content": "{-# LANGUAGE BangPatterns #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Sources\n   Copyright   : Copyright (C) 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nDefines Sources object to be used as input to pandoc parsers and redefines Char\nparsers so they get source position information from it.\n-}\n\nmodule Text.Pandoc.Sources\n  ( Sources(..)\n  , ToSources(..)\n  , UpdateSourcePos(..)\n  , sourcesToText\n  , initialSourceName\n  , addToSources\n  , ensureFinalNewlines\n  , addToInput\n  , satisfy\n  , oneOf\n  , noneOf\n  , anyChar\n  , char\n  , string\n  , newline\n  , space\n  , spaces\n  , letter\n  , digit\n  , hexDigit\n  , alphaNum\n  )\nwhere\nimport qualified Text.Parsec as P\nimport Text.Parsec (Stream(..), ParsecT)\nimport Text.Parsec.Pos as P\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Char (isSpace, isLetter, isAlphaNum, isDigit, isHexDigit)\nimport Data.String (IsString(..))\nimport qualified Data.List.NonEmpty as NonEmpty\n\n-- | A list of inputs labeled with source positions.  It is assumed\n-- that the 'Text's have @\\n@ line endings.\nnewtype Sources = Sources { unSources :: [(SourcePos, Text)] }\n  deriving (Show, Semigroup, Monoid)\n\ninstance Monad m => Stream Sources m Char where\n  uncons (Sources []) = return Nothing\n  uncons (Sources ((pos,t):rest)) =\n    case T.uncons t of\n      Nothing -> uncons (Sources rest)\n      Just (c,t') -> return $ Just (c, Sources ((pos,t'):rest))\n\ninstance IsString Sources where\n  fromString s = Sources [(P.initialPos \"\", T.pack (filter (/='\\r') s))]\n\nclass ToSources a where\n  toSources :: a -> Sources\n\ninstance ToSources Text where\n  toSources t = Sources [(P.initialPos \"\", T.filter (/='\\r') t)]\n\ninstance ToSources [(FilePath, Text)] where\n  toSources = Sources\n            . map (\\(fp,t) ->\n                    (P.initialPos fp, T.snoc (T.filter (/='\\r') t) '\\n'))\n\ninstance ToSources Sources where\n  toSources = id\n\nsourcesToText :: Sources -> Text\nsourcesToText (Sources xs) = mconcat $ map snd xs\n\naddToSources :: Monad m => SourcePos -> Text -> ParsecT Sources u m ()\naddToSources pos t = do\n  curpos <- P.getPosition\n  Sources xs <- P.getInput\n  let xs' = case xs of\n               [] -> []\n               ((_,t'):rest) -> (curpos,t'):rest\n  P.setInput $ Sources ((pos, T.filter (/='\\r') t):xs')\n\nensureFinalNewlines :: Int -- ^ number of trailing newlines\n                    -> Sources\n                    -> Sources\nensureFinalNewlines n (Sources xs) =\n  case NonEmpty.nonEmpty xs of\n    Nothing -> Sources [(initialPos \"\", T.replicate n \"\\n\")]\n    Just lst ->\n      case NonEmpty.last lst of\n        (spos, t) ->\n          case T.length (T.takeWhileEnd (=='\\n') t) of\n            len | len >= n -> Sources xs\n                | otherwise -> Sources (NonEmpty.init lst ++\n                                        [(spos,\n                                          t <> T.replicate (n - len) \"\\n\")])\n\nclass UpdateSourcePos s c where\n  updateSourcePos :: SourcePos -> c -> s -> SourcePos\n\ninstance UpdateSourcePos Text Char where\n   updateSourcePos pos c _ = updatePosChar pos c\n\ninstance UpdateSourcePos [Char] Char where\n   updateSourcePos pos c _ = updatePosChar pos c\n\ninstance UpdateSourcePos BS.ByteString Char where\n   updateSourcePos pos c _ = updatePosChar pos c\n\ninstance UpdateSourcePos BL.ByteString Char where\n   updateSourcePos pos c _ = updatePosChar pos c\n\ninstance UpdateSourcePos Sources Char where\n   updateSourcePos pos c sources =\n     case sources of\n       Sources [] -> updatePosChar pos c\n       Sources ((_,t):(pos',_):_)\n         | T.null t  -> pos'\n       Sources _ ->\n           case c of\n             '\\n' -> incSourceLine (setSourceColumn pos 1) 1\n             '\\t' -> incSourceColumn pos (4 - ((sourceColumn pos - 1) `mod` 4))\n             _    -> incSourceColumn pos 1\n\n-- | Get name of first source in 'Sources'.\ninitialSourceName :: Sources -> FilePath\ninitialSourceName (Sources []) = \"\"\ninitialSourceName (Sources ((pos,_):_)) = sourceName pos\n\n-- | Add some text to the beginning of the input sources.\n-- This simplifies code that expands macros.\naddToInput :: Monad m => Text -> ParsecT Sources u m ()\naddToInput t = do\n  Sources xs <- P.getInput\n  case xs of\n    [] -> P.setInput $ Sources [(initialPos \"\",t)]\n    (pos,t'):rest -> P.setInput $ Sources ((pos, t <> t'):rest)\n\n-- We need to redefine the parsers in Text.Parsec.Char so that they\n-- update source positions properly from the Sources stream.\n\nsatisfy :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n         => (Char -> Bool) -> ParsecT s u m Char\nsatisfy f = P.tokenPrim show updateSourcePos matcher\n where\n  matcher !c = if f c then Just c else Nothing\n\noneOf :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n      => [Char] -> ParsecT s u m Char\noneOf cs = satisfy (`elem` cs)\n\nnoneOf :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n       => [Char] -> ParsecT s u m Char\nnoneOf cs = satisfy (`notElem` cs)\n\nanyChar :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n        => ParsecT s u m Char\nanyChar = satisfy (const True)\n\nchar :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n     => Char -> ParsecT s u m Char\nchar c = satisfy (== c)\n\nstring :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n       => [Char] -> ParsecT s u m [Char]\nstring = mapM char\n\nnewline :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n        => ParsecT s u m Char\nnewline = satisfy (== '\\n')\n\nspace :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n      => ParsecT s u m Char\nspace = satisfy isSpace\n\nspaces :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n       => ParsecT s u m ()\nspaces = P.skipMany space P.<?> \"white space\"\n\nletter :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n       => ParsecT s u m Char\nletter = satisfy isLetter\n\nalphaNum :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n         => ParsecT s u m Char\nalphaNum = satisfy isAlphaNum\n\ndigit :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n      => ParsecT s u m Char\ndigit = satisfy isDigit\n\nhexDigit :: (Monad m, Stream s m Char, UpdateSourcePos s Char)\n         => ParsecT s u m Char\nhexDigit = satisfy isHexDigit\n"
  },
  {
    "path": "src/Text/Pandoc/TeX.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{- |\n   Module      : Text.Pandoc.TeX\n   Copyright   : Copyright (C) 2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTypes for TeX tokens and macros.\n-}\nmodule Text.Pandoc.TeX ( Tok(..)\n                       , TokType(..)\n                       , Macro(..)\n                       , ArgSpec(..)\n                       , ExpansionPoint(..)\n                       , MacroScope(..)\n                       , SourcePos\n                       )\nwhere\nimport Data.Text (Text)\nimport Text.Parsec (SourcePos, sourceName)\nimport Text.Pandoc.Sources\nimport Data.List (groupBy)\n\ndata TokType = CtrlSeq Text | Spaces | Newline | Symbol | Word | Comment |\n               Esc1    | Esc2   | Arg Int  | DeferredArg Int\n     deriving (Eq, Ord, Show)\n\ndata Tok = Tok SourcePos TokType Text\n     deriving (Eq, Ord, Show)\n\ninstance ToSources [Tok] where\n  toSources = Sources\n    . map (\\ts -> case ts of\n                    Tok p _ _ : _ -> (p, mconcat $ map tokToText ts)\n                    _ -> error \"toSources [Tok] encountered empty group\")\n    . groupBy (\\(Tok p1 _ _) (Tok p2 _ _) -> sourceName p1 == sourceName p2)\n\ntokToText :: Tok -> Text\ntokToText (Tok _ _ t) = t\n\ndata ExpansionPoint = ExpandWhenDefined | ExpandWhenUsed\n     deriving (Eq, Ord, Show)\n\ndata MacroScope = GlobalScope | GroupScope\n  deriving (Eq, Ord, Show)\n\ndata Macro = Macro MacroScope ExpansionPoint [ArgSpec] (Maybe [Tok]) [Tok]\n     deriving Show\n\ndata ArgSpec = ArgNum Int | Pattern [Tok]\n     deriving Show\n"
  },
  {
    "path": "src/Text/Pandoc/Templates.hs",
    "content": "{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Templates\n   Copyright   : Copyright (C) 2009-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nUtility functions for working with pandoc templates.\n\n'WithDefaultPartials' and 'WithPartials' are Monad wrappers. Wrapping\nthese around an instance of 'PandocMonad' gives different instances of\n'TemplateMonad', with different search behaviors when retrieving\npartials.\n\nTo compile a template and limit partial search to pandoc’s data files,\nuse @runWithDefaultPartials (compileTemplate ...)@.\n\nTo compile a template and allow partials to be found locally (either on\nthe file system or via HTTP, in the event that the main template has an\nabsolute URL), ue @runWithPartials (compileTemplate ...)@.\n\n'getTemplate' seeks a template locally, or via HTTP if the template has\nan absolute URL, falling back to the data files if not found.\n\n-}\n\nmodule Text.Pandoc.Templates ( Template\n                             , WithDefaultPartials(..)\n                             , WithPartials(..)\n                             , compileTemplate\n                             , renderTemplate\n                             , getTemplate\n                             , getDefaultTemplate\n                             , compileDefaultTemplate\n                             ) where\n\nimport System.FilePath ((<.>), (</>), takeFileName)\nimport Text.DocTemplates (Template, TemplateMonad(..), compileTemplate, renderTemplate)\nimport Text.Pandoc.Class.CommonState (CommonState(..))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, fetchItem,\n                                      getCommonState, modifyCommonState,\n                                      toTextM)\nimport Text.Pandoc.Data (readDataFile)\nimport Control.Monad.Except (catchError, throwError)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Error\nimport System.IO.Error (isDoesNotExistError)\n\n-- | Wrap a Monad in this if you want partials to\n-- be taken only from the default data files.\nnewtype WithDefaultPartials m a = WithDefaultPartials { runWithDefaultPartials :: m a }\n deriving (Functor, Applicative, Monad)\n\n-- | Wrap a Monad in this if you want partials to\n-- be looked for locally (or, when the main template\n-- is at a URL, via HTTP), falling back to default data files.\nnewtype WithPartials m a = WithPartials { runWithPartials :: m a }\n deriving (Functor, Applicative, Monad)\n\ninstance PandocMonad m => TemplateMonad (WithDefaultPartials m) where\n  getPartial fp = WithDefaultPartials $\n    readDataFile (\"templates\" </> takeFileName fp) >>= toTextM fp\n\ninstance PandocMonad m => TemplateMonad (WithPartials m) where\n  getPartial fp = WithPartials $ getTemplate fp\n\n-- | Retrieve text for a template.\ngetTemplate :: PandocMonad m => FilePath -> m Text\ngetTemplate tp =\n  ((do surl <- stSourceURL <$> getCommonState\n       -- we don't want to look for templates remotely\n       -- unless the full URL is specified:\n       modifyCommonState $ \\st -> st{\n         stSourceURL = Nothing }\n       (bs, _) <- fetchItem $ T.pack tp\n       modifyCommonState $ \\st -> st{\n         stSourceURL = surl }\n       return bs)\n   `catchError`\n   (\\e -> case e of\n             PandocResourceNotFound _ ->\n                -- see #5987 on reason for takeFileName\n                readDataFile (\"templates\" </> takeFileName tp)\n             PandocIOError _ ioe | isDoesNotExistError ioe ->\n                -- see #5987 on reason for takeFileName\n                readDataFile (\"templates\" </> takeFileName tp)\n             _ -> throwError e)) >>= toTextM tp\n\n-- | Get default template for the specified writer.\ngetDefaultTemplate :: PandocMonad m\n                   => Text           -- ^ Name of writer\n                   -> m Text\ngetDefaultTemplate format = do\n  case format of\n       \"native\"  -> return \"\"\n       \"csljson\" -> return \"\"\n       \"json\"    -> return \"\"\n       \"xml\"     -> return \"\"\n       \"fb2\"     -> return \"\"\n       \"pptx\"    -> return \"\"\n       \"ipynb\"   -> return \"\"\n       \"asciidoctor\" -> getDefaultTemplate \"asciidoc\"\n       \"asciidoc_legacy\" -> getDefaultTemplate \"asciidoc\"\n       \"docx\"    -> getDefaultTemplate \"openxml\"\n       \"odt\"     -> getDefaultTemplate \"opendocument\"\n       \"html\"    -> getDefaultTemplate \"html5\"\n       \"docbook\" -> getDefaultTemplate \"docbook5\"\n       \"epub\"    -> getDefaultTemplate \"epub3\"\n       \"jats\"    -> getDefaultTemplate \"jats_archiving\"\n       \"markdown_strict\"   -> getDefaultTemplate \"markdown\"\n       \"multimarkdown\"     -> getDefaultTemplate \"markdown\"\n       \"markdown_github\"   -> getDefaultTemplate \"markdown\"\n       \"markdown_mmd\"      -> getDefaultTemplate \"markdown\"\n       \"markdown_phpextra\" -> getDefaultTemplate \"markdown\"\n       \"gfm\"               -> getDefaultTemplate \"commonmark\"\n       \"commonmark_x\"      -> getDefaultTemplate \"commonmark\"\n       \"bbcode_phpbb\"      -> getDefaultTemplate \"bbcode\"\n       \"bbcode_fluxbb\"     -> getDefaultTemplate \"bbcode\"\n       \"bbcode_steam\"      -> getDefaultTemplate \"bbcode\"\n       \"bbcode_hubzilla\"   -> getDefaultTemplate \"bbcode\"\n       \"bbcode_xenforo\"    -> getDefaultTemplate \"bbcode\"\n       _        -> do\n         let fname = \"templates\" </> \"default\" <.> T.unpack format\n         readDataFile fname >>= toTextM fname\n\n-- | Get and compile default template for the specified writer.\n-- Raise an error on compilation failure.\ncompileDefaultTemplate :: PandocMonad m\n                       => Text\n                       -> m (Template Text)\ncompileDefaultTemplate writer = do\n  res <- getDefaultTemplate writer >>=\n          runWithDefaultPartials .\n           compileTemplate (\"templates/default.\" <> T.unpack writer)\n  case res of\n    Left e   -> throwError $ PandocTemplateError (T.pack e)\n    Right t  -> return t\n"
  },
  {
    "path": "src/Text/Pandoc/Transforms.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE StrictData          #-}\n{- |\n   Module      : Text.Pandoc.Transforms\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n\nTransformation of a Pandoc document post-parsing\n-}\nmodule Text.Pandoc.Transforms\n  ( Transform\n  , applyTransforms\n  , adjustLinksAndIds\n  , eastAsianLineBreakFilter\n  , filterIpynbOutput\n  , headerShift\n  ) where\n\nimport Data.List (sortOn)\nimport Data.Text (Text)\nimport Network.URI (unEscapeString)\nimport Text.DocLayout (charWidth)\nimport Text.Pandoc.Definition\n  ( Pandoc (..), Attr, Block (..), Format (..), Inline (..) )\nimport Text.Pandoc.Generic (bottomUp)\nimport Text.Pandoc.Options (Extensions)\nimport Text.Pandoc.Shared (stringify, textToIdentifier)\nimport Text.Pandoc.Walk (walk)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\n\n-- | Transformation of a Pandoc document post-parsing\ntype Transform = Pandoc -> Pandoc\n\n-- | Apply a list of transforms to a document, in order.\napplyTransforms :: Monad m => [Transform] -> Pandoc -> m Pandoc\napplyTransforms transforms d = return $ foldr ($) d transforms\n\n-- | Prefixes identifiers with a string derived from the filepath of\n-- @thisfile@; fixes links to targets in @allfiles@ accordingly.\nadjustLinksAndIds :: Extensions        -- ^ defines how IDs are generated\n                  -> Text              -- ^ thisfile\n                  -> [Text]            -- ^ allfiles\n                  -> Transform\nadjustLinksAndIds exts thisfile allfiles\n  | length allfiles > 1 = walk fixInline . walk fixBlock\n  | otherwise           = id\n where\n  -- fix ids in blocks\n  fixBlock :: Block -> Block\n  fixBlock (CodeBlock attr t) = CodeBlock (fixAttrs attr) t\n  fixBlock (Header lev attr ils) = Header lev (fixAttrs attr) ils\n  fixBlock (Table attr cap cols th tbs tf) =\n     Table (fixAttrs attr) cap cols th tbs tf\n  fixBlock (Div attr bs) = Div (fixAttrs attr) bs\n  fixBlock x = x\n\n  -- fix ids and links in inlines\n  fixInline :: Inline -> Inline\n  fixInline (Code attr t) = Code (fixAttrs attr) t\n  fixInline (Link attr ils (url,tit)) =\n    Link (fixAttrs attr) ils (fixURL url,tit)\n  fixInline (Image attr ils (url,tit)) =\n    Image (fixAttrs attr) ils (fixURL url,tit)\n  fixInline (Span attr ils) = Span (fixAttrs attr) ils\n  fixInline x = x\n\n  -- add thisfile as prefix of identifier\n  fixAttrs :: Attr -> Attr\n  fixAttrs (i,cs,kvs)\n    | T.null i = (i,cs,kvs)\n    | otherwise =\n        (T.intercalate \"__\"\n          (filter (not . T.null) [toIdent thisfile, i]),\n        cs, kvs)\n\n  -- turns a filepath into an identifier\n  toIdent :: Text -> Text\n  toIdent = textToIdentifier exts . T.intercalate \"__\" .\n            T.split (\\c -> c == '/' || c == '\\\\')\n\n  -- if URL begins with file from allfiles, convert to\n  -- an internal link with the appropriate identifier\n  fixURL :: Text -> Text\n  fixURL u =\n    let (a,b) = T.break (== '#') $ T.pack . unEscapeString . T.unpack $ u\n        filepart = if T.null a\n                      then toIdent thisfile\n                      else toIdent a\n        fragpart = T.dropWhile (== '#') b\n     in if T.null a || a `elem` allfiles\n           then \"#\" <> T.intercalate \"__\"\n                         (filter (not . T.null) [filepart, fragpart])\n           else u\n\n-- | Process ipynb output cells.  If mode is Nothing,\n-- remove all output.  If mode is Just format, select\n-- best output for the format.  If format is not ipynb,\n-- strip out ANSI escape sequences from CodeBlocks (see #5633).\nfilterIpynbOutput :: Maybe Format -> Pandoc -> Pandoc\nfilterIpynbOutput mode = walk go\n  where go (Div (ident, \"output\":os, kvs) bs) =\n          case mode of\n            Nothing  -> Div (ident, \"output\":os, kvs) []\n            -- \"best\" for ipynb includes all formats:\n            Just fmt\n              | fmt == Format \"ipynb\"\n                          -> Div (ident, \"output\":os, kvs) bs\n              | otherwise -> Div (ident, \"output\":os, kvs) $\n                              walk removeANSI $\n                              take 1 $ sortOn rank bs\n                 where\n                  rank (RawBlock (Format \"html\") _)\n                    | fmt == Format \"html\" = 1 :: Int\n                    | fmt == Format \"markdown\" = 3\n                    | otherwise = 4\n                  rank (RawBlock (Format \"latex\") _)\n                    | fmt == Format \"latex\" = 1\n                    | fmt == Format \"markdown\" = 3\n                    | otherwise = 4\n                  rank (RawBlock f _)\n                    | fmt == f = 1\n                    | otherwise = 4\n                  rank (Para [Image{}]) = 2\n                  rank _ = 3\n                  removeANSI (CodeBlock attr code) =\n                    CodeBlock attr (removeANSIEscapes code)\n                  removeANSI x = x\n                  removeANSIEscapes t\n                    | Just cs <- T.stripPrefix \"\\x1b[\" t =\n                        removeANSIEscapes $ T.drop 1 $ T.dropWhile (/='m') cs\n                    | Just (c, cs) <- T.uncons t = T.cons c $ removeANSIEscapes cs\n                    | otherwise = \"\"\n        go x = x\n\n-- | Remove soft breaks between East Asian characters.\neastAsianLineBreakFilter :: Pandoc -> Pandoc\neastAsianLineBreakFilter = bottomUp go\n  where go (x:SoftBreak:y:zs)\n          | Just (_, b) <- T.unsnoc $ stringify x\n          , Just (c, _) <- T.uncons $ stringify y\n          , charWidth b == 2\n          , charWidth c == 2\n          = x:y:zs\n          | otherwise\n          = x:SoftBreak:y:zs\n        go xs\n          = xs\n\n-- | Shift header levels up or down.\nheaderShift :: Int -> Pandoc -> Pandoc\nheaderShift n (Pandoc meta (Header m _ ils : bs))\n  | n < 0\n  , m + n == 0 = headerShift n $\n                 B.setTitle (B.fromList ils) $ Pandoc meta bs\n-- for this case, see #10459:\nheaderShift n (Pandoc meta (Div attr@(_,\"section\":_,_) (Header m _ ils : as) : bs))\n  | n < 0\n  , m + n == 0 = headerShift n $\n                 B.setTitle (B.fromList ils) $ Pandoc meta (Div attr as : bs)\nheaderShift n (Pandoc meta bs) = Pandoc meta (walk shift bs)\n\n where\n   shift :: Block -> Block\n   shift (Header level attr inner)\n     | level + n > 0  = Header (level + n) attr inner\n     | otherwise      = Para inner\n   shift x            = x\n"
  },
  {
    "path": "src/Text/Pandoc/Translations/Types.hs",
    "content": "{-# LANGUAGE CPP                        #-}\n{-# LANGUAGE DeriveGeneric              #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\n   Module      : Text.Pandoc.Translations.Types\n   Copyright   : Copyright (C) 2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nData types for localization.\n\nTranslations are stored in @data/translations/langname.trans@,\nwhere langname can be the full BCP47 language specifier, or\njust the language part.  File format is:\n\n> # A comment, ignored\n> Figure: Figura\n> Index: Indeksi\n\n-}\nmodule Text.Pandoc.Translations.Types (\n                           Term(..)\n                         , Translations\n                         , lookupTerm\n                         )\nwhere\nimport Data.Aeson.Types (Value(..), FromJSON(..))\nimport qualified Data.Aeson.Types as Aeson\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport GHC.Generics (Generic)\nimport Text.Pandoc.Shared (safeRead)\n\ndata Term =\n    Abstract\n  | Appendix\n  | Bibliography\n  | Cc\n  | Chapter\n  | Contents\n  | Encl\n  | Figure\n  | Glossary\n  | Index\n  | Listing\n  | ListOfFigures\n  | ListOfTables\n  | Page\n  | Part\n  | Preface\n  | Proof\n  | References\n  | See\n  | SeeAlso\n  | Table\n  | To\n  deriving (Show, Eq, Ord, Generic, Enum, Read)\n\nnewtype Translations = Translations (M.Map Term T.Text)\n        deriving (Show, Generic, Semigroup, Monoid)\n\ninstance FromJSON Term where\n  parseJSON (String t) = case safeRead t of\n                               Just t' -> pure t'\n                               Nothing -> Prelude.fail $ \"Invalid Term name \" ++\n                                                 show t\n  parseJSON invalid = Aeson.typeMismatch \"Term\" invalid\n\ninstance FromJSON Translations where\n  parseJSON o@(Object{}) = do\n    xs <- parseJSON o >>= mapM addItem . M.toList\n    return $ Translations (M.fromList xs)\n    where addItem (k,v) =\n            case safeRead k of\n                 Nothing -> Prelude.fail $ \"Invalid Term name \" ++ show k\n                 Just t  ->\n                   case v of\n                        (String s) -> return (t, T.strip s)\n                        inv        -> Aeson.typeMismatch \"String\" inv\n  parseJSON invalid = Aeson.typeMismatch \"Translations\" invalid\n\n-- | Lookup a term in a 'Translations'.\nlookupTerm :: Term -> Translations -> Maybe T.Text\nlookupTerm t (Translations tm) = M.lookup t tm\n"
  },
  {
    "path": "src/Text/Pandoc/Translations.hs",
    "content": "{-# LANGUAGE CPP                        #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{- |\n   Module      : Text.Pandoc.Translations\n   Copyright   : Copyright (C) 2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions for getting localized translations of terms.\n-}\nmodule Text.Pandoc.Translations (\n                           module Text.Pandoc.Translations.Types\n                         , readTranslations\n                         , getTranslations\n                         , setTranslations\n                         , translateTerm\n                         )\nwhere\nimport Text.Pandoc.Translations.Types\nimport Text.Pandoc.Class (PandocMonad(..), toTextM, report)\nimport Text.Pandoc.Class.CommonState (CommonState(..))\nimport Text.Pandoc.Data (readDataFile)\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Logging (LogMessage(..))\nimport Control.Monad.Except (catchError)\nimport qualified Data.Text as T\nimport qualified Data.Yaml as Yaml\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Data.Yaml (prettyPrintParseException)\nimport Text.Collate.Lang (Lang(..), renderLang)\n\n-- | Parse YAML translations.\nreadTranslations :: T.Text -> Either T.Text Translations\nreadTranslations s =\n  case Yaml.decodeAllEither' $ UTF8.fromText s of\n       Left err' -> Left $ T.pack $ prettyPrintParseException err'\n       Right (t:_)     -> Right t\n       Right []        -> Left \"empty YAML document\"\n\n-- | Select the language to use with 'translateTerm'.\n-- Note that this does not read a translation file;\n-- that is only done the first time 'translateTerm' is\n-- used.\nsetTranslations :: PandocMonad m => Lang -> m ()\nsetTranslations lang =\n  modifyCommonState $ \\st -> st{ stTranslations = Just (lang, Nothing) }\n\n-- | Load term map.\ngetTranslations :: PandocMonad m => m Translations\ngetTranslations = do\n  mbtrans <- getsCommonState stTranslations\n  case mbtrans of\n       Nothing -> return mempty  -- no language defined\n       Just (_, Just t) -> return t\n       Just (lang, Nothing) -> do  -- read from file\n         let translationFile = \"translations/\" <> renderLang lang <> \".yaml\"\n         let fallbackFile = \"translations/\" <> langLanguage lang <> \".yaml\"\n         let getTrans fp = do\n               txt <- readDataFile fp >>= toTextM fp\n               case readTranslations txt of\n                    Left e   -> do\n                      report $ CouldNotLoadTranslations (renderLang lang)\n                        (T.pack fp <> \": \" <> e)\n                      -- make sure we don't try again...\n                      modifyCommonState $ \\st ->\n                        st{ stTranslations = Nothing }\n                      return mempty\n                    Right t -> do\n                      modifyCommonState $ \\st ->\n                                  st{ stTranslations = Just (lang, Just t) }\n                      return t\n         catchError (getTrans $ T.unpack translationFile)\n           (\\_ ->\n             catchError (getTrans $ T.unpack fallbackFile)\n               (\\e -> do\n                 report $ CouldNotLoadTranslations (renderLang lang)\n                          $ case e of\n                               PandocCouldNotFindDataFileError _ ->\n                                 \"data file \" <> fallbackFile <> \" not found\"\n                               _ -> \"\"\n                 -- make sure we don't try again...\n                 modifyCommonState $ \\st -> st{ stTranslations = Nothing }\n                 return mempty))\n\n-- | Get a translation from the current term map.\n-- Issue a warning if the term is not defined.\ntranslateTerm :: PandocMonad m => Term -> m T.Text\ntranslateTerm term = do\n  translations <- getTranslations\n  case lookupTerm term translations of\n       Just s -> return s\n       Nothing -> do\n         report $ NoTranslation $ T.pack $ show term\n         return \"\"\n"
  },
  {
    "path": "src/Text/Pandoc/URI.hs",
    "content": "{-# LANGUAGE ViewPatterns #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE CPP #-}\n{- |\n   Module      : Text.Pandoc.URI\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.URI ( urlEncode\n                       , escapeURI\n                       , isURI\n                       , schemes\n                       , uriPathToPath\n                       , pBase64DataURI\n                       ) where\nimport qualified Network.HTTP.Types as HTTP\nimport Data.ByteString.Base64 (decodeLenient)\nimport Text.Pandoc.MIME (MimeType)\nimport qualified Data.ByteString as B\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Data.Text as T\nimport qualified Data.Set as Set\nimport Data.Char (isSpace, isAscii, isHexDigit, chr)\nimport Safe (readMay)\nimport Network.URI (URI (uriScheme), parseURI, escapeURIString)\nimport qualified Data.Attoparsec.Text as A\nimport Data.Text.Encoding (encodeUtf8)\nimport Control.Applicative (many, (<|>))\n\nurlEncode :: T.Text -> T.Text\nurlEncode = UTF8.toText . HTTP.urlEncode True . UTF8.fromText\n\n-- | Escape whitespace and some punctuation characters in URI.\nescapeURI :: T.Text -> T.Text\nescapeURI = T.pack . escapeURIString (not . needsEscaping) . T.unpack\n  where needsEscaping c = isSpace c || T.any (== c) \"<>|\\\"{}[]^`\"\n\n--\n-- IANA URIs\n--\n\n-- | Schemes from http://www.iana.org/assignments/uri-schemes.html plus\n-- the unofficial schemes doi, javascript, isbn, pmid.\nschemes :: Set.Set T.Text\nschemes = Set.fromList\n  -- Official IANA schemes\n  [ \"aaa\", \"aaas\", \"about\", \"acap\", \"acct\", \"acr\", \"adiumxtra\", \"afp\", \"afs\"\n  , \"aim\", \"appdata\", \"apt\", \"attachment\", \"aw\", \"barion\", \"beshare\", \"bitcoin\"\n  , \"blob\", \"bolo\", \"browserext\", \"callto\", \"cap\", \"chrome\", \"chrome-extension\"\n  , \"cid\", \"coap\", \"coaps\", \"com-eventbrite-attendee\", \"content\", \"crid\", \"cvs\"\n  , \"data\", \"dav\", \"dict\", \"dis\", \"dlna-playcontainer\", \"dlna-playsingle\"\n  , \"dns\", \"dntp\", \"dtn\", \"dvb\", \"ed2k\", \"example\", \"facetime\", \"fax\", \"feed\"\n  , \"feedready\", \"file\", \"filesystem\", \"finger\", \"fish\", \"ftp\", \"geo\", \"gg\"\n  , \"git\", \"gizmoproject\", \"go\", \"gopher\", \"graph\", \"gtalk\", \"h323\", \"ham\"\n  , \"hcp\", \"http\", \"https\", \"hxxp\", \"hxxps\", \"hydrazone\", \"iax\", \"icap\", \"icon\"\n  , \"im\", \"imap\", \"info\", \"iotdisco\", \"ipn\", \"ipp\", \"ipps\", \"irc\", \"irc6\"\n  , \"ircs\", \"iris\", \"iris.beep\", \"iris.lwz\", \"iris.xpc\", \"iris.xpcs\"\n  , \"isostore\", \"itms\", \"jabber\", \"jar\", \"jms\", \"keyparc\", \"lastfm\", \"ldap\"\n  , \"ldaps\", \"lvlt\", \"magnet\", \"mailserver\", \"mailto\", \"maps\", \"market\"\n  , \"message\", \"mid\", \"mms\", \"modem\", \"mongodb\", \"moz\", \"ms-access\"\n  , \"ms-browser-extension\", \"ms-drive-to\", \"ms-enrollment\", \"ms-excel\"\n  , \"ms-gamebarservices\", \"ms-getoffice\", \"ms-help\", \"ms-infopath\"\n  , \"ms-media-stream-id\", \"ms-officeapp\", \"ms-project\", \"ms-powerpoint\"\n  , \"ms-publisher\", \"ms-search-repair\", \"ms-secondary-screen-controller\"\n  , \"ms-secondary-screen-setup\", \"ms-settings\", \"ms-settings-airplanemode\"\n  , \"ms-settings-bluetooth\", \"ms-settings-camera\", \"ms-settings-cellular\"\n  , \"ms-settings-cloudstorage\", \"ms-settings-connectabledevices\"\n  , \"ms-settings-displays-topology\", \"ms-settings-emailandaccounts\"\n  , \"ms-settings-language\", \"ms-settings-location\", \"ms-settings-lock\"\n  , \"ms-settings-nfctransactions\", \"ms-settings-notifications\"\n  , \"ms-settings-power\", \"ms-settings-privacy\", \"ms-settings-proximity\"\n  , \"ms-settings-screenrotation\", \"ms-settings-wifi\", \"ms-settings-workplace\"\n  , \"ms-spd\", \"ms-sttoverlay\", \"ms-transit-to\", \"ms-virtualtouchpad\"\n  , \"ms-visio\", \"ms-walk-to\", \"ms-whiteboard\", \"ms-whiteboard-cmd\", \"ms-word\"\n  , \"msnim\", \"msrp\", \"msrps\", \"mtqp\", \"mumble\", \"mupdate\", \"mvn\", \"news\", \"nfs\"\n  , \"ni\", \"nih\", \"nntp\", \"notes\", \"ocf\", \"oid\", \"onenote\", \"onenote-cmd\"\n  , \"opaquelocktoken\", \"pack\", \"palm\", \"paparazzi\", \"pkcs11\", \"platform\", \"pop\"\n  , \"pres\", \"prospero\", \"proxy\", \"pwid\", \"psyc\", \"qb\", \"query\", \"redis\"\n  , \"rediss\", \"reload\", \"res\", \"resource\", \"rmi\", \"rsync\", \"rtmfp\", \"rtmp\"\n  , \"rtsp\", \"rtsps\", \"rtspu\", \"secondlife\", \"service\", \"session\", \"sftp\", \"sgn\"\n  , \"shttp\", \"sieve\", \"sip\", \"sips\", \"skype\", \"smb\", \"sms\", \"smtp\", \"snews\"\n  , \"snmp\", \"soap.beep\", \"soap.beeps\", \"soldat\", \"spotify\", \"ssh\", \"steam\"\n  , \"stun\", \"stuns\", \"submit\", \"svn\", \"tag\", \"teamspeak\", \"tel\", \"teliaeid\"\n  , \"telnet\", \"tftp\", \"things\", \"thismessage\", \"tip\", \"tn3270\", \"tool\", \"turn\"\n  , \"turns\", \"tv\", \"udp\", \"unreal\", \"urn\", \"ut2004\", \"v-event\", \"vemmi\"\n  , \"ventrilo\", \"videotex\", \"vnc\", \"view-source\", \"wais\", \"webcal\", \"wpid\"\n  , \"ws\", \"wss\", \"wtai\", \"wyciwyg\", \"xcon\", \"xcon-userid\", \"xfire\"\n  , \"xmlrpc.beep\", \"xmlrpc.beeps\", \"xmpp\", \"xri\", \"ymsgr\", \"z39.50\", \"z39.50r\"\n  , \"z39.50s\"\n  -- Unofficial schemes\n  , \"doi\", \"gemini\", \"isbn\", \"javascript\", \"pmid\"\n  ]\n\n-- | Check if the string is a valid URL with a IANA or frequently used but\n-- unofficial scheme (see @schemes@).\nisURI :: T.Text -> Bool\nisURI t =\n  -- If it's a base 64 data: URI, avoid the expensive call to parseURI:\n  case A.parseOnly (pBase64DataURI *> A.endOfInput) t of\n    Right () -> True\n    Left _ ->\n      -- we URI-escape non-ASCII characters because otherwise parseURI will choke:\n      maybe False hasKnownScheme . parseURI . escapeURIString isAscii . T.unpack $ t\n  where\n    hasKnownScheme =\n      (`Set.member` schemes) . T.toLower . T.filter (/= ':') . T.pack . uriScheme\n\n-- | Converts the path part of a file: URI to a regular path.\n-- On windows, @/c:/foo@ should be @c:/foo@.\n-- On linux, @/foo@ should be @/foo@.\nuriPathToPath :: T.Text -> FilePath\nuriPathToPath (T.unpack -> path) =\n#ifdef _WINDOWS\n  case path of\n    '/':ps -> ps\n    ps     -> ps\n#else\n  path\n#endif\n\npBase64DataURI :: A.Parser (B.ByteString, MimeType)\npBase64DataURI = base64uri\n where\n  base64uri = do\n    A.string \"data:\"\n    mime <- do\n      n1 <- restrictedName\n      A.char '/'\n      n2 <- restrictedName\n      mps <- many mediaParam\n      pure $ n1 <> \"/\" <> n2 <> mconcat mps\n    A.string \";base64,\"\n    b64 <- mconcat <$> many\n              (A.takeWhile1 (A.inClass \"A-Za-z0-9/+ \\t\\r\\n\") <|> percentOctet)\n    A.skipWhile (== '=')\n    -- this decode should be lazy:\n    pure (decodeLenient (encodeUtf8 b64), mime)\n  percentOctet = do\n    A.char '%'\n    x <- A.satisfy isHexDigit\n    y <- A.satisfy isHexDigit\n    case readMay ['0','x',x,y] of\n      Nothing -> fail $ \"Could not read percent encoded byte \" <> [x,y]\n      Just d -> pure $ T.singleton $ chr d\n  restrictedName = do\n    c <- A.satisfy (A.inClass \"A-Za-z0-9\")\n    rest <- A.takeWhile (A.inClass \"A-Za-z0-9!#$&^_.+-\")\n    pure $ T.singleton c <> rest\n  mediaParam = do\n    A.char ';'\n    A.skipWhile isSpace\n    k <- restrictedName\n    A.char '='\n    v <- A.takeWhile (/=';')\n    pure $ \";\" <> k <> \"=\" <> v\n"
  },
  {
    "path": "src/Text/Pandoc/UTF8.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.UTF8\n   Copyright   : Copyright (C) 2010-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nUTF-8 aware string IO functions.\n-}\nmodule Text.Pandoc.UTF8 ( readFile\n                        , getContents\n                        , writeFileWith\n                        , writeFile\n                        , putStrWith\n                        , putStr\n                        , putStrLnWith\n                        , putStrLn\n                        , hPutStrWith\n                        , hPutStr\n                        , hPutStrLnWith\n                        , hPutStrLn\n                        , hGetContents\n                        , toString\n                        , toText\n                        , fromString\n                        , fromText\n                        , toStringLazy\n                        , fromTextLazy\n                        , toTextLazy\n                        , fromStringLazy\n                        , encodePath\n                        , decodeArg\n                        )\n\nwhere\n\nimport qualified Data.ByteString.Char8 as B\nimport qualified Data.ByteString.Lazy.Char8 as BL\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.IO as TIO\nimport qualified Data.Text.Encoding as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Lazy.Encoding as TL\nimport Prelude hiding (getContents, putStr, putStrLn, readFile, writeFile)\nimport System.IO hiding (getContents, hGetContents, hPutStr, hPutStrLn, putStr,\n                  putStrLn, readFile, writeFile)\n\nreadFile :: FilePath -> IO Text\nreadFile f = do\n  h <- openFile (encodePath f) ReadMode\n  hGetContents h\n\ngetContents :: IO Text\ngetContents = hGetContents stdin\n\nwriteFileWith :: Newline -> FilePath -> Text -> IO ()\nwriteFileWith eol f s =\n  withFile (encodePath f) WriteMode $ \\h -> hPutStrWith eol h s\n\nwriteFile :: FilePath -> Text -> IO ()\nwriteFile = writeFileWith nativeNewline\n\nputStrWith :: Newline -> Text -> IO ()\nputStrWith eol s = hPutStrWith eol stdout s\n\nputStr :: Text -> IO ()\nputStr = putStrWith nativeNewline\n\nputStrLnWith :: Newline -> Text -> IO ()\nputStrLnWith eol s = hPutStrLnWith eol stdout s\n\nputStrLn :: Text -> IO ()\nputStrLn = putStrLnWith nativeNewline\n\nhPutStrWith :: Newline -> Handle -> Text -> IO ()\nhPutStrWith eol h s =\n  hSetNewlineMode h (NewlineMode eol eol) >>\n  hSetEncoding h utf8 >> TIO.hPutStr h s\n\nhPutStr :: Handle -> Text -> IO ()\nhPutStr = hPutStrWith nativeNewline\n\nhPutStrLnWith :: Newline -> Handle -> Text -> IO ()\nhPutStrLnWith eol h s =\n  hSetNewlineMode h (NewlineMode eol eol) >>\n  hSetEncoding h utf8 >> TIO.hPutStrLn h s\n\nhPutStrLn :: Handle -> Text -> IO ()\nhPutStrLn = hPutStrLnWith nativeNewline\n\nhGetContents :: Handle -> IO Text\nhGetContents = fmap toText . B.hGetContents\n\n-- | Convert UTF8-encoded ByteString to Text, also\n-- removing '\\\\r' characters.\ntoText :: B.ByteString -> Text\ntoText = T.decodeUtf8 . filterCRs . dropBOM\n  where dropBOM bs =\n         if \"\\xEF\\xBB\\xBF\" `B.isPrefixOf` bs\n            then B.drop 3 bs\n            else bs\n        filterCRs = B.filter (/='\\r')\n\n-- | Convert UTF8-encoded ByteString to String, also\n-- removing '\\\\r' characters.\ntoString :: B.ByteString -> String\ntoString = T.unpack . toText\n\n-- | Convert UTF8-encoded ByteString to Text, also\n-- removing '\\\\r' characters.\ntoTextLazy :: BL.ByteString -> TL.Text\ntoTextLazy = TL.decodeUtf8 . filterCRs . dropBOM\n  where dropBOM bs =\n         if \"\\xEF\\xBB\\xBF\" `BL.isPrefixOf` bs\n            then BL.drop 3 bs\n            else bs\n        filterCRs = BL.filter (/='\\r')\n\n-- | Convert UTF8-encoded ByteString to String, also\n-- removing '\\\\r' characters.\ntoStringLazy :: BL.ByteString -> String\ntoStringLazy = TL.unpack . toTextLazy\n\nfromText :: Text -> B.ByteString\nfromText = T.encodeUtf8\n\nfromTextLazy :: TL.Text -> BL.ByteString\nfromTextLazy = TL.encodeUtf8\n\nfromString :: String -> B.ByteString\nfromString = fromText . T.pack\n\nfromStringLazy :: String -> BL.ByteString\nfromStringLazy = fromTextLazy . TL.pack\n\nencodePath :: FilePath -> FilePath\nencodePath = id\n\n{-# DEPRECATED decodeArg \"decodeArg is now a no-op\" #-}\ndecodeArg :: String -> String\ndecodeArg = id\n"
  },
  {
    "path": "src/Text/Pandoc/UUID.hs",
    "content": "{- |\n   Module      : Text.Pandoc.UUID\n   Copyright   : Copyright (C) 2010-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nUUID generation using Version 4 (random method) described\nin RFC4122. See http://tools.ietf.org/html/rfc4122\n-}\n\nmodule Text.Pandoc.UUID ( UUID(..), getRandomUUID ) where\n\nimport Data.Bits (clearBit, setBit)\nimport Data.Word\nimport System.Random (RandomGen, randoms)\nimport Text.Printf (printf)\nimport Text.Pandoc.Class.PandocMonad\n\ndata UUID = UUID Word8 Word8 Word8 Word8 Word8 Word8 Word8 Word8\n                 Word8 Word8 Word8 Word8 Word8 Word8 Word8 Word8\n\ninstance Show UUID where\n  show (UUID a b c d e f g h i j k l m n o p) =\n   \"urn:uuid:\" ++\n   printf \"%02x\" a ++\n   printf \"%02x\" b ++\n   printf \"%02x\" c ++\n   printf \"%02x\" d ++\n   \"-\" ++\n   printf \"%02x\" e ++\n   printf \"%02x\" f ++\n   \"-\" ++\n   printf \"%02x\" g ++\n   printf \"%02x\" h ++\n   \"-\" ++\n   printf \"%02x\" i ++\n   printf \"%02x\" j ++\n   \"-\" ++\n   printf \"%02x\" k ++\n   printf \"%02x\" l ++\n   printf \"%02x\" m ++\n   printf \"%02x\" n ++\n   printf \"%02x\" o ++\n   printf \"%02x\" p\n\ngetUUID :: RandomGen g => g -> UUID\ngetUUID gen =\n  case take 16 (randoms gen :: [Word8]) of\n       [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p] ->\n         -- set variant\n         let i' = i `setBit` 7 `clearBit` 6\n         -- set version (0100 for random)\n             g' = g `clearBit` 7 `setBit` 6 `clearBit` 5 `clearBit` 4\n         in  UUID a b c d e f g' h i' j k l m n o p\n       _ -> error \"not enough random numbers for UUID\" -- should not happen\n\ngetRandomUUID :: PandocMonad m => m UUID\ngetRandomUUID = getUUID <$> newStdGen\n"
  },
  {
    "path": "src/Text/Pandoc/Version.hs",
    "content": "{-# LANGUAGE CPP                   #-}\n{- |\n   Module      : Text.Pandoc.Version\n   Copyright   : Copyright (C) 2022-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nVersion information.\n-}\nmodule Text.Pandoc.Version (\n                     pandocVersion,\n                     pandocVersionText\n                    ) where\n\nimport Data.Version (Version, showVersion)\nimport Paths_pandoc (version)\nimport qualified Data.Text as T\n\n-- | Version number of pandoc library.\npandocVersion :: Version\npandocVersion = version\n\n-- | Text representation of the library's version number.\npandocVersionText :: T.Text\npandocVersionText = T.pack $ showVersion version\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/ANSI.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.ANSI\n   Copyright   : © 2024 Evan Silberman\n                 © 2025 Pandoc contributors\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to Ansi terminal output.\n-}\nmodule Text.Pandoc.Writers.ANSI ( writeANSI ) where\nimport Control.Monad.State.Strict ( StateT, gets, modify, evalStateT )\nimport Control.Monad (foldM)\nimport Data.List (intersperse)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport Text.DocLayout ((<+>), ($$), ($+$))\nimport Text.DocTemplates (Context(..))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (highlight, formatANSI)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Math(texMathToInlines)\nimport Text.Pandoc.Writers.Shared\nimport qualified Data.Text as T\nimport Data.Text.Lazy (toStrict)\nimport qualified Text.DocLayout as D\nimport qualified Text.Pandoc.Highlighting as HL\n\nhr :: D.HasChars a => D.Doc a\nhr = rule 20\n\nrule :: D.HasChars a => Int -> D.Doc a\nrule n = D.literal $ D.replicateChar n '─'\n\ndata WriterState = WriterState {\n    stNotes     :: [D.Doc Text]        -- Footnotes\n  , stColumns   :: Int         -- Width of the rendered text block\n  , stInner     :: Bool    -- Are we at the document's top-level or in a nested construct?\n  , stNextFigureNum :: Int\n  , stInFigure :: Bool\n  , stInTable :: Bool\n  }\n\ntype TW = StateT WriterState\n\nwithFewerColumns :: PandocMonad m => Int -> TW m a -> TW m a\nwithFewerColumns n a = do\n  cols <- gets stColumns\n  inner <- gets stInner\n  modify $ \\s -> s{stColumns = max (cols - n) 4, stInner = True}\n  result <- a\n  modify $ \\s -> s{stColumns = cols, stInner = inner}\n  return result\n\n-- | Convert Pandoc to ANSI\nwriteANSI :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteANSI opts document =\n  evalStateT (pandocToANSI opts document)\n            WriterState { stNotes = [],\n                          stColumns = (writerColumns opts),\n                          stInner = False,\n                          stNextFigureNum = 1,\n                          stInFigure = False,\n                          stInTable = False\n                        }\n\n-- | Return ANSI-styled version of document\npandocToANSI :: PandocMonad m\n                => WriterOptions -> Pandoc -> TW m Text\npandocToANSI opts (Pandoc meta blocks) = do\n  metadata <- metaToContext opts\n                 (blockListToANSI opts)\n                 (inlineListToANSI opts) meta\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  let title = titleBlock colwidth metadata\n  let blocks' = makeSections (writerNumberSections opts) Nothing blocks\n  body <- blockListToANSI opts blocks'\n  notes <- gets $ reverse . stNotes\n  let notemark x = D.literal (tshow (x :: Int) <> \".\") <+> D.space\n  let marks = map notemark [1..length notes]\n  let hangWidth = foldr (max . D.offset) 0 marks\n  let notepretty\n       | not (null notes) =\n          (case colwidth of\n            Nothing -> hr\n            Just w  -> D.cblock w hr)\n          $+$ hangMarks hangWidth marks notes\n       | otherwise = D.empty\n  let main = body $+$ notepretty\n  let context = defField \"body\" main\n              $ defField \"titleblock\" title metadata\n  return $\n    case writerTemplate opts of\n         Nothing  -> toStrict $ D.renderANSI colwidth main\n         Just tpl -> toStrict $ D.renderANSI colwidth\n                              $ renderTemplate tpl context\n\ntitleBlock :: Maybe Int -> Context Text -> D.Doc Text\ntitleBlock width meta =\n  if null most\n     then D.empty\n     else (maybe id D.cblock width) $ most $+$ hr\n  where\n    title = D.bold (fromMaybe D.empty $ getField \"title\" meta)\n    subtitle = fromMaybe D.empty $ getField \"subtitle\" meta\n    author =  D.vcat $ fromMaybe [] $ getField \"author\" meta\n    date = D.italic (fromMaybe D.empty $ getField \"date\" meta)\n    most = (title $$ subtitle) $+$ author $+$ date\n\nhangMarks :: Int -> [D.Doc Text] -> [D.Doc Text] -> D.Doc Text\nhangMarks width markers contents =\n  D.vsep (zipWith hangMark markers contents) where\n    hangMark m d = D.rblock width m <+> D.nest (width + 1) d\n\nstackMarks :: [D.Doc Text] -> [D.Doc Text] -> D.Doc Text\nstackMarks markers contents = D.vsep (zipWith stack markers contents)\n  where stack m d = m $$ D.nest 4 d\n\n-- | Convert Pandoc block element to ANSI\nblockToANSI :: PandocMonad m\n               => WriterOptions -- ^ Options\n               -> Block         -- ^ Block element\n               -> TW m (D.Doc Text)\n\nblockToANSI opts (Div _ bs) = blockListToANSI opts bs\n\nblockToANSI opts (Plain inlines) = inlineListToANSI opts inlines\n\nblockToANSI opts (Para inlines) = inlineListToANSI opts inlines\n\nblockToANSI opts (LineBlock lns) = do\n  let go [] = return D.blankline\n      go xs = inlineListToANSI opts xs\n  lns' <- mapM go lns\n  return $ D.vcat lns'\n\nblockToANSI _ b@(RawBlock _ _) = do\n    report $ BlockNotRendered b\n    return D.empty\n\nblockToANSI _ HorizontalRule = return $ D.blankline $$ hr $$ D.blankline\n\nblockToANSI opts (Header level (_, classes, kvs) inlines) = do\n  contents <- inlineListToANSI opts inlines\n  let secnum = fromMaybe mempty $ lookup \"number\" kvs\n  let doNumber = writerNumberSections opts && not (T.null secnum) && \"unnumbered\" `notElem` classes\n  let number | doNumber = D.hang (D.realLength secnum + 1) (header level (D.literal secnum) <> D.space)\n             | otherwise = id\n  return $ number (header level contents) $$ D.blankline where\n    header 1 = (fmap T.toUpper) . D.bold\n    header 2 = D.bold\n    header _ = D.italic\n\n-- The approach to code blocks and highlighting here is a best-effort with\n-- existing tools. The Skylighting formatANSI function produces fully-rendered\n-- results, and its line numbers are followed by a tab character, which can\n-- produce less-than-ideal results depending on your terminal's tab stops. (See\n-- tabs(1)). A more ambitious approach here could process SourceLines into a\n-- Doc Text.\nblockToANSI opts (CodeBlock attr str) = do\n  table <- gets stInTable\n  let highlightWithStyle s = do\n        let fmt o = formatANSI o s\n            result = highlight (writerSyntaxMap opts) fmt attr str\n        return $ case result of\n          Left _ -> defaultStyle str\n          Right f -> D.literal f\n  inner <- case (table, writerHighlightMethod opts) of\n    (_, NoHighlighting) -> return $ defaultStyle str\n    (True, _) -> return $ defaultStyle str\n    (False, Skylighting s) -> highlightWithStyle s\n    (False, DefaultHighlighting) -> highlightWithStyle HL.defaultStyle\n    (False, IdiomaticHighlighting) -> do\n      report $ CouldNotHighlight \"no idiomatic highlighting in ANSI\"\n      return $ defaultStyle str\n  return $ nest table inner\n  where defaultStyle = (D.fg D.red) . D.literal\n        nest False = D.nest 4\n        nest True = id\n\nblockToANSI opts (BlockQuote blocks) = do\n  contents <- withFewerColumns 2 $ blockListToANSI opts blocks\n  return ( D.prefixed \"│ \" contents $$ D.blankline)\n\nblockToANSI opts (Table _ (Caption _ caption) colSpecs (TableHead _ thead) tbody (TableFoot _ tfoot)) = do\n  let captionInlines = blocksToInlines caption\n  captionMarkup <-\n    if null captionInlines\n       then return mempty\n       else D.nest 2 <$> inlineListToANSI opts (blocksToInlines caption)\n  wasTable <- gets stInTable\n  modify $ \\s -> s{stInTable = True}\n  let tw = writerColumns opts\n  let ncol = length colSpecs\n  let inWidths = map snd colSpecs\n  let spaceForColumns = tw - ncol + 1  -- reserve a 1-char gutter between tcols\n  let claimWidth ColWidthDefault = 0\n      claimWidth (ColWidth n) = floor (n * fromIntegral spaceForColumns)\n  let usedSpace = sum (map claimWidth inWidths)\n  let remaining = spaceForColumns - usedSpace\n  let defWidth = remaining `div` length (filter (== ColWidthDefault) inWidths)\n  let maxWidth ColWidthDefault = defWidth\n      maxWidth k = claimWidth k\n  let widths = map maxWidth inWidths\n  let decor = [D.hsep $ map rule widths]\n  head' <- (makeRows widths . map unRow) thead\n  body' <- (makeRows widths . map unRow) (tableBodiesToRows tbody)\n  foot' <- (makeRows widths . map unRow) tfoot\n  modify $ \\s -> s{stInTable = wasTable}\n  return $ D.vcat (head' <> decor <> body' <> decor <> foot') $+$ captionMarkup\n  where\n    unRow (Row _ cs) = cs\n    makeRows ws rows = do\n      (docs, _) <- foldM (goRow ws) ([], M.empty) rows\n      return $ reverse docs\n    goRow _ (r, spans) [] =\n      -- Empty rows are not displayed but previous row spans still apply for them.\n      let spans' = M.map decrementPreviousRowSpans spans\n      in  return (r, spans')\n    goRow ws (r, spans) cs = do\n      (d, (nextPos, spans'), _) <- foldM goCell ([], (0, spans), ws) cs\n      let spans'' = decrementTrailingRowSpans nextPos spans' -- Handle previous row spans next to the end of the current row\n      return (D.hcat (intersperse (D.vfill \" \") $ reverse d):r, spans'')\n    goCell (r, (colPos, spans), ws) cell@(Cell _ aln (RowSpan rspan) (ColSpan cspan) inner)\n      | Just (ColSpan previousColSpan, spans') <- takePreviousSpansAtColumn colPos spans = do\n          (r', nextPos, ws') <- makeCell r colPos ws AlignDefault previousColSpan []\n          goCell (r', (nextPos, spans'), ws') cell\n      | otherwise = do\n          (r', nextPos, ws') <- makeCell r colPos ws aln cspan inner\n          let spans' = insertCurrentSpansAtColumn colPos spans (RowSpan rspan) (ColSpan cspan)\n          return (r', (nextPos, spans'), ws')\n    decrementPreviousRowSpans spans@(RowSpan rspan, cspan) =\n      if rspan >= 1\n        then (RowSpan rspan - 1, cspan)\n        else spans\n    makeCell r colPos ws aln cspan inner = do\n      let (ws', render) = next ws aln cspan\n      innerDoc <- blockListToANSI opts inner\n      return ((render innerDoc):r, colPos + cspan, ws')\n    tcell AlignLeft    = D.lblock\n    tcell AlignRight   = D.rblock\n    tcell AlignCenter  = D.cblock\n    tcell AlignDefault = D.lblock\n    next ws aln cspan =\n      let (this, ws') = splitAt cspan ws\n          w = sum this + cspan - 1\n          cell = (tcell aln) w\n       in (ws', cell)\n\nblockToANSI opts (BulletList items) = do\n  contents <- withFewerColumns 2 $ mapM (blockListToANSI opts) items\n  return $ D.vsep (fmap hangMark contents) where\n    hangMark d = D.hang 2 (D.literal \"• \") d\n\nblockToANSI opts (OrderedList attribs items) = do\n  let markers = fmap D.literal $ take (length items) $ orderedListMarkers attribs\n  let hangWidth = foldr (max . D.offset) 0 markers\n  contents <- withFewerColumns hangWidth $ mapM (blockListToANSI opts) items\n  return $ hangMarks hangWidth markers contents <> D.cr\n\nblockToANSI opts (DefinitionList items) = do\n  labels <- mapM (inlineListToANSI opts . fst) items\n  columns <- gets stColumns\n  let hangWidth = foldr (max . D.offset) 0 labels\n  if hangWidth > floor (toRational columns / 10 * 3)\n     then do\n       contents <- withFewerColumns 4 $ mapM ((mapM (blockListToANSI opts)) . snd) items\n       return $ stackMarks (D.bold <$> labels) (D.vsep <$> contents) <> D.cr\n     else do\n       contents <- withFewerColumns hangWidth $ mapM ((mapM (blockListToANSI opts)) . snd) items\n       return $ hangMarks hangWidth (D.bold <$> labels) (D.vsep <$> contents) <> D.cr\n\nblockToANSI opts (Figure _ (Caption _ caption)  body) = do\n  let captionInlines = blocksToInlines caption\n  figState <- gets stInFigure\n  captionMarkup <-\n    if null captionInlines\n       then return mempty\n       else D.nest 2 <$> inlineListToANSI opts (blocksToInlines caption)\n  modify $ \\s -> s{stInFigure = True}\n  contents <- blockListToANSI opts body\n  modify $ \\s -> s{stInFigure = figState}\n  return $ contents $+$ captionMarkup\n\n-- Auxiliary functions for lists:\n\n-- | Convert list of Pandoc block elements to ANSI\nblockListToANSI :: PandocMonad m\n                   => WriterOptions -- ^ Options\n                   -> [Block]       -- ^ List of block elements\n                   -> TW m (D.Doc Text)\nblockListToANSI opts blocks =\n  D.vsep <$> mapM (blockToANSI opts) blocks\n\n-- | Convert list of Pandoc inline elements to ANSI\ninlineListToANSI :: PandocMonad m\n                    => WriterOptions -> [Inline] -> TW m (D.Doc Text)\ninlineListToANSI opts lst =\n  D.hcat <$> mapM (inlineToANSI opts) lst\n\n-- | Convert Pandoc inline element to ANSI\ninlineToANSI :: PandocMonad m => WriterOptions -> Inline -> TW m (D.Doc Text)\n\ninlineToANSI opts (Span _ lst) =\n  inlineListToANSI opts lst\n\ninlineToANSI opts (Emph lst) = do\n  contents <- inlineListToANSI opts lst\n  return $ D.italic contents\n\ninlineToANSI opts (Underline lst) = do\n  contents <- inlineListToANSI opts lst\n  return $ D.underlined contents\n\ninlineToANSI opts (Strong lst) = do\n  contents <- inlineListToANSI opts lst\n  return $ D.bold contents\n\ninlineToANSI opts (Strikeout lst) = do\n  contents <- inlineListToANSI opts lst\n  return $ D.strikeout contents\n\ninlineToANSI opts (Superscript lst) = do\n  case traverse toSuperscriptInline lst of\n    Just xs -> inlineListToANSI opts xs\n    Nothing -> D.parens <$> inlineListToANSI opts lst\n\ninlineToANSI opts (Subscript lst) = do\n  case traverse toSubscriptInline lst of\n    Just xs -> inlineListToANSI opts xs\n    Nothing -> D.parens <$> inlineListToANSI opts lst\n\ninlineToANSI opts (SmallCaps lst) = inlineListToANSI opts lst\n\ninlineToANSI opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToANSI opts lst\n  return $ \"‘\" <> contents <> \"’\"\n\ninlineToANSI opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToANSI opts lst\n  return $ \"“\" <> contents <> \"”\"\n\ninlineToANSI opts (Cite _  lst) = inlineListToANSI opts lst\n\n-- Making a judgment call here that for ANSI-formatted output\n-- intended for reading, we want to reflow inline Code on spaces\ninlineToANSI _ (Code _ str) =\n  return $ D.bg D.white $ D.fg D.red $ \" \" <> D.hcat flow <> \" \"\n    where flow = intersperse D.space (D.literal <$> T.words str)\n\ninlineToANSI _ (Str str) = return $ D.literal str\n\ninlineToANSI opts (Math t str) = texMathToInlines t str >>= inlineListToANSI opts\n\ninlineToANSI _ il@RawInline{} = do\n  report $ InlineNotRendered il\n  return \"\"\n\ninlineToANSI _ LineBreak = return D.cr\n\ninlineToANSI _ SoftBreak = return D.space\n\ninlineToANSI _ Space = return D.space\n\ninlineToANSI opts (Link (_, _, _) txt (src, _)) = do\n  label <- inlineListToANSI opts txt\n  return $ D.underlined $ D.fg D.cyan $ D.link src label\n\ninlineToANSI opts (Image _ alt _) = do\n  infig <- gets stInFigure\n  if not infig then do\n    alt' <- inlineListToANSI opts alt\n    return $ D.brackets $ \"image: \" <> alt'\n  else return $ D.brackets \"image\"\n\n-- by construction, we should never be lacking in superscript characters\n-- for the footnote number, but we'll fall back to square brackets anyway\ninlineToANSI opts (Note contents) = do\n  curNotes <- gets stNotes\n  let newnum = tshow $ length curNotes + 1\n  contents' <- blockListToANSI opts contents\n  modify $ \\s -> s { stNotes = contents' : curNotes }\n  let super = T.pack <$> (traverse toSuperscript (T.unpack newnum))\n  return $ D.literal $ fromMaybe (\"[\" <> newnum <> \"]\") super\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/AnnotatedTable.hs",
    "content": "{-# LANGUAGE BangPatterns #-}\n{-# LANGUAGE DeriveDataTypeable #-}\n{-# LANGUAGE DeriveGeneric #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE UndecidableInstances #-}\n\n{- |\n   Module      : Text.Pandoc.Writers.AnnotatedTable\n   Copyright   : Copyright 2020 Christian Despres\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Christian Despres <christian.j.j.despres@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nDefinitions and conversion functions for an intermediate 'Table' and\nrelated types, which annotates the existing Pandoc 'B.Table' types\nwith additional inferred information. For use in writers that need to\nknow the details of columns that cells span, row numbers, and the\ncells that are in the row head.\n-}\n\nmodule Text.Pandoc.Writers.AnnotatedTable\n  ( toTable\n  , fromTable\n  , Table(..)\n  , TableHead(..)\n  , TableBody(..)\n  , TableFoot(..)\n  , HeaderRow(..)\n  , BodyRow(..)\n  , RowNumber(..)\n  , RowHead\n  , RowBody\n  , Cell(..)\n  , ColNumber(..)\n  )\nwhere\n\nimport           Control.Monad.RWS.Strict\nimport           Data.Generics                  ( Data\n                                                , Typeable\n                                                )\nimport           Data.List.NonEmpty             ( NonEmpty(..) )\nimport           GHC.Generics                   ( Generic )\nimport qualified Text.Pandoc.Builder           as B\nimport           Text.Pandoc.Walk               ( Walkable (..) )\n\n-- | An annotated table type, corresponding to the Pandoc 'B.Table'\n-- constructor and the HTML @\\<table\\>@ element. It records the data\n-- of the columns that cells span, the cells in the row head, the row\n-- numbers of rows, and the column numbers of cells, in addition to\n-- the data in a 'B.Table'. The type itself does not enforce any\n-- guarantees about the consistency of this data. Use 'toTable' to\n-- produce a 'Table' from a Pandoc 'B.Table'.\ndata Table = Table B.Attr B.Caption [B.ColSpec] TableHead [TableBody] TableFoot\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | An annotated table head, corresponding to a Pandoc 'B.TableHead'\n-- and the HTML @\\<thead\\>@ element.\ndata TableHead = TableHead B.Attr [HeaderRow]\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | An annotated table body, with an intermediate head and body,\n-- corresponding to a Pandoc 'B.TableBody' and the HTML @\\<tbody\\>@\n-- element.\ndata TableBody = TableBody B.Attr B.RowHeadColumns [HeaderRow] [BodyRow]\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | An annotated table foot, corresponding to a Pandoc 'B.TableFoot'\n-- and the HTML @\\<tfoot\\>@ element.\ndata TableFoot = TableFoot B.Attr [HeaderRow]\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | An annotated header row, corresponding to a Pandoc 'B.Row' and\n-- the HTML @\\<tr\\>@ element, and also recording the row number of the\n-- row. All the cells in a 'HeaderRow' are header (@\\<th\\>@) cells.\ndata HeaderRow = HeaderRow B.Attr RowNumber [Cell]\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | An annotated body row, corresponding to a Pandoc 'B.Row' and the\n-- HTML @\\<tr\\>@ element, and also recording its row number and\n-- separating the row head cells from the row body cells.\ndata BodyRow = BodyRow B.Attr RowNumber RowHead RowBody\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | The row number of a row. Note that rows are numbered continuously\n-- from zero from the start of the table, so the first row in a table\n-- body, for instance, may have a large 'RowNumber'.\nnewtype RowNumber = RowNumber Int\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic, Num, Enum)\n\n-- | The head of a body row; the portion of the row lying in the stub\n-- of the 'TableBody'. Its cells correspond to HTML @\\<th\\>@ cells.\ntype RowHead = [Cell]\n\n-- | The body of a body row; the portion of the row lying after the\n-- stub of the 'TableBody'. Its cells correspond to HTML @\\<td\\>@\n-- cells.\ntype RowBody = [Cell]\n\n-- | An annotated table cell, wrapping a Pandoc 'B.Cell' with its\n-- 'ColNumber' and the 'B.ColSpec' data for the columns that the cell\n-- spans.\ndata Cell = Cell (NonEmpty B.ColSpec) ColNumber B.Cell\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)\n\n-- | The column number of a cell, meaning the column number of the\n-- first column that the cell spans, if the table were laid on a\n-- grid. Columns are numbered starting from zero.\nnewtype ColNumber = ColNumber Int\n  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic, Num, Enum)\n\n-- | Convert a Pandoc 'B.Table' to an annotated 'Table'. This function\n-- also performs the same normalization that the 'B.table' builder\n-- does (fixing overlapping cells, cells that protrude out of their\n-- table section, and so on). If the input table happens to satisfy\n-- the conditions that 'B.table' guarantees, then the resulting\n-- 'Table' will be identical, save for the addition of the inferred\n-- table information.\ntoTable\n  :: B.Attr\n  -> B.Caption\n  -> [B.ColSpec]\n  -> B.TableHead\n  -> [B.TableBody]\n  -> B.TableFoot\n  -> Table\ntoTable attr cap cs th tbs tf = Table attr cap cs th' tbs' tf'\n where\n  (th', tbs', tf') = fst $ evalRWS (annotateTable th tbs tf) (cs, length cs) 0\n\n-- | Internal monad for annotating a table, passing in the 'B.ColSpec'\n-- data for the table, the grid width, and the current 'RowNumber' to\n-- be referenced or updated.\ntype AnnM a = RWS ([B.ColSpec], Int) () RowNumber a\n\nincRowNumber :: AnnM RowNumber\nincRowNumber = do\n  rn <- get\n  put $ rn + 1\n  return rn\n\nannotateTable\n  :: B.TableHead\n  -> [B.TableBody]\n  -> B.TableFoot\n  -> AnnM (TableHead, [TableBody], TableFoot)\nannotateTable th tbs tf = do\n  th'  <- annotateTableHead th\n  tbs' <- traverse annotateTableBody tbs\n  tf'  <- annotateTableFoot tf\n  return (th', tbs', tf')\n\nannotateTableHead :: B.TableHead -> AnnM TableHead\nannotateTableHead (B.TableHead attr rows) =\n  TableHead attr <$> annotateHeaderSection rows\n\nannotateTableBody :: B.TableBody -> AnnM TableBody\nannotateTableBody (B.TableBody attr rhc th tb) = do\n  twidth <- asks snd\n  let rhc' = max 0 $ min (B.RowHeadColumns twidth) rhc\n  th' <- annotateHeaderSection th\n  tb' <- annotateBodySection rhc' tb\n  return $ TableBody attr rhc' th' tb'\n\nannotateTableFoot :: B.TableFoot -> AnnM TableFoot\nannotateTableFoot (B.TableFoot attr rows) =\n  TableFoot attr <$> annotateHeaderSection rows\n\nannotateHeaderSection :: [B.Row] -> AnnM [HeaderRow]\nannotateHeaderSection rows = do\n  colspec <- asks fst\n  let hangcolspec = (1, ) <$> colspec\n  annotateHeaderSection' hangcolspec id $ B.clipRows rows\n where\n  annotateHeaderSection' oldHang acc (B.Row attr cells : rs) = do\n    let (_, newHang, cells', _) =\n          annotateRowSection 0 oldHang $ cells <> repeat B.emptyCell\n    n <- incRowNumber\n    let annRow = HeaderRow attr n cells'\n    annotateHeaderSection' newHang (acc . (annRow :)) rs\n  annotateHeaderSection' _ acc [] = return $ acc []\n\nannotateBodySection :: B.RowHeadColumns -> [B.Row] -> AnnM [BodyRow]\nannotateBodySection (B.RowHeadColumns rhc) rows = do\n  colspec <- asks fst\n  let colspec'             = (1, ) <$> colspec\n  let (stubspec, bodyspec) = splitAt rhc colspec'\n  normalizeBodySection' stubspec bodyspec id $ B.clipRows rows\n where\n  normalizeBodySection' headHang bodyHang acc (B.Row attr cells : rs) = do\n    let (colnum, headHang', rowStub, cells') =\n          annotateRowSection 0 headHang $ cells <> repeat B.emptyCell\n    let (_, bodyHang', rowBody, _) = annotateRowSection colnum bodyHang cells'\n    n <- incRowNumber\n    let annRow = BodyRow attr n rowStub rowBody\n    normalizeBodySection' headHang' bodyHang' (acc . (annRow :)) rs\n  normalizeBodySection' _ _ acc [] = return $ acc []\n\n-- | Lay out a section of a 'Table' row on a grid row, annotating the\n-- cells with the 'B.ColSpec' data for the columns that they\n-- span. Performs the same normalization as 'B.placeRowSection'.\nannotateRowSection\n  :: ColNumber -- ^ The current column number\n  -> [(B.RowSpan, B.ColSpec)] -- ^ The overhang of the previous grid row,\n                              -- with column data\n  -> [B.Cell] -- ^ The cells to annotate\n  -> (ColNumber, [(B.RowSpan, B.ColSpec)], [Cell], [B.Cell]) -- ^ The new\n                                                             -- column\n                                                             -- number,\n                                                             -- overhang,\n                                                             -- annotated\n                                                             -- cells,\n                                                             -- and\n                                                             -- remaining\n                                                             -- cells\nannotateRowSection !colnum oldHang cells\n  -- If the grid has overhang at our position, try to re-lay in\n  -- the next position.\n  | (o, colspec) : os <- oldHang\n  , o > 1\n  = let (colnum', newHang, newCell, cells') =\n            annotateRowSection (colnum + 1) os cells\n    in  (colnum', (o - 1, colspec) : newHang, newCell, cells')\n  -- Otherwise if there is any available width, place the cell and\n  -- continue.\n  | c : cells' <- cells\n  , (h, w) <- getDim c\n  , w' <- max 1 w\n  , (w'', cellHang@(chStart : chRest), oldHang') <- splitCellHang h w' oldHang\n  = let c'      = setW w'' c\n        annCell = Cell (snd <$> chStart :| chRest) colnum c'\n        colnum' = colnum + ColNumber (getColSpan w'')\n        (colnum'', newHang, newCells, remainCells) =\n            annotateRowSection colnum' oldHang' cells'\n    in  (colnum'', cellHang <> newHang, annCell : newCells, remainCells)\n  -- Otherwise there is no room in the section\n  | otherwise\n  = (colnum, [], [], cells)\n where\n  getColSpan (B.ColSpan x) = x\n  getDim (B.Cell _ _ h w _) = (h, w)\n  setW w (B.Cell a b h _ c) = B.Cell a b h w c\n\n-- | In @'splitCellHang' rs cs coldata@, with @rs@ the height of a\n-- cell that lies at the beginning of @coldata@, and @cs@ its width\n-- (which is not assumed to fit in the available space), return the\n-- actual width of the cell (what will fit in the available space),\n-- the data for the columns that the cell spans (including updating\n-- the overhang to equal @rs@), and the remaining column data.\nsplitCellHang\n  :: B.RowSpan\n  -> B.ColSpan\n  -> [(B.RowSpan, B.ColSpec)]\n  -> (B.ColSpan, [(B.RowSpan, B.ColSpec)], [(B.RowSpan, B.ColSpec)])\nsplitCellHang h n = go 0\n where\n  go acc ((1, spec) : ls) | acc < n =\n    let (acc', hang, ls') = go (acc + 1) ls in (acc', (h, spec) : hang, ls')\n  go acc l = (acc, [], l)\n\n-- | Convert an annotated 'Table' to a Pandoc\n-- 'B.Table'. This is the inverse of 'toTable' on\n-- well-formed tables (i.e. tables satisfying the guarantees of\n-- 'B.table').\nfromTable\n  :: Table\n  -> ( B.Attr\n     , B.Caption\n     , [B.ColSpec]\n     , B.TableHead\n     , [B.TableBody]\n     , B.TableFoot\n     )\nfromTable (Table attr cap cs th tbs tf) = (attr, cap, cs, th', tbs', tf')\n where\n  th'  = fromTableHead th\n  tbs' = map fromTableBody tbs\n  tf'  = fromTableFoot tf\n\nfromTableHead :: TableHead -> B.TableHead\nfromTableHead (TableHead attr rows) = B.TableHead attr $ fromHeaderRow <$> rows\n\nfromTableBody :: TableBody -> B.TableBody\nfromTableBody (TableBody attr rhc th tb) =\n  B.TableBody attr rhc (fromHeaderRow <$> th) (fromBodyRow <$> tb)\n\nfromTableFoot :: TableFoot -> B.TableFoot\nfromTableFoot (TableFoot attr rows) = B.TableFoot attr $ fromHeaderRow <$> rows\n\nfromHeaderRow :: HeaderRow -> B.Row\nfromHeaderRow (HeaderRow attr _ cells) = B.Row attr $ fromCell <$> cells\n\nfromBodyRow :: BodyRow -> B.Row\nfromBodyRow (BodyRow attr _ rh rb) =\n  B.Row attr ((fromCell <$> rh) <> (fromCell <$> rb))\n\nfromCell :: Cell -> B.Cell\nfromCell (Cell _ _ c) = c\n\n--\n-- Instances\n--\ninstance Walkable a B.Cell => Walkable a Cell where\n  walkM f (Cell colspecs colnum cell) =\n    Cell colspecs colnum <$> walkM f cell\n  query f (Cell _colspecs _colnum cell) = query f cell\n\ninstance Walkable a B.Cell => Walkable a HeaderRow where\n  walkM f (HeaderRow attr rownum cells) =\n    HeaderRow attr rownum <$> walkM f cells\n  query f (HeaderRow _attr _rownum cells) = query f cells\n\ninstance Walkable a B.Cell => Walkable a TableHead where\n  walkM f (TableHead attr rows) =\n    TableHead attr <$> walkM f rows\n  query f (TableHead _attr rows) = query f rows\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/AsciiDoc.hs",
    "content": "{-# LANGUAGE CPP  #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.AsciiDoc\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to asciidoc.\n\nNote that some information may be lost in conversion, due to\nexpressive limitations of asciidoc.  Footnotes and table cells with\nparagraphs (or other block items) are not possible in asciidoc.\nIf pandoc encounters one of these, it will insert a message indicating\nthat it has omitted the construct.\n\nAsciiDoc:  <http://www.methods.co.nz/asciidoc/>\n-}\nmodule Text.Pandoc.Writers.AsciiDoc (\n  writeAsciiDoc,\n  writeAsciiDocLegacy,\n  writeAsciiDoctor\n  ) where\nimport Control.Monad (foldM)\nimport Control.Monad.State.Strict\n    ( StateT, MonadState(get), gets, modify, evalStateT )\nimport Data.Char (isPunctuation, isSpace)\n#if MIN_VERSION_base(4,19,0)\nimport Data.List (delete, intercalate, intersperse, mapAccumL, uncons, sortOn, unsnoc)\n#else\nimport Data.List (delete, intercalate, intersperse, mapAccumL, uncons, sortOn)\n#endif\nimport Data.List.NonEmpty (NonEmpty((:|)), (<|))\nimport qualified Data.List.NonEmpty as NonEmpty\nimport Data.Maybe (fromMaybe, isJust, catMaybes)\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Network.URI (parseURI, URI(uriScheme))\nimport System.FilePath (dropExtension)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (blankline, space)\nimport Text.DocLayout\nimport Text.Pandoc.Builder (emptyCell)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Walk (walk)\n\n#if !MIN_VERSION_base(4,19,0)\nunsnoc :: [a] -> Maybe ([a], a)\nunsnoc = foldr (\\x -> Just . maybe ([], x) (\\(~(a, b)) -> (x : a, b))) Nothing\n#endif\n\ndata WriterState = WriterState { defListMarker       :: Text\n                               , orderedListLevel    :: Int\n                               , bulletListLevel     :: Int\n                               , intraword           :: Bool\n                               , autoIds             :: Set.Set Text\n                               , legacy              :: Bool\n                               , inList              :: Bool\n                               , hasMath             :: Bool\n                               -- |0 is no table\n                               -- 1 is top level table\n                               -- 2 is a table in a table\n                               , tableNestingLevel   :: Int\n                               }\n\ndefaultWriterState :: WriterState\ndefaultWriterState = WriterState { defListMarker      = \"::\"\n                                 , orderedListLevel   = 0\n                                 , bulletListLevel    = 0\n                                 , intraword          = False\n                                 , autoIds            = Set.empty\n                                 , legacy             = False\n                                 , inList             = False\n                                 , hasMath            = False\n                                 , tableNestingLevel  = 0\n                                 }\n\n-- | Convert Pandoc to AsciiDoc.\nwriteAsciiDoc :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteAsciiDoc opts document =\n  evalStateT (pandocToAsciiDoc opts document) defaultWriterState\n\n{-# DEPRECATED writeAsciiDoctor \"Use writeAsciiDoc instead\" #-}\n-- | Deprecated synonym of 'writeAsciiDoc'.\nwriteAsciiDoctor :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteAsciiDoctor = writeAsciiDoc\n\n-- | Convert Pandoc to legacy AsciiDoc.\nwriteAsciiDocLegacy :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteAsciiDocLegacy opts document =\n  evalStateT (pandocToAsciiDoc opts document)\n    defaultWriterState{ legacy = True }\n\ntype ADW = StateT WriterState\n\n-- | Return asciidoc representation of document.\npandocToAsciiDoc :: PandocMonad m => WriterOptions -> Pandoc -> ADW m Text\npandocToAsciiDoc opts (Pandoc meta blocks) = do\n  let titleblock = not $ null (docTitle meta) && null (docAuthors meta) &&\n                         null (docDate meta)\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  metadata <- metaToContext opts\n              (blockListToAsciiDoc opts)\n              (fmap chomp . inlineListToAsciiDoc opts)\n              meta\n  main <- blockListToAsciiDoc opts $ makeSections False Nothing blocks\n  st <- get\n  let context  = defField \"body\" main\n               $ defField \"toc\"\n                  (writerTableOfContents opts &&\n                   isJust (writerTemplate opts))\n               $ defField \"math\" (hasMath st && not (legacy st))\n               $ defField \"titleblock\" titleblock metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\ndata EscContext = Normal | InTable\n  deriving (Show, Eq)\n\n-- | Escape special characters for AsciiDoc.\nescapeString :: EscContext -> Text -> Doc Text\nescapeString context t\n  | T.any needsEscape t\n  = literal $\n      case T.foldl' go (False, mempty) t of\n        (True, x) -> x <> \"++\" -- close passthrough context\n        (False, x) -> x\n  | otherwise = literal t\n where\n  -- Bool is True when we are in a ++ passthrough context\n  go :: (Bool, Text) -> Char -> (Bool, Text)\n  go (True, x) '+' = (False, x <> \"++\" <> \"{plus}\") -- close context\n  go (False, x) '+' = (False, x <> \"{plus}\")\n  go (True, x) '|'\n    | context == InTable = (False, x <> \"++\" <> \"{vbar}\") -- close context\n  go (False, x) '|'\n    | context == InTable = (False, x <> \"{vbar}\")\n  go (True, x) c\n    | needsEscape c = (True, T.snoc x c)\n    | otherwise = (False, T.snoc (x <> \"++\") c)\n  go (False, x) c\n    | needsEscape c = (True, x <> \"++\" <> T.singleton c)\n    | otherwise = (False, T.snoc x c)\n\n  needsEscape '{' = True\n  needsEscape '+' = True\n  needsEscape '`' = True\n  needsEscape '*' = True\n  needsEscape '#' = True\n  needsEscape '_' = True\n  needsEscape '<' = True\n  needsEscape '>' = True\n  needsEscape '[' = True\n  needsEscape ']' = True\n  needsEscape '\\\\' = True\n  needsEscape '|' = True\n  needsEscape _ = False\n\n-- | Ordered list start parser for use in Para below.\nolMarker :: Parsec Text ParserState Char\nolMarker = do (start, style', delim) <- anyOrderedListMarker\n              if delim == Period &&\n                          (style' == UpperAlpha || (style' == UpperRoman &&\n                          start `elem` [1, 5, 10, 50, 100, 500, 1000]))\n                          then spaceChar >> spaceChar\n                          else spaceChar\n\n-- | True if string begins with an ordered list marker\n-- or would be interpreted as an AsciiDoc option command\nneedsEscaping :: Text -> Bool\nneedsEscaping s = beginsWithOrderedListMarker s || isBracketed s\n  where\n    beginsWithOrderedListMarker str =\n      case runParser olMarker defaultParserState \"para start\" (T.take 10 str) of\n             Left  _ -> False\n             Right _ -> True\n    isBracketed t\n      | Just ('[', t') <- T.uncons t\n      , Just (_, ']')  <- T.unsnoc t'\n      = True\n      | otherwise = False\n\n-- | Convert Pandoc block element to asciidoc.\nblockToAsciiDoc :: PandocMonad m\n                => WriterOptions -- ^ Options\n                -> Block         -- ^ Block element\n                -> ADW m (Doc Text)\nblockToAsciiDoc opts (Div (id',\"section\":_,_)\n                       (Header level (_,cls,kvs) ils : xs)) = do\n  hdr <- blockToAsciiDoc opts (Header level (id',cls,kvs) ils)\n  rest <- blockListToAsciiDoc opts xs\n  return $ hdr $$ rest\nblockToAsciiDoc opts (Plain inlines) = do\n  contents <- inlineListToAsciiDoc opts inlines\n  return $ contents <> blankline\nblockToAsciiDoc opts (Para inlines) = do\n  contents <- inlineListToAsciiDoc opts inlines\n  -- escape if para starts with ordered list marker\n  let esc = if needsEscaping (render Nothing contents)\n               then text \"{empty}\"\n               else empty\n  return $ esc <> contents <> blankline\nblockToAsciiDoc opts (LineBlock lns) = do\n  let docify line = if null line\n                    then return blankline\n                    else inlineListToAsciiDoc opts line\n  let joinWithLinefeeds = nowrap . mconcat . intersperse cr\n  contents <- joinWithLinefeeds <$> mapM docify lns\n  return $ \"[verse]\" $$ text \"--\" $$ contents $$ text \"--\" $$ blankline\nblockToAsciiDoc _ b@(RawBlock f s)\n  | f == \"asciidoc\" = return $ literal s\n  | otherwise         = do\n      report $ BlockNotRendered b\n      return empty\nblockToAsciiDoc _ HorizontalRule =\n  return $ blankline <> text \"'''''\" <> blankline\nblockToAsciiDoc opts (Header level (ident,_,_) inlines) = do\n  contents <- inlineListToAsciiDoc opts inlines\n  ids <- gets autoIds\n  let autoId = uniqueIdent (writerExtensions opts) inlines ids\n  modify $ \\st -> st{ autoIds = Set.insert autoId ids }\n  let identifier = if T.null ident ||\n                      (isEnabled Ext_auto_identifiers opts && ident == autoId)\n                      then empty\n                      else \"[[\" <> literal ident <> \"]]\"\n  return $ identifier $$\n           nowrap (text (replicate (level + 1) '=') <> space <> contents) <>\n           blankline\nblockToAsciiDoc opts (Figure attr (Caption _ longcapt) body) = do\n  -- Images in figures all get rendered as individual block-level images\n  -- with the given caption. Non-image elements are rendered unchanged.\n  capt <- if null longcapt\n             then pure mempty\n             else (\".\" <>) . nowrap <$>\n                   inlineListToAsciiDoc opts (blocksToInlines longcapt)\n  let renderFigElement = \\case\n        Plain [Image imgAttr alternate (src, tit)] -> do\n          args <- imageArguments opts imgAttr alternate src tit\n          let figAttributes = case attr of\n                (\"\", _, _)    -> empty\n                (ident, _, _) -> literal $ \"[#\" <> ident <> \"]\"\n          -- .Figure caption\n          -- image::images/logo.png[Company logo, title=\"blah\"]\n          return $\n            capt $$\n            figAttributes $$\n            \"image::\" <> args <> blankline\n        blk -> blockToAsciiDoc opts blk\n  vcat <$> mapM renderFigElement body\nblockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $ flush (\n  if null classes\n     then \"....\" $$ literal str $$ \"....\"\n     else attrs $$ \"----\" $$ literal str $$ \"----\")\n  <> blankline\n    where attrs = \"[\" <> literal (T.intercalate \",\" classes') <> \"]\"\n          classes' = if \"numberLines\" `elem` classes\n                        then \"source%linesnum\" : delete \"numberLines\" classes\n                        else \"source\" : classes\nblockToAsciiDoc opts (BlockQuote blocks) = do\n  contents <- blockListToAsciiDoc opts blocks\n  let isBlock (BlockQuote _) = True\n      isBlock _              = False\n  -- if there are nested block quotes, put in an open block\n  let contents' = if any isBlock blocks\n                     then \"--\" $$ contents $$ \"--\"\n                     else contents\n  let bar = text \"____\"\n  return $ bar $$ chomp contents' $$ bar <> blankline\nblockToAsciiDoc opts block@(Table _ blkCapt specs thead@(TableHead _ originalHeaders) originalTbody tfoot@(TableFoot _ originalFooters)) = do\n  let (caption, aligns, widths, _, _) =\n        toLegacyTable blkCapt specs thead originalTbody tfoot\n  let headers = adjustEmptyRows originalHeaders\n  let rows = adjustEmptyRows $ tableBodiesToRows originalTbody\n  let footers = adjustEmptyRows originalFooters\n  caption' <- inlineListToAsciiDoc opts caption\n  let caption'' = if null caption\n                     then empty\n                     else \".\" <> caption' <> cr\n  let isSimple = all (== 0) widths\n  let relativePercentWidths = if isSimple\n                                 then widths\n                                 else map (/ sum widths) widths\n  let widths'' :: [Integer]\n      widths'' = map (floor . (* 100)) relativePercentWidths\n  -- ensure that the widths sum to 100\n  let widths' = case widths'' of\n                     _ | isSimple -> widths''\n                     (w:ws) | sum (w:ws) < 100\n                               -> (100 - sum ws) : ws\n                     ws        -> ws\n  let totalwidth :: Integer\n      totalwidth = floor $ sum widths * 100\n  let alignmentOperator AlignLeft     = \"<\"\n      alignmentOperator AlignCenter   = \"^\"\n      alignmentOperator AlignRight    = \">\"\n      alignmentOperator AlignDefault  = \"\"\n  let colspec al wi = (alignmentOperator al) ++\n                      if wi == 0 then \"\" else show wi ++ \"%\"\n  let optionSpecForRows rowList spec = if allRowsEmpty rowList then Nothing else Just spec\n  let headerspec = optionSpecForRows headers \"header\"\n  let footerspec = optionSpecForRows footers \"footer\"\n  let optionsList = catMaybes [headerspec, footerspec]\n  let optionsspec = if null optionsList\n                      then empty\n                      else text \"options=\\\"\" <> text (intercalate \",\" optionsList) <> text \"\\\",\"\n  let widthspec = if totalwidth == 0\n                     then empty\n                     else text \"width=\"\n                          <> doubleQuotes (text $ show totalwidth ++ \"%\")\n                          <> text \",\"\n  let tablespec = text \"[\"\n         <> widthspec\n         <> text \"cols=\"\n         <> doubleQuotes (text $ intercalate \",\"\n             $ zipWith colspec aligns widths')\n         <> text \",\"\n         <> optionsspec <> text \"]\"\n\n  -- construct cells and recurse in case of nested tables\n  parentTableLevel <- gets tableNestingLevel\n  let currentNestingLevel = parentTableLevel + 1\n\n  modify $ \\st -> st{ tableNestingLevel = currentNestingLevel }\n\n  let separator = text (if parentTableLevel == 0\n                          then \"|\"  -- top level separator\n                          else \"!\") -- nested separator\n\n  let makeCell [Plain x] = do d <- blockListToAsciiDoc opts [Plain x]\n                              return $ separator <> chomp d\n      makeCell [Para x]  = makeCell [Plain x]\n      makeCell []        = return separator\n      makeCell bs        = if currentNestingLevel == 2\n                             then do\n                               --asciidoc only supports nesting once\n                               report $ BlockNotRendered block\n                               return separator\n                             else do\n                               d <- blockListToAsciiDoc opts bs\n                               return $ (text \"a\" <> separator) $$ d\n\n  let colSpanFactor (ColSpan colSpan) = if colSpan > 1\n                                          then text $ show colSpan\n                                          else empty\n  let rowSpanFactor (RowSpan rowSpan) = if rowSpan > 1\n                                          then text $ \".\" ++ show rowSpan\n                                          else empty\n\n  let makeCellWithSpansAndAlignment (Cell _ alignment rowSpan colSpan blocks) = do\n        let spanFactor = colSpanFactor colSpan <> rowSpanFactor rowSpan\n        cell <- makeCell blocks\n        let alignedCell = alignmentOperator alignment <> cell\n\n        return $ if null spanFactor\n          then alignedCell\n          else spanFactor <> text \"+\" <> alignedCell\n\n  let makeRow (Row attr []) = makeRow $ Row attr $ replicate (length widths') emptyCell\n      makeRow (Row _ cells) = hsep `fmap` mapM makeCellWithSpansAndAlignment cells\n\n  -- AsciiDoc only supports 1 header row and 1 footer row.\n  let headerRow = Data.List.uncons $ adjustHeaders headers\n  let footerRow = unsnoc $ adjustFooters footers\n  let tailHeaderRows = if allRowsEmpty headers then [] else maybe [] snd headerRow\n  let initFooterRows = if allRowsEmpty footers then [] else maybe [] fst footerRow\n  rows' <- mapM makeRow $ tailHeaderRows ++ rows ++ initFooterRows\n  head' <- case headerRow of\n            Nothing -> return empty\n            Just (headerRow', _) -> makeRow headerRow'\n  foot <- case footerRow of\n            Nothing -> return empty\n            Just (_, footerRow') -> makeRow footerRow'\n  modify $ \\st -> st{ tableNestingLevel = parentTableLevel }\n  let head'' = if allRowsEmpty headers then empty else head'\n  let foot' = if allRowsEmpty footers then empty else foot\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then writerColumns opts\n                    else 100000\n  let maxwidth = maximum $ fmap offset (foot <| (head' :| rows'))\n  let body = if maxwidth > colwidth then vsep rows' else vcat rows'\n  let border = separator <> text \"===\"\n  return $\n    caption'' $$ tablespec $$ border $$ head'' $$ body $$ foot' $$ border $$ blankline\nblockToAsciiDoc opts (BulletList items) = do\n  inlist <- gets inList\n  modify $ \\st -> st{ inList = True }\n  contents <- mapM (bulletListItemToAsciiDoc opts) items\n  modify $ \\st -> st{ inList = inlist }\n  return $ mconcat contents <> blankline\nblockToAsciiDoc opts (OrderedList (start, sty, _delim) items) = do\n  let listStyle = case sty of\n                       DefaultStyle -> []\n                       Decimal      -> [\"arabic\"]\n                       Example      -> []\n                       _            -> [T.toLower (tshow sty)]\n  let listStart = [\"start=\" <> tshow start | start /= 1]\n  let listoptions = case T.intercalate \", \" (listStyle ++ listStart) of\n                          \"\" -> empty\n                          x  -> brackets (literal x)\n  inlist <- gets inList\n  modify $ \\st -> st{ inList = True }\n  contents <- mapM (orderedListItemToAsciiDoc opts) items\n  modify $ \\st -> st{ inList = inlist }\n  return $ listoptions $$ mconcat contents <> blankline\nblockToAsciiDoc opts (DefinitionList items) = do\n  inlist <- gets inList\n  modify $ \\st -> st{ inList = True }\n  contents <- mapM (definitionListItemToAsciiDoc opts) items\n  modify $ \\st -> st{ inList = inlist }\n  return $ mconcat contents <> blankline\n\n-- convert admonition and sidebar divs to asicidoc\nblockToAsciiDoc opts (Div (ident,classes,_) bs) = do\n  let identifier = if T.null ident then empty else \"[[\" <> literal ident <> \"]]\"\n  let admonition_classes = [\"attention\",\"caution\",\"danger\",\"error\",\"hint\",\n                     \"important\",\"note\",\"tip\",\"warning\"]\n  let sidebar_class = \"sidebar\"\n\n  contents <-\n       case classes of\n         (l:_) | l `elem` admonition_classes || T.toLower l == sidebar_class -> do\n             let (titleBs, bodyBs) =\n                     case bs of\n                       (Div (_,[\"title\"],_) ts : rest) -> (ts, rest)\n                       _ -> ([], bs)\n             let fence = if l == \"sidebar\" then \"****\" else \"====\"\n             elemTitle <- if null titleBs ||\n                                   -- If title matches class, omit\n                                   (T.toLower (T.strip (stringify titleBs))) == l\n                                   then return mempty\n                                   else (\".\" <>) <$>\n                                         blockListToAsciiDoc opts titleBs\n             elemBody <- blockListToAsciiDoc opts bodyBs\n             return $ \"[\" <> literal (T.toUpper l) <> \"]\" $$\n                      chomp elemTitle $$\n                      fence $$\n                      chomp elemBody $$\n                      fence\n         _ -> blockListToAsciiDoc opts bs\n  return $ identifier $$ contents $$ blankline\n\n-- | Convert bullet list item (list of blocks) to asciidoc.\nbulletListItemToAsciiDoc :: PandocMonad m\n                         => WriterOptions -> [Block] -> ADW m (Doc Text)\nbulletListItemToAsciiDoc opts blocks = do\n  lev <- gets bulletListLevel\n  modify $ \\s -> s{ bulletListLevel = lev + 1 }\n  isLegacy <- gets legacy\n  let blocksWithTasks = if isLegacy\n                          then blocks\n                          else (taskListItemToAsciiDoc blocks)\n  contents <- snd <$> foldM (addBlock opts) (False, empty) blocksWithTasks\n  modify $ \\s -> s{ bulletListLevel = lev }\n  let marker = text (replicate (lev + 1) '*')\n  return $ marker <> text \" \" <> listBegin blocksWithTasks <>\n    contents <> cr\n\n-- | Convert a list item containing text starting with @U+2610 BALLOT BOX@\n-- or @U+2612 BALLOT BOX WITH X@ to asciidoctor checkbox syntax (e.g. @[x]@).\ntaskListItemToAsciiDoc :: [Block] -> [Block]\ntaskListItemToAsciiDoc = handleTaskListItem toAd listExt\n  where\n    toAd (Str \"☐\" : Space : is) = RawInline (Format \"asciidoc\") \"[ ]\" : Space : is\n    toAd (Str \"☒\" : Space : is) = RawInline (Format \"asciidoc\") \"[x]\" : Space : is\n    toAd is = is\n    listExt = extensionsFromList [Ext_task_lists]\n\naddBlock :: PandocMonad m\n         => WriterOptions -> (Bool, Doc Text) -> Block -> ADW m (Bool, Doc Text)\naddBlock opts (containsContinuation, d) b = do\n  x <- chomp <$> blockToAsciiDoc opts b\n  return $\n    case b of\n        BulletList{}\n          | containsContinuation -> (False, d <> blankline <> x)  -- see #11006\n          | otherwise -> (False, d <> cr <> x)\n        OrderedList (start, sty, _) _\n          | containsContinuation\n          , start == 1\n          , sty == DefaultStyle -> (False, d <> blankline <> x)  -- see #11006\n          | otherwise -> (False, d <> cr <> x)\n        Para (Math DisplayMath _:_) -> (containsContinuation, d <> cr <> x)\n        Plain (Math DisplayMath _:_) -> (containsContinuation, d <> cr <> x)\n        Para{} | isEmpty d -> (containsContinuation, x)\n        Plain{} | isEmpty d -> (containsContinuation, x)\n        _ -> (True, d <> cr <> text \"+\" <> cr <> x)\n\nlistBegin :: [Block] -> Doc Text\nlistBegin blocks =\n        case blocks of\n          Para (Math DisplayMath _:_) : _  -> \"{blank}\"\n          Plain (Math DisplayMath _:_) : _ -> \"{blank}\"\n          Para _ : _                       -> empty\n          Plain _ : _                      -> empty\n          _ : _                            -> \"{blank}\"\n          []                               -> \"{blank}\"\n\n-- | Convert ordered list item (a list of blocks) to asciidoc.\norderedListItemToAsciiDoc :: PandocMonad m\n                          => WriterOptions -- ^ options\n                          -> [Block]       -- ^ list item (list of blocks)\n                          -> ADW m (Doc Text)\norderedListItemToAsciiDoc opts blocks = do\n  lev <- gets orderedListLevel\n  modify $ \\s -> s{ orderedListLevel = lev + 1 }\n  contents <- snd <$> foldM (addBlock opts) (False, empty) blocks\n  modify $ \\s -> s{ orderedListLevel = lev }\n  let marker = text (replicate (lev + 1) '.')\n  return $ marker <> text \" \" <> listBegin blocks <> contents <> cr\n\n-- | Convert definition list item (label, list of blocks) to asciidoc.\ndefinitionListItemToAsciiDoc :: PandocMonad m\n                             => WriterOptions\n                             -> ([Inline],[[Block]])\n                             -> ADW m (Doc Text)\ndefinitionListItemToAsciiDoc opts (label, defs) = do\n  labelText <- inlineListToAsciiDoc opts label\n  marker <- gets defListMarker\n  if marker == \"::\"\n     then modify (\\st -> st{ defListMarker = \";;\"})\n     else modify (\\st -> st{ defListMarker = \"::\"})\n  let divider = cr <> text \"+\" <> cr\n  let defsToAsciiDoc :: PandocMonad m => [Block] -> ADW m (Doc Text)\n      defsToAsciiDoc ds = (vcat . intersperse divider . map chomp)\n           `fmap` mapM (blockToAsciiDoc opts) ds\n  defs' <- mapM defsToAsciiDoc defs\n  modify (\\st -> st{ defListMarker = marker })\n  let contents = nest 2 $ vcat $ intersperse divider $ map chomp defs'\n  return $ labelText <> literal marker <> cr <> contents <> cr\n\n-- | Convert list of Pandoc block elements to asciidoc.\nblockListToAsciiDoc :: PandocMonad m\n                    => WriterOptions -- ^ Options\n                    -> [Block]       -- ^ List of block elements\n                    -> ADW m (Doc Text)\nblockListToAsciiDoc opts blocks =\n  mconcat `fmap` mapM (blockToAsciiDoc opts) blocks\n\ndata SpacyLocation = End | Start\n\n-- | Convert list of Pandoc inline elements to asciidoc.\ninlineListToAsciiDoc :: PandocMonad m =>\n                        WriterOptions ->\n                        [Inline] ->\n                        ADW m (Doc Text)\ninlineListToAsciiDoc opts lst = do\n  oldIntraword <- gets intraword\n  setIntraword False\n  result <- go lst\n  setIntraword oldIntraword\n  return result\n where go [] = return empty\n       go (y:x:xs)\n         | not (isSpacy End y) = do\n           y' <- if isSpacy Start x\n                    then inlineToAsciiDoc opts y\n                    else withIntraword $ inlineToAsciiDoc opts y\n           x' <- withIntraword $ inlineToAsciiDoc opts x\n           xs' <- go xs\n           return (y' <> x' <> xs')\n         | not (isSpacy Start x) = do\n           y' <- withIntraword $ inlineToAsciiDoc opts y\n           xs' <- go (x:xs)\n           return (y' <> xs')\n       go (x:xs) = do\n           x' <- inlineToAsciiDoc opts x\n           xs' <- go xs\n           return (x' <> xs')\n       isSpacy :: SpacyLocation -> Inline -> Bool\n       isSpacy _ Space = True\n       isSpacy _ LineBreak = True\n       isSpacy _ SoftBreak = True\n       -- Note that \\W characters count as spacy in AsciiDoc\n       -- for purposes of determining interword:\n       isSpacy End (Str xs) = case T.unsnoc xs of\n                                   Just (_, c) -> isPunctuation c || isSpace c\n                                   _           -> False\n       isSpacy Start (Str xs)\n         | Just (c, _) <- T.uncons xs = isPunctuation c || isSpace c\n       isSpacy End (Link{}) = True\n       isSpacy End (Image{}) = True\n       isSpacy _ _ = False\n\nsetIntraword :: PandocMonad m => Bool -> ADW m ()\nsetIntraword b = modify $ \\st -> st{ intraword = b }\n\nwithIntraword :: PandocMonad m => ADW m a -> ADW m a\nwithIntraword p = setIntraword True *> p <* setIntraword False\n\n-- | Convert Pandoc inline element to asciidoc.\ninlineToAsciiDoc :: PandocMonad m => WriterOptions -> Inline -> ADW m (Doc Text)\ninlineToAsciiDoc opts (Emph [Strong xs]) =\n  inlineToAsciiDoc opts (Strong [Emph xs])  -- see #5565\ninlineToAsciiDoc opts (Emph lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  isIntraword <- gets intraword\n  let marker = if isIntraword then \"__\" else \"_\"\n  return $ delimited marker marker contents\ninlineToAsciiDoc opts (Underline lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  return $ delimited \"[.underline]#\" \"#\" contents\ninlineToAsciiDoc opts (Strong lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  isIntraword <- gets intraword\n  let marker = if isIntraword then \"**\" else \"*\"\n  return $ delimited marker marker contents\ninlineToAsciiDoc opts (Strikeout lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  return $ delimited \"[line-through]#\" \"#\" contents\ninlineToAsciiDoc opts (Superscript lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  return $ delimited \"^\" \"^\" contents\ninlineToAsciiDoc opts (Subscript lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  return $ delimited \"~\" \"~\" contents\ninlineToAsciiDoc opts (SmallCaps lst) = do\n  contents <- inlineListToAsciiDoc opts lst\n  return $ delimited \"[smallcaps]#\" \"#\" contents\ninlineToAsciiDoc opts (Quoted qt lst) = do\n  isLegacy <- gets legacy\n  contents <- inlineListToAsciiDoc opts lst\n  pure $ case qt of\n    SingleQuote\n      | isLegacy     -> \"`\" <> contents <> \"'\"\n      | otherwise    -> \"'`\" <> contents <> \"`'\"\n    DoubleQuote\n      | isLegacy     -> \"``\" <> contents <> \"''\"\n      | otherwise    -> \"\\\"`\" <> contents <> \"`\\\"\"\ninlineToAsciiDoc _ (Code _ str) = do\n  isLegacy <- gets legacy\n  let escChar '`' = \"\\\\'\"\n      escChar c   = T.singleton c\n  parentTableLevel <- gets tableNestingLevel\n  let content\n       | isLegacy = literal (T.concatMap escChar str)\n       | otherwise = escapeString\n                       (if parentTableLevel > 0 then InTable else Normal) str\n  return $ text \"`\" <> content <> \"`\"\ninlineToAsciiDoc _ (Str str) = do\n  parentTableLevel <- gets tableNestingLevel\n  pure $ escapeString (if parentTableLevel > 0 then InTable else Normal) str\ninlineToAsciiDoc _ (Math InlineMath str) = do\n  isLegacy <- gets legacy\n  modify $ \\st -> st{ hasMath = True }\n  let content = if isLegacy\n                then \"$\" <> literal str <> \"$\"\n                else literal str\n  return $ \"latexmath:[\" <> content <> \"]\"\ninlineToAsciiDoc _ (Math DisplayMath str) = do\n  isLegacy <- gets legacy\n  modify $ \\st -> st{ hasMath = True }\n  let content = if isLegacy\n                   then \"\\\\[\" <> literal str <> \"\\\\]\"\n                   else literal str\n  inlist <- gets inList\n  let sepline = if inlist\n                   then text \"+\"\n                   else blankline\n  return $\n      (cr <> sepline) $$ \"[latexmath]\" $$ \"++++\" $$\n      content $$ \"++++\" <> cr\ninlineToAsciiDoc _ il@(RawInline f s)\n  | f == \"asciidoc\" = return $ literal s\n  | otherwise         = do\n      report $ InlineNotRendered il\n      return empty\ninlineToAsciiDoc _ LineBreak = return $ \" +\" <> cr\ninlineToAsciiDoc _ Space = return space\ninlineToAsciiDoc opts SoftBreak =\n  case writerWrapText opts of\n       WrapAuto     -> return space\n       WrapPreserve -> return cr\n       WrapNone     -> return space\ninlineToAsciiDoc opts (Cite _ lst) = inlineListToAsciiDoc opts lst\ninlineToAsciiDoc opts (Link _ txt (src, _tit)) = do\n-- relative:  link:downloads/foo.zip[download foo.zip]\n-- abs:  http://google.cod[Google]\n-- or my@email.com[email john]\n  let fixCommas (Str t) =\n        intersperse (RawInline (Format \"asciidoc\") \"&#44;\")\n          $ map Str $ T.splitOn \",\" t -- see #8070\n      fixCommas x = [x]\n\n  linktext <- inlineListToAsciiDoc opts $ walk (concatMap fixCommas) txt\n  let needsLinkPrefix = case parseURI (T.unpack src) of\n                          Just u -> uriScheme u `notElem` [\"http:\",\"https:\",\n                                                           \"ftp:\", \"irc:\",\n                                                            \"mailto:\"]\n                          _ -> True\n  let needsPassthrough = \"--\" `T.isInfixOf` src\n  let prefix = if needsLinkPrefix\n                  then text \"link:\"\n                  else empty\n  let srcSuffix = fromMaybe src (T.stripPrefix \"mailto:\" src)\n  let useAuto = case txt of\n                      [Str s] | escapeURI s == srcSuffix -> True\n                      _       -> False\n  return $\n    if needsPassthrough\n       then\n         if useAuto\n            then \"link:++\" <> literal srcSuffix <> \"++[]\"\n            else \"link:++\" <> literal src <> \"++[\" <> linktext <> \"]\"\n       else\n         if useAuto\n            then literal srcSuffix\n            else prefix <> literal src <> \"[\" <> linktext <> \"]\"\ninlineToAsciiDoc opts (Image attr alternate (src, tit)) =\n  (\"image:\" <>) <$> imageArguments opts attr alternate src tit\ninlineToAsciiDoc opts (Note [Para inlines]) =\n  inlineToAsciiDoc opts (Note [Plain inlines])\ninlineToAsciiDoc opts (Note [Plain inlines]) = do\n  contents  <- inlineListToAsciiDoc opts inlines\n  return $ text \"footnote:[\" <> contents <> \"]\"\n-- asciidoc can't handle blank lines in notes\ninlineToAsciiDoc _ (Note _) = return \"[multiblock footnote omitted]\"\ninlineToAsciiDoc opts (Span (ident,classes,_) ils) = do\n  contents <- inlineListToAsciiDoc opts ils\n  isIntraword <- gets intraword\n  let marker = if isIntraword then \"##\" else \"#\"\n  case classes of\n    [] | T.null ident -> return contents\n    [\"mark\"] | T.null ident -> return $ marker <> contents <> marker\n    _ -> do\n       let modifier = brackets $ literal $ T.unwords $\n            [ \"#\" <> ident | not (T.null ident)] ++ map (\".\" <>) classes\n       return $ modifier <> marker <> contents <> marker\n\n-- | Provides the arguments for both `image:` and `image::`\n-- e.g.: sunset.jpg[Sunset,300,200]\nimageArguments :: PandocMonad m => WriterOptions ->\n  Attr -> [Inline] -> Text -> Text ->\n  ADW m (Doc Text)\nimageArguments opts attr altText src title = do\n  let txt = if null altText || (altText == [Str \"\"])\n               then [Str . T.pack . dropExtension $ T.unpack src]\n               else altText\n  linktext <- inlineListToAsciiDoc opts txt\n  let linktitle = if T.null title\n                     then empty\n                     else \",title=\\\"\" <> literal title <> \"\\\"\"\n      showDim dir = case dimension dir attr of\n                      Just (Percent a) ->\n                        [\"scaledwidth=\" <> text (show (Percent a))]\n                      Just dim         ->\n                        [text (show dir) <> \"=\" <>\n                          literal (showInPixel opts dim)]\n                      Nothing          ->\n                        []\n      dimList = showDim Width ++ showDim Height\n      dims = if null dimList\n                then empty\n                else \",\" <> mconcat (intersperse \",\" dimList)\n  return $ literal src <> \"[\" <> linktext <> linktitle <> dims <> \"]\"\n\n-- | Adjust header rows for the fact that AsciiDoc only supports a single header row.\n--\n-- The first header row will become the single header row in AsciiDoc with the\n-- other rows becoming the top body rows.\n-- All cells of the first header row with a RowSpan > 1 will be mapped to\n-- RowSpan 1 and the remaining RowSpans of those cells wll be added as empty\n-- columns into the second row beneath them to preserve the original layout.\nadjustHeaders :: [Row] -> [Row]\nadjustHeaders [] = []\nadjustHeaders [row] = [row]\nadjustHeaders (Row attr firstHeaderCells:secondRow:remainingRows) =\n  let ((_, emptyHeaderCells), headerRow) = mapAccumL adjustHeaderRowCell (0, []) firstHeaderCells\n      secondRow' = applyEmptyCells secondRow emptyHeaderCells\n  in  Row attr headerRow:secondRow':remainingRows\n where\n  adjustHeaderRowCell (columnPosition, emptyCells) cell@(Cell cellAttr alignment (RowSpan rowSpan) (ColSpan colSpan) blocks) =\n    let nextColumnPosition = columnPosition + colSpan\n        adjustedHeaderCell = Cell cellAttr alignment (RowSpan 1) (ColSpan colSpan) blocks\n        emptyHeaderRowCell = Cell nullAttr AlignDefault (RowSpan rowSpan - 1) (ColSpan colSpan) []\n        emptyCellPosition = (columnPosition, emptyHeaderRowCell)\n    in  if rowSpan > 1\n          then ((nextColumnPosition, emptyCellPosition:emptyCells), adjustedHeaderCell)\n          else ((nextColumnPosition, emptyCells), cell)\n\n-- | Adjust footer rows for the fact that AsciiDoc only supports a single footer row.\n--\n-- The last footer row will become the single footer row in AsciiDoc with the\n-- previous footer rows becoming the bottom body rows.\n-- All column indices of cells whose RowSpans would reach that last footer row\n-- are collected and subtracted by 1. Those collected column indices will then\n-- be applied as empty columns into the last footer row to preserve the original\n-- layout.\nadjustFooters :: [Row] -> [Row]\nadjustFooters [] = []\nadjustFooters [row] = [row]\nadjustFooters rows = adjustFooters' [] (0, length rows) M.empty rows\n where\n  adjustFooters' _ _ _ [] = []\n  adjustFooters' columnIndices _ _ [row] = [applyEmptyCells row columnIndices]\n  adjustFooters' columnIndices rowInfo@(rowIndex, footerLength) previousRowSpans (row:rest) =\n    -- Need to keep track of RowSpans from previous rows and how they occupy\n    -- space in rows beneath them to be able to apply the correct column\n    -- position of RowSpans that would reach the last footer row.\n    let (previousRowSpans', row', columnIndices') = adjustFooterRow rowInfo previousRowSpans row\n        rows' = adjustFooters' (columnIndices ++ columnIndices') (rowIndex + 1, footerLength) previousRowSpans' rest\n    in  row':rows'\n\n  adjustFooterRow rowInfo previousRowSpans (Row attr cells) =\n    let ((nextColumnPosition, previousRowSpans'), cells') = mapAccumL (adjustFooterCell rowInfo) (0, previousRowSpans) cells\n        (cells'', columnIndices) = unzip cells'\n\n        -- Apply row spans from a previous row that are next to the end of the\n        -- current row's cells to keep track of the correct column position.\n        previousRowSpans'' = decrementTrailingRowSpans nextColumnPosition previousRowSpans'\n    in  (previousRowSpans'', Row attr cells'', catMaybes columnIndices)\n\n-- | Adjust footer cell for the fact that AsciiDoc only supports a single footer row.\n--\n-- Collects cells whose RowSpan would reach to the last footer row and applies\n-- them as empty cells to that last footer row.\nadjustFooterCell :: (Int, Int) -> (Int, M.Map Int (RowSpan, ColSpan)) -> Cell -> ((Int, M.Map Int (RowSpan, ColSpan)), (Cell, Maybe (Int, Cell)))\nadjustFooterCell rowInfo@(rowIndex, footerLength) (columnPosition, previousSpans) cell@(Cell _ _ (RowSpan rowSpan) (ColSpan colSpan) _)\n  | Just (ColSpan previousColSpan, previousSpans') <- takePreviousSpansAtColumn columnPosition previousSpans =\n      -- Apply row span from a previous row that occupies this column to keep\n      -- track of the correct column position.\n      adjustFooterCell rowInfo (columnPosition + previousColSpan, previousSpans') cell\n  | rowSpan > 1 && rowIndex + rowSpan >= footerLength =\n      -- Adjust row span that would reach all the way to the last footer row and\n      -- keep track of that to apply it to the last footer row.\n      ((nextColumnPosition, previousRowSpans'), (decrementRowSpanInCell cell, Just (columnPosition, emptyCellWithColSpan)))\n  | otherwise = ((nextColumnPosition, previousRowSpans'), (cell, Nothing))\n where\n  -- Keep track of this cell's RowSpan for the rows following it.\n  previousRowSpans' = insertCurrentSpansAtColumn columnPosition previousSpans (RowSpan rowSpan) (ColSpan colSpan)\n  nextColumnPosition = columnPosition + colSpan\n  emptyCellWithColSpan = Cell nullAttr AlignDefault (RowSpan 1) (ColSpan colSpan) []\n\n-- | Adjust empty rows for AsciiDoc.\n--\n-- An empty row without any cells decrements RowSpans that cover it and is\n-- removed by them to adjust for being unable to express empty rows with no\n-- cells in AsciiDoc.\nadjustEmptyRows :: [Row] -> [Row]\nadjustEmptyRows = adjustEmptyRows' . map applyInitialRowsLeft\n where\n  adjustEmptyRows' [] = []\n  adjustEmptyRows' (row:rest)\n    | maxRowSpan' <- maxRowSpan row\n    , maxRowSpan' > 1 =\n        -- Consume empty rows within the row's span.\n        let followingRows = take (maxRowSpan' - 1) rest\n            rows = consumeEmptyRows (row :| []) followingRows\n            rest' = drop (length followingRows) rest\n        in  rowFromCellsWithRowsLeft (NonEmpty.head rows) : adjustEmptyRows' (NonEmpty.tail rows ++ rest')\n    | otherwise = rowFromCellsWithRowsLeft row : adjustEmptyRows' rest\n\n  rowFromCellsWithRowsLeft (attr, cellsWithRowsLeft) = Row attr $ map fst cellsWithRowsLeft\n  cellRowSpan (Cell _ _ (RowSpan rowSpan) _ _) = rowSpan\n\n  consumeEmptyRows rows [] = NonEmpty.reverse rows\n  consumeEmptyRows rows (followingRow:restRows) =\n    if null (snd followingRow) && any rowHasRowSpanAndRowsLeft rows\n      then consumeEmptyRows (fmap (subtractRowsLeft decrementRowSpanInCell) rows) restRows -- Consume empty row for RowSpan and remove it\n      else consumeEmptyRows (followingRow <| fmap (subtractRowsLeft id) rows) restRows\n\n  rowHasRowSpanAndRowsLeft (_, cells) = any cellHasRowSpanAndRowsLeft cells\n  cellHasRowSpanAndRowsLeft (cell, rowsLeft) = cellRowSpan cell > 1 && rowsLeft >= 1\n\n  subtractRowsLeft changeCell (attr, cells) = (attr, map (subtractRowsLeftCell changeCell) cells)\n\n  subtractRowsLeftCell changeCell cellPair@(cell, rowsLeft)\n    | rowsLeft >= 1 = (changeCell cell, rowsLeft - 1)\n    | otherwise = cellPair\n\n  applyInitialRowsLeft (Row attr cells) = (attr, map applyInitialRowsLeftCell cells)\n\n  applyInitialRowsLeftCell cell\n    | rowSpan <- cellRowSpan cell, rowSpan > 1 = (cell, rowSpan - 1) -- Minus its own row\n    | otherwise = (cell, 0)\n\n  maxRowSpan (_, []) = 0\n  maxRowSpan (_, cells) = maximum $ map (cellRowSpan . fst) cells\n\n-- | Decrement the RowSpan of a Cell if that RowSpan > 1.\ndecrementRowSpanInCell :: Cell -> Cell\ndecrementRowSpanInCell cell@(Cell attr alignment (RowSpan rowSpan) colSpan blocks) =\n  if rowSpan > 1\n    then Cell attr alignment (RowSpan rowSpan - 1) colSpan blocks\n    else cell\n\n-- | Apply empty table cells at the given positions inside a Row.\napplyEmptyCells :: Row -> [(Int, Cell)] -> Row\napplyEmptyCells (Row attr cells) = Row attr . applyEmptyCells' 0 cells . sortOn fst\n where\n  applyEmptyCells' _  cells' [] = cells'\n  applyEmptyCells' currentPosition cells' ((columnPosition, columnEmptyCell@(Cell _ _ _ (ColSpan colSpan) _)):rest)\n    | columnPosition == currentPosition = columnEmptyCell : applyEmptyCells' (currentPosition + colSpan) cells' rest\n  applyEmptyCells' _ [] _ = []\n  applyEmptyCells' currentPosition (cell@(Cell _ _ _ (ColSpan currentCellColSpan) _):restCells) emptyCellList =\n    cell : applyEmptyCells' (currentPosition + currentCellColSpan) restCells emptyCellList\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/BBCode.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RankNTypes #-}\n{-# LANGUAGE Strict #-}\n{-# LANGUAGE TypeApplications #-}\n{- |\n   Module      : Text.Pandoc.Writers.BBCode\n   Copyright   : © 2025 Aleksey Myshko <git@crii.xyz>\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Aleksey Myshko <git@crii.xyz>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to various BBCode flavors.\n-}\n\nmodule Text.Pandoc.Writers.BBCode (\n  -- * Predefined writers\n  -- Writers for different flavors of BBCode. 'writeBBCode' is a synonym for\n  -- 'writeBBCode_official'\n  writeBBCode,\n  writeBBCodeOfficial,\n  writeBBCodeSteam,\n  writeBBCodePhpBB,\n  writeBBCodeFluxBB,\n  writeBBCodeHubzilla,\n  writeBBCodeXenforo,\n\n  -- * Extending the writer\n  -- $extending\n  FlavorSpec (..),\n  WriterState (..),\n  RR,\n  writeBBCodeCustom,\n  inlineToBBCode,\n  inlineListToBBCode,\n  blockToBBCode,\n  blockListToBBCode,\n\n  -- ** Handling attributes\n  -- $wrapping_spans_divs\n  attrToMap,\n\n  -- * Predefined flavor specifications\n  officialSpec,\n  steamSpec,\n  phpbbSpec,\n  fluxbbSpec,\n  hubzillaSpec,\n  xenforoSpec,\n) where\n\nimport Control.Applicative (some)\nimport Control.Monad (forM)\nimport Control.Monad.Reader (MonadReader (..), ReaderT (..), asks)\nimport Control.Monad.State (MonadState (..), StateT, evalStateT, gets, modify)\nimport Data.Default (Default (..))\nimport Data.Either (isRight)\nimport Data.Foldable (toList)\nimport Data.Map.Strict (Map)\nimport qualified Data.Map.Strict as Map\nimport Data.Maybe (fromMaybe, isJust)\nimport Data.Sequence (Seq, (|>))\nimport qualified Data.Sequence as Seq\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.DocLayout hiding (char, link, text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging (LogMessage (..))\nimport Text.Pandoc.Options (WriterOptions (..))\nimport Text.Pandoc.Parsing (char, digit, eof, readWith)\nimport Text.Pandoc.Shared (inquotes, onlySimpleTableCells, removeFormatting, trim, tshow)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.URI (escapeURI)\nimport Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable, unsmartify)\nimport Text.Read (readMaybe)\n\n-- Type synonym to prevent haddock-generated HTML from overflowing\ntype PandocTable =\n  (Attr, Caption, [ColSpec], TableHead, [TableBody], TableFoot)\n\n-- $extending\n-- If you want to support more Pandoc elements (or render some of them\n-- differently) you can do so by creating your own 'FlavorSpec'\n--\n-- The module exports the @'FlavorSpec'@s underlying @writeBBCode_*@ functions,\n-- namely 'officialSpec', 'steamSpec', 'phpbbSpec', 'fluxbbSpec',\n-- 'hubzillaSpec'.\n--\n-- You can create and use your own renderers, for instance here we define a\n-- renderer for 'CodeBlock' and use it to create a derivative format:\n--\n-- > renderCodeBlockCustom :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\n-- > renderCodeBlockCustom (_, cls, _) code = do\n-- >   let opening = case cls of\n-- >         (lang : _) -> \"[code=\" <> lang <> \"]\"\n-- >         (\"c++\" : _) -> \"[code=cpp]\"\n-- >         _ -> \"[code]\"\n-- >   pure $ mconcat [literal opening, literal code, cr, \"[/code]\"]\n-- >\n-- > specCustom = officialSpec{renderCodeBlock = renderCodeBlockCustom}\n--\n-- Then we can use it to render 'Pandoc' document via 'writeBBCode_custom'\n\n{- | Data type that is a collection of renderers for most elements in a Pandoc\nAST (see 'Block' and 'Inline')\n\nThe intention here is to allow inheritance between formats, for instance if\nformat A and format @B@ differ only in rendering tables, @B@ can be implemented\nas @A{'renderTable' = renderTableB}@\n-}\ndata FlavorSpec = FlavorSpec\n  { renderBlockQuote ::\n      forall m.\n      (PandocMonad m) =>\n      [Block] ->\n      RR m (Doc Text)\n  -- ^ Render 'BlockQuote'\n  , renderBulletList ::\n      forall m.\n      (PandocMonad m) =>\n      [[Block]] ->\n      RR m (Doc Text)\n  -- ^ Render 'BulletList'\n  , renderCodeBlock ::\n      forall m.\n      (PandocMonad m) =>\n      Attr ->\n      Text ->\n      RR m (Doc Text)\n  -- ^ Render 'CodeBlock'\n  , renderDefinitionList ::\n      forall m.\n      (PandocMonad m) =>\n      [([Inline], [[Block]])] ->\n      RR m (Doc Text)\n  -- ^ Render 'DefinitionList'\n  , renderHeader ::\n      forall m.\n      (PandocMonad m) =>\n      Int ->\n      Attr ->\n      [Inline] ->\n      RR m (Doc Text)\n  -- ^ Render 'Header'\n  , renderInlineCode ::\n      forall m.\n      (PandocMonad m) =>\n      Attr ->\n      Text ->\n      RR m (Doc Text)\n  -- ^ Render 'Code'\n  , renderLink ::\n      forall m.\n      (PandocMonad m) =>\n      Attr ->\n      [Inline] ->\n      Target ->\n      RR m (Doc Text)\n  -- ^ Render 'Link'\n  , renderOrderedList ::\n      forall m.\n      (PandocMonad m) =>\n      ListAttributes ->\n      [[Block]] ->\n      RR m (Doc Text)\n  -- ^ Render 'OrderedList'\n  , renderStrikeout ::\n      forall m.\n      (PandocMonad m) =>\n      [Inline] ->\n      RR m (Doc Text)\n  -- ^ Render 'Strikeout'\n  , renderTable :: forall m. (PandocMonad m) => PandocTable -> RR m (Doc Text)\n  -- ^ Render 'Table'\n  , renderHorizontalRule ::\n      forall m.\n      (PandocMonad m) =>\n      RR m (Doc Text)\n  -- ^ Render 'HorizontalRule'\n  , renderLineBlock ::\n      forall m.\n      (PandocMonad m) =>\n      [[Inline]] ->\n      RR m (Doc Text)\n  -- ^ Render 'LineBlock'\n  , renderPara ::\n      forall m.\n      (PandocMonad m) =>\n      [Inline] ->\n      RR m (Doc Text)\n  -- ^ Render 'Para'\n  , renderSuperscript ::\n      forall m.\n      (PandocMonad m) =>\n      [Inline] ->\n      RR m (Doc Text)\n  -- ^ Render 'Superscript'\n  , renderSubscript :: forall m. (PandocMonad m) => [Inline] -> RR m (Doc Text)\n  -- ^ Render 'Subscript'\n  , renderSmallCaps :: forall m. (PandocMonad m) => [Inline] -> RR m (Doc Text)\n  -- ^ Render 'SmallCaps'\n  , renderCite ::\n      forall m.\n      (PandocMonad m) =>\n      [Citation] ->\n      [Inline] ->\n      RR m (Doc Text)\n  -- ^ Render 'Cite'\n  , renderNote :: forall m. (PandocMonad m) => [Block] -> RR m (Doc Text)\n  -- ^ Render 'Note'\n  , renderFigure ::\n      forall m.\n      (PandocMonad m) =>\n      Attr ->\n      Caption ->\n      [Block] ->\n      RR m (Doc Text)\n  -- ^ Render 'Figure'\n  , renderQuoted ::\n      forall m.\n      (PandocMonad m) =>\n      QuoteType ->\n      [Inline] ->\n      RR m (Doc Text)\n  -- ^ Render 'Quoted'\n  , renderMath ::\n      forall m.\n      (PandocMonad m) =>\n      MathType ->\n      Text ->\n      RR m (Doc Text)\n  -- ^ Render 'Math'\n  , renderImage ::\n      forall m.\n      (PandocMonad m) =>\n      Attr ->\n      [Inline] ->\n      Target ->\n      RR m (Doc Text)\n  -- ^ Render 'Image'\n  , wrapSpanDiv :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\n  -- ^ Wrap document in bbcode tags based on attributes/classes. Boolean flag\n  -- indicates whether passed argument is a Div or a Span (True means Div)\n  }\n\ndata WriterState = WriterState\n  { writerOptions :: WriterOptions\n  , flavorSpec :: FlavorSpec\n  , inList :: Bool\n  }\n\ninstance Default WriterState where\n  def =\n    WriterState\n      { writerOptions = def\n      , flavorSpec = officialSpec\n      , inList = False\n      }\n\n-- | The base of a renderer monad.\ntype RR m a = StateT (Seq (Doc Text)) (ReaderT WriterState m) a\n\npandocToBBCode :: (PandocMonad m) => Pandoc -> RR m Text\npandocToBBCode (Pandoc meta body) = do\n  opts <- asks writerOptions\n  -- Run the rendering that mutates the state by producing footnotes\n  bodyContents <- blockListToBBCode body\n  -- Get the footnotes\n  footnotes <- get\n  -- Separate footnotes (if any) with a horizontal rule\n  footnotesSep <-\n    if null footnotes\n      then pure empty\n      else\n        (\\hr -> blankline <> hr <> blankline)\n          <$> blockToBBCode HorizontalRule\n  -- Put footnotes after the main text\n  let docText = bodyContents <> footnotesSep <> vsep (toList footnotes)\n  metadata <- metaToContext opts blockListToBBCode inlineListToBBCode meta\n  let context = defField \"body\" docText metadata\n  case writerTemplate opts of\n    Just tpl -> pure $ render Nothing (renderTemplate tpl context)\n    Nothing -> pure $ render Nothing docText\n\nwriteBBCode\n  , writeBBCodeOfficial\n  , writeBBCodeSteam\n  , writeBBCodePhpBB\n  , writeBBCodeFluxBB\n  , writeBBCodeHubzilla\n  , writeBBCodeXenforo ::\n    (PandocMonad m) => WriterOptions -> Pandoc -> m Text\nwriteBBCode = writeBBCodeOfficial\nwriteBBCodeOfficial = writeBBCodeCustom officialSpec\nwriteBBCodeSteam = writeBBCodeCustom steamSpec\nwriteBBCodePhpBB = writeBBCodeCustom phpbbSpec\nwriteBBCodeFluxBB = writeBBCodeCustom fluxbbSpec\nwriteBBCodeHubzilla = writeBBCodeCustom hubzillaSpec\nwriteBBCodeXenforo = writeBBCodeCustom xenforoSpec\n\n{- | Convert a 'Pandoc' document to BBCode using the given 'FlavorSpec' and\n'WriterOptions'.\n-}\nwriteBBCodeCustom ::\n  (PandocMonad m) => FlavorSpec -> WriterOptions -> Pandoc -> m Text\nwriteBBCodeCustom spec opts document =\n  runRR mempty def{writerOptions = opts, flavorSpec = spec} $\n    pandocToBBCode document\n where\n  runRR :: (Monad m) => Seq (Doc Text) -> WriterState -> RR m a -> m a\n  runRR footnotes writerState action =\n    runReaderT (evalStateT action footnotes) writerState\n\nblockListToBBCode :: (PandocMonad m) => [Block] -> RR m (Doc Text)\nblockListToBBCode blocks =\n  chomp . vsep . filter (not . null)\n    <$> mapM blockToBBCode blocks\n\nblockToBBCode :: (PandocMonad m) => Block -> RR m (Doc Text)\nblockToBBCode block = do\n  spec <- asks flavorSpec\n  case block of\n    Plain inlines -> inlineListToBBCode inlines\n    Para inlines -> renderPara spec inlines\n    LineBlock inliness -> renderLineBlock spec inliness\n    CodeBlock attr code -> renderCodeBlock spec attr code\n    RawBlock format raw -> case format of\n      \"bbcode\" -> pure $ literal raw\n      _ -> \"\" <$ report (BlockNotRendered block)\n    BlockQuote blocks -> renderBlockQuote spec blocks\n    OrderedList attr items -> renderOrderedList spec attr items\n    BulletList items -> renderBulletList spec items\n    DefinitionList items -> renderDefinitionList spec items\n    Header level attr inlines -> renderHeader spec level attr inlines\n    HorizontalRule -> renderHorizontalRule spec\n    Table attr blkCapt specs thead tbody tfoot ->\n      renderTable spec (attr, blkCapt, specs, thead, tbody, tfoot)\n    Figure attr caption blocks -> renderFigure spec attr caption blocks\n    Div attr blocks -> do\n      contents <- blockListToBBCode blocks\n      let kvcMap = attrToMap attr\n      -- whether passed contents is a Div (Block) element\n      --                      vvvv\n      pure $ wrapSpanDiv spec True kvcMap contents\n\ninlineToBBCode :: (PandocMonad m) => Inline -> RR m (Doc Text)\ninlineToBBCode inline = do\n  spec <- asks flavorSpec\n  case inline of\n    Str str -> do\n      opts <- asks writerOptions\n      pure . literal $ unsmartify opts str\n    Emph inlines -> do\n      contents <- inlineListToBBCode inlines\n      pure $ mconcat [\"[i]\", contents, \"[/i]\"]\n    Underline inlines -> do\n      contents <- inlineListToBBCode inlines\n      pure $ mconcat [\"[u]\", contents, \"[/u]\"]\n    Strong inlines -> do\n      contents <- inlineListToBBCode inlines\n      pure $ mconcat [\"[b]\", contents, \"[/b]\"]\n    Strikeout inlines -> renderStrikeout spec inlines\n    Superscript inlines -> renderSuperscript spec inlines\n    Subscript inlines -> renderSubscript spec inlines\n    SmallCaps inlines -> renderSmallCaps spec inlines\n    Quoted typ inlines -> renderQuoted spec typ inlines\n    Cite cits inlines -> renderCite spec cits inlines\n    Code attr code -> renderInlineCode spec attr code\n    Space -> pure space\n    SoftBreak -> pure space\n    LineBreak -> pure cr\n    Math typ math -> renderMath spec typ math\n    RawInline (Format format) text -> case format of\n      \"bbcode\" -> pure $ literal text\n      _ -> \"\" <$ report (InlineNotRendered inline)\n    Link attr txt target -> renderLink spec attr txt target\n    Image attr alt target -> renderImage spec attr alt target\n    Note blocks -> renderNote spec blocks\n    Span attr inlines -> do\n      contents <- inlineListToBBCode inlines\n      let kvcMap = attrToMap attr\n      -- whether passed contents is a Div (Block element)\n      --                      vvvvv\n      pure $ wrapSpanDiv spec False kvcMap contents\n\nrenderImageDefault ::\n  (PandocMonad m) => Attr -> [Inline] -> Target -> RR m (Doc Text)\nrenderImageDefault (_, _, kvList) alt (source, title) = do\n  altText <-\n    trim . render Nothing\n      <$> inlineListToBBCode (removeFormatting alt)\n  let kvMap = Map.fromList kvList\n  -- No BBCode flavor supported by the Writer has local images support, but we\n  -- still allow source to be plain path or anything else\n  pure . literal $\n    mconcat\n      [ \"[img\"\n      , if T.null altText\n          then \"\"\n          else \" alt=\" <> inquotes altText\n      , if T.null title\n          then \"\"\n          else \" title=\" <> inquotes title\n      , case Map.lookup \"width\" kvMap of\n          Just w\n            | isJust (readMaybe @Int $ T.unpack w) ->\n                \" width=\" <> inquotes w\n          _ -> \"\"\n      , case Map.lookup \"height\" kvMap of\n          Just h\n            | isJust (readMaybe @Int $ T.unpack h) ->\n                \" height=\" <> inquotes h\n          _ -> \"\"\n      , \"]\"\n      , source\n      , \"[/img]\"\n      ]\n\nrenderImageOmit ::\n  (PandocMonad m) => Attr -> [Inline] -> Target -> RR m (Doc Text)\nrenderImageOmit _ _ _ = pure \"\"\n\n{- | Basic phpBB doesn't support any attributes, although\n@[img src=https://example.com]whatever[/img]@ is supported, but text in tag has\nno effect\n-}\nrenderImagePhpBB ::\n  (PandocMonad m) => Attr -> [Inline] -> Target -> RR m (Doc Text)\nrenderImagePhpBB _ _ (source, _) =\n  pure . literal $ mconcat [\"[img]\", source, \"[/img]\"]\n\nrenderImageXenforo ::\n  (PandocMonad m) => Attr -> [Inline] -> Target -> RR m (Doc Text)\nrenderImageXenforo (_, _, kvList) alt (source, title) = do\n  altText <-\n    trim . render Nothing\n      <$> inlineListToBBCode (removeFormatting alt)\n  let kvMap = Map.fromList kvList\n  -- No BBCode flavor supported by the Writer has local images support, but we\n  -- still allow source to be plain path or anything else\n  pure . literal $\n    mconcat\n      [ \"[img\"\n      , if T.null altText\n          then \"\"\n          else \" alt=\" <> inquotes altText\n      , if T.null title\n          then \"\"\n          else \" title=\" <> inquotes title\n      , case Map.lookup \"width\" kvMap of\n          Just w\n            | isRight (readWith sizeP Nothing w) ->\n                \" width=\" <> w\n          _ -> \"\"\n      , \"]\"\n      , source\n      , \"[/img]\"\n      ]\n where\n  sizeP = some digit >> char '%' >> eof\n\n{- | Check whether character is a bracket\n\n>>> T.filter notBracket \"[a]b[[ó]qü]]n®\"\n\"ab\\243q\\252n\\174\"\n-}\nnotBracket :: Char -> Bool\nnotBracket = \\case\n  '[' -> False\n  ']' -> False\n  _ -> True\n\n-- FluxBB uses [img=alt text] instead of [img alt=\"alt text\"]\nrenderImageFluxBB ::\n  (PandocMonad m) => Attr -> [Inline] -> Target -> RR m (Doc Text)\nrenderImageFluxBB _ alt (source, _) = do\n  alt' <- T.filter notBracket . render Nothing <$> inlineListToBBCode alt\n  pure . literal $\n    mconcat\n      [ \"[img\"\n      , if T.null alt'\n          then \"\"\n          else \"=\" <> alt'\n      , \"]\"\n      , source\n      , \"[/img]\"\n      ]\n\ninlineListToBBCode :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\ninlineListToBBCode inlines = mconcat <$> mapM inlineToBBCode inlines\n\n-- Taken from Data.Ord\nclamp :: (Ord a) => (a, a) -> a -> a\nclamp (low, high) a = min high (max a low)\n\nrenderHeaderDefault ::\n  (PandocMonad m) => Int -> Attr -> [Inline] -> RR m (Doc Text)\nrenderHeaderDefault level _attr inlines =\n  case clamp (1, 4) level of\n    1 -> inlineToBBCode $ Underline [Strong inlines]\n    2 -> inlineToBBCode $ Strong inlines\n    3 -> inlineToBBCode $ Underline inlines\n    _ -> inlineListToBBCode inlines\n\n-- Adapted from Text.Pandoc.Writers.Org\nrenderLinkDefault ::\n  (PandocMonad m) => Attr -> [Inline] -> Target -> RR m (Doc Text)\nrenderLinkDefault _ txt (src, _) =\n  case txt of\n    [Str x]\n      | escapeURI x == src ->\n          pure $ \"[url]\" <> literal x <> \"[/url]\"\n    _ -> do\n      contents <- inlineListToBBCode txt\n      let suffix = if T.null src then \"\" else \"=\" <> src\n      pure $ \"[url\" <> literal suffix <> \"]\" <> contents <> \"[/url]\"\n\nrenderCodeBlockDefault :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\nrenderCodeBlockDefault (_, cls, _) code = do\n  let opening = case cls of\n        (lang : _) -> \"[code=\" <> lang <> \"]\"\n        _ -> \"[code]\"\n  pure $ mconcat [literal opening, literal code, cr, \"[/code]\"]\n\nrenderCodeBlockSimple :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\nrenderCodeBlockSimple _ code = do\n  pure $ mconcat [literal \"[code]\", literal code, cr, \"[/code]\"]\n\nrenderInlineCodeLiteral :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\nrenderInlineCodeLiteral _ code = pure $ literal code\n\nrenderInlineCodeNoParse :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\nrenderInlineCodeNoParse _ code =\n  pure $ mconcat [literal \"[noparse]\", literal code, \"[/noparse]\"]\n\nrenderInlineCodeHubzilla :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\nrenderInlineCodeHubzilla _ code =\n  pure $ mconcat [literal \"[code]\", literal code, \"[/code]\"]\n\nrenderInlineCodeXenforo :: (PandocMonad m) => Attr -> Text -> RR m (Doc Text)\nrenderInlineCodeXenforo _ code =\n  pure $ mconcat [literal \"[icode]\", literal code, \"[/icode]\"]\n\nrenderStrikeoutDefault :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\nrenderStrikeoutDefault inlines = do\n  contents <- inlineListToBBCode inlines\n  pure $ mconcat [\"[s]\", contents, \"[/s]\"]\n\nrenderStrikeoutSteam :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\nrenderStrikeoutSteam inlines = do\n  contents <- inlineListToBBCode inlines\n  pure $ mconcat [\"[strike]\", contents, \"[/strike]\"]\n\nrenderDefinitionListDefault ::\n  (PandocMonad m) => [([Inline], [[Block]])] -> RR m (Doc Text)\nrenderDefinitionListDefault items = do\n  items' <- forM items $ \\(term, definitions) -> do\n    term' <- inlineListToBBCode term\n    definitions' <- blockToBBCode (BulletList definitions)\n    pure $ term' $$ definitions'\n  pure $ vcat items'\n\nrenderDefinitionListHubzilla ::\n  (PandocMonad m) => [([Inline], [[Block]])] -> RR m (Doc Text)\nrenderDefinitionListHubzilla items = do\n  items' <- forM items $ \\(term, definitions) -> do\n    term' <- inlineListToBBCode term\n    let term'' = \"[*= \" <> term' <> \"]\"\n    definitions' <- forM definitions blockListToBBCode\n    pure $ vcat (term'' : definitions')\n  pure $ vcat (literal \"[dl terms=\\\"b\\\"]\" : items' ++ [literal \"[/dl]\"])\n\nlistWithTags ::\n  (PandocMonad m) =>\n  Text ->\n  Text ->\n  ([[Block]] -> RR m [Doc Text]) ->\n  [[Block]] ->\n  RR m (Doc Text)\nlistWithTags open close renderItems items = do\n  contents <- local (\\s -> s{inList = True}) (renderItems items)\n  pure $ vcat $ literal open : contents ++ [literal close]\n\nstarListItems :: (PandocMonad m) => [[Block]] -> RR m [Doc Text]\nstarListItems items = forM items $ \\item -> do\n  item' <- blockListToBBCode item\n  pure $ literal \"[*]\" <> item'\n\nlistStyleCode :: ListNumberStyle -> Maybe Text\nlistStyleCode = \\case\n  Decimal -> Just \"1\"\n  DefaultStyle -> Just \"1\"\n  LowerAlpha -> Just \"a\"\n  UpperAlpha -> Just \"A\"\n  LowerRoman -> Just \"i\"\n  UpperRoman -> Just \"I\"\n  Example -> Nothing\n\nrenderBulletListOfficial :: (PandocMonad m) => [[Block]] -> RR m (Doc Text)\nrenderBulletListOfficial = listWithTags \"[list]\" \"[/list]\" starListItems\n\nrenderBulletListHubzilla :: (PandocMonad m) => [[Block]] -> RR m (Doc Text)\nrenderBulletListHubzilla = listWithTags \"[ul]\" \"[/ul]\" starListItems\n\nrenderOrderedListHubzilla ::\n  (PandocMonad m) => ListAttributes -> [[Block]] -> RR m (Doc Text)\nrenderOrderedListHubzilla (_, style, _) = case style of\n  DefaultStyle -> listWithTags \"[ol]\" \"[/ol]\" starListItems\n  Example -> listWithTags \"[ol]\" \"[/ol]\" starListItems\n  _ -> listWithTags (\"[list=\" <> suffix <> \"]\") \"[/list]\" starListItems\n where\n  suffix = fromMaybe \"1\" $ listStyleCode style\n\nrenderOrderedListOfficial ::\n  (PandocMonad m) => ListAttributes -> [[Block]] -> RR m (Doc Text)\nrenderOrderedListOfficial (_, style, _) = do\n  let suffix = maybe \"\" (\"=\" <>) (listStyleCode style)\n  listWithTags (\"[list\" <> suffix <> \"]\") \"[/list]\" starListItems\n\nrenderOrderedListSteam ::\n  (PandocMonad m) => ListAttributes -> [[Block]] -> RR m (Doc Text)\nrenderOrderedListSteam _ =\n  listWithTags \"[olist]\" \"[/olist]\" starListItems\n\nrenderHeaderSteam ::\n  (PandocMonad m) => Int -> Attr -> [Inline] -> RR m (Doc Text)\nrenderHeaderSteam level _ inlines = do\n  body <- inlineListToBBCode inlines\n  let capped = clamp (1, 3) level\n      open = \"[h\" <> tshow capped <> \"]\"\n      close = \"[/h\" <> tshow capped <> \"]\"\n  pure $ literal open <> body <> literal close\n\nrenderHeaderHubzilla ::\n  (PandocMonad m) => Int -> Attr -> [Inline] -> RR m (Doc Text)\nrenderHeaderHubzilla level _ inlines = do\n  body <- inlineListToBBCode inlines\n  let capped = clamp (1, 6) level\n      open = \"[h\" <> tshow capped <> \"]\"\n      close = \"[/h\" <> tshow capped <> \"]\"\n  pure $ literal open <> body <> literal close\n\n-- xenForo supports levels 1--3, but levels other than 1--3 become div with\n-- .bbHeading class which can be linked to.\nrenderHeaderXenforo ::\n  (PandocMonad m) => Int -> Attr -> [Inline] -> RR m (Doc Text)\nrenderHeaderXenforo level _ inlines = do\n  body <- inlineListToBBCode inlines\n  let capped = max 1 level\n      open = \"[heading=\" <> tshow capped <> \"]\"\n      close = \"[/heading]\"\n  pure $ literal open <> body <> literal close\n\nrenderTableGeneric ::\n  (PandocMonad m) =>\n  Text ->\n  Text ->\n  Text ->\n  (Attr, Caption, [ColSpec], TableHead, [TableBody], TableFoot) ->\n  RR m (Doc Text)\nrenderTableGeneric tableTag headerCellTag bodyCellTag table = do\n  caption' <- inlineListToBBCode caption\n  table' <-\n    if not simpleCells\n      then \"\" <$ report (BlockNotRendered tableBlock)\n      else do\n        headerDocs <-\n          if null headers\n            then pure []\n            else pure <$> renderTableRow headerCellTag headers\n        rowDocs <- mapM (renderTableRow bodyCellTag) rows\n        pure $ renderTable' headerDocs rowDocs\n  pure $ caption' $$ table'\n where\n  (attr, blkCapt, specs, thead, tbody, tfoot) = table\n  (caption, _, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  tableBlock = Table attr blkCapt specs thead tbody tfoot\n  simpleCells = onlySimpleTableCells (headers : rows)\n  renderTable' headerDocs rowDocs =\n    vcat\n      [ literal (\"[\" <> tableTag <> \"]\")\n      , vcat headerDocs\n      , vcat rowDocs\n      , literal (\"[/\" <> tableTag <> \"]\")\n      ]\n  renderCell cellTag cellDoc =\n    mconcat\n      [ literal (\"[\" <> cellTag <> \"]\")\n      , cellDoc\n      , literal (\"[/\" <> cellTag <> \"]\")\n      ]\n  renderTableRow cellTag cells = do\n    renderedCells <- mapM blockListToBBCode cells\n    let cellsDoc = mconcat $ map (renderCell cellTag) renderedCells\n    pure $ literal \"[tr]\" <> cellsDoc <> literal \"[/tr]\"\n\nrenderTableDefault ::\n  (PandocMonad m) =>\n  ( Attr\n  , Caption\n  , [ColSpec]\n  , TableHead\n  , [TableBody]\n  , TableFoot\n  ) ->\n  RR m (Doc Text)\nrenderTableDefault = renderTableGeneric \"table\" \"th\" \"td\"\n\nrenderTableOmit ::\n  (PandocMonad m) =>\n  ( Attr\n  , Caption\n  , [ColSpec]\n  , TableHead\n  , [TableBody]\n  , TableFoot\n  ) ->\n  RR m (Doc Text)\nrenderTableOmit (_, blkCapt, specs, thead, tbody, tfoot) = do\n  let (caption, _, _, _, _) = toLegacyTable blkCapt specs thead tbody tfoot\n  caption' <- inlineListToBBCode caption\n  pure $ caption' $$ \"(TABLE)\"\n\n-- $wrapping_spans_divs\n-- Consider attribute a key-value pair with a Just value, and respectively\n-- class is key-value pair with Nothing value.\n-- For instance, given @(\"\", [\"cl1\"], [(\"k\", \"v\")]) :: 'Attr'@, respective Map\n-- should look like @'Map.fromList' [(\"cl1\", 'Nothing'), (\"k\", 'Just' \"v\")]@\n--\n-- This transformation is handled by 'attrToMap'\n--\n-- Example definition of a wrapSpanDiv:\n--\n-- > {-# LANGUAGE OverloadedStrings #-}\n-- > import Data.Map (Map)\n-- > import qualified Data.Map as Map\n-- > import Text.DocLayout\n-- > import Data.Text (Text)\n-- > import qualified Data.Text as T\n-- >\n-- > wrapSpanDivSteam :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\n-- > wrapSpanDivSteam isDiv kvc doc = Map.foldrWithKey wrap doc kvc\n-- >  where\n-- >   wrap \"spoiler\" (Just _) acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n-- >   wrap \"spoiler\" Nothing acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n-- >   wrap _ _ acc = acc\n--\n-- To verify it works, wrap some text in unnamed spoiler\n--\n-- >>> render Nothing $ wrapSpanDivSteam True (attrToMap (\"\", [\"spoiler\"], [])) \"I am text\"\n-- \"[spoiler]I am text[/spoiler]\"\n\n{- | The goal of the transformation is to treat classes and key-value pairs\nuniformly.\n\nClass list becomes Map where all values are Nothing, and list of key-value\npairs is converted to Map via 'Map.toList'. Both Maps are then merged.\n-}\nattrToMap :: Attr -> Map Text (Maybe Text)\nattrToMap (_, classes, kvList) =\n  Map.fromList kvList' `Map.union` Map.fromList classes'\n where\n  kvList' = map (\\(k, v) -> (k, Just v)) kvList\n  classes' = map (\\k -> (k, Nothing)) classes\n\nwrapSpanDivOfficial :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\nwrapSpanDivOfficial isDiv kvc doc = Map.foldrWithKey wrap doc kvc\n where\n  wrap \"left\" Nothing acc | isDiv = \"[left]\" <> acc <> \"[/left]\"\n  wrap \"center\" Nothing acc | isDiv = \"[center]\" <> acc <> \"[/center]\"\n  wrap \"right\" Nothing acc | isDiv = \"[right]\" <> acc <> \"[/right]\"\n  wrap \"spoiler\" Nothing acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n  wrap \"spoiler\" (Just v) acc\n    | isDiv =\n        literal (\"[spoiler=\" <> T.filter notBracket v <> \"]\")\n          <> acc\n          <> \"[/spoiler]\"\n  wrap \"size\" (Just v) acc\n    | Just v' <- readMaybe @Int (T.unpack v)\n    , v' > 0 =\n        literal (\"[size=\" <> v <> \"]\") <> acc <> \"[/size]\"\n  wrap \"color\" (Just v) acc =\n    literal (\"[color=\" <> v <> \"]\") <> acc <> \"[/color]\"\n  wrap _ _ acc = acc\n\nwrapSpanDivSteam :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\nwrapSpanDivSteam isDiv kvc doc = Map.foldrWithKey wrap doc kvc\n where\n  wrap \"spoiler\" (Just _) acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n  wrap \"spoiler\" Nothing acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n  wrap _ _ acc = acc\n\nwrapSpanDivPhpBB :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\nwrapSpanDivPhpBB _ kvc doc = Map.foldrWithKey wrap doc kvc\n where\n  wrap \"color\" (Just v) acc =\n    literal (\"[color=\" <> v <> \"]\") <> acc <> \"[/color]\"\n  wrap _ _ acc = acc\n\nwrapSpanDivFluxBB :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\nwrapSpanDivFluxBB _ kvc doc = Map.foldrWithKey wrap doc kvc\n where\n  wrap \"color\" (Just v) acc =\n    literal (\"[color=\" <> v <> \"]\") <> acc <> \"[/color]\"\n  wrap _ _ acc = acc\n\nwrapSpanDivHubzilla :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\nwrapSpanDivHubzilla isDiv kvc doc = Map.foldrWithKey wrap doc kvc\n where\n  wrap \"center\" Nothing acc | isDiv = \"[center]\" <> acc <> \"[/center]\"\n  wrap \"spoiler\" Nothing acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n  wrap \"spoiler\" (Just v) acc\n    | isDiv =\n        literal (\"[spoiler=\" <> T.filter notBracket v <> \"]\")\n          <> acc\n          <> \"[/spoiler]\"\n  wrap \"size\" (Just v) acc\n    | Just v' <- readMaybe @Int (T.unpack v)\n    , v' > 0 =\n        literal (\"[size=\" <> v <> \"]\") <> acc <> \"[/size]\"\n  wrap \"color\" (Just v) acc =\n    literal (\"[color=\" <> v <> \"]\") <> acc <> \"[/color]\"\n  wrap \"font\" (Just v) acc = literal (\"[font=\" <> v <> \"]\") <> acc <> \"[/font]\"\n  wrap _ _ acc = acc\n\nwrapSpanDivXenforo :: Bool -> Map Text (Maybe Text) -> Doc Text -> Doc Text\nwrapSpanDivXenforo isDiv kvc doc = Map.foldrWithKey wrap doc kvc\n where\n  wrap \"left\" Nothing acc | isDiv = \"[left]\" <> acc <> \"[/left]\"\n  wrap \"center\" Nothing acc | isDiv = \"[center]\" <> acc <> \"[/center]\"\n  wrap \"right\" Nothing acc | isDiv = \"[right]\" <> acc <> \"[/right]\"\n  wrap \"spoiler\" _ acc | not isDiv = \"[ispoiler]\" <> acc <> \"[/ispoiler]\"\n  wrap \"spoiler\" Nothing acc | isDiv = \"[spoiler]\" <> acc <> \"[/spoiler]\"\n  wrap \"spoiler\" (Just v) acc\n    | isDiv =\n        literal (\"[spoiler=\" <> T.filter notBracket v <> \"]\")\n          <> acc\n          <> \"[/spoiler]\"\n  wrap \"size\" (Just v) acc\n    | Just v' <- readMaybe @Int (T.unpack v)\n    , v' > 0 =\n        literal (\"[size=\" <> v <> \"]\") <> acc <> \"[/size]\"\n  wrap \"color\" (Just v) acc =\n    literal (\"[color=\" <> v <> \"]\") <> acc <> \"[/color]\"\n  wrap \"font\" (Just v) acc = literal (\"[font=\" <> v <> \"]\") <> acc <> \"[/font]\"\n  wrap _ _ acc = acc\n\nrenderOrderedListFluxbb ::\n  (PandocMonad m) =>\n  ListAttributes ->\n  [[Block]] ->\n  RR m (Doc Text)\nrenderOrderedListFluxbb (_, style, _) =\n  let suffix = case style of\n        LowerAlpha -> \"=a\"\n        UpperAlpha -> \"=a\"\n        _ -> \"=1\"\n   in listWithTags (\"[list\" <> suffix <> \"]\") \"[/list]\" starListItems\n\nrenderOrderedListXenforo ::\n  (PandocMonad m) =>\n  ListAttributes ->\n  [[Block]] ->\n  RR m (Doc Text)\nrenderOrderedListXenforo _ =\n  listWithTags \"[list=1]\" \"[/list]\" starListItems\n\nrenderLinkEmailAware ::\n  (PandocMonad m) =>\n  Attr ->\n  [Inline] ->\n  Target ->\n  RR m (Doc Text)\nrenderLinkEmailAware attr txt target@(src, _) = do\n  case T.stripPrefix \"mailto:\" src of\n    Just address -> do\n      linkText <- inlineListToBBCode txt\n      let isAutoEmail = case txt of\n            [Str x] -> x == address\n            _ -> False\n      pure $\n        if isAutoEmail\n          then literal \"[email]\" <> literal address <> \"[/email]\"\n          else literal (\"[email=\" <> address <> \"]\") <> linkText <> \"[/email]\"\n    Nothing -> renderLinkDefault attr txt target\n\nrenderBlockQuoteDefault :: (PandocMonad m) => [Block] -> RR m (Doc Text)\nrenderBlockQuoteDefault blocks = do\n  contents <- blockListToBBCode blocks\n  pure $ vcat [\"[quote]\", contents, \"[/quote]\"]\n\nrenderBlockQuoteFluxBB :: (PandocMonad m) => [Block] -> RR m (Doc Text)\nrenderBlockQuoteFluxBB blocks = do\n  contents <- blockListToBBCode blocks\n  isInList <- asks inList\n  if isInList\n    then \"\" <$ report (BlockNotRendered $ BlockQuote blocks)\n    else pure $ vcat [\"[quote]\", contents, \"[/quote]\"]\n\nrenderHorizontalRuleDefault :: (PandocMonad m) => RR m (Doc Text)\nrenderHorizontalRuleDefault = pure \"* * *\"\n\nrenderHorizontalRuleHR :: (PandocMonad m) => RR m (Doc Text)\nrenderHorizontalRuleHR = pure \"[hr]\"\n\nrenderLineBlockDefault :: (PandocMonad m) => [[Inline]] -> RR m (Doc Text)\nrenderLineBlockDefault inliness = vcat <$> mapM inlineListToBBCode inliness\n\nrenderParaDefault :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\nrenderParaDefault inlines = inlineListToBBCode inlines\n\nrenderSuperscriptDefault :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\nrenderSuperscriptDefault = inlineListToBBCode\n\nrenderSubscriptDefault :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\nrenderSubscriptDefault = inlineListToBBCode\n\nrenderSmallCapsDefault :: (PandocMonad m) => [Inline] -> RR m (Doc Text)\nrenderSmallCapsDefault = inlineListToBBCode\n\nrenderCiteDefault ::\n  (PandocMonad m) => [Citation] -> [Inline] -> RR m (Doc Text)\nrenderCiteDefault _ = inlineListToBBCode\n\nrenderNoteDefault :: (PandocMonad m) => [Block] -> RR m (Doc Text)\nrenderNoteDefault blocks = do\n  -- NOTE: no BBCode flavor has native syntax for footnotes.\n  newN <- gets (succ . Seq.length)\n  contents <- blockListToBBCode blocks\n  let pointer = \"(\" <> tshow newN <> \")\"\n  let contents' = literal pointer <> space <> contents\n  modify (|> contents')\n  pure $ literal pointer\n\nrenderFigureDefault ::\n  (PandocMonad m) => Attr -> Caption -> [Block] -> RR m (Doc Text)\nrenderFigureDefault _ (Caption _ caption) blocks = do\n  caption' <- blockListToBBCode caption\n  contents <- blockListToBBCode blocks\n  pure $ contents $$ caption'\n\nrenderQuotedDefault ::\n  (PandocMonad m) => QuoteType -> [Inline] -> RR m (Doc Text)\nrenderQuotedDefault typ inlines = do\n  let quote = case typ of SingleQuote -> \"'\"; DoubleQuote -> \"\\\"\"\n  contents <- inlineListToBBCode inlines\n  pure $ mconcat [quote, contents, quote]\n\nrenderMathDefault :: (PandocMonad m) => MathType -> Text -> RR m (Doc Text)\nrenderMathDefault typ math = case typ of\n  InlineMath ->\n    inlineToBBCode $\n      Code (\"\", [\"latex\"], []) (\"$\" <> math <> \"$\")\n  DisplayMath ->\n    blockToBBCode $\n      CodeBlock (\"\", [\"latex\"], []) (\"$$\" <> math <> \"$$\")\n\n{- | Format documentation: <https://www.bbcode.org/reference.php>\n\nThere is no such thing as «Official» bbcode format, nonetheless this spec\nimplements what is described on bbcode.org, which is a reasonable base that can\nbe extended/contracted as needed.\n-}\nofficialSpec :: FlavorSpec\nofficialSpec =\n  FlavorSpec\n    { renderOrderedList = renderOrderedListOfficial\n    , renderBulletList = renderBulletListOfficial\n    , renderDefinitionList = renderDefinitionListDefault\n    , renderHeader = renderHeaderDefault\n    , renderTable = renderTableDefault\n    , renderLink = renderLinkEmailAware\n    , renderCodeBlock = renderCodeBlockDefault\n    , renderInlineCode = renderInlineCodeLiteral\n    , renderStrikeout = renderStrikeoutDefault\n    , renderBlockQuote = renderBlockQuoteDefault\n    , renderHorizontalRule = renderHorizontalRuleDefault\n    , renderLineBlock = renderLineBlockDefault\n    , renderPara = renderParaDefault\n    , renderSuperscript = renderSuperscriptDefault\n    , renderSubscript = renderSubscriptDefault\n    , renderSmallCaps = renderSmallCapsDefault\n    , renderCite = renderCiteDefault\n    , renderNote = renderNoteDefault\n    , renderFigure = renderFigureDefault\n    , renderMath = renderMathDefault\n    , renderQuoted = renderQuotedDefault\n    , renderImage = renderImageDefault\n    , wrapSpanDiv = wrapSpanDivOfficial\n    }\n\n{- | Format documentation: <https://steamcommunity.com/comment/ForumTopic/formattinghelp>\n\nUsed at: <https://steamcommunity.com/discussions/forum>\n\nQuirks:\n\n- There seems to be no way to show external images on steam.\n  https://steamcommunity.com/sharedfiles/filedetails/?id=2807121939 shows [img]\n  and [previewimg] can (could?) be used to show images, although it is likely\n  reserved for steam urls only.\n-}\nsteamSpec :: FlavorSpec\nsteamSpec =\n  officialSpec\n    { renderOrderedList = renderOrderedListSteam\n    , renderHeader = renderHeaderSteam\n    , renderLink = renderLinkDefault\n    , renderInlineCode = renderInlineCodeNoParse\n    , renderStrikeout = renderStrikeoutSteam\n    , renderImage = renderImageOmit\n    , wrapSpanDiv = wrapSpanDivSteam\n    , renderHorizontalRule = renderHorizontalRuleHR\n    }\n\n{- | Format documentation: <https://www.phpbb.com/community/help/bbcode>\n\nUsed at: <https://www.phpbb.com/community>\n\nQuirks:\n\n- PhpBB docs don't mention strikeout support, but their\n  [support forum](https://www.phpbb.com/community) does support it.\n- Same for named code blocks.\n- @[email=example\\@example.com]the email[/url]@ is a valid use of [email]\n  tag on the phpBB community forum despite not being in the docs.\n-}\nphpbbSpec :: FlavorSpec\nphpbbSpec =\n  officialSpec\n    { renderTable = renderTableOmit\n    , renderImage = renderImagePhpBB\n    , wrapSpanDiv = wrapSpanDivPhpBB\n    }\n\n{- | Format documentation: <https://web.archive.org/web/20210623155046/https://fluxbb.org/forums/help.php#bbcode>\n\nUsed at: https://bbs.archlinux.org\n-}\nfluxbbSpec :: FlavorSpec\nfluxbbSpec =\n  officialSpec\n    { renderOrderedList = renderOrderedListFluxbb\n    , renderCodeBlock = renderCodeBlockSimple\n    , renderTable = renderTableOmit\n    , renderBlockQuote = renderBlockQuoteFluxBB\n    , renderImage = renderImageFluxBB\n    , wrapSpanDiv = wrapSpanDivFluxBB\n    }\n\n{- | Format documentation: <https://hubzilla.org/help/member/bbcode>\n\nUsed at: <https://hub.netzgemeinde.eu> (see [other hubs](https://hubzilla.org/pubsites))\n\nQuirks:\n\n- If link target is not a URI, it simply points to https://$BASEURL/ when\n  rendered by a hub.\n-}\nhubzillaSpec :: FlavorSpec\nhubzillaSpec =\n  officialSpec\n    { renderOrderedList = renderOrderedListHubzilla\n    , renderBulletList = renderBulletListHubzilla\n    , renderDefinitionList = renderDefinitionListHubzilla\n    , renderHeader = renderHeaderHubzilla\n    , renderInlineCode = renderInlineCodeHubzilla\n    , renderLink = renderLinkDefault\n    , wrapSpanDiv = wrapSpanDivHubzilla\n    , renderHorizontalRule = renderHorizontalRuleHR\n    }\n\n{- | Format documentation: <https://www.xenfocus.com/community/help/bb-codes/>\n\nUsed at: see <https://xenforo.com/>\n-}\nxenforoSpec :: FlavorSpec\nxenforoSpec =\n  officialSpec\n    { wrapSpanDiv = wrapSpanDivXenforo\n    , renderHeader = renderHeaderXenforo\n    , renderInlineCode = renderInlineCodeXenforo\n    , renderHorizontalRule = renderHorizontalRuleHR\n    , renderOrderedList = renderOrderedListXenforo\n    , renderImage = renderImageXenforo\n    }\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/BibTeX.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.BibTeX\n   Copyright   : Copyright (C) 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nWrites a BibTeX or BibLaTeX bibliographies based on the\n'references' metadata in a Pandoc document.\n-}\nmodule Text.Pandoc.Writers.BibTeX\n  ( writeBibTeX\n  , writeBibLaTeX\n  )\nwhere\n\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Data.Text (Text)\nimport Data.Maybe (mapMaybe)\nimport Citeproc (parseLang)\nimport Text.Pandoc.Class (PandocMonad)\nimport Text.Pandoc.Citeproc.BibTeX as BibTeX\nimport Text.Pandoc.Citeproc.MetaValue (metaValueToReference)\nimport Text.Pandoc.Writers.Shared (lookupMetaString, defField,\n                                    addVariablesToContext)\nimport Text.DocLayout (render, vcat)\nimport Text.DocTemplates (Context(..))\nimport Text.Pandoc.Templates (renderTemplate)\n\n-- | Write BibTeX based on the references metadata from a Pandoc document.\nwriteBibTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteBibTeX = writeBibTeX' BibTeX.Bibtex\n\n-- | Write BibLaTeX based on the references metadata from a Pandoc document.\nwriteBibLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteBibLaTeX = writeBibTeX' BibTeX.Biblatex\n\nwriteBibTeX' :: PandocMonad m => Variant -> WriterOptions -> Pandoc -> m Text\nwriteBibTeX' variant opts (Pandoc meta _) = do\n  let mblang = case lookupMetaString \"lang\" meta of\n                 \"\" -> Nothing\n                 t  -> either (const Nothing) Just $ parseLang t\n  let refs = case lookupMeta \"references\" meta of\n               Just (MetaList xs) -> mapMaybe metaValueToReference xs\n               _ -> []\n  let main = vcat $ map (BibTeX.writeBibtexString opts variant mblang) refs\n  let context  = defField \"body\" main\n                 $ addVariablesToContext opts (mempty :: Context Text)\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  return $ render colwidth $\n    case writerTemplate opts of\n      Nothing  -> main\n      Just tpl -> renderTemplate tpl context\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Blaze.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.Blaze\n   Copyright   : Copyright (C) 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nRender blaze-html Html to DocLayout document (so it can be wrapped).\n-}\nmodule Text.Pandoc.Writers.Blaze ( layoutMarkup )\nwhere\nimport Text.Blaze\nimport qualified Data.ByteString as S\nimport Data.List (isInfixOf)\nimport Data.Text.Encoding (decodeUtf8)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.DocLayout hiding (Text, Empty)\nimport Text.Blaze.Internal (ChoiceString(..), getText, MarkupM(..))\n\nlayoutMarkup :: Markup -> Doc T.Text\nlayoutMarkup = go True mempty\n  where\n    go :: Bool -> Doc T.Text -> MarkupM b -> Doc T.Text\n    go wrap attrs (Parent _ open close content) =\n      let open' = getText open\n       in literal open'\n            <> attrs\n            <> char '>'\n            <> (case open' of\n                  \"<code\" -> go False mempty content\n                  t | t == \"<pre\" ||\n                      t == \"<style\" ||\n                      t == \"<script\" ||\n                      t == \"<textarea\" -> flush $ go False mempty content\n                    | otherwise -> go wrap mempty content)\n            <> literal (getText close)\n    go wrap attrs (CustomParent tag content) =\n        char '<'\n            <> fromChoiceString wrap tag\n            <> attrs\n            <> char '>'\n            <> go wrap mempty content\n            <> literal \"</\"\n            <> fromChoiceString wrap tag\n            <> char '>'\n    go _wrap attrs (Leaf _ begin end _) =\n        literal (getText begin)\n            <> attrs\n            <> literal (getText end)\n    go wrap attrs (CustomLeaf tag close _) =\n        char '<'\n            <> fromChoiceString wrap tag\n            <> attrs\n            <> (if close then literal \" />\" else char '>')\n    go wrap attrs (AddAttribute rawkey _ value h) =\n        go wrap\n          (space' wrap\n            <> literal (getText rawkey)\n            <> char '='\n            <> doubleQuotes (fromChoiceString False value)\n            <> attrs) h\n    go wrap attrs (AddCustomAttribute key value h) =\n        go wrap\n          (space' wrap\n            <> fromChoiceString wrap key\n            <> char '='\n            <> doubleQuotes (fromChoiceString False value)\n            <> attrs) h\n    go wrap _ (Content content _) = fromChoiceString wrap content\n    go wrap _ (Comment comment _) =\n        literal \"<!--\"\n            <> space' wrap\n            <> fromChoiceString False comment\n            <> space' wrap\n            <> \"-->\"\n    go wrap attrs (Append h1 h2) = go wrap attrs h1 <> go wrap attrs h2\n    go _ _ (Empty _) = mempty\n    space' wrap = if wrap then space else char ' '\n\n\nfromChoiceString :: Bool                  -- ^ Allow wrapping\n                 -> ChoiceString          -- ^ String to render\n                 -> Doc Text              -- ^ Resulting builder\nfromChoiceString wrap (Static s)     = withWrap wrap $ getText s\nfromChoiceString wrap (String s)     = withWrap wrap $\n                                         escapeMarkupEntities $ T.pack s\nfromChoiceString wrap (Text s)       = withWrap wrap $ escapeMarkupEntities s\nfromChoiceString wrap (ByteString s) = withWrap wrap $ decodeUtf8 s\nfromChoiceString _wrap (PreEscaped x) = -- don't wrap!\n  case x of\n    String s -> literal $ T.pack s\n    Text   s -> literal s\n    s        -> fromChoiceString False s\nfromChoiceString wrap (External x) = case x of\n    -- Check that the sequence \"</\" is *not* in the external data.\n    String s     -> if \"</\" `isInfixOf` s then mempty else withWrap wrap (T.pack s)\n    Text   s     -> if \"</\" `T.isInfixOf` s then mempty else withWrap wrap s\n    ByteString s -> if \"</\" `S.isInfixOf` s then mempty else withWrap wrap (decodeUtf8 s)\n    s            -> fromChoiceString wrap s\nfromChoiceString wrap (AppendChoiceString x y) =\n    fromChoiceString wrap x <> fromChoiceString wrap y\nfromChoiceString _ EmptyChoiceString = mempty\n\nwithWrap :: Bool -> Text -> Doc Text\nwithWrap wrap\n  | wrap = mconcat . toChunks\n  | otherwise = literal\n\ntoChunks :: Text -> [Doc Text]\ntoChunks = map toDoc . T.groupBy sameStatus\n  where\n   toDoc t\n     | t == \" \" = space\n     | t == \"\\n\" = cr\n     | otherwise         = literal t\n   sameStatus c d =\n     (c == ' ' && d == ' ') ||\n     (c == '\\n' && d == '\\n') ||\n     (c /= ' ' && d /= ' ' && c /= '\\n' && d /= '\\n')\n\n\n-- | Escape predefined XML entities in a text value\n--\nescapeMarkupEntities :: Text     -- ^ Text to escape\n                     -> Text -- ^ Resulting Doc\nescapeMarkupEntities = T.concatMap escape\n  where\n    escape :: Char -> Text\n    escape '<'  = \"&lt;\"\n    escape '>'  = \"&gt;\"\n    escape '&'  = \"&amp;\"\n    escape '\"'  = \"&quot;\"\n    escape '\\'' = \"&#39;\"\n    escape x    = T.singleton x\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/ChunkedHTML.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Writers.ChunkedHTML\n   Copyright   : Copyright (C) 2023 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to \"chunked\" HTML (a folder of\nlinked HTML documents, split by sections.\n-}\nmodule Text.Pandoc.Writers.ChunkedHTML (\n  writeChunkedHTML\n  ) where\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (WriterOptions(..))\nimport Text.Pandoc.Shared (stringify, tshow)\nimport Text.Pandoc.Class (PandocMonad, getPOSIXTime, runPure,\n                          fetchItem, insertMedia, getMediaBag)\nimport Text.Pandoc.MediaBag (mediaItems)\nimport qualified Data.ByteString.Lazy as BL\nimport Text.Pandoc.Chunks (splitIntoChunks, Chunk(..), ChunkedDoc(..),\n                           SecInfo(..), tocToList)\nimport Text.Pandoc.URI (isURI)\nimport Data.Text (Text)\nimport Data.Tree\nimport qualified Data.Text as T\nimport qualified Data.Text.Encoding as TE\nimport Text.Pandoc.Writers.HTML (writeHtml5String)\nimport Codec.Archive.Zip (Entry, addEntryToArchive, emptyArchive, toEntry,\n                          fromArchive)\nimport qualified Data.Map as M\nimport Text.DocTemplates (Context(..), Val(..))\nimport Text.DocLayout (literal)\nimport Text.Pandoc.Writers.Shared (defField)\nimport Data.Aeson (toJSON, encode)\nimport System.FilePath (isRelative, normalise)\nimport Data.List (isInfixOf)\nimport Text.Pandoc.Walk (walkM)\nimport Text.Pandoc.Builder (setMeta)\nimport Text.Pandoc.Templates (compileTemplate, WithDefaultPartials(..))\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Error\n\n-- | Splits document into HTML chunks, dividing them by section,\n-- and returns a zip archive of a folder of files.\nwriteChunkedHTML :: PandocMonad m\n                 => WriterOptions -> Pandoc -> m BL.ByteString\nwriteChunkedHTML opts (Pandoc meta blocks) = do\n  walkM addMedia (Pandoc meta blocks)\n  epochtime <- floor <$> getPOSIXTime\n  let toMediaEntry (fp, _mt, bs) = toEntry fp epochtime bs\n  mediaEntries <- map toMediaEntry . mediaItems <$> getMediaBag\n  let chunkedDoc = splitIntoChunks (writerChunkTemplate opts)\n                     True\n                     (Just 1)\n                     (writerSplitLevel opts)\n                     (Pandoc meta blocks)\n  let topChunk =\n        Chunk\n          { chunkHeading = docTitle meta\n          , chunkId = \"top\"\n          , chunkLevel = 0\n          , chunkNumber = 0\n          , chunkSectionNumber = Nothing\n          , chunkPath = \"index.html\"\n          , chunkUp = Nothing\n          , chunkPrev = Nothing\n          , chunkNext = case chunkedChunks chunkedDoc of\n                          [] -> Nothing\n                          (x:_) -> Just x\n          , chunkUnlisted = True\n          , chunkContents = mempty\n          }\n\n  let chunks = map (\\x -> case chunkUp x of\n                             Nothing -> x{ chunkUp = Just topChunk }\n                             _ -> x)\n               $ case chunkedChunks chunkedDoc of\n                   [] -> []\n                   (x:xs) -> x{ chunkPrev = Just topChunk } : xs\n\n  let Node secinfo secs = chunkedTOC chunkedDoc\n  let tocTree = Node secinfo{ secTitle = docTitle meta,\n                              secPath = \"index.html\" } secs\n  let tree = buildTOC opts tocTree\n  renderedTOC <- writeHtml5String opts{ writerTemplate = Nothing }\n                    (Pandoc nullMeta [tree])\n  -- see #8915 -- we need to set the math variable in the top chunk:\n  res <- runWithDefaultPartials $ compileTemplate \"mathvar\" \"$math$\"\n  mathVar <- case res of\n    Left e   -> throwError $ PandocTemplateError (T.pack e)\n    Right t  -> return t\n  tocMathVariable <- writeHtml5String opts{ writerTemplate = Just mathVar }\n                    (Pandoc meta (tree:blocks))\n  let opts' = opts{ writerVariables =\n                        defField \"table-of-contents\" renderedTOC\n                      . defField \"math\" tocMathVariable\n                      $ writerVariables opts }\n  entries <- mapM (chunkToEntry opts' meta topChunk) (topChunk : chunks)\n  let sitemap = toEntry \"sitemap.json\" epochtime\n                  (encode $ toJSON $ tocTreeToContext tocTree)\n  let archive = foldr addEntryToArchive emptyArchive\n                 (sitemap : entries ++ mediaEntries)\n  return $ fromArchive archive\n\n\n-- We include in the zip only local media that is in the working directory\n-- or below.\naddMedia :: PandocMonad m => Inline -> m Inline\naddMedia il@(Image _ _ (src,_))\n  | not (isURI src)\n  , fp <- normalise (T.unpack src)\n  , isRelative fp\n  , not (\"..\" `isInfixOf` fp) = do\n  (bs, mbMime) <- fetchItem (T.pack fp)\n  insertMedia fp mbMime (BL.fromStrict bs)\n  return il\naddMedia il = return il\n\nbuildTOC :: WriterOptions -> Tree SecInfo -> Block\nbuildTOC opts = tocToList (writerNumberSections opts) (writerTOCDepth opts)\n\nchunkToEntry :: PandocMonad m\n             => WriterOptions -> Meta -> Chunk -> Chunk -> m Entry\nchunkToEntry opts meta topChunk chunk = do\n  html <- writeHtml5String opts' (Pandoc meta' blocks)\n  epochtime <- floor <$> getPOSIXTime\n  let htmlLBS = BL.fromStrict $ TE.encodeUtf8 html\n  return $ toEntry (chunkPath chunk) epochtime htmlLBS\n where\n  opts' = opts{ writerVariables =\n                  addContextVars opts' topChunk chunk $ writerVariables opts }\n  meta' = setMeta \"pagetitle\" (MetaString (stringify $ chunkHeading chunk)) meta\n  blocks = chunkContents chunk\n\ntocTreeToContext :: Tree SecInfo -> Context Text\ntocTreeToContext (Node secinfo subs) =\n  Context $ M.fromList\n  [ (\"section\", MapVal $ secInfoToContext secinfo)\n  , (\"subsections\", ListVal $ map (MapVal . tocTreeToContext) subs)\n  ]\n\nsecInfoToContext :: SecInfo -> Context Text\nsecInfoToContext sec =\n  Context $ M.fromList\n  [ (\"title\", SimpleVal $ literal $ stringify $ secTitle sec)\n  , (\"number\", maybe NullVal (SimpleVal . literal) (secNumber sec))\n  , (\"id\", SimpleVal $ literal $ secId sec)\n  , (\"path\", SimpleVal $ literal $ secPath sec)\n  , (\"level\", SimpleVal $ literal $ tshow $ secLevel sec)\n  ]\n\naddContextVars\n  :: WriterOptions -> Chunk -> Chunk -> Context Text -> Context Text\naddContextVars opts topChunk chunk context =\n     maybe id (defField \"next\" . navlinks) (chunkNext chunk)\n   . maybe id (defField \"previous\" . navlinks) (chunkPrev chunk)\n   . maybe id (defField \"up\" . navlinks) (chunkUp chunk)\n   . maybe id (defField \"top\" . navlinks) (if chunk == topChunk\n                                              then Nothing\n                                              else Just topChunk)\n   . defField \"toc\" (chunk == topChunk && writerTableOfContents opts)\n    $ context\n where\n  navlinks ch = toMapVal [(\"url\", formatPath ch), (\"title\", formatHeading ch)]\n  toMapVal = MapVal . Context . M.fromList\n  formatPath = SimpleVal . literal . T.pack . chunkPath\n  formatHeading ch = SimpleVal . literal . either (const \"\") id . runPure $\n    writeHtml5String opts{ writerTemplate = Nothing }\n      (Pandoc nullMeta [Plain $ chunkHeading ch])\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/CommonMark.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Writers.CommonMark\n   Copyright   : Copyright (C) 2015-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to CommonMark.\n\nCommonMark:  <http://commonmark.org>\n-}\nmodule Text.Pandoc.Writers.CommonMark (writeCommonMark) where\n\nimport Text.Pandoc.Writers.Markdown (writeCommonMark)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/ConTeXt.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Writers.ConTeXt\n   Copyright   : Copyright (C) 2007-2025 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' format into ConTeXt.\n-}\nmodule Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where\nimport Control.Monad (liftM, unless)\nimport Control.Monad.State.Strict\n    ( StateT, MonadState(put, get), gets, modify, evalStateT )\nimport Data.Char (ord, isDigit)\nimport Data.List (intersperse)\nimport Data.List.NonEmpty (NonEmpty ((:|)))\nimport Data.Maybe (mapMaybe, catMaybes)\nimport Data.Monoid (Any (Any, getAny))\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Network.URI (unEscapeString)\nimport Text.Collate.Lang (Lang(..))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting\n  (formatConTeXtBlock, formatConTeXtInline, highlight, styleToConTeXt)\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI (isURI)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Walk (query)\nimport Text.Pandoc.Writers.Shared\nimport Text.Printf (printf)\n\nimport qualified Data.List.NonEmpty as NonEmpty\nimport qualified Data.Map.Strict as Map\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\n\ndata WriterState =\n  WriterState\n  { stCslHangingIndent :: Bool -- CSL hanging indent\n  , stHasCslRefs       :: Bool -- has CSL citations\n  , stHighlighting     :: Bool -- has syntax-highlighted code blocks\n  , stNextRef          :: Int  -- number of next URL reference\n  , stOptions          :: WriterOptions -- writer options\n  , stOrderedListLevel :: Int  -- level of ordered list\n  , stEmphasisCommands :: Map.Map Text (Doc Text)\n  }\n\n-- | Table type\ndata Tabl = Xtb  -- ^ Extreme tables\n          | Ntb  -- ^ Natural tables\n  deriving (Show, Eq)\n\n-- | Whether a heading belongs to a section environment or is standalone.\ndata HeadingType = SectionHeading | NonSectionHeading\n\norderedListStyles :: [Char]\norderedListStyles = cycle \"narg\"\n\n-- | Convert Pandoc to ConTeXt.\nwriteConTeXt :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteConTeXt options document =\n  let defaultWriterState = WriterState\n        { stCslHangingIndent = False\n        , stHasCslRefs = False\n        , stHighlighting = False\n        , stNextRef = 1\n        , stOptions = options\n        , stOrderedListLevel = 0\n        , stEmphasisCommands = mempty\n        }\n  in evalStateT (pandocToConTeXt options document) defaultWriterState\n\ntype WM = StateT WriterState\n\npandocToConTeXt :: PandocMonad m => WriterOptions -> Pandoc -> WM m Text\npandocToConTeXt options (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText options == WrapAuto\n                    then Just $ writerColumns options\n                    else Nothing\n  metadata <- metaToContext options\n              blockListToConTeXt\n              (fmap chomp . inlineListToConTeXt)\n              meta\n  main <- blockListToConTeXt $ makeSections False Nothing blocks\n  let layoutFromMargins = mconcat $ intersperse (\",\" :: Doc Text) $\n                          mapMaybe (\\(x,y) ->\n                                ((x <> \"=\") <>) <$> getField y metadata)\n                              [(\"leftmargin\",\"margin-left\")\n                              ,(\"rightmargin\",\"margin-right\")\n                              ,(\"top\",\"margin-top\")\n                              ,(\"bottom\",\"margin-bottom\")\n                              ]\n  mblang <- fromBCP47 (getLang options meta)\n  st <- get\n  let context =   defField \"toc\" (writerTableOfContents options)\n                $ defField \"lof\" (writerListOfFigures options)\n                $ defField \"lot\" (writerListOfTables options)\n                $ defField \"placelist\"\n                   (mconcat . intersperse (\",\" :: Doc Text) $\n                     take (writerTOCDepth options +\n                           case writerTopLevelDivision options of\n                             TopLevelPart    -> 0\n                             TopLevelChapter -> 0\n                             _               -> 1)\n                       [\"chapter\",\"section\",\"subsection\",\"subsubsection\",\n                        \"subsubsubsection\",\"subsubsubsubsection\"])\n                $ defField \"body\" main\n                $ defField \"layout\" layoutFromMargins\n                $ defField \"tagging\" (isEnabled Ext_tagging options)\n                $ defField \"number-sections\" (writerNumberSections options)\n                $ defField \"csl-refs\" (stHasCslRefs st)\n                $ defField \"csl-hanging-indent\" (stCslHangingIndent st)\n                $ maybe id (\\l ->\n                     defField \"context-lang\" (literal l :: Doc Text)) mblang\n                $ (case T.unpack . render Nothing <$>\n                      getField \"papersize\" metadata of\n                        Just (('a':d:ds) :: String)\n                          | all isDigit (d:ds) -> resetField \"papersize\"\n                                                   (T.pack ('A':d:ds))\n                        _                     -> id)\n                $ defField \"emphasis-commands\"\n                    (mconcat $ Map.elems (stEmphasisCommands st))\n                $ (case writerHighlightMethod options of\n                      Skylighting sty | stHighlighting st ->\n                        defField \"highlighting-commands\" (styleToConTeXt sty)\n                      _ -> id)\n                $ (case T.toLower $ lookupMetaString \"pdfa\" meta of\n                        \"true\" -> resetField \"pdfa\" (T.pack \"1b:2005\")\n                        _                     -> id) metadata\n  let context' = defField \"context-dir\" (maybe mempty toContextDir\n                                         $ getField \"dir\" context) context\n  return $ render colwidth $\n    case writerTemplate options of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context'\n\n-- change rtl to r2l, ltr to l2r\ntoContextDir :: Doc Text -> Doc Text\ntoContextDir = fmap (\\t -> case t of\n                              \"ltr\" -> \"l2r\"\n                              \"rtl\" -> \"r2l\"\n                              _     -> t)\n\n-- | escape things as needed for ConTeXt\nescapeCharForConTeXt :: WriterOptions -> Char -> Text\nescapeCharForConTeXt opts ch =\n let ligatures = isEnabled Ext_smart opts in\n case ch of\n    '{'      -> \"\\\\{\"\n    '}'      -> \"\\\\}\"\n    '\\\\'     -> \"\\\\letterbackslash{}\"\n    '$'      -> \"\\\\$\"\n    '|'      -> \"\\\\letterbar{}\"\n    '%'      -> \"\\\\letterpercent{}\"\n    '~'      -> \"\\\\lettertilde{}\"\n    '#'      -> \"\\\\#\"\n    '['      -> \"{[}\"\n    ']'      -> \"{]}\"\n    '\\160'   -> \"~\"\n    '\\x2014' | ligatures -> \"---\"\n    '\\x2013' | ligatures -> \"--\"\n    '\\x2019' | ligatures -> \"'\"\n    '\\x2026' -> \"\\\\ldots{}\"\n    x        -> T.singleton x\n\n-- | Escape string for ConTeXt\nstringToConTeXt :: WriterOptions -> Text -> Text\nstringToConTeXt opts = T.concatMap (escapeCharForConTeXt opts)\n\n-- | Sanitize labels\ntoLabel :: Text -> Text\ntoLabel z = T.concatMap go z\n where go x\n         | x `elem` (\"\\\\#[]\\\",{}%()|=\" :: String) = \"ux\" <> T.pack (printf \"%x\" (ord x))\n         | otherwise = T.singleton x\n\n-- | Convert Pandoc block element to ConTeXt.\nblockToConTeXt :: PandocMonad m => Block -> WM m (Doc Text)\nblockToConTeXt (Div attr@(_,\"section\":_,_)\n                 (Header level _ title' : xs)) = do\n  header' <- sectionHeader attr level title' SectionHeading\n  footer' <- sectionFooter attr level\n  innerContents <- blockListToConTeXt xs\n  return $ header' $$ innerContents $$ footer'\nblockToConTeXt (Plain lst) = do\n  opts <- gets stOptions\n  contents <- inlineListToConTeXt lst\n  return $\n    if isEnabled Ext_tagging opts\n    then \"\\\\bpar{}\" <> contents <> \"\\\\epar{}\"\n    else contents\nblockToConTeXt (Para lst) = do\n  opts <- gets stOptions\n  contents <- inlineListToConTeXt lst\n  return $\n    if isEnabled Ext_tagging opts\n    then \"\\\\bpar\" $$ contents $$ \"\\\\epar\" <> blankline\n    else contents <> blankline\nblockToConTeXt (LineBlock lns) = do\n  let emptyToBlankline doc = if isEmpty doc\n                             then blankline\n                             else doc\n  doclines <- mapM inlineListToConTeXt lns\n  let contextLines = vcat . map emptyToBlankline $ doclines\n  return $ \"\\\\startlines\" $$ contextLines $$ \"\\\\stoplines\" <> blankline\nblockToConTeXt (BlockQuote lst) = do\n  contents <- blockListToConTeXt lst\n  return $ \"\\\\startblockquote\" $$ nest 0 contents $$ \"\\\\stopblockquote\" <> blankline\nblockToConTeXt (CodeBlock (_ident, classes, kv) str) = do\n  opts <- gets stOptions\n  let syntaxMap = writerSyntaxMap opts\n  let attr' = (\"\", classes, kv)\n  let unhighlighted = vcat [\"\\\\starttyping\", literal str, \"\\\\stoptyping\"]\n  let highlighted =\n        case highlight syntaxMap formatConTeXtBlock attr' str of\n          Left msg -> do\n            unless (T.null msg) $\n              report (CouldNotHighlight msg)\n            return unhighlighted\n          Right h  -> do\n            modify (\\s -> s{ stHighlighting = True })\n            return (literal h)\n  -- blankline because \\stoptyping can't have anything after it, inc. '}'\n  ($$ blankline) . flush <$>\n    case writerHighlightMethod opts of\n      Skylighting _ | not (null classes) -> pure unhighlighted\n      _ -> highlighted\nblockToConTeXt b@(RawBlock f str)\n  | f == Format \"context\" || f == Format \"tex\" = return $ literal str <> blankline\n  | otherwise = empty <$ report (BlockNotRendered b)\nblockToConTeXt (Div (\"refs\",classes,_) bs) = do\n  modify $ \\st -> st{ stHasCslRefs = True\n                    , stCslHangingIndent = \"hanging-indent\" `elem` classes }\n  inner <- blockListToConTeXt bs\n  return $ \"\\\\startcslreferences\" $$ inner $$ \"\\\\stopcslreferences\"\nblockToConTeXt (Div (ident,_,kvs) bs) = do\n  let align dir txt = \"\\\\startalignment[\" <> dir <> \"]\" $$ txt $$ \"\\\\stopalignment\"\n  mblang <- fromBCP47 (lookup \"lang\" kvs)\n  let wrapRef txt = if T.null ident\n                       then txt\n                       else (\"\\\\reference\" <> brackets (literal $ toLabel ident) <>\n                              braces empty <> \"%\") $$ txt\n      wrapDir = case lookup \"dir\" kvs of\n                  Just \"rtl\" -> align \"righttoleft\"\n                  Just \"ltr\" -> align \"lefttoright\"\n                  _          -> id\n      wrapLang txt = case mblang of\n                       Just lng -> \"\\\\start\\\\language[\"\n                                     <> literal lng <> \"]\" $$ txt $$ \"\\\\stop\"\n                       Nothing  -> txt\n      wrapBlank txt = blankline <> txt <> blankline\n  wrapBlank . wrapLang . wrapDir . wrapRef <$> blockListToConTeXt bs\nblockToConTeXt (BulletList lst) = do\n  contents <- mapM listItemToConTeXt lst\n  return $ (\"\\\\startitemize\" <> if isTightList lst\n                                   then brackets \"packed\"\n                                   else empty) $$\n    vcat contents $$ literal \"\\\\stopitemize\" <> blankline\nblockToConTeXt (OrderedList (start, style', delim) lst) = do\n    st <- get\n    let level = stOrderedListLevel st\n    put st {stOrderedListLevel = level + 1}\n    contents <- mapM listItemToConTeXt lst\n    put st {stOrderedListLevel = level}\n    let start' = if start == 1 then \"\" else \"start=\" <> tshow start\n    let delim' = case delim of\n                        DefaultDelim -> \"\"\n                        Period       -> \"stopper=.\"\n                        OneParen     -> \"stopper=)\"\n                        TwoParens    -> \"left=(,stopper=)\"\n    let specs2Items = filter (not . T.null) [start', delim']\n    let specs2 = if null specs2Items\n                    then \"\"\n                    else \"[\" <> T.intercalate \",\" specs2Items <> \"]\"\n    let style'' = '[': (case style' of\n                          DefaultStyle -> orderedListStyles !! level\n                          Decimal      -> 'n'\n                          Example      -> 'n'\n                          LowerRoman   -> 'r'\n                          UpperRoman   -> 'R'\n                          LowerAlpha   -> 'a'\n                          UpperAlpha   -> 'A') :\n                       if isTightList lst then \",packed]\" else \"]\"\n    let specs = T.pack style'' <> specs2\n    return $ \"\\\\startenumerate\" <> literal specs $$ vcat contents $$\n             \"\\\\stopenumerate\" <> blankline\nblockToConTeXt (DefinitionList lst) =\n  liftM vcat $ mapM defListItemToConTeXt lst\nblockToConTeXt HorizontalRule = return $ \"\\\\thinrule\" <> blankline\n-- If this is ever executed, provide a default for the reference identifier.\nblockToConTeXt (Header level attr lst) =\n  sectionHeader attr level lst NonSectionHeading\nblockToConTeXt (Table attr caption colspecs thead tbody tfoot) =\n  tableToConTeXt (Ann.toTable attr caption colspecs thead tbody tfoot)\nblockToConTeXt (Figure (ident, _, _) (Caption cshort clong) body) = do\n  title   <- inlineListToConTeXt (blocksToInlines clong)\n  list    <- maybe (pure empty) inlineListToConTeXt cshort\n  content <- blockListToConTeXt body\n\n  let options =\n           [\"reference=\" <> literal (toLabel ident) | not (T.null ident)]\n        ++ [\"title=\"     <> braces title | not (isEmpty title)]\n        ++ [\"list=\"      <> braces list  | not (isEmpty list)]\n  let hasSubfigures = getAny $\n        query (Any . \\case {Figure {} -> True; _ -> False}) body\n  return\n     $ \"\\\\startplacefigure\" <> brackets (mconcat $ intersperse \",\" options)\n    $$ (if hasSubfigures then \"\\\\startfloatcombination\" else empty)\n    $$ content\n    $$ (if hasSubfigures then \"\\\\stopfloatcombination\" else empty)\n    $$ \"\\\\stopplacefigure\"\n    $$ blankline\n\ntableToConTeXt :: PandocMonad m => Ann.Table -> WM m (Doc Text)\ntableToConTeXt (Ann.Table attr caption colspecs thead tbodies tfoot) = do\n  opts <- gets stOptions\n  let tabl = if isEnabled Ext_ntb opts\n             then Ntb\n             else Xtb\n  captionText <- case caption of\n                   Caption _ []       -> return mempty\n                   Caption _ longCapt -> blockListToConTeXt longCapt\n  head'  <- tableHeadToConTeXt tabl thead\n  bodies <- mapM (tableBodyToConTeXt tabl) tbodies\n  foot'  <- tableFootToConTeXt tabl tfoot\n  let body = case tabl of\n        Xtb -> \"\\\\startxtable\" $$\n               head' $$\n               \"\\\\startxtablebody[body]\" $$\n               vcat bodies $$\n               \"\\\\stopxtablebody\" $$\n               foot' $$\n               \"\\\\stopxtable\"\n        Ntb -> setupCols colspecs $$\n               \"\\\\bTABLE\" $$\n               head' $$\n               \"\\\\bTABLEbody\" $$\n               vcat bodies $$\n               \"\\\\eTABLEbody\" $$\n               foot' $$\n               \"\\\\eTABLE\"\n  let (ident, _classes, _attribs) = attr\n  let tblopts = filter (not . isEmpty)\n             [ if isEmpty captionText\n               then \"location=none\"\n               else \"title=\" <> braces captionText\n             , if T.null ident\n               then empty\n               else \"reference=\" <> braces (literal (toLabel ident))\n             ]\n  return $ vcat\n    [ \"\\\\startplacetable\" <> brackets (mconcat $ intersperse \",\" tblopts)\n    , body\n    , \"\\\\stopplacetable\" <> blankline\n    ]\n\nsetupCols :: [ColSpec] -> Doc Text\nsetupCols = vcat . zipWith toColSetup [1::Int ..]\n  where\n    toColSetup i (align, width) =\n      let opts = filter (not . isEmpty)\n                 [ case align of\n                     AlignLeft    -> \"align=right\"\n                     AlignRight   -> \"align=left\"\n                     AlignCenter  -> \"align=middle\"\n                     AlignDefault -> \"align=left\"\n                 , case width of\n                     ColWidthDefault -> empty\n                     ColWidth w -> (\"width=\" <>) . braces . text $\n                                   printf \"%.2f\\\\textwidth\" w\n                 ]\n      in \"\\\\setupTABLE[column]\" <> brackets (text $ show i)\n                                <> brackets (mconcat $ intersperse \",\" opts)\n\ntableBodyToConTeXt :: PandocMonad m\n                   => Tabl\n                   -> Ann.TableBody\n                   -> WM m (Doc Text)\ntableBodyToConTeXt tabl (Ann.TableBody _attr _rowHeadCols inthead rows) = do\n  intermediateHead <-\n    if null inthead\n    then return mempty\n    else headerRowsToConTeXt tabl Thead inthead\n  bodyRows <- bodyRowsToConTeXt tabl rows\n  return $ intermediateHead <> bodyRows\n\ntableHeadToConTeXt :: PandocMonad m\n                   => Tabl\n                   -> Ann.TableHead\n                   -> WM m (Doc Text)\ntableHeadToConTeXt tabl (Ann.TableHead attr rows) =\n  tablePartToConTeXt tabl Thead attr rows\n\ntableFootToConTeXt :: PandocMonad m\n                   => Tabl\n                   -> Ann.TableFoot\n                   -> WM m (Doc Text)\ntableFootToConTeXt tbl (Ann.TableFoot attr rows) =\n  tablePartToConTeXt tbl Tfoot attr rows\n\ntablePartToConTeXt :: PandocMonad m\n                   => Tabl\n                   -> TablePart\n                   -> Attr\n                   -> [Ann.HeaderRow]\n                   -> WM m (Doc Text)\ntablePartToConTeXt tabl tblpart _attr rows = do\n  let (startCmd, stopCmd) = case (tabl, tblpart) of\n        (Ntb, Thead) -> (\"\\\\bTABLEhead\", \"\\\\eTABLEhead\")\n        (Ntb, Tfoot) -> (\"\\\\bTABLEfoot\", \"\\\\eTABLEfoot\")\n        (Xtb, Thead) -> (\"\\\\startxtablehead[head]\", \"\\\\stopxtablehead\")\n        (Xtb, Tfoot) -> (\"\\\\startxtablefoot[foot]\", \"\\\\stopxtablefoot\")\n        _            -> (\"\", \"\") -- this would be unexpected\n  contents <- headerRowsToConTeXt tabl tblpart rows\n  return $ startCmd $$ contents $$ stopCmd\n\n-- | The part of a table; header, footer, or body.\ndata TablePart = Thead | Tfoot | Tbody\n  deriving (Eq)\n\ndata CellType = HeaderCell | BodyCell\n\ndata TableRow = TableRow TablePart Attr Ann.RowHead Ann.RowBody\n\nheaderRowsToConTeXt :: PandocMonad m\n                    => Tabl\n                    -> TablePart\n                    -> [Ann.HeaderRow]\n                    -> WM m (Doc Text)\nheaderRowsToConTeXt tabl tablepart = rowListToConTeXt tabl . map toTableRow\n  where\n    toTableRow (Ann.HeaderRow attr _rownum rowbody) =\n      TableRow tablepart attr [] rowbody\n\nbodyRowsToConTeXt :: PandocMonad m\n                  => Tabl\n                  -> [Ann.BodyRow]\n                  -> WM m (Doc Text)\nbodyRowsToConTeXt tabl = rowListToConTeXt tabl . map toTableRow\n  where\n    toTableRow (Ann.BodyRow attr _rownum rowhead rowbody) =\n      TableRow Tbody attr rowhead rowbody\n\n\nrowListToConTeXt :: PandocMonad m\n                 => Tabl\n                 -> [TableRow]\n                 -> WM m (Doc Text)\nrowListToConTeXt = \\case\n  Ntb -> fmap vcat . mapM (tableRowToConTeXt Ntb)\n  Xtb -> \\rows -> do\n    (butlast, lastrow) <-\n      case reverse rows of\n        []   -> pure ( []\n                     , empty\n                     )\n        r:rs -> (,) <$> (mapM (tableRowToConTeXt Xtb) (reverse rs))\n                    <*> tableRowToConTeXt Xtb r\n    return $\n      vcat butlast $$\n      if isEmpty lastrow\n      then empty\n      else \"\\\\startxrowgroup[lastrow]\" $$ lastrow $$ \"\\\\stopxrowgroup\"\n\ntableRowToConTeXt :: PandocMonad m\n               => Tabl\n               -> TableRow\n               -> WM m (Doc Text)\ntableRowToConTeXt tabl (TableRow tblpart _attr rowhead rowbody) = do\n  let celltype = case tblpart of\n                   Thead -> HeaderCell\n                   _     -> BodyCell\n  headcells <- mapM (tableCellToConTeXt tabl HeaderCell) rowhead\n  bodycells <- mapM (tableCellToConTeXt tabl celltype) rowbody\n  let cells = vcat headcells $$ vcat bodycells\n  return $ case tabl of\n    Xtb -> \"\\\\startxrow\" $$ cells $$ \"\\\\stopxrow\"\n    Ntb -> \"\\\\bTR\" $$ cells $$ \"\\\\eTR\"\n\ntableCellToConTeXt :: PandocMonad m\n                   => Tabl\n                   -> CellType\n                   -> Ann.Cell -> WM m (Doc Text)\ntableCellToConTeXt tabl celltype (Ann.Cell colspecs _colnum cell) = do\n  let Cell _attr cellalign rowspan colspan blocks = cell\n  let (colalign, _) :| _ = colspecs\n  let halign = alignToConTeXt $\n               case (cellalign, tabl) of\n                 (AlignDefault, Xtb) -> colalign\n                 _                   -> cellalign\n  let nx = case colspan of\n             ColSpan 1 -> empty\n             ColSpan n -> \"nc=\" <> literal (tshow n)\n  let ny = case rowspan of\n             RowSpan 1 -> empty\n             RowSpan n -> \"nr=\" <> literal (tshow n)\n  let widths = map snd (NonEmpty.toList colspecs)\n  let mbcolwidth = flip map widths $ \\case\n        ColWidthDefault -> Nothing\n        ColWidth w      -> Just w\n  let colwidth = case catMaybes mbcolwidth of\n                   [] -> empty\n                   ws -> (\"width=\" <>) . braces . text $\n                         printf \"%.2f\\\\textwidth\" (sum ws)\n  let keys = hcat . intersperse \",\" $ filter (not . isEmpty) $\n             case tabl of\n               Xtb -> [halign, colwidth, nx, ny]\n               Ntb -> [halign, nx, ny]  -- no need for a column width\n  let options = (if isEmpty keys\n                 then empty\n                 else brackets keys) <> space\n  cellContents <- blockListToConTeXt blocks\n  return $ case tabl of\n             Xtb -> \"\\\\startxcell\" <> options <> cellContents <> \" \\\\stopxcell\"\n             Ntb -> case celltype of\n               BodyCell   -> \"\\\\bTD\" <> options <> cellContents <> \"\\\\eTD\"\n               HeaderCell -> \"\\\\bTH\" <> options <> cellContents <> \"\\\\eTH\"\n\nalignToConTeXt :: Alignment -> Doc Text\nalignToConTeXt = \\case\n  AlignLeft    -> \"align=right\"\n  AlignRight   -> \"align=left\"\n  AlignCenter  -> \"align=middle\"\n  AlignDefault -> empty\n\n\n---\n--- Lists\n--\n\nlistItemToConTeXt :: PandocMonad m => [Block] -> WM m (Doc Text)\nlistItemToConTeXt list = (\"\\\\item\" $$) . nest 2 <$> blockListToConTeXt list\n\ndefListItemToConTeXt :: PandocMonad m => ([Inline], [[Block]]) -> WM m (Doc Text)\ndefListItemToConTeXt (term, defs) = do\n  term' <- inlineListToConTeXt term\n  def'  <- liftM vsep $ mapM blockListToConTeXt defs\n  return $ \"\\\\startdescription\" <> braces term' $$ nest 2 def' $$\n           \"\\\\stopdescription\" <> blankline\n\n-- | Convert list of block elements to ConTeXt.\nblockListToConTeXt :: PandocMonad m => [Block] -> WM m (Doc Text)\nblockListToConTeXt lst = liftM vcat $ mapM blockToConTeXt lst\n\n-- | Convert list of inline elements to ConTeXt.\ninlineListToConTeXt :: PandocMonad m\n                    => [Inline]  -- ^ Inlines to convert\n                    -> WM m (Doc Text)\ninlineListToConTeXt lst = liftM hcat $ mapM inlineToConTeXt $ addStruts lst\n  -- We add a \\strut after a line break that precedes a space,\n  -- or the space gets swallowed\n  where addStruts (LineBreak : s : xs) | isSpacey s =\n           LineBreak : RawInline (Format \"context\") \"\\\\strut \" : s :\n             addStruts xs\n        addStruts (x:xs) = x : addStruts xs\n        addStruts [] = []\n        isSpacey Space                               = True\n        isSpacey (Str (T.uncons -> Just ('\\160',_))) = True\n        isSpacey _                                   = False\n\nhighlightInlines :: PandocMonad m\n                 => Text -> (Doc Text) -> [Inline]\n                 -> WM m (Doc Text)\nhighlightInlines name style inlines = do\n  opts <- gets stOptions\n  contents <- inlineListToConTeXt inlines\n  if not (isEnabled Ext_tagging opts)\n    then return $ braces (style <> space <> contents)\n    else do\n      let cmd = \"\\\\definehighlight \" <> brackets (literal name) <>\n                brackets (\"style=\" <> braces style)\n      modify (\\st -> st{ stEmphasisCommands =\n                         Map.insert name cmd (stEmphasisCommands st) })\n      return $ \"\\\\\" <> literal name <> braces contents\n\n-- | Convert inline element to ConTeXt\ninlineToConTeXt :: PandocMonad m\n                => Inline    -- ^ Inline to convert\n                -> WM m (Doc Text)\ninlineToConTeXt (Emph lst)      = highlightInlines \"emph\"      \"\\\\em\" lst\ninlineToConTeXt (Strong lst)    = highlightInlines \"strong\"    \"\\\\bf\" lst\ninlineToConTeXt (SmallCaps lst) = highlightInlines \"smallcaps\" \"\\\\setsmallcaps\" lst\ninlineToConTeXt (Underline lst) = do\n  contents <- inlineListToConTeXt lst\n  return $ \"\\\\underbar\" <> braces contents\ninlineToConTeXt (Strikeout lst) = do\n  contents <- inlineListToConTeXt lst\n  return $ \"\\\\overstrikes\" <> braces contents\ninlineToConTeXt (Superscript lst) = do\n  contents <- inlineListToConTeXt lst\n  return $ \"\\\\high\" <> braces contents\ninlineToConTeXt (Subscript lst) = do\n  contents <- inlineListToConTeXt lst\n  return $ \"\\\\low\" <> braces contents\ninlineToConTeXt (Code (_ident, classes, _kv) str) = do\n  let rawCode =\n        pure . literal $\n        case typeDelim str of\n          Just (open, close) ->\n            \"\\\\type\" <> (open `T.cons` str) `T.snoc` close\n          Nothing ->\n            \"\\\\type[escape=yes]{\" <>\n            (T.replace \"{\" \"/BTEX\\\\letteropenbrace /ETEX\" .\n             T.replace \"}\" \"/BTEX\\\\letterclosebrace /ETEX\" $\n             str) `T.snoc` '}'\n  opts <- gets stOptions\n  let syntaxMap = writerSyntaxMap opts\n  let attr' = (\"\", classes, [])\n  let highlightCode =\n        case highlight syntaxMap formatConTeXtInline attr' str of\n          Left msg -> do\n            unless (T.null msg) $ report (CouldNotHighlight msg)\n            rawCode\n          Right h -> do\n            modify (\\st -> st{ stHighlighting = True })\n            return (text (T.unpack h))\n  case writerHighlightMethod opts of\n    Skylighting _ | not (null classes) -> highlightCode\n    _ -> rawCode\ninlineToConTeXt (Quoted SingleQuote lst) = do\n  contents <- inlineListToConTeXt lst\n  return $ \"\\\\quote\" <> braces contents\ninlineToConTeXt (Quoted DoubleQuote lst) = do\n  contents <- inlineListToConTeXt lst\n  return $ \"\\\\quotation\" <> braces contents\ninlineToConTeXt (Cite _ lst) = inlineListToConTeXt lst\ninlineToConTeXt (Str str) = do\n  opts <- gets stOptions\n  return $ literal $ stringToConTeXt opts str\ninlineToConTeXt (Math InlineMath str) =\n  return $ char '$' <> literal str <> char '$'\ninlineToConTeXt (Math DisplayMath str) =\n  return $ literal \"\\\\startformula \"  <> literal str <> literal \" \\\\stopformula\" <> space\ninlineToConTeXt il@(RawInline f str)\n  | f == Format \"tex\" || f == Format \"context\" = return $ literal str\n  | otherwise = empty <$ report (InlineNotRendered il)\ninlineToConTeXt LineBreak = return $ literal \"\\\\crlf\" <> cr\ninlineToConTeXt SoftBreak = do\n  wrapText <- gets (writerWrapText . stOptions)\n  return $ case wrapText of\n               WrapAuto     -> space\n               WrapNone     -> space\n               WrapPreserve -> cr\ninlineToConTeXt Space = return space\ninlineToConTeXt (Link _ txt (src, _)) = do\n  let isAutolink = txt == [Str (T.pack $ unEscapeString $ T.unpack src)]\n  let escConTeXtURL = T.concatMap $ \\case\n        '#' -> \"\\\\#\"\n        '%' -> \"\\\\%\"\n        c   -> T.singleton c\n  if isAutolink\n    then do\n      next <- gets stNextRef\n      modify $ \\st -> st {stNextRef = next + 1}\n      let ref = \"url\" <> tshow next\n      return $ mconcat\n        [ \"\\\\useURL\"\n        , brackets (literal ref)\n        , brackets (literal $ escConTeXtURL src)\n        , \"\\\\from\"\n        , brackets (literal ref)\n        ]\n    else do\n      contents <- inlineListToConTeXt txt\n      -- Handle HTML-like internal document references to sections\n      reference <- case T.uncons src of\n        Just ('#', ref) -> toLabel <$>\n                           (stringToConTeXt <$> gets stOptions <*> pure ref)\n        _               -> pure $ \"url(\" <> escConTeXtURL src <> \")\"\n      return $ mconcat\n        [ \"\\\\goto\"\n        , braces contents\n        , brackets (literal reference)\n        ]\ninlineToConTeXt (Image attr@(_,cls,_) _ (src, _)) = do\n  opts <- gets stOptions\n  let showDim dir = let d = literal (tshow dir) <> \"=\"\n                    in case dimension dir attr of\n                         Just (Pixel a)   ->\n                           [d <> literal (showInInch opts (Pixel a)) <> \"in\"]\n                         Just (Percent a) ->\n                           [d <> literal (showFl (a / 100)) <> \"\\\\textwidth\"]\n                         Just dim         ->\n                           [d <> literal (tshow dim)]\n                         Nothing          ->\n                           []\n      dimList = showDim Width ++ showDim Height\n      dims = if null dimList\n                then empty\n                else brackets $ mconcat (intersperse \",\" dimList)\n      clas = case cls of\n               [] -> empty\n               (cl:_) -> brackets $ literal $ toLabel cl\n      -- Use / for path separators on Windows; see #4918\n      fixPathSeparators = T.map $ \\c -> case c of\n                                          '\\\\' -> '/'\n                                          _    -> c\n      src' = fixPathSeparators $\n             if isURI src\n                then src\n                else T.pack $ unEscapeString $ T.unpack src\n  return $ braces $ \"\\\\externalfigure\" <> brackets (literal src') <> clas <> dims\ninlineToConTeXt (Note contents) = do\n  contents' <- blockListToConTeXt contents\n  let codeBlock x@(CodeBlock _ _) = [x]\n      codeBlock _                 = []\n  let codeBlocks = query codeBlock contents\n  return $ if null codeBlocks\n              then literal \"\\\\footnote{\" <> nest 2 (chomp contents') <> char '}'\n              else literal \"\\\\startbuffer \" <> nest 2 (chomp contents') <>\n                   literal \"\\\\stopbuffer\\\\footnote{\\\\getbuffer}\"\ninlineToConTeXt (Span (ident,_,kvs) ils) = do\n  mblang <- fromBCP47 (lookup \"lang\" kvs)\n  let wrapDir txt = case lookup \"dir\" kvs of\n                      Just \"rtl\" -> braces $ \"\\\\righttoleft \" <> txt\n                      Just \"ltr\" -> braces $ \"\\\\lefttoright \" <> txt\n                      _          -> txt\n      wrapLang txt = case mblang of\n                       Just lng -> braces (\"\\\\language\" <>\n                                           brackets (literal lng) <> txt)\n                       Nothing -> txt\n      addReference =\n        if T.null ident\n        then id\n        else ((\"\\\\reference\" <> brackets (literal ident) <> \"{}\") <>)\n  addReference . wrapLang . wrapDir <$> inlineListToConTeXt ils\n\n-- | Craft the section header, inserting the section reference, if supplied.\nsectionHeader :: PandocMonad m\n              => Attr\n              -> Int\n              -> [Inline]\n              -> HeadingType\n              -> WM m (Doc Text)\nsectionHeader (ident,classes,kvs) hdrLevel lst secenv = do\n  opts <- gets stOptions\n  contents <- inlineListToConTeXt lst\n  levelText <- sectionLevelToText opts (ident,classes,kvs) hdrLevel secenv\n  let optsList = mconcat . filter (not . null) $\n        [ [\"title=\" <> braces contents | not (isEmpty contents)]\n        , [\"reference=\" <> braces (literal (toLabel ident)) | not (T.null ident)]\n        , [\"number=no\"          | \"unnumbered\" `elem` classes]\n        , [\"incrementnumber=no\" | \"unnumbered\" `elem` classes]\n        ]\n  let starter = case secenv of\n                  SectionHeading -> \"\\\\start\"\n                  NonSectionHeading -> \"\\\\\"\n  let options = if null optsList || isEmpty levelText\n                then empty\n                else brackets $ hcat (intersperse \",\" optsList)\n  return $ starter <> levelText <> options <> blankline\n\n-- | Craft the section footer\nsectionFooter :: PandocMonad m => Attr -> Int -> WM m (Doc Text)\nsectionFooter attr hdrLevel = do\n  opts <- gets stOptions\n  levelText <- sectionLevelToText opts attr hdrLevel SectionHeading\n  return $ \"\\\\stop\" <> levelText <> blankline\n\n-- | Generate a textual representation of the section level\nsectionLevelToText :: PandocMonad m\n                   => WriterOptions -> Attr -> Int -> HeadingType\n                   -> WM m (Doc Text)\nsectionLevelToText opts (_,classes,_) hdrLevel headingType = do\n  let unlisted = \"unlisted\" `elem` classes\n  let semanticSection shift = do\n        let (section, chapter) = if unlisted\n                                 then (literal \"subject\", literal \"title\")\n                                 else (literal \"section\", literal \"chapter\")\n        return $ case hdrLevel + shift of\n                   -1         -> literal \"part\"\n                   0          -> chapter\n                   n | n >= 1 -> text (concat (replicate (n - 1) \"sub\"))\n                                 <> section\n                   _          -> empty -- cannot happen\n\n  case writerTopLevelDivision opts of\n    TopLevelPart    -> semanticSection (-2)\n    TopLevelChapter -> semanticSection (-1)\n    TopLevelSection -> semanticSection 0\n    TopLevelDefault -> if unlisted\n                       then semanticSection 0\n                       else return . literal $\n                            case headingType of\n                              SectionHeading    -> \"sectionlevel\"\n                              NonSectionHeading -> \"\"\n\n-- | Finds a pair of symbols that can be used as delimiters.\ntypeDelim :: Text -> Maybe (Char, Char)\ntypeDelim t =\n  let delimChars = \"{\\\"'`()-+=%,.:;\"\n      go delims '}' = go delims '{'\n      go delims c = T.filter (/= c) delims\n  in case fmap fst . T.uncons $ T.foldl' go delimChars t of\n       Just '{' -> Just ('{', '}')\n       Just c   -> Just (c, c)\n       Nothing  -> Nothing\n\nfromBCP47 :: PandocMonad m => Maybe Text -> WM m (Maybe Text)\nfromBCP47 mbs = fromBCP47' <$> toLang mbs\n\n-- Takes a list of the constituents of a BCP 47 language code\n-- and irons out ConTeXt's exceptions\n-- https://tools.ietf.org/html/bcp47#section-2.1\n-- http://wiki.contextgarden.net/Language_Codes\nfromBCP47' :: Maybe Lang -> Maybe Text\nfromBCP47' (Just (Lang \"ar\" _ (Just \"SY\") _ _ _)) = Just \"ar-sy\"\nfromBCP47' (Just (Lang \"ar\" _ (Just \"IQ\") _ _ _)) = Just \"ar-iq\"\nfromBCP47' (Just (Lang \"ar\" _ (Just \"JO\") _ _ _)) = Just \"ar-jo\"\nfromBCP47' (Just (Lang \"ar\" _ (Just \"LB\") _ _ _)) = Just \"ar-lb\"\nfromBCP47' (Just (Lang \"ar\" _ (Just \"DZ\") _ _ _)) = Just \"ar-dz\"\nfromBCP47' (Just (Lang \"ar\" _ (Just \"MA\") _ _ _)) = Just \"ar-ma\"\nfromBCP47' (Just (Lang \"de\" _ _ [\"1901\"] _ _))    = Just \"deo\"\nfromBCP47' (Just (Lang \"de\" _ (Just \"DE\") _ _ _)) = Just \"de-de\"\nfromBCP47' (Just (Lang \"de\" _ (Just \"AT\") _ _ _)) = Just \"de-at\"\nfromBCP47' (Just (Lang \"de\" _ (Just \"CH\") _ _ _)) = Just \"de-ch\"\nfromBCP47' (Just (Lang \"el\" _ _ [\"poly\"] _ _))    = Just \"agr\"\nfromBCP47' (Just (Lang \"en\" _ (Just \"US\") _ _ _)) = Just \"en-us\"\nfromBCP47' (Just (Lang \"en\" _ (Just \"GB\") _ _ _)) = Just \"en-gb\"\nfromBCP47' (Just (Lang \"grc\"_ _ _ _ _))           = Just \"agr\"\nfromBCP47' (Just (Lang \"el\" _ _ _ _ _))           = Just \"gr\"\nfromBCP47' (Just (Lang \"eu\" _ _ _ _ _))           = Just \"ba\"\nfromBCP47' (Just (Lang \"he\" _ _ _ _ _))           = Just \"il\"\nfromBCP47' (Just (Lang \"uk\" _ _ _ _ _))           = Just \"ua\"\nfromBCP47' (Just (Lang \"vi\" _ _ _ _ _))           = Just \"vn\"\nfromBCP47' (Just (Lang \"zh\" _ _ _ _ _))           = Just \"cn\"\nfromBCP47' (Just (Lang l _ _ _ _ _))              = Just l\nfromBCP47' Nothing                                = Nothing\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/CslJson.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.CslJson\n   Copyright   : Copyright (C) 2020-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of references from 'Pandoc' metadata to CSL JSON:\n<https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html>.\n\nNote that this writer ignores everything in the body of the\ndocument and everything in the metadata except `references`.\nIt assumes that the `references` field is a list with the structure\nof a CSL JSON bibliography.\n-}\nmodule Text.Pandoc.Writers.CslJson ( writeCslJson )\nwhere\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Error\nimport Text.Pandoc.Class\nimport Control.Monad.Except (throwError)\nimport Data.ByteString.Lazy (toStrict)\nimport Data.ByteString (ByteString)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Builder as B\nimport Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText)\nimport Citeproc (parseLang, Locale, Reference(..), Lang(..))\nimport Control.Monad.Identity\nimport Citeproc.Locale (getLocale)\nimport Citeproc.CslJson\nimport Text.Pandoc.Options (WriterOptions)\nimport Data.Maybe (mapMaybe, fromMaybe)\nimport Data.Aeson.Encode.Pretty         (Config (..), Indent (Spaces),\n                                         NumberFormat (Generic),\n                                         defConfig, encodePretty')\n\nwriteCslJson :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteCslJson _opts (Pandoc meta _) = do\n  let lang = fromMaybe (Lang \"en\" Nothing (Just \"US\") [] [] [])\n               (lookupMeta \"lang\" meta >>= metaValueToText >>=\n                  either (const Nothing) Just . parseLang)\n  locale <- case getLocale lang of\n               Left e  -> throwError $ PandocCiteprocError e\n               Right l -> return l\n  let rs = case lookupMeta \"references\" meta of\n             Just (MetaList xs) -> xs\n             _ -> []\n  return $ UTF8.toText\n           (toCslJson locale (mapMaybe metaValueToReference rs)) <> \"\\n\"\n\nfromInlines :: [Inline] -> CslJson Text\nfromInlines = foldMap fromInline . B.fromList\n\nfromInline :: Inline -> CslJson Text\nfromInline (Str t) = CslText t\nfromInline (Emph ils) = CslItalic (fromInlines ils)\nfromInline (Strong ils) = CslBold (fromInlines ils)\nfromInline (Underline ils) = CslUnderline (fromInlines ils)\nfromInline (Strikeout ils) = fromInlines ils\nfromInline (Superscript ils) = CslSup (fromInlines ils)\nfromInline (Subscript ils) = CslSub (fromInlines ils)\nfromInline (SmallCaps ils) = CslSmallCaps (fromInlines ils)\nfromInline (Quoted _ ils) = CslQuoted (fromInlines ils)\nfromInline (Cite _ ils) = fromInlines ils\nfromInline (Code _ t) = CslText t\nfromInline Space = CslText \" \"\nfromInline SoftBreak = CslText \" \"\nfromInline LineBreak = CslText \"\\n\"\nfromInline (Math InlineMath t) = CslText $ \"$\" <> t <> \"$\"\nfromInline (Math DisplayMath t) = CslText $ \"$$\" <> t <> \"$$\"\nfromInline (RawInline _ _) = CslEmpty\nfromInline (Link _ ils _) = fromInlines ils\nfromInline (Image _ ils _) = fromInlines ils\nfromInline (Note _) = CslEmpty\nfromInline (Span (_,[cl],_) ils)\n  | \"csl-\" `T.isPrefixOf` cl = CslDiv cl (fromInlines ils)\n  | cl == \"nocase\" = CslNoCase (fromInlines ils)\nfromInline (Span _ ils) = fromInlines ils\n\ntoCslJson :: Locale -> [Reference Inlines] -> ByteString\ntoCslJson locale = toStrict .\n  encodePretty' defConfig{ confIndent = Spaces 2\n                         , confCompare = compare\n                         , confNumFormat = Generic }\n  . map (runIdentity .  traverse (return .\n                                  renderCslJson False locale .\n                                  foldMap fromInline))\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Djot.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Writers.Djot\n   Copyright   : Copyright (C) 2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' format into Djot markup (<https://djot.net>).\n-}\nmodule Text.Pandoc.Writers.Djot (\n    writeDjot\n  ) where\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Class ( PandocMonad , report )\nimport Text.Pandoc.Options ( WriterOptions(..), WrapOption(..))\nimport Data.Text (Text)\nimport Data.Set (Set)\nimport qualified Data.Set as Set\nimport qualified Data.ByteString as B\nimport qualified Data.ByteString.Char8 as B8\nimport Data.List (intersperse)\nimport qualified Data.Text as T\nimport qualified Data.Map as M\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Writers.Shared ( metaToContext, defField, toLegacyTable )\nimport Text.Pandoc.Shared (isTightList, tshow, stringify, onlySimpleTableCells,\n                           makeSections)\nimport Text.DocLayout\nimport Text.DocTemplates (renderTemplate)\n\nimport Control.Monad.State (StateT(..), gets, modify)\nimport Control.Monad (zipWithM, when)\nimport Data.Maybe (fromMaybe)\nimport qualified Djot.AST as D\nimport Djot (renderDjot, RenderOptions(..), toIdentifier)\nimport Text.Pandoc.UTF8 (fromText)\n\n-- | Convert Pandoc to Djot.\nwriteDjot :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteDjot opts (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  let ropts = RenderOptions{ preserveSoftBreaks =\n                               writerWrapText opts == WrapPreserve }\n  metadata <- metaToContext opts\n               (fmap (renderDjot ropts) . bodyToDjot opts)\n               (fmap (chomp . renderDjot ropts) . bodyToDjot opts .\n                  (:[]) . Plain)\n               meta\n  main <- renderDjot ropts <$>\n            bodyToDjot opts (makeSections False Nothing blocks)\n  let context  = defField \"body\" main metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\ndata DjotState =\n  DjotState\n  { footnotes :: D.NoteMap\n  , references :: D.ReferenceMap\n  , autoReferences :: D.ReferenceMap\n  , autoIds :: Set B.ByteString\n  , options :: WriterOptions }\n\nbodyToDjot :: PandocMonad m => WriterOptions -> [Block] -> m D.Doc\nbodyToDjot opts bls = do\n  (bs, st) <- runStateT (blocksToDjot bls)\n               (DjotState mempty mempty mempty mempty opts)\n  let D.ReferenceMap autos = autoReferences st\n  let D.ReferenceMap refs = references st\n  pure $ D.Doc{ D.docBlocks = bs\n              , D.docFootnotes = footnotes st\n              , D.docReferences = D.ReferenceMap $ M.difference refs autos\n              , D.docAutoReferences = D.ReferenceMap autos\n              , D.docAutoIdentifiers = autoIds st\n              }\n\nblocksToDjot :: PandocMonad m => [Block] -> StateT DjotState m D.Blocks\nblocksToDjot = fmap mconcat . mapM blockToDjot\n\nblockToDjot :: PandocMonad m => Block -> StateT DjotState m D.Blocks\nblockToDjot (Para ils) = D.para <$> inlinesToDjot ils\nblockToDjot (Plain ils) = D.para <$> inlinesToDjot ils\nblockToDjot (LineBlock ls) =\n  D.para . mconcat . intersperse D.hardBreak <$> mapM inlinesToDjot ls\nblockToDjot (CodeBlock attr@(_,_,kvs) t) = do\n  let lang = fromMaybe mempty $ lookup \"lang\" kvs\n  pure $ D.addAttr (toDjotAttr attr)\n       <$> D.codeBlock (fromText lang) (fromText t)\nblockToDjot (RawBlock (Format f) t) =\n  pure $ D.rawBlock (D.Format (fromText f)) (fromText t)\nblockToDjot (BlockQuote bls) = D.blockQuote <$> blocksToDjot bls\nblockToDjot (Header lev attr ils) =\n  fmap (D.addAttr (toDjotAttr attr)) . D.heading lev <$> inlinesToDjot ils\nblockToDjot HorizontalRule = pure D.thematicBreak\nblockToDjot (Div (ident,\"section\":cls,kvs)\n              (Header lev (_,hcls,hkvs) ils : bls)) = do\n  ilsBs <- D.inlinesToByteString <$> inlinesToDjot ils\n  let ident' = toIdentifier ilsBs\n  let label = D.normalizeLabel ilsBs\n  let autoid = UTF8.toText ident' == ident\n  when autoid $\n    modify $ \\st -> st{ autoIds = Set.insert ident' (autoIds st) }\n  modify $ \\st -> st{ autoReferences = D.insertReference label\n                          (B8.cons '#' ident', mempty) (autoReferences st) }\n  fmap\n    (D.addAttr (toDjotAttr (if autoid then \"\" else ident,\n                         filter (/= \"section\") cls,\n                         filter (\\(k,_) -> k /= \"wrapper\") kvs) <>\n                toDjotAttr (\"\", [c | c <- hcls, c `notElem` cls], hkvs)))\n         . D.section\n     <$> blocksToDjot (Header lev mempty ils : bls)\nblockToDjot (Div attr@(ident,cls,kvs) bls)\n  | Just \"1\" <- lookup \"wrapper\" kvs\n    = fmap (D.addAttr\n             (toDjotAttr (ident,cls,filter (\\(k,_) -> k /= \"wrapper\") kvs)))\n       <$> blocksToDjot bls\n  | otherwise\n    = fmap (D.addAttr (toDjotAttr attr)) . D.div <$> blocksToDjot bls\nblockToDjot (BulletList items) =\n  D.bulletList spacing <$> mapM blocksToDjot items\n where\n   spacing = if isTightList items then D.Tight else D.Loose\nblockToDjot (OrderedList (start, sty, delim) items) =\n  D.orderedList listAttr spacing <$> mapM blocksToDjot items\n where\n   spacing = if isTightList items then D.Tight else D.Loose\n   listAttr = D.OrderedListAttributes {\n                D.orderedListStyle =\n                  case sty of\n                    DefaultStyle -> D.Decimal\n                    Example -> D.Decimal\n                    Decimal -> D.Decimal\n                    LowerRoman -> D.RomanLower\n                    UpperRoman -> D.RomanUpper\n                    LowerAlpha -> D.LetterLower\n                    UpperAlpha -> D.LetterUpper,\n                D.orderedListDelim =\n                    case delim of\n                      DefaultDelim -> D.RightPeriod\n                      Period -> D.RightPeriod\n                      OneParen -> D.RightParen\n                      TwoParens -> D.LeftRightParen,\n                D.orderedListStart = start }\nblockToDjot (DefinitionList items) =\n  D.definitionList spacing <$> mapM toDLItem items\n where\n   spacing = if isTightList (map (concat . snd) items)\n                then D.Tight\n                else D.Loose\n   toDLItem (term, defs) = do\n     term' <- inlinesToDjot term\n     def' <- mconcat <$> mapM blocksToDjot defs\n     pure (term', def')\nblockToDjot (Figure attr (Caption _ capt) bls) = do\n  content <- blocksToDjot bls\n  caption <- fmap (D.addAttr (D.Attr [(\"class\",\"caption\")])) . D.div <$>\n               blocksToDjot capt\n  pure $ fmap (D.addAttr (toDjotAttr attr)) $ D.div $ content <> caption\nblockToDjot (Table attr capt' colspecs thead tbodies tfoot) = do\n  let (capt, aligns, _, headRow, bodyRows) =\n        toLegacyTable capt' colspecs thead tbodies tfoot\n  if onlySimpleTableCells (headRow : bodyRows)\n     then do\n       let alignToAlign al = case al of\n                               AlignDefault -> D.AlignDefault\n                               AlignLeft -> D.AlignLeft\n                               AlignRight -> D.AlignRight\n                               AlignCenter -> D.AlignCenter\n       let defAligns = map alignToAlign aligns\n       let cellToCell isHeader bls al =\n             D.Cell (if isHeader then D.HeadCell else D.BodyCell) al\n               <$> case bls of\n                     [Para ils] -> inlinesToDjot ils\n                     [Plain ils] -> inlinesToDjot ils\n                     [] -> pure mempty\n                     bs -> do\n                       mapM_ (report . BlockNotRendered) bs\n                       pure $ D.str \"((omitted))\"\n       let rowToRow isHeader cells = zipWithM (cellToCell isHeader) cells defAligns\n       hrows <- if null headRow\n                   then pure []\n                   else (:[]) <$> rowToRow True headRow\n       rows <- mapM (rowToRow False) bodyRows\n       caption <- case capt of\n                       [] -> pure Nothing\n                       _ -> Just . D.Caption . D.para <$> inlinesToDjot capt\n       pure $ D.addAttr (toDjotAttr attr) <$> D.table caption (hrows <> rows)\n     else do -- table can't be represented as a simple pipe table, use list\n       tableList <- D.bulletList D.Loose <$> mapM\n                     (fmap (D.bulletList D.Loose) . mapM blocksToDjot)\n                      (headRow:bodyRows)\n       pure $ D.addAttr (D.Attr [(\"class\", \"table\")]) <$> tableList\n\ninlinesToDjot :: PandocMonad m => [Inline] -> StateT DjotState m D.Inlines\ninlinesToDjot = fmap mconcat . mapM inlineToDjot\n\ninlineToDjot :: PandocMonad m => Inline -> StateT DjotState m D.Inlines\ninlineToDjot (Str t) = pure $ D.str (fromText t)\ninlineToDjot Space = pure $ D.str \" \"\ninlineToDjot SoftBreak = pure D.softBreak\ninlineToDjot LineBreak = pure D.hardBreak\ninlineToDjot (Emph ils) = D.emph <$> inlinesToDjot ils\ninlineToDjot (Underline ils) =\n  fmap (D.addAttr (D.Attr [(\"class\",\"underline\")])) . D.span_\n    <$> inlinesToDjot ils\ninlineToDjot (Strong ils) = D.strong <$> inlinesToDjot ils\ninlineToDjot (Strikeout ils) = D.delete <$> inlinesToDjot ils\ninlineToDjot (Subscript ils) = D.subscript <$> inlinesToDjot ils\ninlineToDjot (Superscript ils) = D.superscript <$> inlinesToDjot ils\ninlineToDjot (Span (\"\",[\"mark\"],[]) ils) = D.highlight <$> inlinesToDjot ils\ninlineToDjot (Span attr@(ident,cls,kvs) ils)\n  | Just \"1\" <- lookup \"wrapper\" kvs\n    = fmap (D.addAttr\n            (toDjotAttr (ident,cls,filter (\\(k,_) -> k /= \"wrapper\") kvs)))\n       <$> inlinesToDjot ils\n  | otherwise\n    = fmap (D.addAttr (toDjotAttr attr)) . D.span_ <$> inlinesToDjot ils\ninlineToDjot (SmallCaps ils) =\n  fmap (D.addAttr (D.Attr [(\"class\",\"smallcaps\")])) . D.span_\n    <$> inlinesToDjot ils\ninlineToDjot (Quoted DoubleQuote ils) = D.doubleQuoted <$> inlinesToDjot ils\ninlineToDjot (Quoted SingleQuote ils) = D.singleQuoted <$> inlinesToDjot ils\ninlineToDjot (Cite _cs ils) = inlinesToDjot ils\ninlineToDjot (Code attr t) =\n  pure $ D.addAttr (toDjotAttr attr) <$> D.verbatim (fromText t)\ninlineToDjot (Math mt t) =\n  pure $ (if mt == InlineMath\n             then D.inlineMath\n             else D.displayMath) (fromText t)\ninlineToDjot (RawInline (Format f) t) =\n  pure $ D.rawInline (D.Format (fromText f)) (fromText t)\ninlineToDjot (Link attr ils (src,tit)) = do\n  opts <- gets options\n  description <- inlinesToDjot ils\n  let ilstring = stringify ils\n  let autolink = ilstring == src\n  let email = (\"mailto:\" <> ilstring) == src\n  let removeClass name (ident, cls, kvs) = (ident, filter (/= name) cls, kvs)\n  let attr' = D.Attr [(\"title\", fromText tit) | not (T.null tit)] <>\n               toDjotAttr ( (if autolink\n                                then removeClass \"uri\"\n                                else id) .\n                            (if email\n                                then removeClass \"email\"\n                                else id) $ attr)\n  case () of\n    _ | autolink -> pure $ D.addAttr attr' <$> D.urlLink (fromText ilstring)\n      | email -> pure $ D.addAttr attr' <$> D.emailLink (fromText ilstring)\n      | writerReferenceLinks opts\n        -> do refs@(D.ReferenceMap m) <- gets references\n              autoRefs <- gets autoReferences\n              let lab' = D.inlinesToByteString description\n              lab <- case D.lookupReference lab' (refs <> autoRefs) of\n                       Just _ -> pure lab'\n                       Nothing -> do\n                         let refnum = M.size m + 1\n                         let lab = fromText $ tshow refnum\n                         modify $ \\st -> st{ references =\n                                               D.insertReference lab\n                                                 (fromText src, attr') refs }\n                         pure lab\n              pure $ D.addAttr attr' <$> D.link description (D.Reference lab)\n      | otherwise\n         -> pure $ D.addAttr attr' <$> D.link description (D.Direct (fromText src))\ninlineToDjot (Image attr ils (src,tit)) = do\n  opts <- gets options\n  description <- inlinesToDjot ils\n  let attr' = D.Attr [(\"title\", fromText tit) | not (T.null tit)] <>\n                toDjotAttr attr\n  if writerReferenceLinks opts\n     then do\n       refs@(D.ReferenceMap m) <- gets references\n       let refnum = M.size m + 1\n       let lab = fromText $ tshow refnum\n       modify $ \\st -> st{ references =\n                             D.insertReference lab\n                               (fromText src, attr') refs }\n       pure $ D.addAttr attr' <$> D.image description (D.Reference lab)\n     else pure $ D.addAttr attr' <$> D.image description (D.Direct (fromText src))\ninlineToDjot (Note bs) = do\n  notes@(D.NoteMap m) <- gets footnotes\n  let notenum = M.size m + 1\n  let lab = fromText $ tshow notenum\n  contents <- blocksToDjot bs\n  modify $ \\st -> st{ footnotes = D.insertNote lab contents notes }\n  pure $ D.footnoteReference lab\n\ntoDjotAttr :: (Text, [Text], [(Text, Text)]) -> D.Attr\ntoDjotAttr (ident, classes, kvs) =\n  D.Attr $ [(\"id\", fromText ident) | not (T.null ident)] ++\n           [(\"class\", fromText (T.unwords classes)) | not (null classes)] ++\n           map (\\(k,v) -> (fromText k, fromText v)) kvs\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/DocBook.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards     #-}\n{- |\n   Module      : Text.Pandoc.Writers.DocBook\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to DocBook XML.\n-}\nmodule Text.Pandoc.Writers.DocBook ( writeDocBook4, writeDocBook5 ) where\nimport Control.Monad.Reader\nimport Data.Generics (everywhere, mkT)\nimport Data.List (nub, partition)\nimport Data.Maybe (isNothing)\nimport Data.Monoid (All (..))\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (languages, languagesByExtension)\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.XML\nimport Text.TeXMath\nimport qualified Text.XML.Light as Xml\n\ndata DocBookVersion = DocBook4 | DocBook5\n     deriving (Eq, Show)\n\ntype DB = ReaderT DocBookVersion\n\n-- | Get level of the top-level headers based on the configured top-level division.\n-- The header level can then be used to determine appropriate DocBook element\n-- for each subdivision associated with a header.\n-- The numbering here follows LaTeX's internal numbering\ngetStartLvl :: WriterOptions -> Int\ngetStartLvl opts =\n  case writerTopLevelDivision opts of\n       TopLevelPart    -> -1\n       TopLevelChapter -> 0\n       TopLevelSection -> 1\n       TopLevelDefault -> 1\n\n-- | Get correct name for the id attribute based on DocBook version.\n-- DocBook 4 used custom id attribute but DocBook 5 adopted the xml:id specification.\n-- https://www.w3.org/TR/xml-id/\nidName :: DocBookVersion -> Text\nidName DocBook5 = \"xml:id\"\nidName DocBook4 = \"id\"\n\n-- | Convert list of authors to a docbook <author> section\nauthorToDocBook :: PandocMonad m => WriterOptions -> [Inline] -> DB m B.Inlines\nauthorToDocBook opts name' = do\n  name <- render Nothing <$> inlinesToDocBook opts name'\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  return $ B.rawInline \"docbook\" $\n    render colwidth $ inTags True \"personname\" [] $\n      if T.any (== ',') name\n         then -- last name first\n              let (lastname, rest) = T.break (==',') name\n                  firstname = triml rest in\n              inTagsSimple \"firstname\" (literal $ escapeStringForXML firstname) <>\n              inTagsSimple \"surname\" (literal $ escapeStringForXML lastname)\n         else -- last name last\n              let namewords = T.words name\n                  lengthname = length namewords\n                  (firstname, lastname) = case lengthname of\n                    0 -> (\"\",\"\")\n                    1 -> (\"\", name)\n                    n -> (T.unwords (take (n-1) namewords), last namewords)\n               in inTagsSimple \"firstname\" (literal $ escapeStringForXML firstname) $$\n                  inTagsSimple \"surname\" (literal $ escapeStringForXML lastname)\n\nwriteDocBook4 :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteDocBook4 opts d =\n  runReaderT (writeDocBook opts d) DocBook4\n\nwriteDocBook5 :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteDocBook5 opts d =\n  runReaderT (writeDocBook opts d) DocBook5\n\n-- | Convert Pandoc document to string in DocBook format.\nwriteDocBook :: PandocMonad m => WriterOptions -> Pandoc -> DB m Text\nwriteDocBook opts doc = do\n  let Pandoc meta blocks = ensureValidXmlIdentifiers doc\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  let startLvl = getStartLvl opts\n  let fromBlocks = blocksToDocBook opts .\n                   makeSections False (Just startLvl)\n  auths' <- mapM (authorToDocBook opts) $ docAuthors meta\n  let meta' = B.setMeta \"author\" auths' meta\n  metadata <- metaToContext opts\n                 fromBlocks\n                 (inlinesToDocBook opts)\n                 meta'\n  main <- fromBlocks blocks\n  let context = defField \"body\" main\n              $ defField \"mathml\" (case writerHTMLMathMethod opts of\n                                          MathML -> True\n                                          _      -> False) metadata\n  return $ render colwidth $\n    (if writerPreferAscii opts then fmap toEntities else id) $\n    case writerTemplate opts of\n         Nothing  -> main\n         Just tpl -> renderTemplate tpl context\n\n-- | Convert a list of Pandoc blocks to DocBook.\nblocksToDocBook :: PandocMonad m => WriterOptions -> [Block] -> DB m (Doc Text)\nblocksToDocBook opts = fmap vcat . mapM (blockToDocBook opts)\n\n-- | Auxiliary function to convert Plain block to Para.\nplainToPara :: Block -> Block\nplainToPara (Plain x) = Para x\nplainToPara x         = x\n\n-- | Convert a list of pairs of terms and definitions into a list of\n-- DocBook varlistentrys.\ndeflistItemsToDocBook :: PandocMonad m\n                      => WriterOptions -> [([Inline],[[Block]])]\n                      -> DB m (Doc Text)\ndeflistItemsToDocBook opts items =\n  vcat <$> mapM (uncurry (deflistItemToDocBook opts)) items\n\n-- | Convert a term and a list of blocks into a DocBook varlistentry.\ndeflistItemToDocBook :: PandocMonad m\n                     => WriterOptions -> [Inline] -> [[Block]]\n                     -> DB m (Doc Text)\ndeflistItemToDocBook opts term defs = do\n  term' <- inlinesToDocBook opts term\n  def' <- blocksToDocBook opts $ concatMap (map plainToPara) defs\n  return $ inTagsIndented \"varlistentry\" $\n      inTagsIndented \"term\" term' $$\n      inTagsIndented \"listitem\" def'\n\n-- | Convert a list of lists of blocks to a list of DocBook list items.\nlistItemsToDocBook :: PandocMonad m\n                   => WriterOptions -> [[Block]] -> DB m (Doc Text)\nlistItemsToDocBook opts items = vcat <$> mapM (listItemToDocBook opts) items\n\n-- | Convert a list of blocks into a DocBook list item.\nlistItemToDocBook :: PandocMonad m\n                  => WriterOptions -> [Block] -> DB m (Doc Text)\nlistItemToDocBook opts item =\n  inTagsIndented \"listitem\" <$> blocksToDocBook opts (map plainToPara item)\n\nimageToDocBook :: WriterOptions -> Attr -> Text -> Doc Text\nimageToDocBook _ attr src = selfClosingTag \"imagedata\" $\n  (\"fileref\", src) : idAndRole attr <> dims\n  where\n    dims = go Width \"width\" <> go Height \"depth\"\n    go dir dstr = case dimension dir attr of\n                    Just a  -> [(dstr, tshow a)]\n                    Nothing -> []\n\n-- | Convert a Pandoc block element to DocBook.\nblockToDocBook :: PandocMonad m => WriterOptions -> Block -> DB m (Doc Text)\n-- Add ids to paragraphs in divs with ids - this is needed for\n-- pandoc-citeproc to get link anchors in bibliographies:\nblockToDocBook opts (Div (id',\"section\":_classes,divattrs)\n                     (Header lvl (_,hclasses,_) ils : xs)) = do\n  version <- ask\n  -- DocBook doesn't allow sections with no content, so insert some if needed\n  let bs = if null xs\n              then [Para []]\n              else xs\n      tag = case lvl of\n                 -1                   -> \"part\"\n                 0                    -> \"chapter\"\n                 n | n >= 1 && n <= 5 -> if version == DocBook5\n                                              then \"section\"\n                                              else \"sect\" <> tshow n\n                 _                    -> \"simplesect\"\n      idAttr = [(idName version, writerIdentifierPrefix opts <> id') | not (T.null id')]\n      -- We want to add namespaces to the root (top-level) element.\n      nsAttr = if version == DocBook5 && lvl == getStartLvl opts && isNothing (writerTemplate opts)\n      -- Though, DocBook 4 does not support namespaces and\n      -- standalone documents will include them in the template.\n                 then [(\"xmlns\", \"http://docbook.org/ns/docbook\")\n                      ,(\"xmlns:xlink\", \"http://www.w3.org/1999/xlink\")]\n                 else []\n\n      -- Populate miscAttr with Header.Attr.attributes, filtering out non-valid DocBook section attributes, id, and xml:id\n      -- Also enrich the role attribute with certain class tokens\n      miscAttr = enrichRole (filter (isSectionAttr version) divattrs) hclasses\n      attribs = nsAttr <> idAttr <> miscAttr\n  title' <- inlinesToDocBook opts ils\n  contents <- blocksToDocBook opts bs\n  return $ inTags True tag attribs $ inTagsSimple \"title\" title' $$ contents\nblockToDocBook opts (Div (ident,classes,_) bs) = do\n  version <- ask\n  let identAttribs = [(idName version, ident) | not (T.null ident)]\n      admonitions = [\"caution\",\"danger\",\"important\",\"note\",\"tip\",\"warning\"]\n  case classes of\n    (l:_) | l `elem` admonitions -> do\n        let (mTitleBs, bodyBs) =\n                case bs of\n                  -- Matches AST produced by the DocBook reader → Markdown writer → Markdown reader chain.\n                  (Div (_,[\"title\"],_) [Para ts] : rest) -> (Just (inlinesToDocBook opts ts), rest)\n                  -- Matches AST produced by the DocBook reader.\n                  (Div (_,[\"title\"],_) ts : rest) -> (Just (blocksToDocBook opts ts), rest)\n                  _ -> (Nothing, bs)\n        admonitionTitle <- case mTitleBs of\n                              Nothing -> return mempty\n                              -- id will be attached to the admonition so let’s pass empty identAttrs.\n                              Just titleBs -> inTagsSimple \"title\" <$> titleBs\n        admonitionBody <- handleDivBody [] bodyBs\n        return (inTags True l identAttribs (admonitionTitle $$ admonitionBody))\n    _ -> handleDivBody identAttribs bs\n  where\n    handleDivBody identAttribs [Para lst] =\n      if hasLineBreaks lst\n         then flush . nowrap . inTags False \"literallayout\" identAttribs\n                             <$> inlinesToDocBook opts lst\n         else inTags True \"para\" identAttribs <$> inlinesToDocBook opts lst\n    handleDivBody identAttribs bodyBs = do\n      contents <- blocksToDocBook opts (map plainToPara bodyBs)\n      return $\n        (if null identAttribs\n            then mempty\n            else selfClosingTag \"anchor\" identAttribs) $$ contents\nblockToDocBook _ h@Header{} = do\n  -- should be handled by Div section above, except inside lists/blockquotes\n  report $ BlockNotRendered h\n  return empty\nblockToDocBook opts (Plain lst) = inlinesToDocBook opts lst\nblockToDocBook opts (Para lst)\n  | hasLineBreaks lst = flush . nowrap . inTagsSimple \"literallayout\"\n                        <$> inlinesToDocBook opts lst\n  | otherwise         = inTagsIndented \"para\" <$> inlinesToDocBook opts lst\nblockToDocBook opts (LineBlock lns) =\n  inTags False \"literallayout\" [] . vcat <$> mapM (inlinesToDocBook opts) lns\nblockToDocBook opts (BlockQuote blocks) =\n  inTagsIndented \"blockquote\" <$> blocksToDocBook opts blocks\nblockToDocBook opts (CodeBlock (_,classes,_) str) = return $\n  literal (\"<programlisting\" <> lang <> \">\") <> cr <>\n     flush (literal (escapeStringForXML str) <> cr <> literal \"</programlisting>\")\n    where lang  = case langs of\n                     [] -> \"\"\n                     (l:_) -> \" language=\\\"\" <> escapeStringForXML l <> \"\\\"\"\n          syntaxMap = writerSyntaxMap opts\n          isLang l    = T.toLower l `elem` map T.toLower (languages syntaxMap)\n          langsFrom s = if isLang s\n                           then [s]\n                           else (languagesByExtension syntaxMap) . T.toLower $ s\n          langs       = concatMap langsFrom classes\nblockToDocBook opts (BulletList lst) = do\n  let attribs = [(\"spacing\", \"compact\") | isTightList lst]\n  inTags True \"itemizedlist\" attribs <$> listItemsToDocBook opts lst\nblockToDocBook _ (OrderedList _ []) = return empty\nblockToDocBook opts (OrderedList (start, numstyle, _) items) = do\n  let numeration = case numstyle of\n                       DefaultStyle -> []\n                       Decimal      -> [(\"numeration\", \"arabic\")]\n                       Example      -> [(\"numeration\", \"arabic\")]\n                       UpperAlpha   -> [(\"numeration\", \"upperalpha\")]\n                       LowerAlpha   -> [(\"numeration\", \"loweralpha\")]\n                       UpperRoman   -> [(\"numeration\", \"upperroman\")]\n                       LowerRoman   -> [(\"numeration\", \"lowerroman\")]\n      spacing    = [(\"spacing\", \"compact\") | isTightList items]\n      startnum   = [(\"startingnumber\", tshow start) | start /= 1]\n      attribs    = numeration <> spacing <> startnum\n  inTags True \"orderedlist\" attribs <$> listItemsToDocBook opts items\nblockToDocBook opts (DefinitionList lst) = do\n  let attribs = [(\"spacing\", \"compact\") | isTightList $ concatMap snd lst]\n  inTags True \"variablelist\" attribs <$> deflistItemsToDocBook opts lst\nblockToDocBook _ b@(RawBlock f str)\n  | f == \"docbook\" = return $ literal str -- raw XML block\n  | f == \"html\"    = do\n                     version <- ask\n                     if version == DocBook5\n                        then return empty -- No html in DocBook5\n                        else return $ literal str -- allow html for backwards\n                                                  -- compatibility\n  | otherwise      = do\n      report $ BlockNotRendered b\n      return empty\nblockToDocBook _ HorizontalRule = return empty -- not semantic\nblockToDocBook opts (Table _ blkCapt specs thead tbody tfoot) = do\n  let (caption, aligns, widths, headers, rows) =\n        toLegacyTable blkCapt specs thead tbody tfoot\n  captionDoc <- if null caption\n                   then return empty\n                   else inTagsSimple \"title\" <$>\n                         inlinesToDocBook opts caption\n  let tableType    = if isEmpty captionDoc then \"informaltable\" else \"table\"\n      percent w    = tshow (truncate (100*w) :: Integer) <> \"*\"\n      coltags = vcat $ zipWith (\\w al -> selfClosingTag \"colspec\"\n                       ([(\"colwidth\", percent w) | w > 0] <>\n                        [(\"align\", alignmentToString al)])) widths aligns\n  head' <- if all null headers\n              then return empty\n              else inTagsIndented \"thead\" <$> tableRowToDocBook opts headers\n  body' <- inTagsIndented \"tbody\" . vcat <$>\n              mapM (tableRowToDocBook opts) rows\n  return $ inTagsIndented tableType $ captionDoc $$\n        inTags True \"tgroup\" [(\"cols\", tshow (length aligns))] (\n         coltags $$ head' $$ body')\nblockToDocBook opts (Figure attr capt@(Caption _ caption) body) = do\n  -- TODO: probably better to handle nested figures as mediaobject\n  let isAcceptable = \\case\n        Table {}  -> All False\n        Figure {} -> All False\n        _         -> All True\n  if not . getAll $ query isAcceptable body\n    -- Fallback to a div if the content cannot be included in a figure\n    then blockToDocBook opts $ figureDiv attr capt body\n    else do\n      title <- inlinesToDocBook opts (blocksToInlines caption)\n      let toMediaobject = \\case\n            Plain [Image imgAttr inlns (src, _)] -> do\n              alt <- inlinesToDocBook opts inlns\n              pure $ inTagsIndented \"mediaobject\" (\n                inTagsIndented \"imageobject\"\n                (imageToDocBook opts imgAttr src) $$\n                if isEmpty alt\n                then empty\n                else inTagsSimple \"textobject\" (inTagsSimple \"phrase\" alt))\n            _ -> ask >>= \\case\n                   DocBook4 -> pure mempty -- docbook4 requires media\n                   DocBook5 -> blocksToDocBook opts body\n      mediaobjects <- mapM toMediaobject body\n      return $\n        if isEmpty $ mconcat mediaobjects\n        then mempty -- figures must have at least some content\n        else inTagsIndented \"figure\" $\n             inTagsSimple \"title\" title $$\n             mconcat mediaobjects\n\nalignmentToString :: Alignment -> Text\nalignmentToString alignment = case alignment of\n                                 AlignLeft    -> \"left\"\n                                 AlignRight   -> \"right\"\n                                 AlignCenter  -> \"center\"\n                                 AlignDefault -> \"left\"\n\ntableRowToDocBook :: PandocMonad m\n                  => WriterOptions\n                  -> [[Block]]\n                  -> DB m (Doc Text)\ntableRowToDocBook opts cols =\n  inTagsIndented \"row\" . vcat <$> mapM (tableItemToDocBook opts) cols\n\ntableItemToDocBook :: PandocMonad m\n                   => WriterOptions\n                   -> [Block]\n                   -> DB m (Doc Text)\ntableItemToDocBook opts item =\n  inTags True \"entry\" [] . vcat <$> mapM (blockToDocBook opts) item\n\n-- | Convert a list of inline elements to DocBook.\ninlinesToDocBook :: PandocMonad m => WriterOptions -> [Inline] -> DB m (Doc Text)\ninlinesToDocBook opts lst = hcat <$> mapM (inlineToDocBook opts) lst\n\n-- | Convert an inline element to DocBook.\ninlineToDocBook :: PandocMonad m => WriterOptions -> Inline -> DB m (Doc Text)\ninlineToDocBook _ (Str str) = return $ literal $ escapeStringForXML str\ninlineToDocBook opts (Emph lst) =\n  inTagsSimple \"emphasis\" <$> inlinesToDocBook opts lst\ninlineToDocBook opts (Underline lst) =\n  inTags False \"emphasis\" [(\"role\", \"underline\")] <$> inlinesToDocBook opts lst\ninlineToDocBook opts (Strong lst) =\n  inTags False \"emphasis\" [(\"role\", \"strong\")] <$> inlinesToDocBook opts lst\ninlineToDocBook opts (Strikeout lst) =\n  inTags False \"emphasis\" [(\"role\", \"strikethrough\")] <$>\n  inlinesToDocBook opts lst\ninlineToDocBook opts (Superscript lst) =\n  inTagsSimple \"superscript\" <$> inlinesToDocBook opts lst\ninlineToDocBook opts (Subscript lst) =\n  inTagsSimple \"subscript\" <$> inlinesToDocBook opts lst\ninlineToDocBook opts (SmallCaps lst) =\n  inTags False \"emphasis\" [(\"role\", \"smallcaps\")] <$>\n  inlinesToDocBook opts lst\ninlineToDocBook opts (Quoted _ lst) =\n  inTagsSimple \"quote\" <$> inlinesToDocBook opts lst\ninlineToDocBook opts (Cite _ lst) =\n  inlinesToDocBook opts lst\ninlineToDocBook opts (Span (ident,_,_) ils) = do\n  version <- ask\n  ((if T.null ident\n       then mempty\n       else selfClosingTag \"anchor\" [(idName version, ident)]) <>) <$>\n    inlinesToDocBook opts ils\ninlineToDocBook _ (Code _ str) =\n  return $ inTagsSimple \"literal\" $ literal (escapeStringForXML str)\ninlineToDocBook opts (Math t str)\n  | isMathML (writerHTMLMathMethod opts) = do\n    res <- convertMath writeMathML t str\n    case res of\n         Right r  -> return $ inTagsSimple tagtype\n                     $ literal $ T.pack $ Xml.ppcElement conf\n                     $ fixNS\n                     $ removeAttr r\n         Left il  -> inlineToDocBook opts il\n  | otherwise =\n     texMathToInlines t str >>= inlinesToDocBook opts\n     where tagtype = case t of\n                       InlineMath  -> \"inlineequation\"\n                       DisplayMath -> \"informalequation\"\n           conf = Xml.useShortEmptyTags (const False) Xml.defaultConfigPP\n           removeAttr e = e{ Xml.elAttribs = [] }\n           fixNS' qname = qname{ Xml.qPrefix = Just \"mml\" }\n           fixNS = everywhere (mkT fixNS')\ninlineToDocBook _ il@(RawInline f x)\n  | f == \"html\" || f == \"docbook\" = return $ literal x\n  | otherwise                     = do\n      report $ InlineNotRendered il\n      return empty\ninlineToDocBook _ LineBreak = return $ literal \"\\n\"\n-- currently ignore, would require the option to add custom\n-- styles to the document\ninlineToDocBook _ Space = return space\n-- because we use \\n for LineBreak, we can't do soft breaks:\ninlineToDocBook _ SoftBreak = return space\ninlineToDocBook opts (Link attr txt (src, _))\n  | Just email <- T.stripPrefix \"mailto:\" src =\n      let emailLink = inTagsSimple \"email\" $ literal $\n                      escapeStringForXML email\n      in  case txt of\n           [Str s] | escapeURI s == email -> return emailLink\n           _             -> do contents <- inlinesToDocBook opts txt\n                               return $ contents <+>\n                                          char '(' <> emailLink <> char ')'\n  | otherwise = do\n      version <- ask\n      (if \"#\" `T.isPrefixOf` src\n            then let tag = if null txt then \"xref\" else \"link\"\n                 in  inTags False tag $\n                     (\"linkend\", writerIdentifierPrefix opts <> T.drop 1 src) :\n                     idAndRole attr\n            else if version == DocBook5\n                    then inTags False \"link\" $ (\"xlink:href\", src) : idAndRole attr\n                    else inTags False \"ulink\" $ (\"url\", src) : idAndRole attr )\n        <$> inlinesToDocBook opts txt\ninlineToDocBook opts (Image attr ils (src, tit)) = return $\n  let titleDoc = if T.null tit\n                   then empty\n                   else inTagsIndented \"objectinfo\" $\n                        inTagsSimple \"title\" (literal $ escapeStringForXML tit)\n      alt = if null ils\n               then mempty\n               else inTagsIndented \"textobject\" $\n                    inTagsSimple \"phrase\" $ literal (stringify ils)\n  in  inTagsIndented \"inlinemediaobject\" $\n        inTagsIndented \"imageobject\"\n          (titleDoc $$ imageToDocBook opts attr src)\n        $$ alt\ninlineToDocBook opts (Note contents) =\n  inTagsIndented \"footnote\" <$> blocksToDocBook opts contents\n\nisMathML :: HTMLMathMethod -> Bool\nisMathML MathML = True\nisMathML _      = False\n\nidAndRole :: Attr -> [(Text, Text)]\nidAndRole (id',cls,_) = ident <> role\n  where\n    ident = [(\"id\", id') | not (T.null id')]\n    role  = [(\"role\", T.unwords cls) | not (null cls)]\n\n-- Used in blockToDocBook for Header (section) to create or extend\n-- the role attribute with candidate class tokens\nenrichRole :: [(Text, Text)] -> [Text] -> [(Text, Text)]\nenrichRole mattrs cls = [(\"role\", T.unwords roles) | roles /= []] <> nonRole\n  where\n    (roleAttr, nonRole) = partition (\\(key, _v) -> key == \"role\") mattrs\n    roles = nub $ filter (`elem` cand) cls <> map snd roleAttr\n    cand = [\"unnumbered\"]\n\nisSectionAttr :: DocBookVersion -> (Text, Text) -> Bool\nisSectionAttr _ (\"label\",_) = True\nisSectionAttr _ (\"status\",_) = True\nisSectionAttr DocBook5 (\"annotations\",_) = True\nisSectionAttr DocBook5 (\"dir\",\"ltr\") = True\nisSectionAttr DocBook5 (\"dir\",\"rtl\") = True\nisSectionAttr DocBook5 (\"dir\",\"lro\") = True\nisSectionAttr DocBook5 (\"dir\",\"rlo\") = True\nisSectionAttr _ (\"remap\",_) = True\nisSectionAttr _ (\"revisionflag\",\"changed\") = True\nisSectionAttr _ (\"revisionflag\",\"added\") = True\nisSectionAttr _ (\"revisionflag\",\"deleted\") = True\nisSectionAttr _ (\"revisionflag\",\"off\") = True\nisSectionAttr _ (\"role\",_) = True\nisSectionAttr DocBook5 (\"version\",_) = True\nisSectionAttr DocBook5 (\"xml:base\",_) = True\nisSectionAttr DocBook5 (\"xml:lang\",_) = True\nisSectionAttr _ (\"xreflabel\",_) = True\nisSectionAttr DocBook5 (\"linkend\",_) = True\nisSectionAttr DocBook5 (\"linkends\",_) = True\nisSectionAttr DocBook5 (\"xlink:actuate\",_) = True\nisSectionAttr DocBook5 (\"xlink:arcrole\",_) = True\nisSectionAttr DocBook5 (\"xlink:from\",_) = True\nisSectionAttr DocBook5 (\"xlink:href\",_) = True\nisSectionAttr DocBook5 (\"xlink:label\",_) = True\nisSectionAttr DocBook5 (\"xlink:role\",_) = True\nisSectionAttr DocBook5 (\"xlink:show\",_) = True\nisSectionAttr DocBook5 (\"xlink:title\",_) = True\nisSectionAttr DocBook5 (\"xlink:to\",_) = True\nisSectionAttr DocBook5 (\"xlink:type\",_) = True\nisSectionAttr DocBook4 (\"arch\",_) = True\nisSectionAttr DocBook4 (\"condition\",_) = True\nisSectionAttr DocBook4 (\"conformance\",_) = True\nisSectionAttr DocBook4 (\"lang\",_) = True\nisSectionAttr DocBook4 (\"os\",_) = True\nisSectionAttr DocBook4 (\"revision\",_) = True\nisSectionAttr DocBook4 (\"security\",_) = True\nisSectionAttr DocBook4 (\"vendor\",_) = True\nisSectionAttr _ (_,_) = False\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Docx/OpenXML.hs",
    "content": "{-# LANGUAGE PatternGuards       #-}\n{-# LANGUAGE RankNTypes          #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections       #-}\n{-# LANGUAGE ViewPatterns        #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE TypeApplications    #-}\n{- |\n   Module      : Text.Pandoc.Writers.Docx\n   Copyright   : Copyright (C) 2012-2025 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to docx.\n-}\nmodule Text.Pandoc.Writers.Docx.OpenXML ( writeOpenXML, maxListLevel ) where\n\nimport Control.Monad (when, unless)\nimport Control.Applicative ((<|>))\nimport Control.Monad.Except (catchError)\nimport Crypto.Hash (hashWith, SHA1(SHA1))\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Char (isLetter, isSpace)\nimport Text.Pandoc.Char (isCJK)\nimport Data.Ord (comparing)\nimport Data.String (fromString)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, maybeToList, isJust)\nimport Control.Monad.State ( gets, modify, MonadTrans(lift) )\nimport Control.Monad.Reader ( asks, MonadReader(local) )\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Skylighting\nimport Text.DocLayout (hcat, vcat, literal, render)\nimport Text.Pandoc.Class (PandocMonad, report, getMediaBag)\nimport Text.Pandoc.Translations (Term(Abstract), translateTerm)\nimport Text.Pandoc.MediaBag (lookupMedia, MediaItem(..))\nimport qualified Text.Pandoc.Translations as Term\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.UTF8 (fromText)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (highlight)\nimport Text.Pandoc.Templates (compileDefaultTemplate, renderTemplate)\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.MIME (extensionFromMimeType, getMimeType)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Writers.Docx.StyleMap\nimport Text.Pandoc.Writers.Docx.Table as Table\nimport Text.Pandoc.Writers.Docx.Types\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Walk\nimport qualified Text.Pandoc.Writers.GridTable as Grid\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport Text.TeXMath\nimport Text.Pandoc.Writers.OOXML\nimport Text.Pandoc.XML.Light as XML\nimport Data.List (sortBy, intercalate, groupBy)\n\n-- from wml.xsd EG_RPrBase\nrPrTagOrder :: M.Map Text Int\nrPrTagOrder =\n  M.fromList\n  (zip [ \"rStyle\"\n    , \"rFonts\"\n    , \"b\"\n    , \"bCs\"\n    , \"i\"\n    , \"iCs\"\n    , \"caps\"\n    , \"smallCaps\"\n    , \"strike\"\n    , \"dstrike\"\n    , \"outline\"\n    , \"shadow\"\n    , \"emboss\"\n    , \"imprint\"\n    , \"noProof\"\n    , \"snapToGrid\"\n    , \"vanish\"\n    , \"webHidden\"\n    , \"color\"\n    , \"spacing\"\n    , \"w\"\n    , \"kern\"\n    , \"position\"\n    , \"sz\"\n    , \"szCs\"\n    , \"highlight\"\n    , \"u\"\n    , \"effect\"\n    , \"bdr\"\n    , \"shd\"\n    , \"fitText\"\n    , \"vertAlign\"\n    , \"rtl\"\n    , \"cs\"\n    , \"em\"\n    , \"lang\"\n    , \"eastAsianLayout\"\n    , \"specVanish\"\n    , \"oMath\"\n    ] [0..])\n\nsortSquashed :: [Element] -> [Element]\nsortSquashed l =\n  sortBy (comparing tagIndex) l\n  where\n    tagIndex :: Element -> Int\n    tagIndex el =\n      fromMaybe 0 (M.lookup tag rPrTagOrder)\n      where tag = (qName . elName) el\n\nsquashProps :: EnvProps -> [Element]\nsquashProps (EnvProps Nothing es) = sortSquashed es\nsquashProps (EnvProps (Just e) es) = sortSquashed (e : es)\n\n-- | Certain characters are invalid in XML even if escaped.\n-- See #1992\nstripInvalidChars :: Text -> Text\nstripInvalidChars = T.filter isValidChar\n\n-- | See XML reference\nisValidChar :: Char -> Bool\nisValidChar '\\t' = True\nisValidChar '\\n' = True\nisValidChar '\\r' = True\nisValidChar '\\xFFFE' = False\nisValidChar '\\xFFFF' = False\nisValidChar c = (' ' <= c && c <= '\\xD7FF') || ('\\xE000' <= c)\n\n-- this is the lowest number used for a list numId\nbaseListId :: Int\nbaseListId = 1000\n\ngetNumId :: (PandocMonad m) => WS m Int\ngetNumId = gets (((baseListId - 1) +) . length . stLists)\n\nmakeTOC :: (PandocMonad m) => WriterOptions -> WS m [Element]\nmakeTOC opts = do\n  let depth = \"1-\" <> tshow (writerTOCDepth opts)\n  let tocCmd = \"TOC \\\\o \\\"\" <> depth <> \"\\\" \\\\h \\\\z \\\\u\"\n  tocTitle <- gets stTocTitle\n  title <- withParaPropM (pStyleM \"TOC Heading\") (blocksToOpenXML opts [Para tocTitle])\n  return\n    [mknode \"w:sdt\" [] [\n      mknode \"w:sdtPr\" [] (\n        mknode \"w:docPartObj\" []\n          [mknode \"w:docPartGallery\" [(\"w:val\",\"Table of Contents\")] (),\n          mknode \"w:docPartUnique\" [] ()]\n         -- w:docPartObj\n      ), -- w:sdtPr\n      mknode \"w:sdtContent\" [] (title ++ [ Elem $\n        mknode \"w:p\" [] (\n          mknode \"w:r\" [] [\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"begin\"),(\"w:dirty\",\"true\")] (),\n            mknode \"w:instrText\" [(\"xml:space\",\"preserve\")] tocCmd,\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"separate\")] (),\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"end\")] ()\n          ] -- w:r\n        ) -- w:p\n      ])\n    ]] -- w:sdt\n\nmakeLOF :: (PandocMonad m) => WriterOptions -> WS m [Element]\nmakeLOF opts = do\n  let lofCmd = \"TOC \\\\h \\\\z \\\\t \\\"Image Caption\\\" \\\\c\" :: Text\n  lofTitle <- B.toList <$> B.text <$> translateTerm Term.ListOfFigures\n  title <- withParaPropM (pStyleM \"TOC Heading\") (blocksToOpenXML opts [Para lofTitle])\n  return\n    [mknode \"w:sdt\" [] [\n      mknode \"w:sdtPr\" [] (\n        mknode \"w:docPartObj\" []\n          [mknode \"w:docPartGallery\" [(\"w:val\",\"List of Figures\")] (),\n          mknode \"w:docPartUnique\" [] ()]\n         -- w:docPartObj\n      ), -- w:sdtPr\n      mknode \"w:sdtContent\" [] (title ++ [ Elem $\n        mknode \"w:p\" [] (\n          mknode \"w:r\" [] [\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"begin\"),(\"w:dirty\",\"true\")] (),\n            mknode \"w:instrText\" [(\"xml:space\",\"preserve\")] lofCmd,\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"separate\")] (),\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"end\")] ()\n          ] -- w:r\n        ) -- w:p\n      ]) -- w:sdtContent\n    ]] -- w:sdt\n\nmakeLOT :: (PandocMonad m) => WriterOptions -> WS m [Element]\nmakeLOT opts = do\n  let lotCmd = \"TOC \\\\h \\\\z \\\\t \\\"Table Caption\\\" \\\\c\" :: Text\n  lotTitle <- B.toList <$> B.text <$> translateTerm Term.ListOfTables\n  title <- withParaPropM (pStyleM \"TOC Heading\") (blocksToOpenXML opts [Para lotTitle])\n  return\n    [mknode \"w:sdt\" [] [\n      mknode \"w:sdtPr\" [] (\n        mknode \"w:docPartObj\" []\n          [mknode \"w:docPartGallery\" [(\"w:val\",\"List of Tables\")] (),\n          mknode \"w:docPartUnique\" [] ()]\n         -- w:docPartObj\n      ), -- w:sdtPr\n      mknode \"w:sdtContent\" [] (title ++ [ Elem $\n        mknode \"w:p\" [] (\n          mknode \"w:r\" [] [\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"begin\"),(\"w:dirty\",\"true\")] (),\n            mknode \"w:instrText\" [(\"xml:space\",\"preserve\")] lotCmd,\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"separate\")] (),\n            mknode \"w:fldChar\" [(\"w:fldCharType\",\"end\")] ()\n          ] -- w:r\n        ) -- w:p\n      ]) -- w:sdtContent\n    ]] -- w:sdt\n\n-- | Separator element between sections\nsectionSeparator :: PandocMonad m => WS m (Maybe Content)\nsectionSeparator = do\n  asks envSectPr >>= \\case\n    Just sectPrElem -> pure $\n      Just $ Elem (mknode \"w:p\" [] (mknode \"w:pPr\" [] [sectPrElem]))\n    Nothing -> pure\n      Nothing\n\n-- | Convert Pandoc document to rendered document contents plus two lists of\n-- OpenXML elements (footnotes and comments).\nwriteOpenXML :: PandocMonad m\n             => WriterOptions -> Pandoc\n             -> WS m (Text, [Element], [Element])\nwriteOpenXML opts (Pandoc meta blocks) = do\n  setupTranslations meta\n  let includeTOC = writerTableOfContents opts || lookupMetaBool \"toc\" meta\n  let includeLOF = writerListOfFigures opts || lookupMetaBool \"lof\" meta\n  let includeLOT = writerListOfTables opts || lookupMetaBool \"lot\" meta\n  abstractTitle <- case lookupMeta \"abstract-title\" meta of\n      Just (MetaBlocks bs)   -> pure $ stringify bs\n      Just (MetaInlines ils) -> pure $ stringify ils\n      Just (MetaString s)    -> pure s\n      _                      -> translateTerm Abstract\n  abstract <-\n    case lookupMetaBlocks \"abstract\" meta of\n      [] -> return mempty\n      xs -> vcat . map (literal . showContent) <$>\n              withParaPropM (pStyleM \"Abstract\") (blocksToOpenXML opts xs)\n\n  let toInlineMeta field = hcat . map (literal . showContent) <$>\n         inlinesToOpenXML opts (lookupMetaInlines field meta)\n\n  title <- toInlineMeta \"title\"\n  subtitle <- toInlineMeta \"subtitle\"\n  date <- toInlineMeta \"date\"\n\n  author <- mapM\n             (fmap (hcat . map (literal . showContent)) . inlinesToOpenXML opts)\n             (docAuthors meta)\n\n  doc' <- setFirstPara >> blocksToOpenXML opts blocks\n  let body = vcat $ map (literal . showContent) doc'\n  notes' <- gets (reverse . stFootnotes)\n  comments <- gets (reverse . stComments)\n  let toComment (kvs, ils) = do\n        annotation <- inlinesToOpenXML opts ils\n        return $\n          mknode \"w:comment\" [(\"w:\" <> k, v) | (k,v) <- kvs]\n            [ mknode \"w:p\" [] $\n              map Elem\n              [ mknode \"w:pPr\" []\n                [ mknode \"w:pStyle\" [(\"w:val\", \"CommentText\")] () ]\n              , mknode \"w:r\" []\n                [ mknode \"w:rPr\" []\n                  [ mknode \"w:rStyle\" [(\"w:val\", \"CommentReference\")] ()\n                  ]\n                  , mknode \"w:annotationRef\" [] ()\n                ]\n              ] ++ annotation\n            ]\n  comments' <- mapM toComment comments\n  toc <- if includeTOC\n            then makeTOC opts\n            else return []\n  lof <- if includeLOF\n            then makeLOF opts\n            else return []\n  lot <- if includeLOT\n            then makeLOT opts\n            else return []\n  metadata <- metaToContext opts\n                 (fmap (vcat . map (literal . showContent)) . blocksToOpenXML opts)\n                 (fmap (hcat . map (literal . showContent)) . inlinesToOpenXML opts)\n                 meta\n  cStyleMap <- gets (smParaStyle . stStyleMaps)\n  let styleIdOf name = fromStyleId $ getStyleIdFromName name cStyleMap\n  renderedSectPr <- maybe mempty ppElement <$> asks envSectPr\n\n  let context = resetField \"body\" body\n              . resetField \"toc\"\n                   (vcat (map (literal . showElement) toc))\n              . resetField \"lof\"\n                   (vcat (map (literal . showElement) lof))\n              . resetField \"lot\"\n                   (vcat (map (literal . showElement) lot))\n              . resetField \"title\" title\n              . resetField \"subtitle\" subtitle\n              . resetField \"author\" author\n              . resetField \"date\" date\n              . resetField \"abstract-title\" abstractTitle\n              . resetField \"abstract\" abstract\n              . resetField \"title-style-id\" (styleIdOf \"Title\")\n              . resetField \"subtitle-style-id\" (styleIdOf \"Subtitle\")\n              . resetField \"author-style-id\" (styleIdOf \"Author\")\n              . resetField \"date-style-id\" (styleIdOf \"Date\")\n              . resetField \"abstract-title-style-id\" (styleIdOf \"AbstractTitle\")\n              . resetField \"abstract-style-id\" (styleIdOf \"Abstract\")\n              . resetField \"sectpr\" renderedSectPr\n              $ metadata\n  tpl <- maybe (lift $ compileDefaultTemplate \"openxml\") pure $ writerTemplate opts\n  let rendered = render Nothing $ renderTemplate tpl context\n  return (rendered, notes', comments')\n\n-- | Convert a list of Pandoc blocks to OpenXML.\nblocksToOpenXML :: (PandocMonad m) => WriterOptions -> [Block] -> WS m [Content]\nblocksToOpenXML opts =\n  fmap concat . mapM (blockToOpenXML opts)\n  . separateTables . filter (not . isForeignRawBlock)\n\nisForeignRawBlock :: Block -> Bool\nisForeignRawBlock (RawBlock format _) = format /= \"openxml\"\nisForeignRawBlock _                   = False\n\n-- Word combines adjacent tables unless you put an empty paragraph between\n-- them.  See #4315.\nseparateTables :: [Block] -> [Block]\nseparateTables [] = []\nseparateTables (x@Table{}:xs@(Table{}:_)) =\n  x : RawBlock (Format \"openxml\") \"<w:p />\" : separateTables xs\nseparateTables (x:xs) = x : separateTables xs\n\nrStyleM :: (PandocMonad m) => CharStyleName -> WS m XML.Element\nrStyleM styleName = do\n  cStyleMap <- gets (smCharStyle . stStyleMaps)\n  let sty' = getStyleIdFromName styleName cStyleMap\n  return $ mknode \"w:rStyle\" [(\"w:val\", fromStyleId sty')] ()\n\ngetUniqueId :: (PandocMonad m) => WS m Text\ngetUniqueId = do\n  n <- gets stCurId\n  modify $ \\st -> st{stCurId = n + 1}\n  return $ tshow n\n\n-- | Key for specifying user-defined docx styles.\ndynamicStyleKey :: Text\ndynamicStyleKey = \"custom-style\"\n\n-- | Convert a Pandoc block element to OpenXML.\nblockToOpenXML :: (PandocMonad m) => WriterOptions -> Block -> WS m [Content]\nblockToOpenXML opts blk = withDirection $ blockToOpenXML' opts blk\n\nblockToOpenXML' :: (PandocMonad m) => WriterOptions -> Block -> WS m [Content]\nblockToOpenXML' opts (Div (ident,_classes,kvs) bs) = do\n  stylemod <- case lookup dynamicStyleKey kvs of\n                   Just (fromString . T.unpack -> sty) -> do\n                      modify $ \\s ->\n                        s{stDynamicParaProps = Set.insert sty\n                             (stDynamicParaProps s)}\n                      return $ withParaPropM (pStyleM sty)\n                   _ -> return id\n  dirmod <- case lookup \"dir\" kvs of\n                 Just \"rtl\" -> return $ local (\\env -> env { envRTL = True })\n                 Just \"ltr\" -> return $ local (\\env -> env { envRTL = False })\n                 _ -> return id\n  let (hs, bs') = if ident == \"refs\"\n                     then span isHeaderBlock bs\n                     else ([], bs)\n  let bibmod = if ident == \"refs\"\n                  then withParaPropM (pStyleM \"Bibliography\")\n                  else id\n  let langmod = case lookup \"lang\" kvs of\n                  Nothing -> id\n                  Just lang -> local (\\env -> env{envLang = Just lang})\n  header <- dirmod $ stylemod $ blocksToOpenXML opts hs\n  contents <- dirmod $ bibmod $ stylemod $ langmod $ blocksToOpenXML opts bs'\n  wrapBookmark ident $ header <> contents\nblockToOpenXML' opts (Header lev (ident,_,kvs) lst) = do\n  setFirstPara\n  let isSection = case writerTopLevelDivision opts of\n                     TopLevelChapter -> lev == 1\n                     TopLevelPart -> lev <= 2\n                     _ -> False\n  paraProps <- withParaPropM (pStyleM (fromString $ \"Heading \"++show lev)) $\n                    getParaProps False\n  number <-\n        if writerNumberSections opts\n           then\n             case lookup \"number\" kvs of\n                Just n -> do\n                   num <- withTextPropM (rStyleM \"SectionNumber\")\n                            (inlineToOpenXML opts (Str n))\n                   return $ num ++ [Elem $ mknode \"w:r\" [] [mknode \"w:tab\" [] ()]]\n                Nothing -> return []\n           else return []\n  contents <- (number ++) <$> inlinesToOpenXML opts lst\n  -- Add section break before section-level headers, but not for the first one\n  -- to avoid a blank first page (#10578, #11482).\n  addSectionBreak <- if isSection\n    then do\n      isFirst <- gets stFirstSectionHeader\n      if isFirst\n        then do\n          modify $ \\s -> s { stFirstSectionHeader = False }\n          pure id\n        else sectionSeparator >>= \\case\n          Just sep -> pure (sep:)\n          Nothing  -> pure id\n    else pure id\n  addSectionBreak <$>\n    if T.null ident\n       then return [Elem $ mknode \"w:p\" [] (map Elem paraProps ++ contents)]\n       else do\n         let bookmarkName = ident\n         modify $ \\s -> s{ stSectionIds = Set.insert bookmarkName\n                                        $ stSectionIds s }\n         bookmarkedContents <- wrapBookmark bookmarkName contents\n         return [Elem $ mknode \"w:p\" [] (map Elem paraProps ++ bookmarkedContents)]\nblockToOpenXML' opts (Plain lst) = do\n  isInTable <- gets stInTable\n  isInList <- gets stInList\n  let block = blockToOpenXML opts (Para lst)\n  prop <- pStyleM \"Compact\"\n  if isInTable || isInList\n     then withParaProp prop block\n     else block\nblockToOpenXML' opts (Para lst)\n  | null lst && not (isEnabled Ext_empty_paragraphs opts) = return []\n  | otherwise = do\n      isFirstPara <- gets stFirstPara\n      let displayMathPara = case lst of\n                                 [x] -> isDisplayMath x\n                                 _   -> False\n      paraProps <- getParaProps displayMathPara\n      bodyTextStyle <- pStyleM $ if isFirstPara\n                       then \"First Paragraph\"\n                       else \"Body Text\"\n      let paraProps' = case paraProps of\n            []               -> [mknode \"w:pPr\" [] [bodyTextStyle]]\n            ps               -> ps\n      modify $ \\s -> s { stFirstPara = False }\n      contents <- inlinesToOpenXML opts lst\n      return [Elem $ mknode \"w:p\" [] (map Elem paraProps' ++ contents)]\nblockToOpenXML' opts (LineBlock lns) = blockToOpenXML opts $ linesToPara lns\nblockToOpenXML' _ b@(RawBlock format str)\n  | format == Format \"openxml\" = return [\n        Text (CData CDataRaw str Nothing)\n      ]\n  | otherwise                  = do\n      report $ BlockNotRendered b\n      return []\nblockToOpenXML' opts (BlockQuote blocks) = do\n  inNote <- asks envInNote\n  p <- withParaPropM (pStyleM\n                       (if inNote\n                           then \"Footnote Block Text\"\n                           else \"Block Text\"))\n       $ blocksToOpenXML opts blocks\n  setFirstPara\n  return p\nblockToOpenXML' opts (CodeBlock attrs@(ident, _, _) str) = do\n  p <- withParaPropM (pStyleM \"Source Code\") (blockToOpenXML opts $ Para [Code attrs str])\n  setFirstPara\n  wrapBookmark ident p\nblockToOpenXML' _ HorizontalRule = do\n  setFirstPara\n  return [ Elem $\n    mknode \"w:p\" [] $ mknode \"w:r\" [] $ mknode \"w:pict\" []\n    $ mknode \"v:rect\" [(\"style\",\"width:0;height:1.5pt\"),\n                       (\"o:hralign\",\"center\"),\n                       (\"o:hrstd\",\"t\"),(\"o:hr\",\"t\")] () ]\nblockToOpenXML' opts (Table attr caption colspecs thead tbodies tfoot) = do\n  -- Remove extra paragraph indentation due to list items (#5947).\n  -- This means that tables in lists will not be indented, but it\n  -- avoids unwanted indentation in each cell.\n  content <- tableToOpenXML opts\n              (local (\\env -> env{ envListLevel = -1 }) . blocksToOpenXML opts)\n                 (Grid.toTable attr caption colspecs thead tbodies tfoot)\n  let (tableId, _, _) = attr\n  wrapBookmark tableId content\nblockToOpenXML' opts el\n  | BulletList lst <- el\n    = case mapM toTaskListItem lst of\n      Just items -> mconcat <$>\n        mapM (\\(checked, bs) -> addOpenXMLList (CheckboxMarker checked) [bs]) items\n      Nothing -> addOpenXMLList BulletMarker lst\n  | OrderedList (start, numstyle, numdelim) lst <- el\n    = addOpenXMLList (NumberMarker numstyle numdelim start) lst\n  where\n    addOpenXMLList marker items = do\n      addList marker\n      numid <- getNumId\n      exampleid <- case marker of\n                     NumberMarker Example _ _ -> gets stExampleId\n                     _ -> return Nothing\n      l <- asList $ concat <$>\n             mapM (listItemToOpenXML opts $ fromMaybe numid exampleid) items\n      setFirstPara\n      return l\nblockToOpenXML' opts (DefinitionList items) = do\n  l <- concat `fmap` mapM (definitionListItemToOpenXML opts) items\n  setFirstPara\n  return l\nblockToOpenXML' opts (Figure (ident, _, _) (Caption _ longcapt) body) = do\n  setFirstPara\n  fignum <- gets stNextFigureNum\n  unless (null longcapt) $ modify $ \\st -> st{ stNextFigureNum = fignum + 1 }\n  let refid = if T.null ident\n              then \"ref_fig\" <> tshow fignum\n              else \"ref_\" <> ident\n  figname <- translateTerm Term.Figure\n  prop <- pStyleM $\n    if null longcapt\n    then \"Figure\"\n    else \"Captioned Figure\"\n  paraProps <- local\n    (\\env -> env { envParaProperties = EnvProps (Just prop) [] <>\n                                       envParaProperties env })\n    (getParaProps False)\n\n  -- Figure contents\n  let simpleImage x = do\n        imgXML <- inlineToOpenXML opts x\n        pure $ Elem (mknode \"w:p\" [] (map Elem paraProps ++ imgXML))\n  contentsNode <- case body of\n    [Plain [img@Image {}]] -> simpleImage img\n    [Para  [img@Image {}]] -> simpleImage img\n    _                      -> toFigureTable opts body\n  -- Caption\n  let imageCaption = withParaPropM (pStyleM \"Image Caption\")\n                   . blocksToOpenXML opts\n  let fstCaptionPara inlns = Para $\n        if not $ isEnabled Ext_native_numbering opts\n        then inlns\n        else let rawfld = RawInline (Format \"openxml\") $ mconcat\n                          [ \"<w:fldSimple w:instr=\\\"SEQ Figure\"\n                          , \" \\\\* ARABIC \\\"><w:r><w:t>\"\n                          , tshow fignum\n                          , \"</w:t></w:r></w:fldSimple>\"\n                          ]\n             in Span (refid,[],[]) [Str (figname <> \"\\160\") , rawfld]\n                : Str \": \" : inlns\n  captionNode <- case longcapt of\n    []              -> return []\n    (Para xs  : bs) -> imageCaption (fstCaptionPara xs : bs)\n    (Plain xs : bs) -> imageCaption (fstCaptionPara xs : bs)\n    _               -> imageCaption longcapt\n  wrapBookmark ident $\n    case writerFigureCaptionPosition opts of\n      CaptionBelow -> contentsNode : captionNode\n      CaptionAbove -> captionNode ++ [contentsNode]\n\ntoFigureTable :: PandocMonad m\n              => WriterOptions -> [Block] -> WS m Content\ntoFigureTable opts blks = do\n  modify $ \\s -> s { stInTable = True }\n  let ncols = length blks\n  let textwidth = 7920  -- 5.5 in in twips       (1 twip == 1/20 pt)\n  let cellfrac = 1 / fromIntegral ncols\n  let colwidth = tshow @Integer $ floor (textwidth * cellfrac) -- twips\n  let gridCols = replicate ncols $ mknode \"w:gridCol\" [(\"w:w\", colwidth)] ()\n  let scaleImage = \\case\n        Image attr@(ident, classes, attribs) alt tgt ->\n          let dimWidth  = case dimension Width attr of\n                            Nothing -> Percent (cellfrac * 100)\n                            Just d  -> scaleDimension cellfrac d\n              dimHeight = scaleDimension cellfrac <$> dimension Height attr\n              attribs' = (tshow Width, tshow dimWidth) :\n                         (case dimHeight of\n                            Nothing -> id\n                            Just h  -> ((tshow Height, tshow h) :))\n                         [ (k, v) | (k, v) <- attribs\n                                  , k `notElem` [\"width\", \"height\"]\n                                  ]\n          in Image (ident, classes, attribs') alt tgt\n        x -> x\n  let blockToCell = Table.OOXMLCell nullAttr AlignCenter 1 1 . (:[])\n                  . walk scaleImage\n  tblBody <- Table.rowToOpenXML (blocksToOpenXML opts) .\n             Table.OOXMLRow Table.BodyRow nullAttr $\n             map blockToCell blks\n  let tbl = mknode \"w:tbl\" []\n        ( mknode \"w:tblPr\" []\n          [ mknode \"w:tblStyle\" [(\"w:val\",\"FigureTable\")] (),\n            mknode \"w:tblW\" [ (\"w:type\", \"auto\"), (\"w:w\", \"0\") ] (),\n            mknode \"w:jc\" [(\"w:val\",\"center\")] (),\n            mknode \"w:tblLook\" [ (\"w:firstRow\", \"0\")\n                               , (\"w:lastRow\", \"0\")\n                               , (\"w:firstColumn\", \"0\")\n                               , (\"w:lastColumn\", \"0\")\n                               ] ()\n          ]\n          : mknode \"w:tblGrid\" [] gridCols\n          : maybeToList tblBody\n        )\n  modify $ \\s -> s { stInTable = False }\n  return $ Elem tbl\n\n\ndefinitionListItemToOpenXML  :: (PandocMonad m)\n                             => WriterOptions -> ([Inline],[[Block]])\n                             -> WS m [Content]\ndefinitionListItemToOpenXML opts (term,defs) = do\n  term' <- withParaPropM (pStyleM \"Definition Term\")\n           $ blockToOpenXML opts (Para term)\n  defs' <- withParaPropM (pStyleM \"Definition\")\n           $ concat `fmap` mapM (blocksToOpenXML opts) defs\n  return $ term' ++ defs'\n\naddList :: (PandocMonad m) => ListMarker -> WS m ()\naddList marker = do\n  lists <- gets stLists\n  lastExampleId <- gets stExampleId\n  modify $ \\st -> st{ stLists = lists ++ case marker of\n                                         -- Use only first occurrence of Example for list declaration to avoid overhead\n                                         NumberMarker Example _ _ | isJust lastExampleId -> []\n                                         _ -> [marker]\n                    , stExampleId = case marker of\n                                         -- Reuse the same identifier for all other occurrences of Example\n                                         NumberMarker Example _ _ -> lastExampleId <|> Just (baseListId + length lists)\n                                         _ -> lastExampleId\n                  }\n\nlistItemToOpenXML :: (PandocMonad m)\n                  => WriterOptions\n                  -> Int -> [Block]\n                  -> WS m [Content]\nlistItemToOpenXML opts numid bs = do\n  oldInList <- gets stInList\n  modify $ \\st -> st{ stInList = True }\n  let isListBlock = \\case\n        BulletList{}  -> True\n        OrderedList{} -> True\n        _             -> False\n  -- Prepend an empty string if the first entry is another\n  -- list. Otherwise the outer bullet will disappear.\n  let bs' = case bs of\n                 [] -> []\n                 x:xs -> if isListBlock x\n                               then Plain [Str \"\"]:x:xs\n                               else x:xs\n  modify $ \\st -> st{ stNumIdUsed = False }\n  contents <- withNumId numid $ blocksToOpenXML opts bs'\n  modify $ \\st -> st{ stInList = oldInList }\n  return contents\n\n-- | Convert a list of inline elements to OpenXML.\ninlinesToOpenXML :: PandocMonad m => WriterOptions -> [Inline] -> WS m [Content]\ninlinesToOpenXML opts lst = concat `fmap` mapM (inlineToOpenXML opts) (convertSpace lst)\n\nwithNumId :: (PandocMonad m) => Int -> WS m a -> WS m a\nwithNumId numid = local $ \\env -> env{ envListNumId = numid }\n\nasList :: (PandocMonad m) => WS m a -> WS m a\nasList = local $ \\env -> env{ envListLevel = envListLevel env + 1 }\n\ngetTextProps :: (PandocMonad m) => WS m [Element]\ngetTextProps = do\n  props <- asks envTextProperties\n  mblang <- asks envLang\n  let langnode = case mblang of\n                   Nothing -> mempty\n                   Just l  -> EnvProps Nothing\n                               [mknode \"w:lang\" [(\"w:val\", l)] ()]\n  let squashed = squashProps (props <> langnode)\n  return [mknode \"w:rPr\" [] squashed | (not . null) squashed]\n\nwithTextProp :: PandocMonad m => Element -> WS m a -> WS m a\nwithTextProp d p =\n  local (\\env -> env {envTextProperties = ep <> envTextProperties env}) p\n  where ep = if isStyle d then EnvProps (Just d) [] else EnvProps Nothing [d]\n\nwithTextPropM :: PandocMonad m => WS m Element -> WS m a -> WS m a\nwithTextPropM md p = do\n  d <- md\n  withTextProp d p\n\ngetParaProps :: PandocMonad m => Bool -> WS m [Element]\ngetParaProps displayMathPara = do\n  props <- asks envParaProperties\n  listLevel <- asks envListLevel\n  numid <- asks envListNumId\n  numIdUsed <- gets stNumIdUsed\n  -- clear numId after first use to support multiple paragraphs in the same bullet\n  -- baseListId is the code for no list marker\n  let numid' = if numIdUsed then baseListId else numid\n  modify $ \\st -> st{ stNumIdUsed = True }\n  let listPr = [mknode \"w:numPr\" []\n                [ mknode \"w:ilvl\" [(\"w:val\",tshow listLevel)] ()\n                , mknode \"w:numId\" [(\"w:val\",tshow numid')] () ] | listLevel >= 0 && not displayMathPara]\n  return $ case squashProps (EnvProps Nothing listPr <> props) of\n                [] -> []\n                ps -> [mknode \"w:pPr\" [] ps]\n\nformattedString :: PandocMonad m => Text -> WS m [Element]\nformattedString str =\n  -- properly handle soft hyphens\n  case splitTextBy (=='\\173') str of\n      [w] -> formattedString' w\n      ws  -> do\n         sh <- formattedRun [mknode \"w:softHyphen\" [] ()]\n         intercalate [sh] <$> mapM formattedString' ws\n\nformattedString' :: PandocMonad m => Text -> WS m [Element]\nformattedString' str = do\n  inDel <- asks envInDel\n  let mkrun s =\n        (if T.any isCJK s\n            then withTextProp (mknode \"w:rFonts\" [(\"w:hint\",\"eastAsia\")] ())\n            else id) $ formattedRun\n                       [ mktnode (if inDel then \"w:delText\" else \"w:t\")\n                          [(\"xml:space\",\"preserve\")] $ s ]\n  mapM mkrun $ breakIntoChunks $ stripInvalidChars str\n\n-- For motivation see #9817.\nbreakIntoChunks :: Text -> [Text]\nbreakIntoChunks t\n  | T.null t = []\n  | T.any isCJK t\n    = let cs = T.groupBy (\\c d -> (isSpace c && isSpace d) ||\n                                  not (isSpace c || isSpace d)) t\n          css = groupBy (\\x y -> not (T.any isCJK x || T.any isCJK y)\n                                  || (T.all isSpace x && not (T.any isCJK y))\n                                  || (T.all isSpace y && not (T.any isCJK x)))\n                        cs\n       in map mconcat css\n  | otherwise = [t]\n\nformattedRun :: PandocMonad m => [Element] -> WS m Element\nformattedRun els = do\n  props <- getTextProps\n  return $ mknode \"w:r\" [] $ props ++ els\n\n-- | Convert an inline element to OpenXML.\ninlineToOpenXML :: PandocMonad m => WriterOptions -> Inline -> WS m [Content]\ninlineToOpenXML opts il = withDirection $ inlineToOpenXML' opts il\n\ninlineToOpenXML' :: PandocMonad m => WriterOptions -> Inline -> WS m [Content]\ninlineToOpenXML' _ (Str str) =\n  map Elem <$> formattedString str\ninlineToOpenXML' opts Space = inlineToOpenXML opts (Str \" \")\ninlineToOpenXML' opts SoftBreak = inlineToOpenXML opts (Str \" \")\ninlineToOpenXML' opts (Span (\"\",[\"mark\"],[]) ils) =\n  withTextProp (mknode \"w:highlight\" [(\"w:val\",\"yellow\")] ()) $\n    inlinesToOpenXML opts ils\ninlineToOpenXML' opts (Span (\"\",[\"csl-block\"],[]) ils) =\n  inlinesToOpenXML opts ils\ninlineToOpenXML' opts (Span (\"\",[\"csl-left-margin\"],[]) ils) =\n  inlinesToOpenXML opts ils\ninlineToOpenXML' opts (Span (\"\",[\"csl-right-inline\"],[]) ils) =\n   ([Elem $\n     mknode \"w:r\" []\n     (mknode \"w:t\"\n       [(\"xml:space\",\"preserve\")]\n       (\"\\t\" :: Text))] ++)\n    <$> inlinesToOpenXML opts ils\ninlineToOpenXML' opts (Span (\"\",[\"csl-indent\"],[]) ils) =\n  inlinesToOpenXML opts ils\ninlineToOpenXML' _ (Span (ident,[\"comment-start\"],kvs) ils) = do\n  -- prefer the \"id\" in kvs, since that is the one produced by the docx\n  -- reader.\n  let ident' = fromMaybe ident (lookup \"id\" kvs)\n      kvs' = filter ((\"id\" /=) . fst) kvs\n  modify $ \\st -> st{ stComments = ((\"id\",ident'):kvs', ils) : stComments st }\n  return [ Elem $ mknode \"w:commentRangeStart\" [(\"w:id\", ident')] () ]\ninlineToOpenXML' opts (Span (ident,[\"comment-end\"],kvs) content) = do\n  -- prefer the \"id\" in kvs, since that is the one produced by the docx\n  -- reader.\n  let ident' = fromMaybe ident (lookup \"id\" kvs)\n  -- process nested content: see #8189\n  nestedContent <- inlinesToOpenXML opts content\n  let thisCommentEnd =\n        [ mknode \"w:commentRangeEnd\" [(\"w:id\", ident')] ()\n        , mknode \"w:r\" []\n          [ mknode \"w:rPr\" []\n            [ mknode \"w:rStyle\" [(\"w:val\", \"CommentReference\")] () ]\n          , mknode \"w:commentReference\" [(\"w:id\", ident')] () ]\n        ]\n  return $ map Elem thisCommentEnd ++ nestedContent\ninlineToOpenXML' opts (Span (ident,classes,kvs) ils) = do\n  stylemod <- case lookup dynamicStyleKey kvs of\n                   Just (fromString . T.unpack -> sty) -> do\n                      modify $ \\s ->\n                        s{stDynamicTextProps = Set.insert sty\n                              (stDynamicTextProps s)}\n                      return $ withTextPropM (rStyleM sty)\n                   _ -> return id\n  let dirmod = case lookup \"dir\" kvs of\n                 Just \"rtl\" -> local (\\env -> env { envRTL = True })\n                 Just \"ltr\" -> local (\\env -> env { envRTL = False })\n                 _          -> id\n      off x = withTextProp (mknode x [(\"w:val\",\"0\")] ())\n      pmod =  (if \"csl-no-emph\" `elem` classes then off \"w:i\" else id) .\n              (if \"csl-no-strong\" `elem` classes then off \"w:b\" else id) .\n              (if \"csl-no-smallcaps\" `elem` classes\n                  then off \"w:smallCaps\"\n                  else id)\n      getChangeAuthorDate = do\n        defaultAuthor <- asks envChangesAuthor\n        let author = fromMaybe defaultAuthor (lookup \"author\" kvs)\n        let mdate = lookup \"date\" kvs\n        return $ (\"w:author\", author) :\n                   maybe [] (\\date -> [(\"w:date\", date)]) mdate\n  insmod <- if \"insertion\" `elem` classes\n               then do\n                 changeAuthorDate <- getChangeAuthorDate\n                 insId <- gets stInsId\n                 modify $ \\s -> s{stInsId = insId + 1}\n                 return $ \\f -> do\n                   x <- f\n                   return [Elem $\n                           mknode \"w:ins\"\n                             ((\"w:id\", tshow insId) : changeAuthorDate) x]\n               else return id\n  delmod <- if \"deletion\" `elem` classes\n               then do\n                 changeAuthorDate <- getChangeAuthorDate\n                 delId <- gets stDelId\n                 modify $ \\s -> s{stDelId = delId + 1}\n                 return $ \\f -> local (\\env->env{envInDel=True}) $ do\n                   x <- f\n                   return [Elem $ mknode \"w:del\"\n                             ((\"w:id\", tshow delId) : changeAuthorDate) x]\n               else return id\n  let langmod = case lookup \"lang\" kvs of\n                  Nothing -> id\n                  Just lang -> local (\\env -> env{envLang = Just lang})\n  contents <- insmod $ delmod $ dirmod $ stylemod $ pmod $\n              langmod $ inlinesToOpenXML opts ils\n  wrapBookmark ident contents\ninlineToOpenXML' opts (Strong lst) =\n  withTextProp (mknode \"w:bCs\" [] ()) $ -- needed for LTR, #6911\n  withTextProp (mknode \"w:b\" [] ()) $\n  inlinesToOpenXML opts lst\ninlineToOpenXML' opts (Emph lst) =\n  withTextProp (mknode \"w:iCs\" [] ()) $  -- needed for LTR, #6911\n  withTextProp (mknode \"w:i\" [] ()) $\n  inlinesToOpenXML opts lst\ninlineToOpenXML' opts (Underline lst) =\n  withTextProp (mknode \"w:u\" [(\"w:val\",\"single\")] ()) $\n    inlinesToOpenXML opts lst\ninlineToOpenXML' opts (Subscript lst) =\n  withTextProp (mknode \"w:vertAlign\" [(\"w:val\",\"subscript\")] ())\n  $ inlinesToOpenXML opts lst\ninlineToOpenXML' opts (Superscript lst) =\n  withTextProp (mknode \"w:vertAlign\" [(\"w:val\",\"superscript\")] ())\n  $ inlinesToOpenXML opts lst\ninlineToOpenXML' opts (SmallCaps lst) =\n  withTextProp (mknode \"w:smallCaps\" [] ())\n  $ inlinesToOpenXML opts lst\ninlineToOpenXML' opts (Strikeout lst) =\n  withTextProp (mknode \"w:strike\" [] ())\n  $ inlinesToOpenXML opts lst\ninlineToOpenXML' _ LineBreak = return [Elem br]\ninlineToOpenXML' _ il@(RawInline f str)\n  | f == Format \"openxml\" = return\n                            [Text (CData CDataRaw str Nothing)]\n  | otherwise             = do\n      report $ InlineNotRendered il\n      return []\ninlineToOpenXML' opts (Quoted quoteType lst) =\n  inlinesToOpenXML opts $ [Str open] ++ lst ++ [Str close]\n    where (open, close) = case quoteType of\n                            SingleQuote -> (\"\\x2018\", \"\\x2019\")\n                            DoubleQuote -> (\"\\x201C\", \"\\x201D\")\ninlineToOpenXML' opts (Math mathType str) = do\n  when (mathType == DisplayMath) setFirstPara\n  res <- (lift . lift) (convertMath writeOMML mathType str)\n  case res of\n       Right r -> return [Elem $ fromXLElement r]\n       Left il -> inlineToOpenXML' opts il\ninlineToOpenXML' opts (Cite _ lst) = inlinesToOpenXML opts lst\ninlineToOpenXML' opts (Code attrs str) = do\n  let alltoktypes = [KeywordTok ..]\n  tokTypesMap <- mapM (\\tt -> (,) tt <$> rStyleM (fromString $ show tt)) alltoktypes\n  let unhighlighted = (map Elem . intercalate [br]) `fmap`\n                       mapM formattedString (T.lines str)\n      formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)\n      toHlTok (toktype,tok) =\n        mknode \"w:r\" []\n          [ mknode \"w:rPr\" [] $\n            maybeToList (lookup toktype tokTypesMap)\n            , mknode \"w:t\" [(\"xml:space\",\"preserve\")] tok ]\n  let highlighted =\n        case highlight (writerSyntaxMap opts) formatOpenXML attrs str of\n            Right h  -> return (map Elem h)\n            Left msg -> do\n              unless (T.null msg) $ report $ CouldNotHighlight msg\n              unhighlighted\n  withTextPropM (rStyleM \"Verbatim Char\")\n    $ case writerHighlightMethod opts of\n        DefaultHighlighting -> highlighted\n        Skylighting _ -> highlighted\n        _ -> unhighlighted\ninlineToOpenXML' opts (Note bs) = do\n  notes <- gets stFootnotes\n  notenum <- getUniqueId\n  footnoteStyle <- rStyleM \"Footnote Reference\"\n  let notemarker = mknode \"w:r\" []\n                   [ mknode \"w:rPr\" [] footnoteStyle\n                   , mknode \"w:footnoteRef\" [] () ]\n  let notemarkerXml = RawInline (Format \"openxml\") $ ppElement notemarker\n  let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : Space : ils) : xs\n      insertNoteRef (Para ils  : xs) = Para  (notemarkerXml : Space : ils) : xs\n      insertNoteRef xs               = Para [notemarkerXml] : xs\n\n  contents <- local (\\env -> env{ envListLevel = -1\n                                , envParaProperties = mempty\n                                , envTextProperties = mempty\n                                , envInNote = True })\n              (withParaPropM (pStyleM \"Footnote Text\") $\n               blocksToOpenXML opts $ insertNoteRef bs)\n  let newnote = mknode \"w:footnote\" [(\"w:id\", notenum)] contents\n  modify $ \\s -> s{ stFootnotes = newnote : notes }\n  return [ Elem $ mknode \"w:r\" []\n           [ mknode \"w:rPr\" [] footnoteStyle\n           , mknode \"w:footnoteReference\" [(\"w:id\", notenum)] () ] ]\n-- internal link:\ninlineToOpenXML' opts (Link _ txt (T.uncons -> Just ('#', xs),_)) = do\n  contents <- withTextPropM (rStyleM \"Hyperlink\") $ inlinesToOpenXML opts txt\n  return\n    [ Elem $ mknode \"w:hyperlink\" [(\"w:anchor\", toBookmarkName xs)] contents ]\n-- external link:\ninlineToOpenXML' opts (Link _ txt (src,_)) = do\n  contents <- withTextPropM (rStyleM \"Hyperlink\") $ inlinesToOpenXML opts txt\n  extlinks <- gets stExternalLinks\n  id' <- case M.lookup src extlinks of\n            Just i   -> return i\n            Nothing  -> do\n              i <- (\"rId\" <>) <$> getUniqueId\n              modify $ \\st -> st{ stExternalLinks =\n                        M.insert src i extlinks }\n              return i\n  return [ Elem $ mknode \"w:hyperlink\" [(\"r:id\",id')] contents ]\ninlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do\n  pageWidth <- asks envPrintWidth\n  imgs <- gets stImages\n  let\n    stImage = M.lookup (T.unpack src) imgs\n    generateImgElt (ident, _fp, mt, img) = do\n      docprid <- getUniqueId\n      nvpicprid <- getUniqueId\n      (blipAttrs, blipContents) <-\n        case T.takeWhile (/=';') <$> mt of\n          Just \"image/svg+xml\" -> do\n            -- get fallback png\n            mediabag <- getMediaBag\n            mbFallback <-\n              case lookupMedia (T.unpack (src <> \".png\")) mediabag of\n                Just item -> do\n                  id' <- T.unpack . (\"rId\" <>) <$> getUniqueId\n                  let fp' = \"media/\" <> id' <> \".png\"\n                  let imgdata = (id',\n                                 fp',\n                                 Just (mediaMimeType item),\n                                 BL.toStrict $ mediaContents item)\n                  modify $ \\st -> st { stImages =\n                            M.insert fp' imgdata $ stImages st }\n                  return $ Just id'\n                Nothing -> return Nothing\n            let extLst = mknode \"a:extLst\" []\n                            [ mknode \"a:ext\"\n                              [(\"uri\",\"{28A0092B-C50C-407E-A947-70E740481C1C}\")]\n                              [ mknode \"a14:useLocalDpi\"\n                                [(\"xmlns:a14\",\"http://schemas.microsoft.com/office/drawing/2010/main\"),\n                                 (\"val\",\"0\")] () ]\n                            , mknode \"a:ext\"\n                              [(\"uri\",\"{96DAC541-7B7A-43D3-8B79-37D633B846F1}\")]\n                              [ mknode \"asvg:svgBlip\"\n                                [(\"xmlns:asvg\", \"http://schemas.microsoft.com/office/drawing/2016/SVG/main\"),\n                                 (\"r:embed\",T.pack ident)] () ]\n                            ]\n            return (maybe [] (\\id'' -> [(\"r:embed\", T.pack id'')]) mbFallback,\n                    [extLst])\n          _ -> return ([(\"r:embed\", T.pack ident)], [])\n      let\n        (xpt,ypt) = desiredSizeInPoints opts attr\n               (either (const def) id (imageSize opts img))\n        -- 12700 emu = 1 pt\n        pageWidthPt = case dimension Width attr of\n                        Just (Percent a) -> pageWidth * floor (a * 127)\n                        _                -> pageWidth * 12700\n        (xemu,yemu) = fitToPage (xpt * 12700, ypt * 12700) pageWidthPt\n        cNvPicPr = mknode \"pic:cNvPicPr\" [] $\n                         mknode \"a:picLocks\" [(\"noChangeArrowheads\",\"1\")\n                                             ,(\"noChangeAspect\",\"1\")] ()\n        nvPicPr  = mknode \"pic:nvPicPr\" []\n                        [ mknode \"pic:cNvPr\"\n                            [(\"descr\",src)\n                            ,(\"id\", nvpicprid)\n                            ,(\"name\",\"Picture\")] ()\n                        , cNvPicPr ]\n        blipFill = mknode \"pic:blipFill\" []\n          [ mknode \"a:blip\" blipAttrs blipContents\n          , mknode \"a:stretch\" [] $\n              mknode \"a:fillRect\" [] ()\n          ]\n        xfrm =    mknode \"a:xfrm\" []\n                        [ mknode \"a:off\" [(\"x\",\"0\"),(\"y\",\"0\")] ()\n                        , mknode \"a:ext\" [(\"cx\",tshow xemu)\n                                         ,(\"cy\",tshow yemu)] () ]\n        prstGeom = mknode \"a:prstGeom\" [(\"prst\",\"rect\")] $\n                         mknode \"a:avLst\" [] ()\n        ln =      mknode \"a:ln\" [(\"w\",\"9525\")]\n                        [ mknode \"a:noFill\" [] ()\n                        , mknode \"a:headEnd\" [] ()\n                        , mknode \"a:tailEnd\" [] () ]\n        spPr =    mknode \"pic:spPr\" [(\"bwMode\",\"auto\")]\n                        [xfrm, prstGeom, mknode \"a:noFill\" [] (), ln]\n        graphic = mknode \"a:graphic\" [] $\n          mknode \"a:graphicData\"\n            [(\"uri\",\"http://schemas.openxmlformats.org/drawingml/2006/picture\")]\n            [ mknode \"pic:pic\" []\n              [ nvPicPr\n              , blipFill\n              , spPr\n              ]\n            ]\n        imgElt = mknode \"w:r\" [] $\n          mknode \"w:drawing\" [] $\n            mknode \"wp:inline\" []\n              [ mknode \"wp:extent\" [(\"cx\",tshow xemu),(\"cy\",tshow yemu)] ()\n              , mknode \"wp:effectExtent\"\n                [(\"b\",\"0\"),(\"l\",\"0\"),(\"r\",\"0\"),(\"t\",\"0\")] ()\n              , mknode \"wp:docPr\"\n                [ (\"descr\", stringify alt)\n                , (\"title\", title)\n                , (\"id\", docprid)\n                , (\"name\",\"Picture\")\n                ] ()\n              , graphic\n              ]\n      return [Elem imgElt]\n\n  wrapBookmark imgident =<< case stImage of\n    Just imgData -> generateImgElt imgData\n    Nothing -> ( do --try\n      (img, mt) <- P.fetchItem src\n      ident <- (\"rId\" <>) <$> getUniqueId\n\n      let\n        imgext = case mt >>= extensionFromMimeType of\n          Just x    -> \".\" <> x\n          Nothing   -> case imageType img of\n            Just Png  -> \".png\"\n            Just Jpeg -> \".jpeg\"\n            Just Gif  -> \".gif\"\n            Just Pdf  -> \".pdf\"\n            Just Eps  -> \".eps\"\n            Just Svg  -> \".svg\"\n            Just Emf  -> \".emf\"\n            Just Tiff -> \".tiff\"\n            Just Webp -> \".webp\"\n            Just Avif -> \".avif\"\n            Nothing   -> \"\"\n        imgpath = \"media/\" <> ident <> imgext\n        mbMimeType = mt <|> getMimeType (T.unpack imgpath)\n\n        imgData = (T.unpack ident, T.unpack imgpath, mbMimeType, img)\n\n      if T.null imgext\n         then -- without an extension there is no rule for content type\n           inlinesToOpenXML opts alt -- return alt to avoid corrupted docx\n         else do\n           -- insert mime type to use in constructing [Content_Types].xml\n           modify $ \\st -> st { stImages = M.insert (T.unpack src) imgData $ stImages st }\n           generateImgElt imgData\n      )\n      `catchError` ( \\e -> do\n        report $ CouldNotFetchResource src $ T.pack (show e)\n        -- emit alt text\n        inlinesToOpenXML opts alt\n      )\n\nbr :: Element\nbr = mknode \"w:r\" [] [mknode \"w:br\" [] ()]\n\n\nwithDirection :: PandocMonad m => WS m a -> WS m a\nwithDirection x = do\n  isRTL <- asks envRTL\n  paraProps <- asks envParaProperties\n  textProps <- asks envTextProperties\n  -- We want to clean all bidirection (bidi) and right-to-left (rtl)\n  -- properties from the props first. This is because we don't want\n  -- them to stack up.\n  let paraProps' = filter (\\e -> (qName . elName) e /= \"bidi\") (otherElements paraProps)\n      textProps' = filter (\\e -> (qName . elName) e /= \"rtl\") (otherElements textProps)\n      paraStyle = styleElement paraProps\n      textStyle = styleElement textProps\n  if isRTL\n    -- if we are going right-to-left, we (re?)add the properties.\n    then flip local x $\n         \\env -> env { envParaProperties = EnvProps paraStyle $ mknode \"w:bidi\" [] () : paraProps'\n                     , envTextProperties = EnvProps textStyle $ mknode \"w:rtl\" [] () : textProps'\n                     }\n    else flip local x $ \\env -> env { envParaProperties = EnvProps paraStyle paraProps'\n                                    , envTextProperties = EnvProps textStyle textProps'\n                                    }\n\nwrapBookmark :: (PandocMonad m) => Text -> [Content] -> WS m [Content]\nwrapBookmark \"\" contents = return contents\nwrapBookmark ident contents = do\n  id' <- getUniqueId\n  let bookmarkStart = mknode \"w:bookmarkStart\"\n                       [(\"w:id\", id')\n                       ,(\"w:name\", toBookmarkName ident)] ()\n      bookmarkEnd = mknode \"w:bookmarkEnd\" [(\"w:id\", id')] ()\n  return $ Elem bookmarkStart : contents ++ [Elem bookmarkEnd]\n\n-- Word imposes a 40 character limit on bookmark names and requires\n-- that they begin with a letter.  So we just use a hash of the\n-- identifier when otherwise we'd have an illegal bookmark name.\ntoBookmarkName :: Text -> Text\ntoBookmarkName s\n  | Just (c, _) <- T.uncons s\n  , isLetter c\n  , T.length s <= 40 = s\n  | otherwise = T.pack $ 'X' : drop 1 (show (hashWith SHA1 (fromText s)))\n\nmaxListLevel :: Int\nmaxListLevel = 8\n\nconvertSpace :: [Inline] -> [Inline]\nconvertSpace (Str x : Space : Str y : xs) = convertSpace (Str (x <> \" \" <> y) : xs)\nconvertSpace (Str x : Str y : xs)         = convertSpace (Str (x <> y) : xs)\nconvertSpace (x:xs)                       = x : convertSpace xs\nconvertSpace []                           = []\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Docx/StyleMap.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{- |\n   Module : Text.Pandoc.Writers.Docx.StyleMap\n   Copyright   : © 2014-2020 Jesse Rosenthal <jrosenthal@jhu.edu>,\n                   2014-2024 John MacFarlane <jgm@berkeley.edu>,\n                   2015-2019 Nikolay Yakimov <root@livid.pp.ru>\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nMappings of element styles (word to pandoc-internal).\n-}\n\nmodule Text.Pandoc.Writers.Docx.StyleMap ( StyleMaps(..)\n                                         , ParaStyleName\n                                         , CharStyleName\n                                         , getStyleMaps\n                                         , getStyleIdFromName\n                                         , hasStyleName\n                                         , fromStyleId\n                                         , fromStyleName\n                                         ) where\n\nimport Text.Pandoc.Readers.Docx.Parse.Styles\nimport Codec.Archive.Zip\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.String\nimport Data.Char (isSpace)\n\ndata StyleMaps = StyleMaps { smCharStyle :: CharStyleNameMap, smParaStyle :: ParaStyleNameMap }\ntype ParaStyleNameMap = M.Map ParaStyleName ParStyle\ntype CharStyleNameMap = M.Map CharStyleName CharStyle\n\ngetStyleIdFromName :: (Ord sn, FromStyleName sn, IsString (StyleId sty), HasStyleId sty)\n                   => sn -> M.Map sn sty -> StyleId sty\ngetStyleIdFromName s = maybe (fallback s) getStyleId . M.lookup s\n  where fallback = fromString . T.unpack . T.filter (not . isSpace) . fromStyleName\n\nhasStyleName :: (Ord sn, HasStyleId sty)\n             => sn -> M.Map sn sty -> Bool\nhasStyleName styleName = M.member styleName\n\ngetStyleMaps :: Archive -> StyleMaps\ngetStyleMaps = uncurry StyleMaps . archiveToStyles' getStyleName getStyleName\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Docx/Table.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\nModule      : Text.Pandoc.Writers.Docx.Table\nCopyright   : Copyright (C) 2012-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nConversion of table blocks to docx.\n-}\nmodule Text.Pandoc.Writers.Docx.Table\n  ( tableToOpenXML\n  , rowToOpenXML\n  , OOXMLRow (..)\n  , OOXMLCell (..)\n  , RowType (..)\n  ) where\n\nimport Control.Monad.State.Strict ( modify, gets )\nimport Control.Monad ( unless , zipWithM )\nimport Control.Monad.Except ( throwError )\nimport Data.Array ( elems, (!), assocs, indices )\nimport Data.Text (Text)\nimport Data.Maybe (catMaybes, fromMaybe)\nimport Text.Pandoc.Definition\n    ( ColSpec,\n      Caption(Caption),\n      Format(Format),\n      Attr,\n      Block(Para, Plain),\n      Inline(Str, Span, RawInline),\n      Alignment(..),\n      RowSpan(..),\n      ColSpan(..),\n      ColWidth(..) )\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Translations (translateTerm)\nimport Text.Pandoc.Writers.Docx.Types\n    ( WS,\n      WriterState(stNextTableNum, stInTable),\n      WriterEnv(..),\n      setFirstPara,\n      pStyleM,\n      withParaProp,\n      withParaPropM )\nimport Control.Monad.Reader (asks)\nimport Text.Pandoc.Shared ( tshow, stringify )\nimport Text.Pandoc.Options (WriterOptions(..), isEnabled, CaptionPosition(..))\nimport Text.Pandoc.Extensions (Extension(Ext_native_numbering))\nimport Text.Pandoc.Error (PandocError(PandocSomeError))\nimport Text.Printf (printf)\nimport Text.Pandoc.Writers.GridTable\n    ( rowArray,\n      ColIndex,\n      GridCell(..),\n      Part(Part, partCellArray, partRowAttrs),\n      RowIndex )\nimport Text.Pandoc.Writers.OOXML ( mknode )\nimport Text.Pandoc.XML.Light.Proc ( onlyElems )\nimport Text.Pandoc.XML.Light.Types\n    ( Content(Elem), Element(elName), QName(qName) )\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Translations as Term\nimport qualified Text.Pandoc.Writers.GridTable as Grid\n\ntableToOpenXML :: PandocMonad m\n               => WriterOptions\n               -> ([Block] -> WS m [Content])\n               -> Grid.Table\n               -> WS m [Content]\ntableToOpenXML opts blocksToOpenXML gridTable = do\n  setFirstPara\n  let (Grid.Table (ident,_,tableAttr) caption colspecs _rowheads thead tbodies tfoot) =\n        gridTable\n  let (Caption _maybeShortCaption captionBlocks) = caption\n  tablenum <- gets stNextTableNum\n  unless (null captionBlocks) $\n    modify $ \\st -> st{ stNextTableNum = tablenum + 1 }\n  let tableid = if T.null ident\n                   then \"table\" <> tshow tablenum\n                   else ident\n  tablename <- translateTerm Term.Table\n  let captionStr = stringify captionBlocks\n  let aligns = map fst $ elems colspecs\n  captionXml <- if null captionBlocks\n                then return []\n                else withParaPropM (pStyleM \"Table Caption\")\n                     $ blocksToOpenXML\n                     $ if isEnabled Ext_native_numbering opts\n                          then addLabel tableid tablename tablenum captionBlocks\n                          else captionBlocks\n  -- We set \"in table\" after processing the caption, because we don't\n  -- want the \"Table Caption\" style to be overwritten with \"Compact\".\n  modify $ \\s -> s { stInTable = True }\n  head' <- cellGridToOpenXML blocksToOpenXML HeadRow aligns thead\n  bodies <- mapM (cellGridToOpenXML blocksToOpenXML BodyRow aligns) tbodies\n  foot' <- cellGridToOpenXML blocksToOpenXML FootRow aligns tfoot\n\n  let hasHeader = not . null . indices . partRowAttrs $ thead\n  let hasFooter = not . null . indices . partRowAttrs $ tfoot\n  -- for compatibility with Word <= 2007, we include a val with a bitmask\n  -- 0×0020  Apply first row conditional formatting\n  -- 0×0040  Apply last row conditional formatting\n  -- 0×0080  Apply first column conditional formatting\n  -- 0×0100  Apply last column conditional formatting\n  -- 0×0200  Do not apply row banding conditional formatting\n  -- 0×0400  Do not apply column banding conditional formattin\n  let tblLookVal = if hasHeader then (0x20 :: Int) else 0\n  let (gridCols, tblWattr) = tableLayout (elems colspecs)\n  listLevel <- asks envListLevel\n  let tblStyle =  fromMaybe \"Table\" (lookup \"custom-style\" tableAttr)\n  let indent = (listLevel + 1) * 720\n  let hasWidths = not $ all ((== ColWidthDefault) . snd) colspecs\n  let tbl = mknode \"w:tbl\" []\n        ( mknode \"w:tblPr\" []\n          ( [ mknode \"w:tblStyle\" [(\"w:val\",tblStyle)] (),\n              mknode \"w:tblW\" tblWattr () ] ++\n            [ mknode \"w:jc\" [(\"w:val\",\"left\")] () | indent > 0 ] ++\n            [ mknode \"w:tblInd\" [(\"w:w\", tshow indent),(\"w:type\",\"dxa\")] ()\n                | indent > 0 ] ++\n            [ mknode \"w:tblLayout\" [(\"w:type\", \"fixed\")] () | hasWidths ] ++\n            [ mknode \"w:tblLook\" [(\"w:firstRow\",if hasHeader then \"1\" else \"0\")\n                                 ,(\"w:lastRow\",if hasFooter then \"1\" else \"0\")\n                                 ,(\"w:firstColumn\",\"0\")\n                                 ,(\"w:lastColumn\",\"0\")\n                                 ,(\"w:noHBand\",\"0\")\n                                 ,(\"w:noVBand\",\"0\")\n                                 ,(\"w:val\", T.pack $ printf \"%04x\" tblLookVal)\n                                 ] () ] ++\n            [ mknode \"w:tblCaption\" [(\"w:val\", captionStr)] ()\n            | not (T.null captionStr) ]\n          )\n          : mknode \"w:tblGrid\" [] gridCols\n          : head' ++ mconcat bodies ++ foot'\n        )\n  modify $ \\s -> s { stInTable = False }\n  return $\n    case writerTableCaptionPosition opts of\n      CaptionAbove -> captionXml ++ [Elem tbl]\n      CaptionBelow -> Elem tbl : captionXml\n\naddLabel :: Text -> Text -> Int -> [Block] -> [Block]\naddLabel tableid tablename tablenum bs =\n  case bs of\n    (Para ils : rest)  -> Para (label : Str \": \" : ils) : rest\n    (Plain ils : rest) -> Plain (label : Str \": \" : ils) : rest\n    _ -> Para [label] : bs\n where\n  label = Span (tableid,[],[])\n            [Str (tablename <> \"\\160\"),\n             RawInline (Format \"openxml\")\n               (\"<w:fldSimple w:instr=\\\"SEQ Table\"\n               <> \" \\\\* ARABIC \\\"><w:r><w:t>\"\n               <> tshow tablenum\n               <> \"</w:t></w:r></w:fldSimple>\")]\n\n-- | Parts of a table\ndata RowType = HeadRow | BodyRow | FootRow\n\nalignmentToString :: Alignment -> Text\nalignmentToString = \\case\n  AlignLeft    -> \"left\"\n  AlignRight   -> \"right\"\n  AlignCenter  -> \"center\"\n  AlignDefault -> \"\"\n\ntableLayout :: [ColSpec] -> ([Element], [(Text, Text)])\ntableLayout specs =\n  let\n    textwidth = 7920  -- 5.5 in in twips       (1 twip == 1/20 pt)\n    fullrow   = 5000  -- 100% specified in pct (1 pct  == 1/50th of a percent)\n    ncols = length specs\n    getWidth = \\case\n      ColWidth n -> n\n      _          -> 0\n    widths = map (getWidth . snd) specs\n    rowwidth  = round (fullrow * sum widths) :: Int\n    widthToTwips w = floor (textwidth * w)   :: Int\n    mkGridCol w = mknode \"w:gridCol\" [(\"w:w\", tshow (widthToTwips w))] ()\n  in if all (== 0) widths\n     then ( replicate ncols $ mkGridCol (1.0 / fromIntegral ncols)\n          , [ (\"w:type\", \"auto\"), (\"w:w\", \"0\")])\n     else ( map mkGridCol widths\n          , [ (\"w:type\", \"pct\"), (\"w:w\", tshow rowwidth) ])\n\ncellGridToOpenXML :: PandocMonad m\n                  => ([Block] -> WS m [Content])\n                  -> RowType\n                  -> [Alignment]\n                  -> Part\n                  -> WS m [Element]\ncellGridToOpenXML blocksToOpenXML rowType aligns part@(Part _ cellArray _) =\n  if null (elems cellArray)\n  then return mempty\n  else partToRows rowType aligns part >>=\n       fmap catMaybes . mapM (rowToOpenXML blocksToOpenXML)\n\ndata OOXMLCell\n  = OOXMLCell Attr Alignment RowSpan ColSpan [Block]\n  | OOXMLCellMerge ColSpan\n\ndata OOXMLRow = OOXMLRow RowType Attr [OOXMLCell]\n\npartToRows :: PandocMonad m\n           => RowType -> [Alignment] -> Part -> WS m [OOXMLRow]\npartToRows rowType aligns part = do\n  let toOOXMLCell :: PandocMonad m =>\n        Alignment -> RowIndex -> ColIndex -> GridCell -> WS m [OOXMLCell]\n      toOOXMLCell columnAlign ridx cidx = \\case\n        UnassignedCell ->\n          throwError $ PandocSomeError \"Encountered unassigned table cell\"\n        ContentCell attr align rowspan colspan blocks -> do\n          -- Respect non-default, cell specific alignment.\n          let align' = case align of\n                AlignDefault -> columnAlign\n                _            -> align\n          return [OOXMLCell attr align' rowspan colspan blocks]\n        ContinuationCell idx'@(ridx',cidx') | ridx /= ridx', cidx == cidx' -> do\n          case (partCellArray part)!idx' of\n            (ContentCell _ _ _ colspan _) -> return [OOXMLCellMerge colspan]\n            x -> error $ \"Content cell expected, got, \" ++ show x ++\n                         \" at index \" ++ show idx'\n        _ -> return mempty\n  let mkRow :: PandocMonad m => (RowIndex, Attr) -> WS m OOXMLRow\n      mkRow (ridx, attr) = do\n        cs <- zipWithM (\\align -> uncurry $ toOOXMLCell align ridx)\n                        aligns\n                        (assocs . rowArray ridx $ partCellArray part)\n        return $ OOXMLRow rowType attr . mconcat $ cs\n  mapM mkRow $ assocs (partRowAttrs part)\n\nrowToOpenXML :: PandocMonad m\n             => ([Block] -> WS m [Content])\n             -> OOXMLRow\n             -> WS m (Maybe Element)\nrowToOpenXML blocksToOpenXML (OOXMLRow rowType _attr cells)\n  | null cells = return Nothing\n  | otherwise = do\n    xmlcells <- mapM (ooxmlCellToOpenXML blocksToOpenXML) cells\n    let addTrPr = case rowType of\n          HeadRow -> (mknode \"w:trPr\" []\n                      [mknode \"w:tblHeader\" [(\"w:val\", \"on\")] ()] :)\n          BodyRow -> id\n          FootRow -> id\n    return $ Just $ mknode \"w:tr\" [] (addTrPr xmlcells)\n\nooxmlCellToOpenXML :: PandocMonad m\n                   => ([Block] -> WS m [Content])\n                   -> OOXMLCell\n                   -> WS m Element\nooxmlCellToOpenXML blocksToOpenXML = \\case\n  OOXMLCellMerge (ColSpan colspan) -> do\n    return $ mknode \"w:tc\" []\n      [ mknode \"w:tcPr\" [] [ mknode \"w:gridSpan\" [(\"w:val\", tshow colspan)] ()\n                           , mknode \"w:vMerge\"   [(\"w:val\", \"continue\")] () ]\n      , mknode \"w:p\" [] [mknode \"w:pPr\" [] ()]]\n  OOXMLCell _attr align rowspan (ColSpan colspan) contents -> do\n    compactStyle <- pStyleM \"Compact\"\n    es <- maybe id withParaProp (alignmentFor align) $ blocksToOpenXML contents\n    -- Table cells require a <w:p> element, even an empty one!\n    -- Not in the spec but in Word 2007, 2010. See #4953. And\n    -- apparently the last element must be a <w:p>, see #6983.\n    return . mknode \"w:tc\" [] $\n      Elem\n       (mknode \"w:tcPr\" [] ([ mknode \"w:gridSpan\" [(\"w:val\", tshow colspan)] ()\n                            | colspan > 1] ++\n                            [ mknode \"w:vMerge\" [(\"w:val\", \"restart\")] ()\n                            | rowspan > RowSpan 1 ])) :\n      if null contents\n      then [Elem $ mknode \"w:p\" [] [mknode \"w:pPr\" [] [compactStyle]]]\n      else case reverse (onlyElems es) of\n             b:e:_ | qName (elName b) == \"bookmarkEnd\"  -- y tho?\n                   , qName (elName e) == \"p\" -> es\n             e:_   | qName (elName e) == \"p\" -> es\n             _ -> es ++ [Elem $ mknode \"w:p\" [] ()]\n\nalignmentFor :: Alignment -> Maybe Element\nalignmentFor AlignDefault = Nothing\nalignmentFor al = Just $ mknode \"w:jc\" [(\"w:val\",alignmentToString al)] ()\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Docx/Types.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{- |\nModule      : Text.Pandoc.Writers.Docx\nCopyright   : Copyright (C) 2012-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\nMaintainer  : John MacFarlane <jgm@berkeley.edu>\n\nConversion of table blocks to docx.\n-}\nmodule Text.Pandoc.Writers.Docx.Types\n  ( EnvProps (..)\n  , WriterEnv (..)\n  , defaultWriterEnv\n  , WriterState (..)\n  , defaultWriterState\n  , WS\n  , ListMarker (..)\n  , listMarkerToId\n  , pStyleM\n  , isStyle\n  , setFirstPara\n  , withParaProp\n  , withParaPropM\n  ) where\n\nimport Control.Applicative ((<|>))\nimport Control.Monad.Reader\nimport Control.Monad.State.Strict\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.MIME (MimeType)\nimport Text.Pandoc.Writers.Docx.StyleMap\nimport Text.Pandoc.Writers.OOXML\nimport Text.Pandoc.XML.Light as XML\nimport qualified Data.ByteString as B\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\n\ndata ListMarker = NoMarker\n                | BulletMarker\n                | CheckboxMarker Bool\n                | NumberMarker ListNumberStyle ListNumberDelim Int\n                deriving (Show, Read, Eq, Ord)\n\nlistMarkerToId :: ListMarker -> Text\nlistMarkerToId NoMarker = \"990\"\nlistMarkerToId BulletMarker = \"991\"\nlistMarkerToId (CheckboxMarker False) = \"992\"\nlistMarkerToId (CheckboxMarker True) = \"993\"\nlistMarkerToId (NumberMarker sty delim n) = T.pack $\n  '9' : '9' : styNum : delimNum : show n\n  where styNum = case sty of\n                      DefaultStyle -> '2'\n                      Example      -> '3'\n                      Decimal      -> '4'\n                      LowerRoman   -> '5'\n                      UpperRoman   -> '6'\n                      LowerAlpha   -> '7'\n                      UpperAlpha   -> '8'\n        delimNum = case delim of\n                      DefaultDelim -> '0'\n                      Period       -> '1'\n                      OneParen     -> '2'\n                      TwoParens    -> '3'\n\n\ndata EnvProps = EnvProps{ styleElement  :: Maybe Element\n                        , otherElements :: [Element]\n                        }\n\ninstance Semigroup EnvProps where\n  EnvProps s es <> EnvProps s' es' = EnvProps (s <|> s') (es ++ es')\n\ninstance Monoid EnvProps where\n  mempty = EnvProps Nothing []\n  mappend = (<>)\n\ndata WriterEnv = WriterEnv\n  { envTextProperties :: EnvProps\n  , envParaProperties :: EnvProps\n  , envRTL            :: Bool\n  , envListLevel      :: Int\n  , envListNumId      :: Int\n  , envInDel          :: Bool\n  , envInNote         :: Bool\n  , envChangesAuthor  :: Text\n  , envChangesDate    :: Text\n  , envPrintWidth     :: Integer\n  , envLang           :: Maybe Text\n  , envSectPr         :: Maybe Element\n  }\n\ndefaultWriterEnv :: WriterEnv\ndefaultWriterEnv = WriterEnv\n  { envTextProperties = mempty\n  , envParaProperties = mempty\n  , envRTL = False\n  , envListLevel = -1\n  , envListNumId = 1\n  , envInDel = False\n  , envInNote = False\n  , envChangesAuthor  = \"unknown\"\n  , envChangesDate    = \"1969-12-31T19:00:00Z\"\n  , envPrintWidth     = 1\n  , envLang           = Nothing\n  , envSectPr         = Nothing\n  }\n\n\ndata WriterState = WriterState{\n         stFootnotes      :: [Element]\n       , stComments       :: [([(Text, Text)], [Inline])]\n       , stSectionIds     :: Set.Set Text\n       , stExternalLinks  :: M.Map Text Text\n       , stImages         :: M.Map FilePath (String, String, Maybe MimeType, B.ByteString)\n       , stLists          :: [ListMarker]\n       , stExampleId      :: Maybe Int\n       , stInsId          :: Int\n       , stDelId          :: Int\n       , stStyleMaps      :: StyleMaps\n       , stFirstPara      :: Bool\n       , stFirstSectionHeader :: Bool  -- ^ True until first section header is processed\n       , stNumIdUsed      :: Bool  -- ^ True if the current numId (envListNumId) has been used.\n                                   --   Should only be used once, for the first paragraph.\n       , stInTable        :: Bool\n       , stInList         :: Bool\n       , stTocTitle       :: [Inline]\n       , stDynamicParaProps :: Set.Set ParaStyleName\n       , stDynamicTextProps :: Set.Set CharStyleName\n       , stCurId          :: Int\n       , stNextFigureNum  :: Int\n       , stNextTableNum   :: Int\n       }\n\ndefaultWriterState :: WriterState\ndefaultWriterState = WriterState{\n        stFootnotes      = defaultFootnotes\n      , stComments       = []\n      , stSectionIds     = Set.empty\n      , stExternalLinks  = M.empty\n      , stImages         = M.empty\n      , stLists          = [NoMarker]\n      , stExampleId      = Nothing\n      , stInsId          = 1\n      , stDelId          = 1\n      , stStyleMaps      = StyleMaps M.empty M.empty\n      , stFirstPara      = False\n      , stFirstSectionHeader = True\n      , stNumIdUsed      = False\n      , stInTable        = False\n      , stInList         = False\n      , stTocTitle       = [Str \"Table of Contents\"]\n      , stDynamicParaProps = Set.empty\n      , stDynamicTextProps = Set.empty\n      , stCurId          = 20\n      , stNextFigureNum  = 1\n      , stNextTableNum   = 1\n      }\n\nsetFirstPara :: PandocMonad m => WS m ()\nsetFirstPara =  modify $ \\s -> s { stFirstPara = True }\n\ntype WS m = ReaderT WriterEnv (StateT WriterState m)\n\n-- Word will insert these footnotes into the settings.xml file\n-- (whether or not they're visible in the document). If they're in the\n-- file, but not in the footnotes.xml file, it will produce\n-- problems. So we want to make sure we insert them into our document.\ndefaultFootnotes :: [Element]\ndefaultFootnotes = [ mknode \"w:footnote\"\n                     [(\"w:type\", \"separator\"), (\"w:id\", \"-1\")]\n                     [ mknode \"w:p\" []\n                       [mknode \"w:r\" []\n                        [ mknode \"w:separator\" [] ()]]]\n                   , mknode \"w:footnote\"\n                     [(\"w:type\", \"continuationSeparator\"), (\"w:id\", \"0\")]\n                     [ mknode \"w:p\" []\n                       [ mknode \"w:r\" []\n                         [ mknode \"w:continuationSeparator\" [] ()]]]]\n\npStyleM :: (PandocMonad m) => ParaStyleName -> WS m XML.Element\npStyleM styleName = do\n  pStyleMap <- gets (smParaStyle . stStyleMaps)\n  let sty' = getStyleIdFromName styleName pStyleMap\n  return $ mknode \"w:pStyle\" [(\"w:val\", fromStyleId sty')] ()\n\nwithParaProp :: PandocMonad m => Element -> WS m a -> WS m a\nwithParaProp d p =\n  local (\\env -> env {envParaProperties = ep <> envParaProperties env}) p\n  where ep = if isStyle d then EnvProps (Just d) [] else EnvProps Nothing [d]\n\nwithParaPropM :: PandocMonad m => WS m Element -> WS m a -> WS m a\nwithParaPropM md p = do\n  d <- md\n  withParaProp d p\n\nisStyle :: Element -> Bool\nisStyle e = isElem [] \"w\" \"rStyle\" e ||\n            isElem [] \"w\" \"pStyle\" e\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Docx.hs",
    "content": "{-# LANGUAGE PatternGuards       #-}\n{-# LANGUAGE RankNTypes          #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE ViewPatterns        #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Writers.Docx\n   Copyright   : Copyright (C) 2012-2025 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to docx.\n-}\nmodule Text.Pandoc.Writers.Docx ( writeDocx ) where\nimport Codec.Archive.Zip\n    ( Archive(zEntries),\n      addEntryToArchive,\n      emptyArchive,\n      findEntryByPath,\n      fromArchive,\n      toArchive,\n      toEntry,\n      Entry(eRelativePath) )\nimport Control.Monad (MonadPlus(mplus), foldM)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.Reader ( ReaderT(runReaderT) )\nimport Control.Monad.State.Strict ( StateT(runStateT) )\nimport qualified Data.ByteString as B\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Char (isSpace)\nimport Data.List (isPrefixOf, isSuffixOf)\nimport Data.String (fromString)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, mapMaybe, maybeToList)\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Data.Time.Clock.POSIX\nimport Skylighting\nimport Text.Pandoc.Class (PandocMonad, toLang)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Data (readDataFile, readDefaultDataFile)\nimport Data.Time\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.Highlighting (defaultStyle)\nimport Text.Pandoc.MIME (MimeType, getMimeTypeDef)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Writers.Docx.StyleMap\nimport Text.Pandoc.Writers.Docx.Types\nimport Text.Pandoc.Writers.Docx.OpenXML (writeOpenXML, maxListLevel)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Writers.OOXML\nimport Text.Pandoc.XML.Light as XML\nimport Text.Collate.Lang (renderLang, Lang(..))\n\nwriteDocx :: (PandocMonad m)\n          => WriterOptions  -- ^ Writer options\n          -> Pandoc         -- ^ Document to convert\n          -> m BL.ByteString\nwriteDocx opts doc = do\n  -- Phase 1: Document preprocessing\n  let Pandoc meta blocks = walk fixDisplayMath doc\n  setupTranslations meta\n  let blocks' = makeSectionsWithOffsets (writerNumberOffset opts)\n                   True Nothing blocks\n  let doc' = Pandoc meta blocks'\n\n  -- Phase 2: Archive loading\n  (refArchive, distArchive, username, utctime) <- loadArchives opts\n  let epochtime = floor $ utcTimeToPOSIXSeconds utctime\n\n  -- Phase 3: Page layout extraction\n  (mbsectpr, pgContentWidth) <- extractPageLayout refArchive distArchive\n\n  -- Phase 4: Language & style setup\n  mblang <- toLang $ getLang opts meta\n  let addLang = mkLangTransformer mblang\n  styledoc <- addLang <$> parseXml refArchive distArchive \"word/styles.xml\"\n  let styleMaps = getStyleMaps refArchive\n\n  let tocTitle = case lookupMetaInlines \"toc-title\" meta of\n                   [] -> stTocTitle defaultWriterState\n                   ls -> ls\n\n  let isRTLmeta = case lookupMeta \"dir\" meta of\n        Just (MetaString \"rtl\")        -> True\n        Just (MetaInlines [Str \"rtl\"]) -> True\n        _                              -> False\n\n  let env = defaultWriterEnv {\n          envRTL = isRTLmeta\n        , envChangesAuthor = fromMaybe \"unknown\" username\n        , envChangesDate   = T.pack $ formatTime defaultTimeLocale \"%FT%XZ\" utctime\n        , envPrintWidth = maybe 420 (`quot` 20) pgContentWidth\n        }\n\n  -- Phase 5: Relationship extraction\n  (baserels, headers, footers, newMaxRelId) <- extractRelationships refArchive distArchive\n\n  let initialSt = defaultWriterState {\n          stStyleMaps  = styleMaps\n        , stTocTitle   = tocTitle\n        , stCurId      = newMaxRelId + 1\n        }\n\n  -- Phase 6: Core content generation\n  -- adjust contents to add sectPr from reference.docx\n  let sectpr = case mbsectpr of\n        Just sectpr' -> add_attrs (elAttribs sectpr') $ mknode \"w:sectPr\" []\n                             (elChildren sectpr')\n        Nothing      -> mknode \"w:sectPr\" []\n                          [ mknode \"w:footnotePr\" []\n                            [ mknode \"w:numRestart\" [(\"w:val\",\"eachSect\")] () ]\n                          ]\n\n  ((contents, footnotes, comments), st) <- runStateT\n                         (runReaderT\n                          (writeOpenXML opts{ writerWrapText = WrapNone }\n                                        doc')\n                          env{ envSectPr = Just sectpr })\n                         initialSt\n  let imgs = M.elems $ stImages st\n\n  -- Phase 7: XML document construction\n  -- We create [Content_Types].xml and word/_rels/document.xml.rels\n  -- from scratch rather than reading from reference.docx,\n  -- because Word sometimes changes these files when a reference.docx is modified,\n  -- e.g. deleting the reference to footnotes.xml or removing default entries\n  -- for image content types.\n  let contentTypesEntry = mkContentTypesEntry epochtime imgs headers footers refArchive\n  let relEntry = mkDocumentRelsEntry epochtime baserels imgs (stExternalLinks st)\n  let contentEntry = toEntry \"word/document.xml\" epochtime\n                       (BL.fromStrict $ UTF8.fromText contents)\n  let footnotesEntry = mkFootnotesEntry epochtime footnotes\n  let footnoteRelEntry = mkFootnoteRelsEntry epochtime (stExternalLinks st)\n  let commentsEntry = mkCommentsEntry epochtime comments\n  let styleEntry = mkStylesEntry epochtime styledoc styleMaps st opts\n  numEntry <- mkNumberingEntry refArchive distArchive epochtime (stLists st)\n  let docPropsEntry = mkCorePropsEntry epochtime utctime meta\n  let customPropsEntry = mkCustomPropsEntry epochtime meta\n  let relsEntry = mkPackageRelsEntry epochtime\n\n  -- we use dist archive for settings.xml, because Word sometimes\n  -- adds references to footnotes or endnotes we don't have...\n  -- we do, however, copy some settings over from reference\n  settingsEntry <- copyChildren refArchive distArchive \"word/settings.xml\"\n                     epochtime settingsElementNames\n\n  -- Phase 8: Archive assembly\n  let toImageEntry (_, path, _, img) = toEntry (\"word/\" ++ path) epochtime $ toLazy img\n  let imageEntries = map toImageEntry imgs\n\n  refEntries <- collectReferenceEntries refArchive distArchive headers footers\n\n  let archive = foldr addEntryToArchive emptyArchive $\n                  contentTypesEntry : relsEntry : contentEntry : relEntry :\n                  footnoteRelEntry : numEntry : styleEntry : footnotesEntry :\n                  commentsEntry :\n                  docPropsEntry : customPropsEntry :\n                  settingsEntry :\n                  imageEntries ++ refEntries\n  return $ fromArchive archive\n\nnewParaPropToOpenXml :: ParaStyleName -> Element\nnewParaPropToOpenXml (fromStyleName -> s) =\n  let styleId = T.filter (not . isSpace) s\n  in mknode \"w:style\" [ (\"w:type\", \"paragraph\")\n                      , (\"w:customStyle\", \"1\")\n                      , (\"w:styleId\", styleId)]\n     [ mknode \"w:name\" [(\"w:val\", s)] ()\n     , mknode \"w:basedOn\" [(\"w:val\",\"BodyText\")] ()\n     , mknode \"w:qFormat\" [] ()\n     ]\n\nnewTextPropToOpenXml :: CharStyleName -> Element\nnewTextPropToOpenXml (fromStyleName -> s) =\n  let styleId = T.filter (not . isSpace) s\n  in mknode \"w:style\" [ (\"w:type\", \"character\")\n                      , (\"w:customStyle\", \"1\")\n                      , (\"w:styleId\", styleId)]\n     [ mknode \"w:name\" [(\"w:val\", s)] ()\n     , mknode \"w:basedOn\" [(\"w:val\",\"BodyTextChar\")] ()\n     ]\n\nstyleToOpenXml :: StyleMaps -> Style -> [Element]\nstyleToOpenXml sm style =\n  maybeToList parStyle ++ mapMaybe toStyle alltoktypes\n  where alltoktypes = enumFromTo KeywordTok NormalTok\n        toStyle toktype | hasStyleName (fromString $ show toktype) (smCharStyle sm) = Nothing\n                        | otherwise = Just $\n                          mknode \"w:style\" [(\"w:type\",\"character\"),\n                           (\"w:customStyle\",\"1\"),(\"w:styleId\", tshow toktype)]\n                             [ mknode \"w:name\" [(\"w:val\", tshow toktype)] ()\n                             , mknode \"w:basedOn\" [(\"w:val\",\"VerbatimChar\")] ()\n                             , mknode \"w:rPr\" [] $\n                               [ mknode \"w:b\" [] () | tokFeature tokenBold toktype ] ++\n                               [ mknode \"w:i\" [] () | tokFeature tokenItalic toktype ] ++\n                               [ mknode \"w:color\" [(\"w:val\", tokCol toktype)] ()\n                                 | tokCol toktype /= \"auto\" ] ++\n                               [ mknode \"w:u\" [] () | tokFeature tokenUnderline toktype ] ++\n                               [ mknode \"w:shd\" [(\"w:val\",\"clear\")\n                                                ,(\"w:fill\",tokBg toktype)] ()\n                                 | tokBg toktype /= \"auto\" ]\n                             ]\n        tokStyles = tokenStyles style\n        tokFeature f toktype = maybe False f $ M.lookup toktype tokStyles\n        tokCol toktype = maybe \"auto\" (T.pack . drop 1 . fromColor)\n                         $ (tokenColor =<< M.lookup toktype tokStyles)\n                           `mplus` defaultColor style\n        tokBg toktype = maybe \"auto\" (T.pack . drop 1 . fromColor)\n                         $ (tokenBackground =<< M.lookup toktype tokStyles)\n                           `mplus` backgroundColor style\n        parStyle | hasStyleName \"Source Code\" (smParaStyle sm) = Nothing\n                 | otherwise = Just $\n                   mknode \"w:style\" [(\"w:type\",\"paragraph\"),\n                           (\"w:customStyle\",\"1\"),(\"w:styleId\",\"SourceCode\")]\n                             [ mknode \"w:name\" [(\"w:val\",\"Source Code\")] ()\n                             , mknode \"w:basedOn\" [(\"w:val\",\"Normal\")] ()\n                             , mknode \"w:link\" [(\"w:val\",\"VerbatimChar\")] ()\n                             , mknode \"w:pPr\" []\n                               $ mknode \"w:wordWrap\" [(\"w:val\",\"off\")] ()\n                               :\n                         maybe [] (\\col -> [mknode \"w:shd\" [(\"w:val\",\"clear\"),(\"w:fill\", T.pack $ drop 1 $ fromColor col)] ()]) (backgroundColor style)\n                             ]\n\ncopyChildren :: (PandocMonad m)\n             => Archive -> Archive -> String -> Integer -> [Text] -> m Entry\ncopyChildren refArchive distArchive path timestamp elNames = do\n  ref  <- parseXml refArchive distArchive path\n  dist <- parseXml distArchive distArchive path\n  els <- foldM (addEl ref dist) [] (reverse elNames)\n  return $ toEntry path timestamp\n         $ renderXml dist{ elContent = map cleanElem els }\n  where\n    addEl ref dist els name =\n      case filterChildName (hasName name) ref `mplus`\n             filterChildName (hasName name) dist of\n        Just el -> pure (el : els)\n        Nothing -> pure els\n    hasName name = (== name) . qName\n    cleanElem el@Element{elName=name} = Elem el{elName=name{qURI=Nothing}}\n\n-- this is the lowest number used for a list numId\nbaseListId :: Int\nbaseListId = 1000\n\n-- | Standard XML namespace attributes for docx elements\nstdAttributes :: [(Text, Text)]\nstdAttributes =\n  [(\"xmlns:w\",\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\")\n  ,(\"xmlns:m\",\"http://schemas.openxmlformats.org/officeDocument/2006/math\")\n  ,(\"xmlns:r\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\")\n  ,(\"xmlns:o\",\"urn:schemas-microsoft-com:office:office\")\n  ,(\"xmlns:v\",\"urn:schemas-microsoft-com:vml\")\n  ,(\"xmlns:w10\",\"urn:schemas-microsoft-com:office:word\")\n  ,(\"xmlns:a\",\"http://schemas.openxmlformats.org/drawingml/2006/main\")\n  ,(\"xmlns:pic\",\"http://schemas.openxmlformats.org/drawingml/2006/picture\")\n  ,(\"xmlns:wp\",\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\")]\n\n-- | Settings elements to copy from reference.docx (order matters)\nsettingsElementNames :: [Text]\nsettingsElementNames =\n  [ \"writeProtection\"\n  , \"view\"\n  , \"zoom\"\n  , \"removePersonalInformation\"\n  , \"removeDateAndTime\"\n  , \"doNotDisplayPageBoundaries\"\n  , \"displayBackgroundShape\"\n  , \"printPostScriptOverText\"\n  , \"printFractionalCharacterWidth\"\n  , \"printFormsData\"\n  , \"embedTrueTypeFonts\"\n  , \"embedSystemFonts\"\n  , \"saveSubsetFonts\"\n  , \"saveFormsData\"\n  , \"mirrorMargins\"\n  , \"alignBordersAndEdges\"\n  , \"bordersDoNotSurroundHeader\"\n  , \"bordersDoNotSurroundFooter\"\n  , \"gutterAtTop\"\n  , \"hideSpellingErrors\"\n  , \"hideGrammaticalErrors\"\n  , \"activeWritingStyle\"\n  , \"proofState\"\n  , \"formsDesign\"\n  , \"attachedTemplate\"\n  , \"linkStyles\"\n  , \"stylePaneFormatFilter\"\n  , \"stylePaneSortMethod\"\n  , \"documentType\"\n  , \"mailMerge\"\n  , \"revisionView\"\n  , \"trackRevisions\"\n  , \"doNotTrackMoves\"\n  , \"doNotTrackFormatting\"\n  , \"documentProtection\"\n  , \"autoFormatOverride\"\n  , \"styleLockTheme\"\n  , \"styleLockQFSet\"\n  , \"defaultTabStop\"\n  , \"autoHyphenation\"\n  , \"consecutiveHyphenLimit\"\n  , \"hyphenationZone\"\n  , \"doNotHyphenateCaps\"\n  , \"showEnvelope\"\n  , \"summaryLength\"\n  , \"clickAndTypeStyle\"\n  , \"defaultTableStyle\"\n  , \"evenAndOddHeaders\"\n  , \"bookFoldRevPrinting\"\n  , \"bookFoldPrinting\"\n  , \"bookFoldPrintingSheets\"\n  , \"drawingGridHorizontalSpacing\"\n  , \"drawingGridVerticalSpacing\"\n  , \"displayHorizontalDrawingGridEvery\"\n  , \"displayVerticalDrawingGridEvery\"\n  , \"doNotUseMarginsForDrawingGridOrigin\"\n  , \"drawingGridHorizontalOrigin\"\n  , \"drawingGridVerticalOrigin\"\n  , \"doNotShadeFormData\"\n  , \"noPunctuationKerning\"\n  , \"characterSpacingControl\"\n  , \"printTwoOnOne\"\n  , \"strictFirstAndLastChars\"\n  , \"noLineBreaksAfter\"\n  , \"noLineBreaksBefore\"\n  , \"savePreviewPicture\"\n  , \"doNotValidateAgainstSchema\"\n  , \"saveInvalidXml\"\n  , \"ignoreMixedContent\"\n  , \"alwaysShowPlaceholderText\"\n  , \"doNotDemarcateInvalidXml\"\n  , \"saveXmlDataOnly\"\n  , \"useXSLTWhenSaving\"\n  , \"saveThroughXslt\"\n  , \"showXMLTags\"\n  , \"alwaysMergeEmptyNamespace\"\n  , \"updateFields\"\n  , \"hdrShapeDefaults\"\n  -- , \"footnotePr\" -- this can cause problems, see #9522\n  -- , \"endnotePr\"\n  , \"compat\"\n  , \"docVars\"\n  , \"rsids\"\n  , \"attachedSchema\"\n  , \"themeFontLang\"\n  , \"clrSchemeMapping\"\n  , \"doNotIncludeSubdocsInStats\"\n  , \"doNotAutoCompressPictures\"\n  , \"forceUpgrade\"\n  , \"captions\"\n  , \"readModeInkLockDown\"\n  , \"smartTagType\"\n  , \"shapeDefaults\"\n  , \"doNotEmbedSmartTags\"\n  , \"decimalSymbol\"\n  , \"listSeparator\" ]\n\nmkNumbering :: [ListMarker] -> [Element]\nmkNumbering lists =\n  elts ++ zipWith mkNum lists [baseListId..(baseListId + length lists - 1)]\n    where elts = map mkAbstractNum (nubOrd lists)\n\nmkNum :: ListMarker -> Int -> Element\nmkNum marker numid =\n  mknode \"w:num\" [(\"w:numId\",tshow numid)]\n   $ mknode \"w:abstractNumId\" [(\"w:val\",listMarkerToId marker)] ()\n   : case marker of\n       NoMarker     -> []\n       BulletMarker -> []\n       CheckboxMarker _ -> []\n       NumberMarker _ _ start ->\n          map (\\lvl -> mknode \"w:lvlOverride\" [(\"w:ilvl\",tshow (lvl :: Int))]\n              $ mknode \"w:startOverride\" [(\"w:val\",tshow start)] ())\n                [0..maxListLevel]\n\nmkAbstractNum :: ListMarker -> Element\nmkAbstractNum marker =\n  mknode \"w:abstractNum\" [(\"w:abstractNumId\",listMarkerToId marker)]\n    $ mknode \"w:nsid\" [(\"w:val\", T.justifyRight 8 '0' (\"A\" <> listMarkerToId marker))] ()\n    : mknode \"w:multiLevelType\" [(\"w:val\",\"multilevel\")] ()\n    : map (mkLvl marker)\n      [0..maxListLevel]\n\nmkLvl :: ListMarker -> Int -> Element\nmkLvl marker lvl =\n  mknode \"w:lvl\" [(\"w:ilvl\",tshow lvl)] $\n    (case marker of\n        NumberMarker{} -> [mknode \"w:start\" [(\"w:val\",start)] ()]\n        _ -> []) ++\n    [ mknode \"w:numFmt\" [(\"w:val\",fmt)] ()\n    , mknode \"w:lvlText\" [(\"w:val\", lvltxt)] ()\n    , mknode \"w:lvlJc\" [(\"w:val\",\"left\")] ()\n    , mknode \"w:pPr\" [] $\n        mknode \"w:ind\" [ (\"w:left\",tshow $ lvl * step + step)\n                       , (\"w:hanging\",tshow hang)\n                       ] ()\n    ] ++\n    maybe [] (\\font ->\n                [ mknode \"w:rPr\" []\n                  [ mknode \"w:rFonts\" [ (\"w:ascii\", font)\n                                      , (\"w:hAnsi\", font)\n                                      , (\"w:cs\", font)\n                                      , (\"w:hint\", \"default\") ] () ]]) mbfont\n    where (fmt, lvltxt, mbfont, start) =\n            case marker of\n                 NoMarker             -> (\"bullet\",\" \", Nothing, \"1\")\n                 BulletMarker         -> bulletFor lvl\n                 CheckboxMarker False -> (\"bullet\",\"\\9744\", Nothing, \"1\")\n                 CheckboxMarker True  -> (\"bullet\",\"\\9746\", Nothing, \"1\")\n                 NumberMarker st de n -> (styleFor st lvl\n                                         ,patternFor de (\"%\" <> tshow (lvl + 1))\n                                         ,Nothing\n                                         ,tshow n)\n          step = 720\n          hang :: Int\n          hang = 360\n          bulletFor 0 = (\"bullet\", \"\\xf0b7\", Just \"Symbol\", \"1\") -- filled circle\n          bulletFor 1 = (\"bullet\", \"o\", Just \"Courier New\", \"1\") -- open o\n          bulletFor 2 = (\"bullet\", \"\\xf0a7\", Just \"Wingdings\", \"1\")  -- closed box\n          bulletFor x = bulletFor (x `mod` 3)\n          styleFor UpperAlpha _   = \"upperLetter\"\n          styleFor LowerAlpha _   = \"lowerLetter\"\n          styleFor UpperRoman _   = \"upperRoman\"\n          styleFor LowerRoman _   = \"lowerRoman\"\n          styleFor Decimal _      = \"decimal\"\n          styleFor DefaultStyle 0 = \"decimal\"\n          styleFor DefaultStyle 1 = \"lowerLetter\"\n          styleFor DefaultStyle 2 = \"lowerRoman\"\n          styleFor DefaultStyle 3 = \"decimal\"\n          styleFor DefaultStyle 4 = \"lowerLetter\"\n          styleFor DefaultStyle 5 = \"lowerRoman\"\n          styleFor DefaultStyle x = styleFor DefaultStyle (x `mod` 6)\n          styleFor _ _            = \"decimal\"\n          patternFor OneParen s  = s <> \")\"\n          patternFor TwoParens s = \"(\" <> s <> \")\"\n          patternFor _ s         = s <> \".\"\n\n-- | Build language transformer function for modifying XML elements.\n-- Navigates directly to w:docDefaults/w:rPr/w:lang instead of generic traversal.\nmkLangTransformer :: Maybe Lang -> (Element -> Element)\nmkLangTransformer Nothing  = id\nmkLangTransformer (Just lang) = modifyAtPath path updateLangAttrs\n  where\n    -- Path is: w:docDefaults / w:rPrDefault / w:rPr / w:lang\n    path = [named \"docDefaults\", named \"rPrDefault\", named \"rPr\", named \"lang\"]\n    named n = (== n) . qName\n\n    updateLangAttrs e\n      | isEastAsianLang lang = e{ elAttribs = map (setattr \"eastAsia\") $ elAttribs e }\n      | isBidiLang lang      = e{ elAttribs = map (setattr \"bidi\") $ elAttribs e }\n      | otherwise            = e{ elAttribs = map (setattr \"val\") $ elAttribs e }\n\n    setattr attrname (XML.Attr qn@(QName s _ _) _)\n      | s == attrname  = XML.Attr qn (renderLang lang)\n    setattr _ x        = x\n\n    isEastAsianLang Lang{ langLanguage = l } = l == \"zh\" || l == \"ja\" || l == \"ko\"\n    isBidiLang Lang{ langLanguage = l } = l == \"he\" || l == \"ar\"\n\n-- | Modify an element at a specific path in the XML tree.\n-- The path is a list of predicates that match element names at each level.\nmodifyAtPath :: [(QName -> Bool)] -> (Element -> Element) -> Element -> Element\nmodifyAtPath [] f e = f e\nmodifyAtPath (p:ps) f e = e{ elContent = map go (elContent e) }\n  where\n    go (Elem el) | p (elName el) = Elem (modifyAtPath ps f el)\n    go c = c\n\n-- | Load reference and distribution archives\nloadArchives :: PandocMonad m\n             => WriterOptions\n             -> m (Archive, Archive, Maybe Text, UTCTime)\nloadArchives opts = do\n  username <- P.lookupEnv \"USERNAME\"\n  utctime <- P.getTimestamp\n  oldUserDataDir <- P.getUserDataDir\n  P.setUserDataDir Nothing\n  res <- readDefaultDataFile \"reference.docx\"\n  P.setUserDataDir oldUserDataDir\n  let distArchive = toArchive $ BL.fromStrict res\n  refArchive <- case writerReferenceDoc opts of\n                   Just f  -> toArchive . BL.fromStrict . fst\n                                 <$> P.fetchItem (T.pack f)\n                   Nothing -> toArchive . BL.fromStrict <$>\n                        readDataFile \"reference.docx\"\n  return (refArchive, distArchive, username, utctime)\n\n-- | Extract page dimensions from template\nextractPageLayout :: PandocMonad m\n                  => Archive -> Archive -> m (Maybe Element, Maybe Integer)\nextractPageLayout refArchive distArchive = do\n  parsedDoc <- parseXml refArchive distArchive \"word/document.xml\"\n  let wname f qn = qPrefix qn == Just \"w\" && f (qName qn)\n  let mbsectpr = filterElementName (wname (==\"sectPr\")) parsedDoc\n\n  -- Gets the template size\n  let mbpgsz = mbsectpr >>= filterElementName (wname (==\"pgSz\"))\n  let mbAttrSzWidth = mbpgsz >>= lookupAttrBy ((==\"w\") . qName) . elAttribs\n\n  let mbpgmar = mbsectpr >>= filterElementName (wname (==\"pgMar\"))\n  let mbAttrMarLeft = mbpgmar >>= lookupAttrBy ((==\"left\") . qName) . elAttribs\n  let mbAttrMarRight = mbpgmar >>= lookupAttrBy ((==\"right\") . qName) . elAttribs\n\n  -- Get the available area (converting the size and the margins to int and\n  -- doing the difference\n  let pgContentWidth = do\n                         w <- mbAttrSzWidth >>= safeRead\n                         r <- mbAttrMarRight >>= safeRead\n                         l <- mbAttrMarLeft >>= safeRead\n                         pure $ w - r - l\n\n  return (mbsectpr, pgContentWidth)\n\n-- | Parse and augment relationships from reference.docx\nextractRelationships :: PandocMonad m\n                     => Archive -> Archive\n                     -> m ([Element], [Element], [Element], Int)\nextractRelationships refArchive distArchive = do\n  let isImageNode e = findAttr (QName \"Type\" Nothing Nothing) e == Just \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\"\n  let isHeaderNode e = findAttr (QName \"Type\" Nothing Nothing) e == Just \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header\"\n  let isFooterNode e = findAttr (QName \"Type\" Nothing Nothing) e == Just \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer\"\n  parsedRels <- filterElements\n                  (\\e -> isImageNode e || isHeaderNode e || isFooterNode e)\n              <$> parseXml refArchive distArchive \"word/_rels/document.xml.rels\"\n  let getRelId e =\n        case findAttr (QName \"Id\" Nothing Nothing) e of\n          Just ident -> T.stripPrefix \"rId\" ident >>= safeRead\n          Nothing -> Nothing\n  let relIds = mapMaybe getRelId parsedRels\n  let maxRelId = if null relIds then 0 else maximum relIds\n\n  let headers = filter isHeaderNode parsedRels\n  let footers = filter isFooterNode parsedRels\n  -- word/_rels/document.xml.rels\n  let addBaseRel (url', target') (maxId, rels) =\n        case [e | e <- rels\n                , findAttr (QName \"Target\" Nothing Nothing) e ==\n                   Just target'] of\n          [] -> (maxId + 1, mknode \"Relationship\"\n                            [(\"Type\",url')\n                            ,(\"Id\",\"rId\" <> tshow (maxId + 1))\n                            ,(\"Target\",target')] () : rels)\n          _ -> (maxId, rels)\n\n  let (newMaxRelId, baserels) = foldr addBaseRel (maxRelId, parsedRels)\n                    [(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering\",\n                      \"numbering.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\",\n                      \"styles.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\",\n                      \"settings.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings\",\n                      \"webSettings.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable\",\n                      \"fontTable.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n                      \"theme/theme1.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes\",\n                      \"footnotes.xml\")\n                    ,(\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\",\n                      \"comments.xml\")\n                    ]\n\n  return (baserels, headers, footers, newMaxRelId)\n\n-- | Create footnotes XML entry\nmkFootnotesEntry :: Integer -> [Element] -> Entry\nmkFootnotesEntry epochtime footnotes =\n  let notes = mknode \"w:footnotes\" stdAttributes footnotes\n  in toEntry \"word/footnotes.xml\" epochtime $ renderXml notes\n\n-- | Create footnote relationships entry\nmkFootnoteRelsEntry :: Integer -> M.Map Text Text -> Entry\nmkFootnoteRelsEntry epochtime externalLinks =\n  let linkrels = map toLinkRel $ M.toList externalLinks\n      toLinkRel (src, ident) = mknode \"Relationship\"\n        [(\"Type\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\")\n        ,(\"Id\",ident)\n        ,(\"Target\",src)\n        ,(\"TargetMode\",\"External\")] ()\n  in toEntry \"word/_rels/footnotes.xml.rels\" epochtime\n       $ renderXml $ mknode \"Relationships\"\n           [(\"xmlns\",\"http://schemas.openxmlformats.org/package/2006/relationships\")]\n           linkrels\n\n-- | Create comments XML entry\nmkCommentsEntry :: Integer -> [Element] -> Entry\nmkCommentsEntry epochtime comments =\n  toEntry \"word/comments.xml\" epochtime\n    $ renderXml $ mknode \"w:comments\" stdAttributes comments\n\n-- | Create package-level relationships entry\nmkPackageRelsEntry :: Integer -> Entry\nmkPackageRelsEntry epochtime =\n  let rels = mknode \"Relationships\"\n        [(\"xmlns\", \"http://schemas.openxmlformats.org/package/2006/relationships\")]\n        $ map (\\attrs -> mknode \"Relationship\" attrs ())\n        [ [(\"Id\",\"rId1\")\n          ,(\"Type\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\")\n          ,(\"Target\",\"word/document.xml\")]\n        , [(\"Id\",\"rId4\")\n          ,(\"Type\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\")\n          ,(\"Target\",\"docProps/app.xml\")]\n        , [(\"Id\",\"rId3\")\n          ,(\"Type\",\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\")\n          ,(\"Target\",\"docProps/core.xml\")]\n        , [(\"Id\",\"rId5\")\n          ,(\"Type\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\")\n          ,(\"Target\",\"docProps/custom.xml\")]\n        ]\n  in toEntry \"_rels/.rels\" epochtime $ renderXml rels\n\n-- | Create content types manifest entry\nmkContentTypesEntry :: Integer\n                    -> [(String, String, Maybe MimeType, B.ByteString)]  -- imgs\n                    -> [Element]  -- headers\n                    -> [Element]  -- footers\n                    -> Archive    -- refArchive\n                    -> Entry\nmkContentTypesEntry epochtime imgs headers footers refArchive =\n  let mkOverrideNode (part', contentType') = mknode \"Override\"\n           [(\"PartName\", T.pack part')\n           ,(\"ContentType\", contentType')] ()\n      mkImageOverride (_, imgpath, mbMimeType, _) =\n          mkOverrideNode (\"/word/\" <> imgpath,\n                          fromMaybe \"application/octet-stream\" mbMimeType)\n      mkMediaOverride imgpath =\n          mkOverrideNode (\"/\" <> imgpath, getMimeTypeDef imgpath)\n      unrelativize ('/':xs) = '/':xs\n      unrelativize xs = \"/word/\" ++ xs\n      overrides = map mkOverrideNode (\n                  [(\"/word/webSettings.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml\")\n                  ,(\"/word/numbering.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\")\n                  ,(\"/word/settings.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\")\n                  ,(\"/word/theme/theme1.xml\",\n                    \"application/vnd.openxmlformats-officedocument.theme+xml\")\n                  ,(\"/word/fontTable.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\")\n                  ,(\"/docProps/app.xml\",\n                    \"application/vnd.openxmlformats-officedocument.extended-properties+xml\")\n                  ,(\"/docProps/core.xml\",\n                    \"application/vnd.openxmlformats-package.core-properties+xml\")\n                  ,(\"/docProps/custom.xml\",\n                    \"application/vnd.openxmlformats-officedocument.custom-properties+xml\")\n                  ,(\"/word/styles.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\")\n                  ,(\"/word/document.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\")\n                  ,(\"/word/comments.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\")\n                  ,(\"/word/footnotes.xml\",\n                    \"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\")\n                  ] ++\n                  map (\\x -> (maybe \"\" (unrelativize . T.unpack) (extractTarget x),\n                       \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\")) headers ++\n                  map (\\x -> (maybe \"\" (unrelativize . T.unpack) (extractTarget x),\n                       \"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\")) footers) ++\n                    map mkImageOverride imgs ++\n                    [ mkMediaOverride (eRelativePath e)\n                        | e <- zEntries refArchive\n                        , \"word/media/\" `isPrefixOf` eRelativePath e\n                        , not (\"/\" `isSuffixOf` eRelativePath e) ]\n      mkDefaultNode (ext, mt) =\n        mknode \"Default\" [(\"Extension\",ext),(\"ContentType\",mt)] ()\n      defaultnodes = map mkDefaultNode\n        [(\"xml\", \"application/xml\"),\n         (\"rels\", \"application/vnd.openxmlformats-package.relationships+xml\"),\n         (\"odttf\",\n           \"application/vnd.openxmlformats-officedocument.obfuscatedFont\")]\n      contentTypesDoc = mknode \"Types\"\n        [(\"xmlns\",\"http://schemas.openxmlformats.org/package/2006/content-types\")]\n        $ defaultnodes ++ overrides\n  in toEntry \"[Content_Types].xml\" epochtime $ renderXml contentTypesDoc\n\n-- | Create document relationships entry\nmkDocumentRelsEntry :: Integer\n                    -> [Element]  -- baserels\n                    -> [(String, String, Maybe MimeType, B.ByteString)]  -- imgs\n                    -> M.Map Text Text  -- externalLinks\n                    -> Entry\nmkDocumentRelsEntry epochtime baserels imgs externalLinks =\n  let toImgRel (ident, path, _, _) = mknode \"Relationship\"\n        [(\"Type\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\")\n        ,(\"Id\",T.pack ident)\n        ,(\"Target\",T.pack path)] ()\n      imgrels = map toImgRel imgs\n      toLinkRel (src, ident) = mknode \"Relationship\"\n        [(\"Type\",\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\")\n        ,(\"Id\",ident)\n        ,(\"Target\",src)\n        ,(\"TargetMode\",\"External\")] ()\n      linkrels = map toLinkRel $ M.toList externalLinks\n      reldoc = mknode \"Relationships\"\n        [(\"xmlns\",\"http://schemas.openxmlformats.org/package/2006/relationships\")]\n        $ baserels ++ imgrels ++ linkrels\n  in toEntry \"word/_rels/document.xml.rels\" epochtime $ renderXml reldoc\n\n-- | Create styles entry with dynamic additions\nmkStylesEntry :: Integer -> Element -> StyleMaps -> WriterState -> WriterOptions -> Entry\nmkStylesEntry epochtime styledoc styleMaps st opts =\n  let stylepath = \"word/styles.xml\"\n      -- We only want to inject paragraph and text properties that\n      -- are not already in the style map. Note that keys in the stylemap\n      -- are normalized as lowercase.\n      newDynamicParaProps = filter\n        (\\sty -> not $ hasStyleName sty $ smParaStyle styleMaps)\n        (Set.toList $ stDynamicParaProps st)\n\n      newDynamicTextProps = filter\n        (\\sty -> not $ hasStyleName sty $ smCharStyle styleMaps)\n        (Set.toList $ stDynamicTextProps st)\n\n      newstyles = map newParaPropToOpenXml newDynamicParaProps ++\n                  map newTextPropToOpenXml newDynamicTextProps ++\n                  (case writerHighlightMethod opts of\n                     Skylighting sty -> styleToOpenXml styleMaps sty\n                     DefaultHighlighting -> styleToOpenXml styleMaps\n                                              defaultStyle\n                     _ -> [])\n      styledoc' = styledoc{ elContent = elContent styledoc ++\n                                           map Elem newstyles }\n  in toEntry stylepath epochtime $ renderXml styledoc'\n\n-- | Create core document properties entry\nmkCorePropsEntry :: Integer -> UTCTime -> Meta -> Entry\nmkCorePropsEntry epochtime utctime meta =\n  let keywords = case lookupMeta \"keywords\" meta of\n                       Just (MetaList xs) -> map stringify xs\n                       _                  -> []\n      docPropsPath = \"docProps/core.xml\"\n      extraCoreProps = [\"subject\",\"lang\",\"category\",\"description\"]\n      extraCorePropsMap = M.fromList $ zip extraCoreProps\n                       [\"dc:subject\",\"dc:language\",\"cp:category\",\"dc:description\"]\n      lookupMetaString' :: Text -> Meta -> Text\n      lookupMetaString' key' meta' =\n        case key' of\n             \"description\" -> T.intercalate \"_x000d_\\n\"\n                                (map stringify $ lookupMetaBlocks \"description\" meta')\n             key''         -> lookupMetaString key'' meta'\n\n      docProps = mknode \"cp:coreProperties\"\n          [(\"xmlns:cp\",\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\")\n          ,(\"xmlns:dc\",\"http://purl.org/dc/elements/1.1/\")\n          ,(\"xmlns:dcterms\",\"http://purl.org/dc/terms/\")\n          ,(\"xmlns:dcmitype\",\"http://purl.org/dc/dcmitype/\")\n          ,(\"xmlns:xsi\",\"http://www.w3.org/2001/XMLSchema-instance\")]\n          $ mktnode \"dc:title\" [] (stringify $ docTitle meta)\n          : mktnode \"dc:creator\" [] (T.intercalate \"; \" (map stringify $ docAuthors meta))\n          : [ mktnode (M.findWithDefault \"\" k extraCorePropsMap) [] (lookupMetaString' k meta)\n            | k <- M.keys (unMeta meta), k `elem` extraCoreProps]\n          ++ mknode \"cp:keywords\" [] (T.intercalate \", \" keywords)\n          : (\\x -> [ mknode \"dcterms:created\" [(\"xsi:type\",\"dcterms:W3CDTF\")] x\n                   , mknode \"dcterms:modified\" [(\"xsi:type\",\"dcterms:W3CDTF\")] x\n                   ]) (T.pack $ formatTime defaultTimeLocale \"%FT%XZ\" utctime)\n  in toEntry docPropsPath epochtime $ renderXml docProps\n\n-- | Create custom document properties entry\nmkCustomPropsEntry :: Integer -> Meta -> Entry\nmkCustomPropsEntry epochtime meta =\n  let extraCoreProps = [\"subject\",\"lang\",\"category\",\"description\"]\n      customProperties :: [(Text, Text)]\n      customProperties = [ (k, lookupMetaString k meta)\n                         | k <- M.keys (unMeta meta)\n                         , k `notElem` ([\"title\", \"author\", \"keywords\"]\n                                       ++ extraCoreProps)]\n      mkCustomProp (k, v) pid = mknode \"property\"\n         [(\"fmtid\",\"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}\")\n         ,(\"pid\", tshow pid)\n         ,(\"name\", k)] $ mknode \"vt:lpwstr\" [] v\n      customPropsPath = \"docProps/custom.xml\"\n      customProps = mknode \"Properties\"\n          [(\"xmlns\",\"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\")\n          ,(\"xmlns:vt\",\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\")\n          ] $ zipWith mkCustomProp customProperties [(2 :: Int)..]\n  in toEntry customPropsPath epochtime $ renderXml customProps\n\n-- | Create numbering entry\nmkNumberingEntry :: PandocMonad m\n                 => Archive -> Archive -> Integer -> [ListMarker] -> m Entry\nmkNumberingEntry refArchive distArchive epochtime lists = do\n  let numpath = \"word/numbering.xml\"\n  numbering <- parseXml refArchive distArchive numpath\n  let newNumElts = mkNumbering lists\n  let pandocAdded e =\n       case findAttrBy ((== \"abstractNumId\") . qName) e >>= safeRead of\n         Just numid -> numid >= (990 :: Int)\n         Nothing    ->\n           case findAttrBy ((== \"numId\") . qName) e >>= safeRead of\n             Just numid -> numid >= (1000 :: Int)\n             Nothing    -> False\n  let oldElts = filter (not . pandocAdded) $ onlyElems (elContent numbering)\n  let allElts = oldElts ++ newNumElts\n  return $ toEntry numpath epochtime $ renderXml numbering{ elContent =\n                       -- we want all the abstractNums first, then the nums,\n                       -- otherwise things break:\n                       [Elem e | e <- allElts\n                               , qName (elName e) == \"abstractNum\" ] ++\n                       [Elem e | e <- allElts\n                               , qName (elName e) == \"num\" ] }\n\n-- | Collect auxiliary entries from reference archive\ncollectReferenceEntries :: PandocMonad m\n                        => Archive -> Archive -> [Element] -> [Element]\n                        -> m [Entry]\ncollectReferenceEntries refArchive distArchive headers footers = do\n  let entryFromArchive arch path =\n         maybe (throwError $ PandocSomeError\n                           $ T.pack $ path ++ \" missing in reference docx\")\n               return\n               (findEntryByPath path arch `mplus` findEntryByPath path distArchive)\n  docPropsAppEntry <- entryFromArchive refArchive \"docProps/app.xml\"\n  themeEntry <- entryFromArchive refArchive \"word/theme/theme1.xml\"\n  fontTableEntry <- entryFromArchive refArchive \"word/fontTable.xml\"\n  let fontTableRelsEntries = maybeToList $\n       findEntryByPath \"word/_rels/fontTable.xml.rels\" refArchive\n  let fontEntries = [entry | entry <- zEntries refArchive\n                           , \"word/fonts/\" `isPrefixOf` (eRelativePath entry)]\n  webSettingsEntry <- entryFromArchive refArchive \"word/webSettings.xml\"\n  let unrelativize ('/':xs) = xs\n      unrelativize xs = \"word/\" ++ xs\n  headerFooterEntries <- mapM (entryFromArchive refArchive . unrelativize) $\n                         mapMaybe (fmap T.unpack . extractTarget)\n                         (headers ++ footers)\n  let miscRelEntries = [ e | e <- zEntries refArchive\n                       , \"word/_rels/\" `isPrefixOf` eRelativePath e\n                       , \".xml.rels\" `isSuffixOf` eRelativePath e\n                       , eRelativePath e /= \"word/_rels/document.xml.rels\"\n                       , eRelativePath e /= \"word/_rels/footnotes.xml.rels\" ]\n  let otherMediaEntries = [ e | e <- zEntries refArchive\n                          , \"word/media/\" `isPrefixOf` eRelativePath e ]\n  return $ docPropsAppEntry : themeEntry : fontTableEntry : webSettingsEntry\n         : fontTableRelsEntries ++ fontEntries ++ headerFooterEntries\n         ++ miscRelEntries ++ otherMediaEntries\n\nextractTarget :: Element -> Maybe Text\nextractTarget = findAttr (QName \"Target\" Nothing Nothing)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/DokuWiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.DokuWiki\n   Copyright   : Copyright (C) 2008-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Clare Macrae <clare.macrae@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to DokuWiki markup.\n\nDokuWiki:  <https://www.dokuwiki.org/dokuwiki>\n-}\n\n{-\n    [x] Implement nested blockquotes (currently only ever does one level)\n    [x] Implement alignment of text in tables\n    [ ] Implement comments\n    [ ] Work through the Dokuwiki spec, and check I've not missed anything out\n    [ ] Remove dud/duplicate code\n-}\n\nmodule Text.Pandoc.Writers.DokuWiki ( writeDokuWiki ) where\nimport Control.Monad (zipWithM)\nimport Control.Monad.Reader (ReaderT, asks, local, runReaderT)\nimport Control.Monad.State.Strict (StateT, evalStateT)\nimport Data.Default (Default (..))\nimport Data.List (transpose)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Extensions\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options (WrapOption (..), WriterOptions (writerTableOfContents,\n                            writerTemplate, writerWrapText), isEnabled)\nimport Text.Pandoc.Shared (figureDiv, linesToPara, removeFormatting, trimr)\nimport Text.Pandoc.URI (escapeURI, isURI)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.DocLayout (render, literal)\nimport Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable)\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Map as M\n\ndata WriterState = WriterState {\n  }\n\ndata WriterEnvironment = WriterEnvironment {\n    stIndent      :: Text          -- Indent after the marker at the beginning of list items\n  , stBackSlashLB :: Bool     -- True if we should produce formatted strings with newlines (as in a table cell)\n  , stBlockQuoteLevel :: Int   -- Block quote level\n  }\n\ninstance Default WriterState where\n  def = WriterState {}\n\ninstance Default WriterEnvironment where\n  def = WriterEnvironment { stIndent = \"\"\n                          , stBackSlashLB = False\n                          , stBlockQuoteLevel = 0 }\n\ntype DokuWiki m = ReaderT WriterEnvironment (StateT WriterState m)\n\n-- | Convert Pandoc to DokuWiki.\nwriteDokuWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteDokuWiki opts document =\n  runDokuWiki (pandocToDokuWiki opts document)\n\nrunDokuWiki :: PandocMonad m => DokuWiki m a -> m a\nrunDokuWiki = flip evalStateT def . flip runReaderT def\n\n-- | Return DokuWiki representation of document.\npandocToDokuWiki :: PandocMonad m\n                 => WriterOptions -> Pandoc -> DokuWiki m Text\npandocToDokuWiki opts (Pandoc meta blocks) = do\n  metadata <- metaToContext opts\n              (fmap (literal . trimr) . blockListToDokuWiki opts)\n              (fmap (literal . trimr) . inlineListToDokuWiki opts)\n              meta\n  body <- blockListToDokuWiki opts blocks\n  let context = defField \"body\" body\n              $ defField \"toc\" (writerTableOfContents opts) metadata\n  return $\n    case writerTemplate opts of\n       Nothing  -> body\n       Just tpl -> render Nothing $ renderTemplate tpl context\n\n-- | Escape special characters for DokuWiki.\nescapeString :: Text -> Text\nescapeString = T.replace \"__\" \"%%__%%\" .\n               T.replace \"**\" \"%%**%%\" .\n               T.replace \"//\" \"%%//%%\"\n\n-- | Convert Pandoc block element to DokuWiki.\nblockToDokuWiki :: PandocMonad m\n                => WriterOptions -- ^ Options\n                -> Block         -- ^ Block element\n                -> DokuWiki m Text\n\nblockToDokuWiki opts (Div _attrs bs) = do\n  contents <- blockListToDokuWiki opts bs\n  indent <- asks stIndent\n  return $ contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToDokuWiki opts (Plain inlines) =\n  inlineListToDokuWiki opts inlines\n\nblockToDokuWiki opts (Para inlines) = do\n  bqLevel <- asks stBlockQuoteLevel\n  let bqPrefix = case bqLevel of\n                    0 -> \"\"\n                    n -> T.replicate n \">\" <> \" \"\n  indent <- asks stIndent\n  contents <- inlineListToDokuWiki opts inlines\n  return $ bqPrefix <> contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToDokuWiki opts (LineBlock lns) =\n  blockToDokuWiki opts $ linesToPara lns\n\nblockToDokuWiki opts b@(RawBlock f str)\n  | f == Format \"dokuwiki\" = return str\n  -- See https://www.dokuwiki.org/wiki:syntax\n  -- use uppercase HTML tag for block-level content:\n  | f == Format \"html\"\n  , isEnabled Ext_raw_html opts = return $ \"<HTML>\\n\" <> str <> \"\\n</HTML>\"\n  | otherwise              = \"\" <$\n         report (BlockNotRendered b)\n\nblockToDokuWiki _ HorizontalRule = return \"\\n----\\n\"\n\nblockToDokuWiki opts (Header level _ inlines) = do\n  -- emphasis, links etc. not allowed in headers, apparently,\n  -- so we remove formatting:\n  contents <- inlineListToDokuWiki opts $ removeFormatting inlines\n  let eqs = T.replicate ( 7 - level ) \"=\"\n  return $ eqs <> \" \" <> contents <> \" \" <> eqs <> \"\\n\"\n\nblockToDokuWiki _ (CodeBlock (_,classes,_) str) = do\n  bqLevel <- asks stBlockQuoteLevel\n  let bqPrefix = case bqLevel of\n                    0 -> \"\"\n                    n -> T.replicate n \">\" <> \" \"\n  return $ bqPrefix <>\n           \"<code\" <>\n           (case classes of\n               []    -> \"\"\n               (x:_) -> \" \" <> fromMaybe x (M.lookup x languageNames)) <>\n           \">\\n\" <> str <>\n           (if \"\\n\" `T.isSuffixOf` str then \"\" else \"\\n\") <> \"</code>\\n\"\n\nblockToDokuWiki opts (BlockQuote blocks) =\n  local (\\st -> st{ stBlockQuoteLevel = stBlockQuoteLevel st + 1 })\n               (blockListToDokuWiki opts blocks)\n\nblockToDokuWiki opts (Table _ blkCapt specs thead tbody tfoot) = do\n  let (capt, aligns, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  captionDoc <- if null capt\n                   then return \"\"\n                   else do\n                      c <- inlineListToDokuWiki opts capt\n                      return $ \"\" <> c <> \"\\n\"\n  headers' <- if all null headers\n                 then return []\n                 else zipWithM (tableItemToDokuWiki opts) aligns headers\n  rows' <- mapM (zipWithM (tableItemToDokuWiki opts) aligns) rows\n  let widths = map (maybe 0 maximum . nonEmpty . map T.length)\n                   $ transpose (headers':rows')\n  let padTo (width, al) s =\n          case width - T.length s of\n               x | x > 0 ->\n                 if al == AlignLeft || al == AlignDefault\n                    then s <> T.replicate x \" \"\n                    else if al == AlignRight\n                            then T.replicate x \" \" <> s\n                            else T.replicate (x `div` 2) \" \" <>\n                                 s <> T.replicate (x - x `div` 2) \" \"\n                 | otherwise -> s\n  let renderRow sep cells = sep <>\n          T.intercalate sep (zipWith padTo (zip widths aligns) cells) <> sep\n  return $ captionDoc <>\n           (if null headers' then \"\" else renderRow \"^\" headers' <> \"\\n\") <>\n           T.unlines (map (renderRow \"|\") rows')\n\nblockToDokuWiki opts (BulletList items) = do\n  indent <- asks stIndent\n  backSlash <- asks stBackSlashLB\n  contents <- local (\\s -> s { stIndent = stIndent s <> \"  \"\n                             , stBackSlashLB = backSlash})\n                      (mapM (listItemToDokuWiki opts) items)\n  return $ vcat contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToDokuWiki opts (OrderedList _attribs items) = do\n  indent <- asks stIndent\n  backSlash <- asks stBackSlashLB\n  contents <- local (\\s -> s { stIndent = stIndent s <> \"  \"\n                             , stBackSlashLB = backSlash})\n                (mapM (orderedListItemToDokuWiki opts) items)\n  return $ vcat contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToDokuWiki opts (Figure attr capt body) =\n  blockToDokuWiki opts $ figureDiv attr capt body\n\n-- TODO Need to decide how to make definition lists work on dokuwiki - I don't think there\n--      is a specific representation of them.\n-- TODO This creates double '; ; ' if there is a bullet or ordered list inside a definition list\nblockToDokuWiki opts (DefinitionList items) = do\n  indent <- asks stIndent\n  backSlash <- asks stBackSlashLB\n  contents <- local (\\s -> s { stIndent = stIndent s <> \"  \"\n                             , stBackSlashLB = backSlash})\n                (mapM (definitionListItemToDokuWiki opts) items)\n  return $ vcat contents <> if T.null indent then \"\\n\" else \"\"\n\n-- Auxiliary functions for lists:\n\n-- | Convert bullet list item (list of blocks) to DokuWiki.\nlistItemToDokuWiki :: PandocMonad m\n                   => WriterOptions -> [Block] -> DokuWiki m Text\nlistItemToDokuWiki opts items = do\n  bqLevel <- asks stBlockQuoteLevel\n  let bqPrefix = case bqLevel of\n                    0 -> \"\"\n                    n -> T.replicate n \">\" <> \" \"\n  let useWrap = not (isSimpleListItem items)\n  bs <- mapM (blockToDokuWiki opts) items\n  let contents = case items of\n                      [_, CodeBlock _ _] -> T.concat bs\n                      _                  -> vcat bs\n  indent <- asks stIndent\n  backSlash <- asks stBackSlashLB\n  let indent' = if backSlash then T.drop 2 indent else indent\n  return $ bqPrefix <> indent' <> \"* \" <>\n    if useWrap\n       then \"<WRAP>\\n\" <> contents <> \"\\n</WRAP>\"\n       else contents\n\n-- | Convert ordered list item (list of blocks) to DokuWiki.\n-- | TODO Emiminate dreadful duplication of text from listItemToDokuWiki\norderedListItemToDokuWiki :: PandocMonad m => WriterOptions -> [Block] -> DokuWiki m Text\norderedListItemToDokuWiki opts items = do\n  bqLevel <- asks stBlockQuoteLevel\n  let bqPrefix = case bqLevel of\n                    0 -> \"\"\n                    n -> T.replicate n \">\" <> \" \"\n  let useWrap = not (isSimpleListItem items)\n  contents <- local (\\st -> st{ stBlockQuoteLevel = 0 })\n               (blockListToDokuWiki opts items)\n  indent <- asks stIndent\n  backSlash <- asks stBackSlashLB\n  let indent' = if backSlash then T.drop 2 indent else indent\n  return $ bqPrefix <> indent' <> \"- \" <>\n    if useWrap\n       then \"<WRAP>\\n\" <> contents <> \"\\n</WRAP>\"\n       else contents\n\n-- | Convert definition list item (label, list of blocks) to DokuWiki.\ndefinitionListItemToDokuWiki :: PandocMonad m\n                             => WriterOptions\n                             -> ([Inline],[[Block]])\n                             -> DokuWiki m Text\ndefinitionListItemToDokuWiki opts (label, items) = do\n  let useWrap = not (all isSimpleListItem items)\n  bqLevel <- asks stBlockQuoteLevel\n  let bqPrefix = case bqLevel of\n                    0 -> \"\"\n                    n -> T.replicate n \">\" <> \" \"\n  labelText <- inlineListToDokuWiki opts label\n  contents <- local (\\st -> st{ stBlockQuoteLevel = 0 })\n               (mapM (blockListToDokuWiki opts) items)\n  indent <- asks stIndent\n  backSlash <- asks stBackSlashLB\n  let indent' = if backSlash then T.drop 2 indent else indent\n  return $ bqPrefix <> indent' <> \"* **\" <> labelText <> \"** \" <>\n    if useWrap\n       then \"<WRAP>\\n\" <> vcat contents <> \"\\n</WRAP>\"\n       else T.intercalate \"; \" contents\n\n-- | True if list item can be handled with the simple wiki syntax.  False if\n--   WRAP tags will be needed.\nisSimpleListItem :: [Block] -> Bool\nisSimpleListItem []  = True\nisSimpleListItem [x, CodeBlock{}] | isPlainOrPara x = True\nisSimpleListItem (Div _ bs : ys) = -- see #8920\n  isSimpleListItem bs && all isSimpleList ys\nisSimpleListItem (x:ys) | isPlainOrPara x = all isSimpleList ys\nisSimpleListItem _ = False\n--- | True if the list can be handled by simple wiki markup, False if HTML tags will be needed.\n\nisSimpleList :: Block -> Bool\nisSimpleList x =\n  case x of\n       BulletList items            -> all isSimpleListItem items\n       OrderedList (1, _, _) items -> all isSimpleListItem items\n       DefinitionList items        -> all (all isSimpleListItem . snd) items\n       _                           -> False\n\nisPlainOrPara :: Block -> Bool\nisPlainOrPara (Plain _) = True\nisPlainOrPara (Para  _) = True\nisPlainOrPara _         = False\n\n-- | Concatenates strings with line breaks between them.\nvcat :: [Text] -> Text\nvcat = T.intercalate \"\\n\"\n\n-- | For each string in the input list, convert all newlines to\n-- dokuwiki escaped newlines. Then concat the list using double linebreaks.\nbackSlashLineBreaks :: [Text] -> Text\nbackSlashLineBreaks ls = vcatBackSlash $ map (T.pack . escape . T.unpack) ls\n  where\n    vcatBackSlash = T.intercalate \"\\\\\\\\ \\\\\\\\ \" -- simulate paragraphs.\n    escape ['\\n']    = \"\" -- remove trailing newlines\n    escape ('\\n':cs) = \"\\\\\\\\ \" <> escape cs\n    escape (c:cs)    = c : escape cs\n    escape []        = []\n\n-- Auxiliary functions for tables:\n\ntableItemToDokuWiki :: PandocMonad m\n                    => WriterOptions\n                    -> Alignment\n                    -> [Block]\n                    -> DokuWiki m Text\ntableItemToDokuWiki opts align' item = do\n  let mkcell x = (if align' == AlignRight || align' == AlignCenter\n                     then \"  \"\n                     else \"\") <> x <>\n                 (if align' == AlignLeft || align' == AlignCenter\n                     then \"  \"\n                     else \"\")\n  contents <- local (\\s -> s { stBackSlashLB = True\n                             , stBlockQuoteLevel = 0 }) $\n                blockListToDokuWiki opts item\n  return $ mkcell contents\n\n-- | Convert list of Pandoc block elements to DokuWiki.\nblockListToDokuWiki :: PandocMonad m\n                    => WriterOptions -- ^ Options\n                    -> [Block]       -- ^ List of block elements\n                    -> DokuWiki m Text\nblockListToDokuWiki opts blocks = do\n  backSlash <- asks stBackSlashLB\n  let blocks' = consolidateRawBlocks blocks\n  if backSlash\n    then backSlashLineBreaks <$> mapM (blockToDokuWiki opts) blocks'\n    else vcat <$> mapM (blockToDokuWiki opts) blocks'\n\nconsolidateRawBlocks :: [Block] -> [Block]\nconsolidateRawBlocks [] = []\nconsolidateRawBlocks (RawBlock f1 b1 : RawBlock f2 b2 : xs)\n  | f1 == f2 = consolidateRawBlocks (RawBlock f1 (b1 <> \"\\n\" <> b2) : xs)\nconsolidateRawBlocks (x:xs) = x : consolidateRawBlocks xs\n\n-- | Convert list of Pandoc inline elements to DokuWiki.\ninlineListToDokuWiki :: PandocMonad m\n                     => WriterOptions -> [Inline] -> DokuWiki m Text\ninlineListToDokuWiki opts lst =\n  T.concat <$> mapM (inlineToDokuWiki opts) lst\n\n-- | Convert Pandoc inline element to DokuWiki.\ninlineToDokuWiki :: PandocMonad m\n                 => WriterOptions -> Inline -> DokuWiki m Text\n\ninlineToDokuWiki opts (Span _attrs ils) =\n  inlineListToDokuWiki opts ils\n\ninlineToDokuWiki opts (Emph lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"//\" <> contents <> \"//\"\n\ninlineToDokuWiki opts (Underline lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"__\" <> contents <> \"__\"\n\ninlineToDokuWiki opts (Strong lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"**\" <> contents <> \"**\"\n\ninlineToDokuWiki opts (Strikeout lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"<del>\" <> contents <> \"</del>\"\n\ninlineToDokuWiki opts (Superscript lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"<sup>\" <> contents <> \"</sup>\"\n\ninlineToDokuWiki opts (Subscript lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"<sub>\" <> contents <> \"</sub>\"\n\ninlineToDokuWiki opts (SmallCaps lst) = inlineListToDokuWiki opts lst\n\ninlineToDokuWiki opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"\\8216\" <> contents <> \"\\8217\"\n\ninlineToDokuWiki opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToDokuWiki opts lst\n  return $ \"\\8220\" <> contents <> \"\\8221\"\n\ninlineToDokuWiki opts (Cite _  lst) = inlineListToDokuWiki opts lst\n\ninlineToDokuWiki _ (Code _ str) =\n  -- In dokuwiki, text surrounded by '' is really just a font statement, i.e. <tt>,\n  -- and so other formatting can be present inside.\n  -- However, in pandoc, and markdown, inlined code doesn't contain formatting.\n  -- So I have opted for using %% to disable all formatting inside inline code blocks.\n  -- This gives the best results when converting from other formats to dokuwiki, even if\n  -- the resultand code is a little ugly, for short strings that don't contain formatting\n  -- characters.\n  -- It does mean that if pandoc could ever read dokuwiki, and so round-trip the format,\n  -- any formatting inside inlined code blocks would be lost, or presented incorrectly.\n  return $ \"''%%\" <> str <> \"%%''\"\n\ninlineToDokuWiki _ (Str str) = return $ escapeString str\n\ninlineToDokuWiki _ (Math mathType str) = return $ delim <> str <> delim\n                                 -- note:  str should NOT be escaped\n  where delim = case mathType of\n                     DisplayMath -> \"$$\"\n                     InlineMath  -> \"$\"\n\ninlineToDokuWiki opts il@(RawInline f str)\n  | f == Format \"dokuwiki\" = return str\n  | f == Format \"html\"\n  , isEnabled Ext_raw_html opts = return $ \"<html>\" <> str <> \"</html>\"\n  | otherwise              = \"\" <$ report (InlineNotRendered il)\n\ninlineToDokuWiki _ LineBreak = do\n  backSlash <- asks stBackSlashLB\n  return $ if backSlash\n           then \"\\n\"\n           else \"\\\\\\\\\\n\"\n\ninlineToDokuWiki opts SoftBreak =\n  case writerWrapText opts of\n       WrapNone     -> return \" \"\n       WrapAuto     -> return \" \"\n       WrapPreserve -> return \"\\n\"\n\ninlineToDokuWiki _ Space = return \" \"\n\ninlineToDokuWiki opts (Link _ txt (src, _)) = do\n  label <- inlineListToDokuWiki opts txt\n  case txt of\n     [Str s] | \"mailto:\" `T.isPrefixOf` src -> return $ \"<\" <> s <> \">\"\n             | escapeURI s == src -> return src\n     _  -> if isURI src\n              then return $ \"[[\" <> src  <> \"|\" <> label <> \"]]\"\n              else return $ \"[[\" <> src' <> \"|\" <> label <> \"]]\"\n                     where src' = case T.uncons src of\n                                     Just ('/',xs) -> xs  -- with leading / it's a\n                                     _             -> src -- link to a help page\ninlineToDokuWiki opts (Image attr alt (source, tit)) = do\n  alt' <- inlineListToDokuWiki opts alt\n  let txt = case (tit, alt) of\n              (\"\", []) -> \"\"\n              (\"\", _ ) -> \"|\" <> alt'\n              (_ , _ ) -> \"|\" <> tit\n  return $ \"{{\" <> source <> imageDims opts attr <> txt <> \"}}\"\n\ninlineToDokuWiki opts (Note contents) = do\n  contents' <- local (\\st -> st{ stBlockQuoteLevel = 0 })\n                 (blockListToDokuWiki opts contents)\n  return $ \"((\" <> contents' <> \"))\"\n  -- note - may not work for notes with multiple blocks\n\nimageDims :: WriterOptions -> Attr -> Text\nimageDims opts attr = go (toPx $ dimension Width attr) (toPx $ dimension Height attr)\n  where\n    toPx = fmap (showInPixel opts) . checkPct\n    checkPct (Just (Percent _)) = Nothing\n    checkPct maybeDim           = maybeDim\n    go (Just w) Nothing  = \"?\" <> w\n    go (Just w) (Just h) = \"?\" <> w <> \"x\" <> h\n    go Nothing  (Just h) = \"?0x\" <> h\n    go Nothing  Nothing  = \"\"\n\nlanguageNames :: M.Map Text Text\nlanguageNames = M.fromList\n  [(\"cs\", \"csharp\")\n  ,(\"coffee\", \"cofeescript\")\n  ,(\"commonlisp\", \"lisp\")\n  ,(\"gcc\", \"c\")\n  ,(\"html\", \"html5\")\n  ,(\"makefile\", \"make\")\n  ,(\"objectivec\", \"objc\")\n  ,(\"r\", \"rsplus\")\n  ,(\"sqlmysql\", \"mysql\")\n  ,(\"sqlpostgresql\", \"postgresql\")\n  ,(\"sci\", \"scilab\")\n  ,(\"xorg\", \"xorgconf\")\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/EPUB.hs",
    "content": "{-# LANGUAGE CPP                 #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE PatternGuards       #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Writers.EPUB\n   Copyright   : Copyright (C) 2010-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to EPUB.\n-}\nmodule Text.Pandoc.Writers.EPUB ( writeEPUB2, writeEPUB3 ) where\nimport Codec.Archive.Zip (Entry, addEntryToArchive, eRelativePath, emptyArchive,\n                          fromArchive, fromEntry, toEntry)\nimport Control.Applicative ( (<|>) )\nimport Control.Monad (mplus, unless, when, zipWithM)\nimport Control.Monad.Except (catchError, throwError)\nimport Control.Monad.State.Strict (State, StateT, evalState, evalStateT, get,\n                                   gets, lift, modify)\nimport qualified Data.ByteString.Lazy as B\nimport qualified Data.ByteString.Lazy.Char8 as B8\nimport Data.Char (isAlphaNum, isAscii, isDigit)\nimport Data.List (isInfixOf, isPrefixOf)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, isNothing, mapMaybe, isJust, catMaybes)\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport qualified Data.Text.Lazy as TL\nimport System.FilePath (takeExtension, takeFileName, makeRelative)\nimport Text.HTML.TagSoup (Tag (TagOpen), fromAttrib, parseTags)\nimport Text.Pandoc.Builder (fromList, setMeta)\nimport Text.Pandoc.Writers.Shared (ensureValidXmlIdentifiers)\nimport Data.Tree (Tree(..))\nimport Text.Pandoc.Class (PandocMonad, report)\nimport qualified Text.Pandoc.Class.PandocPure as P\nimport Text.Pandoc.Data (readDataFile)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Data.Time\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.MIME (MimeType, extensionFromMimeType, getMimeType)\nimport Text.Pandoc.URI (urlEncode)\nimport Text.Pandoc.Options (EPUBVersion (..), HTMLMathMethod (..),\n                            ObfuscationMethod (NoObfuscation), WrapOption (..),\n                            WriterOptions (..))\nimport Text.Pandoc.Shared (normalizeDate, renderTags',\n                           stringify, uniqueIdent, tshow)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.UUID (getRandomUUID)\nimport Text.Pandoc.Walk (walk, walkM)\nimport Text.Pandoc.Writers.HTML (writeHtmlStringForEPUB)\nimport Text.Printf (printf)\nimport Text.Pandoc.XML.Light\nimport Text.Pandoc.XML (escapeStringForXML)\nimport Text.DocTemplates (FromContext(lookupContext), Context(..),\n                          ToContext(toVal), Val(..))\nimport Text.Pandoc.Chunks (splitIntoChunks, Chunk(..), ChunkedDoc(..),\n                           SecInfo(..))\n\n-- A Chapter includes a list of blocks.\nnewtype Chapter = Chapter [Block]\n  deriving (Show)\n\ndata EPUBState = EPUBState {\n        stMediaPaths  :: [(FilePath, (FilePath, Maybe Entry))]\n      , stMediaNextId :: Int\n      , stEpubSubdir  :: FilePath\n      }\n\ntype E m = StateT EPUBState m\n\ndata EPUBMetadata = EPUBMetadata{\n    epubIdentifier          :: [Identifier]\n  , epubTitle               :: [Title]\n  , epubDate                :: [Date]\n  , epubLanguage            :: Text\n  , epubCreator             :: [Creator]\n  , epubContributor         :: [Creator]\n  , epubSubject             :: [Subject]\n  , epubDescription         :: Maybe Text\n  , epubType                :: Maybe Text\n  , epubFormat              :: Maybe Text\n  , epubPublisher           :: Maybe Text\n  , epubSource              :: Maybe Text\n  , epubRelation            :: Maybe Text\n  , epubCoverage            :: Maybe Text\n  , epubRights              :: Maybe Text\n  , epubBelongsToCollection :: Maybe Text\n  , epubGroupPosition       :: Maybe Text\n  , epubCoverImage          :: Maybe FilePath\n  , epubStylesheets         :: [FilePath]\n  , epubPageDirection       :: Maybe ProgressionDirection\n  , epubIbooksFields        :: [(Text, Text)]\n  , epubCalibreFields       :: [(Text, Text)]\n  , epubAccessModes         :: [Text] -- https://kb.daisy.org/publishing/docs/metadata/schema.org/accessMode.html\n  , epubAccessModeSufficient :: [Text] -- https://kb.daisy.org/publishing/docs/metadata/schema.org/accessModeSufficient.html\n  , epubAccessibilityFeatures :: [Text]  -- https://kb.daisy.org/publishing/docs/metadata/schema.org/accessibilityFeature.html\n  , epubAccessibilityHazards :: [Text] -- https://kb.daisy.org/publishing/docs/metadata/schema.org/accessibilityHazard.html\n  , epubAccessibilitySummary :: Maybe Text -- https://kb.daisy.org/publishing/docs/metadata/schema.org/accessibilitySummary.html\n  } deriving Show\n\ndata Date = Date{\n    dateText  :: Text\n  , dateEvent :: Maybe Text\n  } deriving Show\n\ndata Creator = Creator{\n    creatorText   :: Text\n  , creatorRole   :: Maybe Text\n  , creatorFileAs :: Maybe Text\n  } deriving Show\n\ndata Identifier = Identifier{\n    identifierText   :: Text\n  , identifierScheme :: Maybe Text\n  } deriving Show\n\ndata Title = Title{\n    titleText   :: Text\n  , titleFileAs :: Maybe Text\n  , titleType   :: Maybe Text\n  } deriving Show\n\ndata ProgressionDirection = LTR | RTL deriving Show\n\ndata Subject = Subject{\n    subjectText      :: Text\n  , subjectAuthority :: Maybe Text\n  , subjectTerm      :: Maybe Text\n  } deriving Show\n\ndcName :: Text -> QName\ndcName n = QName n Nothing (Just \"dc\")\n\ndcNode :: Node t => Text -> t -> Element\ndcNode = node . dcName\n\nopfName :: Text -> QName\nopfName n = QName n Nothing (Just \"opf\")\n\ntoId :: FilePath -> Text\ntoId = T.pack .\n       map (\\x -> if isAlphaNum x || x == '-' || x == '_'\n                     then x\n                     else '_') . takeFileName\n\nremoveNote :: Inline -> Inline\nremoveNote (Note _) = Str \"\"\nremoveNote x        = x\n\ntoVal' :: Text -> Val T.Text\ntoVal' = toVal\n\nmkEntry :: PandocMonad m => FilePath -> B.ByteString -> E m Entry\nmkEntry path content = do\n  epubSubdir <- gets stEpubSubdir\n  let addEpubSubdir :: Entry -> Entry\n      addEpubSubdir e = e{ eRelativePath =\n          (if null epubSubdir\n              then \"\"\n              else epubSubdir ++ \"/\") ++ eRelativePath e }\n  epochtime <- floor <$> lift P.getPOSIXTime\n  return $\n       (if path == \"mimetype\" || \"META-INF\" `isPrefixOf` path\n           then id\n           else addEpubSubdir) $ toEntry path epochtime content\n\ngetEPUBMetadata :: PandocMonad m => WriterOptions -> Meta -> E m EPUBMetadata\ngetEPUBMetadata opts meta = do\n  let md = metadataFromMeta opts meta\n  elts <- case writerEpubMetadata opts of\n            Nothing -> return []\n            Just t -> case parseXMLContents (TL.fromStrict t) of\n                          Left msg -> throwError $\n                            PandocXMLError \"epub metadata\" msg\n                          Right ns -> return (onlyElems ns)\n  let md' = foldr addMetadataFromXML md elts\n  let addIdentifier m =\n       if null (epubIdentifier m)\n          then do\n            randomId <- getRandomUUID\n            return $ m{ epubIdentifier = [Identifier (tshow randomId) Nothing] }\n          else return m\n  let addLanguage m =\n       if T.null (epubLanguage m)\n          then case lookupContext \"lang\" (writerVariables opts) of\n                     Just x  -> return m{ epubLanguage = x }\n                     Nothing -> do\n                       mLang <- lift $ P.lookupEnv \"LANG\"\n                       let localeLang =\n                             case mLang of\n                               Just lang ->\n                                 T.map (\\c -> if c == '_' then '-' else c) $\n                                 T.takeWhile (/='.') lang\n                               Nothing -> \"en-US\"\n                       return m{ epubLanguage = localeLang }\n          else return m\n  let fixDate m =\n       if null (epubDate m)\n          then do\n            currentTime <- lift P.getTimestamp\n            return $ m{ epubDate = [ Date{\n                             dateText = showDateTimeISO8601 currentTime\n                           , dateEvent = Nothing } ] }\n          else return m\n  let addAuthor m =\n       if any (\\c -> creatorRole c == Just \"aut\") $ epubCreator m\n          then return m\n          else do\n            let authors' = map stringify $ docAuthors meta\n            let toAuthor name = Creator{ creatorText = name\n                                       , creatorRole = Just \"aut\"\n                                       , creatorFileAs = Nothing }\n            return $ m{ epubCreator = map toAuthor authors' ++ epubCreator m }\n  addIdentifier md' >>= fixDate >>= addAuthor >>= addLanguage\n\naddMetadataFromXML :: Element -> EPUBMetadata -> EPUBMetadata\naddMetadataFromXML e@(Element (QName name _ (Just \"dc\")) attrs _ _) md\n  | name == \"identifier\" = md{ epubIdentifier =\n             Identifier{ identifierText = strContent e\n                       , identifierScheme = lookupAttr (opfName \"scheme\") attrs\n                       } : epubIdentifier md }\n  | name == \"title\" = md{ epubTitle =\n            Title{ titleText = strContent e\n                 , titleFileAs = getAttr \"file-as\"\n                 , titleType = getAttr \"type\"\n                 } : epubTitle md }\n  | name == \"date\" = md{ epubDate =\n             Date{ dateText = fromMaybe \"\" $ normalizeDate' $ strContent e\n                 , dateEvent = getAttr \"event\"\n                 } : epubDate md }\n  | name == \"language\" = md{ epubLanguage = strContent e }\n  | name == \"creator\" = md{ epubCreator =\n              Creator{ creatorText = strContent e\n                     , creatorRole = getAttr \"role\"\n                     , creatorFileAs = getAttr \"file-as\"\n                     } : epubCreator md }\n  | name == \"contributor\" = md{ epubContributor =\n              Creator  { creatorText = strContent e\n                       , creatorRole = getAttr \"role\"\n                       , creatorFileAs = getAttr \"file-as\"\n                       } : epubContributor md }\n  | name == \"subject\" = md{ epubSubject =\n              Subject  { subjectText = strContent e\n                       , subjectAuthority = getAttr \"authority\"\n                       , subjectTerm = getAttr \"term\"\n                       } : epubSubject md }\n  | name == \"description\" = md { epubDescription = Just $ strContent e }\n  | name == \"type\" = md { epubType = Just $ strContent e }\n  | name == \"format\" = md { epubFormat = Just $ strContent e }\n  | name == \"publisher\" = md { epubPublisher = Just $ strContent e }\n  | name == \"source\" = md { epubSource = Just $ strContent e }\n  | name == \"relation\" = md { epubRelation = Just $ strContent e }\n  | name == \"coverage\" = md { epubCoverage = Just $ strContent e }\n  | name == \"rights\" = md { epubRights = Just $ strContent e }\n  | name == \"belongs-to-collection\" = md { epubBelongsToCollection = Just $ strContent e }\n  | name == \"group-position\" = md { epubGroupPosition = Just $ strContent e }\n  | otherwise = md\n  where getAttr n = lookupAttr (opfName n) attrs\naddMetadataFromXML e@(Element (QName \"meta\" _ _) attrs _ _) md =\n  case getAttr \"property\" `mplus` getAttr \"name\" of\n       Just s | \"ibooks:\" `T.isPrefixOf` s ->\n                md{ epubIbooksFields = (T.drop 7 s, strContent e) :\n                       epubIbooksFields md }\n              | \"calibre:\" `T.isPrefixOf` s ->\n                   md{ epubCalibreFields =\n                         (T.drop 8 s, fromMaybe \"\" $ getAttr \"content\") :\n                          epubCalibreFields md }\n       _ -> md\n  where getAttr n = lookupAttr (unqual n) attrs\naddMetadataFromXML _ md = md\n\nmetaValueToString :: MetaValue -> Text\nmetaValueToString (MetaString s)    = s\nmetaValueToString (MetaInlines ils) = stringify ils\nmetaValueToString (MetaBlocks bs)   = stringify bs\nmetaValueToString (MetaBool True)   = \"true\"\nmetaValueToString (MetaBool False)  = \"false\"\nmetaValueToString _                 = \"\"\n\nmetaValueToPaths :: MetaValue -> [FilePath]\nmetaValueToPaths (MetaList xs) = map (T.unpack . metaValueToString) xs\nmetaValueToPaths x             = [T.unpack $ metaValueToString x]\n\ngetList :: T.Text -> Meta -> (MetaValue -> a) -> [a]\ngetList s meta handleMetaValue =\n  case lookupMeta s meta of\n       Just (MetaList xs) -> map handleMetaValue xs\n       Just mv            -> [handleMetaValue mv]\n       Nothing            -> []\n\ngetIdentifier :: Meta -> [Identifier]\ngetIdentifier meta = getList \"identifier\" meta handleMetaValue\n  where handleMetaValue (MetaMap m) =\n           Identifier{ identifierText = maybe \"\" metaValueToString\n                                        $ M.lookup \"text\" m\n                     , identifierScheme = metaValueToString <$>\n                                          M.lookup \"scheme\" m }\n        handleMetaValue mv = Identifier (metaValueToString mv) Nothing\n\ngetTitle :: Meta -> [Title]\ngetTitle meta = getList \"title\" meta handleMetaValue\n  where handleMetaValue (MetaMap m) =\n           Title{ titleText = maybe \"\" metaValueToString $ M.lookup \"text\" m\n                , titleFileAs = metaValueToString <$> M.lookup \"file-as\" m\n                , titleType = metaValueToString <$> M.lookup \"type\" m }\n        handleMetaValue mv = Title (metaValueToString mv) Nothing Nothing\n\ngetCreator :: T.Text -> Meta -> [Creator]\ngetCreator s meta = getList s meta handleMetaValue\n  where handleMetaValue (MetaMap m) =\n           Creator{ creatorText = maybe \"\" metaValueToString $ M.lookup \"text\" m\n                  , creatorFileAs = metaValueToString <$> M.lookup \"file-as\" m\n                  , creatorRole = metaValueToString <$> M.lookup \"role\" m }\n        handleMetaValue mv = Creator (metaValueToString mv) Nothing Nothing\n\ngetDate :: T.Text -> Meta -> [Date]\ngetDate s meta = getList s meta handleMetaValue\n  where handleMetaValue (MetaMap m) =\n           Date{ dateText = fromMaybe \"\" $\n                   M.lookup \"text\" m >>= normalizeDate' . metaValueToString\n               , dateEvent = metaValueToString <$> M.lookup \"event\" m }\n        handleMetaValue mv = Date { dateText = fromMaybe \"\" $ normalizeDate' $ metaValueToString mv\n                                  , dateEvent = Nothing }\n\ngetSubject :: T.Text -> Meta -> [Subject]\ngetSubject s meta = getList s meta handleMetaValue\n  where handleMetaValue (MetaMap m) =\n           Subject{ subjectText = maybe \"\" metaValueToString $ M.lookup \"text\" m\n                  , subjectAuthority = metaValueToString <$> M.lookup \"authority\" m\n                  , subjectTerm = metaValueToString <$> M.lookup \"term\" m }\n        handleMetaValue mv = Subject (metaValueToString mv) Nothing Nothing\n\nmetadataFromMeta :: WriterOptions -> Meta -> EPUBMetadata\nmetadataFromMeta opts meta = EPUBMetadata{\n      epubIdentifier           = identifiers\n    , epubTitle                = titles\n    , epubDate                 = date\n    , epubLanguage             = language\n    , epubCreator              = creators\n    , epubContributor          = contributors\n    , epubSubject              = subjects\n    , epubDescription          = description\n    , epubType                 = epubtype\n    , epubFormat               = format\n    , epubPublisher            = publisher\n    , epubSource               = source\n    , epubRelation             = relation\n    , epubCoverage             = coverage\n    , epubRights               = rights\n    , epubBelongsToCollection  = belongsToCollection\n    , epubGroupPosition        = groupPosition\n    , epubCoverImage           = coverImage\n    , epubStylesheets          = stylesheets\n    , epubPageDirection        = pageDirection\n    , epubIbooksFields         = ibooksFields\n    , epubCalibreFields        = calibreFields\n    , epubAccessModes          = accessModes\n    , epubAccessModeSufficient = accessModeSufficient\n    , epubAccessibilityFeatures = accessibilityFeatures\n    , epubAccessibilityHazards = accessibilityHazards\n    , epubAccessibilitySummary = accessibilitySummary\n    }\n  where identifiers = getIdentifier meta\n        titles = getTitle meta\n        date = getDate \"date\" meta\n        language = maybe \"\" metaValueToString $\n           lookupMeta \"language\" meta `mplus` lookupMeta \"lang\" meta\n        creators = getCreator \"creator\" meta\n        contributors = getCreator \"contributor\" meta\n        subjects = getSubject \"subject\" meta\n        description = metaValueToString <$> lookupMeta \"description\" meta\n        epubtype = metaValueToString <$> lookupMeta \"type\" meta\n        format = metaValueToString <$> lookupMeta \"format\" meta\n        publisher = metaValueToString <$> lookupMeta \"publisher\" meta\n        source = metaValueToString <$> lookupMeta \"source\" meta\n        relation = metaValueToString <$> lookupMeta \"relation\" meta\n        coverage = metaValueToString <$> lookupMeta \"coverage\" meta\n        rights = metaValueToString <$> lookupMeta \"rights\" meta\n        belongsToCollection = metaValueToString <$> lookupMeta \"belongs-to-collection\" meta\n        groupPosition = metaValueToString <$> lookupMeta \"group-position\" meta\n        coverImage = T.unpack <$>\n            lookupContext \"epub-cover-image\" (writerVariables opts)\n            `mplus` (metaValueToString <$> lookupMeta \"cover-image\" meta)\n        mCss = lookupMeta \"css\" meta <|> lookupMeta \"stylesheet\" meta\n        stylesheets = maybe [] metaValueToPaths mCss ++\n                      case lookupContext \"css\" (writerVariables opts) of\n                         Just xs -> map T.unpack xs\n                         Nothing ->\n                           case lookupContext \"css\" (writerVariables opts) of\n                             Just x  -> [T.unpack x]\n                             Nothing -> []\n        pageDirection = case T.toLower . metaValueToString <$>\n                             lookupMeta \"page-progression-direction\" meta of\n                              Just \"ltr\" -> Just LTR\n                              Just \"rtl\" -> Just RTL\n                              _          -> Nothing\n        ibooksFields = case lookupMeta \"ibooks\" meta of\n                            Just (MetaMap mp)\n                               -> M.toList $ M.map metaValueToString mp\n                            _  -> []\n        calibreFields = case lookupMeta \"calibre\" meta of\n                            Just (MetaMap mp)\n                               -> M.toList $ M.map metaValueToString mp\n                            _  -> []\n        accessModes = case lookupMeta \"accessModes\" meta of\n                         Just (MetaList xs) -> map metaValueToString xs\n                         _ -> [\"textual\"]\n        accessModeSufficient = case lookupMeta \"accessModeSufficient\" meta of\n                         Just (MetaList xs) -> map metaValueToString xs\n                         _ -> [\"textual\"]\n        accessibilityFeatures =\n                      case lookupMeta \"accessibilityFeatures\" meta of\n                         Just (MetaList xs) -> map metaValueToString xs\n                         _ -> [\"alternativeText\", \"readingOrder\",\n                               \"structuralNavigation\", \"tableOfContents\"]\n        accessibilityHazards =\n                       case lookupMeta \"accessibilityHazards\" meta of\n                         Just (MetaList xs) -> map metaValueToString xs\n                         _ -> [\"none\"]\n        accessibilitySummary = metaValueToString <$> lookupMeta \"accessibilitySummary\" meta\n\n-- | Produce an EPUB2 file from a Pandoc document.\nwriteEPUB2 :: PandocMonad m\n          => WriterOptions  -- ^ Writer options\n          -> Pandoc         -- ^ Document to convert\n          -> m B.ByteString\nwriteEPUB2 = writeEPUB EPUB2\n\n-- | Produce an EPUB3 file from a Pandoc document.\nwriteEPUB3 :: PandocMonad m\n          => WriterOptions  -- ^ Writer options\n          -> Pandoc         -- ^ Document to convert\n          -> m B.ByteString\nwriteEPUB3 = writeEPUB EPUB3\n\n-- | Produce an EPUB file from a Pandoc document.\nwriteEPUB :: PandocMonad m\n          => EPUBVersion\n          -> WriterOptions  -- ^ Writer options\n          -> Pandoc         -- ^ Document to convert\n          -> m B.ByteString\nwriteEPUB epubVersion opts doc = do\n  let epubSubdir = writerEpubSubdirectory opts\n  -- sanity check on epubSubdir\n  unless (T.all (\\c -> isAscii c && isAlphaNum c) epubSubdir) $\n    throwError $ PandocEpubSubdirectoryError epubSubdir\n  let initState = EPUBState { stMediaPaths = []\n                            , stMediaNextId = 0\n                            , stEpubSubdir = T.unpack epubSubdir }\n  evalStateT (pandocToEPUB epubVersion opts doc) initState\n\npandocToEPUB :: PandocMonad m\n             => EPUBVersion\n             -> WriterOptions\n             -> Pandoc\n             -> E m B.ByteString\npandocToEPUB version opts doc = do\n  let doc' = ensureValidXmlIdentifiers doc\n  -- handle pictures\n  Pandoc meta blocks <- walkM (transformInline opts) doc' >>=\n                        walkM transformBlock\n  picEntries <- mapMaybe (snd . snd) <$> gets stMediaPaths\n\n  epubSubdir <- gets stEpubSubdir\n  let epub3 = version == EPUB3\n\n  let writeHtml o = fmap (UTF8.fromTextLazy . TL.fromStrict) .\n                      writeHtmlStringForEPUB version o\n  metadata <- getEPUBMetadata opts meta\n\n  -- retrieve title of document\n  let plainTitle :: Text\n      plainTitle = case docTitle' meta of\n                        [] -> case epubTitle metadata of\n                                   []    -> \"UNTITLED\"\n                                   (x:_) -> titleText x\n                        x  -> stringify x\n\n  -- stylesheet\n  stylesheets <- case epubStylesheets metadata of\n                      [] -> (\\x -> [B.fromChunks [x]]) <$>\n                               readDataFile \"epub.css\"\n                      fs -> mapM P.readFileLazy fs\n  stylesheetEntries <- zipWithM\n        (\\bs n -> mkEntry (\"styles/stylesheet\" ++ show n ++ \".css\") bs)\n        stylesheets [(1 :: Int)..]\n\n  -- writer variables\n  let vars :: Context Text\n      vars = Context $\n               M.delete \"css\" .\n               M.insert \"epub3\"\n                 (toVal' $ if epub3 then \"true\" else \"false\") .\n               M.insert \"lang\" (toVal' $ epubLanguage metadata)\n             $ unContext $ writerVariables opts\n\n  -- If True create paths relative to parent folder\n  let cssvars :: Bool -> Context Text\n      cssvars useprefix = Context $ M.insert \"css\"\n                           (ListVal $ map\n                             (\\e -> toVal' $\n                                (if useprefix then \"../\" else \"\") <>\n                                T.pack\n                                 (makeRelative epubSubdir (eRelativePath e)))\n                             stylesheetEntries)\n                             mempty\n\n  -- Add additional options for the writer\n  let opts' :: WriterOptions\n      opts' = opts{ writerEmailObfuscation = NoObfuscation\n                  , writerSectionDivs = True\n                  , writerVariables = vars\n                  , writerWrapText = WrapAuto }\n\n  -- cover page\n  (cpgEntry, cpicEntry, mbCoverImageName) <-\n    createCoverPage meta metadata opts' vars cssvars writeHtml plainTitle\n\n  -- title page\n  tpContent <- lift $ writeHtml opts'{\n                                  writerVariables =\n                                      Context (M.fromList [\n                                        (\"titlepage\", toVal' \"true\"),\n                                        (\"body-type\",  toVal' \"frontmatter\"),\n                                        (\"pagetitle\", toVal $\n                                            escapeStringForXML plainTitle)])\n                                      <> cssvars True <> vars }\n                               (Pandoc meta [])\n  tpEntry <- mkEntry \"text/title_page.xhtml\" tpContent\n\n\n  -- handle fonts\n  let matchingGlob f = do\n        xs <- lift $ P.glob f\n        when (null xs) $\n          report $ CouldNotFetchResource (T.pack f) \"glob did not match any font files\"\n        return xs\n\n  let mkFontEntry :: PandocMonad m => FilePath -> StateT EPUBState m Entry\n      mkFontEntry f = mkEntry (\"fonts/\" ++ takeFileName f) =<<\n                        lift (P.readFileLazy f)\n  fontFiles <- concat <$> mapM matchingGlob (writerEpubFonts opts')\n  fontEntries <- mapM mkFontEntry fontFiles\n\n  -- body pages\n\n  -- add level 1 header to beginning if none there\n  let blocks' = addIdentifiers opts\n                $ case blocks of\n                    (Div _\n                      (Header{}:_) : _) -> blocks\n                    (Header 1 _ _ : _)  -> blocks\n                    _                   -> Header 1 (\"\",[\"unnumbered\"],[])\n                                               (docTitle' meta) : blocks\n\n  -- create the chapters\n  let chunkedDoc = splitIntoChunks \"ch%n.xhtml\"\n                     (writerNumberSections opts)\n                     Nothing\n                     (writerSplitLevel opts)\n                     (Pandoc meta blocks')\n\n\n  -- Create the chapter entries from the chapters.\n  -- Also requires access to the extended writer options and context\n  -- as well as the css Context and html writer\n  chapterEntries <- createChapterEntries opts' vars cssvars writeHtml\n                      (chunkedChunks chunkedDoc)\n\n\n\n  -- contents.opf\n\n  -- set page progression direction attribution\n  let progressionDirection :: [(Text, Text)]\n      progressionDirection = case epubPageDirection metadata of\n                                  Just LTR | epub3 ->\n                                    [(\"page-progression-direction\", \"ltr\")]\n                                  Just RTL | epub3 ->\n                                    [(\"page-progression-direction\", \"rtl\")]\n                                  _  -> []\n\n  -- incredibly inefficient (TODO):\n  let containsMathML ent = epub3 &&\n                           \"<math\" `isInfixOf`\n        B8.unpack (fromEntry ent)\n  let containsSVG ent    = epub3 &&\n                           \"<svg\" `isInfixOf`\n        B8.unpack (fromEntry ent)\n  let props ent = [\"mathml\" | containsMathML ent] ++ [\"svg\" | containsSVG ent]\n\n  let chapterNode ent = unode \"item\" !\n                           ([(\"id\", toId $ makeRelative epubSubdir\n                                         $ eRelativePath ent),\n                             (\"href\", T.pack $ makeRelative epubSubdir\n                                      $ eRelativePath ent),\n                             (\"media-type\", \"application/xhtml+xml\")]\n                            ++ case props ent of\n                                    [] -> []\n                                    xs -> [(\"properties\", T.unwords xs)])\n                        $ ()\n\n  let chapterRefNode ent = unode \"itemref\" !\n                             [(\"idref\", toId $ makeRelative epubSubdir\n                                             $ eRelativePath ent)] $ ()\n  let pictureNode ent = unode \"item\" !\n                           [(\"id\", toId $ makeRelative epubSubdir\n                                        $ eRelativePath ent),\n                            (\"href\", T.pack $ makeRelative epubSubdir\n                                     $ eRelativePath ent),\n                            (\"media-type\",\n                               fromMaybe \"application/octet-stream\"\n                               $ mediaTypeOf $ eRelativePath ent)] $ ()\n  let fontNode ent = unode \"item\" !\n                           [(\"id\", toId $ makeRelative epubSubdir\n                                        $ eRelativePath ent),\n                            (\"href\", T.pack $ makeRelative epubSubdir\n                                     $ eRelativePath ent),\n                            (\"media-type\", fromMaybe \"\" $\n                                  getMimeType $ eRelativePath ent)] $ ()\n\n  -- The tocTitle is either the normal title or a specially configured title.\n  let tocTitle = maybe plainTitle\n                   metaValueToString $ lookupMeta \"toc-title\" meta\n  currentTime <- lift P.getTimestamp\n\n  -- Construct the contentsData\n  let contentsData = UTF8.fromTextLazy $ TL.fromStrict $ ppTopElement $\n        unode \"package\" !\n          ([(\"version\", case version of\n                             EPUB2 -> \"2.0\"\n                             EPUB3 -> \"3.0\")\n           ,(\"xmlns\",\"http://www.idpf.org/2007/opf\")] ++\n           [(\"xml:lang\", epubLanguage metadata) | version == EPUB3] ++\n           [(\"unique-identifier\",\"epub-id-1\")] ++\n           [(\"prefix\",\"ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/\") | version == EPUB3]) $\n          [ metadataElement version metadata mbCoverImageName currentTime\n          , unode \"manifest\" $\n             [ unode \"item\" ! [(\"id\",\"ncx\"), (\"href\",\"toc.ncx\")\n                              ,(\"media-type\",\"application/x-dtbncx+xml\")] $ ()\n             , unode \"item\" ! ([(\"id\",\"nav\")\n                               ,(\"href\",\"nav.xhtml\")\n                               ,(\"media-type\",\"application/xhtml+xml\")] ++\n                               [(\"properties\",\"nav\") | epub3 ]) $ ()\n             ] ++\n             [ unode \"item\" ! [(\"id\",\"stylesheet\" <> tshow n)\n                              , (\"href\", T.pack fp)\n                              ,(\"media-type\",\"text/css\")] $ () |\n                             (n :: Int, fp) <- zip [1..] (map\n                               (makeRelative epubSubdir . eRelativePath)\n                               stylesheetEntries) ] ++\n             map chapterNode (cpgEntry ++\n                               [tpEntry | writerEpubTitlePage opts] ++\n                               chapterEntries) ++\n             (case cpicEntry of\n                    []    -> []\n                    (x:_) -> [add_attrs\n                              [Attr (unqual \"properties\") \"cover-image\" | epub3]\n                              (pictureNode x)]) ++\n             map pictureNode picEntries ++\n             map fontNode fontEntries\n          , unode \"spine\" ! (\n             (\"toc\",\"ncx\") : progressionDirection) $\n              case epubCoverImage metadata of\n                    Nothing -> []\n                    Just _ -> [ unode \"itemref\" !\n                                [(\"idref\", \"cover_xhtml\")] $ () ]\n              ++ ([unode \"itemref\" ! [(\"idref\", \"title_page_xhtml\")\n                                     ,(\"linear\",\n                                         case lookupMeta \"title\" meta of\n                                               Just _  -> \"yes\"\n                                               Nothing -> \"no\")] $ ()\n                     | writerEpubTitlePage opts] ++\n                  [unode \"itemref\" ! [(\"idref\", \"nav\")] $ ()\n                         | writerTableOfContents opts ] ++\n                  map chapterRefNode chapterEntries)\n          , unode \"guide\" $\n             (unode \"reference\" !\n                 [(\"type\",\"toc\"),(\"title\", tocTitle),\n                  (\"href\",\"nav.xhtml\")] $ ()\n             ) :\n             [ unode \"reference\" !\n                   [(\"type\",\"cover\")\n                   ,(\"title\",\"Cover\")\n                   ,(\"href\",\"text/cover.xhtml\")] $ ()\n               | isJust (epubCoverImage metadata)\n             ]\n          ]\n  -- Content should be stored in content.opf\n  contentsEntry <- mkEntry \"content.opf\" contentsData\n\n  -- toc.ncx\n  -- Create the tocEntry from the metadata together with the sections and title.\n  tocEntry <- createTocEntry opts' meta metadata plainTitle\n                (chunkedTOC chunkedDoc)\n\n  -- Create the navEntry using the metadata, all of the various writer options,\n  -- the CSS and HTML helpers, the document and toc title as well as the epub version and all of the sections\n  navEntry <- createNavEntry opts' meta metadata vars cssvars\n                writeHtml tocTitle version (chunkedTOC chunkedDoc)\n\n  -- mimetype\n  mimetypeEntry <- mkEntry \"mimetype\" $\n                        UTF8.fromStringLazy \"application/epub+zip\"\n\n  -- container.xml\n  let containerData = B.fromStrict $ UTF8.fromText $ ppTopElement $\n       unode \"container\" ! [(\"version\",\"1.0\")\n              ,(\"xmlns\",\"urn:oasis:names:tc:opendocument:xmlns:container\")] $\n         unode \"rootfiles\" $\n           unode \"rootfile\" ! [(\"full-path\",\n                    (if null epubSubdir\n                        then \"\"\n                        else T.pack epubSubdir <> \"/\") <> \"content.opf\")\n               ,(\"media-type\",\"application/oebps-package+xml\")] $ ()\n  containerEntry <- mkEntry \"META-INF/container.xml\" containerData\n\n  -- com.apple.ibooks.display-options.xml\n  let apple = B.fromStrict $ UTF8.fromText $ ppTopElement $\n        unode \"display_options\" $\n          unode \"platform\" ! [(\"name\",\"*\")] $\n            unode \"option\" ! [(\"name\",\"specified-fonts\")] $ (\"true\" :: Text)\n  appleEntry <- mkEntry \"META-INF/com.apple.ibooks.display-options.xml\" apple\n\n  -- construct archive\n  let archive = foldr addEntryToArchive emptyArchive $\n                 [mimetypeEntry, containerEntry, appleEntry,\n                  contentsEntry, tocEntry, navEntry] ++\n                  [tpEntry | writerEpubTitlePage opts] ++\n                  stylesheetEntries ++ picEntries ++ cpicEntry ++\n                  cpgEntry ++ chapterEntries ++ fontEntries\n  return $ fromArchive archive\n\n-- | Function used during conversion from pandoc to EPUB to create the cover page.\n-- The first Entry list is for the cover while the second one is for the cover image.\n-- If no cover images are specified, empty lists will be returned.\n-- The third value of the returned tuple is the cover image name.\ncreateCoverPage :: PandocMonad m =>\n                   Meta\n                   -> EPUBMetadata\n                   -> WriterOptions\n                   -> Context Text\n                   -> (Bool -> Context Text)\n                   -> (WriterOptions -> Pandoc -> m B8.ByteString)\n                   -> Text\n                   -> StateT EPUBState m ([Entry], [Entry], Maybe FilePath)\ncreateCoverPage meta metadata opts' vars cssvars writeHtml plainTitle =\n    case epubCoverImage metadata of\n        Nothing   -> return ([],[], Nothing)\n        Just img  -> do\n          let fp = takeFileName img\n          -- retrieve cover image file\n          coverImageName <- getMediaNextNewName (takeExtension fp) -- see #4206\n          -- image dimensions\n          imgContent <- lift $ P.readFileLazy img\n          (coverImageWidth, coverImageHeight) <-\n                case imageSize opts' (B.toStrict imgContent) of\n                  Right sz  -> return $ sizeInPixels sz\n                  Left err' -> (0, 0) <$ report\n                    (CouldNotDetermineImageSize (T.pack img) err')\n          -- write the HTML. Use the cssvars, vars and additional writer options.\n          cpContent <- lift $ writeHtml\n                opts'{ writerVariables =\n                      Context (M.fromList [\n                        (\"coverpage\", toVal' \"true\"),\n                        (\"pagetitle\", toVal $\n                          escapeStringForXML plainTitle),\n                        (\"cover-image\",\n                          toVal' $ T.pack coverImageName),\n                        (\"cover-image-width\", toVal' $\n                          tshow coverImageWidth),\n                        (\"cover-image-height\", toVal' $\n                          tshow coverImageHeight)]) <>\n                        cssvars True <> vars }\n                (Pandoc meta [])\n\n          coverEntry <- mkEntry \"text/cover.xhtml\" cpContent\n          coverImageEntry <- mkEntry (\"media/\" ++ coverImageName)\n                                imgContent\n\n          return ( [ coverEntry ], [ coverImageEntry ], Just coverImageName )\n\n-- | Converts the given chapters to entries using the writeHtml function\n-- and the various provided options\ncreateChapterEntries :: PandocMonad m =>\n                            WriterOptions\n                            -> Context Text\n                            -> (Bool -> Context Text)\n                            -> (WriterOptions -> Pandoc -> StateT EPUBState m B8.ByteString)\n                            -> [Chunk]\n                            -> StateT EPUBState m [Entry]\ncreateChapterEntries opts' vars cssvars writeHtml chapters = do\n  -- Create an entry from the chapter with the provided number.\n  -- chapToEntry :: Int -> Chapter -> StateT EPUBState m Entry\n  let chapToEntry num chunk =\n        mkEntry (\"text/\" ++ chunkPath chunk) =<<\n        -- Combine all provided options\n        writeHtml opts'{ writerVariables =\n                            Context (M.fromList\n                                     [(\"body-type\", toVal' bodyType),\n                                      (\"pagetitle\", toVal' $\n                                           showChapter num)])\n                            <> cssvars True <> vars } pdoc\n         where bs = chunkContents chunk\n               meta' = setMeta \"title\" (fromList\n                         (walk removeNote\n                          (chunkHeading chunk))) nullMeta\n               (pdoc, bodyType) =\n                 case bs of\n                     (Div (_,\"section\":_,kvs) _ : _) ->\n                       -- remove notes or we get doubled footnotes\n                       (Pandoc meta' bs,\n                        -- Check if the chapters belongs to the frontmatter,\n                        -- backmatter of bodymatter defaulting to the body\n                        case lookup \"epub:type\" kvs of\n                             Nothing -> \"bodymatter\"\n                             Just x\n                               | x `elem` frontMatterTypes -> \"frontmatter\"\n                               | x `elem` backMatterTypes  -> \"backmatter\"\n                               | otherwise                 -> \"bodymatter\")\n                     _                   -> (Pandoc meta' bs, \"bodymatter\")\n               frontMatterTypes = [\"prologue\", \"abstract\", \"acknowledgments\",\n                                   \"copyright-page\", \"dedication\",\n                                   \"credits\", \"keywords\", \"imprint\",\n                                   \"contributors\", \"other-credits\",\n                                   \"errata\", \"revision-history\",\n                                   \"titlepage\", \"halftitlepage\", \"seriespage\",\n                                   \"foreword\", \"preface\", \"frontispiece\",\n                                   \"seriespage\", \"titlepage\"]\n               backMatterTypes = [\"appendix\", \"colophon\", \"bibliography\",\n                                  \"index\"]\n\n  zipWithM chapToEntry [1..] chapters\n\ncreateTocEntry :: PandocMonad m =>\n                  WriterOptions\n               -> Meta\n               -> EPUBMetadata\n               -> Text\n               -> Tree SecInfo\n               -> StateT EPUBState m Entry\ncreateTocEntry opts meta metadata plainTitle (Node _ secs) = do\n  let mkNavPoint :: Tree SecInfo -> State Int (Maybe Element)\n      mkNavPoint (Node secinfo subsecs)\n        | secLevel secinfo > writerTOCDepth opts = return Nothing\n        | otherwise = do\n          n <- get\n          modify (+ 1)\n          subs <- catMaybes <$> mapM mkNavPoint subsecs\n          let secnum' = case secNumber secinfo of\n                          Just t -> t <> \" \"\n                          Nothing -> \"\"\n          let title' = secnum' <> stringify (secTitle secinfo)\n          return $ Just $ unode \"navPoint\" !\n                   [(\"id\", \"navPoint-\" <> tshow n)] $\n                      [ unode \"navLabel\" $ unode \"text\" title'\n                      , unode \"content\" !\n                          [(\"src\", \"text/\" <> secPath secinfo)] $ ()\n                      ] ++ subs\n\n  let tpNode = unode \"navPoint\" !  [(\"id\", \"navPoint-0\")] $\n                  [ unode \"navLabel\" $ unode \"text\"\n                     (stringify $ docTitle' meta)\n                  , unode \"content\" ! [(\"src\", \"text/title_page.xhtml\")]\n                  $ () ]\n\n  let navMap = evalState (catMaybes <$> mapM mkNavPoint secs) 1\n\n  uuid <- case epubIdentifier metadata of\n          (x:_) -> return $ identifierText x  -- use first identifier as UUID\n          []    -> throwError $ PandocShouldNeverHappenError \"epubIdentifier is null\"  -- shouldn't happen\n  let tocData = B.fromStrict $ UTF8.fromText $ ppTopElement $\n        unode \"ncx\" ! [(\"version\",\"2005-1\")\n                       ,(\"xmlns\",\"http://www.daisy.org/z3986/2005/ncx/\")] $\n          [ unode \"head\" $\n             [ unode \"meta\" ! [(\"name\",\"dtb:uid\")\n                              ,(\"content\", uuid)] $ ()\n             , unode \"meta\" ! [(\"name\",\"dtb:depth\")\n                              ,(\"content\", \"1\")] $ ()\n             , unode \"meta\" ! [(\"name\",\"dtb:totalPageCount\")\n                              ,(\"content\", \"0\")] $ ()\n             , unode \"meta\" ! [(\"name\",\"dtb:maxPageNumber\")\n                              ,(\"content\", \"0\")] $ ()\n             ] ++ case epubCoverImage metadata of\n                        Nothing  -> []\n                        Just img -> [unode \"meta\" ! [(\"name\",\"cover\"),\n                                            (\"content\", toId img)] $ ()]\n          , unode \"docTitle\" $ unode \"text\" plainTitle\n          , unode \"navMap\" $ [tpNode | writerEpubTitlePage opts] ++ navMap\n          ]\n  mkEntry \"toc.ncx\" tocData\n\n\ncreateNavEntry  :: PandocMonad m\n                => WriterOptions\n                -> Meta\n                -> EPUBMetadata\n                -> Context Text\n                -> (Bool -> Context Text)\n                -> (WriterOptions -> Pandoc -> m B8.ByteString)\n                -> Text\n                -> EPUBVersion\n                -> Tree SecInfo\n                -> StateT EPUBState m Entry\ncreateNavEntry opts meta metadata\n               vars cssvars writeHtml tocTitle version (Node _ secs) = do\n  let mkItem :: Tree SecInfo -> State Int (Maybe Element)\n      mkItem (Node secinfo subsecs)\n        | secLevel secinfo > writerTOCDepth opts = return Nothing\n        | otherwise = do\n          n <- get\n          modify (+ 1)\n          subs <- catMaybes <$> mapM mkItem subsecs\n          let secnum' = case secNumber secinfo of\n                          Just num -> [Span (\"\", [\"section-header-number\"], [])\n                                       [Str num] , Str \"\\160\"]\n                          Nothing -> []\n          let title' = secnum' <> secTitle secinfo\n          -- can't have <a> elements inside generated links...\n          let clean (Link _ ils _) = Span (\"\", [], []) ils\n              clean (Note _)       = Str \"\"\n              clean x              = x\n          let titRendered = case P.runPure\n                                  (writeHtmlStringForEPUB version\n                                    opts{ writerTemplate = Nothing }\n                                    (Pandoc nullMeta\n                                      [Plain $ walk clean title'])) of\n                                  Left _  -> stringify title'\n                                  Right x -> x\n          let titElements = either (const []) id $\n                                  parseXMLContents (TL.fromStrict titRendered)\n\n          return $ Just $ unode \"li\" !\n                   [(\"id\", \"toc-li-\" <> tshow n)] $\n                      (unode \"a\" !\n                        [(\"href\", \"text/\" <> secPath secinfo)]\n                        $ titElements)\n                       : case subs of\n                           [] -> []\n                           (_:_) -> [unode \"ol\" ! [(\"class\",\"toc\")] $ subs]\n\n  let navtag = if version == EPUB3 then \"nav\" else \"div\"\n  let tocBlocks = evalState (catMaybes <$> mapM mkItem secs) 1\n  let navBlocks = [RawBlock (Format \"html\")\n                  $ showElement $ -- prettyprinting introduces bad spaces\n                   unode navtag ! ([(\"epub:type\",\"toc\") | version == EPUB3] ++\n                                   [(\"role\",\"doc-toc\") | version == EPUB3] ++\n                                   [(\"id\",\"toc\")]) $\n                    [ unode \"h1\" ! [(\"id\",\"toc-title\")] $ tocTitle\n                    , unode \"ol\" ! [(\"class\",\"toc\")] $ tocBlocks ]]\n  let landmarkItems = if version == EPUB3\n                         then [ unode \"li\"\n                                [ unode \"a\" ! [(\"href\",\n                                                  \"text/title_page.xhtml\")\n                                               ,(\"epub:type\", \"titlepage\")] $\n                                  (\"Title Page\" :: Text) ] |\n                                  writerEpubTitlePage opts ] ++\n                              [ unode \"li\"\n                                [ unode \"a\" ! [(\"href\", \"text/cover.xhtml\")\n                                              ,(\"epub:type\", \"cover\")] $\n                                  (\"Cover\" :: Text)] |\n                                  isJust (epubCoverImage metadata)\n                              ] ++\n                              [ unode \"li\"\n                                [ unode \"a\" ! [(\"href\", \"#toc\")\n                                              ,(\"epub:type\", \"toc\")] $\n                                    (\"Table of Contents\" :: Text)\n                                ] | writerTableOfContents opts\n                              ]\n                         else []\n  let landmarks = [RawBlock (Format \"html\") $ ppElement $\n                    unode \"nav\" ! [(\"epub:type\",\"landmarks\")\n                                  ,(\"id\",\"landmarks\")\n                                  ,(\"hidden\",\"hidden\")] $\n                    [ unode \"ol\" landmarkItems ]\n                  | not (null landmarkItems)]\n  navData <- lift $ writeHtml opts{ writerVariables =\n                     Context (M.fromList [(\"navpage\", toVal' \"true\")\n                                         ,(\"body-type\",  toVal' \"frontmatter\")\n                                         ])\n                     <> cssvars False <> vars }\n            (Pandoc (setMeta \"title\"\n                     (walk removeNote $ fromList $ docTitle' meta) nullMeta)\n               (navBlocks ++ landmarks))\n  -- Return\n  mkEntry \"nav.xhtml\" navData\n\nmetadataElement :: EPUBVersion -> EPUBMetadata -> Maybe FilePath -> UTCTime\n                -> Element\nmetadataElement version md mbCoverImage currentTime =\n  unode \"metadata\" ! [(\"xmlns:dc\",\"http://purl.org/dc/elements/1.1/\")\n                     ,(\"xmlns:opf\",\"http://www.idpf.org/2007/opf\")] $ mdNodes\n  where mdNodes = identifierNodes ++ titleNodes ++ dateNodes\n                  ++ languageNodes ++ ibooksNodes ++ calibreNodes\n                  ++ creatorNodes ++ contributorNodes ++ subjectNodes\n                  ++ descriptionNodes ++ typeNodes ++ formatNodes\n                  ++ publisherNodes ++ sourceNodes ++ relationNodes\n                  ++ coverageNodes ++ rightsNodes ++ coverImageNodes\n                  ++ modifiedNodes ++ belongsToCollectionNodes\n                  ++ case version of\n                       EPUB2 -> []\n                       EPUB3 -> accessModeNodes ++\n                                accessModeSufficientNodes ++\n                                accessibilityFeatureNodes ++\n                                accessibilityHazardNodes ++\n                                accessibilitySummaryNodes\n        metaprop = if version == EPUB2 then \"name\" else \"property\"\n        withIds base f = concat . zipWith f (map (\\x -> base <>\n                                                        T.cons '-' (tshow x))\n                         ([1..] :: [Int]))\n        identifierNodes = withIds \"epub-id\" toIdentifierNode $\n                          epubIdentifier md\n        titleNodes = withIds \"epub-title\" toTitleNode $ epubTitle md\n        dateNodes = if version == EPUB2\n                       then withIds \"epub-date\" toDateNode $ epubDate md\n                       else -- epub3 allows only one dc:date\n                            -- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-opf-dcdate\n                            case epubDate md of\n                                 [] -> []\n                                 (x:_) -> [dcNode \"date\" ! [(\"id\",\"epub-date\")]\n                                            $ dateText x]\n        ibooksNodes = map ibooksNode (epubIbooksFields md)\n        ibooksNode (k, v) = unode \"meta\" ! [(metaprop, \"ibooks:\" <> k)] $ v\n        calibreNodes = map calibreNode (epubCalibreFields md)\n        calibreNode (k, v) = unode \"meta\" ! [(metaprop, \"calibre:\" <> k),\n                                             (\"content\", v)] $ ()\n        languageNodes = [dcTag \"language\" $ epubLanguage md]\n        creatorNodes = withIds \"epub-creator\" (toCreatorNode \"creator\") $\n                       epubCreator md\n        contributorNodes = withIds \"epub-contributor\"\n                           (toCreatorNode \"contributor\") $ epubContributor md\n        subjectNodes = withIds \"subject\" toSubjectNode $ epubSubject md\n        descriptionNodes = maybe [] (dcTag' \"description\") $ epubDescription md\n        typeNodes = maybe [] (dcTag' \"type\") $ epubType md\n        formatNodes = maybe [] (dcTag' \"format\") $ epubFormat md\n        publisherNodes = maybe [] (dcTag' \"publisher\") $ epubPublisher md\n        sourceNodes = maybe [] (dcTag' \"source\") $ epubSource md\n        relationNodes = maybe [] (dcTag' \"relation\") $ epubRelation md\n        coverageNodes = maybe [] (dcTag' \"coverage\") $ epubCoverage md\n        rightsNodes = maybe [] (dcTag' \"rights\") $ epubRights md\n        coverImageNodes = maybe []\n            (\\img -> [unode \"meta\" !  [(\"name\",\"cover\"),\n                                       (\"content\",toId img)] $ ()])\n            mbCoverImage\n        modifiedNodes = [ unode \"meta\" ! [(metaprop, \"dcterms:modified\")] $\n               showDateTimeISO8601 currentTime | version == EPUB3 ]\n        belongsToCollectionNodes =\n            maybe []\n                (\\belongsToCollection -> (unode \"meta\" !  [(metaprop, \"belongs-to-collection\"), (\"id\", \"epub-collection-1\")] $ belongsToCollection )\n                :\n                [unode \"meta\" !  [(\"refines\", \"#epub-collection-1\"), (metaprop, \"collection-type\")] $ (\"series\" :: Text) ])\n                (epubBelongsToCollection md)++\n            maybe []\n                (\\groupPosition -> [unode \"meta\" !  [(\"refines\", \"#epub-collection-1\"), (metaprop, \"group-position\")] $ groupPosition ])\n                (epubGroupPosition md)\n        schemanode k v = unode \"meta\" ! [(metaprop, \"schema:\" <> k)] $ v\n        accessModeNodes = map (schemanode \"accessMode\") (epubAccessModes md)\n        accessModeSufficientNodes = map (schemanode \"accessModeSufficient\") (epubAccessModeSufficient md)\n        accessibilityFeatureNodes = map (schemanode \"accessibilityFeature\")\n            (epubAccessibilityFeatures md)\n        accessibilityHazardNodes = map (schemanode \"accessibilityHazard\")\n            (epubAccessibilityHazards md)\n        accessibilitySummaryNodes = maybe [] (\\summary -> [schemanode \"accessibilitySummary\" summary]) $ epubAccessibilitySummary md\n\n        dcTag n s = unode (\"dc:\" <> n) s\n        dcTag' n s = [dcTag n s]\n        toIdentifierNode id' (Identifier txt scheme)\n          | version == EPUB2 = [dcNode \"identifier\" !\n              ((\"id\",id') : maybe [] (\\x -> [(\"opf:scheme\", x)]) scheme) $\n              txt]\n          | otherwise = (dcNode \"identifier\" ! [(\"id\",id')] $ txt) :\n              maybe [] ((\\x -> [unode \"meta\" !\n                                [ (\"refines\",\"#\" <> id')\n                                , (metaprop,\"identifier-type\")\n                                , (\"scheme\",\"onix:codelist5\")\n                                ]\n                                $ x\n                               ])\n                        . schemeToOnix)\n                    scheme\n        toCreatorNode s id' creator\n          | version == EPUB2 = [dcNode s !\n             ((\"id\",id') :\n              maybe [] (\\x -> [(\"opf:file-as\",x)]) (creatorFileAs creator) ++\n              maybe [] (\\x -> [(\"opf:role\",x)])\n               (creatorRole creator >>= toRelator)) $ creatorText creator]\n          | otherwise = [dcNode s ! [(\"id\",id')] $ creatorText creator] ++\n              maybe [] (\\x -> [unode \"meta\" !\n                   [(\"refines\",\"#\" <> id'),(metaprop,\"file-as\")] $ x])\n                   (creatorFileAs creator) ++\n              maybe [] (\\x -> [unode \"meta\" !\n                   [(\"refines\",\"#\" <> id'),(metaprop,\"role\"),\n                     (\"scheme\",\"marc:relators\")] $ x])\n                   (creatorRole creator >>= toRelator)\n        toTitleNode id' title\n          | version == EPUB2 = [dcNode \"title\" !\n             ((\"id\",id') :\n              -- note: EPUB2 doesn't accept opf:title-type\n              maybe [] (\\x -> [(\"opf:file-as\",x)]) (titleFileAs title)) $\n              titleText title]\n          | otherwise = [dcNode \"title\" ! [(\"id\",id')] $ titleText title]\n              ++\n              maybe [] (\\x -> [unode \"meta\" !\n                   [(\"refines\",\"#\" <> id'),(metaprop,\"file-as\")] $ x])\n                   (titleFileAs title) ++\n              maybe [] (\\x -> [unode \"meta\" !\n                   [(\"refines\",\"#\" <> id'),(metaprop,\"title-type\")] $ x])\n                   (titleType title)\n        toDateNode id' date = [dcNode \"date\" !\n             ((\"id\",id') :\n                maybe [] (\\x -> [(\"opf:event\",x)]) (dateEvent date)) $\n                 dateText date]\n        toSubjectNode id' subject\n          | version == EPUB2 = [dcNode \"subject\" !\n            [(\"id\",id')] $ subjectText subject]\n          | otherwise = (dcNode \"subject\" ! [(\"id\",id')] $ subjectText subject)\n            : maybe [] (\\x -> (unode \"meta\" !\n                    [(\"refines\", \"#\" <> id'),(metaprop,\"authority\")] $ x) :\n                    maybe [] (\\y -> [unode \"meta\" !\n                         [(\"refines\", \"#\" <> id'),(metaprop,\"term\")] $ y])\n                         (subjectTerm subject))\n                    (subjectAuthority subject)\n        schemeToOnix :: Text -> Text\n        schemeToOnix \"ISBN-10\"              = \"02\"\n        schemeToOnix \"GTIN-13\"              = \"03\"\n        schemeToOnix \"UPC\"                  = \"04\"\n        schemeToOnix \"ISMN-10\"              = \"05\"\n        schemeToOnix \"DOI\"                  = \"06\"\n        schemeToOnix \"LCCN\"                 = \"13\"\n        schemeToOnix \"GTIN-14\"              = \"14\"\n        schemeToOnix \"ISBN-13\"              = \"15\"\n        schemeToOnix \"Legal deposit number\" = \"17\"\n        schemeToOnix \"URN\"                  = \"22\"\n        schemeToOnix \"OCLC number\"          = \"23\"\n        schemeToOnix \"Co-publisher’s ISBN-13\" = \"24\"\n        schemeToOnix \"ISMN-13\"              = \"25\"\n        schemeToOnix \"ISBN-A\"               = \"26\"\n        schemeToOnix \"JP e-code\"            = \"27\"\n        schemeToOnix \"OLCC number\"          = \"28\"\n        schemeToOnix \"JP Magazine ID\"       = \"29\"\n        schemeToOnix \"UPC-12+5\"             = \"30\"\n        schemeToOnix \"BNF Control number\"   = \"31\"\n        schemeToOnix \"ISSN-13\"              = \"34\"\n        schemeToOnix \"ARK\"                  = \"35\"\n        schemeToOnix \"Digital file internal version number\" = \"36\"\n        schemeToOnix _                      = \"01\"\n\nshowDateTimeISO8601 :: UTCTime -> Text\nshowDateTimeISO8601 = T.pack . formatTime defaultTimeLocale \"%FT%TZ\"\n\ntransformTag :: PandocMonad m\n             => Tag T.Text\n             -> E m (Tag T.Text)\ntransformTag tag@(TagOpen name attr)\n  | name `elem` [\"video\", \"source\", \"img\", \"audio\"] &&\n    isNothing (lookup \"data-external\" attr) = do\n  let src = fromAttrib \"src\" tag\n  let poster = fromAttrib \"poster\" tag\n  newsrc <- modifyMediaRef $ T.unpack src\n  newposter <- modifyMediaRef $ T.unpack poster\n  let attr' = filter (\\(x,_) -> x /= \"src\" && x /= \"poster\") attr ++\n              [(\"src\", \"../\" <> newsrc) | not (T.null newsrc)] ++\n              [(\"poster\", \"../\" <> newposter) | not (T.null newposter)]\n  return $ TagOpen name attr'\ntransformTag tag = return tag\n\nmodifyMediaRef :: PandocMonad m\n               => FilePath\n               -> E m T.Text\nmodifyMediaRef \"\" = return \"\"\nmodifyMediaRef oldsrc = do\n  media <- gets stMediaPaths\n  case lookup oldsrc media of\n         Just (n,_) -> return $ T.pack n\n         Nothing    -> catchError\n           (do (img, mbMime) <- P.fetchItem $ T.pack oldsrc\n               let ext = maybe\n                          (takeExtension (takeWhile (/='?') oldsrc))\n                          (T.unpack . (\".\" <>))\n                          (mbMime >>= extensionFromMimeType)\n               newName <- getMediaNextNewName ext\n               let newPath = \"media/\" ++ newName\n               entry <- mkEntry newPath (B.fromChunks . (:[]) $ img)\n               modify $ \\st -> st{ stMediaPaths =\n                            (oldsrc, (newPath, Just entry)):media}\n               return $ T.pack newPath)\n           (\\e -> do\n                report $ CouldNotFetchResource (T.pack oldsrc) (tshow e)\n                return $ T.pack oldsrc)\n\ngetMediaNextNewName :: PandocMonad m => FilePath -> E m FilePath\ngetMediaNextNewName ext = do\n  nextId <- gets stMediaNextId\n  modify $ \\st -> st { stMediaNextId = nextId + 1 }\n  return $ \"file\" ++ show nextId ++ ext\n\nisHtmlFormat :: Format -> Bool\nisHtmlFormat (Format \"html\") = True\nisHtmlFormat (Format \"html4\") = True\nisHtmlFormat (Format \"html5\") = True\nisHtmlFormat _ = False\n\ntransformBlock  :: PandocMonad m\n                => Block\n                -> E m Block\ntransformBlock (RawBlock fmt raw)\n  | isHtmlFormat fmt = do\n  let tags = parseTags raw\n  tags' <- mapM transformTag tags\n  return $ RawBlock fmt (renderTags' tags')\ntransformBlock b = return b\n\ntransformInline  :: PandocMonad m\n                 => WriterOptions\n                 -> Inline\n                 -> E m Inline\ntransformInline _opts (Image attr@(_,_,kvs) lab (src,tit))\n  | isNothing (lookup \"external\" kvs) = do\n    newsrc <- modifyMediaRef $ T.unpack src\n    return $ Image attr lab (\"../\" <> newsrc, tit)\ntransformInline opts x@(Math t m)\n  | WebTeX url <- writerHTMLMathMethod opts = do\n    newsrc <- modifyMediaRef (T.unpack (url <> urlEncode m))\n    let mathclass = if t == DisplayMath then \"display\" else \"inline\"\n    return $ Span (\"\",[\"math\",mathclass],[])\n                [Image nullAttr [x] (\"../\" <> newsrc, \"\")]\ntransformInline _opts (RawInline fmt raw)\n  | isHtmlFormat fmt = do\n  let tags = parseTags raw\n  tags' <- mapM transformTag tags\n  return $ RawInline fmt (renderTags' tags')\ntransformInline _ x = return x\n\n(!) :: (t -> Element) -> [(Text, Text)] -> t -> Element\n(!) f attrs n = add_attrs (map (\\(k,v) -> Attr (unqual k) v) attrs) (f n)\n\nmediaTypeOf :: FilePath -> Maybe MimeType\nmediaTypeOf x =\n  let mediaPrefixes = [\"image\", \"video\", \"audio\"] in\n  case getMimeType x of\n    Just y | any (`T.isPrefixOf` y) mediaPrefixes -> Just y\n    _      -> Nothing\n\n-- Returns filename for chapter number.\nshowChapter :: Int -> Text\nshowChapter = T.pack . printf \"ch%03d.xhtml\"\n\n-- Add identifiers to any headers without them.\naddIdentifiers :: WriterOptions -> [Block] -> [Block]\naddIdentifiers opts bs = evalState (mapM go bs) Set.empty\n where go (Header n (ident,classes,kvs) ils) = do\n         ids <- get\n         let ident' = if T.null ident\n                         then uniqueIdent (writerExtensions opts) ils ids\n                         else ident\n         modify $ Set.insert ident'\n         return $ Header n (ident',classes,kvs) ils\n       go x = return x\n\n-- Variant of normalizeDate that allows partial dates: YYYY, YYYY-MM\nnormalizeDate' :: Text -> Maybe Text\nnormalizeDate' = go . T.strip\n  where\n    go xs\n      | T.length xs == 4            -- YYY\n      , T.all isDigit xs = Just xs\n      | (y, s) <- T.splitAt 4 xs    -- YYY-MM\n      , Just ('-', m) <- T.uncons s\n      , T.length m == 2\n      , T.all isDigit y && T.all isDigit m = Just xs\n      | otherwise = normalizeDate xs\n\ntoRelator :: Text -> Maybe Text\ntoRelator x\n  | x `elem` relators = Just x\n  | otherwise         = lookup (T.toLower x) relatorMap\n\nrelators :: [Text]\nrelators = map snd relatorMap\n\nrelatorMap :: [(Text, Text)]\nrelatorMap =\n           [(\"abridger\", \"abr\")\n           ,(\"actor\", \"act\")\n           ,(\"adapter\", \"adp\")\n           ,(\"addressee\", \"rcp\")\n           ,(\"analyst\", \"anl\")\n           ,(\"animator\", \"anm\")\n           ,(\"annotator\", \"ann\")\n           ,(\"appellant\", \"apl\")\n           ,(\"appellee\", \"ape\")\n           ,(\"applicant\", \"app\")\n           ,(\"architect\", \"arc\")\n           ,(\"arranger\", \"arr\")\n           ,(\"art copyist\", \"acp\")\n           ,(\"art director\", \"adi\")\n           ,(\"artist\", \"art\")\n           ,(\"artistic director\", \"ard\")\n           ,(\"assignee\", \"asg\")\n           ,(\"associated name\", \"asn\")\n           ,(\"attributed name\", \"att\")\n           ,(\"auctioneer\", \"auc\")\n           ,(\"author\", \"aut\")\n           ,(\"author in quotations or text abstracts\", \"aqt\")\n           ,(\"author of afterword, colophon, etc.\", \"aft\")\n           ,(\"author of dialog\", \"aud\")\n           ,(\"author of introduction, etc.\", \"aui\")\n           ,(\"autographer\", \"ato\")\n           ,(\"bibliographic antecedent\", \"ant\")\n           ,(\"binder\", \"bnd\")\n           ,(\"binding designer\", \"bdd\")\n           ,(\"blurb writer\", \"blw\")\n           ,(\"book designer\", \"bkd\")\n           ,(\"book producer\", \"bkp\")\n           ,(\"bookjacket designer\", \"bjd\")\n           ,(\"bookplate designer\", \"bpd\")\n           ,(\"bookseller\", \"bsl\")\n           ,(\"braille embosser\", \"brl\")\n           ,(\"broadcaster\", \"brd\")\n           ,(\"calligrapher\", \"cll\")\n           ,(\"cartographer\", \"ctg\")\n           ,(\"caster\", \"cas\")\n           ,(\"censor\", \"cns\")\n           ,(\"choreographer\", \"chr\")\n           ,(\"cinematographer\", \"cng\")\n           ,(\"client\", \"cli\")\n           ,(\"collection registrar\", \"cor\")\n           ,(\"collector\", \"col\")\n           ,(\"collotyper\", \"clt\")\n           ,(\"colorist\", \"clr\")\n           ,(\"commentator\", \"cmm\")\n           ,(\"commentator for written text\", \"cwt\")\n           ,(\"compiler\", \"com\")\n           ,(\"complainant\", \"cpl\")\n           ,(\"complainant-appellant\", \"cpt\")\n           ,(\"complainant-appellee\", \"cpe\")\n           ,(\"composer\", \"cmp\")\n           ,(\"compositor\", \"cmt\")\n           ,(\"conceptor\", \"ccp\")\n           ,(\"conductor\", \"cnd\")\n           ,(\"conservator\", \"con\")\n           ,(\"consultant\", \"csl\")\n           ,(\"consultant to a project\", \"csp\")\n           ,(\"contestant\", \"cos\")\n           ,(\"contestant-appellant\", \"cot\")\n           ,(\"contestant-appellee\", \"coe\")\n           ,(\"contestee\", \"cts\")\n           ,(\"contestee-appellant\", \"ctt\")\n           ,(\"contestee-appellee\", \"cte\")\n           ,(\"contractor\", \"ctr\")\n           ,(\"contributor\", \"ctb\")\n           ,(\"copyright claimant\", \"cpc\")\n           ,(\"copyright holder\", \"cph\")\n           ,(\"corrector\", \"crr\")\n           ,(\"correspondent\", \"crp\")\n           ,(\"costume designer\", \"cst\")\n           ,(\"court governed\", \"cou\")\n           ,(\"court reporter\", \"crt\")\n           ,(\"cover designer\", \"cov\")\n           ,(\"creator\", \"cre\")\n           ,(\"curator\", \"cur\")\n           ,(\"dancer\", \"dnc\")\n           ,(\"data contributor\", \"dtc\")\n           ,(\"data manager\", \"dtm\")\n           ,(\"dedicatee\", \"dte\")\n           ,(\"dedicator\", \"dto\")\n           ,(\"defendant\", \"dfd\")\n           ,(\"defendant-appellant\", \"dft\")\n           ,(\"defendant-appellee\", \"dfe\")\n           ,(\"degree granting institution\", \"dgg\")\n           ,(\"delineator\", \"dln\")\n           ,(\"depicted\", \"dpc\")\n           ,(\"depositor\", \"dpt\")\n           ,(\"designer\", \"dsr\")\n           ,(\"director\", \"drt\")\n           ,(\"dissertant\", \"dis\")\n           ,(\"distribution place\", \"dbp\")\n           ,(\"distributor\", \"dst\")\n           ,(\"donor\", \"dnr\")\n           ,(\"draftsman\", \"drm\")\n           ,(\"dubious author\", \"dub\")\n           ,(\"editor\", \"edt\")\n           ,(\"editor of compilation\", \"edc\")\n           ,(\"editor of moving image work\", \"edm\")\n           ,(\"electrician\", \"elg\")\n           ,(\"electrotyper\", \"elt\")\n           ,(\"enacting jurisdiction\", \"enj\")\n           ,(\"engineer\", \"eng\")\n           ,(\"engraver\", \"egr\")\n           ,(\"etcher\", \"etr\")\n           ,(\"event place\", \"evp\")\n           ,(\"expert\", \"exp\")\n           ,(\"facsimilist\", \"fac\")\n           ,(\"field director\", \"fld\")\n           ,(\"film director\", \"fmd\")\n           ,(\"film distributor\", \"fds\")\n           ,(\"film editor\", \"flm\")\n           ,(\"film producer\", \"fmp\")\n           ,(\"filmmaker\", \"fmk\")\n           ,(\"first party\", \"fpy\")\n           ,(\"forger\", \"frg\")\n           ,(\"former owner\", \"fmo\")\n           ,(\"funder\", \"fnd\")\n           ,(\"geographic information specialist\", \"gis\")\n           ,(\"honoree\", \"hnr\")\n           ,(\"host\", \"hst\")\n           ,(\"host institution\", \"his\")\n           ,(\"illuminator\", \"ilu\")\n           ,(\"illustrator\", \"ill\")\n           ,(\"inscriber\", \"ins\")\n           ,(\"instrumentalist\", \"itr\")\n           ,(\"interviewee\", \"ive\")\n           ,(\"interviewer\", \"ivr\")\n           ,(\"inventor\", \"inv\")\n           ,(\"issuing body\", \"isb\")\n           ,(\"judge\", \"jud\")\n           ,(\"jurisdiction governed\", \"jug\")\n           ,(\"laboratory\", \"lbr\")\n           ,(\"laboratory director\", \"ldr\")\n           ,(\"landscape architect\", \"lsa\")\n           ,(\"lead\", \"led\")\n           ,(\"lender\", \"len\")\n           ,(\"libelant\", \"lil\")\n           ,(\"libelant-appellant\", \"lit\")\n           ,(\"libelant-appellee\", \"lie\")\n           ,(\"libelee\", \"lel\")\n           ,(\"libelee-appellant\", \"let\")\n           ,(\"libelee-appellee\", \"lee\")\n           ,(\"librettist\", \"lbt\")\n           ,(\"licensee\", \"lse\")\n           ,(\"licensor\", \"lso\")\n           ,(\"lighting designer\", \"lgd\")\n           ,(\"lithographer\", \"ltg\")\n           ,(\"lyricist\", \"lyr\")\n           ,(\"manufacture place\", \"mfp\")\n           ,(\"manufacturer\", \"mfr\")\n           ,(\"marbler\", \"mrb\")\n           ,(\"markup editor\", \"mrk\")\n           ,(\"metadata contact\", \"mdc\")\n           ,(\"metal-engraver\", \"mte\")\n           ,(\"moderator\", \"mod\")\n           ,(\"monitor\", \"mon\")\n           ,(\"music copyist\", \"mcp\")\n           ,(\"musical director\", \"msd\")\n           ,(\"musician\", \"mus\")\n           ,(\"narrator\", \"nrt\")\n           ,(\"onscreen presenter\", \"osp\")\n           ,(\"opponent\", \"opn\")\n           ,(\"organizer of meeting\", \"orm\")\n           ,(\"originator\", \"org\")\n           ,(\"other\", \"oth\")\n           ,(\"owner\", \"own\")\n           ,(\"panelist\", \"pan\")\n           ,(\"papermaker\", \"ppm\")\n           ,(\"patent applicant\", \"pta\")\n           ,(\"patent holder\", \"pth\")\n           ,(\"patron\", \"pat\")\n           ,(\"performer\", \"prf\")\n           ,(\"permitting agency\", \"pma\")\n           ,(\"photographer\", \"pht\")\n           ,(\"plaintiff\", \"ptf\")\n           ,(\"plaintiff-appellant\", \"ptt\")\n           ,(\"plaintiff-appellee\", \"pte\")\n           ,(\"platemaker\", \"plt\")\n           ,(\"praeses\", \"pra\")\n           ,(\"presenter\", \"pre\")\n           ,(\"printer\", \"prt\")\n           ,(\"printer of plates\", \"pop\")\n           ,(\"printmaker\", \"prm\")\n           ,(\"process contact\", \"prc\")\n           ,(\"producer\", \"pro\")\n           ,(\"production company\", \"prn\")\n           ,(\"production designer\", \"prs\")\n           ,(\"production manager\", \"pmn\")\n           ,(\"production personnel\", \"prd\")\n           ,(\"production place\", \"prp\")\n           ,(\"programmer\", \"prg\")\n           ,(\"project director\", \"pdr\")\n           ,(\"proofreader\", \"pfr\")\n           ,(\"provider\", \"prv\")\n           ,(\"publication place\", \"pup\")\n           ,(\"publisher\", \"pbl\")\n           ,(\"publishing director\", \"pbd\")\n           ,(\"puppeteer\", \"ppt\")\n           ,(\"radio director\", \"rdd\")\n           ,(\"radio producer\", \"rpc\")\n           ,(\"recording engineer\", \"rce\")\n           ,(\"recordist\", \"rcd\")\n           ,(\"redaktor\", \"red\")\n           ,(\"renderer\", \"ren\")\n           ,(\"reporter\", \"rpt\")\n           ,(\"repository\", \"rps\")\n           ,(\"research team head\", \"rth\")\n           ,(\"research team member\", \"rtm\")\n           ,(\"researcher\", \"res\")\n           ,(\"respondent\", \"rsp\")\n           ,(\"respondent-appellant\", \"rst\")\n           ,(\"respondent-appellee\", \"rse\")\n           ,(\"responsible party\", \"rpy\")\n           ,(\"restager\", \"rsg\")\n           ,(\"restorationist\", \"rsr\")\n           ,(\"reviewer\", \"rev\")\n           ,(\"rubricator\", \"rbr\")\n           ,(\"scenarist\", \"sce\")\n           ,(\"scientific advisor\", \"sad\")\n           ,(\"screenwriter\", \"aus\")\n           ,(\"scribe\", \"scr\")\n           ,(\"sculptor\", \"scl\")\n           ,(\"second party\", \"spy\")\n           ,(\"secretary\", \"sec\")\n           ,(\"seller\", \"sll\")\n           ,(\"set designer\", \"std\")\n           ,(\"setting\", \"stg\")\n           ,(\"signer\", \"sgn\")\n           ,(\"singer\", \"sng\")\n           ,(\"sound designer\", \"sds\")\n           ,(\"speaker\", \"spk\")\n           ,(\"sponsor\", \"spn\")\n           ,(\"stage director\", \"sgd\")\n           ,(\"stage manager\", \"stm\")\n           ,(\"standards body\", \"stn\")\n           ,(\"stereotyper\", \"str\")\n           ,(\"storyteller\", \"stl\")\n           ,(\"supporting host\", \"sht\")\n           ,(\"surveyor\", \"srv\")\n           ,(\"teacher\", \"tch\")\n           ,(\"technical director\", \"tcd\")\n           ,(\"television director\", \"tld\")\n           ,(\"television producer\", \"tlp\")\n           ,(\"thesis advisor\", \"ths\")\n           ,(\"transcriber\", \"trc\")\n           ,(\"translator\", \"trl\")\n           ,(\"type designer\", \"tyd\")\n           ,(\"typographer\", \"tyg\")\n           ,(\"university place\", \"uvp\")\n           ,(\"videographer\", \"vdg\")\n           ,(\"witness\", \"wit\")\n           ,(\"wood engraver\", \"wde\")\n           ,(\"woodcutter\", \"wdc\")\n           ,(\"writer of accompanying material\", \"wam\")\n           ,(\"writer of added commentary\", \"wac\")\n           ,(\"writer of added lyrics\", \"wal\")\n           ,(\"writer of added text\", \"wat\")\n           ]\n\ndocTitle' :: Meta -> [Inline]\ndocTitle' meta = maybe [] go $ lookupMeta \"title\" meta\n  where go (MetaString s) = [Str s]\n        go (MetaInlines xs) = xs\n        go (MetaBlocks [Para xs]) = xs\n        go (MetaBlocks [Plain xs]) = xs\n        go (MetaMap m) =\n              case M.lookup \"type\" m of\n                   Just x | stringify x == \"main\" ->\n                              maybe [] go $ M.lookup \"text\" m\n                   _ -> []\n        go (MetaList xs) = concatMap go xs\n        go _ = []\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/FB2.hs",
    "content": "{-# LANGUAGE PatternGuards     #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\nModule      : Text.Pandoc.Writers.FB2\nCopyright   : Copyright (C) 2011-2012 Sergey Astanin\n                            2012-2024 John MacFarlane\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : John MacFarlane\nStability   : alpha\nPortability : portable\n\nConversion of 'Pandoc' documents to FB2 (FictionBook2) format.\n\nFictionBook is an XML-based e-book format. For more information see:\n<http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1>\n\n-}\nmodule Text.Pandoc.Writers.FB2 (writeFB2)  where\n\nimport Control.Monad (zipWithM, liftM)\nimport Control.Monad.Except (catchError, throwError)\nimport Control.Monad.State.Strict (StateT, evalStateT, get, gets, lift, modify)\nimport Data.ByteString.Base64 (encode)\nimport Data.Char (isAscii, isControl, isSpace)\nimport Data.Either (lefts, rights)\nimport Data.List (intercalate)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Encoding as TE\nimport Text.Pandoc.URI (urlEncode, isURI)\nimport Text.Pandoc.XML.Light as X\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..), def)\nimport Text.Pandoc.Shared (blocksToInlines, capitalize, orderedListMarkers,\n                           makeSections, tshow, stringify)\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.Writers.Shared (lookupMetaString, toLegacyTable,\n                                   ensureValidXmlIdentifiers)\nimport Data.Generics (everywhere, mkT)\n\n-- | Data to be written at the end of the document:\n-- (foot)notes, URLs, references, images.\ndata FbRenderState = FbRenderState\n    { footnotes         :: [ (Int, Text, [Content]) ]  -- ^ #, ID, text\n    , imagesToFetch     :: [ (Text, Text) ]  -- ^ filename, URL or path\n    , parentListMarker  :: Text  -- ^ list marker of the parent ordered list\n    , writerOptions     :: WriterOptions\n    } deriving (Show)\n\n-- | FictionBook building monad.\ntype FBM m = StateT FbRenderState m\n\nnewFB :: FbRenderState\nnewFB = FbRenderState { footnotes = [], imagesToFetch = []\n                      , parentListMarker = \"\"\n                      , writerOptions = def }\n\ndata ImageMode = NormalImage | InlineImage deriving (Eq)\ninstance Show ImageMode where\n    show NormalImage = \"imageType\"\n    show InlineImage = \"inlineImageType\"\n\n-- | Produce an FB2 document from a 'Pandoc' document.\nwriteFB2 :: PandocMonad m\n         => WriterOptions    -- ^ conversion options\n         -> Pandoc           -- ^ document to convert\n         -> m Text           -- ^ FictionBook2 document (not encoded yet)\nwriteFB2 opts doc = flip evalStateT newFB $ pandocToFB2 opts doc\n\npandocToFB2 :: PandocMonad m\n            => WriterOptions\n            -> Pandoc\n            -> FBM m Text\npandocToFB2 opts doc = do\n     let Pandoc meta blocks = ensureValidXmlIdentifiers doc\n     modify (\\s -> s { writerOptions = opts })\n     desc <- description meta\n     title <- cMapM toXml . docTitle $ meta\n     secs <- renderSections 1 blocks\n     let body = el \"body\" $ el \"title\" (el \"p\" title) : secs\n     notes <- renderFootnotes\n     (imgs,missing) <- get >>= (lift . fetchImages . imagesToFetch)\n     let body' = replaceImagesWithAlt missing body\n     let fb2_xml = el \"FictionBook\" (fb2_attrs, [desc, body'] ++ notes ++ imgs)\n     return $ xml_head <> showContent fb2_xml <> \"\\n\"\n  where\n  xml_head = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"\n  fb2_attrs =\n      let xmlns = \"http://www.gribuser.ru/xml/fictionbook/2.0\"\n          xlink = \"http://www.w3.org/1999/xlink\"\n      in  [ uattr \"xmlns\" xmlns\n          , attr (\"xmlns\", \"l\") xlink ]\n\ndescription :: PandocMonad m => Meta -> FBM m Content\ndescription meta' = do\n  let genre = case lookupMetaString \"genre\" meta' of\n                \"\" -> el \"genre\" (\"unrecognised\" :: Text)\n                s  -> el \"genre\" s\n  bt <- booktitle meta'\n  let as = authors meta'\n  dd <- docdate meta'\n  annotation <- case lookupMeta \"abstract\" meta' of\n                  Just (MetaBlocks bs) -> list . el \"annotation\" <$> cMapM blockToXml (map unPlain bs)\n                  _ -> pure mempty\n  let lang = case lookupMeta \"lang\" meta' of\n               Just (MetaInlines [Str s]) -> [el \"lang\" $ iso639 s]\n               Just (MetaString s)        -> [el \"lang\" $ iso639 s]\n               _                          -> []\n             where iso639 = T.takeWhile (/= '-') -- Convert BCP 47 to ISO 639\n  let coverimage url = do\n        let img = Image nullAttr mempty (url, \"\")\n        im <- insertImage InlineImage img\n        return [el \"coverpage\" im]\n  coverpage <- case lookupMeta \"cover-image\" meta' of\n                    Just (MetaInlines ils) -> coverimage (stringify ils)\n                    Just (MetaString s) -> coverimage s\n                    _       -> return []\n  return $ el \"description\"\n    [ el \"title-info\" (genre :\n                      (as ++ bt ++ annotation ++ dd ++ coverpage ++ lang))\n    , el \"document-info\" [el \"program-used\" (\"pandoc\" :: Text)]\n    ]\n\nbooktitle :: PandocMonad m => Meta -> FBM m [Content]\nbooktitle meta' = do\n  t <- cMapM toXml . docTitle $ meta'\n  return $ [el \"book-title\" t | not (null t)]\n\nauthors :: Meta -> [Content]\nauthors meta' = cMap author (docAuthors meta')\n\nauthor :: [Inline] -> [Content]\nauthor ss =\n  let ws = T.words $ mconcat $ map plain ss\n      email = el \"email\" <$> take 1 (filter (T.any (=='@')) ws)\n      ws' = filter (not . T.any (== '@')) ws\n      names = case ws' of\n                [nickname] -> [ el \"nickname\" nickname ]\n                [fname, lname] -> [ el \"first-name\" fname\n                                    , el \"last-name\" lname ]\n                (fname:rest) -> [ el \"first-name\" fname\n                                , el \"middle-name\" (T.concat . init $ rest)\n                                , el \"last-name\" (last rest) ]\n                [] -> []\n  in  list $ el \"author\" (names ++ email)\n\ndocdate :: PandocMonad m => Meta -> FBM m [Content]\ndocdate meta' = do\n  let ss = docDate meta'\n  d <- cMapM toXml ss\n  return $ [el \"date\" d | not (null d)]\n\n-- | Divide the stream of blocks into sections and convert to XML\n-- representation.\nrenderSections :: PandocMonad m => Int -> [Block] -> FBM m [Content]\nrenderSections level blocks = do\n    let blocks' = makeSections False Nothing blocks\n    let isSection (Div (_,\"section\":_,_) (Header{}:_)) = True\n        isSection _ = False\n    let (initialBlocks, secs) = break isSection blocks'\n    let blocks'' = if null initialBlocks\n        then blocks'\n        else Div (\"\",[\"section\"],[])\n               (Header 1 nullAttr mempty : initialBlocks) : secs\n    cMapM (renderSection level) blocks''\n\nrenderSection :: PandocMonad m =>  Int -> Block -> FBM m [Content]\nrenderSection lvl (Div (id',\"section\":_,_) (Header _ _ title : xs)) = do\n  title' <- if null title\n            then return []\n            else list . el \"title\" <$> formatTitle title\n  content <- cMapM (renderSection (lvl + 1)) xs\n  let sectionContent = if T.null id'\n      then el \"section\" (title' ++ content)\n      else el \"section\" ([uattr \"id\" id'], title' ++ content)\n  return [sectionContent]\nrenderSection lvl (Div _attr bs) =\n  cMapM (renderSection lvl) bs\nrenderSection _ b = blockToXml b\n\n-- | Only <p> and <empty-line> are allowed within <title> in FB2.\nformatTitle :: PandocMonad m => [Inline] -> FBM m [Content]\nformatTitle inlines =\n  cMapM (blockToXml . Para) $ split (== LineBreak) inlines\n\nsplit :: (a -> Bool) -> [a] -> [[a]]\nsplit _ [] = []\nsplit cond xs = let (b,a) = break cond xs\n                in  (b:split cond (drop 1 a))\n\nisLineBreak :: Inline -> Bool\nisLineBreak LineBreak = True\nisLineBreak _         = False\n\n-- | Make another FictionBook body with footnotes.\nrenderFootnotes :: PandocMonad m => FBM m [Content]\nrenderFootnotes = do\n  fns <- footnotes `liftM` get\n  if null fns\n    then return []  -- no footnotes\n    else return . list $\n         el \"body\" ([uattr \"name\" \"notes\"], map renderFN (reverse fns))\n  where\n    renderFN (n, idstr, cs) =\n        let fn_texts = el \"title\" (el \"p\" (tshow n)) : cs\n        in  el \"section\" ([uattr \"id\" idstr], fn_texts)\n\n-- | Fetch images and encode them for the FictionBook XML.\n-- Return image data and a list of hrefs of the missing images.\nfetchImages :: PandocMonad m => [(Text,Text)] -> m ([Content],[Text])\nfetchImages links = do\n    imgs <- mapM (uncurry fetchImage) links\n    return (rights imgs, lefts imgs)\n\n-- | Fetch image data from disk or from network and make a <binary> XML section.\n-- Return either (Left hrefOfMissingImage) or (Right xmlContent).\nfetchImage :: PandocMonad m => Text -> Text -> m (Either Text Content)\nfetchImage href link = do\n  mbimg <-\n      case (isURI link, readDataURI link) of\n       (True, Just (mime,_,True,base64)) ->\n           let mime' = T.toLower mime\n           in if mime' == \"image/png\" || mime' == \"image/jpeg\"\n              then return (Just (mime',base64))\n              else return Nothing\n       (True, Just _) -> return Nothing  -- not base64-encoded\n       _               ->\n         catchError (do (bs, mbmime) <- P.fetchItem link\n                        case mbmime of\n                             Nothing -> do\n                               report $ CouldNotDetermineMimeType link\n                               return Nothing\n                             Just mime -> return $ Just (mime,\n                                                      TE.decodeUtf8 $ encode bs))\n                    (\\e ->\n                       do report $ CouldNotFetchResource link (tshow e)\n                          return Nothing)\n  case mbimg of\n    Just (imgtype, imgdata) ->\n        return . Right $ el \"binary\"\n                   ( [uattr \"id\" href\n                     , uattr \"content-type\" imgtype]\n                   , txt imgdata )\n    _ -> return (Left (\"#\" <> href))\n\n\n-- | Extract mime type and encoded data from the Data URI.\nreadDataURI :: Text -- ^ URI\n            -> Maybe (Text,Text,Bool,Text)\n               -- ^ Maybe (mime,charset,isBase64,data)\nreadDataURI uri =\n  case T.stripPrefix \"data:\" uri of\n    Nothing   -> Nothing\n    Just rest ->\n      let meta = T.takeWhile (/= ',') rest  -- without trailing ','\n          uridata = T.drop (T.length meta + 1) rest\n          parts = T.split (== ';') meta\n          (mime,cs,enc)=foldr upd (\"text/plain\",\"US-ASCII\",False) parts\n      in  Just (mime,cs,enc,uridata)\n\n where\n   upd str m@(mime,cs,enc)\n       | isMimeType str                            = (str,cs,enc)\n       | Just str' <- T.stripPrefix \"charset=\" str = (mime,str',enc)\n       | str ==  \"base64\"                          = (mime,cs,True)\n       | otherwise                                 = m\n\n-- Without parameters like ;charset=...; see RFC 2045, 5.1\nisMimeType :: Text -> Bool\nisMimeType s =\n    case T.split (=='/') s of\n      [mtype,msubtype] ->\n          (T.toLower mtype `elem` types\n           || \"x-\" `T.isPrefixOf` T.toLower mtype)\n          && T.all valid mtype\n          && T.all valid msubtype\n      _ -> False\n where\n   types =  [\"text\",\"image\",\"audio\",\"video\",\"application\",\"message\",\"multipart\"]\n   valid c = isAscii c && not (isControl c) && not (isSpace c) &&\n             c `notElem` (\"()<>@,;:\\\\\\\"/[]?=\" :: [Char])\n\nfootnoteID :: Int -> Text\nfootnoteID i = \"n\" <> tshow i\n\nmkitem :: PandocMonad m => Text -> [Block] -> FBM m [Content]\nmkitem mrk bs = do\n  pmrk <- gets parentListMarker\n  let nmrk = pmrk <> mrk <> \" \"\n  modify (\\s -> s { parentListMarker = nmrk})\n  item <- cMapM blockToXml $ plainToPara $ indentBlocks nmrk bs\n  modify (\\s -> s { parentListMarker = pmrk }) -- old parent marker\n  return item\n\n-- | Convert a block-level Pandoc's element to FictionBook XML representation.\nblockToXml :: PandocMonad m => Block -> FBM m [Content]\nblockToXml (Plain [img@Image {}]) = insertImage NormalImage img\nblockToXml (Plain ss) = cMapM toXml ss  -- FIXME: can lead to malformed FB2\n-- Special handling for singular images and display math elements\nblockToXml (Para [Math DisplayMath formula]) = insertMath NormalImage formula\nblockToXml (Para [img@(Image {})]) = insertImage NormalImage img\nblockToXml (Para ss) = list . el \"p\" <$> cMapM toXml ss\nblockToXml (CodeBlock _ s) = return . spaceBeforeAfter .\n                             map (el \"p\" . el \"code\") . T.lines $ s\nblockToXml (RawBlock f str) =\n  if f == Format \"fb2\"\n    then\n      case parseXMLContents (TL.fromStrict str) of\n         Left msg  -> throwError $ PandocXMLError \"\" msg\n         Right nds -> return nds\n    else return []\nblockToXml (Div _ bs) = cMapM blockToXml bs\nblockToXml (BlockQuote bs) = list . el \"cite\" <$> cMapM blockToXml bs\nblockToXml (LineBlock lns) =\n  list . el \"poem\" <$> mapM stanza (split null lns)\n  where\n    v xs = el \"v\" <$> cMapM toXml xs\n    stanza xs = el \"stanza\" <$> mapM v xs\nblockToXml (OrderedList a bss) =\n    concat <$> zipWithM mkitem markers bss\n    where\n      markers = orderedListMarkers a\nblockToXml (BulletList bss) =\n    cMapM (mkitem \"•\") bss\nblockToXml (DefinitionList defs) =\n    cMapM mkdef defs\n    where\n      mkdef (term, bss) = do\n          items <- cMapM (cMapM blockToXml . plainToPara . indentBlocks (T.replicate 4 \" \")) bss\n          t <- wrap \"strong\" term\n          return (el \"p\" t : items)\nblockToXml h@Header{} = do\n  -- should not occur after makeSections, except inside lists/blockquotes\n  report $ BlockNotRendered h\n  return []\nblockToXml HorizontalRule = return [ el \"empty-line\" () ]\nblockToXml (Table _ blkCapt specs thead tbody tfoot) = do\n    let (caption, aligns, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n    hd <- if null headers then pure [] else (:[]) <$> mkrow \"th\" headers aligns\n    bd <- mapM (\\r -> mkrow \"td\" r aligns) rows\n    c <- el \"emphasis\" <$> cMapM toXml caption\n    return [el \"table\" (hd <> bd), el \"p\" c]\n    where\n      mkrow :: PandocMonad m => Text -> [[Block]] -> [Alignment] -> FBM m Content\n      mkrow tag cells aligns' =\n        el \"tr\" <$> mapM (mkcell tag) (zip cells aligns')\n      --\n      mkcell :: PandocMonad m => Text -> ([Block], Alignment) -> FBM m Content\n      mkcell tag (cell, align) = do\n        cblocks <- cMapM blockToXml cell\n        return $ el tag ([align_attr align], cblocks)\n      --\n      align_attr a = Attr (QName \"align\" Nothing Nothing) (align_str a)\n      align_str AlignLeft    = \"left\"\n      align_str AlignCenter  = \"center\"\n      align_str AlignRight   = \"right\"\n      align_str AlignDefault = \"left\"\nblockToXml (Figure _attr (Caption _ longcapt) body) =\n  let alt = blocksToInlines longcapt\n      addAlt (Image imgattr [] tgt) = Image imgattr alt tgt\n      addAlt inln                   = inln\n  in cMapM blockToXml (walk addAlt body)\n\n-- Replace plain text with paragraphs and add line break after paragraphs.\n-- It is used to convert plain text from tight list items to paragraphs.\nplainToPara :: [Block] -> [Block]\nplainToPara [] = []\nplainToPara (Plain inlines : rest) =\n    Para inlines : plainToPara rest\nplainToPara (Para inlines : rest) =\n    Para inlines : HorizontalRule : plainToPara rest -- HorizontalRule will be converted to <empty-line />\nplainToPara (p:rest) = p : plainToPara rest\n\n-- Replace plain text with paragraphs\nunPlain :: Block -> Block\nunPlain (Plain inlines) = Para inlines\nunPlain x = x\n\n-- Simulate increased indentation level. Will not really work\n-- for multi-line paragraphs.\nindentPrefix :: Text -> Block -> Block\nindentPrefix spacer = indentBlock\n  where\n  indentBlock (Plain ins) = Plain (Str spacer:ins)\n  indentBlock (Para ins) = Para (Str spacer:ins)\n  indentBlock (CodeBlock a s) =\n    let s' = T.unlines . map (spacer<>) . T.lines $ s\n    in  CodeBlock a s'\n  indentBlock (BlockQuote bs) = BlockQuote (map indent bs)\n  indentBlock (Header l attr' ins) = Header l attr' (indentLines ins)\n  indentBlock everythingElse = everythingElse\n  -- indent every (explicit) line\n  indentLines :: [Inline] -> [Inline]\n  indentLines ins = let lns = split isLineBreak ins :: [[Inline]]\n                    in  intercalate [LineBreak] $ map (Str spacer:) lns\n\nindent :: Block -> Block\nindent = indentPrefix spacer\n  where\n  -- indentation space\n  spacer :: Text\n  spacer = T.replicate 4 \" \"\n\nindentBlocks :: Text -> [Block] -> [Block]\nindentBlocks _ [] = []\nindentBlocks prefix (x:xs) = indentPrefix prefix x : map (indentPrefix $ T.replicate (T.length prefix) \" \") xs\n\n-- | Convert a Pandoc's Inline element to FictionBook XML representation.\ntoXml :: PandocMonad m => Inline -> FBM m [Content]\ntoXml (Str s) = return [txt s]\ntoXml (Span _ ils) = cMapM toXml ils\ntoXml (Emph ss) = list `liftM` wrap \"emphasis\" ss\ntoXml (Underline ss) = list `liftM` wrap \"underline\" ss\ntoXml (Strong ss) = list `liftM` wrap \"strong\" ss\ntoXml (Strikeout ss) = list `liftM` wrap \"strikethrough\" ss\ntoXml (Superscript ss) = list `liftM` wrap \"sup\" ss\ntoXml (Subscript ss) = list `liftM` wrap \"sub\" ss\ntoXml (SmallCaps ss) = cMapM toXml $ capitalize ss\ntoXml (Quoted SingleQuote ss) = do  -- FIXME: should be language-specific\n  inner <- cMapM toXml ss\n  return $ [txt \"‘\"] ++ inner ++ [txt \"’\"]\ntoXml (Quoted DoubleQuote ss) = do\n  inner <- cMapM toXml ss\n  return $ [txt \"“\"] ++ inner ++ [txt \"”\"]\ntoXml (Cite _ ss) = cMapM toXml ss  -- FIXME: support citation styles\ntoXml (Code _ s) = return [el \"code\" s]\ntoXml Space = return [txt \" \"]\ntoXml SoftBreak = return [txt \"\\n\"]\ntoXml LineBreak = return [txt \"\\n\"]\ntoXml (Math _ formula) = insertMath InlineImage formula\ntoXml il@(RawInline _ _) = do\n  report $ InlineNotRendered il\n  return []  -- raw TeX and raw HTML are suppressed\ntoXml (Link _ text (url,_)) = do\n  ln_text <- cMapM toXml text\n  return [ el \"a\" ( [ attr (\"l\",\"href\") url ], ln_text) ]\ntoXml img@Image{} = insertImage InlineImage img\ntoXml (Note bs) = do\n  fns <- footnotes `liftM` get\n  let n = 1 + length fns\n  let fn_id = footnoteID n\n  fn_desc <- cMapM blockToXml bs\n  modify (\\s -> s { footnotes = (n, fn_id, fn_desc) : fns })\n  let fn_ref = txt $ \"[\" <> tshow n <> \"]\"\n  return . list $ el \"a\" ( [ attr (\"l\",\"href\") (\"#\" <> fn_id)\n                           , uattr \"type\" \"note\" ]\n                         , fn_ref )\n\ninsertMath :: PandocMonad m => ImageMode -> Text -> FBM m [Content]\ninsertMath immode formula = do\n  htmlMath <- fmap (writerHTMLMathMethod . writerOptions) get\n  case htmlMath of\n    WebTeX url -> do\n       let alt = [Code nullAttr formula]\n       let imgurl = url <> urlEncode formula\n       let img = Image nullAttr alt (imgurl, \"\")\n       insertImage immode img\n    _ -> return [el \"code\" formula]\n\ninsertImage :: PandocMonad m => ImageMode -> Inline -> FBM m [Content]\ninsertImage immode (Image _ alt (url,ttl)) = do\n  images <- imagesToFetch `liftM` get\n  let n = 1 + length images\n  let fname = \"image\" <> tshow n\n  modify (\\s -> s { imagesToFetch = (fname, url) : images })\n  let ttlattr = case (immode, T.null ttl) of\n                  (NormalImage, False) -> [ uattr \"title\" ttl ]\n                  _                    -> []\n  return . list $\n         el \"image\" $\n            [ attr (\"l\",\"href\") (\"#\" <> fname)\n            , attr (\"l\",\"type\") (tshow immode)\n            , uattr \"alt\" (mconcat $ map plain alt) ]\n            ++ ttlattr\ninsertImage _ _ = error \"unexpected inline instead of image\"\n\nreplaceImagesWithAlt :: [Text] -> Content -> Content\nreplaceImagesWithAlt missingHrefs = everywhere (mkT go)\n  where\n    go c = if isMissing c\n              then replaceNode c\n              else c\n    isMissing (Elem img@Element{}) =\n        let imgAttrs = elAttribs img\n            badAttrs = map (attr (\"l\",\"href\")) missingHrefs\n        in  any (`elem` imgAttrs) badAttrs\n    isMissing _ = False\n  --\n    replaceNode :: Content -> Content\n    replaceNode n@(Elem img@Element{}) =\n        let attrs = elAttribs img\n            alt = getAttrVal attrs (unqual \"alt\")\n            imtype = getAttrVal attrs (qname \"l\" \"type\")\n        in case (alt, imtype) of\n             (Just alt', Just imtype') ->\n                 if imtype' == tshow NormalImage\n                 then el \"p\" alt'\n                 else txt alt'\n             (Just alt', Nothing) -> txt alt'  -- no type attribute\n             _ -> n   -- don't replace if alt text is not found\n    replaceNode n = n\n  --\n    getAttrVal :: [X.Attr] -> QName -> Maybe Text\n    getAttrVal attrs name =\n        case filter ((name ==) . attrKey) attrs of\n           (a:_) -> Just (attrVal a)\n           _     -> Nothing\n\n\n-- | Wrap all inlines with an XML tag (given its unqualified name).\nwrap :: PandocMonad m => Text -> [Inline] -> FBM m Content\nwrap tagname inlines = el tagname `liftM` cMapM toXml inlines\n\n-- \" Create a singleton list.\nlist :: a -> [a]\nlist = (:[])\n\n-- | Convert an 'Inline' to plaintext.\nplain :: Inline -> Text\nplain (Str s)               = s\nplain (Emph ss)             = mconcat $ map plain ss\nplain (Underline ss)        = mconcat $ map plain ss\nplain (Span _ ss)           = mconcat $ map plain ss\nplain (Strong ss)           = mconcat $ map plain ss\nplain (Strikeout ss)        = mconcat $ map plain ss\nplain (Superscript ss)      = mconcat $ map plain ss\nplain (Subscript ss)        = mconcat $ map plain ss\nplain (SmallCaps ss)        = mconcat $ map plain ss\nplain (Quoted _ ss)         = mconcat $ map plain ss\nplain (Cite _ ss)           = mconcat $ map plain ss  -- FIXME\nplain (Code _ s)            = s\nplain Space                 = \" \"\nplain SoftBreak             = \" \"\nplain LineBreak             = \"\\n\"\nplain (Math _ s)            = s\nplain (RawInline _ _)       = \"\"\nplain (Link _ text (url,_)) = mconcat (map plain text ++ [\" <\", url, \">\"])\nplain (Image _ alt _)       = mconcat $ map plain alt\nplain (Note _)              = \"\"  -- FIXME\n\n-- | Create an XML element.\nel :: (Node t)\n   => Text     -- ^ unqualified element name\n   -> t        -- ^ node contents\n   -> Content  -- ^ XML content\nel name cs = Elem $ unode name cs\n\n-- | Put empty lines around content\nspaceBeforeAfter :: [Content] -> [Content]\nspaceBeforeAfter cs =\n    let emptyline = el \"empty-line\" ()\n    in  [emptyline] ++ cs ++ [emptyline]\n\n-- | Create a plain-text XML content.\ntxt :: Text -> Content\ntxt s = Text $ CData CDataText s Nothing\n\n-- | Create an XML attribute with an unqualified name.\nuattr :: Text -> Text -> X.Attr\nuattr name = Attr (unqual name)\n\n-- | Create an XML attribute with a qualified name from given namespace.\nattr :: (Text, Text) -> Text -> X.Attr\nattr (ns, name) = Attr (qname ns name)\n\n-- | Qualified name\nqname :: Text -> Text -> QName\nqname ns name = QName name Nothing (Just ns)\n\n-- | Abbreviation for 'concatMap'.\ncMap :: (a -> [b]) -> [a] -> [b]\ncMap = concatMap\n\n-- | Monadic equivalent of 'concatMap'.\ncMapM :: (Monad m) => (a -> m [b]) -> [a] -> m [b]\ncMapM f xs = concat `liftM` mapM f xs\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/GridTable.hs",
    "content": "{-# LANGUAGE FlexibleContexts           #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE LambdaCase                 #-}\n{-# LANGUAGE TupleSections              #-}\n\n{- |\nModule      : Text.Pandoc.Writers.GridTable\nCopyright   : © 2020-2024 Albert Krewinkel\nLicense     : GNU GPL, version 2 or above\n\nMaintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n\nGrid representation of pandoc tables. The structures in this module\nallow to describe 'Text.Pandoc.Definition.Table' elements without loss\nof information. However, they are simpler to use when the grid layout of\na table must be known.\n\nThe \"grid tables\" handled here are conceptually similar to grid tables\nin reStructuredText and Markdown, but are more general.\n-}\nmodule Text.Pandoc.Writers.GridTable\n  ( Table (..)\n  , GridCell (..)\n  , RowIndex (..)\n  , ColIndex (..)\n  , CellIndex\n  , Part (..)\n  , toTable\n  , rowArray\n  ) where\n\nimport Control.Monad (forM_)\nimport Control.Monad.ST\nimport Data.Array\nimport Data.Array.MArray\nimport Data.Array.ST\nimport Data.Maybe (listToMaybe)\nimport Data.STRef\nimport Text.Pandoc.Definition hiding (Table)\nimport qualified Text.Pandoc.Builder as B\n\n-- | A grid cell contains either a real table cell, or is the\n-- continuation of a column or row-spanning cell. In the latter case,\n-- the index of the continued cell is provided.\ndata GridCell\n  = ContentCell Attr Alignment RowSpan ColSpan [Block]\n  | ContinuationCell CellIndex\n  | UnassignedCell\n  deriving (Show)\n\n-- | Row index in a table part.\nnewtype RowIndex = RowIndex Int deriving (Enum, Eq, Ix, Ord, Show)\n-- | Column index in a table part.\nnewtype ColIndex = ColIndex Int deriving (Enum, Eq, Ix, Ord, Show)\n\n-- | Index to a cell in a table part.\ntype CellIndex = (RowIndex, ColIndex)\n\n-- | Cells are placed on a grid. Row attributes are stored in a separate\n-- array.\ndata Part = Part\n  { partAttr :: Attr\n  , partCellArray :: Array (RowIndex,ColIndex) GridCell\n  , partRowAttrs  :: Array RowIndex Attr\n  }\n\ndata Table = Table\n  { tableAttr     :: Attr\n  , tableCaption  :: Caption\n  , tableColSpecs :: Array ColIndex ColSpec\n  , tableRowHeads :: RowHeadColumns\n  , tableHead     :: Part\n  , tableBodies   :: [Part]\n  , tableFoot     :: Part\n  }\n\ntoTable\n  :: B.Attr\n  -> B.Caption\n  -> [B.ColSpec]\n  -> B.TableHead\n  -> [B.TableBody]\n  -> B.TableFoot\n  -> Table\ntoTable attr caption colSpecs thead' tbodies' tfoot' =\n  Table attr caption colSpecs' rowHeads thGrid tbGrids tfGrid\n  where\n    -- normalize in case it's invalid shape:\n    thead = B.normalizeTableHead numcols thead'\n    tbodies = map (B.normalizeTableBody numcols) tbodies'\n    tfoot = B.normalizeTableFoot numcols tfoot'\n    numcols = length colSpecs\n    colSpecs' = listArray (ColIndex 1, ColIndex numcols) colSpecs\n    rowHeads = case listToMaybe tbodies of\n      Nothing -> RowHeadColumns 0\n      Just (TableBody _attr rowHeadCols _headerRows _rows) -> rowHeadCols\n    thGrid = let (TableHead headAttr rows) = thead\n             in rowsToPart headAttr rows\n    tbGrids = map bodyToGrid tbodies\n    tfGrid = let (TableFoot footAttr rows) = tfoot\n             in rowsToPart footAttr rows\n    bodyToGrid (TableBody bodyAttr _rowHeadCols headRows rows) =\n      rowsToPart bodyAttr (headRows ++ rows)\n\ndata BuilderCell\n  = FilledCell GridCell\n  | FreeCell\n\nfromBuilderCell :: BuilderCell -> GridCell\nfromBuilderCell = \\case\n  FilledCell c -> c\n  FreeCell -> UnassignedCell\n\nrowsToPart :: Attr -> [B.Row] -> Part\nrowsToPart attr = \\case\n  [] -> Part\n        attr\n        (listArray ((RowIndex 1, ColIndex 1), (RowIndex 0, ColIndex 0)) [])\n        (listArray (RowIndex 1, RowIndex 0) [])\n  rows@(Row _attr firstRow:_) ->\n    let nrows = length rows\n        ncols = sum $ map (\\(Cell _ _ _ (ColSpan cs) _) -> cs) firstRow\n        gbounds = ((RowIndex 1, ColIndex 1), (RowIndex nrows, ColIndex ncols))\n        mutableGrid :: ST s (STArray s CellIndex GridCell)\n        mutableGrid = do\n          grid <- newArray gbounds FreeCell\n          ridx <- newSTRef (RowIndex 1)\n          forM_ rows $ \\(Row _attr cells) -> do\n            cidx <- newSTRef (ColIndex 1)\n            forM_ cells $ \\(Cell cellAttr align rs cs blks) -> do\n              ridx' <- readSTRef ridx\n              let nextFreeInRow colindex@(ColIndex c) = do\n                    let idx = (ridx', colindex)\n                    if gbounds `inRange` idx\n                      then readArray grid idx >>= \\case\n                             FreeCell -> pure (Just colindex)\n                             _ -> nextFreeInRow $ ColIndex (c + 1)\n                      else pure Nothing  -- invalid table\n              mcidx' <- readSTRef cidx >>= nextFreeInRow\n              -- If there is a FreeCell in the current row, then fill it\n              -- with the current cell and mark cells in this and the\n              -- following rows as continuation cells if necessary.\n              --\n              -- Just skip the current table cell if no FreeCell was\n              -- found; this can only happen with invalid tables.\n              case mcidx' of\n                Nothing -> pure () -- no FreeCell left in row -- skip cell\n                Just cidx' -> do\n                  writeArray grid (ridx', cidx') . FilledCell $\n                    ContentCell cellAttr align rs cs blks\n                  forM_ (continuationIndices ridx' cidx' rs cs) $ \\idx -> do\n                    writeArray grid idx . FilledCell $\n                      ContinuationCell (ridx', cidx')\n                  -- go to new column\n                  writeSTRef cidx cidx'\n            -- go to next row\n            modifySTRef ridx (incrRowIndex 1)\n          -- Swap BuilderCells with normal GridCells.\n          mapArray fromBuilderCell grid\n    in Part\n       { partCellArray = runSTArray mutableGrid\n       , partRowAttrs = listArray (RowIndex 1, RowIndex nrows) $\n                        map (\\(Row rowAttr _) -> rowAttr) rows\n       , partAttr = attr\n       }\n\ncontinuationIndices :: RowIndex -> ColIndex -> RowSpan -> ColSpan -> [CellIndex]\ncontinuationIndices (RowIndex ridx) (ColIndex cidx) rowspan colspan =\n  let (RowSpan rs) = rowspan\n      (ColSpan cs) = colspan\n  in [ (RowIndex r, ColIndex c) | r <- [ridx..(ridx + rs - 1)]\n                                , c <- [cidx..(cidx + cs - 1)]\n                                , (r, c) /= (ridx, cidx)]\n\nrowArray :: RowIndex -> Array CellIndex GridCell -> Array ColIndex GridCell\nrowArray ridx grid =\n  let ((_minRidx, minCidx), (_maxRidx, maxCidx)) = bounds grid\n  in ixmap (minCidx, maxCidx) (ridx,) grid\n\nincrRowIndex :: RowSpan -> RowIndex -> RowIndex\nincrRowIndex (RowSpan n) (RowIndex r) = RowIndex $ r + n\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/HTML.hs",
    "content": "{-# LANGUAGE BangPatterns        #-}\n{-# LANGUAGE FlexibleContexts    #-}\n{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE MultiWayIf          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Writers.HTML\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to HTML.\n-}\nmodule Text.Pandoc.Writers.HTML (\n  writeHtml4,\n  writeHtml4String,\n  writeHtml5,\n  writeHtml5String,\n  writeHtmlStringForEPUB,\n  writeS5,\n  writeSlidy,\n  writeSlideous,\n  writeDZSlides,\n  writeRevealJs,\n  tagWithAttributes\n  ) where\nimport Control.Monad.State.Strict\n    ( StateT, MonadState(get), gets, modify, evalStateT )\nimport Control.Monad ( liftM, when, foldM, unless )\nimport Control.Monad.Trans ( MonadTrans(lift) )\nimport Data.Char (ord, isSpace, isAscii)\nimport Data.List (intercalate, intersperse, partition, delete, (\\\\))\nimport qualified Data.List as L\nimport Data.List.NonEmpty (NonEmpty((:|)))\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Maybe (fromMaybe, isJust, isNothing)\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Network.URI (URI (..), parseURIReference, escapeURIString)\nimport Text.Pandoc.URI (urlEncode)\nimport Numeric (showHex)\nimport Text.DocLayout (render, literal, Doc)\nimport Text.Blaze.Internal (MarkupM (Empty), customLeaf, customParent)\nimport Text.DocTemplates (FromContext (lookupContext), Context (..), Val(..))\nimport qualified Text.DocTemplates.Internal as DT\nimport Text.Blaze.Html hiding (contents)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (formatHtmlBlock, formatHtml4Block,\n                 formatHtmlInline, highlight, styleToCss, defaultStyle)\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Slides\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\nimport Text.Pandoc.XML (escapeStringForXML, fromEntities, toEntities,\n                        html5Attributes, html4Attributes, rdfaAttributes)\nimport qualified Text.Blaze.XHtml5 as H5\nimport qualified Text.Blaze.XHtml5.Attributes as A5\nimport Control.Monad.Except (throwError)\nimport System.FilePath (takeBaseName)\nimport Text.Blaze.Html.Renderer.Text (renderHtml)\nimport qualified Text.Blaze.XHtml1.Transitional as H\nimport qualified Text.Blaze.XHtml1.Transitional.Attributes as A\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Translations (Term(Abstract), translateTerm)\nimport Text.Pandoc.Class.PandocPure (runPure)\nimport Text.Pandoc.Error\nimport Text.Pandoc.Logging\nimport Text.Pandoc.MIME (mediaCategory)\nimport Text.Pandoc.Writers.Blaze (layoutMarkup)\nimport Text.TeXMath\nimport Text.XML.Light (elChildren, unode, unqual)\nimport qualified Text.XML.Light as XML\nimport Text.XML.Light.Output\nimport Data.String (fromString)\n\ndata WriterState = WriterState\n    { stNotes        :: [Html]  -- ^ List of notes\n    , stEmittedNotes :: Int     -- ^ How many notes we've already pushed out to the HTML\n    , stEmittedNoteBlocks :: Int  -- ^ How many @\\<div class=footnote>@ blocks we've already pushed out\n    , stMath         :: Bool    -- ^ Math is used in document\n    , stQuotes       :: Bool    -- ^ <q> tag is used\n    , stHighlighting :: Bool    -- ^ Syntax highlighting is used\n    , stHtml5        :: Bool    -- ^ Use HTML5\n    , stEPUBVersion  :: Maybe EPUBVersion -- ^ EPUB version if for epub\n    , stSlideVariant :: HTMLSlideVariant\n    , stSlideLevel   :: Int     -- ^ Slide level\n    , stInSection    :: Bool    -- ^ Content is in a section (revealjs)\n    , stCodeBlockNum :: Int     -- ^ Number of code block\n    , stCsl          :: Bool    -- ^ Has CSL references\n    , stCslEntrySpacing :: Maybe Int  -- ^ CSL entry spacing\n    , stBlockLevel   :: Int     -- ^ Current block depth, excluding section divs\n    }\n\ndefaultWriterState :: WriterState\ndefaultWriterState = WriterState {stNotes= [],\n                                  stEmittedNotes = 0,\n                                  stEmittedNoteBlocks = 0,\n                                  stMath = False,\n                                  stQuotes = False,\n                                  stHighlighting = False,\n                                  stHtml5 = False,\n                                  stEPUBVersion = Nothing,\n                                  stSlideVariant = NoSlides,\n                                  stSlideLevel = 1,\n                                  stInSection = False,\n                                  stCodeBlockNum = 0,\n                                  stCsl = False,\n                                  stCslEntrySpacing = Nothing,\n                                  stBlockLevel = 0}\n\n-- Helpers to render HTML with the appropriate function.\n\nstrToHtml :: Text -> Html\nstrToHtml t\n    | T.any isSpecial t =\n       let !x = L.foldl' go mempty $ T.groupBy samegroup t\n        in x\n    | otherwise = toHtml t\n  where\n    samegroup c d = d == '\\xFE0E' || not (isSpecial c || isSpecial d)\n    isSpecial '\\'' = True\n    isSpecial '\"' = True\n    isSpecial c = needsVariationSelector c\n    go h \"\\'\" = h <> preEscapedString \"\\'\"\n    go h \"\\\"\" = h <> preEscapedString \"\\\"\"\n    go h txt | T.length txt == 1 && T.all needsVariationSelector txt\n           = h <> preEscapedString (T.unpack txt <> \"\\xFE0E\")\n    go h txt = h <> toHtml txt\n\n-- See #5469: this prevents iOS from substituting emojis.\nneedsVariationSelector :: Char -> Bool\nneedsVariationSelector '↩' = True\nneedsVariationSelector '↔' = True\nneedsVariationSelector _   = False\n\n-- | Hard linebreak.\nnl :: Html\nnl = preEscapedString \"\\n\"\n\n-- | Convert Pandoc document to Html 5 string.\nwriteHtml5String :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteHtml5String = writeHtmlString'\n                      defaultWriterState{ stHtml5 = True }\n\n-- | Convert Pandoc document to Html 5 structure.\nwriteHtml5 :: PandocMonad m => WriterOptions -> Pandoc -> m Html\nwriteHtml5 = writeHtml' defaultWriterState{ stHtml5 = True }\n\n-- | Convert Pandoc document to Html 4 string.\nwriteHtml4String :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteHtml4String opts = writeHtmlString'\n                         defaultWriterState{ stHtml5 = False } opts .\n                        ensureValidXmlIdentifiers\n\n-- | Convert Pandoc document to Html 4 structure.\nwriteHtml4 :: PandocMonad m => WriterOptions -> Pandoc -> m Html\nwriteHtml4 opts = writeHtml' defaultWriterState{ stHtml5 = False } opts .\n                    ensureValidXmlIdentifiers\n\n-- | Convert Pandoc document to Html appropriate for an epub version.\nwriteHtmlStringForEPUB :: PandocMonad m\n                       => EPUBVersion -> WriterOptions -> Pandoc\n                       -> m Text\nwriteHtmlStringForEPUB version o = writeHtmlString'\n                      defaultWriterState{ stHtml5 = version == EPUB3,\n                                          stEPUBVersion = Just version }\n                      o{ writerWrapText = WrapNone }\n   -- we don't use ensureValidXmlIdentifiers here because we\n   -- do that in the EPUB writer\n\n-- | Convert Pandoc document to Reveal JS HTML slide show.\nwriteRevealJs :: PandocMonad m\n              => WriterOptions -> Pandoc -> m Text\nwriteRevealJs = writeHtmlSlideShow' RevealJsSlides\n\n-- | Convert Pandoc document to S5 HTML slide show.\nwriteS5 :: PandocMonad m\n        => WriterOptions -> Pandoc -> m Text\nwriteS5 opts = writeHtmlSlideShow' S5Slides opts .\n               ensureValidXmlIdentifiers\n\n-- | Convert Pandoc document to Slidy HTML slide show.\nwriteSlidy :: PandocMonad m\n           => WriterOptions -> Pandoc -> m Text\nwriteSlidy opts = writeHtmlSlideShow' SlidySlides opts .\n                  ensureValidXmlIdentifiers\n\n-- | Convert Pandoc document to Slideous HTML slide show.\nwriteSlideous :: PandocMonad m\n              => WriterOptions -> Pandoc -> m Text\nwriteSlideous opts = writeHtmlSlideShow' SlideousSlides opts .\n                     ensureValidXmlIdentifiers\n\n-- | Convert Pandoc document to DZSlides HTML slide show.\nwriteDZSlides :: PandocMonad m\n              => WriterOptions -> Pandoc -> m Text\nwriteDZSlides opts = writeHtmlSlideShow' DZSlides opts\n\nwriteHtmlSlideShow' :: PandocMonad m\n                    => HTMLSlideVariant -> WriterOptions -> Pandoc -> m Text\nwriteHtmlSlideShow' variant = writeHtmlString'\n    defaultWriterState{ stSlideVariant = variant\n                      , stHtml5 = case variant of\n                                       RevealJsSlides -> True\n                                       S5Slides       -> False\n                                       SlidySlides    -> False\n                                       DZSlides       -> True\n                                       SlideousSlides -> False\n                                       NoSlides       -> False\n                      }\n\nrenderHtml' :: Html -> Text\nrenderHtml' = TL.toStrict . renderHtml\n\nwriteHtmlString' :: PandocMonad m\n                 => WriterState -> WriterOptions -> Pandoc -> m Text\nwriteHtmlString' st opts d = do\n  (body, context) <- evalStateT (pandocToHtml opts d) st\n  let colwidth = case writerWrapText opts of\n                    WrapAuto -> Just (writerColumns opts)\n                    _ -> Nothing\n  (if writerPreferAscii opts\n      then toEntities\n      else id) <$>\n    case writerTemplate opts of\n       Nothing -> return $\n         case colwidth of\n           Nothing -> renderHtml' body  -- optimization, skip layout\n           Just cols -> render (Just cols) $ layoutMarkup body\n       Just tpl -> do\n         -- warn if empty lang\n         when (isNothing (getField \"lang\" context :: Maybe Text) &&\n               hasVariable \"lang\" tpl) $\n           report NoLangSpecified\n         (context' :: Context Text) <-\n            -- check for empty pagetitle\n            case getField \"pagetitle\" context of\n                 Just (s :: Text) | not (T.null s) -> return context\n                 _ | hasVariable \"pagetitle\" tpl -> do\n                       let fallback = T.pack $\n                             case lookupContext \"sourcefile\"\n                                       (writerVariables opts) of\n                               Nothing    -> \"Untitled\"\n                               Just []    -> \"Untitled\"\n                               Just (x:_) -> takeBaseName $ T.unpack x\n                       report $ NoTitleElement fallback\n                       return $ resetField \"pagetitle\" (literal fallback) context\n                   | otherwise -> return context\n         return $ render colwidth $ renderTemplate tpl\n             (defField \"body\" (layoutMarkup body) context')\n\nwriteHtml' :: PandocMonad m => WriterState -> WriterOptions -> Pandoc -> m Html\nwriteHtml' st opts d =\n  case writerTemplate opts of\n       Just _ -> preEscapedText <$> writeHtmlString' st opts d\n       Nothing\n         | writerPreferAscii opts\n           -> preEscapedText <$> writeHtmlString' st opts d\n         | otherwise -> do\n            (body, _) <- evalStateT (pandocToHtml opts d) st\n            return body\n\n-- result is (title, authors, date, toc, body, new variables)\npandocToHtml :: PandocMonad m\n             => WriterOptions\n             -> Pandoc\n             -> StateT WriterState m (Html, Context Text)\npandocToHtml opts (Pandoc meta blocks) = do\n  lift $ setupTranslations meta\n  let slideLevel = fromMaybe (getSlideLevel blocks) $ writerSlideLevel opts\n  modify $ \\st -> st{ stSlideLevel = slideLevel }\n  metadata <- metaToContext opts\n              (fmap layoutMarkup . blockListToHtml opts)\n              (fmap layoutMarkup . inlineListToHtml opts)\n              meta\n  let stringifyHTML = escapeStringForXML . stringify\n  let authsMeta = map (literal . stringifyHTML) $ docAuthors meta\n  let dateMeta  = stringifyHTML $ docDate meta\n  let descriptionMeta = literal $ escapeStringForXML $\n                          lookupMetaString \"description\" meta\n  slideVariant <- gets stSlideVariant\n  abstractTitle <- translateTerm Abstract\n  let sects = makeSectionsWithOffsets\n                (writerNumberOffset opts) (writerNumberSections opts) Nothing $\n              if slideVariant == NoSlides\n                 then blocks\n                 else prepSlides slideLevel blocks\n  toc <- if writerTableOfContents opts && slideVariant /= S5Slides\n            then fmap layoutMarkup <$> tableOfContents opts sects\n            else return Nothing\n  blocks' <- blockListToHtml opts sects\n  notes <- do\n    -- make the st private just to be safe, since we modify it right afterwards\n    st <- get\n    if null (stNotes st)\n      then return mempty\n      else do\n        notes <- footnoteSection opts EndOfDocument (stEmittedNotes st + 1) (reverse (stNotes st))\n        modify (\\st' -> st'{ stNotes = mempty, stEmittedNotes = stEmittedNotes st' + length (stNotes st') })\n        return notes\n  st <- get\n  let html5 = stHtml5 st\n  let thebody = blocks' >> notes\n  let math = layoutMarkup $ case writerHTMLMathMethod opts of\n        MathJax url\n          | slideVariant /= RevealJsSlides ->\n          -- mathjax is handled via a special plugin in revealjs\n            H.script ! A.defer mempty\n                    ! A.src (toValue $ toURI html5 url)\n                    ! A.type_ \"text/javascript\"\n                    $ case slideVariant of\n                            SlideousSlides ->\n                              preEscapedString\n                              \"MathJax.Hub.Queue([\\\"Typeset\\\",MathJax.Hub]);\"\n                            _ -> mempty\n        KaTeX url -> do\n          H.script !\n            A.defer mempty !\n            A.src (toValue $ toURI html5 $ url <> \"katex.min.js\") $ mempty\n          nl\n          let katexFlushLeft =\n                case lookupContext \"classoption\" metadata of\n                  Just clsops | \"fleqn\" `elem` (clsops :: [Doc Text]) -> \"true\"\n                  _ -> \"false\"\n          H.script $ text $ T.unlines [\n              \"document.addEventListener(\\\"DOMContentLoaded\\\", function () {\"\n            , \" var mathElements = document.getElementsByClassName(\\\"math\\\");\"\n            , \" var macros = [];\"\n            , \" for (var i = 0; i < mathElements.length; i++) {\"\n            , \"  var texText = mathElements[i].firstChild;\"\n            , \"  if (mathElements[i].tagName == \\\"SPAN\\\") {\"\n            , \"   katex.render(texText.data, mathElements[i], {\"\n            , \"    displayMode: mathElements[i].classList.contains('display'),\"\n            , \"    throwOnError: false,\"\n            , \"    macros: macros,\"\n            , \"    fleqn: \" <> katexFlushLeft\n            , \"   });\"\n            , \"}}});\"\n            ]\n          nl\n          H.link ! A.rel \"stylesheet\" !\n            A.href (toValue $ toURI html5 url <> \"katex.min.css\")\n\n        _ -> mempty\n  let mCss :: Maybe [Text] = lookupContext \"css\" metadata\n  let context :: Context Text\n      context =   (if stHighlighting st\n                      then case writerHighlightMethod opts of\n                             Skylighting sty ->\n                               defField \"highlighting-css\"\n                                 (literal $ T.pack $ styleToCss sty)\n                             DefaultHighlighting ->\n                               defField \"highlighting-css\"\n                                 (literal $ T.pack $ styleToCss defaultStyle)\n                             _  -> id\n                      else id) .\n                  (if stCsl st\n                      then defField \"csl-css\" True .\n                           (case stCslEntrySpacing st of\n                              Nothing -> id\n                              Just n  ->\n                                defField \"csl-entry-spacing\"\n                                  (literal $ tshow n <> \"em\"))\n                      else id) .\n                  (if stMath st\n                      then defField \"math\" math\n                      else id) .\n                  defField \"abstract-title\" abstractTitle .\n                  (case writerHTMLMathMethod opts of\n                        MathJax u -> defField \"mathjax\" True .\n                                     defField \"mathjaxurl\"\n                                       (literal $ T.takeWhile (/='?') u)\n                        _         -> defField \"mathjax\" False) .\n                  (case writerHTMLMathMethod opts of\n                        PlainMath -> defField \"displaymath-css\" True\n                        WebTeX _  -> defField \"displaymath-css\" True\n                        _         -> id) .\n                  (if slideVariant == RevealJsSlides\n                      then -- set boolean options explicitly, since\n                           -- template can't distinguish False/undefined\n                         defField \"controls\" True .\n                         defField \"controlsTutorial\" True .\n                         defField \"controlsLayout\"\n                           (\"bottom-right\" :: Doc Text) .\n                         defField \"controlsBackArrows\" (\"faded\" :: Doc Text) .\n                         defField \"progress\" True .\n                         defField \"slideNumber\" False .\n                         defField \"showSlideNumber\" (\"all\" :: Doc Text) .\n                         defField \"hashOneBasedIndex\" False .\n                         defField \"hash\" True .\n                         defField \"respondToHashChanges\" True .\n                         defField \"history\" False .\n                         defField \"keyboard\" True .\n                         defField \"overview\" True .\n                         defField \"disableLayout\" False .\n                         defField \"center\" True .\n                         defField \"touch\" True .\n                         defField \"loop\" False .\n                         defField \"rtl\" False .\n                         defField \"navigationMode\" (\"default\" :: Doc Text) .\n                         defField \"shuffle\" False .\n                         defField \"fragments\" True .\n                         defField \"fragmentInURL\" True .\n                         defField \"embedded\" False .\n                         defField \"help\" True .\n                         defField \"pause\" True .\n                         defField \"showNotes\" False .\n                         defField \"autoPlayMedia\" (\"null\" :: Doc Text) .\n                         defField \"preloadIframes\" (\"null\" :: Doc Text) .\n                         defField \"autoSlide\" (\"0\" :: Doc Text) .\n                         defField \"autoSlideStoppable\" True .\n                         defField \"autoSlideMethod\" (\"null\" :: Doc Text) .\n                         defField \"defaultTiming\" (\"null\" :: Doc Text) .\n                         defField \"mouseWheel\" False .\n                         defField \"display\" (\"block\" :: Doc Text) .\n                         defField \"hideInactiveCursor\" True .\n                         defField \"hideCursorTime\" (\"5000\" :: Doc Text) .\n                         defField \"previewLinks\" False .\n                         defField \"transition\" (\"slide\" :: Doc Text) .\n                         defField \"transitionSpeed\" (\"default\" :: Doc Text) .\n                         defField \"backgroundTransition\" (\"fade\" :: Doc Text) .\n                         defField \"viewDistance\" (\"3\" :: Doc Text) .\n                         defField \"mobileViewDistance\" (\"2\" :: Doc Text) .\n                         (case (lookupContext \"scrollProgress\" metadata\n                                   :: Maybe (Val Text)) of\n                            Just (BoolVal False) -> id\n                            Just (BoolVal True) -> defField \"scrollProgress\" True\n                            _  -> defField \"scrollProgressAuto\" True) .\n                         defField \"scrollActivationWidth\" (\"0\" :: Doc Text) .\n                         defField \"scrollSnap\" (\"mandatory\" :: Doc Text) .\n                         defField \"scrollLayout\" (\"full\" :: Doc Text) .\n                         (case writerHighlightMethod opts of\n                            IdiomaticHighlighting\n                             | slideVariant == RevealJsSlides ->\n                              defField \"highlight-js\" True .\n                              defField \"highlightjs-theme\" (\"monokai\" :: Doc Text)\n                            _ -> id)\n                      else id) .\n                  defField \"document-css\" (isNothing mCss && slideVariant == NoSlides) .\n                  defField \"quotes\" (stQuotes st) .\n                  -- for backwards compatibility we populate toc\n                  -- with the contents of the toc, rather than a\n                  -- boolean:\n                  maybe id (defField \"toc\") toc .\n                  maybe id (defField \"table-of-contents\") toc .\n                  defField \"author-meta\" authsMeta .\n                  maybe id (defField \"date-meta\" . literal)\n                    (normalizeDate dateMeta) .\n                  defField \"description-meta\" descriptionMeta .\n                  defField \"pagetitle\"\n                      (literal . stringifyHTML . docTitle $ meta) .\n                  defField \"idprefix\" (literal $ writerIdentifierPrefix opts) .\n                  -- these should maybe be set in pandoc.hs\n                  defField \"slidy-url\"\n                    (\"https://www.w3.org/Talks/Tools/Slidy2\" :: Doc Text) .\n                  defField \"slideous-url\" (\"slideous\" :: Doc Text) .\n                  defField \"revealjs-url\" (\"https://unpkg.com/reveal.js@^5\" :: Doc Text) $\n                  defField \"s5-url\" (\"s5/default\" :: Doc Text) .\n                  defField \"table-caption-below\"\n                     (writerTableCaptionPosition opts == CaptionBelow) .\n                  defField \"html5\" (stHtml5 st) $\n                  metadata\n  return (thebody, context)\n\n-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix\nprefixedId :: WriterOptions -> Text -> Attribute\nprefixedId opts s =\n  case s of\n    \"\" -> mempty\n    _  -> A.id $ toValue $ writerIdentifierPrefix opts <> s\n\ntoList :: PandocMonad m\n       => (Html -> Html)\n       -> WriterOptions\n       -> [Html]\n       -> StateT WriterState m Html\ntoList listop opts items = do\n    slideVariant <- gets stSlideVariant\n    return $\n      if writerIncremental opts\n         then if slideVariant /= RevealJsSlides\n                 then  listop (mconcat items) ! A.class_ \"incremental\"\n                 else listop $ mconcat $ map (! A.class_ \"fragment\") items\n         else listop $ mconcat items\n\nunordList :: PandocMonad m\n          => WriterOptions -> [Html] -> StateT WriterState m Html\nunordList opts = toList H.ul opts . toListItems\n\nordList :: PandocMonad m\n        => WriterOptions -> [Html] -> StateT WriterState m Html\nordList opts = toList H.ol opts . toListItems\n\ndefList :: PandocMonad m\n        => WriterOptions -> [Html] -> StateT WriterState m Html\ndefList opts items = toList H.dl opts (items ++ [nl])\n\nlistItemToHtml :: PandocMonad m\n               => WriterOptions -> [Block] -> StateT WriterState m Html\nlistItemToHtml opts bls =\n  case toTaskListItem bls of\n    Just (checked, (Para is:bs)) -> taskListItem checked H.p is bs\n    Just (checked, (Plain is:bs)) -> taskListItem checked id is bs\n    _ -> blockListToHtml opts bls\n  where\n    taskListItem checked constr is bs = do\n      let checkbox  = if checked\n                      then checkbox' ! A.checked \"\"\n                      else checkbox'\n          checkbox' = H.input ! A.type_ \"checkbox\"\n      isContents <- inlineListToHtml opts is\n      bsContents <- blockListToHtml opts bs\n      return $ constr (H.label (checkbox >> isContents)) >>\n               (if null bs then mempty else nl) >>\n               bsContents\n\n-- | Construct table of contents from list of elements.\ntableOfContents :: PandocMonad m => WriterOptions -> [Block]\n                -> StateT WriterState m (Maybe Html)\ntableOfContents _ [] = return Nothing\ntableOfContents opts sects = do\n  -- in reveal.js, we need #/apples, not #apples:\n  slideVariant <- gets stSlideVariant\n  let opts' = case slideVariant of\n                RevealJsSlides ->\n                  opts{ writerIdentifierPrefix =\n                          \"/\" <> writerIdentifierPrefix opts }\n                _ -> opts\n  case toTableOfContents opts sects of\n    bl@(BulletList (_:_)) -> Just <$> blockToHtml opts' bl\n    _                     -> return Nothing\n\n-- | Convert list of Note blocks to a footnote <div>.\n-- Assumes notes are sorted.\nfootnoteSection ::\n  PandocMonad m => WriterOptions -> ReferenceLocation -> Int -> [Html] -> StateT WriterState m Html\nfootnoteSection opts refLocation startCounter notes = do\n  html5 <- gets stHtml5\n  slideVariant <- gets stSlideVariant\n  let hrtag = if refLocation /= EndOfBlock\n                 then (if html5 then H5.hr else H.hr) <> nl\n                 else mempty\n  idName <- do\n    blockCount <- gets stEmittedNoteBlocks\n    modify $ \\st -> st{ stEmittedNoteBlocks = blockCount + 1 }\n    return $\n      -- Keep the first note section's id undecorated to maintain a target for\n      -- old links which don't expect numbered sections, or for when the notes\n      -- are rendered all together at the end of the document.\n      if blockCount <= 0\n        then \"footnotes\"\n        else \"footnotes-\" <> show (blockCount + 1)\n  let additionalClassName = case refLocation of\n        EndOfBlock -> \"footnotes-end-of-block\"\n        EndOfDocument -> \"footnotes-end-of-document\"\n        EndOfSection -> \"footnotes-end-of-section\"\n  let className = \"footnotes \" <> additionalClassName\n  epubVersion <- gets stEPUBVersion\n  let container x\n        | html5\n        , epubVersion == Just EPUB3\n                = H5.section ! A.id (fromString idName)\n                             ! A.class_ className\n                             ! customAttribute \"epub:type\" \"footnotes\" $ x\n        | html5\n        , refLocation == EndOfDocument\n        -- Note: we need a section for a new slide in slide formats.\n                = H5.section ! prefixedId opts (fromString idName)\n                             ! A5.class_ className\n                             ! A5.role \"doc-endnotes\"\n                             $ x\n        | html5 = H5.aside   ! prefixedId opts (fromString idName)\n                             ! A5.class_ className\n                             ! A5.role \"doc-footnote\"\n                             $ x\n        | slideVariant /= NoSlides = H.div ! A.class_ \"footnotes slide\" $ x\n        | otherwise = H.div ! A.class_ className $ x\n  return $\n    if null notes\n       then mempty\n       else do\n         nl\n         container $ do\n           nl\n           hrtag\n           -- Keep the previous output exactly the same if we don't\n           -- have multiple notes sections\n           case epubVersion of\n             Just _ -> mconcat notes\n             Nothing | startCounter == 1 ->\n               (H.ol (nl >> mconcat notes)) >> nl\n             Nothing -> (H.ol ! A.start (fromString (show startCounter)) $\n                         nl >> mconcat notes) >> nl\n\n-- | Parse a mailto link; return Just (name, domain) or Nothing.\nparseMailto :: Text -> Maybe (Text, Text)\nparseMailto s =\n  case T.break (==':') s of\n       (xs,T.uncons -> Just (':',addr)) | T.toLower xs == \"mailto\" -> do\n         let (name', rest) = T.span (/='@') addr\n         let domain = T.drop 1 rest\n         return (name', domain)\n       _ -> Prelude.fail \"not a mailto: URL\"\n\n-- | Obfuscate a \"mailto:\" link.\nobfuscateLink :: PandocMonad m\n              => WriterOptions -> Attr -> Html -> Text\n              -> StateT WriterState m Html\nobfuscateLink opts attr txt s | writerEmailObfuscation opts == NoObfuscation = do\n  html5 <- gets stHtml5\n  addAttrs opts attr $ H.a ! A.href (toValue $ toURI html5 s) $ txt\nobfuscateLink opts attr (TL.toStrict . renderHtml -> txt) s = do\n  html5 <- gets stHtml5\n  let meth = writerEmailObfuscation opts\n  let s' = T.toLower (T.take 7 s) <> T.drop 7 s\n  case parseMailto s' of\n        (Just (name', domain)) ->\n          let domain'  = T.replace \".\" \" dot \" domain\n              at'      = obfuscateChar '@'\n              (linkText, altText) =\n                 if txt == T.drop 7 s' -- autolink\n                    then (\"e\", name' <> \" at \" <> domain')\n                    else (\"'\" <> obfuscateString txt <> \"'\",\n                          txt <> \" (\" <> name' <> \" at \" <> domain' <> \")\")\n              (_, classNames, _) = attr\n              classNamesStr = T.concat $ map (\" \"<>) classNames\n          in  case meth of\n                ReferenceObfuscation ->\n                     -- need to use preEscapedString or &'s are escaped to &amp; in URL\n                     return $\n                     preEscapedText $ \"<a href=\\\"\" <> obfuscateString s'\n                     <> \"\\\" class=\\\"email\\\">\" <> obfuscateString txt <> \"</a>\"\n                JavascriptObfuscation ->\n                     return $\n                     (H.script ! A.type_ \"text/javascript\" $\n                     preEscapedText (\"\\n<!--\\nh='\" <>\n                     obfuscateString domain <> \"';a='\" <> at' <> \"';n='\" <>\n                     obfuscateString name' <> \"';e=n+a+h;\\n\" <>\n                     \"document.write('<a h'+'ref'+'=\\\"ma'+'ilto'+':'+e+'\\\" clas'+'s=\\\"em' + 'ail\" <>\n                     classNamesStr <> \"\\\">'+\" <>\n                     linkText  <> \"+'<\\\\/'+'a'+'>');\\n// -->\\n\")) >>\n                     H.noscript (preEscapedText $ obfuscateString altText)\n                _ -> throwError $ PandocSomeError $ \"Unknown obfuscation method: \" <> tshow meth\n        _ -> addAttrs opts attr $ H.a ! A.href (toValue $ toURI html5 s)\n                                      $ toHtml txt  -- malformed email\n\n-- | Obfuscate character as entity.\nobfuscateChar :: Char -> Text\nobfuscateChar char =\n  let num    = ord char\n      numstr = if even num then show num else \"x\" <> showHex num \"\"\n  in  \"&#\" <> T.pack numstr <> \";\"\n\n-- | Obfuscate string using entities.\nobfuscateString :: Text -> Text\nobfuscateString = T.concatMap obfuscateChar . fromEntities\n\n-- | Create HTML tag with attributes.\ntagWithAttributes :: WriterOptions\n                  -> Bool -- ^ True for HTML5\n                  -> Bool -- ^ True if self-closing tag\n                  -> Text -- ^ Tag text\n                  -> Attr -- ^ Pandoc style tag attributes\n                  -> Text\ntagWithAttributes opts html5 selfClosing tagname attr =\n  let mktag = (TL.toStrict . renderHtml <$> evalStateT\n               (addAttrs opts attr (customLeaf (textTag tagname) selfClosing))\n               defaultWriterState{ stHtml5 = html5 })\n  in  case runPure mktag of\n           Left _  -> mempty\n           Right t -> t\n\naddAttrs :: PandocMonad m\n         => WriterOptions -> Attr -> Html -> StateT WriterState m Html\naddAttrs opts attr h = L.foldl' (!) h <$> attrsToHtml opts attr\n\ntoAttrs :: PandocMonad m\n        => [(Text, Text)] -> StateT WriterState m [Attribute]\ntoAttrs kvs = do\n  html5 <- gets stHtml5\n  mbEpubVersion <- gets stEPUBVersion\n  reverse . snd <$> foldM (go html5 mbEpubVersion) (Set.empty, []) kvs\n where\n  go html5 mbEpubVersion (keys, attrs) (k,v) = do\n    if k `Set.member` keys\n       then do\n         report $ DuplicateAttribute k v\n         return (keys, attrs)\n       else return (Set.insert k keys, addAttr html5 mbEpubVersion k v attrs)\n  addAttr html5 mbEpubVersion x y\n    | T.null x = id  -- see #7546\n    | html5\n      = if (x `Set.member` (html5Attributes <> rdfaAttributes)\n            && x /= \"label\") -- #10048\n             || T.any (== ':') x -- e.g. epub: namespace\n             || \"data-\" `T.isPrefixOf` x\n             || \"aria-\" `T.isPrefixOf` x\n           then (customAttribute (textTag x) (toValue y) :)\n           else (customAttribute (textTag (\"data-\" <> x)) (toValue y) :)\n    | mbEpubVersion == Just EPUB2\n    , not (x `Set.member` (html4Attributes <> rdfaAttributes) ||\n      \"xml:\" `T.isPrefixOf` x)\n      = id\n    | otherwise\n      = (customAttribute (textTag x) (toValue y) :)\n\nattrsToHtml :: PandocMonad m\n            => WriterOptions -> Attr -> StateT WriterState m [Attribute]\nattrsToHtml opts (id',classes',keyvals) = do\n  attrs <- toAttrs keyvals\n  let classes'' = nubOrd $ filter (not . T.null) classes'\n  return $\n    [prefixedId opts id' | not (T.null id')] ++\n    [A.class_ (toValue $ T.unwords classes'') | not (null classes'')] ++ attrs\n\nimgAttrsToHtml :: PandocMonad m\n               => WriterOptions -> Attr -> StateT WriterState m [Attribute]\nimgAttrsToHtml opts attr = do\n  attrsToHtml opts (ident,cls, consolidateStyles (kvs' ++ dimensionsToAttrList attr))\n  where\n    (ident,cls,kvs) = attr\n    kvs' = filter isNotDim kvs\n    isNotDim (\"width\", _)  = False\n    isNotDim (\"height\", _) = False\n    isNotDim _             = True\n    consolidateStyles :: [(Text, Text)] -> [(Text, Text)]\n    consolidateStyles xs =\n      case partition isStyle xs of\n           ([], _)    -> xs\n           (ss, rest) -> (\"style\", T.intercalate \";\" $ map snd ss) : rest\n    isStyle (\"style\", _) = True\n    isStyle _            = False\n\ndimensionsToAttrList :: Attr -> [(Text, Text)]\ndimensionsToAttrList attr = go Width ++ go Height\n  where\n    go dir = case dimension dir attr of\n               (Just (Pixel a)) -> [(tshow dir, tshow a)]\n               (Just x)         -> [(\"style\", tshow dir <> \":\" <> tshow x)]\n               Nothing          -> []\n\nblockToHtmlInner :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html\nblockToHtmlInner opts (Plain lst) = inlineListToHtml opts lst\nblockToHtmlInner opts (Para lst) = do\n  slideVariant <- gets stSlideVariant\n  case (slideVariant, lst) of\n    (RevealJsSlides, [Image attr@(_,classes,_) txt (src,tit)])\n      | \"r-stretch\" `elem` classes -> do\n          -- a \"stretched\" image in reveal.js must be a direct child\n          -- of the slide container\n          inlineToHtml opts (Image attr txt (src, tit))\n    _ -> do\n      contents <- inlineListToHtml opts lst\n      case contents of\n        Empty _ | not (isEnabled Ext_empty_paragraphs opts) -> return mempty\n        _ -> return $ H.p contents\nblockToHtmlInner opts (LineBlock lns) = do\n  htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns\n  return $ H.div ! A.class_ \"line-block\" $ htmlLines\nblockToHtmlInner opts (Div (ident, \"section\":dclasses, dkvs)\n                   (Header level\n                     hattr@(hident,hclasses,hkvs) ils : xs)) = do\n  slideVariant <- gets stSlideVariant\n  slideLevel <- gets stSlideLevel\n  let slide = slideVariant /= NoSlides &&\n               level <= slideLevel {- DROPPED old fix for #5168 here -}\n  html5 <- gets stHtml5\n  let titleSlide = slide && level < slideLevel\n  let level' = if level <= slideLevel && slideVariant == SlidySlides\n                  then 1 -- see #3566\n                  else level\n  header' <- if ils == [Str \"\\0\"]  -- marker for hrule\n                then return mempty\n                else blockToHtml opts (Header level' hattr ils)\n  let isSec (Div (_,\"section\":_,_) _) = True\n      isSec (Div _ zs)                = any isSec zs\n      isSec _                         = False\n  let isPause (Para [Str \".\",Space,Str \".\",Space,Str \".\"]) = True\n      isPause _                                            = False\n  let fragmentClass = case slideVariant of\n                           RevealJsSlides -> \"fragment\"\n                           _              -> \"incremental\"\n  let inDiv' zs = RawBlock (Format \"html\") (\"<div class=\\\"\"\n                       <> fragmentClass <> \"\\\">\") :\n                   (zs ++ [RawBlock (Format \"html\") \"</div>\"])\n  let breakOnPauses zs\n        | slide = case splitBy isPause zs of\n                           []   -> []\n                           y:ys -> y ++ concatMap inDiv' ys\n        | otherwise = zs\n  let (titleBlocks, innerSecs) =\n        if titleSlide\n           -- title slides have no content of their own\n           then let (as, bs) = break isSec xs\n                in  (walk breakOnPauses as, bs)\n           else ([], walk breakOnPauses xs)\n  let secttag  = if html5\n                    then H5.section\n                    else H.div\n  titleContents <- blockListToHtml opts titleBlocks\n  inSection <- gets stInSection\n  innerContents <- do\n    modify $ \\st -> st{ stInSection = True }\n    res <- blockListToHtml opts innerSecs\n    modify $ \\st -> st{ stInSection = inSection }\n    notes <- gets stNotes\n    let emitNotes = writerReferenceLocation opts == EndOfSection &&\n                     not (null notes)\n    if emitNotes\n      then do\n        st <- get\n        renderedNotes <- footnoteSection opts (writerReferenceLocation opts)\n                           (stEmittedNotes st + 1) (reverse notes)\n        modify (\\st' -> st'{ stNotes = mempty,\n                             stEmittedNotes = stEmittedNotes st' + length notes })\n        return (res <> renderedNotes)\n      else return res\n  let classes' = [\"title-slide\" | titleSlide] ++ [\"slide\" | slide] ++\n                  [\"section\" | (slide || writerSectionDivs opts) &&\n                               not html5 ] ++\n                  [\"level\" <> tshow level | slide || writerSectionDivs opts ]\n                  <> [d | d <- dclasses,\n                               slideVariant /= RevealJsSlides ||\n                               d /= \"r-fit-text\"] -- see #5965\n  let attr = (ident, classes', dkvs)\n  if titleSlide\n     then do\n       t <- addAttrs opts attr $\n             secttag $ nl <> header' <> nl <> titleContents <> nl\n       -- ensure 2D nesting for revealjs, but only for one level;\n       -- revealjs doesn't like more than one level of nesting\n       return $\n         if slideVariant == RevealJsSlides && not inSection &&\n              not (null innerSecs)\n            then H5.section (nl <> t <> nl <> innerContents)\n            else t <> nl <> if null innerSecs\n                                    then mempty\n                                    else innerContents <> nl\n     else if writerSectionDivs opts || slide ||\n              (hident /= ident && not (T.null hident || T.null ident)) ||\n              (hclasses /= dclasses) || (hkvs /= dkvs)\n          then addAttrs opts attr\n               $ secttag\n               $ nl <> header' <> nl <>\n                 if null innerSecs\n                    then mempty\n                    else innerContents <> nl\n          else do\n            let attr' = (ident, classes' \\\\ hclasses, dkvs \\\\ hkvs)\n            t <- addAttrs opts attr' header'\n            return $ t <>\n                     if null innerSecs\n                        then mempty\n                        else nl <> innerContents\nblockToHtmlInner opts (Div (ident, classes, kvs) [b])\n  | Just \"1\" <- lookup \"wrapper\" kvs\n    -- unwrap \"wrapper\" div, putting attr on child\n  = blockToHtmlInner opts b >>=\n      addAttrs opts (ident, classes, [(k,v) | (k,v) <- kvs, k /= \"wrapper\"])\nblockToHtmlInner opts (Div attr@(ident, classes, kvs') bs) = do\n  html5 <- gets stHtml5\n  slideVariant <- gets stSlideVariant\n  let isCslBibBody = ident == \"refs\" || \"csl-bib-body\" `elem` classes\n  when isCslBibBody $ modify $ \\st -> st{ stCsl = True\n                                        , stCslEntrySpacing =\n                                           lookup \"entry-spacing\" kvs' >>=\n                                           safeRead }\n  let isCslBibEntry = \"csl-entry\" `elem` classes\n  let kvs = [(k,v) | (k,v) <- kvs'\n                   , k /= \"width\" || \"column\" `notElem` classes] ++\n            [(\"style\", \"width:\" <> w <> \";\") | \"column\" `elem` classes\n                                             , (\"width\", w) <- kvs'] ++\n            [(\"role\", \"list\") | isCslBibBody && html5] ++\n            [(\"role\", \"listitem\") | isCslBibEntry && html5]\n  let speakerNotes = \"notes\" `elem` classes\n  -- we don't want incremental output inside speaker notes, see #1394\n  let (opts', isIncrDiv) =\n        if | speakerNotes ->\n             (opts{ writerIncremental = False }, False)\n           | \"incremental\" `elem` classes ->\n             (opts{ writerIncremental = True }, True)\n           | \"nonincremental\" `elem` classes ->\n             (opts{ writerIncremental = False }, True)\n           | otherwise ->\n             (opts, False)\n      -- we remove \"incremental\" and \"nonincremental\" if we're in a\n      -- slide presentation format.\n      classes' = case slideVariant of\n        NoSlides -> classes\n        _ -> filter (\\k -> k /= \"incremental\" && k /= \"nonincremental\") classes\n  let paraToPlain (Para ils) = Plain ils\n      paraToPlain x          = x\n  let bs' = if \"csl-entry\" `elem` classes'\n               then walk paraToPlain bs\n               else bs\n  contents <- if \"columns\" `elem` classes'\n                 then -- we don't use blockListToHtml because it inserts\n                      -- a newline between the column divs, which throws\n                      -- off widths! see #4028\n                      mconcat <$> mapM (blockToHtml opts) bs'\n                 else blockListToHtml opts' bs'\n  let contents' = nl >> contents >> nl\n  let (divtag, classes'') = if html5 && \"section\" `elem` classes'\n                            then (H5.section, filter (/= \"section\") classes')\n                            else (H.div, classes')\n  if | isIncrDiv && (ident, classes'', kvs) == nullAttr ->\n         -- Unwrap divs that only have (non)increment information\n         pure contents\n     | speakerNotes ->\n         case slideVariant of\n              RevealJsSlides -> addAttrs opts' attr $\n                          H5.aside contents'\n              DZSlides       -> do\n                t <- addAttrs opts' attr $\n                            H5.div contents'\n                return $ t ! A5.role \"note\"\n              NoSlides       -> addAttrs opts' attr $\n                          H.div contents'\n              _              -> return mempty\n     | otherwise ->\n          addAttrs opts (ident, classes'', kvs) $\n              divtag contents'\nblockToHtmlInner opts (RawBlock f str) = do\n  ishtml <- isRawHtml f\n  if ishtml\n     then return $ preEscapedText str\n     else if (f == Format \"latex\" || f == Format \"tex\") &&\n             allowsMathEnvironments (writerHTMLMathMethod opts) &&\n             isMathEnvironment str\n             then do\n               modify (\\st -> st {stMath = True})\n               blockToHtml opts $ Plain [Math DisplayMath str]\n             else do\n               report $ BlockNotRendered (RawBlock f str)\n               return mempty\nblockToHtmlInner _ HorizontalRule = do\n  html5 <- gets stHtml5\n  return $ if html5 then H5.hr else H.hr\nblockToHtmlInner opts (CodeBlock (id',classes,keyvals) rawCode) = do\n  html5 <- gets stHtml5\n  slideVariant <- gets stSlideVariant\n  id'' <- if T.null id'\n             then do\n               modify $ \\st -> st{ stCodeBlockNum = stCodeBlockNum st + 1 }\n               codeblocknum <- gets stCodeBlockNum\n               return (writerIdentifierPrefix opts <> \"cb\" <> tshow codeblocknum)\n             else return (writerIdentifierPrefix opts <> id')\n  let tolhs = isEnabled Ext_literate_haskell opts &&\n                any (\\c -> T.toLower c == \"haskell\") classes &&\n                any (\\c -> T.toLower c == \"literate\") classes\n      classes' = if tolhs\n                    then map (\\c -> if T.toLower c == \"haskell\"\n                                       then \"literatehaskell\"\n                                       else c) classes\n                    else classes\n      adjCode  = if tolhs\n                    then T.unlines . map (\"> \" <>) . T.lines $ rawCode\n                    else rawCode\n      isIdiomaticRevealJs = slideVariant == RevealJsSlides &&\n                            writerHighlightMethod opts == IdiomaticHighlighting\n  if isIdiomaticRevealJs\n     then do\n       -- For idiomatic reveal.js highlighting, put attributes on <code>\n       -- with language- prefix, and let highlight.js do the highlighting.\n       modify (\\st -> st{ stHighlighting = True })\n       let (langClasses, otherClasses) = case classes' of\n             (lang:rest) -> ([\"language-\" <> lang], rest)\n             []          -> ([], [])\n           codeAttrs = (id', langClasses ++ otherClasses, keyvals)\n       codeTag <- addAttrs opts codeAttrs $ H.code $ toHtml adjCode\n       return $ H.pre codeTag\n     else do\n       let highlighted = highlight (writerSyntaxMap opts)\n                           (if html5 then formatHtmlBlock else formatHtml4Block)\n                           (id'',classes',keyvals) adjCode\n           hlCode   = case writerHighlightMethod opts of\n                        Skylighting _ -> highlighted\n                        DefaultHighlighting -> highlighted\n                        _ -> Left \"\"\n       case hlCode of\n              Left msg -> do\n                unless (T.null msg) $\n                  report $ CouldNotHighlight msg\n                addAttrs opts (id',classes,keyvals)\n                  $ H.pre $ H.code $ toHtml adjCode\n              Right h -> modify (\\st -> st{ stHighlighting = True }) >>\n                         -- we set writerIdentifierPrefix to \"\" since id'' already\n                         -- includes it:\n                         addAttrs opts{writerIdentifierPrefix = \"\"} (id'',[],keyvals) h\nblockToHtmlInner opts (BlockQuote blocks) = do\n  -- in S5, treat list in blockquote specially\n  -- if default is incremental, make it nonincremental;\n  -- otherwise incremental\n  slideVariant <- gets stSlideVariant\n  if slideVariant /= NoSlides\n     then let inc = not (writerIncremental opts) in\n          case blocks of\n             [BulletList lst]  -> blockToHtml (opts {writerIncremental = inc})\n                                  (BulletList lst)\n             [OrderedList attribs lst] ->\n                                  blockToHtml (opts {writerIncremental = inc})\n                                  (OrderedList attribs lst)\n             [DefinitionList lst] ->\n                                  blockToHtml (opts {writerIncremental = inc})\n                                  (DefinitionList lst)\n             _                 -> do contents <- blockListToHtml opts blocks\n                                     return $ H.blockquote\n                                            $ nl >> contents >> nl\n     else do\n       contents <- blockListToHtml opts blocks\n       return $ H.blockquote $ nl >> contents >> nl\nblockToHtmlInner opts (Header level (ident,classes,kvs) lst) = do\n  contents <- inlineListToHtml opts lst\n  let secnum = fromMaybe mempty $ lookup \"number\" kvs\n  let contents' = if writerNumberSections opts && not (T.null secnum)\n                     && \"unnumbered\" `notElem` classes\n                     then (H.span ! A.class_ \"header-section-number\"\n                             $ toHtml secnum) >> toHtml ' ' >> contents\n                     else contents\n  html5 <- gets stHtml5\n  let kvs' = if html5\n             then kvs\n             else [ (k, v) | (k, v) <- kvs\n                           , k `elem` ([\"lang\", \"dir\", \"title\", \"style\"\n                                      , \"align\"] ++ intrinsicEventsHTML4)]\n  let classes' = if level > 6 then \"heading\":classes else classes\n  addAttrs opts (ident,classes',kvs')\n         $ case level of\n              1 -> H.h1 contents'\n              2 -> H.h2 contents'\n              3 -> H.h3 contents'\n              4 -> H.h4 contents'\n              5 -> H.h5 contents'\n              6 -> H.h6 contents'\n              _ -> H.p  contents'\nblockToHtmlInner opts (BulletList lst) = do\n  contents <- mapM (listItemToHtml opts) lst\n  (if isJust (mapM toTaskListItem lst) then (! A.class_ \"task-list\") else id) <$>\n    unordList opts contents\nblockToHtmlInner opts (OrderedList (startnum, numstyle, _) lst) = do\n  contents <- mapM (listItemToHtml opts) lst\n  html5 <- gets stHtml5\n  let numstyle' = case numstyle of\n                       Example -> \"decimal\"\n                       _       -> camelCaseToHyphenated $ tshow numstyle\n  let attribs = [A.start $ toValue startnum | startnum /= 1] ++\n                [A.class_ \"example\" | numstyle == Example] ++\n                (if numstyle /= DefaultStyle\n                   then if html5\n                           then [A.type_ $\n                                 case numstyle of\n                                      Decimal    -> \"1\"\n                                      LowerAlpha -> \"a\"\n                                      UpperAlpha -> \"A\"\n                                      LowerRoman -> \"i\"\n                                      UpperRoman -> \"I\"\n                                      _          -> \"1\"]\n                           else [A.style $ toValue $ \"list-style-type: \" <>\n                                   numstyle']\n                   else [])\n  l <- ordList opts contents\n  return $ L.foldl' (!) l attribs\nblockToHtmlInner opts (DefinitionList lst) = do\n  contents <- mapM (\\(term, defs) ->\n                  do term' <- liftM H.dt $ inlineListToHtml opts term\n                     defs' <- mapM (liftM (\\x -> H.dd (nl >> x >> nl)) .\n                                    blockListToHtml opts) defs\n                     return $ mconcat $ nl : term' : nl :\n                                        intersperse (nl) defs') lst\n  defList opts contents\nblockToHtmlInner opts (Table attr caption colspecs thead tbody tfoot) =\n  tableToHtml opts (Ann.toTable attr caption colspecs thead tbody tfoot)\nblockToHtmlInner opts (Figure attrs (Caption _ captBody)  body) = do\n  html5 <- gets stHtml5\n\n  figAttrs <- attrsToHtml opts attrs\n  contents <- blockListToHtml opts body\n  captCont <- blockListToHtml opts captBody\n  let figCaption = mconcat $\n                    if html5\n                    then let fcattr = if captionIsAlt captBody body\n                                      then H5.customAttribute\n                                           (textTag \"aria-hidden\")\n                                           (toValue @Text \"true\")\n                                      else mempty\n                         in [ H5.figcaption ! fcattr $ captCont ]\n                    else [ (H.div ! A.class_ \"figcaption\") captCont ]\n  let innards = mconcat $\n                if null captBody\n                   then [nl, contents, nl]\n                   else case writerFigureCaptionPosition opts of\n                         CaptionAbove -> [nl, figCaption, nl, contents, nl]\n                         CaptionBelow -> [nl, contents, nl, figCaption, nl]\n  return $\n    if html5\n    then foldl (!) H5.figure figAttrs innards\n    else foldl (!) H.div (A.class_ \"float\" : figAttrs) innards\n where\n  captionIsAlt capt [Plain [Image (_, _, kv) desc _]] =\n    let alt = fromMaybe (stringify desc) $ lookup \"alt\" kv\n    in stringify capt == alt\n  captionIsAlt _ _ = False\n\n-- | Convert Pandoc block element to HTML. All the legwork is done by\n-- 'blockToHtmlInner', this just takes care of emitting the notes after\n-- the block if necessary.\nblockToHtml :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html\nblockToHtml opts block = do\n  let isSection = case block of\n        Div (_, classes, _) _ | \"section\" `elem` classes -> True\n        _ -> False\n  let increaseLevel = not isSection\n  when increaseLevel $\n    modify (\\st -> st{ stBlockLevel = stBlockLevel st + 1 })\n  doc <- blockToHtmlInner opts block\n  st <- get\n  let emitNotes =\n        writerReferenceLocation opts == EndOfBlock && stBlockLevel st == 1\n  res <- if emitNotes\n    then do\n      notes <- if null (stNotes st)\n        then return mempty\n        else footnoteSection opts (writerReferenceLocation opts)\n                             (stEmittedNotes st + 1) (reverse (stNotes st))\n      modify (\\st' -> st'{ stNotes = mempty, stEmittedNotes = stEmittedNotes st' + length (stNotes st') })\n      return (doc <> notes)\n    else return doc\n  when increaseLevel $\n    modify (\\st' -> st'{ stBlockLevel = stBlockLevel st' - 1 })\n  return res\n\ntableToHtml :: PandocMonad m\n            => WriterOptions\n            -> Ann.Table\n            -> StateT WriterState m Html\ntableToHtml opts (Ann.Table attr caption colspecs thead tbodies tfoot) = do\n  captionDoc <- case caption of\n    Caption _ [] -> return mempty\n    Caption _ longCapt -> do\n      cs <- blockListToHtml opts longCapt\n      return $ do\n        H.caption cs\n        nl\n  coltags <- colSpecListToHtml colspecs\n  head' <- tableHeadToHtml opts thead\n  bodies <- intersperse (nl) <$> mapM (tableBodyToHtml opts) tbodies\n  foot' <- tableFootToHtml opts tfoot\n  let (ident,classes,kvs) = attr\n  -- When widths of columns are < 100%, we need to set width for the whole\n  -- table, or some browsers give us skinny columns with lots of space\n  -- between:\n  let colWidth = \\case\n        ColWidth d -> d\n        ColWidthDefault -> 0\n  let totalWidth = sum . map (colWidth . snd) $ colspecs\n  let attr' = case lookup \"style\" kvs of\n                Nothing | totalWidth < 1 && totalWidth > 0\n                  -> (ident,classes, (\"style\",\"width:\" <>\n                         T.pack (show (round (totalWidth * 100) :: Int))\n                         <> \"%;\"):kvs)\n                _ -> attr\n  addAttrs opts attr' $ H.table $ do\n    nl\n    captionDoc\n    coltags\n    head'\n    mconcat bodies\n    foot'\n    nl\n\ntableBodyToHtml :: PandocMonad m\n                => WriterOptions\n                -> Ann.TableBody\n                -> StateT WriterState m Html\ntableBodyToHtml opts (Ann.TableBody attr _rowHeadCols inthead rows) =\n  addAttrs opts attr . H.tbody =<< do\n    intermediateHead <-\n      if null inthead\n      then return mempty\n      else headerRowsToHtml opts Thead inthead\n    bodyRows <- bodyRowsToHtml opts rows\n    return $ intermediateHead <> bodyRows\n\ntableHeadToHtml :: PandocMonad m\n                => WriterOptions\n                -> Ann.TableHead\n                -> StateT WriterState m Html\ntableHeadToHtml opts (Ann.TableHead attr rows) =\n  tablePartToHtml opts Thead attr rows\n\ntableFootToHtml :: PandocMonad m\n                => WriterOptions\n                -> Ann.TableFoot\n                -> StateT WriterState m Html\ntableFootToHtml opts (Ann.TableFoot attr rows) =\n  tablePartToHtml opts Tfoot attr rows\n\ntablePartToHtml :: PandocMonad m\n                => WriterOptions\n                -> TablePart\n                -> Attr\n                -> [Ann.HeaderRow]\n                -> StateT WriterState m Html\ntablePartToHtml opts tblpart attr rows =\n  if null rows || all isEmptyRow rows\n  then return mempty\n  else do\n    let tag' = case tblpart of\n                 Thead -> H.thead\n                 Tfoot -> H.tfoot\n                 Tbody -> H.tbody -- this would be unexpected\n    contents <- headerRowsToHtml opts tblpart rows\n    tablePartElement <- addAttrs opts attr $ tag' contents\n    return $ do\n      tablePartElement\n      nl\n  where\n    isEmptyRow (Ann.HeaderRow _attr _rownum cells) = all isEmptyCell cells\n    isEmptyCell (Ann.Cell _colspecs _colnum cell) =\n      cell == Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) []\n\n-- | The part of a table; header, footer, or body.\ndata TablePart = Thead | Tfoot | Tbody\n  deriving (Eq)\n\ndata CellType = HeaderCell | BodyCell\n\ndata TableRow = TableRow TablePart Attr Ann.RowNumber Ann.RowHead Ann.RowBody\n\nheaderRowsToHtml :: PandocMonad m\n                 => WriterOptions\n                 -> TablePart\n                 -> [Ann.HeaderRow]\n                 -> StateT WriterState m Html\nheaderRowsToHtml opts tablepart =\n  rowListToHtml opts . map toTableRow\n  where\n    toTableRow (Ann.HeaderRow attr rownum rowbody) =\n      TableRow tablepart attr rownum [] rowbody\n\nbodyRowsToHtml :: PandocMonad m\n               => WriterOptions\n               -> [Ann.BodyRow]\n               -> StateT WriterState m Html\nbodyRowsToHtml opts =\n  rowListToHtml opts . zipWith toTableRow [1..]\n  where\n    toTableRow rownum (Ann.BodyRow attr _rownum rowhead rowbody) =\n      TableRow Tbody attr rownum rowhead rowbody\n\n\nrowListToHtml :: PandocMonad m\n              => WriterOptions\n              -> [TableRow]\n              -> StateT WriterState m Html\nrowListToHtml opts rows =\n  (\\x -> nl *> mconcat x) <$>\n     mapM (tableRowToHtml opts) rows\n\ncolSpecListToHtml :: PandocMonad m\n                  => [ColSpec]\n                  -> StateT WriterState m Html\ncolSpecListToHtml colspecs = do\n  html5 <- gets stHtml5\n  let hasDefaultWidth (_, ColWidthDefault) = True\n      hasDefaultWidth _                    = False\n\n  let percent w = show (truncate (100*w) :: Integer) <> \"%\"\n\n  let col :: ColWidth -> Html\n      col cw = do\n        H.col ! case cw of\n          ColWidthDefault -> mempty\n          ColWidth w -> if html5\n                        then A.style (toValue $ \"width: \" <> percent w)\n                        else A.width (toValue $ percent w)\n        nl\n\n  return $\n    if all hasDefaultWidth colspecs\n    then mempty\n    else do\n      H.colgroup $ do\n        nl\n        mapM_ (col . snd) colspecs\n      nl\n\ntableRowToHtml :: PandocMonad m\n               => WriterOptions\n               -> TableRow\n               -> StateT WriterState m Html\ntableRowToHtml opts (TableRow tblpart attr _rownum rowhead rowbody) = do\n  let celltype = case tblpart of\n                   Thead -> HeaderCell\n                   _     -> BodyCell\n  headcells <- mapM (cellToHtml opts HeaderCell) rowhead\n  bodycells <- mapM (cellToHtml opts celltype) rowbody\n  rowHtml <- addAttrs opts attr $ H.tr $ do\n    nl\n    mconcat headcells\n    mconcat bodycells\n  return $ do\n    rowHtml\n    nl\n\ncolspanAttrib :: ColSpan -> Attribute\ncolspanAttrib = \\case\n  ColSpan 1 -> mempty\n  ColSpan n -> A.colspan (toValue n)\n\nrowspanAttrib :: RowSpan -> Attribute\nrowspanAttrib = \\case\n  RowSpan 1 -> mempty\n  RowSpan n -> A.rowspan (toValue n)\n\ncellToHtml :: PandocMonad m\n           => WriterOptions\n           -> CellType\n           -> Ann.Cell\n           -> StateT WriterState m Html\ncellToHtml opts celltype (Ann.Cell (colspec :| _) _colNum cell) =\n  let align = fst colspec\n  in tableCellToHtml opts celltype align cell\n\ntableCellToHtml :: PandocMonad m\n                => WriterOptions\n                -> CellType\n                -> Alignment\n                -> Cell\n                -> StateT WriterState m Html\ntableCellToHtml opts ctype colAlign (Cell attr align rowspan colspan item) = do\n  contents <- blockListToHtml opts item\n  html5 <- gets stHtml5\n  let (ident, cls, kvs) = attr\n  let tag' = case ctype of\n        BodyCell   -> H.td\n        HeaderCell -> H.th\n  let align' = case align of\n        AlignDefault -> colAlign\n        _            -> align\n  let kvs' = case htmlAlignmentToString align' of\n               Nothing ->\n                 kvs\n               Just alignStr ->\n                 if html5\n                 then htmlAddStyle (\"text-align\", alignStr) kvs\n                 else case break ((== \"align\") . fst) kvs of\n                   (_, []) -> (\"align\", alignStr) : kvs\n                   (xs, _:rest) -> xs ++ (\"align\", alignStr) : rest\n  otherAttribs <- attrsToHtml opts (ident, cls, kvs')\n  let attribs = mconcat\n              $ colspanAttrib colspan\n              : rowspanAttrib rowspan\n              : otherAttribs\n  return $ do\n    tag' ! attribs $ contents\n    nl\n\ntoListItems :: [Html] -> [Html]\ntoListItems items = map toListItem items ++ [nl]\n\ntoListItem :: Html -> Html\ntoListItem item = nl *> H.li item\n\nblockListToHtml :: PandocMonad m\n                => WriterOptions -> [Block] -> StateT WriterState m Html\nblockListToHtml opts lst =\n  mconcat . intersperse (nl) . filter nonempty\n    <$> mapM (blockToHtml opts) lst\n  where nonempty (Empty _) = False\n        nonempty _         = True\n\n-- | Convert list of Pandoc inline elements to HTML.\ninlineListToHtml :: PandocMonad m => WriterOptions -> [Inline] -> StateT WriterState m Html\ninlineListToHtml opts lst = mconcat <$> mapM (inlineToHtml opts) lst\n\n-- | Annotates a MathML expression with the tex source\nannotateMML :: XML.Element -> Text -> XML.Element\nannotateMML e tex = math (unode \"semantics\" [cs, unode \"annotation\" (annotAttrs, T.unpack tex)])\n  where\n    cs = case elChildren e of\n          []  -> unode \"mrow\" ()\n          [x] -> x\n          xs  -> unode \"mrow\" xs\n    math childs = XML.Element q as [XML.Elem childs] l\n      where\n        (XML.Element q as _ l) = e\n    annotAttrs = [XML.Attr (unqual \"encoding\") \"application/x-tex\"]\n\n\n-- | Convert Pandoc inline element to HTML.\ninlineToHtml :: PandocMonad m\n             => WriterOptions -> Inline -> StateT WriterState m Html\ninlineToHtml opts inline = do\n  html5 <- gets stHtml5\n  case inline of\n    (Str str)      -> return $ strToHtml str\n    Space          -> return $ toHtml ' '\n    SoftBreak      -> return $ case writerWrapText opts of\n                                     WrapNone     -> toHtml ' '\n                                     WrapAuto     -> toHtml ' '\n                                     WrapPreserve -> toHtml '\\n'\n    LineBreak      -> return $ do\n                        if html5 then H5.br else H.br\n                        toHtml '\\n'\n    (Span (\"\",[cls],[]) ils)\n        | cls == \"csl-block\" || cls == \"csl-left-margin\" ||\n          cls == \"csl-right-inline\" || cls == \"csl-indent\"\n        -> inlineListToHtml opts ils >>= inDiv cls\n\n    (Span (id',classes,kvs) ils) ->\n                        let go Nothing c\n                             | c `Set.member` htmlSpanLikeElements\n                               = Just (customParent (textTag c), [])\n                             | c == \"smallcaps\"\n                               = Just (H.span ! A.class_ \"smallcaps\", [])\n                             | c == \"underline\"\n                               = Just (H.u, [])\n                             | otherwise = Nothing\n                            go (Just (t,cs)) c\n                             | c `Set.member` htmlSpanLikeElements\n                               = Just (t . customParent (textTag c), cs)\n                             | c == \"smallcaps\"\n                               = Just (t . (H.span ! A.class_ \"smallcaps\"), cs)\n                             | c == \"underline\"\n                               = Just (t . H.u, cs)\n                             | otherwise\n                               = Just (t, c:cs)\n                            spanLikeTags = L.foldl' go Nothing\n                        in case spanLikeTags classes of\n                            Just (tag, cs) -> do\n                              h <- inlineListToHtml opts ils\n                              addAttrs opts (id',cs,kvs') $ tag h\n                            Nothing -> do\n                              h <- inlineListToHtml opts ils\n                              addAttrs opts (id',classes',kvs') (H.span h)\n                            where\n                              styles = [\"font-style:normal;\"\n                                       | \"csl-no-emph\" `elem` classes]\n                                    ++ [\"font-weight:normal;\"\n                                       | \"csl-no-strong\" `elem` classes]\n                                    ++ [\"font-variant:normal;\"\n                                       | \"csl-no-smallcaps\" `elem` classes]\n                              kvs' = if null styles\n                                        then kvs\n                                        else (\"style\", T.concat styles) : kvs\n                              classes' = [ c | c <- classes\n                                         , c `notElem` [ \"csl-no-emph\"\n                                                       , \"csl-no-strong\"\n                                                       , \"csl-no-smallcaps\"\n                                                       ]\n                                         ]\n\n    (Emph lst)       -> H.em <$> inlineListToHtml opts lst\n    (Underline lst)  -> H.u <$> inlineListToHtml opts lst\n    (Strong lst)     -> H.strong <$> inlineListToHtml opts lst\n    (Code attr@(ids,cs,kvs) str)\n                     -> case hlCode of\n                             Left msg -> do\n                               unless (T.null msg) $\n                                 report $ CouldNotHighlight msg\n                               addAttrs opts (ids,cs',kvs) $\n                                 fromMaybe H.code sampOrVar $\n                                 strToHtml str\n                             Right h -> do\n                               modify $ \\st -> st{ stHighlighting = True }\n                               addAttrs opts (ids,[],kvs) $\n                                 fromMaybe id sampOrVar h\n                        where hlCode = case writerHighlightMethod opts of\n                                          Skylighting _ -> highlighted\n                                          DefaultHighlighting -> highlighted\n                                          _ -> Left \"\"\n                              highlighted =  highlight (writerSyntaxMap opts)\n                                                       formatHtmlInline attr str\n                              (sampOrVar,cs')\n                                | \"sample\" `elem` cs =\n                                      (Just H.samp,\"sample\" `delete` cs)\n                                | \"variable\" `elem` cs =\n                                      (Just H.var,\"variable\" `delete` cs)\n                                | otherwise = (Nothing,cs)\n    (Strikeout lst)  -> H.del <$> inlineListToHtml opts lst\n    (SmallCaps lst)   -> (H.span ! A.class_ \"smallcaps\") <$>\n                           inlineListToHtml opts lst\n    (Superscript lst) -> H.sup <$> inlineListToHtml opts lst\n    (Subscript lst)   -> H.sub <$> inlineListToHtml opts lst\n    (Quoted quoteType lst) ->\n                        let (leftQuote, rightQuote) = case quoteType of\n                              SingleQuote -> (toHtml '‘',\n                                              toHtml '’')\n                              DoubleQuote -> (toHtml '“',\n                                              toHtml '”')\n\n                        in if writerHtmlQTags opts\n                               then do\n                                 modify $ \\st -> st{ stQuotes = True }\n                                 let (maybeAttr, lst') = case lst of\n                                      [Span attr@(_, _, kvs) cs]\n                                        | any ((==\"cite\") . fst) kvs\n                                          -> (Just attr, cs)\n                                      cs -> (Nothing, cs)\n                                 let addAttrsMb = maybe return (addAttrs opts)\n                                 inlineListToHtml opts lst' >>=\n                                   addAttrsMb maybeAttr . H.q\n                               else (\\x -> leftQuote >> x >> rightQuote)\n                                    `fmap` inlineListToHtml opts lst\n    (Math t str) -> do\n      modify (\\st -> st {stMath = True})\n      let mathClass = toValue $ (\"math \" :: Text) <>\n                      if t == InlineMath then \"inline\" else \"display\"\n      case writerHTMLMathMethod opts of\n           WebTeX url -> do\n              let imtag = if html5 then H5.img else H.img\n              let str' = T.strip str\n              let s = case t of\n                           InlineMath  -> \"\\\\textstyle \"\n                           DisplayMath -> \"\\\\displaystyle \"\n              return $ imtag ! A.style \"vertical-align:middle\"\n                             ! A.src (toValue . (url <>) . urlEncode $ s <> str')\n                             ! A.alt (toValue str')\n                             ! A.title (toValue str')\n                             ! A.class_ mathClass\n           GladTeX ->\n              return $\n                customParent (textTag \"eq\") !\n                  customAttribute \"env\"\n                    (toValue $ if t == InlineMath\n                                  then (\"math\" :: Text)\n                                  else \"displaymath\") $ strToHtml str\n           MathML -> do\n              let conf = useShortEmptyTags (const False)\n                           defaultConfigPP\n              res <- lift $ convertMath writeMathML t str\n              case res of\n                    Right r  -> return $ preEscapedString $\n                        ppcElement conf (annotateMML r str)\n                    Left il  -> (H.span ! A.class_ mathClass) <$>\n                                   inlineToHtml opts il\n           MathJax _ -> return $ H.span ! A.class_ mathClass $ toHtml $\n              case t of\n                InlineMath  -> \"\\\\(\" <> str <> \"\\\\)\"\n                DisplayMath -> \"\\\\[\" <> str <> \"\\\\]\"\n           KaTeX _ -> return $ H.span ! A.class_ mathClass $ toHtml $\n              case t of\n                InlineMath  -> str\n                DisplayMath -> str\n           PlainMath -> do\n              x <- lift (texMathToInlines t str) >>= inlineListToHtml opts\n              return $ H.span ! A.class_ mathClass $ x\n    (RawInline f str) -> do\n      ishtml <- isRawHtml f\n      if ishtml\n         then return $ preEscapedText str\n         else do\n           let istex = f == Format \"latex\" || f == Format \"tex\"\n           let mm = writerHTMLMathMethod opts\n           case istex of\n             True\n               | allowsMathEnvironments mm && isMathEnvironment str\n                 -> do\n                    modify (\\st -> st {stMath = True})\n                    inlineToHtml opts $ Math DisplayMath str\n               | allowsRef mm && isRef str\n                 -> do\n                    modify (\\st -> st {stMath = True})\n                    inlineToHtml opts $ Math InlineMath str\n             _ -> do report $ InlineNotRendered inline\n                     return mempty\n    (Link attr txt (s,_)) | \"mailto:\" `T.isPrefixOf` s -> do\n                        -- We need to remove links from link text, because an\n                        -- <a> element is not allowed inside another <a>\n                        -- element.\n                        linkText <- inlineListToHtml opts (removeLinks txt)\n                        obfuscateLink opts attr linkText s\n    (Link (ident,classes,kvs) txt (s,tit)) -> do\n                        linkText <- inlineListToHtml opts (removeLinks txt)\n                        slideVariant <- gets stSlideVariant\n                        let s' = case T.uncons s of\n                                   Just ('#',xs) -> let prefix = if slideVariant == RevealJsSlides\n                                                             then \"/\"\n                                                             else writerIdentifierPrefix opts\n                                             in  \"#\" <> prefix <> xs\n                                   _ -> s\n                        let link = H.a ! A.href (toValue $ toURI html5 s')\n                                       $ linkText\n                        link' <- addAttrs opts (ident, classes, kvs) link\n                        return $ if T.null tit\n                                    then link'\n                                    else link' ! A.title (toValue tit)\n    (Image attr@(_, _, attrList) txt (s, tit)) -> do\n                        epubVersion <- gets stEPUBVersion\n                        let alternate = stringify txt\n                        slideVariant <- gets stSlideVariant\n                        let isReveal = slideVariant == RevealJsSlides\n                        attrs <- imgAttrsToHtml opts attr\n                        let attributes =\n                              -- reveal.js uses data-src for lazy loading\n                              (if isReveal\n                                  then customAttribute \"data-src\" $ toValue s\n                                  else A.src $ toValue $ toURI html5 s) :\n                              [A.title $ toValue tit | not (T.null tit)] ++\n                              attrs\n                            imageTag = (if html5 then H5.img else H.img\n                              , [A.alt $ toValue alternate |\n                                  isNothing (lookup \"alt\" attrList) &&\n                                  (isJust epubVersion || not (null txt))] )\n                            mediaTag tg fallbackTxt =\n                              let linkTxt = if null txt\n                                            then fallbackTxt\n                                            else alternate\n                              in (tg $ H.a ! A.href (toValue $ toURI html5 s)\n                                           $ toHtml linkTxt\n                                 , [A5.controls \"\"] )\n                            s' = fromMaybe s $ T.stripSuffix \".gz\" s\n                            category =\n                              if \"data:\" `T.isPrefixOf` s\n                                 then Just . T.takeWhile (/= '/') . T.drop 5 $ s\n                                 else case parseURIReference (T.unpack s') of\n                                        Just u -> mediaCategory $ uriPath u\n                                        Nothing -> mediaCategory (T.unpack s)\n                            (tag, specAttrs) = case category of\n                              Just \"image\" -> imageTag\n                              Just \"video\" -> mediaTag H5.video \"Video\"\n                              Just \"audio\" -> mediaTag H5.audio \"Audio\"\n                              Just _       -> (H5.embed, [])\n                              _            -> imageTag\n                        return $ L.foldl' (!) tag $ attributes ++ specAttrs\n                        -- note:  null title included, as in Markdown.pl\n    (Note contents) -> do\n                        notes <- gets stNotes\n                        emittedNotes <- gets stEmittedNotes\n                        let number = emittedNotes + length notes + 1\n                        let ref = tshow number\n                        htmlContents <- blockListToNote opts ref contents\n                        epubVersion <- gets stEPUBVersion\n                        -- push contents onto front of notes\n                        modify $ \\st -> st {stNotes = htmlContents:notes}\n                        slideVariant <- gets stSlideVariant\n                        let revealSlash = T.pack ['/' | slideVariant == RevealJsSlides]\n                        let link = H.a ! A.href (toValue $ toURI html5 $ \"#\" <>\n                                         revealSlash <>\n                                         writerIdentifierPrefix opts <> \"fn\" <> ref)\n                                       ! A.class_ \"footnote-ref\"\n                                       ! prefixedId opts (\"fnref\" <> ref)\n                                       $ (if isJust epubVersion\n                                             then id\n                                             else H.sup)\n                                       $ toHtml ref\n                        return $ case epubVersion of\n                                      Just EPUB3 -> link ! customAttribute \"epub:type\" \"noteref\" ! customAttribute \"role\" \"doc-noteref\"\n                                      _ | html5  -> link ! A5.role \"doc-noteref\"\n                                      _          -> link\n    (Cite cits il)-> do contents <- inlineListToHtml opts\n                                      (if html5\n                                          then walk addBibliorefRole il\n                                          else il)\n                        let citationIds = T.unwords $ map citationId cits\n                        let result = H.span ! A.class_ \"citation\" $ contents\n                        return $ if html5\n                                    then result ! customAttribute \"data-cites\" (toValue citationIds)\n                                    else result\n\naddBibliorefRole :: Inline -> Inline\naddBibliorefRole (Link (id',classes,kvs) ils (src,tit))\n   | \"#ref-\" `T.isPrefixOf` src =\n  Link (id',classes,(\"role\",\"doc-biblioref\"):kvs) ils (src,tit)\naddBibliorefRole x = x\n\nblockListToNote :: PandocMonad m\n                => WriterOptions -> Text -> [Block]\n                -> StateT WriterState m Html\nblockListToNote opts ref blocks = do\n  epubVersion <- gets stEPUBVersion\n  html5 <- gets stHtml5\n  case epubVersion of\n    Nothing -> do -- web page\n      -- If last block is Para or Plain, include the backlink at the end of\n      -- that block. Otherwise, insert a new Plain block with the backlink.\n      let kvs = [(\"role\",\"doc-backlink\") | html5]\n      let backlink = [Link (\"\",[\"footnote-back\"],kvs)\n                        [Str \"↩\"] (\"#\" <> \"fnref\" <> ref,\"\")]\n      let blocks'  = if null blocks\n                        then []\n                        else let lastBlock   = last blocks\n                                 otherBlocks = init blocks\n                             in  case lastBlock of\n                                      Para [Image (_,cls,_) _ (_,tit)]\n                                          | \"fig:\" `T.isPrefixOf` tit\n                                            || \"r-stretch\" `elem` cls\n                                                -> otherBlocks ++ [lastBlock,\n                                                      Plain backlink]\n                                      Para lst  -> otherBlocks ++\n                                                     [Para (lst ++ backlink)]\n                                      Plain lst -> otherBlocks ++\n                                                     [Plain (lst ++ backlink)]\n                                      _         -> otherBlocks ++ [lastBlock,\n                                                     Plain backlink]\n      contents <- blockListToHtml opts blocks'\n      let noteItem = H.li ! prefixedId opts (\"fn\" <> ref) $ contents\n      return $ noteItem >> nl\n    Just epubv -> do\n      let kvs = [(\"role\",\"doc-backlink\") | html5]\n      let backlink = Link (\"\",[\"footnote-back\"],kvs)\n                        [Str ref] (\"#\" <> \"fnref\" <> ref,\"\")\n      let addBacklinkInlines bs\n             | epubv == EPUB3 = bs\n             | otherwise =\n                 case bs of\n                   (Para ils : rest) ->\n                     Para (backlink : Str \".\" : Space : ils) : rest\n                   (Plain ils : rest) ->\n                     Plain (backlink : Str \".\" : Space : ils) : rest\n                   _ -> Para [backlink , Str \".\"] : blocks\n      contents <- blockListToHtml opts (addBacklinkInlines blocks)\n      let noteItem = (if epubv == EPUB3\n                         then H5.aside ! customAttribute \"epub:type\" \"footnote\" ! customAttribute \"role\" \"doc-footnote\"\n                         else H.div) ! prefixedId opts (\"fn\" <> ref)\n                      $ nl >> contents >> nl\n      return $ noteItem >> nl\n\ninDiv :: PandocMonad m=> Text -> Html -> StateT WriterState m Html\ninDiv cls x = do\n  html5 <- gets stHtml5\n  return $\n    (if html5 then H5.div else H.div)\n                x ! A.class_ (toValue cls)\n\nisRef :: Text -> Bool\nisRef t = \"\\\\ref{\" `T.isPrefixOf` t || \"\\\\eqref{\" `T.isPrefixOf` t\n\nisMathEnvironment :: Text -> Bool\nisMathEnvironment s = \"\\\\begin{\" `T.isPrefixOf` s &&\n                         envName `elem` mathmlenvs\n  where envName = T.takeWhile (/= '}') (T.drop 7 s)\n        mathmlenvs = [ \"align\"\n                     , \"align*\"\n                     , \"alignat\"\n                     , \"alignat*\"\n                     , \"aligned\"\n                     , \"alignedat\"\n                     , \"array\"\n                     , \"Bmatrix\"\n                     , \"bmatrix\"\n                     , \"cases\"\n                     , \"CD\"\n                     , \"eqnarray\"\n                     , \"eqnarray*\"\n                     , \"equation\"\n                     , \"equation*\"\n                     , \"gather\"\n                     , \"gather*\"\n                     , \"gathered\"\n                     , \"matrix\"\n                     , \"multline\"\n                     , \"multline*\"\n                     , \"pmatrix\"\n                     , \"prooftree\" -- bussproofs\n                     , \"smallmatrix\"\n                     , \"split\"\n                     , \"subarray\"\n                     , \"Vmatrix\"\n                     , \"vmatrix\" ]\n\nallowsMathEnvironments :: HTMLMathMethod -> Bool\nallowsMathEnvironments (MathJax _) = True\nallowsMathEnvironments (KaTeX _)   = True\nallowsMathEnvironments MathML      = True\nallowsMathEnvironments (WebTeX _)  = True\nallowsMathEnvironments _           = False\n\nallowsRef :: HTMLMathMethod -> Bool\nallowsRef (MathJax _) = True\nallowsRef _           = False\n\n-- | List of intrinsic event attributes allowed on all elements in HTML4.\nintrinsicEventsHTML4 :: [Text]\nintrinsicEventsHTML4 =\n  [ \"onclick\", \"ondblclick\", \"onmousedown\", \"onmouseup\", \"onmouseover\"\n  , \"onmouseout\", \"onmouseout\", \"onkeypress\", \"onkeydown\", \"onkeyup\"]\n\n\n-- | Check to see if Format is valid HTML\nisRawHtml :: PandocMonad m => Format -> StateT WriterState m Bool\nisRawHtml f = do\n  html5 <- gets stHtml5\n  return $ f == Format \"html\" ||\n           ((html5 && f == Format \"html5\") || f == Format \"html4\") ||\n           isSlideVariant f\n\n-- | Check to see if Format matches with an HTML slide variant\nisSlideVariant :: Format -> Bool\nisSlideVariant f = f `elem` [Format \"s5\", Format \"slidy\", Format \"slideous\",\n                             Format \"dzslides\", Format \"revealjs\"]\n\ntoURI :: Bool -> Text -> Text\ntoURI isHtml5 t = if isHtml5 then t else escapeURI t\n where\n   escapeURI = T.pack . escapeURIString (not . needsEscaping) . T.unpack\n   needsEscaping c = isSpace c || T.any (== c) \"<>|\\\"{}[]^`\" || not (isAscii c)\n\nhasVariable :: Text -> DT.Template a -> Bool\nhasVariable var = checkVar\n where\n   matches v' = T.intercalate \".\" (DT.varParts v') == var\n   checkVar (DT.Interpolate v) = matches v\n   checkVar (DT.Conditional v t1 t2) = matches v || checkVar t1 || checkVar t2\n   checkVar (DT.Iterate v t1 t2) = matches v || checkVar t1 || checkVar t2\n   checkVar (DT.Nested t) = checkVar t\n   checkVar (DT.Partial _ t) = checkVar t\n   checkVar (DT.Concat t1 t2) = checkVar t1 || checkVar t2\n   checkVar (DT.Literal _) = False\n   checkVar DT.Empty = False\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Haddock.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Writers.Haddock\n   Copyright   : Copyright (C) 2014-2015,2017 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to haddock markup.\n\nHaddock:  <http://www.haskell.org/haddock/doc/html/>\n-}\nmodule Text.Pandoc.Writers.Haddock (writeHaddock) where\nimport Control.Monad (zipWithM)\nimport Control.Monad.State.Strict\n    ( StateT, MonadState(get), modify, evalStateT )\nimport Data.Char (isAlphaNum)\nimport Data.Default\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\n\ntype Notes = [[Block]]\nnewtype WriterState = WriterState { stNotes :: Notes }\ninstance Default WriterState\n  where def = WriterState{ stNotes = [] }\n\n-- | Convert Pandoc to Haddock.\nwriteHaddock :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteHaddock opts document =\n  evalStateT (pandocToHaddock opts{\n                  writerWrapText = writerWrapText opts } document) def\n\n-- | Return haddock representation of document.\npandocToHaddock :: PandocMonad m\n                => WriterOptions -> Pandoc -> StateT WriterState m Text\npandocToHaddock opts (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  body <- blockListToHaddock opts blocks\n  st <- get\n  notes' <- notesToHaddock opts (reverse $ stNotes st)\n  let main = body <> (if isEmpty notes' then empty else blankline <> notes')\n  metadata <- metaToContext opts\n               (blockListToHaddock opts)\n               (fmap chomp . inlineListToHaddock opts)\n               meta\n  let context  = defField \"body\" main metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n          Nothing  -> main\n          Just tpl -> renderTemplate tpl context\n\n-- | Return haddock representation of notes.\nnotesToHaddock :: PandocMonad m\n               => WriterOptions -> [[Block]] -> StateT WriterState m (Doc Text)\nnotesToHaddock opts notes =\n  if null notes\n     then return empty\n     else do\n       contents <- blockToHaddock opts $ OrderedList (1,DefaultStyle,DefaultDelim) notes\n       return $ text \"#notes#\" <> blankline <> contents\n\n-- | Escape special characters for Haddock.\nescapeString :: Text -> Text\nescapeString t\n  | T.all isAlphaNum t = t\n  | otherwise = T.concatMap escChar t\n where\n  escChar '\\\\' = \"\\\\\\\\\"\n  escChar '/'  = \"\\\\/\"\n  escChar '\\'' = \"\\\\'\"\n  escChar '`'  = \"\\\\`\"\n  escChar '\"'  = \"\\\\\\\"\"\n  escChar '@'  = \"\\\\@\"\n  escChar '<'  = \"\\\\<\"\n  escChar c    = T.singleton c\n\n-- | Convert Pandoc block element to haddock.\nblockToHaddock :: PandocMonad m\n               => WriterOptions -- ^ Options\n               -> Block         -- ^ Block element\n               -> StateT WriterState m (Doc Text)\nblockToHaddock opts (Div _ ils) = do\n  contents <- blockListToHaddock opts ils\n  return $ contents <> blankline\nblockToHaddock opts (Plain inlines) = do\n  contents <- inlineListToHaddock opts inlines\n  return $ contents <> cr\nblockToHaddock opts (Para inlines) =\n  -- TODO:  if it contains linebreaks, we need to use a @...@ block\n  (<> blankline) `fmap` blockToHaddock opts (Plain inlines)\nblockToHaddock opts (LineBlock lns) =\n  blockToHaddock opts $ linesToPara lns\nblockToHaddock _ b@(RawBlock f str)\n  | f == \"haddock\" =\n      return $ literal str <> text \"\\n\"\n  | otherwise = do\n    report $ BlockNotRendered b\n    return empty\nblockToHaddock opts HorizontalRule =\n  return $ blankline <> text (replicate (writerColumns opts) '_') <> blankline\nblockToHaddock opts (Header level (ident,_,_) inlines) = do\n  contents <- inlineListToHaddock opts inlines\n  let attr' = if T.null ident\n                 then empty\n                 else cr <> text \"#\" <> literal ident <> text \"#\"\n  return $ nowrap (text (replicate level '=') <> space <> contents)\n                 <> attr' <> blankline\nblockToHaddock _ (CodeBlock (_,_,_) str) =\n  return $ prefixed \"> \" (literal str) <> blankline\n-- Nothing in haddock corresponds to block quotes:\nblockToHaddock opts (BlockQuote blocks) =\n  blockListToHaddock opts blocks\nblockToHaddock opts (Table _ blkCapt specs thead tbody tfoot) = do\n  let Caption _ caption = blkCapt\n  caption' <- blockListToHaddock opts caption\n  let caption'' = if null caption\n                     then empty\n                     else blankline <> caption' <> blankline\n  tbl <- gridTable opts blockListToHaddock specs thead tbody tfoot\n  return $ (tbl $$ blankline $$ caption'') $$ blankline\nblockToHaddock opts (BulletList items) = do\n  contents <- mapM (bulletListItemToHaddock opts) items\n  return $ (if isTightList items then vcat else vsep) contents <> blankline\nblockToHaddock opts (OrderedList (start,_,delim) items) = do\n  let attribs = (start, Decimal, delim)\n  let markers  = orderedListMarkers attribs\n  let markers' = map (\\m -> if T.length m < 3\n                               then m <> T.replicate (3 - T.length m) \" \"\n                               else m) markers\n  contents <- zipWithM (orderedListItemToHaddock opts) markers' items\n  return $ (if isTightList items then vcat else vsep) contents <> blankline\nblockToHaddock opts (DefinitionList items) = do\n  contents <- mapM (definitionListItemToHaddock opts) items\n  return $ vcat contents <> blankline\nblockToHaddock opts (Figure _ (Caption _ longcapt) body) =\n  -- Haddock has no concept of figures, floats, or captions.\n  fmap (<> blankline) (blockListToHaddock opts (body ++ longcapt))\n\n-- | Convert bullet list item (list of blocks) to haddock\nbulletListItemToHaddock :: PandocMonad m\n                        => WriterOptions -> [Block] -> StateT WriterState m (Doc Text)\nbulletListItemToHaddock opts items = do\n  contents <- blockListToHaddock opts items\n  let sps = replicate (writerTabStop opts - 2) ' '\n  let start = text ('-' : ' ' : sps)\n  return $ hang (writerTabStop opts) start contents $$\n           if endsWithPlain items\n              then cr\n              else blankline\n\n-- | Convert ordered list item (a list of blocks) to haddock\norderedListItemToHaddock :: PandocMonad m\n                         => WriterOptions -- ^ options\n                         -> Text        -- ^ list item marker\n                         -> [Block]       -- ^ list item (list of blocks)\n                         -> StateT WriterState m (Doc Text)\norderedListItemToHaddock opts marker items = do\n  contents <- blockListToHaddock opts items\n  let sps = case T.length marker - writerTabStop opts of\n                   n | n > 0 -> text $ replicate n ' '\n                   _ -> text \" \"\n  let start = literal marker <> sps\n  return $ hang (writerTabStop opts) start contents $$\n           if endsWithPlain items\n              then cr\n              else blankline\n\n-- | Convert definition list item (label, list of blocks) to haddock\ndefinitionListItemToHaddock :: PandocMonad m\n                            => WriterOptions\n                            -> ([Inline],[[Block]])\n                            -> StateT WriterState m (Doc Text)\ndefinitionListItemToHaddock opts (label, defs) = do\n  labelText <- inlineListToHaddock opts label\n  defs' <- mapM (mapM (blockToHaddock opts)) defs\n  let contents = (if isTightList defs then vcat else vsep) $\n                 map (\\d -> hang 4 empty $ vcat d <> cr) defs'\n  return $ nowrap (brackets labelText) $$ contents $$\n           if isTightList defs\n              then cr\n              else blankline\n\n-- | Convert list of Pandoc block elements to haddock\nblockListToHaddock :: PandocMonad m\n                   => WriterOptions -- ^ Options\n                   -> [Block]       -- ^ List of block elements\n                   -> StateT WriterState m (Doc Text)\nblockListToHaddock opts blocks =\n  mconcat <$> mapM (blockToHaddock opts) blocks\n\n-- | Convert list of Pandoc inline elements to haddock.\ninlineListToHaddock :: PandocMonad m\n                    => WriterOptions -> [Inline] -> StateT WriterState m (Doc Text)\ninlineListToHaddock opts lst =\n  mconcat <$> mapM (inlineToHaddock opts) lst\n\n-- | Convert Pandoc inline element to haddock.\ninlineToHaddock :: PandocMonad m\n                => WriterOptions -> Inline -> StateT WriterState m (Doc Text)\ninlineToHaddock opts (Span (ident,_,_) ils) = do\n  contents <- inlineListToHaddock opts ils\n  if not (T.null ident) && null ils\n     then return $ \"#\" <> literal ident <> \"#\"\n     else return contents\ninlineToHaddock opts (Emph lst) = do\n  contents <- inlineListToHaddock opts lst\n  return $ \"/\" <> contents <> \"/\"\n-- Underline is not supported, treat the same as Emph\ninlineToHaddock opts (Underline lst) =\n  inlineToHaddock opts (Emph lst)\ninlineToHaddock opts (Strong lst) = do\n  contents <- inlineListToHaddock opts lst\n  return $ \"__\" <> contents <> \"__\"\ninlineToHaddock opts (Strikeout lst) = do\n  contents <- inlineListToHaddock opts lst\n  -- not supported in haddock, but we fake it:\n  return $ \"~~\" <> contents <> \"~~\"\n-- not supported in haddock:\ninlineToHaddock opts (Superscript lst) = inlineListToHaddock opts lst\n-- not supported in haddock:\ninlineToHaddock opts (Subscript lst) = inlineListToHaddock opts lst\n-- not supported in haddock:\ninlineToHaddock opts (SmallCaps lst) = inlineListToHaddock opts lst\ninlineToHaddock opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToHaddock opts lst\n  return $ \"‘\" <> contents <> \"’\"\ninlineToHaddock opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToHaddock opts lst\n  return $ \"“\" <> contents <> \"”\"\ninlineToHaddock _ (Code _ str) =\n  return $ \"@\" <> literal (escapeString str) <> \"@\"\ninlineToHaddock _ (Str str) =\n  return $ literal $ escapeString str\ninlineToHaddock _ (Math mt str) =\n  return $ case mt of\n    DisplayMath -> cr <> \"\\\\[\" <> literal str <> \"\\\\]\" <> cr\n    InlineMath  -> \"\\\\(\" <> literal str <> \"\\\\)\"\ninlineToHaddock _ il@(RawInline f str)\n  | f == \"haddock\" = return $ literal str\n  | otherwise = do\n    report $ InlineNotRendered il\n    return empty\n-- no line break in haddock (see above on CodeBlock)\ninlineToHaddock _ LineBreak = return cr\ninlineToHaddock opts SoftBreak =\n  case writerWrapText opts of\n       WrapAuto     -> return space\n       WrapNone     -> return space\n       WrapPreserve -> return cr\ninlineToHaddock _ Space = return space\ninlineToHaddock opts (Cite _ lst) = inlineListToHaddock opts lst\ninlineToHaddock _ (Link _ txt (src, _)) = do\n  let linktext = literal $ escapeString $ stringify txt\n  let useAuto = isURI src &&\n                case txt of\n                      [Str s] | escapeURI s == src -> True\n                      _       -> False\n  return $ nowrap $ \"<\" <> literal src <>\n           (if useAuto then empty else space <> linktext) <> \">\"\ninlineToHaddock opts (Image attr alternate (source, tit)) = do\n  linkhaddock <- inlineToHaddock opts (Link attr alternate (source, tit))\n  return $ \"<\" <> linkhaddock <> \">\"\n-- haddock doesn't have notes, but we can fake it:\ninlineToHaddock opts (Note contents) = do\n  modify (\\st -> st{ stNotes = contents : stNotes st })\n  st <- get\n  let ref = literal $ writerIdentifierPrefix opts <> tshow (length $ stNotes st)\n  return $ \"<#notes [\" <> ref <> \"]>\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/ICML.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\n{- |\n   Module      : Text.Pandoc.Writers.ICML\n   Copyright   : Copyright (C) 2013-2020 github.com/mb21\n   License     : GNU GPL, version 2 or above\n\n   Stability   : alpha\n\nConversion of 'Pandoc' documents to Adobe InCopy ICML, a stand-alone XML format\nwhich is a subset of the zipped IDML format for which the documentation is\navailable here: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/sdk/cs6/idml/idml-specification.pdf\nInCopy is the companion word-processor to Adobe InDesign and ICML documents can be integrated\ninto InDesign with File -> Place.\n-}\nmodule Text.Pandoc.Writers.ICML (writeICML) where\nimport Control.Monad.Except (catchError)\nimport Control.Monad (liftM2)\nimport Control.Monad.State.Strict\n    ( MonadTrans(lift), StateT(runStateT), MonadState(state, get, put) )\nimport Data.List (intersperse)\nimport Data.Maybe (fromMaybe, maybeToList)\nimport qualified Data.Set as Set\nimport qualified Data.Text as Text\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, fetchItem, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout hiding (link)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI (isURI)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Math (texMathToInlines)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.XML\n\ntype Style = [Text]\ntype Hyperlink = [(Int, Text)]\n\ndata WriterState = WriterState{\n    blockStyles  :: Set.Set Text\n  , inlineStyles :: Set.Set Text\n  , objectStyles :: Set.Set Text\n  , links        :: Hyperlink\n  , listDepth    :: Int\n  , maxListDepth :: Int\n  }\n\ntype WS m = StateT WriterState m\n\ndefaultWriterState :: WriterState\ndefaultWriterState = WriterState{\n    blockStyles  = Set.empty\n  , inlineStyles = Set.empty\n  , objectStyles = Set.empty\n  , links        = []\n  , listDepth    = 1\n  , maxListDepth = 0\n  }\n\n-- inline names (appear in InDesign's character styles pane)\nemphName        :: Text\nunderlineName   :: Text\nstrongName      :: Text\nstrikeoutName   :: Text\nsuperscriptName :: Text\nsubscriptName   :: Text\nsmallCapsName   :: Text\ncodeName        :: Text\nlinkName        :: Text\nemphName        = \"Italic\"\nunderlineName   = \"Underline\"\nstrongName      = \"Bold\"\nstrikeoutName   = \"Strikeout\"\nsuperscriptName = \"Superscript\"\nsubscriptName   = \"Subscript\"\nsmallCapsName   = \"SmallCaps\"\ncodeName        = \"Code\"\nlinkName        = \"Link\"\n\n-- block element names (appear in InDesign's paragraph styles pane)\nparagraphName     :: Text\nfigureName        :: Text\nimgCaptionName    :: Text\ncodeBlockName     :: Text\nblockQuoteName    :: Text\norderedListName   :: Text\nbulletListName    :: Text\ndefListTermName   :: Text\ndefListDefName    :: Text\nheaderName        :: Text\ntableName         :: Text\ntableHeaderName   :: Text\ntableCaptionName  :: Text\nalignLeftName     :: Text\nalignRightName    :: Text\nalignCenterName   :: Text\nfirstListItemName :: Text\nbeginsWithName    :: Text\nlowerRomanName    :: Text\nupperRomanName    :: Text\nlowerAlphaName    :: Text\nupperAlphaName    :: Text\nsubListParName    :: Text\nfootnoteName      :: Text\nciteName          :: Text\nparagraphName     = \"Paragraph\"\nfigureName        = \"Figure\"\nimgCaptionName    = \"Caption\"\ncodeBlockName     = \"CodeBlock\"\nblockQuoteName    = \"Blockquote\"\norderedListName   = \"NumList\"\nbulletListName    = \"BulList\"\ndefListTermName   = \"DefListTerm\"\ndefListDefName    = \"DefListDef\"\nheaderName        = \"Header\"\ntableName         = \"TablePar\"\ntableHeaderName   = \"TableHeader\"\ntableCaptionName  = \"TableCaption\"\nalignLeftName     = \"LeftAlign\"\nalignRightName    = \"RightAlign\"\nalignCenterName   = \"CenterAlign\"\nfirstListItemName = \"first\"\nbeginsWithName    = \"beginsWith-\"\nlowerRomanName    = \"lowerRoman\"\nupperRomanName    = \"upperRoman\"\nlowerAlphaName    = \"lowerAlpha\"\nupperAlphaName    = \"upperAlpha\"\nsubListParName    = \"subParagraph\"\nfootnoteName      = \"Footnote\"\nciteName          = \"Cite\"\n\n-- | Convert Pandoc document to string in ICML format.\nwriteICML :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteICML opts doc = do\n  let Pandoc meta blocks = ensureValidXmlIdentifiers doc\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n      renderBlockMeta f s = fst <$> runStateT (f opts [] s) defaultWriterState\n      renderInlineMeta f s = fst <$> runStateT (f opts [] \"\" s) defaultWriterState\n  metadata <- metaToContext opts\n             (renderBlockMeta blocksToICML)\n             (renderInlineMeta inlinesToICML)\n             meta\n  (main, st) <- runStateT (blocksToICML opts [] blocks) defaultWriterState\n  let context = defField \"body\" main\n              $ defField \"charStyles\"   (charStylesToDoc st)\n              $ defField \"parStyles\"    (parStylesToDoc st)\n              $ defField \"objectStyles\" (objectStylesToDoc st)\n              $ defField \"hyperlinks\"   (hyperlinksToDoc $ links st) metadata\n  return $ render colwidth $\n    (if writerPreferAscii opts then fmap toEntities else id) $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\n-- | Auxiliary functions for parStylesToDoc and charStylesToDoc.\ncontains :: Text -> (Text, (Text, Text)) -> [(Text, Text)] -> [(Text, Text)]\ncontains s (t, (k,v)) attrs =\n  if t `Text.isInfixOf` s\n     then case lookup k attrs of -- avoid duplicates, #9158\n            Nothing -> (k, v) : attrs\n            Just _ -> attrs\n     else attrs\n\n-- | The monospaced font to use as default.\nmonospacedFont :: Doc Text\nmonospacedFont = inTags False \"AppliedFont\" [(\"type\", \"string\")] $ text \"Courier New\"\n\n-- | How much to indent blockquotes etc.\ndefaultIndent :: Int\ndefaultIndent = 20\n\n-- | How much to indent numbered lists before the number.\ndefaultListIndent :: Int\ndefaultListIndent = 10\n\n-- other constants\nlineSeparator :: Text\nlineSeparator = \"&#x2028;\"\n\n-- | Convert a WriterState with its block styles to the ICML listing of Paragraph Styles.\nparStylesToDoc :: WriterState -> Doc Text\nparStylesToDoc st = vcat $ map makeStyle $ Set.toAscList $ blockStyles st\n  where\n    makeStyle s =\n      let countSubStrs sub str = length $ Text.breakOnAll sub str\n          attrs = foldr (contains s) [] [\n                               (defListTermName, (\"BulletsAndNumberingListType\", \"BulletList\"))\n                             , (defListTermName, (\"FontStyle\", \"Bold\"))\n                             , (tableHeaderName, (\"FontStyle\", \"Bold\"))\n                             , (alignLeftName,   (\"Justification\", \"LeftAlign\"))\n                             , (alignRightName,  (\"Justification\", \"RightAlign\"))\n                             , (alignCenterName, (\"Justification\", \"CenterAlign\"))\n                             , (headerName<>\"1\", (\"PointSize\", \"36\"))\n                             , (headerName<>\"2\", (\"PointSize\", \"30\"))\n                             , (headerName<>\"3\", (\"PointSize\", \"24\"))\n                             , (headerName<>\"4\", (\"PointSize\", \"18\"))\n                             , (headerName<>\"5\", (\"PointSize\", \"14\"))\n                             ]\n          -- what is the most nested list type, if any?\n          (isBulletList, isOrderedList) = findList $ reverse $ splitTextBy (==' ') s\n            where\n              findList [] = (False, False)\n              findList (x:xs) | x == bulletListName  = (True, False)\n                              | x == orderedListName = (False, True)\n                              | otherwise = findList xs\n          nBuls = countSubStrs bulletListName s\n          nOrds = countSubStrs orderedListName s\n          attrs' = numbering <> listType <> indent <> attrs\n            where\n              numbering | isOrderedList = [(\"NumberingExpression\", \"^#.^t\"), (\"NumberingLevel\", tshow nOrds)]\n                        | otherwise     = []\n              listType | isOrderedList && not (subListParName `Text.isInfixOf` s)\n                           = [(\"BulletsAndNumberingListType\", \"NumberedList\")]\n                       | isBulletList && not (subListParName `Text.isInfixOf` s)\n                           = [(\"BulletsAndNumberingListType\", \"BulletList\")]\n                       | otherwise = []\n              indent = [(\"LeftIndent\", tshow indt)]\n                where\n                  nBlockQuotes = countSubStrs blockQuoteName s\n                  nDefLists = countSubStrs defListDefName s\n                  indt = max 0 $ defaultListIndent*(nBuls + nOrds - 1) + defaultIndent*(nBlockQuotes + nDefLists)\n          props = inTags True \"Properties\" [] (basedOn $$ tabList $$ numbForm)\n            where\n              font = if codeBlockName `Text.isInfixOf` s\n                        then monospacedFont\n                        else empty\n              basedOn = inTags False \"BasedOn\" [(\"type\", \"object\")] (text \"$ID/NormalParagraphStyle\") $$ font\n              tabList = if isBulletList\n                           then inTags True \"TabList\" [(\"type\",\"list\")] $ inTags True \"ListItem\" [(\"type\",\"record\")]\n                                $ vcat [\n                                    inTags False \"Alignment\" [(\"type\",\"enumeration\")] $ text \"LeftAlign\"\n                                  , inTags False \"AlignmentCharacter\" [(\"type\",\"string\")] $ text \".\"\n                                  , selfClosingTag \"Leader\" [(\"type\",\"string\")]\n                                  , inTags False \"Position\" [(\"type\",\"unit\")] $ text\n                                      $ show $ defaultListIndent * (nBuls + nOrds)\n                                  ]\n                           else empty\n              makeNumb name = inTags False \"NumberingFormat\" [(\"type\", \"string\")] (text name)\n              numbForm | Text.isInfixOf lowerRomanName s = makeNumb \"i, ii, iii, iv...\"\n                       | Text.isInfixOf upperRomanName s = makeNumb \"I, II, III, IV...\"\n                       | Text.isInfixOf lowerAlphaName s = makeNumb \"a, b, c, d...\"\n                       | Text.isInfixOf upperAlphaName s = makeNumb \"A, B, C, D...\"\n                       | otherwise = empty\n      in  inTags True \"ParagraphStyle\" ([(\"Self\", \"ParagraphStyle/\"<>s), (\"Name\", s)] ++ attrs') props\n\n-- | Convert a WriterState with its inline styles to the ICML listing of Character Styles.\ncharStylesToDoc :: WriterState -> Doc Text\ncharStylesToDoc st = vcat $ map makeStyle $ Set.toAscList $ inlineStyles st\n  where\n    makeStyle s =\n      let attrs = foldr (contains s) [] [\n                               (strikeoutName,   (\"StrikeThru\", \"true\"))\n                             , (superscriptName, (\"Position\", \"Superscript\"))\n                             , (subscriptName,   (\"Position\", \"Subscript\"))\n                             , (smallCapsName,   (\"Capitalization\", \"SmallCaps\"))\n                             ]\n          attrs' | Text.isInfixOf emphName s && Text.isInfixOf strongName s\n                                               = (\"FontStyle\", \"Bold Italic\") : attrs\n                 | Text.isInfixOf strongName s = (\"FontStyle\", \"Bold\") : attrs\n                 | Text.isInfixOf emphName s   = (\"FontStyle\", \"Italic\") : attrs\n                 | otherwise                   = attrs\n          props = inTags True \"Properties\" [] $\n                    inTags False \"BasedOn\" [(\"type\", \"object\")] (text \"$ID/NormalCharacterStyle\") $$ font\n                  where\n                    font =\n                      if codeName `Text.isInfixOf` s\n                         then monospacedFont\n                         else empty\n      in  inTags True \"CharacterStyle\" ([(\"Self\", \"CharacterStyle/\"<>s), (\"Name\", s)] ++ attrs') props\n\n-- | Convert a WriterState with its object styles to the ICML listing of Object Styles.\nobjectStylesToDoc :: WriterState -> Doc Text\nobjectStylesToDoc st = vcat $ map makeStyle $ Set.toAscList $ objectStyles st\n  where\n    makeStyle s =\n      let attrs = []\n          props = inTags True \"Properties\" [] $\n                    inTags False \"BasedOn\" [(\"type\", \"string\")] (text \"$ID/None\")\n      in  inTags True \"ObjectStyle\" ([(\"Self\", \"ObjectStyle/\"<>s), (\"Name\", s)] ++ attrs) props\n\n-- | Escape colon characters as %3a\nescapeColons :: Text -> Text\nescapeColons txt = Text.replace \":\" \"%3a\" txt\n\n-- | figure out the link destination for a given URL\n-- | HyperlinkURLDestination with more than one colon crashes CS6\nmakeDest :: Text -> Doc Text\nmakeDest txt = literal $\n  if \"#\" `Text.isPrefixOf` txt\n  then \"HyperlinkTextDestination/\" <> escTxt\n  else \"HyperlinkURLDestination/\" <> escTxt\n  where\n    escTxt = escapeColons $ escapeStringForXML txt\n\n-- | Convert a list of (identifier, url) pairs to the ICML listing of hyperlinks.\nhyperlinksToDoc :: Hyperlink -> Doc Text\nhyperlinksToDoc []     = empty\nhyperlinksToDoc (x:xs) = hyp x $$ hyperlinksToDoc xs\n  where\n    hyp (ident, url) = hdest $$ hlink\n      where\n        hdest = if \"#\" `Text.isPrefixOf` url\n                then empty\n                else selfClosingTag \"HyperlinkURLDestination\"\n                  [(\"Self\", \"HyperlinkURLDestination/\"<>escapeColons url), (\"Name\",\"link\"), (\"DestinationURL\",url), (\"DestinationUniqueKey\",\"1\")] -- HyperlinkURLDestination with more than one colon crashes CS6\n        hlink = inTags True \"Hyperlink\" [(\"Self\",\"uf-\"<>tshow ident),  (\"Name\",url),\n                    (\"Source\",\"htss-\"<>tshow ident), (\"Visible\",\"false\"), (\"DestinationUniqueKey\",\"1\")]\n                  $ inTags True \"Properties\" []\n                  $ inTags False \"BorderColor\" [(\"type\",\"enumeration\")] (text \"Black\")\n                 $$ inTags False \"Destination\" [(\"type\",\"object\")] (makeDest url)\n\n-- | Key for specifying user-defined styles\ndynamicStyleKey :: Text\ndynamicStyleKey = \"custom-style\"\n\n-- | Convert a list of Pandoc blocks to ICML.\nblocksToICML :: PandocMonad m => WriterOptions -> Style -> [Block] -> WS m (Doc Text)\nblocksToICML opts style lst = do\n  docs <- mapM (blockToICML opts style) lst\n  return $ intersperseBrs docs\n\n-- | Convert a Pandoc block element to ICML.\nblockToICML :: PandocMonad m => WriterOptions -> Style -> Block -> WS m (Doc Text)\nblockToICML opts style (Plain lst) = parStyle opts style \"\" lst\nblockToICML opts style (Para lst) = parStyle opts (paragraphName:style) \"\" lst\nblockToICML opts style (LineBlock lns) =\n  blockToICML opts style $ linesToPara lns\nblockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) \"\" [Str str]\nblockToICML _ _ b@(RawBlock f str)\n  | f == Format \"icml\" = return $ literal str\n  | otherwise          = do\n      report $ BlockNotRendered b\n      return empty\nblockToICML opts style (BlockQuote blocks) = blocksToICML opts (blockQuoteName:style) blocks\nblockToICML opts style (OrderedList attribs lst) = listItemsToICML opts orderedListName style (Just attribs) lst\nblockToICML opts style (BulletList lst) = listItemsToICML opts bulletListName style Nothing lst\nblockToICML opts style (DefinitionList lst) = intersperseBrs `fmap` mapM (definitionListItemToICML opts style) lst\nblockToICML opts style (Header lvl (ident, cls, _) lst) =\n  let stl = (headerName <> tshow lvl <> unnumbered):style\n      unnumbered = if \"unnumbered\" `elem` cls\n                   then \" (unnumbered)\"\n                   else \"\"\n  in parStyle opts stl ident lst\nblockToICML _ _ HorizontalRule = return empty -- we could insert a page break instead\nblockToICML opts style (Table attr blkCapt specs thead tbody tfoot) =\n  let (caption, aligns, widths, headers, rows) =\n        toLegacyTable blkCapt specs thead tbody tfoot\n      style' = tableName : style\n      noHeader  = all null headers\n      nrHeaders = if noHeader\n                     then \"0\"\n                     else \"1\"\n      nrRows = length rows\n      nrCols = case rows of\n                   [] -> 0\n                   (r:_) -> length r\n      rowsToICML [] _ = return empty\n      rowsToICML (col:rest) rowNr =\n        liftM2 ($$) (colsToICML col aligns rowNr (0::Int)) $ rowsToICML rest (rowNr+1)\n      colsToICML [] _ _ _ = return empty\n      colsToICML _ [] _ _ = return empty\n      colsToICML (cell:rest) (alig:restAligns) rowNr colNr = do\n        let stl  = if rowNr == 0 && not noHeader\n                      then tableHeaderName:style'\n                      else style'\n            stl' | alig == AlignLeft = alignLeftName : stl\n                 | alig == AlignRight = alignRightName : stl\n                 | alig == AlignCenter = alignCenterName : stl\n                 | otherwise = stl\n        c <- blocksToICML opts stl' cell\n        let cl = return $ inTags True \"Cell\"\n                   [(\"Name\", tshow colNr <>\":\"<> tshow rowNr), (\"AppliedCellStyle\",\"CellStyle/Cell\")] c\n        liftM2 ($$) cl $ colsToICML rest restAligns rowNr (colNr+1)\n  in  do\n      let tabl = if noHeader\n                    then rows\n                    else headers:rows\n      cells <- rowsToICML tabl (0::Int)\n      let colWidths w =\n            [(\"SingleColumnWidth\",tshow $ 500 * w) | w > 0]\n      let tupToDoc tup = selfClosingTag \"Column\" $ (\"Name\",tshow $ fst tup) : colWidths (snd tup)\n      let colDescs = vcat $ zipWith (curry tupToDoc) [0..nrCols-1] widths\n      let (_,_,kvs) = attr\n      let dynamicStyle = fromMaybe \"Table\" (lookup dynamicStyleKey kvs)\n      let tableDoc = return $ inTags True \"Table\" [\n                         (\"AppliedTableStyle\",\"TableStyle/\" <> dynamicStyle)\n                       , (\"HeaderRowCount\", nrHeaders)\n                       , (\"BodyRowCount\", tshow nrRows)\n                       , (\"ColumnCount\", tshow nrCols)\n                       ] (colDescs $$ cells)\n      liftM2 ($$) tableDoc $ parStyle opts (tableCaptionName:style) \"\" caption\nblockToICML opts style (Div (_ident, _, kvs) lst) =\n  let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs\n  in  blocksToICML opts (dynamicStyle <> style) lst\nblockToICML opts style (Figure attr capt@(Caption _ longcapt) body) =\n  case body of\n    [Plain [img@(Image {})]] -> do\n      figure  <- parStyle opts (figureName:style) \"\" [img]\n      caption <- parStyle opts (imgCaptionName:style) \"\" $\n                 blocksToInlines longcapt\n      return $ intersperseBrs [figure, caption]\n    _ -> -- fallback to rendering the figure as a Div\n      blockToICML opts style $ figureDiv attr capt body\n\n\n-- | Convert a list of lists of blocks to ICML list items.\nlistItemsToICML :: PandocMonad m => WriterOptions -> Text -> Style -> Maybe ListAttributes -> [[Block]] -> WS m (Doc Text)\nlistItemsToICML _ _ _ _ [] = return empty\nlistItemsToICML opts listType style attribs (first:rest) = do\n  st <- get\n  put st{ listDepth = 1 + listDepth st}\n  let stl = listType:style\n  let f = listItemToICML opts stl True attribs first\n  let r = map (listItemToICML opts stl False attribs) rest\n  docs <- sequence $ f:r\n  s    <- get\n  let maxD = max (maxListDepth s) (listDepth s)\n  put s{ listDepth = 1, maxListDepth = maxD }\n  return $ intersperseBrs docs\n\n-- | Convert a list of blocks to ICML list items.\nlistItemToICML :: PandocMonad m => WriterOptions -> Style -> Bool-> Maybe ListAttributes -> [Block] -> WS m (Doc Text)\nlistItemToICML opts style isFirst attribs item =\n  let makeNumbStart (Just (beginsWith, numbStl, _)) =\n        let doN DefaultStyle = []\n            doN LowerRoman   = [lowerRomanName]\n            doN UpperRoman   = [upperRomanName]\n            doN LowerAlpha   = [lowerAlphaName]\n            doN UpperAlpha   = [upperAlphaName]\n            doN _            = []\n            bw =\n              [beginsWithName <> tshow beginsWith | beginsWith > 1]\n        in  doN numbStl ++ bw\n      makeNumbStart Nothing = []\n      stl = if isFirst\n               then firstListItemName:style\n               else style\n      stl' = makeNumbStart attribs ++ stl\n  in  case item of\n          (i:rest@(_:_)) -> do\n             let insertTab (Para lst) = blockToICML opts (subListParName:style)\n                                         (Para (Str \"\\t\":lst))\n                 insertTab block      = blockToICML opts style block\n             f <- blockToICML opts stl' i\n             r <- mapM insertTab rest\n             return $ intersperseBrs (f : r)\n          _ -> blocksToICML opts stl' item\n\ndefinitionListItemToICML :: PandocMonad m => WriterOptions -> Style -> ([Inline],[[Block]]) -> WS m (Doc Text)\ndefinitionListItemToICML opts style (term,defs) = do\n  term' <- parStyle opts (defListTermName:style) \"\" term\n  defs' <- mapM (blocksToICML opts (defListDefName:style)) defs\n  return $ intersperseBrs (term' : defs')\n\n\n-- | Convert a list of inline elements to ICML.\ninlinesToICML :: PandocMonad m => WriterOptions -> Style -> Text -> [Inline] -> WS m (Doc Text)\ninlinesToICML opts style ident lst = vcat `fmap` mapM (inlineToICML opts style ident) (mergeStrings opts lst)\n\n-- | Convert an inline element to ICML.\ninlineToICML :: PandocMonad m => WriterOptions -> Style -> Text -> Inline -> WS m (Doc Text)\ninlineToICML _    style ident (Str str) = charStyle style ident $ literal $ escapeStringForXML str\ninlineToICML opts style ident (Emph lst) = inlinesToICML opts (emphName:style) ident lst\ninlineToICML opts style ident (Underline lst) = inlinesToICML opts (underlineName:style) ident lst\ninlineToICML opts style ident (Strong lst) = inlinesToICML opts (strongName:style) ident lst\ninlineToICML opts style ident (Strikeout lst) = inlinesToICML opts (strikeoutName:style) ident lst\ninlineToICML opts style ident (Superscript lst) = inlinesToICML opts (superscriptName:style) ident lst\ninlineToICML opts style ident (Subscript lst) = inlinesToICML opts (subscriptName:style) ident lst\ninlineToICML opts style ident (SmallCaps lst) = inlinesToICML opts (smallCapsName:style) ident lst\ninlineToICML opts style ident (Quoted SingleQuote lst) = inlinesToICML opts style ident $\n  mergeStrings opts $ [Str \"‘\"] ++ lst ++ [Str \"’\"]\ninlineToICML opts style ident (Quoted DoubleQuote lst) = inlinesToICML opts style ident $\n  mergeStrings opts $ [Str \"“\"] ++ lst ++ [Str \"”\"]\ninlineToICML opts style ident (Cite _ lst) = inlinesToICML opts (citeName:style) ident lst\ninlineToICML _    style ident (Code _ str) = charStyle (codeName:style) ident $ literal $ escapeStringForXML str\ninlineToICML _    style ident Space = charStyle style ident space\ninlineToICML opts style ident SoftBreak =\n  case writerWrapText opts of\n       WrapAuto     -> charStyle style ident space\n       WrapNone     -> charStyle style ident space\n       WrapPreserve -> charStyle style ident cr\ninlineToICML _ style ident LineBreak = charStyle style ident $ literal lineSeparator\ninlineToICML opts style ident (Math mt str) =\n  lift (texMathToInlines mt str) >>=\n    (fmap mconcat . mapM (inlineToICML opts style ident))\ninlineToICML _ _ _ il@(RawInline f str)\n  | f == Format \"icml\" = return $ literal str\n  | otherwise          = do\n      report $ InlineNotRendered il\n      return empty\ninlineToICML opts style ident (Link _ lst (url, title)) = do\n  content <- inlinesToICML opts (linkName:style) ident lst\n  state $ \\st ->\n            let link_id = case links st of\n                              [] -> 1 :: Int\n                              ((n,_):_) -> 1 + n\n                newst = st{ links = (link_id, url):links st }\n                cont  = inTags True \"HyperlinkTextSource\"\n                         [(\"Self\",\"htss-\"<>tshow link_id), (\"Name\",title), (\"Hidden\",\"false\")] content\n            in  (cont, newst)\ninlineToICML opts style _ident (Image attr _ target) = imageICML opts style attr target\ninlineToICML opts style _ (Note lst) = footnoteToICML opts style lst\ninlineToICML opts style _ (Span (ident, _, kvs) lst) =\n  let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs\n  in  inlinesToICML opts (dynamicStyle <> style) ident lst\n-- ident will be the id of the span, that we need to use down in the hyperlink setter\n--  if T.null ident\n--     then\n--     else do\n\n-- | Convert a list of block elements to an ICML footnote.\nfootnoteToICML :: PandocMonad m => WriterOptions -> Style -> [Block] -> WS m (Doc Text)\nfootnoteToICML opts style lst =\n  let insertTab (Para ls) = blockToICML opts (footnoteName:style) $ Para $ Str \"\\t\":ls\n      insertTab block     = blockToICML opts (footnoteName:style) block\n  in  do\n    contents <- mapM insertTab lst\n    let number = inTags True \"ParagraphStyleRange\" [] $\n                   inTags True \"CharacterStyleRange\" [] $ inTagsSimple \"Content\" \"<?ACE 4?>\"\n    return $ inTags True \"CharacterStyleRange\"\n      [(\"AppliedCharacterStyle\",\"$ID/NormalCharacterStyle\"), (\"Position\",\"Superscript\")]\n      $ inTags True \"Footnote\" [] $ number $$ intersperseBrs contents\n\n-- | Auxiliary function to merge Space elements into the adjacent Strs.\nmergeStrings :: WriterOptions -> [Inline] -> [Inline]\nmergeStrings opts = mergeStrings' . map spaceToStr\n  where spaceToStr Space = Str \" \"\n        spaceToStr SoftBreak = case writerWrapText opts of\n                                    WrapPreserve  -> Str \"\\n\"\n                                    _             -> Str \" \"\n        spaceToStr x = x\n\n        mergeStrings' (Str x : Str y : zs) = mergeStrings' (Str (x <> y) : zs)\n        mergeStrings' (x : xs) = x : mergeStrings' xs\n        mergeStrings' []       = []\n\n-- | Intersperse line breaks\nintersperseBrs :: [Doc Text] -> Doc Text\nintersperseBrs = vcat . intersperse (selfClosingTag \"Br\" []) . filter (not . isEmpty)\n\n-- | Wrap a list of inline elements in an ICML Paragraph Style\nparStyle :: PandocMonad m => WriterOptions -> Style -> Text -> [Inline] -> WS m (Doc Text)\nparStyle opts style ident lst =\n  let slipIn x y = if Text.null y\n                      then x\n                      else x <> \" > \" <> y\n      stlStr = foldr slipIn \"\" $ reverse style\n      stl    = if Text.null stlStr\n                  then \"\"\n                  else \"ParagraphStyle/\" <> stlStr\n      attrs  = (\"AppliedParagraphStyle\", stl)\n      attrs' =  if firstListItemName `elem` style\n                   then let ats = attrs : [(\"NumberingContinue\", \"false\")]\n                            begins = filter (Text.isPrefixOf beginsWithName) style\n                        in  case begins of\n                                [] -> ats\n                                (b:_) ->\n                                   let i = fromMaybe \"\"\n                                             (Text.stripPrefix beginsWithName b)\n                                   in  (\"NumberingStartAt\", i) : ats\n                   else [attrs]\n  in  do\n      content <- inlinesToICML opts [] ident lst\n      let cont = inTags True \"ParagraphStyleRange\" attrs' content\n      state $ \\st -> (cont, st{ blockStyles = Set.insert stlStr $ blockStyles st })\n\n-- | Create the destination name\nmakeDestName :: Text -> Text\nmakeDestName name = \"#\" <> Text.replace \" \" \"-\" name\n\n-- | Create a HyperlinkTextDestination for a given identifier\nmakeLinkDest :: Text -> Doc Text -> Doc Text\nmakeLinkDest ident cont = vcat [\n    selfClosingTag \"HyperlinkTextDestination\"\n      [(\"Self\", \"HyperlinkTextDestination/\"<>makeDestName ident), (\"Name\",\"Destination\"), (\"DestinationUniqueKey\",\"1\")]\n    , inTagsSimple \"Content\" $ flush cont\n  ]\n\n-- | Create the markup for the content (incl. named destinations)\n-- |  NOTE: since we have no easy way to get actual named dests, we just create them for any short content blocks\nmakeContent :: Text -> Doc Text -> Doc Text\nmakeContent ident cont\n              | isEmpty cont = empty\n              | not (Text.null ident) = makeLinkDest ident cont\n              | otherwise = inTagsSimple \"Content\" $ flush cont\n\n-- | Wrap a Doc in an ICML Character Style.\ncharStyle :: PandocMonad m => Style -> Text -> Doc Text -> WS m (Doc Text)\ncharStyle style ident content =\n  let (stlStr, attrs) = styleToStrAttr style\n      doc = inTags True \"CharacterStyleRange\" attrs\n              $ makeContent ident content\n  in\n      state $ \\st ->\n    let styles = if Text.null stlStr\n                    then st\n                    else st{ inlineStyles = Set.insert stlStr $ inlineStyles st }\n    in  (doc, styles)\n\n-- | Transform a Style to a tuple of String (eliminating duplicates and ordered) and corresponding attribute.\nstyleToStrAttr :: Style -> (Text, [(Text, Text)])\nstyleToStrAttr style =\n  let stlStr = Text.unwords $ Set.toAscList $ Set.fromList style\n      stl    = if null style\n                  then \"$ID/NormalCharacterStyle\"\n                  else \"CharacterStyle/\" <> stlStr\n      attrs = [(\"AppliedCharacterStyle\", stl)]\n  in  (stlStr, attrs)\n\n-- | Key for specifying user-defined object (image) styles\nobjectStyleKey :: Text\nobjectStyleKey = \"object-style\"\n\n-- | Assemble an ICML Image.\nimageICML :: PandocMonad m => WriterOptions -> Style -> Attr -> Target -> WS m (Doc Text)\nimageICML opts style attr (src, _) = do\n  imgS <- catchError\n          (do (img, _) <- fetchItem src\n              case imageSize opts img of\n                Right size -> return size\n                Left msg   -> do\n                  report $ CouldNotDetermineImageSize src msg\n                  return def)\n           (\\e -> do\n               report $ CouldNotFetchResource src $ tshow e\n               return def)\n  let (ow, oh) = sizeInPoints imgS\n      (imgWidth, imgHeight) = desiredSizeInPoints opts attr imgS\n      hw = showFl $ ow / 2\n      hh = showFl $ oh / 2\n      scale = showFl (imgWidth / ow) <> \" 0 0 \" <> showFl (imgHeight / oh)\n      src' = if isURI src then src else \"file:\" <> src\n      (stlStr, attrs) = styleToStrAttr style\n      props  = inTags True \"Properties\" [] $ inTags True \"PathGeometry\" []\n                 $ inTags True \"GeometryPathType\" [(\"PathOpen\",\"false\")]\n                 $ inTags True \"PathPointArray\" []\n                 $ vcat [\n                     selfClosingTag \"PathPointType\" [(\"Anchor\", \"-\"<>hw<>\" -\"<>hh),\n                       (\"LeftDirection\", \"-\"<>hw<>\" -\"<>hh), (\"RightDirection\", \"-\"<>hw<>\" -\"<>hh)]\n                   , selfClosingTag \"PathPointType\" [(\"Anchor\", \"-\"<>hw<>\" \"<>hh),\n                       (\"LeftDirection\", \"-\"<>hw<>\" \"<>hh), (\"RightDirection\", \"-\"<>hw<>\" \"<>hh)]\n                   , selfClosingTag \"PathPointType\" [(\"Anchor\", hw<>\" \"<>hh),\n                       (\"LeftDirection\", hw<>\" \"<>hh), (\"RightDirection\", hw<>\" \"<>hh)]\n                   , selfClosingTag \"PathPointType\" [(\"Anchor\", hw<>\" -\"<>hh),\n                       (\"LeftDirection\", hw<>\" -\"<>hh), (\"RightDirection\", hw<>\" -\"<>hh)]\n                   ]\n\n      isdata = \"data:\" `Text.isPrefixOf` src' && \"base64,\" `Text.isInfixOf` src'\n      contents =\n            if isdata\n               then -- see #8398\n                  inTags True \"Contents\" [] $\n                    literal (\"<![CDATA[\" <> Text.replace \"%20\" \"\"\n                            (Text.drop 1 (Text.dropWhile (/=',') src')) <> \"]]>\")\n               else mempty\n      link = if isdata\n                then mempty\n                else  selfClosingTag \"Link\" [(\"Self\", \"ueb\"),\n                                             (\"LinkResourceURI\", src')]\n      (_,_,kvs) = attr\n      applyObjectStyle = lookup objectStyleKey kvs\n      image = inTags True \"Image\"\n            [(\"Self\",\"ue6\"), (\"ItemTransform\", scale <> \" -\" <> hw <> \" -\" <> hh)]\n            $ vcat [\n                inTags True \"Properties\" [] $ vcat [\n                    inTags True \"Profile\" [(\"type\",\"string\")] $ text \"$ID/Embedded\",\n                    selfClosingTag \"GraphicBounds\" [(\"Left\",\"0\"), (\"Top\",\"0\"),\n                    (\"Right\", showFl $ ow * ow / imgWidth),\n                    (\"Bottom\", showFl $ oh * oh / imgHeight)],\n                    contents\n                ],\n                link\n            ]\n      doc   = inTags True \"CharacterStyleRange\" attrs\n          $ inTags True \"Rectangle\"\n              ([(\"Self\",\"uec\"),\n                (\"StrokeWeight\", \"0\"),\n                (\"ItemTransform\", scale <> \" \" <> hw <> \" -\" <> hh)] ++\n                maybe [] (\\aos -> [(\"AppliedObjectStyle\", \"ObjectStyle/\" <> aos)]) applyObjectStyle\n              )\n              (props $$ image)\n  state $ \\st -> (doc, st{\n      inlineStyles = Set.insert stlStr $ inlineStyles st,\n      objectStyles = case applyObjectStyle of\n          Just styleName -> Set.insert styleName $ objectStyles st\n          Nothing        -> objectStyles st\n    })\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Ipynb.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Writers.Ipynb\n   Copyright   : Copyright (C) 2019-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nIpynb (Jupyter notebook JSON format) writer for pandoc.\n\n-}\nmodule Text.Pandoc.Writers.Ipynb ( writeIpynb )\nwhere\nimport Control.Monad (foldM)\nimport Control.Monad.State ( StateT(runStateT), modify )\nimport qualified Data.Map as M\nimport Data.Maybe (catMaybes, fromMaybe)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Definition\nimport Data.Ipynb as Ipynb\nimport Text.Pandoc.Walk (walkM)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Logging\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Data.Aeson as Aeson\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Shared (safeRead)\nimport Text.Pandoc.URI (isURI)\nimport Text.Pandoc.Writers.Shared (metaToContext')\nimport Text.Pandoc.Writers.Markdown (writePlain, writeMarkdown)\nimport qualified Data.Text.Encoding as TE\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Aeson.Encode.Pretty (Config(..), defConfig,\n           encodePretty', keyOrder, Indent(Spaces))\nimport Text.DocLayout (literal)\nimport Text.Pandoc.UUID (getRandomUUID)\nimport Data.Char (isAscii, isAlphaNum)\n\nwriteIpynb :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteIpynb opts d = do\n  notebook <- pandocToNotebook opts d\n  return $ TE.decodeUtf8 . BL.toStrict . encodePretty' defConfig{\n             confIndent  = Spaces 1,\n             confTrailingNewline = True,\n             confCompare = keyOrder\n               [ \"cells\", \"nbformat\", \"nbformat_minor\",\n                 \"cell_type\", \"output_type\",\n                 \"execution_count\", \"metadata\",\n                 \"outputs\", \"source\",\n                 \"data\", \"name\", \"text\" ] <> compare }\n         $ notebook\n\npandocToNotebook :: PandocMonad m\n                 => WriterOptions -> Pandoc -> m (Notebook NbV4)\npandocToNotebook opts (Pandoc meta blocks) = do\n  -- we use writePlain w/ default options because e.g. we don't want\n  -- to add backslash escapes or convert en dashes, see #7928\n  let blockWriter bs = literal <$> writePlain def (Pandoc nullMeta bs)\n  let inlineWriter ils = literal . T.stripEnd <$>\n                            writePlain def (Pandoc nullMeta [Plain ils])\n  let jupyterMeta =\n        case lookupMeta \"jupyter\" meta of\n          Just (MetaMap m) -> Meta m\n          _ -> mempty\n  let nbformat =\n         case (lookupMeta \"nbformat\" jupyterMeta,\n               lookupMeta \"nbformat_minor\" jupyterMeta) of\n               (Just (MetaInlines [Str \"4\"]), Just (MetaInlines [Str y])) ->\n                 case safeRead y of\n                        Just z  -> (4, z)\n                        Nothing -> (4, 5)\n               _                -> (4, 5) -- write as v4.5\n  metadata' <- toJSON <$> metaToContext' blockWriter inlineWriter\n                 (B.deleteMeta \"nbformat\" .\n                  B.deleteMeta \"nbformat_minor\" $\n                  jupyterMeta)\n  -- convert from a Value (JSON object) to a M.Map Text Value:\n  let metadata = case fromJSON metadata' of\n                   Error _ -> mempty -- TODO warning here? shouldn't happen\n                   Success x -> x\n  cells <- extractCells nbformat opts blocks\n  return $ Notebook{\n       notebookMetadata = metadata\n     , notebookFormat = nbformat\n     , notebookCells = cells }\n\naddAttachment :: PandocMonad m\n              => Inline\n              -> StateT (M.Map Text MimeBundle) m Inline\naddAttachment (Image attr lab (src,tit))\n  | not (isURI src) = do\n  (img, mbmt) <- fetchItem src\n  let mt = fromMaybe \"application/octet-stream\" mbmt\n  modify $ M.insert src\n          (MimeBundle (M.insert mt (BinaryData img) mempty))\n  return $ Image attr lab (\"attachment:\" <> src, tit)\naddAttachment x = return x\n\nextractCells :: PandocMonad m\n             => (Int, Int) -> WriterOptions -> [Block] -> m [Ipynb.Cell a]\nextractCells _ _ [] = return []\nextractCells nbformat opts (Div (ident,classes,kvs) xs : bs)\n  | \"cell\" `elem` classes\n  , \"markdown\" `elem` classes = do\n      let meta = pairsToJSONMeta kvs\n      (newdoc, attachments) <-\n        runStateT (walkM addAttachment (Pandoc nullMeta xs)) mempty\n      source <- writeMarkdown opts{ writerTemplate = Nothing } newdoc\n      uuid <- uuidFrom nbformat ident\n      (Ipynb.Cell{\n          cellType = Markdown\n        , cellId = uuid\n        , cellSource = Source $ breakLines $ T.stripEnd source\n        , cellMetadata = meta\n        , cellAttachments = if M.null attachments\n                               then Nothing\n                               else Just $ MimeAttachments attachments } :)\n            <$> extractCells nbformat opts bs\n  | \"cell\" `elem` classes\n  , \"code\" `elem` classes = do\n      let (codeContent, rest) =\n            case xs of\n               (CodeBlock _ t : ys) -> (t, ys)\n               ys                   -> (mempty, ys)\n      let meta = pairsToJSONMeta kvs\n      outputs <- catMaybes <$> mapM blockToOutput rest\n      let exeCount = lookup \"execution_count\" kvs >>= safeRead\n      uuid <- uuidFrom nbformat ident\n      (Ipynb.Cell{\n          cellType = Ipynb.Code {\n                codeExecutionCount = exeCount\n              , codeOutputs = outputs\n              }\n        , cellId = uuid\n        , cellSource = Source $ breakLines codeContent\n        , cellMetadata = meta\n        , cellAttachments = Nothing } :) <$> extractCells nbformat opts bs\n  | \"cell\" `elem` classes\n  , \"raw\" `elem` classes =\n      case consolidateAdjacentRawBlocks xs of\n        [RawBlock (Format f) raw] -> do\n          let format' =\n                case T.toLower f of\n                  \"html\"     -> \"text/html\"\n                  \"html4\"    -> \"text/html\"\n                  \"html5\"    -> \"text/html\"\n                  \"s5\"       -> \"text/html\"\n                  \"slidy\"    -> \"text/html\"\n                  \"slideous\" -> \"text/html\"\n                  \"dzslides\" -> \"text/html\"\n                  \"revealjs\" -> \"text/html\"\n                  \"latex\"    -> \"text/latex\"\n                  \"markdown\" -> \"text/markdown\"\n                  \"rst\"      -> \"text/restructuredtext\"\n                  \"asciidoc\" -> \"text/asciidoc\"\n                  _          -> f\n          uuid <- uuidFrom nbformat ident\n          (Ipynb.Cell{\n              cellType = Raw\n            , cellId = uuid\n            , cellSource = Source $ breakLines raw\n            , cellMetadata = if format' == \"ipynb\" -- means no format given\n                                then mempty\n                                else JSONMeta $ M.insert \"raw_mimetype\"\n                                       (Aeson.String format') mempty\n            , cellAttachments = Nothing } :) <$> extractCells nbformat opts bs\n        _ -> extractCells nbformat opts bs\nextractCells nbformat opts (CodeBlock (ident,classes,kvs) raw : bs)\n  | \"code\" `elem` classes = do\n      let meta = pairsToJSONMeta kvs\n      let exeCount = lookup \"execution_count\" kvs >>= safeRead\n      uuid <- uuidFrom nbformat ident\n      (Ipynb.Cell{\n          cellType = Ipynb.Code {\n                codeExecutionCount = exeCount\n              , codeOutputs = []\n              }\n        , cellId = uuid\n        , cellSource = Source $ breakLines raw\n        , cellMetadata = meta\n        , cellAttachments = Nothing } :) <$> extractCells nbformat opts bs\nextractCells nbformat opts (b:bs) = do\n      let isCodeOrDiv (CodeBlock (_,cl,_) _) = \"code\" `elem` cl\n          isCodeOrDiv (Div (_,cl,_) _)       = \"cell\" `elem` cl\n          isCodeOrDiv _                      = False\n      let (mds, rest) = break isCodeOrDiv bs\n      extractCells nbformat opts\n        (Div (\"\",[\"cell\",\"markdown\"],[]) (b:mds) : rest)\n\n-- Return Nothing if nbformat < 4.5.\n-- Otherwise construct a UUID, using the existing identifier\n-- if it is a valid UUID, otherwise constructing a new one.\nuuidFrom :: PandocMonad m => (Int, Int) -> Text -> m (Maybe Text)\nuuidFrom nbformat ident =\n  if nbformat >= (4,5)\n     then\n       if isValidUUID ident\n          then return $ Just ident\n          else Just . T.pack . drop 9 . show <$> getRandomUUID\n     else return Nothing\n where\n  isValidUUID t = not (T.null t) && T.length t <= 64 &&\n                  T.all isValidUUIDChar t\n  isValidUUIDChar c = isAscii c && (isAlphaNum c || c == '-' || c == '_')\n\nblockToOutput :: PandocMonad m => Block -> m (Maybe (Output a))\nblockToOutput (Div (_,[\"output\",\"stream\",sname],_) (CodeBlock _ t:_)) =\n  return $ Just\n         $ Stream{ streamName = sname\n               , streamText = Source (breakLines t) }\nblockToOutput (Div (_,[\"output\",\"error\"],kvs) (CodeBlock _ t:_)) =\n  return $ Just\n         $ Err{ errName = fromMaybe mempty (lookup \"ename\" kvs)\n              , errValue = fromMaybe mempty (lookup \"evalue\" kvs)\n              , errTraceback = breakLines t }\nblockToOutput (Div (_,[\"output\",\"execute_result\"],kvs) bs) = do\n  (data', metadata') <- extractData bs\n  return $ Just\n         $ ExecuteResult{ executeCount = fromMaybe 0 $\n                          lookup \"execution_count\" kvs >>= safeRead\n                        , executeData = data'\n                        , executeMetadata = pairsToJSONMeta kvs <> metadata'}\nblockToOutput (Div (_,[\"output\",\"display_data\"],kvs) bs) = do\n  (data', metadata') <- extractData bs\n  return $ Just\n         $ DisplayData { displayData = data'\n                       , displayMetadata = pairsToJSONMeta kvs <> metadata'}\nblockToOutput _ = return Nothing\n\nextractData :: PandocMonad m => [Block] -> m (MimeBundle, JSONMeta)\nextractData bs = do\n  (mmap, meta) <- foldM go mempty $ consolidateAdjacentRawBlocks bs\n  return (MimeBundle mmap, meta)\n  where\n    go (mmap, meta) b@(Para [Image (_,_,kvs) _ (src,_)]) = do\n      (img, mbmt) <- fetchItem src\n      case mbmt of\n        Just mt -> return\n          (M.insert mt (BinaryData img) mmap,\n           meta <> pairsToJSONMeta kvs)\n        Nothing -> (mmap, meta) <$ report (BlockNotRendered b)\n    go (mmap, meta) b@(CodeBlock (_,[\"json\"],_) code) =\n      case decode (UTF8.fromTextLazy $ TL.fromStrict code) of\n        Just v  -> return\n                    (M.insert \"application/json\" (JsonData v) mmap, meta)\n        Nothing -> (mmap, meta) <$ report (BlockNotRendered b)\n    go (mmap, meta) (CodeBlock (\"\",[],[]) code) =\n       return (M.insert \"text/plain\" (TextualData code) mmap, meta)\n    go (mmap, meta) (RawBlock (Format \"html\") raw) =\n       return (M.insert \"text/html\" (TextualData raw) mmap, meta)\n    go (mmap, meta) (RawBlock (Format \"latex\") raw) =\n       return (M.insert \"text/latex\" (TextualData raw) mmap, meta)\n    go (mmap, meta) (RawBlock (Format \"markdown\") raw) =\n       return (M.insert \"text/markdown\" (TextualData raw) mmap, meta)\n    go (mmap, meta) (Div _ bs') = foldM go (mmap, meta) bs'\n    go (mmap, meta) b = (mmap, meta) <$ report (BlockNotRendered b)\n\npairsToJSONMeta :: [(Text, Text)] -> JSONMeta\npairsToJSONMeta kvs = JSONMeta $\n  M.fromList [(k, case Aeson.decode (UTF8.fromTextLazy $ TL.fromStrict v) of\n                           Just val -> val\n                           Nothing  -> String v)\n             | (k,v) <- kvs\n             , k /= \"execution_count\"\n             ]\n\nconsolidateAdjacentRawBlocks :: [Block] -> [Block]\nconsolidateAdjacentRawBlocks [] = []\nconsolidateAdjacentRawBlocks (RawBlock f1 x : RawBlock f2 y : xs)\n  | f1 == f2\n  = consolidateAdjacentRawBlocks (RawBlock f1 (x <> \"\\n\" <> y) : xs)\nconsolidateAdjacentRawBlocks (x : xs) =\n  x : consolidateAdjacentRawBlocks xs\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/JATS/References.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.JATS.References\n   Copyright   : © 2021-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nCreation of a bibliography list using @<element-citation>@ elements in\nreference items.\n-}\nmodule Text.Pandoc.Writers.JATS.References\n  ( referencesToJATS\n  , referenceToJATS\n  ) where\n\nimport Citeproc.Pandoc ()\nimport Citeproc.Types\n  ( Date (..), DateParts (..), ItemId (..), Name (..), Reference (..)\n  , Val (..) , lookupVariable, valToText\n  )\nimport Data.Text (Text)\nimport Text.DocLayout (Doc, empty, isEmpty, literal, vcat)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Builder (Inlines)\nimport Text.Pandoc.Options (WriterOptions)\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.Writers.JATS.Types\nimport Text.Pandoc.XML (escapeNCName, escapeStringForXML, inTags)\nimport qualified Data.Text as T\n\nreferencesToJATS :: PandocMonad m\n                 => WriterOptions\n                 -> [Reference Inlines]\n                 -> JATS m (Doc Text)\nreferencesToJATS opts =\n  fmap vcat . mapM (referenceToJATS opts)\n\nreferenceToJATS :: PandocMonad m\n                => WriterOptions\n                -> Reference Inlines\n                -> JATS m (Doc Text)\nreferenceToJATS _opts ref = do\n  let refType = referenceType ref\n  let pubType = [(\"publication-type\", refType) | not (T.null refType)]\n  let ident = escapeNCName $ \"ref-\" <> unItemId (referenceId ref)\n  let wrap = inTags True \"ref\" [(\"id\", ident)]\n           . inTags True \"element-citation\" pubType\n  return . wrap . vcat $\n    [ authors\n    , \"title\" `varInTag`\n      if refType == \"book\"\n      then \"source\"\n      else \"article-title\"\n    , if refType == \"book\"\n      then empty\n      else \"container-title\" `varInTag` \"source\"\n    , editors\n    , \"publisher\"       `varInTag` \"publisher-name\"\n    , \"publisher-place\" `varInTag` \"publisher-loc\"\n    , yearTag\n    , accessed\n    , \"volume\"          `varInTag` \"volume\"\n    , \"issue\"           `varInTag` \"issue\"\n    , \"edition\"         `varInTag` \"edition\"\n    , \"page-first\"      `varInTag` \"fpage\"\n    , \"ISBN\"            `varInTag` \"isbn\"\n    , \"ISSN\"            `varInTag` \"issn\"\n    , \"URL\"             `varInTag` \"uri\"\n    , varInTagWith \"doi\"  \"pub-id\" [(\"pub-id-type\", \"doi\")]\n    , varInTagWith \"pmid\" \"pub-id\" [(\"pub-id-type\", \"pmid\")]\n    ] ++\n    case lookupVariable \"page\" ref >>= valToText of\n      Nothing -> []\n      Just val ->\n        let isdash c = c == '-' || c == '\\x2013'\n            (fpage, lpage) = T.dropWhile isdash <$> T.break isdash val\n         in [ inTags' \"fpage\" [] $ literal $ escapeStringForXML fpage,\n              inTags' \"lpage\" [] $ literal $ escapeStringForXML lpage ]\n  where\n    varInTag var tagName = varInTagWith var tagName []\n\n    varInTagWith var tagName tagAttribs =\n      case lookupVariable var ref >>= valToText of\n        Nothing  -> mempty\n        Just val -> inTags' tagName tagAttribs . literal $\n                    escapeStringForXML val\n\n    authors = case lookupVariable \"author\" ref of\n      Just (NamesVal names) ->\n        inTags True \"person-group\" [(\"person-group-type\", \"author\")] . vcat $\n        map toNameElements names\n      _                     -> empty\n\n    editors = case lookupVariable \"editor\" ref of\n      Just (NamesVal names) ->\n        inTags True \"person-group\" [(\"person-group-type\", \"editor\")] . vcat $\n        map toNameElements names\n      _                     -> empty\n\n    yearTag =\n      case lookupVariable \"issued\" ref of\n        Just (DateVal date) -> toDateElements date\n        _ -> empty\n\n    accessed =\n      case lookupVariable \"accessed\" ref of\n        Just (DateVal d) -> inTags' \"date-in-citation\"\n                                    [(\"content-type\", \"access-date\")]\n                                    (toDateElements d)\n        _ -> empty\n\ntoDateElements :: Date -> Doc Text\ntoDateElements date =\n  case dateParts date of\n    dp@(DateParts (y:m:d:_)):_ -> yearElement y dp <>\n                                  monthElement m <>\n                                  dayElement d\n    dp@(DateParts (y:m:_)):_   -> yearElement y dp <> monthElement m\n    dp@(DateParts (y:_)):_     -> yearElement y dp\n    _                          -> empty\n\nyearElement :: Int -> DateParts -> Doc Text\nyearElement year dp =\n  inTags' \"year\" [(\"iso-8601-date\", iso8601 dp)] $ literal (fourDigits year)\n\nmonthElement :: Int -> Doc Text\nmonthElement month = inTags' \"month\" [] . literal $ twoDigits month\n\ndayElement :: Int -> Doc Text\ndayElement day = inTags' \"day\" [] . literal $ twoDigits day\n\niso8601 :: DateParts -> Text\niso8601 = T.intercalate \"-\" . \\case\n  DateParts (y:m:d:_) -> [fourDigits y, twoDigits m, twoDigits d]\n  DateParts (y:m:_)   -> [fourDigits y, twoDigits m]\n  DateParts (y:_)     -> [fourDigits y]\n  _                   -> []\n\ntwoDigits :: Int -> Text\ntwoDigits n = T.takeEnd 2 $ '0' `T.cons` tshow n\n\nfourDigits :: Int -> Text\nfourDigits n = T.takeEnd 4 $ \"000\" <> tshow n\n\ntoNameElements :: Name -> Doc Text\ntoNameElements name\n  | not (isEmpty nameTags) = inTags' \"name\" [] nameTags\n  | nameLiteral name == Just \"others\" = \"<etal/>\"\n  | otherwise = nameLiteral name `inNameTag` \"string-name\"\n  where\n      inNameTag mVal tag = case mVal of\n        Nothing  -> empty\n        Just val -> inTags' tag [] . literal $ escapeStringForXML val\n      surnamePrefix = maybe mempty (`T.snoc` ' ') $\n                      nameNonDroppingParticle name\n      givenSuffix = maybe mempty (T.cons ' ') $\n                    nameDroppingParticle name\n      nameTags = mconcat\n        [ ((surnamePrefix <>) <$> nameFamily name) `inNameTag` \"surname\"\n        , ((<> givenSuffix) <$> nameGiven name) `inNameTag` \"given-names\"\n        , nameSuffix name `inNameTag` \"suffix\"\n        ]\n\n-- | Put the supplied contents between start and end tags of tagType,\n--   with specified attributes.\ninTags' :: Text -> [(Text, Text)] -> Doc Text -> Doc Text\ninTags' = inTags False\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/JATS/Table.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TupleSections #-}\n{- |\n   Module      : Text.Pandoc.Writers.JATS.Table\n   Copyright   : © 2020-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' tables to JATS XML.\n-}\nmodule Text.Pandoc.Writers.JATS.Table\n  ( tableToJATS\n  ) where\nimport Control.Monad.Reader (asks)\nimport Data.List.NonEmpty (NonEmpty ((:|)))\nimport Data.Text (Text)\nimport Text.DocLayout (Doc, empty, vcat, ($$))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (WriterOptions)\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.Writers.JATS.Types\nimport Text.Pandoc.XML (escapeNCName, inTags, inTagsIndented, selfClosingTag)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\n\ntableToJATS :: PandocMonad m\n            => WriterOptions\n            -> Ann.Table\n            -> JATS m (Doc Text)\ntableToJATS opts (Ann.Table attr caption colspecs thead tbodies tfoot) = do\n  let (Caption _maybeShortCaption captionBlocks) = caption\n  -- Only paragraphs are allowed in captions, all other blocks must be\n  -- wrapped in @<p>@ elements.\n  let needsWrapping = \\case\n        Plain{} -> False\n        Para{}  -> False\n        _       -> True\n  tbl <- captionlessTable opts attr colspecs thead tbodies tfoot\n  captionDoc <- if null captionBlocks\n                then return empty\n                else do\n                  blockToJATS <- asks jatsBlockWriter\n                  inTagsIndented \"caption\" <$>\n                    blockToJATS needsWrapping opts captionBlocks\n  return $ inTags True \"table-wrap\" [] $ captionDoc $$ tbl\n\ncaptionlessTable :: PandocMonad m\n                 => WriterOptions\n                 -> Attr\n                 -> [ColSpec]\n                 -> Ann.TableHead\n                 -> [Ann.TableBody]\n                 -> Ann.TableFoot\n                 -> JATS m (Doc Text)\ncaptionlessTable opts attr colspecs thead tbodies tfoot = do\n  head' <- tableHeadToJats opts thead\n  bodies <- mapM (tableBodyToJats opts) tbodies\n  foot' <- tableFootToJats opts tfoot\n  let validAttribs = [ \"border\", \"cellpadding\", \"cellspacing\", \"content-type\"\n                     , \"frame\", \"rules\", \"specific-use\", \"style\", \"summary\"\n                     , \"width\"\n                     ]\n  let attribs = toAttribs attr validAttribs\n  return $ inTags True \"table\" attribs $ vcat\n    [ colSpecListToJATS colspecs\n    , head'\n    , foot'\n    , vcat bodies\n    ]\n\nvalidTablePartAttribs :: [Text]\nvalidTablePartAttribs =\n  [ \"align\", \"char\", \"charoff\", \"content-type\", \"style\", \"valign\" ]\n\ntableBodyToJats :: PandocMonad m\n                => WriterOptions\n                -> Ann.TableBody\n                -> JATS m (Doc Text)\ntableBodyToJats opts (Ann.TableBody attr _rowHeadCols inthead rows) = do\n  let attribs = toAttribs attr validTablePartAttribs\n  intermediateHead <- if null inthead\n                      then return mempty\n                      else headerRowsToJats opts Thead inthead\n  bodyRows <- bodyRowsToJats opts rows\n  return $ inTags True \"tbody\" attribs $ intermediateHead $$ bodyRows\n\ntableHeadToJats :: PandocMonad m\n                => WriterOptions\n                -> Ann.TableHead\n                -> JATS m (Doc Text)\ntableHeadToJats opts (Ann.TableHead attr rows) =\n  tablePartToJats opts Thead attr rows\n\ntableFootToJats :: PandocMonad m\n                => WriterOptions\n                -> Ann.TableFoot\n                -> JATS m (Doc Text)\ntableFootToJats opts (Ann.TableFoot attr rows) =\n  tablePartToJats opts Tfoot attr rows\n\ntablePartToJats :: PandocMonad m\n                => WriterOptions\n                -> TablePart\n                -> Attr\n                -> [Ann.HeaderRow]\n                -> JATS m (Doc Text)\ntablePartToJats opts tblpart attr rows =\n  if null rows || all isEmptyRow rows\n  then return mempty\n  else do\n    let tag' = case tblpart of\n                 Thead -> \"thead\"\n                 Tfoot -> \"tfoot\"\n                 Tbody -> \"tbody\" -- this would be unexpected\n    let attribs = toAttribs attr validTablePartAttribs\n    inTags True tag' attribs <$> headerRowsToJats opts tblpart rows\n  where\n    isEmptyRow (Ann.HeaderRow _attr _rownum cells) = all isEmptyCell cells\n    isEmptyCell (Ann.Cell _colspecs _colnum cell) =\n      cell == Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) []\n\n-- | The part of a table; header, footer, or body.\ndata TablePart = Thead | Tfoot | Tbody\n  deriving (Eq)\n\ndata CellType = HeaderCell | BodyCell\n\ndata TableRow = TableRow TablePart Attr Ann.RowNumber Ann.RowHead Ann.RowBody\n\nheaderRowsToJats :: PandocMonad m\n                 => WriterOptions\n                 -> TablePart\n                 -> [Ann.HeaderRow]\n                 -> JATS m (Doc Text)\nheaderRowsToJats opts tablepart =\n  rowListToJats opts . map toTableRow\n  where\n    toTableRow (Ann.HeaderRow attr rownum rowbody) =\n      TableRow tablepart attr rownum [] rowbody\n\nbodyRowsToJats :: PandocMonad m\n               => WriterOptions\n               -> [Ann.BodyRow]\n               -> JATS m (Doc Text)\nbodyRowsToJats opts =\n  rowListToJats opts . zipWith toTableRow [1..]\n  where\n    toTableRow rownum (Ann.BodyRow attr _rownum rowhead rowbody) =\n      TableRow Tbody attr rownum rowhead rowbody\n\nrowListToJats :: PandocMonad m\n              => WriterOptions\n              -> [TableRow]\n              -> JATS m (Doc Text)\nrowListToJats opts = fmap vcat . mapM (tableRowToJats opts)\n\ncolSpecListToJATS :: [ColSpec] -> Doc Text\ncolSpecListToJATS colspecs =\n  let hasDefaultWidth (_, ColWidthDefault) = True\n      hasDefaultWidth _                    = False\n\n      percent w = tshow (round (100*w) :: Integer) <> \"%\"\n\n      col :: ColWidth -> Doc Text\n      col = selfClosingTag \"col\" . \\case\n        ColWidthDefault -> mempty\n        ColWidth w -> [(\"width\", percent w)]\n\n   in if all hasDefaultWidth colspecs\n      then mempty\n      else inTags True \"colgroup\" [] $ vcat $ map (col . snd) colspecs\n\ntableRowToJats :: PandocMonad m\n               => WriterOptions\n               -> TableRow\n               -> JATS m (Doc Text)\ntableRowToJats opts (TableRow tblpart attr _rownum rowhead rowbody) = do\n  let validAttribs = [ \"align\", \"char\", \"charoff\", \"content-type\"\n                     , \"style\", \"valign\"\n                     ]\n  let attr' = toAttribs attr validAttribs\n  let celltype = case tblpart of\n                   Thead -> HeaderCell\n                   _     -> BodyCell\n  headcells <- mapM (cellToJats opts HeaderCell) rowhead\n  bodycells <- mapM (cellToJats opts celltype) rowbody\n  return $ inTags True \"tr\" attr' $ mconcat\n    [ vcat headcells\n    , vcat bodycells\n    ]\n\nalignmentAttrib :: Alignment -> Maybe (Text, Text)\nalignmentAttrib = fmap (\"align\",) . \\case\n  AlignLeft    -> Just \"left\"\n  AlignRight   -> Just \"right\"\n  AlignCenter  -> Just \"center\"\n  AlignDefault -> Nothing\n\ncolspanAttrib :: ColSpan -> Maybe (Text, Text)\ncolspanAttrib = \\case\n  ColSpan 1 -> Nothing\n  ColSpan n -> Just (\"colspan\", tshow n)\n\nrowspanAttrib :: RowSpan -> Maybe (Text, Text)\nrowspanAttrib = \\case\n  RowSpan 1 -> Nothing\n  RowSpan n -> Just (\"rowspan\", tshow n)\n\ncellToJats :: PandocMonad m\n           => WriterOptions\n           -> CellType\n           -> Ann.Cell\n           -> JATS m (Doc Text)\ncellToJats opts celltype (Ann.Cell (colspec :| _) _colNum cell) =\n  let align = fst colspec\n  in tableCellToJats opts celltype align cell\n\ntoAttribs :: Attr -> [Text] -> [(Text, Text)]\ntoAttribs (ident, _classes, kvs) knownAttribs =\n  (if T.null ident then id else ((\"id\", escapeNCName ident) :)) $\n  filter ((`elem` knownAttribs) . fst) kvs\n\ntableCellToJats :: PandocMonad m\n                => WriterOptions\n                -> CellType\n                -> Alignment\n                -> Cell\n                -> JATS m (Doc Text)\ntableCellToJats opts ctype colAlign (Cell attr align rowspan colspan item) = do\n  blockToJats   <- asks jatsBlockWriter\n  inlinesToJats <- asks jatsInlinesWriter\n  let fixBreak LineBreak = RawInline (Format \"jats\") \"<break/>\"\n      fixBreak x         = x\n  let cellContents = \\case\n        [Plain inlines] -> inlinesToJats opts\n                             (map fixBreak inlines)\n                             -- Note: <break/> is allowed only as a direct\n                             -- child of <td>, so we don't use walk.\n        blocks          -> blockToJats needsWrapInCell opts blocks\n  let tag' = case ctype of\n        BodyCell   -> \"td\"\n        HeaderCell -> \"th\"\n  let align' = case align of\n        AlignDefault -> colAlign\n        _            -> align\n  let maybeCons = maybe id (:)\n  let validAttribs = [ \"abbr\", \"align\", \"axis\", \"char\", \"charoff\"\n                     , \"content-type\", \"headers\", \"scope\", \"style\", \"valign\"\n                     ]\n  let attribs = maybeCons (alignmentAttrib align')\n              . maybeCons (rowspanAttrib rowspan)\n              . maybeCons (colspanAttrib colspan)\n              $ toAttribs attr validAttribs\n  inTags False tag' attribs <$> cellContents item\n\n-- | Whether the JATS produced from this block should be wrapped in a\n-- @<p>@ element when put directly below a @<td>@ element.\nneedsWrapInCell :: Block -> Bool\nneedsWrapInCell = \\case\n  Plain{}          -> False  -- should be unwrapped anyway\n  Para{}           -> False\n  BulletList{}     -> False\n  OrderedList{}    -> False\n  DefinitionList{} -> False\n  HorizontalRule   -> False\n  CodeBlock{}      -> False\n  RawBlock{}       -> False  -- responsibility of the user\n  _                -> True\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/JATS/Types.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Writers.JATS.Types\n   Copyright   : Copyright (C) 2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTypes for pandoc's JATS writer.\n-}\nmodule Text.Pandoc.Writers.JATS.Types\n  ( JATS\n  , JATSEnv (..)\n  , JATSState (..)\n  , JATSTagSet (..)\n  )\nwhere\n\nimport Citeproc.Types (Reference)\nimport Control.Monad.Reader (ReaderT)\nimport Control.Monad.State (StateT)\nimport Data.Text (Text)\nimport Text.DocLayout (Doc)\nimport Text.Pandoc.Builder (Block, Inline, Inlines)\nimport Text.Pandoc.Options (WriterOptions)\n\n-- | JATS tag set variant\ndata JATSTagSet\n  = TagSetArchiving         -- ^ Archiving and Interchange Tag Set\n  | TagSetPublishing        -- ^ Journal Publishing Tag Set\n  | TagSetArticleAuthoring  -- ^ Article Authoring Tag Set\n  deriving (Eq)\n\n-- | Internal state used by the writer.\nnewtype JATSState = JATSState\n  { jatsNotes :: [(Int, Doc Text)]\n  }\n\n-- | Environment containing all information relevant for rendering.\ndata JATSEnv m = JATSEnv\n  { jatsTagSet :: JATSTagSet  -- ^ The tag set that's being output\n\n  , jatsBlockWriter   :: (Block -> Bool)\n                      -> WriterOptions -> [Block]  -> JATS m (Doc Text)\n    -- ^ Converts a block list to JATS, wrapping top-level blocks into a\n    -- @<p>@ element if the property evaluates to @True@.\n    -- See #7227.\n\n  , jatsInlinesWriter :: WriterOptions -> [Inline] -> JATS m (Doc Text)\n    -- ^ Converts an inline list to JATS.\n\n  , jatsReferences    :: [Reference Inlines] -- ^ List of references\n  }\n\n-- | JATS writer type\ntype JATS m = StateT JATSState (ReaderT (JATSEnv m) m)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/JATS.hs",
    "content": "{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Writers.JATS\n   Copyright   : 2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to JATS XML.\nReference:\nhttps://jats.nlm.nih.gov/publishing/tag-library\n-}\nmodule Text.Pandoc.Writers.JATS\n  ( writeJATS\n  , writeJatsArchiving\n  , writeJatsPublishing\n  , writeJatsArticleAuthoring\n  ) where\nimport Control.Applicative ((<|>))\nimport Control.Monad\nimport Control.Monad.Reader\nimport Control.Monad.State\nimport Data.Generics (everywhere, mkT)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, listToMaybe, isNothing)\nimport Data.Time (toGregorian, Day, parseTimeM, defaultTimeLocale, formatTime)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Pandoc.Citeproc (getReferences)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (languages, languagesByExtension)\nimport Text.Pandoc.Logging\nimport Text.Pandoc.MIME (getMimeType)\nimport Text.Pandoc.Walk (walk)\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.DocTemplates (Context(..), Val(..), toVal)\nimport Text.Pandoc.Writers.JATS.References (referencesToJATS)\nimport Text.Pandoc.Writers.JATS.Table (tableToJATS)\nimport Text.Pandoc.Writers.JATS.Types\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.XML\nimport Text.TeXMath\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\nimport qualified Text.XML.Light as Xml\n\n-- | Default human-readable names for roles in the Contributor Role\n-- Taxonomy (CRediT). This is useful for generating JATS that annotate\n-- contributor roles\ncreditNames :: M.Map Text Text\ncreditNames = M.fromList [\n    (\"conceptualization\", \"Conceptualization\"),\n    (\"data-curation\", \"Data curation\"),\n    (\"formal-analysis\", \"Formal analysis\"),\n    (\"funding-acquisition\", \"Funding acquisition\"),\n    (\"investigation\", \"Investigation\"),\n    (\"methodology\", \"Methodology\"),\n    (\"project-administration\", \"Project administration\"),\n    (\"resources\", \"Resources\"),\n    (\"software\", \"Software\"),\n    (\"supervision\", \"Supervision\"),\n    (\"validation\", \"Validation\"),\n    (\"visualization\", \"Visualization\"),\n    (\"writing-original-draft\", \"Writing – original draft\"),\n    (\"writing-review-editing\", \"Writing – review &amp; editing\")]\n\n-- | Ensure every role with a `credit` key also has a `credit-name`,\n-- using a default value if necessary\naddCreditNames :: Context Text -> Context Text\naddCreditNames context =\n  case getField \"author\" context of\n    -- If there is an \"authors\" key, then we replace the existing value\n    -- with one we mutate by running the addCreditNamesToAuthor helper\n    -- function on each\n    Just (ListVal authors) ->\n      resetField \"author\" (map addCreditNamesToAuthor authors) context\n    -- If there is no \"authors\" key in the context, then we don't have to do\n    -- anything, and just return the context as is\n    _ -> context\n  where\n    addCreditNamesToAuthor :: Val Text -> Val Text\n    addCreditNamesToAuthor val = fromMaybe val $ do\n      MapVal authorCtx <- pure val\n      ListVal roles <- getField \"roles\" authorCtx\n      return $ toVal $ resetField \"roles\" (map addCreditNameToRole roles) authorCtx\n\n    addCreditNameToRole :: Val Text -> Val Text\n    addCreditNameToRole val = fromMaybe val $ do\n      MapVal roleCtx <- pure val\n      guard $ isNothing (getField \"credit-name\" roleCtx :: Maybe (Val Text))\n      creditId <- getField \"credit\" roleCtx\n      creditName <- M.lookup creditId creditNames\n      return $ toVal $ resetField \"credit-name\" creditName roleCtx\n\n-- | Convert a @'Pandoc'@ document to JATS (Archiving and Interchange\n-- Tag Set.)\nwriteJatsArchiving :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteJatsArchiving = writeJats TagSetArchiving\n\n-- | Convert a @'Pandoc'@ document to JATS (Journal Publishing Tag Set.)\nwriteJatsPublishing :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteJatsPublishing = writeJats TagSetPublishing\n\n-- | Convert a @'Pandoc'@ document to JATS (Archiving and Interchange\n-- Tag Set.)\nwriteJatsArticleAuthoring :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteJatsArticleAuthoring = writeJats TagSetArticleAuthoring\n\n-- | Alias for @'writeJatsArchiving'@. This function exists for backwards\n-- compatibility, but will be deprecated in the future. Use\n-- @'writeJatsArchiving'@ instead.\n{-# DEPRECATED writeJATS \"Use writeJatsArchiving instead\" #-}\nwriteJATS :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteJATS = writeJatsArchiving\n\n-- | Convert a @'Pandoc'@ document to JATS.\nwriteJats :: PandocMonad m => JATSTagSet -> WriterOptions -> Pandoc -> m Text\nwriteJats tagSet opts d = do\n  refs <- if extensionEnabled Ext_element_citations $ writerExtensions opts\n          then getReferences Nothing d\n          else pure []\n  let environment = JATSEnv\n          { jatsTagSet = tagSet\n          , jatsInlinesWriter = inlinesToJATS\n          , jatsBlockWriter = wrappedBlocksToJATS\n          , jatsReferences = refs\n          }\n  let initialState = JATSState { jatsNotes = [] }\n  runReaderT (evalStateT (docToJATS opts d) initialState)\n             environment\n\n-- see #9017 for motivation\nensureReferenceHeader :: [Block] -> [Block]\nensureReferenceHeader [] = []\nensureReferenceHeader (h@(Header{}):refs@(Div (\"refs\",_,_) _) : xs) =\n  h:refs:xs\nensureReferenceHeader (refs@(Div (\"refs\",_,_) _) : xs) =\n  Header 1 nullAttr mempty : refs : xs\nensureReferenceHeader (x:xs) = x :ensureReferenceHeader xs\n\n-- | Convert Pandoc document to string in JATS format.\ndocToJATS :: PandocMonad m => WriterOptions -> Pandoc -> JATS m Text\ndocToJATS opts (Pandoc meta blocks') = do\n  -- The numbering here follows LaTeX's internal numbering\n  let startLvl = case writerTopLevelDivision opts of\n                   TopLevelPart    -> -1\n                   TopLevelChapter -> 0\n                   TopLevelSection -> 1\n                   TopLevelDefault -> 1\n  let blocks = makeSections (writerNumberSections opts) (Just startLvl)\n                  $ ensureReferenceHeader blocks'\n  let splitBackBlocks b@(Div (\"refs\",_,_) _) (fs, bs) = (fs, b:bs)\n      splitBackBlocks (Div (ident,(\"section\":_),_)\n                               ( Header lev (_,hcls,hkvs) hils\n                               : (Div rattrs@(\"refs\",_,_) rs)\n                               : rest\n                               )) (fs, bs)\n                       = (fs ++ rest,\n                            Div rattrs\n                             (Header lev (ident,hcls,hkvs) hils : rs) : bs)\n      splitBackBlocks b (fs, bs) = (b:fs, bs)\n  let (bodyblocks, backblocks) = foldr splitBackBlocks ([],[]) blocks\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  metadata <- metaToContext opts\n                 (blocksToJATS opts . makeSections False (Just startLvl))\n                 (fmap chomp . inlinesToJATS opts)\n                 meta\n  main <- blocksToJATS opts bodyblocks\n  notes <- gets (reverse . map snd . jatsNotes)\n  backs <- blocksToJATS opts backblocks\n  tagSet <- asks jatsTagSet\n  -- In the \"Article Authoring\" tag set, occurrence of fn-group elements\n  -- is restricted to table footers. Footnotes have to be placed inline.\n  let fns = if null notes || tagSet == TagSetArticleAuthoring\n            then mempty\n            else inTagsIndented \"fn-group\" $ vcat notes\n  let back = backs $$ fns\n  let date =\n        case getField \"date\" metadata of\n          Nothing -> NullVal\n          Just (SimpleVal (x :: Doc Text)) ->\n             case parseDate (render Nothing x) of\n               Nothing  -> NullVal\n               Just day ->\n                 let (y,m,d) = toGregorian day\n                 in  MapVal . Context $ M.fromList\n                      [(\"year\" :: Text, SimpleVal $ text $ show y)\n                      ,(\"month\", SimpleVal $ text $ show m)\n                      ,(\"day\", SimpleVal $ text $ show d)\n                      ,(\"iso-8601\", SimpleVal $ text $\n                            formatTime defaultTimeLocale \"%F\" day)\n                      ]\n          Just x -> x\n  title' <- inlinesToJATS opts $ map fixLineBreak\n               (lookupMetaInlines \"title\" meta)\n  let context = defField \"body\" main\n              $ defField \"back\" back\n              $ addCreditNames\n              $ resetField \"title\" title'\n              $ resetField \"date\" date\n              $ defField \"mathml\" (case writerHTMLMathMethod opts of\n                                        MathML -> True\n                                        _      -> False) metadata\n  return $ render colwidth $\n    (if writerPreferAscii opts then fmap toEntities else id) $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\n-- | Convert a list of Pandoc blocks to JATS.\nblocksToJATS :: PandocMonad m => WriterOptions -> [Block] -> JATS m (Doc Text)\nblocksToJATS = wrappedBlocksToJATS (const False)\n\n-- | Like @'blocksToJATS'@, but wraps top-level blocks into a @<p>@\n-- element if the @needsWrap@ predicate evaluates to @True@.\nwrappedBlocksToJATS :: PandocMonad m\n                    => (Block -> Bool)\n                    -> WriterOptions\n                    -> [Block]\n                    -> JATS m (Doc Text)\nwrappedBlocksToJATS needsWrap opts =\n  fmap vcat . mapM wrappedBlockToJATS\n  where\n    wrappedBlockToJATS b = do\n      inner <- blockToJATS opts b\n      return $\n        if needsWrap b\n           then inTags True \"p\" [(\"specific-use\",\"wrapper\")] inner\n           else inner\n\n-- | Auxiliary function to convert Plain block to Para.\nplainToPara :: Block -> Block\nplainToPara (Plain x) = Para x\nplainToPara x         = x\n\n-- | Convert a list of pairs of terms and definitions into a list of\n-- JATS varlistentrys.\ndeflistItemsToJATS :: PandocMonad m\n                   => WriterOptions\n                   -> [([Inline],[[Block]])] -> JATS m (Doc Text)\ndeflistItemsToJATS opts items =\n  vcat <$> mapM (uncurry (deflistItemToJATS opts)) items\n\n-- | Convert a term and a list of blocks into a JATS varlistentry.\ndeflistItemToJATS :: PandocMonad m\n                  => WriterOptions\n                  -> [Inline] -> [[Block]] -> JATS m (Doc Text)\ndeflistItemToJATS opts term defs = do\n  term' <- inlinesToJATS opts term\n  def' <- wrappedBlocksToJATS (not . isPara)\n              opts $ concatMap (walk demoteHeaderAndRefs .\n                                map plainToPara) defs\n  return $ inTagsIndented \"def-item\" $\n      inTagsSimple \"term\" term' $$\n      inTagsIndented \"def\" def'\n\n-- | Convert a list of lists of blocks to a list of JATS list items.\nlistItemsToJATS :: PandocMonad m\n                => WriterOptions\n                -> Maybe [Text] -> [[Block]] -> JATS m (Doc Text)\nlistItemsToJATS opts markers items =\n  case markers of\n       Nothing -> vcat <$> mapM (listItemToJATS opts Nothing) items\n       Just ms -> vcat <$> zipWithM (listItemToJATS opts) (map Just ms) items\n\n-- | Convert a list of blocks into a JATS list item.\nlistItemToJATS :: PandocMonad m\n               => WriterOptions\n               -> Maybe Text -> [Block] -> JATS m (Doc Text)\nlistItemToJATS opts mbmarker item = do\n  contents <- wrappedBlocksToJATS (not . isParaOrList) opts\n                 (walk demoteHeaderAndRefs item)\n  return $ inTagsIndented \"list-item\" $\n           maybe empty (inTagsSimple \"label\" . text . T.unpack) mbmarker\n           $$ contents\n\nlanguageFor :: WriterOptions -> [Text] -> Text\nlanguageFor opts classes =\n  case langs of\n     (l:_) -> escapeStringForXML l\n     []    -> \"\"\n    where\n          syntaxMap = writerSyntaxMap opts\n          isLang l    = T.toLower l `elem` map T.toLower (languages syntaxMap)\n          langsFrom s = if isLang s\n                           then [s]\n                           else (languagesByExtension syntaxMap) . T.toLower $ s\n          langs       = concatMap langsFrom classes\n\ncodeAttr :: WriterOptions -> Attr -> (Text, [(Text, Text)])\ncodeAttr opts (ident,classes,kvs) = (lang, attr)\n    where\n       attr = [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n              [(\"language\",lang) | not (T.null lang)] ++\n              [(k,v) | (k,v) <- kvs, k `elem` [\"code-type\",\n                \"code-version\", \"executable\",\n                \"language-version\", \"orientation\",\n                    \"platforms\", \"position\", \"specific-use\"]]\n       lang  = languageFor opts classes\n\n-- <break/> is only allowed as a direct child of <td> or <title> or\n-- <article-title>\nfixLineBreak :: Inline -> Inline\nfixLineBreak LineBreak = RawInline (Format \"jats\") \"<break/>\"\nfixLineBreak x = x\n\n-- | Convert a Pandoc block element to JATS.\nblockToJATS :: PandocMonad m => WriterOptions -> Block -> JATS m (Doc Text)\nblockToJATS opts (Div (id',\"section\":_,kvs) (Header _lvl (_,_,hkvs) ils : xs)) = do\n  let idAttr = [ (\"id\", writerIdentifierPrefix opts <> escapeNCName id')\n               | not (T.null id')]\n  let otherAttrs = [\"sec-type\", \"specific-use\"]\n  let attribs = idAttr ++ [(k,v) | (k,v) <- kvs, k `elem` otherAttrs]\n  title' <- inlinesToJATS opts (map fixLineBreak ils)\n  let label = if writerNumberSections opts\n                 then\n                   case lookup \"number\" hkvs of\n                     Just num -> inTagsSimple \"label\" (literal num)\n                     Nothing -> mempty\n                 else mempty\n  contents <- blocksToJATS opts xs\n  return $ inTags True \"sec\" attribs $\n      label $$\n      inTagsSimple \"title\" title' $$ contents\n-- Bibliography reference:\nblockToJATS opts (Div (ident,_,_) [Para lst]) | \"ref-\" `T.isPrefixOf` ident =\n  inTags True \"ref\" [(\"id\", escapeNCName ident)] .\n  inTagsSimple \"mixed-citation\" <$>\n  inlinesToJATS opts lst\nblockToJATS opts (Div (\"refs\",_,_) xs) = do\n  refs <- asks jatsReferences\n  contents <- if null refs\n              then blocksToJATS opts xs\n              else do\n                titleElement <- case xs of\n                  (Header _ _ title:_) ->\n                    inTagsSimple \"title\" <$> inlinesToJATS opts title\n                  _ -> return mempty\n                elementRefs <- referencesToJATS opts refs\n                return $ titleElement $$ elementRefs\n  return $ inTagsIndented \"ref-list\" contents\nblockToJATS opts (Div (ident,[cls],kvs) bs) | cls `elem` [\"fig\", \"caption\", \"table-wrap\"] = do\n  contents <- blocksToJATS opts bs\n  let attr = [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n             [(\"xml:lang\",l) | (\"lang\",l) <- kvs] ++\n             [(k,v) | (k,v) <- kvs, k `elem` [\"specific-use\",\n                 \"content-type\", \"orientation\", \"position\"]]\n  return $ inTags True cls attr contents\nblockToJATS opts (Div (ident,_,kvs) bs) = do\n  contents <- blocksToJATS opts bs\n  -- Attributes that are allowed on both @<p>@ and @<boxed-text>@ elements\n  let generic_attr = [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n                     [(\"xml:lang\",l) | (\"lang\",l) <- kvs] ++\n                     [(k,v) | (k,v) <- kvs, k `elem` [\"specific-use\",\n                                                      \"content-type\"]]\n  let boxed_attr = [(k,v) | (k,v) <- kvs, k `elem` [\"orientation\", \"position\"]]\n  let attr = generic_attr <> boxed_attr\n  return $\n    if null attr\n    then contents\n    else -- The contents must be wrapped in an appropriate element.\n      let element = if null boxed_attr\n                    then \"p\"\n                    else \"boxed-text\"\n      in inTags True element (generic_attr <> boxed_attr) contents\nblockToJATS opts (Header _ _ title) = do\n  title' <- inlinesToJATS opts (map fixLineBreak title)\n  return $ inTagsSimple \"title\" title'\n-- Special cases for bare images, which are rendered as graphics\nblockToJATS _opts (Plain [Image attr alt tgt]) =\n  return $ graphic attr alt tgt\nblockToJATS _opts (Para [Image attr alt tgt]) =\n  return $ graphic attr alt tgt\n-- No Plain, everything needs to be in a block-level tag\nblockToJATS opts (Plain lst) = blockToJATS opts (Para lst)\nblockToJATS opts (Para lst) =\n  inTagsSimple \"p\" <$> inlinesToJATS opts lst\nblockToJATS opts (LineBlock lns) =\n  blockToJATS opts $ linesToPara lns\nblockToJATS opts (BlockQuote blocks) = do\n  tagSet <- asks jatsTagSet\n  let needsWrap = if tagSet == TagSetArticleAuthoring\n                  then not . isPara\n                  else \\case\n                    Header{}       -> True\n                    HorizontalRule -> True\n                    _              -> False\n  inTagsIndented \"disp-quote\" <$> wrappedBlocksToJATS needsWrap opts blocks\nblockToJATS opts (CodeBlock a str) = return $\n  inTags False tag attr (flush (text (T.unpack $ escapeStringForXML str)))\n    where (lang, attr) = codeAttr opts a\n          tag          = if T.null lang then \"preformat\" else \"code\"\nblockToJATS _ (BulletList []) = return empty\nblockToJATS opts (BulletList lst) =\n  inTags True \"list\" [(\"list-type\", \"bullet\")] <$>\n  listItemsToJATS opts Nothing lst\nblockToJATS _ (OrderedList _ []) = return empty\nblockToJATS opts (OrderedList (start, numstyle, delimstyle) items) = do\n  tagSet <- asks jatsTagSet\n  let listType =\n        -- The Article Authoring tag set doesn't allow a more specific\n        -- @list-type@ attribute than \"order\".\n        if tagSet == TagSetArticleAuthoring\n        then \"order\"\n        else case numstyle of\n               DefaultStyle -> \"order\"\n               Decimal      -> \"order\"\n               Example      -> \"order\"\n               UpperAlpha   -> \"alpha-upper\"\n               LowerAlpha   -> \"alpha-lower\"\n               UpperRoman   -> \"roman-upper\"\n               LowerRoman   -> \"roman-lower\"\n  let simpleList = start == 1 && (delimstyle == DefaultDelim ||\n                                  delimstyle == Period)\n  let markers = if simpleList\n                   then Nothing\n                   else Just $\n                          orderedListMarkers (start, numstyle, delimstyle)\n  inTags True \"list\" [(\"list-type\", listType)] <$>\n    listItemsToJATS opts markers items\nblockToJATS opts (DefinitionList lst) =\n  inTags True \"def-list\" [] <$> deflistItemsToJATS opts lst\nblockToJATS _ b@(RawBlock f str)\n  | f == \"jats\"    = return $ text $ T.unpack str -- raw XML block\n  | otherwise      = do\n      report $ BlockNotRendered b\n      return empty\nblockToJATS _ HorizontalRule = return empty -- not semantic\nblockToJATS opts (Table attr caption colspecs thead tbody tfoot) =\n  tableToJATS opts (Ann.toTable attr caption colspecs thead tbody tfoot)\nblockToJATS opts (Figure (ident, _, kvs) (Caption _short longcapt) body) = do\n  -- Remove the alt text from images if it's the same as the caption text.\n  let unsetAltIfDupl = \\case\n        Image attr alt tgt\n          | stringify alt == stringify longcapt -> Image attr [] tgt\n        inline -> inline\n  capt <- if null longcapt\n          then pure empty\n          else inTagsSimple \"caption\" <$> blocksToJATS opts longcapt\n\n  -- We handle the element specially if it's a figure with subfigures, i.e., if\n  -- all immediate children are figures themselves.\n  let hasSubfigures = all (\\case { Figure{} -> True; _ -> False}) body\n      needsWrapping = if hasSubfigures\n                      then (const False)\n                      else \\case\n                        -- Wrap all figure content elements, except for those\n                        -- allowed as direct subelements.\n                        BlockQuote{}    -> False\n                        CodeBlock{}     -> False\n                        Para{}          -> False\n                        Plain [Image{}] -> False\n                        Plain [Math{}]  -> False\n                        Table{}         -> False\n                        _               -> True\n\n  children <- wrappedBlocksToJATS needsWrapping opts $ walk unsetAltIfDupl body\n  let (tag, allowedAttributes) =\n        if hasSubfigures\n        then ( \"fig-group\"\n             , [\"content-type\", \"orientation\", \"position\", \"specific-use\"]\n             )\n        else (\"fig\"\n             , [\"fig-type\", \"orientation\", \"position\", \"specific-use\"]\n             )\n  let xmlattr =  [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n                 [(k,v) | (k,v) <- kvs\n                        , k `elem` allowedAttributes]\n  return $ inTags True tag xmlattr $ capt $$ children\n\n-- | Convert a list of inline elements to JATS.\ninlinesToJATS :: PandocMonad m => WriterOptions -> [Inline] -> JATS m (Doc Text)\ninlinesToJATS opts lst = hcat <$> mapM (inlineToJATS opts) (fixCitations lst)\n  where\n   fixCitations [] = []\n   fixCitations (x:xs) | needsFixing x =\n     x : Str (stringify ys) : fixCitations zs\n     where\n       needsFixing (RawInline (Format \"jats\") z) =\n           \"<pub-id pub-id-type=\" `T.isPrefixOf` z\n       needsFixing _           = False\n       isRawInline RawInline{} = True\n       isRawInline _           = False\n       (ys,zs)                 = break isRawInline xs\n   fixCitations (x:xs) = x : fixCitations xs\n\n-- | Convert an inline element to JATS.\ninlineToJATS :: PandocMonad m => WriterOptions -> Inline -> JATS m (Doc Text)\ninlineToJATS _ (Str str) = return $ text $ T.unpack $ escapeStringForXML str\ninlineToJATS opts (Emph lst) =\n  inTagsSimple \"italic\" <$> inlinesToJATS opts lst\ninlineToJATS opts (Underline lst) =\n  inTagsSimple \"underline\" <$> inlinesToJATS opts lst\ninlineToJATS opts (Strong lst) =\n  inTagsSimple \"bold\" <$> inlinesToJATS opts lst\ninlineToJATS opts (Strikeout lst) =\n  inTagsSimple \"strike\" <$> inlinesToJATS opts lst\ninlineToJATS opts (Superscript lst) =\n  inTagsSimple \"sup\" <$> inlinesToJATS opts lst\ninlineToJATS opts (Subscript lst) =\n  inTagsSimple \"sub\" <$> inlinesToJATS opts lst\ninlineToJATS opts (SmallCaps lst) =\n  inTagsSimple \"sc\" <$> inlinesToJATS opts lst\ninlineToJATS opts (Quoted SingleQuote lst) = do\n  contents <- inlinesToJATS opts lst\n  return $ char '‘' <> contents <> char '’'\ninlineToJATS opts (Quoted DoubleQuote lst) = do\n  contents <- inlinesToJATS opts lst\n  return $ char '“' <> contents <> char '”'\ninlineToJATS opts (Code a str) =\n  return $ inTags False \"monospace\" attr $ literal (escapeStringForXML str)\n    where (_lang, attr) = codeAttr opts a\ninlineToJATS _ il@(RawInline f x)\n  | f == \"jats\" = return $ literal x\n  | otherwise   = do\n      report $ InlineNotRendered il\n      return empty\ninlineToJATS _ LineBreak = return cr -- not allowed as child of p\n-- see https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/break.html\ninlineToJATS _ Space = return space\ninlineToJATS opts SoftBreak\n  | writerWrapText opts == WrapPreserve = return cr\n  | otherwise = return space\ninlineToJATS opts (Note contents) = do\n  tagSet <- asks jatsTagSet\n  -- Footnotes must occur inline when using the Article Authoring tag set.\n  if tagSet == TagSetArticleAuthoring\n    then inTagsIndented \"fn\" <$> wrappedBlocksToJATS (not . isPara) opts contents\n    else do\n      notes <- gets jatsNotes\n      let notenum = case notes of\n                      (n, _):_ -> n + 1\n                      []       -> 1\n      thenote <- inTags True \"fn\" [(\"id\", \"fn\" <> tshow notenum)]\n                     . (inTagsSimple \"label\" (literal $ tshow notenum) <>)\n                    <$> wrappedBlocksToJATS (not . isPara) opts\n                         (walk demoteHeaderAndRefs contents)\n      modify $ \\st -> st{ jatsNotes = (notenum, thenote) : notes }\n      return $ inTags False \"xref\" [(\"ref-type\", \"fn\"),\n                                    (\"rid\", \"fn\" <> tshow notenum)]\n             $ text (show notenum)\ninlineToJATS opts (Cite _ lst) =\n  inlinesToJATS opts lst\ninlineToJATS opts (Span (ident,classes,kvs) ils) = do\n  contents <- inlinesToJATS opts ils\n  let commonAttr = [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n                   [(\"xml:lang\",l) | (\"lang\",l) <- kvs] ++\n                   [(k,v) | (k,v) <- kvs,  k `elem` [\"alt\", \"specific-use\"]]\n  -- A named-content element is a good fit for spans, but requires a\n  -- content-type attribute to be present. We use either the explicit\n  -- attribute or the first class as content type. If neither is\n  -- available, then we fall back to using a @styled-content@ element.\n  let (tag, specificAttr) =\n        case lookup \"content-type\" kvs <|> listToMaybe classes of\n          Just ct -> ( \"named-content\"\n                     , (\"content-type\", ct) :\n                       [(k, v) | (k, v) <- kvs\n                       , k `elem` [\"rid\", \"vocab\", \"vocab-identifier\",\n                                   \"vocab-term\", \"vocab-term-identifier\"]])\n          -- Fall back to styled-content\n          Nothing -> (\"styled-content\"\n                     , [(k, v) | (k,v) <- kvs\n                       , k `elem` [\"style\", \"style-type\", \"style-detail\",\n                                   \"toggle\"]])\n  let attr = commonAttr ++ specificAttr\n  -- unwrap if wrapping element would have no attributes\n  return $\n    if null attr\n    then contents\n    else inTags False tag attr contents\ninlineToJATS _ (Math t str) = do\n  let addPref (Xml.Attr q v)\n         | Xml.qName q == \"xmlns\" = Xml.Attr q{ Xml.qName = \"xmlns:mml\" } v\n         | otherwise = Xml.Attr q v\n  let fixNS' e = e{ Xml.elName =\n                         (Xml.elName e){ Xml.qPrefix = Just \"mml\" } }\n  let fixNS = everywhere (mkT fixNS') .\n              (\\e -> e{ Xml.elAttribs = map addPref (Xml.elAttribs e) })\n  let conf = Xml.useShortEmptyTags (const False) Xml.defaultConfigPP\n  res <- convertMath writeMathML t str\n  let tagtype = case t of\n                     DisplayMath -> \"disp-formula\"\n                     InlineMath  -> \"inline-formula\"\n\n  let rawtex = text \"<![CDATA[\" <> literal str <> text \"]]>\"\n  let texMath = inTagsSimple \"tex-math\" rawtex\n\n  tagSet <- asks jatsTagSet\n  return . inTagsSimple tagtype $\n    case res of\n      Right r  -> let mathMl = text (Xml.ppcElement conf $ fixNS r)\n                  -- tex-math is unsupported in Article Authoring tag set\n                  in if tagSet == TagSetArticleAuthoring\n                     then mathMl\n                     else inTagsSimple \"alternatives\" $\n                          cr <> texMath $$ mathMl\n      Left _   -> if tagSet /= TagSetArticleAuthoring\n                  then texMath\n                  else rawtex\ninlineToJATS _ (Link _attr [Str t] (T.stripPrefix \"mailto:\" -> Just email, _))\n  | escapeURI t == email =\n  return $ inTagsSimple \"email\" $ literal (escapeStringForXML email)\ninlineToJATS opts (Link (ident,_,kvs) txt (T.uncons -> Just ('#', src), _)) = do\n  let attr = mconcat\n             [ [(\"id\", escapeNCName ident) | not (T.null ident)]\n             , [(\"alt\", stringify txt) | not (null txt)]\n             , [(\"rid\", escapeNCName src)]\n             , [(k,v) | (k,v) <- kvs, k `elem` [\"ref-type\", \"specific-use\"]]\n             , [(\"ref-type\", \"bibr\") | \"ref-\" `T.isPrefixOf` src]\n             ]\n  if null txt\n     then return $ selfClosingTag \"xref\" attr\n     else do\n        contents <- inlinesToJATS opts txt\n        return $ inTags False \"xref\" attr contents\ninlineToJATS opts (Link (ident,_,kvs) txt (src, tit)) = do\n  let attr = [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n             [(\"ext-link-type\", \"uri\"),\n              (\"xlink:href\", src)] ++\n             [(\"xlink:title\", tit) | not (T.null tit)] ++\n             [(k,v) | (k,v) <- kvs, k `elem` [\"assigning-authority\",\n                                              \"specific-use\", \"xlink:actuate\",\n                                              \"xlink:role\", \"xlink:show\",\n                                              \"xlink:type\"]]\n  contents <- inlinesToJATS opts txt\n  return $ inTags False \"ext-link\" attr contents\ninlineToJATS _ (Image attr alt tgt) = do\n  let elattr = graphicAttr attr alt tgt\n  return $ case altToJATS alt of\n             Nothing -> selfClosingTag \"inline-graphic\" elattr\n             Just altTag -> inTags True \"inline-graphic\" elattr altTag\n\ngraphic :: Attr -> [Inline] -> Target -> (Doc Text)\ngraphic attr alt tgt =\n  let elattr = graphicAttr attr alt tgt\n  in case altToJATS alt of\n       Nothing -> selfClosingTag \"graphic\" elattr\n       Just altTag -> inTags True \"graphic\" elattr altTag\n\ngraphicAttr :: Attr -> [Inline] -> Target -> [(Text, Text)]\ngraphicAttr (ident, _, kvs) _alt (src, tit) =\n  let (maintype, subtype) = imageMimeType src kvs\n  in [(\"id\", escapeNCName ident) | not (T.null ident)] ++\n     [ (\"mimetype\", maintype)\n     , (\"mime-subtype\", subtype)\n     , (\"xlink:href\", src)\n     ] ++\n     [(\"xlink:title\", tit) | not (T.null tit)] ++\n     [(k,v) | (k,v) <- kvs\n            , k `elem` [ \"baseline-shift\", \"content-type\", \"specific-use\"\n                       , \"xlink:actuate\", \"xlink:href\", \"xlink:role\"\n                       , \"xlink:show\", \"xlink:type\"]\n            ]\n\naltToJATS :: [Inline] -> Maybe (Doc Text)\naltToJATS alt =\n  if null alt\n  then Nothing\n  else Just . inTagsSimple \"alt-text\" .\n       hsep . map literal . T.words $ stringify alt\n\nimageMimeType :: Text -> [(Text, Text)] -> (Text, Text)\nimageMimeType src kvs =\n  let mbMT = getMimeType (T.unpack src)\n      maintype = fromMaybe \"image\" $\n                  lookup \"mimetype\" kvs `mplus`\n                  (T.takeWhile (/='/') <$> mbMT)\n      subtype = fromMaybe \"\" $\n                  lookup \"mime-subtype\" kvs `mplus`\n                  (T.drop 1 . T.dropWhile (/='/') <$> mbMT)\n  in (maintype, subtype)\n\nisParaOrList :: Block -> Bool\nisParaOrList Para{}           = True\nisParaOrList Plain{}          = True\nisParaOrList BulletList{}     = True\nisParaOrList OrderedList{}    = True\nisParaOrList DefinitionList{} = True\nisParaOrList _                = False\n\nisPara :: Block -> Bool\nisPara Para{}  = True\nisPara Plain{} = True\nisPara _       = False\n\ndemoteHeaderAndRefs :: Block -> Block\ndemoteHeaderAndRefs (Header _ _ ils) = Para ils\ndemoteHeaderAndRefs (Div (\"refs\",cls,kvs) bs) =\n                       Div (\"\",cls,kvs) bs\ndemoteHeaderAndRefs x = x\n\nparseDate :: Text -> Maybe Day\nparseDate s = msum (map (`parsetimeWith` T.unpack s) formats)\n  where parsetimeWith = parseTimeM True defaultTimeLocale\n        formats = [\"%x\",\"%m/%d/%Y\", \"%D\",\"%F\", \"%d %b %Y\",\n                    \"%e %B %Y\", \"%b. %e, %Y\", \"%B %e, %Y\",\n                    \"%Y%m%d\", \"%Y%m\", \"%Y\"]\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Jira.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards #-}\n{- |\n   Module      : Text.Pandoc.Writers.Jira\n   Copyright   : © 2010-2024 Albert Krewinkel, John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to Jira markup.\n\nJIRA:\n<https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all>\n-}\nmodule Text.Pandoc.Writers.Jira ( writeJira ) where\nimport Control.Monad.Reader (ReaderT, ask, asks, runReaderT)\nimport Control.Monad.State.Strict (StateT, evalStateT, gets, modify)\nimport Data.Text (Text)\nimport Text.Jira.Parser (plainText)\nimport Text.Jira.Printer (prettyBlocks, prettyInlines)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (WriterOptions (writerTemplate, writerWrapText),\n                            WrapOption (..))\nimport Text.Pandoc.Shared (linesToPara, stringify)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Math (texMathToInlines)\nimport Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable)\nimport Text.DocLayout (literal, render)\nimport qualified Data.Text as T\nimport qualified Text.Jira.Markup as Jira\n\n-- | Convert Pandoc to Jira.\nwriteJira :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteJira opts = runDefaultConverter (writerWrapText opts) (pandocToJira opts)\n\n-- | State to keep track of footnotes.\ndata ConverterState = ConverterState\n  { stNotes   :: [Text] -- ^ Footnotes to be appended to the end of the text\n  , stInPanel :: Bool   -- ^ whether we are in a @{panel}@ block\n  }\n\n-- | Initial converter state.\nstartState :: ConverterState\nstartState = ConverterState\n  { stNotes = []\n  , stInPanel = False\n  }\n\n-- | Converter monad\ntype JiraConverter m = ReaderT WrapOption (StateT ConverterState m)\n\n-- | Run a converter using the default state\nrunDefaultConverter :: PandocMonad m\n                    => WrapOption\n                    -> (a -> JiraConverter m Text)\n                    -> a\n                    -> m Text\nrunDefaultConverter wrap c x = evalStateT (runReaderT (c x) wrap) startState\n\n-- | Return Jira representation of document.\npandocToJira :: PandocMonad m\n             => WriterOptions -> Pandoc -> JiraConverter m Text\npandocToJira opts (Pandoc meta blocks) = do\n  wrap <- ask\n  metadata <- metaToContext opts\n                 (fmap literal . runDefaultConverter wrap blockListToJira)\n                 (fmap literal . runDefaultConverter wrap inlineListToJira) meta\n  body <- blockListToJira blocks\n  notes <- gets $ T.intercalate \"\\n\" . reverse . stNotes\n  let main = body <> if T.null notes then mempty else \"\\n\\n\" <> notes\n  let context = defField \"body\" main metadata\n  return $\n    case writerTemplate opts of\n      Nothing  -> main\n      Just tpl -> render Nothing $ renderTemplate tpl context\n\nblockListToJira :: PandocMonad m => [Block] -> JiraConverter m Text\nblockListToJira = fmap prettyBlocks . toJiraBlocks\n\ninlineListToJira :: PandocMonad m => [Inline] -> JiraConverter m Text\ninlineListToJira = fmap prettyInlines . toJiraInlines\n\ntoJiraBlocks :: PandocMonad m => [Block] -> JiraConverter m [Jira.Block]\ntoJiraBlocks blocks = do\n  let convert = \\case\n        BlockQuote bs        -> singleton . Jira.BlockQuote\n                                <$> toJiraBlocks bs\n        BulletList items     -> singleton . Jira.List Jira.CircleBullets\n                                <$> toJiraItems items\n        CodeBlock attr cs    -> toJiraCode attr cs\n        DefinitionList items -> toJiraDefinitionList items\n        Div attr bs          -> toJiraPanel attr bs\n        Header lvl attr xs   -> toJiraHeader lvl attr xs\n        HorizontalRule       -> return . singleton $ Jira.HorizontalRule\n        LineBlock xs         -> toJiraBlocks [linesToPara xs]\n        OrderedList _ items  -> singleton . Jira.List Jira.Enumeration\n                                <$> toJiraItems items\n        Para xs              -> singleton . Jira.Para <$> toJiraInlines xs\n        Plain xs             -> singleton . Jira.Para <$> toJiraInlines xs\n        RawBlock fmt cs      -> rawBlockToJira fmt cs\n        Table _ blkCapt specs thead tbody tfoot -> singleton <$> do\n          let (_, _, _, hd, body) = toLegacyTable blkCapt specs thead tbody tfoot\n          headerRow <- if all null hd\n                       then pure Nothing\n                       else Just <$> toRow Jira.HeaderCell hd\n          bodyRows <- mapM (toRow Jira.BodyCell) body\n          let rows = case headerRow of\n                       Just header -> header : bodyRows\n                       Nothing     -> bodyRows\n          return $ Jira.Table rows\n        Figure attr _ body         -> toJiraPanel attr body\n  jiraBlocks <- mapM convert blocks\n  return $ mconcat jiraBlocks\n\ntoRow :: PandocMonad m\n      => ([Jira.Block] -> Jira.Cell)\n      -> [[Block]]\n      -> JiraConverter m Jira.Row\ntoRow mkCell cells = Jira.Row <$>\n  mapM (fmap mkCell . toJiraBlocks) cells\n\ntoJiraItems :: PandocMonad m => [[Block]] -> JiraConverter m [[Jira.Block]]\ntoJiraItems = mapM toJiraBlocks\n\ntoJiraCode :: PandocMonad m\n           => Attr\n           -> Text\n           -> JiraConverter m [Jira.Block]\ntoJiraCode (ident, classes, _attribs) code = do\n  return . addAnchor ident . singleton $\n    case classes of\n      []  -> Jira.NoFormat mempty code\n      l:_ -> Jira.Code (Jira.Language l) mempty code\n\n-- | Prepends an anchor with the given identifier.\naddAnchor :: Text -> [Jira.Block] -> [Jira.Block]\naddAnchor ident =\n  if T.null ident\n  then id\n  else \\case\n    Jira.Para xs : bs -> (Jira.Para (Jira.Anchor ident : xs) : bs)\n    bs                -> (Jira.Para (singleton (Jira.Anchor ident)) : bs)\n\n-- | Creates a Jira definition list\ntoJiraDefinitionList :: PandocMonad m\n                     => [([Inline], [[Block]])]\n                     -> JiraConverter m [Jira.Block]\ntoJiraDefinitionList defItems = do\n  let convertDefItem (term, defs) = do\n        jiraTerm <- Jira.Para <$> styled Jira.Strong term\n        jiraDefs <- mconcat <$> mapM toJiraBlocks defs\n        return $ jiraTerm : jiraDefs\n  singleton . Jira.List Jira.CircleBullets <$> mapM convertDefItem defItems\n\n-- | Creates a Jira panel\ntoJiraPanel :: PandocMonad m\n            => Attr -> [Block]\n            -> JiraConverter m [Jira.Block]\ntoJiraPanel (ident, classes, attribs) blocks = do\n  inPanel <- gets stInPanel\n  if inPanel || (\"panel\" `notElem` classes && null attribs)\n    then addAnchor ident <$> toJiraBlocks blocks\n    else do\n      modify $ \\st -> st{ stInPanel = True }\n      jiraBlocks <- toJiraBlocks blocks\n      modify $ \\st -> st{ stInPanel = inPanel }\n      let params = map (uncurry Jira.Parameter) attribs\n      return $ singleton (Jira.Panel params $ addAnchor ident jiraBlocks)\n\n-- | Creates a Jira header\ntoJiraHeader :: PandocMonad m\n             => Int -> Attr -> [Inline]\n             -> JiraConverter m [Jira.Block]\ntoJiraHeader lvl (ident, _, _) inlines =\n  let anchor = Jira.Anchor ident\n  in singleton . Jira.Header lvl . (anchor :) <$> toJiraInlines inlines\n\n-- | Handles raw block. Jira is included verbatim, everything else is\n-- discarded.\nrawBlockToJira :: PandocMonad m\n               => Format -> Text\n               -> JiraConverter m [Jira.Block]\nrawBlockToJira fmt cs = do\n  rawInlines <- toJiraRaw fmt cs\n  return $\n    if null rawInlines\n    then mempty\n    else singleton (Jira.Para rawInlines)\n\ntoJiraRaw :: PandocMonad m\n          => Format -> Text -> JiraConverter m [Jira.Inline]\ntoJiraRaw fmt cs = case fmt of\n  Format \"jira\" -> return . singleton $ Jira.Str cs\n  _             -> return mempty\n\n\n--\n-- Inlines\n--\n\ntoJiraInlines :: PandocMonad m => [Inline] -> JiraConverter m [Jira.Inline]\ntoJiraInlines inlines = do\n  let convert = \\case\n        Cite _ xs          -> toJiraInlines xs\n        Code _ cs          -> return . singleton $\n                              Jira.Monospaced (escapeSpecialChars cs)\n        Emph xs            -> styled Jira.Emphasis xs\n        Underline xs       -> styled Jira.Insert xs\n        Image attr cap tgt -> uncurry (imageToJira attr cap) tgt\n        LineBreak          -> pure . singleton $ Jira.Linebreak\n        Link attr xs tgt   -> toJiraLink attr tgt xs\n        Math mtype cs      -> mathToJira mtype cs\n        Note bs            -> registerNotes bs\n        Quoted qt xs       -> quotedToJira qt xs\n        RawInline fmt cs   -> toJiraRaw fmt cs\n        SmallCaps xs       -> styled Jira.Strong xs\n        SoftBreak          -> do\n                                preserveBreak <- asks (== WrapPreserve)\n                                pure . singleton $ if preserveBreak\n                                  then Jira.Linebreak\n                                  else Jira.Space\n        Space              -> pure . singleton $ Jira.Space\n        Span attr xs       -> spanToJira attr xs\n        Str s              -> pure $ escapeSpecialChars s\n        Strikeout xs       -> styled Jira.Strikeout xs\n        Strong xs          -> styled Jira.Strong xs\n        Subscript xs       -> styled Jira.Subscript xs\n        Superscript xs     -> styled Jira.Superscript xs\n  jiraInlines <- mapM convert inlines\n  return $ mconcat jiraInlines\n\nsingleton :: a -> [a]\nsingleton = (:[])\n\nstyled :: PandocMonad m\n       => Jira.InlineStyle -> [Inline]\n       -> JiraConverter m [Jira.Inline]\nstyled s = fmap (singleton . Jira.Styled s) . toJiraInlines\n\n-- | Converts a plain text value to Jira inlines, ensuring that all\n-- special characters will be handled appropriately.\nescapeSpecialChars :: Text -> [Jira.Inline]\nescapeSpecialChars t = case plainText t of\n  Right xs -> xs\n  Left _  -> singleton $ Jira.Str t\n\nimageToJira :: PandocMonad m\n            => Attr -> [Inline] -> Text -> Text\n            -> JiraConverter m [Jira.Inline]\nimageToJira (_, classes, kvs) caption src title =\n  let imageWithParams ps = Jira.Image ps (Jira.URL src)\n      alt = stringify caption\n  in pure . singleton . imageWithParams $\n     if \"thumbnail\" `elem` classes\n     then [Jira.Parameter \"thumbnail\" \"\"]\n     else map (uncurry Jira.Parameter)\n          . (if T.null title then id else ((\"title\", title):))\n          . (if T.null alt then id else ((\"alt\", alt):))\n          $ kvs\n\n-- | Creates a Jira Link element.\ntoJiraLink :: PandocMonad m\n           => Attr\n           -> Target\n           -> [Inline]\n           -> JiraConverter m [Jira.Inline]\ntoJiraLink (_, classes, _) (url, _) alias = do\n  let (linkType, url') = toLinkType url\n  description <- if url `elem` [stringify alias, \"mailto:\" <> stringify alias]\n                 then pure mempty\n                 else toJiraInlines alias\n  pure . singleton $ Jira.Link linkType description (Jira.URL url')\n where\n  toLinkType url'\n    | Just email <- T.stripPrefix \"mailto:\" url' = (Jira.Email, email)\n    | \"user-account\" `elem` classes              = (Jira.User, dropTilde url)\n    | \"attachment\" `elem` classes                = (Jira.Attachment, url)\n    | \"smart-card\" `elem` classes                = (Jira.SmartCard, url)\n    | \"smart-link\" `elem` classes                = (Jira.SmartLink, url)\n    | otherwise                                  = (Jira.External, url)\n  dropTilde txt = case T.uncons txt of\n    Just ('~', username) -> username\n    _                    -> txt\n\nmathToJira :: PandocMonad m\n           => MathType\n           -> Text\n           -> JiraConverter m [Jira.Inline]\nmathToJira mtype cs = do\n  mathInlines <- toJiraInlines =<< texMathToInlines mtype cs\n  return $ case mtype of\n    InlineMath  -> mathInlines\n    DisplayMath -> Jira.Linebreak : mathInlines ++ [Jira.Linebreak]\n\nquotedToJira :: PandocMonad m\n             => QuoteType\n             -> [Inline]\n             -> JiraConverter m [Jira.Inline]\nquotedToJira qtype xs = do\n  let quoteChar = case qtype of\n                    DoubleQuote -> \"\\\"\"\n                    SingleQuote -> \"'\"\n  let surroundWithQuotes = (Jira.Str quoteChar :) . (++ [Jira.Str quoteChar])\n  surroundWithQuotes <$> toJiraInlines xs\n\nspanToJira :: PandocMonad m\n           => Attr -> [Inline]\n           -> JiraConverter m [Jira.Inline]\nspanToJira (ident, _classes, attribs) inls =\n  let wrap = case lookup \"color\" attribs of\n               Nothing -> id\n               Just color -> singleton . Jira.ColorInline (Jira.ColorName color)\n  in wrap <$> case ident of\n    \"\" -> toJiraInlines inls\n    _  -> (Jira.Anchor ident :) <$> toJiraInlines inls\n\nregisterNotes :: PandocMonad m => [Block] -> JiraConverter m [Jira.Inline]\nregisterNotes contents = do\n  curNotes <- gets stNotes\n  let newnum = length curNotes + 1\n  contents' <- blockListToJira contents\n  let thisnote = \"\\\\[\" <> T.pack (show newnum) <> \"] \" <> contents' <> \"\\n\"\n  modify $ \\s -> s { stNotes = thisnote : curNotes }\n  return . singleton . Jira.Str $\n    \"[\" <> T.pack (show newnum) <> \"]\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Caption.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Writers.LaTeX.Caption\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nWrite figure or table captions as LaTeX.\n-}\nmodule Text.Pandoc.Writers.LaTeX.Caption\n  ( getCaption\n  ) where\n\nimport Control.Monad.State.Strict\nimport Data.Monoid (Any(..))\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.DocLayout (Doc, brackets, empty)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.LaTeX.Notes (notesToLaTeX)\nimport Text.Pandoc.Writers.LaTeX.Types\n  ( LW, WriterState (stExternalNotes, stNotes, stInCaption) )\n\n\n-- | Produces the components of a LaTeX 'caption' command. Returns a triple\n-- containing the caption text, the short caption for the list of\n-- figures/tables, and the footnote definitions.\ngetCaption :: PandocMonad m\n           => ([Inline] -> LW m (Doc Text)) -- ^ inlines converter\n           -> Bool                          -- ^ whether to extract notes\n           -> Caption\n           -> LW m (Doc Text, Doc Text, Doc Text)\ngetCaption inlineListToLaTeX externalNotes (Caption maybeShort long) = do\n  modify $ \\st -> st{ stInCaption = True }\n  let long' = blocksToInlines long\n  oldExternalNotes <- gets stExternalNotes\n  modify $ \\st -> st{ stExternalNotes = externalNotes, stNotes = [] }\n  capt <- inlineListToLaTeX long'\n  footnotes <- if externalNotes\n                  then notesToLaTeX <$> gets stNotes\n                  else return empty\n  modify $ \\st -> st{ stExternalNotes = oldExternalNotes, stNotes = [] }\n  -- We can't have footnotes in the list of figures/tables, so remove them:\n  let getNote (Note _) = Any True\n      getNote _        = Any False\n  let hasNotes = getAny . query getNote\n  let toShortCapt = fmap brackets . inlineListToLaTeX . walk deNote\n  captForLof <- case maybeShort of\n                  Nothing -> if hasNotes long'\n                             then toShortCapt long'\n                             else return empty\n                  Just short -> toShortCapt short\n  modify $ \\st -> st{ stInCaption = False }\n  return (capt, captForLof, footnotes)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Citation.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.LaTeX.Citation\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.Writers.LaTeX.Citation\n  ( citationsToNatbib,\n    citationsToBiblatex\n  ) where\n\nimport Data.Text (Text)\nimport Data.Char (isPunctuation)\nimport Control.Monad.State (gets)\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Text as T\nimport Text.Pandoc.Options\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport qualified Data.List as L\nimport Text.DocLayout (Doc, brackets, empty, (<+>), text, isEmpty, literal,\n                       braces)\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.LaTeX.Types ( LW, WriterState(stLang, stOptions) )\nimport Text.Pandoc.Citeproc.Locator (parseLocator, LocatorInfo(..),\n                                     toLocatorMap)\nimport Citeproc.Types (Lang(..))\nimport Citeproc.Locale (getLocale)\nimport Safe (headMay, lastMay)\n\ncitationsToNatbib :: PandocMonad m\n                  => ([Inline] -> LW m (Doc Text))\n                  -> [Citation]\n                  -> LW m (Doc Text)\ncitationsToNatbib inlineListToLaTeX [one]\n  = citeCommand inlineListToLaTeX c p s k\n  where\n    Citation { citationId = k\n             , citationPrefix = p\n             , citationSuffix = s\n             , citationMode = m\n             }\n      = one\n    c = case m of\n             AuthorInText   -> \"citet\"\n             SuppressAuthor -> \"citeyearpar\"\n             NormalCitation -> \"citep\"\n\ncitationsToNatbib inlineListToLaTeX cits\n  | noInnerPrefix cits && noInnerSuffix cits && ismode NormalCitation cits\n  = citeCommand inlineListToLaTeX \"citep\" p s ks\n  where\n     noInnerPrefix []     = True\n     noInnerPrefix (_:xs) = all (null . citationPrefix) xs\n     noInnerSuffix []     = True\n     noInnerSuffix [_]    = True\n     noInnerSuffix (x:xs) = null (citationSuffix x) && noInnerSuffix xs\n     ismode m  = all ((==) m  . citationMode)\n     p         = maybe mempty citationPrefix $ headMay cits\n     s         = maybe mempty citationSuffix $ lastMay cits\n     ks        = T.intercalate \", \" $ map citationId cits\n\ncitationsToNatbib inlineListToLaTeX (c:cs)\n  | citationMode c == AuthorInText = do\n     author <- citeCommand inlineListToLaTeX \"citeauthor\" [] [] (citationId c)\n     cits   <- citationsToNatbib inlineListToLaTeX\n                  (c { citationMode = SuppressAuthor } : cs)\n     return $ author <+> cits\n\ncitationsToNatbib inlineListToLaTeX cits = do\n  cits' <- mapM convertOne cits\n  return $ text \"\\\\citetext{\" <> L.foldl' combineTwo empty cits' <> text \"}\"\n  where\n    citeCommand' = citeCommand inlineListToLaTeX\n    combineTwo a b | isEmpty a = b\n                   | otherwise = a <> text \"; \" <> b\n    convertOne Citation { citationId = k\n                        , citationPrefix = p\n                        , citationSuffix = s\n                        , citationMode = m\n                        }\n        = case m of\n               AuthorInText   -> citeCommand' \"citealt\"  p s k\n               SuppressAuthor -> citeCommand' \"citeyear\" p s k\n               NormalCitation -> citeCommand' \"citealp\"  p s k\n\nciteCommand :: PandocMonad m\n            => ([Inline] -> LW m (Doc Text))\n            -> Text\n            -> [Inline]\n            -> [Inline]\n            -> Text\n            -> LW m (Doc Text)\nciteCommand inlineListToLaTeX c p s k = do\n  args <- citeArguments inlineListToLaTeX p s k\n  return $ literal (\"\\\\\" <> c) <> args\n\ntype Prefix = [Inline]\ntype Suffix = [Inline]\ntype CiteId = Text\ndata CiteGroup = CiteGroup Prefix Suffix [CiteId]\n\nciteArgumentsList :: PandocMonad m\n              => ([Inline] -> LW m (Doc Text))\n              -> CiteGroup\n              -> LW m (Doc Text)\nciteArgumentsList _inlineListToLaTeX (CiteGroup _ _ []) = return empty\nciteArgumentsList inlineListToLaTeX (CiteGroup pfxs sfxs ids) = do\n      opts <- gets stOptions\n      mblang <- gets stLang\n      let sfxs' = (case writerCiteMethod opts of\n                     -- In biblatex, the label p. or pp. can be omitted;\n                     -- ranges are treated as page ranges by default. See #9275.\n                     Biblatex -> removePageLabel mblang\n                     _ -> id) $\n              stripLocatorBraces $ case sfxs of\n                (Str t : r) -> case T.uncons t of\n                  Just (x, xs)\n                    | T.null xs\n                    , isPunctuation x -> dropWhile (== Space) r\n                    | isPunctuation x -> Str xs : r\n                  _ -> sfxs\n                _   -> sfxs\n          optargs pdoc sdoc = case (isEmpty pdoc, isEmpty sdoc) of\n                 (True, True ) -> empty\n                 (True, False) -> brackets sdoc\n                 (_   , _    ) -> brackets pdoc <> brackets sdoc\n      pdoc <- inlineListToLaTeX pfxs\n      sdoc <- inlineListToLaTeX sfxs'\n      return $ optargs pdoc sdoc <>\n              braces (literal (T.intercalate \",\" (reverse ids)))\n\nciteArguments :: PandocMonad m\n              => ([Inline] -> LW m (Doc Text))\n              -> [Inline]\n              -> [Inline]\n              -> Text\n              -> LW m (Doc Text)\nciteArguments inlineListToLaTeX p s k =\n  citeArgumentsList inlineListToLaTeX (CiteGroup p s [k])\n\n-- strip off {} used to define locator in pandoc-citeproc; see #5722\nstripLocatorBraces :: [Inline] -> [Inline]\nstripLocatorBraces = walk go\n  where go (Str xs) = Str $ T.filter (\\c -> c /= '{' && c /= '}') xs\n        go x        = x\n\ncitationsToBiblatex :: PandocMonad m\n                    => ([Inline] -> LW m (Doc Text))\n                    -> [Citation] -> LW m (Doc Text)\ncitationsToBiblatex inlineListToLaTeX [one]\n  = citeCommand inlineListToLaTeX cmd p s k\n    where\n       Citation { citationId = k\n                , citationPrefix = p\n                , citationSuffix = s\n                , citationMode = m\n                } = one\n       cmd = case m of\n                  SuppressAuthor -> \"autocite*\"\n                  AuthorInText   -> \"textcite\"\n                  NormalCitation -> \"autocite\"\n\ncitationsToBiblatex inlineListToLaTeX (c:cs)\n  | all (\\cit -> null (citationPrefix cit) && null (citationSuffix cit)) (c:cs)\n    = do\n      let cmd = case citationMode c of\n                    SuppressAuthor -> \"\\\\autocite*\"\n                    AuthorInText   -> \"\\\\textcite\"\n                    NormalCitation -> \"\\\\autocite\"\n      return $ text cmd <>\n               braces (literal (T.intercalate \",\" (map citationId (c:cs))))\n  | otherwise\n    = do\n      let cmd = case citationMode c of\n                    SuppressAuthor -> \"\\\\autocites*\"\n                    AuthorInText   -> \"\\\\textcites\"\n                    NormalCitation -> \"\\\\autocites\"\n\n      groups <- mapM (citeArgumentsList inlineListToLaTeX)\n                     (reverse (L.foldl' grouper [] (c:cs)))\n\n      return $ text cmd <> mconcat groups\n\n  where grouper prev cit = case prev of\n         ((CiteGroup oPfx [] ids):rest)\n             | null pfx && null sfx\n           -> CiteGroup oPfx sfx (cid:ids) : rest\n         _ -> CiteGroup pfx sfx [cid] : prev\n         where pfx = citationPrefix cit\n               sfx = citationSuffix cit\n               cid = citationId cit\n\ncitationsToBiblatex _ _ = return empty\n\nremovePageLabel :: Maybe Lang -> [Inline] -> [Inline]\nremovePageLabel mblang ils =\n  case mbLocinfo of\n    Just locinfo | locatorLabel locinfo == \"page\"\n      -> Str (locatorLoc locinfo) : ils'\n    _ -> ils\n where\n   (mbLocinfo, ils') = parseLocator (toLocatorMap locale) ils\n   lang = fromMaybe (Lang \"en\" Nothing (Just \"US\") [] [] []) mblang\n   locale = either mempty id $ getLocale lang\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Lang.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Writers.LaTeX.Lang\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.Writers.LaTeX.Lang\n  ( toBabel\n  ) where\nimport Data.Text (Text)\nimport Text.Collate.Lang (Lang(..))\n\n\n-- Takes a list of the constituents of a BCP47 language code and\n-- converts it to a Babel language string.\n-- http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf\n-- List of supported languages (slightly outdated):\n-- http://tug.ctan.org/language/hyph-utf8/doc/generic/hyph-utf8/hyphenation.pdf\ntoBabel :: Lang -> Maybe Text\ntoBabel (Lang \"de\" _ (Just \"AT\") vars _ _)\n  | \"1901\" `elem` vars                  = Just \"austrian\"\n  | otherwise                           = Just \"naustrian\"\ntoBabel (Lang \"de\" _ (Just \"CH\") vars _ _)\n  | \"1901\" `elem` vars                  = Just \"swissgerman\"\n  | otherwise                           = Just \"nswissgerman\"\ntoBabel (Lang \"de\" _ _ vars _ _)\n  | \"1901\" `elem` vars                  = Just \"german\"\n  | otherwise                           = Just \"ngerman\"\ntoBabel (Lang \"dsb\" _ _ _ _ _)          = Just \"lowersorbian\"\ntoBabel (Lang \"el\" _ _ vars _ _)\n  | \"polyton\" `elem` vars               = Just \"polytonicgreek\"\ntoBabel (Lang \"en\" _ (Just \"AU\") _ _ _) = Just \"australian\"\ntoBabel (Lang \"en\" _ (Just \"CA\") _ _ _) = Just \"canadian\"\ntoBabel (Lang \"en\" _ (Just \"GB\") _ _ _) = Just \"british\"\ntoBabel (Lang \"en\" _ (Just \"NZ\") _ _ _) = Just \"newzealand\"\ntoBabel (Lang \"en\" _ (Just \"UK\") _ _ _) = Just \"british\"\ntoBabel (Lang \"en\" _ (Just \"US\") _ _ _) = Just \"american\"\ntoBabel (Lang \"fr\" _ (Just \"CA\") _ _ _) = Just \"canadien\"\ntoBabel (Lang \"fra\" _ _ vars _ _)\n  | \"aca\" `elem` vars                   = Just \"acadian\"\ntoBabel (Lang \"grc\" _ _ _ _ _)          = Just \"ancientgreek\"\ntoBabel (Lang \"hsb\" _ _ _ _ _)          = Just \"uppersorbian\"\ntoBabel (Lang \"la\" _ _ vars _ _)\n  | \"x-classic\" `elem` vars             = Just \"classiclatin\"\ntoBabel (Lang \"pt\" _ (Just \"BR\") _ _ _) = Just \"brazilian\"\ntoBabel (Lang \"sl\" _ _ _ _ _)           = Just \"slovene\"\ntoBabel (Lang \"zh\" (Just \"Hant\") (Just \"HK\") _ _ _) = Just \"chinese-hant-hk\"\ntoBabel (Lang \"zh\" (Just \"Hant\") (Just \"MO\") _ _ _) = Just \"chinese-hant-mo\"\ntoBabel (Lang \"zh\" (Just \"Hans\") (Just \"HK\") _ _ _) = Just \"chinese-hans-hk\"\ntoBabel (Lang \"zh\" (Just \"Hans\") (Just \"MO\") _ _ _) = Just \"chinese-hans-mo\"\ntoBabel (Lang \"zh\" (Just \"Hans\") _ _ _ _) = Just \"chinese-hans\"\ntoBabel (Lang \"zh\" (Just \"Hant\") _ _ _ _) = Just \"chinese-hant\"\ntoBabel (Lang \"zh\" _ _ _ _ _)             = Just \"chinese\"\ntoBabel x                                 = commonFromBcp47 x\n\n-- Takes a list of the constituents of a BCP47 language code\n-- and converts it to a string shared by Babel and Polyglossia.\n-- https://tools.ietf.org/html/bcp47#section-2.1\ncommonFromBcp47 :: Lang -> Maybe Text\ncommonFromBcp47 (Lang \"sr\" (Just \"Cyrl\") _ _ _ _)      = Just \"serbianc\"\ncommonFromBcp47 (Lang \"zh\" (Just \"Latn\") _ vars _ _)\n  | \"pinyin\" `elem` vars                               = Just \"pinyin\"\ncommonFromBcp47 (Lang l _ _ _ _ _) = fromIso l\n  where\n    fromIso \"af\"  = Just \"afrikaans\"\n    fromIso \"am\"  = Just \"amharic\"\n    fromIso \"ar\"  = Just \"arabic\"\n    fromIso \"as\"  = Just \"assamese\"\n    fromIso \"ast\" = Just \"asturian\"\n    fromIso \"bg\"  = Just \"bulgarian\"\n    fromIso \"bn\"  = Just \"bengali\"\n    fromIso \"bo\"  = Just \"tibetan\"\n    fromIso \"br\"  = Just \"breton\"\n    fromIso \"ca\"  = Just \"catalan\"\n    fromIso \"cy\"  = Just \"welsh\"\n    fromIso \"cs\"  = Just \"czech\"\n    fromIso \"cop\" = Just \"coptic\"\n    fromIso \"da\"  = Just \"danish\"\n    fromIso \"dv\"  = Just \"divehi\"\n    fromIso \"el\"  = Just \"greek\"\n    fromIso \"en\"  = Just \"english\"\n    fromIso \"eo\"  = Just \"esperanto\"\n    fromIso \"es\"  = Just \"spanish\"\n    fromIso \"et\"  = Just \"estonian\"\n    fromIso \"eu\"  = Just \"basque\"\n    fromIso \"fa\"  = Just \"persian\"\n    fromIso \"fi\"  = Just \"finnish\"\n    fromIso \"fr\"  = Just \"french\"\n    fromIso \"fur\" = Just \"friulan\"\n    fromIso \"ga\"  = Just \"irish\"\n    fromIso \"gd\"  = Just \"scottish\"\n    fromIso \"gez\" = Just \"ethiopic\"\n    fromIso \"gl\"  = Just \"galician\"\n    fromIso \"gu\"  = Just \"gujarati\"\n    fromIso \"he\"  = Just \"hebrew\"\n    fromIso \"hi\"  = Just \"hindi\"\n    fromIso \"hr\"  = Just \"croatian\"\n    fromIso \"hu\"  = Just \"magyar\"\n    fromIso \"hy\"  = Just \"armenian\"\n    fromIso \"ia\"  = Just \"interlingua\"\n    fromIso \"id\"  = Just \"indonesian\"\n    fromIso \"ie\"  = Just \"interlingua\"\n    fromIso \"is\"  = Just \"icelandic\"\n    fromIso \"it\"  = Just \"italian\"\n    fromIso \"ja\"  = Just \"japanese\"\n    fromIso \"km\"  = Just \"khmer\"\n    fromIso \"kmr\" = Just \"kurmanji\"\n    fromIso \"kn\"  = Just \"kannada\"\n    fromIso \"ko\"  = Just \"korean\"\n    fromIso \"la\"  = Just \"latin\"\n    fromIso \"lo\"  = Just \"lao\"\n    fromIso \"lt\"  = Just \"lithuanian\"\n    fromIso \"lv\"  = Just \"latvian\"\n    fromIso \"ml\"  = Just \"malayalam\"\n    fromIso \"mn\"  = Just \"mongolian\"\n    fromIso \"mr\"  = Just \"marathi\"\n    fromIso \"nb\"  = Just \"norsk\"\n    fromIso \"nl\"  = Just \"dutch\"\n    fromIso \"nn\"  = Just \"nynorsk\"\n    fromIso \"no\"  = Just \"norsk\"\n    fromIso \"nqo\" = Just \"nko\"\n    fromIso \"oc\"  = Just \"occitan\"\n    fromIso \"or\"  = Just \"oriya\"\n    fromIso \"pa\"  = Just \"punjabi\"\n    fromIso \"pl\"  = Just \"polish\"\n    fromIso \"pms\" = Just \"piedmontese\"\n    fromIso \"pt\"  = Just \"portuguese\"\n    fromIso \"rm\"  = Just \"romansh\"\n    fromIso \"ro\"  = Just \"romanian\"\n    fromIso \"ru\"  = Just \"russian\"\n    fromIso \"sa\"  = Just \"sanskrit\"\n    fromIso \"se\"  = Just \"samin\"\n    fromIso \"sk\"  = Just \"slovak\"\n    fromIso \"sq\"  = Just \"albanian\"\n    fromIso \"sr\"  = Just \"serbian\"\n    fromIso \"sv\"  = Just \"swedish\"\n    fromIso \"syr\" = Just \"syriac\"\n    fromIso \"ta\"  = Just \"tamil\"\n    fromIso \"te\"  = Just \"telugu\"\n    fromIso \"th\"  = Just \"thai\"\n    fromIso \"ti\"  = Just \"ethiopic\"\n    fromIso \"tk\"  = Just \"turkmen\"\n    fromIso \"tr\"  = Just \"turkish\"\n    fromIso \"uk\"  = Just \"ukrainian\"\n    fromIso \"ur\"  = Just \"urdu\"\n    fromIso \"vi\"  = Just \"vietnamese\"\n    fromIso _     = Nothing\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Notes.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.LaTeX.Notes\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nOutput tables as LaTeX.\n-}\nmodule Text.Pandoc.Writers.LaTeX.Notes\n  ( notesToLaTeX\n  ) where\n\nimport Data.List (intersperse)\nimport Text.DocLayout ( Doc, braces, empty, text, vcat, ($$))\nimport Data.Text (Text)\n\nnotesToLaTeX :: [Doc Text] -> Doc Text\nnotesToLaTeX = \\case\n  [] -> empty\n  ns -> (case length ns of\n            n | n > 1 -> \"\\\\addtocounter\" <>\n                         braces \"footnote\" <>\n                         braces (text $ show $ 1 - n)\n              | otherwise -> empty)\n        $$\n        vcat (intersperse\n               (\"\\\\addtocounter\" <> braces \"footnote\" <> braces \"1\")\n               $ map (\\x -> \"\\\\footnotetext\" <> braces x)\n               $ reverse ns)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Table.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.LaTeX.Table\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nOutput LaTeX formatted tables.\n-}\nmodule Text.Pandoc.Writers.LaTeX.Table\n  ( tableToLaTeX\n  ) where\nimport Control.Monad.State.Strict ( gets, modify )\nimport Control.Monad (when)\nimport Data.List (intersperse)\nimport qualified Data.List.NonEmpty as NonEmpty\nimport Data.List.NonEmpty (NonEmpty ((:|)))\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.DocLayout\n  ( Doc, braces, cr, empty, hcat, hsep, isEmpty, literal, nest\n  , text, vcat, ($$) )\nimport Text.Pandoc.Shared (splitBy, tshow)\nimport Text.Pandoc.Walk (walk, query)\nimport Data.Monoid (Any(..))\nimport Text.Pandoc.Writers.LaTeX.Caption (getCaption)\nimport Text.Pandoc.Writers.LaTeX.Notes (notesToLaTeX)\nimport Text.Pandoc.Writers.LaTeX.Types\n  ( LW, WriterState (stBeamer, stExternalNotes, stInMinipage, stMultiRow\n                    , stNotes, stTable, stOptions) )\nimport Text.Pandoc.Writers.LaTeX.Util (labelFor)\nimport Text.Printf (printf)\nimport qualified Text.Pandoc.Builder as B\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\nimport Text.Pandoc.Options (CaptionPosition(..), WriterOptions(..))\n\ntableToLaTeX :: PandocMonad m\n             => ([Inline] -> LW m (Doc Text))\n             -> ([Block]  -> LW m (Doc Text))\n             -> Ann.Table\n             -> LW m (Doc Text)\ntableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do\n  opts <- gets stOptions\n  let (Ann.Table (ident, _, _) caption specs thead tbodies tfoot) = tbl\n  CaptionDocs capt captNotes <- captionToLaTeX inlnsToLaTeX caption ident\n  let hasTopCaption = not (isEmpty capt) &&\n                        writerTableCaptionPosition opts == CaptionAbove\n  let hasBottomCaption = not (isEmpty capt) &&\n                          writerTableCaptionPosition opts == CaptionBelow\n  let isSimpleTable =\n        all ((== ColWidthDefault) . snd) specs &&\n        all (all isSimpleCell)\n          (mconcat [ headRows thead\n                   , concatMap bodyRows tbodies\n                   , footRows tfoot\n                   ])\n  let removeNote (Note _) = Span (\"\", [], []) []\n      removeNote x        = x\n  let colCount = ColumnCount $ length specs\n  -- The first head is not repeated on the following pages. If we were to just\n  -- use a single head, without a separate first head, then the caption would be\n  -- repeated on all pages that contain a part of the table. We avoid this by\n  -- making the caption part of the first head. The downside is that we must\n  -- duplicate the header rows for this.\n  head' <- do\n    let mkHead = headToLaTeX blksToLaTeX isSimpleTable colCount\n    case (hasTopCaption, isEmptyHead thead) of\n      (False, True) -> return \"\\\\toprule\\\\noalign{}\"\n      (False, False)  -> mkHead thead\n      (True, True)  -> return (capt <> \"\\\\tabularnewline\"\n                                $$ \"\\\\toprule\\\\noalign{}\"\n                                $$ \"\\\\endfirsthead\")\n      (True, False)   -> do\n        -- avoid duplicate notes in head and firsthead:\n        firsthead <- mkHead thead\n        repeated  <- mkHead (walk removeNote thead)\n        return $ capt <> \"\\\\tabularnewline\"\n                 $$ firsthead\n                 $$ \"\\\\endfirsthead\"\n                 $$ repeated\n  rows' <- mapM (rowToLaTeX blksToLaTeX isSimpleTable colCount BodyCell) $\n                mconcat (map bodyRows tbodies)\n  lastfoot <- mapM (rowToLaTeX blksToLaTeX isSimpleTable colCount BodyCell) $\n                    footRows tfoot\n  let foot' = (if isEmptyFoot tfoot\n                  then mempty\n                  else \"\\\\midrule\\\\noalign{}\" $$ vcat lastfoot)\n              $$ \"\\\\bottomrule\\\\noalign{}\"\n              $$ (if hasBottomCaption\n                     then \"\\\\tabularnewline\" $$ capt\n                     else mempty)\n  modify $ \\s -> s{ stTable = True }\n  notes <- notesToLaTeX <$> gets stNotes\n  beamer <- gets stBeamer\n  let makeUnnumbered x = \"{\\\\def\\\\LTcaptype{none} % do not increment counter\" $$ x $$ \"}\"\n  return\n    $ (if null capt then makeUnnumbered else id)\n    $ \"\\\\begin{longtable}[]\" <>\n          braces (\"@{}\" <> colDescriptors isSimpleTable tbl <> \"@{}\")\n          -- the @{} removes extra space at beginning and end\n    $$ head'\n    $$ \"\\\\endhead\"\n    $$ vcat\n       -- Longtable is not able to detect pagebreaks in Beamer; this\n       -- causes problems with the placement of the footer, so make\n       -- footer and bottom rule part of the body when targeting Beamer.\n       -- See issue #8638.\n       (if beamer\n             then [ vcat rows'\n                  , foot'\n                  ]\n             else [ foot'\n                  , \"\\\\endlastfoot\"\n                  ,  vcat rows'\n                  ])\n    $$ \"\\\\end{longtable}\"\n    $$ captNotes\n    $$ notes\n\nisSimpleCell :: Ann.Cell -> Bool\nisSimpleCell (Ann.Cell _ _ (Cell _attr _align _rowspan _colspan blocks)) =\n  case blocks of\n    [Para _]  -> not (hasLineBreak blocks)\n    [Plain _] -> not (hasLineBreak blocks)\n    []        -> True\n    _         -> False\n  where\n    hasLineBreak = getAny . query isLineBreak\n    isLineBreak LineBreak = Any True\n    isLineBreak _         = Any False\n\n-- | Total number of columns in a table.\nnewtype ColumnCount = ColumnCount Int\n\n-- | Creates column descriptors for the table.\ncolDescriptors :: Bool -> Ann.Table -> Doc Text\ncolDescriptors isSimpleTable\n               (Ann.Table _attr _caption specs _thead _tbodies _tfoot) =\n  let (aligns, widths) = unzip specs\n\n      defaultWidthsOnly = all (== ColWidthDefault) widths\n\n      relativeWidths = if defaultWidthsOnly\n                       then replicate (length specs)\n                            (1 / fromIntegral (length specs))\n                       else map toRelWidth widths\n  in if null aligns\n        then \"l\"  -- #9350, table needs at least one column spec\n        else if defaultWidthsOnly && isSimpleTable\n                then hcat $ map (literal . colAlign) aligns\n                else (cr <>) . nest 2 . vcat . map literal $\n                     zipWith (toColDescriptor (length specs))\n                             aligns\n                             relativeWidths\n  where\n    toColDescriptor :: Int -> Alignment -> Double -> Text\n    toColDescriptor numcols align width =\n      T.pack $ printf\n      \">{%s\\\\arraybackslash}p{(\\\\linewidth - %d\\\\tabcolsep) * \\\\real{%0.4f}}\"\n      (T.unpack (alignCommand align))\n      ((numcols - 1) * 2)\n      width\n\n    toRelWidth ColWidthDefault = 0\n    toRelWidth (ColWidth w)    = w\n\nalignCommand :: Alignment -> Text\nalignCommand = \\case\n  AlignLeft    -> \"\\\\raggedright\"\n  AlignRight   -> \"\\\\raggedleft\"\n  AlignCenter  -> \"\\\\centering\"\n  AlignDefault -> \"\\\\raggedright\"\n\ncolAlign :: Alignment -> Text\ncolAlign = \\case\n  AlignLeft    -> \"l\"\n  AlignRight   -> \"r\"\n  AlignCenter  -> \"c\"\n  AlignDefault -> \"l\"\n\ndata CaptionDocs =\n  CaptionDocs\n  { captionCommand :: Doc Text\n  , captionNotes :: Doc Text\n  }\n\ncaptionToLaTeX :: PandocMonad m\n               => ([Inline] -> LW m (Doc Text))\n               -> Caption\n               -> Text     -- ^ table identifier (label)\n               -> LW m CaptionDocs\ncaptionToLaTeX inlnsToLaTeX caption ident = do\n  (captionText, captForLot, captNotes) <- getCaption inlnsToLaTeX False caption\n  label <- labelFor ident\n  return $ CaptionDocs\n    { captionNotes = captNotes\n    , captionCommand = if isEmpty captionText && isEmpty label\n                       then empty\n                       else \"\\\\caption\" <> captForLot <>\n                            braces captionText\n                            <> label\n    }\n\ntype BlocksWriter m = [Block] -> LW m (Doc Text)\n\nheadToLaTeX :: PandocMonad m\n            => BlocksWriter m\n            -> Bool\n            -> ColumnCount\n            -> Ann.TableHead\n            -> LW m (Doc Text)\nheadToLaTeX blocksWriter isSimpleTable\n            colCount (Ann.TableHead _attr headerRows) = do\n  rowsContents <-\n    mapM (rowToLaTeX blocksWriter isSimpleTable\n           colCount HeaderCell . headerRowCells)\n         headerRows\n  return (\"\\\\toprule\\\\noalign{}\" $$ vcat rowsContents $$ \"\\\\midrule\\\\noalign{}\")\n\n-- | Converts a row of table cells into a LaTeX row.\nrowToLaTeX :: PandocMonad m\n           => BlocksWriter m\n           -> Bool\n           -> ColumnCount\n           -> CellType\n           -> [Ann.Cell]\n           -> LW m (Doc Text)\nrowToLaTeX blocksWriter isSimpleTable colCount celltype row = do\n  cellsDocs <- mapM (cellToLaTeX blocksWriter isSimpleTable\n                      colCount celltype) (fillRow row)\n  return $ hsep (intersperse \"&\" cellsDocs) <> \" \\\\\\\\\"\n\n-- | Pads row with empty cells to adjust for rowspans above this row.\nfillRow :: [Ann.Cell] -> [Ann.Cell]\nfillRow = go 0\n  where\n    go _ [] = []\n    go n (acell@(Ann.Cell _spec (Ann.ColNumber colnum) cell):cells) =\n      let (Cell _ _ _ (ColSpan colspan) _) = cell\n      in map mkEmptyCell [n .. colnum - 1] ++\n         acell : go (colnum + colspan) cells\n\n    mkEmptyCell :: Int -> Ann.Cell\n    mkEmptyCell colnum =\n      Ann.Cell ((AlignDefault, ColWidthDefault):|[])\n               (Ann.ColNumber colnum)\n               B.emptyCell\n\nisEmptyHead :: Ann.TableHead -> Bool\nisEmptyHead (Ann.TableHead _attr []) = True\nisEmptyHead (Ann.TableHead _attr rows) = all (null . headerRowCells) rows\n\nisEmptyFoot :: Ann.TableFoot -> Bool\nisEmptyFoot (Ann.TableFoot _attr []) = True\nisEmptyFoot (Ann.TableFoot _attr rows) = all (null . headerRowCells) rows\n\n-- | Gets all cells in a header row.\nheaderRowCells :: Ann.HeaderRow -> [Ann.Cell]\nheaderRowCells (Ann.HeaderRow _attr _rownum cells) = cells\n\n-- | Gets all cells in a body row.\nbodyRowCells :: Ann.BodyRow -> [Ann.Cell]\nbodyRowCells (Ann.BodyRow _attr _rownum rowhead cells) = rowhead <> cells\n\n-- | Gets a list of rows of the table body, where a row is a simple\n-- list of cells.\nbodyRows :: Ann.TableBody -> [[Ann.Cell]]\nbodyRows (Ann.TableBody _attr _rowheads headerRows rows) =\n  map headerRowCells headerRows <> map bodyRowCells rows\n\n-- | Gets a list of rows of the table head, where a row is a simple\n-- list of cells.\nheadRows :: Ann.TableHead -> [[Ann.Cell]]\nheadRows (Ann.TableHead _attr rows) = map headerRowCells rows\n\n-- | Gets a list of rows from the foot, where a row is a simple list\n-- of cells.\nfootRows :: Ann.TableFoot -> [[Ann.Cell]]\nfootRows (Ann.TableFoot _attr rows) = map headerRowCells rows\n\n-- For simple latex tables (without minipages or parboxes),\n-- we need to go to some lengths to get line breaks working:\n-- as LineBreak bs = \\vtop{\\hbox{\\strut as}\\hbox{\\strut bs}}.\nfixLineBreaks :: Block -> Block\nfixLineBreaks = walk fixLineBreaks'\n\nfixLineBreaks' :: [Inline] -> [Inline]\nfixLineBreaks' ils = case splitBy (== LineBreak) ils of\n                       []     -> []\n                       [xs]   -> xs\n                       chunks -> RawInline \"tex\" \"\\\\vtop{\" :\n                                 concatMap tohbox chunks <>\n                                 [RawInline \"tex\" \"}\"]\n  where tohbox ys = RawInline \"tex\" \"\\\\hbox{\\\\strut \" : ys <>\n                    [RawInline \"tex\" \"}\"]\n\n-- We also change display math to inline math, since display\n-- math breaks in simple tables.\ndisplayMathToInline :: Inline -> Inline\ndisplayMathToInline (Math DisplayMath x) = Math InlineMath x\ndisplayMathToInline x                    = x\n\ncellToLaTeX :: PandocMonad m\n            => BlocksWriter m\n            -> Bool\n            -> ColumnCount\n            -> CellType\n            -> Ann.Cell\n            -> LW m (Doc Text)\ncellToLaTeX blockListToLaTeX isSimpleTable colCount celltype annotatedCell = do\n  let (Ann.Cell specs colnum cell) = annotatedCell\n  let colWidths = NonEmpty.map snd specs\n  let hasWidths = NonEmpty.head colWidths /= ColWidthDefault\n  let specAlign = fst (NonEmpty.head specs)\n  let (Cell _attr align' rowspan colspan blocks) = cell\n  let align = case align' of\n                AlignDefault -> specAlign\n                _            -> align'\n  beamer <- gets stBeamer\n  externalNotes <- gets stExternalNotes\n  -- See #5367 -- footnotehyper/footnote don't work in beamer,\n  -- so we need to produce the notes outside the table...\n  modify $ \\st -> st{ stExternalNotes = beamer }\n  let isPlainOrPara = \\case\n        Para{}  -> True\n        Plain{} -> True\n        _       -> False\n  let hasLineBreak LineBreak = Any True\n      hasLineBreak _ = Any False\n  let hasLineBreaks = getAny $ query hasLineBreak blocks\n  result <-\n    if not hasWidths || (celltype /= HeaderCell\n                           && all isPlainOrPara blocks\n                           && not hasLineBreaks)\n       then\n         blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks\n       else do\n         cellContents <- inMinipage $ blockListToLaTeX blocks\n         let valign = text $ case celltype of\n                               HeaderCell -> \"[b]\"\n                               BodyCell   -> \"[t]\"\n         let halign = literal $ alignCommand align\n         return $ \"\\\\begin{minipage}\" <> valign <>\n                  braces \"\\\\linewidth\" <> halign <> cr <>\n                  cellContents <>\n                  (if hasLineBreaks then \"\\\\strut\" else mempty)\n                  <> cr <>\n                  \"\\\\end{minipage}\"\n  modify $ \\st -> st{ stExternalNotes = externalNotes }\n  when (rowspan /= RowSpan 1) $\n    modify (\\st -> st{ stMultiRow = True })\n  let inMultiColumn x = case colspan of\n                          (ColSpan 1) -> x\n                          (ColSpan n) ->\n                            let colDescr = multicolumnDescriptor isSimpleTable\n                                                                 align\n                                                                 colWidths\n                                                                 colCount\n                                                                 colnum\n                            in \"\\\\multicolumn\"\n                               <> braces (literal (tshow n))\n                               <> braces (literal colDescr)\n                               <> braces (\"%\\n\" <> x)\n                                  -- linebreak for readability\n  let hasColWidths = not (all (== ColWidthDefault) colWidths)\n  let aligncmd = case specAlign of\n                   AlignCenter -> \"\\\\centering\\\\arraybackslash \"\n                   AlignRight -> \"\\\\raggedright\\\\arraybackslash \"\n                   _ -> mempty\n  let inMultiRow x = case rowspan of\n                       (RowSpan 1) -> x\n                       (RowSpan n) -> let nrows = literal (tshow n)\n                                      in \"\\\\multirow\" <> braces nrows\n                                         <> braces -- width of column\n                                             (if hasColWidths\n                                                 then \"=\" -- max width\n                                                 else \"*\") -- natural width\n                                         <> braces (aligncmd <> x)\n  return . inMultiColumn . inMultiRow $ result\n\n-- | Returns the width of a cell spanning @n@ columns.\nmulticolumnDescriptor :: Bool\n                      -> Alignment\n                      -> NonEmpty ColWidth\n                      -> ColumnCount\n                      -> Ann.ColNumber\n                      -> Text\nmulticolumnDescriptor isSimpleTable\n  align\n  colWidths\n  (ColumnCount numcols)\n  (Ann.ColNumber colnum) =\n  let toWidth = \\case\n        ColWidthDefault -> (1 / fromIntegral numcols)\n        ColWidth x      -> x\n      colspan = length colWidths\n      width = sum $ NonEmpty.map toWidth colWidths\n\n      -- no column separators at beginning of first and end of last column.\n      skipColSep = \"@{}\" :: String\n  in T.pack $\n     if isSimpleTable\n        then printf \"%s%s%s\"\n              (if colnum == 0 then skipColSep else \"\")\n              (T.unpack (colAlign align))\n              (if colnum + colspan >= numcols then skipColSep else \"\")\n\n        else printf \"%s>{%s\\\\arraybackslash}p{(\\\\linewidth - %d\\\\tabcolsep) * \\\\real{%0.4f} + %d\\\\tabcolsep}%s\"\n              (if colnum == 0 then skipColSep else \"\")\n              (T.unpack (alignCommand align))\n              (2 * (numcols - 1))\n              width\n              (2 * (colspan - 1))\n              (if colnum + colspan >= numcols then skipColSep else \"\")\n\n-- | Perform a conversion, assuming that the context is a minipage.\ninMinipage :: Monad m => LW m a -> LW m a\ninMinipage action = do\n  isInMinipage <- gets stInMinipage\n  modify $ \\st -> st{ stInMinipage = True }\n  result <- action\n  modify $ \\st -> st{ stInMinipage = isInMinipage }\n  return result\n\ndata CellType\n  = HeaderCell\n  | BodyCell\n  deriving Eq\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Types.hs",
    "content": "module Text.Pandoc.Writers.LaTeX.Types\n  ( LW\n  , WriterState (..)\n  , startingState\n  , PdfStandard (..)\n  ) where\n\nimport Control.Monad.State.Strict (StateT)\nimport Data.Text (Text)\nimport Text.DocLayout (Doc)\nimport Text.Pandoc.Options\n  ( WriterOptions (writerIncremental, writerTopLevelDivision)\n  , TopLevelDivision (..)\n  )\nimport Citeproc.Types (Lang)\n\n-- | LaTeX writer type. The type constructor @m@ will typically be an\n-- instance of PandocMonad.\ntype LW m = StateT WriterState m\n\ndata WriterState =\n  WriterState\n  { stInNote        :: Bool          -- ^ true if we're in a note\n  , stInQuote       :: Bool          -- ^ true if in a blockquote\n  , stExternalNotes :: Bool          -- ^ true if in context where\n                                     --   we need to store footnotes\n  , stInMinipage    :: Bool          -- ^ true if in minipage\n  , stInHeading     :: Bool          -- ^ true if in a section heading\n  , stInItem        :: Bool          -- ^ true if in \\item[..]\n  , stInFigure      :: Bool          -- ^ true if in figure environment\n  , stInCite        :: Bool          -- ^ true if in a Cite\n  , stNotes         :: [Doc Text]    -- ^ notes in a minipage\n  , stOLLevel       :: Int           -- ^ level of ordered list nesting\n  , stOptions       :: WriterOptions -- ^ writer options, so they don't have to\n                                     --   be parameter\n  , stVerbInNote    :: Bool          -- ^ true if document has verbatim text in note\n  , stTable         :: Bool          -- ^ true if document has a table\n  , stSubfigure     :: Bool          -- ^ true if document has subfigures\n  , stMultiRow      :: Bool          -- ^ true if document has multirow cells\n  , stStrikeout     :: Bool          -- ^ true if document has strikeout\n  , stUrl           :: Bool          -- ^ true if document has visible URL link\n  , stGraphics      :: Bool          -- ^ true if document contains images\n  , stSVG           :: Bool          -- ^ true if document contains SVGs\n  , stLHS           :: Bool          -- ^ true if document has literate haskell code\n  , stHasChapters   :: Bool          -- ^ true if document has chapters\n  , stCsquotes      :: Bool          -- ^ true if document uses csquotes\n  , stHighlighting  :: Bool          -- ^ true if document has highlighted code\n  , stIncremental   :: Bool          -- ^ true if beamer lists should be\n  , stZwnj          :: Bool          -- ^ true if document has a ZWNJ character\n  , stInternalLinks :: [Text]        -- ^ list of internal link targets\n  , stBeamer        :: Bool          -- ^ produce beamer\n  , stEmptyLine     :: Bool          -- ^ true if no content on line\n  , stHasCslRefs    :: Bool          -- ^ has a Div with class refs\n  , stIsFirstInDefinition :: Bool    -- ^ first block in a defn list\n  , stLang          :: Maybe Lang    -- ^ lang specified in metadata\n  , stInSoulCommand :: Bool          -- ^ in a soul command like ul\n  , stCancel        :: Bool          -- ^ true if document uses \\cancel\n  , stInCaption     :: Bool          -- ^ true if in a caption\n  }\n\n-- | PDF standard settings for DocumentMetadata\ndata PdfStandard = PdfStandard\n  { pdfStandards :: [Text]     -- ^ list of standards (e.g., [\"a-2b\", \"ua-1\"])\n  , pdfVersion   :: Maybe Text -- ^ PDF version (e.g., \"1.7\", \"2.0\")\n  , pdfTagging   :: Bool       -- ^ whether tagging is required\n  }\n\nstartingState :: WriterOptions -> WriterState\nstartingState options =\n  WriterState\n  { stInNote = False\n  , stInQuote = False\n  , stExternalNotes = False\n  , stInHeading = False\n  , stInMinipage = False\n  , stInItem = False\n  , stInFigure = False\n  , stInCite = False\n  , stNotes = []\n  , stOLLevel = 1\n  , stOptions = options\n  , stVerbInNote = False\n  , stTable = False\n  , stSubfigure = False\n  , stMultiRow = False\n  , stStrikeout = False\n  , stUrl = False\n  , stGraphics = False\n  , stSVG = False\n  , stLHS = False\n  , stHasChapters = case writerTopLevelDivision options of\n                      TopLevelPart    -> True\n                      TopLevelChapter -> True\n                      _               -> False\n  , stCsquotes = False\n  , stHighlighting = False\n  , stIncremental = writerIncremental options\n  , stZwnj = False\n  , stInternalLinks = []\n  , stBeamer = False\n  , stEmptyLine = True\n  , stHasCslRefs = False\n  , stIsFirstInDefinition = False\n  , stLang = Nothing\n  , stInSoulCommand = False\n  , stCancel = False\n  , stInCaption = False\n  }\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX/Util.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Writers.LaTeX.Util\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.Writers.LaTeX.Util (\n    stringToLaTeX\n  , StringContext(..)\n  , toLabel\n  , inCmd\n  , wrapDiv\n  , hypertarget\n  , labelFor\n  , getListingsLanguage\n  , mbBraced\n  )\nwhere\n\nimport Control.Applicative ((<|>))\nimport Control.Monad (when)\nimport Text.Pandoc.Class (PandocMonad, toLang)\nimport Text.Pandoc.Options (WriterOptions(..), isEnabled)\nimport Text.Pandoc.Writers.LaTeX.Types (LW, WriterState(..))\nimport Text.Pandoc.Writers.LaTeX.Lang (toBabel)\nimport Text.Pandoc.Highlighting (toListingsLanguage)\nimport Text.DocLayout\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize (showFl)\nimport Control.Monad.State.Strict (gets, modify)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Extensions (Extension(Ext_smart))\nimport Data.Char (isLetter, isSpace, isDigit, isAscii, ord, isAlphaNum)\nimport Text.Printf (printf)\nimport Text.Pandoc.Shared (safeRead)\nimport qualified Data.Text.Normalize as Normalize\nimport Data.List (uncons)\n\ndata StringContext = TextString\n                   | URLString\n                   | CodeString\n                   deriving (Eq)\n\n-- escape things as needed for LaTeX\nstringToLaTeX :: PandocMonad m => StringContext -> Text -> LW m Text\nstringToLaTeX context zs = do\n  opts <- gets stOptions\n  when (T.any (== '\\x200c') zs) $\n    modify (\\s -> s { stZwnj = True })\n  return $ T.pack $\n    foldr (go opts context) mempty $ T.unpack $\n    if writerPreferAscii opts\n       then Normalize.normalize Normalize.NFD zs\n       else zs\n where\n  go :: WriterOptions -> StringContext -> Char -> String -> String\n  go opts ctx x xs   =\n    let ligatures = isEnabled Ext_smart opts && ctx == TextString\n        isUrl = ctx == URLString\n        mbAccentCmd =\n          if writerPreferAscii opts && ctx == TextString\n             then uncons xs >>= \\(c,_) -> lookupAccent c\n             else Nothing\n        emits s =\n          case mbAccentCmd of\n               Just cmd ->\n                 cmd <> \"{\" <> s <> \"}\" <> drop 1 xs -- drop combining accent\n               Nothing  -> s <> xs\n        emitc c =\n          case mbAccentCmd of\n               Just cmd ->\n                 cmd <> \"{\" <> [c] <> \"}\" <> drop 1 xs -- drop combining accent\n               Nothing  -> c : xs\n        emitcseq cs =\n          case xs of\n            c:_ | isLetter c\n                , ctx == TextString\n                             -> cs <> \" \" <> xs\n                | isSpace c  -> cs <> \"{}\" <> xs\n                | ctx == TextString\n                             -> cs <> xs\n            _ -> cs <> \"{}\" <> xs\n        emitquote cs =\n          case xs of\n            '`':_  -> cs <> \"\\\\,\" <> xs -- add thin space\n            '\\'':_ -> cs <> \"\\\\,\" <> xs -- add thin space\n            _      -> cs <> xs\n    in case x of\n         _ | isUrl ->\n           case x of\n             '\\\\' -> emitc '/' -- NB / works as path sep even on Windows\n             '#' -> emits \"\\\\#\" -- #9014\n             '%' -> emits \"\\\\%\" -- #9014\n             '{' -> emits \"\\\\%7B\"\n             '}' -> emits \"\\\\%7D\"\n             '|' -> emits \"\\\\%7C\"\n             '^' -> emits \"\\\\%5E\"\n             '[' -> emits \"\\\\%5B\"\n             ']' -> emits \"\\\\%5D\"\n             '`' -> emits \"\\\\%60\"\n             _ -> emitc x\n         '{' -> emits \"\\\\{\"\n         '}' -> emits \"\\\\}\"\n         '?' | ligatures ->  -- avoid ?` ligature\n           case xs of\n             '`':_ -> emits \"?{\\\\kern0pt}\" -- se #10610\n             _     -> emitc x\n         '!' | ligatures ->  -- avoid !` ligature\n           case xs of\n             '`':_ -> emits \"!{\\\\kern0pt}\"\n             _     -> emitc x\n         '`' | ctx == CodeString -> emitcseq \"\\\\textasciigrave\"\n         '$' -> emits \"\\\\$\"\n         '%' -> emits \"\\\\%\"\n         '&' -> emits \"\\\\&\"\n         '_' -> emits \"\\\\_\"\n         '#' -> emits \"\\\\#\"\n         '-' -> case xs of\n                     -- prevent adjacent hyphens from forming ligatures\n                     ('-':_) -> emits \"-\\\\/\"\n                     _       -> emitc '-'\n         '~' -> emitcseq \"\\\\textasciitilde\"\n         '^' -> emits \"\\\\^{}\"\n         '\\\\' -> emitcseq \"\\\\textbackslash\"\n         '|'  -> emitcseq \"\\\\textbar\"\n         '<'  -> emitcseq \"\\\\textless\"\n         '>'  -> emitcseq \"\\\\textgreater\"\n         '['  -> emits \"{[}\"  -- to avoid interpretation as\n         ']'  -> emits \"{]}\"  -- optional arguments\n         '\\'' -> emitcseq \"\\\\textquotesingle\"\n         '\\160' -> emits \"~\"\n         '\\x00AD' -> emits \"\\\\-\"  -- shy hyphen\n         '\\x200B' -> emits \"\\\\hspace{0pt}\"  -- zero-width space\n         '\\x202F' -> emits \"\\\\,\"\n         '\\x2026' | ligatures -> emitcseq \"\\\\ldots\"\n         '\\x2018' | ligatures -> emitquote \"`\"\n         '\\x2019' | ligatures -> emitquote \"'\"\n         '\\x201C' | ligatures -> emitquote \"``\"\n         '\\x201D' | ligatures -> emitquote \"''\"\n         '\\x2014' | ligatures -> emits \"---\"\n         '\\x2013' | ligatures -> emits \"--\"\n         _ | writerPreferAscii opts\n             -> case x of\n                  'ı' -> emitcseq \"\\\\i\"\n                  'ȷ' -> emitcseq \"\\\\j\"\n                  'å' -> emitcseq \"\\\\aa\"\n                  'Å' -> emitcseq \"\\\\AA\"\n                  'ß' -> emitcseq \"\\\\ss\"\n                  'ø' -> emitcseq \"\\\\o\"\n                  'Ø' -> emitcseq \"\\\\O\"\n                  'Ł' -> emitcseq \"\\\\L\"\n                  'ł' -> emitcseq \"\\\\l\"\n                  'æ' -> emitcseq \"\\\\ae\"\n                  'Æ' -> emitcseq \"\\\\AE\"\n                  'œ' -> emitcseq \"\\\\oe\"\n                  'Œ' -> emitcseq \"\\\\OE\"\n                  '£' -> emitcseq \"\\\\pounds\"\n                  '€' -> emitcseq \"\\\\euro\"\n                  '©' -> emitcseq \"\\\\copyright\"\n                  _   -> emitc x\n           | otherwise -> emitc x\n\nlookupAccent :: Char -> Maybe String\nlookupAccent '\\779'  = Just \"\\\\H\"\nlookupAccent '\\768'  = Just \"\\\\`\"\nlookupAccent '\\769'  = Just \"\\\\'\"\nlookupAccent '\\770'  = Just \"\\\\^\"\nlookupAccent '\\771'  = Just \"\\\\~\"\nlookupAccent '\\776'  = Just \"\\\\\\\"\"\nlookupAccent '\\775'  = Just \"\\\\.\"\nlookupAccent '\\772'  = Just \"\\\\=\"\nlookupAccent '\\781'  = Just \"\\\\|\"\nlookupAccent '\\817'  = Just \"\\\\b\"\nlookupAccent '\\807'  = Just \"\\\\c\"\nlookupAccent '\\783'  = Just \"\\\\G\"\nlookupAccent '\\777'  = Just \"\\\\h\"\nlookupAccent '\\803'  = Just \"\\\\d\"\nlookupAccent '\\785'  = Just \"\\\\f\"\nlookupAccent '\\778'  = Just \"\\\\r\"\nlookupAccent '\\865'  = Just \"\\\\t\"\nlookupAccent '\\782'  = Just \"\\\\U\"\nlookupAccent '\\780'  = Just \"\\\\v\"\nlookupAccent '\\774'  = Just \"\\\\u\"\nlookupAccent '\\808'  = Just \"\\\\k\"\nlookupAccent '\\8413' = Just \"\\\\textcircled\"\nlookupAccent _       = Nothing\n\ntoLabel :: PandocMonad m => Text -> LW m Text\ntoLabel z = go `fmap` stringToLaTeX URLString z\n where\n   go = T.concatMap $ \\x -> case x of\n     _ | (isLetter x || isDigit x) && isAscii x -> T.singleton x\n       | T.any (== x) \"_-+=:;.\" -> T.singleton x\n       | otherwise -> T.pack $ \"ux\" <> printf \"%x\" (ord x)\n\n-- | Puts contents into LaTeX command.\ninCmd :: Text -> Doc Text -> Doc Text\ninCmd cmd contents = char '\\\\' <> literal cmd <> braces contents\n\nmapAlignment :: Text -> Text\nmapAlignment a = case a of\n                   \"top\" -> \"T\"\n                   \"top-baseline\" -> \"t\"\n                   \"bottom\" -> \"b\"\n                   \"center\" -> \"c\"\n                   _ -> a\n\nwrapDiv :: PandocMonad m => Attr -> Doc Text -> LW m (Doc Text)\nwrapDiv (_,classes,kvs) t = do\n  beamer <- gets stBeamer\n  let align dir txt = inCmd \"begin\" dir $$ txt $$ inCmd \"end\" dir\n  lang <- toLang $ lookup \"lang\" kvs\n  let wrapColumns = if beamer && \"columns\" `elem` classes\n                    then \\contents ->\n                           let valign = maybe \"T\" mapAlignment (lookup \"align\" kvs)\n                               totalwidth = maybe [] (\\x -> [\"totalwidth=\" <> x])\n                                 (lookup \"totalwidth\" kvs)\n                               onlytextwidth = filter (\"onlytextwidth\" ==) classes\n                               options = text $ T.unpack $ T.intercalate \",\" $\n                                 valign : totalwidth ++ onlytextwidth\n                           in inCmd \"begin\" \"columns\" <> brackets options\n                              $$ contents\n                              $$ inCmd \"end\" \"columns\"\n                    else id\n      wrapColumn  = if beamer && \"column\" `elem` classes\n                    then \\contents ->\n                           let valign =\n                                 maybe \"\"\n                                 (brackets . text . T.unpack . mapAlignment)\n                                 (lookup \"align\" kvs)\n                               w = maybe \"0.48\" fromPct (lookup \"width\" kvs)\n                           in  inCmd \"begin\" \"column\" <>\n                               valign <>\n                               braces (literal w <> \"\\\\linewidth\")\n                               $$ contents\n                               $$ inCmd \"end\" \"column\"\n                    else id\n      fromPct xs =\n        case T.unsnoc xs of\n          Just (ds, '%') -> case safeRead ds of\n                              Just digits -> showFl (digits / 100 :: Double)\n                              Nothing -> xs\n          _              -> xs\n      wrapDir = case lookup \"dir\" kvs of\n                  Just \"rtl\" -> align \"RTL\"\n                  Just \"ltr\" -> align \"LTR\"\n                  _          -> id\n      wrapLang txt = case lang >>= toBabel of\n                       Just l -> inCmd \"begin\" \"otherlanguage\"\n                                            <> (braces (literal l))\n                                       $$ blankline <> txt <> blankline\n                                       $$ inCmd \"end\" \"otherlanguage\"\n                       Nothing  -> txt\n  return $ wrapColumns . wrapColumn . wrapDir . wrapLang $ t\n\nhypertarget :: PandocMonad m => Text -> LW m (Doc Text)\nhypertarget \"\" = return mempty\nhypertarget ident = do\n  inHeading <- gets stInHeading\n  if inHeading\n     then do -- see #9209 (these cases should be rare)\n      ref <- literal <$> toLabel ident\n      return $ text \"\\\\protect\\\\hypertarget\" <> braces ref <> \"{}\"\n     else do\n      label <- labelFor ident\n      return $ text \"\\\\protect\\\\phantomsection\" <> label\n\nlabelFor :: PandocMonad m => Text -> LW m (Doc Text)\nlabelFor \"\"    = return empty\nlabelFor ident = do\n  ref <- literal `fmap` toLabel ident\n  return $ text \"\\\\label\" <> braces ref\n\n-- Determine listings language from list of class attributes.\ngetListingsLanguage :: [Text] -> Maybe Text\ngetListingsLanguage xs\n  = foldr ((<|>) . toListingsLanguage) Nothing xs\n\nmbBraced :: Text -> Text\nmbBraced x = if not (T.all isAlphaNum x)\n                then \"{\" <> x <> \"}\"\n                else x\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/LaTeX.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE TupleSections       #-}\n{-# LANGUAGE PatternGuards       #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeApplications    #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Writers.LaTeX\n   Copyright   : Copyright (C) 2006-2025 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' format into LaTeX.\n-}\nmodule Text.Pandoc.Writers.LaTeX (\n    writeLaTeX\n  , writeBeamer\n  ) where\nimport Control.Monad.State.Strict\n    ( MonadState(get, put),\n      gets,\n      modify,\n      evalStateT )\nimport Control.Monad\n    ( MonadPlus(mplus),\n      liftM,\n      when,\n      unless )\nimport Crypto.Hash (hashWith, MD5(MD5))\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Char (isDigit, isAscii, isLetter)\nimport Data.List (intersperse, partition, (\\\\))\nimport qualified Data.Set as Set\nimport Data.Maybe (catMaybes, fromMaybe, isJust, listToMaybe, mapMaybe, isNothing)\nimport Data.Monoid (Any (..))\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Network.URI (unEscapeString)\nimport Text.DocTemplates (Context(..), FromContext(lookupContext), Val(..), renderTemplate)\nimport qualified Data.Map as M\nimport Text.Collate.Lang (renderLang)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, getPOSIXTime, lookupEnv,\n                                      report, toLang)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (formatLaTeXBlock, formatLaTeXInline, highlight,\n                                 defaultStyle, styleToLaTeX)\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Slides\nimport Text.Pandoc.Walk (query, walk, walkM)\nimport Text.Pandoc.Writers.LaTeX.Caption (getCaption)\nimport Text.Pandoc.Writers.LaTeX.Table (tableToLaTeX)\nimport Text.Pandoc.Writers.LaTeX.Citation (citationsToNatbib,\n                                           citationsToBiblatex)\nimport Text.Pandoc.Writers.LaTeX.Types (LW, WriterState (..), startingState,\n                                        PdfStandard (..))\nimport Text.Pandoc.Writers.LaTeX.Lang (toBabel)\nimport Text.Pandoc.Writers.LaTeX.Util (stringToLaTeX, StringContext(..),\n                                       toLabel, inCmd,\n                                       wrapDiv, hypertarget, labelFor,\n                                       getListingsLanguage, mbBraced)\nimport Text.Pandoc.Writers.Shared\nimport qualified Data.Attoparsec.Text as A\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\nimport Control.Applicative ((<|>))\n\n-- Work around problems with notes inside emphasis (see #8982)\nisolateBigNotes :: ([Inline] -> Inline) -> [Inline] -> [Inline]\nisolateBigNotes constructor xs =\n  let (before, after) = break isBigNote xs\n  in case after of\n       (noteInline:rest) -> constructor before :\n                            noteInline :\n                            isolateBigNotes constructor rest\n       [] -> [constructor xs]\n\nisBigNote :: Inline -> Bool\nisBigNote (Note [Plain _]) = False  -- A small note\nisBigNote (Note [Para _]) =  False  -- A small note\nisBigNote (Note _) = True  -- A big note\nisBigNote _ = False  -- Not a note\n\nraiseBigNotes :: [Inline] -> [Inline]\nraiseBigNotes (Emph inner : xs)\n  = isolateBigNotes Emph (raiseBigNotes inner) ++ raiseBigNotes xs\nraiseBigNotes (Strong inner : xs)\n  = isolateBigNotes Strong (raiseBigNotes inner) ++ raiseBigNotes xs\nraiseBigNotes (Underline inner : xs)\n  = isolateBigNotes Underline (raiseBigNotes inner) ++ raiseBigNotes xs\nraiseBigNotes (Strikeout inner : xs)\n  = isolateBigNotes Strikeout (raiseBigNotes inner) ++ raiseBigNotes xs\nraiseBigNotes (x : xs)          = x : raiseBigNotes xs\nraiseBigNotes [] = []\n\n-- | Convert Pandoc to LaTeX.\nwriteLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteLaTeX options document = do\n  let Any hasBigNotes =\n       query (\\il -> if isBigNote il then Any True else Any False) document\n  let document' = if hasBigNotes\n                     then walk raiseBigNotes document\n                     else document\n  evalStateT (pandocToLaTeX options document') $ startingState options\n\n-- | Convert Pandoc to LaTeX Beamer.\nwriteBeamer :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteBeamer options document =\n  evalStateT (pandocToLaTeX options document) $\n    (startingState options){ stBeamer = True }\n\npandocToLaTeX :: PandocMonad m\n              => WriterOptions -> Pandoc -> LW m Text\npandocToLaTeX options (Pandoc meta blocks) = do\n  -- Strip off 'references' header if --natbib or --biblatex\n  let method = writerCiteMethod options\n  let isRefsDiv (Div (\"refs\",_,_) _) = True\n      isRefsDiv _ = False\n  let blocks' = if method == Biblatex || method == Natbib\n                   then filter (not . isRefsDiv) blocks\n                   else blocks\n  -- see if there are internal links\n  let isInternalLink (Link _ _ (s,_))\n        | Just ('#', xs) <- T.uncons s = [xs]\n      isInternalLink _                 = []\n  modify $ \\s -> s{ stInternalLinks = query isInternalLink blocks' }\n  let colwidth = if writerWrapText options == WrapAuto\n                    then Just $ writerColumns options\n                    else Nothing\n  docLangs <- catMaybes <$>\n      mapM (toLang . Just) (nubOrd (query (extract \"lang\") blocks))\n  mblang <- toLang $ case getLang options meta of\n                          Just l -> Just l\n                          Nothing | null docLangs -> Nothing\n                                  | otherwise     -> Just \"en\"\n  modify $ \\s -> s{ stLang = mblang }\n  metadata <- metaToContext options\n              blockListToLaTeX\n              (fmap chomp . inlineListToLaTeX)\n              meta\n  let chaptersClasses = [\"memoir\",\"book\",\"report\",\"scrreprt\",\"scrreport\",\n                        \"scrbook\",\"extreport\",\"extbook\",\"tufte-book\",\n                        \"ctexrep\",\"ctexbook\",\"elegantbook\"]\n  let frontmatterClasses = [\"memoir\",\"book\",\"scrbook\",\"extbook\",\"tufte-book\",\n                           \"ctexbook\",\"elegantbook\"]\n  -- these have \\frontmatter etc.\n  beamer <- gets stBeamer\n  let documentClass =\n        case lookupContext \"documentclass\" (writerVariables options) `mplus`\n              (stringify <$> lookupMeta \"documentclass\" meta) of\n                 Just x -> x\n                 Nothing | beamer    -> \"beamer\"\n                         | otherwise -> case writerTopLevelDivision options of\n                                          TopLevelPart    -> \"book\"\n                                          TopLevelChapter -> \"book\"\n                                          _               -> \"article\"\n  when (documentClass `elem` chaptersClasses) $\n     modify $ \\s -> s{ stHasChapters = True }\n  let csquotes =\n        case lookupContext \"csquotes\" (writerVariables options) of\n          Just (BoolVal v) -> v\n          Just (SimpleVal (Text _ t)) -> t /= (\"false\" :: Text)\n          _ -> case stringify <$> lookupMeta \"csquotes\" meta of\n                  Nothing -> False\n                  Just \"false\" -> False\n                  Just _ -> True\n  when csquotes $ modify $ \\s -> s{stCsquotes = True}\n  let (blocks'', lastHeader) = if writerCiteMethod options == Citeproc then\n                                 (blocks', [])\n                               else case reverse blocks' of\n                                 Header 1 _ il : _ -> (init blocks', il)\n                                 _                 -> (blocks', [])\n  blocks''' <- if beamer\n                  then toSlides blocks''\n                  else return $ makeSections False Nothing blocks''\n  main <- blockListToLaTeX blocks'''\n  biblioTitle <- inlineListToLaTeX lastHeader\n  st <- get\n  titleMeta <- escapeCommas <$> -- see #10501\n                stringToLaTeX TextString (stringify $ docTitle meta)\n  subtitleMeta <- stringToLaTeX TextString (stringify $ lookupMetaInlines \"subtitle\" meta)\n  authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta\n  -- The trailer ID is as hash used to identify the PDF. Taking control of its\n  -- value is important when aiming for reproducible PDF generation. Setting\n  -- `SOURCE_DATE_EPOCH` is the traditional method used to control\n  -- reproducible builds. There are no cryptographic requirements for the ID,\n  -- so the 128bits (16 bytes) of MD5 are appropriate.\n  reproduciblePDF <- isJust <$> lookupEnv \"SOURCE_DATE_EPOCH\"\n  trailerID <- do\n    time <- getPOSIXTime\n    let hash = T.pack . show . hashWith MD5 $ mconcat\n               [ UTF8.fromString $ show time\n               , UTF8.fromText $ render Nothing main\n               ]\n    pure $ mconcat [ \"<\", hash, \"> <\", hash, \">\" ]\n  -- we need a default here since lang is used in template conditionals\n  let hasStringValue x = isJust (getField x metadata :: Maybe (Doc Text))\n  let geometryFromMargins = mconcat $ intersperse (\",\" :: Doc Text) $\n                            mapMaybe (\\(x,y) ->\n                                ((x <> \"=\") <>) <$> getField y metadata)\n                              [(\"lmargin\",\"margin-left\")\n                              ,(\"rmargin\",\"margin-right\")\n                              ,(\"tmargin\",\"margin-top\")\n                              ,(\"bmargin\",\"margin-bottom\")\n                              ]\n\n  let dirs = query (extract \"dir\") blocks\n\n  let nociteIds = query (\\case\n                           Cite cs _ -> map citationId cs\n                           _         -> [])\n                    $ lookupMetaInlines \"nocite\" meta\n\n   -- see #7414, avoid escaped underscores\n  let unescapeUnderscore = T.replace \"\\\\_\" \"_\"\n  let bibliography' = map unescapeUnderscore <$>\n                        getField \"bibliography\" metadata\n\n  -- Process PDF standard metadata for DocumentMetadata\n  pdfStd <- processPdfStandard metadata\n\n  let context  =  (case bibliography' of\n                     Nothing -> id\n                     Just xs -> resetField \"bibliography\" xs) $\n                  defField \"toc\" (writerTableOfContents options) $\n                  defField \"lof\" (writerListOfFigures options) $\n                  defField \"lot\" (writerListOfTables options) $\n                  defField \"toc-depth\" (tshow\n                                        (writerTOCDepth options -\n                                              if stHasChapters st\n                                                 then 1\n                                                 else 0)) $\n                  defField \"body\" main $\n                  defField \"title-meta\" titleMeta $\n                  defField \"subtitle-meta\" subtitleMeta $\n                  defField \"author-meta\"\n                        (T.intercalate \"; \" authorsMeta) $\n                  defField \"documentclass\" documentClass $\n                  defField \"verbatim-in-note\" (stVerbInNote st) $\n                  defField \"tables\" (stTable st) $\n                  defField \"multirow\" (stMultiRow st) $\n                  defField \"cancel\" (stCancel st) $\n                  defField \"strikeout\" (stStrikeout st) $\n                  defField \"url\" (stUrl st) $\n                  defField \"numbersections\" (writerNumberSections options) $\n                  defField \"lhs\" (stLHS st) $\n                  defField \"graphics\" (stGraphics st) $\n                  defField \"subfigure\" (stSubfigure st) $\n                  defField \"svg\" (stSVG st) $\n                  defField \"has-chapters\" (stHasChapters st) $\n                  defField \"has-frontmatter\" (documentClass `elem` frontmatterClasses) $\n                  defField \"listings\" (writerHighlightMethod options ==\n                                       IdiomaticHighlighting\n                                       || stLHS st) $\n                  defField \"zero-width-non-joiner\" (stZwnj st) $\n                  defField \"beamer\" beamer $\n                  (if stHighlighting st\n                      then case writerHighlightMethod options of\n                             Skylighting sty ->\n                                   defField \"highlighting-macros\"\n                                      (T.stripEnd $ styleToLaTeX sty)\n                             DefaultHighlighting ->\n                                   defField \"highlighting-macros\"\n                                      (T.stripEnd $ styleToLaTeX defaultStyle)\n                             _ -> id\n                      else id) $\n                  (case writerCiteMethod options of\n                         Natbib   -> defField \"biblio-title\" biblioTitle .\n                                     defField \"natbib\" True .\n                                     defField \"nocite-ids\" nociteIds\n                         Biblatex -> defField \"biblio-title\" biblioTitle .\n                                     defField \"biblatex\" True .\n                                     defField \"nocite-ids\" nociteIds\n                         _        -> id) $\n                  defField \"colorlinks\" (any hasStringValue\n                           [\"citecolor\", \"urlcolor\", \"linkcolor\", \"toccolor\",\n                            \"filecolor\"]) $\n                  (if null dirs\n                     then id\n                     else defField \"dir\" (\"ltr\" :: Text)) $\n                  defField \"section-titles\" True $\n                  defField \"csl-refs\" (stHasCslRefs st) $\n                  defField \"geometry\" geometryFromMargins $\n                  (case T.uncons . render Nothing <$>\n                        getField \"papersize\" metadata of\n                      -- uppercase a4, a5, etc.\n                      Just (Just ('A', ds))\n                        | not (T.null ds) && T.all isDigit ds\n                          -> resetField \"papersize\" (\"a\" <> ds)\n                      _   -> id) .\n                  (if reproduciblePDF\n                    then defField \"pdf-trailer-id\" trailerID\n                    else id) $\n                  (if not (null (pdfStandards pdfStd)) || isJust (pdfVersion pdfStd)\n                    then resetField \"pdfstandard\" $ MapVal $ Context $ M.fromList\n                           [ (\"standards\", ListVal $ map (SimpleVal . literal) (pdfStandards pdfStd))\n                           , (\"version\", maybe NullVal (SimpleVal . literal) (pdfVersion pdfStd))\n                           , (\"tagging\", BoolVal (pdfTagging pdfStd))\n                           ]\n                    else id) $\n                  metadata\n  let babelLang = mblang >>= toBabel\n  let context' =\n          -- note: lang is used in some conditionals in the template,\n          -- so we need to set it if we have any babel/polyglossia:\n          maybe id (\\l -> defField \"lang\"\n                      (literal $ renderLang l)) mblang\n        $ maybe id (\\l -> defField \"babel-lang\"\n                      (literal l)) babelLang\n        $ (case babelLang of -- see #8283\n                Just l | l `notElem` ldfLanguages\n                         -> defField \"babeloptions\" (\"provide=*\" :: Text)\n                _ -> id)\n        $ defField \"babel-otherlangs\"\n             (map literal\n               (filter (`elem` ldfLanguages) .\n                nubOrd . catMaybes .\n                filter (/= babelLang)\n                $ map toBabel docLangs))\n        $ defField \"latex-dir-rtl\"\n           ((render Nothing <$> getField \"dir\" context) ==\n               Just (\"rtl\" :: Text)) context\n  return $ render colwidth $\n    case writerTemplate options of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context'\n\n-- Commas in title-meta need to be put in braces; see #10501\nescapeCommas :: Text -> Text\nescapeCommas = T.replace \",\" \"{,}\"\n\ntoSlides :: PandocMonad m => [Block] -> LW m [Block]\ntoSlides bs = do\n  opts <- gets stOptions\n  let slideLevel = fromMaybe (getSlideLevel bs) $ writerSlideLevel opts\n  let bs' = prepSlides slideLevel bs\n  walkM (elementToBeamer slideLevel) $ makeSections False Nothing bs'\n\n-- this creates section slides and marks slides with class \"slide\",\"block\"\nelementToBeamer :: PandocMonad m => Int -> Block -> LW m Block\nelementToBeamer slideLevel (Div (ident,\"section\":dclasses,dkvs)\n                              xs@(h@(Header lvl _ _) : ys))\n  | lvl >  slideLevel\n    = return $ Div (ident,\"block\":dclasses,dkvs) xs\n  | lvl <  slideLevel\n    = do let isSlide (Div (_,\"slide\":_,_) _)   = True\n             isSlide (Div (_,\"section\":_,_) _) = True\n             isSlide _                         = False\n         let (titleBs, slideBs) = break isSlide ys\n         return $\n           case titleBs of\n              [] -> Div (ident,\"section\":dclasses,dkvs) xs\n              [Div (_,\"notes\":_,_) _] ->  -- see #7857, don't create frame\n                    -- just for speaker notes after section heading\n                    Div (ident,\"section\":dclasses,dkvs) xs\n              _  -> Div (ident,\"section\":dclasses,dkvs)\n                     (h : Div (\"\",\"slide\":dclasses,dkvs) (h:titleBs) : slideBs)\n  | otherwise\n    = return $ Div (ident,\"slide\":dclasses,dkvs) xs\nelementToBeamer _ x = return x\n\nisListBlock :: Block -> Bool\nisListBlock (BulletList _)     = True\nisListBlock (OrderedList _ _)  = True\nisListBlock (DefinitionList _) = True\nisListBlock _                  = False\n\n-- | Convert Pandoc block element to LaTeX.\nblockToLaTeX :: PandocMonad m\n             => Block     -- ^ Block to convert\n             -> LW m (Doc Text)\nblockToLaTeX (Div attr@(identifier,\"block\":dclasses,_)\n             (Header _ _ ils : bs)) = do\n  let blockname\n        | \"example\" `elem` dclasses = \"exampleblock\"\n        | \"alert\" `elem` dclasses = \"alertblock\"\n        | otherwise = \"block\"\n  anchor <- if T.null identifier\n               then pure empty\n               else (cr <>) <$> hypertarget identifier\n  title' <- inlineListToLaTeX ils\n  contents <- blockListToLaTeX bs\n  wrapDiv attr $ (\"\\\\begin\" <> braces blockname <> braces title' <> anchor) $$\n                 contents $$ \"\\\\end\" <> braces blockname\nblockToLaTeX (Div (identifier,\"slide\":dclasses,dkvs)\n               (Header _ (_,hclasses,hkvs) ils : bs)) = do\n  -- note: [fragile] is required or verbatim breaks\n  let hasCodeBlock (CodeBlock _ _) = [True]\n      hasCodeBlock _               = []\n  let hasCode (Code _ _) = [True]\n      hasCode _          = []\n  let classes = nubOrd $ dclasses ++ hclasses\n  let kvs = nubOrd $ dkvs ++ hkvs\n  let fragile = \"fragile\" `elem` classes ||\n                not (null $ query hasCodeBlock bs ++ query hasCode bs)\n  let frameoptions = [\"allowdisplaybreaks\", \"allowframebreaks\", \"fragile\",\n                      \"b\", \"c\", \"t\", \"environment\", \"s\", \"squeeze\",\n                      \"label\", \"plain\", \"shrink\", \"standout\",\n                      \"noframenumbering\", \"containsverbatim\"]\n  let optionslist = [\"fragile\" | fragile\n                               , isNothing (lookup \"fragile\" kvs)\n                               , \"fragile\" `notElem` classes\n                               , \"containsverbatim\" `notElem` classes] ++\n                    [k | k <- classes, k `elem` frameoptions] ++\n                    [k <> \"=\" <> v | (k,v) <- kvs, k `elem` frameoptions] ++\n                    [v | (\"frameoptions\", v) <- kvs]\n  let options = if null optionslist\n                   then empty\n                   else brackets (literal (T.intercalate \",\" optionslist))\n  slideTitle <- if ils == [Str \"\\0\"] -- marker for hrule\n                   then return empty\n                   else braces <$> inlineListToLaTeX ils\n  slideAnchor <- if T.null identifier\n                    then pure empty\n                    else (cr <>) <$> hypertarget identifier\n  contents <- blockListToLaTeX bs >>= wrapDiv (identifier,classes,kvs)\n  return $ (\"\\\\begin{frame}\" <> options <> slideTitle <> slideAnchor) $$\n             contents $$ \"\\\\end{frame}\"\nblockToLaTeX (Div (identifier@(T.uncons -> Just (_,_)),dclasses,dkvs)\n               (Header lvl (\"\",hclasses,hkvs) ils : bs)) =\n  -- move identifier from div to header\n  blockToLaTeX (Div (\"\",dclasses,dkvs)\n               (Header lvl (identifier,hclasses,hkvs) ils : bs))\nblockToLaTeX (Div (identifier,classes,kvs) bs) = do\n  beamer <- gets stBeamer\n  oldIncremental <- gets stIncremental\n  if beamer && \"incremental\" `elem` classes\n     then modify $ \\st -> st{ stIncremental = True }\n     else when (beamer && \"nonincremental\" `elem` classes) $\n             modify $ \\st -> st { stIncremental = False }\n  result <- if (identifier == \"refs\" || -- <- for backwards compatibility\n                \"csl-bib-body\" `elem` classes) &&\n               (not (null bs))\n               then do\n                 modify $ \\st -> st{ stHasCslRefs = True }\n                 inner <- blockListToLaTeX bs\n                 return $ (\"\\\\begin{CSLReferences}\"\n                            <> braces\n                                (if \"hanging-indent\" `elem` classes\n                                    then \"1\"\n                                    else \"0\")\n                            <> braces\n                               (maybe \"1\" literal (lookup \"entry-spacing\" kvs)))\n                          $$ inner\n                          $+$ \"\\\\end{CSLReferences}\"\n               else blockListToLaTeX bs\n  modify $ \\st -> st{ stIncremental = oldIncremental }\n  let wrap txt\n       | beamer && \"notes\" `elem` classes\n         = pure (\"\\\\note\" <> braces txt) -- speaker notes\n       | \"ref-\" `T.isPrefixOf` identifier\n         = do\n             lab <- toLabel identifier\n             pure $ (\"\\\\bibitem\" <> brackets \"\\\\citeproctext\"\n                      <> braces (literal lab)) $$ txt\n         | otherwise = do\n             linkAnchor <- hypertarget identifier\n             pure $ linkAnchor $$ txt\n  wrapDiv (identifier,classes,kvs) result >>= wrap\nblockToLaTeX (Plain lst) =\n  inlineListToLaTeX lst\n-- . . . indicates pause in beamer slides\nblockToLaTeX (Para [Str \".\",Space,Str \".\",Space,Str \".\"]) = do\n  beamer <- gets stBeamer\n  if beamer\n     then blockToLaTeX (RawBlock \"latex\" \"\\\\pause\")\n     else inlineListToLaTeX [Str \".\",Space,Str \".\",Space,Str \".\"]\nblockToLaTeX (Para lst) =\n  if null lst\n     then do\n       opts <- gets stOptions\n       if isEnabled Ext_empty_paragraphs opts\n          then pure \"\\\\hfill\\\\par\"\n          else pure mempty\n     else inlineListToLaTeX lst\nblockToLaTeX (LineBlock lns) =\n  blockToLaTeX $ linesToPara lns\nblockToLaTeX (BlockQuote lst) = do\n  beamer <- gets stBeamer\n  csquotes <- liftM stCsquotes get\n  case lst of\n       [b] | beamer && isListBlock b -> do\n         oldIncremental <- gets stIncremental\n         modify $ \\s -> s{ stIncremental = not oldIncremental }\n         result <- blockToLaTeX b\n         modify $ \\s -> s{ stIncremental = oldIncremental }\n         return result\n       _ -> do\n         oldInQuote <- gets stInQuote\n         modify (\\s -> s{stInQuote = True})\n         contents <- blockListToLaTeX lst\n         modify (\\s -> s{stInQuote = oldInQuote})\n         let envname = if csquotes then \"displayquote\" else \"quote\"\n         return $ (\"\\\\begin\" <> braces envname) $$\n                  contents $$\n                  (\"\\\\end\" <> braces envname)\nblockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do\n  opts <- gets stOptions\n  inNote <- stInNote <$> get\n  linkAnchor <- if T.null identifier\n                   then pure empty\n                   else ((<> cr) . (<> \"%\")) <$> hypertarget identifier\n  let lhsCodeBlock = do\n        modify $ \\s -> s{ stLHS = True }\n        return $ flush (linkAnchor $$ \"\\\\begin{code}\" $$ literal str $$\n                            \"\\\\end{code}\") $$ cr\n  let rawCodeBlock = do\n        env <- if inNote\n                  then modify (\\s -> s{ stVerbInNote = True }) >>\n                       return \"Verbatim\"\n                  else return \"verbatim\"\n        return $ flush (linkAnchor $$ literal (\"\\\\begin{\" <> env <> \"}\") $$\n                 literal str $$ literal (\"\\\\end{\" <> env <> \"}\")) <> cr\n  let listingsCodeBlock = do\n        st <- get\n        ref <- toLabel identifier\n        kvs <- mapM (\\(k,v) -> (k,) <$>\n                       stringToLaTeX TextString v) keyvalAttr\n        let params = if writerHighlightMethod (stOptions st)\n                        == IdiomaticHighlighting\n                     then (case getListingsLanguage classes of\n                                Just l  -> [ \"language=\" <> mbBraced l ]\n                                Nothing -> []) ++\n                          [ \"numbers=left\" | \"numberLines\" `elem` classes\n                             || \"number\" `elem` classes\n                             || \"number-lines\" `elem` classes ] ++\n                          [ (if key == \"startFrom\"\n                                then \"firstnumber\"\n                                else key) <> \"=\" <> mbBraced attr |\n                                (key,attr) <- kvs,\n                                key `notElem` [\"exports\", \"tangle\", \"results\"]\n                                -- see #4889\n                          ] ++\n                          [\"label=\" <> ref | not (T.null identifier)]\n\n                     else []\n            printParams\n                | null params = empty\n                | otherwise   = brackets $ hcat (intersperse \", \"\n                      (map literal params))\n        return $ flush (\"\\\\begin{lstlisting}\" <> printParams $$ literal str $$\n                 \"\\\\end{lstlisting}\") $$ cr\n  let highlightedCodeBlock =\n        case highlight (writerSyntaxMap opts)\n                 formatLaTeXBlock (\"\",classes ++ [\"default\"],keyvalAttr) str of\n               Left msg -> do\n                 unless (T.null msg) $\n                   report $ CouldNotHighlight msg\n                 rawCodeBlock\n               Right h -> do\n                  when inNote $ modify (\\s -> s{ stVerbInNote = True })\n                  modify (\\s -> s{ stHighlighting = True })\n                  return (flush $ linkAnchor $$ literal h)\n  case () of\n     _ | isEnabled Ext_literate_haskell opts && \"haskell\" `elem` classes &&\n         \"literate\" `elem` classes           -> lhsCodeBlock\n       | writerHighlightMethod opts == IdiomaticHighlighting\n                                             -> listingsCodeBlock\n       | not (null classes), Skylighting _ <- writerHighlightMethod opts\n                                             -> highlightedCodeBlock\n       | not (null classes), DefaultHighlighting <- writerHighlightMethod opts\n                                             -> highlightedCodeBlock\n       -- we don't want to use \\begin{verbatim} if our code\n       -- contains \\end{verbatim}:\n       | inNote\n       , \"\\\\end{Verbatim}\" `T.isInfixOf` str -> highlightedCodeBlock\n       | not inNote\n       , \"\\\\end{verbatim}\" `T.isInfixOf` str -> highlightedCodeBlock\n       | otherwise                           -> rawCodeBlock\nblockToLaTeX b@(RawBlock f x) = do\n  beamer <- gets stBeamer\n  if f == Format \"latex\" || f == Format \"tex\" ||\n       (f == Format \"beamer\" && beamer)\n     then return $ literal x\n     else do\n       report $ BlockNotRendered b\n       return empty\nblockToLaTeX (BulletList []) = return empty  -- otherwise latex error\nblockToLaTeX (BulletList lst) = do\n  incremental <- gets stIncremental\n  isFirstInDefinition <- gets stIsFirstInDefinition\n  beamer <- gets stBeamer\n  let inc = if beamer && incremental then \"[<+->]\" else \"\"\n  items <- mapM (listItemToLaTeX False) lst\n  let spacing = if isTightList lst\n                   then text \"\\\\tightlist\"\n                   else empty\n  return $ -- force list to start on new line if in a defn list\n             (if isFirstInDefinition then \"\\\\hfill\" else mempty) $$\n             text (\"\\\\begin{itemize}\" <> inc) $$\n             spacing $$\n             -- force list at beginning of definition to start on new line\n             vcat items $$\n             \"\\\\end{itemize}\"\nblockToLaTeX (OrderedList _ []) = return empty -- otherwise latex error\nblockToLaTeX (OrderedList (start, numstyle, numdelim) lst) = do\n  st <- get\n  let inc = if stBeamer st && stIncremental st then \"[<+->]\" else \"\"\n  let oldlevel = stOLLevel st\n  isFirstInDefinition <- gets stIsFirstInDefinition\n  put $ st {stOLLevel = oldlevel + 1}\n  items <- mapM (listItemToLaTeX True) lst\n  modify (\\s -> s {stOLLevel = oldlevel})\n  let beamer = stBeamer st\n  let tostyle x = case numstyle of\n                       Decimal      -> \"\\\\arabic\" <> braces x\n                       UpperRoman   -> \"\\\\Roman\" <> braces x\n                       LowerRoman   -> \"\\\\roman\" <> braces x\n                       UpperAlpha   -> \"\\\\Alph\" <> braces x\n                       LowerAlpha   -> \"\\\\alph\" <> braces x\n                       Example      -> \"\\\\arabic\" <> braces x\n                       DefaultStyle -> \"\\\\arabic\" <> braces x\n  let todelim x = case numdelim of\n                       OneParen  -> x <> \")\"\n                       TwoParens -> parens x\n                       Period    -> x <> \".\"\n                       _         -> x <> \".\"\n  let exemplar = case numstyle of\n                       Decimal      -> \"1\"\n                       UpperRoman   -> \"I\"\n                       LowerRoman   -> \"i\"\n                       UpperAlpha   -> \"A\"\n                       LowerAlpha   -> \"a\"\n                       Example      -> \"1\"\n                       DefaultStyle -> \"1\"\n  let enum = literal $ \"enum\" <> T.toLower (toRomanNumeral oldlevel)\n  let stylecommand\n        | numstyle == DefaultStyle && numdelim == DefaultDelim = empty\n        | beamer && numstyle == Decimal && numdelim == Period = empty\n        | beamer = brackets (todelim exemplar)\n        | otherwise = \"\\\\def\" <> \"\\\\label\" <> enum <>\n          braces (todelim $ tostyle enum)\n  let resetcounter = if start == 1 || oldlevel > 4\n                        then empty\n                        else \"\\\\setcounter\" <> braces enum <>\n                              braces (text $ show $ start - 1)\n  let spacing = if isTightList lst\n                   then text \"\\\\tightlist\"\n                   else empty\n  return $ -- force list at beginning of definition to start on new line\n           (if isFirstInDefinition then \"\\\\hfill\" else mempty)\n         $$ text (\"\\\\begin{enumerate}\" <> inc)\n         $$ stylecommand\n         $$ resetcounter\n         $$ spacing\n         $$ vcat items\n         $$ \"\\\\end{enumerate}\"\nblockToLaTeX (DefinitionList []) = return empty\nblockToLaTeX (DefinitionList lst) = do\n  incremental <- gets stIncremental\n  beamer <- gets stBeamer\n  let inc = if beamer && incremental then \"[<+->]\" else \"\"\n  items <- mapM defListItemToLaTeX lst\n  let spacing = if all (isTightList . snd) lst\n                   then text \"\\\\tightlist\"\n                   else empty\n  return $ text (\"\\\\begin{description}\" <> inc) $$ spacing $$ vcat items $$\n               \"\\\\end{description}\"\nblockToLaTeX HorizontalRule =\n            return\n  \"\\\\begin{center}\\\\rule{0.5\\\\linewidth}{0.5pt}\\\\end{center}\"\nblockToLaTeX (Header level (id',classes,_) lst) = do\n  modify $ \\s -> s{stInHeading = True}\n  hdr <- sectionHeader classes id' level lst\n  modify $ \\s -> s{stInHeading = False}\n  return hdr\nblockToLaTeX (Table attr blkCapt specs thead tbodies tfoot) =\n  tableToLaTeX inlineListToLaTeX blockListToLaTeX\n               (Ann.toTable attr blkCapt specs thead tbodies tfoot)\nblockToLaTeX (Figure (ident, _, kvs) captnode body) = do\n  opts <- gets stOptions\n  (capt, captForLof, footnotes) <- getCaption inlineListToLaTeX True captnode\n  lab <- labelFor ident\n  let caption = \"\\\\caption\" <> captForLof <> braces capt <> lab\n      placement = case lookup \"latex-placement\" kvs of\n        Just p -> brackets (text (T.unpack p))\n        _      -> text \"\"\n\n  isSubfigure <- gets stInFigure\n  modify $ \\st -> st{ stInFigure = True }\n  contents <- case body of\n    [b] -> blockToLaTeX b\n    bs  -> mconcat . intersperse (cr <> \"\\\\hfill\") <$>\n           mapM (toSubfigure (length bs)) bs\n  let innards = \"\\\\centering\" $$\n                (case writerFigureCaptionPosition opts of\n                  CaptionBelow -> contents $$ caption\n                  CaptionAbove -> caption $$ contents) <> cr\n  modify $ \\st ->\n    st{ stInFigure = isSubfigure\n      , stSubfigure = stSubfigure st || isSubfigure\n      }\n\n  let containsTable = getAny . query (\\case\n        Table {}  -> Any True\n        _         -> Any False)\n  st <- get\n  return $ (case () of\n    _ | containsTable body ->\n          -- placing a longtable in a figure or center environment does\n          -- not make sense.\n          cr <> contents\n    _ | stInMinipage st ->\n          -- can't have figures in notes or minipage (here, table cell)\n          -- http://www.tex.ac.uk/FAQ-ouparmd.html\n          cr <> \"\\\\begin{center}\" $$ contents $+$ capt $$ \"\\\\end{center}\"\n    _ | isSubfigure ->\n          innards\n    _ ->  cr <> \"\\\\begin{figure}\" <> placement $$ innards $$ \"\\\\end{figure}\")\n    $$ footnotes\n\ntoSubfigure :: PandocMonad m => Int -> Block -> LW m (Doc Text)\ntoSubfigure nsubfigs blk = do\n  contents <- blockToLaTeX blk\n  let linewidth = tshow @Double (0.9 / fromIntegral nsubfigs) <> \"\\\\linewidth\"\n  return $ cr <> case blk of\n    Figure {}    -> vcat\n                    [ \"\\\\begin{subfigure}[t]\" <> braces (literal linewidth)\n                    , contents\n                    , \"\\\\end{subfigure}\"\n                    ]\n    _            -> vcat\n                    [ \"\\\\begin{minipage}[t]\" <> braces (literal linewidth)\n                    , contents\n                    , \"\\\\end{minipage}\"\n                    ]\n\nblockListToLaTeX :: PandocMonad m => [Block] -> LW m (Doc Text)\nblockListToLaTeX lst =\n  vsep `fmap` mapM (\\b -> setEmptyLine True >> blockToLaTeX b) lst\n\nlistItemToLaTeX :: PandocMonad m => Bool -> [Block] -> LW m (Doc Text)\nlistItemToLaTeX isOrdered lst\n  -- we need to put some text before a header if it's the first\n  -- element in an item. This will look ugly in LaTeX regardless, but\n  -- this will keep the typesetter from throwing an error.\n  | (Header{} :_) <- lst =\n    (text \"\\\\item ~\" $$) . nest 2 <$> blockListToLaTeX lst\n  | not isOrdered\n  , Just (checked, bs) <- toTaskListItem lst\n   = taskListItem checked bs\n  | otherwise = (text \"\\\\item\" $$) . nest 2 <$> blockListToLaTeX lst\n  where\n    taskListItem checked bs = do\n      let checkbox  = if checked\n                      then \"$\\\\boxtimes$\"\n                      else \"$\\\\square$\"\n      let bs' = case bs of\n                  Plain ils : xs -> Para ils : xs\n                  _ -> bs\n      bsContents <- blockListToLaTeX bs'\n      return $ \"\\\\item\" <> brackets checkbox $$ nest 2 bsContents\n\ndefListItemToLaTeX :: PandocMonad m => ([Inline], [[Block]]) -> LW m (Doc Text)\ndefListItemToLaTeX (term, defs) = do\n    -- needed to turn off 'listings' because it breaks inside \\item[...]:\n    modify $ \\s -> s{stInItem = True}\n    term' <- inlineListToLaTeX term\n    modify $ \\s -> s{stInItem = False}\n    -- put braces around term if it contains an internal link,\n    -- since otherwise we get bad bracket interactions: \\item[\\hyperref[..]\n    let isInternalLink (Link _ _ (src,_))\n          | Just ('#', _) <- T.uncons src = True\n        isInternalLink _                  = False\n    let term'' = if any isInternalLink term\n                    then braces term'\n                    else term'\n    def'  <- case concat defs of\n               [] -> return mempty\n               (x:xs) -> do\n                 modify $ \\s -> s{stIsFirstInDefinition = True }\n                 firstitem <- blockToLaTeX x\n                 modify $ \\s -> s{stIsFirstInDefinition = False }\n                 rest <- blockListToLaTeX xs\n                 return $ firstitem $+$ rest\n    return $ case defs of\n     ((Header{} : _) : _)    ->\n       \"\\\\item\" <> brackets term'' <> \" ~ \" $$ def'\n     ((CodeBlock{} : _) : _) -> -- see #4662\n       \"\\\\item\" <> brackets term'' <> \" ~ \" $$ def'\n     _                       ->\n       \"\\\\item\" <> brackets term'' $$ def'\n\n-- | Craft the section header, inserting the section reference, if supplied.\nsectionHeader :: PandocMonad m\n              => [Text]  -- classes\n              -> Text\n              -> Int\n              -> [Inline]\n              -> LW m (Doc Text)\nsectionHeader classes ident level lst = do\n  let unnumbered = \"unnumbered\" `elem` classes\n  let unlisted = \"unlisted\" `elem` classes\n  txt <- inlineListToLaTeX lst\n  plain <- stringToLaTeX TextString $ T.concat $ map stringify lst\n  let removeInvalidInline (Note _)             = []\n      removeInvalidInline (Span (id', _, _) _) | not (T.null id') = []\n      removeInvalidInline Image{}            = []\n      removeInvalidInline x                    = [x]\n  let lstNoNotes = foldr (mappend . (\\x -> walkM removeInvalidInline x)) mempty lst\n  txtNoNotes <- inlineListToLaTeX lstNoNotes\n  txtNoLinksNoNotes <- inlineListToLaTeX (removeLinks lstNoNotes)\n  -- footnotes in sections don't work (except for starred variants)\n  -- unless you specify an optional argument:\n  -- \\section[mysec]{mysec\\footnote{blah}}\n  optional <- if unnumbered || lstNoNotes == lst || null lstNoNotes\n                 then return empty\n                 else\n                   return $ brackets txtNoNotes\n  let contents = if render Nothing txt == plain\n                    then braces txt\n                    else braces (text \"\\\\texorpdfstring\"\n                         <> braces txt\n                         <> braces (literal plain))\n  book <- gets stHasChapters\n  opts <- gets stOptions\n  let topLevelDivision = if book && writerTopLevelDivision opts == TopLevelDefault\n                         then TopLevelChapter\n                         else writerTopLevelDivision opts\n  beamer <- gets stBeamer\n  let level' = if beamer &&\n                  topLevelDivision `elem` [TopLevelPart, TopLevelChapter]\n               -- beamer has parts but no chapters\n               then if level == 1 then -1 else level - 1\n               else case topLevelDivision of\n                      TopLevelPart    -> level - 2\n                      TopLevelChapter -> level - 1\n                      TopLevelSection -> level\n                      TopLevelDefault -> level\n  let sectionType = case level' of\n                          -1 -> \"part\"\n                          0  -> \"chapter\"\n                          1  -> \"section\"\n                          2  -> \"subsection\"\n                          3  -> \"subsubsection\"\n                          4  -> \"paragraph\"\n                          5  -> \"subparagraph\"\n                          _  -> \"\"\n  inQuote <- gets stInQuote\n  let prefix = if inQuote\n                  then text \"\\\\mbox{}%\"\n                  -- needed for \\paragraph, \\subparagraph in quote environment\n                  -- see http://tex.stackexchange.com/questions/169830/\n                  else empty\n  lab <- labelFor ident\n  let star = if unnumbered then text \"*\" else empty\n  let title = star <> optional <> contents\n  return $ if level' > 5\n              then txt\n              else prefix\n                   $$ text ('\\\\':sectionType) <> title <> lab\n                   $$ if unnumbered && not unlisted\n                         then \"\\\\addcontentsline{toc}\" <>\n                                braces (text sectionType) <>\n                                braces txtNoLinksNoNotes\n                         else empty\n\n-- | Convert list of inline elements to LaTeX.\ninlineListToLaTeX :: PandocMonad m\n                  => [Inline]  -- ^ Inlines to convert\n                  -> LW m (Doc Text)\ninlineListToLaTeX lst = hcat <$>\n  mapM inlineToLaTeX\n    (addKerns . fixLineInitialSpaces . fixInitialLineBreaks $ lst)\n    -- nonbreaking spaces (~) in LaTeX don't work after line breaks,\n    -- so we insert a strut: this is mostly used in verse.\n where fixLineInitialSpaces [] = []\n       fixLineInitialSpaces (LineBreak : Str s : xs)\n         | Just ('\\160', _) <- T.uncons s\n         = LineBreak : RawInline \"latex\" \"\\\\strut \" : Str s\n            : fixLineInitialSpaces xs\n       fixLineInitialSpaces (x:xs) = x : fixLineInitialSpaces xs\n       -- We need \\hfill\\break for a line break at the start\n       -- of a paragraph. See #5591.\n       fixInitialLineBreaks (LineBreak:xs) =\n         RawInline (Format \"latex\") \"\\\\hfill\\\\break\\n\" :\n           fixInitialLineBreaks xs\n       fixInitialLineBreaks xs = xs\n       addKerns [] = []\n       addKerns (Str s : q@Quoted{} : rest)\n         | isQuote (T.takeEnd 1 s) =\n           Str s : RawInline (Format \"latex\") \"\\\\,\" : addKerns (q:rest)\n       addKerns (q@Quoted{} : Str s : rest)\n         | isQuote (T.take 1 s) =\n           q : RawInline (Format \"latex\") \"\\\\,\" : addKerns (Str s : rest)\n       addKerns (x:xs) = x : addKerns xs\n       isQuote \"\\\"\" = True\n       isQuote \"'\" = True\n       isQuote \"\\x2018\" = True\n       isQuote \"\\x2019\" = True\n       isQuote \"\\x201C\" = True\n       isQuote \"\\x201D\" = True\n       isQuote _ = False\n\n-- | Convert inline element to LaTeX\ninlineToLaTeX :: PandocMonad m\n              => Inline    -- ^ Inline to convert\n              -> LW m (Doc Text)\ninlineToLaTeX (Span (\"\",[\"mark\"],[]) lst) = do\n  modify $ \\st -> st{ stStrikeout = True } -- this gives us the soul package\n  inCmd \"hl\" <$> inSoulCommand (inlineListToLaTeX lst)\ninlineToLaTeX (Span (id',classes,kvs) ils) = do\n  linkAnchor <- hypertarget id'\n  lang <- toLang $ lookup \"lang\" kvs\n  let classToCmd \"csl-no-emph\" = Just \"textup\"\n      classToCmd \"csl-no-strong\" = Just \"textnormal\"\n      classToCmd \"csl-no-smallcaps\" = Just \"textnormal\"\n      classToCmd \"csl-block\" = Just \"CSLBlock\"\n      classToCmd \"csl-left-margin\" = Just \"CSLLeftMargin\"\n      classToCmd \"csl-right-inline\" = Just \"CSLRightInline\"\n      classToCmd \"csl-indent\" = Just \"CSLIndent\"\n      classToCmd _ = Nothing\n      kvToCmd (\"dir\",\"rtl\") = Just \"RL\"\n      kvToCmd (\"dir\",\"ltr\") = Just \"LR\"\n      kvToCmd _ = Nothing\n      langCmds =\n        case lang >>= toBabel of\n           Just l  -> [\"foreignlanguage{\" <> l <> \"}\"]\n           Nothing -> []\n  let cmds = mapMaybe classToCmd classes ++ mapMaybe kvToCmd kvs ++ langCmds\n  contents <- inlineListToLaTeX ils\n  return $\n    (if \"csl-right-inline\" `elem` classes\n        then (\"%\" <>) -- see #7932\n        else id) $\n    (if any (`elem` classes)\n            [\"csl-block\",\"csl-left-margin\",\"csl-right-inline\",\"csl-indent\"]\n        then (cr <>)\n        else id) $\n    (if T.null id'\n        then empty\n        else linkAnchor) <>\n    (if null cmds\n        then braces contents\n        else foldr inCmd contents cmds)\ninlineToLaTeX (Emph lst) = inCmd \"emph\" <$> inlineListToLaTeX lst\ninlineToLaTeX (Underline lst) = do\n  modify $ \\st -> st{ stStrikeout = True } -- this gives us the soul package\n  inCmd \"ul\" <$> inSoulCommand (inlineListToLaTeX lst)\ninlineToLaTeX (Strong lst) = inCmd \"textbf\" <$> inlineListToLaTeX lst\ninlineToLaTeX (Strikeout lst) = do\n  modify $ \\s -> s{ stStrikeout = True }\n  inCmd \"st\" <$> inSoulCommand (inlineListToLaTeX lst)\ninlineToLaTeX (Superscript lst) =\n  inCmd \"textsuperscript\" <$> inlineListToLaTeX lst\ninlineToLaTeX (Subscript lst) =\n  inCmd \"textsubscript\" <$> inlineListToLaTeX lst\ninlineToLaTeX (SmallCaps lst) =\n  inCmd \"textsc\"<$> inlineListToLaTeX lst\ninlineToLaTeX (Cite cits lst) = do\n  opts <- gets stOptions\n  modify $ \\st -> st{ stInCite = True }\n  res <- case writerCiteMethod opts of\n           Natbib   -> citationsToNatbib inlineListToLaTeX cits\n           Biblatex -> citationsToBiblatex inlineListToLaTeX cits\n           _        -> inlineListToLaTeX lst\n  modify $ \\st -> st{ stInCite = False }\n  pure res\n\ninlineToLaTeX (Code (_,classes,kvs) str) = do\n  opts <- gets stOptions\n  inHeading <- gets stInHeading\n  inItem <- gets stInItem\n  inSoul <- gets stInSoulCommand\n  inCaption <- gets stInCaption\n  let listingsCode = do\n        let listingsopts = (case getListingsLanguage classes of\n                                Just l  -> ((\"language\", mbBraced l):)\n                                Nothing -> id)\n                           [(k,v) | (k,v) <- kvs\n                                  , k `notElem` [\"exports\",\"tangle\",\"results\"]]\n        let listingsopt = if null listingsopts\n                             then \"\"\n                             else \"[\" <>\n                                  T.intercalate \", \"\n                                  (map (\\(k,v) -> k <> \"=\" <> v)\n                                   listingsopts) <> \"]\"\n        inNote <- gets stInNote\n        when inNote $ modify $ \\s -> s{ stVerbInNote = True }\n        let chr = case \"!\\\"'()*,-./:;?@\" \\\\ T.unpack str of\n                       (c:_) -> c\n                       []    -> '!'\n        let isEscapable '\\\\' = True\n            isEscapable '{'  = True\n            isEscapable '}'  = True\n            isEscapable '%'  = True\n            isEscapable '~'  = True\n            isEscapable '_'  = True\n            isEscapable '&'  = True\n            isEscapable '#'  = True\n            isEscapable '^'  = True\n            isEscapable _    = False\n        let escChar c | isEscapable c = T.pack ['\\\\',c]\n                      | otherwise     = T.singleton c\n        let str' = T.concatMap escChar str\n        -- we always put lstinline in a dummy 'passthrough' command\n        -- (defined in the default template) so that we don't have\n        -- to change the way we escape characters depending on whether\n        -- the lstinline is inside another command.  See #1629:\n        return $ literal $ \"\\\\passthrough{\\\\lstinline\" <>\n                        listingsopt <> T.singleton chr <> str' <> T.singleton chr <> \"}\"\n  let rawCode = liftM (literal . (\\s -> \"\\\\texttt{\" <> escapeSpaces s <> \"}\"))\n                 $ stringToLaTeX CodeString str\n                where escapeSpaces = T.concatMap\n                         (\\c -> if c == ' ' then \"\\\\ \" else T.singleton c)\n  let highlightCode =\n        case highlight (writerSyntaxMap opts)\n                 formatLaTeXInline (\"\",classes,[]) str of\n               Left msg -> do\n                 unless (T.null msg) $ report $ CouldNotHighlight msg\n                 rawCode\n               Right h -> modify (\\st -> st{ stHighlighting = True }) >>\n                          return (text (T.unpack h))\n  -- for soul commands we need to protect VERB in an mbox or we get an error\n  -- (see #1294). with regular texttt we don't get an error, but we get\n  -- incorrect results if there is a space (see #5529).\n  let inMbox x = \"\\\\mbox\" <> braces x\n\n  -- for captions we need to protect VERB with \\protect (see #6821)\n  let protect x = \"\\\\protect\" <> x\n\n  let optionalProtect = case () of _ | inSoul -> inMbox\n                                     | inCaption -> protect\n                                     | otherwise -> id\n  optionalProtect <$>\n   case writerHighlightMethod opts of\n     _ | inHeading || inItem  -> rawCode  -- see #5574\n     IdiomaticHighlighting    -> listingsCode\n     Skylighting _ | not (null classes)\n                              -> highlightCode\n     DefaultHighlighting | not (null classes)\n                              -> highlightCode\n     _noHighlighting          -> rawCode\ninlineToLaTeX (Quoted qt lst) = do\n  contents <- inlineListToLaTeX lst\n  csquotes <- liftM stCsquotes get\n  opts <- gets stOptions\n  if csquotes\n     then return $ case qt of\n               DoubleQuote -> \"\\\\enquote\" <> braces contents\n               SingleQuote -> \"\\\\enquote*\" <> braces contents\n     else do\n       let endsWithQuote xs =\n             case reverse xs of\n                   Quoted{}:_ -> True\n                   Span _ ys : _ -> endsWithQuote ys\n                   Str s:_ -> T.takeEnd 1 s == \"'\"\n                   _ -> False\n       let beginsWithQuote xs =\n             case xs of\n                   Quoted{}:_ -> True\n                   Span _ ys : _ -> beginsWithQuote ys\n                   Str s:_ -> T.take 1 s == \"`\"\n                   _ -> False\n       let inner = (if beginsWithQuote lst then \"\\\\,\" else mempty)\n                    <> contents\n                    <> (if endsWithQuote lst then \"\\\\,\" else mempty)\n       return $ case qt of\n                DoubleQuote ->\n                   if isEnabled Ext_smart opts\n                      then text \"``\" <> inner <> text \"''\"\n                      else char '\\x201C' <> inner <> char '\\x201D'\n                SingleQuote ->\n                   if isEnabled Ext_smart opts\n                      then char '`' <> inner <> char '\\''\n                      else char '\\x2018' <> inner <> char '\\x2019'\ninlineToLaTeX (Str str) = do\n  setEmptyLine False\n  liftM literal $ stringToLaTeX TextString str\ninlineToLaTeX (Math _ str)\n  | isMathEnv str -- see #9711\n  = do setEmptyLine False\n       when (needsCancel str) $ modify $ \\st -> st{ stCancel = True }\n       pure $ literal str\ninlineToLaTeX (Math InlineMath str) = do\n  setEmptyLine False\n  inSoul <- gets stInSoulCommand\n  let contents = literal (handleMathComment str)\n  when (needsCancel str) $ modify $ \\st -> st{ stCancel = True }\n  return $\n    if inSoul -- #9597\n       then \"$\" <> contents <> \"$\"\n       else \"\\\\(\" <> contents <> \"\\\\)\"\ninlineToLaTeX (Math DisplayMath str) = do\n  setEmptyLine False\n  inSoul <- gets stInSoulCommand\n  let contents = literal (handleMathComment str)\n  when (needsCancel str) $ modify $ \\st -> st{ stCancel = True }\n  return $\n    if inSoul -- # 9597\n       then \"$$\" <> contents <> \"$$\"\n       else \"\\\\[\" <> contents <> \"\\\\]\"\ninlineToLaTeX il@(RawInline f str) = do\n  beamer <- gets stBeamer\n  if f == Format \"latex\" || f == Format \"tex\" ||\n        (f == Format \"beamer\" && beamer)\n     then do\n       setEmptyLine False\n       return $ literal str\n     else do\n       report $ InlineNotRendered il\n       return empty\ninlineToLaTeX LineBreak = do\n  emptyLine <- gets stEmptyLine\n  setEmptyLine True\n  return $ (if emptyLine then \"\\\\strut \" else \"\") <> \"\\\\\\\\\" <> cr\ninlineToLaTeX SoftBreak = do\n  wrapText <- gets (writerWrapText . stOptions)\n  case wrapText of\n       WrapAuto     -> return space\n       WrapNone     -> return space\n       WrapPreserve -> return cr\ninlineToLaTeX Space = return space\ninlineToLaTeX (Link (id',_,_) txt (src,_)) =\n   (case T.uncons src of\n     Just ('#', ident) -> do\n        contents <- inlineListToLaTeX txt\n        lab <- toLabel ident\n        inCite <- gets stInCite\n        beamer <- gets stBeamer\n        return $\n          if inCite && \"#ref-\" `T.isPrefixOf` src\n             then \"\\\\citeproc\" <> braces (literal lab) <> braces contents\n             else if beamer\n                     then \"\\\\hyperlink\" <> braces (literal lab) <> braces contents\n                     else \"\\\\hyperref\" <> brackets (literal lab) <> braces contents\n     _ -> case txt of\n          -- For soul sommands we need to protect \\url and \\href in an mbox or\n          -- we get an error (see #9366)\n          [Str x] | T.all isAscii x  -- see #8802\n                  , unEscapeString (T.unpack x) ==\n                    unEscapeString (T.unpack src) ->  -- autolink\n               do modify $ \\s -> s{ stUrl = True }\n                  src' <- stringToLaTeX URLString (escapeURI src)\n                  protectInMboxIfInSoul $ literal $ \"\\\\url{\" <> src' <> \"}\"\n          [Str x] | Just rest <- T.stripPrefix \"mailto:\" src,\n                    unEscapeString (T.unpack x) == unEscapeString (T.unpack rest) -> -- email autolink\n               do modify $ \\s -> s{ stUrl = True }\n                  src' <- stringToLaTeX URLString (escapeURI src)\n                  contents <- inlineListToLaTeX txt\n                  protectInMboxIfInSoul $ \"\\\\href\" <> braces (literal src') <>\n                     braces (\"\\\\nolinkurl\" <> braces contents)\n          _ -> do contents <- inlineListToLaTeX txt\n                  src' <- stringToLaTeX URLString (escapeURI src)\n                  protectInMboxIfInSoul $ literal (\"\\\\href{\" <> src' <> \"}{\") <>\n                    contents <> char '}')\n     >>= (if T.null id'\n             then return\n             else \\x -> do\n               linkAnchor <- hypertarget id'\n               return (linkAnchor <> x))\ninlineToLaTeX il@(Image _ _ (src, _))\n  | Just _ <- T.stripPrefix \"data:\" src = do\n      report $ InlineNotRendered il\n      return empty\ninlineToLaTeX (Image attr@(_,_,kvs) description (source, _)) = do\n  setEmptyLine False\n  let isSVG = \".svg\" `T.isSuffixOf` source || \".SVG\" `T.isSuffixOf` source\n  modify $ \\s -> s{ stGraphics = True\n                  , stSVG = stSVG s || isSVG }\n  opts <- gets stOptions\n  mbalt <- if isSVG\n              then pure Nothing\n              else case lookup \"alt\" kvs of\n                     Just x -> Just <$> stringToLaTeX TextString x\n                     Nothing\n                       | null description -> pure Nothing\n                       | otherwise -> Just <$> stringToLaTeX TextString\n                                                  (stringify description)\n  let showDim dir = let d = text (show dir) <> \"=\"\n                    in case dimension dir attr of\n                         Just (Pixel a)   ->\n                           [d <> literal (showInInch opts (Pixel a)) <> \"in\"]\n                         Just (Percent a) ->\n                           [d <> literal (showFl (a / 100)) <>\n                             case dir of\n                                Width  -> \"\\\\linewidth\"\n                                Height -> \"\\\\textheight\"\n                           ]\n                         Just dim         ->\n                           [d <> text (show dim)]\n                         Nothing          ->\n                           case dir of\n                                Width | isJust (dimension Height attr) ->\n                                  [d <> \"\\\\linewidth\"]\n                                Height | isJust (dimension Width attr) ->\n                                  [d <> \"\\\\textheight\"]\n                                _ -> []\n      optList = showDim Width <> showDim Height <>\n                (case (dimension Height attr, dimension Width attr) of\n                  (Just _, Just _) -> []\n                  _ -> [\"keepaspectratio\"]) <>\n                maybe [] (\\x -> [\"page=\" <> literal x]) (lookup \"page\" kvs) <>\n                maybe [] (\\x -> [\"trim=\" <> literal x]) (lookup \"trim\" kvs) <>\n                maybe [] (\\x -> [\"alt=\" <> braces (literal x)]) mbalt <>\n                maybe [] (const [\"clip\"]) (lookup \"clip\" kvs)\n      options = if null optList\n                   then empty\n                   else brackets $ mconcat (intersperse \",\" optList)\n      source' = if isURI source\n                   then source\n                   else T.pack $ unEscapeString $ T.unpack source\n  source'' <- stringToLaTeX URLString source'\n  inHeading <- gets stInHeading\n  return $\n    (if inHeading then \"\\\\protect\" else \"\") <>\n    (case dimension Width attr `mplus` dimension Height attr of\n       Just _ -> id\n       Nothing -> (\"\\\\pandocbounded\" <>) . braces)\n      ((if isSVG then \"\\\\includesvg\" else \"\\\\includegraphics\") <>\n        options <> braces (literal source''))\ninlineToLaTeX (Note contents) = do\n  setEmptyLine False\n  externalNotes <- gets stExternalNotes\n  modify (\\s -> s{stInNote = True, stExternalNotes = True})\n  contents' <- blockListToLaTeX contents\n  modify (\\s -> s {stInNote = False, stExternalNotes = externalNotes})\n  let optnl = case reverse contents of\n                   (CodeBlock _ _ : _) -> cr\n                   _                   -> empty\n  let noteContents = nest 2 contents' <> optnl\n  beamer <- gets stBeamer\n  -- in beamer slides, display footnote from current overlay forward\n  -- and ensure that the note is on the frame, not e.g. the column (#5769, #5954)\n  incremental <- gets stIncremental\n  let beamerMark = if beamer\n                      then if incremental\n                           then text \"<.->[frame]\"\n                           else text \"<\\\\value{beamerpauses}->[frame]\"\n                      else empty\n  if externalNotes\n     then do\n       modify $ \\st -> st{ stNotes = noteContents : stNotes st }\n       return \"\\\\footnotemark{}\"\n       -- note: a \\n before } needed when note ends with a Verbatim environment\n       else return $ \"\\\\footnote\" <> beamerMark <> braces noteContents\n\n-- A comment at the end of math needs to be followed by a newline,\n-- or the closing delimiter gets swallowed.\nhandleMathComment :: Text -> Text\nhandleMathComment s =\n  let (_, ys) = T.break (\\c -> c == '\\n' || c == '%') $ T.reverse s -- no T.breakEnd\n  in  case T.uncons ys of\n        Just ('%', ys') -> case T.uncons ys' of\n          Just ('\\\\', _) -> s\n          _              -> s <> \"\\n\"\n        _                -> s\n\nsetEmptyLine :: PandocMonad m => Bool -> LW m ()\nsetEmptyLine b = modify $ \\st -> st{ stEmptyLine = b }\n\n-- Extract a key from divs and spans\nextract :: Text -> Block -> [Text]\nextract key (Div attr _)     = lookKey key attr\nextract key (Plain ils)      = query (extractInline key) ils\nextract key (Para ils)       = query (extractInline key) ils\nextract key (Header _ _ ils) = query (extractInline key) ils\nextract _ _                  = []\n\n-- Extract a key from spans\nextractInline :: Text -> Inline -> [Text]\nextractInline key (Span attr _) = lookKey key attr\nextractInline _ _               = []\n\n-- Look up a key in an attribute and give a list of its values\nlookKey :: Text -> Attr -> [Text]\nlookKey key (_,_,kvs) =  maybe [] T.words $ lookup key kvs\n\n-- soul doesn't like \\(..\\) delimiters, so we change these to $ (#9597)\n-- when processing their contents.\ninSoulCommand :: PandocMonad m => LW m a -> LW m a\ninSoulCommand pa = do\n  oldInSoulCommand <- gets stInSoulCommand\n  modify $ \\st -> st{ stInSoulCommand = True }\n  result <- pa\n  modify $ \\st -> st{ stInSoulCommand = oldInSoulCommand }\n  pure result\n\n-- Inside soul commands some commands need to be protected in an mbox\n-- or we get an error (e.g. see #1294)\nprotectInMboxIfInSoul :: (PandocMonad m, HasChars a) => Doc a -> LW m (Doc a)\nprotectInMboxIfInSoul command = do\n  inSoul <- gets stInSoulCommand\n  return $ if inSoul\n    then \"\\\\mbox\" <> braces command\n    else command\n\n-- Babel languages with a .ldf that works well with all engines (see #8283).\n-- We follow the guidance from the Babel documentation:\n-- \"In general, you should do this for European languages written in Latin\n-- and Cyrillic scripts, as well as for Vietnamese.\"\nldfLanguages :: [Text]\nldfLanguages =\n  [ \"magyar\"\n  , \"croatian\"\n  , \"ngerman\"\n  , \"germanb\"\n  , \"german\"\n  , \"austrian\"\n  , \"ngermanb\"\n  , \"naustrian\"\n  , \"nswissgerman\"\n  , \"swissgerman\"\n  , \"italian\"\n  , \"greek\"\n  , \"azerbaijani\"\n  , \"american\"\n  , \"newzealand\"\n  , \"UKenglish\"\n  , \"USenglish\"\n  , \"australian\"\n  , \"british\"\n  , \"canadian\"\n  , \"english\"\n  , \"bahasa\"\n  , \"slovak\"\n  , \"finnish\"\n  , \"occitan\"\n  , \"swedish\"\n  , \"brazil\"\n  , \"portuguese\"\n  , \"portuges\"\n  , \"brazilian\"\n  , \"spanish\"\n  , \"norwegian\"\n  , \"norsk\"\n  , \"nynorsk\"\n  , \"bulgarian\"\n  , \"breton\"\n  , \"belarusian\"\n  , \"piedmontese\"\n  , \"esperanto\"\n  , \"lithuanian\"\n  , \"ukraineb\"\n  , \"scottishgaelic\"\n  , \"scottish\"\n  , \"dutch\"\n  , \"afrikaans\"\n  , \"czech\"\n  , \"serbian\"\n  , \"latvian\"\n  , \"catalan\"\n  , \"basque\"\n  , \"albanian\"\n  , \"irish\"\n  , \"serbianc\"\n  , \"interlingua\"\n  , \"bosnian\"\n  , \"friulan\"\n  , \"romanian\"\n  , \"icelandic\"\n  , \"classiclatin\"\n  , \"ecclesiasticlatin\"\n  , \"medievallatin\"\n  , \"latin\"\n  , \"georgian\"\n  , \"macedonian\"\n  , \"welsh\"\n  , \"vietnamese\"\n  , \"romansh\"\n  , \"danish\"\n  , \"lsorbian\"\n  , \"usorbian\"\n  , \"polish-compat\"\n  , \"polish\"\n  , \"estonian\"\n  , \"french\"\n  , \"frenchb\"\n  , \"canadien\"\n  , \"acadian\"\n  , \"francais\"\n  , \"turkish\"\n  , \"hindi\"\n  , \"northernsami\"\n  , \"samin\"\n  , \"russianb\"\n  , \"galician\"\n  , \"slovene\"\n  ]\n\nisMathEnv :: Text -> Bool\nisMathEnv t =\n  case T.stripPrefix \"\\\\begin{\" (T.dropWhile isSpaceChar t) of\n    Nothing -> False\n    Just t' -> T.takeWhile (/= '}') t' `elem`\n      [ \"align\", \"align*\"\n      , \"flalign\", \"flalign*\"\n      , \"alignat\", \"alignat*\"\n      , \"dmath\", \"dmath*\"\n      , \"dgroup\", \"dgroup*\"\n      , \"darray\", \"darray*\"\n      , \"gather\", \"gather*\"\n      , \"multline\", \"multline*\"\n      , \"subequations\"\n      , \"equation\", \"equation*\"\n      , \"eqnarray\"\n      , \"displaymath\"\n      ]\n where\n   isSpaceChar '\\n' = True\n   isSpaceChar '\\r' = True\n   isSpaceChar '\\t' = True\n   isSpaceChar ' ' = True\n   isSpaceChar _ = False\n\n-- True if the math needs the cancel package\nneedsCancel :: Text -> Bool\nneedsCancel t =\n  case A.parseOnly pCancel t of\n    Right True -> True\n    _ -> False\n where\n  pCancel = (False <$ A.endOfInput) <|> do\n    c <- A.anyChar\n    case c of\n      '\\\\' -> do\n        x <- A.takeWhile isLetter\n        if x == \"cancel\" || x == \"xcancel\" || x == \"bcancel\"\n           then return True\n           else pCancel\n      _ -> pCancel\n\n-- PDF standard support for DocumentMetadata\n\n-- | PDF standards supported by LaTeX's DocumentMetadata\n-- See: https://github.com/latex3/latex2e documentmetadata-support.dtx\nlatexSupportedStandards :: Set.Set Text\nlatexSupportedStandards = Set.fromList\n  [ -- PDF/A standards (note: a-1a is NOT supported by LaTeX, only a-1b)\n    \"a-1b\", \"a-2a\", \"a-2b\", \"a-2u\", \"a-3a\", \"a-3b\", \"a-3u\"\n  , \"a-4\", \"a-4e\", \"a-4f\"\n    -- PDF/X standards\n  , \"x-4\", \"x-4p\", \"x-5g\", \"x-5n\", \"x-5pg\", \"x-6\", \"x-6n\", \"x-6p\"\n    -- PDF/UA standards\n  , \"ua-1\", \"ua-2\"\n  ]\n\n-- | Standards that require PDF tagging (document structure)\n-- PDF/A level \"a\" variants and PDF/UA require tagged structure\ntaggingRequiredStandards :: Set.Set Text\ntaggingRequiredStandards = Set.fromList\n  [\"a-2a\", \"a-3a\", \"ua-1\", \"ua-2\"]\n\n-- | Valid PDF versions for DocumentMetadata\nvalidPdfVersions :: Set.Set Text\nvalidPdfVersions = Set.fromList\n  [\"1.4\", \"1.5\", \"1.6\", \"1.7\", \"2.0\"]\n\n-- | PDF version required by each standard\n-- LaTeX defaults to PDF 2.0 with \\DocumentMetadata, but some standards\n-- have maximum version requirements that are incompatible with 2.0\nstandardRequiredVersion :: M.Map Text Text\nstandardRequiredVersion = M.fromList\n  [ (\"a-1b\", \"1.4\")  -- PDF/A-1 requires exactly PDF 1.4\n    -- PDF/A-2 and PDF/A-3 require 1.7; must set explicitly since LaTeX defaults to 2.0\n  , (\"a-2a\", \"1.7\"), (\"a-2b\", \"1.7\"), (\"a-2u\", \"1.7\")\n  , (\"a-3a\", \"1.7\"), (\"a-3b\", \"1.7\"), (\"a-3u\", \"1.7\")\n    -- PDF/A-4, PDF/UA-1, PDF/UA-2 work with PDF 2.0 (the default)\n  ]\n\n-- | Normalize a PDF standard string: lowercase, strip \"pdf\" prefix\nnormalizePdfStandard :: Text -> Text\nnormalizePdfStandard t =\n  let lower = T.toLower t\n  in case T.stripPrefix \"pdf\" lower of\n       Just rest -> T.dropWhile (`elem` ['-', '/']) rest\n       Nothing   -> lower\n\n-- | Normalize a PDF version string\n-- Handles YAML parsing quirk where 2.0 becomes integer 2, then string \"2\"\nnormalizeVersion :: Text -> Text\nnormalizeVersion t\n  | t == \"2\" = \"2.0\"\n  | otherwise = t\n\n-- | Check if text is a valid PDF version (after normalization)\nisPdfVersion :: Text -> Bool\nisPdfVersion t = Set.member (normalizeVersion t) validPdfVersions\n\n-- | Process pdfstandard metadata, returning PDF standard settings\nprocessPdfStandard :: PandocMonad m\n                   => Context Text\n                   -> m PdfStandard\nprocessPdfStandard ctx = do\n  let standards = fromMaybe [] $ getField \"pdfstandard\" ctx\n      normalized = map normalizePdfStandard standards\n      (versions, pdfStds) = partition isPdfVersion normalized\n      validStandards = filter (`Set.member` latexSupportedStandards) pdfStds\n      invalidStandards = filter (\\s -> not (Set.member s latexSupportedStandards)\n                                    && not (isPdfVersion s)) pdfStds\n      needsTagging = any (`Set.member` taggingRequiredStandards) validStandards\n      -- Use explicit version if provided, otherwise infer from standards\n      -- Apply normalizeVersion to handle YAML parsing \"2\" -> \"2.0\"\n      explicitVersion = normalizeVersion <$> listToMaybe versions\n      inferredVersion = listToMaybe $ mapMaybe (`M.lookup` standardRequiredVersion) validStandards\n      version = explicitVersion <|> inferredVersion\n  -- Warn about unsupported standards\n  mapM_ (report . UnsupportedPdfStandard) invalidStandards\n  return PdfStandard\n    { pdfStandards = validStandards\n    , pdfVersion = version\n    , pdfTagging = needsTagging\n    }\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Man.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Writers.Man\n   Copyright   : Copyright (C) 2007-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to roff man page format.\n\n-}\nmodule Text.Pandoc.Writers.Man ( writeMan ) where\nimport Control.Monad ( liftM, zipWithM, forM, unless )\nimport Control.Monad.State.Strict ( StateT, gets, modify, evalStateT )\nimport Control.Monad.Trans (MonadTrans(lift))\nimport Data.List (intersperse)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Builder (deleteMeta)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Writers.Roff\nimport Text.Pandoc.Highlighting\nimport Text.Printf (printf)\nimport Skylighting (TokenType(..), SourceLine, FormatOptions, defaultFormatOpts,\n                    defStyle, TokenStyle(..), Style(..))\n\n-- | Convert Pandoc to Man.\nwriteMan :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteMan opts document =\n  evalStateT (pandocToMan opts document) defaultWriterState\n\n-- | Return roff man representation of document.\npandocToMan :: PandocMonad m => WriterOptions -> Pandoc -> StateT WriterState m Text\npandocToMan opts (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  titleText <- inlineListToMan opts $ docTitle meta\n  let title' = render Nothing titleText\n  let setFieldsFromTitle =\n       case T.break (== ' ') title' of\n           (cmdName, rest) -> case T.break (=='(') cmdName of\n                                   (xs, ys) | \"(\" `T.isPrefixOf` ys\n                                                && \")\" `T.isSuffixOf` ys ->\n                                     defField \"title\" xs .\n                                     defField \"section\" (T.init $ T.drop 1 ys) .\n                                     case T.splitOn \"|\" rest of\n                                          (ft:hds) ->\n                                            defField \"footer\" (T.strip ft) .\n                                            defField \"header\"\n                                               (T.strip $ mconcat hds)\n                                          [] -> id\n                                   _  -> defField \"title\" title'\n  metadata <- metaToContext opts\n              (blockListToMan opts)\n              (fmap chomp . inlineListToMan opts)\n              $ deleteMeta \"title\" meta\n  body <- blockListToMan opts blocks\n  notes <- gets stNotes\n  notes' <- notesToMan opts (reverse notes)\n  let main = body $$ notes' $$ text \"\"\n  hasTables <- gets stHasTables\n  let context = defField \"body\" main\n              $ setFieldsFromTitle\n              $ defField \"has-tables\" hasTables\n                metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\nescString :: WriterOptions -> Text -> Text\nescString opts = escapeString True (if writerPreferAscii opts\n                                       then AsciiOnly\n                                       else AllowUTF8)\n\n-- | Return man representation of notes.\nnotesToMan :: PandocMonad m => WriterOptions -> [[Block]] -> StateT WriterState m (Doc Text)\nnotesToMan opts notes =\n  if null notes\n     then return empty\n     else (text \".SH NOTES\" $$) . vcat <$> zipWithM (noteToMan opts) [1..] notes\n\n-- | Return man representation of a note.\nnoteToMan :: PandocMonad m => WriterOptions -> Int -> [Block] -> StateT WriterState m (Doc Text)\nnoteToMan opts num note = do\n  contents <- blockListToMan opts note\n  let marker = cr <> text \".SS \" <> brackets (text (show num))\n  return $ marker $$ contents\n\n-- We split inline lists into sentences, and print one sentence per\n-- line.  roff treats the line-ending period differently.\n-- See http://code.google.com/p/pandoc/issues/detail?id=148.\n\n-- | Convert Pandoc block element to man.\nblockToMan :: PandocMonad m\n           => WriterOptions -- ^ Options\n           -> Block         -- ^ Block element\n           -> StateT WriterState m (Doc Text)\nblockToMan opts (Div _ bs) = blockListToMan opts bs\nblockToMan opts (Plain inlines) =\n  splitSentences <$> inlineListToMan opts inlines\nblockToMan opts (Para inlines) = do\n  contents <- inlineListToMan opts inlines\n  return $ text \".PP\" $$ splitSentences contents\nblockToMan opts (LineBlock lns) =\n  blockToMan opts $ linesToPara lns\nblockToMan _ b@(RawBlock f str)\n  | f == Format \"man\" = return $ literal str\n  | otherwise         = do\n      report $ BlockNotRendered b\n      return empty\nblockToMan _ HorizontalRule = return $ literal \".PP\" $$ literal \"   *   *   *   *   *\"\nblockToMan opts (Header level _ inlines) = do\n  contents <- inlineListToMan opts inlines\n  let heading = case level of\n                  1 -> \".SH \"\n                  _ -> \".SS \"\n  return $ nowrap $ literal heading <> contents\nblockToMan opts (CodeBlock attr str) = do\n  hlCode <- case highlight (writerSyntaxMap opts) (formatSource opts)\n                  attr str of\n              Right d -> pure d\n              Left msg -> do\n                unless (T.null msg) $ report $ CouldNotHighlight msg\n                pure $ formatSource opts defaultFormatOpts\n                          (map (\\t -> [(NormalTok,t)]) $ T.lines str)\n  pure $ literal \".IP\" $$\n         literal \".EX\" $$\n         hlCode $$\n         literal \".EE\"\nblockToMan opts (BlockQuote blocks) = do\n  contents <- blockListToMan opts blocks\n  return $ literal \".RS\" $$ contents $$ literal \".RE\"\nblockToMan opts (Table _ blkCapt specs thead tbody tfoot) =\n  let (caption, alignments, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n      aligncode AlignLeft    = \"l\"\n      aligncode AlignRight   = \"r\"\n      aligncode AlignCenter  = \"c\"\n      aligncode AlignDefault = \"l\"\n  in do\n  caption' <- inlineListToMan opts caption\n  modify $ \\st -> st{ stHasTables = True }\n  let iwidths = if all (== 0) widths\n                   then repeat \"\"\n                   else map (T.pack . printf \"w(%0.1fn)\" . (70 *)) widths\n  -- 78n default width - 8n indent = 70n\n  let coldescriptions = literal $ T.unwords\n                        (zipWith (\\align width -> aligncode align <> width)\n                        alignments iwidths) <> \".\"\n  colheadings <- mapM (blockListToMan opts) headers\n  let makeRow cols = literal \"T{\" $$\n                     vcat (intersperse (literal \"T}@T{\") cols) $$\n                     literal \"T}\"\n  let colheadings' = if all null headers\n                        then empty\n                        else makeRow colheadings $$ char '_'\n  body <- mapM (\\row -> do\n                         cols <- mapM (blockListToMan opts) row\n                         return $ makeRow cols) rows\n  return $ literal \".PP\" $$ caption' $$\n           literal \".TS\" $$ literal \"tab(@);\" $$ coldescriptions $$\n           colheadings' $$ vcat body $$ literal \".TE\"\nblockToMan opts (BulletList items) = do\n  contents <- mapM (bulletListItemToMan opts) items\n  return (vcat contents)\nblockToMan opts (OrderedList attribs items) = do\n  let markers = take (length items) $ orderedListMarkers attribs\n  let indent = 1 + maybe 0 maximum (nonEmpty (map T.length markers))\n  contents <- mapM (\\(num, item) -> orderedListItemToMan opts num indent item) $\n              zip markers items\n  return (vcat contents)\nblockToMan opts (DefinitionList items) = do\n  contents <- mapM (definitionListItemToMan opts) items\n  return (vcat contents)\nblockToMan opts (Figure attr capt body) = do\n  blockToMan opts (figureDiv attr capt body)\n\n-- | Convert bullet list item (list of blocks) to man.\nbulletListItemToMan :: PandocMonad m => WriterOptions -> [Block] -> StateT WriterState m (Doc Text)\nbulletListItemToMan _ [] = return empty\nbulletListItemToMan opts (Para first:rest) =\n  bulletListItemToMan opts (Plain first:rest)\nbulletListItemToMan opts (Plain first:rest) = do\n  first' <- blockToMan opts (Plain first)\n  rest' <- blockListToMan opts rest\n  let first'' = literal \".IP \\\\(bu 2\" $$ first'\n  let rest''  = if null rest\n                   then empty\n                   else literal \".RS 2\" $$ rest' $$ literal \".RE\"\n  return (first'' $$ rest'')\nbulletListItemToMan opts (first:rest) = do\n  first' <- blockToMan opts first\n  rest' <- blockListToMan opts rest\n  return $ literal \"\\\\(bu .RS 2\" $$ first' $$ rest' $$ literal \".RE\"\n\n-- | Convert ordered list item (a list of blocks) to man.\norderedListItemToMan :: PandocMonad m\n                     => WriterOptions -- ^ options\n                     -> Text   -- ^ order marker for list item\n                     -> Int      -- ^ number of spaces to indent\n                     -> [Block]  -- ^ list item (list of blocks)\n                     -> StateT WriterState m (Doc Text)\norderedListItemToMan _ _ _ [] = return empty\norderedListItemToMan opts num indent (Para first:rest) =\n  orderedListItemToMan opts num indent (Plain first:rest)\norderedListItemToMan opts num indent (first:rest) = do\n  first' <- blockToMan opts first\n  rest' <- blockListToMan opts rest\n  let num' = printf (\"%\" ++ show (indent - 1) ++ \"s\") num\n  let first'' = literal (\".IP \\\"\" <> T.pack num' <> \"\\\" \" <> tshow indent) $$ first'\n  let rest''  = if null rest\n                   then empty\n                   else literal \".RS 4\" $$ rest' $$ literal \".RE\"\n  return $ first'' $$ rest''\n\n-- | Convert definition list item (label, list of blocks) to man.\ndefinitionListItemToMan :: PandocMonad m\n                        => WriterOptions\n                        -> ([Inline],[[Block]])\n                        -> StateT WriterState m (Doc Text)\ndefinitionListItemToMan opts (label, defs) = do\n  -- in most man pages, option and other code in option lists is boldface,\n  -- but not other things, so we try to reproduce this style:\n  labelText <- inlineListToMan opts label\n  contents <- if null defs\n                 then return empty\n                 else liftM vcat $ forM defs $ \\case\n                          (x:xs) -> do\n                            first' <- blockToMan opts $\n                                      case x of\n                                           Para y -> Plain y\n                                           _      -> x\n                            rest' <- liftM vcat $ mapM\n                                        (\\item -> blockToMan opts item) xs\n                            return $ first' $$\n                                     if null xs\n                                        then empty\n                                        else literal \".RS\" $$ rest' $$ literal \".RE\"\n                          [] -> return empty\n  return $ literal \".TP\" $$ nowrap labelText $$ contents\n\n-- | Convert list of Pandoc block elements to man.\nblockListToMan :: PandocMonad m\n               => WriterOptions -- ^ Options\n               -> [Block]       -- ^ List of block elements\n               -> StateT WriterState m (Doc Text)\nblockListToMan opts blocks =\n  vcat <$> mapM (blockToMan opts) (go blocks)\n where\n   -- Avoid .PP right after .SH; this is a no-op in groff man and mandoc\n   -- but may cause unwanted extra space in some renderers (see #9020)\n   go [] = []\n   go (h@Header{} : Para ils : rest) = h : Plain ils : go rest\n   go (x : xs) = x : go xs\n\n-- | Convert list of Pandoc inline elements to man.\ninlineListToMan :: PandocMonad m => WriterOptions -> [Inline] -> StateT WriterState m (Doc Text)\ninlineListToMan opts lst = hcat <$> mapM (inlineToMan opts) lst\n\n-- | Convert Pandoc inline element to man.\ninlineToMan :: PandocMonad m => WriterOptions -> Inline -> StateT WriterState m (Doc Text)\ninlineToMan opts (Span _ ils) = inlineListToMan opts ils\ninlineToMan opts (Emph lst) =\n  withFontFeature 'I' (inlineListToMan opts lst)\n-- Underline is not supported, so treat the same as Emph\ninlineToMan opts (Underline lst) =\n  withFontFeature 'I' (inlineListToMan opts lst)\ninlineToMan opts (Strong lst) =\n  withFontFeature 'B' (inlineListToMan opts lst)\ninlineToMan opts (Strikeout lst) = do\n  contents <- inlineListToMan opts lst\n  return $ literal \"[STRIKEOUT:\" <> contents <> char ']'\ninlineToMan opts (Superscript lst) = do\n  contents <- inlineListToMan opts lst\n  return $ char '^' <> contents <> char '^'\ninlineToMan opts (Subscript lst) = do\n  contents <- inlineListToMan opts lst\n  return $ char '~' <> contents <> char '~'\ninlineToMan opts (SmallCaps lst) = inlineListToMan opts lst -- not supported\ninlineToMan opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToMan opts lst\n  return $ char '`' <> contents <> char '\\''\ninlineToMan opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToMan opts lst\n  return $ literal \"\\\\(lq\" <> contents <> literal \"\\\\(rq\"\ninlineToMan opts (Cite _ lst) =\n  inlineListToMan opts lst\ninlineToMan opts (Code _ str) =\n  withFontFeature 'C' (return (literal $ escString opts str))\ninlineToMan opts (Str str@(T.uncons -> Just ('.',_))) =\n  return $ afterBreak \"\\\\&\" <> literal (escString opts str)\ninlineToMan opts (Str str) = return $ literal $ escString opts str\ninlineToMan opts (Math InlineMath str) =\n  lift (texMathToInlines InlineMath str) >>= inlineListToMan opts\ninlineToMan opts (Math DisplayMath str) = do\n  contents <- lift (texMathToInlines DisplayMath str) >>= inlineListToMan opts\n  return $ cr <> literal \".RS\" $$ contents $$ literal \".RE\"\ninlineToMan _ il@(RawInline f str)\n  | f == Format \"man\" = return $ literal str\n  | otherwise         = do\n      report $ InlineNotRendered il\n      return empty\ninlineToMan _ LineBreak = return $\n  cr <> literal \".PD 0\" $$ literal \".P\" $$ literal \".PD\" <> cr\ninlineToMan _ SoftBreak = return $ afterBreak \"\\\\\" <> space\ninlineToMan _ Space = return $ afterBreak \"\\\\\" <> space\ninlineToMan opts (Link _ txt (src, _))\n  | not (isURI src) = inlineListToMan opts txt -- skip relative links\n  | otherwise       = do\n  let srcSuffix = fromMaybe src (T.stripPrefix \"mailto:\" src)\n  linktext <- case txt of\n                [Str s] | escapeURI s == srcSuffix -> pure mempty\n                _ -> inlineListToMan opts txt\n  let (start, end) = if \"mailto:\" `T.isPrefixOf` src\n                        then (\".MT\", \".ME\")\n                        else (\".UR\", \".UE\")\n  return $ \"\\\\c\" <> cr -- \\c avoids extra space\n        $$ nowrap (start <+> literal srcSuffix)\n        $$ linktext\n        $$ (end <+> \"\\\\c\" <> cr)  -- \\c avoids space after\ninlineToMan opts (Image attr alternate (source, tit)) = do\n  let txt = if null alternate || (alternate == [Str \"\"]) ||\n               (alternate == [Str source]) -- to prevent autolinks\n               then [Str \"image\"]\n               else alternate\n  linkPart <- inlineToMan opts (Link attr txt (source, tit))\n  return $ char '[' <> literal \"IMAGE: \" <> linkPart <> char ']'\ninlineToMan _ (Note contents) = do\n  -- add to notes in state\n  modify $ \\st -> st{ stNotes = contents : stNotes st }\n  notes <- gets stNotes\n  let ref = tshow (length notes)\n  return $ char '[' <> literal ref <> char ']'\n\nformatSource :: WriterOptions -> FormatOptions -> [SourceLine] -> Doc Text\nformatSource wopts fopts = vcat . map (formatSourceLine wopts fopts)\n\nformatSourceLine :: WriterOptions -> FormatOptions -> SourceLine -> Doc Text\nformatSourceLine _wopts _fopts [] = blankline\nformatSourceLine wopts fopts ts@((_,firstTxt):_) =\n  (case T.uncons firstTxt of\n     Just ('.',_) -> literal \"\\\\&\"\n     _ -> mempty) <> mconcat (map (formatTok wopts fopts) ts) <> literal \"\\n\"\n\nformatTok :: WriterOptions -> FormatOptions -> (TokenType, Text) -> Doc Text\nformatTok wopts _fopts (toktype, t) =\n  let txt = literal (escString wopts t)\n      styleMap = case writerHighlightMethod wopts of\n        Skylighting style   -> Just $ tokenStyles style\n        DefaultHighlighting -> Just $ tokenStyles defaultStyle\n        _ -> Nothing\n      tokStyle = fromMaybe defStyle $ styleMap >>= M.lookup toktype\n  in  if toktype == NormalTok\n         then txt\n         else\n           let fonts = ['B' | tokenBold tokStyle] ++\n                       ['I' | tokenItalic tokStyle || tokenUnderline tokStyle]\n            in if null fonts\n                  then txt\n                  else literal (\"\\\\f[\" <> T.pack fonts <> \"]\") <>\n                       txt <>\n                       literal \"\\\\f[R]\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Markdown/Inline.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE ViewPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Writers.Markdown.Inline\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.Writers.Markdown.Inline (\n  inlineListToMarkdown,\n  linkAttributes,\n  attrsToMarkdown,\n  attrsToMarkua\n  ) where\nimport Control.Monad (when, liftM2)\nimport Control.Monad.Reader\n    ( asks, MonadReader(local) )\nimport Control.Monad.State.Strict\n    ( MonadState(get), gets, modify )\nimport Data.Char (isAlphaNum, isDigit)\nimport Data.List (find, intersperse)\nimport Data.List.NonEmpty (nonEmpty)\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (blankline, blanklines, char, space)\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI (urlEncode, escapeURI, isURI)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.HTML (writeHtml5String)\nimport Text.Pandoc.Writers.Math (texMathToInlines)\nimport Text.Pandoc.XML (toHtml5Entities)\nimport Data.Coerce (coerce)\nimport Text.Pandoc.Writers.Markdown.Types (MarkdownVariant(..),\n                                           WriterState(..),\n                                           WriterEnv(..), MD)\n\n-- | Escape special characters for Markdown.\nescapeText :: WriterOptions -> Text -> Text\nescapeText opts = T.pack . go' . T.unpack\n where\n  startsWithSpace (' ':_) = True\n  startsWithSpace ('\\t':_) = True\n  startsWithSpace [] = True\n  startsWithSpace _ = False\n  go' ('#':cs)\n    | isEnabled Ext_space_in_atx_header opts\n    = if startsWithSpace (dropWhile (=='#') cs)\n         then '\\\\':'#':go cs\n         else '#':go cs\n    | otherwise = '\\\\':'#':go cs\n  go' ('@':cs)\n    | isEnabled Ext_citations opts =\n        case cs of\n             (d:_)\n               | isAlphaNum d || d == '_' || d == '{'\n                  -> '\\\\':'@':go cs\n             _ -> '@':go cs\n  go' cs = go cs\n  go [] = []\n  go ['\\\\'] = ['\\\\','\\\\']\n  go ('-':'-':cs)\n    | isEnabled Ext_smart opts = '\\\\':'-':go('-':cs)\n  go ('.':'.':'.':cs)\n    | isEnabled Ext_smart opts = '\\\\':'.':'.':'.':go cs\n  go (c:'_':d:cs)\n    | isAlphaNum c\n    , isAlphaNum d =\n      if isEnabled Ext_intraword_underscores opts\n         then c:'_':go (d:cs)\n         else c:'\\\\':'_':go (d:cs)\n  go ('\\\\':c:cs)\n    | isEnabled Ext_raw_tex opts = '\\\\':'\\\\':go (c:cs)\n    | isAlphaNum c = '\\\\' : go (c:cs)\n    | otherwise = '\\\\':'\\\\': go cs\n  go ('!':'[':cs) = '\\\\':'!':'[': go cs\n  go ('=':'=':cs)\n    | isEnabled Ext_mark opts = '\\\\':'=':go ('=':cs)\n  go ('~':'~':cs)\n    | isEnabled Ext_strikeout opts = '\\\\':'~':go ('~':cs)\n  go ('&':cs)\n    | Right _ <- parse characterReference \"\" ('&':cs)\n    = '\\\\':'&': go cs\n  go (c:cs) =\n    case c of\n       '[' -> '\\\\':c:go cs\n       ']' -> '\\\\':c:go cs\n       '`' -> '\\\\':c:go cs\n       '*' -> '\\\\':c:go cs\n       '_' -> '\\\\':c:go cs\n       '>' | isEnabled Ext_all_symbols_escapable opts -> '\\\\':'>':go cs\n           | otherwise -> \"&gt;\" ++ go cs\n       '<' | isEnabled Ext_all_symbols_escapable opts -> '\\\\':'<':go cs\n           | otherwise -> \"&lt;\" ++ go cs\n       '|' | isEnabled Ext_pipe_tables opts -> '\\\\':'|':go cs\n       '^' | isEnabled Ext_superscript opts -> '\\\\':'^':go cs\n       '~' | isEnabled Ext_subscript opts -> '\\\\':'~':go cs\n       '$' | isEnabled Ext_tex_math_dollars opts -> '\\\\':'$':go cs\n       '\\'' | isEnabled Ext_smart opts -> '\\\\':'\\'':go cs\n       '\"' | isEnabled Ext_smart opts -> '\\\\':'\"':go cs\n       _   -> c : go cs\n\n-- Escape the escape character, as well as formatting pairs\nescapeMarkuaString :: Text -> Text\nescapeMarkuaString s = foldr (uncurry T.replace) s [(\"--\",\"~-~-\"),\n                        (\"**\",\"~*~*\"),(\"//\",\"~/~/\"),(\"^^\",\"~^~^\"),(\",,\",\"~,~,\")]\n\nattrsToMarkdown :: WriterOptions -> Attr -> Doc Text\nattrsToMarkdown opts attribs = braces $ hsep [attribId, attribClasses, attribKeys]\n        where attribId = case attribs of\n                                (\"\",_,_) -> empty\n                                (i,_,_)  -> \"#\" <> escAttr (writerIdentifierPrefix opts <> i)\n              attribClasses = case attribs of\n                                (_,[],_) -> empty\n                                (_,cs,_) -> hsep $\n                                            map (escAttr . (\".\"<>)) $\n                                            filter (not . T.null) cs\n              attribKeys = case attribs of\n                                (_,_,[]) -> empty\n                                (_,_,ks) -> hsep $\n                                            map (\\(k,v) -> escAttr k\n                                              <> \"=\\\"\" <>\n                                              escAttr v <> \"\\\"\") ks\n              escAttr          = mconcat . map escAttrChar . T.unpack\n              escAttrChar '\"'  = literal \"\\\\\\\"\"\n              escAttrChar '\\\\' = literal \"\\\\\\\\\"\n              escAttrChar c    = literal $ T.singleton c\n\nattrsToMarkua:: WriterOptions -> Attr -> Doc Text\nattrsToMarkua opts attributes\n     | null list = empty\n     | otherwise = braces $ intercalateDocText list\n        where attrId = case attributes of\n                        (\"\",_,_) -> []\n                        (i,_,_)  -> [literal $ \"id: \" <> writerIdentifierPrefix opts <> i]\n              -- all non explicit (key,value) attributes besides id are getting\n              -- a default class key to be Markua conform\n              attrClasses = case attributes of\n                             (_,[],_) -> []\n                             (_,classes,_) -> map (escAttr . (\"class: \" <>))\n                                classes\n              attrKeyValues = case attributes of\n                               (_,_,[]) -> []\n                               (_,_,keyvalues) -> map ((\\(k,v) -> escAttr k\n                                              <> \": \" <> escAttr v) .\n                                              preprocessKeyValues) keyvalues\n              escAttr          = mconcat . map escAttrChar . T.unpack\n              escAttrChar '\"'  = literal \"\\\"\"\n              escAttrChar c    = literal $ T.singleton c\n\n              list = concat [attrId, attrClasses, attrKeyValues]\n\n              -- if attribute key is alt, caption, title then content\n              -- gets wrapped inside quotes\n              -- attribute gets removed\n              preprocessKeyValues :: (Text, Text) -> (Text, Text)\n              preprocessKeyValues (key,value)\n                 | key == \"alt\" ||\n                   key == \"caption\" ||\n                   key == \"title\" = (key, inquotes value)\n                 | otherwise = (key,value)\n              intercalateDocText :: [Doc Text] -> Doc Text\n              intercalateDocText [] = empty\n              intercalateDocText [x] = x\n              intercalateDocText (x:xs) = x <> \", \" <> (intercalateDocText xs)\n\n-- | Add a (key, value) pair to Pandoc attr type\naddKeyValueToAttr :: Attr -> (Text,Text) -> Attr\naddKeyValueToAttr (ident,classes,kvs) (key,value)\n    | not (T.null key) && not (T.null value) = (ident,\n                                                classes,\n                                                (key,value): kvs)\n    | otherwise = (ident,classes,kvs)\n\nlinkAttributes :: WriterOptions -> Attr -> Doc Text\nlinkAttributes opts attr =\n  if (isEnabled Ext_link_attributes opts ||\n        isEnabled Ext_attributes opts) && attr /= nullAttr\n     then attrsToMarkdown opts attr\n     else empty\n\ngetKey :: Doc Text -> Key\ngetKey = toKey . render Nothing\n\nfindUsableIndex :: [Text] -> Int -> Int\nfindUsableIndex lbls i = if tshow i `elem` lbls\n                         then findUsableIndex lbls (i + 1)\n                         else i\n\ngetNextIndex :: PandocMonad m => MD m Int\ngetNextIndex = do\n  prevRefs <- gets stPrevRefs\n  refs <- gets stRefs\n  i <- (+ 1) <$> gets stLastIdx\n  modify $ \\s -> s{ stLastIdx = i }\n  let refLbls = map (\\(r,_,_) -> r) $ prevRefs ++ refs\n  return $ findUsableIndex refLbls i\n\n-- | Get reference for target; if none exists, create unique one and return.\n--   Prefer label if possible; otherwise, generate a unique key.\ngetReference :: PandocMonad m => Attr -> Doc Text -> Target -> MD m Text\ngetReference attr label target = do\n  refs <- gets stRefs\n  case find (\\(_,t,a) -> t == target && a == attr) refs of\n    Just (ref, _, _) -> return ref\n    Nothing       -> do\n      keys <- gets stKeys\n      let key = getKey label\n      let rawkey = coerce key\n      case M.lookup key keys of\n           Nothing -> do -- no other refs with this label\n             (lab', idx) <- if T.null rawkey ||\n                                 T.length rawkey > 999 ||\n                                 T.any (\\c -> c == '[' || c == ']') rawkey\n                               then do\n                                 i <- getNextIndex\n                                 return (tshow i, i)\n                               else\n                                 return (render Nothing label, 0)\n             modify (\\s -> s{\n               stRefs = (lab', target, attr) : refs,\n               stKeys = M.insert (getKey label)\n                           (M.insert (target, attr) idx mempty)\n                                 (stKeys s) })\n             return lab'\n\n           Just km ->    -- we have refs with this label\n             case M.lookup (target, attr) km of\n                  Just i -> do\n                    let lab' = render Nothing $\n                               label <> if i == 0\n                                           then mempty\n                                           else literal (tshow i)\n                    -- make sure it's in stRefs; it may be\n                    -- a duplicate that was printed in a previous\n                    -- block:\n                    when ((lab', target, attr) `notElem` refs) $\n                       modify (\\s -> s{\n                         stRefs = (lab', target, attr) : refs })\n                    return lab'\n                  Nothing -> do -- but this one is to a new target\n                    i <- getNextIndex\n                    let lab' = tshow i\n                    modify (\\s -> s{\n                       stRefs = (lab', target, attr) : refs,\n                       stKeys = M.insert key\n                                   (M.insert (target, attr) i km)\n                                         (stKeys s) })\n                    return lab'\n\n\n\n-- | Convert list of Pandoc inline elements to markdown.\ninlineListToMarkdown :: PandocMonad m => WriterOptions -> [Inline] -> MD m (Doc Text)\ninlineListToMarkdown opts ils = do\n    inlist <- asks envInList\n    avoidBadWraps inlist <$> go ils\n  where go [] = return empty\n        go (x@Math{}:y@(Str t):zs)\n          | T.all isDigit (T.take 1 t) -- starts with digit -- see #7058\n          = liftM2 (<>) (inlineToMarkdown opts x)\n              (go (RawInline (Format \"html\") \"<!-- -->\" : y : zs))\n        go (Str t : i : is)\n          | isLinkOrSpan i\n          , T.takeEnd 1 t == \"!\"\n          = do x <- inlineToMarkdown opts (Str (T.dropEnd 1 t))\n               ((x <> \"\\\\!\") <>) <$> go (i:is)\n        go (i:is) = case i of\n            Link {} -> case is of\n                -- If a link is followed by another link, or '[', '(' or ':'\n                -- then we don't shortcut\n                Link {}:_                                       -> unshortcutable\n                Space:Link {}:_                                 -> unshortcutable\n                Space:(Str(thead -> Just '[')):_                -> unshortcutable\n                Space:(RawInline _ (thead -> Just '[')):_       -> unshortcutable\n                Space:(Cite _ _):_                              -> unshortcutable\n                SoftBreak:Link {}:_                             -> unshortcutable\n                SoftBreak:(Str(thead -> Just '[')):_            -> unshortcutable\n                SoftBreak:(RawInline _ (thead -> Just '[')):_   -> unshortcutable\n                SoftBreak:(Cite _ _):_                          -> unshortcutable\n                LineBreak:Link {}:_                             -> unshortcutable\n                LineBreak:(Str(thead -> Just '[')):_            -> unshortcutable\n                LineBreak:(RawInline _ (thead -> Just '[')):_   -> unshortcutable\n                LineBreak:(Cite _ _):_                          -> unshortcutable\n                (Cite _ _):_                                    -> unshortcutable\n                Str (thead -> Just '['):_                       -> unshortcutable\n                Str (thead -> Just '('):_                       -> unshortcutable\n                Str (thead -> Just ':'):_                       -> unshortcutable\n                (RawInline _ (thead -> Just '[')):_             -> unshortcutable\n                (RawInline _ (thead -> Just '(')):_             -> unshortcutable\n                (RawInline _ (thead -> Just ':')):_             -> unshortcutable\n                (RawInline _ (T.stripPrefix \" [\" -> Just _ )):_ -> unshortcutable\n                _                                               -> shortcutable\n            _ -> shortcutable\n          where\n           shortcutable = liftM2 (<>) (inlineToMarkdown opts i) (go is)\n           unshortcutable = do\n               iMark <- local\n                        (\\env -> env { envRefShortcutable = False })\n                        (inlineToMarkdown opts i)\n               fmap (iMark <>) (go is)\n           thead = fmap fst . T.uncons\n        isLinkOrSpan Link{} = True\n        isLinkOrSpan Span{} = True\n        isLinkOrSpan _ = False\n\n-- Remove breaking spaces that might cause bad wraps.\navoidBadWraps :: Bool -> Doc Text -> Doc Text\navoidBadWraps inListItem = go . toList\n where\n  go [] = mempty\n  go (BreakingSpace : Text len t : BreakingSpace : xs)\n    = case T.uncons t of\n        Just (c,t')\n          | c == '>'\n             || ((c == '-' || c == '*' || c == '+') && T.null t')\n             || (inListItem && isOrderedListMarker t)\n             || (t == \"1.\" || t == \"1)\")\n            -> Text (len + 1) (\" \" <> t) <> go (BreakingSpace : xs)\n        _   -> BreakingSpace <> Text len t <> go (BreakingSpace : xs)\n  go (x:xs) = x <> go xs\n\n  toList (Concat (Concat a b) c) = toList (Concat a (Concat b c))\n  toList (Concat a b) = a : toList b\n  toList x = [x]\n\n-- | Convert Pandoc inline element to markdown.\ninlineToMarkdown :: PandocMonad m => WriterOptions -> Inline -> MD m (Doc Text)\ninlineToMarkdown opts (Span (\"\",[\"emoji\"],kvs) [Str s]) =\n  case lookup \"data-emoji\" kvs of\n       Just emojiname | isEnabled Ext_emoji opts ->\n            return $ \":\" <> literal emojiname <> \":\"\n       _ -> inlineToMarkdown opts (Str s)\ninlineToMarkdown opts (Span (\"\",[\"mark\"],[]) ils)\n  | isEnabled Ext_mark opts\n    = do contents <- inlineListToMarkdown opts ils\n         return $ \"==\" <> contents <> \"==\"\ninlineToMarkdown opts (Span attrs ils) = do\n  variant <- asks envVariant\n  contents <- inlineListToMarkdown opts ils\n  return $ case attrs of\n             (_,[\"csl-block\"],_) -> (cr <>)\n             (_,[\"csl-left-margin\"],_) -> (cr <>)\n             (_,[\"csl-indent\"],_) -> (cr <>)\n             _ -> id\n         $ case variant of\n                PlainText -> contents\n                Markua -> \"`\" <> contents <> \"`\" <> attrsToMarkua opts attrs\n                _     | attrs == nullAttr -> contents\n                      | isEnabled Ext_bracketed_spans opts ->\n                        let attrs' = if attrs /= nullAttr\n                                        then attrsToMarkdown opts attrs\n                                        else empty\n                        in \"[\" <> contents <> \"]\" <> attrs'\n                      | isEnabled Ext_raw_html opts ||\n                        isEnabled Ext_native_spans opts ->\n                        tagWithAttrs \"span\" attrs <> contents <> literal \"</span>\"\n                      | otherwise -> contents\ninlineToMarkdown _ (Emph []) = return empty\ninlineToMarkdown opts (Emph [Emph ils]) = -- #10642\n  inlineListToMarkdown opts ils\ninlineToMarkdown opts (Emph lst) = do\n  variant <- asks envVariant\n  contents <- inlineListToMarkdown opts lst\n  return $ case variant of\n             PlainText\n               | isEnabled Ext_gutenberg opts -> delimited \"_\" \"_\" contents\n               | otherwise ->  contents\n             _ -> delimited \"*\" \"*\" contents\ninlineToMarkdown _ (Underline []) = return empty\ninlineToMarkdown opts (Underline lst) = do\n  variant <- asks envVariant\n  contents <- inlineListToMarkdown opts lst\n  case variant of\n    PlainText -> return contents\n    _     | isEnabled Ext_bracketed_spans opts ->\n            return $ delimited \"[\" \"]{.underline}\" contents\n          | isEnabled Ext_native_spans opts ->\n            return $ tagWithAttrs \"span\" (\"\", [\"underline\"], [])\n              <> contents\n              <> literal \"</span>\"\n          | isEnabled Ext_raw_html opts ->\n            return $ \"<u>\" <> contents <> \"</u>\"\n          | otherwise -> inlineToMarkdown opts (Emph lst)\ninlineToMarkdown _ (Strong []) = return empty\ninlineToMarkdown opts (Strong lst) = do\n  variant <- asks envVariant\n  case variant of\n    PlainText ->\n             inlineListToMarkdown opts $\n               if isEnabled Ext_gutenberg opts\n                  then capitalize lst\n                  else lst\n    _ -> do\n       contents <- inlineListToMarkdown opts lst\n       return $ delimited \"**\" \"**\" contents\ninlineToMarkdown _ (Strikeout []) = return empty\ninlineToMarkdown opts (Strikeout lst) = do\n  contents <- inlineListToMarkdown opts lst\n  return $ if isEnabled Ext_strikeout opts\n              then delimited \"~~\" \"~~\" contents\n              else if isEnabled Ext_raw_html opts\n                       then \"<s>\" <> contents <> \"</s>\"\n                       else contents\ninlineToMarkdown _ (Superscript []) = return empty\ninlineToMarkdown opts (Superscript lst) =\n  local (\\env -> env {envEscapeSpaces = envVariant env == Markdown}) $ do\n    contents <- inlineListToMarkdown opts lst\n    if isEnabled Ext_superscript opts\n       then return $ delimited \"^\" \"^\" contents\n       else if isEnabled Ext_raw_html opts\n                then return $ \"<sup>\" <> contents <> \"</sup>\"\n                else\n                  case traverse toSuperscriptInline lst of\n                    Just xs' | not (writerPreferAscii opts)\n                      -> inlineListToMarkdown opts xs'\n                    _ -> do\n                      let rendered = render Nothing contents\n                      return $\n                        case mapM toSuperscript (T.unpack rendered) of\n                           Just r  -> literal $ T.pack r\n                           Nothing -> literal $ \"^(\" <> rendered <> \")\"\ninlineToMarkdown _ (Subscript []) = return empty\ninlineToMarkdown opts (Subscript lst) =\n  local (\\env -> env {envEscapeSpaces = envVariant env == Markdown}) $ do\n    contents <- inlineListToMarkdown opts lst\n    if isEnabled Ext_subscript opts\n       then return $ delimited \"~\" \"~\" contents\n       else if isEnabled Ext_raw_html opts\n                then return $ \"<sub>\" <> contents <> \"</sub>\"\n                else\n                  case traverse toSubscriptInline lst of\n                    Just xs' | not (writerPreferAscii opts)\n                      -> inlineListToMarkdown opts xs'\n                    _ -> do\n                      let rendered = render Nothing contents\n                      return $\n                        case mapM toSuperscript (T.unpack rendered) of\n                           Just r  -> literal $ T.pack r\n                           Nothing -> literal $ \"_(\" <> rendered <> \")\"\ninlineToMarkdown opts (SmallCaps lst) = do\n  variant <- asks envVariant\n  if variant /= PlainText &&\n     (isEnabled Ext_raw_html opts || isEnabled Ext_native_spans opts)\n     then inlineToMarkdown opts (Span (\"\",[\"smallcaps\"],[]) lst)\n     else inlineListToMarkdown opts $ capitalize lst\ninlineToMarkdown opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToMarkdown opts lst\n  return $ if isEnabled Ext_smart opts\n              then \"'\" <> contents <> \"'\"\n              else\n                if writerPreferAscii opts\n                   then \"&lsquo;\" <> contents <> \"&rsquo;\"\n                   else \"‘\" <> contents <> \"’\"\ninlineToMarkdown opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToMarkdown opts lst\n  return $ if isEnabled Ext_smart opts\n              then \"\\\"\" <> contents <> \"\\\"\"\n              else\n                if writerPreferAscii opts\n                   then \"&ldquo;\" <> contents <> \"&rdquo;\"\n                   else \"“\" <> contents <> \"”\"\ninlineToMarkdown opts (Code attr str) = do\n  variant <- asks envVariant\n  let tickGroups   = filter (T.any (== '`')) $ T.group str\n  let longest      = maybe 0 maximum $ nonEmpty $ map T.length tickGroups\n  let marker       = T.replicate (longest + 1) \"`\"\n  let spacer       = if longest == 0 then \"\" else \" \"\n  let attrsEnabled = isEnabled Ext_inline_code_attributes opts ||\n                     isEnabled Ext_attributes opts\n  let attrs = case variant of\n                       Markua -> attrsToMarkua opts attr\n                       _   -> if attrsEnabled && attr /= nullAttr\n                                        then attrsToMarkdown opts attr\n                                        else empty\n  case variant of\n     PlainText -> return $ literal str\n     _     ->  return $ literal\n                  (marker <> spacer <> str <> spacer <> marker) <> attrs\ninlineToMarkdown opts (Str str) = do\n  variant <- asks envVariant\n  let str' = case variant of\n                Markua -> escapeMarkuaString str\n                _ -> (if writerPreferAscii opts\n                        then toHtml5Entities\n                        else id) .\n                     (if isEnabled Ext_smart opts\n                        then unsmartify opts\n                        else id) .\n                     (if variant == PlainText\n                        then id\n                        else escapeText opts) $ str\n  return $ literal str'\ninlineToMarkdown opts (Math InlineMath str) = do\n  let str' = T.strip str\n  variant <- asks envVariant\n  case () of\n    _ | variant == Markua -> return $ \"`\" <> literal str <> \"`\" <> \"$\"\n      | otherwise -> case writerHTMLMathMethod opts of\n          WebTeX url ->\n             inlineToMarkdown opts\n                  (Image nullAttr [Str str'] (url <> urlEncode str', str'))\n          _ | isEnabled Ext_tex_math_gfm opts ->\n                return $ \"$`\" <> literal str' <> \"`$\"\n            | isEnabled Ext_tex_math_dollars opts ->\n                return $ \"$\" <> literal str' <> \"$\"\n            | isEnabled Ext_tex_math_single_backslash opts ->\n                return $ \"\\\\(\" <> literal str' <> \"\\\\)\"\n            | isEnabled Ext_tex_math_double_backslash opts ->\n                return $ \"\\\\\\\\(\" <> literal str' <> \"\\\\\\\\)\"\n            | otherwise ->\n                texMathToInlines InlineMath str' >>=\n                  inlineListToMarkdown opts .\n                    (if variant == PlainText then makeMathPlainer else id)\n\ninlineToMarkdown opts (Math DisplayMath str) = do\n  variant <- asks envVariant\n  case () of\n    _ | variant == Markua -> do\n        let attributes = attrsToMarkua opts (addKeyValueToAttr (\"\",[],[])\n                                                        (\"format\", \"latex\"))\n        return $ blankline <> attributes <> cr <> literal \"```\" <> cr\n            <> literal str <> cr <> literal \"```\" <> blankline\n      | otherwise -> case writerHTMLMathMethod opts of\n          WebTeX url ->\n            let str' = T.strip str\n             in (\\x -> blankline <> x <> blankline) `fmap`\n                 inlineToMarkdown opts (Image nullAttr [Str str']\n                        (url <> urlEncode str', str'))\n          _ | isEnabled Ext_tex_math_gfm opts ->\n                return $ cr <> (literal \"``` math\"\n                             $$ literal (T.dropAround (=='\\n') str)\n                             $$ literal \"```\") <> cr\n            | isEnabled Ext_tex_math_dollars opts ->\n                return $ \"$$\" <> literal str <> \"$$\"\n            | isEnabled Ext_tex_math_single_backslash opts ->\n                return $ \"\\\\[\" <> literal str <> \"\\\\]\"\n            | isEnabled Ext_tex_math_double_backslash opts ->\n                return $ \"\\\\\\\\[\" <> literal str <> \"\\\\\\\\]\"\n            | otherwise -> (\\x -> cr <> x <> cr) `fmap`\n                (texMathToInlines DisplayMath str >>= inlineListToMarkdown opts)\n\ninlineToMarkdown opts il@(RawInline f str) = do\n  let tickGroups = filter (T.any (== '`')) $ T.group str\n  let numticks   = 1 + maybe 0 maximum (nonEmpty (map T.length tickGroups))\n  variant <- asks envVariant\n  let Format fmt = f\n  let rawAttribInline = return $\n         literal (T.replicate numticks \"`\") <> literal str <>\n         literal (T.replicate numticks \"`\") <> literal \"{=\" <> literal fmt <> literal \"}\"\n  let renderEmpty = mempty <$ report (InlineNotRendered il)\n  case variant of\n    PlainText\n      | f == \"plain\" -> return $ literal str\n    Commonmark\n      | f `elem` [\"gfm\", \"commonmark\", \"commonmark_x\", \"markdown\"]\n         -> return $ literal str\n    Markdown\n      | f `elem` [\"markdown\", \"markdown_github\", \"markdown_phpextra\",\n                  \"markdown_mmd\", \"markdown_strict\"]\n         -> return $ literal str\n    Markua -> renderEmpty\n    _ | isEnabled Ext_raw_attribute opts -> rawAttribInline\n      | f `elem` [\"html\", \"html5\", \"html4\"]\n      , isEnabled Ext_raw_html opts\n         -> return $ literal str\n      | f `elem` [\"latex\", \"tex\"]\n      , isEnabled Ext_raw_tex opts\n         -> return $ literal str\n    _ -> renderEmpty\n\n\ninlineToMarkdown opts LineBreak = do\n  variant <- asks envVariant\n  if variant == PlainText || isEnabled Ext_hard_line_breaks opts\n     then return cr\n     else return $\n          if variant == Commonmark || isEnabled Ext_escaped_line_breaks opts\n             then \"\\\\\" <> cr\n             else \"  \" <> cr\ninlineToMarkdown _ Space = do\n  escapeSpaces <- asks envEscapeSpaces\n  return $ if escapeSpaces then \"\\\\ \" else space\ninlineToMarkdown opts SoftBreak = do\n  escapeSpaces <- asks envEscapeSpaces\n  let space' = if escapeSpaces then \"\\\\ \" else space\n  return $ case writerWrapText opts of\n                WrapNone     -> space'\n                WrapAuto     -> space'\n                WrapPreserve -> cr\ninlineToMarkdown opts (Cite [] lst) = inlineListToMarkdown opts lst\ninlineToMarkdown opts (Cite (c:cs) lst)\n  | not (isEnabled Ext_citations opts) = inlineListToMarkdown opts lst\n  | otherwise =\n      if citationMode c == AuthorInText\n         then do\n           suffs <- inlineListToMarkdown opts $ citationSuffix c\n           rest <- mapM convertOne cs\n           let inbr = suffs <>\n                      (if not (null (citationSuffix c)) && not (null rest)\n                          then text \";\"\n                          else mempty)\n                      <+> joincits rest\n               br   = if isEmpty inbr then empty else char '[' <> inbr <> char ']'\n           return $ literal (\"@\" <> maybeInBraces (citationId c)) <+> br\n         else do\n           cits <- mapM convertOne (c:cs)\n           return $ literal \"[\" <> joincits cits <> literal \"]\"\n  where\n        maybeInBraces key =\n          case readWith (citeKey False >> spaces >> eof)\n                 defaultParserState (\"@\" <> key) of\n            Left _  -> \"{\" <> key <> \"}\"\n            Right _ -> key\n        joincits = hcat . intersperse (literal \"; \") . filter (not . isEmpty)\n        convertOne Citation { citationId      = k\n                            , citationPrefix  = pinlines\n                            , citationSuffix  = sinlines\n                            , citationMode    = m }\n                               = do\n           pdoc <- inlineListToMarkdown opts pinlines\n           sdoc <- inlineListToMarkdown opts sinlines\n           let k' = literal (modekey m <> \"@\" <> maybeInBraces k)\n               r = case sinlines of\n                        Str (T.uncons -> Just (y,_)):_\n                          | y `elem` (\",;]@\" :: String) -> k' <> sdoc\n                        Space:_                         -> k' <> sdoc\n                        _                               -> k' <+> sdoc\n           return $ pdoc <+> r\n        modekey SuppressAuthor = \"-\"\n        modekey _              = \"\"\ninlineToMarkdown opts lnk@(Link attr@(ident,classes,kvs) txt (src, tit)) = do\n  variant <- asks envVariant\n  linktext <- inlineListToMarkdown opts txt\n  let linktitle = if T.null tit\n                     then empty\n                     else literal $ \" \\\"\" <> tit <> \"\\\"\"\n  let srcSuffix = fromMaybe src (T.stripPrefix \"mailto:\" src)\n  let useAuto = isURI src &&\n                T.null ident &&\n                null kvs &&\n               (null classes || classes == [\"uri\"] || classes == [\"email\"]) &&\n                case txt of\n                      [Str s] | escapeURI s == srcSuffix -> True\n                      _       -> False\n  let useWikilink = \"wikilink\" `elem` classes &&\n                    (isEnabled Ext_wikilinks_title_after_pipe opts ||\n                     isEnabled Ext_wikilinks_title_before_pipe opts)\n  let useRefLinks = writerReferenceLinks opts && not useAuto\n  shortcutable <- asks envRefShortcutable\n  let useShortcutRefLinks = shortcutable &&\n                             (variant == Commonmark ||\n                              isEnabled Ext_shortcut_reference_links opts)\n  reftext <- if useRefLinks\n                then literal <$> getReference attr linktext (src, tit)\n                else return mempty\n  case variant of\n    PlainText\n      | useAuto -> return $ literal srcSuffix\n      | otherwise -> return linktext\n    Markua\n      | T.null tit -> return $ result <> attrsToMarkua opts attr\n      | otherwise ->  return $ result <> attrsToMarkua opts attributes\n        where result = \"[\" <> linktext <> \"](\" <> (literal src) <> \")\"\n              attributes = addKeyValueToAttr attr (\"title\", tit)\n    -- Use wikilinks where possible\n    _ | src == stringify txt && useWikilink ->\n        return $ \"[[\" <> literal (stringify txt) <> \"]]\"\n      | useAuto -> return $ \"<\" <> literal srcSuffix <> \">\"\n      | useWikilink && isEnabled Ext_wikilinks_title_after_pipe opts -> return $\n        \"[[\" <> literal src <> \"|\" <> literal (stringify txt) <> \"]]\"\n      | useWikilink && isEnabled Ext_wikilinks_title_before_pipe opts -> return $\n        \"[[\" <> literal (stringify txt) <> \"|\" <> literal src <> \"]]\"\n      | useRefLinks ->\n           let first  = \"[\" <> linktext <> \"]\"\n               second = if getKey linktext == getKey reftext\n                           then if useShortcutRefLinks\n                                   then \"\"\n                                   else \"[]\"\n                           else \"[\" <> reftext <> \"]\"\n           in  return $ first <> second\n      | isEnabled Ext_raw_html opts\n      , not (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts)\n      , attr /= nullAttr -> -- use raw HTML to render attributes\n          literal . T.strip <$>\n            writeHtml5String opts{ writerTemplate = Nothing }\n            (Pandoc nullMeta [Plain [lnk]])\n      | otherwise -> return $\n         \"[\" <> linktext <> \"](\" <> literal src <> linktitle <> \")\" <>\n         linkAttributes opts attr\ninlineToMarkdown opts img@(Image attr alternate (source, tit))\n  | isEnabled Ext_raw_html opts &&\n    not (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts) &&\n    attr /= nullAttr = -- use raw HTML\n    literal . T.strip <$>\n      writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain [img]])\n  | otherwise = do\n  variant <- asks envVariant\n  let txt = if null alternate || alternate == [Str source]\n                                 -- to prevent autolinks\n               then [Str \"\"]\n               else alternate\n  linkPart <- inlineToMarkdown opts (Link attr txt (source, tit))\n  alt <- inlineListToMarkdown opts alternate\n  let attributes | variant == Markua = attrsToMarkua opts $\n            addKeyValueToAttr (addKeyValueToAttr attr (\"title\", tit))\n            (\"alt\", render (Just (writerColumns opts)) alt)\n                 | otherwise = empty\n  return $ case variant of\n                PlainText -> \"[\" <> linkPart <> \"]\"\n                Markua -> cr <> attributes <> cr <> literal \"![](\" <>\n                            literal source <> \")\" <> cr\n                _ -> \"!\" <> linkPart\ninlineToMarkdown opts (Note contents) = do\n  modify (\\st -> st{ stNotes = contents : stNotes st })\n  st <- get\n  let ref = literal $ writerIdentifierPrefix opts <> tshow (stNoteNum st + length (stNotes st) - 1)\n  if isEnabled Ext_footnotes opts\n     then return $ \"[^\" <> ref <> \"]\"\n     else return $ \"[\" <> ref <> \"]\"\n\nmakeMathPlainer :: [Inline] -> [Inline]\nmakeMathPlainer = walk go\n  where\n  go (Emph xs) = Span nullAttr xs\n  go x         = x\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Markdown/Table.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Writers.Markdown\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GPL-2.0-or-later\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n\nCreate Markdown pipe-tables and pandoc-style tables.\n-}\nmodule Text.Pandoc.Writers.Markdown.Table\n  ( pipeTable\n  , pandocTable\n  ) where\n\nimport Control.Monad.Reader (asks)\nimport Data.List (intersperse, transpose)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.DocLayout\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition (Alignment (..))\nimport Text.Pandoc.Options (WriterOptions (writerColumns, writerWrapText),\n                            WrapOption(WrapAuto))\nimport Text.Pandoc.Writers.Markdown.Types (MarkdownVariant(Markdown),\n                                           WriterEnv(..), MD)\n\n-- | Creates a Markdown pipe table.\npipeTable :: PandocMonad m\n          => WriterOptions\n          -> Bool            -- ^ headless?\n          -> [Alignment]     -- ^ column alignments\n          -> [Double]        -- ^ column widhts\n          -> [Doc Text]      -- ^ table header cells\n          -> [[Doc Text]]    -- ^ table body rows\n          -> MD m (Doc Text)\npipeTable opts headless aligns widths rawHeaders rawRows = do\n  let sp = literal \" \"\n  let contentWidths = map (max 3 . maybe 3 maximum . nonEmpty . map offset) $\n                       transpose (rawHeaders : rawRows)\n  let colwidth = writerColumns opts\n  let numcols = length contentWidths\n  let maxwidth = sum contentWidths\n  -- if cell contents are > COLUMNS, adding padding looks bad\n  let pad = maxwidth <= writerColumns opts\n  let blockFor _ _ y | not pad = sp <> y <> sp <> lblock 0 empty\n      blockFor AlignLeft   x y = lblock (x + 2) (sp <> y) <> lblock 0 empty\n      blockFor AlignCenter x y = cblock (x + 2) (sp <> y <> sp) <> lblock 0 empty\n      blockFor AlignRight  x y = rblock (x + 2) (y <> sp) <> lblock 0 empty\n      blockFor AlignDefault x y = lblock (x + 2) (sp <> y) <> lblock 0 empty\n  variant <- asks envVariant\n  let pipeWidths = if variant == Markdown &&\n                      not (all (== 0) widths) &&\n                      maxwidth + (numcols + 1) > colwidth\n                      then map\n                            (max 0 .\n                              floor .\n                                (* fromIntegral (colwidth - (numcols +1))))\n                            widths\n                      else if pad\n                              then contentWidths\n                              else map (const 2) widths\n  let torow cs = nowrap $ literal \"|\" <>\n                    hcat (intersperse (literal \"|\") $\n                          zipWith3 blockFor aligns contentWidths (map chomp cs))\n                    <> literal \"|\"\n  let toborder a w = literal $ case a of\n                          AlignLeft    -> \":\" <> T.replicate (w + 1) \"-\"\n                          AlignCenter  -> \":\" <> T.replicate w \"-\" <> \":\"\n                          AlignRight   -> T.replicate (w + 1) \"-\" <> \":\"\n                          AlignDefault -> T.replicate (w + 2) \"-\"\n  -- note:  pipe tables can't completely lack a\n  -- header; for a headerless table, we need a header of empty cells.\n  -- see jgm/pandoc#1996.\n  let header = if headless\n                  then torow (replicate (length aligns) empty)\n                  else torow rawHeaders\n  let border = nowrap $ literal \"|\" <> hcat (intersperse (literal \"|\") $\n                        zipWith toborder aligns pipeWidths) <> literal \"|\"\n  let body   = vcat $ map torow rawRows\n  return $ header $$ border $$ body\n\n-- | Write a pandoc-style Markdown table.\npandocTable :: PandocMonad m\n            => WriterOptions\n            -> Bool            -- ^ whether this is a multiline table\n            -> Bool            -- ^ whether the table has a header\n            -> [Alignment]     -- ^ column alignments\n            -> [Double]        -- ^ column widths\n            -> [Doc Text]      -- ^ table header cells\n            -> [[Doc Text]]    -- ^ table body rows\n            -> MD m (Doc Text)\npandocTable opts multiline headless aligns widths rawHeaders rawRows = do\n  let isSimple = all (==0) widths\n  let alignHeader alignment = case alignment of\n                                AlignLeft    -> lblock\n                                AlignCenter  -> cblock\n                                AlignRight   -> rblock\n                                AlignDefault -> lblock\n  -- Number of characters per column necessary to output every cell\n  -- without requiring a line break.\n  -- The @+2@ is needed for specifying the alignment.\n  let numChars    = (+ 2) . maybe 0 maximum . nonEmpty . map offset\n  -- Number of characters per column necessary to output every cell\n  -- without requiring a line break *inside a word*.\n  -- The @+2@ is needed for specifying the alignment.\n  let minNumChars = (+ 2) . maybe 0 maximum . nonEmpty . map minOffset\n  let columns = transpose (rawHeaders : rawRows)\n  -- minimal column width without wrapping a single word\n  let relWidth w col =\n         max (floor $ fromIntegral (writerColumns opts - 1) * w)\n             (if writerWrapText opts == WrapAuto\n                 then minNumChars col\n                 else numChars col)\n  let widthsInChars\n        | isSimple  = map numChars columns\n        | otherwise = zipWith relWidth widths columns\n  let makeRow = hcat . intersperse (lblock 1 (literal \" \")) .\n                   zipWith3 alignHeader aligns widthsInChars\n  let rows' = map makeRow rawRows\n  let head' = makeRow rawHeaders\n  let underline = mconcat $ intersperse (literal \" \") $\n                  map (\\width -> literal (T.replicate width \"-\")) widthsInChars\n  let border\n        | multiline = literal (T.replicate (sum widthsInChars +\n                        length widthsInChars - 1) \"-\")\n        | headless  = underline\n        | otherwise = empty\n  let head'' = if headless\n                  then empty\n                  else border <> cr <> head'\n  let body = if multiline\n                then vsep rows' $$\n                     if length rows' < 2\n                        then blankline -- #4578\n                        else empty\n                else vcat rows'\n  let bottom = if headless\n                  then underline\n                  else border\n  return $ head'' $$ underline $$ body $$ bottom\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Markdown/Types.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Writers.Markdown.Types\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n-}\nmodule Text.Pandoc.Writers.Markdown.Types (\n  MarkdownVariant(..),\n  WriterState(..),\n  WriterEnv(..),\n  Notes,\n  Ref,\n  Refs,\n  MD,\n  evalMD\n  ) where\nimport Control.Monad.Reader\nimport Control.Monad.State.Strict\nimport Data.Default\nimport qualified Data.Map as M\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport Text.Pandoc.Parsing (Key)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\n\ntype Notes = [[Block]]\ntype Ref   = (Text, Target, Attr)\ntype Refs  = [Ref]\n\ntype MD m = ReaderT WriterEnv (StateT WriterState m)\n\nevalMD :: PandocMonad m => MD m a -> WriterEnv -> WriterState -> m a\nevalMD md env st = evalStateT (runReaderT md env) st\n\ndata WriterEnv = WriterEnv { envInList          :: Bool\n                           , envVariant         :: MarkdownVariant\n                           , envRefShortcutable :: Bool\n                           , envBlockLevel      :: Int\n                           , envEscapeSpaces    :: Bool\n                           }\n\ndata MarkdownVariant =\n      Markua\n    | PlainText\n    | Commonmark\n    | Markdown\n    deriving (Show, Eq)\n\ninstance Default WriterEnv\n  where def = WriterEnv { envInList          = False\n                        , envVariant         = Markdown\n                        , envRefShortcutable = True\n                        , envBlockLevel      = 0\n                        , envEscapeSpaces    = False\n                        }\n\ndata WriterState = WriterState { stNotes   :: Notes\n                               , stPrevRefs :: Refs\n                               , stRefs    :: Refs\n                               , stKeys    :: M.Map Key\n                                                (M.Map (Target, Attr) Int)\n                               , stLastIdx  :: Int\n                               , stIds     :: Set.Set Text\n                               , stNoteNum :: Int\n                               }\n\ninstance Default WriterState\n  where def = WriterState{ stNotes = []\n                         , stPrevRefs = []\n                         , stRefs = []\n                         , stKeys = M.empty\n                         , stLastIdx = 0\n                         , stIds = Set.empty\n                         , stNoteNum = 1\n                         }\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Markdown.hs",
    "content": "{-# LANGUAGE MultiWayIf          #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections       #-}\n{-# LANGUAGE BangPatterns        #-}\n{- |\n   Module      : Text.Pandoc.Writers.Markdown\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to markdown-formatted plain text.\n\nMarkdown:  <https://daringfireball.net/projects/markdown/>\n-}\nmodule Text.Pandoc.Writers.Markdown (\n  writeMarkdown,\n  writeCommonMark,\n  writeMarkua,\n  writePlain) where\nimport Control.Monad (foldM, zipWithM, MonadPlus(..), when, liftM)\nimport Control.Monad.Reader ( asks, MonadReader(local) )\nimport Control.Monad.State.Strict ( gets, modify )\nimport Data.Default\nimport Data.List (intersperse, sortOn, union, find)\nimport Data.List.NonEmpty (nonEmpty, NonEmpty(..))\nimport qualified Data.Map as M\nimport Data.Maybe (fromMaybe, mapMaybe, isNothing)\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport Data.Char (isSpace)\nimport qualified Data.Text as T\nimport Text.HTML.TagSoup (Tag (..), isTagText, parseTags)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing hiding (blankline, blanklines, char, space)\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.DocTemplates (Val(..), Context(..), FromContext(..))\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.HTML (writeHtml5String)\nimport Text.Pandoc.Writers.Markdown.Inline (inlineListToMarkdown,\n                                            linkAttributes,\n                                            attrsToMarkdown,\n                                            attrsToMarkua)\nimport Text.Pandoc.Writers.Markdown.Table (pipeTable, pandocTable)\nimport Text.Pandoc.Writers.Markdown.Types (MarkdownVariant(..),\n                                           WriterState(..),\n                                           WriterEnv(..),\n                                           Ref, Refs, MD, evalMD)\n\n-- | Convert Pandoc to Markdown.\nwriteMarkdown :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteMarkdown opts document =\n  evalMD (pandocToMarkdown opts{\n             writerWrapText = if isEnabled Ext_hard_line_breaks opts\n                              then WrapNone\n                              else writerWrapText opts }\n             document) def def\n\n-- | Convert Pandoc to plain text (like markdown, but without links,\n-- pictures, or inline formatting).\nwritePlain :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwritePlain opts document =\n  evalMD (pandocToMarkdown opts document) def{ envVariant = PlainText } def\n\n-- | Convert Pandoc to Commonmark.\nwriteCommonMark :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteCommonMark opts document =\n  evalMD (pandocToMarkdown opts' document) def{ envVariant = Commonmark } def\n where\n  opts' = opts{ writerExtensions =\n                   -- These extensions can't be enabled or disabled\n                   -- for commonmark because they're part of the core;\n                   -- we set them here so that escapeText will behave\n                   -- properly.\n                   enableExtension Ext_all_symbols_escapable $\n                   enableExtension Ext_intraword_underscores $\n                     writerExtensions opts ,\n                writerWrapText =\n                  if isEnabled Ext_hard_line_breaks opts\n                     then WrapNone\n                     else writerWrapText opts }\n\n-- | Convert Pandoc to Markua.\nwriteMarkua :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteMarkua opts document =\n  evalMD (pandocToMarkdown opts' document) def{ envVariant = Markua } def\n where\n  opts' = opts{ writerExtensions =\n                  enableExtension Ext_hard_line_breaks $\n                  enableExtension Ext_pipe_tables $\n                  -- required for fancy list enumerators\n                  enableExtension Ext_fancy_lists $\n                  enableExtension Ext_startnum $\n                  enableExtension Ext_strikeout $\n                  enableExtension Ext_subscript $\n                  enableExtension Ext_superscript $\n                  enableExtension Ext_definition_lists $\n                  enableExtension Ext_smart $\n                  enableExtension Ext_footnotes\n                    mempty ,\n                writerWrapText =\n                  if isEnabled Ext_hard_line_breaks opts\n                     then WrapNone\n                     else writerWrapText opts }\n\n\npandocTitleBlock :: Doc Text -> [Doc Text] -> Doc Text -> Doc Text\npandocTitleBlock tit auths dat =\n  hang 2 (text \"% \") tit <> cr <>\n  hang 2 (text \"% \") (vcat $ map nowrap auths) <> cr <>\n  hang 2 (text \"% \") dat <> cr\n\nmmdTitleBlock :: Context Text -> Doc Text\nmmdTitleBlock (Context hashmap) =\n  vcat $ map go $ sortOn (T.toCaseFold . fst) $ M.toList hashmap\n  where go (k,v) =\n          case (text (T.unpack k), v) of\n               (k', ListVal xs)\n                 | null xs        -> empty\n                 | otherwise      -> k' <> \":\" <> space <>\n                                      hcat (intersperse \"; \" $\n                                            mapMaybe fromVal xs)\n               (k', SimpleVal x)\n                      | isEmpty x -> empty\n                      | otherwise -> k' <> \":\" <> space <>\n                                     nest 2 (removeBlankLines (chomp x))\n               _                  -> empty\n        removeBlankLines BlankLines{} = cr <> text \".\" <> cr\n        removeBlankLines (Concat x y) = removeBlankLines x <>\n                                        removeBlankLines y\n        removeBlankLines x            = x\n\nplainTitleBlock :: Doc Text -> [Doc Text] -> Doc Text -> Doc Text\nplainTitleBlock tit auths dat =\n  tit <> cr <>\n  hcat (intersperse (text \"; \") auths) <> cr <>\n  dat <> cr\n\nyamlMetadataBlock :: Context Text -> Doc Text\nyamlMetadataBlock v = \"---\" $$ contextToYaml v $$ \"---\"\n\ncontextToYaml :: Context Text -> Doc Text\ncontextToYaml (Context o) =\n  vcat $ map keyvalToYaml $ sortOn (T.toCaseFold . fst) $ M.toList o\n where\n  keyvalToYaml (k,v) =\n          case (text (T.unpack k), v) of\n               (k', ListVal vs)\n                 | null vs        -> empty\n                 | otherwise      -> (k' <> \":\") $$ valToYaml v\n               (k', MapVal (Context m))\n                 | M.null m       -> k' <> \": {}\"\n                 | otherwise      -> (k' <> \":\") $$ nest 2 (valToYaml v)\n               (_, SimpleVal x)\n                     | isEmpty x  -> empty\n               (_, NullVal)       -> empty\n               (k', _)            -> k' <> \":\" <+> hang 2 \"\" (valToYaml v)\n\nvalToYaml :: Val Text -> Doc Text\nvalToYaml (ListVal xs) =\n  vcat $ map (\\v -> hang 2 \"- \" (valToYaml v)) xs\nvalToYaml (MapVal c) = contextToYaml c\nvalToYaml (BoolVal True) = \"true\"\nvalToYaml (BoolVal False) = \"false\"\nvalToYaml (SimpleVal x)\n  | isEmpty x = empty\n  | otherwise =\n      if hasNewlines x\n         then hang 0 (\"|\" <> cr) x\n         else case x of\n                Text _ t | isSpecialString t ->\n                         \"\\\"\" <> fmap escapeInDoubleQuotes x <> \"\\\"\"\n                _ | isNothing (foldM needsDoubleQuotes True x) ->\n                         \"\\\"\" <> fmap escapeInDoubleQuotes x <> \"\\\"\"\n                  | otherwise -> x\n    where\n      isSpecialString t = Set.member t specialStrings\n      specialStrings = Set.fromList\n       [\"y\", \"Y\", \"yes\", \"Yes\", \"YES\", \"n\", \"N\",\n        \"no\", \"No\", \"NO\", \"true\", \"True\", \"TRUE\",\n        \"false\", \"False\", \"FALSE\", \"on\", \"On\", \"ON\",\n        \"off\", \"Off\", \"OFF\", \"null\", \"Null\",\n        \"NULL\", \"~\", \"*\"]\n      needsDoubleQuotes isFirst t\n        = if T.any isBadAnywhere t ||\n             (isFirst && T.any isYamlPunct (T.take 1 t))\n              then Nothing\n              else Just False\n      isBadAnywhere '#' = True\n      isBadAnywhere ':' = True\n      isBadAnywhere _   = False\n      hasNewlines NewLine = True\n      hasNewlines BlankLines{} = True\n      hasNewlines CarriageReturn = True\n      hasNewlines (Concat w z) = hasNewlines w || hasNewlines z\n      hasNewlines _ = False\n      isYamlPunct = (`elem` ['-','?',':',',','[',']','{','}',\n                             '#','&','*','!','|','>','\\'','\"', '%','@','`'])\n      escapeInDoubleQuotes = T.replace \"\\\"\" \"\\\\\\\"\" . T.replace \"\\\\\" \"\\\\\\\\\"\nvalToYaml _ = empty\n\n-- | Return markdown representation of document.\npandocToMarkdown :: PandocMonad m => WriterOptions -> Pandoc -> MD m Text\npandocToMarkdown opts (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  variant <- asks envVariant\n  metadata <- metaToContext'\n               (blockListToMarkdown opts)\n               (inlineListToMarkdown opts)\n               meta\n  let title' = fromMaybe empty $ getField \"title\" metadata\n  let authors' = fromMaybe [] $ getField \"author\" metadata\n  let date' = fromMaybe empty $ getField \"date\" metadata\n  let titleblock = case writerTemplate opts of\n                        Just _ | variant == PlainText ->\n                                 plainTitleBlock title' authors' date'\n                               | isEnabled Ext_yaml_metadata_block opts ->\n                                   yamlMetadataBlock metadata\n                               | isEnabled Ext_pandoc_title_block opts ->\n                                   pandocTitleBlock title' authors' date'\n                               | isEnabled Ext_mmd_title_block opts ->\n                                   mmdTitleBlock metadata\n                               | otherwise -> empty\n                        Nothing -> empty\n  let modifyTOC =\n        if isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts\n        then id\n        else walk $ \\inln -> case inln of\n          Link _attr contents tgt -> Link nullAttr contents tgt\n          _                       -> inln\n  toc <- if writerTableOfContents opts\n         then blockToMarkdown opts . modifyTOC $ toTableOfContents opts blocks\n         else return mempty\n  -- Strip off final 'references' header if markdown citations enabled\n  let blocks' = if isEnabled Ext_citations opts\n                   then case reverse blocks of\n                             (Div (\"refs\",_,_) _):xs -> reverse xs\n                             _                       -> blocks\n                   else blocks\n  body <- blockListToMarkdown opts blocks'\n  notesAndRefs' <- notesAndRefs opts\n  let main = body <> notesAndRefs'\n  let context  = -- for backwards compatibility we populate toc\n                 -- with the contents of the toc, rather than a\n                 -- boolean:\n                 defField \"toc\" toc\n               $ defField \"table-of-contents\" toc\n               $ defField \"body\" main\n               $ (if isNullMeta meta\n                     then id\n                     else defField \"titleblock\" titleblock)\n               $ addVariablesToContext opts metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\n-- | Return markdown representation of reference key table.\nrefsToMarkdown :: PandocMonad m => WriterOptions -> Refs -> MD m (Doc Text)\nrefsToMarkdown opts refs = vcat <$> mapM (keyToMarkdown opts) refs\n\n-- | Return markdown representation of a reference key.\nkeyToMarkdown :: PandocMonad m\n              => WriterOptions\n              -> Ref\n              -> MD m (Doc Text)\nkeyToMarkdown opts (label', (src, tit), attr) = do\n  let tit' = if T.null tit\n                then empty\n                else space <> \"\\\"\" <> literal tit <> \"\\\"\"\n  return $ nest 2 $ hang 2\n            (\"[\" <> literal label' <> \"]:\" <> space) (literal src <> tit')\n            <+> linkAttributes opts attr\n\n-- | Return markdown representation of notes.\nnotesToMarkdown :: PandocMonad m => WriterOptions -> [[Block]] -> MD m (Doc Text)\nnotesToMarkdown opts notes = do\n  n <- gets stNoteNum\n  notes' <- zipWithM (noteToMarkdown opts) [n..] notes\n  modify $ \\st -> st { stNoteNum = stNoteNum st + length notes }\n  return $ vsep notes'\n\n-- | Return markdown representation of a note.\nnoteToMarkdown :: PandocMonad m => WriterOptions -> Int -> [Block] -> MD m (Doc Text)\nnoteToMarkdown opts num blocks = do\n  contents  <- blockListToMarkdown opts blocks\n  let num' = literal $ writerIdentifierPrefix opts <> tshow num\n  let marker = if isEnabled Ext_footnotes opts\n                  then literal \"[^\" <> num' <> literal \"]:\"\n                  else literal \"[\" <> num' <> literal \"]\"\n  let markerSize = 4 + offset num'\n  let hspacer = case writerTabStop opts - markerSize of\n                      n | n > 0  -> literal $ T.replicate n \" \"\n                      _ -> literal \" \"\n  let spacer = case blocks of\n                    Para{}:_ -> hspacer\n                    Plain{}:_ -> hspacer\n                    _ -> cr\n  return $ if isEnabled Ext_footnotes opts\n              then hang (writerTabStop opts) (marker <> spacer) contents\n              else marker <> spacer <> contents\n\n-- | (Code) blocks with a single class and no attributes can just use it\n-- standalone, no need to bother with curly braces.\nclassOrAttrsToMarkdown :: WriterOptions -> Attr -> Doc Text\nclassOrAttrsToMarkdown _ (\"\",[cls],[]) = literal cls\nclassOrAttrsToMarkdown opts attrs = attrsToMarkdown opts attrs\n\n-- | Ordered list start parser for use in Para below.\nolMarker :: Parsec Text ParserState ()\nolMarker = do (start, style', delim) <- anyOrderedListMarker\n              if delim == Period &&\n                          (style' == UpperAlpha || (style' == UpperRoman &&\n                          start `elem` [1, 5, 10, 50, 100, 500, 1000]))\n                          then mzero -- it needs 2 spaces anyway\n                          else eof\n\n-- | True if string begins with an ordered list marker\nbeginsWithOrderedListMarker :: Text -> Bool\nbeginsWithOrderedListMarker str =\n  case runParser olMarker defaultParserState \"para start\" (T.take 10 str) of\n         Left  _ -> False\n         Right _ -> True\n\nnotesAndRefs :: PandocMonad m => WriterOptions -> MD m (Doc Text)\nnotesAndRefs opts = do\n  notes' <- gets stNotes >>= notesToMarkdown opts . reverse\n  modify $ \\s -> s { stNotes = [] }\n  refs' <- gets stRefs >>= refsToMarkdown opts . reverse\n  modify $ \\s -> s { stPrevRefs = stPrevRefs s ++ stRefs s\n                   , stRefs = []}\n\n  let endSpacing =\n        if | writerReferenceLocation opts == EndOfDocument -> empty\n           | isEmpty notes' && isEmpty refs' -> empty\n           | otherwise -> blankline\n\n  return $\n    (if isEmpty notes' then empty else blankline <> notes') <>\n    (if isEmpty refs' then empty else blankline <> refs') <>\n    endSpacing\n\n-- | Convert Pandoc block element to markdown.\nblockToMarkdown :: PandocMonad m\n                => WriterOptions -- ^ Options\n                -> Block         -- ^ Block element\n                -> MD m (Doc Text)\nblockToMarkdown opts blk =\n  local (\\env -> env {envBlockLevel = envBlockLevel env + 1}) $\n  do doc <- blockToMarkdown' opts blk\n     blkLevel <- asks envBlockLevel\n     if writerReferenceLocation opts == EndOfBlock && blkLevel == 1\n       then notesAndRefs opts >>= (\\d -> return $ doc <> d)\n       else return doc\n\nblockToMarkdown' :: PandocMonad m\n                 => WriterOptions -- ^ Options\n                 -> Block         -- ^ Block element\n                 -> MD m (Doc Text)\nblockToMarkdown' opts (Div attrs@(_,classes,_) bs)\n  | (\"sourceCode\":_) <- classes\n  , [CodeBlock (_,\"sourceCode\":_,_) _] <- bs\n     -- skip pandoc-generated Div wrappers around code blocks\n   = blockListToMarkdown opts bs\n  | isEnabled Ext_alerts opts\n  , (cls:_) <- classes\n  , cls `elem` [\"note\", \"tip\", \"warning\", \"caution\", \"important\"]\n  , (Div (\"\", [\"title\"], []) _ : bs') <- bs = do\n    contents <- blockListToMarkdown opts bs'\n    let alertLabel = literal $ \"[!\" <> T.toUpper cls <> \"]\"\n    pure $ text \"> \" <> alertLabel $$ prefixed \"> \" contents $$ blankline\n  | otherwise = do\n    contents <- blockListToMarkdown opts bs\n    variant <- asks envVariant\n    return $\n       case () of\n           _ | variant == Markua ->\n                 case () of\n                      () | \"blurb\" `elem` classes'\n                           -> prefixed \"B> \" contents <> blankline\n                         | \"aside\" `elem` classes'\n                           -> prefixed \"A> \" contents <> blankline\n                         -- necessary to enable option to create a bibliography\n                         | (take 3 (T.unpack id')) == \"ref\"\n                           -> contents <> blankline\n                         | otherwise -> contents <> blankline\n             | isEnabled Ext_fenced_divs opts ->\n                  let attrsToMd = if variant == Commonmark\n                                  then attrsToMarkdown opts\n                                  else classOrAttrsToMarkdown opts\n                      divNesting = computeDivNestingLevel bs\n                      numcolons = 3 + divNesting\n                      colons = literal $ T.replicate numcolons \":\"\n                  in nowrap (colons <+> attrsToMd attrs) $$\n                     chomp contents $$\n                     colons <> blankline\n             | isEnabled Ext_native_divs opts ||\n               (isEnabled Ext_raw_html opts &&\n                (variant == Commonmark ||\n                 isEnabled Ext_markdown_in_html_blocks opts)) ->\n                  tagWithAttrs \"div\" attrs <> blankline <>\n                  contents <> blankline <> \"</div>\" <> blankline\n             | isEnabled Ext_raw_html opts &&\n               isEnabled Ext_markdown_attribute opts ->\n                  tagWithAttrs \"div\" attrs' <> blankline <>\n                  contents <> blankline <> \"</div>\" <> blankline\n             | otherwise -> contents <> blankline\n         where (id',classes',kvs') = attrs\n               attrs' = (id',classes',(\"markdown\",\"1\"):kvs')\nblockToMarkdown' opts (Plain inlines) = do\n  -- escape if para starts with ordered list marker\n  variant <- asks envVariant\n  let escapeMarker = T.concatMap $ \\x -> if T.any (== x) \".()\"\n                                         then T.pack ['\\\\', x]\n                                         else T.singleton x\n  let startsWithSpace (Space:_)     = True\n      startsWithSpace (SoftBreak:_) = True\n      startsWithSpace _             = False\n  let inlines' =\n        if variant == PlainText\n           then inlines\n           else case inlines of\n                  (Str t:ys)\n                    | null ys || startsWithSpace ys\n                    , beginsWithOrderedListMarker t\n                    -> RawInline (Format \"markdown\") (escapeMarker t):ys\n                  (Str t:_)\n                    | t == \"+\" || t == \"-\" ||\n                      (t == \"%\" && isEnabled Ext_pandoc_title_block opts &&\n                                   isEnabled Ext_all_symbols_escapable opts)\n                    -> RawInline (Format \"markdown\") \"\\\\\" : inlines\n                  _ -> inlines\n  contents <- inlineListToMarkdown opts inlines'\n  return $ contents <> cr\nblockToMarkdown' opts (Para inlines) =\n  (<> blankline) `fmap` blockToMarkdown opts (Plain inlines)\nblockToMarkdown' opts (LineBlock lns) = do\n  variant <- asks envVariant\n  case variant of\n    PlainText -> do\n      let emptyToBlank l = if isEmpty l then blankline else l\n      mdLines <- mapM (liftM emptyToBlank . inlineListToMarkdown opts) lns\n      return $ vcat mdLines <> blankline\n    _ ->\n      if isEnabled Ext_line_blocks opts\n      then do\n        mdLines <- mapM (inlineListToMarkdown opts) lns\n        return $ vcat (map (hang 2 (literal \"| \")) mdLines) <> blankline\n      else blockToMarkdown opts $ linesToPara lns\nblockToMarkdown' opts b@(RawBlock f str) = do\n  variant <- asks envVariant\n  let Format fmt = f\n  let rawAttribBlock = return $\n         (literal \"```{=\" <> literal fmt <> \"}\") $$\n         literal str $$\n         (literal \"```\" <> literal \"\\n\")\n  let renderEmpty = mempty <$ report (BlockNotRendered b)\n  case variant of\n    PlainText\n      | f == \"plain\" -> return $ nest 0 (literal str) <> literal \"\\n\"\n    Commonmark\n      | f `elem` [\"gfm\", \"commonmark\", \"commonmark_x\", \"markdown\"]\n         -> return $ nest 0 (literal str) $$ blankline\n      | f `elem` [\"html\", \"html5\", \"html4\"]\n         -> return $ literal (removeBlankLinesInHTML str) $$ blankline\n    Markdown\n      | f `elem` [\"markdown\", \"markdown_github\", \"markdown_phpextra\",\n                  \"markdown_mmd\", \"markdown_strict\"]\n        -- the 'nest 0' ensures that leading and trailing newlines\n        -- don't get collapsed. See #10477 for context;\n         -> return $ nest 0 (literal str) <> literal \"\\n\"\n    Markua -> renderEmpty\n    _ | f `elem` [\"html\", \"html5\", \"html4\"]\n      , isEnabled Ext_markdown_attribute opts\n         -> return $ literal (addMarkdownAttribute str) <> literal \"\\n\"\n      | f `elem` [\"html\", \"html5\", \"html4\"]\n      , isEnabled Ext_raw_html opts\n         -> return $ literal str <> literal \"\\n\"\n      | f `elem` [\"latex\", \"tex\"]\n      , isEnabled Ext_raw_tex opts\n         -> return $ literal str <> literal \"\\n\"\n      | isEnabled Ext_raw_attribute opts -> rawAttribBlock\n    _ -> renderEmpty\nblockToMarkdown' opts HorizontalRule = do\n  variant <- asks envVariant\n  let indicator = case variant of\n                        Markua -> \"* * *\"\n                        _ -> T.replicate (writerColumns opts) \"-\"\n  return $ blankline <> literal indicator <> blankline\nblockToMarkdown' opts (Header level attr inlines) = do\n  -- first, if we're putting references at the end of a section, we\n  -- put them here.\n  blkLevel <- asks envBlockLevel\n  refs <- if writerReferenceLocation opts == EndOfSection && blkLevel == 1\n          then notesAndRefs opts\n          else return empty\n  variant <- asks envVariant\n  -- we calculate the id that would be used by auto_identifiers\n  -- or gfm_auto_identifiers\n  -- so we know whether to print an explicit identifier\n  ids <- gets stIds\n  let autoId = uniqueIdent (writerExtensions opts) inlines ids\n  modify $ \\st -> st{ stIds = Set.insert autoId ids }\n  let attr' = case attr of\n                   (\"\",[],[]) -> empty\n                   (id',[],[]) | (isEnabled Ext_auto_identifiers opts\n                                  || isEnabled Ext_gfm_auto_identifiers opts)\n                                 && id' == autoId -> empty\n                   (id',_,_)   | isEnabled Ext_mmd_header_identifiers opts ->\n                                    space <> brackets (literal id')\n                   _ | variant == Markua -> attrsToMarkua opts attr\n                     | isEnabled Ext_header_attributes opts ||\n                       isEnabled Ext_attributes opts ->\n                                    space <> attrsToMarkdown opts attr\n                     | otherwise -> empty\n  let setext = level <= 2 && writerSetextHeaders opts ||\n                              (variant == Commonmark &&\n                               hasLineBreaks inlines) -- #11341\n  contents <- inlineListToMarkdown opts $\n                 (if variant == Commonmark && setext\n                     then id\n                     else -- ensure no newlines; see #3736\n                          walk lineBreakToSpace) $\n                   if level == 1 && variant == PlainText &&\n                      isEnabled Ext_gutenberg opts\n                      then capitalize inlines\n                      else inlines\n\n  when (not setext && isEnabled Ext_literate_haskell opts) $\n    report $ ATXHeadingInLHS level (render Nothing contents)\n\n  let hdr = nowrap $ case level of\n            1 | variant == PlainText ->\n                if isEnabled Ext_gutenberg opts\n                   then blanklines 3 <> contents <> blanklines 2\n                   else contents <> blankline\n              | setext ->\n                  contents <> attr' <> cr <> literal (T.replicate (offset contents) \"=\") <>\n                  blankline\n            2 | variant == PlainText ->\n                if isEnabled Ext_gutenberg opts\n                   then blanklines 2 <> contents <> blankline\n                   else contents <> blankline\n              | setext ->\n                  contents <> attr' <> cr <> literal (T.replicate (offset contents) \"-\") <>\n                  blankline\n            -- ghc interprets '#' characters in column 1 as linenum specifiers.\n            _ | variant == PlainText || isEnabled Ext_literate_haskell opts ->\n                contents <> blankline\n            _ | variant == Markua -> attr' <> cr <> literal (T.replicate level \"#\")\n                                        <> space <> contents <> blankline\n            _ -> literal (T.replicate level \"#\") <> space <> contents <> attr' <> blankline\n\n  return $ refs <> hdr\nblockToMarkdown' opts (CodeBlock (_,classes,_) str)\n  | \"haskell\" `elem` classes && \"literate\" `elem` classes &&\n    isEnabled Ext_literate_haskell opts =\n  return $ prefixed \"> \" (literal str) <> blankline\nblockToMarkdown' opts (CodeBlock attribs str) = do\n  variant <- asks envVariant\n  return $\n   case attribs == nullAttr of\n     False | variant == Commonmark ||\n             isEnabled Ext_backtick_code_blocks opts ->\n          backticks <> attrs <> cr <> literal str <> cr <> backticks <> blankline\n           | isEnabled Ext_fenced_code_blocks opts ->\n          tildes <> attrs <> cr <> literal str <> cr <> tildes <> blankline\n     _ | variant == Markua -> blankline <> attrsToMarkua opts attribs <> cr <> backticks <> cr <>\n                                literal str <> cr <> backticks <> cr <> blankline\n       | otherwise -> nest (writerTabStop opts) (literal str) <> blankline\n   where\n     endlineLen c = maybe 3 ((+1) . maximum) $ nonEmpty\n                        [T.length ln\n                         | ln <- map trim (T.lines str)\n                         , T.pack [c,c,c] `T.isPrefixOf` ln\n                         , T.all (== c) ln]\n     endline c = literal $ T.replicate (endlineLen c) $ T.singleton c\n     backticks = endline '`'\n     tildes = endline '~'\n     attrs  = if isEnabled Ext_fenced_code_attributes opts ||\n                 isEnabled Ext_attributes opts\n                 then nowrap $ \" \" <> classOrAttrsToMarkdown opts attribs\n                 else\n                   let (_,cls,_) = attribs\n                    in case getLangFromClasses cls of\n                              Just l -> \" \" <> literal l\n                              Nothing -> empty\nblockToMarkdown' opts (BlockQuote blocks) = do\n  variant <- asks envVariant\n  -- if we're writing literate haskell, put a space before the bird tracks\n  -- so they won't be interpreted as lhs...\n  let leader\n        | isEnabled Ext_literate_haskell opts = \" > \"\n        | variant == PlainText = \"  \"\n        | otherwise            = \"> \"\n  contents <- blockListToMarkdown opts blocks\n  return $ text leader <> prefixed leader contents <> blankline\nblockToMarkdown' opts t@(Table attr blkCapt specs thead tbody tfoot) = do\n  let (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  let isColRowSpans (Cell _ _ rs cs _) = rs > 1 || cs > 1\n  let rowHasColRowSpans (Row _ cs) = any isColRowSpans cs\n  let hasFooter = case tfoot of\n                    TableFoot _ [] -> False\n                    _ -> True\n  let tbodyHasColRowSpans (TableBody _ _ rhs rs) =\n        any rowHasColRowSpans rhs || any rowHasColRowSpans rs\n  let theadHasColRowSpans (TableHead _ rs) = any rowHasColRowSpans rs\n  let tfootHasColRowSpans (TableFoot _ rs) = any rowHasColRowSpans rs\n  let hasColRowSpans = theadHasColRowSpans thead ||\n                       any tbodyHasColRowSpans tbody ||\n                       tfootHasColRowSpans tfoot\n  let numcols = maximum (length aligns :| length widths :\n                           map length (headers:rows))\n  caption' <- inlineListToMarkdown opts caption\n  let caption'' = if attr == nullAttr\n                     then caption'\n                     else caption' <+> attrsToMarkdown opts attr\n  let caption'''\n        | null caption = blankline\n        | isEnabled Ext_table_captions opts\n        = blankline $$ (\": \" <> caption'') $$ blankline\n        | otherwise = blankline $$ caption'' $$ blankline\n  let hasSimpleCells = onlySimpleTableCells $ headers : rows\n  let isSimple = hasSimpleCells && not hasFooter &&\n                 all (==0) widths && not hasColRowSpans\n  let isPlainBlock (Plain _) = True\n      isPlainBlock _         = False\n  let hasBlocks = not (all (all (all isPlainBlock)) $ headers:rows)\n  let padRow r = case numcols - length r of\n                       x | x > 0 -> r ++ replicate x empty\n                         | otherwise -> r\n  let aligns' = case numcols - length aligns of\n                     x | x > 0 -> aligns ++ replicate x AlignDefault\n                       | otherwise -> aligns\n  let widths' = case numcols - length widths of\n                     x | x > 0 -> widths ++ replicate x 0.0\n                       | otherwise -> widths\n  let mkTable f = do\n       rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers\n       rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts)) rows\n       f (all null headers) aligns' widths' rawHeaders rawRows\n  case True of\n     _ | isSimple &&\n         isEnabled Ext_simple_tables opts -> do\n           tbl <- mkTable (pandocTable opts False)\n           return $ nest 2 (tbl $$ caption''') $$ blankline\n       | isSimple &&\n         isEnabled Ext_pipe_tables opts -> do\n           tbl <- mkTable (pipeTable opts)\n           return $ (tbl $$ caption''') $$ blankline\n       | not (hasBlocks || hasColRowSpans || hasFooter) &&\n         isEnabled Ext_multiline_tables opts -> do\n           tbl <- mkTable (pandocTable opts True)\n           return $ nest 2 (tbl $$ caption''') $$ blankline\n       | isEnabled Ext_grid_tables opts &&\n          (hasColRowSpans || writerColumns opts >= 8 * numcols\n                          || hasFooter) -> do\n           tbl <- gridTable opts blockListToMarkdown\n                     specs thead tbody tfoot\n           return $ (tbl $$ caption''') $$ blankline\n       | hasSimpleCells,\n         not hasColRowSpans,\n         isEnabled Ext_pipe_tables opts -> do\n           tbl <- mkTable (pipeTable opts)\n           return $ (tbl $$ caption''') $$ blankline\n       | isEnabled Ext_raw_html opts -> do -- HTML fallback\n           tbl <- literal . removeBlankLinesInHTML <$>\n                     writeHtml5String opts{ writerTemplate = Nothing }\n                     (Pandoc nullMeta [t])\n           return $ tbl $$ blankline  -- caption is in the HTML table\n       | hasSimpleCells,\n         hasColRowSpans,\n         isEnabled Ext_pipe_tables opts -> do\n           -- In this case an approximate pipe table will be rendered,\n           -- without col/row spans. This is better than nothing, since\n           -- we have no other way to render the table correctly (#11128).\n           tbl <- mkTable (pipeTable opts)\n           return $ (tbl $$ caption''') $$ blankline\n       | otherwise\n         -> do\n           report (BlockNotRendered t)\n           return $ (literal \"[TABLE]\" $$ caption''') $$ blankline\nblockToMarkdown' opts (BulletList items) = do\n  contents <- inList $ mapM (bulletListItemToMarkdown opts) items\n  return $ (if isTightList items then vcat else vsep)\n                  contents <> blankline\nblockToMarkdown' opts (OrderedList (start,sty,delim) items) = do\n  variant <- asks envVariant\n  let start' = if variant == Commonmark || isEnabled Ext_startnum opts\n                  then start\n                  else 1\n  let sty'   = if isEnabled Ext_fancy_lists opts then sty else DefaultStyle\n  let delim' | isEnabled Ext_fancy_lists opts =\n               case variant of\n                   -- Markua supports 'fancy' enumerators, but no TwoParens\n                   Markua -> if delim == TwoParens then OneParen else delim\n                   _ -> delim\n             | variant == Commonmark && --commonmark only supports one paren\n                   (delim == OneParen || delim == TwoParens) = OneParen\n             | otherwise = DefaultDelim\n  let attribs = (start', sty', delim')\n  let markers  = orderedListMarkers attribs\n  let markers' = case variant of\n                        Markua -> markers\n                        _ -> map (\\m -> if T.length m < 3\n                                   then m <> T.replicate (3 - T.length m) \" \"\n                                   else m) markers\n  contents <- inList $\n              zipWithM (orderedListItemToMarkdown opts) markers' items\n  return $ (if isTightList items then vcat else vsep) contents <> blankline\nblockToMarkdown' opts (DefinitionList items) = do\n  contents <- inList $ mapM (definitionListItemToMarkdown opts) items\n  return $ mconcat contents <> blankline\nblockToMarkdown' opts (Figure figattr capt body) = do\n  let combinedAttr imgattr = case imgattr of\n        (\"\", cls, kvs)\n          | (figid, [], []) <- figattr\n            -> Just (figid, cls, [(k,v) | (k,v) <- kvs\n                                        , k /= \"alt\" ||\n                                          v /= \"\" && v /= trim (stringify capt)])\n        _ -> Nothing\n  case body of\n    [Plain [Image imgAttr alt (src, ttl)]]\n      | isEnabled Ext_implicit_figures opts\n      , Just imgAttr' <- combinedAttr imgAttr\n      , isEnabled Ext_link_attributes opts || imgAttr' == nullAttr\n        -> do\n          -- use implicit figures if possible\n          let tgt' = (src, fromMaybe ttl $ T.stripPrefix \"fig:\" ttl)\n          let descr = case capt of\n                        Caption _ bs -> blocksToInlines bs\n          -- add alt attribute if image description different from caption,\n          -- so this won't be lost:\n          let imgAttr'' = case imgAttr' of\n                            (i,c,kv)\n                              | not (null alt)\n                              , Nothing <- lookup \"alt\" kv\n                              , stringify descr /= stringify alt ->\n                                 (i, c, (\"alt\", stringify alt) : kv)\n                            _ -> imgAttr'\n          contents <- inlineListToMarkdown opts [Image imgAttr'' descr tgt']\n          return $ contents <> blankline\n    _ ->\n      -- fallback to raw html if possible or div otherwise\n      if isEnabled Ext_raw_html opts\n      then figureToMarkdown opts figattr capt body\n      else if (isEnabled Ext_fenced_divs opts || isEnabled Ext_native_divs opts) ||\n                  not (isEnabled Ext_implicit_figures opts)\n              then blockToMarkdown' opts $ figureDiv figattr capt body\n              else blockListToMarkdown opts body\n\ninList :: Monad m => MD m a -> MD m a\ninList p = local (\\env -> env {envInList = True}) p\n\naddMarkdownAttribute :: Text -> Text\naddMarkdownAttribute s =\n  case span isTagText $ reverse $ parseTags s of\n       (xs, TagOpen t attrs:rest) ->\n            renderTags' $ reverse rest ++ (TagOpen t attrs' : reverse xs)\n              where attrs' = (\"markdown\",\"1\"):[(x,y) | (x,y) <- attrs,\n                                 x /= \"markdown\"]\n       _ -> s\n\n-- | Converts a figure to Markdown by wrapping it in a div named `figure`.\nfigureToMarkdown :: PandocMonad m\n                 => WriterOptions\n                 -> Attr\n                 -> Caption\n                 -> [Block]\n                 -> MD m (Doc Text)\nfigureToMarkdown opts attr@(ident, classes, kvs) capt body\n  | isEnabled Ext_raw_html opts =\n      (<> blankline) . literal . T.strip <$>\n      writeHtml5String\n        opts{ writerTemplate = Nothing }\n        (Pandoc nullMeta [Figure attr capt body])\n  | otherwise = do\n      let attr' = (ident, [\"figure\"] `union` classes, kvs)\n      let Caption _mbshort caption = capt\n      let captionBs = [Div (\"\",[\"caption\"],[]) caption | not (null caption)]\n      blockToMarkdown' opts (Div attr' (body <> captionBs))\n\nitemEndsWithTightList :: [Block] -> Bool\nitemEndsWithTightList bs =\n  case bs of\n        [Plain _, BulletList xs]    -> isTightList xs\n        [Plain _, OrderedList _ xs] -> isTightList xs\n        _                           -> False\n\n-- | Convert bullet list item (list of blocks) to markdown.\nbulletListItemToMarkdown :: PandocMonad m => WriterOptions -> [Block] -> MD m (Doc Text)\nbulletListItemToMarkdown opts bs = do\n  variant <- asks envVariant\n  let exts = writerExtensions opts\n  contents <- blockListToMarkdown opts $ taskListItemToAscii exts bs\n  let start = case variant of\n              Markua -> \"* \"\n              Commonmark -> \"- \"\n              Markdown\n                | isEnabled Ext_four_space_rule opts\n                  -> \"- \" <> T.replicate (writerTabStop opts - 2) \" \"\n              PlainText\n                | isEnabled Ext_four_space_rule opts\n                  -> \"- \" <> T.replicate (writerTabStop opts - 2) \" \"\n              _ -> \"- \"\n  -- remove trailing blank line if item ends with a tight list\n  let contents' = if itemEndsWithTightList bs\n                     then chomp contents <> cr\n                     else contents\n  return $ hang (T.length start) (literal start) contents'\n\n-- | Convert ordered list item (a list of blocks) to markdown.\norderedListItemToMarkdown :: PandocMonad m\n                          => WriterOptions -- ^ options\n                          -> Text          -- ^ list item marker\n                          -> [Block]       -- ^ list item (list of blocks)\n                          -> MD m (Doc Text)\norderedListItemToMarkdown opts marker bs = do\n  let exts = writerExtensions opts\n  contents <- blockListToMarkdown opts $ taskListItemToAscii exts bs\n  variant <- asks envVariant\n  let sps = case writerTabStop opts - T.length marker of\n                   n | n > 0 -> literal $ T.replicate n \" \"\n                   _ -> literal \" \"\n  let ind = if isEnabled Ext_four_space_rule opts\n               then writerTabStop opts\n               else max (writerTabStop opts) (T.length marker + 1)\n  let start = case variant of\n              Markua -> literal marker <> \" \"\n              _      -> literal marker <> sps\n  -- remove trailing blank line if item ends with a tight list\n  let contents' = if itemEndsWithTightList bs\n                     then chomp contents <> cr\n                     else contents\n  return $ hang ind start contents'\n\n-- | Convert definition list item (label, list of blocks) to markdown.\ndefinitionListItemToMarkdown :: PandocMonad m\n                             => WriterOptions\n                             -> ([Inline],[[Block]])\n                             -> MD m (Doc Text)\ndefinitionListItemToMarkdown opts (label, defs) = do\n  labelText <- blockToMarkdown opts (Plain label)\n  defs' <- mapM (mapM (blockToMarkdown opts)) defs\n  if isEnabled Ext_definition_lists opts\n     then do\n       let tabStop = writerTabStop opts\n       variant <- asks envVariant\n       let leader  = case variant of\n                        PlainText -> \" \"\n                        _ -> \":\"\n       let leadingChars = case tabStop of\n                            -- Always use two leading characters for Markua\n                            n | n >= 2 && variant /= Markua -> n\n                            _ -> 2\n       let sps = literal $ T.replicate (leadingChars - 1) \" \"\n       let isTight = case defs of\n                        ((Plain _ : _): _) -> True\n                        _                  -> False\n       let contents = (if isTight then vcat else vsep) $ map\n                       (\\d -> hang leadingChars (leader <> sps) $ vcat d)\n                       defs'\n       return $ blankline <> nowrap labelText $$\n                (if isTight then empty else blankline) <> contents <> blankline\n     else\n       return $ nowrap (chomp labelText <> literal \"  \" <> cr) <>\n                vsep (map vsep defs') <> blankline\n\n-- | Convert list of Pandoc block elements to markdown.\nblockListToMarkdown :: PandocMonad m\n                    => WriterOptions -- ^ Options\n                    -> [Block]       -- ^ List of block elements\n                    -> MD m (Doc Text)\nblockListToMarkdown opts blocks = do\n  inlist <- asks envInList\n  variant <- asks envVariant\n  -- a) insert comment between list and indented code block, or the\n  -- code block will be treated as a list continuation paragraph\n  -- b) change Plain to Para unless it's followed by a RawBlock\n  -- or has a list as its parent (#3487)\n  let fixBlocks (b : CodeBlock attr x : rest)\n       | (not (variant == Commonmark ||\n               isEnabled Ext_backtick_code_blocks opts ||\n                 isEnabled Ext_fenced_code_blocks opts) ||\n              attr == nullAttr)\n            && isListBlock b\n              = b : commentSep : CodeBlock attr x : fixBlocks rest\n      fixBlocks (b1@(BulletList _) : b2@(BulletList _) : bs) =\n           b1 : commentSep : fixBlocks (b2:bs)\n      fixBlocks (b1@(OrderedList _ _) : b2@(OrderedList _ _) : bs) =\n           b1 : commentSep : fixBlocks (b2:bs)\n      fixBlocks (b1@(DefinitionList _) : b2@(DefinitionList _) : bs) =\n           b1 : commentSep : fixBlocks (b2:bs)\n      fixBlocks (Plain ils : bs@(RawBlock{}:_)) =\n           Plain ils : fixBlocks bs\n      fixBlocks (Plain ils : bs@(Div{}:_))\n          | isEnabled Ext_fenced_divs opts =\n           Para ils : fixBlocks bs\n      fixBlocks (Plain ils : bs) | inlist =\n           Plain ils : fixBlocks bs\n      fixBlocks (Plain ils : bs) =\n           Para ils : fixBlocks bs\n      fixBlocks (r@(RawBlock f raw) : b : bs)\n        | not (T.null raw)\n        , T.last raw /= '\\n' =\n        case b of\n             Plain{}    -> r : fixBlocks (b:bs)\n             RawBlock{} -> r : fixBlocks (b:bs)\n             _          -> RawBlock f (raw <> \"\\n\") : fixBlocks (b:bs) -- #4629\n      fixBlocks (x : xs)             = x : fixBlocks xs\n      fixBlocks []                   = []\n      isListBlock (BulletList _)     = True\n      isListBlock (OrderedList _ _)  = True\n      isListBlock (DefinitionList _) = True\n      isListBlock _                  = False\n      commentSep\n        | variant == PlainText        = Plain []\n        | variant == Markua           = Plain []\n        | isEnabled Ext_raw_html opts = RawBlock \"html\" \"<!-- -->\\n\"\n        | otherwise                   = RawBlock \"markdown\" \"&nbsp;\\n\"\n  mconcat <$> mapM (blockToMarkdown opts) (fixBlocks blocks)\n\nlineBreakToSpace :: Inline -> Inline\nlineBreakToSpace LineBreak = Space\nlineBreakToSpace SoftBreak = Space\nlineBreakToSpace x         = x\n\nremoveBlankLinesInHTML :: Text -> Text\nremoveBlankLinesInHTML = T.pack . go False . T.unpack\n  where go _ [] = []\n        go True ('\\n':cs) = \"&#10;\" <> go False cs\n        go False ('\\n':cs) = '\\n' : go True cs\n        go !afternewline (!c:cs)\n          | isSpace c = c : go afternewline cs\n          | otherwise = c : go False cs\n\ncomputeDivNestingLevel :: [Block] -> Int\ncomputeDivNestingLevel = foldr go 0\n where\n   go (Div _ bls') n = max (n + 1) (foldr go (n + 1) bls')\n   go _ n = n\n\n-- Identify the class in a list of classes that corresponds to\n-- the language syntax.  language-X turns to X.\ngetLangFromClasses :: [Text] -> Maybe Text\ngetLangFromClasses cs =\n  case find (\"language-\" `T.isPrefixOf`) cs of\n    Just x -> Just (T.drop 9 x)\n    Nothing ->\n      case filter (/= \"sourceCode\") cs of\n        (x:_) -> Just x\n        [] -> Nothing\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Math.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Text.Pandoc.Writers.Math\n  ( texMathToInlines\n  , convertMath\n  , defaultMathJaxURL\n  , defaultKaTeXURL\n  )\nwhere\n\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.TeXMath (DisplayType (..), Exp, readTeX, writePandoc)\nimport Text.Pandoc.Options (defaultMathJaxURL, defaultKaTeXURL)\n\n-- | Converts a raw TeX math formula to a list of 'Pandoc' inlines.\n-- Defaults to raw formula between @$@ or @$$@ characters if entire formula\n-- can't be converted.\ntexMathToInlines :: PandocMonad m\n                 => MathType\n                 -> T.Text         -- ^ String to parse (assumes @'\\n'@ line endings)\n                 -> m [Inline]\ntexMathToInlines mt inp = do\n  res <- convertMath writePandoc mt inp\n  case res of\n       Right (Just ils)  -> return ils\n       Right Nothing   -> do\n         report $ CouldNotConvertTeXMath inp \"\"\n         return [mkFallback mt inp]\n       Left il           -> return [il]\n\nmkFallback :: MathType -> T.Text -> Inline\nmkFallback mt str = Str (delim <> str <> delim)\n   where delim = case mt of\n                      DisplayMath -> \"$$\"\n                      InlineMath  -> \"$\"\n\n-- | Converts a raw TeX math formula using a writer function,\n-- issuing a warning and producing a fallback (a raw string)\n-- on failure.\nconvertMath :: PandocMonad m\n            => (DisplayType -> [Exp] -> a) -> MathType -> T.Text\n            -> m (Either Inline a)\nconvertMath writer mt str =\n  case writer dt <$> readTeX str of\n       Right r  -> return (Right r)\n       Left e   -> do\n         report $ CouldNotConvertTeXMath str e\n         return (Left $ mkFallback mt str)\n   where dt = case mt of\n                   DisplayMath -> DisplayBlock\n                   InlineMath  -> DisplayInline\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/MediaWiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.MediaWiki\n   Copyright   : Copyright (C) 2008-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to MediaWiki markup.\n\nMediaWiki:  <http://www.mediawiki.org/wiki/MediaWiki>\n-}\nmodule Text.Pandoc.Writers.MediaWiki ( writeMediaWiki, highlightingLangs ) where\nimport Control.Monad.Reader\nimport Control.Monad.State.Strict\nimport Data.Maybe (fromMaybe)\nimport qualified Data.List as DL\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.List.NonEmpty (NonEmpty((:|)))\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.XML (escapeStringForXML)\n\ndata WriterState = WriterState {\n    stNotes   :: Bool            -- True if there are notes\n  , stOptions :: WriterOptions   -- writer options\n  , stInDefLabel :: Bool         -- True if in definition list label\n  }\n\ndata WriterReader = WriterReader {\n    options   :: WriterOptions -- Writer options\n  , listLevel :: [Char]        -- String at beginning of list items, e.g. \"**\"\n  , useTags   :: Bool          -- True if we should use HTML tags because we're in a complex list\n  }\n\ntype MediaWikiWriter m = ReaderT WriterReader (StateT WriterState m)\n\n-- | Convert Pandoc to MediaWiki.\nwriteMediaWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteMediaWiki opts document =\n  let initialState = WriterState {\n        stNotes = False, stOptions = opts, stInDefLabel = False }\n      env = WriterReader { options = opts, listLevel = [], useTags = False }\n  in  evalStateT (runReaderT (pandocToMediaWiki document) env) initialState\n\n-- | Return MediaWiki representation of document.\npandocToMediaWiki :: PandocMonad m => Pandoc -> MediaWikiWriter m Text\npandocToMediaWiki (Pandoc meta blocks) = do\n  opts <- asks options\n  metadata <- metaToContext opts\n              (fmap chomp . blockListToMediaWiki)\n              (fmap chomp . inlineListToMediaWiki)\n              meta\n  body <- blockListToMediaWiki blocks\n  notesExist <- gets stNotes\n  let notes = if notesExist\n                 then cr <> literal \"<references />\"\n                 else mempty\n  let main = body <> notes\n  let context = defField \"body\" main\n                $ defField \"toc\" (writerTableOfContents opts) metadata\n  return $ render Nothing $\n    case writerTemplate opts of\n         Nothing  -> main\n         Just tpl -> renderTemplate tpl context\n\n-- | Escape special characters for MediaWiki.\nescapeText :: Text -> Text\nescapeText =  escapeStringForXML\n\n-- | Convert Pandoc block element to MediaWiki.\nblockToMediaWiki :: PandocMonad m\n                 => Block         -- ^ Block element\n                 -> MediaWikiWriter m (Doc Text)\n\nblockToMediaWiki (Div attrs bs) = do\n  contents <- blockListToMediaWiki bs\n  return $ tagWithAttrs \"div\" attrs $$\n            contents $$\n            literal \"</div>\" $$\n            blankline\n\nblockToMediaWiki (Plain inlines) =\n  inlineListToMediaWiki inlines\n\nblockToMediaWiki (SimpleFigure attr txt (src, tit)) = do\n  capt <- inlineListToMediaWiki txt\n  img  <- imageToMediaWiki attr\n  let capt' = render Nothing capt\n  let opt = if T.null tit\n               then\n                 if T.null capt'\n                    then \"\"\n                    else \"alt=\" <> capt'\n               else \"alt=\" <> tit\n  let separator = \"<nowiki></nowiki>\"\n  -- External images (URIs) cannot use [[File:...]] syntax;\n  -- they must be rendered as bare URLs. MediaWiki will auto-embed\n  -- them when $wgAllowExternalImages is enabled.\n  return $ if isURI src\n           then literal (separator <> src <> separator) <> cr\n           else literal (\"[[\" <>\n                  T.intercalate \"|\"\n                  (filter (not . T.null) [\"File:\" <> src\n                                       , \"thumb\"\n                                       , \"none\"\n                                       , img\n                                       , opt\n                                       , capt'\n                                       ]) <>\n                  \"]]\") <> cr\n\nblockToMediaWiki (Para inlines) = do\n  tags <- asks useTags\n  lev <- asks listLevel\n  contents <- inlineListToMediaWiki inlines\n  let contents' = render Nothing contents\n  let initEsc = if startsWithListMarker contents'\n                   then literal \"\\\\\"\n                   else mempty\n  return $ if tags\n              then  literal \"<p>\" <> contents <> literal \"</p>\"\n              else initEsc <> contents $$\n                   if null lev then blankline else mempty\n\nblockToMediaWiki (LineBlock lns) =\n  blockToMediaWiki $ linesToPara lns\n\nblockToMediaWiki b@(RawBlock f str)\n  | f == Format \"mediawiki\" = return $ literal str\n  | f == Format \"html\"      = return $ literal str\n  | otherwise               = mempty <$ report (BlockNotRendered b)\n\nblockToMediaWiki HorizontalRule = return $ blankline <> literal \"-----\" <> blankline\n\nblockToMediaWiki (Header level (ident,_,_) inlines) = do\n  let autoId = T.replace \" \" \"_\" $ stringify inlines\n  contents <- inlineListToMediaWiki inlines\n  let eqs = literal $ T.replicate level \"=\"\n  return $\n    (if T.null ident || autoId == ident\n        then mempty\n        else literal (\"<span id=\\\"\" <> ident <> \"\\\"></span>\") <> cr)\n    <> eqs <> space <> contents <> space <> eqs <> blankline\n\nblockToMediaWiki (CodeBlock (_,classes,keyvals) str) = do\n  let at  = Set.fromList classes `Set.intersection` highlightingLangs\n  let numberLines = any (`elem` [\"number\",\"numberLines\", \"number-lines\"])\n                    classes\n  let start = lookup \"startFrom\" keyvals\n  return $ literal $\n    case Set.toList at of\n       [] -> \"<pre\" <> (if null classes\n                           then \">\"\n                           else \" class=\\\"\" <> T.unwords classes <> \"\\\">\") <>\n             escapeText str <> \"</pre>\"\n       (l:_) -> \"<syntaxhighlight lang=\\\"\" <> l <> \"\\\"\" <>\n                (if numberLines then \" line\" else \"\") <>\n                maybe \"\" (\\x -> \" start=\\\"\" <> x <> \"\\\"\") start <>\n                \">\" <> str <>\n                \"</syntaxhighlight>\"\n            -- note:  no escape!  even for <!\n\nblockToMediaWiki (BlockQuote blocks) = do\n  contents <- blockListToMediaWiki blocks\n  return $ literal \"<blockquote>\" <> chomp contents <> cr <> literal \"</blockquote>\"\n\nblockToMediaWiki (Table attr capt colSpecs thead tbody tfoot) = do\n    tableToMediaWiki (Ann.toTable attr capt colSpecs thead tbody tfoot)\n\nblockToMediaWiki x@(BulletList items) = do\n  tags <-\n    (|| not (isSimpleList x)) <$> asks useTags\n  if tags\n     then do\n        contents <- local (\\ s -> s { useTags = True }) $ mapM listItemToMediaWiki items\n        return $ literal \"<ul>\" <> cr <> vcat contents <> literal \"</ul>\" <> blankline\n     else do\n        lev <- asks listLevel\n        contents <- local (\\s -> s { listLevel = listLevel s <> \"*\" }) $ mapM listItemToMediaWiki items\n        return $ vcat contents <> if null lev then blankline else mempty\n\nblockToMediaWiki x@(OrderedList attribs items) = do\n  tags <-\n    (|| not (isSimpleList x)) <$> asks useTags\n  if tags\n     then do\n        contents <- local (\\s -> s { useTags = True }) $ mapM listItemToMediaWiki items\n        return $ literal (\"<ol\" <> listAttribsToText attribs <> \">\") <> cr <> vcat contents <> literal \"</ol>\" <> blankline\n     else do\n        lev <- asks listLevel\n        contents <- local (\\s -> s { listLevel = listLevel s <> \"#\" }) $ mapM listItemToMediaWiki items\n        return $ vcat contents <> if null lev then blankline else mempty\n\nblockToMediaWiki x@(DefinitionList items) = do\n  tags <-\n    (|| not (isSimpleList x)) <$> asks useTags\n  if tags\n     then do\n        contents <- local (\\s -> s { useTags = True }) $ mapM definitionListItemToMediaWiki items\n        return $ literal \"<dl>\" <> cr <> vcat contents <> literal \"</dl>\" <> blankline\n     else do\n        lev <- asks listLevel\n        contents <- local (\\s -> s { listLevel = listLevel s <> \";\" }) $ mapM definitionListItemToMediaWiki items\n        return $ vcat contents <> if null lev then blankline else mempty\n\nblockToMediaWiki (Figure (ident, classes, kvs) _ body) =\n  blockToMediaWiki (Div (ident, [\"figure\"] `DL.union` classes, kvs) body)\n\n-- Auxiliary functions for lists:\n\n-- | Convert ordered list attributes to HTML attribute string\nlistAttribsToText :: ListAttributes -> Text\nlistAttribsToText (startnum, numstyle, _) =\n  let numstyle' = camelCaseToHyphenated $ tshow numstyle\n  in  (if startnum /= 1\n          then \" start=\\\"\" <> tshow startnum <> \"\\\"\"\n          else \"\") <>\n      (if numstyle /= DefaultStyle\n          then \" style=\\\"list-style-type: \" <> numstyle' <> \";\\\"\"\n          else \"\")\n\n-- | Convert bullet or ordered list item (list of blocks) to MediaWiki.\nlistItemToMediaWiki :: PandocMonad m => [Block] -> MediaWikiWriter m (Doc Text)\nlistItemToMediaWiki items = do\n  contents <- blockListToMediaWiki items\n  tags <- asks useTags\n  if tags\n     then return $ literal \"<li>\" <> chomp contents <> literal \"</li>\"\n     else do\n       marker <- asks listLevel\n       return $ literal (T.pack marker) <> space <> chomp contents\n\n-- | Convert definition list item (label, list of blocks) to MediaWiki.\ndefinitionListItemToMediaWiki :: PandocMonad m\n                              => ([Inline],[[Block]])\n                              -> MediaWikiWriter m (Doc Text)\ndefinitionListItemToMediaWiki (label, items) = do\n  modify $ \\st -> st{ stInDefLabel = True }\n  labelText <- inlineListToMediaWiki label\n  modify $ \\st -> st{ stInDefLabel = False }\n  contents <- mapM blockListToMediaWiki items\n  tags <- asks useTags\n  if tags\n     then return $ literal \"<dt>\" <> chomp labelText <> literal \"</dt>\" <> cr <>\n           vcat (map (\\d -> literal \"<dd>\" <> chomp d <> literal \"</dd>\") contents)\n     else do\n       marker <- asks listLevel\n       return $ literal (T.pack marker) <> space <> chomp labelText <> cr <>\n           vcat (map (\\d -> literal (T.pack (init marker)) <> literal \": \" <> chomp d) contents)\n\n-- | True if the list can be handled by simple wiki markup, False if HTML tags will be needed.\nisSimpleList :: Block -> Bool\nisSimpleList x =\n  case x of\n       BulletList items                 -> all isSimpleListItem items\n       OrderedList (num, sty, _) items  -> all isSimpleListItem items &&\n                                            num == 1 && sty `elem` [DefaultStyle, Decimal]\n       DefinitionList items             -> all isSimpleListItem $ concatMap snd items\n       _                                -> False\n\n-- | True if list item can be handled with the simple wiki syntax.  False if\n--   HTML tags will be needed.\nisSimpleListItem :: [Block] -> Bool\nisSimpleListItem []  = True\nisSimpleListItem [x] =\n  case x of\n       Plain _          -> True\n       Para  _          -> True\n       BulletList _     -> isSimpleList x\n       OrderedList _ _  -> isSimpleList x\n       DefinitionList _ -> isSimpleList x\n       _                -> False\nisSimpleListItem [x, y] | isPlainOrPara x =\n  case y of\n       BulletList _     -> isSimpleList y\n       OrderedList _ _  -> isSimpleList y\n       DefinitionList _ -> isSimpleList y\n       _                -> False\nisSimpleListItem _ = False\n\nisPlainOrPara :: Block -> Bool\nisPlainOrPara (Plain _) = True\nisPlainOrPara (Para  _) = True\nisPlainOrPara _         = False\n\n-- Auxiliary functions for tables:\n\ntableToMediaWiki :: PandocMonad m => Ann.Table -> MediaWikiWriter m (Doc Text)\ntableToMediaWiki (Ann.Table attr capt _ thead tbodies tfoot) = do\n    let (ident,classes,kvs) = attr\n    caption <- case capt of\n        Caption _ [] -> return mempty\n        Caption _ longCapt -> do\n            c <- blockListToMediaWiki longCapt\n            return $ literal \"|+ \" <> chomp c <> cr\n    head' <- tableHeadToMW thead\n    bodies' <- mconcat <$> mapM tableBodyToMW tbodies\n    foot' <- tableFootToMW tfoot\n    return $ literal \"{|\" <> htmlAttrs (ident, \"wikitable\":classes, kvs) <> cr\n             <> caption <> head' <> bodies' <> foot'\n             <> literal \"|}\" <> blankline\n\ntableHeadToMW :: PandocMonad m => Ann.TableHead -> MediaWikiWriter m (Doc Text)\ntableHeadToMW (Ann.TableHead _ rows) = headerRowsToMW rows\n\ntableFootToMW :: PandocMonad m => Ann.TableFoot -> MediaWikiWriter m (Doc Text)\ntableFootToMW (Ann.TableFoot _ rows) = headerRowsToMW rows\n\ntableBodyToMW :: PandocMonad m => Ann.TableBody -> MediaWikiWriter m (Doc Text)\ntableBodyToMW (Ann.TableBody _ _ headerRows bodyRows) = do\n  headerRows' <- headerRowsToMW headerRows\n  bodyRows' <- bodyRowsToMW bodyRows\n  return $ headerRows' <> bodyRows'\n\nheaderRowsToMW :: PandocMonad m => [Ann.HeaderRow] -> MediaWikiWriter m (Doc Text)\nheaderRowsToMW rows = mconcat <$> mapM headerRowToMW rows\n\nheaderRowToMW :: PandocMonad m => Ann.HeaderRow -> MediaWikiWriter m (Doc Text)\nheaderRowToMW (Ann.HeaderRow attr _ cells) = do\n  cells' <- mconcat <$> mapM (cellToMW \"!\") cells\n  return $ literal \"|-\" <> htmlAttrs attr <> cr <> cells'\n\nbodyRowsToMW :: PandocMonad m => [Ann.BodyRow] -> MediaWikiWriter m (Doc Text)\nbodyRowsToMW rows = mconcat <$> mapM bodyRowToMW rows\n\nbodyRowToMW :: PandocMonad m => Ann.BodyRow -> MediaWikiWriter m (Doc Text)\nbodyRowToMW (Ann.BodyRow attr _ headCells bodyCells) = do\n  headCells' <- mconcat <$> mapM (cellToMW \"!\") headCells\n  bodyCells' <- mconcat <$> mapM (cellToMW \"|\") bodyCells\n  return $ literal \"|-\" <> htmlAttrs attr <> cr <> headCells' <> bodyCells'\n\ncellToMW :: PandocMonad m => Text -> Ann.Cell -> MediaWikiWriter m (Doc Text)\ncellToMW marker (Ann.Cell (colSpec :| _) _ (Cell attr align rowspan colspan content)) = do\n  content' <- blockListToMediaWiki content\n  let (ident,classes,keyVals) = attr\n\n  let align' = case align of\n        AlignDefault -> fst colSpec\n        _            -> align\n  let keyVals' = case (htmlAlignmentToString align') of\n                  Nothing -> keyVals\n                  Just alignStr -> htmlAddStyle (\"text-align\", alignStr) keyVals\n  let rowspan' = case rowspan of\n                  RowSpan 1 -> mempty\n                  RowSpan n -> [(\"rowspan\", T.pack(show n))]\n  let colspan' = case colspan of\n                  ColSpan 1 -> mempty\n                  ColSpan n -> [(\"colspan\", T.pack(show n))]\n  let attrs' = htmlAttrs (ident, classes, rowspan' <> colspan' <> keyVals')\n  let attrsRendered = render Nothing attrs'\n  let pipeAttr = if T.null attrsRendered then mempty else attrs' <> literal \"|\"\n  let contentRendered = render Nothing content'\n  let spaceContent = if T.null contentRendered then mempty else space <> chomp content'\n  return $ literal marker <> pipeAttr <> spaceContent <> cr\n\nimageToMediaWiki :: PandocMonad m => Attr -> MediaWikiWriter m Text\nimageToMediaWiki attr = do\n  opts <- gets stOptions\n  let (_, cls, _) = attr\n      toPx = fmap (showInPixel opts) . checkPct\n      checkPct (Just (Percent _)) = Nothing\n      checkPct maybeDim           = maybeDim\n      go (Just w) Nothing  = w <> \"px\"\n      go (Just w) (Just h) = w <> \"x\" <> h <> \"px\"\n      go Nothing  (Just h) = \"x\" <> h <> \"px\"\n      go Nothing  Nothing  = \"\"\n      dims = go (toPx $ dimension Width attr) (toPx $ dimension Height attr)\n      classes = if null cls\n                   then \"\"\n                   else \"class=\" <> T.unwords cls\n  return $ T.intercalate \"|\" $ filter (not . T.null) [dims, classes]\n\n-- | Convert list of Pandoc block elements to MediaWiki.\nblockListToMediaWiki :: PandocMonad m\n                     => [Block]       -- ^ List of block elements\n                     -> MediaWikiWriter m (Doc Text)\nblockListToMediaWiki blocks =\n  vcat <$> mapM blockToMediaWiki blocks\n\n-- | Convert list of Pandoc inline elements to MediaWiki.\ninlineListToMediaWiki :: PandocMonad m => [Inline] -> MediaWikiWriter m (Doc Text)\ninlineListToMediaWiki lst =\n  hcat <$> mapM inlineToMediaWiki (fixup lst)\n    where\n     fixup [] = []\n     fixup (Str t : x : xs)\n       | not (T.null t) && T.last t == '['\n       , isLinkOrImage x =\n          Str t : RawInline (Format \"mediawiki\") \"<nowiki/>\" : x : fixup xs\n     fixup (x:xs) = x : fixup xs\n     isLinkOrImage Link{}  = True\n     isLinkOrImage Image{} = True\n     isLinkOrImage _         = False\n\n-- | Convert Pandoc inline element to MediaWiki.\ninlineToMediaWiki :: PandocMonad m => Inline -> MediaWikiWriter m (Doc Text)\n\ninlineToMediaWiki (Span attrs ils) = do\n  contents <- inlineListToMediaWiki ils\n  return $ tagWithAttrs \"span\" attrs <> contents <> literal \"</span>\"\n\ninlineToMediaWiki (Emph lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"''\" <> contents <> literal \"''\"\n\ninlineToMediaWiki (Underline lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"<u>\" <> contents <> literal \"</u>\"\n\ninlineToMediaWiki (Strong lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"'''\" <> contents <> literal \"'''\"\n\ninlineToMediaWiki (Strikeout lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"<s>\" <> contents <> literal \"</s>\"\n\ninlineToMediaWiki (Superscript lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"<sup>\" <> contents <> literal \"</sup>\"\n\ninlineToMediaWiki (Subscript lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"<sub>\" <> contents <> literal \"</sub>\"\n\ninlineToMediaWiki (SmallCaps lst) = inlineListToMediaWiki lst\n\ninlineToMediaWiki (Quoted SingleQuote lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"\\8216\" <> contents <> literal \"\\8217\"\n\ninlineToMediaWiki (Quoted DoubleQuote lst) = do\n  contents <- inlineListToMediaWiki lst\n  return $ literal \"\\8220\" <> contents <> literal \"\\8221\"\n\ninlineToMediaWiki (Cite _  lst) = inlineListToMediaWiki lst\n\ninlineToMediaWiki (Code _ str) =\n  return $ literal $ \"<code>\" <> escapeText str <> \"</code>\"\n\ninlineToMediaWiki (Str str) = do\n  inDefLabel <- gets stInDefLabel\n  return $ literal $\n    if inDefLabel\n       then T.intercalate \"<nowiki>:</nowiki>\" $\n              map escapeText $ T.splitOn \":\" str\n       else escapeText str\n\ninlineToMediaWiki (Math mt str) = return $ literal $\n  \"<math display=\\\"\" <>\n  (if mt == DisplayMath then \"block\" else \"inline\") <>\n  \"\\\">\" <> str <> \"</math>\"\n  -- note:  str should NOT be escaped\n\ninlineToMediaWiki il@(RawInline f str)\n  | f == Format \"mediawiki\" = return $ literal str\n  | f == Format \"html\"      = return $ literal str\n  | otherwise               = mempty <$ report (InlineNotRendered il)\n\ninlineToMediaWiki LineBreak = return $ literal \"<br />\" <> cr\n\ninlineToMediaWiki SoftBreak = do\n  wrapText <- gets (writerWrapText . stOptions)\n  listlevel <- asks listLevel\n  case wrapText of\n       WrapAuto     -> return space\n       WrapNone     -> return space\n       WrapPreserve -> if null listlevel\n                          then return cr\n                          else return space\n\ninlineToMediaWiki Space = return space\n\ninlineToMediaWiki (Link _ txt (src, _)) = do\n  -- We need to remove links from link text, because an <a> element is\n  -- not allowed inside another <a> element.\n  label <- inlineListToMediaWiki (removeLinks txt)\n  let label' = render Nothing label\n  case txt of\n     [Str s] | isURI src && escapeURI s == src -> return $ literal src\n     _  -> return $ literal $ if isURI src\n       then \"[\" <> src <> \" \" <> label' <> \"]\"\n       else\n         if src == label'\n           then \"[[\" <> src' <> \"]]\"\n           else \"[[\" <> src' <> \"|\" <> label' <> \"]]\"\n       -- with leading / it's a link to a help page\n       where src' = fromMaybe src $ T.stripPrefix \"/\" src\n\ninlineToMediaWiki (Image attr alt (source, tit)) = do\n  let separator = \"<nowiki></nowiki>\"\n  -- External images (URIs) cannot use [[File:...]] syntax;\n  -- they must be rendered as bare URLs. MediaWiki will auto-embed\n  -- them when $wgAllowExternalImages is enabled.\n  if isURI source\n     then return $ literal $ separator <> source <> separator\n     else do\n       img  <- imageToMediaWiki attr\n       alt' <- inlineListToMediaWiki alt\n       let altText = render Nothing alt'\n       let txt = if T.null altText\n                    then if T.null tit\n                            then \"\"\n                            else tit\n                    else altText\n       return $ literal $ \"[[\" <>\n                T.intercalate \"|\"\n                (filter (not . T.null)\n                 [ \"File:\" <> source\n                 , img\n                 , txt\n                 ]) <> \"]]\"\n\ninlineToMediaWiki (Note contents) = do\n  contents' <- blockListToMediaWiki contents\n  modify (\\s -> s { stNotes = True })\n  let rendered = render Nothing contents'\n  return $ literal $ \"<ref>\" <> stripTrailingNewlines rendered <> \"</ref>\"\n  -- note - does not work for notes with multiple blocks\n\nhighlightingLangs :: Set.Set Text\nhighlightingLangs = Set.fromList [\n  \"abap\",\n  \"abl\",\n  \"abnf\",\n  \"aconf\",\n  \"actionscript\",\n  \"actionscript3\",\n  \"ada\",\n  \"ada2005\",\n  \"ada95\",\n  \"adl\",\n  \"agda\",\n  \"ahk\",\n  \"alloy\",\n  \"ambienttalk\",\n  \"ambienttalk/2\",\n  \"antlr\",\n  \"antlr-actionscript\",\n  \"antlr-as\",\n  \"antlr-c#\",\n  \"antlr-cpp\",\n  \"antlr-csharp\",\n  \"antlr-java\",\n  \"antlr-objc\",\n  \"antlr-perl\",\n  \"antlr-python\",\n  \"antlr-rb\",\n  \"antlr-ruby\",\n  \"apache\",\n  \"apacheconf\",\n  \"apl\",\n  \"applescript\",\n  \"arduino\",\n  \"arexx\",\n  \"as\",\n  \"as3\",\n  \"asm\",\n  \"aspectj\",\n  \"aspx-cs\",\n  \"aspx-vb\",\n  \"asy\",\n  \"asymptote\",\n  \"at\",\n  \"autohotkey\",\n  \"autoit\",\n  \"awk\",\n  \"b3d\",\n  \"basemake\",\n  \"bash\",\n  \"basic\",\n  \"bat\",\n  \"batch\",\n  \"bbcode\",\n  \"because\",\n  \"befunge\",\n  \"bf\",\n  \"blitzbasic\",\n  \"blitzmax\",\n  \"bmax\",\n  \"bnf\",\n  \"boo\",\n  \"boogie\",\n  \"bplus\",\n  \"brainfuck\",\n  \"bro\",\n  \"bsdmake\",\n  \"bugs\",\n  \"c\",\n  \"c#\",\n  \"c++\",\n  \"c++-objdumb\",\n  \"c-objdump\",\n  \"ca65\",\n  \"cadl\",\n  \"camkes\",\n  \"cbmbas\",\n  \"ceylon\",\n  \"cf3\",\n  \"cfc\",\n  \"cfengine3\",\n  \"cfg\",\n  \"cfm\",\n  \"cfs\",\n  \"chai\",\n  \"chaiscript\",\n  \"chapel\",\n  \"cheetah\",\n  \"chpl\",\n  \"cirru\",\n  \"cl\",\n  \"clay\",\n  \"clipper\",\n  \"clj\",\n  \"cljs\",\n  \"clojure\",\n  \"clojurescript\",\n  \"cmake\",\n  \"cobol\",\n  \"cobolfree\",\n  \"coffee\",\n  \"coffee-script\",\n  \"coffeescript\",\n  \"common-lisp\",\n  \"componentpascal\",\n  \"console\",\n  \"control\",\n  \"coq\",\n  \"cp\",\n  \"cpp\",\n  \"cpp-objdump\",\n  \"cpsa\",\n  \"crmsh\",\n  \"croc\",\n  \"cry\",\n  \"cryptol\",\n  \"csh\",\n  \"csharp\",\n  \"csound\",\n  \"csound-csd\",\n  \"csound-document\",\n  \"csound-orc\",\n  \"csound-sco\",\n  \"csound-score\",\n  \"css\",\n  \"css+django\",\n  \"css+erb\",\n  \"css+genshi\",\n  \"css+genshitext\",\n  \"css+jinja\",\n  \"css+lasso\",\n  \"css+mako\",\n  \"css+mozpreproc\",\n  \"css+myghty\",\n  \"css+php\",\n  \"css+ruby\",\n  \"css+smarty\",\n  \"cu\",\n  \"cucumber\",\n  \"cuda\",\n  \"cxx-objdump\",\n  \"cypher\",\n  \"cython\",\n  \"d\",\n  \"d-objdump\",\n  \"dart\",\n  \"debcontrol\",\n  \"debsources\",\n  \"delphi\",\n  \"dg\",\n  \"diff\",\n  \"django\",\n  \"docker\",\n  \"dockerfile\",\n  \"dosbatch\",\n  \"doscon\",\n  \"dosini\",\n  \"dpatch\",\n  \"dtd\",\n  \"duby\",\n  \"duel\",\n  \"dylan\",\n  \"dylan-console\",\n  \"dylan-lid\",\n  \"dylan-repl\",\n  \"earl-grey\",\n  \"earlgrey\",\n  \"easytrieve\",\n  \"ebnf\",\n  \"ec\",\n  \"ecl\",\n  \"eg\",\n  \"eiffel\",\n  \"elisp\",\n  \"elixir\",\n  \"elm\",\n  \"emacs\",\n  \"erb\",\n  \"erl\",\n  \"erlang\",\n  \"evoque\",\n  \"ex\",\n  \"exs\",\n  \"ezhil\",\n  \"f#\",\n  \"factor\",\n  \"fan\",\n  \"fancy\",\n  \"felix\",\n  \"fish\",\n  \"fishshell\",\n  \"flx\",\n  \"fortran\",\n  \"fortranfixed\",\n  \"foxpro\",\n  \"fsharp\",\n  \"fy\",\n  \"gap\",\n  \"gas\",\n  \"gawk\",\n  \"genshi\",\n  \"genshitext\",\n  \"gherkin\",\n  \"glsl\",\n  \"gnuplot\",\n  \"go\",\n  \"golo\",\n  \"gooddata-cl\",\n  \"gosu\",\n  \"groff\",\n  \"groovy\",\n  \"gst\",\n  \"haml\",\n  \"handlebars\",\n  \"haskell\",\n  \"haxe\",\n  \"haxeml\",\n  \"hexdump\",\n  \"hs\",\n  \"html\",\n  \"html+cheetah\",\n  \"html+django\",\n  \"html+erb\",\n  \"html+evoque\",\n  \"html+genshi\",\n  \"html+handlebars\",\n  \"html+jinja\",\n  \"html+kid\",\n  \"html+lasso\",\n  \"html+mako\",\n  \"html+myghty\",\n  \"html+php\",\n  \"html+ruby\",\n  \"html+smarty\",\n  \"html+spitfire\",\n  \"html+twig\",\n  \"html+velocity\",\n  \"htmlcheetah\",\n  \"htmldjango\",\n  \"http\",\n  \"hx\",\n  \"hxml\",\n  \"hxsl\",\n  \"hy\",\n  \"hybris\",\n  \"hylang\",\n  \"i6\",\n  \"i6t\",\n  \"i7\",\n  \"idl\",\n  \"idl4\",\n  \"idr\",\n  \"idris\",\n  \"iex\",\n  \"igor\",\n  \"igorpro\",\n  \"ik\",\n  \"inform6\",\n  \"inform7\",\n  \"ini\",\n  \"io\",\n  \"ioke\",\n  \"irb\",\n  \"irc\",\n  \"isabelle\",\n  \"j\",\n  \"jade\",\n  \"jags\",\n  \"jasmin\",\n  \"jasminxt\",\n  \"java\",\n  \"javascript\",\n  \"javascript+cheetah\",\n  \"javascript+django\",\n  \"javascript+erb\",\n  \"javascript+genshi\",\n  \"javascript+genshitext\",\n  \"javascript+jinja\",\n  \"javascript+lasso\",\n  \"javascript+mako\",\n  \"javascript+mozpreproc\",\n  \"javascript+myghty\",\n  \"javascript+php\",\n  \"javascript+ruby\",\n  \"javascript+smarty\",\n  \"javascript+spitfire\",\n  \"jbst\",\n  \"jcl\",\n  \"jinja\",\n  \"jl\",\n  \"jlcon\",\n  \"jproperties\",\n  \"js\",\n  \"js+cheetah\",\n  \"js+django\",\n  \"js+erb\",\n  \"js+genshi\",\n  \"js+genshitext\",\n  \"js+jinja\",\n  \"js+lasso\",\n  \"js+mako\",\n  \"js+myghty\",\n  \"js+php\",\n  \"js+ruby\",\n  \"js+smarty\",\n  \"js+spitfire\",\n  \"json\",\n  \"json-ld\",\n  \"jsonld\",\n  \"jsonml+bst\",\n  \"jsp\",\n  \"julia\",\n  \"kal\",\n  \"kconfig\",\n  \"kernel-config\",\n  \"kid\",\n  \"koka\",\n  \"kotlin\",\n  \"ksh\",\n  \"lagda\",\n  \"lasso\",\n  \"lassoscript\",\n  \"latex\",\n  \"lcry\",\n  \"lcryptol\",\n  \"lean\",\n  \"less\",\n  \"lhaskell\",\n  \"lhs\",\n  \"lid\",\n  \"lidr\",\n  \"lidris\",\n  \"lighttpd\",\n  \"lighty\",\n  \"limbo\",\n  \"linux-config\",\n  \"liquid\",\n  \"lisp\",\n  \"literate-agda\",\n  \"literate-cryptol\",\n  \"literate-haskell\",\n  \"literate-idris\",\n  \"live-script\",\n  \"livescript\",\n  \"llvm\",\n  \"logos\",\n  \"logtalk\",\n  \"lsl\",\n  \"lua\",\n  \"m2\",\n  \"make\",\n  \"makefile\",\n  \"mako\",\n  \"man\",\n  \"maql\",\n  \"mask\",\n  \"mason\",\n  \"mathematica\",\n  \"matlab\",\n  \"matlabsession\",\n  \"mawk\",\n  \"menuconfig\",\n  \"mf\",\n  \"minid\",\n  \"mma\",\n  \"modelica\",\n  \"modula2\",\n  \"moin\",\n  \"monkey\",\n  \"moo\",\n  \"moocode\",\n  \"moon\",\n  \"moonscript\",\n  \"mozhashpreproc\",\n  \"mozpercentpreproc\",\n  \"mq4\",\n  \"mq5\",\n  \"mql\",\n  \"mql4\",\n  \"mql5\",\n  \"msc\",\n  \"mscgen\",\n  \"mupad\",\n  \"mxml\",\n  \"myghty\",\n  \"mysql\",\n  \"nasm\",\n  \"nawk\",\n  \"nb\",\n  \"nemerle\",\n  \"nesc\",\n  \"newlisp\",\n  \"newspeak\",\n  \"nginx\",\n  \"nim\",\n  \"nimrod\",\n  \"nit\",\n  \"nix\",\n  \"nixos\",\n  \"nroff\",\n  \"nsh\",\n  \"nsi\",\n  \"nsis\",\n  \"numpy\",\n  \"obj-c\",\n  \"obj-c++\",\n  \"obj-j\",\n  \"objc\",\n  \"objc++\",\n  \"objdump\",\n  \"objdump-nasm\",\n  \"objective-c\",\n  \"objective-c++\",\n  \"objective-j\",\n  \"objectivec\",\n  \"objectivec++\",\n  \"objectivej\",\n  \"objectpascal\",\n  \"objj\",\n  \"ocaml\",\n  \"octave\",\n  \"odin\",\n  \"ooc\",\n  \"opa\",\n  \"openbugs\",\n  \"openedge\",\n  \"pacmanconf\",\n  \"pan\",\n  \"parasail\",\n  \"pas\",\n  \"pascal\",\n  \"pawn\",\n  \"pcmk\",\n  \"perl\",\n  \"perl6\",\n  \"php\",\n  \"php3\",\n  \"php4\",\n  \"php5\",\n  \"pig\",\n  \"pike\",\n  \"pkgconfig\",\n  \"pl\",\n  \"pl6\",\n  \"plpgsql\",\n  \"po\",\n  \"posh\",\n  \"postgres\",\n  \"postgres-console\",\n  \"postgresql\",\n  \"postgresql-console\",\n  \"postscr\",\n  \"postscript\",\n  \"pot\",\n  \"pov\",\n  \"powershell\",\n  \"praat\",\n  \"progress\",\n  \"prolog\",\n  \"properties\",\n  \"proto\",\n  \"protobuf\",\n  \"ps1\",\n  \"ps1con\",\n  \"psm1\",\n  \"psql\",\n  \"puppet\",\n  \"py\",\n  \"py3\",\n  \"py3tb\",\n  \"pycon\",\n  \"pypy\",\n  \"pypylog\",\n  \"pyrex\",\n  \"pytb\",\n  \"python\",\n  \"python3\",\n  \"pyx\",\n  \"qbasic\",\n  \"qbs\",\n  \"qml\",\n  \"qvt\",\n  \"qvto\",\n  \"r\",\n  \"racket\",\n  \"ragel\",\n  \"ragel-c\",\n  \"ragel-cpp\",\n  \"ragel-d\",\n  \"ragel-em\",\n  \"ragel-java\",\n  \"ragel-objc\",\n  \"ragel-rb\",\n  \"ragel-ruby\",\n  \"raw\",\n  \"rb\",\n  \"rbcon\",\n  \"rconsole\",\n  \"rd\",\n  \"rebol\",\n  \"red\",\n  \"red/system\",\n  \"redcode\",\n  \"registry\",\n  \"resource\",\n  \"resourcebundle\",\n  \"rest\",\n  \"restructuredtext\",\n  \"rexx\",\n  \"rhtml\",\n  \"rkt\",\n  \"roboconf-graph\",\n  \"roboconf-instances\",\n  \"robotframework\",\n  \"rout\",\n  \"rql\",\n  \"rsl\",\n  \"rst\",\n  \"rts\",\n  \"ruby\",\n  \"rust\",\n  \"s\",\n  \"sage\",\n  \"salt\",\n  \"sass\",\n  \"sc\",\n  \"scala\",\n  \"scaml\",\n  \"scheme\",\n  \"scilab\",\n  \"scm\",\n  \"scss\",\n  \"sh\",\n  \"shell\",\n  \"shell-session\",\n  \"shen\",\n  \"slim\",\n  \"sls\",\n  \"smali\",\n  \"smalltalk\",\n  \"smarty\",\n  \"sml\",\n  \"snobol\",\n  \"sources.list\",\n  \"sourceslist\",\n  \"sp\",\n  \"sparql\",\n  \"spec\",\n  \"spitfire\",\n  \"splus\",\n  \"sql\",\n  \"sqlite3\",\n  \"squeak\",\n  \"squid\",\n  \"squid.conf\",\n  \"squidconf\",\n  \"ssp\",\n  \"st\",\n  \"stan\",\n  \"supercollider\",\n  \"sv\",\n  \"swift\",\n  \"swig\",\n  \"systemverilog\",\n  \"tads3\",\n  \"tap\",\n  \"tcl\",\n  \"tcsh\",\n  \"tcshcon\",\n  \"tea\",\n  \"termcap\",\n  \"terminfo\",\n  \"terraform\",\n  \"tex\",\n  \"text\",\n  \"tf\",\n  \"thrift\",\n  \"todotxt\",\n  \"trac-wiki\",\n  \"trafficscript\",\n  \"treetop\",\n  \"ts\",\n  \"turtle\",\n  \"twig\",\n  \"typescript\",\n  \"udiff\",\n  \"urbiscript\",\n  \"v\",\n  \"vala\",\n  \"vapi\",\n  \"vb.net\",\n  \"vbnet\",\n  \"vctreestatus\",\n  \"velocity\",\n  \"verilog\",\n  \"vfp\",\n  \"vgl\",\n  \"vhdl\",\n  \"vim\",\n  \"winbatch\",\n  \"winbugs\",\n  \"x10\",\n  \"xbase\",\n  \"xml\",\n  \"xml+cheetah\",\n  \"xml+django\",\n  \"xml+erb\",\n  \"xml+evoque\",\n  \"xml+genshi\",\n  \"xml+jinja\",\n  \"xml+kid\",\n  \"xml+lasso\",\n  \"xml+mako\",\n  \"xml+myghty\",\n  \"xml+php\",\n  \"xml+ruby\",\n  \"xml+smarty\",\n  \"xml+spitfire\",\n  \"xml+velocity\",\n  \"xq\",\n  \"xql\",\n  \"xqm\",\n  \"xquery\",\n  \"xqy\",\n  \"xslt\",\n  \"xten\",\n  \"xtend\",\n  \"xul+mozpreproc\",\n  \"yaml\",\n  \"yaml+jinja\",\n  \"zephir\" ]\n\nstartsWithListMarker :: Text -> Bool\nstartsWithListMarker t =\n  case T.uncons t of\n    Nothing -> False\n    Just (c,_) -> c == '#' || c == ':' || c == ';' || c == '*'\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Ms.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Writers.Ms\n   Copyright   : Copyright (C) 2007-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to roff ms format.\n\nTODO:\n\n[ ] use base URL to construct absolute URLs from relative ones for external\n    links\n[ ] is there a better way to do strikeout?\n[ ] tight/loose list distinction\n-}\n\nmodule Text.Pandoc.Writers.Ms ( writeMs ) where\nimport Control.Monad.State.Strict\n    ( gets, modify, evalStateT )\nimport Control.Monad ( MonadPlus(mplus), liftM, unless, forM )\nimport Data.Containers.ListUtils (nubOrd)\nimport Data.Char (isAscii, isLower, isUpper, ord)\nimport Data.List (intercalate, intersperse)\nimport Data.List.NonEmpty (nonEmpty)\nimport qualified Data.Map as Map\nimport Data.Maybe (catMaybes, isNothing)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Network.URI (escapeURIString, isAllowedInURI)\nimport Skylighting\nimport System.FilePath (takeExtension)\nimport Text.Pandoc.Asciify (toAsciiChar)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout hiding (Color)\nimport Text.DocTemplates (lookupContext)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Writers.Roff\nimport Text.Pandoc.Writers.Markdown (writePlain)\nimport Text.Printf (printf)\nimport Text.TeXMath (writeEqn)\nimport qualified Data.Text.Encoding as TE\nimport qualified Data.ByteString as B\n\n-- | Convert Pandoc to Ms.\nwriteMs :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteMs opts document =\n  evalStateT (pandocToMs opts document) defaultWriterState\n\n-- | Return roff ms representation of document.\npandocToMs :: PandocMonad m => WriterOptions -> Pandoc -> MS m Text\npandocToMs opts (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  title <- chomp <$> inlineListToMs' opts (lookupMetaInlines \"title\" meta)\n  metadata <- metaToContext opts\n              (blockListToMs opts)\n              (fmap chomp . inlineListToMs' opts)\n              meta\n  main <- blockListToMs opts blocks\n  hasInlineMath <- gets stHasInlineMath\n  let titleMeta = (escapeStr opts . stringify) $ docTitle meta\n  let authorsMeta = map (escapeStr opts . stringify) $ docAuthors meta\n  hasHighlighting <- gets stHighlighting\n  let highlightingMacros = if hasHighlighting\n                              then case writerHighlightMethod opts of\n                                     Skylighting sty -> styleToMs sty\n                                     _ -> mempty\n                              else mempty\n\n  let context = defField \"body\" main\n              $ defField \"has-inline-math\" hasInlineMath\n              $ defField \"hyphenate\" True\n              $ defField \"toc\" (writerTableOfContents opts)\n              $ defField \"title-meta\" titleMeta\n              $ defField \"author-meta\" (T.intercalate \"; \" authorsMeta)\n              $ defField \"highlighting-macros\" highlightingMacros\n              $ resetField \"title\" title metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\nescapeStr :: WriterOptions -> Text -> Text\nescapeStr opts =\n  escapeString False (if writerPreferAscii opts then AsciiOnly else AllowUTF8)\n\n-- In PDFs we need to escape parentheses and backslash.\n-- In PDF we need to encode as UTF-16 BE.\nescapePDFString :: Text -> Text\nescapePDFString t\n  | T.all (\\c -> isAscii c && c /= '(' && c /= ')' && c /= '\\\\' && c /= '\"') t = t\n  | otherwise = (\"\\\\376\\\\377\" <>) .  -- add bom\n    mconcat . map encodeChar .  T.unpack $ t\n where\n  encodeChar c =\n    if isAscii c && c /= '\\\\' && c /= '(' && c /= ')'\n       then \"\\\\000\" <> T.singleton c\n       else mconcat . map toOctal . B.unpack . TE.encodeUtf16BE $ T.singleton c\n  toOctal n = \"\\\\\" <> T.pack (printf \"%03o\" n)\n\nescapeUri :: Text -> Text\nescapeUri = T.pack . escapeURIString (\\c -> c /= '@' && isAllowedInURI c) . T.unpack\n\ntoSmallCaps :: WriterOptions -> Text -> Text\ntoSmallCaps opts s = case T.uncons s of\n  Nothing -> \"\"\n  Just (c, cs)\n    | isLower c -> let (lowers,rest) = T.span isLower s\n                   in  \"\\\\s-2\" <> escapeStr opts (T.toUpper lowers) <>\n                       \"\\\\s0\" <> toSmallCaps opts rest\n    | isUpper c -> let (uppers,rest) = T.span isUpper s\n                   in  escapeStr opts uppers <> toSmallCaps opts rest\n    | otherwise -> escapeStr opts (T.singleton c) <> toSmallCaps opts cs\n\n-- We split inline lists into sentences, and print one sentence per\n-- line.  roff treats the line-ending period differently.\n-- See http://code.google.com/p/pandoc/issues/detail?id=148.\n\ngetPdfEngine :: WriterOptions -> Maybe Text\ngetPdfEngine opts = lookupContext \"pdf-engine\" (writerVariables opts)\n\nblockToMs :: PandocMonad m\n          => WriterOptions -- ^ Options\n          -> Block         -- ^ Block element\n          -> MS m (Doc Text)\nblockToMs opts (Div (ident,cls,kvs) bs) = do\n  let anchor = if isNothing (getPdfEngine opts) || T.null ident\n                  then empty\n                  else nowrap $\n                         literal \".pdfhref M \"\n                         <> doubleQuotes (literal (toAscii ident))\n  case cls of\n    _ | \"csl-entry\" `elem` cls ->\n       (\".CSLENTRY\" $$) . vcat <$> mapM (cslEntryToMs True opts) bs\n      | \"csl-bib-body\" `elem` cls -> do\n       res <- blockListToMs opts bs\n       return $ anchor $$\n                -- so that XP paragraphs are indented:\n                \".nr PI 3n\" $$\n                -- space between entries\n                \".de CSLENTRY\" $$\n                (case lookup \"entry-spacing\" kvs >>= safeRead of\n                   Just n | n > (0 :: Int) -> \".sp\"\n                   _ -> mempty) $$\n                \"..\" $$\n                \".de CSLP\" $$\n                (if \"hanging-indent\" `elem` cls\n                    then \".XP\"\n                    else \".LP\") $$\n                \"..\" $$\n                res\n    _ -> do\n       setFirstPara\n       res <- blockListToMs opts bs\n       setFirstPara\n       return $ anchor $$ res\nblockToMs opts (Plain inlines) =\n  splitSentences <$> inlineListToMs' opts inlines\nblockToMs opts (Para inlines) = do\n  firstPara <- gets stFirstPara\n  resetFirstPara\n  contents <- inlineListToMs' opts inlines\n  return $ literal (if firstPara then \".LP\" else \".PP\") $$\n           splitSentences contents\nblockToMs _ b@(RawBlock f str)\n  | f == Format \"ms\" = return $ literal str\n  | otherwise        = do\n      report $ BlockNotRendered b\n      return empty\nblockToMs _ HorizontalRule = do\n  resetFirstPara\n  return $ literal \".HLINE\"\nblockToMs opts (Header level (ident,classes,_) inlines) = do\n  setFirstPara\n  modify $ \\st -> st{ stInHeader = True }\n  let inlines' = map breakToSpace inlines\n  contents <- inlineListToMs' opts inlines'\n  plainContents <- inlinesToPlain inlines'\n  modify $ \\st -> st{ stInHeader = False }\n  let (heading, secnum) = if writerNumberSections opts &&\n                              \"unnumbered\" `notElem` classes\n                             then (\".NH\", \"\\\\*[SN]\")\n                             else (\".SH\", \"\")\n  let mbPdfEngine = getPdfEngine opts\n  let anchor = if T.null ident\n                  then empty\n                  else nowrap $\n                         literal \".pdfhref M \"\n                         <> doubleQuotes (literal (toAscii ident))\n  let bookmark = literal \".pdfhref O \" <> literal (tshow level <> \" \") <>\n                      nowrap (doubleQuotes\n                              (literal $ secnum <>\n                                      (if T.null secnum\n                                          then \"\"\n                                          else \"  \") <>\n                                      (case mbPdfEngine of\n                                         Just \"groff\" -> id\n                                         _ -> escapePDFString)\n                                        plainContents))\n  let backlink = nowrap (literal \".pdfhref L -D \" <>\n       doubleQuotes (literal (toAscii ident)) <> space <> literal \"\\\\\") <> cr <>\n       literal \" -- \"\n  let tocEntry = if writerTableOfContents opts &&\n                     level <= writerTOCDepth opts\n                    then literal \".XS\"\n                         $$ backlink <> doubleQuotes (\n                            nowrap (literal (T.replicate level \"\\t\") <>\n                             (if T.null secnum\n                                 then empty\n                                 else literal secnum <> literal \"\\\\~\\\\~\")\n                              <> contents))\n                         $$ literal \".XE\"\n                    else empty\n  modify $ \\st -> st{ stFirstPara = True }\n  return $ (literal heading <> space <> literal (tshow level)) $$\n           contents $$\n           case mbPdfEngine of\n             Nothing -> mempty\n             Just _ -> bookmark $$ anchor $$ tocEntry\nblockToMs opts (CodeBlock attr str) = do\n  hlCode <- highlightCode opts attr str\n  setFirstPara\n  return $\n    literal \".IP\" $$\n    literal \".nf\" $$\n    literal \"\\\\f[C]\" $$\n    ((case T.uncons str of\n      Just ('.',_) -> literal \"\\\\&\"\n      _            -> mempty) <> hlCode) $$\n    literal \"\\\\f[]\" $$\n    literal \".fi\"\nblockToMs opts (LineBlock ls) = do\n  setFirstPara  -- use .LP, see #5588\n  blockToMs opts $ Para $ intercalate [LineBreak] ls\nblockToMs opts (BlockQuote blocks) = do\n  setFirstPara\n  contents <- blockListToMs opts blocks\n  setFirstPara\n  return $ literal \".QS\" $$ contents $$ literal \".QE\"\nblockToMs opts (Table _ blkCapt specs thead tbody tfoot) =\n  let (caption, alignments, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n      aligncode AlignLeft    = \"l\"\n      aligncode AlignRight   = \"r\"\n      aligncode AlignCenter  = \"c\"\n      aligncode AlignDefault = \"l\"\n  in do\n  caption' <- inlineListToMs' opts caption\n  let isSimple = all (== 0) widths\n  let totalWidth = 70\n  -- 78n default width - 8n indent = 70n\n  let coldescriptions = literal $ T.unwords\n                        (zipWith (\\align width -> aligncode align <>\n                                    if width == 0\n                                       then \"\"\n                                       else T.pack $\n                                              printf \"w(%0.1fn)\"\n                                              (totalWidth * width))\n                        alignments widths) <> \".\"\n  colheadings <- mapM (blockListToMs opts) headers\n  let makeRow cols = literal \"T{\" $$\n                     vcat (intersperse (literal \"T}\\tT{\") cols) $$\n                     literal \"T}\"\n  let colheadings' = if all null headers\n                        then empty\n                        else makeRow colheadings $$ char '_'\n  body <- mapM (\\row -> do\n                         cols <- mapM (\\(cell, w) ->\n                                   (if isSimple\n                                       then id\n                                       else (literal (\".nr LL \" <>\n                                              T.pack (printf \"%0.1fn\"\n                                                (w * totalWidth))) $$)) <$>\n                                   blockListToMs opts cell) (zip row widths)\n                         return $ makeRow cols) rows\n  setFirstPara\n  return $ literal \".PP\" $$ caption' $$\n           literal \".na\" $$ -- we don't want justification in table cells\n           (if isSimple\n               then \"\"\n               else \".nr LLold \\\\n[LL]\") $$\n           literal \".TS\" $$ literal \"delim(@@) tab(\\t);\" $$ coldescriptions $$\n           colheadings' $$ vcat body $$ literal \".TE\" $$\n           (if isSimple\n               then \"\"\n               else \".nr LL \\\\n[LLold]\") $$\n           literal \".ad\"\nblockToMs opts (BulletList items) = do\n  contents <- mapM (bulletListItemToMs opts) items\n  setFirstPara\n  return (vcat contents)\nblockToMs opts (OrderedList attribs items) = do\n  let markers = take (length items) $ orderedListMarkers attribs\n  let indent = 2 + maybe 0 maximum (nonEmpty (map T.length markers))\n  contents <- mapM (\\(num, item) -> orderedListItemToMs opts num indent item) $\n              zip markers items\n  setFirstPara\n  return (vcat contents)\nblockToMs opts (DefinitionList items) = do\n  contents <- mapM (definitionListItemToMs opts) items\n  setFirstPara\n  return (vcat contents)\nblockToMs opts (Figure figattr (Caption _ caption) body) =\n  case body of\n    [Plain [ Image attr _alt (src, _tit) ]] -> do\n       let ext = takeExtension (T.unpack src)\n       let sizeAttrs = getSizeAttrs opts attr\n       capt <- blockToMs opts (Div figattr caption)\n       let captlines = height capt\n       let cmd = case ext of\n                   \".ps\" -> \".PSPIC\"\n                   \".eps\" -> \".PSPIC\"\n                   \".pdf\" -> \".PDFPIC\"\n                   _ -> \"\\\\\\\" .IMAGE\"\n       return $ nowrap (literal cmd <+>\n                    doubleQuotes (literal src) <>\n                    sizeAttrs) $$\n                  literal (\".ce \" <> tshow captlines) $$\n                  capt $$\n                  literal \".sp 1\"\n    _ -> blockToMs opts $ Div figattr body\n\n-- | Convert bullet list item (list of blocks) to ms.\nbulletListItemToMs :: PandocMonad m => WriterOptions -> [Block] -> MS m (Doc Text)\nbulletListItemToMs _ [] = return empty\nbulletListItemToMs opts (Para first:rest) =\n  bulletListItemToMs opts (Plain first:rest)\nbulletListItemToMs opts (Plain first:rest) = do\n  first' <- blockToMs opts (Plain first)\n  rest' <- blockListToMs opts rest\n  let first'' = literal \".IP \\\\(bu 3\" $$ first'\n  let rest''  = if null rest\n                   then empty\n                   else literal \".RS 3\" $$ rest' $$ literal \".RE\"\n  return (first'' $$ rest'')\nbulletListItemToMs opts (first:rest) = do\n  first' <- blockToMs opts first\n  rest' <- blockListToMs opts rest\n  return $ literal \"\\\\(bu .RS 3\" $$ first' $$ rest' $$ literal \".RE\"\n\n-- | Convert ordered list item (a list of blocks) to ms.\norderedListItemToMs :: PandocMonad m\n                    => WriterOptions -- ^ options\n                    -> Text   -- ^ order marker for list item\n                    -> Int      -- ^ number of spaces to indent\n                    -> [Block]  -- ^ list item (list of blocks)\n                    -> MS m (Doc Text)\norderedListItemToMs _ _ _ [] = return empty\norderedListItemToMs opts num indent (Para first:rest) =\n  orderedListItemToMs opts num indent (Plain first:rest)\norderedListItemToMs opts num indent (first:rest) = do\n  first' <- blockToMs opts first\n  rest' <- blockListToMs opts rest\n  let num' = T.pack $ printf (\"%\" <> show (indent - 1) <> \"s\") num\n  let first'' = literal (\".IP \\\"\" <> num' <> \"\\\" \" <> tshow indent) $$ first'\n  let rest''  = if null rest\n                   then empty\n                   else literal \".RS \" <> literal (tshow indent) $$\n                         rest' $$ literal \".RE\"\n  return $ first'' $$ rest''\n\n-- | Convert definition list item (label, list of blocks) to ms.\ndefinitionListItemToMs :: PandocMonad m\n                       => WriterOptions\n                       -> ([Inline],[[Block]])\n                       -> MS m (Doc Text)\ndefinitionListItemToMs opts (label, defs) = do\n  labelText <- withFontFeature 'B' $\n                 inlineListToMs' opts $ map breakToSpace label\n  contents <- if null defs\n                 then return empty\n                 else liftM vcat $ forM defs $ \\blocks -> do\n                        let (first, rest) = case blocks of\n                              (Para x:y) -> (Plain x,y)\n                              (x:y)      -> (x,y)\n                              []         -> (Plain [], [])\n                                               -- should not happen\n                        rest' <- liftM vcat $\n                                  mapM (\\item -> blockToMs opts item) rest\n                        first' <- blockToMs opts first\n                        return $ first' $$ literal \".RS 3\" $$ rest' $$ literal \".RE\"\n  return $ nowrap (literal \".IP \" <> doubleQuotes labelText <> \" 3\") $$\n           contents\n\n-- | Convert list of Pandoc block elements to ms.\nblockListToMs :: PandocMonad m\n              => WriterOptions -- ^ Options\n              -> [Block]       -- ^ List of block elements\n              -> MS m (Doc Text)\nblockListToMs opts blocks =\n  vcat <$> mapM (blockToMs opts) blocks\n\n-- | Convert list of Pandoc inline elements to ms.\ninlineListToMs :: PandocMonad m => WriterOptions -> [Inline] -> MS m (Doc Text)\n-- if list starts with ., insert a zero-width character \\& so it\n-- won't be interpreted as markup if it falls at the beginning of a line.\ninlineListToMs opts lst = hcat <$> mapM (inlineToMs opts) lst\n\n-- This version to be used when there is no further inline content;\n-- forces a note at the end.\ninlineListToMs' :: PandocMonad m => WriterOptions -> [Inline] -> MS m (Doc Text)\ninlineListToMs' opts lst = do\n  x <- hcat <$> mapM (inlineToMs opts) lst\n  y <- handleNotes opts empty\n  return $ x <> y\n\n-- | Convert Pandoc inline element to ms.\ninlineToMs :: PandocMonad m => WriterOptions -> Inline -> MS m (Doc Text)\ninlineToMs opts (Span _ ils) = inlineListToMs opts ils\ninlineToMs opts (Emph lst) =\n  withFontFeature 'I' (inlineListToMs opts lst)\ninlineToMs opts (Underline lst) =\n  inlineToMs opts (Emph lst)\ninlineToMs opts (Strong lst) =\n  withFontFeature 'B' (inlineListToMs opts lst)\ninlineToMs opts (Strikeout lst) = do\n  contents <- inlineListToMs opts lst\n  -- we use grey color instead of strikeout, which seems quite\n  -- hard to do in roff for arbitrary bits of text\n  return $ literal \"\\\\m[strikecolor]\" <> contents <> literal \"\\\\m[]\"\ninlineToMs opts (Superscript lst) = do\n  contents <- inlineListToMs opts lst\n  return $ literal \"\\\\*{\" <> contents <> literal \"\\\\*}\"\ninlineToMs opts (Subscript lst) = do\n  contents <- inlineListToMs opts lst\n  return $ literal \"\\\\*<\" <> contents <> literal \"\\\\*>\"\ninlineToMs opts (SmallCaps lst) = do\n  -- see https://lists.gnu.org/archive/html/groff/2015-01/msg00016.html\n  modify $ \\st -> st{ stSmallCaps = not (stSmallCaps st) }\n  res <- inlineListToMs opts lst\n  modify $ \\st -> st{ stSmallCaps = not (stSmallCaps st) }\n  return res\ninlineToMs opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToMs opts lst\n  return $ char '`' <> contents <> char '\\''\ninlineToMs opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToMs opts lst\n  return $ literal \"\\\\(lq\" <> contents <> literal \"\\\\(rq\"\ninlineToMs opts (Cite _ lst) =\n  inlineListToMs opts lst\ninlineToMs opts (Code attr str) = do\n  hlCode <- highlightCode opts attr str\n  withFontFeature 'C' (return hlCode)\ninlineToMs opts (Str str) = do\n  let shim = case T.uncons str of\n                  Just ('.',_) -> afterBreak \"\\\\&\"\n                  _            -> empty\n  smallcaps <- gets stSmallCaps\n  if smallcaps\n     then return $ shim <> literal (toSmallCaps opts str)\n     else return $ shim <> literal (escapeStr opts str)\ninlineToMs opts (Math InlineMath str) = do\n  modify $ \\st -> st{ stHasInlineMath = True }\n  res <- convertMath writeEqn InlineMath str\n  case res of\n       Left il -> inlineToMs opts il\n       Right r -> return $ literal \"@\" <> literal r <> literal \"@\"\ninlineToMs opts (Math DisplayMath str) = do\n  res <- convertMath writeEqn DisplayMath str\n  case res of\n       Left il -> do\n         contents <- inlineToMs opts il\n         return $ cr <> literal \".RS 3\" $$ contents $$ literal \".RE\"\n       Right r -> return $\n            cr <> literal \".EQ\" $$ literal r $$ literal \".EN\" <> cr\ninlineToMs _ il@(RawInline f str)\n  | f == Format \"ms\" = return $ literal str\n  | otherwise        = do\n    report $ InlineNotRendered il\n    return empty\ninlineToMs _ LineBreak = return $ cr <> literal \".br\" <> cr\ninlineToMs opts SoftBreak =\n  handleNotes opts $\n    case writerWrapText opts of\n         WrapAuto     -> space\n         WrapNone     -> space\n         WrapPreserve -> cr\ninlineToMs opts Space = handleNotes opts space\ninlineToMs opts (Link _ txt (T.uncons -> Just ('#',ident), _)) = do\n  -- internal link\n  contents <- inlineListToMs' opts $ map breakToSpace txt\n  return $\n    case getPdfEngine opts of\n      Just _ -> literal \"\\\\c\" <> cr <> nowrap (literal \".pdfhref L -D \" <>\n            doubleQuotes (literal (toAscii ident)) <> literal \" -A \" <>\n            doubleQuotes (literal \"\\\\c\") <> space <> literal \"\\\\\") <> cr <>\n            literal \" -- \" <> doubleQuotes (nowrap contents) <> cr <>\n            literal \"\\\\&\"\n      Nothing -> contents\ninlineToMs opts (Link _ txt (src, _)) = do\n  -- external link\n  contents <- inlineListToMs' opts $ map breakToSpace txt\n  return $\n    case getPdfEngine opts of\n      Just _ -> literal \"\\\\c\" <> cr <> nowrap (literal \".pdfhref W -D \" <>\n            doubleQuotes (literal (escapeUri src)) <> literal \" -A \" <>\n            doubleQuotes (literal \"\\\\c\") <> space <> literal \"\\\\\") <> cr <>\n            literal \" -- \" <> doubleQuotes (nowrap contents) <> cr <>\n            literal \"\\\\&\"\n      Nothing -> contents\ninlineToMs opts (Image attr alternate (src, _)) = do\n  let desc = literal \"[IMAGE: \" <>\n             literal (escapeStr opts (stringify alternate)) <> char ']'\n  let sizeAttrs = getSizeAttrs opts attr\n  let ext = takeExtension (T.unpack src)\n  let cmd = case ext of\n             \".ps\" -> \".PSPIC\"\n             \".eps\" -> \".PSPIC\"\n             \".pdf\" -> \".PDFPIC\"\n             _ -> \"\"\n  return $ cr <> nowrap\n    (if T.null cmd\n        then desc <> \" \\\\\\\" \" <> doubleQuotes (literal src) <> sizeAttrs\n        else literal cmd <+> doubleQuotes (literal src) <> sizeAttrs) <> cr\ninlineToMs _ (Note contents) = do\n  modify $ \\st -> st{ stNotes = contents : stNotes st }\n  return $ literal \"\\\\**\"\n\ncslEntryToMs :: PandocMonad m\n             => Bool\n             -> WriterOptions\n             -> Block\n             -> MS m (Doc Text)\ncslEntryToMs atStart opts (Para xs) =\n  case xs of\n    (Span (\"\",[\"csl-left-margin\"],[]) lils :\n      rest@(Span (\"\",[\"csl-right-inline\"],[]) _ : _))\n      -> do lils' <- inlineListToMs' opts lils\n            ((cr <> literal \".IP \" <>\n              doubleQuotes (nowrap lils') <>\n              literal \" 5\") $$)\n                <$> cslEntryToMs False opts (Para rest)\n    (Span (\"\",[\"csl-block\"],[]) ils : rest)\n      -> ((cr <> literal \".LP\") $$)\n                <$> cslEntryToMs False opts (Para (ils ++ rest))\n    (Span (\"\",[\"csl-left-margin\"],[]) ils : rest)\n      -> ((cr <> literal \".LP\") $$)\n              <$> cslEntryToMs False opts (Para (ils ++ rest))\n    (Span (\"\",[\"csl-indented\"],[]) ils : rest)\n      -> ((cr <> literal \".LP\") $$)\n              <$> cslEntryToMs False opts (Para (ils ++ rest))\n    _ | atStart\n         -> (\".CSLP\" $$) <$> cslEntryToMs False opts (Para xs)\n      | otherwise\n         -> case xs of\n           [] -> return mempty\n           (x:rest) -> (<>) <$> inlineToMs opts x\n                            <*> cslEntryToMs False opts (Para rest)\ncslEntryToMs _ opts x = blockToMs opts x\n\n\nhandleNotes :: PandocMonad m => WriterOptions -> Doc Text -> MS m (Doc Text)\nhandleNotes opts fallback = do\n  notes <- gets stNotes\n  if null notes\n     then return fallback\n     else do\n       modify $ \\st -> st{ stNotes = [] }\n       vcat <$> mapM (handleNote opts) notes\n\nhandleNote :: PandocMonad m => WriterOptions -> Note -> MS m (Doc Text)\nhandleNote opts bs = do\n  -- don't start with Paragraph or we'll get a spurious blank\n  -- line after the note ref:\n  let bs' = case bs of\n                 (Para ils : rest) -> Plain ils : rest\n                 _                 -> bs\n  contents <- blockListToMs opts bs'\n  return $ cr <> literal \".FS\" $$ contents $$ literal \".FE\" <> cr\n\nsetFirstPara :: PandocMonad m => MS m ()\nsetFirstPara = modify $ \\st -> st{ stFirstPara = True }\n\nresetFirstPara :: PandocMonad m => MS m ()\nresetFirstPara = modify $ \\st -> st{ stFirstPara = False }\n\nbreakToSpace :: Inline -> Inline\nbreakToSpace SoftBreak = Space\nbreakToSpace LineBreak = Space\nbreakToSpace x         = x\n\n-- Highlighting\n\nstyleToMs :: Style -> Doc Text\nstyleToMs sty = vcat $ colordefs <> map (toMacro sty) alltoktypes\n  where alltoktypes = enumFromTo KeywordTok NormalTok\n        colordefs = map toColorDef allcolors\n        toColorDef c = literal (\".defcolor \" <>\n            hexColor c <> \" rgb #\" <> hexColor c)\n        allcolors = catMaybes $ nubOrd $\n          [defaultColor sty, backgroundColor sty,\n           lineNumberColor sty, lineNumberBackgroundColor sty] <>\n           concatMap (colorsForToken. snd) (Map.toList (tokenStyles sty))\n        colorsForToken ts = [tokenColor ts, tokenBackground ts]\n\nhexColor :: Color -> Text\nhexColor (RGB r g b) = T.pack $ printf \"%02x%02x%02x\" r g b\n\ntoMacro :: Style -> TokenType -> Doc Text\ntoMacro sty toktype =\n  nowrap (literal \".ds \" <> literal (tshow toktype) <> literal \" \\\\&\" <>\n            setbg <> setcolor <> setfont <>\n            literal \"\\\\\\\\$1\" <>\n            resetfont <> resetcolor <> resetbg)\n  where setcolor = maybe empty fgcol tokCol\n        resetcolor = maybe empty (const $ literal \"\\\\\\\\m[]\") tokCol\n        setbg = empty -- maybe empty bgcol tokBg\n        resetbg = empty -- maybe empty (const $ text \"\\\\\\\\M[]\") tokBg\n        fgcol c = literal $ \"\\\\\\\\m[\" <> hexColor c <> \"]\"\n        -- bgcol c = literal $ \"\\\\\\\\M[\" <> hexColor c <> \"]\"\n        setfont = if tokBold || tokItalic\n                     then literal $ T.pack $ \"\\\\\\\\f[C\" <> ['B' | tokBold] <>\n                          ['I' | tokItalic] <> \"]\"\n                     else empty\n        resetfont = if tokBold || tokItalic\n                       then literal \"\\\\\\\\f[C]\"\n                       else empty\n        tokSty = Map.lookup toktype (tokenStyles sty)\n        tokCol = (tokSty >>= tokenColor) `mplus` defaultColor sty\n        -- tokBg  = (tokSty >>= tokenBackground) `mplus` backgroundColor sty\n        tokBold = maybe False tokenBold tokSty\n        tokItalic = maybe False tokenItalic tokSty\n        -- tokUnderline = fromMaybe False (tokSty >>= tokUnderline)\n        -- lnColor = lineNumberColor sty\n        -- lnBkgColor = lineNumberBackgroundColor sty\n\nmsFormatter :: WriterOptions -> FormatOptions -> [SourceLine] -> Doc Text\nmsFormatter opts _fmtopts =\n  literal . T.intercalate \"\\n\" . map fmtLine\n where\n  fmtLine = mconcat . map fmtToken\n  fmtToken (toktype, tok) =\n    \"\\\\*[\" <> tshow toktype <> \" \\\"\" <> escapeStr opts tok <> \"\\\"]\"\n\nhighlightCode :: PandocMonad m => WriterOptions -> Attr -> Text -> MS m (Doc Text)\nhighlightCode opts attr str =\n  case highlight (writerSyntaxMap opts) (msFormatter opts) attr str of\n         Left msg -> do\n           unless (T.null msg) $ report $ CouldNotHighlight msg\n           return $ literal (escapeStr opts str)\n         Right h -> do\n           modify (\\st -> st{ stHighlighting = True })\n           return h\n\n-- This is used for PDF anchors.\ntoAscii :: Text -> Text\ntoAscii = T.concatMap\n  (\\c -> case toAsciiChar c of\n              Nothing -> \"_u\" <> tshow (ord c) <> \"_\"\n              Just '/' -> \"_u\" <> tshow (ord c) <> \"_\" -- see #4515\n              Just c' -> T.singleton c')\n\ngetSizeAttrs :: WriterOptions -> Attr -> Doc Text\ngetSizeAttrs opts attr =\n  case (mbW, mbH) of\n     (Just wp, Nothing) -> space <> doubleQuotes\n            (literal (tshow (floor wp :: Int) <> \"p\"))\n     (Just wp, Just hp) -> space <> doubleQuotes\n            (literal (tshow (floor wp :: Int) <> \"p\"))\n            <> space <>\n            doubleQuotes\n             (literal (tshow (floor hp :: Int) <> \"p\"))\n     _ -> empty\n where\n  mbW = inPoints opts <$> dimension Width attr\n  mbH = inPoints opts <$> dimension Height attr\n\ninlinesToPlain :: PandocMonad m => [Inline] -> m Text\ninlinesToPlain ils = T.strip <$> writePlain def{ writerWrapText = WrapNone }\n                                    (Pandoc nullMeta [Plain ils])\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Muse.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Writers.Muse\n   Copyright   : Copyright (C) 2017-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Krotov <ilabdsf@gmail.com>\n   Stability   : stable\n   Portability : portable\n\nConversion of 'Pandoc' documents to Muse.\n\nThis module is mostly intended for <https://amusewiki.org/ Amusewiki> markup support,\nas described by <https://amusewiki.org/library/manual Text::Amuse markup manual>.\nOriginal <https://www.gnu.org/software/emacs-muse/ Emacs Muse> markup support\nis a secondary goal.\n\nWhere Text::Amuse markup\n<https://metacpan.org/pod/Text::Amuse#DIFFERENCES-WITH-THE-ORIGINAL-EMACS-MUSE-MARKUP differs>\nfrom <https://www.gnu.org/software/emacs-muse/manual/ Emacs Muse markup>,\nText::Amuse markup is supported.\nFor example, native tables are always used instead of Org Mode tables.\nHowever, @\\<literal style=\"html\">@ tag is used for HTML raw blocks\neven though it is supported only in Emacs Muse.\n-}\nmodule Text.Pandoc.Writers.Muse (writeMuse) where\nimport Control.Monad (zipWithM)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.Reader\n    ( asks, MonadReader(local), ReaderT(runReaderT) )\nimport Control.Monad.State.Strict\n    ( StateT, gets, modify, evalStateT )\nimport Data.Char (isAlphaNum, isAsciiLower, isAsciiUpper, isDigit, isSpace)\nimport Data.Default\nimport Data.List (intersperse, transpose)\nimport Data.List.NonEmpty (nonEmpty, NonEmpty(..))\nimport qualified Data.Set as Set\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport System.FilePath (takeExtension)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\n\ntype Notes = [[Block]]\n\ntype Muse m = ReaderT WriterEnv (StateT WriterState m)\n\ndata WriterEnv =\n  WriterEnv { envOptions               :: WriterOptions\n            , envTopLevel              :: Bool\n            , envInsideBlock           :: Bool\n            , envInlineStart           :: Bool -- ^ True if there is only whitespace since last newline\n            , envInsideLinkDescription :: Bool -- ^ Escape ] if True\n            , envAfterSpace            :: Bool -- ^ There is whitespace (not just newline) before\n            , envOneLine               :: Bool -- ^ True if newlines are not allowed\n            , envInsideAsterisks       :: Bool -- ^ True if outer element is emphasis with asterisks\n            , envNearAsterisks         :: Bool -- ^ Rendering inline near asterisks\n            }\n\ndata WriterState =\n  WriterState { stNotes   :: Notes\n              , stNoteNum :: Int\n              , stIds     :: Set.Set Text\n              , stUseTags :: Bool -- ^ Use tags for emphasis, for example because previous character is a letter\n              }\n\ninstance Default WriterState\n  where def = WriterState { stNotes = []\n                          , stNoteNum = 1\n                          , stIds = Set.empty\n                          , stUseTags = False\n                          }\n\nevalMuse :: PandocMonad m => Muse m a -> WriterEnv -> WriterState -> m a\nevalMuse document env = evalStateT $ runReaderT document env\n\n-- | Convert Pandoc to Muse.\nwriteMuse :: PandocMonad m\n          => WriterOptions\n          -> Pandoc\n          -> m Text\nwriteMuse opts document =\n  evalMuse (pandocToMuse document) env def\n  where env = WriterEnv { envOptions = opts\n                        , envTopLevel = True\n                        , envInsideBlock = False\n                        , envInlineStart = True\n                        , envInsideLinkDescription = False\n                        , envAfterSpace = False\n                        , envOneLine = False\n                        , envInsideAsterisks = False\n                        , envNearAsterisks = False\n                        }\n\n-- | Return Muse representation of document.\npandocToMuse :: PandocMonad m\n             => Pandoc\n             -> Muse m Text\npandocToMuse (Pandoc meta blocks) = do\n  opts <- asks envOptions\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  metadata <- metaToContext opts\n               blockListToMuse\n               (fmap chomp . inlineListToMuse)\n               meta\n  body <- blockListToMuse blocks\n  notes <- currentNotesToMuse\n  let main = body $+$ notes\n  let context = defField \"body\" main metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\n-- | Helper function for flatBlockListToMuse\n-- | Render all blocks and insert blank lines between the first two\ncatWithBlankLines :: PandocMonad m\n                  => [Block]       -- ^ List of block elements\n                  -> Int           -- ^ Number of blank lines\n                  -> Muse m (Doc Text)\ncatWithBlankLines (b : bs) n = do\n  b' <- blockToMuseWithNotes b\n  bs' <- flatBlockListToMuse bs\n  return $ b' <> blanklines n <> bs'\ncatWithBlankLines _ _ = error \"Expected at least one block\"\n\n-- | Convert list of Pandoc block elements to Muse\n-- | without setting envTopLevel.\nflatBlockListToMuse :: PandocMonad m\n                => [Block]       -- ^ List of block elements\n                -> Muse m (Doc Text)\nflatBlockListToMuse bs@(BulletList _ : BulletList _ : _) = catWithBlankLines bs 2\nflatBlockListToMuse bs@(OrderedList (_, style1, _) _ : OrderedList (_, style2, _) _ : _) =\n  catWithBlankLines bs (if style1' == style2' then 2 else 0)\n    where\n      style1' = normalizeStyle style1\n      style2' = normalizeStyle style2\n      normalizeStyle DefaultStyle = Decimal\n      normalizeStyle s            = s\nflatBlockListToMuse bs@(DefinitionList _ : DefinitionList _ : _) = catWithBlankLines bs 2\nflatBlockListToMuse bs@(_ : _) = catWithBlankLines bs 0\nflatBlockListToMuse [] = return mempty\n\nsimpleTable :: PandocMonad m\n            => [Inline]\n            -> [[Block]]\n            -> [[[Block]]]\n            -> Muse m (Doc Text)\nsimpleTable caption headers rows = do\n  topLevel <- asks envTopLevel\n  caption' <- inlineListToMuse caption\n  headers' <- mapM blockListToMuse headers\n  rows' <- mapM (mapM blockListToMuse) rows\n  let widthsInChars = maybe 0 maximum . nonEmpty . map offset <$>\n                       transpose (headers' : rows')\n  let hpipeBlocks sep blocks = hcat $ intersperse sep' blocks\n        where sep' = lblock (T.length sep) $ literal sep\n  let makeRow sep = hpipeBlocks sep . zipWith lblock widthsInChars\n  let head' = makeRow \" || \" headers'\n  rows'' <- mapM (\\row -> makeRow rowSeparator <$> mapM blockListToMuse row) rows\n  let body = vcat rows''\n  return $ (if topLevel then nest 1 else id) ((if noHeaders then empty else head')\n                                             $$ body\n                                             $$ (if null caption then empty else \"|+ \" <> caption' <> \" +|\"))\n         $$ blankline\n  where noHeaders = all null headers\n        rowSeparator = if noHeaders then \" | \" else \" |  \"\n\n-- | Convert list of Pandoc block elements to Muse.\nblockListToMuse :: PandocMonad m\n                => [Block]       -- ^ List of block elements\n                -> Muse m (Doc Text)\nblockListToMuse =\n  local (\\env -> env { envTopLevel = not (envInsideBlock env)\n                     , envInsideBlock = True\n                     }) . flatBlockListToMuse\n\n-- | Convert Pandoc block element to Muse.\nblockToMuse :: PandocMonad m\n            => Block         -- ^ Block element\n            -> Muse m (Doc Text)\nblockToMuse (Plain inlines) = inlineListToMuse' inlines\nblockToMuse (Para inlines) = do\n  contents <- inlineListToMuse' inlines\n  return $ contents <> blankline\nblockToMuse (LineBlock lns) = do\n  lns' <- local (\\env -> env { envOneLine = True }) $ mapM inlineListToMuse lns\n  return $ nowrap $ vcat (map (literal \"> \" <>) lns') <> blankline\nblockToMuse (CodeBlock (_,_,_) str) =\n  return $ \"<example>\" $$ literal str $$ \"</example>\" $$ blankline\nblockToMuse (RawBlock (Format format) str) =\n  return $ blankline $$ \"<literal style=\\\"\" <> literal format <> \"\\\">\" $$\n           literal str $$ \"</literal>\" $$ blankline\nblockToMuse (BlockQuote blocks) = do\n  contents <- flatBlockListToMuse blocks\n  return $ blankline\n        <> \"<quote>\"\n        $$ nest 0 contents -- nest 0 to remove trailing blank lines\n        $$ \"</quote>\"\n        <> blankline\nblockToMuse (OrderedList (start, style, _) items) = do\n  let markers = take (length items) $ orderedListMarkers\n                                      (start, style, Period)\n  contents <- zipWithM orderedListItemToMuse markers items\n  topLevel <- asks envTopLevel\n  return $ (if topLevel then nest 1 else id) (vcat contents) $$ blankline\n  where orderedListItemToMuse :: PandocMonad m\n                              => Text     -- marker for list item\n                              -> [Block]  -- list item (list of blocks)\n                              -> Muse m (Doc Text)\n        orderedListItemToMuse marker item = hang (T.length marker + 1) (literal marker <> space)\n          <$> blockListToMuse item\nblockToMuse (BulletList items) = do\n  contents <- mapM bulletListItemToMuse items\n  topLevel <- asks envTopLevel\n  return $ (if topLevel then nest 1 else id) (vcat contents) $$ blankline\n  where bulletListItemToMuse :: PandocMonad m\n                             => [Block]\n                             -> Muse m (Doc Text)\n        bulletListItemToMuse item = do\n          modify $ \\st -> st { stUseTags = False }\n          hang 2 \"- \" <$> blockListToMuse item\nblockToMuse (DefinitionList items) = do\n  contents <- mapM definitionListItemToMuse items\n  topLevel <- asks envTopLevel\n  return $ (if topLevel then nest 1 else id) (vcat contents) $$ blankline\n  where definitionListItemToMuse :: PandocMonad m\n                                 => ([Inline], [[Block]])\n                                 -> Muse m (Doc Text)\n        definitionListItemToMuse (label, defs) = do\n          modify $ \\st -> st { stUseTags = False }\n          label' <- local (\\env -> env { envOneLine = True, envAfterSpace = True }) $ inlineListToMuse' label\n          let ind = offset' label' -- using Text.DocLayout.offset results in round trip failures\n          hang ind (nowrap label') . vcat <$> mapM descriptionToMuse defs\n          where offset' d = maximum (0 :| map T.length\n                                         (T.lines $ render Nothing d))\n        descriptionToMuse :: PandocMonad m\n                          => [Block]\n                          -> Muse m (Doc Text)\n        descriptionToMuse desc = hang 4 \" :: \" <$> blockListToMuse desc\nblockToMuse (Header level (ident,_,_) inlines) = do\n  opts <- asks envOptions\n  topLevel <- asks envTopLevel\n  contents <- local (\\env -> env { envOneLine = True }) $ inlineListToMuse' inlines\n  ids <- gets stIds\n  let autoId = uniqueIdent (writerExtensions opts) inlines ids\n  modify $ \\st -> st{ stIds = Set.insert autoId ids }\n\n  let attr' = if T.null ident || (isEnabled Ext_auto_identifiers opts && ident == autoId)\n                 then empty\n                 else \"#\" <> literal ident <> cr\n  let header' = if topLevel then literal (T.replicate level \"*\") <> space else mempty\n  return $ blankline <> attr' $$ nowrap (header' <> contents) <> blankline\n-- https://www.gnu.org/software/emacs-muse/manual/muse.html#Horizontal-Rules-and-Anchors\nblockToMuse HorizontalRule = return $ blankline $$ \"----\" $$ blankline\nblockToMuse (Table _ blkCapt specs thead@(TableHead hattr hrows) tbody tfoot) =\n  if isSimple && numcols > 1\n    then simpleTable caption headers rows\n    else do\n      opts <- asks envOptions\n      let tbody' = case hrows of\n                     [] -> tbody\n                     _  -> TableBody nullAttr 0 [] hrows : tbody\n      gridTable opts blocksToDoc specs (TableHead hattr []) tbody' tfoot\n  where\n    (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n    blocksToDoc opts blocks =\n      local (\\env -> env { envOptions = opts }) $ blockListToMuse blocks\n    numcols = maximum\n              (length aligns :| length widths : map length (headers:rows))\n    isSimple = onlySimpleTableCells (headers : rows) && all (== 0) widths\nblockToMuse (Div _ bs) = flatBlockListToMuse bs\nblockToMuse (Figure attr capt body) = do\n  blockToMuse (figureDiv attr capt body)\n\n-- | Return Muse representation of notes collected so far.\ncurrentNotesToMuse :: PandocMonad m\n                   => Muse m (Doc Text)\ncurrentNotesToMuse = do\n  notes <- reverse <$> gets stNotes\n  modify $ \\st -> st { stNotes = mempty }\n  notesToMuse notes\n\n-- | Return Muse representation of notes.\nnotesToMuse :: PandocMonad m\n            => Notes\n            -> Muse m (Doc Text)\nnotesToMuse notes = do\n  n <- gets stNoteNum\n  modify $ \\st -> st { stNoteNum = stNoteNum st + length notes }\n  vsep <$> zipWithM noteToMuse [n ..] notes\n\n-- | Return Muse representation of a note.\nnoteToMuse :: PandocMonad m\n           => Int\n           -> [Block]\n           -> Muse m (Doc Text)\nnoteToMuse num note = do\n  res <- hang (T.length marker) (literal marker) <$>\n    local (\\env -> env { envInsideBlock = True\n                       , envInlineStart = True\n                       , envAfterSpace = True\n                       }) (blockListToMuse note)\n  return $ res <> blankline\n  where\n    marker = \"[\" <> tshow num <> \"] \"\n\n-- | Return Muse representation of block and accumulated notes.\nblockToMuseWithNotes :: PandocMonad m\n                     => Block\n                     -> Muse m (Doc Text)\nblockToMuseWithNotes blk = do\n  topLevel <- asks envTopLevel\n  opts <- asks envOptions\n  let hdrToMuse hdr@Header{} = do\n        b <- blockToMuse hdr\n        if topLevel && writerReferenceLocation opts == EndOfSection\n          then do\n            notes <- currentNotesToMuse\n            return $ notes $+$ b\n          else\n            return b\n      hdrToMuse b = blockToMuse b\n  b <- hdrToMuse blk\n  if topLevel && writerReferenceLocation opts == EndOfBlock\n    then do\n           notes <- currentNotesToMuse\n           return $ b $+$ notes <> blankline\n    else return b\n\n-- | Escape special characters for Muse.\nescapeText :: Text -> Text\nescapeText s =\n  \"<verbatim>\" <>\n  T.replace \"</verbatim>\" \"<</verbatim><verbatim>/verbatim>\" s <>\n  \"</verbatim>\"\n\n-- | Replace newlines with spaces\nreplaceNewlines :: Text -> Text\nreplaceNewlines = T.map $ \\c ->\n  if c == '\\n' then ' ' else c\n\nstartsWithMarker :: (Char -> Bool) -> Text -> Bool\nstartsWithMarker f t = case T.uncons $ T.dropWhile f' t of\n  Just ('.', xs) -> T.null xs || isSpace (T.head xs)\n  _              -> False\n  where\n    f' c = c == ' ' || f c\n\ncontainsNotes :: Char -> Char -> Text -> Bool\ncontainsNotes left right = p . T.unpack -- This ought to be a parser\n  where p (left':xs)\n          | left' == left = q xs || p xs\n          | otherwise = p xs\n        p \"\"       = False\n        q (x:xs)\n          | x `elem` (\"123456789\"::String) = r xs || p xs\n          | otherwise = p xs\n        q [] = False\n        r ('0':xs) = r xs || p xs\n        r xs       = s xs || q xs || p xs\n        s (right':xs)\n          | right' == right = True\n          | otherwise = p xs\n        s []      = False\n\n-- | Return True if string should be escaped with <verbatim> tags\nshouldEscapeText :: PandocMonad m\n                   => Text\n                   -> Muse m Bool\nshouldEscapeText s = do\n  insideLink <- asks envInsideLinkDescription\n  return $ T.null s ||\n           T.any (`elem` (\"#*<=|\" :: String)) s ||\n           \"::\" `T.isInfixOf` s ||\n           \"~~\" `T.isInfixOf` s ||\n           \"[[\" `T.isInfixOf` s ||\n           \">>>\" `T.isInfixOf` s ||\n           (\"]\" `T.isInfixOf` s && insideLink) ||\n           containsNotes '[' ']' s ||\n           containsNotes '{' '}' s\n\n-- | Escape special characters for Muse if needed.\nconditionalEscapeText :: PandocMonad m\n                        => Text\n                        -> Muse m Text\nconditionalEscapeText s = do\n  shouldEscape <- shouldEscapeText s\n  return $ if shouldEscape\n             then escapeText s\n             else s\n\n-- Expand Math and Cite before normalizing inline list\npreprocessInlineList :: PandocMonad m\n                     => [Inline]\n                     -> m [Inline]\npreprocessInlineList (Math t str:xs) = (++) <$> texMathToInlines t str <*> preprocessInlineList xs\n-- Amusewiki does not support <cite> tag,\n-- and Emacs Muse citation support is limited\n-- (https://www.gnu.org/software/emacs-muse/manual/html_node/Citations.html#Citation)\n-- so just fallback to expanding inlines.\npreprocessInlineList (Cite _  lst:xs) = (lst ++) <$> preprocessInlineList xs\npreprocessInlineList (x:xs) = (x:) <$> preprocessInlineList xs\npreprocessInlineList [] = return []\n\nreplaceSmallCaps :: Inline -> Inline\nreplaceSmallCaps (SmallCaps lst) = Emph lst\nreplaceSmallCaps x               = x\n\nremoveKeyValues :: Inline -> Inline\nremoveKeyValues (Code (i, cls, _) xs) = Code (i, cls, []) xs\n-- Do not remove attributes from Link\n-- Do not remove attributes, such as \"width\", from Image\n-- Do not remove attributes, such as \"dir\", from Span\nremoveKeyValues x                     = x\n\nnormalizeInlineList :: [Inline] -> [Inline]\nnormalizeInlineList (Str \"\" : xs)\n  = normalizeInlineList xs\nnormalizeInlineList (x : Str \"\" : xs)\n  = normalizeInlineList (x:xs)\nnormalizeInlineList (Str x1 : Str x2 : xs)\n  = normalizeInlineList $ Str (x1 <> x2) : xs\nnormalizeInlineList (Emph x1 : Emph x2 : ils)\n  = normalizeInlineList $ Emph (x1 <> x2) : ils\nnormalizeInlineList (Strong x1 : Strong x2 : ils)\n  = normalizeInlineList $ Strong (x1 <> x2) : ils\nnormalizeInlineList (Strikeout x1 : Strikeout x2 : ils)\n  = normalizeInlineList $ Strikeout (x1 <> x2) : ils\nnormalizeInlineList (Superscript x1 : Superscript x2 : ils)\n  = normalizeInlineList $ Superscript (x1 <> x2) : ils\nnormalizeInlineList (Subscript x1 : Subscript x2 : ils)\n  = normalizeInlineList $ Subscript (x1 <> x2) : ils\nnormalizeInlineList (SmallCaps x1 : SmallCaps x2 : ils)\n  = normalizeInlineList $ SmallCaps (x1 <> x2) : ils\nnormalizeInlineList (Code _ x1 : Code _ x2 : ils)\n  = normalizeInlineList $ Code nullAttr (x1 <> x2) : ils\nnormalizeInlineList (RawInline f1 x1 : RawInline f2 x2 : ils) | f1 == f2\n  = normalizeInlineList $ RawInline f1 (x1 <> x2) : ils\n-- Do not join Span's during normalization\nnormalizeInlineList (x:xs) = x : normalizeInlineList xs\nnormalizeInlineList [] = []\n\nfixNotes :: [Inline] -> [Inline]\nfixNotes []                            = []\nfixNotes (Space : n@Note{} : rest)     = Str \" \" : n : fixNotes rest\nfixNotes (SoftBreak : n@Note{} : rest) = Str \" \" : n : fixNotes rest\nfixNotes (x:xs)                        = x : fixNotes xs\n\nstartsWithSpace :: [Inline] -> Bool\nstartsWithSpace (Space:_)     = True\nstartsWithSpace (SoftBreak:_) = True\nstartsWithSpace (Str s:_)     = stringStartsWithSpace s\nstartsWithSpace _             = False\n\nendsWithSpace :: [Inline] -> Bool\nendsWithSpace [Space]     = True\nendsWithSpace [SoftBreak] = True\nendsWithSpace [Str s]     = stringEndsWithSpace s\nendsWithSpace (_:xs)      = endsWithSpace xs\nendsWithSpace []          = False\n\nurlEscapeBrackets :: Text -> Text\nurlEscapeBrackets = T.concatMap $ \\c -> case c of\n  ']' -> \"%5D\"\n  _   -> T.singleton c\n\nisHorizontalRule :: Text -> Bool\nisHorizontalRule s = T.length s >= 4 && T.all (== '-') s\n\nstringStartsWithSpace :: Text -> Bool\nstringStartsWithSpace = maybe False (isSpace . fst) . T.uncons\n\nstringEndsWithSpace :: Text -> Bool\nstringEndsWithSpace = maybe False (isSpace . snd) . T.unsnoc\n\nfixOrEscape :: Bool -> Inline -> Bool\nfixOrEscape b (Str s) = fixOrEscapeStr b s\n  where\n    fixOrEscapeStr sp t = case T.uncons t of\n      Just ('-', xs)\n        | T.null xs -> sp\n        | otherwise -> (sp && isSpace (T.head xs)) || isHorizontalRule t\n      Just (';', xs)\n        | T.null xs -> not sp\n        | otherwise -> not sp && isSpace (T.head xs)\n      Just ('>', xs)\n        | T.null xs -> True\n        | otherwise -> isSpace (T.head xs)\n      _             -> (sp && (startsWithMarker isDigit s ||\n                               startsWithMarker isAsciiLower s ||\n                               startsWithMarker isAsciiUpper s))\n                       || stringStartsWithSpace s\nfixOrEscape _ Space = True\nfixOrEscape _ SoftBreak = True\nfixOrEscape _ _ = False\n\ninlineListStartsWithAlnum :: PandocMonad m\n                          => [Inline]\n                          -> Muse m Bool\ninlineListStartsWithAlnum (Str s:_) = do\n  esc <- shouldEscapeText s\n  return $ esc || isAlphaNum (T.head s)\ninlineListStartsWithAlnum _ = return False\n\n-- | Convert list of Pandoc inline elements to Muse\nrenderInlineList :: PandocMonad m\n                 => [Inline]\n                 -> Muse m (Doc Text)\nrenderInlineList [] = pure \"\"\nrenderInlineList (x:xs) = do\n  start <- asks envInlineStart\n  afterSpace <- asks envAfterSpace\n  topLevel <- asks envTopLevel\n  insideAsterisks <- asks envInsideAsterisks\n  nearAsterisks <- asks envNearAsterisks\n  useTags <- gets stUseTags\n  alnumNext <- inlineListStartsWithAlnum xs\n  let newUseTags = useTags || alnumNext\n  modify $ \\st -> st { stUseTags = newUseTags }\n\n  r <- local (\\env -> env { envInlineStart = False\n                          , envInsideAsterisks = False\n                          , envNearAsterisks = nearAsterisks || (null xs && insideAsterisks)\n                          }) $ inlineToMuse x\n  opts <- asks envOptions\n  let isNewline = (x == SoftBreak && writerWrapText opts == WrapPreserve) || x == LineBreak\n  lst' <- local (\\env -> env { envInlineStart = isNewline\n                             , envAfterSpace = x == Space || (not topLevel && isNewline)\n                             , envNearAsterisks = False\n                             }) $ renderInlineList xs\n  if start && fixOrEscape afterSpace x\n    then pure (literal \"<verbatim></verbatim>\" <> r <> lst')\n    else pure (r <> lst')\n\n-- | Normalize and convert list of Pandoc inline elements to Muse.\ninlineListToMuse :: PandocMonad m\n                 => [Inline]\n                 -> Muse m (Doc Text)\ninlineListToMuse lst = do\n  lst' <- normalizeInlineList . fixNotes <$> preprocessInlineList (map (removeKeyValues . replaceSmallCaps) lst)\n  insideAsterisks <- asks envInsideAsterisks\n  start <- asks envInlineStart\n  modify $ \\st -> st { stUseTags = False } -- Previous character is likely a '>' or some other markup\n  if start && null lst'\n    then pure \"<verbatim></verbatim>\"\n    else local (\\env -> env { envNearAsterisks = insideAsterisks }) $ renderInlineList lst'\n\ninlineListToMuse' :: PandocMonad m => [Inline] -> Muse m (Doc Text)\ninlineListToMuse' lst = do\n  topLevel <- asks envTopLevel\n  afterSpace <- asks envAfterSpace\n  local (\\env -> env { envInlineStart = True\n                     , envAfterSpace = afterSpace || not topLevel\n                     }) $ inlineListToMuse lst\n\nemphasis :: PandocMonad m => Text -> Text -> [Inline] -> Muse m (Doc Text)\nemphasis b e lst = do\n  contents <- local (\\env -> env { envInsideAsterisks = inAsterisks }) $ inlineListToMuse lst\n  modify $ \\st -> st { stUseTags = useTags }\n  return $ literal b <> contents <> literal e\n  where inAsterisks = T.last b == '*' || T.head e == '*'\n        useTags = T.last e /= '>'\n\n-- | Convert Pandoc inline element to Muse.\ninlineToMuse :: PandocMonad m\n             => Inline\n             -> Muse m (Doc Text)\ninlineToMuse (Str str) = do\n  escapedStr <- conditionalEscapeText $ replaceNewlines str\n  let useTags = isAlphaNum $ T.last escapedStr -- escapedStr is never empty because empty strings are escaped\n  modify $ \\st -> st { stUseTags = useTags }\n  return $ literal escapedStr\ninlineToMuse (Emph [Strong lst]) = do\n  useTags <- gets stUseTags\n  let lst' = normalizeInlineList lst\n  if useTags\n    then emphasis \"<em>**\" \"**</em>\" lst'\n    else if null lst' || startsWithSpace lst' || endsWithSpace lst'\n           then emphasis \"*<strong>\" \"</strong>*\" lst'\n           else emphasis \"***\" \"***\" lst'\ninlineToMuse (Emph lst) = do\n  useTags <- gets stUseTags\n  let lst' = normalizeInlineList lst\n  if useTags || null lst' || startsWithSpace lst' || endsWithSpace lst'\n    then emphasis \"<em>\" \"</em>\" lst'\n    else emphasis \"*\" \"*\" lst'\ninlineToMuse (Strong [Emph lst]) = do\n  useTags <- gets stUseTags\n  let lst' = normalizeInlineList lst\n  if useTags\n    then emphasis \"<strong>*\" \"*</strong>\" lst'\n    else if null lst' || startsWithSpace lst' || endsWithSpace lst'\n           then emphasis \"**<em>\" \"</em>**\" lst'\n           else emphasis \"***\" \"***\" lst'\n-- Underline is only supported in Emacs Muse mode.\ninlineToMuse (Underline lst) = do\n  opts <- asks envOptions\n  contents <- inlineListToMuse lst\n  if isEnabled Ext_amuse opts\n     then return $ \"_\" <> contents <> \"_\"\n     else inlineToMuse (Emph lst)\ninlineToMuse (Strong lst) = do\n  useTags <- gets stUseTags\n  let lst' = normalizeInlineList lst\n  if useTags || null lst' || startsWithSpace lst' || endsWithSpace lst'\n    then emphasis \"<strong>\" \"</strong>\" lst'\n    else emphasis \"**\" \"**\" lst'\ninlineToMuse (Strikeout lst) = do\n  contents <- inlineListToMuse lst\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"<del>\" <> contents <> \"</del>\"\ninlineToMuse (Superscript lst) = do\n  contents <- inlineListToMuse lst\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"<sup>\" <> contents <> \"</sup>\"\ninlineToMuse (Subscript lst) = do\n  contents <- inlineListToMuse lst\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"<sub>\" <> contents <> \"</sub>\"\ninlineToMuse SmallCaps {} =\n  throwError $ PandocShouldNeverHappenError\n    \"SmallCaps should be expanded before normalization\"\ninlineToMuse (Quoted SingleQuote lst) = do\n  contents <- inlineListToMuse lst\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"‘\" <> contents <> \"’\"\ninlineToMuse (Quoted DoubleQuote lst) = do\n  contents <- inlineListToMuse lst\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"“\" <> contents <> \"”\"\ninlineToMuse Cite {} =\n  throwError $ PandocShouldNeverHappenError\n               \"Citations should be expanded before normalization\"\ninlineToMuse (Code _ str) = do\n  useTags <- gets stUseTags\n  modify $ \\st -> st { stUseTags = False }\n  return $ if useTags || T.null str || T.any (== '=') str\n              || isSpace (T.head str) || isSpace (T.last str)\n             then \"<code>\" <> literal (T.replace \"</code>\" \"<</code><code>/code>\" str) <> \"</code>\"\n             else \"=\" <> literal str <> \"=\"\ninlineToMuse Math{} =\n  throwError $ PandocShouldNeverHappenError\n    \"Math should be expanded before normalization\"\ninlineToMuse (RawInline (Format f) str) = do\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"<literal style=\\\"\" <> literal f <> \"\\\">\" <> literal str <> \"</literal>\"\ninlineToMuse LineBreak = do\n  oneline <- asks envOneLine\n  modify $ \\st -> st { stUseTags = False }\n  return $ if oneline then \"<br>\" else \"<br>\" <> cr\ninlineToMuse Space = do\n  modify $ \\st -> st { stUseTags = False }\n  return space\ninlineToMuse SoftBreak = do\n  oneline <- asks envOneLine\n  wrapText <- asks $ writerWrapText . envOptions\n  modify $ \\st -> st { stUseTags = False }\n  return $ if not oneline && wrapText == WrapPreserve then cr else space\ninlineToMuse (Link _ txt (src, _)) =\n  case txt of\n        [Str x] | escapeURI x == src -> do\n             modify $ \\st -> st { stUseTags = False }\n             return $ \"[[\" <> literal (escapeLink x) <> \"]]\"\n        _ -> do contents <- local (\\env -> env { envInsideLinkDescription = True }) $ inlineListToMuse txt\n                modify $ \\st -> st { stUseTags = False }\n                return $ \"[[\" <> literal (escapeLink src) <> \"][\" <> contents <> \"]]\"\n  where escapeLink lnk = if isImageUrl lnk then \"URL:\" <> urlEscapeBrackets lnk else urlEscapeBrackets lnk\n        -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el\n        imageExtensions = [\".eps\", \".gif\", \".jpg\", \".jpeg\", \".pbm\", \".png\", \".tiff\", \".xbm\", \".xpm\"]\n        isImageUrl = (`elem` imageExtensions) . takeExtension . T.unpack\ninlineToMuse (Image attr alt (source,T.stripPrefix \"fig:\" -> Just title)) =\n  inlineToMuse (Image attr alt (source,title))\ninlineToMuse (Image attr@(_, classes, _) inlines (source, title)) = do\n  opts <- asks envOptions\n  alt <- local (\\env -> env { envInsideLinkDescription = True }) $ inlineListToMuse inlines\n  title' <- if T.null title\n            then if null inlines\n                 then return \"\"\n                 else return $ \"[\" <> alt <> \"]\"\n            else do s <- local (\\env -> env { envInsideLinkDescription = True }) $ conditionalEscapeText title\n                    return $ \"[\" <> literal s <> \"]\"\n  let width = case dimension Width attr of\n                Just (Percent x) | isEnabled Ext_amuse opts -> \" \" <> tshow (round x :: Integer)\n                _ -> \"\"\n  let leftalign = if \"align-left\" `elem` classes\n                  then \" l\"\n                  else \"\"\n  let rightalign = if \"align-right\" `elem` classes\n                   then \" r\"\n                   else \"\"\n  modify $ \\st -> st { stUseTags = False }\n  return $ \"[[\" <> literal (urlEscapeBrackets source <> width <> leftalign <> rightalign) <> \"]\" <> title' <> \"]\"\ninlineToMuse (Note contents) = do\n  -- add to notes in state\n  notes <- gets stNotes\n  modify $ \\st -> st { stNotes = contents:notes\n                     , stUseTags = False\n                     }\n  n <- gets stNoteNum\n  let ref = tshow $ n + length notes\n  return $ \"[\" <> literal ref <> \"]\"\ninlineToMuse (Span (anchor,names,kvs) inlines) = do\n  contents <- inlineListToMuse inlines\n  let (contents', hasDir) = case lookup \"dir\" kvs of\n                              Just \"rtl\" -> (\"<<<\" <> contents <> \">>>\", True)\n                              Just \"ltr\" -> (\">>>\" <> contents <> \"<<<\", True)\n                              _ -> (contents, False)\n  let anchorDoc = if T.null anchor\n                     then mempty\n                     else literal (\"#\" <> anchor) <> space\n  modify $ \\st -> st { stUseTags = False }\n  return $ anchorDoc <>\n   if null inlines && not (T.null anchor)\n      then mempty\n      else case names of\n             [] | hasDir -> contents'\n                | otherwise -> \"<class>\" <> contents' <> \"</class>\"\n             (n:_) -> \"<class name=\\\"\" <> literal n <> \"\\\">\" <>\n                         contents' <> \"</class>\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Native.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Writers.Native\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of a 'Pandoc' document to a string representation.\n-}\nmodule Text.Pandoc.Writers.Native ( writeNative )\nwhere\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (WriterOptions (..))\nimport Text.Show.Pretty (ppDoc)\nimport Text.PrettyPrint (renderStyle, Style(..), style, char)\n\n-- | Prettyprint Pandoc document.\nwriteNative :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteNative opts (Pandoc meta blocks) = do\n  let style' = style{ lineLength = writerColumns opts,\n                      ribbonsPerLine = 1.2 }\n  return $ T.pack $ renderStyle style' $\n    case writerTemplate opts of\n      Just _  -> ppDoc (Pandoc meta blocks) <> char '\\n'\n      Nothing -> ppDoc blocks\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/ODT.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Writers.ODT\n   Copyright   : Copyright (C) 2008-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to ODT.\n-}\nmodule Text.Pandoc.Writers.ODT ( writeODT ) where\nimport Codec.Archive.Zip\nimport Control.Monad.Except (catchError, throwError)\nimport Control.Monad.State.Strict (StateT, evalStateT, gets, modify, lift)\nimport Control.Monad (MonadPlus(mplus))\nimport qualified Data.ByteString.Lazy as B\nimport Data.Maybe (fromMaybe)\nimport Data.Generics (everywhere', mkT)\nimport Data.List (isPrefixOf)\nimport qualified Data.Map as Map\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Data.Time\nimport System.FilePath (takeDirectory, takeExtension, (<.>), (</>), isAbsolute)\nimport Text.Collate.Lang (Lang (..), renderLang)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Data (readDataFile)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError(..))\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.MIME (extensionFromMimeType, getMimeType)\nimport Text.Pandoc.Options (WrapOption (..), WriterOptions (..),\n                            HighlightMethod(Skylighting))\nimport Text.DocLayout\nimport Text.Pandoc.Shared (stringify, tshow)\nimport Text.Pandoc.Version (pandocVersionText)\nimport Text.Pandoc.Writers.Shared (lookupMetaString, lookupMetaBlocks,\n                                   fixDisplayMath, getLang,\n                                   ensureValidXmlIdentifiers)\nimport Text.Pandoc.UTF8 (fromStringLazy, fromTextLazy, toTextLazy)\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.OpenDocument (writeOpenDocument)\nimport Text.Pandoc.XML\nimport Text.Pandoc.XML.Light\nimport Text.TeXMath\nimport qualified Text.XML.Light as XL\nimport Network.URI (parseRelativeReference, URI(uriPath), isURI)\nimport Skylighting\n\nnewtype ODTState = ODTState { stEntries :: [Entry]\n                         }\n\ntype O m = StateT ODTState m\n\n-- | Produce an ODT file from a Pandoc document.\nwriteODT :: PandocMonad m\n         => WriterOptions  -- ^ Writer options\n         -> Pandoc         -- ^ Document to convert\n         -> m B.ByteString\nwriteODT  opts doc =\n  let initState = ODTState{ stEntries = []\n                          }\n      doc' = fixInternalLinks . ensureValidXmlIdentifiers $ doc\n  in\n    evalStateT (pandocToODT opts doc') initState\n\n-- | ODT internal links are evaluated relative to an imaginary folder\n-- structure that mirrors the zip structure.  The result is that relative\n-- links in the document need to start with `..`.  See #3524.\nfixInternalLinks :: Pandoc -> Pandoc\nfixInternalLinks = walk go\n where\n  go (Link attr ils (src,tit)) =\n    Link attr ils (fixRel src,tit)\n  go x = x\n  fixRel uri =\n    case parseRelativeReference (T.unpack uri) of\n      Just u\n        | not (null (uriPath u)) -> tshow $ u{ uriPath = \"../\" <> uriPath u }\n      _ -> uri\n\n-- | Produce an ODT file from a Pandoc document.\npandocToODT :: PandocMonad m\n            => WriterOptions  -- ^ Writer options\n            -> Pandoc         -- ^ Document to convert\n            -> O m B.ByteString\npandocToODT opts doc@(Pandoc meta _) = do\n  let title = docTitle meta\n  let authors = docAuthors meta\n  utctime <- P.getTimestamp\n  lang <- toLang (getLang opts meta)\n  refArchive <-\n       case writerReferenceDoc opts of\n             Just f -> lift $ toArchive . B.fromStrict . fst <$>\n                                (P.fetchItem (T.pack f))\n             Nothing -> lift $ toArchive . B.fromStrict <$>\n                                readDataFile \"reference.odt\"\n  -- handle formulas and pictures\n  -- picEntriesRef <- P.newIORef ([] :: [Entry])\n  doc' <- walkM (transformPicMath opts) $ walk fixDisplayMath doc\n  newContents <- lift $ writeOpenDocument opts{writerWrapText = WrapNone} doc'\n  epochtime <- floor `fmap` lift P.getPOSIXTime\n  let contentEntry = toEntry \"content.xml\" epochtime\n                     $ fromTextLazy $ TL.fromStrict newContents\n  picEntries <- gets stEntries\n  let archive = foldr addEntryToArchive refArchive\n                $ contentEntry : picEntries\n  -- construct META-INF/manifest.xml based on archive\n  let toFileEntry fp = case getMimeType fp of\n                        Nothing  -> empty\n                        Just m   -> selfClosingTag \"manifest:file-entry\"\n                                     [(\"manifest:media-type\", m)\n                                     ,(\"manifest:full-path\", T.pack fp)\n                                     ]\n  let files = [ ent | ent <- filesInArchive archive,\n                             not (\"META-INF\" `isPrefixOf` ent) ]\n  let formulas = [ takeDirectory ent ++ \"/\" | ent <- filesInArchive archive,\n                      \"Formula-\" `isPrefixOf` ent, takeExtension ent == \".xml\" ]\n  let manifestEntry = toEntry \"META-INF/manifest.xml\" epochtime\n        $ fromStringLazy $ render Nothing\n        $ text \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\"\n        $$\n         inTags True \"manifest:manifest\"\n            [(\"xmlns:manifest\",\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\")\n            ,(\"manifest:version\",\"1.3\")] ( selfClosingTag \"manifest:file-entry\"\n                 [(\"manifest:media-type\",\"application/vnd.oasis.opendocument.text\")\n                 ,(\"manifest:full-path\",\"/\")\n                 ,(\"manifest:version\", \"1.3\")]\n                $$ vcat ( map toFileEntry files )\n                $$ vcat ( map toFileEntry formulas )\n              )\n  let archive' = addEntryToArchive manifestEntry archive\n  -- create meta.xml\n  let userDefinedMetaFields = [k | k <- Map.keys (unMeta meta)\n                              , k `notElem` [\"title\", \"lang\", \"author\"\n                                           , \"description\", \"subject\", \"keywords\"]]\n  let escapedText = text . T.unpack . escapeStringForXML\n  let keywords = case lookupMeta \"keywords\" meta of\n                      Just (MetaList xs) -> map stringify xs\n                      _                  -> []\n  let userDefinedMeta =\n        map (\\k -> inTags False \"meta:user-defined\"\n              [ (\"meta:name\", escapeStringForXML k)\n              ,(\"meta:value-type\", \"string\")\n              ] (escapedText $ lookupMetaString k meta)) userDefinedMetaFields\n  let metaTag metafield = inTagsSimple metafield . escapedText\n  let metaEntry = toEntry \"meta.xml\" epochtime\n       $ fromStringLazy $ render Nothing\n       $ text \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\"\n       $$\n        inTags True \"office:document-meta\"\n           [(\"xmlns:office\",\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\")\n           ,(\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\")\n           ,(\"xmlns:dc\",\"http://purl.org/dc/elements/1.1/\")\n           ,(\"xmlns:meta\",\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\")\n           ,(\"xmlns:ooo\",\"http://openoffice.org/2004/office\")\n           ,(\"xmlns:grddl\",\"http://www.w3.org/2003/g/data-view#\")\n           ,(\"office:version\",\"1.3\")] ( inTags True \"office:meta\" []\n                 ( metaTag \"meta:generator\" (\"Pandoc/\" <> pandocVersionText)\n                   $$\n                   metaTag \"dc:title\" (stringify title)\n                   $$\n                   metaTag \"dc:description\"\n                          (T.intercalate \"\\n\" (map stringify $\n                                         lookupMetaBlocks \"description\" meta))\n                   $$\n                   metaTag \"dc:subject\" (lookupMetaString \"subject\" meta)\n                   $$\n                   metaTag \"meta:keyword\" (T.intercalate \", \" keywords)\n                   $$\n                   case lang of\n                        Just l  -> metaTag \"dc:language\" (renderLang l)\n                        Nothing -> empty\n                   $$\n                   (\\d a -> metaTag \"meta:initial-creator\" a\n                         $$ metaTag \"dc:creator\" a\n                         $$ metaTag \"meta:creation-date\" d\n                         $$ metaTag \"dc:date\" d\n                   ) (T.pack $ formatTime defaultTimeLocale \"%FT%XZ\" utctime)\n                     (T.intercalate \"; \" (map stringify authors))\n                   $$\n                   vcat userDefinedMeta\n                 )\n             )\n  -- make sure mimetype is first\n  let mimetypeEntry = toEntry \"mimetype\" epochtime\n                      $ fromStringLazy \"application/vnd.oasis.opendocument.text\"\n  archive'' <- updateStyle opts lang\n                  $ addEntryToArchive mimetypeEntry\n                  $ addEntryToArchive metaEntry archive'\n  return $ fromArchive archive''\n\nupdateStyle :: forall m . PandocMonad m\n            => WriterOptions -> Maybe Lang -> Archive -> O m Archive\nupdateStyle opts mbLang arch = do\n  epochtime <- floor `fmap` lift P.getPOSIXTime\n  let goEntry :: Entry -> O m Entry\n      goEntry e\n        | eRelativePath e == \"styles.xml\"\n          = case parseXMLElement (toTextLazy (fromEntry e)) of\n              Left msg -> throwError $ PandocXMLError \"styles.xml\" msg\n              Right d -> return $\n                toEntry \"styles.xml\" epochtime\n                ( fromTextLazy\n                . TL.fromStrict\n                . showTopElement\n                . maybe id addLang mbLang\n                . transformElement (\\qn -> qName qn == \"styles\" &&\n                                      qPrefix qn == Just \"office\" )\n                     (case writerHighlightMethod opts of\n                        Skylighting style -> addHlStyles style\n                        _ -> id)\n                $ d )\n        | otherwise = pure e\n  entries <- mapM goEntry (zEntries arch)\n  return arch{ zEntries = entries }\n\naddHlStyles :: Style -> Element -> Element\naddHlStyles sty el =\n  el{ elContent = filter (not . isHlStyle) (elContent el) ++\n                styleToOpenDocument sty }\n where\n   isHlStyle (Elem e) = \"Tok\" `T.isSuffixOf` (qName (elName e))\n   isHlStyle _ = False\n\n-- top-down search\ntransformElement :: (QName -> Bool)\n                 -> (Element -> Element)\n                 -> Element\n                 -> Element\ntransformElement g f el\n  | g (elName el)\n    = f el\n  | otherwise\n    = el{ elContent = map go (elContent el) }\n where\n   go (Elem e) = Elem (transformElement g f e)\n   go x = x\n\n-- TODO FIXME avoid this generic traversal!\naddLang :: Lang -> Element -> Element\naddLang lang = everywhere' (mkT updateLangAttr)\n    where updateLangAttr (Attr n@(QName \"language\" _ (Just \"fo\")) _)\n                           = Attr n (langLanguage lang)\n          updateLangAttr (Attr n@(QName \"country\" _ (Just \"fo\")) _)\n                           = Attr n (fromMaybe \"\" $ langRegion lang)\n          updateLangAttr x = x\n\n-- | transform both Image and Math elements\ntransformPicMath :: PandocMonad m => WriterOptions ->Inline -> O m Inline\ntransformPicMath opts (Image attr@(id', cls, _) lab (src,t)) = catchError\n   (do (img, mbMimeType) <- P.fetchItem src\n       (ptX, ptY) <- case imageSize opts img of\n                       Right s  -> return $ sizeInPoints s\n                       Left msg -> do\n                         report $ CouldNotDetermineImageSize src msg\n                         return (100, 100)\n       let dims =\n             case (getDim Width, getDim Height) of\n               (Just w, Just h)              -> [(\"width\", tshow w), (\"height\", tshow h)]\n               (Just w@(Percent _), Nothing) -> [(\"rel-width\", tshow w),(\"rel-height\", \"scale\"),(\"width\", tshow ptX <> \"pt\"),(\"height\", tshow ptY <> \"pt\")]\n               (Nothing, Just h@(Percent _)) -> [(\"rel-width\", \"scale\"),(\"rel-height\", tshow h),(\"width\", tshow ptX <> \"pt\"),(\"height\", tshow ptY <> \"pt\")]\n               (Just w@(Inch i), Nothing)    -> [(\"width\", tshow w), (\"height\", tshow (i / ratio) <> \"in\")]\n               (Nothing, Just h@(Inch i))    -> [(\"width\", tshow (i * ratio) <> \"in\"), (\"height\", tshow h)]\n               _                             -> [(\"width\", tshow ptX <> \"pt\"), (\"height\", tshow ptY <> \"pt\")]\n             where\n               ratio = ptX / ptY\n               getDim dir = case dimension dir attr of\n                              Just (Percent i) -> Just $ Percent i\n                              Just dim         -> Just $ Inch $ inInch opts dim\n                              Nothing          -> Nothing\n       let  newattr = (id', cls, dims)\n       src' <- if writerLinkImages opts\n                  then\n                    case T.unpack src of\n                      s | isURI s -> return src\n                        | isAbsolute s -> return src\n                        | otherwise -> return $ T.pack $ \"..\" </> s\n                  else do\n                    entries <- gets stEntries\n                    let extension = maybe (takeExtension $ takeWhile (/='?') $ T.unpack src) T.unpack\n                                        (mbMimeType >>= extensionFromMimeType)\n                    let newsrc = \"Pictures/\" ++ show (length entries) <.> extension\n                    let toLazy = B.fromChunks . (:[])\n                    epochtime <- floor `fmap` lift P.getPOSIXTime\n                    let entry = toEntry newsrc epochtime $ toLazy img\n                    modify $ \\st -> st{ stEntries = entry : entries }\n                    return $ T.pack newsrc\n       return $ Image newattr lab (src', t))\n   (\\e -> do\n       report $ CouldNotFetchResource src $ T.pack (show e)\n       return $ Emph lab)\n\ntransformPicMath _ (Math t math) = do\n  entries <- gets stEntries\n  let dt = if t == InlineMath then DisplayInline else DisplayBlock\n  case writeMathML dt <$> readTeX math of\n       Left  _ -> return $ Math t math\n       Right r -> do\n         let conf = XL.useShortEmptyTags (const False) XL.defaultConfigPP\n         let mathml = XL.ppcTopElement conf r\n         epochtime <- floor `fmap` lift P.getPOSIXTime\n         let dirname = \"Formula-\" ++ show (length entries) ++ \"/\"\n         let fname = dirname ++ \"content.xml\"\n         let entry = toEntry fname epochtime (fromStringLazy mathml)\n         let fname' = dirname ++ \"settings.xml\"\n         let entry' = toEntry fname' epochtime $ documentSettings (t == InlineMath)\n         modify $ \\st -> st{ stEntries = entry' : (entry : entries) }\n         return $ RawInline (Format \"opendocument\") $ render Nothing $\n           inTags False \"draw:frame\" (if t == DisplayMath\n                                      then [(\"draw:style-name\",\"fr2\")\n                                           -- `draw:frame` does not support either\n                                           -- `style:vertical-pos` or `style:vertical-rel`,\n                                           -- therefore those attributes must go into the\n                                           -- `style:style` element\n                                           ,(\"text:anchor-type\",\"paragraph\")]\n                                      else [(\"draw:style-name\",\"fr1\")\n                                           ,(\"text:anchor-type\",\"as-char\")]) $\n             selfClosingTag \"draw:object\" [(\"xlink:href\", T.pack dirname)\n                                        , (\"xlink:type\", \"simple\")\n                                        , (\"xlink:show\", \"embed\")\n                                        , (\"xlink:actuate\", \"onLoad\")]\n\ntransformPicMath _ x = return x\n\ndocumentSettings :: Bool -> B.ByteString\ndocumentSettings isTextMode = fromStringLazy $ render Nothing\n    $ text \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\"\n    $$\n    inTags True \"office:document-settings\"\n      [(\"xmlns:office\",\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\")\n      ,(\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\")\n      ,(\"xmlns:config\",\"urn:oasis:names:tc:opendocument:xmlns:config:1.0\")\n      ,(\"xmlns:ooo\",\"http://openoffice.org/2004/office\")\n      ,(\"office:version\",\"1.3\")] (\n       inTagsSimple \"office:settings\" $\n         inTags False \"config:config-item-set\"\n           [(\"config:name\", \"ooo:configuration-settings\")] $\n           inTags False \"config:config-item\" [(\"config:name\", \"IsTextMode\")\n                                             ,(\"config:type\", \"boolean\")] $\n                                              text $ if isTextMode then \"true\" else \"false\")\n\nstyleToOpenDocument :: Style -> [Content]\nstyleToOpenDocument style = map (Elem . toStyle) alltoktypes\n  where alltoktypes = enumFromTo KeywordTok NormalTok\n        styleName x =\n          case T.break (== ':') x of\n            (b, a) | T.null a  -> QName x Nothing (Just \"style\")\n                   | otherwise -> QName (T.drop 1 a) Nothing (Just b)\n        styleAttr (x, y) = Attr (styleName x) y\n        styleAttrs = map styleAttr\n        styleElement x attrs cs =\n          Element (styleName x) (styleAttrs attrs) cs Nothing\n        toStyle toktype =\n          styleElement \"style\"\n            [(\"name\", tshow toktype), (\"family\", \"text\")]\n            [Elem (styleElement \"text-properties\"\n                      (tokColor toktype ++ tokBgColor toktype ++\n                        [(\"fo:font-style\", \"italic\") |\n                           tokFeature tokenItalic toktype ] ++\n                        [(\"fo:font-weight\", \"bold\") |\n                           tokFeature tokenBold toktype ] ++\n                        [(\"style:text-underline-style\", \"solid\") |\n                           tokFeature tokenUnderline toktype ])\n                        [])]\n        tokStyles = tokenStyles style\n        tokFeature f toktype = maybe False f $ Map.lookup toktype tokStyles\n        tokColor toktype =\n          maybe [] (\\c -> [(\"fo:color\", T.pack (fromColor c))])\n                        ((tokenColor =<< Map.lookup toktype tokStyles)\n                           `mplus` defaultColor style)\n        tokBgColor toktype =\n          maybe [] (\\c -> [(\"fo:background-color\", T.pack (fromColor c))])\n                    (tokenBackground =<< Map.lookup toktype tokStyles)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/OOXML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.OOXML\n   Copyright   : Copyright (C) 2012-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions common to OOXML writers (Docx and Powerpoint)\n-}\nmodule Text.Pandoc.Writers.OOXML ( mknode\n                                 , mktnode\n                                 , nodename\n                                 , toLazy\n                                 , renderXml\n                                 , parseXml\n                                 , elemToNameSpaces\n                                 , elemName\n                                 , isElem\n                                 , NameSpaces\n                                 , fitToPage\n                                 ) where\n\nimport Codec.Archive.Zip\nimport Control.Monad (mplus)\nimport Control.Monad.Except (throwError)\nimport Text.Pandoc.Error\nimport qualified Data.ByteString as B\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.XML.Light\n\nmknode :: Node t => Text -> [(Text,Text)] -> t -> Element\nmknode s attrs =\n  add_attrs (map (\\(k,v) -> Attr (nodename k) v) attrs) .  node (nodename s)\n\nmktnode :: Text -> [(Text,Text)] -> T.Text -> Element\nmktnode s attrs = mknode s attrs\n\nnodename :: Text -> QName\nnodename s = QName{ qName = name, qURI = Nothing, qPrefix = prefix }\n where (name, prefix) = case T.break (==':') s of\n                          (xs,ys) -> case T.uncons ys of\n                                       Nothing     -> (xs, Nothing)\n                                       Just (_,zs) -> (zs, Just xs)\n\ntoLazy :: B.ByteString -> BL.ByteString\ntoLazy = BL.fromChunks . (:[])\n\nrenderXml :: Element -> BL.ByteString\nrenderXml elt = BL.fromStrict (UTF8.fromText (showTopElement elt))\n\nparseXml :: PandocMonad m => Archive -> Archive -> String -> m Element\nparseXml refArchive distArchive relpath =\n  case findEntryByPath relpath refArchive `mplus`\n         findEntryByPath relpath distArchive of\n            Nothing -> throwError $ PandocSomeError $\n                        T.pack relpath <> \" missing in reference file\"\n            Just e  -> case parseXMLElement . UTF8.toTextLazy . fromEntry $ e of\n                       Left msg ->\n                         throwError $ PandocXMLError (T.pack relpath) msg\n                       Right d  -> return d\n\n-- Copied from Util\n\nattrToNSPair :: Attr -> Maybe (Text, Text)\nattrToNSPair (Attr (QName s _ (Just \"xmlns\")) val) = Just (s, val)\nattrToNSPair _                                     = Nothing\n\n\nelemToNameSpaces :: Element -> NameSpaces\nelemToNameSpaces = mapMaybe attrToNSPair . elAttribs\n\nelemName :: NameSpaces -> Text -> Text -> QName\nelemName ns prefix name =\n  QName name (lookup prefix ns) (if T.null prefix then Nothing else Just prefix)\n\nisElem :: NameSpaces -> Text -> Text -> Element -> Bool\nisElem ns prefix name element =\n  let ns' = ns ++ elemToNameSpaces element\n  in qName (elName element) == name &&\n     qURI (elName element) == lookup prefix ns'\n\ntype NameSpaces = [(Text, Text)]\n\n-- | Scales the image to fit the page\n-- sizes are passed in emu\nfitToPage :: (Double, Double) -> Integer -> (Integer, Integer)\nfitToPage (x, y) pageWidth\n  -- Fixes width to the page width and scales the height\n  | x > fromIntegral pageWidth =\n    (pageWidth, floor $ (fromIntegral pageWidth / x) * y)\n  | otherwise = (floor x, floor y)\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/OPML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE CPP               #-}\n{- |\n   Module      : Text.Pandoc.Writers.OPML\n   Copyright   : Copyright (C) 2013-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to OPML XML.\n-}\nmodule Text.Pandoc.Writers.OPML ( writeOPML) where\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Data.Time\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.HTML (writeHtml5String)\nimport Text.Pandoc.Writers.Markdown (writeMarkdown)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.XML\n\n-- | Convert Pandoc document to string in OPML format.\nwriteOPML :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteOPML opts (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n      meta' = B.setMeta \"date\" (B.str $ convertDate $ docDate meta) meta\n  metadata <- metaToContext opts\n              (fmap literal . writeMarkdown' opts . Pandoc nullMeta)\n              (\\ils -> literal . T.stripEnd <$>\n                writeMarkdown' opts (Pandoc nullMeta [Plain ils]))\n              meta'\n  let blocks' = makeSections False (Just 1) blocks\n  main <- render colwidth . vcat <$>\n             mapM (blockToOPML opts) blocks'\n  let context = defField \"body\" main metadata\n  return $\n    (if writerPreferAscii opts then toEntities else id) $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> render colwidth $ renderTemplate tpl context\n\nwriteMarkdown' :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteMarkdown' opts = writeMarkdown def{ writerWrapText = writerWrapText opts\n                                       , writerColumns = writerColumns opts\n                                       , writerExtensions = pandocExtensions\n                                       }\n\nwriteHtmlInlines :: PandocMonad m => [Inline] -> m Text\nwriteHtmlInlines ils =\n  T.strip <$> writeHtml5String def (Pandoc nullMeta [Plain ils])\n\n-- date format: RFC 822: Thu, 14 Jul 2005 23:41:05 GMT\nshowDateTimeRFC822 :: UTCTime -> Text\nshowDateTimeRFC822 = T.pack . formatTime defaultTimeLocale \"%a, %d %b %Y %X %Z\"\n\nconvertDate :: [Inline] -> Text\nconvertDate ils = maybe \"\" showDateTimeRFC822 $\n  parseTimeM True defaultTimeLocale \"%F\" . T.unpack =<< normalizeDate (stringify ils)\n\n-- | Convert a Block to OPML.\nblockToOPML :: PandocMonad m => WriterOptions -> Block -> m (Doc Text)\nblockToOPML opts (Div (_,\"section\":_,_) (Header _ _ title : xs)) = do\n  let isSect (Div (_,\"section\":_,_) (Header{}:_)) = True\n      isSect _ = False\n  let (blocks, rest) = break isSect xs\n  htmlIls <- writeHtmlInlines title\n  md <- if null blocks\n        then return mempty\n        else writeMarkdown' opts $ Pandoc nullMeta blocks\n  let attrs = (\"text\", htmlIls) :\n              [(\"_note\", T.stripEnd md) | not (null blocks)]\n  rest' <- vcat <$> mapM (blockToOPML opts) rest\n  return $ inTags True \"outline\" attrs rest'\nblockToOPML _ _ = return empty\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/OpenDocument.hs",
    "content": "{-# LANGUAGE FlexibleContexts  #-}\n{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards     #-}\n{- |\n   Module      : Text.Pandoc.Writers.OpenDocument\n   Copyright   : Copyright (C) 2008-2020 Andrea Rossato and John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Andrea Rossato <andrea.rossato@ing.unitn.it>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to OpenDocument XML.\n-}\nmodule Text.Pandoc.Writers.OpenDocument ( writeOpenDocument ) where\nimport Control.Arrow ((***), (>>>))\nimport Control.Monad (unless, liftM)\nimport Control.Monad.State.Strict ( StateT(..), modify, gets, lift )\nimport Data.Char (chr)\nimport Data.Foldable (find)\nimport Data.List (sortOn, sortBy)\nimport qualified Data.List as L\nimport qualified Data.Map as Map\nimport Data.Ord (comparing, Down (Down))\nimport qualified Data.Set as Set\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Collate.Lang (Lang (..), parseLang)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Translations (translateTerm)\nimport Text.Pandoc.Definition\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout hiding (link)\nimport Text.Pandoc.Shared (linesToPara, tshow, blocksToInlines)\nimport Text.Pandoc.Templates (renderTemplate)\nimport qualified Text.Pandoc.Translations as Term (Term(Figure, Table))\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\nimport Text.Pandoc.XML\nimport Text.Printf (printf)\nimport Text.Pandoc.Highlighting (highlight)\nimport Skylighting (FormatOptions(..), SourceLine, Token)\n\n-- | Auxiliary function to convert Plain block to Para.\nplainToPara :: Block -> Block\nplainToPara (Plain x) = Para x\nplainToPara x         = x\n\n--\n-- OpenDocument writer\n--\n\ntype OD m = StateT WriterState m\n\ndata ReferenceType\n  = HeaderRef\n  | TableRef\n  | FigureRef\n\ndata WriterState =\n    WriterState { stNotes          :: [Doc Text]\n                , stTableStyles    :: [Doc Text]\n                , stParaStyles     :: [Doc Text]\n                , stListStyles     :: [(Int, [Doc Text])]\n                , stTextStyles     :: Map.Map (Set.Set TextStyle)\n                                        (Text, Doc Text)\n                , stTextStyleAttr  :: Set.Set TextStyle\n                , stIndentPara     :: Int\n                , stInDefinition   :: Bool\n                , stTight          :: Bool\n                , stFirstPara      :: Bool\n                , stImageId        :: Int\n                , stTableCaptionId :: Int\n                , stImageCaptionId :: Int\n                , stIdentTypes     :: [(Text,ReferenceType)]\n                }\n\ndefaultWriterState :: WriterState\ndefaultWriterState =\n    WriterState { stNotes          = []\n                , stTableStyles    = []\n                , stParaStyles     = []\n                , stListStyles     = []\n                , stTextStyles     = Map.empty\n                , stTextStyleAttr  = Set.empty\n                , stIndentPara     = 0\n                , stInDefinition   = False\n                , stTight          = False\n                , stFirstPara      = False\n                , stImageId        = 1\n                , stTableCaptionId = 1\n                , stImageCaptionId = 1\n                , stIdentTypes     = []\n                }\n\nwhen :: Bool -> Doc Text -> Doc Text\nwhen p a = if p then a else empty\n\naddTableStyle :: PandocMonad m => Doc Text -> OD m ()\naddTableStyle i = modify $ \\s -> s { stTableStyles = i : stTableStyles s }\n\naddNote :: PandocMonad m => Doc Text -> OD m ()\naddNote i = modify $ \\s -> s { stNotes = i : stNotes s }\n\naddParaStyle :: PandocMonad m => Doc Text -> OD m ()\naddParaStyle i = modify $ \\s -> s { stParaStyles = i : stParaStyles s }\n\naddTextStyle :: PandocMonad m\n             => Set.Set TextStyle -> (Text, Doc Text) -> OD m ()\naddTextStyle attrs i = modify $ \\s ->\n  s { stTextStyles = Map.insert attrs i (stTextStyles s) }\n\nincreaseIndent :: PandocMonad m => OD m ()\nincreaseIndent = modify $ \\s -> s { stIndentPara = 1 + stIndentPara s }\n\nresetIndent :: PandocMonad m => OD m ()\nresetIndent = modify $ \\s -> s { stIndentPara = stIndentPara s - 1 }\n\ninTightList :: PandocMonad m => OD m a -> OD m a\ninTightList  f = modify (\\s -> s { stTight = True  }) >> f >>= \\r ->\n                 modify (\\s -> s { stTight = False }) >> return r\n\nsetInDefinitionList :: PandocMonad m => Bool -> OD m ()\nsetInDefinitionList b = modify $  \\s -> s { stInDefinition = b }\n\nsetFirstPara :: PandocMonad m => OD m ()\nsetFirstPara =  modify $  \\s -> s { stFirstPara = True }\n\ninParagraphTags :: PandocMonad m => Doc Text -> OD m (Doc Text)\ninParagraphTags d = do\n  b <- gets stFirstPara\n  a <- if b\n       then do modify $ \\st -> st { stFirstPara = False }\n               return [(\"text:style-name\", \"First_20_paragraph\")]\n       else    return   [(\"text:style-name\", \"Text_20_body\")]\n  return $ inTags False \"text:p\" a d\n\ninParagraphTagsWithStyle :: Text -> Doc Text -> Doc Text\ninParagraphTagsWithStyle sty = inTags False \"text:p\" [(\"text:style-name\", sty)]\n\ninSpanTags :: Text -> Doc Text -> Doc Text\ninSpanTags s = inTags False \"text:span\" [(\"text:style-name\",s)]\n\nwithAlteredTextStyles :: PandocMonad m\n                       => (Set.Set TextStyle -> Set.Set TextStyle) -> OD m a -> OD m a\nwithAlteredTextStyles f action = do\n  oldTextStyleAttr <- gets stTextStyleAttr\n  modify $ \\st -> st{ stTextStyleAttr = f oldTextStyleAttr }\n  res <- action\n  modify $ \\st -> st{ stTextStyleAttr = oldTextStyleAttr }\n  return res\n\nwithTextStyle :: PandocMonad m => TextStyle -> OD m a -> OD m a\nwithTextStyle s = withAlteredTextStyles (Set.insert s)\n\ninTextStyle :: PandocMonad m => Doc Text -> OD m (Doc Text)\ninTextStyle d = do\n  at <- gets stTextStyleAttr\n  if Set.null at\n     then return d\n     else do\n       styles <- gets stTextStyles\n       case Map.lookup at styles of\n            Just (styleName, _) -> return $\n              inTags False \"text:span\" [(\"text:style-name\",styleName)] d\n            Nothing -> do\n              let styleName = \"T\" <> tshow (Map.size styles + 1)\n              addTextStyle at (styleName,\n                     inTags False \"style:style\"\n                       [(\"style:name\", styleName)\n                       ,(\"style:family\", \"text\")]\n                       $ selfClosingTag \"style:text-properties\"\n                          (sortOn fst . Map.toList\n                                $ L.foldl' textStyleAttr mempty (Set.toList at)))\n              return $ inTags False\n                  \"text:span\" [(\"text:style-name\",styleName)] d\n\nformulaStyles :: [Doc Text]\nformulaStyles = [formulaStyle InlineMath, formulaStyle DisplayMath]\n\nformulaStyle :: MathType -> Doc Text\nformulaStyle mt = inTags False \"style:style\"\n  [(\"style:name\", if mt == InlineMath then \"fr1\" else \"fr2\")\n  ,(\"style:family\", \"graphic\")\n  ,(\"style:parent-style-name\", \"Formula\")]\n  $ selfClosingTag \"style:graphic-properties\" $ if mt == InlineMath then\n                                                  [(\"style:vertical-pos\", \"middle\")\n                                                  ,(\"style:vertical-rel\", \"text\")]\n                                                else\n                                                  [(\"style:vertical-pos\",   \"middle\")\n                                                  ,(\"style:vertical-rel\",   \"text\")\n                                                  ,(\"style:horizontal-pos\", \"center\")\n                                                  ,(\"style:horizontal-rel\", \"paragraph-content\")\n                                                  ,(\"style:wrap\",           \"none\")]\n\ninBookmarkTags :: Text -> Doc Text -> Doc Text\ninBookmarkTags ident d =\n  selfClosingTag \"text:bookmark-start\" [ (\"text:name\", ident) ]\n  <> d <>\n  selfClosingTag \"text:bookmark-end\" [ (\"text:name\", ident) ]\n\nselfClosingBookmark :: Text -> Doc Text\nselfClosingBookmark ident =\n  selfClosingTag \"text:bookmark\" [(\"text:name\", ident)]\n\ninHeaderTags :: PandocMonad m => Int -> Text -> Doc Text -> OD m (Doc Text)\ninHeaderTags i ident d =\n  return $ inTags False \"text:h\" [ (\"text:style-name\", \"Heading_20_\" <> tshow i)\n                                 , (\"text:outline-level\", tshow i)]\n         $ if T.null ident\n              then d\n              else inBookmarkTags ident d\n\ninQuotes :: QuoteType -> Doc Text -> Doc Text\ninQuotes SingleQuote s = char '\\8216' <> s <> char '\\8217'\ninQuotes DoubleQuote s = char '\\8220' <> s <> char '\\8221'\n\nhandleSpaces :: Text -> Doc Text\nhandleSpaces s = case T.uncons s of\n  Just (' ', _) -> genTag s\n  Just ('\\t',x) -> selfClosingTag \"text:tab\" [] <> rm x\n  _             -> rm s\n  where\n    genTag = T.span (==' ') >>> tag . T.length *** rm >>> uncurry (<>)\n    tag n  = when (n /= 0) $ selfClosingTag \"text:s\" [(\"text:c\", tshow n)]\n    rm t   = case T.uncons t of\n      Just ( ' ',xs) -> char ' ' <> genTag xs\n      Just ('\\t',xs) -> selfClosingTag \"text:tab\" [] <> genTag xs\n      Just (   x,xs) -> char x <> rm xs\n      Nothing        -> empty\n\n-- | Convert Pandoc document to string in OpenDocument format.\nwriteOpenDocument :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteOpenDocument opts (Pandoc meta blocks) = do\n  setupTranslations meta\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  let meta' = case lookupMetaBlocks \"abstract\" meta of\n                [] -> meta\n                xs -> B.setMeta \"abstract\"\n                        (B.divWith (\"\",[],[(\"custom-style\",\"Abstract\")])\n                          (B.fromList xs))\n                        meta\n  ((body, metadata),s) <- flip runStateT\n        defaultWriterState $ do\n           let collectBlockIdent (Header _ (ident,_,_) _)      = [(ident,HeaderRef)]\n               collectBlockIdent (Figure (ident,_,_) _ _ )     = [(ident,FigureRef)]\n               collectBlockIdent (Table (ident,_,_) _ _ _ _ _) = [(ident,TableRef)]\n               collectBlockIdent _                             = []\n           modify $ \\s -> s{ stIdentTypes = query collectBlockIdent blocks }\n           m <- metaToContext opts\n                  (inlinesToOpenDocument opts . blocksToInlines)\n                  (fmap chomp . inlinesToOpenDocument opts)\n                  meta'\n           b <- blocksToOpenDocument opts blocks\n           return (b, m)\n  let styles   = stTableStyles s ++ stParaStyles s ++ formulaStyles ++\n                     map snd (sortBy (comparing (Down . fst)) (\n                        Map.elems (stTextStyles s)))\n      listStyle (n,l) = inTags True \"text:list-style\"\n                          [(\"style:name\", \"L\" <> tshow n)] (vcat l)\n  let listStyles  = map listStyle (stListStyles s)\n  let automaticStyles = vcat $ reverse $ styles ++ listStyles\n  let context = defField \"body\" body\n              . defField \"toc\" (writerTableOfContents opts)\n              . defField \"toc-depth\" (tshow $ writerTOCDepth opts)\n              . defField \"automatic-styles\" automaticStyles\n              $ metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> body\n       Just tpl -> renderTemplate tpl context\n\nwithParagraphStyle :: PandocMonad m\n                   => WriterOptions -> Text -> [Block] -> OD m (Doc Text)\nwithParagraphStyle  o s (b:bs)\n    | Para l <- b = go =<< inParagraphTagsWithStyle s <$> inlinesToOpenDocument o l\n    | otherwise   = go =<< blockToOpenDocument o b\n    where go i = (<>) i <$>  withParagraphStyle o s bs\nwithParagraphStyle _ _ [] = return empty\n\ninPreformattedTags :: PandocMonad m => [Doc Text] -> OD m (Doc Text)\ninPreformattedTags s = do\n  n <- paraStyle [(\"style:parent-style-name\",\"Preformatted_20_Text\")]\n  return $ inParagraphTagsWithStyle (\"P\" <> tshow n) $ hcat s\n\norderedListToOpenDocument :: PandocMonad m\n                          => WriterOptions -> Int -> [[Block]] -> OD m (Doc Text)\norderedListToOpenDocument o pn bs =\n    vcat . map (inTagsIndented \"text:list-item\") <$>\n    mapM (orderedItemToOpenDocument o pn . map plainToPara) bs\n\norderedItemToOpenDocument :: PandocMonad m\n                          => WriterOptions -> Int -> [Block] -> OD m (Doc Text)\norderedItemToOpenDocument  o n bs = vcat <$> mapM go bs\n where go (OrderedList a l) = newLevel a l\n       go (Para          l) = inParagraphTagsWithStyle (\"P\" <> tshow n) <$>\n                                inlinesToOpenDocument o l\n       go b                 = blockToOpenDocument o b\n       newLevel a l = do\n         nn <- length <$> gets stParaStyles\n         liststyles <- gets stListStyles\n         let ls = case liststyles of\n                    [] -> (1,[])  -- should never happen\n                    (s:_) -> s\n         modify $ \\s -> s { stListStyles = orderedListLevelStyle a ls :\n                                 drop 1 (stListStyles s) }\n         inTagsIndented \"text:list\" <$> orderedListToOpenDocument o nn l\n\nisTightList :: [[Block]] -> Bool\nisTightList []          = False\nisTightList (b:_)\n    | Plain {} : _ <- b = True\n    | otherwise         = False\n\nnewOrderedListStyle :: PandocMonad m\n                    => Bool -> ListAttributes -> OD m (Int,Int)\nnewOrderedListStyle b a = do\n  ln <- (+) 1 . length  <$> gets stListStyles\n  let nbs = orderedListLevelStyle a (ln, [])\n  pn <- if b then inTightList (paraListStyle ln) else paraListStyle ln\n  modify $ \\s -> s { stListStyles = nbs : stListStyles s }\n  return (ln,pn)\n\nbulletListToOpenDocument :: PandocMonad m\n                         => WriterOptions -> [[Block]] -> OD m (Doc Text)\nbulletListToOpenDocument o b = do\n  ln <- (+) 1 . length <$> gets stListStyles\n  (pn,ns) <- if isTightList b then inTightList (bulletListStyle ln) else bulletListStyle ln\n  modify $ \\s -> s { stListStyles = ns : stListStyles s }\n  is <- listItemsToOpenDocument (\"P\" <> tshow pn) o b\n  return $ inTags True \"text:list\" [(\"text:style-name\", \"L\" <> tshow ln)] is\n\nlistItemsToOpenDocument :: PandocMonad m\n                        => Text -> WriterOptions -> [[Block]] -> OD m (Doc Text)\nlistItemsToOpenDocument s o is =\n    vcat . map (inTagsIndented \"text:list-item\") <$> mapM (withParagraphStyle o s . map plainToPara) is\n\ndeflistItemToOpenDocument :: PandocMonad m\n                          => WriterOptions -> ([Inline],[[Block]]) -> OD m (Doc Text)\ndeflistItemToOpenDocument o (t,d) = do\n  let ts = if isTightList d\n           then \"Definition_20_Term_20_Tight\"       else \"Definition_20_Term\"\n      ds = if isTightList d\n           then \"Definition_20_Definition_20_Tight\" else \"Definition_20_Definition\"\n  t' <- withParagraphStyle o ts [Para t]\n  d' <- liftM vcat $ mapM (withParagraphStyle o ds . map plainToPara) d\n  return $ t' $$ d'\n\ninBlockQuote :: PandocMonad m\n             => WriterOptions -> Int -> [Block] -> OD m (Doc Text)\ninBlockQuote  o i (b:bs)\n    | BlockQuote l <- b = do increaseIndent\n                             ni <- paraStyle\n                                   [(\"style:parent-style-name\",\"Quotations\")]\n                             go =<< inBlockQuote o ni (map plainToPara l)\n    | Para       l <- b = go =<< inParagraphTagsWithStyle (\"P\" <> tshow i) <$> inlinesToOpenDocument o l\n    | otherwise         = go =<< blockToOpenDocument o b\n    where go  block  = ($$) block <$> inBlockQuote o i bs\ninBlockQuote     _ _ [] =  resetIndent >> return empty\n\n-- | Convert a list of Pandoc blocks to OpenDocument.\nblocksToOpenDocument :: PandocMonad m => WriterOptions -> [Block] -> OD m (Doc Text)\nblocksToOpenDocument o b = vcat <$> mapM (blockToOpenDocument o) b\n\n-- | Convert a Pandoc block element to OpenDocument.\nblockToOpenDocument :: PandocMonad m => WriterOptions -> Block -> OD m (Doc Text)\nblockToOpenDocument o = \\case\n    Plain          b -> if null b\n                        then return empty\n                        else inParagraphTags =<< inlinesToOpenDocument o b\n    Para           b -> if null b &&\n                           not (isEnabled Ext_empty_paragraphs o)\n                        then return empty\n                        else inParagraphTags =<< inlinesToOpenDocument o b\n    LineBlock      b -> blockToOpenDocument o $ linesToPara b\n    Div attr xs      -> mkDiv attr xs\n    Header     i (ident,_,_) b -> do\n      setFirstPara\n      inHeaderTags i ident =<< inlinesToOpenDocument o b\n    BlockQuote     b -> setFirstPara >> mkBlockQuote b\n    DefinitionList b -> setFirstPara >> defList b\n    BulletList     b -> setFirstPara >> bulletListToOpenDocument o b\n    OrderedList  a b -> setFirstPara >> orderedList a b\n    CodeBlock attrs s -> do\n      setFirstPara\n      case writerHighlightMethod o of\n        Skylighting {} ->\n          case highlight (writerSyntaxMap o) formatOpenDocument attrs s of\n                Right h  -> return $ flush . vcat $ map (inTags True \"text:p\"\n                                          [(\"text:style-name\",\n                                            \"Preformatted_20_Text\")] . hcat) h\n                Left msg -> do\n                  unless (T.null msg) $ report $ CouldNotHighlight msg\n                  unhighlighted s\n        _ -> unhighlighted s\n    Table a bc s th tb tf -> setFirstPara >>\n                              table o (Ann.toTable a bc s th tb tf)\n    HorizontalRule   -> setFirstPara >> return (selfClosingTag \"text:p\"\n                         [ (\"text:style-name\", \"Horizontal_20_Line\") ])\n    b@(RawBlock f s) -> if f == Format \"opendocument\"\n                        then return $ text $ T.unpack s\n                        else empty <$ report (BlockNotRendered b)\n    Figure a capt b  -> figure o a capt b\n    where\n      defList       b = do setInDefinitionList True\n                           r <- vcat  <$> mapM (deflistItemToOpenDocument o) b\n                           setInDefinitionList False\n                           return r\n      unhighlighted s = flush . vcat <$>\n            (mapM ((inPreformattedTags . (:[])) . preformatted) (T.lines s))\n      mkDiv    attr s = do\n        let (ident,_,kvs) = attr\n            i = withLangFromAttr attr $\n                case lookup \"custom-style\" kvs of\n                  Just sty -> withParagraphStyle o sty s\n                  _        -> blocksToOpenDocument o s\n            mkBookmarkedDiv = inTags False \"text:section\" [(\"text:name\", ident)]\n        if T.null ident\n          then i\n          else fmap mkBookmarkedDiv i\n      mkBlockQuote  b = do increaseIndent\n                           i <- paraStyle\n                                 [(\"style:parent-style-name\",\"Quotations\")]\n                           inBlockQuote o i (map plainToPara b)\n      orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a\n                           inTags True \"text:list\" [ (\"text:style-name\", \"L\" <> tshow ln)]\n                                      <$> orderedListToOpenDocument o pn b\n      table :: PandocMonad m => WriterOptions -> Ann.Table -> OD m (Doc Text)\n      table opts\n          (Ann.Table (ident, _, _) (Caption _ c) colspecs thead tbodies tfoot) = do\n        tn <- length <$> gets stTableStyles\n        pn <- length <$> gets stParaStyles\n        let  genIds      = map chr [65..]\n             name        = \"Table\" <> tshow (tn + 1)\n             (aligns, mwidths) = unzip colspecs\n             fromWidth (ColWidth w) | w > 0 = w\n             fromWidth _                    = 0\n             widths = map fromWidth mwidths\n             textWidth   = sum widths\n             columnIds   = zip genIds widths\n             mkColumn  n = selfClosingTag \"table:table-column\" [(\"table:style-name\", name <> \".\" <> T.singleton (fst n))]\n             columns     = map mkColumn columnIds\n             paraHStyles = paraTableStyles \"Heading\"  pn aligns\n             paraStyles  = paraTableStyles \"Contents\" (pn + length (newPara paraHStyles)) aligns\n             newPara     = map snd . filter (not . isEmpty . snd)\n        addTableStyle $ tableStyle tn textWidth columnIds\n        mapM_ addParaStyle . newPara $ paraHStyles ++ paraStyles\n        captionDoc <- if null c\n                      then return empty\n                      else inlinesToOpenDocument o (blocksToInlines c) >>=\n                             if isEnabled Ext_native_numbering o\n                                then numberedTableCaption ident\n                                else unNumberedCaption \"TableCaption\"\n        th <- colHeadsToOpenDocument o (map fst paraHStyles) thead\n        tr <- mapM (tableBodyToOpenDocument o (map fst paraHStyles) (map fst paraStyles)) tbodies\n        tf <- tableFootToOpenDocument o (map fst paraStyles) tfoot\n        let tableDoc = inTags True \"table:table\" [\n                            (\"table:name\"      , name)\n                          , (\"table:style-name\", name)\n                          ] (vcat columns $$ th $$ vcat tr $$ tf)\n        return $\n          case writerTableCaptionPosition opts of\n            CaptionAbove -> captionDoc $$ tableDoc\n            CaptionBelow -> tableDoc $$ captionDoc\n      figure opts (ident, _, _) (Caption _ longcapt) body =\n        case blocksToInlines longcapt of\n          [] ->\n            withParagraphStyle o \"Figure\" body\n          caption -> do\n            imageDoc <- withParagraphStyle o \"FigureWithCaption\" $\n                        map (\\case {Plain i -> Para i; b -> b}) body\n            captionDoc <- inlinesToOpenDocument o caption >>=\n                          if isEnabled Ext_native_numbering o\n                          then numberedFigureCaption ident\n                          else unNumberedCaption \"FigureCaption\"\n            return $\n              case writerFigureCaptionPosition opts of\n                CaptionAbove -> captionDoc $$ imageDoc\n                CaptionBelow -> imageDoc $$ captionDoc\n\n\nnumberedTableCaption :: PandocMonad m => Text -> Doc Text -> OD m (Doc Text)\nnumberedTableCaption ident caption = do\n    id' <- gets stTableCaptionId\n    modify (\\st -> st{ stTableCaptionId = id' + 1 })\n    capterm <- translateTerm Term.Table\n    return $ numberedCaption \"TableCaption\" capterm \"Table\" id' ident caption\n\nnumberedFigureCaption :: PandocMonad m => Text -> Doc Text -> OD m (Doc Text)\nnumberedFigureCaption ident caption = do\n    id' <- gets stImageCaptionId\n    modify (\\st -> st{ stImageCaptionId = id' + 1 })\n    capterm <- translateTerm Term.Figure\n    return $ numberedCaption \"FigureCaption\" capterm  \"Illustration\" id' ident caption\n\nnumberedCaption :: Text -> Text -> Text -> Int -> Text -> Doc Text -> Doc Text\nnumberedCaption style term name num ident caption =\n    let t = text $ T.unpack term\n        r = num - 1\n        ident' = case ident of\n          \"\" -> \"ref\" <> name <> tshow r\n          _ -> ident\n        s = inTags False \"text:sequence\" [ (\"text:ref-name\", ident'),\n                                           (\"text:name\", name),\n                                           (\"text:formula\", \"ooow:\" <> name <> \"+1\"),\n                                           (\"style:num-format\", \"1\") ] $ text $ show num\n        c = text \": \"\n    in inParagraphTagsWithStyle style $ hcat [ t, text \" \", s, c, caption ]\n\nunNumberedCaption :: Monad m => Text -> Doc Text -> OD m (Doc Text)\nunNumberedCaption style caption = return $ inParagraphTagsWithStyle style caption\n\ncolHeadsToOpenDocument :: PandocMonad m\n                       => WriterOptions -> [Text] -> Ann.TableHead\n                       -> OD m (Doc Text)\ncolHeadsToOpenDocument o ns (Ann.TableHead _ hs) =\n  case hs of\n    [] -> return empty\n    xs -> inTagsIndented \"table:table-header-rows\" <$>\n      tableHeaderRowsToOpenDocument o ns \"TableHeaderRowCell\" xs\n\ntableHeaderRowsToOpenDocument :: PandocMonad m\n                              => WriterOptions -> [Text] -> Text -> [Ann.HeaderRow]\n                              -> OD m (Doc Text)\ntableHeaderRowsToOpenDocument o ns s headerRows =\n  vcat <$> mapM headerRowToOpenDocument headerRows\n  where\n    headerRowToOpenDocument (Ann.HeaderRow _ _ c) =\n      inTagsIndented \"table:table-row\" .\n      vcat <$> mapM (tableItemToOpenDocument o s) (zip ns c)\n\ntableBodyToOpenDocument:: PandocMonad m\n                       => WriterOptions -> [Text] -> [Text] -> Ann.TableBody\n                       -> OD m (Doc Text)\ntableBodyToOpenDocument o headns bodyns tb = do\n    let (Ann.TableBody _ _ hs r) = tb\n    tableRowHeaders <- tableHeaderRowsToOpenDocument o headns \"TableRowCell\" hs\n    tableRows <- mapM (tableRowToOpenDocument o headns bodyns) r\n    return $ tableRowHeaders $$ vcat tableRows\n\ntableFootToOpenDocument :: PandocMonad m\n                        => WriterOptions -> [Text] -> Ann.TableFoot\n                        -> OD m (Doc Text)\ntableFootToOpenDocument o ns (Ann.TableFoot _ r) =\n  tableHeaderRowsToOpenDocument o ns \"TableRowCell\" r\n\ntableRowToOpenDocument :: PandocMonad m\n                       => WriterOptions -> [Text] -> [Text] -> Ann.BodyRow\n                       -> OD m (Doc Text)\n\ntableRowToOpenDocument o headns bodyns r =\n    let (Ann.BodyRow _ _ rowheaders cs) = r\n    in inTagsIndented \"table:table-row\" . vcat <$>\n    mapM (tableItemToOpenDocument o \"TableRowCell\")\n        ((zip headns rowheaders) ++ (zip (drop (length rowheaders) bodyns) cs))\n\ncolspanAttrib :: ColSpan -> [(Text, Text)]\ncolspanAttrib cs =\n  case cs of\n    ColSpan 1 -> mempty\n    ColSpan n -> [(\"table:number-columns-spanned\", tshow n)]\n\nrowspanAttrib :: RowSpan -> [(Text, Text)]\nrowspanAttrib rs =\n  case rs of\n    RowSpan 1 -> mempty\n    RowSpan n -> [(\"table:number-rows-spanned\", tshow n)]\n\nalignAttrib :: Alignment -> [(Text,Text)]\nalignAttrib a = case a of\n  AlignRight  -> (\"fo:text-align\",\"end\") : style\n  AlignCenter -> (\"fo:text-align\",\"center\") : style\n  _ -> []\n  where\n    style = [(\"style:justify-single-word\",\"false\")]\n\ntableItemToOpenDocument :: PandocMonad m\n                        => WriterOptions -> Text -> (Text,Ann.Cell)\n                        -> OD m (Doc Text)\ntableItemToOpenDocument o s (n,c) = do\n  let (Ann.Cell _colspecs _colnum (Cell _ align rs cs i) ) = c\n      csa = colspanAttrib cs\n      rsa = rowspanAttrib rs\n      aa = alignAttrib align\n      a = [ (\"table:style-name\" , s )\n          , (\"office:value-type\", \"string\" ) ] ++ csa ++ rsa\n  itemParaStyle <- case aa of\n                     [] -> return 0\n                     _  -> paraStyleFromParent n aa\n  let itemParaStyle' = case itemParaStyle of\n                         0 -> n\n                         x -> \"P\" <> tshow x\n  inTags True \"table:table-cell\" a <$>\n    withParagraphStyle o itemParaStyle' (map plainToPara i)\n\n-- | Convert a list of inline elements to OpenDocument.\ninlinesToOpenDocument :: PandocMonad m => WriterOptions -> [Inline] -> OD m (Doc Text)\ninlinesToOpenDocument o l = hcat <$> toChunks o l\n\ntoChunks :: PandocMonad m => WriterOptions -> [Inline] -> OD m [Doc Text]\ntoChunks _ [] = return []\ntoChunks o (x : xs)\n  | isChunkable x = do\n        contents <- (inTextStyle . hcat) =<<\n                     mapM (inlineToOpenDocument o) (x:ys)\n        rest <- toChunks o zs\n        return (contents : rest)\n  | otherwise     = do\n        contents <- inlineToOpenDocument o x\n        rest <- toChunks o xs\n        return (contents : rest)\n  where (ys, zs) = span isChunkable xs\n\nisChunkable :: Inline -> Bool\nisChunkable (Str _)   = True\nisChunkable Space     = True\nisChunkable SoftBreak = True\nisChunkable _         = False\n\n-- | Convert an inline element to OpenDocument.\ninlineToOpenDocument :: PandocMonad m => WriterOptions -> Inline -> OD m (Doc Text)\ninlineToOpenDocument o ils\n  = case ils of\n    Space         -> return space\n    SoftBreak\n     | writerWrapText o == WrapPreserve\n                  -> return $ preformatted \"\\n\"\n     | otherwise  -> return space\n    Span (\"\", [\"mark\"], []) xs ->\n      inTags False \"text:span\" [(\"text:style-name\",\"Highlighted\")] <$>\n        inlinesToOpenDocument o xs\n    Span attr xs  -> mkSpan attr xs\n    LineBreak     -> return $ selfClosingTag \"text:line-break\" []\n    Str         s -> return $ handleSpaces $ escapeStringForXML s\n    Emph        l -> withTextStyle Italic $ inlinesToOpenDocument o l\n    Underline   l -> withTextStyle Under  $ inlinesToOpenDocument o l\n    Strong      l -> withTextStyle Bold   $ inlinesToOpenDocument o l\n    Strikeout   l -> withTextStyle Strike $ inlinesToOpenDocument o l\n    Superscript l -> withTextStyle Sup    $ inlinesToOpenDocument o l\n    Subscript   l -> withTextStyle Sub    $ inlinesToOpenDocument o l\n    SmallCaps   l -> withTextStyle SmallC $ inlinesToOpenDocument o l\n    Quoted    t l -> inQuotes t <$> inlinesToOpenDocument o l\n    Code      attrs s -> case writerHighlightMethod o of\n      Skylighting {} ->\n        case highlight (writerSyntaxMap o) formatOpenDocument attrs s of\n                Right h  -> inlinedCode $ mconcat $ mconcat h\n                Left msg -> do\n                  unless (T.null msg) $ report $ CouldNotHighlight msg\n                  unhighlighted s\n      _ -> unhighlighted s\n    Math      t s -> lift (texMathToInlines t s) >>=\n                         inlinesToOpenDocument o\n    Cite      _ l -> inlinesToOpenDocument o l\n    RawInline f s -> if f == Format \"opendocument\"\n                       then return $ text $ T.unpack s\n                       else do\n                         report $ InlineNotRendered ils\n                         return empty\n    Link _ l (s,t) -> do\n      identTypes <- gets stIdentTypes\n      mkLink o identTypes s t <$> inlinesToOpenDocument o l\n    Image attr _ (s,t) -> mkImg attr s t\n    Note        l  -> mkNote l\n    where\n      unhighlighted s = inlinedCode $ preformatted s\n      inlinedCode s = return $ inTags False \"text:span\"\n                                 [(\"text:style-name\", \"Source_20_Text\")] s\n      mkImg (_, _, kvs) s _ = do\n               id' <- gets stImageId\n               modify (\\st -> st{ stImageId = id' + 1 })\n               let getDims [] = []\n                   getDims ((\"width\", w) :xs) = (\"svg:width\", w)  : getDims xs\n                   getDims ((\"rel-width\", w):xs) = (\"style:rel-width\", w) : getDims xs\n                   getDims ((\"height\", h):xs) = (\"svg:height\", h) : getDims xs\n                   getDims ((\"rel-height\", w):xs) = (\"style:rel-height\", w) : getDims xs\n                   getDims (_:xs) =                             getDims xs\n               return $ inTags False \"draw:frame\"\n                        ((\"draw:name\", \"img\" <> tshow id') : getDims kvs) $\n                     selfClosingTag \"draw:image\" [ (\"xlink:href\"   , s       )\n                                                 , (\"xlink:type\"   , \"simple\")\n                                                 , (\"xlink:show\"   , \"embed\" )\n                                                 , (\"xlink:actuate\", \"onLoad\")]\n      mkSpan attr xs =  do\n        let (ident,_,kvs) = attr\n            i = maybe id (\\sty ->\n                           fmap (inTags False \"text:span\"\n                                  [ (\"text:style-name\", sty) ]))\n                  (lookup \"custom-style\" kvs) .\n                 withLangFromAttr attr $ inlinesToOpenDocument o xs\n            mkBookmarkedSpan b =\n              if isEmpty b\n                then selfClosingBookmark ident\n                else inBookmarkTags ident b\n        if T.null ident\n          then i\n          else fmap mkBookmarkedSpan i\n      mkNote     l = do\n        n <- length <$> gets stNotes\n        let footNote t = inTags False \"text:note\"\n                         [ (\"text:id\"        , \"ftn\" <> tshow n)\n                         , (\"text:note-class\", \"footnote\"     )] $\n                         inTagsSimple \"text:note-citation\" (text . show $ n + 1) <>\n                         inTagsSimple \"text:note-body\" t\n        nn <- footNote <$> withAlteredTextStyles (const mempty)\n                            (withParagraphStyle o \"Footnote\" l)\n        addNote nn\n        return nn\n\nformatOpenDocument :: FormatOptions -> [SourceLine] -> [[Doc Text]]\nformatOpenDocument _fmtOpts = map (map toHlTok)\ntoHlTok :: Token -> Doc Text\ntoHlTok (toktype,tok) =\n  inTags False \"text:span\" [(\"text:style-name\", T.pack $ show toktype)] $ preformatted tok\n\npreformatted :: Text -> Doc Text\npreformatted s = handleSpaces $ escapeStringForXML s\n\nmkLink :: WriterOptions -> [(Text,ReferenceType)] -> Text -> Text -> Doc Text -> Doc Text\nmkLink o identTypes s t d =\n  let maybeIdentAndType = case T.uncons s of\n                            Just ('#', ident) -> find ((ident ==) . fst) identTypes\n                            _                 -> Nothing\n      d' = inSpanTags \"Definition\" d\n      ref refType format ident       = inTags False refType\n                                       [ (\"text:reference-format\", format ),\n                                         (\"text:ref-name\", ident) ]\n      inlineSpace                    = selfClosingTag \"text:s\" []\n      bookmarkRef                    = ref \"text:bookmark-ref\"\n      bookmarkRefNumber ident        = bookmarkRef \"number\" ident mempty\n      bookmarkRefName ident          = bookmarkRef \"text\" ident d\n      bookmarkRefNameNumber ident    = bookmarkRefNumber ident <> inlineSpace <> bookmarkRefName ident\n      bookmarkRef'\n        | isEnabled Ext_xrefs_number o && isEnabled Ext_xrefs_name o = bookmarkRefNameNumber\n        | isEnabled Ext_xrefs_name o                                 = bookmarkRefName\n        | otherwise                                                  = bookmarkRefNumber\n      sequenceRef                    = ref \"text:sequence-ref\"\n      sequenceRefNumber ident        = sequenceRef \"value\" ident mempty\n      sequenceRefName ident          = sequenceRef \"caption\" ident d\n      sequenceRefNameNumber ident    = sequenceRefNumber ident <> inlineSpace <> sequenceRefName ident\n      sequenceRef'\n        | isEnabled Ext_xrefs_number o && isEnabled Ext_xrefs_name o = sequenceRefNameNumber\n        | isEnabled Ext_xrefs_name o                                 = sequenceRefName\n        | otherwise                                                  = sequenceRefNumber\n      link = inTags False \"text:a\" [ (\"xlink:type\" , \"simple\")\n                                          , (\"xlink:href\" , s       )\n                                          , (\"office:name\", t       )\n                                          ] d'\n      linkOrReference = case maybeIdentAndType of\n                          Just (ident, HeaderRef) -> bookmarkRef' ident\n                          Just (ident, TableRef)  -> sequenceRef' ident\n                          Just (ident, FigureRef) -> sequenceRef' ident\n                          _                       -> link\n      in if isEnabled Ext_xrefs_name o || isEnabled Ext_xrefs_number o\n            then linkOrReference\n            else link\n\nbulletListStyle :: PandocMonad m => Int -> OD m (Int,(Int,[Doc Text]))\nbulletListStyle l = do\n  let doStyles  i = inTags True \"text:list-level-style-bullet\"\n                    [ (\"text:level\"      , tshow (i + 1))\n                    , (\"text:style-name\" , \"Bullet_20_Symbols\"  )\n                    , (\"style:num-suffix\", \".\"                  )\n                    , (\"text:bullet-char\", T.singleton (bulletList !! i))\n                    ] (listLevelStyle (1 + i))\n      bulletList  = map chr $ cycle [8226,9702,9642]\n      listElStyle = map doStyles [0..9]\n  pn <- paraListStyle l\n  return (pn, (l, listElStyle))\n\norderedListLevelStyle :: ListAttributes -> (Int, [Doc Text]) -> (Int,[Doc Text])\norderedListLevelStyle (s,n, d) (l,ls) =\n    let suffix    = case d of\n                      OneParen  -> [(\"style:num-suffix\", \")\")]\n                      TwoParens -> [(\"style:num-prefix\", \"(\")\n                                   ,(\"style:num-suffix\", \")\")]\n                      _         -> [(\"style:num-suffix\", \".\")]\n        format    = case n of\n                      UpperAlpha -> \"A\"\n                      LowerAlpha -> \"a\"\n                      UpperRoman -> \"I\"\n                      LowerRoman -> \"i\"\n                      _          -> \"1\"\n        listStyle = inTags True \"text:list-level-style-number\"\n                    ([ (\"text:level\"      , tshow $ 1 + length ls )\n                     , (\"text:style-name\" , \"Numbering_20_Symbols\")\n                     , (\"style:num-format\", format                )\n                     , (\"text:start-value\", tshow s               )\n                     ] ++ suffix) (listLevelStyle (1 + length ls))\n    in  (l, ls ++ [listStyle])\n\nlistLevelStyle :: Int -> Doc Text\nlistLevelStyle i =\n    let indent = tshow (0.25 + (0.25 * fromIntegral i :: Double)) in\n    inTags True \"style:list-level-properties\"\n                       [ (\"text:list-level-position-and-space-mode\",\n                          \"label-alignment\")\n                       , (\"fo:text-align\", \"right\")\n                       ] $\n       selfClosingTag \"style:list-level-label-alignment\"\n                      [ (\"text:label-followed-by\", \"listtab\")\n                      , (\"text:list-tab-stop-position\", indent <> \"in\")\n                      , (\"fo:text-indent\", \"-0.25in\")\n                      , (\"fo:margin-left\", indent <> \"in\")\n                      ]\n\ntableStyle :: Int -> Double -> [(Char,Double)] -> Doc Text\ntableStyle num textWidth wcs =\n    let tableId        = \"Table\" <> tshow (num + 1)\n        tableWidthAttr :: [(Text,Text)]\n        tableWidthAttr\n          | textWidth <= 1 && textWidth > 0 = [(\"style:rel-width\",\n                                                T.pack (show (round (textWidth * 100) :: Int) <> \"%\"))]\n          | otherwise    = []\n        table          = inTags True \"style:style\"\n                         [(\"style:name\", tableId)\n                         ,(\"style:family\", \"table\")] $\n                         selfClosingTag \"style:table-properties\"\n                         ((\"table:align\", \"center\") : tableWidthAttr)\n        colStyle (c,0) = selfClosingTag \"style:style\"\n                         [ (\"style:name\"  , tableId <> \".\" <> T.singleton c)\n                         , (\"style:family\", \"table-column\"       )]\n        colStyle (c,w) = inTags True \"style:style\"\n                         [ (\"style:name\"  , tableId <> \".\" <> T.singleton c)\n                         , (\"style:family\", \"table-column\"       )] $\n                         selfClosingTag \"style:table-column-properties\"\n                         [(\"style:rel-column-width\", T.pack $ printf \"%d*\" (floor $ w * 65535 :: Integer))]\n        headerRowCellStyle = inTags True \"style:style\"\n                         [ (\"style:name\"  , \"TableHeaderRowCell\")\n                         , (\"style:family\", \"table-cell\"    )] $\n                         selfClosingTag \"style:table-cell-properties\"\n                         [ (\"fo:border\", \"none\")]\n        rowCellStyle = inTags True \"style:style\"\n                         [ (\"style:name\"  , \"TableRowCell\")\n                         , (\"style:family\", \"table-cell\"    )] $\n                         selfClosingTag \"style:table-cell-properties\"\n                         [ (\"fo:border\", \"none\")]\n        cellStyles = if num == 0\n                     then headerRowCellStyle $$ rowCellStyle\n                     else empty\n        columnStyles   = map colStyle wcs\n    in cellStyles $$ table $$ vcat columnStyles\n\nparaStyle :: PandocMonad m => [(Text,Text)] -> OD m Int\nparaStyle attrs = do\n  pn <- (+)   1 . length       <$> gets stParaStyles\n  i  <- (*) (0.5 :: Double) . fromIntegral <$> gets stIndentPara\n  b  <- gets stInDefinition\n  t  <- gets stTight\n  let styleAttr = [ (\"style:name\"             , \"P\" <> tshow pn)\n                  , (\"style:family\"           , \"paragraph\"   )]\n      indentVal = flip (<>) \"in\" . tshow $ if b then max 0.5 i else i\n      tight     = if t then [ (\"fo:margin-top\"          , \"0in\"    )\n                            , (\"fo:margin-bottom\"       , \"0in\"    )]\n                       else []\n      indent    = if i /= 0 || b\n                      then [ (\"fo:margin-left\"         , indentVal)\n                           , (\"fo:margin-right\"        , \"0in\"    )\n                           , (\"fo:text-indent\"         , \"0in\"    )\n                           , (\"style:auto-text-indent\" , \"false\"  )]\n                      else []\n      attributes = indent <> tight\n      paraProps = if null attributes\n                     then mempty\n                     else selfClosingTag\n                             \"style:paragraph-properties\" attributes\n  addParaStyle $ inTags True \"style:style\" (styleAttr <> attrs) paraProps\n  return pn\n\nparaStyleFromParent :: PandocMonad m => Text -> [(Text,Text)] -> OD m Int\nparaStyleFromParent parent attrs = do\n  pn <- (+) 1 . length  <$> gets stParaStyles\n  let styleAttr = [ (\"style:name\"             , \"P\" <> tshow pn)\n                  , (\"style:family\"           , \"paragraph\")\n                  , (\"style:parent-style-name\", parent)]\n      paraProps = if null attrs\n                     then mempty\n                     else selfClosingTag\n                          \"style:paragraph-properties\" attrs\n  addParaStyle $ inTags True \"style:style\" styleAttr paraProps\n  return pn\n\n\nparaListStyle :: PandocMonad m => Int -> OD m Int\nparaListStyle l = paraStyle\n  [(\"style:parent-style-name\",\"Text_20_body\")\n  ,(\"style:list-style-name\", \"L\" <> tshow l)]\n\nparaTableStyles :: Text -> Int -> [Alignment] -> [(Text, Doc Text)]\nparaTableStyles _ _ [] = []\nparaTableStyles t s (a:xs)\n    | AlignRight  <- a = (         pName s, res s \"end\"   ) : paraTableStyles t (s + 1) xs\n    | AlignCenter <- a = (         pName s, res s \"center\") : paraTableStyles t (s + 1) xs\n    | otherwise        = (\"Table_20_\" <> t, empty         ) : paraTableStyles t  s      xs\n    where pName sn = \"P\" <> tshow (sn + 1)\n          res sn x = inTags True \"style:style\"\n                     [ (\"style:name\"             , pName sn        )\n                     , (\"style:family\"           , \"paragraph\"     )\n                     , (\"style:parent-style-name\", \"Table_20_\" <> t)] $\n                     selfClosingTag \"style:paragraph-properties\"\n                     [ (\"fo:text-align\", x)\n                     , (\"style:justify-single-word\", \"false\")]\n\ndata TextStyle = Italic\n               | Bold\n               | Under\n               | Strike\n               | Sub\n               | Sup\n               | SmallC\n               | Pre\n               | Language Lang\n               deriving ( Eq,Ord )\n\ntextStyleAttr :: Map.Map Text Text\n              -> TextStyle\n              -> Map.Map Text Text\ntextStyleAttr m = \\case\n  Italic -> Map.insert \"fo:font-style\" \"italic\" .\n                Map.insert \"style:font-style-asian\" \"italic\" .\n                Map.insert \"style:font-style-complex\" \"italic\" $ m\n  Bold   -> Map.insert \"fo:font-weight\" \"bold\" .\n                Map.insert \"style:font-weight-asian\" \"bold\" .\n                Map.insert \"style:font-weight-complex\" \"bold\" $ m\n  Under  -> Map.insert \"style:text-underline-style\" \"solid\" .\n                Map.insert \"style:text-underline-width\" \"auto\" .\n                Map.insert \"style:text-underline-color\" \"font-color\" $ m\n  Strike -> Map.insert \"style:text-line-through-style\" \"solid\" m\n  Sub    -> Map.insert \"style:text-position\" \"sub 58%\" m\n  Sup    -> Map.insert \"style:text-position\" \"super 58%\" m\n  SmallC -> Map.insert \"fo:font-variant\" \"small-caps\" m\n  Pre    -> Map.insert \"style:font-name\" \"Courier New\" .\n            Map.insert \"style:font-name-asian\" \"Courier New\" .\n            Map.insert \"style:font-name-complex\" \"Courier New\" $ m\n  Language lang ->\n            Map.insert \"fo:language\" (langLanguage lang) .\n            maybe id (Map.insert \"fo:country\") (langRegion lang) $ m\n\nwithLangFromAttr :: PandocMonad m => Attr -> OD m a -> OD m a\nwithLangFromAttr (_,_,kvs) action =\n  case lookup \"lang\" kvs of\n       Nothing -> action\n       Just l  ->\n         case parseLang l of\n              Right lang -> withTextStyle (Language lang) action\n              Left _ -> do\n                report $ InvalidLang l\n                action\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Org.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards #-}\n{- |\n   Module      : Text.Pandoc.Writers.Org\n   Copyright   : © 2010-2015 Puneeth Chaganti <punchagan@gmail.com>\n                   2010-2025 John MacFarlane <jgm@berkeley.edu>\n                   2016-2025 Albert Krewinkel <albert+pandoc@tarleb.com>\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to Emacs Org-Mode.\n\nOrg-Mode:  <http://orgmode.org>\n-}\nmodule Text.Pandoc.Writers.Org (writeOrg) where\nimport Control.Monad (zipWithM)\nimport Control.Monad.State.Strict\n    ( StateT, gets, modify, evalStateT )\nimport Data.Char (isAlphaNum, isDigit)\nimport Data.List (intersperse, partition, dropWhileEnd, transpose)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Maybe (isJust)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Map as M\nimport Text.DocLayout\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Citeproc.Locator (parseLocator, LocatorMap(..), LocatorInfo(..))\nimport Text.Pandoc.Walk (query)\nimport Text.Pandoc.Writers.Shared\n\ndata WriterState =\n  WriterState { stNotes   :: [[Block]]\n              , stHasMath :: Bool\n              , stOptions :: WriterOptions\n              }\n\ntype Org = StateT WriterState\n\n-- | Convert Pandoc to Org.\nwriteOrg :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteOrg opts document = do\n  let st = WriterState { stNotes = [],\n                         stHasMath = False,\n                         stOptions = opts }\n  evalStateT (pandocToOrg document) st\n\n-- | Return Org representation of document.\npandocToOrg :: PandocMonad m => Pandoc -> Org m Text\npandocToOrg (Pandoc meta blocks) = do\n  opts <- gets stOptions\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  metadata <- metaToContext opts\n               blockListToOrg\n               (fmap chomp . inlineListToOrg)\n               meta\n  body <- blockListToOrg blocks\n  notes <- gets (reverse . stNotes) >>= notesToOrg\n  hasMath <- gets stHasMath\n  let main = body $+$ notes\n  let context = defField \"body\" main\n              . defField \"math\" hasMath\n              . defField \"options\"\n                         (M.fromList\n                          ((if isEnabled Ext_smart_quotes opts\n                            then ((\"'\", \"t\"):)\n                            else id) .\n                           (if not (isEnabled Ext_special_strings opts)\n                            then ((\"-\", \"nil\"):)\n                            else id)\n                           $ ([] :: [(Text, Text)])))\n              . defField \"option-special-strings\"\n                         (isEnabled Ext_special_strings opts)\n              $ metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\n-- | Return Org representation of notes.\nnotesToOrg :: PandocMonad m => [[Block]] -> Org m (Doc Text)\nnotesToOrg notes =\n  vsep <$> zipWithM noteToOrg [1..] notes\n\n-- | Return Org representation of a note.\nnoteToOrg :: PandocMonad m => Int -> [Block] -> Org m (Doc Text)\nnoteToOrg num note = do\n  contents <- blockListToOrg note\n  let marker = \"[fn:\" ++ show num ++ \"] \"\n  return $ hang (length marker) (text marker) contents\n\n-- | Replace Unicode characters with their ASCII representation\nreplaceSpecialStrings :: Text -> Text\nreplaceSpecialStrings =\n  let expand c = case c of\n        '\\x00ad' -> \"\\\\-\"\n        '\\x2013' -> \"--\"\n        '\\x2014' -> \"---\"\n        '\\x2019' -> \"'\"\n        '\\x2026' -> \"...\"\n        _        -> T.singleton c\n  in T.concatMap expand\n\n-- | Escape special characters for Org.\nescapeString :: Text -> Doc Text\nescapeString t\n  | T.all isAlphaNum t = literal t\n  | otherwise = mconcat $ map escChar (T.unpack t)\n  where\n    -- escape special chars with ZERO WIDTH SPACE as org manual suggests\n   escChar c = if c == '*' || c == '#' || c == '|'\n     then afterBreak \"\\x200B\" <> char c\n     else char c\n\nisRawFormat :: Format -> Bool\nisRawFormat f =\n  f == Format \"latex\" || f == Format \"tex\" || f == Format \"org\"\n\n-- | Convert Pandoc block element to Org.\nblockToOrg :: PandocMonad m\n           => Block         -- ^ Block element\n           -> Org m (Doc Text)\nblockToOrg (Div (_, [\"cell\", \"code\"], _) (CodeBlock attr t : bs)) = do\n  -- ipynb code cell\n  let (ident, classes, kvs) = attr\n  blockListToOrg (CodeBlock (ident, classes ++ [\"code\"], kvs) t : bs)\nblockToOrg (Div (_, [\"output\", \"execute_result\"], _) [CodeBlock _attr t]) = do\n  -- ipynb code result\n  return $ \"#+RESULTS:\" $$\n    (prefixed \": \" . vcat . map literal $ T.split (== '\\n') t)\nblockToOrg (Div attr@(ident,_,_) bs) = do\n  opts <- gets stOptions\n  -- Strip off bibliography if citations enabled\n  if ident == \"refs\" && isEnabled Ext_citations opts\n     then return mempty\n     else divToOrg attr bs\nblockToOrg (Plain inlines) = inlineListToOrg inlines\nblockToOrg (Para inlines) = do\n  contents <- inlineListToOrg inlines\n  return $ contents <> blankline\nblockToOrg (LineBlock lns) = do\n  let splitStanza [] = []\n      splitStanza xs = case break (== mempty) xs of\n        (l, [])  -> [l]\n        (l, _:r) -> l : splitStanza r\n  let joinWithLinefeeds  = nowrap . mconcat . intersperse cr\n  let joinWithBlankLines = mconcat . intersperse blankline\n  let prettifyStanza ls  = joinWithLinefeeds <$> mapM inlineListToOrg ls\n  contents <- joinWithBlankLines <$> mapM prettifyStanza (splitStanza lns)\n  return $ blankline $$ \"#+begin_verse\" $$\n           nest 2 contents $$ \"#+end_verse\" <> blankline\nblockToOrg (RawBlock \"html\" str) =\n  return $ blankline $$ \"#+begin_html\" $$\n           nest 2 (literal str) $$ \"#+end_html\" $$ blankline\nblockToOrg b@(RawBlock f str)\n  | isRawFormat f = return $ literal str\n  | otherwise     = do\n      report $ BlockNotRendered b\n      return empty\nblockToOrg HorizontalRule = return $ blankline $$ \"--------------\" $$ blankline\nblockToOrg (Header level attr inlines) = do\n  let tagName inline = case inline of\n        Span (_, _, kv) _ -> (:[]) <$> lookup \"tag-name\" kv\n        _                 -> Nothing\n  let (htext, tagsInlines) = break (isJust . tagName) inlines\n  contents <- inlineListToOrg $ dropWhileEnd (== Space) htext\n  columns  <- writerColumns <$> gets stOptions\n  let headerDoc = mconcat\n        [ text $ if level > 999 then \" \" else replicate level '*'\n        , literal \" \"\n        , contents\n        ]\n  let tags = case query tagName tagsInlines of\n               Nothing -> \"\"\n               Just ts -> T.cons ':' (T.intercalate \":\" ts) `T.snoc` ':'\n  let tagsDoc = if T.null tags\n                then empty\n                else (<> literal tags) . text . (`replicate` ' ') . max 1 $\n                     columns - offset headerDoc - realLength tags\n  let drawerStr = if attr == nullAttr\n                  then empty\n                  else cr <> propertiesDrawer attr\n  return $ nowrap (headerDoc <> tagsDoc) <> drawerStr <> cr\nblockToOrg (CodeBlock (ident,classes,kvs) str) = do\n  let name = if T.null ident\n             then empty\n             else literal $ \"#+name: \" <> ident\n  let startnum = maybe \"\" (\\x -> \" \" <> trimr x) $ lookup \"startFrom\" kvs\n  let numberlines = if \"numberLines\" `elem` classes\n                      then if \"continuedSourceBlock\" `elem` classes\n                             then \" +n\" <> startnum\n                             else \" -n\" <> startnum\n                      else \"\"\n  let lang = case filter (`notElem` [\"example\",\"code\"]) classes of\n        []  -> Nothing\n        l:_ -> if \"code\" `elem` classes    -- check for ipynb code cell\n               then Just (\"jupyter-\" <> pandocLangToOrg l)\n               else Just (pandocLangToOrg l)\n  let args = mconcat $\n             [ \" :\" <> k <> \" \" <> v\n             | (k, v) <- kvs, k `notElem` [\"startFrom\", \"org-language\"]]\n  let (beg, end) = case lang of\n        Nothing -> (\"#+begin_example\" <> numberlines, \"#+end_example\")\n        Just x  -> (\"#+begin_src \" <> x <> numberlines <> args, \"#+end_src\")\n  -- escape special lines\n  let escape_line line =\n        let (spaces, code) = T.span (\\c -> c == ' ' || c == '\\t') line\n        in spaces <>\n           (if T.isPrefixOf \"#+\" code || T.isPrefixOf \"*\" code\n            then T.cons ',' code\n            else code)\n  let escaped = T.unlines . map escape_line . T.lines $ str\n  return $ name $$ literal beg $$ literal escaped $$ literal end $$ blankline\nblockToOrg (BlockQuote blocks) = do\n  contents <- blockListToOrg blocks\n  return $ blankline $$ \"#+begin_quote\" $$\n           chomp contents $$ \"#+end_quote\" $$ blankline\nblockToOrg (Table _ blkCapt specs thead tbody tfoot) =  do\n  let (caption', _, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  caption'' <- inlineListToOrg caption'\n  let caption = if null caption'\n                   then empty\n                   else \"#+caption: \" <> caption''\n  headers' <- mapM blockListToOrg headers\n  rawRows <- mapM (mapM blockListToOrg) rows\n  let numChars = maybe 0 maximum . nonEmpty . map offset\n  -- FIXME: width is not being used.\n  let widthsInChars =\n       map numChars $ transpose (headers' : rawRows)\n  -- FIXME: Org doesn't allow blocks with height more than 1.\n  let hpipeBlocks blocks = hcat [beg, middle, end]\n        where sep'   = vfill \" | \"\n              beg    = vfill \"| \"\n              end    = vfill \" |\"\n              middle = hcat $ intersperse sep' blocks\n  let makeRow = hpipeBlocks . zipWith lblock widthsInChars\n  let head' = makeRow headers'\n  rows' <- mapM (\\row -> do cols <- mapM blockListToOrg row\n                            return $ makeRow cols) rows\n  let border ch = char '|' <> char ch <>\n                  (hcat . intersperse (char ch <> char '+' <> char ch) $\n                          map (\\l -> text $ replicate l ch) widthsInChars) <>\n                  char ch <> char '|'\n  let body = vcat rows'\n  let head'' = if all null headers\n                  then empty\n                  else head' $$ border '-'\n  return $ head'' $$ body $$ caption $$ blankline\nblockToOrg (BulletList items) = do\n  contents <- mapM bulletListItemToOrg items\n  return $ (if isTightList items then vcat else vsep) contents $$\n           blankline\nblockToOrg (OrderedList (start, _, delim) items) = do\n  let delim' = case delim of\n                    TwoParens -> OneParen\n                    x         -> x\n  let markers = take (length items) $ orderedListMarkers\n                                      (start, Decimal, delim')\n      counters = (case start of 1 -> Nothing; n -> Just n) : repeat Nothing\n  contents <- zipWithM (\\x f -> f x) items $\n              zipWith orderedListItemToOrg markers counters\n  return $ (if isTightList items then vcat else vsep) contents $$\n           blankline\nblockToOrg (DefinitionList items) = do\n  contents <- mapM definitionListItemToOrg items\n  return $ vcat contents $$ blankline\nblockToOrg (Figure (ident, _, _) caption body) = do\n  -- Represent the figure as content that can be internally linked from other\n  -- parts of the document.\n  capt <- case caption of\n            Caption _ []  -> pure empty\n            Caption _ cpt -> (\"#+caption: \" <>) <$>\n                             inlineListToOrg (blocksToInlines cpt)\n  contents <-  blockListToOrg body\n  let anchor = if T.null ident\n               then empty\n               else \"<<\" <> literal ident <> \">>\"\n  return (capt $$ anchor $$ contents $$ blankline)\n\n-- | Convert bullet list item (list of blocks) to Org.\nbulletListItemToOrg :: PandocMonad m => [Block] -> Org m (Doc Text)\nbulletListItemToOrg items = do\n  exts <- gets $ writerExtensions . stOptions\n  contents <- blockListToOrg (taskListItemToOrg exts items)\n  -- if list item starts with non-paragraph, it must go on\n  -- the next line:\n  let contents' = (case items of\n                    Plain{}:_ -> mempty\n                    Para{}:_ -> mempty\n                    _ -> cr) <> chomp contents\n  return $ hang 2 \"- \" contents' $$\n          if null items || endsWithPlain items\n             then cr\n             else blankline\n\n-- | Convert ordered list item (a list of blocks) to Org.\norderedListItemToOrg :: PandocMonad m\n                     => Text   -- ^ marker for list item\n                     -> Maybe Int -- ^ maybe number for a counter cookie\n                     -> [Block]  -- ^ list item (list of blocks)\n                     -> Org m (Doc Text)\norderedListItemToOrg marker counter items = do\n  exts <- gets $ writerExtensions . stOptions\n  contents <- blockListToOrg (taskListItemToOrg exts items)\n  -- if list item starts with non-paragraph, it must go on\n  -- the next line:\n  let contents' = (case items of\n                    Plain{}:_ -> mempty\n                    Para{}:_ -> mempty\n                    _ -> cr) <> chomp contents\n  let cookie = maybe empty\n               (\\n -> space <> literal \"[@\" <> literal (tshow n) <> literal \"]\")\n               counter\n  return $ hang (T.length marker + 1)\n                (literal marker <> cookie <> space) contents' $$\n          if null items || endsWithPlain items\n             then cr\n             else blankline\n\n-- | Convert a list item containing text starting with @U+2610 BALLOT BOX@\n-- or @U+2612 BALLOT BOX WITH X@ to org checkbox syntax (e.g. @[X]@).\ntaskListItemToOrg :: Extensions -> [Block] -> [Block]\ntaskListItemToOrg = handleTaskListItem toOrg\n  where\n    toOrg (Str \"☐\" : Space : is) = Str \"[ ]\" : Space : is\n    toOrg (Str \"☒\" : Space : is) = Str \"[X]\" : Space : is\n    toOrg is = is\n\n-- | Convert definition list item (label, list of blocks) to Org.\ndefinitionListItemToOrg :: PandocMonad m\n                        => ([Inline], [[Block]]) -> Org m (Doc Text)\ndefinitionListItemToOrg (label, defs) = do\n  label' <- inlineListToOrg label\n  contents <- vcat <$> mapM blockListToOrg defs\n  return $ hang 2 \"- \" (label' <> \" :: \" <> contents) $$\n      if isTightList defs\n         then cr\n         else blankline\n\n-- | Convert list of key/value pairs to Org :PROPERTIES: drawer.\npropertiesDrawer :: Attr -> Doc Text\npropertiesDrawer (ident, classes, kv) =\n  let\n    drawerStart = text \":PROPERTIES:\"\n    drawerEnd   = text \":END:\"\n    kv'  = if classes == mempty then kv  else (\"CLASS\", T.unwords classes):kv\n    kv'' = if ident == mempty   then kv' else (\"CUSTOM_ID\", ident):kv'\n    properties = vcat $ map kvToOrgProperty kv''\n  in\n    drawerStart <> cr <> properties <> cr <> drawerEnd\n where\n   kvToOrgProperty :: (Text, Text) -> Doc Text\n   kvToOrgProperty (key, value) =\n     text \":\" <> literal key <> text \": \" <> literal value <> cr\n\n-- | The different methods to represent a Div block.\ndata DivBlockType\n  = GreaterBlock Text Attr   -- ^ Greater block like @center@ or @quote@.\n  | Drawer Text Attr         -- ^ Org drawer with of given name; keeps\n                             --   key-value pairs.\n  | UnwrappedWithAnchor Text -- ^ Not mapped to other type, only\n                             --   identifier is retained (if any).\n  deriving (Show)\n\n-- | Gives the most suitable method to render a list of blocks\n-- with attributes.\ndivBlockType :: Attr-> DivBlockType\ndivBlockType (ident, classes, kvs)\n  -- if any class is named \"drawer\", then output as org :drawer:\n  | ([_], drawerName:classes') <- partition (== \"drawer\") classes\n  = Drawer drawerName (ident, classes', kvs)\n  -- if any class is either @center@ or @quote@, then use a org block.\n  | (blockName:classes'', classes') <- partition isGreaterBlockClass classes\n  = GreaterBlock blockName (ident, classes' <> classes'', kvs)\n  -- if no better method is found, unwrap div and set anchor\n  | otherwise\n  = UnwrappedWithAnchor ident\n where\n  isGreaterBlockClass :: Text -> Bool\n  isGreaterBlockClass t = case T.toLower t of\n                            \"center\" -> True\n                            \"quote\" -> True\n                            x -> isAdmonition x\n\nisAdmonition :: Text -> Bool\nisAdmonition \"warning\" = True\nisAdmonition \"important\" = True\nisAdmonition \"tip\" = True\nisAdmonition \"note\" = True\nisAdmonition \"caution\" = True\nisAdmonition _ = False\n\n-- | Converts a Div to an org-mode element.\ndivToOrg :: PandocMonad m\n         => Attr -> [Block] -> Org m (Doc Text)\ndivToOrg attr bs = do\n  case divBlockType attr of\n    GreaterBlock blockName attr' -> do\n      -- Write as greater block. The ID, if present, is added via\n      -- the #+name keyword; other classes and key-value pairs\n      -- are kept as #+attr_html attributes.\n      contents <- case bs of\n                    (Div (\"\",[\"title\"],[]) _ : bs')\n                      | isAdmonition blockName -> blockListToOrg bs'\n                    _ -> blockListToOrg bs\n      return $ blankline\n            $$ attrHtml attr'\n            $$ \"#+begin_\" <> literal blockName\n            $$ chomp contents\n            $$ \"#+end_\" <> literal blockName $$ blankline\n    Drawer drawerName (_,_,kvs) -> do\n      contents <- blockListToOrg bs\n      -- Write as drawer. Only key-value pairs are retained.\n      let keys = vcat $ map (\\(k,v) ->\n                               \":\" <> literal k <> \":\"\n                              <> space <> literal v) kvs\n      return $ \":\" <> literal drawerName <> \":\" $$ cr\n            $$ keys $$ blankline\n            $$ contents $$ blankline\n            $$ text \":END:\" $$ blankline\n    UnwrappedWithAnchor ident -> do\n      contents <- blockListToOrg bs\n      -- Unwrap the div. All attributes are discarded, except for\n      -- the identifier, which is added as an anchor before the\n      -- div contents.\n      let contents' = if T.null ident\n                      then contents\n                      else  \"<<\" <> literal ident <> \">>\" $$ contents\n      return (blankline $$ contents' $$ blankline)\n\nattrHtml :: Attr -> Doc Text\nattrHtml (\"\"   , []     , []) = mempty\nattrHtml (ident, classes, kvs) =\n  let\n    name = if T.null ident then mempty else \"#+name: \" <> literal ident <> cr\n    keyword = \"#+attr_html\"\n    addClassKv = if null classes\n                    then id\n                    else ((\"class\", T.unwords classes):)\n    kvStrings = map (\\(k,v) -> \":\" <> k <> \" \" <> v) (addClassKv kvs)\n  in name <> if null kvStrings\n                then mempty\n                else keyword <> \": \" <> literal (T.unwords kvStrings) <> cr\n\n-- | Convert list of Pandoc block elements to Org.\nblockListToOrg :: PandocMonad m\n               => [Block]       -- ^ List of block elements\n               -> Org m (Doc Text)\nblockListToOrg blocks = vcat <$> mapM blockToOrg blocks\n\n-- | Convert list of Pandoc inline elements to Org.\ninlineListToOrg :: PandocMonad m\n                => [Inline]\n                -> Org m (Doc Text)\ninlineListToOrg lst = hcat <$> mapM inlineToOrg (fixMarkers lst)\n  where -- Prevent note refs and list markers from wrapping, see #4171\n        -- and #7132.\n        fixMarkers [] = []\n        fixMarkers (Space : x : rest) | shouldFix x =\n          Str \" \" : x : fixMarkers rest\n        fixMarkers (SoftBreak : x : rest) | shouldFix x =\n          Str \" \" : x : fixMarkers rest\n        fixMarkers (x : rest) = x : fixMarkers rest\n\n        shouldFix Note{} = True    -- Prevent footnotes\n        shouldFix (Str \"-\") = True -- Prevent bullet list items\n        shouldFix (Str x)          -- Prevent ordered list items\n          | Just (cs, c) <- T.unsnoc x = T.all isDigit cs &&\n                                         (c == '.' || c == ')')\n        shouldFix _ = False\n\n-- | Convert Pandoc inline element to Org.\ninlineToOrg :: PandocMonad m => Inline -> Org m (Doc Text)\ninlineToOrg (Span (uid, [], []) []) =\n  return $ \"<<\" <> literal uid <> \">>\"\ninlineToOrg (Span _ lst) =\n  inlineListToOrg lst\ninlineToOrg (Emph lst) = do\n  contents <- inlineListToOrg lst\n  return $ \"/\" <> contents <> \"/\"\ninlineToOrg (Underline lst) = do\n  contents <- inlineListToOrg lst\n  return $ \"_\" <> contents <> \"_\"\ninlineToOrg (Strong lst) = do\n  contents <- inlineListToOrg lst\n  return $ \"*\" <> contents <> \"*\"\ninlineToOrg (Strikeout lst) = do\n  contents <- inlineListToOrg lst\n  return $ \"+\" <> contents <> \"+\"\ninlineToOrg (Superscript lst) = do\n  contents <- inlineListToOrg lst\n  return $ \"^{\" <> contents <> \"}\"\ninlineToOrg (Subscript lst) = do\n  contents <- inlineListToOrg lst\n  return $ \"_{\" <> contents <> \"}\"\ninlineToOrg (SmallCaps lst) = inlineListToOrg lst\ninlineToOrg (Quoted SingleQuote lst) = do\n  contents <- inlineListToOrg lst\n  opts <- gets stOptions\n  return $\n    if isEnabled Ext_smart opts || isEnabled Ext_smart_quotes opts\n    then \"'\" <> contents <> \"'\"\n    else \"‘\" <> contents <> \"’\"\ninlineToOrg (Quoted DoubleQuote lst) = do\n  contents <- inlineListToOrg lst\n  opts <- gets stOptions\n  return $\n    if isEnabled Ext_smart opts || isEnabled Ext_smart_quotes opts\n    then \"\\\"\" <> contents <> \"\\\"\"\n    else \"“\" <> contents <> \"”\"\ninlineToOrg (Cite cs lst) = do\n  opts <- gets stOptions\n  if isEnabled Ext_citations opts\n     then do\n       let renderCiteItem c = do\n             citePref <- inlineListToOrg (citationPrefix c)\n             let (locinfo, suffix) = parseLocator locmap (citationSuffix c)\n             citeSuff <- inlineListToOrg suffix\n             let locator = case locinfo of\n                            Just info -> literal $\n                              T.replace \"\\160\" \" \" $\n                              T.replace \"{\" \"\" $\n                              T.replace \"}\" \"\" $ locatorRaw info\n                            Nothing -> mempty\n             return $ hsep [ citePref\n                           , (\"@\" <> literal (citationId c))\n                           , locator\n                           , citeSuff ]\n       citeItems <- mconcat . intersperse \"; \" <$> mapM renderCiteItem cs\n       let sty = case cs of\n                   (d:_)\n                     | citationMode d == AuthorInText\n                     -> literal \"/t\"\n                   [d]\n                     | citationMode d == SuppressAuthor\n                     -> literal \"/na\"\n                   _ -> mempty\n       return $ \"[cite\" <> sty <> \":\" <> citeItems <> \"]\"\n     else inlineListToOrg lst\ninlineToOrg (Code _ str) = return $ \"=\" <> literal str <> \"=\"\ninlineToOrg (Str str) = do\n  opts <- gets stOptions\n  let str' = if isEnabled Ext_smart opts || isEnabled Ext_special_strings opts\n             then replaceSpecialStrings str\n             else str\n  return $ escapeString str'\ninlineToOrg (Math t str) = do\n  modify $ \\st -> st{ stHasMath = True }\n  return $ if t == InlineMath\n              then \"\\\\(\" <> literal str <> \"\\\\)\"\n              else \"\\\\[\" <> literal str <> \"\\\\]\"\ninlineToOrg il@(RawInline f str)\n  | elem f [\"tex\", \"latex\"] && T.isPrefixOf \"\\\\begin\" str =\n    return $ cr <> literal str <> cr\n  | isRawFormat f = return $ literal str\n  | otherwise     = do\n      report $ InlineNotRendered il\n      return empty\ninlineToOrg LineBreak = return (text \"\\\\\\\\\" <> cr)\ninlineToOrg Space = return space\ninlineToOrg SoftBreak = do\n  wrapText <- gets (writerWrapText . stOptions)\n  case wrapText of\n       WrapPreserve -> return cr\n       WrapAuto     -> return space\n       WrapNone     -> return space\ninlineToOrg (Link _ txt (src, _)) =\n  case txt of\n        [Str x] | escapeURI x == src ->  -- autolink\n             return $ \"[[\" <> literal (orgPath x) <> \"]]\"\n        _ -> do contents <- nowrap <$> inlineListToOrg txt\n                return $ \"[[\" <> literal (orgPath src) <> \"][\" <> contents <> \"]]\"\ninlineToOrg (Image _ _ (source, _)) =\n  return $ \"[[\" <> literal (orgPath source) <> \"]]\"\ninlineToOrg (Note contents) = do\n  -- add to notes in state\n  notes <- gets stNotes\n  modify $ \\st -> st { stNotes = contents:notes }\n  let ref = tshow $ length notes + 1\n  return $ \"[fn:\" <> literal ref <> \"]\"\n\norgPath :: Text -> Text\norgPath src = case T.uncons src of\n  Nothing            -> \"\"             -- wiki link\n  Just ('#', _)      -> src            -- internal link\n  _ | isUrl src      -> src\n  _ | isFilePath src -> src\n  _                  -> \"file:\" <> src\n  where\n    isFilePath :: Text -> Bool\n    isFilePath cs = any (`T.isPrefixOf` cs) [\"/\", \"./\", \"../\", \"file:\"]\n\n    isUrl :: Text -> Bool\n    isUrl cs =\n      let (scheme, path) = T.break (== ':') cs\n       in T.all (\\c -> isAlphaNum c || T.any (== c) \".-\") scheme\n          && not (T.null path)\n\n-- | Translate from pandoc's programming language identifiers to those used by\n-- org-mode.\npandocLangToOrg :: Text -> Text\npandocLangToOrg cs =\n  case cs of\n    \"c\"          -> \"C\"\n    \"commonlisp\" -> \"lisp\"\n    \"r\"          -> \"R\"\n    \"bash\"       -> \"sh\"\n    _            -> cs\n\n-- taken from oc-csl.el in the org source tree:\nlocmap :: LocatorMap\nlocmap = LocatorMap $ M.fromList\n  [ (\"bk.\"       , \"book\")\n  , (\"bks.\"      , \"book\")\n  , (\"book\"      , \"book\")\n  , (\"chap.\"     , \"chapter\")\n  , (\"chaps.\"    , \"chapter\")\n  , (\"chapter\"   , \"chapter\")\n  , (\"col.\"      , \"column\")\n  , (\"cols.\"     , \"column\")\n  , (\"column\"    , \"column\")\n  , (\"figure\"    , \"figure\")\n  , (\"fig.\"      , \"figure\")\n  , (\"figs.\"     , \"figure\")\n  , (\"folio\"     , \"folio\")\n  , (\"fol.\"      , \"folio\")\n  , (\"fols.\"     , \"folio\")\n  , (\"number\"    , \"number\")\n  , (\"no.\"       , \"number\")\n  , (\"nos.\"      , \"number\")\n  , (\"line\"      , \"line\")\n  , (\"l.\"        , \"line\")\n  , (\"ll.\"       , \"line\")\n  , (\"note\"      , \"note\")\n  , (\"n.\"        , \"note\")\n  , (\"nn.\"       , \"note\")\n  , (\"opus\"      , \"opus\")\n  , (\"op.\"       , \"opus\")\n  , (\"opp.\"      , \"opus\")\n  , (\"page\"      , \"page\")\n  , (\"p\"         , \"page\")\n  , (\"p.\"        , \"page\")\n  , (\"pp.\"       , \"page\")\n  , (\"paragraph\" , \"paragraph\")\n  , (\"para.\"     , \"paragraph\")\n  , (\"paras.\"    , \"paragraph\")\n  , (\"¶\"         , \"paragraph\")\n  , (\"¶¶\"        , \"paragraph\")\n  , (\"part\"      , \"part\")\n  , (\"pt.\"       , \"part\")\n  , (\"pts.\"      , \"part\")\n  , (\"§\"         , \"section\")\n  , (\"§§\"        , \"section\")\n  , (\"section\"   , \"section\")\n  , (\"sec.\"      , \"section\")\n  , (\"secs.\"     , \"section\")\n  , (\"sub verbo\" , \"sub verbo\")\n  , (\"s.v.\"      , \"sub verbo\")\n  , (\"s.vv.\"     , \"sub verbo\")\n  , (\"verse\"     , \"verse\")\n  , (\"v.\"        , \"verse\")\n  , (\"vv.\"       , \"verse\")\n  , (\"volume\"    , \"volume\")\n  , (\"vol.\"      , \"volume\")\n  , (\"vols.\"     , \"volume\") ]\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Powerpoint/Output.hs",
    "content": "{-# LANGUAGE DeriveTraversable #-}\n{-# LANGUAGE NamedFieldPuns #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards #-}\n{-# LANGUAGE RankNTypes #-}\n{-# LANGUAGE RecordWildCards #-}\n{-# LANGUAGE TupleSections #-}\n{- |\n   Module      : Text.Pandoc.Writers.Powerpoint.Output\n   Copyright   : Copyright (C) 2017-2020 Jesse Rosenthal\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of Presentation datatype (defined in\nText.Pandoc.Writers.Powerpoint.Presentation) to a zip archive.\n-}\n\nmodule Text.Pandoc.Writers.Powerpoint.Output ( presentationToArchive\n                                             ) where\n\nimport Control.Monad ( MonadPlus(mplus), foldM, unless )\nimport Control.Monad.Except (throwError, catchError)\nimport Control.Monad.Reader\n    ( asks, MonadReader(local), ReaderT(runReaderT) )\nimport Control.Monad.State\n    ( StateT, gets, modify, evalStateT )\nimport Codec.Archive.Zip\nimport Data.List (intercalate, stripPrefix, nub, union, isPrefixOf, intersperse)\nimport Data.Bifunctor (bimap)\nimport Data.CaseInsensitive (CI)\nimport qualified Data.CaseInsensitive as CI\nimport Data.Default\nimport Data.Foldable (toList)\nimport Data.List.NonEmpty (nonEmpty, NonEmpty ((:|)))\nimport Data.Ratio ((%), Ratio)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.Text.Read (decimal)\nimport Data.Time (formatTime, defaultTimeLocale)\nimport Data.Time.Clock (UTCTime)\nimport Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds, posixSecondsToUTCTime)\nimport Data.Traversable (for)\nimport System.FilePath.Posix (splitDirectories, splitExtension, takeExtension, takeFileName)\nimport Text.Pandoc.XML.Light as XML\nimport Text.Pandoc.Definition\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Error (PandocError(..))\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Data (readDataFile, readDefaultDataFile)\nimport Text.Pandoc.Options\nimport Text.Pandoc.MIME\nimport qualified Data.ByteString.Lazy as BL\nimport Text.Pandoc.Writers.Shared (metaToContext)\nimport Text.Pandoc.Writers.OOXML\nimport qualified Data.Map as M\nimport Data.Maybe (mapMaybe, listToMaybe, fromMaybe, maybeToList, catMaybes, isJust)\nimport Text.Pandoc.ImageSize\nimport Control.Applicative ((<|>))\nimport System.FilePath.Glob\nimport Text.DocTemplates (FromContext(lookupContext), Context)\nimport Text.DocLayout (literal)\nimport Text.TeXMath\nimport Text.Pandoc.Logging (LogMessage(PowerpointTemplateWarning))\nimport Text.Pandoc.Writers.Math (convertMath)\nimport Text.Pandoc.Writers.Powerpoint.Presentation\nimport Text.Pandoc.Shared (tshow, stringify)\nimport Skylighting (fromColor)\n\n-- |The 'EMU' type is used to specify sizes in English Metric Units.\ntype EMU = Integer\n\n-- |The 'pixelsToEmu' function converts a size in pixels to one\n-- in English Metric Units. It assumes a DPI of 72.\npixelsToEmu :: Pixels -> EMU\npixelsToEmu = (12700 *)\n\n-- This populates the global ids map with images already in the\n-- template, so the ids won't be used by images introduced by the\n-- user.\ninitialGlobalIds :: Archive -> Archive -> M.Map FilePath Int\ninitialGlobalIds refArchive distArchive =\n  let archiveFiles = filesInArchive refArchive `union` filesInArchive distArchive\n      mediaPaths = filter (isPrefixOf \"ppt/media/image\") archiveFiles\n\n      go :: FilePath -> Maybe (FilePath, Int)\n      go fp = do\n        s <- stripPrefix \"ppt/media/image\" $ fst $ splitExtension fp\n        (n, _) <- listToMaybe $ reads s\n        return (fp, n)\n  in\n    M.fromList $ mapMaybe go mediaPaths\n\ngetPresentationSize :: Archive -> Archive -> Maybe (Integer, Integer)\ngetPresentationSize refArchive distArchive = do\n  entry <- findEntryByPath \"ppt/presentation.xml\" refArchive  `mplus`\n           findEntryByPath \"ppt/presentation.xml\" distArchive\n  presElement <- either (const Nothing) return $\n                   parseXMLElement $ UTF8.toTextLazy $ fromEntry entry\n  let ns = elemToNameSpaces presElement\n  sldSize <- findChild (elemName ns \"p\" \"sldSz\") presElement\n  cxS <- findAttr (QName \"cx\" Nothing Nothing) sldSize\n  cyS <- findAttr (QName \"cy\" Nothing Nothing) sldSize\n  cx <- readTextAsInteger cxS\n  cy <- readTextAsInteger cyS\n  return (cx `div` 12700, cy `div` 12700)\n\nreadTextAsInteger :: Text -> Maybe Integer\nreadTextAsInteger = either (const Nothing) (Just . fst) . Data.Text.Read.decimal\n\ndata WriterEnv = WriterEnv { envRefArchive :: Archive\n                           , envDistArchive :: Archive\n                           , envUTCTime :: UTCTime\n                           , envOpts :: WriterOptions\n                           , envContext :: Context Text\n                           , envPresentationSize :: (Integer, Integer)\n                           , envSlideHasHeader :: Bool\n                           , envInList :: Bool\n                           , envInNoteSlide :: Bool\n                           , envCurSlideId :: Int\n                           , envPlaceholder :: Placeholder\n                           , envSlideIdMap :: M.Map SlideId Int\n                           -- maps the slide number to the\n                           -- corresponding notes id number. If there\n                           -- are no notes for a slide, there will be\n                           -- no entry in the map for it.\n                           , envSpeakerNotesIdMap :: M.Map Int Int\n                           , envInSpeakerNotes :: Bool\n                           , envSlideLayouts :: Maybe SlideLayouts\n                           , envOtherStyleIndents :: Maybe Indents\n                           }\n                 deriving (Show)\n\ninstance Default WriterEnv where\n  def = WriterEnv { envRefArchive = emptyArchive\n                  , envDistArchive = emptyArchive\n                  , envUTCTime = posixSecondsToUTCTime 0\n                  , envOpts = def\n                  , envContext = mempty\n                  , envPresentationSize = (720, 540)\n                  , envSlideHasHeader = False\n                  , envInList = False\n                  , envInNoteSlide = False\n                  , envCurSlideId = 1\n                  , envPlaceholder = Placeholder ObjType 0\n                  , envSlideIdMap = mempty\n                  , envSpeakerNotesIdMap = mempty\n                  , envInSpeakerNotes = False\n                  , envSlideLayouts = Nothing\n                  , envOtherStyleIndents = Nothing\n                  }\n\ntype SlideLayouts = SlideLayoutsOf SlideLayout\n\ndata SlideLayoutsOf a = SlideLayouts\n  { metadata :: a\n  , title :: a\n  , content :: a\n  , twoColumn :: a\n  , comparison :: a\n  , contentWithCaption :: a\n  , blank :: a\n  } deriving (Show, Eq, Functor, Foldable, Traversable)\n\ndata SlideLayout = SlideLayout\n  { slElement :: Element\n  , slInReferenceDoc :: Bool\n    -- ^ True if the layout is in the provided reference doc, False if it's in\n    -- the default reference doc.\n  , slPath :: FilePath\n  , slEntry :: Entry\n  } deriving (Show)\n\ngetSlideLayouts :: PandocMonad m => P m SlideLayouts\ngetSlideLayouts = asks envSlideLayouts >>= maybe (throwError e) pure\n  where\n    e = PandocSomeError (\"Slide layouts aren't defined, even though they should \"\n      <> \"always be. This is a bug in pandoc.\")\n\n-- | A placeholder within a layout, identified by type and index.\n--\n-- E.g., @Placeholder ObjType 2@ is the third placeholder of type 'ObjType' in\n-- the layout.\ndata Placeholder = Placeholder\n  { placeholderType :: PHType\n  , index :: Int\n  } deriving (Show, Eq)\n\n-- | Paragraph indentation info.\ndata Indents = Indents\n  { level1 :: Maybe LevelIndents\n  , level2 :: Maybe LevelIndents\n  , level3 :: Maybe LevelIndents\n  , level4 :: Maybe LevelIndents\n  , level5 :: Maybe LevelIndents\n  , level6 :: Maybe LevelIndents\n  , level7 :: Maybe LevelIndents\n  , level8 :: Maybe LevelIndents\n  , level9 :: Maybe LevelIndents\n  } deriving (Show, Eq)\n\nlevelIndent :: Indents -> Int -> Maybe LevelIndents\nlevelIndent is index = getter is\n  where\n    getter = case index of\n      0 -> level1\n      1 -> level2\n      2 -> level3\n      3 -> level4\n      4 -> level5\n      5 -> level6\n      6 -> level7\n      7 -> level8\n      8 -> level9\n      _ -> const Nothing\n\ndata LevelIndents = LevelIndents\n  { marL :: EMU\n  , indent :: EMU\n  } deriving (Show, Eq)\n\ndata MediaInfo = MediaInfo { mInfoFilePath :: FilePath\n                           , mInfoLocalId  :: Int\n                           , mInfoGlobalId :: Int\n                           , mInfoMimeType :: Maybe MimeType\n                           , mInfoExt      :: Maybe T.Text\n                           , mInfoCaption  :: Bool\n                           } deriving (Show, Eq)\n\ndata WriterState = WriterState { stLinkIds :: M.Map Int (M.Map Int LinkTarget)\n                               -- (FP, Local ID, Global ID, Maybe Mime)\n                               , stMediaIds :: M.Map Int [MediaInfo]\n                               , stMediaGlobalIds :: M.Map FilePath Int\n                               , stFooterInfo :: Maybe FooterInfo\n                               } deriving (Show, Eq)\n\ninstance Default WriterState where\n  def = WriterState { stLinkIds = mempty\n                    , stMediaIds = mempty\n                    , stMediaGlobalIds = mempty\n                    , stFooterInfo = Nothing\n                    }\n\ntype P m = ReaderT WriterEnv (StateT WriterState m)\n\nrunP :: Monad m => WriterEnv -> WriterState -> P m a -> m a\nrunP env st p = evalStateT (runReaderT p env) st\n\n--------------------------------------------------------------------\n\nmonospaceFont :: Monad m => P m T.Text\nmonospaceFont = do\n  vars <- asks envContext\n  case lookupContext \"monofont\" vars of\n    Just s -> return s\n    Nothing -> return \"Courier\"\n\nfontSizeAttributes :: Monad m => RunProps -> P m [(Text, Text)]\nfontSizeAttributes RunProps { rPropForceSize = Just sz } =\n  return [(\"sz\", tshow $ sz * 100)]\nfontSizeAttributes _ = return []\n\ncopyFileToArchive :: PandocMonad m => Archive -> FilePath -> P m Archive\ncopyFileToArchive arch fp = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  case findEntryByPath fp refArchive `mplus` findEntryByPath fp distArchive of\n    Nothing -> throwError $ PandocSomeError\n                          $ T.pack\n                          $ fp <> \" missing in reference file\"\n    Just e -> return $ addEntryToArchive e arch\n\nalwaysInheritedPatterns :: [Pattern]\nalwaysInheritedPatterns =\n  map compile [ \"docProps/app.xml\"\n              , \"ppt/slideLayouts/slideLayout*.xml\"\n              , \"ppt/slideLayouts/_rels/slideLayout*.xml.rels\"\n              , \"ppt/slideMasters/slideMaster1.xml\"\n              , \"ppt/slideMasters/_rels/slideMaster1.xml.rels\"\n              , \"ppt/theme/theme*.xml\"\n              , \"ppt/theme/_rels/theme*.xml.rels\"\n              , \"ppt/presProps.xml\"\n              , \"ppt/tableStyles.xml\"\n              , \"ppt/media/image*\"\n              , \"ppt/fonts/*\"\n              ]\n\n-- We only look for these under special conditions\ncontingentInheritedPatterns :: Presentation -> [Pattern]\ncontingentInheritedPatterns pres = [] <>\n  if presHasSpeakerNotes pres\n  then map compile [ \"ppt/notesMasters/notesMaster*.xml\"\n                   , \"ppt/notesMasters/_rels/notesMaster*.xml.rels\"\n                   ]\n  else []\n\ninheritedPatterns :: Presentation -> [Pattern]\ninheritedPatterns pres =\n  alwaysInheritedPatterns <> contingentInheritedPatterns pres\n\npatternToFilePaths :: PandocMonad m => Pattern -> P m [FilePath]\npatternToFilePaths pat = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n\n  let archiveFiles = filesInArchive refArchive `union` filesInArchive distArchive\n  return $ filter (match pat) archiveFiles\n\npatternsToFilePaths :: PandocMonad m => [Pattern] -> P m [FilePath]\npatternsToFilePaths pats = concat <$> mapM patternToFilePaths pats\n\n-- Here are the files we'll require to make a Powerpoint document. If\n-- any of these are missing, we should error out of our build.\nrequiredFiles :: [FilePath]\nrequiredFiles = [ \"docProps/app.xml\"\n                , \"ppt/presProps.xml\"\n                , \"ppt/slideLayouts/slideLayout1.xml\"\n                , \"ppt/slideLayouts/_rels/slideLayout1.xml.rels\"\n                , \"ppt/slideLayouts/slideLayout2.xml\"\n                , \"ppt/slideLayouts/_rels/slideLayout2.xml.rels\"\n                , \"ppt/slideLayouts/slideLayout3.xml\"\n                , \"ppt/slideLayouts/_rels/slideLayout3.xml.rels\"\n                , \"ppt/slideLayouts/slideLayout4.xml\"\n                , \"ppt/slideLayouts/_rels/slideLayout4.xml.rels\"\n                , \"ppt/slideMasters/slideMaster1.xml\"\n                , \"ppt/slideMasters/_rels/slideMaster1.xml.rels\"\n                , \"ppt/theme/theme1.xml\"\n                , \"ppt/tableStyles.xml\"\n                ]\n\npresentationToArchiveP :: PandocMonad m => Presentation -> P m Archive\npresentationToArchiveP p@(Presentation docProps slides) = do\n  filePaths <- patternsToFilePaths $ inheritedPatterns p\n\n  -- make sure all required files are available:\n  let missingFiles = filter (`notElem` filePaths) requiredFiles\n  unless (null missingFiles)\n    (throwError $\n      PandocSomeError $\n      \"The following required files are missing:\\n\" <>\n      T.unlines (map (T.pack . (\"  \" <>)) missingFiles)\n    )\n\n  newArch <- foldM copyFileToArchive emptyArchive filePaths\n\n  -- Add any layouts taken from the default archive,\n  -- overwriting any already added.\n  slideLayouts <- getSlideLayouts\n  let f layout =\n        if not (slInReferenceDoc layout)\n        then addEntryToArchive (slEntry layout)\n        else id\n  let newArch' = foldr f newArch slideLayouts\n\n  master <- getMaster\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  presentationElement <- parseXml refArchive distArchive \"ppt/presentation.xml\"\n  modify (\\s ->\n    s {stFooterInfo =\n        getFooterInfo (dcDate docProps) slideLayouts master presentationElement\n      })\n\n  -- Update the master to make sure it includes any layouts we've just added\n  masterRels <- getMasterRels\n  let (updatedMasterElem, updatedMasterRelElem) = updateMasterElems slideLayouts master masterRels\n  updatedMasterEntry <- elemToEntry \"ppt/slideMasters/slideMaster1.xml\" updatedMasterElem\n  updatedMasterRelEntry <- elemToEntry \"ppt/slideMasters/_rels/slideMaster1.xml.rels\" updatedMasterRelElem\n\n  -- we make a modified ppt/viewProps.xml out of the presentation viewProps\n  viewPropsEntry <- makeViewPropsEntry\n  -- we make a docProps/core.xml entry out of the presentation docprops\n  docPropsEntry <- docPropsToEntry docProps\n  -- we make a docProps/custom.xml entry out of the custom properties\n  docCustomPropsEntry <- docCustomPropsToEntry docProps\n  -- we make this ourself in case there's something unexpected in the\n  -- one in the reference doc.\n  relsEntry <- topLevelRelsEntry\n  -- presentation entry and rels.\n  (presentationRIdUpdateData, presRelsEntry) <- presentationToRelsEntry p\n  presEntry <- presentationToPresEntry presentationRIdUpdateData p\n  slideEntries <- mapM slideToEntry slides\n  slideRelEntries <- mapM slideToSlideRelEntry slides\n  spkNotesEntries <- catMaybes <$> mapM slideToSpeakerNotesEntry slides\n  spkNotesRelEntries <- catMaybes <$> mapM slideToSpeakerNotesRelEntry slides\n  -- These have to come after everything, because they need the info\n  -- built up in the state.\n  mediaEntries <- makeMediaEntries\n  contentTypesEntry <- presentationToContentTypes p >>= contentTypesToEntry\n  -- fold everything into our inherited archive and return it.\n  return $ foldr addEntryToArchive newArch' $\n    slideEntries <>\n    slideRelEntries <>\n    spkNotesEntries <>\n    spkNotesRelEntries <>\n    mediaEntries <>\n    [updatedMasterEntry, updatedMasterRelEntry]  <>\n    [contentTypesEntry, docPropsEntry, docCustomPropsEntry, relsEntry,\n     presEntry, presRelsEntry, viewPropsEntry]\n\nupdateMasterElems :: SlideLayouts -> Element -> Element -> (Element, Element)\nupdateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels)\n  where\n    updatedMaster = master { elContent = updateSldLayoutIdLst <$> elContent master }\n    (updatedRelationshipIds, updatedMasterRels) = addLayoutRels masterRels\n\n    updateSldLayoutIdLst :: Content -> Content\n    updateSldLayoutIdLst (Elem e) = case elName e of\n      (QName \"sldLayoutIdLst\" _ _) -> let\n        mkChild relationshipId (lastId, children) = let\n          thisId = lastId + 1\n          newChild = Element\n            { elName = QName \"sldLayoutId\" Nothing (Just \"p\")\n            , elAttribs =\n              [ Attr (QName \"id\" Nothing Nothing) (T.pack (show thisId))\n              , Attr (QName \"id\" Nothing (Just \"r\")) relationshipId\n              ]\n            , elContent = []\n            , elLine = Nothing\n            }\n          in (thisId, Elem newChild : children)\n        newChildren = snd (foldr mkChild (maxIdNumber' e, []) updatedRelationshipIds)\n        in Elem e { elContent = elContent e <> newChildren }\n      _ -> Elem e\n    updateSldLayoutIdLst c = c\n\n    addLayoutRels ::\n      Element ->\n      ([Text], Element)\n    addLayoutRels e = let\n      layoutsToAdd = filter (\\l -> not (slInReferenceDoc l) && isNew e l)\n                            (toList layouts)\n      newRelationships = snd (foldr mkRelationship (maxIdNumber e, []) layoutsToAdd)\n      newRelationshipIds =\n        mapMaybe (findElemAttr (QName \"Id\" Nothing Nothing)) newRelationships\n      mkRelationship layout (lastId, relationships) = let\n        thisId = lastId + 1\n        slideLayoutPath = \"../slideLayouts/\" <> T.pack (takeFileName (slPath layout))\n        newRelationship = Element\n          { elName = QName \"Relationship\" Nothing Nothing\n          , elAttribs =\n            [ Attr (QName \"Id\" Nothing Nothing) (\"rId\" <> T.pack (show thisId))\n            , Attr (QName \"Type\" Nothing Nothing) \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\"\n            , Attr (QName \"Target\" Nothing Nothing) slideLayoutPath\n            ]\n          , elContent = []\n          , elLine = Nothing\n          }\n        in (thisId, Elem newRelationship : relationships)\n      in (newRelationshipIds, e {elContent = elContent e <> newRelationships})\n\n    -- Whether the layout needs to be added to the Relationships element.\n    isNew :: Element -> SlideLayout -> Bool\n    isNew relationships SlideLayout{..} = let\n      toDetails = fmap (takeFileName . T.unpack)\n        . findElemAttr (QName \"Target\" Nothing Nothing)\n      in takeFileName slPath `notElem` mapMaybe toDetails (elContent relationships)\n\n    findElemAttr :: QName -> Content -> Maybe Text\n    findElemAttr attr (Elem e) = findAttr attr e\n    findElemAttr _ _ = Nothing\n\n    maxIdNumber :: Element -> Integer\n    maxIdNumber relationships = maximum (0 : idNumbers)\n      where\n        idNumbers = mapMaybe (readTextAsInteger . T.drop 3) idAttributes\n        idAttributes = mapMaybe getIdAttribute (elContent relationships)\n        getIdAttribute (Elem e) = findAttr (QName \"Id\" Nothing Nothing) e\n        getIdAttribute _ = Nothing\n\n    maxIdNumber' :: Element -> Integer\n    maxIdNumber' sldLayouts = maximum (0 : idNumbers)\n      where\n        idNumbers = mapMaybe readTextAsInteger idAttributes\n        idAttributes = mapMaybe getIdAttribute (elContent sldLayouts)\n        getIdAttribute (Elem e) = findAttr (QName \"id\" Nothing Nothing) e\n        getIdAttribute _ = Nothing\n\ndata FooterInfo = FooterInfo\n  { fiDate :: SlideLayoutsOf (Maybe Element)\n  , fiFooter :: SlideLayoutsOf (Maybe Element)\n  , fiSlideNumber :: SlideLayoutsOf (Maybe Element)\n  , fiShowOnFirstSlide :: Bool\n  } deriving (Show, Eq)\n\ngetFooterInfo :: Maybe Text -> SlideLayouts -> Element -> Element -> Maybe FooterInfo\ngetFooterInfo date layouts master presentation = do\n  let ns = elemToNameSpaces master\n  hf <- findChild (elemName ns \"p\" \"hf\") master\n  let fiDate = let\n        f layoutDate =\n          case date of\n            Nothing -> layoutDate\n            Just d ->\n              if dateIsAutomatic (elemToNameSpaces layoutDate) layoutDate\n              then layoutDate\n              else replaceDate d layoutDate\n        in fmap f . getShape \"dt\" hf . slElement <$> layouts\n      fiFooter = getShape \"ftr\" hf . slElement <$> layouts\n      fiSlideNumber = getShape \"sldNum\" hf . slElement <$> layouts\n      fiShowOnFirstSlide =\n        fromMaybe True\n        (getBooleanAttribute \"showSpecialPlsOnTitleSld\" presentation)\n  pure FooterInfo{..}\n    where\n      getShape t hf layout =\n        if fromMaybe True (getBooleanAttribute t hf)\n        then do\n          let ns = elemToNameSpaces layout\n          cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n          spTree <- findChild (elemName ns \"p\" \"spTree\") cSld\n          let containsPlaceholder sp = fromMaybe False $ do\n                nvSpPr <- findChild (elemName ns \"p\" \"nvSpPr\") sp\n                nvPr <- findChild (elemName ns \"p\" \"nvPr\") nvSpPr\n                ph <- findChild (elemName ns \"p\" \"ph\") nvPr\n                placeholderType <- findAttr (QName \"type\" Nothing Nothing) ph\n                pure (placeholderType == t)\n          listToMaybe (filterChildren containsPlaceholder spTree)\n        else Nothing\n\n      dateIsAutomatic :: NameSpaces -> Element -> Bool\n      dateIsAutomatic ns shape = isJust $ do\n        txBody <- findChild (elemName ns \"p\" \"txBody\") shape\n        p <- findChild (elemName ns \"a\" \"p\") txBody\n        findChild (elemName ns \"a\" \"fld\") p\n\n      replaceDate :: Text -> Element -> Element\n      replaceDate newDate e =\n        e { elContent =\n            case (elName e) of\n              QName \"t\" _ (Just \"a\") ->\n                [ Text (CData { cdVerbatim = CDataText\n                              , cdData = newDate\n                              , cdLine = Nothing\n                              })\n                ]\n              _ -> ifElem (replaceDate newDate) <$> elContent e\n           }\n\n      ifElem :: (Element -> Element) -> (Content -> Content)\n      ifElem f (Elem e) = Elem (f e)\n      ifElem _ c = c\n\n      getBooleanAttribute t e =\n        (`elem` [\"1\", \"true\"]) <$>\n          (findAttr (QName t Nothing Nothing) e)\n\nfooterElements ::\n  PandocMonad m =>\n  (forall a. SlideLayoutsOf a -> a) ->\n  P m [Content]\nfooterElements layout = do\n  footerInfo <- gets stFooterInfo\n  pure\n    $ Elem <$>\n      (toList (footerInfo >>= layout . fiDate)\n       <> toList (footerInfo >>= layout . fiFooter)\n       <> toList (footerInfo >>= layout . fiSlideNumber))\n\nmakeSlideIdMap :: Presentation -> M.Map SlideId Int\nmakeSlideIdMap (Presentation _ slides) =\n  M.fromList $ map slideId slides `zip` [1..]\n\nmakeSpeakerNotesMap :: Presentation -> M.Map Int Int\nmakeSpeakerNotesMap (Presentation _ slides) =\n  M.fromList $\n    mapMaybe f (slides `zip` [1..]) `zip` [1..]\n  where f (Slide _ _ notes _, n) = if notes == mempty\n                                   then Nothing\n                                   else Just n\n\npresentationToArchive :: PandocMonad m\n                      => WriterOptions -> Meta -> Presentation -> m Archive\npresentationToArchive opts meta pres = do\n  distArchive <- toArchive . BL.fromStrict <$>\n                        readDefaultDataFile \"reference.pptx\"\n  refArchive <- case writerReferenceDoc opts of\n                     Just f  -> toArchive . BL.fromStrict . fst\n                                  <$> P.fetchItem (T.pack f)\n                     Nothing -> toArchive . BL.fromStrict <$>\n                        readDataFile \"reference.pptx\"\n\n  let (referenceLayouts, defaultReferenceLayouts) =\n        (getLayoutsFromArchive refArchive, getLayoutsFromArchive distArchive)\n  let layoutTitles = SlideLayouts { metadata = \"Title Slide\" :: Text\n                                  , title = \"Section Header\"\n                                  , content = \"Title and Content\"\n                                  , twoColumn = \"Two Content\"\n                                  , comparison = \"Comparison\"\n                                  , contentWithCaption = \"Content with Caption\"\n                                  , blank = \"Blank\"\n                                  }\n  layouts <- for layoutTitles $ \\layoutTitle -> do\n        let layout = M.lookup (CI.mk layoutTitle) referenceLayouts\n        let defaultLayout = M.lookup (CI.mk layoutTitle) defaultReferenceLayouts\n        case (layout, defaultLayout) of\n          (Nothing, Nothing) ->\n            throwError (PandocSomeError (\"Couldn't find layout named \\\"\"\n                                         <> layoutTitle <> \"\\\" in the provided \"\n                                         <> \"reference doc or in the default \"\n                                         <> \"reference doc included with pandoc.\"))\n          (Nothing, Just ((element, path, entry) :| _)) -> do\n            P.report (PowerpointTemplateWarning\n                                     (\"Couldn't find layout named \\\"\"\n                                      <> layoutTitle <> \"\\\" in provided \"\n                                      <> \"reference doc. Falling back to \"\n                                      <> \"the default included with pandoc.\"))\n            pure SlideLayout { slElement = element\n                             , slPath = path\n                             , slEntry = entry\n                             , slInReferenceDoc = False\n                             }\n          (Just ((element, path, entry) :| _), _ ) ->\n            pure SlideLayout { slElement = element\n                             , slPath = path\n                             , slEntry = entry\n                             , slInReferenceDoc = True\n                             }\n\n  master <- getMaster' refArchive distArchive\n\n  let otherStyleIndents = do\n        let ns = elemToNameSpaces master\n        txStyles <- findChild (elemName ns \"p\" \"txStyles\") master\n        otherStyle <- findChild (elemName ns \"p\" \"otherStyle\") txStyles\n        let makeLevelIndents name = do\n              e <- findChild (elemName ns \"a\" name) otherStyle\n              pure LevelIndents\n                { indent = fromMaybe (-342900)\n                    (findAttr (QName \"indent\" Nothing Nothing) e\n                    >>= readTextAsInteger)\n                , marL = fromMaybe 347663\n                    (findAttr (QName \"marL\" Nothing Nothing) e\n                     >>= readTextAsInteger)\n                }\n        pure Indents\n          { level1 = makeLevelIndents \"lvl1pPr\"\n          , level2 = makeLevelIndents \"lvl2pPr\"\n          , level3 = makeLevelIndents \"lvl3pPr\"\n          , level4 = makeLevelIndents \"lvl4pPr\"\n          , level5 = makeLevelIndents \"lvl5pPr\"\n          , level6 = makeLevelIndents \"lvl6pPr\"\n          , level7 = makeLevelIndents \"lvl7pPr\"\n          , level8 = makeLevelIndents \"lvl8pPr\"\n          , level9 = makeLevelIndents \"lvl9pPr\"\n          }\n\n  utctime <- P.getTimestamp\n\n  presSize <- case getPresentationSize refArchive distArchive of\n                Just sz -> return sz\n                Nothing -> throwError $\n                           PandocSomeError\n                           \"Could not determine presentation size\"\n\n  -- note, we need writerTemplate to be Just _ or metaToContext does\n  -- nothing\n  context <- metaToContext opts{ writerTemplate =\n                                  writerTemplate opts <|> Just mempty }\n                (return . literal . stringify)\n                (return . literal . stringify) meta\n\n  let env = def { envRefArchive = refArchive\n                , envDistArchive = distArchive\n                , envUTCTime = utctime\n                , envOpts = opts\n                , envContext = context\n                , envPresentationSize = presSize\n                , envSlideIdMap = makeSlideIdMap pres\n                , envSpeakerNotesIdMap = makeSpeakerNotesMap pres\n                , envSlideLayouts = Just layouts\n                , envOtherStyleIndents = otherStyleIndents\n                }\n\n  let st = def { stMediaGlobalIds = initialGlobalIds refArchive distArchive\n               }\n\n  runP env st $ presentationToArchiveP pres\n\n-- | Get all slide layouts from an archive, as a map where the layout's name\n-- gives the map key.\n--\n-- For each layout, the map contains its XML representation, its path within\n-- the archive, and the archive entry.\ngetLayoutsFromArchive :: Archive -> M.Map (CI Text) (NonEmpty (Element, FilePath, Entry))\ngetLayoutsFromArchive archive =\n  M.fromListWith (<>) ((\\t@(e, _, _) -> (CI.mk (name e), pure t)) <$> layouts)\n  where\n    layouts :: [(Element, FilePath, Entry)]\n    layouts = mapMaybe findElementByPath paths\n    parseXml' entry = case parseXMLElement (UTF8.toTextLazy (fromEntry entry)) of\n            Left _ -> Nothing\n            Right element -> Just element\n    findElementByPath :: FilePath -> Maybe (Element, FilePath, Entry)\n    findElementByPath path = do\n      entry <- findEntryByPath path archive\n      element <- parseXml' entry\n      pure (element, path, entry)\n    paths = filter (match (compile \"ppt/slideLayouts/slideLayout*.xml\")) (filesInArchive archive)\n    name element = fromMaybe \"Untitled layout\" $ do\n            let ns = elemToNameSpaces element\n            cSld <- findChild (elemName ns \"p\" \"cSld\") element\n            findAttr (QName \"name\" Nothing Nothing) cSld\n\n--------------------------------------------------\n\n-- Check to see if the presentation has speaker notes. This will\n-- influence whether we import the notesMaster template.\npresHasSpeakerNotes :: Presentation -> Bool\npresHasSpeakerNotes (Presentation _ slides) =\n  not $ all ((mempty ==) . slideSpeakerNotes) slides\n\ncurSlideHasSpeakerNotes :: PandocMonad m => P m Bool\ncurSlideHasSpeakerNotes =\n  M.member <$> asks envCurSlideId <*> asks envSpeakerNotesIdMap\n\n--------------------------------------------------\n\ngetLayout :: PandocMonad m => Layout -> P m Element\ngetLayout layout = getElement <$> getSlideLayouts\n  where\n    getElement =\n      slElement . case layout of\n        MetadataSlide{}           -> metadata\n        TitleSlide{}              -> title\n        ContentSlide{}            -> content\n        TwoColumnSlide{}          -> twoColumn\n        ComparisonSlide{}         -> comparison\n        ContentWithCaptionSlide{} -> contentWithCaption\n        BlankSlide{}              -> blank\n\nshapeHasId :: NameSpaces -> T.Text -> Element -> Bool\nshapeHasId ns ident element = getShapeId ns element == Just ident\n\ngetShapeId :: NameSpaces -> Element -> Maybe Text\ngetShapeId ns element = do\n  nvSpPr <- findChild (elemName ns \"p\" \"nvSpPr\") element\n  cNvPr <- findChild (elemName ns \"p\" \"cNvPr\") nvSpPr\n  findAttr (QName \"id\" Nothing Nothing) cNvPr\n\ntype ShapeId = Integer\n\ngetContentShape :: PandocMonad m => NameSpaces -> Element -> P m (Maybe ShapeId, Element)\ngetContentShape ns spTreeElem\n  | isElem ns \"p\" \"spTree\" spTreeElem = do\n      ph@Placeholder{index, placeholderType} <- asks envPlaceholder\n      case drop index (getShapesByPlaceHolderType ns spTreeElem placeholderType) of\n        sp : _ -> let\n          shapeId = getShapeId ns sp >>= readTextAsInteger\n          in return (shapeId, sp)\n        [] -> throwError $ PandocSomeError $ missingPlaceholderMessage ph\ngetContentShape _ _ = throwError $ PandocSomeError\n                      \"Attempted to find content on non shapeTree\"\n\nmissingPlaceholderMessage :: Placeholder -> Text\nmissingPlaceholderMessage Placeholder{..} =\n  \"Could not find a \" <> ordinal\n  <> \" placeholder of type \" <> placeholderText\n  where\n    ordinal = T.pack (show index) <>\n      case (index `mod` 100, index `mod` 10) of\n        (11, _) -> \"th\"\n        (12, _) -> \"th\"\n        (13, _) -> \"th\"\n        (_,  1) -> \"st\"\n        (_,  2) -> \"nd\"\n        (_,  3) -> \"rd\"\n        _       -> \"th\"\n    placeholderText = case placeholderType of\n      ObjType -> \"obj (or nothing)\"\n      PHType t -> t\n\ngetShapeDimensions :: NameSpaces\n                   -> Element\n                   -> Maybe ((Integer, Integer), (Integer, Integer))\ngetShapeDimensions ns element\n  | isElem ns \"p\" \"sp\" element = do\n      spPr <- findChild (elemName ns \"p\" \"spPr\") element\n      xfrm <- findChild (elemName ns \"a\" \"xfrm\") spPr\n      off <- findChild (elemName ns \"a\" \"off\") xfrm\n      xS <- findAttr (QName \"x\" Nothing Nothing) off\n      yS <- findAttr (QName \"y\" Nothing Nothing) off\n      ext <- findChild (elemName ns \"a\" \"ext\") xfrm\n      cxS <- findAttr (QName \"cx\" Nothing Nothing) ext\n      cyS <- findAttr (QName \"cy\" Nothing Nothing) ext\n      x <- readTextAsInteger xS\n      y <- readTextAsInteger yS\n      cx <- readTextAsInteger cxS\n      cy <- readTextAsInteger cyS\n      return ((x `div` 12700, y `div` 12700),\n              (cx `div` 12700, cy `div` 12700))\n  | otherwise = Nothing\n\n\ngetMasterShapeDimensionsById :: T.Text\n                             -> Element\n                             -> Maybe ((Integer, Integer), (Integer, Integer))\ngetMasterShapeDimensionsById ident master = do\n  let ns = elemToNameSpaces master\n  cSld <- findChild (elemName ns \"p\" \"cSld\") master\n  spTree <- findChild (elemName ns \"p\" \"spTree\") cSld\n  sp <- filterChild (\\e -> isElem ns \"p\" \"sp\" e && shapeHasId ns ident e) spTree\n  getShapeDimensions ns sp\n\ngetContentShapeSize :: PandocMonad m\n                    => NameSpaces\n                    -> Element\n                    -> Element\n                    -> P m ((Integer, Integer), (Integer, Integer))\ngetContentShapeSize ns layout master\n  | isElem ns \"p\" \"sldLayout\" layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (_, sp)  <- getContentShape ns spTree\n      case getShapeDimensions ns sp of\n        Just sz -> return sz\n        Nothing -> do let mbSz =\n                            findChild (elemName ns \"p\" \"nvSpPr\") sp >>=\n                            findChild (elemName ns \"p\" \"cNvPr\") >>=\n                            findAttr (QName \"id\" Nothing Nothing) >>=\n                            flip getMasterShapeDimensionsById master\n                      case mbSz of\n                        Just sz' -> return sz'\n                        Nothing -> throwError $ PandocSomeError\n                                   \"Couldn't find necessary content shape size\"\ngetContentShapeSize _ _ _ = throwError $ PandocSomeError\n                            \"Attempted to find content shape size in non-layout\"\n\nbuildSpTree :: NameSpaces -> Element -> [Content] -> Element\nbuildSpTree ns spTreeElem newShapes =\n  emptySpTreeElem { elContent = newContent }\n  where newContent = elContent emptySpTreeElem <> newShapes\n        emptySpTreeElem = spTreeElem { elContent = filter fn (elContent spTreeElem) }\n        fn :: Content -> Bool\n        fn (Elem e) = isElem ns \"p\" \"nvGrpSpPr\" e ||\n                      isElem ns \"p\" \"grpSpPr\" e\n        fn _        = True\n\nreplaceNamedChildren :: NameSpaces\n                     -> Text\n                     -> Text\n                     -> [Element]\n                     -> Element\n                     -> Element\nreplaceNamedChildren ns prefix name newKids element =\n  element { elContent = concat $ fun True $ elContent element }\n  where\n    fun :: Bool -> [Content] -> [[Content]]\n    fun _ [] = []\n    fun switch (Elem e : conts) | isElem ns prefix name e =\n                                      if switch\n                                      then map Elem newKids : fun False conts\n                                      else fun False conts\n    fun switch (cont : conts) = [cont] : fun switch conts\n\n----------------------------------------------------------------\n\nregisterLink :: PandocMonad m => LinkTarget -> P m Int\nregisterLink link = do\n  curSlideId <- asks envCurSlideId\n  linkReg <- gets stLinkIds\n  mediaReg <- gets stMediaIds\n  hasSpeakerNotes <- curSlideHasSpeakerNotes\n  let maxLinkId = case M.lookup curSlideId linkReg >>= nonEmpty . M.keys of\n        Just xs -> maximum xs\n        Nothing\n          | hasSpeakerNotes -> 2\n          | otherwise       -> 1\n      maxMediaId = case M.lookup curSlideId mediaReg >>= nonEmpty of\n        Just mInfos -> maximum $ fmap mInfoLocalId mInfos\n        Nothing\n          | hasSpeakerNotes -> 2\n          | otherwise       -> 1\n      maxId = max maxLinkId maxMediaId\n      slideLinks = case M.lookup curSlideId linkReg of\n        Just mp -> M.insert (maxId + 1) link mp\n        Nothing -> M.singleton (maxId + 1) link\n  modify $ \\st -> st{ stLinkIds = M.insert curSlideId slideLinks linkReg}\n  return $ maxId + 1\n\nregisterMedia :: PandocMonad m => FilePath -> [ParaElem] -> P m MediaInfo\nregisterMedia fp caption = do\n  curSlideId <- asks envCurSlideId\n  linkReg <- gets stLinkIds\n  mediaReg <- gets stMediaIds\n  globalIds <- gets stMediaGlobalIds\n  hasSpeakerNotes <- curSlideHasSpeakerNotes\n  let maxLinkId = case M.lookup curSlideId linkReg >>= nonEmpty . M.keys of\n          Just ks -> maximum ks\n          Nothing\n            | hasSpeakerNotes -> 2\n            | otherwise       -> 1\n      maxMediaId = case M.lookup curSlideId mediaReg >>= nonEmpty of\n          Just mInfos -> maximum $ fmap mInfoLocalId mInfos\n          Nothing\n            | hasSpeakerNotes -> 2\n            | otherwise       -> 1\n      maxLocalId = max maxLinkId maxMediaId\n\n      maxGlobalId = maybe 0 maximum $ nonEmpty $ M.elems globalIds\n\n  (imgBytes, mbMt) <- P.fetchItem $ T.pack fp\n  let imgExt = (mbMt >>= extensionFromMimeType >>= (\\x -> return $ \".\" <> x))\n               <|>\n               case imageType imgBytes of\n                 Just Png  -> Just \".png\"\n                 Just Jpeg -> Just \".jpeg\"\n                 Just Gif  -> Just \".gif\"\n                 Just Pdf  -> Just \".pdf\"\n                 Just Eps  -> Just \".eps\"\n                 Just Svg  -> Just \".svg\"\n                 Just Emf  -> Just \".emf\"\n                 Just Tiff -> Just \".tiff\"\n                 Just Webp -> Just \".webp\"\n                 Just Avif -> Just \".avif\"\n                 Nothing   -> Nothing\n\n  let newGlobalId = fromMaybe (maxGlobalId + 1) (M.lookup fp globalIds)\n\n  let newGlobalIds = M.insert fp newGlobalId globalIds\n\n  let mediaInfo = MediaInfo { mInfoFilePath = fp\n                            , mInfoLocalId = maxLocalId + 1\n                            , mInfoGlobalId = newGlobalId\n                            , mInfoMimeType =\n                                case mbMt of\n                                  -- see #9113\n                                  Just t | \";base64\" `T.isSuffixOf` t\n                                     -> T.stripSuffix \";base64\" t\n                                  x -> x\n                            , mInfoExt = imgExt\n                            , mInfoCaption = (not . null) caption\n                            }\n\n  let slideMediaInfos = case M.lookup curSlideId mediaReg of\n        Just minfos -> mediaInfo : minfos\n        Nothing     -> [mediaInfo]\n\n\n  modify $ \\st -> st{ stMediaIds = M.insert curSlideId slideMediaInfos mediaReg\n                    , stMediaGlobalIds = newGlobalIds\n                    }\n  return mediaInfo\n\nmakeMediaEntry :: PandocMonad m => MediaInfo -> P m Entry\nmakeMediaEntry mInfo = do\n  epochtime <- floor . utcTimeToPOSIXSeconds <$> asks envUTCTime\n  (imgBytes, _) <- P.fetchItem (T.pack $ mInfoFilePath mInfo)\n  let ext = fromMaybe \"\" (mInfoExt mInfo)\n  let fp = \"ppt/media/image\" <>\n          show (mInfoGlobalId mInfo) <> T.unpack ext\n  return $ toEntry fp epochtime $ BL.fromStrict imgBytes\n\nmakeMediaEntries :: PandocMonad m => P m [Entry]\nmakeMediaEntries = do\n  mediaInfos <- gets stMediaIds\n  let allInfos = mconcat $ M.elems mediaInfos\n  mapM makeMediaEntry allInfos\n\n-- -- | Scales the image to fit the page\n-- -- sizes are passed in emu\n-- fitToPage' :: (Double, Double)  -- image size in emu\n--            -> Integer           -- pageWidth\n--            -> Integer           -- pageHeight\n--            -> (Integer, Integer) -- imagesize\n-- fitToPage' (x, y) pageWidth pageHeight\n--   -- Fixes width to the page width and scales the height\n--   | x <= fromIntegral pageWidth && y <= fromIntegral pageHeight =\n--       (floor x, floor y)\n--   | x / fromIntegral pageWidth > y / fromIntegral pageWidth =\n--       (pageWidth, floor $ ((fromIntegral pageWidth) / x) * y)\n--   | otherwise =\n--       (floor $ ((fromIntegral pageHeight) / y) * x, pageHeight)\n\n-- positionImage :: (Double, Double) -> Integer -> Integer -> (Integer, Integer)\n-- positionImage (x, y) pageWidth pageHeight =\n--   let (x', y') = fitToPage' (x, y) pageWidth pageHeight\n--   in\n--     ((pageWidth - x') `div` 2, (pageHeight - y') `div`  2)\n\ngetMaster :: PandocMonad m => P m Element\ngetMaster = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  getMaster' refArchive distArchive\n\ngetMaster' :: PandocMonad m => Archive -> Archive -> m Element\ngetMaster' refArchive distArchive =\n  parseXml refArchive distArchive \"ppt/slideMasters/slideMaster1.xml\"\n\ngetMasterRels :: PandocMonad m => P m Element\ngetMasterRels = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  parseXml refArchive distArchive \"ppt/slideMasters/_rels/slideMaster1.xml.rels\"\n\n-- We want to get the header dimensions, so we can make sure that the\n-- image goes underneath it. We only use this in a content slide if it\n-- has a header.\n\n-- getHeaderSize :: PandocMonad m => P m ((Integer, Integer), (Integer, Integer))\n-- getHeaderSize = do\n--   master <- getMaster\n--   let ns = elemToNameSpaces master\n--       sps = [master] >>=\n--             findChildren (elemName ns \"p\" \"cSld\") >>=\n--             findChildren (elemName ns \"p\" \"spTree\") >>=\n--             findChildren (elemName ns \"p\" \"sp\")\n--       mbXfrm =\n--         listToMaybe (filter (shapeHasName ns \"Title Placeholder 1\") sps) >>=\n--         findChild (elemName ns \"p\" \"spPr\") >>=\n--         findChild (elemName ns \"a\" \"xfrm\")\n--       xoff = mbXfrm >>=\n--              findChild (elemName ns \"a\" \"off\") >>=\n--              findAttr (QName \"x\" Nothing Nothing) >>=\n--              (listToMaybe . (\\s -> reads s :: [(Integer, String)]))\n--       yoff = mbXfrm >>=\n--              findChild (elemName ns \"a\" \"off\") >>=\n--              findAttr (QName \"y\" Nothing Nothing) >>=\n--              (listToMaybe . (\\s -> reads s :: [(Integer, String)]))\n--       xext = mbXfrm >>=\n--              findChild (elemName ns \"a\" \"ext\") >>=\n--              findAttr (QName \"cx\" Nothing Nothing) >>=\n--              (listToMaybe . (\\s -> reads s :: [(Integer, String)]))\n--       yext = mbXfrm >>=\n--              findChild (elemName ns \"a\" \"ext\") >>=\n--              findAttr (QName \"cy\" Nothing Nothing) >>=\n--              (listToMaybe . (\\s -> reads s :: [(Integer, String)]))\n--       off = case xoff of\n--               Just (xoff', _) | Just (yoff',_) <- yoff -> (xoff', yoff')\n--               _                               -> (1043490, 1027664)\n--       ext = case xext of\n--               Just (xext', _) | Just (yext',_) <- yext -> (xext', yext')\n--               _                               -> (7024744, 1143000)\n--   return $ (off, ext)\n\n-- Hard-coded for now\n-- captionPosition :: ((Integer, Integer), (Integer, Integer))\n-- captionPosition = ((457200, 6061972), (8229600, 527087))\n\ncaptionHeight :: Integer\ncaptionHeight = 40\n\ncreateCaption :: PandocMonad m\n              => ((Integer, Integer), (Integer, Integer))\n              -> [ParaElem]\n              -> P m (ShapeId, Element)\ncreateCaption contentShapeDimensions paraElements = do\n  let para = Paragraph def{pPropAlign = Just AlgnCenter} paraElements\n  elements <- mapM paragraphToElement [para]\n  let ((x, y), (cx, cy)) = contentShapeDimensions\n  let txBody = mknode \"p:txBody\" [] $\n               [mknode \"a:bodyPr\" [] (), mknode \"a:lstStyle\" [] ()] <> elements\n  return\n    ( 1\n    ,  surroundWithMathAlternate $\n       mknode \"p:sp\" [] [ mknode \"p:nvSpPr\" []\n                          [ mknode \"p:cNvPr\" [(\"id\",\"1\"), (\"name\",\"TextBox 3\")] ()\n                          , mknode \"p:cNvSpPr\" [(\"txBox\", \"1\")] ()\n                          , mknode \"p:nvPr\" []\n                            [mknode \"p:ph\" [(\"idx\", \"1\")] ()]\n                          ]\n                        , mknode \"p:spPr\" []\n                          [ mknode \"a:xfrm\" []\n                            [ mknode \"a:off\" [(\"x\", tshow $ 12700 * x),\n                                              (\"y\", tshow $ 12700 * (y + cy - captionHeight))] ()\n                            , mknode \"a:ext\" [(\"cx\", tshow $ 12700 * cx),\n                                              (\"cy\", tshow $ 12700 * captionHeight)] ()\n                            ]\n                          , mknode \"a:prstGeom\" [(\"prst\", \"rect\")]\n                            [ mknode \"a:avLst\" [] ()\n                            ]\n                          , mknode \"a:noFill\" [] ()\n                          ]\n                        , txBody\n                        ]\n    )\n\nmakePicElements :: PandocMonad m\n                => Element\n                -> PicProps\n                -> MediaInfo\n                -> Text\n                -> [ParaElem]\n                -> P m [(ShapeId, Element)]\nmakePicElements layout picProps mInfo titleText alt = do\n  opts <- asks envOpts\n  (pageWidth, pageHeight) <- asks envPresentationSize\n  -- hasHeader <- asks envSlideHasHeader\n  let hasCaption = mInfoCaption mInfo\n  (imgBytes, _) <- P.fetchItem (T.pack $ mInfoFilePath mInfo)\n  let (pxX, pxY) = case imageSize opts imgBytes of\n        Right sz -> sizeInPixels sz\n        Left _   -> sizeInPixels def\n  master <- getMaster\n  let ns = elemToNameSpaces layout\n  ((x, y), (cx, cytmp)) <- getContentShapeSize ns layout master\n                           `catchError`\n                           (\\_ -> return ((0, 0), (pageWidth, pageHeight)))\n\n  let cy = if hasCaption then cytmp - captionHeight else cytmp\n\n  let imgRatio = fromIntegral pxX / fromIntegral pxY :: Double\n      boxRatio = fromIntegral cx / fromIntegral cy :: Double\n      (dimX, dimY) = if imgRatio > boxRatio\n                     then (fromIntegral cx, fromIntegral cx / imgRatio)\n                     else (fromIntegral cy * imgRatio, fromIntegral cy)\n\n      (dimX', dimY') = (round dimX * 12700, round dimY * 12700) :: (Integer, Integer)\n      (xoff, yoff) = (fromIntegral x + (fromIntegral cx - dimX) / 2,\n                      fromIntegral y + (fromIntegral cy - dimY) / 2)\n      (xoff', yoff') = (round xoff * 12700, round yoff * 12700) :: (Integer, Integer)\n\n  let cNvPicPr = mknode \"p:cNvPicPr\" [] $\n                 mknode \"a:picLocks\" [(\"noGrp\",\"1\")\n                                     ,(\"noChangeAspect\",\"1\")] ()\n  -- cNvPr will contain the link information so we do that separately,\n  -- and register the link if necessary.\n  let description = (if T.null titleText\n                      then \"\"\n                      else titleText <> \"\\n\\n\")\n                      <> T.pack (mInfoFilePath mInfo)\n  let cNvPrAttr = [(\"descr\", description),\n                   (\"id\",\"0\"),\n                   (\"name\",\"Picture 1\")]\n  cNvPr <- case picPropLink picProps of\n    Just link -> do idNum <- registerLink link\n                    return $ mknode \"p:cNvPr\" cNvPrAttr $\n                      mknode \"a:hlinkClick\" [(\"r:id\", \"rId\" <> tshow idNum)] ()\n    Nothing   -> return $ mknode \"p:cNvPr\" cNvPrAttr ()\n  let nvPicPr  = mknode \"p:nvPicPr\" []\n                 [ cNvPr\n                 , cNvPicPr\n                 , mknode \"p:nvPr\" [] ()]\n  let blipFill = mknode \"p:blipFill\" []\n                 [ mknode \"a:blip\" [(\"r:embed\", \"rId\" <>\n                     tshow (mInfoLocalId mInfo))] ()\n                 , mknode \"a:stretch\" [] $\n                   mknode \"a:fillRect\" [] () ]\n  let xfrm =    mknode \"a:xfrm\" []\n                [ mknode \"a:off\" [(\"x\", tshow xoff'), (\"y\", tshow yoff')] ()\n                , mknode \"a:ext\" [(\"cx\", tshow dimX')\n                                 ,(\"cy\", tshow dimY')] () ]\n  let prstGeom = mknode \"a:prstGeom\" [(\"prst\",\"rect\")] $\n                 mknode \"a:avLst\" [] ()\n  let ln =      mknode \"a:ln\" [(\"w\",\"9525\")]\n                [ mknode \"a:noFill\" [] ()\n                , mknode \"a:headEnd\" [] ()\n                , mknode \"a:tailEnd\" [] () ]\n  let spPr =    mknode \"p:spPr\" [(\"bwMode\",\"auto\")]\n                [xfrm, prstGeom, mknode \"a:noFill\" [] (), ln]\n\n  let picShape = ( 0\n                 , mknode \"p:pic\" []\n                   [ nvPicPr\n                   , blipFill\n                   , spPr ]\n                 )\n\n  -- And now, maybe create the caption:\n  if hasCaption\n    then do cap <- createCaption ((x, y), (cx, cytmp)) alt\n            return [picShape, cap]\n    else return [picShape]\n\nconsolidateRuns :: [ParaElem] -> [ParaElem]\nconsolidateRuns [] = []\nconsolidateRuns (Run pr1 s1 : Run pr2 s2 : xs)\n  | pr1 == pr2 = consolidateRuns (Run pr1 (s1 <> s2) : xs)\nconsolidateRuns (x:xs) = x : consolidateRuns xs\n\n\nparaElemToElements :: PandocMonad m => ParaElem -> P m [Content]\nparaElemToElements Break = return [Elem $ mknode \"a:br\" [] ()]\nparaElemToElements (Run rpr s) = do\n  sizeAttrs <- fontSizeAttributes rpr\n  let attrs = sizeAttrs <>\n        (\n        [(\"b\", \"1\") | rPropBold rpr]) <>\n        (\n        [(\"i\", \"1\") | rPropItalics rpr]) <>\n        (\n        [(\"u\", \"sng\") | rPropUnderline rpr]) <>\n        (case rStrikethrough rpr of\n            Just NoStrike     -> [(\"strike\", \"noStrike\")]\n            Just SingleStrike -> [(\"strike\", \"sngStrike\")]\n            Just DoubleStrike -> [(\"strike\", \"dblStrike\")]\n            Nothing -> []) <>\n        (case rBaseline rpr of\n            Just n -> [(\"baseline\", tshow n)]\n            Nothing -> []) <>\n        (case rCap rpr of\n            Just NoCapitals -> [(\"cap\", \"none\")]\n            Just SmallCapitals -> [(\"cap\", \"small\")]\n            Just AllCapitals -> [(\"cap\", \"all\")]\n            Nothing -> []) <>\n        []\n  linkProps <- case rLink rpr of\n                 Just link -> do\n                   idNum <- registerLink link\n                   -- first we have to make sure that if it's an\n                   -- anchor, it's in the anchor map. If not, there's\n                   -- no link.\n                   return $ case link of\n                     InternalTarget _ ->\n                       let linkAttrs =\n                             [ (\"r:id\", \"rId\" <> tshow idNum)\n                             , (\"action\", \"ppaction://hlinksldjump\")\n                             ]\n                       in [mknode \"a:hlinkClick\" linkAttrs ()]\n                     -- external\n                     ExternalTarget _ ->\n                       let linkAttrs =\n                             [ (\"r:id\", \"rId\" <> tshow idNum)\n                             ]\n                       in [mknode \"a:hlinkClick\" linkAttrs ()]\n                 Nothing -> return []\n  let colorContents = case rSolidFill rpr of\n                        Just color ->\n                          case fromColor color of\n                            '#':hx ->\n                              [mknode \"a:solidFill\" []\n                                [mknode \"a:srgbClr\"\n                                  [(\"val\", T.toUpper $ T.pack hx)] ()]]\n                            _ -> []\n                        Nothing -> []\n  codeFont <- monospaceFont\n  let codeContents =\n        [mknode \"a:latin\" [(\"typeface\", codeFont)] () | rPropCode rpr]\n  let propContents = linkProps <> colorContents <> codeContents\n  return [Elem $ mknode \"a:r\" [] [ mknode \"a:rPr\" attrs propContents\n                                 , mknode \"a:t\" [] s\n                                 ]]\nparaElemToElements (MathElem mathType texStr) = do\n  isInSpkrNotes <- asks envInSpeakerNotes\n  if isInSpkrNotes\n    then paraElemToElements $ Run def $ unTeXString texStr\n    else do res <- convertMath writeOMML mathType (unTeXString texStr)\n            case fromXLElement <$> res of\n              Right r -> return [Elem $ mknode \"a14:m\" [] $ addMathInfo r]\n              Left (Str s) -> paraElemToElements (Run def s)\n              Left _       -> throwError $ PandocShouldNeverHappenError \"non-string math fallback\"\nparaElemToElements (RawOOXMLParaElem str) = return\n  [Text (CData CDataRaw str Nothing)]\n\n\n-- This is a bit of a kludge -- really requires adding an option to\n-- TeXMath, but since that's a different package, we'll do this one\n-- step at a time.\naddMathInfo :: Element -> Element\naddMathInfo element =\n  let mathspace =\n        Attr { attrKey = QName \"m\" Nothing (Just \"xmlns\")\n             , attrVal = \"http://schemas.openxmlformats.org/officeDocument/2006/math\"\n             }\n  in add_attr mathspace element\n\n-- We look through the element to see if it contains an a14:m\n-- element. If so, we surround it. This is a bit ugly, but it seems\n-- more dependable than looking through shapes for math. Plus this is\n-- an xml implementation detail, so it seems to make sense to do it at\n-- the xml level.\nsurroundWithMathAlternate :: Element -> Element\nsurroundWithMathAlternate element =\n  case findElement (QName \"m\" Nothing (Just \"a14\")) element of\n    Just _ ->\n      mknode \"mc:AlternateContent\"\n         [(\"xmlns:mc\", \"http://schemas.openxmlformats.org/markup-compatibility/2006\")\n         ] [ mknode \"mc:Choice\"\n             [ (\"xmlns:a14\", \"http://schemas.microsoft.com/office/drawing/2010/main\")\n             , (\"Requires\", \"a14\")] [ element ]\n           ]\n    Nothing -> element\n\nparagraphToElement :: PandocMonad m => Paragraph -> P m Element\nparagraphToElement par = do\n  indents <- asks envOtherStyleIndents\n  let\n    lvl = pPropLevel (paraProps par)\n    attrs = [(\"lvl\", tshow lvl)] <>\n            (case (pPropIndent (paraProps par), pPropMarginLeft (paraProps par)) of\n               (Just px1, Just px2) -> [ (\"indent\", tshow $ pixelsToEmu px1)\n                                       , (\"marL\", tshow $ pixelsToEmu px2)\n                                       ]\n               (Just px1, Nothing) -> [(\"indent\", tshow $ pixelsToEmu px1)]\n               (Nothing, Just px2) -> [(\"marL\", tshow $ pixelsToEmu px2)]\n               (Nothing, Nothing) -> fromMaybe [] $ do\n                 indents' <- indents\n                 thisLevel <- levelIndent indents' lvl\n                 nextLevel <- levelIndent indents' (lvl + 1)\n                 let (m, i) =\n                       case pPropBullet (paraProps par) of\n                         Nothing ->\n                           (Just (marL thisLevel), Just 0)\n                         Just (AutoNumbering _) ->\n                           ( Just (marL nextLevel)\n                           , Just (marL thisLevel - marL nextLevel)\n                           )\n                         Just Bullet -> (Nothing, Nothing)\n                 pure ( toList ((,) \"indent\" . tshow <$> i)\n                      <> toList ((,) \"marL\" . tshow <$> m)\n                      )\n            ) <>\n            (case pPropAlign (paraProps par) of\n               Just AlgnLeft -> [(\"algn\", \"l\")]\n               Just AlgnRight -> [(\"algn\", \"r\")]\n               Just AlgnCenter -> [(\"algn\", \"ctr\")]\n               Nothing -> []\n            )\n    props = [] <>\n            (case pPropSpaceBefore $ paraProps par of\n               Just px -> [mknode \"a:spcBef\" [] [\n                              mknode \"a:spcPts\" [(\"val\", tshow $ 100 * px)] ()\n                              ]\n                          ]\n               Nothing -> []\n            ) <>\n            (case pPropBullet $ paraProps par of\n               Just Bullet -> []\n               Just (AutoNumbering attrs') ->\n                 [mknode \"a:buAutoNum\" (autoNumAttrs attrs') ()]\n               Nothing -> [mknode \"a:buNone\" [] ()]\n            )\n  paras <- mconcat <$> mapM paraElemToElements (consolidateRuns (paraElems par))\n  return $ mknode \"a:p\" [] $ [Elem $ mknode \"a:pPr\" attrs props] <> paras\n\nshapeToElement :: PandocMonad m => Element -> Shape -> P m (Maybe ShapeId, Element)\nshapeToElement layout (TextBox paras)\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (shapeId, sp) <- getContentShape ns spTree\n      elements <- mapM paragraphToElement paras\n      let txBody = mknode \"p:txBody\" [] $\n                   [mknode \"a:bodyPr\" [] (), mknode \"a:lstStyle\" [] ()] <> elements\n          emptySpPr = mknode \"p:spPr\" [] ()\n      return\n        . (shapeId,)\n        . surroundWithMathAlternate\n        . replaceNamedChildren ns \"p\" \"txBody\" [txBody]\n        . replaceNamedChildren ns \"p\" \"spPr\" [emptySpPr]\n        $ sp\n-- GraphicFrame and Pic should never reach this.\nshapeToElement _ _ = return (Nothing, mknode \"p:sp\" [] ())\n\nshapeToElements :: PandocMonad m => Element -> Shape -> P m [(Maybe ShapeId, Content)]\nshapeToElements layout (Pic picProps fp titleText alt) = do\n  mInfo <- registerMedia fp alt\n  case mInfoExt mInfo of\n    Just _ -> map (bimap Just Elem) <$>\n      makePicElements layout picProps mInfo titleText alt\n    Nothing -> shapeToElements layout $ TextBox [Paragraph def alt]\nshapeToElements layout (GraphicFrame tbls cptn) = map (bimap Just Elem) <$>\n  graphicFrameToElements layout tbls cptn\nshapeToElements _ (RawOOXMLShape str) = return\n  [(Nothing, Text (CData CDataRaw str Nothing))]\nshapeToElements layout shp@(TextBox _) = do\n  (shapeId, element) <- shapeToElement layout shp\n  return [(shapeId, Elem element)]\n\nshapesToElements :: PandocMonad m => Element -> [Shape] -> P m [(Maybe ShapeId, Content)]\nshapesToElements layout shps =\n concat <$> mapM (shapeToElements layout) shps\n\ngraphicFrameToElements ::\n  PandocMonad m =>\n  Element ->\n  [Graphic] ->\n  [ParaElem] ->\n  P m [(ShapeId, Element)]\ngraphicFrameToElements layout tbls caption = do\n  -- get the sizing\n  master <- getMaster\n  (pageWidth, pageHeight) <- asks envPresentationSize\n  let ns = elemToNameSpaces layout\n  ((x, y), (cx, cytmp)) <- getContentShapeSize ns layout master\n                           `catchError`\n                           (\\_ -> return ((0, 0), (pageWidth, pageHeight)))\n\n  let cy = if not $ null caption then cytmp - captionHeight else cytmp\n\n  elements <- mapM (graphicToElement cx) tbls\n  let graphicFrameElts =\n        ( 6\n        , mknode \"p:graphicFrame\" [] $\n          [ mknode \"p:nvGraphicFramePr\" []\n            [ mknode \"p:cNvPr\" [(\"id\", \"6\"), (\"name\", \"Content Placeholder 5\")] ()\n            , mknode \"p:cNvGraphicFramePr\" []\n              [mknode \"a:graphicFrameLocks\" [(\"noGrp\", \"1\")] ()]\n            , mknode \"p:nvPr\" []\n              [mknode \"p:ph\" [(\"idx\", \"1\")] ()]\n            ]\n          , mknode \"p:xfrm\" []\n            [ mknode \"a:off\" [(\"x\", tshow $ 12700 * x),\n                              (\"y\", tshow $ 12700 * y)] ()\n            , mknode \"a:ext\" [(\"cx\", tshow $ 12700 * cx),\n                              (\"cy\", tshow $ 12700 * cy)] ()\n            ]\n          ] <> elements\n        )\n\n  if not $ null caption\n    then do capElt <- createCaption ((x, y), (cx, cytmp)) caption\n            return [graphicFrameElts, capElt]\n    else return [graphicFrameElts]\n\ngetDefaultTableStyle :: PandocMonad m => P m (Maybe T.Text)\ngetDefaultTableStyle = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  tblStyleLst <- parseXml refArchive distArchive \"ppt/tableStyles.xml\"\n  return $ findAttr (QName \"def\" Nothing Nothing) tblStyleLst\n\ngraphicToElement :: PandocMonad m => Integer -> Graphic -> P m Element\ngraphicToElement tableWidth (Tbl widths tblPr hdrCells rows) = do\n  let totalWidth = sum widths\n  let colWidths = if 0.0 `elem` widths\n                  then if null hdrCells\n                      then case rows of\n                         r@(_:_) : _ -> replicate (length r) $\n                                                 tableWidth `div` toInteger (length r)\n                         []: _ -> []\n                         [] -> []\n                      else replicate (length hdrCells) $\n                           tableWidth `div` toInteger (length hdrCells)\n                  else map (\\w -> round $ w / totalWidth * fromIntegral tableWidth) widths\n\n  let cellToOpenXML paras =\n        do elements <- mapM paragraphToElement paras\n           let elements' = if null elements\n                           then [mknode \"a:p\" [] [mknode \"a:endParaRPr\" [] ()]]\n                           else elements\n\n           return\n             [mknode \"a:txBody\" [] $\n               [ mknode \"a:bodyPr\" [] ()\n               , mknode \"a:lstStyle\" [] ()]\n               <> elements']\n  headers' <- mapM cellToOpenXML hdrCells\n  rows' <- mapM (mapM cellToOpenXML) rows\n  let borderProps = mknode \"a:tcPr\" [] ()\n  let emptyCell' = [mknode \"a:p\" [] [mknode \"a:pPr\" [] ()]]\n  let mkcell border contents = mknode \"a:tc\" []\n                            $ (if null contents\n                               then emptyCell'\n                               else contents) <> [ borderProps | border ]\n  let mkrow border cells = mknode \"a:tr\" [(\"h\", \"0\")] $ map (mkcell border) cells\n\n  let mkgridcol w = mknode \"a:gridCol\"\n                       [(\"w\", tshow ((12700 * w) :: Integer))] ()\n  let hasHeader = not (all null hdrCells)\n\n  mbDefTblStyle <- getDefaultTableStyle\n  let tblPrElt = mknode \"a:tblPr\"\n                 [ (\"firstRow\", if tblPrFirstRow tblPr then \"1\" else \"0\")\n                 , (\"bandRow\", if tblPrBandRow tblPr then \"1\" else \"0\")\n                 ] (case mbDefTblStyle of\n                      Nothing -> []\n                      Just sty -> [mknode \"a:tableStyleId\" [] sty])\n\n  return $ mknode \"a:graphic\" []\n    [mknode \"a:graphicData\" [(\"uri\", \"http://schemas.openxmlformats.org/drawingml/2006/table\")]\n     [mknode \"a:tbl\" [] $\n      [ tblPrElt\n      , mknode \"a:tblGrid\" [] (if all (==0) colWidths\n                               then []\n                               else map mkgridcol colWidths)\n      ]\n      <> [ mkrow True headers' | hasHeader ] <> map (mkrow False) rows'\n     ]\n    ]\n\n\n-- We get the shape by placeholder type. If there is NO type, it\n-- defaults to a content placeholder.\n\ndata PHType = PHType T.Text | ObjType\n  deriving (Show, Eq)\n\nfindPHType :: NameSpaces -> Element -> PHType -> Bool\nfindPHType ns spElem phType\n  | isElem ns \"p\" \"sp\" spElem =\n    let mbPHElem = (Just spElem >>=\n                   findChild (elemName ns \"p\" \"nvSpPr\") >>=\n                   findChild (elemName ns \"p\" \"nvPr\") >>=\n                   findChild (elemName ns \"p\" \"ph\"))\n    in\n      case mbPHElem of\n        -- if it's a named PHType, we want to check that the attribute\n        -- value matches.\n        Just phElem | (PHType tp) <- phType ->\n                        case findAttr (QName \"type\" Nothing Nothing) phElem of\n                          Just tp' -> tp == tp'\n                          Nothing -> False\n        -- if it's an ObjType, we want to check that there is NO\n        -- \"type\" attribute. In other words, a lookup should return nothing.\n        Just phElem | ObjType <- phType ->\n                        case findAttr (QName \"type\" Nothing Nothing) phElem of\n                          Just _ -> False\n                          Nothing -> True\n        Nothing -> False\nfindPHType _ _ _ = False\n\ngetShapesByPlaceHolderType :: NameSpaces -> Element -> PHType -> [Element]\ngetShapesByPlaceHolderType ns spTreeElem phType\n  | isElem ns \"p\" \"spTree\" spTreeElem =\n      filterChildren (\\e -> findPHType ns e phType) spTreeElem\n  | otherwise = []\n\ngetShapeByPlaceHolderType :: NameSpaces -> Element -> PHType -> Maybe Element\ngetShapeByPlaceHolderType ns spTreeElem phType =\n  listToMaybe $ getShapesByPlaceHolderType ns spTreeElem phType\n\n-- Like the above, but it tries a number of different placeholder types\ngetShapeByPlaceHolderTypes :: NameSpaces -> Element -> [PHType] -> Maybe Element\ngetShapeByPlaceHolderTypes _ _ [] = Nothing\ngetShapeByPlaceHolderTypes ns spTreeElem (s:ss) =\n  case getShapeByPlaceHolderType ns spTreeElem s of\n    Just element -> Just element\n    Nothing -> getShapeByPlaceHolderTypes ns spTreeElem ss\n\nnonBodyTextToElement ::\n  PandocMonad m =>\n  Element ->\n  [PHType] ->\n  [ParaElem] ->\n  P m (Maybe ShapeId, Element)\nnonBodyTextToElement layout phTypes paraElements\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld\n  , Just sp <- getShapeByPlaceHolderTypes ns spTree phTypes\n  , Just nvSpPr <- findChild (elemName ns \"p\" \"nvSpPr\") sp\n  , Just cNvPr <- findChild (elemName ns \"p\" \"cNvPr\") nvSpPr\n  , Just shapeId <- findAttr (nodename \"id\") cNvPr\n  , Right (shapeIdNum, _) <- decimal shapeId = do\n      let hdrPara = Paragraph def paraElements\n      element <- paragraphToElement hdrPara\n      let txBody = mknode \"p:txBody\" [] $\n                   [mknode \"a:bodyPr\" [] (), mknode \"a:lstStyle\" [] ()] <>\n                   [element]\n      return (Just shapeIdNum,\n              surroundWithMathAlternate $\n                replaceNamedChildren ns \"p\" \"txBody\" [txBody] sp)\n  -- XXX: TODO\n  | otherwise = return (Nothing, mknode \"p:sp\" [] ())\n\ndata ContentShapeIds = ContentShapeIds\n  { contentHeaderId :: Maybe ShapeId\n  , contentContentIds :: [ShapeId]\n  }\n\ncontentToElement ::\n  PandocMonad m =>\n  Element ->\n  [ParaElem] ->\n  [Shape] ->\n  P m (Maybe ContentShapeIds, Element)\ncontentToElement layout hdrShape shapes\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (shapeId, element) <- nonBodyTextToElement layout [PHType \"title\"] hdrShape\n      let hdrShapeElements = [Elem element | not (null hdrShape)]\n          contentHeaderId = if null hdrShape then Nothing else shapeId\n      content' <- local\n                         (\\env -> env {envPlaceholder = Placeholder ObjType 0})\n                         (shapesToElements layout shapes)\n      let contentContentIds = mapMaybe fst content'\n          contentElements = snd <$> content'\n      footer <- footerElements content\n      return ( Just ContentShapeIds{..}\n             , buildSpTree ns spTree (hdrShapeElements <> contentElements <> footer)\n             )\ncontentToElement _ _ _ = return (Nothing, mknode \"p:sp\" [] ())\n\ndata TwoColumnShapeIds = TwoColumnShapeIds\n  { twoColumnHeaderId :: Maybe ShapeId\n  , twoColumnLeftIds :: [ShapeId]\n  , twoColumnRightIds :: [ShapeId]\n  }\n\ntwoColumnToElement ::\n  PandocMonad m =>\n  Element ->\n  [ParaElem] ->\n  [Shape] ->\n  [Shape] ->\n  P m (Maybe TwoColumnShapeIds, Element)\ntwoColumnToElement layout hdrShape shapesL shapesR\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (headerId, element) <- nonBodyTextToElement layout [PHType \"title\"] hdrShape\n      let hdrShapeElements = [Elem element | not (null hdrShape)]\n          twoColumnHeaderId = if null hdrShape then Nothing else headerId\n      contentL <- local (\\env -> env {envPlaceholder = Placeholder ObjType 0})\n                        (shapesToElements layout shapesL)\n      let twoColumnLeftIds = mapMaybe fst contentL\n          contentElementsL = snd <$> contentL\n      contentR <- local (\\env -> env {envPlaceholder = Placeholder ObjType 1})\n                        (shapesToElements layout shapesR)\n      let (twoColumnRightIds) = (mapMaybe fst contentR)\n          contentElementsR = snd <$> contentR\n      -- let contentElementsL' = map (setIdx ns \"1\") contentElementsL\n      --     contentElementsR' = map (setIdx ns \"2\") contentElementsR\n      footer <- footerElements twoColumn\n      return\n        $ (Just TwoColumnShapeIds{..}, )\n        $ buildSpTree ns spTree\n        $ hdrShapeElements <> contentElementsL <> contentElementsR <> footer\ntwoColumnToElement _ _ _ _ = return (Nothing, mknode \"p:sp\" [] ())\n\ndata ComparisonShapeIds = ComparisonShapeIds\n  { comparisonHeaderId :: Maybe ShapeId\n  , comparisonLeftTextIds :: [ShapeId]\n  , comparisonLeftContentIds :: [ShapeId]\n  , comparisonRightTextIds :: [ShapeId]\n  , comparisonRightContentIds :: [ShapeId]\n  }\n\ncomparisonToElement ::\n  PandocMonad m =>\n  Element ->\n  [ParaElem] ->\n  ([Shape], [Shape]) ->\n  ([Shape], [Shape]) ->\n  P m (Maybe ComparisonShapeIds, Element)\ncomparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2)\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (headerShapeId, element) <- nonBodyTextToElement layout [PHType \"title\"] hdrShape\n      let hdrShapeElements = [Elem element | not (null hdrShape)]\n          comparisonHeaderId = if null hdrShape then Nothing else headerShapeId\n      contentL1 <- local (\\env -> env {envPlaceholder = Placeholder (PHType \"body\") 0})\n                         (shapesToElements layout shapesL1)\n      let comparisonLeftTextIds = mapMaybe fst contentL1\n          contentElementsL1 = snd <$> contentL1\n      contentL2 <- local (\\env -> env {envPlaceholder = Placeholder ObjType 0})\n                         (shapesToElements layout shapesL2)\n      let comparisonLeftContentIds = mapMaybe fst contentL2\n          contentElementsL2 = snd <$> contentL2\n      contentR1 <- local (\\env -> env {envPlaceholder = Placeholder (PHType \"body\") 1})\n                         (shapesToElements layout shapesR1)\n      let comparisonRightTextIds = mapMaybe fst contentR1\n          contentElementsR1 = snd <$> contentR1\n      contentR2 <- local (\\env -> env {envPlaceholder = Placeholder ObjType 1})\n                         (shapesToElements layout shapesR2)\n      let comparisonRightContentIds = mapMaybe fst contentR2\n          contentElementsR2 = snd <$> contentR2\n      footer <- footerElements comparison\n      return\n        $ (Just ComparisonShapeIds{..}, )\n        $ buildSpTree ns spTree\n        $ mconcat [ hdrShapeElements\n                  , contentElementsL1\n                  , contentElementsL2\n                  , contentElementsR1\n                  , contentElementsR2\n                  ] <> footer\ncomparisonToElement _ _ _ _= return (Nothing, mknode \"p:sp\" [] ())\n\ndata ContentWithCaptionShapeIds = ContentWithCaptionShapeIds\n  { contentWithCaptionHeaderId :: Maybe ShapeId\n  , contentWithCaptionCaptionIds :: [ShapeId]\n  , contentWithCaptionContentIds :: [ShapeId]\n  }\n\ncontentWithCaptionToElement ::\n  PandocMonad m =>\n  Element ->\n  [ParaElem] ->\n  [Shape] ->\n  [Shape] ->\n  P m (Maybe ContentWithCaptionShapeIds, Element)\ncontentWithCaptionToElement layout hdrShape textShapes contentShapes\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (shapeId, element) <- nonBodyTextToElement layout [PHType \"title\"] hdrShape\n      let hdrShapeElements = [Elem element | not (null hdrShape)]\n          contentWithCaptionHeaderId = if null hdrShape then Nothing else shapeId\n      text <- local (\\env -> env {envPlaceholder = Placeholder (PHType \"body\") 0})\n                    (shapesToElements layout textShapes)\n      let contentWithCaptionCaptionIds = mapMaybe fst text\n          textElements = snd <$> text\n      content <- local (\\env -> env {envPlaceholder = Placeholder ObjType 0})\n                       (shapesToElements layout contentShapes)\n      let contentWithCaptionContentIds = mapMaybe fst content\n          contentElements = snd <$> content\n      footer <- footerElements contentWithCaption\n      return\n        $ (Just ContentWithCaptionShapeIds{..}, )\n        $ buildSpTree ns spTree\n        $ mconcat [ hdrShapeElements\n                  , textElements\n                  , contentElements\n                  ] <> footer\ncontentWithCaptionToElement _ _ _ _ = return (Nothing, mknode \"p:sp\" [] ())\n\nblankToElement ::\n  PandocMonad m =>\n  Element ->\n  P m Element\nblankToElement layout\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld =\n      buildSpTree ns spTree <$> footerElements blank\nblankToElement _ = return $ mknode \"p:sp\" [] ()\n\nnewtype TitleShapeIds = TitleShapeIds\n  { titleHeaderId :: Maybe ShapeId\n  }\n\ntitleToElement ::\n  PandocMonad m =>\n  Element ->\n  [ParaElem] ->\n  P m (Maybe TitleShapeIds, Element)\ntitleToElement layout titleElems\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      (shapeId, element) <- nonBodyTextToElement layout [PHType \"title\", PHType \"ctrTitle\"] titleElems\n      let titleShapeElements = [Elem element | not (null titleElems)]\n          titleHeaderId = if null titleElems then Nothing else shapeId\n      footer <- footerElements title\n      return\n        $ (Just TitleShapeIds{..}, )\n        $ buildSpTree ns spTree (titleShapeElements <> footer)\ntitleToElement _ _ = return (Nothing, mknode \"p:sp\" [] ())\n\ndata MetadataShapeIds = MetadataShapeIds\n  { metadataTitleId :: Maybe ShapeId\n  , metadataSubtitleId :: Maybe ShapeId\n  , metadataDateId :: Maybe ShapeId\n  }\n\nmetadataToElement ::\n  PandocMonad m =>\n  Element ->\n  [ParaElem] ->\n  [ParaElem] ->\n  [[ParaElem]] ->\n  [ParaElem] ->\n  P m (Maybe MetadataShapeIds, Element)\nmetadataToElement layout titleElems subtitleElems authorsElems dateElems\n  | ns <- elemToNameSpaces layout\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") layout\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld = do\n      let combinedAuthorElems = intercalate [Break] authorsElems\n          subtitleAndAuthorElems = intercalate [Break, Break] $\n                                    filter (not . null)\n                                     [subtitleElems, combinedAuthorElems]\n      (titleId, titleElement) <- nonBodyTextToElement layout [PHType \"ctrTitle\"] titleElems\n      (subtitleId, subtitleElement) <- nonBodyTextToElement layout [PHType \"subTitle\"] subtitleAndAuthorElems\n      (dateId, dateElement) <- nonBodyTextToElement layout [PHType \"dt\"] dateElems\n      let titleShapeElements = [titleElement | not (null titleElems)]\n          metadataTitleId = if null titleElems then Nothing else titleId\n          subtitleShapeElements = [subtitleElement | not (null subtitleAndAuthorElems)]\n          metadataSubtitleId = if null subtitleAndAuthorElems then Nothing else subtitleId\n      footerInfo <- gets stFooterInfo\n      footer <- (if maybe False fiShowOnFirstSlide footerInfo\n                 then id\n                 else const []) <$> footerElements metadata\n      let dateShapeElements = [dateElement\n                              | not (null dateElems\n                                || isJust (footerInfo >>= metadata . fiDate))\n                              ]\n          metadataDateId = if null dateElems then Nothing else dateId\n      return\n        $ (Just MetadataShapeIds{..}, )\n        $ buildSpTree ns spTree\n        $ map Elem (titleShapeElements <> subtitleShapeElements <> dateShapeElements)\n        <> footer\nmetadataToElement _ _ _ _ _ = return (Nothing, mknode \"p:sp\" [] ())\n\nslideToElement :: PandocMonad m => Slide -> P m Element\nslideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ backgroundImage) = do\n  layout <- getLayout l\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  (shapeIds, spTree)\n     <- local (\\env -> if null hdrElems\n                       then env\n                       else env{envSlideHasHeader=True})\n              (contentToElement layout hdrElems shapes)\n  let animations = case shapeIds of\n        Nothing -> []\n        Just ContentShapeIds{..} ->\n          slideToIncrementalAnimations (zip contentContentIds shapes)\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] (mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree]) : animations)\nslideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _ backgroundImage) = do\n  layout <- getLayout l\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  (shapeIds, spTree) <- local (\\env -> if null hdrElems\n                           then env\n                           else env{envSlideHasHeader=True}) $\n            twoColumnToElement layout hdrElems shapesL shapesR\n  let animations = case shapeIds of\n        Nothing -> []\n        Just TwoColumnShapeIds{..} ->\n          slideToIncrementalAnimations (zip twoColumnLeftIds shapesL\n                                        <> zip twoColumnRightIds shapesR)\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] (mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree]) : animations)\nslideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _ backgroundImage) = do\n  layout <- getLayout l\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  (shapeIds, spTree) <- local (\\env -> if null hdrElems\n                           then env\n                           else env{envSlideHasHeader=True}) $\n            comparisonToElement layout hdrElems shapesL shapesR\n  let animations = case shapeIds of\n        Nothing -> []\n        Just ComparisonShapeIds{..} ->\n          slideToIncrementalAnimations\n            (zip comparisonLeftTextIds (fst shapesL)\n            <> zip comparisonLeftContentIds (snd shapesL)\n            <> zip comparisonRightTextIds (fst shapesR)\n            <> zip comparisonRightContentIds (snd shapesR))\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] (mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree]) : animations)\nslideToElement (Slide _ l@(TitleSlide hdrElems) _ backgroundImage) = do\n  layout <- getLayout l\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  (_, spTree) <- titleToElement layout hdrElems\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] [mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree])]\nslideToElement (Slide\n                _\n                l@(MetadataSlide titleElems subtitleElems authorElems dateElems)\n                _\n                backgroundImage) = do\n  layout <- getLayout l\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  (_, spTree) <- metadataToElement layout titleElems subtitleElems authorElems dateElems\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] [mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree])]\nslideToElement (Slide\n                _\n                l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes)\n                _\n                backgroundImage) = do\n  layout <- getLayout l\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  (shapeIds, spTree) <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes\n  let animations = case shapeIds of\n        Nothing -> []\n        Just ContentWithCaptionShapeIds{..} ->\n          slideToIncrementalAnimations\n            (zip contentWithCaptionCaptionIds captionShapes\n             <> zip contentWithCaptionContentIds contentShapes)\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] (mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree]) : animations)\nslideToElement (Slide _ BlankSlide _ backgroundImage) = do\n  layout <- getLayout BlankSlide\n  backgroundImageElement <- traverse backgroundImageToElement backgroundImage\n  spTree <- blankToElement layout\n  return $ mknode \"p:sld\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\"),\n      (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"),\n      (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] [mknode \"p:cSld\" [] (toList backgroundImageElement <> [spTree])]\n\nbackgroundImageToElement :: PandocMonad m => FilePath -> P m Element\nbackgroundImageToElement path = do\n  MediaInfo{mInfoLocalId, mInfoFilePath} <- registerMedia path []\n  (imgBytes, _) <- P.fetchItem (T.pack mInfoFilePath)\n  opts <- asks envOpts\n  let imageDimensions = either (const Nothing)\n                               (Just . sizeInPixels)\n                               (imageSize opts imgBytes)\n  pageSize <- asks envPresentationSize\n  let fillRectAttributes = maybe [] (offsetAttributes pageSize) imageDimensions\n  let rId = \"rId\" <> T.pack (show mInfoLocalId)\n  return\n    $ mknode \"p:bg\" []\n    $ mknode \"p:bgPr\" []\n    [ mknode \"a:blipFill\" [(\"dpi\", \"0\"), (\"rotWithShape\", \"1\")]\n      [ mknode \"a:blip\" [(\"r:embed\", rId)]\n        $ mknode \"a:lum\" [] ()\n      , mknode \"a:srcRect\" [] ()\n      , mknode \"a:stretch\" []\n        $ mknode \"a:fillRect\" fillRectAttributes ()\n      ]\n    , mknode \"a:effectsLst\" [] ()\n    ]\n  where\n    offsetAttributes :: (Integer, Integer) -> (Integer, Integer) -> [(Text, Text)]\n    offsetAttributes (pageWidth, pageHeight) (pictureWidth, pictureHeight) = let\n      widthRatio = pictureWidth % pageWidth\n      heightRatio = pictureHeight % pageHeight\n      getOffset :: Ratio Integer -> Text\n      getOffset proportion = let\n          percentageOffset = (proportion - 1) * (-100 % 2)\n          integerOffset = round percentageOffset * 1000 :: Integer\n        in T.pack (show integerOffset)\n      in case compare widthRatio heightRatio of\n        EQ -> []\n        LT -> let\n          offset = getOffset ((pictureHeight % pageHeight) / widthRatio)\n          in [ (\"t\", offset)\n             , (\"b\", offset)\n             ]\n        GT -> let\n          offset = getOffset ((pictureWidth % pageWidth) / heightRatio)\n          in [ (\"l\", offset)\n             , (\"r\", offset)\n             ]\n\n\nslideToIncrementalAnimations ::\n  [(ShapeId, Shape)] ->\n  [Element]\nslideToIncrementalAnimations shapes = let\n  incrementals :: [(ShapeId, [Bool])]\n  incrementals = do\n    (shapeId, TextBox ps) <- shapes\n    pure . (shapeId,) $ do\n      Paragraph ParaProps{pPropIncremental} _ <- ps\n      pure pPropIncremental\n  toIndices :: [Bool] -> Maybe (NonEmpty (Integer, Integer))\n  toIndices bs = do\n        let indexed = zip [0..] bs\n        ts <- nonEmpty (filter snd indexed)\n        pure (fmap (\\(n, _) -> (n, n)) ts)\n  indices :: [(ShapeId, NonEmpty (Integer, Integer))]\n  indices = do\n    (shapeId, bs) <- incrementals\n    toList ((,) shapeId <$> toIndices bs)\n  in toList (incrementalAnimation <$> nonEmpty indices)\n\n--------------------------------------------------------------------\n-- Notes:\n\ngetNotesMaster :: PandocMonad m => P m Element\ngetNotesMaster = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  parseXml refArchive distArchive \"ppt/notesMasters/notesMaster1.xml\"\n\ngetSlideNumberFieldId :: PandocMonad m => Element -> P m T.Text\ngetSlideNumberFieldId notesMaster\n  | ns <- elemToNameSpaces notesMaster\n  , Just cSld <- findChild (elemName ns \"p\" \"cSld\") notesMaster\n  , Just spTree <- findChild (elemName ns \"p\" \"spTree\") cSld\n  , Just sp <- getShapeByPlaceHolderType ns spTree (PHType \"sldNum\")\n  , Just txBody <- findChild (elemName ns \"p\" \"txBody\") sp\n  , Just p <- findChild (elemName ns \"a\" \"p\") txBody\n  , Just fld <- findChild (elemName ns \"a\" \"fld\") p\n  , Just fldId <- findAttr (QName \"id\" Nothing Nothing) fld =\n      return fldId\n  | otherwise = throwError $\n                PandocSomeError\n                \"No field id for slide numbers in notesMaster.xml\"\n\nspeakerNotesSlideImage :: Element\nspeakerNotesSlideImage =\n  mknode \"p:sp\" []\n  [ mknode \"p:nvSpPr\" []\n    [ mknode \"p:cNvPr\" [ (\"id\", \"2\")\n                       , (\"name\", \"Slide Image Placeholder 1\")\n                       ] ()\n    , mknode \"p:cNvSpPr\" []\n      [ mknode \"a:spLocks\" [ (\"noGrp\", \"1\")\n                           , (\"noRot\", \"1\")\n                           , (\"noChangeAspect\", \"1\")\n                           ] ()\n      ]\n    , mknode \"p:nvPr\" []\n      [ mknode \"p:ph\" [(\"type\", \"sldImg\")] ()]\n    ]\n  , mknode \"p:spPr\" [] ()\n  ]\n\n-- we want to wipe links from the speaker notes in the\n-- paragraphs. Powerpoint doesn't allow you to input them, and it\n-- would provide extra complications.\nremoveParaLinks :: Paragraph -> Paragraph\nremoveParaLinks paragraph = paragraph{paraElems = map f (paraElems paragraph)}\n  where f (Run rProps s) = Run rProps{rLink=Nothing} s\n        f pe             = pe\n\n-- put an empty paragraph between paragraphs for more expected spacing.\nspaceParas :: [Paragraph] -> [Paragraph]\nspaceParas = intersperse (Paragraph def [])\n\nspeakerNotesBody :: PandocMonad m => [Paragraph] -> P m Element\nspeakerNotesBody paras = do\n  elements <- local (\\env -> env{envInSpeakerNotes = True}) $\n              mapM paragraphToElement $ spaceParas $ map removeParaLinks paras\n  let txBody = mknode \"p:txBody\" [] $\n               [mknode \"a:bodyPr\" [] (), mknode \"a:lstStyle\" [] ()] <> elements\n  return $\n    surroundWithMathAlternate $\n    mknode \"p:sp\" []\n    [ mknode \"p:nvSpPr\" []\n      [ mknode \"p:cNvPr\" [ (\"id\", \"3\")\n                         , (\"name\", \"Notes Placeholder 2\")\n                         ] ()\n      , mknode \"p:cNvSpPr\" []\n        [ mknode \"a:spLocks\" [(\"noGrp\", \"1\")] ()]\n      , mknode \"p:nvPr\" []\n        [ mknode \"p:ph\" [(\"type\", \"body\"), (\"idx\", \"1\")] ()]\n      ]\n    , mknode \"p:spPr\" [] ()\n    , txBody\n    ]\n\nspeakerNotesSlideNumber :: Int -> T.Text -> Element\nspeakerNotesSlideNumber pgNum fieldId =\n  mknode \"p:sp\" []\n  [ mknode \"p:nvSpPr\" []\n    [ mknode \"p:cNvPr\" [ (\"id\", \"4\")\n                       , (\"name\", \"Slide Number Placeholder 3\")\n                       ] ()\n    , mknode \"p:cNvSpPr\" []\n      [ mknode \"a:spLocks\" [(\"noGrp\", \"1\")] ()]\n    , mknode \"p:nvPr\" []\n      [ mknode \"p:ph\" [ (\"type\", \"sldNum\")\n                      , (\"sz\", \"quarter\")\n                      , (\"idx\", \"10\")\n                      ] ()\n      ]\n    ]\n  , mknode \"p:spPr\" [] ()\n  , mknode \"p:txBody\" []\n    [ mknode \"a:bodyPr\" [] ()\n    , mknode \"a:lstStyle\" [] ()\n    , mknode \"a:p\" []\n      [ mknode \"a:fld\" [ (\"id\", fieldId)\n                       , (\"type\", \"slidenum\")\n                       ]\n        [ mknode \"a:rPr\" [(\"lang\", \"en-US\")] ()\n        , mknode \"a:t\" [] (tshow pgNum)\n        ]\n      , mknode \"a:endParaRPr\" [(\"lang\", \"en-US\")] ()\n      ]\n    ]\n  ]\n\nslideToSpeakerNotesElement :: PandocMonad m => Slide -> P m (Maybe Element)\nslideToSpeakerNotesElement (Slide _ _ (SpeakerNotes []) _) = return Nothing\nslideToSpeakerNotesElement slide@(Slide _ _ (SpeakerNotes paras) _) = do\n  master <- getNotesMaster\n  fieldId  <- getSlideNumberFieldId master\n  num <- slideNum slide\n  let imgShape = speakerNotesSlideImage\n      sldNumShape = speakerNotesSlideNumber num fieldId\n  bodyShape <- speakerNotesBody paras\n  return $ Just $\n    mknode \"p:notes\"\n    [ (\"xmlns:a\", \"http://schemas.openxmlformats.org/drawingml/2006/main\")\n    , (\"xmlns:r\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\")\n    , (\"xmlns:p\", \"http://schemas.openxmlformats.org/presentationml/2006/main\")\n    ] [ mknode \"p:cSld\" []\n        [ mknode \"p:spTree\" []\n          [ mknode \"p:nvGrpSpPr\" []\n            [ mknode \"p:cNvPr\" [(\"id\", \"1\"), (\"name\", \"\")] ()\n            , mknode \"p:cNvGrpSpPr\" [] ()\n            , mknode \"p:nvPr\" [] ()\n            ]\n          , mknode \"p:grpSpPr\" []\n            [ mknode \"a:xfrm\" []\n              [ mknode \"a:off\" [(\"x\", \"0\"), (\"y\", \"0\")] ()\n              , mknode \"a:ext\" [(\"cx\", \"0\"), (\"cy\", \"0\")] ()\n              , mknode \"a:chOff\" [(\"x\", \"0\"), (\"y\", \"0\")] ()\n              , mknode \"a:chExt\" [(\"cx\", \"0\"), (\"cy\", \"0\")] ()\n              ]\n            ]\n          , imgShape\n          , bodyShape\n          , sldNumShape\n          ]\n        ]\n      ]\n\n-----------------------------------------------------------------------\n\ngetSlideIdNum :: PandocMonad m => SlideId -> P m Int\ngetSlideIdNum sldId = do\n  slideIdMap <- asks envSlideIdMap\n  case  M.lookup sldId slideIdMap of\n    Just n -> return n\n    Nothing -> throwError $\n               PandocShouldNeverHappenError $\n               \"Slide Id \" <> tshow sldId <> \" not found.\"\n\nslideNum :: PandocMonad m => Slide -> P m Int\nslideNum slide = getSlideIdNum $ slideId slide\n\nidNumToFilePath :: Int -> FilePath\nidNumToFilePath idNum = \"slide\" <> show idNum <> \".xml\"\n\nslideToFilePath :: PandocMonad m => Slide -> P m FilePath\nslideToFilePath slide = do\n  idNum <- slideNum slide\n  return $ \"slide\" <> show idNum <> \".xml\"\n\nslideToRelId ::\n  PandocMonad m =>\n  MinimumRId ->\n  Slide ->\n  P m T.Text\nslideToRelId minSlideRId slide = do\n  n <- slideNum slide\n  return $ \"rId\" <> tshow (n + minSlideRId - 1)\n\n\ndata Relationship = Relationship { relId :: Int\n                                 , relType :: MimeType\n                                 , relTarget :: FilePath\n                                 } deriving (Show, Eq)\n\nelementToRel :: Element -> Maybe Relationship\nelementToRel element\n  | elName element == QName \"Relationship\" (Just \"http://schemas.openxmlformats.org/package/2006/relationships\") Nothing =\n      do rId <- findAttr (QName \"Id\" Nothing Nothing) element\n         numStr <- T.stripPrefix \"rId\" rId\n         num <- fromIntegral <$> readTextAsInteger numStr\n         type' <- findAttr (QName \"Type\" Nothing Nothing) element\n         target <- findAttr (QName \"Target\" Nothing Nothing) element\n         return $ Relationship num type' (T.unpack target)\n  | otherwise = Nothing\n\nslideToPresRel :: PandocMonad m => Int -> Slide -> P m Relationship\nslideToPresRel minimumSlideRId slide = do\n  idNum <- slideNum slide\n  let rId = idNum + minimumSlideRId - 1\n      fp = \"slides/\" <> idNumToFilePath idNum\n  return $ Relationship { relId = rId\n                        , relType = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\"\n                        , relTarget = fp\n                        }\n\ngetPresentationRels :: PandocMonad m => P m [Relationship]\ngetPresentationRels = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  relsElem <- parseXml refArchive distArchive \"ppt/_rels/presentation.xml.rels\"\n  let globalNS = \"http://schemas.openxmlformats.org/package/2006/relationships\"\n  let relElems = findChildren (QName \"Relationship\" (Just globalNS) Nothing) relsElem\n  return $ mapMaybe elementToRel relElems\n\n-- | Info required to update a presentation rId from the reference doc for the\n-- output.\ntype PresentationRIdUpdateData = (ReferenceMinRIdAfterSlides, NewRIdBounds)\n\n-- | The minimum and maximum rIds for presentation relationships created from\n-- the presentation content (as opposed to from the reference doc).\n--\n-- Relationships taken from the reference doc should have their rId number\n-- adjusted to make sure it sits outside this range.\ntype NewRIdBounds = (MinimumRId, MaximumRId)\n\n-- | The minimum presentation rId from the reference doc which comes after the\n-- first slide rId (in the reference doc).\ntype ReferenceMinRIdAfterSlides = Int\ntype MinimumRId = Int\ntype MaximumRId = Int\n\n-- | Given a presentation rId from the reference doc, return the value it should\n-- have in the output.\nupdatePresentationRId :: PresentationRIdUpdateData -> Int -> Int\nupdatePresentationRId (minOverlappingRId, (minNewId, maxNewId)) n\n  | n < minNewId = n\n  | otherwise = n - minOverlappingRId + maxNewId + 1\n\npresentationToRels ::\n  PandocMonad m =>\n  Presentation ->\n  P m (PresentationRIdUpdateData, [Relationship])\npresentationToRels pres@(Presentation _ slides) = do\n  rels <- getPresentationRels\n\n  -- We want to make room for the slides in the id space. We'll assume the slide\n  -- masters come first (this seems to be what PowerPoint does by default, and\n  -- is true of the reference doc), and we'll put the slides next. So we find\n  -- the starting rId for the slides by finding the maximum rId for the masters\n  -- and adding 1.\n  --\n  -- Then:\n  -- 1. We look to see what the minimum rId which is greater than or equal to\n  --    the minimum slide rId is, in the rels we're keeping from the reference\n  --    doc (i.e. the minimum rId which might overlap with the slides).\n  -- 2. We increase this minimum overlapping rId to 1 higher than the last slide\n  --    rId (or the notesMaster rel, if we're including one), and increase all\n  --    rIds higher than this minimum by the same amount.\n\n  let masterRels = filter (T.isSuffixOf \"slideMaster\" . relType) rels\n      slideStartId = maybe 1 ((+ 1) . maximum . fmap relId) (nonEmpty masterRels)\n      -- we remove the slide rels and the notesmaster (if it's\n      -- there). We'll put these back in ourselves, if necessary.\n      relsWeKeep = filter\n                   (\\r -> relType r /= \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" &&\n                          relType r /= \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\")\n                   rels\n      minOverlappingRel = maybe 0 minimum\n                                 (nonEmpty (filter (slideStartId <=)\n                                                   (relId <$> relsWeKeep)))\n\n  mySlideRels <- mapM (slideToPresRel slideStartId) slides\n\n  let notesMasterRels =\n        [Relationship { relId = slideStartId + length mySlideRels\n                         , relType = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\"\n                         , relTarget = \"notesMasters/notesMaster1.xml\"\n                         } | presHasSpeakerNotes pres]\n      insertedRels = mySlideRels <> notesMasterRels\n      newRIdBounds = (slideStartId, slideStartId + length insertedRels - 1)\n      updateRId = updatePresentationRId (minOverlappingRel, newRIdBounds)\n\n      relsWeKeep' = map (\\r -> r{relId = updateRId $ relId r}) relsWeKeep\n\n  return ((minOverlappingRel, newRIdBounds), insertedRels <> relsWeKeep')\n\n-- We make this ourselves, in case there's a thumbnail in the one from\n-- the template.\ntopLevelRels :: [Relationship]\ntopLevelRels =\n  [ Relationship { relId = 1\n                 , relType = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\"\n                 , relTarget = \"ppt/presentation.xml\"\n                 }\n  , Relationship { relId = 2\n                 , relType = \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\"\n                 , relTarget = \"docProps/core.xml\"\n                 }\n  , Relationship { relId = 3\n                 , relType = \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/extended-properties\"\n                 , relTarget = \"docProps/app.xml\"\n                 }\n  , Relationship { relId = 4\n                 , relType = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\"\n                 , relTarget = \"docProps/custom.xml\"\n                 }\n  ]\n\ntopLevelRelsEntry :: PandocMonad m => P m Entry\ntopLevelRelsEntry = elemToEntry \"_rels/.rels\" $ relsToElement topLevelRels\n\nrelToElement :: Relationship -> Element\nrelToElement rel = mknode \"Relationship\" [ (\"Id\", \"rId\" <> tshow (relId rel))\n                                         , (\"Type\", relType rel)\n                                         , (\"Target\", T.pack $ relTarget rel) ] ()\n\nrelsToElement :: [Relationship] -> Element\nrelsToElement rels = mknode \"Relationships\"\n                     [(\"xmlns\", \"http://schemas.openxmlformats.org/package/2006/relationships\")]\n                     (map relToElement rels)\n\npresentationToRelsEntry ::\n  PandocMonad m =>\n  Presentation ->\n  P m (PresentationRIdUpdateData, Entry)\npresentationToRelsEntry pres = do\n  (presentationRIdUpdateData, rels) <- presentationToRels pres\n  element <- elemToEntry \"ppt/_rels/presentation.xml.rels\" $ relsToElement rels\n  pure (presentationRIdUpdateData, element)\n\nelemToEntry :: PandocMonad m => FilePath -> Element -> P m Entry\nelemToEntry fp element = do\n  epochtime <- floor . utcTimeToPOSIXSeconds <$> asks envUTCTime\n  return $ toEntry fp epochtime $ renderXml element\n\nslideToEntry :: PandocMonad m => Slide -> P m Entry\nslideToEntry slide = do\n  idNum <- slideNum slide\n  local (\\env -> env{envCurSlideId = idNum}) $ do\n    element <- slideToElement slide\n    elemToEntry (\"ppt/slides/\" <> idNumToFilePath idNum) element\n\nslideToSpeakerNotesEntry :: PandocMonad m => Slide -> P m (Maybe Entry)\nslideToSpeakerNotesEntry slide = do\n  idNum <- slideNum slide\n  local (\\env -> env{envCurSlideId = idNum}) $ do\n    mbElement <- slideToSpeakerNotesElement slide\n    mbNotesIdNum <- do mp <- asks envSpeakerNotesIdMap\n                       return $ M.lookup idNum mp\n    case mbElement of\n      Just element | Just notesIdNum <- mbNotesIdNum ->\n                       Just <$>\n                       elemToEntry\n                       (\"ppt/notesSlides/notesSlide\" <> show notesIdNum <>\n                        \".xml\")\n                       element\n      _ -> return Nothing\n\nslideToSpeakerNotesRelElement :: PandocMonad m => Slide -> P m (Maybe Element)\nslideToSpeakerNotesRelElement (Slide _ _ (SpeakerNotes []) _) = return Nothing\nslideToSpeakerNotesRelElement slide@Slide{} = do\n  idNum <- slideNum slide\n  return $ Just $\n    mknode \"Relationships\"\n    [(\"xmlns\", \"http://schemas.openxmlformats.org/package/2006/relationships\")]\n    [ mknode \"Relationship\" [ (\"Id\", \"rId2\")\n                            , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\")\n                            , (\"Target\", \"../slides/slide\" <> tshow idNum <> \".xml\")\n                            ] ()\n    , mknode \"Relationship\" [ (\"Id\", \"rId1\")\n                            , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\")\n                            , (\"Target\", \"../notesMasters/notesMaster1.xml\")\n                            ] ()\n    ]\n\n\nslideToSpeakerNotesRelEntry :: PandocMonad m => Slide -> P m (Maybe Entry)\nslideToSpeakerNotesRelEntry slide = do\n  idNum <- slideNum slide\n  mbElement <- slideToSpeakerNotesRelElement slide\n  mp <- asks envSpeakerNotesIdMap\n  let mbNotesIdNum = M.lookup idNum mp\n  case mbElement of\n    Just element | Just notesIdNum <- mbNotesIdNum ->\n      Just <$>\n      elemToEntry\n      (\"ppt/notesSlides/_rels/notesSlide\" <> show notesIdNum <> \".xml.rels\")\n      element\n    _ -> return Nothing\n\nslideToSlideRelEntry :: PandocMonad m => Slide -> P m Entry\nslideToSlideRelEntry slide = do\n  idNum <- slideNum slide\n  element <- slideToSlideRelElement slide\n  elemToEntry (\"ppt/slides/_rels/\" <> idNumToFilePath idNum <> \".rels\") element\n\nlinkRelElement :: PandocMonad m => (Int, LinkTarget) -> P m Element\nlinkRelElement (rIdNum, InternalTarget targetId) = do\n  targetIdNum <- getSlideIdNum targetId\n  return $\n    mknode \"Relationship\" [ (\"Id\", \"rId\" <> tshow rIdNum)\n                          , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\")\n                          , (\"Target\", \"slide\" <> tshow targetIdNum <> \".xml\")\n                          ] ()\nlinkRelElement (rIdNum, ExternalTarget (url, _)) =\n  return $\n    mknode \"Relationship\" [ (\"Id\", \"rId\" <> tshow rIdNum)\n                          , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\")\n                          , (\"Target\", url)\n                          , (\"TargetMode\", \"External\")\n                          ] ()\n\nlinkRelElements :: PandocMonad m => M.Map Int LinkTarget -> P m [Element]\nlinkRelElements mp = mapM linkRelElement (M.toList mp)\n\nmediaRelElement :: MediaInfo -> Element\nmediaRelElement mInfo =\n  let ext = fromMaybe \"\" (mInfoExt mInfo)\n  in\n    mknode \"Relationship\" [ (\"Id\", \"rId\" <>\n      tshow (mInfoLocalId mInfo))\n                          , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\")\n                          , (\"Target\", \"../media/image\" <>\n      tshow (mInfoGlobalId mInfo) <> ext)\n                          ] ()\n\nspeakerNotesSlideRelElement :: PandocMonad m => Slide -> P m (Maybe Element)\nspeakerNotesSlideRelElement slide = do\n  idNum <- slideNum slide\n  mp <- asks envSpeakerNotesIdMap\n  return $ case M.lookup idNum mp of\n    Nothing -> Nothing\n    Just n ->\n      let target = \"../notesSlides/notesSlide\" <> tshow n <> \".xml\"\n      in Just $\n         mknode \"Relationship\" [ (\"Id\", \"rId2\")\n                               , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\")\n                               , (\"Target\", target)\n                               ] ()\n\nslideToSlideRelElement :: PandocMonad m => Slide -> P m Element\nslideToSlideRelElement slide = do\n  idNum <- slideNum slide\n  target <- flip fmap getSlideLayouts $\n    T.pack . (\"../slideLayouts/\" <>) . takeFileName .\n    slPath . case slide of\n        (Slide _ MetadataSlide{} _ _)           -> metadata\n        (Slide _ TitleSlide{} _ _)              -> title\n        (Slide _ ContentSlide{} _ _)            -> content\n        (Slide _ TwoColumnSlide{} _ _)          -> twoColumn\n        (Slide _ ComparisonSlide{} _ _)         -> comparison\n        (Slide _ ContentWithCaptionSlide{} _ _) -> contentWithCaption\n        (Slide _ BlankSlide _ _)                -> blank\n\n  speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide\n\n  linkIds <- gets stLinkIds\n  mediaIds <- gets stMediaIds\n\n  linkRels <- case M.lookup idNum linkIds of\n                Just mp -> linkRelElements mp\n                Nothing -> return []\n  let mediaRels = case M.lookup idNum mediaIds of\n                   Just mInfos -> map mediaRelElement mInfos\n                   Nothing -> []\n\n  return $\n    mknode \"Relationships\"\n    [(\"xmlns\", \"http://schemas.openxmlformats.org/package/2006/relationships\")]\n    ([mknode \"Relationship\" [ (\"Id\", \"rId1\")\n                           , (\"Type\", \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\")\n                           , (\"Target\", target)] ()\n    ] <> speakerNotesRels <> linkRels <> mediaRels)\n\nslideToSldIdElement ::\n  PandocMonad m =>\n  MinimumRId ->\n  Slide ->\n  P m Element\nslideToSldIdElement minimumSlideRId slide = do\n  n <- slideNum slide\n  let id' = tshow $ n + 255\n  rId <- slideToRelId minimumSlideRId slide\n  return $ mknode \"p:sldId\" [(\"id\", id'), (\"r:id\", rId)] ()\n\npresentationToSldIdLst ::\n  PandocMonad m =>\n  MinimumRId ->\n  Presentation ->\n  P m Element\npresentationToSldIdLst minimumSlideRId (Presentation _ slides) = do\n  ids <- mapM (slideToSldIdElement minimumSlideRId) slides\n  return $ mkNodeSldIdLst ids\n\nmkNodeSldIdLst :: [Element] -> Element\nmkNodeSldIdLst = mknode \"p:sldIdLst\" []\n\npresentationToPresentationElement ::\n  PandocMonad m =>\n  PresentationRIdUpdateData ->\n  Presentation ->\n  P m Element\npresentationToPresentationElement presentationUpdateRIdData pres = do\n  let (_, (minSlideRId, maxSlideRId)) = presentationUpdateRIdData\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  element <- parseXml refArchive distArchive \"ppt/presentation.xml\"\n  sldIdLst <- presentationToSldIdLst minSlideRId pres\n\n  let modifySldIdLst :: Content -> Content\n      modifySldIdLst ct = if isSldIdLst ct\n                          then Elem sldIdLst\n                          else ct\n\n      notesMasterRId = maxSlideRId\n\n      notesMasterElem =  mknode \"p:notesMasterIdLst\" []\n                         [ mknode\n                           \"p:notesMasterId\"\n                           [(\"r:id\", \"rId\" <> tshow notesMasterRId)]\n                           ()\n                         ]\n\n      -- if there's a notesMasterIdLst in the presentation.xml file,\n      -- we want to remove it. We then want to put our own, if\n      -- necessary, after the slideMasterIdLst element. We also remove\n      -- handouts master, since we don't want it.\n\n      removeUnwantedMaster' :: Content -> [Content]\n      removeUnwantedMaster' (Elem e) = case elName e of\n        (QName \"notesMasterIdLst\" _ _) -> []\n        (QName \"handoutMasterIdLst\" _ _) -> []\n        _                              -> [Elem e]\n      removeUnwantedMaster' ct = [ct]\n\n      removeUnwantedMaster :: [Content] -> [Content]\n      removeUnwantedMaster = concatMap removeUnwantedMaster'\n\n      insertNotesMaster :: [Content] -> [Content]\n      insertNotesMaster = if presHasSpeakerNotes pres\n                          then insertAfterSldMasterIdLst notesMasterElem\n                          else id\n\n      updateRIds :: Content -> Content\n      updateRIds (Elem el) =\n        Elem (el { elAttribs = fmap updateRIdAttribute (elAttribs el)\n                 , elContent = fmap updateRIds (elContent el)\n                 })\n      updateRIds content = content\n\n      updateRIdAttribute :: XML.Attr -> XML.Attr\n      updateRIdAttribute attr = fromMaybe attr $ do\n        oldValue <- case attrKey attr of\n          QName \"id\" _ (Just \"r\") ->\n            T.stripPrefix \"rId\" (attrVal attr)\n            >>= fmap fromIntegral . readTextAsInteger\n          _ -> Nothing\n        let newValue = updatePresentationRId presentationUpdateRIdData oldValue\n        pure attr {attrVal = \"rId\" <> T.pack (show newValue)}\n\n      -- if there is no sldIdLst in the presentation.xml file, add an empty one\n      -- after the sldMasterIdLst so modifySldIdLst can replace it.\n\n      insertSldIdListIfMissing :: [Content] -> [Content]\n      insertSldIdListIfMissing contentList = if any isSldIdLst contentList\n                                             then contentList\n                                             else insertAfterSldMasterIdLst (mkNodeSldIdLst []) contentList\n\n      insertAfterSldMasterIdLst' :: Content -> Content -> [Content]\n      insertAfterSldMasterIdLst' newElement ct = if isElemName \"sldMasterIdLst\" ct\n                                                 then [ct, newElement]\n                                                 else [ct]\n\n      insertAfterSldMasterIdLst :: Element -> [Content] -> [Content]\n      insertAfterSldMasterIdLst newElement = concatMap $ insertAfterSldMasterIdLst' $ Elem newElement\n\n      isElemName :: T.Text -> Content -> Bool\n      isElemName name (Elem e) = qName (elName e) == name\n      isElemName _ _ = False\n\n      isSldIdLst :: Content -> Bool\n      isSldIdLst = isElemName \"sldIdLst\"\n\n      newContent = insertNotesMaster $\n                   removeUnwantedMaster $\n                   (modifySldIdLst . updateRIds) <$>\n                   insertSldIdListIfMissing (elContent element)\n\n  return $ element{elContent = newContent}\n\npresentationToPresEntry :: PandocMonad m => PresentationRIdUpdateData -> Presentation -> P m Entry\npresentationToPresEntry presentationRIdUpdateData pres =\n  presentationToPresentationElement presentationRIdUpdateData pres >>=\n    elemToEntry \"ppt/presentation.xml\"\n\n-- adapted from the Docx writer\ndocPropsElement :: PandocMonad m => DocProps -> P m Element\ndocPropsElement docProps = do\n  utctime <- asks envUTCTime\n  let keywords = case dcKeywords docProps of\n        Just xs -> T.intercalate \", \" xs\n        Nothing -> \"\"\n  return $\n    mknode \"cp:coreProperties\"\n    [(\"xmlns:cp\",\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\")\n    ,(\"xmlns:dc\",\"http://purl.org/dc/elements/1.1/\")\n    ,(\"xmlns:dcterms\",\"http://purl.org/dc/terms/\")\n    ,(\"xmlns:dcmitype\",\"http://purl.org/dc/dcmitype/\")\n    ,(\"xmlns:xsi\",\"http://www.w3.org/2001/XMLSchema-instance\")]\n    $\n      mknode \"dc:title\" [] (fromMaybe \"\" $ dcTitle docProps)\n    :\n      mknode \"dc:creator\" [] (fromMaybe \"\" $ dcCreator docProps)\n    :\n      mknode \"cp:keywords\" [] keywords\n    : ( [mknode \"dc:subject\" [] $ fromMaybe \"\" $ dcSubject docProps | isJust (dcSubject docProps)])\n    <> ( [mknode \"dc:description\" [] $ fromMaybe \"\" $ dcDescription docProps | isJust (dcDescription docProps)])\n    <> ( [mknode \"cp:category\" [] $ fromMaybe \"\" $ cpCategory docProps | isJust (cpCategory docProps)])\n    <> (\\x -> [ mknode \"dcterms:created\" [(\"xsi:type\",\"dcterms:W3CDTF\")] x\n              , mknode \"dcterms:modified\" [(\"xsi:type\",\"dcterms:W3CDTF\")] x\n              ]) (T.pack $ formatTime defaultTimeLocale \"%FT%XZ\" utctime)\n\ndocPropsToEntry :: PandocMonad m => DocProps -> P m Entry\ndocPropsToEntry docProps = docPropsElement docProps >>=\n                           elemToEntry \"docProps/core.xml\"\n\n-- adapted from the Docx writer\ndocCustomPropsElement :: PandocMonad m => DocProps -> P m Element\ndocCustomPropsElement docProps = do\n  let mkCustomProp (k, v) pid = mknode \"property\"\n         [(\"fmtid\",\"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}\")\n         ,(\"pid\", tshow pid)\n         ,(\"name\", k)] $ mknode \"vt:lpwstr\" [] v\n  return $ mknode \"Properties\"\n          [(\"xmlns\",\"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\")\n          ,(\"xmlns:vt\",\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\")\n          ] $ zipWith mkCustomProp (fromMaybe [] $ customProperties docProps) [(2 :: Int)..]\n\ndocCustomPropsToEntry :: PandocMonad m => DocProps -> P m Entry\ndocCustomPropsToEntry docProps = docCustomPropsElement docProps >>=\n                           elemToEntry \"docProps/custom.xml\"\n\n-- We read from the template, but we remove the lastView, so it always\n-- opens on slide view. Templates will sometimes be open in master\n-- view for editing.\nviewPropsElement :: PandocMonad m => P m Element\nviewPropsElement = do\n  refArchive <- asks envRefArchive\n  distArchive <- asks envDistArchive\n  viewPrElement <- parseXml refArchive distArchive \"ppt/viewProps.xml\"\n  -- remove  \"lastView\" if it exists:\n  let notLastView :: XML.Attr -> Bool\n      notLastView attr =\n          qName (attrKey attr) /= \"lastView\"\n  return $\n    viewPrElement {elAttribs = filter notLastView (elAttribs viewPrElement)}\n\nmakeViewPropsEntry :: PandocMonad m => P m Entry\nmakeViewPropsEntry = viewPropsElement >>= elemToEntry \"ppt/viewProps.xml\"\n\ndefaultContentTypeToElem :: DefaultContentType -> Element\ndefaultContentTypeToElem dct =\n  mknode \"Default\"\n  [(\"Extension\", defContentTypesExt dct),\n    (\"ContentType\", defContentTypesType dct)]\n  ()\n\noverrideContentTypeToElem :: OverrideContentType -> Element\noverrideContentTypeToElem oct =\n  mknode \"Override\"\n  [(\"PartName\", T.pack $ overrideContentTypesPart oct),\n   (\"ContentType\", overrideContentTypesType oct)]\n  ()\n\ncontentTypesToElement :: ContentTypes -> Element\ncontentTypesToElement ct =\n  let ns = \"http://schemas.openxmlformats.org/package/2006/content-types\"\n  in\n    mknode \"Types\" [(\"xmlns\", ns)] $\n\n      map defaultContentTypeToElem (contentTypesDefaults ct) <>\n      map overrideContentTypeToElem (contentTypesOverrides ct)\n\ndata DefaultContentType = DefaultContentType\n                           { defContentTypesExt :: T.Text\n                           , defContentTypesType:: MimeType\n                           }\n                         deriving (Show, Eq)\n\ndata OverrideContentType = OverrideContentType\n                           { overrideContentTypesPart :: FilePath\n                           , overrideContentTypesType :: MimeType\n                           }\n                          deriving (Show, Eq)\n\ndata ContentTypes = ContentTypes { contentTypesDefaults :: [DefaultContentType]\n                                 , contentTypesOverrides :: [OverrideContentType]\n                                 }\n                    deriving (Show, Eq)\n\ncontentTypesToEntry :: PandocMonad m => ContentTypes -> P m Entry\ncontentTypesToEntry ct = elemToEntry \"[Content_Types].xml\" $ contentTypesToElement ct\n\npathToOverride :: FilePath -> Maybe OverrideContentType\npathToOverride fp = OverrideContentType (\"/\" <> fp) <$> getContentType fp\n\nmediaFileContentType :: FilePath -> Maybe DefaultContentType\nmediaFileContentType fp = case takeExtension fp of\n  '.' : ext -> Just $\n               DefaultContentType { defContentTypesExt = T.pack ext\n                                  , defContentTypesType =\n                                      fromMaybe \"application/octet-stream\" (getMimeType fp)\n                                  }\n  _ -> Nothing\n\nmediaContentType :: MediaInfo -> Maybe DefaultContentType\nmediaContentType mInfo\n  | Just t <- mInfoExt mInfo\n  , Just ('.', ext) <- T.uncons t =\n      Just $ DefaultContentType { defContentTypesExt = ext\n                                , defContentTypesType =\n                                    fromMaybe \"application/octet-stream\" (mInfoMimeType mInfo)\n                                }\n  | otherwise = Nothing\n\ngetSpeakerNotesFilePaths :: PandocMonad m => P m [FilePath]\ngetSpeakerNotesFilePaths = do\n  mp <- asks envSpeakerNotesIdMap\n  let notesIdNums = M.elems mp\n  return $ map (\\n -> \"ppt/notesSlides/notesSlide\" <> show n <> \".xml\")\n               notesIdNums\n\npresentationToContentTypes :: PandocMonad m => Presentation -> P m ContentTypes\npresentationToContentTypes p@(Presentation _ slides) = do\n  mediaInfos <- mconcat . M.elems <$> gets stMediaIds\n  filePaths <- patternsToFilePaths $ inheritedPatterns p\n  let mediaFps = filter (match (compile \"ppt/media/image*\")) filePaths\n      fontFps = filter (match (compile \"ppt/fonts/*\")) filePaths\n  let defaults = [ DefaultContentType \"xml\" \"application/xml\"\n                 , DefaultContentType \"rels\" \"application/vnd.openxmlformats-package.relationships+xml\"\n                 ]\n      mediaDefaults = nub $\n                      mapMaybe mediaContentType mediaInfos <>\n                      mapMaybe mediaFileContentType mediaFps\n      fontDefaults = [ DefaultContentType \"fntdata\" \"application/x-fontdata\"\n                     | any (\\fp -> takeExtension fp == \".fntdata\") fontFps\n                     ]\n\n      inheritedOverrides = mapMaybe pathToOverride filePaths\n      createdOverrides = mapMaybe pathToOverride [ \"docProps/core.xml\"\n                                                 , \"docProps/custom.xml\"\n                                                 , \"ppt/presentation.xml\"\n                                                 , \"ppt/viewProps.xml\"\n                                                 ]\n  relativePaths <- mapM slideToFilePath slides\n  let slideOverrides = mapMaybe\n                       (\\fp -> pathToOverride $ \"ppt/slides/\" <> fp)\n                       relativePaths\n  speakerNotesOverrides <- mapMaybe pathToOverride <$> getSpeakerNotesFilePaths\n  return $ ContentTypes\n    (defaults <> mediaDefaults <> fontDefaults)\n    (inheritedOverrides <> createdOverrides <> slideOverrides <> speakerNotesOverrides)\n\npresML :: T.Text\npresML = \"application/vnd.openxmlformats-officedocument.presentationml\"\n\nnoPresML :: T.Text\nnoPresML = \"application/vnd.openxmlformats-officedocument\"\n\ngetContentType :: FilePath -> Maybe MimeType\ngetContentType fp\n  | fp == \"ppt/presentation.xml\" = Just $ presML <> \".presentation.main+xml\"\n  | fp == \"ppt/presProps.xml\" = Just $ presML <> \".presProps+xml\"\n  | fp == \"ppt/viewProps.xml\" = Just $ presML <> \".viewProps+xml\"\n  | fp == \"ppt/tableStyles.xml\" = Just $ presML <> \".tableStyles+xml\"\n  | fp == \"docProps/core.xml\" = Just \"application/vnd.openxmlformats-package.core-properties+xml\"\n  | fp == \"docProps/custom.xml\" = Just \"application/vnd.openxmlformats-officedocument.custom-properties+xml\"\n  | fp == \"docProps/app.xml\" = Just $ noPresML <> \".extended-properties+xml\"\n  | [\"ppt\", \"slideMasters\", f] <- splitDirectories fp\n  , (_, \".xml\") <- splitExtension f =\n      Just $ presML <> \".slideMaster+xml\"\n  | [\"ppt\", \"slides\", f] <- splitDirectories fp\n  , (_, \".xml\") <- splitExtension f =\n      Just $ presML <> \".slide+xml\"\n  | [\"ppt\", \"notesMasters\", f] <- splitDirectories fp\n  , (_, \".xml\") <- splitExtension f =\n      Just $ presML <> \".notesMaster+xml\"\n  | [\"ppt\", \"notesSlides\", f] <- splitDirectories fp\n  , (_, \".xml\") <- splitExtension f =\n      Just $ presML <> \".notesSlide+xml\"\n  | [\"ppt\", \"theme\", f] <- splitDirectories fp\n  , (_, \".xml\") <- splitExtension f =\n      Just $ noPresML <> \".theme+xml\"\n  | [\"ppt\", \"slideLayouts\", _] <- splitDirectories fp=\n      Just $ presML <> \".slideLayout+xml\"\n  | otherwise = Nothing\n\n-- Kept as String for XML.Light\nautoNumAttrs :: ListAttributes -> [(Text, Text)]\nautoNumAttrs (startNum, numStyle, numDelim) =\n  numAttr <> typeAttr\n  where\n    numAttr = [(\"startAt\", tshow startNum) | startNum /= 1]\n    typeAttr = [(\"type\", typeString <> delimString)]\n    typeString = case numStyle of\n      Decimal -> \"arabic\"\n      UpperAlpha -> \"alphaUc\"\n      LowerAlpha -> \"alphaLc\"\n      UpperRoman -> \"romanUc\"\n      LowerRoman -> \"romanLc\"\n      _          -> \"arabic\"\n    delimString = case numDelim of\n      Period -> \"Period\"\n      OneParen -> \"ParenR\"\n      TwoParens -> \"ParenBoth\"\n      _         -> \"Period\"\n\n-- | The XML required to insert an \"appear\" animation for each of the given\n-- groups of paragraphs, identified by index.\nincrementalAnimation ::\n  -- | (ShapeId, [(startParagraphIndex, endParagraphIndex)])\n  NonEmpty (ShapeId, NonEmpty (Integer, Integer)) ->\n  Element\nincrementalAnimation indices = mknode \"p:timing\" [] [tnLst, bldLst]\n  where\n    triples :: NonEmpty (ShapeId, Integer, Integer)\n    triples = do\n      (shapeId, paragraphIds) <- indices\n      (start, end) <- paragraphIds\n      pure (shapeId, start, end)\n\n    tnLst = mknode \"p:tnLst\" []\n      $ mknode \"p:par\" []\n      $ mknode \"p:cTn\" [ (\"id\", \"1\")\n                       , (\"dur\", \"indefinite\")\n                       , (\"restart\", \"never\")\n                       , (\"nodeType\", \"tmRoot\")\n                       ]\n      $ mknode \"p:childTnLst\" []\n      $ mknode \"p:seq\" [ (\"concurrent\", \"1\")\n                       , (\"nextAc\", \"seek\")\n                       ]\n      [ mknode \"p:cTn\" [ (\"id\", \"2\")\n                       , (\"dur\", \"indefinite\")\n                       , (\"nodeType\", \"mainSeq\")\n                       ]\n        $ mknode \"p:childTnLst\" []\n        $ zipWith makePar [3, 7 ..] (toList triples)\n      , mknode \"p:prevCondLst\" []\n        $ mknode \"p:cond\" ([(\"evt\", \"onPrev\"), (\"delay\", \"0\")])\n        $ mknode \"p:tgtEl\" []\n        $ mknode \"p:sldTgt\" [] ()\n      , mknode \"p:nextCondLst\" []\n        $ mknode \"p:cond\" ([(\"evt\", \"onNext\"), (\"delay\", \"0\")])\n        $ mknode \"p:tgtEl\" []\n        $ mknode \"p:sldTgt\" [] ()\n      ]\n    bldLst = mknode \"p:bldLst\" []\n      [ mknode \"p:bldP\" [ (\"spid\", T.pack (show shapeId))\n                        , (\"grpId\", \"0\")\n                        , (\"uiExpand\", \"1\")\n                        , (\"build\", \"p\")\n                        ]\n        () | (shapeId, _) <- toList indices\n      ]\n\n    makePar :: Integer -> (ShapeId, Integer, Integer) -> Element\n    makePar nextId (shapeId, start, end) =\n      mknode \"p:par\" []\n        $ mknode \"p:cTn\" [(\"id\", T.pack (show nextId)), (\"fill\", \"hold\")]\n        [ mknode \"p:stCondLst\" []\n          $ mknode \"p:cond\" [(\"delay\", \"indefinite\")] ()\n        , mknode \"p:childTnLst\" []\n          $ mknode \"p:par\" []\n          $ mknode \"p:cTn\" [ (\"id\", T.pack (show (nextId + 1)))\n                           , (\"fill\", \"hold\")\n                           ]\n          [ mknode \"p:stCondLst\" []\n            $ mknode \"p:cond\" [(\"delay\", \"0\")] ()\n          , mknode \"p:childTnLst\" []\n            $ mknode \"p:par\" []\n            $ mknode \"p:cTn\" [ (\"id\", T.pack (show (nextId + 2)))\n                             , (\"presetID\", \"1\")\n                             , (\"presetClass\", \"entr\")\n                             , (\"presetSubtype\", \"0\")\n                             , (\"fill\", \"hold\")\n                             , (\"grpId\", \"0\")\n                             , (\"nodeType\", \"clickEffect\")\n                             ]\n            [ mknode \"p:stCondLst\" []\n              $ mknode \"p:cond\" [(\"delay\", \"0\")] ()\n            , mknode \"p:childTnLst\" []\n              $ mknode \"p:set\" []\n              [ mknode \"p:cBhvr\" []\n                [ mknode \"p:cTn\" [ (\"id\", T.pack (show (nextId + 3)))\n                                 , (\"dur\", \"1\")\n                                 , (\"fill\", \"hold\")\n                                 ]\n                  $ mknode \"p:stCondLst\" []\n                  $ mknode \"p:cond\" [(\"delay\", \"0\")] ()\n                , mknode \"p:tgtEl\" []\n                  $ mknode \"p:spTgt\" [(\"spid\", T.pack (show shapeId))]\n                  $ mknode \"p:txEl\" []\n                  $ mknode \"p:pRg\" [ (\"st\", T.pack (show start))\n                                   , (\"end\", T.pack (show end))]\n                    ()\n                , mknode \"p:attrNameLst\" []\n                  $ mknode \"p:attrName\" [] (\"style.visibility\" :: Text)\n                ]\n              , mknode \"p:to\" []\n                $ mknode \"p:strVal\" [(\"val\", \"visible\")] ()\n              ]\n            ]\n          ]\n        ]\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Powerpoint/Presentation.hs",
    "content": "{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE LambdaCase                 #-}\n{-# LANGUAGE MultiWayIf                 #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{-# LANGUAGE PatternGuards              #-}\n{-# LANGUAGE ViewPatterns               #-}\n{- |\n   Module      : Text.Pandoc.Writers.Powerpoint.Presentation\n   Copyright   : Copyright (C) 2017-2020 Jesse Rosenthal\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nDefinition of Presentation datatype, modeling a MS Powerpoint (pptx)\ndocument, and functions for converting a Pandoc document to\nPresentation.\n-}\n\nmodule Text.Pandoc.Writers.Powerpoint.Presentation ( documentToPresentation\n                                                   , Presentation(..)\n                                                   , DocProps(..)\n                                                   , Slide(..)\n                                                   , Layout(..)\n                                                   , SpeakerNotes(..)\n                                                   , SlideId(..)\n                                                   , Shape(..)\n                                                   , Graphic(..)\n                                                   , BulletType(..)\n                                                   , Algnment(..)\n                                                   , Paragraph(..)\n                                                   , ParaElem(..)\n                                                   , ParaProps(..)\n                                                   , RunProps(..)\n                                                   , TableProps(..)\n                                                   , Strikethrough(..)\n                                                   , Capitals(..)\n                                                   , Pixels\n                                                   , PicProps(..)\n                                                   , URL\n                                                   , TeXString(..)\n                                                   , LinkTarget(..)\n                                                   ) where\n\nimport Control.Monad\nimport Control.Monad.Reader\nimport Control.Monad.State\nimport Data.List (intercalate)\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Default\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Slides (getSlideLevel)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Walk\nimport qualified Text.Pandoc.Shared as Shared -- so we don't overlap \"Element\"\nimport Text.Pandoc.Shared (tshow)\nimport Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks\n                                 , lookupMetaString, toTableOfContents\n                                 , toLegacyTable)\nimport qualified Data.Map as M\nimport qualified Data.Set as S\nimport Data.Maybe (maybeToList, fromMaybe, listToMaybe, isNothing)\nimport Text.Pandoc.Highlighting\nimport qualified Data.Text as T\nimport Control.Applicative ((<|>))\nimport Skylighting\nimport Data.Bifunctor (bimap)\nimport Data.Char (isSpace)\n\ndata WriterEnv = WriterEnv { envMetadata :: Meta\n                           , envRunProps :: RunProps\n                           , envParaProps :: ParaProps\n                           , envSlideLevel :: Int\n                           , envOpts :: WriterOptions\n                           , envSlideHasHeader :: Bool\n                           , envInList :: Bool\n                           , envInNoteSlide :: Bool\n                           , envCurSlideId :: SlideId\n                           , envInSpeakerNotes :: Bool\n                           , envInIncrementalDiv :: Maybe InIncrementalDiv\n                           , envInListInBlockQuote :: Bool\n                           }\n                 deriving (Show)\n\ninstance Default WriterEnv where\n  def = WriterEnv { envMetadata = mempty\n                  , envRunProps = def\n                  , envParaProps = def\n                  , envSlideLevel = 2\n                  , envOpts = def\n                  , envSlideHasHeader = False\n                  , envInList = False\n                  , envInNoteSlide = False\n                  , envCurSlideId = SlideId \"Default\"\n                  , envInSpeakerNotes = False\n                  , envInIncrementalDiv = Nothing\n                  , envInListInBlockQuote = False\n                  }\n\n\ndata WriterState = WriterState { stNoteIds :: M.Map Int [Block]\n                               -- associate anchors with slide id\n                               , stAnchorMap :: M.Map T.Text SlideId\n                               , stSlideIdSet :: S.Set SlideId\n                               , stLog :: [LogMessage]\n                               , stSpeakerNotes :: SpeakerNotes\n                               } deriving (Show, Eq)\n\ninstance Default WriterState where\n  def = WriterState { stNoteIds = mempty\n                    , stAnchorMap = mempty\n                    -- we reserve this s\n                    , stSlideIdSet = reservedSlideIds\n                    , stLog = []\n                    , stSpeakerNotes = mempty\n                    }\n\ndata InIncrementalDiv\n  = InIncremental\n  -- ^ The current content is contained within an \"incremental\" div.\n  | InNonIncremental\n  -- ^ The current content is contained within a \"nonincremental\" div.\n  deriving (Show)\n\nlistShouldBeIncremental :: Pres Bool\nlistShouldBeIncremental = do\n  incrementalOption <- asks (writerIncremental . envOpts)\n  inIncrementalDiv <- asks envInIncrementalDiv\n  inBlockQuote <- asks envInListInBlockQuote\n  let toBoolean = (\\case InIncremental -> True\n                         InNonIncremental -> False)\n      maybeInvert = if inBlockQuote then not else id\n  pure (maybeInvert (maybe incrementalOption toBoolean inIncrementalDiv))\n\nmetadataSlideId :: SlideId\nmetadataSlideId = SlideId \"Metadata\"\n\ntocSlideId :: SlideId\ntocSlideId = SlideId \"TOC\"\n\nendNotesSlideId :: SlideId\nendNotesSlideId = SlideId \"EndNotes\"\n\nreservedSlideIds :: S.Set SlideId\nreservedSlideIds = S.fromList [ metadataSlideId\n                              , tocSlideId\n                              , endNotesSlideId\n                              ]\n\nuniqueSlideId' :: Integer -> S.Set SlideId -> T.Text -> SlideId\nuniqueSlideId' n idSet s =\n  let s' = if n == 0 then s else s <> \"-\" <> tshow n\n  in if SlideId s' `S.member` idSet\n     then uniqueSlideId' (n+1) idSet s\n     else SlideId s'\n\nuniqueSlideId :: S.Set SlideId -> T.Text -> SlideId\nuniqueSlideId = uniqueSlideId' 0\n\nrunUniqueSlideId :: T.Text -> Pres SlideId\nrunUniqueSlideId s = do\n  idSet <- gets stSlideIdSet\n  let sldId = uniqueSlideId idSet s\n  modify $ \\st -> st{stSlideIdSet = S.insert sldId idSet}\n  return sldId\n\naddLogMessage :: LogMessage -> Pres ()\naddLogMessage msg = modify $ \\st -> st{stLog = msg : stLog st}\n\ntype Pres = ReaderT WriterEnv (State WriterState)\n\nrunPres :: WriterEnv -> WriterState -> Pres a -> (a, [LogMessage])\nrunPres env st p = (pres, reverse $ stLog finalSt)\n  where (pres, finalSt) = runState (runReaderT p env) st\n\ntype Pixels = Integer\n\ndata Presentation = Presentation DocProps [Slide]\n  deriving (Show)\n\ndata DocProps = DocProps { dcTitle :: Maybe T.Text\n                         , dcSubject :: Maybe T.Text\n                         , dcCreator :: Maybe T.Text\n                         , dcKeywords :: Maybe [T.Text]\n                         , dcDescription :: Maybe T.Text\n                         , cpCategory :: Maybe T.Text\n                         , dcDate :: Maybe T.Text\n                         , customProperties :: Maybe [(T.Text, T.Text)]\n                         } deriving (Show, Eq)\n\n\ndata Slide = Slide { slideId :: SlideId\n                   , slideLayout :: Layout\n                   , slideSpeakerNotes :: SpeakerNotes\n                   , slideBackgroundImage :: Maybe FilePath\n                   } deriving (Show, Eq)\n\nnewtype SlideId = SlideId T.Text\n  deriving (Show, Eq, Ord)\n\n-- In theory you could have anything on a notes slide but it seems\n-- designed mainly for one textbox, so we'll just put in the contents\n-- of that textbox, to avoid other shapes that won't work as well.\nnewtype SpeakerNotes = SpeakerNotes {fromSpeakerNotes :: [Paragraph]}\n  deriving (Show, Eq, Monoid, Semigroup)\n\ndata Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem]\n            --              title      subtitle   authors      date\n            | TitleSlide [ParaElem]\n            --           heading\n            | ContentSlide [ParaElem] [Shape]\n            --             heading    content\n            | TwoColumnSlide [ParaElem] [Shape] [Shape]\n            --               heading    left    right\n            | ComparisonSlide [ParaElem] ([Shape], [Shape]) ([Shape], [Shape])\n            --                heading  left@(text, content) right@(text, content)\n            | ContentWithCaptionSlide [ParaElem] [Shape] [Shape]\n            --                        heading     text    content\n            | BlankSlide\n            deriving (Show, Eq)\n\ndata Shape = Pic PicProps FilePath T.Text [ParaElem]\n           --                      title  alt-text\n           | GraphicFrame [Graphic] [ParaElem]\n           | TextBox [Paragraph]\n           | RawOOXMLShape T.Text\n  deriving (Show, Eq)\n\ntype TableCell = [Paragraph]\n\n-- TODO: remove when better handling of new\n-- tables is implemented\ntype SimpleCell = [Block]\n\ndata TableProps = TableProps { tblPrFirstRow :: Bool\n                             , tblPrBandRow :: Bool\n                             } deriving (Show, Eq)\n\ndata Graphic = Tbl [Double] TableProps [TableCell] [[TableCell]]\n  deriving (Show, Eq)\n\n\ndata Paragraph = Paragraph { paraProps :: ParaProps\n                           , paraElems :: [ParaElem]\n                           } deriving (Show, Eq)\n\ndata BulletType = Bullet\n                | AutoNumbering ListAttributes\n  deriving (Show, Eq)\n\ndata Algnment = AlgnLeft | AlgnRight | AlgnCenter\n  deriving (Show, Eq)\n\ndata ParaProps = ParaProps { pPropMarginLeft :: Maybe Pixels\n                           , pPropMarginRight :: Maybe Pixels\n                           , pPropLevel :: Int\n                           , pPropBullet :: Maybe BulletType\n                           , pPropAlign :: Maybe Algnment\n                           , pPropSpaceBefore :: Maybe Pixels\n                           , pPropIndent :: Maybe Pixels\n                           , pPropIncremental :: Bool\n                           } deriving (Show, Eq)\n\ninstance Default ParaProps where\n  def = ParaProps { pPropMarginLeft = Just 0\n                  , pPropMarginRight = Just 0\n                  , pPropLevel = 0\n                  , pPropBullet = Nothing\n                  , pPropAlign = Nothing\n                  , pPropSpaceBefore = Nothing\n                  , pPropIndent = Just 0\n                  , pPropIncremental = False\n                  }\n\nnewtype TeXString = TeXString {unTeXString :: T.Text}\n  deriving (Eq, Show)\n\ndata ParaElem = Break\n              | Run RunProps T.Text\n              -- It would be more elegant to have native TeXMath\n              -- Expressions here, but this allows us to use\n              -- `convertmath` from T.P.Writers.Math. Will perhaps\n              -- revisit in the future.\n              | MathElem MathType TeXString\n              | RawOOXMLParaElem T.Text\n              deriving (Show, Eq)\n\ndata Strikethrough = NoStrike | SingleStrike | DoubleStrike\n  deriving (Show, Eq)\n\ndata Capitals = NoCapitals | SmallCapitals | AllCapitals\n  deriving (Show, Eq)\n\ntype URL = T.Text\n\ndata LinkTarget = ExternalTarget (URL, T.Text)\n                | InternalTarget SlideId\n                deriving (Show, Eq)\n\ndata RunProps = RunProps { rPropBold :: Bool\n                         , rPropItalics :: Bool\n                         , rStrikethrough :: Maybe Strikethrough\n                         , rBaseline :: Maybe Int\n                         , rCap :: Maybe Capitals\n                         , rLink :: Maybe LinkTarget\n                         , rPropCode :: Bool\n                         , rPropBlockQuote :: Bool\n                         , rPropForceSize :: Maybe Pixels\n                         , rSolidFill :: Maybe Color\n                         -- TODO: Make a full underline data type with\n                         -- the different options.\n                         , rPropUnderline :: Bool\n                         } deriving (Show, Eq)\n\ninstance Default RunProps where\n  def = RunProps { rPropBold = False\n                 , rPropItalics = False\n                 , rStrikethrough = Nothing\n                 , rBaseline = Nothing\n                 , rCap = Nothing\n                 , rLink = Nothing\n                 , rPropCode = False\n                 , rPropBlockQuote = False\n                 , rPropForceSize = Nothing\n                 , rSolidFill = Nothing\n                 , rPropUnderline = False\n                 }\n\ndata PicProps = PicProps { picPropLink :: Maybe LinkTarget\n                         , picWidth    :: Maybe Dimension\n                         , picHeight   :: Maybe Dimension\n                         } deriving (Show, Eq)\n\ninstance Default PicProps where\n  def = PicProps { picPropLink = Nothing\n                 , picWidth = Nothing\n                 , picHeight = Nothing\n                 }\n\n--------------------------------------------------\n\ninlinesToParElems :: [Inline] -> Pres [ParaElem]\ninlinesToParElems = fmap mconcat . mapM inlineToParElems\n\ninlineToParElems :: Inline -> Pres [ParaElem]\ninlineToParElems (Str s) = do\n  pr <- asks envRunProps\n  return [Run pr s]\ninlineToParElems (Emph ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rPropItalics=True}}) $\n  inlinesToParElems ils\ninlineToParElems (Underline ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rPropUnderline=True}}) $\n  inlinesToParElems ils\ninlineToParElems (Strong ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rPropBold=True}}) $\n  inlinesToParElems ils\ninlineToParElems (Strikeout ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rStrikethrough=Just SingleStrike}}) $\n  inlinesToParElems ils\ninlineToParElems (Superscript ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rBaseline=Just 30000}}) $\n  inlinesToParElems ils\ninlineToParElems (Subscript ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rBaseline=Just (-25000)}}) $\n  inlinesToParElems ils\ninlineToParElems (SmallCaps ils) =\n  local (\\r -> r{envRunProps = (envRunProps r){rCap = Just SmallCapitals}}) $\n  inlinesToParElems ils\ninlineToParElems Space = inlineToParElems (Str \" \")\ninlineToParElems SoftBreak = inlineToParElems (Str \" \")\ninlineToParElems LineBreak = return [Break]\ninlineToParElems (Link _ ils (url, title)) =\n  local (\\r ->r{envRunProps = (envRunProps r){rLink = Just $ ExternalTarget (url, title)}}) $\n  inlinesToParElems ils\ninlineToParElems (Code _ str) =\n  local (\\r ->r{envRunProps = (envRunProps r){rPropCode = True}}) $\n  inlineToParElems $ Str str\ninlineToParElems (Math mathtype str) =\n  return [MathElem mathtype (TeXString str)]\n-- We ignore notes if we're in a speaker notes div. Otherwise this\n-- would add an entry to the endnotes slide, which would put speaker\n-- notes in the public presentation. In the future, we can entertain a\n-- way of adding a speakernotes-specific note that would just add\n-- paragraphs to the bottom of the notes page.\ninlineToParElems (Note blks) = do\n  inSpNotes <- asks envInSpeakerNotes\n  if inSpNotes\n    then return []\n    else do\n    notes <- gets stNoteIds\n    let maxNoteId = maybe 0 maximum $ nonEmpty $ M.keys notes\n        curNoteId = maxNoteId + 1\n    modify $ \\st -> st { stNoteIds = M.insert curNoteId blks notes }\n    local (\\env -> env{envRunProps = (envRunProps env){rLink = Just $ InternalTarget endNotesSlideId}}) $\n      inlineToParElems $ Superscript [Str $ tshow curNoteId]\ninlineToParElems (Span _ ils) = inlinesToParElems ils\ninlineToParElems (Quoted quoteType ils) =\n  inlinesToParElems $ [Str open] ++ ils ++ [Str close]\n  where (open, close) = case quoteType of\n                          SingleQuote -> (\"\\x2018\", \"\\x2019\")\n                          DoubleQuote -> (\"\\x201C\", \"\\x201D\")\ninlineToParElems il@(RawInline fmt s) =\n  case fmt of\n    Format \"openxml\" -> return [RawOOXMLParaElem s]\n    _                -> do addLogMessage $ InlineNotRendered il\n                           return []\ninlineToParElems (Cite _ ils) = inlinesToParElems ils\n-- Note: we shouldn't reach this, because images should be handled at\n-- the shape level, but should that change in the future, we render\n-- the alt text.\ninlineToParElems (Image _ alt _) = inlinesToParElems alt\n\n\n\nisListType :: Block -> Bool\nisListType (OrderedList _ _) = True\nisListType (BulletList _) = True\nisListType (DefinitionList _) = True\nisListType _ = False\n\nregisterAnchorId :: T.Text -> Pres ()\nregisterAnchorId anchor = do\n  anchorMap <- gets stAnchorMap\n  sldId <- asks envCurSlideId\n  unless (T.null anchor) $\n    modify $ \\st -> st {stAnchorMap = M.insert anchor sldId anchorMap}\n\n-- Currently hardcoded, until I figure out how to make it dynamic.\nblockQuoteSize :: Pixels\nblockQuoteSize = 20\n\nnoteSize :: Pixels\nnoteSize = 18\n\nblockToParagraphs :: Block -> Pres [Paragraph]\nblockToParagraphs (Plain ils) = blockToParagraphs (Para ils)\nblockToParagraphs (Para ils) = do\n  parElems <- inlinesToParElems ils\n  pProps <- asks envParaProps\n  return [Paragraph pProps parElems]\nblockToParagraphs (LineBlock ilsList) = do\n  parElems <- inlinesToParElems $ intercalate [LineBreak] ilsList\n  pProps <- asks envParaProps\n  return [Paragraph pProps parElems]\n-- TODO: work out the attributes\nblockToParagraphs (CodeBlock attr str) = do\n  pProps <- asks envParaProps\n  local (\\r -> r{ envParaProps = def{ pPropMarginLeft = Nothing\n                                    , pPropBullet = Nothing\n                                    , pPropLevel = pPropLevel pProps\n                                    , pPropIndent = Just 0\n                                    }\n                , envRunProps = (envRunProps r){rPropCode = True}}) $ do\n    highlightOpt <- writerHighlightMethod <$> asks envOpts\n    synMap <- writerSyntaxMap <$> asks envOpts\n    let highlightWithStyle style = do\n          case highlight synMap (formatSourceLines style) attr str of\n            Right pElems -> do pPropsNew <- asks envParaProps\n                               return [Paragraph pPropsNew pElems]\n            Left _ -> blockToParagraphs $ Para [Str str]\n    case highlightOpt of\n      Skylighting sty -> highlightWithStyle sty\n      DefaultHighlighting -> highlightWithStyle defaultStyle\n      _ -> blockToParagraphs $ Para [Str str]\n-- We can't yet do incremental lists, but we should render a\n-- (BlockQuote List) as a list to maintain compatibility with other\n-- formats.\nblockToParagraphs (BlockQuote (blk : blks)) | isListType blk = do\n  ps  <- local (\\env -> env { envInListInBlockQuote = True })\n           (blockToParagraphs blk)\n  ps' <- blockToParagraphs $ BlockQuote blks\n  return $ ps ++ ps'\nblockToParagraphs (BlockQuote blks) =\n  local (\\r -> r{ envParaProps = (envParaProps r){ pPropMarginLeft = Just 100\n                                                 , pPropIndent = Just 0\n                                                 }\n                , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$\n  mconcat <$> mapM blockToParagraphs blks\n-- TODO: work out the format\nblockToParagraphs blk@(RawBlock _ _) = do addLogMessage $ BlockNotRendered blk\n                                          return []\nblockToParagraphs (Header _ (ident, _, _) ils) = do\n  -- Note that this function only deals with content blocks, so it\n  -- will only touch headers that are above the current slide level --\n  -- slides at or below the slidelevel will be taken care of by\n  -- `blocksToSlide'`. We have the register anchors in both of them.\n  registerAnchorId ident\n  -- we set the subeader to bold\n  parElems <- local (\\e->e{envRunProps = (envRunProps e){rPropBold=True}}) $\n              inlinesToParElems ils\n  -- and give it a bit of space before it.\n  return [Paragraph def{pPropSpaceBefore = Just 30} parElems]\nblockToParagraphs (BulletList blksLst) = do\n  pProps <- asks envParaProps\n  incremental <- listShouldBeIncremental\n  local (\\env -> env{ envInList = True\n                    , envParaProps = pProps{ pPropBullet = Just Bullet\n                                           , pPropMarginLeft = Nothing\n                                           , pPropIndent = Nothing\n                                           , pPropIncremental = incremental\n                                           }}) $\n    mconcat <$> mapM multiParList blksLst\nblockToParagraphs (OrderedList listAttr blksLst) = do\n  pProps <- asks envParaProps\n  incremental <- listShouldBeIncremental\n  local (\\env -> env{ envInList = True\n                    , envParaProps = pProps{ pPropBullet = Just (AutoNumbering listAttr)\n                                           , pPropMarginLeft = Nothing\n                                           , pPropIndent = Nothing\n                                           , pPropIncremental = incremental\n                                           }}) $\n    mconcat <$> mapM multiParList blksLst\nblockToParagraphs (DefinitionList entries) = do\n  incremental <- listShouldBeIncremental\n  let go :: ([Inline], [[Block]]) -> Pres [Paragraph]\n      go (ils, blksLst) = do\n        term <-blockToParagraphs $ Para [Strong ils]\n        -- For now, we'll treat each definition term as a\n        -- blockquote. We can extend this further later.\n        definition <-\n          mconcat <$> mapM (blockToParagraphs . BlockQuote) blksLst\n        return $ term ++ definition\n  local (\\env -> env {envParaProps =\n                       (envParaProps env) {pPropIncremental = incremental}})\n    $ mconcat <$> mapM go entries\nblockToParagraphs (Div (_, classes, _) blks) = let\n  hasIncremental = \"incremental\" `elem` classes\n  hasNonIncremental = \"nonincremental\" `elem` classes\n  incremental = if | hasIncremental -> Just InIncremental\n                   | hasNonIncremental -> Just InNonIncremental\n                   | otherwise -> Nothing\n  addIncremental env = env { envInIncrementalDiv = incremental }\n  in local addIncremental (mconcat <$> mapM blockToParagraphs blks)\nblockToParagraphs (Figure attr capt blks) = -- This never seems to be used:\n  blockToParagraphs (Shared.figureDiv attr capt blks)\nblockToParagraphs hr@HorizontalRule = notRendered hr\nblockToParagraphs tbl@Table{} = notRendered tbl\n\n-- | Report that a block cannot be rendered.\nnotRendered :: Block -> Pres [Paragraph]\nnotRendered blk = do\n  addLogMessage $ BlockNotRendered blk\n  return []\n\n-- | Make sure the bullet env gets turned off after the first para.\nmultiParList :: [Block] -> Pres [Paragraph]\nmultiParList [] = return []\nmultiParList (b:bs) = do\n  pProps <- asks envParaProps\n  p <- blockToParagraphs b\n  let level = pPropLevel pProps\n  ps <- local (\\env -> env\n                { envParaProps = pProps\n                  { pPropBullet = Nothing\n                  , pPropLevel = level + 1\n                  }\n                })\n        $ mconcat <$> mapM blockToParagraphs bs\n  return $ p ++ ps\n\ncellToParagraphs :: Alignment -> SimpleCell -> Pres [Paragraph]\ncellToParagraphs algn tblCell = do\n  paras <- mapM blockToParagraphs tblCell\n  let alignment = case algn of\n        AlignLeft -> Just AlgnLeft\n        AlignRight -> Just AlgnRight\n        AlignCenter -> Just AlgnCenter\n        AlignDefault -> Nothing\n      paras' = map (map (\\p -> p{paraProps = (paraProps p){pPropAlign = alignment}})) paras\n  return $ concat paras'\n\nrowToParagraphs :: [Alignment] -> [SimpleCell] -> Pres [[Paragraph]]\nrowToParagraphs algns tblCells = do\n  -- We have to make sure we have the right number of alignments\n  let pairs = zip (algns ++ repeat AlignDefault) tblCells\n  mapM (uncurry cellToParagraphs) pairs\n\nwithAttr :: Attr -> Shape -> Shape\nwithAttr attr (Pic picPr url title caption) =\n  let picPr' = picPr { picWidth = dimension Width attr\n                     , picHeight = dimension Height attr\n                     }\n  in\n    Pic picPr' url title caption\nwithAttr _ sp = sp\n\nblockToShape :: Block -> Pres Shape\nblockToShape (Plain ils) = blockToShape (Para ils)\nblockToShape (Para (il:_))  | Image attr ils (url, title) <- il =\n      withAttr attr . Pic def (T.unpack url) title <$> inlinesToParElems ils\nblockToShape (Para (il:_))  | Link _ (il':_) target <- il\n                            , Image attr ils (url, title) <- il' =\n      withAttr attr .\n      Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url) title\n      <$> inlinesToParElems ils\nblockToShape (Figure _figattr _caption [b]) = blockToShape b\nblockToShape (Table _ blkCapt specs thead tbody tfoot) = do\n  let (caption, algn, widths, hdrCells, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  caption' <- inlinesToParElems caption\n  hdrCells' <- rowToParagraphs algn hdrCells\n  rows' <- mapM (rowToParagraphs algn) rows\n  let tblPr = if null hdrCells\n              then TableProps { tblPrFirstRow = False\n                              , tblPrBandRow = True\n                              }\n              else TableProps { tblPrFirstRow = True\n                              , tblPrBandRow = True\n                              }\n\n  return $ GraphicFrame [Tbl widths tblPr hdrCells' rows'] caption'\n-- If the format isn't openxml, we fall through to blockToPargraphs\nblockToShape (RawBlock (Format \"openxml\") str) = return $ RawOOXMLShape str\nblockToShape blk = do paras <- blockToParagraphs blk\n                      let paras' = map (\\par -> par{paraElems = combineParaElems $ paraElems par}) paras\n                      return $ TextBox paras'\n\ncombineShapes :: [Shape] -> [Shape]\ncombineShapes [] = []\ncombineShapes (pic@Pic{} : ss) = pic : combineShapes ss\ncombineShapes (TextBox [] : ss) = combineShapes ss\ncombineShapes (s : TextBox [] : ss) = combineShapes (s : ss)\ncombineShapes (TextBox (p:ps) : TextBox (p':ps') : ss) =\n  combineShapes $ TextBox ((p:ps) ++ (p':ps')) : ss\ncombineShapes (s:ss) = s : combineShapes ss\n\nisNotesDiv :: Block -> Bool\nisNotesDiv (Div (_, [\"notes\"], _) _) = True\nisNotesDiv _ = False\n\nblocksToShapes :: [Block] -> Pres [Shape]\nblocksToShapes blks = combineShapes <$> mapM blockToShape blks\n\nisImage :: Inline -> Bool\nisImage Image{} = True\nisImage (Link _ (Image{} : _) _) = True\nisImage _ = False\n\nplainOrPara :: Block -> Maybe [Inline]\nplainOrPara (Plain ils) = Just ils\nplainOrPara (Para ils) = Just ils\nplainOrPara _ = Nothing\n\nnotText :: Block -> Bool\nnotText block | startsWithImage block = True\nnotText Table{} = True\nnotText Figure{} = True\nnotText _ = False\n\nstartsWithImage :: Block -> Bool\nstartsWithImage block = fromMaybe False $ do\n  inline <- plainOrPara block >>= listToMaybe\n  pure (isImage inline)\n\n-- | Group blocks into a number of \"splits\"\nsplitBlocks' ::\n  -- | Blocks so far in the current split\n  [Block] ->\n  -- | Splits so far\n  [[Block]] ->\n  -- | All remaining blocks\n  [Block] ->\n  Pres [[Block]]\nsplitBlocks' cur acc [] = return $ acc ++ ([cur | not (null cur)])\nsplitBlocks' cur acc (HorizontalRule : blks) =\n  splitBlocks' [] (acc ++ ([cur | not (null cur)])) blks\nsplitBlocks' cur acc (h@(Header n _ _) : blks) = do\n  slideLevel <- asks envSlideLevel\n  let (nts, blks') = span isNotesDiv blks\n  case compare n slideLevel of\n    LT -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [h : nts]) blks'\n    EQ -> splitBlocks' (h:nts) (acc ++ ([cur | not (null cur)])) blks'\n    GT -> splitBlocks' (cur ++ (h:nts)) acc blks'\n-- `blockToParagraphs` treats Plain and Para the same, so we can save\n-- some code duplication by treating them the same here.\nsplitBlocks' cur acc (Plain ils : blks) = splitBlocks' cur acc (Para ils : blks)\nsplitBlocks' cur acc (Para (il:ils) : blks) | isImage il = do\n  slideLevel <- asks envSlideLevel\n  let (nts, blks') = if null ils\n                     then span isNotesDiv blks\n                     else ([], blks)\n  case cur of\n    [Header n _ _] | n == slideLevel || slideLevel == 0 ->\n                            splitBlocks' []\n                            (acc ++ [cur ++ [Para [il]] ++ nts])\n                            (if null ils then blks' else Para ils : blks')\n    _ -> splitBlocks' []\n         (if any notText cur\n          then acc ++ ([cur | not (null cur)]) ++ [Para [il] : nts]\n          else acc ++ [cur ++ [Para [il]] ++ nts])\n         (if null ils then blks' else Para ils : blks')\nsplitBlocks' cur acc (tbl@Table{} : blks) = do\n  slideLevel <- asks envSlideLevel\n  let (nts, blks') = span isNotesDiv blks\n  case cur of\n    [Header n _ _] | n == slideLevel || slideLevel == 0 ->\n                            splitBlocks' [] (acc ++ [cur ++ [tbl] ++ nts]) blks'\n    _ -> splitBlocks' []\n         (if any notText cur\n          then acc ++ ([cur | not (null cur)]) ++ [tbl : nts]\n          else acc ++ ([cur ++ [tbl] ++ nts]))\n         blks'\nsplitBlocks' cur acc (d@(Div (_, classes, _) _): blks) | \"columns\" `elem` classes =  do\n  slideLevel <- asks envSlideLevel\n  let (nts, blks') = span isNotesDiv blks\n  case cur of\n    [Header n _ _] | n == slideLevel || slideLevel == 0 ->\n                            splitBlocks' [] (acc ++ [cur ++ [d] ++ nts]) blks'\n    _ ->  splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [d : nts]) blks'\nsplitBlocks' cur acc (blk : blks) = splitBlocks' (cur ++ [blk]) acc blks\n\nsplitBlocks :: [Block] -> Pres [[Block]]\nsplitBlocks = splitBlocks' [] []\n\n-- | Assuming the slide title is already handled, convert these blocks to the\n-- body content for the slide.\nbodyBlocksToSlide :: Int -> [Block] -> SpeakerNotes -> Pres Slide\nbodyBlocksToSlide _ (blk : blks) spkNotes\n  | Div (_, classes, _) divBlks <- blk\n  , \"columns\" `elem` classes\n  , Div (_, clsL, _) blksL : Div (_, clsR, _) blksR : remaining <- divBlks\n  , \"column\" `elem` clsL, \"column\" `elem` clsR = do\n      -- At least 2 column elements\n      mapM_ (addLogMessage . BlockNotRendered) (blks ++ remaining)\n      let mkTwoColumn left right = do\n            blksL' <- join . take 1 <$> splitBlocks left\n            blksR' <- join . take 1 <$> splitBlocks right\n            shapesL <- blocksToShapes blksL'\n            shapesR <- blocksToShapes blksR'\n            sldId <- asks envCurSlideId\n            return $ Slide\n              sldId\n              (TwoColumnSlide [] shapesL shapesR)\n              spkNotes\n              Nothing\n      let mkComparison blksL1  blksL2 blksR1 blksR2 = do\n            shapesL1 <- blocksToShapes blksL1\n            shapesL2 <- blocksToShapes blksL2\n            shapesR1 <- blocksToShapes blksR1\n            shapesR2 <- blocksToShapes blksR2\n            sldId <- asks envCurSlideId\n            return $ Slide\n              sldId\n              (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2))\n              spkNotes\n              Nothing\n      let (blksL1, blksL2) = break notText blksL\n          (blksR1, blksR2) = break notText blksR\n      if (any null [blksL1, blksL2]) && (any null [blksR1, blksR2])\n      then mkTwoColumn blksL blksR\n      else mkComparison blksL1 blksL2 blksR1 blksR2\n  | Div (_, classes, _) divBlks <- blk\n  , \"columns\" `elem` classes\n  , Div (_, cls, _) columnBlks : remaining <- divBlks\n  , \"column\" `elem` cls = do\n      -- Only 1 column element.\n      mapM_ (addLogMessage . BlockNotRendered) (blks ++ remaining)\n      clBlks' <- join . take 1 <$> splitBlocks columnBlks\n      shapes <- blocksToShapes clBlks'\n      sldId <- asks envCurSlideId\n      return $ Slide sldId (ContentSlide [] shapes) spkNotes Nothing\nbodyBlocksToSlide _ (blk : blks) spkNotes = do\n      sldId <- asks envCurSlideId\n      inNoteSlide <- asks envInNoteSlide\n      let mkSlide s =\n            Slide sldId s spkNotes Nothing\n      if inNoteSlide\n      then mkSlide . ContentSlide [] <$>\n          forceFontSize noteSize (blocksToShapes (blk : blks))\n      else let\n        contentOrBlankSlide =\n          if makesBlankSlide (blk : blks)\n          then pure (mkSlide BlankSlide)\n          else mkSlide . ContentSlide [] <$> blocksToShapes (blk : blks)\n        in case break notText (blk : blks) of\n          ([], _) -> contentOrBlankSlide\n          (_, []) -> contentOrBlankSlide\n          (textBlocks, contentBlocks) -> do\n            textShapes <- blocksToShapes textBlocks\n            contentShapes <- blocksToShapes contentBlocks\n            return (mkSlide (ContentWithCaptionSlide [] textShapes contentShapes))\nbodyBlocksToSlide _ [] spkNotes = do\n  sldId <- asks envCurSlideId\n  return $\n    Slide\n    sldId\n    BlankSlide\n    spkNotes\n    Nothing\n\nblocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide\nblocksToSlide' lvl (Header n (ident, _, attributes) ils : blks) spkNotes\n  | n < lvl = do\n      registerAnchorId ident\n      sldId <- asks envCurSlideId\n      hdr <- inlinesToParElems ils\n      return $ Slide sldId (TitleSlide hdr) spkNotes backgroundImage\n  | n == lvl || lvl == 0 = do\n      registerAnchorId ident\n      hdr <- inlinesToParElems ils\n      -- Now get the slide without the header, and then add the header\n      -- in.\n      slide <- bodyBlocksToSlide lvl blks spkNotes\n      let layout = case slideLayout slide of\n            ContentSlide _ cont          -> ContentSlide hdr cont\n            TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR\n            ComparisonSlide _ contL contR -> ComparisonSlide hdr contL contR\n            ContentWithCaptionSlide _ text content -> ContentWithCaptionSlide hdr text content\n            BlankSlide -> if all inlineIsBlank ils then BlankSlide else ContentSlide hdr []\n            layout'                     -> layout'\n      return $ slide{slideLayout = layout, slideBackgroundImage = backgroundImage}\n  where\n    backgroundImage = T.unpack <$> (lookup \"background-image\" attributes\n                                   <|> lookup \"data-background-image\" attributes)\nblocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes\n\nblockToSpeakerNotes :: Block -> Pres SpeakerNotes\nblockToSpeakerNotes (Div (_, [\"notes\"], _) blks) =\n  local (\\env -> env{envInSpeakerNotes=True}) $\n  SpeakerNotes . mconcat <$> mapM blockToParagraphs blks\nblockToSpeakerNotes _ = return mempty\n\nhandleSpeakerNotes :: Block -> Pres ()\nhandleSpeakerNotes blk = do\n  spNotes <- blockToSpeakerNotes blk\n  modify $ \\st -> st{stSpeakerNotes = stSpeakerNotes st <> spNotes}\n\nhandleAndFilterSpeakerNotes' :: [Block] -> Pres [Block]\nhandleAndFilterSpeakerNotes' blks = do\n  mapM_ handleSpeakerNotes blks\n  return $ filter (not . isNotesDiv) blks\n\nhandleAndFilterSpeakerNotes :: [Block] -> Pres ([Block], SpeakerNotes)\nhandleAndFilterSpeakerNotes blks = do\n  modify $ \\st -> st{stSpeakerNotes = mempty}\n  blks' <- walkM handleAndFilterSpeakerNotes' blks\n  spkNotes <- gets stSpeakerNotes\n  return (blks', spkNotes)\n\nblocksToSlide :: [Block] -> Pres Slide\nblocksToSlide blks = do\n  (blks', spkNotes) <- handleAndFilterSpeakerNotes blks\n  slideLevel <- asks envSlideLevel\n  blocksToSlide' slideLevel blks' spkNotes\n\nmakeNoteEntry :: (Int, [Block]) -> [Block]\nmakeNoteEntry (n, blks) =\n  let enum = Str (tshow n <> \".\")\n  in\n    case blks of\n      (Para ils : blks') -> Para (enum : Space : ils) : blks'\n      _ -> Para [enum] : blks\n\nforceFontSize :: Pixels -> Pres a -> Pres a\nforceFontSize px x = do\n  rpr <- asks envRunProps\n  local (\\r -> r {envRunProps = rpr{rPropForceSize = Just px}}) x\n\n-- We leave these as blocks because we will want to include them in\n-- the TOC.\nmakeEndNotesSlideBlocks :: Pres [Block]\nmakeEndNotesSlideBlocks = do\n  noteIds <- gets stNoteIds\n  slideLevel <- asks envSlideLevel\n  exts <- writerExtensions <$> asks envOpts\n  meta <- asks envMetadata\n  -- Get identifiers so we can give the notes section a unique ident.\n  anchorSet <- M.keysSet <$> gets stAnchorMap\n  if M.null noteIds\n    then return []\n    else let title = case lookupMetaInlines \"notes-title\" meta of\n                       [] -> [Str \"Notes\"]\n                       ls -> ls\n             ident = Shared.uniqueIdent exts title anchorSet\n             hdr = Header slideLevel (ident, [], []) title\n             blks = concatMap makeNoteEntry $\n                    M.toList noteIds\n         in return $ hdr : blks\n\ngetMetaSlide :: Pres (Maybe Slide)\ngetMetaSlide  = do\n  meta <- asks envMetadata\n  title <- inlinesToParElems $ docTitle meta\n  subtitle <- inlinesToParElems $ lookupMetaInlines \"subtitle\" meta\n  authors <- mapM inlinesToParElems $ docAuthors meta\n  date <- inlinesToParElems $ docDate meta\n  -- Get speaker notes from metadata \"notes\" field\n  let notesBlocks = lookupMetaBlocks \"notes\" meta\n  speakerNotes <- if null notesBlocks\n                  then return mempty\n                  else local (\\env -> env{envInSpeakerNotes=True}) $\n                       SpeakerNotes . mconcat <$> mapM blockToParagraphs notesBlocks\n  if null title && null subtitle && null authors && null date\n    then return Nothing\n    else return $\n         Just $\n         Slide\n         metadataSlideId\n         (MetadataSlide title subtitle authors date)\n         speakerNotes\n         Nothing\n\naddSpeakerNotesToMetaSlide :: Slide -> [Block] -> Pres (Slide, [Block])\naddSpeakerNotesToMetaSlide (Slide sldId layout@MetadataSlide{} spkNotes backgroundImage) blks =\n  do let (ntsBlks, blks') = span isNotesDiv blks\n     spkNotes' <- mconcat <$> mapM blockToSpeakerNotes ntsBlks\n     return (Slide sldId layout (spkNotes <> spkNotes') backgroundImage, blks')\naddSpeakerNotesToMetaSlide sld blks = return (sld, blks)\n\nmakeTOCSlide :: [Block] -> Pres Slide\nmakeTOCSlide blks = local (\\env -> env{envCurSlideId = tocSlideId}) $ do\n  opts <- asks envOpts\n  let contents = toTableOfContents opts blks\n  meta <- asks envMetadata\n  slideLevel <- asks envSlideLevel\n  let tocTitle = case lookupMetaInlines \"toc-title\" meta of\n                   [] -> [Str \"Table of Contents\"]\n                   ls -> ls\n      hdr = Header slideLevel nullAttr tocTitle\n  blocksToSlide [hdr, contents]\n\ncombineParaElems' :: Maybe ParaElem -> [ParaElem] -> [ParaElem]\ncombineParaElems' mbPElem [] = maybeToList mbPElem\ncombineParaElems' Nothing (pElem : pElems) =\n  combineParaElems' (Just pElem) pElems\ncombineParaElems' (Just pElem') (pElem : pElems)\n  | Run rPr' s' <- pElem'\n  , Run rPr s <- pElem\n  , rPr == rPr' =\n    combineParaElems' (Just $ Run rPr' $ s' <> s) pElems\n  | otherwise =\n    pElem' : combineParaElems' (Just pElem) pElems\n\ncombineParaElems :: [ParaElem] -> [ParaElem]\ncombineParaElems = combineParaElems' Nothing\n\napplyToParagraph :: Monad m => (ParaElem -> m ParaElem) -> Paragraph -> m Paragraph\napplyToParagraph f para = do\n  paraElems' <- mapM f $ paraElems para\n  return $ para {paraElems = paraElems'}\n\napplyToShape :: Monad m => (ParaElem -> m ParaElem) -> Shape -> m Shape\napplyToShape f (Pic pPr fp title pes) = Pic pPr fp title <$> mapM f pes\napplyToShape f (GraphicFrame gfx pes) = GraphicFrame gfx <$> mapM f pes\napplyToShape f (TextBox paras) = TextBox <$> mapM (applyToParagraph f) paras\napplyToShape _ (RawOOXMLShape str) = return $ RawOOXMLShape str\n\napplyToLayout :: Monad m => (ParaElem -> m ParaElem) -> Layout -> m Layout\napplyToLayout f (MetadataSlide title subtitle authors date) = do\n  title' <- mapM f title\n  subtitle' <- mapM f subtitle\n  authors' <- mapM (mapM f) authors\n  date' <- mapM f date\n  return $ MetadataSlide title' subtitle' authors' date'\napplyToLayout f (TitleSlide title) = TitleSlide <$> mapM f title\napplyToLayout f (ContentSlide hdr content) = do\n  hdr' <- mapM f hdr\n  content' <- mapM (applyToShape f) content\n  return $ ContentSlide hdr' content'\napplyToLayout f (TwoColumnSlide hdr contentL contentR) = do\n  hdr' <- mapM f hdr\n  contentL' <- mapM (applyToShape f) contentL\n  contentR' <- mapM (applyToShape f) contentR\n  return $ TwoColumnSlide hdr' contentL' contentR'\napplyToLayout f (ComparisonSlide hdr (contentL1, contentL2) (contentR1, contentR2)) = do\n  hdr' <- mapM f hdr\n  contentL1' <- mapM (applyToShape f) contentL1\n  contentL2' <- mapM (applyToShape f) contentL2\n  contentR1' <- mapM (applyToShape f) contentR1\n  contentR2' <- mapM (applyToShape f) contentR2\n  return $ ComparisonSlide hdr' (contentL1', contentL2') (contentR1', contentR2')\napplyToLayout f (ContentWithCaptionSlide hdr textShapes contentShapes) = do\n  hdr' <- mapM f hdr\n  textShapes' <- mapM (applyToShape f) textShapes\n  contentShapes' <- mapM (applyToShape f) contentShapes\n  return $ ContentWithCaptionSlide hdr' textShapes' contentShapes'\napplyToLayout _ BlankSlide = pure BlankSlide\n\napplyToSlide :: Monad m => (ParaElem -> m ParaElem) -> Slide -> m Slide\napplyToSlide f slide = do\n  layout' <- applyToLayout f $ slideLayout slide\n  let paras = fromSpeakerNotes $ slideSpeakerNotes slide\n  notes' <- SpeakerNotes <$> mapM (applyToParagraph f) paras\n  return slide{slideLayout = layout', slideSpeakerNotes = notes'}\n\nreplaceAnchor :: ParaElem -> Pres ParaElem\nreplaceAnchor (Run rProps s)\n  | Just (ExternalTarget (T.uncons -> Just ('#', anchor), _)) <- rLink rProps\n  = do\n      anchorMap <- gets stAnchorMap\n      -- If the anchor is not in the anchormap, we just remove the\n      -- link.\n      let rProps' = case M.lookup anchor anchorMap of\n                      Just n  -> rProps{rLink = Just $ InternalTarget n}\n                      Nothing -> rProps{rLink = Nothing}\n      return $ Run rProps' s\nreplaceAnchor pe = return pe\n\nemptyParaElem :: ParaElem -> Bool\nemptyParaElem (Run _ s) =\n  T.null $ Shared.trim s\nemptyParaElem (MathElem _ ts) =\n  T.null $ Shared.trim $ unTeXString ts\nemptyParaElem _ = False\n\nemptyParagraph :: Paragraph -> Bool\nemptyParagraph para = all emptyParaElem $ paraElems para\n\n\nemptyShape :: Shape -> Bool\nemptyShape (TextBox paras) = all emptyParagraph paras\nemptyShape _ = False\n\nemptyLayout :: Layout -> Bool\nemptyLayout layout = case layout of\n  MetadataSlide title subtitle authors date ->\n    all emptyParaElem title &&\n    all emptyParaElem subtitle &&\n    all (all emptyParaElem) authors &&\n    all emptyParaElem date\n  TitleSlide hdr -> all emptyParaElem hdr\n  ContentSlide hdr shapes ->\n    all emptyParaElem hdr &&\n    all emptyShape shapes\n  TwoColumnSlide hdr shapes1 shapes2 ->\n    all emptyParaElem hdr &&\n    all emptyShape shapes1 &&\n    all emptyShape shapes2\n  ComparisonSlide hdr (shapesL1, shapesL2) (shapesR1, shapesR2) ->\n    all emptyParaElem hdr &&\n    all emptyShape shapesL1 &&\n    all emptyShape shapesL2 &&\n    all emptyShape shapesR1 &&\n    all emptyShape shapesR2\n  ContentWithCaptionSlide hdr textShapes contentShapes ->\n    all emptyParaElem hdr &&\n    all emptyShape textShapes &&\n    all emptyShape contentShapes\n  BlankSlide -> False\n\n\nemptySlide :: Slide -> Bool\nemptySlide (Slide _ layout notes backgroundImage)\n  = (notes == mempty)\n  && emptyLayout layout\n  && isNothing backgroundImage\n\nmakesBlankSlide :: [Block] -> Bool\nmakesBlankSlide = all blockIsBlank\n\nblockIsBlank :: Block -> Bool\nblockIsBlank\n  = \\case\n      Plain ins -> all inlineIsBlank ins\n      Para ins -> all inlineIsBlank ins\n      LineBlock inss -> all (all inlineIsBlank) inss\n      CodeBlock _ txt -> textIsBlank txt\n      RawBlock _ txt -> textIsBlank txt\n      BlockQuote bls -> all blockIsBlank bls\n      OrderedList _ blss -> all (all blockIsBlank) blss\n      BulletList blss -> all (all blockIsBlank) blss\n      DefinitionList ds -> all (uncurry (&&) . bimap (all inlineIsBlank) (all (all blockIsBlank))) ds\n      Header _ _ ils -> all inlineIsBlank ils\n      HorizontalRule -> True\n      Figure _ _ bls -> all blockIsBlank bls\n      Table{} -> False\n      Div _ bls -> all blockIsBlank bls\n\ntextIsBlank :: T.Text -> Bool\ntextIsBlank = T.all isSpace\n\ninlineIsBlank :: Inline -> Bool\ninlineIsBlank\n  = \\case\n      (Str txt) -> textIsBlank txt\n      (Emph ins) -> all inlineIsBlank ins\n      (Underline ins) -> all inlineIsBlank ins\n      (Strong ins) -> all inlineIsBlank ins\n      (Strikeout ins) -> all inlineIsBlank ins\n      (Superscript ins) -> all inlineIsBlank ins\n      (Subscript ins) -> all inlineIsBlank ins\n      (SmallCaps ins) -> all inlineIsBlank ins\n      (Quoted _ ins) -> all inlineIsBlank ins\n      (Cite _ _) -> False\n      (Code _ txt) -> textIsBlank txt\n      Space -> True\n      SoftBreak -> True\n      LineBreak -> True\n      (Math _ txt) -> textIsBlank txt\n      (RawInline _ txt) -> textIsBlank txt\n      (Link _ ins (t1, t2)) -> all inlineIsBlank ins && textIsBlank t1 && textIsBlank t2\n      (Image _ ins (t1, t2)) -> all inlineIsBlank ins && textIsBlank t1 && textIsBlank t2\n      (Note bls) -> all blockIsBlank bls\n      (Span _ ins) -> all inlineIsBlank ins\n\nblocksToPresentationSlides :: [Block] -> Pres [Slide]\nblocksToPresentationSlides blks = do\n  opts <- asks envOpts\n  mbMetadataSlide <- getMetaSlide\n  -- if the metadata slide exists, we try to add any speakerNotes\n  -- which immediately follow it. We also convert from maybe to a\n  -- list, so that it will be able to add together more easily with\n  -- the other lists of slides.\n  (metadataslides, blks') <- case mbMetadataSlide of\n                                 Just sld ->\n                                   do (s, bs) <- addSpeakerNotesToMetaSlide sld blks\n                                      return ([s], bs)\n                                 Nothing -> return ([], blks)\n  -- As far as I can tell, if we want to have a variable-length toc in\n  -- the future, we'll have to make it twice. Once to get the length,\n  -- and a second time to include the notes slide. We can't make the\n  -- notes slide before the body slides because we need to know if\n  -- there are notes, and we can't make either before the toc slide,\n  -- because we need to know its length to get slide numbers right.\n  --\n  -- For now, though, since the TOC slide is only length 1, if it\n  -- exists, we'll just get the length, and then come back to make the\n  -- slide later\n  blksLst <- splitBlocks blks'\n  bodySlideIds <- mapM\n                  (\\n -> runUniqueSlideId $ \"BodySlide\" <> tshow n)\n                  (take (length blksLst) [1..] :: [Integer])\n  bodyslides <- mapM\n                (\\(bs, ident) ->\n                    local (\\st -> st{envCurSlideId = ident}) (blocksToSlide bs))\n                (zip blksLst bodySlideIds)\n  endNotesSlideBlocks <- makeEndNotesSlideBlocks\n  -- now we come back and make the real toc...\n  tocSlides <- if writerTableOfContents opts\n               then do toc <- makeTOCSlide $ blks' ++ endNotesSlideBlocks\n                       return [toc]\n               else return []\n  -- ... and the notes slide. We test to see if the blocks are empty,\n  -- because we don't want to make an empty slide.\n  endNotesSlides <- if null endNotesSlideBlocks\n                    then return []\n                    else do endNotesSlide <- local\n                              (\\env -> env { envCurSlideId = endNotesSlideId\n                                           , envInNoteSlide = True\n                                           })\n                              (blocksToSlide endNotesSlideBlocks)\n                            return [endNotesSlide]\n\n  let slides = metadataslides ++ tocSlides ++ bodyslides ++ endNotesSlides\n      slides' = filter (not . emptySlide) slides\n  mapM (applyToSlide replaceAnchor) slides'\n\nmetaToDocProps :: Meta -> DocProps\nmetaToDocProps meta =\n  let keywords = case lookupMeta \"keywords\" meta of\n                   Just (MetaList xs) -> Just $ map Shared.stringify xs\n                   _                  -> Nothing\n\n      authors = case map Shared.stringify $ docAuthors meta of\n                  [] -> Nothing\n                  ss -> Just $ T.intercalate \"; \" ss\n\n      description = case map Shared.stringify $ lookupMetaBlocks \"description\" meta of\n                  [] -> Nothing\n                  ss -> Just $ T.intercalate \"_x000d_\\n\" ss\n\n      customProperties' = case [(k, lookupMetaString k meta) | k <- M.keys (unMeta meta)\n                               , k `notElem` [\"title\", \"author\", \"keywords\", \"description\"\n                                             , \"subject\",\"lang\",\"category\"]] of\n                  [] -> Nothing\n                  ss -> Just ss\n  in\n    DocProps{ dcTitle = Shared.stringify <$> lookupMeta \"title\" meta\n            , dcSubject = Shared.stringify <$> lookupMeta \"subject\" meta\n            , dcCreator = authors\n            , dcKeywords = keywords\n            , dcDescription = description\n            , cpCategory = Shared.stringify <$> lookupMeta \"category\" meta\n            , dcDate =\n              let t = Shared.stringify (docDate meta)\n              in if T.null t\n                 then Nothing\n                 else Just t\n            , customProperties = customProperties'\n            }\n\ndocumentToPresentation :: WriterOptions\n                       -> Pandoc\n                       -> (Presentation, [LogMessage])\ndocumentToPresentation opts (Pandoc meta blks) =\n  let env = def { envOpts = opts\n                , envMetadata = meta\n                , envSlideLevel = fromMaybe (getSlideLevel blks) (writerSlideLevel opts)\n                }\n      (presSlides, msgs) = runPres env def $ blocksToPresentationSlides blks\n      docProps = metaToDocProps meta\n  in\n    (Presentation docProps presSlides, msgs)\n\n-- --------------------------------------------------------------\n\napplyTokStyToRunProps :: TokenStyle -> RunProps -> RunProps\napplyTokStyToRunProps tokSty rProps =\n  rProps{ rSolidFill     = tokenColor tokSty <|> rSolidFill rProps\n        , rPropBold      = tokenBold tokSty || rPropBold rProps\n        , rPropItalics   = tokenItalic tokSty || rPropItalics rProps\n        , rPropUnderline = tokenUnderline tokSty || rPropUnderline rProps\n        }\n\nformatToken :: Style -> Token -> ParaElem\nformatToken sty (tokType, txt) =\n  let rProps = def{rPropCode = True, rSolidFill = defaultColor sty}\n      rProps' = case M.lookup tokType (tokenStyles sty) of\n        Just tokSty -> applyTokStyToRunProps tokSty rProps\n        Nothing     -> rProps\n  in\n    Run rProps' txt\n\nformatSourceLine :: Style -> FormatOptions -> SourceLine -> [ParaElem]\nformatSourceLine sty _ srcLn = map (formatToken sty) srcLn\n\nformatSourceLines :: Style -> FormatOptions -> [SourceLine] -> [ParaElem]\nformatSourceLines sty opts srcLns = intercalate [Break] $\n                                    map (formatSourceLine sty opts) srcLns\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Powerpoint.hs",
    "content": "{- |\n   Module      : Text.Pandoc.Writers.Powerpoint\n   Copyright   : Copyright (C) 2017-2020 Jesse Rosenthal\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to powerpoint (pptx). -}\n\n{-\nThis is a wrapper around two modules:\n\n  - Text.Pandoc.Writers.Powerpoint.Presentation (which converts a\n    pandoc document into a Presentation datatype), and\n\n  - Text.Pandoc.Writers.Powerpoint.Output (which converts a\n    Presentation into a zip archive, which can be output).\n-}\n\nmodule Text.Pandoc.Writers.Powerpoint (writePowerpoint) where\n\nimport Codec.Archive.Zip\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Options (WriterOptions)\nimport Text.Pandoc.Writers.Shared (fixDisplayMath)\nimport Text.Pandoc.Writers.Powerpoint.Presentation (documentToPresentation)\nimport Text.Pandoc.Writers.Powerpoint.Output (presentationToArchive)\nimport qualified Data.ByteString.Lazy as BL\n\nwritePowerpoint :: (PandocMonad m)\n                => WriterOptions  -- ^ Writer options\n                -> Pandoc         -- ^ Document to convert\n                -> m BL.ByteString\nwritePowerpoint opts (Pandoc meta blks) = do\n  let blks' = walk fixDisplayMath blks\n  let (pres, logMsgs) = documentToPresentation opts (Pandoc meta blks')\n  mapM_ report logMsgs\n  archv <- presentationToArchive opts meta pres\n  return $ fromArchive archv\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/RST.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ViewPatterns      #-}\n{- |\n   Module      : Text.Pandoc.Writers.RST\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to reStructuredText.\n\nreStructuredText:  <http://docutils.sourceforge.net/rst.html>\n-}\nmodule Text.Pandoc.Writers.RST ( writeRST, flatten ) where\nimport Control.Monad.State.Strict ( StateT, gets, modify, evalStateT )\nimport Control.Monad (zipWithM, liftM)\nimport Data.Char (isSpace, generalCategory, isAscii, isAlphaNum,\n                  GeneralCategory(\n                        ClosePunctuation, OpenPunctuation, InitialQuote,\n                         FinalQuote, DashPunctuation, OtherPunctuation))\nimport Data.List (transpose, intersperse)\nimport qualified Data.List as L\nimport qualified Data.List.NonEmpty as NE\nimport Data.Maybe (fromMaybe)\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.Walk\nimport Safe (lastMay, headMay)\n\ntype Refs = [([Inline], Target)]\n\ndata WriterState =\n  WriterState { stNotes       :: [[Block]]\n              , stLinks       :: Refs\n              , stImages      :: [([Inline], (Attr, Text, Text, Maybe Text))]\n              , stHasMath     :: Bool\n              , stHasRawTeX   :: Bool\n              , stOptions     :: WriterOptions\n              , stTopLevel    :: Bool\n              , stImageId     :: Int\n              }\n\ntype RST = StateT WriterState\n\n-- | Convert Pandoc to RST.\nwriteRST :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteRST opts document = do\n  let st = WriterState { stNotes = [], stLinks = [],\n                         stImages = [], stHasMath = False,\n                         stHasRawTeX = False, stOptions = opts,\n                         stTopLevel = True, stImageId = 1 }\n  evalStateT (pandocToRST document) st\n\n-- | Return RST representation of document.\npandocToRST :: PandocMonad m => Pandoc -> RST m Text\npandocToRST (Pandoc meta blocks) = do\n  opts <- gets stOptions\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  let subtit = lookupMetaInlines \"subtitle\" meta\n  title <- titleToRST (docTitle meta) subtit\n  metadata <- metaToContext opts\n                blockListToRST\n                (fmap chomp . inlineListToRST)\n                meta\n  body <- blockListToRST' True $ case writerTemplate opts of\n                                      Just _  -> normalizeHeadings 1 blocks\n                                      Nothing -> blocks\n  notes <- gets (reverse . stNotes) >>= notesToRST\n  -- note that the notes may contain refs, so we do them first\n  refs <- gets (reverse . stLinks) >>= refsToRST\n  pics <- gets (reverse . stImages) >>= pictRefsToRST\n  hasMath <- gets stHasMath\n  rawTeX <- gets stHasRawTeX\n  let main = vsep [body, notes, refs, pics]\n  let context = defField \"body\" main\n              $ defField \"toc\" (writerTableOfContents opts)\n              $ defField \"toc-depth\" (tshow $ writerTOCDepth opts)\n              $ defField \"number-sections\" (writerNumberSections opts)\n              $ defField \"math\" hasMath\n              $ defField \"titleblock\" (render Nothing title :: Text)\n              $ defField \"math\" hasMath\n              $ defField \"rawtex\" rawTeX metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n  where\n    normalizeHeadings lev (Header l a i:bs) =\n      Header lev a i:normalizeHeadings (lev+1) cont ++ normalizeHeadings lev bs'\n      where (cont,bs') = break (headerLtEq l) bs\n            headerLtEq level (Header l' _ _) = l' <= level\n            headerLtEq _ _                   = False\n    normalizeHeadings lev (b:bs) = b:normalizeHeadings lev bs\n    normalizeHeadings _   []     = []\n\n-- | Return RST representation of reference key table.\nrefsToRST :: PandocMonad m => Refs -> RST m (Doc Text)\nrefsToRST refs =\n   vcat <$> mapM keyToRST refs\n\n-- | Return RST representation of a reference key.\nkeyToRST :: PandocMonad m => ([Inline], (Text, Text)) -> RST m (Doc Text)\nkeyToRST (label, (src, _)) = do\n  label' <- inlineListToRST label\n  let label'' = if (==':') `T.any` (render Nothing label' :: Text)\n                   then char '`' <> label' <> char '`'\n                   else label'\n  return $ nowrap $ \".. _\" <> label'' <> \": \" <> literal src\n\n-- | Return RST representation of notes.\nnotesToRST :: PandocMonad m => [[Block]] -> RST m (Doc Text)\nnotesToRST notes =\n   vsep <$> zipWithM noteToRST [1..] notes\n\n-- | Return RST representation of a note.\nnoteToRST :: PandocMonad m => Int -> [Block] -> RST m (Doc Text)\nnoteToRST num note = do\n  contents <- blockListToRST note\n  let marker = \".. [\" <> text (show num) <> \"]\"\n  return $ nowrap $ marker $$ nest 3 contents\n\n-- | Return RST representation of picture reference table.\npictRefsToRST :: PandocMonad m\n              => [([Inline], (Attr, Text, Text, Maybe Text))]\n              -> RST m (Doc Text)\npictRefsToRST refs =\n   vcat <$> mapM pictToRST refs\n\n-- | Return RST representation of a picture substitution reference.\npictToRST :: PandocMonad m\n          => ([Inline], (Attr, Text, Text, Maybe Text))\n          -> RST m (Doc Text)\npictToRST (label, (attr, src, _, mbtarget)) = do\n  label' <- inlineListToRST label\n  dims   <- imageDimsToRST attr\n  let (_, cls, _) = attr\n      classes = case cls of\n                   []               -> empty\n                   [\"align-top\"]    -> \":align: top\"\n                   [\"align-middle\"] -> \":align: middle\"\n                   [\"align-bottom\"] -> \":align: bottom\"\n                   [\"align-center\"] -> empty\n                   [\"align-right\"]  -> empty\n                   [\"align-left\"]   -> empty\n                   _                -> \":class: \" <> literal (T.unwords cls)\n  return $ nowrap\n         $ \".. |\" <> label' <> \"| image:: \" <> literal src $$ hang 3 empty (classes $$ dims)\n         $$ case mbtarget of\n                 Nothing -> empty\n                 Just t  -> \"   :target: \" <> literal t\n\n-- | Escape special characters for RST.\nescapeText :: WriterOptions -> Text -> Text\nescapeText opts t =\n  if T.any isSpecial t\n     then T.pack . escapeString' True . T.unpack $ t\n     else t -- optimization\n where\n  isSmart = isEnabled Ext_smart opts\n  isSpecial c = c == '\\\\' || c == '_' || c == '`' || c == '*' || c == '|'\n                || (isSmart && (c == '-' || c == '.' || c == '\"' || c == '\\''))\n  canFollowInlineMarkup c = c == '-' || c == '.' || c == ',' || c == ':'\n                    || c == ';' || c == '!' || c == '?' || c == '\\''\n                    || c == '\"' || c == ')' || c == ']' || c == '}'\n                    || c == '>' || isSpace c\n                    || (not (isAscii c) &&\n                        generalCategory c `elem`\n                        [OpenPunctuation, InitialQuote, FinalQuote,\n                         DashPunctuation, OtherPunctuation])\n  canPrecedeInlineMarkup c = c == '-' || c == ':' || c == '/' || c == '\\''\n                     || c == '\"' || c == '<' || c == '(' || c == '['\n                     || c == '{' || isSpace c\n                     || (not (isAscii c) &&\n                          generalCategory c `elem`\n                          [ClosePunctuation, InitialQuote, FinalQuote,\n                          DashPunctuation, OtherPunctuation])\n  escapeString' canStart cs =\n    case cs of\n      [] -> []\n      d:ds\n        | d == '\\\\'\n        -> '\\\\' : d : escapeString' False ds\n      '\\'':ds\n        | isSmart\n        -> '\\\\' : '\\'' : escapeString' True ds\n      '\"':ds\n        | isSmart\n        -> '\\\\' : '\"' : escapeString' True ds\n      '-':'-':ds\n        | isSmart\n        -> '\\\\' : '-' : escapeString' False ('-':ds)\n      '.':'.':'.':ds\n        | isSmart\n        -> '\\\\' : '.' : escapeString' False ('.':'.':ds)\n      [e]\n        | e == '*' || e == '_' || e == '|' || e == '`'\n        -> ['\\\\',e]\n      d:ds\n        | canPrecedeInlineMarkup d\n        -> d : escapeString' True ds\n      e:d:ds\n        | e == '*' || e == '_' || e == '|' || e == '`'\n        , (not canStart && canFollowInlineMarkup d)\n          || (canStart && not (isSpace d))\n        -> '\\\\' : e : escapeString' False (d:ds)\n      '_':d:ds\n        | not (isAlphaNum d)\n        -> '\\\\' : '_' : escapeString' False (d:ds)\n      d:ds -> d : escapeString' False ds\n\ntitleToRST :: PandocMonad m => [Inline] -> [Inline] -> RST m (Doc Text)\ntitleToRST [] _ = return empty\ntitleToRST tit subtit = do\n  title <- inlineListToRST tit\n  subtitle <- inlineListToRST subtit\n  return $ bordered title '=' $$ bordered subtitle '-'\n\nbordered :: Doc Text -> Char -> Doc Text\nbordered contents c =\n  if len > 0\n     then border $$ contents $$ border\n     else empty\n   where len = offset contents\n         border = literal (T.replicate len $ T.singleton c)\n\n-- | Convert Pandoc block element to RST.\nblockToRST :: PandocMonad m\n           => Block         -- ^ Block element\n           -> RST m (Doc Text)\nblockToRST (Div (\"\",[\"title\"],[]) _) = return empty\n  -- this is generated by the rst reader and can safely be\n  -- omitted when we're generating rst\nblockToRST (Div (ident,classes,_kvs) bs) = do\n  contents <- blockListToRST bs\n  let admonitions = [\"attention\",\"caution\",\"danger\",\"error\",\"hint\",\n                     \"important\",\"note\",\"tip\",\"warning\",\"admonition\"]\n  let admonition = case classes of\n                        (cl:_)\n                          | cl `elem` admonitions\n                          -> blankline <> \".. \" <> literal cl <> \"::\"\n                        cls -> blankline <> \".. container::\" <> space <>\n                                   literal (T.unwords (filter (/= \"container\") cls))\n  -- if contents start with block quote, we need to insert\n  -- an empty comment to fix the indentation point (#10236)\n  let contents' = case bs of\n                    BlockQuote{}:_-> \"..\" $+$ contents\n                    _ -> contents\n  return $ blankline $$\n           admonition $$\n           (if T.null ident\n               then blankline\n               else \"   :name: \" <> literal ident $$ blankline) $$\n           nest 3 contents' $$\n           blankline\nblockToRST (Plain inlines) = inlineListToRST inlines\nblockToRST (Para inlines)\n  | LineBreak `elem` inlines =\n      linesToLineBlock $ splitBy (==LineBreak) inlines\n  | otherwise = do\n      contents <- inlineListToRST inlines\n      return $ contents <> blankline\nblockToRST (LineBlock lns) =\n  linesToLineBlock lns\nblockToRST (RawBlock f@(Format f') str)\n  | f == \"rst\" = return $ literal str\n  | f == \"tex\" = blockToRST (RawBlock (Format \"latex\") str)\n  | otherwise  = return $ blankline <> \".. raw:: \" <>\n                    literal (T.toLower f') $+$\n                    nest 3 (literal str) $$ blankline\nblockToRST HorizontalRule =\n  return $ blankline $$ \"--------------\" $$ blankline\nblockToRST (Header level (name,classes,_) inlines) = do\n  contents <- inlineListToRST inlines\n  -- we calculate the id that would be used by auto_identifiers\n  -- so we know whether to print an explicit identifier\n  opts <- gets stOptions\n  let autoId = uniqueIdent (writerExtensions opts) inlines mempty\n  isTopLevel <- gets stTopLevel\n  if isTopLevel\n    then do\n          let headerChar = if level > 5 then ' ' else \"=-~^'\" !! (level - 1)\n          let border = literal $ T.replicate (offset contents) $ T.singleton headerChar\n          let anchor | T.null name || name == autoId = empty\n                     | otherwise = \".. _\" <>\n                                   (if T.any (==':') name ||\n                                        T.take 1 name == \"_\"\n                                       then \"`\" <> literal name <> \"`\"\n                                       else literal name) <>\n                                   \":\" $$ blankline\n          return $ nowrap $ anchor $$ contents $$ border $$ blankline\n    else do\n          let rub     = \"rubric:: \" <> contents\n          let name' | T.null name    = empty\n                    | otherwise      = \":name: \" <> literal name\n          let cls   | null classes   = empty\n                    | otherwise      = \":class: \" <> literal (T.unwords classes)\n          return $ nowrap $ hang 3 \".. \" (rub $$ name' $$ cls) $$ blankline\nblockToRST (CodeBlock (_,classes,kvs) str) = do\n  opts <- gets stOptions\n  let startnum = maybe \"\" (\\x -> \" \" <> literal x) $ lookup \"startFrom\" kvs\n  let numberlines = if \"numberLines\" `elem` classes\n                       then \"   :number-lines:\" <> startnum\n                       else empty\n  if \"haskell\" `elem` classes && \"literate\" `elem` classes &&\n                  isEnabled Ext_literate_haskell opts\n     then return $ prefixed \"> \" (literal str) $$ blankline\n     else return $\n          (case [c | c <- classes,\n                     c `notElem` [\"sourceCode\",\"literate\",\"numberLines\",\n                                  \"number-lines\",\"example\"]] of\n             []       -> \"::\"\n             (lang:_) -> (blankline <> \".. code:: \" <> literal lang) $$ numberlines)\n          $+$ nest 3 (literal str) $$ blankline\nblockToRST (BlockQuote blocks) = do\n  contents <- blockListToRST blocks\n  return $ nest 3 contents <> blankline\nblockToRST (Table _attrs blkCapt specs thead@(TableHead _ theadRows) tbody tfoot@(TableFoot _ tfootRows)) = do\n  let (caption, aligns, widths, headers, rows) =\n        toLegacyTable blkCapt specs thead tbody tfoot\n  caption' <- inlineListToRST caption\n  let blocksToDoc opts bs = do\n         oldOpts <- gets stOptions\n         modify $ \\st -> st{ stOptions = opts }\n         result <- blockListToRST bs\n         modify $ \\st -> st{ stOptions = oldOpts }\n         return result\n  opts <- gets stOptions\n  let specs' = map (\\(_,width) -> (AlignDefault, width)) specs\n      renderGrid = gridTable opts blocksToDoc specs' thead tbody tfoot\n      rowHasRowSpan (Row _ cells) = any cellHasRowSpan cells\n      cellHasRowSpan (Cell _ _ rowSpan _ _) = rowSpan > 1\n      isSimple = all (== 0) widths && length widths > 1 && not (any rowHasRowSpan $ theadRows ++ tableBodiesToRows tbody ++ tfootRows)\n      renderSimple = do\n        tbl' <- simpleTable opts blocksToDoc thead tbody tfoot\n        if offset tbl' > writerColumns opts\n          then renderGrid\n          else return tbl'\n      isList = writerListTables opts\n      renderList = tableToRSTList caption (map (const AlignDefault) aligns)\n                    widths headers rows\n      rendered\n        | isList    = renderList\n        | isSimple  = renderSimple\n        | otherwise = renderGrid\n  tbl <- rendered\n  return $ blankline $$\n           (if null caption || isList\n               then tbl\n               else (blankline <> \".. table:: \" <> caption') $$ blankline $$ nest 3 tbl) $$\n           blankline\nblockToRST (BulletList items) = do\n  contents <- mapM bulletListItemToRST items\n  -- ensure that sublists have preceding blank line\n  return $ blankline $$\n           (if isTightList items then vcat else vsep) contents $$\n           blankline\nblockToRST (OrderedList (start, style', delim) items) = do\n  let markers = if start == 1 && style' == DefaultStyle && delim == DefaultDelim\n                   then replicate (length items) \"#.\"\n                   else take (length items) $ orderedListMarkers\n                                              (start, style', delim)\n  let maxMarkerLength = maybe 0 maximum $ NE.nonEmpty $ map T.length markers\n  let markers' = map (\\m -> let s = maxMarkerLength - T.length m\n                            in  m <> T.replicate s \" \") markers\n  contents <- zipWithM orderedListItemToRST markers' items\n  -- ensure that sublists have preceding blank line\n  return $ blankline $$\n           (if isTightList items then vcat else vsep) contents $$\n           blankline\nblockToRST (DefinitionList items) = do\n  contents <- mapM definitionListItemToRST items\n  -- ensure that sublists have preceding blank line\n  return $ blankline $$ vcat contents $$ blankline\n\nblockToRST (Figure (ident, classes, _kvs)\n             (Caption _ longCapt) body) = do\n  let figure attr txt (src, tit) = do\n        description <- inlineListToRST txt\n        capt <- blockListToRST longCapt\n        dims <- imageDimsToRST attr\n        let fig = \"figure::\" <+> literal src\n            alt = if null txt\n                     then if T.null tit\n                              then empty\n                              else \":alt:\" <+> literal tit\n                     else \":alt:\" <+> description\n            name = if T.null ident\n                      then empty\n                      else \"name:\" <+> literal ident\n            (_,cls,_) = attr\n            align = case cls of\n                      []               -> empty\n                      [\"align-right\"]  -> \":align: right\"\n                      [\"align-left\"]   -> \":align: left\"\n                      [\"align-center\"] -> \":align: center\"\n                      _ -> \":figclass: \" <> literal (T.unwords cls)\n        return $ hang 3 \".. \" (fig $$ name $$ alt $$ align $$ dims $+$ capt)\n              $$ blankline\n  case body of\n    [Para  [Image attr txt tgt]] -> figure attr txt tgt\n    [Plain [Image attr txt tgt]] -> figure attr txt tgt\n    _ -> do\n      content <- blockListToRST body\n      return $ blankline $$ (\n        \".. container:: float\" <> space <>\n        literal (T.unwords (filter (/= \"container\") classes))) $$\n        (if T.null ident\n         then blankline\n         else \"   :name: \" <> literal ident $$ blankline) $$\n        nest 3 content $$\n        blankline\n\n-- | Convert bullet list item (list of blocks) to RST.\nbulletListItemToRST :: PandocMonad m => [Block] -> RST m (Doc Text)\nbulletListItemToRST items = do\n  contents <- blockListToRST items\n  -- if a list item starts with block quote, we need to insert\n  -- an empty comment to fix the indentation point (#10236)\n  let contents' = case items of\n                    BlockQuote{}:_-> \"..\" $+$ contents\n                    _ -> contents\n  return $ hang 2 \"- \" contents' $$\n      if null items || (endsWithPlain items && not (endsWithList items))\n         then cr\n         else blankline\n\n-- | Convert ordered list item (a list of blocks) to RST.\norderedListItemToRST :: PandocMonad m\n                     => Text   -- ^ marker for list item\n                     -> [Block]  -- ^ list item (list of blocks)\n                     -> RST m (Doc Text)\norderedListItemToRST marker items = do\n  contents <- blockListToRST items\n  let marker' = marker <> \" \"\n  -- if a list item starts with block quote, we need to insert\n  -- an empty comment to fix the indentation point (#10236)\n  let contents' = case items of\n                    BlockQuote{}:_-> \"..\" $+$ contents\n                    _ -> contents\n  return $ hang (T.length marker') (literal marker') contents' $$\n      if null items || (endsWithPlain items && not (endsWithList items))\n         then cr\n         else blankline\n\nendsWithList :: [Block] -> Bool\nendsWithList bs = case lastMay bs of\n                    Just (BulletList{}) -> True\n                    Just (OrderedList{}) -> True\n                    _ -> False\n\n-- | Convert definition list item (label, list of blocks) to RST.\ndefinitionListItemToRST :: PandocMonad m => ([Inline], [[Block]]) -> RST m (Doc Text)\ndefinitionListItemToRST (label, defs) = do\n  label' <- inlineListToRST label\n  contents <- liftM vcat $ mapM blockListToRST defs\n  -- if definition list starts with block quote, we need to insert\n  -- an empty comment to fix the indentation point (#10236)\n  let contents' = case defs of\n                    (BlockQuote{}:_):_ -> \"..\" $+$ contents\n                    _ -> contents\n  return $ nowrap label' $$ nest 3 (nestle contents') $$\n      if isTightList defs\n         then cr\n         else blankline\n\n-- | Format a list of lines as line block.\nlinesToLineBlock :: PandocMonad m => [[Inline]] -> RST m (Doc Text)\nlinesToLineBlock inlineLines = do\n  lns <- mapM inlineListToRST inlineLines\n  return $\n                      vcat (map (hang 2 (literal \"| \")) lns) <> blankline\n\n-- | Convert list of Pandoc block elements to RST.\nblockListToRST' :: PandocMonad m\n                => Bool\n                -> [Block]       -- ^ List of block elements\n                -> RST m (Doc Text)\nblockListToRST' topLevel blocks = do\n  -- insert comment between list and quoted blocks, see #4248 and #3675\n  let fixBlocks (b1:b2@(BlockQuote _):bs)\n        | toClose b1 = b1 : commentSep : b2 : fixBlocks bs\n        where\n          toClose Plain{}                  = False\n          toClose Header{}                 = False\n          toClose LineBlock{}              = False\n          toClose HorizontalRule           = False\n          toClose SimpleFigure{}           = True\n          toClose Para{}                   = False\n          toClose _                        = True\n          commentSep  = RawBlock \"rst\" \"..\\n\\n\"\n      fixBlocks (b:bs) = b : fixBlocks bs\n      fixBlocks [] = []\n  tl <- gets stTopLevel\n  modify (\\s->s{stTopLevel=topLevel})\n  res <- vcat `fmap` mapM blockToRST (fixBlocks blocks)\n  modify (\\s->s{stTopLevel=tl})\n  return res\n\nblockListToRST :: PandocMonad m\n               => [Block]       -- ^ List of block elements\n               -> RST m (Doc Text)\nblockListToRST = blockListToRST' False\n\n{-\n\nhttp://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#directives\n\nAccording to the terminology used in the spec, a marker includes a\nfinal whitespace and a block includes the directive arguments. Here\nthe variable names have slightly different meanings because we don't\nwant to finish the line with a space if there are no arguments, it\nwould produce rST that differs from what users expect in a way that's\nnot easy to detect\n\n-}\ntoRSTDirective :: Doc Text -> Doc Text -> [(Doc Text, Doc Text)] -> Doc Text -> Doc Text\ntoRSTDirective typ args options content = marker <> spaceArgs <> cr <> block\n  where marker = \".. \" <> typ <> \"::\"\n        block = nest 3 (fieldList $$\n                        blankline $$\n                        content $$\n                        blankline)\n        spaceArgs = if isEmpty args then \"\" else \" \" <> args\n        -- a field list could end up being an empty doc thus being\n        -- omitted by $$\n        fieldList = foldl ($$) \"\" $ map joinField options\n        -- a field body can contain multiple lines\n        joinField (name, body) = \":\" <> name <> \": \" <> body\n\ntableToRSTList :: PandocMonad m\n             => [Inline]\n             -> [Alignment]\n             -> [Double]\n             -> [[Block]]\n             -> [[[Block]]]\n             -> RST m (Doc Text)\ntableToRSTList caption _ propWidths headers rows = do\n  captionRST <- inlineListToRST caption\n  opts       <- gets stOptions\n  content    <- listTableContent toWrite\n  pure $ toRSTDirective \"list-table\" captionRST (directiveOptions opts) content\n  where directiveOptions opts = widths (writerColumns opts) propWidths <>\n                                headerRows\n        toWrite = if noHeaders then rows else headers:rows\n        headerRows = [(\"header-rows\", text $ show (1 :: Int)) | not noHeaders]\n        widths tot pro = [(\"widths\", showWidths tot pro) |\n                          not (null propWidths || all (==0.0) propWidths)]\n        noHeaders = all null headers\n        -- >>> showWidths 70 [0.5, 0.5]\n        -- \"35 35\"\n        showWidths :: Int -> [Double] -> Doc Text\n        showWidths tot = text . unwords . map (show . toColumns tot)\n        -- toColumns converts a width expressed as a proportion of the\n        -- total into a width expressed as a number of columns\n        toColumns :: Int -> Double -> Int\n        toColumns t p = round (p * fromIntegral t)\n        listTableContent :: PandocMonad m => [[[Block]]] -> RST m (Doc Text)\n        listTableContent = fmap vcat .\n          mapM (fmap (hang 2 (text \"* \") . vcat) . mapM bulletListItemToRST)\n\ntransformInlines :: [Inline] -> [Inline]\ntransformInlines =  insertBS .\n                    filter hasContents .\n                    removeSpaceAfterDisplayMath .\n                    concatMap (transformNested . flatten)\n  where -- empty inlines are not valid RST syntax\n        hasContents :: Inline -> Bool\n        hasContents (Str \"\")              = False\n        hasContents (Emph [])             = False\n        hasContents (Underline [])        = False\n        hasContents (Strong [])           = False\n        hasContents (Strikeout [])        = False\n        hasContents (Superscript [])      = False\n        hasContents (Subscript [])        = False\n        hasContents (SmallCaps [])        = False\n        hasContents (Quoted _ [])         = False\n        hasContents (Cite _ [])           = False\n        hasContents (Span _ [])           = False\n        hasContents (Link _ [] (\"\", \"\"))  = False\n        hasContents (Image _ [] (\"\", \"\")) = False\n        hasContents _                     = True\n        -- remove spaces after displaymath, as they screw up indentation:\n        removeSpaceAfterDisplayMath (Math DisplayMath x : zs) =\n              Math DisplayMath x : dropWhile (==Space) zs\n        removeSpaceAfterDisplayMath (x:xs) = x : removeSpaceAfterDisplayMath xs\n        removeSpaceAfterDisplayMath [] = []\n        insertBS :: [Inline] -> [Inline] -- insert '\\ ' where needed\n        insertBS (x:y:z:zs)\n          | isComplex y && surroundComplex x z =\n              x : y : insertBS (z : zs)\n        insertBS (x:y:zs)\n          | isComplex x && not (okAfterComplex y) =\n              x : RawInline \"rst\" \"\\\\ \" : insertBS (y : zs)\n          | isComplex y && not (okBeforeComplex x) =\n              x : RawInline \"rst\" \"\\\\ \" : insertBS (y : zs)\n          | otherwise =\n              x : insertBS (y : zs)\n        insertBS (x:ys) = x : insertBS ys\n        insertBS [] = []\n        transformNested :: [Inline] -> [Inline]\n        transformNested = concatMap exportLeadingTrailingSpace\n        exportLeadingTrailingSpace :: Inline -> [Inline]\n        exportLeadingTrailingSpace il\n          | isComplex il =\n             let contents = dropInlineParent il\n                 headSpace = headMay contents == Just Space\n                 lastSpace = lastMay contents == Just Space\n              in (if headSpace then (Space:) else id) .\n                 (if lastSpace then (++ [Space]) else id) $\n                 [setInlineChildren il (stripLeadingTrailingSpace contents)]\n          | otherwise = [il]\n\n        surroundComplex :: Inline -> Inline -> Bool\n        surroundComplex (Str s) (Str s')\n          | Just (_, c)  <- T.unsnoc s\n          , Just (c', _) <- T.uncons s'\n          = case (c, c') of\n              ('\\'','\\'') -> True\n              ('\"','\"')   -> True\n              ('<','>')   -> True\n              ('[',']')   -> True\n              ('{','}')   -> True\n              _           -> False\n        surroundComplex _ _ = False\n        okAfterComplex :: Inline -> Bool\n        okAfterComplex Space = True\n        okAfterComplex SoftBreak = True\n        okAfterComplex LineBreak = True\n        okAfterComplex (Str (T.uncons -> Just (c,_)))\n          = isSpace c || T.any (== c) \"-.,:;!?\\\\/'\\\")]}>–—\"\n        okAfterComplex _ = False\n        okBeforeComplex :: Inline -> Bool\n        okBeforeComplex Space = True\n        okBeforeComplex SoftBreak = True\n        okBeforeComplex LineBreak = True\n        okBeforeComplex (Str (T.unsnoc -> Just (_,c)))\n          = isSpace c || T.any (== c) \"-:/'\\\"<([{–—\"\n        okBeforeComplex _ = False\n        isComplex :: Inline -> Bool\n        isComplex (Emph _)        = True\n        isComplex (Underline _)   = True\n        isComplex (Strong _)      = True\n        isComplex (SmallCaps _)   = True\n        isComplex (Strikeout _)   = True\n        isComplex (Superscript _) = True\n        isComplex (Subscript _)   = True\n        isComplex Link{}          = True\n        isComplex Image{}         = True\n        isComplex (Code _ _)      = True\n        isComplex (Math _ _)      = True\n        isComplex (Cite _ (x:_))  = isComplex x\n        isComplex (Span _ (x:_))  = isComplex x\n        isComplex _               = False\n\n-- | Flattens nested inlines. Extracts nested inlines and goes through\n-- them either collapsing them in the outer inline container or\n-- pulling them out of it\nflatten :: Inline -> [Inline]\nflatten outer\n  | null contents = [outer]\n  | otherwise     = combineAll contents\n  where contents = dropInlineParent outer\n        combineAll = L.foldl' combine []\n\n        combine :: [Inline] -> Inline -> [Inline]\n        combine f i =\n          case (outer, i) of\n          -- quotes are not rendered using RST inlines, so we can keep\n          -- them and they will be readable and parsable\n          (Quoted _ _, _)          -> keep f i\n          (_, Quoted _ _)          -> keep f i\n          -- spans are not rendered using RST inlines, so we can keep them\n          (Span (_,_,[]) _, _)   -> keep f i\n          (_, Span (_,_,[]) _)   -> keep f i\n          -- inlineToRST handles this case properly so it's safe to keep\n          ( Link{}, Image{})       -> keep f i\n          -- parent inlines would prevent links from being correctly\n          -- parsed, in this case we prioritise the content over the\n          -- style\n          (_, Link{})              -> emerge f i\n          -- always give priority to strong text over emphasis\n          (Emph _, Strong _)       -> emerge f i\n          -- drop all other nested styles\n          (_, _)                   -> collapse f i\n\n        emerge f i = f <> [i]\n        keep f i = appendToLast f [i]\n        collapse f i = appendToLast f $ dropInlineParent i\n\n        appendToLast :: [Inline] -> [Inline] -> [Inline]\n        appendToLast flattened toAppend =\n          case NE.nonEmpty flattened of\n            Nothing -> [setInlineChildren outer toAppend]\n            Just xs ->\n              if isOuter lastFlat\n                 then NE.init xs <> [appendTo lastFlat toAppend]\n                 else flattened <> [setInlineChildren outer toAppend]\n               where\n                lastFlat = NE.last xs\n                appendTo o i = mapNested (<> i) o\n                isOuter i = emptyParent i == emptyParent outer\n                emptyParent i = setInlineChildren i []\n\nmapNested :: ([Inline] -> [Inline]) -> Inline -> Inline\nmapNested f i = setInlineChildren i (f (dropInlineParent i))\n\ndropInlineParent :: Inline -> [Inline]\ndropInlineParent (Link _ i _)    = i\ndropInlineParent (Emph i)        = i\ndropInlineParent (Underline i)   = i\ndropInlineParent (Strong i)      = i\ndropInlineParent (Strikeout i)   = i\ndropInlineParent (Superscript i) = i\ndropInlineParent (Subscript i)   = i\ndropInlineParent (SmallCaps i)   = i\ndropInlineParent (Cite _ i)      = i\ndropInlineParent (Image _ i _)   = i\ndropInlineParent (Span _ i)      = i\ndropInlineParent (Quoted _ i)    = i\ndropInlineParent i               = [i] -- not a parent, like Str or Space\n\nsetInlineChildren :: Inline -> [Inline] -> Inline\nsetInlineChildren (Link a _ t) i    = Link a i t\nsetInlineChildren (Emph _) i        = Emph i\nsetInlineChildren (Underline _) i   = Underline i\nsetInlineChildren (Strong _) i      = Strong i\nsetInlineChildren (Strikeout _) i   = Strikeout i\nsetInlineChildren (Superscript _) i = Superscript i\nsetInlineChildren (Subscript _) i   = Subscript i\nsetInlineChildren (SmallCaps _) i   = SmallCaps i\nsetInlineChildren (Quoted q _) i    = Quoted q i\nsetInlineChildren (Cite c _) i      = Cite c i\nsetInlineChildren (Image a _ t) i   = Image a i t\nsetInlineChildren (Span a _) i      = Span a i\nsetInlineChildren leaf _            = leaf\n\ninlineListToRST :: PandocMonad m => [Inline] -> RST m (Doc Text)\ninlineListToRST = writeInlines . walk transformInlines\n\n-- | Convert list of Pandoc inline elements to RST.\nwriteInlines :: PandocMonad m => [Inline] -> RST m (Doc Text)\nwriteInlines lst =\n   hcat <$> mapM inlineToRST lst\n\n-- | Convert Pandoc inline element to RST.\ninlineToRST :: PandocMonad m => Inline -> RST m (Doc Text)\ninlineToRST (Span (\"\",[\"mark\"],[]) ils) = do\n  contents <- writeInlines ils\n  return $ \":mark:`\" <> contents <> \"`\"\ninlineToRST (Span (_,_,kvs) ils) = do\n  contents <- writeInlines ils\n  return $\n    case lookup \"role\" kvs of\n          Just role -> \":\" <> literal role <> \":`\" <> contents <> \"`\"\n          Nothing   -> contents\ninlineToRST (Emph lst) = do\n  contents <- writeInlines lst\n  return $ \"*\" <> contents <> \"*\"\n-- Underline is not supported, fall back to Emph\ninlineToRST (Underline lst) =\n  inlineToRST (Emph lst)\ninlineToRST (Strong lst) = do\n  contents <- writeInlines lst\n  return $ \"**\" <> contents <> \"**\"\ninlineToRST (Strikeout lst) = do\n  contents <- writeInlines lst\n  return $ \"[STRIKEOUT:\" <> contents <> \"]\"\ninlineToRST (Superscript lst) = do\n  contents <- writeInlines lst\n  return $ \":sup:`\" <> contents <> \"`\"\ninlineToRST (Subscript lst) = do\n  contents <- writeInlines lst\n  return $ \":sub:`\" <> contents <> \"`\"\ninlineToRST (SmallCaps lst) = writeInlines lst\ninlineToRST (Quoted SingleQuote lst) = do\n  contents <- writeInlines lst\n  opts <- gets stOptions\n  if isEnabled Ext_smart opts\n     then return $ \"'\" <> contents <> \"'\"\n     else return $ \"‘\" <> contents <> \"’\"\ninlineToRST (Quoted DoubleQuote lst) = do\n  contents <- writeInlines lst\n  opts <- gets stOptions\n  if isEnabled Ext_smart opts\n     then return $ \"\\\"\" <> contents <> \"\\\"\"\n     else return $ \"“\" <> contents <> \"”\"\ninlineToRST (Cite _  lst) =\n  writeInlines lst\ninlineToRST (Code (_,[\"interpreted-text\"],[(\"role\",role)]) str) =\n  return $ \":\" <> literal role <> \":`\" <> literal str <> \"`\"\ninlineToRST (Code _ str) = do\n  opts <- gets stOptions\n  -- we trim the string because the delimiters must adjoin a\n  -- non-space character; see #3496\n  -- we use :literal: when the code contains backticks, since\n  -- :literal: allows backslash-escapes; see #3974\n  return $\n    if T.any (== '`') str\n       then \":literal:`\" <> literal (escapeText opts (trim str)) <> \"`\"\n       else \"``\" <> literal (trim str) <> \"``\"\ninlineToRST (Str str) = do\n  opts <- gets stOptions\n  return $ literal $\n    (if isEnabled Ext_smart opts\n        then unsmartify opts\n        else id) $ escapeText opts str\ninlineToRST (Math t str) = do\n  modify $ \\st -> st{ stHasMath = True }\n  return $ if t == InlineMath\n              then \":math:`\" <> literal str <> \"`\"\n              else if T.any (== '\\n') str\n                   then blankline $$ \".. math::\" $$\n                        blankline $$ nest 3 (literal str) $$ blankline\n                   else blankline $$ (\".. math:: \" <> literal str) $$ blankline\ninlineToRST il@(RawInline f x)\n  | f == \"rst\" = return $ literal x\n  | f == \"latex\" || f == \"tex\" = do\n      modify $ \\st -> st{ stHasRawTeX = True }\n      return $ \":raw-latex:`\" <> literal x <> \"`\"\n  | otherwise  = empty <$ report (InlineNotRendered il)\ninlineToRST LineBreak = return cr -- there's no line break in RST (see Para)\ninlineToRST Space = return space\ninlineToRST SoftBreak = do\n  wrapText <- gets $ writerWrapText . stOptions\n  case wrapText of\n        WrapPreserve -> return cr\n        WrapAuto     -> return space\n        WrapNone     -> return space\n-- autolink\ninlineToRST (Link _ [Str str] (src, _))\n  | isURI src &&\n    if \"mailto:\" `T.isPrefixOf` src\n       then src == escapeURI (\"mailto:\" <> str)\n       else src == escapeURI str = do\n  let srcSuffix = fromMaybe src (T.stripPrefix \"mailto:\" src)\n  return $ literal srcSuffix\ninlineToRST (Link _ [Image attr alt (imgsrc,imgtit)] (src, _tit)) = do\n  label <- registerImage attr alt (imgsrc,imgtit) (Just src)\n  return $ \"|\" <> label <> \"|\"\ninlineToRST (Link _ txt (src, tit)) = do\n  useReferenceLinks <- gets $ writerReferenceLinks . stOptions\n  linktext <- writeInlines $ B.toList . B.trimInlines . B.fromList $ txt\n  if useReferenceLinks\n    then do refs <- gets stLinks\n            case lookup txt refs of\n                 Just (src',tit') ->\n                   if src == src' && tit == tit'\n                      then return $ \"`\" <> linktext <> \"`_\"\n                      else\n                        return $ \"`\" <> linktext <> \" <\" <> literal src <> \">`__\"\n                 Nothing -> do\n                   modify $ \\st -> st { stLinks = (txt,(src,tit)):refs }\n                   return $ \"`\" <> linktext <> \"`_\"\n    else return $ \"`\" <> linktext <> \" <\" <> literal src <> \">`__\"\ninlineToRST (Image attr alternate (source, tit)) = do\n  label <- registerImage attr alternate (source,tit) Nothing\n  return $ \"|\" <> label <> \"|\"\ninlineToRST (Note contents) = do\n  -- add to notes in state\n  notes <- gets stNotes\n  modify $ \\st -> st { stNotes = contents:notes }\n  let ref = show $ length notes + 1\n  return $ \" [\" <> text ref <> \"]_\"\n\nregisterImage :: PandocMonad m => Attr -> [Inline] -> Target -> Maybe Text -> RST m (Doc Text)\nregisterImage attr alt (src,tit) mbtarget = do\n  pics <- gets stImages\n  imgId <- gets stImageId\n  let getImageName = do\n        modify $ \\st -> st{ stImageId = imgId + 1 }\n        return [Str (\"image\" <> tshow imgId)]\n  txt <- case lookup alt pics of\n               Just (a,s,t,mbt) ->\n                 if (a,s,t,mbt) == (attr,src,tit,mbtarget)\n                    then return alt\n                    else do\n                        alt' <- getImageName\n                        modify $ \\st -> st { stImages =\n                           (alt', (attr,src,tit, mbtarget)):stImages st }\n                        return alt'\n               Nothing -> do\n                 alt' <- if null alt || alt == [Str \"\"]\n                            then getImageName\n                            else return alt\n                 modify $ \\st -> st { stImages =\n                        (alt', (attr,src,tit, mbtarget)):stImages st }\n                 return alt'\n  inlineListToRST txt\n\nimageDimsToRST :: PandocMonad m => Attr -> RST m (Doc Text)\nimageDimsToRST attr = do\n  let (ident, _, _) = attr\n      name = if T.null ident\n                then empty\n                else \":name: \" <> literal ident\n      showDim dir = let cols d = \":\" <> text (show dir) <> \": \" <> text (show d)\n                    in  case dimension dir attr of\n                          Just (Percent a) ->\n                            case dir of\n                              Height -> empty\n                              Width  -> cols (Percent a)\n                          Just dim -> cols dim\n                          Nothing  -> empty\n  return $ cr <> name $$ showDim Width $$ showDim Height\n\nsimpleTable :: PandocMonad m\n            => WriterOptions\n            -> (WriterOptions -> [Block] -> m (Doc Text))\n            -> TableHead\n            -> [TableBody]\n            -> TableFoot\n            -> m (Doc Text)\nsimpleTable opts blocksToDoc (TableHead _ headers) tbody (TableFoot _ footers) = do\n  headerDocs <- if allRowsEmpty headers\n                   then return []\n                   else fixEmpties <$> mapM rowToDoc headers\n  rowDocs <- fixEmpties <$> mapM rowToDoc ((tableBodiesToRows tbody) ++ footers)\n  let numChars = maybe 0 maximum . NE.nonEmpty . map (offset . fst)\n  let colWidths = map numChars $ transpose (headerDocs ++ rowDocs)\n  let hline = nowrap $ hsep (map (\\n -> literal (T.replicate n \"=\")) colWidths)\n  let hdr = if allRowsEmpty headers\n               then mempty\n               else hline $$ mapToRow colWidths headerDocs\n  let bdy = mapToRow colWidths rowDocs\n  return $ hdr $$ hline $$ bdy $$ hline\n  where\n    -- can't have empty cells in first column:\n    fixEmpties (d:ds) = fixEmpties' d : ds\n    fixEmpties [] = []\n\n    fixEmpties' ((d, colSpan):ds) = if isEmpty d\n                                     then (literal \"\\\\ \", colSpan) : ds\n                                     else (d, colSpan) : ds\n    fixEmpties' [] = []\n\n    rowToDoc (Row _ cells) = concat <$> mapM cellToDocs cells\n\n    cellToDocs (Cell _ _ _ colSpan blocks) = applyColSpan colSpan <$> (blocksToDoc opts) blocks\n\n    applyColSpan col@(ColSpan colSpan) doc\n      | colSpan > 1 =\n          -- Fill up columns for the col spans by adding empty docs without a ColSpan.\n          let emptyDoc = (literal \"\", Nothing)\n          in  (doc, Just col) : replicate (colSpan - 1) emptyDoc\n      | otherwise = [(doc, Just col)]\n\n    mapToRow colWidths = vcat . concatMap (toRow colWidths)\n\n    toRow colWidths rowDocsWithColSpans =\n      let (rowDocs, colSpans) = unzip rowDocsWithColSpans\n          row = intersperseDivider $ zipWith lblock colWidths rowDocs\n          colSpanRow = intersperseDivider $ writeColSpans colSpans colWidths\n      in  if any (maybe False (> 1)) colSpans\n           then [row, colSpanRow]\n           else [row] -- Don't write out col spans if they are all just 1.\n\n    intersperseDivider = mconcat . intersperse (lblock 1 \" \")\n\n    -- Write col span dashes to match the length of the col widths.\n    writeColSpans [] _ = []\n    writeColSpans _ [] = []\n    writeColSpans (Nothing : remainingColSpans) colWidths = writeColSpans remainingColSpans colWidths\n    writeColSpans (Just (ColSpan colSpan) : remainingColSpans) colWidths =\n      let (colWidths', remainingColWidths) = splitAt colSpan colWidths\n      in  writeColSpanDashes colWidths' : writeColSpans remainingColSpans remainingColWidths\n\n    writeColSpanDashes colWidths =\n      let colWidthsLength = length colWidths\n          colWidthsSum = sum colWidths\n          dashLength = if colWidthsLength > 1\n            -- Offset by 1 for the white spaces between columns so that the col\n            -- span dashes align with the end of the columns correctly.\n            then colWidthsSum + colWidthsLength - 1\n            else colWidthsSum\n      in  literal $ T.replicate dashLength \"-\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/RTF.hs",
    "content": "{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{- |\n   Module      : Text.Pandoc.Writers.RTF\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to RTF (rich text format).\n-}\nmodule Text.Pandoc.Writers.RTF ( writeRTF\n                               ) where\nimport Control.Monad.Except (catchError, throwError)\nimport Control.Monad\nimport qualified Data.ByteString as B\nimport Data.Char (chr, isDigit, ord, isAlphaNum)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport qualified Text.Pandoc.Class.PandocMonad as P\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.DocLayout (render, literal)\nimport Text.Pandoc.Walk\nimport Text.Pandoc.Writers.Math\nimport Text.Pandoc.Writers.Shared\nimport Text.Printf (printf)\n\n-- | Convert Image inlines into a raw RTF embedded image, read from a file,\n-- or a MediaBag, or the internet.\n-- If file not found or filetype not jpeg or png, leave the inline unchanged.\nrtfEmbedImage :: PandocMonad m => WriterOptions -> Inline -> m Inline\nrtfEmbedImage opts x@(Image attr _ (src,_)) = catchError\n  (do result <- P.fetchItem src\n      case result of\n           (imgdata, Just mime)\n             | mime' <- T.takeWhile (/=';') mime\n             , mime' == \"image/jpeg\" || mime' == \"image/png\" -> do\n             let bytes = map (T.pack . printf \"%02x\") $ B.unpack imgdata\n             filetype <-\n                case mime' of\n                     \"image/jpeg\" -> return \"\\\\jpegblip\"\n                     \"image/png\"  -> return \"\\\\pngblip\"\n                     _            -> throwError $\n                                         PandocShouldNeverHappenError $\n                                         \"Unknown file type \" <> mime\n             sizeSpec <-\n                case imageSize opts imgdata of\n                     Left msg -> do\n                       report $ CouldNotDetermineImageSize src msg\n                       return \"\"\n                     Right sz -> return $ \"\\\\picw\" <> tshow xpx <>\n                                \"\\\\pich\" <> tshow ypx <>\n                                \"\\\\picwgoal\" <> tshow (floor (xpt * 20) :: Integer)\n                                <> \"\\\\pichgoal\" <> tshow (floor (ypt * 20) :: Integer)\n                        -- twip = 1/1440in = 1/20pt\n                        where (xpx, ypx) = sizeInPixels sz\n                              (xpt, ypt) = desiredSizeInPoints opts attr sz\n             let raw = \"{\\\\pict\" <> filetype <> sizeSpec <> \" \" <>\n                        T.concat bytes <> \"}\"\n             if B.null imgdata\n                then do\n                  report $ CouldNotFetchResource src \"image contained no data\"\n                  return x\n                else return $ RawInline (Format \"rtf\") raw\n             | otherwise -> do\n               report $ CouldNotFetchResource src \"image is not a jpeg or png\"\n               return x\n           (_, Nothing) -> do\n             report $ CouldNotDetermineMimeType src\n             return x)\n  (\\e -> do\n     report $ CouldNotFetchResource src $ tshow e\n     return x)\nrtfEmbedImage _ x = return x\n\n-- | Convert Pandoc to a string in rich text format.\nwriteRTF :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteRTF options doc = do\n  -- handle images\n  Pandoc meta@(Meta metamap) blocks <- walkM (rtfEmbedImage options) doc\n  let spacer = not $ all null $ docTitle meta : docDate meta : docAuthors meta\n  let toPlain (MetaBlocks [Para ils]) = MetaInlines ils\n      toPlain x                       = x\n  -- adjust title, author, date so we don't get para inside para\n  let meta'  = Meta $ M.adjust toPlain \"title\"\n                    . M.adjust toPlain \"author\"\n                    . M.adjust toPlain \"date\"\n                    $ metamap\n  metadata <- metaToContext options\n              (fmap (literal . T.concat) .\n                mapM (blockToRTF 0 AlignDefault))\n              (fmap literal . inlinesToRTF)\n              meta'\n  body <- blocksToRTF 0 AlignDefault blocks\n  toc <- blocksToRTF 0 AlignDefault [toTableOfContents options blocks]\n  let context = defField \"body\" body\n              $ defField \"spacer\" spacer\n              $ (if writerTableOfContents options\n                    then defField \"table-of-contents\" toc\n                         -- for backwards compatibility,\n                         -- we populate toc with the contents\n                         -- of the toc rather than a boolean:\n                         . defField \"toc\" toc\n                    else id) metadata\n  return $\n    case writerTemplate options of\n       Just tpl -> render Nothing $ renderTemplate tpl context\n       Nothing  -> case T.unsnoc body of\n                        Just (_,'\\n') -> body\n                        _             -> body <> T.singleton '\\n'\n\n-- | Convert unicode characters (> 127) into rich text format representation.\nhandleUnicode :: Text -> Text\nhandleUnicode = T.concatMap $ \\c ->\n  if ord c > 127\n     then if surrogate c\n          then let x = ord c - 0x10000\n                   (q, r) = x `divMod` 0x400\n                   upper = q + 0xd800\n                   lower = r + 0xDC00\n               in enc (chr upper) <> enc (chr lower)\n          else enc c\n     else T.singleton c\n  where\n    surrogate x = not (   (0x0000 <= ord x && ord x <= 0xd7ff)\n                       || (0xe000 <= ord x && ord x <= 0xffff) )\n    enc x = \"\\\\u\" <> tshow (ord x) <> \" ?\"\n\n-- | Escape special characters.\nescapeSpecial :: Text -> Text\nescapeSpecial t\n  | T.all isAlphaNum t = t\n  | otherwise          = T.concatMap escChar t\n where\n  escChar '\\t' = \"\\\\tab \"\n  escChar '\\8216' = \"\\\\u8216'\"\n  escChar '\\8217' = \"\\\\u8217'\"\n  escChar '\\8220' = \"\\\\u8220\\\"\"\n  escChar '\\8221' = \"\\\\u8221\\\"\"\n  escChar '\\8211' = \"\\\\u8211-\"\n  escChar '\\8212' = \"\\\\u8212-\"\n  escChar '{'     = \"\\\\{\"\n  escChar '}'     = \"\\\\}\"\n  escChar '\\\\'    = \"\\\\\\\\\"\n  escChar c       = T.singleton c\n\n-- | Escape strings as needed for rich text format.\nstringToRTF :: Text -> Text\nstringToRTF = handleUnicode . escapeSpecial\n\n-- | Escape things as needed for code block in RTF.\ncodeStringToRTF :: Text -> Text\ncodeStringToRTF str = T.intercalate \"\\\\line\\n\" $ T.lines (stringToRTF str)\n\n-- | Make a paragraph with first-line indent, block indent, and space after.\nrtfParSpaced :: Int       -- ^ space after (in twips)\n             -> Int       -- ^ block indent (in twips)\n             -> Int       -- ^ first line indent (relative to block) (in twips)\n             -> Alignment -- ^ alignment\n             -> Text    -- ^ string with content\n             -> Text\nrtfParSpaced spaceAfter indent firstLineIndent alignment content =\n  let alignString = case alignment of\n                           AlignLeft    -> \"\\\\ql \"\n                           AlignRight   -> \"\\\\qr \"\n                           AlignCenter  -> \"\\\\qc \"\n                           AlignDefault -> \"\\\\ql \"\n  in  \"{\\\\pard \" <> alignString <>\n      \"\\\\f0 \\\\sa\" <> tshow spaceAfter <> \" \\\\li\" <> T.pack (show indent) <>\n      \" \\\\fi\" <> tshow firstLineIndent <> \" \" <> content <> \"\\\\par}\\n\"\n\n-- | Default paragraph.\nrtfPar :: Int       -- ^ block indent (in twips)\n       -> Int       -- ^ first line indent (relative to block) (in twips)\n       -> Alignment -- ^ alignment\n       -> Text    -- ^ string with content\n       -> Text\nrtfPar = rtfParSpaced 180\n\n-- | Compact paragraph (e.g. for compact list items).\nrtfCompact ::  Int       -- ^ block indent (in twips)\n           ->  Int       -- ^ first line indent (relative to block) (in twips)\n           ->  Alignment -- ^ alignment\n           ->  Text    -- ^ string with content\n           ->  Text\nrtfCompact = rtfParSpaced 0\n\n-- number of twips to indent\nindentIncrement :: Int\nindentIncrement = 720\n\nlistIncrement :: Int\nlistIncrement = 360\n\n-- | Returns appropriate bullet list marker for indent level.\nbulletMarker :: Int -> Text\nbulletMarker indent = case indent `mod` 720 of\n                             0 -> \"\\\\bullet \"\n                             _ -> \"\\\\endash \"\n\n-- | Returns appropriate (list of) ordered list markers for indent level.\norderedMarkers :: Int -> ListAttributes -> [Text]\norderedMarkers indent (start, style, delim) =\n  if style == DefaultStyle && delim == DefaultDelim\n     then case indent `mod` 720 of\n              0 -> orderedListMarkers (start, Decimal, Period)\n              _ -> orderedListMarkers (start, LowerAlpha, Period)\n     else orderedListMarkers (start, style, delim)\n\nblocksToRTF :: PandocMonad m\n            => Int\n            -> Alignment\n            -> [Block]\n            -> m Text\nblocksToRTF indent align = fmap T.concat . mapM (blockToRTF indent align)\n\n-- | Convert Pandoc block element to RTF.\nblockToRTF :: PandocMonad m\n           => Int       -- ^ indent level\n           -> Alignment -- ^ alignment\n           -> Block     -- ^ block to convert\n           -> m Text\nblockToRTF indent alignment (Div _ bs) =\n  blocksToRTF indent alignment bs\nblockToRTF indent alignment (Plain lst) =\n  rtfCompact indent 0 alignment <$> inlinesToRTF lst\nblockToRTF indent alignment (Para lst) =\n  rtfPar indent 0 alignment <$> inlinesToRTF lst\nblockToRTF indent alignment (LineBlock lns) =\n  blockToRTF indent alignment $ linesToPara lns\nblockToRTF indent alignment (BlockQuote lst) =\n  blocksToRTF (indent + indentIncrement) alignment lst\nblockToRTF indent _ (CodeBlock _ str) =\n  return $ rtfPar indent 0 AlignLeft (\"\\\\f1 \" <> codeStringToRTF str)\nblockToRTF _ _ b@(RawBlock f str)\n  | f == Format \"rtf\" = return str\n  | otherwise         = do\n      report $ BlockNotRendered b\n      return \"\"\nblockToRTF indent alignment (BulletList lst) = spaceAtEnd . T.concat <$>\n  mapM (listItemToRTF alignment indent (bulletMarker indent)) lst\nblockToRTF indent alignment (OrderedList attribs lst) =\n  spaceAtEnd . T.concat <$>\n   zipWithM (listItemToRTF alignment indent) (orderedMarkers indent attribs) lst\nblockToRTF indent alignment (DefinitionList lst) = spaceAtEnd . T.concat <$>\n  mapM (definitionListItemToRTF alignment indent) lst\nblockToRTF indent _ HorizontalRule = return $\n  rtfPar indent 0 AlignCenter \"\\\\emdash\\\\emdash\\\\emdash\\\\emdash\\\\emdash\"\nblockToRTF indent alignment (Header level _ lst) = do\n  contents <- inlinesToRTF lst\n  return $ rtfPar indent 0 alignment $\n             \"\\\\outlinelevel\" <> tshow (level - 1) <>\n             \" \\\\b \\\\fs\" <> tshow (40 - (level * 4)) <> \" \" <> contents\nblockToRTF indent alignment (Table _ blkCapt specs thead tbody tfoot) = do\n  let (caption, aligns, sizes, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  caption' <- inlinesToRTF caption\n  header' <- if all null headers\n                then return \"\"\n                else tableRowToRTF True indent aligns sizes headers\n  rows' <- T.concat <$> mapM (tableRowToRTF False indent aligns sizes) rows\n  return $ header' <> rows' <> rtfPar indent 0 alignment caption'\nblockToRTF indent alignment (Figure attr capt body) =\n  blockToRTF indent alignment $ figureDiv attr capt body\n\ntableRowToRTF :: PandocMonad m\n              => Bool -> Int -> [Alignment] -> [Double] -> [[Block]] -> m Text\ntableRowToRTF header indent aligns sizes' cols = do\n  let totalTwips = 6 * 1440 -- 6 inches\n  let sizes = if all (== 0) sizes'\n                 then replicate (length cols) (1.0 / fromIntegral (length cols))\n                 else sizes'\n  columns <- T.concat <$>\n     zipWithM (tableItemToRTF indent) aligns cols\n  let rightEdges = drop 1 $\n                    scanl (\\sofar new -> sofar + floor (new * totalTwips))\n                          (0 :: Integer) sizes\n  let cellDefs = map (\\edge -> (if header\n                                   then \"\\\\clbrdrb\\\\brdrs\"\n                                   else \"\") <> \"\\\\cellx\" <> tshow edge)\n                     rightEdges\n  let start = \"{\\n\\\\trowd \\\\trgaph120\\n\" <> T.concat cellDefs <> \"\\n\" <>\n              \"\\\\trkeep\\\\intbl\\n{\\n\"\n  let end = \"}\\n\\\\intbl\\\\row}\\n\"\n  return $ start <> columns <> end\n\ntableItemToRTF :: PandocMonad m => Int -> Alignment -> [Block] -> m Text\ntableItemToRTF indent alignment item = do\n  contents <- blocksToRTF indent alignment item\n  return $ \"{\" <> T.replace \"\\\\pard\" \"\\\\pard\\\\intbl\" contents <> \"\\\\cell}\\n\"\n\n-- | Ensure that there's the same amount of space after compact\n-- lists as after regular lists.\nspaceAtEnd :: Text -> Text\nspaceAtEnd str = maybe str (<> \"\\\\sa180\\\\par}\\n\") $ T.stripSuffix \"\\\\par}\\n\" str\n\n-- | Convert list item (list of blocks) to RTF.\nlistItemToRTF :: PandocMonad m\n              => Alignment  -- ^ alignment\n              -> Int        -- ^ indent level\n              -> Text     -- ^ list start marker\n              -> [Block]    -- ^ list item (list of blocks)\n              -> m Text\nlistItemToRTF alignment indent marker [] = return $\n  rtfCompact (indent + listIncrement) (negate listIncrement) alignment\n             (marker <> \"\\\\tx\" <> tshow listIncrement <> \"\\\\tab \")\nlistItemToRTF alignment indent marker (listFirst:listRest) = do\n  let f = blockToRTF (indent + listIncrement) alignment\n  first <- f listFirst\n  rest <- mapM f listRest\n  let listMarker = \"\\\\fi\" <> tshow (negate listIncrement) <> \" \" <> marker <>\n                   \"\\\\tx\" <> tshow listIncrement <> \"\\\\tab\"\n  -- Find the first occurrence of \\\\fi or \\\\fi-, then replace it and the following\n  -- digits with the list marker.\n  let insertListMarker t = case popDigit $ optionDash $ T.drop 3 suff of\n        Just suff' -> pref <> listMarker <> T.dropWhile isDigit suff'\n        Nothing    -> t\n        where\n          (pref, suff) = T.breakOn \"\\\\fi\" t\n          optionDash x = case T.uncons x of\n            Just ('-', xs) -> xs\n            _              -> x\n          popDigit x\n            | Just (d, xs) <- T.uncons x\n            , isDigit d = Just xs\n            | otherwise = Nothing\n   -- insert the list marker into the (processed) first block\n  return $ insertListMarker first <> T.concat rest\n\n-- | Convert definition list item (label, list of blocks) to RTF.\ndefinitionListItemToRTF :: PandocMonad m\n                        => Alignment          -- ^ alignment\n                        -> Int                -- ^ indent level\n                        -> ([Inline],[[Block]]) -- ^ list item (list of blocks)\n                        -> m Text\ndefinitionListItemToRTF alignment indent (label, defs) = do\n  labelText <- blockToRTF indent alignment (Plain label)\n  itemsText <- blocksToRTF (indent + listIncrement) alignment (concat defs)\n  return $ labelText <> itemsText\n\n-- | Convert list of inline items to RTF.\ninlinesToRTF :: PandocMonad m\n             => [Inline]   -- ^ list of inlines to convert\n             -> m Text\ninlinesToRTF lst = T.concat <$> mapM inlineToRTF lst\n\n-- | Convert inline item to RTF.\ninlineToRTF :: PandocMonad m\n            => Inline         -- ^ inline to convert\n            -> m Text\ninlineToRTF (Span _ lst) = inlinesToRTF lst\ninlineToRTF (Emph lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\i \" <> contents <> \"}\"\ninlineToRTF (Underline lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\ul \" <> contents <> \"}\"\ninlineToRTF (Strong lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\b \" <> contents <> \"}\"\ninlineToRTF (Strikeout lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\strike \" <> contents <> \"}\"\ninlineToRTF (Superscript lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\super \" <> contents <> \"}\"\ninlineToRTF (Subscript lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\sub \" <> contents <> \"}\"\ninlineToRTF (SmallCaps lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"{\\\\scaps \" <> contents <> \"}\"\ninlineToRTF (Quoted SingleQuote lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"\\\\u8216'\" <> contents <> \"\\\\u8217'\"\ninlineToRTF (Quoted DoubleQuote lst) = do\n  contents <- inlinesToRTF lst\n  return $ \"\\\\u8220\\\"\" <> contents <> \"\\\\u8221\\\"\"\ninlineToRTF (Code _ str) = return $ \"{\\\\f1 \" <> codeStringToRTF str <> \"}\"\ninlineToRTF (Str str) = return $ stringToRTF str\ninlineToRTF (Math t str) = texMathToInlines t str >>= inlinesToRTF\ninlineToRTF (Cite _ lst) = inlinesToRTF lst\ninlineToRTF il@(RawInline f str)\n  | f == Format \"rtf\" = return str\n  | otherwise         = do\n      report $ InlineNotRendered il\n      return \"\"\ninlineToRTF LineBreak = return \"\\\\line \"\ninlineToRTF SoftBreak = return \" \"\ninlineToRTF Space = return \" \"\ninlineToRTF (Link _ text (src, _)) = do\n  contents <- inlinesToRTF text\n  return $ \"{\\\\field{\\\\*\\\\fldinst{HYPERLINK \\\"\" <> codeStringToRTF src <>\n    \"\\\"}}{\\\\fldrslt{\\\\ul\\n\" <> contents <> \"\\n}}}\\n\"\ninlineToRTF (Image _ _ (source, _)) =\n  return $ \"{\\\\cf1 [image: \" <> source <> \"]\\\\cf0}\"\ninlineToRTF (Note contents) = do\n  body <- T.concat <$> mapM (blockToRTF 0 AlignDefault) contents\n  return $ \"{\\\\super\\\\chftn}{\\\\*\\\\footnote\\\\chftn\\\\~\\\\plain\\\\pard \" <>\n    body <> \"}\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Roff.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.Roff\n   Copyright   : Copyright (C) 2007-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nCommon functions for roff writers (man, ms).\n-}\n\nmodule Text.Pandoc.Writers.Roff (\n      WriterState(..)\n    , defaultWriterState\n    , MS\n    , Note\n    , EscapeMode(..)\n    , escapeString\n    , withFontFeature\n    ) where\nimport Data.Char (ord, isAscii)\nimport Control.Monad.State.Strict\nimport qualified Data.Map as Map\nimport Data.Text (Text)\nimport qualified Data.Text as Text\nimport Data.String\nimport Data.Maybe (fromMaybe)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.DocLayout\nimport Text.Printf (printf)\nimport Text.Pandoc.RoffChar (standardEscapes, characterCodes)\n\ndata WriterState = WriterState { stHasInlineMath :: Bool\n                               , stFirstPara     :: Bool\n                               , stNotes         :: [Note]\n                               , stSmallCaps     :: Bool\n                               , stHighlighting  :: Bool\n                               , stInHeader      :: Bool\n                               , stFontFeatures  :: Map.Map Char Bool\n                               , stHasTables     :: Bool\n                               }\n\ndefaultWriterState :: WriterState\ndefaultWriterState = WriterState{ stHasInlineMath = False\n                                , stFirstPara     = True\n                                , stNotes         = []\n                                , stSmallCaps     = False\n                                , stHighlighting  = False\n                                , stInHeader      = False\n                                , stFontFeatures  = Map.fromList [\n                                                       ('I',False)\n                                                     , ('B',False)\n                                                     , ('C',False)\n                                                     , ('V',False)\n                                                     ]\n                                , stHasTables     = False\n                                }\n\ntype Note = [Block]\n\ntype MS = StateT WriterState\n\ndata EscapeMode = AllowUTF8        -- ^ use preferred man escapes\n                | AsciiOnly        -- ^ escape everything\n                deriving Show\n\nessentialEscapes :: Map.Map Char Text\nessentialEscapes = Map.fromList standardEscapes\n\n-- | Escape special characters for roff. If the first parameter is\n-- True, escape @-@ as @\\-@, as required by current versions of groff man;\n-- otherwise leave it unescaped, as neededfor ms.\nescapeString :: Bool -> EscapeMode -> Text -> Text\nescapeString escapeHyphen e = Text.concat . escapeString' e . Text.unpack\n  where\n    escapeString' _ [] = []\n    escapeString' escapeMode ('\\n':'.':xs) =\n      \"\\n\\\\&.\" : escapeString' escapeMode xs\n    -- see #10533; we need to escape hyphens as \\- in man but not in ms:\n    escapeString' escapeMode ('-':xs) | escapeHyphen =\n      \"\\\\-\" : escapeString' escapeMode xs\n    escapeString' escapeMode (x:xs) =\n      case Map.lookup x essentialEscapes of\n        Just s  -> s : escapeString' escapeMode xs\n        Nothing\n          | isAscii x -> Text.singleton x : escapeString' escapeMode xs\n          | otherwise ->\n              (case escapeMode of\n                AllowUTF8 -> Text.singleton x\n                AsciiOnly ->\n                   case Map.lookup x characterCodeMap of\n                      Just t\n                        | Text.length t == 2 -> \"\\\\(\" <> t -- see #10716\n                        | otherwise -> \"\\\\C'\" <> t <> \"'\"\n                      Nothing ->\n                        \"\\\\C'\" <> Text.pack (printf \"u%04X\" (ord x)) <> \"'\")\n               : escapeString' escapeMode xs\n\ncharacterCodeMap :: Map.Map Char Text\ncharacterCodeMap = Map.fromList characterCodes\n\nfontChange :: (HasChars a, IsString a, PandocMonad m) => MS m (Doc a)\nfontChange = do\n  features <- gets stFontFeatures\n  inHeader <- gets stInHeader\n  let filling = ['C' | fromMaybe False $ Map.lookup 'C' features] ++\n                ['V' | fromMaybe False $ Map.lookup 'V' features] ++\n                ['B' | inHeader ||\n                       fromMaybe False (Map.lookup 'B' features)] ++\n                ['I' | fromMaybe False $ Map.lookup 'I' features]\n  return $\n    case filling of\n      [] -> text \"\\\\f[R]\"\n      -- see #9020. C is not a font, use CR.\n      ['C'] -> text \"\\\\f[CR]\"\n      _ -> text $ \"\\\\f[\" ++ filling ++ \"]\"\n\nwithFontFeature :: (HasChars a, IsString a, PandocMonad m)\n                => Char -> MS m (Doc a) -> MS m (Doc a)\nwithFontFeature c action = do\n  modify $ \\st -> st{ stFontFeatures = Map.adjust not c $ stFontFeatures st }\n  begin <- fontChange\n  d <- action\n  modify $ \\st -> st{ stFontFeatures = Map.adjust not c $ stFontFeatures st }\n  end <- fontChange\n  return $ begin <> d <> end\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Shared.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE LambdaCase #-}\n{- |\n   Module      : Text.Pandoc.Writers.Shared\n   Copyright   : Copyright (C) 2013-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nShared utility functions for pandoc writers.\n-}\nmodule Text.Pandoc.Writers.Shared (\n                       metaToContext\n                     , metaToContext'\n                     , addVariablesToContext\n                     , getField\n                     , setField\n                     , resetField\n                     , defField\n                     , getLang\n                     , tagWithAttrs\n                     , htmlAddStyle\n                     , htmlAlignmentToString\n                     , htmlAttrs\n                     , isDisplayMath\n                     , fixDisplayMath\n                     , unsmartify\n                     , gridTable\n                     , lookupMetaBool\n                     , lookupMetaBlocks\n                     , lookupMetaInlines\n                     , lookupMetaString\n                     , stripLeadingTrailingSpace\n                     , toSubscript\n                     , toSuperscript\n                     , toSubscriptInline\n                     , toSuperscriptInline\n                     , toTableOfContents\n                     , endsWithPlain\n                     , toLegacyTable\n                     , splitSentences\n                     , ensureValidXmlIdentifiers\n                     , removeLinks\n                     , setupTranslations\n                     , isOrderedListMarker\n                     , toTaskListItem\n                     , delimited\n                     , allRowsEmpty\n                     , tableBodiesToRows\n                     , insertCurrentSpansAtColumn\n                     , takePreviousSpansAtColumn\n                     , decrementTrailingRowSpans\n                     )\nwhere\nimport Safe (lastMay, maximumMay)\nimport qualified Data.ByteString.Lazy as BL\nimport Control.Monad (MonadPlus, mzero)\nimport Data.Either (isRight)\nimport Data.Aeson (ToJSON (..), encode)\nimport Data.Char (chr, ord, isSpace, isLetter, isUpper)\nimport Data.List (groupBy, intersperse, transpose)\nimport qualified Data.List as L\nimport Data.List.NonEmpty (NonEmpty((:|)))\nimport Data.Text.Conversions (FromText(..))\nimport qualified Data.Map as M\nimport qualified Data.Text as T\nimport Data.Text (Text)\nimport qualified Text.Pandoc.Builder as Builder\nimport Text.Pandoc.CSS (cssAttributes)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Parsing (runParser, eof, defaultParserState,\n                            anyOrderedListMarker)\nimport Text.DocLayout\nimport Text.Pandoc.Shared (stringify, makeSections, blocksToInlines)\nimport Text.Pandoc.Walk (Walkable(..))\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.XML (escapeStringForXML)\nimport Text.DocTemplates (Context(..), Val(..), TemplateTarget,\n                          ToContext(..), FromContext(..))\nimport Text.Pandoc.Chunks (tocToList, toTOCTree)\nimport Text.Collate.Lang (Lang (..))\nimport Text.Pandoc.Class (PandocMonad, toLang)\nimport Text.Pandoc.Translations (setTranslations)\nimport Data.Maybe (fromMaybe)\nimport qualified Text.Pandoc.Writers.AnnotatedTable as Ann\n\n-- import Debug.Trace\n\n-- | Create template Context from a 'Meta' and an association list\n-- of variables, specified at the command line or in the writer.\n-- Variables overwrite metadata fields with the same names.\n-- If multiple variables are set with the same name, a list is\n-- assigned.  Does nothing if 'writerTemplate' is Nothing.\nmetaToContext :: (Monad m, TemplateTarget a)\n              => WriterOptions\n              -> ([Block] -> m (Doc a))\n              -> ([Inline] -> m (Doc a))\n              -> Meta\n              -> m (Context a)\nmetaToContext opts blockWriter inlineWriter meta =\n  case writerTemplate opts of\n    Nothing -> return mempty\n    Just _  -> addVariablesToContext opts <$>\n                metaToContext' blockWriter inlineWriter meta\n\n-- | Like 'metaToContext, but does not include variables and is\n-- not sensitive to 'writerTemplate'.\nmetaToContext' :: (Monad m, TemplateTarget a)\n           => ([Block] -> m (Doc a))     -- ^ block writer\n           -> ([Inline] -> m (Doc a))    -- ^ inline writer\n           -> Meta\n           -> m (Context a)\nmetaToContext' blockWriter inlineWriter (Meta metamap) =\n  Context <$> mapM (metaValueToVal blockWriter inlineWriter) metamap\n\n-- | Add variables to a template Context, using monoidal append.\n-- Also add `meta-json`.  Note that metadata values are used\n-- in template contexts only when like-named variables aren't set.\naddVariablesToContext :: TemplateTarget a\n                      => WriterOptions -> Context a -> Context a\naddVariablesToContext opts c1 =\n  c2 <> (fromText <$> writerVariables opts) <> c1\n where\n   c2 = Context $\n          M.insert \"meta-json\" (SimpleVal $ literal $ fromText jsonrep)\n                               mempty\n   jsonrep = UTF8.toText $ BL.toStrict $ encode $ toJSON c1\n\n-- | Converts a 'MetaValue' into a doctemplate 'Val', using the given\n-- converter functions.\nmetaValueToVal :: (Monad m, TemplateTarget a)\n               => ([Block] -> m (Doc a))    -- ^ block writer\n               -> ([Inline] -> m (Doc a))   -- ^ inline writer\n               -> MetaValue\n               -> m (Val a)\nmetaValueToVal blockWriter inlineWriter (MetaMap metamap) =\n  MapVal . Context <$> mapM (metaValueToVal blockWriter inlineWriter) metamap\nmetaValueToVal blockWriter inlineWriter (MetaList xs) = ListVal <$>\n  mapM (metaValueToVal blockWriter inlineWriter) xs\nmetaValueToVal _ _ (MetaBool b) = return $ BoolVal b\nmetaValueToVal _ inlineWriter (MetaString s) =\n   SimpleVal <$> inlineWriter (Builder.toList (Builder.text s))\nmetaValueToVal blockWriter _ (MetaBlocks bs) = SimpleVal <$> blockWriter bs\nmetaValueToVal _ inlineWriter (MetaInlines is) = SimpleVal <$> inlineWriter is\n\n\n-- | Retrieve a field value from a template context.\ngetField   :: FromContext a b => Text -> Context a -> Maybe b\ngetField field (Context m) = M.lookup field m >>= fromVal\n\n-- | Set a field of a template context.  If the field already has a value,\n-- convert it into a list with the new value appended to the old value(s).\n-- This is a utility function to be used in preparing template contexts.\nsetField   :: ToContext a b => Text -> b -> Context a -> Context a\nsetField field val (Context m) =\n  Context $ M.insertWith combine field (toVal val) m\n where\n  combine newval (ListVal xs)   = ListVal (xs ++ [newval])\n  combine newval x              = ListVal [x, newval]\n\n-- | Reset a field of a template context.  If the field already has a\n-- value, the new value replaces it.\n-- This is a utility function to be used in preparing template contexts.\nresetField :: ToContext a b => Text -> b -> Context a -> Context a\nresetField field val (Context m) =\n  Context (M.insert field (toVal val) m)\n\n-- | Set a field of a template context if it currently has no value.\n-- If it has a value, do nothing.\n-- This is a utility function to be used in preparing template contexts.\ndefField   :: ToContext a b => Text -> b -> Context a -> Context a\ndefField field val (Context m) =\n  Context (M.insertWith f field (toVal val) m)\n  where\n    f _newval oldval = oldval\n\n-- | Get the contents of the `lang` metadata field or variable.\ngetLang :: WriterOptions -> Meta -> Maybe Text\ngetLang opts meta =\n  case lookupContext \"lang\" (writerVariables opts) of\n        Just s -> Just s\n        _      ->\n          case lookupMeta \"lang\" meta of\n               Just (MetaBlocks [Para [Str s]])  -> Just s\n               Just (MetaBlocks [Plain [Str s]]) -> Just s\n               Just (MetaInlines [Str s])        -> Just s\n               Just (MetaString s)               -> Just s\n               _                                 -> Nothing\n\n-- | Produce an HTML tag with the given pandoc attributes.\ntagWithAttrs :: HasChars a => a -> Attr -> Doc a\ntagWithAttrs tag attr = \"<\" <> literal tag <> (htmlAttrs attr) <> \">\"\n\n-- | Produce HTML for the given pandoc attributes, to be used in HTML tags\nhtmlAttrs :: HasChars a => Attr -> Doc a\nhtmlAttrs (ident, classes, kvs) = addSpaceIfNotEmpty (hsep [\n  if T.null ident\n      then empty\n      else \"id=\" <> doubleQuotes (text $ T.unpack ident)\n  ,if null classes\n      then empty\n      else \"class=\" <> doubleQuotes (text $ T.unpack (T.unwords classes))\n  ,hsep (map (\\(k,v) -> text (T.unpack k) <> \"=\" <>\n                doubleQuotes (text $ T.unpack (escapeStringForXML v))) kvs)\n  ])\n\naddSpaceIfNotEmpty :: HasChars a => Doc a -> Doc a\naddSpaceIfNotEmpty f = if isEmpty f then f else \" \" <> f\n\n-- | Adds a key-value pair to the @style@ attribute.\nhtmlAddStyle :: (Text, Text) -> [(Text, Text)] -> [(Text, Text)]\nhtmlAddStyle (key, value) kvs =\n  let cssToStyle = T.intercalate \" \" . map (\\(k, v) -> k <> \": \" <> v <> \";\")\n  in case break ((== \"style\") . fst) kvs of\n    (_, []) ->\n      -- no style attribute yet, add new one\n      (\"style\", cssToStyle [(key, value)]) : kvs\n    (xs, (_,cssStyles):rest) ->\n      -- modify the style attribute\n      xs ++ (\"style\", cssToStyle modifiedCssStyles) : rest\n      where\n        modifiedCssStyles =\n          case break ((== key) . fst) $ cssAttributes cssStyles of\n            (cssAttribs, []) -> (key, value) : cssAttribs\n            (pre, _:post)    -> pre ++ (key, value) : post\n\n-- | Get the html representation of an alignment key\nhtmlAlignmentToString :: Alignment -> Maybe Text\nhtmlAlignmentToString = \\case\n  AlignLeft    -> Just \"left\"\n  AlignRight   -> Just \"right\"\n  AlignCenter  -> Just \"center\"\n  AlignDefault -> Nothing\n\n-- | Returns 'True' iff the argument is an inline 'Math' element of type\n-- 'DisplayMath'.\nisDisplayMath :: Inline -> Bool\nisDisplayMath (Math DisplayMath _)          = True\nisDisplayMath (Span _ [Math DisplayMath _]) = True\nisDisplayMath _                             = False\n\n-- | Remove leading and trailing 'Space' and 'SoftBreak' elements.\nstripLeadingTrailingSpace :: [Inline] -> [Inline]\nstripLeadingTrailingSpace = go . reverse . go . reverse\n  where go (Space:xs)     = xs\n        go (SoftBreak:xs) = xs\n        go xs             = xs\n\n-- | Put display math in its own block (for ODT/DOCX).\nfixDisplayMath :: Block -> Block\nfixDisplayMath (Plain lst)\n  | any isDisplayMath lst && not (all isDisplayMath lst) =\n    -- chop into several paragraphs so each displaymath is its own\n    Div (\"\",[\"math\"],[]) $\n       map Plain $\n       filter (not . null) $\n       map stripLeadingTrailingSpace $\n       groupBy (\\x y -> (isDisplayMath x && isDisplayMath y) ||\n                         not (isDisplayMath x || isDisplayMath y)) lst\nfixDisplayMath (Para lst)\n  | any isDisplayMath lst && not (all isDisplayMath lst) =\n    -- chop into several paragraphs so each displaymath is its own\n    Div (\"\",[\"math\"],[]) $\n       map Para $\n       filter (not . null) $\n       map stripLeadingTrailingSpace $\n       groupBy (\\x y -> (isDisplayMath x && isDisplayMath y) ||\n                         not (isDisplayMath x || isDisplayMath y)) lst\nfixDisplayMath x = x\n\n-- | Converts a Unicode character into the ASCII sequence used to\n-- represent the character in \"smart\" Markdown.\nunsmartify :: WriterOptions -> Text -> Text\nunsmartify opts = T.concatMap $ \\c -> case c of\n  '\\8217' -> \"'\"\n  '\\8230' -> \"...\"\n  '\\8211'\n    | isEnabled Ext_old_dashes opts -> \"-\"\n    | otherwise                     -> \"--\"\n  '\\8212'\n    | isEnabled Ext_old_dashes opts -> \"--\"\n    | otherwise                     -> \"---\"\n  '\\8220' -> \"\\\"\"\n  '\\8221' -> \"\\\"\"\n  '\\8216' -> \"'\"\n  _       -> T.singleton c\n\n-- | Writes a grid table.\ngridTable :: Monad m\n           => WriterOptions\n           -> (WriterOptions -> [Block] -> m (Doc Text)) -- ^ format Doc writer\n           -> [ColSpec]\n           -> TableHead\n           -> [TableBody]\n           -> TableFoot\n           -> m (Doc Text)\ngridTable opts blocksToDoc colspecs' thead' tbodies' tfoot' = do\n  let Ann.Table _ _ colspecs thead tbodies tfoot =\n        Ann.toTable mempty (Caption Nothing mempty)\n                    colspecs' thead' tbodies' tfoot'\n  let renderRows = fmap addDummies . mapM (gridRow opts blocksToDoc)\n  let getHeadCells (Ann.HeaderRow _ _ cells) = cells\n  let getHeadRows (Ann.TableHead _ rs) = map getHeadCells rs\n  headCells <- renderRows (getHeadRows thead)\n  let getFootRows (Ann.TableFoot _ xs) = map getHeadCells xs\n  footCells <- renderRows (getFootRows tfoot)\n  -- We don't distinguish between row head and regular cells here:\n  let getBodyCells (Ann.BodyRow _ _ rhcells cells) = rhcells ++ cells\n  let getBody (Ann.TableBody _ _ hs xs) = map getHeadCells hs <> map getBodyCells xs\n  bodyCells <- mapM (renderRows . getBody) tbodies\n  let rows = (setTopBorder SingleLine . setBottomBorder DoubleHeaderLine) headCells ++\n             (setTopBorder (if null headCells\n                               then SingleHeaderLine\n                               else SingleLine) . setBottomBorder SingleLine)\n                   (mconcat bodyCells) ++\n             (setTopBorder DoubleLine . setBottomBorder DoubleLine) footCells\n  pure $ gridRows $ redoWidths opts colspecs rows\n\n-- Returns (current widths, full widths, min widths)\nextractColWidths :: WriterOptions -> [[RenderedCell Text]] -> ([Int], [Int], [Int])\nextractColWidths opts rows = (currentwidths, fullwidths, minwidths)\n where\n   getWidths calcOffset =\n     map (fromMaybe 0 . maximumMay) (transpose (map (concatMap (getCellWidths calcOffset)) rows))\n   getCellWidths calcOffset c = replicate (cellColSpan c)\n                                 (calcOffset c `div` (cellColSpan c) +\n                                  calcOffset c `rem` (cellColSpan c))\n   fullwidths = getWidths (max 1 . offset . cellContents)\n   currentwidths = getWidths cellWidth\n   minwidths =\n     case writerWrapText opts of\n       WrapNone -> fullwidths\n       _ -> getWidths (minOffset . cellContents)\n\nresetWidths :: [Int] -> [RenderedCell Text] -> [RenderedCell Text]\nresetWidths _ [] = []\nresetWidths [] cs = cs\nresetWidths (w:ws) (c:cs) =\n  case cellColSpan c of\n    1 -> c{ cellWidth = w } : resetWidths ws cs\n    n | n < 1 -> c : resetWidths ws cs\n      | otherwise -> c{ cellWidth = w + sum (take (n - 1) ws) + (3 * (n-1)) }\n                               : resetWidths (drop (n - 1) ws) cs\n\nredoWidths :: WriterOptions -> [ColSpec] -> [[RenderedCell Text]] -> [[RenderedCell Text]]\nredoWidths _ _ [] = []\nredoWidths opts colspecs rows = map (resetWidths newwidths) rows\n where\n  numcols = length colspecs\n  isSimple = all ((== ColWidthDefault) . snd) colspecs\n  (actualwidths, fullwidths, minwidths) = extractColWidths opts rows\n  totwidth = writerColumns opts - (3 * numcols) - 1\n  evenwidth = totwidth `div` numcols + totwidth `rem` numcols\n  keepwidths = filter (< evenwidth) fullwidths\n  evenwidth' = (totwidth - sum keepwidths) `div`\n                (numcols - length keepwidths)\n  ensureMinWidths = zipWith max minwidths\n  newwidths = ensureMinWidths $\n              case isSimple of\n                True | sum fullwidths <= totwidth -> fullwidths\n                     | otherwise -> map (\\w -> if w < evenwidth\n                                                  then w\n                                                  else evenwidth') fullwidths\n                False -> actualwidths\n\nmakeDummy :: RenderedCell Text -> RenderedCell Text\nmakeDummy c =\n    RenderedCell{ cellColNum = cellColNum c,\n                  cellColSpan = cellColSpan c,\n                  cellColSpecs = cellColSpecs c,\n                  cellAlign = AlignDefault,\n                  cellRowSpan = cellRowSpan c - 1,\n                  cellWidth = cellWidth c,\n                  cellContents = mempty,\n                  cellBottomBorder = NoLine,\n                  cellTopBorder = NoLine }\n\naddDummies :: [[RenderedCell Text]] -> [[RenderedCell Text]]\naddDummies = reverse . L.foldl' go []\n where\n   go [] cs = [cs]\n   go (prevRow:rs) cs = addDummiesToRow prevRow cs : prevRow : rs\n   addDummiesToRow [] cs = cs\n   addDummiesToRow ds [] = map makeDummy ds\n   addDummiesToRow (d:ds) (c:cs) =\n     if cellColNum d < cellColNum c\n        then makeDummy d : addDummiesToRow ds (c:cs)\n        else c : addDummiesToRow\n                   (dropWhile (\\x ->\n                       cellColNum x < cellColNum c + cellColSpan c) (d:ds))\n                   cs\n\n\nsetTopBorder :: LineStyle -> [[RenderedCell Text]] -> [[RenderedCell Text]]\nsetTopBorder _ [] = []\nsetTopBorder sty (cs:rest) = (map (\\c -> c{ cellTopBorder = sty }) cs) : rest\n\nsetBottomBorder :: LineStyle -> [[RenderedCell Text]] -> [[RenderedCell Text]]\nsetBottomBorder _ [] = []\nsetBottomBorder sty [cs] = [map (\\c -> c{ cellBottomBorder = sty }) cs]\nsetBottomBorder sty (c:cs) = c : setBottomBorder sty cs\n\ngridRows :: [[RenderedCell Text]] -> Doc Text\ngridRows [] = mempty\ngridRows (x:xs) =\n  (case x of\n     [] -> mempty\n     (c:_) | isHeaderStyle (cellTopBorder c)\n            -> formatHeaderLine (cellTopBorder c) (x:xs)\n           | otherwise\n            -> formatBorder cellTopBorder False x)\n  $$\n  vcat (zipWith (rowAndBottom (x:xs)) (x:xs) (xs ++ [[]]))\n where\n  -- generate wrapped contents. include pipe borders, bottom and left\n\n  renderCellContents c =\n    -- we don't use cblock or lblock because the content might\n    -- be interpreted as an indented code block...even though it\n    -- would look better to right-align right-aligned cells...\n    -- (TODO: change this on parsing side?)\n    lblock (cellWidth c) (cellContents c)\n\n  formatRow cs = vfill \"| \" <>\n   hcat (intersperse (vfill \" | \") (map renderCellContents cs)) <> vfill \" |\"\n\n  rowAndBottom allRows thisRow nextRow =\n    let isLastRow = null nextRow\n        border1 = case thisRow of\n                     [] -> mempty\n                     (c:_) -> if isHeaderStyle (cellBottomBorder c)\n                                 then formatHeaderLine (cellBottomBorder c) allRows\n                                 else formatBorder cellBottomBorder False thisRow\n        border2 = case nextRow of\n                     [] -> mempty\n                     (c:_) -> if isHeaderStyle (cellTopBorder c)\n                                 then formatHeaderLine (cellTopBorder c) allRows\n                                 else formatBorder cellTopBorder False nextRow\n        combinedBorder = if isLastRow\n                            then border1\n                            else literal $ combineBorders\n                                  (render Nothing border1) (render Nothing border2)\n    in formatRow thisRow $$ combinedBorder\n\ncombineBorders :: Text -> Text -> Text\ncombineBorders t1 t2 =\n  if T.null t1\n     then t2\n     else T.zipWith go t1 t2\n where\n   go '+' _ = '+'\n   go _ '+' = '+'\n   go ':' _ = ':'\n   go _ ':' = ':'\n   go '|' '-' = '+'\n   go '-' '|' = '+'\n   go '|' '=' = '+'\n   go '=' '|' = '+'\n   go '=' _ = '='\n   go _ '=' = '='\n   go ' ' d = d\n   go c _   = c\n\nformatHeaderLine :: Show a => LineStyle -> [[RenderedCell a]] -> Doc Text\nformatHeaderLine lineStyle rows =\n  literal $ L.foldl'\n    (\\t row -> combineBorders t (render Nothing $ formatBorder (const lineStyle) True row))\n    mempty rows\n\nformatBorder :: Show a => (RenderedCell a -> LineStyle) -> Bool\n             -> [RenderedCell a] -> Doc Text\nformatBorder borderStyle alignMarkers cs =\n  borderParts <> if lastBorderStyle == NoLine\n                            then char '|'\n                            else char '+'\n where\n   (lastBorderStyle, borderParts) = L.foldl' addBorder (NoLine, mempty) cs\n   addBorder (prevBorderStyle, accum) c =\n     (borderStyle c, accum <> char junctionChar <> toBorderSection c)\n      where junctionChar = case (borderStyle c, prevBorderStyle) of\n                               (NoLine, NoLine) -> '|'\n                               _ -> '+'\n   toBorderSection c =\n       text $ leftalign : replicate (cellWidth c) lineChar ++ [rightalign]\n     where\n       lineChar = case borderStyle c of\n                     NoLine -> ' '\n                     SingleLine -> '-'\n                     SingleHeaderLine -> '-'\n                     DoubleLine -> '='\n                     DoubleHeaderLine -> '='\n       (leftalign, rightalign) =\n           case cellAlign c of\n             _ | not alignMarkers -> (lineChar,lineChar)\n             AlignLeft -> (':',lineChar)\n             AlignCenter -> (':',':')\n             AlignRight -> (lineChar,':')\n             AlignDefault -> (lineChar,lineChar)\n\ndata LineStyle = NoLine\n               | SingleLine\n               | DoubleLine\n               | SingleHeaderLine\n               | DoubleHeaderLine\n    deriving (Show, Ord, Eq)\n\nisHeaderStyle :: LineStyle -> Bool\nisHeaderStyle SingleHeaderLine = True\nisHeaderStyle DoubleHeaderLine = True\nisHeaderStyle _ = False\n\ndata RenderedCell a =\n  RenderedCell{ cellColNum :: Int\n              , cellColSpan :: Int\n              , cellColSpecs :: NonEmpty ColSpec\n              , cellAlign :: Alignment\n              , cellRowSpan :: Int\n              , cellWidth :: Int\n              , cellContents :: Doc a\n              , cellBottomBorder :: LineStyle\n              , cellTopBorder :: LineStyle\n              }\n  deriving (Show)\n\ngetColWidth :: ColSpec -> Double\ngetColWidth (_, ColWidth n) = n\ngetColWidth (_, ColWidthDefault) = 0 -- TODO?\n\ntoCharWidth :: WriterOptions -> Double -> Int\ntoCharWidth opts width =\n  max 1 (floor (width * fromIntegral (writerColumns opts)) - 3)\n\ngridRow :: (Monad m, HasChars a)\n        => WriterOptions\n        -> (WriterOptions -> [Block] -> m (Doc a)) -- ^ format Doc writer\n        -> [Ann.Cell]\n        -> m [RenderedCell a]\ngridRow opts blocksToDoc = mapM renderCell\n where\n  renderer = blocksToDoc opts\n  renderCell (Ann.Cell cellcolspecs (Ann.ColNumber colnum)\n               (Cell _ _ (RowSpan rowspan) _ blocks)) = do\n    let ((align,_):|_) = cellcolspecs\n    let width = toCharWidth opts $ sum (fmap getColWidth cellcolspecs)\n    rendered <- renderer blocks\n    pure $ RenderedCell{ cellColNum = colnum,\n                         cellColSpan = length cellcolspecs,\n                         cellColSpecs = cellcolspecs,\n                         cellAlign = align,\n                         cellRowSpan = rowspan,\n                         cellWidth = width,\n                         cellContents = rendered,\n                         cellBottomBorder = if rowspan < 2\n                                               then SingleLine\n                                               else NoLine,\n                         cellTopBorder = SingleLine }\n\n\n-- | Retrieve the metadata value for a given @key@\n-- and convert to Bool.\nlookupMetaBool :: Text -> Meta -> Bool\nlookupMetaBool key meta =\n  case lookupMeta key meta of\n      Just (MetaBlocks _)  -> True\n      Just (MetaInlines _) -> True\n      Just (MetaString x)  -> not (T.null x)\n      Just (MetaBool True) -> True\n      _                    -> False\n\n-- | Retrieve the metadata value for a given @key@\n-- and extract blocks.\n--\n-- Note that an empty list is returned for maps, lists, and booleans.\nlookupMetaBlocks :: Text -> Meta -> [Block]\nlookupMetaBlocks key meta =\n  case lookupMeta key meta of\n         Just (MetaBlocks bs)   -> bs\n         Just (MetaInlines ils) -> [Plain ils]\n         Just (MetaString s)    -> [Plain [Str s]]\n         _                      -> []\n\n-- | Retrieve the metadata value for a given @key@\n-- and extract inlines.\n--\n-- Note that an empty list is returned for maps and lists.\nlookupMetaInlines :: Text -> Meta -> [Inline]\nlookupMetaInlines key meta =\n  case lookupMeta key meta of\n         Just (MetaString s)           -> [Str s]\n         Just (MetaInlines ils)        -> ils\n         Just (MetaBlocks [Plain ils]) -> ils\n         Just (MetaBlocks [Para ils])  -> ils\n         _                             -> []\n\n-- | Retrieve the metadata value for a given @key@\n-- and convert to String.\n--\n-- Note that an empty list is returned for maps, lists, and booleans.\nlookupMetaString :: Text -> Meta -> Text\nlookupMetaString key meta =\n  case lookupMeta key meta of\n         Just (MetaString s)    -> s\n         Just (MetaInlines ils) -> stringify ils\n         Just (MetaBlocks bs)   -> stringify bs\n         Just (MetaBool b)      -> T.pack (show b)\n         _                      -> \"\"\n\n-- | Tries to convert a character into a unicode superscript version of\n-- the character.\ntoSuperscript :: Char -> Maybe Char\ntoSuperscript '1' = Just '\\x00B9'\ntoSuperscript '2' = Just '\\x00B2'\ntoSuperscript '3' = Just '\\x00B3'\ntoSuperscript '+' = Just '\\x207A'\ntoSuperscript '-' = Just '\\x207B'\ntoSuperscript '\\x2212' = Just '\\x207B' -- unicode minus\ntoSuperscript '=' = Just '\\x207C'\ntoSuperscript '(' = Just '\\x207D'\ntoSuperscript ')' = Just '\\x207E'\ntoSuperscript c\n  | c >= '0' && c <= '9' =\n                 Just $ chr (0x2070 + (ord c - 48))\n  | isSpace c = Just c\n  | otherwise = Nothing\n\n-- | Tries to convert a character into a unicode subscript version of\n-- the character.\ntoSubscript :: Char -> Maybe Char\ntoSubscript '+' = Just '\\x208A'\ntoSubscript '-' = Just '\\x208B'\ntoSubscript '=' = Just '\\x208C'\ntoSubscript '(' = Just '\\x208D'\ntoSubscript ')' = Just '\\x208E'\ntoSubscript c\n  | c >= '0' && c <= '9' =\n                 Just $ chr (0x2080 + (ord c - 48))\n  | isSpace c = Just c\n  | otherwise = Nothing\n\ntoSubscriptInline :: Inline -> Maybe Inline\ntoSubscriptInline Space = Just Space\ntoSubscriptInline (Span attr ils) = Span attr <$> traverse toSubscriptInline ils\ntoSubscriptInline (Str s) = Str . T.pack <$> traverse toSubscript (T.unpack s)\ntoSubscriptInline LineBreak = Just LineBreak\ntoSubscriptInline SoftBreak = Just SoftBreak\ntoSubscriptInline _ = Nothing\n\ntoSuperscriptInline :: Inline -> Maybe Inline\ntoSuperscriptInline Space = Just Space\ntoSuperscriptInline (Span attr ils) = Span attr <$> traverse toSuperscriptInline ils\ntoSuperscriptInline (Str s) = Str . T.pack <$> traverse toSuperscript (T.unpack s)\ntoSuperscriptInline LineBreak = Just LineBreak\ntoSuperscriptInline SoftBreak = Just SoftBreak\ntoSuperscriptInline _ = Nothing\n\n-- | Construct table of contents (as a bullet list) from document body.\ntoTableOfContents :: WriterOptions\n                  -> [Block]\n                  -> Block\ntoTableOfContents opts =\n  tocToList (writerNumberSections opts) (writerTOCDepth opts)\n  . toTOCTree\n  . makeSections (writerNumberSections opts) Nothing\n\n-- | Returns 'True' iff the list of blocks has a @'Plain'@ as its last\n-- element.\nendsWithPlain :: [Block] -> Bool\nendsWithPlain xs =\n  case lastMay xs of\n    Just Plain{} -> True\n    Just (BulletList is) -> maybe False endsWithPlain (lastMay is)\n    Just (OrderedList _ is) -> maybe False endsWithPlain (lastMay is)\n    _ -> False\n\n-- | Convert the relevant components of a new-style table (with block\n-- caption, row headers, row and column spans, and so on) to those of\n-- an old-style table (inline caption, table head with one row, no\n-- foot, and so on). Cells with a 'RowSpan' and 'ColSpan' of @(h, w)@\n-- will be cut up into @h * w@ cells of dimension @(1, 1)@, with the\n-- content placed in the upper-left corner.\ntoLegacyTable :: Caption\n              -> [ColSpec]\n              -> TableHead\n              -> [TableBody]\n              -> TableFoot\n              -> ([Inline], [Alignment], [Double], [[Block]], [[[Block]]])\ntoLegacyTable (Caption _ cbody) specs thead tbodies tfoot\n  = (cbody', aligns, widths, th', tb')\n  where\n    numcols = length specs\n    (aligns, mwidths) = unzip specs\n    fromWidth (ColWidth w) | w > 0 = w\n    fromWidth _                    = 0\n    widths = map fromWidth mwidths\n    unRow (Row _ x) = x\n    unBody (TableBody _ _ hd bd) = hd <> bd\n    unBodies = concatMap unBody\n\n    TableHead _ th = Builder.normalizeTableHead numcols thead\n    tb = map (Builder.normalizeTableBody numcols) tbodies\n    TableFoot _ tf = Builder.normalizeTableFoot numcols tfoot\n\n    cbody' = blocksToInlines cbody\n\n    (th', tb') = case th of\n      r:rs -> let (pendingPieces, r') = placeCutCells [] $ unRow r\n                  rs' = cutRows pendingPieces $ rs <> unBodies tb <> tf\n              in (r', rs')\n      []    -> ([], cutRows [] $ unBodies tb <> tf)\n\n    -- Adapted from placeRowSection in Builders. There is probably a\n    -- more abstract foldRowSection that unifies them both.\n    placeCutCells pendingPieces cells\n      -- If there are any pending pieces for a column, add\n      -- them. Pending pieces have preference over cells due to grid\n      -- layout rules.\n      | (p:ps):pendingPieces' <- pendingPieces\n      = let (pendingPieces'', rowPieces) = placeCutCells pendingPieces' cells\n        in (ps : pendingPieces'', p : rowPieces)\n      -- Otherwise cut up a cell on the row and deal with its pieces.\n      | c:cells' <- cells\n      = let (h, w, cBody) = getComponents c\n            cRowPieces = cBody : replicate (w - 1) mempty\n            cPendingPieces = replicate w $ replicate (h - 1) mempty\n            pendingPieces' = drop w pendingPieces\n            (pendingPieces'', rowPieces) = placeCutCells pendingPieces' cells'\n        in (cPendingPieces <> pendingPieces'', cRowPieces <> rowPieces)\n      | otherwise = ([], [])\n\n    cutRows pendingPieces (r:rs)\n      = let (pendingPieces', r') = placeCutCells pendingPieces $ unRow r\n            rs' = cutRows pendingPieces' rs\n        in r' : rs'\n    cutRows _ [] = []\n\n    getComponents (Cell _ _ (RowSpan h) (ColSpan w) body)\n      = (h, w, body)\n\nsplitSentences :: Doc Text -> Doc Text\nsplitSentences = go . toList\n where\n  go [] = mempty\n  go (Text len t : AfterBreak _ : BreakingSpace : xs)\n    | isSentenceEnding t = Text len t <> NewLine <> go xs\n  go (Text len t : BreakingSpace : xs)\n    | isSentenceEnding t = Text len t <> NewLine <> go xs\n  go (x:xs) = x <> go xs\n\n  toList (Concat (Concat a b) c) = toList (Concat a (Concat b c))\n  toList (Concat a b) = a : toList b\n  toList x = [x]\n\n  isSentenceEnding t =\n    case T.unsnoc t of\n      Just (t',c)\n        | c == '.' || c == '!' || c == '?'\n        , not (isInitial t') -> True\n        | c == ')' || c == ']' || c == '\"' || c == '\\x201D' ->\n           case T.unsnoc t' of\n             Just (t'',d) -> d == '.' || d == '!' || d == '?' &&\n                             not (isInitial t'')\n             _ -> False\n      _ -> False\n   where\n    isInitial x = T.length x == 1 && T.all isUpper x\n\n-- | Ensure that all identifiers start with a letter,\n-- and modify internal links accordingly. (Yes, XML allows an\n-- underscore, but HTML 4 doesn't, so we are more conservative.)\nensureValidXmlIdentifiers :: Pandoc -> Pandoc\nensureValidXmlIdentifiers = walk fixLinks . walkAttr fixIdentifiers\n where\n  fixIdentifiers (ident, classes, kvs) =\n    (case T.uncons ident of\n      Nothing -> ident\n      Just (c, _) | isLetter c -> ident\n      _ -> \"id_\" <> ident,\n     classes, kvs)\n  needsFixing src =\n    case T.uncons src of\n      Just ('#',t) ->\n        case T.uncons t of\n          Just (c,_) | not (isLetter c) -> Just (\"#id_\" <> t)\n          _ -> Nothing\n      _ -> Nothing\n  fixLinks (Link attr ils (src, tit))\n    | Just src' <- needsFixing src = Link attr ils (src', tit)\n  fixLinks (Image attr ils (src, tit))\n    | Just src' <- needsFixing src = Image attr ils (src', tit)\n  fixLinks x = x\n\n-- | Walk Pandoc document, modifying attributes.\nwalkAttr :: (Attr -> Attr) -> Pandoc -> Pandoc\nwalkAttr f = walk goInline . walk goBlock\n where\n  goInline (Span attr ils) = Span (f attr) ils\n  goInline (Link attr ils target) = Link (f attr) ils target\n  goInline (Image attr ils target) = Image (f attr) ils target\n  goInline (Code attr txt) = Code (f attr) txt\n  goInline x = x\n\n  goBlock (Header lev attr ils) = Header lev (f attr) ils\n  goBlock (CodeBlock attr txt) = CodeBlock (f attr) txt\n  goBlock (Table attr cap colspecs thead tbodies tfoot) =\n    Table (f attr) cap colspecs thead tbodies tfoot\n  goBlock (Div attr bs) = Div (f attr) bs\n  goBlock x = x\n\n-- | Convert links to spans; most useful when writing elements that must not\n-- contain links, e.g. to avoid nested links.\nremoveLinks :: [Inline] -> [Inline]\nremoveLinks = walk go\n where\n  go (Link attr ils _) = Span attr ils\n  go x = x\n\n-- | Set translations based on the `lang` in metadata.\nsetupTranslations :: PandocMonad m => Meta -> m ()\nsetupTranslations meta = do\n  let defLang = Lang \"en\" (Just \"US\") Nothing [] [] []\n  lang <- case lookupMetaString \"lang\" meta of\n            \"\" -> pure defLang\n            s  -> fromMaybe defLang <$> toLang (Just s)\n  setTranslations lang\n\n-- True if the string would count as a Markdown ordered list marker.\nisOrderedListMarker :: Text -> Bool\nisOrderedListMarker xs = not (T.null xs) && (T.last xs `elem` ['.',')']) &&\n              isRight (runParser (anyOrderedListMarker >> eof)\n                       defaultParserState \"\" xs)\n\ntoTaskListItem :: MonadPlus m => [Block] -> m (Bool, [Block])\ntoTaskListItem (Plain (Str \"☐\":Space:ils):xs) = pure (False, Plain ils:xs)\ntoTaskListItem (Plain (Str \"☒\":Space:ils):xs) = pure (True, Plain ils:xs)\ntoTaskListItem (Para  (Str \"☐\":Space:ils):xs) = pure (False, Para ils:xs)\ntoTaskListItem (Para  (Str \"☒\":Space:ils):xs) = pure (True, Para ils:xs)\ntoTaskListItem _                              = mzero\n\n-- | Add an opener and closer to a Doc. If the Doc begins or ends\n-- with whitespace, export this outside the opener or closer.\n-- This is used for formats, like Markdown, which don't allow spaces\n-- after opening or before closing delimiters.\ndelimited :: Doc Text -> Doc Text -> Doc Text -> Doc Text\ndelimited opener closer content =\n  mconcat initialWS <> opener <> mconcat middle <> closer <> mconcat finalWS\n where\n  contents = toList content\n  (initialWS, rest) = span isWS contents\n  (reverseFinalWS, reverseMiddle) = span isWS (reverse rest)\n  finalWS = reverse reverseFinalWS\n  middle = reverse reverseMiddle\n  isWS NewLine = True\n  isWS CarriageReturn = True\n  isWS BreakingSpace = True\n  isWS BlankLines{} = True\n  isWS _ = False\n  toList (Concat (Concat a b) c) = toList (Concat a (Concat b c))\n  toList (Concat a b) = a : toList b\n  toList x = [x]\n\n-- | Determine whether all rows and their cells are empty.\nallRowsEmpty :: [Row] -> Bool\nallRowsEmpty = all isEmptyRow\n where\n  isEmptyRow (Row _ cells) = all isEmptyCell cells\n  isEmptyCell (Cell _ _ _ _ blocks) = null blocks\n\n-- | Concatenates the header and body Rows of a List of TableBody into a flat\n-- List of Rows.\ntableBodiesToRows :: [TableBody] -> [Row]\ntableBodiesToRows = concatMap tableBodyToRows\n  where\n    tableBodyToRows (TableBody _ _ headerRows bodyRows) = headerRows ++ bodyRows\n\n-- | Insert the current span information of a table cell to keep track of it in\n-- subsequent rows.\n--\n-- If 'RowSpan' @> 1@, the current span information will be inserted. Otherwise\n-- the previous span information will be left unchanged.\n--\n-- Use 'takePreviousSpansAtColumn' to take previous span information at\n-- subsequent rows. Use 'decrementTrailingRowSpans' to handle previous trailing\n-- spans at the end of a row.\n--\n-- For writers that need to manually apply the 'RowSpan' of cells over multiple\n-- rows or otherwise have to keep track of it.\ninsertCurrentSpansAtColumn :: Int -> M.Map Int (RowSpan, ColSpan) -> RowSpan -> ColSpan -> M.Map Int (RowSpan, ColSpan)\ninsertCurrentSpansAtColumn columnPosition previousSpans (RowSpan rowSpan) colSpan =\n  if (rowSpan > 1)\n    then M.insert columnPosition (RowSpan rowSpan - 1, colSpan) previousSpans -- Minus its own row.\n    else previousSpans\n\n-- | Take previous span information at a column position that was added with\n-- 'insertCurrentSpansAtColumn' if available.\n--\n-- If the previous 'RowSpan' @>= 1@, this will return 'Just' the previous\n-- 'ColSpan' and an adjusted span information where that 'RowSpan' is either\n-- decremented or deleted if it would fall to 0. Otherwise this will return\n-- 'Nothing'.\ntakePreviousSpansAtColumn :: Int -> M.Map Int (RowSpan, ColSpan) -> Maybe (ColSpan, M.Map Int (RowSpan, ColSpan))\ntakePreviousSpansAtColumn columnPosition previousSpans\n  | Just previous@(RowSpan previousRowSpan, previousColSpan) <- M.lookup columnPosition previousSpans\n  , previousRowSpan >= 1 = Just (previousColSpan, decrementPreviousRowSpans previous)\n  | otherwise = Nothing\n where\n  decrementPreviousRowSpans (RowSpan previousRowSpan, previousColSpan) =\n    if previousRowSpan > 1\n      then M.insert columnPosition (RowSpan previousRowSpan - 1, previousColSpan) previousSpans\n      else M.delete columnPosition previousSpans\n\n-- | Decrement all previously tracked trailing 'RowSpan' elements at or after a\n-- column position.\n--\n-- For handling previous row spans that are next to the end of a row's cells\n-- that were previously added with 'insertCurrentSpansAtColumn'.\ndecrementTrailingRowSpans :: Int -> M.Map Int (RowSpan, ColSpan) -> M.Map Int (RowSpan, ColSpan)\ndecrementTrailingRowSpans columnPosition = M.mapWithKey decrementTrailing\n  where\n    decrementTrailing previousColumnPosition previousSpan@(RowSpan rowSpan, colSpan) =\n      if previousColumnPosition >= columnPosition && rowSpan >= 1\n        then (RowSpan rowSpan - 1, colSpan)\n        else previousSpan\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/TEI.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE PatternGuards     #-}\n{- |\n   Module      : Text.Pandoc.Writers.TEI\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to TEI XML\n-}\nmodule Text.Pandoc.Writers.TEI (writeTEI) where\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Highlighting (languages, languagesByExtension)\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.XML\n\n-- | Convert Pandoc document to string in TEI XML format.\nwriteTEI :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteTEI opts doc = do\n  let Pandoc meta blocks = ensureValidXmlIdentifiers doc\n  let colwidth = if writerWrapText opts == WrapAuto\n                    then Just $ writerColumns opts\n                    else Nothing\n  let startLvl = case writerTopLevelDivision opts of\n                   TopLevelPart    -> -1\n                   TopLevelChapter -> 0\n                   TopLevelSection -> 1\n                   TopLevelDefault -> 1\n  let fromBlocks = blocksToTEI opts . makeSections False (Just startLvl)\n  metadata <- metaToContext opts\n                 fromBlocks\n                 (fmap chomp . inlinesToTEI opts)\n                 meta\n  main    <- fromBlocks blocks\n  let context = defField \"body\" main\n              $ defField \"mathml\" (case writerHTMLMathMethod opts of\n                                          MathML -> True\n                                          _      -> False) metadata\n  return $ render colwidth $\n    case writerTemplate opts of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\n-- | Convert a list of Pandoc blocks to TEI.\nblocksToTEI :: PandocMonad m => WriterOptions -> [Block] -> m (Doc Text)\nblocksToTEI opts bs = vcat <$> mapM (blockToTEI opts) bs\n\n-- | Auxiliary function to convert Plain block to Para.\nplainToPara :: Block -> Block\nplainToPara (Plain x) = Para x\nplainToPara x         = x\n\n-- | Convert a list of pairs of terms and definitions into a TEI\n-- list with labels and items.\ndeflistItemsToTEI :: PandocMonad m\n                  => WriterOptions -> [([Inline],[[Block]])] -> m (Doc Text)\ndeflistItemsToTEI opts items =\n vcat <$> mapM (uncurry (deflistItemToTEI opts)) items\n\n-- | Convert a term and a list of blocks into a TEI varlistentry.\ndeflistItemToTEI :: PandocMonad m\n                 => WriterOptions -> [Inline] -> [[Block]] -> m (Doc Text)\ndeflistItemToTEI opts term defs = do\n  term' <- inlinesToTEI opts term\n  defs' <- blocksToTEI opts $ concatMap (map plainToPara) defs\n  return $ inTagsIndented \"label\" term' $$\n           inTagsIndented \"item\" defs'\n\n-- | Convert a list of lists of blocks to a list of TEI list items.\nlistItemsToTEI :: PandocMonad m => WriterOptions -> [[Block]] -> m (Doc Text)\nlistItemsToTEI opts items = vcat <$> mapM (listItemToTEI opts) items\n\n-- | Convert a list of blocks into a TEI list item.\nlistItemToTEI :: PandocMonad m => WriterOptions -> [Block] -> m (Doc Text)\nlistItemToTEI opts item =\n  inTagsIndented \"item\" <$> blocksToTEI opts (map plainToPara item)\n\nimageToTEI :: PandocMonad m => WriterOptions -> Attr -> Text -> m (Doc Text)\nimageToTEI opts attr src = return $ selfClosingTag \"graphic\" $\n  (\"url\", src) : idFromAttr opts attr ++ dims\n  where\n    dims = go Width \"width\" ++ go Height \"height\"\n    go dir dstr = case dimension dir attr of\n                    Just a  -> [(dstr, tshow a)]\n                    Nothing -> []\n\n-- | Convert a Pandoc block element to TEI.\nblockToTEI :: PandocMonad m => WriterOptions -> Block -> m (Doc Text)\nblockToTEI opts (Div attr@(_,\"section\":_,_) (Header lvl _ ils : xs)) =\n  do\n  -- TEI doesn't allow sections with no content, so insert some if needed\n  let xs' = if null xs\n               then [Para []]\n               else xs\n      -- level numbering correspond to LaTeX internals\n      divType = case lvl of\n                 n | n == -1          -> \"part\"\n                   | n == 0           -> \"chapter\"\n                   | n >= 1 && n <= 5 -> \"level\" <> tshow n\n                   | otherwise        -> \"section\"\n  titleContents <- inlinesToTEI opts ils\n  contents <- blocksToTEI opts xs'\n  return $ inTags True \"div\" ((\"type\", divType) : idFromAttr opts attr) $\n      inTagsSimple \"head\" titleContents $$ contents\n-- Add ids to paragraphs in divs with ids - this is needed for\n-- pandoc-citeproc to get link anchors in bibliographies:\nblockToTEI opts (Div attr [Para lst]) = do\n  let attribs = idFromAttr opts attr\n  inTags False \"p\" attribs <$> inlinesToTEI opts lst\nblockToTEI opts (Div _ bs) = blocksToTEI opts $ map plainToPara bs\nblockToTEI _ h@Header{} = do\n  -- should not occur after makeSections, except inside lists/blockquotes\n  report $ BlockNotRendered h\n  return empty\n-- For TEI simple, text must be within containing block element, so\n-- we use treat as Para to ensure that Plain text ends up contained by\n-- something:\nblockToTEI opts (Plain lst) = blockToTEI opts $ Para lst\nblockToTEI opts (Para lst) =\n  inTags False \"p\" [] <$> inlinesToTEI opts lst\nblockToTEI opts (LineBlock lns) =\n  blockToTEI opts $ linesToPara lns\nblockToTEI opts (BlockQuote blocks) =\n  inTagsIndented \"quote\" <$> blocksToTEI opts blocks\nblockToTEI opts (CodeBlock (_,classes,_) str) =\n  return $ literal (\"<ab type='codeblock \" <> lang <> \"'>\") <> cr <>\n     flush (literal (escapeStringForXML str) <> cr <> text \"</ab>\")\n    where lang  = case langs of\n                    [] -> \"\"\n                    (l:_) -> escapeStringForXML l\n          syntaxMap = writerSyntaxMap opts\n          isLang l    = T.toLower l `elem` map T.toLower (languages syntaxMap)\n          langsFrom s = if isLang s\n                           then [s]\n                           else (languagesByExtension syntaxMap) . T.toLower $ s\n          langs       = concatMap langsFrom classes\nblockToTEI opts (BulletList lst) = do\n  let attribs = [(\"type\", \"unordered\")]\n  inTags True \"list\" attribs <$> listItemsToTEI opts lst\nblockToTEI _ (OrderedList _ []) = return empty\nblockToTEI opts (OrderedList (start, numstyle, _) (first:rest)) = do\n  let attribs = case numstyle of\n                       DefaultStyle -> []\n                       Decimal      -> [(\"type\", \"ordered:arabic\")]\n                       Example      -> [(\"type\", \"ordered:arabic\")]\n                       UpperAlpha   -> [(\"type\", \"ordered:upperalpha\")]\n                       LowerAlpha   -> [(\"type\", \"ordered:loweralpha\")]\n                       UpperRoman   -> [(\"type\", \"ordered:upperroman\")]\n                       LowerRoman   -> [(\"type\", \"ordered:lowerroman\")]\n  items <- if start == 1\n              then listItemsToTEI opts (first:rest)\n              else do\n                fi <- blocksToTEI opts $ map plainToPara first\n                re <- listItemsToTEI opts rest\n                return $ inTags True \"item\" [(\"n\",tshow start)] fi $$ re\n  return $ inTags True \"list\" attribs items\nblockToTEI opts (DefinitionList lst) = do\n  let attribs = [(\"type\", \"definition\")]\n  inTags True \"list\" attribs <$> deflistItemsToTEI opts lst\nblockToTEI _ b@(RawBlock f str)\n  | f == \"tei\"     = return $ literal str\n  -- raw TEI block (should such a thing exist).\n  | otherwise      = do\n    report $ BlockNotRendered b\n    return empty\nblockToTEI _ HorizontalRule = return $\n  selfClosingTag \"milestone\" [(\"unit\",\"undefined\")\n                             ,(\"type\",\"separator\")\n                             ,(\"rendition\",\"line\")]\nblockToTEI opts (Figure attr capt bs) =\n  blockToTEI opts (figureDiv attr capt bs)\n\n-- TEI Tables\n-- TEI Simple's tables are composed of cells and rows; other\n-- table info in the AST is here lossily discard.\nblockToTEI opts (Table _ blkCapt specs thead tbody tfoot) = do\n  let (_, _, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  headers' <- if null headers then pure mempty else tableHeadersToTEI opts headers\n  rows' <- mapM (tableRowToTEI opts) rows\n  return $ inTags True \"table\" [] $ headers' $$ vcat rows'\n\ntableRowToTEI :: PandocMonad m\n              => WriterOptions\n              -> [[Block]]\n              -> m (Doc Text)\ntableRowToTEI opts cols =\n  inTagsIndented \"row\" . vcat <$> mapM (tableItemToTEI opts) cols\n\ntableHeadersToTEI :: PandocMonad m\n                  => WriterOptions\n                  -> [[Block]]\n                  -> m (Doc Text)\ntableHeadersToTEI opts cols =\n  inTags True \"row\" [(\"role\",\"label\")] . vcat <$>\n    mapM (tableItemToTEI opts) cols\n\ntableItemToTEI :: PandocMonad m\n               => WriterOptions\n               -> [Block]\n               -> m (Doc Text)\ntableItemToTEI opts item =\n  inTags False \"cell\" [] . vcat <$> mapM (blockToTEI opts) item\n\n-- | Convert a list of inline elements to TEI.\ninlinesToTEI :: PandocMonad m => WriterOptions -> [Inline] -> m (Doc Text)\ninlinesToTEI opts lst = hcat <$> mapM (inlineToTEI opts) lst\n\n-- | Convert an inline element to TEI.\ninlineToTEI :: PandocMonad m => WriterOptions -> Inline -> m (Doc Text)\ninlineToTEI _ (Str str) = return $ literal $ escapeStringForXML str\ninlineToTEI opts (Emph lst) =\n  inTags False \"hi\" [(\"rendition\",\"simple:italic\")] <$> inlinesToTEI opts lst\ninlineToTEI opts (Underline lst) =\n  inTags False \"hi\" [(\"rendition\",\"simple:underline\")] <$> inlinesToTEI opts lst\ninlineToTEI opts (Strong lst) =\n  inTags False \"hi\" [(\"rendition\", \"simple:bold\")] <$> inlinesToTEI opts lst\ninlineToTEI opts (Strikeout lst) =\n  inTags False \"hi\" [(\"rendition\", \"simple:strikethrough\")] <$>\n  inlinesToTEI opts lst\ninlineToTEI opts (Superscript lst) =\n  inTags False \"hi\" [(\"rendition\", \"simple:superscript\")] <$>\n    inlinesToTEI opts lst\ninlineToTEI opts (Subscript lst) =\n  inTags False \"hi\" [(\"rendition\", \"simple:subscript\")] <$>\n    inlinesToTEI opts lst\ninlineToTEI opts (SmallCaps lst) =\n  inTags False \"hi\" [(\"rendition\", \"simple:smallcaps\")] <$>\n    inlinesToTEI opts lst\ninlineToTEI opts (Quoted _ lst) =\n  inTagsSimple \"quote\" <$> inlinesToTEI opts lst\ninlineToTEI opts (Cite _ lst) =\n  inlinesToTEI opts lst\ninlineToTEI opts (Span _ ils) =\n  inlinesToTEI opts ils\ninlineToTEI _ (Code _ str) = return $\n  inTags False \"seg\" [(\"type\",\"code\")] $ literal (escapeStringForXML str)\n-- Distinguish display from inline math by wrapping the former in a \"figure.\"\ninlineToTEI _ (Math t str) = return $\n  case t of\n    InlineMath  -> inTags False \"formula\" [(\"notation\",\"TeX\")] $\n                   literal str\n    DisplayMath -> inTags True \"figure\" [(\"type\",\"math\")] $\n                   inTags False \"formula\" [(\"notation\",\"TeX\")] $ literal str\n\ninlineToTEI _ il@(RawInline f x) | f == \"tei\"     = return $ literal x\n                                 | otherwise      = empty <$\n                                     report (InlineNotRendered il)\ninlineToTEI _ LineBreak = return $ selfClosingTag \"lb\" []\ninlineToTEI _ Space =\n            return space\n-- because we use \\n for LineBreak, we can't do soft breaks:\ninlineToTEI _ SoftBreak =\n            return space\ninlineToTEI opts (Link attr txt (src, _))\n  | Just email <- T.stripPrefix \"mailto:\" src = do\n      let emailLink = literal $\n                      escapeStringForXML email\n      case txt of\n           [Str s] | escapeURI s == email ->\n                       return emailLink\n           _             -> do\n              linktext <- inlinesToTEI opts txt\n              return $ linktext <+> char '(' <> emailLink <> char ')'\n  | otherwise =\n      inTags False \"ref\" ((\"target\", src) : idFromAttr opts attr)\n                 <$> inlinesToTEI opts txt\ninlineToTEI opts (Image attr description (src, tit)) = do\n  let titleDoc = if T.null tit\n                   then empty\n                   else inTags False \"figDesc\" []\n                           (literal $ escapeStringForXML tit)\n  imageDesc <- if null description\n                  then return empty\n                  else inTags False \"head\" []\n                         <$> inlinesToTEI opts description\n  img <- imageToTEI opts attr src\n  return $ inTagsIndented \"figure\" $ imageDesc $$ img $$ titleDoc\ninlineToTEI opts (Note contents) =\n  inTagsIndented \"note\" <$> blocksToTEI opts contents\n\nidFromAttr :: WriterOptions -> Attr -> [(Text, Text)]\nidFromAttr opts (id',_,_) =\n  [(\"xml:id\", writerIdentifierPrefix opts <> id') | not (T.null id')]\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Texinfo.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.Texinfo\n   Copyright   : Copyright (C) 2008-2024 John MacFarlane\n                               2012 Peter Wang\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' format into Texinfo.\n-}\nmodule Text.Pandoc.Writers.Texinfo ( writeTexinfo ) where\nimport Control.Monad (zipWithM, unless)\nimport Control.Monad.Except (throwError)\nimport Control.Monad.State.Strict\n    ( StateT, MonadState(get), gets, modify, evalStateT )\nimport Data.Char (chr, ord, isAlphaNum)\nimport Data.List (maximumBy, transpose)\nimport qualified Data.List as L\nimport Data.List.NonEmpty (nonEmpty)\nimport Data.Ord (comparing)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Network.URI (unEscapeString)\nimport System.FilePath\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Walk (walkM)\nimport Text.Pandoc.Error\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\nimport Text.Printf (printf)\n\ndata WriterState =\n  WriterState { stStrikeout   :: Bool  -- document contains strikeout\n              , stContext     :: Context\n              , stNodes       :: M.Map Text Int -- maps node to number of duplicates\n              , stHeadings    :: M.Map Text Text -- header ids to node texts\n              , stOptions     :: WriterOptions -- writer options\n              }\n\ndata Context = NormalContext | NodeContext\n  deriving (Eq, Show)\n\nwithContext :: PandocMonad m => Context -> TI m a -> TI m a\nwithContext context pa = do\n  oldContext <- gets stContext\n  modify $ \\s -> s{ stContext = context }\n  res <- pa\n  modify $ \\s -> s{ stContext = oldContext }\n  pure res\n\ndisallowedInNode :: Char -> Bool\ndisallowedInNode c = c `elem` ['.',':',',','(',')']\n\n{- TODO:\n - internal cross references a la HTML\n - generated .texi files don't work when run through texi2dvi\n -}\n\ntype TI m = StateT WriterState m\n\n-- | Convert Pandoc to Texinfo.\nwriteTexinfo :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteTexinfo options document =\n  evalStateT (pandocToTexinfo options $ wrapTop document)\n  WriterState { stStrikeout = False,\n                stContext = NormalContext,\n                stNodes = mempty,\n                stHeadings = mempty,\n                stOptions = options}\n\n-- | Add a \"Top\" node around the document, needed by Texinfo.\nwrapTop :: Pandoc -> Pandoc\nwrapTop (Pandoc meta blocks) =\n  Pandoc meta (Header 0 nullAttr (docTitle meta) : blocks)\n\naddNodeText :: PandocMonad m => Block -> TI m Block\naddNodeText (Header lev (ident,_,_) ils) | lev >= 1 && lev <= 4 = do\n  node <- render Nothing <$> withContext NodeContext (inlineListToTexinfo ils)\n  nodes <- gets stNodes\n  node' <- case M.lookup node nodes of\n                Just i -> do\n                  modify $ \\st -> st{ stNodes = M.adjust (+ 1) node nodes }\n                  pure $ node <> \" \" <> tshow (i + 1)\n                Nothing -> do\n                  modify $ \\st -> st{ stNodes = M.insert node 1 nodes }\n                  pure node\n  unless (T.null ident) $\n    modify $ \\st -> st{ stHeadings = M.insert ident node' (stHeadings st) }\n  pure $ Header lev (ident,[],[(\"node\", node')]) ils\naddNodeText x = pure  x\n\npandocToTexinfo :: PandocMonad m => WriterOptions -> Pandoc -> TI m Text\npandocToTexinfo options (Pandoc meta blocks') = do\n  blocks <- walkM addNodeText blocks'\n  let titlePage = not $ all null\n                      $ docTitle meta : docDate meta : docAuthors meta\n  let colwidth = if writerWrapText options == WrapAuto\n                    then Just $ writerColumns options\n                    else Nothing\n  metadata <- metaToContext options\n              blockListToTexinfo\n              (fmap chomp .inlineListToTexinfo)\n              meta\n  body <- blockListToTexinfo blocks\n  st <- get\n  let context = defField \"body\" body\n              $ defField \"toc\" (writerTableOfContents options)\n              $ defField \"titlepage\" titlePage\n              $ defField \"strikeout\" (stStrikeout st) metadata\n  return $ render colwidth $\n    case writerTemplate options of\n       Nothing  -> body\n       Just tpl -> renderTemplate tpl context\n\n-- | Escape things as needed for Texinfo.\nstringToTexinfo :: PandocMonad m => Text -> TI m Text\nstringToTexinfo t\n  | T.all isAlphaNum t = pure t\n  | otherwise = do\n      context <- gets stContext\n      let escChar '{'      = \"@{\"\n          escChar '}'      = \"@}\"\n          escChar '@'      = \"@@\"\n          escChar '\\160'   = \"@ \"\n          escChar '\\x2014' = \"---\"\n          escChar '\\x2013' = \"--\"\n          escChar '\\x2026' = \"@dots{}\"\n          escChar '\\x2019' = \"'\"\n          escChar ',' | context == NodeContext = \"\"\n          escChar ':' | context == NodeContext = \"\"\n          escChar '.' | context == NodeContext = \"\"\n          escChar '(' | context == NodeContext = \"\"\n          escChar ')' | context == NodeContext = \"\"\n          escChar c        = T.singleton c\n      pure $ T.concatMap escChar t\n\n-- | Puts contents into Texinfo command.\ninCmd :: Text -> Doc Text -> Doc Text\ninCmd cmd contents = char '@' <> literal cmd <> braces contents\n\nisCodeOrBreak :: Inline -> Bool\nisCodeOrBreak (Code{}) = True\nisCodeOrBreak LineBreak = True\nisCodeOrBreak _ = False\n\nisCode :: Inline -> Bool\nisCode (Code{}) = True\nisCode _ = False\n\ncodeToStr :: Inline -> Inline\ncodeToStr (Code _ s) = Str s\ncodeToStr x = x\n\n-- | Convert Pandoc block element to Texinfo.\nblockToTexinfo :: PandocMonad m\n               => Block     -- ^ Block to convert\n               -> TI m (Doc Text)\n\nblockToTexinfo (Div _ bs) = blockListToTexinfo bs\n\nblockToTexinfo (Plain lst) =\n  inlineListToTexinfo lst\n\n-- this is handled differently from Plain in blockListToTexinfo\nblockToTexinfo (Para lst)\n  | all isCodeOrBreak lst\n      = (\\xs -> \"@example\" $$ vcat xs $$ \"@end example\")\n          <$> mapM (inlineToTexinfo . codeToStr) (filter isCode lst)\n  | otherwise = inlineListToTexinfo lst\n\nblockToTexinfo (LineBlock lns) =\n  blockToTexinfo $ linesToPara lns\n\nblockToTexinfo (BlockQuote lst) = do\n  contents <- blockListToTexinfo lst\n  return $ text \"@quotation\" $$\n           contents $$\n           text \"@end quotation\"\n\nblockToTexinfo (CodeBlock _ str) =\n  return $ blankline $$\n         text \"@verbatim\" $$\n         flush (literal str) $$\n         text \"@end verbatim\" <> blankline\n\nblockToTexinfo b@(RawBlock f str)\n  | f == \"texinfo\" = return $ literal str\n  | f == \"latex\" || f == \"tex\" =\n                      return $ text \"@tex\" $$ literal str $$ text \"@end tex\"\n  | otherwise      = do\n      report $ BlockNotRendered b\n      return empty\n\nblockToTexinfo (BulletList lst) = do\n  items <- mapM listItemToTexinfo lst\n  return $ text \"@itemize\" $$\n           vcat items $$\n           text \"@end itemize\" <> blankline\n\nblockToTexinfo (OrderedList (start, numstyle, _) lst) = do\n  items <- mapM listItemToTexinfo lst\n  return $ text \"@enumerate \" <> exemplar $$\n           vcat items $$\n           text \"@end enumerate\" <> blankline\n  where\n    exemplar = case numstyle of\n                DefaultStyle -> decimal\n                Decimal      -> decimal\n                Example      -> decimal\n                UpperRoman   -> decimal   -- Roman numerals not supported\n                LowerRoman   -> decimal\n                UpperAlpha   -> upperAlpha\n                LowerAlpha   -> lowerAlpha\n    decimal = if start == 1\n                 then empty\n                 else text (show start)\n    upperAlpha = text [chr $ ord 'A' + start - 1]\n    lowerAlpha = text [chr $ ord 'a' + start - 1]\n\nblockToTexinfo (DefinitionList lst) = do\n  items <- mapM defListItemToTexinfo lst\n  return $ text \"@table @asis\" $$\n           vcat items $$\n           text \"@end table\" <> blankline\n\nblockToTexinfo HorizontalRule =\n    -- XXX can't get the equivalent from LaTeX.hs to work\n    return $ text \"@iftex\" $$\n             text \"@bigskip@hrule@bigskip\" $$\n             text \"@end iftex\" $$\n             text \"@ifnottex\" $$\n             text (replicate 72 '-') $$\n             text \"@end ifnottex\"\n\nblockToTexinfo (Header 0 _ lst) = do\n  txt <- if null lst\n            then return $ text \"Top\"\n            else inlineListToTexinfo lst\n  return $ text \"@node Top\" $$\n           text \"@top \" <> txt <> blankline\n\nblockToTexinfo (Header level (_,_,[(\"node\",node)]) lst) = do\n    txt <- inlineListToTexinfo lst\n    sec <- seccmd level\n    return $ if (level > 0) && (level <= 4)\n                then blankline <> text \"@node \" <> literal node $$\n                     literal sec <> txt\n                else txt\n    where\n      seccmd :: PandocMonad m => Int -> TI m Text\n      seccmd 1 = return \"@chapter \"\n      seccmd 2 = return \"@section \"\n      seccmd 3 = return \"@subsection \"\n      seccmd 4 = return \"@subsubsection \"\n      seccmd _ = throwError $ PandocSomeError \"illegal seccmd level\"\n\n-- non-node header:\nblockToTexinfo (Header _ _ lst) = blockToTexinfo (Para lst)\n\nblockToTexinfo (Table _ blkCapt specs thead tbody tfoot) = do\n  let (caption, aligns, widths, heads, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  headers <- if all null heads\n                then return empty\n                else tableHeadToTexinfo aligns heads\n  captionText <- inlineListToTexinfo caption\n  rowsText <- mapM (tableRowToTexinfo aligns) rows\n  colDescriptors <-\n    if all (== 0) widths\n       then do -- use longest entry instead of column widths\n            cols <- mapM (mapM (fmap (T.unpack . render Nothing . hcat) .\n                           mapM blockToTexinfo)) $\n                        transpose $ heads : rows\n            return $ concatMap\n                ((\\x -> \"{\"++x++\"} \") .\n                        maybe \"\" (maximumBy (comparing length)) . nonEmpty)\n                cols\n       else return $ \"@columnfractions \" ++ concatMap (printf \"%.2f \") widths\n  let tableBody = text (\"@multitable \" ++ colDescriptors) $$\n                  headers $$\n                  vcat rowsText $$\n                  text \"@end multitable\"\n  return $ if isEmpty captionText\n              then tableBody <> blankline\n              else text \"@float Table\" $$\n                   tableBody $$\n                   inCmd \"caption\" captionText $$\n                   text \"@end float\"\n\nblockToTexinfo (Figure _ caption [SimpleFigure attr figCaption tgt]) = do\n  let capt = if null figCaption\n             then let (Caption _ cblks) = caption\n                  in blocksToInlines cblks\n             else figCaption\n  captionText <- if null capt\n                 then return empty\n                 else (text \"@caption\" <>) . braces <$> inlineListToTexinfo capt\n  img  <- inlineToTexinfo (Image attr figCaption tgt)\n  return $ text \"@float Figure\" $$ img $$ captionText $$ text \"@end float\"\n\nblockToTexinfo (Figure _ fCaption [\n    Table attr tCaption@(Caption _ cbody) specs thead tbody tfoot]) = do\n  let caption = case cbody of\n                  [] -> fCaption\n                  _  -> tCaption\n  blockToTexinfo (Table attr caption specs thead tbody tfoot)\n\nblockToTexinfo (Figure _ (Caption _ caption) body) = do\n  captionText <- inlineListToTexinfo $ blocksToInlines caption\n  content <- blockListToTexinfo body\n  return $ text (\"@float\" ++ floatType body) $$ content $$ (\n      if isEmpty captionText\n         then empty\n         else inCmd \"caption\" captionText\n    ) $$ text \"@end float\"\n  where\n  -- floatType according to\n  -- https://www.gnu.org/software/texinfo/manual/texinfo/html_node/_0040float.html\n  floatType [SimpleFigure {}] = \" Figure\"\n  floatType [Table {}] = \" Table\"\n  floatType _ = \"\"\n\ntableHeadToTexinfo :: PandocMonad m\n                   => [Alignment]\n                   -> [[Block]]\n                   -> TI m (Doc Text)\ntableHeadToTexinfo = tableAnyRowToTexinfo \"@headitem \"\n\ntableRowToTexinfo :: PandocMonad m\n                  => [Alignment]\n                  -> [[Block]]\n                  -> TI m (Doc Text)\ntableRowToTexinfo = tableAnyRowToTexinfo \"@item \"\n\ntableAnyRowToTexinfo :: PandocMonad m\n                     => Text\n                     -> [Alignment]\n                     -> [[Block]]\n                     -> TI m (Doc Text)\ntableAnyRowToTexinfo itemtype aligns cols =\n  (literal itemtype $$) . L.foldl' (\\row item -> row $$\n  (if isEmpty row then empty else text \" @tab \") <> item) empty <$> zipWithM alignedBlock aligns cols\n\nalignedBlock :: PandocMonad m\n             => Alignment\n             -> [Block]\n             -> TI m (Doc Text)\n-- XXX @flushleft and @flushright text won't get word wrapped.  Since word\n-- wrapping is more important than alignment, we ignore the alignment.\nalignedBlock _ = blockListToTexinfo\n{-\nalignedBlock AlignLeft col = do\n  b <- blockListToTexinfo col\n  return $ text \"@flushleft\" $$ b $$ text \"@end flushleft\"\nalignedBlock AlignRight col = do\n  b <- blockListToTexinfo col\n  return $ text \"@flushright\" $$ b $$ text \"@end flushright\"\nalignedBlock _ col = blockListToTexinfo col\n-}\n\n-- | Convert Pandoc block elements to Texinfo.\nblockListToTexinfo :: PandocMonad m\n                   => [Block]\n                   -> TI m (Doc Text)\nblockListToTexinfo [] = return empty\nblockListToTexinfo (x:xs) = do\n  x' <- blockToTexinfo x\n  case x of\n    Header level _ _ -> do\n      -- We need need to insert a menu for this node.\n      let (before, after) = break isHeaderBlock xs\n      before' <- blockListToTexinfo before\n      let menu = if level < 4\n                    then collectNodes (level + 1) after\n                    else []\n      lines' <- mapM makeMenuLine menu\n      let menu' = if null lines'\n                    then empty\n                    else blankline $$\n                         text \"@menu\" $$\n                         vcat lines' $$\n                         text \"@end menu\"\n      after' <- blockListToTexinfo after\n      return $ x' $$ before' $$ menu' $$ after'\n    Para _ -> do\n      xs' <- blockListToTexinfo xs\n      case xs of\n           (CodeBlock _ _:_) -> return $ x' $$ xs'\n           _                 -> return $ x' $+$ xs'\n    _ -> do\n      xs' <- blockListToTexinfo xs\n      return $ x' $$ xs'\n\ncollectNodes :: Int -> [Block] -> [Block]\ncollectNodes _ [] = []\ncollectNodes level (x:xs) =\n  case x of\n    (Header hl _ _)\n      | hl < level -> []\n      | hl == level -> x : collectNodes level xs\n      | otherwise -> collectNodes level xs\n    _ ->\n      collectNodes level xs\n\nmakeMenuLine :: PandocMonad m\n             => Block\n             -> TI m (Doc Text)\nmakeMenuLine (Header _ (_,_,[(\"node\", node)]) lst) = do\n  txt <- withContext NodeContext $ inlineListToTexinfo lst\n  pure $ nowrap $ text \"* \" <>\n    if render Nothing txt == node\n       then literal node <> \"::\"\n       else txt <> \": \" <> literal node <> \".\"\nmakeMenuLine _ = throwError $ PandocSomeError \"makeMenuLine called with non-node\"\n\nlistItemToTexinfo :: PandocMonad m\n                  => [Block]\n                  -> TI m (Doc Text)\nlistItemToTexinfo lst = do\n  contents <- blockListToTexinfo lst\n  let spacer = case reverse lst of\n                    (Para{}:_) -> blankline\n                    _          -> empty\n  return $ text \"@item\" $$ contents <> spacer\n\ndefListItemToTexinfo :: PandocMonad m\n                     => ([Inline], [[Block]])\n                     -> TI m (Doc Text)\ndefListItemToTexinfo (term, defs) = do\n    term' <- inlineListToTexinfo term\n    let defToTexinfo bs = do d <- blockListToTexinfo bs\n                             case reverse bs of\n                                  (Para{}:_) -> return $ d <> blankline\n                                  _          -> return d\n    defs' <- mapM defToTexinfo defs\n    return $ text \"@item \" <> term' $+$ vcat defs'\n\n-- | Convert list of inline elements to Texinfo.\ninlineListToTexinfo :: PandocMonad m\n                    => [Inline]  -- ^ Inlines to convert\n                    -> TI m (Doc Text)\ninlineListToTexinfo lst = hcat <$> mapM inlineToTexinfo lst\n\n-- | Convert inline element to Texinfo\ninlineToTexinfo :: PandocMonad m\n                => Inline    -- ^ Inline to convert\n                -> TI m (Doc Text)\n\ninlineToTexinfo (Span _ lst) =\n  inlineListToTexinfo lst\n\ninlineToTexinfo (Emph lst) =\n  inCmd \"emph\" <$> inlineListToTexinfo lst\n\n-- Underline isn't supported, fall back to Emph\ninlineToTexinfo (Underline lst) =\n  inlineToTexinfo (Emph lst)\n\ninlineToTexinfo (Strong lst) =\n  inCmd \"strong\" <$> inlineListToTexinfo lst\n\ninlineToTexinfo (Strikeout lst) = do\n  modify $ \\st -> st{ stStrikeout = True }\n  contents <- inlineListToTexinfo lst\n  return $ text \"@textstrikeout{\" <> contents <> text \"}\"\n\ninlineToTexinfo (Superscript lst) = do\n  contents <- inlineListToTexinfo lst\n  return $ text \"@sup{\" <> contents <> char '}'\n\ninlineToTexinfo (Subscript lst) = do\n  contents <- inlineListToTexinfo lst\n  return $ text \"@sub{\" <> contents <> char '}'\n\ninlineToTexinfo (SmallCaps lst) =\n  inCmd \"sc\" <$> inlineListToTexinfo lst\n\ninlineToTexinfo (Code (_, cls , _) str) | T.pack \"variable\" `elem` cls  = do\n  code <- stringToTexinfo str\n  return $ literal $ \"@code{@var{\" <> code <> \"}}\"\n\ninlineToTexinfo (Code _ str) = do\n  code <- stringToTexinfo str\n  return $ literal $ \"@code{\" <> code <> \"}\"\n\ninlineToTexinfo (Quoted SingleQuote lst) = do\n  contents <- inlineListToTexinfo lst\n  return $ char '`' <> contents <> char '\\''\n\ninlineToTexinfo (Quoted DoubleQuote lst) = do\n  contents <- inlineListToTexinfo lst\n  return $ text \"``\" <> contents <> text \"''\"\n\ninlineToTexinfo (Cite _ lst) =\n  inlineListToTexinfo lst\ninlineToTexinfo (Str str) = literal <$> stringToTexinfo str\ninlineToTexinfo (Math _ str) = return $ inCmd \"math\" $ literal str\ninlineToTexinfo il@(RawInline f str)\n  | f == \"latex\" || f == \"tex\" =\n                      return $ text \"@tex\" $$ literal str $$ text \"@end tex\"\n  | f == \"texinfo\" =  return $ literal str\n  | otherwise      =  do\n      report $ InlineNotRendered il\n      return empty\ninlineToTexinfo LineBreak = return $ text \"@*\" <> cr\ninlineToTexinfo SoftBreak = do\n  wrapText <- gets (writerWrapText . stOptions)\n  case wrapText of\n      WrapAuto     -> return space\n      WrapNone     -> return space\n      WrapPreserve -> return cr\ninlineToTexinfo Space = return space\n\ninlineToTexinfo (Link _ txt (src, _))\n  | Just ('#', ident) <- T.uncons src = do\n      headings <- gets stHeadings\n      target <- case M.lookup ident headings of\n                  Nothing -> literal <$> stringToTexinfo\n                                    (T.filter (not . disallowedInNode) src)\n                  Just node -> pure $ literal node\n      contents <- withContext NodeContext $ inlineListToTexinfo txt\n      return $ text \"@ref\"\n        <> braces (target <> if contents == target\n                                then mempty\n                                else text \",,\" <> contents)\n  | otherwise = case txt of\n      [Str x] | escapeURI x == src ->  -- autolink\n                  return $ literal $ \"@url{\" <> x <> \"}\"\n      _ -> do\n        contents <- withContext NodeContext $ inlineListToTexinfo txt\n        src1 <- stringToTexinfo src\n        return $ literal (\"@uref{\" <> src1 <> \",\") <> contents <>\n                 char '}'\n\ninlineToTexinfo (Image attr alternate (source, _)) = do\n  content <- withContext NodeContext $ inlineListToTexinfo alternate\n  opts <- gets stOptions\n  let showDim dim = case dimension dim attr of\n                      (Just (Pixel a))   -> showInInch opts (Pixel a) <> \"in\"\n                      (Just (Percent _)) -> \"\"\n                      (Just d)           -> tshow d\n                      Nothing            -> \"\"\n  return $ literal (\"@image{\" <> base <> \",\" <> showDim Width <> \",\" <> showDim Height <> \",\")\n           <> content <> text \",\" <> literal (ext <> \"}\")\n  where\n    ext     = T.drop 1 $ T.pack $ takeExtension source'\n    base    = T.pack $ dropExtension source'\n    source' = if isURI source\n              then T.unpack source\n              else unEscapeString $ T.unpack source\n\ninlineToTexinfo (Note contents) = do\n  contents' <- blockListToTexinfo contents\n  return $ text \"@footnote\" <> braces contents'\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Textile.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.Textile\n   Copyright   : Copyright (C) 2010-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to Textile markup.\n\nTextile:  <http://thresholdstate.com/articles/4312/the-textile-reference-manual>\n-}\nmodule Text.Pandoc.Writers.Textile ( writeTextile ) where\nimport Control.Monad (zipWithM, liftM)\nimport Control.Monad.State.Strict ( StateT, gets, modify, evalStateT )\nimport Data.Char (isSpace)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.DocLayout (render, literal)\nimport Text.Pandoc.Shared\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared\nimport Text.Pandoc.XML (escapeStringForXML)\n\ndata WriterState = WriterState {\n    stNotes     :: [Text]        -- Footnotes\n  , stListLevel :: [Char]        -- String at beginning of list items, e.g. \"**\"\n  , stStartNum  :: Maybe Int     -- Start number if first list item\n  , stUseTags   :: Bool          -- True if we should use HTML tags because we're in a complex list\n  }\n\ntype TW = StateT WriterState\n\n-- | Convert Pandoc to Textile.\nwriteTextile :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteTextile opts document =\n  evalStateT (pandocToTextile opts document)\n            WriterState { stNotes = [],\n                          stListLevel = [],\n                          stStartNum = Nothing,\n                          stUseTags = False }\n\n-- | Return Textile representation of document.\npandocToTextile :: PandocMonad m\n                => WriterOptions -> Pandoc -> TW m Text\npandocToTextile opts (Pandoc meta blocks) = do\n  metadata <- metaToContext opts\n                 (fmap literal . blockListToTextile opts)\n                 (fmap literal . inlineListToTextile opts) meta\n  body <- blockListToTextile opts blocks\n  notes <- gets $ T.unlines . reverse . stNotes\n  let main = body <> if T.null notes then \"\" else \"\\n\\n\" <> notes\n  let context = defField \"body\" main metadata\n  return $\n    case writerTemplate opts of\n         Nothing  -> main\n         Just tpl -> render Nothing $ renderTemplate tpl context\n\nwithUseTags :: PandocMonad m => TW m a -> TW m a\nwithUseTags action = do\n  oldUseTags <- gets stUseTags\n  modify $ \\s -> s { stUseTags = True }\n  result <- action\n  modify $ \\s -> s { stUseTags = oldUseTags }\n  return result\n\n-- | Escape one character as needed for Textile.\nescapeCharForTextile :: Char -> Text\nescapeCharForTextile x = case x of\n                         '&'      -> \"&amp;\"\n                         '<'      -> \"&lt;\"\n                         '>'      -> \"&gt;\"\n                         '\"'      -> \"&quot;\"\n                         '*'      -> \"&#42;\"\n                         '_'      -> \"&#95;\"\n                         '@'      -> \"&#64;\"\n                         '+'      -> \"&#43;\"\n                         '-'      -> \"&#45;\"\n                         '|'      -> \"&#124;\"\n                         '\\x2014' -> \" -- \"\n                         '\\x2013' -> \" - \"\n                         '\\x2019' -> \"'\"\n                         '\\x2026' -> \"...\"\n                         c        -> T.singleton c\n\n-- | Escape string as needed for Textile.\nescapeTextForTextile :: Text -> Text\nescapeTextForTextile = T.concatMap escapeCharForTextile\n\n-- | Convert Pandoc block element to Textile.\nblockToTextile :: PandocMonad m\n               => WriterOptions -- ^ Options\n               -> Block         -- ^ Block element\n               -> TW m Text\n\nblockToTextile opts (Div attr bs) = do\n  let startTag = render Nothing $ tagWithAttrs \"div\" attr\n  let endTag = \"</div>\"\n  contents <- blockListToTextile opts bs\n  return $ startTag <> \"\\n\\n\" <> contents <> \"\\n\\n\" <> endTag <> \"\\n\"\n\nblockToTextile opts (Plain inlines) =\n  inlineListToTextile opts inlines\n\nblockToTextile opts (Para inlines) = do\n  useTags <- gets stUseTags\n  listLevel <- gets stListLevel\n  contents <- inlineListToTextile opts inlines\n  return $ if useTags\n              then \"<p>\" <> contents <> \"</p>\"\n              else contents <> if null listLevel then \"\\n\" else \"\"\n\nblockToTextile opts (LineBlock lns) =\n  blockToTextile opts $ linesToPara lns\n\nblockToTextile _ b@(RawBlock f str)\n  | f == Format \"html\" || f == Format \"textile\" = return str\n  | otherwise                                   = do\n      report $ BlockNotRendered b\n      return \"\"\n\nblockToTextile _ HorizontalRule = return \"<hr />\\n\"\n\nblockToTextile opts (Header level (ident,classes,keyvals) inlines) = do\n  contents <- inlineListToTextile opts inlines\n  let identAttr = if T.null ident then \"\" else \"#\" <> ident\n  let attribs = if T.null identAttr && null classes\n                   then \"\"\n                   else \"(\" <> T.unwords classes <> identAttr <> \")\"\n  let lang = maybe \"\" (\\x -> \"[\" <> x <> \"]\") $ lookup \"lang\" keyvals\n  let styles = maybe \"\" (\\x -> \"{\" <> x <> \"}\") $ lookup \"style\" keyvals\n  let prefix = \"h\" <> tshow level <> attribs <> styles <> lang <> \". \"\n  return $ prefix <> contents <> \"\\n\"\n\nblockToTextile _ (CodeBlock (_,classes,_) str) | any (T.all isSpace) (T.lines str) =\n  return $ \"<pre\"  <> classes' <> \">\\n\" <> escapeStringForXML str <>\n           \"\\n</pre>\\n\"\n    where classes' = if null classes\n                        then \"\"\n                        else \" class=\\\"\" <> T.unwords classes <> \"\\\"\"\n\nblockToTextile _ (CodeBlock (_,classes,_) str) =\n  return $ \"bc\" <> classes' <> \". \" <> str <> \"\\n\\n\"\n    where classes' = if null classes\n                        then \"\"\n                        else \"(\" <> T.unwords classes <> \")\"\n\nblockToTextile opts (BlockQuote bs@[Para _]) = do\n  contents <- blockListToTextile opts bs\n  return $ \"bq. \" <> contents <> \"\\n\\n\"\n\nblockToTextile opts (BlockQuote blocks) = do\n  contents <- blockListToTextile opts blocks\n  return $ \"<blockquote>\\n\\n\" <> contents <> \"\\n</blockquote>\\n\"\n\nblockToTextile opts (Table _ blkCapt specs thead tbody tfoot)\n  = case toLegacyTable blkCapt specs thead tbody tfoot of\n      ([], aligns, widths, headers, rows') | all (==0) widths -> do\n        hs <- mapM (liftM ((\"_. \" <>) . stripTrailingNewlines) . blockListToTextile opts) headers\n        let cellsToRow cells = \"|\" <> T.intercalate \"|\" cells <> \"|\"\n        let header = if all null headers then \"\" else cellsToRow hs <> \"\\n\"\n        let blocksToCell (align, bs) = do\n              contents <- stripTrailingNewlines <$> blockListToTextile opts bs\n              let alignMarker = case align of\n                                     AlignLeft    -> \"<. \"\n                                     AlignRight   -> \">. \"\n                                     AlignCenter  -> \"=. \"\n                                     AlignDefault -> \"\"\n              return $ alignMarker <> contents\n        let rowToCells = mapM blocksToCell . zip aligns\n        bs <- mapM rowToCells rows'\n        let body = T.unlines $ map cellsToRow bs\n        return $ header <> body\n      (capt, aligns, widths, headers, rows') -> do\n        let alignStrings = map alignmentToText aligns\n        captionDoc <- if null capt\n                         then return \"\"\n                         else do\n                            c <- inlineListToTextile opts capt\n                            return $ \"<caption>\" <> c <> \"</caption>\\n\"\n        let percent w = tshow (truncate (100*w) :: Integer) <> \"%\"\n        let coltags = if all (== 0.0) widths\n                         then \"\"\n                         else T.unlines $ map\n                               (\\w -> \"<col width=\\\"\" <> percent w <> \"\\\" />\") widths\n        head' <- if all null headers\n                    then return \"\"\n                    else do\n                       hs <- tableRowToTextile opts alignStrings 0 headers\n                       return $ \"<thead>\\n\" <> hs <> \"\\n</thead>\\n\"\n        body' <- zipWithM (tableRowToTextile opts alignStrings) [1..] rows'\n        return $ \"<table>\\n\" <> captionDoc <> coltags <> head' <>\n                  \"<tbody>\\n\" <> T.unlines body' <> \"</tbody>\\n</table>\\n\"\n\nblockToTextile opts x@(BulletList items) = do\n  oldUseTags <- gets stUseTags\n  let useTags = oldUseTags || not (isSimpleList x)\n  if useTags\n     then do\n        contents <- withUseTags $ mapM (listItemToTextile opts) items\n        return $ \"<ul>\\n\" <> vcat contents <> \"\\n</ul>\\n\"\n     else do\n        modify $ \\s -> s { stListLevel = stListLevel s <> \"*\" }\n        level <- gets $ length . stListLevel\n        contents <- mapM (listItemToTextile opts) items\n        modify $ \\s -> s { stListLevel = init (stListLevel s) }\n        return $ vcat contents <> (if level > 1 then \"\" else \"\\n\")\n\nblockToTextile opts x@(OrderedList attribs@(start, _, _) items) = do\n  oldUseTags <- gets stUseTags\n  let useTags = oldUseTags || not (isSimpleList x)\n  if useTags\n     then do\n        contents <- withUseTags $ mapM (listItemToTextile opts) items\n        return $ \"<ol\" <> listAttribsToString attribs <> \">\\n\" <> vcat contents <>\n                   \"\\n</ol>\\n\"\n     else do\n        modify $ \\s -> s { stListLevel = stListLevel s <> \"#\"\n                         , stStartNum = if start > 1\n                                           then Just start\n                                           else Nothing }\n        level <- gets $ length . stListLevel\n        contents <- mapM (listItemToTextile opts) items\n        modify $ \\s -> s { stListLevel = init (stListLevel s),\n                           stStartNum = Nothing }\n        return $ vcat contents <> (if level > 1 then \"\" else \"\\n\")\n\nblockToTextile opts (DefinitionList items) = do\n  contents <- withUseTags $ mapM (definitionListItemToTextile opts) items\n  return $ \"<dl>\\n\" <> vcat contents <> \"\\n</dl>\\n\"\n\nblockToTextile opts (Figure attr (Caption _ caption)  body) = do\n  let startTag = render Nothing $ tagWithAttrs \"figure\" attr\n  let endTag = \"</figure>\"\n  let captionInlines = blocksToInlines caption\n  captionMarkup <- if null captionInlines\n                      then return \"\"\n                      else ((<> \"\\n\\n</figcaption>\\n\\n\") .  (\"<figcaption>\\n\\n\" <>)) <$>\n                          inlineListToTextile opts (blocksToInlines caption)\n  contents <- blockListToTextile opts body\n  return $ startTag <> \"\\n\\n\" <>\n    captionMarkup <>\n    contents <> \"\\n\\n\" <> endTag <> \"\\n\"\n\n-- Auxiliary functions for lists:\n\n-- | Convert ordered list attributes to HTML attribute string\nlistAttribsToString :: ListAttributes -> Text\nlistAttribsToString (startnum, numstyle, _) =\n  let numstyle' = camelCaseToHyphenated $ tshow numstyle\n  in  (if startnum /= 1\n          then \" start=\\\"\" <> tshow startnum <> \"\\\"\"\n          else \"\") <>\n      (if numstyle /= DefaultStyle\n          then \" style=\\\"list-style-type: \" <> numstyle' <> \";\\\"\"\n          else \"\")\n\n-- | Convert bullet or ordered list item (list of blocks) to Textile.\nlistItemToTextile :: PandocMonad m\n                  => WriterOptions -> [Block] -> TW m Text\nlistItemToTextile opts items = do\n  contents <- blockListToTextile opts items\n  useTags <- gets stUseTags\n  if useTags\n     then return $ \"<li>\" <> contents <> \"</li>\"\n     else do\n       marker <- gets stListLevel\n       mbstart <- gets stStartNum\n       case mbstart of\n            Just n -> do\n              modify $ \\s -> s{ stStartNum = Nothing }\n              return $ T.pack marker <> tshow n <> \" \" <> contents\n            Nothing -> return $ T.pack marker <> \" \" <> contents\n\n-- | Convert definition list item (label, list of blocks) to Textile.\ndefinitionListItemToTextile :: PandocMonad m\n                            => WriterOptions\n                             -> ([Inline],[[Block]])\n                             -> TW m Text\ndefinitionListItemToTextile opts (label, items) = do\n  labelText <- inlineListToTextile opts label\n  contents <- mapM (blockListToTextile opts) items\n  return $ \"<dt>\" <> labelText <> \"</dt>\\n\" <>\n          T.intercalate \"\\n\" (map (\\d -> \"<dd>\" <> d <> \"</dd>\") contents)\n\n-- | True if the list can be handled by simple wiki markup, False if HTML tags will be needed.\nisSimpleList :: Block -> Bool\nisSimpleList x =\n  case x of\n       BulletList items                 -> all isSimpleListItem items\n       OrderedList (_, sty, _) items    -> all isSimpleListItem items &&\n                                            sty `elem` [DefaultStyle, Decimal]\n       _                                -> False\n\n-- | True if list item can be handled with the simple wiki syntax.  False if\n--   HTML tags will be needed.\nisSimpleListItem :: [Block] -> Bool\nisSimpleListItem []  = True\nisSimpleListItem [x] =\n  case x of\n       Plain _         -> True\n       Para  _         -> True\n       BulletList _    -> isSimpleList x\n       OrderedList _ _ -> isSimpleList x\n       _               -> False\nisSimpleListItem [x, y] | isPlainOrPara x =\n  case y of\n       BulletList _    -> isSimpleList y\n       OrderedList _ _ -> isSimpleList y\n       _               -> False\nisSimpleListItem _ = False\n\nisPlainOrPara :: Block -> Bool\nisPlainOrPara (Plain _) = True\nisPlainOrPara (Para  _) = True\nisPlainOrPara _         = False\n\n-- | Concatenates strings with line breaks between them.\nvcat :: [Text] -> Text\nvcat = T.intercalate \"\\n\"\n\n-- Auxiliary functions for tables. (TODO: these are common to HTML, MediaWiki,\n-- and Textile writers, and should be abstracted out.)\n\ntableRowToTextile :: PandocMonad m\n                  => WriterOptions\n                  -> [Text]\n                  -> Int\n                  -> [[Block]]\n                  -> TW m Text\ntableRowToTextile opts alignStrings rownum cols' = do\n  let celltype = if rownum == 0 then \"th\" else \"td\"\n  cols'' <- zipWithM\n            (\\alignment item -> tableItemToTextile opts celltype alignment item)\n            alignStrings cols'\n  return $ \"<tr>\\n\" <> T.unlines cols'' <> \"</tr>\"\n\nalignmentToText :: Alignment -> Text\nalignmentToText alignment = case alignment of\n                                 AlignLeft    -> \"left\"\n                                 AlignRight   -> \"right\"\n                                 AlignCenter  -> \"center\"\n                                 AlignDefault -> \"left\"\n\ntableItemToTextile :: PandocMonad m\n                   => WriterOptions\n                   -> Text\n                   -> Text\n                   -> [Block]\n                   -> TW m Text\ntableItemToTextile opts celltype align' item = do\n  let mkcell x = \"<\" <> celltype <> \" align=\\\"\" <> align' <> \"\\\">\" <>\n                    x <> \"</\" <> celltype <> \">\"\n  contents <- blockListToTextile opts item\n  return $ mkcell contents\n\n-- | Convert list of Pandoc block elements to Textile.\nblockListToTextile :: PandocMonad m\n                   => WriterOptions -- ^ Options\n                   -> [Block]       -- ^ List of block elements\n                   -> TW m Text\nblockListToTextile opts blocks =\n  vcat <$> mapM (blockToTextile opts) blocks\n\n-- | Convert list of Pandoc inline elements to Textile.\ninlineListToTextile :: PandocMonad m\n                    => WriterOptions -> [Inline] -> TW m Text\ninlineListToTextile opts lst =\n  T.concat <$> mapM (inlineToTextile opts) lst\n\n-- | Convert Pandoc inline element to Textile.\ninlineToTextile :: PandocMonad m => WriterOptions -> Inline -> TW m Text\n\ninlineToTextile opts (Span _ lst) =\n  inlineListToTextile opts lst\n\ninlineToTextile opts (Emph lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ if T.any (== '_') contents\n              then \"<em>\" <> contents <> \"</em>\"\n              else \"_\" <> contents <> \"_\"\n\ninlineToTextile opts (Underline lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ if T.any (== '+') contents\n              then \"<u>\" <> contents <> \"</u>\"\n              else \"+\" <> contents <> \"+\"\n\ninlineToTextile opts (Strong lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ if T.any (== '*') contents\n              then \"<strong>\" <> contents <> \"</strong>\"\n              else \"*\" <> contents <> \"*\"\n\ninlineToTextile opts (Strikeout lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ if T.any (== '-') contents\n              then \"<del>\" <> contents <> \"</del>\"\n              else \"-\" <> contents <> \"-\"\n\ninlineToTextile opts (Superscript lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ if T.any (== '^') contents\n              then \"<sup>\" <> contents <> \"</sup>\"\n              else \"[^\" <> contents <> \"^]\"\n\ninlineToTextile opts (Subscript lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ if T.any (== '~') contents\n              then \"<sub>\" <> contents <> \"</sub>\"\n              else \"[~\" <> contents <> \"~]\"\n\ninlineToTextile opts (SmallCaps lst) = inlineListToTextile opts lst\n\ninlineToTextile opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ \"'\" <> contents <> \"'\"\n\ninlineToTextile opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToTextile opts lst\n  return $ \"\\\"\" <> contents <> \"\\\"\"\n\ninlineToTextile opts (Cite _  lst) = inlineListToTextile opts lst\n\ninlineToTextile _ (Code _ str) =\n  return $ if T.any (== '@') str\n           then \"<tt>\" <> escapeStringForXML str <> \"</tt>\"\n           else \"@\" <> str <> \"@\"\n\ninlineToTextile _ (Str str) = return $ escapeTextForTextile str\n\ninlineToTextile _ (Math _ str) =\n  return $ \"<span class=\\\"math\\\">\" <> escapeStringForXML str <> \"</span>\"\n\ninlineToTextile opts il@(RawInline f str)\n  | f == Format \"html\" || f == Format \"textile\" = return str\n  | (f == Format \"latex\" || f == Format \"tex\") &&\n     isEnabled Ext_raw_tex opts                 = return str\n  | otherwise                                   = do\n      report $ InlineNotRendered il\n      return \"\"\n\ninlineToTextile _ LineBreak = return \"\\n\"\n\ninlineToTextile _ SoftBreak = return \" \"\n\ninlineToTextile _ Space = return \" \"\n\ninlineToTextile opts (Link (_, cls, _) txt (src, _)) = do\n  label <- case txt of\n                [Code _ s]\n                 | s == src -> return \"$\"\n                [Str s]\n                 | s == src -> return \"$\"\n                _           -> inlineListToTextile opts txt\n  let classes = if null cls || cls == [\"uri\"] && label == \"$\"\n                   then \"\"\n                   else \"(\" <> T.unwords cls <> \")\"\n  return $ \"\\\"\" <> classes <> label <> \"\\\":\" <> src\n\ninlineToTextile opts (Image attr@(_, cls, _) alt (source, tit)) = do\n  alt' <- inlineListToTextile opts alt\n  let txt = if T.null tit\n               then if T.null alt'\n                       then \"\"\n                       else \"(\" <> alt' <> \")\"\n               else \"(\" <> tit <> \")\"\n      classes = if null cls\n                   then \"\"\n                   else \"(\" <> T.unwords cls <> \")\"\n      showDim dir = let toCss str = Just $ tshow dir <> \":\" <> str <> \";\"\n                    in case dimension dir attr of\n                         Just (Percent a) -> toCss $ tshow (Percent a)\n                         Just dim         -> toCss $ showInPixel opts dim <> \"px\"\n                         Nothing          -> Nothing\n      styles = case (showDim Width, showDim Height) of\n                 (Just w, Just h)   -> \"{\" <> w <> h <> \"}\"\n                 (Just w, Nothing)  -> \"{\" <> w <> \"height:auto;}\"\n                 (Nothing, Just h)  -> \"{\" <> \"width:auto;\" <> h <> \"}\"\n                 (Nothing, Nothing) -> \"\"\n  return $ \"!\" <> classes <> styles <> source <> txt <> \"!\"\n\ninlineToTextile opts (Note contents) = do\n  curNotes <- gets stNotes\n  let newnum = length curNotes + 1\n  contents' <- blockListToTextile opts contents\n  let thisnote = \"fn\" <> tshow newnum <> \". \" <> contents' <> \"\\n\"\n  modify $ \\s -> s { stNotes = thisnote : curNotes }\n  return $ \"[\" <> tshow newnum <> \"]\"\n  -- note - may not work for notes with multiple blocks\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Typst.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE BangPatterns        #-}\n{-# LANGUAGE LambdaCase          #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc.Writers.Typst\n   Copyright   : Copyright (C) 2023 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' format into Typst markup\n(<https://typst.app>).\n-}\nmodule Text.Pandoc.Writers.Typst (\n    writeTypst\n  ) where\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Class ( PandocMonad, report, runPure, fetchItem )\nimport Text.Pandoc.ImageSize ( dimension, Dimension(Pixel), Direction(..),\n                               showInInch )\nimport Text.Pandoc.Options ( WriterOptions(..), WrapOption(..), isEnabled,\n                             CaptionPosition(..), HighlightMethod(..) )\nimport Data.Text (Text)\nimport Data.List (intercalate, intersperse)\nimport Data.Bifunctor (first, second)\nimport Network.URI (unEscapeString)\nimport qualified Data.Text as T\nimport Control.Monad (unless)\nimport Control.Monad.State ( StateT, evalStateT, gets, modify )\nimport Text.Pandoc.Writers.Shared ( lookupMetaInlines, lookupMetaString,\n                                    metaToContext, defField, resetField,\n                                    setupTranslations )\nimport Text.Pandoc.Shared (isTightList, orderedListMarkers, tshow, stringify)\nimport Text.Pandoc.Highlighting (highlight, formatTypstBlock, formatTypstInline,\n                                 styleToTypst)\nimport Text.Pandoc.Translations (Term(Abstract), translateTerm)\nimport Text.Pandoc.Error (PandocError(PandocSomeError))\nimport Text.Pandoc.Walk (query)\nimport Text.Pandoc.Writers.Math (convertMath)\nimport qualified Text.TeXMath as TM\nimport Text.DocLayout\nimport Text.DocTemplates (renderTemplate)\nimport Text.Pandoc.Extensions (Extension(..))\nimport Text.Pandoc.Logging (LogMessage(..))\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Collate.Lang (Lang(..), parseLang)\nimport Text.Printf (printf)\nimport Data.Char (isDigit)\nimport Data.Maybe (fromMaybe)\nimport Unicode.Char (isXIDContinue)\nimport qualified Data.ByteString as B\n\n-- | Convert Pandoc to Typst.\nwriteTypst :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteTypst options document =\n  evalStateT (pandocToTypst options document)\n    WriterState{ stOptions = options,\n                 stEscapeContext = NormalContext,\n                 stHighlighting = False }\n\ndata EscapeContext = NormalContext | TermContext\n  deriving (Show, Eq)\n\ndata WriterState =\n  WriterState {\n    stOptions :: WriterOptions,\n    stEscapeContext :: EscapeContext,\n    stHighlighting :: Bool\n    }\n\ntype TW m = StateT WriterState m\n\npandocToTypst :: PandocMonad m\n              => WriterOptions -> Pandoc -> TW m Text\npandocToTypst options (Pandoc meta blocks) = do\n  let colwidth = if writerWrapText options == WrapAuto\n                    then Just $ writerColumns options\n                    else Nothing\n  setupTranslations meta\n  metadata <- metaToContext options\n              blocksToTypst\n              (fmap chomp . inlinesToTypst)\n              meta\n  main <- blocksToTypst blocks\n  abstractTitle <- translateTerm Abstract\n  let toPosition :: CaptionPosition -> Text\n      toPosition CaptionAbove = \"top\"\n      toPosition CaptionBelow = \"bottom\"\n  let nociteIds = query (\\case\n                           Cite cs _ -> map citationId cs\n                           _         -> [])\n                  $ lookupMetaInlines \"nocite\" meta\n  hasHighlighting <- gets stHighlighting\n\n  let context = defField \"body\" main\n              $ defField \"toc\" (writerTableOfContents options)\n              $ (if isEnabled Ext_citations options\n                    then defField \"citations\" True\n                       . defField \"nocite-ids\" (filter (/= \"*\") nociteIds)\n                       . defField \"full-bibliography\" (\"*\" `elem` nociteIds)\n                    else id)\n              $ (case lookupMetaString \"lang\" meta of\n                    \"\" -> id\n                    lang ->\n                      case parseLang lang of\n                        Left _ -> id\n                        Right l ->\n                          resetField \"lang\" (langLanguage l) .\n                          maybe id (resetField \"region\") (langRegion l))\n              $ defField \"csl\" (lookupMetaString \"citation-style\" meta) -- #10661\n              $ defField \"smart\" (isEnabled Ext_smart options)\n              $ defField \"abstract-title\" abstractTitle\n              $ defField \"toc-depth\" (tshow $ writerTOCDepth options)\n              $ (if hasHighlighting\n                    then case writerHighlightMethod options of\n                           Skylighting sty ->\n                              defField \"highlighting-definitions\"\n                                (T.stripEnd $ styleToTypst sty)\n                           _ -> id\n                    else id)\n              $ defField \"figure-caption-position\"\n                   (toPosition $ writerFigureCaptionPosition options)\n              $ defField \"table-caption-position\"\n                   (toPosition $ writerTableCaptionPosition options)\n              $ defField \"page-numbering\" (\"1\" :: Text)\n              $ (if writerNumberSections options\n                    then defField \"section-numbering\" (\"1.1.1.1.1\" :: Text)\n                    else id)\n              metadata\n  return $ render colwidth $\n    case writerTemplate options of\n       Nothing  -> main\n       Just tpl -> renderTemplate tpl context\n\npickTypstAttrs :: [(Text, Text)] -> ([(Text, Text)],[(Text, Text)])\npickTypstAttrs = foldr go ([],[])\n  where\n    go (k,v) =\n      case T.splitOn \":\" k of\n        [\"typst\", \"text\", x] -> second ((x,v):)\n        [\"typst\", x] -> first ((x,v):)\n        _ -> id\n\nformatTypstProp :: (Text, Text) -> Text\nformatTypstProp (k,v) = k <> \": \" <> v\n\ntoTypstPropsListSep :: [(Text, Text)] -> Doc Text\ntoTypstPropsListSep = hsep . intersperse \",\" . map (literal . formatTypstProp)\n\ntoTypstPropsListTerm :: [(Text, Text)] -> Doc Text\ntoTypstPropsListTerm [] = \"\"\ntoTypstPropsListTerm typstAttrs = toTypstPropsListSep typstAttrs <> \",\"\n\ntoTypstPropsListParens :: [(Text, Text)] -> Doc Text\ntoTypstPropsListParens [] = \"\"\ntoTypstPropsListParens typstAttrs = parens $ toTypstPropsListSep typstAttrs\n\ntoTypstTextElement :: [(Text, Text)] -> Doc Text -> Doc Text\ntoTypstTextElement [] content = content\ntoTypstTextElement typstTextAttrs content = \"#text\" <> toTypstPropsListParens typstTextAttrs <> brackets content\n\ntoTypstSetText :: [(Text, Text)] -> Doc Text\ntoTypstSetText [] = \"\"\ntoTypstSetText typstTextAttrs = \"set text\" <> parens (toTypstPropsListSep typstTextAttrs) <> \"; \"\n\ntoTypstPoundSetText :: [(Text, Text)] -> Doc Text\ntoTypstPoundSetText [] = \"\"\ntoTypstPoundSetText typstTextAttrs = \"#\" <> toTypstSetText typstTextAttrs\n\ntoTypstBracesSetText :: [(Text, Text)] -> Doc Text -> Doc Text\ntoTypstBracesSetText [] x = \"#\" <> x\ntoTypstBracesSetText typstTextAttrs x = \"#\" <> braces (toTypstSetText typstTextAttrs <> x)\n\nblocksToTypst :: PandocMonad m => [Block] -> TW m (Doc Text)\nblocksToTypst blocks = vcat <$> mapM blockToTypst blocks\n\nblockToTypst :: PandocMonad m => Block -> TW m (Doc Text)\nblockToTypst block =\n  case block of\n    Plain inlines -> inlinesToTypst inlines\n    Para inlines -> do\n      ($$ blankline) <$> inlinesToTypst inlines\n    Header level (ident,cls,_) inlines -> do\n      contents <- inlinesToTypst inlines\n      let lab = toLabel FreestandingLabel ident\n      let headingAttrs =\n            [\"outlined: false\" | \"unlisted\" `elem` cls] ++\n            [\"numbering: none\" | \"unnumbered\" `elem` cls]\n      return $\n        if null headingAttrs\n           then nowrap\n                 (literal (T.replicate level \"=\") <> space <> contents) <>\n                 cr <> lab\n           else literal \"#heading\" <>\n                  parens (literal (T.intercalate \", \"\n                              (\"level: \" <> tshow level : headingAttrs))) <>\n                  brackets contents <> cr <> lab\n    RawBlock fmt str ->\n      case fmt of\n        Format \"typst\" -> return $ literal str\n        _ -> return mempty\n    CodeBlock (ident,cls,kvs) code -> do\n      let go :: Char -> (Int, Int) -> (Int, Int)\n          go '`' (longest, current) =\n            let !new = current + 1 in (max longest new, new)\n          go _ (longest, _) = (longest, 0)\n      let (longestBacktickSequence, _) = T.foldr go (0,0) code\n      let fence = literal $ T.replicate (max 3 (longestBacktickSequence + 1)) \"`\"\n      let lang = case cls of\n                   (cl:_) -> literal cl\n                   _ -> mempty\n      opts <-  gets stOptions\n      case writerHighlightMethod opts of\n        Skylighting _ ->\n          case highlight (writerSyntaxMap opts) formatTypstBlock\n                (ident,cls ++ [\"default\"],kvs) code of\n            Left msg -> do\n              unless (T.null msg) $ report $ CouldNotHighlight msg\n              return $ fence <> lang <> cr <> literal code <> cr <> fence <> blankline\n            Right h -> do\n              modify (\\s -> s{ stHighlighting = True })\n              return (literal h)\n        NoHighlighting -> return $ fence <> cr <> literal code <> cr <> fence <> blankline\n        _ -> return $ fence <> lang <> cr <> literal code <> cr <> fence <> blankline\n    LineBlock lns -> do\n      contents <- inlinesToTypst (intercalate [LineBreak] lns)\n      return $ contents <> blankline\n    BlockQuote blocks -> do\n      contents <- blocksToTypst blocks\n      return $ \"#quote(block: true)[\" $$ chomp contents $$ \"]\" $$ blankline\n    HorizontalRule ->\n      return $ blankline <> \"#horizontalrule\" <> blankline\n    OrderedList attribs items -> do\n      let addBlock = case attribs of\n                       (1, DefaultStyle, DefaultDelim) -> id\n                       (1, Decimal, Period) -> id\n                       (start, sty, delim) -> \\x ->\n                              \"#block[\" $$\n                               (\"#set enum\" <>\n                                  parens (\n                                    \"numbering: \" <>\n                                    doubleQuoted\n                                     (case orderedListMarkers (1, sty, delim) of\n                                          (m:_) -> m\n                                          [] -> \"1.\") <>\n                                    \", start: \" <>\n                                      text (show start) )) $$\n                               x $$\n                               \"]\"\n      items' <- mapM (fmap chomp . listItemToTypst 2 (\"+\")) items\n      return $ addBlock\n               (if isTightList items\n                   then vcat items'\n                   else vsep items')\n              $$ blankline\n    BulletList items -> do\n      items' <- mapM (fmap chomp . listItemToTypst 2 \"-\") items\n      return $ (if isTightList items\n                   then vcat items'\n                   else vsep items') $$ blankline\n    DefinitionList items ->\n      ($$ blankline) . vsep <$> mapM defListItemToTypst items\n    Table (ident,tabclasses,tabkvs) (Caption _ caption) colspecs thead tbodies tfoot -> do\n      let lab = toLabel FreestandingLabel ident\n      capt' <- if null caption\n                  then return mempty\n                  else do\n                    captcontents <- blocksToTypst caption\n                    return $ \", caption: \" <> brackets captcontents\n      let typstFigureKind = literal (\", kind: \" <> fromMaybe \"table\" (lookup \"typst:figure:kind\" tabkvs))\n      let numcols = length colspecs\n      let (aligns, widths) = unzip colspecs\n      let commaSep = hcat . intersperse \", \"\n      let toPercentage (ColWidth w) =\n            literal $ (T.dropWhileEnd (== '.') . T.dropWhileEnd (== '0'))\n                         (T.pack (printf \"%0.2f\" (w * 100))) <> \"%\"\n          toPercentage ColWidthDefault = literal \"auto\"\n      let columns = if all (== ColWidthDefault) widths\n                       then literal $ tshow numcols\n                       else parens (commaSep (map toPercentage widths))\n      let formatalign AlignLeft = \"left,\"\n          formatalign AlignRight = \"right,\"\n          formatalign AlignCenter = \"center,\"\n          formatalign AlignDefault = \"auto,\"\n      let alignarray = parens $ mconcat $ map formatalign aligns\n\n      let fromCell (Cell (_,_,kvs) alignment rowspan colspan bs) = do\n            let (typstAttrs, typstTextAttrs) = pickTypstAttrs kvs\n            let valign =\n                  (case lookup \"align\" typstAttrs of\n                    Just va -> [va]\n                    _ -> [])\n            let typstAttrs2 = filter ((/=\"align\") . fst) typstAttrs\n            let halign =\n                  (case alignment of\n                    AlignDefault -> []\n                    AlignLeft -> [ \"left\" ]\n                    AlignRight -> [ \"right\" ]\n                    AlignCenter -> [ \"center\" ])\n            let cellaligns = valign ++ halign\n            let cellattrs =\n                  (case cellaligns of\n                    [] -> []\n                    _ -> [ \"align: \" <> T.intercalate \" + \" cellaligns ]) ++\n                  (case rowspan of\n                     RowSpan 1 -> []\n                     RowSpan n -> [ \"rowspan: \" <> tshow n ]) ++\n                  (case colspan of\n                     ColSpan 1 -> []\n                     ColSpan n -> [ \"colspan: \" <> tshow n ]) ++\n                  map formatTypstProp typstAttrs2\n            cellContents <- blocksToTypst bs\n            let contents2 = brackets (toTypstPoundSetText typstTextAttrs <> cellContents)\n            pure $ if null cellattrs\n                      then contents2\n                      else \"table.cell\" <>\n                            parens\n                             (literal (T.intercalate \", \" cellattrs)) <>\n                            contents2\n      let fromRow (Row _ cs) =\n            (<> \",\") . commaSep <$> mapM fromCell cs\n      let fromHead (TableHead _attr headRows) =\n            if null headRows\n               then pure mempty\n               else (($$ \"table.hline(),\") .\n                      (<> \",\") . (\"table.header\" <>) . parens . nest 2 . vcat)\n                      <$> mapM fromRow headRows\n      let fromFoot (TableFoot _attr footRows) =\n            if null footRows\n               then pure mempty\n               else ((\"table.hline(),\" $$) .\n                      (<> \",\") . (\"table.footer\" <>) . parens . nest 2 . vcat)\n                      <$> mapM fromRow footRows\n      let fromTableBody (TableBody _attr _rowHeadCols headRows bodyRows) = do\n            hrows <- mapM fromRow headRows\n            brows <- mapM fromRow bodyRows\n            pure $ vcat (hrows ++ [\"table.hline(),\" | not (null hrows)] ++ brows)\n      let (typstAttrs, typstTextAttrs) = pickTypstAttrs tabkvs\n      header <- fromHead thead\n      footer <- fromFoot tfoot\n      body <- vcat <$> mapM fromTableBody tbodies\n      let table = \"table(\"\n            $$ nest 2\n                (  \"columns: \" <> columns <> \",\"\n                $$ \"align: \" <> alignarray <> \",\"\n                $$ toTypstPropsListTerm typstAttrs\n                $$ header\n                $$ body\n                $$ footer\n            )\n            $$ \")\"\n      return $ if \"typst:no-figure\" `elem` tabclasses\n        then toTypstBracesSetText typstTextAttrs table\n        else \"#figure(\"\n            $$\n            nest 2\n            (\"align(center)[\" <> toTypstPoundSetText typstTextAttrs <> \"#\" <> table <> \"]\"\n              $$ capt'\n              $$ typstFigureKind\n              $$ \")\")\n            $$ lab\n          $$ blankline\n    Figure (ident,_,_) (Caption _mbshort capt) blocks -> do\n      caption <- blocksToTypst capt\n      opts <-  gets stOptions\n      let toImage (Image attr inlines (src, _)) =\n            Just $ mkImage opts False src attr (getAlt attr inlines)\n          toImage _ = Nothing\n      contents <- case blocks of\n                     -- don't need #box around block-level image\n                     [Para [img]] | Just i <- toImage img -> pure i\n                     [Plain [img]] | Just i <- toImage img -> pure i\n                     _ -> brackets <$> blocksToTypst blocks\n      let lab = toLabel FreestandingLabel ident\n      return $ \"#figure(\" <> nest 2 ((contents <> \",\")\n                                     $$\n                                     (\"caption: [\" $$ nest 2 caption $$ \"]\")\n                                    )\n                          $$ \")\" $$ lab $$ blankline\n    Div (ident,_,_) (Header lev (\"\",cls,kvs) ils:rest) ->\n      blocksToTypst (Header lev (ident,cls,kvs) ils:rest)\n    Div (ident,_,kvs) blocks -> do\n      let lab = toLabel FreestandingLabel ident\n      let (typstAttrs,typstTextAttrs) = pickTypstAttrs kvs\n      -- Handle lang attribute for Div elements\n      let langAttrs = case lookup \"lang\" kvs of\n                        Nothing -> []\n                        Just lang -> case parseLang lang of\n                                       Left _ -> []\n                                       Right l -> [(\"lang\",\n                                                    tshow (langLanguage l))]\n      let allTypstTextAttrs = typstTextAttrs ++ langAttrs\n      contents <- blocksToTypst blocks\n      return $ \"#block\" <> toTypstPropsListParens typstAttrs <> \"[\"\n        $$ toTypstPoundSetText allTypstTextAttrs <> contents\n        $$ (\"]\" <+> lab)\n\ndefListItemToTypst :: PandocMonad m => ([Inline], [[Block]]) -> TW m (Doc Text)\ndefListItemToTypst (term, defns) = do\n  modify $ \\st -> st{ stEscapeContext = TermContext }\n  term' <- inlinesToTypst term\n  modify $ \\st -> st{ stEscapeContext = NormalContext }\n  defns' <- mapM blocksToTypst defns\n  return $ nowrap (\"/ \" <> term' <> \": \" <> \"#block[\") $$\n            chomp (vsep defns') $$ \"]\"\n\nlistItemToTypst :: PandocMonad m => Int -> Doc Text -> [Block] -> TW m (Doc Text)\nlistItemToTypst ind marker blocks = do\n  contents <- blocksToTypst blocks\n  return $ hang ind (marker <> space) contents\n\ninlinesToTypst :: PandocMonad m => [Inline] -> TW m (Doc Text)\ninlinesToTypst ils = hcat <$> mapM inlineToTypst (escapeParens ils)\n\n-- Add an escape before a parenthesis right after a non-space element.\n-- Otherwise we risk `#emph[test](3)` which will error. See #11210.\nescapeParens :: [Inline] -> [Inline]\nescapeParens [] = []\nescapeParens (s : x : xs)\n  | isSpacey s\n    = s : x : escapeParens xs\nescapeParens (Str t : xs)\n  | Just ('(',_) <- T.uncons t\n    = RawInline (Format \"typst\") \"\\\\\" : Str t : escapeParens xs\nescapeParens (x : xs) = x : escapeParens xs\n\nisSpacey :: Inline -> Bool\nisSpacey Space = True\nisSpacey SoftBreak = True\nisSpacey LineBreak = True\nisSpacey _ = False\n\ninlineToTypst :: PandocMonad m => Inline -> TW m (Doc Text)\ninlineToTypst inline =\n  case inline of\n    Str txt -> do\n      opts <-  gets stOptions\n      context <- gets stEscapeContext\n      return $ escapeTypst (isEnabled Ext_smart opts) context txt\n    Space -> return space\n    SoftBreak -> do\n      wrapText <- gets $ writerWrapText . stOptions\n      case wrapText of\n        WrapPreserve -> return cr\n        WrapAuto     -> return space\n        WrapNone     -> return space\n    LineBreak -> return (space <> \"\\\\\" <> space)\n    Math mathType str -> do\n      res <- convertMath TM.writeTypst mathType str\n      case res of\n          Left il -> inlineToTypst il\n          Right r ->\n            (case extractLabel str of -- #10805\n              Nothing -> id\n              Just lab -> (<> (toLabel FreestandingLabel lab))) <$>\n             case mathType of\n               InlineMath -> return $ \"$\" <> literal r <> \"$\"\n               DisplayMath -> return $ \"$ \" <> literal r <> \" $\"\n    Code (ident,cls,kvs) code -> do\n      opts <- gets stOptions\n      let defaultHighlightedCode =\n            case cls of\n              (lang:_) | writerHighlightMethod opts /= NoHighlighting\n                       -> \"#raw(lang:\" <> doubleQuoted lang <>\n                              \", \" <> doubleQuoted code <> \")\"\n              _ | T.any (=='`') code -> \"#raw(\" <> doubleQuoted code <> \")\"\n                | otherwise -> \"`\" <> literal code <> \"`\"\n      case writerHighlightMethod opts of\n        Skylighting _ ->\n          case highlight (writerSyntaxMap opts) formatTypstInline\n                (ident,cls ++ [\"default\"],kvs) code of\n            Left msg -> do\n              unless (T.null msg) $ report $ CouldNotHighlight msg\n              return defaultHighlightedCode\n            Right h -> do\n              modify (\\s -> s{ stHighlighting = True })\n              return (literal h)\n        _ -> return defaultHighlightedCode\n    RawInline fmt str ->\n      case fmt of\n        Format \"typst\" -> return $ literal str\n        _ -> return mempty\n    Strikeout inlines -> textstyle \"#strike\" inlines\n    Emph inlines -> textstyle \"#emph\" inlines\n    Underline inlines -> textstyle \"#underline\" inlines\n    Strong inlines -> textstyle \"#strong\" inlines\n    Superscript inlines -> textstyle \"#super\" inlines\n    Subscript inlines -> textstyle \"#sub\" inlines\n    SmallCaps inlines -> textstyle \"#smallcaps\" inlines\n    Span (ident,cls,kvs) inlines -> do\n      let lab = toLabel FreestandingLabel ident\n      let (_, typstTextAttrs) = pickTypstAttrs kvs\n      contents <- inlinesToTypst inlines\n      let addHl x = \"#highlight\" <> brackets x\n      return $ (if \"mark\" `elem` cls\n                   then addHl\n                   else id)\n               (toTypstTextElement typstTextAttrs contents) <> lab\n    Quoted quoteType inlines -> do\n      opts <- gets stOptions\n      let smart = isEnabled Ext_smart opts\n      contents <- inlinesToTypst inlines\n      return $\n        case quoteType of\n           DoubleQuote\n             | smart -> \"\\\"\" <> contents <> \"\\\"\"\n             | otherwise -> \"“\" <> contents <> \"”\"\n           SingleQuote\n             | smart -> \"'\" <> contents <> \"'\"\n             | otherwise -> \"‘\" <> contents <> \"’\"\n    Cite citations inlines -> do\n      opts <-  gets stOptions\n      if isEnabled Ext_citations opts\n         -- Note: this loses prefix\n         then mconcat <$> mapM toCite citations\n         else inlinesToTypst inlines\n    Link (_,_,kvs) inlines (src,_tit) -> do\n      case lookup \"reference-type\" kvs of\n        Just \"ref\"\n          | Just ('#', ident) <- T.uncons src\n          -> if T.all isIdentChar ident\n                then pure $ literal $ \"@\" <> ident\n                else pure $ \"#ref\" <> parens (toLabel ArgumentLabel ident)\n        _ -> do\n          contents <- inlinesToTypst inlines\n          let dest = case T.uncons src of\n                       Just ('#', ident) -> toLabel ArgumentLabel ident\n                       _ -> doubleQuoted src\n          pure $ \"#link\" <> parens dest <>\n                    (if inlines == [Str src]\n                          then mempty\n                          else nowrap $ brackets contents)\n    Image attr inlines (src,_tit) -> do\n      opts <-  gets stOptions\n      pure $ mkImage opts True src attr (getAlt attr inlines)\n    Note blocks -> do\n      contents <- blocksToTypst blocks\n      return $ \"#footnote\" <> brackets (chomp contents)\n\n-- see #9104; need box or image is treated as block-level\nmkImage :: WriterOptions -> Bool -> Text -> Attr -> Maybe Text -> Doc Text\nmkImage opts useBox src attr mbAlt\n  | useBox = \"#box\" <> parens coreImage\n  | otherwise = coreImage\n where\n  src' = T.pack $ unEscapeString $ T.unpack src -- #9389\n  showDim (Pixel a) = literal (showInInch opts (Pixel a) <> \"in\")\n  showDim dim = text (show dim)\n  dimAttrs =\n     (case dimension Height attr of\n        Nothing -> mempty\n        Just dim -> \", height: \" <> showDim dim) <>\n     (case dimension Width attr of\n        Nothing -> mempty\n        Just dim -> \", width: \" <> showDim dim)\n  altAttr = case mbAlt of\n              Just alt -> \", alt: \" <> doubleQuoted alt\n              Nothing -> mempty\n  isData = \"data:\" `T.isPrefixOf` src'\n  eitherImageData = if isData\n                       then runPure (fetchItem src)\n                       else Left $ PandocSomeError \"not a data URI\"\n  toArray = parens . hcat . intersperse \",\" . map (literal . tshow) . B.unpack\n  attrs = dimAttrs <> altAttr\n  coreImage = \"image\" <> parens\n    (case eitherImageData of\n      Right (contents, Just \"image/svg+xml\")\n        -> \"bytes\" <> parens (doubleQuoted (UTF8.toText contents)) <> attrs\n      Right (bytes, _mime) -> \"bytes\" <> parens (toArray bytes) <> attrs\n      Left _ -> doubleQuoted src' <> attrs)\n\n-- | Extract alt text from image attributes and inlines.\n-- Use explicit alt attribute if present; otherwise use inlines.\n-- Empty alt=\"\" means decorative image (no alt text).\ngetAlt :: Attr -> [Inline] -> Maybe Text\ngetAlt (_, _, kvs) imgInlines =\n  case lookup \"alt\" kvs of\n    Just \"\" -> Nothing  -- decorative\n    Just alt -> Just alt\n    Nothing -> case imgInlines of\n                 [] -> Nothing\n                 _ -> Just (stringify imgInlines)\n\ntextstyle :: PandocMonad m => Doc Text -> [Inline] -> TW m (Doc Text)\ntextstyle s inlines = do\n  (s <>) . brackets . fixInitialAfterBreakEscape\n    <$> inlinesToTypst inlines\n\nfixInitialAfterBreakEscape :: Doc Text -> Doc Text\nfixInitialAfterBreakEscape (Concat x y) =\n  Concat (fixInitialAfterBreakEscape x) y\n-- make an initial AfterBreak escape unconditional (it will be rendered\n-- in a block [..] and there won't be an actual break to trigger it, but\n-- typst still needs the escape)\nfixInitialAfterBreakEscape (AfterBreak \"\\\\\") = Text 1 \"\\\\\"\nfixInitialAfterBreakEscape x = x\n\nisOrderedListMarker :: Text -> Bool\nisOrderedListMarker t = not (T.null ds) && rest == \".\"\n  where (ds, rest) = T.span isDigit t\n\nescapeTypst :: Bool -> EscapeContext -> Text -> Doc Text\nescapeTypst smart context t =\n  (case T.uncons t of\n    Just (c, rest)\n      | c == ';' -> char '\\\\' -- see #9252\n      | c == '.'\n      , not (T.null rest) -> char '\\\\' -- see #11511\n      | needsEscapeAtLineStart c || isOrderedListMarker t\n        -> afterBreak \"\\\\\"\n    _ -> mempty) <>\n   literal (snd $ T.foldl' go ('\\n', mempty) t)\n  where\n    go (lastc, t') c\n      | needsEscape c = (c, t' <> escapeChar c)\n      | c == '-', lastc == '-', smart = (c, t' <> T.pack ['\\\\',c])\n      | c == '/', lastc == '/' = (c, t' <> T.pack ['\\\\',c])\n      | otherwise = (c, T.snoc t' c)\n    escapeChar c\n      | c == '\\160' = \"~\"\n      | c == '\\8216', smart = \"'\" -- left quote\n      | c == '\\8217', smart = \"'\" -- apostrophe\n      | c == '\\8220', smart = \"\\\"\" -- left double quote\n      | c == '\\8221', smart = \"\\\"\" -- right double quote\n      | c == '\\8212', smart = \"---\" -- em dash\n      | c == '\\8211', smart = \"--\" -- en dash\n      | needsEscape c = \"\\\\\" <> T.singleton c\n      | otherwise = T.singleton c\n    needsEscape '\\160' = True\n    needsEscape '\\8216' = smart\n    needsEscape '\\8217' = smart\n    needsEscape '\\8220' = smart\n    needsEscape '\\8221' = smart\n    needsEscape '\\8212' = smart\n    needsEscape '\\8211' = smart\n    needsEscape '\\'' = smart\n    needsEscape '\"' = smart\n    needsEscape '[' = True\n    needsEscape ']' = True\n    needsEscape '#' = True\n    needsEscape '<' = True\n    needsEscape '>' = True\n    needsEscape '@' = True\n    needsEscape '$' = True\n    needsEscape '\\\\' = True\n    needsEscape '`' = True\n    needsEscape '_' = True\n    needsEscape '*' = True\n    needsEscape '~' = True\n    needsEscape ':' = context == TermContext\n    needsEscape _ = False\n\nneedsEscapeAtLineStart :: Char -> Bool\nneedsEscapeAtLineStart '/' = True\nneedsEscapeAtLineStart '+' = True\nneedsEscapeAtLineStart '-' = True\nneedsEscapeAtLineStart '=' = True\nneedsEscapeAtLineStart _ = False\n\ndata LabelType =\n    FreestandingLabel\n  | ArgumentLabel\n  deriving (Show, Eq)\n\ntoLabel :: LabelType -> Text -> Doc Text\ntoLabel labelType ident\n  | T.null ident = mempty\n  | T.all isIdentChar ident'\n    = \"<\" <> literal ident' <> \">\"\n  | otherwise\n     = case labelType of\n          FreestandingLabel -> \"#label\" <> parens (doubleQuoted ident')\n          ArgumentLabel -> \"label\" <> parens (doubleQuoted ident')\n where\n   ident' = T.pack $ unEscapeString $ T.unpack ident\n\nisIdentChar :: Char -> Bool\nisIdentChar c = isXIDContinue c || c == '_' || c == '-' || c == '.' || c == ':'\n\ntoCite :: PandocMonad m => Citation -> TW m (Doc Text)\ntoCite cite = do\n  let ident' = T.pack $ unEscapeString $ T.unpack $ citationId cite\n  -- typst inserts comma and we get a doubled one if supplement contains it:\n  let eatComma (Str \",\" : Space : xs) = xs\n      eatComma xs = xs\n  if citationMode cite == NormalCitation && T.all isIdentChar ident'\n     then do\n       suppl <- case citationSuffix cite of\n                  [] -> pure mempty\n                  suff -> brackets <$> inlinesToTypst (eatComma suff)\n       pure $ \"@\" <> literal ident' <> suppl\n     else do\n       let label = if T.all isIdentChar ident'\n                      then \"<\" <> literal ident' <> \">\"\n                      else \"label\" <> parens (doubleQuoted ident')\n       let form = case citationMode cite of\n                     NormalCitation -> mempty\n                     SuppressAuthor -> \", form: \\\"year\\\"\"\n                     AuthorInText -> \", form: \\\"prose\\\"\"\n       suppl <- case citationSuffix cite of\n                  [] -> pure mempty\n                  suff -> (\", supplement: \" <>) . brackets\n                             <$> inlinesToTypst (eatComma suff)\n       pure $ (if citationMode cite == SuppressAuthor  -- see #11044\n                  then parens\n                  else id)\n            $ \"#cite\" <> parens (label <> form <> suppl)\n\ndoubleQuoted :: Text -> Doc Text\ndoubleQuoted = doubleQuotes . literal . escape\n where\n  escape = T.concatMap escapeChar\n  escapeChar '\\\\' = \"\\\\\\\\\"\n  escapeChar '\"' = \"\\\\\\\"\"\n  escapeChar c = T.singleton c\n\nextractLabel :: Text -> Maybe Text\nextractLabel = go . T.unpack\n where\n   go [] = Nothing\n   go ('\\\\':'l':'a':'b':'e':'l':'{':xs) = Just (T.pack (takeWhile (/='}') xs))\n   go (_:xs) = go xs\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/Vimdoc.hs",
    "content": "{-# LANGUAGE LambdaCase #-}\n{-# LANGUAGE MultiWayIf #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE Strict #-}\n\nmodule Text.Pandoc.Writers.Vimdoc (writeVimdoc) where\n\nimport Control.Applicative (optional, (<|>))\nimport Control.Monad (forM)\nimport Control.Monad.Reader (MonadReader (..), ReaderT (..), asks)\nimport Control.Monad.State (MonadState (..), StateT, evalStateT, gets, modify)\nimport Data.Default (Default (..))\nimport Data.List (intercalate, intersperse, transpose)\nimport Data.List.NonEmpty (NonEmpty (..), nonEmpty)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.DocLayout hiding (char, link, text)\nimport Text.Pandoc.Class.PandocMonad ( report, PandocMonad )\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Error (PandocError)\nimport Text.Pandoc.Logging (LogMessage (..))\nimport Text.Pandoc.Options (WrapOption (..), WriterOptions (..))\nimport Text.Pandoc.Parsing.General (many1Till, many1TillChar, readWith)\nimport Text.Pandoc.Shared (capitalize, onlySimpleTableCells, orderedListMarkers, isTightList, makeSections, removeFormatting, tshow)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.URI (escapeURI, isURI)\nimport Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable)\nimport Text.Parsec (anyChar, char, eof, string, try)\nimport Text.Read (readMaybe)\nimport Text.Pandoc.Chunks (toTOCTree, SecInfo (..))\nimport Data.Tree (Tree(..))\nimport Data.Functor ((<&>))\nimport Data.Sequence (Seq, (|>), (<|))\nimport qualified Data.Sequence as Seq\nimport Data.Foldable (toList)\n\ndata WriterState = WriterState\n  { indentLevel :: Int -- How much to indent the block. Inlines shouldn't\n                       -- be concerned with indent level (I guess?)\n  , shiftWidth :: Int -- spaces per indentation level\n  , writerOptions :: WriterOptions\n  , vimdocPrefix :: Maybe Text\n  }\n\ninstance Default WriterState where\n  def =\n    WriterState\n      { indentLevel = 0\n      , shiftWidth = 4\n      , writerOptions = def\n      , vimdocPrefix = Nothing\n      }\n\nindent :: (Monad m) => Int -> (VW m a) -> (VW m a)\nindent n = local (\\s -> s{indentLevel = indentLevel s + n})\n\ntype VW m = StateT (Seq (Doc Text)) (ReaderT WriterState m)\n\nrunRR :: (Monad m) => Seq (Doc Text) -> WriterState -> VW m a -> m a\nrunRR footnotes opts action = runReaderT (evalStateT action footnotes) opts\n\ndocShiftWidth :: Meta -> Maybe Int\ndocShiftWidth meta = case lookupMeta \"shiftwidth\" meta of\n  Just (MetaInlines [Str sw]) -> readMaybe (T.unpack sw)\n  Just (MetaString sw) -> readMaybe (T.unpack sw)\n  _ -> Nothing\n\ndocVimdocPrefix :: Meta -> Maybe Text\ndocVimdocPrefix meta = case lookupMeta \"vimdoc-prefix\" meta of\n  Just (MetaInlines [Str pref]) -> Just pref\n  Just (MetaString pref) -> Just pref\n  _ -> Nothing\n\n{- | Build a vim modeline\n>>> makeModeLine def\n\"vim:tw=72:sw=4:ts=4:ft=help:norl:et:\"\n-}\nmakeModeLine :: WriterState -> Text\nmakeModeLine ws =\n  T.pack . intercalate \":\" $\n    [ \"vim\"\n    , \"tw=\" <> show tw\n    , \"sw=\" <> show sw\n    , \"ts=\" <> show sw\n    , \"ft=help\"\n    , \"norl\" -- left-to-right text\n    , \"et:\" -- expandtab and finishing \":\"\n    ]\n where\n  tw = writerColumns . writerOptions $ ws\n  sw = shiftWidth ws\n\n-- | Build a single formatted TOC line\ntocEntryToLine :: (PandocMonad m) => SecInfo -> VW m Text\ntocEntryToLine secinfo = do\n  rightRef <- mkVimdocRef (secId secinfo)\n  let numberStr = case secNumber secinfo of\n        Nothing -> \"\"\n        Just x | '.' `T.elem` x -> x <> \" \"\n        Just x -> x <> \". \"\n  title <- inlineListToVimdoc $ removeFormatting (secTitle secinfo)\n  let titlePlain = render Nothing (title <> \" \")\n\n  -- length sub 2 because vertical bars are concealed\n  let rightRefLen = max 0 (T.length rightRef - 2)\n  let numberLen = T.length numberStr\n  let leftLen = numberLen + T.length titlePlain\n  let padForRight = 1\n  textWidth <- asks (writerColumns . writerOptions)\n  il <- asks indentLevel\n\n  -- positive when we lack space (i.e. content is too long)\n  let lack = (il + leftLen + padForRight + rightRefLen) - textWidth\n\n  -- when lacking, truncate title reserving 3+ chars for ellipsis\n  let finalTitle =\n        if lack >= 0\n          then\n            let trunc = T.dropEnd (lack + 3) titlePlain\n                stripped = T.stripEnd trunc\n                ellipsis =\n                  T.replicate (3 + T.length trunc - T.length stripped) \".\"\n             in stripped <> ellipsis\n          else titlePlain\n\n  -- Negative lack means we have an excess of space, so we fill it with dots\n  let dots = T.replicate (negate lack) \".\"\n\n  pure . T.concat $ [numberStr, finalTitle, dots, \" \", rightRef]\n\nvimdocTOC :: (PandocMonad m) => WriterState -> [Block] -> VW m (Doc Text)\nvimdocTOC (WriterState{writerOptions = opts}) blocks = do\n  let (Node _ subtrees) =\n        toTOCTree $ makeSections (writerNumberSections opts) Nothing blocks\n  let tocDepth = writerTOCDepth opts\n  let isBelowTocDepth (Node sec _) = secLevel sec <= tocDepth\n\n  let makeItem :: (PandocMonad m) => Tree SecInfo -> VW m (Doc Text)\n      makeItem (Node secinfo xs) = do\n        line <- tocEntryToLine secinfo\n        -- When unnumbered, indent constantly by two,\n        -- otherwise indent by (length of marker + 1)\n        let markerLen = 1 + maybe 1 T.length (secNumber secinfo)\n        childItems <-\n          indent markerLen $\n            traverse makeItem (filter isBelowTocDepth xs)\n        pure (literal line $$ nest markerLen (vcat childItems))\n\n  items <- traverse makeItem (filter isBelowTocDepth subtrees)\n  pure $ vcat items\n\nwriteVimdoc :: (PandocMonad m) => WriterOptions -> Pandoc -> m Text\nwriteVimdoc opts document@(Pandoc meta _) =\n  let\n    sw = fromMaybe (shiftWidth def) $ docShiftWidth meta\n    vp = docVimdocPrefix meta\n    footnotes = Seq.empty\n    initialEnv = def{shiftWidth = sw, writerOptions = opts, vimdocPrefix = vp}\n   in\n    runRR footnotes initialEnv $ pandocToVimdoc document\n\npandocToVimdoc :: (PandocMonad m) => Pandoc -> VW m Text\npandocToVimdoc (Pandoc meta body) = do\n  st <- ask\n  let opts = writerOptions st\n\n  metadata <- metaToContext opts blockListToVimdoc inlineListToVimdoc meta\n  main <- do\n    body' <- blockListToVimdoc body\n    footnotes <- get\n    rule <- blockToVimdoc HorizontalRule\n    let footnotes' = if Seq.null footnotes\n          then Empty\n          else vsep (toList $ rule <| footnotes)\n    pure $ body' <> blankline <> footnotes'\n\n  title <- inlineListToVimdoc $ docTitle meta\n  authors <- traverse inlineListToVimdoc $ docAuthors meta\n  let authors' = mconcat $ intersperse (\",\" <> space) (fmap nowrap authors)\n  let tw = writerColumns . writerOptions $ st\n\n  let combinedTitle =\n        render (Just tw) . cblock tw $\n            (title <> space)\n              <> (if null authors' then \"\" else \"by\" <> space <> authors')\n\n  -- This is placed here because I couldn't find a way to right-align text\n  -- inside template to the width specified by a variable\n  let toc_reminder =\n        render Nothing . rblock tw $\n          (\"Type |gO| to see the table of contents.\" :: Doc Text)\n\n  toc <- render (Just tw) <$> vimdocTOC st body\n\n  let modeline = makeModeLine st\n  let context =\n        defField \"body\" main\n          . defField \"toc\" (if writerTableOfContents opts then toc else \"\")\n          . defField \"modeline\" modeline\n          . defField \"combined-title\" combinedTitle\n          . defField \"toc-reminder\" toc_reminder\n          $ metadata\n\n  pure $\n    case writerTemplate opts of\n      Just tpl -> render (Just tw) $ renderTemplate tpl context\n      Nothing -> render (Just tw) main\n\nblockListToVimdoc :: (PandocMonad m) => [Block] -> VW m (Doc Text)\nblockListToVimdoc blocks = vcat <$> mapM blockToVimdoc blocks\n\nblockToVimdoc :: (PandocMonad m) => Block -> VW m (Doc Text)\n\nblockToVimdoc (Plain inlines) = inlineListToVimdoc inlines\n\nblockToVimdoc (Para inlines) = do\n  contents <- inlineListToVimdoc inlines\n  pure $ contents <> blankline\n\nblockToVimdoc (LineBlock inliness) = vcat <$> mapM inlineListToVimdoc inliness\n\nblockToVimdoc (CodeBlock (_, cls, _) code) = do\n  sw <- asks shiftWidth\n  let lang = case cls of\n        (lang' : _) -> lang'\n        _ -> \"\"\n  -- NOTE: No blankline after the codeblock because closing `<` is concealed\n  pure . vcat $\n    [ \">\" <> literal lang\n    , nest sw (literal code)\n    , flush \"<\"\n    ]\n\nblockToVimdoc block@(RawBlock format raw) = case format of\n  \"vimdoc\" -> pure $ literal raw\n  _ -> \"\" <$ report (BlockNotRendered block)\n\nblockToVimdoc (BlockQuote blocks) = do\n  content <- blockListToVimdoc blocks\n  pure $ nest 2 content <> blankline\n\nblockToVimdoc (OrderedList listAttr items) = do\n  let itemSpacer = if isTightList items then empty else blankline\n  let itemsWithMarkers = zip (orderedListMarkers listAttr) items\n  items' <- forM itemsWithMarkers $ \\(marker, blocks) -> do\n    let markerLen = T.length marker\n\n    item' <- indent (markerLen + 1) $ blockListToVimdoc blocks\n    pure $ literal marker <> space <> nest (markerLen + 1) item' <> itemSpacer\n  pure $ vcat items' <> blankline\n\nblockToVimdoc (BulletList items) = do\n  let itemSpacer = if isTightList items then empty else blankline\n  items' <- forM items $ \\blocks -> do\n    let marker = \"-\"\n    item <- indent 2 $ blockListToVimdoc blocks\n    pure $ marker <> \" \" <> nest 2 item <> itemSpacer\n  pure $ vcat items' <> blankline\n\nblockToVimdoc (DefinitionList items) = do\n  sw <- asks shiftWidth\n  let sepAll = if all (isTightList . snd) items then vcat else vsep\n  items' <- forM items $ \\(term, definitions) -> do\n    let sepCur = if isTightList definitions then vcat else vsep\n    labeledTerm <- mkVimdocDefinitionTerm term\n    definitions' <- indent sw $ traverse blockListToVimdoc definitions\n    pure $ labeledTerm <> cr <> nest sw (sepCur definitions')\n  pure $ sepAll items' <> blankline\n\nblockToVimdoc (Header level (ref, _, _) inlines) = do\n  tw <- asks (writerColumns . writerOptions)\n  let rule = case level of\n        1 -> T.replicate tw \"=\"\n        2 -> T.replicate tw \"-\"\n        _ -> \"\"\n  title <- fmap (render Nothing) . inlineListToVimdoc $ case level of\n    3 -> capitalize inlines\n    _ -> inlines\n\n  label <- mkVimdocTag ref\n  -- One manual space that ensures that even if spaceLeft is 0, title and ref\n  -- don't touch each other\n  let label' = \" \" <> label\n  -- (+ 2) due to stars concealment\n  let spaceLeft = tw - T.length title + 2\n\n  pure $ vcat\n      [ blankline\n      , literal rule\n      , literal $ title <> T.justifyRight spaceLeft ' ' label'\n      , blankline\n      ]\n\nblockToVimdoc HorizontalRule = do\n  tw <- asks (writerColumns . writerOptions)\n  pure $ literal (T.replicate (tw `div` 2) \" *\") <> blankline\n\n-- Based on blockToMarkdown' from Text.Pandoc.Writers.Markdown\nblockToVimdoc t@(Table (_, _, _) blkCapt specs thead tbody tfoot) = do\n  let isColRowSpans (Cell _ _ rs cs _) = rs > 1 || cs > 1\n  let rowHasColRowSpans (Row _ cs) = any isColRowSpans cs\n  let tbodyHasColRowSpans (TableBody _ _ rhs rs) =\n        any rowHasColRowSpans rhs || any rowHasColRowSpans rs\n  let theadHasColRowSpans (TableHead _ rs) = any rowHasColRowSpans rs\n  let tfootHasColRowSpans (TableFoot _ rs) = any rowHasColRowSpans rs\n  let hasColRowSpans =\n        theadHasColRowSpans thead\n          || any tbodyHasColRowSpans tbody\n          || tfootHasColRowSpans tfoot\n  let (caption, aligns, widths, headers, rows) =\n        toLegacyTable blkCapt specs thead tbody tfoot\n  let numcols =\n        maximum $\n          length aligns :| length widths : map length (headers : rows)\n  caption' <- inlineListToVimdoc caption\n  let caption''\n        | null caption = blankline\n        | otherwise = blankline $$ caption' $$ blankline\n  let hasSimpleCells = onlySimpleTableCells $ headers : rows\n  let isSimple = hasSimpleCells && all (== 0) widths && not hasColRowSpans\n  let isPlainBlock (Plain _) = True\n      isPlainBlock _ = False\n  let hasBlocks = not (all (all (all isPlainBlock)) $ headers : rows)\n  let padRow r = r ++ replicate x empty\n       where\n        x = numcols - length r\n  let aligns' = aligns ++ replicate x AlignDefault\n       where\n        x = numcols - length aligns\n  let widths' = widths ++ replicate x 0.0\n       where\n        x = numcols - length widths\n  sw <- asks shiftWidth\n  rawHeaders <- padRow <$> mapM blockListToVimdoc headers\n  rawRows <- mapM (fmap padRow . mapM blockListToVimdoc) rows\n  let hasHeader = all null headers\n  if\n    | isSimple -> do\n        -- Simple table\n        tbl <-\n          indent sw $\n            vimdocTable False hasHeader aligns' widths' rawHeaders rawRows\n        pure $ nest sw (tbl $$ caption'') $$ blankline\n    | not (hasBlocks || hasColRowSpans) -> do\n        -- Multiline table\n        tbl <-\n          indent sw $\n            vimdocTable True hasHeader aligns' widths' rawHeaders rawRows\n        pure $ nest sw (tbl $$ caption'') $$ blankline\n    | otherwise -> (\"[TABLE]\" $$ caption'') <$ report (BlockNotRendered t)\n\nblockToVimdoc (Figure _ _ blocks) = blockListToVimdoc blocks\n\nblockToVimdoc (Div _ blocks) = blockListToVimdoc blocks\n\n{- | Create a vimdoc tag. Tag is prefixed with \"$vimdocPrefix-\" if vimdocPrefix\nis a Just value.\n>>> runReader (mkVimdocTag \"abc\") def\n\"*abc*\"\n>>> runReader (mkVimdocTag \"abc\") (def{vimdocPrefix = Just \"myCoolProject\"})\n\"*myCoolProject-abc*\"\n-}\nmkVimdocTag :: (Monad m) => Text -> VW m Text\nmkVimdocTag tag = do\n  asks vimdocPrefix <&> \\case\n    _ | T.null tag -> \"\"\n    Nothing -> \"*\" <> tag <> \"*\"\n    Just pref' -> \"*\" <> pref' <> \"-\" <> tag <> \"*\"\n\n{- | Create a hotlink for a tag, ie. a followable vimdoc link. Tag is prefixed\n - with \"$vimdocPrefix-\" if vimdocPrefix is a Just value\n>>> runReader (mkVimdocRef \"abc\") def\n\"|abc|\"\n>>> runReader (mkVimdocRef \"abc\") (def{vimdocPrefix = Just \"myCoolProject\"})\n\"|myCoolProject-abc|\"\n-}\nmkVimdocRef :: (Monad m) => Text -> VW m Text\nmkVimdocRef ref =\n  asks vimdocPrefix <&> \\case\n    _ | T.null ref -> \"\"\n    Nothing -> \"|\" <> ref <> \"|\"\n    Just pref' -> \"|\" <> pref' <> \"-\" <> ref <> \"|\"\n\nmkVimdocDefinitionTerm ::\n  (PandocMonad m) =>\n  [Inline] ->\n  VW m (Doc Text)\nmkVimdocDefinitionTerm inlines = do\n  il <- asks indentLevel\n  tw <- asks (writerColumns . writerOptions)\n  label <- case inlines of\n    -- NOTE: commands in vim are unique, so they get no prefix\n    [Code (ref, _, _) code]\n      | T.isPrefixOf \":\" code ->\n          pure . Just $ \"*\" <> ref <> \"*\"\n    [Code (ref, _, _) _] | not (T.null ref) -> Just <$> mkVimdocTag ref\n    [Span (ref, _, _) _] | not (T.null ref) -> Just <$> mkVimdocTag ref\n    _ -> pure Nothing\n\n  term <- case inlines of\n    [Code _ code] | T.isPrefixOf \":\" code -> pure $ literal code\n    _ -> inlineListToVimdoc inlines\n  let termLen = offset term\n  let labelLen = maybe 0 T.length label\n\n  if il + termLen + labelLen > tw\n    then\n      pure . mconcat $\n        [ case label of\n            Nothing -> empty\n            -- (+2) due to stars concealment\n            Just l -> flush (rblock (tw + 2) $ literal l) <> cr\n        , term\n        ]\n    else\n      pure . mconcat $\n        [ -- Since we calculated that label fits on the same line as\n          -- term and since label actually must exceed textwidth to align\n          -- properly, we disable wrapping.\n          -- vvvvvvvv\n          nowrap term\n        , case label of\n            Nothing -> empty\n            -- (+2) due to stars concealment\n            Just l -> rblock (tw - termLen - il + 2) (literal l)\n        ]\n\n-- | Write a vimdoc table\nvimdocTable ::\n  (Monad m) =>\n  -- | whether this is a multiline table\n  Bool ->\n  -- | whether the table has a header\n  Bool ->\n  -- | column alignments\n  [Alignment] ->\n  -- | column widths\n  [Double] ->\n  -- | table header cells\n  [Doc Text] ->\n  -- | table body rows\n  [[Doc Text]] ->\n  VW m (Doc Text)\nvimdocTable multiline headless aligns widths rawHeaders rawRows = do\n  let isSimple = all (== 0) widths\n  let alignHeader alignment = case alignment of\n        AlignLeft -> lblock\n        AlignCenter -> cblock\n        AlignRight -> rblock\n        AlignDefault -> lblock\n  -- Number of characters per column necessary to output every cell\n  -- without requiring a line break.\n  -- The @+2@ is needed for specifying the alignment.\n  let numChars = (+ 2) . maybe 0 maximum . nonEmpty . map offset\n  -- Number of characters per column necessary to output every cell\n  -- without requiring a line break *inside a word*.\n  -- The @+2@ is needed for specifying the alignment.\n  let minNumChars = (+ 2) . maybe 0 maximum . nonEmpty . map minOffset\n  let columns = transpose (rawHeaders : rawRows)\n\n  il <- asks indentLevel\n\n  -- x = (2 * length columns)         -- spaces for specifying the alignment\n  -- y = (length columns - 1)         -- spaces between the columns\n  -- x + y = (3 * length columns - 1) -- total needed correction\n  tw <- asks (writerColumns . writerOptions)\n  let tw' = tw - il - 3 * length columns + 1\n  wrap <- asks (writerWrapText . writerOptions)\n\n  -- minimal column width without wrapping a single word\n  let relWidth w col =\n        max\n          (floor $ fromIntegral (tw' - 1) * w)\n          ( if wrap == WrapAuto\n              then minNumChars col\n              else numChars col\n          )\n  let widthsInChars\n        | isSimple = map numChars columns\n        | otherwise = zipWith relWidth widths columns\n  let makeRow =\n        hcat\n          . intersperse (lblock 1 (literal \" \"))\n          . zipWith3 alignHeader aligns widthsInChars\n  let rows' = map makeRow rawRows\n  -- TODO: reduce tw in case head is not empty\n  let head' = makeRow rawHeaders <> \" ~\"\n  let head'' =\n        if headless\n          then empty\n          else head'\n  let body =\n        if multiline\n          then\n            vsep rows'\n              $$ if length rows' < 2\n                then blankline\n                else empty\n          else vcat rows'\n  return $\n    blankline\n      $$ head''\n      $$ (if multiline then blankline else empty)\n      $$ body\n\n-- | Replace Unicode characters with their ASCII representation\nreplaceSpecialStrings :: Text -> Text\nreplaceSpecialStrings =\n  let expand c = case c of\n        '\\x00ad' -> \"\"\n        '\\x2013' -> \"--\"\n        '\\x2014' -> \"---\"\n        '\\x2019' -> \"'\"\n        '\\x2026' -> \"...\"\n        _        -> T.singleton c\n  in T.concatMap expand\n\ninlineListToVimdoc :: (PandocMonad m) => [Inline] -> VW m (Doc Text)\ninlineListToVimdoc inlines = hcat <$> mapM inlineToVimdoc inlines\n\ninlineToVimdoc :: (PandocMonad m) => Inline -> VW m (Doc Text)\n\ninlineToVimdoc (Str str) = pure . literal $ replaceSpecialStrings str\n\n-- Neither `:h help-writing`, nor neovim's grammar.js for vimdoc and\n-- highlights.scm say anything about styling text, so we strip all the\n-- formatting\ninlineToVimdoc (Emph inlines) = inlineListToVimdoc inlines\ninlineToVimdoc (Underline inlines) = inlineListToVimdoc inlines\ninlineToVimdoc (Strong inlines) = inlineListToVimdoc inlines\ninlineToVimdoc (Strikeout inlines) = inlineListToVimdoc inlines\ninlineToVimdoc (Superscript inlines) = inlineListToVimdoc inlines\ninlineToVimdoc (Subscript inlines) = inlineListToVimdoc inlines\ninlineToVimdoc (SmallCaps inlines) = inlineListToVimdoc inlines\n\ninlineToVimdoc (Quoted typ inlines) =\n  let quote = case typ of SingleQuote -> \"'\"; DoubleQuote -> \"\\\"\"\n   in inlineListToVimdoc inlines >>= \\text -> pure (quote <> text <> quote)\n\ninlineToVimdoc (Cite _citations inlines) = inlineListToVimdoc inlines\n\ninlineToVimdoc (Code (_, cls, _) code) = do\n  let hasNoLang = null cls\n  pure . literal $ case T.words code of\n    [\":help\", ref] | hasNoLang -> \"|\" <> ref <> \"|\"\n    [\":h\", ref]    | hasNoLang -> \"|\" <> ref <> \"|\"\n    _                          -> \"`\" <> code <> \"`\"\n\ninlineToVimdoc Space = pure space\ninlineToVimdoc SoftBreak =\n  asks (writerWrapText . writerOptions) >>= \\case\n    WrapAuto -> pure space\n    WrapNone -> pure \" \"\n    WrapPreserve -> pure \"\\n\"\n\ninlineToVimdoc LineBreak = pure \"\\n\"\n\ninlineToVimdoc (Math _ math) = pure . literal $ \"`$\" <> math <> \"$`\"\n\ninlineToVimdoc inline@(RawInline (Format format) text) = case format of\n  \"vimdoc\" -> pure $ literal text\n  _ -> \"\" <$ report (InlineNotRendered inline)\n\ninlineToVimdoc (Link _ txt (src, _)) = do\n  let srcSuffix = fromMaybe src (T.stripPrefix \"mailto:\" src)\n  linkText <- render Nothing <$> inlineListToVimdoc txt\n\n  let isAutolink = case txt of\n        [Str x] | escapeURI x `elem` [src, srcSuffix] -> True\n        _ -> False\n\n  pure $ case refdocLinkToLink src of\n    Right link | isAutolink -> \"|\" <> literal link <> \"|\"\n    Right link ->\n      literal (T.stripEnd linkText) <> space <> \"|\" <> literal link <> \"|\"\n    Left _ | isURI src, isAutolink -> literal srcSuffix\n    Left _ -> literal (T.stripEnd linkText) <> space <> literal srcSuffix\n\ninlineToVimdoc (Image {}) = pure \"\"\n\ninlineToVimdoc (Note blocks) = do\n  newN <- gets (succ . Seq.length)\n  contents <- blockListToVimdoc blocks\n  tag <- mkVimdocTag (\"footnote\" <> tshow newN)\n  tw <- asks (writerColumns . writerOptions)\n\n  -- (+2) due to concealment of stars\n  --                     vvvvvvvv\n  let taggedContents = rblock (tw + 2) (literal tag) $$ contents\n  modify (|> taggedContents)\n\n  ref <- mkVimdocRef (\"footnote\" <> tshow newN)\n  pure $ space <> literal ref\n\ninlineToVimdoc (Span _ inlines) = inlineListToVimdoc inlines\n\n\nrefdocLinkToLink :: Text -> Either PandocError Text\nrefdocLinkToLink x = (\\parser -> readWith parser Nothing x) $ do\n  string \"http\" >> optional (char 's') >> string \"://\"\n\n  let vimhelpP = do\n        try (string \"vimhelp.org/\") <|> string \"neo.vimhelp.org/\"\n\n        try (many1Till anyChar (char '#') >> many1TillChar anyChar eof)\n          <|> many1TillChar anyChar (try $ string \".html\" >> eof)\n\n  let neovimP = do\n        string \"neovim.io/doc/user/\"\n        try (many1Till anyChar (char '#') >> many1TillChar anyChar eof)\n          <|> do base <- many1TillChar anyChar (try $ string \".html\" >> eof)\n                 pure $ base <> \".txt\"\n\n  try vimhelpP <|> neovimP\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/XML.hs",
    "content": "{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\n-- |\n--   Module      : Text.Pandoc.Writers.XML\n--   Copyright   : Copyright (C) 2025- Massimiliano Farinella and John MacFarlane\n--   License     : GNU GPL, version 2 or above\n--\n--   Maintainer  : Massimiliano Farinella <massifrg@gmail.com>\n--   Stability   : WIP\n--   Portability : portable\n--\n-- Conversion of 'Pandoc' documents to (pandoc specific) xml markup.\nmodule Text.Pandoc.Writers.XML (writeXML) where\n\nimport Data.Map (Map, toList)\nimport Data.Maybe (mapMaybe)\nimport qualified Data.Text as T\nimport Data.Version (versionBranch)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options (WriterOptions (..))\nimport Text.Pandoc.XML.Light\nimport qualified Text.Pandoc.XML.Light as XML\nimport Text.Pandoc.XMLFormat\nimport Text.XML.Light (xml_header)\n\ntype PandocAttr = Text.Pandoc.Definition.Attr\n\nwriteXML :: (PandocMonad m) => WriterOptions -> Pandoc -> m T.Text\nwriteXML _ doc = do\n  return $ pandocToXmlText doc\n\ntext_node :: T.Text -> Content\ntext_node text = Text (CData CDataText text Nothing)\n\nemptyElement :: T.Text -> Element\nemptyElement tag =\n  Element\n    { elName = unqual tag,\n      elAttribs = [],\n      elContent = [],\n      elLine = Nothing\n    }\n\nelementWithContents :: T.Text -> [Content] -> Element\nelementWithContents tag contents =\n  Element\n    { elName = unqual tag,\n      elAttribs = [],\n      elContent = contents,\n      elLine = Nothing\n    }\n\nelementWithAttributes :: T.Text -> [XML.Attr] -> Element\nelementWithAttributes tag attributes =\n  Element\n    { elName = unqual tag,\n      elAttribs = attributes,\n      elContent = [],\n      elLine = Nothing\n    }\n\nelementWithAttrAndContents :: T.Text -> PandocAttr -> [Content] -> Element\nelementWithAttrAndContents tag attr contents = addAttrAttributes attr $ elementWithContents tag contents\n\nasBlockOfInlines :: Element -> [Content]\nasBlockOfInlines el = [Elem el, text_node \"\\n\"]\n\nasBlockOfBlocks :: Element -> [Content]\nasBlockOfBlocks el = [Elem newline_before_first, newline]\n  where\n    newline = text_node \"\\n\"\n    newline_before_first = if null (elContent el) then el else prependContents [newline] el\n\nitemName :: (Show a) => a -> T.Text\nitemName a = T.pack $ takeWhile (/= ' ') (show a)\n\nintAsText :: Int -> T.Text\nintAsText i = T.pack $ show i\n\nitemAsEmptyElement :: (Show a) => a -> Element\nitemAsEmptyElement item = emptyElement $ itemName item\n\npandocToXmlText :: Pandoc -> T.Text\npandocToXmlText (Pandoc (Meta meta) blocks) = with_header . with_blocks . with_meta . with_version $ el\n  where\n    el = prependContents [text_node \"\\n\"] $ emptyElement \"Pandoc\"\n    with_version = addAttribute atNameApiVersion (T.intercalate \",\" $ map (T.pack . show) $ versionBranch pandocTypesVersion)\n    with_meta = appendContents (metaMapToXML meta \"meta\")\n    with_blocks = appendContents (asBlockOfBlocks $ elementWithContents \"blocks\" $ blocksToXML blocks)\n    with_header :: Element -> T.Text\n    with_header e = T.concat [T.pack xml_header, \"\\n\", showElement e]\n\nmetaMapToXML :: Map T.Text MetaValue -> T.Text -> [Content]\nmetaMapToXML mmap tag = asBlockOfBlocks $ elementWithContents tag entries\n  where\n    entries = concatMap to_entry $ toList mmap\n    to_entry :: (T.Text, MetaValue) -> [Content]\n    to_entry (text, metavalue) = asBlockOfBlocks with_key\n      where\n        entry = elementWithContents tgNameMetaMapEntry $ metaValueToXML metavalue\n        with_key = addAttribute atNameMetaMapEntryKey text entry\n\nmetaValueToXML :: MetaValue -> [Content]\nmetaValueToXML value =\n  let name = itemName value\n      el = itemAsEmptyElement value\n   in case (value) of\n        MetaBool b -> asBlockOfInlines $ addAttribute atNameMetaBoolValue bool_value el\n          where\n            bool_value = if b then \"true\" else \"false\"\n        MetaString s -> asBlockOfInlines $ appendContents [text_node s] el\n        MetaInlines inlines -> asBlockOfInlines $ appendContents (inlinesToXML inlines) el\n        MetaBlocks blocks -> asBlockOfBlocks $ appendContents (blocksToXML blocks) el\n        MetaList items -> asBlockOfBlocks $ appendContents (concatMap metaValueToXML items) el\n        MetaMap mm -> metaMapToXML mm name\n\nblocksToXML :: [Block] -> [Content]\nblocksToXML blocks = concatMap blockToXML blocks\n\ninlinesToXML :: [Inline] -> [Content]\ninlinesToXML inlines = concatMap inlineContentToContents (ilsToIlsContent inlines [])\n\ndata InlineContent\n  = NormalInline Inline\n  | ElSpace Int\n  | ElStr T.Text\n\nilsToIlsContent :: [Inline] -> [InlineContent] -> [InlineContent]\nilsToIlsContent (Space : xs) [] = ilsToIlsContent xs [ElSpace 1]\nilsToIlsContent (Space : xs) (NormalInline Space : cs) = ilsToIlsContent xs (ElSpace 2 : cs)\nilsToIlsContent (Space : xs) (ElSpace n : cs) = ilsToIlsContent xs (ElSpace (n + 1) : cs)\n-- empty Str are always encoded as <Str />\nilsToIlsContent (Str \"\" : xs) ilct = ilsToIlsContent xs (ElStr \"\" : ilct)\n-- Str s1, Str s2 -> s1<Str content=\"s2\">\nilsToIlsContent (Str s2 : xs) (NormalInline str1@(Str _) : ilct) = ilsToIlsContent xs (ElStr s2 : NormalInline str1 : ilct)\n--\nilsToIlsContent (Str s : xs) ilct =\n  if T.any (== ' ') s\n    then ilsToIlsContent xs (ElStr s : ilct)\n    else ilsToIlsContent xs (NormalInline (Str s) : ilct)\nilsToIlsContent (x : xs) ilct = ilsToIlsContent xs (NormalInline x : ilct)\nilsToIlsContent [] ilct = reverse $ lastSpaceAsElem ilct\n  where\n    lastSpaceAsElem :: [InlineContent] -> [InlineContent]\n    lastSpaceAsElem (NormalInline Space : xs) = ElSpace 1 : xs\n    lastSpaceAsElem ilcts = ilcts\n\ninlineContentToContents :: InlineContent -> [Content]\ninlineContentToContents (NormalInline il) = inlineToXML il\ninlineContentToContents (ElSpace 1) = [Elem $ emptyElement \"Space\"]\ninlineContentToContents (ElSpace n) = [Elem $ addAttribute atNameSpaceCount (intAsText n) (emptyElement \"Space\")]\ninlineContentToContents (ElStr \"\") = [Elem $ emptyElement \"Str\"]\ninlineContentToContents (ElStr s) = [Elem $ addAttribute atNameStrContent s (emptyElement \"Str\")]\n\nasContents :: Element -> [Content]\nasContents el = [Elem el]\n\nwrapBlocks :: T.Text -> [Block] -> [Content]\nwrapBlocks tag blocks = asBlockOfBlocks $ elementWithContents tag $ blocksToXML blocks\n\nwrapArrayOfBlocks :: T.Text -> [[Block]] -> [Content]\nwrapArrayOfBlocks tag array = concatMap (wrapBlocks tag) array\n\n-- wrapInlines :: T.Text -> [Inline] -> [Content]\n-- wrapInlines tag inlines = asBlockOfInlines $ element_with_contents tag $ inlinesToXML inlines\n\nblockToXML :: Block -> [Content]\nblockToXML block =\n  let el = itemAsEmptyElement block\n   in case (block) of\n        Para inlines -> asBlockOfInlines $ appendContents (inlinesToXML inlines) el\n        Header level (idn, cls, attrs) inlines -> asBlockOfInlines $ appendContents (inlinesToXML inlines) with_attr\n          where\n            with_attr = addAttrAttributes (idn, cls, attrs ++ [(atNameLevel, intAsText level)]) el\n        Plain inlines -> asBlockOfInlines $ appendContents (inlinesToXML inlines) el\n        Div attr blocks -> asBlockOfBlocks $ appendContents (blocksToXML blocks) with_attr\n          where\n            with_attr = addAttrAttributes attr el\n        BulletList items -> asBlockOfBlocks $ appendContents (wrapArrayOfBlocks tgNameListItem items) el\n        OrderedList (start, style, delim) items -> asBlockOfBlocks $ with_contents . with_attrs $ el\n          where\n            with_attrs =\n              addAttributes\n                ( validAttributes\n                    [ (atNameStart, intAsText start),\n                      (atNameNumberStyle, itemName style),\n                      (atNameNumberDelim, itemName delim)\n                    ]\n                )\n            with_contents = appendContents (wrapArrayOfBlocks tgNameListItem items)\n        BlockQuote blocks -> asBlockOfBlocks $ appendContents (blocksToXML blocks) el\n        HorizontalRule -> asBlockOfInlines el\n        CodeBlock attr text -> asBlockOfInlines $ with_contents . with_attr $ el\n          where\n            with_contents = appendContents [text_node text]\n            with_attr = addAttrAttributes attr\n        LineBlock lins -> asBlockOfBlocks $ appendContents (concatMap wrapInlines lins) el\n          where\n            wrapInlines inlines = asContents $ appendContents (inlinesToXML inlines) $ emptyElement tgNameLineItem\n        Table attr caption colspecs thead tbodies tfoot -> asBlockOfBlocks $ with_foot . with_bodies . with_head . with_colspecs . with_caption . with_attr $ el\n          where\n            with_attr = addAttrAttributes attr\n            with_caption = appendContents (captionToXML caption)\n            with_colspecs = appendContents (colSpecsToXML colspecs)\n            with_head = appendContents (tableHeadToXML thead)\n            with_bodies = appendContents (concatMap tableBodyToXML tbodies)\n            with_foot = appendContents (tableFootToXML tfoot)\n        Figure attr caption blocks -> asBlockOfBlocks $ with_contents . with_caption . with_attr $ el\n          where\n            with_attr = addAttrAttributes attr\n            with_caption = appendContents (captionToXML caption)\n            with_contents = appendContents (blocksToXML blocks)\n        RawBlock (Format format) text -> asContents $ appendContents [text_node text] raw\n          where\n            raw = addAttribute atNameFormat format el\n        DefinitionList items -> asBlockOfBlocks $ appendContents (map definitionListItemToXML items) el\n\ninlineToXML :: Inline -> [Content]\ninlineToXML inline =\n  let el = itemAsEmptyElement inline\n      wrapInlines inlines = asContents $ appendContents (inlinesToXML inlines) el\n   in case (inline) of\n        Space -> [text_node \" \"]\n        Str s -> [text_node s]\n        Emph inlines -> wrapInlines inlines\n        Strong inlines -> wrapInlines inlines\n        Quoted quote_type inlines -> asContents $ appendContents (inlinesToXML inlines) quoted\n          where\n            quoted = addAttribute atNameQuoteType (itemName quote_type) el\n        Underline inlines -> wrapInlines inlines\n        Strikeout inlines -> wrapInlines inlines\n        SmallCaps inlines -> wrapInlines inlines\n        Superscript inlines -> wrapInlines inlines\n        Subscript inlines -> wrapInlines inlines\n        SoftBreak -> asContents el\n        LineBreak -> asContents el\n        Span attr inlines -> asContents $ appendContents (inlinesToXML inlines) with_attr\n          where\n            with_attr = addAttrAttributes attr el\n        Link (idn, cls, attrs) inlines (url, title) -> asContents $ appendContents (inlinesToXML inlines) with_attr\n          where\n            with_attr = addAttrAttributes (idn, cls, attrs ++ [(atNameLinkUrl, url), (atNameTitle, title)]) el\n        Image (idn, cls, attrs) inlines (url, title) -> asContents $ appendContents (inlinesToXML inlines) with_attr\n          where\n            with_attr = addAttrAttributes (idn, cls, attrs ++ [(atNameImageUrl, url), (atNameTitle, title)]) el\n        RawInline (Format format) text -> asContents $ appendContents [text_node text] raw\n          where\n            raw = addAttribute atNameFormat format el\n        Math math_type text -> asContents $ appendContents [text_node text] math\n          where\n            math = addAttribute atNameMathType (itemName math_type) el\n        Code attr text -> asContents $ appendContents [text_node text] with_attr\n          where\n            with_attr = addAttrAttributes attr el\n        Note blocks -> asContents $ appendContents (blocksToXML blocks) el\n        Cite citations inlines -> asContents $ appendContents (inlinesToXML inlines) with_citations\n          where\n            with_citations = addCitations citations el\n\n-- TODO: don't let an attribute overwrite id or class\nmaybeAttribute :: (T.Text, T.Text) -> Maybe XML.Attr\nmaybeAttribute (_, \"\") = Nothing\nmaybeAttribute (\"\", _) = Nothing\nmaybeAttribute (name, value) = Just $ XML.Attr (unqual name) value\n\nvalidAttributes :: [(T.Text, T.Text)] -> [XML.Attr]\nvalidAttributes pairs = mapMaybe maybeAttribute pairs\n\nappendContents :: [Content] -> Element -> Element\nappendContents newContents el = el {elContent = (elContent el) ++ newContents}\n\nprependContents :: [Content] -> Element -> Element\nprependContents newContents el = el {elContent = newContents ++ (elContent el)}\n\naddAttributes :: [XML.Attr] -> Element -> Element\naddAttributes newAttrs el = el {elAttribs = newAttrs ++ elAttribs el}\n\naddAttribute :: T.Text -> T.Text -> Element -> Element\naddAttribute attr_name attr_value el = el {elAttribs = new_attr : elAttribs el}\n  where\n    new_attr = XML.Attr (unqual attr_name) attr_value\n\naddAttrAttributes :: PandocAttr -> Element -> Element\naddAttrAttributes (identifier, classes, attributes) el = addAttributes attrs' el\n  where\n    attrs' = mapMaybe maybeAttribute ((\"id\", identifier) : (\"class\", T.intercalate \" \" classes) : attributes)\n\naddCitations :: [Citation] -> Element -> Element\naddCitations citations el = appendContents [Elem $ elementWithContents tgNameCitations $ (text_node \"\\n\") : concatMap citation_to_elem citations] el\n  where\n    citation_to_elem :: Citation -> [Content]\n    citation_to_elem citation = asBlockOfInlines with_suffix\n      where\n        cit_elem = elementWithAttributes (itemName citation) attrs\n        prefix = citationPrefix citation\n        suffix = citationSuffix citation\n        with_prefix =\n          if null prefix\n            then cit_elem\n            else appendContents [Elem $ elementWithContents tgNameCitationPrefix $ inlinesToXML prefix] cit_elem\n        with_suffix =\n          if null suffix\n            then with_prefix\n            else appendContents [Elem $ elementWithContents tgNameCitationSuffix $ inlinesToXML suffix] with_prefix\n        attrs =\n          map\n            (\\(n, v) -> XML.Attr (unqual n) v)\n            [ (\"id\", citationId citation),\n              (atNameCitationMode, T.pack $ show $ citationMode citation),\n              (atNameCitationNoteNum, intAsText $ citationNoteNum citation),\n              (atNameCitationHash, intAsText $ citationHash citation)\n            ]\n\ndefinitionListItemToXML :: ([Inline], [[Block]]) -> Content\ndefinitionListItemToXML (inlines, defs) = Elem $ elementWithContents tgNameDefListItem $ term ++ wrapArrayOfBlocks tgNameDefListDef defs\n  where\n    term = asBlockOfInlines $ appendContents (inlinesToXML inlines) $ emptyElement tgNameDefListTerm\n\ncaptionToXML :: Caption -> [Content]\ncaptionToXML (Caption short blocks) = asBlockOfBlocks with_short_caption\n  where\n    el = elementWithContents \"Caption\" $ blocksToXML blocks\n    with_short_caption = case (short) of\n      Just inlines -> prependContents (asBlockOfInlines $ elementWithContents tgNameShortCaption $ inlinesToXML inlines) el\n      _ -> el\n\ncolSpecToXML :: (Alignment, ColWidth) -> [Content]\ncolSpecToXML (align, cw) = asBlockOfInlines colspec\n  where\n    colspec = elementWithAttributes \"ColSpec\" $ validAttributes [(atNameAlignment, itemName align), (atNameColWidth, colwidth)]\n    colwidth = case (cw) of\n      ColWidth d -> T.pack $ show d\n      ColWidthDefault -> \"0\"\n\ncolSpecsToXML :: [(Alignment, ColWidth)] -> [Content]\ncolSpecsToXML colspecs = asBlockOfBlocks $ elementWithContents tgNameColspecs $ concatMap colSpecToXML colspecs\n\ntableHeadToXML :: TableHead -> [Content]\ntableHeadToXML (TableHead attr rows) = asBlockOfBlocks $ elementWithAttrAndContents \"TableHead\" attr $ concatMap rowToXML rows\n\ntableBodyToXML :: TableBody -> [Content]\ntableBodyToXML (TableBody (idn, cls, attrs) (RowHeadColumns headcols) hrows brows) = asBlockOfBlocks $ elementWithAttrAndContents \"TableBody\" attr children\n  where\n    attr = (idn, cls, (atNameRowHeadColumns, intAsText headcols) : attrs)\n    header_rows = asBlockOfBlocks $ elementWithContents tgNameBodyHeader $ concatMap rowToXML hrows\n    body_rows = asBlockOfBlocks $ elementWithContents tgNameBodyBody $ concatMap rowToXML brows\n    children = header_rows ++ body_rows\n\ntableFootToXML :: TableFoot -> [Content]\ntableFootToXML (TableFoot attr rows) = asBlockOfBlocks $ elementWithAttrAndContents \"TableFoot\" attr $ concatMap rowToXML rows\n\nrowToXML :: Row -> [Content]\nrowToXML (Row attr cells) = asBlockOfBlocks $ elementWithAttrAndContents \"Row\" attr $ concatMap cellToXML cells\n\ncellToXML :: Cell -> [Content]\ncellToXML (Cell (idn, cls, attrs) alignment (RowSpan rowspan) (ColSpan colspan) blocks) = asBlockOfBlocks $ elementWithAttrAndContents \"Cell\" attr $ blocksToXML blocks\n  where\n    with_alignment a = (atNameAlignment, itemName alignment) : a\n    with_rowspan a = if rowspan > 1 then (atNameRowspan, intAsText rowspan) : a else a\n    with_colspan a = if colspan > 1 then (atNameColspan, intAsText colspan) : a else a\n    attrs' = (with_colspan . with_rowspan . with_alignment) attrs\n    attr = (idn, cls, attrs')\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/XWiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-\nCopyright (C) 2008-2024 John MacFarlane <jgm@berkeley.edu>\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n-}\n\n{- |\n   Module      : Text.Pandoc.Writers.XWiki\n   Copyright   : Copyright (C) 2008-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Derek Chen-Becker <dchenbecker@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nConversion of 'Pandoc' documents to XWiki markup.\n\nXWiki:  <http://www.xwiki.org/>\nXWiki Syntax:  <http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/>\n-}\n\nmodule Text.Pandoc.Writers.XWiki ( writeXWiki ) where\nimport Control.Monad.Reader (ReaderT, asks, local, runReaderT)\nimport qualified Data.Set as Set\nimport qualified Data.Text as Text\nimport Data.Text (Text, intercalate, replace, split)\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared\nimport Text.Pandoc.URI\nimport Text.Pandoc.Writers.MediaWiki (highlightingLangs)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable)\nimport Text.DocLayout (render, literal)\n\nnewtype WriterState = WriterState {\n  listLevel :: Text -- String at the beginning of items\n}\n\ntype XWikiReader m = ReaderT WriterState m\n\n-- | Convert Pandoc to XWiki.\nwriteXWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteXWiki opts (Pandoc meta blocks) = do\n  let env = WriterState { listLevel = \"\" }\n  metadata <- metaToContext opts\n              (fmap (literal . trimr) . (\\bs -> runReaderT (blockListToXWiki bs) env))\n              (fmap (literal . trimr) . (\\is -> runReaderT (inlineListToXWiki is) env))\n              meta\n  body <- runReaderT (blockListToXWiki blocks) env\n  let context = defField \"body\" body\n                $ defField \"toc\" (writerTableOfContents opts) metadata\n  return $\n    case writerTemplate opts of\n       Just tpl -> render Nothing $ renderTemplate tpl context\n       Nothing  -> body\n\n-- | Concatenates strings with line breaks between them.\nvcat :: [Text] -> Text\nvcat = intercalate \"\\n\"\n\n-- If an id is provided, we can generate an anchor using the id macro\n-- https://extensions.xwiki.org/xwiki/bin/view/Extension/Id%20Macro\ngenAnchor :: Text -> Text\ngenAnchor id' = if Text.null id'\n  then \"\"\n  else \"{{id name=\\\"\" <> id' <> \"\\\" /}}\"\n\nblockListToXWiki :: PandocMonad m => [Block] -> XWikiReader m Text\nblockListToXWiki blocks =\n  vcat <$> mapM blockToXWiki blocks\n\nblockToXWiki :: PandocMonad m => Block -> XWikiReader m Text\n\nblockToXWiki (Div (id', _, _) blocks) = do\n  content <- blockListToXWiki blocks\n  return $ genAnchor id' <> content\n\nblockToXWiki (Plain inlines) =\n  inlineListToXWiki inlines\n\nblockToXWiki (Para inlines) = do\n  contents <- inlineListToXWiki inlines\n  return $ contents <> \"\\n\"\n\nblockToXWiki (LineBlock lns) =\n  blockToXWiki $ linesToPara lns\n\nblockToXWiki b@(RawBlock f str)\n  | f == Format \"xwiki\" = return str\n  | otherwise           = \"\" <$ report (BlockNotRendered b)\n\nblockToXWiki HorizontalRule = return \"\\n----\\n\"\n\nblockToXWiki (Header level (id', _, _) inlines) = do\n  contents <- inlineListToXWiki inlines\n  let eqs = Text.replicate level \"=\"\n  return $ eqs <> \" \" <> contents <> \" \" <> genAnchor id' <> eqs <> \"\\n\"\n\n-- XWiki doesn't appear to differentiate between inline and block-form code, so we delegate\n-- We do amend the text to ensure that the code markers are on their own lines, since this is a block\nblockToXWiki (CodeBlock attrs str) = do\n  contents <- inlineToXWiki (Code attrs (\"\\n\" <> str <> \"\\n\"))\n  return $ \"\\n\" <> contents <> \"\\n\"\n\nblockToXWiki (BlockQuote blocks) = do\n  blockText <- blockListToXWiki blocks\n  let quoteLines = split (== '\\n') blockText\n  let prefixed = map (\">\" <>) quoteLines\n  return $ vcat prefixed\n\nblockToXWiki (BulletList contents) = blockToXWikiList \"*\" contents\n\nblockToXWiki (OrderedList _ contents) = blockToXWikiList \"1\" contents\n\nblockToXWiki (DefinitionList items) = do\n  lev <- asks listLevel\n  contents <- local (\\s -> s { listLevel = listLevel s <> \";\" }) $ mapM definitionListItemToMediaWiki items\n  return $ vcat contents <> if Text.null lev then \"\\n\" else \"\"\n\n-- Create a group according to\n-- https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/?syntax=2.1&section=Groups\nblockToXWiki (Figure attr _ body) = do\n  content <- blockToXWiki $ Div attr body\n  return $ intercalate content [\"(((\\n\", \"\\n)))\"]\n\n-- TODO: support more features\nblockToXWiki (Table _ blkCapt specs thead tbody tfoot) = do\n  let (_, _, _, headers, rows') = toLegacyTable blkCapt specs thead tbody tfoot\n  headers' <- mapM (tableCellXWiki True) $ take (length specs) $ headers ++ repeat []\n  otherRows <- mapM formRow rows'\n  return $ Text.unlines (Text.unwords headers':otherRows)\n\nformRow :: PandocMonad m => [[Block]] -> XWikiReader m Text\nformRow row = do\n  cellStrings <- mapM (tableCellXWiki False) row\n  return $ Text.unwords cellStrings\n\n\ntableCellXWiki :: PandocMonad m => Bool -> [Block] -> XWikiReader m Text\ntableCellXWiki isHeader cell = do\n  contents <- blockListToXWiki cell\n  let isMultiline = (length . split (== '\\n')) contents > 1\n  let contents' = intercalate contents $ if isMultiline then [\"(((\", \")))\"] else [mempty, mempty]\n  let cellBorder = if isHeader then \"|=\" else \"|\"\n  return $ cellBorder <> contents'\n\n\ninlineListToXWiki :: PandocMonad m => [Inline] -> XWikiReader m Text\ninlineListToXWiki lst =\n  mconcat <$> mapM inlineToXWiki lst\n\ninlineToXWiki :: PandocMonad m => Inline -> XWikiReader m Text\n\ninlineToXWiki (Str str) = return $ escapeXWikiString str\n\ninlineToXWiki Space = return \" \"\n\n-- Special syntax for XWiki 2.0. This won't break table cells\ninlineToXWiki LineBreak = return \"\\\\\\\\\"\n\ninlineToXWiki SoftBreak = return \" \"\n\ninlineToXWiki (Emph lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"//\" <> contents <> \"//\"\n\ninlineToXWiki (Underline lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"__\" <> contents <> \"__\"\n\ninlineToXWiki (Strong lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"**\" <> contents <> \"**\"\n\ninlineToXWiki (Strikeout lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"--\" <> contents <> \"--\"\n\ninlineToXWiki (Superscript lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"^^\" <> contents <> \"^^\"\n\ninlineToXWiki (Subscript lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \",,\" <> contents <> \",,\"\n\n-- TODO: Not supported. Maybe escape to HTML?\ninlineToXWiki (SmallCaps lst) =\n  inlineListToXWiki lst\n\ninlineToXWiki (Quoted SingleQuote lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"‘\" <> contents <> \"’\"\n\ninlineToXWiki (Quoted DoubleQuote lst) = do\n  contents <- inlineListToXWiki lst\n  return $ \"“\" <> contents <> \"”\"\n\ninlineToXWiki (Code (_,classes,_) contents) = do\n  let at  = Set.fromList classes `Set.intersection` highlightingLangs\n  return $\n    case Set.toList at of\n      [] -> \"{{code}}\" <> contents <> \"{{/code}}\"\n      (l:_) -> \"{{code language=\\\"\" <> l <> \"\\\"}}\" <> contents <> \"{{/code}}\"\n\ninlineToXWiki (Cite _ lst) = inlineListToXWiki lst\n\n-- FIXME: optionally support this (plugin?)\ninlineToXWiki (Math _ str) = return $ \"{{formula}}\" <> str <> \"{{/formula}}\"\n\ninlineToXWiki il@(RawInline frmt str)\n  | frmt == Format \"xwiki\" = return str\n  | otherwise              = \"\" <$ report (InlineNotRendered il)\n\n-- TODO: Handle anchors\ninlineToXWiki (Link (id', _, _) txt (src, _)) = do\n  label <- inlineListToXWiki txt\n  case txt of\n     [Str s] | isURI src && escapeURI s == src -> return $ src <> genAnchor id'\n     _  -> return $ \"[[\" <> label <> \">>\" <> src <> \"]]\" <> genAnchor id'\n\ninlineToXWiki (Image _ alt (source, tit)) = do\n  alt' <- inlineListToXWiki alt\n  let\n    params = Text.unwords $ filter (not . Text.null) [\n        if Text.null alt' then \"\" else \"alt=\\\"\" <> alt' <> \"\\\"\",\n          if Text.null tit then \"\" else \"title=\\\"\" <> tit <> \"\\\"\"\n        ]\n  return $ \"[[image:\" <> source <> (if Text.null params then \"\" else \"||\" <> params) <> \"]]\"\n\ninlineToXWiki (Note contents) = do\n  contents' <- blockListToXWiki contents\n  return $ \"{{footnote}}\" <> Text.strip contents' <> \"{{/footnote}}\"\n\n-- TODO: support attrs other than id (anchor)\ninlineToXWiki (Span (id', _, _) contents) = do\n  contents' <- inlineListToXWiki contents\n  return $ genAnchor id' <> contents'\n\n-- Utility method since (for now) all lists are handled the same way\nblockToXWikiList :: PandocMonad m => Text -> [[Block]] -> XWikiReader m Text\nblockToXWikiList marker contents = do\n  lev <- asks listLevel\n  contents' <- local (\\s -> s { listLevel = listLevel s <> marker } ) $ mapM listItemToXWiki contents\n  return $ vcat contents' <> if Text.null lev then \"\\n\" else \"\"\n\n\nlistItemToXWiki :: PandocMonad m => [Block] -> XWikiReader m Text\nlistItemToXWiki contents = do\n  marker <- asks listLevel\n  contents' <- blockListToXWiki contents\n  return $ marker <> \". \" <> Text.strip contents'\n\n\n-- | Convert definition list item (label, list of blocks) to MediaWiki.\ndefinitionListItemToMediaWiki :: PandocMonad m\n                              => ([Inline],[[Block]])\n                              -> XWikiReader m Text\ndefinitionListItemToMediaWiki (label, items) = do\n  labelText <- inlineListToXWiki label\n  contents <- mapM blockListToXWiki items\n  marker <- asks listLevel\n  return $ marker <> \" \" <> labelText <> \"\\n\" <>\n    intercalate \"\\n\" (map (\\d -> Text.init marker <> \": \" <> d) contents)\n\n-- Escape the escape character, as well as formatting pairs\nescapeXWikiString :: Text -> Text\nescapeXWikiString s = foldr (uncurry replace) s $ zip [\"--\", \"**\", \"//\", \"^^\", \",,\", \"~\"] [\"~-~-\", \"~*~*\", \"~/~/\", \"~^~^\", \"~,~,\", \"~~\"]\n"
  },
  {
    "path": "src/Text/Pandoc/Writers/ZimWiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.Writers.ZimWiki\n   Copyright   : © 2008-2024 John MacFarlane,\n                   2017-2019 Alex Ivkin\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alex Ivkin <alex@ivkin.net>\n   Stability   : beta\n   Portability : portable\n\nConversion of 'Pandoc' documents to ZimWiki markup.\n\nhttp://zim-wiki.org/manual/Help/Wiki_Syntax.html\n-}\n\nmodule Text.Pandoc.Writers.ZimWiki ( writeZimWiki ) where\nimport Control.Monad (zipWithM)\nimport Control.Monad.State.Strict (StateT, evalStateT, gets, modify)\nimport Data.Default (Default (..))\nimport Data.List (transpose)\nimport Data.List.NonEmpty (nonEmpty)\nimport qualified Data.Map as Map\nimport Text.DocLayout (render, literal)\nimport Data.Maybe (fromMaybe)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Text.Pandoc.Class.PandocMonad (PandocMonad, report)\nimport Text.Pandoc.Definition\nimport Text.Pandoc.ImageSize\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options (WrapOption (..),\n           WriterOptions (writerTableOfContents, writerTemplate,\n                          writerWrapText))\nimport Text.Pandoc.Shared (figureDiv, linesToPara, removeFormatting, trimr)\nimport Text.Pandoc.URI (escapeURI, isURI)\nimport Text.Pandoc.Templates (renderTemplate)\nimport Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable)\n\ndata WriterState = WriterState {\n    stIndent  :: Text,           -- Indent after the marker at the beginning of list items\n    stInTable :: Bool,           -- Inside a table\n    stInLink  :: Bool            -- Inside a link description\n  }\n\ninstance Default WriterState where\n  def = WriterState { stIndent = \"\", stInTable = False, stInLink = False }\n\ntype ZW = StateT WriterState\n\n-- | Convert Pandoc to ZimWiki.\nwriteZimWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteZimWiki opts document = evalStateT (pandocToZimWiki opts document) def\n\n-- | Return ZimWiki representation of document.\npandocToZimWiki :: PandocMonad m => WriterOptions -> Pandoc -> ZW m Text\npandocToZimWiki opts (Pandoc meta blocks) = do\n  metadata <- metaToContext opts\n              (fmap (literal . trimr) . blockListToZimWiki opts)\n              (fmap (literal . trimr) . inlineListToZimWiki opts)\n              meta\n  main <- blockListToZimWiki opts blocks\n  --let header = \"Content-Type: text/x-zim-wiki\\nWiki-Format: zim 0.4\\n\"\n  let context = defField \"body\" main\n                $ defField \"toc\" (writerTableOfContents opts) metadata\n  return $\n    case writerTemplate opts of\n       Just tpl -> render Nothing $ renderTemplate tpl context\n       Nothing  -> main\n\n-- | Escape special characters for ZimWiki.\nescapeText :: Text -> Text\nescapeText = T.replace \"__\" \"''__''\" .\n               T.replace \"**\" \"''**''\" .\n               T.replace \"~~\" \"''~~''\" .\n               T.replace \"//\" \"''//''\"\n\n-- | Convert Pandoc block element to ZimWiki.\nblockToZimWiki :: PandocMonad m => WriterOptions -> Block -> ZW m Text\n\nblockToZimWiki opts (Div _attrs bs) = do\n  contents <- blockListToZimWiki opts bs\n  return $ contents <> \"\\n\"\n\nblockToZimWiki opts (Plain inlines) = inlineListToZimWiki opts inlines\n\nblockToZimWiki opts (Para inlines) = do\n  indent <- gets stIndent\n  -- useTags <- gets stUseTags\n  contents <- inlineListToZimWiki opts inlines\n  return $ contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToZimWiki opts (LineBlock lns) =\n  blockToZimWiki opts $ linesToPara lns\n\nblockToZimWiki opts b@(RawBlock f str)\n  | f == Format \"zimwiki\"  = return str\n  | f == Format \"html\"     = indentFromHTML opts str\n  | otherwise              = do\n      report $ BlockNotRendered b\n      return \"\"\n\nblockToZimWiki _ HorizontalRule = return \"\\n----\\n\"\n\nblockToZimWiki opts (Header level _ inlines) = do\n  contents <- inlineListToZimWiki opts inlines\n  let eqs = T.replicate ( 7 - level ) \"=\"\n  return $ eqs <> \" \" <> contents <> \" \" <> eqs <> \"\\n\"\n\nblockToZimWiki _ (CodeBlock (_,classes,_) str) = do\n  -- Remap languages into the gtksourceview2 convention that ZimWiki source code plugin is using\n  let langal = [(\"javascript\", \"js\"), (\"bash\", \"sh\"), (\"winbatch\", \"dosbatch\")]\n  let langmap = Map.fromList langal\n  return $ case classes of\n                []      -> \"'''\\n\" <> cleanupCode str <> \"\\n'''\\n\"   -- turn no lang block into a quote block\n                (x:_)   -> \"{{{code: lang=\\\"\" <>\n                        fromMaybe x (Map.lookup x langmap) <> \"\\\" linenumbers=\\\"True\\\"\\n\" <> str <> \"\\n}}}\\n\"  -- for zim's code plugin, go verbatim on the lang spec\n\nblockToZimWiki opts (BlockQuote blocks) = do\n  contents <- blockListToZimWiki opts blocks\n  return $ T.unlines $ map (\"> \" <>) $ T.lines contents\n\nblockToZimWiki opts (Table _ blkCapt specs thead tbody tfoot) = do\n  let (capt, aligns, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot\n  captionDoc <- if null capt\n                   then return \"\"\n                   else do\n                      c <- inlineListToZimWiki opts capt\n                      return $ \"\" <> c <> \"\\n\"\n  headers' <- if all null headers\n                 then case rows of\n                        [] -> pure mempty\n                        (r:_) -> zipWithM (tableItemToZimWiki opts) aligns r\n                 else mapM (inlineListToZimWiki opts . removeFormatting)headers  -- emphasis, links etc. are not allowed in table headers\n  rows' <- mapM (zipWithM (tableItemToZimWiki opts) aligns) rows\n  let widths = map (maybe 0 maximum . nonEmpty . map T.length) $\n                  transpose (headers':rows')\n  let padTo (width, al) s =\n          case width - T.length s of\n               x | x > 0 ->\n                 if al == AlignLeft || al == AlignDefault\n                    then s <> T.replicate x \" \"\n                    else if al == AlignRight\n                            then T.replicate x \" \" <> s\n                            else T.replicate (x `div` 2) \" \" <>\n                                 s <> T.replicate (x - x `div` 2) \" \"\n                 | otherwise -> s\n  let borderCell (width, al) _\n        | al == AlignLeft = \":\"<> T.replicate (width-1) \"-\"\n        | al == AlignDefault = T.replicate width \"-\"\n        | al == AlignRight = T.replicate (width-1) \"-\" <> \":\"\n        | otherwise = \":\" <> T.replicate (width-2) \"-\" <> \":\"\n  let underheader  = \"|\" <> T.intercalate \"|\" (zipWith borderCell (zip widths aligns) headers') <> \"|\"\n  let renderRow cells = \"|\" <> T.intercalate \"|\" (zipWith padTo (zip widths aligns) cells) <> \"|\"\n  return $ captionDoc <>\n           (if null headers' then \"\" else renderRow headers' <> \"\\n\") <> underheader <> \"\\n\" <>\n           T.unlines (map renderRow rows')\n\nblockToZimWiki opts (BulletList items) = do\n  contents <- mapM (listItemToZimWiki opts) items\n  indent <- gets stIndent\n  return $ vcat contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToZimWiki opts (OrderedList _ items) = do\n  contents <- zipWithM (orderedListItemToZimWiki opts) [1..] items\n  indent <- gets stIndent\n  return $ vcat contents <> if T.null indent then \"\\n\" else \"\"\n\nblockToZimWiki opts (DefinitionList items) = do\n  contents <- mapM (definitionListItemToZimWiki opts) items\n  return $ vcat contents\n\nblockToZimWiki opts (Figure attr capt body) = do\n  blockToZimWiki opts (figureDiv attr capt body)\n\ndefinitionListItemToZimWiki :: PandocMonad m\n                            => WriterOptions\n                            -> ([Inline],[[Block]])\n                            -> ZW m Text\ndefinitionListItemToZimWiki opts (label, items) = do\n  labelText <- inlineListToZimWiki opts label\n  contents <- mapM (blockListToZimWiki opts) items\n  indent <- gets stIndent\n  return $ indent <> \"* **\" <> labelText <> \"** \" <> T.concat contents\n\n-- Auxiliary functions for lists:\nindentFromHTML :: PandocMonad m => WriterOptions -> Text -> ZW m Text\nindentFromHTML _ str = do\n   indent <- gets stIndent\n   if \"<li>\" `T.isInfixOf` str\n      then return indent\n      else if \"</li>\" `T.isInfixOf` str\n        then return \"\\n\"\n        else if \"<li value=\" `T.isInfixOf` str\n          then return \"\"\n          else if \"<ol>\" `T.isInfixOf` str\n            then do\n              let olcount=countSubStrs \"<ol>\" str\n              modify $ \\s -> s { stIndent = stIndent s <>\n                                 T.replicate olcount \"\\t\" }\n              return \"\"\n            else if \"</ol>\" `T.isInfixOf` str\n              then do\n                let olcount=countSubStrs \"/<ol>\" str\n                modify $ \\s -> s{ stIndent = T.drop olcount (stIndent s) }\n                return \"\"\n              else return \"\"\n\ncountSubStrs :: Text -> Text -> Int\ncountSubStrs sub str = length $ T.breakOnAll sub str\n\ncleanupCode :: Text -> Text\ncleanupCode = T.replace \"<nowiki>\" \"\" . T.replace \"</nowiki>\" \"\"\n\nvcat :: [Text] -> Text\nvcat = T.intercalate \"\\n\"\n\n-- | Convert bullet list item (list of blocks) to ZimWiki.\nlistItemToZimWiki :: PandocMonad m => WriterOptions -> [Block] -> ZW m Text\nlistItemToZimWiki opts items = do\n  indent <- gets stIndent\n  modify $ \\s -> s { stIndent = indent <> \"\\t\" }\n  contents <- blockListToZimWiki opts items\n  modify $ \\s -> s{ stIndent = indent }\n  return $ indent <> \"* \" <> contents\n\n-- | Convert ordered list item (list of blocks) to ZimWiki.\norderedListItemToZimWiki :: PandocMonad m\n                         => WriterOptions -> Int -> [Block] -> ZW m Text\norderedListItemToZimWiki opts itemnum items = do\n  indent <- gets stIndent\n  modify $ \\s -> s { stIndent = indent <> \"\\t\" }\n  contents <- blockListToZimWiki opts items\n  modify $ \\s -> s{ stIndent = indent }\n  return $ indent <> T.pack (show itemnum) <> \". \" <> contents\n\n-- Auxiliary functions for tables:\ntableItemToZimWiki :: PandocMonad m\n                   => WriterOptions -> Alignment -> [Block] -> ZW m Text\ntableItemToZimWiki opts align' item = do\n  let mkcell x = (if align' == AlignRight || align' == AlignCenter\n                     then \"  \"\n                     else \"\") <> x <>\n                 (if align' == AlignLeft || align' == AlignCenter\n                     then \"  \"\n                     else \"\")\n  modify $ \\s -> s { stInTable = True }\n  contents <- blockListToZimWiki opts item\n  modify $ \\s -> s { stInTable = False }\n  return $ mkcell contents\n\n-- | Convert list of Pandoc block elements to ZimWiki.\nblockListToZimWiki :: PandocMonad m\n                   => WriterOptions -> [Block] -> ZW m Text\nblockListToZimWiki opts blocks = vcat <$> mapM (blockToZimWiki opts) blocks\n\n-- | Convert list of Pandoc inline elements to ZimWiki.\ninlineListToZimWiki :: PandocMonad m\n                    => WriterOptions -> [Inline] -> ZW m Text\ninlineListToZimWiki opts lst = T.concat <$> mapM (inlineToZimWiki opts) lst\n\n-- | Convert Pandoc inline element to ZimWiki.\ninlineToZimWiki :: PandocMonad m\n                => WriterOptions -> Inline -> ZW m Text\n\ninlineToZimWiki opts (Emph lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"//\" <> contents <> \"//\"\n\ninlineToZimWiki opts (Underline lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"__\" <> contents <> \"__\"\n\ninlineToZimWiki opts (Strong lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"**\" <> contents <> \"**\"\n\ninlineToZimWiki opts (Strikeout lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"~~\" <> contents <> \"~~\"\n\ninlineToZimWiki opts (Superscript lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"^{\" <> contents <> \"}\"\n\ninlineToZimWiki opts (Subscript lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"_{\" <> contents <> \"}\"\n\ninlineToZimWiki opts (Quoted SingleQuote lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"\\8216\" <> contents <> \"\\8217\"\n\ninlineToZimWiki opts (Quoted DoubleQuote lst) = do\n  contents <- inlineListToZimWiki opts lst\n  return $ \"\\8220\" <> contents <> \"\\8221\"\n\ninlineToZimWiki opts (Span _attrs ils) = inlineListToZimWiki opts ils\n\ninlineToZimWiki opts (SmallCaps lst) = inlineListToZimWiki opts lst\n\ninlineToZimWiki opts (Cite _  lst) = inlineListToZimWiki opts lst\n\ninlineToZimWiki _ (Code _ str) = return $ \"''\" <> str <> \"''\"\n\ninlineToZimWiki _ (Str str) = do\n  inTable <- gets stInTable\n  inLink  <- gets stInLink\n  if inTable\n      then return $ T.replace \"|\" \"\\\\|\" . escapeText $ str\n      else\n          if inLink\n          then return str\n          else return $ escapeText str\n\ninlineToZimWiki _ (Math mathType str) = return $ delim <> str <> delim   -- note:  str should NOT be escaped\n  where delim = case mathType of\n                     DisplayMath -> \"$$\"\n                     InlineMath  -> \"$\"\n\n-- f == Format \"html\"     = return $ \"<html>\" <> str <> \"</html>\"\ninlineToZimWiki opts il@(RawInline f str)\n  | f == Format \"zimwiki\" = return str\n  | f == Format \"html\"    = indentFromHTML opts str\n  | otherwise             = do\n      report $ InlineNotRendered il\n      return \"\"\n\ninlineToZimWiki _ LineBreak = do\n  inTable <- gets stInTable\n  if inTable\n      then return \"\\\\n\"\n      else return \"\\n\"\n\ninlineToZimWiki opts SoftBreak =\n  case writerWrapText opts of\n       WrapNone     -> return \" \"\n       WrapAuto     -> return \" \"\n       WrapPreserve -> return \"\\n\"\n\ninlineToZimWiki _ Space = return \" \"\n\ninlineToZimWiki opts (Link _ txt (src, _)) = do\n  inTable <- gets stInTable\n  modify $ \\s -> s { stInLink = True }\n  label <- inlineListToZimWiki opts $ removeFormatting txt -- zim does not allow formatting in link text, it takes the text verbatim, no need to escape it\n  modify $ \\s -> s { stInLink = False }\n  let label'= if inTable\n            then \"\" -- no label is allowed in a table\n            else \"|\"<>label\n  case txt of\n     [Str s] | \"mailto:\" `T.isPrefixOf` src -> return $ \"<\" <> s <> \">\"\n             | escapeURI s == src -> return src\n     _  -> if isURI src\n              then return $ \"[[\" <> src  <> label' <> \"]]\"\n              else return $ \"[[\" <> src' <> label' <> \"]]\"\n  where\n    -- with leading / it's a link to a help page\n    src' = fromMaybe src $ T.stripPrefix \"/\" src\n\ninlineToZimWiki opts (Image attr alt (source, tit)) = do\n  alt' <- inlineListToZimWiki opts alt\n  inTable <- gets stInTable\n  let txt = case (tit, alt, inTable) of\n              (\"\",[], _)      -> \"\"\n              (\"\", _, False ) -> \"|\" <> alt'\n              (_ , _, False ) -> \"|\" <> tit\n              (_ , _, True )  -> \"\"\n  return $ \"{{\" <> source <> imageDims opts attr <> txt <> \"}}\"\n\ninlineToZimWiki opts (Note contents) = do\n  -- no concept of notes in zim wiki, use a text block\n  contents' <- blockListToZimWiki opts contents\n  return $ \" **{Note:** \" <> trimr contents' <> \"**}**\"\n\nimageDims :: WriterOptions -> Attr -> Text\nimageDims opts attr = go (toPx $ dimension Width attr) (toPx $ dimension Height attr)\n  where\n    toPx = fmap (showInPixel opts) . checkPct\n    checkPct (Just (Percent _)) = Nothing\n    checkPct maybeDim           = maybeDim\n    go (Just w) Nothing  = \"?\" <> w\n    go (Just w) (Just h) = \"?\" <> w <> \"x\" <> h\n    go Nothing  (Just h) = \"?0x\" <> h\n    go Nothing  Nothing  = \"\"\n"
  },
  {
    "path": "src/Text/Pandoc/Writers.hs",
    "content": "{-# LANGUAGE FlexibleInstances   #-}\n{-# LANGUAGE GADTs               #-}\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections       #-}\n{- |\n   Module      : Text.Pandoc\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nThis helper module exports all writers functions.\n-}\nmodule Text.Pandoc.Writers\n  (\n    -- * Writers: converting /from/ Pandoc format\n      Writer(..)\n    , writers\n    , writeANSI\n    , writeAsciiDoc\n    , writeAsciiDocLegacy\n    , writeAsciiDoctor\n    , writeBeamer\n    , writeBibTeX\n    , writeBibLaTeX\n    , writeChunkedHTML\n    , writeCommonMark\n    , writeConTeXt\n    , writeCslJson\n    , writeDZSlides\n    , writeDjot\n    , writeDocBook4\n    , writeDocBook5\n    , writeDocx\n    , writeDokuWiki\n    , writeEPUB2\n    , writeEPUB3\n    , writeFB2\n    , writeIpynb\n    , writeHaddock\n    , writeHtml4\n    , writeHtml4String\n    , writeHtml5\n    , writeHtml5String\n    , writeICML\n    , writeJATS\n    , writeJatsArchiving\n    , writeJatsArticleAuthoring\n    , writeJatsPublishing\n    , writeJSON\n    , writeJira\n    , writeLaTeX\n    , writeMan\n    , writeMarkdown\n    , writeMarkua\n    , writeMediaWiki\n    , writeMs\n    , writeMuse\n    , writeNative\n    , writeODT\n    , writeOPML\n    , writeOpenDocument\n    , writeOrg\n    , writePlain\n    , writePowerpoint\n    , writeRST\n    , writeRTF\n    , writeRevealJs\n    , writeS5\n    , writeSlideous\n    , writeSlidy\n    , writeTEI\n    , writeTexinfo\n    , writeTextile\n    , writeTypst\n    , writeXML\n    , writeXWiki\n    , writeZimWiki\n    , writeVimdoc\n    , writeBBCode\n    , writeBBCodeSteam\n    , writeBBCodeFluxBB\n    , writeBBCodePhpBB\n    , writeBBCodeHubzilla\n    , writeBBCodeXenforo\n    , getWriter\n    ) where\n\nimport Control.Monad.Except (throwError)\nimport Data.Aeson\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Text (Text)\nimport Text.Pandoc.Class\nimport Text.Pandoc.Definition\nimport qualified Text.Pandoc.Format as Format\nimport Text.Pandoc.Options\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Text.Pandoc.Error\nimport Text.Pandoc.Writers.ANSI\nimport Text.Pandoc.Writers.AsciiDoc\nimport Text.Pandoc.Writers.BibTeX\nimport Text.Pandoc.Writers.ChunkedHTML\nimport Text.Pandoc.Writers.CommonMark\nimport Text.Pandoc.Writers.ConTeXt\nimport Text.Pandoc.Writers.CslJson\nimport Text.Pandoc.Writers.Djot\nimport Text.Pandoc.Writers.DocBook\nimport Text.Pandoc.Writers.Docx\nimport Text.Pandoc.Writers.DokuWiki\nimport Text.Pandoc.Writers.EPUB\nimport Text.Pandoc.Writers.FB2\nimport Text.Pandoc.Writers.Ipynb\nimport Text.Pandoc.Writers.Haddock\nimport Text.Pandoc.Writers.HTML\nimport Text.Pandoc.Writers.ICML\nimport Text.Pandoc.Writers.JATS\nimport Text.Pandoc.Writers.Jira\nimport Text.Pandoc.Writers.LaTeX\nimport Text.Pandoc.Writers.Man\nimport Text.Pandoc.Writers.Markdown\nimport Text.Pandoc.Writers.MediaWiki\nimport Text.Pandoc.Writers.Ms\nimport Text.Pandoc.Writers.Muse\nimport Text.Pandoc.Writers.Native\nimport Text.Pandoc.Writers.ODT\nimport Text.Pandoc.Writers.OpenDocument\nimport Text.Pandoc.Writers.OPML\nimport Text.Pandoc.Writers.Org\nimport Text.Pandoc.Writers.Powerpoint\nimport Text.Pandoc.Writers.RST\nimport Text.Pandoc.Writers.RTF\nimport Text.Pandoc.Writers.TEI\nimport Text.Pandoc.Writers.Texinfo\nimport Text.Pandoc.Writers.Textile\nimport Text.Pandoc.Writers.Typst\nimport Text.Pandoc.Writers.XML\nimport Text.Pandoc.Writers.XWiki\nimport Text.Pandoc.Writers.ZimWiki\nimport Text.Pandoc.Writers.Vimdoc\nimport Text.Pandoc.Writers.BBCode (\n  writeBBCode,\n  writeBBCodeFluxBB,\n  writeBBCodeHubzilla,\n  writeBBCodePhpBB,\n  writeBBCodeSteam,\n  writeBBCodeXenforo,\n )\n\ndata Writer m = TextWriter (WriterOptions -> Pandoc -> m Text)\n              | ByteStringWriter (WriterOptions -> Pandoc -> m BL.ByteString)\n\n-- | Association list of formats and writers.\nwriters :: PandocMonad m => [ (Text, Writer m) ]\nwriters = [\n   (\"native\"       , TextWriter writeNative)\n  ,(\"json\"         , TextWriter writeJSON)\n  ,(\"docx\"         , ByteStringWriter writeDocx)\n  ,(\"odt\"          , ByteStringWriter writeODT)\n  ,(\"pptx\"         , ByteStringWriter writePowerpoint)\n  ,(\"epub\"         , ByteStringWriter writeEPUB3)\n  ,(\"epub2\"        , ByteStringWriter writeEPUB2)\n  ,(\"epub3\"        , ByteStringWriter writeEPUB3)\n  ,(\"fb2\"          , TextWriter writeFB2)\n  ,(\"ipynb\"        , TextWriter writeIpynb)\n  ,(\"html\"         , TextWriter writeHtml5String)\n  ,(\"html4\"        , TextWriter writeHtml4String)\n  ,(\"html5\"        , TextWriter writeHtml5String)\n  ,(\"icml\"         , TextWriter writeICML)\n  ,(\"s5\"           , TextWriter writeS5)\n  ,(\"slidy\"        , TextWriter writeSlidy)\n  ,(\"slideous\"     , TextWriter writeSlideous)\n  ,(\"dzslides\"     , TextWriter writeDZSlides)\n  ,(\"revealjs\"     , TextWriter writeRevealJs)\n  ,(\"docbook\"      , TextWriter writeDocBook5)\n  ,(\"docbook4\"     , TextWriter writeDocBook4)\n  ,(\"docbook5\"     , TextWriter writeDocBook5)\n  ,(\"jats\"         , TextWriter writeJatsArchiving)\n  ,(\"jats_articleauthoring\", TextWriter writeJatsArticleAuthoring)\n  ,(\"jats_publishing\" , TextWriter writeJatsPublishing)\n  ,(\"jats_archiving\" , TextWriter writeJatsArchiving)\n  ,(\"jira\"         , TextWriter writeJira)\n  ,(\"opml\"         , TextWriter writeOPML)\n  ,(\"opendocument\" , TextWriter writeOpenDocument)\n  ,(\"latex\"        , TextWriter writeLaTeX)\n  ,(\"beamer\"       , TextWriter writeBeamer)\n  ,(\"context\"      , TextWriter writeConTeXt)\n  ,(\"texinfo\"      , TextWriter writeTexinfo)\n  ,(\"man\"          , TextWriter writeMan)\n  ,(\"ms\"           , TextWriter writeMs)\n  ,(\"markdown\"     , TextWriter writeMarkdown)\n  ,(\"markdown_strict\" , TextWriter writeMarkdown)\n  ,(\"markdown_phpextra\" , TextWriter writeMarkdown)\n  ,(\"markdown_github\" , TextWriter writeMarkdown)\n  ,(\"markdown_mmd\" , TextWriter writeMarkdown)\n  ,(\"plain\"        , TextWriter writePlain)\n  ,(\"rst\"          , TextWriter writeRST)\n  ,(\"mediawiki\"    , TextWriter writeMediaWiki)\n  ,(\"dokuwiki\"     , TextWriter writeDokuWiki)\n  ,(\"xwiki\"        , TextWriter writeXWiki)\n  ,(\"zimwiki\"      , TextWriter writeZimWiki)\n  ,(\"textile\"      , TextWriter writeTextile)\n  ,(\"typst\"        , TextWriter writeTypst)\n  ,(\"rtf\"          , TextWriter writeRTF)\n  ,(\"org\"          , TextWriter writeOrg)\n  ,(\"asciidoc\"     , TextWriter writeAsciiDoc)\n  ,(\"asciidoctor\"  , TextWriter writeAsciiDoc)\n  ,(\"asciidoc_legacy\" , TextWriter writeAsciiDocLegacy)\n  ,(\"haddock\"      , TextWriter writeHaddock)\n  ,(\"commonmark\"   , TextWriter writeCommonMark)\n  ,(\"commonmark_x\" , TextWriter writeCommonMark)\n  ,(\"gfm\"          , TextWriter writeCommonMark)\n  ,(\"tei\"          , TextWriter writeTEI)\n  ,(\"muse\"         , TextWriter writeMuse)\n  ,(\"csljson\"      , TextWriter writeCslJson)\n  ,(\"bibtex\"       , TextWriter writeBibTeX)\n  ,(\"biblatex\"     , TextWriter writeBibLaTeX)\n  ,(\"markua\"       , TextWriter writeMarkua)\n  ,(\"chunkedhtml\"  , ByteStringWriter writeChunkedHTML)\n  ,(\"djot\"         , TextWriter writeDjot)\n  ,(\"ansi\"         , TextWriter writeANSI)\n  ,(\"xml\"          , TextWriter writeXML)\n  ,(\"vimdoc\"       , TextWriter writeVimdoc)\n  ,(\"bbcode\"       , TextWriter writeBBCode)\n  ,(\"bbcode_steam\" , TextWriter writeBBCodeSteam)\n  ,(\"bbcode_phpbb\" , TextWriter writeBBCodePhpBB)\n  ,(\"bbcode_fluxbb\", TextWriter writeBBCodeFluxBB)\n  ,(\"bbcode_hubzilla\" , TextWriter writeBBCodeHubzilla)\n  ,(\"bbcode_xenforo\" , TextWriter writeBBCodeXenforo)\n  ]\n\n-- | Retrieve writer, extensions based on formatSpec (format+extensions).\ngetWriter :: PandocMonad m => Format.FlavoredFormat -> m (Writer m, Extensions)\ngetWriter flvrd = do\n  let writerName = Format.formatName flvrd\n  case lookup writerName writers of\n    Nothing  -> throwError $ PandocUnknownWriterError writerName\n    Just  w  -> (w,) <$>\n      Format.applyExtensionsDiff (Format.getExtensionsConfig writerName) flvrd\n\nwriteJSON :: PandocMonad m => WriterOptions -> Pandoc -> m Text\nwriteJSON _ = return . UTF8.toText . BL.toStrict . encode\n"
  },
  {
    "path": "src/Text/Pandoc/XML.hs",
    "content": "{-# LANGUAGE LambdaCase        #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.XML\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nFunctions for escaping and formatting XML.\n-}\nmodule Text.Pandoc.XML ( escapeCharForXML,\n                         escapeStringForXML,\n                         escapeNCName,\n                         inTags,\n                         selfClosingTag,\n                         inTagsSimple,\n                         inTagsIndented,\n                         toEntities,\n                         toHtml5Entities,\n                         fromEntities,\n                         lookupEntity,\n                         html4Attributes,\n                         html5Attributes,\n                         rdfaAttributes ) where\n\nimport Data.Char (isAscii, isSpace, ord, isLetter, isDigit)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Commonmark.Entity (lookupEntity)\nimport Text.HTML.TagSoup.Entity (htmlEntities)\nimport Text.DocLayout\n    ( ($$), char, hcat, nest, text, Doc, HasChars )\nimport Text.Printf (printf)\nimport qualified Data.Map as M\nimport Data.String ( IsString )\nimport qualified Data.Set as Set\n\n-- | Escape one character as needed for XML.\nescapeCharForXML :: Char -> Text\nescapeCharForXML x = case x of\n                       '&' -> \"&amp;\"\n                       '<' -> \"&lt;\"\n                       '>' -> \"&gt;\"\n                       '\"' -> \"&quot;\"\n                       c   -> T.singleton c\n\n-- | Escape string as needed for XML.  Entity references are not preserved.\nescapeStringForXML :: Text -> Text\nescapeStringForXML = T.concatMap escapeCharForXML . T.filter isLegalXMLChar\n  where isLegalXMLChar c = c == '\\t' || c == '\\n' || c == '\\r' ||\n                           (c >= '\\x20' && c <= '\\xD7FF') ||\n                           (c >= '\\xE000' && c <= '\\xFFFD') ||\n                           (c >= '\\x10000' && c <= '\\x10FFFF')\n  -- see https://www.w3.org/TR/xml/#charsets\n\n-- | Escape newline characters as &#10;\nescapeNls :: Text -> Text\nescapeNls = T.concatMap $ \\case\n  '\\n' -> \"&#10;\"\n  c    -> T.singleton c\n\n-- | Return a text object with a string of formatted XML attributes.\nattributeList :: (HasChars a, IsString a) => [(Text, Text)] -> Doc a\nattributeList = hcat . map\n  (\\(a, b) -> text (T.unpack $ \" \" <> escapeStringForXML a <> \"=\\\"\" <>\n  escapeNls (escapeStringForXML b) <> \"\\\"\"))\n\n-- | Put the supplied contents between start and end tags of tagType,\n--   with specified attributes and (if specified) indentation.\ninTags :: (HasChars a, IsString a)\n      => Bool -> Text -> [(Text, Text)] -> Doc a -> Doc a\ninTags isIndented tagType attribs contents =\n  let openTag = char '<' <> text (T.unpack tagType) <> attributeList attribs <>\n                char '>'\n      closeTag  = text \"</\" <> text (T.unpack tagType) <> char '>'\n  in  if isIndented\n         then openTag $$ nest 2 contents $$ closeTag\n         else openTag <> contents <> closeTag\n\n-- | Return a self-closing tag of tagType with specified attributes\nselfClosingTag :: (HasChars a, IsString a)\n               => Text -> [(Text, Text)] -> Doc a\nselfClosingTag tagType attribs =\n  char '<' <> text (T.unpack tagType) <> attributeList attribs <> text \" />\"\n\n-- | Put the supplied contents between start and end tags of tagType.\ninTagsSimple :: (HasChars a, IsString a)\n             => Text -> Doc a -> Doc a\ninTagsSimple tagType = inTags False tagType []\n\n-- | Put the supplied contents in indented block btw start and end tags.\ninTagsIndented :: (HasChars a, IsString a)\n               => Text -> Doc a -> Doc a\ninTagsIndented tagType = inTags True tagType []\n\n-- | Escape all non-ascii characters using numerical entities.\ntoEntities :: Text -> Text\ntoEntities = T.concatMap go\n  where go c | isAscii c = T.singleton c\n             | otherwise = T.pack (printf \"&#x%X;\" (ord c))\n\n-- | Escape all non-ascii characters using HTML5 entities, falling\n-- back to numerical entities.\ntoHtml5Entities :: Text -> Text\ntoHtml5Entities = T.concatMap go\n  where go c | isAscii c = T.singleton c\n             | otherwise =\n                 case M.lookup c html5EntityMap of\n                   Just t  -> T.singleton '&' <> t <> T.singleton ';'\n                   Nothing -> T.pack (\"&#\" ++ show (ord c) ++ \";\")\n\nhtml5EntityMap :: M.Map Char Text\nhtml5EntityMap = foldr go mempty htmlEntities\n  where go (ent, s) entmap =\n         case s of\n           [c] -> M.insertWith\n                   (\\new old -> if T.length new > T.length old\n                                   then old\n                                   else new) c ent' entmap\n                  where ent' = T.takeWhile (/=';') (T.pack ent)\n           _ -> entmap\n\n-- | Converts a string into an NCName, i.e., an XML name without colons.\n-- Disallowed characters are escaped using @ux%x@, where @%x@ is the\n-- hexadecimal unicode identifier of the escaped character.\nescapeNCName :: Text -> Text\nescapeNCName t = case T.uncons t of\n  Nothing -> T.empty\n  Just (c, cs) -> escapeStartChar c <> T.concatMap escapeNCNameChar cs\n  where\n    escapeStartChar :: Char -> Text\n    escapeStartChar c = if isLetter c || c == '_'\n                        then T.singleton c\n                        else escapeChar c\n\n    escapeNCNameChar :: Char -> Text\n    escapeNCNameChar c = if isNCNameChar c\n                         then T.singleton c\n                         else escapeChar c\n\n    isNCNameChar :: Char -> Bool\n    isNCNameChar c = isLetter c || c `elem` (\"_-.·\" :: String) || isDigit c\n      || '\\x0300' <= c && c <= '\\x036f'\n      || '\\x203f' <= c && c <= '\\x2040'\n\n    escapeChar :: Char -> Text\n    escapeChar = T.pack . printf \"U%04X\" . ord\n\n-- | Unescapes XML entities\nfromEntities :: Text -> Text\nfromEntities t\n  = let (x, y) = T.break (== '&') t\n     in if T.null y\n           then t\n           else x <>\n             let (ent, rest) = T.break (\\c -> isSpace c || c == ';') y\n                 rest' = case T.uncons rest of\n                            Just (';',ys) -> ys\n                            _ -> rest\n                 ent' = T.drop 1 ent <> \";\"\n              in case lookupEntity ent' of\n                   Just c  -> c <> fromEntities rest'\n                   Nothing  -> ent <> fromEntities rest\n\n\nhtml5Attributes :: Set.Set Text\nhtml5Attributes = Set.fromList\n  [ \"abbr\"\n  , \"accept\"\n  , \"accept-charset\"\n  , \"accesskey\"\n  , \"action\"\n  , \"allow\"\n  , \"allowfullscreen\"\n  , \"allowpaymentrequest\"\n  , \"allowusermedia\"\n  , \"alt\"\n  , \"as\"\n  , \"async\"\n  , \"autocapitalize\"\n  , \"autocomplete\"\n  , \"autofocus\"\n  , \"autoplay\"\n  , \"charset\"\n  , \"checked\"\n  , \"cite\"\n  , \"class\"\n  , \"color\"\n  , \"cols\"\n  , \"colspan\"\n  , \"content\"\n  , \"contenteditable\"\n  , \"controls\"\n  , \"coords\"\n  , \"crossorigin\"\n  , \"data\"\n  , \"datetime\"\n  , \"decoding\"\n  , \"default\"\n  , \"defer\"\n  , \"dir\"\n  , \"dirname\"\n  , \"disabled\"\n  , \"download\"\n  , \"draggable\"\n  , \"enctype\"\n  , \"enterkeyhint\"\n  , \"fetchpriority\"\n  , \"for\"\n  , \"form\"\n  , \"formaction\"\n  , \"formenctype\"\n  , \"formmethod\"\n  , \"formnovalidate\"\n  , \"formtarget\"\n  , \"headers\"\n  , \"height\"\n  , \"hidden\"\n  , \"high\"\n  , \"href\"\n  , \"hreflang\"\n  , \"http-equiv\"\n  , \"id\"\n  , \"imagesizes\"\n  , \"imagesrcset\"\n  , \"inputmode\"\n  , \"integrity\"\n  , \"is\"\n  , \"ismap\"\n  , \"itemid\"\n  , \"itemprop\"\n  , \"itemref\"\n  , \"itemscope\"\n  , \"itemtype\"\n  , \"kind\"\n  , \"label\"\n  , \"lang\"\n  , \"list\"\n  , \"loading\"\n  , \"loop\"\n  , \"low\"\n  , \"manifest\"\n  , \"max\"\n  , \"maxlength\"\n  , \"media\"\n  , \"method\"\n  , \"min\"\n  , \"minlength\"\n  , \"multiple\"\n  , \"muted\"\n  , \"name\"\n  , \"nomodule\"\n  , \"nonce\"\n  , \"novalidate\"\n  , \"onabort\"\n  , \"onafterprint\"\n  , \"onauxclick\"\n  , \"onbeforeprint\"\n  , \"onbeforeunload\"\n  , \"onblur\"\n  , \"oncancel\"\n  , \"oncanplay\"\n  , \"oncanplaythrough\"\n  , \"onchange\"\n  , \"onclick\"\n  , \"onclose\"\n  , \"oncontextmenu\"\n  , \"oncopy\"\n  , \"oncuechange\"\n  , \"oncut\"\n  , \"ondblclick\"\n  , \"ondrag\"\n  , \"ondragend\"\n  , \"ondragenter\"\n  , \"ondragexit\"\n  , \"ondragleave\"\n  , \"ondragover\"\n  , \"ondragstart\"\n  , \"ondrop\"\n  , \"ondurationchange\"\n  , \"onemptied\"\n  , \"onended\"\n  , \"onerror\"\n  , \"onfocus\"\n  , \"onhashchange\"\n  , \"oninput\"\n  , \"oninvalid\"\n  , \"onkeydown\"\n  , \"onkeypress\"\n  , \"onkeyup\"\n  , \"onlanguagechange\"\n  , \"onload\"\n  , \"onloadeddata\"\n  , \"onloadedmetadata\"\n  , \"onloadend\"\n  , \"onloadstart\"\n  , \"onmessage\"\n  , \"onmessageerror\"\n  , \"onmousedown\"\n  , \"onmouseenter\"\n  , \"onmouseleave\"\n  , \"onmousemove\"\n  , \"onmouseout\"\n  , \"onmouseover\"\n  , \"onmouseup\"\n  , \"onoffline\"\n  , \"ononline\"\n  , \"onpagehide\"\n  , \"onpageshow\"\n  , \"onpaste\"\n  , \"onpause\"\n  , \"onplay\"\n  , \"onplaying\"\n  , \"onpopstate\"\n  , \"onprogress\"\n  , \"onratechange\"\n  , \"onrejectionhandled\"\n  , \"onreset\"\n  , \"onresize\"\n  , \"onscroll\"\n  , \"onsecuritypolicyviolation\"\n  , \"onseeked\"\n  , \"onseeking\"\n  , \"onselect\"\n  , \"onstalled\"\n  , \"onstorage\"\n  , \"onsubmit\"\n  , \"onsuspend\"\n  , \"ontimeupdate\"\n  , \"ontoggle\"\n  , \"onunhandledrejection\"\n  , \"onunload\"\n  , \"onvolumechange\"\n  , \"onwaiting\"\n  , \"onwheel\"\n  , \"open\"\n  , \"optimum\"\n  , \"pattern\"\n  , \"ping\"\n  , \"placeholder\"\n  , \"playsinline\"\n  , \"poster\"\n  , \"preload\"\n  , \"readonly\"\n  , \"referrerpolicy\"\n  , \"rel\"\n  , \"required\"\n  , \"reversed\"\n  , \"role\"\n  , \"rows\"\n  , \"rowspan\"\n  , \"sandbox\"\n  , \"scope\"\n  , \"selected\"\n  , \"shape\"\n  , \"size\"\n  , \"sizes\"\n  , \"slot\"\n  , \"span\"\n  , \"spellcheck\"\n  , \"src\"\n  , \"srcdoc\"\n  , \"srclang\"\n  , \"srcset\"\n  , \"start\"\n  , \"step\"\n  , \"style\"\n  , \"tabindex\"\n  , \"target\"\n  , \"title\"\n  , \"translate\"\n  , \"type\"\n  , \"typemustmatch\"\n  , \"updateviacache\"\n  , \"usemap\"\n  , \"value\"\n  , \"width\"\n  , \"workertype\"\n  , \"wrap\"\n  ]\n\n-- See https://en.wikipedia.org/wiki/RDFa, https://www.w3.org/TR/rdfa-primer/\nrdfaAttributes :: Set.Set Text\nrdfaAttributes = Set.fromList\n  [ \"about\"\n  , \"rel\"\n  , \"rev\"\n  , \"src\"\n  , \"href\"\n  , \"resource\"\n  , \"property\"\n  , \"content\"\n  , \"datatype\"\n  , \"typeof\"\n  , \"vocab\"\n  , \"prefix\"\n  ]\n\nhtml4Attributes :: Set.Set Text\nhtml4Attributes = Set.fromList\n  [ \"abbr\"\n  , \"accept\"\n  , \"accept-charset\"\n  , \"accesskey\"\n  , \"action\"\n  , \"align\"\n  , \"alink\"\n  , \"alt\"\n  , \"archive\"\n  , \"axis\"\n  , \"background\"\n  , \"bgcolor\"\n  , \"border\"\n  , \"cellpadding\"\n  , \"cellspacing\"\n  , \"char\"\n  , \"charoff\"\n  , \"charset\"\n  , \"checked\"\n  , \"cite\"\n  , \"class\"\n  , \"classid\"\n  , \"clear\"\n  , \"code\"\n  , \"codebase\"\n  , \"codetype\"\n  , \"color\"\n  , \"cols\"\n  , \"colspan\"\n  , \"compact\"\n  , \"content\"\n  , \"coords\"\n  , \"data\"\n  , \"datetime\"\n  , \"declare\"\n  , \"defer\"\n  , \"dir\"\n  , \"disabled\"\n  , \"enctype\"\n  , \"face\"\n  , \"for\"\n  , \"frame\"\n  , \"frameborder\"\n  , \"headers\"\n  , \"height\"\n  , \"href\"\n  , \"hreflang\"\n  , \"hspace\"\n  , \"http-equiv\"\n  , \"id\"\n  , \"ismap\"\n  , \"label\"\n  , \"lang\"\n  , \"language\"\n  , \"link\"\n  , \"longdesc\"\n  , \"marginheight\"\n  , \"marginwidth\"\n  , \"maxlength\"\n  , \"media\"\n  , \"method\"\n  , \"multiple\"\n  , \"name\"\n  , \"nohref\"\n  , \"noresize\"\n  , \"noshade\"\n  , \"nowrap\"\n  , \"object\"\n  , \"onblur\"\n  , \"onchange\"\n  , \"onclick\"\n  , \"ondblclick\"\n  , \"onfocus\"\n  , \"onkeydown\"\n  , \"onkeypress\"\n  , \"onkeyup\"\n  , \"onload\"\n  , \"onmousedown\"\n  , \"onmousemove\"\n  , \"onmouseout\"\n  , \"onmouseover\"\n  , \"onmouseup\"\n  , \"onreset\"\n  , \"onselect\"\n  , \"onsubmit\"\n  , \"onunload\"\n  , \"profile\"\n  , \"prompt\"\n  , \"readonly\"\n  , \"rel\"\n  , \"rev\"\n  , \"rows\"\n  , \"rowspan\"\n  , \"rules\"\n  , \"scheme\"\n  , \"scope\"\n  , \"scrolling\"\n  , \"selected\"\n  , \"shape\"\n  , \"size\"\n  , \"span\"\n  , \"src\"\n  , \"standby\"\n  , \"start\"\n  , \"style\"\n  , \"summary\"\n  , \"tabindex\"\n  , \"target\"\n  , \"text\"\n  , \"title\"\n  , \"usemap\"\n  , \"valign\"\n  , \"value\"\n  , \"valuetype\"\n  , \"version\"\n  , \"vlink\"\n  , \"vspace\"\n  , \"width\"\n  ]\n"
  },
  {
    "path": "src/Text/Pandoc/XMLFormat.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\nmodule Text.Pandoc.XMLFormat\n  ( atNameAlignment,\n    atNameApiVersion,\n    atNameCitationHash,\n    atNameCitationMode,\n    atNameCitationNoteNum,\n    atNameColspan,\n    atNameColWidth,\n    atNameFormat,\n    atNameImageUrl,\n    atNameLevel,\n    atNameLinkUrl,\n    atNameMathType,\n    atNameMetaBoolValue,\n    atNameMetaMapEntryKey,\n    atNameNumberDelim,\n    atNameNumberStyle,\n    atNameQuoteType,\n    atNameRowHeadColumns,\n    atNameRowspan,\n    atNameSpaceCount,\n    atNameStart,\n    atNameStrContent,\n    atNameTitle,\n    tgNameBodyBody,\n    tgNameBodyHeader,\n    tgNameCitations,\n    tgNameCitationPrefix,\n    tgNameCitationSuffix,\n    tgNameColspecs,\n    tgNameDefListDef,\n    tgNameDefListItem,\n    tgNameDefListTerm,\n    tgNameLineItem,\n    tgNameListItem,\n    tgNameMetaMapEntry,\n    tgNameShortCaption,\n  )\nwhere\n\nimport Data.Text (Text)\n\n-- the attribute carrying the API version of pandoc types in the main Pandoc element\natNameApiVersion :: Text\natNameApiVersion = \"api-version\"\n\n-- the element of a <meta> or <MetaMap> entry\ntgNameMetaMapEntry :: Text\ntgNameMetaMapEntry = \"entry\"\n\n-- the attribute carrying the key name of a <meta> or <MetaMap> entry\natNameMetaMapEntryKey :: Text\natNameMetaMapEntryKey = \"key\"\n\n-- the attribute carrying the boolean value (\"true\" or \"false\") of a MetaBool\natNameMetaBoolValue :: Text\natNameMetaBoolValue = \"value\"\n\n-- level of a Header\natNameLevel :: Text\natNameLevel = \"level\"\n\n-- start number of an OrderedList\natNameStart :: Text\natNameStart = \"start\"\n\n-- number delimiter of an OrderedList\natNameNumberDelim :: Text\natNameNumberDelim = \"number-delim\"\n\n-- number style of an OrderedList\natNameNumberStyle :: Text\natNameNumberStyle = \"number-style\"\n\n-- target title in Image and Link\natNameTitle :: Text\natNameTitle = \"title\"\n\n-- target url in Image\natNameImageUrl :: Text\natNameImageUrl = \"src\"\n\n-- target url in Link\natNameLinkUrl :: Text\natNameLinkUrl = \"href\"\n\n-- QuoteType of a Quoted\natNameQuoteType :: Text\natNameQuoteType = \"quote-type\"\n\n-- MathType of a Math\natNameMathType :: Text\natNameMathType = \"math-type\"\n\n-- format of a RawInline or a RawBlock\natNameFormat :: Text\natNameFormat = \"format\"\n\n-- alignment attribute in a ColSpec or in a Cell\natNameAlignment :: Text\natNameAlignment = \"alignment\"\n\n-- ColWidth attribute in a ColSpec\natNameColWidth :: Text\natNameColWidth = \"col-width\"\n\n-- RowHeadColumns attribute in a TableBody\natNameRowHeadColumns :: Text\natNameRowHeadColumns = \"row-head-columns\"\n\n-- RowSpan attribute in a Cell\natNameRowspan :: Text\natNameRowspan = \"row-span\"\n\n-- ColSpan attribute in a Cell\natNameColspan :: Text\natNameColspan = \"col-span\"\n\n-- the citationMode of a Citation\natNameCitationMode :: Text\natNameCitationMode = \"mode\"\n\n-- the citationHash of a Citation\natNameCitationHash :: Text\natNameCitationHash = \"hash\"\n\n-- the citationNoteNum of a Citation\natNameCitationNoteNum :: Text\natNameCitationNoteNum = \"note-num\"\n\n-- the number of consecutive spaces of the <Space> element\natNameSpaceCount :: Text\natNameSpaceCount = \"count\"\n\n-- the content of the <Str> element\natNameStrContent :: Text\natNameStrContent = \"content\"\n\n-- container of Citation elements in Cite inlines\ntgNameCitations :: Text\ntgNameCitations = \"citations\"\n\n-- element around the prefix inlines of a Citation\ntgNameCitationPrefix :: Text\ntgNameCitationPrefix = \"prefix\"\n\n-- element around the suffix inlines of a Citation\ntgNameCitationSuffix :: Text\ntgNameCitationSuffix = \"suffix\"\n\n-- list item for BulletList and OrderedList\ntgNameListItem :: Text\ntgNameListItem = \"item\"\n\n-- list item for DefinitionList\ntgNameDefListItem :: Text\ntgNameDefListItem = \"item\"\n\n-- element around the inlines of the term of a DefinitionList item\ntgNameDefListTerm :: Text\ntgNameDefListTerm = \"term\"\n\n-- element around the blocks of a definition in a DefinitionList item\ntgNameDefListDef :: Text\ntgNameDefListDef = \"def\"\n\n-- optional element of the ShortCaption\ntgNameShortCaption :: Text\ntgNameShortCaption = \"ShortCaption\"\n\n-- element around the ColSpec of a Table\ntgNameColspecs :: Text\ntgNameColspecs = \"colspecs\"\n\n-- element around the header rows of a TableBody\ntgNameBodyHeader :: Text\ntgNameBodyHeader = \"header\"\n\n-- element around the body rows of a TableBody\ntgNameBodyBody :: Text\ntgNameBodyBody = \"body\"\n\n-- element around the inlines of a line in a LineBlock\ntgNameLineItem :: Text\ntgNameLineItem = \"line\"\n"
  },
  {
    "path": "src/Text/Pandoc.hs",
    "content": "{-# LANGUAGE FlexibleInstances   #-}\n{-# LANGUAGE GADTs               #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Text.Pandoc\n   Copyright   : Copyright (C) 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nThis helper module exports the main writers, readers, and data\nstructure definitions from the Pandoc libraries.\n\nA typical application will chain together a reader and a writer\nto convert strings from one format to another.  For example, the\nfollowing simple program will act as a filter converting markdown\nfragments to reStructuredText, using reference-style links instead of\ninline links:\n\n> module Main where\n> import Text.Pandoc\n> import Data.Text (Text)\n> import qualified Data.Text.IO as T\n>\n> mdToRST :: Text -> IO Text\n> mdToRST txt = runIOorExplode $\n>   readMarkdown def txt\n>   >>= writeRST def{ writerReferenceLinks = True }\n>\n> main :: IO ()\n> main = do\n>   T.getContents >>= mdToRST >>= T.putStrLn\n\n-}\n\nmodule Text.Pandoc\n               (\n               -- * Definitions\n               module Text.Pandoc.Definition\n               -- * Generics\n               , module Text.Pandoc.Generic\n               -- * Options\n               , module Text.Pandoc.Options\n               -- * Logging\n               , module Text.Pandoc.Logging\n               -- * Typeclass\n               , module Text.Pandoc.Class\n               -- * Internal data files\n               , module Text.Pandoc.Data\n               -- * Error handling\n               , module Text.Pandoc.Error\n               -- * Readers: converting /to/ Pandoc format\n               , module Text.Pandoc.Readers\n               -- * Writers: converting /from/ Pandoc format\n               , module Text.Pandoc.Writers\n               -- * Rendering templates and default templates\n               , module Text.Pandoc.Templates\n               -- * Localization\n               , setTranslations\n               , translateTerm\n               -- * Version information\n               , pandocVersion\n               , pandocVersionText\n             ) where\n\nimport Text.Pandoc.Class\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Data\nimport Text.Pandoc.Error\nimport Text.Pandoc.Generic\nimport Text.Pandoc.Logging\nimport Text.Pandoc.Options\nimport Text.Pandoc.Readers\nimport Text.Pandoc.Version (pandocVersion, pandocVersionText)\nimport Text.Pandoc.Templates\nimport Text.Pandoc.Translations (setTranslations, translateTerm)\nimport Text.Pandoc.Writers\n"
  },
  {
    "path": "stack.yaml",
    "content": "flags:\n  pandoc:\n    embed_data_files: true\n  QuickCheck:\n    old-random: false\npackages:\n- '.'\n- 'pandoc-cli'\n- 'pandoc-lua-engine'\n- 'pandoc-server'\nextra-deps:\n- hslua-2.5.0\n- hslua-marshalling-2.3.2\n- hslua-module-doclayout-1.2.1.1\n- hslua-module-path-1.2.0\n- hslua-module-text-1.2.0\n- hslua-module-system-1.3.0\n- hslua-module-version-1.2.0.1\n- hslua-module-zip-1.2.1\n- hslua-objectorientation-2.5.0\n- hslua-packaging-2.4.1\n- hslua-typing-0.2.0\n- pandoc-lua-marshal-0.3.2.1\n- typst-symbols-0.1.9.1\n- citeproc-0.13\n- skylighting-format-blaze-html-0.1.2\n- djot-0.1.4\n- asciidoc-0.1.0.2\n- texmath-0.13.1.1\n- typst-0.9.0.1\n\nghc-options:\n   \"$locals\": -fhide-source-paths -Wno-missing-home-modules\nresolver: lts-24.20\nnix:\n  packages:\n  - pkg-config\n  - zlib\n"
  },
  {
    "path": "test/Tests/Command.hs",
    "content": "{-# LANGUAGE BangPatterns #-}\n{- |\n   Module      : Tests.Command\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nRun commands, and test results, defined in markdown files.\n\nA command test is a code block with the following format:\n\n> ```\n> % pandoc -f markdown -t latex\n> *hi*\n> ^D\n> \\emph{hi}\n> ```\n\n- The first line, after \"%\", should contain a command to run.\n- Then comes zero or more lines of text which will be passed\n  to the command as stdin.\n- The stdin terminates with a line containing \"^D\".\n- The following lines are typically the expected output\n  on stdout.\n- If any output on stderr is expected, it should come first\n  and each stderr line should be preceded by the string \"2> \".\n- If a nonzero exit status is expected, the last line should\n  contain \"=> \" followed by the exit status.\n\n-}\nmodule Tests.Command (tests)\nwhere\n\nimport Data.Maybe (fromMaybe)\nimport Data.Algorithm.Diff\nimport System.Environment (getExecutablePath)\nimport qualified Data.ByteString as BS\nimport qualified Data.Text as T\nimport Data.List (isSuffixOf)\nimport System.Directory\nimport System.Exit\nimport System.FilePath ((</>))\nimport System.IO.Unsafe (unsafePerformIO)\nimport System.Process\nimport Test.Tasty\nimport Test.Tasty.HUnit\nimport Test.Tasty.Golden.Advanced (goldenTest)\nimport Tests.Helpers\nimport Text.Pandoc\nimport qualified Text.Pandoc.UTF8 as UTF8\n\n-- | Run a test with and return output.\nexecTest :: String    -- ^ Path to test executable\n         -> String    -- ^ Shell command\n         -> String    -- ^ Input text\n         -> IO (ExitCode, String)  -- ^ Exit code and actual output\nexecTest testExePath cmd inp = do\n  env' <- setupEnvironment testExePath\n  let pr = (shell (pandocToEmulate True cmd)){ env = Just env' }\n  (!ec, out', err') <- readCreateProcessWithExitCode pr inp\n  let err = unlines . map (\"2> \" ++) . lines $ err'\n  -- filter \\r so the tests will work on Windows machines\n  let out'' = filter (/= '\\r') $ err ++ out'\n  let out = out'' ++ case ec of\n                        ExitFailure !n -> \"=> \" ++ show n ++ \"\\n\"\n                        ExitSuccess    -> \"\"\n  return (ec, out)\n\npandocToEmulate :: Bool -> String -> String\npandocToEmulate True ('p':'a':'n':'d':'o':'c':cs) =\n  \"test-pandoc --emulate\" ++ pandocToEmulate False cs\npandocToEmulate False ('|':' ':'p':'a':'n':'d':'o':'c':cs) =\n  \"| \" ++ \"test-pandoc --emulate\" ++ pandocToEmulate False cs\npandocToEmulate _ (c:cs) = c : pandocToEmulate False cs\npandocToEmulate _ [] = []\n\ntests :: TestTree\n{-# NOINLINE tests #-}\ntests = unsafePerformIO $ do\n  files <- filter (\".md\" `isSuffixOf`) <$>\n               getDirectoryContents \"command\"\n  testExePath <- getExecutablePath\n  let cmds = map (extractCommandTest testExePath) files\n  return $ testGroup \"Command:\" cmds\n\nisCodeBlock :: Block -> Bool\nisCodeBlock (CodeBlock _ _) = True\nisCodeBlock _               = False\n\nextractCode :: Block -> String\nextractCode (CodeBlock _ code) = T.unpack code\nextractCode _                  = \"\"\n\ndropPercent :: String -> Maybe String\ndropPercent ('%':xs) = Just $ dropWhile (== ' ') xs\ndropPercent _        = Nothing\n\nrunCommandTest :: FilePath -> FilePath -> Int -> String -> TestTree\nrunCommandTest testExePath fp num code = do\n  goldenTest testname getExpected getActual compareValues' updateGolden\n where\n  testname = \"#\" <> show num\n  codelines = lines code\n  (continuations, r1) = span (\"\\\\\" `isSuffixOf`) codelines\n  cmd = fromMaybe (error \"Command test line does not begin with %\")\n            (dropPercent (unwords (map init continuations ++ take 1 r1)))\n  r2 = drop 1 r1\n  (inplines, r3) = break (==\"^D\") r2\n  normlines = takeWhile (/=\".\") (drop 1 r3)\n  input = unlines inplines\n  norm = unlines normlines\n  getExpected = return norm\n  getActual = snd <$> execTest testExePath cmd input\n  compareValues' expected actual\n    | actual == expected = return Nothing\n    | otherwise = return $ Just $ \"--- test/command/\" ++ fp ++ \"\\n+++ \" ++\n                                cmd ++ \"\\n\" ++ showDiff (1,1)\n                                   (getDiff (lines actual) (lines expected))\n  updateGolden newnorm = do\n    let fp' = \"command\" </> fp\n    raw <- UTF8.readFile fp'\n    let cmdline = \"% \" <> cmd\n    let x = cmdline <> \"\\n\" <> input <> \"^D\\n\" <> norm\n    let y = cmdline <> \"\\n\" <> input <> \"^D\\n\" <> newnorm\n    let updated = T.replace (T.pack x) (T.pack y) raw\n    UTF8.writeFile fp' updated\n\nextractCommandTest :: FilePath -> FilePath -> TestTree\nextractCommandTest testExePath fp = unsafePerformIO $ do\n  contents <- UTF8.toText <$> BS.readFile (\"command\" </> fp)\n  Pandoc _ blocks <- runIOorExplode (readMarkdown\n                        def{ readerExtensions = pandocExtensions } contents)\n  let codeblocks = map extractCode $ filter isCodeBlock blocks\n  let cases = zipWith (runCommandTest testExePath fp) [1..] codeblocks\n  return $ testGroup fp\n         $ if null cases\n              then [testCase \"!!\" $ assertFailure \"No command tests defined\"]\n              else cases\n"
  },
  {
    "path": "test/Tests/Helpers.hs",
    "content": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE TupleSections #-}\n{-# LANGUAGE FlexibleInstances    #-}\n{- |\n   Module      : Tests.Helpers\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nUtility functions for the test suite.\n-}\nmodule Tests.Helpers ( test\n                     , TestResult(..)\n                     , setupEnvironment\n                     , showDiff\n                     , nativeDiff\n                     , testGolden\n                     , (=?>)\n                     , purely\n                     , ToString(..)\n                     , ToPandoc(..)\n                     )\n                     where\n\nimport System.FilePath\nimport Data.Algorithm.Diff\nimport qualified Data.Map as M\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport Data.Text (Text, unpack)\nimport qualified Data.Text as T\nimport System.Exit\nimport qualified System.Environment as Env\nimport Test.Tasty\nimport Test.Tasty.Golden.Advanced (goldenTest)\nimport Test.Tasty.HUnit\nimport Text.Pandoc.Builder (Blocks, Inlines, doc, plain)\nimport qualified Text.Pandoc.Builder as B\nimport Text.Pandoc.Class\nimport Text.Pandoc.Definition\nimport Text.Pandoc.Options\nimport Text.Pandoc.Shared (trimr)\nimport Text.Pandoc.Writers.Native (writeNative)\nimport Text.Printf\n\ntest :: (ToString a, ToString b, ToString c, HasCallStack)\n     => (a -> b)  -- ^ function to test\n     -> String    -- ^ name of test case\n     -> (a, c)    -- ^ (input, expected value)\n     -> TestTree\ntest fn name (input, expected) =\n  testCase name' $ assertBool msg (actual' == expected')\n     where msg = nl ++ dashes \"input\" ++ nl ++ input' ++ nl ++\n                 dashes \"result\" ++ nl ++\n                 unlines (map vividize diff) ++\n                 dashes \"\"\n           nl = \"\\n\"\n           name'   = if length name > 54\n                        then take 52 name ++ \"...\"  -- avoid wide output\n                        else name\n           input'  = toString input\n           actual' = lines $ toString $ fn input\n           expected' = lines $ toString expected\n           diff = getDiff expected' actual'\n           dashes \"\" = replicate 72 '-'\n           dashes x  = replicate (72 - length x - 5) '-' ++ \" \" ++ x ++ \" ---\"\n\ntestGolden :: TestName -> FilePath -> FilePath -> (Text -> IO Text) -> TestTree\ntestGolden  name expectedPath inputPath fn =\n  goldenTest\n    name\n    (UTF8.readFile expectedPath)\n    (UTF8.readFile inputPath >>= fn)\n    compareVals\n    (UTF8.writeFile expectedPath)\n where\n  compareVals expected actual\n    | expected == actual = return Nothing\n    | otherwise =  return $ Just $\n        \"\\n--- \" ++ expectedPath ++ \"\\n+++\\n\" ++\n        showDiff (1,1)\n          (getDiff (lines . filter (/='\\r') $ T.unpack actual)\n                   (lines . filter (/='\\r') $ T.unpack expected))\n\n-- | Set up environment for pandoc command tests.\nsetupEnvironment :: FilePath -> IO [(String, String)]\nsetupEnvironment testExePath = do\n  mldpath   <- Env.lookupEnv \"LD_LIBRARY_PATH\"\n  mdyldpath <- Env.lookupEnv \"DYLD_LIBRARY_PATH\"\n  mpdd <- Env.lookupEnv \"pandoc_datadir\"\n  mbpath <- Env.lookupEnv \"PATH\"\n  -- Note that Cabal sets the pandoc_datadir environment variable\n  -- to point to the source directory, since otherwise getDataFilename\n  -- will look in the data directory into which pandoc will be installed\n  -- (but has not yet been).  So when we spawn a new process with\n  -- pandoc, we need to make sure this environment variable is set.\n  return $ (\"PATH\",takeDirectory testExePath <>\n                    maybe mempty (searchPathSeparator:) mbpath) :\n           (\"TMP\",\".\") :\n           (\"LANG\",\"en_US.UTF-8\") :\n           (\"HOME\", \"./\") :\n           maybe [] ((:[]) . (\"pandoc_datadir\",)) mpdd ++\n           maybe [] ((:[]) . (\"LD_LIBRARY_PATH\",)) mldpath ++\n           maybe [] ((:[]) . (\"DYLD_LIBRARY_PATH\",)) mdyldpath\n\ndata TestResult = TestPassed\n                | TestError ExitCode\n                | TestFailed String FilePath [Diff String]\n     deriving (Eq)\n\ninstance Show TestResult where\n  show TestPassed     = \"PASSED\"\n  show (TestError ec) = \"ERROR \" ++ show ec\n  show (TestFailed cmd file d) = '\\n' : dash ++\n                                 \"\\n--- \" ++ file ++\n                                 \"\\n+++ \" ++ cmd ++ \"\\n\" ++ showDiff (1,1) d ++\n                                 dash\n    where dash = replicate 72 '-'\n\nshowDiff :: (Int,Int) -> [Diff String] -> String\nshowDiff _ []             = \"\"\nshowDiff (l,r) (First ln : ds) =\n  printf \"+%4d \" l ++ ln ++ \"\\n\" ++ showDiff (l+1,r) ds\nshowDiff (l,r) (Second ln : ds) =\n  printf \"-%4d \" r ++ ln ++ \"\\n\" ++ showDiff (l,r+1) ds\nshowDiff (l,r) (Both _ _ : ds) =\n  showDiff (l+1,r+1) ds\n\nvividize :: Diff String -> String\nvividize (Both s _) = \"  \" ++ s\nvividize (First s)  = \"- \" ++ s\nvividize (Second s) = \"+ \" ++ s\n\nnativeDiff :: FilePath -> Pandoc -> Pandoc -> IO (Maybe String)\nnativeDiff normPath expectedNative actualNative\n  | expectedNative == actualNative = return Nothing\n  | otherwise = Just <$> do\n      expected <- T.unpack <$> runIOorExplode (writeNative def expectedNative)\n      actual <- T.unpack <$> runIOorExplode (writeNative def actualNative)\n      let dash = replicate 72 '-'\n      let diff = getDiff (lines actual) (lines expected)\n      return $ '\\n' : dash ++\n               \"\\n--- \" ++ normPath ++\n               \"\\n+++ \" ++ \"test\" ++ \"\\n\" ++\n               showDiff (1,1) diff ++ dash\n\npurely :: (b -> PandocPure a) -> b -> a\npurely f = either (error . show) id . runPure . f\n\ninfix 5 =?>\n(=?>) :: a -> b -> (a,b)\nx =?> y = (x, y)\n\nclass ToString a where\n  toString :: a -> String\n\ninstance ToString Pandoc where\n  toString d = unpack $\n     purely (writeNative def{ writerTemplate = s }) $ toPandoc d\n   where s = case d of\n                  (Pandoc (Meta m) _)\n                    | M.null m  -> Nothing\n                    | otherwise -> Just mempty -- need this to get meta output\n\ninstance ToString Blocks where\n  toString = unpack . purely (writeNative def) . toPandoc\n\ninstance ToString [Block] where\n  toString = toString . B.fromList\n\ninstance ToString Block where\n  toString = toString . B.singleton\n\ninstance ToString Inlines where\n  toString = unpack . trimr . purely (writeNative def) . toPandoc\n\ninstance ToString String where\n  toString = id\n\ninstance ToString Text where\n  toString = unpack\n\nclass ToPandoc a where\n  toPandoc :: a -> Pandoc\n\ninstance ToPandoc Pandoc where\n  toPandoc = id\n\ninstance ToPandoc Blocks where\n  toPandoc = doc\n\ninstance ToPandoc Inlines where\n  toPandoc = doc . plain\n"
  },
  {
    "path": "test/Tests/MediaBag.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.MediaBag (tests) where\n\nimport Test.Tasty\nimport Test.Tasty.HUnit\n-- import Tests.Helpers\nimport Text.Pandoc.Class.IO (extractMedia)\nimport Text.Pandoc.Class (fillMediaBag, runIOorExplode)\nimport System.IO.Temp (withTempDirectory)\nimport Text.Pandoc.Shared (inDirectory)\nimport System.FilePath\nimport Text.Pandoc.Builder as B\nimport System.Directory (doesFileExist, copyFile)\n\ntests :: [TestTree]\ntests = [\n  testCase \"test fillMediaBag & extractMedia\" $\n      withTempDirectory \".\" \"extractMediaTest\" $ \\tmpdir -> inDirectory tmpdir $ do\n        copyFile \"../../test/lalune.jpg\" \"moon.jpg\"\n        let d = B.doc $\n                  B.para (B.image \"../../test/lalune.jpg\" \"\" mempty) <>\n                  B.para (B.image \"moon.jpg\" \"\" mempty) <>\n                  B.para (B.image \"data:image/png;base64,cHJpbnQgImhlbGxvIgo=;.lua+%2f%2e%2e%2f%2e%2e%2fa%2elua\" \"\" mempty) <>\n                  B.para (B.image \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" \"\" mempty)\n        runIOorExplode $ do\n          fillMediaBag d\n          extractMedia \"foo\" d\n        exists1 <- doesFileExist (\"foo\" </> \"moon.jpg\")\n        assertBool \"file in directory is not extracted with original name\" exists1\n        exists2 <- doesFileExist (\"foo\" </> \"f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg\")\n        assertBool \"file above directory is not extracted with hashed name\" exists2\n        exists3 <- doesFileExist (\"foo\" </> \"2a0eaa89f43fada3e6c577beea4f2f8f53ab6a1d.png\")\n        exists4 <- doesFileExist \"a.lua\"\n        assertBool \"data uri with malicious payload gets written outside of destination dir\"\n          (exists3 && not exists4)\n        exists5 <- doesFileExist (\"foo\" </> \"d5fceb6532643d0d84ffe09c40c481ecdf59e15a.gif\")\n        assertBool \"data uri with gif is not properly decoded\" exists5\n        -- double-encoded version:\n        let e = B.doc $\n                  B.para (B.image \"data:image/png;base64,cHJpbnQgInB3bmVkIgo=;.lua+%252f%252e%252e%252f%252e%252e%252fb%252elua\" \"\" mempty)\n        runIOorExplode $ do\n          fillMediaBag e\n          extractMedia \"bar\" e\n        exists6 <- doesFileExist (\"bar\" </> \"772ceca21a2751863ec46cb23db0e7fc35b9cff8.png\")\n        exists7 <- doesFileExist \"b.lua\"\n        assertBool \"data uri with double-encoded malicious payload gets written outside of destination dir\"\n          (exists6 && not exists7)\n  ]\n"
  },
  {
    "path": "test/Tests/Old.hs",
    "content": "{- |\n   Module      : Tests.Old\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\n\"Old\" style tests (comparing output to golden files).\n-}\nmodule Tests.Old (tests) where\n\nimport Data.Algorithm.Diff\nimport System.Exit\nimport System.FilePath ((<.>), (</>))\nimport System.Environment (getExecutablePath)\nimport Text.Pandoc.Process (pipeProcess)\nimport Test.Tasty (TestTree, testGroup)\nimport Test.Tasty.Golden.Advanced (goldenTest)\nimport Tests.Helpers hiding (test)\nimport qualified Text.Pandoc.UTF8 as UTF8\nimport qualified Data.Text as T\n\ntests :: FilePath -> [TestTree]\ntests pandocPath =\n  [ testGroup \"markdown\"\n    [ testGroup \"writer\"\n      $ writerTests' \"markdown\" ++ lhsWriterTests' \"markdown\" ++ extWriterTests' \"markdown\"\n    , testGroup \"reader\"\n      [ test' \"basic\" [\"-r\", \"markdown\", \"-w\", \"native\", \"-s\"]\n        \"testsuite.txt\" \"testsuite.native\"\n      , test' \"tables\" [\"-r\", \"markdown\", \"-w\", \"native\", \"--columns=80\"]\n        \"tables.txt\" \"tables.native\"\n      , test' \"pipe tables\" [\"-r\", \"markdown\", \"-w\", \"native\", \"--columns=80\"]\n        \"pipe-tables.txt\" \"pipe-tables.native\"\n      , test' \"more\" [\"-r\", \"markdown\", \"-w\", \"native\", \"-s\"]\n        \"markdown-reader-more.txt\" \"markdown-reader-more.native\"\n      , lhsReaderTest' \"markdown+lhs\"\n      ]\n    , testGroup \"citations\"\n      [ test' \"citations\" [\"-r\", \"markdown\", \"-w\", \"native\"]\n        \"markdown-citations.txt\" \"markdown-citations.native\"\n      ]\n    ]\n  , testGroup \"rst\"\n    [ testGroup \"writer\" (writerTests' \"rst\" ++ lhsWriterTests' \"rst\")\n    , testGroup \"reader\"\n      [ test' \"basic\" [\"-r\", \"rst+smart\", \"-w\", \"native\",\n        \"-s\", \"--columns=80\"] \"rst-reader.rst\" \"rst-reader.native\"\n      , test' \"tables\" [\"-r\", \"rst\", \"-w\", \"native\", \"--columns=80\"]\n        \"tables.rst\" \"tables-rstsubset.native\"\n      , lhsReaderTest' \"rst+lhs\"\n      ]\n    ]\n  , testGroup \"latex\"\n    [ testGroup \"writer\"\n        (extWriterTests' \"latex\" ++ lhsWriterTests' \"latex\")\n    , testGroup \"reader\"\n      [ test' \"basic\" [\"-r\", \"latex+raw_tex\", \"-w\", \"native\", \"-s\"]\n        \"latex-reader.latex\" \"latex-reader.native\"\n      , lhsReaderTest' \"latex+lhs\"\n      ]\n    ]\n  , testGroup \"html\"\n    [ testGroup \"writer\" $ mconcat\n      [ extWriterTests' \"html4\"\n      , extWriterTests' \"html5\"\n      , lhsWriterTests' \"html\"\n      ]\n    , test' \"reader\" [\"-r\", \"html\", \"-w\", \"native\", \"-s\"]\n      \"html-reader.html\" \"html-reader.native\"\n    ]\n  , testGroup \"s5\"\n    [ s5WriterTest' \"basic\" [\"-s\"] \"s5\"\n    , s5WriterTest' \"fancy\" [\"-s\",\"--mathjax\",\"-i\"] \"s5\"\n    , s5WriterTest' \"fragment\" [] \"html4\"\n    , s5WriterTest' \"inserts\"  [\"-s\", \"-H\", \"insert\",\n      \"-B\", \"insert\", \"-A\", \"insert\", \"-c\", \"main.css\"] \"html4\"\n    ]\n  , testGroup \"asciidoc\"\n    [ testGroup \"writer\" (writerTests' \"asciidoc\" ++\n                          writerTests' \"asciidoc_legacy\")\n    , testGroup \"reader\"\n      [ test' \"basic\" [\"-f\", \"asciidoc\", \"-t\", \"native\", \"-s\"]\n          \"asciidoc-reader.adoc\" \"asciidoc-reader.native\"\n      ]\n    ]\n  , testGroup \"textile\"\n    [ testGroup \"writer\" $ writerTests' \"textile\"\n    , test' \"reader\" [\"-r\", \"textile\", \"-w\", \"native\", \"-s\"]\n      \"textile-reader.textile\" \"textile-reader.native\"\n    ]\n  , testGroup \"djot\"\n    [ testGroup \"writer\" $ writerTests' \"djot\"\n    , test' \"reader\" [\"-f\", \"djot\", \"-t\" ,\"native\", \"-s\"]\n       \"djot-reader.djot\" \"djot-reader.native\"\n    ]\n  , testGroup \"docbook\"\n    [ testGroup \"writer\" $ writerTests' \"docbook4\"\n    , test' \"reader\" [\"-r\", \"docbook\", \"-w\", \"native\", \"-s\"]\n      \"docbook-reader.docbook\" \"docbook-reader.native\"\n    , test' \"reader\" [\"-r\", \"docbook\", \"-w\", \"native\", \"-s\"]\n      \"docbook-chapter.docbook\" \"docbook-chapter.native\"\n    , test' \"reader\" [\"-r\", \"docbook\", \"-w\", \"native\", \"-s\"]\n      \"docbook-xref.docbook\" \"docbook-xref.native\"\n    ]\n  , testGroup \"docbook5\"\n    [ testGroup \"writer\" $ writerTests' \"docbook5\"\n    ]\n  , testGroup \"jats\"\n    [ testGroup \"writer\"\n      [ testGroup \"jats_archiving\" $\n        extWriterTests' \"jats_archiving\"\n      , testGroup \"jats_articleauthoring\" $\n        writerTests' \"jats_articleauthoring\"\n      , testGroup \"jats_publishing\" $\n        writerTests' \"jats_publishing\"\n      ]\n    , test' \"reader\" [\"-r\", \"jats\", \"-w\", \"native\", \"-s\"]\n      \"jats-reader.xml\" \"jats-reader.native\"\n    ]\n  , testGroup \"jira\"\n    [ testGroup \"writer\" $ writerTests' \"jira\"\n    , test' \"reader\" [\"-r\", \"jira\", \"-w\", \"native\", \"-s\"]\n      \"jira-reader.jira\" \"jira-reader.native\"\n    ]\n  , testGroup \"native\"\n    [ testGroup \"writer\" $ writerTests' \"native\"\n    , test' \"reader\" [\"-r\", \"native\", \"-w\", \"native\", \"-s\"]\n      \"testsuite.native\" \"testsuite.native\"\n    ]\n  , testGroup \"fb2\"\n    [ fb2WriterTest' \"basic\" [] \"fb2/basic.markdown\" \"fb2/basic.fb2\"\n    , fb2WriterTest' \"titles\" [] \"fb2/titles.markdown\" \"fb2/titles.fb2\"\n    , fb2WriterTest' \"images\" [] \"fb2/images.markdown\" \"fb2/images.fb2\"\n    , fb2WriterTest' \"images-embedded\" [] \"fb2/images-embedded.html\" \"fb2/images-embedded.fb2\"\n    , fb2WriterTest' \"math\" [] \"fb2/math.markdown\" \"fb2/math.fb2\"\n    , fb2WriterTest' \"meta\" [] \"fb2/meta.markdown\" \"fb2/meta.fb2\"\n    , fb2WriterTest' \"tables\" [] \"tables.native\" \"tables.fb2\"\n    , fb2WriterTest' \"testsuite\" [] \"testsuite.native\" \"writer.fb2\"\n    ]\n  , testGroup \"mediawiki\"\n    [ testGroup \"writer\" $ mconcat [\n      writerTests' \"mediawiki\"\n      , extWriterTests' \"mediawiki\"\n      ]\n    , test' \"reader\" [\"-r\", \"mediawiki\", \"-w\", \"native\", \"-s\"]\n      \"mediawiki-reader.wiki\" \"mediawiki-reader.native\"\n    ]\n  , testGroup \"vimwiki\"\n    [ test' \"reader\" [\"-r\", \"vimwiki\", \"-w\", \"native\", \"-s\"]\n      \"vimwiki-reader.wiki\" \"vimwiki-reader.native\"\n    ]\n  , testGroup \"dokuwiki\"\n    [ testGroup \"writer\" $ writerTests' \"dokuwiki\"\n    , test' \"inline_formatting\" [\"-r\", \"native\", \"-w\", \"dokuwiki\", \"-s\"]\n      \"dokuwiki_inline_formatting.native\" \"dokuwiki_inline_formatting.dokuwiki\"\n    , test' \"multiblock table\" [\"-r\", \"native\", \"-w\", \"dokuwiki\", \"-s\"]\n      \"dokuwiki_multiblock_table.native\" \"dokuwiki_multiblock_table.dokuwiki\"\n    , test' \"external images\" [\"-r\", \"native\", \"-w\", \"dokuwiki\", \"-s\"]\n      \"dokuwiki_external_images.native\" \"dokuwiki_external_images.dokuwiki\"\n    ]\n  , testGroup \"opml\"\n    [ test' \"basic\" [\"-r\", \"native\", \"-w\", \"opml\", \"--columns=80\", \"-s\"]\n       \"testsuite.native\" \"writer.opml\"\n    , test' \"reader\" [\"-r\", \"opml\", \"-w\", \"native\", \"-s\"]\n      \"opml-reader.opml\" \"opml-reader.native\"\n    ]\n  , testGroup \"haddock\"\n    [ testGroup \"writer\" $ writerTests' \"haddock\"\n    , test' \"reader\" [\"-r\", \"haddock\", \"-w\", \"native\", \"-s\"]\n      \"haddock-reader.haddock\" \"haddock-reader.native\"\n    ]\n  , testGroup \"txt2tags\"\n    [ test' \"reader\" [\"-r\", \"t2t\", \"-w\", \"native\", \"-s\"]\n        \"txt2tags.t2t\" \"txt2tags.native\" ]\n  , testGroup \"epub\" [\n      test' \"features\" [\"-r\", \"epub\", \"-w\", \"native\", \"-s\"]\n        \"epub/features.epub\" \"epub/features.native\"\n    , test' \"wasteland\" [\"-r\", \"epub\", \"-w\", \"native\", \"-s\"]\n        \"epub/wasteland.epub\" \"epub/wasteland.native\"\n    , test' \"formatting\" [\"-r\", \"epub\", \"-w\", \"native\", \"-s\"]\n        \"epub/formatting.epub\" \"epub/formatting.native\"\n    ]\n  , testGroup \"twiki\"\n    [ test' \"reader\" [\"-r\", \"twiki\", \"-w\", \"native\", \"-s\"]\n        \"twiki-reader.twiki\" \"twiki-reader.native\" ]\n  , testGroup \"tikiwiki\"\n    [ test' \"reader\" [\"-r\", \"tikiwiki\", \"-w\", \"native\", \"-s\"]\n        \"tikiwiki-reader.tikiwiki\" \"tikiwiki-reader.native\" ]\n  , testGroup \"other writers\" $ map (\\f -> testGroup f $ writerTests' f)\n    [ \"opendocument\" , \"context\" , \"texinfo\", \"icml\", \"tei\"\n    , \"man\" , \"plain\" , \"xwiki\", \"zimwiki\" ]\n  , testGroup \"writers-lang-and-dir\"\n    [ test' \"latex\" [\"-f\", \"native\", \"-t\", \"latex\", \"-s\"]\n      \"writers-lang-and-dir.native\" \"writers-lang-and-dir.latex\"\n    , test' \"context\" [\"-f\", \"native\", \"-t\", \"context\", \"-s\"]\n      \"writers-lang-and-dir.native\" \"writers-lang-and-dir.context\"\n    ]\n  , testGroup \"muse\"\n    [ testGroup \"writer\" $ writerTests' \"muse\"\n    ]\n  , testGroup \"ms\"\n    [ test' \"basic\"  [\"-f\", \"native\", \"-t\", \"ms\", \"--columns=80\",\n                      \"--variable\", \"pandoc-version=\",\n                      \"--pdf-engine\", \"pdfroff\", \"-s\"]\n      \"testsuite.native\" \"writer.ms\"\n    , test' \"tables\" [\"-f\", \"native\", \"-t\", \"ms\", \"--columns=80\",\n                      \"--variable\", \"pandoc-version=\",\n                      \"--pdf-engine\", \"pdfroff\"]\n      \"tables.native\"  \"tables.ms\"\n    ]\n  , testGroup \"typst\"\n    [ testGroup \"writer\" $ writerTests' \"typst\" ++ extWriterTests' \"typst\"\n    , testGroup \"reader\"\n       [ test' \"typst-reader\" [\"-r\", \"typst\", \"-w\", \"native\", \"-s\"]\n          \"typst-reader.typ\" \"typst-reader.native\"\n       ]\n    ]\n\n  , testGroup \"creole\"\n    [ test' \"reader\" [\"-r\", \"creole\", \"-w\", \"native\", \"-s\"]\n      \"creole-reader.txt\" \"creole-reader.native\"\n    ]\n  , testGroup \"man\"\n    [ test' \"reader\" [\"-r\", \"man\", \"-w\", \"native\", \"-s\"]\n      \"man-reader.man\" \"man-reader.native\"\n    ]\n  , testGroup \"org\"\n    [ test' \"reader\" [\"-r\", \"org\", \"-w\", \"native\", \"-s\"]\n      \"org-select-tags.org\" \"org-select-tags.native\"\n    , testGroup \"writer\" $ writerTests' \"org\"\n    ]\n  , testGroup \"rtf\"\n    [ testGroup \"writer\" $ writerTests' \"rtf\" ]\n  , testGroup \"endnotexml\"\n    [ test' \"reader\" [\"-r\", \"endnotexml\", \"-w\", \"native\", \"-s\"]\n        \"endnotexml-reader.xml\" \"endnotexml-reader.native\" ]\n  , testGroup \"ipynb\"\n    [ test' \"reader\" [\"-f\", \"ipynb-raw_html-raw_tex+raw_attribute\",\n                      \"-t\", \"native\", \"-s\"]\n      \"ipynb/simple.ipynb\" \"ipynb/simple.out.native\"\n    , test' \"writer\" [\"-f\", \"native\",\n                      \"--markdown-headings=setext\", \"-t\",\n                      \"ipynb-raw_html-raw_tex+raw_attribute\", \"-s\"]\n      \"ipynb/simple.in.native\" \"ipynb/simple.ipynb\"\n    , test' \"reader\" [\"-t\", \"native\", \"-f\", \"ipynb\",\n                      \"--ipynb-output=all\"]\n      \"ipynb/mime.ipynb\" \"ipynb/mime.native\"\n    , test' \"writer\" [\"-f\", \"native\", \"-t\", \"ipynb\",\n                      \"--wrap=preserve\"]\n      \"ipynb/mime.native\" \"ipynb/mime.out.ipynb\"\n    , test' \"reader\" [\"-f\", \"ipynb\", \"-t\", \"html\"]\n      \"ipynb/rank.ipynb\" \"ipynb/rank.out.html\"\n    ]\n  , testGroup \"markua\" [ testGroup \"writer\" $ writerTests' \"markua\"]\n  , testGroup \"ansi\"\n      [ test' \"ansi\" [\"-f\", \"markdown\", \"-t\", \"ansi\"]\n        \"ansi-test.txt\" \"ansi-test.ansi\"\n      ]\n  , testGroup \"pod\"\n      [ test' \"pod\" [\"-f\", \"pod\", \"-t\", \"native\"]\n        \"pod-reader.pod\" \"pod-reader.native\"\n      ]\n  , testGroup \"vimdoc\" [ testGroup \"writer\" $\n      writerTests' \"vimdoc\" ++\n        [ test' \"vimdoc-specific definition lists\"\n            [\"-s\", \"-r\", \"markdown\", \"-w\", \"vimdoc\", \"--toc\", \"--columns=78\"]\n            \"vimdoc/definition-lists.markdown\" \"vimdoc/definition-lists.vimdoc\"\n        , test' \"linking to docs\"\n            [\"-s\", \"-r\", \"markdown\", \"-w\", \"vimdoc\", \"--toc\", \"--columns=78\"]\n            \"vimdoc/vim-online-doc.markdown\" \"vimdoc/vim-online-doc.vimdoc\"\n        , test' \"unnumbered TOC up to level 2 headers\"\n            [\"-s\", \"-r\", \"markdown\", \"-w\", \"vimdoc\", \"--toc\", \"--columns=78\",\n             \"--toc-depth=2\"]\n            \"vimdoc/headers.markdown\" \"vimdoc/headers.vimdoc\"\n        , test' \"numbered TOC\"\n            [\"-s\", \"-r\", \"markdown\", \"-w\", \"vimdoc\", \"--toc\", \"--columns=78\",\n             \"-N\"]\n            \"vimdoc/headers.markdown\" \"vimdoc/headers-numbered.vimdoc\"\n        ]\n    ]\n  , testGroup \"bbcode\" [testGroup \"writer\" $ writerTests' \"bbcode\"]\n  ]\n where\n    test'           = test pandocPath\n    writerTests'    = writerTests pandocPath\n    s5WriterTest'   = s5WriterTest pandocPath\n    fb2WriterTest'  = fb2WriterTest pandocPath\n    lhsWriterTests' = lhsWriterTests pandocPath\n    lhsReaderTest'  = lhsReaderTest pandocPath\n    extWriterTests' = extendedWriterTests pandocPath\n\n-- makes sure file is fully closed after reading\nreadFile' :: FilePath -> IO String\nreadFile' f = do s <- UTF8.readFile f\n                 return $! (T.length s `seq` T.unpack s)\n\nlhsWriterTests :: FilePath -> String -> [TestTree]\nlhsWriterTests pandocPath format\n  = [ t \"lhs to normal\" format\n    , t \"lhs to lhs\"    (format ++ \"+lhs\")\n    ]\n  where\n    t n f = test pandocPath\n             n [\"--wrap=preserve\", \"-r\", \"native\",\n              \"--markdown-headings=setext\", \"-w\", f]\n             \"lhs-test.native\" (\"lhs-test\" <.> f)\n\nlhsReaderTest :: FilePath -> String -> TestTree\nlhsReaderTest pandocPath format =\n  test pandocPath \"lhs\" [\"-r\", format, \"-w\", \"native\"]\n    (\"lhs-test\" <.> format) norm\n   where norm = if format == \"markdown+lhs\"\n                   then \"lhs-test-markdown.native\"\n                   else \"lhs-test.native\"\n\nwriterTests :: FilePath -> String -> [TestTree]\nwriterTests pandocPath format\n  = [ test pandocPath\n        \"basic\"  (opts ++ [\"-s\"]) \"testsuite.native\" (\"writer\" <.> format)\n    , test pandocPath\n       \"tables\" opts             \"tables.native\"    (\"tables\" <.> format)\n    ]\n  where\n    opts = [\"-r\", \"native\", \"-w\", format, \"--columns=80\",\n            \"--variable\", \"pandoc-version=\"]\n\nextendedWriterTests :: FilePath -> String -> [TestTree]\nextendedWriterTests pandocPath format\n  = writerTests pandocPath format ++\n    let testForTable name =\n          test pandocPath\n               (name ++ \" table\")\n               opts\n               (\"tables\" </> name <.> \"native\")\n               (\"tables\" </> name <.> format)\n    in map testForTable [\"planets\", \"nordics\", \"students\"]\n  where\n    opts = [\"-r\", \"native\", \"-w\", format, \"--columns=80\",\n            \"--variable\", \"pandoc-version=\"]\n\ns5WriterTest :: FilePath -> String -> [String] -> String -> TestTree\ns5WriterTest pandocPath modifier opts format\n  = test pandocPath (format ++ \" writer (\" ++ modifier ++ \")\")\n    ([\"-r\", \"native\", \"-w\", format] ++ opts)\n    \"s5.native\"  (\"s5-\" ++ modifier <.> \"html\")\n\nfb2WriterTest :: FilePath -> String -> [String] -> String -> String -> TestTree\nfb2WriterTest pandocPath title opts inputfile normfile =\n  testWithNormalize (ignoreBinary . formatXML) pandocPath\n                    title ([\"-t\", \"fb2\"]++opts) inputfile normfile\n  where\n    formatXML xml = splitTags $ zip xml (drop 1 xml)\n    splitTags []               = []\n    splitTags [end]            = [fst end, snd end]\n    splitTags (('>','<'):rest) = \">\\n\" ++ splitTags rest\n    splitTags ((c,_):rest)     = c : splitTags rest\n    ignoreBinary = unlines . filter (not . startsWith \"<binary \") . lines\n    startsWith tag str = all (uncurry (==)) $ zip tag str\n\n-- | Run a test without normalize function, return True if test passed.\ntest :: FilePath  -- ^ Path of pandoc executable\n     -> String    -- ^ Title of test\n     -> [String]  -- ^ Options to pass to pandoc\n     -> String    -- ^ Input filepath\n     -> FilePath  -- ^ Norm (for test results) filepath\n     -> TestTree\ntest = testWithNormalize id\n\n-- | Run a test with normalize function, return True if test passed.\ntestWithNormalize  :: (String -> String) -- ^ Normalize function for output\n                   -> FilePath  -- ^ Path to pandoc executable\n                   -> String    -- ^ Title of test\n                   -> [String]  -- ^ Options to pass to pandoc\n                   -> String    -- ^ Input filepath\n                   -> FilePath  -- ^ Norm (for test results) filepath\n                   -> TestTree\ntestWithNormalize normalizer pandocPath testname opts inp norm =\n  goldenTest testname getExpected getActual\n    (compareValues norm options) updateGolden\n  where getExpected = normalizer <$> readFile' norm\n        getActual   = do\n              env <- setupEnvironment pandocPath\n              (ec, out) <- pipeProcess (Just env) pandocPath\n                             (\"--emulate\":options) mempty\n              if ec == ExitSuccess\n                 then return $ filter (/='\\r') . normalizer\n                             $ UTF8.toStringLazy out\n                   -- filter \\r so the tests will work on Windows machines\n                 else fail $ \"Pandoc failed with error code \" ++ show ec\n        updateGolden = UTF8.writeFile norm . T.pack\n        options = [\"--quiet\"] ++ [inp] ++ opts\n\ncompareValues :: FilePath -> [String] -> String -> String -> IO (Maybe String)\ncompareValues norm options expected actual = do\n  testExePath <- getExecutablePath\n  let cmd  = testExePath ++ \" --emulate \" ++ unwords options\n  let dash = replicate 72 '-'\n  let diff = getDiff (lines actual) (lines expected)\n  if expected == actual\n     then return Nothing\n     else return $ Just $\n        '\\n' : dash ++\n        \"\\n--- \" ++ norm ++\n        \"\\n+++ \" ++ cmd ++ \"\\n\" ++\n        showDiff (1,1) diff ++ dash\n"
  },
  {
    "path": "test/Tests/Readers/Creole.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Creole\n   Copyright   : © 2017 Sascha Wilde\n                   2017-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Sascha Wilde <wilde@sha-bang.de>\n   Stability   : alpha\n   Portability : portable\n\nTests for the creole reader.\n-}\nmodule Tests.Readers.Creole (tests) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\ncreole :: Text -> Pandoc\ncreole = purely $ readCreole def{ readerStandalone = True }\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test creole\n\ntests :: [TestTree]\ntests = [\n  testGroup \"Basic Text Formatting\" [\n          \"bold, single line, fully delimited\" =:\n          \"only **bold** is bold\"\n          =?> para (\"only \" <> strong \"bold\" <> \" is bold\")\n        , \"italics, single line, fully delimited\" =:\n          \"only //this// is in italics\"\n          =?> para (\"only \" <> emph \"this\" <> \" is in italics\")\n        , \"bold in italics, fully delimited\" =:\n          \"//**this**// is in bold italics\"\n          =?> para (emph (strong \"this\") <> \" is in bold italics\")\n        , \"italics in bold, fully delimited\" =:\n          \"**//this//** is in bold italics\"\n          =?> para (strong (emph \"this\") <> \" is in bold italics\")\n\n        , \"escape bold marker\" =:\n          \"~**not bold\" =?> para \"**not bold\"\n        , \"escape italics marker\" =:\n          \"~//not in italics\" =?> para \"//not in italics\"\n\n        , \"inline nowiki, simple\" =:\n          \"this is {{{**not** ~interpreted}}} at all\"\n          =?> para (\"this is \" <> code \"**not** ~interpreted\" <> \" at all\")\n        , \"inline nowiki, curly braces inside\" =:\n          \"this is {{{{{{//including// some `}' chars}}}}}}\"\n          =?> para (\"this is \" <> code \"{{{//including// some `}' chars}}}\")\n\n        , \"placeholder\" =:\n          \"foo <<<place holder>>> bar\"\n          =?> para \"foo bar\"\n        , \"placeholder escaped\" =:\n          \"foo ~<<<no place holder>>> bar\"\n          =?> para \"foo <<<no place holder>>> bar\"\n        ]\n  , testGroup \"Headers\" [\n          \"header level 1, no space, no trailing =\" =:\n          \"= Top-Level Header\"\n          =?> header 1 (str \"Top-Level Header\")\n        , \"header level 1, leading space, trailing =\" =:\n          \" = Top-Level Header = \"\n          =?> header 1 (str \"Top-Level Header\")\n        , \"header level 2, no space, no trailing =\" =:\n          \"== Second Level\"\n          =?> header 2 (str \"Second Level\")\n        , \"header level 2, leading space, no trailing =\" =:\n          \"   == Second Level\"\n          =?> header 2 (str \"Second Level\")\n        , \"header level 3, no space, no trailing =\" =:\n          \"=== Third\"\n          =?> header 3 (str \"Third\")\n        , \"header level 3, no space, > 3 trailing =\" =:\n          \"=== Third =======\"\n          =?> header 3 (str \"Third\")\n        , \"header level 4, no space, no trailing =\" =:\n          \"==== Fourth Level Heading\"\n          =?> header 4 (str \"Fourth Level Heading\")\n        , \"header level 4, no space, < 4 trailing =\" =:\n          \"==== Fourth Level Heading ==\"\n          =?> header 4 (str \"Fourth Level Heading\")\n        , \"header level 5, no space, no trailing =\" =:\n          \"===== Fifth\"\n          =?> header 5 (str \"Fifth\")\n        , \"header level 6, no space, no trailing =\" =:\n          \"====== Sixth\"\n          =?> header 6 (str \"Sixth\")\n        ]\n  , testGroup \"Paragraphs\" [\n          \"paragraphs: multiple, one line\" =:\n          \"first line\\n\\nanother line\\n\"\n          =?> para \"first line\" <> para \"another line\"\n          ]\n  , testGroup \"Lists\" [\n          \"unordered list, two entries, one separating space\" =:\n          \"* foo\\n* bar\"\n          =?> bulletList [ plain \"foo\", plain \"bar\" ]\n        , \"unordered list, three entries, one separating space\" =:\n          \"* foo\\n* bar\\n* baz\"\n          =?> bulletList [ plain \"foo\", plain \"bar\", plain \"baz\" ]\n        , \"para followed by, unordered list, two entries, one separating space\" =:\n          \"blubber\\n* foo\\n* bar\"\n          =?> para \"blubber\" <> bulletList [ plain \"foo\", plain \"bar\" ]\n        , \"nested unordered list, one separating space\" =:\n          \"* foo\\n** bar\\n** baz\\n* blubb\"\n          =?> bulletList [ plain \"foo\"\n                         <> bulletList [ plain \"bar\", plain \"baz\" ]\n                         , plain \"blubb\" ]\n        , \"nested many unordered lists, one separating space\" =:\n          (\"* foo\\n** bar\\n*** third\\n*** third two\\n** baz\\n*** third again\\n\"\n           <> \"**** fourth\\n***** fifth\\n* blubb\")\n          =?> bulletList [ plain \"foo\"\n                           <> bulletList [ plain \"bar\"\n                                           <> bulletList [ plain \"third\"\n                                                         , plain \"third two\"]\n                                         , plain \"baz\"\n                                           <> bulletList [ plain \"third again\"\n                                                         <> bulletList [\n                                                             plain \"fourth\"\n                                                             <> bulletList [\n                                                                 plain \"fifth\"\n                                                                 ]\n                                                             ]\n                                                         ]\n                                         ]\n                         , plain \"blubb\" ]\n        , \"nested unordered list, mixed separating space\" =:\n          \"*foo\\n   **   bar\\n    **baz\\n *      blubb\"\n          =?> bulletList [ plain \"foo\"\n                         <> bulletList [ plain \"bar\", plain \"baz\" ]\n                         , plain \"blubb\" ]\n        , \"nested unordered list, one separating space, trailing space\" =:\n          \"* foo \\n** bar  \\n** baz \\n* blubb  \"\n          =?> bulletList [ plain \"foo\"\n                         <> bulletList [ plain \"bar\", plain \"baz\" ]\n                         , plain \"blubb\" ]\n        , \"ordered list, two entries, one separating space\" =:\n          \"# foo\\n# bar\"\n          =?> orderedList [ plain \"foo\", plain \"bar\" ]\n        , \"ordered list, three entries, one separating space\" =:\n          \"# foo\\n# bar\\n# baz\"\n          =?> orderedList [ plain \"foo\", plain \"bar\", plain \"baz\" ]\n        , \"para followed by, ordered list, two entries, one separating space\" =:\n          \"blubber\\n# foo\\n# bar\"\n          =?> para \"blubber\" <> orderedList [ plain \"foo\", plain \"bar\" ]\n        , \"nested ordered list, one separating space\" =:\n          \"# foo\\n## bar\\n## baz\\n# blubb\"\n          =?> orderedList [ plain \"foo\"\n                         <> orderedList [ plain \"bar\", plain \"baz\" ]\n                         , plain \"blubb\" ]\n        , \"nested ordered list, one separating space, trailing space\" =:\n          \"# foo \\n## bar  \\n## baz \\n# blubb  \"\n          =?> orderedList [ plain \"foo\"\n                         <> orderedList [ plain \"bar\", plain \"baz\" ]\n                         , plain \"blubb\" ]\n        , \"nested many ordered lists, one separating space\" =:\n          (\"# foo\\n## bar\\n### third\\n### third two\\n## baz\\n### third again\\n\"\n           <> \"#### fourth\\n##### fifth\\n# blubb\")\n          =?> orderedList [ plain \"foo\"\n                           <> orderedList [ plain \"bar\"\n                                           <> orderedList [ plain \"third\"\n                                                         , plain \"third two\"]\n                                         , plain \"baz\"\n                                           <> orderedList [ plain \"third again\"\n                                                         <> orderedList [\n                                                             plain \"fourth\"\n                                                             <> orderedList [\n                                                                 plain \"fifth\"\n                                                                 ]\n                                                             ]\n                                                         ]\n                                         ]\n                         , plain \"blubb\" ]\n        , \"nested ordered list, mixed separating space\" =:\n          \"#foo\\n   ##   bar\\n    ##baz\\n #      blubb\"\n          =?> orderedList [ plain \"foo\"\n                         <> orderedList [ plain \"bar\", plain \"baz\" ]\n                         , plain \"blubb\" ]\n        , \"mixed nested ordered and unordered lists, one separating space\" =:\n          (\"# foo\\n** bar\\n### third\\n### third two\\n** baz\\n### third again\\n\"\n           <> \"#### fourth\\n***** fifth\\n# blubb\")\n          =?> orderedList [ plain \"foo\"\n                           <> bulletList [ plain \"bar\"\n                                           <> orderedList [ plain \"third\"\n                                                         , plain \"third two\"]\n                                         , plain \"baz\"\n                                           <> orderedList [ plain \"third again\"\n                                                         <> orderedList [\n                                                             plain \"fourth\"\n                                                             <> bulletList [\n                                                                 plain \"fifth\"\n                                                                 ]\n                                                             ]\n                                                         ]\n                                         ]\n                         , plain \"blubb\" ]\n        ]\n  , testGroup \"NoWiki\" [\n          \"quoted block, simple\" =:\n          \"{{{\\nfoo bar\\n  //baz//\\n}}}\"\n          =?> codeBlock \"foo bar\\n  //baz//\"\n        , \"quoted block, curly bracket exception\" =:\n          \"{{{\\nfoo bar\\n  }}}\\nbaz\\n }}}\\n}}}\"\n          =?> codeBlock \"foo bar\\n }}}\\nbaz\\n}}}\"\n        , \"forced line breaks\" =:\n          \"{{{no break!\\\\\\\\here}}} but a break\\\\\\\\here!\"\n          =?> para (code \"no break!\\\\\\\\here\" <> \" but a break\"\n                    <> linebreak <> \"here!\"),\n          \"quoted block, after trailing white space\" =:\n          \"this is a paragraph  \\n{{{\\nfoo bar\\n  //baz//\\n}}}\"\n          =?> para \"this is a paragraph\" <> codeBlock \"foo bar\\n  //baz//\"\n        ]\n  , testGroup \"Images and Links\" [\n          \"image simple\" =:\n          \"{{foo.png}}\" =?> para (image \"foo.png\" \"\" (str \"\"))\n        , \"image with alt text\" =:\n          \"Image of a bar: {{/path/to/bar.png|A Bar}} look at it!\"\n          =?> para (\"Image of a bar: \"\n                    <> image \"/path/to/bar.png\" \"\" (str \"A Bar\") <> \" look at it!\")\n\n        , \"auto link\" =:\n          \"foo http://foo.example.com/bar/baz.html bar\"\n          =?> para (\"foo \"\n                    <> link \"http://foo.example.com/bar/baz.html\" \"\"\n                     (str \"http://foo.example.com/bar/baz.html\")\n                    <> \" bar\")\n        , \"escaped auto link\" =:\n          \"foo ~http://foo.example.com/bar/baz.html bar\"\n          =?> para \"foo http://foo.example.com/bar/baz.html bar\"\n        , \"wiki link simple\" =:\n          \"foo [[http://foo.example.com/foo.png]] bar\"\n          =?> para (\"foo \"\n                    <> link \"http://foo.example.com/foo.png\" \"\"\n                     (str \"http://foo.example.com/foo.png\")\n                    <> \" bar\")\n        , \"wiki link with name\" =:\n          \"foo [[http://foo.example.com/foo.png|my link]] bar\"\n          =?> para (\"foo \"\n                    <> link \"http://foo.example.com/foo.png\" \"\"\n                     (str \"my link\")\n                    <> \" bar\")\n        , \"image link\" =:\n          \"[[http://foo.example.com/|{{foo.png}}]]\"\n          =?> para (link \"http://foo.example.com/\" \"\" (image \"foo.png\" \"\" (str \"\")))\n        ]\n  , testGroup \"Table\" [\n          \"Table with Header\" =:\n          T.unlines [ \"|= Foo |= Bar |= Baz  |\"\n                    , \"| One  | Two  | Three |\"\n                    , \"| 1    | 2    | 3     |\"\n                    , \"| A    | B    | C     |\"\n                    ]\n          =?> simpleTable\n            [plain \"Foo\", plain \"Bar\" , plain \"Baz\"]\n            [[plain \"One\", plain \"Two\" , plain \"Three\"]\n            ,[plain \"1\", plain \"2\" , plain \"3\"]\n            ,[plain \"A\", plain \"B\" , plain \"C\"]]\n        , \"Table without Header\" =:\n          T.unlines [ \"| One  | Two  | Three |\"\n                    , \"| 1    | 2    | 3     |\"\n                    , \"| A    | B    | C     |\"\n                    ]\n          =?> simpleTable [mempty]\n            [[plain \"One\", plain \"Two\" , plain \"Three\"]\n            ,[plain \"1\", plain \"2\" , plain \"3\"]\n            ,[plain \"A\", plain \"B\" , plain \"C\"]]\n        , \"Table without Header, no markers at line ends\" =:\n          T.unlines [ \"| One  | Two  | Three\"\n                    , \"| 1    | 2    | 3\"\n                    , \"| A    | B    | C  \"\n                    ]\n          =?> simpleTable [mempty]\n            [[plain \"One\", plain \"Two\" , plain \"Three\"]\n            ,[plain \"1\", plain \"2\" , plain \"3\"]\n            ,[plain \"A\", plain \"B\" , plain \"C\"]]\n        , \"Table with Header, with formatting\" =:\n          T.unlines [ \"|= **Foo**        |= **Bar** |= **Baz**  |\"\n                    , \"|//one// element  |//second// elt|Three  |\"\n                    , \"| {{{1}}}    | {{{{}}}}    | [[link]]    |\"\n                    ]\n          =?> simpleTable\n            [plain $ strong \"Foo\", plain $ strong \"Bar\" , plain $ strong \"Baz\"]\n            [[plain (emph \"one\" <> \" element\"), plain (emph \"second\" <> \" elt\")\n             ,plain \"Three\"]\n            ,[plain $ code \"1\", plain $ code \"{}\"\n             ,plain $ link \"link\" \"\" (str \"link\")]]\n        ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Docx.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Docx\n   Copyright   : © 2017-2020 Jesse Rosenthal, John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Jesse Rosenthal <jrosenthal@jhu.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the word docx reader.\n-}\nmodule Tests.Readers.Docx (tests) where\n\nimport Codec.Archive.Zip\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as B\nimport qualified Data.Text as T\nimport Data.Maybe\nimport System.IO.Unsafe\nimport Test.Tasty\nimport Test.Tasty.Golden.Advanced\nimport Test.Tasty.HUnit\nimport Tests.Helpers\nimport Text.Pandoc\nimport qualified Text.Pandoc.Class as P\nimport qualified Text.Pandoc.MediaBag as MB\nimport Text.Pandoc.UTF8 as UTF8\n\ndefopts :: ReaderOptions\ndefopts = def{ readerExtensions = getDefaultExtensions \"docx\" }\n\ntestCompare :: String -> FilePath -> FilePath -> TestTree\ntestCompare = testCompareWithOpts defopts\n\ntestCompareWithOpts :: ReaderOptions -> String -> FilePath -> FilePath -> TestTree\ntestCompareWithOpts opts testName docxFP nativeFP =\n  goldenTest\n  testName\n  (do nf <- UTF8.toText <$> BS.readFile nativeFP\n      runIOorExplode (readNative def nf))\n  (do df <- B.readFile docxFP\n      runIOorExplode (readDocx opts df))\n  (nativeDiff nativeFP)\n  (\\a -> runIOorExplode (writeNative def{ writerTemplate = Just mempty} a)\n            >>= BS.writeFile nativeFP . UTF8.fromText)\n\ntestForWarningsWithOptsIO :: ReaderOptions -> String -> FilePath -> [String] -> IO TestTree\ntestForWarningsWithOptsIO opts name docxFile expected = do\n  df <- B.readFile docxFile\n  logs <-  runIOorExplode $ setVerbosity ERROR >> readDocx opts df >> P.getLog\n  let warns = [m | DocxParserWarning m <- logs]\n  return $ test id name (T.unlines warns, unlines expected)\n\ntestForWarningsWithOpts :: ReaderOptions -> String -> FilePath -> [String] -> TestTree\ntestForWarningsWithOpts opts name docxFile expected =\n  unsafePerformIO $ testForWarningsWithOptsIO opts name docxFile expected\n\n-- testForWarnings :: String -> FilePath -> [String] -> TestTree\n-- testForWarnings = testForWarningsWithOpts defopts\n\ngetMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)\ngetMedia archivePath mediaPath = fmap fromEntry . findEntryByPath\n    (\"word/\" ++ mediaPath) . toArchive <$> B.readFile archivePath\n\ncompareMediaPathIO :: FilePath -> MB.MediaBag -> FilePath -> IO Bool\ncompareMediaPathIO mediaPath mediaBag docxPath = do\n  docxMedia <- getMedia docxPath mediaPath\n  let mbBS   = case MB.lookupMedia mediaPath mediaBag of\n                 Just item    -> MB.mediaContents item\n                 Nothing      -> error (\"couldn't find \" ++\n                                        mediaPath ++\n                                        \" in media bag\")\n      docxBS = fromMaybe (error (\"couldn't find \" ++\n                        mediaPath ++\n                        \" in media bag\")) docxMedia\n  return $ mbBS == docxBS\n\ncompareMediaBagIO :: FilePath -> IO Bool\ncompareMediaBagIO docxFile = do\n    df <- B.readFile docxFile\n    mb <- runIOorExplode $ readDocx defopts df >> P.getMediaBag\n    bools <- mapM\n             (\\(fp, _, _) -> compareMediaPathIO fp mb docxFile)\n             (MB.mediaDirectory mb)\n    return $ and bools\n\ntestMediaBagIO :: String -> FilePath -> IO TestTree\ntestMediaBagIO name docxFile = do\n  outcome <- compareMediaBagIO docxFile\n  return $ testCase name (assertBool\n                          (\"Media didn't match media bag in file \" ++ docxFile)\n                          outcome)\n\ntestMediaBag :: String -> FilePath -> TestTree\ntestMediaBag name docxFile = unsafePerformIO $ testMediaBagIO name docxFile\n\ntests :: [TestTree]\ntests = [ testGroup \"document\"\n          [ testCompare\n            \"allow different document.xml file as defined in _rels/.rels\"\n            \"docx/alternate_document_path.docx\"\n            \"docx/alternate_document_path.native\"\n          ]\n        , testGroup \"inlines\"\n          [ testCompare\n            \"font formatting\"\n            \"docx/inline_formatting.docx\"\n            \"docx/inline_formatting.native\"\n          , testCompare\n            \"font formatting with character styles\"\n            \"docx/char_styles.docx\"\n            \"docx/char_styles.native\"\n          , testCompare\n            \"hyperlinks\"\n            \"docx/links.docx\"\n            \"docx/links.native\"\n          , testCompare\n            \"hyperlinks in <w:instrText> tag\"\n            \"docx/instrText_hyperlink.docx\"\n            \"docx/instrText_hyperlink.native\"\n          , testCompare\n            \"nested fields with <w:instrText> tag\"\n            \"docx/nested_instrText.docx\"\n            \"docx/nested_instrText.native\"\n          , testCompare\n            \"empty fields with <w:instrText> tag\"\n            \"docx/empty_field.docx\"\n            \"docx/empty_field.native\"\n          , testCompare\n            \"pageref hyperlinks in <w:instrText> tag\"\n            \"docx/pageref.docx\"\n            \"docx/pageref.native\"\n          , testCompare\n            \"inline image\"\n            \"docx/image.docx\"\n            \"docx/image_no_embed.native\"\n          , testCompare\n            \"VML image\"\n            \"docx/image_vml.docx\"\n            \"docx/image_vml.native\"\n          , testCompare\n            \"VML image as object\"\n            \"docx/image_vml_as_object.docx\"\n            \"docx/image_vml_as_object.native\"\n          , testCompare\n            \"inline image in links\"\n            \"docx/inline_images.docx\"\n            \"docx/inline_images.native\"\n          , testCompare\n            \"handling unicode input\"\n            \"docx/unicode.docx\"\n            \"docx/unicode.native\"\n          , testCompare\n            \"literal tabs\"\n            \"docx/tabs.docx\"\n            \"docx/tabs.native\"\n          , testCompare\n            \"special punctuation\"\n            \"docx/special_punctuation.docx\"\n            \"docx/special_punctuation.native\"\n          , testCompare\n            \"normalizing inlines\"\n            \"docx/normalize.docx\"\n            \"docx/normalize.native\"\n          , testCompare\n            \"normalizing inlines deep inside blocks\"\n            \"docx/deep_normalize.docx\"\n            \"docx/deep_normalize.native\"\n          , testCompare\n            \"move trailing spaces outside of formatting\"\n            \"docx/trailing_spaces_in_formatting.docx\"\n            \"docx/trailing_spaces_in_formatting.native\"\n          , testCompare\n            \"remove trailing spaces from last inline\"\n            \"docx/trim_last_inline.docx\"\n            \"docx/trim_last_inline.native\"\n          , testCompare\n            \"inline code (with VerbatimChar style)\"\n            \"docx/inline_code.docx\"\n            \"docx/inline_code.native\"\n          , testCompare\n            \"inline code in subscript and superscript\"\n            \"docx/verbatim_subsuper.docx\"\n            \"docx/verbatim_subsuper.native\"\n          , testCompare\n            \"inlines inside of Structured Document Tags\"\n            \"docx/sdt_elements.docx\"\n            \"docx/sdt_elements.native\"\n          , testCompare\n            \"Structured Document Tags in footnotes\"\n            \"docx/sdt_in_footnote.docx\"\n            \"docx/sdt_in_footnote.native\"\n          , testCompare\n            \"nested Structured Document Tags\"\n            \"docx/nested_sdt.docx\"\n            \"docx/nested_sdt.native\"\n          , testCompare\n            \"nested Smart Tags\"\n            \"docx/nested_smart_tags.docx\"\n            \"docx/nested_smart_tags.native\"\n          , testCompare\n            \"remove anchor spans with nothing pointing to them\"\n            \"docx/unused_anchors.docx\"\n            \"docx/unused_anchors.native\"\n          , testCompare\n            \"collapse overlapping targets (anchor spans)\"\n            \"docx/overlapping_targets.docx\"\n            \"docx/overlapping_targets.native\"\n          , testCompare\n            \"anchor in header after anchor\"\n            \"docx/anchor_header_after_anchor.docx\"\n            \"docx/anchor_header_after_anchor.native\"\n          , testCompare\n            \"text in shape format\"\n            \"docx/text_in_shape_format.docx\"\n            \"docx/text_in_shape_format.native\"\n          , testCompare\n            \"image inside textbox content\"\n            \"docx/textbox_image.docx\"\n            \"docx/textbox_image.native\"\n          , testCompare\n            \"image inside textbox content with duplicate encoding\"\n            \"docx/textbox_image_duplicate_encoding.docx\"\n            \"docx/textbox_image_duplicate_encoding.native\"\n          , testCompare\n            \"image with textbox caption in same paragraph\"\n            \"docx/image_with_textbox_caption.docx\"\n            \"docx/image_with_textbox_caption.native\"\n          ]\n        , testGroup \"blocks\"\n          [ testCompare\n            \"headers\"\n            \"docx/headers.docx\"\n            \"docx/headers.native\"\n          , testCompare\n            \"headers already having auto identifiers\"\n            \"docx/already_auto_ident.docx\"\n            \"docx/already_auto_ident.native\"\n          , testCompare\n            \"avoid zero-level headers\"\n            \"docx/0_level_headers.docx\"\n            \"docx/0_level_headers.native\"\n          , testCompare\n            \"nested anchor spans in header\"\n            \"docx/nested_anchors_in_header.docx\"\n            \"docx/nested_anchors_in_header.native\"\n          , testCompare\n            \"single numbered item not made into list\"\n            \"docx/numbered_header.docx\"\n            \"docx/numbered_header.native\"\n          , testCompare\n            \"enumerated headers not made into numbered list\"\n            \"docx/enumerated_headings.docx\"\n            \"docx/enumerated_headings.native\"\n          , testCompare\n            \"i18n blocks (headers and blockquotes)\"\n            \"docx/i18n_blocks.docx\"\n            \"docx/i18n_blocks.native\"\n          , testCompare\n            \"lists\"\n            \"docx/lists.docx\"\n            \"docx/lists.native\"\n          , testCompare\n            \"compact lists\"\n            \"docx/lists-compact.docx\"\n            \"docx/lists-compact.native\"\n          , testCompare\n            \"lists with level overrides\"\n            \"docx/lists_level_override.docx\"\n            \"docx/lists_level_override.native\"\n          , testCompare\n            \"lists continuing after interruption\"\n            \"docx/lists_continuing.docx\"\n            \"docx/lists_continuing.native\"\n          , testCompare\n            \"lists restarting after interruption\"\n            \"docx/lists_restarting.docx\"\n            \"docx/lists_restarting.native\"\n          , testCompare\n            \"sublists reset numbering to 1\"\n            \"docx/lists_sublist_reset.docx\"\n            \"docx/lists_sublist_reset.native\"\n          , testCompare\n            \"definition lists\"\n            \"docx/definition_list.docx\"\n            \"docx/definition_list.native\"\n          , testCompare\n            \"task lists\"\n            \"docx/task_list.docx\"\n            \"docx/task_list.native\"\n          , testCompare\n            \"custom defined lists in styles\"\n            \"docx/german_styled_lists.docx\"\n            \"docx/german_styled_lists.native\"\n          , testCompare\n            \"user deletes bullet after list item (=> part of item par)\"\n            \"docx/dummy_item_after_list_item.docx\"\n            \"docx/dummy_item_after_list_item.native\"\n          , testCompare\n            \"user deletes bullet after par (=> new par)\"\n            \"docx/dummy_item_after_paragraph.docx\"\n            \"docx/dummy_item_after_paragraph.native\"\n          , testCompare\n            \"footnotes and endnotes\"\n            \"docx/notes.docx\"\n            \"docx/notes.native\"\n          , testCompare\n            \"links in footnotes and endnotes\"\n            \"docx/link_in_notes.docx\"\n            \"docx/link_in_notes.native\"\n          , testCompare\n            \"blockquotes (parsing indent as blockquote)\"\n            \"docx/block_quotes.docx\"\n            \"docx/block_quotes.native\"\n          , testCompare\n            \"blockquotes (parsing indent relative to the indent of the parent style as blockquote)\"\n            \"docx/relative_indentation_blockquotes.docx\"\n            \"docx/relative_indentation_blockquotes.native\"\n          , testCompare\n            \"hanging indents\"\n            \"docx/hanging_indent.docx\"\n            \"docx/hanging_indent.native\"\n          , testCompare\n            \"tables\"\n            \"docx/tables.docx\"\n            \"docx/tables.native\"\n          , testCompare\n            \"tables with lists in cells\"\n            \"docx/table_with_list_cell.docx\"\n            \"docx/table_with_list_cell.native\"\n          , testCompare\n            \"a table with gridBefore\"\n            \"docx/table_gridbefore.docx\"\n            \"docx/table_gridbefore.native\"\n          , testCompare\n            \"a table with a header which contains rowspans greater than 1\"\n            \"docx/table_header_rowspan.docx\"\n            \"docx/table_header_rowspan.native\"\n          , testCompare\n            \"tables with one row\"\n            \"docx/table_one_row.docx\"\n            \"docx/table_one_row.native\"\n          , testCompare\n            \"tables with just one row, which is a header\"\n            \"docx/table_one_header_row.docx\"\n            \"docx/table_one_header_row.native\"\n          , testCompare\n            \"tables with variable width\"\n            \"docx/table_variable_width.docx\"\n            \"docx/table_variable_width.native\"\n          , testCompare\n            \"tables with captions which contain a Table field\"\n            \"docx/table_captions_with_field.docx\"\n            \"docx/table_captions_with_field.native\"\n          , testCompare\n            \"tables with captions which don't contain a Table field\"\n            \"docx/table_captions_no_field.docx\"\n            \"docx/table_captions_no_field.native\"\n          , testCompare\n            \"code block\"\n            \"docx/codeblock.docx\"\n            \"docx/codeblock.native\"\n          , testCompare\n            \"combine adjacent code blocks\"\n            \"docx/adjacent_codeblocks.docx\"\n            \"docx/adjacent_codeblocks.native\"\n          , testCompare\n            \"dropcap paragraphs\"\n            \"docx/drop_cap.docx\"\n            \"docx/drop_cap.native\"\n          ]\n        , testGroup \"citations\"\n          [ testCompare\n            \"zotero with -citations\"\n            \"docx/zotero_citations.docx\"\n            \"docx/zotero_citations_minus.native\"\n          , testCompareWithOpts def{readerExtensions =\n                  extensionsFromList [Ext_citations]}\n            \"zotero with +citations\"\n            \"docx/zotero_citations.docx\"\n            \"docx/zotero_citations_plus.native\"\n          , testCompare\n            \"mendeley with -citations\"\n            \"docx/mendeley_citations.docx\"\n            \"docx/mendeley_citations_minus.native\"\n          , testCompareWithOpts def{readerExtensions =\n                  extensionsFromList [Ext_citations]}\n            \"mendeley with +citations\"\n            \"docx/mendeley_citations.docx\"\n            \"docx/mendeley_citations_plus.native\"\n          ]\n        , testGroup \"track changes\"\n          [ testCompare\n            \"insertion (default)\"\n            \"docx/track_changes_insertion.docx\"\n            \"docx/track_changes_insertion_accept.native\"\n          , testCompareWithOpts def{readerTrackChanges=AcceptChanges}\n            \"insert insertion (accept)\"\n            \"docx/track_changes_insertion.docx\"\n            \"docx/track_changes_insertion_accept.native\"\n          , testCompareWithOpts def{readerTrackChanges=RejectChanges}\n            \"remove insertion (reject)\"\n            \"docx/track_changes_insertion.docx\"\n            \"docx/track_changes_insertion_reject.native\"\n          , testCompare\n            \"deletion (default)\"\n            \"docx/track_changes_deletion.docx\"\n            \"docx/track_changes_deletion_accept.native\"\n          , testCompareWithOpts def{readerTrackChanges=AcceptChanges}\n            \"remove deletion (accept)\"\n            \"docx/track_changes_deletion.docx\"\n            \"docx/track_changes_deletion_accept.native\"\n          , testCompareWithOpts def{readerTrackChanges=RejectChanges}\n            \"insert deletion (reject)\"\n            \"docx/track_changes_deletion.docx\"\n            \"docx/track_changes_deletion_reject.native\"\n          , testCompareWithOpts def{readerTrackChanges=AllChanges}\n            \"keep insertion (all)\"\n            \"docx/track_changes_deletion.docx\"\n            \"docx/track_changes_deletion_all.native\"\n          , testCompareWithOpts def{readerTrackChanges=AllChanges}\n            \"keep deletion (all)\"\n            \"docx/track_changes_deletion.docx\"\n            \"docx/track_changes_deletion_all.native\"\n          , testCompareWithOpts def{readerTrackChanges=AcceptChanges}\n            \"move text (accept)\"\n            \"docx/track_changes_move.docx\"\n            \"docx/track_changes_move_accept.native\"\n          , testCompareWithOpts def{readerTrackChanges=RejectChanges}\n            \"move text (reject)\"\n            \"docx/track_changes_move.docx\"\n            \"docx/track_changes_move_reject.native\"\n          , testCompareWithOpts def{readerTrackChanges=AllChanges}\n            \"move text (all)\"\n            \"docx/track_changes_move.docx\"\n            \"docx/track_changes_move_all.native\"\n          , testCompareWithOpts def{readerTrackChanges=AcceptChanges}\n            \"comments (accept -- no comments)\"\n            \"docx/comments.docx\"\n            \"docx/comments_no_comments.native\"\n          , testCompareWithOpts def{readerTrackChanges=RejectChanges}\n            \"comments (reject -- comments)\"\n            \"docx/comments.docx\"\n            \"docx/comments_no_comments.native\"\n          , testCompareWithOpts def{readerTrackChanges=AllChanges}\n            \"comments (all comments)\"\n            \"docx/comments.docx\"\n            \"docx/comments.native\"\n          , testCompareWithOpts def{readerTrackChanges=AcceptChanges}\n            \"paragraph insertion/deletion (accept)\"\n            \"docx/paragraph_insertion_deletion.docx\"\n            \"docx/paragraph_insertion_deletion_accept.native\"\n          , testCompareWithOpts def{readerTrackChanges=RejectChanges}\n            \"paragraph insertion/deletion (reject)\"\n            \"docx/paragraph_insertion_deletion.docx\"\n            \"docx/paragraph_insertion_deletion_reject.native\"\n          , testCompareWithOpts def{readerTrackChanges=AllChanges}\n            \"paragraph insertion/deletion (all)\"\n            \"docx/paragraph_insertion_deletion.docx\"\n            \"docx/paragraph_insertion_deletion_all.native\"\n          , testCompareWithOpts def{readerTrackChanges=AllChanges}\n            \"paragraph insertion/deletion (all)\"\n            \"docx/track_changes_scrubbed_metadata.docx\"\n            \"docx/track_changes_scrubbed_metadata.native\"\n          , testForWarningsWithOpts def{readerTrackChanges=AcceptChanges}\n            \"comment warnings (accept -- no warnings)\"\n            \"docx/comments_warning.docx\"\n            []\n          , testForWarningsWithOpts def{readerTrackChanges=RejectChanges}\n            \"comment warnings (reject -- no warnings)\"\n            \"docx/comments_warning.docx\"\n            []\n          , testForWarningsWithOpts def{readerTrackChanges=AllChanges}\n            \"comment warnings (all)\"\n            \"docx/comments_warning.docx\"\n            [\"Docx comment 1 will not retain formatting\"]\n          , testForWarningsWithOpts def{readerTrackChanges=AllChanges,\n                                        readerExtensions=extensionsFromList [Ext_styles]}\n            \"comments (with styles extension)\"\n            \"docx/comments.docx\"\n            []\n          ]\n        , testGroup \"media\"\n          [ testMediaBag\n            \"image extraction\"\n            \"docx/image.docx\"\n          , testMediaBag\n            \"image inside textbox content populates media bag\"\n            \"docx/textbox_image.docx\"\n          , testMediaBag\n            \"image inside textbox content with duplicate encoding populates media bag\"\n            \"docx/textbox_image_duplicate_encoding.docx\"\n          , testMediaBag\n            \"image with textbox caption in same paragraph populates media bag\"\n            \"docx/image_with_textbox_caption.docx\"\n          ]\n        , testGroup \"custom styles\"\n          [ testCompare\n            \"custom styles (`+styles`) not enabled (default)\"\n            \"docx/custom-style-reference.docx\"\n            \"docx/custom-style-no-styles.native\"\n          , testCompareWithOpts\n            def{readerExtensions=extensionsFromList [Ext_styles]}\n            \"custom styles (`+styles`) enabled\"\n            \"docx/custom-style-reference.docx\"\n            \"docx/custom-style-with-styles.native\"\n          , testCompareWithOpts\n            def{readerExtensions=extensionsFromList [Ext_styles]}\n            \"custom styles (`+styles`): Compact style is removed from output\"\n            \"docx/compact-style-removal.docx\"\n            \"docx/compact-style-removal.native\"\n          ]\n        , testGroup \"metadata\"\n          [ testCompareWithOpts def{readerStandalone=True}\n            \"metadata fields\"\n            \"docx/metadata.docx\"\n            \"docx/metadata.native\"\n          , testCompareWithOpts def{readerStandalone=True}\n            \"stop recording metadata with normal text\"\n            \"docx/metadata_after_normal.docx\"\n            \"docx/metadata_after_normal.native\"\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/DokuWiki.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TupleSections #-}\n{- |\n   Module      : Tests.Readers.DokuWiki\n   Copyright   : © 2018-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Krotov\n   Stability   : alpha\n   Portability : portable\n\nTests for DokuWiki reader.\n-}\nmodule Tests.Readers.DokuWiki (tests) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\ndokuwiki :: Text -> Pandoc\ndokuwiki = purely $ readDokuWiki def{ readerStandalone = True }\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test dokuwiki\n\ntests :: [TestTree]\ntests = [ testGroup \"inlines\"\n          [ \"Bold\" =:\n            \"**bold**\" =?>\n            para (strong \"bold\")\n          , \"Italic\" =:\n            \"//italic//\" =?>\n            para (emph \"italic\")\n          , \"Underlined\" =:\n            \"__underlined__\" =?>\n            para (underline \"underlined\")\n          , \"Monospaced\" =:\n            \"''monospaced''\" =?>\n            para (code \"monospaced\")\n          , \"Monospaced with nowiki\" =:\n            \"''%%monospaced%%''\" =?>\n            para (code \"monospaced\")\n          , \"Combined\" =:\n            \"**__//''combine''//__**\" =?>\n            para (strong $ underline $ emph $ code \"combine\")\n          , \"Nowiki\" =:\n            T.unlines [ \"<nowiki>\"\n                      , \"This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it.\"\n                      , \"</nowiki>\"\n                      ] =?>\n            para \"This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it.\"\n          , \"Percent\" =:\n            \"The same is true for %%//__this__ text// with a smiley ;-)%%.\" =?>\n            para \"The same is true for //__this__ text// with a smiley ;-).\"\n          , \"Subscript\" =:\n            \"<sub>subscript</sub>\" =?>\n            para (subscript \"subscript\")\n          , \"Superscript\" =:\n            \"<sup>superscript</sup>\" =?>\n            para (superscript \"superscript\")\n          , \"Deleted\" =:\n            \"<del>deleted</del>\" =?>\n            para (strikeout \"deleted\")\n          , \"Inline code\" =:\n            \"foo <code java>public static void main</code> bar\" =?>\n            para (text \"foo\") <> codeBlockWith (\"\", [\"java\"], []) \"public static void main\"\n              <> para (text \"bar\")\n          , \"Inline file\" =:\n            \"foo <file></code></file> bar\" =?>\n            para (text \"foo\") <> codeBlock \"</code>\" <> para (text \"bar\")\n          , \"Inline HTML\" =:\n            \"<html>\\nThis is some <span style=\\\"color:red;font-size:150%;\\\">inline HTML</span>\\n</html>\" =?>\n            para (rawInline \"html\" \"\\nThis is some <span style=\\\"color:red;font-size:150%;\\\">inline HTML</span>\\n\")\n          , \"Inline PHP\" =:\n            \"<php>echo '<p>Hello World</p>';</php>\" =?>\n            para (rawInline \"html\" \"<?php echo '<p>Hello World</p>'; ?>\")\n          , \"Linebreak\" =:\n            T.unlines [ \"This is some text with some linebreaks\\\\\\\\ Note that the\"\n                      , \"two backslashes are only recognized at the end of a line\\\\\\\\\"\n                      , \"or followed by\\\\\\\\ a whitespace \\\\\\\\this happens without it.\"\n                      ] =?>\n            para (\"This is some text with some linebreaks\" <> linebreak <> \"Note that the\\n\" <>\n                  \"two backslashes are only recognized at the end of a line\" <> linebreak <>\n                  \"or followed by\" <> linebreak <> \"a whitespace \\\\\\\\this happens without it.\")\n          , testGroup \"External links\"\n            [ \"Autolink\" =:\n              \"http://www.google.com\" =?>\n              para (link \"http://www.google.com\" \"\" (str \"http://www.google.com\"))\n            , \"Link without description\" =:\n              \"[[https://example.com]]\" =?>\n              para (link \"https://example.com\" \"\" (str \"https://example.com\"))\n            , \"Link with description\" =:\n              \"[[http://www.google.com|This Link points to google]]\" =?>\n              para (link \"http://www.google.com\" \"\" (text \"This Link points to google\"))\n            , \"Trim whitespace around link and description\" =:\n              \"[[   http://www.google.com    |   This Link points to google   ]]\" =?>\n              para (link \"http://www.google.com\" \"\" (text \"This Link points to google\"))\n            , \"Email address\" =:\n              \"<andi@splitbrain.org>\" =?>\n              para (link \"mailto:andi@splitbrain.org\" \"\" (str \"andi@splitbrain.org\"))\n            ]\n          , testGroup \"Internal links\"\n            [ \"Current namespace\" =:\n              \"[[example]]\" =?>\n              para (link \"example\" \"\" (str \"example\"))\n            , \"Current namespace starting with dot\" =:\n              \"[[.example]]\" =?>\n              para (link \"example\" \"\" (str \".example\"))\n            , \"Current namespace starting with dot and colon\" =:\n              \"[[.:example]]\" =?>\n              para (link \"example\" \"\" (str \"example\"))\n            , \"Root namespace\" =:\n              \"[[:example]]\" =?>\n              para (link \"/example\" \"\" (str \"example\"))\n            , \"Parent namespace\" =:\n              \"[[..example]]\" =?>\n              para (link \"../example\" \"\" (str \"..example\"))\n            , \"Parent namespace with colon\" =:\n              \"[[..:example]]\" =?>\n              para (link \"../example\" \"\" (str \"example\"))\n            , \"Beneath the root namespace\" =:\n              \"[[wiki:example]]\" =?>\n              para (link \"/wiki/example\" \"\" (str \"example\"))\n            , \"Explicitly beneath the root namespace\" =:\n              \"[[:wiki:example]]\" =?>\n              para (link \"/wiki/example\" \"\" (str \"example\"))\n            ]\n          , testGroup \"Interwiki links\"\n            [ \"Interwiki without description\" =:\n              \"[[doku>DokuWiki]]\" =?>\n              para (link \"https://www.dokuwiki.org/DokuWiki\" \"\" (str \"DokuWiki\"))\n            , \"Interwiki link with description\" =:\n              \"[[doku>toolbar|quickbuttons]]\" =?>\n              para (link \"https://www.dokuwiki.org/toolbar\" \"\" (str \"quickbuttons\"))\n            ]\n          , \"Footnote\" =:\n            \"((This is a footnote))\" =?>\n            para (note (para \"This is a footnote\"))\n          , testGroup \"Images\"\n            [ \"Image\" =:\n              \"{{image.jpg}}\" =?>\n              para (image \"image.jpg\" \"\" (str \"image.jpg\"))\n            , \"Image with caption\" =:\n              \"{{image.png|This is the caption}}\" =?>\n              para (image \"image.png\" \"\" \"This is the caption\")\n            , \"Image with } in caption\" =:\n              \"{{image.png|There is an } in the caption}}\" =?>\n              para (image \"image.png\" \"\" \"There is an } in the caption\")\n            , \"Wiki namespace starting with dot\" =:\n              \"{{.wiki:image.jpg}}\" =?>\n              para (image \"wiki/image.jpg\" \"\" (str \"image.jpg\"))\n            , \"Left aligned image\" =:\n              \"{{wiki:dokuwiki-128.png }}\" =?>\n              para (imageWith (\"\", [\"align-left\"], []) \"/wiki/dokuwiki-128.png\" \"\" (str \"dokuwiki-128.png\"))\n            , \"Right aligned image\" =:\n              \"{{ wiki:dokuwiki-128.png}}\" =?>\n              para (imageWith (\"\", [\"align-right\"], []) \"/wiki/dokuwiki-128.png\" \"\" (str \"dokuwiki-128.png\"))\n            , \"Centered image\" =:\n              \"{{ wiki:dokuwiki-128.png }}\" =?>\n              para (imageWith (\"\", [\"align-center\"], []) \"/wiki/dokuwiki-128.png\" \"\" (str \"dokuwiki-128.png\"))\n            , \"Image with width\" =:\n              \"{{wiki:dokuwiki-128.png?50}}\" =?>\n              para (imageWith (\"\", [], [(\"width\", \"50\"), (\"query\", \"?50\")]) \"/wiki/dokuwiki-128.png\" \"\" (str \"dokuwiki-128.png\"))\n            , \"Image with width and height\" =:\n              \"{{wiki:dokuwiki-128.png?nocache&50x100}}\" =?>\n              para (imageWith (\"\", [], [(\"width\", \"50\"), (\"height\", \"100\"), (\"query\", \"?nocache&50x100\")]) \"/wiki/dokuwiki-128.png\" \"\" (str \"dokuwiki-128.png\"))\n            , \"Linkonly\" =:\n              \"{{wiki:dokuwiki-128.png?linkonly}}\" =?>\n              para (link \"/wiki/dokuwiki-128.png\" \"\" (str \"dokuwiki-128.png\"))\n            ]\n          , \"Ignore ~~NOTOC~~\" =:\n            \"Here is a ~~NOTOC~~ macro\" =?>\n            para \"Here is a macro\"\n          , \"Ignore ~~NOCACHE~~\" =:\n            \"Here is a ~~NOCACHE~~ macro\" =?>\n            para \"Here is a macro\"\n          ]\n        , testGroup \"Sectioning\"\n          [ \"Headline level 1\" =:\n            \"====== Headline Level 1 ======\" =?>\n            header 1 \"Headline Level 1\"\n          , \"Headline level 2\" =:\n            \"===== Headline Level 2 =====\" =?>\n            header 2 \"Headline Level 2\"\n          , \"Headline level 3\" =:\n            \"==== Headline Level 3 ====\" =?>\n            header 3 \"Headline Level 3\"\n          , \"Headline level 4\" =:\n            \"=== Headline Level 4 ===\" =?>\n            header 4 \"Headline Level 4\"\n          , \"Headline level 5\" =:\n            \"== Headline Level 5 ==\" =?>\n            header 5 \"Headline Level 5\"\n          , \"Only two closing = are required\" =:\n            \"====== Headline Level 1 ==\" =?>\n            header 1 \"Headline Level 1\"\n          , \"One closing = is not enough\" =:\n            \"====== Headline Level 1 =\" =?>\n            para \"====== Headline Level 1 =\"\n          , \"One closing = is not enough\" =:\n            \"== Headline with = sign ==\" =?>\n            header 5 \"Headline with = sign\"\n          ]\n        , \"Horizontal line\" =:\n          \"----\" =?>\n          horizontalRule\n        , testGroup \"Lists\"\n          [ \"Unordered list\" =:\n            T.unlines [ \"  * This is a list\"\n                      , \"  * The second item\"\n                      , \"    * You may have different levels\"\n                      , \"  * Another item\"\n                      ] =?>\n            bulletList [ plain \"This is a list\"\n                       , plain \"The second item\" <>\n                         bulletList [ plain \"You may have different levels\" ]\n                       , plain \"Another item\"\n                       ]\n          , \"Ordered list\" =:\n            T.unlines [ \"  - The same list but ordered\"\n                      , \"  - Another item\"\n                      , \"    - Just use indentation for deeper levels\"\n                      , \"  - That's it\"\n                      ] =?>\n            orderedList [ plain \"The same list but ordered\"\n                        , plain \"Another item\" <>\n                          orderedList [ plain \"Just use indentation for deeper levels\" ]\n                        , plain \"That's it\"\n                        ]\n          , \"Multiline list items\" =: -- https://www.dokuwiki.org/faq:lists\n            T.unlines [ \"  - first item\"\n                      , \"  - second item with linebreak\\\\\\\\ second line\"\n                      , \"  - third item with code: <code>\"\n                      , \"some code\"\n                      , \"comes here\"\n                      , \"</code>\"\n                      , \"  - fourth item\"\n                      ] =?>\n            orderedList [ plain \"first item\"\n                        , plain (\"second item with linebreak\" <> linebreak <> \" second line\")\n                        , plain \"third item with code: \" <> codeBlock \"some code\\ncomes here\\n\"\n                        , plain \"fourth item\"\n                        ]\n          ]\n        , \"Block HTML\" =:\n          T.unlines [ \"<HTML>\"\n                    , \"<p style=\\\"border:2px dashed red;\\\">And this is some block HTML</p>\"\n                    , \"</HTML>\"\n                    ] =?>\n          rawBlock \"html\" \"<p style=\\\"border:2px dashed red;\\\">And this is some block HTML</p>\\n\"\n        , \"Block PHP\" =:\n          T.unlines [ \"<PHP>\"\n                    , \"echo '<p>Hello World</p>';\"\n                    , \"</PHP>\"\n                    ] =?>\n          rawBlock \"html\" \"<?php echo '<p>Hello World</p>';\\n ?>\"\n        , \"Quote\" =:\n          T.unlines [ \"> foo\"\n                    , \">no space is required after >\"\n                    , \"> bar\"\n                    , \">> baz\"\n                    , \"> bat\"\n                    ] =?>\n          blockQuote (plain (text \"foo\" <> linebreak <>\n                        text \"no space is required after >\" <> linebreak <>\n                        text \"bar\") <>\n                      blockQuote (plain \"baz\") <>\n                      plain \"bat\")\n        , \"Code block\" =:\n          T.unlines [ \"<code>\"\n                    , \"foo bar baz\"\n                    , \"</code>\"\n                    ] =?>\n          codeBlock \"foo bar baz\\n\"\n        , \"Java code block\" =:\n          T.unlines [ \"<code java>\"\n                    , \"public static void main\"\n                    , \"</code>\"\n                    ] =?>\n          codeBlockWith (\"\", [\"java\"], []) \"public static void main\\n\"\n        , \"File with filename and no language\" =:\n          T.unlines [ \"<file - foo.bar>\"\n                    , \"file contents\"\n                    , \"</file>\"\n                    ] =?>\n          codeBlock \"file contents\\n\"\n        , \"Table\" =:\n          T.unlines [ \"| foo | bar |\"\n                    , \"| bat | baz |\"\n                    ] =?>\n          simpleTable [] [[plain \"foo\", plain \"bar\"]\n                         ,[plain \"bat\", plain \"baz\"]]\n        , \"Table with header\" =:\n          T.unlines [ \"^ foo ^ bar ^\"\n                    , \"| bat | baz |\"\n                    ] =?>\n          simpleTable [plain \"foo\", plain \"bar\"] [[plain \"bat\", plain \"baz\"]]\n        , \"Table with alignment\" =:\n          T.unlines [ \"^ 0  ^  1  ^  2 ^ 3 ^\"\n                    , \"| a  | b   | c  |d  |\"\n                    ] =?>\n          table emptyCaption\n                (map (, ColWidthDefault) [AlignLeft, AlignCenter, AlignRight, AlignDefault])\n                (TableHead nullAttr\n                          [Row nullAttr . map (simpleCell . plain) $ [\"0\", \"1\", \"2\", \"3\"]])\n                [TableBody nullAttr 0 []\n                          [Row nullAttr . map (simpleCell . plain) $ [\"a\", \"b\", \"c\", \"d\"]]]\n                (TableFoot nullAttr [])\n        , \"Table with colspan\" =:\n          T.unlines [ \"^ 0,0 ^ 0,1 ^ 0,2 ^\"\n                    , \"| 1,0 | 1,1 ||\"\n                    , \"| 2,0 | 2,1 | 2,2 |\"\n                    ] =?>\n          simpleTable [plain \"0,0\", plain \"0,1\", plain \"0,2\"]\n                      [[plain \"1,0\", plain \"1,1\", mempty]\n                      ,[plain \"2,0\", plain \"2,1\", plain \"2,2\"]\n                      ]\n        , \"Indented code block\" =:\n          T.unlines [ \"foo\"\n                    , \"  bar\"\n                    , \"    bat\"\n                    , \"baz\"\n                    ] =?>\n          para \"foo\" <>\n          codeBlock \"bar\\n  bat\\n\" <>\n          para \"baz\"\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/EPUB.hs",
    "content": "{- |\n   Module      : Tests.Readers.EPUB\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.eu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the EPUB mediabag.\n-}\nmodule Tests.Readers.EPUB (tests) where\n\nimport qualified Data.ByteString.Lazy as BL\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit\nimport qualified Text.Pandoc.Class as P\nimport Text.Pandoc.MediaBag (MediaBag, mediaDirectory)\nimport Text.Pandoc.Options\nimport Text.Pandoc.Readers.EPUB\n\ngetMediaBag :: FilePath -> IO MediaBag\ngetMediaBag fp = do\n  bs <- BL.readFile fp\n  P.runIOorExplode $ do\n    readEPUB def bs\n    P.getMediaBag\n\ntestMediaBag :: FilePath -> [(String, String, Int)] -> IO ()\ntestMediaBag fp bag = do\n  actBag <- mediaDirectory <$> getMediaBag fp\n  assertBool (show \"MediaBag did not match:\\nExpected: \"\n             ++ show bag\n             ++ \"\\nActual: \"\n             ++ show actBag)\n             (actBag == packBag bag)\n  where\n    packBag = map $ \\(x, y, z) -> (x, T.pack y, z)\n\nfeaturesBag :: [(String, String, Int)]\nfeaturesBag = [(\"img/check.gif\",\"image/gif\",1340)\n              ,(\"img/check.jpg\",\"image/jpeg\",2661)\n              ,(\"img/check.png\",\"image/png\",2815)\n              ,(\"img/multiscripts_and_greek_alphabet.png\",\"image/png\",10060)\n              ]\n\n-- with additional meta tag for cover in EPUB2 format\nepub3CoverBag :: [(String, String, Int)]\nepub3CoverBag = [(\"wasteland-cover.jpg\",\"image/jpeg\", 16586)]\n\nepub3NoCoverBag :: [(String, String, Int)]\nepub3NoCoverBag = [(\"img/check.gif\",\"image/gif\",1340)\n                  ,(\"img/check.jpg\",\"image/jpeg\",2661)\n                  ,(\"img/check.png\",\"image/png\",2815)\n                  ]\n\n-- content.opf uses the word `picture` to refer to the cover as much as validly possible\n-- to check if references are resolved correctly\nepub2PictureBag :: [(String, String, Int)]\nepub2PictureBag = [(\"image/image.jpg\",\"image/jpeg\",9713)]\n\n-- content.opf contains the word `cover` as much as possible, to check if possible multiple matches cause errors\nepub2CoverBag :: [(String, String, Int)]\nepub2CoverBag = [(\"image/cover.jpg\",\"image/jpeg\",9713)]\n\nepub2NoCoverBag :: [(String, String, Int)]\nepub2NoCoverBag = []\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"EPUB Mediabag\"\n    [ testCase \"features bag\"\n      (testMediaBag \"epub/img.epub\" featuresBag),\n      testCase \"EPUB3 cover bag\"\n      (testMediaBag \"epub/wasteland.epub\" epub3CoverBag),\n      testCase \"EPUB3 no cover bag\"\n      (testMediaBag \"epub/img_no_cover.epub\" epub3NoCoverBag),\n      testCase \"EPUB2 picture bag\"\n      (testMediaBag \"epub/epub2_picture.epub\" epub2PictureBag),\n      testCase \"EPUB2 cover bag\"\n      (testMediaBag \"epub/epub2_cover.epub\" epub2CoverBag),\n      testCase \"EPUB2 no cover bag\"\n      (testMediaBag \"epub/epub2_no_cover.epub\" epub2NoCoverBag)\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/FB2.hs",
    "content": "{- |\n   Module      : Tests.Readers.FB2\n   Copyright   : © 2018-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : © 2018-2020 Alexander Krotov <ilabdsf@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nTests for the FB2 reader.\n-}\nmodule Tests.Readers.FB2 (tests) where\n\nimport Test.Tasty\nimport Tests.Helpers\nimport Test.Tasty.Golden (goldenVsString)\nimport qualified Data.ByteString as BS\nimport Text.Pandoc\nimport Text.Pandoc.UTF8 (toText, fromStringLazy)\nimport Data.Text (Text, unpack)\nimport System.FilePath (replaceExtension)\n\nfb2ToNative :: Text -> Text\nfb2ToNative = purely (writeNative def{ writerTemplate = Just mempty }) . purely (readFB2 def)\n\nfb2Test :: TestName -> FilePath -> TestTree\nfb2Test name path = goldenVsString name native\n  (fromStringLazy . filter (/='\\r') . unpack . fb2ToNative . toText\n    <$> BS.readFile path)\n  where native = replaceExtension path \".native\"\n\ntests :: [TestTree]\ntests = [ fb2Test \"Emphasis\" \"fb2/reader/emphasis.fb2\"\n        , fb2Test \"Titles\" \"fb2/reader/titles.fb2\"\n        , fb2Test \"Epigraph\" \"fb2/reader/epigraph.fb2\"\n        , fb2Test \"Poem\" \"fb2/reader/poem.fb2\"\n        , fb2Test \"Meta\" \"fb2/reader/meta.fb2\"\n        , fb2Test \"Notes\" \"fb2/reader/notes.fb2\"\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/HTML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.HTML\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the HTML reader.\n-}\nmodule Tests.Readers.HTML (tests) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.QuickCheck\nimport Test.Tasty.Options (IsOption(defaultValue))\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Shared (isHeaderBlock)\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Walk (walk)\n\nhtml :: Text -> Pandoc\nhtml = purely $ readHtml def\n\nhtmlNativeDivs :: Text -> Pandoc\nhtmlNativeDivs = purely $ readHtml def { readerExtensions = enableExtension Ext_native_divs $ readerExtensions def }\n\nmakeRoundTrip :: Block -> Block\nmakeRoundTrip CodeBlock{} = Para [Str \"code block was here\"]\nmakeRoundTrip LineBlock{} = Para [Str \"line block was here\"]\nmakeRoundTrip RawBlock{} = Para [Str \"raw block was here\"]\nmakeRoundTrip (Div attr bs) = Div attr $ filter (not . isHeaderBlock) bs\n-- avoids round-trip failures related to makeSections\n-- e.g. with [Div (\"loc\",[],[(\"a\",\"11\"),(\"b_2\",\"a b c\")]) [Header 3 (\"\",[],[]) []]]\nmakeRoundTrip Table{} = Para [Str \"table block was here\"]\nmakeRoundTrip x           = x\n\nremoveRawInlines :: Inline -> Inline\nremoveRawInlines RawInline{} = Str \"raw inline was here\"\nremoveRawInlines x           = x\n\nroundTrip :: Blocks -> Bool\nroundTrip b = d'' == d'''\n  where d = walk removeRawInlines $\n            walk makeRoundTrip $ Pandoc nullMeta $ toList b\n        d' = rewrite d\n        d'' = rewrite d'\n        d''' = rewrite d''\n        rewrite = html . (`T.snoc` '\\n') .\n                  purely (writeHtml5String def\n                            { writerWrapText = WrapPreserve })\n\ntests :: [TestTree]\ntests = [ testGroup \"base tag\"\n          [ test html \"simple\" $\n            \"<head><base href=\\\"http://www.w3schools.com/images/foo\\\" ></head><body><img src=\\\"stickman.gif\\\" alt=\\\"Stickman\\\"></head>\" =?>\n            plain (image \"http://www.w3schools.com/images/stickman.gif\" \"\" (text \"Stickman\"))\n          , test html \"slash at end of base\" $\n            \"<head><base href=\\\"http://www.w3schools.com/images/\\\" ></head><body><img src=\\\"stickman.gif\\\" alt=\\\"Stickman\\\"></head>\" =?>\n            plain (image \"http://www.w3schools.com/images/stickman.gif\" \"\" (text \"Stickman\"))\n          , test html \"slash at beginning of href\" $\n            \"<head><base href=\\\"http://www.w3schools.com/images/\\\" ></head><body><img src=\\\"/stickman.gif\\\" alt=\\\"Stickman\\\"></head>\" =?>\n            plain (image \"http://www.w3schools.com/stickman.gif\" \"\" (text \"Stickman\"))\n          , test html \"absolute URL\" $\n            \"<head><base href=\\\"http://www.w3schools.com/images/\\\" ></head><body><img src=\\\"http://example.com/stickman.gif\\\" alt=\\\"Stickman\\\"></head>\" =?>\n            plain (image \"http://example.com/stickman.gif\" \"\" (text \"Stickman\"))\n          ]\n        , testGroup \"anchors\"\n          [ test html \"anchor without href\" $ \"<a name=\\\"anchor\\\"/>\" =?>\n            plain (spanWith (\"anchor\",[],[]) mempty)\n          ]\n        , testGroup \"img\"\n          [ test html \"data-external attribute\" $ \"<img data-external=\\\"1\\\" src=\\\"http://example.com/stickman.gif\\\">\" =?>\n            plain (imageWith (\"\", [], [(\"external\", \"1\")]) \"http://example.com/stickman.gif\" \"\" \"\")\n          , test html \"title\" $ \"<img title=\\\"The title\\\" src=\\\"http://example.com/stickman.gif\\\">\" =?>\n            plain (imageWith (\"\", [], []) \"http://example.com/stickman.gif\" \"The title\" \"\")\n          ]\n        , testGroup \"lang\"\n          [ test html \"lang on <html>\" $ \"<html lang=\\\"es\\\">hola\" =?>\n            setMeta \"lang\" (text \"es\") (doc (plain (text \"hola\")))\n          , test html \"xml:lang on <html>\" $ \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" xml:lang=\\\"es\\\"><head></head><body>hola</body></html>\" =?>\n            setMeta \"lang\" (text \"es\") (doc (plain (text \"hola\")))\n          ]\n        , testGroup \"main\"\n          [ test htmlNativeDivs \"<main> contents are parsed\" $ \"<header>ignore me</header><nav><p>ignore me</p><main>hello</main><footer>ignore me</footer>\" =?>\n            doc (plain (text \"hello\"))\n          , test htmlNativeDivs \"<main role=X> becomes <div role=X>\" $ \"<main role=foobar>hello</main>\" =?>\n            doc (divWith (\"\", [], [(\"role\", \"foobar\")]) (plain (text \"hello\")))\n          , test htmlNativeDivs \"<main> has attributes preserved\" $ \"<main id=foo class=bar data-baz=qux>hello</main>\" =?>\n            doc (divWith (\"foo\", [\"bar\"], [(\"role\", \"main\"), (\"baz\", \"qux\")]) (plain (text \"hello\")))\n          , test htmlNativeDivs \"<main> closes <p>\" $ \"<p>hello<main>main content</main>\" =?>\n            doc (plain (text \"main content\"))\n          , test htmlNativeDivs \"<main> followed by text\" $ \"<main>main content</main>non-main content\" =?>\n            doc (plain (text \"main content\"))\n          ]\n        , testGroup \"code\"\n          [\n            test html \"inline code block\" $\n            \"<code>Answer is 42</code>\" =?>\n            plain (codeWith (\"\",[],[]) \"Answer is 42\")\n          ]\n        , testGroup \"tt\"\n          [\n            test html \"inline tt block\" $\n            \"<tt>Answer is 42</tt>\" =?>\n            plain (codeWith (\"\",[],[]) \"Answer is 42\")\n          ]\n        , testGroup \"samp\"\n          [\n            test html \"inline samp block\" $\n            \"<samp>Answer is 42</samp>\" =?>\n            plain (codeWith (\"\",[\"sample\"],[]) \"Answer is 42\")\n          ]\n        , testGroup \"var\"\n          [ test html \"inline var block\" $\n            \"<var>result</var>\" =?>\n            plain (codeWith (\"\",[\"variable\"],[]) \"result\")\n          ]\n        , testGroup \"header\"\n          [ test htmlNativeDivs \"<header> is parsed as a div\" $\n            \"<header id=\\\"title\\\">Title</header>\" =?>\n            divWith (\"title\", mempty, mempty) (plain \"Title\")\n          ]\n        , testGroup \"code block\"\n          [ test html \"attributes in pre > code element\" $\n            \"<pre><code id=\\\"a\\\" class=\\\"python\\\">\\nprint('hi')\\n</code></pre>\"\n            =?>\n            codeBlockWith (\"a\", [\"python\"], []) \"\\nprint('hi')\"\n\n          , test html \"attributes in pre take precedence\" $\n            \"<pre id=\\\"c\\\"><code id=\\\"d\\\">print('hi mom!')\\n</code></pre>\"\n            =?>\n            codeBlockWith (\"c\", [], []) \"print('hi mom!')\"\n          ]\n        , askOption $ \\(QuickCheckTests numtests) ->\n            testProperty \"Round trip\" $\n              withMaxSuccess (if QuickCheckTests numtests == defaultValue\n                                 then 25\n                                 else numtests) roundTrip\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/JATS.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.JATS\n   Copyright   : © 2017 Hamish Mackenzie\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Hamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>\n   Stability   : alpha\n   Portability : portable\n\nTests for the JATS reader.\n-}\nmodule Tests.Readers.JATS (tests) where\n\nimport Data.Text (Text)\nimport Test.Tasty\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nimport qualified Data.Text as T\n\njats :: Text -> Pandoc\njats = purely $ readJATS def\n\ntests :: [TestTree]\ntests = [ testGroup \"inline code\"\n          [ test jats \"basic\" $ \"<p>\\n  <monospace>@&amp;</monospace>\\n</p>\" =?> para (code \"@&\")\n          ]\n        , testGroup \"block code\"\n          [ test jats \"basic\" $ \"<preformat>@&amp;</preformat>\" =?> codeBlock \"@&\"\n          , test jats \"lang\" $ \"<code language=\\\"c\\\">@&amp;</code>\" =?> codeBlockWith (\"\", [\"c\"], []) \"@&\"\n          ]\n        , testGroup \"images\"\n          [ test jats \"basic\" $ \"<graphic mimetype=\\\"image\\\" mime-subtype=\\\"\\\" xlink:href=\\\"/url\\\" xlink:title=\\\"title\\\" />\"\n            =?> para (image \"/url\" \"title\" mempty)\n            , test jats \"alt-text\" $ \n                          \"<graphic id=\\\"graphic001\\\"\\n\\\n                          \\ xlink:href=\\\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\\\"\\n\\\n                          \\ xlink:title=\\\"This is the title of the graphic\\\"\\n\\\n                          \\ xlink:role=\\\"This is the role of the graphic\\\">\\n\\\n                          \\ <alt-text>Alternative text of the graphic</alt-text>\\n\\\n                          \\ <caption>\\n\\\n                          \\ <title>This is the title of the caption</title>\\n\\\n                          \\ <p>Google doodle from 14 March 2003</p></caption>\\n\\\n                          \\ </graphic>\"\n            =?> Para [ Image\n              ( \"graphic001\"\n              , [ \"This\"\n                , \"is\"\n                , \"the\"\n                , \"role\"\n                , \"of\"\n                , \"the\"\n                , \"graphic\"\n                ]\n              , []\n              )\n              [ Str \"Alternative\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"graphic\"\n              ]\n              ( \"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n              , \"This is the title of the graphic\"\n              )\n              ]\n          ]\n        , test jats \"bullet list\" $\n                            \"<list list-type=\\\"bullet\\\">\\n\\\n                            \\  <list-item>\\n\\\n                            \\    <p>\\n\\\n                            \\      first\\n\\\n                            \\    </p>\\n\\\n                            \\  </list-item>\\n\\\n                            \\  <list-item>\\n\\\n                            \\    <p>\\n\\\n                            \\      second\\n\\\n                            \\    </p>\\n\\\n                            \\  </list-item>\\n\\\n                            \\  <list-item>\\n\\\n                            \\    <p>\\n\\\n                            \\      third\\n\\\n                            \\    </p>\\n\\\n                            \\  </list-item>\\n\\\n                            \\</list>\"\n                =?> bulletList [ para $ text \"first\"\n                               , para $ text \"second\"\n                               , para $ text \"third\"\n                               ]\n        , testGroup \"definition lists\"\n          [ test jats \"with internal link\" $\n            \"<def-list>\\n\\\n            \\  <def-item>\\n\\\n            \\    <term>\\n\\\n            \\      <xref alt=\\\"testing\\\" rid=\\\"go\\\">testing</xref>\\n\\\n            \\    </term>\\n\\\n            \\    <def>\\n\\\n            \\      <p>\\n\\\n            \\        hi there\\n\\\n            \\      </p>\\n\\\n            \\    </def>\\n\\\n            \\  </def-item>\\n\\\n            \\</def-list>\"\n            =?> definitionList [(link \"#go\" \"\" (str \"testing\"),\n                [para (text \"hi there\")])]\n          ]\n        , testGroup \"math\"\n          [ test jats \"escape |\" $\n            \"<p>\\n\\\n            \\  <inline-formula><alternatives>\\n\\\n            \\  <tex-math><![CDATA[\\\\sigma|_{\\\\{x\\\\}}]]></tex-math>\\n\\\n            \\  <mml:math display=\\\"inline\\\" xmlns:mml=\\\"http://www.w3.org/1998/Math/MathML\\\"><mml:mrow><mml:mi>σ</mml:mi><mml:msub><mml:mo stretchy=\\\"false\\\" form=\\\"prefix\\\">|</mml:mo><mml:mrow><mml:mo stretchy=\\\"false\\\" form=\\\"prefix\\\">{</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\\\"false\\\" form=\\\"postfix\\\">}</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></alternatives></inline-formula>\\n\\\n            \\</p>\"\n            =?> para (math \"\\\\sigma|_{\\\\{x\\\\}}\")\n          , test jats \"tex-math only\" $\n            \"<p>\\n\\\n            \\  <inline-formula><alternatives>\\n\\\n            \\  <tex-math><![CDATA[\\\\sigma|_{\\\\{x\\\\}}]]></tex-math>\\n\\\n            \\  </alternatives></inline-formula>\\n\\\n            \\</p>\"\n            =?> para (math \"\\\\sigma|_{\\\\{x\\\\}}\")\n          , test jats \"math ml only\" $\n            \"<p>\\n\\\n            \\  <inline-formula><alternatives>\\n\\\n            \\  <mml:math display=\\\"inline\\\" xmlns:mml=\\\"http://www.w3.org/1998/Math/MathML\\\"><mml:mrow><mml:mi>σ</mml:mi><mml:msub><mml:mo stretchy=\\\"false\\\" form=\\\"prefix\\\">|</mml:mo><mml:mrow><mml:mo stretchy=\\\"false\\\" form=\\\"prefix\\\">{</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\\\"false\\\" form=\\\"postfix\\\">}</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></alternatives></inline-formula>\\n\\\n            \\</p>\"\n            =?> para (math \"\\\\sigma|_{\\\\{ x\\\\}}\")\n          ]\n        , testGroup \"headers\"\n-- TODO fix footnotes in headers\n--          [ test jats \"unnumbered header\" $\n--            \"<sec>\\n\\\n--            \\  <title>Header 1<fn>\\n\\\n--            \\    <p>\\n\\\n--            \\      note\\n\\\n--            \\    </p>\\n\\\n--            \\  </fn></title>\\n\\\n--            \\</sec>\"\n--            =?> header 1\n--                (text \"Header 1\" <> note (plain $ text \"note\"))\n          [ test jats \"unnumbered sub header\" $\n            \"<sec id=\\\"foo\\\">\\n\\\n            \\  <title>Header</title>\\n\\\n            \\  <sec id=\\\"foo2\\\">\\n\\\n            \\    <title>Sub-Header</title>\\n\\\n            \\  </sec>\\n\\\n            \\</sec>\"\n            =?> headerWith (\"foo\", [], []) 1\n                  (text \"Header\")\n                <> headerWith  (\"foo2\", [], []) 2\n                  (text \"Sub-Header\")\n          , test jats \"containing image\" $\n            \"<sec>\\n\\\n            \\  <title><inline-graphic mimetype=\\\"image\\\" mime-subtype=\\\"jpeg\\\" xlink:href=\\\"imgs/foo.jpg\\\" /></title>\\n\\\n            \\</sec>\"\n            =?> header 1 (image \"imgs/foo.jpg\" \"\" mempty)\n          ]\n\n        , testGroup \"metadata\"\n          [ test jats \"abstract\" $\n            T.unlines [ \"<front>\"\n                      , \"<article-meta>\"\n                      , \"<abstract>\"\n                      , \"<p>Paragraph 1</p>\"\n                      , \"<p>Paragraph 2</p>\"\n                      , \"</abstract>\"\n                      , \"</article-meta>\"\n                      , \"</front>\"\n                      ] =?>\n            let abstract = para \"Paragraph 1\" <> para \"Paragraph 2\"\n            in setMeta \"abstract\" abstract $ doc mempty\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/Jira.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Tests.Readers.Jira\n   Copyright   : © 2019-2024 Albert Krewinel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTests for the RST reader.\n-}\nmodule Tests.Readers.Jira (tests) where\n\nimport Prelude hiding (unlines)\nimport Data.Text (Text, unlines)\nimport Test.Tasty (TestTree, testGroup)\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers (ToString, purely, test, (=?>))\nimport Text.Pandoc (def)\nimport Text.Pandoc.Readers.Jira (readJira)\nimport Text.Pandoc.Builder\n\njira :: Text -> Pandoc\njira = purely $ readJira def\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test jira\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"para\"\n    [ \"Simple sentence\" =:\n      \"Hello, World!\" =?> para \"Hello, World!\"\n\n    , \"leading blank lines\" =:\n      \"\\n\\ntext\" =?> para \"text\"\n    ]\n\n  , testGroup \"header\"\n    [ \"header\" =:\n      \"h1. Main\\n\" =?> header 1 \"Main\"\n    ]\n\n  , testGroup \"list\"\n    [ \"simple list\" =:\n      \"* foo\\n* bar\\n\" =?> bulletList [para \"foo\", para \"bar\"]\n\n    , \"list with minus as bullets\" =:\n      \"- foo\\n- bar\\n\" =?> bulletList [para \"foo\", para \"bar\"]\n\n    , \"ordered list / enumeration\" =:\n      \"# first\\n# second\\n\" =?> orderedList [para \"first\", para \"second\"]\n    ]\n\n  , testGroup \"block quote\"\n    [ \"simple block quote\" =:\n      \"bq. _Don't_ quote me on this.\" =?>\n      blockQuote (para $ emph \"Don't\" <> space <> \"quote me on this.\")\n\n    , \"block quote between paragraphs\" =:\n      unlines [ \"Regular text.\"\n              , \"bq.This is a blockquote\"\n              , \"More text.\"\n              ] =?>\n      mconcat [ para \"Regular text.\"\n              , blockQuote (para \"This is a blockquote\")\n              , para \"More text.\"\n              ]\n    ]\n\n  , testGroup \"table\"\n    [ \"table without header\" =:\n      \"| one | two |\\n| three | four |\\n\" =?>\n      simpleTable []\n                  [ [para \"one\", para \"two\"]\n                  , [para \"three\", para \"four\"]]\n\n    , \"table with header\" =:\n      \"|| one || two ||\\n| three | four |\\n| five | six |\\n\" =?>\n      simpleTable [para \"one\", para \"two\"]\n                  [ [para \"three\", para \"four\"]\n                  , [para \"five\", para \"six\"]]\n\n    , \"table with column header\" =:\n      \"|| language | haskell | lua |\\n|| type | static | dynamic |\\n\" =?>\n      simpleTable []\n                  [ [para \"language\", para \"haskell\", para \"lua\"]\n                  , [para \"type\", para \"static\", para \"dynamic\"]]\n\n    , \"table after paragraph\" =:\n      \"*tabletest*\\n||Name|\\n|Test|\\n\" =?>\n      para (strong \"tabletest\") <>\n      simpleTable [para \"Name\"] [[para \"Test\"]]\n    ]\n\n  , testGroup \"panel\"\n    [ \"simple panel\" =:\n      \"{panel}\\nInterviewer: Jane Doe{panel}\\n\" =?>\n      divWith (\"\", [\"panel\"], []) (para \"Interviewer: Jane Doe\")\n    ]\n\n  , testGroup \"inlines\"\n    [ \"emphasis\" =:\n      \"*quid pro quo*\" =?>\n      para (strong \"quid pro quo\")\n\n    , \"deleted\" =:\n      \"-old-\" =?>\n      para (strikeout \"old\")\n\n    , \"monospaced\" =:\n      \"{{this *is* monospace}}\" =?>\n      para (code \"this is monospace\")\n\n    , \"sub- and superscript\" =:\n      \"HCO ~3~^-^\" =?>\n      para (\"HCO \" <> subscript \"3\" <> superscript \"-\")\n\n    , \"citation\" =:\n      \"Et tu, Brute? ??Caesar??\" =?>\n      para (\"Et tu, Brute? — \" <> emph \"Caesar\")\n\n    , \"color\" =:\n      \"This is {color:red}red{color}.\" =?>\n      para (\"This is \" <> spanWith (\"\", [], [(\"color\", \"red\")]) \"red\" <> \".\")\n\n    , \"hexcolor\" =:\n      \"{color:#00875A}green{color}\" =?>\n      para (spanWith (\"\", [], [(\"color\", \"#00875A\")]) \"green\")\n\n    , \"linebreak\" =:\n      \"first\\nsecond\" =?>\n      para (\"first\" <> linebreak <> \"second\")\n\n    , testGroup \"links\"\n      [ \"external\" =:\n        \"[Example|https://example.org]\" =?>\n        para (link \"https://example.org\" \"\" \"Example\")\n\n      , \"URL in alias\" =:\n        \"[See https://example.com|https://example.com]\" =?>\n        para (link \"https://example.com\" \"\" \"See https://example.com\")\n\n      , \"email\" =:\n        \"[mailto:me@example.org]\" =?>\n        para (link \"mailto:me@example.org\" \"\" \"me@example.org\")\n\n      , \"email with description\" =:\n        \"[email|mailto:me@example.org]\" =?>\n        para (link \"mailto:me@example.org\" \"\" \"email\")\n\n      , \"attachment\" =:\n        \"[^example.txt]\" =?>\n        para (linkWith (\"\", [\"attachment\"], []) \"example.txt\" \"\" \"example.txt\")\n\n      , \"attachment with description\" =:\n        \"[an example^example.txt]\" =?>\n        para (linkWith (\"\", [\"attachment\"], []) \"example.txt\" \"\" \"an example\")\n\n      , \"user\" =:\n        \"[~johndoe]\" =?>\n        para (linkWith (\"\", [\"user-account\"], []) \"~johndoe\" \"\" \"~johndoe\")\n\n      , \"user with description\" =:\n        \"[John Doe|~johndoe]\" =?>\n        para (linkWith (\"\", [\"user-account\"], []) \"~johndoe\" \"\" \"John Doe\")\n\n      , \"'smart' link\" =:\n        \"[x|http://example.com|smart-link]\" =?>\n        para (linkWith (\"\", [\"smart-link\"], []) \"http://example.com\" \"\" \"x\")\n\n      , \"'smart' card\" =:\n        \"[x|http://example.com|smart-card]\" =?>\n        para (linkWith (\"\", [\"smart-card\"], []) \"http://example.com\" \"\" \"x\")\n      ]\n\n    , \"image\" =:\n      \"!https://example.com/image.jpg!\" =?>\n      para (image \"https://example.com/image.jpg\" \"\" mempty)\n\n    , \"thumbnail image\" =:\n      \"!image.jpg|thumbnail!\" =?>\n      para (imageWith (\"\", [\"thumbnail\"], []) \"image.jpg\" \"\" mempty)\n\n    , \"image with attributes\" =:\n      \"!image.gif|align=right, vspace=4, title=Hello!\" =?>\n      let attr = (\"\", [], [(\"align\", \"right\"), (\"vspace\", \"4\")])\n      in para $ imageWith attr \"image.gif\" \"Hello\" mempty\n\n    , \"inserted text\" =:\n      \"+the new version+\" =?>\n      para (underline \"the new version\")\n\n    , \"HTML entity\" =:\n      \"me &amp; you\" =?> para \"me & you\"\n\n    , \"non-strikeout dashes\" =:\n      \"20.09-15 2-678\" =?>\n      para \"20.09-15 2-678\"\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/LaTeX.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.LaTeX\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the LaTeX reader.\n-}\nmodule Tests.Readers.LaTeX (tests) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nlatex :: Text -> Pandoc\nlatex = purely $ readLaTeX def{\n                   readerExtensions = getDefaultExtensions \"latex\" }\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test latex\n\ntable' :: [Alignment] -> [Row] -> Blocks\ntable' aligns rows\n  = table emptyCaption\n          (zip aligns (repeat ColWidthDefault))\n          (TableHead nullAttr [])\n          [TableBody nullAttr 0 [] rows]\n          (TableFoot nullAttr [])\n\nsimpleTable' :: [Alignment] -> [[Blocks]] -> Blocks\nsimpleTable' aligns rows\n  = table' aligns (map toRow rows)\n  where\n    toRow = Row nullAttr . map simpleCell\n\ntests :: [TestTree]\ntests = [ testGroup \"basic\"\n          [ \"simple\" =:\n            \"word\" =?> para \"word\"\n          , \"space\" =:\n            \"some text\" =?> para \"some text\"\n          , \"emphasized\" =:\n            \"\\\\emph{emphasized}\" =?> para (emph \"emphasized\")\n          ]\n\n        , testGroup \"headers\"\n          [ \"level 1\" =:\n            \"\\\\section{header}\" =?> headerWith (\"header\",[],[]) 1 \"header\"\n          , \"level 2\" =:\n            \"\\\\subsection{header}\" =?> headerWith (\"header\",[],[]) 2 \"header\"\n          , \"level 3\" =:\n            \"\\\\subsubsection{header}\" =?> headerWith (\"header\",[],[]) 3 \"header\"\n          , \"emph\" =:\n            \"\\\\section{text \\\\emph{emph}}\" =?>\n             headerWith (\"text-emph\",[],[]) 1 (\"text\" <> space <> emph \"emph\")\n          , \"link\" =:\n            \"\\\\section{text \\\\href{/url}{link}}\" =?>\n              headerWith (\"text-link\",[],[]) 1 (\"text\" <> space <> link \"/url\" \"\" \"link\")\n          ]\n\n        , testGroup \"math\"\n          [ \"escaped $\" =:\n            \"$x=\\\\$4$\" =?> para (math \"x=\\\\$4\")\n          ]\n\n        , testGroup \"space and comments\"\n          [ \"blank lines + space at beginning\" =:\n            \"\\n  \\n  hi\" =?> para \"hi\"\n          , \"blank lines + space + comments\" =:\n            \"% my comment\\n\\n  \\n  % another\\n\\nhi\" =?> para \"hi\"\n          , \"comment in paragraph\" =:\n            \"hi % this is a comment\\nthere\\n\" =?>\n                para (\"hi\" <> softbreak <> \"there\")\n          ]\n\n        , testGroup \"code blocks\"\n          [ \"identifier\" =:\n            \"\\\\begin{lstlisting}[label=test]\\\\end{lstlisting}\" =?> codeBlockWith (\"test\", [], [(\"label\",\"test\")]) \"\"\n          , \"no identifier\" =:\n            \"\\\\begin{lstlisting}\\\\end{lstlisting}\" =?> codeBlock \"\"\n          ]\n\n        , testGroup \"tables\"\n          [ \"Single cell table\" =:\n            \"\\\\begin{tabular}{|l|}Test\\\\\\\\\\\\end{tabular}\" =?>\n            simpleTable' [AlignLeft] [[plain \"Test\"]]\n          , \"Multi cell table\" =:\n            \"\\\\begin{tabular}{|rl|}One & Two\\\\\\\\ \\\\end{tabular}\" =?>\n            simpleTable' [AlignRight,AlignLeft] [[plain \"One\", plain \"Two\"]]\n          , \"Multi line table\" =:\n            T.unlines [ \"\\\\begin{tabular}{|c|}\"\n                    , \"One\\\\\\\\\"\n                    , \"Two\\\\\\\\\"\n                    , \"Three\\\\\\\\\"\n                    , \"\\\\end{tabular}\" ] =?>\n            simpleTable' [AlignCenter]\n                         [[plain \"One\"], [plain \"Two\"], [plain \"Three\"]]\n          , \"Empty table\" =:\n            \"\\\\begin{tabular}{}\\\\end{tabular}\" =?>\n            simpleTable' [] []\n          , \"Table with fixed column width\" =:\n            \"\\\\begin{tabular}{|p{5cm}r|}One & Two\\\\\\\\ \\\\end{tabular}\" =?>\n            simpleTable' [AlignLeft,AlignRight] [[plain \"One\", plain \"Two\"]]\n          , \"Table with empty column separators\" =:\n            \"\\\\begin{tabular}{@{}r@{}l}One & Two\\\\\\\\ \\\\end{tabular}\" =?>\n            simpleTable' [AlignRight,AlignLeft] [[plain \"One\", plain \"Two\"]]\n          , \"Table with custom column separators\" =:\n            T.unlines [ \"\\\\begin{tabular}{@{($\\\\to$)}r@{\\\\hspace{2cm}}l}\"\n                    , \"One&Two\\\\\\\\\"\n                    , \"\\\\end{tabular}\" ] =?>\n            simpleTable' [AlignRight,AlignLeft] [[plain \"One\", plain \"Two\"]]\n          , \"Table with vertical alignment argument\" =:\n            \"\\\\begin{tabular}[t]{r|r}One & Two\\\\\\\\ \\\\end{tabular}\" =?>\n            simpleTable' [AlignRight,AlignRight] [[plain \"One\", plain \"Two\"]]\n          , \"Table with multicolumn item\" =:\n            \"\\\\begin{tabular}{l c r}\\\\multicolumn{2}{c}{One} & Two\\\\\\\\ \\\\end{tabular}\" =?>\n            table' [AlignLeft, AlignCenter, AlignRight]\n                   [ Row nullAttr [ cell AlignCenter (RowSpan 1) (ColSpan 2) (plain \"One\")\n                                  , simpleCell (plain \"Two\")\n                                  ]\n                   ]\n          , \"table with multicolumn item (#6596)\" =:\n            \"\\\\begin{tabular}{l c r}One & \\\\multicolumn{2}{c}{Two} & \\\\\\\\ \\\\end{tabular}\" =?>\n            table' [AlignLeft, AlignCenter, AlignRight]\n                   [ Row nullAttr [ simpleCell (plain \"One\")\n                                  , cell AlignCenter (RowSpan 1) (ColSpan 2) (plain \"Two\")\n                                  ]\n                   ]\n          , \"Table with multirow item\" =:\n            T.unlines [\"\\\\begin{tabular}{c}\"\n                      ,\"\\\\multirow{2}{5em}{One}\\\\\\\\Two\\\\\\\\\"\n                      ,\"\\\\end{tabular}\"\n                      ] =?>\n            table' [AlignCenter]\n                  [ Row nullAttr [ cell AlignDefault (RowSpan 2) (ColSpan 1) (plain \"One\") ]\n                  , Row nullAttr [ simpleCell (plain \"Two\") ]\n                  ]\n          , \"Table with multirow item using full prototype\" =:\n            T.unlines [\"\\\\begin{tabular}{c}\"\n                      ,\"\\\\multirow[c]{2}[3]{5em}[1in]{One}\\\\\\\\Two\\\\\\\\\"\n                      ,\"\\\\end{tabular}\"\n                      ] =?>\n            table' [AlignCenter]\n                  [ Row nullAttr [ cell AlignDefault (RowSpan 2) (ColSpan 1) (plain \"One\") ]\n                  , Row nullAttr [ simpleCell (plain \"Two\") ]\n                  ]\n          , \"Table with nested multirow/multicolumn item\" =:\n            T.unlines [ \"\\\\begin{tabular}{c c c c}\"\n                      , \"\\\\multicolumn{3}{c}{\\\\multirow{2}{5em}{One}}&Two\\\\\\\\\"\n                      , \"\\\\multicolumn{2}{c}{} & & Three\\\\\\\\\"\n                      , \"Four&Five&Six&Seven\\\\\\\\\"\n                      , \"\\\\end{tabular}\"\n                      ] =?>\n            table' [AlignCenter, AlignCenter, AlignCenter, AlignCenter]\n                   [ Row nullAttr [ cell AlignCenter (RowSpan 2) (ColSpan 3) (plain \"One\")\n                                  , simpleCell (plain \"Two\")\n                                  ]\n                   , Row nullAttr [ simpleCell (plain \"Three\") ]\n                   , Row nullAttr [ simpleCell (plain \"Four\")\n                                  , simpleCell (plain \"Five\")\n                                  , simpleCell (plain \"Six\")\n                                  , simpleCell (plain \"Seven\")\n                                  ]\n                   ]\n          , \"Table with multicolumn header\" =:\n            T.unlines [ \"\\\\begin{tabular}{ |l|l| }\"\n                      , \"\\\\hline\\\\multicolumn{2}{|c|}{Header}\\\\\\\\\"\n                      , \"\\\\hline key & val\\\\\\\\\"\n                      , \"\\\\hline\\\\end{tabular}\"\n                      ] =?>\n            table emptyCaption\n                  (zip [AlignLeft, AlignLeft] (repeat ColWidthDefault))\n                  (TableHead nullAttr [ Row nullAttr [cell AlignCenter (RowSpan 1) (ColSpan 2) (plain \"Header\")]])\n                  [TableBody nullAttr 0 [] [Row nullAttr [ simpleCell (plain \"key\")\n                                                         , simpleCell (plain \"val\")\n                                                         ]\n                                           ]\n                  ]\n                  (TableFoot nullAttr [])\n          , \"Table with normal empty cells\" =:\n            T.unlines [ \"\\\\begin{tabular}{|r|r|r|}\"\n                      , \"A &   & B \\\\\\\\\"\n                      , \"  & C &\"\n                      , \"\\\\end{tabular}\"\n                      ] =?>\n            table emptyCaption\n                  (replicate 3 (AlignRight, ColWidthDefault))\n                  (TableHead nullAttr [])\n                  [TableBody nullAttr 0 []\n                    [Row nullAttr [ simpleCell (plain \"A\")\n                                  , emptyCell\n                                  , simpleCell (plain \"B\")\n                                  ]\n                    ,Row nullAttr [ emptyCell\n                                  , simpleCell (plain \"C\")\n                                  , emptyCell\n                                  ]]]\n                  (TableFoot nullAttr [])\n          ]\n\n        , testGroup \"citations\"\n          [ natbibCitations\n          , biblatexCitations\n          ]\n\n        , testGroup \"images\"\n          [ \"Basic image\" =:\n            \"\\\\includegraphics{foo.png}\" =?>\n            para (image \"foo.png\" \"\" (text \"image\"))\n          , \"Basic image with blank options\" =:\n            \"\\\\includegraphics[]{foo.png}\" =?>\n            para (image \"foo.png\" \"\" (text \"image\"))\n          , \"Image with both width and height\" =:\n            \"\\\\includegraphics[width=17cm,height=5cm]{foo.png}\" =?>\n            para (imageWith (\"\", [], [(\"width\", \"17cm\"), (\"height\", \"5cm\")]) \"foo.png\" \"\" \"image\")\n          , \"Image with width and height and a bunch of other options\" =:\n            \"\\\\includegraphics[width=17cm,height=5cm,clip,keepaspectratio]{foo.png}\" =?>\n            para (imageWith (\"\", [], [(\"width\", \"17cm\"), (\"height\", \"5cm\")]) \"foo.png\" \"\" \"image\")\n          , \"Image with just width\" =:\n            \"\\\\includegraphics[width=17cm]{foo.png}\" =?>\n            para (imageWith (\"\", [], [(\"width\", \"17cm\")]) \"foo.png\" \"\" \"image\")\n          , \"Image with just height\" =:\n            \"\\\\includegraphics[height=17cm]{foo.png}\" =?>\n            para (imageWith (\"\", [], [(\"height\", \"17cm\")]) \"foo.png\" \"\" \"image\")\n          , \"Image width relative to textsize\" =:\n            \"\\\\includegraphics[width=0.6\\\\textwidth]{foo.png}\" =?>\n            para (imageWith (\"\", [], [(\"width\", \"60%\")]) \"foo.png\" \"\" \"image\")\n          , \"Image with options with spaces\" =:\n            \"\\\\includegraphics[width=12cm, height = 5cm]{foo.png}\" =?>\n            para (imageWith (\"\", [], [(\"width\", \"12cm\"), (\"height\", \"5cm\")]) \"foo.png\" \"\" \"image\")\n          ]\n\n        , let hex = ['0'..'9']++['a'..'f'] in\n          testGroup \"Character Escapes\"\n          [ \"Two-character escapes\" =:\n            mconcat [\"^^\" <> T.pack [i,j] | i <- hex, j <- hex] =?>\n            para (str $ T.pack ['\\0'..'\\255'])\n          , \"One-character escapes\" =:\n            mconcat [\"^^\" <> T.pack [i] | i <- hex] =?>\n            para (str $ T.pack $ ['p'..'y']++['!'..'&'])\n          ]\n        , testGroup \"memoir scene breaks\"\n          [ \"plainbreak\" =:\n            \"hello\\\\plainbreak{2}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"plainbreak*\" =:\n            \"hello\\\\plainbreak*{2}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"fancybreak\" =:\n            \"hello\\\\fancybreak{b r e a k}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"fancybreak*\" =:\n            \"hello\\\\fancybreak*{b r e a k}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"plainfancybreak\" =:\n            \"hello\\\\plainfancybreak{4}{2}{b r e a k}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"plainfancybreak*\" =:\n            \"hello\\\\plainfancybreak*{4}{2}{b r e a k}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"pfbreak\" =:\n            \"hello\\\\pfbreak{}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          , \"pfbreak*\" =:\n            \"hello\\\\pfbreak*{}goodbye\" =?>\n            para (str \"hello\") <> horizontalRule <> para (str \"goodbye\")\n          ]\n        , testGroup \"biblatex roman numerals\"\n          [ \"upper\" =:\n            \"number \\\\RN{12}\" =?>\n            para (str \"number\" <> space <> str \"XII\")\n          , \"lower\" =:\n            \"number \\\\Rn{29}\" =?>\n            para (str \"number\" <> space <> str \"xxix\")\n          , \"leading zero\" =:\n            \"\\\\Rn{014}\" =?>\n            para (str \"xiv\")\n          , \"surrounding spaces\" =:\n            \"number \\\\Rn{ 41 }\" =?>\n            para (str \"number\" <> space <> str \"xli\")\n          , \"zero\" =:\n            \"\\\\RN{0}\" =?>\n            para (str \"\")\n          , \"space then unbraced argument\" =:\n            \"\\\\RN 7 ok\" =?>\n            para (str \"VII\" <> space <> str \"ok\")\n          , \"space before braced argument\" =:\n            \"\\\\Rn {13}ok\" =?>\n            para (str \"xiiiok\")\n          ]\n        , testGroup \"polyglossia language spans\"\n          [ \"french\" =:\n            \"hello \\\\textfrench{bonjour}\" =?>\n            para (str \"hello\" <> space <> spanWith (\"\", [], [(\"lang\", \"fr\")]) (str \"bonjour\"))\n          , \"nested\" =:\n            \"\\\\textfrench{quelle c'est \\\\textlatin{primus}?}\" =?>\n            para (spanWith (\"\", [], [(\"lang\", \"fr\")]) $\n                    str \"quelle\" <> space <> str \"c\\8217est\" <> space <>\n                    spanWith (\"\", [], [(\"lang\", \"la\")]) (str \"primus\") <> str \"?\")\n          , \"with formatting\" =:\n            \"\\\\textgerman{wie \\\\emph{spaet} ist es?}\" =?>\n            para (spanWith (\"\", [], [(\"lang\", \"de\")]) $\n                    str \"wie\" <> space <> emph (str \"spaet\") <> space <> str \"ist\" <> space <> str \"es?\")\n          , \"language options\" =:\n            \"\\\\textgerman[variant=swiss]{hoechdeutsche}\" =?>\n            para (spanWith (\"\", [], [(\"lang\", \"de-CH\")]) $ str \"hoechdeutsche\")\n          , \"unknown option fallback\" =:\n            \"\\\\textgerman[variant=moon]{ueberhoechdeutsche}\" =?>\n            para (spanWith (\"\", [], [(\"lang\", \"de\")]) $ str \"ueberhoechdeutsche\")\n          ]\n        ]\n\nbaseCitation :: Citation\nbaseCitation = Citation{ citationId      = \"item1\"\n                       , citationPrefix  = []\n                       , citationSuffix  = []\n                       , citationMode    = AuthorInText\n                       , citationNoteNum = 0\n                       , citationHash    = 0\n                       }\n\nrt :: String -> Inlines\nrt = rawInline \"latex\" . T.pack\n\nnatbibCitations :: TestTree\nnatbibCitations = testGroup \"natbib\"\n  [ \"citet\" =: \"\\\\citet{item1}\"\n    =?> para (cite [baseCitation] (rt \"\\\\citet{item1}\"))\n  , \"suffix\" =: \"\\\\citet[p.~30]{item1}\"\n    =?> para\n        (cite [baseCitation{ citationSuffix = toList $ text \"p.\\160\\&30\" }] (rt \"\\\\citet[p.~30]{item1}\"))\n  , \"suffix long\" =: \"\\\\citet[p.~30, with suffix]{item1}\"\n    =?> para (cite [baseCitation{ citationSuffix =\n                       toList $ text \"p.\\160\\&30, with suffix\" }] (rt \"\\\\citet[p.~30, with suffix]{item1}\"))\n  , \"multiple\" =: \"\\\\citeauthor{item1} \\\\citetext{\\\\citeyear{item1}; \\\\citeyear[p.~30]{item2}; \\\\citealp[see also][]{item3}}\"\n    =?> para (cite [baseCitation{ citationMode = AuthorInText }\n                   ,baseCitation{ citationMode = SuppressAuthor\n                                , citationSuffix = [Str \"p.\\160\\&30\"]\n                                , citationId = \"item2\" }\n                   ,baseCitation{ citationId = \"item3\"\n                                , citationPrefix = [Str \"see\",Space,Str \"also\"]\n                                , citationMode = NormalCitation }\n                   ] (rt \"\\\\citetext{\\\\citeyear{item1}; \\\\citeyear[p.~30]{item2}; \\\\citealp[see also][]{item3}}\"))\n  , \"group\" =: \"\\\\citetext{\\\\citealp[see][p.~34--35]{item1}; \\\\citealp[also][chap. 3]{item3}}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationPrefix = [Str \"see\"]\n                                , citationSuffix = [Str \"p.\\160\\&34\\8211\\&35\"] }\n                   ,baseCitation{ citationMode = NormalCitation\n                                , citationId = \"item3\"\n                                , citationPrefix = [Str \"also\"]\n                                , citationSuffix = [Str \"chap.\",Space,Str \"3\"] }\n                   ] (rt \"\\\\citetext{\\\\citealp[see][p.~34--35]{item1}; \\\\citealp[also][chap. 3]{item3}}\"))\n  , \"suffix and locator\" =: \"\\\\citep[pp.~33, 35--37, and nowhere else]{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationSuffix = [Str \"pp.\\160\\&33,\",Space,Str \"35\\8211\\&37,\",Space,Str \"and\",Space,Str \"nowhere\",Space, Str \"else\"] }] (rt \"\\\\citep[pp.~33, 35--37, and nowhere else]{item1}\"))\n  , \"suffix only\" =: \"\\\\citep[and nowhere else]{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationSuffix = toList $ text \"and nowhere else\" }] (rt \"\\\\citep[and nowhere else]{item1}\"))\n  , \"no author\" =: \"\\\\citeyearpar{item1}, and now Doe with a locator \\\\citeyearpar[p.~44]{item2}\"\n    =?> para (cite [baseCitation{ citationMode = SuppressAuthor }] (rt \"\\\\citeyearpar{item1}\") <>\n              text \", and now Doe with a locator \" <>\n              cite [baseCitation{ citationMode = SuppressAuthor\n                                , citationSuffix = [Str \"p.\\160\\&44\"]\n                                , citationId = \"item2\" }] (rt \"\\\\citeyearpar[p.~44]{item2}\"))\n  , \"markup\" =: \"\\\\citep[\\\\emph{see}][p. \\\\textbf{32}]{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationPrefix = [Emph [Str \"see\"]]\n                                , citationSuffix = [Str \"p.\",Space,\n                                    Strong [Str \"32\"]] }] (rt \"\\\\citep[\\\\emph{see}][p. \\\\textbf{32}]{item1}\"))\n  ]\n\nbiblatexCitations :: TestTree\nbiblatexCitations = testGroup \"biblatex\"\n  [ \"textcite\" =: \"\\\\textcite{item1}\"\n    =?> para (cite [baseCitation] (rt \"\\\\textcite{item1}\"))\n  , \"suffix\" =: \"\\\\textcite[p.~30]{item1}\"\n    =?> para\n        (cite [baseCitation{ citationSuffix = toList $ text \"p.\\160\\&30\" }] (rt \"\\\\textcite[p.~30]{item1}\"))\n  , \"suffix long\" =: \"\\\\textcite[p.~30, with suffix]{item1}\"\n    =?> para (cite [baseCitation{ citationSuffix =\n                       toList $ text \"p.\\160\\&30, with suffix\" }] (rt \"\\\\textcite[p.~30, with suffix]{item1}\"))\n  , \"multiple\" =: \"\\\\textcites{item1}[p.~30]{item2}[see also][]{item3}\"\n    =?> para (cite [baseCitation{ citationMode = AuthorInText }\n                   ,baseCitation{ citationMode = NormalCitation\n                                , citationSuffix = [Str \"p.\\160\\&30\"]\n                                , citationId = \"item2\" }\n                   ,baseCitation{ citationId = \"item3\"\n                                , citationPrefix = [Str \"see\",Space,Str \"also\"]\n                                , citationMode = NormalCitation }\n                   ] (rt \"\\\\textcites{item1}[p.~30]{item2}[see also][]{item3}\"))\n  , \"group\" =: \"\\\\autocites[see][p.~34--35]{item1}[also][chap. 3]{item3}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationPrefix = [Str \"see\"]\n                                , citationSuffix = [Str \"p.\\160\\&34\\8211\\&35\"] }\n                   ,baseCitation{ citationMode = NormalCitation\n                                , citationId = \"item3\"\n                                , citationPrefix = [Str \"also\"]\n                                , citationSuffix = [Str \"chap.\",Space,Str \"3\"] }\n                   ] (rt \"\\\\autocites[see][p.~34--35]{item1}[also][chap. 3]{item3}\"))\n  , \"suffix and locator\" =: \"\\\\autocite[pp.~33, 35--37, and nowhere else]{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationSuffix = [Str \"pp.\\160\\&33,\",Space,Str \"35\\8211\\&37,\",Space,Str \"and\",Space,Str \"nowhere\",Space, Str \"else\"] }] (rt \"\\\\autocite[pp.~33, 35--37, and nowhere else]{item1}\"))\n  , \"suffix only\" =: \"\\\\autocite[and nowhere else]{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationSuffix = toList $ text \"and nowhere else\" }] (rt \"\\\\autocite[and nowhere else]{item1}\"))\n  , \"no author\" =: \"\\\\autocite*{item1}, and now Doe with a locator \\\\autocite*[p.~44]{item2}\"\n    =?> para (cite [baseCitation{ citationMode = SuppressAuthor }] (rt \"\\\\autocite*{item1}\") <>\n              text \", and now Doe with a locator \" <>\n              cite [baseCitation{ citationMode = SuppressAuthor\n                                , citationSuffix = [Str \"p.\\160\\&44\"]\n                                , citationId = \"item2\" }] (rt \"\\\\autocite*[p.~44]{item2}\"))\n  , \"markup\" =: \"\\\\autocite[\\\\emph{see}][p. \\\\textbf{32}]{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation\n                                , citationPrefix = [Emph [Str \"see\"]]\n                                , citationSuffix = [Str \"p.\",Space,\n                                    Strong [Str \"32\"]] }] (rt \"\\\\autocite[\\\\emph{see}][p. \\\\textbf{32}]{item1}\"))\n  , \"parencite\" =: \"\\\\parencite{item1}\"\n    =?> para (cite [baseCitation{ citationMode = NormalCitation }] (rt \"\\\\parencite{item1}\"))\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Man.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Man\n   Copyright   : © 2018-2019 Yan Pas <yanp.bugz@gmail.com>,\n                   2018-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the Man reader.\n-}\nmodule Tests.Readers.Man (tests) where\n\nimport Data.Text (Text)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nman :: Text -> Pandoc\nman = purely $ readMan def\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test man\n\ntoRow :: [Blocks] -> Row\ntoRow = Row nullAttr . map simpleCell\n\ntests :: [TestTree]\ntests = [\n  -- .SH \"HEllo bbb\" \"aaa\"\" as\"\n  testGroup \"Macros\" [\n      \"Bold\" =:\n      \".B foo\"\n      =?> para (strong \"foo\")\n    , \"Italic\" =:\n      \".I bar\\n\"\n      =?> para (emph \"bar\")\n    , \"BoldItalic\" =:\n      \".BI foo bar\"\n      =?> para (strong (str \"foo\") <> emph (str \"bar\"))\n    , \"H1\" =:\n      \".SH The header\\n\"\n      =?> header 1 (text \"The header\")\n    , \"H2\" =:\n      \".SS \\\"The header 2\\\"\"\n      =?> header 2 (text \"The header 2\")\n    , \"Macro args\" =:\n      \".B \\\"single arg with \\\"\\\"Q\\\"\\\"\\\"\"\n      =?>para (strong $ text \"single arg with \\\"Q\\\"\")\n    , \"Argument from next line\" =:\n      \".B\\nsingle arg with \\\"Q\\\"\"\n      =?>para (strong $ text \"single arg with \\\"Q\\\"\")\n    , \"comment\" =:\n      \".\\\\\\\"bla\\naaa\"\n      =?>para (str \"aaa\")\n    , \"link\" =:\n      \".BR aa (1)\"\n      =?> para (strong (str \"aa\") <> str \"(1)\")\n    ],\n  testGroup \"Escapes\" [\n      \"fonts\" =:\n      \"aa\\\\fIbb\\\\fRcc\"\n      =?>para (str \"aa\" <> emph (str \"bb\") <> str \"cc\")\n    , \"nested fonts\" =:\n      \"\\\\f[BI]hi\\\\f[I] there\\\\f[R]\"\n      =?> para (emph (strong (text \"hi\") <> text \" there\"))\n    , \"nested fonts 2\" =:\n      \"\\\\f[R]hi \\\\f[I]there \\\\f[BI]bold\\\\f[R] ok\"\n      =?> para (text \"hi \" <> emph (text \"there \" <> strong (text \"bold\")) <>\n                                   text \" ok\")\n    , \"skip\" =:\n      \"a\\\\%\\\\\\n\\\\:b\\\\0\"\n      =?>para (str \"ab\\8199\")\n    , \"replace\" =:\n      \"\\\\-\\\\ \\\\\\\\\\\\[lq]\\\\[rq]\\\\[em]\\\\[en]\\\\*(lq\\\\*(rq\"\n      =?>para (text \"- \\\\“”—–“”\")\n    , \"replace2\" =:\n      \"\\\\t\\\\e\\\\`\\\\^\\\\|\\\\'\" =?>para (text \"\\\\`\\8202\\8198'\")\n    , \"comment  with \\\\\\\"\" =:\n      \"Foo \\\\\\\" bar\\n\" =?>para (text \"Foo\")\n    , \"comment with \\\\#\" =:\n      \"Foo\\\\#\\nbar\\n\" =?>para (text \"Foobar\")\n    , \"two letter escapes\" =:\n      \"\\\\(oA\\\\(~O\" =?>para (text \"ÅÕ\")\n    , \"bracketed escapes\" =:\n      \"\\\\[oA]\\\\[~O]\\\\[Do]\\\\[Ye]\\\\[product]\\\\[ul]\" =?>para (text \"ÅÕ$¥∏_\")\n    , \"unicode escapes\" =:\n      \"\\\\[u2020]\" =?>para (text \"†\")\n    , \"unicode escapes (combined)\" =:\n      \"\\\\[u0075_u0301]\" =?>para (text \"\\250\")\n    , \"unknown escape (#5034)\" =:\n       \"\\\\9\" =?>para (text \"9\")\n    ],\n  testGroup \"Lists\" [\n      \"bullet\" =:\n      \".IP \\\"\\\\[bu]\\\"\\nfirst\\n.IP \\\"\\\\[bu]\\\"\\nsecond\"\n      =?> bulletList [para $ str \"first\", para $ str \"second\"]\n    , \"ordered\" =:\n      \".IP 2 a\\nfirst\\n.IP 3 a\\nsecond\"\n      =?> orderedListWith (2,Decimal,DefaultDelim) [para $ str \"first\", para $ str \"second\"]\n    , \"upper\" =:\n      \".IP A) a\\nfirst\\n.IP B) a\\nsecond\"\n      =?> orderedListWith (1,UpperAlpha,OneParen) [para $ str \"first\", para $ str \"second\"]\n    , \"nested\" =:\n      \".IP \\\"\\\\[bu]\\\"\\nfirst\\n.RS\\n.IP \\\"\\\\[bu]\\\"\\n1a\\n.IP \\\"\\\\[bu]\\\"\\n1b\\n.RE\"\n      =?> bulletList [para (str \"first\") <> bulletList [para $ str \"1a\", para $ str \"1b\"]]\n    , \"change in list style\" =:\n      \".IP \\\\[bu]\\nfirst\\n.IP 1\\nsecond\"\n      =?> bulletList [para (str \"first\")] <>\n            orderedListWith (1,Decimal,DefaultDelim) [para (str \"second\")]\n    ],\n  testGroup \"CodeBlocks\" [\n      \"cb1\"=:\n      \".nf\\naa\\n\\tbb\\n.fi\"\n      =?> codeBlock \"aa\\n\\tbb\"\n    ],\n  testGroup \"Tables\" [\n      \"t1\" =:\n      \".TS\\nallbox;\\nl l l.\\na\\tb\\tc\\nd\\te\\tf\\n.TE\"\n      =?> table\n            emptyCaption\n            (replicate 3 (AlignLeft, ColWidthDefault))\n            (TableHead nullAttr [])\n            [TableBody nullAttr 0 [] $ map toRow\n              [map (plain . str ) [\"a\", \"b\", \"c\"],\n               map (plain . str ) [\"d\", \"e\", \"f\"]]]\n            (TableFoot nullAttr []),\n      \"longcell\" =:\n      \".TS\\n;\\nr.\\nT{\\na\\nb\\nc d\\nT}\\nf\\n.TE\"\n      =?> table\n            emptyCaption\n            [(AlignRight, ColWidthDefault)]\n            (TableHead nullAttr [])\n            [TableBody nullAttr 0 [] $ map toRow [[plain $ text \"a b c d\"], [plain $ str \"f\"]]]\n            (TableFoot nullAttr [])\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Markdown.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Markdown\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the Markdown reader.\n-}\nmodule Tests.Readers.Markdown (tests) where\n\nimport Data.Text (Text, unpack)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nmarkdown :: Text -> Pandoc\nmarkdown = purely $ readMarkdown def { readerExtensions =\n                            disableExtension Ext_smart pandocExtensions }\n\nmarkdownSmart :: Text -> Pandoc\nmarkdownSmart = purely $  readMarkdown def { readerExtensions =\n                             enableExtension Ext_smart pandocExtensions }\n\nmarkdownGH :: Text -> Pandoc\nmarkdownGH = purely $ readMarkdown def {readerExtensions = enableExtension\n                 Ext_wikilinks_title_before_pipe githubMarkdownExtensions }\n\nmarkdownMMD :: Text -> Pandoc\nmarkdownMMD = purely $ readMarkdown def {\n                 readerExtensions = multimarkdownExtensions }\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test markdown\n\ntestBareLink :: (Text, Inlines) -> TestTree\ntestBareLink (inp, ils) =\n  test (purely $ readMarkdown def{ readerExtensions =\n             extensionsFromList [Ext_autolink_bare_uris, Ext_raw_html] })\n       (unpack inp) (inp, doc $ para ils)\n\nautolink :: String -> Inlines\nautolink = autolinkWith (\"\",[\"uri\"],[])\n\nautolinkWith :: Attr -> String -> Inlines\nautolinkWith attr s = linkWith attr s' \"\" (str s')\n  where s' = T.pack s\n\nwikilink :: Attr\nwikilink = (mempty, [\"wikilink\"], mempty)\n\nbareLinkTests :: [(Text, Inlines)]\nbareLinkTests =\n  [ (\"http://google.com is a search engine.\",\n     autolink \"http://google.com\" <> \" is a search engine.\")\n  , (\"<a href=\\\"http://foo.bar.baz\\\">http://foo.bar.baz</a>\",\n     rawInline \"html\" \"<a href=\\\"http://foo.bar.baz\\\">\" <>\n     \"http://foo.bar.baz\" <> rawInline \"html\" \"</a>\")\n  , (\"Try this query: http://google.com?search=fish&time=hour.\",\n     \"Try this query: \" <> autolink \"http://google.com?search=fish&time=hour\" <> \".\")\n  , (\"HTTPS://GOOGLE.COM,\",\n      autolink \"HTTPS://GOOGLE.COM\" <> \",\")\n  , (\"http://el.wikipedia.org/wiki/Τεχνολογία,\",\n      autolink \"http://el.wikipedia.org/wiki/Τεχνολογία\" <> \",\")\n  , (\"doi:10.1000/182,\",\n      autolink \"doi:10.1000/182\" <> \",\")\n  , (\"git://github.com/foo/bar.git,\",\n      autolink \"git://github.com/foo/bar.git\" <> \",\")\n  , (\"file:///Users/joe/joe.txt, and\",\n      autolink \"file:///Users/joe/joe.txt\" <> \", and\")\n  , (\"mailto:someone@somedomain.com.\",\n      autolink \"mailto:someone@somedomain.com\" <> \".\")\n  , (\"Use http: this is not a link!\",\n      \"Use http: this is not a link!\")\n  , (\"(http://google.com).\",\n      \"(\" <> autolink \"http://google.com\" <> \").\")\n  , (\"http://en.wikipedia.org/wiki/Sprite_(computer_graphics)\",\n      autolink \"http://en.wikipedia.org/wiki/Sprite_(computer_graphics)\")\n  , (\"http://en.wikipedia.org/wiki/Sprite_[computer_graphics]\",\n      linkWith (\"\",[\"uri\"],[])\n        \"http://en.wikipedia.org/wiki/Sprite_%5Bcomputer_graphics%5D\" \"\"\n        (str \"http://en.wikipedia.org/wiki/Sprite_[computer_graphics]\"))\n  , (\"http://en.wikipedia.org/wiki/Sprite_{computer_graphics}\",\n      linkWith (\"\",[\"uri\"],[])\n        \"http://en.wikipedia.org/wiki/Sprite_%7Bcomputer_graphics%7D\" \"\"\n        (str \"http://en.wikipedia.org/wiki/Sprite_{computer_graphics}\"))\n  , (\"http://example.com/Notification_Center-GitHub-20101108-140050.jpg\",\n      autolink \"http://example.com/Notification_Center-GitHub-20101108-140050.jpg\")\n  , (\"https://github.com/github/hubot/blob/master/scripts/cream.js#L20-20\",\n      autolink \"https://github.com/github/hubot/blob/master/scripts/cream.js#L20-20\")\n  , (\"http://www.rubyonrails.com\",\n      autolink \"http://www.rubyonrails.com\")\n  , (\"http://www.rubyonrails.com:80\",\n      autolink \"http://www.rubyonrails.com:80\")\n  , (\"http://www.rubyonrails.com/~minam\",\n      autolink \"http://www.rubyonrails.com/~minam\")\n  , (\"https://www.rubyonrails.com/~minam\",\n      autolink \"https://www.rubyonrails.com/~minam\")\n  , (\"http://www.rubyonrails.com/~minam/url%20with%20spaces\",\n      autolink \"http://www.rubyonrails.com/~minam/url%20with%20spaces\")\n  , (\"http://www.rubyonrails.com/foo.cgi?something=here\",\n      autolink \"http://www.rubyonrails.com/foo.cgi?something=here\")\n  , (\"http://www.rubyonrails.com/foo.cgi?something=here&and=here\",\n      autolink \"http://www.rubyonrails.com/foo.cgi?something=here&and=here\")\n  , (\"http://www.rubyonrails.com/contact;new\",\n      autolink \"http://www.rubyonrails.com/contact;new\")\n  , (\"http://www.rubyonrails.com/contact;new%20with%20spaces\",\n      autolink \"http://www.rubyonrails.com/contact;new%20with%20spaces\")\n  , (\"http://www.rubyonrails.com/contact;new?with=query&string=params\",\n      autolink \"http://www.rubyonrails.com/contact;new?with=query&string=params\")\n  , (\"http://www.rubyonrails.com/~minam/contact;new?with=query&string=params\",\n      autolink \"http://www.rubyonrails.com/~minam/contact;new?with=query&string=params\")\n  , (\"http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007\",\n      autolink \"http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007\")\n  , (\"http://www.mail-archive.com/rails@lists.rubyonrails.org/\",\n      autolink \"http://www.mail-archive.com/rails@lists.rubyonrails.org/\")\n  , (\"http://www.amazon.com/Testing-Equal-Sign-In-Path/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1198861734&sr=8-1\",\n      autolink \"http://www.amazon.com/Testing-Equal-Sign-In-Path/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1198861734&sr=8-1\")\n  , (\"http://en.wikipedia.org/wiki/Texas_hold%27em\",\n      autolink \"http://en.wikipedia.org/wiki/Texas_hold%27em\")\n  , (\"https://www.google.com/doku.php?id=gps:resource:scs:start\",\n      autolink \"https://www.google.com/doku.php?id=gps:resource:scs:start\")\n  , (\"http://www.rubyonrails.com\",\n      autolink \"http://www.rubyonrails.com\")\n  , (\"http://manuals.ruby-on-rails.com/read/chapter.need_a-period/103#page281\",\n      autolink \"http://manuals.ruby-on-rails.com/read/chapter.need_a-period/103#page281\")\n  , (\"http://foo.example.com/controller/action?parm=value&p2=v2#anchor123\",\n      autolink \"http://foo.example.com/controller/action?parm=value&p2=v2#anchor123\")\n  , (\"http://foo.example.com:3000/controller/action\",\n      autolink \"http://foo.example.com:3000/controller/action\")\n  , (\"http://foo.example.com:3000/controller/action+pack\",\n      autolink \"http://foo.example.com:3000/controller/action+pack\")\n  , (\"http://business.timesonline.co.uk/article/0,,9065-2473189,00.html\",\n      autolink \"http://business.timesonline.co.uk/article/0,,9065-2473189,00.html\")\n  , (\"http://www.mail-archive.com/ruby-talk@ruby-lang.org/\",\n      autolink \"http://www.mail-archive.com/ruby-talk@ruby-lang.org/\")\n  , (\"https://example.org/?anchor=lala-\",\n      autolink \"https://example.org/?anchor=lala-\")\n  , (\"https://example.org/?anchor=-lala\",\n      autolink \"https://example.org/?anchor=-lala\")\n  ]\n\n{-\np_markdown_round_trip :: Block -> Bool\np_markdown_round_trip b = matches d' d''\n  where d'  = normalize $ Pandoc (Meta [] [] []) [b]\n        d'' = normalize\n              $ readMarkdown def { readerSmart = True }\n              $ writeMarkdown def d'\n        matches (Pandoc _ [Plain []]) (Pandoc _ []) = True\n        matches (Pandoc _ [Para []]) (Pandoc _ []) = True\n        matches (Pandoc _ [Plain xs]) (Pandoc _ [Para xs']) = xs == xs'\n        matches x y = x == y\n-}\n\ntests :: [TestTree]\ntests = [ testGroup \"inline code\"\n          [ \"with attribute\" =:\n            \"`document.write(\\\"Hello\\\");`{.javascript}\"\n            =?> para\n                (codeWith (\"\",[\"javascript\"],[]) \"document.write(\\\"Hello\\\");\")\n          , \"with attribute space\" =:\n            \"`*` {.haskell .special x=\\\"7\\\"}\"\n            =?> para (code \"*\" <> space <> str \"{.haskell\" <> space <>\n                      str \".special\" <> space <> str \"x=\\\"7\\\"}\")\n          ]\n        , testGroup \"inline code in lists (regression tests for #6284)\" $\n          let lists = [(\"ordered\", \"1. \", ol), (\"bullet\", \"- \", ul)]\n              ol = orderedListWith (1, Decimal, Period)\n              ul = bulletList\n              items =\n                [ (\"in text\"                , [\"If `(1) x`, then `2`\"], [text \"If \" <> code \"(1) x\" <> text \", then \" <> code \"2\"])\n                , (\"at start\"               , [\"`#. x`\"              ], [code \"#. x\"                                             ])\n                , (\"at start\"               , [\"`- x`\"               ], [code \"- x\"                                              ])\n                , (\"after literal backticks\", [\"`x``#. x`\"           ], [code \"x``#. x\"                                          ])\n                , (\"after literal backticks\", [\"`x``- x`\"            ], [code \"x``- x\"                                           ])\n                ]\n              lis = [\"`text\",\"y\",\"x`\"]\n              bldLsts w lsts txts\n                = let (res, res', f) =\n                         foldr (\\((_, _, lt), lc) (acc, tacc, t) ->\n                             if lt [] == t []\n                             then (acc, lc : tacc, lt)\n                             else (join t tacc acc, [lc], lt))\n                           (mempty, [], mconcat)\n                           (zip lsts (map text txts))\n                      join t tacc acc = case tacc of\n                          [] -> acc\n                          [x] -> t [plain x] <> acc\n                          xs -> t (map w xs) <> acc\n                  in join f res' res\n          in [\"code with list marker \"<>mp<>\" in \" <> ln <> \" list\" =:\n              T.intercalate \"\\n\" (map (lstr <>) istrs) =?> lbld (map plain iblds)\n              | (ln, lstr, lbld) <- lists, (mp, istrs, iblds) <- items]\n          <> [ \"lists with newlines in backticks\" =:\n               T.intercalate \"\\n\" (zipWith (\\i (_, lt, _) -> lt <> i) lis lsts)\n               =?> bldLsts plain lsts lis\n             | lsts <- [ [i, j, k] | i <- lists, j <- lists, k <- lists]\n             ]\n          <> [ \"lists with blank lines and indent in backticks\" =:\n               T.intercalate (\"\\n\\n\" <> T.replicate 4 \" \") (zipWith (\\i (_, lt, _) -> lt <> i) lis (l:ls))\n               <> \"\\n\"\n               =?> let (_, _, f) = l\n                   in f . pure $ (para . text $ \"`text\") <> bldLsts para ls (drop 1 lis)\n             | (l:ls) <- [ [i, j, k] | i <- lists, j <- lists, k <- lists]\n             ]\n        , testGroup \"emph and strong\"\n          [ \"two strongs in emph\" =:\n             \"***a**b **c**d*\" =?> para (emph (strong (str \"a\") <> str \"b\" <> space\n                                         <> strong (str \"c\") <> str \"d\"))\n          , \"emph and strong emph alternating\" =:\n            \"*xxx* ***xxx*** xxx\\n*xxx* ***xxx*** xxx\"\n            =?> para (emph \"xxx\" <> space <> strong (emph \"xxx\") <>\n                      space <> \"xxx\" <> softbreak <>\n                      emph \"xxx\" <> space <> strong (emph \"xxx\") <>\n                      space <> \"xxx\")\n          , \"emph with spaced strong\" =:\n            \"*x **xx** x*\"\n            =?> para (emph (\"x\" <> space <> strong \"xx\" <> space <> \"x\"))\n          , \"intraword underscore with opening underscore (#1121)\" =:\n            \"_foot_ball_\" =?> para (emph (text \"foot_ball\"))\n          ]\n        , testGroup \"raw LaTeX\"\n          [ \"in URL\" =:\n            \"\\\\begin\\n\" =?> para (text \"\\\\begin\")\n          ]\n        , testGroup \"raw HTML\"\n          [ \"nesting (issue #1330)\" =:\n            \"<del>test</del>\" =?>\n            rawBlock \"html\" \"<del>\" <> plain (str \"test\") <>\n            rawBlock \"html\" \"</del>\"\n          , \"invalid tag (issue #1820\" =:\n            \"</ div></.div>\" =?>\n            para (text \"</ div></.div>\")\n          , \"technically invalid comment\" =:\n            \"<!-- pandoc --help -->\" =?>\n            rawBlock \"html\" \"<!-- pandoc --help -->\"\n          , test markdownGH \"issue 2469\" $\n            \"<\\n\\na>\" =?>\n            para (text \"<\") <> para (text \"a>\")\n          ]\n        , testGroup \"raw email addresses\"\n          [ test markdownGH \"issue 2940\" $\n            \"**@user**\" =?>\n            para (strong (text \"@user\"))\n          ]\n        , testGroup \"emoji\"\n          [ test markdownGH \"emoji symbols\" $\n            \":smile: and :+1:\" =?> para (spanWith (\"\", [\"emoji\"], [(\"data-emoji\", \"smile\")]) \"😄\" <>\n                                         space <> str \"and\" <> space <>\n                                         spanWith (\"\", [\"emoji\"], [(\"data-emoji\", \"+1\")]) \"👍\")\n          ]\n        , \"unbalanced brackets\" =:\n            \"[[[[[[[[[[[[hi\" =?> para (text \"[[[[[[[[[[[[hi\")\n        , testGroup \"backslash escapes\"\n          [ \"in URL\" =:\n            \"[hi](/there\\\\))\"\n            =?> para (link \"/there)\" \"\" \"hi\")\n          , \"in title\" =:\n            \"[hi](/there \\\"a\\\\\\\"a\\\")\"\n            =?> para (link \"/there\" \"a\\\"a\" \"hi\")\n          , \"in reference link title\" =:\n            \"[hi]\\n\\n[hi]: /there (a\\\\)a)\"\n            =?> para (link \"/there\" \"a)a\" \"hi\")\n          , \"in reference link URL\" =:\n            \"[hi]\\n\\n[hi]: /there\\\\.0\"\n            =?> para (link \"/there.0\" \"\" \"hi\")\n          ]\n        , testGroup \"bare URIs\"\n             (map testBareLink bareLinkTests)\n        , testGroup \"autolinks\"\n          [ \"with unicode dash following\" =:\n            \"<http://foo.bar>\\8212\" =?> para (autolink \"http://foo.bar\" <>\n                                         str \"\\8212\")\n          , \"a partial URL (#2277)\" =:\n            \"<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>\" =?>\n            para (text \"<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>\")\n          , \"with some attributes\" =:\n            \"<http://foo.bar>{#i .j .z k=v}\" =?>\n            para (autolinkWith (\"i\", [\"j\", \"z\"], [(\"k\", \"v\")]) \"http://foo.bar\")\n          , \"with some attributes and spaces\" =:\n            \"<http://foo.bar> {#i .j .z k=v}\" =?>\n            para (autolink \"http://foo.bar\" <> space <> text \"{#i .j .z k=v}\")\n          ]\n        , testGroup \"links\"\n          [ \"no autolink inside link\" =:\n            \"[<https://example.org>](url)\" =?>\n            para (link \"url\" \"\" (text \"<https://example.org>\"))\n          , \"no inline link inside link\" =:\n            \"[[a](url2)](url)\" =?>\n            para (link \"url\" \"\" (text \"[a](url2)\"))\n          , \"no bare URI inside link\" =:\n            \"[https://example.org(](url)\" =?>\n            para (link \"url\" \"\" (text \"https://example.org(\"))\n          ]\n        , testGroup \"Github wiki links\"\n          [ test markdownGH \"autolink\" $\n            \"[[https://example.org]]\" =?>\n            para (linkWith wikilink \"https://example.org\" \"\" (str \"https://example.org\"))\n          , test markdownGH \"link with title\" $\n            \"[[title|https://example.org]]\" =?>\n            para (linkWith wikilink \"https://example.org\" \"\" (str \"title\"))\n          , test markdownGH \"bad link with title\" $\n            \"[[title|random string]]\" =?>\n            para (linkWith wikilink \"random string\" \"\" (str \"title\"))\n          , test markdownGH \"autolink not being a link\" $\n            \"[[Name of page]]\" =?>\n            para (linkWith wikilink \"Name of page\" \"\" (text \"Name of page\"))\n          , test markdownGH \"autolink not being a link with a square bracket\" $\n            \"[[Name of ]page]]\" =?>\n            para (linkWith wikilink \"Name of ]page\" \"\" (text \"Name of ]page\"))\n          , test markdownGH \"link with inline start should be a link\" $\n            \"[[t`i*t_le|https://example.org]]\" =?>\n            para (linkWith wikilink \"https://example.org\" \"\" (str \"t`i*t_le\"))\n          ]\n        , testGroup \"Headers\"\n          [ \"blank line before header\" =:\n            \"\\n# Header\\n\"\n            =?> headerWith (\"header\",[],[]) 1 \"Header\"\n          , \"bracketed text (#2062)\" =:\n            \"# [hi]\\n\"\n            =?> headerWith (\"hi\",[],[]) 1 \"[hi]\"\n          , \"ATX header without trailing #s\" =:\n            \"# Foo bar\\n\\n\" =?>\n            headerWith (\"foo-bar\",[],[]) 1 \"Foo bar\"\n          , \"ATX header without trailing #s\" =:\n            \"# Foo bar with # #\" =?>\n            headerWith (\"foo-bar-with\",[],[]) 1 \"Foo bar with #\"\n          , \"setext header\" =:\n            \"Foo bar\\n=\\n\\n Foo bar 2 \\n=\" =?>\n            headerWith (\"foo-bar\",[],[]) 1 \"Foo bar\"\n            <> headerWith (\"foo-bar-2\",[],[]) 1 \"Foo bar 2\"\n          ]\n        , testGroup \"Implicit header references\"\n          [ \"ATX header without trailing #s\" =:\n            \"# Header\\n[header]\\n\\n[header ]\\n\\n[ header]\" =?>\n            headerWith (\"header\",[],[]) 1 \"Header\"\n            <> para (link \"#header\" \"\" (text \"header\"))\n            <> para (link \"#header\" \"\" (text \"header\"))\n            <> para (link \"#header\" \"\" (text \"header\"))\n          , \"ATX header with trailing #s\" =:\n            \"# Foo bar #\\n[foo bar]\\n\\n[foo bar ]\\n\\n[ foo bar]\" =?>\n            headerWith (\"foo-bar\",[],[]) 1 \"Foo bar\"\n            <> para (link \"#foo-bar\" \"\" (text \"foo bar\"))\n            <> para (link \"#foo-bar\" \"\" (text \"foo bar\"))\n            <> para (link \"#foo-bar\" \"\" (text \"foo bar\"))\n          , \"setext header\" =:\n            \" Header \\n=\\n\\n[header]\\n\\n[header ]\\n\\n[ header]\" =?>\n            headerWith (\"header\",[],[]) 1 \"Header\"\n            <> para (link \"#header\" \"\" (text \"header\"))\n            <> para (link \"#header\" \"\" (text \"header\"))\n            <> para (link \"#header\" \"\" (text \"header\"))\n          ]\n        , testGroup \"smart punctuation\"\n          [ test markdownSmart \"quote before ellipses\"\n            (\"'...hi'\"\n            =?> para (singleQuoted \"…hi\"))\n          , test markdownSmart \"apostrophe before emph\"\n            (\"D'oh! A l'*aide*!\"\n            =?> para (\"D’oh! A l’\" <> emph \"aide\" <> \"!\"))\n          , test markdownSmart \"apostrophe in French\"\n            (\"À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»\"\n            =?> para \"À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»\")\n          , test markdownSmart \"apostrophe after math\" $ -- issue #1909\n              \"The value of the $x$'s and the systems' condition.\" =?>\n              para (text \"The value of the \" <> math \"x\" <> text \"\\8217s and the systems\\8217 condition.\")\n          , test markdownSmart \"unclosed double quote\"\n            (\"**this should \\\"be bold**\"\n            =?> para (strong \"this should \\8220be bold\"))\n          ]\n        , testGroup \"sub- and superscripts\"\n          [\n            test markdownMMD \"normal subscript\"\n            (\"H~2~\"\n            =?> para (\"H\" <> subscript \"2\"))\n          , test markdownMMD \"normal superscript\"\n            (\"x^3^\"\n            =?> para (\"x\" <> superscript \"3\"))\n          , test markdownMMD \"short subscript delimited by space\"\n            (\"O~2 is dangerous\"\n            =?> para (\"O\" <> subscript \"2\" <> space <> \"is dangerous\"))\n          , test markdownMMD \"short subscript delimited by newline\"\n            (\"O~2\\n\"\n            =?> para (\"O\" <> subscript \"2\"))\n          , test markdownMMD \"short subscript delimited by EOF\"\n            (\"O~2\"\n            =?> para (\"O\" <> subscript \"2\"))\n          , test markdownMMD \"short subscript delimited by punctuation\"\n            (\"O~2.\"\n            =?> para (\"O\" <> subscript \"2\" <> \".\"))\n          , test markdownMMD \"short subscript delimited by emph\"\n            (\"O~2*combustible!*\"\n            =?> para (\"O\" <> subscript \"2\" <> emph \"combustible!\"))\n          , test markdownMMD \"no nesting in short subscripts\"\n            (\"y~*2*\"\n            =?> para (\"y~\" <> emph \"2\"))\n          , test markdownMMD \"short superscript delimited by space\"\n            (\"x^2 = y\"\n            =?> para (\"x\" <> superscript \"2\" <> space <> \"= y\"))\n          , test markdownMMD \"short superscript delimited by newline\"\n            (\"x^2\\n\"\n            =?> para (\"x\" <> superscript \"2\"))\n          , test markdownMMD \"short superscript delimited by ExF\"\n            (\"x^2\"\n            =?> para (\"x\" <> superscript \"2\"))\n          , test markdownMMD \"short superscript delimited by punctuation\"\n            (\"x^2.\"\n            =?> para (\"x\" <> superscript \"2\" <> \".\"))\n          , test markdownMMD \"short superscript delimited by emph\"\n            (\"x^2*combustible!*\"\n            =?> para (\"x\" <> superscript \"2\" <> emph \"combustible!\"))\n          , test markdownMMD \"no nesting in short superscripts\"\n            (\"y^*2*\"\n            =?> para (\"y^\" <> emph \"2\"))\n          ]\n        , testGroup \"footnotes\"\n          [ \"indent followed by newline and flush-left text\" =:\n            \"[^1]\\n\\n[^1]: my note\\n\\n     \\nnot in note\\n\"\n            =?> para (note (para \"my note\")) <> para \"not in note\"\n          , \"indent followed by newline and indented text\" =:\n            \"[^1]\\n\\n[^1]: my note\\n     \\n    in note\\n\"\n            =?> para (note (para \"my note\" <> para \"in note\"))\n          , \"recursive note\" =:\n            \"[^1]\\n\\n[^1]: See [^1]\\n\"\n            =?> para (note (para \"See [^1]\"))\n          ]\n        , testGroup \"lhs\"\n          [ test (purely $ readMarkdown def{ readerExtensions = enableExtension\n                       Ext_literate_haskell pandocExtensions })\n              \"inverse bird tracks and html\"\n              $ (\"> a\\n\\n< b\\n\\n<div>\\n\" :: Text)\n              =?> codeBlockWith (\"\",[\"haskell\",\"literate\"],[]) \"a\"\n                  <>\n                  codeBlockWith (\"\",[\"haskell\"],[]) \"b\"\n                  <>\n                  divWith (\"\",[],[]) mempty\n          ]\n-- the round-trip properties frequently fail\n--        , testGroup \"round trip\"\n--          [ property \"p_markdown_round_trip\" p_markdown_round_trip\n--          ]\n        , testGroup \"definition lists\"\n          [ \"no blank space\" =:\n            \"foo1\\n  :  bar\\n\\nfoo2\\n  : bar2\\n  : bar3\\n\" =?>\n            definitionList [ (text \"foo1\", [plain (text \"bar\")])\n                           , (text \"foo2\", [plain (text \"bar2\"),\n                                            plain (text \"bar3\")])\n                           ]\n          , \"blank space before first def\" =:\n            \"foo1\\n\\n  :  bar\\n\\nfoo2\\n\\n  : bar2\\n  : bar3\\n\" =?>\n            definitionList [ (text \"foo1\", [para (text \"bar\")])\n                           , (text \"foo2\", [plain (text \"bar2\"),\n                                            para (text \"bar3\")])\n                           ]\n          , \"blank space before second def\" =:\n            \"foo1\\n  :  bar\\n\\nfoo2\\n  : bar2\\n\\n  : bar3\\n\" =?>\n            definitionList [ (text \"foo1\", [plain (text \"bar\")])\n                           , (text \"foo2\", [plain (text \"bar2\"),\n                                            plain (text \"bar3\")])\n                           ]\n          , \"laziness\" =:\n            \"foo1\\n  :  bar\\nbaz\\n  : bar2\\n\" =?>\n            definitionList [ (text \"foo1\", [plain (text \"bar\" <>\n                                                 softbreak <> text \"baz\"),\n                                            plain (text \"bar2\")])\n                           ]\n          , \"no blank space before first of two paragraphs\" =:\n            \"foo1\\n  : bar\\n\\n    baz\\n\" =?>\n            definitionList [ (text \"foo1\", [plain (text \"bar\") <>\n                                            plain (text \"baz\")])\n                           ]\n          , \"first line not indented\" =:\n            \"foo\\n: bar\\n\" =?>\n            definitionList [ (text \"foo\", [plain (text \"bar\")]) ]\n          , \"list in definition\" =:\n            \"foo\\n:   - bar\\n\" =?>\n            definitionList [ (text \"foo\", [bulletList [plain (text \"bar\")]]) ]\n          , \"in div\" =:\n            \"<div>foo\\n:   - bar\\n</div>\" =?>\n            divWith nullAttr (definitionList\n              [ (text \"foo\", [bulletList [plain (text \"bar\")]]) ])\n          ]\n        , testGroup \"lists\"\n          [ \"issue #1154\" =:\n              \" -  <div>\\n    first div breaks\\n    </div>\\n\\n    <button>if this button exists</button>\\n\\n    <div>\\n    with this div too.\\n    </div>\\n\"\n              =?> bulletList [divWith nullAttr (para $ text \"first div breaks\") <>\n                              rawBlock \"html\" \"<button>\" <>\n                              plain (text \"if this button exists\") <>\n                              rawBlock \"html\" \"</button>\" <>\n                              divWith nullAttr (para $ text \"with this div too.\")]\n          , test markdownGH \"issue #1636\" $\n              T.unlines [ \"* a\"\n                        , \"* b\"\n                        , \"* c\"\n                        , \"    * d\" ]\n              =?>\n              bulletList [ plain \"a\"\n                         , plain \"b\"\n                         , plain \"c\" <> bulletList [plain \"d\"] ]\n          ]\n        , testGroup \"entities\"\n          [ \"character references\" =:\n            \"&lang; &ouml;\" =?> para (text \"\\10216 ö\")\n          , \"numeric\" =:\n            \"&#44;&#x44;&#X44;\" =?> para (text \",DD\")\n          , \"in link title\" =:\n            \"[link](/url \\\"title &lang; &ouml; &#44;\\\")\" =?>\n               para (link \"/url\" \"title \\10216 ö ,\" (text \"link\"))\n          ]\n        , testGroup \"citations\"\n          [ \"simple\" =:\n            \"@item1\" =?> para (cite [\n                Citation{ citationId      = \"item1\"\n                        , citationPrefix  = []\n                        , citationSuffix  = []\n                        , citationMode    = AuthorInText\n                        , citationNoteNum = 1\n                        , citationHash    = 0\n                        }\n                ] \"@item1\")\n          , \"key starts with digit\" =:\n            \"@1657:huyghens\" =?> para (cite [\n                Citation{ citationId      = \"1657:huyghens\"\n                        , citationPrefix  = []\n                        , citationSuffix  = []\n                        , citationMode    = AuthorInText\n                        , citationNoteNum = 1\n                        , citationHash    = 0\n                        }\n                ] \"@1657:huyghens\")\n          ]\n        , let citation = cite [Citation \"cita\" [] [] AuthorInText 1 0] (str \"@cita\")\n          in testGroup \"footnote/link following citation\" -- issue #2083\n          [ \"footnote\" =:\n              T.unlines [ \"@cita[^note]\"\n                        , \"\"\n                        , \"[^note]: note\" ] =?>\n              para (\n                citation <> note (para $ str \"note\")\n              )\n          , \"normal link\" =:\n              \"@cita [link](http://www.com)\" =?>\n              para (\n                citation <> space <> link \"http://www.com\" \"\" (str \"link\")\n              )\n          , \"reference link\" =:\n              T.unlines [ \"@cita [link][link]\"\n                        , \"\"\n                        , \"[link]: http://www.com\" ] =?>\n              para (\n                citation <> space <> link \"http://www.com\" \"\" (str \"link\")\n              )\n          , \"short reference link\" =:\n              T.unlines [ \"@cita [link]\"\n                        , \"\"\n                        , \"[link]: http://www.com\" ] =?>\n              para (\n                citation <> space <> link \"http://www.com\" \"\" (str \"link\")\n              )\n          , \"implicit header link\" =:\n              T.unlines [ \"# Header\"\n                        , \"@cita [Header]\" ] =?>\n              headerWith (\"header\",[],[]) 1 (str \"Header\") <> para (\n                citation <> space <> link \"#header\" \"\" (str \"Header\")\n              )\n          , \"regular citation\" =:\n              \"@cita [foo]\" =?>\n              para (\n                cite [Citation \"cita\" [] [Str \"foo\"] AuthorInText 1 0]\n                  (str \"@cita\" <> space <> str \"[foo]\")\n              )\n          ]\n      , testGroup \"figures\"\n        [ \"latex placement\" =:\n          \"![caption](img.jpg){latex-placement=\\\"htbp\\\" alt=\\\"alt text\\\"}\" =?>\n          figureWith (\"\", [], [(\"latex-placement\", \"htbp\")])\n            (simpleCaption $ plain \"caption\")\n            (plain $ image (T.pack \"img.jpg\") (T.pack \"\") (text \"alt text\"))\n        ]\n      ]\n"
  },
  {
    "path": "test/Tests/Readers/Mdoc.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Mdoc\n   Copyright   : © 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : \n   Stability   : alpha\n   Portability : portable\n\nTests for the Mdoc reader.\n-}\n\nmodule Tests.Readers.Mdoc (tests) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nmdoc :: Text -> Pandoc\nmdoc = purely $ readMdoc def\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test mdoc\n\ncls :: Text -> Attr\ncls x = (mempty, [x], mempty)\n\ntests :: [TestTree]\ntests = [\n  testGroup \"one-line enclosures\"\n    [ \"Dq\" =:\n        \".Dq hello world\" =?>\n        para (doubleQuoted \"hello world\")\n    , \"Sq\" =:\n        \".Sq hello world\" =?>\n        para (singleQuoted \"hello world\")\n    , \"empty\" =:\n        \".Dq\" =?>\n        para (doubleQuoted mempty)\n    , \"nested\" =:\n        \".Dq Pq hello world\" =?>\n        para (doubleQuoted \"(hello world)\")\n    , \"nested with closing delimiters\" =:\n        \".Dq Pq hi mom !\" =?>\n        para (doubleQuoted \"(hi mom)\" <> \"!\")\n    , \"nested multiline enclosure\" =:\n        \".Dq Po a \\\\&; b \\\\&; c Pc .\" =?>\n        para (doubleQuoted \"(a ; b ; c)\" <> \".\")\n    , \"with inlines\" =:\n        \".Dq hello Sy world .\" =?>\n        para (doubleQuoted (\"hello\" <> space <> strong \"world\" <> \".\"))\n    , \"with text production\" =:\n        \".Dq I love the St -iso8601 standard!\" =?>\n        para (doubleQuoted \"I love the ISO 8601 standard!\")\n    , \"with Ns\" =:\n        \".Op , Ns Ar value ...\" =?>\n        para (\"[,\" <> (codeWith (cls \"variable\") \"value ...\") <> \"]\")\n    , \"ending with open delimiter\" =:\n        \".Dq hi (\" =?>\n        para (doubleQuoted \"hi (\")\n    ]\n  , testGroup \"multiline enclosures\"\n    [ \"nested multiline\" =:\n        T.unlines [\".Bo\", \".Po\", \"hi\", \".Pc\", \".Bc\"] =?>\n        para (\"[(hi)]\")\n    , \"nested on one line\" =:\n        \".Bo Po hi Pc Bc\" =?>\n        para (\"[(hi)]\")\n    , \"with wacky delimiters\" =:\n        \".Bo ( | hi ! Bc ?\" =?>\n        para (\"([| hi!]?\")\n    ]\n  , testGroup \"simple inlines\"\n    [ \"Sy\" =:\n        \".Sy hello world\" =?>\n        para (strong \"hello world\")\n    , \"Em\" =:\n        \".Em hello world\" =?>\n        para (emph \"hello world\")\n    , \"Ev\" =:\n        \".Ev HELLO_WORLD ,\" =?>\n        para (codeWith (cls \"Ev\") \"HELLO_WORLD\" <> \",\")\n    , \"Ar\" =:\n        \".Ar ) z\" =?>\n        para (codeWith (cls \"variable\") \"file ...\" <> \") \" <> codeWith (cls \"variable\") \"z\")\n    , \"In\" =:\n        \".In ( math.h ) b c\" =?>\n        para (\"(\" <> codeWith (cls \"In\") \"<math.h>\" <> \") b c\")\n    , \"Mt\" =:\n        \".Mt a@example.org , b@example.org\" =?>\n        para ((link \"mailto:a@example.org\" \"\" \"a@example.org\") <>\n               \",\" <> space <> (link \"mailto:b@example.org\" \"\" \"b@example.org\"))\n    , \"No\" =:\n        \".No ( hello , world ! )\" =?>\n        para \"(hello, world!)\"\n    , \"empty Pa with closing punctuation\" =:\n        \".Pa ) z\" =?>\n        para (spanWith (cls \"Pa\") \"~\" <> \")\" <> space <> spanWith (mempty, [\"Pa\"], mempty) \"z\")\n    , \"delimiters\" =:\n        \".Sy ( hello world )\" =?>\n        para (mconcat [\"(\", strong \"hello world\", \")\"])\n    , \"multiple\" =:\n        \".Sy hello Em world\" =?>\n        para (strong \"hello\" <> space <> emph \"world\")\n    ]\n  , testGroup \"Fl\"\n    [ \"simple\" =:\n        \".Fl w\" =?>\n        para (codeWith (cls \"Fl\") \"-w\")\n    , \"multiple\" =:\n        \".Fl W all\" =?>\n        para (codeWith (cls \"Fl\") \"-W\" <> space <> codeWith (cls \"Fl\") \"-all\")\n    , \"empty with following macro\" =:\n        \".Fl Cm x\" =?>\n        para (codeWith (cls \"Fl\") \"-\" <> codeWith (cls \"Cm\") \"x\")\n    , \"enclosed with following macro\" =:\n        \".Pq Fl Cm x\" =?>\n        para (\"(\" <> codeWith (cls \"Fl\") \"-\" <> codeWith (cls \"Cm\") \"x\" <> \")\")\n    -- XXX this is a mandoc delta, the period is meant to land outside\n    -- the enclosure. parseInline has learned how to defer eols but not\n    -- closing delimiters\n    , \"enclosed with following delimiters\" =:\n        \".Pq Fl x .\" =?>\n        para (\"(\" <> codeWith (cls \"Fl\") \"-x\" <> \".)\")\n    , \"following Ns\" =:\n        \".Fl W Ns Cm all\" =?>\n        para (codeWith (cls \"Fl\") \"-W\" <> codeWith (cls \"Cm\") \"all\")\n    , \"GNU\" =:\n        \".Fl -help\" =?>\n        para (codeWith (cls \"Fl\") \"--help\")\n    , \"GNU escaped\" =:\n        \".Fl \\\\-help\" =?>\n        para (codeWith (cls \"Fl\") \"--help\")\n    , \"GNU Fl Fl\" =:\n        \".Fl Fl help\" =?>\n        para (codeWith (cls \"Fl\") \"--help\")\n    , \"punctuation\" =:\n        \".Op Fl a | b\" =?>\n        para (\"[\" <> codeWith (cls \"Fl\") \"-a\" <> \" | \" <> codeWith (cls \"Fl\") \"-b\" <> \"]\")\n    , \"middle close paren\" =:\n        \".Fl a ) z\" =?>\n        para (codeWith (cls \"Fl\") \"-a\" <> \") \" <> codeWith (cls \"Fl\") \"-z\")\n    , \"empty with close paren\" =:\n        \".Fl ) z\" =?>\n        para (codeWith (cls \"Fl\") \"-\" <> \") \" <> codeWith (cls \"Fl\") \"-z\")\n    , \"empty with pipe\" =:\n        \".Fl | z\" =?>\n        para (codeWith (cls \"Fl\") \"-\" <> \" | \" <> codeWith (cls \"Fl\") \"-z\")\n    , \"empty with parens\" =:\n        \".Fl ( )\" =?>\n        para (\"(\" <> codeWith (cls \"Fl\") \"-\" <> \")\")\n    ]\n  , testGroup \"links\"\n    [ \"basic\" =:\n        \".Lk href name\" =?>\n        para (link \"href\" \"\" \"name\")\n    , \"complicated\" =:\n        \".Lk , ( href name )\" =?>\n        para (\",\" <> space <> \"(\" <> link \"href\" \"\" \"name\" <> \")\")\n    , \"unnamed\" =:\n        \".Lk href\" =?>\n        para (link \"href\" \"\" \"href\")\n    ]\n  , testGroup \"Ns macro\"\n    [ \"at the beginning of a macro line (mandoc delta)\" =:\n        T.unlines [\".Op before\", \".Ns Op after\"] =?>\n        para \"[before] [after]\"  -- mandoc: warning\n    , \"after a block closing macro\" =:\n        T.unlines [\".Oo before\", \".Oc Ns Op after\"] =?>\n        para \"[before][after]\"\n    , \"in the middle of a macro line\" =:\n        \".Oo before Oc Ns Op after\" =?>\n        para \"[before][after]\"\n    , \"before closing punctuation\" =:\n        \".Oo before Oc Ns : Op after\" =?>\n        para \"[before]: [after]\"  -- mandoc: warning\n    , \"after closing punctuation\" =:\n        \".Oo before Oc : Ns Op after\" =?>\n        para \"[before]:[after]\"\n    , \"at the end of a macro line\" =:\n        T.unlines [\".Oo before Oc Ns\", \".Op after\"] =?>\n        para \"[before][after]\"\n    , \"at the end of a partial-implicit line\" =:\n        T.unlines [\".Op before Ns\", \".Op after\"] =?>\n        para \"[before][after]\"\n    , \"normal words\" =:\n        \".No no Ns ns No no\" =?>\n        para (\"nons\" <> space <> \"no\")\n    , \"opening punctuation\" =:\n        \".No no Ns \\\"(\\\" ns No no\" =?>\n        para (\"no(ns\" <> space <> \"no\")\n    , \"closing punctuation\" =:\n        \".No no \\\"Ns\\\" ns \\\")\\\" No no\" =?>\n        para (\"nons)\" <> space <> \"no\")\n    ]\n  , testGroup \"spacing mode\"\n    [ \"all text\" =:\n        T.unlines [\"a\", \".Sm off\", \"b c\", \"d\", \".Sm on\", \"e\"] =?>\n        para (\"a b c d e\")\n    , \"text around macro\" =:\n        T.unlines [\"a\", \".Sm off\", \".Sy b c\", \".Sm on\", \"d\"] =?>\n        para (\"a\" <> space <> strong \"bc\" <> space <> \"d\")\n    , \"mulitple macros\" =:\n        T.unlines [\"a\", \".Sm off\", \".Sy b Em c\", \".Sm on\", \"d\"] =?>\n        para (\"a\" <> space <> strong \"b\" <> emph \"c\" <> space <> \"d\")\n    , \"mulitple control lines\" =:\n        T.unlines [\"a\", \".Sm off\", \".Sy b\", \".Em c\", \".Sm on\", \"d\"] =?>\n        para (\"a\" <> space <> strong \"b\" <> emph \"c\" <> space <> \"d\")\n    , \"mixed control and text lines\" =:\n        T.unlines [\"a\", \".Sm off\", \".Sy b\", \"c\", \".Em d\", \".Sm on\", \"d\"] =?>\n        para (\"a\" <> space <> strong \"b\" <> \"c\" <> emph \"d\" <> space <> \"d\")\n    , \"delimiters\" =:\n        T.unlines [\".Sm off\", \".Em a \", \".Em [ b | c ]\", \".Sm on\"] =?>\n        para (emph \"a\" <> \"[\" <> emph \"b\" <> \"|\" <> emph \"c\" <> \"]\")\n    ]\n  , testGroup \"Ap macro\"\n    [ \"in the middle of a macro line\" =:\n        \".Xr mandoc 1 Ap s\" =?>\n        para (spanWith (cls \"Xr\") \"mandoc(1)\" <> \"'s\")\n    -- mandoc difference: the edge case of \"Ap (\" tested in this mandoc regress\n    -- isn't present in any actual OpenBSD base system manuals, where Ap is\n    -- only ever followed by a letter. Furthermore, \"Ap\" is generally uncommon\n    -- compared to \"Ns '\" (e.g. \".Xr mandoc 1 Ns 's\"). I'm accepting a\n    -- difference from mandoc here because correctly suppressing space after\n    -- the \"(\" here would require more refactoring than I feel like doing at\n    -- time of writing.\n    -- per mandoc, should be: para (strong \"bold\" <> \"'(\" <> strong \"bold\")\n    , \"with punctuation and called macro\" =:\n        \".Sy bold Ap ( \\\"Sy\\\" bold\" =?>\n        para (strong \"bold\" <> \"'( \" <> strong \"bold\")\n    ]\n  , testGroup \"Pf macro\"\n    [ \"closing punctuation\" =:\n        \".Pf . right .\" =?>\n        para \".right.\"\n    , \"double punctuation\" =:\n        \".Pf . . double\" =?>\n        para \".. double\"\n    , \"opening punctuation\" =:\n        \".Pf ( left .\" =?>\n        para \"(left.\"\n    , \"unparsed argument\" =:\n        \".Pf Ar Sy gument \" =?>\n        para (\"Ar\" <> strong \"gument\")\n    ]\n  , testGroup \"text production\"\n    [ \"early NetBSD versions\" =:\n        T.unlines [\".Nx 0.9a\", \"and\", \".Nx 9.4b\"] =?>\n        para \"NetBSD 0.9A and NetBSD 9.4b\"\n    , \"with Ns\" =:\n        \".Ox Ns -specific\" =?>\n        para \"OpenBSD-specific\"\n    , \"with punctuation\" =:\n        \".Fx ,\" =?>\n        para \"FreeBSD,\"\n    , \"with argument and punctuation\" =:\n        \".Fx 12.0 .\" =?>\n        para \"FreeBSD 12.0.\"\n    , \"BSD alone\" =:\n        \".Bx .\" =?>\n        para \"BSD.\"\n    , \"BSD with macro\" =:\n        \".Bx No rocks\" =?>\n        para \"BSD rocks\"\n    , \"BSD with version\" =:\n        \".Bx 4.4 ,\" =?>\n        para \"4.4BSD,\"\n    , \"BSD with variant\" =:\n        \".Bx 4.3 tahoe !\" =?>\n        para \"4.3BSD-Tahoe!\"\n    ]\n  , testGroup \"inline punctuation\"\n    [ testGroup \"leading punctuation\"\n      [ \"open paren\"           =: \".Em ( b\"     =?> para (\"(\" <> emph \"b\")\n      , \"open square bracket\"  =: \".Em \\\"[\\\" b\" =?> para (\"[\" <> emph \"b\")\n      , \"pipe\"                 =: \".Em | b\"     =?> para (\"|\" <> space <> emph \"b\")\n      , \"period\"               =: \".Em . b\"     =?> para (\".\" <> space <> emph \"b\")\n      , \"comma\"                =: \".Em , b\"     =?> para (\",\" <> space <> emph \"b\")\n      , \"semicolon\"            =: \".Em ; b\"     =?> para (\";\" <> space <> emph \"b\")\n      , \"colon\"                =: \".Em : b\"     =?> para (\":\" <> space <> emph \"b\")\n      , \"question mark\"        =: \".Em ? b\"     =?> para (\"?\" <> space <> emph \"b\")\n      , \"exclamation\"          =: \".Em ! b\"     =?> para (\"!\" <> space <> emph \"b\")\n      , \"close paren\"          =: \".Em ) b\"     =?> para (\")\" <> space <> emph \"b\")\n      , \"close square bracket\" =: \".Em \\\"]\\\" b\" =?> para (\"]\" <> space <> emph \"b\")\n      ]\n    , testGroup \"trailing punctuation\"\n      [ \"open paren\"           =: \".Em a (\"     =?> para (emph \"a\" <> space <> \"(\")\n      , \"open square bracket\"  =: \".Em a [\"     =?> para (emph \"a\" <> space <> \"[\")\n      , \"pipe\"                 =: \".Em a |\"     =?> para (emph \"a\" <> space <> \"|\")\n      , \"period\"               =: \".Em a .\"     =?> para (emph \"a\" <> \".\")\n      , \"comma\"                =: \".Em a ,\"     =?> para (emph \"a\" <> \",\")\n      , \"semicolon\"            =: \".Em a ;\"     =?> para (emph \"a\" <> \";\")\n      , \"colon\"                =: \".Em a :\"     =?> para (emph \"a\" <> \":\")\n      , \"question mark\"        =: \".Em a ?\"     =?> para (emph \"a\" <> \"?\")\n      , \"exclamation\"          =: \".Em a !\"     =?> para (emph \"a\" <> \"!\")\n      , \"close parens\"         =: \".Em a \\\")\\\"\" =?> para (emph \"a\" <> \")\")\n      , \"close square bracket\" =: \".Em a ]\"     =?> para (emph \"a\" <> \"]\")\n      ]\n    , testGroup \"middle punctuation\"\n      [ \"open paren\"           =: \".Em a ( b\"     =?> para (mconcat [emph \"a\", space, \"(\", emph \"b\"])\n      , \"open square bracket\"  =: \".Em a [ b\"     =?> para (mconcat [emph \"a\", space, \"[\", emph \"b\"])\n      , \"pipe\"                 =: \".Em a \\\"|\\\" b\" =?> para (mconcat [emph \"a\", space, \"|\", space, emph \"b\"])\n      , \"period\"               =: \".Em a . b\"     =?> para (mconcat [emph \"a\", \".\", space, emph \"b\"])\n      , \"comma\"                =: \".Em a , b\"     =?> para (mconcat [emph \"a\", \",\", space, emph \"b\"])\n      , \"semicolon\"            =: \".Em a ; b\"     =?> para (mconcat [emph \"a\", \";\", space, emph \"b\"])\n      , \"colon\"                =: \".Em a \\\":\\\" b\" =?> para (mconcat [emph \"a\", \":\", space, emph \"b\"])\n      , \"question mark\"        =: \".Em a ? b\"     =?> para (mconcat [emph \"a\", \"?\", space, emph \"b\"])\n      , \"exclamation\"          =: \".Em a ! b\"     =?> para (mconcat [emph \"a\", \"!\", space, emph \"b\"])\n      , \"close paren\"          =: \".Em a ) b\"     =?> para (mconcat [emph \"a\", \")\", space, emph \"b\"])\n      , \"close square bracket\" =: \".Em a ] b\"     =?> para (mconcat [emph \"a\", \"]\", space, emph \"b\"])\n      ]\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Muse.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Muse\n   Copyright   : © 2017-2020 Alexander Krotov\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Alexander Krotov <ilabdsf@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nTests for the Muse reader.\n-}\nmodule Tests.Readers.Muse (tests) where\n\nimport Data.List (intersperse)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\namuse :: Text -> Pandoc\namuse = purely $ readMuse def { readerExtensions = extensionsFromList [Ext_amuse]}\n\nemacsMuse :: Text -> Pandoc\nemacsMuse = purely $ readMuse def { readerExtensions = emptyExtensions }\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test amuse\n\nspcSep :: [Inlines] -> Inlines\nspcSep = mconcat . intersperse space\n\nsimpleTable' :: Int -> Caption -> [Blocks] -> [[Blocks]] -> Blocks\nsimpleTable' n capt headers rows\n  = table capt\n          (replicate n (AlignDefault, ColWidthDefault))\n          (TableHead nullAttr $ toHeaderRow headers)\n          [TableBody nullAttr 0 [] $ map toRow rows]\n          (TableFoot nullAttr [])\n  where\n    toRow = Row nullAttr . map simpleCell\n    toHeaderRow l = [toRow l | not (null l)]\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"Inlines\"\n      [ \"Plain String\" =:\n          \"Hello, World\" =?>\n          para \"Hello, World\"\n\n      , \"Muse is not XML\" =: \"&lt;\" =?> para \"&lt;\"\n\n      , \"Emphasis\" =:\n        \"*Foo bar*\" =?>\n        para (emph . spcSep $ [\"Foo\", \"bar\"])\n\n      , \"Newline in the beginning of emphasis\" =:\n        \"*\\nFoo bar*\" =?>\n        para (text \"*\\nFoo bar*\")\n      , \"Newline in the end of emphasis\" =:\n        \"*Foo bar\\n*\" =?>\n        para (text \"*Foo bar\\n*\")\n\n      , \"Comma after closing *\" =:\n        \"Foo *bar*, baz\" =?>\n        para (\"Foo \" <> emph \"bar\" <> \", baz\")\n\n      , \"Letter after closing *\" =:\n        \"Foo *bar*x baz\" =?>\n        para \"Foo *bar*x baz\"\n\n      , \"Letter before opening *\" =:\n        \"Foo x*bar* baz\" =?>\n        para \"Foo x*bar* baz\"\n\n      , \"Digit after closing *\" =:\n        \"Foo *bar*0 baz\" =?>\n        para \"Foo *bar*0 baz\"\n\n      , \"Emphasis tag\" =:\n        \"<em>Foo bar</em>\" =?>\n        para (emph . spcSep $ [\"Foo\", \"bar\"])\n\n      , \"Strong\" =:\n          \"**Cider**\" =?>\n          para (strong \"Cider\")\n\n      , \"Strong tag\" =: \"<strong>Strong</strong>\" =?> para (strong \"Strong\")\n\n      , \"Strong Emphasis\" =:\n          \"***strength***\" =?>\n          para (strong . emph $ \"strength\")\n\n      , \"Strong inside emphasis\" =:\n        \"*foo **bar** baz*\" =?>\n        para (emph (text \"foo \" <> strong (text \"bar\") <> text \" baz\"))\n\n      , \"Emphasis inside strong\" =:\n        \"**foo *bar* baz**\" =?>\n        para (strong (text \"foo \" <> emph (text \"bar\") <> text \" baz\"))\n\n      , \"Opening asterisk can't be preceded by another one\" =:\n        \"**foo*\" =?>\n        para \"**foo*\"\n\n      , \"Asterisk between words does not terminate emphasis\" =:\n        \"*foo*bar*\" =?>\n        para (emph \"foo*bar\")\n\n      , \"Two asterisks between words do not terminate emphasis\" =:\n        \"*foo**bar*\" =?>\n        para (emph \"foo**bar\")\n\n      , \"Three asterisks between words do not terminate emphasis\" =:\n        \"*foo***bar*\" =?>\n        para (emph \"foo***bar\")\n\n      , \"Two asterisks between words do not terminate strong\" =:\n        \"**foo**bar**\" =?>\n        para (strong \"foo**bar\")\n\n      , \"Three asterisks between words do not terminate strong\" =:\n        \"**foo***bar**\" =?>\n        para (strong \"foo***bar\")\n\n      , \"Three asterisks between words do not terminate strong emphasis\" =:\n        \"***foo***bar***\" =?>\n        para (strong . emph $ \"foo***bar\")\n\n      , \"Six asterisks between words do not terminate strong emphasis\" =:\n        \"***foo******bar***\" =?>\n        para (strong . emph $ \"foo******bar\")\n\n      , test emacsMuse \"Underline\"\n        (\"_Underline_\" =?> para (underline \"Underline\"))\n\n      , \"Superscript tag\" =: \"<sup>Superscript</sup>\" =?> para (superscript \"Superscript\")\n\n      , \"Subscript tag\" =: \"<sub>Subscript</sub>\" =?> para (subscript \"Subscript\")\n\n      , \"Strikeout tag\" =: \"<del>Strikeout</del>\" =?> para (strikeout \"Strikeout\")\n\n      , \"Opening inline tags\" =: \"foo <em> bar <strong>baz\" =?> para \"foo <em> bar <strong>baz\"\n\n      , \"Closing inline tags\" =: \"foo </em> bar </strong>baz\" =?> para \"foo </em> bar </strong>baz\"\n\n      , \"Tag soup\" =: \"foo <em> bar </strong>baz\" =?> para \"foo <em> bar </strong>baz\"\n\n      -- Both inline tags must be within the same paragraph\n      , \"No multiparagraph inline tags\" =:\n        T.unlines [ \"First line\"\n                  , \"<em>Second line\"\n                  , \"\"\n                  , \"Fourth line</em>\"\n                  ] =?>\n        para \"First line\\n<em>Second line\" <>\n        para \"Fourth line</em>\"\n\n      , \"Linebreak\" =: \"Line <br>  break\" =?> para (\"Line\" <> linebreak <> \"break\")\n\n      , \"Trailing whitespace inside paragraph\" =:\n        T.unlines [ \"First line \" -- trailing whitespace here\n                  , \"second line\"\n                  ]\n        =?> para \"First line\\nsecond line\"\n\n      , \"Non-breaking space\" =: \"Foo~~bar\" =?> para \"Foo\\160bar\"\n      , \"Single ~\" =: \"Foo~bar\" =?> para \"Foo~bar\"\n\n      , testGroup \"Code markup\"\n        [ \"Code\" =: \"=foo(bar)=\" =?> para (code \"foo(bar)\")\n\n        , \"Not code\" =: \"a=b= =c=d\" =?> para (text \"a=b= =c=d\")\n\n        -- Emacs Muse 3.20 parses this as code, we follow Amusewiki\n        , \"Not code if closing = is detached\" =: \"=this is not a code =\" =?> para \"=this is not a code =\"\n\n        , \"Not code if opening = is detached\" =: \"= this is not a code=\" =?> para \"= this is not a code=\"\n\n        , \"Code if followed by comma\" =:\n          \"Foo =bar=, baz\" =?>\n          para (text \"Foo \" <> code \"bar\" <> text \", baz\")\n\n        , \"Not code if followed by digit\" =:\n          \"Foo =bar=0 baz\" =?>\n          para (text \"Foo =bar=0 baz\")\n\n        , \"One character code\" =: \"=c=\" =?> para (code \"c\")\n\n        , \"Code with equal sign\" =: \"=foo = bar=\" =?> para (code \"foo = bar\")\n\n        , \"Three = characters is not a code\" =: \"===\" =?> para \"===\"\n\n        , \"Multiline code markup\" =:\n          \"foo =bar\\nbaz= end of code\" =?>\n          para (text \"foo \" <> code \"bar\\nbaz\" <> text \" end of code\")\n\n{- Emacs Muse 3.20 has a bug: it publishes\n - <p>foo <code>bar\n -\n - baz</code> foo</p>\n - which is displayed as one paragraph by browsers.\n - We follow Amusewiki here and avoid joining paragraphs.\n -}\n        , \"No multiparagraph code\" =:\n          T.unlines [ \"foo =bar\"\n                    , \"\"\n                    , \"baz= foo\"\n                    ] =?>\n          para \"foo =bar\" <>\n          para \"baz= foo\"\n\n        , \"Code at the beginning of paragraph but not first column\" =:\n          \" - =foo=\" =?> bulletList [ para $ code \"foo\" ]\n        ]\n\n      , \"Code tag\" =: \"<code>foo(bar)</code>\" =?> para (code \"foo(bar)\")\n\n      , \"Math tag\" =: \"<math>\\\\sum_{i=0}^n i^2</math>\" =?> para (math \"\\\\sum_{i=0}^n i^2\")\n\n      , \"Verbatim tag\" =: \"*<verbatim>*</verbatim>*\" =?> para (emph \"*\")\n\n      , \"Verbatim inside code\" =: \"<code><verbatim>foo</verbatim></code>\" =?> para (code \"<verbatim>foo</verbatim>\")\n\n      , \"Verbatim tag after text\" =: \"Foo <verbatim>bar</verbatim>\" =?> para \"Foo bar\"\n\n      , \"Verbatim tag escapes block level markup\" =:\n        T.unlines [ \"Foo <verbatim>bar\"\n                  , \"* Not a heading\"\n                  , \"</verbatim>baz\"\n                  ] =?>\n        para \"Foo bar\\n* Not a heading\\nbaz\"\n\n      , \"Class tag\" =: \"<class name=\\\"foo\\\">bar</class>\" =?> para (spanWith (\"\", [\"foo\"], []) \"bar\")\n      , \"Class tag without name\" =: \"<class>foobar</class>\" =?> para (spanWith (\"\", [], []) \"foobar\")\n\n      , \"RTL\" =: \"<<<foo bar>>>\" =?> para (spanWith (\"\", [], [(\"dir\", \"rtl\")]) \"foo bar\")\n      , \"LTR\" =: \">>>foo bar<<<\" =?> para (spanWith (\"\", [], [(\"dir\", \"ltr\")]) \"foo bar\")\n\n      -- <em> tag should match with the last </em> tag, not verbatim one\n      , \"Nested \\\"</em>\\\" inside em tag\" =: \"<em>foo<verbatim></em></verbatim>bar</em>\" =?> para (emph \"foo</em>bar\")\n\n      , testGroup \"Links\"\n        [ \"Link without description\" =:\n          \"[[https://amusewiki.org/]]\" =?>\n          para (link \"https://amusewiki.org/\" \"\" (str \"https://amusewiki.org/\"))\n        , \"Link with description\" =:\n          \"[[https://amusewiki.org/][A Muse Wiki]]\" =?>\n          para (link \"https://amusewiki.org/\" \"\" (text \"A Muse Wiki\"))\n        , \"Link with empty description\" =:\n          \"[[https://amusewiki.org/][]]\" =?>\n          para (link \"https://amusewiki.org/\" \"\" (text \"\"))\n        , \"Image\" =:\n          \"[[image.jpg]]\" =?>\n          para (image \"image.jpg\" \"\" mempty)\n        , \"Closing bracket is not allowed in image filename\" =:\n          \"[[foo]bar.jpg]]\" =?>\n          para (text \"[[foo]bar.jpg]]\")\n        , \"Image with description\" =:\n          \"[[image.jpg][Image]]\" =?>\n          para (image \"image.jpg\" \"\" (text \"Image\"))\n        , \"Image with space in filename\" =:\n          \"[[image name.jpg]]\" =?>\n          para (image \"image name.jpg\" \"\" mempty)\n        , \"Image with width\" =:\n          \"[[image.jpg 60]]\" =?>\n          para (imageWith (\"\", [], [(\"width\", \"60%\")]) \"image.jpg\" mempty mempty)\n        , \"At least one space is required between image filename and width\" =:\n          \"[[image.jpg60]]\" =?>\n          para (link \"image.jpg60\" mempty (str \"image.jpg60\"))\n        , \"Left-aligned image with width\" =:\n          \"[[image.png 60 l][Image]]\" =?>\n          para (imageWith (\"\", [\"align-left\"], [(\"width\", \"60%\")]) \"image.png\" \"\" (str \"Image\"))\n        , \"Right-aligned image with width\" =:\n          \"[[image.png 60 r][Image]]\" =?>\n          para (imageWith (\"\", [\"align-right\"], [(\"width\", \"60%\")]) \"image.png\" \"\" (str \"Image\"))\n        , \"Image link\" =:\n          \"[[URL:image.jpg]]\" =?>\n          para (link \"image.jpg\" \"\" (str \"image.jpg\"))\n        , \"Image link with description\" =:\n          \"[[URL:image.jpg][Image]]\" =?>\n          para (link \"image.jpg\" \"\" (text \"Image\"))\n        -- Implicit links are supported in Emacs Muse, but not in Amusewiki:\n        -- https://github.com/melmothx/text-amuse/issues/18\n        --\n        -- This test also makes sure '=' without whitespace is not treated as code markup\n        , \"No implicit links\" =: \"http://example.org/index.php?action=view&id=1\"\n               =?> para \"http://example.org/index.php?action=view&id=1\"\n        , \"Link with empty URL\" =: \"[[][empty URL]]\" =?> para (link \"\" \"\" (text \"empty URL\"))\n        , \"No footnotes inside links\" =:\n          \"[[https://amusewiki.org/][foo[1]]\" =?>\n          para (link \"https://amusewiki.org/\" \"\" (text \"foo[1\"))\n        , \"Image inside link\" =:\n          \"[[https://amusewiki.org/][Image [[image.png][with it's own description]] inside link description]]\" =?>\n          para (link \"https://amusewiki.org/\" \"\" (text \"Image \" <> image \"image.png\" \"\" (text \"with it's own description\") <> text \" inside link description\"))\n        , \"Link inside image description\" =:\n          \"[[image.jpg][Image from [[https://amusewiki.org/]]]]\" =?>\n          para (image \"image.jpg\" \"\" (text \"Image from \" <> link \"https://amusewiki.org/\" \"\" (str \"https://amusewiki.org/\")))\n        ]\n\n      , testGroup \"Literal\"\n        [ test emacsMuse \"Inline literal\"\n          (\"Foo<literal style=\\\"html\\\">lit</literal>bar\" =?>\n          para (text \"Foo\" <> rawInline \"html\" \"lit\" <> text \"bar\"))\n        , test emacsMuse \"Single inline literal in paragraph\"\n          (\"<literal style=\\\"html\\\">lit</literal>\" =?>\n          para (rawInline \"html\" \"lit\"))\n        ]\n      ]\n\n  , testGroup \"Blocks\"\n      [ \"Block elements end paragraphs\" =:\n        T.unlines [ \"First paragraph\"\n                  , \"----\"\n                  , \"Second paragraph\"\n                  ] =?> para (text \"First paragraph\") <> horizontalRule <> para (text \"Second paragraph\")\n      , testGroup \"Horizontal rule\"\n        [ \"Less than 4 dashes is not a horizontal rule\" =: \"---\" =?> para (text \"---\")\n        , \"4 dashes is a horizontal rule\" =: \"----\" =?> horizontalRule\n        , \"5 dashes is a horizontal rule\" =: \"-----\" =?> horizontalRule\n        , \"4 dashes with spaces is a horizontal rule\" =: \"----  \" =?> horizontalRule\n        ]\n      , testGroup \"Page breaks\"\n        [ \"Page break\" =:\n          \"      * * * * *\" =?>\n          divWith (\"\", [], [(\"style\", \"page-break-before: always;\")]) mempty\n        , \"Page break with trailing space\" =:\n          \"      * * * * * \" =?>\n          divWith (\"\", [], [(\"style\", \"page-break-before: always;\")]) mempty\n        ]\n      , testGroup \"Paragraphs\"\n        [ \"Simple paragraph\" =:\n          T.unlines [ \"First line\"\n                    , \"second line.\"\n                    ] =?>\n          para \"First line\\nsecond line.\"\n        , \"Indented paragraph\" =:\n          T.unlines [ \" First line\"\n                    , \"second line.\"\n                    ] =?>\n          para \"First line\\nsecond line.\"\n        -- Emacs Muse starts a blockquote on the second line.\n        -- We copy Amusewiki behavior and require a blank line to start a blockquote.\n        , \"Indentation in the middle of paragraph\" =:\n           T.unlines [ \"First line\"\n                     , \"  second line\"\n                     , \"third line\"\n                     ] =?>\n           para \"First line\\nsecond line\\nthird line\"\n        , \"Quote\" =:\n          \"  This is a quotation\\n\" =?>\n          blockQuote (para \"This is a quotation\")\n        , \"Indentation does not indicate quote inside quote tag\" =:\n          T.unlines [ \"<quote>\"\n                    , \"  Not a nested quote\"\n                    , \"</quote>\"\n                    ] =?>\n          blockQuote (para \"Not a nested quote\")\n        , \"Multiline quote\" =:\n          T.unlines [ \"  This is a quotation\"\n                    , \"  with a continuation\"\n                    ] =?>\n          blockQuote (para \"This is a quotation\\nwith a continuation\")\n        , testGroup \"Div\"\n          [ \"Div without id\" =:\n            T.unlines [ \"<div>\"\n                      , \"Foo bar\"\n                      , \"</div>\"\n                      ] =?>\n            divWith nullAttr (para \"Foo bar\")\n          , \"Div with id\" =:\n            T.unlines [ \"<div id=\\\"foo\\\">\"\n                      , \"Foo bar\"\n                      , \"</div>\"\n                      ] =?>\n            divWith (\"foo\", [], []) (para \"Foo bar\")\n          ]\n        , \"Biblio\" =:\n          T.unlines [ \"<biblio>\"\n                    , \"\"\n                    , \"Author, *Title*, description\"\n                    , \"\"\n                    , \"Another author, *Another title*, another description\"\n                    , \"\"\n                    , \"</biblio>\"\n                    ] =?>\n          divWith (\"\", [\"biblio\"], []) (para (text \"Author, \" <> emph \"Title\" <> \", description\") <>\n                                        para (text \"Another author, \" <> emph \"Another title\" <> text \", another description\"))\n        , \"Play\" =:\n          T.unlines [ \"<play>\"\n                    , \"Foo bar\"\n                    , \"</play>\"\n                    ] =?>\n          divWith (\"\", [\"play\"], []) (para \"Foo bar\")\n        , \"Verse\" =:\n          T.unlines [ \"> This is\"\n                    , \"> First stanza\"\n                    , \">\" -- Emacs produces verbatim \">\" here, we follow Amusewiki\n                    , \"> And this is\"\n                    , \">   Second stanza\"\n                    , \">\"\n                    , \"\"\n                    , \">\"\n                    , \"\"\n                    , \"> Another verse\"\n                    , \">    is here\"\n                    ] =?>\n          lineBlock [ \"This is\"\n                    , \"First stanza\"\n                    , \"\"\n                    , \"And this is\"\n                    , \"\\160\\160Second stanza\"\n                    , \"\"\n                    ] <>\n          lineBlock [ \"\" ] <>\n          lineBlock [ \"Another verse\"\n                    , \"\\160\\160\\160is here\"\n                    ]\n        ]\n      , \"Verse in list\" =: \" - > foo\" =?> bulletList [ lineBlock [ \"foo\" ] ]\n      , \"Verse line starting with emphasis\" =: \"> *foo* bar\" =?> lineBlock [ emph \"foo\" <> text \" bar\" ]\n      , \"Multiline verse in list\" =:\n        T.unlines [ \" - > foo\"\n                  , \"   > bar\"\n                  ] =?>\n        bulletList [ lineBlock [ \"foo\", \"bar\" ] ]\n      , \"Paragraph after verse in list\" =:\n        T.unlines [ \" - > foo\"\n                  , \"   bar\"\n                  ] =?>\n        bulletList [ lineBlock [ \"foo\" ] <> para \"bar\" ]\n      , \"Empty quote tag\" =:\n        T.unlines [ \"<quote>\"\n                  , \"</quote>\"\n                  ]\n        =?> blockQuote mempty\n      , \"Quote tag\" =:\n        T.unlines [ \"<quote>\"\n                  , \"Hello, world\"\n                  , \"</quote>\"\n                  ]\n        =?> blockQuote (para $ text \"Hello, world\")\n      , \"Nested quote tag\" =:\n        T.unlines [ \"<quote>\"\n                  , \"foo\"\n                  , \"<quote>\"\n                  , \"bar\"\n                  , \"</quote>\"\n                  , \"baz\"\n                  , \"</quote>\"\n                  ] =?>\n        blockQuote (para \"foo\" <> blockQuote (para \"bar\") <> para \"baz\")\n      , \"Indented quote inside list\" =:\n        T.unlines [ \" -  <quote>\"\n                  , \"    foo\"\n                  , \"    </quote>\"\n                  ] =?>\n        bulletList [ blockQuote (para \"foo\") ]\n      , \"Verse tag\" =:\n        T.unlines [ \"<verse>\"\n                  , \"\"\n                  , \"Foo bar baz\"\n                  , \"  One two three\"\n                  , \"\"\n                  , \"</verse>\"\n                  ] =?>\n        lineBlock [ \"\"\n                  , text \"Foo bar baz\"\n                  , text \"\\160\\160One two three\"\n                  , \"\"\n                  ]\n      , \"Verse tag with empty line inside\" =:\n        T.unlines [ \"<verse>\"\n                  , \"\"\n                  , \"</verse>\"\n                  ] =?>\n        lineBlock [ \"\" ]\n      , \"Verse tag with verbatim close tag inside\" =:\n        T.unlines [ \"<verse>\"\n                  , \"<verbatim></verse></verbatim>\"\n                  , \"</verse>\"\n                  ] =?>\n        lineBlock [ \"</verse>\" ]\n      , testGroup \"Example\"\n        [ \"Braces on separate lines\" =:\n          T.unlines [ \"{{{\"\n                    , \"Example line\"\n                    , \"}}}\"\n                    ] =?>\n          codeBlock \"Example line\"\n        , \"Spaces after opening braces\" =:\n          T.unlines [ \"{{{  \"\n                    , \"Example line\"\n                    , \"}}}\"\n                    ] =?>\n          codeBlock \"Example line\"\n        , \"One blank line in the beginning\" =:\n          T.unlines [ \"{{{\"\n                    , \"\"\n                    , \"Example line\"\n                    , \"}}}\"\n                    ] =?>\n          codeBlock \"\\nExample line\"\n        , \"One blank line in the end\" =:\n          T.unlines [ \"{{{\"\n                    , \"Example line\"\n                    , \"\"\n                    , \"}}}\"\n                    ] =?>\n          codeBlock \"Example line\\n\"\n        , \"Indented braces\" =:\n          T.unlines [ \" - {{{\"\n                    , \"   Example line\"\n                    , \"   }}}\"\n                    ] =?>\n          bulletList [ codeBlock \"Example line\" ]\n        , \"Tabs\" =:\n          T.unlines [ \"{{{\"\n                    , \"\\t  foo\"\n                    , \"\\t\\t\"\n                    , \"\\t  bar\"\n                    , \"}}}\"\n                    ] =?>\n          codeBlock \"  foo\\n\\t\\n  bar\"\n        -- Amusewiki requires braces to be on separate line,\n        -- this is an extension.\n        , \"One line\" =:\n          \"{{{Example line}}}\" =?>\n          codeBlock \"Example line\"\n        ]\n      , testGroup \"Example tag\"\n        [ \"Tags on separate lines\" =:\n          T.unlines [ \"<example>\"\n                    , \"Example line\"\n                    , \"</example>\"\n                    ] =?>\n          codeBlock \"Example line\"\n        , \"One line\" =:\n          \"<example>Example line</example>\" =?>\n          codeBlock \"Example line\"\n        , \"One blank line in the beginning\" =:\n          T.unlines [ \"<example>\"\n                    , \"\"\n                    , \"Example line\"\n                    , \"</example>\"\n                    ] =?>\n          codeBlock \"\\nExample line\"\n        , \"One blank line in the end\" =:\n          T.unlines [ \"<example>\"\n                    , \"Example line\"\n                    , \"\"\n                    , \"</example>\"\n                    ] =?>\n          codeBlock \"Example line\\n\"\n        , \"Example inside list\" =:\n          T.unlines [ \" - <example>\"\n                    , \"   foo\"\n                    , \"   </example>\"\n                    ] =?>\n          bulletList [ codeBlock \"foo\" ]\n        , \"Empty example inside list\" =:\n          T.unlines [ \" - <example>\"\n                    , \"   </example>\"\n                    ] =?>\n          bulletList [ codeBlock \"\" ]\n        , \"Example inside list with empty lines\" =:\n          T.unlines [ \" - <example>\"\n                    , \"   foo\"\n                    , \"   </example>\"\n                    , \"\"\n                    , \"   bar\"\n                    , \"\"\n                    , \"   <example>\"\n                    , \"   baz\"\n                    , \"   </example>\"\n                    ] =?>\n          bulletList [ codeBlock \"foo\" <> para \"bar\" <> codeBlock \"baz\" ]\n        , \"Indented example inside list\" =:\n          T.unlines [ \" -  <example>\"\n                    , \"    foo\"\n                    , \"    </example>\"\n                    ] =?>\n          bulletList [ codeBlock \"foo\" ]\n        , \"Example inside definition list\" =:\n          T.unlines [ \" foo :: <example>\"\n                    , \"        bar\"\n                    , \"        </example>\"\n                    ] =?>\n          definitionList [ (\"foo\", [codeBlock \"bar\"]) ]\n        , \"Example inside list definition with empty lines\" =:\n          T.unlines [ \" term :: <example>\"\n                    , \"         foo\"\n                    , \"         </example>\"\n                    , \"\"\n                    , \"         bar\"\n                    , \"\"\n                    , \"         <example>\"\n                    , \"         baz\"\n                    , \"         </example>\"\n                    ] =?>\n          definitionList [ (\"term\", [codeBlock \"foo\" <> para \"bar\" <> codeBlock \"baz\"]) ]\n        , \"Example inside note\" =:\n          T.unlines [ \"Foo[1]\"\n                    , \"\"\n                    , \"[1] <example>\"\n                    , \"    bar\"\n                    , \"    </example>\"\n                    ] =?>\n          para (\"Foo\" <> note (codeBlock \"bar\"))\n        ]\n      , testGroup \"Literal blocks\"\n        [ test emacsMuse \"Literal block\"\n          (T.unlines [ \"<literal style=\\\"latex\\\">\"\n                    , \"\\\\newpage\"\n                    , \"</literal>\"\n                    ] =?>\n          rawBlock \"latex\" \"\\\\newpage\")\n        ]\n      , \"Center\" =:\n        T.unlines [ \"<center>\"\n                  , \"Hello, world\"\n                  , \"</center>\"\n                  ] =?>\n        para (text \"Hello, world\")\n      , \"Right\" =:\n        T.unlines [ \"<right>\"\n                  , \"Hello, world\"\n                  , \"</right>\"\n                  ] =?>\n        para (text \"Hello, world\")\n      , testGroup \"Comments\"\n        [ \"Comment tag\" =: \"<comment>\\nThis is a comment\\n</comment>\" =?> (mempty::Blocks)\n        , \"Line comment\" =: \"; Comment\" =?> (mempty::Blocks)\n        , \"Empty comment\" =: \";\" =?> (mempty::Blocks)\n        , \"Text after empty comment\" =: \";\\nfoo\" =?> para \"foo\" -- Make sure we don't consume newline while looking for whitespace\n        , \"Not a comment (does not start with a semicolon)\" =: \" ; Not a comment\" =?> para (text \"; Not a comment\")\n        , \"Not a comment (has no space after semicolon)\" =: \";Not a comment\" =?> para (text \";Not a comment\")\n        , \"Not a comment (semicolon not in the first column)\" =: \" - ; foo\" =?> bulletList [para \"; foo\"]\n        ]\n      , testGroup \"Headers\"\n        [ \"Part\" =:\n          \"* First level\" =?>\n          header 1 \"First level\"\n        , \"Chapter\" =:\n          \"** Second level\" =?>\n          header 2 \"Second level\"\n        , \"Section\" =:\n          \"*** Third level\" =?>\n          header 3 \"Third level\"\n        , \"Subsection\" =:\n          \"**** Fourth level\" =?>\n          header 4 \"Fourth level\"\n        , \"Subsubsection\" =:\n          \"***** Fifth level\" =?>\n          header 5 \"Fifth level\"\n        , \"Whitespace is required after *\" =: \"**Not a header\" =?> para \"**Not a header\"\n        , \"No headers in footnotes\" =:\n          T.unlines [ \"Foo[1]\"\n                    , \"[1] * Bar\"\n                    ] =?>\n          para (text \"Foo\" <>\n                note (para \"* Bar\"))\n        , \"No headers in quotes\" =:\n          T.unlines [ \"<quote>\"\n                    , \"* Hi\"\n                    , \"</quote>\"\n                    ] =?>\n          blockQuote (para \"* Hi\")\n        , \"Headers consume anchors\" =:\n          T.unlines [ \"; A comment to make sure anchor is not parsed as a directive\"\n                    , \"#bar\"\n                    , \"** Foo\"\n                    ] =?>\n          headerWith (\"bar\",[],[]) 2 \"Foo\"\n        , \"Headers don't consume anchors separated with a blankline\" =:\n          T.unlines [ \"; A comment to make sure anchor is not parsed as a directive\"\n                    , \"#bar\"\n                    , \"\"\n                    , \"** Foo\"\n                    ] =?>\n          para (spanWith (\"bar\", [], []) mempty) <>\n          header 2 \"Foo\"\n        , \"Headers terminate paragraph\" =:\n          T.unlines [ \"foo\"\n                    , \"* bar\"\n                    ] =?>\n          para \"foo\" <> header 1 \"bar\"\n        , \"Headers terminate lists\" =:\n          T.unlines [ \" - foo\"\n                    , \"* bar\"\n                    ] =?>\n          bulletList [ para \"foo\" ] <>\n          header 1 \"bar\"\n        , test emacsMuse \"Paragraphs terminate Emacs Muse headers\"\n          (T.unlines [ \"* Foo\"\n                    , \"bar\"\n                    ] =?> header 1 \"Foo\" <> para \"bar\")\n        , \"Paragraphs don't terminate Text::Amuse headers\" =:\n          T.unlines [ \"* Foo\"\n                    , \"bar\"\n                    ] =?> header 1 \"Foo\\nbar\"\n        , \"Empty header\" =:\n          T.unlines [ \"Foo\"\n                    , \"\"\n                    , \"* \"\n                    , \"\"\n                    , \"bar\"\n                    ] =?> para (text \"Foo\") <> header 1 \"\" <> para (text \"bar\")\n        , test (purely $ readMuse def { readerExtensions = extensionsFromList [Ext_amuse, Ext_auto_identifiers]})\n               \"Auto identifiers\"\n          (T.unlines [ \"* foo\"\n                     , \"** Foo\"\n                     , \"* bar\"\n                     , \"** foo\"\n                     , \"* foo\"\n                     ] =?> headerWith (\"foo\",[],[]) 1 \"foo\" <>\n                           headerWith (\"foo-1\",[],[]) 2 \"Foo\" <>\n                           headerWith (\"bar\",[],[]) 1 \"bar\" <>\n                           headerWith (\"foo-2\",[],[]) 2 \"foo\" <>\n                           headerWith (\"foo-3\",[],[]) 1 \"foo\")\n        ]\n      , testGroup \"Directives\"\n        [ \"Title\" =:\n          \"#title Document title\" =?>\n          let titleInline = toList \"Document title\"\n              meta = setMeta \"title\" (MetaInlines titleInline) nullMeta\n          in Pandoc meta mempty\n        -- Emacs Muse documentation says that \"You can use any combination\n        -- of uppercase and lowercase letters for directives\",\n        -- but also allows '-', which is not documented, but used for disable-tables.\n        , test emacsMuse \"Disable tables\"\n          (\"#disable-tables t\" =?>\n          Pandoc (setMeta \"disable-tables\" (MetaInlines $ toList \"t\") nullMeta) mempty)\n        , \"Multiple directives\" =:\n          T.unlines [ \"#title Document title\"\n                    , \"#subtitle Document subtitle\"\n                    ] =?>\n          Pandoc (setMeta \"title\" (MetaInlines $ toList \"Document title\") $\n                  setMeta \"subtitle\" (MetaInlines $ toList \"Document subtitle\") nullMeta) mempty\n        , \"Multiline directive\" =:\n          T.unlines [ \"#title Document title\"\n                    , \"#notes First line\"\n                    , \"and second line\"\n                    , \"#author Name\"\n                    ] =?>\n          Pandoc (setMeta \"title\" (MetaInlines $ toList \"Document title\") $\n                  setMeta \"notes\" (MetaInlines $ toList \"First line\\nand second line\") $\n                  setMeta \"author\" (MetaInlines $ toList \"Name\") nullMeta) mempty\n        , \"Amusewiki's #cover is translated to pandoc's #cover-image\" =:\n          \"#cover cover.png\" =?>\n          let titleInline = toList \"cover.png\"\n              meta = setMeta \"cover-image\" (MetaInlines titleInline) nullMeta\n          in Pandoc meta mempty\n        ]\n      , testGroup \"Anchors\"\n        [ \"Anchor\" =:\n          T.unlines [ \"; A comment to make sure anchor is not parsed as a directive\"\n                    , \"#anchor Target\"\n                    ] =?>\n          para (spanWith (\"anchor\", [], []) mempty <> \"Target\")\n        , \"Anchor cannot start with a number\" =:\n          T.unlines [ \"; A comment to make sure anchor is not parsed as a directive\"\n                    , \"#0notanchor Target\"\n                    ] =?>\n          para \"#0notanchor Target\"\n        , \"Not anchor if starts with a space\" =:\n          \" #notanchor Target\" =?>\n          para \"#notanchor Target\"\n        , \"Anchor inside a paragraph\" =:\n          T.unlines [ \"Paragraph starts here\"\n                    , \"#anchor and ends here.\"\n                    ] =?>\n          para (\"Paragraph starts here\\n\" <> spanWith (\"anchor\", [], []) mempty <> \"and ends here.\")\n        , \"Anchor with \\\"-\\\"\" =:\n          T.unlines [ \"; A comment to make sure anchor is not parsed as a directive\"\n                    , \"#anchor-id Target\"\n                    ] =?>\n          para (spanWith (\"anchor-id\", [], []) mempty <> \"Target\")\n        ]\n      , testGroup \"Footnotes\"\n        [ \"Simple footnote\" =:\n          T.unlines [ \"Here is a footnote[1].\"\n                    , \"\"\n                    , \"[1] Footnote contents\"\n                    ] =?>\n          para (text \"Here is a footnote\" <>\n                note (para \"Footnote contents\") <>\n                str \".\")\n        , \"Simple secondary footnote\" =:\n          T.unlines [ \"Here is a secondary note{1}.\"\n                    , \"\"\n                    , \"{1} Secondary note contents\"\n                    ] =?>\n          para (text \"Here is a secondary note\" <>\n                note (para \"Secondary note contents\") <>\n                str \".\")\n        , \"Missing footnote\" =: \"Foo[1]\" =?> para \"Foo[1]\"\n        , \"Missing secondary note\" =: \"Foo{1}\" =?> para \"Foo{1}\"\n        , \"Wrong note type\" =:\n          T.unlines [ \"Here is a secondary note{1}\"\n                    , \"\"\n                    , \"Footnote contents[1]\"\n                    ] =?>\n          para \"Here is a secondary note{1}\" <>\n          para \"Footnote contents[1]\"\n        , \"Recursive footnote\" =:\n          T.unlines [ \"Start recursion here[1]\"\n                    , \"\"\n                    , \"[1] Recursion continues here[1]\"\n                    ] =?>\n          para (text \"Start recursion here\" <>\n                note (para \"Recursion continues here[1]\"))\n        , \"Nested footnotes\" =:\n          T.unlines [ \"Footnote: [1]\"\n                    , \"\"\n                    , \"[1] Nested: [2]\"\n                    , \"\"\n                    , \"[2] No recursion: [1]\"\n                    ] =?>\n          para (text \"Footnote: \" <>\n                note (para (text \"Nested: \" <> note (para $ text \"No recursion: [1]\"))))\n        , \"No zero footnotes\" =:\n          T.unlines [ \"Here is a footnote[0].\"\n                    , \"\"\n                    , \"[0] Footnote contents\"\n                    ] =?>\n          para \"Here is a footnote[0].\" <>\n          para \"[0] Footnote contents\"\n        , \"Footnotes can't start with zero\" =:\n          T.unlines [ \"Here is a footnote[01].\"\n                    , \"\"\n                    , \"[01] Footnote contents\"\n                    ] =?>\n          para \"Here is a footnote[01].\" <>\n          para \"[01] Footnote contents\"\n        , testGroup \"Multiparagraph footnotes\"\n          [ \"Amusewiki multiparagraph footnotes\" =:\n            T.unlines [ \"Multiparagraph[1] footnotes[2]\"\n                      , \"\"\n                      , \"[1] First footnote paragraph\"\n                      , \"\"\n                      , \"    Second footnote paragraph\"\n                      , \"with continuation\"\n                      , \"\"\n                      , \"Not a note\"\n                      , \"[2] Second footnote\"\n                      ] =?>\n            para (text \"Multiparagraph\" <>\n                  note (para \"First footnote paragraph\" <>\n                        para \"Second footnote paragraph\\nwith continuation\") <>\n                  text \" footnotes\" <>\n                  note (para \"Second footnote\")) <>\n            para (text \"Not a note\")\n\n          -- Verse requires precise indentation, so it is good to test indentation requirements\n          , \"Note continuation with verse\" =:\n            T.unlines [ \"Foo[1]\"\n                      , \"\"\n                      , \"[1] Bar\"\n                      , \"\"\n                      , \"    > Baz\"\n                      ] =?>\n            para (\"Foo\" <> note (para \"Bar\" <> lineBlock [\"Baz\"]))\n          , \"Footnote ending in self-terminating element and followed by paragraph\" =:\n            T.unlines [ \"Foo[1]\"\n                      , \"\"\n                      , \"[1] > bar\"\n                      , \"baz\"\n                      ] =?>\n            para (str \"Foo\" <> note (lineBlock [\"bar\"])) <> para (str \"baz\")\n\n          , \"Footnote starting with empty line\" =:\n            T.unlines [ \"Foo[1]\"\n                      , \"\"\n                      , \"[1]\" -- No space character after note marker\n                      , \"\"\n                      , \"    Bar\"\n                      ] =?>\n            para (str \"Foo\" <> note (para $ text \"Bar\"))\n          , \"Indentation in footnote starting with empty line\" =:\n            T.unlines [ \"Foo[1]\"\n                      , \"\"\n                      , \"[1]\" -- No space character after note marker\n                      , \"\"\n                      , \"   Bar\"\n                      ] =?>\n            para (str \"Foo\" <> note mempty) <> blockQuote (para $ text \"Bar\")\n          , test emacsMuse \"Emacs multiparagraph footnotes\"\n            (T.unlines\n              [ \"First footnote reference[1] and second footnote reference[2].\"\n              , \"\"\n              , \"[1] First footnote paragraph\"\n              , \"\"\n              , \"Second footnote\"\n              , \"paragraph\"\n              , \"\"\n              , \"[2] Third footnote paragraph\"\n              , \"\"\n              , \"Fourth footnote paragraph\"\n              ] =?>\n            para (text \"First footnote reference\" <>\n                  note (para \"First footnote paragraph\" <>\n                        para \"Second footnote\\nparagraph\") <>\n                  text \" and second footnote reference\" <>\n                  note (para \"Third footnote paragraph\" <>\n                        para \"Fourth footnote paragraph\") <>\n                  text \".\"))\n          ]\n        ]\n      ]\n    , testGroup \"Tables\"\n        [ \"Two cell table\" =:\n          \"One | Two\" =?>\n          simpleTable [] [[plain \"One\", plain \"Two\"]]\n        , \"Table with multiple words\" =:\n          \"One two | three four\" =?>\n          simpleTable [] [[plain \"One two\", plain \"three four\"]]\n        , \"Not a table\" =:\n          \"One| Two\" =?>\n          para (text \"One| Two\")\n        , \"Not a table again\" =:\n          \"One |Two\" =?>\n          para (text \"One |Two\")\n        , \"Two line table\" =:\n          T.unlines\n            [ \"One |  Two\"\n            , \"Three  | Four\"\n            ] =?>\n          simpleTable [] [[plain \"One\", plain \"Two\"],\n                          [plain \"Three\", plain \"Four\"]]\n        , \"Table with one header\" =:\n          T.unlines\n            [ \"First || Second\"\n            , \"Third | Fourth\"\n            ] =?>\n          simpleTable [plain \"First\", plain \"Second\"] [[plain \"Third\", plain \"Fourth\"]]\n        , \"Table with two headers\" =:\n          T.unlines\n            [ \"First || header\"\n            , \"Second || header\"\n            , \"Foo | bar\"\n            ] =?>\n          simpleTable [plain \"First\", plain \"header\"] [[plain \"Second\", plain \"header\"],\n                                                       [plain \"Foo\", plain \"bar\"]]\n        , \"Header and footer reordering\" =:\n          T.unlines\n            [ \"Foo ||| bar\"\n            , \"Baz || foo\"\n            , \"Bar | baz\"\n            ] =?>\n          simpleTable [plain \"Baz\", plain \"foo\"] [[plain \"Bar\", plain \"baz\"],\n                                                  [plain \"Foo\", plain \"bar\"]]\n        , \"Table with caption\" =:\n          T.unlines\n            [ \"Foo || bar || baz\"\n            , \"First | row | here\"\n            , \"Second | row | there\"\n            , \"|+ Table caption +|\"\n            ] =?>\n          simpleTable' 3 (simpleCaption $ plain $ text \"Table caption\")\n                       [plain \"Foo\", plain \"bar\", plain \"baz\"]\n                       [[plain \"First\", plain \"row\", plain \"here\"],\n                        [plain \"Second\", plain \"row\", plain \"there\"]]\n        , \"Table caption with +\" =:\n          T.unlines\n            [ \"Foo | bar\"\n            , \"|+ Table + caption +|\"\n            ] =?>\n          simpleTable' 2 (simpleCaption $ plain $ text \"Table + caption\")\n                       []\n                       [[plain \"Foo\", plain \"bar\"]]\n        , \"Caption without table\" =:\n          \"|+ Foo bar baz +|\" =?>\n          simpleTable' 0 (simpleCaption $ plain $ text \"Foo bar baz\") [] []\n        , \"Table indented with space\" =:\n          T.unlines\n            [ \" Foo | bar\"\n            , \" Baz | foo\"\n            , \" Bar | baz\"\n            ] =?>\n          simpleTable [] [[plain \"Foo\", plain \"bar\"],\n                          [plain \"Baz\", plain \"foo\"],\n                          [plain \"Bar\", plain \"baz\"]]\n        , \"Empty cells\" =:\n          T.unlines\n            [ \" | Foo\"\n            , \" |\"\n            , \" bar |\"\n            , \" || baz\"\n            ] =?>\n          simpleTable [plain \"\", plain \"baz\"] [[plain \"\", plain \"Foo\"],\n                                               [plain \"\", plain \"\"],\n                                               [plain \"bar\", plain \"\"]]\n        , \"Empty cell in the middle\" =:\n          T.unlines\n            [ \" 1 | 2 | 3\"\n            , \" 4 |   | 6\"\n            , \" 7 | 8 | 9\"\n            ] =?>\n          simpleTable []\n                      [[plain \"1\", plain \"2\", plain \"3\"],\n                       [plain \"4\", mempty,    plain \"6\"],\n                       [plain \"7\", plain \"8\", plain \"9\"]]\n        , \"Grid table\" =:\n          T.unlines\n            [ \"+-----+-----+\"\n            , \"| foo | bar |\"\n            , \"+-----+-----+\"\n            ] =?>\n          simpleTable [] [[para \"foo\", para \"bar\"]]\n        , \"Grid table inside list\" =:\n          T.unlines\n            [ \" - +-----+-----+\"\n            , \"   | foo | bar |\"\n            , \"   +-----+-----+\"\n            ] =?>\n          bulletList [simpleTable [] [[para \"foo\", para \"bar\"]]]\n        , \"Grid table with two rows\" =:\n          T.unlines\n            [ \"+-----+-----+\"\n            , \"| foo | bar |\"\n            , \"+-----+-----+\"\n            , \"| bat | baz |\"\n            , \"+-----+-----+\"\n            ] =?>\n          simpleTable [] [[para \"foo\", para \"bar\"]\n                         ,[para \"bat\", para \"baz\"]]\n        , \"Grid table inside grid table\" =:\n          T.unlines\n            [ \"+-----+\"\n            , \"|+---+|\"\n            , \"||foo||\"\n            , \"|+---+|\"\n            , \"+-----+\"\n            ] =?>\n          simpleTable [] [[simpleTable [] [[para \"foo\"]]]]\n        , \"Grid table with example\" =:\n          T.unlines\n            [ \"+------------+\"\n            , \"| <example>  |\"\n            , \"| foo        |\"\n            , \"| </example> |\"\n            , \"+------------+\"\n            ] =?>\n          simpleTable [] [[codeBlock \"foo\"]]\n        ]\n    , testGroup \"Lists\"\n      [ \"Bullet list\" =:\n        T.unlines\n           [ \" - Item1\"\n           , \"\"\n           , \" - Item2\"\n           ] =?>\n        bulletList [ para \"Item1\"\n                   , para \"Item2\"\n                   ]\n      , \"Ordered list\" =:\n        T.unlines\n          [ \" 1. Item1\"\n          , \"\"\n          , \" 2. Item2\"\n          ] =?>\n        orderedListWith (1, Decimal, Period) [ para \"Item1\"\n                                             , para \"Item2\"\n                                             ]\n      , \"Ordered list with implicit numbers\" =:\n        T.unlines\n          [ \" 1. Item1\"\n          , \"\"\n          , \" 1. Item2\"\n          , \"\"\n          , \" 1. Item3\"\n          ] =?>\n        orderedListWith (1, Decimal, Period) [ para \"Item1\"\n                                             , para \"Item2\"\n                                             , para \"Item3\"\n                                             ]\n      , \"Ordered list with roman numerals\" =:\n        T.unlines\n          [ \" i. First\"\n          , \" ii. Second\"\n          , \" iii. Third\"\n          , \" iv. Fourth\"\n          ] =?>\n        orderedListWith (1, LowerRoman, Period) [ para \"First\"\n                                                , para \"Second\"\n                                                , para \"Third\"\n                                                , para \"Fourth\"\n                                                ]\n      , \"Bullet list with empty items\" =:\n        T.unlines\n          [ \" -\"\n          , \"\"\n          , \" - Item2\"\n          ] =?>\n        bulletList [ mempty\n                   , para \"Item2\"\n                   ]\n      , \"Ordered list with empty items\" =:\n        T.unlines\n          [ \" 1.\"\n          , \"\"\n          , \" 2.\"\n          , \"\"\n          , \" 3. Item3\"\n          ] =?>\n        orderedListWith (1, Decimal, Period) [ mempty\n                                             , mempty\n                                             , para \"Item3\"\n                                             ]\n      , \"Bullet list with last item empty\" =:\n        T.unlines\n          [ \" -\"\n          , \"\"\n          , \"foo\"\n          ] =?>\n        bulletList [ mempty ] <>\n        para \"foo\"\n      , testGroup \"Nested lists\"\n        [ \"Nested bullet list\" =:\n          T.unlines [ \" - Item1\"\n                    , \"   - Item2\"\n                    , \"     - Item3\"\n                    , \"   - Item4\"\n                    , \"     - Item5\"\n                    , \" - Item6\"\n                    ] =?>\n          bulletList [ para \"Item1\" <>\n                       bulletList [ para \"Item2\" <>\n                                    bulletList [ para \"Item3\" ]\n                                  , para \"Item4\" <>\n                                    bulletList [ para \"Item5\" ]\n                                  ]\n                     , para \"Item6\"\n                     ]\n        , \"Nested ordered list\" =:\n          T.unlines [ \" 1. Item1\"\n                    , \"    1. Item2\"\n                    , \"       1. Item3\"\n                    , \"    2. Item4\"\n                    , \"       1. Item5\"\n                    , \" 2. Item6\"\n                    ] =?>\n          orderedListWith (1, Decimal, Period) [ para \"Item1\" <>\n                                                 orderedListWith (1, Decimal, Period) [ para \"Item2\" <>\n                                                                                        orderedListWith (1, Decimal, Period) [ para \"Item3\" ]\n                                                                                      , para \"Item4\" <>\n                                                                                        orderedListWith (1, Decimal, Period) [ para \"Item5\" ]\n                                                                                      ]\n                                               , para \"Item6\"\n                                               ]\n        , \"Mixed nested list\" =:\n          T.unlines\n            [ \" - Item1\"\n            , \"   - Item2\"\n            , \"   - Item3\"\n            , \" - Item4\"\n            , \"   1. Nested\"\n            , \"   2. Ordered\"\n            , \"   3. List\"\n            ] =?>\n          bulletList [ mconcat [ para \"Item1\"\n                               , bulletList [ para \"Item2\"\n                                            , para \"Item3\"\n                                            ]\n                               ]\n                     , mconcat [ para \"Item4\"\n                               , orderedListWith (1, Decimal, Period) [ para \"Nested\"\n                                                                      , para \"Ordered\"\n                                                                      , para \"List\"\n                                                                      ]\n                               ]\n                     ]\n        , \"Text::Amuse includes only one space in list marker\" =:\n          T.unlines\n            [ \" -    First item\"\n            , \"   - Nested item\"\n            ] =?>\n          bulletList [ para \"First item\" <> bulletList [ para \"Nested item\"]]\n        ]\n      , \"List continuation\" =:\n         T.unlines\n           [ \" - a\"\n           , \"\"\n           , \"   b\"\n           , \"\"\n           , \"   c\"\n           ] =?>\n         bulletList [ mconcat [ para \"a\"\n                              , para \"b\"\n                              , para \"c\"\n                              ]\n                    ]\n      , \"List continuation after nested list\" =:\n         T.unlines\n           [ \" - - foo\"\n           , \"\"\n           , \"   bar\"\n           ] =?>\n         bulletList [ bulletList [ para \"foo\" ] <>\n                      para \"bar\"\n                    ]\n      -- Emacs Muse allows to separate lists with two or more blank lines.\n      -- Text::Amuse (Amusewiki engine) always creates a single list as of version 0.82.\n      -- pandoc follows Emacs Muse behavior\n      , testGroup \"Blank lines\"\n        [ \"Blank lines between list items are not required\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \" - Bar\"\n            ] =?>\n          bulletList [ para \"Foo\"\n                     , para \"Bar\"\n                     ]\n        , \"One blank line between list items is allowed\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"\"\n            , \" - Bar\"\n            ] =?>\n          bulletList [ para \"Foo\"\n                     , para \"Bar\"\n                     ]\n        , \"Two blank lines separate lists\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"\"\n            , \"\"\n            , \" - Bar\"\n            ] =?>\n          bulletList [ para \"Foo\" ] <> bulletList [ para \"Bar\" ]\n        , \"No blank line after multiline first item\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"   bar\"\n            , \" - Baz\"\n            ] =?>\n          bulletList [ para \"Foo\\nbar\"\n                     , para \"Baz\"\n                     ]\n        , \"One blank line after multiline first item\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"   bar\"\n            , \"\"\n            , \" - Baz\"\n            ] =?>\n          bulletList [ para \"Foo\\nbar\"\n                     , para \"Baz\"\n                     ]\n        , \"Two blank lines after multiline first item\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"   bar\"\n            , \"\"\n            , \"\"\n            , \" - Baz\"\n            ] =?>\n          bulletList [ para \"Foo\\nbar\" ] <> bulletList [ para \"Baz\" ]\n        , \"No blank line after list continuation\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"\"\n            , \"   bar\"\n            , \" - Baz\"\n            ] =?>\n          bulletList [ para \"Foo\" <> para \"bar\"\n                     , para \"Baz\"\n                     ]\n        , \"One blank line after list continuation\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"\"\n            , \"   bar\"\n            , \"\"\n            , \" - Baz\"\n            ] =?>\n          bulletList [ para \"Foo\" <> para \"bar\"\n                     , para \"Baz\"\n                     ]\n        , \"Two blank lines after list continuation\" =:\n          T.unlines\n            [ \" - Foo\"\n            , \"\"\n            , \"   bar\"\n            , \"\"\n            , \"\"\n            , \" - Baz\"\n            ] =?>\n          bulletList [ para \"Foo\" <> para \"bar\" ] <> bulletList [ para \"Baz\" ]\n        , \"No blank line after blockquote\" =:\n          T.unlines\n            [ \" - <quote>\"\n            , \"   foo\"\n            , \"   </quote>\"\n            , \" - bar\"\n            ] =?>\n          bulletList [ blockQuote $ para \"foo\", para \"bar\" ]\n        , \"One blank line after blockquote\" =:\n          T.unlines\n            [ \" - <quote>\"\n            , \"   foo\"\n            , \"   </quote>\"\n            , \"\"\n            , \" - bar\"\n            ] =?>\n          bulletList [ blockQuote $ para \"foo\", para \"bar\" ]\n        , \"Two blank lines after blockquote\" =:\n          T.unlines\n            [ \" - <quote>\"\n            , \"   foo\"\n            , \"   </quote>\"\n            , \"\"\n            , \"\"\n            , \" - bar\"\n            ] =?>\n          bulletList [ blockQuote $ para \"foo\" ] <> bulletList [ para \"bar\" ]\n        , \"No blank line after verse\" =:\n          T.unlines\n            [ \" - > foo\"\n            , \" - bar\"\n            ] =?>\n          bulletList [ lineBlock [ \"foo\" ], para \"bar\" ]\n        , \"One blank line after verse\" =:\n          T.unlines\n            [ \" - > foo\"\n            , \"\"\n            , \" - bar\"\n            ] =?>\n          bulletList [ lineBlock [ \"foo\" ], para \"bar\" ]\n        , \"Two blank lines after verse\" =:\n          T.unlines\n            [ \" - > foo\"\n            , \"\"\n            , \"\"\n            , \" - bar\"\n            ] =?>\n          bulletList [ lineBlock [ \"foo\" ] ] <> bulletList [ para \"bar\" ]\n        ]\n      , \"List ending in self-terminating element and followed by paragraph\" =:\n        T.unlines [ \" - > Foo\"\n                  , \"bar\"\n                  ] =?>\n        bulletList [lineBlock [\"Foo\"]] <> para (str \"bar\")\n      -- Test that definition list requires a leading space.\n      -- Emacs Muse does not require a space, we follow Amusewiki here.\n      , \"Not a definition list\" =:\n        T.unlines\n          [ \"First :: second\"\n          , \"Foo :: bar\"\n          ] =?>\n        para \"First :: second\\nFoo :: bar\"\n      , test emacsMuse \"Emacs Muse definition list\"\n        (T.unlines\n          [ \"First :: second\"\n          , \"Foo :: bar\"\n          ] =?>\n        definitionList [ (\"First\", [ para \"second\" ])\n                       , (\"Foo\", [ para \"bar\" ])\n                       ])\n      , \"Definition list\" =:\n        T.unlines\n          [ \" First :: second\"\n          , \" Foo :: bar\"\n          ] =?>\n        definitionList [ (\"First\", [ para \"second\" ])\n                       , (\"Foo\", [ para \"bar\" ])\n                       ]\n      , \"Definition list term cannot include newline\" =:\n        T.unlines\n          [ \" Foo\" -- \"Foo\" is not a part of the definition list term\n          , \" Bar :: baz\"\n          ] =?>\n        para \"Foo\" <>\n        definitionList [ (\"Bar\", [ para \"baz\" ]) ]\n      , \"One-line definition list\" =: \" foo :: bar\" =?>\n        definitionList [ (\"foo\", [ para \"bar\" ]) ]\n      , \"Definition list term may include single colon\" =:\n        \" foo:bar :: baz\" =?>\n        definitionList [ (\"foo:bar\", [ para \"baz\" ]) ]\n      , \"Definition list term with emphasis\" =: \" *Foo* :: bar\\n\" =?>\n        definitionList [ (emph \"Foo\", [ para \"bar\" ]) ]\n      , \"Definition list term with :: inside code\" =: \" foo <code> :: </code> :: bar <code> :: </code> baz\\n\" =?>\n        definitionList [ (\"foo \" <> code \" :: \", [ para $ \"bar \" <> code \" :: \" <> \" baz\" ]) ]\n      , \"Multi-line definition lists\" =:\n        T.unlines\n          [ \" First term :: Definition of first term\"\n          , \"and its continuation.\"\n          , \" Second term :: Definition of second term.\"\n          ] =?>\n        definitionList [ (\"First term\", [ para \"Definition of first term\\nand its continuation.\" ])\n                       , (\"Second term\", [ para \"Definition of second term.\" ])\n                       ]\n      , \"Definition list with verse\" =:\n        T.unlines\n          [ \" First term :: Definition of first term\"\n          , \"  > First verse\"\n          , \"  > Second line of first verse\"\n          , \"\"\n          , \"               > Second verse\"\n          , \"               > Second line of second verse\"\n          ] =?>\n        definitionList [ (\"First term\", [ para \"Definition of first term\" <>\n                                          lineBlock [ text \"First verse\"\n                                                    , text \"Second line of first verse\"\n                                                    ] <>\n                                          lineBlock [ text \"Second verse\"\n                                                    , text \"Second line of second verse\"\n                                                    ]\n                                        ])\n                       ]\n      , \"Definition list with table\" =:\n        \" foo :: bar | baz\" =?>\n        definitionList [ (\"foo\", [ simpleTable [] [[plain \"bar\", plain \"baz\"]]\n                                 ])]\n      , \"Definition list with table inside bullet list\" =:\n        \" - foo :: bar | baz\" =?>\n        bulletList [definitionList [ (\"foo\", [ simpleTable [] [[plain \"bar\", plain \"baz\"]]\n                                             ])]]\n      , test emacsMuse \"Multi-line definition lists from Emacs Muse manual\"\n        (T.unlines\n          [ \"Term1 ::\"\n          , \"  This is a first definition\"\n          , \"  And it has two lines;\"\n          , \"no, make that three.\"\n          , \"\"\n          , \"Term2 :: This is a second definition\"\n          ] =?>\n         definitionList [ (\"Term1\", [ para \"This is a first definition\\nAnd it has two lines;\\nno, make that three.\"])\n                        , (\"Term2\", [ para \"This is a second definition\"])\n                        ])\n      -- Text::Amuse requires indentation with one space\n      , \"Multi-line definition lists from Emacs Muse manual with initial space\" =:\n        (T.unlines\n          [ \" Term1 ::\"\n          , \"  This is a first definition\"\n          , \"  And it has two lines;\"\n          , \"no, make that three.\"\n          , \"\"\n          , \" Term2 :: This is a second definition\"\n          ] =?>\n         definitionList [ (\"Term1\", [ para \"This is a first definition\\nAnd it has two lines;\\nno, make that three.\"])\n                        , (\"Term2\", [ para \"This is a second definition\"])\n                        ])\n      , \"One-line nested definition list\" =:\n        \" Foo :: bar :: baz\" =?>\n        definitionList [ (\"Foo\", [ definitionList [ (\"bar\", [ para \"baz\" ])]])]\n      , \"Nested definition list\" =:\n        T.unlines\n        [ \" First :: Second :: Third\"\n        , \"          Fourth :: Fifth :: Sixth\"\n        , \" Seventh :: Eighth\"\n        ] =?>\n        definitionList [ (\"First\", [ definitionList [ (\"Second\", [ para \"Third\" ]),\n                                                      (\"Fourth\", [ definitionList [ (\"Fifth\", [ para \"Sixth\"] ) ] ] ) ] ] )\n                       , (\"Seventh\", [ para \"Eighth\" ])\n                       ]\n      , testGroup \"Definition lists with multiple descriptions\"\n        [ \"Correctly indented second description\" =:\n          T.unlines\n          [ \" First term :: first description\"\n          , \"  :: second description\"\n          ] =?>\n          definitionList [ (\"First term\", [ para \"first description\"\n                                          , para \"second description\"\n                                          ])\n                         ]\n        , \"Incorrectly indented second description\" =:\n          T.unlines\n          [ \" First term :: first description\"\n          , \" :: second description\"\n          ] =?>\n          definitionList [ (\"First term\", [ para \"first description\" ])\n                         , (\"\", [ para \"second description\" ])\n                         ]\n        ]\n      , \"Two blank lines separate definition lists\" =:\n        T.unlines\n          [ \" First :: list\"\n          , \"\"\n          , \"\"\n          , \" Second :: list\"\n          ] =?>\n        definitionList [ (\"First\", [ para \"list\" ]) ] <>\n        definitionList [ (\"Second\", [ para \"list\" ]) ]\n      -- Headers in first column of list continuation are not allowed\n      , \"No headers in list continuation\" =:\n        T.unlines\n          [ \" - Foo\"\n          , \"\"\n          , \"   * Bar\"\n          ] =?>\n        bulletList [ mconcat [ para \"Foo\"\n                             , para \"* Bar\"\n                             ]\n                   ]\n      , \"Bullet list inside a tag\" =:\n        T.unlines\n          [ \"<quote>\"\n          , \" - First\"\n          , \"\"\n          , \" - Second\"\n          , \"\"\n          , \" - Third\"\n          , \"</quote>\"\n          ] =?>\n        blockQuote (bulletList [ para \"First\"\n                               , para \"Second\"\n                               , para \"Third\"\n                               ])\n      , \"Ordered list inside a tag\" =:\n        T.unlines\n          [ \"<quote>\"\n          , \" 1. First\"\n          , \"\"\n          , \" 2. Second\"\n          , \"\"\n          , \" 3. Third\"\n          , \"</quote>\"\n          ] =?>\n        blockQuote (orderedListWith (1, Decimal, Period) [ para \"First\"\n                                                         , para \"Second\"\n                                                         , para \"Third\"\n                                                         ])\n      -- Regression test for a bug caught by round-trip test\n      , \"Do not consume whitespace while looking for end tag\" =:\n        T.unlines\n          [ \"<quote>\"\n          , \" - <quote>\"\n          , \"   foo\"\n          , \"   </quote>\"\n          , \" bar\" -- Do not consume whitespace while looking for arbitrarily indented </quote>\n          , \"</quote>\"\n          ] =?>\n        blockQuote (bulletList [ blockQuote $ para \"foo\" ] <> para \"bar\")\n\n      , \"Unclosed quote tag\" =:\n        T.unlines\n          [ \"<quote>\"\n          , \"<verse>\"\n          , \"</quote>\"\n          , \"</verse>\"\n          ] =?>\n        para \"<quote>\" <> lineBlock [ \"</quote>\" ]\n\n      , \"Unclosed quote tag inside list\" =:\n        T.unlines\n          [ \" - <quote>\"\n          , \"   <verse>\"\n          , \"   </quote>\"\n          , \"   </verse>\"\n          ] =?>\n        bulletList [ para \"<quote>\" <> lineBlock [ \"</quote>\" ] ]\n\n      -- Allowing indented closing tags is dangerous,\n      -- as they may terminate lists\n      , \"No indented closing tags\" =:\n        T.unlines\n          [ \"<quote>\"\n          , \"\"\n          , \" - Foo\"\n          , \"\"\n          , \"   </quote>\"\n          , \"\"\n          , \"   bar\"\n          , \"\"\n          , \"   <verse>\"\n          , \"   </quote>\"\n          , \"   </verse>\"\n          , \"</quote>\"\n          ] =?>\n        blockQuote (bulletList [ para \"Foo\" <> para \"</quote>\" <> para \"bar\" <> lineBlock [ \"</quote>\" ] ])\n      ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/ODT.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.ODT\n   Copyright   : © 2015-2024 John MacFarlane\n                   2015 Martin Linnemann\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the ODT reader.\n-}\nmodule Tests.Readers.ODT (tests) where\n\nimport Control.Monad (liftM)\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as B\nimport qualified Data.Map as M\nimport Data.Text (unpack)\nimport System.IO.Unsafe (unsafePerformIO)\nimport Test.Tasty\nimport Tests.Helpers\nimport Text.Pandoc\nimport qualified Text.Pandoc.UTF8 as UTF8\n\ndefopts :: ReaderOptions\ndefopts = def{ readerExtensions = getDefaultExtensions \"odt\" }\n\ntests :: [TestTree]\ntests = testsComparingToMarkdown ++ testsComparingToNative\n\ntestsComparingToMarkdown :: [TestTree]\ntestsComparingToMarkdown    = map nameToTest namesOfTestsComparingToMarkdown\n  where nameToTest     name = createTest\n                                compareODTToMarkdown\n                                name\n                                (toODTPath      name)\n                                (toMarkdownPath name)\n        toODTPath      name = \"odt/odt/\"      ++ name ++ \".odt\"\n        toMarkdownPath name = \"odt/markdown/\" ++ name ++ \".md\"\n\ntestsComparingToNative   :: [TestTree]\ntestsComparingToNative      = map nameToTest namesOfTestsComparingToNative\n  where nameToTest     name = createTest\n                                compareODTToNative\n                                name\n                                (toODTPath      name)\n                                (toNativePath   name)\n        toODTPath      name = \"odt/odt/\"      ++ name ++ \".odt\"\n        toNativePath   name = \"odt/native/\"   ++ name ++ \".native\"\n\n\nnewtype NoNormPandoc = NoNormPandoc {unNoNorm :: Pandoc}\n  deriving ( Show )\n\ninstance ToString NoNormPandoc where\n  toString d = unpack $\n               purely (writeNative def{ writerTemplate = s }) $ toPandoc d\n   where s = case d of\n                  NoNormPandoc (Pandoc (Meta m) _)\n                    | M.null m  -> Nothing\n                    | otherwise -> Just mempty -- need this for Meta output\n\ninstance ToPandoc NoNormPandoc where\n  toPandoc = unNoNorm\n\ngetNoNormVia :: (a -> Pandoc) -> String -> Either PandocError a -> NoNormPandoc\ngetNoNormVia _ readerName (Left  _) = error (readerName ++ \" reader failed\")\ngetNoNormVia f _          (Right a) = NoNormPandoc (f a)\n\ntype TestCreator =  ReaderOptions\n                 -> FilePath -> FilePath\n                 -> IO (NoNormPandoc, NoNormPandoc)\n\ncompareODTToNative   :: TestCreator\ncompareODTToNative opts odtPath nativePath = do\n   nativeFile   <- UTF8.toText <$> BS.readFile nativePath\n   odtFile      <- B.readFile       odtPath\n   native       <- getNoNormVia id  \"native\" <$> runIO (readNative def nativeFile)\n   odt          <- getNoNormVia id  \"odt\"    <$> runIO (readODT  opts odtFile)\n   return (odt,native)\n\ncompareODTToMarkdown :: TestCreator\ncompareODTToMarkdown opts odtPath markdownPath = do\n   markdownFile <- UTF8.toText <$> BS.readFile markdownPath\n   odtFile      <- B.readFile       odtPath\n   markdown     <- getNoNormVia id \"markdown\" <$>\n                      runIO (readMarkdown def{ readerExtensions = pandocExtensions }\n                              markdownFile)\n   odt          <- getNoNormVia id \"odt\"      <$> runIO (readODT      opts odtFile)\n   return (odt,markdown)\n\n\ncreateTest :: TestCreator\n           -> TestName\n           -> FilePath -> FilePath\n           -> TestTree\ncreateTest   creator name path1 path2 =\n  unsafePerformIO $ liftM (test id name) (creator defopts path1 path2)\n\n{-\n--\n\ngetMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)\ngetMedia archivePath mediaPath = do\n  zf <- B.readFile archivePath >>= return . toArchive\n  return $ findEntryByPath (\"Pictures/\" ++ mediaPath) zf >>= (Just . fromEntry)\n\ncompareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool\ncompareMediaPathIO mediaPath mediaBag odtPath = do\n  odtMedia <- getMedia odtPath mediaPath\n  let mbBS   = case lookupMedia mediaPath mediaBag of\n                 Just (_, bs) -> bs\n                 Nothing      -> error (\"couldn't find \" ++\n                                        mediaPath ++\n                                        \" in media bag\")\n      odtBS = case odtMedia of\n                 Just bs -> bs\n                 Nothing -> error (\"couldn't find \" ++\n                                   mediaPath ++\n                                   \" in media bag\")\n  return $ mbBS == odtBS\n\ncompareMediaBagIO :: FilePath -> IO Bool\ncompareMediaBagIO odtFile = do\n    df <- B.readFile odtFile\n    let (_, mb) = readODT def df\n    bools <- mapM\n             (\\(fp, _, _) -> compareMediaPathIO fp mb odtFile)\n             (mediaDirectory mb)\n    return $ and bools\n\ntestMediaBagIO :: String -> FilePath -> IO TestTree\ntestMediaBagIO name odtFile = do\n  outcome <- compareMediaBagIO odtFile\n  return $ testCase name (assertBool\n                          (\"Media didn't match media bag in file \" ++ odtFile)\n                          outcome)\n\ntestMediaBag :: String -> FilePath -> TestTree\ntestMediaBag name odtFile = buildTest $ testMediaBagIO name odtFile\n-}\n--\n\n\n\nnamesOfTestsComparingToMarkdown :: [ String ]\nnamesOfTestsComparingToMarkdown  = [ \"blockquote2\"\n                                   , \"bold\"\n--                                 , \"citation\"\n                                   , \"endnote\"\n                                   , \"externalLink\"\n                                   , \"footnote\"\n                                   , \"formula\"\n                                   , \"headers\"\n--                                 , \"horizontalRule\"\n                                   , \"italic\"\n--                                 , \"listBlocks\"\n                                   , \"paragraph\"\n                                   , \"strikeout\"\n--                                 , \"trackedChanges\"\n                                   , \"underlined\"\n                                   ]\n\nnamesOfTestsComparingToNative  :: [ String ]\nnamesOfTestsComparingToNative   = [ \"blockquote\"\n                                  , \"image\"\n                                  , \"imageIndex\"\n                                  , \"imageRelative\"\n                                  , \"imageWithCaption\"\n                                  , \"inlinedCode\"\n                                  , \"listContinueNumbering\"\n                                  , \"listContinueNumbering2\"\n                                  , \"orderedListMixed\"\n                                  , \"orderedListRoman\"\n                                  , \"orderedListSimple\"\n                                  , \"orderedListHeader\"\n                                  , \"preformattedText\"\n                                  , \"preformattedTextParentStyle\"\n                                  , \"referenceToChapter\"\n                                  , \"referenceToListItem\"\n                                  , \"referenceToText\"\n                                  , \"simpleTable\"\n                                  , \"simpleTableWithCaption\"\n                                  , \"simpleTableWithHeader\"\n                                  , \"simpleTableWithMultipleHeaderRows\"\n                                  , \"tab\"\n--                                , \"table\"\n                                  , \"textMixedStyles\"\n                                  , \"tableWithContents\"\n                                  , \"tableWithSpans\"\n                                  , \"unicode\"\n                                  , \"unorderedList\"\n                                  , \"unorderedListHeader\"\n                                  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Block/CodeBlock.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Block.CodeBlock\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of org code blocks.\n-}\nmodule Tests.Readers.Org.Block.CodeBlock (tests) where\n\nimport Test.Tasty (TestTree)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:), spcSep)\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\ntests :: [TestTree]\ntests =\n  [ \"Source block\" =:\n       T.unlines [ \"  #+begin_src haskell\"\n                 , \"  main = putStrLn greeting\"\n                 , \"    where greeting = \\\"moin\\\"\"\n                 , \"  #+end_src\" ] =?>\n       let attr' = (\"\", [\"haskell\"], [])\n           code' = \"main = putStrLn greeting\\n\" <>\n                   \"  where greeting = \\\"moin\\\"\\n\"\n       in codeBlockWith attr' code'\n\n  , \"Source block with indented code\" =:\n       T.unlines [ \"  #+begin_src haskell\"\n                 , \"    main = putStrLn greeting\"\n                 , \"      where greeting = \\\"moin\\\"\"\n                 , \"  #+end_src\" ] =?>\n       let attr' = (\"\", [\"haskell\"], [])\n           code' = \"main = putStrLn greeting\\n\" <>\n                   \"  where greeting = \\\"moin\\\"\\n\"\n       in codeBlockWith attr' code'\n\n  , \"Source block with tab-indented code\" =:\n       T.unlines [ \"\\t#+begin_src haskell\"\n                 , \"\\tmain = putStrLn greeting\"\n                 , \"\\t  where greeting = \\\"moin\\\"\"\n                 , \"\\t#+end_src\" ] =?>\n       let attr' = (\"\", [\"haskell\"], [])\n           code' = \"main = putStrLn greeting\\n\" <>\n                   \"  where greeting = \\\"moin\\\"\\n\"\n       in codeBlockWith attr' code'\n\n  , \"Empty source block\" =:\n       T.unlines [ \"  #+begin_src haskell\"\n                 , \"  #+end_src\" ] =?>\n       let attr' = (\"\", [\"haskell\"], [])\n           code' = \"\"\n       in codeBlockWith attr' code'\n\n  , \"Source block between paragraphs\" =:\n       T.unlines [ \"Low German greeting\"\n                 , \"  #+begin_src haskell\"\n                 , \"  main = putStrLn greeting\"\n                 , \"    where greeting = \\\"Moin!\\\"\"\n                 , \"  #+end_src\" ] =?>\n       let attr' = (\"\", [\"haskell\"], [])\n           code' = \"main = putStrLn greeting\\n\" <>\n                    \"  where greeting = \\\"Moin!\\\"\\n\"\n       in mconcat [ para $ spcSep [ \"Low\", \"German\", \"greeting\"  ]\n                  , codeBlockWith attr' code'\n                  ]\n  , \"Source block with babel arguments\" =:\n       T.unlines [ \"#+begin_src emacs-lisp :exports both\"\n                 , \"(progn (message \\\"Hello, World!\\\")\"\n                 , \"       (+ 23 42))\"\n                 , \"#+end_src\" ] =?>\n       let classes = [ \"commonlisp\" ] -- as kate doesn't know emacs-lisp syntax\n           params = [ (\"org-language\", \"emacs-lisp\")\n                    , (\"exports\", \"both\")\n                    ]\n           code' = T.unlines [ \"(progn (message \\\"Hello, World!\\\")\"\n                           , \"       (+ 23 42))\" ]\n       in codeBlockWith (\"\", classes, params) code'\n\n  , \"Source block with results and :exports both\" =:\n       T.unlines [ \"#+begin_src emacs-lisp :exports both\"\n                 , \"(progn (message \\\"Hello, World!\\\")\"\n                 , \"       (+ 23 42))\"\n                 , \"#+end_src\"\n                 , \"\"\n                 , \"#+RESULTS:\"\n                 , \": 65\"] =?>\n       let classes = [ \"commonlisp\" ]\n           params = [ (\"org-language\", \"emacs-lisp\")\n                    , (\"exports\", \"both\")\n                    ]\n           code' = T.unlines [ \"(progn (message \\\"Hello, World!\\\")\"\n                             , \"       (+ 23 42))\" ]\n           results' = \"65\\n\"\n       in codeBlockWith (\"\", classes, params) code'\n          <>\n          codeBlockWith (\"\", [], []) results'\n\n  , \"Source block with results and :exports code\" =:\n       T.unlines [ \"#+begin_src emacs-lisp :exports code\"\n                 , \"(progn (message \\\"Hello, World!\\\")\"\n                 , \"       (+ 23 42))\"\n                 , \"#+end_src\"\n                 , \"\"\n                 , \"#+RESULTS:\"\n                 , \": 65\" ] =?>\n       let classes = [ \"commonlisp\" ]\n           params = [ (\"org-language\", \"emacs-lisp\")\n                    , (\"exports\", \"code\")\n                    ]\n           code' = T.unlines [ \"(progn (message \\\"Hello, World!\\\")\"\n                             , \"       (+ 23 42))\" ]\n       in codeBlockWith (\"\", classes, params) code'\n\n  , \"Source block with results and :exports results\" =:\n       T.unlines [ \"#+begin_src emacs-lisp :exports results\"\n                 , \"(progn (message \\\"Hello, World!\\\")\"\n                 , \"       (+ 23 42))\"\n                 , \"#+end_src\"\n                 , \"\"\n                 , \"#+RESULTS:\"\n                 , \": 65\" ] =?>\n       let results' = \"65\\n\"\n       in codeBlockWith (\"\", [], []) results'\n\n  , \"Source block with results and :exports none\" =:\n       T.unlines [ \"#+begin_src emacs-lisp :exports none\"\n                 , \"(progn (message \\\"Hello, World!\\\")\"\n                 , \"       (+ 23 42))\"\n                 , \"#+end_src\"\n                 , \"\"\n                 , \"#+RESULTS:\"\n                 , \": 65\" ] =?>\n       (mempty :: Blocks)\n\n  , \"Source block with toggling header arguments\" =:\n    T.unlines [ \"#+begin_src sh :noeval\"\n              , \"echo $HOME\"\n              , \"#+end_src\"\n              ] =?>\n    let classes = [ \"bash\" ]\n        params = [ (\"org-language\", \"sh\"), (\"noeval\", \"yes\") ]\n    in codeBlockWith (\"\", classes, params) \"echo $HOME\\n\"\n\n  , \"Source block with line number switch\" =:\n    T.unlines [ \"#+begin_src sh -n 10\"\n              , \":() { :|:& };:\"\n              , \"#+end_src\"\n              ] =?>\n    let classes = [ \"bash\", \"numberLines\" ]\n        params = [ (\"org-language\", \"sh\"), (\"startFrom\", \"10\") ]\n    in codeBlockWith (\"\", classes, params) \":() { :|:& };:\\n\"\n\n  , \"Source block with multi-word parameter values\" =:\n    T.unlines [ \"#+begin_src dot :cmdline -Kdot -Tpng \"\n              , \"digraph { id [label=\\\"ID\\\"] }\"\n              , \"#+end_src\"\n              ] =?>\n    let classes = [ \"dot\" ]\n        params = [ (\"cmdline\", \"-Kdot -Tpng\") ]\n    in codeBlockWith (\"\", classes, params) \"digraph { id [label=\\\"ID\\\"] }\\n\"\n\n  , \"Example block\" =:\n       T.unlines [ \"#+begin_example\"\n                 , \"A chosen representation of\"\n                 , \"a rule.\"\n                 , \"#+eND_exAMPle\"\n                 ] =?>\n       codeBlockWith (\"\", [], [])\n                     \"A chosen representation of\\na rule.\\n\"\n\n  , \"Code block with caption\" =:\n      T.unlines [ \"#+caption: Functor laws in Haskell\"\n                , \"#+name: functor-laws\"\n                , \"#+begin_src haskell\"\n                , \"fmap id = id\"\n                , \"fmap (p . q) = (fmap p) . (fmap q)\"\n                , \"#+end_src\"\n                ] =?>\n      divWith\n         (\"\", [\"captioned-content\"], [] )\n         (mappend\n          (divWith (\"\", [\"caption\"], []) $\n           plain (spcSep [ \"Functor\", \"laws\", \"in\", \"Haskell\" ]))\n          (codeBlockWith (\"functor-laws\", [\"haskell\"], [])\n                         (T.unlines [ \"fmap id = id\"\n                                    , \"fmap (p . q) = (fmap p) . (fmap q)\"\n                                    ])))\n\n  , \"Non-letter chars in source block parameters\" =:\n      T.unlines [ \"#+begin_src C :tangle xxxx.c :city Zürich\"\n                , \"code body\"\n                , \"#+end_src\"\n                ] =?>\n      let params  = [ (\"org-language\", \"C\")\n                    , (\"tangle\", \"xxxx.c\")\n                    , (\"city\", \"Zürich\")\n                    ]\n      in codeBlockWith ( \"\", [\"c\"], params) \"code body\\n\"\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Block/Figure.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Block.Figure\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of org figures.\n-}\nmodule Tests.Readers.Org.Block.Figure (tests) where\n\nimport Test.Tasty (TestTree)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:))\nimport Text.Pandoc.Builder ( emptyCaption, figure, figureWith, image\n                           , plain, simpleCaption, simpleFigure )\nimport qualified Data.Text as T\n\ntests :: [TestTree]\ntests =\n  [ \"Figure\" =:\n      T.unlines [ \"#+caption: A courageous man.\"\n                , \"#+name: ed\"\n                , \"[[file:edward.jpg]]\"\n                ] =?>\n      figureWith (\"ed\", mempty, mempty)\n             (plainCaption \"A courageous man.\")\n             (plain $ image \"edward.jpg\" mempty \"\")\n\n  , \"Figure with no name\" =:\n      T.unlines [ \"#+caption: I've been through the desert on this\"\n                , \"[[file:horse.png]]\"\n                ] =?>\n      figure (plainCaption \"I've been through the desert on this\")\n             (plain $ image \"horse.png\" \"\" \"\")\n\n  , \"Figure with `fig:` prefix in name\" =:\n      T.unlines [ \"#+caption: Used as a metapher in evolutionary biology.\"\n                , \"#+name: fig:redqueen\"\n                , \"[[./the-red-queen.jpg]]\"\n                ] =?>\n      figureWith (\"fig:redqueen\", mempty, mempty)\n             (plainCaption \"Used as a metapher in evolutionary biology.\")\n             (plain $ image \"./the-red-queen.jpg\" mempty \"\")\n\n  , \"Figure with HTML attributes\" =:\n      T.unlines [ \"#+caption: mah brain just explodid\"\n                , \"#+name: lambdacat\"\n                , \"#+attr_html: :style color: blue :role button\"\n                , \"[[file:lambdacat.jpg]]\"\n                ] =?>\n      let kv = [(\"style\", \"color: blue\"), (\"role\", \"button\")]\n          name = \"lambdacat\"\n          capt = plain \"mah brain just explodid\"\n      in figureWith (name, mempty, kv) (simpleCaption capt)\n         (plain $ image \"lambdacat.jpg\" mempty \"\")\n\n  , \"LaTeX attributes are ignored\" =:\n      T.unlines [ \"#+caption: Attribute after caption\"\n                , \"#+attr_latex: :float nil\"\n                , \"[[file:test.png]]\"\n                ] =?>\n      simpleFigure \"Attribute after caption\"\n                   \"test.png\" \"\"\n\n  , \"Labelled figure\" =:\n      T.unlines [ \"#+caption: My figure\"\n                , \"#+label: fig:myfig\"\n                , \"[[file:blub.png]]\"\n                ] =?>\n      figureWith (\"fig:myfig\", mempty, mempty)\n                 (simpleCaption $ plain \"My figure\")\n                 (plain (image \"blub.png\" \"\" \"\"))\n\n  , \"Figure with empty caption\" =:\n      T.unlines [ \"#+caption:\"\n                , \"[[file:guess.jpg]]\"\n                ] =?>\n      figure emptyCaption (plain (image \"guess.jpg\" \"\" \"\"))\n  ]\n where\n  plainCaption = simpleCaption . plain\n"
  },
  {
    "path": "test/Tests/Readers/Org/Block/Header.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Block.Header\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of org header blocks.\n-}\nmodule Tests.Readers.Org.Block.Header (tests) where\n\nimport Test.Tasty (TestTree, testGroup)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:), spcSep, tagSpan)\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\ntests :: [TestTree]\ntests =\n  [ \"First Level Header\" =:\n      \"* Headline\\n\" =?>\n      headerWith (\"headline\", [], []) 1 \"Headline\"\n\n  , \"Third Level Header\" =:\n      \"*** Third Level Headline\\n\" =?>\n      headerWith (\"third-level-headline\", [], [])\n                 3\n                 (\"Third\" <> space <> \"Level\" <> space <> \"Headline\")\n\n  , \"Compact Headers with Paragraph\" =:\n      T.unlines [ \"* First Level\"\n                , \"** Second Level\"\n                , \"   Text\"\n                ] =?>\n      mconcat [ headerWith (\"first-level\", [], [])\n                           1\n                           (\"First\" <> space <> \"Level\")\n              , headerWith (\"second-level\", [], [])\n                           2\n                           (\"Second\" <> space <> \"Level\")\n              , para \"Text\"\n              ]\n\n  , \"Separated Headers with Paragraph\" =:\n      T.unlines [ \"* First Level\"\n                , \"\"\n                , \"** Second Level\"\n                , \"\"\n                , \"   Text\"\n                ] =?>\n      mconcat [ headerWith (\"first-level\", [], [])\n                           1\n                           (\"First\" <> space <> \"Level\")\n              , headerWith (\"second-level\", [], [])\n                           2\n                           (\"Second\" <> space <> \"Level\")\n              , para \"Text\"\n              ]\n\n  , \"Headers not preceded by a blank line\" =:\n      T.unlines [ \"** eat dinner\"\n                , \"Spaghetti and meatballs tonight.\"\n                , \"** walk dog\"\n                ] =?>\n      mconcat [ headerWith (\"eat-dinner\", [], [])\n                           2\n                           (\"eat\" <> space <> \"dinner\")\n              , para $ spcSep [ \"Spaghetti\", \"and\", \"meatballs\", \"tonight.\" ]\n              , headerWith (\"walk-dog\", [], [])\n                           2\n                           (\"walk\" <> space <> \"dog\")\n              ]\n\n  , testGroup \"Todo keywords\"\n    [ \"Header with known todo keyword\" =:\n        \"* TODO header\" =?>\n        let todoSpan = spanWith (\"\", [\"todo\", \"TODO\"], []) \"TODO\"\n        in headerWith (\"header\", [], []) 1 (todoSpan <> space <> \"header\")\n\n    , \"Header marked as done\" =:\n        \"* DONE header\" =?>\n        let todoSpan = spanWith (\"\", [\"done\", \"DONE\"], []) \"DONE\"\n        in headerWith (\"header\", [], []) 1 (todoSpan <> space <> \"header\")\n\n    , \"emphasis in first word\" =:\n        \"** TODO /fix/ this\" =?>\n        let todoSpan = spanWith (\"\", [\"todo\", \"TODO\"], []) \"TODO\"\n        in headerWith (\"fix-this\", [], [])\n                      2\n                      (todoSpan <> space <> emph \"fix\" <> space <> \"this\")\n\n    , \"Header with unknown todo keyword\" =:\n        \"* WAITING header\" =?>\n        headerWith (\"waiting-header\", [], []) 1 \"WAITING header\"\n\n    , \"Custom todo keywords\" =:\n        T.unlines [ \"#+todo: WAITING CANCELLED\"\n                  , \"* WAITING compile\"\n                  , \"* CANCELLED lunch\"\n                  ] =?>\n        let todoSpan = spanWith (\"\", [\"todo\", \"WAITING\"], []) \"WAITING\"\n            doneSpan = spanWith (\"\", [\"done\", \"CANCELLED\"], []) \"CANCELLED\"\n        in headerWith (\"compile\", [], []) 1 (todoSpan <> space <> \"compile\")\n        <> headerWith (\"lunch\", [], []) 1 (doneSpan <> space <> \"lunch\")\n\n    , \"Custom todo keywords with multiple done-states\" =:\n        T.unlines [ \"#+todo: WAITING | DONE CANCELLED \"\n                  , \"* WAITING compile\"\n                  , \"* CANCELLED lunch\"\n                  , \"* DONE todo-feature\"\n                  ] =?>\n        let waiting = spanWith (\"\", [\"todo\", \"WAITING\"], []) \"WAITING\"\n            cancelled = spanWith (\"\", [\"done\", \"CANCELLED\"], []) \"CANCELLED\"\n            done = spanWith (\"\", [\"done\", \"DONE\"], []) \"DONE\"\n        in headerWith (\"compile\", [], []) 1 (waiting <> space <> \"compile\")\n        <> headerWith (\"lunch\", [], []) 1 (cancelled <> space <> \"lunch\")\n        <> headerWith (\"todo-feature\", [], []) 1 (done <> space <> \"todo-feature\")\n\n    , \"Fast access TODO states\" =:\n        T.unlines [ \"#+TODO: TODO(t) | DONE(d)\"\n                  , \"* TODO test\"\n                  ] =?>\n        let todoSpan = spanWith (\"\", [\"todo\", \"TODO\"], []) \"TODO\"\n        in headerWith (\"test\", [], []) 1 (todoSpan <> space <> \"test\")\n    ]\n\n  , \"Tagged headers\" =:\n      T.unlines [ \"* Personal       :PERSONAL:\"\n                , \"** Call Mom      :@PHONE:\"\n                , \"** Call John     :@PHONE:JOHN: \"\n                ] =?>\n      mconcat [ headerWith (\"personal\", [], [])\n                           1\n                           (\"Personal \" <> tagSpan \"PERSONAL\")\n              , headerWith (\"call-mom\", [], [])\n                           2\n                           (\"Call Mom \" <> tagSpan \"@PHONE\")\n              , headerWith (\"call-john\", [], [])\n                           2\n                           (\"Call John \" <> tagSpan \"@PHONE\" <> \"\\160\" <> tagSpan \"JOHN\")\n              ]\n\n  , \"Untagged header containing colons\" =:\n      \"* This: is not: tagged\" =?>\n      headerWith (\"this-is-not-tagged\", [], []) 1 \"This: is not: tagged\"\n\n  , \"Untagged header time followed by colon\" =:\n      \"** Meeting at 5:23: free food\" =?>\n      let attr = (\"meeting-at-523-free-food\", [], [])\n      in headerWith attr 2 \"Meeting at 5:23: free food\"\n\n  , \"tag followed by text\" =:\n      \"*** Looks like a :tag: but isn't\" =?>\n      let attr = (\"looks-like-a-tag-but-isnt\", [], [])\n      in headerWith attr 3 \"Looks like a :tag: but isn't\"\n\n  , \"Header starting with strokeout text\" =:\n      T.unlines [ \"foo\"\n                , \"\"\n                , \"* +thing+ other thing\"\n                ] =?>\n      mconcat [ para \"foo\"\n              , headerWith (\"thing-other-thing\", [], [])\n                           1\n                           (strikeout \"thing\" <> \" other thing\")\n              ]\n\n  , \"Comment Trees\" =:\n      T.unlines [ \"* COMMENT A comment tree\"\n                , \"  Not much going on here\"\n                , \"** This will be dropped\"\n                , \"* Comment tree above\"\n                ] =?>\n      headerWith (\"comment-tree-above\", [], []) 1 \"Comment tree above\"\n\n  , \"Nothing but a COMMENT header\" =:\n      \"* COMMENT Test\" =?>\n      (mempty::Blocks)\n\n  , \"Tree with :noexport:\" =:\n      T.unlines [ \"* Should be ignored :archive:noexport:old:\"\n                , \"** Old stuff\"\n                , \"   This is not going to be exported\"\n                ] =?>\n      (mempty::Blocks)\n\n  , \"Subtree with :noexport:\" =:\n      T.unlines [ \"* Exported\"\n                , \"** This isn't exported :noexport:\"\n                , \"*** This neither\"\n                , \"** But this is\"\n                ] =?>\n      mconcat [ headerWith (\"exported\", [], []) 1 \"Exported\"\n              , headerWith (\"but-this-is\", [], []) 2 \"But this is\"\n              ]\n\n  , \"Preferences are treated as header attributes\" =:\n      T.unlines [ \"* foo\"\n                , \"  :PROPERTIES:\"\n                , \"  :custom_id: fubar\"\n                , \"  :bar: baz\"\n                , \"  :END:\"\n                ] =?>\n      headerWith (\"fubar\", [], [(\"bar\", \"baz\")]) 1 \"foo\"\n\n\n  , \"Headers marked with a unnumbered property get a class of the same name\" =:\n      T.unlines [ \"* Not numbered\"\n                , \"  :PROPERTIES:\"\n                , \"  :UNNUMBERED: t\"\n                , \"  :END:\"\n                ] =?>\n      headerWith (\"not-numbered\", [\"unnumbered\"], []) 1 \"Not numbered\"\n\n  , testGroup \"planning information\"\n    [ \"Planning info is not included in output\" =:\n      T.unlines [ \"* important\"\n                , T.unwords\n                  [ \"CLOSED: [2018-09-05 Wed 13:58]\"\n                  , \"DEADLINE: <2018-09-17 Mon>\"\n                  , \"SCHEDULED: <2018-09-10 Mon>\"\n                  ]\n                ] =?>\n      headerWith (\"important\", [], []) 1 \"important\"\n\n    , \"Properties after planning info are recognized\" =:\n      T.unlines [ \"* important \"\n                , \"  \" <> T.unwords\n                  [ \"CLOSED: [2018-09-05 Wed 13:58]\"\n                  , \"DEADLINE: <2018-09-17 Mon>\"\n                  , \"SCHEDULED: <2018-09-10 Mon>\"\n                  ]\n                , \"  :PROPERTIES:\"\n                , \"  :custom_id: look\"\n                , \"  :END:\"\n                ] =?>\n      headerWith (\"look\", [], []) 1 \"important\"\n\n    , \"Planning info followed by test\" =:\n      T.unlines [ \"* important \"\n                , \"  \" <> T.unwords\n                  [ \"CLOSED: [2018-09-05 Wed 13:58]\"\n                  , \"DEADLINE: <2018-09-17 Mon>\"\n                  , \"SCHEDULED: <2018-09-10 Mon>\"\n                  ]\n                , \"  :PROPERTIES:\"\n                , \"  :custom_id: look\"\n                , \"  :END:\"\n                ] =?>\n      headerWith (\"look\", [], []) 1 \"important\"\n\n    , \"third and forth level headers\" =:\n      T.unlines [ \"#+options: p:t h:3\"\n                , \"*** Third\"\n                , \"    CLOSED: [2018-09-05 Wed 13:58]\"\n                , \"    Text 3\"\n                , \"**** Fourth\"\n                , \"SCHEDULED: <2019-05-13 Mon 22:42>\"\n                , \"Text 4\"\n                ] =?>\n      mconcat\n      [ headerWith (\"third\", [], mempty) 3 \"Third\"\n      , plain $\n        strong \"CLOSED:\" <> space <> emph (str \"[2018-09-05 Wed 13:58]\")\n      , para \"Text 3\"\n      , orderedList [\n          mconcat\n          [ para \"Fourth\"\n          , plain $ strong \"SCHEDULED:\"\n                    <> space\n                    <> emph (str \"<2019-05-13 Mon 22:42>\")\n          , para \"Text 4\"\n          ]]\n      ]\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Block/List.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Block.Header\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of org lists.\n-}\nmodule Tests.Readers.Org.Block.List (tests) where\n\nimport Data.Text (Text)\nimport Test.Tasty (TestTree)\nimport Tests.Helpers ((=?>), purely, test)\nimport Tests.Readers.Org.Shared ((=:), spcSep)\nimport Text.Pandoc (ReaderOptions (readerExtensions),\n                    Extension (Ext_fancy_lists), def, enableExtension,\n                    getDefaultExtensions, readOrg)\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\norgFancyLists :: Text -> Pandoc\norgFancyLists = purely $\n  let extensionsFancy = enableExtension Ext_fancy_lists (getDefaultExtensions \"org\")\n  in readOrg def{ readerExtensions = extensionsFancy }\n\ntests :: [TestTree]\ntests =\n  [ \"Simple Bullet Lists\" =:\n      (\"- Item1\\n\" <>\n       \"- Item2\\n\") =?>\n      bulletList [ plain \"Item1\"\n                 , plain \"Item2\"\n                 ]\n\n  , \"Simple Bullet List with Ignored Counter Cookie\" =:\n      (\"- [@4] Item1\\n\" <>\n       \"- Item2\\n\") =?>\n      bulletList [ plain \"Item1\"\n                 , plain \"Item2\"\n                 ]\n\n  , \"Indented Bullet Lists\" =:\n      (\"   - Item1\\n\" <>\n       \"   - Item2\\n\") =?>\n      bulletList [ plain \"Item1\"\n                 , plain \"Item2\"\n                 ]\n\n  , \"Unindented *\" =:\n      (\"- Item1\\n\" <>\n       \"* Item2\\n\") =?>\n      bulletList [ plain \"Item1\"\n                 ] <>\n      headerWith (\"item2\", [], []) 1 \"Item2\"\n\n  , \"Multi-line Bullet Lists\" =:\n      (\"- *Fat\\n\" <>\n       \"  Tony*\\n\" <>\n       \"- /Sideshow\\n\" <>\n       \" Bob/\") =?>\n      bulletList [ plain $ strong (\"Fat\" <> softbreak <> \"Tony\")\n                 , plain $ emph (\"Sideshow\" <> softbreak <> \"Bob\")\n                 ]\n\n  , \"Nested Bullet Lists\" =:\n      (\"- Discovery\\n\" <>\n       \"  + One More Time\\n\" <>\n       \"  + Harder, Better, Faster, Stronger\\n\" <>\n       \"- Homework\\n\" <>\n       \"  + Around the World\\n\"<>\n       \"- Human After All\\n\" <>\n       \"  + Technologic\\n\" <>\n       \"  + Robot Rock\\n\") =?>\n      bulletList [ mconcat\n                   [ plain \"Discovery\"\n                   , bulletList [ plain (\"One\" <> space <>\n                                         \"More\" <> space <>\n                                         \"Time\")\n                                , plain (\"Harder,\" <> space <>\n                                         \"Better,\" <> space <>\n                                         \"Faster,\" <> space <>\n                                         \"Stronger\")\n                                ]\n                   ]\n                 , mconcat\n                   [ plain \"Homework\"\n                   , bulletList [ plain (\"Around\" <> space <>\n                                         \"the\" <> space <>\n                                         \"World\")\n                                ]\n                   ]\n                 , mconcat\n                   [ plain (\"Human\" <> space <> \"After\" <> space <> \"All\")\n                   , bulletList [ plain \"Technologic\"\n                                , plain (\"Robot\" <> space <> \"Rock\")\n                                ]\n                   ]\n                 ]\n\n  , \"Bullet List with Decreasing Indent\" =:\n       \"  - Discovery\\n\\\n        \\ - Human After All\\n\" =?>\n       mconcat [ bulletList [ plain \"Discovery\" ]\n               , bulletList [ plain (\"Human\" <> space <> \"After\" <> space <> \"All\")]\n               ]\n\n  , \"Header follows Bullet List\" =:\n      \"  - Discovery\\n\\\n       \\  - Human After All\\n\\\n       \\* Homework\" =?>\n      mconcat [ bulletList [ plain \"Discovery\"\n                           , plain (\"Human\" <> space <> \"After\" <> space <> \"All\")\n                           ]\n              , headerWith (\"homework\", [], []) 1 \"Homework\"\n              ]\n\n  , \"Bullet List Unindented with trailing Header\" =:\n      \"- Discovery\\n\\\n       \\- Homework\\n\\\n       \\* NotValidListItem\" =?>\n      mconcat [ bulletList [ plain \"Discovery\"\n                           , plain \"Homework\"\n                           ]\n              , headerWith (\"notvalidlistitem\", [], []) 1 \"NotValidListItem\"\n              ]\n\n  , \"Empty bullet points\" =:\n      T.unlines [ \"-\"\n                , \"- \"\n                ] =?>\n      bulletList [ plain \"\", plain \"\" ]\n\n  , \"Task list\" =:\n    T.unlines [ \"- [ ] nope\"\n              , \"- [X] yup\"\n              , \"- [-] started\"\n              , \"  1. [X] sure\"\n              , \"  2. [ ] nuh-uh\"\n              ] =?>\n    bulletList [ plain \"☐ nope\", plain \"☒ yup\"\n               , mconcat [ plain \"☐ started\"\n                         , orderedList [plain \"☒ sure\", plain \"☐ nuh-uh\"]\n                         ]\n               ]\n\n  , \"Task List with Counter Cookies\" =:\n    T.unlines [ \"- [ ] nope\"\n              , \"- [@9] [X] yup\"\n              , \"- [@a][-] started\"\n              , \"  1. [@3][X] sure\"\n              , \"  2. [@b] [ ] nuh-uh\"\n              ] =?>\n    bulletList [ plain \"☐ nope\", plain \"☒ yup\"\n               , mconcat [ plain \"☐ started\"\n                         , orderedListWith\n                           (3, DefaultStyle, DefaultDelim)\n                           [plain \"☒ sure\", plain \"☐ nuh-uh\"]\n                         ]\n               ]\n\n  , test orgFancyLists \"Task with alphabetical markers and counter cookie\" $\n    T.unlines [ \"- [ ] nope\"\n              , \"- [@9] [X] yup\"\n              , \"- [@a][-] started\"\n              , \"  a) [@D][X] sure\"\n              , \"  b) [@8] [ ] nuh-uh\"\n              ] =?>\n    bulletList [ plain \"☐ nope\", plain \"☒ yup\"\n               , mconcat [ plain \"☐ started\"\n                         , orderedListWith\n                           (4, LowerAlpha, OneParen)\n                           [plain \"☒ sure\", plain \"☐ nuh-uh\"]\n                         ]\n               ]\n\n  , \"Simple Ordered List\" =:\n      (\"1. Item1\\n\" <>\n       \"2. Item2\\n\") =?>\n      let listStyle = (1, DefaultStyle, DefaultDelim)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , test orgFancyLists \"Simple Ordered List with fancy lists extension\" $\n      (\"1. Item1\\n\" <>\n       \"2. Item2\\n\") =?>\n      let listStyle = (1, Decimal, Period)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , test orgFancyLists \"Simple Ordered List with lower alpha marker\" $\n      (\"a) Item1\\n\" <>\n       \"b) Item2\\n\") =?>\n      let listStyle = (1, LowerAlpha, OneParen)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , test orgFancyLists \"Simple Ordered List with upper and lower alpha markers\" $\n      (\"A. Item1\\n\" <>\n       \"b) Item2\\n\") =?>\n      let listStyle = (1, UpperAlpha, Period)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Simple Ordered List with Counter Cookie\" =:\n      (\"1. [@1234] Item1\\n\" <>\n       \"2. Item2\\n\") =?>\n      let listStyle = (1234, DefaultStyle, DefaultDelim)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Simple Ordered List with Alphabetical Counter Cookie\" =:\n      (\"1. [@c] Item1\\n\" <>\n       \"2. Item2\\n\") =?>\n      let listStyle = (3, DefaultStyle, DefaultDelim)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Simple Ordered List with Ignored Counter Cookie\" =:\n      (\"1. Item1\\n\" <>\n       \"2. [@4] Item2\\n\") =?>\n      let listStyle = (1, DefaultStyle, DefaultDelim)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Simple Ordered List with Parens\" =:\n      (\"1) Item1\\n\" <>\n       \"2) Item2\\n\") =?>\n      let listStyle = (1, DefaultStyle, DefaultDelim)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Indented Ordered List\" =:\n      (\" 1. Item1\\n\" <>\n       \" 2. Item2\\n\") =?>\n      let listStyle = (1, DefaultStyle, DefaultDelim)\n          listStructure = [ plain \"Item1\"\n                          , plain \"Item2\"\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Empty ordered list item\" =:\n      T.unlines [ \"1.\"\n                , \"3. \"\n                ] =?>\n      orderedList [ plain \"\", plain \"\" ]\n\n  , test orgFancyLists \"Empty ordered list item with fancy lists extension\" $\n      T.unlines [ \"a.\"\n                , \"2. \"\n                ] =?>\n      orderedListWith (1, LowerAlpha, Period) [ plain \"\", plain \"\" ]\n\n  , \"Empty ordered list item with counter cookie\" =:\n      T.unlines [ \"1. [@5]\"\n                , \"3. [@e] \"\n                ] =?>\n      let listStyle = (5, DefaultStyle, DefaultDelim)\n      in orderedListWith listStyle [ plain \"\", plain \"\" ]\n\n  , \"Nested Ordered Lists\" =:\n      (\"1. One\\n\" <>\n       \"   1. One-One\\n\" <>\n       \"   2. One-Two\\n\" <>\n       \"2. Two\\n\" <>\n       \"   1. Two-One\\n\"<>\n       \"   2. Two-Two\\n\") =?>\n      let listStyle = (1, DefaultStyle, DefaultDelim)\n          listStructure = [ mconcat\n                            [ plain \"One\"\n                            , orderedList [ plain \"One-One\"\n                                          , plain \"One-Two\"\n                                          ]\n                            ]\n                          , mconcat\n                            [ plain \"Two\"\n                            , orderedList [ plain \"Two-One\"\n                                          , plain \"Two-Two\"\n                                          ]\n                            ]\n                          ]\n      in orderedListWith listStyle listStructure\n\n  , \"Ordered List in Bullet List\" =:\n      (\"- Emacs\\n\" <>\n       \"  1. Org\\n\") =?>\n      bulletList [ plain \"Emacs\" <>\n                   orderedList [ plain \"Org\"]\n                 ]\n\n  , \"Bullet List in Ordered List\" =:\n      (\"1. GNU\\n\" <>\n       \"   - Freedom\\n\") =?>\n      orderedList [ plain \"GNU\" <> bulletList [ plain \"Freedom\" ] ]\n\n  , \"Definition List\" =:\n      T.unlines [ \"- PLL :: phase-locked loop\"\n                , \"- TTL ::\"\n                , \"  transistor-transistor logic\"\n                , \"- PSK :: phase-shift keying\"\n                , \"\"\n                , \"  a digital modulation scheme\"\n                ] =?>\n      definitionList [ (\"PLL\", [ plain $ \"phase-locked\" <> space <> \"loop\" ])\n                     , (\"TTL\", [ plain $ \"transistor-transistor\" <> space <>\n                                           \"logic\" ])\n                     , (\"PSK\", [ mconcat\n                                 [ para $ \"phase-shift\" <> space <> \"keying\"\n                                 , para $ spcSep [ \"a\", \"digital\"\n                                                 , \"modulation\", \"scheme\" ]\n                                 ]\n                               ])\n                     ]\n  , \"Definition list with multi-word term\" =:\n    \" - Elijah Wood :: He plays Frodo\" =?>\n     definitionList [ (\"Elijah\" <> space <> \"Wood\", [plain $ \"He\" <> space <> \"plays\" <> space <> \"Frodo\"])]\n  , \"Compact definition list\" =:\n       T.unlines [ \"- ATP :: adenosine 5' triphosphate\"\n                 , \"- DNA :: deoxyribonucleic acid\"\n                 , \"- PCR :: polymerase chain reaction\"\n                 , \"\"\n                 ] =?>\n      definitionList\n      [ (\"ATP\", [ plain $ spcSep [ \"adenosine\", \"5'\", \"triphosphate\" ] ])\n      , (\"DNA\", [ plain $ spcSep [ \"deoxyribonucleic\", \"acid\" ] ])\n      , (\"PCR\", [ plain $ spcSep [ \"polymerase\", \"chain\", \"reaction\" ] ])\n      ]\n\n  , \"Definition List With Trailing Header\" =:\n      \"- definition :: list\\n\\\n      \\- cool :: defs\\n\\\n      \\* header\" =?>\n      mconcat [ definitionList [ (\"definition\", [plain \"list\"])\n                               , (\"cool\", [plain \"defs\"])\n                               ]\n              , headerWith (\"header\", [], []) 1 \"header\"\n              ]\n\n  , \"Definition lists double-colon markers must be surrounded by whitespace\" =:\n      \"- std::cout\" =?>\n      bulletList [ plain \"std::cout\" ]\n\n  , \"Loose bullet list\" =:\n     T.unlines [ \"- apple\"\n               , \"\"\n               , \"- orange\"\n               , \"\"\n               , \"- peach\"\n               ] =?>\n      bulletList [ para \"apple\"\n                 , para \"orange\"\n                 , para \"peach\"\n                 ]\n\n  , \"Recognize preceding paragraphs in non-list contexts\" =:\n      T.unlines [ \"CLOSED: [2015-10-19 Mon 15:03]\"\n                , \"- Note taken on [2015-10-19 Mon 13:24]\"\n                ] =?>\n      mconcat [ para \"CLOSED: [2015-10-19 Mon 15:03]\"\n              , bulletList [ plain \"Note taken on [2015-10-19 Mon 13:24]\" ]\n              ]\n\n  , \"Markup after header and list\" =:\n      T.unlines [ \"* headline\"\n                , \"- list\"\n                , \"\"\n                , \"~variable name~\"\n                ] =?>\n      mconcat [ headerWith (\"headline\", [], []) 1 \"headline\"\n              , bulletList [ plain \"list\" ]\n              , para (code \"variable name\")\n              ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Block/Table.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Block.Table\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of org tables.\n-}\nmodule Tests.Readers.Org.Block.Table (tests) where\n\nimport Test.Tasty (TestTree)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:), spcSep)\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\nsimpleTable' :: Int\n             -> [Blocks]\n             -> [[Blocks]]\n             -> Blocks\nsimpleTable' n = simpleTable'' emptyCaption $ replicate n (AlignDefault, ColWidthDefault)\n\nsimpleTable'' :: Caption -> [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks\nsimpleTable'' = simpleTableWith'' (mempty, [], [])\n\nsimpleTableWith'' :: Attr -> Caption -> [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks\nsimpleTableWith'' attr capt spec headers rows\n  = tableWith attr\n              capt\n              spec\n              (TableHead nullAttr $ toHeaderRow headers)\n              [TableBody nullAttr 0 [] $ map toRow rows]\n              (TableFoot nullAttr [])\n  where\n    toRow = Row nullAttr . map simpleCell\n    toHeaderRow l = [toRow l | not (null l)]\n\ntests :: [TestTree]\ntests =\n  [ \"Single cell table\" =:\n      \"|Test|\" =?>\n      simpleTable' 1 mempty [[plain \"Test\"]]\n\n  , \"Multi cell table\" =:\n      \"| One | Two |\" =?>\n       simpleTable' 2 mempty [ [ plain \"One\", plain \"Two\" ] ]\n\n  , \"Multi line table\" =:\n      T.unlines [ \"| One   |\"\n                , \"| Two   |\"\n                , \"| Three |\"\n                ] =?>\n       simpleTable' 1 mempty\n                    [ [ plain \"One\" ]\n                    , [ plain \"Two\" ]\n                    , [ plain \"Three\" ]\n                    ]\n\n  , \"Empty table\" =:\n      \"||\" =?>\n      simpleTable' 1 mempty [[mempty]]\n\n  , \"Glider Table\" =:\n      T.unlines [ \"| 1 | 0 | 0 |\"\n                , \"| 0 | 1 | 1 |\"\n                , \"| 1 | 1 | 0 |\"\n                ] =?>\n      simpleTable' 3 mempty\n                   [ [ plain \"1\", plain \"0\", plain \"0\" ]\n                   , [ plain \"0\", plain \"1\", plain \"1\" ]\n                   , [ plain \"1\", plain \"1\", plain \"0\" ]\n                   ]\n\n  , \"Table between Paragraphs\" =:\n      T.unlines [ \"Before\"\n                , \"| One | Two |\"\n                , \"After\"\n                ] =?>\n      mconcat [ para \"Before\"\n              , simpleTable' 2 mempty [ [ plain \"One\", plain \"Two\" ] ]\n              , para \"After\"\n              ]\n\n  , \"Table with Header\" =:\n      T.unlines [ \"| Species      | Status       |\"\n                , \"|--------------+--------------|\"\n                , \"| cervisiae    | domesticated |\"\n                , \"| paradoxus    | wild         |\"\n                ] =?>\n      simpleTable [ plain \"Species\", plain \"Status\" ]\n                  [ [ plain \"cervisiae\", plain \"domesticated\" ]\n                  , [ plain \"paradoxus\", plain \"wild\" ]\n                  ]\n\n  , \"Table with final hline\" =:\n      T.unlines [ \"| cervisiae    | domesticated |\"\n                , \"| paradoxus    | wild         |\"\n                , \"|--------------+--------------|\"\n                ] =?>\n      simpleTable' 2 mempty\n            [ [ plain \"cervisiae\", plain \"domesticated\" ]\n             , [ plain \"paradoxus\", plain \"wild\" ]\n            ]\n\n  , \"Table in a box\" =:\n      T.unlines [ \"|---------|---------|\"\n                , \"| static  | Haskell |\"\n                , \"| dynamic | Lisp    |\"\n                , \"|---------+---------|\"\n                ] =?>\n      simpleTable' 2 mempty\n            [ [ plain \"static\", plain \"Haskell\" ]\n            , [ plain \"dynamic\", plain \"Lisp\" ]\n            ]\n\n  , \"Table with empty cells\" =:\n      \"|||c|\" =?>\n      simpleTable' 3 mempty [[mempty, mempty, plain \"c\"]]\n\n  , \"Table with empty rows\" =:\n      T.unlines [ \"| first  |\"\n                , \"|        |\"\n                , \"| third  |\"\n                ] =?>\n      simpleTable' 1 mempty [[plain \"first\"], [mempty], [plain \"third\"]]\n\n  , \"Table with alignment row\" =:\n      T.unlines [ \"| Numbers | Text | More |\"\n                , \"| <c>     | <r>  |      |\"\n                , \"| 1       | One  | foo  |\"\n                , \"| 2       | Two  | bar  |\"\n                ] =?>\n      simpleTable''\n        emptyCaption\n        (zip\n          [AlignCenter, AlignRight, AlignDefault]\n          [ColWidthDefault, ColWidthDefault, ColWidthDefault])\n        []\n        [ [ plain \"Numbers\", plain \"Text\", plain \"More\" ]\n        , [ plain \"1\"      , plain \"One\" , plain \"foo\"  ]\n        , [ plain \"2\"      , plain \"Two\" , plain \"bar\"  ]\n        ]\n\n  , \"Pipe within text doesn't start a table\" =:\n      \"Ceci n'est pas une | pipe \" =?>\n      para (spcSep [ \"Ceci\", \"n'est\", \"pas\", \"une\", \"|\", \"pipe\" ])\n\n  , \"Missing pipe at end of row\" =:\n      \"|incomplete-but-valid\" =?>\n      simpleTable' 1 mempty [ [ plain \"incomplete-but-valid\" ] ]\n\n  , \"Table with differing row lengths\" =:\n      T.unlines [ \"| Numbers | Text \"\n                , \"|-\"\n                , \"| <c>     | <r>  |\"\n                , \"| 1       | One  | foo  |\"\n                , \"| 2\"\n                ] =?>\n      simpleTable''\n        emptyCaption\n        (zip [AlignCenter, AlignRight] [ColWidthDefault, ColWidthDefault])\n        [ plain \"Numbers\", plain \"Text\" ]\n        [ [ plain \"1\" , plain \"One\" , plain \"foo\" ]\n        , [ plain \"2\" ]\n        ]\n\n  , \"Table with caption\" =:\n      T.unlines [ \"#+caption: Hitchhiker's Multiplication Table\"\n                , \"| x |  6 |\"\n                , \"| 9 | 42 |\"\n                ] =?>\n      simpleTable''\n        (simpleCaption $ plain \"Hitchhiker's Multiplication Table\")\n        [(AlignDefault, ColWidthDefault), (AlignDefault, ColWidthDefault)]\n        []\n        [ [ plain \"x\", plain \"6\" ]\n        , [ plain \"9\", plain \"42\" ]\n        ]\n\n  , \"named table\" =:\n      T.unlines [ \"#+name: x-marks-the-spot\"\n                , \"| x |\"\n                ] =?>\n      simpleTableWith'' (\"x-marks-the-spot\", mempty, mempty)\n                        emptyCaption\n                        (replicate 1 (AlignDefault, ColWidthDefault))\n                        mempty\n                        [ [ plain \"x\" ] ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Block.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Block\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTests parsing of org blocks.\n-}\nmodule Tests.Readers.Org.Block (tests) where\n\nimport Test.Tasty (TestTree, testGroup)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:), spcSep)\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\nimport qualified Tests.Readers.Org.Block.CodeBlock as CodeBlock\nimport qualified Tests.Readers.Org.Block.Figure as Figure\nimport qualified Tests.Readers.Org.Block.Header as Header\nimport qualified Tests.Readers.Org.Block.List as List\nimport qualified Tests.Readers.Org.Block.Table as Table\n\ntests :: [TestTree]\ntests =\n  [ \"Paragraph\" =:\n      \"Paragraph\\n\" =?>\n      para \"Paragraph\"\n\n  , \"Paragraph starting with an asterisk\" =:\n      \"*five\" =?>\n      para \"*five\"\n\n  , \"Paragraph containing asterisk at beginning of line\" =:\n      T.unlines [ \"lucky\"\n                , \"*star\"\n                ] =?>\n      para (\"lucky\" <> softbreak <> \"*star\")\n\n  , \"Example block\" =:\n      T.unlines [ \": echo hello\"\n                , \": echo dear tester\"\n                ] =?>\n      codeBlockWith (\"\", [], []) \"echo hello\\necho dear tester\\n\"\n\n  , \"Example block surrounded by text\" =:\n      T.unlines [ \"Greetings\"\n                , \": echo hello\"\n                , \": echo dear tester\"\n                , \"Bye\"\n                ] =?>\n      mconcat [ para \"Greetings\"\n              , codeBlockWith (\"\", [], [])\n                              \"echo hello\\necho dear tester\\n\"\n              , para \"Bye\"\n              ]\n\n  , \"Horizontal Rule\" =:\n      T.unlines [ \"before\"\n                , \"-----\"\n                , \"after\"\n                ] =?>\n      mconcat [ para \"before\"\n              , horizontalRule\n              , para \"after\"\n              ]\n\n  , \"Not a Horizontal Rule\" =:\n      \"----- em and en dash\" =?>\n      para \"\\8212\\8211 em and en dash\"\n\n  , testGroup \"Comments\"\n    [ \"Comment Block\" =:\n      T.unlines [ \"#+begin_comment\"\n                , \"stuff\"\n                , \"bla\"\n                , \"#+end_comment\"] =?>\n      (mempty::Blocks)\n\n    , \"Comment line\" =:\n      T.unlines [ \"# this is a comment\" ] =?>\n      (mempty :: Blocks)\n\n    , \"Empty comment line\" =:\n      T.unlines [ \"  #\" ] =?>\n      (mempty :: Blocks)\n    ]\n\n  , testGroup \"Blocks and fragments\"\n    [ \"HTML block\" =:\n      T.unlines [ \"#+begin_html\"\n                , \"<aside>HTML5 is pretty nice.</aside>\"\n                , \"#+end_html\"\n                ] =?>\n      rawBlock \"html\" \"<aside>HTML5 is pretty nice.</aside>\\n\"\n\n    , \"Quote block\" =:\n      T.unlines [ \"#+begin_quote\"\n                , \"/Niemand/ hat die Absicht, eine Mauer zu errichten!\"\n                , \"#+end_quote\"\n                ] =?>\n      blockQuote (para (spcSep [ emph \"Niemand\", \"hat\", \"die\", \"Absicht,\"\n                               , \"eine\", \"Mauer\", \"zu\", \"errichten!\"\n                               ]))\n\n    , \"Verse block\" =:\n      T.unlines [ \"The first lines of Goethe's /Faust/:\"\n                , \"#+begin_verse\"\n                , \"Habe nun, ach! Philosophie,\"\n                , \"Juristerei und Medizin,\"\n                , \"Und leider auch Theologie!\"\n                , \"Durchaus studiert, mit heißem Bemühn.\"\n                , \"#+end_verse\"\n                ] =?>\n      mconcat\n        [ para $ spcSep [ \"The\", \"first\", \"lines\", \"of\"\n                        , \"Goethe's\", emph \"Faust\" <> \":\"]\n        , lineBlock\n          [ \"Habe nun, ach! Philosophie,\"\n          , \"Juristerei und Medizin,\"\n          , \"Und leider auch Theologie!\"\n          , \"Durchaus studiert, mit heißem Bemühn.\"\n          ]\n        ]\n\n    , \"Verse block with blank lines\" =:\n      T.unlines [ \"#+begin_verse\"\n                , \"foo\"\n                , \"\"\n                , \"bar\"\n                , \"#+end_verse\"\n                ] =?>\n      lineBlock [ \"foo\", mempty, \"bar\" ]\n\n    , \"Verse block with varying indentation\" =:\n      T.unlines [ \"#+begin_verse\"\n                , \"  hello darkness\"\n                , \"my old friend\"\n                , \"#+end_verse\"\n                ] =?>\n      lineBlock [ \"\\160\\160hello darkness\", \"my old friend\" ]\n\n    , \"Raw block LaTeX\" =:\n      T.unlines [ \"#+begin_latex\"\n                , \"The category $\\\\cat{Set}$ is adhesive.\"\n                , \"#+end_latex\"\n                ] =?>\n      rawBlock \"latex\" \"The category $\\\\cat{Set}$ is adhesive.\\n\"\n\n    , \"Raw LaTeX line\" =:\n      \"#+latex: \\\\let\\\\foo\\\\bar\" =?>\n      rawBlock \"latex\" \"\\\\let\\\\foo\\\\bar\"\n\n    , \"Raw Beamer line\" =:\n      \"#+beamer: \\\\pause\" =?>\n      rawBlock \"beamer\" \"\\\\pause\"\n\n    , \"Raw HTML line\" =:\n      \"#+html: <aside>not important</aside>\" =?>\n      rawBlock \"html\" \"<aside>not important</aside>\"\n\n    , \"Export block HTML\" =:\n      T.unlines [ \"#+begin_export html\"\n                , \"<samp>Hello, World!</samp>\"\n                , \"#+end_export\"\n                ] =?>\n      rawBlock \"html\" \"<samp>Hello, World!</samp>\\n\"\n\n    , \"LaTeX fragment\" =:\n      \"\\\\begin{equation}\\n\\\n      \\X_i = \\\\begin{cases}\\n\\\n      \\      G_{\\\\alpha(i)} & \\\\text{if }\\\\alpha(i-1) = \\\\alpha(i)\\\\\\\\\\n\\\n      \\      C_{\\\\alpha(i)} & \\\\text{otherwise}\\n\\\n      \\      \\\\end{cases}\\n\\\n      \\\\\\end{equation}\"\n      =?>\n      para (rawInline \"latex\"\n             \"\\\\begin{equation}\\n\\\n             \\X_i = \\\\begin{cases}\\n\\\n             \\      G_{\\\\alpha(i)} & \\\\text{if }\\\\alpha(i-1) = \\\\alpha(i)\\\\\\\\\\n\\\n             \\      C_{\\\\alpha(i)} & \\\\text{otherwise}\\n\\\n             \\      \\\\end{cases}\\n\\\n             \\\\\\end{equation}\")\n\n    , \"One-line LaTeX fragment\" =:\n      \"\\\\begin{equation} 2 + 3 \\\\end{equation}\" =?>\n      para (rawInline \"latex\" \"\\\\begin{equation} 2 + 3 \\\\end{equation}\")\n\n    , \"LaTeX fragment with more arguments\" =:\n      T.unlines [ \"\\\\begin{tikzcd}[ampersand replacement=\\\\&]\"\n                , \"  A \\\\& B \\\\\\\\\"\n                , \"  C \\\\& D\"\n                , \"  \\\\arrow[from=1-1, to=1-2]\"\n                , \"  \\\\arrow[\\\"f\\\", from=2-1, to=2-2]\"\n                , \"\\\\end{tikzcd}\"\n                ] =?>\n      rawBlock \"latex\"\n      (T.unlines [ \"\\\\begin{tikzcd}[ampersand replacement=\\\\&]\"\n                 , \"  A \\\\& B \\\\\\\\\"\n                 , \"  C \\\\& D\"\n                 , \"  \\\\arrow[from=1-1, to=1-2]\"\n                 , \"  \\\\arrow[\\\"f\\\", from=2-1, to=2-2]\"\n                 , \"\\\\end{tikzcd}\"\n                 ])\n\n    , \"Convert blank lines in blocks to single newlines\" =:\n      T.unlines [ \"#+begin_html\"\n                , \"\"\n                , \"<span>boring</span>\"\n                , \"\"\n                , \"#+end_html\"\n                ] =?>\n      rawBlock \"html\" \"\\n<span>boring</span>\\n\\n\"\n\n    , \"Accept `attr_html` attributes for generic block\" =:\n      T.unlines [ \"#+attr_html: :title hello, world :id test :class fun code\"\n                , \"#+begin_test\"\n                , \"nonsense\"\n                , \"#+end_test\"\n                ] =?>\n      let attr = (\"test\", [\"fun\", \"code\", \"test\"], [(\"title\", \"hello, world\")])\n      in divWith attr (para \"nonsense\")\n    ]\n\n  , testGroup \"Headers\" Header.tests\n  , testGroup \"Figures\" Figure.tests\n  , testGroup \"Lists\" List.tests\n  , testGroup \"CodeBlocks\" CodeBlock.tests\n  , testGroup \"Tables\" Table.tests\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Directive.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Directive\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTests parsing of org directives (like @#+OPTIONS@).\n-}\nmodule Tests.Readers.Org.Directive (tests) where\n\nimport Data.Time (UTCTime (UTCTime), secondsToDiffTime)\nimport Data.Time.Calendar (Day (ModifiedJulianDay))\nimport Test.Tasty (TestTree, testGroup)\nimport Tests.Helpers ((=?>), ToString, purely, test)\nimport Tests.Readers.Org.Shared ((=:), tagSpan)\nimport Text.Pandoc\nimport Text.Pandoc.Builder\nimport qualified Data.ByteString as BS\nimport qualified Data.Text as T\n\ntestWithFiles :: (ToString c)\n              => [(FilePath, BS.ByteString)]\n              -> String         -- ^ name of test case\n              -> (T.Text, c)    -- ^ (input, expected value)\n              -> TestTree\ntestWithFiles fileDefs = test (orgWithFiles fileDefs)\n\norgWithFiles :: [(FilePath, BS.ByteString)] -> T.Text -> Pandoc\norgWithFiles fileDefs input =\n  let readOrg' = readOrg def{ readerExtensions = getDefaultExtensions \"org\" }\n  in flip purely input $ \\inp -> do\n    modifyPureState (\\st -> st { stFiles = files fileDefs })\n    readOrg' inp\n\n\nfiles :: [(FilePath, BS.ByteString)] -> FileTree\nfiles fileDefs =\n  let dummyTime = UTCTime (ModifiedJulianDay 125) (secondsToDiffTime 0)\n  in foldr (\\(fp, bs) -> insertInFileTree fp (FileInfo dummyTime bs))\n      mempty fileDefs\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"export options\"\n    [ \"disable simple sub/superscript syntax\" =:\n        T.unlines [ \"#+OPTIONS: ^:nil\"\n                  , \"a^b\"\n                  ] =?>\n        para \"a^b\"\n\n    , \"directly select drawers to be exported\" =:\n        T.unlines [ \"#+OPTIONS: d:(\\\"IMPORTANT\\\")\"\n                  , \":IMPORTANT:\"\n                  , \"23\"\n                  , \":END:\"\n                  , \":BORING:\"\n                  , \"very boring\"\n                  , \":END:\"\n                  ] =?>\n        divWith (mempty, [\"IMPORTANT\", \"drawer\"], mempty) (para \"23\")\n\n    , \"exclude drawers from being exported\" =:\n        T.unlines [ \"#+OPTIONS: d:(not \\\"BORING\\\")\"\n                  , \":IMPORTANT:\"\n                  , \"5\"\n                  , \":END:\"\n                  , \":BORING:\"\n                  , \"very boring\"\n                  , \":END:\"\n                  ] =?>\n        divWith (mempty, [\"IMPORTANT\", \"drawer\"], mempty) (para \"5\")\n\n    , \"don't include archive trees\" =:\n        T.unlines [ \"#+OPTIONS: arch:nil\"\n                  , \"* old  :ARCHIVE:\"\n                  ] =?>\n        (mempty ::Blocks)\n\n    , \"include complete archive trees\" =:\n        T.unlines [ \"#+OPTIONS: arch:t\"\n                  , \"* old  :ARCHIVE:\"\n                  , \"  boring\"\n                  ] =?>\n        mconcat [ headerWith (\"old\", [], mempty) 1\n                             (\"old\" <> space <> tagSpan \"ARCHIVE\")\n                , para \"boring\"\n                ]\n\n    , \"include archive tree header only\" =:\n        T.unlines [ \"#+OPTIONS: arch:headline\"\n                  , \"* old  :ARCHIVE:\"\n                  , \"  boring\"\n                  ] =?>\n        headerWith (\"old\", [], mempty) 1 (\"old\" <> space <> tagSpan \"ARCHIVE\")\n\n    , \"limit headline depth\" =:\n        T.unlines [ \"#+OPTIONS: H:2\"\n                  , \"* top-level section\"\n                  , \"** subsection\"\n                  , \"*** list item 1\"\n                  , \"*** list item 2\"\n                  ] =?>\n        mconcat [ headerWith (\"top-level-section\", [], [])    1 \"top-level section\"\n                , headerWith (\"subsection\", [], []) 2 \"subsection\"\n                , orderedList [ para \"list item 1\", para \"list item 2\" ]\n                ]\n\n    , \"turn all headlines into lists\" =:\n        T.unlines [ \"#+OPTIONS: H:0\"\n                  , \"first block\"\n                  , \"* top-level section 1\"\n                  , \"** subsection\"\n                  , \"* top-level section 2\"\n                  ] =?>\n        mconcat [ para \"first block\"\n                , orderedList\n                  [ para \"top-level section 1\" <>\n                     orderedList [ para \"subsection\" ]\n                  , para \"top-level section 2\" ]\n                ]\n\n    , \"preserve linebreaks as hard breaks\" =:\n        T.unlines [ \"#+OPTIONS: \\\\n:t\"\n                  , \"first\"\n                  , \"second\"\n                  ] =?>\n        para (\"first\" <> linebreak <> \"second\")\n\n    , \"disable author export\" =:\n        T.unlines [ \"#+OPTIONS: author:nil\"\n                  , \"#+AUTHOR: ShyGuy\"\n                  ] =?>\n        Pandoc nullMeta mempty\n\n    , \"disable creator export\" =:\n        T.unlines [ \"#+OPTIONS: creator:nil\"\n                  , \"#+creator: The Architect\"\n                  ] =?>\n        Pandoc nullMeta mempty\n\n    , \"disable email export\" =:\n        T.unlines [ \"#+OPTIONS: email:nil\"\n                  , \"#+email: no-mail-please@example.com\"\n                  ] =?>\n        Pandoc nullMeta mempty\n\n    , \"disable MathML-like entities\" =:\n        T.unlines [ \"#+OPTIONS: e:nil\"\n                  , \"Icelandic letter: \\\\thorn\"\n                  ] =?>\n        para \"Icelandic letter: \\\\thorn\"\n\n    , testGroup \"Option f\"\n      [ \"disable inline footnotes\" =:\n        T.unlines [ \"#+OPTIONS: f:nil\"\n                  , \"Funny![fn:funny:or not]\"\n                  ] =?>\n        para \"Funny!\"\n\n      , \"disable reference footnotes\" =:\n        T.unlines [ \"#+OPTIONS: f:nil\"\n                  , \"Burn everything[fn:1] down!\"\n                  , \"\"\n                  , \"[fn:2] Not quite everything.\"\n                  ] =?>\n        para \"Burn everything down!\"\n      ]\n\n    , \"disable inclusion of todo keywords\" =:\n        T.unlines [ \"#+OPTIONS: todo:nil\"\n                  , \"** DONE todo export\"\n                  ] =?>\n        headerWith (\"todo-export\", [], []) 2 \"todo export\"\n\n    , \"remove tags from headlines\" =:\n        T.unlines [ \"#+OPTIONS: tags:nil\"\n                  , \"* Headline :hello:world:\"\n                  ] =?>\n        headerWith (\"headline\", [], mempty) 1 \"Headline\"\n\n    , testGroup \"LaTeX\"\n      [ testGroup \"Include LaTeX fragments\"\n        [ \"Inline command\" =:\n          T.unlines [ \"#+OPTIONS: tex:t\"\n                    , \"Hello \\\\emph{Name}\"\n                    ] =?>\n          para (\"Hello\" <> space <> rawInline \"latex\" \"\\\\emph{Name}\")\n\n        , \"Alpha\" =:\n          T.unlines [ \"#+OPTIONS: tex:t\"\n                    , \"\\\\alpha\"\n                    ] =?>\n          para \"α\"\n\n        , \"equation environment\" =:\n          \"#+OPTIONS: tex:t\\n\\\n          \\\\\\begin{equation}\\n\\\n          \\f(x) = x^2\\n\\\n          \\\\\\end{equation}\"\n          =?>\n          para (rawInline \"latex\"\n                 \"\\\\begin{equation}\\n\\\n                 \\f(x) = x^2\\n\\\n                 \\\\\\end{equation}\")\n        ]\n\n      , testGroup \"Ignore LaTeX fragments\"\n        [ \"Inline command\" =:\n          T.unlines [ \"#+OPTIONS: tex:nil\"\n                    , \"Hello \\\\emph{Emphasised}\"\n                    ] =?>\n          para \"Hello\"\n\n        , \"MathML symbol (alpha)\" =:\n          T.unlines [ \"#+OPTIONS: tex:nil\"\n                    , \"\\\\alpha\"\n                    ] =?>\n          para \"α\"\n\n        , \"equation environment\" =:\n          T.unlines [ \"#+OPTIONS: tex:nil\"\n                    , \"\\\\begin{equation}\"\n                    , \"f(x) = x^2\"\n                    , \"\\\\end{equation}\"\n                    ] =?>\n          (para mempty)\n        ]\n\n      , testGroup \"Verbatim LaTeX\"\n        [ \"Inline command\" =:\n          T.unlines [ \"#+OPTIONS: tex:verbatim\"\n                    , \"Hello \\\\emph{Emphasised}\"\n                    ] =?>\n          para \"Hello \\\\emph{Emphasised}\"\n\n        , \"MathML symbol (alpha)\" =:\n          T.unlines [ \"#+OPTIONS: tex:verbatim\"\n                    , \"\\\\alpha\"\n                    ] =?>\n          para \"α\"\n\n        , \"equation environment\" =:\n          T.unlines [ \"#+OPTIONS: tex:verbatim\"\n                    , \"\\\\begin{equation}\"\n                    , \"f(x) = x^2\"\n                    , \"\\\\end{equation}\"\n                    ] =?>\n          para (str \"\\\\begin{equation}\" <> softbreak <>\n                text \"f(x) = x^2\" <> softbreak <>\n                str \"\\\\end{equation}\")\n        ]\n      ]\n\n    , testGroup \"planning information\"\n      [ \"include planning info after headlines\" =:\n        T.unlines [ \"#+OPTIONS: p:t\"\n                  , \"* important\"\n                  , \"  DEADLINE: <2018-10-01 Mon> SCHEDULED: <2018-09-15 Sat>\"\n                  ] =?>\n        mconcat [ headerWith (\"important\", mempty, mempty) 1 \"important\"\n                , plain $ strong \"DEADLINE:\"\n                       <> space\n                       <> emph (str \"<2018-10-01 Mon>\")\n                       <> space\n                       <> strong \"SCHEDULED:\"\n                       <> space\n                       <> emph (str \"<2018-09-15 Sat>\")\n                ]\n\n      , \"empty planning info is not included\" =:\n        T.unlines [ \"#+OPTIONS: p:t\"\n                  , \"* Wichtig\"\n                  ] =?>\n        headerWith (\"wichtig\", mempty, mempty) 1 \"Wichtig\"\n      ]\n\n    , testGroup \"Option |\"\n      [ \"disable export of tables\" =:\n        T.unlines [ \"#+OPTIONS: |:nil\"\n                  , \"| chair |\"\n                  ] =?>\n        (mempty :: Blocks)\n      ]\n\n    , testGroup \"unknown options\"\n      [ \"unknown options are ignored\" =:\n          T.unlines [ \"#+OPTIONS: does-not-exist:t \"] =?>\n          (mempty :: Pandoc)\n\n      , \"highlighting after unknown option\" =:\n          T.unlines [ \"#+OPTIONS: nope\"\n                    , \"/yup/\"\n                    ] =?>\n          para (emph \"yup\")\n\n      , \"unknown option interleaved with known\" =:\n          T.unlines [ \"#+OPTIONS: tags:nil foo:bar todo:nil\"\n                    , \"* DONE ignore things  :easy:\"\n                    ] =?>\n          headerWith (\"ignore-things\", [], mempty) 1 \"ignore things\"\n      ]\n    ]\n\n  , testGroup \"Include\"\n    [ testWithFiles [(\"./other.org\", \"content of other file\\n\")]\n      \"file inclusion\"\n      (T.unlines [ \"#+include: \\\"other.org\\\"\" ] =?>\n       plain \"content of other file\")\n\n    , testWithFiles [(\"./world.org\", \"World\\n\\n\")]\n      \"Included file belongs to item\"\n      (T.unlines [ \"- Hello,\\n  #+include: \\\"world.org\\\"\" ] =?>\n       bulletList [para \"Hello,\" <> para \"World\"])\n\n    , testWithFiles [(\"./level3.org\", \"*** Level3\\n\\n\")]\n      \"Default include preserves level\"\n      (T.unlines [ \"#+include: \\\"level3.org\\\"\" ] =?>\n       headerWith (\"level3\", [], []) 3 \"Level3\")\n\n    , testWithFiles [(\"./level3.org\", \"*** Level3\\n\\n\")]\n      \"Minlevel shifts level leftward\"\n      (T.unlines [ \"#+include: \\\"level3.org\\\" :minlevel 1\" ] =?>\n       headerWith (\"level3\", [], []) 1 \"Level3\")\n\n    , testWithFiles [(\"./level1.org\", \"* Level1\\n\\n\")]\n      \"Minlevel shifts level rightward\"\n      (T.unlines [ \"#+include: \\\"level1.org\\\" :minlevel 3\" ] =?>\n       headerWith (\"level1\", [], []) 3 \"Level1\")\n\n    , testWithFiles [(\"./src.hs\", \"putStrLn outString\\n\")]\n      \"Include file as source code snippet\"\n      (T.unlines [ \"#+include: \\\"src.hs\\\" src haskell\" ] =?>\n       codeBlockWith (\"\", [\"haskell\"], []) \"putStrLn outString\\n\")\n\n    , testWithFiles [(\"./export-latex.org\", \"\\\\emph{Hello}\\n\")]\n      \"Include file as export snippet\"\n      (T.unlines [ \"#+include: \\\"export-latex.org\\\" export latex\" ] =?>\n       rawBlock \"latex\" \"\\\\emph{Hello}\\n\")\n\n    , testWithFiles [(\"./subdir/foo-bar.latex\", \"foo\\n\"),\n                     (\"./hello.lisp\", \"(print \\\"Hello!\\\")\\n\")\n                    ]\n      \"include directive is limited to one line\"\n      (T.unlines [ \"#+INCLUDE: \\\"hello.lisp\\\" src lisp\"\n                 , \"#+include: \\\"subdir/foo-bar.latex\\\" export latex\"\n                 , \"bar\"\n                 ] =?>\n       mconcat\n         [ codeBlockWith (\"\", [\"lisp\"], []) \"(print \\\"Hello!\\\")\\n\"\n         , rawBlock \"latex\" \"foo\\n\"\n         , para \"bar\"\n         ]\n      )\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Inline/Citation.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Inline.Citation\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of citations in org input.\n-}\nmodule Tests.Readers.Org.Inline.Citation (tests) where\n\nimport Test.Tasty (TestTree, testGroup)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:))\nimport Text.Pandoc.Builder\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"Org-cite citations\"\n    [ \"Citation\" =:\n      \"[cite:@nonexistent]\" =?>\n      let citation = Citation\n                     { citationId = \"nonexistent\"\n                     , citationPrefix = []\n                     , citationSuffix = []\n                     , citationMode = NormalCitation\n                     , citationNoteNum = 0\n                     , citationHash = 0}\n      in (para $ cite [citation] \"[cite:@nonexistent]\")\n\n    , \"Citation containing text\" =:\n      \"[cite:see @item1 p. 34-35]\" =?>\n      let citation = Citation\n                     { citationId = \"item1\"\n                     , citationPrefix = [Str \"see\"]\n                     , citationSuffix = [Space ,Str \"p.\",Space,Str \"34-35\"]\n                     , citationMode = NormalCitation\n                     , citationNoteNum = 0\n                     , citationHash = 0}\n      in (para $ cite [citation] \"[cite:see @item1 p. 34-35]\")\n\n    , \"Author-in-text citation with locator and suffix\" =:\n      \"[cite/t:see @item1 p. 34-35 and *passim*; @item2]\" =?>\n      let citations =\n            [ Citation\n                { citationId = \"item1\"\n                , citationPrefix = [ Str \"see\" ]\n                , citationSuffix =\n                    [ Str \"p.\"\n                    , Space\n                    , Str \"34-35\"\n                    , Space\n                    , Str \"and\"\n                    , Space\n                    , Strong [ Str \"passim\" ]\n                    ]\n                , citationMode = AuthorInText\n                , citationNoteNum = 0\n                , citationHash = 0\n                }\n            , Citation\n                { citationId = \"item2\"\n                , citationPrefix = []\n                , citationSuffix = []\n                , citationMode = NormalCitation\n                , citationNoteNum = 0\n                , citationHash = 0\n                }\n            ]\n      in (para $ cite citations \"[cite/t:see @item1 p. 34-35 and *passim*; @item2]\")\n    ]\n\n  , testGroup \"org-ref citations\"\n    [ \"simple citation\" =:\n      \"cite:pandoc\" =?>\n      let citation = Citation\n                     { citationId = \"pandoc\"\n                     , citationPrefix = mempty\n                     , citationSuffix = mempty\n                     , citationMode = AuthorInText\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"cite:pandoc\")\n\n    , \"simple citation with underscores\" =:\n      \"cite:pandoc_org_ref\" =?>\n      let citation = Citation\n                     { citationId = \"pandoc_org_ref\"\n                     , citationPrefix = mempty\n                     , citationSuffix = mempty\n                     , citationMode = AuthorInText\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"cite:pandoc_org_ref\")\n\n    , \"simple citation succeeded by comma\" =:\n      \"cite:pandoc,\" =?>\n      let citation = Citation\n                     { citationId = \"pandoc\"\n                     , citationPrefix = mempty\n                     , citationSuffix = mempty\n                     , citationMode = AuthorInText\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"cite:pandoc\" <> str \",\")\n\n    , \"simple citation succeeded by dot\" =:\n      \"cite:pandoc.\" =?>\n      let citation = Citation\n                     { citationId = \"pandoc\"\n                     , citationPrefix = mempty\n                     , citationSuffix = mempty\n                     , citationMode = AuthorInText\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"cite:pandoc\" <> str \".\")\n\n    , \"simple citation succeeded by colon\" =:\n      \"cite:pandoc:\" =?>\n      let citation = Citation\n                     { citationId = \"pandoc\"\n                     , citationPrefix = mempty\n                     , citationSuffix = mempty\n                     , citationMode = AuthorInText\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"cite:pandoc\" <> str \":\")\n\n    , \"simple citep citation\" =:\n      \"citep:pandoc\" =?>\n      let citation = Citation\n                     { citationId = \"pandoc\"\n                     , citationPrefix = mempty\n                     , citationSuffix = mempty\n                     , citationMode = NormalCitation\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"citep:pandoc\")\n\n    , \"multiple simple citations\" =:\n      \"citep:picard,riker\" =?>\n      let picard = Citation\n                 { citationId = \"picard\"\n                 , citationPrefix = mempty\n                 , citationSuffix = mempty\n                 , citationMode = NormalCitation\n                 , citationNoteNum = 0\n                 , citationHash = 0\n                 }\n          riker  = Citation\n                 { citationId = \"riker\"\n                 , citationPrefix = mempty\n                 , citationSuffix = mempty\n                 , citationMode = NormalCitation\n                 , citationNoteNum = 0\n                 , citationHash = 0\n                 }\n      in (para $ cite [picard,riker] \"citep:picard,riker\")\n\n    , \"multiple simple citations succeeded by comma\" =:\n      \"citep:picard,riker,\" =?>\n      let picard = Citation\n                 { citationId = \"picard\"\n                 , citationPrefix = mempty\n                 , citationSuffix = mempty\n                 , citationMode = NormalCitation\n                 , citationNoteNum = 0\n                 , citationHash = 0\n                 }\n          riker  = Citation\n                 { citationId = \"riker\"\n                 , citationPrefix = mempty\n                 , citationSuffix = mempty\n                 , citationMode = NormalCitation\n                 , citationNoteNum = 0\n                 , citationHash = 0\n                 }\n      in (para $ cite [picard,riker] \"citep:picard,riker\" <> str \",\")\n\n    , \"extended citation\" =:\n      \"[[citep:Dominik201408][See page 20::, for example]]\" =?>\n      let citation = Citation\n                     { citationId = \"Dominik201408\"\n                     , citationPrefix = toList \"See page 20\"\n                     , citationSuffix = toList \", for example\"\n                     , citationMode = NormalCitation\n                     , citationNoteNum = 0\n                     , citationHash = 0\n                     }\n      in (para $ cite [citation] \"[[citep:Dominik201408][See page 20::, for example]]\")\n    ]\n\n  , \"LaTeX citation\" =:\n    \"\\\\cite{Coffee}\" =?>\n      para (rawInline \"latex\" \"\\\\cite{Coffee}\")\n\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Inline/Note.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Inline.Note\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest parsing of footnotes in org input.\n-}\nmodule Tests.Readers.Org.Inline.Note (tests) where\n\nimport Test.Tasty (TestTree)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:))\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\ntests :: [TestTree]\ntests =\n  [ \"Footnote\" =:\n      T.unlines [ \"A footnote[1]\"\n                , \"\"\n                , \"[1] First paragraph\"\n                , \"\"\n                , \"second paragraph\"\n                ] =?>\n      para (mconcat\n            [ \"A\", space, \"footnote\"\n            , note $ mconcat [ para (\"First\" <> space <> \"paragraph\")\n                             , para (\"second\" <> space <> \"paragraph\")\n                             ]\n            ])\n\n  , \"Two footnotes\" =:\n      T.unlines [ \"Footnotes[fn:1][fn:2]\"\n                , \"\"\n                , \"[fn:1] First note.\"\n                , \"\"\n                , \"[fn:2] Second note.\"\n                ] =?>\n      para (mconcat\n            [ \"Footnotes\"\n            , note $ para (\"First\" <> space <> \"note.\")\n            , note $ para (\"Second\" <> space <> \"note.\")\n            ])\n\n  , \"Emphasized text before footnote\" =:\n      T.unlines [ \"/text/[fn:1]\"\n                , \"\"\n                , \"[fn:1] unicorn\"\n                ] =?>\n      para (mconcat\n           [ emph \"text\"\n           , note . para $ \"unicorn\"\n           ])\n\n  , \"Footnote that starts with emphasized text\" =:\n      T.unlines [ \"text[fn:1]\"\n                , \"\"\n                , \"[fn:1] /emphasized/\"\n                ] =?>\n      para (mconcat\n           [ \"text\"\n           , note . para $ emph \"emphasized\"\n           ])\n\n  , \"Footnote followed by header\" =:\n      T.unlines [ \"Another note[fn:yay]\"\n                , \"\"\n                , \"[fn:yay] This is great!\"\n                , \"\"\n                , \"** Headline\"\n                ] =?>\n      mconcat\n      [ para (mconcat\n              [ \"Another\", space, \"note\"\n              , note $ para (\"This\" <> space <> \"is\" <> space <> \"great!\")\n              ])\n      , headerWith (\"headline\", [], []) 2 \"Headline\"\n      ]\n\n  , \"Footnote followed by two blank lines\" =:\n      T.unlines [ \"footnote[fn:blanklines]\"\n                , \"\"\n                , \"[fn:blanklines] followed by blank lines\"\n                , \"\"\n                , \"\"\n                , \"next\"\n                ] =?>\n      mconcat\n      [ para (\"footnote\" <> note (para \"followed by blank lines\"))\n      , para \"next\"\n      ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Inline/Smart.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Inline.Smart\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTest smart parsing of quotes, apostrophe, etc.\n-}\nmodule Tests.Readers.Org.Inline.Smart (tests) where\n\nimport Data.Text (Text)\nimport Test.Tasty (TestTree)\nimport Tests.Helpers ((=?>), purely, test)\nimport Text.Pandoc (ReaderOptions (readerExtensions),\n                    Extension (Ext_smart), def, enableExtension,\n                    getDefaultExtensions, readOrg)\nimport Text.Pandoc.Builder\n\norgSmart :: Text -> Pandoc\norgSmart = purely $\n  let extensionsSmart = enableExtension Ext_smart (getDefaultExtensions \"org\")\n  in readOrg def{ readerExtensions = extensionsSmart }\n\ntests :: [TestTree]\ntests =\n  [ test orgSmart \"quote before ellipses\"\n    (\"'...hi'\"\n     =?> para (singleQuoted \"…hi\"))\n\n  , test orgSmart \"apostrophe before emph\"\n    (\"D'oh! A l'/aide/!\"\n     =?> para (\"D’oh! A l’\" <> emph \"aide\" <> \"!\"))\n\n  , test orgSmart \"apostrophe in French\"\n    (\"À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»\"\n     =?> para \"À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»\")\n\n  , test orgSmart \"Quotes cannot occur at the end of emphasized text\"\n    (\"/say \\\"yes\\\"/\" =?>\n     para (\"/say\" <> space <> doubleQuoted \"yes\" <> \"/\"))\n\n  , test orgSmart \"Dashes are allowed at the borders of emphasis'\"\n    (\"/foo---/\" =?>\n     para (emph \"foo—\"))\n\n  , test orgSmart \"Support for shy (soft) hyphen\"\n    (\"Ur\\\\-instinkt\" =?>\n     para \"Ur\\173instinkt\")\n\n  , test orgSmart \"Single quotes can be followed by emphasized text\"\n    (\"Singles on the '/meat market/'\" =?>\n     para (\"Singles on the \" <> singleQuoted (emph \"meat market\")))\n\n  , test orgSmart \"Double quotes can be followed by emphasized text\"\n    (\"Double income, no kids: \\\"/DINK/\\\"\" =?>\n     para (\"Double income, no kids: \" <> doubleQuoted (emph \"DINK\")))\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Inline.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Inline\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTests parsing of org inlines.\n-}\nmodule Tests.Readers.Org.Inline (tests) where\n\nimport Data.List (intersperse)\nimport Test.Tasty (TestTree, testGroup)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:), spcSep)\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\nimport qualified Tests.Readers.Org.Inline.Citation as Citation\nimport qualified Tests.Readers.Org.Inline.Note as Note\nimport qualified Tests.Readers.Org.Inline.Smart as Smart\n\ntests :: [TestTree]\ntests =\n  [ \"Plain String\" =:\n      \"Hello, World\" =?>\n      para (spcSep [ \"Hello,\", \"World\" ])\n\n  , \"Emphasis\" =:\n      \"/Planet Punk/\" =?>\n      para (emph . spcSep $ [\"Planet\", \"Punk\"])\n\n  , \"Strong\" =:\n      \"*Cider*\" =?>\n      para (strong \"Cider\")\n\n  , \"Strong Emphasis\" =:\n      \"/*strength*/\" =?>\n      para (emph . strong $ \"strength\")\n\n  , \"Emphasized Strong preceded by space\" =:\n      \" */super/*\" =?>\n      para (strong . emph $ \"super\")\n\n  , \"Underline\" =:\n      \"_underline_\" =?>\n      para (underline \"underline\")\n\n  , \"Strikeout\" =:\n      \"+Kill Bill+\" =?>\n      para (strikeout . spcSep $ [ \"Kill\", \"Bill\" ])\n\n  , \"Verbatim\" =:\n      \"=Robot.rock()=\" =?>\n      para (codeWith (\"\", [\"verbatim\"], []) \"Robot.rock()\")\n\n  , \"Code\" =:\n      \"~word for word~\" =?>\n      para (code \"word for word\")\n\n  , \"Math $..$\" =:\n      \"$E=mc^2$\" =?>\n       para (math \"E=mc^2\")\n\n  , \"Math $$..$$\" =:\n      \"$$E=mc^2$$\" =?>\n      para (displayMath \"E=mc^2\")\n\n  , \"Math \\\\[..\\\\]\" =:\n      \"\\\\[E=ℎν\\\\]\" =?>\n      para (displayMath \"E=ℎν\")\n\n  , \"Math \\\\(..\\\\)\" =:\n      \"\\\\(σ_x σ_p ≥ \\\\frac{ℏ}{2}\\\\)\" =?>\n      para (math \"σ_x σ_p ≥ \\\\frac{ℏ}{2}\")\n\n  , \"Symbol\" =:\n      \"A * symbol\" =?>\n      para (str \"A\" <> space <> str \"*\" <> space <> \"symbol\")\n\n  , \"Superscript simple expression\" =:\n      \"2^-λ\" =?>\n      para (str \"2\" <> superscript \"-λ\")\n\n  , \"Superscript multi char\" =:\n      \"2^{n-1}\" =?>\n      para (str \"2\" <> superscript \"n-1\")\n\n  , \"Superscript-like, but not after string\" =:\n      \"a ^caret\" =?>\n      para \"a ^caret\"\n\n  , \"Subscript simple expression\" =:\n      \"a_n\" =?>\n      para (str \"a\" <> subscript \"n\")\n\n  , \"Subscript multi char\" =:\n      \"a_{n+1}\" =?>\n      para (str \"a\" <> subscript \"n+1\")\n\n  , \"Subscript-like, but not after string\" =:\n      \"_underscore\" =?>\n      para \"_underscore\"\n\n  , \"Subscript takes precedence before underline\" =:\n      \"text_subscript_\" =?>\n      para (str \"text\" <> subscript \"subscript\" <> str \"_\")\n\n  , \"Linebreak\" =:\n      \"line \\\\\\\\ \\nbreak\" =?>\n      para (\"line\" <> linebreak <> \"break\")\n\n  , \"Inline note\" =:\n      \"[fn::Schreib mir eine E-Mail]\" =?>\n      para (note $ para \"Schreib mir eine E-Mail\")\n\n  , \"By default, markup-chars not occurring on word break are symbols\" =:\n      T.unlines [ \"#+pandoc-emphasis-pre:\"\n                , \"#+pandoc-emphasis-post:\"\n                , \"this+that+ +so+on\"\n                , \"seven*eight* nine*\"\n                , \"+not+funny+\"\n                ] =?>\n      para (\"this+that+ +so+on\" <> softbreak <>\n            \"seven*eight* nine*\" <> softbreak <>\n            strikeout \"not+funny\")\n\n  , \"No empty markup\" =:\n      \"// ** __ <> == ~~ $$\" =?>\n      para (spcSep [ \"//\", \"**\", \"__\", \"<>\", \"==\", \"~~\", \"$$\" ])\n\n  , \"Adherence to Org's rules for markup borders\" =:\n      \"/t/& a/ / ./r/ (*l*) /e/! ze\\x200b/r/\\x200bo /b/.\" =?>\n      para (spcSep [ emph $ \"t/&\" <> space <> \"a\"\n                   , \"/\"\n                   , \"./r/\"\n                   , \"(\" <> strong \"l\" <> \")\"\n                   , emph \"e\" <> \"!\"\n                   , \"ze\\x200b\" <> emph \"r\" <> \"\\x200bo\"\n                   , emph \"b\" <> \".\"\n                   ])\n\n  , \"Quotes are allowed border chars\" =:\n      \"/'yep/ *sure\\\"*\" =?>\n      para (emph \"'yep\" <> space <> strong \"sure\\\"\")\n\n  , \"Spaces are forbidden border chars\" =:\n      \"/nada /\" =?>\n      para \"/nada /\"\n\n  , \"Zero width spaces are forbidden border chars\" =:\n      \"/emph\\x200b/asis\" =?>\n      para \"/emph\\x200b/asis\"\n\n  , \"Markup should work properly after a blank line\" =:\n    T.unlines [\"foo\", \"\", \"/bar/\"] =?>\n    para (text \"foo\") <>\n    para (emph $ text \"bar\")\n\n  , \"Inline math must stay within three lines\" =:\n      T.unlines [ \"$a\", \"b\", \"c$\", \"$d\", \"e\", \"f\", \"g$\" ] =?>\n      para (math \"a\\nb\\nc\" <> softbreak <>\n            \"$d\" <> softbreak <> \"e\" <> softbreak <>\n            \"f\" <> softbreak <> \"g$\")\n\n  , \"Single-character math\" =:\n      \"$a$ $b$! $c$?\" =?>\n      para (spcSep [ math \"a\"\n                   , \"$b$!\"\n                   , math \"c\" <> \"?\"\n                   ])\n\n  , \"Markup may not span more than two lines\" =:\n      \"/this *is +totally\\nnice+ not*\\nemph/\" =?>\n      para (\"/this\" <> space <>\n              strong (\"is\" <> space <>\n                      strikeout (\"totally\" <>\n                        softbreak <> \"nice\") <>\n                      space <> \"not\") <>\n              softbreak <> \"emph/\")\n\n  , \"Sub- and superscript expressions\" =:\n     T.unlines [ \"a_(a(b)(c)d)\"\n               , \"e^(f(g)h)\"\n               , \"i_(jk)l)\"\n               , \"m^()n\"\n               , \"o_{p{q{}r}}\"\n               , \"s^{t{u}v}\"\n               , \"w_{xy}z}\"\n               , \"1^{}2\"\n               , \"3_{{}}\"\n               , \"4^(a(*b(c*)d))\"\n               ] =?>\n     para (mconcat $ intersperse softbreak\n                  [ \"a\" <> subscript \"(a(b)(c)d)\"\n                  , \"e\" <> superscript \"(f(g)h)\"\n                  , \"i\" <> subscript \"(jk)\" <> \"l)\"\n                  , \"m\" <> superscript \"()\" <> \"n\"\n                  , \"o\" <> subscript \"p{q{}r}\"\n                  , \"s\" <> superscript \"t{u}v\"\n                  , \"w\" <> subscript \"xy\" <> \"z}\"\n                  , \"1\" <> superscript \"\" <> \"2\"\n                  , \"3\" <> subscript \"{}\"\n                  , \"4\" <> superscript (\"(a(\" <> strong \"b(c\" <> \")d))\")\n                  ])\n  , \"Verbatim text can contain equal signs (=)\" =:\n      \"=is_subst = True=\" =?>\n      para (codeWith (\"\", [\"verbatim\"], []) \"is_subst = True\")\n\n  , testGroup \"Images\"\n    [ \"Image\" =:\n      \"[[./sunset.jpg]]\" =?>\n      para (image \"./sunset.jpg\" \"\" \"\")\n\n    , \"Image with explicit file: prefix\" =:\n      \"[[file:sunrise.jpg]]\" =?>\n      para (image \"sunrise.jpg\" \"\" \"\")\n\n    , \"Multiple images within a paragraph\" =:\n      T.unlines [ \"[[file:sunrise.jpg]]\"\n                , \"[[file:sunset.jpg]]\"\n                ] =?>\n      para (image \"sunrise.jpg\" \"\" \"\"\n             <> softbreak\n             <> image \"sunset.jpg\" \"\" \"\")\n\n    , \"Image with html attributes\" =:\n      T.unlines [ \"#+attr_html: :width 50%\"\n                , \"[[file:guinea-pig.gif]]\"\n                ] =?>\n      para (imageWith (\"\", [], [(\"width\", \"50%\")]) \"guinea-pig.gif\" \"\" \"\")\n\n    , \"HTML attributes can have trailing spaces\" =:\n      T.unlines [ \"#+attr_html: :width 100% :height 360px  \"\n                , \"[[file:fireworks.jpg]]\"\n                ] =?>\n      let kv = [(\"width\", \"100%\"), (\"height\", \"360px\")]\n      in para (imageWith (mempty, mempty, kv) \"fireworks.jpg\" mempty mempty)\n\n\n    , \"Uppercase extension\" =:\n      \"[[file:test.PNG]]\" =?>\n      para (image \"test.PNG\" \"\" \"\")\n    ]\n\n  , \"Explicit link\" =:\n      \"[[http://zeitlens.com/][pseudo-random /nonsense/]]\" =?>\n    para (link \"http://zeitlens.com/\" \"\"\n                   (\"pseudo-random\" <> space <> emph \"nonsense\"))\n\n  , \"Self-link\" =:\n      \"[[http://zeitlens.com/]]\" =?>\n    para (link \"http://zeitlens.com/\" \"\" \"http://zeitlens.com/\")\n\n  , \"Internal self-link (reference)\" =:\n    \"[[#rabbit]]\" =?>\n    para (link \"#rabbit\" \"\" \"#rabbit\")\n\n  , \"Absolute file link\" =:\n      \"[[/url][hi]]\" =?>\n    para (link \"file:///url\" \"\" \"hi\")\n\n  , \"Link to file in parent directory\" =:\n      \"[[../file.txt][moin]]\" =?>\n    para (link \"../file.txt\" \"\" \"moin\")\n\n  , \"Empty link (for gitit interop)\" =:\n      \"[[][New Link]]\" =?>\n    para (link \"\" \"\" \"New Link\")\n\n  , \"Image link\" =:\n      \"[[sunset.png][file:dusk.svg]]\" =?>\n    para (link \"sunset.png\" \"\" (image \"dusk.svg\" \"\" \"\"))\n\n  , \"Image link with non-image target\" =:\n      \"[[http://example.com][./logo.png]]\" =?>\n    para (link \"http://example.com\" \"\" (image \"./logo.png\" \"\" \"\"))\n\n  , \"Link to image\" =:\n    \"[[https://example.com/image.jpg][Look!]]\" =?>\n    para (link \"https://example.com/image.jpg\" \"\" (str \"Look!\"))\n\n  , \"Plain link\" =:\n      \"Posts on http://zeitlens.com/ can be funny at times.\" =?>\n    para (spcSep [ \"Posts\", \"on\"\n                     , link \"http://zeitlens.com/\" \"\" \"http://zeitlens.com/\"\n                     , \"can\", \"be\", \"funny\", \"at\", \"times.\"\n                     ])\n\n  , \"Angle link\" =:\n      \"Look at <http://moltkeplatz.de> for fnords.\" =?>\n    para (spcSep [ \"Look\", \"at\"\n                     , link \"http://moltkeplatz.de\" \"\" \"http://moltkeplatz.de\"\n                     , \"for\", \"fnords.\"\n                     ])\n\n  , \"Absolute file link\" =:\n      \"[[file:///etc/passwd][passwd]]\" =?>\n    para (link \"file:///etc/passwd\" \"\" \"passwd\")\n\n  , \"File link\" =:\n      \"[[file:target][title]]\" =?>\n    para (link \"target\" \"\" \"title\")\n\n  , \"Anchor\" =:\n      \"<<anchor>> Link here later.\" =?>\n    para (spanWith (\"anchor\", [], []) mempty <>\n              \"Link\" <> space <> \"here\" <> space <> \"later.\")\n\n  , \"Inline code block\" =:\n      \"src_emacs-lisp{(message \\\"Hello\\\")}\" =?>\n    para (codeWith ( \"\"\n                       , [ \"commonlisp\" ]\n                       , [ (\"org-language\", \"emacs-lisp\") ])\n                       \"(message \\\"Hello\\\")\")\n\n  , \"Inline code block with arguments\" =:\n      \"src_sh[:export both :results output]{echo 'Hello, World'}\" =?>\n    para (codeWith ( \"\"\n                       , [ \"bash\" ]\n                       , [ (\"org-language\", \"sh\")\n                         , (\"export\", \"both\")\n                         , (\"results\", \"output\")\n                         ]\n                       )\n                       \"echo 'Hello, World'\")\n\n  , \"Inline code block with a blank argument array\" =:\n      \"src_sh[]{echo 'Hello, World'}\" =?>\n    para (codeWith ( \"\"\n                       , [ \"bash\" ]\n                       , [ (\"org-language\", \"sh\") ])\n                       \"echo 'Hello, World'\")\n\n  , \"Inline code block with toggle\" =:\n      \"src_sh[:toggle]{echo $HOME}\" =?>\n    para (codeWith ( \"\"\n                       , [ \"bash\" ]\n                       , [ (\"org-language\", \"sh\")\n                         , (\"toggle\", \"yes\")\n                         ]\n                       )\n                       \"echo $HOME\")\n\n  , \"Inline LaTeX symbol\" =:\n      \"\\\\dots\" =?>\n      para \"…\"\n\n  , \"Inline LaTeX command\" =:\n      \"\\\\textit{Emphasised}\" =?>\n      para (emph \"Emphasised\")\n\n  , \"Inline LaTeX command with spaces\" =:\n      \"\\\\emph{Emphasis mine}\" =?>\n      para (rawInline \"latex\" \"\\\\emph{Emphasis mine}\")\n\n  , \"Inline math symbols\" =:\n      \"\\\\tau \\\\oplus \\\\alpha\" =?>\n      para \"τ ⊕ α\"\n\n  , \"Inline LaTeX math command\" =:\n      \"\\\\crarr\" =?>\n      para \"↵\"\n\n  , \"Unknown inline LaTeX command\" =:\n      \"\\\\notacommand{foo}\" =?>\n      para (rawInline \"latex\" \"\\\\notacommand{foo}\")\n\n  , \"Export snippet\" =:\n      \"@@html:<kbd>M-x org-agenda</kbd>@@\" =?>\n      para (rawInline \"html\" \"<kbd>M-x org-agenda</kbd>\")\n\n  , \"MathML symbol in LaTeX-style\" =:\n      \"There is a hackerspace in Lübeck, Germany, called nbsp (unicode symbol: '\\\\nbsp').\" =?>\n      para \"There is a hackerspace in Lübeck, Germany, called nbsp (unicode symbol: ' ').\"\n\n  , \"MathML symbol in LaTeX-style, including braces\" =:\n      \"\\\\Aacute{}stor\" =?>\n      para \"Ástor\"\n\n  , \"MathML copy sign\" =:\n      \"\\\\copy\" =?>\n      para \"©\"\n\n  , \"MathML symbols, space separated\" =:\n      \"\\\\ForAll \\\\Auml\" =?>\n      para \"∀ Ä\"\n\n  , \"Macro\" =:\n      T.unlines [ \"#+MACRO: HELLO /Hello, $1/\"\n                , \"{{{HELLO(World)}}}\"\n                ] =?>\n      para (emph \"Hello, World\")\n\n  , \"Macro duplicating its argument\" =:\n      T.unlines [ \"#+MACRO: HELLO $1$1\"\n                , \"{{{HELLO(moin)}}}\"\n                ] =?>\n      para \"moinmoin\"\n\n  , \"Macro called with too few arguments\" =:\n      T.unlines [ \"#+MACRO: HELLO Foo $1 $2 Bar\"\n                , \"{{{HELLO()}}}\"\n                ] =?>\n      para \"Foo Bar\"\n  , \"Macro called with an escaped comma\" =:\n      T.unlines [ \"#+MACRO: HELLO Foo $1\"\n                , \"{{{HELLO(moin\\\\, niom)}}}\"\n                ] =?>\n      para \"Foo moin, niom\"\n\n  , testGroup \"Citations\" Citation.tests\n  , testGroup \"Footnotes\" Note.tests\n  , testGroup \"Smart punctuation\" Smart.tests\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Meta.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Meta\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTests parsing of org meta data (mostly lines starting with @#+@).\n-}\nmodule Tests.Readers.Org.Meta (tests) where\n\nimport Test.Tasty (TestTree, testGroup)\nimport Tests.Helpers ((=?>))\nimport Tests.Readers.Org.Shared ((=:), spcSep)\nimport Text.Pandoc\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"Comments\"\n    [ \"Comment\" =:\n      \"# Nothing to see here\" =?>\n      (mempty::Blocks)\n\n    , \"Hash not followed by space is text\" =:\n      \"#-tag\" =?>\n      para \"#-tag\"\n\n    , \"Comment surrounded by Text\" =:\n      T.unlines [ \"Before\"\n                , \"# Comment\"\n                , \"After\"\n                ] =?>\n      mconcat [ para \"Before\"\n              , para \"After\"\n              ]\n    ]\n\n  , testGroup \"Export settings\"\n    [ \"Title\" =:\n      \"#+title: Hello, World\" =?>\n      let titleInline = toList $ \"Hello,\" <> space <> \"World\"\n          meta = setMeta \"title\" (MetaInlines titleInline) nullMeta\n      in Pandoc meta mempty\n\n    , testGroup \"Author\"\n      [ \"sets 'author' field\" =:\n        \"#+author: John /Emacs-Fanboy/ Doe\" =?>\n        let author = toList . spcSep $ [ \"John\", emph \"Emacs-Fanboy\", \"Doe\" ]\n            meta = setMeta \"author\" (MetaInlines author) nullMeta\n        in Pandoc meta mempty\n\n      , \"Multiple author lines\" =:\n        T.unlines [ \"#+author: James Dewey Watson,\"\n                  , \"#+author: Francis Harry Compton Crick\"\n                  ] =?>\n        let watson = toList \"James Dewey Watson,\"\n            crick = toList \"Francis Harry Compton Crick\"\n            meta = setMeta \"author\"\n                           (MetaInlines (watson ++ SoftBreak : crick))\n                           nullMeta\n        in Pandoc meta mempty\n      ]\n\n    , \"Date\" =:\n      \"#+date: Feb. *28*, 2014\" =?>\n      let date = toList . spcSep $ [ \"Feb.\", strong \"28\" <> \",\", \"2014\" ]\n          meta = setMeta \"date\" (MetaInlines date) nullMeta\n      in Pandoc meta mempty\n\n    , testGroup \"Description\"\n      [ \"Single line\" =:\n        \"#+description: Explanatory text\" =?>\n        let description = [Str \"Explanatory\", Space, Str \"text\"]\n            meta = setMeta \"description\" (MetaInlines description) nullMeta\n        in Pandoc meta mempty\n\n      , \"Multiline\" =:\n        T.unlines [ \"#+description: /Short/ introduction\"\n                  , \"#+description: to Org-mode\"\n                  ] =?>\n        let description = [ Emph [Str \"Short\"], Space, Str \"introduction\"\n                          , SoftBreak\n                          , Str \"to\", Space, Str \"Org-mode\"\n                          ]\n            meta = setMeta \"description\" (MetaInlines description) nullMeta\n        in Pandoc meta mempty\n      ]\n\n    , \"Subtitle\" =:\n      T.unlines [ \"#+subtitle: Your Life in\"\n                , \"#+subtitle: /Plain/ Text\"\n                ] =?>\n      let subtitle = \"Your Life in\" <> softbreak <> emph \"Plain\" <> \" Text\"\n      in Pandoc (setMeta \"subtitle\" (toMetaValue subtitle) nullMeta) mempty\n\n    , \"Keywords\" =:\n      T.unlines [ \"#+keywords: pandoc, testing,\"\n                , \"#+keywords: Org\"\n                ] =?>\n      let keywords = toList $ \"pandoc, testing,\" <> softbreak <> \"Org\"\n          meta = setMeta \"keywords\" (MetaInlines keywords) nullMeta\n      in Pandoc meta mempty\n\n    , \"Institute\" =:\n      \"#+institute: ACME Inc.\" =?>\n      Pandoc (setMeta \"institute\" (\"ACME Inc.\" :: Inlines) nullMeta) mempty\n\n    , \"Document language\" =:\n      \"#+LANGUAGE: de-DE\" =?>\n      Pandoc (setMeta \"lang\" (MetaString \"de-DE\") nullMeta) mempty\n\n    , testGroup \"Todo sequences\"\n      [ \"not included in document\" =:\n        \"#+todo: WAITING | FINISHED\" =?>\n        Pandoc mempty mempty\n\n      , \"can contain multiple pipe characters\" =:\n        \"#+todo: UNFINISHED | RESEARCH | NOTES | CHART\\n\" =?>\n        Pandoc mempty mempty\n      ]\n\n    , testGroup \"LaTeX\"\n      [ \"LATEX_HEADER\" =:\n        \"#+latex_header: \\\\usepackage{tikz}\" =?>\n        let latexInlines = rawInline \"latex\" \"\\\\usepackage{tikz}\"\n            inclList = MetaList [MetaInlines (toList latexInlines)]\n            meta = setMeta \"header-includes\" inclList nullMeta\n        in Pandoc meta mempty\n\n      , \"LATEX_HEADER_EXTRA\" =:\n        \"#+latex_header_extra: \\\\usepackage{calc}\" =?>\n        let latexInlines = rawInline \"latex\" \"\\\\usepackage{calc}\"\n            inclList = toMetaValue [latexInlines]\n        in Pandoc (setMeta \"header-includes\" inclList nullMeta) mempty\n\n      , testGroup \"LaTeX_CLASS\"\n        [ \"stored as documentclass\" =:\n          \"#+latex_class: article\" =?>\n          let meta = setMeta \"documentclass\" (MetaString \"article\") nullMeta\n          in Pandoc meta mempty\n\n        , \"last definition takes precedence\" =:\n          T.unlines [ \"#+latex_class: this will not be used\"\n                    , \"#+latex_class: report\"\n                    ] =?>\n          let meta = setMeta \"documentclass\" (MetaString \"report\") nullMeta\n          in Pandoc meta mempty\n        ]\n\n      , \"LATEX_CLASS_OPTIONS as classoption\" =:\n        \"#+latex_class_options: [a4paper]\" =?>\n        let meta = setMeta \"classoption\" (MetaString \"a4paper\") nullMeta\n        in Pandoc meta mempty\n      ]\n\n    , testGroup \"HTML\"\n      [ \"HTML_HEAD values are added to header-includes\" =:\n        \"#+html_head: <meta/>\" =?>\n        let html = rawInline \"html\" \"<meta/>\"\n            inclList = MetaList [MetaInlines (toList html)]\n            meta = setMeta \"header-includes\" inclList nullMeta\n        in Pandoc meta mempty\n\n      , \"HTML_HEAD_EXTRA behaves like HTML_HEAD\" =:\n        T.unlines [ \"#+html_head: <meta name=\\\"generator\\\" content=\\\"pandoc\\\">\"\n                  , \"#+html_head_extra: <meta charset=\\\"utf-8\\\">\"\n                  ] =?>\n        let generator = rawInline \"html\"\n                                  \"<meta name=\\\"generator\\\" content=\\\"pandoc\\\">\"\n            charset = rawInline \"html\" \"<meta charset=\\\"utf-8\\\">\"\n            inclList = toMetaValue [generator, charset]\n        in Pandoc (setMeta \"header-includes\" inclList nullMeta) mempty\n      ]\n    ]\n\n  , testGroup \"Non-export keywords\"\n    [ testGroup \"#+link\"\n      [ \"Link abbreviation\" =:\n        T.unlines [ \"#+link: wp https://en.wikipedia.org/wiki/%s\"\n                  , \"[[wp:Org_mode][Wikipedia on Org-mode]]\"\n                  ] =?>\n        para (link \"https://en.wikipedia.org/wiki/Org_mode\" \"\"\n               (\"Wikipedia\" <> space <> \"on\" <> space <> \"Org-mode\"))\n\n      , \"Link abbreviation, defined after first use\" =:\n        T.unlines [ \"[[zl:non-sense][Non-sense articles]]\"\n                  , \"#+link: zl http://zeitlens.com/tags/%s.html\"\n                  ] =?>\n        para (link \"http://zeitlens.com/tags/non-sense.html\" \"\"\n               (\"Non-sense\" <> space <> \"articles\"))\n\n      , \"Link abbreviation, URL encoded arguments\" =:\n        T.unlines [ \"#+link: expl http://example.com/%h/foo\"\n                  , \"[[expl:Hello, World!][Moin!]]\"\n                  ] =?>\n        para (link \"http://example.com/Hello%2C%20World%21/foo\" \"\" \"Moin!\")\n\n      , \"Link abbreviation, append arguments\" =:\n        T.unlines [ \"#+link: expl http://example.com/\"\n                  , \"[[expl:foo][bar]]\"\n                  ] =?>\n        para (link \"http://example.com/foo\" \"\" \"bar\")\n      ]\n\n    , testGroup \"emphasis config\"\n      [ \"Changing pre chars for emphasis\" =:\n        T.unlines [ \"#+pandoc-emphasis-pre: \\\"[)$a1%\\\"\"\n                  , \"[/emph/.)*strong*.a~code~\"\n                  ] =?>\n        para (\"[\" <> emph \"emph\" <> \".)\" <> strong \"strong\" <>\n              \".a\" <> code \"code\")\n\n      , \"Changing post chars for emphasis\" =:\n        T.unlines [ \"#+pandoc-emphasis-post: \\\"(]$a1%\\\"\"\n                  , \"/emph/('*strong*]'~code~a\"\n                  ] =?>\n        para (emph \"emph\" <> \"('\" <> strong \"strong\" <> \"]'\" <>\n              code \"code\" <> \"a\")\n\n      , \"setting an invalid value restores the default\" =:\n        T.unlines [ \"#+pandoc-emphasis-pre: \\\"[\\\"\"\n                  , \"#+pandoc-emphasis-post: \\\"]\\\"\"\n                  , \"#+pandoc-emphasis-pre:\"\n                  , \"#+pandoc-emphasis-post:\"\n                  , \"[/noemph/]\"\n                  ] =?>\n        para \"[/noemph/]\"\n      ]\n\n    , \"Unknown keyword\" =:\n      T.unlines [ \"#+unknown_keyword: Chumbawamba\"\n                , \"#+another_unknown: Blur\"\n                ] =?>\n      rawBlock \"org\" \"#+unknown_keyword: Chumbawamba\" <>\n      rawBlock \"org\" \"#+another_unknown: Blur\"\n    ]\n\n  , \"Properties drawer\" =:\n      T.unlines [ \"  :PROPERTIES:\"\n                , \"  :setting: foo\"\n                , \"  :END:\"\n                ] =?>\n      (setMeta \"setting\" (\"foo\" :: T.Text) (doc mempty))\n\n  , \"Logbook drawer\" =:\n      T.unlines [ \"  :LogBook:\"\n                , \"  - State \\\"DONE\\\"       from \\\"TODO\\\"       [2014-03-03 Mon 11:00]\"\n                , \"  :END:\"\n                ] =?>\n      (mempty::Blocks)\n\n  , \"Drawer surrounded by text\" =:\n      T.unlines [ \"Before\"\n                , \":PROPERTIES:\"\n                , \":END:\"\n                , \"After\"\n                ] =?>\n      para \"Before\" <> para \"After\"\n\n  , \"Drawer markers must be the only text in the line\" =:\n      T.unlines [ \"  :LOGBOOK: foo\"\n                , \"  :END: bar\"\n                ] =?>\n      para (\":LOGBOOK: foo\" <> softbreak <> \":END: bar\")\n\n  , \"Drawers can be arbitrary\" =:\n      T.unlines [ \":FOO:\"\n                , \"/bar/\"\n                , \":END:\"\n                ] =?>\n      divWith (mempty, [\"FOO\", \"drawer\"], mempty) (para $ emph \"bar\")\n\n  , \"Anchor reference\" =:\n      T.unlines [ \"<<link-here>> Target.\"\n                , \"\"\n                , \"[[link-here][See here!]]\"\n                ] =?>\n      (para (spanWith (\"link-here\", [], []) mempty <> \"Target.\") <>\n       para (link \"#link-here\" \"\" (\"See\" <> space <> \"here!\")))\n\n  , \"Search links are read as emph\" =:\n      \"[[Wally][Where's Wally?]]\" =?>\n      para (spanWith (\"\", [\"spurious-link\"], [(\"target\", \"Wally\")])\n                     (emph $ \"Where's\" <> space <> \"Wally?\"))\n\n  , \"Link to nonexistent anchor\" =:\n      T.unlines [ \"<<link-here>> Target.\"\n                , \"\"\n                , \"[[link$here][See here!]]\"\n                ] =?>\n      (para (spanWith (\"link-here\", [], []) mempty <> \"Target.\") <>\n       para (spanWith (\"\", [\"spurious-link\"], [(\"target\", \"link$here\")])\n                      (emph (\"See\" <> space <> \"here!\"))))\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Org/Shared.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Org.Shared\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nHelper functions used by other org tests.\n-}\nmodule Tests.Readers.Org.Shared\n  ( (=:)\n  , org\n  , spcSep\n  , tagSpan\n  ) where\n\nimport Data.List (intersperse)\nimport Data.Text (Text)\nimport Tests.Helpers (ToString, purely, test)\nimport Test.Tasty (TestTree)\nimport Test.Tasty.HUnit (HasCallStack)\nimport Text.Pandoc (Pandoc, ReaderOptions (readerExtensions),\n                    def, getDefaultExtensions, readOrg)\nimport Text.Pandoc.Builder (Inlines, smallcaps, space, spanWith, str)\n\norg :: Text -> Pandoc\norg = purely $ readOrg def{ readerExtensions = getDefaultExtensions \"org\" }\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test org\n\nspcSep :: [Inlines] -> Inlines\nspcSep = mconcat . intersperse space\n\n-- | Create a span for the given tag.\ntagSpan :: Text -> Inlines\ntagSpan t = spanWith (\"\", [\"tag\"], [(\"tag-name\", t)]) . smallcaps $ str t\n"
  },
  {
    "path": "test/Tests/Readers/Org.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Shared\n   Copyright   : © 2014-2024 Albert Krewinkel\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>\n   Stability   : alpha\n   Portability : portable\n\nTests of the org reader.\n-}\nmodule Tests.Readers.Org (tests) where\n\nimport Test.Tasty (TestTree, testGroup)\nimport qualified Tests.Readers.Org.Block as Block\nimport qualified Tests.Readers.Org.Directive as Directive\nimport qualified Tests.Readers.Org.Inline as Inline\nimport qualified Tests.Readers.Org.Meta as Meta\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"Inlines\" Inline.tests\n  , testGroup \"Basic Blocks\" Block.tests\n  , testGroup \"Meta Information\" Meta.tests\n  , testGroup \"Directives\" Directive.tests\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Pod.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Pod\n   Copyright   : © 2024 Evan Silberman\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : \n   Stability   : alpha\n   Portability : portable\n\nTests for the Pod reader.\n-}\n\nmodule Tests.Readers.Pod (tests) where\n\nimport Data.Text (Text, pack)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\npod :: Text -> Pandoc\npod t = (purely $ readPod def) (\"=pod\\n\\n\" <> t <> \"\\n\\n=cut\\n\")\n\nmanLink :: Text -> Maybe Text -> Inlines -> Inlines\nmanLink nm Nothing = linkWith (mempty, mempty, [(\"manual\", nm)]) \"\" \"\"\nmanLink nm (Just sc) = linkWith (mempty, mempty, [(\"manual\", nm), (\"section\", sc)]) \"\" \"\"\n\nbogusEntity :: String -> TestTree\nbogusEntity t = t =: \"E<\" <> pack t <> \">\" =?> para (\"E<\" <> str (pack t) <> \">\")\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test pod\n\ntests :: [TestTree]\ntests = [\n  testGroup \"inlines\"\n    [ \"code with nested inlines\" =:\n        \"C</I<A> (*PRUNE) I<B>/>\" =?>\n        para (code \"/A (*PRUNE) B/\")\n    , \"compact in compact\" =:\n        \"I<B<strong> emphasis>\" =?>\n        para (emph $ (strong \"strong\") <> \" emphasis\")\n    , \"expanded in compact\" =:\n        \"I<B<< strong >> emphasis>\" =?>\n        para (emph $ (strong \"strong\") <> \" emphasis\")\n    , \"compact in expanded\" =:\n        \"I<<< B<strong> emphasis >>>\" =?>\n        para (emph $ (strong \"strong\") <> \" emphasis\")\n    , \"expanded in expanded\" =:\n        \"I<<< B<<< strong >>> emphasis >>>\" =?>\n        para (emph $ (strong \"strong\") <> \" emphasis\")\n    ]\n  , testGroup \"links\"\n    [ testGroup \"compact\"\n      [ \"URL\" =:\n          \"L<https://example.org>\" =?>\n          para (link \"https://example.org\" \"\" \"https://example.org\")\n      , \"URL with link text\" =:\n          \"L<link|https://example.org/index.html>\" =?>\n          para (link \"https://example.org/index.html\" \"\" \"link\")\n      , \"perl manual\" =:\n          \"L<Foo::Bar>\" =?>\n          para (manLink \"Foo::Bar\" Nothing \"Foo::Bar\")\n      , \"manual with quoted section\" =:\n          \"L<crontab(5)/\\\"DESCRIPTION\\\">\" =?>\n          para (manLink \"crontab(5)\" (Just \"DESCRIPTION\") (doubleQuoted \"DESCRIPTION\" <> \" in crontab(5)\"))\n      , \"manual with section and formatted link text\" =:\n          \"L<B<< extravagant >> link|HTTP::Simple/is_info>\" =?>\n          para (manLink \"HTTP::Simple\" (Just \"is_info\") (strong \"extravagant\" <> \" link\"))\n      , \"internal link\" =:\n          \"L</section name>\" =?>\n          para (link \"#section-name\" \"\" (doubleQuoted \"section name\"))\n      , \"internal link with formatting\" =:\n          \"L</The C<pod2html> command>\" =?>\n          para (link \"#the-pod2html-command\" \"\" (doubleQuoted (\"The \" <> code \"pod2html\" <> \" command\")))\n      , \"link with angle bracket\" =:\n          \"L<m<>\" =?>\n          para (manLink \"m<\" Nothing \"m<\")\n      , \"empty name\" =:\n          \"L<|https://example.org>\" =?>\n          para (link \"https://example.org\" \"\" mempty)\n      ]\n    , testGroup \"expanded\"\n      [ \"URL\" =:\n          \"L<< https://example.org >>\" =?>\n          para (link \"https://example.org\" \"\" \"https://example.org\")\n      , \"URL with link text\" =:\n          \"L<< link|https://example.org/index.html >>\" =?>\n          para (link \"https://example.org/index.html\" \"\" \"link\")\n      , \"perl manual\" =:\n          \"L<<< Foo::Bar >>>\" =?>\n          para (manLink \"Foo::Bar\" Nothing \"Foo::Bar\")\n      , \"manual with quoted section\" =:\n          \"L<< crontab(5)/\\\"DESCRIPTION\\\"     >>\" =?>\n          para (manLink \"crontab(5)\" (Just \"DESCRIPTION\") (doubleQuoted \"DESCRIPTION\" <> \" in crontab(5)\"))\n      , \"manual with section and formatted link text\" =:\n          \"L<< B<< extravagant >> link|HTTP::Simple/is_info >>\" =?>\n          para (manLink \"HTTP::Simple\" (Just \"is_info\") (strong \"extravagant\" <> \" link\"))\n      , \"internal link\" =:\n          \"L<<   /section name  >>\" =?>\n          para (link \"#section-name\" \"\" (doubleQuoted \"section name\"))\n      , \"internal link with formatting\" =:\n          \"L<<<<<          /The C<pod2html> command    >>>>>\" =?>\n          para (link \"#the-pod2html-command\" \"\" (doubleQuoted (\"The \" <> code \"pod2html\" <> \" command\")))\n      , \"link with angle bracket\" =:\n          \"L<< m< >>\" =?>\n          para (manLink \"m<\" Nothing \"m<\")\n      , \"empty name\" =:\n          \"L<< |https://example.org >>\" =?>\n          para (link \"https://example.org\" \"\" mempty)\n      ]\n    ]\n  , testGroup \"entities\"\n      [ testGroup \"required\"\n        [ \"quot\" =:\n            \"E<quot>\" =?>\n          para \"\\\"\"\n        , \"amp\" =:\n            \"E<amp>\" =?>\n            para \"&\"\n        , \"apos\" =:\n            \"E<apos>\" =?>\n            para \"'\"\n        , \"lt\" =:\n            \"E<lt>\" =?>\n            para \"<\"\n        , \"gt\" =:\n            \"E<gt>\" =?>\n            para \">\"\n        , \"sol\" =:\n            \"E<sol>\" =?>\n            para \"/\"\n        , \"verbar\" =:\n            \"E<verbar>\" =?>\n            para \"|\"\n        , \"lchevron\" =:\n            \"E<lchevron>\" =?>\n            para \"«\"\n        , \"rchevron\" =:\n            \"E<rchevron>\" =?>\n            para \"»\"\n        ]\n      , testGroup \"html\"\n        [ \"trade\" =:\n           \"E<trade>\" =?>\n           para \"™\"\n        , \"ccaron\" =:\n           \"E<ccaron>\" =?>\n           para \"č\"\n        , \"cent\" =:\n           \"E<cent>\" =?>\n           para \"¢\"\n        ]\n      , testGroup \"numeric\"\n        [ \"decimal\" =:\n            \"E<162>\" =?>\n            para \"¢\"\n        , \"octal\" =:\n            \"E<0242>\" =?>\n            para \"¢\"\n        , \"hexadecimal\" =:\n            \"E<0xA2>\" =?>\n            para \"¢\"\n        , \"hexadecimal variant\" =:\n            \"E<0x00A2>\" =?>\n            para \"¢\"\n        , \"actually decimal\" =:\n            \"E<099>\" =?>\n            para \"c\"\n        ]\n      , testGroup \"bogus\"\n        [ bogusEntity \"0XA2\"\n        , bogusEntity \"not a real entity\"\n        , bogusEntity \"162 1\"\n        , bogusEntity \"99 bottles of beer\"\n        , bogusEntity \"0xhh\"\n        , bogusEntity \"077x\"\n        , bogusEntity \"0x63 skidoo\"\n        , bogusEntity \"trade;\"\n        ]\n      ]\n    ]\n"
  },
  {
    "path": "test/Tests/Readers/Pptx.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Pptx\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nTests for the PPTX reader.\n-}\nmodule Tests.Readers.Pptx (tests) where\n\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as B\nimport Test.Tasty\nimport Test.Tasty.Golden.Advanced\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.UTF8 as UTF8\n\ndefopts :: ReaderOptions\ndefopts = def{ readerExtensions = getDefaultExtensions \"pptx\" }\n\ntestCompare :: String -> FilePath -> FilePath -> TestTree\ntestCompare = testCompareWithOpts defopts\n\ntestCompareWithOpts :: ReaderOptions -> String -> FilePath -> FilePath -> TestTree\ntestCompareWithOpts opts testName pptxFP nativeFP =\n  goldenTest\n  testName\n  (do nf <- UTF8.toText <$> BS.readFile nativeFP\n      runIOorExplode (readNative def nf))\n  (do df <- B.readFile pptxFP\n      runIOorExplode (readPptx opts df))\n  (nativeDiff nativeFP)\n  (\\a -> runIOorExplode (writeNative def{ writerTemplate = Just mempty} a)\n            >>= BS.writeFile nativeFP . UTF8.fromText)\n\ntests :: [TestTree]\ntests = [ testGroup \"basic\"\n          [ testCompare\n            \"text extraction\"\n            \"pptx-reader/basic.pptx\"\n            \"pptx-reader/basic.native\"\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/RST.hs",
    "content": "{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{- |\n   Module      : Tests.Readers.RST\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the RST reader.\n-}\nmodule Tests.Readers.RST (tests) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nrst :: Text -> Pandoc\nrst = purely $ readRST def{ readerStandalone = True }\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test rst\n\ntests :: [TestTree]\ntests = [ \"line block with blank line\" =:\n          \"| a\\n|\\n|  b\" =?> lineBlock [ \"a\", mempty, \"\\160b\" ]\n        , testGroup \"field list\"\n          [ \"general\" =: T.unlines\n             [ \"para\"\n             , \"\"\n             , \":Hostname: media08\"\n             , \":IP address: 10.0.0.19\"\n             , \":Size: 3ru\"\n             , \":Version: 1\"\n             , \":Indentation: Since the field marker may be quite long, the second\"\n             , \"   and subsequent lines of the field body do not have to line up\"\n             , \"   with the first line, but they must be indented relative to the\"\n             , \"   field name marker, and they must line up with each other.\"\n             , \":Parameter i: integer\"\n             , \":Final: item\"\n             , \"  on two lines\" ]\n             =?>\n              doc (para \"para\" <>\n                   definitionList [ (str \"Hostname\", [plain \"media08\"])\n                                  , (text \"IP address\", [plain \"10.0.0.19\"])\n                                  , (str \"Size\", [plain \"3ru\"])\n                                  , (str \"Version\", [plain \"1\"])\n                                  , (str \"Indentation\", [plain \"Since the field marker may be quite long, the second\\nand subsequent lines of the field body do not have to line up\\nwith the first line, but they must be indented relative to the\\nfield name marker, and they must line up with each other.\"])\n                                  , (text \"Parameter i\", [plain \"integer\"])\n                                  , (str \"Final\", [plain \"item\\non two lines\"])\n                                  ])\n          , \"metadata\" =: T.unlines\n             [ \"=====\"\n             , \"Title\"\n             , \"=====\"\n             , \"--------\"\n             , \"Subtitle\"\n             , \"--------\"\n             , \"\"\n             , \":Version: 1\"\n             ]\n             =?>\n              setMeta \"version\" (str \"1\") (setMeta \"title\" (\"Title\" :: Inlines)\n                 $ setMeta \"subtitle\" (\"Subtitle\" :: Inlines)\n                 $ doc mempty)\n          , \"with inline markup\" =: T.unlines\n             [ \":*Date*: today\"\n             , \"\"\n             , \"..\"\n             , \"\"\n             , \":*one*: emphasis\"\n             , \":two_: reference\"\n             , \":`three`_: another one\"\n             , \":``four``: literal\"\n             , \"\"\n             , \".. _two: http://example.com\"\n             , \".. _three: http://example.org\"\n             ]\n             =?>\n              setMeta \"date\" (str \"today\") (doc\n                 $ definitionList [ (emph \"one\", [plain \"emphasis\"])\n                                  , (link \"http://example.com\" \"\" \"two\", [plain \"reference\"])\n                                  , (link \"http://example.org\" \"\" \"three\", [plain \"another one\"])\n                                  , (code \"four\", [plain \"literal\"])\n                                  ])\n          ]\n        , \"URLs with following punctuation\" =:\n          (\"http://google.com, http://yahoo.com; http://foo.bar.baz.\\n\" <>\n           \"http://foo.bar/baz_(bam) (http://foo.bar)\") =?>\n          para (link \"http://google.com\" \"\" \"http://google.com\" <> \", \" <>\n                link \"http://yahoo.com\" \"\" \"http://yahoo.com\" <> \"; \" <>\n                link \"http://foo.bar.baz\" \"\" \"http://foo.bar.baz\" <> \". \" <>\n                softbreak <>\n                link \"http://foo.bar/baz_(bam)\" \"\" \"http://foo.bar/baz_(bam)\"\n                <> \" (\" <> link \"http://foo.bar\" \"\" \"http://foo.bar\" <> \")\")\n        , \"Reference names with special characters\" =:\n                   (\"A-1-B_2_C:3:D+4+E.5.F_\\n\\n\" <>\n                   \".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\\n\") =?>\n                   para (link \"https://example.com\" \"\" \"A-1-B_2_C:3:D+4+E.5.F\")\n        , \"Code directive with class and number-lines\" =: T.unlines\n            [ \".. code::python\"\n            , \"   :number-lines: 34\"\n            , \"   :class: class1 class2 class3\"\n            , \"\"\n            , \"  def func(x):\"\n            , \"    return y\"\n            ]  =?>\n              doc (codeBlockWith\n                  ( \"\"\n                  , [\"python\", \"numberLines\", \"class1\", \"class2\", \"class3\"]\n                  , [ (\"startFrom\", \"34\") ]\n                  )\n                  \"def func(x):\\n  return y\")\n        , \"Code directive with number-lines, no line specified\" =: T.unlines\n            [ \".. code::python\"\n            , \"   :number-lines:\"\n            , \"\"\n            , \"  def func(x):\"\n            , \"    return y\"\n            ]  =?>\n              doc (codeBlockWith\n                  ( \"\"\n                  , [\"python\", \"numberLines\"]\n                  , []\n                  )\n                  \"def func(x):\\n  return y\")\n        , testGroup \"literal / line / code blocks\"\n          [ \"indented literal block\" =: T.unlines\n            [ \"::\"\n            , \"\"\n            , \"  block quotes\"\n            , \"\"\n            , \"  can go on for many lines\"\n            , \"but must stop here\"]\n            =?>\n              doc (\n                 codeBlock \"block quotes\\n\\ncan go on for many lines\" <>\n                 para \"but must stop here\")\n          , \"line block with 3 lines\" =: \"| a\\n| b\\n| c\"\n            =?> lineBlock [\"a\", \"b\", \"c\"]\n          , \"line blocks with blank lines\" =: T.unlines\n            [ \"|\"\n            , \"\"\n            , \"|\"\n            , \"| a\"\n            , \"| b\"\n            , \"|\"\n            , \"\"\n            , \"|\"\n            ] =?>\n            lineBlock [\"\"] <>\n            lineBlock [\"\", \"a\", \"b\", \"\"] <>\n            lineBlock [\"\"]\n          , \"quoted literal block using >\" =: \"::\\n\\n> quoted\\n> block\\n\\nOrdinary paragraph\"\n            =?> codeBlock \"> quoted\\n> block\" <> para \"Ordinary paragraph\"\n          , \"quoted literal block using | (not  a line block)\" =: \"::\\n\\n| quoted\\n| block\\n\\nOrdinary paragraph\"\n            =?> codeBlock \"| quoted\\n| block\" <> para \"Ordinary paragraph\"\n          , \"class directive with single paragraph\" =: \".. class:: special\\n\\nThis is a \\\"special\\\" paragraph.\"\n            =?> divWith (\"\", [\"special\"], []) (para \"This is a \\\"special\\\" paragraph.\")\n          , \"class directive with two paragraphs\" =: \".. class:: exceptional remarkable\\n\\n    First paragraph.\\n\\n    Second paragraph.\"\n            =?> divWith (\"\", [\"exceptional\", \"remarkable\"], []) (para \"First paragraph.\" <> para \"Second paragraph.\")\n          , \"class directive around literal block\" =: \".. class:: classy\\n\\n::\\n\\n    a\\n    b\"\n            =?> divWith (\"\", [\"classy\"], []) (codeBlock \"a\\nb\")]\n        , testGroup \"interpreted text roles\"\n          [ \"literal role prefix\" =: \":literal:`a`\" =?> para (code \"a\")\n          , \"literal role postfix\" =: \"`a`:literal:\" =?> para (code \"a\")\n          , \"literal text\" =: \"``text``\" =?> para (code \"text\")\n          , \"code role\" =: \":code:`a`\" =?> para (codeWith (\"\", [], []) \"a\")\n          , \"inherited code role\" =: \".. role:: codeLike(code)\\n\\n:codeLike:`a`\"\n            =?> para (codeWith (\"\", [\"codeLike\"], []) \"a\")\n          , \"custom code role with language field\"\n            =: \".. role:: lhs(code)\\n    :language: haskell\\n\\n:lhs:`a`\"\n            =?> para (codeWith (\"\", [\"lhs\", \"haskell\"], []) \"a\")\n          , \"custom role with class field\"\n            =: \".. role:: classy\\n    :class: myclass\\n\\n:classy:`a`\"\n            =?> para (spanWith (\"\", [\"myclass\"], []) \"a\")\n          , \"custom role with class field containing multiple whitespace-separated classes\"\n            =: \".. role:: classy\\n    :class: myclass1 myclass2\\n       myclass3\\n\\n:classy:`a`\"\n            =?> para (spanWith (\"\", [\"myclass1\", \"myclass2\", \"myclass3\"], []) \"a\")\n          , \"custom role with inherited class field\"\n            =: \".. role:: classy\\n    :class: myclass1\\n.. role:: classier(classy)\\n    :class: myclass2\\n\\n:classier:`a`\"\n            =?> para (spanWith (\"\", [\"myclass2\", \"myclass1\"], []) \"a\")\n          , \"custom role with unspecified parent role\"\n            =: \".. role:: classy\\n\\n:classy:`text`\"\n            =?> para (spanWith (\"\", [\"classy\"], []) \"text\")\n          , \"role with recursive inheritance\"\n            =: \".. role:: haskell(code)\\n.. role:: lhs(haskell)\\n\\n:lhs:`text`\"\n            =?> para (codeWith (\"\", [\"lhs\", \"haskell\"], []) \"text\")\n          , \"unknown role\" =: \":unknown:`text`\" =?>\n              para (codeWith (\"\",[\"interpreted-text\"],[(\"role\",\"unknown\")]) \"text\")\n          ]\n        , testGroup \"footnotes\"\n          [ \"remove space before note\" =: T.unlines\n            [ \"foo [1]_\"\n            , \"\"\n            , \".. [1]\"\n            , \"   bar\"\n            ] =?>\n              para (\"foo\" <> note (para \"bar\"))\n          ]\n        , testGroup \"inlines\"\n          [ \"links can contain an URI without being parsed twice (#4581)\" =:\n            \"`http://loc <http://loc>`__\" =?>\n            para (link \"http://loc\" \"\" \"http://loc\")\n          , \"inline markup cannot be nested\" =:\n            \"**a*b*c**\" =?>\n            para (strong \"a*b*c\")\n          , \"bare URI parsing disabled inside emphasis (#4561)\" =:\n            \"*http://location*\" =?>\n            para (emph (text \"http://location\"))\n          , \"include newlines\" =:\n            \"**before\\nafter**\" =?>\n            para (strong (text \"before\\nafter\"))\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Readers/RTF.hs",
    "content": "{- |\n   Module      : Tests.Readers.RTF\n   Copyright   : © 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : jgm@berkeley.edu\n   Stability   : alpha\n   Portability : portable\n\nTests for the RTF reader.\n-}\nmodule Tests.Readers.RTF (tests) where\n\nimport Test.Tasty\nimport Tests.Helpers\nimport Text.Pandoc\nimport System.FilePath (replaceExtension, (</>), (<.>))\n\nrtfTest :: TestName -> TestTree\nrtfTest name = testGolden name native path\n   (\\t -> runIOorExplode\n            (readRTF def t >>=\n              writeNative def{ writerTemplate = Just mempty }))\n  where native = replaceExtension path \".native\"\n        path = \"rtf\" </> name <.> \"rtf\"\n\n\ntests :: [TestTree]\ntests = map rtfTest [ \"footnote\"\n                    , \"accent\"\n                    , \"unicode\"\n                    , \"image\"\n                    , \"link\"\n                    , \"heading\"\n                    , \"formatting\"\n                    , \"list_simple\"\n                    , \"list_complex\"\n                    , \"bookmark\"\n                    , \"table_simple\"\n                    , \"table_error_codes\"\n                    ]\n"
  },
  {
    "path": "test/Tests/Readers/Txt2Tags.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Txt2Tags\n   Copyright   : © 2014-2024 John MacFarlane,\n                 © 2014 Matthew Pickering\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for the Txt2Tags reader.\n-}\nmodule Tests.Readers.Txt2Tags (tests) where\n\nimport Data.List (intersperse)\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nt2t :: Text -> Pandoc\n-- t2t = handleError . readTxt2Tags (T2TMeta \"date\" \"mtime\" \"in\" \"out\") def\nt2t = purely $ \\s -> do\n  setInputFiles [\"in\"]\n  setOutputFile (Just \"out\")\n  readTxt2Tags def s\n\ninfix 4 =:\n(=:) :: (ToString c, HasCallStack)\n     => String -> (Text, c) -> TestTree\n(=:) = test t2t\n\nspcSep :: [Inlines] -> Inlines\nspcSep = mconcat . intersperse space\n\nsimpleTable' :: Int\n             -> [Blocks]\n             -> [[Blocks]]\n             -> Blocks\nsimpleTable' n = simpleTable'' $ replicate n (AlignCenter, ColWidthDefault)\n\nsimpleTable'' :: [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks\nsimpleTable'' spec headers rows\n  = table emptyCaption\n          spec\n          (TableHead nullAttr $ toHeaderRow headers)\n          [TableBody nullAttr 0 [] $ map toRow rows]\n          (TableFoot nullAttr [])\n  where\n    toRow = Row nullAttr . map simpleCell\n    toHeaderRow l = [toRow l | not (null l)]\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"Inlines\"\n      [ \"Plain String\" =:\n          \"Hello, World\" =?>\n          para (spcSep [ \"Hello,\", \"World\" ])\n\n      , \"Emphasis\" =:\n          \"//Planet Punk//\" =?>\n          para (emph . spcSep $ [\"Planet\", \"Punk\"])\n\n      , \"Strong\" =:\n          \"**Cider**\" =?>\n          para (strong \"Cider\")\n\n      , \"Strong Emphasis\" =:\n          \"//**strength**//\" =?>\n          para (emph . strong $ \"strength\")\n\n      , \"Strikeout\" =:\n          \"--Kill Bill--\" =?>\n          para (strikeout . spcSep $ [ \"Kill\", \"Bill\" ])\n\n      , \"Verbatim\" =:\n          \"``Robot.rock()``\" =?>\n          para (code \"Robot.rock()\")\n\n      , \"Symbol\" =:\n          \"A * symbol\" =?>\n          para (str \"A\" <> space <> str \"*\" <> space <> \"symbol\")\n\n      , \"No empty markup\" =:\n          \"//// **** ____ ---- ```` \\\"\\\"\\\"\\\" ''''\" =?>\n          para (spcSep [ \"////\", \"****\", \"____\", \"----\", \"````\", \"\\\"\\\"\\\"\\\"\", \"''''\" ])\n\n      , \"Inline markup is greedy\" =:\n          \"***** ///// _____ ----- ````` \\\"\\\"\\\"\\\"\\\" '''''\" =?>\n          para (spcSep [strong \"*\", emph \"/\", underline \"_\"\n                       , strikeout \"-\", code \"`\", text \"\\\"\"\n                       , rawInline \"html\" \"'\"])\n      , \"Markup must be greedy\" =:\n          \"**********    //////////    __________    ----------    ``````````   \\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"   ''''''''''\" =?>\n                      para (spcSep [strong \"******\", emph \"//////\", underline \"______\"\n                       , strikeout \"------\", code \"``````\", text \"\\\"\\\"\\\"\\\"\\\"\\\"\"\n                       , rawInline \"html\" \"''''''\"])\n      , \"Inlines must be glued\" =:\n          \"** a** **a ** ** a **\" =?>\n          para (text \"** a** **a ** ** a **\")\n\n      , \"Macros: Date\" =:\n          \"%%date\" =?>\n            para \"1970-01-01\"\n      , \"Macros: Mod Time\" =:\n          \"%%mtime\" =?>\n            para (str \"\")\n      , \"Macros: Infile\" =:\n          \"%%infile\" =?>\n            para \"in\"\n      , \"Macros: Outfile\" =:\n          \"%%outfile\" =?>\n            para \"out\"\n      , \"Autolink\" =:\n          \"http://www.google.com\" =?>\n            para (link \"http://www.google.com\" \"\" (str \"http://www.google.com\"))\n      , \"JPEG Image\" =:\n          \"[image.jpg]\" =?>\n            para (image \"image.jpg\" \"\" mempty)\n      , \"PNG Image\" =:\n          \"[image.png]\" =?>\n            para (image \"image.png\" \"\" mempty)\n\n      , \"Link\" =:\n          \"[title http://google.com]\" =?>\n            para (link \"http://google.com\" \"\" (str \"title\"))\n\n      , \"Image link\" =:\n          \"[[image.jpg] abc]\" =?>\n            para (link \"abc\" \"\" (image \"image.jpg\" \"\" mempty))\n      , \"Invalid link: No trailing space\" =:\n          \"[title invalid ]\" =?>\n            para (text \"[title invalid ]\")\n\n\n      ]\n\n  , testGroup \"Basic Blocks\"\n      [\"Paragraph, lines grouped together\" =:\n          \"A paragraph\\n A blank line ends the \\n current paragraph\\n\"\n            =?> para \"A paragraph\\n A blank line ends the\\n current paragraph\"\n      , \"Paragraph, ignore leading and trailing spaces\" =:\n          \"   Leading and trailing spaces are ignored.   \\n\" =?>\n            para \"Leading and trailing spaces are ignored.\"\n      , \"Comment line in paragraph\" =:\n          \"A comment line can be placed inside a paragraph.\\n% this comment will be ignored \\nIt will not affect it.\\n\"\n          =?> para \"A comment line can be placed inside a paragraph.\\nIt will not affect it.\"\n      , \"Paragraph\" =:\n          \"Paragraph\\n\" =?>\n          para \"Paragraph\"\n\n      , \"First Level Header\" =:\n          \"+ Headline +\\n\" =?>\n          header 1 \"Headline\"\n\n      , \"Third Level Header\" =:\n          \"=== Third Level Headline ===\\n\" =?>\n          header 3 (\"Third\" <> space <>\n                    \"Level\" <> space <>\n                    \"Headline\")\n\n      , \"Header with label\" =:\n          \"= header =[label]\" =?>\n            headerWith (\"label\", [], []) 1 \"header\"\n\n      , \"Invalid header, mismatched delimiters\" =:\n          \"== header =\" =?>\n            para (text \"== header =\")\n\n      , \"Invalid header, spaces in label\" =:\n          \"== header ==[ haha ]\" =?>\n            para (text \"== header ==[ haha ]\")\n\n      , \"Invalid header, invalid label character\" =:\n          \"== header ==[lab/el]\" =?>\n            para (text \"== header ==[lab/el]\")\n      , \"Headers not preceded by a blank line\" =:\n          T.unlines [ \"++ eat dinner ++\"\n                  , \"Spaghetti and meatballs tonight.\"\n                  , \"== walk dog ==\"\n                  ] =?>\n          mconcat [ header 2 (\"eat\" <> space <> \"dinner\")\n                  , para $ spcSep [ \"Spaghetti\", \"and\", \"meatballs\", \"tonight.\" ]\n                  , header 2 (\"walk\" <> space <> \"dog\")\n                  ]\n\n      , \"Paragraph starting with an equals\" =:\n          \"=five\" =?>\n          para \"=five\"\n\n      , \"Paragraph containing asterisk at beginning of line\" =:\n          T.unlines [ \"lucky\"\n                  , \"*star\"\n                  ] =?>\n          para (\"lucky\" <> softbreak <> \"*star\")\n\n      , \"Horizontal Rule\" =:\n          T.unlines [ \"before\"\n                  , T.replicate 20 \"-\"\n                  , T.replicate 20 \"=\"\n                  , T.replicate 20 \"_\"\n                  , \"after\"\n                  ] =?>\n          mconcat [ para \"before\"\n                  , horizontalRule\n                  , horizontalRule\n                  , horizontalRule\n                  , para \"after\"\n                  ]\n\n      , \"Comment Block\" =:\n          T.unlines [ \"%%%\"\n                  , \"stuff\"\n                  , \"bla\"\n                  , \"%%%\"] =?>\n          (mempty::Blocks)\n\n\n    ]\n\n  , testGroup \"Lists\"\n      [ \"Simple Bullet Lists\" =:\n          (\"- Item1\\n\" <>\n           \"- Item2\\n\") =?>\n          bulletList [ plain \"Item1\"\n                     , plain \"Item2\"\n                     ]\n\n      , \"Indented Bullet Lists\" =:\n          (\"   - Item1\\n\" <>\n           \"   - Item2\\n\") =?>\n          bulletList [ plain \"Item1\"\n                     , plain \"Item2\"\n                     ]\n\n\n\n      , \"Nested Bullet Lists\" =:\n          (\"- Discovery\\n\" <>\n           \"  + One More Time\\n\" <>\n           \"  + Harder, Better, Faster, Stronger\\n\" <>\n           \"- Homework\\n\" <>\n           \"  + Around the World\\n\"<>\n           \"- Human After All\\n\" <>\n           \"  + Technologic\\n\" <>\n           \"  + Robot Rock\\n\") =?>\n          bulletList [ mconcat\n                       [ plain \"Discovery\"\n                       , orderedList [ plain (\"One\" <> space <>\n                                             \"More\" <> space <>\n                                             \"Time\")\n                                    , plain (\"Harder,\" <> space <>\n                                             \"Better,\" <> space <>\n                                             \"Faster,\" <> space <>\n                                             \"Stronger\")\n                                    ]\n                       ]\n                     , mconcat\n                       [ plain \"Homework\"\n                       , orderedList [ plain (\"Around\" <> space <>\n                                             \"the\" <> space <>\n                                             \"World\")\n                                    ]\n                       ]\n                     , mconcat\n                       [ plain (\"Human\" <> space <> \"After\" <> space <> \"All\")\n                       , orderedList [ plain \"Technologic\"\n                                    , plain (\"Robot\" <> space <> \"Rock\")\n                                    ]\n                       ]\n                     ]\n\n      , \"Simple Ordered List\" =:\n          (\"+ Item1\\n\" <>\n           \"+ Item2\\n\") =?>\n          let listStyle = (1, DefaultStyle, DefaultDelim)\n              listStructure = [ plain \"Item1\"\n                              , plain \"Item2\"\n                              ]\n          in orderedListWith listStyle listStructure\n\n\n      , \"Indented Ordered List\" =:\n          (\" + Item1\\n\" <>\n           \" + Item2\\n\") =?>\n          let listStyle = (1, DefaultStyle, DefaultDelim)\n              listStructure = [ plain \"Item1\"\n                              , plain \"Item2\"\n                              ]\n          in orderedListWith listStyle listStructure\n\n      , \"Nested Ordered Lists\" =:\n          (\"+ One\\n\" <>\n           \"   + One-One\\n\" <>\n           \"   + One-Two\\n\" <>\n           \"+ Two\\n\" <>\n           \"   + Two-One\\n\"<>\n           \"   + Two-Two\\n\") =?>\n          let listStyle = (1, DefaultStyle, DefaultDelim)\n              listStructure = [ mconcat\n                                [ plain \"One\"\n                                , orderedList [ plain \"One-One\"\n                                              , plain \"One-Two\"\n                                              ]\n                                ]\n                              , mconcat\n                                [ plain \"Two\"\n                                , orderedList [ plain \"Two-One\"\n                                              , plain \"Two-Two\"\n                                              ]\n                                ]\n                              ]\n          in orderedListWith listStyle listStructure\n\n      , \"Ordered List in Bullet List\" =:\n          (\"- Emacs\\n\" <>\n           \"  + Org\\n\") =?>\n          bulletList [ plain \"Emacs\" <>\n                       orderedList [ plain \"Org\"]\n                     ]\n\n      , \"Bullet List in Ordered List\" =:\n          (\"+ GNU\\n\" <>\n           \"   - Freedom\\n\") =?>\n          orderedList [ plain \"GNU\" <> bulletList [ plain \"Freedom\" ] ]\n\n      , \"Definition List\" =:\n          T.unlines [ \": PLL\"\n                  , \"  phase-locked loop\"\n                  , \": TTL\"\n                  , \"  transistor-transistor logic\"\n                  , \": PSK\"\n                  , \"  a digital\"\n                  ] =?>\n          definitionList [ (\"PLL\", [ plain $ \"phase-locked\" <> space <> \"loop\" ])\n                         , (\"TTL\", [ plain $ \"transistor-transistor\" <> space <> \"logic\" ])\n                         , (\"PSK\", [ plain $ \"a\" <> space <> \"digital\" ])\n                         ]\n\n\n      , \"Loose bullet list\" =:\n          T.unlines [ \"- apple\"\n                  , \"\"\n                  , \"- orange\"\n                  , \"\"\n                  , \"- peach\"\n                  ] =?>\n          bulletList [ para \"apple\"\n                     , para \"orange\"\n                     , para \"peach\"\n                     ]\n      ]\n\n  , testGroup \"Tables\"\n      [ \"Single cell table\" =:\n          \"| Test \" =?>\n          simpleTable' 1 mempty [[plain \"Test\"]]\n\n      , \"Multi cell table\" =:\n          \"| One | Two |\" =?>\n           simpleTable' 2 mempty [ [ plain \"One\", plain \"Two\" ] ]\n\n      , \"Multi line table\" =:\n          T.unlines [ \"| One |\"\n                  , \"| Two |\"\n                  , \"| Three |\"\n                  ] =?>\n           simpleTable' 1 mempty\n                        [ [ plain \"One\" ]\n                        , [ plain \"Two\" ]\n                        , [ plain \"Three\" ]\n                        ]\n\n      , \"Empty table\" =:\n          \"| |\" =?>\n          simpleTable' 1 mempty [[mempty]]\n\n      , \"Glider Table\" =:\n          T.unlines [ \"| 1 | 0 | 0 |\"\n                  , \"| 0 | 1 | 1 |\"\n                  , \"| 1 | 1 | 0 |\"\n                  ] =?>\n          simpleTable' 3 mempty\n                       [ [ plain \"1\", plain \"0\", plain \"0\" ]\n                       , [ plain \"0\", plain \"1\", plain \"1\" ]\n                       , [ plain \"1\", plain \"1\", plain \"0\" ]\n                       ]\n\n\n      , \"Table with Header\" =:\n          T.unlines [ \"|| Species     | Status       |\"\n                  , \"| cervisiae    | domesticated |\"\n                  , \"| paradoxus | wild         |\"\n                  ] =?>\n          simpleTable [ plain \"Species\", plain \"Status\" ]\n                      [ [ plain \"cervisiae\", plain \"domesticated\" ]\n                      , [ plain \"paradoxus\", plain \"wild\" ]\n                      ]\n\n      , \"Table alignment determined by spacing\" =:\n          T.unlines [ \"| Numbers |     Text | More    |\"\n                  , \"| 1 |    One  |    foo  |\"\n                  , \"| 2 |    Two  | bar  |\"\n                  ] =?>\n          simpleTable''\n            (zip\n              [AlignCenter, AlignRight, AlignDefault]\n              [ColWidthDefault, ColWidthDefault, ColWidthDefault])\n            []\n            [ [ plain \"Numbers\", plain \"Text\", plain \"More\" ]\n            , [ plain \"1\"      , plain \"One\" , plain \"foo\"  ]\n            , [ plain \"2\"      , plain \"Two\" , plain \"bar\"  ]\n            ]\n\n      , \"Pipe within text doesn't start a table\" =:\n          \"Ceci n'est pas une | pipe \" =?>\n          para (spcSep [ \"Ceci\", \"n'est\", \"pas\", \"une\", \"|\", \"pipe\" ])\n\n\n      , \"Table with differing row lengths\" =:\n          T.unlines [ \"|| Numbers | Text \"\n                  , \"| 1 | One  | foo  |\"\n                  , \"| 2 \"\n                  ] =?>\n          simpleTable''\n            (zip\n              [AlignCenter, AlignLeft, AlignLeft]\n              [ColWidthDefault, ColWidthDefault, ColWidthDefault])\n            [ plain \"Numbers\", plain \"Text\" , plain mempty ]\n            [ [ plain \"1\"      , plain \"One\"  , plain \"foo\"  ]\n            , [ plain \"2\"      , plain mempty , plain mempty  ]\n            ]\n\n      ]\n\n    , testGroup \"Blocks and fragments\"\n      [ \"Source block\" =:\n           T.unlines [ \"```\"\n                   , \"main = putStrLn greeting\"\n                   , \"  where greeting = \\\"moin\\\"\"\n                   , \"```\" ] =?>\n           let code' = \"main = putStrLn greeting\\n\" <>\n                       \"  where greeting = \\\"moin\\\"\\n\"\n           in codeBlock code'\n\n      , \"tagged block\" =:\n           T.unlines [ \"'''\"\n                   , \"<aside>HTML5 is pretty nice.</aside>\"\n                   , \"'''\"\n                   ] =?>\n           rawBlock \"html\" \"<aside>HTML5 is pretty nice.</aside>\\n\"\n\n      , \"Quote block\" =:\n           T.unlines [\"\\t//Niemand// hat die Absicht, eine Mauer zu errichten!\"\n                   ] =?>\n           blockQuote (para (spcSep [ emph \"Niemand\", \"hat\", \"die\", \"Absicht,\"\n                                    , \"eine\", \"Mauer\", \"zu\", \"errichten!\"\n                                    ]))\n\n      ]\n  ]\n"
  },
  {
    "path": "test/Tests/Readers/Xlsx.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Readers.Xlsx\n   Copyright   : © 2025 Anton Antic\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Anton Antic <anton@everworker.ai>\n   Stability   : alpha\n   Portability : portable\n\nTests for the XLSX reader.\n-}\nmodule Tests.Readers.Xlsx (tests) where\n\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as B\nimport Test.Tasty\nimport Test.Tasty.Golden.Advanced\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.UTF8 as UTF8\n\ndefopts :: ReaderOptions\ndefopts = def{ readerExtensions = getDefaultExtensions \"xlsx\" }\n\ntestCompare :: String -> FilePath -> FilePath -> TestTree\ntestCompare = testCompareWithOpts defopts\n\ntestCompareWithOpts :: ReaderOptions -> String -> FilePath -> FilePath -> TestTree\ntestCompareWithOpts opts testName xlsxFP nativeFP =\n  goldenTest\n  testName\n  (do nf <- UTF8.toText <$> BS.readFile nativeFP\n      runIOorExplode (readNative def nf))\n  (do df <- B.readFile xlsxFP\n      runIOorExplode (readXlsx opts df))\n  (nativeDiff nativeFP)\n  (\\a -> runIOorExplode (writeNative def{ writerTemplate = Just mempty} a)\n            >>= BS.writeFile nativeFP . UTF8.fromText)\n\ntests :: [TestTree]\ntests = [ testGroup \"basic\"\n          [ testCompare\n            \"sheet extraction\"\n            \"xlsx-reader/basic.xlsx\"\n            \"xlsx-reader/basic.native\"\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Shared.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Shared\n   Copyright   : © 2006-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley@edu>\n   Stability   : alpha\n   Portability : portable\n\nTests for functions used in many parts of the library.\n-}\nmodule Tests.Shared (tests) where\n\nimport System.FilePath.Posix (joinPath)\nimport Test.Tasty\nimport Text.Pandoc.Arbitrary ()\nimport Test.Tasty.QuickCheck (testProperty)\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Shared\nimport Test.Tasty.HUnit\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Writers.Shared\nimport qualified Data.Text as T\n\ntests :: [TestTree]\ntests = [ testGroup \"compactifyDL\"\n          [ testCase \"compactifyDL with empty def\" $\n              assertBool \"compactifyDL\"\n              (let x = [(str \"word\", [para (str \"def\"), mempty])]\n               in  compactifyDL x == x)\n          ]\n        , testGroup \"collapseFilePath\" testCollapse\n        , testGroup \"toLegacyTable\" testLegacyTable\n        , testGroup \"table of contents\" testTOC\n        , testGroup \"makeSections\"\n          [ testProperty \"makeSections is idempotent\" makeSectionsIsIdempotent\n          , testCase \"makeSections is idempotent for test case\" $\n              let d = header 1 \"H1\" <> header 2 \"H2\" <> header 3 \"H3\" <>\n                      header 2 \"H2a\" <> header 4 \"H4\" <> header 1 \"H1a\"\n                  d' = makeSections False Nothing $ toList d\n               in assertBool \"makeSections is idempotent for test case\"\n                      (makeSections False Nothing d' == d')\n          ]\n        ]\n\nmakeSectionsIsIdempotent :: [Block] -> Bool\nmakeSectionsIsIdempotent d =\n  let d' = makeSections False Nothing d\n   in d' == makeSections False Nothing d'\n\ngivesTOC :: String -> (Blocks, Blocks) -> TestTree\ngivesTOC desc (blocks, toc) =\n  test (singleton . toTableOfContents def) desc (toList blocks, toc)\n\nlinkId :: T.Text -> T.Text -> T.Text -> Inlines -> Inlines\nlinkId lId = linkWith (lId,[],[])\n\nheaderId :: T.Text -> Int -> Inlines -> Blocks\nheaderId hId = headerWith (hId,[],[])\n\ntestTOC :: [TestTree]\ntestTOC = [ givesTOC \"empty case\" $ mempty =?> bulletList []\n          , givesTOC \"no headers\" $ horizontalRule =?> bulletList []\n          , givesTOC \"unlinked header\" $\n              header 1 \"H1\" =?>\n              bulletList [plain \"H1\"]\n          , givesTOC \"linked header\" $\n              headerId \"h1\" 1 \"H1\" =?>\n              bulletList [plain $ linkId \"toc-h1\" \"#h1\" \"\" \"H1\"]\n          , givesTOC \"nested headlines\" $\n              header 1 \"H1a\" <> header 2 \"H2\" =?>\n              bulletList [plain \"H1a\" <> bulletList [plain \"H2\"]]\n          , givesTOC \"only referenced headers\" $\n              header 1 \"H1a\" <> headerId \"h2\" 2 \"H2\" =?>\n              bulletList [plain \"H1a\" <>\n                          bulletList [plain $ linkId \"toc-h2\" \"#h2\" \"\" \"H2\"]]\n          , givesTOC \"section id used as backup\" $\n              divWith (\"sec\",[\"section\"],[]) (header 1 \"H1\") =?>\n              bulletList [plain $ linkId \"toc-sec\" \"#sec\" \"\" \"H1\"]\n          ]\n\ntestCollapse :: [TestTree]\ntestCollapse = map (testCase \"collapse\")\n [  collapseFilePath (joinPath [ \"\"]) @?= joinPath [ \"\"]\n ,  collapseFilePath (joinPath [ \".\",\"foo\"]) @?= joinPath [ \"foo\"]\n ,  collapseFilePath (joinPath [ \".\",\".\",\"..\",\"foo\"]) @?= joinPath [ joinPath [\"..\", \"foo\"]]\n ,  collapseFilePath (joinPath [ \"..\",\"foo\"]) @?= joinPath [ \"..\",\"foo\"]\n ,  collapseFilePath (joinPath [ \"\",\"bar\",\"..\",\"baz\"]) @?= joinPath [ \"\",\"baz\"]\n ,  collapseFilePath (joinPath [ \"\",\"..\",\"baz\"]) @?= joinPath [ \"\",\"..\",\"baz\"]\n ,  collapseFilePath (joinPath [ \".\",\"foo\",\"..\",\".\",\"bar\",\"..\",\".\",\".\",\"baz\"]) @?= joinPath [ \"baz\"]\n ,  collapseFilePath (joinPath [ \".\",\"\"]) @?= joinPath [ \"\"]\n ,  collapseFilePath (joinPath [ \".\",\".\",\"\"]) @?= joinPath [ \"\"]\n ,  collapseFilePath (joinPath [ \"..\",\"\"]) @?= joinPath [ \"..\"]\n ,  collapseFilePath (joinPath [ \"..\",\".\",\"\"]) @?= joinPath [ \"..\"]\n ,  collapseFilePath (joinPath [ \".\",\"..\",\"\"]) @?= joinPath [ \"..\"]\n ,  collapseFilePath (joinPath [ \"..\",\"..\",\"\"]) @?= joinPath [ \"..\",\"..\"]\n ,  collapseFilePath (joinPath [ \"parent\",\"foo\",\"baz\",\"..\",\"bar\"]) @?= joinPath [ \"parent\",\"foo\",\"bar\"]\n ,  collapseFilePath (joinPath [ \"parent\",\"foo\",\"baz\",\"..\",\"..\",\"bar\"]) @?= joinPath [ \"parent\",\"bar\"]\n ,  collapseFilePath (joinPath [ \"parent\",\"foo\",\"..\"]) @?= joinPath [ \"parent\"]\n ,  collapseFilePath (joinPath [ \"\",\"parent\",\"foo\",\"..\",\"..\",\"bar\"]) @?= joinPath [ \"\",\"bar\"]\n ,  collapseFilePath (joinPath [ \"\",\".\",\"parent\",\"foo\"]) @?= joinPath [ \"\",\"parent\",\"foo\"]]\n\ntestLegacyTable :: [TestTree]\ntestLegacyTable =\n  [ testCase \"decomposes a table with head\" $ gen1 @?= expect1\n  , testCase \"decomposes a table without head\" $ gen2 @?= expect2\n  , testCase \"decomposes the table from issue 7683\" $ gen3 @?= expect3\n  ]\n  where\n    pln = toList . plain . str\n    cl a h w = Cell (\"\", [], []) AlignDefault h w $ pln a\n    rws = map $ Row nullAttr\n    th = TableHead nullAttr . rws\n    tb n x y = TableBody nullAttr n (rws x) (rws y)\n    tf = TableFoot nullAttr . rws\n\n    headRows1 =\n      [[cl \"a\" 1 1, cl \"b\" 2 2]\n      ,[cl \"c\" 1 1]\n      ]\n    body1 = tb 1\n      [[cl \"e\" 3 1,cl \"f\" 3 2]\n      ,[]\n      ,[]\n      ]\n      [[emptyCell,emptyCell,emptyCell]\n      ,[cl \"g\" 1 1,emptyCell,emptyCell]\n      ]\n    footRows1 =\n      [[cl \"h\" 1 2,cl \"i\" 2 1]\n      ,[cl \"j\" 1 2]]\n    caption1 = simpleCaption $ plain \"caption\"\n    spec1 = replicate 2 (AlignDefault, ColWidth 0.5) ++ [(AlignRight, ColWidthDefault)]\n    expect1 = ( [Str \"caption\"]\n              , replicate 2 AlignDefault ++ [AlignRight]\n              , replicate 2 0.5 ++ [0]\n              , [pln \"a\", pln \"b\", mempty]\n              , [[pln \"c\", mempty, mempty]\n                ,[pln \"e\", pln \"f\", mempty]\n                ,[mempty, mempty, mempty]\n                ,[mempty, mempty, mempty]\n                ,[mempty, mempty, mempty]\n                ,[pln \"g\", mempty, mempty]\n                ,[pln \"h\", mempty, pln \"i\"]\n                ,[pln \"j\", mempty, mempty]]\n              )\n    gen1 = toLegacyTable caption1 spec1 (th headRows1) [body1] (tf footRows1)\n\n    expect2 = ( []\n              , replicate 2 AlignDefault ++ [AlignRight]\n              , replicate 2 0.5 ++ [0]\n              , []\n              , [[pln \"e\", pln \"f\", mempty]\n                ,[mempty, mempty, mempty]\n                ,[mempty, mempty, mempty]\n                ,[mempty, mempty, mempty]\n                ,[pln \"g\", mempty, mempty]\n                ,[pln \"h\", mempty, pln \"i\"]\n                ,[pln \"j\", mempty, mempty]]\n              )\n    gen2 = toLegacyTable emptyCaption spec1 (th []) [body1] (tf footRows1)\n\n    spec3 = replicate 4 (AlignDefault, ColWidthDefault)\n    body3 = tb 0\n      []\n      [[cl \"a\" 2 1, cl \"b\" 1 2, cl \"c\" 2 1]\n      ,[cl \"d\" 1 1, cl \"e\" 1 1]\n      ]\n    expect3 = ( []\n              , replicate 4 AlignDefault\n              , replicate 4 0\n              , []\n              , [[pln \"a\", pln \"b\", mempty, pln \"c\"]\n                ,[mempty, pln \"d\", pln \"e\", mempty]]\n              )\n    gen3 = toLegacyTable emptyCaption spec3 (th []) [body3] (tf [])\n"
  },
  {
    "path": "test/Tests/Writers/AnnotatedTable.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Tests.Writers.AnnotatedTable\n   Copyright   : 2020 Christian Despres\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : Christian Despres <christian.j.j.despres@gmail.com>\n   Stability   : alpha\n   Portability : portable\n\nTests for the table helper functions.\n-}\nmodule Tests.Writers.AnnotatedTable\n  ( tests\n  )\nwhere\n\nimport           Prelude\nimport qualified Data.Foldable                 as F\nimport qualified Data.List.NonEmpty            as NonEmpty\nimport           Test.Tasty\nimport           Test.Tasty.HUnit               ( testCase\n                                                , (@?=)\n                                                )\nimport           Test.Tasty.QuickCheck          ( QuickCheckTests(..)\n                                                , Property\n                                                , Testable\n                                                , conjoin\n                                                , forAll\n                                                , testProperty\n                                                , (===)\n                                                , vectorOf\n                                                , choose\n                                                , arbitrary\n                                                , elements\n                                                )\nimport           Text.Pandoc.Arbitrary          ( )\nimport           Text.Pandoc.Builder\nimport qualified Text.Pandoc.Writers.AnnotatedTable\n                                               as Ann\n\ntests :: [TestTree]\ntests = [testGroup \"toTable\" $ testAnnTable <> annTableProps]\n\ngetSpec :: Ann.Cell -> [ColSpec]\ngetSpec (Ann.Cell colspec _ _) = F.toList colspec\n\ncatHeaderSpec :: Ann.HeaderRow -> [ColSpec]\ncatHeaderSpec (Ann.HeaderRow _ _ x) = concatMap getSpec x\n\ncatBodySpec :: Ann.BodyRow -> [ColSpec]\ncatBodySpec (Ann.BodyRow _ _ x y) = concatMap getSpec x <> concatMap getSpec y\n\n-- Test if the first list can be obtained from the second by deleting\n-- elements from it.\nisSubsetOf :: Eq a => [a] -> [a] -> Bool\nisSubsetOf (x : xs) (y : ys) | x == y    = isSubsetOf xs ys\n                             | otherwise = isSubsetOf (x : xs) ys\nisSubsetOf [] _  = True\nisSubsetOf _  [] = False\n\ntestAnnTable :: [TestTree]\ntestAnnTable =\n  [testCase \"annotates a sample table properly\" $ generated @?= expected]\n where\n  spec1 = (AlignRight, ColWidthDefault)\n  spec2 = (AlignLeft, ColWidthDefault)\n  spec3 = (AlignCenter, ColWidthDefault)\n  spec  = [spec1, spec2, spec3]\n\n  cl a h w = Cell (a, [], []) AlignDefault h w []\n  rws = map $ Row nullAttr\n  th  = TableHead nullAttr . rws\n  tb n x y = TableBody nullAttr n (rws x) (rws y)\n  tf           = TableFoot nullAttr . rws\n  initialHeads = [[cl \"a\" 1 1, cl \"b\" 3 2], [cl \"c\" 2 2, cl \"d\" 1 1]]\n  initialTB1   = tb 1\n                    [[], [cl \"e\" 5 1, cl \"f\" (-7) 0]]\n                    [[cl \"g\" 4 3, cl \"h\" 4 3], [], [emptyCell]]\n  initialTB2 = tb 2 [] [[cl \"i\" 4 3, cl \"j\" 4 3]]\n  generated  = Ann.toTable nullAttr\n                           emptyCaption\n                           spec\n                           (th initialHeads)\n                           [initialTB1, initialTB2]\n                           (tf initialHeads)\n\n  acl al n a h w =\n    Ann.Cell (NonEmpty.fromList al) n $ Cell (a, [], []) AlignDefault h w []\n  emptyAnnCell al n = acl al n \"\" 1 1\n  ahrw    = Ann.HeaderRow nullAttr\n  abrw    = Ann.BodyRow nullAttr\n  ath     = Ann.TableHead nullAttr\n  atb     = Ann.TableBody nullAttr\n  atf     = Ann.TableFoot nullAttr\n\n  finalTH = ath\n    [ ahrw 0 [acl [spec1] 0 \"a\" 1 1, acl [spec2, spec3] 1 \"b\" 2 2]\n    , ahrw 1 [acl [spec1] 0 \"c\" 1 1]\n    ]\n  finalTB1 = atb\n    1\n    [ ahrw\n      2\n      [emptyAnnCell [spec1] 0, emptyAnnCell [spec2] 1, emptyAnnCell [spec3] 2]\n    , ahrw\n      3\n      [acl [spec1] 0 \"e\" 1 1, acl [spec2] 1 \"f\" 1 1, emptyAnnCell [spec3] 2]\n    ]\n    [ abrw 4 [acl [spec1] 0 \"g\" 3 1] [acl [spec2, spec3] 1 \"h\" 3 2]\n    , abrw 5 []                      []\n    , abrw 6 []                      []\n    ]\n  finalTB2 =\n    atb 2 [] [abrw 7 [acl [spec1, spec2] 0 \"i\" 1 2] [acl [spec3] 2 \"j\" 1 1]]\n  finalTF = atf\n    [ ahrw 8 [acl [spec1] 0 \"a\" 1 1, acl [spec2, spec3] 1 \"b\" 2 2]\n    , ahrw 9 [acl [spec1] 0 \"c\" 1 1]\n    ]\n  expected =\n    Ann.Table nullAttr emptyCaption spec finalTH [finalTB1, finalTB2] finalTF\n\nwithColSpec :: Testable prop => ([ColSpec] -> prop) -> Property\nwithColSpec = forAll arbColSpec\n where\n  arbColSpec = do\n    cs <- choose (1 :: Int, 6)\n    vectorOf\n      cs\n      ((,) <$> arbitrary <*> elements\n        [ColWidthDefault, ColWidth (1 / 3), ColWidth 0.25]\n      )\n\nannTableProps :: [TestTree]\nannTableProps =\n  localOption (QuickCheckTests 50)\n    <$> [ testProperty \"normalizes like the table builder\"  propBuilderAnnTable\n        , testProperty \"has valid final cell columns\"       propColNumber\n        , testProperty \"has valid first row column data\"    propFirstRowCols\n        , testProperty \"has valid all row column data\"      propColSubsets\n        , testProperty \"has valid cell column data lengths\" propCellColLengths\n        ]\n\n-- The property that Ann.toTable will normalize a table identically to\n-- the table builder. This should mean that Ann.toTable is at least as\n-- rigorous as Builder.table in that respect without repeating those\n-- tests here (see the pandoc-types Table tests for examples).\npropBuilderAnnTable :: TableHead -> [TableBody] -> TableFoot -> Property\npropBuilderAnnTable th tbs tf = withColSpec $ \\cs ->\n  convertTable (table emptyCaption cs th tbs tf)\n    === convertAnnTable (Ann.toTable nullAttr emptyCaption cs th tbs tf)\n where\n  convertTable blks = case toList blks of\n    [Table _ _ colspec a b c] -> Right (colspec, a, b, c)\n    x                         -> Left x\n  convertAnnTable x = case Ann.fromTable x of\n    (_, _, colspec, a, b, c) -> Right (colspec, a, b, c)\n\n-- The property of Ann.toTable that if the last cell in the first row\n-- of a table section has ColSpan w and ColNumber n, then w + n is the\n-- width of the table.\npropColNumber :: TableHead -> [TableBody] -> TableFoot -> Property\npropColNumber th tbs tf = withColSpec $ \\cs ->\n  let twidth = length cs\n      Ann.Table _ _ _ ath atbs atf =\n          Ann.toTable nullAttr emptyCaption cs th tbs tf\n  in  conjoin\n        $  [colNumTH twidth ath]\n        <> (colNumTB twidth <$> atbs)\n        <> [colNumTF twidth atf]\n where\n  colNumTH n (Ann.TableHead _ rs) = firstly (isHeaderValid n) rs\n  colNumTB n (Ann.TableBody _ _ rs ts) =\n    firstly (isHeaderValid n) rs && firstly (isBodyValid n) ts\n  colNumTF n (Ann.TableFoot _ rs) = firstly (isHeaderValid n) rs\n\n  isHeaderValid n (Ann.HeaderRow _ _ x) = isSegmentValid n x\n  isBodyValid n (Ann.BodyRow _ _ _ x) = isSegmentValid n x\n\n  firstly f (x : _) = f x\n  firstly _ []      = True\n  lastly f [x     ] = f x\n  lastly f (_ : xs) = lastly f xs\n  lastly _ []       = True\n\n  isSegmentValid twidth cs =\n    flip lastly cs\n      $ \\(Ann.Cell _ (Ann.ColNumber n) (Cell _ _ _ (ColSpan w) _)) ->\n          n + w == twidth\n\n-- The property of an Ann.Table from Ann.toTable that if the NonEmpty\n-- ColSpec data of the cells in the first row of a table section are\n-- concatenated, the result should equal the [ColSpec] of the entire\n-- table.\npropFirstRowCols :: TableHead -> [TableBody] -> TableFoot -> Property\npropFirstRowCols th tbs tf = withColSpec $ \\cs ->\n  let Ann.Table _ _ _ ath atbs atf =\n          Ann.toTable nullAttr emptyCaption cs th tbs tf\n  in  conjoin\n        $  [firstRowTH cs ath]\n        <> (firstRowTB cs <$> atbs)\n        <> [firstRowTF cs atf]\n where\n  firstly f (x : _) = f x\n  firstly _ []      = True\n\n  firstHeaderValid cs = firstly $ \\r -> cs == catHeaderSpec r\n  firstBodyValid cs = firstly $ \\r -> cs == catBodySpec r\n\n  firstRowTH cs (Ann.TableHead _ rs) = firstHeaderValid cs rs\n  firstRowTB cs (Ann.TableBody _ _ rs ts) =\n    firstHeaderValid cs rs && firstBodyValid cs ts\n  firstRowTF cs (Ann.TableFoot _ rs) = firstHeaderValid cs rs\n\n-- The property that in any row in an Ann.Table from Ann.toTable, the\n-- NonEmpty ColSpec annotations on cells, when concatenated, form a\n-- subset (really sublist) of the [ColSpec] of the entire table.\npropColSubsets :: TableHead -> [TableBody] -> TableFoot -> Property\npropColSubsets th tbs tf = withColSpec $ \\cs ->\n  let Ann.Table _ _ _ ath atbs atf =\n          Ann.toTable nullAttr emptyCaption cs th tbs tf\n  in  conjoin\n        $  subsetTH cs ath\n        <> concatMap (subsetTB cs) atbs\n        <> subsetTF cs atf\n where\n  subsetTH cs (Ann.TableHead _ rs) = map (subsetHeader cs) rs\n  subsetTB cs (Ann.TableBody _ _ rs ts) =\n    map (subsetHeader cs) rs <> map (subsetBody cs) ts\n  subsetTF cs (Ann.TableFoot _ rs) = map (subsetHeader cs) rs\n\n  subsetHeader cs r = catHeaderSpec r `isSubsetOf` cs\n  subsetBody cs r = catBodySpec r `isSubsetOf` cs\n\n-- The property that in any cell in an Ann.Table from Ann.toTable, the\n-- NonEmpty ColSpec annotation on a cell is equal in length to its\n-- ColSpan.\npropCellColLengths :: TableHead -> [TableBody] -> TableFoot -> Property\npropCellColLengths th tbs tf = withColSpec $ \\cs ->\n  let Ann.Table _ _ _ ath atbs atf =\n          Ann.toTable nullAttr emptyCaption cs th tbs tf\n  in  conjoin $ cellColTH ath <> concatMap cellColTB atbs <> cellColTF atf\n where\n  cellColTH (Ann.TableHead _ rs) = concatMap cellColHeader rs\n  cellColTB (Ann.TableBody _ _ rs ts) =\n    concatMap cellColHeader rs <> concatMap cellColBody ts\n  cellColTF (Ann.TableFoot _ rs) = concatMap cellColHeader rs\n\n  cellColHeader (Ann.HeaderRow _ _ x) = fmap validLength x\n  cellColBody (Ann.BodyRow _ _ x y) = fmap validLength x <> fmap validLength y\n\n  validLength (Ann.Cell colspec _ (Cell _ _ _ (ColSpan w) _)) =\n    length colspec == w\n"
  },
  {
    "path": "test/Tests/Writers/AsciiDoc.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.AsciiDoc (tests) where\n\nimport Data.Text (unpack)\nimport Test.Tasty\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nasciidoc :: (ToPandoc a) => a -> String\nasciidoc = unpack . purely (writeAsciiDocLegacy def) . toPandoc\n\nasciidoctor :: (ToPandoc a) => a -> String\nasciidoctor = unpack . purely (writeAsciiDoc def) . toPandoc\n\ntestAsciidoc :: (ToString a, ToPandoc a)\n             => String\n             -> (a, String)\n             -> TestTree\ntestAsciidoc = test asciidoc\n\ntestAsciidoctor :: (ToString a, ToPandoc a)\n             => String\n             -> (a, String)\n             -> TestTree\ntestAsciidoctor = test asciidoctor\n\ntests :: [TestTree]\ntests = [ testGroup \"emphasis\"\n          [ testAsciidoc \"emph word before\" $\n               para (text \"foo\" <> emph (text \"bar\")) =?>\n                 \"foo__bar__\"\n          , testAsciidoc \"emph word after\" $\n               para (emph (text \"foo\") <> text \"bar\") =?>\n                 \"__foo__bar\"\n          , testAsciidoc \"emph quoted\" $\n               para (doubleQuoted (emph (text \"foo\"))) =?>\n                 \"``_foo_''\"\n          , testAsciidoc \"strong word before\" $\n               para (text \"foo\" <> strong (text \"bar\")) =?>\n                 \"foo**bar**\"\n          , testAsciidoc \"strong word after\" $\n               para (strong (text \"foo\") <> text \"bar\") =?>\n                 \"**foo**bar\"\n          , testAsciidoc \"strong quoted\" $\n               para (singleQuoted (strong (text \"foo\"))) =?>\n                 \"`*foo*'\"\n          ]\n        , testGroup \"blocks\"\n          [ testAsciidoc \"code block without line numbers\" $\n               codeBlockWith (\"\", [ \"haskell\" ], []) \"foo\" =?> unlines\n                                           [ \"[source,haskell]\"\n                                           , \"----\"\n                                           , \"foo\"\n                                           , \"----\"\n                                           ]\n          , testAsciidoc \"code block with line numbers\" $\n               codeBlockWith (\"\", [ \"haskell\", \"numberLines\" ], []) \"foo\" =?> unlines\n                                           [ \"[source%linesnum,haskell]\"\n                                           , \"----\"\n                                           , \"foo\"\n                                           , \"----\"\n                                           ]\n          , testAsciidoc \"sidebar block\" $\n               divWith (\"sidebar_id\", [\"sidebar\"], [])\n                                           (divWith (\"\", [\"title\"], [])\n                                           (plain \"Sidebar Title\")\n                                           <> para \"Sidebar paragraph\"\n                                           ) =?> unlines\n                                           [ \"[[sidebar_id]]\"\n                                           , \"[SIDEBAR]\"\n                                           , \".Sidebar Title\"\n                                           , \"****\"\n                                           , \"Sidebar paragraph\"\n                                           , \"****\"\n                                           ]\n          ]\n        , testGroup \"tables\"\n          [ testAsciidoc \"empty cells\" $\n               simpleTable [] [[mempty],[mempty]] =?> unlines\n                                           [ \"[cols=\\\"\\\",]\"\n                                           , \"|===\"\n                                           , \"|\"\n                                           , \"|\"\n                                           , \"|===\"\n                                           ]\n          , test asciidoc \"multiblock cells\" $\n               simpleTable [] [[para (text \"Para 1\") <> para (text \"Para 2\")]]\n                                           =?> unlines\n                                           [ \"[cols=\\\"\\\",]\"\n                                           , \"|===\"\n                                           , \"a|\"\n                                           , \"Para 1\"\n                                           , \"\"\n                                           , \"Para 2\"\n                                           , \"\"\n                                           , \"|===\"\n                                           ]\n          ]\n        , testGroup \"lists\"\n          [ testAsciidoctor \"bullet task list\" $\n               bulletList [plain \"☐ a\", plain \"☒ b\"] =?> unlines\n                                           [ \"* [ ] a\"\n                                           , \"* [x] b\"\n                                           ]\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/BBCode.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TypeApplications #-}\n\nmodule Tests.Writers.BBCode (tests) where\n\nimport Data.Maybe (isNothing)\nimport Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Test.Tasty.QuickCheck\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Shared (tshow)\nimport Text.Read (readMaybe)\n\nbbcodeDefault\n  , bbcodeSteam\n  , bbcodePhpBB\n  , bbcodeFluxBB\n  , bbcodeHubzilla\n  , bbcodeXenforo ::\n    (ToPandoc a) => a -> Text\nbbcodeDefault = purely (writeBBCode def) . toPandoc\nbbcodeSteam = purely (writeBBCodeSteam def) . toPandoc\nbbcodePhpBB = purely (writeBBCodePhpBB def) . toPandoc\nbbcodeFluxBB = purely (writeBBCodeFluxBB def) . toPandoc\nbbcodeHubzilla = purely (writeBBCodeHubzilla def) . toPandoc\nbbcodeXenforo = purely (writeBBCodeXenforo def) . toPandoc\n\ninfix 4 =:, `steam`, `phpbb`, `fluxbb`, `hubzilla`, `xenforo`\n(=:)\n  , steam\n  , phpbb\n  , fluxbb\n  , hubzilla\n  , xenforo ::\n    (ToString a, ToPandoc a, HasCallStack) =>\n    String ->\n    (a, Text) ->\n    TestTree\n(=:) = test bbcodeDefault\nsteam = test bbcodeSteam\nphpbb = test bbcodePhpBB\nfluxbb = test bbcodeFluxBB\nhubzilla = test bbcodeHubzilla\nxenforo = test bbcodeXenforo\n\nspanClasses :: [Text] -> Inlines -> Inlines\nspanClasses cls = spanWith (\"\", cls, [])\n\nspanAttrs :: [(Text, Text)] -> Inlines -> Inlines\nspanAttrs kvList = spanWith (\"\", [], kvList)\n\ndivClasses :: [Text] -> Blocks -> Blocks\ndivClasses cls = divWith (\"\", cls, [])\n\ndivAttrs :: [(Text, Text)] -> Blocks -> Blocks\ndivAttrs kvList = divWith (\"\", [], kvList)\n\ntests :: [TestTree]\ntests =\n  [ testGroup\n      \"spans classes\"\n      [ \"left\" =: spanClasses [\"left\"] \"foo\" =?> \"foo\"\n      , \"center\" =: spanClasses [\"center\"] \"foo\" =?> \"foo\"\n      , \"right\" =: spanClasses [\"right\"] \"foo\" =?> \"foo\"\n      , \"spoiler\" =: spanClasses [\"spoiler\"] \"foo\" =?> \"foo\"\n      ]\n  , testGroup\n      \"spans attributes\"\n      [ testProperty \"incorrect size ignored\" . property $ do\n          n <- arbitrary @String\n          let nInt = readMaybe @Int n\n          let actual = bbcodeDefault (spanAttrs [(\"size\", T.pack n)] \"foo\")\n          pure $ isNothing nInt ==> actual === \"foo\"\n      , testProperty \"size<=0 ignored\" . property $ do\n          NonPositive n <- arbitrary @(NonPositive Int)\n          let actual = bbcodeDefault (spanAttrs [(\"size\", tshow n)] \"foo\")\n          pure $ actual === \"foo\"\n      , testProperty \"size>0\" . property $ do\n          Positive n <- arbitrary @(Positive Int)\n          let actual = bbcodeDefault (spanAttrs [(\"size\", tshow n)] \"foo\")\n          let expected = \"[size=\" <> tshow n <> \"]\" <> \"foo[/size]\"\n          pure $ actual === expected\n      , \"size=20\" =: spanAttrs [(\"size\", \"20\")] \"foo\" =?> \"[size=20]foo[/size]\"\n      , \"color=#AAAAAA\"\n          =: spanAttrs [(\"color\", \"#AAAAAA\")] \"foo\"\n          =?> \"[color=#AAAAAA]foo[/color]\"\n      , \"spoiler ignored\"\n          =: spanAttrs [(\"spoiler\", \"name with spaces and ]brackets[]\")] \"foo\"\n          =?> \"foo\"\n      ]\n  , testGroup\n      \"divs classes\"\n      [ \"left\"\n          =: divClasses [\"left\"] (para \"foo\")\n          =?> \"[left]foo[/left]\"\n      , \"center\"\n          =: divClasses [\"center\"] (para \"foo\")\n          =?> \"[center]foo[/center]\"\n      , \"right\"\n          =: divClasses [\"right\"] (para \"foo\")\n          =?> \"[right]foo[/right]\"\n      , \"spoiler\"\n          =: divClasses [\"spoiler\"] (para \"foo\")\n          =?> \"[spoiler]foo[/spoiler]\"\n      ]\n  , testGroup\n      \"divs attributes\"\n      [ testProperty \"incorrect size ignored\" . property $ do\n          n <- arbitrary @String\n          let nInt = readMaybe @Int n\n          let actual = bbcodeDefault (divAttrs [(\"size\", T.pack n)] $ para \"foo\")\n          pure $ isNothing nInt ==> actual === \"foo\"\n      , testProperty \"size<=0 ignored\" . property $ do\n          NonPositive n <- arbitrary @(NonPositive Int)\n          let actual = bbcodeDefault (divAttrs [(\"size\", tshow n)] $ para \"foo\")\n          pure $ actual === \"foo\"\n      , testProperty \"size>0\" . property $ do\n          Positive n <- arbitrary @(Positive Int)\n          let actual = bbcodeDefault (divAttrs [(\"size\", tshow n)] $ para \"foo\")\n          let expected = \"[size=\" <> tshow n <> \"]\" <> \"foo[/size]\"\n          pure $ actual === expected\n      , \"size=20\"\n          =: divAttrs [(\"size\", \"20\")] (para \"foo\")\n          =?> \"[size=20]foo[/size]\"\n      , \"color=#AAAAAA\"\n          =: divAttrs [(\"color\", \"#AAAAAA\")] (para \"foo\")\n          =?> \"[color=#AAAAAA]foo[/color]\"\n      , \"spoiler\"\n          =: divAttrs\n            [(\"spoiler\", \"name with spaces and ]brackets[]\")]\n            (para \"foo\")\n          =?> \"[spoiler=name with spaces and brackets]foo[/spoiler]\"\n      ]\n  , testGroup\n      \"default flavor\"\n      [ \"link\"\n          =: link \"https://example.com\" \"title\" \"label\"\n          =?> \"[url=https://example.com]label[/url]\"\n      , \"autolink\"\n          =: link \"https://example.com\" \"title\" \"https://example.com\"\n          =?> \"[url]https://example.com[/url]\"\n      , \"email autolink\"\n          =: link\n            \"mailto:example@example.com\"\n            \"title\"\n            \"example@example.com\"\n          =?> \"[email]example@example.com[/email]\"\n      , \"named email\"\n          =: link \"mailto:example@example.com\" \"title\" \"example email\"\n          =?> \"[email=example@example.com]example email[/email]\"\n      , \"h0\" =: header 0 \"heading 0\" =?> \"[u][b]heading 0[/b][/u]\"\n      , \"h1\" =: header 1 \"heading 1\" =?> \"[u][b]heading 1[/b][/u]\"\n      , \"h2\" =: header 2 \"heading 2\" =?> \"[b]heading 2[/b]\"\n      , \"h3\" =: header 3 \"heading 3\" =?> \"[u]heading 3[/u]\"\n      , \"h4\" =: header 4 \"heading 4\" =?> \"heading 4\"\n      , \"h5\" =: header 5 \"heading 5\" =?> \"heading 5\"\n      ]\n  , testGroup\n      \"steam\"\n      [ test bbcodeSteam \"dename spoiler\" $\n          divAttrs [(\"spoiler\", \"bar\")] (para \"foo\")\n            =?> (\"[spoiler]foo[/spoiler]\" :: Text)\n      , testProperty \"ordered list styleless\" . property $ do\n          let listItems = [para \"foo\", para \"bar\", para \"baz\"]\n          attrsRand <- (,,) <$> arbitrary <*> arbitrary <*> arbitrary\n          let actual = bbcodeSteam $ orderedListWith attrsRand listItems\n          let expected = \"[olist]\\n[*]foo\\n[*]bar\\n[*]baz\\n[/olist]\"\n          pure $ actual === expected\n      , \"h0\" `steam` header 0 \"heading 0\" =?> \"[h1]heading 0[/h1]\"\n      , \"h1\" `steam` header 1 \"heading 1\" =?> \"[h1]heading 1[/h1]\"\n      , \"h2\" `steam` header 2 \"heading 2\" =?> \"[h2]heading 2[/h2]\"\n      , \"h3\" `steam` header 3 \"heading 3\" =?> \"[h3]heading 3[/h3]\"\n      , \"h4\" `steam` header 4 \"heading 4\" =?> \"[h3]heading 4[/h3]\"\n      , \"code\"\n          `steam` codeWith (\"id\", [\"haskell\"], []) \"map (2^) [1..5]\"\n          =?> \"[noparse]map (2^) [1..5][/noparse]\"\n      ]\n  , testGroup\n      \"phpBB\"\n      [ \"image\"\n          `phpbb` imageWith\n            (\"id\", [], [(\"width\", \"100\")])\n            \"https://example.com\"\n            \"title\"\n            \"alt text\"\n          =?> \"[img]https://example.com[/img]\"\n      ]\n  , testGroup\n      \"FluxBB\"\n      [ \"image\"\n          `fluxbb` imageWith\n            (\"id\", [], [(\"width\", \"100\")])\n            \"https://example.com\"\n            \"title\"\n            \"alt text\"\n          =?> \"[img=alt text]https://example.com[/img]\"\n      , testProperty \"ordered list\" . property $ do\n          let listItems = [para \"foo\", para \"bar\", para \"baz\"]\n          attrsRand <- (,,) <$> arbitrary <*> arbitrary <*> arbitrary\n          let actual = bbcodeFluxBB $ orderedListWith attrsRand listItems\n          let opening = case attrsRand of\n                (_, LowerAlpha, _) -> \"[list=a]\"\n                (_, UpperAlpha, _) -> \"[list=a]\"\n                _ -> \"[list=1]\"\n          let expected = opening <> \"\\n[*]foo\\n[*]bar\\n[*]baz\\n[/list]\"\n          pure $ actual === expected\n      , \"ulist > BlockQuote not rendered\"\n          `fluxbb` bulletList [blockQuote (para \"foo\") <> para \"bar\"]\n          =?> \"[list]\\n[*]bar\\n[/list]\"\n      , \"code block\"\n          `fluxbb` codeBlockWith\n            (\"id\", [\"haskell\"], [])\n            ( T.intercalate \"\\n\" $\n                [ \"vals =\"\n                , \"  take 10\"\n                , \"    . filter (\\\\x -> (x - 5) `mod` 3 == 0)\"\n                , \"    $ map (2 ^) [1 ..]\"\n                ]\n            )\n          =?> T.intercalate\n            \"\\n\"\n            [ \"[code]vals =\"\n            , \"  take 10\"\n            , \"    . filter (\\\\x -> (x - 5) `mod` 3 == 0)\"\n            , \"    $ map (2 ^) [1 ..]\"\n            , \"[/code]\"\n            ]\n      ]\n  , testGroup\n      \"Hubzilla\"\n      [ \"unordered list\"\n          `hubzilla` bulletList [para \"foo\", para \"bar\", para \"baz\"]\n          =?> \"[ul]\\n[*]foo\\n[*]bar\\n[*]baz\\n[/ul]\"\n      , testProperty \"ordered list\" . property $ do\n          let listItems = [para \"foo\", para \"bar\", para \"baz\"]\n          attrsRand <- (,,) <$> arbitrary <*> arbitrary <*> arbitrary\n          let actual = bbcodeHubzilla $ orderedListWith attrsRand listItems\n          let (opening, closing) = case attrsRand of\n                (_, Decimal, _) -> (\"[list=1]\", \"[/list]\")\n                (_, DefaultStyle, _) -> (\"[ol]\", \"[/ol]\")\n                (_, Example, _) -> (\"[ol]\", \"[/ol]\")\n                (_, LowerAlpha, _) -> (\"[list=a]\", \"[/list]\")\n                (_, UpperAlpha, _) -> (\"[list=A]\", \"[/list]\")\n                (_, LowerRoman, _) -> (\"[list=i]\", \"[/list]\")\n                (_, UpperRoman, _) -> (\"[list=I]\", \"[/list]\")\n          let expected =\n                opening <> \"\\n[*]foo\\n[*]bar\\n[*]baz\\n\" <> closing\n          pure $ actual === expected\n      , \"definition list\"\n          `hubzilla` definitionList\n            [ (\"term_foo\", [para \"def_foo1\", para \"def_foo2\"])\n            , (\"term_bar\", [para \"def_bar1\", para \"def_bar2\"])\n            , (\"term_baz\", [para \"def_baz1\", para \"def_baz2\"])\n            ]\n          =?> mconcat\n            [ \"[dl terms=\\\"b\\\"]\\n\"\n            , \"[*= term_foo]\\ndef_foo1\\ndef_foo2\\n\"\n            , \"[*= term_bar]\\ndef_bar1\\ndef_bar2\\n\"\n            , \"[*= term_baz]\\ndef_baz1\\ndef_baz2\\n\"\n            , \"[/dl]\"\n            ]\n      , \"h0\" `hubzilla` header 0 \"heading 0\" =?> \"[h1]heading 0[/h1]\"\n      , \"h1\" `hubzilla` header 1 \"heading 1\" =?> \"[h1]heading 1[/h1]\"\n      , \"h2\" `hubzilla` header 2 \"heading 2\" =?> \"[h2]heading 2[/h2]\"\n      , \"h3\" `hubzilla` header 3 \"heading 3\" =?> \"[h3]heading 3[/h3]\"\n      , \"h4\" `hubzilla` header 4 \"heading 4\" =?> \"[h4]heading 4[/h4]\"\n      , \"h5\" `hubzilla` header 5 \"heading 5\" =?> \"[h5]heading 5[/h5]\"\n      , \"h6\" `hubzilla` header 6 \"heading 6\" =?> \"[h6]heading 6[/h6]\"\n      , \"h7\" `hubzilla` header 7 \"heading 7\" =?> \"[h6]heading 7[/h6]\"\n      , \"link\"\n          `hubzilla` link \"https://example.com\" \"title\" \"label\"\n          =?> \"[url=https://example.com]label[/url]\"\n      , \"autolink\"\n          `hubzilla` link \"https://example.com\" \"title\" \"https://example.com\"\n          =?> \"[url]https://example.com[/url]\"\n      , \"email autolink\"\n          `hubzilla` link\n            \"mailto:example@example.com\"\n            \"title\"\n            \"example@example.com\"\n          =?> \"[url=mailto:example@example.com]example@example.com[/url]\"\n      , \"named email\"\n          `hubzilla` link \"mailto:example@example.com\" \"title\" \"example email\"\n          =?> \"[url=mailto:example@example.com]example email[/url]\"\n      , \"inline code\"\n          `hubzilla` ( \"inline code: \"\n                        <> codeWith (\"id\", [\"haskell\"], []) \"map (2^) [1..5]\"\n                     )\n          =?> \"inline code: [code]map (2^) [1..5][/code]\"\n      , \"font\"\n          `hubzilla` divAttrs [(\"font\", \"serif\")] (para \"foo\")\n          =?> \"[font=serif]foo[/font]\"\n      ]\n  , testGroup\n      \"xenForo\"\n      [ \"unordered list\"\n          `xenforo` bulletList [para \"foo\", para \"bar\", para \"baz\"]\n          =?> \"[list]\\n[*]foo\\n[*]bar\\n[*]baz\\n[/list]\"\n      , testProperty \"ordered list styleless\" . property $ do\n          let listItems = [para \"foo\", para \"bar\", para \"baz\"]\n          attrsRand <- (,,) <$> arbitrary <*> arbitrary <*> arbitrary\n          let actual = bbcodeXenforo $ orderedListWith attrsRand listItems\n          let expected = \"[list=1]\\n[*]foo\\n[*]bar\\n[*]baz\\n[/list]\"\n          pure $ actual === expected\n      , \"h0\" `xenforo` header 0 \"heading 0\" =?> \"[heading=1]heading 0[/heading]\"\n      , \"h1\" `xenforo` header 1 \"heading 1\" =?> \"[heading=1]heading 1[/heading]\"\n      , \"h2\" `xenforo` header 2 \"heading 2\" =?> \"[heading=2]heading 2[/heading]\"\n      , \"h3\" `xenforo` header 3 \"heading 3\" =?> \"[heading=3]heading 3[/heading]\"\n      , \"h4\" `xenforo` header 4 \"heading 4\" =?> \"[heading=4]heading 4[/heading]\"\n      , \"link\"\n          `xenforo` link \"https://example.com\" \"title\" \"label\"\n          =?> \"[url=https://example.com]label[/url]\"\n      , \"autolink\"\n          `xenforo` link \"https://example.com\" \"title\" \"https://example.com\"\n          =?> \"[url]https://example.com[/url]\"\n      , \"email autolink\"\n          `xenforo` link\n            \"mailto:example@example.com\"\n            \"title\"\n            \"example@example.com\"\n          =?> \"[email]example@example.com[/email]\"\n      , \"named email\"\n          `xenforo` link \"mailto:example@example.com\" \"title\" \"example email\"\n          =?> \"[email=example@example.com]example email[/email]\"\n      , \"inline code\"\n          `xenforo` ( \"inline code: \"\n                        <> codeWith (\"id\", [\"haskell\"], []) \"map (2^) [1..5]\"\n                    )\n          =?> \"inline code: [icode]map (2^) [1..5][/icode]\"\n      , \"font\"\n          `xenforo` divAttrs [(\"font\", \"serif\")] (para \"foo\")\n          =?> \"[font=serif]foo[/font]\"\n      , \"inline spoiler\"\n          `xenforo` (\"It was \" <> spanClasses [\"spoiler\"] (\"DNS\") <> \"!\")\n          =?> \"It was [ispoiler]DNS[/ispoiler]!\"\n      , \"image w=50% h=50%\"\n          `xenforo` imageWith\n            (\"\", [], [(\"width\", \"50%\"), (\"height\", \"50%\")])\n            \"https://example.com\"\n            \"title text\"\n            \"alt text\"\n          =?> \"[img alt=\\\"alt text\\\" title=\\\"title text\\\" width=50%]https://example.com[/img]\"\n      , \"image w=50 h=50\"\n          `xenforo` imageWith\n            (\"\", [], [(\"width\", \"50\"), (\"height\", \"50\")])\n            \"https://example.com\"\n            \"\"\n            \"\"\n          =?> \"[img]https://example.com[/img]\"\n      ]\n  ]\n"
  },
  {
    "path": "test/Tests/Writers/ConTeXt.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.ConTeXt (tests) where\n\nimport Data.Text (unpack, pack)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Test.Tasty.QuickCheck\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\ncontext :: (ToPandoc a) => a -> String\ncontext = unpack . purely (writeConTeXt def) . toPandoc\n\ncontext' :: (ToPandoc a) => a -> String\ncontext' = unpack . purely (writeConTeXt def{ writerWrapText = WrapNone }) . toPandoc\n\ncontextNtb :: (ToPandoc a) => a -> String\ncontextNtb = unpack . purely (writeConTeXt def{ writerExtensions = enableExtension Ext_ntb pandocExtensions }) . toPandoc\n\ncontextSection :: (ToPandoc a) => a -> String\ncontextSection = unpack\n  . purely (writeConTeXt def{ writerTopLevelDivision = TopLevelSection })\n  . toPandoc\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test context \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test context \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test context\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"inline code\"\n    [ \"with '}'\" =: code \"}\" =?> \"\\\\type\\\"}\\\"\"\n    , \"without '}'\" =: code \"]\" =?> \"\\\\type{]}\"\n    , \"span with ID\" =:\n      spanWith (\"city\", [], []) \"Berlin\" =?>\n      \"\\\\reference[city]{}Berlin\"\n    , testProperty \"code property\" $ \\s ->\n        null s || '\\n' `elem` s ||\n        case T.stripPrefix \"\\\\type\" (pack $ context' (code $ pack s))\n             >>= T.uncons of\n          Just (c, _) -> c `notElem` s\n          Nothing     -> False\n    ]\n  , testGroup \"headers\"\n    [ \"level 1\" =:\n      headerWith (\"my-header\",[],[]) 1 \"My header\" =?>\n      \"\\\\startsectionlevel[title={My header},reference={my-header}]\\n\" <>\n      \"\\n\" <>\n      \"\\\\stopsectionlevel\"\n    , test contextSection \"Section as top-level\" $\n      (   headerWith (\"header1\", [], []) 1 (text \"Header1\")\n       <> headerWith (\"header2\", [], []) 2 (text \"Header2\")\n       <> headerWith (\"header3\", [], []) 3 (text \"Header3\")\n       <> headerWith (\"header4\", [], []) 4 (text \"Header4\")\n       <> headerWith (\"header5\", [], []) 5 (text \"Header5\")\n       <> headerWith (\"header6\", [], []) 6 (text \"Header6\"))\n      =?>\n      unlines\n      [ \"\\\\startsection[title={Header1},reference={header1}]\\n\"\n      , \"\\\\startsubsection[title={Header2},reference={header2}]\\n\"\n      , \"\\\\startsubsubsection[title={Header3},reference={header3}]\\n\"\n      , \"\\\\startsubsubsubsection[title={Header4},reference={header4}]\\n\"\n      , \"\\\\startsubsubsubsubsection[title={Header5},reference={header5}]\\n\"\n      , \"\\\\startsubsubsubsubsubsection[title={Header6},reference={header6}]\\n\"\n      , \"\\\\stopsubsubsubsubsubsection\\n\"\n      , \"\\\\stopsubsubsubsubsection\\n\"\n      , \"\\\\stopsubsubsubsection\\n\"\n      , \"\\\\stopsubsubsection\\n\"\n      , \"\\\\stopsubsection\\n\"\n      , \"\\\\stopsection\" ]\n    ]\n  , testGroup \"bullet lists\"\n    [ \"nested\" =:\n      bulletList [\n         plain (text \"top\")\n           <> bulletList [\n             plain (text \"next\")\n              <> bulletList [plain (text \"bot\")]\n           ]\n      ] =?> unlines\n          [ \"\\\\startitemize[packed]\"\n          , \"\\\\item\"\n          , \"  top\"\n          , \"  \\\\startitemize[packed]\"\n          , \"  \\\\item\"\n          , \"    next\"\n          , \"    \\\\startitemize[packed]\"\n          , \"    \\\\item\"\n          , \"      bot\"\n          , \"    \\\\stopitemize\"\n          , \"  \\\\stopitemize\"\n          , \"\\\\stopitemize\" ]\n    ]\n  , testGroup \"natural tables\"\n    [ test contextNtb \"table with header and caption\" $\n      let capt = text \"Table 1\"\n          aligns = [ (AlignRight, ColWidthDefault)\n                   , (AlignLeft, ColWidthDefault)\n                   , (AlignCenter, ColWidthDefault)\n                   , (AlignDefault, ColWidthDefault) ]\n          headers = [plain $ text \"Right\",\n                     plain $ text \"Left\",\n                     plain $ text \"Center\",\n                     plain $ text \"Default\"]\n          rows = [[plain $ text \"1.1\",\n                   plain $ text \"1.2\",\n                   plain $ text \"1.3\",\n                   plain $ text \"1.4\"]\n                 ,[plain $ text \"2.1\",\n                   plain $ text \"2.2\",\n                   plain $ text \"2.3\",\n                   plain $ text \"2.4\"]\n                 ,[plain $ text \"3.1\",\n                   plain $ text \"3.2\",\n                   plain $ text \"3.3\",\n                   plain $ text \"3.4\"]]\n          toRow = Row nullAttr . map simpleCell\n      in table (simpleCaption $ plain capt)\n               aligns\n               (TableHead nullAttr [toRow headers])\n               [TableBody nullAttr 0 [] $ map toRow rows]\n               (TableFoot nullAttr [])\n      =?> unlines [ \"\\\\startplacetable[title={Table 1}]\"\n                  , \"\\\\setupTABLE[column][1][align=left]\"\n                  , \"\\\\setupTABLE[column][2][align=right]\"\n                  , \"\\\\setupTABLE[column][3][align=middle]\"\n                  , \"\\\\setupTABLE[column][4][align=left]\"\n                  , \"\\\\bTABLE\"\n                  , \"\\\\bTABLEhead\"\n                  , \"\\\\bTR\"\n                  , \"\\\\bTH Right\\\\eTH\"\n                  , \"\\\\bTH Left\\\\eTH\"\n                  , \"\\\\bTH Center\\\\eTH\"\n                  , \"\\\\bTH Default\\\\eTH\"\n                  , \"\\\\eTR\"\n                  , \"\\\\eTABLEhead\"\n                  , \"\\\\bTABLEbody\"\n                  , \"\\\\bTR\"\n                  , \"\\\\bTD 1.1\\\\eTD\"\n                  , \"\\\\bTD 1.2\\\\eTD\"\n                  , \"\\\\bTD 1.3\\\\eTD\"\n                  , \"\\\\bTD 1.4\\\\eTD\"\n                  , \"\\\\eTR\"\n                  , \"\\\\bTR\"\n                  , \"\\\\bTD 2.1\\\\eTD\"\n                  , \"\\\\bTD 2.2\\\\eTD\"\n                  , \"\\\\bTD 2.3\\\\eTD\"\n                  , \"\\\\bTD 2.4\\\\eTD\"\n                  , \"\\\\eTR\"\n                  , \"\\\\bTR\"\n                  , \"\\\\bTD 3.1\\\\eTD\"\n                  , \"\\\\bTD 3.2\\\\eTD\"\n                  , \"\\\\bTD 3.3\\\\eTD\"\n                  , \"\\\\bTD 3.4\\\\eTD\"\n                  , \"\\\\eTR\"\n                  , \"\\\\eTABLEbody\"\n                  , \"\\\\bTABLEfoot\"\n                  , \"\\\\eTABLEfoot\"\n                  , \"\\\\eTABLE\"\n                  , \"\\\\stopplacetable\" ]\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Writers/DocBook.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.DocBook (tests) where\n\nimport Data.Text (unpack)\nimport Test.Tasty\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\ndocbook :: (ToPandoc a) => a -> String\ndocbook = docbookWithOpts def{ writerWrapText = WrapNone }\n\ndocbook5 :: (ToPandoc a) => a -> String\ndocbook5 = docbook5WithOpts def{ writerWrapText = WrapNone }\n\ndocbookWithOpts :: ToPandoc a => WriterOptions -> a -> String\ndocbookWithOpts opts = unpack . purely (writeDocBook4 opts) . toPandoc\n\ndocbook5WithOpts :: ToPandoc a => WriterOptions -> a -> String\ndocbook5WithOpts opts = unpack . purely (writeDocBook5 opts) . toPandoc\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test docbook \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test docbook \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:), testDb4, testDb5 :: (ToString a, ToPandoc a)\n                       => String -> (a, String) -> TestTree\n(=:) = test docbook\ntestDb4 = test docbook\ntestDb5 = test docbook5\n\nlineblock :: Blocks\nlineblock = para (\"some text\" <> linebreak <>\n                  \"and more lines\" <> linebreak <>\n                  \"and again\")\nlineblock_out :: [String]\nlineblock_out = [ \"<literallayout>some text\"\n                , \"and more lines\"\n                , \"and again</literallayout>\"\n                ]\n\ntests :: [TestTree]\ntests = [ testGroup \"inline elements\"\n          [ testGroup \"links\"\n            [ testDb4 \"db4 external link\" $ link \"https://example.com\" \"\" \"Hello\"\n                                            =?> \"<ulink url=\\\"https://example.com\\\">Hello</ulink>\"\n            , testDb5 \"db5 external link\" $ link \"https://example.com\" \"\" \"Hello\"\n                                            =?> \"<link xlink:href=\\\"https://example.com\\\">Hello</link>\"\n            , testDb5 \"anchor\"            $ link \"#foo\" \"\" \"Hello\"\n                                            =?> \"<link linkend=\\\"foo\\\">Hello</link>\"\n            , testDb5 \"automatic anchor\"  $ link \"#foo\" \"\" \"\"\n                                            =?> \"<xref linkend=\\\"foo\\\"></xref>\"\n            ]\n          ]\n        , testGroup \"line blocks\"\n          [ \"none\"       =: para \"This is a test\"\n                              =?> unlines\n                                    [ \"<para>\"\n                                    , \"  This is a test\"\n                                    , \"</para>\"\n                                    ]\n          , \"basic\"      =: lineblock\n                              =?> unlines lineblock_out\n          , \"blockquote\" =: blockQuote lineblock\n                              =?> unlines\n                                    ( [ \"<blockquote>\" ] ++\n                                      lineblock_out ++\n                                      [ \"</blockquote>\" ]\n                                    )\n          , \"footnote\"   =: para (\"This is a test\" <>\n                                  note lineblock <>\n                                  \" of footnotes\")\n                              =?> unlines\n                                    ( [ \"<para>\"\n                                      , \"  This is a test<footnote>\" ] ++\n                                      lineblock_out ++\n                                      [ \"  </footnote> of footnotes\"\n                                      , \"</para>\" ]\n                                    )\n          ]\n        , testGroup \"divs\"\n          [ \"admonition\" =: divWith (\"foo\", [\"warning\"], []) (para \"This is a test\")\n                              =?> unlines\n                                    [ \"<warning id=\\\"foo\\\">\"\n                                    , \"  <para>\"\n                                    , \"    This is a test\"\n                                    , \"  </para>\"\n                                    , \"</warning>\"\n                                    ]\n          , \"admonition-with-title\" =:\n                            divWith (\"foo\", [\"note\"], []) (\n                              divWith (\"foo\", [\"title\"], [])\n                                (plain (text \"This is title\")) <>\n                              para \"This is a test\"\n                            )\n                              =?> unlines\n                                    [ \"<note id=\\\"foo\\\">\"\n                                    , \"  <title>This is title</title>\"\n                                    , \"  <para>\"\n                                    , \"    This is a test\"\n                                    , \"  </para>\"\n                                    , \"</note>\"\n                                    ]\n          , \"admonition-with-title-in-para\" =:\n                            divWith (\"foo\", [\"note\"], []) (\n                              divWith (\"foo\", [\"title\"], [])\n                                (para \"This is title\") <>\n                              para \"This is a test\"\n                            )\n                              =?> unlines\n                                    [ \"<note id=\\\"foo\\\">\"\n                                    , \"  <title>This is title</title>\"\n                                    , \"  <para>\"\n                                    , \"    This is a test\"\n                                    , \"  </para>\"\n                                    , \"</note>\"\n                                    ]\n          , \"single-child\" =:\n                            divWith (\"foo\", [], []) (para \"This is a test\")\n                              =?> unlines\n                                    [ \"<para id=\\\"foo\\\">\"\n                                    , \"  This is a test\"\n                                    , \"</para>\"\n                                    ]\n          , \"single-literal-child\" =:\n                            divWith (\"foo\", [], []) lineblock\n                              =?> unlines\n                                    [ \"<literallayout id=\\\"foo\\\">some text\"\n                                    , \"and more lines\"\n                                    , \"and again</literallayout>\"\n                                    ]\n          , \"multiple-children\" =:\n                            divWith (\"foo\", [], []) (\n                              para \"This is a test\" <>\n                              para \"This is an another test\"\n                            )\n                              =?> unlines\n                                    [ \"<anchor id=\\\"foo\\\" />\"\n                                    , \"<para>\"\n                                    , \"  This is a test\"\n                                    , \"</para>\"\n                                    , \"<para>\"\n                                    , \"  This is an another test\"\n                                    , \"</para>\"\n                                    ]\n          ]\n        , testGroup \"compact lists\"\n          [ testGroup \"bullet\"\n            [ \"compact\"    =: bulletList [plain \"a\", plain \"b\", plain \"c\"]\n                                =?> unlines\n                                      [ \"<itemizedlist spacing=\\\"compact\\\">\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      a\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      b\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      c\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"</itemizedlist>\"\n                                      ]\n            , \"loose\"      =: bulletList [para \"a\", para \"b\", para \"c\"]\n                                =?> unlines\n                                      [ \"<itemizedlist>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      a\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      b\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      c\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"</itemizedlist>\"\n                                      ]\n            ]\n          , testGroup \"ordered\"\n            [ \"compact\"    =: orderedList [plain \"a\", plain \"b\", plain \"c\"]\n                                =?> unlines\n                                      [ \"<orderedlist spacing=\\\"compact\\\">\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      a\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      b\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      c\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"</orderedlist>\"\n                                      ]\n            , \"loose\"      =: orderedList [para \"a\", para \"b\", para \"c\"]\n                                =?> unlines\n                                      [ \"<orderedlist>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      a\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      b\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"  <listitem>\"\n                                      , \"    <para>\"\n                                      , \"      c\"\n                                      , \"    </para>\"\n                                      , \"  </listitem>\"\n                                      , \"</orderedlist>\"\n                                      ]\n            ]\n          , testGroup \"definition\"\n            [ \"compact\"    =: definitionList [ (\"an\", [plain \"apple\" ])\n                                             , (\"a\",  [plain \"banana\"])\n                                             , (\"an\", [plain \"orange\"])]\n                                =?> unlines\n                                      [ \"<variablelist spacing=\\\"compact\\\">\"\n                                      , \"  <varlistentry>\"\n                                      , \"    <term>\"\n                                      , \"      an\"\n                                      , \"    </term>\"\n                                      , \"    <listitem>\"\n                                      , \"      <para>\"\n                                      , \"        apple\"\n                                      , \"      </para>\"\n                                      , \"    </listitem>\"\n                                      , \"  </varlistentry>\"\n                                      , \"  <varlistentry>\"\n                                      , \"    <term>\"\n                                      , \"      a\"\n                                      , \"    </term>\"\n                                      , \"    <listitem>\"\n                                      , \"      <para>\"\n                                      , \"        banana\"\n                                      , \"      </para>\"\n                                      , \"    </listitem>\"\n                                      , \"  </varlistentry>\"\n                                      , \"  <varlistentry>\"\n                                      , \"    <term>\"\n                                      , \"      an\"\n                                      , \"    </term>\"\n                                      , \"    <listitem>\"\n                                      , \"      <para>\"\n                                      , \"        orange\"\n                                      , \"      </para>\"\n                                      , \"    </listitem>\"\n                                      , \"  </varlistentry>\"\n                                      , \"</variablelist>\"\n                                      ]\n            , \"loose\"      =: definitionList [ (\"an\", [para \"apple\" ])\n                                             , (\"a\",  [para \"banana\"])\n                                             , (\"an\", [para \"orange\"])]\n                                =?> unlines\n                                      [ \"<variablelist>\"\n                                      , \"  <varlistentry>\"\n                                      , \"    <term>\"\n                                      , \"      an\"\n                                      , \"    </term>\"\n                                      , \"    <listitem>\"\n                                      , \"      <para>\"\n                                      , \"        apple\"\n                                      , \"      </para>\"\n                                      , \"    </listitem>\"\n                                      , \"  </varlistentry>\"\n                                      , \"  <varlistentry>\"\n                                      , \"    <term>\"\n                                      , \"      a\"\n                                      , \"    </term>\"\n                                      , \"    <listitem>\"\n                                      , \"      <para>\"\n                                      , \"        banana\"\n                                      , \"      </para>\"\n                                      , \"    </listitem>\"\n                                      , \"  </varlistentry>\"\n                                      , \"  <varlistentry>\"\n                                      , \"    <term>\"\n                                      , \"      an\"\n                                      , \"    </term>\"\n                                      , \"    <listitem>\"\n                                      , \"      <para>\"\n                                      , \"        orange\"\n                                      , \"      </para>\"\n                                      , \"    </listitem>\"\n                                      , \"  </varlistentry>\"\n                                      , \"</variablelist>\"\n                                      ]\n            ]\n          ]\n        , testGroup \"writer options\"\n          [ testGroup \"top-level division\" $\n            let\n              headers =  header 1 (text \"header1\")\n                      <> header 2 (text \"header2\")\n                      <> header 3 (text \"header3\")\n\n              docbookTopLevelDiv :: (ToPandoc a)\n                                 => TopLevelDivision -> a -> String\n              docbookTopLevelDiv division =\n                docbookWithOpts def{ writerTopLevelDivision = division }\n            in\n            [ test (docbookTopLevelDiv TopLevelSection) \"sections as top-level\" $\n              headers =?>\n              unlines [ \"<sect1>\"\n                      , \"  <title>header1</title>\"\n                      , \"  <sect2>\"\n                      , \"    <title>header2</title>\"\n                      , \"    <sect3>\"\n                      , \"      <title>header3</title>\"\n                      , \"      <para>\"\n                      , \"      </para>\"\n                      , \"    </sect3>\"\n                      , \"  </sect2>\"\n                      , \"</sect1>\"\n                      ]\n            , test (docbookTopLevelDiv TopLevelChapter) \"chapters as top-level\" $\n              headers =?>\n              unlines [ \"<chapter>\"\n                      , \"  <title>header1</title>\"\n                      , \"  <sect1>\"\n                      , \"    <title>header2</title>\"\n                      , \"    <sect2>\"\n                      , \"      <title>header3</title>\"\n                      , \"      <para>\"\n                      , \"      </para>\"\n                      , \"    </sect2>\"\n                      , \"  </sect1>\"\n                      , \"</chapter>\"\n                      ]\n            , test (docbookTopLevelDiv TopLevelPart) \"parts as top-level\" $\n              headers =?>\n              unlines [ \"<part>\"\n                      , \"  <title>header1</title>\"\n                      , \"  <chapter>\"\n                      , \"    <title>header2</title>\"\n                      , \"    <sect1>\"\n                      , \"      <title>header3</title>\"\n                      , \"      <para>\"\n                      , \"      </para>\"\n                      , \"    </sect1>\"\n                      , \"  </chapter>\"\n                      , \"</part>\"\n                      ]\n            , test (docbookTopLevelDiv TopLevelDefault) \"default top-level\" $\n              headers =?>\n              unlines [ \"<sect1>\"\n                      , \"  <title>header1</title>\"\n                      , \"  <sect2>\"\n                      , \"    <title>header2</title>\"\n                      , \"    <sect3>\"\n                      , \"      <title>header3</title>\"\n                      , \"      <para>\"\n                      , \"      </para>\"\n                      , \"    </sect3>\"\n                      , \"  </sect2>\"\n                      , \"</sect1>\"\n                      ]\n            ]\n          ]\n          , testGroup \"section attributes\" $\n            let\n              headers =  headerWith (\"myid1\",[\"unnumbered\",\"ignored\"],[(\"role\",\"internal\"),(\"xml:id\",\"anotherid\"),(\"dir\",\"rtl\")]) 1 \"header1\"\n                      <> headerWith (\"myid2\",[\"unnumbered\"],[(\"invalidname\",\"value\"),(\"arch\",\"linux\"),(\"dir\",\"invaliddir\")]) 1 \"header2\"\n                      <> headerWith (\"myid3\",[\"ignored\"],[]) 1 \"header3\"\n            in\n            [ test docbook5 \"sections with attributes (db5)\" $\n              headers =?>\n              unlines [ \"<section xmlns=\\\"http://docbook.org/ns/docbook\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" xml:id=\\\"myid1\\\" role=\\\"unnumbered internal\\\" dir=\\\"rtl\\\">\"\n                      , \"  <title>header1</title>\"\n                      , \"  <para>\"\n                      , \"  </para>\"\n                      , \"</section>\"\n                      , \"<section xmlns=\\\"http://docbook.org/ns/docbook\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" xml:id=\\\"myid2\\\" role=\\\"unnumbered\\\">\"\n                      , \"  <title>header2</title>\"\n                      , \"  <para>\"\n                      , \"  </para>\"\n                      , \"</section>\"\n                      , \"<section xmlns=\\\"http://docbook.org/ns/docbook\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" xml:id=\\\"myid3\\\">\"\n                      , \"  <title>header3</title>\"\n                      , \"  <para>\"\n                      , \"  </para>\"\n                      , \"</section>\"\n                      ]\n            , test docbook \"sections with attributes (db4)\" $\n              headers =?>\n              unlines [ \"<sect1 id=\\\"myid1\\\" role=\\\"unnumbered internal\\\">\"\n                      , \"  <title>header1</title>\"\n                      , \"  <para>\"\n                      , \"  </para>\"\n                      , \"</sect1>\"\n                      , \"<sect1 id=\\\"myid2\\\" role=\\\"unnumbered\\\" arch=\\\"linux\\\">\"\n                      , \"  <title>header2</title>\"\n                      , \"  <para>\"\n                      , \"  </para>\"\n                      , \"</sect1>\"\n                      , \"<sect1 id=\\\"myid3\\\">\"\n                      , \"  <title>header3</title>\"\n                      , \"  <para>\"\n                      , \"  </para>\"\n                      , \"</sect1>\"\n                      ]\n            ]\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/Docx.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Docx (tests) where\n\nimport Codec.Archive.Zip (findEntryByPath, fromEntry, toArchive)\nimport qualified Data.ByteString.Lazy as BL\nimport Data.List (isInfixOf, isPrefixOf)\nimport qualified Data.Map as M\nimport Data.Text (Text)\nimport qualified Data.Text as Text\nimport qualified Data.Text.IO as T\nimport Test.Tasty\nimport Test.Tasty.HUnit\nimport Tests.Writers.OOXML\nimport Text.Pandoc\nimport Text.XML.Light (QName(QName), findAttr, findElements, parseXMLDoc)\n\n-- we add an extra check to make sure that we're not writing in the\n-- toplevel docx directory. We don't want to accidentally overwrite an\n-- Word-generated docx file used to test the reader.\ndocxTest :: String -> WriterOptions -> FilePath -> FilePath -> TestTree\ndocxTest testName opts nativeFP goldenFP =\n  if \"docx/golden/\" `isPrefixOf` goldenFP\n  then ooxmlTest writeDocx testName opts nativeFP goldenFP\n  else testCase testName $\n       assertFailure $\n       goldenFP ++ \" is not in `test/docx/golden`\"\n\ntests :: [TestTree]\ntests = [ testGroup \"inlines\"\n          [ docxTest\n            \"font formatting\"\n            def\n            \"docx/inline_formatting.native\"\n            \"docx/golden/inline_formatting.docx\"\n          , docxTest\n            \"hyperlinks\"\n            def\n            \"docx/links.native\"\n            \"docx/golden/links.docx\"\n          , docxTest\n            \"inline image\"\n            def{ writerExtensions =\n                   enableExtension Ext_native_numbering (writerExtensions def) }\n            \"docx/image_writer_test.native\"\n            \"docx/golden/image.docx\"\n          , docxTest\n            \"inline images\"\n            def\n            \"docx/inline_images_writer_test.native\"\n            \"docx/golden/inline_images.docx\"\n          , docxTest\n            \"handling unicode input\"\n            def\n            \"docx/unicode.native\"\n            \"docx/golden/unicode.docx\"\n          , docxTest\n            \"inline code\"\n            def\n            \"docx/inline_code.native\"\n            \"docx/golden/inline_code.docx\"\n          , docxTest\n            \"inline code in subscript and superscript\"\n            def\n            \"docx/verbatim_subsuper.native\"\n            \"docx/golden/verbatim_subsuper.docx\"\n          ]\n        , testGroup \"blocks\"\n          [ docxTest\n            \"headers\"\n            def\n            \"docx/headers.native\"\n            \"docx/golden/headers.docx\"\n          , docxTest\n            \"nested anchor spans in header\"\n            def\n            \"docx/nested_anchors_in_header.native\"\n            \"docx/golden/nested_anchors_in_header.docx\"\n          , docxTest\n            \"lists\"\n            def\n            \"docx/lists.native\"\n            \"docx/golden/lists.docx\"\n          , docxTest\n            \"lists continuing after interruption\"\n            def\n            \"docx/lists_continuing.native\"\n            \"docx/golden/lists_continuing.docx\"\n          , docxTest\n            \"lists restarting after interruption\"\n            def\n            \"docx/lists_restarting.native\"\n            \"docx/golden/lists_restarting.docx\"\n          , docxTest\n            \"lists with multiple initial list levels\"\n            def\n            \"docx/lists_multiple_initial.native\"\n            \"docx/golden/lists_multiple_initial.docx\"\n          , docxTest\n            \"lists with div bullets\"\n            def\n            \"docx/lists_div_bullets.native\"\n            \"docx/golden/lists_div_bullets.docx\"\n          , docxTest\n            \"definition lists\"\n            def\n            \"docx/definition_list.native\"\n            \"docx/golden/definition_list.docx\"\n          , docxTest\n            \"task lists\"\n            def\n            \"docx/task_list.native\"\n            \"docx/golden/task_list.docx\"\n          , docxTest\n            \"issue 9994\"\n            def\n            \"docx/lists_9994.native\"\n            \"docx/golden/lists_9994.docx\"\n          , docxTest\n            \"footnotes and endnotes\"\n            def\n            \"docx/notes.native\"\n            \"docx/golden/notes.docx\"\n          , docxTest\n            \"links in footnotes and endnotes\"\n            def\n            \"docx/link_in_notes.native\"\n            \"docx/golden/link_in_notes.docx\"\n          , docxTest\n            \"blockquotes\"\n            def\n            \"docx/block_quotes.native\"\n            \"docx/golden/block_quotes.docx\"\n          , docxTest\n            \"tables\"\n            def\n            \"docx/tables.native\"\n            \"docx/golden/tables.docx\"\n          , docxTest\n            \"tables without explicit column widths\"\n            def\n            \"docx/tables-default-widths.native\"\n            \"docx/golden/tables-default-widths.docx\"\n          , docxTest\n            \"tables with lists in cells\"\n            def\n            \"docx/table_with_list_cell.native\"\n            \"docx/golden/table_with_list_cell.docx\"\n          , docxTest\n            \"tables with one row\"\n            def\n            \"docx/table_one_row.native\"\n            \"docx/golden/table_one_row.docx\"\n          , docxTest\n            \"tables separated with RawBlock\"\n            def\n            \"docx/tables_separated_with_rawblock.native\"\n            \"docx/golden/tables_separated_with_rawblock.docx\"\n          , docxTest\n            \"code block\"\n            def\n            \"docx/codeblock.native\"\n            \"docx/golden/codeblock.docx\"\n          , docxTest\n            \"raw OOXML blocks\"\n            def\n            \"docx/raw-blocks.native\"\n            \"docx/golden/raw-blocks.docx\"\n          , docxTest\n            \"raw bookmark markers\"\n            def\n            \"docx/raw-bookmarks.native\"\n            \"docx/golden/raw-bookmarks.docx\"\n          ]\n        , testGroup \"track changes\"\n          [ docxTest\n            \"insertion\"\n            def\n            \"docx/track_changes_insertion_all.native\"\n            \"docx/golden/track_changes_insertion.docx\"\n          , docxTest\n            \"deletion\"\n            def\n            \"docx/track_changes_deletion_all.native\"\n            \"docx/golden/track_changes_deletion.docx\"\n          , docxTest\n            \"move text\"\n            def\n            \"docx/track_changes_move_all.native\"\n            \"docx/golden/track_changes_move.docx\"\n          , docxTest\n            \"comments\"\n            def\n            \"docx/comments.native\"\n            \"docx/golden/comments.docx\"\n          , docxTest\n            \"scrubbed metadata\"\n            def\n            \"docx/track_changes_scrubbed_metadata.native\"\n            \"docx/golden/track_changes_scrubbed_metadata.docx\"\n          ]\n        , testGroup \"custom styles\"\n          [ docxTest \"custom styles without reference.docx\"\n            def\n            \"docx/custom_style.native\"\n            \"docx/golden/custom_style_no_reference.docx\"\n          , docxTest \"custom styles with reference.docx\"\n            def{writerReferenceDoc = Just \"docx/custom-style-reference.docx\"}\n            \"docx/custom_style.native\"\n            \"docx/golden/custom_style_reference.docx\"\n          , docxTest \"suppress custom style for headers and blockquotes\"\n            def\n            \"docx/custom-style-preserve.native\"\n            \"docx/golden/custom_style_preserve.docx\"\n          ]\n        , testGroup \"metadata\"\n          [ docxTest \"document properties (core, custom)\"\n            def\n            \"docx/document-properties.native\"\n            \"docx/golden/document-properties.docx\"\n          , docxTest \"document properties (short description)\"\n            def\n            \"docx/document-properties-short-desc.native\"\n            \"docx/golden/document-properties-short-desc.docx\"\n          ]\n        , testGroup \"top-level-division\"\n          -- Helper to count occurrences of a substring\n          -- Note: counts by splitting on \"<w:sectPr\" which marks section properties\n          [ testCase \"no section break before first chapter (#10578)\" $ do\n              -- With --top-level-division=chapter, there should be no section\n              -- break before the first chapter (to avoid blank first page)\n              let opts = def{ writerTopLevelDivision = TopLevelChapter }\n              bs <- runIOorExplode $ do\n                setVerbosity ERROR\n                let doc = Pandoc mempty\n                          [ Header 1 (\"ch1\", [], []) [Str \"Chapter\", Space, Str \"1\"]\n                          , Para [Str \"First\", Space, Str \"chapter.\"]\n                          ]\n                writeDocx opts doc\n              let archive = toArchive bs\n              entry <- case findEntryByPath \"word/document.xml\" archive of\n                Nothing -> assertFailure \"Missing word/document.xml in output docx\"\n                Just e -> return e\n              let docXml = show (fromEntry entry)\n              -- Count occurrences of \"<w:sectPr\" (opening tag for section properties)\n              let countOccurrences needle haystack =\n                    length (filter (needle `isPrefixOf`) (tails haystack))\n                    where tails [] = []; tails s@(_:xs) = s : tails xs\n              let sectPrCount = countOccurrences \"<w:sectPr\" docXml\n              -- Should have exactly 1 sectPr (the final document section),\n              -- not 2 (which would mean one before the chapter heading)\n              assertBool (\"Expected 1 sectPr (final section only), found \" ++ show sectPrCount)\n                (sectPrCount == 1)\n          , testCase \"section breaks between chapters (#11482)\" $ do\n              -- With --top-level-division=chapter, there should be section\n              -- breaks between chapters (but not before the first one)\n              let opts = def{ writerTopLevelDivision = TopLevelChapter }\n              bs <- runIOorExplode $ do\n                setVerbosity ERROR\n                let doc = Pandoc mempty\n                          [ Header 1 (\"ch1\", [], []) [Str \"Chapter\", Space, Str \"1\"]\n                          , Para [Str \"First\", Space, Str \"chapter.\"]\n                          , Header 1 (\"ch2\", [], []) [Str \"Chapter\", Space, Str \"2\"]\n                          , Para [Str \"Second\", Space, Str \"chapter.\"]\n                          , Header 1 (\"ch3\", [], []) [Str \"Chapter\", Space, Str \"3\"]\n                          , Para [Str \"Third\", Space, Str \"chapter.\"]\n                          ]\n                writeDocx opts doc\n              let archive = toArchive bs\n              entry <- case findEntryByPath \"word/document.xml\" archive of\n                Nothing -> assertFailure \"Missing word/document.xml in output docx\"\n                Just e -> return e\n              let docXml = show (fromEntry entry)\n              -- Count occurrences of \"<w:sectPr\" (opening tag for section properties)\n              let countOccurrences needle haystack =\n                    length (filter (needle `isPrefixOf`) (tails haystack))\n                    where tails [] = []; tails s@(_:xs) = s : tails xs\n              let sectPrCount = countOccurrences \"<w:sectPr\" docXml\n              -- Should have 3 sectPr elements:\n              -- - 1 before chapter 2\n              -- - 1 before chapter 3\n              -- - 1 final document section\n              -- (No section break before chapter 1)\n              assertBool (\"Expected 3 sectPr elements, found \" ++ show sectPrCount)\n                (sectPrCount == 3)\n          ]\n        , testGroup \"reference docx\"\n          [ testCase \"no media directory override in content types\" $ do\n              let opts = def{ writerReferenceDoc = Just \"docx/inline_images.docx\" }\n              txt <- T.readFile \"docx/inline_formatting.native\"\n              bs <- runIOorExplode $ do\n                mblang <- toLang (Just (Text.pack \"en-US\") :: Maybe Text)\n                maybe (return ()) setTranslations mblang\n                setVerbosity ERROR\n                readNative def txt >>= writeDocx opts\n              let archive = toArchive bs\n              entry <- case findEntryByPath \"[Content_Types].xml\" archive of\n                Nothing -> assertFailure \"Missing [Content_Types].xml in output docx\"\n                Just e -> return e\n              doc <- case parseXMLDoc (fromEntry entry) of\n                Nothing -> assertFailure \"Failed to parse [Content_Types].xml\"\n                Just d -> return d\n              let partNameAttr = QName \"PartName\" Nothing Nothing\n              let overrideName = QName \"Override\" Nothing Nothing\n              let overrides = findElements overrideName doc\n              let hasBadOverride =\n                    any (\\el -> findAttr partNameAttr el == Just \"/word/media/\")\n                        overrides\n              assertBool \"Found invalid /word/media/ Override in [Content_Types].xml\"\n                (not hasBadOverride)\n          , testCase \"language from reference docx is preserved\" $ do\n              -- First, verify that the german-reference.docx actually has de-DE\n              refBs <- BL.readFile \"docx/german-reference.docx\"\n              let refArchive = toArchive refBs\n              refEntry <- case findEntryByPath \"word/styles.xml\" refArchive of\n                Nothing -> assertFailure \"Missing word/styles.xml in german-reference.docx\"\n                Just e -> return e\n              let refStylesXml = show (fromEntry refEntry)\n              let getLangLines = filter (\"w:lang\" `isInfixOf`) . lines\n              assertBool (\"german-reference.docx w:lang line: \" ++\n                  unlines (getLangLines refStylesXml))\n                (any (\"de-DE\" `isInfixOf`) (getLangLines refStylesXml))\n              -- Now test that using this reference preserves the language\n              let opts = def{ writerReferenceDoc = Just \"docx/german-reference.docx\" }\n              txt <- T.readFile \"docx/inline_formatting.native\"\n              bs <- runIOorExplode $ do\n                setVerbosity ERROR\n                readNative def txt >>= writeDocx opts\n              let archive = toArchive bs\n              entry <- case findEntryByPath \"word/styles.xml\" archive of\n                Nothing -> assertFailure \"Missing word/styles.xml in output docx\"\n                Just e -> return e\n              let stylesXml = show (fromEntry entry)\n              -- Find the w:lang line for debugging\n              -- Check that the styles.xml contains the German language\n              assertBool (\"Language from reference docx not preserved. w:lang lines: \" ++ unlines (getLangLines stylesXml))\n                (any (\"de-DE\" `isInfixOf`) (getLangLines stylesXml))\n          , testCase \"language from metadata overrides reference docx\" $ do\n              -- Use a reference docx with German language, but specify French in metadata\n              let opts = def{ writerReferenceDoc = Just \"docx/german-reference.docx\" }\n              bs <- runIOorExplode $ do\n                setVerbosity ERROR\n                -- Create a document with French language metadata\n                let doc = Pandoc (Meta $ M.fromList [(\"lang\", MetaString \"fr-FR\")])\n                                 [Para [Str \"Test\"]]\n                writeDocx opts doc\n              let archive = toArchive bs\n              entry <- case findEntryByPath \"word/styles.xml\" archive of\n                Nothing -> assertFailure \"Missing word/styles.xml in output docx\"\n                Just e -> return e\n              let stylesXml = show (fromEntry entry)\n              -- Check that the styles.xml contains the French language (not German)\n              let getLangLines = filter (\"w:lang\" `isInfixOf`) . lines\n              assertBool \"Language from metadata did not override reference docx (expected fr-FR)\"\n                (any (\"fr-FR\" `isInfixOf`) (getLangLines stylesXml))\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/FB2.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.FB2 (tests) where\n\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nfb2 :: String -> String\nfb2 x = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\" ++\n        \"<FictionBook xmlns=\\\"http://www.gribuser.ru/xml/fictionbook/2.0\\\" xmlns:l=\\\"http://www.w3.org/1999/xlink\\\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section>\" ++ x ++ \"</section></body></FictionBook>\"\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test (purely (writeFB2 def) . toPandoc)\n\ntests :: [TestTree]\ntests = [ testGroup \"block elements\"\n          [\"para\"          =: para \"Lorem ipsum cetera.\"\n                           =?> fb2 \"<p>Lorem ipsum cetera.</p>\"\n          ]\n        , testGroup \"inlines\"\n          [\n            \"Emphasis\"      =:  para (emph \"emphasized\")\n                            =?> fb2 \"<p><emphasis>emphasized</emphasis></p>\"\n          ]\n        , \"bullet list\" =: bulletList [ plain $ text \"first\"\n                                      , plain $ text \"second\"\n                                      , plain $ text \"third\"\n                                      ]\n                        =?> fb2 \"<p>\\x2022 first</p><p>\\x2022 second</p><p>\\x2022 third</p>\"\n         ]\n"
  },
  {
    "path": "test/Tests/Writers/HTML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.HTML (tests) where\n\nimport Data.Text (unpack)\nimport qualified Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nhtmlWithOpts :: (ToPandoc a) => WriterOptions -> a -> String\nhtmlWithOpts opts = unpack . purely (writeHtml4String opts{ writerWrapText = WrapNone }) . toPandoc\n\nhtml :: (ToPandoc a) => a -> String\nhtml = htmlWithOpts def\n\nhtmlQTags :: (ToPandoc a) => a -> String\nhtmlQTags = unpack\n  . purely (writeHtml4String def{ writerWrapText = WrapNone, writerHtmlQTags = True })\n  . toPandoc\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test html \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test html \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test html\n\nnoteTestDoc :: Blocks\nnoteTestDoc =\n  header 1 \"Page title\" <>\n  header 2 \"First section\" <>\n  para (\"This is a footnote.\" <>\n        note (para \"Down here.\") <>\n        \" And this is a \" <>\n        link \"https://www.google.com\" \"\" \"link\" <>\n        \".\") <>\n  blockQuote (para (\"A note inside a block quote.\" <>\n                    note (para \"The second note.\")) <>\n              para \"A second paragraph.\") <>\n  header 2 \"Second section\" <>\n  para \"Some more text.\"\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"inline code\"\n    [ \"basic\" =: code \"@&\" =?> \"<code>@&amp;</code>\"\n    , \"haskell\" =: codeWith (\"\",[\"haskell\"],[]) \">>=\"\n      =?> \"<code class=\\\"sourceCode haskell\\\"><span class=\\\"op\\\">&gt;&gt;=</span></code>\"\n    , \"nolanguage\" =: codeWith (\"\",[\"nolanguage\"],[]) \">>=\"\n      =?> \"<code class=\\\"nolanguage\\\">&gt;&gt;=</code>\"\n    ]\n  , testGroup \"images\"\n    [ \"alt with formatting\" =:\n      image \"/url\" \"title\" (\"my \" <> emph \"image\")\n      =?> \"<img src=\\\"/url\\\" title=\\\"title\\\" alt=\\\"my image\\\" />\"\n    ]\n  , testGroup \"blocks\"\n    [ \"definition list with empty <dt>\" =:\n      definitionList [(mempty, [para $ text \"foo bar\"])]\n      =?> \"<dl>\\n<dt></dt>\\n<dd>\\n<p>foo bar</p>\\n</dd>\\n</dl>\"\n    , \"heading with disallowed attributes\" =:\n      headerWith (\"\", [], [(\"invalid\",\"1\"), (\"lang\", \"en\")]) 1 \"test\"\n      =?>\n      \"<h1 lang=\\\"en\\\">test</h1>\"\n    ]\n  , testGroup \"quotes\"\n    [ \"quote with cite attribute (without q-tags)\" =:\n      doubleQuoted (spanWith (\"\", [], [(\"cite\", \"http://example.org\")]) (str \"examples\"))\n      =?> \"“<span cite=\\\"http://example.org\\\">examples</span>”\"\n    , tQ \"quote with cite attribute (with q-tags)\" $\n      doubleQuoted (spanWith (\"\", [], [(\"cite\", \"http://example.org\")]) (str \"examples\"))\n      =?> \"<q cite=\\\"http://example.org\\\">examples</q>\"\n    ]\n  , testGroup \"code\"\n    [ \"code should be rendered correctly\" =:\n      plain (codeWith (\"\",[],[]) \"Answer is 42\") =?>\n      \"<code>Answer is 42</code>\"\n    ]\n  , testGroup \"sample\"\n    [ \"sample should be rendered correctly\" =:\n      plain (codeWith (\"\",[\"sample\"],[]) \"Answer is 42\") =?>\n      \"<samp>Answer is 42</samp>\"\n    ]\n  , testGroup \"variable\"\n    [ \"variable should be rendered correctly\" =:\n      plain (codeWith (\"\",[\"variable\"],[]) \"result\") =?>\n      \"<var>result</var>\"\n    ]\n  , testGroup \"sample with style\"\n    [ \"samp should wrap highlighted code\" =:\n      codeWith (\"\",[\"sample\",\"haskell\"],[]) \">>=\"\n      =?> (\"<samp><code class=\\\"sourceCode haskell sample\\\">\" ++\n          \"<span class=\\\"op\\\">&gt;&gt;=</span></code></samp>\")\n    ]\n  , testGroup \"variable with style\"\n    [ \"var should wrap highlighted code\" =:\n      codeWith (\"\",[\"haskell\",\"variable\"],[]) \">>=\"\n      =?> (\"<var><code class=\\\"sourceCode haskell variable\\\">\" ++\n          \"<span class=\\\"op\\\">&gt;&gt;=</span></code></var>\")\n    ]\n  , testGroup \"footnotes\"\n      [ test (htmlWithOpts def{writerReferenceLocation=EndOfDocument})\n        \"at the end of a document\" $\n        noteTestDoc =?>\n        T.unlines\n          [ \"<h1>Page title</h1>\"\n          , \"<h2>First section</h2>\"\n          , \"<p>This is a footnote.<a href=\\\"#fn1\\\" class=\\\"footnote-ref\\\" id=\\\"fnref1\\\"><sup>1</sup></a> And this is a <a href=\\\"https://www.google.com\\\">link</a>.</p>\"\n          , \"<blockquote>\"\n          , \"<p>A note inside a block quote.<a href=\\\"#fn2\\\" class=\\\"footnote-ref\\\" id=\\\"fnref2\\\"><sup>2</sup></a></p>\"\n          , \"<p>A second paragraph.</p>\"\n          , \"</blockquote>\"\n          , \"<h2>Second section</h2>\"\n          , \"<p>Some more text.</p>\"\n          , \"<div class=\\\"footnotes footnotes-end-of-document\\\">\"\n          , \"<hr />\"\n          , \"<ol>\"\n          , \"<li id=\\\"fn1\\\"><p>Down here.<a href=\\\"#fnref1\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"<li id=\\\"fn2\\\"><p>The second note.<a href=\\\"#fnref2\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"</ol>\"\n          , \"</div>\"\n          ]\n      , test (htmlWithOpts def{writerReferenceLocation=EndOfBlock})\n        \"at the end of a block\" $\n        noteTestDoc =?>\n        T.unlines\n          [ \"<h1>Page title</h1>\"\n          , \"<h2>First section</h2>\"\n          , \"<p>This is a footnote.<a href=\\\"#fn1\\\" class=\\\"footnote-ref\\\" id=\\\"fnref1\\\"><sup>1</sup></a> And this is a <a href=\\\"https://www.google.com\\\">link</a>.</p>\"\n          , \"<div class=\\\"footnotes footnotes-end-of-block\\\">\"\n          , \"<ol>\"\n          , \"<li id=\\\"fn1\\\"><p>Down here.<a href=\\\"#fnref1\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"</ol>\"\n          , \"</div>\"\n          , \"<blockquote>\"\n          , \"<p>A note inside a block quote.<a href=\\\"#fn2\\\" class=\\\"footnote-ref\\\" id=\\\"fnref2\\\"><sup>2</sup></a></p>\"\n          , \"<p>A second paragraph.</p>\"\n          , \"</blockquote>\"\n          , \"<div class=\\\"footnotes footnotes-end-of-block\\\">\"\n          , \"<ol start=\\\"2\\\">\"\n          , \"<li id=\\\"fn2\\\"><p>The second note.<a href=\\\"#fnref2\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"</ol>\"\n          , \"</div>\"\n          , \"<h2>Second section</h2>\"\n          , \"<p>Some more text.</p>\"\n          ]\n      , test (htmlWithOpts def{writerReferenceLocation=EndOfSection})\n        \"at the end of a section\" $\n        noteTestDoc =?>\n        T.unlines\n          [ \"<h1>Page title</h1>\"\n          , \"<h2>First section</h2>\"\n          , \"<p>This is a footnote.<a href=\\\"#fn1\\\" class=\\\"footnote-ref\\\" id=\\\"fnref1\\\"><sup>1</sup></a> And this is a <a href=\\\"https://www.google.com\\\">link</a>.</p>\"\n          , \"<blockquote>\"\n          , \"<p>A note inside a block quote.<a href=\\\"#fn2\\\" class=\\\"footnote-ref\\\" id=\\\"fnref2\\\"><sup>2</sup></a></p>\"\n          , \"<p>A second paragraph.</p>\"\n          , \"</blockquote>\"\n          , \"<div class=\\\"footnotes footnotes-end-of-section\\\">\"\n          , \"<hr />\"\n          , \"<ol>\"\n          , \"<li id=\\\"fn1\\\"><p>Down here.<a href=\\\"#fnref1\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"<li id=\\\"fn2\\\"><p>The second note.<a href=\\\"#fnref2\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"</ol>\"\n          , \"</div>\"\n          , \"<h2>Second section</h2>\"\n          , \"<p>Some more text.</p>\"\n          ]\n      , test (htmlWithOpts def{writerReferenceLocation=EndOfSection, writerSectionDivs=True})\n        \"at the end of a section, with section divs\" $\n        noteTestDoc =?>\n        -- Footnotes are rendered _after_ their section (in this case after the level2 section\n        -- that contains it).\n        T.unlines\n          [ \"<div class=\\\"section level1\\\">\"\n          , \"<h1>Page title</h1>\"\n          , \"<div class=\\\"section level2\\\">\"\n          , \"<h2>First section</h2>\"\n          , \"<p>This is a footnote.<a href=\\\"#fn1\\\" class=\\\"footnote-ref\\\" id=\\\"fnref1\\\"><sup>1</sup></a> And this is a <a href=\\\"https://www.google.com\\\">link</a>.</p>\"\n          , \"<blockquote>\"\n          , \"<p>A note inside a block quote.<a href=\\\"#fn2\\\" class=\\\"footnote-ref\\\" id=\\\"fnref2\\\"><sup>2</sup></a></p>\"\n          , \"<p>A second paragraph.</p>\"\n          , \"</blockquote>\"\n          , \"<div class=\\\"footnotes footnotes-end-of-section\\\">\"\n          , \"<hr />\"\n          , \"<ol>\"\n          , \"<li id=\\\"fn1\\\"><p>Down here.<a href=\\\"#fnref1\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"<li id=\\\"fn2\\\"><p>The second note.<a href=\\\"#fnref2\\\" class=\\\"footnote-back\\\">↩︎</a></p></li>\"\n          , \"</ol>\"\n          , \"</div>\"\n          , \"</div>\"\n          , \"<div class=\\\"section level2\\\">\"\n          , \"<h2>Second section</h2>\"\n          , \"<p>Some more text.</p>\"\n          , \"</div>\"\n          , \"</div>\"\n          ]\n      ]\n  ]\n  where\n    tQ :: (ToString a, ToPandoc a)\n         => String -> (a, String) -> TestTree\n    tQ = test htmlQTags\n"
  },
  {
    "path": "test/Tests/Writers/JATS.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.JATS (tests) where\n\nimport Data.Text (Text)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\nimport qualified Data.Text as T\n\njats :: (ToPandoc a) => a -> Text\njats = purely (writeJatsArchiving def{ writerWrapText = WrapNone })\n     . toPandoc\n\njatsArticleAuthoring :: (ToPandoc a) => a -> Text\njatsArticleAuthoring =\n    purely (writeJatsArticleAuthoring def{ writerWrapText = WrapNone })\n  . toPandoc\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test jats \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test jats \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, Text) -> TestTree\n(=:) = test jats\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"inline code\"\n    [ \"basic\" =: code \"@&\" =?> \"<p><monospace>@&amp;</monospace></p>\"\n    ]\n  , testGroup \"block code\"\n    [ \"basic\" =: codeBlock \"@&\" =?> \"<preformat>@&amp;</preformat>\"\n    , \"lang\" =: codeBlockWith (\"\", [\"c\"], []) \"@&\" =?> \"<code language=\\\"c\\\">@&amp;</code>\"\n    ]\n  , testGroup \"images\"\n    [ \"basic\" =:\n      image \"/url\" \"title\" mempty\n      =?> \"<graphic mimetype=\\\"image\\\" mime-subtype=\\\"\\\" xlink:href=\\\"/url\\\" xlink:title=\\\"title\\\" />\"\n    ]\n  , testGroup \"inlines\"\n    [ \"Emphasis\" =: emph \"emphasized\"\n      =?> \"<p><italic>emphasized</italic></p>\"\n\n    , test jatsArticleAuthoring \"footnote in articleauthoring tag set\"\n      (\"test\" <> note (para \"footnote\") =?>\n        unlines [ \"<p>test<fn>\"\n                , \"  <p>footnote</p>\"\n                , \"</fn></p>\"\n                ])\n    ]\n  , testGroup \"bullet list\"\n    [ \"plain items\" =: bulletList [ plain $ text \"first\"\n                                  , plain $ text \"second\"\n                                  , plain $ text \"third\"\n                                  ]\n      =?> \"<list list-type=\\\"bullet\\\">\\n\\\n          \\  <list-item>\\n\\\n          \\    <p>first</p>\\n\\\n          \\  </list-item>\\n\\\n          \\  <list-item>\\n\\\n          \\    <p>second</p>\\n\\\n          \\  </list-item>\\n\\\n          \\  <list-item>\\n\\\n          \\    <p>third</p>\\n\\\n          \\  </list-item>\\n\\\n          \\</list>\"\n\n    , \"item with implicit figure\" =:\n      bulletList [ simpleFigure (text \"caption\") \"a.png\" \"\" ] =?>\n      T.unlines\n        [ \"<list list-type=\\\"bullet\\\">\"\n        , \"  <list-item>\"\n        , \"    <p specific-use=\\\"wrapper\\\">\"\n        , \"      <fig>\"\n        , \"        <caption><p>caption</p></caption>\"\n        , \"        <graphic mimetype=\\\"image\\\" mime-subtype=\\\"png\\\"\" <>\n          \" xlink:href=\\\"a.png\\\" />\"\n        , \"      </fig>\"\n        , \"    </p>\"\n        , \"  </list-item>\"\n        , \"</list>\"\n        ]\n    ]\n  , testGroup \"definition lists\"\n    [ \"with internal link\" =: definitionList [(link \"#go\" \"\" (str \"testing\"),\n                                               [plain (text \"hi there\")])] =?>\n      \"<def-list>\\n\\\n      \\  <def-item>\\n\\\n      \\    <term><xref alt=\\\"testing\\\" rid=\\\"go\\\">testing</xref></term>\\n\\\n      \\    <def>\\n\\\n      \\      <p>hi there</p>\\n\\\n      \\    </def>\\n\\\n      \\  </def-item>\\n\\\n      \\</def-list>\"\n    ]\n  , testGroup \"math\"\n    [ \"escape |\" =: para (math \"\\\\sigma|_{\\\\{x\\\\}}\") =?>\n      \"<p><inline-formula><alternatives>\\n\\\n      \\<tex-math><![CDATA[\\\\sigma|_{\\\\{x\\\\}}]]></tex-math>\\n\\\n      \\<mml:math display=\\\"inline\\\" xmlns:mml=\\\"http://www.w3.org/1998/Math/MathML\\\"><mml:mrow><mml:mi>σ</mml:mi><mml:msub><mml:mo stretchy=\\\"false\\\" form=\\\"prefix\\\">|</mml:mo><mml:mrow><mml:mo stretchy=\\\"false\\\" form=\\\"prefix\\\">{</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\\\"false\\\" form=\\\"postfix\\\">}</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></alternatives></inline-formula></p>\"\n    ]\n  , testGroup \"headers\"\n    [ \"unnumbered header\" =:\n      headerWith (\"foo\",[\"unnumbered\"],[]) 1\n      (text \"Header 1\" <> note (plain $ text \"note\")) =?>\n      \"<sec id=\\\"foo\\\">\\n\\\n      \\  <title>Header 1<xref ref-type=\\\"fn\\\" rid=\\\"fn1\\\">1</xref></title>\\n\\\n      \\</sec>\"\n    , \"unnumbered sub header\" =:\n      headerWith (\"foo\",[\"unnumbered\"],[]) 1\n      (text \"Header\")\n      <> headerWith (\"foo\",[\"unnumbered\"],[]) 2\n      (text \"Sub-Header\") =?>\n      \"<sec id=\\\"foo\\\">\\n\\\n      \\  <title>Header</title>\\n\\\n      \\  <sec id=\\\"foo\\\">\\n\\\n      \\    <title>Sub-Header</title>\\n\\\n      \\  </sec>\\n\\\n      \\</sec>\"\n    , \"containing image\" =:\n      header 1 (image \"imgs/foo.jpg\" \"\" (text \"Alt text\")) =?>\n      \"<sec>\\n\\\n      \\  <title><inline-graphic mimetype=\\\"image\\\" mime-subtype=\\\"jpeg\\\" xlink:href=\\\"imgs/foo.jpg\\\">\\n\\\n      \\    <alt-text>Alt text</alt-text>\\n\\\n      \\  </inline-graphic></title>\\n\\\n      \\</sec>\"\n    ]\n\n  , testGroup \"ids\"\n    [ \"non-ASCII in header ID\" =:\n      headerWith (\"smørbrød\",[],[]) 1 (text \"smørbrød\") =?>\n      T.unlines [ \"<sec id=\\\"smørbrød\\\">\"\n                , \"  <title>smørbrød</title>\"\n                , \"</sec>\"\n                ]\n\n    , \"disallowed symbol in header id\" =:\n      headerWith (\"i/o\",[],[]) 1 (text \"I/O\") =?>\n      T.unlines [ \"<sec id=\\\"iU002Fo\\\">\"\n                , \"  <title>I/O</title>\"\n                , \"</sec>\"\n                ]\n\n    , \"disallowed symbols in internal link target\" =:\n      link \"#foo:bar\" \"\" \"baz\" =?>\n      \"<p><xref alt=\\\"baz\\\" rid=\\\"fooU003Abar\\\">baz</xref></p>\"\n\n    , \"code id starting with a number\" =:\n      codeWith (\"7y\",[],[]) \"print 5\" =?>\n      \"<p><monospace id=\\\"U0037y\\\">print 5</monospace></p>\"\n    ]\n\n  , testGroup \"spans\"\n    [ \"unwrapped if no attributes given\" =:\n      spanWith nullAttr \"text in span\" =?>\n      \"<p>text in span</p>\"\n\n    , \"converted to named-content element if class given\" =:\n      spanWith (\"a\", [\"genus-species\"], [(\"alt\", \"aa\")]) \"C. elegans\" =?>\n      (\"<p><named-content id=\\\"a\\\" alt=\\\"aa\\\" content-type=\\\"genus-species\\\">\"\n       <> \"C. elegans</named-content></p>\")\n\n    , \"unwrapped if styled-content element would have no attributes\" =:\n      spanWith (\"\", [], [(\"hidden\", \"true\")]) \"text in span\" =?>\n      \"<p>text in span</p>\"\n\n    , \"use content-type attribute if present\" =:\n      spanWith (\"\", [], [(\"content-type\", \"species\")]) \"E. coli\" =?>\n      \"<p><named-content content-type=\\\"species\\\">E. coli</named-content></p>\"\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Writers/Jira.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Jira (tests) where\n\nimport Data.Text (unpack)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\njira :: (ToPandoc a) => a -> String\njira = unpack . purely (writeJira def) . toPandoc\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test jira\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"inlines\"\n    [ \"underlined text\" =:\n      underline \"underlined text\" =?>\n      \"+underlined text+\"\n\n    , \"image with attributes\" =:\n      imageWith (\"\", [], [(\"align\", \"right\"), (\"height\", \"50\")])\n                \"image.png\" \"\" mempty =?>\n      \"!image.png|align=right, height=50!\"\n\n    , testGroup \"links\"\n      [ \"external link\" =:\n        link \"https://example.com/test.php\" \"\" \"test\" =?>\n        \"[test|https://example.com/test.php]\"\n\n      , \"external link without description\" =:\n        link \"https://example.com/tmp.js\" \"\" \"https://example.com/tmp.js\" =?>\n        \"[https://example.com/tmp.js]\"\n\n      , \"email link\" =:\n        link \"mailto:me@example.com\" \"\" \"Jane\" =?>\n        \"[Jane|mailto:me@example.com]\"\n\n      , \"email link without description\" =:\n        link \"mailto:me@example.com\" \"\" \"me@example.com\" =?>\n        \"[mailto:me@example.com]\"\n\n      , \"attachment link\" =:\n        linkWith (\"\", [\"attachment\"], []) \"foo.txt\" \"\" \"My file\" =?>\n        \"[My file^foo.txt]\"\n\n      , \"attachment link without description\" =:\n        linkWith (\"\", [\"attachment\"], []) \"foo.txt\" \"\" \"foo.txt\" =?>\n        \"[^foo.txt]\"\n\n      , \"user link\" =:\n        linkWith (\"\", [\"user-account\"], []) \"~johndoe\" \"\" \"John Doe\" =?>\n        \"[John Doe|~johndoe]\"\n\n      , \"user link with user as description\" =:\n        linkWith (\"\", [\"user-account\"], []) \"~johndoe\" \"\" \"~johndoe\" =?>\n        \"[~johndoe]\"\n\n      , \"'smart' link\" =:\n        para (linkWith (\"\", [\"smart-link\"], []) \"http://example.com\" \"\" \"x\") =?>\n        \"[x|http://example.com|smart-link]\"\n\n      , \"'smart' card\" =:\n        para (linkWith (\"\", [\"smart-card\"], []) \"http://example.org\" \"\" \"x\") =?>\n        \"[x|http://example.org|smart-card]\"\n      ]\n\n    , testGroup \"spans\"\n      [ \"id is used as anchor\" =:\n        spanWith (\"unicorn\", [], []) (str \"Unicorn\") =?>\n        \"{anchor:unicorn}Unicorn\"\n\n      , \"use `color` attribute\" =:\n        spanWith (\"\",[],[(\"color\",\"red\")]) \"ruby\" =?>\n        \"{color:red}ruby{color}\"\n      ]\n\n    , testGroup \"code\"\n      [ \"code block with known language\" =:\n        codeBlockWith (\"\", [\"java\"], []) \"Book book = new Book(\\\"Algebra\\\")\" =?>\n        \"{code:java}\\nBook book = new Book(\\\"Algebra\\\")\\n{code}\"\n\n      , \"code block without language\" =:\n        codeBlockWith (\"\", [], []) \"preformatted\\n  text.\\n\" =?>\n        \"{noformat}\\npreformatted\\n  text.\\n{noformat}\"\n      ]\n    ]\n\n  , testGroup \"blocks\"\n    [ testGroup \"div\"\n      [ \"empty attributes\" =:\n        divWith nullAttr (para \"interesting text\") =?>\n        \"interesting text\"\n\n      , \"just identifier\" =:\n        divWith (\"a\", [], []) (para \"interesting text\") =?>\n        \"{anchor:a}interesting text\"\n\n      , \"with class 'panel'\" =:\n        divWith (\"\", [\"panel\"], []) (para \"Contents!\") =?>\n        \"{panel}\\nContents\\\\!\\n{panel}\\n\"\n\n      , \"panel with id\" =:\n        divWith (\"b\", [\"panel\"], []) (para \"text\") =?>\n        \"{panel}\\n{anchor:b}text\\n{panel}\\n\"\n\n      , \"title attribute\" =:\n        divWith (\"\", [], [(\"title\", \"Gimme!\")]) (para \"Contents!\") =?>\n        \"{panel:title=Gimme!}\\nContents\\\\!\\n{panel}\\n\"\n\n      , \"nested panels\" =:\n        let panelAttr = (\"\", [\"panel\"], [])\n        in divWith panelAttr (para \"hi\" <>\n                              divWith panelAttr (para \"wassup?\")) =?>\n        \"{panel}\\nhi\\n\\nwassup?\\n{panel}\\n\"\n      ]\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Writers/LaTeX.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.LaTeX (tests) where\n\nimport Data.Text (pack, unpack)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\nlatex :: (ToPandoc a) => a -> String\nlatex = latexWithOpts def\n\nlatexListing :: (ToPandoc a) => a -> String\nlatexListing = latexWithOpts def{ writerHighlightMethod = IdiomaticHighlighting }\n\nlatexWithOpts :: (ToPandoc a) => WriterOptions -> a -> String\nlatexWithOpts opts = unpack . purely (writeLaTeX opts) . toPandoc\n\nbeamerWithOpts :: (ToPandoc a) => WriterOptions -> a -> String\nbeamerWithOpts opts = unpack . purely (writeBeamer opts) . toPandoc\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test latex \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test latex \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test latex\n\ntests :: [TestTree]\ntests = [ testGroup \"code blocks\"\n          [ \"in footnotes\" =: note (para \"hi\" <> codeBlock \"hi\") =?>\n            \"\\\\footnote{hi\\n\\n\\\\begin{Verbatim}\\nhi\\n\\\\end{Verbatim}\\n}\"\n          , test latexListing \"identifier\" $ codeBlockWith (\"id\",[],[]) \"hi\" =?>\n            (\"\\\\begin{lstlisting}[label=id]\\nhi\\n\\\\end{lstlisting}\" :: String)\n          , test latexListing \"no identifier\" $ codeBlock \"hi\" =?>\n            (\"\\\\begin{lstlisting}\\nhi\\n\\\\end{lstlisting}\" :: String)\n          ]\n        , testGroup \"definition lists\"\n          [ \"with internal link\" =: definitionList [(link \"#go\" \"\" (str \"testing\"),\n             [plain (text \"hi there\")])] =?>\n            \"\\\\begin{description}\\n\\\\tightlist\\n\\\\item[{\\\\hyperref[go]{testing}}]\\nhi there\\n\\\\end{description}\"\n          ]\n        , testGroup \"math\"\n          [ \"escape |\" =: para (math \"\\\\sigma|_{\\\\{x\\\\}}\") =?>\n            \"\\\\(\\\\sigma|_{\\\\{x\\\\}}\\\\)\"\n          ]\n        , testGroup \"headers\"\n          [ \"unnumbered header\" =:\n            headerWith (\"foo\",[\"unnumbered\"],[]) 1\n              (text \"Header 1\" <> note (plain $ text \"note\")) =?>\n            \"\\\\section*{\\\\texorpdfstring{Header 1\\\\footnote{note}}{Header 1}}\\\\label{foo}\\n\\\\addcontentsline{toc}{section}{Header 1}\\n\"\n          , \"in list item\" =:\n            bulletList [header 2 (text \"foo\")] =?>\n            \"\\\\begin{itemize}\\n\\\\item ~\\n  \\\\subsection{foo}\\n\\\\end{itemize}\"\n          , \"in definition list item\" =:\n            definitionList [(text \"foo\", [header 2 (text \"bar\"),\n                                          para $ text \"baz\"])] =?>\n            \"\\\\begin{description}\\n\\\\item[foo] ~ \\n\\\\subsection{bar}\\n\\nbaz\\n\\\\end{description}\"\n          , \"containing image\" =:\n            header 1 (image \"imgs/foo.jpg\" \"\" (text \"Alt text\")) =?>\n            \"\\\\section{\\\\texorpdfstring{\\\\protect\\\\pandocbounded{\\\\includegraphics[keepaspectratio,alt={Alt text}]{imgs/foo.jpg}}}{Alt text}}\"\n          ]\n        , testGroup \"inline code\"\n          [ \"struck out and highlighted\" =:\n            strikeout (codeWith (\"\",[\"haskell\"],[]) \"foo\" <> space\n              <> str \"bar\") =?>\n            \"\\\\st{\\\\mbox{\\\\VERB|\\\\NormalTok{foo}|} bar}\"\n          , \"struck out and not highlighted\" =:\n            strikeout (code \"foo\" <> space\n              <> str \"bar\") =?>\n            \"\\\\st{\\\\mbox{\\\\texttt{foo}} bar}\"\n          , \"single quotes\" =:\n              code \"dog's\" =?> \"\\\\texttt{dog\\\\textquotesingle{}s}\"\n          , \"backtick\" =:\n              code \"`nu?`\" =?> \"\\\\texttt{\\\\textasciigrave{}nu?\\\\textasciigrave{}}\"\n          ]\n        , testGroup \"inline note\"\n          [ \"Big note in emph\" =:\n              emph (str \"This sentence\"\n                    <> note (para (str \"paragraph1\")\n                             <> para (str \"paragraph2\"))\n                    <> str \" has footnote.\")\n              =?>\n                 \"\\\\emph{This sentence}\\\\footnote{paragraph1\\n\\n  paragraph2}\"\n                 <> \"\\\\emph{ has footnote.}\"\n           , \"Big note in strong\" =:\n              strong (str \"This sentence\"\n                      <> note (para (str \"paragraph1\")\n                               <> para (str \"paragraph2\"))\n                      <> str \" has footnote.\")\n              =?>\n                 \"\\\\textbf{This sentence}\\\\footnote{paragraph1\\n\\n  paragraph2}\"\n                 <> \"\\\\textbf{ has footnote.}\"\n\n           , \"Big note in underline\" =:\n              underline (str \"This sentence\"\n                         <> note (para (str \"paragraph1\")\n                                  <> para (str \"paragraph2\"))\n                         <> str \" has footnote.\")\n              =?>\n                 \"\\\\ul{This sentence}\\\\footnote{paragraph1\\n\\n  paragraph2}\"\n                 <> \"\\\\ul{ has footnote.}\"\n\n           , \"Big note in strikeout\" =:\n              strikeout (str \"This sentence\"\n                         <> note (para (str \"paragraph1\")\n                                  <> para (str \"paragraph2\"))\n                         <> str \" has footnote.\")\n              =?>\n                 \"\\\\st{This sentence}\\\\footnote{paragraph1\\n\\n  paragraph2}\"\n                 <> \"\\\\st{ has footnote.}\"\n\n           , \"Small note in emph\" =:\n              emph (str \"This sentence\"\n                    <> note (para (str \"paragraph\"))\n                    <> str \" has footnote.\")\n              =?>\n                 \"\\\\emph{This sentence\\\\footnote{paragraph} has footnote.}\"\n\n           , \"Big note nested in emph and strong\" =:\n              emph (str \"This \"\n                    <> strong (str \"nested sentence \"\n                               <> note (para (str \"paragraph1\")\n                                        <> para (str \"paragraph2\"))\n                               <> str \"has \")\n                    <> str \"footnote.\"\n              )\n              =?>\n                 \"\\\\emph{This \\\\textbf{nested sentence }}\\\\footnote{paragraph1\\n\\n\"\n                 <> \"  paragraph2}\\\\emph{\\\\textbf{has }footnote.}\"\n\n          , \"Two Big notes in emph\" =:\n              emph (str \"This sentence\"\n                    <> note (para (str \"1-paragraph1\")\n                             <> para (str \"1-paragraph2\"))\n                    <> str \" has\"\n                    <> note (para (str \"2-paragraph1\")\n                             <> para (str \"2-paragraph2\"))\n                    <> str \" footnote.\")\n              =?>\n                 \"\\\\emph{This sentence}\\\\footnote{1-paragraph1\\n\\n  1-paragraph2}\"\n                 <> \"\\\\emph{ has}\\\\footnote{2-paragraph1\\n\\n  2-paragraph2}\"\n                 <> \"\\\\emph{ footnote.}\"\n          ]\n        , testGroup \"writer options\"\n          [ testGroup \"top-level division\" $\n            let\n              headers =  header 1 (text \"header1\")\n                      <> header 2 (text \"header2\")\n                      <> header 3 (text \"header3\")\n\n              latexTopLevelDiv :: (ToPandoc a) => TopLevelDivision -> a -> String\n              latexTopLevelDiv division =\n                latexWithOpts def{ writerTopLevelDivision = division }\n\n              beamerTopLevelDiv :: (ToPandoc a)\n                                => TopLevelDivision -> a -> String\n              beamerTopLevelDiv division =\n                beamerWithOpts def { writerTopLevelDivision = division }\n            in\n            [ test (latexTopLevelDiv TopLevelSection)\n                   \"sections as top-level\" $ headers =?>\n              unlines [ \"\\\\section{header1}\\n\"\n                      , \"\\\\subsection{header2}\\n\"\n                      , \"\\\\subsubsection{header3}\"\n                      ]\n            , test (latexTopLevelDiv TopLevelChapter)\n                   \"chapters as top-level\" $ headers =?>\n              unlines [ \"\\\\chapter{header1}\\n\"\n                      , \"\\\\section{header2}\\n\"\n                      , \"\\\\subsection{header3}\"\n                      ]\n            , test (latexTopLevelDiv TopLevelPart)\n                   \"parts as top-level\" $ headers =?>\n              unlines [ \"\\\\part{header1}\\n\"\n                      , \"\\\\chapter{header2}\\n\"\n                      , \"\\\\section{header3}\"\n                      ]\n            , test (latexTopLevelDiv TopLevelDefault)\n                   \"default top-level\" $ headers =?>\n              unlines [ \"\\\\section{header1}\\n\"\n                      , \"\\\\subsection{header2}\\n\"\n                      , \"\\\\subsubsection{header3}\"\n                      ]\n            , test (beamerTopLevelDiv TopLevelSection)\n                   \"sections as top-level in beamer\" $ headers =?>\n              unlines [ \"\\\\section{header1}\\n\"\n                      , \"\\\\subsection{header2}\\n\"\n                      , \"\\\\subsubsection{header3}\"\n                      ]\n            , test (beamerTopLevelDiv TopLevelChapter)\n                   \"chapters are as part in beamer\" $ headers =?>\n              unlines [ \"\\\\part{header1}\\n\"\n                      , \"\\\\section{header2}\\n\"\n                      , \"\\\\subsection{header3}\"\n                      ]\n            , test (beamerTopLevelDiv TopLevelPart)\n                   \"parts as top-level in beamer\" $ headers =?>\n              unlines [ \"\\\\part{header1}\\n\"\n                      , \"\\\\section{header2}\\n\"\n                      , \"\\\\subsection{header3}\"\n                      ]\n            , test (beamerTopLevelDiv TopLevelDefault)\n                   \"default top-level in beamer\" $ headers =?>\n              unlines [ \"\\\\section{header1}\\n\"\n                      , \"\\\\subsection{header2}\\n\"\n                      , \"\\\\subsubsection{header3}\"\n                      ]\n            , test (latexTopLevelDiv TopLevelPart)\n                   \"part top-level, section not in toc\" $\n                   (   headerWith (\"\", [\"unnumbered\"], []) 1 (text \"header1\")\n                    <> headerWith (\"\", [\"unnumbered\"], []) 2 (text \"header2\")\n                    <> headerWith (\"\", [\"unnumbered\"], []) 3 (text \"header3\")\n                    <> headerWith (\"\", [\"unnumbered\"], []) 4 (text \"header4\")\n                    <> headerWith (\"\", [\"unnumbered\"], []) 5 (text \"header5\")\n                    <> headerWith (\"\", [\"unnumbered\"], []) 6 (text \"header6\"))\n                   =?>\n              unlines [ \"\\\\part*{header1}\"\n                      , \"\\\\addcontentsline{toc}{part}{header1}\\n\"\n                      , \"\\\\chapter*{header2}\"\n                      , \"\\\\addcontentsline{toc}{chapter}{header2}\\n\"\n                      , \"\\\\section*{header3}\"\n                      , \"\\\\addcontentsline{toc}{section}{header3}\\n\"\n                      , \"\\\\subsection*{header4}\"\n                      , \"\\\\addcontentsline{toc}{subsection}{header4}\\n\"\n                      , \"\\\\subsubsection*{header5}\"\n                      , \"\\\\addcontentsline{toc}{subsubsection}{header5}\\n\"\n                      , \"\\\\paragraph*{header6}\"\n                      , \"\\\\addcontentsline{toc}{paragraph}{header6}\"\n                      ]\n            ]\n          ]\n        , testGroup \"figures\"\n          [ \"placement\" =:\n            figureWith (\"\", [], [(\"latex-placement\", \"htbp\")])\n            (simpleCaption $ plain \"caption\")\n            (plain $ image (pack \"img.jpg\") (pack \"\") (text \"alt text\"))\n            =?>\n              \"\\\\begin{figure}[htbp]\\n\\\\centering\\n\"\n              <> \"\\\\pandocbounded{\\\\includegraphics[keepaspectratio,alt={alt text}]{img.jpg}}\\n\"\n              <> \"\\\\caption{caption}\\n\\\\end{figure}\"\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/Markdown.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{-# OPTIONS_GHC -fno-warn-name-shadowing #-}\nmodule Tests.Writers.Markdown (tests) where\n\nimport Data.Text (unpack)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\ndefopts :: WriterOptions\ndefopts = def\n  { writerExtensions = pandocExtensions\n  , writerSetextHeaders = True }\n\nmarkdown :: (ToPandoc a) => a -> String\nmarkdown = unpack . purely (writeMarkdown defopts) . toPandoc\n\nmarkdownWithOpts :: (ToPandoc a) => WriterOptions -> a -> String\nmarkdownWithOpts opts x = unpack . purely (writeMarkdown opts) $ toPandoc x\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test markdown \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test markdown \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test markdown\n\ntests :: [TestTree]\ntests = [ \"indented code after list\"\n             =: (orderedList [ para \"one\" <> para \"two\" ] <> codeBlock \"test\")\n             =?> \"1.  one\\n\\n    two\\n\\n<!-- -->\\n\\n    test\"\n        , \"list with tight sublist\"\n             =: bulletList [ plain \"foo\" <> bulletList [ plain \"bar\" ],\n                             plain \"baz\" ]\n             =?> \"- foo\\n  - bar\\n- baz\\n\"\n        , \"emph/strong with spaces (#10696)\"\n             =: emph (str \"f\" <> strong (space <> str \"d\" <> space)) <> str \"l\" =?>\n             \"*f **d*** l\"\n        ] ++ [noteTests] ++ [shortcutLinkRefsTests]\n\n{-\n\nTesting with the following text:\n\nFirst Header\n============\n\nThis is a footnote.[^1] And this is a [link](https://www.google.com).\n\n> A note inside a block quote.[^2]\n>\n> A second paragraph.\n\nSecond Header\n=============\n\nSome more text.\n\n\n[^1]: Down here.\n\n[^2]: The second note.\n\n-}\n\nnoteTestDoc :: Blocks\nnoteTestDoc =\n  header 1 \"First Header\" <>\n  para (\"This is a footnote.\" <>\n        note (para \"Down here.\") <>\n        \" And this is a \" <>\n        link \"https://www.google.com\" \"\" \"link\" <>\n        \".\") <>\n  blockQuote (para (\"A note inside a block quote.\" <>\n                    note (para \"The second note.\")) <>\n              para \"A second paragraph.\") <>\n  header 1 \"Second Header\" <>\n  para \"Some more text.\"\n\n\n\nnoteTests :: TestTree\nnoteTests = testGroup \"note and reference location\"\n  [ test (markdownWithOpts defopts)\n    \"footnotes at the end of a document\" $\n    noteTestDoc =?>\n    unlines [ \"First Header\"\n               , \"============\"\n               , \"\"\n               , \"This is a footnote.[^1] And this is a [link](https://www.google.com).\"\n               , \"\"\n               , \"> A note inside a block quote.[^2]\"\n               , \">\"\n               , \"> A second paragraph.\"\n               , \"\"\n               , \"Second Header\"\n               , \"=============\"\n               , \"\"\n               , \"Some more text.\"\n               , \"\"\n               , \"[^1]: Down here.\"\n               , \"\"\n               , \"[^2]: The second note.\"\n               ]\n  , test (markdownWithOpts defopts{writerReferenceLocation=EndOfBlock})\n    \"footnotes at the end of blocks\" $\n    noteTestDoc =?>\n    unlines [ \"First Header\"\n               , \"============\"\n               , \"\"\n               , \"This is a footnote.[^1] And this is a [link](https://www.google.com).\"\n               , \"\"\n               , \"[^1]: Down here.\"\n               , \"\"\n               , \"> A note inside a block quote.[^2]\"\n               , \">\"\n               , \"> A second paragraph.\"\n               , \"\"\n               , \"[^2]: The second note.\"\n               , \"\"\n               , \"Second Header\"\n               , \"=============\"\n               , \"\"\n               , \"Some more text.\"\n               ]\n  , test (markdownWithOpts defopts{writerReferenceLocation=EndOfBlock, writerReferenceLinks=True})\n    \"footnotes and reference links at the end of blocks\" $\n    noteTestDoc =?>\n    unlines [ \"First Header\"\n               , \"============\"\n               , \"\"\n               , \"This is a footnote.[^1] And this is a [link].\"\n               , \"\"\n               , \"[^1]: Down here.\"\n               , \"\"\n               , \"  [link]: https://www.google.com\"\n               , \"\"\n               , \"> A note inside a block quote.[^2]\"\n               , \">\"\n               , \"> A second paragraph.\"\n               , \"\"\n               , \"[^2]: The second note.\"\n               , \"\"\n               , \"Second Header\"\n               , \"=============\"\n               , \"\"\n               , \"Some more text.\"\n               ]\n  , test (markdownWithOpts defopts{writerReferenceLocation=EndOfSection})\n    \"footnotes at the end of section\" $\n    noteTestDoc =?>\n    unlines [ \"First Header\"\n               , \"============\"\n               , \"\"\n               , \"This is a footnote.[^1] And this is a [link](https://www.google.com).\"\n               , \"\"\n               , \"> A note inside a block quote.[^2]\"\n               , \">\"\n               , \"> A second paragraph.\"\n               , \"\"\n               , \"[^1]: Down here.\"\n               , \"\"\n               , \"[^2]: The second note.\"\n               , \"\"\n               , \"Second Header\"\n               , \"=============\"\n               , \"\"\n               , \"Some more text.\"\n               ]\n\n  ]\n\nshortcutLinkRefsTests :: TestTree\nshortcutLinkRefsTests =\n  let infix 4 =:\n      (=:) :: (ToString a, ToPandoc a, HasCallStack)\n\n        => String -> (a, String) -> TestTree\n      (=:) = test (purely (writeMarkdown defopts{writerReferenceLinks = True}) . toPandoc)\n  in testGroup \"Shortcut reference links\"\n     [ \"Simple link (shortcutable)\"\n           =: para (link \"/url\" \"title\" \"foo\")\n           =?> \"[foo]\\n\\n  [foo]: /url \\\"title\\\"\"\n     , \"Followed by another link (unshortcutable)\"\n           =: para (link \"/url1\" \"title1\" \"first\"\n                  <> link \"/url2\" \"title2\" \"second\")\n           =?> unlines [ \"[first][][second]\"\n                       , \"\"\n                       , \"  [first]: /url1 \\\"title1\\\"\"\n                       , \"  [second]: /url2 \\\"title2\\\"\"\n                       ]\n     , \"Followed by space and another link (unshortcutable)\"\n           =: para (link \"/url1\" \"title1\" \"first\" <> \" \"\n                  <> link \"/url2\" \"title2\" \"second\")\n           =?> unlines [ \"[first][] [second]\"\n                       , \"\"\n                       , \"  [first]: /url1 \\\"title1\\\"\"\n                       , \"  [second]: /url2 \\\"title2\\\"\"\n                       ]\n     , \"Reference link is used multiple times (unshortcutable)\"\n           =: para (link \"/url1\" \"\" \"foo\" <> link \"/url2\" \"\" \"foo\"\n                                             <> link \"/url3\" \"\" \"foo\")\n           =?> unlines [ \"[foo][][foo][1][foo][2]\"\n                       , \"\"\n                       , \"  [foo]: /url1\"\n                       , \"  [1]: /url2\"\n                       , \"  [2]: /url3\"\n                       ]\n     , \"Reference link is used multiple times (unshortcutable)\"\n           =: para (link \"/url1\" \"\" \"foo\" <> \" \" <> link \"/url2\" \"\" \"foo\"\n                                             <> \" \" <> link \"/url3\" \"\" \"foo\")\n           =?> unlines [ \"[foo][] [foo][1] [foo][2]\"\n                       , \"\"\n                       , \"  [foo]: /url1\"\n                       , \"  [1]: /url2\"\n                       , \"  [2]: /url3\"\n                       ]\n     , \"Reference link is followed by text in brackets\"\n          =:  para (link \"/url\" \"\" \"link\" <> \"[text in brackets]\")\n          =?> unlines [ \"[link][]\\\\[text in brackets\\\\]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     , \"Reference link is followed by space and text in brackets\"\n          =:  para (link \"/url\" \"\" \"link\" <> \" [text in brackets]\")\n          =?> unlines [ \"[link][] \\\\[text in brackets\\\\]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     , \"Reference link is followed by RawInline\"\n          =: para (link \"/url\" \"\" \"link\" <> rawInline \"markdown\" \"[rawText]\")\n          =?> unlines [ \"[link][][rawText]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     , \"Reference link is followed by space and RawInline\"\n          =: para (link \"/url\" \"\" \"link\" <> space <> rawInline \"markdown\" \"[rawText]\")\n          =?> unlines [ \"[link][] [rawText]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     , \"Reference link is followed by RawInline with space\"\n          =: para (link \"/url\" \"\" \"link\" <> rawInline \"markdown\" \" [rawText]\")\n          =?> unlines [ \"[link][] [rawText]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     , \"Reference link is followed by citation\"\n          =: para (link \"/url\" \"\" \"link\" <> cite [Citation \"author\" [] [] NormalCitation 0 0] (str \"[@author]\"))\n          =?> unlines [ \"[link][][@author]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     , \"Reference link is followed by space and citation\"\n          =: para (link \"/url\" \"\" \"link\" <> space <> cite [Citation \"author\" [] [] NormalCitation 0 0] (str \"[@author]\"))\n          =?> unlines [ \"[link][] [@author]\"\n                      , \"\"\n                      , \"  [link]: /url\"\n                      ]\n     ]\n"
  },
  {
    "path": "test/Tests/Writers/Markua.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Markua (tests) where\n\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test html \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test html \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test (purely (writeMarkua def) . toPandoc)\n\ntests :: [TestTree]\ntests = [ testGroup \"simple blurb/aside\"\n          [\"blurb\"          =: divWith (\"\",[\"blurb\"],[]) (bulletList [para \"blurb content\"])\n                           =?> \"B> * blurb content\"\n          ,\"aside\"          =: divWith (\"\",[\"aside\"],[]) (bulletList [para \"aside list\"])\n                           =?> \"A> * aside list\"\n          ]\n         ,testGroup \"multiclass blurb/aside\"\n          [\"blurb\"          =: divWith (\"\",[\"blurb\", \"otherclass\"],[]) (bulletList [para \"blurb content\"])\n                           =?> \"B> * blurb content\"\n          ,\"aside\"          =: divWith (\"\",[\"otherclass\", \"aside\"],[]) (bulletList [para \"aside list\"])\n                           =?> \"A> * aside list\"\n          ]\n         ]\n"
  },
  {
    "path": "test/Tests/Writers/Ms.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Ms (tests) where\n\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Builder\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test (purely (writeMs def . toPandoc))\n\ntests :: [TestTree]\ntests = [ testGroup \"code blocks\"\n          [ \"basic\"\n              =: codeBlock \"hello\"\n              =?> unlines\n              [ \".IP\"\n              , \".nf\"\n              , \"\\\\f[C]\"\n              , \"hello\"\n              , \"\\\\f[]\"\n              , \".fi\"]\n          , \"escape starting .\"\n              =: codeBlock \". hello\"\n              =?> unlines\n              [ \".IP\"\n              , \".nf\"\n              , \"\\\\f[C]\"\n              , \"\\\\&. hello\"\n              , \"\\\\f[]\"\n              , \".fi\"]\n          ]\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/Muse.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Muse (tests) where\n\nimport Prelude hiding (unlines)\nimport Data.Text (Text, unlines)\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\ndefopts :: WriterOptions\ndefopts = def{ writerWrapText = WrapPreserve,\n               writerExtensions = extensionsFromList [Ext_amuse,\n                                                      Ext_auto_identifiers] }\n\nmuse :: (ToPandoc a) => a -> Text\nmuse = museWithOpts defopts\n\nmuseWithOpts :: (ToPandoc a) => WriterOptions -> a -> Text\nmuseWithOpts opts = purely (writeMuse opts) . toPandoc\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, Text) -> TestTree\n(=:) = test muse\n\nnoteLocationTestDoc :: Blocks\nnoteLocationTestDoc =\n  header 1 \"First Header\" <>\n  para (\"This is a footnote.\" <>\n        note (para \"First note.\")) <>\n  blockQuote (para (\"A note inside a block quote.\" <>\n                    note (para \"The second note.\")) <>\n              para \"A second paragraph.\") <>\n  header 1 \"Second Header\" <>\n  para \"Some more text.\"\n\nnoteLocationTests :: TestTree\nnoteLocationTests = testGroup \"note location\"\n  [ test (museWithOpts defopts {writerReferenceLocation=EndOfDocument})\n    \"footnotes at the end of document\" $\n    noteLocationTestDoc =?>\n    unlines [ \"* First Header\"\n            , \"\"\n            , \"This is a footnote.[1]\"\n            , \"\"\n            , \"<quote>\"\n            , \"A note inside a block quote.[2]\"\n            , \"\"\n            , \"A second paragraph.\"\n            , \"</quote>\"\n            , \"\"\n            , \"* Second Header\"\n            , \"\"\n            , \"Some more text.\"\n            , \"\"\n            , \"[1] First note.\"\n            , \"\"\n            , \"[2] The second note.\"\n            ]\n  , test (museWithOpts defopts {writerReferenceLocation=EndOfBlock})\n    \"footnotes at the end of block\" $\n    noteLocationTestDoc =?>\n    unlines [ \"* First Header\"\n            , \"\"\n            , \"This is a footnote.[1]\"\n            , \"\"\n            , \"[1] First note.\"\n            , \"\"\n            , \"<quote>\"\n            , \"A note inside a block quote.[2]\"\n            , \"\"\n            , \"[2] The second note.\"\n            , \"\"\n            , \"A second paragraph.\"\n            , \"</quote>\"\n            , \"\"\n            , \"* Second Header\"\n            , \"\"\n            , \"Some more text.\"\n            ]\n  , test (museWithOpts defopts {writerReferenceLocation=EndOfSection})\n    \"footnotes at the end of section\" $\n    noteLocationTestDoc =?>\n    unlines [ \"* First Header\"\n            , \"\"\n            , \"This is a footnote.[1]\"\n            , \"\"\n            , \"<quote>\"\n            , \"A note inside a block quote.[2]\"\n            , \"\"\n            , \"A second paragraph.\"\n            , \"</quote>\"\n            , \"\"\n            , \"[1] First note.\"\n            , \"\"\n            , \"[2] The second note.\"\n            , \"\"\n            , \"* Second Header\"\n            , \"\"\n            , \"Some more text.\"\n            ]\n  ]\n\ntests :: [TestTree]\ntests = [ testGroup \"block elements\"\n          [ \"plain\" =: plain \"Foo bar.\" =?> \"Foo bar.\"\n          , testGroup \"paragraphs\"\n            [ \"single paragraph\" =: para \"Sample paragraph.\"\n                                 =?> \"Sample paragraph.\"\n            , \"two paragraphs\" =: para \"First paragraph.\" <>\n                                  para \"Second paragraph.\"\n                               =?> unlines [ \"First paragraph.\"\n                                           , \"\"\n                                           , \"Second paragraph.\"\n                                           ]\n            ]\n          , \"line block\" =: lineBlock [\"Foo\", \"bar\", \"baz\"]\n                         =?> unlines [ \"> Foo\"\n                                     , \"> bar\"\n                                     , \"> baz\"\n                                     ]\n          , \"code block\" =: codeBlock \"int main(void) {\\n\\treturn 0;\\n}\"\n                         =?> unlines [ \"<example>\"\n                                     , \"int main(void) {\"\n                                     , \"\\treturn 0;\"\n                                     , \"}\"\n                                     , \"</example>\"\n                                     ]\n          , \"html raw block\" =: rawBlock \"html\" \"<hr>\"\n                             =?> unlines [ \"<literal style=\\\"html\\\">\"\n                                         , \"<hr>\"\n                                         , \"</literal>\"\n                                         ]\n          , \"block quote\" =: blockQuote (para \"Foo\")\n                          =?> unlines [ \"<quote>\"\n                                      , \"Foo\"\n                                      , \"</quote>\"\n                                      ]\n          , testGroup \"lists\"\n            [ testGroup \"simple lists\"\n              [\n                \"ordered list\" =: orderedList [ plain \"first\"\n                                              , plain \"second\"\n                                              , plain \"third\"\n                                              ]\n                               =?> unlines [ \" 1. first\"\n                                           , \" 2. second\"\n                                           , \" 3. third\"\n                                           ]\n              , \"ordered list with Roman numerals\"\n                =: orderedListWith (1, UpperRoman, DefaultDelim)\n                   [ plain \"first\"\n                   , plain \"second\"\n                   , plain \"third\"\n                   ]\n                =?> unlines [ \" I. first\"\n                            , \" II. second\"\n                            , \" III. third\"\n                            ]\n              , \"bullet list\" =: bulletList [ plain \"first\"\n                                            , plain \"second\"\n                                            , plain \"third\"\n                                            ]\n                              =?> unlines [ \" - first\"\n                                          , \" - second\"\n                                          , \" - third\"\n                                          ]\n              , \"definition list\" =: definitionList [ (\"first definition\", [plain \"first description\"])\n                                                    , (\"second definition\", [plain \"second description\"])\n                                                    , (\"third definition\", [plain \"third description\"])\n                                                    ]\n                                  =?> unlines [ \" first definition :: first description\"\n                                              , \" second definition :: second description\"\n                                              , \" third definition :: third description\"\n                                              ]\n              , \"definition list with multiple descriptions\" =:\n                definitionList [ (\"first definition\", [ plain \"first description\"\n                                                      , plain \"second description\"\n                                                      ])\n                               , (\"second definition\", [plain \"third description\"])\n                               ]\n                =?> unlines [ \" first definition :: first description\"\n                            , \"                  :: second description\"\n                            , \" second definition :: third description\"\n                            ]\n              , \"definition list with empty term\" =:\n                definitionList [ (\"first definition\", [plain \"first description\"])\n                               , (mempty, [plain \"second description\"])\n                               , (str \"\", [plain \"third description\"])\n                               ]\n                =?> unlines [ \" first definition :: first description\"\n                            , \" <verbatim></verbatim> :: second description\"\n                            , \" <verbatim></verbatim> :: third description\"\n                            ]\n              , \"definition list terms starting with space\" =:\n                definitionList [ (\"first definition\", [plain \"first description\"])\n                               , (space <> str \"foo\", [plain \"second description\"])\n                               , (str \" > bar\", [plain \"third description\"])\n                               ]\n                =?> unlines [ \" first definition :: first description\"\n                            , \" <verbatim></verbatim> foo :: second description\"\n                            , \" <verbatim></verbatim> > bar :: third description\"\n                            ]\n              , \"definition list terms starting with list markers\" =:\n                definitionList [ (\"first definition\", [plain \"first description\"])\n                               , (str \"-\", [plain \"second description\"])\n                               , (str \"1.\", [plain \"third description\"])\n                               ]\n                =?> unlines [ \" first definition :: first description\"\n                            , \" <verbatim></verbatim>- :: second description\"\n                            , \" <verbatim></verbatim>1. :: third description\"\n                            ]\n              ]\n            -- Test that lists of the same type and style are separated with two blanklines\n            , testGroup \"sequential lists\"\n              [ \"bullet lists\" =:\n                bulletList [ para \"First\"\n                           , para \"Second\"\n                           , para \"Third\"\n                           ] <>\n                bulletList [ para \"Fourth\"\n                           , para \"Fifth\"\n                           ] =?>\n                unlines [ \" - First\"\n                        , \" - Second\"\n                        , \" - Third\"\n                        , \"\"\n                        , \"\"\n                        , \" - Fourth\"\n                        , \" - Fifth\"\n                        ]\n              , \"ordered lists of the same style\" =:\n                orderedListWith (1, UpperRoman, DefaultDelim) [ para \"First\"\n                                                              , para \"Second\"\n                                                              ] <>\n                orderedListWith (1, UpperRoman, DefaultDelim) [ para \"Third\"\n                                                              , para \"Fourth\"\n                                                              ] =?>\n                unlines [ \" I. First\"\n                        , \" II. Second\"\n                        , \"\"\n                        , \"\"\n                        , \" I. Third\"\n                        , \" II. Fourth\"\n                        ]\n              , \"ordered lists with equal styles\" =:\n                orderedList [ para \"First\"\n                            , para \"Second\"\n                            ] <>\n                orderedListWith (1, Decimal, DefaultDelim) [ para \"Third\"\n                                                           , para \"Fourth\"\n                                                           ] =?>\n                unlines [ \" 1. First\"\n                        , \" 2. Second\"\n                        , \"\"\n                        , \"\"\n                        , \" 1. Third\"\n                        , \" 2. Fourth\"\n                        ]\n              , \"bullet and ordered lists\" =:\n                bulletList [ para \"First\"\n                           , para \"Second\"\n                           ] <>\n                orderedListWith (1, UpperRoman, DefaultDelim) [ para \"Third\"\n                                                              , para \"Fourth\"\n                                                              ] =?>\n                unlines [ \" - First\"\n                        , \" - Second\"\n                        , \"\"\n                        , \" I. Third\"\n                        , \" II. Fourth\"\n                        ]\n              , \"different style ordered lists\" =:\n                orderedListWith (1, UpperRoman, DefaultDelim) [ para \"First\"\n                                                              , para \"Second\"\n                                                              ] <>\n                orderedListWith (1, Decimal, DefaultDelim) [ para \"Third\"\n                                                           , para \"Fourth\"\n                                                           ] =?>\n                unlines [ \" I. First\"\n                        , \" II. Second\"\n                        , \"\"\n                        , \" 1. Third\"\n                        , \" 2. Fourth\"\n                        ]\n              ]\n            , testGroup \"nested lists\"\n              [ \"nested ordered list\" =: orderedList [ plain \"First outer\"\n                                                     , plain \"Second outer:\" <>\n                                                       orderedList [ plain \"first\"\n                                                                   , plain \"second\"\n                                                                   ]\n                                                     , plain \"Third outer\"\n                                                     ]\n                                      =?> unlines [ \" 1. First outer\"\n                                                  , \" 2. Second outer:\"\n                                                  , \"    1. first\"\n                                                  , \"    2. second\"\n                                                  , \" 3. Third outer\"\n                                                  ]\n              , \"nested bullet lists\" =: bulletList [ plain \"First outer\"\n                                                    , plain \"Second outer:\" <>\n                                                      bulletList [ plain \"first\"\n                                                                 , plain \"second\"\n                                                                 ]\n                                                    , plain \"Third outer\"\n                                                    ]\n                                      =?> unlines [ \" - First outer\"\n                                                  , \" - Second outer:\"\n                                                  , \"   - first\"\n                                                  , \"   - second\"\n                                                  , \" - Third outer\"\n                                                  ]\n              , \"nested definition lists\" =: definitionList [ (\"first definition\", [plain \"first description\"])\n                                                            , (\"second definition\",\n                                                               [ plain \"second description\" <>\n                                                                 definitionList [ (\"first inner definition\"\n                                                                                  , [plain \"first inner description\"])\n                                                                                , ( \"second inner definition\"\n                                                                                  , [plain \"second inner description\"])\n                                                                                ]\n                                                               ]\n                                                              )\n                                                            ]\n                                          =?> unlines [ \" first definition :: first description\"\n                                                      , \" second definition :: second description\"\n                                                      , \"                      first inner definition :: first inner description\"\n                                                      , \"                      second inner definition :: second inner description\"\n                                                      ]\n              , \"list item starting with list\" =: bulletList [ bulletList [ plain \"foo\"] ] =?> \" - - foo\"\n              ]\n            -- Check that list is intended with one space even inside a quote\n            , \"List inside block quote\" =: blockQuote (orderedList [ plain \"first\"\n                                                                   , plain \"second\"\n                                                                   , plain \"third\"\n                                                                   ])\n                                        =?> unlines [ \"<quote>\"\n                                                    , \" 1. first\"\n                                                    , \" 2. second\"\n                                                    , \" 3. third\"\n                                                    , \"</quote>\"\n                                                    ]\n            ]\n          , testGroup \"headings\"\n            [ \"normal heading\" =:\n              header 1 \"foo\" =?> \"* foo\"\n            , \"heading levels\" =:\n              header 1 \"First level\" <>\n              header 3 \"Third level\" =?>\n              unlines [ \"* First level\"\n                      , \"\"\n                      , \"*** Third level\"\n                      ]\n            , \"heading with ID\" =:\n               headerWith (\"bar\", [], []) 2 \"Foo\" =?>\n               unlines [ \"#bar\"\n                       , \"** Foo\"\n                      ]\n            , \"empty heading\" =: header 4 mempty =?> \"**** <verbatim></verbatim>\"\n            ]\n          , \"horizontal rule\" =: horizontalRule =?> \"----\"\n          , \"escape horizontal rule\" =: para \"----\" =?> \"<verbatim></verbatim>----\"\n          , \"escape long horizontal rule\" =: para \"----------\" =?> \"<verbatim></verbatim>----------\"\n          , \"don't escape horizontal inside paragraph\" =: para \"foo ---- bar\" =?> \"foo ---- bar\"\n          , \"escape nonbreaking space\" =: para \"~~\" =?> \"<verbatim>~~</verbatim>\"\n          , \"escape > in the beginning of line\" =: para \"> foo bar\" =?> \"<verbatim></verbatim>> foo bar\"\n          , \"escape string with > and space in the beginning of line\" =: para (str \"> foo bar\") =?> \"<verbatim></verbatim>> foo bar\"\n          , testGroup \"tables\"\n            [ \"table without header\" =:\n              let rows = [[para \"Para 1.1\", para \"Para 1.2\"]\n                         ,[para \"Para 2.1\", para \"Para 2.2\"]]\n                  toRow = Row nullAttr . map simpleCell\n              in table emptyCaption\n                       [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)]\n                       (TableHead nullAttr [toRow [mempty, mempty]])\n                       [TableBody nullAttr 0 [] $ map toRow rows]\n                       (TableFoot nullAttr [])\n              =?>\n              unlines [ \" Para 1.1 | Para 1.2\"\n                      , \" Para 2.1 | Para 2.2\"\n                      ]\n            , \"table with header\" =:\n              let headers = [plain \"header 1\", plain \"header 2\"]\n                  rows = [[para \"Para 1.1\", para \"Para 1.2\"]\n                         ,[para \"Para 2.1\", para \"Para 2.2\"]]\n              in simpleTable headers rows\n              =?>\n              unlines [ \" header 1 || header 2\"\n                      , \" Para 1.1 |  Para 1.2\"\n                      , \" Para 2.1 |  Para 2.2\"\n                      ]\n            , \"table with header and caption\" =:\n              let capt = simpleCaption $ plain \"Table 1\"\n                  toRow = Row nullAttr . map simpleCell\n                  headers = [toRow [plain \"header 1\", plain \"header 2\"]]\n                  rows = map toRow [[para \"Para 1.1\", para  \"Para 1.2\"]\n                                   ,[para \"Para 2.1\", para  \"Para 2.2\"]]\n              in table capt\n                       [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)]\n                       (TableHead nullAttr headers)\n                       [TableBody nullAttr 0 [] rows]\n                       (TableFoot nullAttr [])\n              =?> unlines [ \" header 1 || header 2\"\n                          , \" Para 1.1 |  Para 1.2\"\n                          , \" Para 2.1 |  Para 2.2\"\n                          , \" |+ Table 1 +|\"\n                          ]\n            , \"table inside bullet list\" =:\n              bulletList [simpleTable [] [[para \"foo\", para \"bar\"]\n                                         ,[para \"bat\", para \"baz\"]]]\n              =?> unlines [ \" - foo | bar\"\n                          , \"   bat | baz\"\n                          ]\n            , \"table with one column\" =:\n              let headers = []\n                  rows = [[para \"Para 1\"]\n                         ,[para \"Para 2\"]]\n              in simpleTable headers rows\n              =?>\n              unlines [ \"+--------+\"\n                      , \"| Para 1 |\"\n                      , \"+--------+\"\n                      , \"| Para 2 |\"\n                      , \"+--------+\"\n                      ]\n            ]\n          , \"div with bullet list\" =:\n            divWith nullAttr (bulletList [para \"foo\"]) =?>\n            unlines [ \" - foo\" ] -- Making sure bullets are indented\n          ]\n        , testGroup \"inline elements\"\n          [ testGroup \"string\"\n            [ \"string\" =: str \"foo\" =?> \"foo\"\n            , \"escape footnote\" =: str \"[1]\" =?> \"<verbatim>[1]</verbatim>\"\n            , \"escape secondary note\" =: str \"{1}\" =?> \"<verbatim>{1}</verbatim>\"\n            , \"do not escape brackets\" =: str \"[12ab]\" =?> \"[12ab]\"\n            , \"escape verbatim close tag\" =: str \"foo</verbatim>bar\"\n               =?> \"<verbatim>foo<</verbatim><verbatim>/verbatim>bar</verbatim>\"\n            , \"escape link-like text\" =: str \"[[https://www.example.org]]\"\n               =?> \"<verbatim>[[https://www.example.org]]</verbatim>\"\n            , \"escape pipe to avoid accidental tables\" =: str \"foo | bar\"\n               =?> \"<verbatim>foo | bar</verbatim>\"\n            , \"escape hash to avoid accidental anchors\" =: text \"#foo bar\"\n              =?> \"<verbatim>#foo</verbatim> bar\"\n            , \"escape definition list markers\" =: str \"::\" =?> \"<verbatim>::</verbatim>\"\n            , \"normalize strings before escaping\" =: fromList [Str \":\", Str \":\"] =?> \"<verbatim>::</verbatim>\"\n            -- We don't want colons to be escaped if they can't be confused\n            -- with definition list item markers.\n            , \"do not escape colon\" =: str \":\" =?> \":\"\n            , \"escape - to avoid accidental unordered lists\" =: text \" - foo\" =?> \"<verbatim></verbatim> - foo\"\n            , \"escape - inside a list to avoid accidental nested unordered lists\" =:\n              bulletList [ para \"foo\" <>\n                           para \"- bar\"\n                         ] =?>\n              unlines [ \" - foo\"\n                      , \"\"\n                      , \"   <verbatim></verbatim>- bar\"\n                      ]\n            , \"escape strings starting with - inside a list\" =:\n              bulletList [ para (str \"foo\") <>\n                           para (str \"- bar\")\n                         ] =?>\n              unlines [ \" - foo\"\n                      , \"\"\n                      , \"   <verbatim></verbatim>- bar\"\n                      ]\n            , \"escape - inside a note\" =:\n              note (para \"- foo\") =?>\n              unlines [ \"[1]\"\n                      , \"\"\n                      , \"[1] <verbatim></verbatim>- foo\"\n                      ]\n            , \"escape - after softbreak in note\" =:\n              note (para (str \"foo\" <> softbreak <> str \"- bar\")) =?>\n              unlines [ \"[1]\"\n                      , \"\"\n                      , \"[1] foo\"\n                      , \"    <verbatim></verbatim>- bar\"\n                      ]\n            , \"escape ; to avoid accidental comments\" =: text \"; foo\" =?> \"<verbatim></verbatim>; foo\"\n            , \"escape strings starting with ; and space\" =: str \"; foo\" =?> \"<verbatim></verbatim>; foo\"\n            , \"escape ; after softbreak\" =: \"foo\" <> softbreak <> \"; bar\" =?> \"foo\\n<verbatim></verbatim>; bar\"\n            , \"escape ; after linebreak\" =: \"foo\" <> linebreak <> \"; bar\" =?> \"foo<br>\\n<verbatim></verbatim>; bar\"\n            , \"do not escape ; inside paragraph\" =: text \"foo ; bar\" =?> \"foo ; bar\"\n            , \"escape newlines\" =: str \"foo\\nbar\" =?> \"foo bar\"\n            ]\n          , testGroup \"emphasis\"\n            [ \"emphasis\" =: emph \"foo\" =?> \"*foo*\"\n            , \"emphasis inside word\" =: \"foo\" <> emph \"bar\" <> \"baz\" =?> \"foo<em>bar</em>baz\"\n            , \"emphasis before comma\" =: emph \"foo\" <> \", bar\" =?> \"*foo*, bar\"\n            , \"emphasis before period\" =: emph \"foobar\" <> \".\" =?> \"*foobar*.\"\n            , \"empty emphasis\" =: emph mempty =?> \"<em></em>\"\n            , \"empty strong\" =: strong mempty =?> \"<strong></strong>\"\n            , \"empty strong emphasis\" =: strong (emph mempty) =?> \"**<em></em>**\"\n            , \"empty emphasized strong\" =: emph (strong mempty) =?> \"*<strong></strong>*\"\n            , \"emphasized empty string\" =: emph (str \"\") =?> \"<em></em>\"\n            , \"strong empty string\" =: strong (str \"\") =?> \"<strong></strong>\"\n            , \"strong emphasized empty string\" =: strong (emph (str \"\")) =?> \"**<em></em>**\"\n            , \"emphasized strong empty string\" =: emph (strong (str \"\")) =?> \"*<strong></strong>*\"\n            , \"emphasized string with space\" =: emph (str \" \") =?> \"<em> </em>\"\n            , \"emphasized string ending with space\" =: emph (str \"foo \") =?> \"<em>foo </em>\"\n            , \"emphasized string with tab\" =: emph (str \"\\t\") =?> \"<em>\\t</em>\"\n            , \"emphasized space between empty strings\" =: emph (str \"\" <> space <> str \"\") =?> \"<em> </em>\"\n            , \"strong\" =: strong \"foo\" =?> \"**foo**\"\n            , \"strong inside word\" =: \"foo\" <> strong \"bar\" <> \"baz\" =?> \"foo<strong>bar</strong>baz\"\n            , \"strong emphasis\" =: strong (emph \"foo\") =?> \"***foo***\"\n            , \"strong after emphasis\" =: emph \"foo\" <> strong \"bar\" =?> \"*foo*<strong>bar</strong>\"\n            , \"strong emphasis after emphasis\" =: emph \"foo\" <> strong (emph \"bar\") =?> \"*foo*<strong>*bar*</strong>\"\n            , \"strong in the end of emphasis\" =: emph (\"foo\" <> strong \"bar\") =?> \"*foo<strong>bar</strong>*\"\n            , \"switch to lightweight markup after <em> tag\" =:\n              strong (str \"foo\") <> emph (str \"bar\") <> strong (str \"baz\") =?>\n              \"**foo**<em>bar</em>**baz**\"\n            , \"strikeout\" =: strikeout \"foo\" =?> \"<del>foo</del>\"\n            , \"space at the beginning of emphasis\" =: emph \" foo\" =?> \"<em> foo</em>\"\n            , \"space at the end of emphasis\" =: emph \"foo \" =?> \"<em>foo </em>\"\n            , \"space at the beginning of strong\" =: strong \" foo\" =?> \"<strong> foo</strong>\"\n            , \"space at the end of strong\" =: strong \"foo \" =?> \"<strong>foo </strong>\"\n            , \"space at the beginning of strong emphasis\" =: strong (emph \" foo\") =?> \"**<em> foo</em>**\"\n            , \"space at the end of strong emphasis\" =: strong (emph \"foo \") =?> \"**<em>foo </em>**\"\n            , \"space at the beginning of emphasiszed strong\" =: emph (strong \" foo\") =?> \"*<strong> foo</strong>*\"\n            , \"space at the end of emphasized strong\" =: emph (strong \"foo \") =?> \"*<strong>foo </strong>*\"\n            ]\n          , \"superscript\" =: superscript \"foo\" =?> \"<sup>foo</sup>\"\n          , \"subscript\" =: subscript \"foo\" =?> \"<sub>foo</sub>\"\n          , \"smallcaps\" =: smallcaps \"foo\" =?> \"*foo*\"\n          , \"smallcaps near emphasis\" =: emph (str \"foo\") <> smallcaps (str \"bar\") =?> \"*foobar*\"\n          , \"single quoted\" =: singleQuoted \"foo\" =?> \"‘foo’\"\n          , \"double quoted\" =: doubleQuoted \"foo\" =?> \"“foo”\"\n          -- Cite is trivial\n          , testGroup \"code\"\n            [ \"simple\" =: code \"foo\" =?> \"=foo=\"\n            , \"empty\" =: code \"\" =?> \"<code></code>\"\n            , \"space\" =: code \" \" =?> \"<code> </code>\"\n            , \"space at the beginning\" =: code \" foo\" =?> \"<code> foo</code>\"\n            , \"space at the end\" =: code \"foo \" =?> \"<code>foo </code>\"\n            , \"use tags for =\" =: code \"foo = bar\" =?> \"<code>foo = bar</code>\"\n            , \"escape tag\" =: code \"<code>foo = bar</code> baz\" =?> \"<code><code>foo = bar<</code><code>/code> baz</code>\"\n            , \"normalization with attributes\" =: codeWith (\"\",[\"haskell\"],[]) \"foo\" <> code \"bar\" =?> \"=foobar=\"\n            , \"code tag\" =: code \"<code>foo</code>\" =?> \"=<code>foo</code>=\"\n            , \"normalization\" =: code \"</co\" <> code \"de>\" <> code \"=\" =?> \"<code><</code><code>/code>=</code>\"\n            , \"normalization with empty string\" =: code \"</co\" <> str \"\" <> code \"de>\" <> code \"=\" =?> \"<code><</code><code>/code>=</code>\"\n            , \"emphasized code\" =: emph (code \"foo\") =?> \"*=foo=*\"\n            , \"strong code\" =: strong (code \"foo\") =?> \"**=foo=**\"\n            ]\n          , testGroup \"spaces\"\n            [ \"space\" =: \"a\" <> space <> \"b\" =?> \"a b\"\n            , \"soft break\" =: \"a\" <> softbreak <> \"b\" =?> \"a\\nb\"\n            , test (museWithOpts def{ writerWrapText = WrapNone })\n                   \"remove soft break\" $ \"a\" <> softbreak <> \"b\"\n                   =?> (\"a b\" :: String)\n            , \"line break\" =: \"a\" <> linebreak <> \"b\" =?> \"a<br>\\nb\"\n            , \"line break at the end\" =: \"a\" <> linebreak =?> \"a<br>\"\n            , \"no newline after line break in header\" =: header 1 (\"a\" <> linebreak <> \"b\") =?> \"* a<br>b\"\n            , \"no softbreak in header\" =: header 1 (\"a\" <> softbreak <> \"b\") =?> \"* a b\"\n            ]\n          , testGroup \"math\"\n            [ \"inline math\" =: math \"2^3\" =?> \"2<sup>3</sup>\"\n            , \"display math\" =: displayMath \"2^3\" =?> \"2<sup>3</sup>\"\n            , \"multiple letters in inline math\" =: math \"abc\" =?> \"*abc*\"\n            , \"expand math before normalization\" =: math \"[\" <> str \"2]\" =?> \"<verbatim>[2]</verbatim>\"\n            , \"multiple math expressions inside one inline list\" =: math \"5_4\" <> \", \" <> displayMath \"3^2\" =?> \"5<sub>4</sub>, 3<sup>2</sup>\"\n            ]\n          , \"raw inline\"\n            =: rawInline \"html\" \"<mark>marked text</mark>\"\n            =?> \"<literal style=\\\"html\\\"><mark>marked text</mark></literal>\"\n          , testGroup \"links\"\n            [ \"link with description\" =: link \"https://example.com\" \"\" (str \"Link 1\")\n                                      =?> \"[[https://example.com][Link 1]]\"\n            , \"link without description\" =: link \"https://example.com\" \"\" (str \"https://example.com\")\n                                         =?> \"[[https://example.com]]\"\n            -- Internal links in Muse include '#'\n            , \"link to anchor\" =: link \"#intro\" \"\" (str \"Introduction\")\n                               =?> \"[[#intro][Introduction]]\"\n            -- According to Emacs Muse manual, links to images should be prefixed with \"URL:\"\n            , \"link to image with description\" =: link \"1.png\" \"\" (str \"Link to image\")\n                                               =?> \"[[URL:1.png][Link to image]]\"\n            , \"link to image without description\" =: link \"1.png\" \"\" (str \"1.png\")\n                                                  =?> \"[[URL:1.png]]\"\n\n            , testGroup \"escape brackets in links\"\n              [ \"link with description\"\n                =: link \"https://example.com/foo].txt\" \"\" (str \"Description\")\n                =?> \"[[https://example.com/foo%5D.txt][Description]]\"\n              , \"link without description\"\n                =: link \"https://example.com/foo].txt\" \"\" (str \"https://example.com/foo].txt\")\n                =?> \"[[https://example.com/foo%5D.txt][<verbatim>https://example.com/foo].txt</verbatim>]]\"\n              , \"image link with description\"\n                =: link \"foo]bar.png\" \"\" (str \"Image link\")\n                =?> \"[[URL:foo%5Dbar.png][Image link]]\"\n              , \"image link without description\"\n                =: link \"foo]bar.png\" \"\" (str \"foo]bar.png\")\n                =?> \"[[URL:foo%5Dbar.png][<verbatim>foo]bar.png</verbatim>]]\"\n              ]\n            ]\n          , \"image\" =: image \"image.png\" \"Image 1\" (str \"\") =?> \"[[image.png][Image 1]]\"\n          , \"image with width\" =:\n            imageWith (\"\", [], [(\"width\", \"60%\")]) \"image.png\" \"Image\" (str \"\") =?>\n            \"[[image.png 60][Image]]\"\n          , \"left-aligned image with width\" =:\n            imageWith (\"\", [\"align-left\"], [(\"width\", \"60%\")]) \"image.png\" \"Image\" (str \"\") =?>\n            \"[[image.png 60 l][Image]]\"\n          , \"right-aligned image with width\" =:\n            imageWith (\"\", [\"align-right\"], [(\"width\", \"60%\")]) \"image.png\" \"Image\" (str \"\") =?>\n            \"[[image.png 60 r][Image]]\"\n          , \"escape brackets in image title\" =: image \"image.png\" \"Foo]bar\" (str \"\") =?> \"[[image.png][<verbatim>Foo]bar</verbatim>]]\"\n          , \"note\" =: note (plain \"Foo\")\n                   =?> unlines [ \"[1]\"\n                               , \"\"\n                               , \"[1] Foo\"\n                               ]\n          , noteLocationTests\n          , \"span with class\" =: spanWith (\"\",[\"foobar\"],[]) \"Some text\"\n                              =?> \"<class name=\\\"foobar\\\">Some text</class>\"\n          , \"span without class\" =: spanWith (\"\",[],[]) \"Some text\"\n                                 =?> \"<class>Some text</class>\"\n          , \"span with anchor\" =: spanWith (\"anchor\", [], []) mempty <> \"Foo bar\"\n                               =?> \"#anchor Foo bar\"\n          , \"empty span with anchor\" =: spanWith (\"anchor\", [], []) mempty\n                                     =?> \"#anchor\"\n          , \"empty span without class and anchor\" =: spanWith (\"\", [], []) mempty\n                                                  =?> \"<class></class>\"\n          , \"span with class and anchor\" =: spanWith (\"anchor\", [\"foo\"], []) \"bar\"\n                                         =?> \"#anchor <class name=\\\"foo\\\">bar</class>\"\n          , \"adjacent spans\" =: spanWith (\"\", [\"syllable\"], []) (str \"wa\") <>\n                                spanWith (\"\", [\"syllable\"], []) (str \"ter\")\n                             =?> \"<class name=\\\"syllable\\\">wa</class><class name=\\\"syllable\\\">ter</class>\"\n          , testGroup \"RTL\"\n            [ \"RTL span\" =: spanWith (\"\",[],[(\"dir\", \"rtl\")]) (text \"foo bar\") =?> \"<<<foo bar>>>\"\n            , \"LTR span\" =: spanWith (\"\",[],[(\"dir\", \"ltr\")]) (text \"foo bar\") =?> \">>>foo bar<<<\"\n            , \"RTL span with a class\" =: spanWith (\"\",[\"foobar\"],[(\"dir\", \"rtl\")]) (text \"foo bar\") =?> \"<class name=\\\"foobar\\\"><<<foo bar>>></class>\"\n            , \"LTR span with a class\" =: spanWith (\"\",[\"foobar\"],[(\"dir\", \"ltr\")]) (text \"foo bar\") =?> \"<class name=\\\"foobar\\\">>>>foo bar<<<</class>\"\n            , \"Escape <<< and >>>\" =: plain (text \"<<< foo bar >>>\") =?> \"<verbatim><<<</verbatim> foo bar <verbatim>>>></verbatim>\"\n            ]\n          , testGroup \"combined\"\n            [ \"emph word before\" =:\n                para (\"foo\" <> emph \"bar\") =?>\n                    \"foo<em>bar</em>\"\n            , \"emph word after\" =:\n                para (emph \"foo\" <> \"bar\") =?>\n                    \"<em>foo</em>bar\"\n            , \"emph quoted\" =:\n                para (doubleQuoted (emph \"foo\")) =?>\n                    \"“*foo*”\"\n            , \"strong word before\" =:\n                para (\"foo\" <> strong \"bar\") =?>\n                    \"foo<strong>bar</strong>\"\n            , \"strong word after\" =:\n                para (strong \"foo\" <> \"bar\") =?>\n                    \"<strong>foo</strong>bar\"\n            , \"strong quoted\" =:\n                para (singleQuoted (strong \"foo\")) =?>\n                    \"‘**foo**’\"\n            ]\n         ]\n       ]\n"
  },
  {
    "path": "test/Tests/Writers/Native.hs",
    "content": "module Tests.Writers.Native (tests) where\n\nimport Data.Text (unpack)\nimport Test.Tasty\nimport Test.Tasty.QuickCheck\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\n\np_write_rt :: Pandoc -> Bool\np_write_rt d =\n  read (unpack $ purely (writeNative def{ writerTemplate = Just mempty }) d) == d\n\np_write_blocks_rt :: [Block] -> Bool\np_write_blocks_rt bs =\n  read (unpack $ purely (writeNative def) (Pandoc nullMeta bs)) == bs\n\ntests :: [TestTree]\ntests = [ testProperty \"p_write_rt\" p_write_rt\n        , testProperty \"p_write_blocks_rt\" $ mapSize\n             (\\x -> if x > 3 then 3 else x) p_write_blocks_rt\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/OOXML.hs",
    "content": "{-# LANGUAGE PatternGuards     #-}\n{-# LANGUAGE OverloadedStrings #-}\n\nmodule Tests.Writers.OOXML (ooxmlTest) where\n\nimport Text.Pandoc hiding (Attr)\nimport Test.Tasty\nimport Test.Tasty.Golden.Advanced\nimport Control.Applicative ((<|>))\nimport Codec.Archive.Zip\nimport Text.XML.Light\nimport qualified Data.ByteString as BS\nimport qualified Data.ByteString.Lazy as BL\nimport Data.Foldable (asum)\nimport qualified Data.Text.IO as T\nimport Data.List (isSuffixOf, sort, (\\\\), intercalate, union)\nimport Data.Maybe (catMaybes, mapMaybe)\nimport Tests.Helpers\nimport Data.Algorithm.Diff\nimport System.FilePath.Glob (compile, match)\n\ncompareXML :: Content -> Content -> Maybe XMLDifference\n-- We make a special exception for times at the moment, and just pass\n-- them because we can't control the utctime when running IO. Besides,\n-- so long as we have two times, we're okay.\ncompareXML (Elem goodElem) (Elem myElem)\n  | (QName \"created\" _ (Just \"dcterms\")) <- elName myElem\n  , (QName \"created\" _ (Just \"dcterms\")) <- elName goodElem =\n      Nothing\ncompareXML (Elem goodElem) (Elem myElem)\n  | (QName \"modified\" _ (Just \"dcterms\")) <- elName myElem\n  , (QName \"modified\" _ (Just \"dcterms\")) <- elName goodElem =\n      Nothing\ncompareXML (Elem goodElem) (Elem myElem) =\n  (if elName myElem == elName goodElem\n   then Nothing\n   else Just\n    (ElemNamesDiffer\n     (Comparison {mine = elName myElem, good = elName goodElem}))\n  )\n  <|> (if sort (elAttribs myElem) == sort (elAttribs goodElem)\n   then Nothing\n   else Just\n    (ElemAttributesDiffer\n     (Comparison { mine = sort (elAttribs myElem)\n                 , good = sort (elAttribs goodElem)\n                 })))\n  <|> (if length (elContent myElem) == length (elContent goodElem)\n   then Nothing\n   else Just\n    (ElemChildrenDiffer\n      (Comparison { mine = elContent myElem, good = elContent goodElem})))\n  <|> asum (zipWith compareXML (elContent myElem) (elContent goodElem))\ncompareXML (Text goodCData) (Text myCData) =\n  (if cdVerbatim myCData == cdVerbatim goodCData\n    && cdData myCData == cdData goodCData\n   then Nothing\n   else Just (CDatasDiffer (Comparison { mine = myCData, good = goodCData })))\ncompareXML (CRef goodStr) (CRef myStr) =\n  if myStr == goodStr\n  then Nothing\n  else Just (CRefsDiffer (Comparison { mine = myStr, good = goodStr }))\ncompareXML g m = Just (OtherContentsDiffer (Comparison {mine = m, good = g}))\n\ndata XMLDifference\n  = ElemNamesDiffer (Comparison QName)\n  | ElemAttributesDiffer (Comparison [Attr])\n  | ElemChildrenDiffer (Comparison [Content])\n  | CDatasDiffer (Comparison CData)\n  | CRefsDiffer (Comparison String)\n  | OtherContentsDiffer (Comparison Content)\n  deriving (Show)\n\ndata Comparison a = Comparison { good :: a, mine :: a }\n  deriving (Show)\n\ndisplayDiff :: Element -> Element -> String\ndisplayDiff elemA elemB =\n  showDiff (1,1)\n    (getDiff (lines $ ppElement elemA) (lines $ ppElement elemB))\n\ngoldenArchive :: FilePath -> IO Archive\ngoldenArchive fp = toArchive . BL.fromStrict <$> BS.readFile fp\n\ntestArchive :: (WriterOptions -> Pandoc -> PandocIO BL.ByteString)\n            -> WriterOptions\n            -> FilePath\n            -> IO Archive\ntestArchive writerFn opts fp = do\n  txt <- T.readFile fp\n  bs <- runIOorExplode $ do\n    setTranslations \"en-US\"\n    setVerbosity ERROR -- otherwise test output is confusingly noisy\n    readNative def txt >>= writerFn opts\n  return $ toArchive bs\n\ncompareFileList :: FilePath -> Archive -> Archive -> Maybe String\ncompareFileList goldenFP goldenArch testArch =\n  let testFiles = filesInArchive testArch\n      goldenFiles = filesInArchive goldenArch\n      diffTestGolden = testFiles \\\\ goldenFiles\n      diffGoldenTest = goldenFiles \\\\ testFiles\n\n      results =\n        [ if null diffGoldenTest\n          then Nothing\n          else Just $\n               \"Files in \" ++ goldenFP ++ \" but not in generated archive:\\n\" ++\n               intercalate \", \" diffGoldenTest\n        , if null diffTestGolden\n          then Nothing\n          else Just $\n               \"Files in generated archive but not in \" ++ goldenFP ++ \":\\n\" ++\n               intercalate \", \" diffTestGolden\n        ]\n  in\n    if null $ catMaybes results\n    then Nothing\n    else Just $ intercalate \"\\n\" $ catMaybes results\n\ncompareXMLFile' :: FilePath -> Archive -> Archive -> Either String ()\ncompareXMLFile' fp goldenArch testArch = do\n  testEntry <- case findEntryByPath fp testArch of\n                 Just entry -> Right entry\n                 Nothing -> Left $\n                   \"Can't extract \" ++ fp ++ \" from generated archive\"\n  testXMLDoc <- case parseXMLDoc $ fromEntry testEntry of\n                  Just doc -> Right doc\n                  Nothing -> Left $\n                    \"Can't parse xml in  \" ++ fp ++ \" from generated archive\"\n\n  goldenEntry <- case findEntryByPath fp goldenArch of\n                 Just entry -> Right entry\n                 Nothing -> Left $\n                   \"Can't extract \" ++ fp ++ \" from archive in stored file\"\n  goldenXMLDoc <- case parseXMLDoc $ fromEntry goldenEntry of\n                  Just doc -> Right doc\n                  Nothing -> Left $\n                    \"Can't parse xml in  \" ++ fp ++ \" from archive in stored file\"\n\n  let testContent = Elem testXMLDoc\n      goldenContent = Elem goldenXMLDoc\n      display difference = \"Non-matching xml in \"\n        ++ fp ++ \":\\n\"\n        ++ \"* \" ++ show difference ++ \"\\n\"\n        ++ displayDiff testXMLDoc goldenXMLDoc\n\n\n  maybe (Right ()) (Left . display) (compareXML goldenContent testContent)\n\ncompareXMLFile :: FilePath -> Archive -> Archive -> Maybe String\ncompareXMLFile fp goldenArch testArch =\n  case compareXMLFile' fp goldenArch testArch of\n    Right _ -> Nothing\n    Left s -> Just s\n\ncompareAllXMLFiles :: Archive -> Archive -> Maybe String\ncompareAllXMLFiles goldenArch testArch =\n  let allFiles = filesInArchive goldenArch `union` filesInArchive testArch\n      allXMLFiles = sort $\n        filter\n        (\\fp -> \".xml\" `isSuffixOf` fp || \".rels\" `isSuffixOf` fp)\n        allFiles\n      results =\n        mapMaybe (\\fp -> compareXMLFile fp goldenArch testArch) allXMLFiles\n  in\n    if null results\n    then Nothing\n    else Just $ unlines results\n\ncompareMediaFile' :: FilePath -> Archive -> Archive -> Either String ()\ncompareMediaFile' fp goldenArch testArch = do\n  testEntry <- case findEntryByPath fp testArch of\n                 Just entry -> Right entry\n                 Nothing -> Left $\n                   \"Can't extract \" ++ fp ++ \" from generated archive\"\n  goldenEntry <- case findEntryByPath fp goldenArch of\n                 Just entry -> Right entry\n                 Nothing -> Left $\n                   \"Can't extract \" ++ fp ++ \" from archive in stored file\"\n\n  if fromEntry testEntry == fromEntry goldenEntry\n    then Right ()\n    else Left $\n    \"Non-matching binary file: \" ++ fp\n\ncompareMediaFile :: FilePath -> Archive -> Archive -> Maybe String\ncompareMediaFile fp goldenArch testArch =\n  case compareMediaFile' fp goldenArch testArch of\n    Right _ -> Nothing\n    Left s -> Just s\n\ncompareAllMediaFiles :: Archive -> Archive -> Maybe String\ncompareAllMediaFiles goldenArch testArch =\n  let allFiles = filesInArchive goldenArch `union` filesInArchive testArch\n      mediaPattern = compile \"*/media/*\"\n      allMediaFiles = sort $\n        filter (match mediaPattern) allFiles\n      results =\n        mapMaybe (\\fp -> compareMediaFile fp goldenArch testArch) allMediaFiles\n  in\n    if null results\n    then Nothing\n    else Just $ unlines results\n\nooxmlTest :: (WriterOptions -> Pandoc -> PandocIO BL.ByteString)\n          -> String\n          -> WriterOptions\n          -> FilePath\n          -> FilePath\n          -> TestTree\nooxmlTest writerFn testName opts nativeFP goldenFP =\n  goldenTest\n  testName\n  (goldenArchive goldenFP)\n  (testArchive writerFn opts nativeFP)\n  (\\goldenArch testArch ->\n     let res = catMaybes [ compareFileList goldenFP goldenArch testArch\n                         , compareAllXMLFiles goldenArch testArch\n                         , compareAllMediaFiles goldenArch testArch\n                         ]\n     in return $ if null res then Nothing else Just $ unlines res)\n  (\\a -> BL.writeFile goldenFP $ fromArchive a)\n"
  },
  {
    "path": "test/Tests/Writers/Org.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Org (tests) where\n\nimport Data.Text as T\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, Text) -> TestTree\n(=:) = test org\n\ndefopts :: WriterOptions\ndefopts = def\n  { writerExtensions = getDefaultExtensions \"org\"\n  }\n\norg :: (ToPandoc a) => a -> Text\norg = orgWithOpts defopts\n\norgWithOpts :: (ToPandoc a) => WriterOptions -> a -> Text\norgWithOpts opts x = purely (writeOrg opts) $ toPandoc x\n\n\ntests :: [TestTree]\ntests =\n  [ testGroup \"links\"\n    -- See http://orgmode.org/manual/Internal-links.html#Internal-links\n    [ \"simple link\"\n      =: link \"/url\" \"\" \"foo\"\n      =?> \"[[/url][foo]]\"\n    , \"internal link to anchor\"\n      =: link \"#my-custom-id\" \"\" \"#my-custom-id\"\n      =?> \"[[#my-custom-id]]\"\n    ]\n\n  , testGroup \"lists\"\n    [ \"bullet task list\"\n      =: bulletList [plain \"☐ a\", plain \"☒ b\"]\n      =?> T.unlines\n          [ \"- [ ] a\"\n          , \"- [X] b\"\n          ]\n    , \"ordered task list\"\n      =: orderedList [plain (\"☐\" <> space <> \"a\"), plain \"☒ b\"]\n      =?> T.unlines\n          [ \"1. [ ] a\"\n          , \"2. [X] b\"\n          ]\n    , \"ordered task list with starting number\"\n      =: orderedListWith\n         (9, DefaultStyle, DefaultDelim)\n         [plain (\"☐\" <> space <> \"a\"), plain \"☒ b\"]\n      =?> T.unlines\n          [ \"9. [@9] [ ] a\"\n          , \"10. [X] b\"\n          ]\n    , test (orgWithOpts def) \"bullet without task_lists\" $\n      bulletList [plain \"☐ a\", plain \"☒ b\"]\n      =?> T.unlines\n          [ \"- ☐ a\"\n          , \"- ☒ b\"\n          ]\n    ]\n\n  , testGroup \"code blocks\"\n    [ \"identifier\"\n      =: codeBlockWith (\"abc\", [\"python\"], []) \"return True\"\n      =?> T.unlines\n      [ \"#+name: abc\"\n      , \"#+begin_src python\"\n      , \"return True\"\n      , \"#+end_src\"\n      ]\n\n    , \"attributes\"\n      =: codeBlockWith (\"\", [\"python\"], [(\"cache\", \"yes\"), (\"noweb\", \"yes\")])\n                       \"'Hello'\"\n      =?> T.unlines\n      [ \"#+begin_src python :cache yes :noweb yes\"\n      , \"'Hello'\"\n      , \"#+end_src\"\n      ]\n    ]\n  ]\n"
  },
  {
    "path": "test/Tests/Writers/Plain.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.Plain (tests) where\n\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test (purely (writePlain def{ writerExtensions =\n                          enableExtension Ext_gutenberg plainExtensions }) .\n                      toPandoc)\n\n\ntests :: [TestTree]\ntests = [ \"strongly emphasized text to uppercase\"\n             =: strong \"Straße\"\n             =?> \"STRASSE\"\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/Powerpoint.hs",
    "content": "module Tests.Writers.Powerpoint (tests) where\n\nimport Control.Arrow ((***))\nimport Tests.Writers.OOXML (ooxmlTest)\nimport Text.Pandoc\nimport Test.Tasty\nimport System.FilePath\nimport Text.DocTemplates (ToContext(toVal), Context(..))\nimport qualified Data.Map as M\nimport Data.Text (pack)\n\n-- templating is important enough, and can break enough things, that\n-- we want to run all our tests with both default formatting and a\n-- template.\n\nmodifyPptxName :: FilePath -> String -> FilePath\nmodifyPptxName fp suffix =\n  addExtension (takeDirectory fp ++ suffix) \"pptx\"\n\npptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree)\npptxTests name opts native pptx =\n  let referenceDoc = \"pptx/reference-depth.pptx\"\n  in\n    ( ooxmlTest\n      writePowerpoint\n      name\n      opts{writerReferenceDoc=Nothing}\n      native\n      pptx\n    , ooxmlTest\n      writePowerpoint\n      name\n      opts{writerReferenceDoc=Just referenceDoc}\n      native\n      (modifyPptxName pptx \"/templated\")\n    )\n\ngroupPptxTests :: [(TestTree, TestTree)] -> [TestTree]\ngroupPptxTests pairs =\n  let (noRefs, refs) = unzip pairs\n  in\n    [ testGroup \"Default slide formatting\" noRefs\n    , testGroup \"With `--reference-doc` pptx file\" refs\n    ]\n\ntestGroup' :: String -> [(TestTree, TestTree)] -> (TestTree, TestTree)\ntestGroup' descr = (testGroup descr *** testGroup descr) . unzip\n\n\ntests :: [TestTree]\ntests = let\n  regularTests = groupPptxTests\n    [ pptxTests \"Inline formatting\"\n      def\n      \"pptx/inline-formatting/input.native\"\n      \"pptx/inline-formatting/output.pptx\"\n    , pptxTests \"Slide breaks (default slide-level)\"\n      def\n      \"pptx/slide-breaks/input.native\"\n      \"pptx/slide-breaks/output.pptx\"\n    , pptxTests \"slide breaks (slide-level set to 1)\"\n      def{ writerSlideLevel = Just 1 }\n      \"pptx/slide-breaks/input.native\"\n      \"pptx/slide-breaks-slide-level-1/output.pptx\"\n    , pptxTests \"lists\"\n      def\n      \"pptx/lists/input.native\"\n      \"pptx/lists/output.pptx\"\n    , pptxTests \"start ordered list at specified num\"\n      def\n      \"pptx/start-numbering-at/input.native\"\n      \"pptx/start-numbering-at/output.pptx\"\n    , pptxTests \"List continuation paragraph indentation\"\n      def\n      \"pptx/list-level/input.native\"\n      \"pptx/list-level/output.pptx\"\n    , pptxTests \"tables\"\n      def\n      \"pptx/tables/input.native\"\n      \"pptx/tables/output.pptx\"\n    , pptxTests \"table of contents\"\n      def{ writerTableOfContents = True }\n      \"pptx/slide-breaks/input.native\"\n      \"pptx/slide-breaks-toc/output.pptx\"\n    , pptxTests \"end notes\"\n      def\n      \"pptx/endnotes/input.native\"\n      \"pptx/endnotes/output.pptx\"\n    , pptxTests \"end notes, with table of contents\"\n      def { writerTableOfContents = True }\n      \"pptx/endnotes/input.native\"\n      \"pptx/endnotes-toc/output.pptx\"\n    , pptxTests \"images\"\n      def\n      \"pptx/images/input.native\"\n      \"pptx/images/output.pptx\"\n    , pptxTests \"two-column layout\"\n      def\n      \"pptx/two-column/all-text/input.native\"\n      \"pptx/two-column/all-text/output.pptx\"\n    , pptxTests \"two-column (not comparison)\"\n      def\n      \"pptx/two-column/text-and-image/input.native\"\n      \"pptx/two-column/text-and-image/output.pptx\"\n    , pptxTests \"single column text\"\n      def\n      \"pptx/single-column/text/input.native\"\n      \"pptx/single-column/text/output.pptx\"\n    , pptxTests \"single column image\"\n      def\n      \"pptx/single-column/image/input.native\"\n      \"pptx/single-column/image/output.pptx\"\n    , pptxTests \"speaker notes\"\n      def\n      \"pptx/speaker-notes/input.native\"\n      \"pptx/speaker-notes/output.pptx\"\n    , pptxTests \"speaker notes after a separating block\"\n      def\n      \"pptx/speaker-notes-afterseps/input.native\"\n      \"pptx/speaker-notes-afterseps/output.pptx\"\n    , pptxTests \"speaker notes after a separating header\"\n      def\n      \"pptx/speaker-notes-afterheader/input.native\"\n      \"pptx/speaker-notes-afterheader/output.pptx\"\n    , pptxTests \"speaker notes after metadata\"\n      def\n      \"pptx/speaker-notes-after-metadata/input.native\"\n      \"pptx/speaker-notes-after-metadata/output.pptx\"\n    , pptxTests \"speaker notes from metadata field\"\n      def\n      \"pptx/metadata-speaker-notes/input.native\"\n      \"pptx/metadata-speaker-notes/output.pptx\"\n    , pptxTests \"remove empty slides\"\n      def\n      \"pptx/remove-empty-slides/input.native\"\n      \"pptx/remove-empty-slides/output.pptx\"\n    , pptxTests \"raw ooxml\"\n      def\n      \"pptx/raw-ooxml/input.native\"\n      \"pptx/raw-ooxml/output.pptx\"\n    , pptxTests \"metadata, custom properties\"\n      def\n      \"pptx/document-properties/input.native\"\n      \"pptx/document-properties/output.pptx\"\n    , pptxTests \"metadata, short description\"\n      def\n      \"pptx/document-properties-short-desc/input.native\"\n      \"pptx/document-properties-short-desc/output.pptx\"\n    , pptxTests \"inline code and code blocks\"\n      def\n      \"pptx/code/input.native\"\n      \"pptx/code/output.pptx\"\n    , pptxTests \"inline code and code blocks, custom formatting\"\n      def { writerVariables = Context $ M.fromList\n              [(pack \"monofont\", toVal $ pack \"Consolas\")] }\n      \"pptx/code/input.native\"\n      \"pptx/code-custom/output.pptx\"\n    , testGroup' \"Using slide level 0, if the first thing on a slide is\"\n      [ pptxTests (\"a h1 it's used as the slide title\")\n        def { writerSlideLevel = Just 0 }\n        \"pptx/slide-level-0/h1-with-image/input.native\"\n        \"pptx/slide-level-0/h1-with-image/output.pptx\"\n      , pptxTests (\"a h2 it's used as the \"\n                   <> \"slide title\")\n        def { writerSlideLevel = Just 0 }\n        \"pptx/slide-level-0/h2-with-image/input.native\"\n        \"pptx/slide-level-0/h2-with-image/output.pptx\"\n      , testGroup' \"a heading it's used as the slide title\"\n        [ pptxTests \"(works with a table)\"\n          def { writerSlideLevel = Just 0 }\n          \"pptx/slide-level-0/h1-with-table/input.native\"\n          \"pptx/slide-level-0/h1-with-table/output.pptx\"\n        , pptxTests (\"(content with caption layout)\")\n          def { writerSlideLevel = Just 0 }\n          \"pptx/slide-level-0/h1-h2-with-table/input.native\"\n          \"pptx/slide-level-0/h1-h2-with-table/output.pptx\"\n        ]\n      ]\n    , testGroup' \"comparison layout\"\n      [ testGroup' \"comparison layout is used...\"\n        [ pptxTests \"when two columns contain text + non-text\"\n          def\n          \"pptx/comparison/both-columns/input.native\"\n          \"pptx/comparison/both-columns/output.pptx\"\n        , pptxTests \"even when only one col contains text + non-text\"\n          def\n          \"pptx/comparison/one-column/input.native\"\n          \"pptx/comparison/one-column/output.pptx\"\n        ]\n      , testGroup' \"extra ... in one column gets overlaid\"\n        [ pptxTests \"text\"\n          def\n          \"pptx/comparison/extra-text/input.native\"\n          \"pptx/comparison/extra-text/output.pptx\"\n        , pptxTests \"image\"\n          def\n          \"pptx/comparison/extra-image/input.native\"\n          \"pptx/comparison/extra-image/output.pptx\"\n        ]\n      , pptxTests \"is not used if the non-text comes first\"\n        def\n        \"pptx/comparison/non-text-first/input.native\"\n        \"pptx/comparison/non-text-first/output.pptx\"\n      ]\n    , testGroup' \"Content with Caption layout is ...\"\n      [ pptxTests \"used for heading, text, image on the same slide\"\n        def\n        \"pptx/content-with-caption/heading-text-image/input.native\"\n        \"pptx/content-with-caption/heading-text-image/output.pptx\"\n      , pptxTests \"used for text and an image on the same slide\"\n        def\n        \"pptx/content-with-caption/text-image/input.native\"\n        \"pptx/content-with-caption/text-image/output.pptx\"\n      , pptxTests \"not used if the image comes first\"\n        def\n        \"pptx/content-with-caption/image-text/input.native\"\n        \"pptx/content-with-caption/image-text/output.pptx\"\n      ]\n    , testGroup' \"The Blank layout is used if a slide contains only...\"\n      [ pptxTests \"speaker notes\"\n        def\n        \"pptx/blanks/just-speaker-notes/input.native\"\n        \"pptx/blanks/just-speaker-notes/output.pptx\"\n      , pptxTests \"an empty heading with a body of only NBSPs\"\n        def\n        \"pptx/blanks/nbsp-in-body/input.native\"\n        \"pptx/blanks/nbsp-in-body/output.pptx\"\n      , pptxTests \"a heading containing only non-breaking spaces\"\n        def\n        \"pptx/blanks/nbsp-in-heading/input.native\"\n        \"pptx/blanks/nbsp-in-heading/output.pptx\"\n      ]\n    , pptxTests (\"Incremental lists are supported\")\n      def { writerIncremental = True }\n      \"pptx/incremental-lists/with-flag/input.native\"\n      \"pptx/incremental-lists/with-flag/output.pptx\"\n    , pptxTests (\"One-off incremental lists are supported\")\n      def\n      \"pptx/incremental-lists/without-flag/input.native\"\n      \"pptx/incremental-lists/without-flag/output.pptx\"\n    , pptxTests \"Background images\"\n      def\n      \"pptx/background-image/input.native\"\n      \"pptx/background-image/output.pptx\"\n    ]\n  referenceSpecificTests =\n    [ ooxmlTest\n      writePowerpoint\n      \"Basic footer\"\n      def { writerReferenceDoc = Just \"pptx/footer/basic/reference.pptx\"}\n      \"pptx/footer/input.native\"\n      \"pptx/footer/basic/output.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Footer with fixed date, replaced by meta block date\"\n      def { writerReferenceDoc = Just \"pptx/footer/fixed-date/reference.pptx\"}\n      \"pptx/footer/input.native\"\n      \"pptx/footer/fixed-date/output.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Footer not shown on title slide\"\n      def { writerReferenceDoc = Just \"pptx/footer/no-title-slide/reference.pptx\"}\n      \"pptx/footer/input.native\"\n      \"pptx/footer/no-title-slide/output.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Footer with slide number starting from 3\"\n      def { writerReferenceDoc = Just \"pptx/footer/higher-slide-number/reference.pptx\"}\n      \"pptx/footer/input.native\"\n      \"pptx/footer/higher-slide-number/output.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Layouts can be moved around in reference doc\"\n      def {writerReferenceDoc = Just \"pptx/reference-moved-layouts.pptx\"}\n      \"pptx/layouts/input.native\"\n      \"pptx/layouts/moved.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Layouts can be missing from the reference doc\"\n      def {writerReferenceDoc = Just \"pptx/reference-deleted-layouts.pptx\"}\n      \"pptx/layouts/input.native\"\n      \"pptx/layouts/deleted.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Slides can be missing from the reference doc\"\n      def {writerReferenceDoc = Just \"pptx/reference-no-slides.pptx\"}\n      \"pptx/reference-no-slides/add-slides/input.native\"\n      \"pptx/reference-no-slides/add-slides/output.pptx\"\n    , ooxmlTest\n      writePowerpoint\n      \"Notes are placed at the right position with a reference doc without slides\"\n      def {writerReferenceDoc = Just \"pptx/reference-no-slides.pptx\"}\n      \"pptx/reference-no-slides/with-notes/input.native\"\n      \"pptx/reference-no-slides/with-notes/output.pptx\"\n    ]\n  in regularTests <> referenceSpecificTests\n"
  },
  {
    "path": "test/Tests/Writers/RST.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.RST (tests) where\n\nimport Control.Monad.Identity\nimport Test.Tasty\nimport Test.Tasty.HUnit\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\nimport Text.Pandoc.Writers.RST\nimport qualified Data.Text as T\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test (purely (writeRST def . toPandoc))\n\ntestTemplate :: (ToString a, ToString c, ToPandoc a) =>\n                String -> String -> (a, c) -> TestTree\ntestTemplate t = case runIdentity (compileTemplate [] (T.pack t)) of\n    Left e -> error $ \"Could not compile RST template: \" ++ e\n    Right templ -> test (purely (writeRST def{ writerTemplate = Just templ }) . toPandoc)\n\nbodyTemplate :: Template T.Text\nbodyTemplate = case runIdentity (compileTemplate [] \"$body$\\n\") of\n                    Left e      -> error $\n                      \"Could not compile RST bodyTemplate\" ++ e\n                    Right templ -> templ\n\ntests :: [TestTree]\ntests = [ testGroup \"rubrics\"\n          [ \"in list item\" =:\n              bulletList [header 2 (text \"foo\")] =?>\n              \"- .. rubric:: foo\"\n          , \"in definition list item\" =:\n              definitionList [(text \"foo\", [header 2 (text \"bar\"),\n                                            para $ text \"baz\"])] =?>\n              unlines\n              [ \"foo\"\n              , \"   .. rubric:: bar\"\n              , \"\"\n              , \"   baz\"]\n          , \"in block quote\" =:\n              blockQuote (header 1 (text \"bar\")) =?>\n              \"   .. rubric:: bar\"\n          , \"with id\" =:\n              blockQuote (headerWith (\"foo\",[],[]) 1 (text \"bar\")) =?>\n              unlines\n              [ \"   .. rubric:: bar\"\n              , \"      :name: foo\"]\n          , \"with id class\" =:\n              blockQuote (headerWith (\"foo\",[\"baz\"],[]) 1 (text \"bar\")) =?>\n              unlines\n              [ \"   .. rubric:: bar\"\n              , \"      :name: foo\"\n              , \"      :class: baz\"]\n          ]\n        , testGroup \"ligatures\" -- handling specific sequences of blocks\n          [ \"a list is closed by a comment before a quote\" =: -- issue 4248\n            bulletList [plain \"bulleted\"] <> blockQuote (plain \"quoted\") =?>\n              unlines\n              [ \"- bulleted\"\n              , \"\"\n              , \"..\"\n              , \"\"\n              , \"   quoted\"]\n          ]\n        , testGroup \"flatten\"\n          [ testCase \"emerges nested styles as expected\" $\n            flatten (Emph [Str \"1\", Strong [Str \"2\"], Str \"3\"]) @?=\n            [Emph [Str \"1\"], Strong [Str \"2\"], Emph [Str \"3\"]]\n          , testCase \"could introduce trailing spaces\" $\n            flatten (Emph [Str \"f\", Space, Strong [Str \"2\"]]) @?=\n            [Emph [Str \"f\", Space], Strong [Str \"2\"]]\n            -- the test above is the reason why we call\n            -- stripLeadingTrailingSpace through transformNested after\n            -- flatten\n          , testCase \"preserves empty parents\" $\n            flatten (Image (\"\",[],[]) [] (\"loc\",\"title\")) @?=\n            [Image (\"\",[],[]) [] (\"loc\",\"title\")]\n          ]\n        , testGroup \"inlines\"\n          [ \"are removed when empty\" =: -- #4434\n            plain (strong (str \"\")) =?> \"\"\n          , \"do not cause the introduction of extra spaces when removed\" =:\n            plain (strong (str \"\") <> emph (str \"text\")) =?> \"*text*\"\n          , \"spaces are stripped at beginning and end\" =:\n            -- pandoc issue 4327 \"The text within inline markup may not\n            -- begin or end with whitespace\"\n            -- http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup\n            strong (space <> str \"text\" <> space <> space) =?> \"**text**\"\n          , \"single space stripped\" =:\n            strong space =?> \"\"\n          , \"give priority to strong style over emphasis\" =:\n            strong (emph (strong (str \"s\"))) =?> \"**s**\"\n          , \"links are not elided by outer style\" =:\n            strong (emph (link \"loc\" \"\" (str \"text\"))) =?>\n            \"`text <loc>`__\"\n          , \"RST inlines cannot start nor end with spaces\" =:\n            emph (str \"f\" <> strong (space <> str \"d\" <> space) <> str \"l\") =?>\n            \"*f* **d** *l*\"\n          , \"keeps quotes\" =:\n            strong (str \"f\" <> doubleQuoted (str \"d\") <> str \"l\") =?>\n            \"**f“d”l**\"\n          , \"backslash inserted between str and code\" =:\n            str \"/api?query=\" <> code \"foo\" =?>\n            \"/api?query=\\\\ ``foo``\"\n          ]\n        , testGroup \"headings\"\n          [ \"normal heading\" =:\n              header 1 (text \"foo\") =?>\n              unlines\n              [ \"foo\"\n              , \"===\"]\n          -- note: heading normalization is only done in standalone mode\n          , test (purely (writeRST def{ writerTemplate = Just bodyTemplate })\n                       . toPandoc)\n            \"heading levels\" $\n              header 1 (text \"Header 1\") <>\n              header 3 (text \"Header 2\") <>\n              header 2 (text \"Header 2\") <>\n              header 1 (text \"Header 1\") <>\n              header 4 (text \"Header 2\") <>\n              header 5 (text \"Header 3\") <>\n              header 3 (text \"Header 2\") =?>\n              unlines\n              [ \"Header 1\"\n              , \"========\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"\n              , \"\"\n              , \"Header 1\"\n              , \"========\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"\n              , \"\"\n              , \"Header 3\"\n              , \"~~~~~~~~\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"]\n          , test (purely (writeRST def{ writerTemplate = Just bodyTemplate }) . toPandoc)\n            \"minimal heading levels\" $\n              header 2 (text \"Header 1\") <>\n              header 3 (text \"Header 2\") <>\n              header 2 (text \"Header 1\") <>\n              header 4 (text \"Header 2\") <>\n              header 5 (text \"Header 3\") <>\n              header 3 (text \"Header 2\") =?>\n              unlines\n              [ \"Header 1\"\n              , \"========\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"\n              , \"\"\n              , \"Header 1\"\n              , \"========\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"\n              , \"\"\n              , \"Header 3\"\n              , \"~~~~~~~~\"\n              , \"\"\n              , \"Header 2\"\n              , \"--------\"]\n          ]\n        , testTemplate \"$subtitle$\\n\" \"subtitle\" $\n          setMeta \"subtitle\" (\"subtitle\" :: Inlines) (doc $ plain \"\") =?>\n          (\"subtitle\" :: String)\n        ]\n"
  },
  {
    "path": "test/Tests/Writers/TEI.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Tests.Writers.TEI (tests) where\n\nimport Test.Tasty\nimport Test.Tasty.HUnit (HasCallStack)\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\nimport Text.Pandoc.Builder\n\n{-\n  \"my test\" =: X =?> Y\n\nis shorthand for\n\n  test html \"my test\" $ X =?> Y\n\nwhich is in turn shorthand for\n\n  test html \"my test\" (X,Y)\n-}\n\ninfix 4 =:\n(=:) :: (ToString a, ToPandoc a, HasCallStack)\n     => String -> (a, String) -> TestTree\n(=:) = test (purely (writeTEI def) . toPandoc)\n\ntests :: [TestTree]\ntests = [ testGroup \"block elements\"\n          [\"para\"          =: para \"Lorem ipsum cetera.\"\n                           =?> \"<p>Lorem ipsum cetera.</p>\"\n          ]\n        , testGroup \"inlines\"\n          [\n            \"Emphasis\"      =:  emph \"emphasized\"\n                            =?> \"<p><hi rendition=\\\"simple:italic\\\">emphasized</hi></p>\"\n           ,\"SingleQuoted\"  =:  singleQuoted (text \"quoted material\")\n                            =?> \"<p><quote>quoted material</quote></p>\"\n           ,\"DoubleQuoted\"  =:  doubleQuoted (text \"quoted material\")\n                            =?> \"<p><quote>quoted material</quote></p>\"\n           ,\"NestedQuoted\"  =:  doubleQuoted (singleQuoted (text \"quoted material\"))\n                            =?> \"<p><quote><quote>quoted material</quote></quote></p>\"\n          ]\n         ]\n"
  },
  {
    "path": "test/Tests/XML.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\n{- |\n--   Module      : Tests.XML\n--   Copyright   : Copyright (C) 2025- Massimiliano Farinella and John MacFarlane\n--   License     : GNU GPL, version 2 or above\n--\n--   Maintainer  : Massimiliano Farinella <massifrg@gmail.com>\n--   Stability   : WIP\n--   Portability : portable\nRuns a roundtrip conversion of an AST trough the XML format:\n- first from AST to XML (XML Writer),\n- then back to AST (XML Reader),\n- and checks that the two ASTs are the same\n-}\nmodule Tests.XML (tests) where\n\nimport Control.Monad ((>=>))\nimport Test.Tasty (TestTree)\nimport Test.Tasty.QuickCheck\nimport Tests.Helpers\nimport Text.Pandoc\nimport Text.Pandoc.Arbitrary ()\n\np_xml_roundtrip :: Pandoc -> Bool\np_xml_roundtrip d = d == purely (writeXML def {writerTemplate = Just mempty} >=> readXML def) d\n\ntests :: [TestTree]\ntests = [testProperty \"p_xml_roundtrip\" p_xml_roundtrip]"
  },
  {
    "path": "test/ansi-test.ansi",
    "content": "\u001b[1m\u001b[23m\u001b[39m\u001b[49m\u001b[24m\u001b[29mLEVEL 1 HEADING\u001b[0m\n\nText\n\n\u001b[1m\u001b[23m\u001b[39m\u001b[49m\u001b[24m\u001b[29mLevel 2 heading\u001b[0m\n\nText\n\n\u001b[22m\u001b[3m\u001b[39m\u001b[49m\u001b[24m\u001b[29mLevel 3 heading\u001b[0m\n\nText\n\n\u001b[22m\u001b[3m\u001b[39m\u001b[49m\u001b[24m\u001b[29mLevel 4 heading\u001b[0m\n\nText\n\n\u001b[22m\u001b[3m\u001b[39m\u001b[49m\u001b[24m\u001b[29mLevel 5 heading\u001b[0m\n\nText\n\n• list\n\n  • nested\n\n    1) numbered\n\n       continuation paragraph\n\n\u001b[22m\u001b[23m\u001b[36m\u001b[49m\u001b[4m\u001b[29m\u001b]8;;http://example.com\u001b\\link\u001b[0m\u001b]8;;\u001b\\\n\n\u001b[22m\u001b[23m\u001b[36m\u001b[49m\u001b[4m\u001b[29m\u001b]8;;mailto:mail@example.com\u001b\\mail@example.com\u001b[0m\u001b]8;;\u001b\\\n\n│ Block quote\n│\n│ │ Nested block quote\n\nMultiline table with caption:\n\nCentered    Left       Right        Default aligned\nHeader      Aligned    Aligned      \n─────────── ────────── ──────────── ──────────────────────────\nFirst       row        12.0         Example of a row that\n                                    spans multiple lines.\nSecond      row        5.0          Here’s another one. Note\n                                    the blank line between\n                                    rows.\n─────────── ────────── ──────────── ──────────────────────────\n\n  Here’s the caption. It may span multiple lines.\n\nMultiline table without caption:\n\nCentered    Left       Right        Default aligned\nHeader      Aligned    Aligned      \n─────────── ────────── ──────────── ──────────────────────────\nFirst       row        12.0         Example of a row that\n                                    spans multiple lines.\nSecond      row        5.0          Here’s another one. Note\n                                    the blank line between\n                                    rows.\n─────────── ────────── ──────────── ──────────────────────────\n\nTable without column headers:\n\n───────────────── ───────────────── ───────────────── ─────────────────\n12                12                12                12\n123               123               123               123\n1                 1                 1                 1\n───────────────── ───────────────── ───────────────── ─────────────────\n\nFootnote¹\n\nMultiple blocks in a cell\n\n────────────────── ─────────── ────────────\n\u001b[1m\u001b[23m\u001b[39m\u001b[49m\u001b[24m\u001b[29mCOL 1\u001b[0m              \u001b[1m\u001b[23m\u001b[39m\u001b[49m\u001b[24m\u001b[29mCOL 2\u001b[0m       \u001b[1m\u001b[23m\u001b[39m\u001b[49m\u001b[24m\u001b[29mCOL 3\u001b[0m\n                               \ncol 1              col 2       col 3\nr1 a               • b         c c 2 c 2\n                               \nr1 bis             • b 2       \n                               \n                   • b 2       \n────────────────── ─────────── ────────────\n\nEast Asian characters have double width\n\n── ────\n魚 fish\n── ────\n\nThis is inline code: \u001b[22m\u001b[23m\u001b[31m\u001b[47m\u001b[24m\u001b[29m x >>= y ++ 3 \u001b[0m.\n\n    \u001b[22m\u001b[23m\u001b[31m\u001b[49m\u001b[24m\u001b[29mcode block\u001b[0m\n    \u001b[22m\u001b[23m\u001b[31m\u001b[49m\u001b[24m\u001b[29m   >>> ## ``\u001b[0m\n\nHighlighted:\n\n    \u001b[0m\u001b[0m\u001b[22;23;24m\u001b[31;22;23;24m<\u001b[0m\u001b[22;23;24m\u001b[32;1;23;24mp\u001b[0m\u001b[22;23;24m\u001b[31;22;23;24m><\u001b[0m\u001b[22;23;24m\u001b[32;1;23;24ma\u001b[0m\u001b[22;23;24m\u001b[32;22;23;24m href\u001b[0m\u001b[22;23;24m\u001b[90;22;23;24m=\u001b[0m\u001b[22;23;24m\u001b[36;22;23;24m\"foobar\"\u001b[0m\u001b[22;23;24m\u001b[32;22;23;24m title\u001b[0m\u001b[22;23;24m\u001b[90;22;23;24m=\u001b[0m\u001b[22;23;24m\u001b[36;22;23;24m\"title\"\u001b[0m\u001b[22;23;24m\u001b[31;22;23;24m>\u001b[0m\u001b[22;23;24m\u001b[0m\u001b[22;23;24mThis is a link\u001b[0m\u001b[22;23;24m\u001b[31;22;23;24m</\u001b[0m\u001b[22;23;24m\u001b[32;1;23;24ma\u001b[0m\u001b[22;23;24m\u001b[31;22;23;24m></\u001b[0m\u001b[22;23;24m\u001b[32;1;23;24mp\u001b[0m\u001b[22;23;24m\u001b[31;22;23;24m>\u001b[0m\u001b[22;23;24m\n    \u001b[90;22;3;24m<!-- comment -->\u001b[0m\u001b[22;23;24m\u001b[0m\n\nMath: $\\pi^2 = \\frac{1}{2}$\n\n\u001b[22m\u001b[3m\u001b[39m\u001b[49m\u001b[24m\u001b[29me\u001b[0m = \u001b[22m\u001b[3m\u001b[39m\u001b[49m\u001b[24m\u001b[29mmc\u001b[0m²\n\n────────────────────\n\nMore text.\n\n\u001b[1m\u001b[23m\u001b[39m\u001b[49m\u001b[24m\u001b[29mboldface text\u001b[0m, \u001b[22m\u001b[23m\u001b[39m\u001b[49m\u001b[4m\u001b[29munderlined text\u001b[0m, \u001b[22m\u001b[3m\u001b[39m\u001b[49m\u001b[24m\u001b[29memphasized text\u001b[0m.\n\nsmall caps\n\nWe see a log₁₀ reduction in 2⁹ seconds.\n\nHello\n\nGoodbye\n\n                          ────────────────────\n\n  1. Here’s the note.\u001b[0m\u001b]8;;\u001b\\\n"
  },
  {
    "path": "test/ansi-test.txt",
    "content": "---\ntitle: My Document\nauthor: John Doe\ndate: July 25, 1933\n...\n\n# Level 1 heading\n\nText\n\n## Level 2 heading\n\nText\n\n### Level 3 heading\n\nText\n\n#### Level 4 heading\n\nText\n\n##### Level 5 heading\n\nText\n\n- list\n  - nested\n    1) numbered\n\n       continuation paragraph\n\n[link](http://example.com)\n\n<mail@example.com>\n\n> Block quote\n>\n> > Nested block quote\n\nMultiline table with caption:\n\n:  Here's the caption.\nIt may span multiple lines.\n\n---------------------------------------------------------------\n Centered   Left             Right\n  Header    Aligned        Aligned  Default aligned\n----------  ---------  -----------  ---------------------------\n   First    row               12.0  Example of a row that spans\n                                    multiple lines.\n\n   Second   row                5.0  Here's another one.  Note\n                                    the blank line between rows.\n---------------------------------------------------------------\n\nMultiline table without caption:\n\n---------------------------------------------------------------\n Centered   Left             Right\n  Header    Aligned        Aligned  Default aligned\n----------  ---------  -----------  ---------------------------\n   First    row               12.0  Example of a row that spans\n                                    multiple lines.\n\n   Second   row                5.0  Here's another one.  Note\n                                    the blank line between rows.\n---------------------------------------------------------------\n\nTable without column headers:\n\n-------     ------ ----------   -------\n     12     12        12             12\n    123     123       123           123\n      1     1          1              1\n-------     ------ ----------   -------\n\nFootnote^[Here's the note.]\n\nMultiple blocks in a cell\n\n+------------------+-----------+------------+\n| # col 1          | # col 2   | # col 3    |\n| col 1            | col 2     | col 3      |\n+------------------+-----------+------------+\n| r1 a             | - b       | c          |\n|                  | - b 2     | c 2        |\n| r1 bis           | - b 2     | c 2        |\n+------------------+-----------+------------+\n\nEast Asian characters have double width\n\n+--+----+\n|魚|fish|\n+--+----+\n\nThis is inline code: `x >>= y ++ 3`.\n\n```\ncode block\n   >>> ## ``\n```\n\nHighlighted:\n\n```html\n<p><a href=\"foobar\" title=\"title\">This is a link</a></p>\n<!-- comment -->\n```\n\nMath: $\\pi^2 = \\frac{1}{2}$\n\n$$e = mc^2$$\n\n----\n\nMore text.\n\n**boldface text**, [underlined text]{.underline}, *emphasized text*.\n\n[small caps]{.smallcaps}\n\nWe see a log~10~ reduction in 2^9^ seconds.\n\n| Hello\n|\n| Goodbye\n"
  },
  {
    "path": "test/asciidoc-reader-include.adoc",
    "content": "This is a test!\n\n. one\n.. two\n"
  },
  {
    "path": "test/asciidoc-reader-include.rb",
    "content": "# A function\ndef foo\n  return 42\nend\n"
  },
  {
    "path": "test/asciidoc-reader.adoc",
    "content": "// Some comment here.\n= AsciiDoc reader test\nJohn MacFarlane <jgm@berkeley.edu>; John Doe <doe@example.com>\nv1.0, 2025-11-24\n:custom: Foo bar \\\nbaz\n:flag:\n:stem: latexmath\n\n[#firsty]\n== Inline markup\n\n=== Characters and escapes\n\nDog's has a curved apostrophe, but dog\\'s does not.\n\nAn escaped symbol: \\*star\\*.\n\nCharacter references: &auml;&#160;&#x22E0; \n\n=== Line breaks\n\nThis is a hard +\nbreak.\n\nOr set it for a whole paragraph\n\n[%hardbreaks]\nThese are\nall\nhard\nbreaks.\n\n=== Autolinks\n\nhttp://example.com/foobar?a=333&b=no%20body, me@example.com\n\n<http://example.com/foobar?a=333&b=no%20body>, <me@example.com>\n\n=== Cross-reference\n\nSee <<firsty>>\n\nSee <<firsty,My great section on Inline markup>>\n\nGo to <<anch,an inline anchor>>\n\n=== Anchors\n\nAn [[anch]]inline anchor.\n\n[[[bibanchor]]Doe, John. A Book.\n\n=== Inline macros\n\nkbd:[F11]\n\nkbd:[Ctrl+Shift+F]\n\nmenu:File[Save]\n\nmenu:Reader[Markdown > Pandoc]\n\nbtn:[Cancel]\n\nicon:heart[2x,role=red]\n\nanchor:tiger\n\npass:[<b>*bold*</b>]\n\nlink:downloads/report.pdf[Get Report]\n\nlink:tools.html#editors[]\n\nlink:file:///home/username[Your files]\n\nTricky cases:\n\nlink:pass:[My Documents/report.pdf][Get Report]\n\nlink:My&#32;Documents/report.pdf[Get Report]\n\nlink:My%20Documents/report.pdf[Get Report]\n\nlink:++https://example.org/now_this__link_works.html++[]\n\nmailto:join@discuss.example.org[Subscribe]\n\nmailto:join@discuss.example.org[\"Click, subscribe, and participate!\",role=mail]\n\nxref:link-macro-attributes[use attributes within the link macro]\n\nimage::sunset.jpg[Sunset]\n\nimage::name.png[]\n\nimage::sunset.jpg[Sunset,300,400]\n\nimage::sunset.jpg[alt=Sunset,width=300,height=400]\n\n[latexmath]\n++++\ne=mc^2\n++++\n\n[asciimath]\n++++\nsin n / 3\n++++\n\n[stem]\n++++\ne^i\n++++\n\n=== Attribute substitutions\n\n{custom}\n\n{nonexistent}\n\nBuilt in: x{blank}y{empty}z{sp}a{nbsp}b{zwsp}c{apos}d{lsquo}\n\n=== Bold and italic\n\nConstrained: *this is bold _and italic_*.\n\nUnconstrained: wild**content__with italic__stuff**.\n\n=== Monospace\n\n`simple`\n\n`complex *with bold* text and a link:foo.html[]`\n\nunconstrained``wwow``okay\n\n=== Span and inline attributes\n\n[.red]#Bonjour *monsieur*#\n\nUn[.red]##constrained##content\n\nWith #no attribute# it's highlighted.\n\n=== Sub and superscript\n\nH~2~O\n\nH~a{sp}b~O\n\nNot subscript: H~a b~O.\n\nH^2&O\n\nH^a{sp}b^O\n\nNot subscript: H^a b^O.\n\n=== Passthrough\n\nHere the special characters just come through as literal:\n\n+<b>*test*</b>+\n\nxx++<b>*test*</b>++xx\n\nBut here they are passed through:\n\nxx+++<b>*test*</b>+++xx\n\n=== Quoted\n\n\"`double quoted`\"\n\n'`single quoted`'\n\n=== Footnotes\n\nDoublefootnote:[The double hail-and-rainbow level makes my toes tingle.]\n\nA bold statement!footnote:disclaimer[Opinions are my own.]\nAnother outrageous statement.footnote:disclaimer[]\n\n== Block markup\n\n=== Sections\n\n==== Another level\n\n===== Level 5\n\n#### Markdown style\n\n##### Level 5\n\n=== Discrete heading\n\n[discrete]\n==== A discrete heading, not a section\n\n=== Paragraph\n\nThis is a paragraph\nwhose source fits on two lines.\n\n{.This is my title}\nA paragraph with a title.\n\n=== Example block\n\n.Optional title\n[example]\nThis is an example of an example block.\n\n.Optional title\n====\nParagraph *one*.\n\nParagraph *two*.\n====\n\n=== Admonition\n\nSimple form:\n\nWARNING: This is very dangerous.\nDon't do it unless you understand the risks.\n\n[IMPORTANT]\n.Title of the admonition\n====\nRemember:\n\n. Don't do this.\n. And don't do that.\n====\n\n=== Sidebar\n\n[sidebar]\nA simple sidebar.\n\n.Optional Title *with strong emphasis*\n****\nHere is a sidebar.\n\nTIP: It can contain any type of content.\n****\n\n=== Literal block\n\nShort indented code:\n\n  $ ls -a\n  $ cat /foo/bar/baz \\\n       /bi/bim/bop\n\n[literal]\nThis is\n  a literal block too.\n\n....\n  Fenced\n    $+ *a* literal\n\n****\nnot a sidebar\n****\n....\n\n=== Listing\n\n[source,ruby]\n----\nrequire 'sinatra'\n\nget '/hi' do\n  \"Hello World!\"\nend\n----\n\nImplied:\n\n[source,ruby]\n----\nrequire 'sinatra'\n\nget '/hi' do\n  \"Hello World!\"\nend\n----\n\n[,ruby]\n----\ninclude::asciidoc-reader-include.rb[]\n----\n\n[#hello.haskell]\n----\nputStrLn $ unwords [\"Hello\", \"world\"]\n----\n\nLine numbering:\n\n[%linenums,ruby]\n----\nputs 1\nputs 2\nputs 3\n----\n\n----\nThis doesn't have a language.\n  +=\"hi\"\n----\n\nAnd with a callout list:\n\n[source,ruby]\n----\nrequire 'sinatra' <1>\n\nget '/hi' do <2> <3>\n  \"Hello World!\"\nend\n----\n<1> Library import\n<2> URL mapping\n<3> Response block\n\nMarkdown-style fenced:\n\n```ruby\ndef foo\n  return 5\nend\n```\n\n=== Verse\n\n[verse,Carl Sandburg, two lines from the poem Fog]\nThe fog comes\non little cat feet.\n\n[verse,Carl Sandburg,Fog]\n____\nThe fog comes\non little cat feet.\nIt sits looking\nover harbor and city\non silent haunches\nand then moves on.\n____\n\n=== Collapsible\n\nClick here for more.\n[%collapsible%open]\n====\nThis is collapsible.\n\nIt can be hidden.\n====\n\n.Click me!\n[%collapsible]\nThis paragraph is\nalso collapsible.\n\n=== Quote\n\n[quote,Captain James T. Kirk,Star Trek IV: The Voyage Home]\nEverybody remember where we parked.\n\n[quote,Monty Python and the Holy Grail]\n____\nDennis: Come and see the violence inherent in the system. Help! Help! I'm being\nrepressed.\n\nKing Arthur: Bloody peasant!\n\nDennis: Oh, what a giveaway! Did you hear that? Did you hear that, eh? That's what I'm\non about! Did you see him repressing me? You saw him, Didn't you?\n____\n\n[quote.movie#roads,Dr. Emmett Brown]\n____\nRoads? Where we're going, we don't need roads.\n____\n\n=== Pass\n\n++++\n<p>pass <em>through</em>\n  </p>\n++++\n\n=== Open block\n\n.A title.\n[key=\"a value\"]\n--\nAny content can go here:\n\n. one\n. two\n--\n\n=== Anchor\n\n[[goals]]\n* one\n* two\n\n=== Breaks\n\nAsciidoc thematic break:\n\n'''\n\nMarkdown style:\n\n---\n- - -\n***\n* * *\n\nPage breaks:\n\n<<<\n\n[%always]\n<<<\n\n=== List\n\n* Edgar Allan Poe\n* Sheri S. Tepper\n* Bill Bryson\n\n// titled\n\n.Kizmet's Favorite Authors\n* Edgar Allan Poe\n* Sheri S. Tepper\n* Bill Bryson\n\n// hyphen\n\n- Edgar Allan Poe\n- Sheri S. Tepper\n- Bill Bryson\n\n. Nested list\n* West wood maze\n** Maze heart\n*** Reflection pool\n** Secret exit\n* Level 1 list item\n** Level 2 list item\n*** Level 3 list item\n**** Level 4 list item\n***** Level 5 list item\n****** etc.\n* Level 1 list item\n\n// attributes\n\n[square]\n* one\n* two\n* three\n\n// ordered with actual numbers\n\n1. Protons\n2. Electrons\n3. Neutrons\n\n// ordered with .\n\n. Protons\n. Electrons\n. Neutrons\n\nStart with 4:\n\n4. Step four\n5. Step five\n6. Step six\n\nor\n\n[start=4]\n. Step four\n. Step five\n. Step six\n\nReversed:\n\n[%reversed]\n.Parts of an atom\n. Protons\n. Electrons\n. Neutrons\n\nNested\n\n. Step 1\n. Step 2\n.. Step 2a\n.. Step 2b\n. Step 3\n\nMixed nested\n\n. Linux\n* Fedora\n* Ubuntu\n* Slackware\n. BSD\n* FreeBSD\n* NetBSD\n\nWith spacing\n\n. Linux\n* Fedora\n* Ubuntu\n* Slackware\n. BSD\n* FreeBSD\n* NetBSD\n\nWith number styles\n\n[lowerroman,start=5]\n. Five\n. Six\n[loweralpha]\n.. a\n.. b\n.. c\n. Seven\n\nChecklist\n\n* [*] checked\n* [x] also checked\n* [ ] not checked\n* normal list item\n\nSeparate lists with block attribute\n\n* Apples\n* Oranges\n[]\n. Wash\n. Slice\n\nMultiline items\n\n* Blah blah.\nBlah blah.\n* The document header in AsciiDoc is optional.\nIf present, it must start with a document title.\n\n* Optional author and revision information lines\nimmediately follow the document title.\n\n* The document header must be separated from\n  the remainder of the document by one or more\n  empty lines and it cannot contain empty lines.\n\nComplex item\n\n* The header in AsciiDoc must start with a document title.\n+\n----\n= Document Title\n----\n+\nKeep in mind that the header is optional.\n* Optional author and revision information lines immediately follow the document\ntitle.\n+\n----\n= Document Title\nDoc Writer <doc.writer@asciidoc.org>\nv1.0, 2022-01-01\n----\n* Second item\n\nEmpty principle element:\n\n. {empty}\n+\n----\ntest\n----\n\n=== Table\n\n==== Simple with column specs\n\n[cols=\"3,2,3\"]\n|===\n|This content is placed in the first cell of column 1\n|This line starts with a vertical bar so this content is placed in a new cell in\ncolumn 2 |When the processor encounters a whitespace followed by a vertical bar it\nends the previous cell and starts a new cell\n|===\n\n==== Repeated column in specs\n\n[cols=\"2*\"]\n|===\n>s|This cell's specifier indicates that this cell's content is right-aligned and bold.\n|The cell specifier on this cell hasn't been set explicitly, so the default\nproperties are applied.\n|===\n\n==== Simple without column specs\n\n|===\n|Column 1, header row |Column 2, header row\n\n|Cell in column 1, row 2\n|Cell in column 2, row 2\n\n|Cell in column 1, row 3\n|Cell in column 2, row 3\n|===\n\n==== With caption\n\n.My cool table.\n|===\n|Column 1, header row |Column 2, header row\n\n|Cell in column 1, row 2\n|Cell in column 2, row 2\n\n|Cell in column 1, row 3\n|Cell in column 2, row 3\n|===\n\n==== No header\n\nBy default the first line should turn into the header, but this\ncan be disabled:\n\n[%noheader]\n|===\n|Cell in column 1, row 1 |Cell in column 2, row 1\n|Cell in column 1, row 2 |Cell in column 2, row 2\n|===\n\nAnd also explicitly enabled:\n\n[%header%footer%autowidth,cols=2*~]\n|===\n|Cell A1 |Cell B1\n|Cell A2 |Cell B2\n|Cell A3 |Cell B3\n|===\n\n==== Footer\n\n[%header%footer,cols=\"2,2,1\"]\n|===\n|Column 1, header row\n|Column 2, header row\n|Column 3, header row\n|Cell in column 1, row 2\n|Cell in column 2, row 2\n|Cell in column 3, row 2\n|Column 1, footer row\n|Column 2, footer row\n|Column 3, footer row\n|===\n\nor\n\n[options=\"footer\"]\n|===\n|Column 1, header row |Column 2, header row\n|Cell in column 1, row 2\n|Cell in column 2, row 2\n|Cell in column 1, row 3\n|Cell in column 2, row 3\n|Column 1, footer row\n|Column 2, footer row\n|===\n\n==== Alignment\n\n|===\n|Column Name |Column Name\n2+^|This cell spans two columns, and its content is horizontally centered because the\ncell specifier includes the `+^+` operator.\n2*^|This content is duplicated in two adjacent columns.\nIts content is horizontally centered because the cell specifier\nincludes the `+^+` operator.\n|===\n\n==== Multiple paragraphs in cells\n\n|===\n\n|Single paragraph on row 1\n\n|First paragraph on row 2\n\nSecond paragraph on row 2\n|===\n\n==== Complex table\n\n|===\n\n2*>m|This content is duplicated across two columns.\n\nIt is aligned right horizontally.\n\nAnd it is monospaced.\n\n.3+^.>s|This cell spans 3 rows. The content is centered horizontally, aligned to the bottom of the cell, and strong.\ne|This content is emphasized.\n\n.^l|This content is aligned to the top of the cell and literal.\n\na|\n[source]\nputs \"This is a source block!\"\n\n|===\n\n==== Column styles\n\n[cols=\"m,m\"]\n|===\n|monospace | mono\nd|default | mono\n|===\n\n==== Block elements in cells\n\n|===\n|Normal Style |AsciiDoc Style\n|This cell isn't prefixed with an `a`, so the processor doesn't interpret the\nfollowing lines as an AsciiDoc list.\n\n* List item 1\n* List item 2\n* List item 3\n\na|This cell is prefixed with an `a`, so the processor interprets the following lines\nas an AsciiDoc list.\n\n* List item 1\n* List item 2\n* List item 3\n\n|This cell isn't prefixed with an `a`, so the processor doesn't interpret the listing\nblock delimiters or the `source` style.\n\n[source,python]\n----\nimport os\nprint (\"%s\" %(os.uname()))\n----\n\na|This cell is prefixed with an `a`, so the listing block is processed and rendered\naccording to the `source` style rules.\n\n[source,python]\n----\nimport os\nprint \"%s\" %(os.uname())\n----\n|===\n\n==== Col and rowspan\n\n|===\n|Column 1, header row |Column 2, header row | Column 3, header row\n2.2+|This cell spans 2 cols and 2 rows\n|Cell in column 3, row 2\n|Cell in column 3, row 3\n3+|Cell in column 1-3, row 4\n|===\n\n==== CSV table\n\n[%header,format=csv]\n|===\nArtist,Track,Genre\nBaauer,Harlem Shake,Hip Hop\nThe Lumineers,Ho Hey,Folk Rock\n|===\n\nor\n\n,===\nArtist,Track,Genre\nBaauer,Harlem Shake,Hip Hop\n,===\n\n==== DSV table\n\n[format=dsv,separator=;]\n|===\na;b;c\nd;e;f\n|===\n\nor\n\n:===\nArtist:Track:Genre\nRobyn:Indestructible:Dance\n:===\n\n=== Definition list\n\nCPU:: The brain of the computer.\nHard drive:: Permanent storage for operating system and/or user files.\n\nMixed\n\nDairy::\n* Milk\n* Eggs\nBakery::\n* Bread\nProduce::\n* Bananas\n\nWith spaces\n\nDairy::\n\n  * Milk\n  * Eggs\n\nBakery::\n\n  * Bread\n\nProduce::\n\n  * Bananas\n\nNested\n\nOperating Systems::\nLinux:::\n . Fedora\n  * Desktop\n . Ubuntu\n  * Desktop\n  * Server\nBSD:::\n . FreeBSD\n . NetBSD\nCloud Providers::\n PaaS:::\n  . OpenShift\n  . CloudBees\n IaaS:::\n  . Amazon EC2\n\nThis just affects the output:\n\n[horizontal,labelwidth=25,itemwidth=75]\nCPU:: The brain of the computer.\nRAM:: Temporarily stores information the CPU uses during operation.\n\nQ&A list\n\n[qanda]\nWhat is the answer?::\nThis is the answer.\nAre cameras allowed?::\nAre backpacks allowed?::\nNo.\n\nOrdered description list (with numbers)\n\n[ordered]\n&:: ampersand\n>:: greater than\n\n=== Block macros\n\nimage::sunset.jpg[Sunset,300,200]\n\nvideo::mymovie.mp4[]\n\naudio::mysong.mp3[]\n\ntoc::[]\n\ninclude::asciidoc-reader-include.adoc[]\n\n"
  },
  {
    "path": "test/asciidoc-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines\n                    [ Str \"John\"\n                    , Space\n                    , Str \"MacFarlane\"\n                    , Space\n                    , Str \"(\"\n                    , Link\n                        ( \"\" , [] , [] )\n                        [ Str \"jgm@berkeley.edu\" ]\n                        ( \"mailto:jgm@berkeley.edu\" , \"\" )\n                    , Str \")\"\n                    ]\n                , MetaInlines\n                    [ Str \"John\"\n                    , Space\n                    , Str \"Doe\"\n                    , Space\n                    , Str \"(\"\n                    , Link\n                        ( \"\" , [] , [] )\n                        [ Str \"doe@example.com\" ]\n                        ( \"mailto:doe@example.com\" , \"\" )\n                    , Str \")\"\n                    ]\n                ]\n            )\n          , ( \"custom\" , MetaString \"Foo bar baz\" )\n          , ( \"date\" , MetaString \"2025-11-24\" )\n          , ( \"flag\" , MetaBool True )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"AsciiDoc\"\n                , Space\n                , Str \"reader\"\n                , Space\n                , Str \"test\"\n                ]\n            )\n          , ( \"version\" , MetaString \"1.0\" )\n          ]\n    }\n  [ Header\n      1\n      ( \"firsty\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"markup\" ]\n  , Header\n      2\n      ( \"_characters_and_escapes\" , [] , [] )\n      [ Str \"Characters\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"escapes\"\n      ]\n  , Para\n      [ Str \"Dog\\8217s\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"curved\"\n      , Space\n      , Str \"apostrophe,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"dog's\"\n      , Space\n      , Str \"does\"\n      , Space\n      , Str \"not.\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"escaped\"\n      , Space\n      , Str \"symbol:\"\n      , Space\n      , Str \"*star*.\"\n      ]\n  , Para\n      [ Str \"Character\"\n      , Space\n      , Str \"references:\"\n      , Space\n      , Str \"\\228\\160\\8928\"\n      ]\n  , Header\n      2\n      ( \"_line_breaks\" , [] , [] )\n      [ Str \"Line\" , Space , Str \"breaks\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , LineBreak\n      , Str \"break.\"\n      ]\n  , Para\n      [ Str \"Or\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"whole\"\n      , Space\n      , Str \"paragraph\"\n      ]\n  , Div\n      ( \"\"\n      , []\n      , [ ( \"wrapper\" , \"1\" ) , ( \"options\" , \"hardbreaks\" ) ]\n      )\n      [ Para\n          [ Str \"These\"\n          , Space\n          , Str \"are\"\n          , LineBreak\n          , Str \"all\"\n          , LineBreak\n          , Str \"hard\"\n          , LineBreak\n          , Str \"breaks.\"\n          ]\n      ]\n  , Header 2 ( \"_autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/foobar?a=333&b=no%20body\" ]\n          ( \"http://example.com/foobar?a=333&b=no%20body\" , \"\" )\n      , Str \",\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"me@example.com\" ]\n          ( \"me@example.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/foobar?a=333&b=no%20body\" ]\n          ( \"http://example.com/foobar?a=333&b=no%20body\" , \"\" )\n      , Str \",\"\n      , Space\n      , Str \"<\"\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"me@example.com\" ]\n          ( \"me@example.com\" , \"\" )\n      , Str \">\"\n      ]\n  , Header\n      2 ( \"_cross_reference\" , [] , [] ) [ Str \"Cross-reference\" ]\n  , Para\n      [ Str \"See\"\n      , Space\n      , Link\n          ( \"\" , [ \"cross-reference\" ] , [] )\n          [ Str \"Inline\" , Space , Str \"markup\" ]\n          ( \"#firsty\" , \"\" )\n      ]\n  , Para\n      [ Str \"See\"\n      , Space\n      , Link\n          ( \"\" , [ \"cross-reference\" ] , [] )\n          [ Str \"My\"\n          , Space\n          , Str \"great\"\n          , Space\n          , Str \"section\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"Inline\"\n          , Space\n          , Str \"markup\"\n          ]\n          ( \"#firsty\" , \"\" )\n      ]\n  , Para\n      [ Str \"Go\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Link\n          ( \"\" , [ \"cross-reference\" ] , [] )\n          [ Str \"an\" , Space , Str \"inline\" , Space , Str \"anchor\" ]\n          ( \"#anch\" , \"\" )\n      ]\n  , Header 2 ( \"_anchors\" , [] , [] ) [ Str \"Anchors\" ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Span ( \"anch\" , [] , [] ) []\n      , Str \"inline\"\n      , Space\n      , Str \"anchor.\"\n      ]\n  , Para\n      [ Span ( \"[bibanchor\" , [] , [] ) []\n      , Str \"Doe,\"\n      , Space\n      , Str \"John.\"\n      , Space\n      , Str \"A\"\n      , Space\n      , Str \"Book.\"\n      ]\n  , Header\n      2\n      ( \"_inline_macros\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"macros\" ]\n  , Para\n      [ Span ( \"\" , [ \"kbd\" ] , [] ) [ Strong [ Str \"F11\" ] ] ]\n  , Para\n      [ Span ( \"\" , [ \"kbd\" ] , [] ) [ Strong [ Str \"Ctrl\" ] ]\n      , Str \"+\"\n      , Span ( \"\" , [ \"kbd\" ] , [] ) [ Strong [ Str \"Shift\" ] ]\n      , Str \"+\"\n      , Span ( \"\" , [ \"kbd\" ] , [] ) [ Strong [ Str \"F\" ] ]\n      ]\n  , Para\n      [ Span\n          ( \"\" , [ \"menu\" ] , [] )\n          [ Strong [ Str \"File\\160\\8250\\160Save\" ] ]\n      ]\n  , Para\n      [ Span\n          ( \"\" , [ \"menu\" ] , [] )\n          [ Strong\n              [ Str \"Reader\\160\\8250\\160Markdown\\160\\8250\\160Pandoc\" ]\n          ]\n      ]\n  , Para\n      [ Span\n          ( \"\" , [ \"button\" ] , [] ) [ Strong [ Str \"[Cancel]\" ] ]\n      ]\n  , Para\n      [ Image\n          ( \"\" , [ \"red icon\" ] , [] )\n          []\n          ( \"./images/icons/heart.png\" , \"\" )\n      ]\n  , Para [ Str \"anchor:tiger\" ]\n  , Para [ Strong [ Str \"*bold*\" ] ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Get\" , Space , Str \"Report\" ]\n          ( \"downloads/report.pdf\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"tools.html#editors\" ]\n          ( \"tools.html#editors\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Your\" , Space , Str \"files\" ]\n          ( \"file:///home/username\" , \"\" )\n      ]\n  , Para [ Str \"Tricky\" , Space , Str \"cases:\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Get\" , Space , Str \"Report\" ]\n          ( \"My Documents/report.pdf\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Get\" , Space , Str \"Report\" ]\n          ( \"My&#32;Documents/report.pdf\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Get\" , Space , Str \"Report\" ]\n          ( \"My%20Documents/report.pdf\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"https://example.org/now_this__link_works.html\" ]\n          ( \"https://example.org/now_this__link_works.html\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Subscribe\" ]\n          ( \"join@discuss.example.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"mail\" ] , [] )\n          [ Str \"Click,\"\n          , Space\n          , Str \"subscribe,\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"participate!\"\n          ]\n          ( \"join@discuss.example.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"cross-reference\" ] , [] )\n          [ Str \"use\"\n          , Space\n          , Str \"attributes\"\n          , Space\n          , Str \"within\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"macro\"\n          ]\n          ( \"#link-macro-attributes\" , \"\" )\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] ) [ Str \"Sunset\" ] ( \"sunset.jpg\" , \"\" )\n          ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ Plain [ Image ( \"\" , [] , [] ) [] ( \"name.png\" , \"\" ) ] ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ Plain\n          [ Image\n              ( \"\"\n              , []\n              , [ ( \"width\" , \"300px\" ) , ( \"height\" , \"400px\" ) ]\n              )\n              [ Str \"Sunset\" ]\n              ( \"sunset.jpg\" , \"\" )\n          ]\n      ]\n  , Div\n      ( \"\"\n      , []\n      , [ ( \"wrapper\" , \"1\" )\n        , ( \"alt\" , \"Sunset\" )\n        , ( \"height\" , \"400\" )\n        , ( \"width\" , \"300\" )\n        ]\n      )\n      [ Figure\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ Plain [ Image ( \"\" , [] , [] ) [] ( \"sunset.jpg\" , \"\" ) ]\n          ]\n      ]\n  , Para [ Math DisplayMath \"e=mc^2\\n\" ]\n  , Para [ Math DisplayMath \"sin n / 3\\n\" ]\n  , Para [ Math DisplayMath \"e^i\\n\" ]\n  , Header\n      2\n      ( \"_attribute_substitutions\" , [] , [] )\n      [ Str \"Attribute\" , Space , Str \"substitutions\" ]\n  , Para [ Str \"Foo\" , Space , Str \"bar\" , Space , Str \"baz\" ]\n  , Para [ Str \"{nonexistent}\" ]\n  , Para\n      [ Str \"Built\"\n      , Space\n      , Str \"in:\"\n      , Space\n      , Str \"xyz\"\n      , Space\n      , Str \"a\\160b\\8203c'd\\8216\"\n      ]\n  , Header\n      2\n      ( \"_bold_and_italic\" , [] , [] )\n      [ Str \"Bold\" , Space , Str \"and\" , Space , Str \"italic\" ]\n  , Para\n      [ Str \"Constrained:\"\n      , Space\n      , Strong\n          [ Str \"this\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"bold\"\n          , Space\n          , Emph [ Str \"and\" , Space , Str \"italic\" ]\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Unconstrained:\"\n      , Space\n      , Str \"wild\"\n      , Strong\n          [ Str \"content\"\n          , Emph [ Str \"with\" , Space , Str \"italic\" ]\n          , Str \"stuff\"\n          ]\n      , Str \".\"\n      ]\n  , Header 2 ( \"_monospace\" , [] , [] ) [ Str \"Monospace\" ]\n  , Para [ Code ( \"\" , [] , [] ) \"simple\" ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"complex\"\n      , Space\n      , Strong\n          [ Code ( \"\" , [] , [] ) \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"bold\"\n          ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"text\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"and\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Code ( \"\" , [] , [] ) \"foo.html\" ]\n          ( \"foo.html\" , \"\" )\n      ]\n  , Para\n      [ Str \"unconstrained\"\n      , Code ( \"\" , [] , [] ) \"wwow\"\n      , Str \"okay\"\n      ]\n  , Header\n      2\n      ( \"_span_and_inline_attributes\" , [] , [] )\n      [ Str \"Span\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"attributes\"\n      ]\n  , Para\n      [ Span\n          ( \"\" , [ \"red\" ] , [] )\n          [ Str \"Bonjour\" , Space , Strong [ Str \"monsieur\" ] ]\n      ]\n  , Para\n      [ Str \"Un\"\n      , Span ( \"\" , [ \"red\" ] , [] ) [ Str \"constrained\" ]\n      , Str \"content\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Span\n          ( \"\" , [ \"mark\" ] , [] )\n          [ Str \"no\" , Space , Str \"attribute\" ]\n      , Space\n      , Str \"it\\8217s\"\n      , Space\n      , Str \"highlighted.\"\n      ]\n  , Header\n      2\n      ( \"_sub_and_superscript\" , [] , [] )\n      [ Str \"Sub\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"superscript\"\n      ]\n  , Para [ Str \"H\" , Subscript [ Str \"2\" ] , Str \"O\" ]\n  , Para\n      [ Str \"H\"\n      , Subscript [ Str \"a\" , Space , Str \"b\" ]\n      , Str \"O\"\n      ]\n  , Para\n      [ Str \"Not\"\n      , Space\n      , Str \"subscript:\"\n      , Space\n      , Str \"H~a\"\n      , Space\n      , Str \"b~O.\"\n      ]\n  , Para [ Str \"H^2&O\" ]\n  , Para\n      [ Str \"H\"\n      , Superscript [ Str \"a\" , Space , Str \"b\" ]\n      , Str \"O\"\n      ]\n  , Para\n      [ Str \"Not\"\n      , Space\n      , Str \"subscript:\"\n      , Space\n      , Str \"H^a\"\n      , Space\n      , Str \"b^O.\"\n      ]\n  , Header\n      2 ( \"_passthrough\" , [] , [] ) [ Str \"Passthrough\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"special\"\n      , Space\n      , Str \"characters\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"come\"\n      , Space\n      , Str \"through\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"literal:\"\n      ]\n  , Para [ Str \"<b>*test*</b>\" ]\n  , Para [ Str \"xx<b>*test*</b>xx\" ]\n  , Para\n      [ Str \"But\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Str \"they\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"passed\"\n      , Space\n      , Str \"through:\"\n      ]\n  , Para [ Str \"xx\" , Strong [ Str \"*test*\" ] , Str \"xx\" ]\n  , Header 2 ( \"_quoted\" , [] , [] ) [ Str \"Quoted\" ]\n  , Para\n      [ Quoted DoubleQuote [ Str \"double\" , Space , Str \"quoted\" ]\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"single\" , Space , Str \"quoted\" ]\n      ]\n  , Header 2 ( \"_footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Double\"\n      , Note\n          [ Para\n              [ Str \"The\"\n              , Space\n              , Str \"double\"\n              , Space\n              , Str \"hail-and-rainbow\"\n              , Space\n              , Str \"level\"\n              , Space\n              , Str \"makes\"\n              , Space\n              , Str \"my\"\n              , Space\n              , Str \"toes\"\n              , Space\n              , Str \"tingle.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"bold\"\n      , Space\n      , Str \"statement!\"\n      , Note\n          [ Para\n              [ Str \"Opinions\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"my\"\n              , Space\n              , Str \"own.\"\n              ]\n          ]\n      , SoftBreak\n      , Str \"Another\"\n      , Space\n      , Str \"outrageous\"\n      , Space\n      , Str \"statement.\"\n      , Note\n          [ Para\n              [ Str \"Opinions\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"my\"\n              , Space\n              , Str \"own.\"\n              ]\n          ]\n      ]\n  , Header\n      1\n      ( \"_block_markup\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"markup\" ]\n  , Header 2 ( \"_sections\" , [] , [] ) [ Str \"Sections\" ]\n  , Header\n      3\n      ( \"_another_level\" , [] , [] )\n      [ Str \"Another\" , Space , Str \"level\" ]\n  , Header\n      4 ( \"_level_5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      3\n      ( \"_markdown_style\" , [] , [] )\n      [ Str \"Markdown\" , Space , Str \"style\" ]\n  , Header\n      4\n      ( \"_level_5_2\" , [] , [] )\n      [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      2\n      ( \"_discrete_heading\" , [] , [] )\n      [ Str \"Discrete\" , Space , Str \"heading\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"A\"\n      , Space\n      , Str \"discrete\"\n      , Space\n      , Str \"heading,\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"section\"\n      ]\n  , Header 2 ( \"_paragraph\" , [] , [] ) [ Str \"Paragraph\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , SoftBreak\n      , Str \"whose\"\n      , Space\n      , Str \"source\"\n      , Space\n      , Str \"fits\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"lines.\"\n      ]\n  , Para\n      [ Str \"{.This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"my\"\n      , Space\n      , Str \"title}\"\n      , SoftBreak\n      , Str \"A\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"title.\"\n      ]\n  , Header\n      2\n      ( \"_example_block\" , [] , [] )\n      [ Str \"Example\" , Space , Str \"block\" ]\n  , Div\n      ( \"\" , [] , [] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para [ Str \"Optional\" , Space , Str \"title\" ] ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"example\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"example\"\n          , Space\n          , Str \"block.\"\n          ]\n      ]\n  , Div\n      ( \"\" , [ \"example\" ] , [] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para [ Str \"Optional\" , Space , Str \"title\" ] ]\n      , Para\n          [ Str \"Paragraph\" , Space , Strong [ Str \"one\" ] , Str \".\" ]\n      , Para\n          [ Str \"Paragraph\" , Space , Strong [ Str \"two\" ] , Str \".\" ]\n      ]\n  , Header 2 ( \"_admonition\" , [] , [] ) [ Str \"Admonition\" ]\n  , Para [ Str \"Simple\" , Space , Str \"form:\" ]\n  , Div\n      ( \"\" , [ \"warning\" ] , [] )\n      [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Warning\" ] ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"very\"\n          , Space\n          , Str \"dangerous.\"\n          , SoftBreak\n          , Str \"Don\\8217t\"\n          , Space\n          , Str \"do\"\n          , Space\n          , Str \"it\"\n          , Space\n          , Str \"unless\"\n          , Space\n          , Str \"you\"\n          , Space\n          , Str \"understand\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"risks.\"\n          ]\n      ]\n  , Div\n      ( \"\" , [ \"important\" ] , [] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para\n              [ Str \"Title\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"admonition\"\n              ]\n          ]\n      , Para [ Str \"Remember:\" ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para\n                [ Str \"Don\\8217t\"\n                , Space\n                , Str \"do\"\n                , Space\n                , Str \"this.\"\n                ]\n            ]\n          , [ Para\n                [ Str \"And\"\n                , Space\n                , Str \"don\\8217t\"\n                , Space\n                , Str \"do\"\n                , Space\n                , Str \"that.\"\n                ]\n            ]\n          ]\n      ]\n  , Header 2 ( \"_sidebar\" , [] , [] ) [ Str \"Sidebar\" ]\n  , Para\n      [ Str \"A\" , Space , Str \"simple\" , Space , Str \"sidebar.\" ]\n  , Div\n      ( \"\" , [ \"sidebar\" ] , [] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para\n              [ Str \"Optional\"\n              , Space\n              , Str \"Title\"\n              , Space\n              , Strong\n                  [ Str \"with\"\n                  , Space\n                  , Str \"strong\"\n                  , Space\n                  , Str \"emphasis\"\n                  ]\n              ]\n          ]\n      , Para\n          [ Str \"Here\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"sidebar.\"\n          ]\n      , Div\n          ( \"\" , [ \"tip\" ] , [] )\n          [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Tip\" ] ]\n          , Para\n              [ Str \"It\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"contain\"\n              , Space\n              , Str \"any\"\n              , Space\n              , Str \"type\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"content.\"\n              ]\n          ]\n      ]\n  , Header\n      2\n      ( \"_literal_block\" , [] , [] )\n      [ Str \"Literal\" , Space , Str \"block\" ]\n  , Para\n      [ Str \"Short\"\n      , Space\n      , Str \"indented\"\n      , Space\n      , Str \"code:\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"$ ls -a\\n$ cat /foo/bar/baz \\\\\\n     /bi/bim/bop\\n\"\n  , CodeBlock\n      ( \"\" , [] , [] ) \"This is\\n  a literal block too.\\n\"\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"  Fenced\\n    $+ *a* literal\\n\\n****\\nnot a sidebar\\n****\\n\"\n  , Header 2 ( \"_listing\" , [] , [] ) [ Str \"Listing\" ]\n  , CodeBlock\n      ( \"\" , [ \"ruby\" ] , [] )\n      \"require 'sinatra'\\n\\nget '/hi' do\\n  \\\"Hello World!\\\"\\nend\"\n  , Para [ Str \"Implied:\" ]\n  , CodeBlock\n      ( \"\" , [ \"ruby\" ] , [] )\n      \"require 'sinatra'\\n\\nget '/hi' do\\n  \\\"Hello World!\\\"\\nend\"\n  , CodeBlock\n      ( \"\" , [ \"ruby\" ] , [] )\n      \"# A function\\ndef foo\\n  return 42\\nend\"\n  , CodeBlock\n      ( \"hello\" , [ \"haskell\" ] , [] )\n      \"putStrLn $ unwords [\\\"Hello\\\", \\\"world\\\"]\"\n  , Para [ Str \"Line\" , Space , Str \"numbering:\" ]\n  , CodeBlock\n      ( \"\" , [] , [ ( \"options\" , \"linenums\" ) ] )\n      \"puts 1\\nputs 2\\nputs 3\"\n  , CodeBlock\n      ( \"\" , [] , [] ) \"This doesn't have a language.\\n  +=\\\"hi\\\"\"\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"callout\"\n      , Space\n      , Str \"list:\"\n      ]\n  , CodeBlock\n      ( \"\" , [ \"ruby\" ] , [] )\n      \"require 'sinatra' \\9312\\n\\nget '/hi' do \\9313 \\9314\\n  \\\"Hello World!\\\"\\nend\"\n  , Div\n      ( \"\" , [ \"callout-list\" ] , [] )\n      [ OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"Library\" , Space , Str \"import\" ] ]\n          , [ Para [ Str \"URL\" , Space , Str \"mapping\" ] ]\n          , [ Para [ Str \"Response\" , Space , Str \"block\" ] ]\n          ]\n      ]\n  , Para [ Str \"Markdown-style\" , Space , Str \"fenced:\" ]\n  , CodeBlock\n      ( \"\" , [ \"ruby\" ] , [] ) \"def foo\\n  return 5\\nend\"\n  , Header 2 ( \"_verse\" , [] , [] ) [ Str \"Verse\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"The\"\n          , Space\n          , Str \"fog\"\n          , Space\n          , Str \"comes\"\n          , LineBreak\n          , Str \"on\"\n          , Space\n          , Str \"little\"\n          , Space\n          , Str \"cat\"\n          , Space\n          , Str \"feet.\"\n          ]\n      , Para\n          [ Str \"\\8212\"\n          , Space\n          , Str \"Carl\"\n          , Space\n          , Str \"Sandburg,\"\n          , Space\n          , Str \"two\"\n          , Space\n          , Str \"lines\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"poem\"\n          , Space\n          , Str \"Fog\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"The\"\n          , Space\n          , Str \"fog\"\n          , Space\n          , Str \"comes\"\n          , LineBreak\n          , Str \"on\"\n          , Space\n          , Str \"little\"\n          , Space\n          , Str \"cat\"\n          , Space\n          , Str \"feet.\"\n          , LineBreak\n          , Str \"It\"\n          , Space\n          , Str \"sits\"\n          , Space\n          , Str \"looking\"\n          , LineBreak\n          , Str \"over\"\n          , Space\n          , Str \"harbor\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"city\"\n          , LineBreak\n          , Str \"on\"\n          , Space\n          , Str \"silent\"\n          , Space\n          , Str \"haunches\"\n          , LineBreak\n          , Str \"and\"\n          , Space\n          , Str \"then\"\n          , Space\n          , Str \"moves\"\n          , Space\n          , Str \"on.\"\n          ]\n      , Para\n          [ Str \"\\8212\"\n          , Space\n          , Str \"Carl\"\n          , Space\n          , Str \"Sandburg,\"\n          , Space\n          , Str \"Fog\"\n          ]\n      ]\n  , Header\n      2 ( \"_collapsible\" , [] , [] ) [ Str \"Collapsible\" ]\n  , Para\n      [ Str \"Click\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"more.\"\n      ]\n  , Div\n      ( \"\"\n      , [ \"example\" ]\n      , [ ( \"options\" , \"collapsible,open\" ) ]\n      )\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"collapsible.\"\n          ]\n      , Para\n          [ Str \"It\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"hidden.\"\n          ]\n      ]\n  , Div\n      ( \"\" , [] , [ ( \"options\" , \"collapsible\" ) ] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para [ Str \"Click\" , Space , Str \"me!\" ] ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"paragraph\"\n          , Space\n          , Str \"is\"\n          , SoftBreak\n          , Str \"also\"\n          , Space\n          , Str \"collapsible.\"\n          ]\n      ]\n  , Header 2 ( \"_quote\" , [] , [] ) [ Str \"Quote\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"Everybody\"\n          , Space\n          , Str \"remember\"\n          , Space\n          , Str \"where\"\n          , Space\n          , Str \"we\"\n          , Space\n          , Str \"parked.\"\n          ]\n      , Para\n          [ Str \"\\8212\"\n          , Space\n          , Str \"Captain\"\n          , Space\n          , Str \"James\"\n          , Space\n          , Str \"T.\"\n          , Space\n          , Str \"Kirk,\"\n          , Space\n          , Str \"Star\"\n          , Space\n          , Str \"Trek\"\n          , Space\n          , Str \"IV:\"\n          , Space\n          , Str \"The\"\n          , Space\n          , Str \"Voyage\"\n          , Space\n          , Str \"Home\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Dennis:\"\n          , Space\n          , Str \"Come\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"see\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"violence\"\n          , Space\n          , Str \"inherent\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"system.\"\n          , Space\n          , Str \"Help!\"\n          , Space\n          , Str \"Help!\"\n          , Space\n          , Str \"I\\8217m\"\n          , Space\n          , Str \"being\"\n          , SoftBreak\n          , Str \"repressed.\"\n          ]\n      , Para\n          [ Str \"King\"\n          , Space\n          , Str \"Arthur:\"\n          , Space\n          , Str \"Bloody\"\n          , Space\n          , Str \"peasant!\"\n          ]\n      , Para\n          [ Str \"Dennis:\"\n          , Space\n          , Str \"Oh,\"\n          , Space\n          , Str \"what\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"giveaway!\"\n          , Space\n          , Str \"Did\"\n          , Space\n          , Str \"you\"\n          , Space\n          , Str \"hear\"\n          , Space\n          , Str \"that?\"\n          , Space\n          , Str \"Did\"\n          , Space\n          , Str \"you\"\n          , Space\n          , Str \"hear\"\n          , Space\n          , Str \"that,\"\n          , Space\n          , Str \"eh?\"\n          , Space\n          , Str \"That\\8217s\"\n          , Space\n          , Str \"what\"\n          , Space\n          , Str \"I\\8217m\"\n          , SoftBreak\n          , Str \"on\"\n          , Space\n          , Str \"about!\"\n          , Space\n          , Str \"Did\"\n          , Space\n          , Str \"you\"\n          , Space\n          , Str \"see\"\n          , Space\n          , Str \"him\"\n          , Space\n          , Str \"repressing\"\n          , Space\n          , Str \"me?\"\n          , Space\n          , Str \"You\"\n          , Space\n          , Str \"saw\"\n          , Space\n          , Str \"him,\"\n          , Space\n          , Str \"Didn\\8217t\"\n          , Space\n          , Str \"you?\"\n          ]\n      , Para\n          [ Str \"\\8212\"\n          , Space\n          , Str \"Monty\"\n          , Space\n          , Str \"Python\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"Holy\"\n          , Space\n          , Str \"Grail\"\n          ]\n      ]\n  , Div\n      ( \"roads\" , [ \"movie\" ] , [ ( \"wrapper\" , \"1\" ) ] )\n      [ BlockQuote\n          [ Para\n              [ Str \"Roads?\"\n              , Space\n              , Str \"Where\"\n              , Space\n              , Str \"we\\8217re\"\n              , Space\n              , Str \"going,\"\n              , Space\n              , Str \"we\"\n              , Space\n              , Str \"don\\8217t\"\n              , Space\n              , Str \"need\"\n              , Space\n              , Str \"roads.\"\n              ]\n          , Para\n              [ Str \"\\8212\"\n              , Space\n              , Str \"Dr.\"\n              , Space\n              , Str \"Emmett\"\n              , Space\n              , Str \"Brown\"\n              ]\n          ]\n      ]\n  , Header 2 ( \"_pass\" , [] , [] ) [ Str \"Pass\" ]\n  , Para [ Str \"pass\" , Space , Emph [ Str \"through\" ] ]\n  , Header\n      2\n      ( \"_open_block\" , [] , [] )\n      [ Str \"Open\" , Space , Str \"block\" ]\n  , Div\n      ( \"\" , [] , [ ( \"key\" , \"a value\" ) ] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para [ Str \"A\" , Space , Str \"title.\" ] ]\n      , Para\n          [ Str \"Any\"\n          , Space\n          , Str \"content\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"go\"\n          , Space\n          , Str \"here:\"\n          ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"one\" ] ] , [ Para [ Str \"two\" ] ] ]\n      ]\n  , Header 2 ( \"_anchor\" , [] , [] ) [ Str \"Anchor\" ]\n  , Div\n      ( \"goals\" , [] , [ ( \"wrapper\" , \"1\" ) ] )\n      [ BulletList\n          [ [ Para [ Str \"one\" ] ] , [ Para [ Str \"two\" ] ] ]\n      ]\n  , Header 2 ( \"_breaks\" , [] , [] ) [ Str \"Breaks\" ]\n  , Para\n      [ Str \"Asciidoc\"\n      , Space\n      , Str \"thematic\"\n      , Space\n      , Str \"break:\"\n      ]\n  , HorizontalRule\n  , Para [ Str \"Markdown\" , Space , Str \"style:\" ]\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , Para [ Str \"Page\" , Space , Str \"breaks:\" ]\n  , Div\n      ( \"\" , [ \"page-break\" ] , [ ( \"wrapper\" , \"1\" ) ] )\n      [ HorizontalRule ]\n  , Div\n      ( \"\"\n      , [ \"page-break\" ]\n      , [ ( \"options\" , \"always\" ) , ( \"wrapper\" , \"1\" ) ]\n      )\n      [ HorizontalRule ]\n  , Header 2 ( \"_list\" , [] , [] ) [ Str \"List\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"Edgar\" , Space , Str \"Allan\" , Space , Str \"Poe\" ]\n        ]\n      , [ Para\n            [ Str \"Sheri\" , Space , Str \"S.\" , Space , Str \"Tepper\" ]\n        ]\n      , [ Para [ Str \"Bill\" , Space , Str \"Bryson\" ] ]\n      ]\n  , Div\n      ( \"\" , [] , [] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para\n              [ Str \"Kizmet\\8217s\"\n              , Space\n              , Str \"Favorite\"\n              , Space\n              , Str \"Authors\"\n              ]\n          ]\n      , BulletList\n          [ [ Para\n                [ Str \"Edgar\"\n                , Space\n                , Str \"Allan\"\n                , Space\n                , Str \"Poe\"\n                ]\n            ]\n          , [ Para\n                [ Str \"Sheri\"\n                , Space\n                , Str \"S.\"\n                , Space\n                , Str \"Tepper\"\n                ]\n            ]\n          , [ Para [ Str \"Bill\" , Space , Str \"Bryson\" ] ]\n          ]\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"Edgar\" , Space , Str \"Allan\" , Space , Str \"Poe\" ]\n        ]\n      , [ Para\n            [ Str \"Sheri\" , Space , Str \"S.\" , Space , Str \"Tepper\" ]\n        ]\n      , [ Para [ Str \"Bill\" , Space , Str \"Bryson\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Nested\" , Space , Str \"list\" ]\n        , BulletList\n            [ [ Para\n                  [ Str \"West\"\n                  , Space\n                  , Str \"wood\"\n                  , Space\n                  , Str \"maze\"\n                  ]\n              , BulletList\n                  [ [ Para [ Str \"Maze\" , Space , Str \"heart\" ]\n                    , BulletList\n                        [ [ Para\n                              [ Str \"Reflection\" , Space , Str \"pool\" ]\n                          ]\n                        ]\n                    ]\n                  , [ Para [ Str \"Secret\" , Space , Str \"exit\" ] ]\n                  ]\n              ]\n            , [ Para\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"1\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  ]\n              , BulletList\n                  [ [ Para\n                        [ Str \"Level\"\n                        , Space\n                        , Str \"2\"\n                        , Space\n                        , Str \"list\"\n                        , Space\n                        , Str \"item\"\n                        ]\n                    , BulletList\n                        [ [ Para\n                              [ Str \"Level\"\n                              , Space\n                              , Str \"3\"\n                              , Space\n                              , Str \"list\"\n                              , Space\n                              , Str \"item\"\n                              ]\n                          , BulletList\n                              [ [ Para\n                                    [ Str \"Level\"\n                                    , Space\n                                    , Str \"4\"\n                                    , Space\n                                    , Str \"list\"\n                                    , Space\n                                    , Str \"item\"\n                                    ]\n                                , BulletList\n                                    [ [ Para\n                                          [ Str \"Level\"\n                                          , Space\n                                          , Str \"5\"\n                                          , Space\n                                          , Str \"list\"\n                                          , Space\n                                          , Str \"item\"\n                                          ]\n                                      , BulletList\n                                          [ [ Para [ Str \"etc.\" ] ] ]\n                                      ]\n                                    ]\n                                ]\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Para\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"1\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Para [ Str \"one\" ] ]\n      , [ Para [ Str \"two\" ] ]\n      , [ Para [ Str \"three\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Protons\" ] ]\n      , [ Para [ Str \"Electrons\" ] ]\n      , [ Para [ Str \"Neutrons\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Protons\" ] ]\n      , [ Para [ Str \"Electrons\" ] ]\n      , [ Para [ Str \"Neutrons\" ] ]\n      ]\n  , Para\n      [ Str \"Start\" , Space , Str \"with\" , Space , Str \"4:\" ]\n  , OrderedList\n      ( 4 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Step\" , Space , Str \"four\" ] ]\n      , [ Para [ Str \"Step\" , Space , Str \"five\" ] ]\n      , [ Para [ Str \"Step\" , Space , Str \"six\" ] ]\n      ]\n  , Para [ Str \"or\" ]\n  , OrderedList\n      ( 4 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Step\" , Space , Str \"four\" ] ]\n      , [ Para [ Str \"Step\" , Space , Str \"five\" ] ]\n      , [ Para [ Str \"Step\" , Space , Str \"six\" ] ]\n      ]\n  , Para [ Str \"Reversed:\" ]\n  , Div\n      ( \"\" , [] , [ ( \"options\" , \"reversed\" ) ] )\n      [ Div\n          ( \"\" , [ \"title\" ] , [] )\n          [ Para\n              [ Str \"Parts\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Str \"atom\"\n              ]\n          ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"Protons\" ] ]\n          , [ Para [ Str \"Electrons\" ] ]\n          , [ Para [ Str \"Neutrons\" ] ]\n          ]\n      ]\n  , Para [ Str \"Nested\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Step\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Step\" , Space , Str \"2\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Para [ Str \"Step\" , Space , Str \"2a\" ] ]\n            , [ Para [ Str \"Step\" , Space , Str \"2b\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Step\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Mixed\" , Space , Str \"nested\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Linux\" ]\n        , BulletList\n            [ [ Para [ Str \"Fedora\" ] ]\n            , [ Para [ Str \"Ubuntu\" ] ]\n            , [ Para [ Str \"Slackware\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"BSD\" ]\n        , BulletList\n            [ [ Para [ Str \"FreeBSD\" ] ] , [ Para [ Str \"NetBSD\" ] ] ]\n        ]\n      ]\n  , Para [ Str \"With\" , Space , Str \"spacing\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Linux\" ]\n        , BulletList\n            [ [ Para [ Str \"Fedora\" ] ]\n            , [ Para [ Str \"Ubuntu\" ] ]\n            , [ Para [ Str \"Slackware\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"BSD\" ]\n        , BulletList\n            [ [ Para [ Str \"FreeBSD\" ] ] , [ Para [ Str \"NetBSD\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"With\" , Space , Str \"number\" , Space , Str \"styles\" ]\n  , OrderedList\n      ( 5 , LowerRoman , DefaultDelim )\n      [ [ Para [ Str \"Five\" ] ]\n      , [ Para [ Str \"Six\" ]\n        , OrderedList\n            ( 1 , LowerAlpha , DefaultDelim )\n            [ [ Para [ Str \"a\" ] ]\n            , [ Para [ Str \"b\" ] ]\n            , [ Para [ Str \"c\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Seven\" ] ]\n      ]\n  , Para [ Str \"Checklist\" ]\n  , BulletList\n      [ [ Para [ Str \"\\9746\" , Space , Str \"checked\" ] ]\n      , [ Para\n            [ Str \"\\9746\" , Space , Str \"also\" , Space , Str \"checked\" ]\n        ]\n      , [ Para\n            [ Str \"\\9744\" , Space , Str \"not\" , Space , Str \"checked\" ]\n        ]\n      , [ Para\n            [ Str \"normal\" , Space , Str \"list\" , Space , Str \"item\" ]\n        ]\n      ]\n  , Para\n      [ Str \"Separate\"\n      , Space\n      , Str \"lists\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"attribute\"\n      ]\n  , BulletList\n      [ [ Para [ Str \"Apples\" ] ]\n      , [ Para [ Str \"Oranges\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Para [ Str \"Wash\" ] ] , [ Para [ Str \"Slice\" ] ] ]\n        ]\n      ]\n  , Para [ Str \"Multiline\" , Space , Str \"items\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"Blah\"\n            , Space\n            , Str \"blah.\"\n            , SoftBreak\n            , Str \"Blah\"\n            , Space\n            , Str \"blah.\"\n            ]\n        ]\n      , [ Para\n            [ Str \"The\"\n            , Space\n            , Str \"document\"\n            , Space\n            , Str \"header\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"AsciiDoc\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"optional.\"\n            , SoftBreak\n            , Str \"If\"\n            , Space\n            , Str \"present,\"\n            , Space\n            , Str \"it\"\n            , Space\n            , Str \"must\"\n            , Space\n            , Str \"start\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"document\"\n            , Space\n            , Str \"title.\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"Optional\"\n            , Space\n            , Str \"author\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"revision\"\n            , Space\n            , Str \"information\"\n            , Space\n            , Str \"lines\"\n            , SoftBreak\n            , Str \"immediately\"\n            , Space\n            , Str \"follow\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"document\"\n            , Space\n            , Str \"title.\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"The\"\n            , Space\n            , Str \"document\"\n            , Space\n            , Str \"header\"\n            , Space\n            , Str \"must\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"separated\"\n            , Space\n            , Str \"from\"\n            , SoftBreak\n            , Str \"the\"\n            , Space\n            , Str \"remainder\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"document\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"or\"\n            , Space\n            , Str \"more\"\n            , SoftBreak\n            , Str \"empty\"\n            , Space\n            , Str \"lines\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"it\"\n            , Space\n            , Str \"cannot\"\n            , Space\n            , Str \"contain\"\n            , Space\n            , Str \"empty\"\n            , Space\n            , Str \"lines.\"\n            ]\n        ]\n      ]\n  , Para [ Str \"Complex\" , Space , Str \"item\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"The\"\n            , Space\n            , Str \"header\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"AsciiDoc\"\n            , Space\n            , Str \"must\"\n            , Space\n            , Str \"start\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"document\"\n            , Space\n            , Str \"title.\"\n            ]\n        , CodeBlock ( \"\" , [] , [] ) \"= Document Title\"\n        , Para\n            [ Str \"Keep\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"mind\"\n            , Space\n            , Str \"that\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"header\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"optional.\"\n            ]\n        ]\n      , [ Para\n            [ Str \"Optional\"\n            , Space\n            , Str \"author\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"revision\"\n            , Space\n            , Str \"information\"\n            , Space\n            , Str \"lines\"\n            , Space\n            , Str \"immediately\"\n            , Space\n            , Str \"follow\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"document\"\n            , SoftBreak\n            , Str \"title.\"\n            ]\n        , CodeBlock\n            ( \"\" , [] , [] )\n            \"= Document Title\\nDoc Writer <doc.writer@asciidoc.org>\\nv1.0, 2022-01-01\"\n        ]\n      , [ Para [ Str \"Second\" , Space , Str \"item\" ] ]\n      ]\n  , Para\n      [ Str \"Empty\"\n      , Space\n      , Str \"principle\"\n      , Space\n      , Str \"element:\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [] , CodeBlock ( \"\" , [] , [] ) \"test\" ] ]\n  , Header 2 ( \"_table\" , [] , [] ) [ Str \"Table\" ]\n  , Header\n      3\n      ( \"_simple_with_column_specs\" , [] , [] )\n      [ Str \"Simple\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"specs\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.375 )\n      , ( AlignDefault , ColWidth 0.25 )\n      , ( AlignDefault , ColWidth 0.375 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"This\"\n                     , Space\n                     , Str \"content\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"placed\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"first\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"of\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"1\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"This\"\n                     , Space\n                     , Str \"line\"\n                     , Space\n                     , Str \"starts\"\n                     , Space\n                     , Str \"with\"\n                     , Space\n                     , Str \"a\"\n                     , Space\n                     , Str \"vertical\"\n                     , Space\n                     , Str \"bar\"\n                     , Space\n                     , Str \"so\"\n                     , Space\n                     , Str \"this\"\n                     , Space\n                     , Str \"content\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"placed\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"a\"\n                     , Space\n                     , Str \"new\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"in\"\n                     , SoftBreak\n                     , Str \"column\"\n                     , Space\n                     , Str \"2\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"When\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"processor\"\n                     , Space\n                     , Str \"encounters\"\n                     , Space\n                     , Str \"a\"\n                     , Space\n                     , Str \"whitespace\"\n                     , Space\n                     , Str \"followed\"\n                     , Space\n                     , Str \"by\"\n                     , Space\n                     , Str \"a\"\n                     , Space\n                     , Str \"vertical\"\n                     , Space\n                     , Str \"bar\"\n                     , Space\n                     , Str \"it\"\n                     , SoftBreak\n                     , Str \"ends\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"previous\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"and\"\n                     , Space\n                     , Str \"starts\"\n                     , Space\n                     , Str \"a\"\n                     , Space\n                     , Str \"new\"\n                     , Space\n                     , Str \"cell\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      3\n      ( \"_repeated_column_in_specs\" , [] , [] )\n      [ Str \"Repeated\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"specs\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignRight\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Strong\n                         [ Str \"This\"\n                         , Space\n                         , Str \"cell\\8217s\"\n                         , Space\n                         , Str \"specifier\"\n                         , Space\n                         , Str \"indicates\"\n                         , Space\n                         , Str \"that\"\n                         , Space\n                         , Str \"this\"\n                         , Space\n                         , Str \"cell\\8217s\"\n                         , Space\n                         , Str \"content\"\n                         , Space\n                         , Str \"is\"\n                         , Space\n                         , Str \"right-aligned\"\n                         , Space\n                         , Str \"and\"\n                         , Space\n                         , Str \"bold.\"\n                         ]\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"The\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"specifier\"\n                     , Space\n                     , Str \"on\"\n                     , Space\n                     , Str \"this\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"hasn\\8217t\"\n                     , Space\n                     , Str \"been\"\n                     , Space\n                     , Str \"set\"\n                     , Space\n                     , Str \"explicitly,\"\n                     , Space\n                     , Str \"so\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"default\"\n                     , SoftBreak\n                     , Str \"properties\"\n                     , Space\n                     , Str \"are\"\n                     , Space\n                     , Str \"applied.\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      3\n      ( \"_simple_without_column_specs\" , [] , [] )\n      [ Str \"Simple\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"specs\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"1,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"2,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"3\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"3\"\n                     ]\n                 ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_with_caption\" , [] , [] )\n      [ Str \"With\" , Space , Str \"caption\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"My\" , Space , Str \"cool\" , Space , Str \"table.\" ]\n         ])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"1,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"2,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"3\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"3\"\n                     ]\n                 ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_no_header\" , [] , [] )\n      [ Str \"No\" , Space , Str \"header\" ]\n  , Para\n      [ Str \"By\"\n      , Space\n      , Str \"default\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"first\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"turn\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"header,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"this\"\n      , SoftBreak\n      , Str \"can\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"disabled:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"1,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"1\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"2,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"1\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"2\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"2\"\n                     ]\n                 ]\n             ]\n         ])\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"explicitly\"\n      , Space\n      , Str \"enabled:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Cell\" , Space , Str \"A1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Cell\" , Space , Str \"B1\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Cell\" , Space , Str \"A2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Cell\" , Space , Str \"B2\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Cell\" , Space , Str \"A3\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Cell\" , Space , Str \"B3\" ] ]\n             ]\n         ])\n  , Header 3 ( \"_footer\" , [] , [] ) [ Str \"Footer\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.4 )\n      , ( AlignDefault , ColWidth 0.4 )\n      , ( AlignDefault , ColWidth 0.2 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"3,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"1,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"2,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"3,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"footer\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"footer\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"3,\"\n                     , Space\n                     , Str \"footer\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n  , Para [ Str \"or\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"1,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"2,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"1,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"3\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"2,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"3\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"footer\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"footer\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n  , Header 3 ( \"_alignment\" , [] , [] ) [ Str \"Alignment\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Column\" , Space , Str \"Name\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Column\" , Space , Str \"Name\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignCenter\n                  (RowSpan 1)\n                  (ColSpan 2)\n                  [ Para\n                      [ Str \"This\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"spans\"\n                      , Space\n                      , Str \"two\"\n                      , Space\n                      , Str \"columns,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"its\"\n                      , Space\n                      , Str \"content\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"horizontally\"\n                      , Space\n                      , Str \"centered\"\n                      , Space\n                      , Str \"because\"\n                      , Space\n                      , Str \"the\"\n                      , SoftBreak\n                      , Str \"cell\"\n                      , Space\n                      , Str \"specifier\"\n                      , Space\n                      , Str \"includes\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Code ( \"\" , [] , [] ) \"^\"\n                      , Space\n                      , Str \"operator.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignCenter\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"This\"\n                     , Space\n                     , Str \"content\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"duplicated\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"two\"\n                     , Space\n                     , Str \"adjacent\"\n                     , Space\n                     , Str \"columns.\"\n                     , SoftBreak\n                     , Str \"Its\"\n                     , Space\n                     , Str \"content\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"horizontally\"\n                     , Space\n                     , Str \"centered\"\n                     , Space\n                     , Str \"because\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"specifier\"\n                     , SoftBreak\n                     , Str \"includes\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"^\"\n                     , Space\n                     , Str \"operator.\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignCenter\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"This\"\n                     , Space\n                     , Str \"content\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"duplicated\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"two\"\n                     , Space\n                     , Str \"adjacent\"\n                     , Space\n                     , Str \"columns.\"\n                     , SoftBreak\n                     , Str \"Its\"\n                     , Space\n                     , Str \"content\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"horizontally\"\n                     , Space\n                     , Str \"centered\"\n                     , Space\n                     , Str \"because\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"specifier\"\n                     , SoftBreak\n                     , Str \"includes\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"^\"\n                     , Space\n                     , Str \"operator.\"\n                     ]\n                 ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_multiple_paragraphs_in_cells\" , [] , [] )\n      [ Str \"Multiple\"\n      , Space\n      , Str \"paragraphs\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"cells\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault ) ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Single\"\n                     , Space\n                     , Str \"paragraph\"\n                     , Space\n                     , Str \"on\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"1\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"First\"\n                     , Space\n                     , Str \"paragraph\"\n                     , Space\n                     , Str \"on\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"2\"\n                     ]\n                 , Para\n                     [ Str \"Second\"\n                     , Space\n                     , Str \"paragraph\"\n                     , Space\n                     , Str \"on\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"2\"\n                     ]\n                 ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_complex_table\" , [] , [] )\n      [ Str \"Complex\" , Space , Str \"table\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignRight\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Code ( \"\" , [] , [] ) \"This\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"content\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"is\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"duplicated\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"across\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"two\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"columns.\"\n                     ]\n                 , Para\n                     [ Code ( \"\" , [] , [] ) \"It\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"is\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"aligned\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"right\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"horizontally.\"\n                     ]\n                 , Para\n                     [ Code ( \"\" , [] , [] ) \"And\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"it\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"is\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"monospaced.\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignRight\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Code ( \"\" , [] , [] ) \"This\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"content\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"is\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"duplicated\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"across\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"two\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"columns.\"\n                     ]\n                 , Para\n                     [ Code ( \"\" , [] , [] ) \"It\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"is\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"aligned\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"right\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"horizontally.\"\n                     ]\n                 , Para\n                     [ Code ( \"\" , [] , [] ) \"And\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"it\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"is\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"monospaced.\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignCenter\n                  (RowSpan 2)\n                  (ColSpan 1)\n                  [ Para\n                      [ Strong\n                          [ Str \"This\"\n                          , Space\n                          , Str \"cell\"\n                          , Space\n                          , Str \"spans\"\n                          , Space\n                          , Str \"3\"\n                          , Space\n                          , Str \"rows.\"\n                          , Space\n                          , Str \"The\"\n                          , Space\n                          , Str \"content\"\n                          , Space\n                          , Str \"is\"\n                          , Space\n                          , Str \"centered\"\n                          , Space\n                          , Str \"horizontally,\"\n                          , Space\n                          , Str \"aligned\"\n                          , Space\n                          , Str \"to\"\n                          , Space\n                          , Str \"the\"\n                          , Space\n                          , Str \"bottom\"\n                          , Space\n                          , Str \"of\"\n                          , Space\n                          , Str \"the\"\n                          , Space\n                          , Str \"cell,\"\n                          , Space\n                          , Str \"and\"\n                          , Space\n                          , Str \"strong.\"\n                          ]\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Emph\n                          [ Str \"This\"\n                          , Space\n                          , Str \"content\"\n                          , Space\n                          , Str \"is\"\n                          , Space\n                          , Str \"emphasized.\"\n                          ]\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ CodeBlock\n                      ( \"\" , [] , [] )\n                      \"This content is aligned to the top of the cell and literal.\\n\\n\"\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ CodeBlock\n                     ( \"\" , [] , [] ) \"puts \\\"This is a source block!\\\"\"\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             ]\n         ])\n  , Header\n      3\n      ( \"_column_styles\" , [] , [] )\n      [ Str \"Column\" , Space , Str \"styles\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Code ( \"\" , [] , [] ) \"monospace\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Code ( \"\" , [] , [] ) \"mono\" ] ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"default\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Code ( \"\" , [] , [] ) \"mono\" ] ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_block_elements_in_cells\" , [] , [] )\n      [ Str \"Block\"\n      , Space\n      , Str \"elements\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"cells\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Normal\" , Space , Str \"Style\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"AsciiDoc\" , Space , Str \"Style\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"This\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"isn\\8217t\"\n                      , Space\n                      , Str \"prefixed\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"an\"\n                      , Space\n                      , Code ( \"\" , [] , [] ) \"a\"\n                      , Str \",\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"processor\"\n                      , Space\n                      , Str \"doesn\\8217t\"\n                      , Space\n                      , Str \"interpret\"\n                      , Space\n                      , Str \"the\"\n                      , SoftBreak\n                      , Str \"following\"\n                      , Space\n                      , Str \"lines\"\n                      , Space\n                      , Str \"as\"\n                      , Space\n                      , Str \"an\"\n                      , Space\n                      , Str \"AsciiDoc\"\n                      , Space\n                      , Str \"list.\"\n                      ]\n                  , Para\n                      [ Str \"*\"\n                      , Space\n                      , Str \"List\"\n                      , Space\n                      , Str \"item\"\n                      , Space\n                      , Str \"1\"\n                      , SoftBreak\n                      , Str \"*\"\n                      , Space\n                      , Str \"List\"\n                      , Space\n                      , Str \"item\"\n                      , Space\n                      , Str \"2\"\n                      , SoftBreak\n                      , Str \"*\"\n                      , Space\n                      , Str \"List\"\n                      , Space\n                      , Str \"item\"\n                      , Space\n                      , Str \"3\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"This\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"prefixed\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"an\"\n                      , Space\n                      , Code ( \"\" , [] , [] ) \"a\"\n                      , Str \",\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"processor\"\n                      , Space\n                      , Str \"interprets\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"following\"\n                      , Space\n                      , Str \"lines\"\n                      , SoftBreak\n                      , Str \"as\"\n                      , Space\n                      , Str \"an\"\n                      , Space\n                      , Str \"AsciiDoc\"\n                      , Space\n                      , Str \"list.\"\n                      ]\n                  , BulletList\n                      [ [ Para\n                            [ Str \"List\"\n                            , Space\n                            , Str \"item\"\n                            , Space\n                            , Str \"1\"\n                            ]\n                        ]\n                      , [ Para\n                            [ Str \"List\"\n                            , Space\n                            , Str \"item\"\n                            , Space\n                            , Str \"2\"\n                            ]\n                        ]\n                      , [ Para\n                            [ Str \"List\"\n                            , Space\n                            , Str \"item\"\n                            , Space\n                            , Str \"3\"\n                            ]\n                        ]\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"This\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"isn\\8217t\"\n                     , Space\n                     , Str \"prefixed\"\n                     , Space\n                     , Str \"with\"\n                     , Space\n                     , Str \"an\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"a\"\n                     , Str \",\"\n                     , Space\n                     , Str \"so\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"processor\"\n                     , Space\n                     , Str \"doesn\\8217t\"\n                     , Space\n                     , Str \"interpret\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"listing\"\n                     , SoftBreak\n                     , Str \"block\"\n                     , Space\n                     , Str \"delimiters\"\n                     , Space\n                     , Str \"or\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"source\"\n                     , Space\n                     , Str \"style.\"\n                     ]\n                 , Para\n                     [ Str \"----\"\n                     , SoftBreak\n                     , Str \"import\"\n                     , Space\n                     , Str \"os\"\n                     , SoftBreak\n                     , Str \"print\"\n                     , Space\n                     , Str \"(\\\"%s\\\"\"\n                     , Space\n                     , Str \"%(os.uname()))\"\n                     , SoftBreak\n                     , Str \"----\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"This\"\n                     , Space\n                     , Str \"cell\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"prefixed\"\n                     , Space\n                     , Str \"with\"\n                     , Space\n                     , Str \"an\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"a\"\n                     , Str \",\"\n                     , Space\n                     , Str \"so\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Str \"listing\"\n                     , Space\n                     , Str \"block\"\n                     , Space\n                     , Str \"is\"\n                     , Space\n                     , Str \"processed\"\n                     , Space\n                     , Str \"and\"\n                     , Space\n                     , Str \"rendered\"\n                     , SoftBreak\n                     , Str \"according\"\n                     , Space\n                     , Str \"to\"\n                     , Space\n                     , Str \"the\"\n                     , Space\n                     , Code ( \"\" , [] , [] ) \"source\"\n                     , Space\n                     , Str \"style\"\n                     , Space\n                     , Str \"rules.\"\n                     ]\n                 , CodeBlock\n                     ( \"\" , [ \"python\" ] , [] )\n                     \"import os\\nprint \\\"%s\\\" %(os.uname())\"\n                 ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_col_and_rowspan\" , [] , [] )\n      [ Str \"Col\" , Space , Str \"and\" , Space , Str \"rowspan\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"1,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"2,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para\n                     [ Str \"Column\"\n                     , Space\n                     , Str \"3,\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"row\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 2)\n                  (ColSpan 2)\n                  [ Para\n                      [ Str \"This\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"spans\"\n                      , Space\n                      , Str \"2\"\n                      , Space\n                      , Str \"cols\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"2\"\n                      , Space\n                      , Str \"rows\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"3,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"Cell\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"column\"\n                      , Space\n                      , Str \"3,\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"3\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 3)\n                 [ Para\n                     [ Str \"Cell\"\n                     , Space\n                     , Str \"in\"\n                     , Space\n                     , Str \"column\"\n                     , Space\n                     , Str \"1-3,\"\n                     , Space\n                     , Str \"row\"\n                     , Space\n                     , Str \"4\"\n                     ]\n                 ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_csv_table\" , [] , [] )\n      [ Str \"CSV\" , Space , Str \"table\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Artist\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Track\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Genre\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Baauer\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Harlem\" , Space , Str \"Shake\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Hip\" , Space , Str \"Hop\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"The\" , Space , Str \"Lumineers\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Ho\" , Space , Str \"Hey\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Folk\" , Space , Str \"Rock\" ] ]\n             ]\n         ])\n  , Para [ Str \"or\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Artist\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Track\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Genre\" ] ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Baauer\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Harlem\" , Space , Str \"Shake\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Hip\" , Space , Str \"Hop\" ] ]\n             ]\n         ])\n  , Header\n      3\n      ( \"_dsv_table\" , [] , [] )\n      [ Str \"DSV\" , Space , Str \"table\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"a\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"b\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"c\" ] ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"d\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"e\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"f\" ] ]\n             ]\n         ])\n  , Para [ Str \"or\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Artist\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Track\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Genre\" ] ]\n             ]\n         ])\n      [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Robyn\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Indestructible\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Dance\" ] ]\n             ]\n         ])\n  , Header\n      2\n      ( \"_definition_list\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"list\" ]\n  , DefinitionList\n      [ ( [ Str \"CPU\" ]\n        , [ [ Para\n                [ Str \"The\"\n                , Space\n                , Str \"brain\"\n                , Space\n                , Str \"of\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"computer.\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"Hard\" , Space , Str \"drive\" ]\n        , [ [ Para\n                [ Str \"Permanent\"\n                , Space\n                , Str \"storage\"\n                , Space\n                , Str \"for\"\n                , Space\n                , Str \"operating\"\n                , Space\n                , Str \"system\"\n                , Space\n                , Str \"and/or\"\n                , Space\n                , Str \"user\"\n                , Space\n                , Str \"files.\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Para [ Str \"Mixed\" ]\n  , DefinitionList\n      [ ( [ Str \"Dairy\" ]\n        , [ [ BulletList\n                [ [ Para [ Str \"Milk\" ] ]\n                , [ Para [ Str \"Eggs\" ]\n                  , DefinitionList [ ( [ Str \"Bakery\" ] , [ [] ] ) ]\n                  ]\n                , [ Para [ Str \"Bread\" ]\n                  , DefinitionList [ ( [ Str \"Produce\" ] , [ [] ] ) ]\n                  ]\n                , [ Para [ Str \"Bananas\" ] ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Para [ Str \"With\" , Space , Str \"spaces\" ]\n  , DefinitionList [ ( [ Str \"Dairy\" ] , [ [] ] ) ]\n  , BulletList\n      [ [ Para [ Str \"Milk\" ] ] , [ Para [ Str \"Eggs\" ] ] ]\n  , DefinitionList [ ( [ Str \"Bakery\" ] , [ [] ] ) ]\n  , BulletList [ [ Para [ Str \"Bread\" ] ] ]\n  , DefinitionList [ ( [ Str \"Produce\" ] , [ [] ] ) ]\n  , BulletList [ [ Para [ Str \"Bananas\" ] ] ]\n  , Para [ Str \"Nested\" ]\n  , DefinitionList\n      [ ( [ Str \"Operating\" , Space , Str \"Systems\" ]\n        , [ [ DefinitionList\n                [ ( [ Str \"Linux\" ]\n                  , [ [ OrderedList\n                          ( 1 , DefaultStyle , DefaultDelim )\n                          [ [ Para [ Str \"Fedora\" ]\n                            , BulletList [ [ Para [ Str \"Desktop\" ] ] ]\n                            ]\n                          , [ Para [ Str \"Ubuntu\" ]\n                            , BulletList\n                                [ [ Para [ Str \"Desktop\" ] ]\n                                , [ Para [ Str \"Server\" ] ]\n                                ]\n                            ]\n                          ]\n                      ]\n                    ]\n                  )\n                , ( [ Str \"BSD\" ]\n                  , [ [ OrderedList\n                          ( 1 , DefaultStyle , DefaultDelim )\n                          [ [ Para [ Str \"FreeBSD\" ] ]\n                          , [ Para [ Str \"NetBSD\" ]\n                            , DefinitionList\n                                [ ( [ Str \"Cloud\"\n                                    , Space\n                                    , Str \"Providers\"\n                                    ]\n                                  , [ [ DefinitionList\n                                          [ ( [ Str \"PaaS\" ] , [ [] ] )\n                                          ]\n                                      ]\n                                    ]\n                                  )\n                                ]\n                            ]\n                          , [ Para [ Str \"OpenShift\" ] ]\n                          , [ Para [ Str \"CloudBees\" ] ]\n                          ]\n                      ]\n                    ]\n                  )\n                , ( [ Str \"IaaS\" ]\n                  , [ [ OrderedList\n                          ( 1 , DefaultStyle , DefaultDelim )\n                          [ [ Para [ Str \"Amazon\" , Space , Str \"EC2\" ]\n                            ]\n                          ]\n                      ]\n                    ]\n                  )\n                ]\n            , Para\n                [ Str \"This\"\n                , Space\n                , Str \"just\"\n                , Space\n                , Str \"affects\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"output:\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Div\n      ( \"\"\n      , []\n      , [ ( \"wrapper\" , \"1\" )\n        , ( \"itemwidth\" , \"75\" )\n        , ( \"labelwidth\" , \"25\" )\n        ]\n      )\n      [ DefinitionList\n          [ ( [ Str \"CPU\" ]\n            , [ [ Para\n                    [ Str \"The\"\n                    , Space\n                    , Str \"brain\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"computer.\"\n                    ]\n                ]\n              ]\n            )\n          , ( [ Str \"RAM\" ]\n            , [ [ Para\n                    [ Str \"Temporarily\"\n                    , Space\n                    , Str \"stores\"\n                    , Space\n                    , Str \"information\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"CPU\"\n                    , Space\n                    , Str \"uses\"\n                    , Space\n                    , Str \"during\"\n                    , Space\n                    , Str \"operation.\"\n                    ]\n                ]\n              ]\n            )\n          ]\n      ]\n  , Para [ Str \"Q&A\" , Space , Str \"list\" ]\n  , DefinitionList\n      [ ( [ Str \"What\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"answer?\"\n          ]\n        , [ [ Para\n                [ Str \"This\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"answer.\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"Are\"\n          , Space\n          , Str \"cameras\"\n          , Space\n          , Str \"allowed?\"\n          ]\n        , [ [] ]\n        )\n      , ( [ Str \"Are\"\n          , Space\n          , Str \"backpacks\"\n          , Space\n          , Str \"allowed?\"\n          ]\n        , [ [ Para [ Str \"No.\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Ordered\"\n      , Space\n      , Str \"description\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"(with\"\n      , Space\n      , Str \"numbers)\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ DefinitionList\n            [ ( [ Str \"&\" ] , [ [ Para [ Str \"ampersand\" ] ] ] ) ]\n        ]\n      , [ DefinitionList\n            [ ( [ Str \">\" ]\n              , [ [ Para [ Str \"greater\" , Space , Str \"than\" ] ] ]\n              )\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"_block_macros\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"macros\" ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ Plain\n          [ Image\n              ( \"\"\n              , []\n              , [ ( \"width\" , \"300px\" ) , ( \"height\" , \"200px\" ) ]\n              )\n              [ Str \"Sunset\" ]\n              ( \"sunset.jpg\" , \"\" )\n          ]\n      ]\n  , Plain\n      [ Image\n          ( \"\" , [] , [] )\n          [ Str \"mymovie.mp4\" ]\n          ( \"mymovie.mp4\" , \"\" )\n      ]\n  , Plain\n      [ Image\n          ( \"\" , [] , [] ) [ Str \"mysong.mp3\" ] ( \"mysong.mp3\" , \"\" )\n      ]\n  , Div ( \"toc\" , [] , [] ) []\n  , Div\n      ( \"\"\n      , [ \"included\" ]\n      , [ ( \"path\" , \"asciidoc-reader-include.adoc\" ) ]\n      )\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"test!\"\n          ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"one\" ]\n            , OrderedList\n                ( 1 , DefaultStyle , DefaultDelim )\n                [ [ Para [ Str \"two\" ] ] ]\n            ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/command/01.csv",
    "content": "\"Column1\";\"Column2\"\n\"Data1\";\"- data1\n\n- data2\"\n"
  },
  {
    "path": "test/command/10002.md",
    "content": "````\n% pandoc -f native -t opendocument\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 3)\n               [ Plain\n                   [ Str \"First\"\n                   , Space\n                   , Str \"Header\"\n                   , Space\n                   , Str \"Row\"\n                   ]\n               ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Second\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Row\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Header - Table\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Header - Body\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Header - Row\" ] ]\n            ]\n        ]\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Table\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Row\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot\n        ( \"\" , [] , [] )\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 3)\n                [ Plain\n                    [ Str \"First\"\n                    , Space\n                    , Str \"Footer\"\n                    , Space\n                    , Str \"Row\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Footer\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Row\" ] ]\n            ]\n        ])\n]\n^D\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-column table:style-name=\"Table1.C\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\" table:number-columns-spanned=\"3\">\n        <text:p text:style-name=\"Table_20_Heading\">First Header\n        Row</text:p>\n      </table:table-cell>\n    </table:table-row>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Second</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Header</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Row</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Heading\">Header - Table</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Heading\">Header - Body</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Heading\">Header - Row</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Table</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Body</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Row</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\" table:number-columns-spanned=\"3\">\n      <text:p text:style-name=\"Table_20_Contents\">First Footer\n      Row</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Second</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Footer</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Row</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n````\n"
  },
  {
    "path": "test/command/10057.md",
    "content": "```\n% pandoc --natbib -t latex\nWe all love the famous proof by @BenjaminHornigold [p. 42].\n^D\nWe all love the famous proof by \\citet[p.~42]{BenjaminHornigold}.\n```\n"
  },
  {
    "path": "test/command/10062.md",
    "content": "```\n% pandoc -t asciidoc\n### section\n\n##### five\n^D\n==== section\n\n====== five\n```\n"
  },
  {
    "path": "test/command/10071.md",
    "content": "Leading tabs must be preserved in org mode *src* blocks with the `-i`\nflag when pandoc is called with `-p`/`--preserve-tabs`.\n\n```\n% pandoc -f org -t native --preserve-tabs\n#+begin_src makefile -i\n%.o: %.cpp\n\t$(CXX)\t-o\t$@\t$<\n#+end_src\n^D\n[ CodeBlock\n    ( \"\" , [ \"makefile\" ] , [] )\n    \"%.o: %.cpp\\n\\t$(CXX)\\t-o\\t$@\\t$<\\n\"\n]\n```\n"
  },
  {
    "path": "test/command/10093.md",
    "content": "```\n% pandoc -f rst\n========== ====\nFunction   1   \n========== ====\na          yes \nb              \n========== ====\n^D\n<table>\n<thead>\n<tr>\n<th>Function</th>\n<th>1</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>a</td>\n<td>yes</td>\n</tr>\n<tr>\n<td>b</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f rst\n========== ====\nFunction   1   \n========== ====\na          yes \n           & no\n========== ====\n^D\n<table>\n<thead>\n<tr>\n<th>Function</th>\n<th>1</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>a</td>\n<td>yes &amp; no</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/10094.md",
    "content": "```\n% pandoc -f rst -t markdown_strict\n.. table:: Test Table\n\n   ================================== ====\n   Functions for tests                1   \n   ================================== ====\n   a                                  yes \n   b                                      \n   c                                      \n   d                                  yes\n   e                                      \n   ================================== ====\n^D\n<table>\n<caption>Test Table</caption>\n<thead>\n<tr>\n<th>Functions for tests</th>\n<th>1</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>a</td>\n<td>yes</td>\n</tr>\n<tr>\n<td>b</td>\n<td></td>\n</tr>\n<tr>\n<td>c</td>\n<td></td>\n</tr>\n<tr>\n<td>d</td>\n<td>yes</td>\n</tr>\n<tr>\n<td>e</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n\n```\n"
  },
  {
    "path": "test/command/10105.md",
    "content": "```\n% pandoc -t asciidoc --wrap=preserve\n[link](https://example.com)\n[link](ftps://example.com)\n^D\nhttps://example.com[link]\nlink:ftps://example.com[link]\n```\n"
  },
  {
    "path": "test/command/10127.md",
    "content": "RST Reader\n\n```\n% pandoc -f rst -t native\n=====  =====  ======\n   Inputs     Output\n------------  ------\n  A      B    A or B\n=====  =====  ======\nFalse  False  False\nTrue   False  True\nFalse  True   True\nTrue   True   True\n=====  =====  ======\n\nTable with trailing whitespaces to ensure they don't interfere with col span parsing.\n\n===============  ============  =====================  \nFull column header\n---------------------------------------------------- \nHeader One       Header Two    Header 3\n===============  ============  =====================   \nRow              With col span 2 on the right\n---------------  -----------------------------------   \nFull column row\n----------------------------------------------------\nRow with         Col spans     For visual separation\n---------------  ------------  ---------------------  \nRow with col span 2            On the left\n-----------------------------  ---------------------\nFinal row\n===============  ============  =====================\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"Inputs\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Output\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"B\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" , Space , Str \"or\" , Space , Str \"B\" ]\n               ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"trailing\"\n    , Space\n    , Str \"whitespaces\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"ensure\"\n    , Space\n    , Str \"they\"\n    , Space\n    , Str \"don't\"\n    , Space\n    , Str \"interfere\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"col\"\n    , Space\n    , Str \"span\"\n    , Space\n    , Str \"parsing.\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 3)\n               [ Plain\n                   [ Str \"Full\"\n                   , Space\n                   , Str \"column\"\n                   , Space\n                   , Str \"header\"\n                   ]\n               ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"One\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"Two\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain\n                    [ Str \"With\"\n                    , Space\n                    , Str \"col\"\n                    , Space\n                    , Str \"span\"\n                    , Space\n                    , Str \"2\"\n                    , Space\n                    , Str \"on\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"right\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 3)\n                [ Plain\n                    [ Str \"Full\"\n                    , Space\n                    , Str \"column\"\n                    , Space\n                    , Str \"row\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Row\" , Space , Str \"with\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Col\" , Space , Str \"spans\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"For\"\n                    , Space\n                    , Str \"visual\"\n                    , Space\n                    , Str \"separation\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain\n                    [ Str \"Row\"\n                    , Space\n                    , Str \"with\"\n                    , Space\n                    , Str \"col\"\n                    , Space\n                    , Str \"span\"\n                    , Space\n                    , Str \"2\"\n                    ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"On\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"left\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Final\" , Space , Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\nRST Writer\n```\n% pandoc -f native -t rst\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"Inputs\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Output\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"B\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" , Space , Str \"or\" , Space , Str \"B\" ]\n               ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"False\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"True\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 3)\n               [ Plain\n                   [ Str \"Full\"\n                   , Space\n                   , Str \"column\"\n                   , Space\n                   , Str \"header\"\n                   ]\n               ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"One\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"Two\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain\n                    [ Str \"With\"\n                    , Space\n                    , Str \"col\"\n                    , Space\n                    , Str \"span\"\n                    , Space\n                    , Str \"2\"\n                    , Space\n                    , Str \"on\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"right\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 3)\n                [ Plain\n                    [ Str \"Full\"\n                    , Space\n                    , Str \"column\"\n                    , Space\n                    , Str \"row\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain\n                    [ Str \"Row\"\n                    , Space\n                    , Str \"with\"\n                    , Space\n                    , Str \"col\"\n                    , Space\n                    , Str \"span\"\n                    , Space\n                    , Str \"2\"\n                    ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"On\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"left\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Final\" , Space , Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        ]\n    ]\n    (TableFoot\n      ( \"\" , [] , [] ) \n      [ Row\n          ( \"\" , [] , [] )\n          [ Cell\n              ( \"\" , [] , [] )\n              AlignDefault\n              (RowSpan 1)\n              (ColSpan 1)\n              [ Plain [ Str \"Footer\" , Space , Str \"Row\" ] ]\n          , Cell\n              ( \"\" , [] , [] )\n              AlignDefault\n              (RowSpan 1)\n              (ColSpan 1)\n              [ Plain [ Str \"at\" , Space , Str \"the\" ] ]\n          , Cell\n              ( \"\" , [] , [] )\n              AlignDefault\n              (RowSpan 1)\n              (ColSpan 1)\n              [ Plain [ Str \"bottom\" ] ]\n          ]\n      ])\n]\n^D\n====== ===== ======\nInputs       Output\n------------ ------\nA      B     A or B\n====== ===== ======\nFalse  False False\nTrue   False True\nFalse  True  True\nTrue   True  True\n====== ===== ======\n\n=================== ============================ ===========\nFull column header                               \n------------------------------------------------------------\nHeader One          Header Two                   Header 3\n=================== ============================ ===========\nRow                 With col span 2 on the right \n------------------- ----------------------------------------\nFull column row                                  \n------------------------------------------------------------\nRow with col span 2                              On the left\n------------------------------------------------ -----------\nFinal row                                        \nFooter Row          at the                       bottom\n=================== ============================ ===========\n```\n"
  },
  {
    "path": "test/command/10145.md",
    "content": "```\n% pandoc -f rtf -t native\n{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 \\fmodern Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 {\\shp{\\*\\shpinst\\shpwr2\\shpwrk3\\shpbypara\\shpbyignore\\shptop1320\\shpbottom7745\\shpbxcolumn\\shpbxignore\\shpleft0\\shpright9638{\\sp{\\sn shapeType}{\\sv 75}}{\\sp{\\sn wzDescription}{\\sv }}{\\sp{\\sn wzName}{\\sv }}{\\sp{\\sn pib}{\\sv {\\pict\\jpegblip\\picw20\\pich22\\picwgoal400\\pichgoal440 ffd8ffe000104a46494600010101004800480000fffe0050546869732061727420697320696e20746865207075626c696320646f6d61696e2e204b6576696e204875676865732c206b6576696e68406569742e636f6d2c2053657074656d6265722031393935ffdb00430001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffdb00430101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffc00011080016001403012200021101031101ffc4001a000100020301000000000000000000000000080905060a07ffc400231000010501000300010500000000000000060304050708020001090a11153976b7ffc400160101010100000000000000000000000000060800ffc400261101000102050109000000000000000000010200030405061121b33134365154717475b4ffda000c03010002110311003f00a90cf388f366a62aa720ed6ae07f96901f3831d973452b8cf36fe3570fc908e46d466433e5dd954f2e96992d9e498c7753faa44916e016ca91cc7d88b38fe60a5b97737defcbcc539c98d336a57f4fc2ca9a486bf07ab575ad9a3af4df221d8215e36df86c4504ff0024574551b3d687ee0575757b3ad64e311ee62bd94158d37e24198c43973099f1fc0c41614d950246513a081abf76cfe7061f6863281e6352fd1670949c148dd6dfb0d25f5b3689b1d5c965b0eacbf4e0932ad28e22ab9ae945633f4744bd3c8cee0a7fdf085b9000f449c5f7afa30b83e0b6fd7b0c8429c9467ff9715347c891e25fa24a205861aa715e6a09bd0488237dc2723414d9891381524e8ca7c0894664f835653631ab55ee7e3de433e4ff001b30949124e4c10c8b6ad0a479b3f9c937b2cf5bc0095ad600a0a41a0e9faee174a1c605e161c6c7a313539650b0113190f1a8368e60d5b24f30ff008ea7f0bf867fa6595feeb6978f1fe0f9c26177f4d63a51a9235184750e7d18811339cd000000c75f000e00380380ae390c350def826ed42ad051fa6f501c50f9b699c3b69cbeb76476d202bf3ac985b6e0e968be66572893e6a744540bd9722e5c87956848629bc2559306bd113e8653d3b6aff651dfad7a3ac8b02958cba02a93ccf525757039bae6cff090e1d90688e8aa233ee86a4c4a3e0586d6b2340522e47dcb7d0046d8a5acb05a123ee25d2b230b2ada6e2e2f9ede3c05202520ec2487b0d56562529d8b3393bca76adca4ec1bca508abb001babc007915d84fe3dd14e207e3c62f8379da2a3b861fb6629d28dba53b6ea388ebfed866bf6dfb553455e91ed547ae92e9445253a4fdf3efb4f8ebdfbe7d3c78f1ee0bb9e13e358e942a4ed49e22cff00eeb35fdd7ebfffd9}}}}}\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 moon\\par}\n}\n^D\n[ Para\n    [ Image\n        ( \"\"\n        , []\n        , [ ( \"width\" , \"0.2777777777777778in\" )\n          , ( \"height\" , \"0.3055555555555556in\" )\n          ]\n        )\n        [ Str \"image\" ]\n        ( \"9ea9761885249909bcd8a610706eef51b54dc351.jpg\" , \"\" )\n    ]\n, Para [ Str \"moon\" ]\n]\n```\n"
  },
  {
    "path": "test/command/10148.md",
    "content": "```\n% pandoc -t typst\nSee [@MyPaper].\n\nSee [@MyPaper, Equation 1] for details.\n\nSee [@MyPaper, Equation 1].\n\nSee [@MyPaper, Equation 1; @Other, Figure 1].\n^D\nSee @MyPaper.\n\nSee @MyPaper[Equation 1] for details.\n\nSee @MyPaper[Equation 1].\n\nSee @MyPaper[Equation 1]@Other[Figure 1].\n```\n"
  },
  {
    "path": "test/command/10149.md",
    "content": "Row spans\n```\n% pandoc -f html --columns 24 -t ansi\n<table>\n  <thead>\n    <tr>\n      <td rowspan=\"3\">1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>4</td>\n      <td rowspan=\"4\">5</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <td>2</td>\n      <td colspan=\"2\" rowspan=\"2\">3</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">2</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <td>1</td>\n      <td>3</td>\n      <td>4</td>\n      <td>6</td>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td colspan=\"2\">a</td>\n      <td rowspan=\"2\">c</td>\n      <td>d</td>\n      <td>e</td>\n      <td>f</td>\n    </tr>\n    <tr>\n      <td>a</td>\n      <td>b</td>\n      <td colspan=\"3\" rowspan=\"2\">d</td>\n    </tr>\n    <tr>\n      <td>a</td>\n      <td>b</td>\n      <td>c</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td colspan=\"2\" rowspan=\"4\">A</td>\n      <td>C</td>\n      <td>D</td>\n      <td colspan=\"2\" rowspan=\"3\">E</td>\n    </tr>\n    <tr>\n      <td>C</td>\n      <td>D</td>\n    </tr>\n    <tr>\n      <td>C</td>\n      <td>D</td>\n    </tr>\n    <tr>\n      <td>C</td>\n      <td>D</td>\n      <td>E</td>\n      <td>F</td>\n    </tr>\n  </tfoot>\n</table>\n^D\n1   2   3   4   5   6\n    2   3           6\n    2               6\n1       3   4       6\n─── ─── ─── ─── ─── ───\na       c   d   e   f\na   b       d\na   b   c\n─── ─── ─── ─── ─── ───\nA       C   D   E\n        C   D\n        C   D\n        C   D   E   F\u001b[0m\u001b]8;;\u001b\\\n```\n\nEmpty rows\n```\n% pandoc -f native --columns 12 -t ansi\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 3)\n               (ColSpan 2)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 2)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 4)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        , Row ( \"\" , [] , [] ) []\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 3)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"2\" ] ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       ])\n]\n^D\n1       3\n        3\n1   2   3\n─── ─── ───\n1   2   3\n1   2\n1       3\n1       3\n─── ─── ───\n1   2   3\n1   2   3\n1   2\u001b[0m\u001b]8;;\u001b\\\n```\n"
  },
  {
    "path": "test/command/10152.md",
    "content": "# CRediT Roles\n\nThis document contains tests and examples for enabling\nexport of roles to JATS. It was added for\n[Issue #10152](https://github.com/jgm/pandoc/issues/10152)\nand corresponding [Pull Request #10153](https://github.com/jgm/pandoc/pull/10153).\n\nIn the first example, we show a fully qualified CRediT role.\nAn explicit name isn't given, so the CRediT name is used.\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - credit: software\n        credit-name: Software\n        degree: Lead\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<role vocab=\"credit\" degree-contribution=\"Lead\"\n      vocab-identifier=\"https://credit.niso.org/\"\n      vocab-term-identifier=\"https://credit.niso.org/contributor-roles/software/\"\n      vocab-term=\"Software\"\n>Software</role>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n\nIn the second example, we show a fully qualified CRediT role.\nAn explicit name is given in a different language.\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - credit: software\n        credit-name: Software\n        degree: Lead\n        name: Programas\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<role vocab=\"credit\" degree-contribution=\"Lead\"\n      vocab-identifier=\"https://credit.niso.org/\"\n      vocab-term-identifier=\"https://credit.niso.org/contributor-roles/software/\"\n      vocab-term=\"Software\"\n>Programas</role>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n\nIn this example, we show a partially qualified CRediT role\nthat does not have a `degree`:\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - credit: software\n        credit-name: Software\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<role vocab=\"credit\"\n      vocab-identifier=\"https://credit.niso.org/\"\n      vocab-term-identifier=\"https://credit.niso.org/contributor-roles/software/\"\n      vocab-term=\"Software\"\n>Software</role>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n\nIn this example, we show a more stripped-down data that requires automatic lookup of the\n`credit-name`.\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - credit: software\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<role vocab=\"credit\"\n      vocab-identifier=\"https://credit.niso.org/\"\n      vocab-term-identifier=\"https://credit.niso.org/contributor-roles/software/\"\n      vocab-term=\"Software\"\n>Software</role>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n\nIn this example, we test the correct XML encoding of\nthe CRediT role [Writing – review & editing](https://credit.niso.org/contributor-roles/writing-review-editing/),\nwhich annoyingly contains an ampersand in its label.\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - credit: writing-review-editing\n        credit-name: Writing – review & editing\n        degree: Lead\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<role vocab=\"credit\" degree-contribution=\"Lead\"\n      vocab-identifier=\"https://credit.niso.org/\"\n      vocab-term-identifier=\"https://credit.niso.org/contributor-roles/writing-review-editing/\"\n      vocab-term=\"Writing – review &amp; editing\"\n>Writing – review &amp; editing</role>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n\nIn this example, we show a role that isn't qualified with CRediT.\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - name: Dolphin Catcher\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<role>Dolphin Catcher</role>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n\nIn this example, we show a role that neither has a CRediT identifer,\nnor a name, so it's ignored.\n\n```\n% pandoc -s -t jats\n---\ntitle: CRediT Test\nauthor:\n  - name: Max Mustermann\n    affiliation: [ 1 ]\n    roles:\n      - irrelevant-key: Dolphin Catcher\naffiliation:\n- id: 1\n  name: Silverlight University\n---\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>CRediT Test</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>Max Mustermann</string-name>\n<xref ref-type=\"aff\" rid=\"aff-1\"/>\n</contrib>\n<aff id=\"aff-1\">\n<institution-wrap>\n<institution>Silverlight University</institution>\n</institution-wrap>\n</aff>\n</contrib-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n</back>\n</article>\n```\n"
  },
  {
    "path": "test/command/10160.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{equation}\n  [0,1)\n\\end{equation}\n\n\\begin{table}[h]\n\\end{table}\n^D\n[ Para\n    [ Math\n        DisplayMath \"\\\\begin{equation}\\n  [0,1)\\n\\\\end{equation}\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/10185.md",
    "content": "```\n% pandoc -t latex --citeproc\nLorem ipsum\n\n# References\n\n::: {#refs}\n:::\n^D\nLorem ipsum\n\n\\section{References}\\label{references}\n\n\\protect\\phantomsection\\label{refs}\n```\n\n```\n% pandoc -t latex --citeproc\n---\nreferences:\n- id: foo\n  type: book\n  title: The Title\n  author: John Doe\n...\n\nLorem ipsum [@foo].\n\n# References\n\n::: {#refs}\n:::\n^D\nLorem ipsum (John Doe, n.d.).\n\n\\section{References}\\label{references}\n\n\\protect\\phantomsection\\label{refs}\n\\begin{CSLReferences}{1}{1}\n\\bibitem[\\citeproctext]{ref-foo}\nJohn Doe. n.d. \\emph{The Title}.\n\n\\end{CSLReferences}\n\n```\n\n"
  },
  {
    "path": "test/command/10236.md",
    "content": "```\n% pandoc -t rst\n- > test\n  >\n  > para 2\n^D\n- ..\n\n     test\n\n     para 2\n```\n\n```\n% pandoc -t rst\n1. > test\n   >\n   > para 2\n^D\n1. ..\n\n      test\n\n      para 2\n```\n\n```\n% pandoc -t rst\n::: caution\n> test\n:::\n^D\n.. caution::\n\n   ..\n\n      test\n```\n\n```\n% pandoc -f native -t rst --list-tables\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.26 ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ BlockQuote\n                  [ Para [ Emph [ Str \"Level\" , Space , Str \"0:\" ] ]\n                  , Para\n                      [ Emph [ Str \"Incomplete\" , Space , Str \"process\" ]\n                      ]\n                  ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n^D\n.. list-table::\n   :widths: 19\n\n   * - ..\n\n          *Level 0:*\n\n          *Incomplete process*\n```\n\n"
  },
  {
    "path": "test/command/10271.md",
    "content": "```\n% pandoc -f markdown+smart -t typst+smart\n\"don't do it---\"\n^D\n\"don't do it---\"\n\n```\n```\n% pandoc -f markdown+smart -t typst-smart\n\"don't do it---\"\n^D\n“don’t do it—”\n\n```\n```\n% pandoc -f markdown-smart -t typst+smart\n\"don't do it---\"\n^D\n\\\"don\\'t do it-\\-\\-\\\"\n\n```\n```\n% pandoc -f markdown-smart -t typst-smart\n\"don't do it---\"\n^D\n\"don't do it---\"\n\n```\n\n"
  },
  {
    "path": "test/command/10279.md",
    "content": "```\n% pandoc -f rst\nSee `the full compatibility guidelines <https://\nexample.com>`_ for more information.\n^D\n<p>See <a href=\"https://example.com\">the full compatibility\nguidelines</a> for more information.</p>\n\n```\n"
  },
  {
    "path": "test/command/10281.md",
    "content": "```\n% pandoc -f rst -t native\n`Want Speed? Pass by Value`_\n\n.. note::\n  For more information about the pass-by-value idiom, read: `Want Speed? Pass by Value`_.\n\n  .. _Want Speed? Pass by Value: https://web.archive.org/web/20140205194657/http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/\n^D\n[ Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Str \"Want\"\n        , Space\n        , Str \"Speed?\"\n        , Space\n        , Str \"Pass\"\n        , Space\n        , Str \"by\"\n        , Space\n        , Str \"Value\"\n        ]\n        ( \"https://web.archive.org/web/20140205194657/http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/\"\n        , \"\"\n        )\n    ]\n, Div\n    ( \"\" , [ \"note\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Note\" ] ]\n    , Para\n        [ Str \"For\"\n        , Space\n        , Str \"more\"\n        , Space\n        , Str \"information\"\n        , Space\n        , Str \"about\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"pass-by-value\"\n        , Space\n        , Str \"idiom,\"\n        , Space\n        , Str \"read:\"\n        , Space\n        , Link\n            ( \"\" , [] , [] )\n            [ Str \"Want\"\n            , Space\n            , Str \"Speed?\"\n            , Space\n            , Str \"Pass\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"Value\"\n            ]\n            ( \"https://web.archive.org/web/20140205194657/http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/\"\n            , \"\"\n            )\n        , Str \".\"\n        ]\n    ]\n]\n\n```\n\n"
  },
  {
    "path": "test/command/10318.md",
    "content": "```\n% pandoc -f rst -t html5\n-a         Output all.\n-c arg     Output just arg.\n--long     Output all day long.\n/V         A VMS/DOS-style option.\n\n-p         This option has two paragraphs in the description.\n           This is the first.\n\n           This is the second.\n           Blank lines may be omitted between options\n           (as above) or left in (as here and below).\n\n--very-long-option  A VMS-style option.  Note the adjustment\n                    for the required two spaces.\n\n--an-even-longer-option\n           The description can also start on the next line.\n\n-2, --two  This option has two variants.\n\n-f FILE, --file=FILE  These two options are synonyms; both have\n                      arguments.\n\n-f <[path]file>  Option argument placeholders must start with\n                 a letter or be wrapped in angle brackets.\n\n-d <src dest>    Angle brackets are also required if an option\n                 expects more than one argument.\n^D\n<dl>\n<dt><code>-a</code></dt>\n<dd>\n<p>Output all.</p>\n</dd>\n<dt><code>-c arg</code></dt>\n<dd>\n<p>Output just arg.</p>\n</dd>\n<dt><code>--long</code></dt>\n<dd>\n<p>Output all day long.</p>\n</dd>\n<dt><code>/V</code></dt>\n<dd>\n<p>A VMS/DOS-style option.</p>\n</dd>\n<dt><code>-p</code></dt>\n<dd>\n<p>This option has two paragraphs in the description. This is the\nfirst.</p>\n<p>This is the second. Blank lines may be omitted between options (as\nabove) or left in (as here and below).</p>\n</dd>\n<dt><code>--very-long-option</code></dt>\n<dd>\n<p>A VMS-style option. Note the adjustment for the required two\nspaces.</p>\n</dd>\n<dt><code>--an-even-longer-option</code></dt>\n<dd>\n<p>The description can also start on the next line.</p>\n</dd>\n<dt><code>-2, --two</code></dt>\n<dd>\n<p>This option has two variants.</p>\n</dd>\n<dt><code>-f FILE, --file=FILE</code></dt>\n<dd>\n<p>These two options are synonyms; both have arguments.</p>\n</dd>\n<dt><code>-f &lt;[path]file&gt;</code></dt>\n<dd>\n<p>Option argument placeholders must start with a letter or be wrapped\nin angle brackets.</p>\n</dd>\n<dt><code>-d &lt;src dest&gt;</code></dt>\n<dd>\n<p>Angle brackets are also required if an option expects more than one\nargument.</p>\n</dd>\n</dl>\n```\n"
  },
  {
    "path": "test/command/10328.md",
    "content": "Unwrap divs if they only have the `nonincremental` or `incremental` classes.\n\n```\n% pandoc --incremental --from=markdown --to=revealjs\n## First slide\n\n::: nonincremental\n\n1.  Note 1\n2.  Note 2\n3.  Note 3\n\n:::\n\n## Second Slide\n\n1.  Note 1\n2.  Note 2\n3.  Note 3\n^D\n<section id=\"first-slide\" class=\"slide level2\">\n<h2>First slide</h2>\n<ol type=\"1\">\n<li>Note 1</li>\n<li>Note 2</li>\n<li>Note 3</li>\n</ol>\n</section>\n<section id=\"second-slide\" class=\"slide level2\">\n<h2>Second Slide</h2>\n<ol type=\"1\">\n<li class=\"fragment\">Note 1</li>\n<li class=\"fragment\">Note 2</li>\n<li class=\"fragment\">Note 3</li>\n</ol>\n</section>\n```\n"
  },
  {
    "path": "test/command/10338-rst-multiple-header-rows.md",
    "content": "```\n% pandoc -f rst -t native\nMultiple Headers\n================\n\n========== =========\nHeader A1  Header A2\nHeader B1  Header B2\n========== =========\nbody a1    body a1\nbody b1    body b2\n========== =========\n\nHeadless\n========\n\n========== =========\nbody a1    body a1\nbody b1    body b2\n========== =========\n\nEnd Section\n===========\n^D\n[ Header\n    1\n    ( \"multiple-headers\" , [] , [] )\n    [ Str \"Multiple\" , Space , Str \"Headers\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"A1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"A2\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"B1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"B2\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"a1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"a1\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"b1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"b2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Header 1 ( \"headless\" , [] , [] ) [ Str \"Headless\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"a1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"a1\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"b1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"body\" , Space , Str \"b2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Header\n    1\n    ( \"end-section\" , [] , [] )\n    [ Str \"End\" , Space , Str \"Section\" ]\n]\n```\n"
  },
  {
    "path": "test/command/10385.md",
    "content": "````\n% pandoc -t asciidoc\nC+ C++ C+++ `++`\n\n`` ` `` \\`hi\\`\n\n`hi\\there`` ok`\n\n```\n++`\n```\n^D\nC{plus} C{plus}{plus} C{plus}{plus}{plus} `{plus}{plus}`\n\n`++`++` ++`++hi++`++\n\n`hi++\\++there++``++ ok`\n\n....\n++`\n....\n````\n"
  },
  {
    "path": "test/command/10390.md",
    "content": "```\n% pandoc -f mediawiki\n {| class=\"wikitable\"\n |+ Overview of basic table markup\n ! Key\n |-\n | Value\n |}\n^D\n<table>\n<caption>Overview of basic table markup</caption>\n<thead>\n<tr>\n<th><p>Key</p></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><p>Value</p></td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/10414.md",
    "content": "```\n% pandoc -f textile -t html\nfrom 30.-100. text, inside - after dash\n^D\n<p>from 30.–100. text, inside - after dash</p>\n```\n"
  },
  {
    "path": "test/command/10459.md",
    "content": "```\n% pandoc -s --shift-heading-level-by=-1 -f djot -t native\n# hi\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList [ ( \"title\" , MetaInlines [ Str \"hi\" ] ) ]\n    }\n  [ Div ( \"hi\" , [ \"section\" ] , [] ) [] ]\n```\n"
  },
  {
    "path": "test/command/10484.md",
    "content": "```\n% pandoc -frst -tmarkdown_strict\n- One issue fixed: `issue 123`_.\n\n- One change merged: `Big change <pull 234_>`_.\n\n- Improved the `home page <https://example.com/homepage>`_.\n\n- One more `small change`__.\n\n.. _issue 123: https://github.com/joe/project/issues/123\n.. _pull 234: https://github.com/joe/project/pull/234\n__ https://github.com/joe/project/issues/999\n\n^D\n- One issue fixed: [issue\n  123](https://github.com/joe/project/issues/123).\n- One change merged: [Big\n  change](https://github.com/joe/project/pull/234).\n- Improved the [home page](https://example.com/homepage).\n- One more [small change](https://github.com/joe/project/issues/999).\n```\n"
  },
  {
    "path": "test/command/10490.md",
    "content": "```\n% pandoc -f mediawiki -t html\n{|class=\"wikitable\" style=\"text-align: center;\"\n|-\n!rowspan=3 style=\"\"|Witness program version\n!colspan=4 style=\"\"|Hash size\n|-\n!Mainnet\n!Testnet\n!Mainnet\n!Testnet\n|-\n|0||p2||QW||7Xh||T7n\n|-\n|1||p4||QY||7Xq||T7w\n|}\n^D\n<table>\n<thead>\n<tr>\n<th style=\"\"><p>Witness program version</p></th>\n<th colspan=\"4\" style=\"\"><p>Hash size</p></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><p>Mainnet</p></td>\n<td><p>Testnet</p></td>\n<td><p>Mainnet</p></td>\n<td><p>Testnet</p></td>\n<td></td>\n</tr>\n<tr>\n<td><p>0</p></td>\n<td><p>p2</p></td>\n<td><p>QW</p></td>\n<td><p>7Xh</p></td>\n<td><p>T7n</p></td>\n</tr>\n<tr>\n<td><p>1</p></td>\n<td><p>p4</p></td>\n<td><p>QY</p></td>\n<td><p>7Xq</p></td>\n<td><p>T7w</p></td>\n</tr>\n</tbody>\n</table>\n\n```\n"
  },
  {
    "path": "test/command/10491.md",
    "content": "```\n% pandoc -f mediawiki -t gfm\n{| class=\"wikitable\"\n|-\n!\n!0\n!1\n!2\n!3\n!4\n!5\n!6\n!7\n|-\n!+0\n|q||p||z||r||y||9||x||8\n|-\n!+8\n|g||f||2||t||v||d||w||0\n|-\n!+16\n|s||3||j||n||5||4||k||h\n|-\n!+24\n|c||e||6||m||u||a||7||l\n|}\n^D\n|     | 0   | 1   | 2   | 3   | 4   | 5   | 6   | 7   |\n|-----|-----|-----|-----|-----|-----|-----|-----|-----|\n| +0  | q   | p   | z   | r   | y   | 9   | x   | 8   |\n| +8  | g   | f   | 2   | t   | v   | d   | w   | 0   |\n| +16 | s   | 3   | j   | n   | 5   | 4   | k   | h   |\n| +24 | c   | e   | 6   | m   | u   | a   | 7   | l   |\n\n```\n"
  },
  {
    "path": "test/command/10497.md",
    "content": "```\n% pandoc -f rst\na.__b__\n\na__b__\n\n__foo__\n^D\n<p>a.__b__</p>\n<p>a__b__</p>\n<p>__foo__</p>\n```\n\n"
  },
  {
    "path": "test/command/10537.md",
    "content": "```\n% pandoc -f pod -t html\n=encoding utf8\n\n=head1 NAME\n\nTest document\n^D\n<h1>NAME</h1>\n<p>Test document</p>\n```\n\n```\n% pandoc -f pod -t html\n=encoding utf8\n\n\n=head1 NAME\n\nTest document\n^D\n<h1>NAME</h1>\n<p>Test document</p>\n```\n"
  },
  {
    "path": "test/command/10594.md",
    "content": "```\n% pandoc -f docbook -t native\n<orderedlist numeration=\"loweralpha\">\n<title>header inside listing</title>   // not rendered in any output format!\n<listitem>\n<simpara>first step</simpara>\n</listitem>\n</orderedlist>\n^D\n[ Div\n    ( \"\" , [] , [] )\n    [ Div\n        ( \"\" , [ \"title\" ] , [] )\n        [ Plain\n            [ Str \"header\"\n            , Space\n            , Str \"inside\"\n            , Space\n            , Str \"listing\"\n            ]\n        ]\n    , OrderedList\n        ( 1 , LowerAlpha , DefaultDelim )\n        [ [ Para [ Str \"first\" , Space , Str \"step\" ] ] ]\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/10621.md",
    "content": "```\n% pandoc -f markdown -t html\n[test](url\n\"title\")\n^D\n<p><a href=\"url\" title=\"title\">test</a></p>\n```\n"
  },
  {
    "path": "test/command/10631.md",
    "content": "GFM has funny treatment of escaped braces, requiring `\\\\{` instead of `\\{`.\n\n```\n% pandoc -f gfm -t markdown\n$\\\\{x,y\\\\}$\n^D\n$\\{x,y\\}$\n```\n"
  },
  {
    "path": "test/command/10635.md",
    "content": "# Support for KOMA's `\\minisec` command\n\n```\n% pandoc -f latex -t native\n\\minisec{Montage}\nZunächst suche man das Mauseloch.\n^D\n[ Header\n    6\n    ( \"montage\" , [ \"unnumbered\" , \"unlisted\" ] , [] )\n    [ Str \"Montage\" ]\n, Para\n    [ Str \"Zun\\228chst\"\n    , Space\n    , Str \"suche\"\n    , Space\n    , Str \"man\"\n    , Space\n    , Str \"das\"\n    , Space\n    , Str \"Mauseloch.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/10643.md",
    "content": "```\n% pandoc -f html -t native\n<p>A<style></style>B</p>\n^D\n[ Para\n    [ Str \"A\"\n    , RawInline (Format \"html\") \"<style></style>\"\n    , Str \"B\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/10650.md",
    "content": "```\n% pandoc -t typst --wrap=preserve\n1\\. I don't want this to be an enumerated list.\n2\\. No, I don't: only a number before a paragraph.\n^D\n\\1. I don't want this to be an enumerated list.\n\\2. No, I don't: only a number before a paragraph.\n```\n\n"
  },
  {
    "path": "test/command/10659.md",
    "content": "```\n% pandoc -f latex -t native\n\\includegraphics[\nwidth=5cm,\n]{abc.jpg}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [ ( \"width\" , \"5cm\" ) ] )\n        [ Str \"image\" ]\n        ( \"abc.jpg\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\includegraphics[%\nwidth=5cm,%\n]{abc.jpg}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [ ( \"width\" , \"5cm\" ) ] )\n        [ Str \"image\" ]\n        ( \"abc.jpg\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\includegraphics[width=5cm]{%\nabc.jpg%\n}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [ ( \"width\" , \"5cm\" ) ] )\n        [ Str \"image\" ]\n        ( \"abc.jpg\" , \"\" )\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/10672.md",
    "content": "```\n% pandoc\n| This | Is |\n|:-----|:---|\n| With \\\n| Cells\n^D\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">This</th>\n<th style=\"text-align: left;\">Is</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">With \\</td>\n<td style=\"text-align: left;\"></td>\n</tr>\n<tr>\n<td style=\"text-align: left;\">Cells</td>\n<td style=\"text-align: left;\"></td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/10708.md",
    "content": "```\n% pandoc -f html -t mediawiki\n<dl>\n<dt>Case 1: Both subsets are non-empty</dt>\n<dd>\nIn this case, …\n</dd>\n</dl>\n^D\n; Case 1<nowiki>:</nowiki> Both subsets are non-empty\n: In this case, …\n```\n\n```\n% pandoc -f mediawiki -t html\n; term : definition\n^D\n<dl>\n<dt>term</dt>\n<dd>\ndefinition\n</dd>\n</dl>\n```\n"
  },
  {
    "path": "test/command/10730.md",
    "content": "```\n% pandoc -f org -t native\n=hi\nthere=\n^D\n[ Para [ Code ( \"\" , [ \"verbatim\" ] , [] ) \"hi there\" ] ]\n```\n"
  },
  {
    "path": "test/command/10747.md",
    "content": "```\n% pandoc -t typst\n[Mark]{.mark}\n^D\n#highlight[Mark]\n```\n"
  },
  {
    "path": "test/command/10755.md",
    "content": "```\n% pandoc -f native -t markdown\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Para [ Str \"An\" , Space , Str \"image.\" ] ])\n    [ Plain\n        [ Image\n            ( \"\"\n            , []\n            , []\n            )\n            [ Str \"An\" , Space , Str \"image.\" ]\n            ( \"media/rId20.jpg\" , \"\" )\n        ]\n    ]\n]\n^D\n![An image.](media/rId20.jpg)\n```\n\n```\n% pandoc -f native -t markdown -t markdown-implicit_figures\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Para [ Str \"An\" , Space , Str \"image.\" ] ])\n    [ Plain\n        [ Image\n            ( \"\"\n            , []\n            , []\n            )\n            [ Str \"An\" , Space , Str \"image.\" ]\n            ( \"media/rId20.jpg\" , \"\" )\n        ]\n    ]\n]\n^D\n<figure>\n<img src=\"media/rId20.jpg\" alt=\"An image.\" />\n<figcaption aria-hidden=\"true\"><p>An image.</p></figcaption>\n</figure>\n```\n\n```\n% pandoc -f native -t markdown -t markdown-implicit_figures-raw_html\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Para [ Str \"An\" , Space , Str \"image.\" ] ])\n    [ Plain\n        [ Image\n            ( \"\"\n            , []\n            , []\n            )\n            [ Str \"An\" , Space , Str \"image.\" ]\n            ( \"media/rId20.jpg\" , \"\" )\n        ]\n    ]\n]\n^D\n:::: figure\n![An image.](media/rId20.jpg)\n\n::: caption\nAn image.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/10758.md",
    "content": "```\n% pandoc -f native -t markdown\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Para [ Str \"Foo\" , Space , Emph [ Str \"emphasis\" ] ] ])\n    [ Plain\n        [ Image\n            ( \"\"\n            , []\n            , []\n            )\n            [ Str \"Foo\" , Space , Str \"emphasis\" ]\n            ( \"media/rId20.jpg\" , \"\" )\n        ]\n    ]\n]\n^D\n![Foo *emphasis*](media/rId20.jpg)\n```\n"
  },
  {
    "path": "test/command/10781.md",
    "content": "```\n% pandoc -f latex -t markdown --wrap=preserve\nThis is \\texttt{--flag} with dashes.\nThis is the same --flag without a code.\n^D\nThis is `--flag` with dashes.\nThis is the same --flag without a code.\n```\n"
  },
  {
    "path": "test/command/10791.md",
    "content": "```\n% pandoc -t opendocument\nAboard **the luxury cruise ship Heart of the Ocean[^1] in the Atlantic Ocean**...\n\n[^1]: **Heart of the Ocean** (海洋之心) – The Heart of the Ocean\n^D\n<text:p text:style-name=\"Text_20_body\">Aboard\n<text:span text:style-name=\"T1\">the luxury cruise ship Heart of the\nOcean</text:span><text:note text:id=\"ftn0\" text:note-class=\"footnote\"><text:note-citation>1</text:note-citation><text:note-body><text:p text:style-name=\"Footnote\"><text:span text:style-name=\"T1\">Heart\nof the Ocean</text:span> (海洋之心) – The Heart of the\nOcean</text:p></text:note-body></text:note><text:span text:style-name=\"T1\">\nin the Atlantic Ocean</text:span>…</text:p>\n\n```\n"
  },
  {
    "path": "test/command/10805.md",
    "content": "```\n% pandoc -t typst -f latex\n\\begin{equation}\n  \\label{eq:U}\n  U = A\n\\end{equation}\n^D\n$ U = A $<eq:U>\n```\n\n```\n% pandoc -t typst -f latex\n\\begin{equation}\n  \\label{eq:U 2}\n  U = A\n\\end{equation}\n^D\n$ U = A $#label(\"eq:U 2\")\n```\n"
  },
  {
    "path": "test/command/10812.md",
    "content": "Check that the `four_space_rule` extension works for plain writer.\n\n```\n% pandoc -f markdown -t plain+four_space_rule\nThis is the title\n\nHere we fix:\n\n- a\n- b\n- c\n^D\nThis is the title\n\nHere we fix:\n\n-   a\n-   b\n-   c\n```\n\nCheck that the `four_space_rule` extension is off by default.\n\n```\n% pandoc -f markdown -t plain\nThis is the title\n\nHere we fix:\n\n- a\n- b\n- c\n^D\nThis is the title\n\nHere we fix:\n\n- a\n- b\n- c\n```\n"
  },
  {
    "path": "test/command/10816.md",
    "content": "```\n% pandoc -f markdown -t typst\n# Test①\n^D\n= Test①\n#label(\"test①\")\n```\n"
  },
  {
    "path": "test/command/10825.md",
    "content": "```\n% pandoc -f docbook -t html\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<book xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\">\n  <info><title>Literallayout test</title></info>\n  <chapter>\n    <info><title>Literallayout without class</title></info>\n    <literallayout>First line.\nSecond line.\n  Third line, indented two spaces.</literallayout>\n  </chapter>\n  <chapter>\n    <info><title>Literallayout with normal class</title></info>\n    <literallayout class=\"normal\">First line.\nSecond line.\n  Third line, indented two spaces.</literallayout>\n  </chapter>\n  <chapter>\n    <info><title>Literallayout with monospaced</title></info>\n    <literallayout class=\"monospaced\">First line.\nSecond line.\n  Third line, indented two spaces.</literallayout>\n  </chapter>\n</book>\n^D\n<h1>Literallayout without class</h1>\n<div class=\"line-block\">First line.<br />\nSecond line.<br />\n  Third line, indented two spaces.</div>\n<h1>Literallayout with normal class</h1>\n<div class=\"line-block\">First line.<br />\nSecond line.<br />\n  Third line, indented two spaces.</div>\n<h1>Literallayout with monospaced</h1>\n<pre><code>First line.\nSecond line.\n  Third line, indented two spaces.</code></pre>\n\n```\n"
  },
  {
    "path": "test/command/10836.md",
    "content": "```\n% pandoc -f org -t latex\nSome equation here\n\\begin{equation}\nx = y\n\\end{equation}\nwhere $x$ is something important.\n^D\nSome equation here \\begin{equation}\nx = y\n\\end{equation} where \\(x\\) is something important.\n```\n"
  },
  {
    "path": "test/command/10848.md",
    "content": "```\n% pandoc -f html -t markdown\n<table>\n<tr>\n<td colspan=\"3\">A</td>\n<td rowspan=\"1\" colspan=\"2\">F</td>\n</tr>\n<tr>\n<td>C</td>\n<td colspan=\"2\">B</td>\n<td colspan=\"2\">H</td>\n</tr>\n<tr>\n<td colspan=\"2\">D</td>\n<td colspan=\"2\">E</td>\n<td>G</td>\n</tr>\n</table>\n^D\n+---+---+---+---+---+\n| A         | F     |\n+---+-------+-------+\n| C | B     | H     |\n+---+---+---+---+---+\n| D     | E     | G |\n+-------+-------+---+\n```\n\n```\n% pandoc -f html -t markdown\n<table>\n<tr>\n<td colspan=\"2\">A</td>\n<td colspan=\"2\">J</td>\n<td rowspan=\"3\">F</td>\n</tr>\n<tr>\n<td rowspan=\"3\">C</td>\n<td>B</td>\n<td rowspan=\"2\" colspan=\"2\">H</td>\n</tr>\n<tr>\n<td>D</td>\n</tr>\n<tr>\n<td colspan=\"4\">K</td>\n</tr>\n</table>\n^D\n+---+---+-------+---+\n| A     | J     | F |\n+---+---+-------+   |\n| C | B | H     |   |\n|   +---+       |   |\n|   | D |       |   |\n|   +---+-------+---+\n|   | K             |\n+---+---------------+\n```\n\n```\n% pandoc -f html -t markdown-simple_tables-multiline_tables-pipe_tables\n<table>\n  <tbody>\n    <tr>\n      <td>a</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td></td>\n      <td></td>\n    </tr>\n  </tbody>\n</table>\n^D\n+---+---+\n| a |   |\n+---+---+\n|   |   |\n+---+---+\n```\n\n"
  },
  {
    "path": "test/command/10855.md",
    "content": "```\n% pandoc -t markdown\n+----------+----+\n| h1       | h2 |\n+:===:+===:+:===+\n| A        | B  |\n+-----+----+----+\n| C   | D  | E  |\n+-----+----+----+\n^D\n+-------------+----+\n| h1          | h2 |\n+:====:+=====:+:===+\n| A           | B  |\n+------+------+----+\n| C    | D    | E  |\n+------+------+----+\n\n```\n\n```\n% pandoc -t markdown\n+-----+----+----+\n| h1  | h2 | h3 |\n+:===:+===:+:===+\n| A        | B  |\n+-----+----+----+\n| C   | D  | E  |\n+-----+----+----+\n^D\n+------+------+----+\n| h1   | h2   | h3 |\n+:====:+=====:+:===+\n| A           | B  |\n+------+------+----+\n| C    | D    | E  |\n+------+------+----+\n\n```\n\n```\n% pandoc -t markdown\n+:------:+:-----------:+\n| hello  | ![a](b.png) |\n+--------+-------------+\n| hello  | ![c](b.png) |\n+--------+-------------+\n^D\n+:------:+:-----------:+\n| hello  | ![a](b.png) |\n+--------+-------------+\n| hello  | ![c](b.png) |\n+--------+-------------+\n\n```\n\n```\n% pandoc -t markdown\n+:------:+:-----------:+\n| hello  | ![a](b.png) |\n+--------+-------------+\n| hello  | ![c](b.png) |\n+--------+-------------+\n^D\n+:------:+:-----------:+\n| hello  | ![a](b.png) |\n+--------+-------------+\n| hello  | ![c](b.png) |\n+--------+-------------+\n\n```\n"
  },
  {
    "path": "test/command/10862.md",
    "content": "```\n% pandoc --embed-resources\n<script></script>\n^D\n<script></script>\n```\n"
  },
  {
    "path": "test/command/10867.md",
    "content": "```\n% pandoc -f native -t markdown-raw_html\n[ Figure\n    ( \"fig:foo\" , [] , [ ( \"label\" , \"1.1\" ) ] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Figure\" , Space , Str \"1.1:\" , Space , Str \"Figure\" ]\n       ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [] )\n            [ Str \"Figure\" , Space , Str \"1.1:\" , Space , Str \"Figure\" ]\n            ( \"./image.png\" , \"\" )\n        ]\n    ]\n]\n^D\n:::: {#fig:foo .figure label=\"1.1\"}\n![Figure 1.1: Figure](./image.png)\n\n::: caption\nFigure 1.1: Figure\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/10884.md",
    "content": "```\n% pandoc -f markdown -t markdown\n  header1   header2\n  --------- ---------\n  r1c1      r1c2\n  r2c1      r2c2\n\n  : mycaption {#myid .myclass key=\"value\"}\n^D\n  header1   header2\n  --------- ---------\n  r1c1      r1c2\n  r2c1      r2c2\n\n  : mycaption {#myid .myclass key=\"value\"}\n\n```\n"
  },
  {
    "path": "test/command/10889.md",
    "content": "```\n% pandoc\napple\n\n: pomaceous\n\n  fruit\n^D\n<dl>\n<dt>apple</dt>\n<dd>\n<p>pomaceous</p>\n<p>fruit</p>\n</dd>\n</dl>\n```\n"
  },
  {
    "path": "test/command/10890.md",
    "content": "```\n% pandoc --tab-stop=2 --from=native --to=markdown\n[ DefinitionList\n    [ ( [ Str \"apple\" ]\n      , [ [ Para [ Str \"pomaceous\" ] , Para [ Str \"fruit\" ] ] ]\n      )\n    ]\n]\n^D\napple\n\n: pomaceous\n\n  fruit\n```\n"
  },
  {
    "path": "test/command/10912.md",
    "content": "```\n% pandoc -f docbook -t native\n<orderedlist numeration=\"arabic\" startingnumber=\"4\">\n<listitem>\n<simpara>Para1</simpara>\n</listitem>\n<listitem>\n<simpara>Para2</simpara>\n</listitem>\n</orderedlist>\n^D\n[ OrderedList\n    ( 4 , Decimal , DefaultDelim )\n    [ [ Para [ Str \"Para1\" ] ] , [ Para [ Str \"Para2\" ] ] ]\n]\n```\n"
  },
  {
    "path": "test/command/10915.md",
    "content": "```\n% pandoc -f latex\n\\newcommand{\\a}{\\ifmmode x \\else y \\fi}\n$\\a$ and \\a\n^D\n<p><span class=\"math inline\"><em>x</em></span> and y</p>\n```\n\n"
  },
  {
    "path": "test/command/10919.md",
    "content": "# Org output with smart quotes turned on\n\n```\n% pandoc -t org+smart_quotes -s\n\"It's nice\" she said.\n^D\n#+options: ':t\n\n\"It's nice\" she said.\n```\n\nSame test, but with special strings turned off.\n```\n% pandoc -t org+smart_quotes-special_strings -s\n\"It's nice\" she said.\n^D\n#+options: ':t\n#+options: -:nil\n\n\"It’s nice\" she said.\n```\n"
  },
  {
    "path": "test/command/10926.md",
    "content": "````\n% pandoc -f html -t gfm\n<div class=\"sourceCode\" id=\"cb1\"><pre\nclass=\"sourceCode ruby\"><code class=\"sourceCode ruby\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"fu\">test</span></span></code></pre></div>\n^D\n``` ruby\ntest\n```\n````\n\n````\n% pandoc -f html -t gfm\n<pre\nclass=\"border language-ruby\"><code class=\"sourceCode ruby\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"fu\">test</span></span></code></pre>\n^D\n``` ruby\ntest\n```\n````\n"
  },
  {
    "path": "test/command/10942.md",
    "content": "Ungrouped field instruction:\n```\n% pandoc -f rtf -t native\n{\\rtf1\\ansi\\deff0\n{\\fonttbl{\\f0\\froman Times New Roman;}}\n{\\colortbl;\\red0\\green0\\blue0;}\n\\deftab720\n\n\\trowd\\trleft0\\cellx2000\\cellx4000\n\\pard\\intbl\n{{\\field{\\*\\fldinst HYPERLINK \"https://example.com\" }{\\fldrslt {\\hich\\af0\\loch\\hich\\af0\\loch\\cf0\\f0\\cf0\\f0\\loch\n{\\*\\bkmkstart _dx_frag_StartFragment}{\\*\\bkmkend _dx_frag_StartFragment}Problem Text}}}}\\cell\n\\pard\\intbl Normal Text\\cell\n\\row\n\n\\trowd\\trleft0\\cellx2000\\cellx4000\n\\pard\\intbl Simple Text\\cell\n\\pard\\intbl More Text\\cell\n\\row\n}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para\n                    [ Link\n                        ( \"\" , [] , [] )\n                        [ Str \"Problem\" , Space , Str \"Text\" ]\n                        ( \"https://example.com\" , \"\" )\n                    ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"Normal\" , Space , Str \"Text\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"Simple\" , Space , Str \"Text\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"More\" , Space , Str \"Text\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\nAdditionally, ungrouped field result:\n```\n% pandoc -f rtf -t native\n{\\rtf1\\ansi\\ansicpg1252\\cocoartf2867\n\\cocoatextscaling0\\cocoaplatform1{\\fonttbl\\f0\\fnil\\fcharset0 HelveticaNeue;}\n{\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;}\n\\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133\n\\deftab720\n\\pard\\pardeftab720\\partightenfactor0\n{\\field{\\*\\fldinst{HYPERLINK \"https://example.com\"}}{\\fldrslt \n\\f0\\fs22 \\cf2 \\up0 \\nosupersub \\ul \\ulc2 link}}}\n^D\n[ Para\n    [ Underline\n        [ Link\n            ( \"\" , [] , [] )\n            [ Str \"link\" ]\n            ( \"https://example.com\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/10965.md",
    "content": "```\n% pandoc -f markdown -t typst\n::: {lang=\"en\"}\nThis text should be in English.\n:::\n^D\n#block[\n#set text(lang: \"en\"); This text should be in English.\n\n]\n```\n\n```\n% pandoc -f markdown -t typst\n::: {lang=\"fr\"}\nCe texte devrait être en français.\n:::\n^D\n#block[\n#set text(lang: \"fr\"); Ce texte devrait être en français.\n\n]\n```\n\n```\n% pandoc -f markdown -t typst\n::: {lang=\"de-DE\"}\nDieser Text sollte auf Deutsch sein.\n:::\n^D\n#block[\n#set text(lang: \"de\"); Dieser Text sollte auf Deutsch sein.\n\n]\n```\n\n```\n% pandoc -f markdown -t typst\n::: {lang=\"\"}\nThis should not have lang set.\n:::\n^D\n#block[\nThis should not have lang set.\n\n]\n```\n"
  },
  {
    "path": "test/command/10983.md",
    "content": "```\n% pandoc --citeproc --csl command/chicago-fullnote-bibliography.csl -t plain\n---\nreferences:\n- id: test4\n  type: blog-post\n  title: \"Username as author\"\n  author:\n  - brtw\n  container-title: \"Reddit\"\n  issued:\n    year: 2004\nsuppress-bibliography: true\n...\n\n[@test4]\n^D\n[1]\n\n[1] brtw, “Username as Author,” Reddit, 2004.\n\n```\n"
  },
  {
    "path": "test/command/10984.md",
    "content": " ```\n % pandoc -f html -t djot\n<h1 id=\"foo\" class=\"a b\">Hi</hi>\n^D\n{#foo .a .b}\n# Hi\n```\n\nIn this one the id is suppressed by the djot writer because\nthe same one would be automatically generated by the djot reader:\n```\n% pandoc -f html -t djot\n<h2 id=\"Introduction\">Introduction</h2>\n^D\n## Introduction\n```\n"
  },
  {
    "path": "test/command/11006.md",
    "content": "```\n% pandoc -f html -t asciidoc\n<ul>\n  <li>\n    <p>Paragraph one</p>\n    <p>Paragraph two to force a list continuation</p>\n    <ul>\n      <li>First nested</li>\n      <li>Second nested</li>\n    </ul>\n  </li>\n</ul>\n\n<p>How about ordered lists?</p>\n\n<ol>\n  <li>\n    <p>Paragraph one</p>\n    <p>Paragraph two to force a list continuation</p>\n    <ol><li>Nested item</li></ol>\n  </li>\n</ol>\n\n<p>With non-default attributes:</p>\n\n<ol>\n  <li>\n    <p>Paragraph one</p>\n    <p>Paragraph two to force a list continuation</p>\n    <ol start=5><li>Nested item</li></ol>\n  </li>\n</ol>\n^D\n* Paragraph one\n+\nParagraph two to force a list continuation\n\n** First nested\n** Second nested\n\nHow about ordered lists?\n\n. Paragraph one\n+\nParagraph two to force a list continuation\n\n.. Nested item\n\nWith non-default attributes:\n\n. Paragraph one\n+\nParagraph two to force a list continuation\n[start=5]\n.. Nested item\n```\n"
  },
  {
    "path": "test/command/11013.md",
    "content": "```\n% pandoc --csl command/chicago-fullnote-bibliography.csl -C --wrap=none -t plain\n---\nreferences:\n- id: test10\n  type: blog-post\n  title: \"Test 10: Lowercase username in brackets, Works!\"\n  author:\n  - literal: \"[deleted]\"\n  container-title: \"Reddit\"\n  issued:\n    year: 2009\n...\n\nblah [@test10].\n^D\nblah.[1]\n\n[deleted]. “Test 10: Lowercase Username in Brackets, Works!” Reddit, 2009.\n\n[1] [deleted], “Test 10: Lowercase Username in Brackets, Works!” Reddit, 2009.\n\n```\n"
  },
  {
    "path": "test/command/11014.md",
    "content": "```\n% pandoc -f djot -t html\n{.foo}\n- bar\n^D\n<ul class=\"foo\">\n<li>bar</li>\n</ul>\n```\n"
  },
  {
    "path": "test/command/11017.md",
    "content": "```\n% pandoc -t markdown -f typst\n#show heading: smallcaps\n\n= Introduction\n^D\n# [Introduction]{.smallcaps}\n\n```\n"
  },
  {
    "path": "test/command/11046.md",
    "content": "```\n% pandoc --citeproc -t plain+smart --csl command/chicago-note-bibliography.csl\n---\nreferences:\n- id: doe\n  title: Title\n  type: book\n  date: 2006\n  author: John Doe\n...\n\nblah blah [@doe]---blah blah.\n^D\nblah blah[1]---blah blah.\n\nJohn Doe. Title, n.d.\n\n[1] John Doe, Title.\n```\n"
  },
  {
    "path": "test/command/11047.md",
    "content": "```\n% pandoc -t typst --wrap=auto\nFull-time study: 2001-2003; Thesis submission: Nov 2005; Award: Jul 2006.\n^D\nFull-time study: 2001-2003; Thesis submission: Nov 2005; Award: Jul\n\\2006.\n```\n"
  },
  {
    "path": "test/command/11048.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@article{khatri2021spooky,\n    title = {Spooky action at a global distance: analysis of space-based\n             entanglement distribution for the quantum internet},\n    author = {Khatri, Sumeet and Brady, Anthony J and Desporte, Ren{\\'e}e A and\n              Bart, Manon P and Dowling, Jonathan P},\n    journal = {{npj} Quantum Information},\n    volume = {7},\n    number = {1},\n    pages = {4},\n    doi = {10.1038/s41534-020-00327-5},\n    url = {https://doi.org/10.1038/s41534-020-00327-5},\n    year = {2021},\n    publisher = {Nature Publishing Group UK London},\n}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Khatri\n    given: Sumeet\n  - family: Brady\n    given: Anthony J\n  - family: Desporte\n    given: Renée A\n  - family: Bart\n    given: Manon P\n  - family: Dowling\n    given: Jonathan P\n  container-title: \"[npj]{.nocase} Quantum Information\"\n  doi: 10.1038/s41534-020-00327-5\n  id: khatri2021spooky\n  issue: 1\n  issued: 2021\n  page: 4\n  publisher: Nature Publishing Group UK London\n  title: \"Spooky action at a global distance: Analysis of space-based\n    entanglement distribution for the quantum internet\"\n  title-short: Spooky action at a global distance\n  type: article-journal\n  url: \"https://doi.org/10.1038/s41534-020-00327-5\"\n  volume: 7\n---\n\n\n```\n"
  },
  {
    "path": "test/command/11090/ch1.typ",
    "content": "== Chapter One\n\n#figure(\n  image(\"media/image1.png\"),\n  caption: [An image.]\n)\n"
  },
  {
    "path": "test/command/11090.md",
    "content": "```\n% pandoc -f typst -t native\n#include \"command/11090/ch1.typ\"\n\n== Chapter Two\n\n#figure(\n  image(\"command/11090/media/image1.png\"),\n  caption: [This is an image.] \n)\n^D\n[ Header\n    2 ( \"\" , [] , [] ) [ Str \"Chapter\" , Space , Str \"One\" ]\n, Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Para [ Str \"An\" , Space , Str \"image.\" ] ])\n    [ Para\n        [ Image\n            ( \"\" , [] , [] )\n            []\n            ( \"command/11090/media/image1.png\" , \"\" )\n        ]\n    ]\n, Header\n    2 ( \"\" , [] , [] ) [ Str \"Chapter\" , Space , Str \"Two\" ]\n, Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Para\n           [ Str \"This\"\n           , Space\n           , Str \"is\"\n           , Space\n           , Str \"an\"\n           , Space\n           , Str \"image.\"\n           ]\n       ])\n    [ Para\n        [ Image\n            ( \"\" , [] , [] )\n            []\n            ( \"command/11090/media/image1.png\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/11101.md",
    "content": "```\n% pandoc -f typst -t native\nFirst paragraph.\n\n#pagebreak()\n\nSecond paragraph.\n^D\n[ Para [ Str \"First\" , Space , Str \"paragraph.\" ]\n, Div\n    ( \"\" , [ \"page-break\" ] , [ ( \"wrapper\" , \"1\" ) ] )\n    [ HorizontalRule ]\n, Para [ Str \"Second\" , Space , Str \"paragraph.\" ]\n]\n```"
  },
  {
    "path": "test/command/11113.md",
    "content": "```\n% pandoc command/11113.docx -t plain\n^D\nColored:❤️😏📖👌😒🤍\n\nBW: 😊︎\n```\n"
  },
  {
    "path": "test/command/11124.md",
    "content": "The heading is \"unlinked\" before adding it to the TOC.\n\n```\n% pandoc --to=latex\n<http://example.com/> {-}\n=========================\n^D\n\\section*{\\texorpdfstring{\\url{http://example.com/}}{http://example.com/}}\\label{httpexample.com}\n\\addcontentsline{toc}{section}{{http://example.com/}}\n```\n"
  },
  {
    "path": "test/command/11128.md",
    "content": "```\n% pandoc -f html -t markdown_strict+pipe_tables-raw_html\n<table>\n<tr>\n<th class=\"\" colspan=\"2\" rowspan=\"1\"><b>Subject</b></th>\n<th class=\"\"><b>Grade</b></th>\n</tr>\n<tr>\n<td class=\"\" colspan=\"1\" rowspan=\"2\">Physics</td>\n<td class=\"\">Practical</td>\n<td class=\"\">A</td>\n</tr>\n<tr>\n<td class=\"\">Theory</td>\n<td class=\"\">B+</td>\n</tr>\n</table>\n^D\n| **Subject** |           | **Grade** |\n|-------------|-----------|-----------|\n| Physics     | Practical | A         |\n|             | Theory    | B+        |\n```\n"
  },
  {
    "path": "test/command/11140.md",
    "content": "```\n% pandoc -f rst -t native\n.. figure:: image.png\n   :alt: my alt\n\n   Caption\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Caption\" ] ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [] )\n            [ Str \"my\" , Space , Str \"alt\" ]\n            ( \"image.png\" , \"\" )\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f rst -t native\n.. figure:: image.png\n\n   Caption\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Caption\" ] ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [] ) [ Str \"Caption\" ] ( \"image.png\" , \"\" )\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f native -t markdown\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Plain [ Str \"Caption\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [ Str \"my\", Space, Str \"alt\" ] ( \"image.png\" , \"\" )\n        ]\n    ]\n]\n^D\n![Caption](image.png){alt=\"my alt\"}\n```\n\nIgnore `\\pandocbounded`:\n```\n% pandoc -f latex -t native\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={Caption}]{image.png}}\n\\caption{Caption}\n\\end{figure}\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Caption\" ] ])\n    [ Para\n        [ Image\n            ( \"\" , [] , [] ) [ Str \"Caption\" ] ( \"image.png\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/11150.md",
    "content": "```\n% pandoc -f rst\n===  =====\nint  float\n===  =====\n10   9.90\n-10  9.90\n===  =====\n^D\n<table>\n<thead>\n<tr>\n<th>int</th>\n<th>float</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>10</td>\n<td>9.90</td>\n</tr>\n<tr>\n<td>-10</td>\n<td>9.90</td>\n</tr>\n</tbody>\n</table>\n\n```\n"
  },
  {
    "path": "test/command/11162.md",
    "content": "```\n% pandoc -f native -t rst\n[ BulletList\n    [ [ Plain [ Str \"list\" ]\n      , CodeBlock ( \"\" , [ \"ruby\" ] , [] ) \"code = 7 # comment\"\n      ]\n    , [ Plain [ Str \"second\" , Space , Str \"item\" ] ]\n    ]\n]\n^D\n- list\n\n  .. code:: ruby\n\n     code = 7 # comment\n\n- second item\n\n```\n"
  },
  {
    "path": "test/command/11188.md",
    "content": "Parsing PARAMETERS of Org-mode blocks\n\n```\n% pandoc -f org --to=native\n#+attr_html: :width 10px\n#+BEGIN_myex :this that\nhuhu\n#+END_myex\n^D\n[ Div\n    ( \"\"\n    , [ \"myex\" ]\n    , [ ( \"width\" , \"10px\" ) , ( \"this\" , \"that\" ) ]\n    )\n    [ Para [ Str \"huhu\" ] ]\n]\n```\n\nPython-style parameters are accepted, too.\n\n```\n% pandoc -f org --to=native\n#+BEGIN_myblock width=10px\n[[image.svg][logo]]\n#+END_myblock\n^D\n[ Div\n    ( \"\" , [ \"myblock\" ] , [ ( \"width\" , \"10px\" ) ] )\n    [ Para\n        [ Span\n            ( \"\"\n            , [ \"spurious-link\" ]\n            , [ ( \"target\" , \"image.svg\" ) ]\n            )\n            [ Emph [ Str \"logo\" ] ]\n        ]\n    ]\n]\n```\n\nThe fallback is to put the remainder of the line into a `parameters`\nattribute.\n\n```\n% pandoc -f org --to=native\n#+BEGIN_myblock these are parameters in an unsupported format\n/OK/\n#+END_myblock\n^D\n[ Div\n    ( \"\"\n    , [ \"myblock\" ]\n    , [ ( \"parameters\"\n        , \"these are parameters in an unsupported format\"\n        )\n      ]\n    )\n    [ Para [ Emph [ Str \"OK\" ] ] ]\n]\n```\n\nAlso works on dynamic blocks.\n\n```\n% pandoc -f org --to=markdown\n#+BEGIN: clocktable :scope subtree :maxlevel 3\n#+CAPTION: Clock summary at [2025-10-18 Sat 17:23]\n| Headline     | Time   |\n|--------------+--------|\n| *Total time* | *0:00* |\n#+END:\n^D\n::: {.clocktable scope=\"subtree\" maxlevel=\"3\"}\n  Headline         Time\n  ---------------- ----------\n  **Total time**   **0:00**\n\n  : Clock summary at \\[2025-10-18 Sat 17:23\\]\n:::\n```\n"
  },
  {
    "path": "test/command/11210.md",
    "content": "```\n% pandoc -t typst -f man\n.PP\n.IR login (1)\n.PP\nand a regular (paren) that should not be escaped.\n^D\n#emph[login]\\(1)\n\nand a regular (paren) that should not be escaped.\n\n```\n\n"
  },
  {
    "path": "test/command/11211.md",
    "content": "```\n% pandoc -f rtf -t native\n{\\field{\\*\\fldinst{\\rtlch\\ab0\\ai0\\af2\\alang1025\\afs22\\ltrch\\b0\\i0\\fs22\\lang1033\\langnp1033\\langfe1033\\langfenp1033\n\\loch\\af2\\dbch\\af2\\hich\\f2\\insrsid10976062\\strike0\\ulnone\\cf1 HYPERLINK \"https://example.com\"}{\\*\\datafield 08d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b28000000680074007400700073003a002f002f006500780061006d0070006c0065002e0063006f006d000000}}\n{\\fldrslt{\\rtlch\\ab0\\ai0\\af2\\alang1025\\afs22\\ltrch\\b0\\i0\\fs22\\lang1033\\langnp1033\\langfe1033\\langfenp1033\\loch\\af2\\dbch\\af2\\hich\\f2\\strike0\\ul\\cf2 link}}}\n^D\n[ Para\n    [ Underline\n        [ Link\n            ( \"\" , [] , [] )\n            [ Str \"link\" ]\n            ( \"https://example.com\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/11253.md",
    "content": "```\n% pandoc -f markdown -t native\n\\ifstrequal{hello}{hello}{TRUE}{FALSE}\n\\ifstrequal{hello}{world}{TRUE}{FALSE}\n^D\n[ Para\n    [ RawInline (Format \"tex\") \"TRUE\"\n    , SoftBreak\n    , RawInline (Format \"tex\") \"FALSE\"\n    ]\n]\n```\n\n```\n% pandoc -f markdown-latex_macros -t native\n\\ifstrequal{hello}{hello}{TRUE}{FALSE}\n\\ifstrequal{hello}{world}{TRUE}{FALSE}\n^D\n[ Para\n    [ RawInline\n        (Format \"tex\") \"\\\\ifstrequal{hello}{hello}{TRUE}{FALSE}\"\n    , SoftBreak\n    , RawInline\n        (Format \"tex\") \"\\\\ifstrequal{hello}{world}{TRUE}{FALSE}\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/1126.md",
    "content": "```\n% pandoc -f html -t latex\n\\begin{eqnarray}\nA&=&B,\\\\\nC&=&D\n\\end{eqnarray}\n^D\n\\textbackslash begin\\{eqnarray\\} A\\&=\\&B,\\textbackslash\\textbackslash{}\nC\\&=\\&D \\textbackslash end\\{eqnarray\\}\n```\n\n```\n% pandoc -f html+raw_tex -t latex\n<p>See \\eqref{myeq}.</p>\n\\begin{eqnarray}\nA&=&B,\\\\\nC&amp;=&amp;D\n\\\\label{myeq}\n\\end{eqnarray}\n^D\nSee \\eqref{myeq}.\n\n\\begin{eqnarray}\nA&=&B,\\\\\nC&=&D\n\\\\label{myeq}\n\\end{eqnarray}\n```\n"
  },
  {
    "path": "test/command/11266.md",
    "content": "```\n% pandoc -t latex\n$$\n\\begin{eqnarray}\nS &\\rightarrow& a A                      \\nonumber \\\\\nA &\\rightarrow& d B \\ | \\ b A \\ | \\ c A  \\nonumber \\\\\nB &\\rightarrow& a c \\ | \\ b C \\ | \\ c A  \\nonumber \\\\\nC &\\rightarrow& \\epsilon                 \\nonumber\n\\end{eqnarray}\n$$\n^D\n\n\\begin{eqnarray}\nS &\\rightarrow& a A                      \\nonumber \\\\\nA &\\rightarrow& d B \\ | \\ b A \\ | \\ c A  \\nonumber \\\\\nB &\\rightarrow& a c \\ | \\ b C \\ | \\ c A  \\nonumber \\\\\nC &\\rightarrow& \\epsilon                 \\nonumber\n\\end{eqnarray}\n```\n"
  },
  {
    "path": "test/command/11270.md",
    "content": "```\n% pandoc -f markdown -t native -s\n---\nheader-includes: |\n    \\makeatletter\n    \\beamer@ignorenonframefalse\n    \\makeatother\n...\n\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"header-includes\"\n            , MetaBlocks\n                [ RawBlock\n                    (Format \"tex\")\n                    \"\\\\makeatletter\\n\\\\beamer@ignorenonframefalse\\n\\\\makeatother\"\n                ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/11299.md",
    "content": "```\n% pandoc -f mediawiki -t native\n<foo>\n\n<samp>x</samp>\n\n<kbd>x</kbd>\n\n<var>x</var>\n\n<mark>This is ''highlighted''</mark>\n^D\n[ Para [ Str \"<foo>\" ]\n, Para [ Code ( \"\" , [ \"sample\" ] , [] ) \"x\" ]\n, Para [ Span ( \"\" , [ \"kbd\" ] , [] ) [ Str \"x\" ] ]\n, Para [ Code ( \"\" , [ \"variable\" ] , [] ) \"x\" ]\n, Para\n    [ Span\n        ( \"\" , [ \"mark\" ] , [] )\n        [ Str \"This\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Emph [ Str \"highlighted\" ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/11300.md",
    "content": "```\n% pandoc -f docbook -t native -s\n<?xml version=\"1.0\"?>\n<book xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" dir=\"ltr\">\n  <info>\n    <title>Book title</title>\n    <subtitle>Book subtitle</subtitle>\n  </info>\n  <chapter>\n    <info>\n      <title>Chapter title</title>\n    </info>\n    <para>My sentence</para>\n  </chapter>\n</book>\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"subtitle\"\n            , MetaInlines [ Str \"Book\" , Space , Str \"subtitle\" ]\n            )\n          , ( \"title\"\n            , MetaInlines [ Str \"Book\" , Space , Str \"title\" ]\n            )\n          ]\n    }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"Chapter\" , Space , Str \"title\" ]\n  , Para [ Str \"My\" , Space , Str \"sentence\" ]\n  ]\n```\n\n```\n% pandoc -f docbook -t native -s\n<?xml version=\"1.0\"?>\n<book xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" dir=\"ltr\">\n  <chapter>\n    <info>\n      <title>Chapter title</title>\n    </info>\n    <para>My sentence</para>\n  </chapter>\n  <info>\n    <title>Book title</title>\n    <subtitle>Book subtitle</subtitle>\n  </info>\n</book>\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"subtitle\"\n            , MetaInlines [ Str \"Book\" , Space , Str \"subtitle\" ]\n            )\n          , ( \"title\"\n            , MetaInlines [ Str \"Book\" , Space , Str \"title\" ]\n            )\n          ]\n    }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"Chapter\" , Space , Str \"title\" ]\n  , Para [ Str \"My\" , Space , Str \"sentence\" ]\n  ]\n```\n"
  },
  {
    "path": "test/command/11309.md",
    "content": "```\n% pandoc -f rst -t native\nCho\\ **co**\\ late\n^D\n[ Para [ Str \"Cho\" , Strong [ Str \"co\" ] , Str \"late\" ] ]\n```\n"
  },
  {
    "path": "test/command/11312.md",
    "content": "```\n% pandoc -f mediawiki -t texinfo\nfoofoo\n\n bar\n baz\n\nfoofoo\n^D\n@node Top\n@top Top\n\nfoofoo\n\n@example\nbar\nbaz\n@end example\n\nfoofoo\n```\n"
  },
  {
    "path": "test/command/11323.md",
    "content": "```\n% pandoc -f rst\nfoo-\n   bar\n^D\n<dl>\n<dt>foo-</dt>\n<dd>\n<p>bar</p>\n</dd>\n</dl>\n```\n"
  },
  {
    "path": "test/command/11341.md",
    "content": "```\n% pandoc -t commonmark -f html\n<h1>The Hobbit<br>or<br>There and Back Again</h1>\n^D\nThe Hobbit\\\nor\\\nThere and Back Again\n====================\n```\n"
  },
  {
    "path": "test/command/11342.md",
    "content": "Subfigures should be converted to *fig-group* elements.\n\n```\n% pandoc -f latex -t jats\n\\begin{figure}[H]\n  \\begin{subfigure}\n    \\centering\n    \\includegraphics[height=1.5in]{assets/A.png}\n    \\caption{Graph for function *A*.}\n    \\label{fig:A}\n  \\end{subfigure}\n  \\begin{subfigure}\n    \\centering\n    \\includegraphics[height=1.5in]{assets/B.png}\n    \\caption{Graph for function *B*.}\n    \\label{fig:B}\n  \\end{subfigure}\n  \\label{fig:graphs}\n  \\caption{Function graphs.}\n\\end{figure}\n^D\n<fig-group id=\"figU003Agraphs\">\n  <caption><p>Function graphs.</p></caption>\n  <fig id=\"figU003AA\">\n    <caption><p>Graph for function *A*.</p></caption>\n    <graphic mimetype=\"image\" mime-subtype=\"png\" xlink:href=\"assets/A.png\" />\n  </fig>\n  <fig id=\"figU003AB\">\n    <caption><p>Graph for function *B*.</p></caption>\n    <graphic mimetype=\"image\" mime-subtype=\"png\" xlink:href=\"assets/B.png\" />\n  </fig>\n</fig-group>\n```"
  },
  {
    "path": "test/command/11348.md",
    "content": "```\n% pandoc -f markdown -t native\n$ invalid opening inline math$\n\n$\ninvalid opening inline math$\n\n$invalid closing inline math $\n\n$invalid closing inline math\n$\n\n$valid inline math$\n^D\n[ Para\n    [ Str \"$\"\n    , Space\n    , Str \"invalid\"\n    , Space\n    , Str \"opening\"\n    , Space\n    , Str \"inline\"\n    , Space\n    , Str \"math$\"\n    ]\n, Para\n    [ Str \"$\"\n    , SoftBreak\n    , Str \"invalid\"\n    , Space\n    , Str \"opening\"\n    , Space\n    , Str \"inline\"\n    , Space\n    , Str \"math$\"\n    ]\n, Para\n    [ Str \"$invalid\"\n    , Space\n    , Str \"closing\"\n    , Space\n    , Str \"inline\"\n    , Space\n    , Str \"math\"\n    , Space\n    , Str \"$\"\n    ]\n, Para\n    [ Str \"$invalid\"\n    , Space\n    , Str \"closing\"\n    , Space\n    , Str \"inline\"\n    , Space\n    , Str \"math\"\n    , SoftBreak\n    , Str \"$\"\n    ]\n, Para [ Math InlineMath \"valid inline math\" ]\n]\n```\n"
  },
  {
    "path": "test/command/11362.md",
    "content": "```\n% pandoc -f markdown -t asciidoc\nThis is a _test_[^1].\n\nAnd yet another **one**[^1].\n\nWe can also try to write #hashtags [this]{.test}.\n\n[^1]: Test footnote.\n^D\nThis is a __test__footnote:[Test footnote.].\n\nAnd yet another **one**footnote:[Test footnote.].\n\nWe can also try to write ++#++hashtags [.test]#this#.\n\n```\n"
  },
  {
    "path": "test/command/11364.md",
    "content": "```\n% pandoc -f rtf -t native\n{\\rtf1\\ansi\\deff3\\adeflang1025\n{\\fonttbl{\\f0\\froman\\fprq2\\fcharset0 Times New Roman;}{\\f1\\froman\\fprq2\\fcharset2 Symbol;}{\\f2\\fswiss\\fprq2\\fcharset0 Arial;}{\\f3\\froman\\fprq2\\fcharset0 Liberation Serif{\\*\\falt Times New Roman};}{\\f4\\fnil\\fprq0\\fcharset2 OpenSymbol{\\*\\falt Arial Unicode MS};}{\\f5\\fswiss\\fprq2\\fcharset0 Liberation Sans{\\*\\falt Arial};}{\\f6\\fnil\\fprq2\\fcharset0 Noto Sans CJK SC;}{\\f7\\fnil\\fprq2\\fcharset0 Matangi Light;}{\\f8\\fnil\\fprq0\\fcharset128 Matangi Light;}{\\f9\\fnil\\fprq0\\fcharset128 OpenSymbol{\\*\\falt Arial Unicode MS};}}\n{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0;\\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;}\n{\\stylesheet{\\s0\\snext0\\widctlpar\\hyphpar0\\ltrpar\\kerning1\\cf0\\rtlch\\af7\\afs24\\alang1081\\ltrch\\hich\\af3\\afs24\\alang1033\\dbch\\af10\\langfe2052\\loch\\f3\\fs24\\lang1033 Normal;}\n{\\*\\cs15\\snext15\\rtlch\\af4\\ltrch\\hich\\af4\\dbch\\af4\\loch\\f4 Bullets;}\n{\\s16\\sbasedon0\\snext17\\sb240\\sa120\\keepn\\rtlch\\af7\\afs28\\ltrch\\hich\\af5\\afs28\\dbch\\af6\\loch\\f5\\fs28 Heading;}\n{\\s17\\sbasedon0\\snext17\\sl276\\slmult1\\sb0\\sa140 Body Text;}\n{\\s18\\sbasedon17\\snext18\\rtlch\\af8\\ltrch List;}\n{\\s19\\sbasedon0\\snext19\\sb120\\sa120\\noline\\rtlch\\af8\\afs24\\ai\\ltrch\\fs24\\i caption;}\n{\\s20\\sbasedon0\\snext20\\noline\\rtlch\\af8\\ltrch Index;}\n{\\s21\\sbasedon0\\snext21\\nowidctlpar\\noline Table Contents;}\n}{\\*\\listtable{\\list\\listtemplateid1\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u8226 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li720}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u9702 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li1080}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u9642 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li1440}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u8226 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li1800}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u9702 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li2160}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u9642 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li2520}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u8226 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li2880}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u9702 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li3240}\n{\\listlevel\\levelnfc23\\leveljc0\\levelstartat1\\levelfollow0{\\leveltext \\'01\\u9642 ?;}{\\levelnumbers;}\\f9\\rtlch\\af4\\ltrch\\fi-360\\li3600}\\listid1}\n{\\list\\listtemplateid2\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\n{\\listlevel\\levelnfc255\\leveljc0\\levelstartat1\\levelfollow2{\\leveltext \\'00;}{\\levelnumbers;}\\fi0\\li0}\\listid2}\n}{\\listoverridetable{\\listoverride\\listid1\\listoverridecount0\\ls1}{\\listoverride\\listid2\\listoverridecount0\\ls2}}{\\*\\generator LibreOffice/25.8.4.2$Linux_X86_64 LibreOffice_project/580$Build-2}{\\info{\\creatim\\yr2025\\mo12\\dy28\\hr10\\min51}{\\revtim\\yr2025\\mo12\\dy28\\hr10\\min53}{\\printim\\yr0\\mo0\\dy0\\hr0\\min0}}{\\*\\userprops}\\deftab709\n\\hyphauto1\\viewscale140\\formshade\\nobrkwrptbl\\paperh15840\\paperw12240\\margl1134\\margr1134\\margt1134\\margb1134\\sectd\\sbknone\\sftnnar\\saftnnrlc\\sectunlocked1\\pgwsxn12240\\pghsxn15840\\marglsxn1134\\margrsxn1134\\margtsxn1134\\margbsxn1134\\ftnbj\\ftnstart1\\ftnrstcont\\ftnnar\\fet\\aftnrstcont\\aftnstart1\\aftnnrlc\n{\\*\\ftnsep\\chftnsep}\\pgndec\\pard\\plain \\s0\\widctlpar\\hyphpar0\\ltrpar\\kerning1\\cf0\\rtlch\\af7\\afs24\\alang1081\\ltrch\\hich\\af3\\afs24\\alang1033\\dbch\\af10\\langfe2052\\loch\\f3\\fs24\\lang1033{\\listtext\\pard\\plain \\rtlch\\af4\\ltrch\\hich\\af4\\dbch\\af4\\loch\\f4 \\u8226\\'95\\tab}\\ilvl0\\ls1 \\fi-360\\li720\\lin720\\ql\\ltrpar{\nList item}\n\\par \\trowd\\trql\\ltrrow\\trpaddft3\\trpaddt0\\trpaddfl3\\trpaddl0\\trpaddfb3\\trpaddb0\\trpaddfr3\\trpaddr0\\clbrdrt\\brdrs\\brdrw10\\brdrcf1\\clpadfl3\\clpadl55\\clbrdrl\\brdrs\\brdrw10\\brdrcf1\\clpadft3\\clpadt55\\clbrdrb\\brdrs\\brdrw10\\brdrcf1\\clpadfb3\\clpadb55\\clpadfr3\\clpadr55\\cellx4986\\clbrdrt\\brdrs\\brdrw10\\brdrcf1\\clpadfl3\\clpadl55\\clbrdrl\\brdrs\\brdrw10\\brdrcf1\\clpadft3\\clpadt55\\clbrdrb\\brdrs\\brdrw10\\brdrcf1\\clpadfb3\\clpadb55\\clbrdrr\\brdrs\\brdrw10\\brdrcf1\\clpadfr3\\clpadr55\\cellx9972\\pard\\plain \\s21\\nowidctlpar\\noline\\intbl\\ql\\ltrpar{\nA}\\cell\\pard\\plain \\s21\\nowidctlpar\\noline\\intbl\\ql\\ltrpar{\nB}\\cell\\row\\pard \\pard\\plain \\s0\\widctlpar\\hyphpar0\\ltrpar\\kerning1\\cf0\\rtlch\\af7\\afs24\\alang1081\\ltrch\\hich\\af3\\afs24\\alang1033\\dbch\\af10\\langfe2052\\loch\\f3\\fs24\\lang1033\\ql\\ltrpar\n\\par }\n^D\n[ BulletList\n    [ [ Para [ Str \"List\" , Space , Str \"item\" ] ] ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"A\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"B\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/11374.md",
    "content": "```\n% pandoc -f native -t asciidoc\n[ Para [ SmallCaps [ Str \"foo\" ] ] ]\n^D\n[smallcaps]#foo#\n```\n"
  },
  {
    "path": "test/command/11384.md",
    "content": "```\n% pandoc -t markdown -f native\n[ Para [ Math DisplayMath \"\\ne = mc^2\\n\" ] ]\n^D\n$$\ne = mc^2\n$$\n```\n\nBut we need to collapse spaces around inline math:\n\n```\n% pandoc -t markdown -f native\n[ Para [ Math InlineMath \"\\ne=mc\\n\" ]]\n^D\n$e=mc$\n```\n"
  },
  {
    "path": "test/command/11409.md",
    "content": "```\n% pandoc -t native\ntext^[sup]{.class}^\n^D\n[ Para\n    [ Str \"text\"\n    , Superscript\n        [ Span ( \"\" , [ \"class\" ] , [] ) [ Str \"sup\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/11420.md",
    "content": "````\n% pandoc -t revealjs --syntax-highlighting=idiomatic\n# Slide\n\n```python\ndef hello():\n    print(\"Hello\")\n```\n^D\n<section id=\"slide\" class=\"slide level1\">\n<h1>Slide</h1>\n<pre><code class=\"language-python\">def hello():\n    print(&quot;Hello&quot;)</code></pre>\n</section>\n````\n"
  },
  {
    "path": "test/command/11422.md",
    "content": "```\n% pandoc -f docbook -t markdown\n<example>\n    <para>\n      Example without a title.\n    </para>\n</example>\n^D\n::: example\nExample without a title.\n:::\n```\n"
  },
  {
    "path": "test/command/11450.md",
    "content": "Test for \\footnotemark and \\footnotetext (issue #11450)\n\n```\n% pandoc -f latex -t native\nText\\footnotemark{}.\n\\footnotetext{The footnote content.}\n^D\n[ Para\n    [ Str \"Text\"\n    , Note\n        [ Para\n            [ Str \"The\"\n            , Space\n            , Str \"footnote\"\n            , Space\n            , Str \"content.\"\n            ]\n        ]\n    , Str \".\"\n    ]\n]\n```\n\nWith explicit footnote numbers:\n\n```\n% pandoc -f latex -t native\nFirst\\footnotemark[1] and second\\footnotemark[2].\n\\footnotetext[1]{First note.}\n\\footnotetext[2]{Second note.}\n^D\n[ Para\n    [ Str \"First\"\n    , Note [ Para [ Str \"First\" , Space , Str \"note.\" ] ]\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"second\"\n    , Note [ Para [ Str \"Second\" , Space , Str \"note.\" ] ]\n    , Str \".\"\n    ]\n]\n```\n\nMixed with regular footnotes:\n\n```\n% pandoc -f latex -t native\nText\\footnotemark[1] and more\\footnote{Regular footnote.}\n\\footnotetext[1]{Marked footnote.}\n^D\n[ Para\n    [ Str \"Text\"\n    , Note [ Para [ Str \"Marked\" , Space , Str \"footnote.\" ] ]\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"more\"\n    , Note [ Para [ Str \"Regular\" , Space , Str \"footnote.\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/11455.md",
    "content": "```\n% pandoc -f textile -t html\n| foo | bar |\n| table\n* item 1\n* item 2\n* item 3 | xxx |\n^D\n<table>\n<tbody>\n<tr>\n<td>foo</td>\n<td>bar</td>\n</tr>\n<tr>\n<td><p>table</p>\n<ul>\n<li>item 1</li>\n<li>item 2</li>\n<li>item 3</li>\n</ul></td>\n<td>xxx</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/11463.md",
    "content": "```\n% pandoc -t typst\n'hi' and \\'\n^D\n'hi' and \\'\n```\n\n```\n% pandoc -f markdown -t typst | pandoc -f typst -t markdown\n\"hi\" \\\" 'hi' and \\'\n^D\n\"hi\" \\\" 'hi' and \\'\n```\n"
  },
  {
    "path": "test/command/11479.md",
    "content": "```\n% pandoc -f docbook -t gfm\n<important>\n<itemizedlist>\n<listitem>\n<simpara>Test.</simpara>\n</listitem>\n<listitem>\n<simpara>Test 2.</simpara>\n</listitem>\n</itemizedlist>\n</important>\n^D\n> [!IMPORTANT]\n> - Test.\n>\n> - Test 2.\n```\n\n```\n% pandoc -f gfm -t gfm\n> [!IMPORTANT]\n> - Test.\n>\n> - Test 2.\n^D\n> [!IMPORTANT]\n> - Test.\n>\n> - Test 2.\n```\n"
  },
  {
    "path": "test/command/11486/scroll.revealjs",
    "content": "$if(view)$\n        scrollActivationWidth: $scrollActivationWidth$,\n$if(scrollSnap)$\n        scrollSnap: '$scrollSnap/nowrap$',\n$else$\n        scrollSnap: false,\n$endif$\n$if(scrollProgressAuto)$\n        scrollProgress: 'auto',\n$elseif(scrollProgress)$\n        scrollProgress: $scrollProgress$,\n$else$\n        scrollProgress: false,\n$endif$\n$endif$\n"
  },
  {
    "path": "test/command/11486.md",
    "content": "```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\n---\n^D\n        scrollActivationWidth: 0,\n        scrollSnap: 'mandatory',\n        scrollProgress: 'auto',\n```\n\n```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\nscrollSnap: false\n---\n^D\n        scrollActivationWidth: 0,\n        scrollSnap: false,\n        scrollProgress: 'auto',\n```\n\n```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\nscrollSnap: proximity\n---\n^D\n        scrollActivationWidth: 0,\n        scrollSnap: 'proximity',\n        scrollProgress: 'auto',\n```\n\n```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\nscrollActivationWidth: 500\n---\n^D\n        scrollActivationWidth: 500,\n        scrollSnap: 'mandatory',\n        scrollProgress: 'auto',\n```\n\n```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\nscrollProgress: true\n---\n^D\n        scrollActivationWidth: 0,\n        scrollSnap: 'mandatory',\n        scrollProgress: true,\n```\n\n```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\nscrollProgress: false\n---\n^D\n        scrollActivationWidth: 0,\n        scrollSnap: 'mandatory',\n        scrollProgress: false,\n```\n\n```\n% pandoc -t revealjs --template=command/11486/scroll.revealjs\n---\nview: scroll\nscrollProgress: auto\n---\n^D\n        scrollActivationWidth: 0,\n        scrollSnap: 'mandatory',\n        scrollProgress: 'auto',\n```\n"
  },
  {
    "path": "test/command/11490.md",
    "content": "```\n% pandoc -t markdown\n&lt;&amp;lt;\n^D\n\\<\\&lt;\n```\n\n```\n% pandoc -t markdown\n&amp;#xa0;\n^D\n\\&#xa0;\n```\n"
  },
  {
    "path": "test/command/11494.md",
    "content": "External images should not use [[File:...]] syntax.\n\nInline external image:\n```\n% pandoc -f native -t mediawiki\n[Para [Image (\"\",[],[]) [] (\"https://example.org/image.png\", \"\")]]\n^D\n<nowiki></nowiki>https://example.org/image.png<nowiki></nowiki>\n```\n\nInline local image (should still use [[File:]]):\n```\n% pandoc -f native -t mediawiki\n[Para [Image (\"\",[],[]) [] (\"local.png\", \"\")]]\n^D\n[[File:local.png]]\n```\n\nFigure with external image (from markdown):\n```\n% pandoc -f markdown -t mediawiki\n![](https://example.org/figure.png)\n^D\n<nowiki></nowiki>https://example.org/figure.png<nowiki></nowiki>\n```\n\nLocal image (from markdown, no caption):\n```\n% pandoc -f markdown -t mediawiki\n![](local.png)\n^D\n[[File:local.png]]\n```\n\nFigure with caption and external image:\n```\n% pandoc -f markdown -t mediawiki\n![Caption](https://example.org/figure.png)\n^D\n<div class=\"figure\">\n<nowiki></nowiki>https://example.org/figure.png<nowiki></nowiki>\n</div>\n```\n\nFigure with caption and local image:\n```\n% pandoc -f markdown -t mediawiki\n![Caption](local.png)\n^D\n<div class=\"figure\">\n[[File:local.png|Caption]]\n</div>\n```\n\nSimpleFigure with external image (native format with fig: title):\n```\n% pandoc -f native -t mediawiki\n[Figure (\"\",[],[]) (Caption Nothing []) [Para [Image (\"\",[],[]) [Str \"caption\"] (\"https://example.org/figure.png\", \"fig:\")]]]\n^D\n<div class=\"figure\">\n<nowiki></nowiki>https://example.org/figure.png<nowiki></nowiki>\n</div>\n```\n\nSimpleFigure with local image (native format with fig: title):\n```\n% pandoc -f native -t mediawiki\n[Figure (\"\",[],[]) (Caption Nothing []) [Para [Image (\"\",[],[]) [Str \"caption\"] (\"local.png\", \"fig:\")]]]\n^D\n<div class=\"figure\">\n[[File:local.png|thumb|none|alt=caption|caption]]\n</div>\n```\n"
  },
  {
    "path": "test/command/11498.md",
    "content": "```\n% pandoc -f markdown -t icml\n![](command/11498.png){object-style=\"myStyle\"}\n^D\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 32 -32\" AppliedObjectStyle=\"ObjectStyle/myStyle\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-32 -32\" LeftDirection=\"-32 -32\" RightDirection=\"-32 -32\" />\n              <PathPointType Anchor=\"-32 32\" LeftDirection=\"-32 32\" RightDirection=\"-32 32\" />\n              <PathPointType Anchor=\"32 32\" LeftDirection=\"32 32\" RightDirection=\"32 32\" />\n              <PathPointType Anchor=\"32 -32\" LeftDirection=\"32 -32\" RightDirection=\"32 -32\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -32 -32\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"64\" Bottom=\"64\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:command/11498.png\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n```\n```\n% pandoc -s -f markdown -t icml\n![](command/11498.png){object-style=\"myStyle\"}\n^D\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$ID/NormalCharacterStyle\" Name=\"Default\" />\n      <CharacterStyle Self=\"CharacterStyle/\" Name=\"\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$ID/NormalParagraphStyle\" Name=\"$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Paragraph\" Name=\"Paragraph\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n    <RootObjectStyleGroup Self=\"pandoc_object_styles\">\n      <ObjectStyle Self=\"ObjectStyle/myStyle\" Name=\"myStyle\">\n        <Properties>\n          <BasedOn type=\"string\">$ID/None</BasedOn>\n        </Properties>\n      </ObjectStyle>\n    </RootObjectStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 32 -32\" AppliedObjectStyle=\"ObjectStyle/myStyle\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-32 -32\" LeftDirection=\"-32 -32\" RightDirection=\"-32 -32\" />\n              <PathPointType Anchor=\"-32 32\" LeftDirection=\"-32 32\" RightDirection=\"-32 32\" />\n              <PathPointType Anchor=\"32 32\" LeftDirection=\"32 32\" RightDirection=\"32 32\" />\n              <PathPointType Anchor=\"32 -32\" LeftDirection=\"32 -32\" RightDirection=\"32 -32\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -32 -32\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"64\" Bottom=\"64\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:command/11498.png\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n\n  </Story>\n  \n</Document>\n```\n"
  },
  {
    "path": "test/command/11511.md",
    "content": "```\n% pandoc -f html -t typst\n<p><a href=\"http://torch.utils.data\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">torch.utils.data</a>.Dataset</p>\n^D\n#link(\"http://torch.utils.data\")[torch.utils.data]\\.Dataset\n```\n"
  },
  {
    "path": "test/command/11534.md",
    "content": "```\n% pandoc -f markdown+lists_without_preceding_blankline+alerts -t native\n:::: caution\n::: title\nCaution\n:::\n\nFoo bar, wuppie fluppie!\n::::\n^D\n[ Div\n    ( \"\" , [ \"caution\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Caution\" ] ]\n    , Para\n        [ Str \"Foo\"\n        , Space\n        , Str \"bar,\"\n        , Space\n        , Str \"wuppie\"\n        , Space\n        , Str \"fluppie!\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f markdown+lists_without_preceding_blankline -t native\nhello\n- a\n- b\nc\n^D\n[ Para [ Str \"hello\" ]\n, BulletList\n    [ [ Plain [ Str \"a\" ] ]\n    , [ Plain [ Str \"b\" , SoftBreak , Str \"c\" ] ]\n    ]\n]\n\n```\n\n"
  },
  {
    "path": "test/command/1166.md",
    "content": "See #1166 and <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables>.\n\n```\n% pandoc -f rst -t html5\n=====  =====\ncol 1  col 2\n=====  =====\n1      Second column of row 1.\n2      Second column of row 2.\n       Second line of paragraph.\n3      - Second column of row 3.\n\n       - Second item in bullet\n         list (row 3, column 2).\n\\      Row 4; column 1 will be empty.\n=====  =====\n^D\n<table>\n<thead>\n<tr>\n<th>col 1</th>\n<th>col 2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td>Second column of row 1.</td>\n</tr>\n<tr>\n<td>2</td>\n<td>Second column of row 2. Second line of paragraph.</td>\n</tr>\n<tr>\n<td>3</td>\n<td><ul>\n<li>Second column of row 3.</li>\n<li>Second item in bullet list (row 3, column 2).</li>\n</ul></td>\n</tr>\n<tr>\n<td></td>\n<td>Row 4; column 1 will be empty.</td>\n</tr>\n</tbody>\n</table>\n```\n\n"
  },
  {
    "path": "test/command/1279.md",
    "content": "```\n% pandoc -s -t markdown\n---\nauthor: 'John Doe[^1]'\ndate: 2014\ntitle: My Article\n---\n\n[^1]: Dept. of This and That\n^D\n---\nauthor: John Doe[^1]\ndate: 2014\ntitle: My Article\n---\n\n[^1]: Dept. of This and That\n```\n\n"
  },
  {
    "path": "test/command/1390.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand\\foo{+}\nTesting: $\\mu\\foo\\eta$.\n^D\n[ Para\n    [ Str \"Testing:\"\n    , Space\n    , Math InlineMath \"\\\\mu+\\\\eta\"\n    , Str \".\"\n    ]\n]\n```\n\n<!-- It would be nice to handle this case, but I don't\nknow how:\n\n```\n% pandoc -f latex -t native\n\\newcommand{\\vecx}{a + b}\n$\\hat\\vecx$\n^D\n[Para [Math InlineMath \"\\\\hat{a+b}\"]]\n```\n-->\n\n"
  },
  {
    "path": "test/command/1592.md",
    "content": "```\n% pandoc -t native\n[hi]{.smallcaps}\n^D\n[ Para [ SmallCaps [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -t native\n[hi]{style=\"font-variant: small-caps;\"}\n^D\n[ Para [ SmallCaps [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -t native\n<span class=\"smallcaps\">hi</span>\n^D\n[ Para [ SmallCaps [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -f html -t native\n<p><span class=\"smallcaps\">hi</span></p>\n^D\n[ Para [ SmallCaps [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -f html -t native\n<p><span style=\"font-variant:small-caps\">hi</span></p>\n^D\n[ Para [ SmallCaps [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -f native -t html\n[Para [SmallCaps [Str \"hi\"]]]\n^D\n<p><span class=\"smallcaps\">hi</span></p>\n```\n\n```\n% pandoc -f native -t markdown\n[Para [SmallCaps [Str \"hi\"]]]\n^D\n[hi]{.smallcaps}\n```\n\n```\n% pandoc -f html -t native\n<bdo dir=\"ltr\">foo</bdo>\n^D\n[ Plain\n    [ Span ( \"\" , [] , [ ( \"dir\" , \"ltr\" ) ] ) [ Str \"foo\" ] ]\n]\n```\n\n```\n% pandoc -f html -t native\n<bdo dir=\"rtl\">foo<bdo dir=\"ltr\">bar</bdo>baz</bdo>\n^D\n[ Plain\n    [ Span\n        ( \"\" , [] , [ ( \"dir\" , \"rtl\" ) ] )\n        [ Str \"foo\"\n        , Span ( \"\" , [] , [ ( \"dir\" , \"ltr\" ) ] ) [ Str \"bar\" ]\n        , Str \"baz\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<p><bdo dir=\"rtl\">This text will go right\nto left.</bdo></p>\n^D\n[ Para\n    [ Span\n        ( \"\" , [] , [ ( \"dir\" , \"rtl\" ) ] )\n        [ Str \"This\"\n        , Space\n        , Str \"text\"\n        , Space\n        , Str \"will\"\n        , Space\n        , Str \"go\"\n        , Space\n        , Str \"right\"\n        , SoftBreak\n        , Str \"to\"\n        , Space\n        , Str \"left.\"\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/1608.md",
    "content": "```\n% pandoc -f latex -t native\n\\newtheorem{theorem}{Theorem}\n\\newtheorem{corollary}[theorem]{Corollary}\n\\newtheorem{lemma}[theorem]{Lemma}\n\\theoremstyle{definition}\n\\newtheorem{definition}[theorem]{Definition}\n\\theoremstyle{remark}\n\\newtheorem{remark}{Remark}\n\n\\begin{definition}[right-angled triangles] \\label{def:tri}\nA \\emph{right-angled triangle} is a triangle whose sides of length~\\(a\\), \\(b\\) and~\\(c\\), in some permutation of order, satisfies \\(a^2+b^2=c^2\\).\n\\end{definition}\n\n\\begin{lemma}\nThe triangle with sides of length~\\(3\\), \\(4\\) and~\\(5\\) is right-angled.\n\\end{lemma}\n\n\\begin{proof}\nThis lemma follows from \\cref{def:tri} since \\(3^2+4^2=9+16=25=5^2\\).\n\\end{proof}\n\n\\begin{theorem}[Pythagorean triplets] \\label{thm:py}\nTriangles with sides of length \\(a=p^2-q^2\\), \\(b=2pq\\) and \\(c=p^2+q^2\\) are right-angled triangles.\n\\end{theorem}\n\n\\begin{remark}\nThese are all pretty interesting facts.\n\\end{remark}\n^D\n[ Div\n    ( \"def:tri\" , [ \"definition\" ] , [] )\n    [ Para\n        [ Strong [ Str \"Definition\" , Space , Str \"1\" ]\n        , Space\n        , Str \"(right-angled\"\n        , Space\n        , Str \"triangles).\"\n        , Space\n        , Space\n        , Str \"A\"\n        , Space\n        , Emph [ Str \"right-angled\" , Space , Str \"triangle\" ]\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"triangle\"\n        , Space\n        , Str \"whose\"\n        , Space\n        , Str \"sides\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"length\\160\"\n        , Math InlineMath \"a\"\n        , Str \",\"\n        , Space\n        , Math InlineMath \"b\"\n        , Space\n        , Str \"and\\160\"\n        , Math InlineMath \"c\"\n        , Str \",\"\n        , Space\n        , Str \"in\"\n        , Space\n        , Str \"some\"\n        , Space\n        , Str \"permutation\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"order,\"\n        , Space\n        , Str \"satisfies\"\n        , Space\n        , Math InlineMath \"a^2+b^2=c^2\"\n        , Str \".\"\n        ]\n    ]\n, Div\n    ( \"\" , [ \"lemma\" ] , [] )\n    [ Para\n        [ Strong [ Str \"Lemma\" , Space , Str \"2\" ]\n        , Str \".\"\n        , Space\n        , Space\n        , Emph\n            [ Str \"The\"\n            , Space\n            , Str \"triangle\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"sides\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"length\\160\"\n            , Math InlineMath \"3\"\n            , Str \",\"\n            , Space\n            , Math InlineMath \"4\"\n            , Space\n            , Str \"and\\160\"\n            , Math InlineMath \"5\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"right-angled.\"\n            ]\n        ]\n    ]\n, Div\n    ( \"\" , [ \"proof\" ] , [] )\n    [ Para\n        [ Emph [ Str \"Proof.\" ]\n        , Space\n        , Str \"This\"\n        , Space\n        , Str \"lemma\"\n        , Space\n        , Str \"follows\"\n        , Space\n        , Str \"from\"\n        , Space\n        , Link\n            ( \"\"\n            , []\n            , [ ( \"reference-type\" , \"ref+label\" )\n              , ( \"reference\" , \"def:tri\" )\n              ]\n            )\n            [ Str \"1\" ]\n            ( \"#def:tri\" , \"\" )\n        , Space\n        , Str \"since\"\n        , Space\n        , Math InlineMath \"3^2+4^2=9+16=25=5^2\"\n        , Str \".\"\n        , Str \"\\160\\9723\"\n        ]\n    ]\n, Div\n    ( \"thm:py\" , [ \"theorem\" ] , [] )\n    [ Para\n        [ Strong [ Str \"Theorem\" , Space , Str \"3\" ]\n        , Space\n        , Str \"(Pythagorean\"\n        , Space\n        , Str \"triplets).\"\n        , Space\n        , Space\n        , Emph\n            [ Str \"Triangles\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"sides\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"length\"\n            , Space\n            , Math InlineMath \"a=p^2-q^2\"\n            , Str \",\"\n            , Space\n            , Math InlineMath \"b=2pq\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Math InlineMath \"c=p^2+q^2\"\n            , Space\n            , Str \"are\"\n            , Space\n            , Str \"right-angled\"\n            , Space\n            , Str \"triangles.\"\n            ]\n        ]\n    ]\n, Div\n    ( \"\" , [ \"remark\" ] , [] )\n    [ Para\n        [ Emph [ Str \"Remark\" , Space , Str \"1\" ]\n        , Str \".\"\n        , Space\n        , Space\n        , Str \"These\"\n        , Space\n        , Str \"are\"\n        , Space\n        , Str \"all\"\n        , Space\n        , Str \"pretty\"\n        , Space\n        , Str \"interesting\"\n        , Space\n        , Str \"facts.\"\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/1629.md",
    "content": "```\n% pandoc -t latex --syntax-highlighting=idiomatic\nbla bla `a % b`\n\n*bla bla `a % b`*\n^D\nbla bla \\passthrough{\\lstinline!a \\% b!}\n\n\\emph{bla bla \\passthrough{\\lstinline!a \\% b!}}\n```\n"
  },
  {
    "path": "test/command/168.md",
    "content": "```\n% pandoc -t native\n:::::::::: warning ::::::::::::\nThis is the warning!\n\n1. list\n2. another\n\n::: {#myid .class key=val}\nnested div\n:::\n:::::::::::::::::::::::::::::::\n^D\n[ Div\n    ( \"\" , [ \"warning\" ] , [] )\n    [ Para\n        [ Str \"This\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"warning!\"\n        ]\n    , OrderedList\n        ( 1 , Decimal , Period )\n        [ [ Plain [ Str \"list\" ] ] , [ Plain [ Str \"another\" ] ] ]\n    , Div\n        ( \"myid\" , [ \"class\" ] , [ ( \"key\" , \"val\" ) ] )\n        [ Para [ Str \"nested\" , Space , Str \"div\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -t native\nfoo\n:::\nbar\n^D\n[ Para\n    [ Str \"foo\"\n    , SoftBreak\n    , Str \":::\"\n    , SoftBreak\n    , Str \"bar\"\n    ]\n]\n```\n\n```\n% pandoc -t native\n::::: Warning\nHere is a paragraph.\n\nAnd another.\n:::::\n^D\n[ Div\n    ( \"\" , [ \"Warning\" ] , [] )\n    [ Para\n        [ Str \"Here\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"paragraph.\"\n        ]\n    , Para [ Str \"And\" , Space , Str \"another.\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/1710.md",
    "content": "```\n% pandoc -t revealjs\n# Slide one\n\n<div class=\"columns\">\n<div class=\"column\" width=\"40%\">\n- a\n- b\n</div>\n<div class=\"column\" width=\"40%\">\n- c\n- d\n</div>\n<div class=\"column\" width=\"10%\">\nok\n</div>\n</div>\n^D\n<section id=\"slide-one\" class=\"slide level1\">\n<h1>Slide one</h1>\n<div class=\"columns\">\n<div class=\"column\" style=\"width:40%;\">\n<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n</div><div class=\"column\" style=\"width:40%;\">\n<ul>\n<li>c</li>\n<li>d</li>\n</ul>\n</div><div class=\"column\" style=\"width:10%;\">\n<p>ok</p>\n</div>\n</div>\n</section>\n```\n\n```\n% pandoc -t beamer\n# Slide one\n\n<div class=\"columns\">\n<div class=\"column\" width=\"40%\">\n- a\n- b\n</div>\n<div class=\"column\" width=\"40%\">\n- c\n- d\n</div>\n<div class=\"column\" width=\"10%\">\nok\n</div>\n</div>\n^D\n\\begin{frame}{Slide one}\n\\protect\\phantomsection\\label{slide-one}\n\\begin{columns}[T]\n\\begin{column}{0.4\\linewidth}\n\\begin{itemize}\n\\tightlist\n\\item\n  a\n\\item\n  b\n\\end{itemize}\n\\end{column}\n\n\\begin{column}{0.4\\linewidth}\n\\begin{itemize}\n\\tightlist\n\\item\n  c\n\\item\n  d\n\\end{itemize}\n\\end{column}\n\n\\begin{column}{0.1\\linewidth}\nok\n\\end{column}\n\\end{columns}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/1718.md",
    "content": "```\n% pandoc -t native\nNote[^1].\n\n[^1]: the first note.\n\n[^2]: the second, unused, note.\n^D\n2> [WARNING] Note with key '2' defined at line 5 column 1 but not used.\n[ Para\n    [ Str \"Note\"\n    , Note\n        [ Para\n            [ Str \"the\" , Space , Str \"first\" , Space , Str \"note.\" ]\n        ]\n    , Str \".\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/1745.md",
    "content": "```\n% pandoc -f latex+auto_identifiers -t html\n\\section{Six favourite beers}\n\\subsection{Jovaru Alus}\\label{jovaru-alus}\n\\section{Farmhouse brewers}\n\\subsection{Jovaru Alus}\n^D\n<h1 id=\"six-favourite-beers\">Six favourite beers</h1>\n<h2 id=\"jovaru-alus\">Jovaru Alus</h2>\n<h1 id=\"farmhouse-brewers\">Farmhouse brewers</h1>\n<h2 id=\"jovaru-alus-1\">Jovaru Alus</h2>\n```\n\n"
  },
  {
    "path": "test/command/1762.md",
    "content": "```\n% pandoc -t latex\n# One {.unlisted}\n\n# Two {.unnumbered}\n\n# Three {.unlisted .unnumbered}\n^D\n\\section{One}\\label{one}\n\n\\section*{Two}\\label{two}\n\\addcontentsline{toc}{section}{Two}\n\n\\section*{Three}\\label{three}\n```\n"
  },
  {
    "path": "test/command/1773.md",
    "content": "```\n% pandoc -f latex+raw_tex -t native\n\\noindent hi\n^D\n[ Para\n    [ RawInline (Format \"latex\") \"\\\\noindent \" , Str \"hi\" ]\n]\n```\n"
  },
  {
    "path": "test/command/1841.md",
    "content": "```\n% pandoc\n<table>\n<tr>\n<td>    *one*</td>\n<td>    [a link](http://google.com)</td>\n</tr>\n</table>\n^D\n<table>\n<tr>\n<td>\n<em>one</em>\n</td>\n<td>\n<a href=\"http://google.com\">a link</a>\n</td>\n</tr>\n</table>\n```\n\n```\n% pandoc\n<table>\n    <tr>\n        <td>*one*</td>\n        <td>[a link](http://google.com)</td>\n    </tr>\n</table>\n^D\n<table>\n<tr>\n<td>\n<em>one</em>\n</td>\n<td>\n<a href=\"http://google.com\">a link</a>\n</td>\n</tr>\n</table>\n```\n\n"
  },
  {
    "path": "test/command/1881.md",
    "content": "```\n% pandoc -f html -t native\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td>12</td>\n</tr>\n</tbody>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Demonstration\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"simple\"\n           , Space\n           , Str \"table\"\n           , Space\n           , Str \"syntax.\"\n           ]\n       ])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignRight\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignLeft\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignRight\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f html -t native\n<table>\n<tr>\n<td style=\"text-align: right;\">12</td>\n<td style=\"text-align:left;\">12</td>\n<td style=\"text-align:  center\">12</td>\n<td style=\"text-align: right;\">12</td>\n</tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignRight\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignRight\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n"
  },
  {
    "path": "test/command/1905.md",
    "content": "```\n% pandoc -f latex-auto_identifiers -t html\n\\chapter{chapone}\n\\part{partone}\n\\chapter{chaptwo}\n\\section{secone}\n^D\n<h2>chapone</h2>\n<h1>partone</h1>\n<h2>chaptwo</h2>\n<h3>secone</h3>\n```\n\n```\n% pandoc -f latex-auto_identifiers -t html\n\\chapter{chapone}\n\\chapter{chaptwo}\n\\section{secone}\n^D\n<h1>chapone</h1>\n<h1>chaptwo</h1>\n<h2>secone</h2>\n```\n\n```\n% pandoc -f latex-auto_identifiers -t html\n\\section{secone}\n^D\n<h1>secone</h1>\n```\n"
  },
  {
    "path": "test/command/2103.md",
    "content": "```\n% pandoc -t latex\n| A happy pandoc user said \"fix this bug please\n| or I'll go crazy!\"\n^D\nA happy pandoc user said ``fix this bug please\\\\\nor I'll go crazy!''\n```\n"
  },
  {
    "path": "test/command/2118.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\inclgraph}{\\includegraphics[width=0.8\\textwidth]}\n\\begin{figure}[ht]\n  \\inclgraph{setminus.png}\n  \\caption{Set subtraction}\n  \\label{fig:setminus}\n\\end{figure}\n^D\n[ Figure\n    ( \"fig:setminus\" , [] , [ ( \"latex-placement\" , \"ht\" ) ] )\n    (Caption\n       Nothing [ Plain [ Str \"Set\" , Space , Str \"subtraction\" ] ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [ ( \"width\" , \"80%\" ) ] )\n            []\n            ( \"setminus.png\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/2228.md",
    "content": "```\n% pandoc -f markdown+smart -t latex+smart\n*foo*'s 'foo'\n^D\n\\emph{foo}'s `foo'\n```\n"
  },
  {
    "path": "test/command/2337.md",
    "content": "```\n% pandoc -t asciidoc -f html\n<a href=\"http://example.com\">][</a>\n^D\nhttp://example.com[++][++]\n```\n"
  },
  {
    "path": "test/command/2378.md",
    "content": "Ensure that we don't get duplicated footnotes when\na note occurs in a header cell and `\\endfirsthead`\nis used.\n\n```\n% pandoc -t latex\n| x | y[^fn] |\n|-|-|\n|1|2|\n: a table\n\n[^fn]: a footnote\n^D\n\\begin{longtable}[]{@{}ll@{}}\n\\caption{a table}\\tabularnewline\n\\toprule\\noalign{}\nx & y\\footnote{a footnote} \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\nx & y{} \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n1 & 2 \\\\\n\\end{longtable}\n```\n"
  },
  {
    "path": "test/command/2397.md",
    "content": "```\n% pandoc -f markdown_mmd\n# Chapter 1: A long name of chapter [Chapter 1]\n\nSee [Chapter 1].\n^D\n<h1 id=\"chapter1\">Chapter 1: A long name of chapter</h1>\n<p>See <a href=\"#chapter1\">Chapter 1</a>.</p>\n```\n"
  },
  {
    "path": "test/command/2434.md",
    "content": "```\n% pandoc -t opendocument\n1. a\n2. b\n    1. alpha\n    2. beta\n    * gamma\n^D\n<text:list text:style-name=\"L1\">\n  <text:list-item>\n    <text:p text:style-name=\"P1\">a</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P1\">b</text:p>\n    <text:list>\n      <text:list-item>\n        <text:p text:style-name=\"P1\">alpha</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P1\">beta</text:p>\n      </text:list-item>\n    </text:list>\n    <text:list text:style-name=\"L2\">\n      <text:list-item>\n        <text:p text:style-name=\"P2\">gamma</text:p>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n</text:list>\n```\n\n```\n% pandoc -t opendocument\n(@) text\n\n    some text\n\n    a) sub item 1\n    b) sub item 2\n\n    more text -- this line is missing in the odt output\n^D\n<text:list text:style-name=\"L1\">\n  <text:list-item>\n    <text:p text:style-name=\"P1\">text</text:p>\n    <text:p text:style-name=\"P1\">some text</text:p>\n    <text:list>\n      <text:list-item>\n        <text:p text:style-name=\"P1\">sub item 1</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P1\">sub item 2</text:p>\n      </text:list-item>\n    </text:list>\n    <text:p text:style-name=\"P1\">more text – this line is missing in the\n    odt output</text:p>\n  </text:list-item>\n</text:list>\n```\n"
  },
  {
    "path": "test/command/2465.md",
    "content": "```\n% pandoc -f textile -t native\nThis list starts:\n\n# one\n# two\n\nThis list should continue at 3:\n\n#3 three\n# four\n\nThis list should restart at 1:\n\n# one again\n# two again\n^D\n[ Para\n    [ Str \"This\" , Space , Str \"list\" , Space , Str \"starts:\" ]\n, OrderedList\n    ( 1 , DefaultStyle , DefaultDelim )\n    [ [ Plain [ Str \"one\" ] ] , [ Plain [ Str \"two\" ] ] ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"list\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"continue\"\n    , Space\n    , Str \"at\"\n    , Space\n    , Str \"3:\"\n    ]\n, OrderedList\n    ( 3 , DefaultStyle , DefaultDelim )\n    [ [ Plain [ Str \"three\" ] ] , [ Plain [ Str \"four\" ] ] ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"list\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"restart\"\n    , Space\n    , Str \"at\"\n    , Space\n    , Str \"1:\"\n    ]\n, OrderedList\n    ( 1 , DefaultStyle , DefaultDelim )\n    [ [ Plain [ Str \"one\" , Space , Str \"again\" ] ]\n    , [ Plain [ Str \"two\" , Space , Str \"again\" ] ]\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/2549.md",
    "content": "```\n% pandoc -f latex -t native\n\\hypertarget{foo}{%\n\\section{A section}\\label{foo}\n}\n^D\n[ Header\n    1 ( \"foo\" , [] , [] ) [ Str \"A\" , Space , Str \"section\" ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\hypertarget{bar}{%\n\\section{A section}\\label{foo}\n}\n^D\n[ Div\n    ( \"bar\" , [] , [] )\n    [ Header\n        1 ( \"foo\" , [] , [] ) [ Str \"A\" , Space , Str \"section\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nBar \\hypertarget{foo}{Foo}\n^D\n[ Para\n    [ Str \"Bar\"\n    , Space\n    , Span ( \"foo\" , [] , [] ) [ Str \"Foo\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\hypertarget{foo}{%\n\\begin{verbatim}\nbar\n\\end{verbatim}\n}\n^D\n[ Div\n    ( \"foo\" , [] , [] ) [ CodeBlock ( \"\" , [] , [] ) \"bar\" ]\n]\n```\n\n"
  },
  {
    "path": "test/command/2552.md",
    "content": "```\n% pandoc --strip-comments\nFoo\n\nbar\n\n<!-- comment -->\n\nbaz<!-- bim -->boop\n^D\n<p>Foo</p>\n<p>bar</p>\n<p>bazboop</p>\n```\n"
  },
  {
    "path": "test/command/256.md",
    "content": "```\n% pandoc --abbreviations=command/abbrevs -t native\nFoo. bar baz h.k. and e.g. and Mr. Brown.\n^D\n[ Para\n    [ Str \"Foo.\\160bar\"\n    , Space\n    , Str \"baz\"\n    , Space\n    , Str \"h.k.\\160and\"\n    , Space\n    , Str \"e.g.\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"Mr.\"\n    , Space\n    , Str \"Brown.\"\n    ]\n]\n```\n```\n% pandoc -t native\nFoo. bar baz h.k. and e.g. and Mr. Brown.\n^D\n[ Para\n    [ Str \"Foo.\"\n    , Space\n    , Str \"bar\"\n    , Space\n    , Str \"baz\"\n    , Space\n    , Str \"h.k.\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"e.g.\\160and\"\n    , Space\n    , Str \"Mr.\\160Brown.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/2602.md",
    "content": "```\n% pandoc\n[a] [b]\n\n[b]: url\n^D\n<p>[a] <a href=\"url\">b</a></p>\n```\n\n```\n% pandoc -f markdown+spaced_reference_links\n[a] [b]\n\n[b]: url\n^D\n<p><a href=\"url\">a</a></p>\n```\n\n"
  },
  {
    "path": "test/command/2606.md",
    "content": "```\n% pandoc -f mediawiki -t html5\n{|\n| * hello\n|}\n^D\n<table>\n<tbody>\n<tr>\n<td><p>* hello</p></td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f mediawiki -t html5\n{|\n|\n* hello\n|}\n^D\n<table>\n<tbody>\n<tr>\n<td><ul>\n<li>hello</li>\n</ul></td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f mediawiki -t html5\n{|\n|\n * hello\n|}\n^D\n<table>\n<tbody>\n<tr>\n<td><p><code>* hello</code></p></td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f mediawiki -t html5\n* * hi\n^D\n<ul>\n<li>* hi</li>\n</ul>\n```\n\n"
  },
  {
    "path": "test/command/262.md",
    "content": "```\n% pandoc -f rst\n`hello`_ and `goodbye`_\n\n.. _hello:\n.. _goodbye: example.com\n^D\n<p><a href=\"example.com\">hello</a> and <a\nhref=\"example.com\">goodbye</a></p>\n```\n\n```\n% pandoc -f rst\n`hello`_ `goodbye`_\n\n.. _hello:\n.. _goodbye:\n\nparagraph\n^D\n<p><a href=\"#hello\">hello</a> <a href=\"#goodbye\">goodbye</a></p>\n<div id=\"hello\">\n<div id=\"goodbye\">\n<p>paragraph</p>\n</div>\n</div>\n```\n"
  },
  {
    "path": "test/command/2649.md",
    "content": "```\n% pandoc -f mediawiki -t html5\n{| class=\"wikitable\" style=\"line-height: 1.0\"\n\n|- bgcolor=\"#efefef\"\n|}\n^D\n<table>\n<tbody>\n<tr>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f mediawiki -t html5\n{| border=\"4\" cellspacing=\"2\" cellpadding=\"0\" WIDTH=\"100%\"\n|-----\n| peildatum Simbase || november 2005 || colspan=2 | '''uitslagen Flohrgambiet'''\n|-----\n| totaal aantal partijen Simbase || 7.316.773\n| wit wint || 53%\n|-----\n| percentage (en partijen) Flohrgambiet\n| 0.023 % (1.699) || zwart wint || 27%\n|-----\n| percentage Flohrgambiet in aug 2003\n| 0.035 % || remise || 20%\n|}\n^D\n<table>\n<tbody>\n<tr>\n<td><p>peildatum Simbase</p></td>\n<td><p>november 2005</p></td>\n<td colspan=\"2\"><p><strong>uitslagen Flohrgambiet</strong></p></td>\n</tr>\n<tr>\n<td><p>totaal aantal partijen Simbase</p></td>\n<td><p>7.316.773</p></td>\n<td><p>wit wint</p></td>\n<td><p>53%</p></td>\n</tr>\n<tr>\n<td><p>percentage (en partijen) Flohrgambiet</p></td>\n<td><p>0.023 % (1.699)</p></td>\n<td><p>zwart wint</p></td>\n<td><p>27%</p></td>\n</tr>\n<tr>\n<td><p>percentage Flohrgambiet in aug 2003</p></td>\n<td><p>0.035 %</p></td>\n<td><p>remise</p></td>\n<td><p>20%</p></td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f mediawiki -t html5\n{| class=\"wikitable\" style=\"text-align:center; font-size:95%\" valign=\"top\" |\n! Plaats\n! Rijder\n! Aantal\n|-\n| 1\n|align=left| {{FR-VLAG}} [[Sébastien Loeb]]\n| 78\n|-\n| 2\n|align=left| {{FR-VLAG}} '''[[Sébastien Ogier]]'''\n| 38\n|-\n| 10\n|align=left| {{FI-VLAG}} [[Hannu Mikkola]]\n| 18\n|}\n^D\n<table>\n<thead>\n<tr>\n<th><p>Plaats</p></th>\n<th><p>Rijder</p></th>\n<th><p>Aantal</p></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><p>1</p></td>\n<td style=\"text-align: left;\"><p><a href=\"Sébastien_Loeb\"\nclass=\"wikilink\" title=\"Sébastien Loeb\">Sébastien Loeb</a></p></td>\n<td><p>78</p></td>\n</tr>\n<tr>\n<td><p>2</p></td>\n<td style=\"text-align: left;\"><p><strong><a href=\"Sébastien_Ogier\"\nclass=\"wikilink\" title=\"Sébastien Ogier\">Sébastien\nOgier</a></strong></p></td>\n<td><p>38</p></td>\n</tr>\n<tr>\n<td><p>10</p></td>\n<td style=\"text-align: left;\"><p><a href=\"Hannu_Mikkola\"\nclass=\"wikilink\" title=\"Hannu Mikkola\">Hannu Mikkola</a></p></td>\n<td><p>18</p></td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/2662.md",
    "content": "```\n% pandoc -t html -f rst --wrap=none\n.. image:: http://url.to.image/foo.png\n   :align: left\n   :height: 100px\n   :width: 200 px\n   :scale: 300 %\n   :alt: alternate text\n^D\n<p><img src=\"http://url.to.image/foo.png\" class=\"align-left\" width=\"600\" height=\"300\" alt=\"alternate text\" /></p>\n```\n"
  },
  {
    "path": "test/command/2834.md",
    "content": "Nested grid tables.\n```\n% pandoc -f html -t markdown --columns=72\n<table>\n  <tr>\n    <td>\n      <table>\n        <tr>\n          <td>\n            <table>\n              <tr>\n                <td>some text</td>\n              </tr>\n            </table>\n          </td>\n        </tr>\n      </table>\n    </td>\n  </tr>\n</table>\n^D\n+---------------------------------------------------------------------------+\n| +-----------------------------------------------------------------------+ |\n| |   -----------                                                         | |\n| |   some text                                                           | |\n| |   -----------                                                         | |\n| +-----------------------------------------------------------------------+ |\n+---------------------------------------------------------------------------+\n```\n"
  },
  {
    "path": "test/command/2874.md",
    "content": "```\n% pandoc -f html -t latex\n<a></a>\n<br/>\n^D\n{}\\strut \\\\\n```\n\n```\n% pandoc -f html -t latex\n<a name=\"foo\"></a><br/>\n^D\n\\protect\\phantomsection\\label{foo}{}\\strut \\\\\n```\n"
  },
  {
    "path": "test/command/2994.md",
    "content": "```\n% pandoc -f markdown -t docx -o - | pandoc -f docx -t markdown --track-changes=all\nI want [I left a comment.]{.comment-start id=\"0\"\nauthor=\"Jesse Rosenthal\" date=\"2016-05-09T16:13:00Z\"}some text to have a\ncomment []{.comment-end id=\"0\"}on it.\n^D\nI want [I left a comment.]{.comment-start id=\"0\"\nauthor=\"Jesse Rosenthal\" date=\"2016-05-09T16:13:00Z\"}some text to have a\ncomment []{.comment-end id=\"0\"}on it.\n```\n"
  },
  {
    "path": "test/command/3113.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{eqnarray}\nA&=&B,\\\\\nC&=&D,\\\\\n%\\end{eqnarray}\n%\\begin{eqnarray}\nE&=&F\n\\end{eqnarray}\n^D\n[ Para\n    [ Math\n        DisplayMath\n        \"\\\\begin{eqnarray}\\nA&=&B,\\\\\\\\\\nC&=&D,\\\\\\\\\\n%\\\\end{eqnarray}\\n%\\\\begin{eqnarray}\\nE&=&F\\n\\\\end{eqnarray}\"\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/3123.md",
    "content": "```\n% pandoc -f markdown -t native\n<?php echo \"1\" ; ?>\n^D\n[ RawBlock (Format \"html\") \"<?php echo \\\"1\\\" ; ?>\" ]\n```\n\n```\n% pandoc -f markdown -t native\na<?php echo \"1\" ; ?>\n^D\n[ Para\n    [ Str \"a\"\n    , RawInline (Format \"html\") \"<?php echo \\\"1\\\" ; ?>\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3236.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\mycolor}{red}\n\n\\includegraphics[width=17cm]{\\mycolor /header}\nMagnificent \\mycolor{} header.\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [ ( \"width\" , \"17cm\" ) ] )\n        [ Str \"image\" ]\n        ( \"red/header\" , \"\" )\n    , SoftBreak\n    , Str \"Magnificent\"\n    , Space\n    , Str \"red\"\n    , Space\n    , Str \"header.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3257.md",
    "content": "```\n% pandoc -t native\n(i<j)\n^D\n[ Para [ Str \"(i<j)\" ] ]\n```\n\n```\n% pandoc -t native\ni<j-1, j>k\n^D\n[ Para [ Str \"i<j-1,\" , Space , Str \"j>k\" ] ]\n```\n"
  },
  {
    "path": "test/command/3309.md",
    "content": "Certain environments should be treated as inline unless they\nare surrounded by blank lines:\n\n```\n% pandoc -t latex --wrap=preserve\nLorem ipsum dolor sit amet,\n\n\\begin{equation}\nE = mc^2,\n\\end{equation}\n\nconsectetur adipiscing elit.\n^D\nLorem ipsum dolor sit amet,\n\n\\begin{equation}\nE = mc^2,\n\\end{equation}\n\nconsectetur adipiscing elit.\n```\n\n```\n% pandoc -t latex --wrap=preserve\nLorem ipsum dolor sit amet,\n\\begin{equation}\nE = mc^2,\n\\end{equation}\nconsectetur adipiscing elit.\n^D\nLorem ipsum dolor sit amet,\n\\begin{equation}\nE = mc^2,\n\\end{equation}\nconsectetur adipiscing elit.\n```\n\n```\n% pandoc -t latex --wrap=preserve\nThe formula\n\\begin{math}\nx = y\n\\end{math}\nshould be inline.\n^D\nThe formula\n\\begin{math}\nx = y\n\\end{math}\nshould be inline.\n```\n\n"
  },
  {
    "path": "test/command/3314.md",
    "content": "See #3315 and <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables>.\n\n```\n% pandoc -f org -t html5\n+-----------+-------+----------+\n| First     | 12.0  | Example  |\n|           |       | row      |\n|           |       | spanning |\n|           |       | lines    |\n+-----------+-------+----------+\n| Second    | 5.0   | Another  |\n+-----------+-------+----------+\n^D\n<table style=\"width:43%;\">\n<colgroup>\n<col style=\"width: 16%\" />\n<col style=\"width: 11%\" />\n<col style=\"width: 15%\" />\n</colgroup>\n<tbody>\n<tr>\n<td>First</td>\n<td>12.0</td>\n<td>Example row spanning lines</td>\n</tr>\n<tr>\n<td>Second</td>\n<td>5.0</td>\n<td>Another</td>\n</tr>\n</tbody>\n</table>\n```\n\n"
  },
  {
    "path": "test/command/3324.md",
    "content": "```\n% pandoc -t latex\nSignatures\n\n\\\n\\\n___________________________\\\nPeter Foobar\\\n*The Foo Company*\n^D\nSignatures\n\n\\hfill\\break\n\\hfill\\break\n\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\\\\nPeter Foobar\\\\\n\\emph{The Foo Company}\n```\n"
  },
  {
    "path": "test/command/3337.md",
    "content": "```\n% pandoc -f html -t markdown\n<table>\n<tr><td>a</td></tr>\n<tr><td>1</td><td>2</td></tr>\n</table>\n^D\n  --- ---\n  a   \n  1   2\n  --- ---\n```\n\n"
  },
  {
    "path": "test/command/3348.md",
    "content": "```\n% pandoc -t native --columns=72\n  ----- ------------------------------------------------\n    foo bar\n\n    foo this is a long\n        line of text\n  ----- ------------------------------------------------\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidth 8.333333333333333e-2 )\n    , ( AlignLeft , ColWidth 0.6805555555555556 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"foo\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"bar\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"foo\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"this\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"long\"\n                    , SoftBreak\n                    , Str \"line\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"text\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/3401.md",
    "content": "See #3401 and <http://orgmode.org/manual/Macro-replacement.html>\n\n```\n% pandoc -f org -t native\n#+MACRO: HELLO /Hello, $1/\n{{{HELLO(World)}}}\n^D\n[ Para [ Emph [ Str \"Hello,\" , Space , Str \"World\" ] ] ]\n```\n\nInverted argument order\n\n```\n% pandoc -f org -t native\n#+MACRO: A $2,$1\n{{{A(1,2)}}}\n^D\n[ Para [ Str \"2,1\" ] ]\n```\n"
  },
  {
    "path": "test/command/3407.md",
    "content": "```\n% pandoc -f native -t rst\n[Para [Code (\"\",[\"interpreted-text\"],[(\"role\",\"foo\")]) \"text\"]]\n^D\n:foo:`text`\n```\n\n```\n% pandoc -f rst -t native\n:foo:`text`\n^D\n[ Para\n    [ Code\n        ( \"\" , [ \"interpreted-text\" ] , [ ( \"role\" , \"foo\" ) ] )\n        \"text\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3422.md",
    "content": "See #3422\n\n```\n% pandoc -t latex --syntax-highlighting=idiomatic\n`int main(int argc, const char *argv[]);`{.c}\n^D\n\\passthrough{\\lstinline[language=C]!int main(int argc, const char *argv[]);!}\n```\n\n"
  },
  {
    "path": "test/command/3432.md",
    "content": "List-table with header-rows and widths options. \n\n```\n% pandoc -f rst\n.. list-table:: Frozen Delights!\n   :widths: 15 10 30\n   :header-rows: 1\n\n   * - Treat\n     - Quantity\n     - Description\n   * - Albatross\n     - 2.99\n     - On a stick!\n   * - Crunchy Frog\n     - 1.49\n     - If we took the bones out, it wouldn't be\n       crunchy, now would it?\n   * - Gannet Ripple\n     - 1.99\n     - On a stick!\n^D\n<table>\n<caption>Frozen Delights!</caption>\n<colgroup>\n<col style=\"width: 27%\" />\n<col style=\"width: 18%\" />\n<col style=\"width: 54%\" />\n</colgroup>\n<thead>\n<tr>\n<th>Treat</th>\n<th>Quantity</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Albatross</td>\n<td>2.99</td>\n<td>On a stick!</td>\n</tr>\n<tr>\n<td>Crunchy Frog</td>\n<td>1.49</td>\n<td>If we took the bones out, it wouldn't be crunchy, now would it?</td>\n</tr>\n<tr>\n<td>Gannet Ripple</td>\n<td>1.99</td>\n<td>On a stick!</td>\n</tr>\n</tbody>\n</table>\n```\n\nList-table whose widths is \"auto\". \n\n```\n% pandoc -f rst\n.. list-table:: Frozen Delights!\n   :header-rows: 1\n   :widths: auto\n\n   * - Treat\n     - Quantity\n     - Description\n   * - Albatross\n     - 2.99\n     - On a stick!\n   * - Crunchy Frog\n     - 1.49\n     - If we took the bones out, it wouldn't be\n       crunchy, now would it?\n   * - Gannet Ripple\n     - 1.99\n     - On a stick!\n^D\n<table>\n<caption>Frozen Delights!</caption>\n<thead>\n<tr>\n<th>Treat</th>\n<th>Quantity</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Albatross</td>\n<td>2.99</td>\n<td>On a stick!</td>\n</tr>\n<tr>\n<td>Crunchy Frog</td>\n<td>1.49</td>\n<td>If we took the bones out, it wouldn't be crunchy, now would it?</td>\n</tr>\n<tr>\n<td>Gannet Ripple</td>\n<td>1.99</td>\n<td>On a stick!</td>\n</tr>\n</tbody>\n</table>\n```\n\n\nList-table with header-rows which is bigger than 1. Only the first row is treated as a header. \n\n```\n% pandoc -f rst\n.. list-table:: Frozen Delights!\n   :header-rows: 2\n\n   * - Treat\n     - Quantity\n     - Description\n   * - Albatross\n     - 2.99\n     - On a stick!\n   * - Crunchy Frog\n     - 1.49\n     - If we took the bones out, it wouldn't be\n       crunchy, now would it?\n   * - Gannet Ripple\n     - 1.99\n     - On a stick!\n^D\n<table>\n<caption>Frozen Delights!</caption>\n<thead>\n<tr>\n<th>Treat</th>\n<th>Quantity</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Albatross</td>\n<td>2.99</td>\n<td>On a stick!</td>\n</tr>\n<tr>\n<td>Crunchy Frog</td>\n<td>1.49</td>\n<td>If we took the bones out, it wouldn't be crunchy, now would it?</td>\n</tr>\n<tr>\n<td>Gannet Ripple</td>\n<td>1.99</td>\n<td>On a stick!</td>\n</tr>\n</tbody>\n</table>\n```\n\nList-table without header-rows.\n\n```\n% pandoc -f rst\n.. list-table:: Frozen Delights!\n\n   * - Albatross\n     - 2.99\n     - On a stick!\n   * - Crunchy Frog\n     - 1.49\n     - If we took the bones out, it wouldn't be\n       crunchy, now would it?\n   * - Gannet Ripple\n     - 1.99\n     - On a stick!\n^D\n<table>\n<caption>Frozen Delights!</caption>\n<tbody>\n<tr>\n<td>Albatross</td>\n<td>2.99</td>\n<td>On a stick!</td>\n</tr>\n<tr>\n<td>Crunchy Frog</td>\n<td>1.49</td>\n<td>If we took the bones out, it wouldn't be crunchy, now would it?</td>\n</tr>\n<tr>\n<td>Gannet Ripple</td>\n<td>1.99</td>\n<td>On a stick!</td>\n</tr>\n</tbody>\n</table>\n```\n\nList-table with empty cells. You need a space after '-', otherwise the row will disappear. Parser for Bulletlists causes this restriction. \n\n```\n% pandoc -f rst\n.. list-table:: Frozen Delights!\n   :header-rows: 2\n\n   * - Treat\n     - Quantity\n     - Description\n   * - Albatross\n     - 2.99\n     - \n   * - Crunchy Frog\n     - \n     - If we took the bones out, it wouldn't be\n       crunchy, now would it?\n   * - Gannet Ripple\n     - 1.99\n     - On a stick!\n^D\n<table>\n<caption>Frozen Delights!</caption>\n<thead>\n<tr>\n<th>Treat</th>\n<th>Quantity</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Albatross</td>\n<td>2.99</td>\n<td></td>\n</tr>\n<tr>\n<td>Crunchy Frog</td>\n<td></td>\n<td>If we took the bones out, it wouldn't be crunchy, now would it?</td>\n</tr>\n<tr>\n<td>Gannet Ripple</td>\n<td>1.99</td>\n<td>On a stick!</td>\n</tr>\n</tbody>\n</table>\n```\n\nList-table with a cell having a bulletlist\n\n```\n% pandoc -f rst\n.. list-table:: Frozen Delights!\n\n   * - Albatross\n     - 2.99\n     - + On a stick!\n       + In a cup!\n   * - Crunchy Frog\n     - 1.49\n     - If we took the bones out, it wouldn't be\n       crunchy, now would it?\n   * - Gannet Ripple\n     - 1.99\n     - On a stick!\n^D\n<table>\n<caption>Frozen Delights!</caption>\n<tbody>\n<tr>\n<td>Albatross</td>\n<td>2.99</td>\n<td><ul>\n<li>On a stick!</li>\n<li>In a cup!</li>\n</ul></td>\n</tr>\n<tr>\n<td>Crunchy Frog</td>\n<td>1.49</td>\n<td>If we took the bones out, it wouldn't be crunchy, now would it?</td>\n</tr>\n<tr>\n<td>Gannet Ripple</td>\n<td>1.99</td>\n<td>On a stick!</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/3432a.md",
    "content": "```\n% pandoc -f rst\n* - a\n  - b\n* - c\n  - d\n^D\n<ul>\n<li><ul>\n<li>a</li>\n<li>b</li>\n</ul></li>\n<li><ul>\n<li>c</li>\n<li>d</li>\n</ul></li>\n</ul>\n```\n\n"
  },
  {
    "path": "test/command/3450.md",
    "content": "```\n% pandoc -fmarkdown-implicit_figures\n![image](lalune.jpg){height=2em}\n^D\n<p><img src=\"lalune.jpg\" style=\"height:2em\" alt=\"image\" /></p>\n```\n```\n% pandoc -fmarkdown-implicit_figures -t latex\n![image](lalune.jpg){height=2em}\n^D\n\\includegraphics[width=\\linewidth,height=2em,keepaspectratio,alt={image}]{lalune.jpg}\n```\n"
  },
  {
    "path": "test/command/3475.md",
    "content": "RST implicit internal links to headers:\n\n```\n% pandoc -f rst\nYears\n-----\n\nYears_\n^D\n<h1 id=\"years\">Years</h1>\n<p><a href=\"#years\">Years</a></p>\n```\n\n```\n% pandoc -f rst\nYears_\n\nYears\n-----\n^D\n<p><a href=\"#years\">Years</a></p>\n<h1 id=\"years\">Years</h1>\n```\n\n```\n% pandoc -f rst\nYears and years\n---------------\n\n`Years and years`_\n^D\n<h1 id=\"years-and-years\">Years and years</h1>\n<p><a href=\"#years-and-years\">Years and years</a></p>\n```\n\n```\n% pandoc -f rst\nYears and *years*\n-----------------\n\n`Years and years`_\n^D\n<h1 id=\"years-and-years\">Years and <em>years</em></h1>\n<p><a href=\"#years-and-years\">Years and years</a></p>\n```\n"
  },
  {
    "path": "test/command/3487.md",
    "content": "```\n% pandoc -f html -t markdown\nSome text\n<ul>\n<li>element</li>\n</ul>\n^D\nSome text\n\n- element\n```\n"
  },
  {
    "path": "test/command/3494.md",
    "content": "```\n% pandoc -f latex --quiet\n\\begin{table}[h!]\n\\begin{tabular}{r|l|l}\n\n  {\\large \\textbf{ﺍ}} && \\\\\n  \\textbf{ﺄﺤﺴﻨﺘـ(ﻭﺍ) IV} & \\em{ʾaḥsant(ū)} & thank you \\\\\n  \\newpage\n  \\emph{blah} & \\emph{blah} & \\emph{blah} \\\\\n  blah & blah & blah \\\\\n\n\\end{tabular}\n\\end{table}\n^D\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: right;\"><span><strong>ﺍ</strong></span></td>\n<td style=\"text-align: left;\"></td>\n<td style=\"text-align: left;\"></td>\n</tr>\n<tr>\n<td style=\"text-align: right;\"><strong>ﺄﺤﺴﻨﺘـ(ﻭﺍ) IV</strong></td>\n<td style=\"text-align: left;\"><em><span>ʾaḥsant(ū)</span></em></td>\n<td style=\"text-align: left;\">thank you</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\"><em>blah</em></td>\n<td style=\"text-align: left;\"><em>blah</em></td>\n<td style=\"text-align: left;\"><em>blah</em></td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">blah</td>\n<td style=\"text-align: left;\">blah</td>\n<td style=\"text-align: left;\">blah</td>\n</tr>\n</tbody>\n</table>\n```\n\n"
  },
  {
    "path": "test/command/3497.md",
    "content": "Escape list markers at beginning of paragraph:\n\n```\n% pandoc -t markdown\n\\* ok\n\n\\+ ok\n\n\\- ok\n\n1\\. ok\n\na\\. ok\n^D\n\\* ok\n\n\\+ ok\n\n\\- ok\n\n1\\. ok\n\na\\. ok\n```\n\nHere we don't need to escape because there's no space:\n\n```\n% pandoc -t markdown\n\\+ok\n\n\\-ok\n\n1.ok\n^D\n+ok\n\n-ok\n\n1.ok\n```\n\nAlso escape things that might become line blocks or tables:\n\n```\n% pandoc -t markdown\n\\| hi \\|\n^D\n\\| hi \\|\n```\n\n"
  },
  {
    "path": "test/command/3499.md",
    "content": "Org-mode tables can't be on the same line as list markers:\n```\n% pandoc -f org\n- |something|\n- \n  |else|\n^D\n<ul>\n<li>|something|</li>\n<li><table>\n<tbody>\n<tr>\n<td>else</td>\n</tr>\n</tbody>\n</table></li>\n</ul>\n```\n"
  },
  {
    "path": "test/command/3510-export.latex",
    "content": "\\emph{Hello}"
  },
  {
    "path": "test/command/3510-src.hs",
    "content": "putStrLn outString\n"
  },
  {
    "path": "test/command/3510-subdoc.org",
    "content": "* Subsection\n\nIncluded text\n\nLorem ipsum.\n"
  },
  {
    "path": "test/command/3510.md",
    "content": "See <http://orgmode.org/manual/Include-files.html>\n```\n% pandoc -f org -t native\nText\n\n#+include: \"command/3510-subdoc.org\"\n\n#+INCLUDE: \"command/3510-src.hs\" src haskell\n#+INCLUDE: \"command/3510-export.latex\" export latex\n\nMore text\n^D\n[ Para [ Str \"Text\" ]\n, Header 1 ( \"subsection\" , [] , [] ) [ Str \"Subsection\" ]\n, Para [ Str \"Included\" , Space , Str \"text\" ]\n, Plain [ Str \"Lorem\" , Space , Str \"ipsum.\" ]\n, CodeBlock\n    ( \"\" , [ \"haskell\" ] , [] ) \"putStrLn outString\\n\"\n, RawBlock (Format \"latex\") \"\\\\emph{Hello}\"\n, Para [ Str \"More\" , Space , Str \"text\" ]\n]\n```\n"
  },
  {
    "path": "test/command/3511.md",
    "content": "```\n% pandoc -t native\n- a\n  - b\n    - c\n\n-     code\n\n1000. one\n\n    not continuation\n^D\n[ BulletList\n    [ [ Plain [ Str \"a\" ]\n      , BulletList\n          [ [ Plain [ Str \"b\" ]\n            , BulletList [ [ Plain [ Str \"c\" ] ] ]\n            ]\n          ]\n      ]\n    , [ CodeBlock ( \"\" , [] , [] ) \"code\" ]\n    ]\n, OrderedList\n    ( 1000 , Decimal , Period ) [ [ Plain [ Str \"one\" ] ] ]\n, CodeBlock ( \"\" , [] , [] ) \"not continuation\"\n]\n```\n\n```\n% pandoc -t native -f markdown+four_space_rule\n- a\n  - b\n    - c\n\n-     not code\n\n1000. one\n\n    continuation\n^D\n[ BulletList\n    [ [ Plain [ Str \"a\" ] ]\n    , [ Plain [ Str \"b\" ]\n      , BulletList [ [ Plain [ Str \"c\" ] ] ]\n      ]\n    , [ CodeBlock ( \"\" , [] , [] ) \"not code\" ]\n    ]\n, OrderedList\n    ( 1000 , Decimal , Period )\n    [ [ Para [ Str \"one\" ] , Para [ Str \"continuation\" ] ] ]\n]\n```\n"
  },
  {
    "path": "test/command/3512.md",
    "content": "```\n% pandoc -f markdown-auto_identifiers\n#hi\n^D\n<p>#hi</p>\n```\n\n```\n% pandoc -f markdown-auto_identifiers-space_in_atx_header\n#hi\n^D\n<h1>hi</h1>\n```\n"
  },
  {
    "path": "test/command/3516.md",
    "content": "Correctly handle empty row:\n```\n% pandoc -f markdown -t rst\n+---+---+\n| 1 | 2 |\n+---+---+\n|   |   |\n+---+---+\n^D\n+---+---+\n| 1 | 2 |\n+---+---+\n|   |   |\n+---+---+\n```\n\nTemporarily added these to figure out what is happening\non Windows builds.\n```\n% pandoc -f markdown -t native\n+---+---+\n| 1 | 2 |\n+---+---+\n|   |   |\n+---+---+\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 5.555555555555555e-2 )\n    , ( AlignDefault , ColWidth 5.555555555555555e-2 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f native -t rst\n[Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 5.555555555555555e-2)\n ,(AlignDefault,ColWidth 5.555555555555555e-2)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   []\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   []]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"2\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n+---+---+\n|   |   |\n+===+===+\n| 1 | 2 |\n+---+---+\n|   |   |\n+---+---+\n```\n"
  },
  {
    "path": "test/command/3518.md",
    "content": "```\n% pandoc -f latex -t plain\n$\\alpha^2 \\cdot \\alpha^{2+3} \\equiv \\alpha^7$\n^D\nα² ⋅ α² ⁺ ³ ≡ α⁷\n```\n"
  },
  {
    "path": "test/command/3523.md",
    "content": "```\n% pandoc -f latex -t html \n\\documentclass{article}\n\\usepackage{epigraph}\n\\begin{document}\n\n\\epigraph{\n    Das Recht hat kein Dasein f{\\\"u}r sich, sein Wesen vielmehr ist das Leben des Menschen selbst, von einer besonderen Seite angesehen. \n    \n    Das Recht hat kein Dasein f{\\\"u}r sich, sein Wesen vielmehr ist das Leben des Menschen selbst, von einer besonderen Seite angesehen.\n    \n    \\begin{itemize}\n        \\item hey\n        \\item hey\n        \\item hey\n    \\end{itemize}\n    \n    }{ Friedrich Carl von Savigny }\n\\end{document}\n^D\n<div class=\"epigraph\">\n<p>Das Recht hat kein Dasein f<span>ü</span>r sich, sein Wesen vielmehr\nist das Leben des Menschen selbst, von einer besonderen Seite\nangesehen.</p>\n<p>Das Recht hat kein Dasein f<span>ü</span>r sich, sein Wesen vielmehr\nist das Leben des Menschen selbst, von einer besonderen Seite\nangesehen.</p>\n<ul>\n<li><p>hey</p></li>\n<li><p>hey</p></li>\n<li><p>hey</p></li>\n</ul>\n<p>Friedrich Carl von Savigny</p>\n</div>\n```\n"
  },
  {
    "path": "test/command/3526.md",
    "content": "```\n% pandoc -t rst\n+--+---+\n|  |   |\n+--+---+\n|  |   |\n+--+---+\n^D\n+---+---+\n|   |   |\n+---+---+\n|   |   |\n+---+---+\n```\n"
  },
  {
    "path": "test/command/3529.md",
    "content": "```\n% pandoc -t markdown-simple_tables-pipe_tables-grid_tables+multiline_tables\nA  B\n-- --\n7  8\n9  10\n^D\n  --------\n  A   B\n  --- ----\n  7   8\n\n  9   10\n  --------\n```\n"
  },
  {
    "path": "test/command/3530.md",
    "content": "```\n% pandoc -f latex -t native\n\\subfile{command/sub-file-chapter-1}\n\\subfile{command/sub-file-chapter-2}\n^D\n[ Header\n    1\n    ( \"chapter-1\" , [] , [] )\n    [ Str \"Chapter\" , Space , Str \"1\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"Chapter\"\n    , Space\n    , Str \"1,\"\n    , Space\n    , Str \"provided\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"sub\"\n    , Space\n    , Str \"file.\"\n    ]\n, Header\n    1\n    ( \"chapter-2\" , [] , [] )\n    [ Str \"Chapter\" , Space , Str \"2\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"Chapter\"\n    , Space\n    , Str \"2,\"\n    , Space\n    , Str \"provided\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"second\"\n    , Space\n    , Str \"sub\"\n    , Space\n    , Str \"file.\"\n    ]\n]\n```\n\n```\n% pandoc -flatex+raw_tex -t native\n\\subfile{command/sub-file-chapter-1}\n\\subfile{command/sub-file-chapter-2}\n^D\n[ RawBlock\n    (Format \"latex\") \"\\\\subfile{command/sub-file-chapter-1}\"\n, RawBlock\n    (Format \"latex\") \"\\\\subfile{command/sub-file-chapter-2}\"\n]\n```\n"
  },
  {
    "path": "test/command/3531.md",
    "content": "```\n% pandoc -t mediawiki --wrap=preserve\n* This is a list item.\n* This is a list item in Markdown. It is\n  continued in the next line.\n    * It has a sub-item.\n* This is the next list item.\n\nA paragraph can span multiple lines\nwithout being broken into pieces.\n^D\n* This is a list item.\n* This is a list item in Markdown. It is continued in the next line.\n** It has a sub-item.\n* This is the next list item.\n\nA paragraph can span multiple lines\nwithout being broken into pieces.\n\n```\n"
  },
  {
    "path": "test/command/3533-rst-csv-tables.csv",
    "content": "\"Albatross\", 2.99, \"On a stick!\"\n\"Crunchy Frog\", 1.49, \"If we took the bones out, it wouldn't be\ncrunchy, now would it?\"\n\n"
  },
  {
    "path": "test/command/3533-rst-csv-tables.md",
    "content": "```\n% pandoc -f rst -t native\n.. csv-table:: Test\n   :widths: 10, 5, 10\n   :header: Flavor,Price,Slogan\n   :file: command/3533-rst-csv-tables.csv\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Test\" ] ])\n    [ ( AlignDefault , ColWidth 0.4 )\n    , ( AlignDefault , ColWidth 0.2 )\n    , ( AlignDefault , ColWidth 0.4 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Flavor\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Price\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Slogan\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Albatross\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2.99\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"On\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"stick!\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Crunchy\" , Space , Str \"Frog\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1.49\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"If\"\n                    , Space\n                    , Str \"we\"\n                    , Space\n                    , Str \"took\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"bones\"\n                    , Space\n                    , Str \"out,\"\n                    , Space\n                    , Str \"it\"\n                    , Space\n                    , Str \"wouldn't\"\n                    , Space\n                    , Str \"be\"\n                    , SoftBreak\n                    , Str \"crunchy,\"\n                    , Space\n                    , Str \"now\"\n                    , Space\n                    , Str \"would\"\n                    , Space\n                    , Str \"it?\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f rst -t native\n.. csv-table:: Test\n   :header-rows: 1\n   :quote: '\n   :delim: space\n\n   '' 'a' 'b'\n   'cat''s' 3 4\n   'dog''s' 2 3\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Test\" ] ])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"a\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"b\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"cat's\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"dog's\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f rst -t native\n.. csv-table:: Test\n   :escape: \\\n\n   \"1\",\"\\\"\"\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Test\" ] ])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"\\\"\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n"
  },
  {
    "path": "test/command/3534.md",
    "content": "```\n% pandoc -f latex -t html\nI want to explain the interface of \\lstinline[language=Java]{public class MyClass}.\n^D\n<p>I want to explain the interface of <code\nclass=\"sourceCode java\"><span class=\"kw\">public</span> <span class=\"kw\">class</span> MyClass</code>.</p>\n\n```\n\n```\n% pandoc -f latex -t html\nI want to explain the interface of \\lstinline{public class MyClass}.\n^D\n<p>I want to explain the interface of\n<code>public class MyClass</code>.</p>\n\n```\n\n```\n% pandoc -f latex -t native\nI want to explain the interface of \\lstinline[language=Java]{public class MyClass}.\n^D\n[ Para\n    [ Str \"I\"\n    , Space\n    , Str \"want\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"explain\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"interface\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Code ( \"\" , [ \"java\" ] , [] ) \"public class MyClass\"\n    , Str \".\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t html\nI want to explain the interface of \\mintinline{java}{public class MyClass}.\n^D\n<p>I want to explain the interface of <code\nclass=\"sourceCode java\"><span class=\"kw\">public</span> <span class=\"kw\">class</span> MyClass</code>.</p>\n\n```\n\n```\n% pandoc -f latex -t html\nI want to explain the interface of \\mintinline{java}|public class MyClass|.\n^D\n<p>I want to explain the interface of <code\nclass=\"sourceCode java\"><span class=\"kw\">public</span> <span class=\"kw\">class</span> MyClass</code>.</p>\n\n```\n\n```\n% pandoc -f latex -t native\nI want to explain the interface of \\mintinline[linenos]{java}{public class MyClass}.\n^D\n[ Para\n    [ Str \"I\"\n    , Space\n    , Str \"want\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"explain\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"interface\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Code ( \"\" , [ \"java\" ] , [] ) \"public class MyClass\"\n    , Str \".\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3537.md",
    "content": "Generalized raw attributes.\n\n````\n% pandoc -t native\n```{=ms}\n.MACRO\nfoo bar\n```\n^D\n[ RawBlock (Format \"ms\") \".MACRO\\nfoo bar\" ]\n````\n\n````\n% pandoc -t native\nHi `there`{=ms}.\n^D\n[ Para\n    [ Str \"Hi\"\n    , Space\n    , RawInline (Format \"ms\") \"there\"\n    , Str \".\"\n    ]\n]\n````\n\n````\n% pandoc -t native\n~~~ {=ms}\n.MACRO\nfoo bar\n~~~\n^D\n[ RawBlock (Format \"ms\") \".MACRO\\nfoo bar\" ]\n````\n"
  },
  {
    "path": "test/command/3539.md",
    "content": "# Commands of [glossaries package](ftp://ftp.tu-chemnitz.de/pub/tex/macros/latex/contrib/glossaries/glossaries-code.pdf)\n\n```\n% pandoc -f latex -t native\nMany programming languages provide \\glspl{API}. Each \\gls{API} should provide a documentation.\n^D\n[ Para\n    [ Str \"Many\"\n    , Space\n    , Str \"programming\"\n    , Space\n    , Str \"languages\"\n    , Space\n    , Str \"provide\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"plural+short\" )\n          ]\n        )\n        [ Str \"APIs\" ]\n    , Str \".\"\n    , Space\n    , Str \"Each\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+short\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"provide\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"documentation.\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\Glsdesc{API} XYZ ist not as performant as \\glsdesc{API} ZXY.\n^D\n[ Para\n    [ Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+long\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"XYZ\"\n    , Space\n    , Str \"ist\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Str \"performant\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+long\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"ZXY.\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\Acrlong{API} XYZ ist not as performant as \\acrlong{API} ZXY.\n^D\n[ Para\n    [ Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+long\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"XYZ\"\n    , Space\n    , Str \"ist\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Str \"performant\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+long\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"ZXY.\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\Acrfull{API} XYZ ist not as performant as \\acrfull{API} ZXY.\n^D\n[ Para\n    [ Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+full\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"XYZ\"\n    , Space\n    , Str \"ist\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Str \"performant\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+full\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"ZXY.\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\Acrshort{API} XYZ ist not as performant as \\acrshort{API} ZXY.\n^D\n[ Para\n    [ Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+abbrv\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"XYZ\"\n    , Space\n    , Str \"ist\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Str \"performant\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+abbrv\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"ZXY.\"\n    ]\n]\n```\n\n# Commands of [acronym package](ftp://ftp.mpi-sb.mpg.de/pub/tex/mirror/ftp.dante.de/pub/tex/macros/latex/contrib/acronym/acronym.pdf)\n\n```\n% pandoc -f latex -t native\nMany programming languages provide \\acp{API}. Each \\ac{API} should provide a documentation.\n^D\n[ Para\n    [ Str \"Many\"\n    , Space\n    , Str \"programming\"\n    , Space\n    , Str \"languages\"\n    , Space\n    , Str \"provide\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"plural+short\" )\n          ]\n        )\n        [ Str \"APIs\" ]\n    , Str \".\"\n    , Space\n    , Str \"Each\"\n    , Space\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"acronym-label\" , \"API\" )\n          , ( \"acronym-form\" , \"singular+short\" )\n          ]\n        )\n        [ Str \"API\" ]\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"provide\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"documentation.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3558.md",
    "content": "```\n% pandoc -t native\n\\multi\n\nhello\n\n\\endmulti\n^D\n[ RawBlock (Format \"tex\") \"\\\\multi\"\n, Para [ Str \"hello\" ]\n, RawBlock (Format \"tex\") \"\\\\endmulti\"\n]\n```\n"
  },
  {
    "path": "test/command/3568.md",
    "content": "```\n% pandoc -t man\nnormal *italic **bold in the middle** only italic* normal.\n\nnormal **bold `code` more bold** normal.\n\nnormal `code` normal.\n^D\n.PP\nnormal \\f[I]italic \\f[BI]bold in the middle\\f[I] only italic\\f[R]\nnormal.\n.PP\nnormal \\f[B]bold \\f[CB]code\\f[B] more bold\\f[R] normal.\n.PP\nnormal \\f[CR]code\\f[R] normal.\n```\n"
  },
  {
    "path": "test/command/3570.md",
    "content": "```\n% pandoc -f markdown+autolink_bare_uris\n**Notes:**\n^D\n<p><strong>Notes:</strong></p>\n```\n"
  },
  {
    "path": "test/command/3577.md",
    "content": "```\n% pandoc -f latex -t html5 --quiet\n\\begin{figure}[ht]\n    \\begin{subfigure}{0.45\\textwidth}\n        \\centering\n        \\includegraphics{img1.jpg}\n        \\caption{Caption 1}\n    \\end{subfigure}\n\n    \\begin{subfigure}{0.45\\textwidth}\n        \\centering\n        \\includegraphics{img2.jpg}\n        \\caption{Caption 2}\n    \\end{subfigure}\n    \\caption{Subfigure with Subfloat}\n\\end{figure}\n^D\n<figure data-latex-placement=\"ht\">\n<figure>\n<img src=\"img1.jpg\" />\n<figcaption>Caption 1</figcaption>\n</figure>\n<figure>\n<img src=\"img2.jpg\" />\n<figcaption>Caption 2</figcaption>\n</figure>\n<figcaption>Subfigure with Subfloat</figcaption>\n</figure>\n```\n```\n% pandoc -f latex -t html5\n\\begin{figure}[ht]\n    \\includegraphics{img1.jpg}\n    \\caption{Caption 3}\n\\end{figure}\n^D\n<figure data-latex-placement=\"ht\">\n<img src=\"img1.jpg\" />\n<figcaption>Caption 3</figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/3585.md",
    "content": "```\n% pandoc -f mediawiki+smart -t native\n\"Hello\"\n\nSame but bzip2 it and nice it <tt>zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org \"> /storage/c-3po/tank-storage-data-svn.dmp.bz2\"</tt>\n^D\n[ Para [ Quoted DoubleQuote [ Str \"Hello\" ] ]\n, Para\n    [ Str \"Same\"\n    , Space\n    , Str \"but\"\n    , Space\n    , Str \"bzip2\"\n    , Space\n    , Str \"it\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"nice\"\n    , Space\n    , Str \"it\"\n    , Space\n    , Code\n        ( \"\" , [] , [] )\n        \"zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org \\\"> /storage/c-3po/tank-storage-data-svn.dmp.bz2\\\"\"\n    ]\n]\n```\n\n```\n% pandoc -f mediawiki -t native\n\"Hello\"\n^D\n[ Para [ Str \"\\\"Hello\\\"\" ] ]\n```\n"
  },
  {
    "path": "test/command/3587.md",
    "content": "```\n% pandoc -f latex -t native\n\\SI[round-precision=2]{1}{m} is equal to \\SI{1000}{mm}\n^D\n[ Para\n    [ Str \"1\\160m\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"equal\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"1000\\160mm\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\SI[round-precision=2]{1}[\\$]{} is equal to \\SI{0.938094}{\\euro}\n^D\n[ Para\n    [ Str \"$\\160\\&1\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"equal\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"0.938094\\160\\8364\"\n    ]\n]\n```\n\n\n```\n% pandoc -f latex -t native\n\\SI{30}{\\milli\\meter}\n^D\n[ Para [ Str \"30\\160mm\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\SI{6}{\\gram}\n^D\n[ Para [ Str \"6\\160g\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\SI{25}{\\square\\meter}\n^D\n[ Para [ Str \"25\\160m\" , Superscript [ Str \"2\" ] ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\SI{18.2}{\\degreeCelsius}\n^D\n[ Para [ Str \"18.2\\160\\176C\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\SI{18.2}{\\celsius}\n^D\n[ Para [ Str \"18.2\\160\\176C\" ] ]\n```\n\n# SIrange tests\n\n## Integer range with simple common units\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\gram}\n^D\n[ Para [ Str \"10\\160g\\8211\\&20\\160g\" ] ]\n```\n```\n% pandoc -f latex -t native\n\\SIrange{35}{9}{\\milli\\meter}\n^D\n[ Para [ Str \"35\\160mm\\8211\\&9\\160mm\" ] ]\n```\n```\n% pandoc -f latex -t native\n\\SIrange{4}{97367265}{\\celsius}\n^D\n[ Para [ Str \"4\\160\\176C\\8211\\&97367265\\160\\176C\" ] ]\n```\n\n## Decimal range with simple units\n\n```\n% pandoc -f latex -t native\n\\SIrange{4.5}{97367265.5}{\\celsius}\n^D\n[ Para [ Str \"4.5\\160\\176C\\8211\\&97367265.5\\160\\176C\" ] ]\n```\n\n## Squared, cubed etc. units\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\square\\meter}\n^D\n[ Para\n    [ Str \"10\\160m\"\n    , Superscript [ Str \"2\" ]\n    , Str \"\\8211\\&20\\160m\"\n    , Superscript [ Str \"2\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\cubic\\meter}\n^D\n[ Para\n    [ Str \"10\\160m\"\n    , Superscript [ Str \"3\" ]\n    , Str \"\\8211\\&20\\160m\"\n    , Superscript [ Str \"3\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\raisetothe{4}\\meter}\n^D\n[ Para\n    [ Str \"10\\160m\"\n    , Superscript [ Str \"4\" ]\n    , Str \"\\8211\\&20\\160m\"\n    , Superscript [ Str \"4\" ]\n    ]\n]\n```\n\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\meter\\squared}\n^D\n[ Para\n    [ Str \"10\\160m\"\n    , Superscript [ Str \"2\" ]\n    , Str \"\\8211\\&20\\160m\"\n    , Superscript [ Str \"2\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\meter\\cubed}\n^D\n[ Para\n    [ Str \"10\\160m\"\n    , Superscript [ Str \"3\" ]\n    , Str \"\\8211\\&20\\160m\"\n    , Superscript [ Str \"3\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\SIrange{10}{20}{\\meter\\tothe{4}}\n^D\n[ Para\n    [ Str \"10\\160m\"\n    , Superscript [ Str \"4\" ]\n    , Str \"\\8211\\&20\\160m\"\n    , Superscript [ Str \"4\" ]\n    ]\n]\n```\n\n\n\n## Ignore round precision\n\n`round-precision` option appears to be ignored by `\\SI` as of 7c6dbd37e, so\n`\\SIrange` will ignore it as well.\n\n```\n% pandoc -f latex -t native\n\\SIrange[round-precision=2]{10}{20}{\\gram}\n^D\n[ Para [ Str \"10\\160g\\8211\\&20\\160g\" ] ]\n```\n```\n% pandoc -f latex -t native\n\\SIrange[round-precision=2]{10.0}{20.25}{\\gram}\n^D\n[ Para [ Str \"10.0\\160g\\8211\\&20.25\\160g\" ] ]\n```\n\n"
  },
  {
    "path": "test/command/3596.md",
    "content": "```\n% pandoc -f html -t markdown-raw_html-bracketed_spans-native_spans\n<ul>\n<li>foo</li>\n<li id=\"id\">bar</li>\n<li>baz</li>\n</ul>\n^D\n- foo\n- bar\n- baz\n```\n\n```\n% pandoc -f html -t markdown-raw_html-bracketed_spans-native_spans\n<ul>\n<li>foo</li>\n<li id=\"id\">bar<ul><li>subbar</li></ul></li>\n<li>baz</li>\n</ul>\n^D\n- foo\n- bar\n  - subbar\n- baz\n```\n\n\n```\n% pandoc -f html -t markdown\n<ul>\n<li>foo</li>\n<li id=\"id\">bar</li>\n<li>baz</li>\n</ul>\n^D\n- foo\n- [bar]{#id}\n- baz\n```\n\n\n```\n% pandoc -f html -t markdown\n<ul>\n<li><p>foo</p></li>\n<li id=\"id\"><p>bar</p></li>\n<li><p>baz</p></li>\n</ul>\n^D\n- foo\n\n- ::: {#id}\n  bar\n  :::\n\n- baz\n\n```\n"
  },
  {
    "path": "test/command/3615.md",
    "content": "```\n% pandoc -f html -t markdown --reference-links\n<a href=\"a\">foo</a> <a href=\"b\">Foo</a>\n^D\n[foo][] [Foo][1]\n\n  [foo]: a\n  [1]: b\n```\n\n```\n% pandoc -f html -t markdown --reference-links\n<a href=\"a\">foo</a> <a href=\"a\">Foo</a>\n^D\n[foo][] [Foo]\n\n  [foo]: a\n```\n"
  },
  {
    "path": "test/command/3619.md",
    "content": "```\n% pandoc -f html -t markdown --reference-links\n<a href=\"foo\">bar</a>: baz\n^D\n[bar][]: baz\n\n  [bar]: foo\n```\n\n```\n% pandoc -f html -t markdown --reference-links\n<a href=\"foo\">bar</a>(baz)\n^D\n[bar][](baz)\n\n  [bar]: foo\n```\n\n```\n% pandoc -f html -t markdown_strict --reference-links\n<a href=\"a\">foo</a><br/><a href=\"b\">bar</a>\n^D\n[foo][]  \n[bar]\n\n  [foo]: a\n  [bar]: b\n```\n"
  },
  {
    "path": "test/command/3630.md",
    "content": "```\n% pandoc -f markdown -t markdown --reference-links\n![foo](bar.png){#myId}\n^D\n![foo]\n\n  [foo]: bar.png {#myId}\n```\n"
  },
  {
    "path": "test/command/3667.md",
    "content": "```\n% pandoc -f textile\n| \"link text\":http://example.com/ |\n^D\n<table>\n<tbody>\n<tr>\n<td><a href=\"http://example.com/\">link text</a></td>\n</tr>\n</tbody>\n</table>\n```\n\n"
  },
  {
    "path": "test/command/3674.md",
    "content": "Make sure we don't get duplicate reference links, even with\n`--reference-location=section`.\n\n```\n% pandoc --reference-links -t markdown --reference-location=section\n# a\n\n![](a)\n\n# b\n\n![](b)\n\n^D\n# a\n\n![][1]\n\n  [1]: a\n\n# b\n\n![][2]\n\n  [2]: b\n```\n\nSubsidiary issue:  allow line break between reference link\nurl/title and attributes:\n\n```\n% pandoc\n[a]\n\n[a]: url\n{.class}\n^D\n<p><a href=\"url\" class=\"class\">a</a></p>\n```\n"
  },
  {
    "path": "test/command/3675.md",
    "content": "````\n% pandoc -t rst\n```python\nprint(\"hello\")\n```\n> block quote\n^D\n.. code:: python\n\n   print(\"hello\")\n\n..\n\n   block quote\n````\n"
  },
  {
    "path": "test/command/3681.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\cicd}{CI/CD\\xspace}\n\nSoftware developers create \\cicd pipelines to… Following issue can be resolved by \\cicd:\n^D\n[ Para\n    [ Str \"Software\"\n    , Space\n    , Str \"developers\"\n    , Space\n    , Str \"create\"\n    , Space\n    , Str \"CI/CD\"\n    , Space\n    , Str \"pipelines\"\n    , Space\n    , Str \"to\\8230\"\n    , Space\n    , Str \"Following\"\n    , Space\n    , Str \"issue\"\n    , Space\n    , Str \"can\"\n    , Space\n    , Str \"be\"\n    , Space\n    , Str \"resolved\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"CI/CD:\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\newcommand{\\cicd}{CI/CD\\xspace}\n\n\\cicd\\footnote{\\url{https://en.wikipedia.org/wiki/CI/CD}} is awesome.\n^D\n[ Para\n    [ Str \"CI/CD\"\n    , Note\n        [ Para\n            [ Link\n                ( \"\" , [ \"uri\" ] , [] )\n                [ Str \"https://en.wikipedia.org/wiki/CI/CD\" ]\n                ( \"https://en.wikipedia.org/wiki/CI/CD\" , \"\" )\n            ]\n        ]\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"awesome.\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\newcommand{\\cicd}{CI/CD\\xspace}\n\\newcommand{\\pipeline}{pipeline\\xspace}\n\n\\cicd\\pipeline.\n^D\n[ Para [ Str \"CI/CD\" , Space , Str \"pipeline.\" ] ]\n```\n"
  },
  {
    "path": "test/command/3690.md",
    "content": "```\n% pandoc\n- [o] _hi_\n^D\n<ul>\n<li>[o] <em>hi</em></li>\n</ul>\n```\n"
  },
  {
    "path": "test/command/3701.md",
    "content": "```\n% pandoc --reference-location=block -t markdown --reference-links --wrap=preserve\n[a](u)\n\n[a](u)\n\n[a](u2)\n[A](u)\n[a](u){.foo}\n\n[a](u3)\n^D\n[a]\n\n  [a]: u\n\n[a]\n\n  [a]: u\n\n[a][1]\n[A][]\n[a][2]\n\n  [1]: u2\n  [A]: u\n  [2]: u {.foo}\n\n[a][3]\n\n  [3]: u3\n```\n\n```\n% pandoc\n[a]\n\n  [a]: u\n\n[a]\n\n  [a]: u\n\n[a][1]\n[A][]\n[a][2]\n\n  [1]: u2\n  [A]: u\n  [2]: u {.foo}\n\n[a][3]\n\n  [3]: u3\n^D\n<p><a href=\"u\">a</a></p>\n<p><a href=\"u\">a</a></p>\n<p><a href=\"u2\">a</a> <a href=\"u\">A</a> <a href=\"u\"\nclass=\"foo\">a</a></p>\n<p><a href=\"u3\">a</a></p>\n```\n"
  },
  {
    "path": "test/command/3706.md",
    "content": "Results marker can be hidden in block attributes (#3706)\n\n```\n% pandoc -f org -t native\n#+begin_src r :exports results :colnames yes\n   data.frame(Id = 1:3, Desc = rep(\"La\",3))\n#+end_src\n\n#+caption: Lalelu.\n#+label: tab\n#+RESULTS:\n| Id | Desc |\n|----+------|\n|  1 | La   |\n|  2 | La   |\n|  3 | La   |\n^D\n[ Table\n    ( \"tab\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Lalelu.\" ] ])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Id\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Desc\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"La\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"La\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"La\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f org -t native\n#+begin_src R :exports none :colnames yes\n   data.frame(Id = 1:2, Desc = rep(\"La\",2))\n#+end_src\n\n#+caption: Lalelu.\n#+label: tab\n#+RESULTS:\n| Id | Desc |\n|----+------|\n|  1 | La   |\n|  2 | La   |\n^D\n[]\n```\n"
  },
  {
    "path": "test/command/3708.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{tabular}{cc}\n    A & B\\&1 \\\\\n    C & D\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"A\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B&1\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"C\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"D\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/3715.md",
    "content": "```\n% pandoc -t markdown -f html --wrap=preserve\nx<em></em>x\ny<strong></strong>y\nz<sup></sup>z\nw<sub></sub>w\nq<s></s>q\n^D\nxx\nyy\nzz\nww\nqq\n```\n\n"
  },
  {
    "path": "test/command/3716.md",
    "content": "```\n% pandoc\n<http://example.com>{.foo}\n^D\n<p><a href=\"http://example.com\" class=\"foo\">http://example.com</a></p>\n```\n"
  },
  {
    "path": "test/command/3730.md",
    "content": "````\n% pandoc\nnice line\\\n```\ncode\n```\n^D\n<p>nice line<br />\n</p>\n<pre><code>code</code></pre>\n````\n\n```\n% pandoc\n# hi\\\nthere\n^D\n<h1 id=\"hi\">hi<br />\n</h1>\n<p>there</p>\n```\n"
  },
  {
    "path": "test/command/3733.md",
    "content": "````\n% pandoc -t native\n- Item1\n- Item2\n```yaml\nsome: code\n```\n^D\n[ BulletList\n    [ [ Plain [ Str \"Item1\" ] ] , [ Plain [ Str \"Item2\" ] ] ]\n, CodeBlock ( \"\" , [ \"yaml\" ] , [] ) \"some: code\"\n]\n````\n"
  },
  {
    "path": "test/command/3734.md",
    "content": "```\n% pandoc -t markdown_strict+pipe_tables\n| aaaaaaaaaaaa | bbbbb | ccccccccccc                                                              |\n|--------------|-------|--------------------------------------------------------------------------|\n| aaaaaaaaaaaa |       | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |\n^D\n| aaaaaaaaaaaa | bbbbb | ccccccccccc |\n|------------|-------|------------------------------------------------------|\n| aaaaaaaaaaaa |  | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |\n```\n\n```\n% pandoc -t markdown_strict+pipe_tables-raw_html\n| aaaaaaaaaaaa | bbbbb | ccccccccccc                                                              |\n|--------------|-------|--------------------------------------------------------------------------|\n| aaaaaaaaaaaa |       | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |\n^D\n| aaaaaaaaaaaa | bbbbb | ccccccccccc |\n|------------|-------|------------------------------------------------------|\n| aaaaaaaaaaaa |  | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |\n```\n\n```\n% pandoc -t gfm\n| aaaaaaaaaaaa | bbbbb | ccccccccccc                                                              |\n|--------------|-------|--------------------------------------------------------------------------|\n| aaaaaaaaaaaa |       | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |\n^D\n| aaaaaaaaaaaa | bbbbb | ccccccccccc |\n|----|----|----|\n| aaaaaaaaaaaa |  | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |\n```\n"
  },
  {
    "path": "test/command/3736.md",
    "content": "```\n% pandoc --wrap=preserve -f html -t markdown\n<h2>hi\nthere</h2>\n^D\n## hi there\n```\n\n```\n% pandoc --wrap=preserve -f html -t markdown\n<h2>hi <em>there\nagain</em></h2>\n^D\n## hi *there again*\n```\n\n```\n% pandoc --wrap=preserve -f html -t markdown\n<h2>hi<br>there</h2>\n^D\n## hi there\n```\n"
  },
  {
    "path": "test/command/3752.md",
    "content": "```\n% pandoc command/chap1/text.md command/chap2/text.md -f markdown+rebase_relative_paths --verbose -t docx -o - | pandoc -f docx -t plain\n^D\n2> [INFO] Loaded command/chap1/spider.png from command/chap1/spider.png\n2> [INFO] Loaded command/chap2/spider.png from command/chap2/spider.png\n2> [INFO] Loaded command/chap1/../../lalune.jpg from command/chap1/../../lalune.jpg\nChapter one\n\nA spider: [spider]\n\nAnother spider: [another spider]\n\nThe moon: [moon]\n\nLink to spider picture.\n\nURL left alone: manual.\n\nAbsolute path left alone: absolute.\n\nLink to fragment: chapter two.\n\nEmpty path: empty.\n\nChapter two\n\nA spider: [spider]\n```\n\n```\n% pandoc command/chap1/text.md command/chap2/text.md -f markdown+rebase_relative_paths -t html\n^D\n<h1 id=\"chapter-one\">Chapter one</h1>\n<p>A spider: <img src=\"command/chap1/spider.png\" alt=\"spider\" /></p>\n<p>Another spider: <img src=\"command/chap2/spider.png\"\nalt=\"another spider\" /></p>\n<p>The moon: <img src=\"command/chap1/../../lalune.jpg\" alt=\"moon\" /></p>\n<p>Link to <a href=\"command/chap1/spider.png\">spider picture</a>.</p>\n<p>URL left alone: <a\nhref=\"https://pandoc.org/MANUAL.html\">manual</a>.</p>\n<p>Absolute path left alone: <a\nhref=\"/foo/bar/baz.png\">absolute</a>.</p>\n<p>Link to fragment: <a href=\"#chapter-two\">chapter two</a>.</p>\n<p>Empty path: <a href=\"\">empty</a>.</p>\n<h1 id=\"chapter-two\">Chapter two</h1>\n<p>A spider: <img src=\"command/chap2/spider.png\" alt=\"spider\" /></p>\n```\n\n```\n% pandoc command/chap1/text.md command/chap2/text.md -f commonmark+rebase_relative_paths -t html\n^D\n<h1>Chapter one</h1>\n<p>A spider: <img src=\"command/chap1/spider.png\" alt=\"spider\" /></p>\n<p>Another spider: <img src=\"command/chap2/spider.png\"\nalt=\"another spider\" /></p>\n<p>The moon: <img src=\"command/chap1/../../lalune.jpg\" alt=\"moon\" /></p>\n<p>Link to <a href=\"command/chap1/spider.png\">spider picture</a>.</p>\n<p>URL left alone: <a\nhref=\"https://pandoc.org/MANUAL.html\">manual</a>.</p>\n<p>Absolute path left alone: <a\nhref=\"/foo/bar/baz.png\">absolute</a>.</p>\n<p>Link to fragment: <a href=\"#chapter-two\">chapter two</a>.</p>\n<p>Empty path: <a href=\"\">empty</a>.</p>\n<h1>Chapter two</h1>\n<p>A spider: <img src=\"command/chap2/spider.png\" alt=\"spider\" /></p>\n```\n"
  },
  {
    "path": "test/command/3755.md",
    "content": "```\n% pandoc -t native -s\n---\ntitle: 'Titel'\ndate: '22. Juni 2017'\n---\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"date\"\n            , MetaInlines\n                [ Str \"22.\" , Space , Str \"Juni\" , Space , Str \"2017\" ]\n            )\n          , ( \"title\" , MetaInlines [ Str \"Titel\" ] )\n          ]\n    }\n  []\n```\n\n```\n% pandoc -t native -s\n---\ntitle: \"<div>foo</div>\\n\"\ndate: |\n  22. Juni 2017\n---\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"date\"\n            , MetaBlocks\n                [ OrderedList\n                    ( 22 , Decimal , Period )\n                    [ [ Plain [ Str \"Juni\" , Space , Str \"2017\" ] ] ]\n                ]\n            )\n          , ( \"title\"\n            , MetaBlocks\n                [ Div ( \"\" , [] , [] ) [ Plain [ Str \"foo\" ] ] ]\n            )\n          ]\n    }\n  []\n```\n\n"
  },
  {
    "path": "test/command/3771.md",
    "content": "```\n% pandoc -f html -t org\n<div class=\"Section1\">\n  Today is a nice day.\n</div>\n<div id=\"forecast\">\n  Tomorrow will be rainy.\n</div>\n^D\nToday is a nice day.\n\n<<forecast>>\nTomorrow will be rainy.\n```\n"
  },
  {
    "path": "test/command/3773.md",
    "content": "```\n% pandoc -t markdown\nA.  \\#\nB.  \\+\nC.  \\*\nD.  o\nE.  o or \\*\n^D\nA.  \\#\nB.  \\+\nC.  \\*\nD.  o\nE.  o or \\*\n```\n"
  },
  {
    "path": "test/command/3779.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\fakeitemize}[1]{\n    \\begin{itemize}\n        #1\n    \\end{itemize}\n}\n\\newcommand{\\testcmd}[1]{\n    #1\n}\n\\fakeitemize{\n    \\item Pandoc is 100\\% awesome.\n}\n\n\\begin{itemize}\n    \\item Pandoc is 200\\% awesome.\n\\end{itemize}\n\n\\testcmd{\n    Pandoc is 300\\% awesome.\n}\n^D\n[ BulletList\n    [ [ Para\n          [ Str \"Pandoc\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"100%\"\n          , Space\n          , Str \"awesome.\"\n          ]\n      ]\n    ]\n, BulletList\n    [ [ Para\n          [ Str \"Pandoc\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"200%\"\n          , Space\n          , Str \"awesome.\"\n          ]\n      ]\n    ]\n, Para\n    [ Str \"Pandoc\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"300%\"\n    , Space\n    , Str \"awesome.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3792.md",
    "content": "Make sure metadata values are treated as strings,\nand properly escaped.\n\n```\n% pandoc -t markdown -s -M title=\"<this> *that*\"\nok\n^D\n---\ntitle: \\<this\\> \\*that\\*\n---\n\nok\n```\n"
  },
  {
    "path": "test/command/3794.md",
    "content": "```\n% pandoc -f html -t native\n<div><p>hello</div>\n^D\n[ Div ( \"\" , [] , [] ) [ Para [ Str \"hello\" ] ] ]\n```\n"
  },
  {
    "path": "test/command/3803.md",
    "content": "```\n% pandoc -f markdown+raw_tex -t latex\n\\begin{blah*}\n*ok*\n\\end{blah*}\n^D\n\\begin{blah*}\n*ok*\n\\end{blah*}\n```\n"
  },
  {
    "path": "test/command/3804.md",
    "content": "```\n% pandoc -t native\n\\titleformat{\\chapter}[display]{\\normalfont\\large\\bfseries}{第\\thechapter{}章}{20pt}{\\Huge}\n^D\n[ RawBlock\n    (Format \"tex\")\n    \"\\\\titleformat{\\\\chapter}[display]{\\\\normalfont\\\\large\\\\bfseries}{\\31532\\\\thechapter{}\\31456}{20pt}{\\\\Huge}\"\n]\n```\n"
  },
  {
    "path": "test/command/3816.md",
    "content": "```\n% pandoc --mathjax -t html5 --wrap=preserve\nThis is an equation:\n\\begin{equation}\ny+2 = 3\n\\end{equation}\n\nThis is a system of equations:\n\\begin{align*}\nx^2+y^2 & = 2 \\\\\n\\sin(y) & = 0.5\n\\end{align*}\n\nThis is Euler's formula:\n\\begin{eqnarray*}\ne^{i\\pi} + 1 & = & 0.\n\\end{eqnarray*}\n^D\n<p>This is an equation:\n<span class=\"math display\">\\[\\begin{equation}\ny+2 = 3\n\\end{equation}\\]</span></p>\n<p>This is a system of equations:\n<span class=\"math display\">\\[\\begin{align*}\nx^2+y^2 &amp; = 2 \\\\\n\\sin(y) &amp; = 0.5\n\\end{align*}\\]</span></p>\n<p>This is Euler’s formula:\n<span class=\"math display\">\\[\\begin{eqnarray*}\ne^{i\\pi} + 1 &amp; = &amp; 0.\n\\end{eqnarray*}\\]</span></p>\n```\n"
  },
  {
    "path": "test/command/3824.md",
    "content": "```\n% pandoc -f native -t dokuwiki\n[BulletList\n [[Para [Str \"hi\"]\n  ,CodeBlock (\"\",[],[]) \" there\"]\n ,[Para [Str \"ok\"]]]]\n^D\n  * hi<code>\n there\n</code>\n\n  * ok\n\n```\n"
  },
  {
    "path": "test/command/3840.md",
    "content": "```\n% pandoc\n[@Alhazen1572-qk, V.9]: \"competentius est\"\n^D\n<p><span class=\"citation\" data-cites=\"Alhazen1572-qk\">[@Alhazen1572-qk,\nV.9]</span>: “competentius est”</p>\n```\n\n```\n% pandoc -f markdown-citations\n[@Alhazen1572-qk, V.9]: \"competentius est\"\n\n[@Alhazen1572-qk, V.9]\n^D\n<p><a href=\"\" title=\"competentius est\">@Alhazen1572-qk, V.9</a></p>\n```\n"
  },
  {
    "path": "test/command/3853.md",
    "content": "```\n% pandoc -f latex -t native\n\\newtoggle{ebook}\n\\toggletrue{ebook}\n\\iftoggle{ebook}{\nebook\n}%\n{\nnot ebook\n}%\nmore\n\n\\togglefalse{ebook}\n\\iftoggle{ebook}{%\nebook\n}{\nnot ebook\n}%\nmore\n\nhello \\iftoggle{ebook}{ebook}{noebook}\n^D\n[ Para [ Str \"ebook\" , SoftBreak , Str \"more\" ]\n, Para\n    [ Str \"not\" , Space , Str \"ebook\" , SoftBreak , Str \"more\" ]\n, Para [ Str \"hello\" , Space , Str \"noebook\" ]\n]\n```\n"
  },
  {
    "path": "test/command/3880.md",
    "content": "```\n% pandoc -f rst -t native\n.. include:: command/3880.txt\n^D\n[ Para [ Str \"hi\" ] ]\n```\n"
  },
  {
    "path": "test/command/3880.txt",
    "content": "hi\n"
  },
  {
    "path": "test/command/3916.md",
    "content": "```\n% pandoc -f textile -t native\n# text text\n<pre>blabla</pre>\n# more\n^D\n[ OrderedList\n    ( 1 , DefaultStyle , DefaultDelim )\n    [ [ Plain [ Str \"text\" , Space , Str \"text\" ]\n      , CodeBlock ( \"\" , [] , [] ) \"blabla\"\n      ]\n    , [ Plain [ Str \"more\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/3937.md",
    "content": "```\n% pandoc -t rst\n# My Great Section {#mysection}\n# Other section\n^D\n.. _mysection:\n\nMy Great Section\n================\n\nOther section\n=============\n```\n"
  },
  {
    "path": "test/command/3947.md",
    "content": "```\n% pandoc -t native\n\\newpage\n\n\tCode block\n\n\tAnother Code block\n^D\n[ RawBlock (Format \"tex\") \"\\\\newpage\"\n, CodeBlock\n    ( \"\" , [] , [] ) \"Code block\\n\\nAnother Code block\"\n]\n```\n"
  },
  {
    "path": "test/command/3958.md",
    "content": "```\n% pandoc -f latex -t native\n\\texttt{\"hi\"}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"\\\"hi\\\"\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\texttt{``hi''}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"\\8216\\8216hi\\8217\\8217\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\texttt{`hi'}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"\\8216hi\\8217\" ] ]\n```\n"
  },
  {
    "path": "test/command/3968.md",
    "content": "```\n% pandoc --top-level-division=chapter -t context\n# Chapter\n\n## Section\n^D\n\\startchapter[title={Chapter},reference={chapter}]\n\n\\startsection[title={Section},reference={section}]\n\n\\stopsection\n\n\\stopchapter\n```\n"
  },
  {
    "path": "test/command/3971.md",
    "content": "```\n% pandoc -f latex -t native\n\\documentclass{article}\n\\include{command/3971b}\n\\code{f}\n\\end{document}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"f\" ] ]\n```\n"
  },
  {
    "path": "test/command/3971b.tex",
    "content": "\\newcommand{\\code}[1]{\\texttt{#1}}\n\\begin{document}\n"
  },
  {
    "path": "test/command/3974.md",
    "content": "```\n% pandoc -f native -t rst\n[Code (\"\",[],[]) \"``\"]\n^D\n:literal:`\\`\\``\n```\n"
  },
  {
    "path": "test/command/3978.md",
    "content": "```\n% pandoc -t rst\nfoo_bar*baz\n^D\nfoo_bar*baz\n```\n"
  },
  {
    "path": "test/command/3983.md",
    "content": "```\n% pandoc -f latex+raw_tex -t native\n\\def\\filename@area{foo:bar:baz}\n\\makeatletter\n\\graphicspath\\expandafter{\\expandafter{\\filename@area}}%\n\\makeatother\n^D\n[ RawBlock (Format \"latex\") \"\\\\makeatletter\"\n, RawBlock (Format \"latex\") \"\\\\makeatother\"\n]\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\makeatletter\n  \\newcommand\\urlfootnote@[1]{\\footnote{\\url@{#1}}}\n  \\DeclareRobustCommand{\\urlfootnote}{\\hyper@normalise\\urlfootnote@}\n\\makeatother\n^D\n[ RawBlock (Format \"latex\") \"\\\\makeatletter\"\n, RawBlock (Format \"latex\") \"\\\\makeatother\"\n]\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\def\\foo{bar}\n\\expandafter\\bam\\foo\n^D\n[ RawBlock (Format \"latex\") \"\\\\bambar\" ]\n```\n"
  },
  {
    "path": "test/command/3989.md",
    "content": "```\n% pandoc -f markdown -t native\n<span title=\"1st line of text <br> 2nd line of text\">foo</span>\n <span title=\"1st line of text <br> 2nd line of text\">foo</span>\n^D\n[ Para\n    [ Span\n        ( \"\"\n        , []\n        , [ ( \"title\" , \"1st line of text <br> 2nd line of text\" ) ]\n        )\n        [ Str \"foo\" ]\n    , SoftBreak\n    , Span\n        ( \"\"\n        , []\n        , [ ( \"title\" , \"1st line of text <br> 2nd line of text\" ) ]\n        )\n        [ Str \"foo\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4007.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand\\arrow\\to\n$a\\arrow b$\n^D\n[ Para [ Math InlineMath \"a\\\\to b\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\newcommand\\pfeil[1]{\\to #1}\n$a\\pfeil b$\n^D\n[ Para [ Math InlineMath \"a\\\\to b\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\newcommand\\fleche{\\to}\n$a\\fleche b$\n^D\n[ Para [ Math InlineMath \"a\\\\to b\" ] ]\n```\n"
  },
  {
    "path": "test/command/4012.md",
    "content": "```\n% pandoc -f markdown-implicit_figures\n![image]\n\n[image]: http://example.com/image.jpg {height=35mm}\n^D\n<p><img src=\"http://example.com/image.jpg\" style=\"height:35mm\"\nalt=\"image\" /></p>\n```\n"
  },
  {
    "path": "test/command/4016.md",
    "content": "```\n% pandoc -t beamer\n# Level 2 blocks\n\n<div class=\"columns\">\n<div class=\"column\" width=\"40%\">\n## Block one\n- Item\n</div>\n<div class=\"column\" width=\"60%\">\n## Block two\n- Item\n</div>\n</div>\n^D\n\\begin{frame}{Level 2 blocks}\n\\protect\\phantomsection\\label{level-2-blocks}\n\\begin{columns}[T]\n\\begin{column}{0.4\\linewidth}\n\\begin{block}{Block one}\n\\protect\\phantomsection\\label{block-one}\n\\begin{itemize}\n\\tightlist\n\\item\n  Item\n\\end{itemize}\n\\end{block}\n\\end{column}\n\n\\begin{column}{0.6\\linewidth}\n\\begin{block}{Block two}\n\\protect\\phantomsection\\label{block-two}\n\\begin{itemize}\n\\tightlist\n\\item\n  Item\n\\end{itemize}\n\\end{block}\n\\end{column}\n\\end{columns}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/4019.md",
    "content": "```\n% pandoc --wrap=preserve\nThis <!-- x > 0 --> works!\nThis <!-- x > 0 --> fails?\n^D\n<p>This <!-- x > 0 --> works!\nThis <!-- x > 0 --> fails?</p>\n```\n"
  },
  {
    "path": "test/command/4038.md",
    "content": "```\n% pandoc -f gfm -t gfm\n# ~~Header~~\n^D\n# ~~Header~~\n```\n"
  },
  {
    "path": "test/command/4054.md",
    "content": "```\n% pandoc -t native -s -M title=New\n% Old\n^D\nPandoc\n  Meta\n    { unMeta = fromList [ ( \"title\" , MetaString \"New\" ) ] }\n  []\n```\n\n```\n% pandoc -t native -s -M foo=1 -M foo=2\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"foo\" , MetaList [ MetaString \"1\" , MetaString \"2\" ] ) ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/4056.md",
    "content": "```\n% pandoc -f markdown -t native\n\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}\n^D\n[ RawBlock\n    (Format \"tex\")\n    \"\\\\parbox[t]{0.4\\\\textwidth}{\\n\\\\begin{shaded}\\n\\\\end{shaded}\\n}\"\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{tabular}{l*{2}{r}}\nBlah & Foo & Bar \\\\\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Blah\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Foo\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Bar\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/4061.md",
    "content": "```\n% pandoc -t markdown-simple_tables-multiline_tables-pipe_tables\n+-----------------------------------+\n| Text [^1]                         |\n+-----------------------------------+\n\n[^1]: Footnote.\n^D\n+-----------------------------------+\n| Text [^1]                         |\n+-----------------------------------+\n\n[^1]: Footnote.\n```\n"
  },
  {
    "path": "test/command/4062.md",
    "content": "```\n% pandoc -t latex\nSentence blah.\\footnote[][-.5in]{I'm a footnote}\n^D\nSentence blah.\\footnote[][-.5in]{I'm a footnote}\n```\n"
  },
  {
    "path": "test/command/4063.md",
    "content": "```\n% pandoc -f html -t native\n<table>\n<colgroup>\n  <col width=\"30%\" />\n  <col width=\"*\" />\n</colgroup>\n<tr>\n  <td>1</td>\n  <td>2</td>\n</tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.3 )\n    , ( AlignDefault , ColWidth 0.7 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/4068.md",
    "content": "```\n% pandoc -f mediawiki -t native\n[https://domain.com/script.php?a=1&b=2&c=&d=4 open productname bugs]\n\n[http://domain.com?a=. open productname bugs]\n^D\n[ Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Str \"open\"\n        , Space\n        , Str \"productname\"\n        , Space\n        , Str \"bugs\"\n        ]\n        ( \"https://domain.com/script.php?a=1&b=2&c=&d=4\" , \"\" )\n    ]\n, Para\n    [ Str \"[\"\n    , Link\n        ( \"\" , [] , [] )\n        [ Str \"http://domain.com?a=\" ]\n        ( \"http://domain.com?a=\" , \"\" )\n    , Str \".\"\n    , Space\n    , Str \"open\"\n    , Space\n    , Str \"productname\"\n    , Space\n    , Str \"bugs]\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4091.md",
    "content": "```\n% pandoc -f latex\n\\alert<3>{foo}\n^D\n<p><span class=\"alert\">foo</span></p>\n```\n"
  },
  {
    "path": "test/command/4102.md",
    "content": "SmallCaps spans can have additional attributes.\n```\n% pandoc -t latex -f markdown\n[Populus]{.smallcaps lang=la}\n\n[Romanus]{.smallcaps}\n^D\n\\foreignlanguage{latin}{\\textsc{Populus}}\n\n\\textsc{Romanus}\n```\n"
  },
  {
    "path": "test/command/4113.md",
    "content": "```\n% pandoc -t gfm\n::::{.bug}\nI am a [bug]{#bug}.\n::::\n^D\n<div class=\"bug\">\n\nI am a <span id=\"bug\">bug</span>.\n\n</div>\n```\n"
  },
  {
    "path": "test/command/4119.md",
    "content": "```\n% pandoc -t native\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 2    |\n\n::: {.notes} :::\nnot a caption!\n::::::::::::::::\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"col1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"col2\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Div\n    ( \"\" , [ \"notes\" ] , [] )\n    [ Para\n        [ Str \"not\" , Space , Str \"a\" , Space , Str \"caption!\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4125.md",
    "content": "```\n% pandoc\n<?asciidoc-toc?>\n^D\n<?asciidoc-toc?>\n```\n"
  },
  {
    "path": "test/command/4134.md",
    "content": "```\n% pandoc -f latex -t native\nHello.\\\nworld.\n^D\n[ Para [ Str \"Hello.\\160world.\" ] ]\n```\n\n```\n% pandoc -f latex -t native\nHello.\\  \n world.\n^D\n[ Para [ Str \"Hello.\\160world.\" ] ]\n```\n\n```\n% pandoc -f latex -t native\nHello.\\\n\nWorld.\n^D\n[ Para [ Str \"Hello.\\160\" ] , Para [ Str \"World.\" ] ]\n```\n"
  },
  {
    "path": "test/command/4156.md",
    "content": "```\n% pandoc -f rst\n.. _`SOMEID`:\n\nfoo\n^D\n<div id=\"SOMEID\">\n<p>foo</p>\n</div>\n```\n"
  },
  {
    "path": "test/command/4159.md",
    "content": "```\n% pandoc -f markdown -t native\n\\newcommand{\\gen}{a\\ Gen\\ b}\nabc\n^D\n[ RawBlock (Format \"tex\") \"\\\\newcommand{\\\\gen}{a\\\\ Gen\\\\ b}\"\n, Para [ Str \"abc\" ]\n]\n```\n"
  },
  {
    "path": "test/command/4162.md",
    "content": "```\n% pandoc -f html -t native\n<div class=\"line-block\">hi<br /><br>\n there</div>\n^D\n[ LineBlock [ [ Str \"hi\" ] , [] , [ Str \"\\160there\" ] ] ]\n```\n"
  },
  {
    "path": "test/command/4164.md",
    "content": "```\n% pandoc -f opml -t markdown\n<?xml version=\"1.0\"?> <opml version=\"1.0\"> <head> <title> test </title> </head> <body> <outline text=\"test\"> <outline text=\"try\" _note=\"Here is inline html:&#xA;&#xA;&lt;div&gt; &#xA;&lt;balise&gt;&#xA;bla bla&#xA;&lt;/div&gt;\"/> </outline> </body> </opml>\n^D\n# test\n\n## try\n\nHere is inline html:\n\n::: {}\n`<balise>`{=html} bla bla\n:::\n\n```\n\n```\n% pandoc -f opml-raw_html-native_divs -t markdown\n<?xml version=\"1.0\"?> <opml version=\"1.0\"> <head> <title> test </title> </head> <body> <outline text=\"test\"> <outline text=\"try\" _note=\"Here is inline html:&#xA;&#xA;&lt;div&gt; &#xA;&lt;balise&gt;&#xA;bla bla&#xA;&lt;/div&gt;\"/> </outline> </body> </opml>\n^D\n# test\n\n## try\n\nHere is inline html:\n\n\\<div\\> \\<balise\\> bla bla \\</div\\>\n\n```\n"
  },
  {
    "path": "test/command/4171.md",
    "content": "```\n% pandoc -f org -t org\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [fn:1] a\n\n[fn:1] b\n^D\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [fn:1]\na\n\n[fn:1] b\n```\n\n\n```\n% pandoc -f org -t org\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n [fn:1] a\n\n[fn:1] b\n^D\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [fn:1]\na\n\n[fn:1] b\n```\n\nSimilar bug: \"-\" should not be wrapped:\n```\n% pandoc -f org -t org\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - abc\n^D\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -\nabc\n```\n"
  },
  {
    "path": "test/command/4172.md",
    "content": "Test that text wrapping does not move note reference [1] to the beginning of the line,\nwhere it would become a note.\n```\n% pandoc -f muse -t muse\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [1] a\n\n[1] b\n^D\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [1]\na\n\n[1] b\n\n```\n\nSoftBreak test:\n```\n% pandoc -f muse -t muse\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n [1] a\n\n[1] b\n^D\nAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [1]\na\n\n[1] b\n\n```\n"
  },
  {
    "path": "test/command/4183.md",
    "content": "```\n% pandoc -f html -t native\n<figure>\n  <img src=\"foo\" alt=\"bar\">\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"foo\" , \"\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<figure>\n  <img src=\"foo\" alt=\"bar\">\n  <figcaption>\n    <div>\n      baz\n    </div>\n  </figcaption>\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Div ( \"\" , [] , [] ) [ Plain [ Str \"baz\" ] ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"foo\" , \"\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<figure>\n  <img src=\"foo\">\n  <figcaption><p><em>baz</em></p></figcaption>\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Para [ Emph [ Str \"baz\" ] ] ])\n    [ Plain [ Image ( \"\" , [] , [] ) [] ( \"foo\" , \"\" ) ] ]\n]\n```\n"
  },
  {
    "path": "test/command/4186.md",
    "content": "```\n% pandoc -f org -t native\n#+begin_example -i\n    This should retain the four leading spaces\n#+end_example\n^D\n[ CodeBlock\n    ( \"\" , [] , [] )\n    \"    This should retain the four leading spaces\\n\"\n]\n```\n\n```\n% pandoc -f org -t html\n- depth 1\n  #+name: bob\n  #+begin_example -i\n    Vertical alignment is four spaces beyond the appearance of the word \"depth\".\n  #+end_example\n       - depth 2\n         #+begin_example\n                          Vertically aligned with the second appearance of the word \"depth\".\n         #+end_example\n              #+begin_example -i\n    Vertical alignment is four spaces beyond the second\n    appearance of the word \"depth\".\n    The \"begin\" portion is a component of\n    this deeper list element, so that guarantees\n    that the entire block must be a component of the\n    inner list element.\n    #+end_example\n         Still inside the inner list element\n   #+name: carrie\n                         #+begin_example\n                           This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.\n                           #+end_example\n                 Still in the shallower list element since the preceding example\n                 block forced the deeper list element to terminate.\nOutside all lists.\n^D\n<ul>\n<li><p>depth 1</p>\n<pre id=\"bob\"><code>    Vertical alignment is four spaces beyond the appearance of the word &quot;depth&quot;.\n</code></pre>\n<ul>\n<li><p>depth 2</p>\n<pre><code>Vertically aligned with the second appearance of the word &quot;depth&quot;.\n</code></pre>\n<pre><code>    Vertical alignment is four spaces beyond the second\n    appearance of the word &quot;depth&quot;.\n    The &quot;begin&quot; portion is a component of\n    this deeper list element, so that guarantees\n    that the entire block must be a component of the\n    inner list element.\n</code></pre>\n<p>Still inside the inner list element</p></li>\n</ul>\n<pre id=\"carrie\"><code>This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.\n</code></pre>\n<p>Still in the shallower list element since the preceding example block\nforced the deeper list element to terminate.</p></li>\n</ul>\n<p>Outside all lists.</p>\n```\n"
  },
  {
    "path": "test/command/4193.md",
    "content": "```\n% pandoc -f rst -t native\n-\n a\n- b\n^D\n[ BulletList\n    [ [ Plain [ Str \"a\" ] ] , [ Plain [ Str \"b\" ] ] ]\n]\n```\n"
  },
  {
    "path": "test/command/4199.md",
    "content": "```\n% pandoc -f latex -t native\n\\foreignlanguage{ngerman}{foo}\n^D\n[ Para\n    [ Span ( \"\" , [] , [ ( \"lang\" , \"de-DE\" ) ] ) [ Str \"foo\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4208.md",
    "content": "```\n% pandoc -t latex\nWhat is a _piffle_? Mark the correct answer(s):\n\n\\begin{TAB}(@)[6pt]{|l|c|}{|c|c|c|}\n(a) a subnormal woffle                      &  $\\Box$  \\\\\n(b) an infinite-dimensional baffle          &  $\\Box$  \\\\\n(c) an inverted first-order triffle         &  $\\Box$  \\\\\n\\end{TAB}\n^D\nWhat is a \\emph{piffle}? Mark the correct answer(s):\n\n\\begin{TAB}(@)[6pt]{|l|c|}{|c|c|c|}\n(a) a subnormal woffle                      &  $\\Box$  \\\\\n(b) an infinite-dimensional baffle          &  $\\Box$  \\\\\n(c) an inverted first-order triffle         &  $\\Box$  \\\\\n\\end{TAB}\n```\n"
  },
  {
    "path": "test/command/4235.md",
    "content": "```\n% pandoc --id-prefix=foo\nThis.^[Has a footnote.]\n^D\n<p>This.<a href=\"#foofn1\" class=\"footnote-ref\" id=\"foofnref1\"\nrole=\"doc-noteref\"><sup>1</sup></a></p>\n<section id=\"foofootnotes\" class=\"footnotes footnotes-end-of-document\"\nrole=\"doc-endnotes\">\n<hr />\n<ol>\n<li id=\"foofn1\"><p>Has a footnote.<a href=\"#foofnref1\"\nclass=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</section>\n```\n"
  },
  {
    "path": "test/command/4240.md",
    "content": "```\n% pandoc -f rst -s -t native\n=====\nTitle\n=====\n\n--------\nSubtitle\n--------\n\nheader1\n=======\n\nheader2\n-------\n\n.. _id:\n\nheader3\n~~~~~~~\n\n.. _id2:\n.. _id3:\n\nheader4\n~~~~~~~\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"subtitle\" , MetaInlines [ Str \"Subtitle\" ] )\n          , ( \"title\" , MetaInlines [ Str \"Title\" ] )\n          ]\n    }\n  [ Header 1 ( \"header1\" , [] , [] ) [ Str \"header1\" ]\n  , Header 2 ( \"header2\" , [] , [] ) [ Str \"header2\" ]\n  , Header 3 ( \"id\" , [] , [] ) [ Str \"header3\" ]\n  , Header\n      3\n      ( \"id3\" , [] , [] )\n      [ Str \"header4\" , Span ( \"id2\" , [] , [] ) [] ]\n  ]\n```\n"
  },
  {
    "path": "test/command/4253.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\noop}[1]{#1}\n\\noop{\\newcommand{\\foo}[1]{#1}}\n\\foo{hi}\n^D\n[ Para [ Str \"hi\" ] ]\n```\n"
  },
  {
    "path": "test/command/4254.md",
    "content": "```\n% pandoc -f rst -t latex\n.. math::\n\n   x &= y\\\\\n   y &= z\n^D\n\\[\\begin{aligned}\nx &= y\\\\\ny &= z\n\\end{aligned}\\]\n```\n"
  },
  {
    "path": "test/command/4280.md",
    "content": "```\n% pandoc -f rst -t native\nDriver \n------\n^D\n[ Header 1 ( \"driver\" , [] , [] ) [ Str \"Driver\" ] ]\n```\n"
  },
  {
    "path": "test/command/4281.md",
    "content": "```\n% pandoc -t native\n:::: {.a}\n- ::: {.b}\n  text\n  :::\n  ::: {.c}\n  text\n  :::\n::::\n^D\n[ Div\n    ( \"\" , [ \"a\" ] , [] )\n    [ BulletList\n        [ [ Div ( \"\" , [ \"b\" ] , [] ) [ Para [ Str \"text\" ] ]\n          , Div ( \"\" , [ \"c\" ] , [] ) [ Para [ Str \"text\" ] ]\n          ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4284.md",
    "content": "```\n% pandoc -f org -t native\n#+EXCLUDE_TAGS:apple       cat   bye     dog %     \n\n* This should not appear                                              :apple:\n* NOEXPORT should appear if not specified in EXCLUDE_TAGS          :noexport:\n* This should not appear                                      :cat:hi:laptop:\n** Children of headers with excluded tags should not appear       :xylophone:\n* This should not appear                                                  :%:\n^D\n[ Header\n    1\n    ( \"noexport-should-appear-if-not-specified-in-excludetags\"\n    , []\n    , []\n    )\n    [ Str \"NOEXPORT\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"appear\"\n    , Space\n    , Str \"if\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"specified\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"EXCLUDE\"\n    , Subscript [ Str \"TAGS\" ]\n    , Space\n    , Span\n        ( \"\" , [ \"tag\" ] , [ ( \"tag-name\" , \"noexport\" ) ] )\n        [ SmallCaps [ Str \"noexport\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f org -t native\n#+EXCLUDE_TAGS:elephant\n* This should not appear                                           :elephant:\n* This should appear                                                   :fawn:\n^D\n[ Header\n    1\n    ( \"this-should-appear\" , [] , [] )\n    [ Str \"This\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"appear\"\n    , Space\n    , Span\n        ( \"\" , [ \"tag\" ] , [ ( \"tag-name\" , \"fawn\" ) ] )\n        [ SmallCaps [ Str \"fawn\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f org -t native\n#+EXCLUDE_TAGS: giraffe\n#+EXCLUDE_TAGS: hippo\n* This should not appear                                            :giraffe:\n* This should not appear                                              :hippo:\n* This should appear                                               :noexport:\n^D\n[ Header\n    1\n    ( \"this-should-appear\" , [] , [] )\n    [ Str \"This\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"appear\"\n    , Space\n    , Span\n        ( \"\" , [ \"tag\" ] , [ ( \"tag-name\" , \"noexport\" ) ] )\n        [ SmallCaps [ Str \"noexport\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f org -t native\n#+EXCLUDE_TAGS:\n* NOEXPORT should appear if not specified in EXCLUDE_TAGS          :noexport:\n^D\n[ Header\n    1\n    ( \"noexport-should-appear-if-not-specified-in-excludetags\"\n    , []\n    , []\n    )\n    [ Str \"NOEXPORT\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"appear\"\n    , Space\n    , Str \"if\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"specified\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"EXCLUDE\"\n    , Subscript [ Str \"TAGS\" ]\n    , Space\n    , Span\n        ( \"\" , [ \"tag\" ] , [ ( \"tag-name\" , \"noexport\" ) ] )\n        [ SmallCaps [ Str \"noexport\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4306.md",
    "content": "```\n% pandoc -f latex -t native\n\\documentclass{article}\n\\usepackage{hyperref}\n\\begin{document}\nThe file id is \\nolinkurl{ESP_123_5235}.\n\\end{document}\n^D\n[ Para\n    [ Str \"The\"\n    , Space\n    , Str \"file\"\n    , Space\n    , Str \"id\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Code ( \"\" , [] , [] ) \"ESP_123_5235\"\n    , Str \".\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4320.md",
    "content": "```\n% pandoc -f native -t rst --wrap=none\n[Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 0.3)\n ,(AlignDefault,ColWidth 0.3)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"one\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"two\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"ports\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [BlockQuote\n     [Para [Strong [Str \"thisIsGoingToBeTooLongAnyway\"]]]]]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n+--------------------+-------------------------------------+\n| one                | two                                 |\n+====================+=====================================+\n| ports              |    **thisIsGoingToBeTooLongAnyway** |\n+--------------------+-------------------------------------+\n```\n"
  },
  {
    "path": "test/command/4374.md",
    "content": "```\n% pandoc -f latex -t native\n\\cite{a%\n}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"a\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline (Format \"latex\") \"\\\\cite{a%\\n}\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4382.md",
    "content": "```\n% pandoc -f rst -t native\n-\n\n=====\n^D\n[ BulletList [ [] ] , HorizontalRule ]\n```\n"
  },
  {
    "path": "test/command/4420.md",
    "content": "```\n% pandoc -f native -t rst\n[Para [Image (\"\",[\"align-right\"],[(\"width\",\"100px\")]) [Str \"image\"] (\"foo.png\",\"fig:test\")]]\n^D\n|image|\n\n.. |image| image:: foo.png\n   :width: 100px\n```\n"
  },
  {
    "path": "test/command/4424.md",
    "content": "```\n% pandoc -f latex -t native\n\\documentclass{article}\n\\usepackage[sortlocale=en_GB]{biblatex}\n\\begin{document}\nTest\n\\end{document}\n^D\n[ Para [ Str \"Test\" ] ]\n```\n"
  },
  {
    "path": "test/command/4442.md",
    "content": "```\n% pandoc -f markdown -t latex\n\\newcommand{\\myFruit}{Mango\\xspace}\n\\myFruit is the king of fruits.\n^D\n\\newcommand{\\myFruit}{Mango\\xspace}\n\nMango is the king of fruits.\n```\n"
  },
  {
    "path": "test/command/4454.md",
    "content": "```\n% pandoc -f rst -t native\n• a\n• b\n^D\n[ BulletList\n    [ [ Plain [ Str \"a\" ] ] , [ Plain [ Str \"b\" ] ] ]\n]\n```\n"
  },
  {
    "path": "test/command/4465.md",
    "content": "```\n% pandoc -f html -t markdown\n<ol>\n  <li>An ordered list can contain block-level elements ind html, it means that divs are also allowed.</li>\n  <li>Let's see the problem! <div class=\"example\">This is an example.</div></li>\n</ol>\n^D\n1.  An ordered list can contain block-level elements ind html, it means\n    that divs are also allowed.\n2.  Let\\'s see the problem!\n\n    ::: example\n    This is an example.\n    :::\n```\n"
  },
  {
    "path": "test/command/4470.md",
    "content": "```\n% pandoc -r latex -w plain\n\\newcommand{\\foo}{123}\\renewcommand\\foo{456}\\foo\n^D\n456\n```\n\n```\n% pandoc -r latex -w plain\n\\newcommand\\foo{123}\\renewcommand\\foo{456}\\foo\n^D\n456\n```\n\n```\n% pandoc -r latex -w plain\n\\newcommand{\\foo}{123}\\renewcommand{\\foo}{456}\\foo\n^D\n456\n```\n\n```\n% pandoc -r latex -w plain\n\\newcommand\\foo{123}\\renewcommand{\\foo}{456}\\foo\n^D\n456\n```\n"
  },
  {
    "path": "test/command/4499.md",
    "content": "```\n% pandoc -f latex -t html\n\\mbox{abc def} ghi\n^D\n<p>abc def ghi</p>\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\mbox{abc def}\n^D\n[ Para [ RawInline (Format \"latex\") \"\\\\mbox{abc def}\" ] ]\n```\n\n```\n% pandoc -f latex -t html\nabc \\mbox{\\textit{def ghi} jkl} mno\n^D\n<p>abc <em>def ghi</em> jkl mno</p>\n```\n\n```\n% pandoc -f latex -t html\nabc \\mbox{def \\\\ ghi} jkl\n^D\n<p>abc defghi jkl</p>\n```\n\n```\n% pandoc -f latex -t html\nabc \\mbox{def\nghi}\n^D\n<p>abc def ghi</p>\n```\n\n```\n% pandoc -f latex -t html\nabc \\mbox{def \\textit{ghi \\\\ jkl}\nmno} pqr\n^D\n<p>abc def <em>ghijkl</em> mno pqr</p>\n```\n\n```\n% pandoc -f latex -t html\n\\hbox{abc def} ghi\n^D\n<p>abc def ghi</p>\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\hbox{abc def}\n^D\n[ Para [ RawInline (Format \"latex\") \"\\\\hbox{abc def}\" ] ]\n```\n\n```\n% pandoc -f latex -t html\nabc \\hbox{\\textit{def ghi} jkl} mno\n^D\n<p>abc <em>def ghi</em> jkl mno</p>\n```\n\n```\n% pandoc -f latex -t html\nabc \\hbox{def \\\\ ghi} jkl\n^D\n<p>abc defghi jkl</p>\n```\n\n```\n% pandoc -f latex -t html\nabc \\hbox{def\nghi}\n^D\n<p>abc def ghi</p>\n```\n\n```\n% pandoc -f latex -t html\nabc \\hbox{def \\textit{ghi \\\\ jkl}\nmno} pqr\n^D\n<p>abc def <em>ghijkl</em> mno pqr</p>\n```\n"
  },
  {
    "path": "test/command/4513.md",
    "content": "```\n% pandoc -f textile -t native\n|_. heading 1 |_. heading 2|\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"heading\" , Space , Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"heading\" , Space , Str \"2\" ] ]\n           ]\n       ])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/4527.md",
    "content": "This command comes through as regular text:\n```\n% pandoc -f latex+raw_tex -t native\n\\maketitle\n^D\n[ RawBlock (Format \"latex\") \"\\\\maketitle\" ]\n```\n\n\n```\n% pandoc -f latex -t native\n\\maketitle\n^D\n[]\n```\n\n```\n% pandoc -f latex -t rst\n\\maketitle\nHello.\n^D\nHello.\n```\n"
  },
  {
    "path": "test/command/4528.md",
    "content": "# Rendering small caps, superscripts and subscripts with and without `raw_html`\n\n## Small caps\n\n```\n% pandoc --wrap=none -f latex -t commonmark-raw_html\nThis has \\textsc{small caps} in it.\n^D\nThis has SMALL CAPS in it.\n```\n\n```\n% pandoc --wrap=none -f latex -t commonmark+raw_html\nThis has \\textsc{small caps} in it.\n^D\nThis has <span class=\"smallcaps\">small caps</span> in it.\n```\n\n```\n% pandoc --wrap=none -f latex -t markdown_strict+raw_html\nThis has \\textsc{small caps} in it.\n^D\nThis has <span class=\"smallcaps\">small caps</span> in it.\n```\n\n## Strikeout\n\n```\n% pandoc --wrap=none -f html -t commonmark-raw_html-strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has strikeout in it.\n```\n\n```\n% pandoc --wrap=none -f html -t commonmark+raw_html-strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has <s>strikeout</s> in it.\n```\n\n```\n% pandoc --wrap=none -f html -t commonmark-raw_html+strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has ~~strikeout~~ in it.\n```\n\n```\n% pandoc --wrap=none -f html -t commonmark+raw_html+strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has ~~strikeout~~ in it.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict-raw_html-strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has strikeout in it.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict+raw_html-strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has <s>strikeout</s> in it.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict-raw_html+strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has ~~strikeout~~ in it.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict+raw_html+strikeout\nThis has <s>strikeout</s> in it.\n^D\nThis has ~~strikeout~~ in it.\n```\n\n## Superscript\n\n```\n% pandoc --wrap=none -f html -t commonmark-raw_html\nThis has <sup>superscript</sup> in it and <sup>2 3</sup> again. With emphasis: <sup><em>2</em> 3</sup>. With letters: <sup>foo</sup>. With a span: <sup><span class=foo>2</span></sup>.\n^D\nThis has ^(superscript) in it and ² ³ again. With emphasis: ^(*2* 3). With letters: ^(foo). With a span: ².\n```\n\n```\n% pandoc --wrap=none -f html -t commonmark+raw_html\nThis has <sup>superscript</sup> in it and <sup>2</sup> again.\n^D\nThis has <sup>superscript</sup> in it and <sup>2</sup> again.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict-raw_html-superscript\nThis has <sup>superscript</sup> in it and <sup>2</sup> again.\n^D\nThis has ^(superscript) in it and ² again.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict+raw_html-superscript\nThis has <sup>superscript</sup> in it and <sup>2</sup> again.\n^D\nThis has <sup>superscript</sup> in it and <sup>2</sup> again.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict+raw_html+superscript\nThis has <sup>superscript</sup> in it and <sup>2</sup> again.\n^D\nThis has ^superscript^ in it and ^2^ again.\n```\n\n## Subscript\n\n```\n% pandoc --wrap=none -f html -t commonmark-raw_html\nThis has <sub>subscript</sub> in it and <sub>2 3</sub> again. With emphasis: <sub><em>2</em> 3</sub>. With letters: <sub>foo</sub>. With a span: <sub><span class=foo>2</span></sub>.\n^D\nThis has _(subscript) in it and ₂ ₃ again. With emphasis: _(*2* 3). With letters: _(foo). With a span: ₂.\n```\n\n```\n% pandoc --wrap=none -f html -t commonmark+raw_html\nThis has <sub>subscript</sub> in it and <sub>2</sub> again.\n^D\nThis has <sub>subscript</sub> in it and <sub>2</sub> again.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict-raw_html-subscript\nThis has <sub>subscript</sub> in it and <sub>2</sub> again.\n^D\nThis has _(subscript) in it and ₂ again.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict+raw_html-subscript\nThis has <sub>subscript</sub> in it and <sub>2</sub> again.\n^D\nThis has <sub>subscript</sub> in it and <sub>2</sub> again.\n```\n\n```\n% pandoc --wrap=none -f html -t markdown_strict+raw_html+subscript\nThis has <sub>subscript</sub> in it and <sub>2</sub> again.\n^D\nThis has ~subscript~ in it and ~2~ again.\n```\n"
  },
  {
    "path": "test/command/4529.md",
    "content": "```\n% pandoc -f latex -t plain+gutenberg\n\\chapter{First chapter}\\label{sec:chp1}\nThe next chapter is Chapter~\\ref{sec:chp2}.\n\\section{First section}\\label{sec:chp1sec1}\nThe next section is Section~\\ref{sec:chp2sec1}.\n\n\\chapter{Second chapter}\\label{sec:chp2}\nThe previous chapter is Chapter~\\ref{sec:chp1}.\n\\section{First section}\\label{sec:chp2sec1}\nThe previous section is Section~\\ref{sec:chp1sec1}.\n^D\n\n\nFIRST CHAPTER\n\n\nThe next chapter is Chapter 2.\n\n\nFirst section\n\nThe next section is Section 2.1.\n\n\n\nSECOND CHAPTER\n\n\nThe previous chapter is Chapter 1.\n\n\nFirst section\n\nThe previous section is Section 1.1.\n```\n"
  },
  {
    "path": "test/command/4545.md",
    "content": "```\n% pandoc -t asciidoc\nTest 1\n\n[my text]\n\nTest 2\n^D\nTest 1\n\n++[++my text++]++\n\nTest 2\n```\n```\n% pandoc -t asciidoc\n4\\. foo\n^D\n{empty}4. foo\n```\n"
  },
  {
    "path": "test/command/4550.md",
    "content": "```\n% pandoc -f markdown-smart -t ms\nA ‘simple’ example\n^D\n.LP\nA \\(oqsimple\\(cq example\n```\n"
  },
  {
    "path": "test/command/4553.md",
    "content": "```\n% pandoc -f latex -t native\nfoo \\include{command/bar}\n^D\n[ Para [ Str \"foo\" ]\n, Para [ Emph [ Str \"hi\" , Space , Str \"there\" ] ]\n]\n```\n\n```\n% pandoc -f latex -t native\nfoo \\input{command/bar}\n^D\n[ Para\n    [ Str \"foo\"\n    , Space\n    , Emph [ Str \"hi\" , Space , Str \"there\" ]\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/4564.md",
    "content": "```\n% pandoc -f native -t rst --list-tables\n[Table (\"\",[],[]) (Caption Nothing\n [Plain [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"caption.\"]])\n [(AlignDefault,ColWidth 0.1527777777777778)\n ,(AlignDefault,ColWidth 0.1388888888888889)\n ,(AlignDefault,ColWidth 0.16666666666666666)\n ,(AlignDefault,ColWidth 0.375)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Centered\",SoftBreak,Str \"Header\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Left\",SoftBreak,Str \"Aligned\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Right\",SoftBreak,Str \"Aligned\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Default\",Space,Str \"aligned\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"First\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain []]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12.0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Example\",Space,Str \"of\",Space,Str \"a\",Space,Str \"row\",Space,Str \"that\",SoftBreak,Str \"spans\",Space,Str \"multiple\",Space,Str \"lines.\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Second\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"row\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5.0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Here\\8217s\",Space,Str \"another\",Space,Str \"one.\",Space,Str \"Note\",SoftBreak,Str \"the\",Space,Str \"blank\",Space,Str \"line\",Space,Str \"between\",SoftBreak,Str \"rows.\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n.. list-table:: Here is a caption.\n   :widths: 11 10 12 27\n   :header-rows: 1\n\n   * - Centered Header\n     - Left Aligned\n     - Right Aligned\n     - Default aligned\n   * - First\n     - \n     - 12.0\n     - Example of a row that spans multiple lines.\n   * - Second\n     - row\n     - 5.0\n     - Here’s another one. Note the blank line between rows.\n```\n"
  },
  {
    "path": "test/command/4576.md",
    "content": "```\n% pandoc -f latex -t native\n$\\rho_\\text{D$_2$O}=866$\n^D\n[ Para [ Math InlineMath \"\\\\rho_\\\\text{D$_2$O}=866\" ] ]\n```\n"
  },
  {
    "path": "test/command/4578.md",
    "content": "```\n% pandoc -t markdown\n  ------ ------- --------------- ---------------------\n  One    row                12.0 Example of a row that\n                                 spans multiple lines.\n\n  ------ ------- --------------- ---------------------\n^D\n  ------ ------- --------------- ---------------------\n  One    row                12.0 Example of a row that\n                                 spans multiple lines.\n\n  ------ ------- --------------- ---------------------\n```\n"
  },
  {
    "path": "test/command/4579.md",
    "content": "```\n% pandoc -f rst -t native\n.. list-table::\n  :header-rows: 1\n\n  * - Foo\n    - Bar\n  * - spam\n    - ham\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Foo\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Bar\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"spam\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"ham\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/4589.md",
    "content": "```\n% pandoc -f markdown -t latex\n\\newcommand{\\one}[1]{#1}\n\\newcommand{\\two}[1]{#1}\n\nFormatting *is* working **here**. But sticking \\one{two }\\two{commands}\ntogether *breaks* formatting.\n^D\n\\newcommand{\\one}[1]{#1}\n\\newcommand{\\two}[1]{#1}\n\nFormatting \\emph{is} working \\textbf{here}. But sticking two commands\ntogether \\emph{breaks} formatting.\n```\n"
  },
  {
    "path": "test/command/4594.md",
    "content": "```\n% pandoc -f markdown -t latex\nSome **bold** text here.\n\n\\begin{figure}[htbp]\n\\centering\n\\def\\svgwidth{\\columnwidth}\n\\import{img/}{vectors.pdf_tex}\n\\caption{Some caption.}\n\\end{figure}\n\nSome *italic* text here.\n^D\nSome \\textbf{bold} text here.\n\n\\begin{figure}[htbp]\n\\centering\n\\def\\svgwidth{\\columnwidth}\n\\import{img/}{vectors.pdf_tex}\n\\caption{Some caption.}\n\\end{figure}\n\nSome \\emph{italic} text here.\n```\n"
  },
  {
    "path": "test/command/4598.md",
    "content": "```\n% pandoc -f rst\n`x`__\n\n__ `xy`_\n\n.. _`xy`: http://xy.org\n^D\n<p><a href=\"http://xy.org\">x</a></p>\n```\n"
  },
  {
    "path": "test/command/4624.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{Verbatim}[key1=value1]\ncode1\n\n\\end{Verbatim}\n\n\n\\begin{lstlisting}[key2=value2]\ncode2\n  \n\\end{lstlisting}\n\n\\begin{verbatim}\ncode3\n\\end{verbatim}\n\n\\begin{verbatim}\ncode4\n    \\end{verbatim}\n\n\\begin{verbatim}\ncode5\\end{verbatim}\n^D\n[ CodeBlock\n    ( \"\" , [] , [ ( \"key1\" , \"value1\" ) ] ) \"code1\\n\"\n, CodeBlock\n    ( \"\" , [] , [ ( \"key2\" , \"value2\" ) ] ) \"code2\\n  \"\n, CodeBlock ( \"\" , [] , [] ) \"code3\"\n, CodeBlock ( \"\" , [] , [] ) \"code4\"\n, CodeBlock ( \"\" , [] , [] ) \"code5\"\n]\n```\n"
  },
  {
    "path": "test/command/4635.md",
    "content": "```\n% pandoc -f markdown -t native\n(cf.\nfoo)\n^D\n[ Para [ Str \"(cf.\" , SoftBreak , Str \"foo)\" ] ]\n```\n\n```\n% pandoc -f markdown -t native\na (cf.\nfoo)\n^D\n[ Para\n    [ Str \"a\" , Space , Str \"(cf.\" , SoftBreak , Str \"foo)\" ]\n]\n```\n\n```\n% pandoc -f markdown -t native\ncf.\nfoo\n^D\n[ Para [ Str \"cf.\" , SoftBreak , Str \"foo\" ] ]\n```\n\n```\n% pandoc -f markdown -t native\na cf.\nfoo\n^D\n[ Para\n    [ Str \"a\" , Space , Str \"cf.\" , SoftBreak , Str \"foo\" ]\n]\n```\n"
  },
  {
    "path": "test/command/4637.md",
    "content": "```\n% pandoc -t latex\nmore \\indextext{dogs}' than \\indextext{cats}'\n^D\nmore \\indextext{dogs}' than \\indextext{cats}'\n```\n"
  },
  {
    "path": "test/command/4639.md",
    "content": "```\n% pandoc -t html --mathjax\n\\begin{equation}\n  E=mc^2\n\\end{equation}\n^D\n<p><span class=\"math display\">\\[\\begin{equation}\n  E=mc^2\n\\end{equation}\\]</span></p>\n```\n"
  },
  {
    "path": "test/command/4653.md",
    "content": "```\n% pandoc -t latex\n\\let\\tex\\TeX\n\\renewcommand{\\TeX}{\\tex\\xspace}\n^D\n\\let\\tex\\TeX\n\\renewcommand{\\TeX}{\\tex\\xspace}\n```\n"
  },
  {
    "path": "test/command/4667.md",
    "content": "```\n% pandoc -t latex\n---\nheader-includes:\n- \\newcommand{\\blandscape}{\\begin{landscape}}\n- \\newcommand{\\elandscape}{\\end{landscape}}\n...\n\n\\blandscape\n\ntesting\n\n\\elandscape\n^D\n\\begin{landscape}\n\ntesting\n\n\\end{landscape}\n```\n"
  },
  {
    "path": "test/command/4669.md",
    "content": "```\n% pandoc -f latex -t native\n{\\tt <-}\n\n\\begin{verbatim}\n  while (n > 0) {\n\\end{verbatim}\n^D\n[ Para\n    [ Span ( \"\" , [] , [] ) [ Code ( \"\" , [] , [] ) \"<-\" ] ]\n, CodeBlock ( \"\" , [] , [] ) \"  while (n > 0) {\"\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{itemize}\n\\item<1> one\n\\item<2-3,5> two\n\\item<2| @alert> three\n\\item<handout> four\n\\item<beamer:2> five\n\\end{itemize}\n^D\n[ BulletList\n    [ [ Para [ Str \"one\" ] ]\n    , [ Para [ Str \"two\" ] ]\n    , [ Para [ Str \"three\" ] ]\n    , [ Para [ Str \"four\" ] ]\n    , [ Para [ Str \"five\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4677.md",
    "content": "```\n% pandoc --to \"markdown-bracketed_spans-fenced_divs-link_attributes-simple_tables-multiline_tables-grid_tables-pipe_tables-fenced_code_attributes-markdown_in_html_blocks-table_captions-smart\"\n![Caption](img.png){#img:1}\n^D\n<figure id=\"img:1\">\n<img src=\"img.png\" alt=\"Caption\" />\n<figcaption aria-hidden=\"true\">Caption</figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/4690.md",
    "content": "```\n% pandoc -t beamer\n# title\n\n:::: {.columns}\n::: {.column width=\"8%\"}\ncontent\n:::\n::: {.column width=\"84%\"}\ncontent2\n:::\n::::\n^D\n\\begin{frame}{title}\n\\protect\\phantomsection\\label{title}\n\\begin{columns}[T]\n\\begin{column}{0.08\\linewidth}\ncontent\n\\end{column}\n\n\\begin{column}{0.84\\linewidth}\ncontent2\n\\end{column}\n\\end{columns}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/4715.md",
    "content": "```\n% pandoc -f rst -t native\n.. toctree::\n   :name: tree1\n   :class: foo bar\n   :caption: Indice dei contenuti\n   :numbered:\n   :maxdepth: 3\n\n   premessa.rst\n   acquisizione-software.rst\n   riuso-software.rst\n^D\n[ Div\n    ( \"tree1\"\n    , [ \"toctree\" , \"foo\" , \"bar\" ]\n    , [ ( \"caption\" , \"Indice dei contenuti\" )\n      , ( \"numbered\" , \"\" )\n      , ( \"maxdepth\" , \"3\" )\n      ]\n    )\n    [ Para\n        [ Str \"premessa.rst\"\n        , SoftBreak\n        , Str \"acquisizione-software.rst\"\n        , SoftBreak\n        , Str \"riuso-software.rst\"\n        ]\n    ]\n]\n ```\n"
  },
  {
    "path": "test/command/4722.md",
    "content": "```\n% pandoc -f tikiwiki -t native\n*Level 1\n*Level 1\n**Level 2\n***Level 3\n*Level 1\n^D\n[ BulletList\n    [ [ Plain [ Str \"Level\" , Space , Str \"1\" ] ]\n    , [ Plain [ Str \"Level\" , Space , Str \"1\" ]\n      , BulletList\n          [ [ Plain [ Str \"Level\" , Space , Str \"2\" ]\n            , BulletList [ [ Plain [ Str \"Level\" , Space , Str \"3\" ] ] ]\n            ]\n          ]\n      ]\n    , [ Plain [ Str \"Level\" , Space , Str \"1\" ] ]\n    ]\n]\n```\n```\n% pandoc -f tikiwiki -t native\n#Level 1\n#Level 1\n##Level 2\n###Level 3\n#Level 1\n^D\n[ OrderedList\n    ( 1 , DefaultStyle , DefaultDelim )\n    [ [ Plain [ Str \"Level\" , Space , Str \"1\" ] ]\n    , [ Plain [ Str \"Level\" , Space , Str \"1\" ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Plain [ Str \"Level\" , Space , Str \"2\" ]\n            , OrderedList\n                ( 1 , DefaultStyle , DefaultDelim )\n                [ [ Plain [ Str \"Level\" , Space , Str \"3\" ] ] ]\n            ]\n          ]\n      ]\n    , [ Plain [ Str \"Level\" , Space , Str \"1\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4742.md",
    "content": "Check that the commonmark reader handles the `ascii_identifiers`\nextension properly.\n\n```\n% pandoc -f commonmark+gfm_auto_identifiers+ascii_identifiers -t native\n# non ascii ⚠️ räksmörgås\n^D\n[ Header\n    1\n    ( \"non-ascii-warning-raksmorgas\" , [] , [] )\n    [ Str \"non\"\n    , Space\n    , Str \"ascii\"\n    , Space\n    , Str \"\\9888\\65039\"\n    , Space\n    , Str \"r\\228ksm\\246rg\\229s\"\n    ]\n]\n```\n\nNote that the emoji here is actually a composite character,\nformed from \\9888 and \\65039. The latter is a combining mark,\nso it survives...\n\n```\n% pandoc -f commonmark+gfm_auto_identifiers-ascii_identifiers -t native\n# non ascii ⚠️ räksmörgås\n^D\n[ Header\n    1\n    ( \"non-ascii-warning-r\\228ksm\\246rg\\229s\" , [] , [] )\n    [ Str \"non\"\n    , Space\n    , Str \"ascii\"\n    , Space\n    , Str \"\\9888\\65039\"\n    , Space\n    , Str \"r\\228ksm\\246rg\\229s\"\n    ]\n]\n```\n\n`gfm` should have `ascii_identifiers` disabled by default.\n\n```\n% pandoc -f gfm -t native\n# non ascii ⚠️ räksmörgås\n^D\n[ Header\n    1\n    ( \"non-ascii-warning-r\\228ksm\\246rg\\229s\" , [] , [] )\n    [ Str \"non\"\n    , Space\n    , Str \"ascii\"\n    , Space\n    , Str \"\\9888\\65039\"\n    , Space\n    , Str \"r\\228ksm\\246rg\\229s\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4743.md",
    "content": "Test that emojis are wrapped in Span\n\n```\n% pandoc -f commonmark+emoji -t native\nMy:thumbsup:emoji:heart:\n^D\n[ Para\n    [ Str \"My\"\n    , Span\n        ( \"\" , [ \"emoji\" ] , [ ( \"data-emoji\" , \"thumbsup\" ) ] )\n        [ Str \"\\128077\" ]\n    , Str \"emoji\"\n    , Span\n        ( \"\" , [ \"emoji\" ] , [ ( \"data-emoji\" , \"heart\" ) ] )\n        [ Str \"\\10084\\65039\" ]\n    ]\n]\n```\n\n```\n% pandoc -f markdown+emoji -t native\nMy:thumbsup:emoji:heart:\n^D\n[ Para\n    [ Str \"My\"\n    , Span\n        ( \"\" , [ \"emoji\" ] , [ ( \"data-emoji\" , \"thumbsup\" ) ] )\n        [ Str \"\\128077\" ]\n    , Str \"emoji\"\n    , Span\n        ( \"\" , [ \"emoji\" ] , [ ( \"data-emoji\" , \"heart\" ) ] )\n        [ Str \"\\10084\\65039\" ]\n    ]\n]\n```\n\n```\n% pandoc -f commonmark+emoji -t html\n:zero: header\n=============\nMy:thumbsup:emoji:heart:x :hearts: xyz\n^D\n<h1><span class=\"emoji\" data-emoji=\"zero\">0️⃣</span> header</h1>\n<p>My<span class=\"emoji\" data-emoji=\"thumbsup\">👍</span>emoji<span\nclass=\"emoji\" data-emoji=\"heart\">❤️</span>x <span class=\"emoji\"\ndata-emoji=\"hearts\">♥️</span> xyz</p>\n```\n"
  },
  {
    "path": "test/command/4746.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{tabular}{c c}\n  \\begin{tabular}{c} a \\\\ \\end{tabular}\n  &\n  \\\\\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Table\n                    ( \"\" , [] , [] )\n                    (Caption Nothing [])\n                    [ ( AlignCenter , ColWidthDefault ) ]\n                    (TableHead ( \"\" , [] , [] ) [])\n                    [ TableBody\n                        ( \"\" , [] , [] )\n                        (RowHeadColumns 0)\n                        []\n                        [ Row\n                            ( \"\" , [] , [] )\n                            [ Cell\n                                ( \"\" , [] , [] )\n                                AlignDefault\n                                (RowSpan 1)\n                                (ColSpan 1)\n                                [ Plain [ Str \"a\" ] ]\n                            ]\n                        ]\n                    ]\n                    (TableFoot ( \"\" , [] , [] ) [])\n                ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/4748.md",
    "content": "```\n% pandoc -f org -t rst\nBefore example block.\n#+begin_example\nThis is in an example block.\n#+end_example\nAfter example block.\n^D\nBefore example block.\n\n::\n\n   This is in an example block.\n\nAfter example block.\n```\n"
  },
  {
    "path": "test/command/4768.md",
    "content": "```\n% pandoc -f latex -t plain\n\\def\\foo#1!#2!#3{#1 or #2 and #3}\n\\foo aa!bbb bbb!{ccc}\n^D\naa or bbb bbb and ccc\n```\n"
  },
  {
    "path": "test/command/4781.md",
    "content": "```\n% pandoc -t native\nMarkdown parsed *here*\n\n\\include{command/bar}\n\n*But not here*\n^D\n[ Para\n    [ Str \"Markdown\"\n    , Space\n    , Str \"parsed\"\n    , Space\n    , Emph [ Str \"here\" ]\n    ]\n, RawBlock (Format \"tex\") \"\\\\include{command/bar}\"\n, Para\n    [ Emph\n        [ Str \"But\" , Space , Str \"not\" , Space , Str \"here\" ]\n    ]\n]\n```\n\n```\n% pandoc -t native\n*here* \\input{command/bar}\n\n*But not here*\n^D\n[ Para\n    [ Emph [ Str \"here\" ]\n    , Space\n    , RawInline (Format \"tex\") \"\\\\input{command/bar}\"\n    ]\n, Para\n    [ Emph\n        [ Str \"But\" , Space , Str \"not\" , Space , Str \"here\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4794.md",
    "content": "```\n% pandoc -f markdown -t mediawiki\n| Column1 | Column2 | Column3 |\n| ------- | ------- | ------- |\n| text    |         | text    |\n^D\n{| class=\"wikitable\"\n|-\n! Column1\n! Column2\n! Column3\n|-\n| text\n|\n| text\n|}\n\n```\n"
  },
  {
    "path": "test/command/4805-beamer-columns-alignment.md",
    "content": "```\n% pandoc -t beamer\n:::: { .columns }                                \n::: { .column align=center }\n:::\n::: { .column align=bottom }\n:::\n::::\n\n:::: { .columns align=bottom .onlytextwidth }\n::: { .column align=top }\n:::\n::: { .column align=top-baseline }\n:::\n::::\n\n:::: { .columns totalwidth=7em } \n::::\n^D\n\\begin{frame}\n\\begin{columns}[T]\n\\begin{column}[c]{0.48\\linewidth}\n\\end{column}\n\n\\begin{column}[b]{0.48\\linewidth}\n\\end{column}\n\\end{columns}\n\n\\begin{columns}[b,onlytextwidth]\n\\begin{column}[T]{0.48\\linewidth}\n\\end{column}\n\n\\begin{column}[t]{0.48\\linewidth}\n\\end{column}\n\\end{columns}\n\n\\begin{columns}[T,totalwidth=7em]\n\\end{columns}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/4811.md",
    "content": "No blank lines in inline interpreted roles:\n\n```\n% pandoc -f rst -t native\n`no\n\nblank`:myrole:\n^D\n[ Para [ Str \"`no\" ] , Para [ Str \"blank`:myrole:\" ] ]\n```\n\nBackslash escape behaves properly in interpreted roles:\n\n```\n% pandoc -f rst -t native\n`hi\\ there`:sup:\n\n`hi\\ there`:code:\n^D\n[ Para [ Superscript [ Str \"hithere\" ] ]\n, Para [ Code ( \"\" , [] , [] ) \"hi\\\\ there\" ]\n]\n```\n\nBacktick followed by alphanumeric doesn't end the span:\n```\n% pandoc -f rst -t native\n`hi`there`:myrole:\n^D\n[ Para\n    [ Code\n        ( \"\" , [ \"interpreted-text\" ] , [ ( \"role\" , \"myrole\" ) ] )\n        \"hi`there\"\n    ]\n]\n```\n\nNewline is okay, as long as not blank:\n```\n% pandoc -f rst -t native\n`hi\nthere`:myrole:\n^D\n[ Para\n    [ Code\n        ( \"\" , [ \"interpreted-text\" ] , [ ( \"role\" , \"myrole\" ) ] )\n        \"hi\\nthere\"\n    ]\n]\n```\n\nUse span for title-reference:\n```\n% pandoc -f rst -t native\n`default`\n^D\n[ Para\n    [ Span ( \"\" , [ \"title-ref\" ] , [] ) [ Str \"default\" ] ]\n]\n```\n"
  },
  {
    "path": "test/command/4817.md",
    "content": "```\n% pandoc -t native -s\n---\nfoo:\n- bar: bam\n...\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"foo\"\n            , MetaList\n                [ MetaMap\n                    (fromList [ ( \"bar\" , MetaInlines [ Str \"bam\" ] ) ])\n                ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/4819.md",
    "content": "```\n% pandoc -f markdown -t native -s\n---\nfoo: 42\n...\n^D\nPandoc\n  Meta\n    { unMeta = fromList [ ( \"foo\" , MetaInlines [ Str \"42\" ] ) ]\n    }\n  []\n```\n\n```\n% pandoc -f markdown -t native -s\n---\nfoo: true\n...\n^D\nPandoc\n  Meta { unMeta = fromList [ ( \"foo\" , MetaBool True ) ] } []\n```\n\n```\n% pandoc -f markdown -t native -s\n---\nfoo: True\n...\n^D\nPandoc\n  Meta { unMeta = fromList [ ( \"foo\" , MetaBool True ) ] } []\n```\n\n```\n% pandoc -f markdown -t native -s\n---\nfoo: FALSE\n...\n^D\nPandoc\n  Meta { unMeta = fromList [ ( \"foo\" , MetaBool False ) ] }\n  []\n```\n\n```\n% pandoc -f markdown -t native -s\n---\nfoo: no\n...\n^D\nPandoc\n  Meta { unMeta = fromList [ ( \"foo\" , MetaBool False ) ] }\n  []\n```\n\n"
  },
  {
    "path": "test/command/4832.md",
    "content": "```\n% pandoc -f latex -t native\n\\url{http://example.com/foo%20bar.htm}\n^D\n[ Para\n    [ Link\n        ( \"\" , [ \"uri\" ] , [] )\n        [ Str \"http://example.com/foo%20bar.htm\" ]\n        ( \"http://example.com/foo%20bar.htm\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\url{http://example.com/foo{bar}.htm}\n^D\n[ Para\n    [ Link\n        ( \"\" , [ \"uri\" ] , [] )\n        [ Str \"http://example.com/foo{bar}.htm\" ]\n        ( \"http://example.com/foo{bar}.htm\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\href{http://example.com/foo%20bar}{Foobar}\n^D\n[ Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Str \"Foobar\" ]\n        ( \"http://example.com/foo%20bar\" , \"\" )\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/4833.md",
    "content": "```\n% pandoc -f native -t rst\n[Div (\"\",[\"warning\"],[])\n [Div (\"\",[\"title\"],[])\n  [Para [Str \"Warning\"]]\n ,Para [Str \"Hi\"]]]\n^D\n.. warning::\n\n   Hi\n```\n```\n% pandoc -f native -t rst\n[Div (\"\",[\"unknown\"],[])\n [Para [Str \"Hi\"]]]\n^D\n.. container:: unknown\n\n   Hi\n```\n"
  },
  {
    "path": "test/command/4842.md",
    "content": "```\n% pandoc -f latex -t native\n\\l\n^D\n[ Para [ Str \"\\322\" ] ]\n```\n"
  },
  {
    "path": "test/command/4845.md",
    "content": "```\n% pandoc -f html -t native\nx<a href=\"/foo\"> leading trailing space </a>x\n^D\n[ Plain\n    [ Str \"x\"\n    , Space\n    , Link\n        ( \"\" , [] , [] )\n        [ Str \"leading\"\n        , Space\n        , Str \"trailing\"\n        , Space\n        , Str \"space\"\n        ]\n        ( \"/foo\" , \"\" )\n    , Space\n    , Str \"x\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4848.md",
    "content": "```\n% pandoc -f latex -t native\n\\enquote*{hi}\n^D\n[ Para [ Quoted SingleQuote [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\foreignquote{italian}{hi}\n^D\n[ Para\n    [ Quoted\n        DoubleQuote\n        [ Span ( \"\" , [] , [ ( \"lang\" , \"it\" ) ] ) [ Str \"hi\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\hyphenquote*{italian}{hi}\n^D\n[ Para\n    [ Quoted\n        SingleQuote\n        [ Span ( \"\" , [] , [ ( \"lang\" , \"it\" ) ] ) [ Str \"hi\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nLorem ipsum\n\\blockquote{dolor sit amet}\nconsectetuer.\n^D\n[ Para [ Str \"Lorem\" , Space , Str \"ipsum\" ]\n, BlockQuote\n    [ Para\n        [ Str \"dolor\" , Space , Str \"sit\" , Space , Str \"amet\" ]\n    ]\n, Para [ Str \"consectetuer.\" ]\n]\n```\n\n```\n% pandoc -f latex -t native\nLorem ipsum\n\\blockcquote[198]{Knu86}{dolor sit amet}\nconsectetuer.\n^D\n[ Para [ Str \"Lorem\" , Space , Str \"ipsum\" ]\n, BlockQuote\n    [ Para\n        [ Str \"dolor\" , Space , Str \"sit\" , Space , Str \"amet\" ]\n    , Para\n        [ Cite\n            [ Citation\n                { citationId = \"Knu86\"\n                , citationPrefix = []\n                , citationSuffix = [ Str \"198\" ]\n                , citationMode = NormalCitation\n                , citationNoteNum = 0\n                , citationHash = 0\n                }\n            ]\n            []\n        ]\n    ]\n, Para [ Str \"consectetuer.\" ]\n]\n```\n\n```\n% pandoc -f latex -t native\nLorem ipsum\n\\foreignblockquote{italian}{dolor sit amet}\nconsectetuer.\n^D\n[ Para [ Str \"Lorem\" , Space , Str \"ipsum\" ]\n, BlockQuote\n    [ Div\n        ( \"\" , [] , [ ( \"lang\" , \"it\" ) ] )\n        [ Para\n            [ Str \"dolor\" , Space , Str \"sit\" , Space , Str \"amet\" ]\n        ]\n    ]\n, Para [ Str \"consectetuer.\" ]\n]\n```\n\n"
  },
  {
    "path": "test/command/4860.md",
    "content": "```\n% pandoc -f rst -t native\nThis is broken_.\n\n.. ***** REFERENCES FOLLOW *****\n.. _broken: http://google.com\n^D\n[ Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Link\n        ( \"\" , [] , [] )\n        [ Str \"broken\" ]\n        ( \"http://google.com\" , \"\" )\n    , Str \".\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4877.md",
    "content": "```\n% pandoc -f html -t native\nMy <script type=\"math/tex\">\\mathcal{D}</script>\n^D\n[ Plain\n    [ Str \"My\" , Space , Math InlineMath \"\\\\mathcal{D}\" ]\n]\n```\n\n```\n% pandoc -f html -t native\n<script type=\"math/tex; mode=display\">\\mathcal{D}</script>\n^D\n[ Plain [ Math DisplayMath \"\\\\mathcal{D}\" ] ]\n```\n"
  },
  {
    "path": "test/command/4880.md",
    "content": "```\n% pandoc -t latex\n$x=y%comment$\n^D\n\\(x=y%comment\n\\)\n```\n"
  },
  {
    "path": "test/command/4885.md",
    "content": "```\n% pandoc -f org -t markdown\nThis won't show the command.\nsrc_maxima[:exports none :results raw]{tex('integrate(sin((e^x)/pi),x,0,inf));} $$\\int_{0}^{\\infty }{\\sin \\left({{e^{x}}\\over{\\pi}}\\right)\\;dx}$$\n^D\nThis won\\'t show the command.\n$$\\int_{0}^{\\infty }{\\sin \\left({{e^{x}}\\over{\\pi}}\\right)\\;dx}$$\n```\n"
  },
  {
    "path": "test/command/4908.md",
    "content": "```\n% pandoc -f markdown_mmd+fancy_lists+example_lists -t native -t plain\n(@) Example one\n(@) Example two\n\nsome text\n\n(@) Example three\n^D\n(1) Example one\n(2) Example two\n\nsome text\n\n(3) Example three\n```\n"
  },
  {
    "path": "test/command/4913.md",
    "content": "```\n% pandoc -f markdown -t html\n[https://pandoc.org](https://pandoc.org)\n^D\n<p><a href=\"https://pandoc.org\">https://pandoc.org</a></p>\n```\n\n```\n% pandoc -f markdown -t markdown\n[https://pandoc.org](https://pandoc.org)\n^D\n<https://pandoc.org>\n```\n\n```\n% pandoc -f markdown -t html\n<https://pandoc.org>\n^D\n<p><a href=\"https://pandoc.org\" class=\"uri\">https://pandoc.org</a></p>\n```\n\n```\n% pandoc -f markdown -t html\n<https://pandoc.org>{.foo}\n^D\n<p><a href=\"https://pandoc.org\" class=\"foo\">https://pandoc.org</a></p>\n```\n\n```\n% pandoc -f markdown -t html\n<me@example.com>\n^D\n<p><a href=\"mailto:me@example.com\" class=\"email\">me@example.com</a></p>\n```\n"
  },
  {
    "path": "test/command/4919.md",
    "content": "```\n% pandoc -f rst -t native\n.. _`tgtmath`:\n\n  .. math::\n     :name:\n\n     V = \\frac{K}{r^2}\n^D\n[ Div\n    ( \"tgtmath\" , [] , [] )\n    [ BlockQuote\n        [ Para [ Math DisplayMath \"V = \\\\frac{K}{r^2}\" ] ]\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/4928.md",
    "content": "```\n% pandoc -f latex -t native\n\\cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"Knu86\"\n            , citationPrefix = [ Str \"Multiprenote\" , Space , Str \"23\" ]\n            , citationSuffix = [ Str \"42\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        , Citation\n            { citationId = \"Nie72\"\n            , citationPrefix = []\n            , citationSuffix =\n                [ Str \"65\" , Str \",\" , Space , Str \"multipostnote\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline\n            (Format \"latex\")\n            \"\\\\cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"Knu86\"\n            , citationPrefix = [ Str \"Multiprenote\" , Space , Str \"23\" ]\n            , citationSuffix = [ Str \"42\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        , Citation\n            { citationId = \"Nie72\"\n            , citationPrefix = []\n            , citationSuffix = [ Str \"65\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline\n            (Format \"latex\")\n            \"\\\\cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72}\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\cites()(multipostnote)[23][42]{Knu86}[65]{Nie72}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"Knu86\"\n            , citationPrefix = [ Str \"23\" ]\n            , citationSuffix = [ Str \"42\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        , Citation\n            { citationId = \"Nie72\"\n            , citationPrefix = []\n            , citationSuffix =\n                [ Str \"65\" , Str \",\" , Space , Str \"multipostnote\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline\n            (Format \"latex\")\n            \"\\\\cites()(multipostnote)[23][42]{Knu86}[65]{Nie72}\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\cites()()[23][42]{Knu86}[65]{Nie72}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"Knu86\"\n            , citationPrefix = [ Str \"23\" ]\n            , citationSuffix = [ Str \"42\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        , Citation\n            { citationId = \"Nie72\"\n            , citationPrefix = []\n            , citationSuffix = [ Str \"65\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline\n            (Format \"latex\") \"\\\\cites()()[23][42]{Knu86}[65]{Nie72}\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\cites(multipostnote)[23][42]{Knu86}[65]{Nie72}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"Knu86\"\n            , citationPrefix = [ Str \"23\" ]\n            , citationSuffix = [ Str \"42\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        , Citation\n            { citationId = \"Nie72\"\n            , citationPrefix = []\n            , citationSuffix =\n                [ Str \"65\" , Str \",\" , Space , Str \"multipostnote\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline\n            (Format \"latex\")\n            \"\\\\cites(multipostnote)[23][42]{Knu86}[65]{Nie72}\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\cites(Multiprenote)(multipostnote){Knu86}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"Knu86\"\n            , citationPrefix = [ Str \"Multiprenote\" ]\n            , citationSuffix = [ Str \",\" , Space , Str \"multipostnote\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline\n            (Format \"latex\")\n            \"\\\\cites(Multiprenote)(multipostnote){Knu86}\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}\n^D\n[ Para\n    [ Note\n        [ Para\n            [ Cite\n                [ Citation\n                    { citationId = \"Knu86\"\n                    , citationPrefix =\n                        [ Str \"Multiprenote\" , Space , Str \"23\" ]\n                    , citationSuffix = [ Str \"42\" ]\n                    , citationMode = NormalCitation\n                    , citationNoteNum = 0\n                    , citationHash = 0\n                    }\n                , Citation\n                    { citationId = \"Nie72\"\n                    , citationPrefix = []\n                    , citationSuffix =\n                        [ Str \"65\"\n                        , Str \",\"\n                        , Space\n                        , Str \"multipostnote\"\n                        ]\n                    , citationMode = NormalCitation\n                    , citationNoteNum = 0\n                    , citationHash = 0\n                    }\n                ]\n                [ RawInline\n                    (Format \"latex\")\n                    \"\\\\footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}\"\n                ]\n            , Str \".\"\n            ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4933.md",
    "content": "```\n% pandoc -f latex -t native\n\\includegraphics{lalune}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [] ) [ Str \"image\" ] ( \"lalune.jpg\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/4960.md",
    "content": "```\n% pandoc -t latex --biblatex\n[@a1;@a2;@a3]\n^D\n\\autocite{a1,a2,a3}\n```\n\n```\n% pandoc -t latex --biblatex\n@a1 [@a2;@a3]\n^D\n\\textcite{a1,a2,a3}\n```\n\n```\n% pandoc -t latex --biblatex\n[@a1, blah; @a2; see @a3]\n^D\n\\autocites[blah]{a1}{a2}[see][]{a3}\n```\n\n\n"
  },
  {
    "path": "test/command/5010.md",
    "content": "```\n% pandoc -f latex -t latex\n\\(\\left\\{ \\begin{matrix}\ny\\,\\,\\,\\, \\geqq \\,\\,\\, f\\,(\\, x\\,)\\,\\, \\\\\ny\\,\\,\\, \\leqq \\,\\,\\, g\\,(\\, x\\,)\\, \\\\\n\\end{matrix} \\right.\\ \\)\n^D\n\\(\\left\\{ \\begin{matrix}\ny\\,\\,\\,\\, \\geqq \\,\\,\\, f\\,(\\, x\\,)\\,\\, \\\\\ny\\,\\,\\, \\leqq \\,\\,\\, g\\,(\\, x\\,)\\, \\\\\n\\end{matrix} \\right.\\ \\)\n```\n\n```\n% pandoc -f markdown -t latex\n$x\\ $\n^D\n\\(x\\ \\)\n```\n\n\n"
  },
  {
    "path": "test/command/5014.md",
    "content": "```\n% pandoc -f html -t native\n<table>\n  <thead>\n    <tr>\n        <td>Name</td>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n        <td>Accounts</td>\n    </tr>\n    </tbody>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Name\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Accounts\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/5039.md",
    "content": "```\n% pandoc -f man -t plain\n.ds foo bar\n.ds bar baz\n\\*[\\*[foo]]\n^D\nbaz\n```\n\n```\n% pandoc -f man -t plain\n.ds foo [bar]\n.ds bar baz\n\\*\\*[foo]\n^D\nbaz\n```\n\n```\n% pandoc -f man -t html\n.ds B-Font B\n.ds I-Font I\n.ds R-Font R\n\\f\\*[B-Font]certtool\\fP\n^D\n<p><strong>certtool</strong></p>\n```\n"
  },
  {
    "path": "test/command/5050.md",
    "content": "```\n% pandoc -t rst\n<unknown>\nx\n^D\nx\n```\n"
  },
  {
    "path": "test/command/5053.md",
    "content": "```\n% pandoc\n—_legibility_—\n^D\n<p>—<em>legibility</em>—</p>\n```\n\n```\n% pandoc\n_filename_|_filetype_\n^D\n<p><em>filename</em>|<em>filetype</em></p>\n```\n\n"
  },
  {
    "path": "test/command/5071.md",
    "content": "```\n% pandoc -f markdown -t html --number-sections\n## First section\n\n### Subhead\n\n##### Subhead with gap\n\n## Second section\n^D\n<h2 data-number=\"1\" id=\"first-section\"><span\nclass=\"header-section-number\">1</span> First section</h2>\n<h3 data-number=\"1.1\" id=\"subhead\"><span\nclass=\"header-section-number\">1.1</span> Subhead</h3>\n<h5 data-number=\"1.1.0.1\" id=\"subhead-with-gap\"><span\nclass=\"header-section-number\">1.1.0.1</span> Subhead with gap</h5>\n<h2 data-number=\"2\" id=\"second-section\"><span\nclass=\"header-section-number\">2</span> Second section</h2>\n\n```\n\n```\n% pandoc -f markdown -t html --number-sections\n## First section\n\n### Subhead\n\n# Higher-level section\n\n## Sub\n^D\n<h2 data-number=\"0.1\" id=\"first-section\"><span\nclass=\"header-section-number\">0.1</span> First section</h2>\n<h3 data-number=\"0.1.1\" id=\"subhead\"><span\nclass=\"header-section-number\">0.1.1</span> Subhead</h3>\n<h1 data-number=\"1\" id=\"higher-level-section\"><span\nclass=\"header-section-number\">1</span> Higher-level section</h1>\n<h2 data-number=\"1.1\" id=\"sub\"><span\nclass=\"header-section-number\">1.1</span> Sub</h2>\n```\n\nFor backwards compatibility, we want it to work the old way,\ngiving numbers like 0.1, when `--number-offset` is used:\n```\n% pandoc -f markdown -t html --number-sections --number-offset=2,2,2\n## First section\n\n### Subhead\n^D\n<h2 data-number=\"2.3\" id=\"first-section\"><span\nclass=\"header-section-number\">2.3</span> First section</h2>\n<h3 data-number=\"2.3.1\" id=\"subhead\"><span\nclass=\"header-section-number\">2.3.1</span> Subhead</h3>\n\n```\n\n```\n% pandoc -f markdown -t html --number-sections --number-offset=0,2,2\n## First section\n\n### Subhead\n^D\n<h2 data-number=\"0.3\" id=\"first-section\"><span\nclass=\"header-section-number\">0.3</span> First section</h2>\n<h3 data-number=\"0.3.1\" id=\"subhead\"><span\nclass=\"header-section-number\">0.3.1</span> Subhead</h3>\n\n```\n"
  },
  {
    "path": "test/command/5072.md",
    "content": "```\n% pandoc -t latex -i\n1. one\n2. two\n^D\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  one\n\\item\n  two\n\\end{enumerate}\n```\n"
  },
  {
    "path": "test/command/5079.md",
    "content": "```\n% pandoc -f html -t native\n<table>\n<tfoot>\n</tfoot>\n<tbody>\n<tr>\n<td>Cell</td>\n</tr>\n</tbody>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/5080.md",
    "content": "```\n% pandoc -t asciidoc\n[foo *bar*]{.small .red key=val}\n^D\n[.small .red]#foo _bar_#\n```\n\n```\n% pandoc -f html -t asciidoc\n<small>SMALL</small>\n^D\n[.small]#SMALL#\n```\n"
  },
  {
    "path": "test/command/5081.md",
    "content": "```\n% pandoc -f rst\nGo to `g`_ `g <www.example.com>`_.\n^D\n<p>Go to <a href=\"www.example.com\">g</a> <a\nhref=\"www.example.com\">g</a>.</p>\n\n```\n"
  },
  {
    "path": "test/command/5099.md",
    "content": "```\n% pandoc -t native\n(@citation\n^D\n[ Para\n    [ Str \"(\"\n    , Cite\n        [ Citation\n            { citationId = \"citation\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = AuthorInText\n            , citationNoteNum = 1\n            , citationHash = 0\n            }\n        ]\n        [ Str \"@citation\" ]\n    ]\n]\n```\n\n```\n% pandoc -t native\n('asd')\n^D\n[ Para\n    [ Str \"(\" , Quoted SingleQuote [ Str \"asd\" ] , Str \")\" ]\n]\n```\n"
  },
  {
    "path": "test/command/5107.md",
    "content": "```\n% pandoc -f muse -t dokuwiki\n - foo\n   1. bar\n   - baz\n^D\n  * foo\n    - bar\n    * baz\n\n```\n```\n% pandoc -f muse -t dokuwiki\n - foo\n   1. bar\n   2. baz\n^D\n  * foo\n    - bar\n    - baz\n\n```\n\n"
  },
  {
    "path": "test/command/5116.md",
    "content": "```\n% pandoc -t latex\n![This is a figure.](img.jpg)\n\n  Right     Left     Center     Default\n-------     ------ ----------   -------\n     12     12        12            12\n    123     123       123          123\n      1     1          1             1\n\n  :  Demonstration of simple table syntax.\n^D\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={This is a figure.}]{img.jpg}}\n\\caption{This is a figure.}\n\\end{figure}\n\n\\begin{longtable}[]{@{}rlcl@{}}\n\\caption{Demonstration of simple table syntax.}\\tabularnewline\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n\n```\n\n```\n% pandoc -t latex --figure-caption-position=above --table-caption-position=above\n![This is a figure.](img.jpg)\n\n  Right     Left     Center     Default\n-------     ------ ----------   -------\n     12     12        12            12\n    123     123       123          123\n      1     1          1             1\n\n  :  Demonstration of simple table syntax.\n^D\n\\begin{figure}\n\\centering\n\\caption{This is a figure.}\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={This is a figure.}]{img.jpg}}\n\\end{figure}\n\n\\begin{longtable}[]{@{}rlcl@{}}\n\\caption{Demonstration of simple table syntax.}\\tabularnewline\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n\n```\n\n```\n% pandoc -t latex --figure-caption-position=below --table-caption-position=below\n![This is a figure.](img.jpg)\n\n  Right     Left     Center     Default\n-------     ------ ----------   -------\n     12     12        12            12\n    123     123       123          123\n      1     1          1             1\n\n  :  Demonstration of simple table syntax.\n^D\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={This is a figure.}]{img.jpg}}\n\\caption{This is a figure.}\n\\end{figure}\n\n\\begin{longtable}[]{@{}rlcl@{}}\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\tabularnewline\n\\caption{Demonstration of simple table syntax.}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n\n```\n"
  },
  {
    "path": "test/command/5119.md",
    "content": "```\n% pandoc -t docbook\nh&#x4;i\n^D\n<para>\n  hi\n</para>\n```\n\n"
  },
  {
    "path": "test/command/512.md",
    "content": "```\n% pandoc -f rst\n`click here`__ or `click here`__\n\n.. _link1: http://www.example.com/\n.. _link2: http://johnmacfarlane.net/pandoc/\n\n__ link1_\n__ link2_\n^D\n<p><a href=\"http://www.example.com/\">click here</a> or <a\nhref=\"http://johnmacfarlane.net/pandoc/\">click here</a></p>\n```\n\nMultiple indirection:\n\n```\n% pandoc -f rst\n`click here`__\n\n.. _link1: link2_\n.. _link2: http://johnmacfarlane.net/pandoc/\n\n__ link1_\n^D\n<p><a href=\"http://johnmacfarlane.net/pandoc/\">click here</a></p>\n```\n\nLoop detection:\n\n```\n% pandoc -f rst\n`click here`__\n\n.. _link1: link2_\n.. _link2: link1_\n\n__ link1_\n^D\n2> [WARNING] Circular reference 'link1' at line 8 column 1\n<p><a href=\"\">click here</a></p>\n```\n\n"
  },
  {
    "path": "test/command/5121.md",
    "content": "```\n% pandoc -f markdown -t markdown_strict\n![My caption](./my-figure.jpg){width=500px}\n\n## Header 2\n^D\n<figure>\n<img src=\"./my-figure.jpg\" width=\"500\" alt=\"My caption\" />\n<figcaption aria-hidden=\"true\">My caption</figcaption>\n</figure>\n\n## Header 2\n```\n"
  },
  {
    "path": "test/command/5128.md",
    "content": "```\n% pandoc -f org -t rst --columns=78\n| Option | Meaning                                                                                                                                                                                                    |\n|--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| =<=    | Left alignment, additional characters are added to the right (default for string).                                                                                                                         |\n| =>=     | Right alignment, additional characters are added to the left.                                                                                                                                              |\n| =^=     | Centered , the same amount of characters is added to the left and the right.                                                                                                                               |\n| ===      | Padding. If a numeric value is printed with a sign, then additional characters are added after the sign. Otherwise it behaves like \"=>=\". This option is only available for numbers (default for numbers). |\n^D\n+--------+-------------------------------------------------------------------+\n| Option | Meaning                                                           |\n+========+===================================================================+\n| ``<``  | Left alignment, additional characters are added to the right      |\n|        | (default for string).                                             |\n+--------+-------------------------------------------------------------------+\n| ``>``  | Right alignment, additional characters are added to the left.     |\n+--------+-------------------------------------------------------------------+\n| ``^``  | Centered , the same amount of characters is added to the left and |\n|        | the right.                                                        |\n+--------+-------------------------------------------------------------------+\n| ``=``  | Padding. If a numeric value is printed with a sign, then          |\n|        | additional characters are added after the sign. Otherwise it      |\n|        | behaves like \"``>``\". This option is only available for numbers   |\n|        | (default for numbers).                                            |\n+--------+-------------------------------------------------------------------+\n```\n"
  },
  {
    "path": "test/command/5177.md",
    "content": "This should not give a \"Prelude.read: no parse\" error:\n\n```\n% pandoc -M foo=1e -s -t markdown\nhi\n^D\n---\nfoo: 1e\n---\n\nhi\n```\n"
  },
  {
    "path": "test/command/5178.md",
    "content": "```\n% pandoc -f rst -t org\n.. code:: haskell\n   :number-lines: 42\n\n   main = putStrLn \"Hello World!\"\n   unsafePerformIO main\n^D\n#+begin_src haskell -n 42\nmain = putStrLn \"Hello World!\"\nunsafePerformIO main\n#+end_src\n```\n\n```\n% pandoc -f org -t native\n#+begin_src lisp -n 20\n  (+ 1 1)\n#+end_src\n\n#+begin_src lisp +n 10\n  (+ 2 2)\n#+end_src\n^D\n[ CodeBlock\n    ( \"\"\n    , [ \"commonlisp\" , \"numberLines\" ]\n    , [ ( \"org-language\" , \"lisp\" ) , ( \"startFrom\" , \"20\" ) ]\n    )\n    \"(+ 1 1)\\n\"\n, CodeBlock\n    ( \"\"\n    , [ \"commonlisp\" , \"numberLines\" , \"continuedSourceBlock\" ]\n    , [ ( \"org-language\" , \"lisp\" ) , ( \"startFrom\" , \"10\" ) ]\n    )\n    \"(+ 2 2)\\n\"\n]\n```\n\n```\n% pandoc -f native -t org\n[CodeBlock (\"\",[\"commonlisp\",\"numberLines\"],[(\"org-language\",\"lisp\"),(\"startFrom\",\"20\")]) \"(+ 1 1)\\n\"\n,CodeBlock (\"\",[\"commonlisp\",\"numberLines\",\"continuedSourceBlock\"],[(\"org-language\",\"lisp\"),(\"startFrom\",\"10\")]) \"(+ 2 2)\\n\"]\n^D\n#+begin_src lisp -n 20\n(+ 1 1)\n#+end_src\n\n#+begin_src lisp +n 10\n(+ 2 2)\n#+end_src\n```\n"
  },
  {
    "path": "test/command/5182.md",
    "content": "```\n% pandoc -f rst -t native\n.. include:: command/5182.txt\n^D\n[ CodeBlock\n    ( \"\" , [ \"python\" , \"numberLines\" ] , [] )\n    \"def func(x):\\n  return y\"\n]\n```\n"
  },
  {
    "path": "test/command/5182.txt",
    "content": ".. code::python\n   :number-lines:\n\n  def func(x):\n    return y\n"
  },
  {
    "path": "test/command/5195.md",
    "content": "```\n% pandoc -f markdown_strict -t gfm+hard_line_breaks\nHello\nthere\n^D\nHello there\n```\n"
  },
  {
    "path": "test/command/5233.md",
    "content": "```\n% pandoc -f latex -t plain\nfoo\n\\endinput\nbar\n^D\nfoo\n```\n\n"
  },
  {
    "path": "test/command/5241.md",
    "content": "```\n% pandoc -f markdown -t html5\n<textarea>\n one\n  *two*\n</textarea>\n^D\n<textarea>\n one\n  *two*\n</textarea>\n```\n"
  },
  {
    "path": "test/command/5271.md",
    "content": "```\n% pandoc -f markdown -t native -s\n---\nabstract: |\n  This is the abstract.\n\n  It consists of two paragraphs.\n...\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"abstract\"\n            , MetaBlocks\n                [ Para\n                    [ Str \"This\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"abstract.\"\n                    ]\n                , Para\n                    [ Str \"It\"\n                    , Space\n                    , Str \"consists\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"two\"\n                    , Space\n                    , Str \"paragraphs.\"\n                    ]\n                ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/5285.md",
    "content": "```\n% pandoc -t native\n- a\n\n  b\n- a\n\n- b\n^D\n[ BulletList\n    [ [ Para [ Str \"a\" ] , Para [ Str \"b\" ] ]\n    , [ Para [ Str \"a\" ] ]\n    , [ Para [ Str \"b\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -t native\n- foo\n\n  foo\n- foo\n\n  > foo\n^D\n[ BulletList\n    [ [ Para [ Str \"foo\" ] , Para [ Str \"foo\" ] ]\n    , [ Para [ Str \"foo\" ] , BlockQuote [ Para [ Str \"foo\" ] ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/5304.md",
    "content": "````\n% pandoc -f markdown -t markdown\n``` {.markdown}\n`«sträng»`\n\n`` «sträng» ``\n\n``` «sträng» ```\n\n````«sträng»````\n... \n```\n^D\n``` markdown\n`«sträng»`\n\n`` «sträng» ``\n\n``` «sträng» ```\n\n````«sträng»````\n... \n```\n````\n"
  },
  {
    "path": "test/command/5321.md",
    "content": "```\n% pandoc -f jats -t native\n<fig id=\"fig-1\">\n  <caption>\n    <p>bar</p>\n  </caption>\n  <graphic xlink:href=\"foo.png\">\n    <alt-text>baz</alt-text>\n  </graphic>\n</fig>\n^D\n[ Figure\n    ( \"fig-1\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"bar\" ] ])\n    [ Para\n        [ Image ( \"\" , [] , [] ) [ Str \"baz\" ] ( \"foo.png\" , \"\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<fig id=\"fig-1\">\n  <caption>\n    <title>foo</title>\n    <p>bar</p>\n  </caption>\n    <graphic xlink:href=\"foo.png\">\n      <alt-text>baz</alt-text>\n    </graphic>\n</fig>\n^D\n[ Figure\n    ( \"fig-1\" , [] , [] )\n    (Caption\n       Nothing [ Plain [ Str \"foo\" , LineBreak , Str \"bar\" ] ])\n    [ Para\n        [ Image ( \"\" , [] , [] ) [ Str \"baz\" ] ( \"foo.png\" , \"\" ) ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/5340.md",
    "content": "```\n% pandoc -f html -t latex --wrap=preserve\n<a href=\"https://example.com/foo-bar\">https://example.com/foo-bar</a>\n<a href=\"https://example.com/foo--bar\">https://example.com/foo--bar</a>\n<a href=\"https://example.com/foo%2Dbar\">https://example.com/foo-bar</a>\n<a href=\"https://example.com/foo%2D%2Dbar\">https://example.com/foo--bar</a>\n<a href=\"https://example.com/foo%2D%2Dbar\">https://example.com/foo%2D%2Dbar</a>\n^D\n\\url{https://example.com/foo-bar}\n\\url{https://example.com/foo--bar}\n\\url{https://example.com/foo\\%2Dbar}\n\\url{https://example.com/foo\\%2D\\%2Dbar}\n\\url{https://example.com/foo\\%2D\\%2Dbar}\n```\n"
  },
  {
    "path": "test/command/5360.md",
    "content": "```\n% pandoc -t native\n::: {.foo}\n<table>\n <tr>\n  <td>hi</td>\n </tr>\n</table>\n:::\n^D\n[ Div\n    ( \"\" , [ \"foo\" ] , [] )\n    [ RawBlock (Format \"html\") \"<table>\"\n    , RawBlock (Format \"html\") \"<tr>\"\n    , RawBlock (Format \"html\") \"<td>\"\n    , Plain [ Str \"hi\" ]\n    , RawBlock (Format \"html\") \"</td>\"\n    , RawBlock (Format \"html\") \"</tr>\"\n    , RawBlock (Format \"html\") \"</table>\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/5367.md",
    "content": "```\n% pandoc -t latex\nhello[^1]\n\n: Sample table.[^2]\n\n-----------\n Fruit[^3]\n-----------\n Bans[^4]\n-----------\n\ndolly[^5]\n\n[^1]: doc footnote\n[^2]: caption footnote\n[^3]: header footnote\n[^4]: table cell footnote\n[^5]: doc footnote\n^D\nhello\\footnote{doc footnote}\n\n\\begin{longtable}[]{@{}\n  >{\\centering\\arraybackslash}p{(\\linewidth - 0\\tabcolsep) * \\real{0.1667}}@{}}\n\\caption[Sample table.]{Sample table.\\footnote{caption footnote}}\\tabularnewline\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nFruit\\footnote{header footnote}\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nFruit{}\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\nBans\\footnote{table cell footnote} \\\\\n\\end{longtable}\n\ndolly\\footnote{doc footnote}\n```\n"
  },
  {
    "path": "test/command/5368.md",
    "content": "```\n% pandoc -t native\n1. foo\n\n    ![bar](bar.png)\n2. foo2\n\n    ![bar2](bar2.png)\n3. foo3\n\n    ![foo3](foo3.png)\n\nQuux.\n^D\n[ OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Para [ Str \"foo\" ]\n      , Figure\n          ( \"\" , [] , [] )\n          (Caption Nothing [ Plain [ Str \"bar\" ] ])\n          [ Plain\n              [ Image ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"bar.png\" , \"\" )\n              ]\n          ]\n      ]\n    , [ Para [ Str \"foo2\" ]\n      , Figure\n          ( \"\" , [] , [] )\n          (Caption Nothing [ Plain [ Str \"bar2\" ] ])\n          [ Plain\n              [ Image\n                  ( \"\" , [] , [] ) [ Str \"bar2\" ] ( \"bar2.png\" , \"\" )\n              ]\n          ]\n      ]\n    , [ Para [ Str \"foo3\" ]\n      , Figure\n          ( \"\" , [] , [] )\n          (Caption Nothing [ Plain [ Str \"foo3\" ] ])\n          [ Plain\n              [ Image\n                  ( \"\" , [] , [] ) [ Str \"foo3\" ] ( \"foo3.png\" , \"\" )\n              ]\n          ]\n      ]\n    ]\n, Para [ Str \"Quux.\" ]\n]\n```\n"
  },
  {
    "path": "test/command/5369.md",
    "content": "```\n% pandoc -f native -t markdown\n[Div (\"\",[],[(\"tags\",\"[\\\"o\\\\ne\\\",\\\"two\\\"]\")]) [] ]\n^D\n::: {tags=\"[\\\"o\\\\ne\\\",\\\"two\\\"]\"}\n:::\n```\n"
  },
  {
    "path": "test/command/5407.md",
    "content": "```\n% pandoc -t latex --wrap=preserve\nhi there?“\nhi there!“\nhi there?‘\nhi there!‘\nhi there!\n^D\nhi there?{\\kern0pt}``\nhi there!{\\kern0pt}``\nhi there?{\\kern0pt}`\nhi there!{\\kern0pt}`\nhi there!\n```\n"
  },
  {
    "path": "test/command/5410.md",
    "content": "```\n% pandoc -f man -t native\n.ie n \\{\\\n'br\\}\n^D\n[ Para [ LineBreak ] ]\n```\n"
  },
  {
    "path": "test/command/5416.md",
    "content": "```\n% pandoc -f dokuwiki -t native\n{\n^D\n[ Para [ Str \"{\" ] ]\n```\n\n```\n% pandoc -f dokuwiki -t native\n{{\n^D\n[ Para [ Str \"{{\" ] ]\n```\n"
  },
  {
    "path": "test/command/5420.md",
    "content": "```\n% pandoc --syntax-highlighting=idiomatic -t latex\n`int a = 1;`{.cpp style=cpp}\n^D\n\\passthrough{\\lstinline[language={C++}, style=cpp]!int a = 1;!}\n```\n"
  },
  {
    "path": "test/command/5439.md",
    "content": "```\n% pandoc -t latex\nnamespace\\fshyp{}container\n^D\nnamespace\\fshyp{}container\n```\n"
  },
  {
    "path": "test/command/5446.md",
    "content": "```\n% pandoc -f latex -t rst\n{\\em test test \\/}\n^D\n*test test*\n```\n"
  },
  {
    "path": "test/command/5474-figures.md",
    "content": "```\n% pandoc -t opendocument+native_numbering\n\n![First image](lalune.jpg)\n\n![Second image](lalune.jpg)\n\n^D\n<text:p text:style-name=\"FigureWithCaption\"><draw:frame draw:name=\"img1\"><draw:image xlink:href=\"lalune.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame></text:p>\n<text:p text:style-name=\"FigureCaption\">Figure <text:sequence text:ref-name=\"refIllustration0\" text:name=\"Illustration\" text:formula=\"ooow:Illustration+1\" style:num-format=\"1\">1</text:sequence>: First\nimage</text:p>\n<text:p text:style-name=\"FigureWithCaption\"><draw:frame draw:name=\"img2\"><draw:image xlink:href=\"lalune.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame></text:p>\n<text:p text:style-name=\"FigureCaption\">Figure <text:sequence text:ref-name=\"refIllustration1\" text:name=\"Illustration\" text:formula=\"ooow:Illustration+1\" style:num-format=\"1\">2</text:sequence>: Second\nimage</text:p>\n```\n"
  },
  {
    "path": "test/command/5474-tables.md",
    "content": "```\n% pandoc -t opendocument+native_numbering\n  Right     Left  \n-------     ------\n     12     11\n\n: First table\n\n  Right     Left  \n-------     ------\n     13     14    \n\n: Second Table\n^D\n<text:p text:style-name=\"TableCaption\">Table <text:sequence text:ref-name=\"refTable0\" text:name=\"Table\" text:formula=\"ooow:Table+1\" style:num-format=\"1\">1</text:sequence>: First\ntable</text:p>\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P1\">Right</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P2\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">11</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"TableCaption\">Table <text:sequence text:ref-name=\"refTable1\" text:name=\"Table\" text:formula=\"ooow:Table+1\" style:num-format=\"1\">2</text:sequence>: Second\nTable</text:p>\n<table:table table:name=\"Table2\" table:style-name=\"Table2\">\n  <table:table-column table:style-name=\"Table2.A\" />\n  <table:table-column table:style-name=\"Table2.B\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P3\">Right</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P4\">13</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">14</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n```\n"
  },
  {
    "path": "test/command/5476.md",
    "content": "```\n% pandoc -t latex\n![moon^[the moon]](test/lalune.jpg)\n^D\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={moon}]{test/lalune.jpg}}\n\\caption[moon]{moon\\footnotemark{}}\n\\end{figure}\n\\footnotetext{the moon}\n```\n\n"
  },
  {
    "path": "test/command/5495.md",
    "content": "```\n% pandoc -t markdown --reference-links\nAll because of [1](#one) link...\n\n[This](#foo) will break Pandoc.\n\n[This](#bar) will make you laugh.\n^D\nAll because of [1] link...\n\n[This] will break Pandoc.\n\n[This][2] will make you laugh.\n\n  [1]: #one\n  [This]: #foo\n  [2]: #bar\n```\n"
  },
  {
    "path": "test/command/5519.md",
    "content": "~~~\n% pandoc -t markdown\n``````{.attr}\n ```\n code\n ```\n``````\n^D\n```` attr\n ```\n code\n ```\n````\n~~~\n"
  },
  {
    "path": "test/command/5529.md",
    "content": "```\n% pandoc -t latex\n~~`hello world`~~\n\n~~_`hello world`_~~\n^D\n\\st{\\mbox{\\texttt{hello\\ world}}}\n\n\\st{\\emph{\\mbox{\\texttt{hello\\ world}}}}\n```\n"
  },
  {
    "path": "test/command/5540.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{lstlisting}[language=myfunnylanguage]\nStay pure!\n\\end{lstlisting}\n^D\n[ CodeBlock\n    ( \"\"\n    , [ \"myfunnylanguage\" ]\n    , [ ( \"language\" , \"myfunnylanguage\" ) ]\n    )\n    \"Stay pure!\"\n]\n```\n"
  },
  {
    "path": "test/command/5541-localLink.md",
    "content": "```\n% pandoc -f markdown -t icml -s\n\n# Header 1\n\nthis is some text\n\n## Header 2\n\nsome more text that [links to](#header-1) the first header. And this links to [some text](#spanner) in 2.1.\n\n## Header 2.1\n\nif you can read this text, [and it's linked]{#spanner} - all good!\n\n^D\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$ID/NormalCharacterStyle\" Name=\"Default\" />\n      <CharacterStyle Self=\"CharacterStyle/Link\" Name=\"Link\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$ID/NormalParagraphStyle\" Name=\"$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header1\" Name=\"Header1\" LeftIndent=\"0\" PointSize=\"36\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header2\" Name=\"Header2\" LeftIndent=\"0\" PointSize=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Paragraph\" Name=\"Paragraph\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-1\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is some text</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-2\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>some more text that </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-1\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>links to</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> the first header. And this links to </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-2\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>some text</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> in 2.1.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-2.1\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 2.1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>if you can read this text, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#spanner\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>and it’s linked</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> - all good!</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n\n  </Story>\n  <Hyperlink Self=\"uf-2\" Name=\"#spanner\" Source=\"htss-2\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkTextDestination/#spanner</Destination>\n    </Properties>\n  </Hyperlink>\n  <Hyperlink Self=\"uf-1\" Name=\"#header-1\" Source=\"htss-1\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkTextDestination/#header-1</Destination>\n    </Properties>\n  </Hyperlink>\n</Document>\n```\n"
  },
  {
    "path": "test/command/5541-nesting.md",
    "content": "```\n% pandoc -f html -t icml -s\n\n<div id=\"blockId\">\n  <div id=\"blockId2\">\n    <span id=\"inlineId\">\n      <img id=\"inlineId2\" src=\"lalune.jpg\" />\n    </span>\n  </div>\n</div>\n\n^D\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$ID/NormalCharacterStyle\" Name=\"Default\" />\n      <CharacterStyle Self=\"CharacterStyle/\" Name=\"\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$ID/NormalParagraphStyle\" Name=\"$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/\" Name=\"\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n<ParagraphStyleRange AppliedParagraphStyle=\"\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#inlineId\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content> </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 75 -75\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-75 -75\" LeftDirection=\"-75 -75\" RightDirection=\"-75 -75\" />\n              <PathPointType Anchor=\"-75 75\" LeftDirection=\"-75 75\" RightDirection=\"-75 75\" />\n              <PathPointType Anchor=\"75 75\" LeftDirection=\"75 75\" RightDirection=\"75 75\" />\n              <PathPointType Anchor=\"75 -75\" LeftDirection=\"75 -75\" RightDirection=\"75 -75\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -75 -75\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"150\" Bottom=\"150\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:lalune.jpg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#inlineId\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content> </Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n\n  </Story>\n  \n</Document>\n```\n"
  },
  {
    "path": "test/command/5541-urlLink.md",
    "content": "```\n% pandoc -f markdown -t icml -s\n\n# Header 1\n\nthis is some text\n\n## Header 2\n\nsome more text that [links to](https://www.pandoc.org) Pandoc.\n\n^D\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$ID/NormalCharacterStyle\" Name=\"Default\" />\n      <CharacterStyle Self=\"CharacterStyle/Link\" Name=\"Link\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$ID/NormalParagraphStyle\" Name=\"$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header1\" Name=\"Header1\" LeftIndent=\"0\" PointSize=\"36\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header2\" Name=\"Header2\" LeftIndent=\"0\" PointSize=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Paragraph\" Name=\"Paragraph\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-1\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is some text</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-2\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>some more text that </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-1\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>links to</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> Pandoc.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n\n  </Story>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/https%3a//www.pandoc.org\" Name=\"link\" DestinationURL=\"https://www.pandoc.org\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-1\" Name=\"https://www.pandoc.org\" Source=\"htss-1\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/https%3a//www.pandoc.org</Destination>\n    </Properties>\n  </Hyperlink>\n</Document>\n```\n"
  },
  {
    "path": "test/command/5543.md",
    "content": "```\n% pandoc -t markdown\n1\\. item\n:   description\n^D\n1\\. item\n:   description\n```\n"
  },
  {
    "path": "test/command/5549.md",
    "content": "```\n% pandoc -t native\n##\n\n[]\n^D\n[ Header 2 ( \"section\" , [] , [] ) [] , Para [ Str \"[]\" ] ]\n```\n"
  },
  {
    "path": "test/command/5565.md",
    "content": "```\n% pandoc -t asciidoc\n***hi***\n^D\n*_hi_*\n```\n"
  },
  {
    "path": "test/command/5566.md",
    "content": "```\n% pandoc -t asciidoc -f html\nfo<span class=\"c\">o</span> f<span class=\"c\">o</span>o <span class=\"c\">f</span>oo <span class=\"c\">foo</span>\n^D\nfo[.c]##o## f[.c]##o##o [.c]##f##oo [.c]#foo#\n```\n"
  },
  {
    "path": "test/command/5574.md",
    "content": "No highlighting inside heading:\n```\n% pandoc -t latex\n# `foo`{.cpp}\n^D\n\\section{\\texorpdfstring{\\texttt{foo}}{foo}}\\label{foo}\n```\n"
  },
  {
    "path": "test/command/5619.md",
    "content": "```\n% pandoc -f rst -t native\n.. figure:: img1.jpg\n  :width: 1in\n  :name: test\n\n  The caption. Here's what piggybacking on caption would look like {#fig:1}\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"The\"\n           , Space\n           , Str \"caption.\"\n           , Space\n           , Str \"Here's\"\n           , Space\n           , Str \"what\"\n           , Space\n           , Str \"piggybacking\"\n           , Space\n           , Str \"on\"\n           , Space\n           , Str \"caption\"\n           , Space\n           , Str \"would\"\n           , Space\n           , Str \"look\"\n           , Space\n           , Str \"like\"\n           , Space\n           , Str \"{#fig:1}\"\n           ]\n       ])\n    [ Plain\n        [ Image\n            ( \"test\" , [] , [ ( \"width\" , \"1in\" ) ] )\n            [ Str \"The\"\n            , Space\n            , Str \"caption.\"\n            , Space\n            , Str \"Here's\"\n            , Space\n            , Str \"what\"\n            , Space\n            , Str \"piggybacking\"\n            , Space\n            , Str \"on\"\n            , Space\n            , Str \"caption\"\n            , Space\n            , Str \"would\"\n            , Space\n            , Str \"look\"\n            , Space\n            , Str \"like\"\n            , Space\n            , Str \"{#fig:1}\"\n            ]\n            ( \"img1.jpg\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/5620.md",
    "content": "```\n% pandoc -t man\n`-o`, `--output=`*OUTFILE*\n:   Write output to *OUTFILE* instead of `stdout`(3)\n^D\n.TP\n\\f[CR]\\-o\\f[R], \\f[CR]\\-\\-output=\\f[R]\\f[I]OUTFILE\\f[R]\nWrite output to \\f[I]OUTFILE\\f[R] instead of \\f[CR]stdout\\f[R](3)\n```\n"
  },
  {
    "path": "test/command/5627.md",
    "content": "```\n% pandoc -t html\n## Example\n\n1. One\n2. Two `-->something<!--`\n3. Three\n\n~~~html\n--><!--<script>alert('Escaped!')</script>\n~~~\n\n~~~html\nSomething\n~~~\n^D\n<h2 id=\"example\">Example</h2>\n<ol type=\"1\">\n<li>One</li>\n<li>Two <code>--&gt;something&lt;!--</code></li>\n<li>Three</li>\n</ol>\n<div class=\"sourceCode\" id=\"cb1\"><pre\nclass=\"sourceCode html\"><code class=\"sourceCode html\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>--&gt;<span class=\"co\">&lt;!--&lt;script&gt;alert(&#39;Escaped!&#39;)&lt;/script&gt;</span></span></code></pre></div>\n<div class=\"sourceCode\" id=\"cb2\"><pre\nclass=\"sourceCode html\"><code class=\"sourceCode html\"><span id=\"cb2-1\"><a href=\"#cb2-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>Something</span></code></pre></div>\n```\n\n```\n% pandoc -t html\n## Example 2\n\n- `-->something<!--`\n- `-->something<!--`\n- bye `-->something else<!--`\n\n~~~html\n--><!--<script>alert('Escaped!')</script>\n~~~\n\n~~~html\nSomething\n~~~\n^D\n<h2 id=\"example-2\">Example 2</h2>\n<ul>\n<li><code>--&gt;something&lt;!--</code></li>\n<li><code>--&gt;something&lt;!--</code></li>\n<li>bye <code>--&gt;something else&lt;!--</code></li>\n</ul>\n<div class=\"sourceCode\" id=\"cb1\"><pre\nclass=\"sourceCode html\"><code class=\"sourceCode html\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>--&gt;<span class=\"co\">&lt;!--&lt;script&gt;alert(&#39;Escaped!&#39;)&lt;/script&gt;</span></span></code></pre></div>\n<div class=\"sourceCode\" id=\"cb2\"><pre\nclass=\"sourceCode html\"><code class=\"sourceCode html\"><span id=\"cb2-1\"><a href=\"#cb2-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>Something</span></code></pre></div>\n```\n\n```\n% pandoc -t html\n## Example 3\n\n1. `-->one<!--`\n5. bye `-->two <!--`\n3. ` three, not in block\n1. four, not in block  `\n2. five\n5. six\n6. seven `\n-  separate unordered list `\n42. forty-two, separate ordered list\n^D\n<h2 id=\"example-3\">Example 3</h2>\n<ol type=\"1\">\n<li><code>--&gt;one&lt;!--</code></li>\n<li>bye <code>--&gt;two &lt;!--</code></li>\n<li>` three, not in block</li>\n<li>four, not in block `</li>\n<li>five</li>\n<li>six</li>\n<li>seven `</li>\n</ol>\n<ul>\n<li>separate unordered list `</li>\n</ul>\n<ol start=\"42\" type=\"1\">\n<li>forty-two, separate ordered list</li>\n</ol>\n```\n"
  },
  {
    "path": "test/command/5635.md",
    "content": "```\n% pandoc -f latex -t plain\n\\providecommand{\\test}{foo}\n\\providecommand{\\test}{bar}\n\nThe value is: \\test\n^D\nThe value is: foo\n```\n\n```\n% pandoc -f latex -t plain\n\\provideenvironment{test}{startfoo}{stopfoo}\n\\provideenvironment{test}{startbar}{stopbar}\n\n\\begin{test}\nHi\n\\end{test}\n^D\nstartfoo Hi stopfoo\n```\n\n\n"
  },
  {
    "path": "test/command/5642.md",
    "content": "```\n% pandoc -t html5 -f markdown\n![test](foo){aria-describedby=\"barbaz\"}\n^D\n<figure>\n<img src=\"foo\" aria-describedby=\"barbaz\" alt=\"test\" />\n<figcaption aria-hidden=\"true\">test</figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/5650.md",
    "content": "````\n% pandoc --id-prefix foo\n```haskell\na\nb\n```\n^D\n<div class=\"sourceCode\" id=\"foocb1\"><pre\nclass=\"sourceCode haskell\"><code class=\"sourceCode haskell\"><span id=\"foocb1-1\"><a href=\"#foocb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>a</span>\n<span id=\"foocb1-2\"><a href=\"#foocb1-2\" aria-hidden=\"true\" tabindex=\"-1\"></a>b</span></code></pre></div>\n````\n\n````\n% pandoc --id-prefix foo\n``` {.haskell #bar}\na\nb\n```\n^D\n<div class=\"sourceCode\" id=\"foobar\"><pre\nclass=\"sourceCode haskell\"><code class=\"sourceCode haskell\"><span id=\"foobar-1\"><a href=\"#foobar-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>a</span>\n<span id=\"foobar-2\"><a href=\"#foobar-2\" aria-hidden=\"true\" tabindex=\"-1\"></a>b</span></code></pre></div>\n````\n\n"
  },
  {
    "path": "test/command/5654.md",
    "content": "```\n% pandoc -f latex -t markdown\nThis is {\\tt monospaced too} done.\n^D\nThis is `monospaced too` done.\n```\n"
  },
  {
    "path": "test/command/5655.md",
    "content": "````\n% pandoc --webtex\n$T_n={n+1 \\choose 2}$\n^D\n<p><img style=\"vertical-align:middle\"\nsrc=\"https://latex.codecogs.com/png.latex?%5Ctextstyle%20T_n%3D%7Bn%2B1%20%5Cchoose%202%7D\"\nalt=\"T_n={n+1 \\choose 2}\" title=\"T_n={n+1 \\choose 2}\"\nclass=\"math inline\" /></p>\n````\n\n````\n% pandoc --webtex\n$$T_n={n+1 \\choose 2}$$\n^D\n<p><img style=\"vertical-align:middle\"\nsrc=\"https://latex.codecogs.com/png.latex?%5Cdisplaystyle%20T_n%3D%7Bn%2B1%20%5Cchoose%202%7D\"\nalt=\"T_n={n+1 \\choose 2}\" title=\"T_n={n+1 \\choose 2}\"\nclass=\"math display\" /></p>\n````\n\n"
  },
  {
    "path": "test/command/5682.md",
    "content": "```\n% pandoc -t native -f latex\n\\newcommand{\\ittakestwo}[2][defaultone]{#2}\n\\ittakestwo[to]{tango}\n^D\n[ Para [ Str \"tango\" ] ]\n```\n\n"
  },
  {
    "path": "test/command/5684.md",
    "content": "```\n% pandoc -f native -t latex\n[Str \"\\8222\\8218Der\",Space,Str \"Erz\\228hler.\",Space,Str \"Betrachtungen\",Space,Str \"zum\",Space,Str \"Werk\",Space,Str \"Nikolai\",Space,Str \"Lesskows\\8216\\8220.\"]\n^D\n„‚Der Erzähler. Betrachtungen zum Werk Nikolai Lesskows`\\,``.\n```\n"
  },
  {
    "path": "test/command/5686.md",
    "content": "```\n% pandoc -t native\nFOO\\t0BAR\n\nThis part does not make it to the html output.\n^D\n[ Para\n    [ Str \"FOO\" , RawInline (Format \"tex\") \"\\\\t0\" , Str \"BAR\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"part\"\n    , Space\n    , Str \"does\"\n    , Space\n    , Str \"not\"\n    , Space\n    , Str \"make\"\n    , Space\n    , Str \"it\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"html\"\n    , Space\n    , Str \"output.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/5690.md",
    "content": "```\n% pandoc -f docbook -t asciidoc\n<warning>\n<title>My warning!</title>\n<para>A warning.</para>\n<para>Another paragraph.</para>\n</warning>\n^D\n[WARNING]\n.My warning!\n====\nA warning.\n\nAnother paragraph.\n====\n```\n"
  },
  {
    "path": "test/command/5700-metadata-file-1.yml",
    "content": "title: This title should be overridden by 5700-metadta-file-2.yml\n"
  },
  {
    "path": "test/command/5700-metadata-file-2.yml",
    "content": "title: Multiple metadata files test\ndesc: Both of these files should be loaded.\n"
  },
  {
    "path": "test/command/5700.md",
    "content": "```\n% pandoc -t native -s --metadata-file command/5700-metadata-file-1.yml --metadata-file command/5700-metadata-file-2.yml\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"desc\"\n            , MetaInlines\n                [ Str \"Both\"\n                , Space\n                , Str \"of\"\n                , Space\n                , Str \"these\"\n                , Space\n                , Str \"files\"\n                , Space\n                , Str \"should\"\n                , Space\n                , Str \"be\"\n                , Space\n                , Str \"loaded.\"\n                ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Multiple\"\n                , Space\n                , Str \"metadata\"\n                , Space\n                , Str \"files\"\n                , Space\n                , Str \"test\"\n                ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/5705.md",
    "content": "```\n% pandoc -f native -t markdown\n[OrderedList (8,UpperRoman,Period)\n [[Plain [Str \"Blah\"]\n  ,BulletList\n   [[Plain [Str \"Blah\"]]]]]]\n^D\nVIII. Blah\n      - Blah\n```\n\n"
  },
  {
    "path": "test/command/5708.md",
    "content": "```\n% pandoc -f rst -t native\n+--------+----------------+\n| 123456 | :math:`a + b`  |\n+--------+----------------+\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.125 )\n    , ( AlignDefault , ColWidth 0.2361111111111111 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123456\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"a + b\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/5711.md",
    "content": "```\n% pandoc -t native -f latex\n\\documentclass{article}\n\\begin{document}\n\\begin{tabular}{c}\n\\parbox{2cm}{d\\\\e}\n\\end{tabular}\n\\end{document}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"d\" , LineBreak , Str \"e\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/5714.md",
    "content": "```\n% pandoc -t native\n# hi _a\nb_\n\n# hi _c\nc\n^D\n[ Header\n    1 ( \"hi-_a\" , [] , [] ) [ Str \"hi\" , Space , Str \"_a\" ]\n, Para [ Str \"b_\" ]\n, Header\n    1 ( \"hi-_c\" , [] , [] ) [ Str \"hi\" , Space , Str \"_c\" ]\n, Para [ Str \"c\" ]\n]\n```\n"
  },
  {
    "path": "test/command/5740.md",
    "content": "```\n% pandoc -t latex\n\\newcommand\\parenthesize[1][x]{(#1)}\n$\\parenthesize$, $\\parenthesize[y]$, $\\parenthesize[\\textsc{head}]$\n^D\n\\newcommand\\parenthesize[1][x]{(#1)}\n\n\\((x)\\), \\((y)\\), \\((\\textsc{head})\\)\n```\n"
  },
  {
    "path": "test/command/5753.md",
    "content": "```\n% pandoc -f rst -t native\n.. math::\n\n    q_3\n   + 4\n\n  - 5 +\n    q_5\n\nend\n^D\n[ Para\n    [ Math DisplayMath \"q_3\\n+ 4\"\n    , Math DisplayMath \"- 5 +\\nq_5\"\n    ]\n, Para [ Str \"end\" ]\n]\n```\n"
  },
  {
    "path": "test/command/5793.md",
    "content": "```\n% pandoc -f html -t djot\nYou can use <abbr title=\"Cascading Style Sheets\">CSS</abbr>\n^D\nYou can use [CSS]{.abbr title=\"Cascading Style Sheets\"}\n```\n\n```\n% pandoc -f djot -t html\nYou can use [CSS]{.abbr title=\"Cascading Style Sheets\"}\n^D\n<p>You can use <abbr title=\"Cascading Style Sheets\">CSS</abbr></p>\n```\n"
  },
  {
    "path": "test/command/5795.md",
    "content": "```\n% pandoc -f html -t html\n<dfn id=\"foo\" title=\"bax\"><span>foo</span></dfn>\n^D\n<dfn id=\"foo\" title=\"bax\"><span>foo</span></dfn>\n```\n\n```\n% pandoc -f html -t native\n<dfn id=\"foo\" title=\"bax\"><span>foo</span></dfn>\n^D\n[ Plain\n    [ Span\n        ( \"foo\" , [ \"dfn\" ] , [ ( \"title\" , \"bax\" ) ] )\n        [ Span ( \"\" , [] , [] ) [ Str \"foo\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f native -t html\n[Plain [Span (\"foo\",[\"dfn\"],[(\"title\",\"bax\")]) [Span (\"\",[],[]) [Str \"foo\"]]]]\n^D\n<dfn id=\"foo\" title=\"bax\"><span>foo</span></dfn>\n```\n"
  },
  {
    "path": "test/command/5797.md",
    "content": "```\n% pandoc -f html -t html\n<mark>Ctrl-C</mark>\n^D\n<mark>Ctrl-C</mark>\n```\n\n```\n% pandoc -f html -t native\n<mark>Ctrl-C</mark>\n^D\n[ Plain [ Span ( \"\" , [ \"mark\" ] , [] ) [ Str \"Ctrl-C\" ] ] ]\n```\n\n```\n% pandoc -f native -t html\n[Plain [Span (\"\",[\"mark\"],[]) [Str \"Ctrl-C\"]]]\n^D\n<mark>Ctrl-C</mark>\n```\n"
  },
  {
    "path": "test/command/5805.md",
    "content": "```\n% pandoc -f html -t html\n<kbd>Ctrl-C</kbd>\n^D\n<kbd>Ctrl-C</kbd>\n```\n\n```\n% pandoc -f html -t native\n<kbd>Ctrl-C</kbd>\n^D\n[ Plain [ Span ( \"\" , [ \"kbd\" ] , [] ) [ Str \"Ctrl-C\" ] ] ]\n```\n\n```\n% pandoc -f native -t html\n[Plain [Span (\"\",[\"kbd\"],[]) [Str \"Ctrl-C\"]]]\n^D\n<kbd>Ctrl-C</kbd>\n```\n"
  },
  {
    "path": "test/command/5813.md",
    "content": "```\n% pandoc -f gfm\n### Jekyll Plugins & Gems :gem:\n^D\n<h3 id=\"jekyll-plugins--gems-gem\">Jekyll Plugins &amp; Gems <span\nclass=\"emoji\" data-emoji=\"gem\">💎</span></h3>\n```\n"
  },
  {
    "path": "test/command/5819.md",
    "content": "```\n% pandoc -t revealjs --slide-level=2\n# Heading\n\none\n\n. . .\n\ntwo\n^D\n<section id=\"heading\" class=\"title-slide slide level1\">\n<h1>Heading</h1>\n<p>one</p>\n<div class=\"fragment\">\n<p>two</p>\n</div>\n</section>\n```\n"
  },
  {
    "path": "test/command/5836.md",
    "content": "```\n% pandoc -f markdown -t latex\n\\newcommand{\\vara}{\\alpha}\n\\newcommand{\\varb}{b}\n$\\vara \\varb$\n^D\n\\newcommand{\\vara}{\\alpha}\n\\newcommand{\\varb}{b}\n\n\\(\\alpha b\\)\n```\n```\n% pandoc -f latex -t latex\n\\newcommand{\\vara}{\\alpha}\n\\newcommand{\\varb}{b}\n$\\vara \\varb$\n^D\n\\(\\alpha b\\)\n```\n```\n% pandoc -f latex -t latex\n\\newcommand{\\vara}{\\alpha}\n\\newcommand{\\varb}{b}\n\\[\\vara \\varb\\]\n^D\n\\[\\alpha b\\]\n```\n"
  },
  {
    "path": "test/command/5845.md",
    "content": "```\n% pandoc -t native\n\\parbox{1em}{#1}\n^D\n[ Para [ Str \"\\\\parbox{1em}{#1}\" ] ]\n```\n\n```\n% pandoc -t native\n\\newcommand{\\highlight}[1]{\\colorbox{yellow}{\\parbox{\\dimexpr\\linewidth-2\\fboxsep}{#1}}\n\nHello World\n^D\n[ Para\n    [ Str \"\\\\newcommand{\"\n    , RawInline (Format \"tex\") \"\\\\highlight\"\n    , Str \"}[1]{\\\\colorbox{yellow}{\\\\parbox{\"\n    , RawInline (Format \"tex\") \"\\\\dimexpr\"\n    , RawInline (Format \"tex\") \"\\\\linewidth-2\"\n    , RawInline (Format \"tex\") \"\\\\fboxsep\"\n    , Str \"}{#1}}\"\n    ]\n, Para [ Str \"Hello\" , Space , Str \"World\" ]\n]\n```\n"
  },
  {
    "path": "test/command/5846.md",
    "content": "```\n% pandoc --section-divs\n::: {.mydiv}\n# header 1a\n\none\n\n# header 1b\n\ntwo\n:::\n^D\n<div class=\"mydiv\">\n<section id=\"header-1a\" class=\"level1\">\n<h1>header 1a</h1>\n<p>one</p>\n</section>\n<section id=\"header-1b\" class=\"level1\">\n<h1>header 1b</h1>\n<p>two</p>\n</section>\n</div>\n```\n\n```\n% pandoc --section-divs\n::: mydiv\n# head 1\n## head 1.1\n# head 2\n:::\n\n## head 2.1\n^D\n<div class=\"mydiv\">\n<section id=\"head-1\" class=\"level1\">\n<h1>head 1</h1>\n<section id=\"head-1.1\" class=\"level2\">\n<h2>head 1.1</h2>\n</section>\n</section>\n<section id=\"head-2\" class=\"level1\">\n<h1>head 2</h1>\n</section>\n</div>\n<section id=\"head-2.1\" class=\"level2\">\n<h2>head 2.1</h2>\n</section>\n```\n\n```\n% pandoc --section-divs\n# One\n## One A\n::: fence\n## One B\n# Two\n:::\n^D\n<section id=\"one\" class=\"level1\">\n<h1>One</h1>\n<section id=\"one-a\" class=\"level2\">\n<h2>One A</h2>\n</section>\n<div class=\"fence\">\n<section id=\"one-b\" class=\"level2\">\n<h2>One B</h2>\n</section>\n<section id=\"two\" class=\"level1\">\n<h1>Two</h1>\n</section>\n</div>\n</section>\n```\n\n```\n% pandoc --section-divs\n# Beginning\n\n::: exterior\n\nAt first...\n\n:::\n\nIn the beginning...\n\n::: interior\n\n# Middle\n\nSo it continued...\n\n:::\n\n# Ending\n\n::: exterior\n\nAnd finally...\n\n:::\n^D\n<section id=\"beginning\" class=\"level1\">\n<h1>Beginning</h1>\n<div class=\"exterior\">\n<p>At first…</p>\n</div>\n<p>In the beginning…</p>\n</section>\n<section id=\"middle\" class=\"level1 interior\">\n<h1>Middle</h1>\n<p>So it continued…</p>\n</section>\n<section id=\"ending\" class=\"level1\">\n<h1>Ending</h1>\n<div class=\"exterior\">\n<p>And finally…</p>\n</div>\n</section>\n```\n\n```\n% pandoc --section-divs\n::: part\n# One\n# Two\n:::\n::: part\n# Three\n# Four\n# Five\n:::\n::: part\n# Six\n# Seven\n# Eight\n:::\n^D\n<div class=\"part\">\n<section id=\"one\" class=\"level1\">\n<h1>One</h1>\n</section>\n<section id=\"two\" class=\"level1\">\n<h1>Two</h1>\n</section>\n</div>\n<div class=\"part\">\n<section id=\"three\" class=\"level1\">\n<h1>Three</h1>\n</section>\n<section id=\"four\" class=\"level1\">\n<h1>Four</h1>\n</section>\n<section id=\"five\" class=\"level1\">\n<h1>Five</h1>\n</section>\n</div>\n<div class=\"part\">\n<section id=\"six\" class=\"level1\">\n<h1>Six</h1>\n</section>\n<section id=\"seven\" class=\"level1\">\n<h1>Seven</h1>\n</section>\n<section id=\"eight\" class=\"level1\">\n<h1>Eight</h1>\n</section>\n</div>\n```\n"
  },
  {
    "path": "test/command/5849-prefix.md",
    "content": "```\n% pandoc -t latex --biblatex\n[e.g. @a1;@a2;@a3; but also @b1;@b2;@b3]\n^D\n\\autocites[e.g.][]{a1,a2,a3}[but also][]{b1,b2,b3}\n```\n```\n% pandoc -t latex --biblatex\n[e.g. @a1; e.g. @a2;@a3; but also @b1;@b2;but also @b3]\n^D\n\\autocites[e.g.][]{a1}[e.g.][]{a2,a3}[but also][]{b1,b2}[but also][]{b3}\n```\n```\n% pandoc -t latex --biblatex\n[e.g. @a1, ch.3 and elsewhere;@a2;@a3; but also @a4;@a5]\n^D\n\\autocites[e.g.][ch.3 and elsewhere]{a1}{a2,a3}[but also][]{a4,a5}\n```\n```\n% pandoc -t latex --biblatex\n[e.g. @a1;@a2, ch.3 and elsewhere;@a3; but also @a4;@a5]\n^D\n\\autocites[e.g.][]{a1}[ch.3 and elsewhere]{a2}{a3}[but also][]{a4,a5}\n```\n```\n% pandoc -t latex --biblatex\n[e.g. @a1, blah;@a2, ch.3 and elsewhere;@a3; but also @b4;@b5]\n^D\n\\autocites[e.g.][blah]{a1}[ch.3 and elsewhere]{a2}{a3}[but\nalso][]{b4,b5}\n```\n"
  },
  {
    "path": "test/command/5857.md",
    "content": "```\n% pandoc -f native -t markdown\n[BulletList\n [[Plain [Str \"a\"]]\n ,[]\n ,[Plain [Str \"b\"]]]]\n^D\n- a\n- \n- b\n```\n"
  },
  {
    "path": "test/command/5876/metadata/5876.yaml",
    "content": "---\ndesc: Found in metadata directory.\n---\n"
  },
  {
    "path": "test/command/5876/metadata/command/5876.yaml",
    "content": "---\ndesc: Should not be loaded.\n---\n"
  },
  {
    "path": "test/command/5876.md",
    "content": "```\n% pandoc -s -t native --data-dir=command/5876 --metadata-file=5876.yaml\nHello\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"desc\"\n            , MetaInlines\n                [ Str \"Found\"\n                , Space\n                , Str \"in\"\n                , Space\n                , Str \"metadata\"\n                , Space\n                , Str \"directory.\"\n                ]\n            )\n          ]\n    }\n  [ Para [ Str \"Hello\" ] ]\n```\n```\n% pandoc -s -t native --data-dir=command/5876 --metadata-file=command/5876.yaml\nHello\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"desc\"\n            , MetaInlines\n                [ Str \"Found\"\n                , Space\n                , Str \"in\"\n                , Space\n                , Str \"working\"\n                , Space\n                , Str \"directory.\"\n                ]\n            )\n          ]\n    }\n  [ Para [ Str \"Hello\" ] ]\n```\n```\n% pandoc -s -t native --data-dir=command/5876 --metadata-file=does-not-exist.yaml\nHello\n^D\n2> Could not find metadata file does-not-exist.yaml\n=> 98\n```\n```\n% pandoc -s -t native --metadata-file=does-not-exist.yaml\nHello\n^D\n2> Could not find metadata file does-not-exist.yaml\n=> 98\n```\n"
  },
  {
    "path": "test/command/5876.yaml",
    "content": "---\ndesc: Found in working directory.\n---\n"
  },
  {
    "path": "test/command/5878.md",
    "content": "```\n% pandoc -t native\nZozime^[],\nSynésius^[]\n^D\n[ Para\n    [ Str \"Zozime\"\n    , Note [ Para [] ]\n    , Str \",\"\n    , SoftBreak\n    , Str \"Syn\\233sius\"\n    , Note [ Para [] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/5881.md",
    "content": "```\n% pandoc -t markdown -s -H command/D.txt -d command/defaults1.yaml -d command/defaults2.yaml\nOk\n^D\nhere's d\n\nthis is a\n\nhere is b\n\nand this is c\n\nOk\n```\n"
  },
  {
    "path": "test/command/5885.md",
    "content": "```\n% pandoc -f docbook -t latex\n<equation>\n  <mathphrase>\n    J(x, y) = \\left\\{ \\begin{array}{ll}\n    0 &amp; \\text{if $I(x, y) &lt; t$} \\\\\n    1 &amp; \\text{if $I(x, y) \\ge t$}\n    \\end{array}\n    \\right.\n  </mathphrase>\n</equation>\n^D\n\\[\n    J(x, y) = \\left\\{ \\begin{array}{ll}\n    0 & \\text{if $I(x, y) < t$} \\\\\n    1 & \\text{if $I(x, y) \\ge t$}\n    \\end{array}\n    \\right.\n  \\]\n```\n"
  },
  {
    "path": "test/command/5898.md",
    "content": "```\n% pandoc -f html -t rst\n<html>\n  <body>\n    <ul>\n      <li>A list of stuff with a table inside\n\t<table>\n\t  <thead>\n\t    <tr>\n\t      <th>First</th><th>Second</th><th>Third</th>\n\t    </tr>\n\t  </thead>\n\t  <tbody>\n\t    <tr>\n\t      <td>First</td>\n\t      <td>Second</td>\n\t      <td>Third</td>\n\t    </tr>\n\t  </tbody>\n\t</table>\n      </li>\n      <li>Another list item</li>\n    </ul>\n  </body>\n</html>\n^D\n- A list of stuff with a table inside\n\n  ===== ====== =====\n  First Second Third\n  ===== ====== =====\n  First Second Third\n  ===== ====== =====\n\n- Another list item\n```\n"
  },
  {
    "path": "test/command/5899.md",
    "content": "```\n% pandoc -f html -t rst\n<html>\n  <body>\n    <ul>\n      <li>A list of stuff with a table inside\n        <table>\n          <thead>\n            <tr>\n              <th>First</th><th>Second</th><th>Third</th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>First</td>\n              <td>\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n                The big long table cell.\n              </td>\n              <td>Third</td>\n            </tr>\n          </tbody>\n        </table>\n      </li>\n      <li>Another list item</li>\n    </ul>\n  </body>\n</html>\n^D\n- A list of stuff with a table inside\n\n  +-------+------------------------------------------------------+-------+\n  | First | Second                                               | Third |\n  +=======+======================================================+=======+\n  | First | The big long table cell. The big long table cell.    | Third |\n  |       | The big long table cell. The big long table cell.    |       |\n  |       | The big long table cell. The big long table cell.    |       |\n  |       | The big long table cell. The big long table cell.    |       |\n  |       | The big long table cell. The big long table cell.    |       |\n  +-------+------------------------------------------------------+-------+\n\n- Another list item\n ```\n"
  },
  {
    "path": "test/command/5904.md",
    "content": "```\n%  pandoc -s -t markdown -H command/B.txt --variable header-includes:foo\nHi\n^D\nfoo\n\nhere is b\n\nHi\n```\n"
  },
  {
    "path": "test/command/5918.md",
    "content": "```\n% pandoc -t markdown -f latex\n1. \\textsc{excessive}\n^D\n1\\. [excessive]{.smallcaps}\n```\n"
  },
  {
    "path": "test/command/5936.md",
    "content": "```\n% pandoc -f gfm -t rst\n| Name |\n| ---- |\n| Foo  |\n| Bar  |\n| Baz  |\n| Quux |\n^D\n+------+\n| Name |\n+======+\n| Foo  |\n+------+\n| Bar  |\n+------+\n| Baz  |\n+------+\n| Quux |\n+------+\n```\n\n```\n% pandoc -f gfm -t rst\n| Name | Number |\n| ---- | ------ |\n| Foo  | 3 |\n| Bar  | 4 |\n| Baz  | 2 |\n| Quux | 1 |\n^D\n==== ======\nName Number\n==== ======\nFoo  3\nBar  4\nBaz  2\nQuux 1\n==== ======\n```\n"
  },
  {
    "path": "test/command/5967.md",
    "content": "```\n% pandoc --toc --toc-depth=3 -s -t plain\n# One\n## Two\n#### Four\n^D\n- One\n  - Two\n\nOne\n\nTwo\n\nFour\n```\n"
  },
  {
    "path": "test/command/5986.md",
    "content": "```\n% pandoc -t epub --number-sections --toc --metadata title=Foo -o - | pandoc -f epub -t html\n# Hi\n^D\n<p><span id=\"title_page.xhtml\"></span></p>\n<p><span id=\"nav.xhtml\"></span></p>\n<nav epub:type=\"landmarks\" id=\"landmarks\" hidden=\"hidden\">\n<ol>\n<li><a href=\"text/title_page.xhtml\" class=\"titlepage\">Title\nPage</a></li>\n<li><a href=\"#nav.xhtml_toc\" class=\"toc\">Table of Contents</a></li>\n</ol>\n</nav>\n<p><span id=\"ch001.xhtml\"></span></p>\n<section id=\"ch001.xhtml_hi\" class=\"level1\" data-number=\"1\">\n<h1 data-number=\"1\"><span class=\"header-section-number\">1</span> Hi</h1>\n</section>\n```\n"
  },
  {
    "path": "test/command/6009.md",
    "content": "```\n% pandoc -t native\n  <tr>\n   <td>\n   </td>\n  </tr>\n\nx\n\n    y\n^D\n[ RawBlock (Format \"html\") \"<tr>\"\n, RawBlock (Format \"html\") \"<td>\"\n, RawBlock (Format \"html\") \"</td>\"\n, RawBlock (Format \"html\") \"</tr>\"\n, Para [ Str \"x\" ]\n, CodeBlock ( \"\" , [] , [] ) \"y\"\n]\n```\n"
  },
  {
    "path": "test/command/6021.md",
    "content": "```\n% pandoc -t native\nOxide      石英\n-------  ------\nSiO2        100\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Oxide\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"\\30707\\33521\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"SiO2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"100\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/6026.md",
    "content": "```\n% pandoc -t native\n@{https://openreview.net/forum?id=HkwoSDPgg}\n\n@https://openreview.net/forum?id=HkwoSDPgg\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"https://openreview.net/forum?id=HkwoSDPgg\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = AuthorInText\n            , citationNoteNum = 1\n            , citationHash = 0\n            }\n        ]\n        [ Str \"@https://openreview.net/forum?id=HkwoSDPgg\" ]\n    ]\n, Para\n    [ Cite\n        [ Citation\n            { citationId = \"https://openreview.net/forum?id\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = AuthorInText\n            , citationNoteNum = 2\n            , citationHash = 0\n            }\n        ]\n        [ Str \"@https://openreview.net/forum?id\" ]\n    , Str \"=HkwoSDPgg\"\n    ]\n]\n```\n```\n% pandoc -t markdown\n@{https://openreview.net/forum?id=HkwoSDPgg}\n\n@https://openreview.net/forum?id=HkwoSDPgg\n^D\n@{https://openreview.net/forum?id=HkwoSDPgg}\n\n@https://openreview.net/forum?id=HkwoSDPgg\n```\n"
  },
  {
    "path": "test/command/6030.md",
    "content": "```\n% pandoc -t revealjs --slide-level=3\n# One\n\nOne\n\n## Two\n\nTwo\n\n### Three\n\nThree\n\n#### Four\n\nFour\n\n# New sec\n\nNew sec\n\n## New sub\n\nNew sub\n^D\n<section>\n<section id=\"one\" class=\"title-slide slide level1\">\n<h1>One</h1>\n<p>One</p>\n</section>\n<section id=\"two\" class=\"title-slide slide level2\">\n<h2>Two</h2>\n<p>Two</p>\n</section>\n<section id=\"three\" class=\"slide level3\">\n<h3>Three</h3>\n<p>Three</p>\n<h4 id=\"four\">Four</h4>\n<p>Four</p>\n</section>\n</section>\n<section>\n<section id=\"new-sec\" class=\"title-slide slide level1\">\n<h1>New sec</h1>\n<p>New sec</p>\n</section>\n<section id=\"new-sub\" class=\"title-slide slide level2\">\n<h2>New sub</h2>\n<p>New sub</p>\n</section>\n</section>\n```\n\n```\n% pandoc -t beamer --slide-level=3\n# One\n\nOne\n\n## Two\n\nTwo\n\n### Three\n\nThree\n\n#### Four\n\nFour\n^D\n\\section{One}\\label{one}\n\n\\begin{frame}{One}\nOne\n\\end{frame}\n\n\\subsection{Two}\\label{two}\n\n\\begin{frame}{Two}\nTwo\n\\end{frame}\n\n\\begin{frame}{Three}\n\\protect\\phantomsection\\label{three}\nThree\n\n\\begin{block}{Four}\n\\protect\\phantomsection\\label{four}\nFour\n\\end{block}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/6033.md",
    "content": "```\n% pandoc -t beamer --slide-level=4\n# One\n\n## One-A\n\n:::: columns\n\n::: column\n\n- One column.\n\n:::\n\n::: column\n\n- Another column.\n\n:::\n\n::::\n\n- Some more text.\n\n## One-B\n\n- Text.\n\n# Two\n\n## Two-A\n\n- More text.\n^D\n\\section{One}\\label{one}\n\n\\subsection{One-A}\\label{one-a}\n\n\\begin{frame}{One-A}\n\\begin{columns}[T]\n\\begin{column}{0.48\\linewidth}\n\\begin{itemize}\n\\tightlist\n\\item\n  One column.\n\\end{itemize}\n\\end{column}\n\n\\begin{column}{0.48\\linewidth}\n\\begin{itemize}\n\\tightlist\n\\item\n  Another column.\n\\end{itemize}\n\\end{column}\n\\end{columns}\n\n\\begin{itemize}\n\\tightlist\n\\item\n  Some more text.\n\\end{itemize}\n\\end{frame}\n\n\\subsection{One-B}\\label{one-b}\n\n\\begin{frame}{One-B}\n\\begin{itemize}\n\\tightlist\n\\item\n  Text.\n\\end{itemize}\n\\end{frame}\n\n\\section{Two}\\label{two}\n\n\\subsection{Two-A}\\label{two-a}\n\n\\begin{frame}{Two-A}\n\\begin{itemize}\n\\tightlist\n\\item\n  More text.\n\\end{itemize}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/6034.md",
    "content": "```\n% pandoc -f latex+raw_tex -t native\n\\begin{figure*}\n  \\centering\n  \\begin{overpic}{test_pic}\n    \\put (70,80) {Caption}\n  \\end{overpic}\n\\end{figure*}\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ RawBlock (Format \"latex\") \"\\\\centering\"\n    , RawBlock\n        (Format \"latex\")\n        \"\\\\begin{overpic}{test_pic}\\n    \\\\put (70,80) {Caption}\\n  \\\\end{overpic}\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6043.md",
    "content": "```\n% pandoc -t beamer\n\\textbf<1>{Bold Text On Slide1}\n^D\n\\begin{frame}\n\\textbf<1>{Bold Text On Slide1}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/6062.md",
    "content": "```\n% pandoc -f native -t html\n[Header 1 (\"section\",[\"foo\",\"unnumbered\"],[(\"key\",\"val\")]) [Str \"1\"]]\n^D\n<h1 class=\"foo unnumbered\" data-key=\"val\" id=\"section\">1</h1>\n```\n"
  },
  {
    "path": "test/command/6107.md",
    "content": "```\n% pandoc -t beamer\n---\ntitle: A silly slide\nsubtitle: Look for the sequel!\n---\n\n# A circus!\n\n## Another silly title\n\nNot much to do about nothing.\n\n## Epilogue {.standout}\n^D\n\\section{A circus!}\\label{a-circus}\n\n\\begin{frame}{Another silly title}\n\\protect\\phantomsection\\label{another-silly-title}\nNot much to do about nothing.\n\\end{frame}\n\n\\begin{frame}[standout]{Epilogue}\n\\protect\\phantomsection\\label{epilogue}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/6114.md",
    "content": "```\n% pandoc -f latex -t native\n\\includegraphics[width=.85\\textwidth]%\n {pic_M87star.pdf}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [ ( \"width\" , \".85\\\\textwidth\" ) ] )\n        [ Str \"image\" ]\n        ( \"pic_M87star.pdf\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6119.md",
    "content": "```\n% pandoc -t mediawiki\n[[link](url)]\n\n[![image](url)]\n^D\n[<nowiki/>[[url|link]]]\n\n[<nowiki/>[[File:url|image]]]\n```\n"
  },
  {
    "path": "test/command/6133.md",
    "content": "```\n% pandoc -f markdown_mmd -t markdown_mmd -s\nauthor: Author\ntitle: Title\n\nSome text\n^D\nauthor: Author\ntitle: Title\n\nSome text\n```\n"
  },
  {
    "path": "test/command/6137.md",
    "content": "```\n% pandoc -f latex -t native\nThis reference to Table \\ref{tbl:label} doesn't work.\n\\begin{table}\n        \\caption{This caption has no number.}\\label{tbl:label}\n        \\begin{tabular}{ l c r }\n          -------- & -------- & -------- \\\\\n          -------- & -------- & -------- \\\\\n        \\end{tabular}\n\\end{table}\n\nThis reference to Figure \\ref{fig:label} works fine.\n\\begin{figure}\n        \\includegraphics[width=\\textwidth]{example.png}\n        \\caption{A numbered caption, if I use pandoc-crossref.}\\label{fig:label}\n\\end{figure}\n^D\n[ Para\n    [ Str \"This\"\n    , Space\n    , Str \"reference\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"Table\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"tbl:label\" )\n          ]\n        )\n        [ Str \"1\" ]\n        ( \"#tbl:label\" , \"\" )\n    , Space\n    , Str \"doesn\\8217t\"\n    , Space\n    , Str \"work.\"\n    ]\n, Div\n    ( \"tbl:label\" , [] , [] )\n    [ Table\n        ( \"\" , [] , [] )\n        (Caption\n           Nothing\n           [ Plain\n               [ Str \"This\"\n               , Space\n               , Str \"caption\"\n               , Space\n               , Str \"has\"\n               , Space\n               , Str \"no\"\n               , Space\n               , Str \"number.\"\n               ]\n           ])\n        [ ( AlignLeft , ColWidthDefault )\n        , ( AlignCenter , ColWidthDefault )\n        , ( AlignRight , ColWidthDefault )\n        ]\n        (TableHead ( \"\" , [] , [] ) [])\n        [ TableBody\n            ( \"\" , [] , [] )\n            (RowHeadColumns 0)\n            []\n            [ Row\n                ( \"\" , [] , [] )\n                [ Cell\n                    ( \"\" , [] , [] )\n                    AlignDefault\n                    (RowSpan 1)\n                    (ColSpan 1)\n                    [ Plain [ Str \"\\8212\\8212\\8211\" ] ]\n                , Cell\n                    ( \"\" , [] , [] )\n                    AlignDefault\n                    (RowSpan 1)\n                    (ColSpan 1)\n                    [ Plain [ Str \"\\8212\\8212\\8211\" ] ]\n                , Cell\n                    ( \"\" , [] , [] )\n                    AlignDefault\n                    (RowSpan 1)\n                    (ColSpan 1)\n                    [ Plain [ Str \"\\8212\\8212\\8211\" ] ]\n                ]\n            , Row\n                ( \"\" , [] , [] )\n                [ Cell\n                    ( \"\" , [] , [] )\n                    AlignDefault\n                    (RowSpan 1)\n                    (ColSpan 1)\n                    [ Plain [ Str \"\\8212\\8212\\8211\" ] ]\n                , Cell\n                    ( \"\" , [] , [] )\n                    AlignDefault\n                    (RowSpan 1)\n                    (ColSpan 1)\n                    [ Plain [ Str \"\\8212\\8212\\8211\" ] ]\n                , Cell\n                    ( \"\" , [] , [] )\n                    AlignDefault\n                    (RowSpan 1)\n                    (ColSpan 1)\n                    [ Plain [ Str \"\\8212\\8212\\8211\" ] ]\n                ]\n            ]\n        ]\n        (TableFoot ( \"\" , [] , [] ) [])\n    ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"reference\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:label\" )\n          ]\n        )\n        [ Str \"1\" ]\n        ( \"#fig:label\" , \"\" )\n    , Space\n    , Str \"works\"\n    , Space\n    , Str \"fine.\"\n    ]\n, Figure\n    ( \"fig:label\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"A\"\n           , Space\n           , Str \"numbered\"\n           , Space\n           , Str \"caption,\"\n           , Space\n           , Str \"if\"\n           , Space\n           , Str \"I\"\n           , Space\n           , Str \"use\"\n           , Space\n           , Str \"pandoc-crossref.\"\n           ]\n       ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [ ( \"width\" , \"\\\\textwidth\" ) ] )\n            []\n            ( \"example.png\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6194.md",
    "content": "```\n% pandoc -f markdown -t rst\nimage1: ![foo](x.png)\n\nimage2: ![foo](y.png)\n^D\nimage1: |foo|\n\nimage2: |image1|\n\n.. |foo| image:: x.png\n.. |image1| image:: y.png\n```\n\n"
  },
  {
    "path": "test/command/6265.md",
    "content": "```\n% pandoc -f markdown -t latex -M csquotes=true\n\"test\"\n^D\n\\enquote{test}\n```\n"
  },
  {
    "path": "test/command/6285.md",
    "content": "```\n% pandoc -t docx -f native -o - | pandoc -f docx -t native\n[ HorizontalRule ]\n^D\n[ HorizontalRule ]\n```\n"
  },
  {
    "path": "test/command/6288.md",
    "content": "```\n% pandoc -f jats -t native\n<sec>\n<label>I</label><title>Introduction</title>\n</sec>\n^D\n[ Header 1 ( \"\" , [] , [] ) [ Str \"Introduction\" ] ]\n```\n"
  },
  {
    "path": "test/command/6296.md",
    "content": "```\n% pandoc -f native -t markdown\n[Str \"_hi_there\"]\n^D\n\\_hi_there\n```\n\n```\n% pandoc -f native -t markdown-intraword_underscores\n[Str \"_hi_there\"]\n^D\n\\_hi\\_there\n```\n\n"
  },
  {
    "path": "test/command/6308.md",
    "content": "```\n% pandoc -f org -t asciidoc\n* Header\n#+begin_tip\nI'm a tip\n#+end_tip\n\n** Subheader\n^D\n== Header\n\n[TIP]\n====\nI'm a tip\n====\n\n=== Subheader\n```\n"
  },
  {
    "path": "test/command/6324.md",
    "content": "```\n% pandoc -f latex -t native -s\n\\documentclass{article}\n\n\\begin{document}\n    \\title{Document title}\n    \\author{\n\nMe\n\n}\n\\maketitle\n\\end{document}\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\" , MetaList [ MetaInlines [ Str \"Me\" ] ] )\n          , ( \"title\"\n            , MetaInlines [ Str \"Document\" , Space , Str \"title\" ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/6348.md",
    "content": "```\n% pandoc -f jats -t native\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.0 20120330//EN\" \"http://jats.nlm.nih.gov/publishing/1.0/JATS-journalpublishing1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" dtd-version=\"1.0\" article-type=\"research-article\">\n  <front>\n    <journal-meta>\n      <journal-title-group>\n        <journal-title>Opinion Research</journal-title>\n      </journal-title-group>\n    </journal-meta>\n    <article-meta>\n      <title-group>\n        <article-title>Example article</article-title>\n      </title-group>\n    </article-meta>\n  </front>\n  <body>\n    <sec sec-type=\"results\">\n      <title>Results</title>\n      <p>A University <xref ref-type=\"fn\" rid=\"N0001\">1</xref></p>\n    </sec>\n  </body>\n  <back>\n    <fn-group>\n      <fn id=\"N0001\">\n        <p>footnote</p>\n      </fn>\n    </fn-group>\n  </back>\n</article>\n^D\n[ Header 1 ( \"\" , [] , [] ) [ Str \"Results\" ]\n, Para\n    [ Str \"A\"\n    , Space\n    , Str \"University\"\n    , Space\n    , Note [ Para [ Str \"footnote\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6350.md",
    "content": "```\n% pandoc -f commonmark+implicit_figures -t native\n![caption](image.jpg){#ident width=\"100%\"}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [] ) [ Str \"caption\" ] ( \"image.jpg\" , \"\" )\n    , Str \"{#ident\"\n    , Space\n    , Str \"width=\\\"100%\\\"}\"\n    ]\n]\n\n```\n\n```\n% pandoc -f commonmark -t native\n![caption](image.jpg){#ident width=\"100%\"}\n^D\n[ Para\n    [ Image\n        ( \"\" , [] , [] ) [ Str \"caption\" ] ( \"image.jpg\" , \"\" )\n    , Str \"{#ident\"\n    , Space\n    , Str \"width=\\\"100%\\\"}\"\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/6360.md",
    "content": "```\n% pandoc -f native -t latex --wrap=none\n[Link (\"test2\",[],[]) [Str \"link\",Space,Str \"to\",Space,Str \"text\",Space,Str \"test1\"] (\"#test1\",\"\")]\n^D\n\\protect\\phantomsection\\label{test2}\\hyperref[test1]{link to text test1}\n```\n"
  },
  {
    "path": "test/command/6367.md",
    "content": "```\n% pandoc -f ipynb -t org\n{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"A Markdown cell\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"data\": {\n      \"text/plain\": [\n       \"2\"\n      ]\n     },\n     \"execution_count\": 1,\n     \"metadata\": {},\n     \"output_type\": \"execute_result\"\n    }\n   ],\n   \"source\": [\n    \"# A code cell\\n\",\n    \"1 + 1\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Another Markdown cell\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.8.2\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n^D\nA Markdown cell\n\n#+begin_src jupyter-python\n# A code cell\n1 + 1\n#+end_src\n\n#+RESULTS:\n: 2\n\nAnother Markdown cell\n```\n"
  },
  {
    "path": "test/command/6384.md",
    "content": "```\n% pandoc --wrap=preserve --file-scope command/file1.txt command/file2.txt\n^D\n<h1 id=\"command__file1.txt__zed\">Zed</h1>\n<p><a href=\"bar\">foo</a>\nand <a href=\"#command__file1.txt__zed\">Zed</a>\nand <a href=\"#command__file2.txt__zed\">other Zed</a>\nand <a href=\"#command__file2.txt\">other file</a>\nand <a href=\"c.md#zed\">foreign Zed</a></p>\n<h2 id=\"command__file2.txt__zed\">Zed</h2>\n<p><a href=\"baz\">foo</a></p>\n```\n"
  },
  {
    "path": "test/command/6385.md",
    "content": "```\n% pandoc -f markdown -t html\n<details>\n<summary>Show me:</summary>\ndetails para 1\n\ndetails para 2\n\n</details>\n^D\n<details>\n<summary>\nShow me:\n</summary>\n<p>details para 1</p>\n<p>details para 2</p>\n</details>\n```\n"
  },
  {
    "path": "test/command/6388.md",
    "content": "```\n% pandoc -t markdown -s\n---\nnvalue: false\nvalue: true\n---\n\ntext\n^D\n---\nnvalue: false\nvalue: true\n---\n\ntext\n```\n"
  },
  {
    "path": "test/command/6424.md",
    "content": "```\n% pandoc -t asciidoc\ntest^[this is a note\\]. and more]\n^D\ntestfootnote:[this is a note++]++. and more]\n```\n"
  },
  {
    "path": "test/command/6441.md",
    "content": "```\n% pandoc -f org -t html\n#+ATTR_HTML: :class table-dark\n| h1 | h2 |\n|----|----|\n| c1 | c2 |\n^D\n<table class=\"table-dark\">\n<thead>\n<tr>\n<th>h1</th>\n<th>h2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>c1</td>\n<td>c2</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/645.md",
    "content": "Don't use listings commands in \\item[..] context:\n```\n% pandoc -t latex\n`--foo` **BAR**\n\n:   Enables the foo feature with **BAR** as its flavour.\n^D\n\\begin{description}\n\\item[\\texttt{-\\/-foo} \\textbf{BAR}]\nEnables the foo feature with \\textbf{BAR} as its flavour.\n\\end{description}\n```\n"
  },
  {
    "path": "test/command/6466-beg.hs",
    "content": "want :: Int\nwant = 42\n\n-- DO NOT WANT this; right bound is exclusive\n\n-- DO NOT WANT the below\ndoNotWant :: Int\ndoNotWant = 999\n"
  },
  {
    "path": "test/command/6466-end.hs",
    "content": "-- DO NOT WANT\n\nwant :: Int\nwant = 42\n"
  },
  {
    "path": "test/command/6466-mid.hs",
    "content": "-- DO NOT WANT\n\nwant :: Int\nwant = 42\n\n-- AVOID EXCLUSIVE RIGHT BOUND\n\n-- DO NOT WANT\ndoNotWant :: Int\ndoNotWant = 999\n"
  },
  {
    "path": "test/command/6466-whole.hs",
    "content": "want :: Int\nwant = 42\n"
  },
  {
    "path": "test/command/6466.md",
    "content": "```\n% pandoc -f org -t native\nStuff\n\n#+INCLUDE: \"command/6466-beg.hs\" src haskell :lines \"-4\"\n#+INCLUDE: \"command/6466-mid.hs\" src haskell :lines \"3-6\"\n#+INCLUDE: \"command/6466-end.hs\" src haskell :lines \"3-\"\n#+INCLUDE: \"command/6466-whole.hs\" src haskell :lines \"-\"\n\nMore stuff\n^D\n[ Para [ Str \"Stuff\" ]\n, CodeBlock\n    ( \"\" , [ \"haskell\" ] , [] ) \"want :: Int\\nwant = 42\\n\\n\"\n, CodeBlock\n    ( \"\" , [ \"haskell\" ] , [] ) \"want :: Int\\nwant = 42\\n\\n\"\n, CodeBlock\n    ( \"\" , [ \"haskell\" ] , [] ) \"want :: Int\\nwant = 42\\n\"\n, CodeBlock\n    ( \"\" , [ \"haskell\" ] , [] ) \"want :: Int\\nwant = 42\\n\"\n, Para [ Str \"More\" , Space , Str \"stuff\" ]\n]\n```\n"
  },
  {
    "path": "test/command/6481.md",
    "content": "```\n% pandoc -t html5\n::: {.div-class}\n+-------+-----+-----+-------------------------------------------------+\n| Col 1 | Col | Col | Col 4                                           |\n|       | 2   | 3   |                                                 |\n+:=====:+:===:+:===:+:================================================+\n| High  | Med | Med | Some description of something.                  |\n+-------+-----+-----+-------------------------------------------------+\n:::\n^D\n<div class=\"div-class\">\n<table style=\"width:97%;\">\n<colgroup>\n<col style=\"width: 11%\" />\n<col style=\"width: 8%\" />\n<col style=\"width: 8%\" />\n<col style=\"width: 69%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Col 1</th>\n<th style=\"text-align: center;\">Col 2</th>\n<th style=\"text-align: center;\">Col 3</th>\n<th style=\"text-align: left;\">Col 4</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">High</td>\n<td style=\"text-align: center;\">Med</td>\n<td style=\"text-align: center;\">Med</td>\n<td style=\"text-align: left;\">Some description of something.</td>\n</tr>\n</tbody>\n</table>\n</div>\n```\n"
  },
  {
    "path": "test/command/6541.md",
    "content": "```\n% pandoc -f docbook -t markdown -s\n<?xml version=\"1.0\"?>\n<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\"\n  \"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\">\n<book>\n\n<bookinfo>\n<title>Title</title>\n<author>\n<firstname>Firstname</firstname><surname>Lastname</surname>\n</author>\n<releaseinfo>1.17</releaseinfo>\n</bookinfo>\n\n<para>Text.</para>\n\n</book>\n^D\n---\nauthor: Firstname Lastname\nreleaseinfo: 1.17\ntitle: Title\n---\n\nText.\n```\n"
  },
  {
    "path": "test/command/6549.md",
    "content": "```\n% pandoc -f rst\n.. csv-table:: Test table\n   :file: command/01.csv\n   :delim: ;\n   :header-rows: 1\n^D\n<table>\n<caption>Test table</caption>\n<thead>\n<tr>\n<th>Column1</th>\n<th>Column2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Data1</td>\n<td><ul>\n<li>data1</li>\n<li>data2</li>\n</ul></td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/6588.md",
    "content": "```\n% pandoc -f rst\nI recommend you try |Python|_.\n\n.. |Python| replace:: Python, *the* best language around\n.. _Python: http://www.python.org/\n^D\n<p>I recommend you try <a href=\"http://www.python.org/\"><span>Python,\n<em>the</em> best language around</span></a>.</p>\n```\n"
  },
  {
    "path": "test/command/6620.md",
    "content": "```\n% pandoc -f latex\n\\SI{23(2)}{\\m}\n\n\\SI{125(12)}{\\m}\n\n\\SI{0.135(21)}{\\m}\n\n\\SI{12.3(60)}{\\m}\n\n\\SI{10.0 \\pm 3.3}{\\ms}\n^D\n<p>23 ± 2 m</p>\n<p>125 ± 12 m</p>\n<p>0.135 ± 0.021 m</p>\n<p>12.3 ± 6 m</p>\n<p>10.0 ± 3.3 ms</p>\n```\n"
  },
  {
    "path": "test/command/6658.md",
    "content": "```\n% pandoc -f latex -t html\n\\num{12345,67890}\n\n\\num{1+-2i}\n\n\\num{.3e45}\n\n\\num{1.654 x 2.34 x 3.430}\n\n\\si{kg.m.s^{-1}}\n\n\\si{\\kilogram\\metre\\per\\second}\n\n\\si[per-mode=symbol]{\\kilogram\\metre\\per\\second}\n\n\\si[per-mode=symbol]{\\kilogram\\metre\\per\\ampere\\per\\second}\n\n\\numlist{10;20;30}\n\n\\SIlist{0.13;0.67;0.80}{\\milli\\metre}\n\n\\numrange{10}{20}\n\n\\SIrange{0.13}{0.67}{\\milli\\metre}\n\n\\ang{10}\n\n\\ang{1;2;3}\n\n\\ang{;;1}\n\n\\ang{+10;;}\n\n\\ang{-0;1;}\n\n\\si{kg.m/s^2}\n\n\\si{g_{polymer}~mol_{cat}.s^{-1}}\n\n\\si{\\kilo\\gram\\metre\\per\\square\\second}\n\n\\si{\\gram\\per\\cubic\\centi\\metre}\n\n\\si{\\square\\volt\\cubic\\lumen\\per\\farad}\n\n\\si{\\metre\\squared\\per\\gray\\cubic\\lux}\n\n\\si{\\henry\\second}\n^D\n<p>12345.67890</p>\n<p>1 ± 2i</p>\n<p>0.3 × 10<sup>45</sup></p>\n<p>1.654 × 2.34 × 3.430</p>\n<p>kg m s<sup>−1</sup></p>\n<p>kg m s<sup>−1</sup></p>\n<p>kg m/s</p>\n<p>kg m/A/s</p>\n<p>10, 20, &amp; 30</p>\n<p>0.13 mm, 0.67 mm, &amp; 0.80 mm</p>\n<p>10–20</p>\n<p>0.13 mm–0.67 mm</p>\n<p>10°</p>\n<p>1°2′3″</p>\n<p>1″</p>\n<p>10°</p>\n<p>-0°1′</p>\n<p>kg m/s<sup>2</sup></p>\n<p>g<sub>polymer</sub> mol<sub>cat</sub> s<sup>−1</sup></p>\n<p>kg m s<sup>−2</sup></p>\n<p>g cm<sup>−3</sup></p>\n<p>V<sup>2</sup> lm<sup>3</sup> F<sup>−1</sup></p>\n<p>m<sup>2</sup> Gy<sup>−1</sup> lx<sup>3</sup></p>\n<p>H s</p>\n```\n"
  },
  {
    "path": "test/command/6675.md",
    "content": "```\n% pandoc -f markdown -t icml -s\n\n# Header 1\n\nthis is some text\n\n## Header 2\n\nsome more text that [links to](https://www.pandoc.org) Pandoc.\n\nand some text that [links to](#header-1) the first header\n\n^D\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$ID/NormalCharacterStyle\" Name=\"Default\" />\n      <CharacterStyle Self=\"CharacterStyle/Link\" Name=\"Link\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$ID/NormalParagraphStyle\" Name=\"$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header1\" Name=\"Header1\" LeftIndent=\"0\" PointSize=\"36\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header2\" Name=\"Header2\" LeftIndent=\"0\" PointSize=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Paragraph\" Name=\"Paragraph\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-1\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is some text</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#header-2\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Header 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>some more text that </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-1\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>links to</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> Pandoc.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>and some text that </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-2\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>links to</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> the first header</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n\n  </Story>\n  <Hyperlink Self=\"uf-2\" Name=\"#header-1\" Source=\"htss-2\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkTextDestination/#header-1</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/https%3a//www.pandoc.org\" Name=\"link\" DestinationURL=\"https://www.pandoc.org\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-1\" Name=\"https://www.pandoc.org\" Source=\"htss-1\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/https%3a//www.pandoc.org</Destination>\n    </Properties>\n  </Hyperlink>\n</Document>\n```\n"
  },
  {
    "path": "test/command/6699.md",
    "content": "```\n% pandoc -f rst -t native\n.. class:: allowframebreaks\n\ntitle\n-----\n\ntext\n^D\n[ Header\n    1 ( \"title\" , [ \"allowframebreaks\" ] , [] ) [ Str \"title\" ]\n, Para [ Str \"text\" ]\n]\n```\n\n"
  },
  {
    "path": "test/command/6709.md",
    "content": "Tabs must be expanded even if --file-scope is used\n````\n% pandoc -t native --file-scope --tab-stop=2\n```\nif true; then\n\techo \"yup\"\nfi\n```\n^D\n[ CodeBlock\n    ( \"\" , [] , [] ) \"if true; then\\n  echo \\\"yup\\\"\\nfi\"\n]\n````\n"
  },
  {
    "path": "test/command/6719.md",
    "content": "```\n% pandoc -f docbook -t native\n<para>\n<emphasis>emphasized </emphasis>text\n</para>\n^D\n[ Para [ Emph [ Str \"emphasized\" , Space ] , Str \"text\" ] ]\n```\n\n```\n% pandoc -f jats -t native\n<p>\n<italic> hi  </italic>there\n</p>\n^D\n[ Para [ Emph [ Space , Str \"hi\" , Space ] , Str \"there\" ] ]\n```\n\n"
  },
  {
    "path": "test/command/6723.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/chicago-fullnote-bibliography.csl\nreferences:\n- id: doe\n  type: article\n  author:\n  - family: Doe\n    given: John\n  DOI: 10.1109/5.771073\n  issued:\n    - year: 2020\n  title: An article\n...\nBlah [@doe].\n\n# References {-}\n\n^D\nBlah.[^1]\n\n# References {#references .unnumbered}\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-doe .csl-entry}\nDoe, John. \"An Article,\" 2020. <https://doi.org/10.1109/5.771073>.\n:::\n::::\n\n[^1]: John Doe, \"An Article,\" 2020, <https://doi.org/10.1109/5.771073>.\n```\n"
  },
  {
    "path": "test/command/6739.md",
    "content": "```\n% pandoc -f gfm\n* `--argument` This item does not have a pipe character\n* `--argA | --argB` This item has a pipe character\n^D\n<ul>\n<li><code>--argument</code> This item does not have a pipe\ncharacter</li>\n<li><code>--argA | --argB</code> This item has a pipe character</li>\n</ul>\n```\n\n```\n% pandoc --mathjax -f gfm+tex_math_dollars\n* $|x|$\n* $|y|$\n^D\n<ul>\n<li><span class=\"math inline\">\\(|x|\\)</span></li>\n<li><span class=\"math inline\">\\(|y|\\)</span></li>\n</ul>\n```\n"
  },
  {
    "path": "test/command/6740.md",
    "content": "```\n% pandoc -t gfm\n<https://www.google.com>\n^D\n<https://www.google.com>\n```\n\n"
  },
  {
    "path": "test/command/6741.md",
    "content": "```\n% pandoc --citeproc --csl command/ieee.csl -t plain\n---\ntitle: 'A Simple Citations Test'\nauthor: 'Joanna Doe'\nreferences:\n- author:\n  - family: Mathôt\n    given: S\n  container-title: Annual review of vision science\n  DOI: 10.1146/annurev-vision-030320-062352\n  id: mathot2020\n  issued: 2020\n  title: \"Tuning the senses: How the pupil shapes vision at the earliest\n    stage.\"\n  title-short: Tuning the senses\n  type: article-journal\n- author:\n  - family: Zokaei\n    given: Nahid\n  - family: Board\n    given: Alexander G.\n  - family: Manohar\n    given: Sanjay G.\n  - family: Nobre\n    given: Anna C.\n  container-title: Proceedings of the National Academy of Sciences of\n    the United States of America\n  DOI: 10.1073/pnas.1909959116\n  id: zokaei2019\n  issued: 2019\n  page: 201909959\n  title: Modulation of the pupillary response by the content of visual\n    working memory\n  type: article-journal\n- author:\n  - family: Suzuki\n    given: Y.\n  - family: Minami\n    given: T.\n  - family: Laeng\n    given: B.\n  - family: Nakauchi\n    given: S.\n  container-title: Acta Psychologica\n  DOI: 10.1016/j.actpsy.2019.102882\n  id: suzuki2019\n  issued: 2019\n  page: 102882\n  title: \"Colorful glares: Effects of colors on brightness illusions\n    measured with pupillometry.\"\n  title-short: Colorful glares\n  type: article-journal\n  volume: 198\n- author:\n  - family: Brainard\n    given: David H.\n  - family: Hurlbert\n    given: Anya\n  container-title: Current Biology\n  DOI: 10.1016/j.cub.2015.05.020\n  id: brainard2015a\n  issue: 13\n  issued: 2015\n  page: R551-R554\n  title: \"Colour vision: Understanding \\\\#TheDress\"\n  title-short: Colour vision\n  type: article-journal\n  volume: 25\n- author:\n  - family: Cavanagh\n    given: Patrick\n  container-title: Limits of vision\n  editor:\n  - family: Crody-Dillon\n    given: John R.\n  id: cavanagh1991\n  issued: 1991\n  page: 234-250\n  publisher: CRC Press\n  title: Vision at equiluminance\n  type: chapter\n- author:\n  - family: Brainard\n    given: David H.\n  container-title: Annual Review of Vision Science\n  DOI: 10.1146/annurev-vision-082114-035341\n  id: brainard2015\n  issued: 2015\n  page: 519-546\n  title: Color and the cone mosaic\n  type: article-journal\n  volume: 1\n...\n\n# First Heading #\nHere is some **text**. And a reference [@brainard2015;@brainard2015a].\n\n# Second Heading #\nHere is some *text*[@cavanagh1991]. And a reference [@cavanagh1991;@brainard2015].\n\n# Third Heading #\nHere is some [text]{.underline}. And a reference [@mathot2020;@zokaei2019;@suzuki2019].\n\n::: {#refs}\n## Bibliography ##\n:::\n^D\nFirst Heading\n\nHere is some text. And a reference [1], [2].\n\nSecond Heading\n\nHere is some text[3]. And a reference [1], [3].\n\nThird Heading\n\nHere is some text. And a reference [4]–[6].\n\nBibliography\n\n[1] D. H. Brainard, “Color and the cone mosaic,” Annual Review of Vision\nScience, vol. 1, pp. 519–546, 2015.\n\n[2] D. H. Brainard and A. Hurlbert, “Colour vision: Understanding\n#TheDress,” Current Biology, vol. 25, no. 13, pp. R551–R554, 2015.\n\n[3] P. Cavanagh, “Vision at equiluminance,” in Limits of vision, J. R.\nCrody-Dillon, Ed. CRC Press, 1991, pp. 234–250.\n\n[4] S. Mathôt, “Tuning the senses: How the pupil shapes vision at the\nearliest stage.” Annual review of vision science, 2020.\n\n[5] N. Zokaei, A. G. Board, S. G. Manohar, and A. C. Nobre, “Modulation\nof the pupillary response by the content of visual working memory,”\nProceedings of the National Academy of Sciences of the United States of\nAmerica, p. 201909959, 2019.\n\n[6] Y. Suzuki, T. Minami, B. Laeng, and S. Nakauchi, “Colorful glares:\nEffects of colors on brightness illusions measured with pupillometry.”\nActa Psychologica, vol. 198, p. 102882, 2019.\n\n```\n\n"
  },
  {
    "path": "test/command/6752.md",
    "content": "```\n% pandoc -f biblatex -t csljson\n@xdata{XDPubAlfredAKnopf,\n    publisher   = {Alfred A.~Knopf},\n    address     = {New York, NY}\n}\n@book{Klinkenborg2012,\n    author      = {Verlyn Klinkenborg},\n    title       = {Several short sentences about writing},\n    date        = {2012},\n    xdata       = {XDPubAlfredAKnopf},\n}\n^D\n[\n  {\n    \"author\": [\n      {\n        \"family\": \"Klinkenborg\",\n        \"given\": \"Verlyn\"\n      }\n    ],\n    \"id\": \"Klinkenborg2012\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          2012\n        ]\n      ]\n    },\n    \"publisher\": \"Alfred A. Knopf\",\n    \"publisher-place\": \"New York, NY\",\n    \"title\": \"Several short sentences about writing\",\n    \"type\": \"book\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/6755.md",
    "content": "```\n%pandoc -f native -t opendocument\n[Div (\"divId\",[],[])\n [Para [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"div.\"]],\nPara [Span (\"spanId\",[],[]) [Str \"And\",Space,Str \"here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"span.\"]]]\n^D\n<text:section text:name=\"divId\"><text:p text:style-name=\"Text_20_body\">Here\nis a div.</text:p></text:section>\n<text:p text:style-name=\"Text_20_body\"><text:bookmark-start text:name=\"spanId\" />And\nhere is a span.<text:bookmark-end text:name=\"spanId\" /></text:p>\n```\n"
  },
  {
    "path": "test/command/6765.md",
    "content": "```\n% pandoc --citeproc -t plain\n@book_chapter_1 [55] says blah.\n\n---\ncsl: command/chicago-fullnote-bibliography.csl\nreferences:\n- id: book_chapter_1\n  author:\n    - family: Author\n      given: Ann\n  container-title: A book\n  editor:\n    - family: Editor\n      given: Edward\n  issued: 2014\n  page: 48-67\n  publisher: A publisher\n  publisher-place: A place\n  title: A book chapter\n  type: chapter\n...\n^D\nAnn Author[1] says blah.\n\nAuthor, Ann. “A Book Chapter.” In A Book, edited by Edward Editor,\n48–67. A place: A publisher, 2014.\n\n[1] “A Book Chapter,” in A Book, ed. Edward Editor (A place: A\npublisher, 2014), 55.\n```\n"
  },
  {
    "path": "test/command/6768.md",
    "content": "```\n% pandoc -tcommonmark\n::: custom_div\nThis is a div\n:::\n^D\n<div class=\"custom_div\">\n\nThis is a div\n\n</div>\n```\n\n```\n% pandoc -tcommonmark-raw_html\n::: custom_div\nThis is a div\n:::\n^D\nThis is a div\n```\n"
  },
  {
    "path": "test/command/6774.md",
    "content": "```\n% pandoc -f native -t opendocument --quiet\n[Header 1 (\"chapter1\",[],[]) [Str \"The\",Space,Str \"Chapter\"]\n,Para [Str \"Chapter\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"The\",Space,Str \"Chapter\"] (\"#chapter1\",\"\")]]\n^D\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"chapter1\" />The\nChapter<text:bookmark-end text:name=\"chapter1\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Chapter 1 references\n<text:a xlink:type=\"simple\" xlink:href=\"#chapter1\" office:name=\"\"><text:span text:style-name=\"Definition\">The\nChapter</text:span></text:a></text:p>\n```\n```\n% pandoc -f native -t opendocument+xrefs_name --quiet\n[Header 1 (\"chapter1\",[],[]) [Str \"The\",Space,Str \"Chapter\"]\n,Para [Str \"Chapter\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"The\",Space,Str \"Chapter\"] (\"#chapter1\",\"\")]\n,Figure (\"lalune\",[],[]) (Caption Nothing [Para [Str \"Voyage dans la Lune\"]]) [Plain [Image (\"\",[],[]) [Str \"lalune\"] (\"lalune.jpg\",\"\")]]\n,Para [Str \"Image\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"La\",Space,Str \"Lune\"] (\"#lalune\",\"\")]]\n^D\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"chapter1\" />The\nChapter<text:bookmark-end text:name=\"chapter1\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Chapter 1 references\n<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"chapter1\">The\nChapter</text:bookmark-ref></text:p>\n<text:p text:style-name=\"FigureWithCaption\"><draw:frame draw:name=\"img1\"><draw:image xlink:href=\"lalune.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame></text:p>\n<text:p text:style-name=\"FigureCaption\">Voyage dans la Lune</text:p>\n<text:p text:style-name=\"Text_20_body\">Image 1 references\n<text:sequence-ref text:reference-format=\"caption\" text:ref-name=\"lalune\">La\nLune</text:sequence-ref></text:p>\n```\n```\n% pandoc -f native -t opendocument+xrefs_number --quiet\n[Header 1 (\"chapter1\",[],[]) [Str \"The\",Space,Str \"Chapter\"]\n,Para [Str \"Chapter\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"The\",Space,Str \"Chapter\"] (\"#chapter1\",\"\")]\n,Figure (\"lalune\",[],[]) (Caption Nothing [Para [Str \"lalune\"]]) [Plain [Image (\"\",[],[]) [Str \"lalune\"] (\"lalune.jpg\",\"Voyage dans la Lune\")]]\n,Para [Str \"Image\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"La\",Space,Str \"Lune\"] (\"#lalune\",\"\")]]\n^D\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"chapter1\" />The\nChapter<text:bookmark-end text:name=\"chapter1\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Chapter 1 references\n<text:bookmark-ref text:reference-format=\"number\" text:ref-name=\"chapter1\"></text:bookmark-ref></text:p>\n<text:p text:style-name=\"FigureWithCaption\"><draw:frame draw:name=\"img1\"><draw:image xlink:href=\"lalune.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame></text:p>\n<text:p text:style-name=\"FigureCaption\">lalune</text:p>\n<text:p text:style-name=\"Text_20_body\">Image 1 references\n<text:sequence-ref text:reference-format=\"value\" text:ref-name=\"lalune\"></text:sequence-ref></text:p>\n```\n```\n% pandoc -f native -t opendocument+xrefs_number+xrefs_name --quiet\n[Header 1 (\"chapter1\",[],[]) [Str \"The\",Space,Str \"Chapter\"]\n,Para [Str \"Chapter\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"The\",Space,Str \"Chapter\"] (\"#chapter1\",\"\")]\n,Figure (\"lalune\",[],[]) (Caption Nothing [Para [Str \"Voyage dans la Lune\"]]) [Plain [Image (\"\",[],[]) [Str \"lalune\"] (\"lalune.jpg\",\"\")]]\n,Para [Str \"Image\",Space,Str \"1\",Space,Str \"references\",Space,Link (\"\",[],[]) [Str \"La\",Space,Str \"Lune\"] (\"#lalune\",\"\")]]\n^D\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"chapter1\" />The\nChapter<text:bookmark-end text:name=\"chapter1\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Chapter 1 references\n<text:bookmark-ref text:reference-format=\"number\" text:ref-name=\"chapter1\"></text:bookmark-ref><text:s /><text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"chapter1\">The\nChapter</text:bookmark-ref></text:p>\n<text:p text:style-name=\"FigureWithCaption\"><draw:frame draw:name=\"img1\"><draw:image xlink:href=\"lalune.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame></text:p>\n<text:p text:style-name=\"FigureCaption\">Voyage dans la Lune</text:p>\n<text:p text:style-name=\"Text_20_body\">Image 1 references\n<text:sequence-ref text:reference-format=\"value\" text:ref-name=\"lalune\"></text:sequence-ref><text:s /><text:sequence-ref text:reference-format=\"caption\" text:ref-name=\"lalune\">La\nLune</text:sequence-ref></text:p>\n```\n"
  },
  {
    "path": "test/command/6783.md",
    "content": "```\n% pandoc -f markdown -t plain -s --citeproc\n---\nreferences:\n- author:\n  - family: Jupyter\n    given: Project\n  container-title: Proceedings of the 17th Python in Science Conference\n  id: 'ref-1'\n  issued: 2018\n  title: 'Binder 2.0 - Reproducible, interactive, sharable environments for science at scale'\n  type: 'paper-conference'\n  volume:\n...\n\nThis is a test[@ref-1].\n^D\n\n\nThis is a test(Jupyter 2018).\n\nJupyter, Project. 2018. “Binder 2.0 - Reproducible, Interactive,\nSharable Environments for Science at Scale.” Proceedings of the 17th\nPython in Science Conference.\n```\n\n"
  },
  {
    "path": "test/command/6791.md",
    "content": "```\n% pandoc -f docbook -t native --quiet\n<informaltable frame=\"all\" rowsep=\"1\" colsep=\"1\">\n<?dbfo table-width=\"50%\"?>\n<tgroup cols=\"2\">\n<colspec colname=\"col_1\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_2\" colwidth=\"6.25*\"/>\n<tbody>\n<row>\n<entry align=\"center\" valign=\"top\"><simpara>2</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>1</simpara></entry>\n</row>\n</tbody>\n</tgroup>\n</informaltable>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.25 )\n    , ( AlignDefault , ColWidth 0.25 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/6792.md",
    "content": "```\n% pandoc -f native -t opendocument -s --quiet\n[Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 0.25)\n ,(AlignDefault,ColWidth 0.25)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n    [Para [Str \"2\"]]\n   ,Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n    [Para [Str \"1\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\" xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" office:version=\"1.3\">\n  <office:font-face-decls>\n    <style:font-face style:name=\"Courier New\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\" svg:font-family=\"'Courier New'\" />\n  </office:font-face-decls>\n  <office:automatic-styles>\n    <style:style style:name=\"fr2\" style:family=\"graphic\" style:parent-style-name=\"Formula\"><style:graphic-properties style:vertical-pos=\"middle\" style:vertical-rel=\"text\" style:horizontal-pos=\"center\" style:horizontal-rel=\"paragraph-content\" style:wrap=\"none\" /></style:style>\n    <style:style style:name=\"fr1\" style:family=\"graphic\" style:parent-style-name=\"Formula\"><style:graphic-properties style:vertical-pos=\"middle\" style:vertical-rel=\"text\" /></style:style>\n    <style:style style:name=\"P1\" style:family=\"paragraph\" style:parent-style-name=\"Table_20_Contents\">\n      <style:paragraph-properties fo:text-align=\"center\" style:justify-single-word=\"false\" />\n    </style:style>\n    <style:style style:name=\"P2\" style:family=\"paragraph\" style:parent-style-name=\"Table_20_Contents\">\n      <style:paragraph-properties fo:text-align=\"center\" style:justify-single-word=\"false\" />\n    </style:style>\n    <style:style style:name=\"TableHeaderRowCell\" style:family=\"table-cell\">\n      <style:table-cell-properties fo:border=\"none\" />\n    </style:style>\n    <style:style style:name=\"TableRowCell\" style:family=\"table-cell\">\n      <style:table-cell-properties fo:border=\"none\" />\n    </style:style>\n    <style:style style:name=\"Table1\" style:family=\"table\">\n      <style:table-properties table:align=\"center\" style:rel-width=\"50%\" />\n    </style:style>\n    <style:style style:name=\"Table1.A\" style:family=\"table-column\">\n      <style:table-column-properties style:rel-column-width=\"16383*\" />\n    </style:style>\n    <style:style style:name=\"Table1.B\" style:family=\"table-column\">\n      <style:table-column-properties style:rel-column-width=\"16383*\" />\n    </style:style>\n  </office:automatic-styles>\n<office:body>\n<office:text>\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P1\">2</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P2\">1</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n</office:text>\n</office:body>\n</office:document-content>\n```\n"
  },
  {
    "path": "test/command/6796.md",
    "content": "```\n% pandoc -f latex -t markdown\n\\newcommand{\\cL}{\\mathcal{L}}\n\\newcommand{\\til}[1]{\\tilde{#1}}\n\n$$\\til\\cL$$\n\n\\newcommand{\\mc}[1]{\\mathcal{#1}}\n\\newcommand{\\dL}{\\mc{L}}\n\n$$\\til\\dL$$\n^D\n$$\\tilde{\\mathcal{L}}$$\n\n$$\\tilde{\\mathcal{L}}$$\n```\n"
  },
  {
    "path": "test/command/6802.md",
    "content": "```\n% pandoc -f latex -t native\n\\blockquote[test][]{quote}\n^D\n[ BlockQuote [ Para [ Str \"quote\" ] , Para [ Str \"test\" ] ]\n]\n\n```\n"
  },
  {
    "path": "test/command/6821.md",
    "content": "```\n% pandoc -f native -t latex\n[ Para [ Code ( \"\" , [ \"python\" ] , [] ) \"x = 5\" ]\n, Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"This\"\n           , Space\n           , Str \"is\"\n           , Space\n           , Str \"a\"\n           , Space\n           , Str \"test\"\n           , Space\n           , Code ( \"\" , [ \"python\" ] , [] ) \"x = 5\"\n           ]\n       ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [] )\n            [ Str \"This\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"test\"\n            , Space\n            , Code ( \"\" , [ \"python\" ] , [] ) \"x = 5\"\n            ]\n            ( \"test.png\" , \"\" )\n        ]\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain [ Code ( \"\" , [ \"cpp\" ] , [] ) \"caption\" ] ])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" ] ]\n           ]\n       ])\n, Para [ Code ( \"\" , [ \"cpp\" ] , [] ) \"caption\" ]\n]\n^D\n\\VERB|\\NormalTok{x }\\OperatorTok{=} \\DecValTok{5}|\n\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={This is a test x = 5}]{test.png}}\n\\caption{This is a test\n\\protect\\VERB|\\NormalTok{x }\\OperatorTok{=} \\DecValTok{5}|}\n\\end{figure}\n\n\\begin{longtable}[]{@{}l@{}}\n\\caption{\\protect\\VERB|\\NormalTok{caption}|}\\tabularnewline\n\\toprule\\noalign{}\n\\endfirsthead\n\\endhead\n\\midrule\\noalign{}\nA \\\\\n\\bottomrule\\noalign{}\n\\endlastfoot\n\\end{longtable}\n\n\\VERB|\\NormalTok{caption}|\n```\n"
  },
  {
    "path": "test/command/6836.md",
    "content": "```\n% pandoc -t native\n[@buchanan]\n\n(@foo)\n\nSee @foo.\n\n[@buchanan]\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"buchanan\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = NormalCitation\n            , citationNoteNum = 1\n            , citationHash = 0\n            }\n        ]\n        [ Str \"[@buchanan]\" ]\n    ]\n, OrderedList ( 1 , Example , TwoParens ) [ [] ]\n, Para [ Str \"See\" , Space , Str \"1.\" ]\n, Para\n    [ Cite\n        [ Citation\n            { citationId = \"buchanan\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = NormalCitation\n            , citationNoteNum = 2\n            , citationHash = 0\n            }\n        ]\n        [ Str \"[@buchanan]\" ]\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/6837.md",
    "content": "```\n% pandoc -t markdown --markdown-headings=setext\n## Hi\n\n### Ok\n^D\nHi\n--\n\n### Ok\n```\n\n```\n% pandoc -t markdown+lhs\n# Hi\n^D\n2> [WARNING] Rendering heading 'Hi' as a paragraph.\n2>   ATX headings cannot be used in literate Haskell, because '#' is not\n2>   allowed in column 1. Consider using --markdown-headings=setext.\nHi\n```\n\n```\n% pandoc -t markdown --markdown-headings=atx\nHi\n--\n^D\n## Hi\n```\n"
  },
  {
    "path": "test/command/6844.md",
    "content": "Negative numbers with siunitx\n\n```\n% pandoc -f latex -t native\n\\SI{123}{\\celsius}\n\n^D\n[ Para [ Str \"123\\160\\176C\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\SI{-123}{\\celsius}\n\n^D\n[ Para [ Str \"\\8722\\&123\\160\\176C\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\SI{+123}{\\celsius}\n\n^D\n[ Para [ Str \"123\\160\\176C\" ] ]\n```\n\n\n"
  },
  {
    "path": "test/command/6855.md",
    "content": "```\n% pandoc -t markdown\n(@a) one\n(@b) two\n\nSee (@a--@b)\n^D\n(1) one\n(2) two\n\nSee (1--2)\n```\n"
  },
  {
    "path": "test/command/6858.md",
    "content": "```\n% pandoc -t markdown -f man\n.TH FvwmAnimate 1 \"Date\" Fvwm \"Fvwm Modules\"\n.UC\n.SH NAME\n\\fBFvwmAnimate\\fP \\- the fvwm animate module\n.SH SYNOPSIS\nModule FvwmAnimate [ModuleAlias]\n\n.IP \"*FvwmAnimate: Color \\fBcolor\\fP\"\n\nTells \\fBFvwmAnimate\\fP what color to draw with.\nThe color is \"XOR'ed\" (exclusive ORed) onto the background.\n\n.IP \"*FvwmAnimate: Pixmap \\fBpixmap\\fP\"\n\nTells \\fBFvwmAnimate\\fP to use \\fBpixmap\\fP to draw with. This can be useful\nif \\fB*FvwmAnimate: Color\\fP gives poor results.\n^D\n# NAME\n\n**FvwmAnimate** - the fvwm animate module\n\n# SYNOPSIS\n\nModule FvwmAnimate \\[ModuleAlias\\]\n\n\\*FvwmAnimate: Color color\n\n:   Tells **FvwmAnimate** what color to draw with. The color is\n    \\\"XOR\\'ed\\\" (exclusive ORed) onto the background.\n\n\\*FvwmAnimate: Pixmap pixmap\n\n:   Tells **FvwmAnimate** to use **pixmap** to draw with. This can be\n    useful if **\\*FvwmAnimate: Color** gives poor results.\n```\n\n```\n% pandoc -t markdown -f man\n.IP \"\\[bu]\"\n\nhi\n\n.IP \"\\[bu]\"\n\nthere\n^D\n- hi\n\n- there\n```\n"
  },
  {
    "path": "test/command/6869.md",
    "content": "```\n% pandoc -f latex -t native\n\\cite[„Aber“]{key}\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"key\"\n            , citationPrefix = []\n            , citationSuffix = [ Str \"\\8222Aber\\8220\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ RawInline (Format \"latex\") \"\\\\cite[\\8222Aber\\8220]{key}\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6873.md",
    "content": "```\n% pandoc -f latex -t native --citeproc\n\\cite[„Etwas […{]} auslassen“]{key}\n^D\n2> [WARNING] Citeproc: citation key not found\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"key\"\n            , citationPrefix = []\n            , citationSuffix =\n                [ Str \"\\8222Etwas\"\n                , Space\n                , Str \"[\\8230\"\n                , Span ( \"\" , [] , [] ) [ Str \"]\" ]\n                , Space\n                , Str \"auslassen\\8220\"\n                ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"(\"\n        , Strong [ Str \"key?\" ]\n        , Str \"\\8222Etwas\"\n        , Space\n        , Str \"[\\8230\"\n        , Span ( \"\" , [] , [] ) [ Str \"]\" ]\n        , Space\n        , Str \"auslassen\\8220)\"\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6890.md",
    "content": "```\n% pandoc -t native --citeproc\n---\nreferences:\n- author:\n  - family: Früchtel\n    given: Frank\n  - family: Budde\n    given: Wolfgang\n  - family: Cyprian\n    given: Gudrun\n  edition: 3\n  id: fruchtel-sozialer-2013a\n  issued: 2013\n  language: de-DE\n  publisher: Springer VS\n  publisher-place: Wiesbaden, Germany\n  title: \"Sozialer Raum und Soziale Arbeit Fieldbook: Methoden und\n    Techniken\"\n  title-short: Sozialer Raum und Soziale Arbeit Fieldbook\n  type: book\n---\n\n@fruchtel-sozialer-2013a\n\nSome text.[^1]\n\n[^1]: @fruchtel-sozialer-2013a\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"fruchtel-sozialer-2013a\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = AuthorInText\n            , citationNoteNum = 1\n            , citationHash = 0\n            }\n        ]\n        [ Str \"Fr\\252chtel\"\n        , Space\n        , Str \"et\"\n        , Space\n        , Str \"al.\"\n        , Space\n        , Str \"(2013)\"\n        ]\n    ]\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text.\"\n    , Note\n        [ Para\n            [ Cite\n                [ Citation\n                    { citationId = \"fruchtel-sozialer-2013a\"\n                    , citationPrefix = []\n                    , citationSuffix = []\n                    , citationMode = AuthorInText\n                    , citationNoteNum = 2\n                    , citationHash = 0\n                    }\n                ]\n                [ Str \"Fr\\252chtel\"\n                , Space\n                , Str \"et\"\n                , Space\n                , Str \"al.\"\n                , Space\n                , Str \"(2013)\"\n                ]\n            ]\n        ]\n    ]\n, Div\n    ( \"refs\"\n    , [ \"references\" , \"csl-bib-body\" , \"hanging-indent\" ]\n    , []\n    )\n    [ Div\n        ( \"ref-fruchtel-sozialer-2013a\" , [ \"csl-entry\" ] , [] )\n        [ Para\n            [ Str \"Fr\\252chtel,\"\n            , Space\n            , Str \"Frank,\"\n            , Space\n            , Str \"Wolfgang\"\n            , Space\n            , Str \"Budde,\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"Gudrun\"\n            , Space\n            , Str \"Cyprian.\"\n            , Space\n            , Str \"2013.\"\n            , Space\n            , Emph\n                [ Str \"Sozialer\"\n                , Space\n                , Str \"Raum\"\n                , Space\n                , Str \"und\"\n                , Space\n                , Str \"Soziale\"\n                , Space\n                , Str \"Arbeit\"\n                , Space\n                , Str \"Fieldbook:\"\n                , Space\n                , Str \"Methoden\"\n                , Space\n                , Str \"und\"\n                , Space\n                , Str \"Techniken\"\n                ]\n            , Str \".\"\n            , Space\n            , Str \"3rd\"\n            , Space\n            , Str \"ed.\"\n            , Space\n            , Str \"Springer\"\n            , Space\n            , Str \"VS.\"\n            ]\n        ]\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/6925.md",
    "content": "```\n% pandoc -f latex -t markdown\n\\documentclass{amsart}\n\\newtheorem{thm}{Theorem}[section]\n\\theoremstyle{definition}\n\\newtheorem{thm2}[section]{Theorem}\n\\begin{document}\n\\begin{thm}\na\n\\begin{figure}\n\\includegraphics[]{1.png}\n\\end{figure}\n\\end{thm}\n\n\\begin{thm2}\na\n\\begin{figure}\n\\includegraphics[]{1.png}\n\\end{figure}\n\\end{thm2}\n\\end{document}\n^D\n::: thm\n**Theorem 1**. *a*\n\n![](1.png)\n:::\n\n::: thm2\n**Theorem 1**. a\n\n![](1.png)\n:::\n```\n"
  },
  {
    "path": "test/command/6948.md",
    "content": "Treat an image alone in its paragraph (but not a figure)\nas an independent image:\n```\n% pandoc -f native -t rst\n[Para [Image (\"\",[\"align-center\"],[]) [Str \"https://pandoc.org/diagram.jpg\"] (\"https://pandoc.org/diagram.jpg\",\"\")]]\n^D\n|https://pandoc.org/diagram.jpg|\n\n.. |https://pandoc.org/diagram.jpg| image:: https://pandoc.org/diagram.jpg\n```\n\nHere we just omit the center attribute as it's not valid:\n```\n% pandoc -f native -t rst\n[Para [Str \"hi\",Space,Image (\"\",[\"align-center\"],[]) [Str \"https://pandoc.org/diagram.jpg\"] (\"https://pandoc.org/diagram.jpg\",\"\")]]\n^D\nhi |https://pandoc.org/diagram.jpg|\n\n.. |https://pandoc.org/diagram.jpg| image:: https://pandoc.org/diagram.jpg\n```\n\nBut we can use top, middle, or bottom alignment:\n```\n% pandoc -f native -t rst\n[Para [Str \"hi\",Space,Image (\"\",[\"align-top\"],[]) [Str \"https://pandoc.org/diagram.jpg\"] (\"https://pandoc.org/diagram.jpg\",\"\")]]\n^D\nhi |https://pandoc.org/diagram.jpg|\n\n.. |https://pandoc.org/diagram.jpg| image:: https://pandoc.org/diagram.jpg\n   :align: top\n```\n"
  },
  {
    "path": "test/command/6951.md",
    "content": "```\n% pandoc --citeproc -t plain --bibliography command/biblio.bib\n---\nreferences:\n- id: foo\n  title: Crazy\n  type: book\n...\n\n[@foo; @item1]\n\n^D\n(Crazy, n.d.; Doe 2005)\n\nCrazy. n.d.\n\nDoe, John. 2005. First Book. Cambridge University Press.\n```\n"
  },
  {
    "path": "test/command/6958.md",
    "content": "Add thin space between single and double quotes.\n```\n% pandoc -t latex+smart\n---\nlang: en-GB\n---\n'[\"On the Outside\"]{}: Constructing Cycling Citizenship.'\n^D\n`\\,{``On the Outside''}: Constructing Cycling Citizenship.'\n```\n"
  },
  {
    "path": "test/command/6959.md",
    "content": "```\n% pandoc -t docx -o - | pandoc -f docx -t markdown --track-changes=all\n[This is the comment]{.comment-start id=\"1\" author=\"Mike\"\ndate=\"2020-12-17T16:53:00Z\"} [Here is my reply]{.comment-start id=\"2\"\nauthor=\"Mike\" date=\"2020-12-17T17:39:00Z\"} This is the content being\ncommented on [[]{.comment-end id=\"2\"}]{.comment-end id=\"1\"}\n^D\n[This is the comment]{.comment-start id=\"1\" author=\"Mike\"\ndate=\"2020-12-17T16:53:00Z\"} [Here is my reply]{.comment-start id=\"2\"\nauthor=\"Mike\" date=\"2020-12-17T17:39:00Z\"} This is the content being\ncommented on [[]{.comment-end id=\"2\"}]{.comment-end id=\"1\"}\n```\n"
  },
  {
    "path": "test/command/6970.md",
    "content": "```\n% pandoc -f html -t native\n<a name=\"foo\" class=\"bar baz\" href='https://example.com' target='_blank'>https://example.com<a>\n^D\n[ Plain\n    [ Link\n        ( \"foo\" , [ \"bar\" , \"baz\" ] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"https://example.com\" ]\n        ( \"https://example.com\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/6992.md",
    "content": "```\n% pandoc -f mediawiki -t native\n{| class=\"wikitable\"\n!colspan=4 | template request\n|-\n| mode || No || String || MUST be \"template\" or omitted\n|}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 4)\n               [ Para [ Str \"template\" , Space , Str \"request\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"mode\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"No\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"String\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para\n                    [ Str \"MUST\"\n                    , Space\n                    , Str \"be\"\n                    , Space\n                    , Str \"\\\"template\\\"\"\n                    , Space\n                    , Str \"or\"\n                    , Space\n                    , Str \"omitted\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n\n```\n"
  },
  {
    "path": "test/command/6993.md",
    "content": "```\n% pandoc -f mediawiki -t native\n'''Should be bold '''\n^D\n[ Para\n    [ Strong\n        [ Str \"Should\" , Space , Str \"be\" , Space , Str \"bold\" ]\n    ]\n]\n```\n\n```\n% pandoc -f mediawiki -t native\n''' Should be bold'''\n^D\n[ Para\n    [ Strong\n        [ Str \"Should\" , Space , Str \"be\" , Space , Str \"bold\" ]\n    ]\n]\n```\n\n```\n% pandoc -f mediawiki -t native\n'' Should be emph ''\n^D\n[ Para\n    [ Emph\n        [ Str \"Should\" , Space , Str \"be\" , Space , Str \"emph\" ]\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/7003.md",
    "content": "```\n% pandoc -f latex -t native\n\\documentclass{article}\n\\usepackage{listings}\n\n\\lstset{basicstyle=\\ttfamily}\n\n\\begin{filecontents*}[overwrite]{example.tex}\n\\documentclass{article}\n\\begin{document}\n\\section{Bar}\nThis a Bar section\n\\end{document}\n\\end{filecontents*}\n\n\\begin{document}\n\n\\section{With lstlisting environment}\n\n\\begin{lstlisting}\n\\documentclass{article}\n\\begin{document}\n\\section{Foo}\nThis a Foo section\n\\end{document}\n\\end{lstlisting}\n\n\\section{With lstinputlisting command}\n\n\\lstinputlisting{example.tex}\n\\end{document}\n^D\n[ Header\n    1\n    ( \"with-lstlisting-environment\" , [] , [] )\n    [ Str \"With\"\n    , Space\n    , Str \"lstlisting\"\n    , Space\n    , Str \"environment\"\n    ]\n, CodeBlock\n    ( \"\" , [] , [] )\n    \"\\\\documentclass{article}\\n\\\\begin{document}\\n\\\\section{Foo}\\nThis a Foo section\\n\\\\end{document}\"\n, Header\n    1\n    ( \"with-lstinputlisting-command\" , [] , [] )\n    [ Str \"With\"\n    , Space\n    , Str \"lstinputlisting\"\n    , Space\n    , Str \"command\"\n    ]\n, CodeBlock\n    ( \"\" , [ \"latex\" ] , [] )\n    \"\\\\documentclass{article}\\n\\\\begin{document}\\n\\\\section{Bar}\\nThis a Bar section\\n\\\\end{document}\"\n]\n```\n"
  },
  {
    "path": "test/command/7006.md",
    "content": "```\n% pandoc -t html\nTest.[^fn]\n\n[^fn]: Foo:\n\n    ![Caption.](/image.jpg)\n^D\n<p>Test.<a href=\"#fn1\" class=\"footnote-ref\" id=\"fnref1\"\nrole=\"doc-noteref\"><sup>1</sup></a></p>\n<section id=\"footnotes\" class=\"footnotes footnotes-end-of-document\"\nrole=\"doc-endnotes\">\n<hr />\n<ol>\n<li id=\"fn1\"><p>Foo:</p>\n<figure>\n<img src=\"/image.jpg\" alt=\"Caption.\" />\n<figcaption aria-hidden=\"true\">Caption.</figcaption>\n</figure>\n<a href=\"#fnref1\" class=\"footnote-back\" role=\"doc-backlink\">↩︎</a></li>\n</ol>\n</section>\n```\n"
  },
  {
    "path": "test/command/7009.md",
    "content": "```\n% pandoc -t gfm\n3. a\n4. b\n^D\n3.  a\n4.  b\n```\n"
  },
  {
    "path": "test/command/7016.md",
    "content": "```\n% pandoc --citeproc --to=jats_archiving --standalone\n---\ncsl: command/apa.csl\nreferences:\n- id: doe\n  type: article\n  author:\n  - family: Doe\n    given: Jane\n  container-title: Proceedings of the Academy of Test Inputs\n  doi: 10.x/nope\n  issued: 2021\n  title: Another article\n...\nBlah [@doe].\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<p>Blah (Doe, 2021).</p>\n</body>\n<back>\n<ref-list>\n  <title></title>\n  <ref id=\"ref-doe\">\n    <mixed-citation>Doe, J. (2021). Another article. <italic>Proceedings\n    of the Academy of Test Inputs</italic>.\n    doi:<ext-link ext-link-type=\"uri\" xlink:href=\"https://doi.org/10.x/nope\">10.x/nope</ext-link></mixed-citation>\n  </ref>\n</ref-list>\n</back>\n</article>\n```\n"
  },
  {
    "path": "test/command/7041.md",
    "content": "```\n% pandoc -f html -t jats\n<table>\n  <tr><td><blockquote>Fly, you fools!</blockquote></td></tr>\n</table>\n^D\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"100%\" />\n    </colgroup>\n    <tbody>\n      <tr>\n        <td><p specific-use=\"wrapper\">\n          <disp-quote>\n            <p>Fly, you fools!</p>\n          </disp-quote>\n        </p></td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n```\n"
  },
  {
    "path": "test/command/7042.md",
    "content": "```\n% pandoc -f markdown -t jats_publishing+element_citations --citeproc -s\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Jane\n    given: Doe\n  container-title: Public Library of Tests\n  id: year-month\n  issued: 1999-08\n  title: Year and month\n  type: article-journal\n- accessed: 1999-01-22\n  author:\n  - family: Negidius\n    given: Numerius\n  - literal: others\n  container-title: Public Library of Tests\n  id: access-date\n  issued: 1911-10-03\n  title: Entry with access date and et al.\n  type: article-journal\n- author:\n  - family: Beethoven\n    given: Ludwig\n    dropping-particle: van\n  - family: Bray\n    given: Jan\n    non-dropping-particle: de\n  container-title: Public Library of Tests\n  id: name-particles\n  issued: 1820\n  title: Name particles, dropping and non-dropping\n  type: article-journal\n- author:\n  - 宮水 三葉\n  - 立花 瀧\n  title: Big Book of Tests\n  id: book-with-japanese-authors\n  issued: 2016\n  type: book\n- author:\n  - family: Watson\n    given: J. D.\n  - family: Crick\n    given: F. H. C.\n  container-title: Nature\n  doi: '10.1038/171737a0'\n  id: full-journal-article-entry\n  issue: 4356\n  issued: '1953-04-01'\n  page: 737-738\n  pmid: 13054692\n  title: 'Molecular Structure of Nucleic Acids: A Structure for Deoxyribose Nucleic Acid'\n  type: article-journal\n  volume: 171\n...\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN\"\n                  \"JATS-publishing1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n\n</body>\n<back>\n<ref-list>\n  <title></title>\n  <ref id=\"ref-year-month\">\n    <element-citation publication-type=\"article-journal\">\n      <person-group person-group-type=\"author\">\n        <name><surname>Jane</surname><given-names>Doe</given-names></name>\n      </person-group>\n      <article-title>Year and month</article-title>\n      <source>Public Library of Tests</source>\n      <year iso-8601-date=\"1999-08\">1999</year><month>08</month>\n    </element-citation>\n  </ref>\n  <ref id=\"ref-access-date\">\n    <element-citation publication-type=\"article-journal\">\n      <person-group person-group-type=\"author\">\n        <name><surname>Negidius</surname><given-names>Numerius</given-names></name>\n        <etal/>\n      </person-group>\n      <article-title>Entry with access date and et al.</article-title>\n      <source>Public Library of Tests</source>\n      <year iso-8601-date=\"1911-10-03\">1911</year><month>10</month><day>03</day>\n      <date-in-citation content-type=\"access-date\"><year iso-8601-date=\"1999-01-22\">1999</year><month>01</month><day>22</day></date-in-citation>\n    </element-citation>\n  </ref>\n  <ref id=\"ref-name-particles\">\n    <element-citation publication-type=\"article-journal\">\n      <person-group person-group-type=\"author\">\n        <name><surname>Beethoven</surname><given-names>Ludwig van</given-names></name>\n        <name><surname>de Bray</surname><given-names>Jan</given-names></name>\n      </person-group>\n      <article-title>Name particles, dropping and non-dropping</article-title>\n      <source>Public Library of Tests</source>\n      <year iso-8601-date=\"1820\">1820</year>\n    </element-citation>\n  </ref>\n  <ref id=\"ref-book-with-japanese-authors\">\n    <element-citation publication-type=\"book\">\n      <person-group person-group-type=\"author\">\n        <string-name>宮水 三葉</string-name>\n        <string-name>立花 瀧</string-name>\n      </person-group>\n      <source>Big Book of Tests</source>\n      <year iso-8601-date=\"2016\">2016</year>\n    </element-citation>\n  </ref>\n  <ref id=\"ref-full-journal-article-entry\">\n    <element-citation publication-type=\"article-journal\">\n      <person-group person-group-type=\"author\">\n        <name><surname>Watson</surname><given-names>J. D.</given-names></name>\n        <name><surname>Crick</surname><given-names>F. H. C.</given-names></name>\n      </person-group>\n      <article-title>Molecular Structure of Nucleic Acids: A Structure for Deoxyribose Nucleic Acid</article-title>\n      <source>Nature</source>\n      <year iso-8601-date=\"1953-04-01\">1953</year><month>04</month><day>01</day>\n      <volume>171</volume>\n      <issue>4356</issue>\n      <pub-id pub-id-type=\"doi\">10.1038/171737a0</pub-id>\n      <pub-id pub-id-type=\"pmid\">13054692</pub-id>\n      <fpage>737</fpage>\n      <lpage>738</lpage>\n    </element-citation>\n  </ref>\n</ref-list>\n</back>\n</article>\n\n```\n"
  },
  {
    "path": "test/command/7058.md",
    "content": "```\n% pandoc -f latex -t markdown\n5\\(-\\)8 \\(x\\)\n^D\n5$-$`<!-- -->`{=html}8 $x$\n```\n"
  },
  {
    "path": "test/command/7064.md",
    "content": "```\n% pandoc -f rst -t html\n.. csv-table:: Changes\n    :header: \"Version\", \"Date\", \"Description\"\n    :widths: 15, 15, 70\n    :delim: $\n\n    0.1.0 $ 18/02/2013 $ Initial Release\n^D\n<table>\n<caption>Changes</caption>\n<colgroup>\n<col style=\"width: 15%\" />\n<col style=\"width: 15%\" />\n<col style=\"width: 70%\" />\n</colgroup>\n<thead>\n<tr>\n<th>Version</th>\n<th>Date</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0.1.0</td>\n<td>18/02/2013</td>\n<td>Initial Release</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/7067.md",
    "content": "```\n% pandoc -t biblatex\n---\nreferences:\n- id: garaud\n  author:\n    - family: Garaud\n      given: Marcel\n  container-title: Bulletin de la Societé des antiquaires de l’Ouest\n  collection-title: 4\n  issued:\n    - year: 1967\n  language: fr-FR\n  page: 11-27\n  title: Recherches sur les défrichements dans la Gâtine poitevine aux XI^e^ et XII^e^ siècles\n  type: article-journal\n  volume: 9\n...\n^D\n@article{garaud,\n  author = {Garaud, Marcel},\n  title = {Recherches sur les défrichements dans la Gâtine poitevine aux\n    XI\\textsuperscript{e} et XII\\textsuperscript{e} siècles},\n  journal = {Bulletin de la Societé des antiquaires de l’Ouest},\n  series = {4},\n  volume = {9},\n  pages = {11-27},\n  date = {1967},\n  langid = {fr-FR}\n}\n```\n\n```\n% pandoc -t bibtex\n---\nreferences:\n- id: garaud\n  author:\n    - family: Garaud\n      given: Marcel\n  container-title: Bulletin de la Société des antiquaires de l’Ouest\n  collection-title: 4\n  issued:\n    - year: 1967\n  language: fr-FR\n  page: 11-27\n  title: Recherches sur les défrichements dans la Gâtine poitevine aux XI^e^ et XII^e^ siècles\n  type: article-journal\n  volume: 9\n...\n^D\n@article{garaud,\n  author = {Garaud, Marcel},\n  title = {{Recherches sur les défrichements dans la Gâtine poitevine\n    aux XI\\textsuperscript{e} et XII\\textsuperscript{e} siècles}},\n  journal = {Bulletin de la Société des antiquaires de l’Ouest},\n  series = {4},\n  volume = {9},\n  pages = {11-27},\n  year = {1967}\n}\n```\n\nThis tests the titlecasing of a word with an accented second letter:\n```\n% pandoc -t bibtex\n---\nreferences:\n- id: garaud\n  author:\n    - family: Garaud\n      given: Marcel\n  container-title: English Journal\n  issued:\n    - year: 1967\n  language: en-US\n  title: Research on the défrichements in the Gâtine poitevine\n  type: article-journal\n  volume: 9\n...\n^D\n@article{garaud,\n  author = {Garaud, Marcel},\n  title = {Research on the Défrichements in the {Gâtine} Poitevine},\n  journal = {English Journal},\n  volume = {9},\n  year = {1967}\n}\n```\n\n"
  },
  {
    "path": "test/command/7080.md",
    "content": "```\n% pandoc -f markdown_mmd -t native\n![][image]\n\n[image]: image.png width=100px height=150px\n^D\n[ Para\n    [ Image\n        ( \"\"\n        , []\n        , [ ( \"width\" , \"100px\" ) , ( \"height\" , \"150px\" ) ]\n        )\n        []\n        ( \"image.png\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7092.md",
    "content": "```\n% pandoc -flatex+raw_tex -t native\n\\newcommand{\\em}[1]{\\emph{#1}}\n\n\\em{\\parseMe{foo}}\n^D\n[ Para\n    [ Emph [ RawInline (Format \"latex\") \"\\\\parseMe{foo}\" ] ]\n]\n```\n"
  },
  {
    "path": "test/command/7099.md",
    "content": "```\n% pandoc -f html -t native --verbose\n<iframe src=\"\"></iframe>\n^D\n2> [INFO] Skipped '<iframe src></iframe>' at input line 1 column 16\n[]\n```\n\n```\n% pandoc -f html -t native --verbose\n<iframe src=\"h:invalid@url\"></iframe>\n^D\n2> [INFO] Fetching h:invalid@url...\n2> [WARNING] Could not fetch resource h:invalid@url: Could not fetch h:invalid@url\n2>   InvalidUrlException \"h:invalid@url\" \"Invalid scheme\"\n2> [INFO] Skipped '<iframe src=\"h:invalid@url\"></iframe>' at input line 1 column 29\n[]\n```\n"
  },
  {
    "path": "test/command/7112.md",
    "content": "```\n% pandoc -f rst\n.. csv-table::\n\n   setting, ``echo PATH=\"path\"``\n^D\n<table>\n<tbody>\n<tr>\n<td>setting</td>\n<td><code>echo PATH=\"path\"</code></td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/7129.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{tabular}{ll} \\hline\n  FOO & BAR         \\\\ \\hline\n  foo & \\verb|b&r|  \\\\ \\hline\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"FOO\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"BAR\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"foo\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Code ( \"\" , [] , [] ) \"b&r\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/7132.md",
    "content": "```\n% pandoc -f markdown -t org --columns=72\n- This line has exactly the wrong number of characters before the number 5.\n- Long line ending with a number (this time it is in parentheses and a 23)\n^D\n- This line has exactly the wrong number of characters before the\n  number 5.\n- Long line ending with a number (this time it is in parentheses and\n  a 23)\n```\n"
  },
  {
    "path": "test/command/7134.md",
    "content": "```\n% pandoc -f rst -t native\nThis is a paragraph.\n\n    This is a block quote.\n\n..\n\n    This should be a second block quote.\n^D\n[ Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"paragraph.\"\n    ]\n, BlockQuote\n    [ Para\n        [ Str \"This\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"block\"\n        , Space\n        , Str \"quote.\"\n        ]\n    ]\n, BlockQuote\n    [ Para\n        [ Str \"This\"\n        , Space\n        , Str \"should\"\n        , Space\n        , Str \"be\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"second\"\n        , Space\n        , Str \"block\"\n        , Space\n        , Str \"quote.\"\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7145.md",
    "content": "```\n% pandoc -f mediawiki -t native\nMaecenas at sapien tempor, pretium turpis ut, imperdiet augue.<ref>This is a multiline\n\nreference\n<i>with</i>\nempty\n\nlinebreaks</ref>  Nulla ut massa eget ex venenatis lobortis id in eros.\n^D\n[ Para\n    [ Str \"Maecenas\"\n    , Space\n    , Str \"at\"\n    , Space\n    , Str \"sapien\"\n    , Space\n    , Str \"tempor,\"\n    , Space\n    , Str \"pretium\"\n    , Space\n    , Str \"turpis\"\n    , Space\n    , Str \"ut,\"\n    , Space\n    , Str \"imperdiet\"\n    , Space\n    , Str \"augue.\"\n    , Note\n        [ Para\n            [ Str \"This\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"multiline\"\n            ]\n        , Para\n            [ Str \"reference\"\n            , SoftBreak\n            , RawInline (Format \"html\") \"<i>\"\n            , Str \"with\"\n            , RawInline (Format \"html\") \"</i>\"\n            , SoftBreak\n            , Str \"empty\"\n            ]\n        , Para [ Str \"linebreaks\" ]\n        ]\n    , Space\n    , Str \"Nulla\"\n    , Space\n    , Str \"ut\"\n    , Space\n    , Str \"massa\"\n    , Space\n    , Str \"eget\"\n    , Space\n    , Str \"ex\"\n    , Space\n    , Str \"venenatis\"\n    , Space\n    , Str \"lobortis\"\n    , Space\n    , Str \"id\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"eros.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7155.md",
    "content": "```\n% pandoc -f markdown+tex_math_single_backslash -t native\n\\(x\\) \\[x\\]\n\\\\(x\\\\) \\\\[x\\\\]\n^D\n[ Para\n    [ Math InlineMath \"x\"\n    , Space\n    , Math DisplayMath \"x\"\n    , SoftBreak\n    , Str \"\\\\(x\\\\)\"\n    , Space\n    , Str \"\\\\[x\\\\]\"\n    ]\n]\n```\n\n```\n% pandoc -f markdown+tex_math_double_backslash -t native\n\\(x\\) \\[x\\]\n\\\\(x\\\\) \\\\[x\\\\]\n^D\n[ Para\n    [ Str \"(x)\"\n    , Space\n    , Str \"[x]\"\n    , SoftBreak\n    , Math InlineMath \"x\"\n    , Space\n    , Math DisplayMath \"x\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7172.md",
    "content": "```\n% pandoc -t markdown\n- one\n  - two\n^D\n- one\n  - two\n```\n\n```\n% pandoc -t markdown+four_space_rule\n- one\n  - two\n^D\n-   one\n    -   two\n```\n"
  },
  {
    "path": "test/command/7173.md",
    "content": "```\n% pandoc -f docbook -t latex\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE article PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd\">\n<?xml-model href=\"http://www.oxygenxml.com/docbook/xml/5.0/rng/dbmathml.rng\" schematypens=\"http://relaxng.org/ns/structure/1.0\"?>\n<?xml-model href=\"http://docbook.org/xml/5.0/rng/docbook.rng\" type=\"application/xml\" schematypens=\"http://purl.oclc.org/dsdl/schematron\"?>\n<article xmlns=\"http://docbook.org/ns/docbook\"\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n    version=\"5.1\">\n    <title>Untitled Document</title>\n    <para>Word</para>\n    <informalequation>\n        <alt role='tex'>1+2</alt>\n        <m:math xmlns:m=\"http://www.w3.org/1998/Math/MathML\">\n            <m:mrow>\n                <m:mrow><m:mn>1</m:mn><m:mo>+</m:mo><m:mn>2</m:mn>\n                </m:mrow>\n            </m:mrow>\n        </m:math>\n    </informalequation>\n</article>\n^D\nWord\n\n\\[1 + 2\\]\n```\n\n```\n% pandoc -f docbook -t latex\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE article PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd\">\n<?xml-model href=\"http://www.oxygenxml.com/docbook/xml/5.0/rng/dbmathml.rng\" schematypens=\"http://relaxng.org/ns/structure/1.0\"?>\n<?xml-model href=\"http://docbook.org/xml/5.0/rng/docbook.rng\" type=\"application/xml\" schematypens=\"http://purl.oclc.org/dsdl/schematron\"?>\n<article xmlns=\"http://docbook.org/ns/docbook\"\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n    version=\"5.1\">\n    <title>Untitled Document</title>\n    <para>Word</para>\n    <informalequation>\n        <alt role='tex'>1+2</alt>\n        <mml:math xmlns:mml=\"http://www.w3.org/1998/Math/MathML\">\n            <mml:mrow>\n                <mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:mn>2</mml:mn>\n                </mml:mrow>\n            </mml:mrow>\n        </mml:math>\n    </informalequation>\n</article>\n^D\nWord\n\n\\[1 + 2\\]\n```\n\n```\n% pandoc -f docbook -t latex\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE article PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd\">\n<?xml-model href=\"http://www.oxygenxml.com/docbook/xml/5.0/rng/dbmathml.rng\" schematypens=\"http://relaxng.org/ns/structure/1.0\"?>\n<?xml-model href=\"http://docbook.org/xml/5.0/rng/docbook.rng\" type=\"application/xml\" schematypens=\"http://purl.oclc.org/dsdl/schematron\"?>\n<article xmlns=\"http://docbook.org/ns/docbook\"\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n    version=\"5.1\">\n    <title>Untitled Document</title>\n    <para>Word</para>\n    <informalequation>\n        <alt role='tex'>1+2</alt>\n        <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n            <mrow>\n                <mrow><mn>1</mn><mo>+</mo><mn>2</mn>\n                </mrow>\n            </mrow>\n        </math>\n    </informalequation>\n</article>\n^D\nWord\n\n\\[1 + 2\\]\n```\n\n```\n% pandoc -f docbook -t latex\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE article PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd\">\n<?xml-model href=\"http://www.oxygenxml.com/docbook/xml/5.0/rng/dbmathml.rng\" schematypens=\"http://relaxng.org/ns/structure/1.0\"?>\n<?xml-model href=\"http://docbook.org/xml/5.0/rng/docbook.rng\" type=\"application/xml\" schematypens=\"http://purl.oclc.org/dsdl/schematron\"?>\n<article xmlns=\"http://docbook.org/ns/docbook\"\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n    xmlns:m=\"http://www.w3.org/1998/Math/MathML\"\n    version=\"5.1\">\n    <title>Untitled Document</title>\n    <para>Word</para>\n    <informalequation>\n        <alt role='tex'>1+2</alt>\n        <m:math>\n            <m:mrow>\n                <m:mrow><m:mn>1</m:mn><m:mo>+</m:mo><m:mn>2</m:mn>\n                </m:mrow>\n            </m:mrow>\n        </m:math>\n    </informalequation>\n</article>\n^D\nWord\n\n\\[1 + 2\\]\n```\n\n```\n% pandoc -f docbook -t latex\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE article PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd\">\n<?xml-model href=\"http://www.oxygenxml.com/docbook/xml/5.0/rng/dbmathml.rng\" schematypens=\"http://relaxng.org/ns/structure/1.0\"?>\n<?xml-model href=\"http://docbook.org/xml/5.0/rng/docbook.rng\" type=\"application/xml\" schematypens=\"http://purl.oclc.org/dsdl/schematron\"?>\n<article xmlns=\"http://docbook.org/ns/docbook\"\n    xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n    xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"\n    version=\"5.1\">\n    <title>Untitled Document</title>\n    <para>Word</para>\n    <informalequation>\n        <alt role='tex'>1+2</alt>\n        <mml:math>\n            <mml:mrow>\n                <mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:mn>2</mml:mn>\n                </mml:mrow>\n            </mml:mrow>\n        </mml:math>\n    </informalequation>\n</article>\n^D\nWord\n\n\\[1 + 2\\]\n```\n\n"
  },
  {
    "path": "test/command/7181.md",
    "content": "```\n% pandoc -t latex\n![Global frog population.](slides.pdf){page=13,trim=1cm,clip,width=4cm}\n^D\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,page=13,trim=1cm,clip,width=4cm,alt={Global frog population.}]{slides.pdf}}\n\\caption{Global frog population.}\n\\end{figure}\n\n```\n"
  },
  {
    "path": "test/command/7201.md",
    "content": "```\n% pandoc -t revealjs --slide-level=1\n# Overview\n\n:::::::::::::: {.columns}\n::: {.column width=\"40%\"}\n\nLeft column\n\n:::\n::: {.column width=\"60%\"}\n\n* First list\n    * subitem\n\n. . .\n\n* Second list\n    * subitem\n:::\n::::::::::::::\n^D\n<section id=\"overview\" class=\"slide level1\">\n<h1>Overview</h1>\n<div class=\"columns\">\n<div class=\"column\" style=\"width:40%;\">\n<p>Left column</p>\n</div><div class=\"column\" style=\"width:60%;\">\n<ul>\n<li>First list\n<ul>\n<li>subitem</li>\n</ul></li>\n</ul>\n<div class=\"fragment\">\n<ul>\n<li>Second list\n<ul>\n<li>subitem</li>\n</ul></li>\n</ul>\n</div>\n</div>\n</div>\n</section>\n\n```\n"
  },
  {
    "path": "test/command/7208.md",
    "content": "```\n% pandoc -t gfm\n\\<hi\\>\n^D\n\\<hi\\>\n```\n"
  },
  {
    "path": "test/command/7214.md",
    "content": "```\n% pandoc\n+------------+----------+------------------+\n|日本語      | の文字列 | words in english |\n+------------+----------+------------------+\n|abc defghij | def      | xyz              |\n+------------+----------+------------------+\n^D\n<table style=\"width:60%;\">\n<colgroup>\n<col style=\"width: 18%\" />\n<col style=\"width: 15%\" />\n<col style=\"width: 26%\" />\n</colgroup>\n<tbody>\n<tr>\n<td>日本語</td>\n<td>の文字列</td>\n<td>words in english</td>\n</tr>\n<tr>\n<td>abc defghij</td>\n<td>def</td>\n<td>xyz</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/7216.md",
    "content": "```\n% pandoc -t latex\n\"This is some text in quotes. Another paragraph by the same speaker follows. The first paragraph should have no close quote.\n\n\"The second paragraph should have open and close quotes.\"\n\n| \"Open quote on this line,\n| Close quote on the next line.\"\n| \"Quotes on the same line.\"\n^D\n``This is some text in quotes. Another paragraph by the same speaker\nfollows. The first paragraph should have no close quote.\n\n``The second paragraph should have open and close quotes.''\n\n``Open quote on this line,\\\\\nClose quote on the next line.''\\\\\n``Quotes on the same line.''\n```\n"
  },
  {
    "path": "test/command/7219.md",
    "content": "```\n% pandoc --citeproc -t plain\n---\nreferences:\n- author:\n  - family: Reese\n    given: Trevor R.\n  collection-title: 3rd series\n  container-title: William and Mary Quarterly\n  id: reese\n  issued: 1958\n  language: en-US\n  page: 168-190\n  title: Georgia in Anglo-Spanish diplomacy, 1736-1739\n  type: article-journal\n  volume: 15\n...\nand also in -@reese\n^D\nand also in (1958)\n\nReese, Trevor R. 1958. “Georgia in Anglo-Spanish Diplomacy, 1736-1739.”\nWilliam and Mary Quarterly, 3rd series, vol. 15: 168–90.\n\n```\n"
  },
  {
    "path": "test/command/7266.md",
    "content": "```\n% pandoc -f biblatex -t biblatex -s\n@article{id,\n  annote = \"annotation\"\n}\n^D\n@article{id,\n  annote = {annotation}\n}\n```\n"
  },
  {
    "path": "test/command/7272.md",
    "content": "```\n% pandoc -t latex -f html\n<table>\n  <tbody>\n    <tr>\n      <td>\n        <span>\n          text\n          <br />\n          text2\n        </span>\n      </td>\n    </tr>\n  </tbody>\n</table>\n^D\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 0\\tabcolsep) * \\real{1.0000}}@{}}\n\\toprule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n\\begin{minipage}[t]{\\linewidth}\\raggedright\n{ text\\\\\ntext2 }\\strut\n\\end{minipage} \\\\\n\\end{longtable}\n}\n```\n"
  },
  {
    "path": "test/command/7278.md",
    "content": "```\n% pandoc -t beamer\n# Slide\n\nSome blocks:\n\n## example block title {.example}\n\ntext in block\n\n## alert block title {.alert}\n\ntext in block\n\n## block title\n\ntext in block\n^D\n\\begin{frame}{Slide}\n\\protect\\phantomsection\\label{slide}\nSome blocks:\n\n\\begin{exampleblock}{example block title}\n\\protect\\phantomsection\\label{example-block-title}\ntext in block\n\\end{exampleblock}\n\n\\begin{alertblock}{alert block title}\n\\protect\\phantomsection\\label{alert-block-title}\ntext in block\n\\end{alertblock}\n\n\\begin{block}{block title}\n\\protect\\phantomsection\\label{block-title}\ntext in block\n\\end{block}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/7282.md",
    "content": "Don't crash on unmatched closing tag.\n```\n% pandoc -f html -t native\n</script>\n^D\n[]\n```\n"
  },
  {
    "path": "test/command/7288.md",
    "content": "```\n% pandoc -f rst -t ms\n.. list-table::\n   :widths: 50 50\n   :header-rows: 1\n\n   * - Left\n     - Right\n   * - Long text that should be easy to break up into multiple lines\n     - Another long text that should be easy to break up into multiple lines\n\n       Bar\n^D\n.PP\n.na\n.nr LLold \\n[LL]\n.TS\ndelim(@@) tab(\t);\nlw(35.0n) lw(35.0n).\nT{\nLeft\nT}\tT{\nRight\nT}\n_\nT{\n.nr LL 35.0n\n.LP\nLong text that should be easy to break up into multiple lines\nT}\tT{\n.nr LL 35.0n\n.PP\nAnother long text that should be easy to break up into multiple lines\n.PP\nBar\nT}\n.TE\n.nr LL \\n[LLold]\n.ad\n```\n"
  },
  {
    "path": "test/command/7299.md",
    "content": "```\n% pandoc -f latex -t plain\n$1-{\\ensuremath{r}\\xspace}$\n^D\n1 − r\n```\n\n```\n% pandoc -f latex -t plain\n\\newcommand{\\foo}{Foo\\xspace}\n\n$\\text{\\foo bar}$\n^D\nFoo bar\n```\n\n```\n% pandoc -f latex -t plain\na\\xspace b\n^D\na b\n```\n\n"
  },
  {
    "path": "test/command/7321.md",
    "content": "```\n% pandoc -t plain --citeproc --wrap=none\n---\nreferences:\n- id: fenner2012a\n  title: One-click science marketing\n  author:\n  - family: Fenner\n    given: Martin\n  container-title: Nature Materials\n  volume: 11\n  issue: 4\n  publisher: Nature Publishing Group\n  type: article-journal\n  issued:\n    year: 2012\n---\n\n[@fenner2012a, $a^2+b^2=c^2$]\n^D\n(Fenner 2012, a² + b² = c²)\n\nFenner, Martin. 2012. “One-Click Science Marketing.” Nature Materials 11 (4).\n```\n"
  },
  {
    "path": "test/command/7323.md",
    "content": "```\n% pandoc --citeproc -t plain\n---\nreferences:\n- id: smith\n  author: John Smith\n  issued: 2019\n  title: Insects\n  type: book\n...\n\n@smith [chap. 6]\n\n@smith [chapter 6]\n\n@smith [Chap. 6]\n\n@smith [Chapter 6]\n^D\nJohn Smith (2019, chap. 6)\n\nJohn Smith (2019, chap. 6)\n\nJohn Smith (2019, chap. 6)\n\nJohn Smith (2019, chap. 6)\n\nJohn Smith. 2019. Insects.\n```\n"
  },
  {
    "path": "test/command/7324.md",
    "content": "```\n% pandoc --citeproc -t plain\n---\nreferences:\n- id: smith\n  author: John Smith\n  issued: 2019\n  title: Insects\n  type: book\n...\n\n@smith [, among others]\n\n@smith [ among others]\n\n@smith [among others]\n^D\nJohn Smith (2019, among others)\n\nJohn Smith (2019 among others)\n\nJohn Smith (2019, among others)\n\nJohn Smith. 2019. Insects.\n```\n"
  },
  {
    "path": "test/command/7326.md",
    "content": "Table with row and column spans\n```\n% pandoc -f html -t asciidoc\n<table>\n  <colgroup>\n    <col style=\"width: 17%\" />\n    <col style=\"width: 16%\" />\n    <col style=\"width: 15%\" />\n    <col style=\"width: 52%\" />\n  </colgroup>\n  <thead>\n    <tr>\n      <th>Header 1</th>\n      <th>Header 2</th>\n      <th>Header 3</th>\n      <th>Header 4</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>body row 1</td>\n      <td>column 2</td>\n      <td>column 3</td>\n      <td>column 4</td>\n    </tr>\n    <tr>\n      <td>body row 2</td>\n      <td colspan=\"2\">Cells may span columns.</td>\n      <td>fff</td>\n    </tr>\n    <tr>\n      <td>body row 3</td>\n      <td rowspan=\"2\">Cells may span rows.</td>\n      <td rowspan=\"2\">\n        <ul>\n          <li>Cells</li>\n          <li>can</li>\n          <li>contain</li>\n          <li>blocks.</li>\n        </ul>\n      </td>\n      <td rowspan=\"2\">\n        <ul>\n          <li>This is a very long line of text</li>\n          <li><a href=\"http://www.python.org/\">Python</a></li>\n          <li>b</li>\n          <li>c</li>\n        </ul>\n      </td>\n    </tr>\n    <tr>\n      <td>body row 4</td>\n    </tr>\n  </tbody>\n</table>\n^D\n[width=\"100%\",cols=\"17%,16%,15%,52%\",options=\"header\",]\n|===\n|Header 1 |Header 2 |Header 3 |Header 4\n|body row 1 |column 2 |column 3 |column 4\n|body row 2 2+|Cells may span columns. |fff\n|body row 3 .2+|Cells may span rows. .2+a|\n* Cells\n* can\n* contain\n* blocks.\n\n.2+a|\n* This is a very long line of text\n* http://www.python.org/[Python]\n* b\n* c\n\n|body row 4\n|===\n```\n\nHeader and footer.\nAsciiDoc only supports 1 header and 1 footer row.\nSo for multiple header and/or footer rows all the extra rows become part of the table body.\n```\n% pandoc -f html -t asciidoc\n<table>\n  <thead>\n    <tr>\n      <th colspan=\"2\">Inputs</th>\n      <th>Output</th>\n    </tr>\n    <tr>\n      <th>A</th>\n      <th>B</th>\n      <th>A or B</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <td>True</td>\n      <td>False</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <td>False</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td>A</td>\n      <td>B</td>\n      <td>A or B</td>\n    </tr>\n    <tr>\n      <td colspan=\"2\">Inputs</td>\n      <td>Output</td>\n    </tr>\n  </tfoot>\n</table>\n<table>\n  <thead>\n    <tr>\n      <th colspan=\"2\">Header</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>Body 1-1</td>\n      <td>Body 2-1</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td colspan=\"2\">Footer</td>\n    </tr>\n  </tfoot>\n</table>\n^D\n[cols=\",,\",options=\"header,footer\",]\n|===\n2+|Inputs |Output\n|A |B |A or B\n|False |False |False\n|True |False |True\n|False |True |True\n|True |True |True\n|A |B |A or B\n2+|Inputs |Output\n|===\n\n[cols=\",\",options=\"header,footer\",]\n|===\n2+|Header\n|Body 1-1 |Body 2-1\n2+|Footer\n|===\n```\n\nTable without header but with footer rows\n```\n% pandoc -f html -t asciidoc\n<table>\n  <colgroup>\n    <col style=\"width: 37%\" />\n    <col style=\"width: 37%\" />\n    <col style=\"width: 26%\" />\n  </colgroup>\n  <tbody>\n    <tr>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <td>True</td>\n      <td>False</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <td>False</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td>A</td>\n      <td>B</td>\n      <td>A or B</td>\n    </tr>\n    <tr>\n      <td colspan=\"2\">Inputs</td>\n      <td>Output</td>\n    </tr>\n  </tfoot>\n</table>\n^D\n[width=\"100%\",cols=\"37%,37%,26%\",options=\"footer\",]\n|===\n|False |False |False\n|True |False |True\n|False |True |True\n|True |True |True\n|A |B |A or B\n2+|Inputs |Output\n|===\n```\n\nAdjust row span for multiple header rows\n```\n% pandoc -f html -t asciidoc\n<table style=\"width: 63%\">\n  <colgroup>\n    <col style=\"width: 30%\" />\n    <col style=\"width: 11%\" />\n    <col style=\"width: 11%\" />\n    <col style=\"width: 11%\" />\n  </colgroup>\n  <thead>\n    <tr>\n      <th rowspan=\"2\">Location</th>\n      <th colspan=\"3\">Temperature 1961-1990 in degree Celsius</th>\n    </tr>\n    <tr>\n      <th>min</th>\n      <th>mean</th>\n      <th>max</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>Antarctica</td>\n      <td>-89.2</td>\n      <td>N/A</td>\n      <td>19.8</td>\n    </tr>\n    <tr>\n      <td>Earth</td>\n      <td>-89.2</td>\n      <td>14</td>\n      <td>56.7</td>\n    </tr>\n  </tbody>\n</table>\n<table style=\"width: 63%\">\n  <colgroup>\n    <col style=\"width: 11%\" />\n    <col style=\"width: 11%\" />\n    <col style=\"width: 11%\" />\n    <col style=\"width: 30%\" />\n  </colgroup>\n  <thead>\n    <tr>\n      <th colspan=\"3\">Temperature 1961-1990 in degree Celsius</th>\n      <th rowspan=\"2\">Location</th>\n    </tr>\n    <tr>\n      <th>min</th>\n      <th>mean</th>\n      <th>max</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>-89.2</td>\n      <td>N/A</td>\n      <td>19.8</td>\n      <td>Antarctica</td>\n    </tr>\n    <tr>\n      <td>-89.2</td>\n      <td>14</td>\n      <td>56.7</td>\n      <td>Earth</td>\n    </tr>\n  </tbody>\n</table>\n<table style=\"width: 65%\">\n  <colgroup>\n    <col style=\"width: 11%\" />\n    <col style=\"width: 11%\" />\n    <col style=\"width: 11%\" />\n    <col style=\"width: 18%\" />\n    <col style=\"width: 14%\" />\n  </colgroup>\n  <thead>\n    <tr>\n      <th colspan=\"3\">Temperature 1961-1990 in degree Celsius</th>\n      <th rowspan=\"2\">Location</th>\n      <th>Extra</th>\n    </tr>\n    <tr>\n      <th>min</th>\n      <th>mean</th>\n      <th>max</th>\n      <th>Extra 2</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>-89.2</td>\n      <td>N/A</td>\n      <td>19.8</td>\n      <td>Antarctica</td>\n      <td>Extra 3</td>\n    </tr>\n    <tr>\n      <td>-89.2</td>\n      <td>14</td>\n      <td>56.7</td>\n      <td>Earth</td>\n      <td>Extra 4</td>\n    </tr>\n  </tbody>\n</table>\n<table>\n  <thead>\n    <tr>\n      <th>Header 1-1</th>\n      <th colspan=\"2\" rowspan=\"2\">Header 1-2</th>\n    </tr>\n    <tr>\n      <th>Header 2-1</th>\n    </tr>\n    <tr>\n      <th>Header 3-1</th>\n      <th>Header 3-2</th>\n      <th>Header 3-3</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td rowspan=\"2\">Body 1-1</td>\n      <td colspan=\"2\">Body 1-2</td>\n    </tr>\n    <tr>\n      <td>Body 2-1</td>\n      <td>Body 2-2</td>\n    </tr>\n  </tbody>\n</table>\n<table>\n  <thead>\n    <tr>\n      <th rowspan=\"2\">Header 1-1</th>\n      <th>Header 1-2</th>\n      <th rowspan=\"2\">Header 1-3</th>\n    </tr>\n    <tr>\n      <th>Header 2-1</th>\n    </tr>\n    <tr>\n      <th>Header 3-1</th>\n      <th>Header 3-2</th>\n      <th>Header 3-3</th>\n    </tr>\n  </thead>\n  <tbody></tbody>\n</table>\n^D\n[width=\"63%\",cols=\"49%,17%,17%,17%\",options=\"header\",]\n|===\n|Location 3+|Temperature 1961-1990 in degree Celsius\n| |min |mean |max\n|Antarctica |-89.2 |N/A |19.8\n|Earth |-89.2 |14 |56.7\n|===\n\n[width=\"63%\",cols=\"19%,17%,17%,47%\",options=\"header\",]\n|===\n3+|Temperature 1961-1990 in degree Celsius |Location\n|min |mean |max |\n|-89.2 |N/A |19.8 |Antarctica\n|-89.2 |14 |56.7 |Earth\n|===\n\n[width=\"65%\",cols=\"20%,16%,16%,27%,21%\",options=\"header\",]\n|===\n3+|Temperature 1961-1990 in degree Celsius |Location |Extra\n|min |mean |max | |Extra 2\n|-89.2 |N/A |19.8 |Antarctica |Extra 3\n|-89.2 |14 |56.7 |Earth |Extra 4\n|===\n\n[cols=\",,\",options=\"header\",]\n|===\n|Header 1-1 2+|Header 1-2\n|Header 2-1 2+|\n|Header 3-1 |Header 3-2 |Header 3-3\n.2+|Body 1-1 2+|Body 1-2\n|Body 2-1 |Body 2-2\n|===\n\n[cols=\",,\",options=\"header\",]\n|===\n|Header 1-1 |Header 1-2 |Header 1-3\n| |Header 2-1 |\n|Header 3-1 |Header 3-2 |Header 3-3\n|===\n```\n\nAdjust row span in multiple footer rows.\n```\n% pandoc -f html -t asciidoc\n<table>\n  <colgroup>\n    <col style=\"width: 40%\" />\n    <col style=\"width: 40%\" />\n    <col style=\"width: 20%\" />\n  </colgroup>\n  <tbody>\n    <tr>\n      <td>Body 1-1</td>\n      <td>Body 1-2</td>\n      <td>Body 1-3</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td colspan=\"2\">Footer 1-1/2</td>\n      <td>Footer 1-3</td>\n    </tr>\n    <tr>\n      <td>Footer 2-1</td>\n      <td rowspan=\"3\">Span 3</td>\n      <td>Footer 2-3</td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">Span 2</td>\n      <td>Footer 3-3</td>\n    </tr>\n    <tr>\n      <td>Footer 4-3</td>\n    </tr>\n  </tfoot>\n</table>\n<table>\n  <tbody>\n    <tr>\n      <td>Body 1-1</td>\n      <td>Body 1-2</td>\n      <td>Body 1-3</td>\n      <td>Body 1-4</td>\n      <td>Body 1-5</td>\n    </tr>\n    <tr>\n      <td>Body 2-1</td>\n      <td>Body 2-2</td>\n      <td>Body 2-3</td>\n      <td>Body 2-4</td>\n      <td>Body 2-5</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td colspan=\"3\">Footer 1-1/2/3</td>\n      <td>Footer 1-4</td>\n      <td>Footer 1-5</td>\n    </tr>\n    <tr>\n      <td>Footer 2-1</td>\n      <td rowspan=\"3\">Span 3</td>\n      <td>Footer 2-3</td>\n      <td colspan=\"2\">Footer 2-4/5</td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">Span 2</td>\n      <td colspan=\"2\">Footer 3-3/4</td>\n      <td rowspan=\"2\">Span 2</td>\n    </tr>\n    <tr>\n      <td rowspan=\"3\">Span 3</td>\n      <td>Footer 4-4</td>\n    </tr>\n    <tr>\n      <td>Footer 5-1</td>\n      <td>Footer 5-2</td>\n      <td>Footer 5-4</td>\n      <td rowspan=\"2\">Span 2</td>\n    </tr>\n    <tr>\n      <td colspan=\"2\">Footer 6-1/2</td>\n      <td>Footer 6-4</td>\n    </tr>\n  </tfoot>\n</table>\n<table>\n  <tbody>\n    <tr>\n      <td>Body 1</td>\n      <td>Body 2</td>\n      <td>Body 3</td>\n      <td>Body 4</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td>Footer 1-1</td>\n      <td colspan=\"2\" rowspan=\"3\">Span 3</td>\n      <td rowspan=\"2\">Span 2</td>\n    </tr>\n    <tr>\n      <td>Footer 2-1</td>\n    </tr>\n    <tr>\n      <td>Footer 3-1</td>\n      <td>Footer 3-4</td>\n    </tr>\n  </tfoot>\n</table>\n<table>\n  <tbody>\n    <tr>\n      <td>Body 1-1</td>\n      <td>Body 1-2</td>\n      <td>Body 1-3</td>\n      <td>Body 1-4</td>\n    </tr>\n  </tbody>\n  <tfoot>\n    <tr>\n      <td colspan=\"2\">Footer 1-1/2</td>\n      <td rowspan=\"6\">Span 6</td>\n      <td>Footer 1-4</td>\n    </tr>\n    <tr>\n      <td rowspan=\"3\">Span 3</td>\n      <td>Footer 2-2</td>\n      <td>Footer 2-4</td>\n    </tr>\n    <tr>\n      <td>Footer 3-2</td>\n      <td>Footer 3-4</td>\n    </tr>\n    <tr>\n      <td>Footer 4-2</td>\n      <td>Footer 4-4</td>\n    </tr>\n    <tr>\n      <td>Footer 5-1</td>\n      <td>Footer 5-2</td>\n      <td rowspan=\"2\">Span 2</td>\n    </tr>\n    <tr>\n      <td colspan=\"2\">Footer 6-1/2</td>\n    </tr>\n  </tfoot>\n</table>\n^D\n[width=\"100%\",cols=\"40%,40%,20%\",options=\"footer\",]\n|===\n|Body 1-1 |Body 1-2 |Body 1-3\n2+|Footer 1-1/2 |Footer 1-3\n|Footer 2-1 .2+|Span 3 |Footer 2-3\n|Span 2 |Footer 3-3\n| | |Footer 4-3\n|===\n\n[cols=\",,,,\",options=\"footer\",]\n|===\n|Body 1-1 |Body 1-2 |Body 1-3 |Body 1-4 |Body 1-5\n|Body 2-1 |Body 2-2 |Body 2-3 |Body 2-4 |Body 2-5\n3+|Footer 1-1/2/3 |Footer 1-4 |Footer 1-5\n|Footer 2-1 .3+|Span 3 |Footer 2-3 2+|Footer 2-4/5\n.2+|Span 2 2+|Footer 3-3/4 .2+|Span 2\n.2+|Span 3 |Footer 4-4\n|Footer 5-1 |Footer 5-2 |Footer 5-4 |Span 2\n2+|Footer 6-1/2 | |Footer 6-4 |\n|===\n\n[cols=\",,,\",options=\"footer\",]\n|===\n|Body 1 |Body 2 |Body 3 |Body 4\n|Footer 1-1 2.2+|Span 3 .2+|Span 2\n|Footer 2-1\n|Footer 3-1 2+| |Footer 3-4\n|===\n\n[cols=\",,,\",options=\"footer\",]\n|===\n|Body 1-1 |Body 1-2 |Body 1-3 |Body 1-4\n2+|Footer 1-1/2 .5+|Span 6 |Footer 1-4\n.3+|Span 3 |Footer 2-2 |Footer 2-4\n|Footer 3-2 |Footer 3-4\n|Footer 4-2 |Footer 4-4\n|Footer 5-1 |Footer 5-2 |Span 2\n2+|Footer 6-1/2 | |\n|===\n```\n\nIndividual cell alignments\n```\n% pandoc -f native -t asciidoc\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignLeft\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" , Space , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 2)\n               (ColSpan 2)\n               [ Plain [ Str \"Center\" , Space , Str \"Headers\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignRight\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , Space , Str \"Header\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" , Space , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignRight\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , Space , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignLeft\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" , Space , Str \"Header\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignRight\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , Space , Str \"Body\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignLeft\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"Left\" , Space , Str \"Body\" ] ]\n           ]\n        , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" , Space , Str \"Body\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignRight\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , Space , Str \"Body\" ] ]\n           ]\n        ]\n    ]\n    (TableFoot\n        ( \"\" , [] , [] )\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 3)\n                [ Plain [ Str \"Center\" , Space , Str \"Footer\" ] ]\n            ]\n        , Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignLeft\n                 (RowSpan 1)\n                 (ColSpan 2)\n                 [ Plain [ Str \"Left\" , Space , Str \"Footer\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignCenter\n                 (RowSpan 3)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Center\" , Space , Str \"Footer\" ] ]\n             ]\n         , Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignRight\n                 (RowSpan 1)\n                 (ColSpan 2)\n                 [ Plain [ Str \"Right\" , Space , Str \"Footer\" ] ]\n             ]\n         , Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignCenter\n                 (RowSpan 1)\n                 (ColSpan 2)\n                 [ Plain [ Str \"Center\" , Space , Str \"Footer\" ] ]\n             ]\n        ])\n]\n^D\n[cols=\",,\",options=\"header,footer\",]\n|===\n<|Left Header 2+^|Center Headers\n>|Right Header 2+|\n^|Center Header >|Right Header <|Left Header\n.2+>|Right Body 2+<|Left Body\n^|Center Body >|Right Body\n3+^|Center Footer\n2+<|Left Footer .2+^|Center Footer\n2+>|Right Footer\n2+^|Center Footer |\n|===\n```\n\nAdjust row span for empty rows and handle empty rows in general\n```\n% pandoc -f native -t asciidoc\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"1-1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 3)\n               (ColSpan 1)\n               [ Plain [ Str \"Span\" , Space , Str \"3\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"1-3\" ] ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"2-1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" , Space , Str \"2-3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 3)\n                (ColSpan 2)\n                [ Plain [ Str \"Body\" , Space , Str \"1-1/2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 5)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"5\" ] ]\n            ]\n        , Row ( \"\" , [] , [] ) []\n        , Row ( \"\" , [] , [] ) []\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"2-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"2-2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"3-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"3-2\" ] ]\n            ]\n        , Row ( \"\" , [] , [] ) []\n        ]\n    ]\n    (TableFoot\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 5)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Span\" , Space , Str \"5\" ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"Footer\" , Space , Str \"1-2\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 2)\n               [ Plain\n                   [ Str \"Span\" , Space , Str \"2\" ]\n               ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"Footer\" , Space , Str \"3-2/3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"Footer\" , Space , Str \"4-2/3\" ] ]\n           ]\n       ])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"1-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"1-2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 3)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"4\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 5)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"2-2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] ) []\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"3-2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"3-3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"4-2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"4-3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] ) []\n        , Row\n            ( \"\" , [] , [] ) []\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"6-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"6-2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"6-3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Footer\" , Space , Str \"1-1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 8)\n               (ColSpan 1)\n               [ Plain [ Str \"Span\" , Space , Str \"8\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Footer\" , Space , Str \"1-3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 3)\n               (ColSpan 1)\n               [ Plain [ Str \"Span\" , Space , Str \"3\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Footer\" , Space , Str \"2-3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"Span\" , Space , Str \"2\" ] ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Footer\" , Space , Str \"4-1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Footer\" , Space , Str \"4-3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Footer\" , Space , Str \"5-1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 3)\n               (ColSpan 1)\n               [ Plain [ Str \"Span\" , Space , Str \"3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"Span\" , Space , Str \"2\" ] ]\n           ]\n       , Row ( \"\" , [] , [] ) []\n       ])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [ \"rowspan-cell\" ] , [] )\n                AlignDefault\n                (RowSpan 6)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"1-2\" ] ]\n            , Cell\n                ( \"\" , [ \"rowspan-cell\" ] , [] )\n                AlignDefault\n                (RowSpan 2)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [ \"rowspan-cell\" ] , [] )\n                AlignDefault\n                (RowSpan 3)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [ \"rowspan-cell\" ] , [] )\n                AlignDefault\n                (RowSpan 4)\n                (ColSpan 1)\n                [ Plain [ Str \"Span\" , Space , Str \"4\" ] ]\n            ]\n        , Row ( \"\" , [] , [] ) []\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"3-2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"4-2\" ] ]\n            ]\n        , Row ( \"\" , [] , [] ) []\n        , Row ( \"\" , [] , [] ) []\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n^D\n[cols=\",,\",options=\"header,footer\",]\n|===\n|Header 1-1 |Span 3 |Header 1-3\n|Header 2-1 | |Header 2-3\n2+|Body 1-1/2 .3+|Span 5\n|Body 2-1 |Body 2-2\n|Body 3-1 |Body 3-2\n| | |\n.3+|Span 5 2+|Footer 1-2\n2+|Span 2\n2+|Footer 3-2/3\n| 2+|Footer 4-2/3\n|===\n\n[cols=\",,\",options=\"footer\",]\n|===\n|Body 1-1 |Body 1-2 .2+|Span 4\n.3+|Span 5 |Body 2-2\n|Body 3-2 |Body 3-3\n|Body 4-2 |Body 4-3\n| | |\n|Body 6-1 |Body 6-2 |Span 6-3\n|Footer 1-1 .5+|Span 8 |Footer 1-3\n.2+|Span 3 |Footer 2-3\n|Span 2\n|Footer 4-1 |Footer 4-3\n|Footer 5-1 |Span 3\n|Span 2 | |\n|===\n\n[cols=\",,\",]\n|===\n.5+|Span 6 |Body 1-2 .2+|Span 2\n.2+|Span 3\n.3+|Span 4\n|Body 3-2\n|Body 4-2\n| | |\n| | |\n|===\n```\n"
  },
  {
    "path": "test/command/7329.md",
    "content": "```\n% pandoc -f markdown -t org\n- @item1\n- @item1 [p. 12]\n- @item1 [p.12; see also @item2]\n- [@item1]\n- [-@item1]\n- [see @item1 p. 12]\n- [see @item1, p. 12]\n- [see @item1, p. 12 and *passim*]\n- [@item1;@item2]\n- [see @item1; @item2]\n^D\n- [cite/t:@item1]\n- [cite/t:@item1 p. 12]\n- [cite/t:@item1 p.12; see also @item2]\n- [cite:@item1]\n- [cite/na:@item1]\n- [cite:see @item1 p. 12]\n- [cite:see @item1 p. 12]\n- [cite:see @item1 p. 12 and /passim/]\n- [cite:@item1; @item2]\n- [cite:see @item1; @item2]\n```\n\n```\n% pandoc -f markdown -t org -C --bibliography command/biblio.bib\n- [@item1]\n^D\n- (Doe 2005)\n\n<<refs>>\n\n<<ref-item1>>\nDoe, John. 2005. /First Book/. Cambridge University Press.\n```\n\n\n```\n% pandoc -f markdown -t org-citations -C --bibliography command/biblio.bib\n[@item1]\n^D\n(Doe 2005)\n\n<<refs>>\n\n<<ref-item1>>\nDoe, John. 2005. /First Book/. Cambridge University Press.\n```\n\n```\n% pandoc -f org -t markdown\n- [cite/t:@item1]\n- [cite/t:@item1 p. 12]\n- [cite/t:@item1 p.12; see also @item2]\n- [cite:@item1]\n- [cite/na:@item1]\n- [cite:see @item1 p. 12]\n- [cite:see @item1 p. 12 and /passim/]\n- [cite:@item1; @item2]\n- [cite:see @item1; @item2]\n^D\n- @item1\n- @item1 [p. 12]\n- @item1 [p.12; see also @item2]\n- [@item1]\n- [-@item1]\n- [see @item1 p. 12]\n- [see @item1 p. 12 and *passim*]\n- [@item1; @item2]\n- [see @item1; @item2]\n```\n"
  },
  {
    "path": "test/command/7339.md",
    "content": "```\n% pandoc -f gfm -s -t native\n---\ntitle: Test\n---\n\nHi\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList [ ( \"title\" , MetaInlines [ Str \"Test\" ] ) ]\n    }\n  [ Para [ Str \"Hi\" ] ]\n```\n"
  },
  {
    "path": "test/command/7340.md",
    "content": "```\n% pandoc -f latex -t native\n\\(*\\)\n^D\n[ Para [ Math InlineMath \"*\" ] ]\n```\n"
  },
  {
    "path": "test/command/7376.md",
    "content": "```\n% pandoc --citeproc -t plain\n---\nreferences:\n- id: item1\n  type: book\n  author:\n    - family: Doe\n      given: Jane\n  issued: 2020\n  title: The title\n...\n^D\n\n\n```\n"
  },
  {
    "path": "test/command/7394.md",
    "content": "```\n% pandoc -f markdown -t plain --citeproc\n---\ncsl: command/chicago-fullnote-bibliography.csl\nreferences:\n- author:\n  - family: Wandt\n    given: Manfred\n  edition: 6\n  id: wandt2014ges-sv\n  issued: 2014\n  publisher: Franz Vahlen\n  publisher-place: München\n  title: Gesetzliche schuldverhältnisse\n  title-short: Gesetzl SV\n  type: book\n- author:\n  - family: Smith\n    given: Zenda\n  edition: 6\n  id: smith2015\n  issued: 2015\n  publisher: Macmillan\n  publisher-place: New York\n  title: A verb and a noun\n  type: book\n---\n\nHi^[@wandt2014ges-sv.].\n\nHi^[[@wandt2014ges-sv].].\n\nHi^[[See also @wandt2014ges-sv].].\n\nHi^[See also @wandt2014ges-sv.].\n\nHi^[@wandt2014ges-sv [@smith2015].].\n\nHi^[[@wandt2014ges-sv; @smith2015].].\n\nHi [@wandt2014ges-sv].\n\nHi [see also @wandt2014ges-sv].\n\n^D\nHi[1].\n\nHi[2].\n\nHi[3].\n\nHi[4].\n\nHi[5].\n\nHi[6].\n\nHi.[7]\n\nHi.[8]\n\nSmith, Zenda. A Verb and a Noun. 6th ed. New York: Macmillan, 2015.\n\nWandt, Manfred. Gesetzliche Schuldverhältnisse. 6th ed. München: Franz\nVahlen, 2014.\n\n[1] Manfred Wandt, Gesetzliche Schuldverhältnisse, 6th ed. (München:\nFranz Vahlen, 2014).\n\n[2] Wandt.\n\n[3] See also Wandt.\n\n[4] See also Wandt.\n\n[5] Wandt, Zenda Smith, A Verb and a Noun, 6th ed. (New York: Macmillan,\n2015).\n\n[6] Wandt, Gesetzl SV; Smith, A Verb and a Noun.\n\n[7] Wandt, Gesetzl SV.\n\n[8] See also Wandt.\n```\n\n"
  },
  {
    "path": "test/command/7397.md",
    "content": "````\n% pandoc -t markdown\n~~~~ { .haskell startFrom=\"100\"}\nqsort []     = []\nqsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++\n               qsort (filter (>= x) xs)\n~~~~\n^D\n``` {.haskell startFrom=\"100\"}\nqsort []     = []\nqsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++\n               qsort (filter (>= x) xs)\n```\n````\n"
  },
  {
    "path": "test/command/7400.md",
    "content": "```\n% pandoc -t native -s\n---\n# Comment only\n...\n^D\nPandoc Meta { unMeta = fromList [] } []\n```\n"
  },
  {
    "path": "test/command/7416.md",
    "content": "```\n% pandoc -f markdown -t html\n![caption](../media/rId25.jpg \"title\"){alt=\"alt\"}\n\n^D\n<figure>\n<img src=\"../media/rId25.jpg\" title=\"title\" alt=\"alt\" />\n<figcaption>caption</figcaption>\n</figure>\n```\n\n```\n% pandoc -f markdown -t html\n![caption](../media/rId25.jpg \"title\")\n\n^D\n<figure>\n<img src=\"../media/rId25.jpg\" title=\"title\" alt=\"caption\" />\n<figcaption aria-hidden=\"true\">caption</figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/7434.md",
    "content": "```\n% pandoc -f markdown -t native\n\\begin{proof}\n\\newcommand{\\x}{\\left.\\right.}\n\\x\n\\end{proof}\n\n1234567890abcdefghi\n\n[\\*\\a](x)\n^D\n[ RawBlock\n    (Format \"tex\")\n    \"\\\\begin{proof}\\n\\\\newcommand{\\\\x}{\\\\left.\\\\right.}\\n\\\\left.\\\\right.\\n\\\\end{proof}\"\n, Para [ Str \"1234567890abcdefghi\" ]\n, Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Str \"*\" , RawInline (Format \"tex\") \"\\\\a\" ]\n        ( \"x\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7436.md",
    "content": "```\n% pandoc -f rst -t native\n.. include:: command/three.txt\n   :code:\n\n.. include:: command/three.txt\n   :literal:\n\n.. include:: command/three.txt\n^D\n[ CodeBlock\n    ( \"\" , [ \"\" ] , [ ( \"code\" , \"\" ) ] )\n    \"1st line.\\n2nd line.\\n3rd line.\\n\"\n, CodeBlock\n    ( \"\" , [ \"\" ] , [ ( \"literal\" , \"\" ) ] )\n    \"1st line.\\n2nd line.\\n3rd line.\\n\"\n, Para\n    [ Str \"1st\"\n    , Space\n    , Str \"line.\"\n    , SoftBreak\n    , Str \"2nd\"\n    , Space\n    , Str \"line.\"\n    , SoftBreak\n    , Str \"3rd\"\n    , Space\n    , Str \"line.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7473.md",
    "content": "```\n% pandoc -f rst -t native\n.. figure:: example.png\n   :figclass: foo bar\n   :align: right\n   :width: 1in\n\n   This is a caption.\n^D\n[ Figure\n    ( \"\" , [ \"foo\" , \"bar\" , \"align-right\" ] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"This\"\n           , Space\n           , Str \"is\"\n           , Space\n           , Str \"a\"\n           , Space\n           , Str \"caption.\"\n           ]\n       ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [ ( \"width\" , \"1in\" ) ] )\n            [ Str \"This\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"caption.\"\n            ]\n            ( \"example.png\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7482.md",
    "content": "```\n% pandoc -f html -t org\n<table border=0 cellpadding=0 cellspacing=0 width=206 style='border-collapse:\n collapse;width:154pt'>\n<!--StartFragment-->\n <col width=99 style='mso-width-source:userset;mso-width-alt:3157;width:74pt'>\n <col width=107 style='mso-width-source:userset;mso-width-alt:3413;width:80pt'>\n <tr height=23 style='height:17.0pt'>\n  <td height=23 align=left width=99 style='height:17.0pt;width:74pt'>Last N\n  credits</td>\n  <td align=left width=107 style='width:80pt'>Average grade</td>\n </tr>\n <tr height=21 style='height:16.0pt'>\n  <td height=21 align=right style='height:16.0pt'>140</td>\n  <td align=right>17.06571429</td>\n </tr>\n <tr height=21 style='height:16.0pt'>\n  <td height=21 class=xl63 align=right style='height:16.0pt'>84</td>\n  <td class=xl63 align=right>17.95595238</td>\n </tr>\n <tr height=21 style='height:16.0pt'>\n  <td height=21 class=xl63 align=right style='height:16.0pt'>64</td>\n  <td class=xl63 align=right>18.9734375</td>\n </tr>\n <tr height=21 style='height:16.0pt'>\n  <td height=21 align=right style='height:16.0pt'>36</td>\n  <td align=right>19.12777778</td>\n </tr>\n <tr height=27 style='mso-height-source:userset;height:20.0pt'>\n  <td height=27 align=right style='height:20.0pt'>29</td>\n  <td align=right>19.18275862</td>\n </tr>\n <tr height=21 style='height:16.0pt'>\n  <td height=21 align=right style='height:16.0pt'>19</td>\n  <td align=right>19.00526316</td>\n </tr>\n<!--EndFragment-->\n</table>\n^D\n| Last N credits | Average grade |\n| 140            | 17.06571429   |\n| 84             | 17.95595238   |\n| 64             | 18.9734375    |\n| 36             | 19.12777778   |\n| 29             | 19.18275862   |\n| 19             | 19.00526316   |\n```\n"
  },
  {
    "path": "test/command/7494.md",
    "content": "```\n% pandoc -f latex -t plain\n\\def\\foo{BAR}\n{\\foo\n\\def\\foo{BAZ}\n\\foo\n}\n\\foo\n^D\nBAR BAZ BAR\n```\n\n```\n% pandoc -f latex -t plain\n\\def\\foo{BAR}\n{\\foo\n\\gdef\\foo{BAZ}\n\\foo\n}\n\\foo\n^D\nBAR BAZ BAZ\n```\n\n```\n% pandoc -f latex -t plain\n\\def\\foo{BAR}\n{\\foo\n\\global\\def\\foo{BAZ}\n\\foo\n}\n\\foo\n^D\nBAR BAZ BAZ\n```\n\n```\n% pandoc -f latex -t plain\n\\newcommand{\\aaa}{BBB}\n{\n\\renewcommand{\\aaa}{AAA}\n\\aaa\n}\n\\aaa\n^D\nAAA BBB\n```\n\n```\n% pandoc -f latex -t markdown\n\\newcommand{\\aaa}{BBB}\n\\begin{quote}\n\\renewcommand{\\aaa}{AAA}\n\\aaa\n\\end{quote}\n\\aaa\n^D\n> AAA\n\nBBB\n```\n\n"
  },
  {
    "path": "test/command/7497.md",
    "content": "````\n% pandoc -f markdown-raw_tex -t latex\n```\n\\end{verbatim}\n\\LaTeX\n\\begin{verbatim}\n```\n^D\n\\begin{Shaded}\n\\begin{Highlighting}[]\n\\NormalTok{\\textbackslash{}end\\{verbatim\\}}\n\\NormalTok{\\textbackslash{}LaTeX}\n\\NormalTok{\\textbackslash{}begin\\{verbatim\\}}\n\\end{Highlighting}\n\\end{Shaded}\n````\n\n````\n% pandoc -f markdown-raw_tex -t latex\nhi[^1]\n\n[^1]:\n    ```\n    \\end{Verbatim}\n    \\LaTeX\n    \\begin{Verbatim}\n    ```\n^D\nhi\\footnote{\\begin{Shaded}\n\\begin{Highlighting}[]\n\\NormalTok{\\textbackslash{}end\\{Verbatim\\}}\n\\NormalTok{\\textbackslash{}LaTeX}\n\\NormalTok{\\textbackslash{}begin\\{Verbatim\\}}\n\\end{Highlighting}\n\\end{Shaded}\n}\n````\n"
  },
  {
    "path": "test/command/7512.md",
    "content": "```\n% pandoc -t native -f latex\n\\begin{equation*}\n[d,\\delta]=0.\n\\end{equation*}\n^D\n[ Para\n    [ Math\n        DisplayMath\n        \"\\\\begin{equation*}\\n[d,\\\\delta]=0.\\n\\\\end{equation*}\"\n    ]\n]\n```\n\n```\n% pandoc -t native -f latex\n\\begin{table}[htb]\n  \\begin{tabular}{|c|c|}\n       $W$      & rel. err. \\\\[0mm]\n       [$\\mu$m] & [\\%]\\\\\n  \\end{tabular}\n\\end{table}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"W\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"rel.\" , Space , Str \"err.\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"[\" , Math InlineMath \"\\\\mu\" , Str \"m]\" ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"[%]\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/7520.md",
    "content": "```\n% pandoc -f org -t native -s\n:PROPERTIES:\n:ID:       d5b18943-98a3-4b2a-a545-41d17bf50f3e\n:END:\n#+title: Common Ground\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"id\"\n            , MetaString \"d5b18943-98a3-4b2a-a545-41d17bf50f3e\"\n            )\n          , ( \"title\"\n            , MetaInlines [ Str \"Common\" , Space , Str \"Ground\" ]\n            )\n          ]\n    }\n  []\n\n```\n"
  },
  {
    "path": "test/command/7521.md",
    "content": "```\n% pandoc --strip-comments\n- one\n  <!-- with comm -->\n- two\n^D\n<ul>\n<li>one </li>\n<li>two</li>\n</ul>\n```\n"
  },
  {
    "path": "test/command/7525.md",
    "content": "```\n% pandoc -f latex -t native\n\\texttt{Normal code. \\emph{Emph and code.} \\textsc{\\textbf{Bold small caps.}} \\sout{Strikeout. \\underline{Strikeout and underline.}}}\n^D\n[ Para\n    [ Code ( \"\" , [] , [] ) \"Normal code. \"\n    , Emph [ Code ( \"\" , [] , [] ) \"Emph and code.\" ]\n    , Code ( \"\" , [] , [] ) \" \"\n    , SmallCaps\n        [ Strong [ Code ( \"\" , [] , [] ) \"Bold small caps.\" ] ]\n    , Code ( \"\" , [] , [] ) \" \"\n    , Strikeout\n        [ Code ( \"\" , [] , [] ) \"Strikeout. \"\n        , Underline\n            [ Code ( \"\" , [] , [] ) \"Strikeout and underline.\" ]\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<code><b>hi</b></code>\n^D\n[ Plain [ Strong [ Code ( \"\" , [] , [] ) \"hi\" ] ] ]\n```\n\n```\n% pandoc -f mediawiki -t native\n<code>''hey''</code>\n^D\n[ Para [ Emph [ Code ( \"\" , [] , [] ) \"hey\" ] ] ]\n```\n"
  },
  {
    "path": "test/command/7529.md",
    "content": "```\n% pandoc -f html -t asciidoc\n<a href=\"https://example.com/show.cgi?id=hi--there--everyone\">https://example.com/show.cgi?id=hi--there--everyone</a>\n^D\nlink:++https://example.com/show.cgi?id=hi--there--everyone++[]\n```\n\n"
  },
  {
    "path": "test/command/7546.md",
    "content": "```\n% pandoc -t html -f native\nSpan (\"\", [], [(\"\",\"\")]) []\n^D\n<span></span>\n```\n"
  },
  {
    "path": "test/command/7557.md",
    "content": "```\n% pandoc -f org -t native\n- 11. and 12. 09. meeting\n^D\n[ BulletList\n    [ [ Plain\n          [ Str \"11.\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"12.\"\n          , Space\n          , Str \"09.\"\n          , Space\n          , Str \"meeting\"\n          ]\n      ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7568.md",
    "content": "```\n% pandoc -f rst\nWhile `Labyrinth Lord: Revised Edition`_ (LLRE; PDF and POD) has been\ncriticized for not being a completely faithful retro-clone of the\nMoldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still\nholds a useful spot.\n\n.. _Labyrinth Lord\\: Revised Edition: https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition\n^D\n<p>While <a\nhref=\"https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition\">Labyrinth\nLord: Revised Edition</a> (LLRE; PDF and POD) has been criticized for\nnot being a completely faithful retro-clone of the Moldvay/Cook/Marsh\nBasic/Expert D&amp;D rules (B/X), I think it still holds a useful\nspot.</p>\n```\n"
  },
  {
    "path": "test/command/7573.md",
    "content": "```\n% pandoc --preserve-tabs\n<ol>\n\t<li>one\n</ol>\n^D\n<ol>\n<li>\none\n</ol>\n```\n"
  },
  {
    "path": "test/command/7582.md",
    "content": "```\n% pandoc -t revealjs\n# Slide\n\n::: columns\n:::: column\nLeft column\n::::\n\n. . .\n\n:::: column\nRight column\n::::\n:::\n^D\n<section id=\"slide\" class=\"slide level1\">\n<h1>Slide</h1>\n<div class=\"columns\">\n<div class=\"column\">\n<p>Left column</p>\n</div><div class=\"fragment\"><div class=\"column\">\n<p>Right column</p>\n</div></div>\n</div>\n</section>\n\n```\n"
  },
  {
    "path": "test/command/7589.md",
    "content": "```\n% pandoc -f html -t native\n<table>\n <thead>\n  <tr>\n   <th>experience</th>\n   <th>expertise</th>\n   <th>paradigms</th>\n   <th>haskell</th>\n   <th>name</th>\n   <th>image</th>\n  </tr>\n </thead>\n <tbody></tbody>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"experience\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"expertise\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"paradigms\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"haskell\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"name\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"image\" ] ]\n           ]\n       ])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/7615.md",
    "content": "```\n% pandoc -f latex -t native\n\\texttt{\\^}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"^\" ] ]\n```\n"
  },
  {
    "path": "test/command/7623.md",
    "content": "```\n% pandoc -t native\n[link $(0,1]$](url)\n^D\n[ Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Str \"link\" , Space , Math InlineMath \"(0,1]\" ]\n        ( \"url\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7632.md",
    "content": "```\n% pandoc -t native\n(@a) First case\n\n[link to (@a)](url)\n^D\n[ OrderedList\n    ( 1 , Example , TwoParens )\n    [ [ Plain [ Str \"First\" , Space , Str \"case\" ] ] ]\n, Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Str \"link\" , Space , Str \"to\" , Space , Str \"(1)\" ]\n        ( \"url\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -t native\n[@a]{.class}\n^D\n[ Para\n    [ Span\n        ( \"\" , [ \"class\" ] , [] )\n        [ Cite\n            [ Citation\n                { citationId = \"a\"\n                , citationPrefix = []\n                , citationSuffix = []\n                , citationMode = AuthorInText\n                , citationNoteNum = 1\n                , citationHash = 0\n                }\n            ]\n            [ Str \"@a\" ]\n        ]\n    ]\n]\n\n```\n\n```\n% pandoc -t native\n[@a](url)\n^D\n[ Para\n    [ Link\n        ( \"\" , [] , [] )\n        [ Cite\n            [ Citation\n                { citationId = \"a\"\n                , citationPrefix = []\n                , citationSuffix = []\n                , citationMode = AuthorInText\n                , citationNoteNum = 1\n                , citationHash = 0\n                }\n            ]\n            [ Str \"@a\" ]\n        ]\n        ( \"url\" , \"\" )\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/7668.md",
    "content": "```\n% pandoc -f bibtex -t csljson\n%@Book{JW82,\n author   = {Richard A. Johnson and Dean W. Wichern},\n title    = {Applied Multivariate Statistical Analysis},\n publisher= {Prentice-Hall},\n year     = {1983}\n}\n@Book{JW83,\n  author = {Richard %A.\n    B. Johnson},\n%  title = {Multivariate Analysis},\n  year = \"%\n  1983\"\n}\n^D\n[\n  {\n    \"author\": [\n      {\n        \"family\": \"Johnson\",\n        \"given\": \"Richard B.\"\n      }\n    ],\n    \"id\": \"JW83\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          1983\n        ]\n      ]\n    },\n    \"type\": \"book\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/7678.md",
    "content": "```\n% pandoc -f bibtex -t csljson\n@misc{doe,\n  author = \"Jane Doe\",\n  title = \"Work\",\n  year = \"2021\",\n  url = \"%20and%20\"\n}\n^D\n[\n  {\n    \"URL\": \"%20and%20\",\n    \"author\": [\n      {\n        \"family\": \"Doe\",\n        \"given\": \"Jane\"\n      }\n    ],\n    \"id\": \"doe\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          2021\n        ]\n      ]\n    },\n    \"title\": \"Work\",\n    \"type\": \"\"\n  }\n]\n```\n```\n% pandoc -f bibtex -t csljson\n@misc{doe,\n  author = \"Jane Doe\",\n  title = \"Work\",\n  year = \"2021\",\n  doi = \"%20and%20\"\n}\n^D\n[\n  {\n    \"DOI\": \"%20and%20\",\n    \"author\": [\n      {\n        \"family\": \"Doe\",\n        \"given\": \"Jane\"\n      }\n    ],\n    \"id\": \"doe\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          2021\n        ]\n      ]\n    },\n    \"title\": \"Work\",\n    \"type\": \"\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/7691.md",
    "content": "```\n% pandoc command/7691.docx\n^D\n<p>Some text</p>\n```\n"
  },
  {
    "path": "test/command/7692.md",
    "content": "```\n% pandoc -t markdown\n[https://example.com](https://example.com){.clz}\n^D\n[https://example.com](https://example.com){.clz}\n```\n\n```\n% pandoc -f markdown -t html | pandoc -f html -t markdown\n<http://example.com>\n^D\n<http://example.com>\n```\n"
  },
  {
    "path": "test/command/7697.md",
    "content": "```\n% pandoc -f rst -t mediawiki\n.. _refsubpage1:\n\nheading\n-------\n\nref to top of this section: `refsubpage1`_.\n^D\n<span id=\"refsubpage1\"></span>\n= heading =\n\nref to top of this section: [[#refsubpage1|refsubpage1]].\n```\n```\n% pandoc -f markdown -t mediawiki\n# Heading {#foo}\n^D\n<span id=\"foo\"></span>\n= Heading =\n```\n```\n% pandoc -f markdown -t mediawiki\n# My Heading {#My_Heading}\n^D\n= My Heading =\n```\n"
  },
  {
    "path": "test/command/7713.md",
    "content": "```\n% pandoc\n| aaaaaaaaaaaa | bbbbb | ccccccccccc                                                       |\n| ---          | ---   | ---                                                               |\n|              |       | cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc |\n^D\n<table>\n<colgroup>\n<col style=\"width: 33%\" />\n<col style=\"width: 33%\" />\n<col style=\"width: 33%\" />\n</colgroup>\n<thead>\n<tr>\n<th>aaaaaaaaaaaa</th>\n<th>bbbbb</th>\n<th>ccccccccccc</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td></td>\n<td></td>\n<td>cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc\ncccccccccc</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/7723.md",
    "content": "```\n% pandoc -t native\nBug![^1]\n\n[^1]: Note.\n^D\n[ Para [ Str \"Bug!\" , Note [ Para [ Str \"Note.\" ] ] ] ]\n```\n"
  },
  {
    "path": "test/command/7726.md",
    "content": "```\n% pandoc -t markdown\n\\# Hi\n\n\\## Hi\n\n\\### Hi\n\n\\#### hi\n\nand #hi\n^D\n\\# Hi\n\n\\## Hi\n\n\\### Hi\n\n\\#### hi\n\nand #hi\n```\n"
  },
  {
    "path": "test/command/7738.md",
    "content": "```\n% pandoc\n![_](url.png) image\n^D\n<p><img src=\"url.png\" alt=\"_\" /> image</p>\n```\n"
  },
  {
    "path": "test/command/7743.md",
    "content": "```\n% pandoc -f markdown+mark -t html\n==Hi==\n^D\n<p><mark>Hi</mark></p>\n```\n\n```\n% pandoc -f markdown+mark -t latex\n==Hi==\n^D\n\\hl{Hi}\n```\n\n```\n% pandoc -f markdown+mark -t rst\n==Hi==\n^D\n:mark:`Hi`\n```\n\n```\n% pandoc -f html -t markdown+mark\n<mark>Hi</mark>\n^D\n==Hi==\n```\n\n```\n% pandoc -f html -t markdown\n<mark>Hi</mark>\n^D\n[Hi]{.mark}\n```\n\n```\n% pandoc -f rst -t markdown+mark\n:mark:`Hi`\n^D\n==Hi==\n```\n\n```\n% pandoc -f markdown+mark -t docx -o - | pandoc -f docx -t markdown+mark\n==Hi==\n^D\n==Hi==\n```\n\n```\n% pandoc -f latex -t markdown+mark\n\\hl{Hi}\n^D\n==Hi==\n```\n\n"
  },
  {
    "path": "test/command/7761.md",
    "content": "```\n% pandoc --citeproc --csl command/chicago-fullnote-bibliography.csl -t plain\n---\nreferences:\n- id: noauthor\n  issued: 2020\n  publisher: Oxford University Press\n  publisher-place: Oxford\n  title: Title\n  type: book\n- id: author\n  author:\n  - family: Jones\n    given: Jim\n  issued: 2021\n  title: Title\n  type: book\n  url: \"https://duckduckgo.com/cite2021\"\n---\n\nText.[^n]\n\n[^n]: See @author. Another example of a sea level mapping tool with\nsimilar limitations is @noauthor.\n^D\nText.[1]\n\nJones, Jim. Title, 2021. https://duckduckgo.com/cite2021.\n\nTitle. Oxford: Oxford University Press, 2020.\n\n[1] See Jim Jones, Title, 2021, https://duckduckgo.com/cite2021. Another\nexample of a sea level mapping tool with similar limitations is Title\n(Oxford: Oxford University Press, 2020).\n```\n"
  },
  {
    "path": "test/command/7778.md",
    "content": "Here the thing to remember is that block level structure indications\ntake precedence over inline level structure indications:\n\n```\n% pandoc\nTerm\n: Def\n<!--\n: comment def\n-->\n^D\n<dl>\n<dt>Term</dt>\n<dd>\nDef &lt;!–\n</dd>\n<dd>\ncomment def –&gt;\n</dd>\n</dl>\n```\n\n```\n% pandoc\nTerm\n: Def\ntest <!--\n: comment def\nand -->\n^D\n<dl>\n<dt>Term</dt>\n<dd>\nDef test &lt;!–\n</dd>\n<dd>\ncomment def and –&gt;\n</dd>\n</dl>\n```\n\n```\n% pandoc\nTerm\n: Def\n`code\n: comment def\nmore code`\n^D\n<dl>\n<dt>Term</dt>\n<dd>\nDef `code\n</dd>\n<dd>\ncomment def more code`\n</dd>\n</dl>\n```\n"
  },
  {
    "path": "test/command/7803.md",
    "content": "```\n% pandoc -f html -t asciidoc\n<ul>\n<li><a href=x.htm><i>Xx</i></a><i>,</i>\n<li><a href=x.htm><i>Xx</i></a><i>,,</i>\n<li><a href=x.htm><i>Xx</i></a><i>1</i>\n<li><a href=x.htm><i>Xx</i></a>1<i>1</i>\n<li><a href=x.htm><i>Xx</i></a><i>bcd</i>\n<li><a href=x.htm><i>Xx</i></a>a<i>bcd</i>\n<li><a href=x.htm><i>Xx</i></a>a<i>bcd</i>e\n<li><a href=x.htm><i>Xx</i></a> <i>,</i>\n<li><a href=x.htm><i>Xx</i></a>,<i>,</i>\n<li><a href=x.htm>Xx</a><i>,</i>\n</ul>\n^D\n* link:x.htm[_Xx_]_,_\n* link:x.htm[_Xx_]_,,_\n* link:x.htm[_Xx_]_1_\n* link:x.htm[_Xx_]1__1__\n* link:x.htm[_Xx_]_bcd_\n* link:x.htm[_Xx_]a__bcd__\n* link:x.htm[_Xx_]a__bcd__e\n* link:x.htm[_Xx_] _,_\n* link:x.htm[_Xx_],_,_\n* link:x.htm[Xx]_,_\n```\n"
  },
  {
    "path": "test/command/7808.md",
    "content": "Wiki links should have no display text, if their display text matches\ntheir target.\n```\n% pandoc -f mediawiki -t mediawiki\n[[Help]] [[Butter|Butter]] [[Bubbles|Everyone loves bubbles]]\n^D\n[[Help]] [[Butter]] [[Bubbles|Everyone loves bubbles]]\n```\n"
  },
  {
    "path": "test/command/7810.md",
    "content": "```\n% pandoc -f org -t org\n- \n  #+begin_example\n  aa\n  #+end_example\n- test\n^D\n- \n  #+begin_example\n  aa\n  #+end_example\n\n- test\n```\n\n```\n% pandoc -f org -t org\n- a\n- \n- a\n- a\n^D\n- a\n- \n- a\n- a\n```\n\n```\n% pandoc -f org -t org\n- a\n  - b\n  - b\n- a\n- a\n^D\n- a\n  - b\n  - b\n- a\n- a\n```\n"
  },
  {
    "path": "test/command/7813-meta.yaml",
    "content": "---\nabstract: |\n    a footnote[^1] in abstract.\n\n    [^1]: content\n...\n"
  },
  {
    "path": "test/command/7813.md",
    "content": "```\n% pandoc --metadata-file command/7813-meta.yaml -t native -s\nHi\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"abstract\"\n            , MetaBlocks\n                [ Para\n                    [ Str \"a\"\n                    , Space\n                    , Str \"footnote\"\n                    , Note [ Para [ Str \"content\" ] ]\n                    , Space\n                    , Str \"in\"\n                    , Space\n                    , Str \"abstract.\"\n                    ]\n                ]\n            )\n          ]\n    }\n  [ Para [ Str \"Hi\" ] ]\n```\n"
  },
  {
    "path": "test/command/7826.md",
    "content": "```\n% pandoc -t plain --citeproc\n---\nbibliography: command/biblio.bib\nsuppress-bibliography: true\ncsl: command/american-medical-association.csl\nnotes-after-punctuation: true\n---\n\nIn numerous recent works [@item1; @item2], statistician\nFoo and Bar have criticized XXX.\n^D\nIn numerous recent works,^(1,2) statistician Foo and Bar have criticized\nXXX.\n```\n```\n% pandoc -t plain --citeproc\n---\nbibliography: command/biblio.bib\nsuppress-bibliography: true\ncsl: command/american-medical-association.csl\n---\n\nIn numerous recent works [@item1; @item2], statistician\nFoo and Bar have criticized XXX.\n^D\nIn numerous recent works^(1,2), statistician Foo and Bar have criticized\nXXX.\n```\n```\n% pandoc -t plain --citeproc\n---\nbibliography: command/biblio.bib\nsuppress-bibliography: true\ncsl: command/chicago-fullnote-bibliography.csl\nnotes-after-punctuation: false\n---\n\nIn numerous recent works [@item1; @item2], statistician\nFoo and Bar have criticized XXX.\n^D\nIn numerous recent works[1], statistician Foo and Bar have criticized\nXXX.\n\n[1] John Doe, First Book (Cambridge: Cambridge University Press, 2005);\nJohn Doe, “Article,” Journal of Generic Studies 6 (2006): 33–34.\n```\n```\n% pandoc -t plain --citeproc\n---\nbibliography: command/biblio.bib\nsuppress-bibliography: true\ncsl: command/chicago-fullnote-bibliography.csl\n---\n\nIn numerous recent works [@item1; @item2], statistician\nFoo and Bar have criticized XXX.\n^D\nIn numerous recent works,[1] statistician Foo and Bar have criticized\nXXX.\n\n[1] John Doe, First Book (Cambridge: Cambridge University Press, 2005);\nJohn Doe, “Article,” Journal of Generic Studies 6 (2006): 33–34.\n```\n```\n% pandoc -t plain --citeproc\n---\nbibliography: command/biblio.bib\nsuppress-bibliography: true\nnotes-after-punctuation: true\n---\n\nIn numerous recent works [@item1; @item2], statistician\nFoo and Bar have criticized XXX.\n^D\nIn numerous recent works (Doe 2005, 2006), statistician Foo and Bar have\ncriticized XXX.\n```\n"
  },
  {
    "path": "test/command/7847.md",
    "content": "```\n% pandoc -f html -t markdown_strict+pipe_tables\n<table>\n<colgroup>\n<col style=\"width: 20%\" />\n<col style=\"width: 60%\" />\n<col style=\"width: 20%\" />\n</colgroup>\n<thead>\n<tr>\n<th>aaa</th>\n<th>bbb</th>\n<th>ccc</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Consequat nisi sit amet nibh. Nunc mi tortor, tristique\nsit amet, rhoncus porta, malesuada elementum, nisi.</td>\n<td></td>\n<td>ccc</td>\n</tr>\n</tbody>\n</table>\n^D\n| aaa | bbb | ccc |\n|---------------|------------------------------------------|---------------|\n| Consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. |  | ccc |\n\n```\n\n```\n% pandoc -f html -t markdown_strict+pipe_tables\n<table>\n<tr>\n<th>aaa</th>\n<th>bbb</th>\n<th>ccc</th>\n</tr>\n<tr>\n<td>Consequat nisi sit amet nibh. Nunc mi tortor, tristique\nsit amet, rhoncus porta, malesuada elementum, nisi.</td>\n<td></td>\n<td>ccc</td>\n</tr>\n</table>\n^D\n| aaa | bbb | ccc |\n|----|----|----|\n| Consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. |  | ccc |\n\n```\n\n```\n% pandoc -f html -t commonmark+pipe_tables\n<table>\n<colgroup>\n<col style=\"width: 20%\" />\n<col style=\"width: 60%\" />\n<col style=\"width: 20%\" />\n</colgroup>\n<thead>\n<tr>\n<th>aaa</th>\n<th>bbb</th>\n<th>ccc</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Consequat nisi sit amet nibh. Nunc mi tortor, tristique\nsit amet, rhoncus porta, malesuada elementum, nisi.</td>\n<td>bbb</td>\n<td>ccc</td>\n</tr>\n</tbody>\n</table>\n^D\n| aaa | bbb | ccc |\n|----|----|----|\n| Consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. | bbb | ccc |\n\n```\n\n\n"
  },
  {
    "path": "test/command/7857.md",
    "content": "```\n% pandoc --slide-level=2 -t beamer\n# section\n\n::: notes\nmy note\n:::\n\n## slide\n\nok\n^D\n\\section{section}\\label{section}\n\n\\note{my note}\n\n\\begin{frame}{slide}\n\\protect\\phantomsection\\label{slide}\nok\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/7858.md",
    "content": "```\n% pandoc -t html --columns=50 --wrap=auto\n`neuth asontue stheuosnt aeosunth asnoetuh asneotuh snatehou snatoehu sntahe ousntahoe unstaheou sntaheou aoeu sthoeu sntaoeusnth ansoetuhs atoeuh saonteu`\n^D\n<p><code>neuth asontue stheuosnt aeosunth asnoetuh asneotuh snatehou snatoehu sntahe ousntahoe unstaheou sntaheou aoeu sthoeu sntaoeusnth ansoetuhs atoeuh saonteu</code></p>\n```\n"
  },
  {
    "path": "test/command/7861/metadata/placeholder",
    "content": ""
  },
  {
    "path": "test/command/7861.md",
    "content": "```\n% pandoc -s -t native --data-dir=command/7861 --metadata-file=../../7861.yaml\nHello\n^D\n2> Could not find metadata file ../../7861.yaml\n=> 98\n```\n"
  },
  {
    "path": "test/command/7861.yaml",
    "content": ""
  },
  {
    "path": "test/command/7863.md",
    "content": "```\n% pandoc -f commonmark+yaml_metadata_block+sourcepos -t native\n---\nkey:\n  |\n  value\n...\n\n\nText\n^D\n[ Div\n    ( \"\"\n    , []\n    , [ ( \"wrapper\" , \"1\" ) , ( \"data-pos\" , \"8:1-9:1\" ) ]\n    )\n    [ Para\n        [ Span\n            ( \"\"\n            , []\n            , [ ( \"wrapper\" , \"1\" ) , ( \"data-pos\" , \"8:1-8:5\" ) ]\n            )\n            [ Str \"Text\" ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7871.md",
    "content": "```\n% pandoc -f html -t html\n<table>\n<tr><td style=\"padding-right:4px;text-align:right\">a</td></tr>\n</table>\n^D\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: right; padding-right: 4px;\">a</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/7884.md",
    "content": "```\n% pandoc -f html+epub_html_exts -t native\n<body epub:type=\"bodymatter\">\n<section id=\"chapter-1\" class=\"level1\" data-number=\"1\">\n<h1 data-number=\"1\">Chapter 1</h1>\n<p>Here is a footnote.<a href=\"#fn1\" class=\"footnote-ref\" id=\"fnref1\" epub:type=\"noteref\">1</a></p>\n<p>Here is a second footnote.<a href=\"#fn2\" class=\"footnote-ref\" id=\"fnref2\" epub:type=\"noteref\">2</a></p>\n</section>\n<section class=\"footnotes footnotes-end-of-document\" epub:type=\"footnotes\">\n<hr />\n<ol>\n<li id=\"fn1\" epub:type=\"footnote\"><p>This is a test<a href=\"#fnref1\" class=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn2\" epub:type=\"footnote\"><p>This is another test<a href=\"#fnref2\" class=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</section>\n</body>\n^D\n[ Div\n    ( \"chapter-1\"\n    , [ \"section\" , \"level1\" ]\n    , [ ( \"number\" , \"1\" ) ]\n    )\n    [ Header\n        1\n        ( \"\" , [] , [ ( \"number\" , \"1\" ) ] )\n        [ Str \"Chapter\" , Space , Str \"1\" ]\n    , Para\n        [ Str \"Here\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"footnote.\"\n        , Note\n            [ Para\n                [ Str \"This\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"test\"\n                ]\n            ]\n        ]\n    , Para\n        [ Str \"Here\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"second\"\n        , Space\n        , Str \"footnote.\"\n        , Note\n            [ Para\n                [ Str \"This\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"another\"\n                , Space\n                , Str \"test\"\n                ]\n            ]\n        ]\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/7894.md",
    "content": "```\n% pandoc -f ris -t csljson\nTY  - BOOK\nID  - Chang_Keisler_Model_Theory\nAU  - Chang, C. C.\nAU  - Keisler, H. Jerome\nPY  - 1990\nET  - 3\nTI  - Model Theory\nPU  - North-Holland Press\nPP  - Amsterdam\nKW  - model theory\nKW  - logic\nER  -\nTY  - JOUR\nAU  - Shannon, Claude E.\nPY  - 1948\nDA  - July\nTI  - A Mathematical Theory of Communication\nT2  - Bell System Technical Journal\nSP  - 379\nEP  - 423\nVL  - 27\nER  -\nTY  - JOUR\nT1  - On computable numbers, with an application to the Entscheidungsproblem\nA1  - Turing, Alan Mathison\nJO  - Proc. of London Mathematical Society\nVL  - 47\nIS  - 1\nKW  - decidability\nKW  - computability\nSP  - 230\nEP  - 265\nY1  - 1937\nER  -\n^D\n[\n  {\n    \"author\": [\n      {\n        \"family\": \"Chang\",\n        \"given\": \"C. C.\"\n      },\n      {\n        \"family\": \"Keisler\",\n        \"given\": \"H. Jerome\"\n      }\n    ],\n    \"edition\": \"3\",\n    \"id\": \"Chang_Keisler_Model_Theory\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          1990\n        ]\n      ]\n    },\n    \"keyword\": \"logic, model theory\",\n    \"publisher-place\": \"Amsterdam\",\n    \"title\": \"Model Theory\",\n    \"type\": \"book\"\n  },\n  {\n    \"author\": [\n      {\n        \"family\": \"Shannon\",\n        \"given\": \"Claude E.\"\n      }\n    ],\n    \"container-title\": \"Bell System Technical Journal\",\n    \"id\": \"Shannon_1948\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          1948\n        ]\n      ]\n    },\n    \"page\": \"379-423\",\n    \"title\": \"A Mathematical Theory of Communication\",\n    \"type\": \"article-journal\",\n    \"volume\": \"27\"\n  },\n  {\n    \"author\": [\n      {\n        \"family\": \"Turing\",\n        \"given\": \"Alan Mathison\"\n      }\n    ],\n    \"container-title\": \"Proc. of London Mathematical Society\",\n    \"id\": \"Turing_1937\",\n    \"issue\": \"1\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          1937\n        ]\n      ]\n    },\n    \"keyword\": \"computability, decidability\",\n    \"page\": \"230-265\",\n    \"title\": \"On computable numbers, with an application to the Entscheidungsproblem\",\n    \"type\": \"article-journal\",\n    \"volume\": \"47\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/7919.md",
    "content": "```\n% pandoc -f markdown\nsingle column table | \n------------------- | \nitem 1              |\nitem 2              |\n^D\n<table>\n<thead>\n<tr>\n<th>single column table</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>item 1</td>\n</tr>\n<tr>\n<td>item 2</td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f markdown\n| single column table\n| -------------------\n| item 1\n| item 2\n^D\n<table>\n<thead>\n<tr>\n<th>single column table</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>item 1</td>\n</tr>\n<tr>\n<td>item 2</td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f markdown\nsingle column table\n-------------------\nitem 1\nitem 2\n^D\n<h2 id=\"single-column-table\">single column table</h2>\n<p>item 1 item 2</p>\n```\n\n```\n% pandoc -f gfm\nsingle column table | \n------------------- | \nitem 1              |\nitem 2              |\n^D\n<table>\n<thead>\n<tr>\n<th>single column table</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>item 1</td>\n</tr>\n<tr>\n<td>item 2</td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f gfm\n| single column table\n| -------------------\n| item 1\n| item 2\n^D\n<table>\n<thead>\n<tr>\n<th>single column table</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>item 1</td>\n</tr>\n<tr>\n<td>item 2</td>\n</tr>\n</tbody>\n</table>\n```\n\n```\n% pandoc -f gfm\nsingle column table\n-------------------\nitem 1\nitem 2\n^D\n<h2 id=\"single-column-table\">single column table</h2>\n<p>item 1 item 2</p>\n```\n\n"
  },
  {
    "path": "test/command/7920.md",
    "content": "```\n% pandoc -t native\n[hi]{#123}\n^D\n[ Para [ Span ( \"123\" , [] , [] ) [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -t markdown\n[hi]{#123}\n^D\n[hi]{#123}\n```\n\n```\n% pandoc -t markdown\n# Hi {#123}\n^D\n# Hi {#123}\n```\n"
  },
  {
    "path": "test/command/7930.md",
    "content": "```\n% pandoc -f latex -t native\nWe discuss foobar in notes \\ref{note:X} and \\ref{note:Y}.\n\nFoo.\\footnote{\\label{note:X}A note. See also note~\\ref{note:Y}.}\n\nBar.\\footnote{\\label{note:Y}Another note. See also\nnote~\\ref{note:X}}\n^D\n[ Para\n    [ Str \"We\"\n    , Space\n    , Str \"discuss\"\n    , Space\n    , Str \"foobar\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"notes\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"note:X\" )\n          ]\n        )\n        [ Str \"1\" ]\n        ( \"#note:X\" , \"\" )\n    , Space\n    , Str \"and\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"note:Y\" )\n          ]\n        )\n        [ Str \"2\" ]\n        ( \"#note:Y\" , \"\" )\n    , Str \".\"\n    ]\n, Para\n    [ Str \"Foo.\"\n    , Note\n        [ Para\n            [ Span ( \"note:X\" , [] , [ ( \"label\" , \"note:X\" ) ] ) []\n            , Str \"A\"\n            , Space\n            , Str \"note.\"\n            , Space\n            , Str \"See\"\n            , Space\n            , Str \"also\"\n            , Space\n            , Str \"note\\160\"\n            , Link\n                ( \"\"\n                , []\n                , [ ( \"reference-type\" , \"ref\" )\n                  , ( \"reference\" , \"note:Y\" )\n                  ]\n                )\n                [ Str \"2\" ]\n                ( \"#note:Y\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n    ]\n, Para\n    [ Str \"Bar.\"\n    , Note\n        [ Para\n            [ Span ( \"note:Y\" , [] , [ ( \"label\" , \"note:Y\" ) ] ) []\n            , Str \"Another\"\n            , Space\n            , Str \"note.\"\n            , Space\n            , Str \"See\"\n            , Space\n            , Str \"also\"\n            , SoftBreak\n            , Str \"note\\160\"\n            , Link\n                ( \"\"\n                , []\n                , [ ( \"reference-type\" , \"ref\" )\n                  , ( \"reference\" , \"note:X\" )\n                  ]\n                )\n                [ Str \"1\" ]\n                ( \"#note:X\" , \"\" )\n            ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7939.md",
    "content": "```\n% pandoc -f latex -t native\n\\def\\|{\\verb|}\n\\vbox{\n\\hbox{\\|\\begin{minipage}[t]%|}\n}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"\\\\begin{minipage}[t]%\" ] ]\n```\n"
  },
  {
    "path": "test/command/7941.md",
    "content": "```\n% pandoc -f commonmark_x -t commonmark_x\n# Class setup\n^D\n# Class setup\n```\n"
  },
  {
    "path": "test/command/7953.md",
    "content": "```\n% pandoc -f latex -t native\n{foo\\bgroup bar\\egroup }\n^D\n[ Para\n    [ Span\n        ( \"\" , [] , [] )\n        [ Str \"foo\" , Span ( \"\" , [] , [] ) [ Str \"bar\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/7965.md",
    "content": "```\n% pandoc -f markdown -t gfm\nWatson and Crick (1953)\n\n<div id=\"refs\" class=\"references csl-bib-body hanging-indent\">\n\n<div id=\"ref-WatsonCrick1953\" class=\"csl-entry\">\n\nWatson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic\nAcids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):\n737–38. <https://doi.org/10.1038/171737a0>.\n\n</div>\n\n</div>\n^D\nWatson and Crick (1953)\n\n<div id=\"refs\" class=\"references csl-bib-body hanging-indent\">\n\n<div id=\"ref-WatsonCrick1953\" class=\"csl-entry\">\n\nWatson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic\nAcids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):\n737–38. <https://doi.org/10.1038/171737a0>.\n\n</div>\n\n</div>\n```\n\n```\n% pandoc -f markdown -t gfm-raw_html\nWatson and Crick (1953)\n\n<div id=\"refs\" class=\"references csl-bib-body hanging-indent\">\n\n<div id=\"ref-WatsonCrick1953\" class=\"csl-entry\">\n\nWatson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic\nAcids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):\n737–38. <https://doi.org/10.1038/171737a0>.\n\n</div>\n\n</div>\n^D\nWatson and Crick (1953)\n\nWatson, J. D., and F. H. C. Crick. 1953. “Molecular Structure of Nucleic\nAcids: A Structure for Deoxyribose Nucleic Acid.” *Nature* 171 (4356):\n737–38. <https://doi.org/10.1038/171737a0>.\n```\n\n"
  },
  {
    "path": "test/command/8003.md",
    "content": "```\n% pandoc -f markdown+ascii_identifiers\n# Işık\n^D\n<h1 id=\"isik\">Işık</h1>\n```\n"
  },
  {
    "path": "test/command/8011.md",
    "content": "```\n% pandoc -f docbook -t gfm\n<itemizedlist mark=\"none\">\n<listitem>\n<simpara>&#10063; a</simpara>\n</listitem>\n<listitem>\n<simpara>&#10003; b</simpara>\n</listitem>\n</itemizedlist>\n^D\n- [ ] a\n\n- [x] b\n```\n"
  },
  {
    "path": "test/command/8024.md",
    "content": "```\n% pandoc -d command/8024a.yaml -t markdown\nHello, if this works the text should be wrapped.\n^D\nHello, if this\nworks the text\nshould be\nwrapped.\n\n```\n"
  },
  {
    "path": "test/command/8024a.yaml",
    "content": "defaults: ${.}/8024b.yaml\n\n"
  },
  {
    "path": "test/command/8024b.yaml",
    "content": "wrap: auto\ncolumns: 15\n\n"
  },
  {
    "path": "test/command/8028.md",
    "content": "```\n% pandoc\nfoo^[a note\n\nwith multiple paragraphs]\n^D\n<p>foo^[a note</p>\n<p>with multiple paragraphs]</p>\n\n```\n"
  },
  {
    "path": "test/command/8047.md",
    "content": "```\n% pandoc --wrap=none\n![](file.jpg){height=10em width=10em style='border: 1px solid black'}\n^D\n<p><img src=\"file.jpg\" style=\"border: 1px solid black;width:10em;height:10em\" /></p>\n```\n"
  },
  {
    "path": "test/command/8070.md",
    "content": "```\n% pandoc -f html -t asciidoc\n<p><a href=\"https://docs.oracle.com/database/121/BRADV/rcmxplat.htm#BRADV724\">12.1\nmanual&#44; Database Backup and Recovery User&#8217;s Guide:\n<span class=\"enumeration_chapter\">Chapter 28</span> Transporting Data Across Platforms&#44;\nSteps to Transport a Database to a Different Platform Using Backup Sets</a></p>\n^D\nhttps://docs.oracle.com/database/121/BRADV/rcmxplat.htm#BRADV724[12.1\nmanual&#44; Database Backup and Recovery User’s Guide:\n[.enumeration_chapter]#Chapter 28# Transporting Data Across\nPlatforms&#44; Steps to Transport a Database to a Different Platform\nUsing Backup Sets]\n```\n"
  },
  {
    "path": "test/command/8079.md",
    "content": "```\n% pandoc -f html -t icml\n<table custom-style=\"Foo\">\n<tr><td>one</td></tr>\n</table>\n^D\n<Table AppliedTableStyle=\"TableStyle/Foo\" HeaderRowCount=\"0\" BodyRowCount=\"1\" ColumnCount=\"1\">\n  <Column Name=\"0\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>one</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n</ParagraphStyleRange>\n```\n"
  },
  {
    "path": "test/command/8088.md",
    "content": "```\n% pandoc -t latex --biblatex\n[@first, 1; @second; @third, 3]\n^D\n\\autocites[1]{first}{second}[3]{third}\n```\n"
  },
  {
    "path": "test/command/8097.md",
    "content": "```\n% pandoc --number-sec --number-offset=2 --wrap=none\n# One\n\n# two\n^D\n<h1 data-number=\"3\" id=\"one\"><span class=\"header-section-number\">3</span> One</h1>\n<h1 data-number=\"4\" id=\"two\"><span class=\"header-section-number\">4</span> two</h1>\n```\n"
  },
  {
    "path": "test/command/8098.md",
    "content": "```\n% pandoc -t revealjs --slide-level=2\n# Title 1\n\n## Slide 1\n\nText.\n\n::: fragment\n### Sub Slide header\n\nText.\n:::\n\n## Slide 2\n\nText.\n^D\n<section>\n<section id=\"title-1\" class=\"title-slide slide level1\">\n<h1>Title 1</h1>\n\n</section>\n<section id=\"slide-1\" class=\"slide level2\">\n<h2>Slide 1</h2>\n<p>Text.</p>\n<div class=\"fragment\">\n<h3 id=\"sub-slide-header\">Sub Slide header</h3>\n<p>Text.</p>\n</div>\n</section>\n<section id=\"slide-2\" class=\"slide level2\">\n<h2>Slide 2</h2>\n<p>Text.</p>\n</section></section>\n```\n"
  },
  {
    "path": "test/command/8110.md",
    "content": "```\n% pandoc -f mediawiki\n{| class=\"wikitable\"\n! Header text \n! Header text \n! Header text\n\n|-\n| Example \n| Example \n| Example\n\n|- <!-- This is a comment --> \n| Example \n| Example \n| Example\n|}\n^D\n<table>\n<thead>\n<tr>\n<th><p>Header text</p></th>\n<th><p>Header text</p></th>\n<th><p>Header text</p></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><p>Example</p></td>\n<td><p>Example</p></td>\n<td><p>Example</p></td>\n</tr>\n<tr>\n<td><p>Example</p></td>\n<td><p>Example</p></td>\n<td><p>Example</p></td>\n</tr>\n</tbody>\n</table>\n\n```\n"
  },
  {
    "path": "test/command/8131.md",
    "content": "# TOC in gfm contains no HTML by default\n```\n% pandoc --to=gfm --toc --standalone\n# Head\n\nContent\n^D\n- [Head](#head)\n\n# Head\n\nContent\n```\n\n# Same in Markdown if link_attributes extension is disabled\n```\n% pandoc --to=markdown-link_attributes --toc --standalone\n# Head\n\nContent\n^D\n- [Head](#head)\n\n# Head\n\nContent\n```\n\n# IDs are added to TOC with the \"attributes\" CommonMark extension\n```\n% pandoc --to=commonmark+gfm_auto_identifiers+attributes --toc -s\n# Nam a sapien\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit.\n^D\n- [Nam a sapien](#nam-a-sapien){#toc-nam-a-sapien}\n\n# Nam a sapien\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit.\n```\n"
  },
  {
    "path": "test/command/8150.md",
    "content": "Nested bullet lists\n```\n% pandoc -f html -t markdown\n<ul>\n\t<li>L1</li>\n\t<li>L2</li>\n\t<ul>\n\t\t<li>L3.1</li>\n\t\t<li>L3.2</li>\n\t</ul>\n  <li>L4</li>\n</ul>\n^D\n- L1\n- L2\n  - L3.1\n  - L3.2\n- L4\n```\n\nNested ordered lists\n```\n% pandoc -f html -t markdown\n<ol>\n\t<li>L1</li>\n\t<li>L2</li>\n\t<ol>\n\t\t<li>L3.1</li>\n\t\t<li>L3.2</li>\n\t</ol>\n</ol>\n^D\n1.  L1\n2.  L2\n    1.  L3.1\n    2.  L3.2\n```\n\nOrdered list nested below an unordered list\n```\n% pandoc -f html -t markdown\n<ul>\n\t<li>L1</li>\n\t<li>L2</li>\n\t<ol>\n\t\t<li>L3.1</li>\n\t\t<li>L3.2</li>\n\t</ol>\n</ul>\n^D\n- L1\n- L2\n  1.  L3.1\n  2.  L3.2\n```\n"
  },
  {
    "path": "test/command/8170.md",
    "content": "```\n% pandoc -f rtf -t html\n{\\rtf1\\ansi\\ansicpg1252\\cocoartf2638\n\\cocoascreenfonts1\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\froman\\fcharset0 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n\\margl1440\\margr1440\\vieww16800\\viewh17280\\viewkind0\n\\pard\\tx1080\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\tx6480\\tx7200\\tx7920\\tx8640\\li180\\fi440\\sa120\\pardirnatural\\partightenfactor0\n\n\\f0\\fs34 \\cf0 In 5\n\\fs20 \\super th\n\\fs34 \\nosupersub  grade I found a bug.}\n^D\n<p>In 5<sup>th</sup> grade I found a bug.</p>\n```\n"
  },
  {
    "path": "test/command/8174.md",
    "content": "````\n% pandoc -t native\n```yaml {#id}\nsome: code\n```\n^D\n[ CodeBlock ( \"id\" , [ \"yaml\" ] , [] ) \"some: code\" ]\n````\n\n````\n% pandoc -t native\n```yaml {.class #id}\nsome: code\n```\n^D\n[ CodeBlock\n    ( \"id\" , [ \"yaml\" , \"class\" ] , [] ) \"some: code\"\n]\n````\n\n<!-- Inline code sections at the start of the line should not be mistaken for code blocks -->\n````\n% pandoc -t native\n```ab```\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"ab\" ] ]\n````\n\n````\n% pandoc -t native\n```ab```{.class}\n^D\n[ Para [ Code ( \"\" , [ \"class\" ] , [] ) \"ab\" ] ]\n````\n\n<!-- Illegal language identifiers should be treated as inline code for now -->\n````\n% pandoc -t native\n``` foo}{.bar}\ntest\n```\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"foo}{.bar} test\" ] ]\n````\n"
  },
  {
    "path": "test/command/8178.md",
    "content": "```\n% pandoc -f dokuwiki -t native\n<latex>$\\sum_{\\substack{(i,j) \\in I^2 \\i \\neq j}}$</latex>\n^D\n[ Para\n    [ RawInline\n        (Format \"latex\")\n        \"$\\\\sum_{\\\\substack{(i,j) \\\\in I^2 \\\\i \\\\neq j}}$\"\n    ]\n]\n```\n\n```\n% pandoc -f dokuwiki+tex_math_dollars -t native\n$mc^2$\n^D\n[ Para [ Math InlineMath \"mc^2\" ] ]\n```\n\n```\n% pandoc -f dokuwiki -t native\n$mc^2$\n^D\n[ Para [ Str \"$mc^2$\" ] ]\n```\n"
  },
  {
    "path": "test/command/8179.md",
    "content": "```\n% pandoc -f latex -t native\n\\passthrough{\\lstinline!\\\\textbf\\{\\}!}\n^D\n[ Para [ Code ( \"\" , [] , [] ) \"\\\\textbf{}\" ] ]\n```\n"
  },
  {
    "path": "test/command/8182.md",
    "content": "```\n% pandoc -f dokuwiki -t rst\nThis //text and [[https://pandoc.org/|link]] are in italic//.\n^D\nThis *text and* `link <https://pandoc.org/>`__ *are in italic*.\n```\n"
  },
  {
    "path": "test/command/8201.md",
    "content": "```\n% pandoc -f org -t html\n[[file:d:/Home/Documents/test.png][Link Test]]\n^D\n<p><a href=\"file:///d:/Home/Documents/test.png\">Link Test</a></p>\n```\n"
  },
  {
    "path": "test/command/8204.md",
    "content": "Include abstract in Org output.\n```\n% pandoc --to=org --standalone\n---\nabstract: |\n  This is an *abstract*.\n\n  It has multiple paragraphs.\n---\n^D\n#+begin_abstract\nThis is an /abstract/.\n\nIt has multiple paragraphs.\n\n#+end_abstract\n```\n\nParse abstract environment as *abstract* metadata field.\n```\n% pandoc --from=org --to=markdown --standalone\n#+begin_abstract\n\nThis is an /abstract/.\n\nIt has multiple paragraphs.\n#+end_abstract\n\nMain text\n^D\n---\nabstract: |\n  This is an *abstract*.\n\n  It has multiple paragraphs.\n---\n\nMain text\n```\n\nUppercase ABSTRACT environment is not moved to metadata.\n```\n% pandoc --from=org --to=markdown --standalone\n#+BEGIN_ABSTRACT\nSome text.\n#+END_ABSTRACT\n^D\n::: ABSTRACT\nSome text.\n:::\n```\n"
  },
  {
    "path": "test/command/8216.md",
    "content": "Misaligned separators in grid table\n```\n% pandoc -f markdown -t html\n: Grid Table\n\n+-----------------+:-:+\n|Some text        |[text]{.class1 .class2 .class3}|\n+-----------------+---+\n|Some text        |[text]{.class1 .class2 .class3}|\n+-----------------+---+\n|Some text        |[text]{.class1 .class2 .class3}|\n+-----------------+---+\n^D\n<table style=\"width:69%;\">\n<caption>Grid Table</caption>\n<colgroup>\n<col style=\"width: 25%\" />\n<col style=\"width: 44%\" />\n</colgroup>\n<tbody>\n<tr>\n<td>Some text</td>\n<td><span class=\"class1 class2 class3\">text</span></td>\n</tr>\n<tr>\n<td>Some text</td>\n<td><span class=\"class1 class2 class3\">text</span></td>\n</tr>\n<tr>\n<td>Some text</td>\n<td><span class=\"class1 class2 class3\">text</span></td>\n</tr>\n</tbody>\n</table>\n```\n\nMissing cell\n\n```\n% pandoc -f markdown -t gfm\n+------+\n| text |\n+------+---+\n| text | 1 |\n+------+---+\n^D\n|      |     |\n|------|-----|\n| text |     |\n| text | 1   |\n```\n"
  },
  {
    "path": "test/command/8219.md",
    "content": "```\n% pandoc -f html -t latex\n<table id=\"test\">\n  <tr><td>one</td><td>two</td></tr>\n</table>\n^D\n\\begin{longtable}[]{@{}ll@{}}\n\\caption{}\\label{test}\\tabularnewline\n\\toprule\\noalign{}\n\\endfirsthead\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\none & two \\\\\n\\end{longtable}\n```\n"
  },
  {
    "path": "test/command/8236.md",
    "content": "```\n% pandoc -f org -t native\n  #+begin_src jupyter-python :session py :display plain\n  import pandas as pd\n  df = pd.read_csv('weight.csv', parse_dates=['Date'], index_col=0)\n  #+end_src\n^D\n[ CodeBlock\n    ( \"\"\n    , [ \"python\" , \"code\" ]\n    , [ ( \"session\" , \"py\" ) , ( \"display\" , \"plain\" ) ]\n    )\n    \"import pandas as pd\\ndf = pd.read_csv('weight.csv', parse_dates=['Date'], index_col=0)\\n\"\n]\n```\n"
  },
  {
    "path": "test/command/8243.md",
    "content": "```\n% pandoc -f latex\n\\newenvironment{topics}{\n\\newcommand{\\topic}[2]{ \\item{##1 / ##2} }\nTopics:\n\\begin{itemize}\n}\n{\n\\end{itemize}\n}\n\n\\begin{topics}\n\\topic{Foo}{Bar}\n\\topic{Baz}{Bim}\n\\end{topics}\n^D\n<p>Topics:</p>\n<ul>\n<li><p><span>Foo / Bar</span></p></li>\n<li><p><span>Baz / Bim</span></p></li>\n</ul>\n```\n\n"
  },
  {
    "path": "test/command/8251.md",
    "content": "```\n% pandoc -f native -t html\nLink (\"\",[\"\", \"\", \"\"],[]) [Str \"foo\"] (\"https://example.com\",\"\")\n^D\n<a href=\"https://example.com\">foo</a>\n```\n\n```\n% pandoc -f native -t markdown\nLink (\"\",[\"\", \"\", \"\"],[]) [Str \"foo\"] (\"https://example.com\",\"\")\n^D\n[foo](https://example.com){}\n```\n"
  },
  {
    "path": "test/command/8254.md",
    "content": "```\n% pandoc -t native\nWow![@legras_michel_2010]\n^D\n[ Para\n    [ Str \"Wow!\"\n    , Cite\n        [ Citation\n            { citationId = \"legras_michel_2010\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = NormalCitation\n            , citationNoteNum = 2\n            , citationHash = 0\n            }\n        ]\n        [ Str \"[@legras_michel_2010]\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/8256.md",
    "content": "```\n% pandoc -t opendocument -s\n\n---\ntitle: |\n  This *is* \\\n  a test\nauthor: Someone\n---\n\nTesting.\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\" xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" office:version=\"1.3\">\n  <office:font-face-decls>\n    <style:font-face style:name=\"Courier New\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\" svg:font-family=\"'Courier New'\" />\n  </office:font-face-decls>\n  <office:automatic-styles>\n    <style:style style:name=\"T1\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" style:font-style-asian=\"italic\" style:font-style-complex=\"italic\" /></style:style>\n    <style:style style:name=\"fr2\" style:family=\"graphic\" style:parent-style-name=\"Formula\"><style:graphic-properties style:vertical-pos=\"middle\" style:vertical-rel=\"text\" style:horizontal-pos=\"center\" style:horizontal-rel=\"paragraph-content\" style:wrap=\"none\" /></style:style>\n    <style:style style:name=\"fr1\" style:family=\"graphic\" style:parent-style-name=\"Formula\"><style:graphic-properties style:vertical-pos=\"middle\" style:vertical-rel=\"text\" /></style:style>\n  </office:automatic-styles>\n<office:body>\n<office:text>\n<text:p text:style-name=\"Title\">This\n<text:span text:style-name=\"T1\">is</text:span><text:line-break />a\ntest</text:p>\n<text:p text:style-name=\"Author\">Someone</text:p>\n<text:p text:style-name=\"Text_20_body\">Testing.</text:p>\n</office:text>\n</office:body>\n</office:document-content>\n```\n\n"
  },
  {
    "path": "test/command/8257.md",
    "content": "```\n% pandoc -f markdown -t html5\n+------+-------+\n| Item | Price |\n+======+=======+\n| Eggs | 5£    |\n+------+-------+\n| Spam | 3£    |\n+======+=======+\n| Sum  | 8£    |\n+======+=======+\n^D\n<table style=\"width:21%;\">\n<colgroup>\n<col style=\"width: 9%\" />\n<col style=\"width: 11%\" />\n</colgroup>\n<thead>\n<tr>\n<th>Item</th>\n<th>Price</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Eggs</td>\n<td>5£</td>\n</tr>\n<tr>\n<td>Spam</td>\n<td>3£</td>\n</tr>\n</tbody><tfoot>\n<tr>\n<td>Sum</td>\n<td>8£</td>\n</tr>\n</tfoot>\n\n</table>\n```\n"
  },
  {
    "path": "test/command/8281.md",
    "content": "```\n% pandoc -t html\n# Title\n\ntest\n\n. . .\n\ntest\n^D\n<h1 id=\"title\">Title</h1>\n<p>test</p>\n<p>. . .</p>\n<p>test</p>\n```\n"
  },
  {
    "path": "test/command/8302.md",
    "content": "```\n% pandoc -f org -t markdown\nsome text cite:&long-2004-tecton-evolut\n^D\nsome text @long-2004-tecton-evolut\n```\n"
  },
  {
    "path": "test/command/8307.md",
    "content": "```\n% pandoc -t commonmark -f html\n<table>\n<tbody>\n<tr>\n<td title=\"this\n  \n\nbreaks\">hello</td>\n</tr>\n</tbody>\n</table>\n^D\n<table>\n<tbody>\n<tr>\n<td title=\"this\n  &#10;\nbreaks\">hello</td>\n</tr>\n</tbody>\n</table>\n```\n\n````\n% pandoc -t commonmark -f markdown\n``` {=html}\n<table>\n<tbody>\n<tr>\n<td title=\"this\n  \n\nbreaks\">hello</td>\n</tr>\n</tbody>\n</table>\n```\n^D\n<table>\n<tbody>\n<tr>\n<td title=\"this\n  &#10;\nbreaks\">hello</td>\n</tr>\n</tbody>\n</table>\n````\n"
  },
  {
    "path": "test/command/8344.md",
    "content": "```\n% pandoc -t jats -s\n---\ntitle: |-\n  My\\\n  document\n...\n\n# Section\\\nwith line break\n\nParagraph\\\nwith line break\n\n--------\nA    B\n---  ---\n1\\   3\n2    4\n\n*1\\  5\\\n2*   6\n\n     7\n--------\n\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>My<break/>document</article-title>\n</title-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<sec id=\"section\">\n  <title>Section<break/></title>\n  <p>with line break</p>\n  <p>Paragraph\n  with line break</p>\n  <table-wrap>\n    <table>\n      <colgroup>\n        <col width=\"7%\" />\n        <col width=\"7%\" />\n      </colgroup>\n      <thead>\n        <tr>\n          <th align=\"left\">A</th>\n          <th align=\"left\">B</th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td align=\"left\">1<break/>2</td>\n          <td align=\"left\">3 4</td>\n        </tr>\n        <tr>\n          <td align=\"left\"><italic>1\n          2</italic></td>\n          <td align=\"left\">5<break/>6</td>\n        </tr>\n        <tr>\n          <td align=\"left\"></td>\n          <td align=\"left\">7</td>\n        </tr>\n      </tbody>\n    </table>\n  </table-wrap>\n</sec>\n</body>\n<back>\n</back>\n</article>\n```\n"
  },
  {
    "path": "test/command/8354.md",
    "content": "```\n% pandoc -f markdown -t html --citeproc\n---\ntitle: test\nnocite: '[@*]'\nreferences:\n- author:\n  - family: Fekete\n    given: Jean-Daniel\n  - family: Freire\n    given: Juliana\n  DOI: 10.1109/MCG.2020.3006412\n  id: feketeExploringReproducibilityVisualization2020\n  ISSN: 1558-1756\n  issue: 5\n  issued: 2020-09\n  page: 108-119\n  source: IEEE Xplore\n  title: Exploring Reproducibility in Visualization\n  container-title: IEEE Computer Graphics and Applications\n  type: article-journal\n  volume: 40\n---\n\n## References\n^D\n<h2 class=\"unnumbered\" id=\"references\">References</h2>\n<div id=\"refs\" class=\"references csl-bib-body hanging-indent\"\nrole=\"list\">\n<div id=\"ref-feketeExploringReproducibilityVisualization2020\"\nclass=\"csl-entry\" role=\"listitem\">\nFekete, Jean-Daniel, and Juliana Freire. 2020. <span>“Exploring\nReproducibility in Visualization.”</span> <em>IEEE Computer Graphics and\nApplications</em> 40 (5): 108–19. <a\nhref=\"https://doi.org/10.1109/MCG.2020.3006412\">https://doi.org/10.1109/MCG.2020.3006412</a>.\n</div>\n</div>\n```\n"
  },
  {
    "path": "test/command/8364.md",
    "content": "```\n% pandoc --citeproc -t jats -s\n---\nreference-section-title: Bibliography\ncsl: command/apa.csl\nreferences:\n- author:\n  - family: Doe\n    given: John\n  id: test\n  issued:\n    date-parts:\n    - - 2006\n  title: Test\n  type: 'article-journal'\n  volume: 81\n---\n\n@test\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<p>Doe (2006)</p>\n</body>\n<back>\n<ref-list>\n  <title>Bibliography</title>\n  <ref id=\"ref-test\">\n    <mixed-citation>Doe, J. (2006). Test,\n    <italic>81</italic>.</mixed-citation>\n  </ref>\n</ref-list>\n</back>\n</article>\n\n```\n"
  },
  {
    "path": "test/command/8365.md",
    "content": "```\n% pandoc -f jats -t native -s\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<p>Doe (2006)</p>\n</body>\n<back>\n<ref-list>\n  <title>Bibliography</title>\n  <ref id=\"ref-test\">\n    <mixed-citation>Doe, J. (2006). Test,\n    <italic>81</italic>.</mixed-citation>\n  </ref>\n</ref-list>\n</back>\n</article>\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"references\"\n            , MetaList\n                [ MetaMap (fromList [ ( \"id\" , MetaString \"test\" ) ]) ]\n            )\n          ]\n    }\n  [ Para [ Str \"Doe\" , Space , Str \"(2006)\" ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Bibliography\" ]\n  , Div ( \"refs\" , [] , [] ) []\n  ]\n```\n"
  },
  {
    "path": "test/command/8380.md",
    "content": "```\n% pandoc -f man -t rst\nLC_*\n^D\nLC\\_\\*\n```\n\nThese examples of things that don't require escaping are taken\nfrom the RST documentation:\n\n```\n% pandoc -f native -t rst\n[Para [Str \"2*x a**b O(N**2) e**(x*y) f(x)*f(y) a|b\"]\n,Para [Str \"a**b O(N**2) e**(x*y) f(x)*f(y)\"]\n]\n^D\n2*x a**b O(N**2) e**(x*y) f(x)*f(y) a|b\n\na**b O(N**2) e**(x*y) f(x)*f(y)\n```\n\nThese examples of things that do require escaping are taken\nfrom the RST documentation:\n\n```\n% pandoc -f native -t rst\nStr \"*4, class_, *args, **kwargs, `TeX-quoted', *ML, *.txt\"\n^D\n\\*4, class\\_, \\*args, \\**kwargs, \\`TeX-quoted', \\*ML, \\*.txt\n```\n\n"
  },
  {
    "path": "test/command/8402.md",
    "content": "```\n% pandoc --toc -s -t markdown\n::: {.cell .markdown id=\"6u8qXoeFGdqt\"}\n# Summary\n> Expand to see summary\n\n## Overview and Explanation\n:::\n\n# Details\n\n## inner 1\ntext\n\n## inner 2\n\n### inner inner 1\n\n## inner 3\ntext\n^D\n- [Summary](#summary){#toc-summary}\n  - [Overview and\n    Explanation](#overview-and-explanation){#toc-overview-and-explanation}\n- [Details](#details){#toc-details}\n  - [inner 1](#inner-1){#toc-inner-1}\n  - [inner 2](#inner-2){#toc-inner-2}\n    - [inner inner 1](#inner-inner-1){#toc-inner-inner-1}\n  - [inner 3](#inner-3){#toc-inner-3}\n\n::: {#6u8qXoeFGdqt .cell .markdown}\n# Summary\n\n> Expand to see summary\n\n## Overview and Explanation\n:::\n\n# Details\n\n## inner 1\n\ntext\n\n## inner 2\n\n### inner inner 1\n\n## inner 3\n\ntext\n```\n"
  },
  {
    "path": "test/command/8437.md",
    "content": "```\n% pandoc -f markdown -t asciidoc\n[![alt](https://img.shields.io/badge/License-Apache%202.0-blue.svg \"title\")](http://www.apache.org/licenses/LICENSE-2.0)\n^D\nhttp://www.apache.org/licenses/LICENSE-2.0[image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[alt,title=\"title\"]]\n```\n\n```\n% pandoc -f markdown -t docbook\n[![alt](https://img.shields.io/badge/License-Apache%202.0-blue.svg \"title\")](http://www.apache.org/licenses/LICENSE-2.0)\n^D\n<para>\n  <link xlink:href=\"http://www.apache.org/licenses/LICENSE-2.0\"><inlinemediaobject>\n    <imageobject>\n      <objectinfo>\n        <title>title</title>\n      </objectinfo>\n      <imagedata fileref=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" />\n    </imageobject>\n    <textobject>\n      <phrase>alt</phrase>\n    </textobject>\n  </inlinemediaobject></link>\n</para>\n```\n\n```\n% pandoc -f docbook -t markdown\n<para>\n  <link xlink:href=\"http://www.apache.org/licenses/LICENSE-2.0\"><inlinemediaobject>\n    <imageobject>\n      <objectinfo>\n        <title>title</title>\n      </objectinfo>\n      <imagedata fileref=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" />\n    </imageobject>\n    <textobject>\n      <phrase>alt</phrase>\n    </textobject>\n  </inlinemediaobject></link>\n</para>\n^D\n[![alt](https://img.shields.io/badge/License-Apache%202.0-blue.svg \"title\")](http://www.apache.org/licenses/LICENSE-2.0)\n```\n"
  },
  {
    "path": "test/command/8486.md",
    "content": "# Unnumbered and unlisted headings in ConTeXt\n\n```\n% pandoc --to=context\n# Preface {.unlisted -}\n\nNullam rutrum.\n\n# Introduction\n\nNullam eu ante vel est convallis dignissim.\n\n# Methods\n\nSed diam. Nulla posuere. Praesent fermentum tempor tellus. Nam\nvestibulum accumsan nisl. Nam vestibulum accumsan nisl.\n\n# References {-}\n^D\n\\startsubject[title={Preface},reference={preface},number=no,incrementnumber=no]\n\nNullam rutrum.\n\n\\stopsubject\n\n\\startsectionlevel[title={Introduction},reference={introduction}]\n\nNullam eu ante vel est convallis dignissim.\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Methods},reference={methods}]\n\nSed diam. Nulla posuere. Praesent fermentum tempor tellus. Nam\nvestibulum accumsan nisl. Nam vestibulum accumsan nisl.\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={References},reference={references},number=no,incrementnumber=no]\n\n\\stopsectionlevel\n```\n\n## Semantic Headings with `--top-level-division`\n```\n% pandoc --to=context --top-level-division=chapter\n# Bibliography {-}\nNone\n^D\n\\startchapter[title={Bibliography},reference={bibliography},number=no,incrementnumber=no]\n\nNone\n\n\\stopchapter\n```\n"
  },
  {
    "path": "test/command/8487.md",
    "content": "```\n% pandoc -f textile -t native\np>.\n\np=. Links:\n^D\n[ Div\n    ( \"\" , [] , [ ( \"style\" , \"text-align:right;\" ) ] )\n    [ Para [] ]\n, Div\n    ( \"\" , [] , [ ( \"style\" , \"text-align:center;\" ) ] )\n    [ Para [ Str \"Links:\" ] ]\n]\n```\n"
  },
  {
    "path": "test/command/8504.md",
    "content": "```\n% pandoc -f markdown -s -t biblatex\n---\nreferences:\n- id: Larsson_2016\n  author:\n    - family: Larsson\n      given: Johan\n  citation-key: Larsson_2016\n  issued:\n    - year: 2016\n  medium: Windows\n  title: 'qualpalr: Automatic Generation of Qualitative Color Palettes'\n  type: software\n  URL: https://cran.r-project.org/package=qualpalr\n  version: 0.3.1\n...\n^D\n@software{Larsson_2016,\n  author = {Larsson, Johan},\n  title = {Qualpalr: {Automatic} {Generation} of {Qualitative} {Color}\n    {Palettes}},\n  version = {0.3.1},\n  date = {2016},\n  url = {https://cran.r-project.org/package=qualpalr}\n}\n```\n\n```\n% pandoc -f markdown -s -t bibtex\n---\nreferences:\n- id: Larsson_2016\n  author:\n    - family: Larsson\n      given: Johan\n  citation-key: Larsson_2016\n  issued:\n    - year: 2016\n  medium: Windows\n  title: 'qualpalr: Automatic Generation of Qualitative Color Palettes'\n  type: software\n  URL: https://cran.r-project.org/package=qualpalr\n  version: 0.3.1\n...\n^D\n@misc{Larsson_2016,\n  author = {Larsson, Johan},\n  title = {Qualpalr: {Automatic} {Generation} of {Qualitative} {Color}\n    {Palettes}},\n  year = {2016},\n  url = {https://cran.r-project.org/package=qualpalr}\n}\n```\n\n```\n% pandoc -f biblatex -s -t csljson\n@software{Larsson_2016,\n  author = {Larsson, Johan},\n  title = {Qualpalr: {Automatic} {Generation} of {Qualitative} {Color}\n    {Palettes}},\n  version = {0.3.1},\n  date = {2016},\n  url = {https://cran.r-project.org/package=qualpalr}\n}\n^D\n[\n  {\n    \"URL\": \"https://cran.r-project.org/package=qualpalr\",\n    \"author\": [\n      {\n        \"family\": \"Larsson\",\n        \"given\": \"Johan\"\n      }\n    ],\n    \"id\": \"Larsson_2016\",\n    \"issued\": {\n      \"date-parts\": [\n        [\n          2016\n        ]\n      ]\n    },\n    \"title\": \"Qualpalr: Automatic Generation of Qualitative Color Palettes\",\n    \"title-short\": \"Qualpalr\",\n    \"type\": \"software\",\n    \"version\": \"0.3.1\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/8508.md",
    "content": "```\n% pandoc -t man\nSEE ALSO\n========\n\n* [Milk](https://en.wikipedia.org/wiki/Milk)\n* [EBNF](https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)\n^D\n.SH SEE ALSO\n.IP \\(bu 2\n\\c\n.UR https://en.wikipedia.org/wiki/Milk\nMilk\n.UE \\c\n.IP \\(bu 2\n\\c\n.UR https://en.wikipedia.org/wiki/Extended_Backus–Naur_form\nEBNF\n.UE \\c\n```\n"
  },
  {
    "path": "test/command/8511.md",
    "content": "# Conversion of icon-like sequences followed by alphanum char\n## to Jira\n```\n% pandoc -t jira\n:P :P_ :PA :Pa :P2\n^D\n\\:P \\:P\\_ :PA :Pa :P2\n```\n\n## from jira\n```\n% pandoc -f jira -t markdown\n\\:PA\n^D\n\\\\:PA\n```\n"
  },
  {
    "path": "test/command/8513.md",
    "content": "# Round-tripping tags in org\n```\n% pandoc --from org --to org --columns=72\n* Header with tag   :tag:\n^D\n* Header with tag                                                  :tag:\n:PROPERTIES:\n:CUSTOM_ID: header-with-tag\n:END:\n```\n\nMultiple tags\n```\n% pandoc --from org-auto_identifiers --to org --columns=78\n* Header with two tags                                           :first:second:\n^D\n* Header with two tags                                          :first:second:\n```\n\nCheck that long headings work with tags\n\n```\n% pandoc --from org-auto_identifiers --to org --columns=40\n* Header with tag and more words which are not that interesting   :tag:\n^D\n* Header with tag and more words which are not that interesting :tag:\n```\n"
  },
  {
    "path": "test/command/853.md",
    "content": "reStructuredText citations.\n\n```\n% pandoc -f rst\nHere is a citation reference: [CIT2002]_.\n\n.. [CIT2002] This is the citation.  It's just like a footnote,\n   except the label is textual.\n^D\n<p>Here is a citation reference: <a href=\"#CIT2002\"\nclass=\"citation\">[CIT2002]</a>.</p>\n<div id=\"citations\">\n<dl>\n<dt><span id=\"CIT2002\" class=\"citation-label\">CIT2002</span></dt>\n<dd>\n<p>This is the citation. It's just like a footnote, except the label is\ntextual.</p>\n</dd>\n</dl>\n</div>\n```\n"
  },
  {
    "path": "test/command/8534.md",
    "content": "```\n% pandoc -f html -t texinfo\n<html>\nfoo <code>bar <var>baz</var> bar</code> foo\n</html>\n^D\n@node Top\n@top Top\n\nfoo @code{bar }@code{@var{baz}}@code{ bar} foo\n```\n"
  },
  {
    "path": "test/command/8573.md",
    "content": "```\n% pandoc -f latex -t plain\n\\newenvironment{myenv}[1]{Open#1}{Close}\n\\begin{myenv}{x}Hello\\end{myenv}\n^D\nOpenxHelloClose\n```\n"
  },
  {
    "path": "test/command/8611.md",
    "content": "```\n% pandoc -f markdown -s -t bibtex\n---\nnocite: \"[@*]\"\nreferences:\n- id: mcdowell:why\n  title: |\n    Why is Sellars's Essay Called \"Empiricism and the Philosophy of Mind\"?\n  author:\n  - family: McDowell\n    given: John\n  journal: Proceedings of the Aristotelian Society\n  type: chapter\n  container-title: 'Empiricism, Perceptual Knowledge, Normativity, and Realism: Essays on Wilfrid Sellars'\n  editor:\n    - family: deVries\n      given: Willem A.\n  issued: 2009\n  publisher: Oxford University Press\n  publisher-place: Oxford\n...\n^D\n@incollection{mcdowell:why,\n  author = {McDowell, John},\n  editor = {deVries, Willem A.},\n  publisher = {Oxford University Press},\n  title = {Why Is {Sellars’s} {Essay} {Called} “{Empiricism} and the\n    {Philosophy} of {Mind}”?},\n  booktitle = {Empiricism, Perceptual Knowledge, Normativity, and\n    Realism: Essays on Wilfrid Sellars},\n  year = {2009},\n  address = {Oxford}\n}\n```\n"
  },
  {
    "path": "test/command/8638.md",
    "content": "# Beamer tables must not use longtable footer\n```\n% pandoc -t beamer\n| fruit   | price |\n|---------|------:|\n| apple   | 2.05  |\n| oranges | 4.25  |\n^D\n\\begin{frame}\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}lr@{}}\n\\toprule\\noalign{}\nfruit & price \\\\\n\\midrule\\noalign{}\n\\endhead\napple & 2.05 \\\\\noranges & 4.25 \\\\\n\\bottomrule\\noalign{}\n\\end{longtable}\n}\n\\end{frame}\n```\n"
  },
  {
    "path": "test/command/8652.md",
    "content": "```\n% pandoc -t native\nMy text^[My note]isnot^[Text]\n^D\n[ Para\n    [ Str \"My\"\n    , Space\n    , Str \"text\"\n    , Note [ Para [ Str \"My\" , Space , Str \"note\" ] ]\n    , Str \"isnot\"\n    , Note [ Para [ Str \"Text\" ] ]\n    ]\n]\n\n```\n\n```\n% pandoc -t native\n^[note1]test^[note2]\n^D\n[ Para\n    [ Note [ Para [ Str \"note1\" ] ]\n    , Str \"test\"\n    , Note [ Para [ Str \"note2\" ] ]\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/8653.md",
    "content": "```\n% pandoc -f rst -t native\n.. role:: py:class(emphasis)\n\n:py:class:`foo`\n^D\n[ Para [ Emph [ Str \"foo\" ] ] ]\n```\n\n```\n% pandoc -f rst -t native\n:py:class:`foo`\n^D\n[ Para\n    [ Code\n        ( \"\"\n        , [ \"interpreted-text\" ]\n        , [ ( \"role\" , \"py:class\" ) ]\n        )\n        \"foo\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/8659.md",
    "content": "# A single pipe is parsed as an empty table\n```\n% pandoc -f org -t html\n|\n^D\n<table>\n<tbody>\n<tr>\n</tr>\n</tbody>\n</table>\n```\n# Accepts an empty org table within a grid table cell\n\nThe misaligned pipe in the first row is treated as an empty table.\n\n```\n% pandoc -f org -t html\n+-----+-----+-----+-----------+\n|     |     |     |         |\n+:====+=====+====:+==========:+\n| a   |  b  | c   | d         |\n+-----+-----+-----+-----------+\n^D\n<table style=\"width:42%;\">\n<colgroup>\n<col style=\"width: 8%\" />\n<col style=\"width: 8%\" />\n<col style=\"width: 8%\" />\n<col style=\"width: 16%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: left;\"></th>\n<th></th>\n<th style=\"text-align: right;\"></th>\n<th style=\"text-align: right;\"><table>\n<tbody>\n<tr>\n</tr>\n</tbody>\n</table></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">a</td>\n<td>b</td>\n<td style=\"text-align: right;\">c</td>\n<td style=\"text-align: right;\">d</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/8661.md",
    "content": "```\n% pandoc -f tsv -t gfm\na\tb\tc\n\t\t6\n^D\n| a   | b   | c   |\n|-----|-----|-----|\n|     |     | 6   |\n```\n"
  },
  {
    "path": "test/command/8665.md",
    "content": "```\n% pandoc -f docbook -t asciidoc\n<informaltable frame=\"all\" rowsep=\"1\" colsep=\"1\">\n    <tgroup cols=\"1\">\n        <thead>\n            <row>\n                <entry align=\"left\" valign=\"top\">h1</entry>\n                <entry align=\"left\" valign=\"top\">h2</entry>\n            </row>\n        </thead>\n        <tbody>\n            <row>\n                <entry align=\"left\" valign=\"top\">\n                    <simpara>!@#$%^&amp;*(){}|~?+-',.\"&lt;&gt;[]\\`</simpara>\n                </entry>\n                <entry align=\"left\" valign=\"top\">\n                    <simpara>col 2</simpara>\n                </entry>\n            </row>\n        </tbody>\n    </tgroup>\n</informaltable>\n^D\n[cols=\",\",options=\"header\",]\n|===\n<|h1 <|h2\n<|!@++#++$%^&++*++()++{++}{vbar}~?{plus}-',.\"++<>[]\\`++ <|col 2\n|===\n```\n"
  },
  {
    "path": "test/command/8666.md",
    "content": "```\n% pandoc -f docbook -t native\n<formalpara xml:id=\"my_code_id\">\n<title>Code title</title>\n<para>\n<programlisting language=\"bash\" linenumbering=\"unnumbered\">echo \"hello world!\"</programlisting>\n</para>\n</formalpara>\n<example xml:id=\"my_example_id\">\n<title>Example title</title>\n<simpara>example content</simpara>\n</example>\n<sidebar xml:id=\"my_sidebar_id\">\n<title>Sidebar title</title>\n<simpara>sidebar content</simpara>\n</sidebar>\n^D\n[ Div\n    ( \"my_code_id\" , [ \"formalpara\" ] , [] )\n    [ Div\n        ( \"\" , [ \"title\" ] , [] )\n        [ Plain [ Str \"Code\" , Space , Str \"title\" ] ]\n    , CodeBlock ( \"\" , [ \"bash\" ] , [] ) \"echo \\\"hello world!\\\"\"\n    ]\n, Div\n    ( \"my_example_id\" , [ \"example\" ] , [] )\n    [ Div\n        ( \"\" , [ \"title\" ] , [] )\n        [ Plain [ Str \"Example\" , Space , Str \"title\" ] ]\n    , Para [ Str \"example\" , Space , Str \"content\" ]\n    ]\n, Div\n    ( \"my_sidebar_id\" , [ \"sidebar\" ] , [] )\n    [ Div\n        ( \"\" , [ \"title\" ] , [] )\n        [ Plain [ Str \"Sidebar\" , Space , Str \"title\" ] ]\n    , Para [ Str \"sidebar\" , Space , Str \"content\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/8681.md",
    "content": "# Include Jira panel title in resulting div\n```\n% pandoc -f jira -t html\n{panel:title=This is the title|titleBGColor=#cccccc|bgColor=#eeeeee}\nPanel content\n{panel}\n^D\n<div class=\"panel\" data-titleBGColor=\"#cccccc\" data-bgColor=\"#eeeeee\">\n<div class=\"panelheader\">\n<strong>This is the title</strong>\n</div>\n<p>Panel content</p>\n</div>\n```\n"
  },
  {
    "path": "test/command/8689.md",
    "content": "# Org figures should be rendered implicit figures\n\n```\n% pandoc -f org -t markdown+implicit_figures\n#+label: fig:bsdd-graphql-voyager-orig-detail\n#+caption: Original bSDD GraphQL Schema: Detail of Classification and ClassificationProperty\n[[./Classification-ClassificationProperty.png]]\n^D\n![Original bSDD GraphQL Schema: Detail of Classification and\nClassificationProperty](./Classification-ClassificationProperty.png){#fig:bsdd-graphql-voyager-orig-detail}\n\n```\n"
  },
  {
    "path": "test/command/8711.md",
    "content": "```\n% pandoc -f html-native_spans -t native\n<table>\n<tr>\n<td>\n  <p><span class=\"foo\">a</span> <span class=\"bar\">b</span></p>\n</td>\n</tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"a\" , Space , Str \"b\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n\n```\n\n```\n% pandoc -f html-native_spans+raw_html -t native\n<table>\n<tr>\n<td>\n  <p><span class=\"foo\">a</span> <span class=\"bar\">b</span></p>\n</td>\n</tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para\n                    [ RawInline (Format \"html\") \"<span class=\\\"foo\\\">\"\n                    , Str \"a\"\n                    , RawInline (Format \"html\") \"</span>\"\n                    , Space\n                    , RawInline (Format \"html\") \"<span class=\\\"bar\\\">\"\n                    , Str \"b\"\n                    , RawInline (Format \"html\") \"</span>\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n\n```\n\n```\n% pandoc -f html -t native\n<table>\n<tr>\n<td>\n  <p><span class=\"foo\">a</span> <span class=\"bar\">b</span></p>\n</td>\n</tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para\n                    [ Span ( \"\" , [ \"foo\" ] , [] ) [ Str \"a\" ]\n                    , Space\n                    , Span ( \"\" , [ \"bar\" ] , [] ) [ Str \"b\" ]\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n\n```\n"
  },
  {
    "path": "test/command/8738.md",
    "content": "```\n% pandoc -f native -t mediawiki\n[Link (\"\",[],[]) [Link (\"\",[],[]) [Str \"test\"] (\"https://bar.example.com\",\"\"),Str \"Test\"] (\"https://foo.example.com\",\"\")]\n^D\n[https://foo.example.com <span>test</span>Test]\n```\n"
  },
  {
    "path": "test/command/8745.md",
    "content": "# Alt text on images\n\n```\n% pandoc -f latex -t native\n\\documentclass[12pt]{article}\n\\usepackage{graphicx}\n\\begin{document}\nSample text\n\\begin{figure}[ht]\n    \\includegraphics[alt={Upside down painting},width=0.5\\textwidth]{New_York_City_I.jpg}\n    \\caption{New York City by Piet Mondrian (Wikipedia)}\n    \\label{fig:Mondrian}\n\\end{figure}\n\\includegraphics[alt={Face of a mandrill}]{mandrill.jpg}\n\\end{document}\n^D\n[ Para [ Str \"Sample\" , Space , Str \"text\" ]\n, Figure\n    ( \"fig:Mondrian\" , [] , [ ( \"latex-placement\" , \"ht\" ) ] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"New\"\n           , Space\n           , Str \"York\"\n           , Space\n           , Str \"City\"\n           , Space\n           , Str \"by\"\n           , Space\n           , Str \"Piet\"\n           , Space\n           , Str \"Mondrian\"\n           , Space\n           , Str \"(Wikipedia)\"\n           ]\n       ])\n    [ Para\n        [ Image\n            ( \"\" , [] , [ ( \"width\" , \"50%\" ) ] )\n            [ Str \"Upside down painting\" ]\n            ( \"New_York_City_I.jpg\" , \"\" )\n        ]\n    ]\n, Para\n    [ Image\n        ( \"\" , [] , [] )\n        [ Str \"Face of a mandrill\" ]\n        ( \"mandrill.jpg\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/8764.md",
    "content": "```\n% pandoc -f html -t opendocument\n<table>\n  <tbody>\n    <tr>\n      <th>Header</th>\n      <td>Normal cell (column 2)</td>\n      <td>Normal cell (column 3)</td>\n    </tr>\n    <tr>\n      <td>Normal cell (column 1)</td>\n      <td>Normal cell (column 2)</td>\n      <td>Normal cell (column 3)</td>\n    </tr>\n  </tbody>\n</table>\n^D\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-column table:style-name=\"Table1.C\" />\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Header</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Normal cell (column\n      2)</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Normal cell (column\n      3)</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Normal cell (column\n      1)</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Normal cell (column\n      2)</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Normal cell (column\n      3)</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n```\n"
  },
  {
    "path": "test/command/8770-block.md",
    "content": "```\n% pandoc -t html5 --reference-location=block\n# Section 1\n\nhello[^1]\n\n: Sample table.[^2]\n\n-----------\n Fruit[^3]\n-----------\n Bans[^4]\n-----------\n\n# Section 2\n\ndolly[^5]\n\n[^1]: doc footnote\n[^2]: caption footnote\n[^3]: header footnote\n[^4]: table cell footnote\n[^5]: doc footnote\n^D\n<h1 id=\"section-1\">Section 1</h1>\n<p>hello<a href=\"#fn1\" class=\"footnote-ref\" id=\"fnref1\"\nrole=\"doc-noteref\"><sup>1</sup></a></p>\n<aside id=\"footnotes\" class=\"footnotes footnotes-end-of-block\"\nrole=\"doc-footnote\">\n<ol>\n<li id=\"fn1\"><p>doc footnote<a href=\"#fnref1\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</aside>\n<table style=\"width:17%;\">\n<caption>Sample table.<a href=\"#fn2\" class=\"footnote-ref\" id=\"fnref2\"\nrole=\"doc-noteref\"><sup>2</sup></a></caption>\n<colgroup>\n<col style=\"width: 16%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Fruit<a href=\"#fn3\" class=\"footnote-ref\"\nid=\"fnref3\" role=\"doc-noteref\"><sup>3</sup></a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">Bans<a href=\"#fn4\" class=\"footnote-ref\"\nid=\"fnref4\" role=\"doc-noteref\"><sup>4</sup></a></td>\n</tr>\n</tbody>\n</table>\n<aside id=\"footnotes-2\" class=\"footnotes footnotes-end-of-block\"\nrole=\"doc-footnote\">\n<ol start=\"2\">\n<li id=\"fn2\"><p>caption footnote<a href=\"#fnref2\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn3\"><p>header footnote<a href=\"#fnref3\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn4\"><p>table cell footnote<a href=\"#fnref4\"\nclass=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</aside>\n<h1 id=\"section-2\">Section 2</h1>\n<p>dolly<a href=\"#fn5\" class=\"footnote-ref\" id=\"fnref5\"\nrole=\"doc-noteref\"><sup>5</sup></a></p>\n<aside id=\"footnotes-3\" class=\"footnotes footnotes-end-of-block\"\nrole=\"doc-footnote\">\n<ol start=\"5\">\n<li id=\"fn5\"><p>doc footnote<a href=\"#fnref5\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</aside>\n```\n"
  },
  {
    "path": "test/command/8770-document.md",
    "content": "```\n% pandoc -t html5 --reference-location=document\n# Section 1\n\nhello[^1]\n\n: Sample table.[^2]\n\n-----------\n Fruit[^3]\n-----------\n Bans[^4]\n-----------\n\n# Section 2\n\ndolly[^5]\n\n[^1]: doc footnote\n[^2]: caption footnote\n[^3]: header footnote\n[^4]: table cell footnote\n[^5]: doc footnote\n^D\n<h1 id=\"section-1\">Section 1</h1>\n<p>hello<a href=\"#fn1\" class=\"footnote-ref\" id=\"fnref1\"\nrole=\"doc-noteref\"><sup>1</sup></a></p>\n<table style=\"width:17%;\">\n<caption>Sample table.<a href=\"#fn2\" class=\"footnote-ref\" id=\"fnref2\"\nrole=\"doc-noteref\"><sup>2</sup></a></caption>\n<colgroup>\n<col style=\"width: 16%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Fruit<a href=\"#fn3\" class=\"footnote-ref\"\nid=\"fnref3\" role=\"doc-noteref\"><sup>3</sup></a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">Bans<a href=\"#fn4\" class=\"footnote-ref\"\nid=\"fnref4\" role=\"doc-noteref\"><sup>4</sup></a></td>\n</tr>\n</tbody>\n</table>\n<h1 id=\"section-2\">Section 2</h1>\n<p>dolly<a href=\"#fn5\" class=\"footnote-ref\" id=\"fnref5\"\nrole=\"doc-noteref\"><sup>5</sup></a></p>\n<section id=\"footnotes\" class=\"footnotes footnotes-end-of-document\"\nrole=\"doc-endnotes\">\n<hr />\n<ol>\n<li id=\"fn1\"><p>doc footnote<a href=\"#fnref1\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn2\"><p>caption footnote<a href=\"#fnref2\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn3\"><p>header footnote<a href=\"#fnref3\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn4\"><p>table cell footnote<a href=\"#fnref4\"\nclass=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn5\"><p>doc footnote<a href=\"#fnref5\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</section>\n```\n"
  },
  {
    "path": "test/command/8770-section.md",
    "content": "```\n% pandoc -t html5 --reference-location=section\n# Section 1\n\nhello[^1]\n\n: Sample table.[^2]\n\n-----------\n Fruit[^3]\n-----------\n Bans[^4]\n-----------\n\n# Section 2\n\ndolly[^5]\n\n[^1]: doc footnote\n[^2]: caption footnote\n[^3]: header footnote\n[^4]: table cell footnote\n[^5]: doc footnote\n^D\n<h1 id=\"section-1\">Section 1</h1>\n<p>hello<a href=\"#fn1\" class=\"footnote-ref\" id=\"fnref1\"\nrole=\"doc-noteref\"><sup>1</sup></a></p>\n<table style=\"width:17%;\">\n<caption>Sample table.<a href=\"#fn2\" class=\"footnote-ref\" id=\"fnref2\"\nrole=\"doc-noteref\"><sup>2</sup></a></caption>\n<colgroup>\n<col style=\"width: 16%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Fruit<a href=\"#fn3\" class=\"footnote-ref\"\nid=\"fnref3\" role=\"doc-noteref\"><sup>3</sup></a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">Bans<a href=\"#fn4\" class=\"footnote-ref\"\nid=\"fnref4\" role=\"doc-noteref\"><sup>4</sup></a></td>\n</tr>\n</tbody>\n</table>\n<aside id=\"footnotes\" class=\"footnotes footnotes-end-of-section\"\nrole=\"doc-footnote\">\n<hr />\n<ol>\n<li id=\"fn1\"><p>doc footnote<a href=\"#fnref1\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn2\"><p>caption footnote<a href=\"#fnref2\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn3\"><p>header footnote<a href=\"#fnref3\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn4\"><p>table cell footnote<a href=\"#fnref4\"\nclass=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</aside>\n<h1 id=\"section-2\">Section 2</h1>\n<p>dolly<a href=\"#fn5\" class=\"footnote-ref\" id=\"fnref5\"\nrole=\"doc-noteref\"><sup>5</sup></a></p>\n<aside id=\"footnotes-2\" class=\"footnotes footnotes-end-of-section\"\nrole=\"doc-footnote\">\n<hr />\n<ol start=\"5\">\n<li id=\"fn5\"><p>doc footnote<a href=\"#fnref5\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</aside>\n```\n"
  },
  {
    "path": "test/command/8777.md",
    "content": "# Backslash escapes in markdown_strict\n\n```\n% pandoc --from=markdown_strict -t html\nThese are not escaped: \\~ \\\"\n^D\n<p>These are not escaped: \\~ \\\"</p>\n```\n"
  },
  {
    "path": "test/command/8783.md",
    "content": "```\n% pandoc -f rtf -t native\n{\\rtf1\\ansi\\ansicpg1252\\cocoartf2867\n\\cocoatextscaling0\\cocoaplatform1{\\fonttbl\\f0\\fnil\\fcharset0 HelveticaNeue;}\n{\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;}\n{\\*\\listtable{\\list\\listtemplateid1\\listhybrid{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{decimal\\}.}{\\leveltext\\leveltemplateid1\\'02\\'00.;}{\\levelnumbers\\'01;}\\fi-360\\li720\\lin720 }{\\listname ;}\\listid1}\n{\\list\\listtemplateid2\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{disc\\}}{\\leveltext\\leveltemplateid101\\'01\\uc0\\u8226 ;}{\\levelnumbers;}\\fi-360\\li720\\lin720 }{\\listname ;}\\listid2}}\n{\\*\\listoverridetable{\\listoverride\\listid1\\listoverridecount0\\ls1}{\\listoverride\\listid2\\listoverridecount0\\ls2}}\n\\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133\n\\deftab720\n\\pard\\pardeftab720\\partightenfactor0\n\n\\f0\\fs22 \\cf2 \\up0 \\nosupersub \\ulnone First paragraph\\\n\\pard\\tx20\\tx360\\pardeftab720\\li360\\fi-360\\partightenfactor0\n\\ls1\\ilvl0\\cf2 \\up0 \\nosupersub \\ulnone {\\listtext\t1.\t}\\cf2 \\up0 \\nosupersub \\ulnone Numbered item\\\n\\pard\\pardeftab720\\partightenfactor0\n\\cf2 Second paragraph\\\n\\pard\\tx20\\tx180\\pardeftab720\\li180\\fi-180\\partightenfactor0\n\\ls2\\ilvl0\\cf2 \\up0 \\nosupersub \\ulnone {\\listtext\t\\uc0\\u8226 \t}\\cf2 \\up0 \\nosupersub \\ulnone Bullet item\\\n\\pard\\pardeftab720\\partightenfactor0\n\\cf2 New paragraph}\n^D\n[ Para [ Str \"First\" , Space , Str \"paragraph\" ]\n, OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Para [ Str \"Numbered\" , Space , Str \"item\" ] ] ]\n, Para [ Str \"Second\" , Space , Str \"paragraph\" ]\n, BulletList\n    [ [ Para [ Str \"Bullet\" , Space , Str \"item\" ] ] ]\n, Para [ Str \"New\" , Space , Str \"paragraph\" ]\n]\n```\n"
  },
  {
    "path": "test/command/8789.md",
    "content": "# `\\multicolumn` with column-type `p`\n\n```\n% pandoc --from=latex --to=html\n\\begin{tabular}{rrll}\n\t\\toprule\n\t\\textbf{First} & \\textbf{Second} & \\textbf{Third} & \\textbf{Fourth} \\\\ \\toprule\n\t160 & 1 & test & test \\\\\\midrule\n\t160 & 2 & \\multicolumn{2}{p{12cm}}{\\textit{This is a test:}\n\t\t\t\\begin{equation*}\n\t\t\t\ta^2+b^2 = c^2\n\t\t\\end{equation*}\n\t}\\\\\n\\bottomrule\n\\end{tabular}\n^D\n<table>\n<thead>\n<tr>\n<th style=\"text-align: right;\"><strong>First</strong></th>\n<th style=\"text-align: right;\"><strong>Second</strong></th>\n<th style=\"text-align: left;\"><strong>Third</strong></th>\n<th style=\"text-align: left;\"><strong>Fourth</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: right;\">160</td>\n<td style=\"text-align: right;\">1</td>\n<td style=\"text-align: left;\">test</td>\n<td style=\"text-align: left;\">test</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">160</td>\n<td style=\"text-align: right;\">2</td>\n<td colspan=\"2\" style=\"text-align: left;\"><em>This is a test:</em> <span\nclass=\"math display\"><em>a</em><sup>2</sup> + <em>b</em><sup>2</sup> = <em>c</em><sup>2</sup></span></td>\n</tr>\n</tbody>\n</table>\n\n```\n"
  },
  {
    "path": "test/command/8853.md",
    "content": "```\n% pandoc -f markdown+wikilinks_title_after_pipe --wrap=none\n[[hi]] and ![[hi]]\n^D\n<p><a href=\"hi\" class=\"wikilink\">hi</a> and <img src=\"hi\" class=\"wikilink\" alt=\"hi\" /></p>\n```\n"
  },
  {
    "path": "test/command/8863.md",
    "content": "```\n% pandoc -f dokuwiki -t native\n  * item 1\n   * item 1.1\n^D\n[ BulletList\n    [ [ Plain [ Str \"item\" , Space , Str \"1\" ] ]\n    , [ Plain [ Str \"item\" , Space , Str \"1.1\" ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/8867.md",
    "content": "```\n% pandoc -f jats -t native -s\n<article-meta>\n      <title-group>\n        <article-title></article-title>\n      </title-group>\n      <permissions>\n        <copyright-statement>© 2023, Ellerman et al</copyright-statement>\n        <copyright-year>2023</copyright-year>\n        <copyright-holder>Ellerman et al</copyright-holder>\n        <license license-type=\"open-access\">\n          <ali:license_ref xmlns:ali=\"http://www.niso.org/schemas/ali/1.0/\">https://creativecommons.org/licenses/by/4.0/</ali:license_ref>\n          <license-p>This document is distributed under a Creative Commons Attribution 4.0 International license.</license-p>\n        </license>\n      </permissions>\n</article-meta>\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"copyright\"\n            , MetaMap\n                (fromList\n                   [ ( \"holder\" , MetaString \"Ellerman et al\" )\n                   , ( \"statement\"\n                     , MetaString \"\\169 2023, Ellerman et al\"\n                     )\n                   , ( \"year\" , MetaString \"2023\" )\n                   ])\n            )\n          , ( \"license\"\n            , MetaMap\n                (fromList\n                   [ ( \"link\"\n                     , MetaString\n                         \"https://creativecommons.org/licenses/by/4.0/\"\n                     )\n                   , ( \"text\"\n                     , MetaString\n                         \"This document is distributed under a Creative Commons Attribution 4.0 International license.\"\n                     )\n                   , ( \"type\" , MetaString \"open-access\" )\n                   ])\n            )\n          ]\n    }\n  []\n```"
  },
  {
    "path": "test/command/8869.md",
    "content": "Org arguments can either be single words, or quoted.\n\n```\n% pandoc -f org -t native\n#+begin_src jupyter-julia :exports both\n1 + 2\n#+end_src\n\n#+begin_src jupyter-julia :exports \"both\"\n1 + 2\n#+end_src\n^D\n[ CodeBlock\n    ( \"\" , [ \"julia\" , \"code\" ] , [ ( \"exports\" , \"both\" ) ] )\n    \"1 + 2\\n\"\n, CodeBlock\n    ( \"\" , [ \"julia\" , \"code\" ] , [ ( \"exports\" , \"both\" ) ] )\n    \"1 + 2\\n\"\n]\n```\n"
  },
  {
    "path": "test/command/8872.md",
    "content": "\n```\n% pandoc -f latex -t native\n\\documentclass{amsart}\n\\newtheorem{theorem}{Theorem}\n\\begin{document}\n\\begin{theorem}\\label{thm}\n\\begin{enumerate}\n\\item \\label{item1}text1\n\\item \\label{item2}text2\n\\item text3\n\\end{enumerate}\n\\end{theorem}\n\\end{document}\n^D\n[ Div\n    ( \"thm\" , [ \"theorem\" ] , [] )\n    [ Para\n        [ Strong [ Str \"Theorem\" , Space , Str \"1\" ]\n        , Str \".\"\n        , Space\n        , Space\n        , Emph []\n        ]\n    , OrderedList\n        ( 1 , DefaultStyle , DefaultDelim )\n        [ [ Para\n              [ Emph\n                  [ Span ( \"item1\" , [] , [ ( \"label\" , \"item1\" ) ] ) []\n                  , Str \"text1\"\n                  ]\n              ]\n          ]\n        , [ Para\n              [ Emph\n                  [ Span ( \"item2\" , [] , [ ( \"label\" , \"item2\" ) ] ) []\n                  , Str \"text2\"\n                  ]\n              ]\n          ]\n        , [ Para [ Emph [ Str \"text3\" ] ] ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/8948.md",
    "content": "```\n% pandoc --embed-resources\n![minimal](command/minimal.svg){.inline-svg}\n![minimal](command/minimal.svg){.inline-svg}\n^D\n<p><svg role=\"img\" aria-label=\"minimal\" alt=\"minimal\" viewBox=\"-.333 -.333 480 150\" style=\"background-color:#ffffff00\" xml:space=\"preserve\" width=\"480\" height=\"150\"><use href=\"#svg_7868854ffb8f30209cd0\" width=\"100%\" height=\"100%\" /></svg>\n<svg id=\"svg_7868854ffb8f30209cd0\" role=\"img\" aria-label=\"minimal\" alt=\"minimal\" viewBox=\"-.333 -.333 480 150\" style=\"background-color:#ffffff00\" xml:space=\"preserve\" width=\"480\" height=\"150\">\n    <path d=\"M 0 35.5 L 6.5 22.5 L 16 37 L 23 24 L 34.8 43.7 L 42.5 30 L 50.3 47 L 59.7 27.7 L 69 47 L 85 17.7 L 98.3 39 L 113 9.7 L 127.7 42.3 L 136.3 23.7 L 147 44.3 L 158.3 20.3 L 170.3 40.3 L 177.7 25.7 L 189.7 43 L 199.7 21 L 207.7 35 L 219 11 L 233 37 L 240.3 23.7 L 251 43 L 263 18.3 L 272.7 33.3 L 283 10 L 295 32.3 L 301.3 23 L 311.7 37 L 323.7 7.7 L 339.3 39 L 346.3 25.7 L 356.3 42.3 L 369.7 15 L 376.3 25.7 L 384 9 L 393 28.3 L 400.3 19 L 411.7 38.3 L 421 21 L 434.3 43 L 445 25 L 453 36.3 L 464.3 18.3 L 476.2 40.3 L 480 33.5 L 480 215 L 0 215 L 0 35.5 Z\" fill=\"#175720\" />\n</svg></p>\n```\n\n```\n% pandoc --embed-resources\n![minimal](command/minimal.svg){.inline-svg}\n![minimal](command/minimal.svg){#foo .inline-svg}\n^D\n<p><svg role=\"img\" aria-label=\"minimal\" alt=\"minimal\" viewBox=\"-.333 -.333 480 150\" style=\"background-color:#ffffff00\" xml:space=\"preserve\" width=\"480\" height=\"150\"><use href=\"#foo\" width=\"100%\" height=\"100%\" /></svg>\n<svg id=\"foo\" role=\"img\" aria-label=\"minimal\" alt=\"minimal\" viewBox=\"-.333 -.333 480 150\" style=\"background-color:#ffffff00\" xml:space=\"preserve\" width=\"480\" height=\"150\">\n    <path d=\"M 0 35.5 L 6.5 22.5 L 16 37 L 23 24 L 34.8 43.7 L 42.5 30 L 50.3 47 L 59.7 27.7 L 69 47 L 85 17.7 L 98.3 39 L 113 9.7 L 127.7 42.3 L 136.3 23.7 L 147 44.3 L 158.3 20.3 L 170.3 40.3 L 177.7 25.7 L 189.7 43 L 199.7 21 L 207.7 35 L 219 11 L 233 37 L 240.3 23.7 L 251 43 L 263 18.3 L 272.7 33.3 L 283 10 L 295 32.3 L 301.3 23 L 311.7 37 L 323.7 7.7 L 339.3 39 L 346.3 25.7 L 356.3 42.3 L 369.7 15 L 376.3 25.7 L 384 9 L 393 28.3 L 400.3 19 L 411.7 38.3 L 421 21 L 434.3 43 L 445 25 L 453 36.3 L 464.3 18.3 L 476.2 40.3 L 480 33.5 L 480 215 L 0 215 L 0 35.5 Z\" fill=\"#175720\" />\n</svg></p>\n```\n\n```\n% pandoc --embed-resources\n![minimal](command/minimal.svg)\n^D\n<figure>\n<img role=\"img\" aria-label=\"minimal\" src=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PgoKPHN2ZyB2aWV3Qm94PSItLjMzMyAtLjMzMyA0ODAgMTUwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICA8cGF0aCBkPSJNIDAgMzUuNSBMIDYuNSAyMi41IEwgMTYgMzcgTCAyMyAyNCBMIDM0LjggNDMuNyBMIDQyLjUgMzAgTCA1MC4zIDQ3IEwgNTkuNyAyNy43IEwgNjkgNDcgTCA4NSAxNy43IEwgOTguMyAzOSBMIDExMyA5LjcgTCAxMjcuNyA0Mi4zIEwgMTM2LjMgMjMuNyBMIDE0NyA0NC4zIEwgMTU4LjMgMjAuMyBMIDE3MC4zIDQwLjMgTCAxNzcuNyAyNS43IEwgMTg5LjcgNDMgTCAxOTkuNyAyMSBMIDIwNy43IDM1IEwgMjE5IDExIEwgMjMzIDM3IEwgMjQwLjMgMjMuNyBMIDI1MSA0MyBMIDI2MyAxOC4zIEwgMjcyLjcgMzMuMyBMIDI4MyAxMCBMIDI5NSAzMi4zIEwgMzAxLjMgMjMgTCAzMTEuNyAzNyBMIDMyMy43IDcuNyBMIDMzOS4zIDM5IEwgMzQ2LjMgMjUuNyBMIDM1Ni4zIDQyLjMgTCAzNjkuNyAxNSBMIDM3Ni4zIDI1LjcgTCAzODQgOSBMIDM5MyAyOC4zIEwgNDAwLjMgMTkgTCA0MTEuNyAzOC4zIEwgNDIxIDIxIEwgNDM0LjMgNDMgTCA0NDUgMjUgTCA0NTMgMzYuMyBMIDQ2NC4zIDE4LjMgTCA0NzYuMiA0MC4zIEwgNDgwIDMzLjUgTCA0ODAgMjE1IEwgMCAyMTUgTCAwIDM1LjUgWiIgZmlsbD0iIzE3NTcyMCIvPgo8L3N2Zz4K\" alt=\"minimal\" />\n<figcaption aria-hidden=\"true\">minimal</figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/8956.md",
    "content": "```\n% pandoc -iNtslidy\n# One\n\n- one\n- two\n^D\n<div id=\"one\" class=\"slide section level1\" number=\"1\">\n<h1><span class=\"header-section-number\">1</span> One</h1>\n<ul class=\"incremental\">\n<li>one</li>\n<li>two</li>\n</ul>\n</div>\n```\n\n````\n% pandoc -pstnative\n```\n\tafter tab\n```\n^D\nPandoc\n  Meta { unMeta = fromList [] }\n  [ CodeBlock ( \"\" , [] , [] ) \"\\tafter tab\" ]\n````\n\n```\n% pandoc -sfalse\nhi\n^D\n<p>hi</p>\n```\n\n```\n% pandoc --standalone=false\nhi\n^D\n<p>hi</p>\n```\n\n```\n% pandoc --standalone=FALSE\nhi\n^D\n<p>hi</p>\n```\n\n"
  },
  {
    "path": "test/command/8957.md",
    "content": "```\n% pandoc -f latex -t html --wrap=none\n![Sample figure caption.](fig.jpg){width=\"342pt\" height=\"9pc\"}\n^D\n<p>![Sample figure caption.](fig.jpg)<span>width=\"342pt\" height=\"9pc\"</span></p>\n\n```\n"
  },
  {
    "path": "test/command/8966.md",
    "content": "```\n% pandoc -t typst\n**Samsonov T.E.** Shape-Adaptive Geometric Simplification of Heterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova // International Journal of Geographical Information Science. — 2017. — Vol. 31. — № 8. — pp. 1485-1520.\n^D\n#strong[Samsonov T.E.] Shape-Adaptive Geometric Simplification of\nHeterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova /\\/\nInternational Journal of Geographical Information Science. --- 2017. ---\nVol. 31. --- № 8. --- pp.~1485-1520.\n```\n"
  },
  {
    "path": "test/command/8981.md",
    "content": "```\n% pandoc --wrap=none\nconsectetur [^\\[link\\]^](#ref \"Title\")\n^D\n<p>consectetur <a href=\"#ref\" title=\"Title\"><sup>[link]</sup></a></p>\n```\n"
  },
  {
    "path": "test/command/8984.md",
    "content": "```\n% pandoc -f html -t native\n<table>\n  <tr>\n    <th colspan=\"2\">a</th>\n    <td>b</td>\n  </tr>\n  <tr>\n    <th>c</th>\n    <th>d</th>\n    <td>e</td>\n  </tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 2)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain [ Str \"a\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"b\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"c\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"d\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"e\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n\n```\n\n```\n% pandoc -f html -t native\n<table>\n<tr>\n<th rowspan=\"2\">Heading</th>\n<td>content</td>\n</tr>\n<tr>\n<td>content2</td>\n</tr>\n</table>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 1)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 2)\n                (ColSpan 1)\n                [ Plain [ Str \"Heading\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"content\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"content2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n\n```\n"
  },
  {
    "path": "test/command/8992.md",
    "content": "```\n% pandoc -t latex\n[A theorem](https://en.wikipedia.org/wiki/Rice's_theorem).\n^D\n\\href{https://en.wikipedia.org/wiki/Rice's_theorem}{A theorem}.\n```\n"
  },
  {
    "path": "test/command/8997.md",
    "content": "```\n% pandoc -f org -t native\n* has space after second colon\n: aaa\n: \n: bbb\n\n\n* has no space after second colon\n: aaa\n:\n: bbb\n^D\n[ Header\n    1\n    ( \"has-space-after-second-colon\" , [] , [] )\n    [ Str \"has\"\n    , Space\n    , Str \"space\"\n    , Space\n    , Str \"after\"\n    , Space\n    , Str \"second\"\n    , Space\n    , Str \"colon\"\n    ]\n, CodeBlock ( \"\" , [] , [] ) \"aaa\\n\\nbbb\\n\"\n, Header\n    1\n    ( \"has-no-space-after-second-colon\" , [] , [] )\n    [ Str \"has\"\n    , Space\n    , Str \"no\"\n    , Space\n    , Str \"space\"\n    , Space\n    , Str \"after\"\n    , Space\n    , Str \"second\"\n    , Space\n    , Str \"colon\"\n    ]\n, CodeBlock ( \"\" , [] , [] ) \"aaa\\n\\nbbb\\n\"\n]\n```\n\n```\n% pandoc -f org -t native\n* only the colon\n:\n\n* only the colon and a space\n: \n^D\n[ Header\n    1\n    ( \"only-the-colon\" , [] , [] )\n    [ Str \"only\" , Space , Str \"the\" , Space , Str \"colon\" ]\n, CodeBlock ( \"\" , [] , [] ) \"\\n\"\n, Header\n    1\n    ( \"only-the-colon-and-a-space\" , [] , [] )\n    [ Str \"only\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"colon\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"space\"\n    ]\n, CodeBlock ( \"\" , [] , [] ) \"\\n\"\n]\n```\n"
  },
  {
    "path": "test/command/9000.md",
    "content": "```\n% pandoc -t org --wrap=auto --columns=20\n[This is a link with a long description that should not\nwrap](http://example.com) and\nsome regular text after it so we can see how wrapping works.\n^D\n[[http://example.com][This is a link with a long description that should not wrap]]\nand some regular\ntext after it so we\ncan see how wrapping\nworks.\n\n```\n\n"
  },
  {
    "path": "test/command/9002.md",
    "content": "```\n% pandoc command/9002.docx -t html\n^D\n<table style=\"width:40%;\">\n<caption><p>This is my table!</p></caption>\n<colgroup>\n<col style=\"width: 20%\" />\n<col style=\"width: 20%\" />\n</colgroup>\n<thead>\n<tr>\n<th>a</th>\n<th>b</th>\n</tr>\n</thead>\n<tbody>\n</tbody>\n</table>\n<p>See <a href=\"#_Ref143272803\">Table 1 This is my table!</a></p>\n```\n"
  },
  {
    "path": "test/command/9017.md",
    "content": "```\n% pandoc -t jats --citeproc -s\n---\nreferences:\n- author: DeGroot\n  id: degroot_probability\n  title: Probability\n  issued: 2002\ntitle: Doc example with single reference\n---\n\n# I like\n\n[@degroot_probability].\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>Doc example with single reference</article-title>\n</title-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<sec id=\"i-like\">\n  <title>I like</title>\n  <p>(DeGroot 2002).</p>\n</sec>\n</body>\n<back>\n<ref-list>\n  <title></title>\n  <ref id=\"ref-degroot_probability\">\n    <mixed-citation>DeGroot. 2002.\n    <italic>Probability</italic>.</mixed-citation>\n  </ref>\n</ref-list>\n</back>\n</article>\n```\n"
  },
  {
    "path": "test/command/9021.md",
    "content": "```\n% pandoc -t jats+element_citations --citeproc -s\n---\nreferences:\n- author: DeGroot\n  id: degroot_probability\n  title: Probability\n  issued: 2002\ntitle: Doc example with single reference\nreference-section-title: Ref Title\n---\n\n# I like\n\n[@degroot_probability].\n^D\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>Doc example with single reference</article-title>\n</title-group>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<sec id=\"i-like\">\n  <title>I like</title>\n  <p>(DeGroot 2002).</p>\n</sec>\n</body>\n<back>\n<ref-list>\n  <title>Ref Title</title>\n  <ref id=\"ref-degroot_probability\">\n    <element-citation>\n      <person-group person-group-type=\"author\">\n        <string-name>DeGroot</string-name>\n      </person-group>\n      <article-title>Probability</article-title>\n      <year iso-8601-date=\"2002\">2002</year>\n    </element-citation>\n  </ref>\n</ref-list>\n</back>\n</article>\n\n```\n"
  },
  {
    "path": "test/command/9038.md",
    "content": "```\n% pandoc -t native\n![foo]\n^D\n[ Para [ Str \"![foo]\" ] ]\n```\n"
  },
  {
    "path": "test/command/9042.md",
    "content": "```\n% pandoc -f org\n#+TITLE: Testing\n\n* Testing\n\np. lower case\n\nP. Upper Case\n^D\n<h1 id=\"testing-1\">Testing</h1>\n<p>p. lower case</p>\n<p>P. Upper Case</p>\n```\n```\n% pandoc -f org+fancy_lists\n#+TITLE: Testing\n\n* Testing\n\np. lower case\n\nP. Upper Case\n^D\n<h1 id=\"testing-1\">Testing</h1>\n<ol type=\"a\">\n<li><p>lower case</p></li>\n<li><p>Upper Case</p></li>\n</ol>\n```\n"
  },
  {
    "path": "test/command/9043.md",
    "content": "```\n% pandoc -t latex\n[**TreeTagger**](https://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/)\n^D\n\\href{https://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/}{\\textbf{TreeTagger}}\n```\n\n```\n% pandoc -t latex\n[**TreeTagger**](https://www.cis.uni-muenchen.de/%E7schmid/tools/TreeTagger/)\n^D\n\\href{https://www.cis.uni-muenchen.de/\\%E7schmid/tools/TreeTagger/}{\\textbf{TreeTagger}}\n```\n"
  },
  {
    "path": "test/command/9045.md",
    "content": "```\n% pandoc -t latex\n![hi](there.jpg){#foo}\n^D\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={hi}]{there.jpg}}\n\\caption{hi}\\label{foo}\n\\end{figure}\n```\n"
  },
  {
    "path": "test/command/9047.md",
    "content": "tests meant to test the fixes of bug [#9047](https://github.com/jgm/pandoc/issues/9047)\n\n```\n% pandoc -f html -t html\n<ul class=\"task-list\">\n<li><label><input type=\"checkbox\" />foo</label></li>\n<li><label><input type=\"checkbox\" checked=\"\" />bar</label></li>\n<li><label><input type=\"button\" checked=\"\" />foobar</label></li>\n<li><input id=\"hello\" type=\"checkbox\" checked/><label for=\"hello\">hello</label></li>\n</ul>\n^D\n<ul>\n<li><label><input type=\"checkbox\" />foo</label></li>\n<li><label><input type=\"checkbox\" checked=\"\" />bar</label></li>\n<li>foobar</li>\n<li><label><input type=\"checkbox\" checked=\"\" />hello</label></li>\n</ul>\n```\n\nw/ rawHTML extension a checkbox by itself is kept\n```\n% pandoc -f html+raw_html -t html+raw_html\n<input type=\"checkbox\" checked=\"\" />\n^D\n<input type=\"checkbox\" checked>\n</input>\n```\n\nw/ rawHTML extension, a checkbox in an `li` is handled properly\n```\n% pandoc -f html+raw_html -t html+raw_html\n<ul>\n<li><input type=\"checkbox\" checked/>foo</li>\n</ul>\n^D\n<ul class=\"task-list\">\n<li><label><input type=\"checkbox\" checked=\"\" />foo</label></li>\n</ul>\n```\n\nw/o rawHTML extension, a checkbox outside of an `li` is properly ignored\n```\n% pandoc -f html -t html\n<p><input type=\"checkbox\" checked/>foo</p>\n^D\nfoo\n```\n"
  },
  {
    "path": "test/command/9088.md",
    "content": "```\n% pandoc -t latex\n|    0 - A\n|    1 - B\n|    2 - C\n^D\n~~~0 - A\\\\\n\\strut ~~~1 - B\\\\\n\\strut ~~~2 - C\n```\n"
  },
  {
    "path": "test/command/9090.md",
    "content": "```\n% pandoc -f html -t gfm\n<table>\n  <tr>\n    <th>invalid head cell</td>\n  </tr>\n  <tr>\n    <td>body cell</td>\n  </tr>\n</table>\n^D\n| invalid head cell |\n|-------------------|\n| body cell         |\n```\n"
  },
  {
    "path": "test/command/9121.md",
    "content": "````\n% pandoc -t gfm\na $$x=y$$ b\n^D\na\n``` math\nx=y\n```\nb\n````\n\n````\n% pandoc -t gfm\na $x=y$ b\n^D\na $`x=y`$ b\n````\n"
  },
  {
    "path": "test/command/9150.md",
    "content": "```\n% pandoc -f latex -t native\n\\hfill  {\\Large \\textbf{Theoretische Grundlagen der Informatik}}\n^D\n[ Para\n    [ Span\n        ( \"\" , [] , [] )\n        [ Strong\n            [ Str \"Theoretische\"\n            , Space\n            , Str \"Grundlagen\"\n            , Space\n            , Str \"der\"\n            , Space\n            , Str \"Informatik\"\n            ]\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\hfill  {\\Large \\textbf{Theoretische Grundlagen der Informatik}}\n^D\n[ Para\n    [ RawInline (Format \"latex\") \"\\\\hfill  \"\n    , Span\n        ( \"\" , [] , [] )\n        [ RawInline (Format \"latex\") \"\\\\Large \"\n        , Strong\n            [ Str \"Theoretische\"\n            , Space\n            , Str \"Grundlagen\"\n            , Space\n            , Str \"der\"\n            , Space\n            , Str \"Informatik\"\n            ]\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\hskip 2pt plus 1pt minus 1pt\n^D\n[ RawBlock (Format \"latex\") \"\\\\hskip 2pt plus 1pt minus 1pt\"\n]\n```\n"
  },
  {
    "path": "test/command/9159.md",
    "content": "```\n% pandoc -t org -f markdown\n\\* See Blah\n\n\\# not comment\n\n\\| not table \\|\n^D\n​* See Blah\n\n​# not comment\n\n​| not table |\n\n```\n"
  },
  {
    "path": "test/command/9171.md",
    "content": "```\n% pandoc -f markdown -t native\n[link][link contents]{target=\"_blank\"}\n[link2](https://example.com){target=\"_blank\"}\n\n[link contents]: https://example.com\n^D\n[ Para\n    [ Link\n        ( \"\" , [] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"link\" ]\n        ( \"https://example.com\" , \"\" )\n    , SoftBreak\n    , Link\n        ( \"\" , [] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"link2\" ]\n        ( \"https://example.com\" , \"\" )\n    ]\n]\n\n```\n\n```\n% pandoc -f markdown -t native\n[link][link contents]{#id1 target=\"_blank\"}\n[link2](https://example.com){target=\"_blank\"}\n\n[link contents]: https://example.com {#id2 target=\"_nonblank\"}\n^D\n[ Para\n    [ Link\n        ( \"id1\" , [] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"link\" ]\n        ( \"https://example.com\" , \"\" )\n    , SoftBreak\n    , Link\n        ( \"\" , [] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"link2\" ]\n        ( \"https://example.com\" , \"\" )\n    ]\n]\n\n```\n\n```\n% pandoc -f markdown -t native\n[link][link contents]{target=\"_blank\"}\n[link2](https://example.com){target=\"_blank\"}\n\n[link contents]: https://example.com {.foo}\n^D\n[ Para\n    [ Link\n        ( \"\" , [ \"foo\" ] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"link\" ]\n        ( \"https://example.com\" , \"\" )\n    , SoftBreak\n    , Link\n        ( \"\" , [] , [ ( \"target\" , \"_blank\" ) ] )\n        [ Str \"link2\" ]\n        ( \"https://example.com\" , \"\" )\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/9193.md",
    "content": "```\n% pandoc -t native\n$a+%\nb$\n^D\n[ Para [ Math InlineMath \"a+%\\nb\" ] ]\n```\n"
  },
  {
    "path": "test/command/9196.md",
    "content": "```\n% pandoc -f rst --wrap=none\nDefine  _`my target`, then reference `my target`_.\n^D\n<p>Define <span id=\"my-target\">my target</span>, then reference <a href=\"#my-target\">my target</a>.</p>\n```\n"
  },
  {
    "path": "test/command/9201.md",
    "content": "```\n% pandoc -f man -t markdown\n.TH \"EXAMPLE\" \"1\"\n.SH \"OPTIONS\"\n.TP 8n\n\\fB\\-\\-help\\fR\nThis is line one.\n.sp\nThis is line two.\n^D\n# OPTIONS\n\n**\\--help**\n\n:   This is line one.\n\n    This is line two.\n```\n"
  },
  {
    "path": "test/command/9202.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{otherlanguage}{french}\nBonjour.\n\\end{otherlanguage}\n^D\n[ Div\n    ( \"\" , [] , [ ( \"lang\" , \"fr\" ) ] )\n    [ Para [ Str \"Bonjour.\" ] ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{otherlanguage*}{french}\nBonjour.\n\\end{otherlanguage*}\n^D\n[ Div\n    ( \"\" , [ \"otherlanguage*\" ] , [] )\n    [ Para\n        [ Span ( \"\" , [] , [] ) [ Str \"french\" ]\n        , SoftBreak\n        , Str \"Bonjour.\"\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\textfrench{Bonjour}\n^D\n[ Para\n    [ Span ( \"\" , [] , [ ( \"lang\" , \"fr\" ) ] ) [ Str \"Bonjour\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\foreignlanguage{swissgerman}{Guten tag}\n^D\n[ Para\n    [ Span\n        ( \"\" , [] , [ ( \"lang\" , \"de-CH-1901\" ) ] )\n        [ Str \"Guten\" , Space , Str \"tag\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{french}\nBonjour.\n\\end{french}\n^D\n[ Div\n    ( \"\" , [] , [ ( \"lang\" , \"fr\" ) ] )\n    [ Para [ Str \"Bonjour.\" ] ]\n]\n```\n"
  },
  {
    "path": "test/command/9209.md",
    "content": "```\n% pandoc -t latex\n## [Section]{#Section3}\n^D\n\\subsection{\\texorpdfstring{\\protect\\hypertarget{Section3}{}{Section}}{Section}}\\label{section}\n```\n"
  },
  {
    "path": "test/command/9218.md",
    "content": "# Escape special lines in Org-mode code blocks\n\n````\n% pandoc -f markdown -t org\n``` org\n** Click Application\n*** Imports\n\n#+begin_src py\nfrom addict import Dict\n#+end_src\n```\n^D\n#+begin_src org\n,** Click Application\n,*** Imports\n\n,#+begin_src py\nfrom addict import Dict\n,#+end_src\n#+end_src\n````\n"
  },
  {
    "path": "test/command/9236.md",
    "content": "```\n% pandoc -t typst\n![minimal](command/minimal.svg){width=3in}\n\n![minimal](command/minimal.svg){width=3in height=2in}\n\n![minimal](command/minimal.svg)\n\nAnd inline: ![minimal](command/minimal.svg){height=2in} and\n![minimal](command/minimal.svg).\n^D\n#figure(image(\"command/minimal.svg\", width: 3in, alt: \"minimal\"),\n  caption: [\n    minimal\n  ]\n)\n\n#figure(image(\"command/minimal.svg\", height: 2in, width: 3in, alt: \"minimal\"),\n  caption: [\n    minimal\n  ]\n)\n\n#figure(image(\"command/minimal.svg\", alt: \"minimal\"),\n  caption: [\n    minimal\n  ]\n)\n\nAnd inline:\n#box(image(\"command/minimal.svg\", height: 2in, alt: \"minimal\")) and\n#box(image(\"command/minimal.svg\", alt: \"minimal\")).\n\n```\n"
  },
  {
    "path": "test/command/9275.md",
    "content": "```\n% pandoc -t latex --biblatex\n[@scott2000, p. 33]\n[@scott2000, pp. 33-34 and elsewhere; @scott2001, ch. 4]\n^D\n\\autocite[33]{scott2000} \\autocites[33-34 and\nelsewhere]{scott2000}[ch.~4]{scott2001}\n\n```\n\n```\n% pandoc -t latex --biblatex -Mlang=de\n[@scott2000, p. 33]\n[@scott2000, S. 33]\n^D\n\\autocite[p.~33]{scott2000} \\autocite[33]{scott2000}\n\n```\n"
  },
  {
    "path": "test/command/9279.md",
    "content": "```\n% pandoc -f org -t native\n#+LABEL: tbl:Cosasexample\n#+CAPTION: Cosas\n+-------+-------+\n| cosas | cosas |\n| cosas | cosas |\n+=======+=======+\n| cosas | cosas |\n| cosas | cosas |\n+-------+-------+\n^D\n[ Table\n    ( \"tbl:Cosasexample\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Cosas\" ] ])\n    [ ( AlignDefault , ColWidth 0.1111111111111111 )\n    , ( AlignDefault , ColWidth 0.1111111111111111 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"cosas\" , SoftBreak , Str \"cosas\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"cosas\" , SoftBreak , Str \"cosas\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"cosas\" , SoftBreak , Str \"cosas\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"cosas\" , SoftBreak , Str \"cosas\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f org -t markdown\n#+LABEL: tbl:Cosasexample\n#+CAPTION: Cosas\n+-------+-------+\n| cosas | cosas |\n| cosas | cosas |\n+=======+=======+\n| cosas | cosas |\n| cosas | cosas |\n+-------+-------+\n^D\n  ---------------\n  cosas   cosas\n  cosas   cosas\n  ------- -------\n  cosas   cosas\n  cosas   cosas\n\n  ---------------\n\n  : Cosas {#tbl:Cosasexample}\n\n```\n\n```\n% pandoc -f org -t markdown\n#+LABEL: tbl:Cosasexample\n+-------+-------+\n| cosas | cosas |\n| cosas | cosas |\n+=======+=======+\n| cosas | cosas |\n| cosas | cosas |\n+-------+-------+\n^D\n  ---------------\n  cosas   cosas\n  cosas   cosas\n  ------- -------\n  cosas   cosas\n  cosas   cosas\n\n  ---------------\n\n```\n\n```\n% pandoc -f org -t markdown\n#+CAPTION: Cosas\n+-------+-------+\n| cosas | cosas |\n| cosas | cosas |\n+=======+=======+\n| cosas | cosas |\n| cosas | cosas |\n+-------+-------+\n^D\n  ---------------\n  cosas   cosas\n  cosas   cosas\n  ------- -------\n  cosas   cosas\n  cosas   cosas\n\n  ---------------\n\n  : Cosas\n\n```\n"
  },
  {
    "path": "test/command/9293.md",
    "content": "```\n% pandoc -f mediawiki -t native\n* Linearity in the first argument:\n*:<math>\\begin{align}\n\\langle a \\mathbf u, \\mathbf v\\rangle &= a \\langle \\mathbf u, \\mathbf v\\rangle. \\\\\n\\langle \\mathbf u + \\mathbf v, \\mathbf w\\rangle &= \\langle \\mathbf u, \\mathbf w\\rangle+ \\langle \\mathbf v, \\mathbf w\\rangle.\n\\end{align}</math>\n^D\n[ BulletList\n    [ [ Plain\n          [ Str \"Linearity\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"first\"\n          , Space\n          , Str \"argument:\"\n          ]\n      , Para\n          [ Math\n              DisplayMath\n              \"\\\\begin{align}\\n\\\\langle a \\\\mathbf u, \\\\mathbf v\\\\rangle &= a \\\\langle \\\\mathbf u, \\\\mathbf v\\\\rangle. \\\\\\\\\\n\\\\langle \\\\mathbf u + \\\\mathbf v, \\\\mathbf w\\\\rangle &= \\\\langle \\\\mathbf u, \\\\mathbf w\\\\rangle+ \\\\langle \\\\mathbf v, \\\\mathbf w\\\\rangle.\\n\\\\end{align}\"\n          ]\n      ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/934.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\ddb}[2]{\n  \\textit{``#1''}\n\n  \\textbf{#2}\n}\n\\ddb{This should be italic and in quotes}{And this is the attribution}\n^D\n[ Para\n    [ Emph\n        [ Quoted\n            DoubleQuote\n            [ Str \"This\"\n            , Space\n            , Str \"should\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"italic\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"quotes\"\n            ]\n        ]\n    ]\n, Para\n    [ Strong\n        [ Str \"And\"\n        , Space\n        , Str \"this\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"attribution\"\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/9346.md",
    "content": "```\n% pandoc -f markdown -t markdown_strict+pipe_tables\n|V1 |V2 |V3 |V4 |V5 |V6 |V7 |V8 |V9 |V10 |V11 |V12 |V13 |V14 |V15 |V16 |V17 |V18 |V19 |V20 |V21 |V22 |V23 |V24 |V25 |V26 |V27 |V28 |V29 |V30 |V31 |V32 |V33 |V34 |V35 |V36 |V37 |V38 |V39 |V40 |V41 |V42 |V43 |V44 |V45 |V46 |V47 |V48 |V49 |V50 |V51 |V52 |V53 |V54 |V55 |V56 |V57 |V58 |V59 |V60 |V61 |V62 |V63 |V64 |V65 |V66 |V67 |V68 |V69 |V70 |V71 |V72 |\n|:--|:--|:--|:--|:--|:--|:--|:--|:--|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|\n^D\n| V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 | V11 | V12 | V13 | V14 | V15 | V16 | V17 | V18 | V19 | V20 | V21 | V22 | V23 | V24 | V25 | V26 | V27 | V28 | V29 | V30 | V31 | V32 | V33 | V34 | V35 | V36 | V37 | V38 | V39 | V40 | V41 | V42 | V43 | V44 | V45 | V46 | V47 | V48 | V49 | V50 | V51 | V52 | V53 | V54 | V55 | V56 | V57 | V58 | V59 | V60 | V61 | V62 | V63 | V64 | V65 | V66 | V67 | V68 | V69 | V70 | V71 | V72 |\n|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|:-|\n```\n"
  },
  {
    "path": "test/command/9350.md",
    "content": "```\n% pandoc -f html -t latex\n<table><tbody><tr></tr></tbody></table>\n^D\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}l@{}}\n\\toprule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n \\\\\n\\end{longtable}\n}\n```\n"
  },
  {
    "path": "test/command/9358.md",
    "content": "Caption belongs to the second table:\n```\n% pandoc -f docx -t html command/9358.docx\n^D\n<p>Lorem gipsum</p>\n<table>\n<colgroup>\n<col style=\"width: 50%\" />\n<col style=\"width: 50%\" />\n</colgroup>\n<thead>\n<tr>\n<th>A</th>\n<th>B</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>C</td>\n<td>D</td>\n</tr>\n</tbody>\n</table>\n<p>Lorem ipsum</p>\n<table>\n<caption><p>Table 1 Numbers from 1 to 4</p></caption>\n<colgroup>\n<col style=\"width: 50%\" />\n<col style=\"width: 50%\" />\n</colgroup>\n<thead>\n<tr>\n<th>1</th>\n<th>2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>3</td>\n<td>4</td>\n</tr>\n</tbody>\n</table>\n<p>Lorem yipsum</p>\n```\n"
  },
  {
    "path": "test/command/9366.md",
    "content": "```\n% pandoc -f native -t latex\n[ Para\n    [ Strikeout\n        [ Link\n            ( \"\" , [] , [] )\n            [ Str \"Example\" ]\n            ( \"https://example.com\" , \"\" )\n        ]\n    ]\n, Para\n    [ Strikeout\n        [ Link\n            ( \"\" , [] , [] )\n            [ Str \"https://example.com\" ]\n            ( \"https://example.com\" , \"\" )\n        ]\n    ]\n, Para\n    [ Strikeout\n        [ Link\n            ( \"\" , [] , [] )\n            [ Str \"info@example.com\" ]\n            ( \"mailto:info@example.com\" , \"\" )\n        ]\n    ]\n]\n^D\n\\st{\\mbox{\\href{https://example.com}{Example}}}\n\n\\st{\\mbox{\\url{https://example.com}}}\n\n\\st{\\mbox{\\href{mailto:info@example.com}{\\nolinkurl{info@example.com}}}}\n```\n"
  },
  {
    "path": "test/command/9371.md",
    "content": "```\n% pandoc -t latex\n\"'In this case (A),\n\nI get a kern to separate the quotes,' he said.\"\n\n\"'Also in this case (B), I get a kern,' he added.\"\n\n\"'But in this case (C), there is no kern,'\n\nhe continued.\"\n\n\"He concluded,\n\n'Nor in this case (D) is there a kern.'\"\n^D\n``\\,'In this case (A),\n\nI get a kern to separate the quotes,' he said.''\n\n``\\,`Also in this case (B), I get a kern,' he added.''\n\n``\\,`But in this case (C), there is no kern,'\n\nhe continued.''\n\n``He concluded,\n\n`Nor in this case (D) is there a kern.'\\,''\n```\n"
  },
  {
    "path": "test/command/9386.md",
    "content": "```\n% pandoc -t typst --wrap=preserve\nA string of text that is long enough that after 73 chars that includes a\n/ slash creates a newline\n^D\nA string of text that is long enough that after 73 chars that includes a\n\\/ slash creates a newline\n```\n\n```\n% pandoc -t typst --wrap=preserve\nA string of text that is long enough that after 73 chars that includes\na / slash creates a newline\n^D\nA string of text that is long enough that after 73 chars that includes\na / slash creates a newline\n```\n"
  },
  {
    "path": "test/command/9387.md",
    "content": "```\n% pandoc -f html -t typst\n<div id=\"my label\">\n<p>test</p>\n</div>\n<p>See <a href=\"#my label\">my label</a>.</p>\n^D\n#block[\ntest\n\n] #label(\"my label\")\nSee #link(label(\"my label\"))[my label].\n\n```\n\n```\n% pandoc -f latex -t typst\n\\cite{10.1117/12.695309}\n\\cite{foo}\n^D\n#cite(label(\"10.1117/12.695309\")) @foo\n\n```\n"
  },
  {
    "path": "test/command/9388.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{figure}\n\\centering\n\\includegraphics[width=0.5\\linewidth,height=0.5\\textheight]{figures/placeholder}\n\\caption{Example figure}\n\\end{figure}\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Plain [ Str \"Example\" , Space , Str \"figure\" ] ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [ ( \"width\" , \"50%\" ) , ( \"height\" , \"50%\" ) ] )\n            []\n            ( \"figures/placeholder\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/9391.md",
    "content": "```\n% pandoc command/9391.docx -t html\n^D\n<p>Lorem ipsum.</p>\n<figure>\n<img src=\"media/image1.png\" style=\"width:1.10263in;height:1.10263in\" />\n<figcaption><p>Blue square.</p></figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/9420.md",
    "content": "```\n% pandoc --embed-resources\n![](command/9420.svg){.inline-svg}\n^D\n<p><svg id=\"svg_e1815ef374a63cf552e4\" role=\"img\" width=\"504pt\" height=\"360pt\" viewBox=\"0 0 504 360\">\n<defs>\n<clipPath id=\"svg_e1815ef374a63cf552e4_clip1-c3ce354c\">\n  <path />\n</clipPath>\n</defs>\n<g clip-path=\"url(#svg_e1815ef374a63cf552e4_clip1-c3ce354c)\" clip-rule=\"nonzero\"></g>\n</svg></p>\n```\n"
  },
  {
    "path": "test/command/9445.md",
    "content": "```\n% pandoc -f man -t markdown\n\\fB--c \\fI<file>\n^D\n**\\--c** *\\<file\\>*\n```\n"
  },
  {
    "path": "test/command/9452.md",
    "content": "```\n% pandoc -t typst\n@something2024 says blah.\n\nHere is a sentence [@something2024].\n\nWith supplement [@something2024, p. 3].\n\nAnd just the year [-@something2024].\n^D\n#cite(<something2024>, form: \"prose\") says blah.\n\nHere is a sentence @something2024.\n\nWith supplement @something2024[p.~3].\n\nAnd just the year (#cite(<something2024>, form: \"year\")).\n\n```\n"
  },
  {
    "path": "test/command/9467.md",
    "content": "```\n% pandoc --embed-resources\n![](command/9467.svg)\n^D\n<p><img role=\"img\" src=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTkiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB2ZXJzaW9uPSIxLjEiIGlkPSJzdmcyIiB3aWR0aD0iMTkxLjU2MjY3IiBoZWlnaHQ9IjE1MS43MTIwMSIgdmlld0JveD0iMCAwIDE5MS41NjI2NyAxNTEuNzEyMDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGRlZnMgaWQ9ImRlZnM2Ij4KICAgIDxjbGlwUGF0aCBjbGlwUGF0aFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImNsaXBQYXRoMjQiPgogICAgICA8cGF0aCBkPSJNIDU2LjY5MzYyLDAgMTEzLjM4NzI0LDExMy4zODcyNCAxNzAuMDgwODYsMCBaIiBpZD0icGF0aDIyIiAvPgogICAgPC9jbGlwUGF0aD4KICAgIDxjbGlwUGF0aCBjbGlwUGF0aFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImNsaXBQYXRoMzgiPgogICAgICA8cGF0aCBkPSJNIDAsMCBIIDEwMCBWIDEwMCBIIDAgWiIgaWQ9InBhdGgzNiIgLz4KICAgIDwvY2xpcFBhdGg+CiAgICA8cmFkaWFsR3JhZGllbnQgZng9IjUwLjAwMDY0MSIgZnk9IjUwLjAwMDY0MSIgY3g9IjUwLjAwMDY0MSIgY3k9IjUwLjAwMDY0MSIgcj0iNTAuMDAwNjQxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9InJhZGlhbEdyYWRpZW50NDYiPgogICAgICA8c3RvcCBzdHlsZT0ic3RvcC1vcGFjaXR5OjE7c3RvcC1jb2xvcjojZmZmZmZmIiBvZmZzZXQ9IjAiIGlkPSJzdG9wNDAiIC8+CiAgICAgIDxzdG9wIHN0eWxlPSJzdG9wLW9wYWNpdHk6MTtzdG9wLWNvbG9yOiM5OTk5ZmYiIG9mZnNldD0iMjUuMDAwMzIiIGlkPSJzdG9wNDIiIC8+CiAgICAgIDxzdG9wIHN0eWxlPSJzdG9wLW9wYWNpdHk6MTtzdG9wLWNvbG9yOiM5OTk5ZmYiIG9mZnNldD0iNTAuMDAwNjQiIGlkPSJzdG9wNDQiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogIDwvZGVmcz4KICA8ZyBpZD0iZzgiIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMzMywwLDAsLTEuMzMzMzMzMywwLDE1MS43MTIpIj4KICAgIDxnIGlkPSJnMTAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNi42MDYsMC4xOTkpIj4KICAgICAgPGcgaWQ9ImcxMiI+CiAgICAgICAgPGcgaWQ9ImcxNCI+CiAgICAgICAgICA8ZyBpZD0iZzE2Ij4KICAgICAgICAgICAgPGcgaWQ9ImcxOCI+CiAgICAgICAgICAgICAgPGcgaWQ9ImcyMCIgY2xpcC1wYXRoPSJ1cmwoI2NsaXBQYXRoMjQpIj4KICAgICAgICAgICAgICAgIDxnIGlkPSJnMjYiIHRyYW5zZm9ybT0ibWF0cml4KDIuMjY4MDIsMCwwLDIuMjY4MDIsMTEzLjM4NzI0LDU2LjY5MzYyKSI+CiAgICAgICAgICAgICAgICAgIDxnIGlkPSJnMjgiPgogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJnMzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC01MCwtNTApIj4KICAgICAgICAgICAgICAgICAgICAgIDxnIGlkPSJnMzIiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZyBpZD0iZzM0IiBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGgzOCkiPgogICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0gMCwwIEggMTAwIFYgMTAwIEggMCBaIiBzdHlsZT0iZmlsbDp1cmwoI3JhZGlhbEdyYWRpZW50NDYpO3N0cm9rZTpub25lIiBpZD0icGF0aDQ4IiAvPgogICAgICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0gNTYuNjkzNjIsMCAxMTMuMzg3MjQsMTEzLjM4NzI0IDE3MC4wODA4NiwwIFoiIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiM5OTk5ZmY7c3Ryb2tlLXdpZHRoOjAuMzk4NTtzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjptaXRlcjtzdHJva2UtbWl0ZXJsaW1pdDoxMDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIgaWQ9InBhdGg1MCIgLz4KICAgICAgICAgICAgPGcgaWQ9Imc1MiI+CiAgICAgICAgICAgICAgPGcgaWQ9Imc1NCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjMuMzM3LDUuNDU3KSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iZzU2Ij4KICAgICAgICAgICAgICAgICAgPGcgaWQ9Imc1OCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM2LjczMSwtNS42NTYpIj4KICAgICAgICAgICAgICAgICAgICA8dGV4dCB4bWw6c3BhY2U9InByZXNlcnZlIiB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwtMSwzNi43MzEsNS42NTYpIiBzdHlsZT0iZm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpub3JtYWw7Zm9udC1zaXplOjkuOTYyNnB4O2ZvbnQtZmFtaWx5OkNNU1MxMDstaW5rc2NhcGUtZm9udC1zcGVjaWZpY2F0aW9uOkNNU1MxMDt3cml0aW5nLW1vZGU6bHItdGI7ZmlsbDojOTk5OWZmO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiBpZD0idGV4dDYyIj48dHNwYW4geD0iMCA0Ljk4MTI5OTkgOC4zODU1MiAxMy4xNzM1NDYgMTguMzIxMjIyIDIwLjcwMTI4NiAyNS4xMjg2NjYgMzAuMjc2MzQgMzcuMTkxMzgzIDQxLjAxMDA0OCA0Ni4xNTc3MjIgNTAuOTQ1NzQ3IDU2LjA5MzQyMiA2MC41MjA4MDIgNjguOTk1OTg3IDcyLjU5MzQ4MyA3NS45OTc3MDQgNzguMzc3NzY5IDgzLjE2NTc5NCA4OC4zMDM1MDUgOTMuMjg0ODA1IDk1LjY2NDg3MSIgeT0iMCIgaWQ9InRzcGFuNjAiPmdyYWRpZW50c2hhZGVkdHJpYW5nbGU8L3RzcGFuPjwvdGV4dD4KICAgICAgICAgICAgICAgICAgICA8ZyBpZD0iZzY0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzNi43MzEsNS42NTYpIiAvPgogICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8ZyBpZD0iZzY2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNjMuMzM3LC01LjQ1NykiIC8+CiAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K\" /></p>\n\n```\n"
  },
  {
    "path": "test/command/9472.md",
    "content": "```\n% pandoc -t latex -s\n---\nlang: de-DE\n---\n\nMore text in English. ['Zitat auf Deutsch.']{lang=de}\n\n[Bonjour]{lang=fr} [café]{lang=\"fr-FR\"}\n^D\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  french,\n  ngerman,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={de-DE},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nMore text in English. \\foreignlanguage{ngerman}{`Zitat auf Deutsch.'}\n\n\\foreignlanguage{french}{Bonjour} \\foreignlanguage{french}{café}\n\n\\end{document}\n\n```\n"
  },
  {
    "path": "test/command/9475.md",
    "content": "```\n% pandoc -f org -t native\n#+begin_note\nUseful note.\n#+end_note\n\n#+begin_warning\nBe careful!\n#+end_warning\n\n#+begin_tip\nTry this...\n#+end_tip\n\n#+begin_caution\nCaution\n#+end_caution\n\n#+name: foo\n#+begin_important\nImportant\n#+end_important\n^D\n[ Div\n    ( \"\" , [ \"note\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Note\" ] ]\n    , Para [ Str \"Useful\" , Space , Str \"note.\" ]\n    ]\n, Div\n    ( \"\" , [ \"warning\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Warning\" ] ]\n    , Para [ Str \"Be\" , Space , Str \"careful!\" ]\n    ]\n, Div\n    ( \"\" , [ \"tip\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Tip\" ] ]\n    , Para [ Str \"Try\" , Space , Str \"this\\8230\" ]\n    ]\n, Div\n    ( \"\" , [ \"caution\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Caution\" ] ]\n    , Para [ Str \"Caution\" ]\n    ]\n, Div\n    ( \"foo\" , [ \"important\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Important\" ] ]\n    , Para [ Str \"Important\" ]\n    ]\n]\n\n```\n\n```\n% pandoc -f native -t org\n[ Div\n    ( \"\" , [ \"note\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Note\" ] ]\n    , Para [ Str \"Useful\" , Space , Str \"note.\" ]\n    ]\n, Div\n    ( \"\" , [ \"warning\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Warning\" ] ]\n    , Para [ Str \"Be\" , Space , Str \"careful!\" ]\n    ]\n, Div\n    ( \"\" , [ \"tip\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Tip\" ] ]\n    , Para [ Str \"Try\" , Space , Str \"this\\8230\" ]\n    ]\n, Div\n    ( \"\" , [ \"caution\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Caution\" ] ]\n    , Para [ Str \"Caution\" ]\n    ]\n, Div\n    ( \"foo\" , [ \"important\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Important\" ] ]\n    , Para [ Str \"Important\" ]\n    ]\n]\n^D\n#+begin_note\nUseful note.\n#+end_note\n\n#+begin_warning\nBe careful!\n#+end_warning\n\n#+begin_tip\nTry this...\n#+end_tip\n\n#+begin_caution\nCaution\n#+end_caution\n\n#+name: foo\n#+begin_important\nImportant\n#+end_important\n```\n"
  },
  {
    "path": "test/command/9478.md",
    "content": "```\n% pandoc -t typst --wrap=preserve\n**- a -\n- b**\n^D\n#strong[\\- a -\n\\- b]\n```\n\n"
  },
  {
    "path": "test/command/9481.md",
    "content": "```\n% pandoc -f markdown+wikilinks_title_after_pipe\n[a](https://example.com)\n^D\n<p><a href=\"https://example.com\">a</a></p>\n\n```\n"
  },
  {
    "path": "test/command/9516.md",
    "content": "```\n% pandoc --number-sections\n# One {-}\n\n# Two\n\n# Three {-}\n\n# Four\n^D\n<h1 class=\"unnumbered\" id=\"one\">One</h1>\n<h1 data-number=\"1\" id=\"two\"><span\nclass=\"header-section-number\">1</span> Two</h1>\n<h1 class=\"unnumbered\" id=\"three\">Three</h1>\n<h1 data-number=\"2\" id=\"four\"><span\nclass=\"header-section-number\">2</span> Four</h1>\n```\n"
  },
  {
    "path": "test/command/9517.md",
    "content": "```\n% pandoc -f latex+raw_tex -t native\n\\begin{tabular}{l}\n\\begin{theorem}\nCats\n\\end{theorem}\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ RawBlock\n                    (Format \"latex\")\n                    \"\\\\begin{theorem}\\nCats\\n\\\\end{theorem}\"\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/9555.md",
    "content": "```\n% pandoc -t native -f latex\na\\@ b\\@c\n\n\\makeatletter\na\\@ b\\@c\n\\makeatother\na\\@ b\\@c\n^D\n[ Para [ Str \"a\" , Space , Str \"bc\" ]\n, Para [ Str \"ab\" , SoftBreak , Str \"a\" , Space , Str \"bc\" ]\n]\n```\n"
  },
  {
    "path": "test/command/9569.md",
    "content": "```\n% pandoc -f docbook -t gfm\n<note>\n  <para>Some content</para>\n</note>\n<para>Spacer.</para>\n<note>\n  <title>A note with a title. Works, but the title is discarded.</title>\n  <para>Some content</para>\n</note>\n^D\n> [!NOTE]\n> Some content\n\nSpacer.\n\n> [!NOTE]\n> Some content\n```\n"
  },
  {
    "path": "test/command/9576.md",
    "content": "```\n% pandoc -t native\n::: {#something}\nText with a footnote.[^3]\n\n[^3]: A footnote.\n:::\n^D\n[ Div\n    ( \"something\" , [] , [] )\n    [ Para\n        [ Str \"Text\"\n        , Space\n        , Str \"with\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"footnote.\"\n        , Note [ Para [ Str \"A\" , Space , Str \"footnote.\" ] ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/9579.md",
    "content": "```\n% pandoc -t native\n\\begin{tabular}{p{2in}}\n\\end{tabular}\n\n# Test\n\n\\begin{tabular}{p{2\\linewidth}}\n\\end{tabular}\n^D\n[ RawBlock\n    (Format \"tex\") \"\\\\begin{tabular}{p{2in}}\\n\\\\end{tabular}\"\n, Header 1 ( \"test\" , [] , [] ) [ Str \"Test\" ]\n, RawBlock\n    (Format \"tex\")\n    \"\\\\begin{tabular}{p{2\\\\linewidth}}\\n\\\\end{tabular}\"\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{tabular}{p{2in}}\n\\end{tabular}\n\nTest\n\n\\begin{tabular}{p{2\\linewidth}}\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para [ Str \"Test\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidth 2.0 ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/9585.md",
    "content": "```\n% pandoc -f native -t typst\n[ Header 2 ( \"\" , [] , [] ) [ Str \"One\" ]\n, Header 2 ( \"\" , [ \"unnumbered\", \"unlisted\" ] , [] ) [ Str \"Two\" ]\n, Header 2 ( \"\" , [] , [] ) [ Str \"Three\" ]\n]\n^D\n== One\n#heading(level: 2, outlined: false, numbering: none)[Two]\n== Three\n```\n"
  },
  {
    "path": "test/command/9586.md",
    "content": "```\n% pandoc -t typst\n**1. April 2024**\n^D\n#strong[\\1. April 2024]\n\n```\n"
  },
  {
    "path": "test/command/9597.md",
    "content": "```\n% pandoc -t latex\n~~$T$~~\n^D\n\\st{$T$}\n```\n"
  },
  {
    "path": "test/command/9603.md",
    "content": "```\n% pandoc command/9603.docx -t html -f docx+styles\n^D\n<p>A table with a contemporary style:</p>\n<table data-custom-style=\"TableContemporary\">\n<colgroup>\n<col style=\"width: 50%\" />\n<col style=\"width: 50%\" />\n</colgroup>\n<thead>\n<tr>\n<th>Test</th>\n<th>Column</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td>2</td>\n</tr>\n</tbody>\n</table>\n```\n"
  },
  {
    "path": "test/command/9616.md",
    "content": "```\n% pandoc -f bibtex -t csljson -s\n@MISC {3252037,\n    TITLE = {Isomorphism between projective varieties $\\mathbf{P}^{1}$ and a conic in $\\mathbf{P}^{2}$},\n    URL = {https://math.stackexchange.com/q/3252037}\n}\n^D\n[\n  {\n    \"URL\": \"https://math.stackexchange.com/q/3252037\",\n    \"id\": \"3252037\",\n    \"title\": \"Isomorphism between projective varieties $\\\\mathbf{P}^{1}$ and a conic in $\\\\mathbf{P}^{2}$\",\n    \"type\": \"\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/9630.md",
    "content": "```\n% pandoc -f dokuwiki\n  * [[https://example.com|https://example.com]]\n  * [[https://example.com/start#monitoring|https://example.com/start#monitoring]]\n^D\n<ul>\n<li><a href=\"https://example.com\">https://example.com</a></li>\n<li><a\nhref=\"https://example.com/start#monitoring\">https://example.com/start#monitoring</a></li>\n</ul>\n\n```\n"
  },
  {
    "path": "test/command/9632.md",
    "content": "```\n% pandoc -f dokuwiki\n[[.:supprimer-profil-windows|]]\n^D\n<p><a href=\"supprimer-profil-windows\">supprimer-profil-windows</a></p>\n\n```\n"
  },
  {
    "path": "test/command/9635.md",
    "content": "```\n% pandoc\n> ::: {.fence}\n> that is\n> not closed\n\nokay\n^D\n2> [WARNING] Div at _chunk line 1 column 1 unclosed at _chunk line 5 column 1, closing implicitly.\n<blockquote>\n<div class=\"fence\">\n<p>that is not closed</p>\n</div>\n</blockquote>\n<p>okay</p>\n```\n"
  },
  {
    "path": "test/command/9639.md",
    "content": "```\n% pandoc -f org -t native\n#+title: repro\n\n* heading-name\n:PROPERTIES:\n:ID:       123abc\n:END:\n^D\n[ Header 1 ( \"123abc\" , [] , [] ) [ Str \"heading-name\" ] ]\n```\n"
  },
  {
    "path": "test/command/9644.md",
    "content": "```\n% pandoc -t latex\n[$T$]{.underline}\n[$T$]{.mark}\n^D\n\\ul{$T$} \\hl{$T$}\n```\n"
  },
  {
    "path": "test/command/9652.md",
    "content": "````\n% pandoc -f markdown -t html --embed-resources\n```{=html}\n<img class=\"something inline-svg\" src=\"command/9652.svg\" />\n```\n^D\n<svg id=\"svg_b627f92299158b36552b\" role=\"img\" width=\"504.00pt\" height=\"360.00pt\" viewBox=\"0 0 504.00 360.00\" class=\"something inline-svg please-do-not-delete-me\">\n</svg>\n````\n"
  },
  {
    "path": "test/command/9657.md",
    "content": "```\n% pandoc -t opendocument\n[Text here]{custom-style=\"Strikethrough\"}\n^D\n<text:p text:style-name=\"Text_20_body\"><text:span text:style-name=\"Strikethrough\">Text\nhere</text:span></text:p>\n```\n"
  },
  {
    "path": "test/command/9676.md",
    "content": "```\n% pandoc -f latex\n\\def\\foo{BAR}\n\\foo\n\\ifstrequal{BAR}{BAR}{\\def\\foo{BAZ}}{}\n\\foo\n^D\n<p>BAR BAZ</p>\n```\n"
  },
  {
    "path": "test/command/9700.md",
    "content": "```\n% pandoc -t mediawiki\nThis is a normal sentence with a manual text footnote\\*\n\n\\* The footnote explains why it couldn't just be inside parentheses\n\n\\#foobar \\#foobar\n^D\nThis is a normal sentence with a manual text footnote*\n\n\\* The footnote explains why it couldn’t just be inside parentheses\n\n\\#foobar #foobar\n```\n"
  },
  {
    "path": "test/command/9716.md",
    "content": "```\n% pandoc -f markdown+alerts -t native\n> [!TIP]\n> A suggestion.\n^D\n[ Div\n    ( \"\" , [ \"tip\" ] , [] )\n    [ Div ( \"\" , [ \"title\" ] , [] ) [ Para [ Str \"Tip\" ] ]\n    , Para [ Str \"A\" , Space , Str \"suggestion.\" ]\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/9777-b.md",
    "content": "```\n% pandoc -f native -t typst\n[ Table\n    ( \"\" , [] , [ ( \"typst:figure:kind\" , \"figure\" ) ] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"f\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"b\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,auto,),\n    table.header([f], [b],),\n    table.hline(),\n    [1], [2],\n  )]\n  , kind: figure\n  )\n```\n\n"
  },
  {
    "path": "test/command/9777.md",
    "content": "```\n% pandoc -f native -t typst\n[ Table\n    ( \"\" , [ \"typst:no-figure\" ] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"f\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"b\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n^D\n#table(\n  columns: 2,\n  align: (auto,auto,),\n  table.header([f], [b],),\n  table.hline(),\n  [1], [2],\n)\n```\n"
  },
  {
    "path": "test/command/9792.md",
    "content": "```\n% pandoc -t gfm\n- list item\n  <details>\n\n  - subitem\n  </details>\n\n  item _continue_ **with** formatting\n- next list item\n^D\n- list item\n  <details>\n\n  - subitem\n\n  </details>\n\n  item *continue* **with** formatting\n- next list item\n```\n"
  },
  {
    "path": "test/command/9797.md",
    "content": "```\n% pandoc -t native -f csv\n\"one_line_break:\nfour_line_breaks:\n\n\n\nlast_line\"\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"one_line_break:\"\n                   , LineBreak\n                   , Str \"four_line_breaks:\"\n                   , LineBreak\n                   , LineBreak\n                   , LineBreak\n                   , LineBreak\n                   , Str \"last_line\"\n                   ]\n               ]\n           ]\n       ])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/9805.md",
    "content": "```\n% pandoc -f rst -t native\nword.*word\n------------\n* abc\n^D\n[ Header 1 ( \"word.word\" , [] , [] ) [ Str \"word.*word\" ]\n, BulletList [ [ Plain [ Str \"abc\" ] ] ]\n]\n```\n"
  },
  {
    "path": "test/command/9807.md",
    "content": "```\n% pandoc -f typst -t native\n#let foo = [\n  bar baz\n]\n*#foo*\n^D\n[ Para\n    [ Strong\n        [ SoftBreak , Str \"bar\" , Space , Str \"baz\" , SoftBreak ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/9809.md",
    "content": "```\n% pandoc -f html -t native\n<ul>\n  <li>Bullet point.</li>\n  <p>Nested line.</p>\n</ul>\n^D\n[ BulletList\n    [ [ Para [ Str \"Bullet\" , Space , Str \"point.\" ]\n      , Para [ Str \"Nested\" , Space , Str \"line.\" ]\n      ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/982.md",
    "content": "```\n% pandoc -f latex -t native\n\\newcommand{\\BEQ}{\\begin{equation}}\n\\newcommand{\\EEQ}{\\end{equation}}\n\n\\BEQ\ny=x^2\n\\EEQ\n^D\n[ Para\n    [ Math\n        DisplayMath \"\\\\begin{equation}\\ny=x^2\\n\\\\end{equation}\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/9865.md",
    "content": "````\n% pandoc\n- example 1\n- ```\n  one\n  two\n  ```\n- list item three\n^D\n<ul>\n<li>example 1</li>\n<li><pre><code>one\ntwo</code></pre></li>\n<li>list item three</li>\n</ul>\n````\n\n````\n% pandoc\n- example 3\n- ```\none\ntwo\n```\n- list item three\n^D\n<ul>\n<li>example 3</li>\n<li><pre><code>one\ntwo</code></pre></li>\n<li>list item three</li>\n</ul>\n````\n\nHere is a case that we used to handle differently, but\n#9865 aligns pandoc's markdown parser with commonmark in letting\nblock level structure take precedence over inline level structure.\n\n````\n% pandoc\n- a <!--\n\n- b\n\n-->\n- c\n^D\n<ul>\n<li><p>a &lt;!–</p></li>\n<li><p>b</p></li>\n</ul>\n<p>–&gt; - c</p>\n````\n"
  },
  {
    "path": "test/command/987.md",
    "content": "```\n% pandoc -f latex -t markdown\n\\documentclass{article}\n\\newenvironment{flubble}{FOO}{BAR}\n\\begin{document}\n   \\begin{flubble}\n   grr\n   \\end{flubble}\n\\end{document}\n^D\nFOO grr BAR\n```\n"
  },
  {
    "path": "test/command/9878.md",
    "content": "```\n% pandoc -f textile -t native\n15% 50%\n^D\n[ Para [ Str \"15%\" , Space , Str \"50%\" ] ]\n```\n```\n% pandoc -f textile -t native\n15%. 70%\n^D\n[ Para [ Str \"15%.\" , Space , Str \"70%\" ] ]\n```\n"
  },
  {
    "path": "test/command/9902.md",
    "content": "```\n% pandoc -t native -f latex+raw_tex\n\\kern.1pt\n^D\n[ RawBlock (Format \"latex\") \"\\\\kern.1pt\" ]\n```\n"
  },
  {
    "path": "test/command/9904.md",
    "content": "```\n% pandoc -f rst -t native --citeproc --bibliography command/biblio.bib\nThe axioms were introduced by :cite:t:`{see}item1`.\nThe axioms were introduced by :cite:t:`item1{p. 1166}`.\nThe axioms were introduced by :cite:t:`{see}item1{p. 1166}`.\nAxioms were introduced :cite:`{see}item1`.\nAxioms were introduced :cite:p:`item1{p. 1166}`.\nAxioms were introduced :cite:p:`{see}item1{p. 1166}`.\n\n.. bibliography::\n^D\n[ Para\n    [ Str \"The\"\n    , Space\n    , Str \"axioms\"\n    , Space\n    , Str \"were\"\n    , Space\n    , Str \"introduced\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Cite\n        [ Citation\n            { citationId = \"item1\"\n            , citationPrefix = [ Str \"see\" ]\n            , citationSuffix = []\n            , citationMode = AuthorInText\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"(see\" , Space , Str \"Doe;\" , Space , Str \"2005)\" ]\n    , Str \".\"\n    , SoftBreak\n    , Str \"The\"\n    , Space\n    , Str \"axioms\"\n    , Space\n    , Str \"were\"\n    , Space\n    , Str \"introduced\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Cite\n        [ Citation\n            { citationId = \"item1\"\n            , citationPrefix = []\n            , citationSuffix = [ Str \"p.\" , Space , Str \"1166\" ]\n            , citationMode = AuthorInText\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"Doe\" , Space , Str \"(2005,\" , Space , Str \"1166)\" ]\n    , Str \".\"\n    , SoftBreak\n    , Str \"The\"\n    , Space\n    , Str \"axioms\"\n    , Space\n    , Str \"were\"\n    , Space\n    , Str \"introduced\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Cite\n        [ Citation\n            { citationId = \"item1\"\n            , citationPrefix = [ Str \"see\" ]\n            , citationSuffix = [ Str \"p.\" , Space , Str \"1166\" ]\n            , citationMode = AuthorInText\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"(see\"\n        , Space\n        , Str \"Doe;\"\n        , Space\n        , Str \"2005,\"\n        , Space\n        , Str \"1166)\"\n        ]\n    , Str \".\"\n    , SoftBreak\n    , Str \"Axioms\"\n    , Space\n    , Str \"were\"\n    , Space\n    , Str \"introduced\"\n    , Space\n    , Cite\n        [ Citation\n            { citationId = \"item1\"\n            , citationPrefix = [ Str \"see\" ]\n            , citationSuffix = []\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"(see\" , Space , Str \"Doe\" , Space , Str \"2005)\" ]\n    , Str \".\"\n    , SoftBreak\n    , Str \"Axioms\"\n    , Space\n    , Str \"were\"\n    , Space\n    , Str \"introduced\"\n    , Space\n    , Cite\n        [ Citation\n            { citationId = \"item1\"\n            , citationPrefix = []\n            , citationSuffix = [ Str \"p.\" , Space , Str \"1166\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"(Doe\" , Space , Str \"2005,\" , Space , Str \"1166)\" ]\n    , Str \".\"\n    , SoftBreak\n    , Str \"Axioms\"\n    , Space\n    , Str \"were\"\n    , Space\n    , Str \"introduced\"\n    , Space\n    , Cite\n        [ Citation\n            { citationId = \"item1\"\n            , citationPrefix = [ Str \"see\" ]\n            , citationSuffix = [ Str \"p.\" , Space , Str \"1166\" ]\n            , citationMode = NormalCitation\n            , citationNoteNum = 0\n            , citationHash = 0\n            }\n        ]\n        [ Str \"(see\"\n        , Space\n        , Str \"Doe\"\n        , Space\n        , Str \"2005,\"\n        , Space\n        , Str \"1166)\"\n        ]\n    , Str \".\"\n    ]\n, Div\n    ( \"refs\"\n    , [ \"references\" , \"csl-bib-body\" , \"hanging-indent\" ]\n    , []\n    )\n    [ Div\n        ( \"ref-item1\" , [ \"csl-entry\" ] , [] )\n        [ Para\n            [ Str \"Doe,\"\n            , Space\n            , Str \"John.\"\n            , Space\n            , Str \"2005.\"\n            , Space\n            , Emph [ Str \"First\" , Space , Str \"Book\" ]\n            , Str \".\"\n            , Space\n            , Str \"Cambridge\"\n            , Space\n            , Str \"University\"\n            , Space\n            , Str \"Press.\"\n            ]\n        ]\n    ]\n]\n\n```\n"
  },
  {
    "path": "test/command/9905.md",
    "content": "```\n% pandoc -t html5\n# Section Ψ {#Ψ}\n\nlook at [Section Ψ](#Ψ).\n^D\n<h1 id=\"Ψ\">Section Ψ</h1>\n<p>look at <a href=\"#Ψ\">Section Ψ</a>.</p>\n\n```\n```\n% pandoc -t html4\n# Section Ψ {#Ψ}\n\nlook at [Section Ψ](#Ψ).\n^D\n<h1 id=\"Ψ\">Section Ψ</h1>\n<p>look at <a href=\"#%CE%A8\">Section Ψ</a>.</p>\n\n```\n"
  },
  {
    "path": "test/command/9908.md",
    "content": "```\n% pandoc -f native -t markdown\n[ BulletList\n    [ [ BlockQuote [ Para [ Str \"a\" ] , Para [ Str \"b\" ] ] ] ]\n]\n^D\n- > a\n  >\n  > b\n```\n"
  },
  {
    "path": "test/command/9943.md",
    "content": "```\n% pandoc -t man -s -Vpandoc-version=X.Y\n---\ntitle: HELLO\nsection: 1\n---\n^D\n.\\\" Automatically generated by Pandoc X.Y\n.\\\"\n.TH \"HELLO\" \"1\" \"\" \"\"\n```\n\n```\n% pandoc -t man -s -Vpandoc-version=X.Y\n---\ntitle: HELLO\nsection: 1\nheader: Head\n---\n^D\n.\\\" Automatically generated by Pandoc X.Y\n.\\\"\n.TH \"HELLO\" \"1\" \"\" \"\" \"Head\"\n```\n"
  },
  {
    "path": "test/command/9945.md",
    "content": "```\n% pandoc -t typst --dpi 300\n![](image.jpg){width=300 height=300}\n^D\n#box(image(\"image.jpg\", height: 1in, width: 1in))\n```\n\n```\n% pandoc -t typst --dpi 600\n![](image.jpg){width=300px height=300px}\n^D\n#box(image(\"image.jpg\", height: 0.5in, width: 0.5in))\n```\n\n```\n% pandoc -t typst --dpi 600\n![](image.jpg){width=1in height=3cm}\n^D\n#box(image(\"image.jpg\", height: 3cm, width: 1in))\n```\n\n\n```\n% pandoc -t typst --dpi 600\n![](image.jpg){.foo .bar baz=3}\n^D\n#box(image(\"image.jpg\"))\n```\n"
  },
  {
    "path": "test/command/9953.md",
    "content": "```\n% pandoc -f markdown -t native -s\n---\nheader-includes: |\n    \\makeatletter\n    \\let\\old@verbatim@font=\\verbatim@font\n    \\def\\verbatim@font{%\n    \\fontsize{10}{12}%\n    \\old@verbatim@font\n    }\n    \\makeatother\n...\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"header-includes\"\n            , MetaBlocks\n                [ RawBlock\n                    (Format \"tex\")\n                    \"\\\\makeatletter\\n\\\\let\\\\old@verbatim@font=\\\\verbatim@font\\n\\\\def\\\\verbatim@font{%\\n\\\\fontsize{10}{12}%\\n\\\\old@verbatim@font\\n}\\n\\\\makeatother\"\n                ]\n            )\n          ]\n    }\n  []\n\n```\n"
  },
  {
    "path": "test/command/9987.md",
    "content": "```\n% pandoc -f bibtex -t bibtex\n@misc{agency,\n  author = {{European Environment Agency}},\n}\n^D\n@misc{agency,\n  author = {{European Environment Agency}}\n}\n```\n"
  },
  {
    "path": "test/command/A.txt",
    "content": "this is a\n"
  },
  {
    "path": "test/command/B.txt",
    "content": "here is b\n"
  },
  {
    "path": "test/command/C.txt",
    "content": "and this is c\n"
  },
  {
    "path": "test/command/D.txt",
    "content": "here's d\n"
  },
  {
    "path": "test/command/abbrevs",
    "content": "Foo.\nh.k.\n"
  },
  {
    "path": "test/command/adjacent_latex_blocks.md",
    "content": "```\n% pandoc -f markdown -t native\n\\listoffigures\n\n\\listoftables\n^D\n[ RawBlock (Format \"tex\") \"\\\\listoffigures\"\n, RawBlock (Format \"tex\") \"\\\\listoftables\"\n]\n```\n"
  },
  {
    "path": "test/command/advanced-optical-materials.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"en-US\">\n  <info>\n    <title>Advanced Optical Materials</title>\n    <id>http://www.zotero.org/styles/advanced-optical-materials</id>\n    <link href=\"http://www.zotero.org/styles/advanced-optical-materials\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/small\" rel=\"template\"/>\n    <link href=\"http://onlinelibrary.wiley.com/journal/10.1002/(ISSN)2195-1071/homepage/2298_forauthors.html\" rel=\"documentation\"/>\n    <author>\n      <name>Martin F. Schumann</name>\n      <email>mfs@mfs.name</email>\n    </author>\n    <category citation-format=\"numeric\"/>\n    <category field=\"engineering\"/>\n    <eissn>2195-1071</eissn>\n    <summary>A style for Wiley's Advanced Optical Materials</summary>\n    <updated>2017-02-16T15:37:41+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"capitalize-first\" suffix=\" \"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <label form=\"short\" text-case=\"capitalize-first\" suffix=\".: \" strip-periods=\"true\"/>\n      <name initialize-with=\".\" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n    </names>\n  </macro>\n  <macro name=\"year-date\">\n    <group font-weight=\"bold\">\n      <choose>\n        <if variable=\"issued\">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n        </if>\n        <else>\n          <text term=\"no date\" form=\"short\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"access-date\">\n    <group delimiter=\", \">\n      <date variable=\"accessed\">\n        <date-part name=\"month\" prefix=\"accessed: \" suffix=\", \" form=\"short\"/>\n        <date-part name=\"year\"/>\n      </date>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if variable=\"page\" match=\"none\">\n        <choose>\n          <if variable=\"DOI\">\n            <text variable=\"DOI\" prefix=\"DOI: \"/>\n          </if>\n        </choose>\n        <choose>\n          <if type=\"webpage\">\n            <text variable=\"URL\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\", \">\n      <text variable=\"publisher\" text-case=\"capitalize-all\"/>\n      <text variable=\"publisher-place\" text-case=\"title\"/>\n    </group>\n  </macro>\n  <macro name=\"pages\">\n    <label variable=\"page\" form=\"short\" suffix=\" \"/>\n    <text variable=\"page\"/>\n  </macro>\n  <citation collapse=\"citation-number\">\n    <sort>\n      <key variable=\"citation-number\"/>\n    </sort>\n    <layout prefix=\"[\" suffix=\"]\" delimiter=\",\" vertical-align=\"sup\">\n      <text variable=\"citation-number\"/>\n    </layout>\n  </citation>\n  <bibliography entry-spacing=\"0\" second-field-align=\"flush\" line-spacing=\"2\">\n    <layout suffix=\".\">\n      <text variable=\"citation-number\" prefix=\"[\" suffix=\"]\"/>\n      <text macro=\"author\" suffix=\", \"/>\n      <choose>\n        <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n          <group delimiter=\", \">\n            <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n            <text macro=\"publisher\"/>\n            <text macro=\"year-date\"/>\n          </group>\n        </if>\n        <else-if type=\"chapter paper-conference\" match=\"any\">\n          <group delimiter=\", \">\n            <group delimiter=\" \">\n              <text term=\"in\"/>\n              <text variable=\"container-title\" form=\"short\" text-case=\"title\" font-style=\"italic\"/>\n              <text macro=\"editor\" prefix=\"(\" suffix=\")\"/>\n            </group>\n            <text macro=\"publisher\"/>\n            <text macro=\"year-date\"/>\n            <group delimiter=\" \">\n              <text macro=\"pages\"/>\n            </group>\n          </group>\n        </else-if>\n        <else-if type=\"patent\">\n          <group delimiter=\", \">\n            <text variable=\"number\" font-style=\"italic\"/>\n            <text macro=\"year-date\"/>\n          </group>\n        </else-if>\n        <else-if type=\"thesis\">\n          <group delimiter=\", \">\n            <text variable=\"title\" text-case=\"title\"/>\n            <text variable=\"genre\"/>\n            <text variable=\"publisher\"/>\n            <text macro=\"year-date\"/>\n          </group>\n        </else-if>\n        <else-if type=\"webpage\">\n          <group delimiter=\", \">\n            <text variable=\"title\"/>\n            <text macro=\"access\"/>\n            <text macro=\"access-date\"/>\n          </group>\n        </else-if>\n        <else>\n          <group delimiter=\" \">\n            <text variable=\"container-title\" form=\"short\" font-style=\"italic\"/>\n            <group delimiter=\", \">\n              <text macro=\"year-date\"/>\n              <group>\n                <text variable=\"volume\" font-style=\"italic\"/>\n              </group>\n              <text variable=\"page-first\"/>\n            </group>\n          </group>\n          <text macro=\"access\" prefix=\", \"/>\n        </else>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/alerts.md",
    "content": "```\n% pandoc -f rst -t gfm\n.. note::\n   This is my note.\n^D\n> [!NOTE]\n> This is my note.\n```\n\n```\n% pandoc -f gfm -t rst\n> [!WARNING]\n> Be careful!\n^D\n.. warning::\n\n   Be careful!\n```\n\n```\n% pandoc -f gfm -t asciidoc\n> [!TIP]\n> A tip.\n^D\n[TIP]\n====\nA tip.\n====\n```\n\n```\n% pandoc -f gfm -t docbook\n> [!TIP]\n> A tip.\n^D\n<tip>\n  <title>Tip</title>\n  <para>\n    A tip.\n  </para>\n</tip>\n```\n\n```\n% pandoc -f docbook -t gfm\n<tip>\n  <title>Tip</title>\n  <para>\n    A tip.\n  </para>\n</tip>\n^D\n> [!TIP]\n> A tip.\n```\n"
  },
  {
    "path": "test/command/american-medical-association.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" page-range-format=\"expanded\" default-locale=\"en-US\">\n  <info>\n    <title>American Medical Association 11th edition</title>\n    <title-short>AMA (11th ed.)</title-short>\n    <id>http://www.zotero.org/styles/american-medical-association</id>\n    <link href=\"http://www.zotero.org/styles/american-medical-association\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/american-medical-association-10th-edition\" rel=\"template\"/>\n    <link href=\"https://westlibrary.txwes.edu/sites/default/files/pdf/AMACitationStyle.pdf\" rel=\"documentation\"/>\n    <link href=\"https://www.amamanualofstyle.com/fileasset/AMAMOS/aaaAMWA%20presentation%20Nov%202019%20FULL.pdf\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Christian Pietsch</name>\n      <uri>http://purl.org/net/pietsch</uri>\n    </contributor>\n    <contributor>\n      <name>Daniel W Chan</name>\n      <email>danwchan@protonmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Patrick O'Brien</name>\n      <email>obrienpat86@gmail.com</email>\n    </contributor>\n    <category citation-format=\"numeric\"/>\n    <category field=\"medicine\"/>\n    <summary>The American Medical Association style as used in JAMA. Version 11 as per November-2019.</summary>\n    <updated>2020-04-23T13:38:04+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"page-range-delimiter\">-</term>\n    </terms>\n  </locale>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"all\" sort-separator=\" \" initialize-with=\"\" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"author\">\n    <group suffix=\".\">\n      <names variable=\"author\">\n        <name name-as-sort-order=\"all\" sort-separator=\" \" initialize-with=\"\" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <label form=\"short\" prefix=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <text macro=\"title\"/>\n        </substitute>\n      </names>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if type=\"article-newspaper\" match=\"none\">\n        <choose>\n          <if variable=\"DOI\">\n            <text value=\"doi:\"/>\n            <text variable=\"DOI\"/>\n          </if>\n          <else-if variable=\"URL\">\n            <group delimiter=\". \">\n              <choose>\n                <if type=\"webpage post post-weblog\" match=\"any\">\n                  <date variable=\"issued\" prefix=\"Published \" form=\"text\"/>\n                </if>\n              </choose>\n              <group>\n                <text term=\"accessed\" text-case=\"capitalize-first\" suffix=\" \"/>\n                <date variable=\"accessed\">\n                  <date-part name=\"month\" suffix=\" \"/>\n                  <date-part name=\"day\" suffix=\", \"/>\n                  <date-part name=\"year\"/>\n                </date>\n              </group>\n              <text variable=\"URL\"/>\n            </group>\n          </else-if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\"/>\n      </if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <text variable=\"publisher\"/>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <number variable=\"edition\" form=\"ordinal\"/>\n          <text term=\"edition\" form=\"short\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" suffix=\".\"/>\n      </else>\n    </choose>\n  </macro>\n  <citation collapse=\"citation-number\">\n    <sort>\n      <key variable=\"citation-number\"/>\n    </sort>\n    <layout delimiter=\",\" vertical-align=\"sup\">\n      <text variable=\"citation-number\"/>\n      <group prefix=\"(\" suffix=\")\">\n        <label variable=\"locator\" form=\"short\" strip-periods=\"true\"/>\n        <text variable=\"locator\"/>\n      </group>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"false\" et-al-min=\"7\" et-al-use-first=\"3\" second-field-align=\"flush\">\n    <layout>\n      <text variable=\"citation-number\" suffix=\". \"/>\n      <text macro=\"author\"/>\n      <text macro=\"title\" prefix=\" \" suffix=\".\"/>\n      <choose>\n        <if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n          <group suffix=\".\" prefix=\" \" delimiter=\" \">\n            <group delimiter=\" \">\n              <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" strip-periods=\"true\"/>\n              <text variable=\"volume\" suffix=\".\"/>\n            </group>\n            <text macro=\"edition\"/>\n            <text macro=\"editor\" prefix=\"(\" suffix=\")\"/>\n          </group>\n          <text macro=\"publisher\" prefix=\" \"/>\n          <group suffix=\".\" prefix=\"; \">\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n            <text variable=\"page\" prefix=\":\"/>\n          </group>\n        </if>\n        <else-if type=\"chapter paper-conference entry-dictionary entry-encyclopedia\" match=\"any\">\n          <group prefix=\" \" delimiter=\" \">\n            <text term=\"in\" text-case=\"capitalize-first\" suffix=\":\"/>\n            <text macro=\"editor\"/>\n            <text variable=\"container-title\" font-style=\"italic\" suffix=\".\" text-case=\"title\"/>\n            <group delimiter=\" \">\n              <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" strip-periods=\"true\"/>\n              <text variable=\"volume\" suffix=\".\"/>\n            </group>\n            <text macro=\"edition\"/>\n            <text variable=\"collection-title\" suffix=\".\"/>\n            <group suffix=\".\">\n              <text macro=\"publisher\"/>\n              <group suffix=\".\" prefix=\"; \">\n                <date variable=\"issued\">\n                  <date-part name=\"year\"/>\n                </date>\n                <text variable=\"page\" prefix=\":\"/>\n              </group>\n            </group>\n          </group>\n        </else-if>\n        <else-if type=\"article-newspaper\">\n          <text variable=\"container-title\" font-style=\"italic\" prefix=\" \" suffix=\". \"/>\n          <choose>\n            <if variable=\"URL\">\n              <group delimiter=\". \" suffix=\".\">\n                <text variable=\"URL\"/>\n                <group prefix=\"Published \">\n                  <date variable=\"issued\">\n                    <date-part name=\"month\" suffix=\" \"/>\n                    <date-part name=\"day\" suffix=\", \"/>\n                    <date-part name=\"year\"/>\n                  </date>\n                </group>\n                <group>\n                  <text term=\"accessed\" text-case=\"capitalize-first\" suffix=\" \"/>\n                  <date variable=\"accessed\">\n                    <date-part name=\"month\" suffix=\" \"/>\n                    <date-part name=\"day\" suffix=\", \"/>\n                    <date-part name=\"year\"/>\n                  </date>\n                </group>\n              </group>\n            </if>\n            <else>\n              <group delimiter=\":\" suffix=\".\">\n                <group>\n                  <date variable=\"issued\">\n                    <date-part name=\"month\" suffix=\" \"/>\n                    <date-part name=\"day\" suffix=\", \"/>\n                    <date-part name=\"year\"/>\n                  </date>\n                </group>\n                <text variable=\"page\"/>\n              </group>\n            </else>\n          </choose>\n        </else-if>\n        <else-if type=\"legal_case\">\n          <group suffix=\",\" prefix=\" \" delimiter=\" \">\n            <text macro=\"editor\" prefix=\"(\" suffix=\")\"/>\n          </group>\n          <group prefix=\" \" delimiter=\" \">\n            <text variable=\"container-title\"/>\n            <text variable=\"volume\"/>\n          </group>\n          <text variable=\"page\" prefix=\", \" suffix=\" \"/>\n          <group prefix=\"(\" suffix=\").\" delimiter=\" \">\n            <text variable=\"authority\"/>\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </else-if>\n        <else-if type=\"webpage post post-weblog\" match=\"any\">\n          <text variable=\"container-title\" prefix=\" \" suffix=\".\"/>\n        </else-if>\n        <else-if type=\"speech\">\n          <group prefix=\" \" suffix=\":\">\n            <choose>\n              <if variable=\"genre\">\n                <text variable=\"genre\" suffix=\" \"/>\n                <text term=\"presented at\"/>\n              </if>\n              <else>\n                <text term=\"presented at\" text-case=\"capitalize-first\"/>\n              </else>\n            </choose>\n          </group>\n          <group delimiter=\"; \" prefix=\" \" suffix=\".\">\n            <text variable=\"event\"/>\n            <group>\n              <date delimiter=\" \" variable=\"issued\">\n                <date-part name=\"month\"/>\n                <date-part name=\"day\" suffix=\",\"/>\n                <date-part name=\"year\"/>\n              </date>\n            </group>\n            <text variable=\"event-place\"/>\n          </group>\n        </else-if>\n        <else>\n          <text macro=\"editor\" prefix=\" \" suffix=\".\"/>\n          <group prefix=\" \" suffix=\".\">\n            <text variable=\"container-title\" font-style=\"italic\" form=\"short\" strip-periods=\"true\" suffix=\".\"/>\n            <group delimiter=\";\" prefix=\" \">\n              <choose>\n                <if variable=\"issue volume\" match=\"any\">\n                  <date variable=\"issued\">\n                    <date-part name=\"year\"/>\n                  </date>\n                </if>\n                <else>\n                  <group delimiter=\" \">\n                    <text value=\"Published online\"/>\n                    <date form=\"text\" date-parts=\"year-month-day\" variable=\"issued\"/>\n                  </group>\n                </else>\n              </choose>\n              <group>\n                <text variable=\"volume\"/>\n                <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n              </group>\n            </group>\n            <text variable=\"page\" prefix=\":\"/>\n          </group>\n        </else>\n      </choose>\n      <text prefix=\" \" macro=\"access\"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/annales.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" default-locale=\"fr-FR\" version=\"1.0\" page-range-format=\"expanded\" demote-non-dropping-particle=\"sort-only\">\n  <info>\n    <title>Annales. Histoire, Sciences sociales (French)</title>\n    <id>http://www.zotero.org/styles/annales</id>\n    <link href=\"http://www.zotero.org/styles/annales\" rel=\"self\"/>\n    <link href=\"http://annales.ehess.fr/?lang=en/\" rel=\"documentation\"/>\n    <author>\n      <name>Franziska Heimburger</name>\n      <email>zotero@franziska.fr</email>\n    </author>\n    <category citation-format=\"note\"/>\n    <category field=\"social_science\"/>\n    <issn>0395-2649</issn>\n    <updated>2013-08-29T04:18:55+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"fr\">\n    <terms>\n      <term name=\"ordinal-01\">ère</term>\n      <term name=\"ordinal-02\">e</term>\n      <term name=\"ordinal-03\">e</term>\n      <term name=\"ordinal-04\">e</term>\n      <term name=\"cited\">op.&#160;cit.</term>\n      <term name=\"page\" form=\"short\">\n        <single>p.</single>\n        <multiple>p.</multiple>\n      </term>\n      <term name=\"editor\" form=\"short\">\n        <single>dir.</single>\n        <multiple>dir.</multiple>\n      </term>\n    </terms>\n  </locale>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\">\n        <name-part name=\"family\" font-variant=\"small-caps\"/>\n      </name>\n      <label form=\"short\" prefix=\"&#160;(\" suffix=\")\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"long\" and=\"text\" initialize-with=\". \" delimiter-precedes-last=\"never\">\n        <name-part name=\"family\" font-variant=\"small-caps\"/>\n      </name>\n      <label form=\"short\" prefix=\"&#160;(\" suffix=\")\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \" font-style=\"normal\">\n      </name>\n      <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \" font-style=\"normal\" prefix=\" trad. fr. \">\n        <name-part name=\"family\" font-variant=\"small-caps\"/>\n      </name>\n    </names>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n      </if>\n      <else-if type=\"article-journal article-newspaper article-magazine\" match=\"any\">\n        <group delimiter=\", \">\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\" font-style=\"normal\"/>\n          <text variable=\"container-title\" font-style=\"italic\"/>\n        </group>\n      </else-if>\n      <else-if type=\"thesis\" match=\"any\">\n        <group>\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\" font-style=\"normal\"/>\n          <text variable=\"genre\" suffix=\", \" prefix=\" \"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else-if>\n      <else-if type=\"manuscript\" match=\"any\">\n        <group delimiter=\",\">\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\" font-style=\"normal\"/>\n          <text variable=\"genre\" prefix=\" \"/>\n        </group>\n      </else-if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group>\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\" suffix=\",\"/>\n          <text value=\"in\" font-style=\"italic\" suffix=\" \" prefix=\" \"/>\n          <text macro=\"editor\" suffix=\", \"/>\n          <text variable=\"container-title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </group>\n      </else-if>\n      <else-if type=\"webpage\" match=\"any\">\n        <group>\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\", \"/>\n          <text variable=\"URL\" text-decoration=\"underline\"/>\n        </group>\n      </else-if>\n      <else>\n        <text variable=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"pub-place\">\n    <choose>\n      <if type=\"bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song\" match=\"any\">\n        <text variable=\"publisher-place\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"bill book chapter entry-dictionary entry-encyclopedia graphic legal_case motion_picture paper-conference report song\" match=\"any\">\n        <text variable=\"publisher\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"yearpage\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture paper-conference manuscript report song thesis\" match=\"any\">\n        <group delimiter=\", \" font-style=\"normal\">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\"/>\n            <text variable=\"volume\"/>\n          </group>\n          <group delimiter=\"&#8239;\">\n            <label variable=\"locator\" form=\"short\"/>\n            <text variable=\"locator\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\" \" font-style=\"normal\">\n          <date variable=\"issued\">\n            <date-part name=\"year\" suffix=\", \"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\" suffix=\",\"/>\n          </group>\n          <label variable=\"page\" form=\"short\"/>\n          <group delimiter=\", \">\n            <text variable=\"page\"/>\n            <group delimiter=\"&#8239;\">\n              <label variable=\"locator\" form=\"short\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"article-journal\" match=\"any\">\n        <group delimiter=\" \" font-style=\"normal\">\n          <label variable=\"page\" form=\"short\"/>\n          <group delimiter=\", \">\n            <text variable=\"page\"/>\n            <group delimiter=\"&#8239;\">\n              <label variable=\"locator\" form=\"short\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine\" match=\"any\">\n        <group delimiter=\" \" font-style=\"normal\">\n          <date variable=\"issued\" form=\"numeric\">\n            <date-part name=\"day\"/>\n            <date-part name=\"month\"/>\n            <date-part name=\"year\"/>\n          </date>\n          <group delimiter=\" \" font-style=\"normal\">\n            <choose>\n              <if variable=\"locator\" match=\"any\">\n                <group delimiter=\"&#8239;\">\n                  <label variable=\"locator\" form=\"short\"/>\n                  <text variable=\"locator\"/>\n                </group>\n              </if>\n              <else-if variable=\"locator\" match=\"none\">\n                <label variable=\"page\" form=\"short\"/>\n              </else-if>\n            </choose>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"webpage\" match=\"any\">\n        <group delimiter=\" \" font-style=\"normal\">\n          <text value=\"consulté le\" suffix=\" \" prefix=\" \"/>\n          <date variable=\"accessed\" form=\"text\">\n            <date-part name=\"day\"/>\n            <date-part name=\"month\"/>\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song chapter paper-conference\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"article-journal article-magazine\" match=\"any\">\n        <group font-style=\"normal\">\n          <choose>\n            <if variable=\"issued\">\n              <date variable=\"issued\">\n                <date-part name=\"year\"/>\n              </date>\n              <text macro=\"volume\" prefix=\", \"/>\n            </if>\n            <else>\n              <text macro=\"volume\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n    <text macro=\"issue\" prefix=\", \"/>\n  </macro>\n  <macro name=\"volume\">\n    <choose>\n      <if is-numeric=\"volume\">\n        <text term=\"volume\" form=\"short\" suffix=\".&#160;\"/>\n        <text variable=\"volume\"/>\n      </if>\n      <else>\n        <text variable=\"volume\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if is-numeric=\"issue\">\n        <text term=\"issue\" form=\"short\" suffix=\"&#160;\"/>\n        <text variable=\"issue\"/>\n      </if>\n      <else>\n        <text variable=\"issue\"/>\n      </else>\n    </choose>\n  </macro>\n  <citation>\n    <layout suffix=\".\" delimiter=\"&#160;; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\", \">\n            <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\".\"/>\n            <group delimiter=\"&#8239;\">\n              <label variable=\"locator\" form=\"short\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <group delimiter=\", \">\n            <text macro=\"author-short\"/>\n            <choose>\n              <if type=\"bill book graphic legal_case motion_picture report song thesis\" match=\"any\">\n                <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n              </if>\n              <else>\n                <text variable=\"title\" text-case=\"capitalize-first\" form=\"short\" quotes=\"true\" font-style=\"normal\"/>\n              </else>\n            </choose>\n            <text term=\"cited\" font-style=\"italic\" suffix=\".\"/>\n            <group delimiter=\"&#8239;\">\n              <label variable=\"locator\" form=\"short\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </group>\n        </else-if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"author\"/>\n            <text macro=\"title\"/>\n            <text macro=\"translator\"/>\n            <text macro=\"edition\"/>\n            <text macro=\"pub-place\"/>\n            <text macro=\"publisher\"/>\n            <text macro=\"yearpage\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography>\n    <sort>\n      <key macro=\"author\" names-min=\"3\" names-use-first=\"3\"/>\n      <key variable=\"issued\" sort=\"descending\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\", \">\n        <text macro=\"author\"/>\n        <text macro=\"title\"/>\n        <text macro=\"translator\"/>\n        <text macro=\"edition\"/>\n        <text macro=\"pub-place\"/>\n        <text macro=\"publisher\"/>\n        <text macro=\"yearpage\"/>\n      </group>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/apa.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"never\">\n  <!-- This style was edited with the Visual CSL Editor (http://steveridout.com/csl/visualEditor/) -->\n  <info>\n    <title>American Psychological Association 6th edition</title>\n    <title-short>APA</title-short>\n    <id>http://www.zotero.org/styles/apa</id>\n    <link href=\"http://www.zotero.org/styles/apa\" rel=\"self\"/>\n    <link href=\"http://owl.english.purdue.edu/owl/resource/560/01/\" rel=\"documentation\"/>\n    <author>\n      <name>Simon Kornblith</name>\n      <email>simon@simonster.com</email>\n    </author>\n    <contributor>\n      <name>Bruce D'Arcus</name>\n    </contributor>\n    <contributor>\n      <name>Curtis M. Humphrey</name>\n    </contributor>\n    <contributor>\n      <name>Richard Karnesky</name>\n      <email>karnesky+zotero@gmail.com</email>\n      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>\n    </contributor>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <category citation-format=\"author-date\"/>\n    <category field=\"psychology\"/>\n    <category field=\"generic-base\"/>\n    <updated>2014-04-12T01:20:52+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"editortranslator\" form=\"short\">\n        <single>ed. &amp; trans.</single>\n        <multiple>eds. &amp; trans.</multiple>\n      </term>\n      <term name=\"translator\" form=\"short\">\n        <single>trans.</single>\n        <multiple>trans.</multiple>\n      </term>\n    </terms>\n  </locale>\n  <macro name=\"container-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <names variable=\"editor translator container-author\" delimiter=\", \" suffix=\", \">\n          <name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/>\n          <label form=\"short\" prefix=\" (\" text-case=\"title\" suffix=\")\"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"secondary-contributors\">\n    <choose>\n      <if type=\"article-journal chapter paper-conference\" match=\"none\">\n        <names variable=\"translator editor container-author\" delimiter=\", \" prefix=\" (\" suffix=\")\">\n          <name and=\"symbol\" initialize-with=\". \" delimiter=\", \"/>\n          <label form=\"short\" prefix=\", \" text-case=\"title\"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name name-as-sort-order=\"all\" and=\"symbol\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\" text-case=\"capitalize-first\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <choose>\n          <if type=\"report\">\n            <text variable=\"publisher\"/>\n            <text macro=\"title\"/>\n          </if>\n          <else>\n            <text macro=\"title\"/>\n          </else>\n        </choose>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"symbol\" delimiter=\", \" initialize-with=\". \"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <choose>\n          <if type=\"report\">\n            <text variable=\"publisher\"/>\n            <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n          </if>\n          <else-if type=\"legal_case\">\n            <text variable=\"title\" font-style=\"italic\"/>\n          </else-if>\n          <else-if type=\"bill book graphic legislation motion_picture song\" match=\"any\">\n            <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n          </else-if>\n          <else>\n            <text variable=\"title\" form=\"short\" quotes=\"true\"/>\n          </else>\n        </choose>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if type=\"thesis\">\n        <choose>\n          <if variable=\"archive\" match=\"any\">\n            <group>\n              <text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/>\n              <text term=\"from\" suffix=\" \"/>\n              <text variable=\"archive\" suffix=\".\"/>\n              <text variable=\"archive_location\" prefix=\" (\" suffix=\")\"/>\n            </group>\n          </if>\n          <else>\n            <group>\n              <text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/>\n              <text term=\"from\" suffix=\" \"/>\n              <text variable=\"URL\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n      <else>\n        <choose>\n          <if variable=\"DOI\">\n            <text variable=\"DOI\" prefix=\"doi:\"/>\n          </if>\n          <else>\n            <choose>\n              <if type=\"webpage\">\n                <group delimiter=\" \">\n                  <text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/>\n                  <group>\n                    <date variable=\"accessed\" form=\"text\" suffix=\", \"/>\n                  </group>\n                  <text term=\"from\"/>\n                  <text variable=\"URL\"/>\n                </group>\n              </if>\n              <else>\n                <group>\n                  <text term=\"retrieved\" text-case=\"capitalize-first\" suffix=\" \"/>\n                  <text term=\"from\" suffix=\" \"/>\n                  <text variable=\"URL\"/>\n                </group>\n              </else>\n            </choose>\n          </else>\n        </choose>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"report thesis\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n        <group prefix=\" (\" suffix=\")\" delimiter=\" \">\n          <text variable=\"genre\"/>\n          <text variable=\"number\" prefix=\"No. \"/>\n        </group>\n      </if>\n      <else-if type=\"book graphic  motion_picture report song manuscript speech\" match=\"any\">\n        <!---This is a hack until we have a computer program type -->\n        <choose>\n          <if variable=\"version\">\n            <group delimiter=\" \">\n              <text variable=\"title\"/>\n              <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n                <text term=\"version\" text-case=\"capitalize-first\"/>\n                <text variable=\"version\"/>\n              </group>\n            </group>\n          </if>\n          <else>\n            <text variable=\"title\" font-style=\"italic\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"report\" match=\"any\">\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </if>\n      <else-if type=\"thesis\" match=\"any\">\n        <group delimiter=\", \">\n          <text variable=\"publisher\"/>\n          <text variable=\"publisher-place\"/>\n        </group>\n      </else-if>\n      <else>\n        <group delimiter=\", \">\n          <choose>\n            <if variable=\"event\" match=\"none\">\n              <text variable=\"genre\"/>\n            </if>\n          </choose>\n          <choose>\n            <if type=\"article-journal article-magazine\" match=\"none\">\n              <group delimiter=\": \">\n                <text variable=\"publisher-place\"/>\n                <text variable=\"publisher\"/>\n              </group>\n            </if>\n          </choose>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"event\">\n    <choose>\n      <if variable=\"container-title\" match=\"none\">\n        <choose>\n          <if variable=\"event\">\n            <choose>\n              <if variable=\"genre\" match=\"none\">\n                <text term=\"presented at\" text-case=\"capitalize-first\" suffix=\" \"/>\n                <text variable=\"event\"/>\n              </if>\n              <else>\n                <group delimiter=\" \">\n                  <text variable=\"genre\" text-case=\"capitalize-first\"/>\n                  <text term=\"presented at\"/>\n                  <text variable=\"event\"/>\n                </group>\n              </else>\n            </choose>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issued\">\n    <choose>\n      <if type=\"bill legal_case legislation\" match=\"none\">\n        <choose>\n          <if variable=\"issued\">\n            <group prefix=\" (\" suffix=\")\">\n              <date variable=\"issued\">\n                <date-part name=\"year\"/>\n              </date>\n              <text variable=\"year-suffix\"/>\n              <choose>\n                <if type=\"article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"none\">\n                  <date variable=\"issued\">\n                    <date-part prefix=\", \" name=\"month\"/>\n                    <date-part prefix=\" \" name=\"day\"/>\n                  </date>\n                </if>\n              </choose>\n            </group>\n          </if>\n          <else>\n            <group prefix=\" (\" suffix=\")\">\n              <text term=\"no date\" form=\"short\"/>\n              <text variable=\"year-suffix\" prefix=\"-\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issued-sort\">\n    <choose>\n      <if type=\"article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"none\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n          <date-part name=\"month\"/>\n          <date-part name=\"day\"/>\n        </date>\n      </if>\n      <else>\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issued-year\">\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n        <text variable=\"year-suffix\"/>\n      </if>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n        <text variable=\"year-suffix\" prefix=\"-\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <number variable=\"edition\" form=\"ordinal\"/>\n          <text term=\"edition\" form=\"short\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" suffix=\".\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locators\">\n    <choose>\n      <if type=\"article-journal article-magazine\" match=\"any\">\n        <group prefix=\", \" delimiter=\", \">\n          <group>\n            <text variable=\"volume\" font-style=\"italic\"/>\n            <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n          </group>\n          <text variable=\"page\"/>\n        </group>\n      </if>\n      <else-if type=\"article-newspaper\">\n        <group delimiter=\" \" prefix=\", \">\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"book graphic motion_picture report song chapter paper-conference\" match=\"any\">\n        <group prefix=\" (\" suffix=\")\" delimiter=\", \">\n          <text macro=\"edition\"/>\n          <group>\n            <text term=\"volume\" form=\"short\" plural=\"true\" text-case=\"capitalize-first\" suffix=\" \"/>\n            <number variable=\"number-of-volumes\" form=\"numeric\" prefix=\"1-\"/>\n          </group>\n          <group>\n            <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <group>\n            <label variable=\"page\" form=\"short\" suffix=\" \"/>\n            <text variable=\"page\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <group prefix=\" (\" suffix=\")\" delimiter=\" \">\n          <text variable=\"authority\"/>\n          <date variable=\"issued\" form=\"text\"/>\n        </group>\n      </else-if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <date variable=\"issued\" prefix=\" (\" suffix=\")\">\n          <date-part name=\"year\"/>\n        </date>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"citation-locator\">\n    <group>\n      <choose>\n        <if locator=\"chapter\">\n          <label variable=\"locator\" form=\"long\" text-case=\"capitalize-first\"/>\n        </if>\n        <else>\n          <label variable=\"locator\" form=\"short\"/>\n        </else>\n      </choose>\n      <text variable=\"locator\" prefix=\" \"/>\n    </group>\n  </macro>\n  <macro name=\"container\">\n    <group>\n      <choose>\n        <if type=\"chapter paper-conference entry-encyclopedia\" match=\"any\">\n          <text term=\"in\" text-case=\"capitalize-first\" suffix=\" \"/>\n        </if>\n      </choose>\n      <text macro=\"container-contributors\"/>\n      <text macro=\"secondary-contributors\"/>\n      <text macro=\"container-title\"/>\n    </group>\n  </macro>\n  <macro name=\"container-title\">\n    <choose>\n      <if type=\"article article-journal article-magazine article-newspaper\" match=\"any\">\n        <text variable=\"container-title\" font-style=\"italic\" text-case=\"title\"/>\n      </if>\n      <else-if type=\"bill legal_case legislation\" match=\"none\">\n        <text variable=\"container-title\" font-style=\"italic\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"legal-cites\">\n    <choose>\n      <if type=\"bill legal_case legislation\" match=\"any\">\n        <group delimiter=\" \" prefix=\", \">\n          <choose>\n            <if variable=\"container-title\">\n              <text variable=\"volume\"/>\n              <text variable=\"container-title\"/>\n              <group delimiter=\" \">\n                <!--change to label variable=\"section\" as that becomes available -->\n                <text term=\"section\" form=\"symbol\"/>\n                <text variable=\"section\"/>\n              </group>\n              <text variable=\"page\"/>\n            </if>\n            <else>\n              <choose>\n                <if type=\"legal_case\">\n                  <text variable=\"number\" prefix=\"No. \"/>\n                </if>\n                <else>\n                  <text variable=\"number\" prefix=\"Pub. L. No. \"/>\n                  <group delimiter=\" \">\n                    <!--change to label variable=\"section\" as that becomes available -->\n                    <text term=\"section\" form=\"symbol\"/>\n                    <text variable=\"section\"/>\n                  </group>\n                </else>\n              </choose>\n            </else>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <citation et-al-min=\"6\" et-al-use-first=\"1\" et-al-subsequent-min=\"3\" et-al-subsequent-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\" collapse=\"year\" givenname-disambiguation-rule=\"primary-name\">\n    <sort>\n      <key macro=\"author\"/>\n      <key macro=\"issued-sort\"/>\n    </sort>\n    <layout prefix=\"(\" suffix=\")\" delimiter=\"; \">\n      <group delimiter=\", \">\n        <text macro=\"author-short\"/>\n        <text macro=\"issued-year\"/>\n        <text macro=\"citation-locator\"/>\n      </group>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"8\" et-al-use-first=\"6\" et-al-use-last=\"true\" entry-spacing=\"0\" line-spacing=\"2\">\n    <sort>\n      <key macro=\"author\"/>\n      <key macro=\"issued-sort\" sort=\"ascending\"/>\n      <key macro=\"title\"/>\n    </sort>\n    <layout>\n      <group suffix=\".\">\n        <group delimiter=\". \">\n          <text macro=\"author\"/>\n          <text macro=\"issued\"/>\n          <text macro=\"title\" prefix=\" \"/>\n          <text macro=\"container\"/>\n        </group>\n        <text macro=\"legal-cites\"/>\n        <text macro=\"locators\"/>\n        <group delimiter=\", \" prefix=\". \">\n          <text macro=\"event\"/>\n          <text macro=\"publisher\"/>\n        </group>\n      </group>\n      <text macro=\"access\" prefix=\" \"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/archeologie-medievale.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" class=\"note\" demote-non-dropping-particle=\"display-and-sort\" default-locale=\"fr-FR\" page-range-format=\"expanded\">\n  <info>\n    <title>Archéologie médiévale (French)</title>\n    <id>http://www.zotero.org/styles/archeologie-medievale</id>\n    <link href=\"http://www.zotero.org/styles/archeologie-medievale\" rel=\"self\"/>\n    <link href=\"http://www.unicaen.fr/crahm/archeomed/spip.php?article80\" rel=\"documentation\"/>\n    <author>\n      <name>Nicolas Monteix</name>\n      <email>nicolas.monteix@univ-rouen.fr</email>\n    </author>\n    <category citation-format=\"note\"/>\n    <category field=\"history\"/>\n    <category field=\"anthropology\"/>\n    <issn>0153-9337</issn>\n    <summary>Style auteur-date en note pour Archéologie médiévale. NB: les sources éditées doivent être considérées comme des livres ayant un auteur (médiéval) et un éditeur (contemporain). Pour les sources éditées ne disposant pas d'auteur (médiéval), il est nécessaire de transformer le (dir.) en (éd.). Pour les archives (type=manuscrit), le \"lieu\" correspond au dépôt d'archives, l' \"archive\" au fonds, la \"loc. dans l'archive\" à la cote.</summary>\n    <updated>2014-08-17T23:30:36+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"fr\">\n    <terms>\n      <term name=\"editor\" form=\"short\">dir.</term>\n      <term name=\"in\">dans</term>\n      <term name=\"anonymous\">anonyme</term>\n      <term name=\"anonymous\" form=\"short\">anon.</term>\n      <term name=\"accessed\">consulté le</term>\n      <term name=\"no date\">sans date</term>\n      <term name=\"no date\" form=\"short\">s.&#160;d.</term>\n    </terms>\n  </locale>\n  <macro name=\"author\">\n    <names variable=\"author\" delimiter=\" \">\n      <name name-as-sort-order=\"all\" font-variant=\"small-caps\" sort-separator=\" \" initialize-with=\".\" delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \"/>\n      <substitute>\n        <text macro=\"editor\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"all\" font-variant=\"small-caps\" sort-separator=\" \" initialize-with=\".\" delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \"/>\n      <label form=\"short\" font-variant=\"normal\" text-case=\"lowercase\" prefix=\" (\" suffix=\")\"/>\n    </names>\n  </macro>\n  <macro name=\"pages\">\n    <group>\n      <text variable=\"page\" prefix=\"p.&#160;\"/>\n    </group>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \"/>\n      <et-al font-variant=\"normal\" font-style=\"italic\"/>\n      <substitute>\n        <text macro=\"editor-short\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor-short\">\n    <names variable=\"editor\">\n      <name form=\"short\" delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \"/>\n      <et-al font-variant=\"normal\" font-style=\"italic\"/>\n    </names>\n  </macro>\n  <macro name=\"URLaccess\">\n    <group prefix=\"(\" suffix=\")\">\n      <text variable=\"URL\"/>\n      <text macro=\"access\"/>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <group prefix=\" [\" suffix=\"]\">\n      <text term=\"accessed\" suffix=\" \"/>\n      <date variable=\"accessed\">\n        <date-part name=\"day\" suffix=\" \"/>\n        <date-part name=\"month\" suffix=\" \"/>\n        <date-part name=\"year\"/>\n      </date>\n    </group>\n  </macro>\n  <macro name=\"editor-text\">\n    <group>\n      <names variable=\"editor\" suffix=\" (éd.), \">\n        <name name-as-sort-order=\"all\" font-variant=\"small-caps\" sort-separator=\" \" initialize-with=\".\" delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \"/>\n      </names>\n      <text macro=\"publisher\" suffix=\", \"/>\n      <text macro=\"year-date\"/>\n    </group>\n  </macro>\n  <macro name=\"editor-text-short\">\n    <group>\n      <names variable=\"editor\" suffix=\" (éd.), \">\n        <name name-as-sort-order=\"all\" form=\"short\" font-variant=\"small-caps\" delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \"/>\n      </names>\n      <text macro=\"year-date\"/>\n    </group>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"book\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </if>\n      <else-if type=\"webpage\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else-if variable=\"container-title\" match=\"none\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\", \">\n      <text variable=\"publisher-place\"/>\n      <text variable=\"publisher\"/>\n    </group>\n  </macro>\n  <macro name=\"year-date\">\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n    <choose>\n      <if is-numeric=\"edition\">\n        <group vertical-align=\"sup\">\n          <number variable=\"edition\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"type-sorting\">\n    <choose>\n      <if type=\"book\" variable=\"editor author\" match=\"all\">\n        <text value=\"1\"/>\n      </if>\n      <else-if type=\"manuscript\">\n        <text value=\"2\"/>\n      </else-if>\n      <else>\n        <text value=\"3\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locator\">\n    <choose>\n      <if locator=\"paragraph\">\n        <text variable=\"locator\" prefix=\", § \"/>\n      </if>\n      <else-if locator=\"folio\">\n        <text variable=\"locator\" prefix=\",&#160;fol.&#160;\"/>\n      </else-if>\n      <else>\n        <group prefix=\",&#160;\">\n          <label variable=\"locator\" form=\"short\" suffix=\".&#160;\"/>\n          <text variable=\"locator\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"3\" delimiter-precedes-et-al=\"never\" disambiguate-add-year-suffix=\"true\">\n    <sort>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout delimiter=\"&#160;; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group>\n            <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n            <text macro=\"locator\"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </else-if>\n        <else-if type=\"book\" variable=\"editor author\" match=\"all\">\n          <group suffix=\".\">\n            <text macro=\"author-short\" font-variant=\"small-caps\" suffix=\", \"/>\n            <text macro=\"title\" suffix=\", \"/>\n            <text macro=\"editor-text-short\"/>\n            <text macro=\"locator\"/>\n          </group>\n        </else-if>\n        <else-if type=\"manuscript\">\n          <group delimiter=\", \">\n            <text variable=\"publisher-place\"/>\n            <text variable=\"archive_location\"/>\n            <text macro=\"locator\"/>\n          </group>\n        </else-if>\n        <else>\n          <text macro=\"author-short\" suffix=\"&#160;\" font-variant=\"small-caps\"/>\n          <text macro=\"year-date\"/>\n          <text macro=\"locator\"/>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography subsequent-author-substitute=\"\">\n    <sort>\n      <key macro=\"type-sorting\"/>\n      <key macro=\"author\"/>\n      <key variable=\"issued\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout suffix=\".\">\n      <choose>\n        <if type=\"book\" variable=\"editor author\" match=\"all\">\n          <group suffix=\".\">\n            <text macro=\"author\" suffix=\", \"/>\n            <text macro=\"title\" suffix=\", \"/>\n            <text macro=\"editor-text\"/>\n          </group>\n        </if>\n        <else-if type=\"manuscript\">\n          <group delimiter=\", \">\n            <text variable=\"archive_location\"/>\n            <text variable=\"archive\"/>\n            <text variable=\"title\" font-style=\"italic\"/>\n          </group>\n          <group prefix=\" (\" suffix=\")\">\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </else-if>\n        <else>\n          <group display=\"block\">\n            <text macro=\"author\" suffix=\"&#9;\"/>\n          </group>\n          <group display=\"left-margin\">\n            <text macro=\"year-date\" suffix=\", \"/>\n            <choose>\n              <if type=\"thesis\">\n                <group delimiter=\", \" suffix=\".\">\n                  <text macro=\"title\" font-style=\"italic\"/>\n                  <text variable=\"genre\"/>\n                  <text variable=\"publisher\"/>\n                  <text variable=\"publisher-place\"/>\n                </group>\n              </if>\n              <else-if type=\"webpage\">\n                <group delimiter=\" \">\n                  <text macro=\"title\" font-style=\"italic\"/>\n                  <text macro=\"URLaccess\"/>\n                </group>\n              </else-if>\n              <else-if type=\"article-journal article-magazine article-newspaper broadcast personal_communication thesis entry-dictionary entry-encyclopedia\" match=\"any\">\n                <group delimiter=\", \" suffix=\".\">\n                  <text macro=\"title\" quotes=\"true\"/>\n                  <text variable=\"container-title\" font-style=\"italic\"/>\n                  <text variable=\"volume\"/>\n                  <text variable=\"issue\"/>\n                  <text macro=\"pages\"/>\n                </group>\n              </else-if>\n              <else-if type=\"book graphic\" match=\"any\">\n                <group suffix=\".\">\n                  <text macro=\"title\" suffix=\", \"/>\n                  <text macro=\"publisher\"/>\n                </group>\n              </else-if>\n              <else-if type=\"chapter paper-conference\" match=\"any\">\n                <text macro=\"title\" quotes=\"true\" suffix=\", \"/>\n                <group delimiter=\", \">\n                  <group delimiter=\" \">\n                    <text term=\"in\"/>\n                    <text macro=\"editor\"/>\n                  </group>\n                  <text variable=\"container-title\" font-style=\"italic\"/>\n                  <text macro=\"publisher\"/>\n                  <text macro=\"pages\"/>\n                </group>\n              </else-if>\n            </choose>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/ascii.md",
    "content": "```\n% pandoc -t html --ascii\näéıå\n^D\n<p>&#xE4;&#xE9;&#x131;&#xE5;</p>\n```\n\n```\n% pandoc -t latex --ascii\näéıå\n^D\n\\\"{a}\\'{e}\\i\\r{a}\n```\n\n```\n% pandoc -t man --ascii\näéıå\n^D\n.PP\n\\(:a\\('e\\(.i\\(oa\n```\n\n```\n% pandoc -t ms --ascii\näéıå\n^D\n.LP\n\\(:a\\('e\\(.i\\(oa\n```\n\n```\n% pandoc -t docbook --ascii\näéıå\n^D\n<para>\n  &#xE4;&#xE9;&#x131;&#xE5;\n</para>\n```\n\n```\n% pandoc -t jats --ascii\näéıå\n^D\n<p>&#xE4;&#xE9;&#x131;&#xE5;</p>\n```\n\n```\n% pandoc -t markdown-smart --ascii\n\"äéıå\"\n^D\n&ldquo;&auml;&eacute;&imath;&aring;&rdquo;\n```\n\n# CommonMark tests\n\n```\n% pandoc -f commonmark -t commonmark --ascii\nhello … ok? … bye\n^D\nhello &mldr; ok? &mldr; bye\n```\n\n```\n% pandoc -f commonmark+smart -t commonmark-smart --ascii --wrap=none\n\"hi\"...dog's breath---cat 5--6\n^D\n&ldquo;hi&rdquo;&mldr;dog&rsquo;s breath&mdash;cat 5&ndash;6\n```\n\n```\n% pandoc -f commonmark+smart -t commonmark+smart --ascii\n\"hi\"...dog's breath---cat 5--6\n^D\n\"hi\"...dog's breath---cat 5--6\n```\n\n```\n% pandoc -f commonmark -t commonmark --ascii\nfoo &#1234; bar\n^D\nfoo &#1234; bar\n```\n\n```\n% pandoc -f commonmark -t commonmark --ascii\n\\[foo\\](bar)\n^D\n\\[foo\\](bar)\n```\n"
  },
  {
    "path": "test/command/author-in-text-move-note.md",
    "content": "```\n% pandoc --citeproc --csl command/chicago-fullnote-bibliography.csl -t plain\n---\nreferences:\n- id: foo\n  type: book\n  author: John Doe\n  title: A Book\n...\n\nSee @foo [p. 21], as well.\n^D\nSee John Doe,[1] as well.\n\nJohn Doe. A Book, n.d.\n\n[1] A Book, n.d., 21.\n```\n\n"
  },
  {
    "path": "test/command/averroes.bib",
    "content": "@string{anch-ie = {Angew.~Chem. Int.~Ed.}}\n@string{cup     = {Cambridge University Press}}\n@string{dtv     = {Deutscher Taschenbuch-Verlag}}\n@string{hup     = {Harvard University Press}}\n@string{jams    = {J.~Amer. Math. Soc.}}\n@string{jchph   = {J.~Chem. Phys.}}\n@string{jomch   = {J.~Organomet. Chem.}}\n@string{pup     = {Princeton University Press}}\n\n@book{averroes/bland,\n  author       = {Averroes},\n  title        = {The Epistle on the Possibility of Conjunction with the Active\n                  Intellect by {Ibn Rushd} with the Commentary of {Moses Narboni}},\n  date         = 1982,\n  editor       = {Bland, Kalman P.},\n  translator   = {Bland, Kalman P.},\n  series       = {Moreshet: Studies in {Jewish} History, Literature and Thought},\n  number       = 7,\n  publisher    = {Jewish Theological Seminary of America},\n  location     = {New York},\n  keywords     = {primary},\n  langid       = {english},\n  langidopts   = {variant=american},\n  indextitle   = {Epistle on the Possibility of Conjunction, The},\n  shorttitle   = {Possibility of Conjunction},\n  annotation   = {A \\texttt{book} entry with a \\texttt{series} and a\n                  \\texttt{number}. Note the concatenation of the \\texttt{editor}\n                  and \\texttt{translator} fields as well as the\n                  \\texttt{indextitle} field},\n}\n\n@book{averroes/hannes,\n  author       = {Averroes},\n  title        = {Des Averro{\\\"e}s Abhandlung: \\mkbibquote{{\\\"U}ber die\n                  M{\\\"o}glichkeit der Conjunktion} oder \\mkbibquote{{\\\"U}ber den\n                  materiellen Intellekt}},\n  date         = 1892,\n  editor       = {Hannes, Ludwig},\n  translator   = {Hannes, Ludwig},\n  annotator    = {Hannes, Ludwig},\n  publisher    = {C.~A. Kaemmerer},\n  location     = {Halle an der Saale},\n  keywords     = {primary},\n  langid       = {german},\n  sorttitle    = {Uber die Moglichkeit der Conjunktion},\n  indexsorttitle= {Uber die Moglichkeit der Conjunktion},\n  indextitle   = {{\\\"U}ber die M{\\\"o}glichkeit der Conjunktion},\n  shorttitle   = {{\\\"U}ber die M{\\\"o}glichkeit der Conjunktion},\n  annotation   = {An annotated edition. Note the concatenation of the\n                  \\texttt{editor}, \\texttt{translator}, and \\texttt{annotator}\n                  fields. Also note the \\texttt{shorttitle},\n                  \\texttt{indextitle}, \\texttt{sorttitle}, and\n                  \\texttt{indexsorttitle} fields},\n}\n\n@book{averroes/hercz,\n  author       = {Averroes},\n  title        = {Drei Abhandlungen {\\\"u}ber die Conjunction des separaten\n                  Intellects mit dem Menschen},\n  date         = 1869,\n  editor       = {Hercz, J.},\n  translator   = {Hercz, J.},\n  publisher    = {S.~Hermann},\n  location     = {Berlin},\n  keywords     = {primary},\n  langid       = {german},\n  indexsorttitle= {Drei Abhandlungen uber die Conjunction},\n  indextitle   = {Drei Abhandlungen {\\\"u}ber die Conjunction},\n  subtitle     = {Von Averroes (Vater und Sohn), aus dem Arabischen\n                  {\\\"u}bersetzt von Samuel Ibn Tibbon},\n  shorttitle   = {Drei Abhandlungen},\n  annotation   = {A \\texttt{book} entry. Note the concatenation of the\n                  \\texttt{editor} and \\texttt{translator} fields as well as the\n                  \\texttt{indextitle} and \\texttt{indexsorttitle} fields},\n}\n\n@book{cicero,\n  author       = {Cicero, Marcus Tullius},\n  title        = {De natura deorum. {\\\"U}ber das Wesen der G{\\\"o}tter},\n  date         = 1995,\n  editor       = {Blank-Sangmeister, Ursula},\n  translator   = {Blank-Sangmeister, Ursula},\n  afterword    = {Thraede, Klaus},\n  language     = {langlatin and langgerman},\n  publisher    = {Reclam},\n  location     = {Stuttgart},\n  langid       = {german},\n  indextitle   = {De natura deorum},\n  shorttitle   = {De natura deorum},\n  annotation   = {A bilingual edition of Cicero's \\emph{De natura deorum}, with\n                  a German translation. Note the format of the \\texttt{language}\n                  field in the database file, the concatenation of the\n                  \\texttt{editor} and \\texttt{translator} fields, and the\n                  \\texttt{afterword} field},\n}\n"
  },
  {
    "path": "test/command/bar-endinput.tex",
    "content": "\\emph{hi there}\n\\endinput\n\\emph{invisible}\n"
  },
  {
    "path": "test/command/bar.tex",
    "content": "\\emph{hi there}\n"
  },
  {
    "path": "test/command/biblatex-266.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@book{goethe2005,\n  langid = {german},\n  location = {{Frankfurt am Main}},\n  title = {Not A Real Book},\n  date = {2005},\n  author = {family=Goethe, given=Johann Wolfgang, prefix=von, useprefix=false and given=Antonie, prefix=van, family=Leeuwenhoek, useprefix=true}, editor = {Schöne, Albrecht}\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - dropping-particle: von\n    family: Goethe\n    given: Johann Wolfgang\n  - family: Leeuwenhoek\n    given: Antonie\n    non-dropping-particle: van\n  editor:\n  - family: Schöne\n    given: Albrecht\n  id: goethe2005\n  issued: 2005\n  language: de-DE\n  publisher-place: Frankfurt am Main\n  title: Not A Real Book\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-aksin.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Aksin et al. 2006)\n\nAksin, Özge, Hayati Türkmen, Levent Artok, Bekir Çetinkaya, Chaoying Ni,\nOrhan Büyükgüngör, and Erhan Özkal. 2006. “Effect of Immobilization on\nCatalytic Characteristics of Saturated Pd-N-heterocyclic Carbenes in\nMizoroki-Heck Reactions.” *J. Organomet. Chem.* 691 (13): 3027–3036.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Aksin et al., 2006)\n\nAksin, Ö., Türkmen, H., Artok, L., Çetinkaya, B., Ni, C., Büyükgüngör,\nO., & Özkal, E. (2006). Effect of immobilization on catalytic\ncharacteristics of saturated Pd-N-heterocyclic carbenes in Mizoroki-Heck\nreactions. *J. Organomet. Chem.*, *691*(13), 3027–3036.\n\n\n}\n\n@string{ jomch   = {J.~Organomet. Chem.} }\n\n@Article{aksin,\n  author       = {Aks{\\i}n, {\\\"O}zge and T{\\\"u}rkmen, Hayati and Artok, Levent\n                  and {\\c{C}}etinkaya, Bekir and Ni, Chaoying and\n                  B{\\\"u}y{\\\"u}kg{\\\"u}ng{\\\"o}r, Orhan and {\\\"O}zkal, Erhan},\n  title        = {Effect of immobilization on catalytic characteristics of\n                  saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck}\n                  reactions},\n  journaltitle = jomch,\n  date         = 2006,\n  volume       = 691,\n  number       = 13,\n  pages        = {3027-3036},\n  indextitle   = {Effect of immobilization on catalytic characteristics},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Aksın\n    given: Özge\n  - family: Türkmen\n    given: Hayati\n  - family: Artok\n    given: Levent\n  - family: Çetinkaya\n    given: Bekir\n  - family: Ni\n    given: Chaoying\n  - family: Büyükgüngör\n    given: Orhan\n  - family: Özkal\n    given: Erhan\n  container-title: J. Organomet. Chem.\n  id: aksin\n  issue: 13\n  issued: 2006\n  page: 3027-3036\n  title: Effect of immobilization on catalytic characteristics of\n    saturated Pd-N-heterocyclic carbenes in Mizoroki-Heck reactions\n  type: article-journal\n  volume: 691\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-almendro.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Almendro et al. 1998)\n\nAlmendro, José L., Jacinto Martín, Alberto Sánchez, and Fernando Nozal.\n1998. “Elektromagnetisches Signalhorn.”\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Almendro, Martín, Sánchez, & Nozal, 1998)\n\nAlmendro, J. L., Martín, J., Sánchez, A., & Nozal, F. (1998).\nElektromagnetisches Signalhorn.\n\n\nNOTES:\n\n- CSL styles’ handling of patent items needs to be improved\n\n}\n\n@Patent{almendro,\n  author       = {Almendro, Jos{\\'e} L. and Mart{\\'i}n, Jacinto and S{\\'a}nchez,\n                  Alberto and Nozal, Fernando},\n  title        = {Elektromagnetisches Signalhorn},\n  number       = {EU-29702195U},\n  date         = 1998,\n  location     = {countryfr and countryuk and countryde},\n  hyphenation  = {german},\n  annotation   = {This is a patent entry with a location\n                  field. The number is given in the number field. Note\n                  the format of the location field in the database\n                  file. Compare laufenberg, sorace, and\n                  kowalik},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a patent entry with a location field. The number is\n    given in the number field. Note the format of the location field in\n    the database file. Compare laufenberg, sorace, and kowalik\n  author:\n  - family: Almendro\n    given: José L.\n  - family: Martín\n    given: Jacinto\n  - family: Sánchez\n    given: Alberto\n  - family: Nozal\n    given: Fernando\n  id: almendro\n  issued: 1998\n  jurisdiction: France; United Kingdom; Germany\n  language: de-DE\n  number: EU-29702195U\n  title: Elektromagnetisches Signalhorn\n  type: patent\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-angenendt.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Angenendt 2002)\n\nAngenendt, Arnold. 2002. “In Honore Salvatoris – Vom Sinn und Unsinn der\nPatrozinienkunde.” *Revue d’Histoire Ecclésiastique* 97: 431–456,\n791–823.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Angenendt, 2002)\n\nAngenendt, A. (2002). In Honore Salvatoris – Vom Sinn und Unsinn der\nPatrozinienkunde. *Revue d’Histoire Ecclésiastique*, *97*, 431–456,\n791–823.\n\n\n}\n\n@Article{angenendt,\n  author       = {Angenendt, Arnold},\n  title        = {In Honore Salvatoris~-- Vom Sinn und Unsinn der\n                  Patrozinienkunde},\n  journaltitle = {Revue d'Histoire Eccl{\\'e}siastique},\n  date         = 2002,\n  volume       = 97,\n  pages        = {431--456, 791--823},\n  hyphenation  = {german},\n  indextitle   = {In Honore Salvatoris},\n  shorttitle   = {In Honore Salvatoris},\n  annotation   = {A German article in a French journal. Apart from that, a\n                  typical article entry. Note the indextitle\n                  field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A German article in a French journal. Apart from that, a\n    typical article entry. Note the indextitle field\n  author:\n  - family: Angenendt\n    given: Arnold\n  container-title: Revue d'Histoire Eccl[é]{.nocase}siastique\n  id: angenendt\n  issued: 2002\n  language: de-DE\n  page: 431-456, 791-823\n  title: In Honore Salvatoris -- Vom Sinn und Unsinn der\n    Patrozinienkunde\n  title-short: In Honore Salvatoris\n  type: article-journal\n  volume: 97\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-aristotle-anima.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Aristotle 1907)\n\nAristotle. 1907. *De Anima*. Edited by Robert Drew Hicks. Cambridge:\nCambridge University Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Aristotle, 1907)\n\nAristotle. (1907). *De anima*. (R. D. Hicks, Ed.). Cambridge: Cambridge\nUniversity Press.\n\n\n}\n\n@string{ cup     = {Cambridge University Press} }\n\n@Book{aristotle:anima,\n  author       = {Aristotle},\n  title        = {De Anima},\n  date         = 1907,\n  editor       = {Hicks, Robert Drew},\n  publisher    = cup,\n  location     = {Cambridge},\n  keywords     = {primary},\n  hyphenation  = {british},\n  annotation   = {A book entry with an author and an\n                  editor},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with an author and an editor\n  author:\n  - family: Aristotle\n  editor:\n  - family: Hicks\n    given: Robert Drew\n  id: \"aristotle:anima\"\n  issued: 1907\n  keyword: primary\n  language: en-GB\n  publisher: Cambridge University Press\n  publisher-place: Cambridge\n  title: De anima\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-aristotle-physics.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Aristotle 1929)\n\nAristotle. 1929. *Physics*. Translated by P. H. Wicksteed and F. M.\nCornford. New York: G. P. Putnam.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Aristotle, 1929)\n\nAristotle. (1929). *Physics*. (P. H. Wicksteed & F. M. Cornford,\nTrans.). New York: G. P. Putnam.\n\n\n}\n\n@Book{aristotle:physics,\n  author       = {Aristotle},\n  title        = {Physics},\n  date         = 1929,\n  translator   = {Wicksteed, P. H. and Cornford, F. M.},\n  publisher    = {G. P. Putnam},\n  location     = {New York},\n  keywords     = {primary},\n  hyphenation  = {american},\n  shorttitle   = {Physics},\n  annotation   = {A book entry with a translator field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with a translator field\n  author:\n  - family: Aristotle\n  id: \"aristotle:physics\"\n  issued: 1929\n  keyword: primary\n  language: en-US\n  publisher: G. P. Putnam\n  publisher-place: New York\n  title: Physics\n  title-short: Physics\n  translator:\n  - family: Wicksteed\n    given: P. H.\n  - family: Cornford\n    given: F. M.\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-aristotle-poetics.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Aristotle 1968)\n\nAristotle. 1968. *Poetics*. Edited by D. W. Lucas. Clarendon Aristotle.\nOxford: Clarendon Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Aristotle, 1968)\n\nAristotle. (1968). *Poetics*. (D. W. Lucas, Ed.). Oxford: Clarendon\nPress.\n\n\n}\n\n@Book{aristotle:poetics,\n  author       = {Aristotle},\n  title        = {Poetics},\n  date         = 1968,\n  editor       = {Lucas, D. W.},\n  series       = {Clarendon {Aristotle}},\n  publisher    = {Clarendon Press},\n  location     = {Oxford},\n  keywords     = {primary},\n  hyphenation  = {british},\n  shorttitle   = {Poetics},\n  annotation   = {A book entry with an author and an\n                  editor as well as a series field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with an author and an editor as well as a series\n    field\n  author:\n  - family: Aristotle\n  collection-title: Clarendon Aristotle\n  editor:\n  - family: Lucas\n    given: D. W.\n  id: \"aristotle:poetics\"\n  issued: 1968\n  keyword: primary\n  language: en-GB\n  publisher: Clarendon Press\n  publisher-place: Oxford\n  title: Poetics\n  title-short: Poetics\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-aristotle-rhetoric.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Aristotle 1877)\n\nAristotle. 1877. *The Rhetoric of Aristotle with a Commentary by the\nLate Edward Meredith Cope*. Edited by Edward Meredith Cope. 3. Cambridge\nUniversity Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Aristotle, 1877)\n\nAristotle. (1877). *The rhetoric of Aristotle with a commentary by the\nlate Edward Meredith Cope*. (E. M. Cope, Ed.) (1-3). Cambridge\nUniversity Press.\n\n\nNOTES:\n\n- biblio2yaml\n\t- commentator has no counterpart in CSL\n\n}\n\n@string{ cup     = {Cambridge University Press} }\n\n@Book{aristotle:rhetoric,\n  author       = {Aristotle},\n  title        = {The Rhetoric of {Aristotle} with a commentary by the late {Edward\n                  Meredith Cope}},\n  date         = 1877,\n  editor       = {Cope, Edward Meredith},\n  commentator  = {Cope, Edward Meredith},\n  volumes      = 3,\n  publisher    = cup,\n  keywords     = {primary},\n  hyphenation  = {british},\n  sorttitle    = {Rhetoric of Aristotle},\n  indextitle   = {Rhetoric of {Aristotle}, The},\n  shorttitle   = {Rhetoric},\n  annotation   = {A commented edition. Note the concatenation of the\n                  editor and commentator fields as well as the\n                  volumes, sorttitle, and indextitle\n                  fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A commented edition. Note the concatenation of the editor and\n    commentator fields as well as the volumes, sorttitle, and indextitle\n    fields\n  author:\n  - family: Aristotle\n  editor:\n  - family: Cope\n    given: Edward Meredith\n  id: \"aristotle:rhetoric\"\n  issued: 1877\n  keyword: primary\n  language: en-GB\n  number-of-volumes: 3\n  publisher: Cambridge University Press\n  title: The rhetoric of Aristotle with a commentary by the late Edward\n    Meredith Cope\n  title-short: Rhetoric\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-article.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n    - contains:\n        - an article entry with just the required fields\n        - an article entry with required and all optional fields\n    - notes:\n        - year, month to be ignored if date is present\n        - journal to be ignored if journaltitle is present\n        - editortype, editoratype, editorbtype, editorctype, pubstate,\nseries contain keys which, unless corresponding CSL terms exist, require\nlocale-specific expansion\n    - limitations:\n        - annotator, commentator, eid, eprint, eprintclass, eprinttype,\nissuetitle, issuesubtitle, language, origlanguage have no matching\ncounterparts in CSL\n        - for editor, editora, editorb, editorc (plus editortype,\neditoratype, editorbtype, editorctype) only a subset, editor and director,\nhas matching counterparts in CSL\n    - kludges:\n        - note + addendum -> CSL note\n        - number + issue -> CSL issue\n        - handling of titleaddon\n        - handling of (journal) series\n            - done properly, this should be mapped to some CSL variable\n(version? edition? collection-number?), CSL styles would have to be adapted\n            - slightly better kludge would map integer to ordinal + \"ser.\"\n(\"3\" -> \"3rd ser.\"); localization keys \"newseries\" -> \"new ser.\",\n\"oldseries\" -> \"old ser.\"; and print all other values as is -- but still\nwouldn't fit all styles or locales.\n    }\n\n@article{article-req,\n    Author = {Author, Ann},\n    Date = {2013-07-29},\n    Hyphenation = {english},\n    Journaltitle = {The Journaltitle},\n    Title = {An Article Entry with Just the Required Fields}}\n\n@article{article-opt,\n    Addendum = {The Addendum},\n    Annotator = {Annotator, A.},\n    Author = {Author, Jr., Ann A.},\n    Commentator = {Commentator, C.},\n    Date = {2008-12-31},\n    Doi = {10.1086/520976},\n    Editor = {Editor, Edward},\n    Editora = {Editor, A.},\n    Editorb = {Editor, B.},\n    Editorc = {Editor, C.},\n    Eid = {eid},\n    Eprint = {eprint},\n    Eprintclass = {eprintclass},\n    Eprinttype = {eprinttype},\n    Hyphenation = {english},\n    Issn = {issn},\n    Issue = {issue},\n    Issuesubtitle = {The Issuesubtitle},\n    Issuetitle = {The Issuetitle},\n    Journalsubtitle = {The Journalsubtitle},\n    Journaltitle = {The Journaltitle},\n    Journal = {The Journal},\n    Language = {language},\n    Month = {08},\n    Year = {2007},\n    Note = {The Note},\n    Number = {number},\n    Origlanguage = {origlanguage},\n    Pages = {pages},\n    Pubstate = {inpress},\n    Series = {newseries},\n    Subtitle = {The Subtitle},\n    Title = {An Article Entry with the Required and All Optional Fields},\n    Titleaddon = {The Titleaddon},\n    Translator = {Translator, Ted},\n    Url = {http://foo.bar.baz/},\n    Urldate = {2013-07-29},\n    Version = {version},\n    Volume = {volume},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Ann\n  container-title: The Journaltitle\n  id: article-req\n  issued: 2013-07-29\n  language: en-US\n  title: An article entry with just the required fields\n  type: article-journal\n- accessed: 2013-07-29\n  author:\n  - family: Author\n    given: Ann A.\n    suffix: Jr.\n  collection-title: New series\n  container-title: \"The Journaltitle: The Journalsubtitle\"\n  doi: 10.1086/520976\n  editor:\n  - family: Editor\n    given: Edward\n  id: article-opt\n  issn: issn\n  issue: number, issue\n  issued: 2008-12-31\n  language: en-US\n  note: The Note. The Addendum\n  page: pages\n  status: in press\n  title: \"An article entry with the required and all optional fields:\n    The subtitle. The titleaddon\"\n  title-short: An article entry with the required and all optional\n    fields\n  translator:\n  - family: Translator\n    given: Ted\n  type: article-journal\n  url: \"http://foo.bar.baz/\"\n  version: version\n  volume: volume\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-augustine.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Augustine 1995)\n\nAugustine, Robert L. 1995. *Heterogeneous Catalysis for the Synthetic\nChemist*. New York: Marcel Dekker.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Augustine, 1995)\n\nAugustine, R. L. (1995). *Heterogeneous catalysis for the synthetic\nchemist*. New York: Marcel Dekker.\n\n\n}\n\n@Book{augustine,\n  author       = {Augustine, Robert L.},\n  title        = {Heterogeneous catalysis for the synthetic chemist},\n  date         = 1995,\n  publisher    = {Marcel Dekker},\n  location     = {New York},\n  hyphenation  = {american},\n  shorttitle   = {Heterogeneous catalysis},\n  annotation   = {A plain book entry},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A plain book entry\n  author:\n  - family: Augustine\n    given: Robert L.\n  id: augustine\n  issued: 1995\n  language: en-US\n  publisher: Marcel Dekker\n  publisher-place: New York\n  title: Heterogeneous catalysis for the synthetic chemist\n  title-short: Heterogeneous catalysis\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-averroes-bland.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Averroes 1982)\n\nAverroes. 1982. *The Epistle on the Possibility of Conjunction with the\nActive Intellect by Ibn Rushd with the Commentary of Moses Narboni*.\nKalman P. Bland. Moreshet: Studies in Jewish History, Literature and\nThought 7. New York: Jewish Theological Seminary of America.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Averroes, 1982)\n\nAverroes. (1982). *The epistle on the possibility of conjunction with\nthe active intellect by Ibn Rushd with the commentary of Moses Narboni*.\n(K. P. Bland). New York: Jewish Theological Seminary of America.\n\n\nNOTES:\n\n- citeproc\n\t- term \"edited and translated by\" missing\n\n}\n\n@Book{averroes-bland,\n  author       = {Averroes},\n  title        = {The Epistle on the Possibility of Conjunction with the Active\n                  Intellect by {Ibn Rushd} with the Commentary of {Moses Narboni}},\n  date         = 1982,\n  editor       = {Bland, Kalman P.},\n  translator   = {Bland, Kalman P.},\n  series       = {Moreshet: {Studies} in {Jewish} History, Literature and Thought},\n  number       = 7,\n  publisher    = {Jewish Theological Seminary of America},\n  location     = {New York},\n  keywords     = {primary},\n  hyphenation  = {american},\n  indextitle   = {Epistle on the Possibility of Conjunction, The},\n  shorttitle   = {Possibility of Conjunction},\n  annotation   = {A book entry with a series and a\n                  number. Note the concatenation of the editor\n                  and translator fields as well as the\n                  indextitle field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with a series and a number. Note the\n    concatenation of the editor and translator fields as well as the\n    indextitle field\n  author:\n  - family: Averroes\n  collection-number: 7\n  collection-title: \"Moreshet: Studies in Jewish history, literature and\n    thought\"\n  editor:\n  - family: Bland\n    given: Kalman P.\n  id: averroes-bland\n  issued: 1982\n  keyword: primary\n  language: en-US\n  publisher: Jewish Theological Seminary of America\n  publisher-place: New York\n  title: The epistle on the possibility of conjunction with the active\n    intellect by Ibn Rushd with the commentary of Moses Narboni\n  title-short: Possibility of conjunction\n  translator:\n  - family: Bland\n    given: Kalman P.\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-averroes-hannes.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Averroes 1892)\n\nAverroes. 1892. *Des Averroës Abhandlung: “Über die Möglichkeit der\nConjunktion” oder “Über den materiellen Intellekt”*. Ludwig Hannes.\nHalle an der Saale: C. A. Kaemmerer.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Averroes, 1892)\n\nAverroes. (1892). *Des Averroës Abhandlung: “Über die Möglichkeit der\nConjunktion” oder “Über den materiellen Intellekt”*. (L. Hannes). Halle\nan der Saale: C. A. Kaemmerer.\n\n\nNOTES:\n\n- citeproc\n\t- term \"edited and translated by\" missing\n\n}\n\n@Book{averroes-hannes,\n  author       = {Averroes},\n  title        = {Des Averro{\\\"e}s Abhandlung: \\mkbibquote{{\\\"U}ber die\n                  M{\\\"o}glichkeit der Conjunktion} oder \\mkbibquote{{\\\"U}ber den\n                  materiellen Intellekt}},\n  date         = 1892,\n  editor       = {Hannes, Ludwig},\n  translator   = {Hannes, Ludwig},\n  annotator    = {Hannes, Ludwig},\n  publisher    = {C.~A. Kaemmerer},\n  location     = {Halle an der Saale},\n  keywords     = {primary},\n  hyphenation  = {german},\n  sorttitle    = {Uber die Moglichkeit der Conjunktion},\n  indexsorttitle= {Uber die Moglichkeit der Conjunktion},\n  indextitle   = {{\\\"U}ber die M{\\\"o}glichkeit der Conjunktion},\n  shorttitle   = {{\\\"U}ber die M{\\\"o}glichkeit der Conjunktion},\n  annotation   = {An annotated edition. Note the concatenation of the\n                  editor, translator, and annotator\n                  fields. Also note the shorttitle,\n                  indextitle, sorttitle, and\n                  indexsorttitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An annotated edition. Note the concatenation of the editor,\n    translator, and annotator fields. Also note the shorttitle,\n    indextitle, sorttitle, and indexsorttitle fields\n  author:\n  - family: Averroes\n  editor:\n  - family: Hannes\n    given: Ludwig\n  id: averroes-hannes\n  issued: 1892\n  keyword: primary\n  language: de-DE\n  publisher: C. A. Kaemmerer\n  publisher-place: Halle an der Saale\n  title: \"Des Averroës Abhandlung: \\\"Über die Möglichkeit der\n    Conjunktion\\\" oder \\\"Über den materiellen Intellekt\\\"\"\n  title-short: Über die Möglichkeit der Conjunktion\n  translator:\n  - family: Hannes\n    given: Ludwig\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-averroes-hercz.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Averroes 1869)\n\nAverroes. 1869. *Drei Abhandlungen über die Conjunction des separaten\nIntellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem\nArabischen übersetzt von Samuel Ibn Tibbon*. J. Hercz. Berlin:\nS. Hermann.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Averroes, 1869)\n\nAverroes. (1869). *Drei Abhandlungen über die Conjunction des separaten\nIntellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem\nArabischen übersetzt von Samuel Ibn Tibbon*. (J. Hercz). Berlin:\nS. Hermann.\n\n\nNOTES:\n\n- citeproc\n\t- term \"edited and translated by\" missing\n\n}\n\n@Book{averroes-hercz,\n  author       = {Averroes},\n  title        = {Drei Abhandlungen {\\\"u}ber die Conjunction des separaten\n                  Intellects mit dem Menschen},\n  date         = 1869,\n  editor       = {Hercz, J.},\n  translator   = {Hercz, J.},\n  publisher    = {S.~Hermann},\n  location     = {Berlin},\n  keywords     = {primary},\n  hyphenation  = {german},\n  indexsorttitle= {Drei Abhandlungen uber die Conjunction},\n  indextitle   = {Drei Abhandlungen {\\\"u}ber die Conjunction},\n  subtitle     = {Von Averroes (Vater und Sohn), aus dem Arabischen\n                  {\\\"u}bersetzt von Samuel Ibn Tibbon},\n  shorttitle   = {Drei Abhandlungen},\n  annotation   = {A book entry. Note the concatenation of the\n                  editor and translator fields as well as the\n                  indextitle and indexsorttitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry. Note the concatenation of the editor and\n    translator fields as well as the indextitle and indexsorttitle\n    fields\n  author:\n  - family: Averroes\n  editor:\n  - family: Hercz\n    given: J.\n  id: averroes-hercz\n  issued: 1869\n  keyword: primary\n  language: de-DE\n  publisher: S. Hermann\n  publisher-place: Berlin\n  title: \"Drei Abhandlungen über die Conjunction des separaten\n    Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem\n    Arabischen übersetzt von Samuel Ibn Tibbon\"\n  title-short: Drei Abhandlungen\n  translator:\n  - family: Hercz\n    given: J.\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-baez-article.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Baez and Lauda 2004)\n\nBaez, John C., and Aaron D. Lauda. 2004. “Higher-dimensional Algebra V:\n2-groups” (version 3). *Theory and Applications of Categories* 12:\n423–491.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Baez & Lauda, 2004)\n\nBaez, J. C., & Lauda, A. D. (2004). Higher-dimensional algebra V:\n2-groups. *Theory and Applications of Categories*, *12*, 423–491.\n\n\nNOTES:\n\n- biblio2yaml\n\t- eprint: see baez-online\n\n}\n\n@Article{baez-article,\n  author       = {Baez, John C. and Lauda, Aaron D.},\n  title        = {Higher-Dimensional Algebra {V}: 2-Groups},\n  journaltitle = {Theory and Applications of Categories},\n  date         = 2004,\n  volume       = 12,\n  pages        = {423-491},\n  version      = 3,\n  eprint       = {math/0307200v3},\n  eprinttype   = {arxiv},\n  hyphenation  = {american},\n  annotation   = {An article with eprint and\n                  eprinttype fields. Note that the arXiv reference is\n                  transformed into a clickable link if hyperref support\n                  has been enabled.  Compare baez\\slash online, which\n                  is the same item given as an online entry},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article with eprint and eprinttype fields. Note that the\n    arXiv reference is transformed into a clickable link if hyperref\n    support has been enabled. Compare baez/online, which is the same\n    item given as an online entry\n  author:\n  - family: Baez\n    given: John C.\n  - family: Lauda\n    given: Aaron D.\n  container-title: Theory and Applications of Categories\n  id: baez-article\n  issued: 2004\n  language: en-US\n  page: 423-491\n  title: \"Higher-dimensional algebra V: 2-groups\"\n  title-short: Higher-dimensional algebra V\n  type: article-journal\n  url: \"https://arxiv.org/abs/math/0307200v3\"\n  version: 3\n  volume: 12\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-baez-online.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Baez and Lauda 2004)\n\nBaez, John C., and Aaron D. Lauda. 2004. “Higher-dimensional Algebra V:\n2-groups” (version 3). October 27.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Baez & Lauda, 2004)\n\nBaez, J. C., & Lauda, A. D. (2004, October 27). Higher-dimensional\nalgebra V: 2-groups.\n\n\nNOTES:\n\n- biblio2yaml:\n\t- eprinttype = {arxiv}, eprint = {math/0307200v3}, \n\t  should be converted to a url: http://arxiv.org/abs/math/0307200v3\n\t  (prefix http://arxiv.org/abs/ seems to work for all arxiv material)\n\n}\n\n@Online{baez-online,\n  author       = {Baez, John C. and Lauda, Aaron D.},\n  title        = {Higher-Dimensional Algebra {V}: 2-Groups},\n  date         = {2004-10-27},\n  version      = 3,\n  hyphenation  = {american},\n  eprinttype   = {arxiv},\n  eprint       = {math/0307200v3},\n  annotation   = {An online reference from arXiv. Note the\n                  eprint and eprinttype fields. Compare\n                  baez\\slash article which is the same item given as an\n                  article entry with eprint information},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An online reference from arXiv. Note the eprint and eprinttype\n    fields. Compare baez/article which is the same item given as an\n    article entry with eprint information\n  author:\n  - family: Baez\n    given: John C.\n  - family: Lauda\n    given: Aaron D.\n  id: baez-online\n  issued: 2004-10-27\n  language: en-US\n  title: \"Higher-dimensional algebra V: 2-groups\"\n  title-short: Higher-dimensional algebra V\n  type: webpage\n  url: \"https://arxiv.org/abs/math/0307200v3\"\n  version: 3\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-basic.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@Book{item1,\nauthor=\"John Doe\",\ntitle=\"First Book\",\nyear=\"2005\",\naddress=\"Cambridge\",\npublisher=\"Cambridge University Press\"\n}\n\n@Article{item2,\nauthor=\"John Doe\",\ntitle=\"Article\",\nyear=\"2006\",\njournal=\"Journal of Generic Studies\",\nvolume=\"6\",\npages=\"33-34\"\n}\n\n@InCollection{пункт3,\nauthor=\"John Doe and Jenny Roe\",\ntitle=\"Why Water Is Wet\",\nbooktitle=\"Third Book\",\neditor=\"Sam Smith\",\npublisher=\"Oxford University Press\",\naddress=\"Oxford\",\nyear=\"2007\"\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Doe\n    given: John\n  id: item1\n  issued: 2005\n  publisher: Cambridge University Press\n  publisher-place: Cambridge\n  title: First book\n  type: book\n- author:\n  - family: Doe\n    given: John\n  container-title: Journal of Generic Studies\n  id: item2\n  issued: 2006\n  page: 33-34\n  title: Article\n  type: article-journal\n  volume: 6\n- author:\n  - family: Doe\n    given: John\n  - family: Roe\n    given: Jenny\n  container-title: Third book\n  editor:\n  - family: Smith\n    given: Sam\n  id: пункт3\n  issued: 2007\n  publisher: Oxford University Press\n  publisher-place: Oxford\n  title: Why water is wet\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-bertram.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Bertram and Wentworth 1996)\n\nBertram, Aaron, and Richard Wentworth. 1996. “Gromov Invariants for\nHolomorphic Maps on Riemann Surfaces.” *J. Amer. Math. Soc.* 9 (2):\n529–571.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Bertram & Wentworth, 1996)\n\nBertram, A., & Wentworth, R. (1996). Gromov invariants for holomorphic\nmaps on Riemann surfaces. *J. Amer. Math. Soc.*, *9*(2), 529–571.\n\n\n}\n\n@string{ jams    = {J.~Amer. Math. Soc.} }\n\n@Article{bertram,\n  author       = {Bertram, Aaron and Wentworth, Richard},\n  title        = {Gromov invariants for holomorphic maps on {Riemann} surfaces},\n  journaltitle = jams,\n  date         = 1996,\n  volume       = 9,\n  number       = 2,\n  pages        = {529-571},\n  hyphenation  = {american},\n  shorttitle   = {Gromov invariants},\n  annotation   = {An article entry with a volume and a\n                  number field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry with a volume and a number field\n  author:\n  - family: Bertram\n    given: Aaron\n  - family: Wentworth\n    given: Richard\n  container-title: J. Amer. Math. Soc.\n  id: bertram\n  issue: 2\n  issued: 1996\n  language: en-US\n  page: 529-571\n  title: Gromov invariants for holomorphic maps on Riemann surfaces\n  title-short: Gromov invariants\n  type: article-journal\n  volume: 9\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-bibstring-resolution.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@book{item1,\n\tTitle = {The Title: \\bibstring{newseries}},\n        Hyphenation = {english}\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- id: item1\n  language: en-US\n  title: \"The title: New series\"\n  title-short: The title\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-book-averroes.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\nadapted from\nhttp://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@book{averroes/bland,\n\tAnnotation = {A book entry with a series and a number. Note the concatenation of the editor and translator fields as well as the indextitle field},\n\tAuthor = {Averroes},\n\tDate = 1982,\n\tEditor = {Bland, Kalman P.},\n\tHyphenation = {american},\n\tIndextitle = {Epistle on the Possibility of Conjunction, The},\n\tKeywords = {primary},\n\tLocation = {New York},\n\tNumber = 7,\n\tPublisher = {Jewish Theological Seminary of America},\n\tSeries = {{Moreshet: Studies in Jewish History, Literature and Thought}},\n\tShorttitle = {Possibility of Conjunction},\n\tTitle = {The Epistle on the Possibility of Conjunction with the Active Intellect by {Ibn Rushd} with the Commentary of {Moses Narboni}},\n\tTranslator = {Bland, Kalman P.}}\n\n@book{averroes/hannes,\n\tAnnotation = {An annotated edition. Note the concatenation of the editor, translator, and annotator fields. Also note the shorttitle, indextitle, sorttitle, and indexsorttitle fields},\n\tAnnotator = {Hannes, Ludwig},\n\tAuthor = {Averroes},\n\tDate = 1892,\n\tEditor = {Hannes, Ludwig},\n\tHyphenation = {german},\n\tIndexsorttitle = {Uber die Moglichkeit der Conjunktion},\n\tIndextitle = {Über die Möglichkeit der Conjunktion},\n\tKeywords = {primary},\n\tLocation = {Halle an der Saale},\n\tPublisher = {C.~A. Kaemmerer},\n\tShorttitle = {Über die Möglichkeit der Conjunktion},\n\tSorttitle = {Uber die Moglichkeit der Conjunktion},\n\tTitle = {Des Averroës Abhandlung: \\mkbibquote{Über die Möglichkeit der Conjunktion} oder \\mkbibquote{Über den materiellen Intellekt}},\n\tTranslator = {Hannes, Ludwig}}\n\n@book{averroes/hercz,\n\tAnnotation = {A book entry. Note the concatenation of the editor and translator fields as well as the indextitle and indexsorttitle fields},\n\tAuthor = {Averroes},\n\tDate = 1869,\n\tEditor = {Hercz, J.},\n\tHyphenation = {german},\n\tIndexsorttitle = {Drei Abhandlungen uber die Conjunction},\n\tIndextitle = {Drei Abhandlungen über die Conjunction},\n\tKeywords = {primary},\n\tLocation = {Berlin},\n\tPublisher = {S.~Hermann},\n\tShorttitle = {Drei Abhandlungen},\n\tSubtitle = {Von Averroes (Vater und Sohn), aus dem Arabischen übersetzt von Samuel Ibn Tibbon},\n\tTitle = {Drei Abhandlungen über die Conjunction des separaten Intellects mit dem Menschen},\n\tTranslator = {Hercz, J.}}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with a series and a number. Note the\n    concatenation of the editor and translator fields as well as the\n    indextitle field\n  author:\n  - family: Averroes\n  collection-number: 7\n  collection-title: \"[Moreshet: Studies in Jewish History, Literature\n    and Thought]{.nocase}\"\n  editor:\n  - family: Bland\n    given: Kalman P.\n  id: averroes/bland\n  issued: 1982\n  keyword: primary\n  language: en-US\n  publisher: Jewish Theological Seminary of America\n  publisher-place: New York\n  title: The epistle on the possibility of conjunction with the active\n    intellect by Ibn Rushd with the commentary of Moses Narboni\n  title-short: Possibility of conjunction\n  translator:\n  - family: Bland\n    given: Kalman P.\n  type: book\n- annote: An annotated edition. Note the concatenation of the editor,\n    translator, and annotator fields. Also note the shorttitle,\n    indextitle, sorttitle, and indexsorttitle fields\n  author:\n  - family: Averroes\n  editor:\n  - family: Hannes\n    given: Ludwig\n  id: averroes/hannes\n  issued: 1892\n  keyword: primary\n  language: de-DE\n  publisher: C. A. Kaemmerer\n  publisher-place: Halle an der Saale\n  title: \"Des Averroës Abhandlung: \\\"Über die Möglichkeit der\n    Conjunktion\\\" oder \\\"Über den materiellen Intellekt\\\"\"\n  title-short: Über die Möglichkeit der Conjunktion\n  translator:\n  - family: Hannes\n    given: Ludwig\n  type: book\n- annote: A book entry. Note the concatenation of the editor and\n    translator fields as well as the indextitle and indexsorttitle\n    fields\n  author:\n  - family: Averroes\n  editor:\n  - family: Hercz\n    given: J.\n  id: averroes/hercz\n  issued: 1869\n  keyword: primary\n  language: de-DE\n  publisher: S. Hermann\n  publisher-place: Berlin\n  title: \"Drei Abhandlungen über die Conjunction des separaten\n    Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem\n    Arabischen übersetzt von Samuel Ibn Tibbon\"\n  title-short: Drei Abhandlungen\n  translator:\n  - family: Hercz\n    given: J.\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-book-coleridge.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\nTODO (as a stopgap):\nCombine biblatex “volume = 7” and “part = 2” to CSL “volume: 7.2”\n\n}\n\n@book{coleridge,\n\tAnnotation = {One (partial) volume of a multivolume book. This is a book entry with a volume and a part field which explicitly refers to the second (physical) part of the seventh (logical) volume. Also note the series and number fields},\n\tAuthor = {Coleridge, Samuel Taylor},\n\tDate = 1983,\n\tEditor = {Coburn, Kathleen and Engell, James and Bate, W. Jackson},\n\tHyphenation = {british},\n\tIndextitle = {Biographia literaria},\n\tLocation = {London},\n\tMaintitle = {The collected works of {Samuel Taylor Coleridge}},\n\tNumber = 75,\n\tPart = 2,\n\tPublisher = {Routledge {and} Kegan Paul},\n\tSeries = {Bollingen Series},\n\tShorttitle = {Biographia literaria},\n\tTitle = {Biographia literaria, or {Biographical} sketches of my literary life and opinions},\n\tVolume = 7}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: One (partial) volume of a multivolume book. This is a book\n    entry with a volume and a part field which explicitly refers to the\n    second (physical) part of the seventh (logical) volume. Also note\n    the series and number fields\n  author:\n  - family: Coleridge\n    given: Samuel Taylor\n  collection-number: 75\n  collection-title: Bollingen series\n  editor:\n  - family: Coburn\n    given: Kathleen\n  - family: Engell\n    given: James\n  - family: Bate\n    given: W. Jackson\n  id: coleridge\n  issued: 1983\n  language: en-GB\n  publisher: Routledge and Kegan Paul\n  publisher-place: London\n  title: The collected works of Samuel Taylor Coleridge\n  type: book\n  volume: 7.2\n  volume-title: Biographia literaria, or Biographical sketches of my\n    literary life and opinions\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-book-title-maintitle-series.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@book{item1,\n\tAuthor = {Author, Al},\n\tDate = {2013},\n\tHyphenation = {french},\n\tLocation = {Location},\n\tMainsubtitle = {Mainsubtitle},\n\tMaintitle = {Maintitle},\n\tMaintitleaddon = {Maintitleaddon},\n\tNumber = {3},\n\tPublisher = {Publisher},\n\tSeries = {Series},\n\tSubtitle = {Subtitle},\n\tTitle = {Title of the Book},\n\tTitleaddon = {Titleaddon},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Al\n  collection-number: 3\n  collection-title: Series\n  id: item1\n  issued: 2013\n  language: fr-FR\n  publisher: Publisher\n  publisher-place: Location\n  title: \"Maintitle: Mainsubtitle. Maintitleaddon\"\n  type: book\n  volume-title: \"Title of the Book: Subtitle. Titleaddon\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-book-vazques-de-parga.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{excerpted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\nNote handling of Author = {Vázques{ de }Parga, Luis}\n\n}\n\n@book{vazques-de-parga,\n\tAnnotation = {A multivolume book cited as a whole. This is a book entry with volumes, note, sorttitle, and indextitle fields},\n\tAuthor = {Vázques{ de }Parga, Luis and Lacarra, José María and Uría Ríu, Juan},\n\tDate = 1993,\n\tHyphenation = {spanish},\n\tIndextitle = {Peregrinaciones a Santiago de Compostela, Las},\n\tLocation = {Pamplona},\n\tNote = {Ed. facs. de la realizada en 1948--49},\n\tPublisher = {Iberdrola},\n\tShorttitle = {Peregrinaciones},\n\tSorttitle = {Peregrinaciones a Santiago de Compostela},\n\tTitle = {Las Peregrinaciones a Santiago de Compostela},\n\tVolumes = 3}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A multivolume book cited as a whole. This is a book entry with\n    volumes, note, sorttitle, and indextitle fields\n  author:\n  - family: Vázques de Parga\n    given: Luis\n  - family: Lacarra\n    given: José María\n  - family: Uría Ríu\n    given: Juan\n  id: vazques-de-parga\n  issued: 1993\n  language: es-ES\n  note: Ed. facs. de la realizada en 1948--49\n  number-of-volumes: 3\n  publisher: Iberdrola\n  publisher-place: Pamplona\n  title: Las Peregrinaciones a Santiago de Compostela\n  title-short: Peregrinaciones\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-brandt.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Brandt and Hoffmann 1987)\n\nBrandt, Ahasver von, and Erich Hoffmann. 1987. “Die nordischen Länder\nvon der Mitte des 11. Jahrhunderts bis 1448.” In *Europa im Hoch- und\nSpätmittelalter*, edited by Ferdinand Seibt, 884–917. Handbuch der\neuropäischen Geschichte 2. Stuttgart: Klett-Cotta.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Brandt & Hoffmann, 1987)\n\nBrandt, A. von, & Hoffmann, E. (1987). Die nordischen Länder von der\nMitte des 11. Jahrhunderts bis 1448. In F. Seibt (ed.), *Europa im Hoch-\nund Spätmittelalter* (pp. 884–917). Stuttgart: Klett-Cotta.\n\n\n}\n\n@InCollection{brandt,\n  author       = {von Brandt, Ahasver and Erich Hoffmann},\n  editor       = {Ferdinand Seibt},\n  title        = {Die nordischen L{\\\"a}nder von der Mitte des 11.~Jahrhunderts\n                  bis 1448},\n  date         = 1987,\n  booktitle    = {Europa im Hoch- und Sp{\\\"a}tmittelalter},\n  series       = {Handbuch der europ{\\\"a}ischen Geschichte},\n  number       = 2,\n  publisher    = {Klett-Cotta},\n  location     = {Stuttgart},\n  pages        = {884-917},\n  options      = {useprefix=false},\n  hyphenation  = {german},\n  indexsorttitle= {Nordischen Lander von der Mitte des 11. Jahrhunderts bis\n                  1448},\n  indextitle   = {Nordischen L{\\\"a}nder von der Mitte des 11.~Jahrhunderts bis\n                  1448, Die},\n  shorttitle   = {Die nordischen L{\\\"a}nder},\n  annotation   = {An incollection entry with a series and a\n                  number. Note the format of the printed name and\n                  compare the useprefix option in the options\n                  field as well as vangennep. Also note the\n                  indextitle, and indexsorttitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An incollection entry with a series and a number. Note the\n    format of the printed name and compare the useprefix option in the\n    options field as well as vangennep. Also note the indextitle, and\n    indexsorttitle fields\n  author:\n  - dropping-particle: von\n    family: Brandt\n    given: Ahasver\n  - family: Hoffmann\n    given: Erich\n  collection-number: 2\n  collection-title: Handbuch der europäischen Geschichte\n  container-title: Europa im Hoch- und Spätmittelalter\n  editor:\n  - family: Seibt\n    given: Ferdinand\n  id: brandt\n  issued: 1987\n  language: de-DE\n  page: 884-917\n  publisher: Klett-Cotta\n  publisher-place: Stuttgart\n  title: Die nordischen Länder von der Mitte des 11. Jahrhunderts bis\n    1448\n  title-short: Die nordischen Länder\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-britannica.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Preece 2003)\n\nPreece, Warren E., ed. 2003. *The New EncyclopæDia Britannica*. 15th ed.\n32. Chicago, Ill.: Encyclopædia Britannica.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Preece, 2003)\n\nPreece, W. E. (Ed.). (2003). *The new encyclopædia Britannica* (15th\ned., 1-32). Chicago, Ill.: Encyclopædia Britannica.\n\n\nNOTES:\n\n- biblio2yaml\n\t- spurious <span> in Encyclopædia\n\t- options = {useeditor=false} has no equivalent in CSL, so citing and alphabetizing by title even though there is an editor does not seem to be possible\n\n- citeproc\n\t- incorrect camel case: \"EncyclopæDia\"\n\t- term \"vols.\" missing\n\n}\n\n@Collection{britannica,\n  editor       = {Preece, Warren E.},\n  title        = {The New Encyclop{\\ae}dia {Britannica}},\n  date         = 2003,\n  edition      = 15,\n  volumes      = 32,\n  publisher    = {Encyclop{\\ae}dia Britannica},\n  location     = {Chicago, Ill.},\n  options      = {useeditor=false},\n  label        = {EB},\n  hyphenation  = {british},\n  sorttitle    = {Encyclop{\\ae}dia Britannica},\n  indextitle   = {Encyclop{\\ae}dia Britannica, The New},\n  shorttitle   = {Encyclop{\\ae}dia {Britannica}},\n  annotation   = {This is a collection entry for an encyclopedia. Note\n                  the useeditor option in the options field as\n                  well as the sorttitle field. We want this entry to be\n                  cited and alphabetized by title even though there is an\n                  editor. In addition to that, we want the title to be\n                  alphabetized under \\enquote*{E} rather than \\enquote*{T}. Also\n                  note the label field which is provided for\n                  author-year citation styles},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a collection entry for an encyclopedia. Note the\n    useeditor option in the options field as well as the sorttitle\n    field. We want this entry to be cited and alphabetized by title even\n    though there is an editor. In addition to that, we want the title to\n    be alphabetized under 'E' rather than 'T'. Also note the label field\n    which is provided for author-year citation styles\n  edition: 15\n  editor:\n  - family: Preece\n    given: Warren E.\n  id: britannica\n  issued: 2003\n  language: en-GB\n  number-of-volumes: 32\n  publisher: Encyclopædia Britannica\n  publisher-place: Chicago, Ill.\n  title: The new encyclopædia Britannica\n  title-short: Encyclopædia Britannica\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-chiu.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Chiu and Chow 1978)\n\nChiu, Willy W., and We Min Chow. 1978. “A Hybrid Hierarchical Model of a\nMultiple Virtual Storage (MVS) Operating System.” Research report\nRC-6947. IBM.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Chiu & Chow, 1978)\n\nChiu, W. W., & Chow, W. M. (1978). *A hybrid hierarchical model of a\nmultiple virtual storage (MVS) operating system* (research report No.\nRC-6947). IBM.\n\n\nNOTES:\n\n- biblio2yaml\n\t- \"MVS\", when not wrapped in {}, gives \"mVS\", which is probably never intended, or useful (latex converts the whole word to lowercase if unprotected (\"MVS\" -> \"mvs\"))\n\n}\n\n@Report{chiu,\n  author       = {Chiu, Willy W. and Chow, We Min},\n  title        = {A Hybrid Hierarchical Model of a Multiple Virtual Storage\n                  ({MVS}) Operating System},\n  type         = {resreport},\n  institution  = {IBM},\n  date         = 1978,\n  number       = {RC-6947},\n  hyphenation  = {american},\n  sorttitle    = {Hybrid Hierarchical Model of a Multiple Virtual Storage (MVS)\n                  Operating System},\n  indextitle   = {Hybrid Hierarchical Model, A},\n  annotation   = {This is a report entry for a research report. Note\n                  the format of the type field in the database file\n                  which uses a localization key. The number of the report is\n                  given in the number field. Also note the\n                  sorttitle and indextitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a report entry for a research report. Note the format\n    of the type field in the database file which uses a localization\n    key. The number of the report is given in the number field. Also\n    note the sorttitle and indextitle fields\n  author:\n  - family: Chiu\n    given: Willy W.\n  - family: Chow\n    given: We Min\n  genre: research report\n  id: chiu\n  issued: 1978\n  language: en-US\n  number: RC-6947\n  publisher: IBM\n  title: A hybrid hierarchical model of a multiple virtual storage (MVS)\n    operating system\n  type: report\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-cicero.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Cicero 1995)\n\nCicero, Marcus Tullius. 1995. *De natura deorum. Über das Wesen der\nGötter*. Ursula Blank-Sangmeister. Stuttgart: Reclam.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Cicero, 1995)\n\nCicero, M. T. (1995). *De natura deorum. Über das Wesen der Götter*. (U.\nBlank-Sangmeister). Stuttgart: Reclam.\n\n\nNOTES:\n\n- biblio2yaml\n\t- afterword, language: no CSL variables available\n\n- citeproc:\n\t- term such as \"edited and translated by\" should appear\n\n}\n\n@Book{cicero,\n  author       = {Cicero, Marcus Tullius},\n  title        = {De natura deorum. {\\\"U}ber das Wesen der G{\\\"o}tter},\n  date         = 1995,\n  editor       = {Blank-Sangmeister, Ursula},\n  translator   = {Blank-Sangmeister, Ursula},\n  afterword    = {Thraede, Klaus},\n  language     = {langlatin and langgerman},\n  publisher    = {Reclam},\n  location     = {Stuttgart},\n  hyphenation  = {german},\n  indextitle   = {De natura deorum},\n  shorttitle   = {De natura deorum},\n  annotation   = {A bilingual edition of Cicero's \\emph{De natura deorum}, with\n                  a German translation. Note the format of the language\n                  field in the database file, the concatenation of the\n                  editor and translator fields, and the\n                  afterword field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A bilingual edition of Cicero's *De natura deorum*, with a\n    German translation. Note the format of the language field in the\n    database file, the concatenation of the editor and translator\n    fields, and the afterword field\n  author:\n  - family: Cicero\n    given: Marcus Tullius\n  editor:\n  - family: Blank-Sangmeister\n    given: Ursula\n  id: cicero\n  issued: 1995\n  language: de-DE\n  publisher: Reclam\n  publisher-place: Stuttgart\n  title: De natura deorum. Über das Wesen der Götter\n  title-short: De natura deorum\n  translator:\n  - family: Blank-Sangmeister\n    given: Ursula\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-cms.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(*The Chicago Manual of Style: The Essential Guide for Writers, Editors,\nand Publishers* 2003)\n\n*The Chicago Manual of Style: The Essential Guide for Writers, Editors,\nand Publishers*. 2003. 15th ed. Chicago, Ill.: University of Chicago\nPress.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(*Chicago manual of style*, 2003)\n\n*The Chicago manual of style: The essential guide for writers, editors,\nand publishers*. (2003) (15th ed.). Chicago, Ill.: University of Chicago\nPress.\n\n\nNOTES:\n\n- chicago-author-date.csl should have as in-text citation: \n  (*Chicago Manual of Style* 2003)\n  Same behaviour in Zotero; most probably a style file issue.\n\n}\n\n@Manual{cms,\n  title        = {The {Chicago} Manual of Style},\n  date         = 2003,\n  subtitle     = {The Essential Guide for Writers, Editors, and Publishers},\n  edition      = 15,\n  publisher    = {University of Chicago Press},\n  location     = {Chicago, Ill.},\n  isbn         = {0-226-10403-6},\n  label        = {CMS},\n  hyphenation  = {american},\n  sorttitle    = {Chicago Manual of Style},\n  indextitle   = {Chicago Manual of Style, The},\n  shorttitle   = {Chicago Manual of Style},\n  annotation   = {This is a manual entry without an author or\n                  editor. Note the label field in the database\n                  file which is provided for author-year citation styles. Also\n                  note the sorttitle and indextitle fields. By\n                  default, all entries without an author or\n                  editor are alphabetized by title but we want\n                  this entry to be alphabetized under \\enquote*{C} rather than\n                  \\enquote*{T}. There's also an isbn field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a manual entry without an author or editor. Note the\n    label field in the database file which is provided for author-year\n    citation styles. Also note the sorttitle and indextitle fields. By\n    default, all entries without an author or editor are alphabetized by\n    title but we want this entry to be alphabetized under 'C' rather\n    than 'T'. There's also an isbn field\n  edition: 15\n  id: cms\n  isbn: 0-226-10403-6\n  issued: 2003\n  language: en-US\n  publisher: University of Chicago Press\n  publisher-place: Chicago, Ill.\n  title: \"The Chicago manual of style: The essential guide for writers,\n    editors, and publishers\"\n  title-short: Chicago manual of style\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-coleridge.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2015-03-08:\n\n(Coleridge 1983)\n\nColeridge, Samuel Taylor. 1983. *The Collected Works of Samuel Taylor\nColeridge*. Edited by Kathleen Coburn, James Engell, and W. Jackson\nBate. Vol. 7.2. Bollingen Series 75. London: Routledge and Kegan Paul.\n\nFormatted with pandoc and apa.csl, 2015-03-08:\n\n(Coleridge, 1983)\n\nColeridge, S. T. (1983). *The collected works of Samuel Taylor\nColeridge*. (K. Coburn, J. Engell, & W. J. Bate, Eds.) (Vol. 7.2).\nLondon: Routledge and Kegan Paul.\n\nNOTES:\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@Book{coleridge,\n  author       = {Coleridge, Samuel Taylor},\n  title        = {Biographia literaria, or {Biographical} sketches of my literary\n                  life and opinions},\n  date         = 1983,\n  editor       = {Coburn, Kathleen and Engell, James and Bate, W. Jackson},\n  maintitle    = {The collected works of {Samuel Taylor Coleridge}},\n  volume       = 7,\n  part         = 2,\n  series       = {Bollingen Series},\n  number       = 75,\n  publisher    = {Routledge {and} Kegan Paul},\n  location     = {London},\n  hyphenation  = {british},\n  indextitle   = {Biographia literaria},\n  shorttitle   = {Biographia literaria},\n  annotation   = {One (partial) volume of a multivolume book. This is a\n                  book entry with a volume and a part\n                  field which explicitly refers to the second (physical) part of\n                  the seventh (logical) volume. Also note the series\n                  and number fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: One (partial) volume of a multivolume book. This is a book\n    entry with a volume and a part field which explicitly refers to the\n    second (physical) part of the seventh (logical) volume. Also note\n    the series and number fields\n  author:\n  - family: Coleridge\n    given: Samuel Taylor\n  collection-number: 75\n  collection-title: Bollingen series\n  editor:\n  - family: Coburn\n    given: Kathleen\n  - family: Engell\n    given: James\n  - family: Bate\n    given: W. Jackson\n  id: coleridge\n  issued: 1983\n  language: en-GB\n  publisher: Routledge and Kegan Paul\n  publisher-place: London\n  title: The collected works of Samuel Taylor Coleridge\n  type: book\n  volume: 7.2\n  volume-title: Biographia literaria, or Biographical sketches of my\n    literary life and opinions\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-companion.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Goossens, Mittelbach, and Samarin 1994)\n\nGoossens, Michel, Frank Mittelbach, and Alexander Samarin. 1994. *The\nLaTeX Companion*. 1st ed. Reading, Mass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Goossens, Mittelbach, & Samarin, 1994)\n\nGoossens, M., Mittelbach, F., & Samarin, A. (1994). *The LaTeX\ncompanion* (1st ed.). Reading, Mass.: Addison-Wesley.\n\n\n}\n\n@Book{companion,\n  author       = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},\n  title        = {The {LaTeX} Companion},\n  date         = 1994,\n  edition      = 1,\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  pagetotal    = 528,\n  hyphenation  = {american},\n  sorttitle    = {LaTeX Companion},\n  indextitle   = {LaTeX Companion, The},\n  shorttitle   = {LaTeX Companion},\n  annotation   = {A book with three authors. Note the formatting of the author\n                  list. By default, only the first name is reversed in the\n                  bibliography},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book with three authors. Note the formatting of the author\n    list. By default, only the first name is reversed in the\n    bibliography\n  author:\n  - family: Goossens\n    given: Michel\n  - family: Mittelbach\n    given: Frank\n  - family: Samarin\n    given: Alexander\n  edition: 1\n  id: companion\n  issued: 1994\n  language: en-US\n  number-of-pages: 528\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: The LaTeX companion\n  title-short: LaTeX companion\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-cotton.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Cotton et al. 1999)\n\nCotton, Frank Albert, Geoffrey Wilkinson, Carlos A. Murillio, and\nManfred Bochmann. 1999. *Advanced Inorganic Chemistry*. 6th ed.\nChichester: Wiley.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Cotton, Wilkinson, Murillio, & Bochmann, 1999)\n\nCotton, F. A., Wilkinson, G., Murillio, C. A., & Bochmann, M. (1999).\n*Advanced inorganic chemistry* (6th ed.). Chichester: Wiley.\n\n\n}\n\n@Book{cotton,\n  author       = {Cotton, Frank Albert and Wilkinson, Geoffrey and Murillio,\n                  Carlos A. and Bochmann, Manfred},\n  title        = {Advanced inorganic chemistry},\n  date         = 1999,\n  edition      = 6,\n  publisher    = {Wiley},\n  location     = {Chichester},\n  hyphenation  = {british},\n  annotation   = {A book entry with \\arabic{author} authors and an\n                  edition field. By default, long author and\n                  editor lists are automatically truncated. This is\n                  configurable},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with `\\arabic{author}`{=latex} authors and an\n    edition field. By default, long author and editor lists are\n    automatically truncated. This is configurable\n  author:\n  - family: Cotton\n    given: Frank Albert\n  - family: Wilkinson\n    given: Geoffrey\n  - family: Murillio\n    given: Carlos A.\n  - family: Bochmann\n    given: Manfred\n  edition: 6\n  id: cotton\n  issued: 1999\n  language: en-GB\n  publisher: Wiley\n  publisher-place: Chichester\n  title: Advanced inorganic chemistry\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-crossref-inbook-mvbook.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\ncrossref, directly from inbook to mvbook\n\n}\n\n@inbook{inbook-1,\n    Crossref = {mvbook-1},\n    Title = {Macbeth [title field of inbook-1]},\n    Date = {1975},\n    Volume = {3},\n    Chapter = {7},\n    Pages = {100-200},\n}\n\n@mvbook{mvbook-1,\n    Author = {Shakespeare},\n    Date = {1970/1980},\n    Title = {Collected Works [title field of mvbook-1]},\n    Location = {Location},\n    Publisher = {Publisher},\n    Volumes = {4},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Shakespeare\n  chapter-number: 7\n  container-author:\n  - family: Shakespeare\n  container-title: Collected works \\[title field of mvbook-1\\]\n  id: inbook-1\n  issued: 1975\n  number-of-volumes: 4\n  page: 100-200\n  publisher: Publisher\n  publisher-place: Location\n  title: Macbeth \\[title field of inbook-1\\]\n  type: chapter\n  volume: 3\n- author:\n  - family: Shakespeare\n  id: mvbook-1\n  issued: 1970/1980\n  number-of-volumes: 4\n  publisher: Publisher\n  publisher-place: Location\n  title: Collected works \\[title field of mvbook-1\\]\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-crossref-nested.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nNested cross-references (see biber manual v 1.7)\n\n}\n\n@bookinbook{bookinbook-1,\n    Crossref = {book-1},\n    Title = {Macbeth [title field of bookinbook-1]},\n    Chapter = {7},\n    Pages = {100-200},\n}\n\n@inbook{inbook-1,\n    Crossref = {book-1},\n    Title = {Macbeth [title field of inbook-1]},\n    Chapter = {7},\n    Pages = {100-200},\n}\n\n@book{book-1,\n    Crossref = {mvbook-1},\n    Date = {1975},\n    Title = {Tragedies [title field of book-1]},\n    Volume = {3}\n}\n\n@mvbook{mvbook-1,\n    Author = {Shakespeare},\n    Date = {1970/1980},\n    Title = {Collected Works [title field of mvbook-1]},\n    Location = {Location},\n    Publisher = {Publisher},\n    Volumes = {4}\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Shakespeare\n  chapter-number: 7\n  container-author:\n  - family: Shakespeare\n  container-title: Collected works \\[title field of mvbook-1\\]\n  id: bookinbook-1\n  issued: 1975\n  number-of-volumes: 4\n  page: 100-200\n  publisher: Publisher\n  publisher-place: Location\n  title: Macbeth \\[title field of bookinbook-1\\]\n  type: chapter\n  volume: 3\n  volume-title: Tragedies \\[title field of book-1\\]\n- author:\n  - family: Shakespeare\n  chapter-number: 7\n  container-author:\n  - family: Shakespeare\n  container-title: Collected works \\[title field of mvbook-1\\]\n  id: inbook-1\n  issued: 1975\n  number-of-volumes: 4\n  page: 100-200\n  publisher: Publisher\n  publisher-place: Location\n  title: Macbeth \\[title field of inbook-1\\]\n  type: chapter\n  volume: 3\n  volume-title: Tragedies \\[title field of book-1\\]\n- author:\n  - family: Shakespeare\n  container-author:\n  - family: Shakespeare\n  id: book-1\n  issued: 1975\n  number-of-volumes: 4\n  publisher: Publisher\n  publisher-place: Location\n  title: Collected works \\[title field of mvbook-1\\]\n  type: book\n  volume: 3\n  volume-title: Tragedies \\[title field of book-1\\]\n- author:\n  - family: Shakespeare\n  id: mvbook-1\n  issued: 1970/1980\n  number-of-volumes: 4\n  publisher: Publisher\n  publisher-place: Location\n  title: Collected works \\[title field of mvbook-1\\]\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-ctan.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(“CTAN: The Comprehensive TeX Archive Network” 2006)\n\n“CTAN: The Comprehensive TeX Archive Network.” 2006.\n<http://www.ctan.org>.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(“CTAN: The Comprehensive TeX Archive Network,” 2006)\n\nCTAN: The Comprehensive TeX Archive Network. (2006). Retrieved October\n01, 2006, from <http://www.ctan.org>\n\n\nNOTES:\n\n- biblio2yaml\n\t- if there is no shorttitle, but title and subtitle, the title alone should also be mapped to title-short\n\n- citeproc\n\t- citeproc should use title-short (if available) instead of title for in-text citations when there is no author\n\n}\n\n@Online{ctan,\n  title        = {{CTAN}},\n  date         = 2006,\n  url          = {http://www.ctan.org},\n  subtitle     = {{The Comprehensive TeX Archive Network}},\n  urldate      = {2006-10-01},\n  label        = {CTAN},\n  hyphenation  = {american},\n  annotation   = {This is an online entry. The \\textsc{url}, which is\n                  given in the url field, is transformed into a\n                  clickable link if hyperref support has been\n                  enabled. Note the format of the urldate field\n                  (yyyy-mm-dd) in the database file. Also note the\n                  label field which may be used as a fallback by\n                  citation styles which need an author and\\slash or a\n                  year},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- accessed: 2006-10-01\n  annote: This is an online entry. The [url]{.smallcaps}, which is given\n    in the url field, is transformed into a clickable link if hyperref\n    support has been enabled. Note the format of the urldate field\n    (yyyy-mm-dd) in the database file. Also note the label field which\n    may be used as a fallback by citation styles which need an author\n    and/or a year\n  id: ctan\n  issued: 2006\n  language: en-US\n  title: \"CTAN: The Comprehensive TeX Archive Network\"\n  title-short: CTAN\n  type: webpage\n  url: \"http://www.ctan.org\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-dates.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n    - Dates\n    - Not included in tests:\n        - malformed dates and date ranges\n        - literal dates (\"13th century\"; not supported by biblatex)\n        - seasons (would have to come from parsing the issue field)\n        - uncertain dates (use \"doubtfuldate\" from biblatex-apa?)\n        - dates with single-digit day or month (not supported by biblatex)\n        - negative dates (not supported by biblatex)\n    - Note: biblatex supports years < 1000 but only if padded with leading zeros\n    - TODO:\n        - either biblio2yaml or, probably better, citeproc should strip leading zeros\n         from days and months (CSL can add leading zeros to its output, but not remove\n         them when they are in its input data)\n}\n\n@article{year-month-old,\n    Author = {Author, Al},\n    Journal = {Journal},\n    Month = aug,\n    Title = {Year and Month, bibtex style, supported by biblatex for backwards compatibility},\n    Year = {1999}}\n\n@article{year-month-new,\n    Author = {Author, Al},\n    Journal = {Journal},\n    Month = {08},\n    Title = {Year and Month, biblatex style; note that biblatex does not have a ``day'' field},\n    Year = {1999}}\n\n@article{dates,\n    Author = {Author, Al},\n    Date = {2012-12-13},\n    Eventdate = {2011-10-03},\n    Journal = {Journal},\n    Month = may,\n    Origdate = {1888-10-01},\n    Title = {Dates, default biblatex style; year, month to be ignored if date exists},\n    Urldate = {1999-05-23},\n    Year = {9999}}\n\n@article{date-ranges-different-years,\n    Author = {Author, Al},\n    Date = {1999-10-14/2010-01-23},\n    Eventdate = {1999-12/2000-01},\n    Journal = {Journal},\n    Origdate = {1888-01-02/1913-12-13},\n    Title = {Date ranges; different years},\n    Urldate = {2012-10-12/2013-01-31}}\n\n@article{date-ranges-same-year,\n    Author = {Author, Al},\n    Date = {1999-10-14/1999-10-15},\n    Eventdate = {1999-10/1999-11},\n    Journal = {Journal},\n    Origdate = {1888-01-02/1888-12-13},\n    Title = {Date ranges; same year},\n    Urldate = {2012-10-31/2012-11-01}}\n\n@article{date-ranges-open,\n    Author = {Author, Al},\n    Date = {1999-10-14/},\n    Eventdate = {1999-10/},\n    Journal = {Journal},\n    Origdate = {1888-01-02/},\n    Title = {Date ranges, open-ended},\n    Urldate = {2012-10-31/}}\n\n@article{dates-very-old,\n    Author = {Author, Al},\n    Date = {0712-12-13},\n    Eventdate = {0311-10-03},\n    Journal = {Journal},\n    Month = may,\n    Origdate = {0088-10-01},\n    Title = {Dates, year less than 1000},\n    Urldate = {0999-12-14}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  id: year-month-old\n  issued: 1999-08\n  title: Year and month, bibtex style, supported by biblatex for\n    backwards compatibility\n  type: article-journal\n- author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  id: year-month-new\n  issued: 1999-08\n  title: Year and month, biblatex style; note that biblatex does not\n    have a \"day\" field\n  type: article-journal\n- accessed: 1999-05-23\n  author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  event-date: 2011-10-03\n  id: dates\n  issued: 2012-12-13\n  original-date: 1888-10-01\n  title: Dates, default biblatex style; year, month to be ignored if\n    date exists\n  type: article-journal\n- accessed: 2012-10-12/2013-01-31\n  author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  event-date: 1999-12/2000-01\n  id: date-ranges-different-years\n  issued: 1999-10-14/2010-01-23\n  original-date: 1888-01-02/1913-12-13\n  title: Date ranges; different years\n  type: article-journal\n- accessed: 2012-10-31/2012-11-01\n  author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  event-date: 1999-10/1999-11\n  id: date-ranges-same-year\n  issued: 1999-10-14/1999-10-15\n  original-date: 1888-01-02/1888-12-13\n  title: Date ranges; same year\n  type: article-journal\n- accessed: 2012-10-31/\n  author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  event-date: 1999-10/\n  id: date-ranges-open\n  issued: 1999-10-14/\n  original-date: 1888-01-02/\n  title: Date ranges, open-ended\n  type: article-journal\n- accessed: 0999-12-14\n  author:\n  - family: Author\n    given: Al\n  container-title: Journal\n  event-date: 0311-10-03\n  id: dates-very-old\n  issued: 0712-12-13\n  original-date: 0088-10-01\n  title: Dates, year less than 1000\n  type: article-journal\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-doody.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Doody 1974) (Matuz 1990)\n\nDoody, Terrence. 1974. “Hemingway’s Style and Jake’s Narration.” *The\nJournal of Narrative Technique* 4 (3): 212–225.\n\nMatuz, Roger, ed. 1990. *Contemporary Literary Criticism*. Vol. 61.\nDetroit: Gale.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Doody, 1974) (Matuz, 1990)\n\nDoody, T. (1974). Hemingway’s style and Jake’s narration. *The Journal\nof Narrative Technique*, *4*(3), 212–225.\n\nMatuz, R. (Ed.). (1990). *Contemporary literary criticism* (Vol. 61, pp.\n204–208). Detroit: Gale.\n\n\nNOTES\n\n- biblio2yaml\n\t- contains fields “related” and “relatedstring”. In principle, these could be appended to CSL \"note\", if citeproc can handle citations in the bibliography ...\n\n}\n\n@Article{doody,\n  author       = {Doody, Terrence},\n  title        = {Hemingway's Style and {Jake}'s Narration},\n  year         = 1974,\n  volume       = 4,\n  number       = 3,\n  pages        = {212-225},\n  hyphenation  = {american},\n  related      = {matuz:doody},\n  relatedstring= {\\autocap{e}xcerpt in},\n  journal      = {The Journal of Narrative Technique},\n  annotation   = {An article entry cited as an excerpt from a\n                  collection entry. Note the format of the\n                  related and relatedstring fields},\n}\n\n@Collection{matuz:doody,\n  editor       = {Matuz, Roger},\n  title        = {Contemporary Literary Criticism},\n  year         = 1990,\n  volume       = 61,\n  publisher    = {Gale},\n  location     = {Detroit},\n  pages        = {204-208},\n  hyphenation  = {american},\n  annotation   = {A collection entry providing the excerpt information\n                  for the doody entry. Note the format of the\n                  pages field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry cited as an excerpt from a collection entry.\n    Note the format of the related and relatedstring fields\n  author:\n  - family: Doody\n    given: Terrence\n  container-title: The Journal of Narrative Technique\n  id: doody\n  issue: 3\n  issued: 1974\n  language: en-US\n  page: 212-225\n  title: Hemingway's style and Jake's narration\n  type: article-journal\n  volume: 4\n- annote: A collection entry providing the excerpt information for the\n    doody entry. Note the format of the pages field\n  editor:\n  - family: Matuz\n    given: Roger\n  id: \"matuz:doody\"\n  issued: 1990\n  language: en-US\n  page: 204-208\n  publisher: Gale\n  publisher-place: Detroit\n  title: Contemporary literary criticism\n  type: book\n  volume: 61\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-edtf-date.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\nNote that current CSL doesn't give us a way\nto distinguish between /open and /unknown,\nso item3-3 and item3-4 get parsed similarly.\nThat should change in CSL 1.1, and then this\ntest should be revised.\n\n@article{item3-3, date={1998/unknown}}\n@article{item3-4, date={1999/open}}\n@article{item3-10, date={2004-04-05T14:34:00}}\n@article{item5-1, date={0000}}\n@article{item5-2, date={-0876}}\n@article{item5-3, date={-0877/-0866}}\n@article{item5-5, date={-0343-02}}\n@article{item5-8, date={1723~}}\n@article{item5-9, date={1723?}}\n@article{item5-10, date={1723?~}}\n@article{item5-11, date={2004-22}}\n@article{item5-12, date={2004-24}}\n@article{item5-13, date={20uu}}\n@article{item5-14, date={y-123456789}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- id: item3-3\n  issued: 1998/\n  type: article-journal\n- id: item3-4\n  issued: 1999/\n  type: article-journal\n- id: item3-10\n  issued: 2004-04-05\n  type: article-journal\n- id: item5-1\n  type: article-journal\n- id: item5-2\n  issued: \"-0876\"\n  type: article-journal\n- id: item5-3\n  issued: \"-0877/-0866\"\n  type: article-journal\n- id: item5-5\n  issued: \"-0343-02\"\n  type: article-journal\n- id: item5-8\n  issued: 1723\\~\n  type: article-journal\n- id: item5-9\n  issued: 1723\n  type: article-journal\n- id: item5-10\n  issued: 1723\\~\n  type: article-journal\n- id: item5-11\n  issued: 2004-22\n  type: article-journal\n- id: item5-12\n  issued: 2004-24\n  type: article-journal\n- id: item5-13\n  issued: 2000/2099\n  type: article-journal\n- id: item5-14\n  issued: y-123456789\n  type: article-journal\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-escapedquotes.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{From jgm/pandoc#1568.  Double quotes escaped using {\"}.}\n\n@ARTICLE{Koff2009-gn,\n  title       = \"Pan-Canadian evaluation of irreversible compression ratios\n                 ({\"}lossy{\"} compression) for development of national\n                 guidelines\",\n  author      = \"Koff, David and Bak, Peter and Brownrigg, Paul and\n                 Hosseinzadeh, Danoush and Khademi, April and Kiss, Alex and\n                 Lepanto, Luigi and Michalak, Tracy and Shulman, Harry and\n                 Volkening, Andrew\",\n  affiliation = \"Sunnybrook Health Sciences Centre, 2075 Bayview Ave., Toronto,\n                 ON, M4N 3M5, Canada. dkoffmcmaster.ca\",\n  journal     = \"Journal of digital imaging\",\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Koff\n    given: David\n  - family: Bak\n    given: Peter\n  - family: Brownrigg\n    given: Paul\n  - family: Hosseinzadeh\n    given: Danoush\n  - family: Khademi\n    given: April\n  - family: Kiss\n    given: Alex\n  - family: Lepanto\n    given: Luigi\n  - family: Michalak\n    given: Tracy\n  - family: Shulman\n    given: Harry\n  - family: Volkening\n    given: Andrew\n  container-title: Journal of digital imaging\n  id: Koff2009-gn\n  title: Pan-canadian evaluation of irreversible compression ratios\n    (\\\"lossy\\\" compression) for development of national guidelines\n  type: article-journal\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-formatting.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@article{item1,\n    Title = {The Title:\n     \\textit{italics},\n     \\textbf{bold},\n     \\textsubscript{subscript},\n     \\textsuperscript{superscript},\n     \\textsc{small-caps}}\n}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- id: item1\n  title: \"The title: *Italics*, **bold**, ~subscript~, ^superscript^,\n    [small-caps]{.smallcaps}\"\n  title-short: The title\n  type: article-journal\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-gaonkar-in.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Gaonkar 2001)\n\nGaonkar, Dilip Parameshwar. 2001. “On Alternative Modernities.” In\n*Alternative Modernities*, edited by Dilip Parameshwar Gaonkar, 1–23.\nDurham; London: Duke University Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Gaonkar, 2001)\n\nGaonkar, D. P. (2001). On alternative modernities. In D. P. Gaonkar\n(Ed.), *Alternative modernities* (pp. 1–23). Durham; London: Duke\nUniversity Press.\n\n\n}\n\n@InCollection{gaonkar:in,\n  author       = {Gaonkar, Dilip Parameshwar},\n  editor       = {Gaonkar, Dilip Parameshwar},\n  title        = {On Alternative Modernities},\n  date         = 2001,\n  booktitle    = {Alternative Modernities},\n  publisher    = {Duke University Press},\n  location     = {Durham and London},\n  isbn         = {0-822-32714-7},\n  pages        = {1-23},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Gaonkar\n    given: Dilip Parameshwar\n  container-title: Alternative modernities\n  editor:\n  - family: Gaonkar\n    given: Dilip Parameshwar\n  id: \"gaonkar:in\"\n  isbn: 0-822-32714-7\n  issued: 2001\n  page: 1-23\n  publisher: Duke University Press\n  publisher-place: Durham; London\n  title: On alternative modernities\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-gaonkar.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Gaonkar 2001)\n\nGaonkar, Dilip Parameshwar, ed. 2001. *Alternative Modernities*. Durham;\nLondon: Duke University Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Gaonkar, 2001)\n\nGaonkar, D. P. (Ed.). (2001). *Alternative modernities*. Durham; London:\nDuke University Press.\n\n\n}\n\n@Collection{gaonkar,\n  editor       = {Gaonkar, Dilip Parameshwar},\n  title        = {Alternative Modernities},\n  date         = 2001,\n  publisher    = {Duke University Press},\n  location     = {Durham and London},\n  isbn         = {0-822-32714-7},\n  hyphenation  = {american},\n  annotation   = {This is a collection entry. Note the format of the\n                  location field in the database file as well as the\n                  isbn field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a collection entry. Note the format of the location\n    field in the database file as well as the isbn field\n  editor:\n  - family: Gaonkar\n    given: Dilip Parameshwar\n  id: gaonkar\n  isbn: 0-822-32714-7\n  issued: 2001\n  language: en-US\n  publisher: Duke University Press\n  publisher-place: Durham; London\n  title: Alternative modernities\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-geer.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Geer 1985)\n\nGeer, Ingrid de. 1985. “Earl, Saint, Bishop, Skald – and Music: The\nOrkney Earldom of the Twelfth Century. A Musicological Study.” PhD\nthesis, Uppsala: Uppsala Universitet.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Geer, 1985)\n\nGeer, I. de. (1985). *Earl, saint, bishop, skald – and music: The Orkney\nearldom of the twelfth century. A musicological study* (PhD thesis).\nUppsala Universitet, Uppsala.\n\n\n}\n\n@Thesis{geer,\n  author       = {de Geer, Ingrid},\n  title        = {Earl, Saint, Bishop, Skald~-- and Music},\n  type         = {phdthesis},\n  institution  = {Uppsala Universitet},\n  date         = 1985,\n  subtitle     = {The {Orkney} Earldom of the Twelfth Century. {A} Musicological\n                  Study},\n  location     = {Uppsala},\n  options      = {useprefix=false},\n  hyphenation  = {british},\n  annotation   = {This is a typical thesis entry for a PhD thesis. Note\n                  the type field in the database file which uses a\n                  localization key. Also note the format of the printed name and\n                  compare the useprefix option in the options\n                  field as well as vangennep},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a typical thesis entry for a PhD thesis. Note the type\n    field in the database file which uses a localization key. Also note\n    the format of the printed name and compare the useprefix option in\n    the options field as well as vangennep\n  author:\n  - dropping-particle: de\n    family: Geer\n    given: Ingrid\n  genre: PhD thesis\n  id: geer\n  issued: 1985\n  language: en-GB\n  publisher: Uppsala Universitet\n  publisher-place: Uppsala\n  title: \"Earl, saint, bishop, skald -- and music: The Orkney earldom of\n    the twelfth century. A musicological study\"\n  title-short: Earl, saint, bishop, skald -- and music\n  type: thesis\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-gerhardt.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Gerhardt 2000)\n\nGerhardt, Michael J. 2000. *The Federal Appointments Process: A\nConstitutional and Historical Analysis*. Durham; London: Duke University\nPress.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Gerhardt, 2000)\n\nGerhardt, M. J. (2000). *The federal appointments process: A\nconstitutional and historical analysis*. Durham; London: Duke University\nPress.\n\n\n}\n\n@Book{gerhardt,\n  author       = {Gerhardt, Michael J.},\n  title        = {The Federal Appointments Process},\n  date         = 2000,\n  publisher    = {Duke University Press},\n  location     = {Durham and London},\n  hyphenation  = {american},\n  sorttitle    = {Federal Appointments Process},\n  indextitle   = {Federal Appointments Process, The},\n  subtitle     = {A Constitutional and Historical Analysis},\n  shorttitle   = {Federal Appointments Process},\n  annotation   = {This is a book entry. Note the format of the\n                  location field as well as the sorttitle and\n                  indextitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a book entry. Note the format of the location field as\n    well as the sorttitle and indextitle fields\n  author:\n  - family: Gerhardt\n    given: Michael J.\n  id: gerhardt\n  issued: 2000\n  language: en-US\n  publisher: Duke University Press\n  publisher-place: Durham; London\n  title: \"The federal appointments process: A constitutional and\n    historical analysis\"\n  title-short: Federal appointments process\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-gillies.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Gillies 1933)\n\nGillies, Alexander. 1933. “Herder and the Preparation of Goethe’s Idea\nof World Literature.” *Publications of the English Goethe Society, New\nSeries* 9: 46–67.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Gillies, 1933)\n\nGillies, A. (1933). Herder and the preparation of Goethe’s idea of world\nliterature. *Publications of the English Goethe Society, new series*,\n*9*, 46–67.\n\n\nNOTES:\n\n- biblio2yaml\n\t- \"new series\" is not pretty, but it’s the best we can do at the moment, given the limitations of CSL.\n\n}\n\n@Article{gillies,\n  author       = {Gillies, Alexander},\n  title        = {Herder and the Preparation of {Goethe}'s Idea of World\n                  Literature},\n  journaltitle = {Publications of the English Goethe Society},\n  date         = 1933,\n  series       = {newseries},\n  volume       = 9,\n  pages        = {46-67},\n  hyphenation  = {british},\n  annotation   = {An article entry with a series and a\n                  volume field. Note that format of the series\n                  field in the database file},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry with a series and a volume field. Note that\n    format of the series field in the database file\n  author:\n  - family: Gillies\n    given: Alexander\n  collection-title: New series\n  container-title: Publications of the English Goethe Society\n  id: gillies\n  issued: 1933\n  language: en-GB\n  page: 46-67\n  title: Herder and the preparation of Goethe's idea of world literature\n  type: article-journal\n  volume: 9\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-glashow.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Glashow 1961)\n\nGlashow, Sheldon. 1961. “Partial Symmetries of Weak Interactions.”\n*Nucl. Phys.* 22: 579–588.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Glashow, 1961)\n\nGlashow, S. (1961). Partial symmetries of weak interactions.\n*Nucl. Phys.*, *22*, 579–588.\n\n\n}\n\n@Article{glashow,\n  author       = {Glashow, Sheldon},\n  title        = {Partial Symmetries of Weak Interactions},\n  journaltitle = {Nucl.~Phys.},\n  date         = 1961,\n  volume       = 22,\n  pages        = {579-588},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Glashow\n    given: Sheldon\n  container-title: Nucl. Phys.\n  id: glashow\n  issued: 1961\n  page: 579-588\n  title: Partial symmetries of weak interactions\n  type: article-journal\n  volume: 22\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-gonzalez.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Gonzalez 2001)\n\nGonzalez, Ray. 2001. *The Ghost of John Wayne and Other Stories*.\nTucson: The University of Arizona Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Gonzalez, 2001)\n\nGonzalez, R. (2001). *The ghost of John Wayne and other stories*.\nTucson: The University of Arizona Press.\n\n}\n\n@Book{gonzalez,\n  author       = {Gonzalez, Ray},\n  title        = {The Ghost of {John Wayne} and Other Stories},\n  date         = 2001,\n  publisher    = {The University of Arizona Press},\n  location     = {Tucson},\n  isbn         = {0-816-52066-6},\n  hyphenation  = {american},\n  sorttitle    = {Ghost of John Wayne and Other Stories},\n  indextitle   = {Ghost of {John Wayne} and Other Stories, The},\n  shorttitle   = {Ghost of {John Wayne}},\n  annotation   = {A collection of short stories. This is a book entry.\n                  Note the sorttitle and indextitle fields in\n                  the database file. There's also an isbn field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A collection of short stories. This is a book entry. Note the\n    sorttitle and indextitle fields in the database file. There's also\n    an isbn field\n  author:\n  - family: Gonzalez\n    given: Ray\n  id: gonzalez\n  isbn: 0-816-52066-6\n  issued: 2001\n  language: en-US\n  publisher: The University of Arizona Press\n  publisher-place: Tucson\n  title: The ghost of John Wayne and other stories\n  title-short: Ghost of John Wayne\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-hammond.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Hammond 1997)\n\nHammond, Christopher. 1997. *The Basics of Crystallography and\nDiffraction*. Oxford: International Union of Crystallography; Oxford\nUniversity Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Hammond, 1997)\n\nHammond, C. (1997). *The basics of crystallography and diffraction*.\nOxford: International Union of Crystallography; Oxford University Press.\n\n\n}\n\n@Book{hammond,\n  author       = {Hammond, Christopher},\n  title        = {The basics of crystallography and diffraction},\n  date         = 1997,\n  publisher    = {International Union of Crystallography and Oxford University\n                  Press},\n  location     = {Oxford},\n  hyphenation  = {british},\n  sorttitle    = {Basics of crystallography and diffraction},\n  indextitle   = {Basics of crystallography and diffraction, The},\n  shorttitle   = {Crystallography and diffraction},\n  annotation   = {A book entry. Note the sorttitle and\n                  indextitle fields as well as the format of the\n                  publisher field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry. Note the sorttitle and indextitle fields as well\n    as the format of the publisher field\n  author:\n  - family: Hammond\n    given: Christopher\n  id: hammond\n  issued: 1997\n  language: en-GB\n  publisher: International Union of Crystallography; Oxford University\n    Press\n  publisher-place: Oxford\n  title: The basics of crystallography and diffraction\n  title-short: Crystallography and diffraction\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-herrmann.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Herrmann et al. 2006)\n\nHerrmann, Wolfgang A., Karl Öfele, Sabine K. Schneider, Eberhardt\nHerdtweck, and Stephan D. Hoffmann. 2006. “A Carbocyclic Carbene as an\nEfficient Catalyst Ligand for C–C Coupling Reactions.” *Angew. Chem.\nInt. Ed.* 45 (23): 3859–3862.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Herrmann, Öfele, Schneider, Herdtweck, & Hoffmann, 2006)\n\nHerrmann, W. A., Öfele, K., Schneider, S. K., Herdtweck, E., & Hoffmann,\nS. D. (2006). A carbocyclic carbene as an efficient catalyst ligand for\nC–C coupling reactions. *Angew. Chem. Int. Ed.*, *45*(23), 3859–3862.\n\n\n}\n\n@string{ anch-ie = {Angew.~Chem. Int.~Ed.} }\n\n@Article{herrmann,\n  author       = {Herrmann, Wolfgang A. and {\\\"O}fele, Karl and Schneider,\n                  Sabine K.  and Herdtweck, Eberhardt and Hoffmann, Stephan D.},\n  title        = {A carbocyclic carbene as an efficient catalyst ligand for {C--C}\n                  coupling reactions},\n  journaltitle = anch-ie,\n  date         = 2006,\n  volume       = 45,\n  number       = 23,\n  pages        = {3859-3862},\n  indextitle   = {Carbocyclic carbene as an efficient catalyst, A},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Herrmann\n    given: Wolfgang A.\n  - family: Öfele\n    given: Karl\n  - family: Schneider\n    given: Sabine K.\n  - family: Herdtweck\n    given: Eberhardt\n  - family: Hoffmann\n    given: Stephan D.\n  container-title: Angew. Chem. Int. Ed.\n  id: herrmann\n  issue: 23\n  issued: 2006\n  page: 3859-3862\n  title: A carbocyclic carbene as an efficient catalyst ligand for C--C\n    coupling reactions\n  type: article-journal\n  volume: 45\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-hyman.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Hyman 1981)\n\nHyman, Arthur. 1981. “Aristotle’s Theory of the Intellect and Its\nInterpretation by Averroes.” In *Studies in Aristotle*, edited by\nDominic J. O’Meara, 161–191. Studies in Philosophy and the History of\nPhilosophy 9. Washington, D.C.: The Catholic University of America\nPress.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Hyman, 1981)\n\nHyman, A. (1981). Aristotle’s theory of the intellect and its\ninterpretation by Averroes. In D. J. O’Meara (Ed.), *Studies in\nAristotle* (pp. 161–191). Washington, D.C.: The Catholic University of\nAmerica Press.\n\n\n}\n\n@InCollection{hyman,\n  author       = {Arthur Hyman},\n  editor       = {O'Meara, Dominic J.},\n  title        = {Aristotle's Theory of the Intellect and its Interpretation by\n                  {Averroes}},\n  date         = 1981,\n  booktitle    = {Studies in {Aristotle}},\n  series       = {Studies in Philosophy and the History of Philosophy},\n  number       = 9,\n  publisher    = {The Catholic University of America Press},\n  location     = {Washington, D.C.},\n  pages        = {161-191},\n  keywords     = {secondary},\n  hyphenation  = {american},\n  indextitle   = {Aristotle's Theory of the Intellect},\n  shorttitle   = {Aristotle's Theory of the Intellect},\n  annotation   = {An incollection entry with a series and\n                  number field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An incollection entry with a series and number field\n  author:\n  - family: Hyman\n    given: Arthur\n  collection-number: 9\n  collection-title: Studies in philosophy and the history of philosophy\n  container-title: Studies in Aristotle\n  editor:\n  - family: O'Meara\n    given: Dominic J.\n  id: hyman\n  issued: 1981\n  keyword: secondary\n  language: en-US\n  page: 161-191\n  publisher: The Catholic University of America Press\n  publisher-place: Washington, D.C.\n  title: Aristotle's theory of the intellect and its interpretation by\n    Averroes\n  title-short: Aristotle's theory of the intellect\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-iliad.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Homer 2004)\n\nHomer. 2004. *Die Ilias*. Translated by Wolfgang Schadewaldt. 3rd ed.\nDüsseldorf; Zürich: Artemis & Winkler.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Homer, 2004)\n\nHomer. (2004). *Die Ilias*. (W. Schadewaldt, trans.) (3rd ed.).\nDüsseldorf; Zürich: Artemis & Winkler.\n\n}\n\n@Book{iliad,\n  author       = {Homer},\n  title        = {Die Ilias},\n  date         = 2004,\n  translator   = {Schadewaldt, Wolfgang},\n  introduction = {Latacz, Joachim},\n  edition      = 3,\n  publisher    = {Artemis \\& Winkler},\n  location     = {D{\\\"u}sseldorf and Z{\\\"u}rich},\n  hyphenation  = {german},\n  sorttitle    = {Ilias},\n  indextitle   = {Ilias, Die},\n  shorttitle   = {Ilias},\n  annotation   = {A German translation of the \\emph{Iliad}. Note the\n                  translator and introduction fields and the\n                  format of the location field in the database\n                  file. Also note the sorttitle and indextitle\n                  fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A German translation of the *Iliad*. Note the translator and\n    introduction fields and the format of the location field in the\n    database file. Also note the sorttitle and indextitle fields\n  author:\n  - family: Homer\n  edition: 3\n  id: iliad\n  issued: 2004\n  language: de-DE\n  publisher: Artemis & Winkler\n  publisher-place: Düsseldorf; Zürich\n  title: Die Ilias\n  title-short: Ilias\n  translator:\n  - family: Schadewaldt\n    given: Wolfgang\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-inbook-title-booktitle-maintitle-series-2.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@inbook{item1,\n\tAuthor = {Author, Al},\n\tBookauthor = {Bookauthor, Bob},\n\tBooksubtitle = {Booksubtitle},\n\tBooktitle = {Booktitle},\n\tBooktitleaddon = {Booktitleaddon},\n\tDate = {2011},\n\tHyphenation = {french},\n\tLocation = {Location},\n\tMainsubtitle = {Mainsubtitle},\n\tMaintitle = {Maintitle},\n\tMaintitleaddon = {Maintitleaddon},\n\tNumber = {3},\n\tPublisher = {Publisher},\n\tSeries = {Series},\n\tSubtitle = {Subtitle},\n\tTitle = {Title of the ``inbook'' Entry},\n\tTitleaddon = {Titleaddon},\n\tVolume = {4}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Al\n  collection-number: 3\n  collection-title: Series\n  container-author:\n  - family: Bookauthor\n    given: Bob\n  container-title: \"Maintitle: Mainsubtitle. Maintitleaddon\"\n  id: item1\n  issued: 2011\n  language: fr-FR\n  publisher: Publisher\n  publisher-place: Location\n  title: \"Title of the \\\"inbook\\\" Entry: Subtitle. Titleaddon\"\n  type: chapter\n  volume: 4\n  volume-title: \"Booktitle: Booksubtitle. Booktitleaddon\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-inbook-title-booktitle-maintitle-series.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@inbook{item1,\n\tAuthor = {Author, Al},\n\tBooksubtitle = {Booksubtitle},\n\tBooktitle = {Booktitle},\n\tBooktitleaddon = {Booktitleaddon},\n\tDate = {2011},\n\tHyphenation = {french},\n\tLocation = {Location},\n\tMainsubtitle = {Mainsubtitle},\n\tMaintitle = {Maintitle},\n\tMaintitleaddon = {Maintitleaddon},\n\tNumber = {3},\n\tPublisher = {Publisher},\n\tSeries = {Series},\n\tSubtitle = {Subtitle},\n\tTitle = {Title of the ``inbook'' Entry},\n\tTitleaddon = {Titleaddon},\n\tVolume = {4}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Al\n  collection-number: 3\n  collection-title: Series\n  container-title: \"Maintitle: Mainsubtitle. Maintitleaddon\"\n  id: item1\n  issued: 2011\n  language: fr-FR\n  publisher: Publisher\n  publisher-place: Location\n  title: \"Title of the \\\"inbook\\\" Entry: Subtitle. Titleaddon\"\n  type: chapter\n  volume: 4\n  volume-title: \"Booktitle: Booksubtitle. Booktitleaddon\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-inbook.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\nadapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\nTODO / citeproc: in biblatex \"inbook\" entries, citeproc should suppress bookauthor = CSL container-author if identical with author. -- See annotation in kant:kpv.\n}\n\n@string{dtv = {Deutscher Taschenbuch-Verlag}}\n\n@inbook{kant:kpv,\n\tAnnotation = {An edition of Kant's \\emph{Collected Works}, volume five. This is an inbook entry which explicitly refers to the \\emph{Critique of Practical Reason} only, not to the entire fifth volume. Note the author and bookauthor fields in the database file. By default, the bookauthor is omitted if the values of the author and bookauthor fields are identical},\n\tAuthor = {Kant, Immanuel},\n\tBookauthor = {Kant, Immanuel},\n\tBooktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},\n\tDate = 1968,\n\tHyphenation = {german},\n\tLocation = {Berlin},\n\tMaintitle = {Kants Werke. Akademie Textausgabe},\n\tPages = {1-163},\n\tPublisher = {Walter de Gruyter},\n\tShorthand = {KpV},\n\tShorttitle = {Kritik der praktischen Vernunft},\n\tTitle = {Kritik der praktischen Vernunft},\n\tVolume = 5}\n\n@inbook{kant:ku,\n\tAnnotation = {An edition of Kant's \\emph{Collected Works}, volume five. This is an inbook entry which explicitly refers to the \\emph{Critique of Judgment} only, not to the entire fifth volume},\n\tAuthor = {Kant, Immanuel},\n\tBookauthor = {Kant, Immanuel},\n\tBooktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},\n\tDate = 1968,\n\tHyphenation = {german},\n\tLocation = {Berlin},\n\tMaintitle = {Kants Werke. Akademie Textausgabe},\n\tPages = {165-485},\n\tPublisher = {Walter de Gruyter},\n\tShorthand = {KU},\n\tTitle = {Kritik der Urtheilskraft},\n\tVolume = 5}\n\n@inbook{nietzsche:historie,\n\tAnnotation = {A single essay from the critical edition of Nietzsche's works. This inbook entry explicitly refers to an essay found in the first volume. Note the title, booktitle, and maintitle fields. Also note the sorttitle and sortyear fields. We want this entry to be listed after the entry referring to the entire first volume},\n\tAuthor = {Nietzsche, Friedrich},\n\tBookauthor = {Nietzsche, Friedrich},\n\tBooktitle = {Die Geburt der Tragödie. Unzeitgemäße Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},\n\tDate = 1988,\n\tEditor = {Colli, Giorgio and Montinari, Mazzino},\n\tHyphenation = {german},\n\tIndexsorttitle = {Vom Nutzen und Nachtheil der Historie fur das Leben},\n\tIndextitle = {Vom Nutzen und Nachtheil der Historie für das Leben},\n\tLocation = {München and Berlin and New York},\n\tMainsubtitle = {Kritische Studienausgabe},\n\tMaintitle = {Sämtliche Werke},\n\tPages = {243-334},\n\tPublisher = dtv # { and Walter de Gruyter},\n\tShorttitle = {Vom Nutzen und Nachtheil der Historie},\n\tSorttitle = {Werke-01-243},\n\tSortyear = {1988-2},\n\tSubtitle = {Vom Nutzen und Nachtheil der Historie für das Leben},\n\tTitle = {Unzeitgemässe Betrachtungen. Zweites Stück},\n\tVolume = 1}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An edition of Kant's *Collected Works*, volume five. This is\n    an inbook entry which explicitly refers to the *Critique of\n    Practical Reason* only, not to the entire fifth volume. Note the\n    author and bookauthor fields in the database file. By default, the\n    bookauthor is omitted if the values of the author and bookauthor\n    fields are identical\n  author:\n  - family: Kant\n    given: Immanuel\n  container-author:\n  - family: Kant\n    given: Immanuel\n  container-title: Kants Werke. Akademie Textausgabe\n  id: \"kant:kpv\"\n  issued: 1968\n  language: de-DE\n  page: 1-163\n  publisher: Walter de Gruyter\n  publisher-place: Berlin\n  title: Kritik der praktischen Vernunft\n  title-short: Kritik der praktischen Vernunft\n  type: chapter\n  volume: 5\n  volume-title: Kritik der praktischen Vernunft. Kritik der\n    Urtheilskraft\n- annote: An edition of Kant's *Collected Works*, volume five. This is\n    an inbook entry which explicitly refers to the *Critique of\n    Judgment* only, not to the entire fifth volume\n  author:\n  - family: Kant\n    given: Immanuel\n  container-author:\n  - family: Kant\n    given: Immanuel\n  container-title: Kants Werke. Akademie Textausgabe\n  id: \"kant:ku\"\n  issued: 1968\n  language: de-DE\n  page: 165-485\n  publisher: Walter de Gruyter\n  publisher-place: Berlin\n  title: Kritik der Urtheilskraft\n  type: chapter\n  volume: 5\n  volume-title: Kritik der praktischen Vernunft. Kritik der\n    Urtheilskraft\n- annote: A single essay from the critical edition of Nietzsche's works.\n    This inbook entry explicitly refers to an essay found in the first\n    volume. Note the title, booktitle, and maintitle fields. Also note\n    the sorttitle and sortyear fields. We want this entry to be listed\n    after the entry referring to the entire first volume\n  author:\n  - family: Nietzsche\n    given: Friedrich\n  container-author:\n  - family: Nietzsche\n    given: Friedrich\n  container-title: \"Sämtliche Werke: Kritische Studienausgabe\"\n  editor:\n  - family: Colli\n    given: Giorgio\n  - family: Montinari\n    given: Mazzino\n  id: \"nietzsche:historie\"\n  issued: 1988\n  language: de-DE\n  page: 243-334\n  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter\n  publisher-place: München; Berlin; New York\n  title: \"Unzeitgemässe Betrachtungen. Zweites Stück: Vom Nutzen und\n    Nachtheil der Historie für das Leben\"\n  title-short: Vom Nutzen und Nachtheil der Historie\n  type: chapter\n  volume: 1\n  volume-title: Die Geburt der Tragödie. Unzeitgemäße Betrachtungen\n    I--IV. Nachgelassene Schriften 1870--1973\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-incollection-2.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n\n@string{hup = {Harvard University Press}}\n\n\n@incollection{westfahl:space,\n\tAnnotation = {A cross-referenced article from a collection. This is an incollection entry with a crossref field. Note the subtitle and indextitle fields},\n\tAuthor = {Westfahl, Gary},\n\tCrossref = {westfahl:frontier},\n\tHyphenation = {american},\n\tIndextitle = {True Frontier, The},\n\tPages = {55-65},\n\tSubtitle = {Confronting and Avoiding the Realities of Space in {American} Science Fiction Films},\n\tTitle = {The True Frontier}}\n\n@incollection{gaonkar:in,\n\tAuthor = {Gaonkar, Dilip Parameshwar},\n\tBooktitle = {Alternative Modernities},\n\tDate = 2001,\n\tEditor = {Gaonkar, Dilip Parameshwar},\n\tIsbn = {0-822-32714-7},\n\tLocation = {Durham and London},\n\tPages = {1-23},\n\tPublisher = {Duke University Press},\n\tTitle = {On Alternative Modernities}}\n\n@collection{westfahl:frontier,\n\tAnnotation = {This is a collection entry. Note the format of the location field as well as the subtitle and booksubtitle fields},\n\tBooksubtitle = {The Frontier Theme in Science Fiction},\n\tBooktitle = {Space and Beyond},\n\tDate = 2000,\n\tEditor = {Westfahl, Gary},\n\tHyphenation = {american},\n\tLocation = {Westport, Conn. and London},\n\tPublisher = {Greenwood},\n\tSubtitle = {The Frontier Theme in Science Fiction},\n\tTitle = {Space and Beyond}}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A cross-referenced article from a collection. This is an\n    incollection entry with a crossref field. Note the subtitle and\n    indextitle fields\n  author:\n  - family: Westfahl\n    given: Gary\n  container-title: \"Space and beyond: The frontier theme in science\n    fiction\"\n  editor:\n  - family: Westfahl\n    given: Gary\n  id: \"westfahl:space\"\n  issued: 2000\n  language: en-US\n  page: 55-65\n  publisher: Greenwood\n  publisher-place: Westport, Conn.; London\n  title: \"The true frontier: Confronting and avoiding the realities of\n    space in American science fiction films\"\n  title-short: The true frontier\n  type: chapter\n- author:\n  - family: Gaonkar\n    given: Dilip Parameshwar\n  container-title: Alternative modernities\n  editor:\n  - family: Gaonkar\n    given: Dilip Parameshwar\n  id: \"gaonkar:in\"\n  isbn: 0-822-32714-7\n  issued: 2001\n  page: 1-23\n  publisher: Duke University Press\n  publisher-place: Durham; London\n  title: On alternative modernities\n  type: chapter\n- annote: This is a collection entry. Note the format of the location\n    field as well as the subtitle and booksubtitle fields\n  editor:\n  - family: Westfahl\n    given: Gary\n  id: \"westfahl:frontier\"\n  issued: 2000\n  language: en-US\n  publisher: Greenwood\n  publisher-place: Westport, Conn.; London\n  title: \"Space and beyond: The frontier theme in science fiction\"\n  title-short: Space and beyond\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-incollection.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@string{hup = {Harvard University Press}}\n\n@incollection{brandt,\n\tAnnotation = {An incollection entry with a series and a number. Note the format of the printed name and compare the useprefix option in the options field as well as vangennep. Also note the indextitle, and indexsorttitle fields},\n\tAuthor = {von Brandt, Ahasver and Hoffmann, Erich},\n\tBooktitle = {Europa im Hoch- und Spätmittelalter},\n\tDate = 1987,\n\tEditor = {Seibt, Ferdinand},\n\tHyphenation = {german},\n\tIndexsorttitle = {Nordischen Lander von der Mitte des 11. Jahrhunderts bis 1448},\n\tIndextitle = {Nordischen Länder von der Mitte des 11.~Jahrhunderts bis 1448, Die},\n\tLocation = {Stuttgart},\n\tNumber = 2,\n\tOptions = {useprefix=false},\n\tPages = {884-917},\n\tPublisher = {Klett-Cotta},\n\tSeries = {Handbuch der europäischen Geschichte},\n\tShorttitle = {Die nordischen Länder},\n\tTitle = {Die nordischen Länder von der Mitte des 11.~Jahrhunderts bis 1448}}\n\n@incollection{hyman,\n\tAnnotation = {An incollection entry with a series and number field},\n\tAuthor = {Hyman, Arthur},\n\tBooktitle = {Studies in {Aristotle}},\n\tDate = 1981,\n\tEditor = {O'Meara, Dominic J.},\n\tHyphenation = {american},\n\tIndextitle = {Aristotle's Theory of the Intellect},\n\tKeywords = {secondary},\n\tLocation = {Washington, D.C.},\n\tNumber = 9,\n\tPages = {161-191},\n\tPublisher = {The Catholic University of America Press},\n\tSeries = {Studies in Philosophy and the History of Philosophy},\n\tShorttitle = {Aristotle's Theory of the Intellect},\n\tTitle = {Aristotle's Theory of the Intellect and its Interpretation by {Averroes}}}\n\n@incollection{pines,\n\tAnnotation = {A typical incollection entry. Note the indextitle field},\n\tAuthor = {Pines, Shlomo},\n\tBooktitle = {Studies in Medieval {Jewish} History and Literature},\n\tDate = 1979,\n\tEditor = {Twersky, Isadore},\n\tHyphenation = {american},\n\tIndextitle = {Limitations of Human Knowledge According to Al-Farabi, ibn Bajja, and Maimonides, The},\n\tKeywords = {secondary},\n\tLocation = {Cambridge, Mass.},\n\tPages = {82-109},\n\tPublisher = hup,\n\tShorttitle = {Limitations of Human Knowledge},\n\tTitle = {The Limitations of Human Knowledge According to {Al-Farabi}, {ibn Bajja}, and {Maimonides}}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An incollection entry with a series and a number. Note the\n    format of the printed name and compare the useprefix option in the\n    options field as well as vangennep. Also note the indextitle, and\n    indexsorttitle fields\n  author:\n  - dropping-particle: von\n    family: Brandt\n    given: Ahasver\n  - family: Hoffmann\n    given: Erich\n  collection-number: 2\n  collection-title: Handbuch der europäischen Geschichte\n  container-title: Europa im Hoch- und Spätmittelalter\n  editor:\n  - family: Seibt\n    given: Ferdinand\n  id: brandt\n  issued: 1987\n  language: de-DE\n  page: 884-917\n  publisher: Klett-Cotta\n  publisher-place: Stuttgart\n  title: Die nordischen Länder von der Mitte des 11. Jahrhunderts bis\n    1448\n  title-short: Die nordischen Länder\n  type: chapter\n- annote: An incollection entry with a series and number field\n  author:\n  - family: Hyman\n    given: Arthur\n  collection-number: 9\n  collection-title: Studies in philosophy and the history of philosophy\n  container-title: Studies in Aristotle\n  editor:\n  - family: O'Meara\n    given: Dominic J.\n  id: hyman\n  issued: 1981\n  keyword: secondary\n  language: en-US\n  page: 161-191\n  publisher: The Catholic University of America Press\n  publisher-place: Washington, D.C.\n  title: Aristotle's theory of the intellect and its interpretation by\n    Averroes\n  title-short: Aristotle's theory of the intellect\n  type: chapter\n- annote: A typical incollection entry. Note the indextitle field\n  author:\n  - family: Pines\n    given: Shlomo\n  container-title: Studies in medieval Jewish history and literature\n  editor:\n  - family: Twersky\n    given: Isadore\n  id: pines\n  issued: 1979\n  keyword: secondary\n  language: en-US\n  page: 82-109\n  publisher: Harvard University Press\n  publisher-place: Cambridge, Mass.\n  title: The limitations of human knowledge according to Al-Farabi, [ibn\n    Bajja]{.nocase}, and Maimonides\n  title-short: Limitations of human knowledge\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-inproceedings.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@string{cup = {Cambridge University Press}}\n\n@inproceedings{moraux,\n\tAnnotation = {This is a typical inproceedings entry. Note the booksubtitle, shorttitle, indextitle, and indexsorttitle fields. Also note the eventdate field.},\n\tAuthor = {Moraux, Paul},\n\tBooktitle = {Aristotle on Mind and the Senses},\n\tBooktitleaddon = {Proceedings of the Seventh Symposium Aristotelicum},\n\tDate = 1979,\n\tEditor = {Lloyd, G. E. R. and Owen, G. E. L.},\n\tEventdate = 1975,\n\tHyphenation = {french},\n\tIndexsorttitle = {De Anima dans la tradition grecque},\n\tIndextitle = {\\emph{De Anima} dans la tradition grècque, Le},\n\tKeywords = {secondary},\n\tLocation = {Cambridge},\n\tPages = {281-324},\n\tPublisher = cup,\n\tShorttitle = {\\emph{De Anima} dans la tradition grècque},\n\tSubtitle = {Quelques aspects de l'interpretation du traité, de Theophraste à Themistius},\n\tTitle = {Le \\emph{De Anima} dans la tradition grècque}}\n\n@inproceedings{salam,\n\tAuthor = {Salam, Abdus},\n\tBooksubtitle = {Relativistic groups and analyticity},\n\tBooktitle = {Elementary particle theory},\n\tBooktitleaddon = {Proceedings of the Eighth {Nobel} Symposium},\n\tDate = 1968,\n\tEditor = {Svartholm, Nils},\n\tEventdate = {1968-05-19/1968-05-25},\n\tLocation = {Stockholm},\n\tPages = {367-377},\n\tPublisher = {Almquist \\& Wiksell},\n\tTitle = {Weak and Electromagnetic Interactions},\n\tVenue = {Aspenäsgarden, Lerum}}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a typical inproceedings entry. Note the booksubtitle,\n    shorttitle, indextitle, and indexsorttitle fields. Also note the\n    eventdate field.\n  author:\n  - family: Moraux\n    given: Paul\n  container-title: Aristotle on Mind and the Senses. Proceedings of the\n    Seventh Symposium Aristotelicum\n  editor:\n  - family: Lloyd\n    given: G. E. R.\n  - family: Owen\n    given: G. E. L.\n  event-date: 1975\n  id: moraux\n  issued: 1979\n  keyword: secondary\n  language: fr-FR\n  page: 281-324\n  publisher: Cambridge University Press\n  publisher-place: Cambridge\n  title: \"Le *De Anima* dans la tradition grècque: Quelques aspects de\n    l'interpretation du traité, de Theophraste à Themistius\"\n  title-short: \"*De Anima* dans la tradition grècque\"\n  type: paper-conference\n- author:\n  - family: Salam\n    given: Abdus\n  container-title: \"Elementary particle theory: Relativistic groups and\n    analyticity. Proceedings of the eighth Nobel symposium\"\n  editor:\n  - family: Svartholm\n    given: Nils\n  event-date: 1968-05-19/1968-05-25\n  event-place: Aspenäsgarden, Lerum\n  id: salam\n  issued: 1968\n  page: 367-377\n  publisher: Almquist & Wiksell\n  publisher-place: Stockholm\n  title: Weak and electromagnetic interactions\n  type: paper-conference\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-issue288.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@thesis{Leavitt_2016,\nlocation = {{Los Angeles, CA}},\ntitle = {Upvoting the News: {{Breaking}} News Aggregation, Crowd Collaboration,\nand Algorithm-Driven Attention on Reddit.Com},\ntimestamp = {2017-04-06T14:13:22Z},\nlangid = {english},\ninstitution = {{University of Southern California}},\ntype = {Dissertation},\nauthor = {Leavitt, Alex},\ndate = {2016-08},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Leavitt\n    given: Alex\n  genre: Dissertation\n  id: Leavitt_2016\n  issued: 2016-08\n  language: en-US\n  publisher: University of Southern California\n  publisher-place: Los Angeles, CA\n  title: \"Upvoting the news: Breaking news aggregation, crowd\n    collaboration, and algorithm-driven attention on reddit.com\"\n  title-short: Upvoting the news\n  type: thesis\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-itzhaki.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Itzhaki 1996)\n\nItzhaki, Nissan. 1996. “Some Remarks on ’t Hooft’s S-matrix for Black\nHoles” (version 1). March 11.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Itzhaki, 1996)\n\nItzhaki, N. (1996, March 11). Some remarks on ’t Hooft’s S-matrix for\nblack holes.\n\n\nNOTES:\n\n- biblio2yaml:\n\t- eprinttype = {arxiv}, eprint = {hep-th/9603067}, \n\t  should be converted to a url: http://arxiv.org/abs/hep-th/9603067\n\t  (prefix http://arxiv.org/abs/ seems to work for all arxiv material)\n\n- citeproc:\n\t- obtaining correct case of \"'t Hooft's\" in title is possible but awkward:\n\t  '{t Hooft's} works; {'t Hooft}'s or '{t Hooft}'s do not\n\n}\n\n@Online{itzhaki,\n  author       = {Itzhaki, Nissan},\n  title        = {Some remarks on '{t Hooft's} {S}-matrix for black holes},\n  date         = {1996-03-11},\n  version      = 1,\n  hyphenation  = {american},\n  eprinttype   = {arxiv},\n  eprint       = {hep-th/9603067},\n  annotation   = {An online reference from arXiv. Note the\n                  eprint and eprinttype fields. Also note that\n                  the arXiv reference is transformed into a clickable link if\n                  hyperref support has been enabled},\n  abstract     = {We discuss the limitations of 't Hooft's proposal for the\n                  black hole S-matrix. We find that the validity of the S-matrix\n                  implies violation of the semi-classical approximation at\n                  scales large compared to the Planck scale. We also show that\n                  the effect of the centrifugal barrier on the S-matrix is\n                  crucial even for large transverse distances.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- abstract: We discuss the limitations of 't Hooft's proposal for the\n    black hole S-matrix. We find that the validity of the S-matrix\n    implies violation of the semi-classical approximation at scales\n    large compared to the Planck scale. We also show that the effect of\n    the centrifugal barrier on the S-matrix is crucial even for large\n    transverse distances.\n  annote: An online reference from arXiv. Note the eprint and eprinttype\n    fields. Also note that the arXiv reference is transformed into a\n    clickable link if hyperref support has been enabled\n  author:\n  - family: Itzhaki\n    given: Nissan\n  id: itzhaki\n  issued: 1996-03-11\n  language: en-US\n  title: Some remarks on '[t Hooft's]{.nocase} S-matrix for black holes\n  type: webpage\n  url: \"https://arxiv.org/abs/hep-th/9603067\"\n  version: 1\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-jaffe.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Jaffé 1885–1888)\n\nJaffé, Philipp, ed. 1885–1888. *Regesta Pontificum Romanorum ab condita\necclesia ad annum post Christum natum \\<span\nStyle=\"font-variant:small-caps;\"\\>mcxcviii\\</span\\>*. 2nd ed. 2.\nLeipzig.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Jaffé, 1885–1888)\n\nJaffé, P. (Ed.). (1885–1888). *Regesta Pontificum Romanorum ab condita\necclesia ad annum post Christum natum \\<span\nstyle=\"font-variant:small-caps;\"\\>mcxcviii\\</span\\>* (2nd ed., 1-2).\nLeipzig.\n\n\nNOTES:\n\n- biblatex conversion:\n\t- hyphenation = {latin}\n- citeproc:\n\t- \"vols.\" is missing\n\t\t- works in Zotero\n\t\t- This does not show up in the tests from the citeproc test suite that currently fail.\n\t- \"\\<span ...\\> needs to be fixed.\n\t\t- maybe add markdown syntax ^^small caps^^ ?\n\t\t- in pandoc \"plain\" output, small caps could be converted to uppercase chars: \"MCXCVIII\" would definitely look better here.\n\n}\n\n@Collection{jaffe,\n  editor       = {Jaff{\\'e}, Philipp},\n  title        = {Regesta Pontificum Romanorum ab condita ecclesia ad annum post\n                  Christum natum \\textsc{mcxcviii}},\n  date         = {1885/1888},\n  editora      = {Loewenfeld, Samuel and Kaltenbrunner, Ferdinand and Ewald,\n                  Paul},\n  edition      = 2,\n  volumes      = 2,\n  location     = {Leipzig},\n  editoratype  = {redactor},\n  indextitle   = {Regesta Pontificum Romanorum},\n  shorttitle   = {Regesta Pontificum Romanorum},\n  annotation   = {A collection entry with edition and\n                  volumes fields. Note the editora and\n                  editoratype fields},\n  hyphenation  = {latin},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A collection entry with edition and volumes fields. Note the\n    editora and editoratype fields\n  edition: 2\n  editor:\n  - family: Jaffé\n    given: Philipp\n  id: jaffe\n  issued: 1885/1888\n  language: la\n  number-of-volumes: 2\n  publisher-place: Leipzig\n  title: Regesta Pontificum Romanorum ab condita ecclesia ad annum post\n    Christum natum [mcxcviii]{.smallcaps}\n  title-short: Regesta Pontificum Romanorum\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-jcg.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(“Semantic 3D Media and Content” 2011)\n\n“Semantic 3D Media and Content.” 2011. *Computers and Graphics* 35 (4).\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(“Semantic 3D media and content,” 2011)\n\nSemantic 3D media and content. (2011). *Computers and Graphics*,\n*35*(4).\n\n\nNOTES:\n\t- output looks OK even if indistinguishable from article without page numbers\n\n}\n\n@Periodical{jcg,\n  title        = {Computers and Graphics},\n  year         = 2011,\n  issuetitle   = {Semantic {3D} Media and Content},\n  volume       = 35,\n  number       = 4,\n  issn         = {0097-8493},\n  annotation   = {This is a periodical entry with an issn\n                  field.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a periodical entry with an issn field.\n  container-title: Computers and Graphics\n  id: jcg\n  issn: 0097-8493\n  issue: 4\n  issued: 2011\n  title: Semantic 3D media and content\n  type: article-journal\n  volume: 35\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kant-kpv.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kant 1968)\n\nKant, Immanuel. 1968. “Kritik der praktischen Vernunft.” In *Kants\nWerke. Akademie Textausgabe*, by Immanuel Kant, 5:1–163. Berlin: Walter\nde Gruyter.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kant, 1968)\n\nKant, I. (1968). Kritik der praktischen Vernunft. In *Kants Werke.\nAkademie Textausgabe* (Vol. 5, pp. 1–163). Berlin: Walter de Gruyter.\n\n\nNOTES:\n\n- citeproc\n\t- support for the not yet official \"volume-title\" is missing\n\n- csl style file\n\t- if author and container-author are identical, container-author should be suppressed (apparently csl style file issue; zotero shows same behaviour)\n\n}\n\n@InBook{kant:kpv,\n  title        = {Kritik der praktischen Vernunft},\n  date         = 1968,\n  author       = {Kant, Immanuel},\n  booktitle    = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},\n  bookauthor   = {Kant, Immanuel},\n  maintitle    = {Kants Werke. Akademie Textausgabe},\n  volume       = 5,\n  publisher    = {Walter de Gruyter},\n  location     = {Berlin},\n  pages        = {1-163},\n  shorthand    = {KpV},\n  hyphenation  = {german},\n  shorttitle   = {Kritik der praktischen Vernunft},\n  annotation   = {An edition of Kant's \\emph{Collected Works}, volume five. This\n                  is an inbook entry which explicitly refers to the\n                  \\emph{Critique of Practical Reason} only, not to the entire\n                  fifth volume. Note the author and bookauthor\n                  fields in the database file. By default, the\n                  bookauthor is omitted if the values of the\n                  author and bookauthor fields are identical},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An edition of Kant's *Collected Works*, volume five. This is\n    an inbook entry which explicitly refers to the *Critique of\n    Practical Reason* only, not to the entire fifth volume. Note the\n    author and bookauthor fields in the database file. By default, the\n    bookauthor is omitted if the values of the author and bookauthor\n    fields are identical\n  author:\n  - family: Kant\n    given: Immanuel\n  container-author:\n  - family: Kant\n    given: Immanuel\n  container-title: Kants Werke. Akademie Textausgabe\n  id: \"kant:kpv\"\n  issued: 1968\n  language: de-DE\n  page: 1-163\n  publisher: Walter de Gruyter\n  publisher-place: Berlin\n  title: Kritik der praktischen Vernunft\n  title-short: Kritik der praktischen Vernunft\n  type: chapter\n  volume: 5\n  volume-title: Kritik der praktischen Vernunft. Kritik der\n    Urtheilskraft\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kant-ku.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kant 1968)\n\nKant, Immanuel. 1968. “Kritik der Urtheilskraft.” In *Kants Werke.\nAkademie Textausgabe*, by Immanuel Kant, 5:165–485. Berlin: Walter de\nGruyter.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kant, 1968)\n\nKant, I. (1968). Kritik der Urtheilskraft. In *Kants Werke. Akademie\nTextausgabe* (Vol. 5, pp. 165–485). Berlin: Walter de Gruyter.\n\n\nNOTES:\n\n- citeproc\n\t- support for the not yet official \"volume-title\" is missing\n\t\n- CSL style file\n\t- if author and container-author are identical, container-author should be suppressed (apparently csl style file issue; zotero shows same behaviour)\n\n}\n\n@InBook{kant:ku,\n  title        = {Kritik der Urtheilskraft},\n  date         = 1968,\n  author       = {Kant, Immanuel},\n  booktitle    = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},\n  bookauthor   = {Kant, Immanuel},\n  maintitle    = {Kants Werke. Akademie Textausgabe},\n  volume       = 5,\n  publisher    = {Walter de Gruyter},\n  location     = {Berlin},\n  pages        = {165-485},\n  shorthand    = {KU},\n  hyphenation  = {german},\n  annotation   = {An edition of Kant's \\emph{Collected Works}, volume five. This\n                  is an inbook entry which explicitly refers to the\n                  \\emph{Critique of Judgment} only, not to the entire fifth\n                  volume},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An edition of Kant's *Collected Works*, volume five. This is\n    an inbook entry which explicitly refers to the *Critique of\n    Judgment* only, not to the entire fifth volume\n  author:\n  - family: Kant\n    given: Immanuel\n  container-author:\n  - family: Kant\n    given: Immanuel\n  container-title: Kants Werke. Akademie Textausgabe\n  id: \"kant:ku\"\n  issued: 1968\n  language: de-DE\n  page: 165-485\n  publisher: Walter de Gruyter\n  publisher-place: Berlin\n  title: Kritik der Urtheilskraft\n  type: chapter\n  volume: 5\n  volume-title: Kritik der praktischen Vernunft. Kritik der\n    Urtheilskraft\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kastenholz.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kastenholz and Hünenberger 2006)\n\nKastenholz, M. A., and Philippe H. Hünenberger. 2006. “Computation of\nMethodologyindependent Ionic Solvation Free Energies from Molecular\nSimulations: I. the Electrostatic Potential in Molecular Liquids.”\n*J. Chem. Phys.* 124.\ndoi:[10.1063/1.2172593](https://doi.org/10.1063/1.2172593 \"10.1063/1.2172593\").\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kastenholz & Hünenberger, 2006)\n\nKastenholz, M. A., & Hünenberger, P. H. (2006). Computation of\nmethodologyindependent ionic solvation free energies from molecular\nsimulations: I. the electrostatic potential in molecular liquids.\n*J. Chem. Phys.*, *124*.\ndoi:[10.1063/1.2172593](https://doi.org/10.1063/1.2172593 \"10.1063/1.2172593\")\n\n\nNOTES:\n\n- biblio2xaml\n\t- fix conversion of \"\\hyphen”\n\t- the string \"doi:\" should not appear as part of the content of the \"doi\" field \n\n}\n\n@string{ jchph   = {J.~Chem. Phys.} }\n\n@Article{kastenholz,\n  author       = {Kastenholz, M. A. and H{\\\"u}nenberger, Philippe H.},\n  title        = {Computation of methodology\\hyphen independent ionic solvation\n                  free energies from molecular simulations},\n  journaltitle = jchph,\n  date         = 2006,\n  subtitle     = {I. {The} electrostatic potential in molecular liquids},\n  volume       = 124,\n  eid          = 124106,\n  doi          = {10.1063/1.2172593},\n  hyphenation  = {american},\n  indextitle   = {Computation of ionic solvation free energies},\n  annotation   = {An article entry with an eid and a\n                  doi field. Note that the \\textsc{doi} is transformed\n                  into a clickable link if hyperref support has been\n                  enabled},\n  abstract     = {The computation of ionic solvation free energies from\n                  atomistic simulations is a surprisingly difficult problem that\n                  has found no satisfactory solution for more than 15 years. The\n                  reason is that the charging free energies evaluated from such\n                  simulations are affected by very large errors. One of these is\n                  related to the choice of a specific convention for summing up\n                  the contributions of solvent charges to the electrostatic\n                  potential in the ionic cavity, namely, on the basis of point\n                  charges within entire solvent molecules (M scheme) or on the\n                  basis of individual point charges (P scheme). The use of an\n                  inappropriate convention may lead to a charge-independent\n                  offset in the calculated potential, which depends on the\n                  details of the summation scheme, on the quadrupole-moment\n                  trace of the solvent molecule, and on the approximate form\n                  used to represent electrostatic interactions in the\n                  system. However, whether the M or P scheme (if any) represents\n                  the appropriate convention is still a matter of on-going\n                  debate. The goal of the present article is to settle this\n                  long-standing controversy by carefully analyzing (both\n                  analytically and numerically) the properties of the\n                  electrostatic potential in molecular liquids (and inside\n                  cavities within them).},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- abstract: The computation of ionic solvation free energies from\n    atomistic simulations is a surprisingly difficult problem that has\n    found no satisfactory solution for more than 15 years. The reason is\n    that the charging free energies evaluated from such simulations are\n    affected by very large errors. One of these is related to the choice\n    of a specific convention for summing up the contributions of solvent\n    charges to the electrostatic potential in the ionic cavity, namely,\n    on the basis of point charges within entire solvent molecules (M\n    scheme) or on the basis of individual point charges (P scheme). The\n    use of an inappropriate convention may lead to a charge-independent\n    offset in the calculated potential, which depends on the details of\n    the summation scheme, on the quadrupole-moment trace of the solvent\n    molecule, and on the approximate form used to represent\n    electrostatic interactions in the system. However, whether the M or\n    P scheme (if any) represents the appropriate convention is still a\n    matter of on-going debate. The goal of the present article is to\n    settle this long-standing controversy by carefully analyzing (both\n    analytically and numerically) the properties of the electrostatic\n    potential in molecular liquids (and inside cavities within them).\n  annote: An article entry with an eid and a doi field. Note that the\n    [doi]{.smallcaps} is transformed into a clickable link if hyperref\n    support has been enabled\n  author:\n  - family: Kastenholz\n    given: M. A.\n  - family: Hünenberger\n    given: Philippe H.\n  container-title: J. Chem. Phys.\n  doi: 10.1063/1.2172593\n  id: kastenholz\n  issued: 2006\n  language: en-US\n  title: \"Computation of methodology-independent ionic solvation free\n    energies from molecular simulations: I. The electrostatic potential\n    in molecular liquids\"\n  title-short: Computation of methodology-independent ionic solvation\n    free energies from molecular simulations\n  type: article-journal\n  volume: 124\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct-a.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Knuth 1984)\n\nKnuth, Donald E. 1984. *Computers & Typesetting*. Vol. A. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Knuth, 1984)\n\nKnuth, D. E. (1984). *Computers & typesetting* (Vol. A). Reading, Mass.:\nAddison-Wesley.\n\n\nNOTES:\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@Book{knuth:ct:a,\n  author       = {Knuth, Donald E.},\n  title        = {The {\\TeX} book},\n  date         = 1984,\n  maintitle    = {Computers \\& Typesetting},\n  volume       = {A},\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1984-1},\n  sorttitle    = {Computers & Typesetting A},\n  indexsorttitle= {The TeXbook},\n  indextitle   = {\\protect\\TeX book, The},\n  shorttitle   = {\\TeX book},\n  annotation   = {The first volume of a five-volume book. Note the\n                  sorttitle and sortyear fields. We want this\n                  volume to be listed after the entry referring to the entire\n                  five-volume set. Also note the indextitle and\n                  indexsorttitle fields. Indexing packages that don't\n                  generate robust index entries require some control sequences\n                  to be protected from expansion},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: The first volume of a five-volume book. Note the sorttitle and\n    sortyear fields. We want this volume to be listed after the entry\n    referring to the entire five-volume set. Also note the indextitle\n    and indexsorttitle fields. Indexing packages that don't generate\n    robust index entries require some control sequences to be protected\n    from expansion\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct:a\"\n  issued: 1984\n  language: en-US\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  type: book\n  volume: A\n  volume-title: The TeX book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct-b.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2015-03-08:\n\n(Knuth 1986)\n\nKnuth, Donald E. 1986. *Computers & Typesetting*. Vol. B. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2015-03-08:\n\n(Knuth, 1986)\n\nKnuth, D. E. (1986). *Computers & typesetting* (Vol. B). Reading, Mass.:\nAddison-Wesley.\n\n\nNOTES:\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@Book{knuth:ct:b,\n  author       = {Knuth, Donald E.},\n  title        = {\\TeX: {T}he Program},\n  date         = 1986,\n  maintitle    = {Computers \\& Typesetting},\n  volume       = {B},\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1986-1},\n  sorttitle    = {Computers & Typesetting B},\n  indexsorttitle= {TeX: The Program},\n  shorttitle   = {\\TeX},\n  annotation   = {The second volume of a five-volume book. Note the\n                  sorttitle and sortyear fields. Also note the\n                  indexsorttitle field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: The second volume of a five-volume book. Note the sorttitle\n    and sortyear fields. Also note the indexsorttitle field\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct:b\"\n  issued: 1986\n  language: en-US\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  title-short: TeX\n  type: book\n  volume: B\n  volume-title: \"TeX: The program\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct-c.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2015-03-08:\n\n(Knuth 1986)\n\nKnuth, Donald E. 1986. *Computers & Typesetting*. Vol. C. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2015-03-08:\n\n(Knuth, 1986)\n\nKnuth, D. E. (1986). *Computers & typesetting* (Vol. C). Reading, Mass.:\nAddison-Wesley.\n\n\nNOTES:\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@Book{knuth:ct:c,\n  author       = {Knuth, Donald E.},\n  title        = {The {METAFONTbook}},\n  date         = 1986,\n  maintitle    = {Computers \\& Typesetting},\n  volume       = {C},\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1986-2},\n  sorttitle    = {Computers & Typesetting C},\n  indextitle   = {METAFONTbook, The},\n  shorttitle   = {{METAFONTbook}},\n  annotation   = {The third volume of a five-volume book. Note the\n                  sorttitle and sortyear fields as well as the\n                  indextitle field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: The third volume of a five-volume book. Note the sorttitle and\n    sortyear fields as well as the indextitle field\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct:c\"\n  issued: 1986\n  language: en-US\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  type: book\n  volume: C\n  volume-title: The METAFONTbook\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct-d.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2015-03-08:\n\n(Knuth 1986)\n\nKnuth, Donald E. 1986. *Computers & Typesetting*. Vol. D. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2015-03-08:\n\n(Knuth, 1986)\n\nKnuth, D. E. (1986). *Computers & typesetting* (Vol. D). Reading, Mass.:\nAddison-Wesley.\n\n\nNOTES:\n\n- biblio2yaml\n\t- Should letters following a colon, such as the \"T\" in \"{{METAFONT}: {T}he Program}\" be protected by default? -- I'm not sure ...\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@Book{knuth:ct:d,\n  author       = {Knuth, Donald E.},\n  title        = {{METAFONT}: {T}he Program},\n  date         = 1986,\n  maintitle    = {Computers \\& Typesetting},\n  volume       = {D},\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1986-3},\n  sorttitle    = {Computers & Typesetting D},\n  shorttitle   = {{METAFONT}},\n  annotation   = {The fourth volume of a five-volume book. Note the\n                  sorttitle and sortyear fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: The fourth volume of a five-volume book. Note the sorttitle\n    and sortyear fields\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct:d\"\n  issued: 1986\n  language: en-US\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  title-short: METAFONT\n  type: book\n  volume: D\n  volume-title: \"METAFONT: The program\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct-e.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2015-03-08:\n\n(Knuth 1986)\n\nKnuth, Donald E. 1986. *Computers & Typesetting*. Vol. E. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2015-03-08:\n\n(Knuth, 1986)\n\nKnuth, D. E. (1986). *Computers & typesetting* (Vol. E). Reading, Mass.:\nAddison-Wesley.\n\n\nNOTES:\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@Book{knuth:ct:e,\n  author       = {Knuth, Donald E.},\n  title        = {Computer Modern Typefaces},\n  date         = 1986,\n  maintitle    = {Computers \\& Typesetting},\n  volume       = {E},\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1986-4},\n  sorttitle    = {Computers & Typesetting E},\n  annotation   = {The fifth volume of a five-volume book. Note the\n                  sorttitle and sortyear fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: The fifth volume of a five-volume book. Note the sorttitle and\n    sortyear fields\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct:e\"\n  issued: 1986\n  language: en-US\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  type: book\n  volume: E\n  volume-title: Computer modern typefaces\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct-related.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Knuth 1984–1986)\n\nKnuth, Donald E. 1984–1986. *Computers & Typesetting*. 5. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Knuth, 1984–1986)\n\nKnuth, D. E. (1984–1986). *Computers & typesetting* (1-5). Reading,\nMass.: Addison-Wesley.\n\n\nNOTES:\n\n- biblio2yaml\n\t- related = {...}, relatedtype  = {multivolume}, -- no counterpart in CSL \n\n- citeproc\n\t- term \"vols.\" missing\n\n}\n\n@Book{knuth:ct:related,\n  author       = {Knuth, Donald E.},\n  title        = {Computers \\& Typesetting},\n  date         = {1984/1986},\n  volumes      = 5,\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1984-0},\n  sorttitle    = {Computers & Typesetting},\n  indexsorttitle= {Computers & Typesetting},\n  related      = {knuth:ct:a,knuth:ct:b,knuth:ct:c,knuth:ct:d,knuth:ct:e},\n  relatedtype  = {multivolume},\n  annotation   = {A five-volume book cited as a whole and related to its\n                  individual volumes. Note the related and\n                  relatedtype fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A five-volume book cited as a whole and related to its\n    individual volumes. Note the related and relatedtype fields\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct:related\"\n  issued: 1984/1986\n  language: en-US\n  number-of-volumes: 5\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-knuth-ct.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Knuth 1984–1986)\n\nKnuth, Donald E. 1984–1986. *Computers & Typesetting*. 5. Reading,\nMass.: Addison-Wesley.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Knuth, 1984–1986)\n\nKnuth, D. E. (1984–1986). *Computers & typesetting* (1-5). Reading,\nMass.: Addison-Wesley.\n\n\nNOTES:\n\n- citeproc\n\t- term \"vols.\" is missing\n\n}\n\n@Book{knuth:ct,\n  author       = {Knuth, Donald E.},\n  title        = {Computers \\& Typesetting},\n  date         = {1984/1986},\n  volumes      = 5,\n  publisher    = {Addison-Wesley},\n  location     = {Reading, Mass.},\n  hyphenation  = {american},\n  sortyear     = {1984-0},\n  sorttitle    = {Computers & Typesetting},\n  indexsorttitle= {Computers & Typesetting},\n  annotation   = {A five-volume book cited as a whole. This is a book\n                  entry, note the volumes field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A five-volume book cited as a whole. This is a book entry,\n    note the volumes field\n  author:\n  - family: Knuth\n    given: Donald E.\n  id: \"knuth:ct\"\n  issued: 1984/1986\n  language: en-US\n  number-of-volumes: 5\n  publisher: Addison-Wesley\n  publisher-place: Reading, Mass.\n  title: Computers & typesetting\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kowalik.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kowalik and Isard 1995)\n\nKowalik, F., and M. Isard. 1995. “Estimateur d’un défaut de\nfonctionnement d’un modulateur en quadrature et étage de modulation\nl’utilisant.” French patent request.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kowalik & Isard, 1995)\n\nKowalik, F., & Isard, M. (1995, January 11). Estimateur d’un défaut de\nfonctionnement d’un modulateur en quadrature et étage de modulation\nl’utilisant. French patent request.\n\n\n}\n\n@Patent{kowalik,\n  author       = {Kowalik, F. and Isard, M.},\n  title        = {Estimateur d'un d{\\'e}faut de fonctionnement d'un modulateur\n                  en quadrature et {\\'e}tage de modulation l'utilisant},\n  number       = 9500261,\n  date         = {1995-01-11},\n  type         = {patreqfr},\n  hyphenation  = {french},\n  indextitle   = {Estimateur d'un d{\\'e}faut de fonctionnement},\n  annotation   = {This is a patent entry for a French patent request\n                  with a full date. The number is given in the number\n                  field. Note the format of the type and date\n                  fields in the database file. Compare almendro,\n                  laufenberg, and sorace},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a patent entry for a French patent request with a full\n    date. The number is given in the number field. Note the format of\n    the type and date fields in the database file. Compare almendro,\n    laufenberg, and sorace\n  author:\n  - family: Kowalik\n    given: F.\n  - family: Isard\n    given: M.\n  genre: French patent request\n  id: kowalik\n  issued: 1995-01-11\n  language: fr-FR\n  number: 9500261\n  title: Estimateur d'un défaut de fonctionnement d'un modulateur en\n    quadrature et étage de modulation l'utilisant\n  type: patent\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kullback-related.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kullback 1997)\n\nKullback, Solomon. 1997. *Information Theory and Statistics*. New York:\nDover Publications.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kullback, 1997)\n\nKullback, S. (1997). *Information theory and statistics*. New York:\nDover Publications.\n\n\nNOTES:\n\n- related = {kullback}, relatedtype = {origpubin}, -- not possible in CSL\n\n}\n\n@Book{kullback:related,\n  author       = {Kullback, Solomon},\n  title        = {Information Theory and Statistics},\n  year         = 1997,\n  publisher    = {Dover Publications},\n  location     = {New York},\n  hyphenation  = {american},\n  related      = {kullback},\n  relatedtype  = {origpubin},\n  annotation   = {A reprint of the kullback entry. Note the format of\n                  the related and relatedtype fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A reprint of the kullback entry. Note the format of the\n    related and relatedtype fields\n  author:\n  - family: Kullback\n    given: Solomon\n  id: \"kullback:related\"\n  issued: 1997\n  language: en-US\n  publisher: Dover Publications\n  publisher-place: New York\n  title: Information theory and statistics\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kullback-reprint.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kullback 1997)\n\nKullback, Solomon. 1997. *Information Theory and Statistics*. New York:\nDover Publications.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kullback, 1997)\n\nKullback, S. (1997). *Information theory and statistics*. New York:\nDover Publications.\n\n\nNOTES:\n\nFormatted with chicago-author-date-TEST-20131018.csl \n\n(Kullback [1959] 1997)\n\nKullback, Solomon. (1959) 1997. *Information Theory and Statistics*. New\nYork: Dover Publications.\n\n}\n\n@Book{kullback:reprint,\n  author       = {Kullback, Solomon},\n  title        = {Information Theory and Statistics},\n  year         = 1997,\n  publisher    = {Dover Publications},\n  location     = {New York},\n  origyear     = 1959,\n  origpublisher= {John Wiley \\& Sons},\n  hyphenation  = {american},\n  annotation   = {A reprint of the kullback entry. Note the format of\n                  origyear and origpublisher. These fields are\n                  not used by the standard bibliography styles},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A reprint of the kullback entry. Note the format of origyear\n    and origpublisher. These fields are not used by the standard\n    bibliography styles\n  author:\n  - family: Kullback\n    given: Solomon\n  id: \"kullback:reprint\"\n  issued: 1997\n  language: en-US\n  original-date: 1959\n  original-publisher: John Wiley & Sons\n  publisher: Dover Publications\n  publisher-place: New York\n  title: Information theory and statistics\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-kullback.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Kullback 1959)\n\nKullback, Solomon. 1959. *Information Theory and Statistics*. New York:\nJohn Wiley & Sons.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Kullback, 1959)\n\nKullback, S. (1959). *Information theory and statistics*. New York: John\nWiley & Sons.\n\n\n}\n\n@Book{kullback,\n  author       = {Kullback, Solomon},\n  title        = {Information Theory and Statistics},\n  year         = 1959,\n  publisher    = {John Wiley \\& Sons},\n  location     = {New York},\n  hyphenation  = {american},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Kullback\n    given: Solomon\n  id: kullback\n  issued: 1959\n  language: en-US\n  publisher: John Wiley & Sons\n  publisher-place: New York\n  title: Information theory and statistics\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-laufenberg.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Laufenberg et al. 2006)\n\nLaufenberg, Xaver, Dominique Eynius, Helmut Suelzle, Stephan Usbeck,\nMatthias Spaeth, Miriam Neuser-Hoffmann, Christian Myrzik, et al. 2006.\n“Elektrische Einrichtung und Betriebsverfahren.” European patent.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Laufenberg et al., 2006)\n\nLaufenberg, X., Eynius, D., Suelzle, H., Usbeck, S., Spaeth, M.,\nNeuser-Hoffmann, M., … Ebner, N. (2006, September 13). Elektrische\nEinrichtung und Betriebsverfahren. European patent.\n\n\nNOTES:\n\n- biblio2yaml\n\t- Is there any equivalent of \"holder\" in CSL?\n\n}\n\n@Patent{laufenberg,\n  author       = {Laufenberg, Xaver and Eynius, Dominique and Suelzle, Helmut\n                  and Usbeck, Stephan and Spaeth, Matthias and Neuser-Hoffmann,\n                  Miriam and Myrzik, Christian and Schmid, Manfred and Nietfeld,\n                  Franz and Thiel, Alexander and Braun, Harald and Ebner,\n                  Norbert},\n  title        = {Elektrische Einrichtung und Betriebsverfahren},\n  number       = 1700367,\n  date         = {2006-09-13},\n  holder       = {{Robert Bosch GmbH} and {Daimler Chrysler AG} and {Bayerische\n                  Motoren Werke AG}},\n  type         = {patenteu},\n  hyphenation  = {german},\n  annotation   = {This is a patent entry with a holder field.\n                  Note the format of the type and location\n                  fields in the database file. Compare almendro,\n                  sorace, and kowalik},\n  abstract     = {The invention relates to an electric device comprising a\n                  generator, in particular for use in the vehicle electric\n                  system of a motor vehicle and a controller for controlling the\n                  generator voltage. The device is equipped with a control zone,\n                  in which the voltage is controlled and zones, in which the\n                  torque is controlled. The invention also relates to methods\n                  for operating a device of this type.},\n  file         = {http://v3.espacenet.com/textdoc?IDX=EP1700367},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- abstract: The invention relates to an electric device comprising a\n    generator, in particular for use in the vehicle electric system of a\n    motor vehicle and a controller for controlling the generator\n    voltage. The device is equipped with a control zone, in which the\n    voltage is controlled and zones, in which the torque is controlled.\n    The invention also relates to methods for operating a device of this\n    type.\n  annote: This is a patent entry with a holder field. Note the format of\n    the type and location fields in the database file. Compare almendro,\n    sorace, and kowalik\n  author:\n  - family: Laufenberg\n    given: Xaver\n  - family: Eynius\n    given: Dominique\n  - family: Suelzle\n    given: Helmut\n  - family: Usbeck\n    given: Stephan\n  - family: Spaeth\n    given: Matthias\n  - family: Neuser-Hoffmann\n    given: Miriam\n  - family: Myrzik\n    given: Christian\n  - family: Schmid\n    given: Manfred\n  - family: Nietfeld\n    given: Franz\n  - family: Thiel\n    given: Alexander\n  - family: Braun\n    given: Harald\n  - family: Ebner\n    given: Norbert\n  genre: European patent\n  id: laufenberg\n  issued: 2006-09-13\n  language: de-DE\n  number: 1700367\n  title: Elektrische Einrichtung und Betriebsverfahren\n  type: patent\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-loh.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Loh 1992)\n\nLoh, Nin C. 1992. “High-resolution Micromachined Interferometric\nAccelerometer.” Master’s thesis, Cambridge, Mass.: Massachusetts\nInstitute of Technology.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Loh, 1992)\n\nLoh, N. C. (1992). *High-resolution micromachined interferometric\naccelerometer* (Master’s thesis). Massachusetts Institute of Technology,\nCambridge, Mass.\n\n\nNOTES:\n\n- biblio2yaml\n\t- At some point, actual localization of \"localization keys\" will have to be implemented\n\n}\n\n@Thesis{loh,\n  author       = {Loh, Nin C.},\n  title        = {High-Resolution Micromachined Interferometric Accelerometer},\n  type         = {mathesis},\n  institution  = {Massachusetts Institute of Technology},\n  date         = 1992,\n  location     = {Cambridge, Mass.},\n  hyphenation  = {american},\n  annotation   = {This is a typical thesis entry for an MA thesis. Note\n                  the type field in the database file which uses a\n                  localization key},\n}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a typical thesis entry for an MA thesis. Note the type\n    field in the database file which uses a localization key\n  author:\n  - family: Loh\n    given: Nin C.\n  genre: Master's thesis\n  id: loh\n  issued: 1992\n  language: en-US\n  publisher: Massachusetts Institute of Technology\n  publisher-place: Cambridge, Mass.\n  title: High-resolution micromachined interferometric accelerometer\n  type: thesis\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-malinowski.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Malinowski 1972)\n\nMalinowski, Bronisław. 1972. *Argonauts of the Western Pacific: An\nAccount of Native Enterprise and Adventure in the Archipelagoes of\nMelanesian New Guinea*. 8th ed. London: Routledge and Kegan Paul.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Malinowski, 1972)\n\nMalinowski, B. (1972). *Argonauts of the Western Pacific: An account of\nnative enterprise and adventure in the Archipelagoes of Melanesian New\nGuinea* (8th ed.). London: Routledge and Kegan Paul.\n\n\n}\n\n@Book{malinowski,\n  author       = {Malinowski, Bronis{\\l}aw},\n  title        = {Argonauts of the {Western Pacific}},\n  date         = 1972,\n  edition      = 8,\n  publisher    = {Routledge {and} Kegan Paul},\n  location     = {London},\n  hyphenation  = {british},\n  subtitle     = {An account of native enterprise and adventure in the\n                  {Archipelagoes of Melanesian New Guinea}},\n  shorttitle   = {Argonauts},\n  annotation   = {This is a book entry. Note the format of the\n                  publisher and edition fields as well as the\n                  subtitle field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a book entry. Note the format of the publisher and\n    edition fields as well as the subtitle field\n  author:\n  - family: Malinowski\n    given: Bronisław\n  edition: 8\n  id: malinowski\n  issued: 1972\n  language: en-GB\n  publisher: Routledge and Kegan Paul\n  publisher-place: London\n  title: \"Argonauts of the Western Pacific: An account of native\n    enterprise and adventure in the [Archipelagoes of Melanesian New\n    Guinea]{.nocase}\"\n  title-short: Argonauts\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-manual.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@Manual{cms,\n  title        = {The {Chicago} Manual of Style},\n  date         = 2003,\n  subtitle     = {The Essential Guide for Writers, Editors, and Publishers},\n  edition      = 15,\n  publisher    = {University of Chicago Press},\n  location     = {Chicago, Ill.},\n  isbn         = {0-226-10403-6},\n  label        = {CMS},\n  hyphenation  = {american},\n  sorttitle    = {Chicago Manual of Style},\n  indextitle   = {Chicago Manual of Style, The},\n  shorttitle   = {Chicago Manual of Style},\n  annotation   = {This is a manual entry without an author or\n                  editor. Note the label field in the database\n                  file which is provided for author-year citation styles. Also\n                  note the sorttitle and indextitle fields. By\n                  default, all entries without an author or\n                  editor are alphabetized by title but we want\n                  this entry to be alphabetized under \\enquote*{C} rather than\n                  \\enquote*{T}. There's also an isbn field},\n}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a manual entry without an author or editor. Note the\n    label field in the database file which is provided for author-year\n    citation styles. Also note the sorttitle and indextitle fields. By\n    default, all entries without an author or editor are alphabetized by\n    title but we want this entry to be alphabetized under 'C' rather\n    than 'T'. There's also an isbn field\n  edition: 15\n  id: cms\n  isbn: 0-226-10403-6\n  issued: 2003\n  language: en-US\n  publisher: University of Chicago Press\n  publisher-place: Chicago, Ill.\n  title: \"The Chicago manual of style: The essential guide for writers,\n    editors, and publishers\"\n  title-short: Chicago manual of style\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-markey.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Markey 2005)\n\nMarkey, Nicolas. 2005. “Tame the BeaST: The B to X of BibTeX” (version\n1.3). October 16.\n<http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf>.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Markey, 2005)\n\nMarkey, N. (2005, October 16). Tame the BeaST: The B to X of BibTeX.\nRetrieved October 01, 2006, from\n<http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf>\n\n\n}\n\n@Online{markey,\n  author       = {Markey, Nicolas},\n  title        = {Tame the {BeaST}},\n  date         = {2005-10-16},\n  url          =\n                  {http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf},\n  subtitle     = {The {B} to {X} of {BibTeX}},\n  version      = {1.3},\n  urldate      = {2006-10-01},\n  hyphenation  = {american},\n  sorttitle    = {Tame the Beast},\n  annotation   = {An online entry for a tutorial. Note the format of\n                  the date field (yyyy-mm-dd) in the database\n                  file.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- accessed: 2006-10-01\n  annote: An online entry for a tutorial. Note the format of the date\n    field (yyyy-mm-dd) in the database file.\n  author:\n  - family: Markey\n    given: Nicolas\n  id: markey\n  issued: 2005-10-16\n  language: en-US\n  title: \"Tame the BeaST: The B to X of BibTeX\"\n  title-short: Tame the BeaST\n  type: webpage\n  url: \"http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf\"\n  version: 1.3\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-maron.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Maron 2000)\n\nMaron, Monika. 2000. *Animal Triste*. Translated by Brigitte Goldstein.\nLincoln: University of Nebraska Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Maron, 2000)\n\nMaron, M. (2000). *Animal triste*. (B. Goldstein, Trans.). Lincoln:\nUniversity of Nebraska Press.\n\n\nNOTES:\n\n-   origlanguage concatenated with translator, e.g. “translated from the German by …” not possible in CSL\n\n}\n\n@Book{maron,\n  author       = {Maron, Monika},\n  title        = {Animal Triste},\n  date         = 2000,\n  translator   = {Brigitte Goldstein},\n  origlanguage = {german},\n  publisher    = {University of Nebraska Press},\n  location     = {Lincoln},\n  hyphenation  = {american},\n  shorttitle   = {Animal Triste},\n  annotation   = {An English translation of a German novel with a French title.\n                  In other words: a book entry with a\n                  translator field.  Note the origlanguage\n                  field which is concatenated with the translator},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: \"An English translation of a German novel with a French title.\n    In other words: a book entry with a translator field. Note the\n    origlanguage field which is concatenated with the translator\"\n  author:\n  - family: Maron\n    given: Monika\n  id: maron\n  issued: 2000\n  language: en-US\n  publisher: University of Nebraska Press\n  publisher-place: Lincoln\n  title: Animal triste\n  title-short: Animal triste\n  translator:\n  - family: Goldstein\n    given: Brigitte\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-massa.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Massa 2004)\n\nMassa, Werner. 2004. *Crystal Structure Determination*. 2nd ed. Berlin:\nSpinger.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Massa, 2004)\n\nMassa, W. (2004). *Crystal structure determination* (2nd ed.). Berlin:\nSpinger.\n\n\n}\n\n@Book{massa,\n  author       = {Werner Massa},\n  title        = {Crystal structure determination},\n  date         = 2004,\n  edition      = 2,\n  publisher    = {Spinger},\n  location     = {Berlin},\n  hyphenation  = {british},\n  annotation   = {A book entry with an edition field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry with an edition field\n  author:\n  - family: Massa\n    given: Werner\n  edition: 2\n  id: massa\n  issued: 2004\n  language: en-GB\n  publisher: Spinger\n  publisher-place: Berlin\n  title: Crystal structure determination\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-moore-related.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Moore 1998)\n\nMoore, Gordon E. 1998. “Cramming More Components onto Integrated\nCircuits.” *Proceedings of the IEEE* 86 (1): 82–85.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Moore, 1998)\n\nMoore, G. E. (1998). Cramming more components onto integrated circuits.\n*Proceedings of the IEEE*, *86*(1), 82–85.\n\n\nNOTES:\n\n- \"related = {moore}, relatedtype = {reprintfrom},\" – no equivalent implemented in CSL\n\n}\n\n@Article{moore:related,\n  author       = {Moore, Gordon E.},\n  title        = {Cramming more components onto integrated circuits},\n  journaltitle = {Proceedings of the {IEEE}},\n  year         = 1998,\n  volume       = 86,\n  number       = 1,\n  pages        = {82-85},\n  hyphenation  = {american},\n  related      = {moore},\n  relatedtype  = {reprintfrom},\n  annotation   = {A reprint of Moore's law. Note the related and\n                  relatedtype fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A reprint of Moore's law. Note the related and relatedtype\n    fields\n  author:\n  - family: Moore\n    given: Gordon E.\n  container-title: Proceedings of the IEEE\n  id: \"moore:related\"\n  issue: 1\n  issued: 1998\n  language: en-US\n  page: 82-85\n  title: Cramming more components onto integrated circuits\n  type: article-journal\n  volume: 86\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-moore.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Moore 1965)\n\nMoore, Gordon E. 1965. “Cramming More Components onto Integrated\nCircuits.” *Electronics* 38 (8): 114–117.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Moore, 1965)\n\nMoore, G. E. (1965). Cramming more components onto integrated circuits.\n*Electronics*, *38*(8), 114–117.\n\n\n}\n\n@Article{moore,\n  author       = {Moore, Gordon E.},\n  title        = {Cramming more components onto integrated circuits},\n  journaltitle = {Electronics},\n  year         = 1965,\n  volume       = 38,\n  number       = 8,\n  pages        = {114-117},\n  hyphenation  = {american},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Moore\n    given: Gordon E.\n  container-title: Electronics\n  id: moore\n  issue: 8\n  issued: 1965\n  language: en-US\n  page: 114-117\n  title: Cramming more components onto integrated circuits\n  type: article-journal\n  volume: 38\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-moraux.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Moraux 1979)\n\nMoraux, Paul. 1979. “Le *De Anima* dans la tradition grècque: Quelques\naspects de l’interpretation du traité, de Theophraste à Themistius.” In\n*Aristotle on Mind and the Senses. Proceedings of the Seventh Symposium\nAristotelicum*, edited by G. E. R. Lloyd and G. E. L. Owen, 281–324.\nCambridge: Cambridge University Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Moraux, 1979)\n\nMoraux, P. (1979). Le *De Anima* dans la tradition grècque: Quelques\naspects de l’interpretation du traité, de Theophraste à Themistius. In\nG. E. R. Lloyd & G. E. L. Owen (eds.), *Aristotle on Mind and the\nSenses. Proceedings of the Seventh Symposium Aristotelicum* (pp.\n281–324). Cambridge: Cambridge University Press.\n\n\nNOTES:\n\n- Since case (conversion) can only be specified per entry, not per field, for apa.csl the case of container-title would have to be adjusted manually.\n\n}\n\n@string{ cup     = {Cambridge University Press} }\n\n@InProceedings{moraux,\n  author       = {Moraux, Paul},\n  editor       = {Lloyd, G. E. R. and Owen, G. E. L.},\n  title        = {Le \\emph{De Anima} dans la tradition gr{\\`e}cque},\n  date         = 1979,\n  booktitle    = {Aristotle on Mind and the Senses},\n  subtitle     = {Quelques aspects de l'interpretation du trait{\\'e}, de\n                  Theophraste {\\`a} Themistius},\n  booktitleaddon= {Proceedings of the Seventh Symposium Aristotelicum},\n  eventdate    = 1975,\n  publisher    = cup,\n  location     = {Cambridge},\n  pages        = {281-324},\n  keywords     = {secondary},\n  hyphenation  = {french},\n  indexsorttitle= {De Anima dans la tradition grecque},\n  indextitle   = {\\emph{De Anima} dans la tradition gr{\\`e}cque, Le},\n  shorttitle   = {\\emph{De Anima} dans la tradition gr{\\`e}cque},\n  annotation   = {This is a typical inproceedings entry. Note the\n                  booksubtitle, shorttitle,\n                  indextitle, and indexsorttitle fields. Also\n                  note the eventdate field.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a typical inproceedings entry. Note the booksubtitle,\n    shorttitle, indextitle, and indexsorttitle fields. Also note the\n    eventdate field.\n  author:\n  - family: Moraux\n    given: Paul\n  container-title: Aristotle on Mind and the Senses. Proceedings of the\n    Seventh Symposium Aristotelicum\n  editor:\n  - family: Lloyd\n    given: G. E. R.\n  - family: Owen\n    given: G. E. L.\n  event-date: 1975\n  id: moraux\n  issued: 1979\n  keyword: secondary\n  language: fr-FR\n  page: 281-324\n  publisher: Cambridge University Press\n  publisher-place: Cambridge\n  title: \"Le *De Anima* dans la tradition grècque: Quelques aspects de\n    l'interpretation du traité, de Theophraste à Themistius\"\n  title-short: \"*De Anima* dans la tradition grècque\"\n  type: paper-conference\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-murray.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Hostetler et al. 1998)\n\nHostetler, Michael J., Julia E. Wingate, Chuan-Jian Zhong, Jay E.\nHarris, Richard W. Vachet, Michael R. Clark, J. David Londono, et al.\n1998. “Alkanethiolate Gold Cluster Molecules with Core Diameters from\n1.5 to 5.2 nm: Core and Monolayer Properties as a Function of Core\nSize.” *Langmuir* 14 (1): 17–30.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Hostetler et al., 1998)\n\nHostetler, M. J., Wingate, J. E., Zhong, C.-J., Harris, J. E., Vachet,\nR. W., Clark, M. R., … Murray, R. W. (1998). Alkanethiolate gold cluster\nmolecules with core diameters from 1.5 to 5.2 nm: Core and monolayer\nproperties as a function of core size. *Langmuir*, *14*(1), 17–30.\n\n\n}\n\n@Article{murray,\n  author       = {Hostetler, Michael J. and Wingate, Julia E. and Zhong,\n                  Chuan-Jian and Harris, Jay E. and Vachet, Richard W. and\n                  Clark, Michael R.  and Londono, J. David and Green, Stephen\n                  J. and Stokes, Jennifer J.  and Wignall, George D. and Glish,\n                  Gary L. and Porter, Marc D.  and Evans, Neal D. and Murray,\n                  Royce W.},\n  title        = {Alkanethiolate gold cluster molecules with core diameters from\n                  1.5 to 5.2~{nm}},\n  journaltitle = {Langmuir},\n  date         = 1998,\n  subtitle     = {Core and monolayer properties as a function of core size},\n  volume       = 14,\n  number       = 1,\n  pages        = {17-30},\n  hyphenation  = {american},\n  indextitle   = {Alkanethiolate gold cluster molecules},\n  shorttitle   = {Alkanethiolate gold cluster molecules},\n  annotation   = {An article entry with \\arabic{author} authors. By\n                  default, long author and editor lists are automatically\n                  truncated. This is configurable},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry with `\\arabic{author}`{=latex} authors. By\n    default, long author and editor lists are automatically truncated.\n    This is configurable\n  author:\n  - family: Hostetler\n    given: Michael J.\n  - family: Wingate\n    given: Julia E.\n  - family: Zhong\n    given: Chuan-Jian\n  - family: Harris\n    given: Jay E.\n  - family: Vachet\n    given: Richard W.\n  - family: Clark\n    given: Michael R.\n  - family: Londono\n    given: J. David\n  - family: Green\n    given: Stephen J.\n  - family: Stokes\n    given: Jennifer J.\n  - family: Wignall\n    given: George D.\n  - family: Glish\n    given: Gary L.\n  - family: Porter\n    given: Marc D.\n  - family: Evans\n    given: Neal D.\n  - family: Murray\n    given: Royce W.\n  container-title: Langmuir\n  id: murray\n  issue: 1\n  issued: 1998\n  language: en-US\n  page: 17-30\n  title: \"Alkanethiolate gold cluster molecules with core diameters from\n    1.5 to 5.2 [nm]{.nocase}: Core and monolayer properties as a\n    function of core size\"\n  title-short: Alkanethiolate gold cluster molecules\n  type: article-journal\n  volume: 14\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-nietzsche-historie.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Nietzsche 1988)\n\nNietzsche, Friedrich. 1988. “Unzeitgemässe Betrachtungen. Zweites Stück:\nVom Nutzen und Nachtheil der Historie für das Leben.” In *Sämtliche\nWerke: Kritische Studienausgabe*, by Friedrich Nietzsche, edited by\nGiorgio Colli and Mazzino Montinari, 1:243–334. München; Berlin; New\nYork: Deutscher Taschenbuch-Verlag; Walter de Gruyter.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Nietzsche, 1988)\n\nNietzsche, F. (1988). Unzeitgemässe Betrachtungen. Zweites Stück: Vom\nNutzen und Nachtheil der Historie für das Leben. In G. Colli & M.\nMontinari (eds.), *Sämtliche Werke: Kritische Studienausgabe* (Vol. 1,\npp. 243–334). München; Berlin; New York: Deutscher Taschenbuch-Verlag;\nWalter de Gruyter.\n\n\n}\n\n@string{ dtv     = {Deutscher Taschenbuch-Verlag} }\n\n@InBook{nietzsche:historie,\n  title        = {Unzeitgem{\\\"a}sse Betrachtungen. Zweites St{\\\"u}ck},\n  date         = 1988,\n  author       = {Nietzsche, Friedrich},\n  booktitle    = {Die Geburt der Trag{\\\"o}die. Unzeitgem{\\\"a}{\\ss}e\n                  Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},\n  bookauthor   = {Nietzsche, Friedrich},\n  editor       = {Colli, Giorgio and Montinari, Mazzino},\n  subtitle     = {Vom Nutzen und Nachtheil der Historie f{\\\"u}r das Leben},\n  maintitle    = {S{\\\"a}mtliche Werke},\n  mainsubtitle = {Kritische Studienausgabe},\n  volume       = 1,\n  publisher    = dtv # { and Walter de Gruyter},\n  location     = {M{\\\"u}nchen and Berlin and New York},\n  pages        = {243-334},\n  hyphenation  = {german},\n  sortyear     = {1988-2},\n  sorttitle    = {Werke-01-243},\n  indexsorttitle= {Vom Nutzen und Nachtheil der Historie fur das Leben},\n  indextitle   = {Vom Nutzen und Nachtheil der Historie f{\\\"u}r das Leben},\n  shorttitle   = {Vom Nutzen und Nachtheil der Historie},\n  annotation   = {A single essay from the critical edition of Nietzsche's works.\n                  This inbook entry explicitly refers to an essay found\n                  in the first volume. Note the title,\n                  booktitle, and maintitle fields. Also note\n                  the sorttitle and sortyear fields. We want\n                  this entry to be listed after the entry referring to the\n                  entire first volume},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A single essay from the critical edition of Nietzsche's works.\n    This inbook entry explicitly refers to an essay found in the first\n    volume. Note the title, booktitle, and maintitle fields. Also note\n    the sorttitle and sortyear fields. We want this entry to be listed\n    after the entry referring to the entire first volume\n  author:\n  - family: Nietzsche\n    given: Friedrich\n  container-author:\n  - family: Nietzsche\n    given: Friedrich\n  container-title: \"Sämtliche Werke: Kritische Studienausgabe\"\n  editor:\n  - family: Colli\n    given: Giorgio\n  - family: Montinari\n    given: Mazzino\n  id: \"nietzsche:historie\"\n  issued: 1988\n  language: de-DE\n  page: 243-334\n  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter\n  publisher-place: München; Berlin; New York\n  title: \"Unzeitgemässe Betrachtungen. Zweites Stück: Vom Nutzen und\n    Nachtheil der Historie für das Leben\"\n  title-short: Vom Nutzen und Nachtheil der Historie\n  type: chapter\n  volume: 1\n  volume-title: Die Geburt der Tragödie. Unzeitgemäße Betrachtungen\n    I--IV. Nachgelassene Schriften 1870--1973\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-nietzsche-ksa.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Nietzsche 1988)\n\nNietzsche, Friedrich. 1988. *Sämtliche Werke: Kritische Studienausgabe*.\nEdited by Giorgio Colli and Mazzino Montinari. 2nd ed. 15. München;\nBerlin; New York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Nietzsche, 1988)\n\nNietzsche, F. (1988). *Sämtliche Werke: Kritische Studienausgabe*. (G.\nColli & M. Montinari, eds.) (2nd ed., 1-15). München; Berlin; New York:\nDeutscher Taschenbuch-Verlag; Walter de Gruyter.\n\n\nNOTES:\n\n- biblio2yaml\n\t- term \"vols.\" missing\n\n}\n\n@string{ dtv     = {Deutscher Taschenbuch-Verlag} }\n\n@Book{nietzsche:ksa,\n  author       = {Nietzsche, Friedrich},\n  title        = {S{\\\"a}mtliche Werke},\n  date         = 1988,\n  editor       = {Colli, Giorgio and Montinari, Mazzino},\n  edition      = 2,\n  volumes      = 15,\n  publisher    = dtv # { and Walter de Gruyter},\n  location     = {M{\\\"u}nchen and Berlin and New York},\n  hyphenation  = {german},\n  sortyear     = {1988-0},\n  sorttitle    = {Werke-00-000},\n  indexsorttitle= {Samtliche Werke},\n  subtitle     = {Kritische Studienausgabe},\n  annotation   = {The critical edition of Nietzsche's works. This is a\n                  book entry referring to a 15-volume work as a\n                  whole. Note the volumes field and the format of the\n                  publisher and location fields in the\n                  database file. Also note the sorttitle and\n                  sortyear fields which are used to fine-tune the\n                  sorting order of the bibliography. We want this item listed\n                  first in the bibliography},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: The critical edition of Nietzsche's works. This is a book\n    entry referring to a 15-volume work as a whole. Note the volumes\n    field and the format of the publisher and location fields in the\n    database file. Also note the sorttitle and sortyear fields which are\n    used to fine-tune the sorting order of the bibliography. We want\n    this item listed first in the bibliography\n  author:\n  - family: Nietzsche\n    given: Friedrich\n  edition: 2\n  editor:\n  - family: Colli\n    given: Giorgio\n  - family: Montinari\n    given: Mazzino\n  id: \"nietzsche:ksa\"\n  issued: 1988\n  language: de-DE\n  number-of-volumes: 15\n  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter\n  publisher-place: München; Berlin; New York\n  title: \"Sämtliche Werke: Kritische Studienausgabe\"\n  title-short: Sämtliche Werke\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-nietzsche-ksa1.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2015-03-08:\n\n(Nietzsche 1988)\n\nNietzsche, Friedrich. 1988. *Sämtliche Werke: Kritische Studienausgabe*.\nEdited by Giorgio Colli and Mazzino Montinari. 2nd ed. Vol. 1. München;\nBerlin; New York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.\n\n\nFormatted with pandoc and apa.csl, 2015-03-08:\n\n(Nietzsche, 1988)\n\nNietzsche, F. (1988). *Sämtliche Werke: Kritische Studienausgabe*. (G.\nColli & M. Montinari, eds., F. Nietzsche) (2nd ed., Vol. 1). München;\nBerlin; New York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.\n\n\nNOTES:\n\n- volume-title currently not implemented by chicago-author-date.csl and apa.csl.\n\n}\n\n@string{ dtv     = {Deutscher Taschenbuch-Verlag} }\n\n@Book{nietzsche:ksa1,\n  author       = {Nietzsche, Friedrich},\n  title        = {Die Geburt der Trag{\\\"o}die. Unzeitgem{\\\"a}{\\ss}e\n                  Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},\n  date         = 1988,\n  editor       = {Colli, Giorgio and Montinari, Mazzino},\n  maintitle    = {S{\\\"a}mtliche Werke},\n  mainsubtitle = {Kritische Studienausgabe},\n  volume       = 1,\n  edition      = 2,\n  publisher    = dtv # { and Walter de Gruyter},\n  location     = {M{\\\"u}nchen and Berlin and New York},\n  hyphenation  = {german},\n  sortyear     = {1988-1},\n  sorttitle    = {Werke-01-000},\n  indexsorttitle= {Samtliche Werke I},\n  bookauthor   = {Nietzsche, Friedrich},\n  indextitle   = {S{\\\"a}mtliche Werke I},\n  shorttitle   = {S{\\\"a}mtliche Werke I},\n  annotation   = {A single volume from the critical edition of Nietzsche's\n                  works. This book entry explicitly refers to the first\n                  volume only. Note the title and maintitle\n                  fields. Also note the sorttitle and sortyear\n                  fields. We want this entry to be listed after the entry\n                  referring to the entire edition},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A single volume from the critical edition of Nietzsche's\n    works. This book entry explicitly refers to the first volume only.\n    Note the title and maintitle fields. Also note the sorttitle and\n    sortyear fields. We want this entry to be listed after the entry\n    referring to the entire edition\n  author:\n  - family: Nietzsche\n    given: Friedrich\n  container-author:\n  - family: Nietzsche\n    given: Friedrich\n  edition: 2\n  editor:\n  - family: Colli\n    given: Giorgio\n  - family: Montinari\n    given: Mazzino\n  id: \"nietzsche:ksa1\"\n  issued: 1988\n  language: de-DE\n  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter\n  publisher-place: München; Berlin; New York\n  title: \"Sämtliche Werke: Kritische Studienausgabe\"\n  type: book\n  volume: 1\n  volume-title: Die Geburt der Tragödie. Unzeitgemäße Betrachtungen\n    I--IV. Nachgelassene Schriften 1870--1973\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-online.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@online{markey,\n\tAnnotation = {An online entry for a tutorial. Note the format of the date field (yyyy-mm-dd) in the database file.},\n\tAuthor = {Markey, Nicolas},\n\tDate = {2005-10-16},\n\tHyphenation = {american},\n\tSorttitle = {Tame the Beast},\n\tSubtitle = {The {B} to {X} of {BibTeX}},\n\tTitle = {Tame the {BeaST}},\n\tUrl = {http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf},\n\tUrldate = {2006-10-01},\n\tVersion = {1.3},\n}\n\n@online{CTAN,\n\tAnnotation = {This is an online entry. The \\textsc{url}, which is given in the url field, is transformed into a clickable link if hyperref support has been enabled. Note the format of the urldate field (yyyy-mm-dd) in the database file. Also note the label field which may be used as a fallback by citation styles which need an author and\\slash or a year},\n\tDate = 2006,\n\tHyphenation = {american},\n\tLabel = {CTAN},\n\tSubtitle = {The {Comprehensive TeX Archive Network}},\n\tTitle = {{CTAN}},\n\tUrl = {http://www.ctan.org},\n\tUrldate = {2006-10-01},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- accessed: 2006-10-01\n  annote: An online entry for a tutorial. Note the format of the date\n    field (yyyy-mm-dd) in the database file.\n  author:\n  - family: Markey\n    given: Nicolas\n  id: markey\n  issued: 2005-10-16\n  language: en-US\n  title: \"Tame the BeaST: The B to X of BibTeX\"\n  title-short: Tame the BeaST\n  type: webpage\n  url: \"http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf\"\n  version: 1.3\n- accessed: 2006-10-01\n  annote: This is an online entry. The [url]{.smallcaps}, which is given\n    in the url field, is transformed into a clickable link if hyperref\n    support has been enabled. Note the format of the urldate field\n    (yyyy-mm-dd) in the database file. Also note the label field which\n    may be used as a fallback by citation styles which need an author\n    and/or a year\n  id: CTAN\n  issued: 2006\n  language: en-US\n  title: \"CTAN: The Comprehensive TeX Archive Network\"\n  title-short: CTAN\n  type: webpage\n  url: \"http://www.ctan.org\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-options-url-false-doi-false.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nEntry contains url and doi fields; these should be discarded since the\noptions field specifies url=false, doi=false.\n\nException: As in standard biblatex, in online entries url should never be\ndiscarded, even if options contains url=false.\n\n}\n\n@article{item1,\n    Author = {Author, Andy},\n    Date = {2012},\n    Doi = {1234/5678.90},\n    Journal = {Journal},\n    Options = {url=false, doi=false},\n    Title = {Title, Any Entry Type Except online},\n    Url = {http://foo.bar}\n}\n\n@online{item2,\n    Author = {Author, Andy},\n    Date = {2012},\n    Doi = {1234/5678.90},\n    Journal = {Journal},\n    Options = {url=false, doi=false},\n    Title = {Title, Entry Type online},\n    Url = {http://foo.bar}\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Andy\n  container-title: Journal\n  id: item1\n  issued: 2012\n  title: Title, any entry type except online\n  type: article-journal\n- author:\n  - family: Author\n    given: Andy\n  container-title: Journal\n  id: item2\n  issued: 2012\n  title: Title, entry type online\n  type: webpage\n  url: \"http://foo.bar\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-padhye.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Padhye, Firoiu, and Towsley 1999)\n\nPadhye, Jitendra, Victor Firoiu, and Don Towsley. 1999. “A Stochastic\nModel of TCP Reno Congestion Avoidance and Control.” Technical report\n99-02. Amherst, Mass.: University of Massachusetts.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Padhye, Firoiu, & Towsley, 1999)\n\nPadhye, J., Firoiu, V., & Towsley, D. (1999). *A stochastic model of TCP\nReno congestion avoidance and control* (technical report No. 99-02).\nAmherst, Mass.: University of Massachusetts.\n\n}\n\n@Report{padhye,\n  author       = {Padhye, Jitendra and Firoiu, Victor and Towsley, Don},\n  title        = {A Stochastic Model of {TCP Reno} Congestion Avoidance and\n                  Control},\n  type         = {techreport},\n  institution  = {University of Massachusetts},\n  date         = 1999,\n  number       = {99-02},\n  location     = {Amherst, Mass.},\n  hyphenation  = {american},\n  sorttitle    = {A Stochastic Model of TCP Reno Congestion Avoidance and\n                  Control},\n  indextitle   = {Stochastic Model of {TCP Reno} Congestion Avoidance and Control,\n                  A},\n  annotation   = {This is a report entry for a technical report. Note\n                  the format of the type field in the database file\n                  which uses a localization key. The number of the report is\n                  given in the number field. Also note the\n                  sorttitle and indextitle fields},\n  abstract     = {The steady state performance of a bulk transfer TCP flow\n                  (i.e., a flow with a large amount of data to send, such as FTP\n                  transfers) may be characterized by three quantities. The first\n                  is the send rate, which is the amount of data sent by the\n                  sender in unit time. The second is the throughput, which is\n                  the amount of data received by the receiver in unit time. Note\n                  that the throughput will always be less than or equal to the\n                  send rate due to losses. Finally, the number of non-duplicate\n                  packets received by the receiver in unit time gives us the\n                  goodput of the connection. The goodput is always less than or\n                  equal to the throughput, since the receiver may receive two\n                  copies of the same packet due to retransmissions by the\n                  sender. In a previous paper, we presented a simple model for\n                  predicting the steady state send rate of a bulk transfer TCP\n                  flow as a function of loss rate and round trip time. In this\n                  paper, we extend that work in two ways. First, we analyze the\n                  performance of bulk transfer TCP flows using more precise,\n                  stochastic analysis. Second, we build upon the previous\n                  analysis to provide both an approximate formula as well as a\n                  more accurate stochastic model for the steady state throughput\n                  of a bulk transfer TCP flow.},\n  file         = {ftp://gaia.cs.umass.edu/pub/Padhey99-markov.ps},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- abstract: The steady state performance of a bulk transfer TCP flow\n    (i.e., a flow with a large amount of data to send, such as FTP\n    transfers) may be characterized by three quantities. The first is\n    the send rate, which is the amount of data sent by the sender in\n    unit time. The second is the throughput, which is the amount of data\n    received by the receiver in unit time. Note that the throughput will\n    always be less than or equal to the send rate due to losses.\n    Finally, the number of non-duplicate packets received by the\n    receiver in unit time gives us the goodput of the connection. The\n    goodput is always less than or equal to the throughput, since the\n    receiver may receive two copies of the same packet due to\n    retransmissions by the sender. In a previous paper, we presented a\n    simple model for predicting the steady state send rate of a bulk\n    transfer TCP flow as a function of loss rate and round trip time. In\n    this paper, we extend that work in two ways. First, we analyze the\n    performance of bulk transfer TCP flows using more precise,\n    stochastic analysis. Second, we build upon the previous analysis to\n    provide both an approximate formula as well as a more accurate\n    stochastic model for the steady state throughput of a bulk transfer\n    TCP flow.\n  annote: This is a report entry for a technical report. Note the format\n    of the type field in the database file which uses a localization\n    key. The number of the report is given in the number field. Also\n    note the sorttitle and indextitle fields\n  author:\n  - family: Padhye\n    given: Jitendra\n  - family: Firoiu\n    given: Victor\n  - family: Towsley\n    given: Don\n  genre: technical report\n  id: padhye\n  issued: 1999\n  language: en-US\n  number: 99-02\n  publisher: University of Massachusetts\n  publisher-place: Amherst, Mass.\n  title: A stochastic model of TCP Reno congestion avoidance and control\n  type: report\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-patent.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\nTODO: Is there a CSL counterpart for the biblatex field \"holder\"?}\n\n\n@patent{almendro,\n\tAnnotation = {This is a patent entry with a location field. The number is given in the number field. Note the format of the location field in the database file. Compare laufenberg, sorace, and kowalik},\n\tAuthor = {Almendro, José L. and Martín, Jacinto and Sánchez, Alberto and Nozal, Fernando},\n\tDate = 1998,\n\tHyphenation = {german},\n\tLocation = {countryfr and countryuk and countryde},\n\tNumber = {EU-29702195U},\n\tTitle = {Elektromagnetisches Signalhorn}}\n\n@patent{kowalik,\n\tAnnotation = {This is a patent entry for a French patent request with a full date. The number is given in the number field. Note the format of the type and date fields in the database file. Compare almendro, laufenberg, and sorace},\n\tAuthor = {Kowalik, F. and Isard, M.},\n\tDate = {1995-01-11},\n\tHyphenation = {french},\n\tIndextitle = {Estimateur d'un défaut de fonctionnement},\n\tNumber = 9500261,\n\tTitle = {Estimateur d'un défaut de fonctionnement d'un modulateur en quadrature et étage de modulation l'utilisant},\n\tType = {patreqfr}}\n\n@patent{laufenberg,\n\tAnnotation = {This is a patent entry with a holder field. Note the format of the type and location fields in the database file. Compare almendro, sorace, and kowalik},\n\tAuthor = {Laufenberg, Xaver and Eynius, Dominique and Suelzle, Helmut and Usbeck, Stephan and Spaeth, Matthias and Neuser-Hoffmann, Miriam and Myrzik, Christian and Schmid, Manfred and Nietfeld, Franz and Thiel, Alexander and Braun, Harald and Ebner, Norbert},\n\tDate = {2006-09-13},\n\tFile = {http://v3.espacenet.com/textdoc?IDX=EP1700367},\n\tHolder = {{Robert Bosch GmbH} and {Daimler Chrysler AG} and {Bayerische Motoren Werke AG}},\n\tHyphenation = {german},\n\tNumber = 1700367,\n\tTitle = {Elektrische Einrichtung und Betriebsverfahren},\n\tType = {patenteu},\n\tAbstract = {The invention relates to an electric device comprising a\n                  generator, in particular for use in the vehicle electric\n                  system of a motor vehicle and a controller for controlling the\n                  generator voltage. The device is equipped with a control zone,\n                  in which the voltage is controlled and zones, in which the\n                  torque is controlled. The invention also relates to methods\n                  for operating a device of this type.}}\n\n@patent{sorace,\n\tAnnotation = {This is a patent entry with a holder field. Note the format of the type and date fields in the database file. Compare almendro, laufenberg, and kowalik},\n\tAuthor = {Sorace, Ronald E. and Reinhardt, Victor S. and Vaughn, Steven A.},\n\tDate = {1997-09-16},\n\tDate-Modified = {2013-10-16 13:44:15 +0000},\n\tHolder = {{Hughes Aircraft Company}},\n\tHyphenation = {american},\n\tNumber = 5668842,\n\tTitle = {High-Speed Digital-to-{RF} Converter},\n\tType = {patentus}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a patent entry with a location field. The number is\n    given in the number field. Note the format of the location field in\n    the database file. Compare laufenberg, sorace, and kowalik\n  author:\n  - family: Almendro\n    given: José L.\n  - family: Martín\n    given: Jacinto\n  - family: Sánchez\n    given: Alberto\n  - family: Nozal\n    given: Fernando\n  id: almendro\n  issued: 1998\n  jurisdiction: France; United Kingdom; Germany\n  language: de-DE\n  number: EU-29702195U\n  title: Elektromagnetisches Signalhorn\n  type: patent\n- annote: This is a patent entry for a French patent request with a full\n    date. The number is given in the number field. Note the format of\n    the type and date fields in the database file. Compare almendro,\n    laufenberg, and sorace\n  author:\n  - family: Kowalik\n    given: F.\n  - family: Isard\n    given: M.\n  genre: French patent request\n  id: kowalik\n  issued: 1995-01-11\n  language: fr-FR\n  number: 9500261\n  title: Estimateur d'un défaut de fonctionnement d'un modulateur en\n    quadrature et étage de modulation l'utilisant\n  type: patent\n- abstract: The invention relates to an electric device comprising a\n    generator, in particular for use in the vehicle electric system of a\n    motor vehicle and a controller for controlling the generator\n    voltage. The device is equipped with a control zone, in which the\n    voltage is controlled and zones, in which the torque is controlled.\n    The invention also relates to methods for operating a device of this\n    type.\n  annote: This is a patent entry with a holder field. Note the format of\n    the type and location fields in the database file. Compare almendro,\n    sorace, and kowalik\n  author:\n  - family: Laufenberg\n    given: Xaver\n  - family: Eynius\n    given: Dominique\n  - family: Suelzle\n    given: Helmut\n  - family: Usbeck\n    given: Stephan\n  - family: Spaeth\n    given: Matthias\n  - family: Neuser-Hoffmann\n    given: Miriam\n  - family: Myrzik\n    given: Christian\n  - family: Schmid\n    given: Manfred\n  - family: Nietfeld\n    given: Franz\n  - family: Thiel\n    given: Alexander\n  - family: Braun\n    given: Harald\n  - family: Ebner\n    given: Norbert\n  genre: European patent\n  id: laufenberg\n  issued: 2006-09-13\n  language: de-DE\n  number: 1700367\n  title: Elektrische Einrichtung und Betriebsverfahren\n  type: patent\n- annote: This is a patent entry with a holder field. Note the format of\n    the type and date fields in the database file. Compare almendro,\n    laufenberg, and kowalik\n  author:\n  - family: Sorace\n    given: Ronald E.\n  - family: Reinhardt\n    given: Victor S.\n  - family: Vaughn\n    given: Steven A.\n  genre: U.S. patent\n  id: sorace\n  issued: 1997-09-16\n  language: en-US\n  number: 5668842\n  title: High-speed digital-to-RF converter\n  type: patent\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-periodical.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{excerpt from\nhttp://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@periodical{jcg,\n\tAnnotation = {This is a periodical entry with an issn field.},\n\tIssn = {0097-8493},\n\tIssuetitle = {Semantic {3D} Media and Content},\n\tNumber = 4,\n\tTitle = {Computers and Graphics},\n\tVolume = 35,\n\tYear = 2011}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a periodical entry with an issn field.\n  container-title: Computers and Graphics\n  id: jcg\n  issn: 0097-8493\n  issue: 4\n  issued: 2011\n  title: Semantic 3D media and content\n  type: article-journal\n  volume: 35\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-piccato.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Piccato 2001)\n\nPiccato, Pablo. 2001. *City of Suspects: Crime in Mexico City,\n1900–1931*. Durham; London: Duke University Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Piccato, 2001)\n\nPiccato, P. (2001). *City of suspects: Crime in Mexico City, 1900–1931*.\nDurham; London: Duke University Press.\n\n\n}\n\n@Book{piccato,\n  author       = {Piccato, Pablo},\n  title        = {City of Suspects},\n  date         = 2001,\n  publisher    = {Duke University Press},\n  location     = {Durham and London},\n  hyphenation  = {american},\n  subtitle     = {Crime in {Mexico City}, 1900--1931},\n  shorttitle   = {City of Suspects},\n  annotation   = {This is a book entry. Note the format of the\n                  location field in the database file},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a book entry. Note the format of the location field in\n    the database file\n  author:\n  - family: Piccato\n    given: Pablo\n  id: piccato\n  issued: 2001\n  language: en-US\n  publisher: Duke University Press\n  publisher-place: Durham; London\n  title: \"City of suspects: Crime in Mexico City, 1900--1931\"\n  title-short: City of suspects\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-pines.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Pines 1979)\n\nPines, Shlomo. 1979. “The Limitations of Human Knowledge According to\nAl-Farabi, ibn Bajja, and Maimonides.” In *Studies in Medieval Jewish\nHistory and Literature*, edited by Isadore Twersky, 82–109. Cambridge,\nMass.: Harvard University Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Pines, 1979)\n\nPines, S. (1979). The limitations of human knowledge according to\nAl-Farabi, ibn Bajja, and Maimonides. In I. Twersky (Ed.), *Studies in\nmedieval Jewish history and literature* (pp. 82–109). Cambridge, Mass.:\nHarvard University Press.\n\n\n}\n\n@string{ hup     = {Harvard University Press} }\n\n@InCollection{pines,\n  author       = {Pines, Shlomo},\n  editor       = {Twersky, Isadore},\n  title        = {The Limitations of Human Knowledge According to {Al-Farabi}, {ibn\n                  Bajja}, and {Maimonides}},\n  date         = 1979,\n  booktitle    = {Studies in Medieval {Jewish} History and Literature},\n  publisher    = hup,\n  location     = {Cambridge, Mass.},\n  pages        = {82-109},\n  keywords     = {secondary},\n  hyphenation  = {american},\n  indextitle   = {Limitations of Human Knowledge According to {Al-Farabi}, {ibn\n                  Bajja}, and {Maimonides}, The},\n  shorttitle   = {Limitations of Human Knowledge},\n  annotation   = {A typical incollection entry. Note the\n                  indextitle field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A typical incollection entry. Note the indextitle field\n  author:\n  - family: Pines\n    given: Shlomo\n  container-title: Studies in medieval Jewish history and literature\n  editor:\n  - family: Twersky\n    given: Isadore\n  id: pines\n  issued: 1979\n  keyword: secondary\n  language: en-US\n  page: 82-109\n  publisher: Harvard University Press\n  publisher-place: Cambridge, Mass.\n  title: The limitations of human knowledge according to Al-Farabi, [ibn\n    Bajja]{.nocase}, and Maimonides\n  title-short: Limitations of human knowledge\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-quotes.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{excerpt from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\n\\mkbibquote{} should be replaced by a matching set of quotation marks that can be used by citeproc for quote substitution and flipflopping. English smart double quotation marks seem best, as they cannot be confused with apostrophes.\n\n\\enquote{}, \\enquote*{} should be replaced by a matching set of quotation marks, too: “foo”, ‘bar’.\n}\n\n@string{pup = {Princeton University Press}}\n\n@book{nussbaum,\n\tAnnotation = {A book entry. Note the sorttitle and indexsorttitle fields and the markup of the quotes in the database file},\n\tAuthor = {Nussbaum, Martha},\n\tDate = 1978,\n\tHyphenation = {american},\n\tIndexsorttitle = {Aristotle's De Motu Animalium},\n\tKeywords = {secondary},\n\tLocation = {Princeton},\n\tPublisher = pup,\n\tSorttitle = {Aristotle's De Motu Animalium},\n\tTitle = {Aristotle's \\mkbibquote{De Motu Animalium}}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry. Note the sorttitle and indexsorttitle fields and\n    the markup of the quotes in the database file\n  author:\n  - family: Nussbaum\n    given: Martha\n  id: nussbaum\n  issued: 1978\n  keyword: secondary\n  language: en-US\n  publisher: Princeton University Press\n  publisher-place: Princeton\n  title: Aristotle's \"De Motu Animalium\"\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-reese.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Reese 1958)\n\nReese, Trevor R. 1958. “Georgia in Anglo-Spanish Diplomacy, 1736-1739.”\n*William and Mary Quarterly, 3* 15: 168–190.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Reese, 1958)\n\nReese, T. R. (1958). Georgia in Anglo-Spanish diplomacy, 1736-1739.\n*William and Mary Quarterly, 3*, *15*, 168–190.\n\n\nNOTES:\n\n- biblio2yaml\n\t- series field: still not entirely satisfactory.\n\t  Could we map this to some existing CSL variable, and have the CSL styles handle this? \"edition\", maybe ??\n\n}\n\n@Article{reese,\n  author       = {Reese, Trevor R.},\n  title        = {Georgia in {Anglo-Spanish} Diplomacy, 1736-1739},\n  journaltitle = {William and Mary Quarterly},\n  date         = 1958,\n  series       = 3,\n  volume       = 15,\n  pages        = {168-190},\n  hyphenation  = {american},\n  annotation   = {An article entry with a series and a\n                  volume field. Note the format of the series. If the\n                  value of the series field is an integer, this number\n                  is printed as an ordinal and the string \\enquote*{series} is\n                  appended automatically},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry with a series and a volume field. Note the\n    format of the series. If the value of the series field is an\n    integer, this number is printed as an ordinal and the string\n    'series' is appended automatically\n  author:\n  - family: Reese\n    given: Trevor R.\n  collection-title: 3rd series\n  container-title: William and Mary Quarterly\n  id: reese\n  issued: 1958\n  language: en-US\n  page: 168-190\n  title: Georgia in Anglo-Spanish diplomacy, 1736-1739\n  type: article-journal\n  volume: 15\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-report.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{excerpt from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\nTODO: Where to map \"file\" field?\n}\n\n@report{chiu,\n\tAnnotation = {This is a report entry for a research report. Note the format of the type field in the database file which uses a localization key. The number of the report is given in the number field. Also note the sorttitle and indextitle fields},\n\tAuthor = {Chiu, Willy W. and Chow, We Min},\n\tDate = 1978,\n\tHyphenation = {american},\n\tIndextitle = {Hybrid Hierarchical Model, A},\n\tInstitution = {IBM},\n\tNumber = {RC-6947},\n\tSorttitle = {Hybrid Hierarchical Model of a Multiple Virtual Storage (MVS) Operating System},\n\tTitle = {A Hybrid Hierarchical Model of a {Multiple Virtual Storage} ({MVS}) Operating System},\n\tType = {resreport}}\n\n@report{padhye,\n\tAnnotation = {This is a report entry for a technical report. Note the format of the type field in the database file which uses a localization key. The number of the report is given in the number field. Also note the sorttitle and indextitle fields},\n\tAuthor = {Padhye, Jitendra and Firoiu, Victor and Towsley, Don},\n\tDate = 1999,\n\tFile = {ftp://gaia.cs.umass.edu/pub/Padhey99-markov.ps},\n\tHyphenation = {american},\n\tIndextitle = {Stochastic Model of TCP Reno Congestion Avoidance and Control, A},\n\tInstitution = {University of Massachusetts},\n\tLocation = {Amherst, Mass.},\n\tNumber = {99-02},\n\tSorttitle = {A Stochastic Model of TCP Reno Congestion Avoidance and Control},\n\tTitle = {A Stochastic Model of {TCP Reno} Congestion Avoidance and Control},\n\tType = {techreport},\n\tAbstract = {The steady state performance of a bulk transfer TCP flow\n                  (i.e., a flow with a large amount of data to send, such as FTP\n                  transfers) may be characterized by three quantities. The first\n                  is the send rate, which is the amount of data sent by the\n                  sender in unit time. The second is the throughput, which is\n                  the amount of data received by the receiver in unit time. Note\n                  that the throughput will always be less than or equal to the\n                  send rate due to losses. Finally, the number of non-duplicate\n                  packets received by the receiver in unit time gives us the\n                  goodput of the connection. The goodput is always less than or\n                  equal to the throughput, since the receiver may receive two\n                  copies of the same packet due to retransmissions by the\n                  sender. In a previous paper, we presented a simple model for\n                  predicting the steady state send rate of a bulk transfer TCP\n                  flow as a function of loss rate and round trip time. In this\n                  paper, we extend that work in two ways. First, we analyze the\n                  performance of bulk transfer TCP flows using more precise,\n                  stochastic analysis. Second, we build upon the previous\n                  analysis to provide both an approximate formula as well as a\n                  more accurate stochastic model for the steady state throughput\n                  of a bulk transfer TCP flow.}}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a report entry for a research report. Note the format\n    of the type field in the database file which uses a localization\n    key. The number of the report is given in the number field. Also\n    note the sorttitle and indextitle fields\n  author:\n  - family: Chiu\n    given: Willy W.\n  - family: Chow\n    given: We Min\n  genre: research report\n  id: chiu\n  issued: 1978\n  language: en-US\n  number: RC-6947\n  publisher: IBM\n  title: A hybrid hierarchical model of a Multiple Virtual Storage (MVS)\n    operating system\n  type: report\n- abstract: The steady state performance of a bulk transfer TCP flow\n    (i.e., a flow with a large amount of data to send, such as FTP\n    transfers) may be characterized by three quantities. The first is\n    the send rate, which is the amount of data sent by the sender in\n    unit time. The second is the throughput, which is the amount of data\n    received by the receiver in unit time. Note that the throughput will\n    always be less than or equal to the send rate due to losses.\n    Finally, the number of non-duplicate packets received by the\n    receiver in unit time gives us the goodput of the connection. The\n    goodput is always less than or equal to the throughput, since the\n    receiver may receive two copies of the same packet due to\n    retransmissions by the sender. In a previous paper, we presented a\n    simple model for predicting the steady state send rate of a bulk\n    transfer TCP flow as a function of loss rate and round trip time. In\n    this paper, we extend that work in two ways. First, we analyze the\n    performance of bulk transfer TCP flows using more precise,\n    stochastic analysis. Second, we build upon the previous analysis to\n    provide both an approximate formula as well as a more accurate\n    stochastic model for the steady state throughput of a bulk transfer\n    TCP flow.\n  annote: This is a report entry for a technical report. Note the format\n    of the type field in the database file which uses a localization\n    key. The number of the report is given in the number field. Also\n    note the sorttitle and indextitle fields\n  author:\n  - family: Padhye\n    given: Jitendra\n  - family: Firoiu\n    given: Victor\n  - family: Towsley\n    given: Don\n  genre: technical report\n  id: padhye\n  issued: 1999\n  language: en-US\n  number: 99-02\n  publisher: University of Massachusetts\n  publisher-place: Amherst, Mass.\n  title: A stochastic model of TCP Reno congestion avoidance and control\n  type: report\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-salam.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Salam 1968)\n\nSalam, Abdus. 1968. “Weak and Electromagnetic Interactions.” In\n*Elementary Particle Theory: Relativistic Groups and Analyticity.\nProceedings of the Eighth Nobel Symposium*, edited by Nils Svartholm,\n367–377. Stockholm: Almquist & Wiksell.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Salam, 1968)\n\nSalam, A. (1968). Weak and electromagnetic interactions. In N. Svartholm\n(Ed.), *Elementary particle theory: Relativistic groups and analyticity.\nProceedings of the eighth Nobel symposium* (pp. 367–377). Stockholm:\nAlmquist & Wiksell.\n\n\n}\n\n@InProceedings{salam,\n  author       = {Salam, Abdus},\n  editor       = {Svartholm, Nils},\n  title        = {Weak and Electromagnetic Interactions},\n  date         = 1968,\n  booktitle    = {Elementary particle theory},\n  booksubtitle = {Relativistic groups and analyticity},\n  booktitleaddon= {Proceedings of the Eighth {Nobel} Symposium},\n  eventdate    = {1968-05-19/1968-05-25},\n  venue        = {Aspen{\\\"a}sgarden, Lerum},\n  publisher    = {Almquist \\& Wiksell},\n  location     = {Stockholm},\n  pages        = {367-377},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Salam\n    given: Abdus\n  container-title: \"Elementary particle theory: Relativistic groups and\n    analyticity. Proceedings of the eighth Nobel symposium\"\n  editor:\n  - family: Svartholm\n    given: Nils\n  event-date: 1968-05-19/1968-05-25\n  event-place: Aspenäsgarden, Lerum\n  id: salam\n  issued: 1968\n  page: 367-377\n  publisher: Almquist & Wiksell\n  publisher-place: Stockholm\n  title: Weak and electromagnetic interactions\n  type: paper-conference\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-sarfraz.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Sarfraz and Razzak 2002)\n\nSarfraz, M., and M. F. A. Razzak. 2002. “Technical Section: An Algorithm\nfor Automatic Capturing of the Font Outlines.” *Computers and Graphics*\n26 (5): 795–804.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Sarfraz & Razzak, 2002)\n\nSarfraz, M., & Razzak, M. F. A. (2002). Technical section: An algorithm\nfor automatic capturing of the font outlines. *Computers and Graphics*,\n*26*(5), 795–804.\n\n\n}\n\n@Article{sarfraz,\n  author       = {M. Sarfraz and M. F. A. Razzak},\n  title        = {Technical section: {An} algorithm for automatic capturing of\n                  the font outlines},\n  year         = 2002,\n  volume       = 26,\n  number       = 5,\n  pages        = {795-804},\n  issn         = {0097-8493},\n  journal      = {Computers and Graphics},\n  annotation   = {An article entry with an issn field},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry with an issn field\n  author:\n  - family: Sarfraz\n    given: M.\n  - family: Razzak\n    given: M. F. A.\n  container-title: Computers and Graphics\n  id: sarfraz\n  issn: 0097-8493\n  issue: 5\n  issued: 2002\n  page: 795-804\n  title: \"Technical section: An algorithm for automatic capturing of the\n    font outlines\"\n  title-short: Technical section\n  type: article-journal\n  volume: 26\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-shore.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Shore 1991)\n\nShore, Bradd. 1991. “Twice-born, Once Conceived: Meaning Construction\nand Cultural Cognition.” *American Anthropologist, New Series* 93 (1)\n(March): 9–27.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Shore, 1991)\n\nShore, B. (1991). Twice-born, once conceived: Meaning construction and\ncultural cognition. *American Anthropologist, new series*, *93*(1),\n9–27.\n\n\n}\n\n@Article{shore,\n  author       = {Shore, Bradd},\n  title        = {Twice-Born, Once Conceived},\n  journaltitle = {American Anthropologist},\n  date         = {1991-03},\n  subtitle     = {Meaning Construction and Cultural Cognition},\n  series       = {newseries},\n  volume       = 93,\n  number       = 1,\n  pages        = {9-27},\n  annotation   = {An article entry with series,\n                  volume, and number fields. Note the format\n                  of the series which is a localization key},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry with series, volume, and number fields. Note\n    the format of the series which is a localization key\n  author:\n  - family: Shore\n    given: Bradd\n  collection-title: New series\n  container-title: American Anthropologist\n  id: shore\n  issue: 1\n  issued: 1991-03\n  page: 9-27\n  title: \"Twice-born, once conceived: Meaning construction and cultural\n    cognition\"\n  title-short: Twice-born, once conceived\n  type: article-journal\n  volume: 93\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-sigfridsson.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Sigfridsson and Ryde 1998)\n\nSigfridsson, Emma, and Ulf Ryde. 1998. “Comparison of Methods for\nDeriving Atomic Charges from the Electrostatic Potential and Moments.”\n*Journal of Computational Chemistry* 19 (4): 377–395.\ndoi:[10.1002/(SICI)1096-987X(199803)19:4\\<377::AID-JCC1\\>3.0.CO;2-P](https://doi.org/10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P \"10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P\").\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Sigfridsson & Ryde, 1998)\n\nSigfridsson, E., & Ryde, U. (1998). Comparison of methods for deriving\natomic charges from the electrostatic potential and moments. *Journal of\nComputational Chemistry*, *19*(4), 377–395.\ndoi:[10.1002/(SICI)1096-987X(199803)19:4\\<377::AID-JCC1\\>3.0.CO;2-P](https://doi.org/10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P \"10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P\")\n\n\nNOTES:\n\n- biblio2xaml\n\t- the string \"doi:\" should not appear as part of the content of the \"doi\" field \n\n}\n\n@Article{sigfridsson,\n  author       = {Sigfridsson, Emma and Ryde, Ulf},\n  title        = {Comparison of methods for deriving atomic charges from the\n                  electrostatic potential and moments},\n  journaltitle = {Journal of Computational Chemistry},\n  date         = 1998,\n  volume       = 19,\n  number       = 4,\n  pages        = {377-395},\n  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},\n  hyphenation  = {american},\n  indextitle   = {Methods for deriving atomic charges},\n  annotation   = {An article entry with volume,\n                  number, and doi fields. Note that the\n                  \\textsc{doi} is transformed into a clickable link if\n                  hyperref support has been enabled},\n  abstract     = {Four methods for deriving partial atomic charges from the\n                  quantum chemical electrostatic potential (CHELP, CHELPG,\n                  Merz-Kollman, and RESP) have been compared and critically\n                  evaluated. It is shown that charges strongly depend on how and\n                  where the potential points are selected. Two alternative\n                  methods are suggested to avoid the arbitrariness in the\n                  point-selection schemes and van der Waals exclusion radii:\n                  CHELP-BOW, which also estimates the charges from the\n                  electrostatic potential, but with potential points that are\n                  Boltzmann-weighted after their occurrence in actual\n                  simulations using the energy function of the program in which\n                  the charges will be used, and CHELMO, which estimates the\n                  charges directly from the electrostatic multipole\n                  moments. Different criteria for the quality of the charges are\n                  discussed.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- abstract: \"Four methods for deriving partial atomic charges from the\n    quantum chemical electrostatic potential (CHELP, CHELPG,\n    Merz-Kollman, and RESP) have been compared and critically evaluated.\n    It is shown that charges strongly depend on how and where the\n    potential points are selected. Two alternative methods are suggested\n    to avoid the arbitrariness in the point-selection schemes and van\n    der Waals exclusion radii: CHELP-BOW, which also estimates the\n    charges from the electrostatic potential, but with potential points\n    that are Boltzmann-weighted after their occurrence in actual\n    simulations using the energy function of the program in which the\n    charges will be used, and CHELMO, which estimates the charges\n    directly from the electrostatic multipole moments. Different\n    criteria for the quality of the charges are discussed.\"\n  annote: An article entry with volume, number, and doi fields. Note\n    that the [doi]{.smallcaps} is transformed into a clickable link if\n    hyperref support has been enabled\n  author:\n  - family: Sigfridsson\n    given: Emma\n  - family: Ryde\n    given: Ulf\n  container-title: Journal of Computational Chemistry\n  doi: \"10.1002/(SICI)1096-987X(199803)19:4\\\\<377::AID-JCC1\\\\>3.0.CO;2-P\"\n  id: sigfridsson\n  issue: 4\n  issued: 1998\n  language: en-US\n  page: 377-395\n  title: Comparison of methods for deriving atomic charges from the\n    electrostatic potential and moments\n  type: article-journal\n  volume: 19\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-sorace.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Sorace, Reinhardt, and Vaughn 1997)\n\nSorace, Ronald E., Victor S. Reinhardt, and Steven A. Vaughn. 1997.\n“High-speed Digital-to-RF Converter.” U.S. patent.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Sorace, Reinhardt, & Vaughn, 1997)\n\nSorace, R. E., Reinhardt, V. S., & Vaughn, S. A. (1997, September 16).\nHigh-speed digital-to-RF converter. U.S. patent.\n\n\n}\n\n@Patent{sorace,\n  author       = {Sorace, Ronald E. and Reinhardt, Victor S. and Vaughn, Steven\n                  A.},\n  title        = {High-Speed Digital-to-{RF} Converter},\n  number       = 5668842,\n  date         = {1997-09-16},\n  holder       = {{Hughes Aircraft Company}},\n  type         = {patentus},\n  hyphenation  = {american},\n  annotation   = {This is a patent entry with a holder field.\n                  Note the format of the type and date fields\n                  in the database file. Compare almendro,\n                  laufenberg, and kowalik},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a patent entry with a holder field. Note the format of\n    the type and date fields in the database file. Compare almendro,\n    laufenberg, and kowalik\n  author:\n  - family: Sorace\n    given: Ronald E.\n  - family: Reinhardt\n    given: Victor S.\n  - family: Vaughn\n    given: Steven A.\n  genre: U.S. patent\n  id: sorace\n  issued: 1997-09-16\n  language: en-US\n  number: 5668842\n  title: High-speed digital-to-RF converter\n  type: patent\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-spiegelberg.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Spiegelberg 1969)\n\nSpiegelberg, Herbert. 1969. ““Intention” und “Intentionalität” in der\nScholastik, bei Brentano und Husserl.” *Studia Philosophica* 29:\n189–216.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Spiegelberg, 1969)\n\nSpiegelberg, H. (1969). “Intention” und “Intentionalität” in der\nScholastik, bei Brentano und Husserl. *Studia Philosophica*, *29*,\n189–216.\n\n\nNOTES:\n\n- citeproc\n\t- flipflopping of quotes incorrect\n\n}\n\n@Article{spiegelberg,\n  author       = {Spiegelberg, Herbert},\n  title        = {\\mkbibquote{Intention} und \\mkbibquote{Intentionalit{\\\"a}t} in\n                  der Scholastik, bei Brentano und Husserl},\n  journaltitle = {Studia Philosophica},\n  date         = 1969,\n  volume       = 29,\n  pages        = {189-216},\n  hyphenation  = {german},\n  sorttitle    = {Intention und Intentionalitat in der Scholastik, bei Brentano\n                  und Husserl},\n  indexsorttitle= {Intention und Intentionalitat in der Scholastik, bei Brentano\n                  und Husserl},\n  shorttitle   = {Intention und Intentionalit{\\\"a}t},\n  annotation   = {An article entry. Note the sorttitle and\n                  indexsorttitle fields and the markup of the quotes in\n                  the database file},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: An article entry. Note the sorttitle and indexsorttitle fields\n    and the markup of the quotes in the database file\n  author:\n  - family: Spiegelberg\n    given: Herbert\n  container-title: Studia Philosophica\n  id: spiegelberg\n  issued: 1969\n  language: de-DE\n  page: 189-216\n  title: \"\\\"Intention\\\" und \\\"Intentionalität\\\" in der Scholastik, bei\n    Brentano und Husserl\"\n  title-short: Intention und Intentionalität\n  type: article-journal\n  volume: 29\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-springer.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Springer 1950)\n\nSpringer, Otto. 1950. “Mediaeval Pilgrim Routes from Scandinavia to\nRome.” *Mediaeval Studies* 12: 92–122.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Springer, 1950)\n\nSpringer, O. (1950). Mediaeval pilgrim routes from Scandinavia to Rome.\n*Mediaeval Studies*, *12*, 92–122.\n\n\n}\n\n@Article{springer,\n  author       = {Springer, Otto},\n  title        = {Mediaeval Pilgrim Routes from {Scandinavia} to {Rome}},\n  journaltitle = {Mediaeval Studies},\n  date         = 1950,\n  volume       = 12,\n  pages        = {92-122},\n  hyphenation  = {british},\n  shorttitle   = {Mediaeval Pilgrim Routes},\n  annotation   = {A plain article entry},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A plain article entry\n  author:\n  - family: Springer\n    given: Otto\n  container-title: Mediaeval Studies\n  id: springer\n  issued: 1950\n  language: en-GB\n  page: 92-122\n  title: Mediaeval pilgrim routes from Scandinavia to Rome\n  title-short: Mediaeval pilgrim routes\n  type: article-journal\n  volume: 12\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-strings.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{excerpt from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}\n\n@string{anch-ie = {Angew.~Chem. Int.~Ed.}}\n\n@article{herrmann,\n\tAuthor = {Herrmann, Wolfgang A. and Öfele, Karl and Schneider, Sabine K. and Herdtweck, Eberhardt and Hoffmann, Stephan D.},\n\tDate = 2006,\n\tHyphenation = {english},\n\tIndextitle = {Carbocyclic carbene as an efficient catalyst, A},\n\tJournaltitle = anch-ie,\n\tNumber = 23,\n\tPages = {3859-3862},\n\tTitle = {A Carbocyclic Carbene as an Efficient Catalyst Ligand for {C--C} Coupling Reactions},\n\tVolume = 45}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Herrmann\n    given: Wolfgang A.\n  - family: Öfele\n    given: Karl\n  - family: Schneider\n    given: Sabine K.\n  - family: Herdtweck\n    given: Eberhardt\n  - family: Hoffmann\n    given: Stephan D.\n  container-title: Angew. Chem. Int. Ed.\n  id: herrmann\n  issue: 23\n  issued: 2006\n  language: en-US\n  page: 3859-3862\n  title: A carbocyclic carbene as an efficient catalyst ligand for C--C\n    coupling reactions\n  type: article-journal\n  volume: 45\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-test-case-conversion.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n    - bibtex and biblatex\n        - expect titles in title case\n        - styles use titles as is, or convert them to sentence case\n        - strings wrapped {} are not converted\n    - all CSL styles at <http://github.com/citation-style-language/styles>\n      and <https://www.zotero.org/styles/>\n        - expect titles in sentence case\n        - styles use titles as is, or convert them to title case\n        - except for (hardcoded) list of stop words, see\n          <http://citationstyles.org/downloads/specification.html#title-case-conversion>\n        - citeproc-js (MLZ only?) also recognizes a markup syntax for\n          suppressing title-case changes on a range of text (see\n          <https://forums.zotero.org/discussion/21991/excessive-capitalization-of-citation-titles/#Item_22>):\n            - `<span class=\"nocase\"/>lowercase</span>`\n    - Proposal:\n        - When converting to yaml, convert English titles to sentence case,\n            - for all strings wrapped in {} where {} is not part of a latex\n              command, ...\n            - ... when starting with an uppercase letter: suppress\nconversion, remove the {}\n            - ... when starting with a lowercase letter (\"nm\", \"iPod\"):\n              suppress conversion, replace the {} with\n              <span class=\"nocase\"/></span>\n            - Note: Camel case (\"iPod\") needs to be protected in\n              bibtex/biblatex anyway; the only \"extension\" (wrt bibtex/biblatex\n              specs) we'd be introducing is wrapping lowercase-only strings in\n              {}, something that is never necessary on the latex side but\n              won't break anything there either.\n        - citeproc-hs/pandoc-citeproc should be modified to honour this new\n          syntax and suppress conversion to title case for strings wrapped\n          in `<span class=\"nocase\"/></span>`.\n        - Expected output, using one of the title-case CSL styles, here\n          chicago-author-date.csl:\n\n            Author, Ann. 2013. “A Title, in English, with a Proper Name and\nan\n            ACRONYM and a camelCase Word and Some Units, 400 nm, 3 cm, and\na Quote,\n            *Alea iacta est*.” *Journal*.\n    }\n\n@article{item1,\n    Author = {Author, Ann},\n    Date = {2013},\n    Hyphenation = {english},\n    Journaltitle = {Journal},\n    Title = {A Title, in {English}, with a {Proper Name} and an {ACRONYM}\nand a {camelCase} Word and Some Units, 400~{nm}, 3~{cm}, and a Quote,\n\\textit{{Alea} {iacta est}}}\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Author\n    given: Ann\n  container-title: Journal\n  id: item1\n  issued: 2013\n  language: en-US\n  title: A title, in English, with a Proper Name and an ACRONYM and a\n    [camelCase]{.nocase} word and some units, 400 [nm]{.nocase},\n    3 [cm]{.nocase}, and a quote, *Alea [iacta est]{.nocase}*\n  type: article-journal\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-textnormal.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@book{item1,\n\tTitle = {The Title \\textnormal{of this book}},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- id: item1\n  title: The title [of this book]{.nodecor}\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-thesis.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{excerpted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib\n\nTODO: Uppercase letters following hyphens need to be converted to lowercase, too (e.g., \"r\" in \"High-Resolution\". -- Same for citeproc when doing title-case conversion!)\n}\n\n@thesis{geer,\n\tAnnotation = {This is a typical thesis entry for a PhD thesis. Note the type field in the database file which uses a localization key. Also note the format of the printed name and compare the useprefix option in the options field as well as vangennep},\n\tAuthor = {de Geer, Ingrid},\n\tDate = 1985,\n\tHyphenation = {british},\n\tInstitution = {Uppsala Universitet},\n\tLocation = {Uppsala},\n\tOptions = {useprefix=false},\n\tSubtitle = {The {Orkney} Earldom of the Twelfth Century. {A} Musicological Study},\n\tTitle = {Earl, Saint, Bishop, Skald~-- and Music},\n\tType = {phdthesis}}\n\n@thesis{loh,\n\tAnnotation = {This is a typical thesis entry for an MA thesis. Note the type field in the database file which uses a localization key},\n\tAuthor = {Loh, Nin C.},\n\tDate = 1992,\n\tHyphenation = {american},\n\tInstitution = {Massachusetts Institute of Technology},\n\tLocation = {Cambridge, Mass.},\n\tTitle = {High-Resolution Micromachined Interferometric Accelerometer},\n\tType = {mathesis}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a typical thesis entry for a PhD thesis. Note the type\n    field in the database file which uses a localization key. Also note\n    the format of the printed name and compare the useprefix option in\n    the options field as well as vangennep\n  author:\n  - dropping-particle: de\n    family: Geer\n    given: Ingrid\n  genre: PhD thesis\n  id: geer\n  issued: 1985\n  language: en-GB\n  publisher: Uppsala Universitet\n  publisher-place: Uppsala\n  title: \"Earl, saint, bishop, skald -- and music: The Orkney earldom of\n    the twelfth century. A musicological study\"\n  title-short: Earl, saint, bishop, skald -- and music\n  type: thesis\n- annote: This is a typical thesis entry for an MA thesis. Note the type\n    field in the database file which uses a localization key\n  author:\n  - family: Loh\n    given: Nin C.\n  genre: Master's thesis\n  id: loh\n  issued: 1992\n  language: en-US\n  publisher: Massachusetts Institute of Technology\n  publisher-place: Cambridge, Mass.\n  title: High-resolution micromachined interferometric accelerometer\n  type: thesis\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-title-and-shorttitle.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nTODO:\nSlight inconsistency:\nWhen a biblatex “title” field contains a colon, the part before the colon is mapped to CSL “title-short”.\nWhen there’s a biblatex “title” and a “subtitle” field, CSL “title-short” is not set, though it would make at least as much sense to map “title” (without “subtitle”) to CSL “title-short” in this case.\n\nCSL “container-title-short” could also be set\n- from biblatex “shortjournal”\n- for inbook, incollection etc. from the “shorttitle” field of the cross-referenced book, collection etc. entry (see item5, item6)\n... but it might not really be worth it, “container-title-short” not being used once in my sample of 70+ CSL styles.\n\n}\n\n@book{item4,\n\tShorttitle = {The Shorttitle},\n\tSubtitle = {And a Subtitle, in Two Separate Fields; plus a Separate “Shorttitle” Field},\n\tTitle = {The Title: With a Colon in the “Title” Field}}\n\n@book{item3,\n\tSubtitle = {And a Subtitle, in two separate fields},\n\tTitle = {The Title: With a Colon in the “title” field}}\n\n@book{item2,\n\tSubtitle = {The Subtitle, In Two Separate fields},\n\tTitle = {The Title}}\n\n@book{item1,\n\tTitle = {The Title: And the Subtitle, all in the “title” Field}}\n\n@inbook{item5,\n\tTitle = {The inbook Title: And the Subtitle, all in the “title” Field},\n\tCrossref = {item6}}\n\n@book{item6,\n\tTitle = {The Title: And the Subtitle, all in the “title” Field},\n\tShorttitle = {The Shorttitle},\n}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- id: item4\n  title: \"The title: With a colon in the \\\"title\\\" field: And a subtitle,\n    in two separate fields; plus a separate \\\"shorttitle\\\" field\"\n  title-short: The shorttitle\n  type: book\n- id: item3\n  title: \"The title: With a colon in the \\\"title\\\" field: And a subtitle,\n    in two separate fields\"\n  title-short: The title\n  type: book\n- id: item2\n  title: \"The title: The subtitle, in two separate fields\"\n  title-short: The title\n  type: book\n- id: item1\n  title: \"The title: And the subtitle, all in the \\\"title\\\" field\"\n  title-short: The title\n  type: book\n- container-title: \"The title: And the subtitle, all in the \\\"title\\\"\n    field\"\n  id: item5\n  title: \"The inbook title: And the subtitle, all in the \\\"title\\\" field\"\n  title-short: The inbook title\n  type: chapter\n- id: item6\n  title: \"The title: And the subtitle, all in the \\\"title\\\" field\"\n  title-short: The shorttitle\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-vangennep-related.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(van Gennep 1909)\n\nvan Gennep, Arnold. 1909. *Les rites de passage*. Paris: Nourry.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(van Gennep, 1909)\n\nvan Gennep, A. (1909). *Les rites de passage*. Paris: Nourry.\n\nNOTES:\n\n- biblio2yaml\n\t- \"related = {vizedom:related}, relatedtype = {bytranslator}\": no equivalent implemented in CSL\n\t- \"options = {useprefix},\" is shorthand for \"options = {useprefix=true},\"\n\n\n}\n\n@Book{vangennep:related,\n  author       = {van Gennep, Arnold},\n  title        = {Les rites de passage},\n  date         = 1909,\n  publisher    = {Nourry},\n  location     = {Paris},\n  options      = {useprefix},\n  hyphenation  = {french},\n  related      = {vizedom:related},\n  relatedtype  = {bytranslator},\n  sorttitle    = {Rites de passage},\n  indextitle   = {Rites de passage, Les},\n  shorttitle   = {Rites de passage},\n  annotation   = {A variant of the vangennep entry related to its\n                  translation. Note the format of the related and\n                  relatedtype fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A variant of the vangennep entry related to its translation.\n    Note the format of the related and relatedtype fields\n  author:\n  - family: Gennep\n    given: Arnold\n    non-dropping-particle: van\n  id: \"vangennep:related\"\n  issued: 1909\n  language: fr-FR\n  publisher: Nourry\n  publisher-place: Paris\n  title: Les rites de passage\n  title-short: Rites de passage\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-vangennep-trans.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(van Gennep 1960)\n\nvan Gennep, Arnold. 1960. *The Rites of Passage*. Translated by Monika\nB. Vizedom and Gabrielle L. Caffee. University of Chicago Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(van Gennep, 1960)\n\nvan Gennep, A. (1960). *The rites of passage*. (M. B. Vizedom & G. L.\nCaffee, Trans.). University of Chicago Press.\n\n\n}\n\n@Book{vangennep:trans,\n  author       = {van Gennep, Arnold},\n  title        = {The Rites of Passage},\n  year         = 1960,\n  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},\n  language     = {english},\n  origlanguage = {french},\n  publisher    = {University of Chicago Press},\n  options      = {useprefix},\n  indextitle   = {Rites of Passage, The},\n  sorttitle    = {Rites of Passage},\n  shorttitle   = {Rites of Passage},\n  hyphenation  = {american},\n  annotation   = {A translation of the vangennep entry. Note the\n                  translator and origlanguage fields. Compare\n                  with the vangennep:related entry.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: \"A translation of the vangennep entry. Note the translator and\n    origlanguage fields. Compare with the vangennep:related entry.\"\n  author:\n  - family: Gennep\n    given: Arnold\n    non-dropping-particle: van\n  id: \"vangennep:trans\"\n  issued: 1960\n  language: en-US\n  publisher: University of Chicago Press\n  title: The rites of passage\n  title-short: Rites of passage\n  translator:\n  - family: Vizedom\n    given: Monika B.\n  - family: Caffee\n    given: Gabrielle L.\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-vangennep.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(van Gennep 1909)\n\nvan Gennep, Arnold. 1909. *Les rites de passage*. Paris: Nourry.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(van Gennep, 1909)\n\nvan Gennep, A. (1909). *Les rites de passage*. Paris: Nourry.\n\n\n}\n\n@Book{vangennep,\n  author       = {van Gennep, Arnold},\n  title        = {Les rites de passage},\n  date         = 1909,\n  publisher    = {Nourry},\n  location     = {Paris},\n  options      = {useprefix},\n  hyphenation  = {french},\n  sorttitle    = {Rites de passage},\n  indextitle   = {Rites de passage, Les},\n  shorttitle   = {Rites de passage},\n  annotation   = {A book entry. Note the format of the printed name and\n                  compare the useprefix option in the options\n                  field as well as brandt and geer},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry. Note the format of the printed name and compare\n    the useprefix option in the options field as well as brandt and geer\n  author:\n  - family: Gennep\n    given: Arnold\n    non-dropping-particle: van\n  id: vangennep\n  issued: 1909\n  language: fr-FR\n  publisher: Nourry\n  publisher-place: Paris\n  title: Les rites de passage\n  title-short: Rites de passage\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-vazques-de-parga-mvbook.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Vázques de Parga, Lacarra, and Uría Ríu 1993)\n\nVázques de Parga, Luis, José María Lacarra, and Juan Uría Ríu. 1993.\n*Las Peregrinaciones a Santiago de Compostela*. 3. Pamplona: Iberdrola.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Vázques de Parga, Lacarra, & Uría Ríu, 1993)\n\nVázques de Parga, L., Lacarra, J. M., & Uría Ríu, J. (1993). *Las\nPeregrinaciones a Santiago de Compostela* (1-3). Pamplona: Iberdrola.\n\n\nNOTES:\n\n- citeproc\n\t- term \"vols.\" missing\n\n}\n\n@mvbook{vazques-de-parga,\n  author       = {V{\\'a}zques{ de }Parga, Luis and Lacarra, Jos{\\'e} Mar{\\'i}a\n                  and Ur{\\'i}a R{\\'i}u, Juan},\n  title        = {Las Peregrinaciones a Santiago de Compostela},\n  date         = 1993,\n  volumes      = 3,\n  note         = {Ed. facs. de la realizada en 1948--49},\n  publisher    = {Iberdrola},\n  location     = {Pamplona},\n  hyphenation  = {spanish},\n  sorttitle    = {Peregrinaciones a Santiago de Compostela},\n  indextitle   = {Peregrinaciones a Santiago de Compostela, Las},\n  shorttitle   = {Peregrinaciones},\n  annotation   = {A multivolume book cited as a whole. This is a book\n                  entry with volumes, note,\n                  sorttitle, and indextitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A multivolume book cited as a whole. This is a book entry with\n    volumes, note, sorttitle, and indextitle fields\n  author:\n  - family: Vázques de Parga\n    given: Luis\n  - family: Lacarra\n    given: José María\n  - family: Uría Ríu\n    given: Juan\n  id: vazques-de-parga\n  issued: 1993\n  language: es-ES\n  note: Ed. facs. de la realizada en 1948--49\n  number-of-volumes: 3\n  publisher: Iberdrola\n  publisher-place: Pamplona\n  title: Las Peregrinaciones a Santiago de Compostela\n  title-short: Peregrinaciones\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-vazques-de-parga.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Vázques de Parga, Lacarra, and Uría Ríu 1993)\n\nVázques de Parga, Luis, José María Lacarra, and Juan Uría Ríu. 1993.\n*Las Peregrinaciones a Santiago de Compostela*. 3. Pamplona: Iberdrola.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Vázques de Parga, Lacarra, & Uría Ríu, 1993)\n\nVázques de Parga, L., Lacarra, J. M., & Uría Ríu, J. (1993). *Las\nPeregrinaciones a Santiago de Compostela* (1-3). Pamplona: Iberdrola.\n\n\nNOTES:\n\n- citeproc\n\t- term \"vols.\" missing\n\n}\n\n@Book{vazques-de-parga,\n  author       = {V{\\'a}zques{ de }Parga, Luis and Lacarra, Jos{\\'e} Mar{\\'i}a\n                  and Ur{\\'i}a R{\\'i}u, Juan},\n  title        = {Las Peregrinaciones a Santiago de Compostela},\n  date         = 1993,\n  volumes      = 3,\n  note         = {Ed. facs. de la realizada en 1948--49},\n  publisher    = {Iberdrola},\n  location     = {Pamplona},\n  hyphenation  = {spanish},\n  sorttitle    = {Peregrinaciones a Santiago de Compostela},\n  indextitle   = {Peregrinaciones a Santiago de Compostela, Las},\n  shorttitle   = {Peregrinaciones},\n  annotation   = {A multivolume book cited as a whole. This is a book\n                  entry with volumes, note,\n                  sorttitle, and indextitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A multivolume book cited as a whole. This is a book entry with\n    volumes, note, sorttitle, and indextitle fields\n  author:\n  - family: Vázques de Parga\n    given: Luis\n  - family: Lacarra\n    given: José María\n  - family: Uría Ríu\n    given: Juan\n  id: vazques-de-parga\n  issued: 1993\n  language: es-ES\n  note: Ed. facs. de la realizada en 1948--49\n  number-of-volumes: 3\n  publisher: Iberdrola\n  publisher-place: Pamplona\n  title: Las Peregrinaciones a Santiago de Compostela\n  title-short: Peregrinaciones\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-video.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@video{x1,title={blah}}\n@movie{x2,title={blah}}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- id: x1\n  title: Blah\n  type: motion_picture\n- id: x2\n  title: Blah\n  type: motion_picture\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-vizedom-related.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Vizedom and Caffee 1960)\n\nVizedom, Monika B., and Gabrielle L. Caffee, trans. 1960. *The Rites of\nPassage*. University of Chicago Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Vizedom & Caffee, 1960)\n\nVizedom, M. B., & Caffee, G. L. (Trans.). (1960). *The rites of\npassage*. University of Chicago Press.\n\n\nNOTES:\n\n- biblio2yaml\n\t- \"related = {vangennep}, relatedtype = {translationof}\": no equivalent implemented in CSL\n\n}\n\n@Book{vizedom:related,\n  title        = {The Rites of Passage},\n  year         = 1960,\n  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},\n  language     = {english},\n  publisher    = {University of Chicago Press},\n  hyphenation  = {american},\n  options      = {usetranslator},\n  related      = {vangennep},\n  relatedtype  = {translationof},\n  indextitle   = {Rites of Passage, The},\n  sorttitle    = {Rites of Passage},\n  shorttitle   = {Rites of Passage},\n  annotation   = {A translated work from vangennep. Note the format of\n                  the related and relatedtype fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A translated work from vangennep. Note the format of the\n    related and relatedtype fields\n  id: \"vizedom:related\"\n  issued: 1960\n  language: en-US\n  publisher: University of Chicago Press\n  title: The rites of passage\n  title-short: Rites of passage\n  translator:\n  - family: Vizedom\n    given: Monika B.\n  - family: Caffee\n    given: Gabrielle L.\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-wassenberg.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Wassenberg and Sanders 2010)\n\nWassenberg, Jan, and Peter Sanders. 2010. “Faster Radix Sort via Virtual\nMemory and Write-combining” (version 1). August 17.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Wassenberg & Sanders, 2010)\n\nWassenberg, J., & Sanders, P. (2010, August 17). Faster radix sort via\nvirtual memory and write-combining.\n\n\nNOTES:\n\n- biblio2yaml\n\t- \"eprinttype = {arxiv}, eprintclass = {cs.DS}, eprint = {1008.2849v1}\" should be used to reconstruct a Url: http://arxiv.org/abs/1008.2849v1 (\"cs.DS\" does not seem to be essential)\n\n}\n\n@Online{wassenberg,\n  author       = {Wassenberg, Jan and Sanders, Peter},\n  title        = {Faster Radix Sort via Virtual Memory and Write-Combining},\n  date         = {2010-08-17},\n  version      = 1,\n  hyphenation  = {american},\n  eprinttype   = {arxiv},\n  eprintclass  = {cs.DS},\n  eprint       = {1008.2849v1},\n  annotation   = {A recent online reference from arXiv using the new\n                  (April 2007 onward) identifier format. Note the\n                  eprint, eprinttype, and eprintclass\n                  fields. Also note that the arXiv reference is transformed into\n                  a clickable link if hyperref support has been\n                  enabled},\n  abstract     = {Sorting algorithms are the deciding factor for the performance\n                  of common operations such as removal of duplicates or database\n                  sort-merge joins. This work focuses on 32-bit integer keys,\n                  optionally paired with a 32-bit value. We present a fast radix\n                  sorting algorithm that builds upon a microarchitecture-aware\n                  variant of counting sort},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- abstract: Sorting algorithms are the deciding factor for the\n    performance of common operations such as removal of duplicates or\n    database sort-merge joins. This work focuses on 32-bit integer keys,\n    optionally paired with a 32-bit value. We present a fast radix\n    sorting algorithm that builds upon a microarchitecture-aware variant\n    of counting sort\n  annote: A recent online reference from arXiv using the new (April 2007\n    onward) identifier format. Note the eprint, eprinttype, and\n    eprintclass fields. Also note that the arXiv reference is\n    transformed into a clickable link if hyperref support has been\n    enabled\n  author:\n  - family: Wassenberg\n    given: Jan\n  - family: Sanders\n    given: Peter\n  id: wassenberg\n  issued: 2010-08-17\n  language: en-US\n  title: Faster radix sort via virtual memory and write-combining\n  type: webpage\n  url: \"https://arxiv.org/abs/1008.2849v1\"\n  version: 1\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-weinberg.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Weinberg 1967)\n\nWeinberg, Steven. 1967. “A Model of Leptons.” *Phys. Rev. Lett.* 19:\n1264–1266.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Weinberg, 1967)\n\nWeinberg, S. (1967). A model of leptons. *Phys. Rev. Lett.*, *19*,\n1264–1266.\n\n\n}\n\n@Article{weinberg,\n  author       = {Weinberg, Steven},\n  title        = {A Model of Leptons},\n  journaltitle = {Phys.~Rev.~Lett.},\n  date         = 1967,\n  volume       = 19,\n  pages        = {1264-1266},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Weinberg\n    given: Steven\n  container-title: Phys. Rev. Lett.\n  id: weinberg\n  issued: 1967\n  page: 1264-1266\n  title: A model of leptons\n  type: article-journal\n  volume: 19\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-westfahl-frontier.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Westfahl 2000)\n\nWestfahl, Gary, ed. 2000. *Space and Beyond: The Frontier Theme in\nScience Fiction*. Westport, Conn.; London: Greenwood.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Westfahl, 2000)\n\nWestfahl, G. (Ed.). (2000). *Space and beyond: The frontier theme in\nscience fiction*. Westport, Conn.; London: Greenwood.\n\n\n}\n\n@Collection{westfahl:frontier,\n  editor       = {Westfahl, Gary},\n  title        = {Space and Beyond},\n  date         = 2000,\n  subtitle     = {The Frontier Theme in Science Fiction},\n  publisher    = {Greenwood},\n  location     = {Westport, Conn. and London},\n  hyphenation  = {american},\n  booktitle    = {Space and Beyond},\n  booksubtitle = {The Frontier Theme in Science Fiction},\n  annotation   = {This is a collection entry. Note the format of the\n                  location field as well as the subtitle and\n                  booksubtitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: This is a collection entry. Note the format of the location\n    field as well as the subtitle and booksubtitle fields\n  editor:\n  - family: Westfahl\n    given: Gary\n  id: \"westfahl:frontier\"\n  issued: 2000\n  language: en-US\n  publisher: Greenwood\n  publisher-place: Westport, Conn.; London\n  title: \"Space and beyond: The frontier theme in science fiction\"\n  title-short: Space and beyond\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-westfahl-space.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Westfahl 2000a) (Westfahl 2000b)\n\nWestfahl, Gary. 2000a. “The True Frontier: Confronting and Avoiding the\nRealities of Space in American Science Fiction Films.” In *Space and\nBeyond: The Frontier Theme in Science Fiction*, edited by Gary Westfahl,\n55–65. Westport, Conn.; London: Greenwood.\n\n———, ed. 2000b. *Space and Beyond: The Frontier Theme in Science\nFiction*. Westport, Conn.; London: Greenwood.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Westfahl, 2000) (Westfahl, 2000)\n\nWestfahl, G. (2000). The true frontier: Confronting and avoiding the\nrealities of space in American science fiction films. In G. Westfahl\n(Ed.), *Space and beyond: The frontier theme in science fiction* (pp.\n55–65). Westport, Conn.; London: Greenwood.\n\nWestfahl, G. (Ed.). (2000). *Space and beyond: The frontier theme in\nscience fiction*. Westport, Conn.; London: Greenwood.\n\n\n}\n\n@InCollection{westfahl:space,\n  author       = {Westfahl, Gary},\n  title        = {The True Frontier},\n  subtitle     = {Confronting and Avoiding the Realities of Space in {American}\n                  Science Fiction Films},\n  pages        = {55-65},\n  crossref     = {westfahl:frontier},\n  hyphenation  = {american},\n  indextitle   = {True Frontier, The},\n  annotation   = {A cross-referenced article from a collection. This is\n                  an incollection entry with a crossref\n                  field. Note the subtitle and indextitle\n                  fields},\n}\n\n@Collection{westfahl:frontier,\n  editor       = {Westfahl, Gary},\n  title        = {Space and Beyond},\n  date         = 2000,\n  subtitle     = {The Frontier Theme in Science Fiction},\n  publisher    = {Greenwood},\n  location     = {Westport, Conn. and London},\n  hyphenation  = {american},\n  booktitle    = {Space and Beyond},\n  booksubtitle = {The Frontier Theme in Science Fiction},\n  annotation   = {This is a collection entry. Note the format of the\n                  location field as well as the subtitle and\n                  booksubtitle fields},\n}\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A cross-referenced article from a collection. This is an\n    incollection entry with a crossref field. Note the subtitle and\n    indextitle fields\n  author:\n  - family: Westfahl\n    given: Gary\n  container-title: \"Space and beyond: The frontier theme in science\n    fiction\"\n  editor:\n  - family: Westfahl\n    given: Gary\n  id: \"westfahl:space\"\n  issued: 2000\n  language: en-US\n  page: 55-65\n  publisher: Greenwood\n  publisher-place: Westport, Conn.; London\n  title: \"The true frontier: Confronting and avoiding the realities of\n    space in American science fiction films\"\n  title-short: The true frontier\n  type: chapter\n- annote: This is a collection entry. Note the format of the location\n    field as well as the subtitle and booksubtitle fields\n  editor:\n  - family: Westfahl\n    given: Gary\n  id: \"westfahl:frontier\"\n  issued: 2000\n  language: en-US\n  publisher: Greenwood\n  publisher-place: Westport, Conn.; London\n  title: \"Space and beyond: The frontier theme in science fiction\"\n  title-short: Space and beyond\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-wilde.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Wilde 1899)\n\nWilde, Oscar. 1899. *The Importance of Being Earnest: A Trivial Comedy\nfor Serious People*. English and American Drama of the Nineteenth\nCentury. Leonard Smithers and Company.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Wilde, 1899)\n\nWilde, O. (1899). *The importance of being earnest: A trivial comedy for\nserious people*. Leonard Smithers and Company.\n\n\nNOTES:\n\n- biblio2yaml\n\t- From \"eprint = {4HIWAAAAYAAJ}, eprinttype = {googlebooks}\", a url could be reconstructed, shortest form: http://books.google.com?id=4HIWAAAAYAAJ\n\n}\n\n@Book{wilde,\n  author       = {Wilde, Oscar},\n  title        = {The Importance of Being Earnest: {A} Trivial Comedy for Serious\n                  People},\n  year         = 1899,\n  series       = {English and American drama of the Nineteenth Century},\n  publisher    = {Leonard Smithers {and} Company},\n  eprint       = {4HIWAAAAYAAJ},\n  eprinttype   = {googlebooks},\n  annotation   = {A book with eprint and eprinttype\n                  fields.},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book with eprint and eprinttype fields.\n  author:\n  - family: Wilde\n    given: Oscar\n  collection-title: English and american drama of the nineteenth century\n  id: wilde\n  issued: 1899\n  publisher: Leonard Smithers and Company\n  title: \"The importance of being earnest: A trivial comedy for serious\n    people\"\n  title-short: The importance of being earnest\n  type: book\n  url: \"https://books.google.com?id=4HIWAAAAYAAJ\"\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-worman.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Worman 2002)\n\nWorman, Nancy. 2002. *The Cast of Character: Style in Greek Literature*.\nAustin: University of Texas Press.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Worman, 2002)\n\nWorman, N. (2002). *The cast of character: Style in Greek literature*.\nAustin: University of Texas Press.\n\n\n}\n\n@Book{worman,\n  author       = {Worman, Nancy},\n  title        = {The Cast of Character},\n  date         = 2002,\n  publisher    = {University of Texas Press},\n  location     = {Austin},\n  hyphenation  = {american},\n  sorttitle    = {Cast of Character},\n  indextitle   = {Cast of Character, The},\n  subtitle     = {Style in {Greek} Literature},\n  shorttitle   = {Cast of Character},\n  annotation   = {A book entry. Note the sorttitle and\n                  indextitle fields},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- annote: A book entry. Note the sorttitle and indextitle fields\n  author:\n  - family: Worman\n    given: Nancy\n  id: worman\n  issued: 2002\n  language: en-US\n  publisher: University of Texas Press\n  publisher-place: Austin\n  title: \"The cast of character: Style in Greek literature\"\n  title-short: Cast of character\n  type: book\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblatex-yoon.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@comment{\n\nAdapted from biblatex-example.bib\n\n\nFormatted with pandoc and chicago-author-date.csl, 2013-10-23:\n\n(Yoon et al. 2006)\n\nYoon, Myeong S., Dowook Ryu, Jeongryul Kim, and Kyo Han Ahn. 2006.\n“Palladium Pincer Complexes with Reduced Bond Angle Strain: Efficient\nCatalysts for the Heck Reaction.” *Organometallics* 25 (10): 2409–2411.\n\n\nFormatted with pandoc and apa.csl, 2013-10-23:\n\n(Yoon, Ryu, Kim, & Ahn, 2006)\n\nYoon, M. S., Ryu, D., Kim, J., & Ahn, K. H. (2006). Palladium pincer\ncomplexes with reduced bond angle strain: Efficient catalysts for the\nHeck reaction. *Organometallics*, *25*(10), 2409–2411.\n\n\n}\n\n@Article{yoon,\n  author       = {Yoon, Myeong S. and Ryu, Dowook and Kim, Jeongryul and Ahn,\n                  Kyo Han},\n  title        = {Palladium pincer complexes with reduced bond angle strain:\n                  efficient catalysts for the {Heck} reaction},\n  journaltitle = {Organometallics},\n  date         = 2006,\n  volume       = 25,\n  number       = 10,\n  pages        = {2409-2411},\n  indextitle   = {Palladium pincer complexes},\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Yoon\n    given: Myeong S.\n  - family: Ryu\n    given: Dowook\n  - family: Kim\n    given: Jeongryul\n  - family: Ahn\n    given: Kyo Han\n  container-title: Organometallics\n  id: yoon\n  issue: 10\n  issued: 2006\n  page: 2409-2411\n  title: \"Palladium pincer complexes with reduced bond angle strain:\n    Efficient catalysts for the Heck reaction\"\n  title-short: Palladium pincer complexes with reduced bond angle strain\n  type: article-journal\n  volume: 25\n---\n\n\n```\n"
  },
  {
    "path": "test/command/biblio.bib",
    "content": "@Book{item1,\nauthor=\"John Doe\",\ntitle=\"First Book\",\nyear=\"2005\",\naddress=\"Cambridge\",\npublisher=\"Cambridge University Press\"\n}\n\n@Article{item2,\nauthor=\"John Doe\",\ntitle=\"Article\",\nyear=\"2006\",\njournal=\"Journal of Generic Studies\",\nvolume=\"6\",\npages=\"33-34\"\n}\n\n@InCollection{пункт3,\nauthor=\"John Doe and Jenny Roe\",\ntitle=\"Why Water Is Wet\",\nbooktitle=\"Third Book\",\neditor=\"Sam Smith\",\npublisher=\"Oxford University Press\",\naddress=\"Oxford\",\nyear=\"2007\"\n}\n"
  },
  {
    "path": "test/command/bibtex-basic.md",
    "content": "```\n% pandoc -f biblatex -t markdown -s\n@Book{item1,\nauthor=\"John Doe\",\ntitle=\"First Book\",\nyear=\"2005\",\naddress=\"Cambridge\",\npublisher=\"Cambridge University Press\"\n}\n\n@Article{item2,\nauthor=\"John Doe\",\ntitle=\"Article\",\nyear=\"2006\",\njournal=\"Journal of Generic Studies\",\nvolume=\"6\",\npages=\"33-34\"\n}\n\n@InCollection{пункт3,\nauthor=\"John Doe and Jenny Roe\",\ntitle=\"Why Water Is Wet\",\nbooktitle=\"Third Book\",\neditor=\"Sam Smith\",\npublisher=\"Oxford University Press\",\naddress=\"Oxford\",\nyear=\"2007\"\n}\n\n^D\n---\nnocite: \"[@*]\"\nreferences:\n- author:\n  - family: Doe\n    given: John\n  id: item1\n  issued: 2005\n  publisher: Cambridge University Press\n  publisher-place: Cambridge\n  title: First book\n  type: book\n- author:\n  - family: Doe\n    given: John\n  container-title: Journal of Generic Studies\n  id: item2\n  issued: 2006\n  page: 33-34\n  title: Article\n  type: article-journal\n  volume: 6\n- author:\n  - family: Doe\n    given: John\n  - family: Roe\n    given: Jenny\n  container-title: Third book\n  editor:\n  - family: Smith\n    given: Sam\n  id: пункт3\n  issued: 2007\n  publisher: Oxford University Press\n  publisher-place: Oxford\n  title: Why water is wet\n  type: chapter\n---\n\n\n```\n"
  },
  {
    "path": "test/command/bioethics.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" page-range-format=\"minimal-two\" demote-non-dropping-particle=\"never\" default-locale=\"en-GB\">\n  <info>\n    <title>Bioethics</title>\n    <id>http://www.zotero.org/styles/bioethics</id>\n    <link href=\"http://www.zotero.org/styles/bioethics\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/journal-of-roman-archaeology-b\" rel=\"template\"/>\n    <link href=\"http://onlinelibrary.wiley.com/journal/10.1111/(ISSN)1467-8519/homepage/ForAuthors.html\" rel=\"documentation\"/>\n    <author>\n      <name>Patrick O'Brien</name>\n    </author>\n    <category citation-format=\"note\"/>\n    <category field=\"anthropology\"/>\n    <issn>0269-9702</issn>\n    <eissn>1467-8519</eissn>\n    <updated>2017-07-12T11:26:44+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name sort-separator=\", \" initialize-with=\".\" delimiter=\", \"/>\n      <label form=\"short\" prefix=\", \"/>\n      <substitute>\n        <text macro=\"container-author\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"container-author\">\n    <names variable=\"container-author\" delimiter=\", \">\n      <name sort-separator=\", \" initialize-with=\".\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name initialize-with=\".\"/>\n      <substitute>\n        <text macro=\"editor\"/>\n        <text variable=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor-short\">\n    <names variable=\"editor\">\n      <name form=\"short\" sort-separator=\", \" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"container-author-short\">\n    <names variable=\"container-author\" delimiter=\", \">\n      <name form=\"short\" sort-separator=\", \" delimiter=\", \"/>\n      <et-al font-style=\"italic\"/>\n    </names>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" sort-separator=\", \" delimiter=\", \"/>\n      <et-al font-style=\"italic\"/>\n      <substitute>\n        <text macro=\"editor-short\"/>\n        <text macro=\"container-author-short\"/>\n        <text variable=\"title-short\" font-style=\"italic\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"collection\">\n    <group delimiter=\" \" suffix=\", \">\n      <text variable=\"collection-title\"/>\n      <text variable=\"collection-number\"/>\n    </group>\n  </macro>\n  <macro name=\"encyclopedia\">\n    <group delimiter=\" \">\n      <choose>\n        <if variable=\"title-short\" match=\"any\">\n          <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n        </if>\n        <else>\n          <text variable=\"container-title\" font-style=\"italic\"/>\n        </else>\n      </choose>\n      <text variable=\"volume\"/>\n      <date variable=\"issued\" prefix=\"(\" suffix=\")\">\n        <date-part name=\"year\"/>\n      </date>\n      <text variable=\"page\" suffix=\",\"/>\n      <text variable=\"title\" prefix=\"s.v. \" quotes=\"true\"/>\n      <text macro=\"author\" prefix=\"(\" suffix=\")\"/>\n    </group>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"book thesis\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <date form=\"text\" variable=\"issued\" suffix=\". \"/>\n        <text variable=\"title\" font-style=\"italic\" suffix=\". \"/>\n        <text variable=\"container-title\" font-style=\"italic\"/>\n      </else-if>\n      <else-if type=\"article-journal article-magazine article-newspaper\" match=\"any\">\n        <group delimiter=\". \">\n          <text variable=\"title\" quotes=\"false\"/>\n          <group delimiter=\" \">\n            <text variable=\"container-title\" form=\"short\" strip-periods=\"true\" font-style=\"italic\"/>\n            <group delimiter=\"; \">\n              <text macro=\"year-date\"/>\n              <group delimiter=\": \">\n                <group>\n                  <text variable=\"volume\"/>\n                  <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n                </group>\n                <text variable=\"page\"/>\n              </group>\n            </group>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"chapter paper-conference\" match=\"any\">\n        <group delimiter=\". \" suffix=\". \">\n          <text macro=\"year-date\"/>\n          <text variable=\"title\" quotes=\"false\"/>\n        </group>\n        <group delimiter=\". \">\n          <group delimiter=\" \">\n            <text term=\"in\" text-case=\"capitalize-first\"/>\n            <text macro=\"editor\"/>\n          </group>\n          <text variable=\"container-title\"/>\n        </group>\n      </else-if>\n      <else>\n        <text variable=\"title\" font-style=\"italic\" font-weight=\"bold\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if variable=\"collection-title\" match=\"any\">\n        <text macro=\"collection\"/>\n      </if>\n      <else-if type=\"thesis\">\n        <text variable=\"genre\" suffix=\",\"/>\n        <text variable=\"publisher\"/>\n      </else-if>\n      <else>\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"year-date\">\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locator\">\n    <choose>\n      <if locator=\"page\">\n        <text variable=\"locator\" prefix=\": \"/>\n      </if>\n      <else-if locator=\"paragraph\">\n        <text variable=\"locator\" prefix=\"§\"/>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\" \" prefix=\". \">\n          <group delimiter=\": \">\n            <text term=\"available at\" text-case=\"capitalize-first\"/>\n            <text variable=\"URL\"/>\n          </group>\n          <group delimiter=\" \" prefix=\"[\" suffix=\"]\">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date form=\"text\" variable=\"accessed\"/>\n          </group>\n        </group>\n      </else-if>\n      <else>\n        <text variable=\"page\" prefix=\": \"/>\n      </else>\n    </choose>\n  </macro>\n  <citation and=\"symbol\" delimiter-precedes-et-al=\"always\" delimiter-precedes-last=\"always\" et-al-min=\"3\" et-al-use-first=\"1\">\n    <layout delimiter=\"; \" suffix=\".\">\n      <choose>\n        <if type=\"entry-dictionary entry-encyclopedia\" match=\"any\">\n          <text macro=\"encyclopedia\"/>\n        </if>\n        <else-if position=\"ibid-with-locator\">\n          <group delimiter=\" \">\n            <text term=\"ibid\" suffix=\".\"/>\n            <text macro=\"locator\"/>\n          </group>\n        </else-if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\" suffix=\".\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <group delimiter=\" \">\n            <text macro=\"author-short\"/>\n            <group prefix=\"(\" suffix=\")\" delimiter=\" \">\n              <text term=\"cited\"/>\n              <group delimiter=\"&#160;\">\n                <text term=\"note\" form=\"short\"/>\n                <text variable=\"first-reference-note-number\"/>\n              </group>\n            </group>\n            <text macro=\"locator\"/>\n          </group>\n        </else-if>\n        <else>\n          <text macro=\"author\" suffix=\". \"/>\n          <text macro=\"title\"/>\n          <text macro=\"publisher\" prefix=\". \"/>\n          <text macro=\"locator\"/>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n</style>\n"
  },
  {
    "path": "test/command/bits-book-meta.md",
    "content": "```\n% pandoc -f jats -t native -s\n<book>\n    <book-meta>\n\t\t<book-id book-id-type=\"publisher\">handbook-648</book-id>\n  \t\t<book-title-group>\n   \t\t\t<book-title>The NCBI Handbook</book-title>\n  \t\t</book-title-group>\n  \t\t<contrib-group>\n   \t\t\t<contrib contrib-type=\"author\">\n    \t\t\t<name><surname>McEntyre</surname>\n     \t\t\t<given-names>Jo</given-names></name>\n    \t\t\t<xref ref-type=\"aff\" rid=\"bid.m.1\"/>\n   \t\t\t</contrib>\n   \t\t\t<contrib contrib-type=\"editor\">\n    \t\t\t<name><surname>Ostell</surname>\n     \t\t\t<given-names>Jim</given-names></name>\n    \t\t\t<xref ref-type=\"aff\" rid=\"bid.m.1\"/>\n   \t\t\t</contrib>\n  \t\t</contrib-group>\n  \t\t<aff id=\"bid.m.1\">\n   \t\t\t<institution>National Center for Biotechnology Information (NCBI), National Library of Medicine, National Institutes of Health</institution>, <addr-line>Bethesda, MD 20892-6510</addr-line>\n  \t\t</aff>\n  \t\t<pub-date iso-8601-date=\"2002-11\">\n   \t\t\t<month>11</month>\n   \t\t\t<year>2002</year>\n  \t\t</pub-date>\n  \t\t<publisher>\n   \t\t\t<publisher-name>National Center for Biotechnology Information (NCBI), National Library of Medicine, National Institutes of Health</publisher-name>\n   \t\t\t<publisher-loc>Bethesda, MD</publisher-loc>\n  \t\t</publisher>\n  \t\t<edition>1</edition>\n  \t\t<counts>\n   \t\t\t<book-fig-count count=\"98\"/>\n   \t\t\t<book-table-count count=\"40\"/>\n   \t\t\t<book-equation-count count=\"0\"/>\n   \t\t\t<book-ref-count count=\"115\"/>\n   \t\t\t<book-page-count count=\"532\"/>\n   \t\t\t<book-word-count count=\"149852\"/>\n  \t\t</counts>\n \t</book-meta>\n</book>\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"Jo\" , Space , Str \"McEntyre\" ] ]\n            )\n          , ( \"date\" , MetaInlines [ Str \"2002-11\" ] )\n          , ( \"institute\"\n            , MetaList\n                [ MetaInlines\n                    [ Str \"National\"\n                    , Space\n                    , Str \"Center\"\n                    , Space\n                    , Str \"for\"\n                    , Space\n                    , Str \"Biotechnology\"\n                    , Space\n                    , Str \"Information\"\n                    , Space\n                    , Str \"(NCBI),\"\n                    , Space\n                    , Str \"National\"\n                    , Space\n                    , Str \"Library\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"Medicine,\"\n                    , Space\n                    , Str \"National\"\n                    , Space\n                    , Str \"Institutes\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"Health,\"\n                    , Space\n                    , Str \"Bethesda,\"\n                    , Space\n                    , Str \"MD\"\n                    , Space\n                    , Str \"20892-6510\"\n                    ]\n                ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"The\"\n                , Space\n                , Str \"NCBI\"\n                , Space\n                , Str \"Handbook\"\n                ]\n            )\n          ]\n    }\n  []\n```"
  },
  {
    "path": "test/command/bits-book-part-wrapper-meta.md",
    "content": "```\n% pandoc -f jats -t native -s\n<book-part-wrapper \n  dtd-version=\"2.1\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xmlns:xi=\"http://www.w3.org/2001/XInclude\"\n  xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\n <collection-meta>\n  <title-group>\n   <title>Balisage Series on Markup Technologies</title>\n  </title-group>\n \n  <abstract>\n   <p>The <italic>Balisage Series on Markup Technologies</italic> \n    is an occasional series...</p>\n  </abstract>\n </collection-meta>\n\n <book-meta>\n  <book-title-group>\n   <book-title>Proceedings of Balisage: The Markup Conference \n    2013</book-title>\n  </book-title-group>\n \n  <abstract>\n   <p>Balisage is a peer-reviewed conference...</p></abstract>\n \n </book-meta>\n</book-part-wrapper>\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"abstract\"\n            , MetaBlocks\n                [ Para\n                    [ Str \"Balisage\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"peer-reviewed\"\n                    , Space\n                    , Str \"conference...\"\n                    ]\n                ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Proceedings\"\n                , Space\n                , Str \"of\"\n                , Space\n                , Str \"Balisage:\"\n                , Space\n                , Str \"The\"\n                , Space\n                , Str \"Markup\"\n                , Space\n                , Str \"Conference\"\n                , SoftBreak\n                , Str \"2013\"\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"The\"\n      , Space\n      , Emph\n          [ Str \"Balisage\"\n          , Space\n          , Str \"Series\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"Markup\"\n          , Space\n          , Str \"Technologies\"\n          ]\n      , SoftBreak\n      , Str \"is\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"occasional\"\n      , Space\n      , Str \"series...\"\n      ]\n  ]\n```"
  },
  {
    "path": "test/command/bits-book-part-wrapper.md",
    "content": "```\n% pandoc -f jats -t native\n<book-part-wrapper \n  dtd-version=\"2.1\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xmlns:xi=\"http://www.w3.org/2001/XInclude\"\n  xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\n <collection-meta>\n  <title-group>\n   <title>Balisage Series on Markup Technologies</title>\n  </title-group>\n \n  <abstract>\n   <p>The <italic>Balisage Series on Markup Technologies</italic> \n    is an occasional series...</p>\n  </abstract>\n </collection-meta>\n\n <book-meta>\n  <book-title-group>\n   <book-title>Proceedings of Balisage: The Markup Conference \n    2013</book-title>\n  </book-title-group>\n \n  <abstract>\n   <p>Balisage is a peer-reviewed conference...</p></abstract>\n \n </book-meta>\n\n <book-part id=\"bid.1\" book-part-type=\"part\">\n   \t\t\t<book-part-meta>\n    \t\t\t<title-group>\n     \t\t\t\t<label>Part 1</label>\n     \t\t\t\t<title>The Databases</title>\n    \t\t\t</title-group>\n   \t\t\t</book-part-meta>\n   \t\t\t<body>\n    \t\t\t<sec id=\"bid.3\">\n     \t\t\t\t<title>History</title>\n     \t\t\t\t<p>Initially, GenBank was built and maintained at Los Alamos \n      \t\t\t\tNational Laboratory.</p>\n    \t\t\t</sec>\n   \t\t\t</body>\n   \t\t\t<back>\n                <title>Back matter of book part</title>\n  \t\t\t\t<ref-list>\n   \t\t\t\t\t<title>References</title>\n   \t\t\t\t\t<ref id=\"bid.41\">\n    \t\t\t\t\t<label>1</label>\n    \t\t\t\t\t<element-citation>\n     \t\t\t\t\t\t<person-group>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Olson</surname>\n       \t\t\t\t\t\t\t\t<given-names>M</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Hood</surname>\n       \t\t\t\t\t\t\t\t<given-names>L</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Cantor</surname>\n       \t\t\t\t\t\t\t\t<given-names>C</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Botstein</surname>\n       \t\t\t\t\t\t\t\t<given-names>D</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n     \t\t\t\t\t\t</person-group>\n     \t\t\t\t\t\t<article-title>A common language for physical mapping of the human genome</article-title>\n     \t\t\t\t\t\t<source>Science</source>\n     \t\t\t\t\t\t<year iso-8601-date=\"1989\">1989</year>\n     \t\t\t\t\t\t<volume>245</volume>\n     \t\t\t\t\t\t<issue>4925</issue>\n     \t\t\t\t\t\t<fpage>1434</fpage>\n     \t\t\t\t\t\t<lpage>1435</lpage>\n     \t\t\t\t\t\t<pub-id pub-id-type=\"pmid\">2781285</pub-id>\n    \t\t\t\t\t</element-citation>\n   \t\t\t\t\t</ref>\n  \t\t\t\t</ref-list>\n \t\t\t</back>\n  \t</book-part>\n</book-part-wrapper>\n^D\n[ Para\n    [ Str \"The\"\n    , Space\n    , Emph\n        [ Str \"Balisage\"\n        , Space\n        , Str \"Series\"\n        , Space\n        , Str \"on\"\n        , Space\n        , Str \"Markup\"\n        , Space\n        , Str \"Technologies\"\n        ]\n    , SoftBreak\n    , Str \"is\"\n    , Space\n    , Str \"an\"\n    , Space\n    , Str \"occasional\"\n    , Space\n    , Str \"series...\"\n    ]\n, Header 2 ( \"bid.3\" , [] , [] ) [ Str \"History\" ]\n, Para\n    [ Str \"Initially,\"\n    , Space\n    , Str \"GenBank\"\n    , Space\n    , Str \"was\"\n    , Space\n    , Str \"built\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"maintained\"\n    , Space\n    , Str \"at\"\n    , Space\n    , Str \"Los\"\n    , Space\n    , Str \"Alamos\"\n    , SoftBreak\n    , Str \"National\"\n    , Space\n    , Str \"Laboratory.\"\n    ]\n, Header\n    2\n    ( \"\" , [] , [] )\n    [ Str \"Back\"\n    , Space\n    , Str \"matter\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"book\"\n    , Space\n    , Str \"part\"\n    ]\n, Header 1 ( \"\" , [] , [] ) [ Str \"References\" ]\n, Div ( \"refs\" , [] , [] ) []\n]\n```"
  },
  {
    "path": "test/command/bits-book.md",
    "content": "```\n% pandoc -f jats -t native\n<book dtd-version=\"2.1\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\">\n \t<front-matter>\n  \t\t<front-matter-part>\n   \t\t\t<book-part-meta>\n    \t\t\t<title-group>\n     \t\t\t\t<title>About this book</title>\n    \t\t\t</title-group>\n   \t\t\t</book-part-meta>\n   \t\t\t<named-book-part-body>\n    \t\t\t<sec sec-type=\"miscinfo\">\n     \t\t\t\t<title>The NCBI Handbook</title>\n     \t\t\t\t<p>Bioinformatics consists of a computational approach\n      \t\t\t\tto biomedical information management and analysis.</p>\n    \t\t\t</sec>\n   \t\t\t</named-book-part-body>\n  \t\t</front-matter-part>\n \t</front-matter>\n \t<book-body>\n  \t\t<book-part id=\"bid.1\" book-part-type=\"part\">\n   \t\t\t<book-part-meta>\n    \t\t\t<title-group>\n     \t\t\t\t<label>Part 1</label>\n     \t\t\t\t<title>The Databases</title>\n    \t\t\t</title-group>\n   \t\t\t</book-part-meta>\n   \t\t\t<body>\n    \t\t\t<sec id=\"bid.3\">\n     \t\t\t\t<title>History</title>\n     \t\t\t\t<p>Initially, GenBank was built and maintained at Los Alamos \n      \t\t\t\tNational Laboratory.</p>\n    \t\t\t</sec>\n   \t\t\t</body>\n   \t\t\t<back>\n                <title>Back matter of book part</title>\n  \t\t\t\t<ref-list>\n   \t\t\t\t\t<title>References</title>\n   \t\t\t\t\t<ref id=\"bid.41\">\n    \t\t\t\t\t<label>1</label>\n    \t\t\t\t\t<element-citation>\n     \t\t\t\t\t\t<person-group>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Olson</surname>\n       \t\t\t\t\t\t\t\t<given-names>M</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Hood</surname>\n       \t\t\t\t\t\t\t\t<given-names>L</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Cantor</surname>\n       \t\t\t\t\t\t\t\t<given-names>C</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n      \t\t\t\t\t\t\t<string-name>\n\t\t\t\t\t\t\t\t\t<surname>Botstein</surname>\n       \t\t\t\t\t\t\t\t<given-names>D</given-names>\n\t\t\t\t\t\t\t\t</string-name>\n     \t\t\t\t\t\t</person-group>\n     \t\t\t\t\t\t<article-title>A common language for physical mapping of the human genome</article-title>\n     \t\t\t\t\t\t<source>Science</source>\n     \t\t\t\t\t\t<year iso-8601-date=\"1989\">1989</year>\n     \t\t\t\t\t\t<volume>245</volume>\n     \t\t\t\t\t\t<issue>4925</issue>\n     \t\t\t\t\t\t<fpage>1434</fpage>\n     \t\t\t\t\t\t<lpage>1435</lpage>\n     \t\t\t\t\t\t<pub-id pub-id-type=\"pmid\">2781285</pub-id>\n    \t\t\t\t\t</element-citation>\n   \t\t\t\t\t</ref>\n  \t\t\t\t</ref-list>\n \t\t\t</back>\n  \t\t</book-part>\n \t</book-body>\n \t<book-back>\n  \t\t<ack id=\"bid.394\">\n   \t\t<title>Acknowledgments</title>\n   \t\t<p>We gratefully acknowledge the work of Vladimir Soussov,\n    \tas well as the entire NCBI Entrez team...</p>\n  \t\t</ack>\n \t</book-back>\n</book>\n^D\n[ Header\n    2\n    ( \"\" , [] , [] )\n    [ Str \"The\" , Space , Str \"NCBI\" , Space , Str \"Handbook\" ]\n, Para\n    [ Str \"Bioinformatics\"\n    , Space\n    , Str \"consists\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"computational\"\n    , Space\n    , Str \"approach\"\n    , SoftBreak\n    , Str \"to\"\n    , Space\n    , Str \"biomedical\"\n    , Space\n    , Str \"information\"\n    , Space\n    , Str \"management\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"analysis.\"\n    ]\n, Header 2 ( \"bid.3\" , [] , [] ) [ Str \"History\" ]\n, Para\n    [ Str \"Initially,\"\n    , Space\n    , Str \"GenBank\"\n    , Space\n    , Str \"was\"\n    , Space\n    , Str \"built\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"maintained\"\n    , Space\n    , Str \"at\"\n    , Space\n    , Str \"Los\"\n    , Space\n    , Str \"Alamos\"\n    , SoftBreak\n    , Str \"National\"\n    , Space\n    , Str \"Laboratory.\"\n    ]\n, Header\n    2\n    ( \"\" , [] , [] )\n    [ Str \"Back\"\n    , Space\n    , Str \"matter\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"book\"\n    , Space\n    , Str \"part\"\n    ]\n, Header 1 ( \"\" , [] , [] ) [ Str \"References\" ]\n, Div ( \"refs\" , [] , [] ) []\n, Header 2 ( \"bid.394\" , [] , [] ) [ Str \"Acknowledgments\" ]\n, Para\n    [ Str \"We\"\n    , Space\n    , Str \"gratefully\"\n    , Space\n    , Str \"acknowledge\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"work\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"Vladimir\"\n    , Space\n    , Str \"Soussov,\"\n    , SoftBreak\n    , Str \"as\"\n    , Space\n    , Str \"well\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"entire\"\n    , Space\n    , Str \"NCBI\"\n    , Space\n    , Str \"Entrez\"\n    , Space\n    , Str \"team...\"\n    ]\n]\n```"
  },
  {
    "path": "test/command/bits-index-elements.md",
    "content": "```\n% pandoc -f jats -t native\n<index-group>\n\t<index-title-group>\n\t\t<title>Index group</title>\n\t</index-title-group>\n\t<p>Content of index group</p>\n\t<index>\n\t\t<index-title-group>\n\t\t\t<title>Index</title>\n\t\t</index-title-group>\n\t\t<p>Content of index</p>\n  \t\t<index-div>\n   \t\t\t<index-title-group>\n    \t\t\t<title>N</title>\n   \t\t\t</index-title-group>\n   \t\t\t<p>Content of index div</p>\n   \t\t\t<index-entry>\n    \t\t\t<term>Navy</term>\n    \t\t\t<x>.</x>\n    \t\t\t<see-entry>Armed forces</see-entry>\n    \t\t\t<x>.</x>\n   \t\t\t</index-entry>\n   \t\t\t<index-entry>\n    \t\t\t<term>Necessary and proper clause, congressional power</term>\n   \t\t\t</index-entry>\n   \t\t\t<index-entry>\n    \t\t\t<term>Newsgathering as commerce</term>\n   \t\t\t</index-entry>\n  \t\t</index-div>\n\t</index>\n</index-group>\n^D\n[ Header\n    1 ( \"\" , [] , [] ) [ Str \"Index\" , Space , Str \"group\" ]\n, Para\n    [ Str \"Content\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"index\"\n    , Space\n    , Str \"group\"\n    ]\n, Header 2 ( \"\" , [] , [] ) [ Str \"Index\" ]\n, Para\n    [ Str \"Content\" , Space , Str \"of\" , Space , Str \"index\" ]\n, Header 3 ( \"\" , [] , [] ) [ Str \"N\" ]\n, Para\n    [ Str \"Content\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"index\"\n    , Space\n    , Str \"div\"\n    ]\n, Plain [ Str \"Navy\" ]\n, Plain [ Str \".\" ]\n, Plain [ Str \"Armed\" , Space , Str \"forces\" ]\n, Plain [ Str \".\" ]\n, Plain\n    [ Str \"Necessary\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"proper\"\n    , Space\n    , Str \"clause,\"\n    , Space\n    , Str \"congressional\"\n    , Space\n    , Str \"power\"\n    ]\n, Plain\n    [ Str \"Newsgathering\"\n    , Space\n    , Str \"as\"\n    , Space\n    , Str \"commerce\"\n    ]\n]\n```"
  },
  {
    "path": "test/command/bits-legend.md",
    "content": "```\n% pandoc -f jats -t native\n<fig id=\"fig_A.1\" orientation=\"portrait\">\n <label>Figure A.1</label>\n <caption>\n  <title>Field of Application</title>\n </caption>\n <legend>\n  <title>Key</title>\n  <def-list>\n   <def-item>\n    <term>I</term>\n    <def><p>input</p></def>\n   </def-item>\n   <def-item>\n    <term>O</term>\n    <def><p>output</p></def>\n   </def-item>\n   ...\n  </def-list>\n </legend>\n <graphic xlink:href=\"1234\"/>\n</fig>\n^D\n[ Figure\n    ( \"fig_A.1\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Field\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"Application\"\n           ]\n       ])\n    [ Header 1 ( \"\" , [] , [] ) [ Str \"Key\" ]\n    , DefinitionList\n        [ ( [ Str \"I\" ] , [ [ Para [ Str \"input\" ] ] ] )\n        , ( [ Str \"O\" ] , [ [ Para [ Str \"output\" ] ] ] )\n        ]\n    , Para [ Image ( \"\" , [] , [] ) [] ( \"1234\" , \"\" ) ]\n    ]\n]\n```"
  },
  {
    "path": "test/command/bits-named-boook-parts.md",
    "content": "```\n% pandoc -f jats -t native\n<dedication>\n\t<named-book-part-body>\n\t\t<p>This is the dedication text.</p>\n\t</named-book-part-body>\n</dedication>\n^D\n[ Header 1 ( \"\" , [] , [] ) [ Str \"Dedication\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"dedication\"\n    , Space\n    , Str \"text.\"\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<foreword>\n\t<named-book-part-body>\n\t\t<p>This is the foreword text.</p>\n\t</named-book-part-body>\n</foreword>\n^D\n[ Header 1 ( \"\" , [] , [] ) [ Str \"Foreword\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"foreword\"\n    , Space\n    , Str \"text.\"\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<preface>\n\t<named-book-part-body>\n\t\t<p>This is the preface text.</p>\n\t</named-book-part-body>\n</preface>\n^D\n[ Header 1 ( \"\" , [] , [] ) [ Str \"Preface\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"preface\"\n    , Space\n    , Str \"text.\"\n    ]\n]\n```"
  },
  {
    "path": "test/command/bits-title-display-as.md",
    "content": "```\n% pandoc -f jats -t native\n<sec>\n\t<title>THE EUROPEAN UNION  EXPLAINED</title>\n</sec>\n^D\n[ Header\n    1\n    ( \"\" , [] , [] )\n    [ Str \"THE\"\n    , Space\n    , Str \"EUROPEAN\"\n    , Space\n    , Str \"UNION\"\n    , Space\n    , Str \"EXPLAINED\"\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<sec>\n\t<title display-as=\"3\">THE EUROPEAN UNION  EXPLAINED</title>\n</sec>\n^D\n[ Header\n    3\n    ( \"\" , [] , [] )\n    [ Str \"THE\"\n    , Space\n    , Str \"EUROPEAN\"\n    , Space\n    , Str \"UNION\"\n    , Space\n    , Str \"EXPLAINED\"\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<body>\n\t<sec>\n\t\t<title>The European Parliament</title>\n\t\t<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>\n\t\t<sec>\n\t\t    <title display-as=\"3\">Composition of the European Parliament</title>\n\t\t\t<p>The seats in the European Parliament are allocated among the Member States.</p>\n\t\t</sec>\n        <sec>\n            <title>Composition of the European Parliament - II </title>\n            <p>Most MEPs are associated with a national political party in their home country.</p>\n\t\t</sec>\n    </sec>\n</body>\n^D\n[ Header\n    1\n    ( \"\" , [] , [] )\n    [ Str \"The\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    ]\n, Para\n    [ Str \"Members\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    , Space\n    , Str \"(MEPs)\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"directly\"\n    , Space\n    , Str \"elected\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"EU\"\n    , Space\n    , Str \"citizens.\"\n    ]\n, Header\n    3\n    ( \"\" , [] , [] )\n    [ Str \"Composition\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    ]\n, Para\n    [ Str \"The\"\n    , Space\n    , Str \"seats\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"allocated\"\n    , Space\n    , Str \"among\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"Member\"\n    , Space\n    , Str \"States.\"\n    ]\n, Header\n    2\n    ( \"\" , [] , [] )\n    [ Str \"Composition\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    , Space\n    , Str \"-\"\n    , Space\n    , Str \"II\"\n    ]\n, Para\n    [ Str \"Most\"\n    , Space\n    , Str \"MEPs\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"associated\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"national\"\n    , Space\n    , Str \"political\"\n    , Space\n    , Str \"party\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"their\"\n    , Space\n    , Str \"home\"\n    , Space\n    , Str \"country.\"\n    ]\n]\n```"
  },
  {
    "path": "test/command/bits-title-supress.md",
    "content": "```\n% pandoc -f jats -t native\n<sec>\n\t<title>The European Parliament</title>\n\t<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>\n</sec>\n^D\n[ Header\n    1\n    ( \"\" , [] , [] )\n    [ Str \"The\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    ]\n, Para\n    [ Str \"Members\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    , Space\n    , Str \"(MEPs)\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"directly\"\n    , Space\n    , Str \"elected\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"EU\"\n    , Space\n    , Str \"citizens.\"\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<sec>\n\t<title suppress=\"no\">The European Parliament</title>\n\t<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>\n</sec>\n^D\n[ Header\n    1\n    ( \"\" , [] , [] )\n    [ Str \"The\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    ]\n, Para\n    [ Str \"Members\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    , Space\n    , Str \"(MEPs)\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"directly\"\n    , Space\n    , Str \"elected\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"EU\"\n    , Space\n    , Str \"citizens.\"\n    ]\n]\n```\n\n```\n% pandoc -f jats -t native\n<sec>\n\t<title suppress=\"yes\">The European Parliament</title>\n\t<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>\n</sec>\n^D\n[ Para\n    [ Str \"Members\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"European\"\n    , Space\n    , Str \"Parliament\"\n    , Space\n    , Str \"(MEPs)\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"directly\"\n    , Space\n    , Str \"elected\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"EU\"\n    , Space\n    , Str \"citizens.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/bits-toc-elements.md",
    "content": "```\n% pandoc -f jats -t native\n<toc-group>\n\t<toc-title-group>\n\t\t<title>TOC group</title>\n\t</toc-title-group>\n\t<p>Content of toc group</p>\n\t<toc>\n\t\t<toc-title-group>\n\t\t\t<title>TOC</title>\n\t\t</toc-title-group>\n\t\t<p>Content of TOC</p>\n  \t\t<toc-div content-type=\"sections\">\n   \t\t\t<toc-title-group>\n                <title>Mental Health Services</title>\n            </toc-title-group>\n            <toc-entry>\n                <label>Section 1</label>\n                <title>Introduction</title>\n                <nav-pointer rid=\"tc3\"/>\n            </toc-entry>\n            <toc-entry>\n                <label>Section 2</label>\n                <title>Mental Health of the Population</title>\n                <nav-pointer rid=\"tc4\"/>\n            </toc-entry>\n  \t\t</toc-div>\n\t</toc>\n</toc-group>\n^D\n[ Header\n    1 ( \"\" , [] , [] ) [ Str \"TOC\" , Space , Str \"group\" ]\n, Para\n    [ Str \"Content\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"toc\"\n    , Space\n    , Str \"group\"\n    ]\n, Header 2 ( \"\" , [] , [] ) [ Str \"TOC\" ]\n, Para\n    [ Str \"Content\" , Space , Str \"of\" , Space , Str \"TOC\" ]\n, Header\n    3\n    ( \"\" , [] , [] )\n    [ Str \"Mental\"\n    , Space\n    , Str \"Health\"\n    , Space\n    , Str \"Services\"\n    ]\n, Header 4 ( \"\" , [] , [] ) [ Str \"Introduction\" ]\n, Header\n    4\n    ( \"\" , [] , [] )\n    [ Str \"Mental\"\n    , Space\n    , Str \"Health\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"Population\"\n    ]\n]\n```"
  },
  {
    "path": "test/command/chap1/text.md",
    "content": "# Chapter one\n\nA spider: ![spider](spider.png)\n\nAnother spider: ![another spider][refspider]\n\nThe moon: ![moon](../../lalune.jpg)\n\nLink to [spider picture](spider.png).\n\nURL left alone: [manual](https://pandoc.org/MANUAL.html).\n\nAbsolute path left alone: [absolute](/foo/bar/baz.png).\n\nLink to fragment: [chapter two](#chapter-two).\n\nEmpty path: [empty]().\n"
  },
  {
    "path": "test/command/chap2/text.md",
    "content": "# Chapter two\n\nA spider: ![spider](spider.png)\n\n[refspider]: spider.png\n"
  },
  {
    "path": "test/command/chicago-annotated-bibliography.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"never\" page-range-format=\"chicago\">\n  <info>\n    <title>Chicago Manual of Style 16th edition (note, annotated bibliography)</title>\n    <id>http://www.zotero.org/styles/chicago-annotated-bibliography</id>\n    <link href=\"http://www.zotero.org/styles/chicago-annotated-bibliography\" rel=\"self\"/>\n    <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Simon Kornblith</name>\n      <email>simon@simonster.com</email>\n    </contributor>\n    <contributor>\n      <name>Elena Razlogova</name>\n      <email>elena.razlogova@gmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Frank Bennett</name>\n      <email>biercenator@gmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Andrew Dunning</name>\n      <email>andrew.dunning@utoronto.ca</email>\n    </contributor>\n    <category citation-format=\"note\"/>\n    <category field=\"generic-base\"/>\n    <summary>Chicago format with short notes and annotated bibliography</summary>\n    <updated>2012-10-25T21:15:26+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"editor\" form=\"verb-short\">ed.</term>\n      <term name=\"translator\" form=\"verb-short\">trans.</term>\n      <term name=\"editortranslator\" form=\"verb-short\">\n        <single>ed. and trans.</single>\n        <multiple>ed. and trans.</multiple>\n      </term>\n      <term name=\"editortranslator\" form=\"verb\">\n        <single>Edited and translated by</single>\n        <multiple>Edited and translated by</multiple>\n      </term>\n      <term name=\"translator\" form=\"short\">trans.</term>\n    </terms>\n  </locale>\n  <macro name=\"editor-translator\">\n    <group delimiter=\", \">\n      <group delimiter=\" \">\n        <choose>\n          <if variable=\"container-author reviewed-author\" match=\"any\">\n            <group>\n              <names variable=\"container-author reviewed-author\">\n                <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                <name and=\"text\" delimiter=\", \"/>\n              </names>\n            </group>\n          </if>\n        </choose>\n      </group>\n      <names variable=\"editor translator\" delimiter=\", \">\n        <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n        <name and=\"text\" delimiter=\", \"/>\n      </names>\n    </group>\n  </macro>\n  <macro name=\"secondary-contributors-note\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"none\">\n        <text macro=\"editor-translator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors-note\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text macro=\"editor-translator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"secondary-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"none\">\n        <names variable=\"editor translator\" delimiter=\". \">\n          <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n          <name and=\"text\" delimiter=\", \"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if variable=\"author\">\n              <choose>\n                <if variable=\"container-author\" match=\"any\">\n                  <names variable=\"container-author\">\n                    <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </if>\n              </choose>\n              <!--This includes page numbers after the container author, e.g. for Introductions -->\n              <choose>\n                <if variable=\"container-author author\" match=\"all\">\n                  <group delimiter=\". \">\n                    <text variable=\"page\"/>\n                    <names variable=\"editor translator\" delimiter=\", \">\n                      <label form=\"verb\" suffix=\" \"/>\n                      <name and=\"text\" delimiter=\", \"/>\n                    </names>\n                  </group>\n                </if>\n                <else>\n                  <names variable=\"editor translator\" delimiter=\", \">\n                    <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </else>\n              </choose>\n            </if>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"recipient-note\">\n    <names variable=\"recipient\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-note\">\n    <group delimiter=\" \">\n      <names variable=\"author\">\n        <name and=\"text\" sort-separator=\", \" delimiter=\", \"/>\n        <label form=\"short\" prefix=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"verb-short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"personal_communication\">\n          <choose>\n            <if variable=\"genre\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n            <else>\n              <text term=\"letter\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors\">\n    <group delimiter=\". \">\n      <names variable=\"author\">\n        <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <substitute>\n          <text macro=\"editor\"/>\n          <text macro=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient\"/>\n    </group>\n  </macro>\n  <macro name=\"recipient-short\">\n    <names variable=\"recipient\">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name form=\"short\" and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-short\">\n    <group delimiter=\" \">\n      <names variable=\"author\">\n        <name form=\"short\" and=\"text\" delimiter=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient-short\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors-sort\">\n    <names variable=\"author\">\n      <name name-as-sort-order=\"all\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"interviewer-note\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"interviewer\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"title-note\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <text variable=\"genre\"/>\n      </if>\n      <else-if type=\"bill book graphic  legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <group delimiter=\" \" prefix=\", \">\n          <text term=\"version\"/>\n          <text variable=\"version\"/>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case interview\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else-if variable=\"reviewed-author\">\n        <text variable=\"title\" font-style=\"italic\" prefix=\"review of \"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"personal_communication\" match=\"none\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <group prefix=\" (\" suffix=\")\" delimiter=\" \">\n          <text term=\"version\"/>\n          <text variable=\"version\"/>\n        </group>\n      </else-if>\n      <else-if variable=\"reviewed-author\">\n        <group delimiter=\", \">\n          <text variable=\"title\" font-style=\"italic\" prefix=\"Review of \"/>\n          <names variable=\"reviewed-author\">\n            <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case interview\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-short\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"interview\">\n            <text term=\"interview\"/>\n          </if>\n          <else-if type=\"manuscript speech\" match=\"any\">\n            <text variable=\"genre\" form=\"short\"/>\n          </else-if>\n          <else-if type=\"personal_communication\">\n            <text macro=\"issued\"/>\n          </else-if>\n        </choose>\n      </if>\n      <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" form=\"short\" font-style=\"italic\"/>\n      </else-if>\n      <else-if type=\"legal_case interview\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" form=\"short\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-disambiguate\">\n    <choose>\n      <if disambiguate=\"true\">\n        <text macro=\"issued\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"description-note\">\n    <group delimiter=\", \">\n      <text macro=\"interviewer-note\"/>\n      <text variable=\"medium\"/>\n      <choose>\n        <if variable=\"title\" match=\"none\"/>\n        <else-if type=\"manuscript thesis speech\" match=\"any\"/>\n        <else>\n          <text variable=\"genre\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"description\">\n    <group delimiter=\", \">\n      <group delimiter=\". \">\n        <text macro=\"interviewer\"/>\n        <text variable=\"medium\" text-case=\"capitalize-first\"/>\n      </group>\n      <choose>\n        <if variable=\"title\" match=\"none\"/>\n        <else-if type=\"thesis speech\" match=\"any\"/>\n        <else>\n          <text variable=\"genre\" text-case=\"capitalize-first\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"container-title-note\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"chapter paper-conference\" match=\"any\">\n          <text term=\"in\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"container-title\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"chapter paper-conference\" match=\"any\">\n          <text term=\"in\" text-case=\"capitalize-first\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"collection-title\">\n    <choose>\n      <if match=\"none\" type=\"article-journal\">\n        <choose>\n          <if match=\"none\" is-numeric=\"collection-number\">\n            <group delimiter=\", \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </if>\n          <else>\n            <group delimiter=\" \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"collection-title-journal\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\" \">\n          <text variable=\"collection-title\"/>\n          <text variable=\"collection-number\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition-note\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note-join-with-space\">\n    <choose>\n      <if type=\"article-journal\" variable=\"volume\" match=\"all\">\n        <choose>\n          <if match=\"none\" variable=\"collection-title\">\n            <text macro=\"locators-note\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\" match=\"none\">\n        <text macro=\"locators-note\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\" match=\"none\">\n            <text macro=\"locators-note\"/>\n          </if>\n          <else-if match=\"any\" variable=\"collection-title\">\n            <text macro=\"locators-note\"/>\n          </else-if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\", \">\n          <text macro=\"collection-title-journal\"/>\n          <number variable=\"volume\"/>\n          <group delimiter=\" \">\n            <text term=\"issue\" form=\"short\"/>\n            <number variable=\"issue\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"legal_case\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <number variable=\"volume\"/>\n            <text variable=\"container-title\"/>\n            <text variable=\"page\"/>\n          </group>\n          <text variable=\"locator\"/>\n        </group>\n      </else-if>\n      <else-if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <group delimiter=\", \">\n          <text macro=\"edition-note\"/>\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"none\">\n              <group delimiter=\" \">\n                <number variable=\"number-of-volumes\" form=\"numeric\"/>\n                <text term=\"volume\" form=\"short\" plural=\"true\"/>\n              </group>\n            </if>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-space\">\n    <choose>\n      <if type=\"article-journal\" variable=\"volume\" match=\"all\">\n        <choose>\n          <if match=\"none\" variable=\"collection-title\">\n            <text macro=\"locators\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-comma\">\n    <choose>\n      <if type=\"legal_case chapter paper-conference\" match=\"any\">\n        <text macro=\"locators\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\" match=\"none\">\n            <text macro=\"locators\"/>\n          </if>\n          <else-if match=\"any\" variable=\"collection-title\">\n            <text macro=\"locators\"/>\n          </else-if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-period\">\n    <choose>\n      <if type=\"legal_case article-journal chapter paper-conference\" match=\"none\">\n        <text macro=\"locators\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\", \">\n          <text macro=\"collection-title-journal\"/>\n          <number variable=\"volume\"/>\n          <group delimiter=\" \">\n            <text term=\"issue\" form=\"short\"/>\n            <number variable=\"issue\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"legal_case\">\n        <group delimiter=\" \">\n          <number variable=\"volume\"/>\n          <text variable=\"container-title\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <group delimiter=\". \">\n          <text macro=\"edition\"/>\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <group delimiter=\" \">\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" plural=\"true\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"chapter paper-conference\" match=\"any\">\n        <group delimiter=\". \">\n          <text macro=\"edition\"/>\n          <choose>\n            <if variable=\"page\" match=\"none\">\n              <group delimiter=\" \">\n                <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n                <number variable=\"volume\" form=\"numeric\"/>\n              </group>\n            </if>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-newspaper\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <number variable=\"edition\"/>\n            <text term=\"edition\"/>\n          </group>\n          <group delimiter=\" \">\n            <text term=\"section\" form=\"short\"/>\n            <text variable=\"section\"/>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"event-note\">\n    <text variable=\"event\"/>\n  </macro>\n  <macro name=\"event\">\n    <choose>\n      <if variable=\"title\">\n        <group delimiter=\" \">\n          <text term=\"presented at\"/>\n          <text variable=\"event\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\" \">\n          <text term=\"presented at\" text-case=\"capitalize-first\"/>\n          <text variable=\"event\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"originally-published\">\n    <group delimiter=\", \">\n      <group delimiter=\": \">\n        <text variable=\"original-publisher-place\"/>\n        <text variable=\"original-publisher\"/>\n      </group>\n      <date variable=\"original-date\" form=\"text\" date-parts=\"year\"/>\n    </group>\n  </macro>\n  <macro name=\"reprint-note\">\n    <!--needs localization-->\n    <choose>\n      <if variable=\"original-date issued\" match=\"all\">\n        <choose>\n          <!--for whatever reason in notes, when we have both original and new publishers, reprint doesn't appear-->\n          <if variable=\"original-publisher original-publisher-place\" match=\"none\">\n            <text value=\"repr.\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"reprint\">\n    <!--needs localization-->\n    <choose>\n      <if variable=\"original-date issued\" match=\"all\">\n        <text value=\"reprint\" text-case=\"capitalize-first\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"thesis\">\n        <text variable=\"publisher\"/>\n      </if>\n      <else-if type=\"speech\">\n        <text variable=\"event-place\"/>\n      </else-if>\n      <else>\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issued\">\n    <choose>\n      <if variable=\"issued\">\n        <choose>\n          <if type=\"graphic report\" match=\"any\">\n            <date variable=\"issued\" form=\"text\"/>\n          </if>\n          <else-if type=\"legal_case\">\n            <group delimiter=\" \">\n              <text variable=\"authority\"/>\n              <date variable=\"issued\">\n                <date-part name=\"year\"/>\n              </date>\n            </group>\n          </else-if>\n          <else-if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song thesis\" match=\"any\">\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n          </else-if>\n          <else>\n            <date variable=\"issued\" form=\"text\"/>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"status\">\n        <text variable=\"status\"/>\n      </else-if>\n      <else-if variable=\"accessed URL\" match=\"all\"/>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-subsequent\">\n    <choose>\n      <if type=\"legal_case\"/>\n      <else-if variable=\"locator\">\n        <choose>\n          <if locator=\"page\" match=\"none\">\n            <group delimiter=\" \">\n              <choose>\n                <if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n                  <choose>\n                    <if variable=\"volume\">\n                      <group delimiter=\", \">\n                        <group delimiter=\" \">\n                          <text term=\"volume\" form=\"short\"/>\n                          <number variable=\"volume\" form=\"numeric\"/>\n                        </group>\n                        <label variable=\"locator\" form=\"short\"/>\n                      </group>\n                    </if>\n                    <else>\n                      <label variable=\"locator\" form=\"short\"/>\n                    </else>\n                  </choose>\n                </if>\n                <else>\n                  <label variable=\"locator\" form=\"short\"/>\n                </else>\n              </choose>\n              <text variable=\"locator\"/>\n            </group>\n          </if>\n          <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n            <group delimiter=\":\">\n              <number variable=\"volume\" form=\"numeric\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </else-if>\n          <else>\n            <text variable=\"locator\"/>\n          </else>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-join-with-colon\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"locator page\" match=\"any\">\n            <choose>\n              <if variable=\"volume issue\" match=\"any\">\n                <text macro=\"point-locators\"/>\n              </if>\n            </choose>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\" match=\"none\">\n        <text macro=\"point-locators\"/>\n      </if>\n      <else-if variable=\"volume issue\" match=\"none\">\n        <text macro=\"point-locators\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators\">\n    <choose>\n      <if variable=\"locator\" match=\"none\">\n        <choose>\n          <if type=\"article-journal chapter paper-conference\" match=\"any\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"article-journal\">\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\" match=\"none\">\n              <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case\"/>\n      <else>\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\" match=\"none\">\n              <label variable=\"locator\" form=\"short\"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locators-chapter\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"author container-author\" match=\"all\"/>\n          <else>\n            <choose>\n              <if variable=\"page\">\n                <number variable=\"volume\" suffix=\":\"/>\n                <text variable=\"page\"/>\n              </if>\n            </choose>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-journal-join-with-colon\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"any\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-journal-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"none\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"archive-note\">\n    <choose>\n      <if type=\"thesis\">\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\" prefix=\"(\" suffix=\")\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\", \">\n          <text variable=\"archive_location\"/>\n          <text variable=\"archive\"/>\n          <text variable=\"archive-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"archive\">\n    <choose>\n      <if type=\"thesis\">\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\" prefix=\"(\" suffix=\")\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\". \">\n          <text variable=\"archive_location\" text-case=\"capitalize-first\"/>\n          <text variable=\"archive\"/>\n          <text variable=\"archive-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue-note-join-with-space\">\n    <choose>\n      <if type=\"article-journal legal_case manuscript thesis\" variable=\"publisher-place publisher\" match=\"any\">\n        <!--Chicago doesn't use publisher/place for Newspapers and we want the date delimited by a comma-->\n        <choose>\n          <if type=\"article-newspaper\" match=\"none\">\n            <choose>\n              <if type=\"article-journal\" match=\"none\">\n                <text macro=\"issue-note\"/>\n              </if>\n              <else-if variable=\"issue volume\" match=\"any\">\n                <text macro=\"issue-note\"/>\n              </else-if>\n            </choose>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note-join-with-comma\">\n    <choose>\n      <if type=\"article-journal legal_case manuscript thesis\" variable=\"publisher-place publisher\" match=\"none\">\n        <text macro=\"issue-note\"/>\n      </if>\n      <else-if type=\"article-newspaper\">\n        <text macro=\"issue-note\"/>\n      </else-if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"none\">\n            <text macro=\"issue-note\"/>\n          </if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note\">\n    <choose>\n      <if type=\"legal_case\" match=\"any\">\n        <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"any\">\n            <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n          </if>\n          <else>\n            <text macro=\"issued\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if type=\"article-newspaper\">\n        <text macro=\"issued\"/>\n      </else-if>\n      <else-if variable=\"publisher-place event-place publisher genre\" match=\"any\">\n        <group prefix=\"(\" suffix=\")\" delimiter=\", \">\n          <choose>\n            <if variable=\"title\" match=\"none\"/>\n            <else-if type=\"manuscript thesis speech\" match=\"any\">\n              <text variable=\"genre\"/>\n            </else-if>\n          </choose>\n          <text macro=\"event-note\"/>\n          <group delimiter=\"; \">\n            <text macro=\"originally-published\"/>\n            <group delimiter=\", \">\n              <text macro=\"reprint-note\"/>\n              <text macro=\"publisher\"/>\n            </group>\n          </group>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else>\n        <text macro=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-space\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"any\">\n        <choose>\n          <if variable=\"issue volume\" match=\"any\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-period\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"none\">\n        <choose>\n          <if type=\"speech\" variable=\"publisher publisher-place\" match=\"any\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-comma\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"none\">\n        <choose>\n          <if type=\"speech\" variable=\"publisher publisher-place\" match=\"none\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if variable=\"volume issue\" match=\"none\">\n        <text macro=\"issue\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if type=\"legal_case\" match=\"any\">\n        <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"issue volume\" match=\"any\">\n            <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n          </if>\n          <else>\n            <text macro=\"issued\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if type=\"speech\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"title\" match=\"none\"/>\n              <else>\n                <text variable=\"genre\" text-case=\"capitalize-first\"/>\n              </else>\n            </choose>\n            <text macro=\"event\"/>\n          </group>\n          <text variable=\"event-place\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <!--Chicago doesn't use publisher/place for Newspapers -->\n      <else-if type=\"article-newspaper\">\n        <text macro=\"issued\"/>\n      </else-if>\n      <else-if variable=\"publisher-place publisher\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if type=\"thesis\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n          </choose>\n          <group delimiter=\". \">\n            <text macro=\"originally-published\"/>\n            <group delimiter=\", \">\n              <text macro=\"reprint\"/>\n              <text macro=\"publisher\"/>\n            </group>\n          </group>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else>\n        <text macro=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"access-note\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive-note\"/>\n        </if>\n        <else-if type=\"article-journal bill book chapter legal_case legislation motion_picture paper-conference\" match=\"none\">\n          <text macro=\"archive-note\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\"/>\n            <date variable=\"accessed\" form=\"text\"/>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"doi:\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive\"/>\n        </if>\n        <else-if type=\"article-journal bill book chapter legal_case legislation motion_picture paper-conference\" match=\"none\">\n          <text macro=\"archive\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date variable=\"accessed\" form=\"text\"/>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"doi:\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"case-locator-subsequent\">\n    <choose>\n      <if type=\"legal_case\">\n        <text macro=\"locators-note\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"case-issue-subsequent\">\n    <choose>\n      <if type=\"legal_case\">\n        <text macro=\"issue\"/>\n      </if>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-names=\"true\">\n    <layout suffix=\".\" delimiter=\"; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\", \">\n            <text term=\"ibid\"/>\n            <text macro=\"point-locators-subsequent\"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\"/>\n        </else-if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"contributors-short\"/>\n            <group delimiter=\" \">\n              <group delimiter=\", \">\n                <text macro=\"title-short\"/>\n                <!--if title & author are the same: -->\n                <text macro=\"date-disambiguate\"/>\n                <text macro=\"case-locator-subsequent\"/>\n              </group>\n              <text macro=\"case-issue-subsequent\"/>\n            </group>\n            <text macro=\"point-locators-subsequent\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"11\" et-al-use-first=\"7\" subsequent-author-substitute=\"&#8212;&#8212;&#8212;\" entry-spacing=\"0\">\n    <sort>\n      <key macro=\"contributors-sort\"/>\n      <key variable=\"title\"/>\n      <key variable=\"genre\"/>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\". \">\n        <group delimiter=\": \">\n          <group delimiter=\", \">\n            <group delimiter=\" \">\n              <group delimiter=\". \">\n                <group delimiter=\" \">\n                  <group delimiter=\", \">\n                    <group delimiter=\". \">\n                      <group delimiter=\". \">\n                        <text macro=\"contributors\"/>\n                        <text macro=\"title\"/>\n                      </group>\n                      <text macro=\"description\"/>\n                      <text macro=\"secondary-contributors\"/>\n                      <group delimiter=\", \">\n                        <text macro=\"container-title\"/>\n                        <text macro=\"container-contributors\"/>\n                      </group>\n                      <text macro=\"locators-join-with-period\"/>\n                    </group>\n                    <text macro=\"locators-join-with-comma\"/>\n                    <text macro=\"locators-chapter\"/>\n                  </group>\n                  <text macro=\"locators-join-with-space\"/>\n                </group>\n                <text macro=\"collection-title\"/>\n                <text macro=\"issue-join-with-period\"/>\n              </group>\n              <text macro=\"issue-join-with-space\"/>\n            </group>\n            <text macro=\"issue-join-with-comma\"/>\n            <text macro=\"locators-journal-join-with-comma\"/>\n            <text macro=\"locators-newspaper\"/>\n          </group>\n          <text macro=\"locators-journal-join-with-colon\"/>\n        </group>\n        <text macro=\"access\"/>\n      </group>\n      <text variable=\"note\" display=\"block\"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/chicago-author-date-with-original-date-and-status.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"never\" page-range-format=\"chicago\">\n  <info>\n    <title>Chicago Manual of Style 16th edition (author-date)</title>\n    <id>http://www.zotero.org/styles/chicago-author-date</id>\n    <link href=\"http://www.zotero.org/styles/chicago-author-date\" rel=\"self\"/>\n    <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <contributor>\n      <name>Richard Karnesky</name>\n      <email>karnesky+zotero@gmail.com</email>\n      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>\n    </contributor>\n    <contributor>\n      <name>Andrew Dunning</name>\n      <email>andrew.dunning@utoronto.ca</email>\n    </contributor>\n    <category citation-format=\"author-date\"/>\n    <category field=\"generic-base\"/>\n    <summary>The author-date variant of the Chicago style</summary>\n    <updated>2014-05-23T03:53:32+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"editor\" form=\"verb-short\">ed.</term>\n      <term name=\"container-author\" form=\"verb\">by</term>\n      <term name=\"translator\" form=\"verb-short\">trans.</term>\n      <term name=\"editortranslator\" form=\"verb\">\n        <single>edited and translated by</single>\n        <multiple>edited and translated by</multiple>\n      </term>\n      <term name=\"translator\" form=\"short\">trans.</term>\n    </terms>\n  </locale>\n  <macro name=\"secondary-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"none\">\n        <names variable=\"editor translator\" delimiter=\". \">\n          <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n          <name and=\"text\" delimiter=\", \"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <group prefix=\", \" delimiter=\", \">\n          <names variable=\"container-author\" delimiter=\", \">\n            <label form=\"verb\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n          <names variable=\"editor translator\" delimiter=\", \">\n            <label form=\"verb\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <choose>\n      <if type=\"personal_communication\">\n        <choose>\n          <if variable=\"genre\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n          <else>\n            <text term=\"letter\" text-case=\"capitalize-first\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n    <names variable=\"recipient\" delimiter=\", \">\n      <label form=\"verb\" prefix=\" \" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors\">\n    <group delimiter=\". \">\n      <names variable=\"author\">\n        <name and=\"text\" name-as-sort-order=\"first\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <label form=\"short\" prefix=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n          <text macro=\"title\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"text\" delimiter=\", \" initialize-with=\". \"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"interviewer\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" prefix=\" \" text-case=\"capitalize-first\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"archive\">\n    <group delimiter=\". \">\n      <text variable=\"archive_location\" text-case=\"capitalize-first\"/>\n      <text variable=\"archive\"/>\n      <text variable=\"archive-place\"/>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive\"/>\n        </if>\n        <else-if type=\"article-journal bill book chapter legal_case legislation motion_picture paper-conference\" match=\"none\">\n          <text macro=\"archive\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date variable=\"accessed\" delimiter=\" \">\n              <date-part name=\"month\"/>\n              <date-part name=\"day\"/>\n            </date>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"doi:\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"personal_communication\" match=\"none\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <group prefix=\" (\" suffix=\")\" delimiter=\" \">\n          <text term=\"version\"/>\n          <text variable=\"version\"/>\n        </group>\n      </else-if>\n      <else-if variable=\"reviewed-author\">\n        <group delimiter=\", \">\n          <text variable=\"title\" font-style=\"italic\" prefix=\"Review of \"/>\n          <names variable=\"reviewed-author\">\n            <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case interview\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \" prefix=\". \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\" strip-periods=\"true\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" prefix=\". \"/>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"chapter  paper-conference\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \" prefix=\", \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" prefix=\", \"/>\n          </else>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\">\n            <text variable=\"volume\" prefix=\" \"/>\n            <group prefix=\" (\" suffix=\")\">\n              <choose>\n                <if variable=\"issue\">\n                  <text variable=\"issue\"/>\n                </if>\n                <else>\n                  <date variable=\"issued\">\n                    <date-part name=\"month\"/>\n                  </date>\n                </else>\n              </choose>\n            </group>\n          </if>\n          <else-if variable=\"issue\">\n            <group delimiter=\" \" prefix=\", \">\n              <text term=\"issue\" form=\"short\"/>\n              <text variable=\"issue\"/>\n              <date variable=\"issued\" prefix=\"(\" suffix=\")\">\n                <date-part name=\"month\"/>\n              </date>\n            </group>\n          </else-if>\n          <else>\n            <date variable=\"issued\" prefix=\", \">\n              <date-part name=\"month\"/>\n            </date>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"legal_case\">\n        <text variable=\"volume\" prefix=\", \"/>\n        <text variable=\"container-title\" prefix=\" \"/>\n        <text variable=\"page\" prefix=\" \"/>\n      </else-if>\n      <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <group prefix=\". \" delimiter=\". \">\n          <group>\n            <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <group>\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" prefix=\" \" plural=\"true\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"chapter paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"page\" match=\"none\">\n            <group prefix=\". \">\n              <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/>\n              <number variable=\"volume\" form=\"numeric\"/>\n            </group>\n          </if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-chapter\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"page\">\n            <group prefix=\", \">\n              <text variable=\"volume\" suffix=\":\"/>\n              <text variable=\"page\"/>\n            </group>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-article\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <group prefix=\", \" delimiter=\", \">\n          <group>\n            <text variable=\"edition\" suffix=\" \"/>\n            <text term=\"edition\" prefix=\" \"/>\n          </group>\n          <group>\n            <text term=\"section\" form=\"short\" suffix=\" \"/>\n            <text variable=\"section\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"any\">\n            <text variable=\"page\" prefix=\": \"/>\n          </if>\n          <else>\n            <text variable=\"page\" prefix=\", \"/>\n          </else>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators\">\n    <choose>\n      <if variable=\"locator\">\n        <choose>\n          <if locator=\"page\" match=\"none\">\n            <choose>\n              <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n                <choose>\n                  <if variable=\"volume\">\n                    <group>\n                      <text term=\"volume\" form=\"short\" suffix=\" \"/>\n                      <number variable=\"volume\" form=\"numeric\"/>\n                      <label variable=\"locator\" form=\"short\" prefix=\", \" suffix=\" \"/>\n                    </group>\n                  </if>\n                  <else>\n                    <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n                  </else>\n                </choose>\n              </if>\n              <else>\n                <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n              </else>\n            </choose>\n          </if>\n          <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n            <number variable=\"volume\" form=\"numeric\" suffix=\":\"/>\n          </else-if>\n        </choose>\n        <text variable=\"locator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-prefix\">\n    <text term=\"in\" text-case=\"capitalize-first\"/>\n  </macro>\n  <macro name=\"container-title\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text macro=\"container-prefix\" suffix=\" \"/>\n      </if>\n    </choose>\n    <choose>\n      <if type=\"legal_case\" match=\"none\">\n        <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\": \">\n      <text variable=\"publisher-place\"/>\n      <text variable=\"publisher\"/>\n    </group>\n  </macro>\n  <macro name=\"date-citation\">\n    <choose>\n      <if variable=\"original-date\">\n        <date variable=\"original-date\" prefix=\"[\"  suffix=\"]\">\n        <date-part name=\"year\"/>\n      </date>\n      </if>\n    </choose>\n  <choose>\n    <if variable=\"issued\">\n      <date variable=\"issued\" prefix=\" \">\n        <date-part name=\"year\"/>\n      </date>\n    </if>\n    <else-if variable=\"status\">\n      <text variable=\"status\" prefix=\", \"/>\n    </else-if>\n    <else-if variable=\"accessed\">\n      <date variable=\"accessed\" prefix=\" \">\n        <date-part name=\"year\"/>\n      </date>\n    </else-if>\n    </choose>\n  </macro>\n  <macro name=\"date-bibliography\">\n      <choose>\n        <if variable=\"original-date\">\n          <date variable=\"original-date\" prefix=\" (\"  suffix=\") \">\n          <date-part name=\"year\"/>\n        </date>\n        </if>\n      </choose>\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else-if variable=\"status\">\n        <text variable=\"status\" text-case=\"capitalize-first\"/>\n      </else-if>\n      <else-if variable=\"accessed\">\n        <date variable=\"accessed\">\n          <date-part name=\"year\"/>\n        </date>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"day-month\">\n    <date variable=\"issued\">\n      <date-part name=\"month\"/>\n      <date-part name=\"day\" prefix=\" \"/>\n    </date>\n  </macro>\n  <macro name=\"collection-title\">\n    <choose>\n      <if match=\"none\" type=\"article-journal\">\n        <choose>\n          <if match=\"none\" is-numeric=\"collection-number\">\n            <group delimiter=\", \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </if>\n          <else>\n            <group delimiter=\" \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"collection-title-journal\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\" \">\n          <text variable=\"collection-title\"/>\n          <text variable=\"collection-number\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"event\">\n    <group>\n      <text term=\"presented at\" suffix=\" \"/>\n      <text variable=\"event\"/>\n    </group>\n  </macro>\n  <macro name=\"description\">\n    <choose>\n      <if type=\"interview\">\n        <group delimiter=\". \">\n          <text macro=\"interviewer\"/>\n          <text variable=\"medium\" text-case=\"capitalize-first\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"medium\" text-case=\"capitalize-first\" prefix=\". \"/>\n      </else>\n    </choose>\n    <choose>\n      <if variable=\"title\" match=\"none\"/>\n      <else-if type=\"thesis personal_communication speech\" match=\"any\"/>\n      <else>\n        <group delimiter=\" \" prefix=\". \">\n          <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          <choose>\n            <if type=\"report\">\n              <text variable=\"number\"/>\n            </if>\n          </choose>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if type=\"legal_case\">\n        <text variable=\"authority\" prefix=\". \"/>\n      </if>\n      <else-if type=\"speech\">\n        <group prefix=\". \" delimiter=\", \">\n          <group delimiter=\" \">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            <text macro=\"event\"/>\n          </group>\n          <text variable=\"event-place\"/>\n          <text macro=\"day-month\"/>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine personal_communication\" match=\"any\">\n        <text macro=\"day-month\" prefix=\", \"/>\n      </else-if>\n      <else>\n        <group prefix=\". \" delimiter=\", \">\n          <choose>\n            <if type=\"thesis\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n          </choose>\n          <text macro=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\" givenname-disambiguation-rule=\"primary-name\">\n    <layout prefix=\"(\" suffix=\")\" delimiter=\"; \">\n      <group delimiter=\", \">\n        <group delimiter=\" \">\n          <text macro=\"contributors-short\"/>\n          <text macro=\"date-citation\"/>\n        </group>\n        <text macro=\"point-locators\"/>\n      </group>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"11\" et-al-use-first=\"7\" subsequent-author-substitute=\"&#8212;&#8212;&#8212;\" entry-spacing=\"0\">\n    <sort>\n      <key macro=\"contributors\"/>\n      <key variable=\"original-date\"/>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\". \">\n        <text macro=\"contributors\"/>\n        <text macro=\"date-bibliography\" text-case=\"capitalize-first\"/> \n        <text macro=\"title\"/>\n      </group>\n      <text macro=\"description\"/>\n      <text macro=\"secondary-contributors\" prefix=\". \"/>\n      <text macro=\"container-title\" prefix=\". \"/>\n      <text macro=\"container-contributors\"/>\n      <text macro=\"edition\"/>\n      <text macro=\"locators-chapter\"/>\n      <text macro=\"collection-title-journal\" prefix=\", \" suffix=\", \"/>\n      <text macro=\"locators\"/>\n      <text macro=\"collection-title\" prefix=\". \"/>\n      <text macro=\"issue\"/>\n      <text macro=\"locators-article\"/>\n      <text macro=\"access\" prefix=\". \"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/chicago-fullnote-bibliography.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"display-and-sort\" page-range-format=\"chicago\">\n  <info>\n    <title>Chicago Manual of Style 17th edition (full note)</title>\n    <id>http://www.zotero.org/styles/chicago-fullnote-bibliography</id>\n    <link href=\"http://www.zotero.org/styles/chicago-fullnote-bibliography\" rel=\"self\"/>\n    <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Simon Kornblith</name>\n      <email>simon@simonster.com</email>\n    </contributor>\n    <contributor>\n      <name>Elena Razlogova</name>\n      <email>elena.razlogova@gmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Frank Bennett</name>\n      <email>biercenator@gmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Andrew Dunning</name>\n      <email>andrew.dunning@utoronto.ca</email>\n    </contributor>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <category citation-format=\"note\"/>\n    <category field=\"generic-base\"/>\n    <summary>Chicago format with full notes and bibliography</summary>\n    <updated>2017-10-12T12:00:00+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"editor\" form=\"verb-short\">ed.</term>\n      <term name=\"translator\" form=\"verb-short\">trans.</term>\n      <term name=\"translator\" form=\"short\">trans.</term>\n      <term name=\"editortranslator\" form=\"verb-short\">ed. and trans.</term>\n      <term name=\"editortranslator\" form=\"verb\">Edited and translated by</term>\n      <term name=\"translator\" form=\"short\">trans.</term>\n    </terms>\n  </locale>\n  <macro name=\"editor-translator\">\n    <group delimiter=\", \">\n      <group delimiter=\" \">\n        <choose>\n          <if variable=\"container-author reviewed-author\" match=\"any\">\n            <group>\n              <names variable=\"container-author reviewed-author\">\n                <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                <name and=\"text\" delimiter=\", \"/>\n              </names>\n            </group>\n          </if>\n        </choose>\n      </group>\n      <names variable=\"editor translator\" delimiter=\", \">\n        <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n        <name and=\"text\" delimiter=\", \"/>\n      </names>\n    </group>\n  </macro>\n  <macro name=\"secondary-contributors-note\">\n    <choose>\n      <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"none\">\n        <text macro=\"editor-translator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors-note\">\n    <choose>\n      <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"any\">\n        <text macro=\"editor-translator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"secondary-contributors\">\n    <choose>\n      <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"none\">\n        <names variable=\"editor translator\" delimiter=\". \">\n          <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n          <name and=\"text\" delimiter=\", \"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors\">\n    <choose>\n      <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if variable=\"author\">\n              <choose>\n                <if variable=\"container-author\" match=\"any\">\n                  <names variable=\"container-author\">\n                    <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </if>\n              </choose>\n              <!--This includes page numbers after the container author, e.g. for Introductions -->\n              <choose>\n                <if variable=\"container-author author\" match=\"all\">\n                  <group delimiter=\". \">\n                    <text variable=\"page\"/>\n                    <names variable=\"editor translator\" delimiter=\", \">\n                      <label form=\"verb\" suffix=\" \"/>\n                      <name and=\"text\" delimiter=\", \"/>\n                    </names>\n                  </group>\n                </if>\n                <else>\n                  <names variable=\"editor translator\" delimiter=\", \">\n                    <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </else>\n              </choose>\n            </if>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"recipient-note\">\n    <names variable=\"recipient\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-note\">\n    <group delimiter=\" \">\n      <names variable=\"author\">\n        <name and=\"text\" sort-separator=\", \" delimiter=\", \"/>\n        <label form=\"short\" prefix=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"verb-short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"personal_communication\">\n          <choose>\n            <if variable=\"genre\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n            <else>\n              <text term=\"letter\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors\">\n    <group delimiter=\". \">\n      <names variable=\"author\">\n        <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <substitute>\n          <text macro=\"editor\"/>\n          <text macro=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient\"/>\n    </group>\n  </macro>\n  <macro name=\"recipient-short\">\n    <names variable=\"recipient\">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name form=\"short\" and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-short\">\n    <group delimiter=\" \">\n      <names variable=\"author\">\n        <name form=\"short\" and=\"text\" delimiter=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient-short\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors-sort\">\n    <names variable=\"author\">\n      <name name-as-sort-order=\"all\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"interviewer-note\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"interviewer\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"title-note\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <text variable=\"genre\"/>\n      </if>\n      <else-if type=\"book graphic map motion_picture song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <group delimiter=\" \" prefix=\", \">\n          <text term=\"version\"/>\n          <text variable=\"version\"/>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case interview patent\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else-if variable=\"reviewed-author\">\n        <text variable=\"title\" font-style=\"italic\" prefix=\"review of \"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"personal_communication\" match=\"none\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"book graphic motion_picture song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <group prefix=\" (\" suffix=\")\" delimiter=\" \">\n          <text term=\"version\"/>\n          <text variable=\"version\"/>\n        </group>\n      </else-if>\n      <else-if variable=\"reviewed-author\">\n        <group delimiter=\", \">\n          <text variable=\"title\" font-style=\"italic\" prefix=\"Review of \"/>\n          <names variable=\"reviewed-author\">\n            <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"bill legislation legal_case interview patent\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-short\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"interview\">\n            <text term=\"interview\"/>\n          </if>\n          <else-if type=\"manuscript speech\" match=\"any\">\n            <text variable=\"genre\" form=\"short\"/>\n          </else-if>\n          <else-if type=\"personal_communication\">\n            <text macro=\"issued\"/>\n          </else-if>\n        </choose>\n      </if>\n      <else-if type=\"book graphic motion_picture song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" form=\"short\" font-style=\"italic\"/>\n      </else-if>\n      <else-if type=\"legal_case\" variable=\"title-short\" match=\"all\">\n        <text variable=\"title\" font-style=\"italic\" form=\"short\"/>\n      </else-if>\n      <else-if type=\"patent interview\" match=\"any\">\n        <text variable=\"title\" form=\"short\"/>\n      </else-if>\n      <else-if type=\"legal_case bill legislation\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" form=\"short\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date-disambiguate\">\n    <choose>\n      <if disambiguate=\"true\">\n        <text macro=\"issued\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"description-note\">\n    <group delimiter=\", \">\n      <text macro=\"interviewer-note\"/>\n      <text variable=\"medium\"/>\n      <choose>\n        <if variable=\"title\" match=\"none\"/>\n        <else-if type=\"manuscript thesis speech\" match=\"any\"/>\n        <else-if type=\"patent\">\n          <group delimiter=\" \">\n            <text variable=\"authority\"/>\n            <text variable=\"number\"/>\n          </group>\n        </else-if>\n        <else>\n          <text variable=\"genre\"/>\n        </else>\n      </choose>\n      <choose>\n        <if type=\"map\">\n          <text variable=\"scale\"/>\n        </if>\n        <else-if type=\"graphic\">\n          <text variable=\"dimensions\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"description\">\n    <group delimiter=\", \">\n      <group delimiter=\". \">\n        <text macro=\"interviewer\"/>\n        <text variable=\"medium\" text-case=\"capitalize-first\"/>\n      </group>\n      <choose>\n        <if variable=\"title\" match=\"none\"/>\n        <else-if type=\"thesis speech\" match=\"any\"/>\n        <else-if type=\"patent\">\n          <group delimiter=\" \">\n            <text variable=\"authority\"/>\n            <text variable=\"number\"/>\n          </group>\n        </else-if>\n        <else>\n          <text variable=\"genre\" text-case=\"capitalize-first\"/>\n        </else>\n      </choose>\n      <choose>\n        <if type=\"map\">\n          <text variable=\"scale\"/>\n        </if>\n        <else-if type=\"graphic\">\n          <text variable=\"dimensions\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"container-title-note\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"any\">\n          <text term=\"in\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"webpage\">\n          <text variable=\"container-title\"/>\n        </if>\n        <else-if type=\"post-weblog\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\" suffix=\" (blog)\"/>\n        </else-if>\n        <else-if type=\"bill legislation legal_case\" match=\"none\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"container-title\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"any\">\n          <text term=\"in\" text-case=\"capitalize-first\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"webpage\">\n          <text variable=\"container-title\"/>\n        </if>\n        <else-if type=\"post-weblog\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\" suffix=\" (blog)\"/>\n        </else-if>\n        <else-if type=\"bill legislation legal_case\" match=\"none\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n        </else-if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"collection-title\">\n    <choose>\n      <if match=\"none\" type=\"article-journal\">\n        <choose>\n          <if match=\"none\" is-numeric=\"collection-number\">\n            <group delimiter=\", \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </if>\n          <else>\n            <group delimiter=\" \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"collection-title-journal\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\" \">\n          <text variable=\"collection-title\"/>\n          <text variable=\"collection-number\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition-note\">\n    <choose>\n      <if type=\"book chapter graphic motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"book chapter graphic motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note-join-with-space\">\n    <choose>\n      <if type=\"article-journal\" variable=\"volume\" match=\"all\">\n        <choose>\n          <if match=\"none\" variable=\"collection-title\">\n            <text macro=\"locators-note\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\" match=\"none\">\n        <text macro=\"locators-note\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\" match=\"none\">\n            <text macro=\"locators-note\"/>\n          </if>\n          <else-if match=\"any\" variable=\"collection-title\">\n            <text macro=\"locators-note\"/>\n          </else-if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\", \">\n          <text macro=\"collection-title-journal\"/>\n          <number variable=\"volume\"/>\n          <group delimiter=\" \">\n            <text term=\"issue\" form=\"short\"/>\n            <number variable=\"issue\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"bill legislation legal_case\" match=\"any\">\n        <text macro=\"legal-cites\"/>\n      </else-if>\n      <else-if type=\"book chapter graphic motion_picture paper-conference report song\" match=\"any\">\n        <group delimiter=\", \">\n          <text macro=\"edition-note\"/>\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"none\">\n              <group delimiter=\" \">\n                <number variable=\"number-of-volumes\" form=\"numeric\"/>\n                <text term=\"volume\" form=\"short\" plural=\"true\"/>\n              </group>\n            </if>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"legal-cites\">\n    <choose>\n      <if type=\"legal_case\" match=\"any\">\n        <group delimiter=\" \">\n          <choose>\n            <if variable=\"container-title\">\n              <text variable=\"volume\"/>\n              <text variable=\"container-title\"/>\n              <group delimiter=\" \">\n                <!--change to label variable=\"section\" as that becomes available -->\n                <text term=\"section\" form=\"symbol\"/>\n                <text variable=\"section\"/>\n              </group>\n              <text variable=\"page\"/>\n            </if>\n            <else>\n              <text variable=\"number\" prefix=\"No. \"/>\n            </else>\n          </choose>\n        </group>\n      </if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if variable=\"number\">\n              <!--There's a public law number-->\n              <text variable=\"number\" prefix=\"Pub. L. No. \"/>\n              <group delimiter=\" \">\n                <!--change to label variable=\"section\" as that becomes available -->\n                <text term=\"section\" form=\"symbol\"/>\n                <text variable=\"section\"/>\n              </group>\n              <group delimiter=\" \">\n                <text variable=\"volume\"/>\n                <text variable=\"container-title\"/>\n                <text variable=\"page-first\"/>\n              </group>\n            </if>\n            <else>\n              <group delimiter=\" \">\n                <text variable=\"volume\"/>\n                <text variable=\"container-title\"/>\n                <!--change to label variable=\"section\" as that becomes available -->\n                <text term=\"section\" form=\"symbol\"/>\n                <text variable=\"section\"/>\n              </group>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-space\">\n    <choose>\n      <if type=\"article-journal\" variable=\"volume\" match=\"all\">\n        <choose>\n          <if match=\"none\" variable=\"collection-title\">\n            <text macro=\"locators\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-comma\">\n    <choose>\n      <if type=\"bill chapter legislation legal_case paper-conference\" match=\"any\">\n        <text macro=\"locators\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\" match=\"none\">\n            <text macro=\"locators\"/>\n          </if>\n          <else-if match=\"any\" variable=\"collection-title\">\n            <text macro=\"locators\"/>\n          </else-if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-period\">\n    <choose>\n      <if type=\"bill legislation legal_case article-journal chapter paper-conference\" match=\"none\">\n        <text macro=\"locators\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\", \">\n          <text macro=\"collection-title-journal\"/>\n          <number variable=\"volume\"/>\n          <group delimiter=\" \">\n            <text term=\"issue\" form=\"short\"/>\n            <number variable=\"issue\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"bill legislation legal_case\" match=\"any\">\n        <text macro=\"legal-cites\"/>\n      </else-if>\n      <else-if type=\"book graphic motion_picture report song\" match=\"any\">\n        <group delimiter=\". \">\n          <text macro=\"edition\"/>\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <group delimiter=\" \">\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" plural=\"true\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"any\">\n        <group delimiter=\". \">\n          <text macro=\"edition\"/>\n          <choose>\n            <if variable=\"page\" match=\"none\">\n              <group delimiter=\" \">\n                <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n                <number variable=\"volume\" form=\"numeric\"/>\n              </group>\n            </if>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-newspaper\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <number variable=\"edition\"/>\n            <text term=\"edition\"/>\n          </group>\n          <group delimiter=\" \">\n            <text term=\"section\" form=\"short\"/>\n            <text variable=\"section\"/>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"event-note\">\n    <text variable=\"event\"/>\n  </macro>\n  <macro name=\"event\">\n    <choose>\n      <if variable=\"title\">\n        <group delimiter=\" \">\n          <text term=\"presented at\"/>\n          <text variable=\"event\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\" \">\n          <text term=\"presented at\" text-case=\"capitalize-first\"/>\n          <text variable=\"event\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"originally-published\">\n    <group delimiter=\", \">\n      <group delimiter=\": \">\n        <text variable=\"original-publisher-place\"/>\n        <text variable=\"original-publisher\"/>\n      </group>\n      <date variable=\"original-date\" form=\"text\" date-parts=\"year\"/>\n    </group>\n  </macro>\n  <macro name=\"reprint-note\">\n    <!--needs localization-->\n    <choose>\n      <if variable=\"original-date issued\" match=\"all\">\n        <choose>\n          <!--for whatever reason in notes, when we have both original and new publishers, reprint doesn't appear-->\n          <if variable=\"original-publisher original-publisher-place\" match=\"none\">\n            <text value=\"repr.\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"reprint\">\n    <!--needs localization-->\n    <choose>\n      <if variable=\"original-date issued\" match=\"all\">\n        <text value=\"reprint\" text-case=\"capitalize-first\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"thesis\">\n        <text variable=\"publisher\"/>\n      </if>\n      <else-if type=\"speech\">\n        <text variable=\"event-place\"/>\n      </else-if>\n      <else>\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issued\">\n    <choose>\n      <if variable=\"issued\">\n        <choose>\n          <if type=\"legal_case\">\n            <group delimiter=\" \">\n              <text variable=\"authority\"/>\n              <choose>\n                <if variable=\"container-title\" match=\"any\">\n                  <!--Only print year for cases published in reporters-->\n                  <date variable=\"issued\" form=\"numeric\" date-parts=\"year\"/>\n                </if>\n                <else>\n                  <date variable=\"issued\" form=\"text\"/>\n                </else>\n              </choose>\n            </group>\n          </if>\n          <else-if type=\"book bill chapter  legislation motion_picture paper-conference song thesis\" match=\"any\">\n            <choose>\n              <if is-uncertain-date=\"issued\">\n                <date variable=\"issued\" form=\"numeric\" date-parts=\"year\" prefix=\"[\" suffix=\"?]\"/>\n              </if>\n              <else>\n                <date variable=\"issued\" form=\"numeric\" date-parts=\"year\"/>\n              </else>\n            </choose>\n          </else-if>\n          <else-if type=\"patent\">\n            <group delimiter=\", \">\n              <group delimiter=\" \">\n                <!--Needs Localization-->\n                <text value=\"filed\"/>\n                <date variable=\"submitted\" form=\"text\"/>\n              </group>\n              <group delimiter=\" \">\n                <choose>\n                  <if variable=\"issued submitted\" match=\"all\">\n                    <text term=\"and\"/>\n                  </if>\n                </choose>\n                <!--Needs Localization-->\n                <text value=\"issued\"/>\n                <date variable=\"issued\" form=\"text\"/>\n              </group>\n            </group>\n          </else-if>\n          <else>\n            <choose>\n              <if is-uncertain-date=\"issued\">\n                <date variable=\"issued\" form=\"text\" prefix=\"[\" suffix=\"?]\"/>\n              </if>\n              <else>\n                <date variable=\"issued\" form=\"text\"/>\n              </else>\n            </choose>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"status\">\n        <text variable=\"status\"/>\n      </else-if>\n      <else-if variable=\"accessed URL\" match=\"all\"/>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-subsequent\">\n    <choose>\n      <if type=\"legal_case\" variable=\"locator\" match=\"all\">\n        <choose>\n          <if locator=\"page\">\n            <group delimiter=\":\">\n              <number variable=\"volume\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </if>\n          <else>\n            <group delimiter=\" \">\n              <label variable=\"locator\" form=\"short\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"locator\">\n        <choose>\n          <if locator=\"page\" match=\"none\">\n            <group delimiter=\" \">\n              <choose>\n                <if type=\"book graphic motion_picture report song\" match=\"any\">\n                  <choose>\n                    <if variable=\"volume\">\n                      <group delimiter=\", \">\n                        <group delimiter=\" \">\n                          <text term=\"volume\" form=\"short\"/>\n                          <number variable=\"volume\" form=\"numeric\"/>\n                        </group>\n                        <label variable=\"locator\" form=\"short\"/>\n                      </group>\n                    </if>\n                    <else>\n                      <label variable=\"locator\" form=\"short\"/>\n                    </else>\n                  </choose>\n                </if>\n                <else>\n                  <label variable=\"locator\" form=\"short\"/>\n                </else>\n              </choose>\n              <text variable=\"locator\"/>\n            </group>\n          </if>\n          <else-if type=\"book graphic motion_picture report song\" match=\"any\">\n            <group delimiter=\":\">\n              <number variable=\"volume\" form=\"numeric\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </else-if>\n          <else>\n            <text variable=\"locator\"/>\n          </else>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-join-with-colon\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"locator page\" match=\"any\">\n            <choose>\n              <if variable=\"volume issue\" match=\"any\">\n                <text macro=\"point-locators\"/>\n              </if>\n            </choose>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\" match=\"none\">\n        <text macro=\"point-locators\"/>\n      </if>\n      <else-if variable=\"volume issue\" match=\"none\">\n        <text macro=\"point-locators\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators\">\n    <choose>\n      <if variable=\"locator\" match=\"none\">\n        <choose>\n          <if type=\"article-journal chapter paper-conference\" match=\"any\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"article-journal\">\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\" match=\"none\">\n              <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case\"/>\n      <else>\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\" match=\"none\">\n              <label variable=\"locator\" form=\"short\"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locators-chapter\">\n    <choose>\n      <if type=\"chapter entry-dictionary entry-encyclopedia paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"author container-author\" match=\"all\"/>\n          <else>\n            <choose>\n              <if variable=\"page\">\n                <number variable=\"volume\" suffix=\":\"/>\n                <text variable=\"page\"/>\n              </if>\n            </choose>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-journal-join-with-colon\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"any\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-journal-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"none\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"archive-note\">\n    <choose>\n      <if type=\"thesis\">\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\" prefix=\"(\" suffix=\")\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\", \">\n          <text variable=\"archive_location\"/>\n          <text variable=\"archive\"/>\n          <text variable=\"archive-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"archive\">\n    <choose>\n      <if type=\"thesis\">\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\" prefix=\"(\" suffix=\")\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\". \">\n          <text variable=\"archive_location\" text-case=\"capitalize-first\"/>\n          <text variable=\"archive\"/>\n          <text variable=\"archive-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue-note-join-with-space\">\n    <choose>\n      <if type=\"article-journal bill legislation legal_case manuscript thesis\" variable=\"publisher-place publisher\" match=\"any\">\n        <!--Chicago doesn't use publisher/place for Newspapers and we want the date delimited by a comma-->\n        <choose>\n          <if type=\"article-newspaper\" match=\"none\">\n            <choose>\n              <if type=\"article-journal\" match=\"none\">\n                <text macro=\"issue-note\"/>\n              </if>\n              <else-if variable=\"issue volume\" match=\"any\">\n                <text macro=\"issue-note\"/>\n              </else-if>\n            </choose>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note-join-with-comma\">\n    <choose>\n      <if type=\"article-journal bill legislation legal_case manuscript thesis\" variable=\"publisher-place publisher\" match=\"none\">\n        <text macro=\"issue-note\"/>\n      </if>\n      <else-if type=\"article-newspaper\">\n        <text macro=\"issue-note\"/>\n      </else-if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"none\">\n            <text macro=\"issue-note\"/>\n          </if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"issue-map-graphic\">\n    <!--See CMoS 17th ed. 14.235 and 14.237-->\n    <choose>\n      <if type=\"graphic map\" match=\"any\">\n        <choose>\n          <if variable=\"publisher publisher-place\" match=\"none\">\n            <text macro=\"issued\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note\">\n    <choose>\n      <if type=\"bill legislation legal_case\" match=\"any\">\n        <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"any\">\n            <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n          </if>\n          <else>\n            <text macro=\"issued\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if type=\"article-newspaper\">\n        <text macro=\"issued\"/>\n      </else-if>\n      <else-if type=\"manuscript thesis speech\" match=\"any\">\n        <group delimiter=\", \" prefix=\"(\" suffix=\")\">\n          <choose>\n            <if variable=\"title\" match=\"any\">\n              <text variable=\"genre\"/>\n            </if>\n          </choose>\n          <text variable=\"publisher\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else-if variable=\"publisher-place event-place publisher\" match=\"any\">\n        <group prefix=\"(\" suffix=\")\" delimiter=\", \">\n          <text macro=\"event-note\"/>\n          <group delimiter=\"; \">\n            <text macro=\"originally-published\"/>\n            <group delimiter=\", \">\n              <text macro=\"reprint-note\"/>\n              <text macro=\"publisher\"/>\n            </group>\n          </group>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else>\n        <text macro=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-space\">\n    <choose>\n      <if type=\"article-journal\" match=\"any\">\n        <choose>\n          <if variable=\"issue volume\" match=\"any\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"bill legislation legal_case\" match=\"any\">\n        <text macro=\"issue\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-period\">\n    <choose>\n      <if type=\"article-journal bill legislation legal_case\" match=\"none\">\n        <choose>\n          <if type=\"speech\" variable=\"publisher publisher-place\" match=\"any\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-comma\">\n    <choose>\n      <if type=\"bill legislation legal_case\" match=\"none\">\n        <choose>\n          <if type=\"article-journal\" match=\"none\">\n            <choose>\n              <if type=\"speech\" variable=\"publisher publisher-place\" match=\"none\">\n                <text macro=\"issue\"/>\n              </if>\n            </choose>\n          </if>\n          <else-if variable=\"volume issue\" match=\"none\">\n            <text macro=\"issue\"/>\n          </else-if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if type=\"bill legislation legal_case\" match=\"any\">\n        <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"issue volume\" match=\"any\">\n            <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n          </if>\n          <else>\n            <text macro=\"issued\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else-if type=\"speech\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"title\" match=\"none\"/>\n              <else>\n                <text variable=\"genre\" text-case=\"capitalize-first\"/>\n              </else>\n            </choose>\n            <text macro=\"event\"/>\n          </group>\n          <text variable=\"event-place\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <!--Chicago doesn't use publisher/place for Newspapers -->\n      <else-if type=\"article-newspaper\">\n        <text macro=\"issued\"/>\n      </else-if>\n      <else-if variable=\"publisher-place publisher\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if type=\"thesis\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n          </choose>\n          <group delimiter=\". \">\n            <text macro=\"originally-published\"/>\n            <group delimiter=\", \">\n              <text macro=\"reprint\"/>\n              <text macro=\"publisher\"/>\n            </group>\n          </group>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <!--location for data for maps and artwork is different-->\n      <else-if type=\"graphic map\" match=\"none\">\n        <text macro=\"issued\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"access-note\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive-note\"/>\n        </if>\n        <else-if type=\"article-journal bill book chapter legal_case legislation motion_picture paper-conference\" match=\"none\">\n          <text macro=\"archive-note\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\"/>\n            <date variable=\"accessed\" form=\"text\"/>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"https://doi.org/\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive\"/>\n        </if>\n        <else-if type=\"article-journal bill book chapter legal_case legislation motion_picture paper-conference\" match=\"none\">\n          <text macro=\"archive\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date variable=\"accessed\" form=\"text\"/>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"https://doi.org/\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"case-locator-subsequent\">\n    <choose>\n      <if type=\"legal_case\">\n        <group delimiter=\" \">\n          <text variable=\"volume\"/>\n          <text variable=\"container-title\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"case-pinpoint-subsequent\">\n    <choose>\n      <if type=\"legal_case\">\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\">\n              <text term=\"at\"/>\n              <text variable=\"locator\"/>\n            </if>\n            <else>\n              <label variable=\"locator\"/>\n              <text variable=\"locator\"/>\n            </else>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-names=\"true\">\n    <layout suffix=\".\" delimiter=\"; \">\n      <choose>\n        <if position=\"ibid ibid-with-locator\" match=\"any\">\n          <group delimiter=\", \">\n            <text macro=\"contributors-short\"/>\n            <group delimiter=\" \">\n              <group delimiter=\", \">\n                <choose>\n                  <if variable=\"author editor translator\" match=\"none\">\n                    <text macro=\"title-short\"/>\n                  </if>\n                </choose>\n                <text macro=\"case-locator-subsequent\"/>\n              </group>\n              <text macro=\"case-pinpoint-subsequent\"/>\n            </group>\n            <choose>\n              <if match=\"none\" type=\"legal_case\">\n                <text macro=\"point-locators-subsequent\"/>\n              </if>\n            </choose>\n          </group>\n        </if>\n        <else-if position=\"subsequent\">\n          <group delimiter=\", \">\n            <text macro=\"contributors-short\"/>\n            <group delimiter=\" \">\n              <group delimiter=\", \">\n                <text macro=\"title-short\"/>\n                <!--if title & author are the same: -->\n                <text macro=\"date-disambiguate\"/>\n                <text macro=\"case-locator-subsequent\"/>\n              </group>\n              <text macro=\"case-pinpoint-subsequent\"/>\n            </group>\n            <choose>\n              <if match=\"none\" type=\"legal_case\">\n                <text macro=\"point-locators-subsequent\"/>\n              </if>\n            </choose>\n          </group>\n        </else-if>\n        <else>\n          <group delimiter=\", \">\n            <group delimiter=\": \">\n              <group delimiter=\", \">\n                <group delimiter=\" \">\n                  <group delimiter=\", \">\n                    <group delimiter=\" \">\n                      <group delimiter=\", \">\n                        <group delimiter=\", \">\n                          <text macro=\"contributors-note\"/>\n                          <text macro=\"title-note\"/>\n                          <text macro=\"issue-map-graphic\"/>\n                        </group>\n                        <text macro=\"description-note\"/>\n                        <text macro=\"secondary-contributors-note\"/>\n                        <text macro=\"container-title-note\"/>\n                        <text macro=\"container-contributors-note\"/>\n                      </group>\n                      <text macro=\"locators-note-join-with-space\"/>\n                    </group>\n                    <text macro=\"locators-note-join-with-comma\"/>\n                    <text macro=\"collection-title\"/>\n                    <text macro=\"issue-note-join-with-comma\"/>\n                  </group>\n                  <text macro=\"issue-note-join-with-space\"/>\n                </group>\n                <text macro=\"locators-newspaper\"/>\n                <text macro=\"point-locators-join-with-comma\"/>\n              </group>\n              <text macro=\"point-locators-join-with-colon\"/>\n            </group>\n            <text macro=\"access-note\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"11\" et-al-use-first=\"7\" subsequent-author-substitute=\"&#8212;&#8212;&#8212;\" entry-spacing=\"0\">\n    <sort>\n      <key macro=\"contributors-sort\"/>\n      <key variable=\"title\"/>\n      <key variable=\"genre\"/>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\". \">\n        <group delimiter=\": \">\n          <group delimiter=\", \">\n            <group delimiter=\" \">\n              <group delimiter=\". \">\n                <group delimiter=\" \">\n                  <group delimiter=\", \">\n                    <group delimiter=\". \">\n                      <group delimiter=\". \">\n                        <text macro=\"contributors\"/>\n                        <text macro=\"title\"/>\n                        <text macro=\"issue-map-graphic\"/>\n                      </group>\n                      <text macro=\"description\"/>\n                      <text macro=\"secondary-contributors\"/>\n                      <group delimiter=\", \">\n                        <text macro=\"container-title\"/>\n                        <text macro=\"container-contributors\"/>\n                      </group>\n                      <text macro=\"locators-join-with-period\"/>\n                    </group>\n                    <text macro=\"locators-join-with-comma\"/>\n                    <text macro=\"locators-chapter\"/>\n                  </group>\n                  <text macro=\"locators-join-with-space\"/>\n                </group>\n                <text macro=\"collection-title\"/>\n                <text macro=\"issue-join-with-period\"/>\n              </group>\n              <text macro=\"issue-join-with-space\"/>\n            </group>\n            <text macro=\"issue-join-with-comma\"/>\n            <text macro=\"locators-journal-join-with-comma\"/>\n            <text macro=\"locators-newspaper\"/>\n          </group>\n          <text macro=\"locators-journal-join-with-colon\"/>\n        </group>\n        <text macro=\"access\"/>\n      </group>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/chicago-note-bibliography.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\">\n  <info>\n    <title>Chicago Manual of Style (note)</title>\n    <id>http://www.zotero.org/styles/chicago-note-bibliography</id>\n    <link href=\"http://www.zotero.org/styles/chicago-note-bibliography\" rel=\"self\"/>\n    <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Simon Kornblith</name>\n      <email>simon@simonster.com</email>\n    </contributor>\n    <contributor>\n      <name>Elena Razlogova</name>\n      <email>elena.razlogova@gmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Frank Bennett</name>\n      <email>biercenator@gmail.com</email>\n    </contributor>\n    <category citation-format=\"note\"/>\n    <category field=\"generic-base\"/>\n    <summary>Chicago format with short notes and bibliography</summary>\n    <updated>2012-10-25T21:15:26+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"editortranslator\" form=\"verb-short\">\n        <single>trans. and ed.</single>\n        <multiple>trans. and ed.</multiple>\n      </term>\n      <term name=\"editortranslator\" form=\"verb\">\n        <single> Translated and edited by</single>\n        <multiple> Translated and edited by</multiple>\n      </term>\n      <term name=\"editor\" form=\"verb-short\">ed.</term>\n      <term name=\"translator\" form=\"verb-short\">trans.</term>\n    </terms>\n  </locale>\n  <macro name=\"editor-translator\">\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"author\">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"container-author\">\n                <group>\n                  <names variable=\"container-author\">\n                    <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </group>\n              </if>\n            </choose>\n          </group>\n          <names variable=\"editor translator\" delimiter=\", \">\n            <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"secondary-contributors-note\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"none\">\n        <text macro=\"editor-translator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors-note\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text macro=\"editor-translator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"secondary-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"none\">\n        <group delimiter=\". \">\n          <choose>\n            <if variable=\"author\">\n              <names variable=\"editor translator\" delimiter=\". \">\n                <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n                <name and=\"text\" delimiter=\", \"/>\n              </names>\n            </if>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if variable=\"author\">\n              <choose>\n                <if variable=\"container-author\">\n                  <names variable=\"container-author\">\n                    <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </if>\n              </choose>\n              <!--This includes page numbers after the container author, e.g. for Introductions -->\n              <choose>\n                <if variable=\"container-author author\" match=\"all\">\n                  <group delimiter=\". \">\n                    <text variable=\"page\"/>\n                    <names variable=\"editor translator\" delimiter=\", \">\n                      <label form=\"verb\" suffix=\" \"/>\n                      <name and=\"text\" delimiter=\", \"/>\n                    </names>\n                  </group>\n                </if>\n                <else>\n                  <names variable=\"editor translator\" delimiter=\", \">\n                    <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </else>\n              </choose>\n            </if>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"recipient-note\">\n    <names variable=\"recipient\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-note\">\n    <group delimiter=\" \">\n      <names variable=\"author\">\n        <name and=\"text\" sort-separator=\", \" delimiter=\", \"/>\n        <label form=\"short\" prefix=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"verb-short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"personal_communication\">\n          <choose>\n            <if variable=\"genre\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n            <else>\n              <text term=\"letter\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors\">\n    <group delimiter=\". \">\n      <names variable=\"author\">\n        <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <substitute>\n          <text macro=\"editor\"/>\n          <text macro=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient\"/>\n    </group>\n  </macro>\n  <macro name=\"recipient-short\">\n    <names variable=\"recipient\">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name form=\"short\" and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-short\">\n    <group delimiter=\" \">\n      <names variable=\"author\">\n        <name form=\"short\" and=\"text\" delimiter=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient-short\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors-sort\">\n    <names variable=\"author\">\n      <name name-as-sort-order=\"all\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"interviewer-note\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"interviewer\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"title-note\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <text variable=\"genre\"/>\n      </if>\n      <else-if type=\"bill book graphic  legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <text variable=\"version\" prefix=\" , version \" suffix=\"\"/>\n        <!--This isn't localized because we don't have a version term. While not ideal, it should work for many languages and is better than not including a term.-->\n      </else-if>\n      <else-if type=\"legal_case\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"personal_communication\" match=\"none\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <text variable=\"version\" prefix=\" (version \" suffix=\")\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-short\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"interview\">\n            <text term=\"interview\" text-case=\"lowercase\"/>\n          </if>\n          <else-if type=\"manuscript speech\" match=\"any\">\n            <text variable=\"genre\" form=\"short\"/>\n          </else-if>\n          <else-if type=\"personal_communication\">\n            <text macro=\"issued\"/>\n          </else-if>\n        </choose>\n      </if>\n      <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" form=\"short\" font-style=\"italic\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" form=\"short\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"description-note\">\n    <group delimiter=\", \">\n      <text macro=\"interviewer-note\"/>\n      <text variable=\"medium\"/>\n      <choose>\n        <if variable=\"title\" match=\"none\"/>\n        <else-if type=\"thesis speech\" match=\"any\"/>\n        <else>\n          <text variable=\"genre\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"description\">\n    <group delimiter=\", \">\n      <group delimiter=\". \">\n        <text macro=\"interviewer\"/>\n        <text variable=\"medium\" text-case=\"capitalize-first\"/>\n      </group>\n      <choose>\n        <if variable=\"title\" match=\"none\"/>\n        <else-if type=\"thesis speech\" match=\"any\"/>\n        <else>\n          <text variable=\"genre\" text-case=\"capitalize-first\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"container-title-note\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"chapter paper-conference\" match=\"any\">\n          <text term=\"in\" text-case=\"lowercase\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"container-title\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"chapter paper-conference\" match=\"any\">\n          <text term=\"in\" text-case=\"capitalize-first\"/>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"collection-title\">\n    <group delimiter=\" \">\n      <text variable=\"collection-title\" text-case=\"title\"/>\n      <text variable=\"collection-number\"/>\n    </group>\n  </macro>\n  <macro name=\"edition-note\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <number variable=\"edition\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <number variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note-join-with-space\">\n    <choose>\n      <if type=\"article-journal\">\n        <text macro=\"locators-note\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\" match=\"none\">\n        <text macro=\"locators-note\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-note\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\", \">\n          <number variable=\"volume\"/>\n          <group delimiter=\" \">\n            <text term=\"issue\" form=\"short\"/>\n            <number variable=\"issue\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"legal_case\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <number variable=\"volume\"/>\n            <text variable=\"container-title\"/>\n            <text variable=\"page\"/>\n          </group>\n          <text variable=\"locator\"/>\n        </group>\n      </else-if>\n      <else-if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"none\">\n              <group delimiter=\" \">\n                <number variable=\"number-of-volumes\" form=\"numeric\"/>\n                <text term=\"volume\" form=\"short\" plural=\"true\"/>\n              </group>\n            </if>\n          </choose>\n          <text macro=\"edition-note\"/>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-space\">\n    <choose>\n      <if type=\"article-journal\">\n        <text macro=\"locators\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-comma\">\n    <choose>\n      <if type=\"legal_case\">\n        <text macro=\"locators\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-join-with-period\">\n    <choose>\n      <if type=\"legal_case article-journal\" match=\"none\">\n        <text macro=\"locators\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\", \">\n          <number variable=\"volume\"/>\n          <group delimiter=\" \">\n            <text term=\"issue\" form=\"short\"/>\n            <number variable=\"issue\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"legal_case\">\n        <group delimiter=\" \">\n          <number variable=\"volume\"/>\n          <text variable=\"container-title\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <group delimiter=\". \">\n          <group delimiter=\" \">\n            <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <group delimiter=\" \">\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" plural=\"true\"/>\n          </group>\n          <text macro=\"edition\"/>\n        </group>\n      </else-if>\n      <else-if type=\"chapter paper-conference\" match=\"any\">\n        <group delimiter=\". \">\n          <choose>\n            <if variable=\"page\" match=\"none\">\n              <group delimiter=\" \">\n                <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n                <number variable=\"volume\" form=\"numeric\"/>\n              </group>\n            </if>\n          </choose>\n          <text macro=\"edition\"/>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-newspaper\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <number variable=\"edition\"/>\n            <text term=\"edition\"/>\n          </group>\n          <group delimiter=\" \">\n            <text term=\"section\" form=\"short\"/>\n            <text variable=\"section\"/>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"event\">\n    <group delimiter=\" \">\n      <text term=\"presented at\"/>\n      <text variable=\"event\"/>\n    </group>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"thesis\">\n        <text variable=\"publisher\"/>\n      </if>\n      <else>\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issued\">\n    <choose>\n      <if variable=\"issued\">\n        <choose>\n          <if type=\"graphic report\" match=\"any\">\n            <date variable=\"issued\">\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"day\" suffix=\", \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </if>\n          <else-if type=\"legal_case\">\n            <group delimiter=\" \">\n              <text variable=\"authority\"/>\n              <date variable=\"issued\">\n                <date-part name=\"year\"/>\n              </date>\n            </group>\n          </else-if>\n          <else-if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song thesis\" match=\"any\">\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n          </else-if>\n          <else>\n            <date variable=\"issued\">\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"day\" suffix=\", \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"accessed URL\" match=\"all\">\n      </else-if>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-subsequent\">\n    <choose>\n      <if variable=\"locator\">\n        <choose>\n          <if locator=\"page\" match=\"none\">\n            <group delimiter=\" \">\n              <choose>\n                <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n                  <choose>\n                    <if variable=\"volume\">\n                      <group delimiter=\", \">\n                        <group delimiter=\" \">\n                          <text term=\"volume\" form=\"short\" text-case=\"lowercase\"/>\n                          <number variable=\"volume\" form=\"numeric\"/>\n                        </group>\n                        <label variable=\"locator\" form=\"short\"/>\n                      </group>\n                    </if>\n                    <else>\n                      <label variable=\"locator\" form=\"short\"/>\n                    </else>\n                  </choose>\n                </if>\n                <else>\n                  <label variable=\"locator\" form=\"short\"/>\n                </else>\n              </choose>\n              <text variable=\"locator\"/>\n            </group>\n          </if>\n          <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n            <group delimiter=\":\">\n              <number variable=\"volume\" form=\"numeric\"/>\n              <text variable=\"locator\"/>\n            </group>\n          </else-if>\n          <else>\n            <text variable=\"locator\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-join-with-colon\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"locator page\" match=\"any\">\n            <text macro=\"point-locators\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-join-with-comma\">\n    <choose>\n      <if type=\"article-journal\" match=\"none\">\n        <text macro=\"point-locators\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators\">\n    <choose>\n      <if variable=\"locator\" match=\"none\">\n        <choose>\n          <if type=\"article-journal chapter paper-conference\" match=\"any\">\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"article-journal\">\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\" match=\"none\">\n              <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case\"/>\n      <else>\n        <group delimiter=\" \">\n          <choose>\n            <if locator=\"page\" match=\"none\">\n              <label variable=\"locator\" form=\"short\"/>\n            </if>\n          </choose>\n          <text variable=\"locator\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locators-chapter\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"page\">\n            <number variable=\"volume\" suffix=\":\"/>\n            <text variable=\"page\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-journal\">\n    <choose>\n      <if type=\"article-journal\">\n        <text variable=\"page\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"archive-note\">\n    <choose>\n      <if type=\"thesis\">\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\" prefix=\"(\" suffix=\")\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\", \">\n          <text variable=\"archive_location\"/>\n          <text variable=\"archive\"/>\n          <text variable=\"archive-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"archive\">\n    <choose>\n      <if type=\"thesis\">\n        <group delimiter=\" \">\n          <text variable=\"archive\"/>\n          <text variable=\"archive_location\" prefix=\"(\" suffix=\")\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\". \">\n          <text variable=\"archive_location\" text-case=\"capitalize-first\"/>\n          <text variable=\"archive\"/>\n          <text variable=\"archive-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue-note-join-with-space\">\n    <choose>\n      <if type=\"article-journal legal_case\" variable=\"publisher-place publisher\" match=\"any\">\n        <text macro=\"issue-note\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note-join-with-comma\">\n    <choose>\n      <if type=\"article-journal legal_case\" variable=\"publisher-place publisher\" match=\"none\">\n        <text macro=\"issue-note\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"any\">\n        <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n      </if>\n      <else-if variable=\"publisher-place publisher\" match=\"any\">\n        <group prefix=\"(\" suffix=\")\" delimiter=\", \">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"title\" match=\"none\"/>\n              <else-if type=\"thesis speech\" match=\"any\">\n                <text variable=\"genre\"/>\n              </else-if>\n            </choose>\n            <text macro=\"event\"/>\n          </group>\n          <text macro=\"publisher\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else>\n        <text macro=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-space\">\n    <choose>\n      <if type=\"article-journal legal_case\">\n        <text macro=\"issue\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-period\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"none\">\n        <choose>\n          <if type=\"speech\" variable=\"publisher publisher-place\" match=\"any\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue-join-with-comma\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"none\">\n        <choose>\n          <if type=\"speech\" variable=\"publisher publisher-place\" match=\"none\">\n            <text macro=\"issue\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if type=\"article-journal legal_case\" match=\"any\">\n        <text macro=\"issued\" prefix=\" (\" suffix=\")\"/>\n      </if>\n      <else-if type=\"speech\">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"title\" match=\"none\"/>\n              <else>\n                <text variable=\"genre\" text-case=\"capitalize-first\"/>\n              </else>\n            </choose>\n            <text macro=\"event\"/>\n          </group>\n          <text variable=\"event-place\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else-if variable=\"publisher-place publisher\" match=\"any\">\n        <group delimiter=\", \">\n          <choose>\n            <if type=\"thesis\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n          </choose>\n          <text macro=\"publisher\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else>\n        <text macro=\"issued\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"access-note\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive-note\"/>\n        </if>\n        <else-if type=\"article-journal article-magazine article-newspaper bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"none\">\n          <text macro=\"archive-note\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\"/>\n            <date variable=\"accessed\">\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"day\" suffix=\", \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"doi:\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive\"/>\n        </if>\n        <else-if type=\"article-journal article-magazine article-newspaper bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"none\">\n          <text macro=\"archive\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date variable=\"accessed\">\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"day\" suffix=\", \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"doi:\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"case-locator-subsequent\">\n    <choose>\n      <if type=\"legal_case\">\n        <text macro=\"locators-note\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"case-issue-subsequent\">\n    <choose>\n      <if type=\"legal_case\">\n        <text macro=\"issue\"/>\n      </if>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-names=\"true\">\n    <layout suffix=\".\" delimiter=\"; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\", \">\n            <text term=\"ibid\"/>\n            <text macro=\"point-locators-subsequent\"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\"/>\n        </else-if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"contributors-short\"/>\n            <group delimiter=\" \">\n              <group delimiter=\", \">\n                <text macro=\"title-short\"/>\n                <text macro=\"case-locator-subsequent\"/>\n              </group>\n              <text macro=\"case-issue-subsequent\"/>\n            </group>\n            <text macro=\"point-locators-subsequent\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"11\" et-al-use-first=\"7\" subsequent-author-substitute=\"&#8212;&#8212;&#8212;\" entry-spacing=\"0\">\n    <sort>\n      <key macro=\"contributors-sort\"/>\n      <key variable=\"title\"/>\n      <key variable=\"genre\"/>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\". \">\n        <group delimiter=\": \">\n          <group delimiter=\", \">\n            <group delimiter=\" \">\n              <group delimiter=\". \">\n                <group delimiter=\" \">\n                  <group delimiter=\", \">\n                    <group delimiter=\". \">\n                      <group delimiter=\" \">\n                        <group delimiter=\". \">\n                          <text macro=\"contributors\"/>\n                          <text macro=\"title\"/>\n                        </group>\n                        <text macro=\"description\"/>\n                      </group>\n                      <text macro=\"secondary-contributors\"/>\n                      <group delimiter=\", \">\n                        <text macro=\"container-title\"/>\n                        <text macro=\"container-contributors\"/>\n                        <text macro=\"locators-chapter\"/>\n                      </group>\n                      <text macro=\"locators-join-with-period\"/>\n                    </group>\n                    <text macro=\"locators-join-with-comma\"/>\n                  </group>\n                  <text macro=\"locators-join-with-space\"/>\n                </group>\n                <text macro=\"collection-title\"/>\n                <text macro=\"issue-join-with-period\"/>\n              </group>\n              <text macro=\"issue-join-with-space\"/>\n            </group>\n            <text macro=\"issue-join-with-comma\"/>\n            <text macro=\"locators-newspaper\"/>\n          </group>\n          <text macro=\"locators-journal\"/>\n        </group>\n        <text macro=\"access\"/>\n      </group>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/chinese-gb7714-2005-numeric.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"zh-CN\">\n  <info>\n    <title>Chinese Std GB/T 7714-2005 (numeric, Chinese)</title>\n    <id>http://www.zotero.org/styles/chinese-gb7714-2005-numeric</id>\n    <link href=\"http://www.zotero.org/styles/chinese-gb7714-2005-numeric\" rel=\"self\"/>\n    <link href=\"http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/19.pdf\" rel=\"documentation\"/>\n    <author>\n      <name>heromyth</name>\n      <email>zxpmyth@yahoo.com.cn</email>\n    </author>\n    <category citation-format=\"numeric\"/>\n    <category field=\"engineering\"/>\n    <category field=\"generic-base\"/>\n    <category field=\"science\"/>\n    <summary>This style just partly implemented what the Chinese GB/T 7714-2005 requires.</summary>\n    <updated>2012-10-11T09:38:41+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name initialize-with=\" \" name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\">\n        <name-part name=\"family\" text-case=\"uppercase\"/>\n      </name>\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <names variable=\"recipient\">\n      <name name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"lowercase\"/>\n    </names>\n  </macro>\n  <macro name=\"interviewer\">\n    <names variable=\"interviewer\">\n      <name name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"lowercase\"/>\n    </names>\n  </macro>\n  <macro name=\"composer\">\n    <names variable=\"composer\">\n      <name name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"lowercase\"/>\n    </names>\n  </macro>\n  <macro name=\"original-author\">\n    <names variable=\"original-author\">\n      <name name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"lowercase\"/>\n    </names>\n  </macro>\n  <macro name=\"title\">\n    <text variable=\"title\"/>\n  </macro>\n  <macro name=\"titleField\">\n    <choose>\n      <if type=\"report\">\n        <text macro=\"title\" suffix=\"[R]. \"/>\n      </if>\n      <else-if type=\"thesis\">\n        <text macro=\"title\" suffix=\"[D]. \"/>\n      </else-if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <text variable=\"number\" suffix=\", \"/>\n        <text macro=\"title\" suffix=\"[S]\"/>\n      </else-if>\n      <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <text macro=\"title\" suffix=\"[M]. \"/>\n      </else-if>\n      <else-if type=\"paper-conference\">\n        <text macro=\"title\" suffix=\"[C]//\"/>\n      </else-if>\n      <else-if type=\"chapter paper-conference\" match=\"any\">\n        <text macro=\"title\" suffix=\"[G]//\"/>\n      </else-if>\n      <else-if type=\"webpage\">\n        <text macro=\"title\" suffix=\"[EB/OL]. \"/>\n      </else-if>\n      <else-if type=\"patent\">\n        <text macro=\"title\"/>\n        <text variable=\"number\" prefix=\": 中国, \" suffix=\"[P].  \"/>\n      </else-if>\n      <else>\n        <text macro=\"title\" suffix=\"[J]. \"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"secondaryAuthor\">\n    <names variable=\"editor\">\n      <name initialize-with=\" \" name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\">\n        <name-part name=\"family\" text-case=\"uppercase\"/>\n      </name>\n    </names>\n    <names variable=\"translator\">\n      <name name-as-sort-order=\"all\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"always\" suffix=\", 译\"/>\n    </names>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text variable=\"container-title\" suffix=\". \"/>\n      </if>\n      <else-if type=\"report\">\n        <text variable=\"collection-title\" suffix=\", \"/>\n        <text variable=\"number\" suffix=\", \"/>\n      </else-if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <text variable=\"container-title\" prefix=\". \"/>\n      </else-if>\n      <else>\n        <text variable=\"container-title\" suffix=\", \"/>\n      </else>\n    </choose>\n    <!--\n\n<text variable=\"event\" suffix=\"event \"/>\n<text variable=\"event-place\" suffix=\"event-place \"/>\n<text variable=\"original-title\" suffix=\"original-title\"/>\n\n -->\n    <text variable=\"publisher-place\" suffix=\": \"/>\n    <group delimiter=\", \">\n      <text variable=\"publisher\"/>\n      <choose>\n        <if type=\"webpage\" variable=\"container-title\" match=\"all\">\n          <date variable=\"issued\" suffix=\". \">\n            <date-part name=\"year\"/>\n            <date-part name=\"month\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n            <date-part name=\"day\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n          </date>\n        </if>\n        <else-if type=\"webpage\"/>\n        <else-if type=\"patent\">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n            <date-part name=\"month\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n            <date-part name=\"day\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n          </date>\n        </else-if>\n        <else-if variable=\"publisher\">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n        </else-if>\n        <else-if type=\"bill legislation\" match=\"any\"/>\n        <else>\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n        </else>\n      </choose>\n    </group>\n    <text variable=\"volume\" prefix=\", \"/>\n    <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n  </macro>\n  <macro name=\"pageField\">\n    <text variable=\"page\"/>\n  </macro>\n  <macro name=\"referenceDate\">\n    <choose>\n      <if type=\"webpage\">\n        <date variable=\"issued\" prefix=\"(\" suffix=\")\">\n          <date-part name=\"year\"/>\n          <date-part name=\"month\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n          <date-part name=\"day\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n        </date>\n        <date variable=\"accessed\" prefix=\"[\" suffix=\"]\">\n          <date-part name=\"year\"/>\n          <date-part name=\"month\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n          <date-part name=\"day\" form=\"numeric-leading-zeros\" prefix=\"-\"/>\n        </date>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if variable=\"DOI\">\n        <text variable=\"DOI\" prefix=\"doi:\"/>\n      </if>\n      <else-if variable=\"URL\">\n        <text variable=\"URL\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <citation collapse=\"citation-number\">\n    <sort>\n      <key variable=\"citation-number\" sort=\"ascending\"/>\n    </sort>\n    <layout vertical-align=\"sup\" prefix=\"[\" suffix=\"]\" delimiter=\",\">\n      <text variable=\"citation-number\"/>\n    </layout>\n  </citation>\n  <bibliography et-al-min=\"4\" et-al-use-first=\"3\" second-field-align=\"flush\" entry-spacing=\"0\">\n    <layout suffix=\".\">\n      <text variable=\"citation-number\" prefix=\"[\" suffix=\"]\"/>\n      <text macro=\"author\" suffix=\". \"/>\n      <text macro=\"titleField\"/>\n      <text macro=\"secondaryAuthor\" suffix=\". \"/>\n      <text variable=\"edition\" prefix=\"第\" suffix=\"版. \"/>\n      <text macro=\"publisher\"/>\n      <text macro=\"pageField\" prefix=\": \"/>\n      <text macro=\"referenceDate\"/>\n      <choose>\n        <if type=\"webpage\" match=\"any\">\n          <text macro=\"access\" prefix=\". \"/>\n        </if>\n      </choose>\n      <text macro=\"recipient\"/>\n      <text macro=\"interviewer\"/>\n      <text macro=\"composer\"/>\n      <text macro=\"original-author\"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/cite-in-inline-note.md",
    "content": "```\n% pandoc -t native\nfoo^[bar [@doe]]\n^D\n[ Para\n    [ Str \"foo\"\n    , Note\n        [ Para\n            [ Str \"bar\"\n            , Space\n            , Cite\n                [ Citation\n                    { citationId = \"doe\"\n                    , citationPrefix = []\n                    , citationSuffix = []\n                    , citationMode = NormalCitation\n                    , citationNoteNum = 1\n                    , citationHash = 0\n                    }\n                ]\n                [ Str \"[@doe]\" ]\n            ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/citeproc-17.md",
    "content": "```\n% pandoc -t csljson\n---\nreferences:\n- id: foo\n  type: book\n  title: \"Hi & Low\"\n...\n^D\n[\n  {\n    \"id\": \"foo\",\n    \"title\": \"Hi & Low\",\n    \"type\": \"book\"\n  }\n]\n```\n"
  },
  {
    "path": "test/command/citeproc-20.md",
    "content": "```\n% pandoc --citeproc -t plain\nLorem ipsum dolor sit amet^[Consectetur adipisicing elit: «sed do eiusmod tempor incididunt» [@doe_1989, 15].].\n\n---\ncsl: command/chicago-fullnote-bibliography.csl\nsuppress-bibliography: true\nreferences:\n- id: doe_1989\n  author:\n    - family: Doe\n      given: John\n  issued:\n    - year: 1989\n  publisher: ABC\n  publisher-place: New York\n  title: Tempor\n  type: book\n...\n^D\nLorem ipsum dolor sit amet[1].\n\n[1] Consectetur adipisicing elit: «sed do eiusmod tempor incididunt»\n(John Doe, Tempor (New York: ABC, 1989), 15).\n```\n"
  },
  {
    "path": "test/command/citeproc-7a.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/chicago-fullnote-bibliography.csl\nreferences:\n  - id: test\n    title: Test\n    author:\n      family: Doe\n      given: John\n---\n\nTest [@test, 12].\n\nTest [@test, 12].\n\nTest.^[asdfasdf]\n\nTest [@test, 12].\n^D\nTest.[^1]\n\nTest.[^2]\n\nTest.[^3]\n\nTest.[^4]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-test .csl-entry}\nDoe, John. \"Test,\" n.d.\n:::\n::::\n\n[^1]: John Doe, \"Test,\" n.d., 12.\n\n[^2]: Doe, 12.\n\n[^3]: asdfasdf\n\n[^4]: Doe, \"Test,\" 12.\n```\n"
  },
  {
    "path": "test/command/citeproc-7b.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/bioethics.csl\nreferences:\n  - id: test\n    title: Test\n    author:\n      family: Doe\n      given: John\n---\n\nIrrelevant.^[note]\n\nTest [@test, 12].\n\nTest.^[asdfasdf]\n\nTest [@test, 12].\n^D\nIrrelevant.[^1]\n\nTest.[^2]\n\nTest.[^3]\n\nTest.[^4]\n\n[^1]: note\n\n[^2]: J. Doe. ***Test***: 12.\n\n[^3]: asdfasdf\n\n[^4]: Doe (cited n. 2) : 12.\n```\n"
  },
  {
    "path": "test/command/citeproc-87.md",
    "content": "```\n% pandoc --citeproc -Mlang=it-IT -t markdown-citations\nFoo [@a 50: «Disse: \"bar\"»]. «Disse: \"baz\"»\n\n---\nsuppress-bibliography: true\nreferences:\n- id: a\n  author:\n    - literal: Aristotele\n  title: Metafisica\n  type: book\n...\n^D\nFoo (Aristotele, s.d., 50: «Disse: \"bar\"»). «Disse: \"baz\"»\n```\n\nThe Quoted is passed to citeproc as a Span (\"\",[\"csl-quoted\"],[])\nso that flipflopping and localization occur.\n```\n% pandoc -C -t plain -Mlang=en --csl command/le-tapuscrit-note.csl\n---\nreferences:\n- id: a\n  author:\n    - literal: Aristotele\n  title: Metafisica et \"Physica\"\n  type: article-journal\n...\n\nFoo [@a 50].\n^D\nFoo.[1]\n\nARISTOTELE, “Metafisica et ‘Physica’.”\n\n[1] Aristotele, “Metafisica et ‘Physica’,” p. 50.\n```\n\n```\n% pandoc -C -t plain -Mlang=it --csl command/le-tapuscrit-note.csl\n---\nreferences:\n- id: a\n  author:\n    - literal: Aristotele\n  title: Metafisica et \"Physica\"\n  type: article-journal\n...\n\nFoo [@a 50].\n^D\nFoo.[1]\n\nARISTOTELE, «Metafisica et “Physica”».\n\n[1] Aristotele, «Metafisica et “Physica”», p. 50.\n```\n\n"
  },
  {
    "path": "test/command/citeproc-author-in-text-suffix.md",
    "content": "```\n% pandoc -t native\n@a [p. 33; @b]\n^D\n[ Para\n    [ Cite\n        [ Citation\n            { citationId = \"a\"\n            , citationPrefix = []\n            , citationSuffix = [ Str \"p.\\160\\&33\" ]\n            , citationMode = AuthorInText\n            , citationNoteNum = 1\n            , citationHash = 0\n            }\n        , Citation\n            { citationId = \"b\"\n            , citationPrefix = []\n            , citationSuffix = []\n            , citationMode = NormalCitation\n            , citationNoteNum = 1\n            , citationHash = 0\n            }\n        ]\n        [ Str \"@a\"\n        , Space\n        , Str \"[p.\"\n        , Space\n        , Str \"33;\"\n        , Space\n        , Str \"@b]\"\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/csv.md",
    "content": "```\n% pandoc -f csv -t native\nFruit,Price,Quantity\nApple,25 cents,33\n\"\"\"Navel\"\" Orange\",\"35 cents\",22\n,,45\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Fruit\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Price\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Quantity\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Apple\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"25\" , Space , Str \"cents\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"33\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"\\\"Navel\\\"\" , Space , Str \"Orange\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"35\" , Space , Str \"cents\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"22\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"45\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/defaults-inheritance-1.md",
    "content": "```\n% pandoc -d command/defaults3\n# Header\n^D\n# Header\n```\n"
  },
  {
    "path": "test/command/defaults-inheritance-2.md",
    "content": "```\n% pandoc -d command/defaults6 2>&1\n^D\nError: Circular defaults file reference in 'command/defaults7.yaml'\n=> 63\n```\n"
  },
  {
    "path": "test/command/defaults-inheritance-3.md",
    "content": "```\n% pandoc -d command/defaults8\n<h1>Header</h1>\n^D\n# Header\n```\n"
  },
  {
    "path": "test/command/defaults1.yaml",
    "content": "include-in-header: command/A.txt\n"
  },
  {
    "path": "test/command/defaults2.yaml",
    "content": "include-in-header:\n- command/B.txt\n- command/C.txt\n\n"
  },
  {
    "path": "test/command/defaults3.yaml",
    "content": "defaults:\n  - command/defaults4\n  - command/defaults5\nto: markdown\n"
  },
  {
    "path": "test/command/defaults4.yaml",
    "content": "from: html\ndefaults:\n  - command/defaults5\n"
  },
  {
    "path": "test/command/defaults5.yaml",
    "content": "from: markdown\nto: html\n"
  },
  {
    "path": "test/command/defaults6.yaml",
    "content": "defaults:\n  - command/defaults7\n"
  },
  {
    "path": "test/command/defaults7.yaml",
    "content": "defaults:\n  - command/defaults6\n"
  },
  {
    "path": "test/command/defaults8.yaml",
    "content": "from: html\ndefaults: command/defaults9\n"
  },
  {
    "path": "test/command/defaults9.yaml",
    "content": "to: markdown\n"
  },
  {
    "path": "test/command/din-1505-2.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"de-DE\">\n  <info>\n    <title>DIN 1505-2 (author-date, German)</title>\n    <id>http://www.zotero.org/styles/din-1505-2</id>\n    <link href=\"http://www.zotero.org/styles/din-1505-2\" rel=\"self\"/>\n    <link href=\"http://www.bui.haw-hamburg.de/fileadmin/redaktion/diplom/Lorenzen__litverz.pdf\" rel=\"documentation\"/>\n    <link href=\"http://bibliothek.fh-potsdam.de/fileadmin/fhp_bib/dokumente/Schulungen/wissenschaftliches_Arbeiten/Zitieren_Lorenzen.pdf\" rel=\"documentation\"/>\n    <link href=\"http://www.uni-muenster.de/imperia/md/content/fachbereich_physik/didaktik_physik/materialien/materialschlichting/zitierregeln.pdf\" rel=\"documentation\"/>\n    <link href=\"http://forums.zotero.org/discussion/1857\" rel=\"documentation\"/>\n    <author>\n      <name>Sven Rothe</name>\n      <email>mmoole@googlemail.com</email>\n    </author>\n    <contributor>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </contributor>\n    <category citation-format=\"author-date\"/>\n    <category field=\"generic-base\"/>\n    <summary>Style following DIN 1505-2, for other media types on additional standards \n      Hinweise zur Benutzung: \n      * Zitieren von Gesetzen: \n        - hier müssen manuell §, Abs und S. zur Seitenangabe beim Zitieren eingetragen werden \n        - im Kurzbeleg wird der Kurztitel verwendet, dafür keine Autoren eintragen! \n        - als Jahresangabe wird 'Datum des Inkrafttretens' herangezogen, Verwenden nur bei Verweis auf nicht z.Z. gültige Gesetze, z.B. (idF. v. 12.12.1972) \n       * Zitieren von Normen und Standards - nicht vollständig nach DIN 1505\n        - Nutzen Sie den Typ 'Bericht' - als Abhilfe, da es keinen Typ 'Standard' gibt.\n        - als Autor die Kurzbezeichnung inkl. Nummer und Jahr eingeben (z.B. VDI 2222-1997), Vorname leer, Jahr leer\n        - als Titel den ausführlichen Titel bei Bedarf (z.B. VDI Richtlinie 2222 Blatt 1 - Konstruktionsmethodik - Methodisches Entwickeln von Lösungsprinzipien)</summary>\n    <!--    This is just a beginning to try to have a DIN 1505 citation style,\n            Feel free to send me any comments, suggestions etc...\n            todo:\n            * basic media types (book, journal article, etc..)\n            * more media types (according DINxxx) audio video etc...\n            * fine tuning\n            * correcting errors\n            known bugs, help appreciated\n            * Abbreviations (Mitarb.) & (Hrsg. der Reihe) are missing (contributor, seriesEditor labels)\n            * \"contributor\" is not valid as a name variable , nevertheless it works but doesn't validate!\n            * author etc. first names should not be abbreviated\n            * reviewed author seems to be not available as variable (newspaper article)\n            * thesis type does notoffer a PLACE or FACULTY as variable!\n            how to show the place if it is not included in the University title!?!?\n            * thesis type: publisher (university), genre (type) dont seem to get through!?\n    -->\n    <!-- useful things:\n      non breaking space: &#160;\n      narrow no break space: uni202F / &#8239; - but this is not supported widely!\n      em dash: &#8212;\n      space:  &#032;\n      tab: &#009;\n\n    -->\n    <updated>2012-09-27T22:06:38+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"de\">\n    <terms>\n      <term name=\"anonymous\" form=\"short\">o.&#160;A.</term>\n      <term name=\"no date\" form=\"short\">o.&#160;J.</term>\n      <term name=\"collection-editor\" form=\"short\">Hrsg.</term>\n      <term name=\"retrieved\">abgerufen am</term>\n      <term name=\"composer\" form=\"short\">Komp.</term>\n      <term name=\"composer\" form=\"long\">Komponist</term>\n    </terms>\n  </locale>\n  <macro name=\"author\">\n    <names variable=\"author\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n    </names>\n  </macro>\n  <macro name=\"author-container\">\n    <names variable=\"container-author\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" initialize-with=\". \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" initialize-with=\". \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n      <!-- needed: Label should appear as suffix to EVERY name...!-->\n    </names>\n  </macro>\n  <macro name=\"editor-collection\">\n    <names variable=\"collection-editor\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" initialize-with=\". \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n      <!-- needed: Label should appear as suffix to EVERY name...!-->\n    </names>\n  </macro>\n  <macro name=\"composer\">\n    <names variable=\"composer\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <label form=\"long\" prefix=\" (\" suffix=\")\"/>\n      <!-- needed: Label should appear as suffix to EVERY name...!-->\n    </names>\n  </macro>\n  <!--  <macro name=\"contributor\">\n    <names variable=\" \" delimiter=\" ; \">\n    <name name-as-sort-order=\"all\" sort-separator=\", \" initialize-with=\". \" delimiter=\" ; \"\n    delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n    <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n    </names>\n    </macro>-->\n  <macro name=\"translator\">\n    <names variable=\"translator\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" initialize-with=\". \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n      <!-- needed: Label should appear as suffix to EVERY name...!-->\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <names variable=\"recipient\" delimiter=\" ; \">\n      <name name-as-sort-order=\"all\" sort-separator=\", \" initialize-with=\". \" delimiter=\" ; \" delimiter-precedes-last=\"always\" font-variant=\"small-caps\"/>\n      <!--<label form=\"long\" prefix=\" (\" suffix=\")\"/>-->\n      <!-- needed: Label should appear as suffix to EVERY name...!-->\n    </names>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"symbol\" delimiter=\", \" initialize-with=\". \" delimiter-precedes-last=\"never\" font-variant=\"small-caps\"/>\n      <et-al font-variant=\"normal\"/>\n      <substitute>\n        <names variable=\"editor\" font-variant=\"small-caps\"/>\n        <names variable=\"translator\" font-variant=\"small-caps\"/>\n        <choose>\n          <if type=\"bill book graphic legal_case  motion_picture report song\" match=\"any\">\n            <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n          </if>\n          <else-if type=\"bill legal_case legislation\" match=\"any\">\n            <text variable=\"title\" form=\"short\" font-style=\"normal\"/>\n          </else-if>\n          <else>\n            <text variable=\"title\" form=\"short\" quotes=\"true\"/>\n          </else>\n        </choose>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"access\">\n    <group>\n      <text term=\"retrieved\" suffix=\" \"/>\n      <date variable=\"accessed\">\n        <date-part name=\"year\" form=\"long\" suffix=\"-\"/>\n        <date-part name=\"month\" form=\"numeric-leading-zeros\" suffix=\"-\"/>\n        <date-part name=\"day\" form=\"numeric-leading-zeros\"/>\n      </date>\n      <!--<date variable=\"accessed\" form=\"numeric\" date-parts=\"year-month-day\"/> // dd.mm.yyy -->\n    </group>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill legislation\" match=\"any\">\n        <group delimiter=\" &#8212; \">\n          <text variable=\"title-short\" font-style=\"normal\"/>\n          <text variable=\"title\"/>\n        </group>\n      </if>\n      <else-if type=\"book graphic legal_case motion_picture report song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"genre\">\n    <choose>\n      <if type=\"report thesis manuscript map\" match=\"any\">\n        <group>\n          <text variable=\"genre\"/>\n          <!--<text term=\"number\" form=\"short\" suffix=\" \"/>-->\n          <text variable=\"number\" prefix=\" Nr. \"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"volumes\">\n    <group delimiter=\" \">\n      <text term=\"volume\" form=\"short\" plural=\"false\"/>\n      <number variable=\"volume\" form=\"numeric\"/>\n      <number variable=\"number-of-volumes\" form=\"numeric\" prefix=\"v. \"/>\n    </group>\n  </macro>\n  <macro name=\"edition\">\n    <group>\n      <number variable=\"edition\" form=\"numeric\" suffix=\". \"/>\n      <text term=\"edition\" form=\"short\" plural=\"false\"/>\n    </group>\n  </macro>\n  <macro name=\"pages\">\n    <choose>\n      <if type=\"chapter paper-conference article-journal\" match=\"any\">\n        <label variable=\"page\" form=\"short\" suffix=\"&#160;\"/>\n        <text variable=\"page\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"dimensions\">\n    <group>\n      <text variable=\"dimensions\"/>\n    </group>\n  </macro>\n  <macro name=\"medium\">\n    <group>\n      <text variable=\"medium\"/>\n    </group>\n  </macro>\n  <macro name=\"scale\">\n    <group>\n      <text term=\"scale\"/>\n      <text prefix=\" \" variable=\"scale\"/>\n    </group>\n  </macro>\n  <macro name=\"recipient-show\">\n    <choose>\n      <if type=\"personal_communication\">\n        <choose>\n          <if variable=\"genre\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n          <else>\n            <text term=\"letter\" text-case=\"capitalize-first\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n    <text macro=\"recipient\" prefix=\", \"/>\n  </macro>\n  <macro name=\"cite-year\">\n    <group>\n      <choose>\n        <if type=\"bill legislation\" match=\"any\">\n          <date variable=\"issued\" prefix=\" (\" suffix=\")\">\n            <date-part name=\"year\" prefix=\"idF. v. \"/>\n          </date>\n        </if>\n        <else>\n          <date variable=\"issued\" prefix=\", \">\n            <date-part name=\"year\"/>\n          </date>\n          <text variable=\"year-suffix\"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"bibliography-year\">\n    <date variable=\"issued\" form=\"numeric\" date-parts=\"year\"/>\n    <text variable=\"year-suffix\"/>\n  </macro>\n  <macro name=\"locator\">\n    <group>\n      <choose>\n        <if type=\"bill legislation\" match=\"any\">\n          <text variable=\"locator\" prefix=\" \"/>\n        </if>\n        <else>\n          <label variable=\"locator\" form=\"short\" prefix=\", \"/>\n          <text variable=\"locator\" prefix=\" \"/>\n        </else>\n      </choose>\n    </group>\n  </macro>\n  <citation et-al-min=\"3\" et-al-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"false\" disambiguate-add-givenname=\"false\" collapse=\"year\">\n    <sort>\n      <key macro=\"author\"/>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout prefix=\"(\" suffix=\")\" delimiter=\"; \">\n      <group>\n        <text macro=\"author-short\"/>\n        <text macro=\"cite-year\"/>\n        <text macro=\"locator\"/>\n      </group>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"9\" et-al-use-first=\"8\">\n    <sort>\n      <key macro=\"author\"/>\n      <key variable=\"issued\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout>\n      <group delimiter=\" ; \" suffix=\":\">\n        <text macro=\"author\"/>\n        <choose>\n          <if type=\"bill book graphic legal_case legislation manuscript map motion_picture report song thesis webpage\" match=\"any\">\n            <!-- except type=\"chapter article \" etc.... -->\n            <text macro=\"editor\"/>\n            <text macro=\"editor-collection\"/>\n            <text macro=\"composer\"/>\n          </if>\n        </choose>\n        <!-- <text macro=\"contributor\"/> -->\n        <text macro=\"translator\"/>\n      </group>\n      <choose>\n        <!-- Tabelle 1 aus litverz.ps -->\n        <if type=\"bill book broadcast graphic legal_case legislation manuscript map motion_picture report song\" match=\"any\">\n          <text prefix=\" \" macro=\"title\"/>\n          <text prefix=\", \" variable=\"collection-title\" font-style=\"italic\"/>\n          <!--Reihe-->\n          <text prefix=\" (\" macro=\"genre\" suffix=\")\"/>\n          <text prefix=\". \" macro=\"volumes\"/>\n          <text prefix=\". \" macro=\"edition\"/>\n          <text prefix=\". \" macro=\"medium\"/>\n          <text prefix=\". \" macro=\"dimensions\"/>\n          <text prefix=\". \" variable=\"publisher-place\"/>\n          <text prefix=\"&#160;: \" variable=\"publisher\"/>\n          <text macro=\"bibliography-year\" prefix=\", \"/>\n          <!-- \" (1. Gesamttitel mit Zählung)\"\n            \" (2. Gesamttitel mit Zählung)\" -->\n          <text prefix=\" &#8211;&#160;\" macro=\"scale\"/>\n          <text prefix=\". &#8212;&#160;\" variable=\"note\"/>\n          <text prefix=\" &#8212;&#160;ISBN&#160;\" variable=\"ISBN\"/>\n        </if>\n        <!-- Tabelle 3 aus litverz.ps -->\n        <else-if type=\"chapter paper-conference\" match=\"any\">\n          <text prefix=\" \" macro=\"title\" suffix=\".\"/>\n          <text prefix=\". \" term=\"in\" text-case=\"capitalize-all\" suffix=\": \"/>\n          <!-- verfahre nach Tabelle 1... -->\n          <group delimiter=\" ; \" suffix=\": \">\n            <text macro=\"author-container\"/>\n            <text macro=\"editor\"/>\n            <text macro=\"editor-collection\"/>\n          </group>\n          <text variable=\"container-title\" font-style=\"italic\"/>\n          <text prefix=\", \" variable=\"collection-title\" font-style=\"italic\"/>\n          <!-- Reihe -->\n          <text prefix=\". \" macro=\"volumes\"/>\n          <!-- <text prefix=\" : \" variable=\"title of volumes\"/> what is this? -->\n          <text prefix=\". \" macro=\"edition\"/>\n          <text prefix=\". \" variable=\"publisher-place\"/>\n          <text prefix=\"&#160;: \" variable=\"publisher\"/>\n          <text macro=\"bibliography-year\" prefix=\", \"/>\n          <!-- \" (1. Gesamttitel mit Zählung)\"\n            \" (2. Gesamttitel mit Zählung)\" -->\n          <text prefix=\". &#8212;&#160;\" variable=\"note\"/>\n          <text prefix=\" &#8212;&#160;ISBN&#160;\" variable=\"ISBN\"/>\n          <text prefix=\", \" macro=\"pages\"/>\n        </else-if>\n        <!-- Tabelle 5 aus litverz.ps - Hochschulschriften\n          (Diplomarbeiten, Dissertationen, Master-A., unverö. Studienarbeiten -->\n        <else-if type=\"thesis\" match=\"any\">\n          <text prefix=\" \" macro=\"title\" font-style=\"italic\"/>\n          <text prefix=\". \" macro=\"edition\"/>\n          <text prefix=\". \" variable=\"publisher-place\"/>\n          <text prefix=\", \" variable=\"publisher\" form=\"long\"/>\n          <!-- <text prefix=\", \" variable=\"faculty\"/> -->\n          <text prefix=\", \" macro=\"genre\"/>\n          <text macro=\"bibliography-year\" prefix=\", \"/>\n          <text prefix=\". &#8212;&#160;\" variable=\"note\"/>\n        </else-if>\n        <else-if type=\"webpage post post-weblog\" match=\"any\">\n          <text prefix=\" \" macro=\"title\" suffix=\". \" font-style=\"italic\"/>\n          <text prefix=\"URL \" variable=\"URL\"/>\n          <text prefix=\". - \" macro=\"access\"/>\n          <text prefix=\". &#8212;&#160;\" variable=\"container-title\"/>\n          <text prefix=\". &#8212;&#160;\" variable=\"note\"/>\n        </else-if>\n        <!-- Tabelle 2 aus litverz.ps UND -->\n        <!-- Tabelle 4 aus litverz.ps - Schriften von Tagungen, Konferenzen, Symposien, ...-->\n        <else-if type=\"article article-journal article-magazine article-newspaper\" match=\"any\">\n          <text prefix=\" \" variable=\"title\"/>\n          <!-- \" : Zusatz zum Sachtitel\"\n            \". Angabe des Teils\"\n            \" (Gesamttitelangabe)\" -->\n          <group>\n            <text prefix=\". \" term=\"in\" text-case=\"capitalize-first\" suffix=\": \"/>\n            <text macro=\"editor\" suffix=\" \"/>\n            <text variable=\"container-title\" font-style=\"italic\"/>\n            <text prefix=\", \" variable=\"collection-title\" font-style=\"italic\" suffix=\".\"/>\n            <!--\", unterreihe der zeitschrift/zeitung\" -->\n          </group>\n          <text prefix=\" \" macro=\"volumes\"/>\n          <text prefix=\". \" variable=\"publisher-place\"/>\n          <text prefix=\", \" variable=\"publisher\" form=\"long\"/>\n          <text macro=\"bibliography-year\" prefix=\" (\" suffix=\")\"/>\n          <text prefix=\", Nr.&#160;\" variable=\"issue\"/>\n          <text prefix=\", \" macro=\"pages\"/>\n          <text prefix=\". &#8212;&#160;\" variable=\"note\"/>\n          <text prefix=\" &#8212;&#160;ISBN&#160;\" variable=\"ISBN\"/>\n        </else-if>\n        <!-- keiner der oben genannten fälle -->\n        <else>\n          <group suffix=\".\">\n            <text prefix=\" \" macro=\"title\"/>\n            <text prefix=\", \" macro=\"editor\"/>\n            <text prefix=\". \" macro=\"recipient-show\"/>\n          </group>\n          <group prefix=\" \" suffix=\".\">\n            <text variable=\"container-title\" font-style=\"italic\"/>\n            <group prefix=\", \">\n              <text variable=\"volume\" font-style=\"italic\"/>\n              <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n            </group>\n            <text prefix=\", \" macro=\"pages\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/docbook-bibliography.md",
    "content": "```\n% pandoc -f docbook -t native --quiet\n<bibliodiv>\n<title>Document References</title>\n<bibliomixed>\n<bibliomisc><anchor xml:id=\"refTheFirst\" xreflabel=\"[1]\"/>[1] First reference</bibliomisc>\n</bibliomixed>\n<bibliomixed>\n<bibliomisc><anchor xml:id=\"refTheSecond\" xreflabel=\"[2]\"/>[2] Second reference</bibliomisc>\n</bibliomixed>\n<bibliomixed>\n<bibliomisc><anchor xml:id=\"refTheThird\" xreflabel=\"[3]\"/>[3] Third reference</bibliomisc>\n</bibliomixed>\n</bibliodiv>\n^D\n[ Header\n    1\n    ( \"\" , [] , [] )\n    [ Str \"Document\" , Space , Str \"References\" ]\n, Para\n    [ Span ( \"refTheFirst\" , [] , [] ) []\n    , Str \"[1]\"\n    , Space\n    , Str \"First\"\n    , Space\n    , Str \"reference\"\n    ]\n, Para\n    [ Span ( \"refTheSecond\" , [] , [] ) []\n    , Str \"[2]\"\n    , Space\n    , Str \"Second\"\n    , Space\n    , Str \"reference\"\n    ]\n, Para\n    [ Span ( \"refTheThird\" , [] , [] ) []\n    , Str \"[3]\"\n    , Space\n    , Str \"Third\"\n    , Space\n    , Str \"reference\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/dokuwiki-quote.md",
    "content": "```\n% pandoc -f dokuwiki -t native\n> <code>some\ncode\n</code>\n>> ok\n> then\n> more\n^D\n[ BlockQuote\n    [ CodeBlock ( \"\" , [] , [] ) \"some\\ncode\\n\"\n    , BlockQuote [ Plain [ Str \"ok\" ] ]\n    , Plain [ Str \"then\" , LineBreak , Str \"more\" ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/dots.md",
    "content": "```\n% pandoc -f latex -t native\n\\dots\n\n\\ldots\n\n\\vdots\n^D\n[ Para [ Str \"\\8230\" ]\n, Para [ Str \"\\8230\" ]\n, Para [ Str \"\\8942\" ]\n]\n```\n"
  },
  {
    "path": "test/command/duplicate_attributes.md",
    "content": "```\n% pandoc\n[span]{.foobar style=\"color:blue\" class=\"zip\" style=\"color:red\"}\n^D\n2> [WARNING] Ignoring duplicate attribute style=\"color:red\".\n<p><span class=\"foobar zip\" style=\"color:blue\">span</span></p>\n```\n"
  },
  {
    "path": "test/command/emoji.md",
    "content": "```\n% pandoc -t markdown+emoji -f markdown+emoji\n:smile:\n^D\n:smile:\n```\n\n```\n% pandoc -t markdown-emoji -f markdown+emoji\n:smile:\n^D\n😄\n```\n\n```\n% pandoc -t gfm -f markdown+emoji\n:smile:\n^D\n:smile:\n```\n\n```\n% pandoc -t gfm-emoji -f markdown+emoji\n:smile:\n^D\n😄\n```\n"
  },
  {
    "path": "test/command/empty_paragraphs.md",
    "content": "```\n% pandoc -f native -t docx -o - | pandoc -f docx -t native\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n[ Para [ Str \"hi\" ] , Para [ Str \"lo\" ] ]\n```\n\n```\n% pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx -t native\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n[ Para [ Str \"hi\" ] , Para [ Str \"lo\" ] ]\n```\n\n```\n% pandoc -f native -t docx -o - | pandoc -f docx+empty_paragraphs -t native\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n[ Para [ Str \"hi\" ] , Para [ Str \"lo\" ] ]\n```\n\n```\n% pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx+empty_paragraphs -t native\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n[ Para [ Str \"hi\" ]\n, Para []\n, Para []\n, Para [ Str \"lo\" ]\n]\n```\n\n```\n% pandoc -f native -t html5\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n<p>hi</p>\n<p>lo</p>\n```\n\n```\n% pandoc -f native -t html5+empty_paragraphs\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n<p>hi</p>\n<p></p>\n<p></p>\n<p>lo</p>\n```\n\n```\n% pandoc -f html+empty_paragraphs -t native\n<p>hi</p>\n<p></p>\n<p></p>\n<p>lo</p>\n^D\n[ Para [ Str \"hi\" ]\n, Para []\n, Para []\n, Para [ Str \"lo\" ]\n]\n```\n\n```\n% pandoc -f html -t native\n<p>hi</p>\n<p></p>\n<p></p>\n<p>lo</p>\n^D\n[ Para [ Str \"hi\" ] , Para [ Str \"lo\" ] ]\n```\n\n```\n% pandoc -f native -t opendocument+empty_paragraphs\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n<text:p text:style-name=\"Text_20_body\">hi</text:p>\n<text:p text:style-name=\"Text_20_body\"></text:p>\n<text:p text:style-name=\"Text_20_body\"></text:p>\n<text:p text:style-name=\"Text_20_body\">lo</text:p>\n```\n\n```\n% pandoc -f native -t opendocument\n[Para [Str \"hi\"], Para [], Para [], Para [Str \"lo\"]]\n^D\n<text:p text:style-name=\"Text_20_body\">hi</text:p>\n<text:p text:style-name=\"Text_20_body\">lo</text:p>\n```\n"
  },
  {
    "path": "test/command/figures-context.md",
    "content": "# Figure with one image, caption and label\n\n```\n% pandoc -t context -f html\n<figure>\n  <img src=\"mandrill.jpg\" />\n  <figcaption><q>The Mandrill</q>, a photo used in\n    image processing tests.</figcaption>\n</figure>\n^D\n\\startplacefigure[title={\\quotation{The Mandrill}, a photo used in image\nprocessing tests.}]\n{\\externalfigure[mandrill.jpg]}\n\\stopplacefigure\n```\n\n# Nested figures\n\n```\n% pandoc -t context -f html\n<figure id=\"test-images\">\n  <figure id=\"mandrill\">\n    <img src=\"../testing/mandrill.jpg\">\n    <figcaption><q>The Mandrill</q> is a commonly used test image.</figcaption>\n  </figure>\n  <figure id=\"peppers\">\n    <img src=\"../testing/peppers.webp\" >\n    <figcaption>Another test image. This one is called <q>peppers</q>.</figcaption>\n  </figure>\n  <figcaption>Signal processing test images.</figcaption>\n</figure>\n^D\n\\startplacefigure[reference=test-images,title={Signal processing test\nimages.}]\n\\startfloatcombination\n\\startplacefigure[reference=mandrill,title={\\quotation{The Mandrill} is\na commonly used test image.}]\n{\\externalfigure[../testing/mandrill.jpg]}\n\\stopplacefigure\n\n\\startplacefigure[reference=peppers,title={Another test image. This one\nis called \\quotation{peppers}.}]\n{\\externalfigure[../testing/peppers.webp]}\n\\stopplacefigure\n\n\\stopfloatcombination\n\\stopplacefigure\n```\n"
  },
  {
    "path": "test/command/figures-fb2.md",
    "content": "```\n% pandoc -f native -t fb2\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section><p>content</p></section></body></FictionBook>\n```\n"
  },
  {
    "path": "test/command/figures-haddock.md",
    "content": "```\n% pandoc -f native -t haddock\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\ncontent\n```\n"
  },
  {
    "path": "test/command/figures-html.md",
    "content": "# Writer\n\nHTML5 figure with caption and content.\n\n```\n% pandoc -f native -t html5\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Plain [Str \"caption\"]]) [Para [Str \"content\"]]]\n\n^D\n<figure id=\"fig-id\">\n<p>content</p>\n<figcaption>caption</figcaption>\n</figure>\n```\n\nHTML5 figure with NO caption and content.\n\n```\n% pandoc -f native -t html5\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\n<figure id=\"fig-id\">\n<p>content</p>\n</figure>\n```\n\nHTML4 figure with caption and content.\n\n```\n% pandoc -f native -t html4\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Plain [Str \"caption\"]]) [Para [Str \"content\"]]]\n\n^D\n<div class=\"float\" id=\"fig-id\">\n<p>content</p>\n<div class=\"figcaption\">caption</div>\n</div>\n```\n\nHTML4 figure with NO caption and content.\n\n```\n% pandoc -f native -t html4\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\n<div class=\"float\" id=\"fig-id\">\n<p>content</p>\n</div>\n```\n\n# Reader\n\nFigure with caption and multiple elements.\n\n```\n% pandoc -f html -t native\n<figure class=\"important\">\n  <img src=\"../media/rId25.jpg\" />\n  <ul> <li> ITEM </li> </ul>\n  <figcaption> CAP2 </figcaption>\n</figure>\n^D\n[ Figure\n    ( \"\" , [ \"important\" ] , [] )\n    (Caption Nothing [ Plain [ Str \"CAP2\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"../media/rId25.jpg\" , \"\" ) ]\n    , BulletList [ [ Plain [ Str \"ITEM\" ] ] ]\n    ]\n]\n```\n\nFigure without caption.\n\n```\n% pandoc -f html -t native\n<figure class=\"important\">\n  <img src=\"../media/rId25.jpg\" />\n  <ul> <li> ITEM </li> </ul>\n</figure>\n^D\n[ Figure\n    ( \"\" , [ \"important\" ] , [] )\n    (Caption Nothing [])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"../media/rId25.jpg\" , \"\" ) ]\n    , BulletList [ [ Plain [ Str \"ITEM\" ] ] ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/figures-jats.md",
    "content": "Figure float with caption at the figure level.\n\n```\n% pandoc -f native -t jats\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Str \"Text\"],\nPara [Image (\"fig-id-2\",[],[]) [] (\"foo.png\", \"fig:\")]]]\n\n^D\n<fig id=\"fig-id\">\n  <caption><p>Caption</p></caption>\n  <p>Text</p>\n  <graphic id=\"fig-id-2\" mimetype=\"image\" mime-subtype=\"png\" xlink:href=\"foo.png\" xlink:title=\"fig:\" />\n</fig>\n```\n\nFigure float with caption and alt text.\n\n```\n% pandoc -f native -t jats\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Str \"Text\"],\nPara [Image (\"fig-id-2\",[],[]) [Str \"alt\"] (\"foo.png\", \"fig:\")]]]\n\n^D\n<fig id=\"fig-id\">\n  <caption><p>Caption</p></caption>\n  <p>Text</p>\n  <graphic id=\"fig-id-2\" mimetype=\"image\" mime-subtype=\"png\" xlink:href=\"foo.png\" xlink:title=\"fig:\">\n    <alt-text>alt</alt-text>\n  </graphic>\n</fig>\n```\n"
  },
  {
    "path": "test/command/figures-jira.md",
    "content": "A figure with title\n```\n% pandoc -f native -t jira\n[Figure (\"fig-id\",[],[(\"title\",\"This is the title\")]) (Caption Nothing []) []]\n^D\n{panel:title=This is the title}\n{anchor:fig-id}\n{panel}\n```\n"
  },
  {
    "path": "test/command/figures-latex.md",
    "content": "# Figure with one image, caption and label\n\n```\n% pandoc -f latex -t native\n\\begin{document}\n  \\begin{figure}\n    \\includegraphics{../../media/rId25.jpg}\n    \\caption{CAP}\n    \\label{LAB}\n  \\end{figure}\n\\end{document}\n^D\n[ Figure\n    ( \"LAB\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"CAP\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"../../media/rId25.jpg\" , \"\" )\n        ]\n    ]\n]\n```\n\n# Nested figures\n\n```\n% pandoc -f latex -t native\n\\begin{figure}\n  \\begin{subfigure}[b]{0.5\\textwidth}\n    \\begin{subfigure}[b]{0.5\\textwidth}\n      \\centering\n      \\includegraphics{test/media/rId25.jpg}\n      \\caption{CAP1.1}\n    \\end{subfigure}\n    \\begin{subfigure}[b]{0.5\\textwidth}\n      \\centering\n      \\includegraphics{test/media/rId25.jpg}\n      \\caption{CAP1.2}\n    \\end{subfigure}\n    \\caption{CAP1}\n    \\label{fig:inner1}\n  \\end{subfigure}\n  \\begin{subfigure}[b]{0.5\\textwidth}\n    \\includegraphics{test/media/rId25.jpg}\n    \\caption{CAP2}\n    \\label{fig:inner2}\n  \\end{subfigure}\n  \\caption{CAP}\n  \\label{fig:outer}\n\\end{figure}\n^D\n[ Figure\n    ( \"fig:outer\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"CAP\" ] ])\n    [ Figure\n        ( \"fig:inner1\" , [] , [] )\n        (Caption Nothing [ Plain [ Str \"CAP1\" ] ])\n        [ Figure\n            ( \"\" , [] , [] )\n            (Caption Nothing [ Plain [ Str \"CAP1.1\" ] ])\n            [ Plain\n                [ Image\n                    ( \"\" , [] , [] ) [] ( \"test/media/rId25.jpg\" , \"\" )\n                ]\n            ]\n        , Figure\n            ( \"\" , [] , [] )\n            (Caption Nothing [ Plain [ Str \"CAP1.2\" ] ])\n            [ Plain\n                [ Image\n                    ( \"\" , [] , [] ) [] ( \"test/media/rId25.jpg\" , \"\" )\n                ]\n            ]\n        ]\n    , Figure\n        ( \"fig:inner2\" , [] , [] )\n        (Caption Nothing [ Plain [ Str \"CAP2\" ] ])\n        [ Plain\n            [ Image ( \"\" , [] , [] ) [] ( \"test/media/rId25.jpg\" , \"\" )\n            ]\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/figures-markdown.md",
    "content": "Figure float with caption at the figure level.\n\n```\n% pandoc -f native -t markdown\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"fig:\")]]]\n\n^D\n<figure id=\"fig-id\">\n<p><img src=\"foo.png\" title=\"fig:\" /></p>\n<figcaption><p>Caption</p></figcaption>\n</figure>\n```\n"
  },
  {
    "path": "test/command/figures-mediawiki.md",
    "content": "Figure float with caption at the figure level.\n\n```\n% pandoc -f native -t mediawiki\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"fig:\")]]]\n\n^D\n<div id=\"fig-id\" class=\"figure\">\n[[File:foo.png|thumb|none]]\n</div>\n```\n"
  },
  {
    "path": "test/command/figures-org.md",
    "content": "```\n% pandoc -f native -t org\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\n<<fig-id>>\ncontent\n```\n\n```\n% pandoc -f native -t org\n[Figure (\"\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\ncontent\n```\n"
  },
  {
    "path": "test/command/figures-rst.md",
    "content": "Figure float with caption at the figure level.\n\n```\n% pandoc -f native -t rst\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"fig:\")]]]\n\n^D\n.. figure:: foo.png\n   name: fig-id\n   :alt: fig:\n\n   Caption\n```\n"
  },
  {
    "path": "test/command/figures-texinfo.md",
    "content": "Figure float with caption at the figure level.\n\n```\n% pandoc -f native -t texinfo\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"fig:\")]]]\n\n^D\n@node Top\n@top Top\n\n@float Figure\n@image{foo,,,,png}\n@caption{Caption}\n@end float\n```\n\nFloat that has no caption and doesn't contain a `SimpleFigure`\n\n```\n% pandoc -f native -t texinfo\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"\")]]]\n\n^D\n@node Top\n@top Top\n\n@float\n@image{foo,,,,png}\n@end float\n```\n\nTable float with caption at the figure level.\n\n```\n% pandoc -f native -t texinfo\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]])\n[Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Fruit\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Price\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Quantity\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Apple\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"25\",Space,Str \"cents\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"33\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"\\\"Navel\\\"\",Space,Str \"Orange\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"35\",Space,Str \"cents\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"22\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"45\"]]]])]\n (TableFoot (\"\",[],[])\n [])]]\n\n^D\n@node Top\n@top Top\n\n@float Table\n@multitable {\"Navel\" Orange} {35 cents} {Quantity} \n@headitem \nFruit\n @tab Price\n @tab Quantity\n@item \nApple\n @tab 25 cents\n @tab 33\n@item \n\"Navel\" Orange\n @tab 35 cents\n @tab 22\n@item \n45\n@end multitable\n@caption{Caption}\n@end float\n```\n\nFloat the isn't a table nor a figure.\n\n```\n% pandoc -f native -t texinfo\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para[ Str \"Caption\"]]) [Para [Str \"Content\"]]]\n\n^D\n@node Top\n@top Top\n\n@float\nContent\n@caption{Caption}\n@end float\n```\n"
  },
  {
    "path": "test/command/figures-textile.md",
    "content": "```\n% pandoc -f native -t textile\n[Figure (\"fig-id\",[],[]) (Caption Nothing [Para [Str \"Caption\"]]) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"\")]]]\n\n^D\n<figure id=\"fig-id\">\n\n<figcaption>\n\nCaption\n\n</figcaption>\n\n!foo.png!\n\n\n</figure>\n```\n\n```\n% pandoc -f native -t textile\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Image (\"\",[],[]) [] (\"foo.png\", \"\")]]]\n\n^D\n<figure id=\"fig-id\">\n\n!foo.png!\n\n\n</figure>\n```\n"
  },
  {
    "path": "test/command/figures-xwiki.md",
    "content": "```\n% pandoc -f native -t xwiki\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\n(((\n{{id name=\"fig-id\" /}}content\n\n)))\n```\n"
  },
  {
    "path": "test/command/figures-zimwiki.md",
    "content": "```\n% pandoc -f native -t zimwiki\n[Figure (\"fig-id\",[],[]) (Caption Nothing []) [Para [Str \"content\"]]]\n\n^D\ncontent\n\n\n```\n"
  },
  {
    "path": "test/command/file1.txt",
    "content": "# Zed\n\n[foo]: bar\n\n[foo]\nand [Zed](#zed)\nand [other Zed](command/file2.txt#zed)\nand [other file](command/file2.txt)\nand [foreign Zed](c.md#zed)\n"
  },
  {
    "path": "test/command/file2.txt",
    "content": "## Zed\n\n[foo]: baz\n\n[foo]\n"
  },
  {
    "path": "test/command/gfm.md",
    "content": "gfm tests:\n\n```\n% pandoc -f gfm -t native\n| Fruit | Price |\n| ----- | ----: |\n| apple | 0.13  |\n| orange|1.12|\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Fruit\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Price\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"apple\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0.13\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"orange\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1.12\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f gfm -t native\n~~stricken out~~\n^D\n[ Para [ Strikeout [ Str \"stricken\" , Space , Str \"out\" ] ]\n]\n```\n\n```\n% pandoc -f gfm -t native\n# Header\n## Header\n# -foo-bar_baz\n^D\n[ Header 1 ( \"header\" , [] , [] ) [ Str \"Header\" ]\n, Header 2 ( \"header-1\" , [] , [] ) [ Str \"Header\" ]\n, Header\n    1 ( \"-foo-bar_baz\" , [] , [] ) [ Str \"-foo-bar_baz\" ]\n]\n```\n\n```\n% pandoc -f gfm -t native\nMy:thumbsup:emoji:heart:\n^D\n[ Para\n    [ Str \"My\"\n    , Span\n        ( \"\" , [ \"emoji\" ] , [ ( \"data-emoji\" , \"thumbsup\" ) ] )\n        [ Str \"\\128077\" ]\n    , Str \"emoji\"\n    , Span\n        ( \"\" , [ \"emoji\" ] , [ ( \"data-emoji\" , \"heart\" ) ] )\n        [ Str \"\\10084\\65039\" ]\n    ]\n]\n```\n\n```\n% pandoc -f gfm -t native\n\"hi\"\n^D\n[ Para [ Str \"\\\"hi\\\"\" ] ]\n```\n\n```\n% pandoc -f gfm+smart -t native\n\"hi\"\n^D\n[ Para [ Quoted DoubleQuote [ Str \"hi\" ] ] ]\n```\n\n```\n% pandoc -t gfm -f native\n[Table (\"\",[],[]) (Caption Nothing\n [Plain [Str \"The\",Space,Str \"caption.\"]])\n [(AlignDefault,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Fruit\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Price\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"apple\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0.13\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"orange\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1.12\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n| Fruit  | Price |\n|--------|------:|\n| apple  |  0.13 |\n| orange |  1.12 |\n\nThe caption.\n```\n\n```\n% pandoc -f gfm-smart -t gfm+smart\n“hi”\n^D\n\"hi\"\n```\n\n```\n% pandoc -f gfm+smart -t gfm-smart\n\"hi\"\n^D\n“hi”\n```\n\n```\n% pandoc -f gfm+smart -t gfm+smart\n\"hi\"\n^D\n\"hi\"\n```\n\n```\n% pandoc -f gfm+hard_line_breaks -t native\nhi\nhi\n^D\n[ Para [ Str \"hi\" , LineBreak , Str \"hi\" ] ]\n```\n\n```\n% pandoc -f gfm -t native\n- [ ] foo\n- [x] bar\n^D\n[ BulletList\n    [ [ Plain [ Str \"\\9744\" , Space , Str \"foo\" ] ]\n    , [ Plain [ Str \"\\9746\" , Space , Str \"bar\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f gfm-task_lists -t native\n- [ ] foo\n- [x] bar\n^D\n[ BulletList\n    [ [ Plain [ Str \"[\" , Space , Str \"]\" , Space , Str \"foo\" ]\n      ]\n    , [ Plain [ Str \"[x]\" , Space , Str \"bar\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f gfm -t gfm\n- [ ] foo\n- [x] bar\n^D\n- [ ] foo\n- [x] bar\n```\n"
  },
  {
    "path": "test/command/harvard-university-of-kent.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"en-GB\">\n  <info>\n    <title>University of Kent - Harvard</title>\n    <id>http://www.zotero.org/styles/harvard-university-of-kent</id>\n    <link href=\"http://www.zotero.org/styles/harvard-university-of-kent\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/harvard-cardiff-university-biosi\" rel=\"template\"/>\n    <link href=\"http://www.kent.ac.uk/ai/Harvard-Style-Guide-July-2014.pdf\" rel=\"documentation\"/>\n    <author>\n      <name>Sebastian Karcher</name>\n    </author>\n    <category citation-format=\"author-date\"/>\n    <category field=\"generic-base\"/>\n    <summary>The Harvard author-date style - adapted for the University of Kent</summary>\n    <updated>2012-09-27T22:06:38+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <macro name=\"editor\">\n    <names variable=\"editor\" delimiter=\", \">\n      <name name-as-sort-order=\"all\" and=\"text\" sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"never\"/>\n      <label form=\"short\" prefix=\" \"/>\n    </names>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name name-as-sort-order=\"all\" and=\"text\" sort-separator=\", \" initialize-with=\".\" delimiter-precedes-last=\"never\" delimiter=\", \"/>\n      <label form=\"short\" prefix=\" \"/>\n      <et-al font-style=\"italic\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <text macro=\"title-substitute\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"text\" delimiter=\", \" delimiter-precedes-last=\"never\" initialize-with=\". \"/>\n      <et-al font-style=\"italic\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <text macro=\"title-substitute\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if variable=\"URL\">\n        <group delimiter=\" \">\n          <group delimiter=\": \">\n            <text term=\"available at\" text-case=\"capitalize-first\"/>\n            <text variable=\"URL\"/>\n          </group>\n          <group prefix=\"[\" suffix=\"]\" delimiter=\": \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date variable=\"accessed\">\n              <date-part name=\"day\" suffix=\" \"/>\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song thesis webpage\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\"/>\n      </if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-substitute\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song thesis webpage\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\"/>\n      </if>\n      <else-if type=\"broadcast\">\n        <choose>\n          <if variable=\"container-title\">\n            <text variable=\"title\"/>\n          </if>\n          <else>\n            <text variable=\"title\" font-style=\"italic\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"thesis\">\n        <text variable=\"publisher\"/>\n      </if>\n      <else-if type=\"graphic\">\n        <text variable=\"archive\"/>\n      </else-if>\n      <else>\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"year-date\">\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <number variable=\"edition\" form=\"ordinal\"/>\n          <text term=\"edition\" form=\"short\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" suffix=\".\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"online\">\n    <choose>\n      <if variable=\"medium\">\n        <text variable=\"medium\" prefix=\"[\" suffix=\"]\"/>\n      </if>\n      <else-if variable=\"URL\">\n        <text term=\"online\" text-case=\"capitalize-first\" prefix=\"[\" suffix=\"]\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"broadcast-info\">\n    <choose>\n      <if type=\"broadcast\">\n        <group delimiter=\". \">\n          <text variable=\"container-title\" font-style=\"italic\"/>\n          <text variable=\"number\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"pages\">\n    <group>\n      <label variable=\"page\" form=\"short\" suffix=\" \"/>\n      <text variable=\"page\"/>\n    </group>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\">\n    <layout prefix=\"(\" suffix=\")\" delimiter=\"; \">\n      <group delimiter=\", \">\n        <group delimiter=\" \">\n          <text macro=\"author-short\"/>\n          <text macro=\"year-date\"/>\n        </group>\n        <group>\n          <label variable=\"locator\" form=\"short\"/>\n          <text variable=\"locator\"/>\n        </group>\n      </group>\n    </layout>\n  </citation>\n  <bibliography et-al-min=\"4\" et-al-use-first=\"1\" hanging-indent=\"true\">\n    <sort>\n      <key macro=\"author\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout suffix=\".\">\n      <text macro=\"author\"/>\n      <date variable=\"issued\" prefix=\" (\" suffix=\").\">\n        <date-part name=\"year\"/>\n      </date>\n      <choose>\n        <if type=\"book broadcast graphic legal_case motion_picture report song\" match=\"any\">\n          <group prefix=\" \" delimiter=\". \" suffix=\".\">\n            <text macro=\"title\"/>\n            <text macro=\"broadcast-info\"/>\n            <text macro=\"online\"/>\n            <group delimiter=\" \">\n              <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n              <text variable=\"volume\"/>\n            </group>\n            <text macro=\"edition\"/>\n            <text macro=\"editor\"/>\n            <text variable=\"collection-title\"/>\n            <text variable=\"collection-number\" prefix=\"Number \"/>\n            <text macro=\"publisher\"/>\n            <text variable=\"dimensions\"/>\n          </group>\n        </if>\n        <else-if type=\"chapter paper-conference\" match=\"any\">\n          <text macro=\"title\" prefix=\" \" suffix=\".\"/>\n          <group prefix=\" \" delimiter=\" \">\n            <text term=\"in\" text-case=\"capitalize-first\" suffix=\":\"/>\n            <text macro=\"editor\"/>\n            <text variable=\"container-title\" font-style=\"italic\" suffix=\".\" text-case=\"title\"/>\n            <text macro=\"edition\"/>\n            <group suffix=\".\" delimiter=\", \">\n              <text macro=\"publisher\"/>\n              <text macro=\"pages\"/>\n            </group>\n          </group>\n        </else-if>\n        <else-if type=\"thesis\">\n          <group prefix=\" \" delimiter=\". \" suffix=\".\">\n            <text macro=\"title\"/>\n            <group delimiter=\", \">\n              <text variable=\"genre\"/>\n              <text macro=\"publisher\"/>\n            </group>\n          </group>\n        </else-if>\n        <else-if type=\"webpage\">\n          <group prefix=\" \" suffix=\".\">\n            <group delimiter=\" \" suffix=\".\">\n              <text macro=\"title\"/>\n              <text macro=\"online\"/>\n            </group>\n            <text macro=\"edition\"/>\n          </group>\n        </else-if>\n        <else>\n          <group suffix=\".\">\n            <text macro=\"title\" prefix=\" \"/>\n            <text macro=\"editor\" prefix=\" \"/>\n          </group>\n          <group prefix=\" \" suffix=\".\">\n            <group delimiter=\" \">\n              <text variable=\"container-title\" font-style=\"italic\"/>\n              <text macro=\"online\"/>\n            </group>\n            <text variable=\"volume\" font-weight=\"bold\" prefix=\" \"/>\n            <text variable=\"page\" prefix=\":\"/>\n          </group>\n        </else>\n      </choose>\n      <text prefix=\". \" macro=\"access\" suffix=\".\"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/hspace.md",
    "content": "`\\hspace` and `\\vspace` should count as both block and inline.\n\nHere they need to be inline:\n```\n% pandoc -f markdown+raw_tex -t native\n\\begin{figure}\n\\includegraphics{lalune.jpg}\n\\caption{lalune \\hspace{2em} \\vspace{1em} bloo}\n\\end{figure}\n^D\n[ RawBlock\n    (Format \"tex\")\n    \"\\\\begin{figure}\\n\\\\includegraphics{lalune.jpg}\\n\\\\caption{lalune \\\\hspace{2em} \\\\vspace{1em} bloo}\\n\\\\end{figure}\"\n]\n```\n\nHere block:\n```\n% pandoc -f markdown+raw_tex -t native\n\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\wedge Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}\n\\hspace{1em}\n\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\vee Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}\n^D\n[ RawBlock\n    (Format \"tex\")\n    \"\\\\begin{tabular}[t]{cc|c}\\n\\\\(P\\\\) & \\\\(Q\\\\) & \\\\(P\\\\wedge Q\\\\)\\\\\\\\\\n\\\\hline\\nT & T &\\\\\\\\\\nT & F &\\\\\\\\\\nF & T &\\\\\\\\\\nF & F &\\\\\\\\\\n\\\\end{tabular}\\n\\\\hspace{1em}\\n\\\\begin{tabular}[t]{cc|c}\\n\\\\(P\\\\) & \\\\(Q\\\\) & \\\\(P\\\\vee Q\\\\)\\\\\\\\\\n\\\\hline\\nT & T &\\\\\\\\\\nT & F &\\\\\\\\\\nF & T &\\\\\\\\\\nF & F &\\\\\\\\\\n\\\\end{tabular}\"\n]\n```\n\n```\n% pandoc -f markdown+raw_tex -t native\nhi\\hspace{1em}there\n^D\n[ Para\n    [ Str \"hi\"\n    , RawInline (Format \"tex\") \"\\\\hspace{1em}\"\n    , Str \"there\"\n    ]\n]\n```\n\n```\n% pandoc -f markdown+raw_tex -t native\nhi\n\n\\hspace{1em}\n\nthere\n^D\n[ Para [ Str \"hi\" ]\n, RawBlock (Format \"tex\") \"\\\\hspace{1em}\"\n, Para [ Str \"there\" ]\n]\n```\n"
  },
  {
    "path": "test/command/html-read-figure.md",
    "content": "```\n% pandoc -f html -t native\n<figure>\n  <img src=\"foo.png\" title=\"voyage\">\n  <figcaption>bar</figcaption>\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"bar\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"foo.png\" , \"voyage\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<figure>\n  <figcaption>bar</figcaption>\n  <img src=\"foo.png\" title=\"voyage\">\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"bar\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"foo.png\" , \"voyage\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<figure>\n  <img src=\"foo.png\" title=\"voyage\">\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"foo.png\" , \"voyage\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<figure>\n  <p><img src=\"foo.png\" title=\"voyage\"></p>\n  <figcaption>bar</figcaption>\n</figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"bar\" ] ])\n    [ Para\n        [ Image ( \"\" , [] , [] ) [] ( \"foo.png\" , \"voyage\" ) ]\n    ]\n]\n```\n\n```\n% pandoc -f html -t native\n<figure><img src=\"foo.png\" title=\"voyage\" alt=\"this is ignored\"><figcaption>bar <strong>baz</strong></figcaption></figure>\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain [ Str \"bar\" , Space , Strong [ Str \"baz\" ] ] ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [] )\n            [ Str \"this\" , Space , Str \"is\" , Space , Str \"ignored\" ]\n            ( \"foo.png\" , \"voyage\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/html-trim-definition-list-terms.md",
    "content": "```\n% pandoc -f html -t native\n<dl>\n    <dt>\n    foo\n    bar\n    </dt>\n    <dt>\n    baz\n    </dt>\n    <dd>test</dd>\n</dl>\n^D\n[ DefinitionList\n    [ ( [ Str \"foo\"\n        , SoftBreak\n        , Str \"bar\"\n        , LineBreak\n        , Str \"baz\"\n        ]\n      , [ [ Plain [ Str \"test\" ] ] ]\n      )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/html-writer-a-in-a.md",
    "content": "a is not allowed inside a in HTML, so we remove links in link text:\n```\n% pandoc -f native -t html\n[ Link (\"\",[],[]) [Link (\"\",[],[]) [Str \"Lo\"] (\"url2\",\"\") ] (\"url\",\"\") ]\n^D\n<a href=\"url\"><span>Lo</span></a>\n```\n"
  },
  {
    "path": "test/command/hyphenat.md",
    "content": "```\n% pandoc -f latex -t native\nelectromagnetic\\hyp{}endioscopy\n^D\n[ Para [ Str \"electromagnetic-endioscopy\" ] ]\n```\n\n```\n% pandoc -f latex -t native\nC\\colonhyp\\bshyp{}Windows\\bshyp\n^D\n[ Para [ Str \"C:\\173\\\\\\173Windows\\\\\\173\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\fshyp{}usr\\fshyp{}share\\fshyp\n^D\n[ Para [ Str \"/\\173usr/\\173share/\\173\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\fshyp{}home\\fshyp{}schrieveslaach\\fshyp\\dothyp{}m2\n^D\n[ Para [ Str \"/\\173home/\\173schrieveslaach/\\173.\\173m2\" ] ]\n```\n\n```\n% pandoc -f latex -t native\n\\nohyphens{Pneumonoultramicroscopicsilicovolcanoconiosis}\n^D\n[ Para\n    [ Str \"Pneumonoultramicroscopicsilicovolcanoconiosis\" ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\textnhtt{Pneumonoultramicroscopicsilicovolcanoconiosis}\n^D\n[ Para\n    [ Code\n        ( \"\" , [] , [] )\n        \"Pneumonoultramicroscopicsilicovolcanoconiosis\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\nhttfamily{Pneumonoultramicroscopicsilicovolcanoconiosis}\n^D\n[ Para\n    [ Code\n        ( \"\" , [] , [] )\n        \"Pneumonoultramicroscopicsilicovolcanoconiosis\"\n    ]\n]\n```\n\n"
  },
  {
    "path": "test/command/ieee.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\">\n  <info>\n    <title>IEEE</title>\n    <id>http://www.zotero.org/styles/ieee</id>\n    <link href=\"http://www.zotero.org/styles/ieee\" rel=\"self\"/>\n    <link href=\"http://www.ieee.org/documents/style_manual.pdf\" rel=\"documentation\"/>\n    <link href=\"http://www.ieee.org/documents/auinfo07.pdf\" rel=\"documentation\"/>\n    <author>\n      <name>Michael Berkowitz</name>\n      <email>mberkowi@gmu.edu</email>\n    </author>\n    <contributor>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </contributor>\n    <contributor>\n      <name>Rintze Zelle</name>\n      <uri>http://twitter.com/rintzezelle</uri>\n    </contributor>\n    <contributor>\n      <name>Stephen Frank</name>\n      <uri>http://www.zotero.org/sfrank</uri>\n    </contributor>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <category citation-format=\"numeric\"/>\n    <category field=\"engineering\"/>\n    <category field=\"generic-base\"/>\n    <updated>2013-12-17T18:04:02+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"chapter\" form=\"short\">ch.</term>\n      <term name=\"presented at\">presented at the</term>\n      <term name=\"available at\">available</term>\n    </terms>\n  </locale>\n  <!-- Macros -->\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"issued\">\n    <choose>\n      <if type=\"article-journal report\" match=\"any\">\n        <date variable=\"issued\">\n          <date-part name=\"month\" form=\"short\" suffix=\" \"/>\n          <date-part name=\"year\" form=\"long\"/>\n        </date>\n      </if>\n      <else-if type=\" bill book chapter graphic legal_case legislation motion_picture paper-conference song thesis\" match=\"any\">\n        <date variable=\"issued\">\n          <date-part name=\"year\" form=\"long\"/>\n        </date>\n      </else-if>\n      <else>\n        <date variable=\"issued\">\n          <date-part name=\"day\" form=\"numeric-leading-zeros\" suffix=\"-\"/>\n          <date-part name=\"month\" form=\"short\" suffix=\"-\" strip-periods=\"true\"/>\n          <date-part name=\"year\" form=\"long\"/>\n        </date>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name initialize-with=\". \" delimiter=\", \" and=\"text\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"capitalize-first\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name initialize-with=\". \" delimiter=\", \" and=\"text\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"capitalize-first\"/>\n    </names>\n  </macro>\n  <macro name=\"locators\">\n    <group delimiter=\", \">\n      <text macro=\"edition\"/>\n      <group delimiter=\" \">\n        <text term=\"volume\" form=\"short\"/>\n        <number variable=\"volume\" form=\"numeric\"/>\n      </group>\n      <group delimiter=\" \">\n        <number variable=\"number-of-volumes\" form=\"numeric\"/>\n        <text term=\"volume\" form=\"short\" plural=\"true\"/>\n      </group>\n      <group delimiter=\" \">\n        <text term=\"issue\" form=\"short\"/>\n        <number variable=\"issue\" form=\"numeric\"/>\n      </group>\n    </group>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </if>\n      <else>\n        <text variable=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\" bill book chapter graphic legal_case legislation motion_picture paper-conference song\" match=\"any\">\n        <group delimiter=\": \">\n          <text variable=\"publisher-place\"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </if>\n      <else>\n        <group delimiter=\", \">\n          <text variable=\"publisher\"/>\n          <text variable=\"publisher-place\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"event\">\n    <choose>\n      <if type=\"paper-conference speech\" match=\"any\">\n        <choose>\n          <!-- Published Conference Paper -->\n          <if variable=\"container-title\">\n            <group delimiter=\", \">\n              <group delimiter=\" \">\n                <text term=\"in\"/>\n                <text variable=\"container-title\" font-style=\"italic\"/>\n              </group>\n              <text variable=\"event-place\"/>\n            </group>\n          </if>\n          <!-- Unpublished Conference Paper -->\n          <else>\n            <group delimiter=\", \">\n              <group delimiter=\" \">\n                <text term=\"presented at\"/>\n                <text variable=\"event\"/>\n              </group>\n              <text variable=\"event-place\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if type=\"webpage\">\n        <choose>\n          <if variable=\"URL\">\n            <group delimiter=\". \">\n              <text term=\"online\" prefix=\"[\" suffix=\"]\" text-case=\"capitalize-first\"/>\n              <group delimiter=\": \">\n                <text term=\"available at\" text-case=\"capitalize-first\"/>\n                <text variable=\"URL\"/>\n              </group>\n              <group prefix=\"[\" suffix=\"]\" delimiter=\": \">\n                <text term=\"accessed\" text-case=\"capitalize-first\"/>\n                <date variable=\"accessed\">\n                  <date-part name=\"day\" form=\"numeric-leading-zeros\" suffix=\"-\"/>\n                  <date-part name=\"month\" form=\"short\" suffix=\"-\" strip-periods=\"true\"/>\n                  <date-part name=\"year\" form=\"long\"/>\n                </date>\n              </group>\n            </group>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"page\">\n    <group>\n      <label variable=\"page\" form=\"short\" suffix=\" \"/>\n      <text variable=\"page\"/>\n    </group>\n  </macro>\n  <macro name=\"citation-locator\">\n    <group delimiter=\" \">\n      <choose>\n        <if locator=\"page\">\n          <label variable=\"locator\" form=\"short\"/>\n        </if>\n        <else>\n          <label variable=\"locator\" form=\"short\" text-case=\"capitalize-first\"/>\n        </else>\n      </choose>\n      <text variable=\"locator\"/>\n    </group>\n  </macro>\n  <!-- Citation -->\n  <citation collapse=\"citation-number\">\n    <sort>\n      <key variable=\"citation-number\"/>\n    </sort>\n    <layout delimiter=\", \">\n      <group prefix=\"[\" suffix=\"]\" delimiter=\", \">\n        <text variable=\"citation-number\"/>\n        <text macro=\"citation-locator\"/>\n      </group>\n    </layout>\n  </citation>\n  <!-- Bibliography -->\n  <bibliography entry-spacing=\"0\" second-field-align=\"flush\">\n    <layout suffix=\".\">\n      <!-- Citation Number -->\n      <text variable=\"citation-number\" prefix=\"[\" suffix=\"]\"/>\n      <!-- Author(s) -->\n      <text macro=\"author\" suffix=\", \"/>\n      <!-- Rest of Citation -->\n      <choose>\n        <!-- Specific Formats -->\n        <if type=\"article-journal\">\n          <group delimiter=\", \">\n            <text macro=\"title\"/>\n            <text variable=\"container-title\" font-style=\"italic\" form=\"short\"/>\n            <text macro=\"locators\"/>\n            <text macro=\"page\"/>\n            <text macro=\"issued\"/>\n          </group>\n        </if>\n        <else-if type=\"paper-conference speech\" match=\"any\">\n          <group delimiter=\", \">\n            <text macro=\"title\"/>\n            <text macro=\"event\"/>\n            <text macro=\"issued\"/>\n            <text macro=\"locators\"/>\n            <text macro=\"page\"/>\n          </group>\n        </else-if>\n        <else-if type=\"report\">\n          <group delimiter=\", \">\n            <text macro=\"title\"/>\n            <text macro=\"publisher\"/>\n            <group delimiter=\" \">\n              <text variable=\"genre\"/>\n              <text variable=\"number\"/>\n            </group>\n            <text macro=\"issued\"/>\n          </group>\n        </else-if>\n        <else-if type=\"thesis\">\n          <group delimiter=\", \">\n            <text macro=\"title\"/>\n            <text variable=\"genre\"/>\n            <text macro=\"publisher\"/>\n            <text macro=\"issued\"/>\n          </group>\n        </else-if>\n        <else-if type=\"webpage post-weblog\" match=\"any\">\n          <group delimiter=\", \" suffix=\". \">\n            <text macro=\"title\"/>\n            <text variable=\"container-title\" font-style=\"italic\"/>\n            <text macro=\"issued\"/>\n          </group>\n          <text macro=\"access\"/>\n        </else-if>\n        <else-if type=\"patent\">\n          <group delimiter=\", \">\n            <text macro=\"title\"/>\n            <text variable=\"number\"/>\n            <text macro=\"issued\"/>\n          </group>\n        </else-if>\n        <!-- Generic/Fallback Formats -->\n        <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n          <group delimiter=\", \" suffix=\". \">\n            <text macro=\"title\"/>\n            <text macro=\"locators\"/>\n          </group>\n          <group delimiter=\", \">\n            <text macro=\"publisher\"/>\n            <text macro=\"issued\"/>\n            <text macro=\"page\"/>\n          </group>\n        </else-if>\n        <else-if type=\"article-magazine article-newspaper broadcast interview manuscript map patent personal_communication song speech thesis webpage\" match=\"any\">\n          <group delimiter=\", \">\n            <text macro=\"title\"/>\n            <text variable=\"container-title\" font-style=\"italic\"/>\n            <text macro=\"locators\"/>\n            <text macro=\"publisher\"/>\n            <text macro=\"page\"/>\n            <text macro=\"issued\"/>\n          </group>\n        </else-if>\n        <else-if type=\"chapter paper-conference\" match=\"any\">\n          <group delimiter=\", \" suffix=\", \">\n            <text macro=\"title\"/>\n            <group delimiter=\" \">\n              <text term=\"in\"/>\n              <text variable=\"container-title\" font-style=\"italic\"/>\n            </group>\n            <text macro=\"locators\"/>\n          </group>\n          <text macro=\"editor\" suffix=\" \"/>\n          <group delimiter=\", \">\n            <text macro=\"publisher\"/>\n            <text macro=\"issued\"/>\n            <text macro=\"page\"/>\n          </group>\n        </else-if>\n        <else>\n          <group delimiter=\", \" suffix=\". \">\n            <text macro=\"title\"/>\n            <text variable=\"container-title\" font-style=\"italic\"/>\n            <text macro=\"locators\"/>\n          </group>\n          <group delimiter=\", \">\n            <text macro=\"publisher\"/>\n            <text macro=\"page\"/>\n            <text macro=\"issued\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/ifstrequal.md",
    "content": "```\n% pandoc -f latex -t native\n\\ifstrequal{a}{b}{yes}{\\emph{no}}\n\\newcommand{\\h}[1]{\\ifstrequal{#1}{a}{\\'a}{#1}}\n\\h{a}\n\\h{b}\n^D\n[ Para\n    [ Emph [ Str \"no\" ]\n    , SoftBreak\n    , Str \"\\225\"\n    , SoftBreak\n    , Str \"b\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/indented-fences.md",
    "content": "`````\n% pandoc -t native\n  ```haskell\n  let x = y\nin y\n   ```\n^D\n[ CodeBlock ( \"\" , [ \"haskell\" ] , [] ) \"let x = y\\nin y\" ]\n`````\n`````\n% pandoc -t native\n ~~~ {.haskell}\n  let x = y\n in y +\ny +\n y\n~~~\n^D\n[ CodeBlock\n    ( \"\" , [ \"haskell\" ] , [] ) \" let x = y\\nin y +\\ny +\\ny\"\n]\n`````\n"
  },
  {
    "path": "test/command/input-with-endinput.md",
    "content": "```\n% pandoc --from=latex -t native\n\\begin{document}\nVisible\n\n\\include{command/bar-endinput}\n\nVisible\n\\end{document}\n^D\n[ Para [ Str \"Visible\" ]\n, Para [ Emph [ Str \"hi\" , Space , Str \"there\" ] ]\n, Para [ Str \"Visible\" ]\n]\n```\n"
  },
  {
    "path": "test/command/issue160.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" default-locale=\"en-US\">\n  <info>\n    <title>Issue 160 Test Style</title>\n    <id>issue-160-test</id>\n    <category citation-format=\"label\"/>\n    <updated>2017-02-04T19:31:46+0000</updated>\n  </info>\n  <citation>\n    <layout prefix=\"[\" suffix=\"]\" delimiter=\",\">\n      <text variable=\"citation-label\"/>\n    </layout>\n  </citation>\n  <bibliography>\n    <layout>\n      <text variable=\"citation-label\" prefix=\"[\" suffix=\"] \"/>\n      <group delimiter=\". \" suffix=\".\">\n        <names variable=\"author\">\n          <name delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        </names>\n        <text variable=\"title\"/>\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </group>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/issue437.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" default-locale=\"en-US\" version=\"1.0\">\n  <info>\n    <title>Minimal style to reproduce bug</title>\n    <id>http://www.example.org/styles/minimal-test-style</id>\n    <author>\n      <name>Nicolas Chachereau</name>\n      <email>nicolas@nchachereau.ch</email>\n    </author>\n    <updated>2020-01-27T14:27:45+01:00</updated>\n  </info>\n  <citation>\n    <layout>\n      <group delimiter=\", \">\n        <names variable=\"author\"/>\n        <text variable=\"title\"/>\n        <text variable=\"publisher-place\"/>\n        <date variable=\"issued\" form=\"numeric\" date-parts=\"year\"/>\n        <group delimiter=\"&#160;\">\n          <number variable=\"number-of-pages\"/>\n          <label variable=\"number-of-pages\"/>\n        </group>\n      </group>\n    </layout>\n  </citation>\n</style>\n"
  },
  {
    "path": "test/command/issue58.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"never\" page-range-format=\"chicago\">\n  <info>\n    <title>Chicago Manual of Style 16th edition (author-date) modif 2014-06-30</title>\n    <id></id>\n    <link href=\"\" rel=\"self\"/>\n    <link href=\"http://www.chicagomanualofstyle.org/tools_citationguide.html\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <contributor>\n      <name>Richard Karnesky</name>\n      <email>karnesky+zotero@gmail.com</email>\n      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>\n    </contributor>\n    <contributor>\n      <name>Andrew Dunning</name>\n      <email>andrew.dunning@utoronto.ca</email>\n    </contributor>\n    <category citation-format=\"author-date\"/>\n    <category field=\"generic-base\"/>\n    <summary>The author-date variant of the Chicago style</summary>\n    <updated>2014-05-23T03:53:32+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"editor\" form=\"verb-short\">ed.</term>\n      <term name=\"container-author\" form=\"verb\">by</term>\n      <term name=\"translator\" form=\"verb-short\">trans.</term>\n      <term name=\"editortranslator\" form=\"verb\">\n        <single>edited and translated by</single>\n        <multiple>edited and translated by</multiple>\n      </term>\n      <term name=\"translator\" form=\"short\">trans.</term>\n    </terms>\n  </locale>\n  <macro name=\"secondary-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"none\">\n        <names variable=\"editor translator\" delimiter=\". \">\n          <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n          <name and=\"text\" delimiter=\", \"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-contributors\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <group prefix=\", \" delimiter=\", \">\n          <names variable=\"container-author\" delimiter=\", \">\n            <label form=\"verb\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n          <names variable=\"editor translator\" delimiter=\", \">\n            <label form=\"verb\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"recipient\">\n    <choose>\n      <if type=\"personal_communication\">\n        <choose>\n          <if variable=\"genre\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n          <else>\n            <text term=\"letter\" text-case=\"capitalize-first\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n    <names variable=\"recipient\" delimiter=\", \">\n      <label form=\"verb\" prefix=\" \" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"noauthor-container-title\">\n    <choose>\n      <if variable=\"container-title\">\n        <choose>\n          <if type=\"article-journal article-magazine article-newspaper\" match=\"any\">\n            <text macro=\"container-title\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"contributors\">\n    <group delimiter=\". \">\n      <names variable=\"author\">\n        <name and=\"text\" name-as-sort-order=\"first\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <label form=\"short\" prefix=\", \"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n          <text macro=\"noauthor-container-title\"/>\n          <text macro=\"title\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"text\" delimiter=\", \" initialize-with=\". \"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"noauthor-container-title\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"interviewer\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" prefix=\" \" text-case=\"capitalize-first\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"archive\">\n    <group delimiter=\". \">\n      <text variable=\"archive_location\" text-case=\"capitalize-first\"/>\n      <text variable=\"archive\"/>\n      <text variable=\"archive-place\"/>\n    </group>\n  </macro>\n  <macro name=\"access\">\n    <group delimiter=\". \">\n      <choose>\n        <if type=\"graphic report\" match=\"any\">\n          <text macro=\"archive\"/>\n        </if>\n        <else-if type=\"article-journal bill book chapter legal_case legislation motion_picture paper-conference\" match=\"none\">\n          <text macro=\"archive\"/>\n        </else-if>\n      </choose>\n      <choose>\n        <if variable=\"issued\" match=\"none\">\n          <group delimiter=\" \">\n            <text term=\"accessed\" text-case=\"capitalize-first\"/>\n            <date variable=\"accessed\" delimiter=\" \">\n              <date-part name=\"month\"/>\n              <date-part name=\"day\"/>\n            </date>\n          </group>\n        </if>\n      </choose>\n      <choose>\n        <if type=\"legal_case\" match=\"none\">\n          <choose>\n            <if variable=\"DOI\">\n              <text variable=\"DOI\" prefix=\"doi:\"/>\n            </if>\n            <else>\n              <text variable=\"URL\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if variable=\"title\" match=\"none\">\n        <choose>\n          <if type=\"personal_communication\" match=\"none\">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"bill book graphic legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"title\" font-style=\"italic\"/>\n        <group prefix=\" (\" suffix=\")\" delimiter=\" \">\n          <text term=\"version\"/>\n          <text variable=\"version\"/>\n        </group>\n      </else-if>\n      <else-if variable=\"reviewed-author\">\n        <group delimiter=\", \">\n          <text variable=\"title\" font-style=\"italic\" prefix=\"Review of \"/>\n          <names variable=\"reviewed-author\">\n            <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"legal_case interview\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" text-case=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \" prefix=\". \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\" strip-periods=\"true\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" prefix=\". \"/>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"chapter  paper-conference\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \" prefix=\", \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" prefix=\", \"/>\n          </else>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\">\n            <text variable=\"volume\" prefix=\" \"/>\n            <group prefix=\" (\" suffix=\")\">\n              <choose>\n                <if variable=\"issue\">\n                  <text variable=\"issue\"/>\n                </if>\n                <else>\n                  <date variable=\"issued\">\n                    <date-part name=\"month\"/>\n                  </date>\n                </else>\n              </choose>\n            </group>\n          </if>\n          <else-if variable=\"issue\">\n            <group delimiter=\" \" prefix=\", \">\n              <text term=\"issue\" form=\"short\"/>\n              <text variable=\"issue\"/>\n              <date variable=\"issued\" prefix=\"(\" suffix=\")\">\n                <date-part name=\"month\"/>\n              </date>\n            </group>\n          </else-if>\n          <else>\n            <date variable=\"issued\" prefix=\", \">\n              <date-part name=\"month\"/>\n            </date>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"legal_case\">\n        <text variable=\"volume\" prefix=\", \"/>\n        <text variable=\"container-title\" prefix=\" \"/>\n        <text variable=\"page\" prefix=\" \"/>\n      </else-if>\n      <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <group prefix=\". \" delimiter=\". \">\n          <group>\n            <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/>\n            <number variable=\"volume\" form=\"numeric\"/>\n          </group>\n          <group>\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" prefix=\" \" plural=\"true\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"chapter paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"page\" match=\"none\">\n            <group prefix=\". \">\n              <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\" suffix=\" \"/>\n              <number variable=\"volume\" form=\"numeric\"/>\n            </group>\n          </if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locators-chapter\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <choose>\n          <if variable=\"page\">\n            <group prefix=\", \">\n              <text variable=\"volume\" suffix=\":\"/>\n              <text variable=\"page\"/>\n            </group>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locators-article\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <group prefix=\", \" delimiter=\", \">\n          <group>\n            <text variable=\"edition\" suffix=\" \"/>\n            <text term=\"edition\" prefix=\" \"/>\n          </group>\n          <group>\n            <text term=\"section\" form=\"short\" suffix=\" \"/>\n            <text variable=\"section\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume issue\" match=\"any\">\n            <text variable=\"page\" prefix=\": \"/>\n          </if>\n          <else>\n            <text variable=\"page\" prefix=\", \"/>\n          </else>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"point-locators\">\n    <choose>\n      <if variable=\"locator\">\n        <choose>\n          <if locator=\"page\" match=\"none\">\n            <choose>\n              <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n                <choose>\n                  <if variable=\"volume\">\n                    <group>\n                      <text term=\"volume\" form=\"short\" suffix=\" \"/>\n                      <number variable=\"volume\" form=\"numeric\"/>\n                      <label variable=\"locator\" form=\"short\" prefix=\", \" suffix=\" \"/>\n                    </group>\n                  </if>\n                  <else>\n                    <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n                  </else>\n                </choose>\n              </if>\n              <else>\n                <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n              </else>\n            </choose>\n          </if>\n          <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n            <number variable=\"volume\" form=\"numeric\" suffix=\":\"/>\n          </else-if>\n        </choose>\n        <text variable=\"locator\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-prefix\">\n    <text term=\"in\" text-case=\"capitalize-first\"/>\n  </macro>\n  <macro name=\"container-title\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text macro=\"container-prefix\" suffix=\" \"/>\n      </if>\n    </choose>\n    <choose>\n      <if type=\"legal_case\" match=\"none\">\n        <text variable=\"container-title\" text-case=\"title\" font-style=\"italic\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\": \">\n      <text variable=\"publisher-place\"/>\n      <text variable=\"publisher\"/>\n    </group>\n  </macro>\n  <macro name=\"date\">\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else-if variable=\"accessed\">\n        <date variable=\"accessed\">\n          <date-part name=\"year\"/>\n        </date>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"day-month\">\n    <date variable=\"issued\">\n      <date-part name=\"month\"/>\n      <date-part name=\"day\" prefix=\" \"/>\n    </date>\n  </macro>\n  <macro name=\"collection-title\">\n    <choose>\n      <if match=\"none\" type=\"article-journal\">\n        <choose>\n          <if match=\"none\" is-numeric=\"collection-number\">\n            <group delimiter=\", \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </if>\n          <else>\n            <group delimiter=\" \">\n              <text variable=\"collection-title\" text-case=\"title\"/>\n              <text variable=\"collection-number\"/>\n            </group>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"collection-title-journal\">\n    <choose>\n      <if type=\"article-journal\">\n        <group delimiter=\" \">\n          <text variable=\"collection-title\"/>\n          <text variable=\"collection-number\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"event\">\n    <group>\n      <text term=\"presented at\" suffix=\" \"/>\n      <text variable=\"event\"/>\n    </group>\n  </macro>\n  <macro name=\"description\">\n    <choose>\n      <if type=\"interview\">\n        <group delimiter=\". \">\n          <text macro=\"interviewer\"/>\n          <text variable=\"medium\" text-case=\"capitalize-first\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"medium\" text-case=\"capitalize-first\" prefix=\". \"/>\n      </else>\n    </choose>\n    <choose>\n      <if variable=\"title\" match=\"none\"/>\n      <else-if type=\"thesis personal_communication speech\" match=\"any\"/>\n      <else>\n        <group delimiter=\" \" prefix=\". \">\n          <text variable=\"genre\" text-case=\"capitalize-first\"/>\n          <choose>\n            <if type=\"report\">\n              <text variable=\"number\"/>\n            </if>\n          </choose>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if type=\"legal_case\">\n        <text variable=\"authority\" prefix=\". \"/>\n      </if>\n      <else-if type=\"speech\">\n        <group prefix=\". \" delimiter=\", \">\n          <group delimiter=\" \">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            <text macro=\"event\"/>\n          </group>\n          <text variable=\"event-place\"/>\n          <text macro=\"day-month\"/>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine personal_communication\" match=\"any\">\n        <text macro=\"day-month\" prefix=\", \"/>\n      </else-if>\n      <else>\n        <group prefix=\". \" delimiter=\", \">\n          <choose>\n            <if type=\"thesis\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n          </choose>\n          <text macro=\"publisher\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\" givenname-disambiguation-rule=\"primary-name\">\n    <layout prefix=\"(\" suffix=\")\" delimiter=\"; \">\n      <group delimiter=\", \">\n        <group delimiter=\" \">\n          <text macro=\"contributors-short\"/>\n          <text macro=\"date\"/>\n        </group>\n        <text macro=\"point-locators\"/>\n      </group>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"11\" et-al-use-first=\"7\" subsequent-author-substitute=\"&#8212;&#8212;&#8212;\" entry-spacing=\"0\">\n    <sort>\n      <key macro=\"contributors\"/>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\". \">\n        <text macro=\"contributors\"/>\n        <text macro=\"date\"/>\n        <text macro=\"title\"/>\n      </group>\n      <text macro=\"description\"/>\n      <text macro=\"secondary-contributors\" prefix=\". \"/>\n      <text macro=\"container-title\" prefix=\". \"/>\n      <text macro=\"container-contributors\"/>\n      <text macro=\"edition\"/>\n      <text macro=\"locators-chapter\"/>\n      <text macro=\"collection-title-journal\" prefix=\", \" suffix=\", \"/>\n      <text macro=\"locators\"/>\n      <text macro=\"collection-title\" prefix=\". \"/>\n      <text macro=\"issue\"/>\n      <text macro=\"locators-article\"/>\n      <text macro=\"access\" prefix=\". \"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/jabberwocky.md",
    "content": "```\n% pandoc -t plain -f markdown\n| 'Twas brillig, and the slithy toves\n|       Did gyre and gimble in the wabe:\n| All mimsy were the borogoves,\n|       And the mome raths outgrabe.\n|\n| \"Beware the Jabberwock, my son!\n|       The jaws that bite, the claws that catch!\n| Beware the Jubjub bird, and shun\n|       The frumious Bandersnatch!\"\n^D\n’Twas brillig, and the slithy toves\n      Did gyre and gimble in the wabe:\nAll mimsy were the borogoves,\n      And the mome raths outgrabe.\n\n“Beware the Jabberwock, my son!\n      The jaws that bite, the claws that catch!\nBeware the Jubjub bird, and shun\n      The frumious Bandersnatch!”\n```\n"
  },
  {
    "path": "test/command/jats-figure-alt-text.md",
    "content": "```\n% pandoc -f jats -t native\n<fig id=\"fig-1\">\n  <caption>\n    <p>bar</p>\n  </caption>\n  <alt-text>alternative-decription</alt-text>\n  <graphic xlink:href=\"foo.png\">\n    <alt-text>baz</alt-text> \n  </graphic>\n</fig>\n\n^D\n[ Figure\n    ( \"fig-1\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"bar\" ] ])\n    [ Plain [ Str \"alternative-decription\" ]\n    , Para\n        [ Image ( \"\" , [] , [] ) [ Str \"baz\" ] ( \"foo.png\" , \"\" ) ]\n    ]\n]\n```"
  },
  {
    "path": "test/command/latex-center.md",
    "content": "# `\\begin{center}`\n\n```\n% pandoc -f latex -t native\n\\begin{center}\nHello\n\\end{center}\n\n^D\n[ Div ( \"\" , [ \"center\" ] , [] ) [ Para [ Str \"Hello\" ] ] ]\n```\n\n"
  },
  {
    "path": "test/command/latex-color.md",
    "content": "# `\\textcolor{}{}`\n\n```\n% pandoc -f latex -t native\nHello \\textcolor{red}{World}\n^D\n[ Para\n    [ Str \"Hello\"\n    , Space\n    , Span\n        ( \"\" , [] , [ ( \"style\" , \"color: red\" ) ] ) [ Str \"World\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\textcolor{red}{Hello} World\n^D\n[ Para\n    [ Span\n        ( \"\" , [] , [ ( \"style\" , \"color: red\" ) ] ) [ Str \"Hello\" ]\n    , Space\n    , Str \"World\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nHello \\textcolor{blue}{\\textbf{World}}\n^D\n[ Para\n    [ Str \"Hello\"\n    , Space\n    , Span\n        ( \"\" , [] , [ ( \"style\" , \"color: blue\" ) ] )\n        [ Strong [ Str \"World\" ] ]\n    ]\n]\n```\n\n\n```\n% pandoc -f latex -t native\nHello \\textcolor{blue}{\\textbf{World}}.\n^D\n[ Para\n    [ Str \"Hello\"\n    , Space\n    , Span\n        ( \"\" , [] , [ ( \"style\" , \"color: blue\" ) ] )\n        [ Strong [ Str \"World\" ] ]\n    , Str \".\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\textcolor{orange}{\n\\begin{itemize}\t\n    \\item Item 1\n    \\item Item 2\n\\end{itemize}\n}\n^D\n[ Div\n    ( \"\" , [] , [ ( \"style\" , \"color: orange\" ) ] )\n    [ BulletList\n        [ [ Para [ Str \"Item\" , Space , Str \"1\" ] ]\n        , [ Para [ Str \"Item\" , Space , Str \"2\" ] ]\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\textcolor{blue}{\n\\begin{itemize}\n    \\item Item 1\n    \\item Item 2\n\\end{itemize}\n} some more text\n^D\n[ Div\n    ( \"\" , [] , [ ( \"style\" , \"color: blue\" ) ] )\n    [ BulletList\n        [ [ Para [ Str \"Item\" , Space , Str \"1\" ] ]\n        , [ Para [ Str \"Item\" , Space , Str \"2\" ] ]\n        ]\n    ]\n, Para\n    [ Str \"some\" , Space , Str \"more\" , Space , Str \"text\" ]\n]\n```\n\n# `\\colorbox{}{}`\n\n\n```\n% pandoc -f latex -t native\nHello \\colorbox{red}{World}\n^D\n[ Para\n    [ Str \"Hello\"\n    , Space\n    , Span\n        ( \"\" , [] , [ ( \"style\" , \"background-color: red\" ) ] )\n        [ Str \"World\" ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\colorbox{red}{Hello} World\n^D\n[ Para\n    [ Span\n        ( \"\" , [] , [ ( \"style\" , \"background-color: red\" ) ] )\n        [ Str \"Hello\" ]\n    , Space\n    , Str \"World\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nHello \\colorbox{blue}{\\textbf{World}}\n^D\n[ Para\n    [ Str \"Hello\"\n    , Space\n    , Span\n        ( \"\" , [] , [ ( \"style\" , \"background-color: blue\" ) ] )\n        [ Strong [ Str \"World\" ] ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nHello \\colorbox{blue}{\\textbf{World}}.\n^D\n[ Para\n    [ Str \"Hello\"\n    , Space\n    , Span\n        ( \"\" , [] , [ ( \"style\" , \"background-color: blue\" ) ] )\n        [ Strong [ Str \"World\" ] ]\n    , Str \".\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\colorbox{orange}{\n\\begin{minipage}{\\textwidth}\n\\begin{itemize}\t\n    \\item Item 1\n    \\item Item 2\n\\end{itemize}\n\\end{minipage}\n}\n^D\n[ Div\n    ( \"\" , [] , [ ( \"style\" , \"background-color: orange\" ) ] )\n    [ Div\n        ( \"\" , [ \"minipage\" ] , [] )\n        [ BulletList\n            [ [ Para [ Str \"Item\" , Space , Str \"1\" ] ]\n            , [ Para [ Str \"Item\" , Space , Str \"2\" ] ]\n            ]\n        ]\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\colorbox{blue}{\n\\begin{minipage}{\\textwidth}\n\\begin{itemize}\n    \\item Item 1\n    \\item Item 2\n\\end{itemize}\n\\end{minipage}\n} some more text\n^D\n[ Div\n    ( \"\" , [] , [ ( \"style\" , \"background-color: blue\" ) ] )\n    [ Div\n        ( \"\" , [ \"minipage\" ] , [] )\n        [ BulletList\n            [ [ Para [ Str \"Item\" , Space , Str \"1\" ] ]\n            , [ Para [ Str \"Item\" , Space , Str \"2\" ] ]\n            ]\n        ]\n    ]\n, Para\n    [ Str \"some\" , Space , Str \"more\" , Space , Str \"text\" ]\n]\n```\n"
  },
  {
    "path": "test/command/latex-command-comment.md",
    "content": "```\n% pandoc -f latex -t native\n\\emph%\n{hi}\n^D\n[ Para [ Emph [ Str \"hi\" ] ] ]\n```\n"
  },
  {
    "path": "test/command/latex-fontawesome.md",
    "content": "```\n% pandoc -f latex -t native\nCheck: \\faCheck\n^D\n[ Para [ Str \"Check:\" , Space , Str \"\\10003\" ] ]\n```\n\n```\n% pandoc -f latex -t native\nClose: \\faClose\n^D\n[ Para [ Str \"Close:\" , Space , Str \"\\10007\" ] ]\n```\n"
  },
  {
    "path": "test/command/latex-math-trailing-space.md",
    "content": "Test that trailing spaces before \\end{equation} don't create spurious paragraph breaks:\n\n```\n% pandoc -f latex -t latex\n\\begin{equation}\n  a\n \\end{equation}\n^D\n\\begin{equation}\n  a\n\\end{equation}\n```\n\nSame for align environment:\n\n```\n% pandoc -f latex -t latex\n\\begin{align}\n  x &= y \\\\\n \\end{align}\n^D\n\\begin{align}\n  x &= y \\\\\n\\end{align}\n```\n\nTest with multiple trailing spaces:\n\n```\n% pandoc -f latex -t latex\n\\begin{equation}\n  a + b\n   \\end{equation}\n^D\n\\begin{equation}\n  a + b\n\\end{equation}\n```\n"
  },
  {
    "path": "test/command/latex-tabular-column-specs.md",
    "content": "See https://groups.google.com/forum/#!topic/pandoc-discuss/_VXtqihCyDU.\n\n```\n% pandoc -f latex -t native\n\\begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}}\n\\toprule\n& f1 & f2 \\\\\n\\midrule\ne      & 0.5    &  4   \\\\\nf      & 0.5    & 5,5  \\\\\n\\bottomrule\n\\end{tabular}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Math InlineMath \"\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Math InlineMath \"f1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Math InlineMath \"f2\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"e\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"0.5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"4\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"f\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"0.5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Math InlineMath \"5,5\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/le-tapuscrit-note.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" default-locale=\"fr-FR\" version=\"1.0\" page-range-format=\"expanded\">\n  <info>\n    <title>Le tapuscrit (École des hautes études en sciences sociales) (note, French)</title>\n    <title-short>Tapuscrit-EHESS</title-short>\n    <id>http://www.zotero.org/styles/le-tapuscrit-note</id>\n    <link href=\"http://www.zotero.org/styles/le-tapuscrit-note\" rel=\"self\"/>\n    <link href=\"http://www.editions.ehess.fr/ouvrages/ouvrage/le-tapuscrit/\" rel=\"documentation\"/>\n    <author>\n      <name>Franziska Heimburger</name>\n      <email>zotero@franziska.fr</email>\n    </author>\n    <category citation-format=\"note\"/>\n    <category field=\"social_science\"/>\n    <category field=\"generic-base\"/>\n    <updated>2018-07-12T11:20:37+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"fr\">\n    <terms>\n      <term name=\"ordinal-01\">ère</term>\n      <term name=\"ordinal-02\">e</term>\n      <term name=\"ordinal-03\">e</term>\n      <term name=\"ordinal-04\">e</term>\n      <term name=\"cited\">op.&#160;cit.</term>\n      <term name=\"page\" form=\"short\">p.</term>\n      <term name=\"editor\" form=\"short\">\n        <single>ed.</single>\n        <multiple>eds.</multiple>\n      </term>\n      <term name=\"in\">dans</term>\n    </terms>\n  </locale>\n  <macro name=\"author\">\n    <choose>\n      <if variable=\"author\">\n        <names variable=\"author\">\n          <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n        </names>\n      </if>\n      <else-if variable=\"editor\">\n        <names variable=\"editor\">\n          <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n          <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n        </names>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"author-bib\">\n    <choose>\n      <if variable=\"author\">\n        <names variable=\"author\">\n          <name name-as-sort-order=\"all\" form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \">\n            <name-part name=\"family\" font-variant=\"small-caps\"/>\n          </name>\n        </names>\n      </if>\n      <else-if variable=\"editor\">\n        <names variable=\"editor\">\n          <name name-as-sort-order=\"all\" form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \">\n            <name-part name=\"family\" font-variant=\"small-caps\"/>\n          </name>\n          <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n        </names>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"author-ibid\">\n    <choose>\n      <if variable=\"author\">\n        <names variable=\"author\">\n          <name and=\"text\" initialize=\"true\" initialize-with=\".\" delimiter-precedes-last=\"never\" sort-separator=\" \" font-style=\"normal\"/>\n        </names>\n      </if>\n      <else-if variable=\"editor\">\n        <names variable=\"editor\">\n          <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n          <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n        </names>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n      <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \" prefix=\" traduit par \"/>\n    </names>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n      </if>\n      <else-if type=\"article-journal article-newspaper article-magazine\" match=\"any\">\n        <group delimiter=\", \">\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\"/>\n          <text variable=\"container-title\" font-style=\"italic\"/>\n        </group>\n      </else-if>\n      <else-if type=\"thesis\" match=\"any\">\n        <group delimiter=\"\">\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\",\"/>\n          <text variable=\"genre\" suffix=\", \" prefix=\" \"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else-if>\n      <else-if type=\"manuscript\" match=\"any\">\n        <group delimiter=\",\">\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n          <text variable=\"genre\" prefix=\" [\" suffix=\"]\"/>\n        </group>\n      </else-if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\"\">\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\"/>\n          <text value=\"dans\" suffix=\" \" prefix=\" \"/>\n          <text macro=\"editor\" suffix=\", \"/>\n          <text variable=\"container-title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </group>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\"\">\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\", \"/>\n          <text variable=\"URL\"/>\n          <group prefix=\" , \">\n            <date variable=\"issued\">\n              <date-part name=\"day\" suffix=\" \"/>\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </group>\n      </else-if>\n      <else>\n        <text variable=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"pub-place\">\n    <choose>\n      <if type=\"bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if variable=\"publisher-place\" match=\"any\">\n            <text variable=\"publisher-place\"/>\n          </if>\n          <else>\n            <text value=\"s.l.\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"bill book chapter entry-dictionary entry-encyclopedia graphic legal_case motion_picture paper-conference report song\" match=\"any\">\n        <text variable=\"publisher\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"yearpage\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture paper-conference manuscript report song thesis\" match=\"any\">\n        <group delimiter=\", \">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <text variable=\"number-of-pages\" suffix=\"&#160;p\"/>\n            </else-if>\n          </choose>\n        </group>\n      </if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\" \">\n          <date variable=\"issued\">\n            <date-part name=\"year\" suffix=\", \"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\" suffix=\",\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <label variable=\"page\" form=\"short\"/>\n              <text variable=\"page\"/>\n            </else-if>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"article-journal\" match=\"any\">\n        <group delimiter=\" \" font-style=\"normal\">\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <label variable=\"page\" form=\"short\"/>\n              <text variable=\"page\"/>\n            </else-if>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine\" match=\"any\">\n        <date variable=\"issued\">\n          <date-part name=\"day\" suffix=\" \"/>\n          <date-part name=\"month\" form=\"short\" suffix=\" \"/>\n          <date-part name=\"year\"/>\n        </date>\n        <group delimiter=\" \" font-style=\"normal\">\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n        <group delimiter=\" \" font-style=\"normal\">\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <label variable=\"page\" form=\"short\"/>\n            </else-if>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n          <text value=\"consulté le\" suffix=\" \" prefix=\" \"/>\n          <date variable=\"accessed\" form=\"text\">\n            <date-part name=\"day\"/>\n            <date-part name=\"month\"/>\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"yearpage-bib\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture paper-conference report song thesis\" match=\"any\">\n        <group delimiter=\", \">\n          <group delimiter=\", \">\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n            <group>\n              <text term=\"volume\" form=\"short\" suffix=\".\"/>\n              <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n              <text variable=\"volume\"/>\n            </group>\n            <text variable=\"number-of-pages\" suffix=\"&#160;p\"/>\n          </group>\n          <group>\n            <label variable=\"locator\" form=\"short\"/>\n            <text variable=\"locator\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\", \">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\"/>\n          </group>\n          <group>\n            <label variable=\"page\" form=\"short\"/>\n            <text variable=\"page\" prefix=\"&#160;\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"article-journal chapter\" match=\"any\">\n        <group delimiter=\" \">\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine\" match=\"any\">\n        <group delimiter=\" \">\n          <date variable=\"issued\">\n            <date-part name=\"day\" suffix=\" \"/>\n            <date-part name=\"month\" form=\"short\" suffix=\" \"/>\n            <date-part name=\"year\"/>\n          </date>\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"manuscript\">\n        <group delimiter=\"\" font-style=\"normal\">\n          <choose>\n            <if variable=\"issued\">\n              <date variable=\"issued\">\n                <date-part name=\"day\" suffix=\" \"/>\n                <date-part name=\"month\" suffix=\" \"/>\n                <date-part name=\"year\"/>\n              </date>\n            </if>\n            <else>\n              <text value=\"s. d.\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\" \">\n          <text value=\"consulté le\" suffix=\" \" prefix=\" \"/>\n          <date variable=\"accessed\" form=\"text\">\n            <date-part name=\"day\"/>\n            <date-part name=\"month\"/>\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song chapter paper-conference\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"article-journal article-magazine\" match=\"any\">\n        <group delimiter=\"\">\n          <choose>\n            <if variable=\"issued\">\n              <date variable=\"issued\">\n                <date-part name=\"day\" suffix=\" \"/>\n                <date-part name=\"month\" suffix=\" \"/>\n                <date-part name=\"year\"/>\n              </date>\n              <text macro=\"volume\" prefix=\", \"/>\n            </if>\n            <else>\n              <text macro=\"volume\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n    <text macro=\"issue\" prefix=\", \"/>\n  </macro>\n  <macro name=\"volume\">\n    <choose>\n      <if is-numeric=\"volume\">\n        <text term=\"volume\" form=\"short\" suffix=\".&#160;\"/>\n        <text variable=\"volume\"/>\n      </if>\n      <else>\n        <text variable=\"volume\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if is-numeric=\"issue\">\n        <text term=\"issue\" form=\"short\" suffix=\"&#160;\"/>\n        <text variable=\"issue\"/>\n      </if>\n      <else>\n        <text variable=\"issue\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"collection\">\n    <text variable=\"collection-title\" quotes=\"true\" prefix=\" (coll.&#160;\" suffix=\")\"/>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\">\n    <layout suffix=\".\" delimiter=\"&#160;; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\", \">\n            <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\".\"/>\n            <text variable=\"locator\" prefix=\"p.&#160;\"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <group delimiter=\", \">\n            <text macro=\"author-ibid\"/>\n            <choose>\n              <if type=\"bill book graphic legal_case motion_picture report song thesis manuscript\" match=\"any\">\n                <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n                <text term=\"cited\" font-style=\"italic\" suffix=\".\"/>\n              </if>\n              <else>\n                <text variable=\"title\" text-case=\"capitalize-first\" form=\"short\" quotes=\"true\"/>\n                <text value=\"art cit\"/>\n              </else>\n            </choose>\n            <text variable=\"locator\" prefix=\"p.&#160;\"/>\n          </group>\n        </else-if>\n        <else>\n          <choose>\n            <if type=\"manuscript\">\n              <group delimiter=\", \">\n                <text variable=\"archive\"/>\n                <text variable=\"archive_location\"/>\n                <text variable=\"call-number\"/>\n                <text macro=\"title\"/>\n                <text macro=\"yearpage-bib\"/>\n              </group>\n            </if>\n            <else-if type=\"bill chapter article-journal article-newspaper interview book graphic legal_case motion_picture paper-conference report song thesis webpage post-weblog article-magazine\" match=\"any\">\n              <group delimiter=\", \">\n                <text macro=\"author\"/>\n                <text macro=\"title\"/>\n                <text macro=\"translator\"/>\n                <text macro=\"edition\"/>\n                <text macro=\"pub-place\"/>\n                <text macro=\"publisher\"/>\n                <text macro=\"yearpage\"/>\n              </group>\n            </else-if>\n          </choose>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography>\n    <sort>\n      <key macro=\"author\" names-min=\"3\" names-use-first=\"3\"/>\n      <key variable=\"issued\" sort=\"descending\"/>\n    </sort>\n    <layout suffix=\".\">\n      <choose>\n        <if type=\"manuscript\">\n          <group delimiter=\", \">\n            <text variable=\"archive\"/>\n            <text variable=\"archive_location\"/>\n            <text variable=\"call-number\"/>\n            <text macro=\"title\"/>\n            <text macro=\"yearpage-bib\"/>\n          </group>\n        </if>\n        <else-if type=\"bill chapter article-journal article-newspaper interview book graphic legal_case motion_picture paper-conference report song thesis webpage post-weblog article-magazine\" match=\"any\">\n          <group delimiter=\", \">\n            <text macro=\"author-bib\"/>\n            <text macro=\"title\"/>\n            <text macro=\"translator\"/>\n            <text macro=\"edition\"/>\n            <text macro=\"pub-place\"/>\n            <group delimiter=\" \">\n              <text macro=\"publisher\"/>\n              <text macro=\"collection\"/>\n            </group>\n            <text macro=\"yearpage-bib\"/>\n          </group>\n        </else-if>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/lettrine.md",
    "content": "```\n% pandoc -f latex -t native\n\\lettrine{A}{category} is\n\n\\lettrine[lhang=0.17]{A}{category} is\n^D\n[ Para\n    [ Span ( \"\" , [ \"lettrine\" ] , [] ) [ Str \"A\" ]\n    , SmallCaps [ Str \"category\" ]\n    , Space\n    , Str \"is\"\n    ]\n, Para\n    [ Span ( \"\" , [ \"lettrine\" ] , [] ) [ Str \"A\" ]\n    , SmallCaps [ Str \"category\" ]\n    , Space\n    , Str \"is\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/lists-inside-definition.md",
    "content": "This inserts an empty `\\item[]` when a list occurs at the\nbeginning of a definition list definition; otherwise the list\nmay start on the line with the label, which looks terrible.\nSee https://tex.stackexchange.com/questions/192480/force-itemize-inside-description-onto-a-new-line\n\n```\n% pandoc -t latex\nDefinition\n:   1. list\n    2. list\n^D\n\\begin{description}\n\\tightlist\n\\item[Definition]\n\\hfill\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  list\n\\item\n  list\n\\end{enumerate}\n\\end{description}\n```\n\n```\n% pandoc -t latex\nDefinition\n:   Foo\n\n    1. list\n    2. list\n^D\n\\begin{description}\n\\tightlist\n\\item[Definition]\nFoo\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  list\n\\item\n  list\n\\end{enumerate}\n\\end{description}\n```\n\n```\n% pandoc -t latex\nDefinition\n:   - list\n    - list\n^D\n\\begin{description}\n\\tightlist\n\\item[Definition]\n\\hfill\n\\begin{itemize}\n\\tightlist\n\\item\n  list\n\\item\n  list\n\\end{itemize}\n\\end{description}\n```\n\n"
  },
  {
    "path": "test/command/locators.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"en-GB\">\n  <info>\n    <title>A CSL to test locator parsing in pandoc-citeproc</title>\n    <title-short>test-locators</title-short>\n    <id>https://example.com/test-locators</id>\n    <link href=\"https://forums.zotero.org/discussion/4841/new-australian-legal-citation-style/?Focus=20831#Comment_20831\" rel=\"documentation\"/>\n    <category citation-format=\"note\"/>\n  </info>\n\n  <locale>\n    <terms>\n      <term name=\"section\" form=\"short\">\n        <single>s</single>\n        <multiple>ss</multiple>\n      </term>\n    </terms>\n  </locale>\n\n  <macro name=\"locator\">\n    <choose>\n      <if locator=\"section\">\n        <!-- s or ss -->\n        <group delimiter=\" \" prefix=\" \">\n          <label variable=\"locator\" form=\"short\" />\n          <text variable=\"locator\" prefix=\"{\" suffix=\"}\" />\n        </group>\n      </if>\n      <else>\n        <text variable=\"locator\" prefix=\" {\" suffix=\"}\" />\n      </else>\n    </choose>\n  </macro>\n\n  <macro name=\"title\">\n      <text variable=\"title\" suffix=\" \"/>\n  </macro>\n\n  <citation>\n    <layout prefix=\"\" suffix=\".\" delimiter=\"; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <text value=\"ibid-with-locator\"/>\n          <text macro=\"locator\"/>\n        </if>\n        <else-if position=\"ibid\">\n          <text value=\"ibid\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <text value=\"subsequent\"/>\n          <text macro=\"locator\"/>\n        </else-if>\n        <else>\n          <text macro=\"title\" />\n          <text macro=\"locator\" />\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography>\n    <sort>\n      <key variable=\"issued\"/>\n    </sort>\n    <layout>\n      <text variable=\"title\" />\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/lstlisting.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{lstlisting}[language=Java, caption={Java Example}, label=lst:Hello-World]\npublic class World {\n    public static void main(String[] args) {\n        System.out.println(\"Hello World\");\n    }\n}\n\\end{lstlisting}\n^D\n[ CodeBlock\n    ( \"lst:Hello-World\"\n    , [ \"java\" ]\n    , [ ( \"language\" , \"Java\" )\n      , ( \"caption\" , \"Java Example\" )\n      , ( \"label\" , \"lst:Hello-World\" )\n      ]\n    )\n    \"public class World {\\n    public static void main(String[] args) {\\n        System.out.println(\\\"Hello World\\\");\\n    }\\n}\"\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{lstlisting}[language=Java, escapechar=|, caption={Java Example}, label=lst:Hello-World]\npublic class World {\n    public static void main(String[] args) {\n        System.out.println(\"Hello World\");\n    }\n}\n\\end{lstlisting}\n^D\n[ CodeBlock\n    ( \"lst:Hello-World\"\n    , [ \"java\" ]\n    , [ ( \"language\" , \"Java\" )\n      , ( \"escapechar\" , \"|\" )\n      , ( \"caption\" , \"Java Example\" )\n      , ( \"label\" , \"lst:Hello-World\" )\n      ]\n    )\n    \"public class World {\\n    public static void main(String[] args) {\\n        System.out.println(\\\"Hello World\\\");\\n    }\\n}\"\n]\n```\n"
  },
  {
    "path": "test/command/macro-defs-in-preamble.md",
    "content": "```\n% pandoc -s -f latex-latex_macros -t native\n\\documentclass[11pt]{article}\n\n\\newcommand{\\vara}{\\alpha}\n\\newcommand{\\varb}{b}\n\n\\begin{document}\n$\\vara \\varb$\n\\end{document}\n^D\nPandoc\n  Meta { unMeta = fromList [] }\n  [ RawBlock (Format \"latex\") \"\\\\newcommand{\\\\vara}{\\\\alpha}\"\n  , RawBlock (Format \"latex\") \"\\\\newcommand{\\\\varb}{b}\"\n  , Para [ Math InlineMath \"\\\\vara \\\\varb\" ]\n  ]\n```\n"
  },
  {
    "path": "test/command/macros.md",
    "content": "```\n% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute\n\\newcommand{\\my}{\\phi}\n$\\my+\\my$\n^D\n\\newcommand{\\my}{\\phi}\n\n$\\phi+\\phi$\n```\n\n```\n% pandoc -f markdown-latex_macros -t markdown+raw_tex-raw_attribute\n\\newcommand{\\my}{\\phi}\n$\\my+\\my$\n^D\n\\newcommand{\\my}{\\phi}\n\n$\\my+\\my$\n```\n\n`\\let` macros should be expanded at point of\ndefinition, while `\\newcommand` macros should be\nexpanded at point of use:\n\n```\n% pandoc -f latex -t latex\n\\let\\a\\b\n\\def\\b{\\emph{ouk}}\n\\a a\n^D\na̱\n```\n\n```\n% pandoc -f latex -t latex\n\\newcommand{\\a}{\\b}\n\\newcommand{\\b}{\\emph{ouk}}\n\\a a\n^D\n\\emph{ouk}a\n```\n\n```\n% pandoc -f latex -t latex\n\\def\\BDpos{}\n\\def\\BDneg{-}\n\\def\\beq{\\begin{align}}\n\\def\\eeq{\\end{align}}\n\\def\\e#1{\\emph{#1}}\n\\def\\f#1#2{\\emph{#1--#2}}\n\n$5\\BDneg 6\\BDpos 7$\n\n\\beq\nx &= y\\\\\n\\eeq\n\n\\e{hi}\n\n\\f{hi}{ok}\n^D\n\\(5-67\\)\n\n\\begin{align}\nx &= y\\\\\n\\end{align}\n\n\\emph{hi}\n\n\\emph{hi--ok}\n```\n\n```\n% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute\n\\newcommand{\\my}{\\phi}\n\\begin{equation}\n\\my+\\my\n\\end{equation}\n^D\n\\newcommand{\\my}{\\phi}\n\n\\begin{equation}\n\\phi+\\phi\n\\end{equation}\n```\n\n```\n% pandoc -f markdown-latex_macros -t markdown+raw_tex-raw_attribute\n\\newcommand{\\my}{\\phi}\n\\begin{equation}\n\\my+\\my\n\\end{equation}\n^D\n\\newcommand{\\my}{\\phi}\n\n\\begin{equation}\n\\my+\\my\n\\end{equation}\n```\n\n```\n% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute\n\\newcommand{\\my}{\\emph{a}}\n\\my\n^D\n\\newcommand{\\my}{\\emph{a}}\n\\emph{a}\n```\n\n<https://tex.stackexchange.com/questions/258/what-is-the-difference-between-let-and-def>\n\n```\n% pandoc -f latex -t plain\n\\def\\bar{hello}\n\\let\\fooi\\bar\n\\def\\fooii{\\bar}\n\\fooi +\\fooii\n\n\\def\\bar{goodbye}\n\\fooi +\\fooii\n^D\nhello+hello\n\nhello+goodbye\n```\n\n```\n% pandoc -f latex -t plain\n\\def\\txt{a}\n\\def\\foo{\\txt}\n\\let\\bar\\foo\n\\bar % -> a\n\\def\\txt{b}\n\\bar % -> b\n\\def\\foo{OH}\n\\bar % -> b\n^D\na b b\n```\n\n```\n% pandoc -f latex -t plain\n\\def\\aaa{aaa}\n\\def\\bbb{x\\aaa}\n\\edef\\ccc{y\\aaa}\n\\def\\aaa{AAA}\n\\bbb \\ccc\n^D\nxAAAyaaa\n```\n\n```\n% pandoc -f latex -t plain\n\\gdef\\aaa{aaa}\n\\gdef\\bbb{x\\aaa}\n\\xdef\\ccc{y\\aaa}\n\\gdef\\aaa{AAA}\n\\bbb \\ccc\n^D\nxAAAyaaa\n```\n\n"
  },
  {
    "path": "test/command/make-section-column-divs.md",
    "content": "For reference see\nhttps://groups.google.com/d/msgid/pandoc-discuss/cef24253-7731-417c-a1ee-48153c4344bf%40googlegroups.com\n\n```\n% pandoc\n::: columns\n::: column\n# A\n\na\n:::\n::: column\n# B\n\nb\n:::\n:::\n^D\n<div class=\"columns\">\n<div class=\"column\">\n<h1 id=\"a\">A</h1>\n<p>a</p>\n</div><div class=\"column\">\n<h1 id=\"b\">B</h1>\n<p>b</p>\n</div>\n</div>\n```\n"
  },
  {
    "path": "test/command/man-defines.md",
    "content": "```\n% pandoc -f man -t plain\n.de test\nok\n..\n.test\n.br\n\\A'test'\n.br\n\\A'xyz'\n^D\nok\n1\n0\n```\n"
  },
  {
    "path": "test/command/md-abbrevs.md",
    "content": "Pandoc recognizes an abbreviation and inserts a nonbreaking\nspace (among other things, this prevents a sentence-ending\nspace from being inserted in LaTeX output).\n\n```\n% pandoc -t native\nMr. Bob\n^D\n[ Para [ Str \"Mr.\\160Bob\" ] ]\n```\n\nIf you don't want this to happen you can escape the period:\n\n```\n% pandoc -t native\nHi Mr\\. Bob\n^D\n[ Para [ Str \"Hi\" , Space , Str \"Mr.\" , Space , Str \"Bob\" ]\n]\n```\n\n"
  },
  {
    "path": "test/command/mdoc-An.md",
    "content": "```\n% pandoc -f mdoc -t plain\n.Sh DESCRIPTION\n.An Emily Brontë ,\n.An Anne Brontë\n.Pp\n.An -split\n.An Charlotte Brontë\n.An Bramwell Brontë\n^D\nDESCRIPTION\n\nEmily Brontë, Anne Brontë\n\nCharlotte Brontë\nBramwell Brontë\n```\n"
  },
  {
    "path": "test/command/mdoc-Bd-unfilled.md",
    "content": "```\n% pandoc -f mdoc -t plain\n.Bd -unfilled\n’Twas brillig, and the slithy toves\n      Did gyre and gimble in the wabe:\nAll mimsy were the borogoves,\n      And the mome raths outgrabe.\n\n“Beware the Jabberwock, my son!\n      The jaws that bite, the claws that catch!\nBeware the Jubjub bird, and shun\n      The frumious Bandersnatch!”\n.Ed\n^D\n’Twas brillig, and the slithy toves\n      Did gyre and gimble in the wabe:\nAll mimsy were the borogoves,\n      And the mome raths outgrabe.\n\n“Beware the Jabberwock, my son!\n      The jaws that bite, the claws that catch!\nBeware the Jubjub bird, and shun\n      The frumious Bandersnatch!”\n```\n"
  },
  {
    "path": "test/command/mdoc-Bl-column.md",
    "content": "```\n% pandoc -f mdoc -t djot\n.Bl -column a b\n.It a Ta\n.Sy b\nb\n.Ta c\n.Pp\n.It c Ta d Ta \\&\n.It Em e\n.Ta f\n.Ta g\n.It h Ta Ta j\n.It Pq a Ta b Ta c\n.El\n^D\n| a   | *b* b | c |\n| c   | d     |   |\n| _e_ | f     | g |\n| h   |       | j |\n| (a) | b     | c |\n```\n"
  },
  {
    "path": "test/command/mdoc-Bl-tag.md",
    "content": "```\n% pandoc -f mdoc -t native\n.Bl -tag\n.It one\none\n.It Xo\ntwo\n.Xc\ntwo\n.It Em three Xo\nthree\n.Xc\nthree\n.It Po one two\n.Bq three\n.Pc\nfour\n.El\n^D\n[ DefinitionList\n    [ ( [ Str \"one\" ] , [ [ Para [ Str \"one\" ] ] ] )\n    , ( [ Str \"two\" ] , [ [ Para [ Str \"two\" ] ] ] )\n    , ( [ Emph [ Str \"three\" ] , Space , Str \"three\" ]\n      , [ [ Para [ Str \"three\" ] ] ]\n      )\n    , ( [ Str \"(one\"\n        , Space\n        , Str \"two\"\n        , Space\n        , Str \"[three])\"\n        ]\n      , [ [ Para [ Str \"four\" ] ] ]\n      )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/mediawiki_behavior_switches.md",
    "content": "```\n% pandoc -f mediawiki -t native\n____INDEX____\n__NOINDEX__\n__noindex__\n__FOOBAR__\n^D\n[ Para\n    [ Str \"____\"\n    , SoftBreak\n    , Str \"__noindex__\"\n    , SoftBreak\n    , Str \"__FOOBAR__\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/mmd-metadata.md",
    "content": "```\n% pandoc -f markdown_mmd -t markdown -s\nTitle: Blah blah blah\nAuthor: Doo de Doo\nBase Header Level: 1\nBibliography: Pubs.bib\nLang: en-GB\n\nbody\n^D\n---\nauthor: Doo de Doo\nbaseheaderlevel: 1\nbibliography: Pubs.bib\nlang: en-GB\ntitle: Blah blah blah\n---\n\nbody\n```\n"
  },
  {
    "path": "test/command/modern-humanities-research-association.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"en-GB\">\n  <info>\n    <title>Modern Humanities Research Association (note with bibliography)</title>\n    <id>http://www.zotero.org/styles/modern-humanities-research-association</id>\n    <link href=\"http://www.zotero.org/styles/modern-humanities-research-association\" rel=\"self\"/>\n    <link href=\"http://www.mhra.org.uk/Publications/Books/StyleGuide/download.shtml\" rel=\"documentation\"/>\n    <author>\n      <name>Rintze Zelle</name>\n      <uri>http://twitter.com/rintzezelle</uri>\n    </author>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <category citation-format=\"note\"/>\n    <category field=\"generic-base\"/>\n    <summary>MHRA format with full notes and bibliography</summary>\n    <updated>2013-04-16T04:40:01+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"et-al\">and others</term>\n      <term name=\"editor\" form=\"verb-short\">ed. by</term>\n      <term name=\"edition\" form=\"short\">edn</term>\n      <term name=\"translator\" form=\"verb-short\">trans. by</term>\n    </terms>\n  </locale>\n  <macro name=\"author\">\n    <group delimiter=\". \">\n      <names variable=\"author\">\n        <name name-as-sort-order=\"first\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n        <label form=\"short\" prefix=\", \" suffix=\".\"/>\n        <substitute>\n          <names variable=\"editor\"/>\n          <names variable=\"translator\"/>\n          <text macro=\"title-note\"/>\n        </substitute>\n      </names>\n      <text macro=\"recipient\"/>\n    </group>\n  </macro>\n  <macro name=\"recipient\">\n    <group delimiter=\" \">\n      <choose>\n        <if type=\"personal_communication\">\n          <choose>\n            <if variable=\"genre\">\n              <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            </if>\n            <else>\n              <text term=\"letter\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </if>\n      </choose>\n      <text macro=\"recipient-note\"/>\n    </group>\n  </macro>\n  <macro name=\"contributors-note\">\n    <names variable=\"author\">\n      <name and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"never\"/>\n      <label form=\"short\" prefix=\", \"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title-note\"/>\n      </substitute>\n    </names>\n    <text macro=\"recipient-note\"/>\n  </macro>\n  <macro name=\"title-note\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\"/>\n      </if>\n      <else>\n        <text variable=\"title\" quotes=\"true\" text-case=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"disambiguate\">\n    <choose>\n      <if disambiguate=\"true\">\n        <choose>\n          <if variable=\"title\" match=\"none\">\n            <text macro=\"issued\"/>\n          </if>\n          <else-if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n            <text variable=\"title\" font-style=\"italic\" text-case=\"title\" form=\"short\"/>\n          </else-if>\n          <else>\n            <text variable=\"title\" quotes=\"true\" text-case=\"title\" form=\"short\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"title-sort-substitute\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\" form=\"short\"/>\n      </if>\n      <else>\n        <text variable=\"title\" quotes=\"true\" text-case=\"title\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"editor-translator\">\n    <group delimiter=\", \">\n      <choose>\n        <if variable=\"author\">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"container-author\">\n                <group>\n                  <names variable=\"container-author\">\n                    <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n                    <name and=\"text\" delimiter=\", \"/>\n                  </names>\n                </group>\n              </if>\n            </choose>\n          </group>\n          <names variable=\"editor translator\" delimiter=\", \">\n            <label form=\"verb-short\" text-case=\"lowercase\" suffix=\" \"/>\n            <name and=\"text\" delimiter=\", \"/>\n          </names>\n        </if>\n      </choose>\n    </group>\n  </macro>\n  <macro name=\"collection-title\">\n    <text variable=\"collection-title\" text-case=\"title\"/>\n    <text variable=\"collection-number\" prefix=\", \"/>\n  </macro>\n  <macro name=\"locators-note\">\n    <choose>\n      <if type=\"article-journal\">\n        <text variable=\"volume\"/>\n      </if>\n      <else-if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <group delimiter=\", \">\n          <text macro=\"edition-note\"/>\n          <group>\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" prefix=\" \" plural=\"true\"/>\n          </group>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"volume\">\n    <choose>\n      <if type=\"article-journal\">\n        <text variable=\"volume\"/>\n      </if>\n      <else-if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <group delimiter=\", \">\n          <text macro=\"edition-note\"/>\n          <group>\n            <number variable=\"number-of-volumes\" form=\"numeric\"/>\n            <text term=\"volume\" form=\"short\" prefix=\" \" plural=\"true\"/>\n          </group>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"issue-note\">\n    <choose>\n      <if type=\"article-journal\">\n        <choose>\n          <if variable=\"volume\">\n            <text macro=\"issued\" prefix=\" (\" suffix=\")\"/>\n          </if>\n          <else>\n            <text macro=\"issued\" prefix=\", \"/>\n          </else>\n        </choose>\n      </if>\n      <else-if variable=\"publisher-place publisher\" match=\"any\">\n        <group prefix=\" (\" suffix=\")\" delimiter=\", \">\n          <group delimiter=\" \">\n            <choose>\n              <if variable=\"title\" match=\"none\"/>\n              <else-if type=\"thesis speech\" match=\"any\">\n                <text variable=\"genre\" prefix=\"unpublished \"/>\n              </else-if>\n            </choose>\n            <text macro=\"event\"/>\n          </group>\n          <text macro=\"publisher\"/>\n          <text macro=\"issued\"/>\n        </group>\n      </else-if>\n      <else>\n        <text macro=\"issued\" prefix=\", \"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locators-specific-note\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"volume\">\n            <number variable=\"volume\" form=\"roman\" font-variant=\"small-caps\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-title-note\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text term=\"in\" text-case=\"lowercase\" suffix=\" \"/>\n      </if>\n    </choose>\n    <text variable=\"container-title\" font-style=\"italic\"/>\n  </macro>\n  <macro name=\"edition-note\">\n    <choose>\n      <if type=\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"editor-note\">\n    <names variable=\"editor\">\n      <name and=\"text\" sort-separator=\", \" delimiter=\", \"/>\n      <label form=\"short\" prefix=\", \" suffix=\".\"/>\n    </names>\n  </macro>\n  <macro name=\"translator-note\">\n    <names variable=\"translator\">\n      <name and=\"text\" sort-separator=\", \" delimiter=\", \"/>\n      <label form=\"verb-short\" prefix=\", \" suffix=\".\"/>\n    </names>\n  </macro>\n  <macro name=\"recipient-note\">\n    <names variable=\"recipient\" delimiter=\", \">\n      <label form=\"verb\" prefix=\" \" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"recipient-short\">\n    <names variable=\"recipient\">\n      <label form=\"verb\" prefix=\" \" text-case=\"lowercase\" suffix=\" \"/>\n      <name form=\"short\" and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"contributors-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"text\" sort-separator=\", \" delimiter=\", \" delimiter-precedes-last=\"never\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text macro=\"title-sort-substitute\"/>\n      </substitute>\n    </names>\n    <text macro=\"recipient-short\"/>\n  </macro>\n  <macro name=\"interviewer-note\">\n    <names variable=\"interviewer\" delimiter=\", \">\n      <label form=\"verb\" prefix=\" \" text-case=\"lowercase\" suffix=\" \"/>\n      <name and=\"text\" delimiter=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"locators-newspaper\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <group delimiter=\", \">\n          <group>\n            <text variable=\"edition\" suffix=\" \"/>\n            <text term=\"edition\" prefix=\" \"/>\n          </group>\n          <group>\n            <text term=\"section\" suffix=\" \"/>\n            <text variable=\"section\"/>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"event\">\n    <group>\n      <text term=\"presented at\" suffix=\" \"/>\n      <text variable=\"event\"/>\n    </group>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\": \">\n      <text variable=\"publisher-place\"/>\n      <text variable=\"publisher\"/>\n    </group>\n  </macro>\n  <macro name=\"issued\">\n    <choose>\n      <if type=\"graphic report article-newspaper article-magazine personal_communication\" match=\"any\">\n        <date variable=\"issued\">\n          <date-part name=\"day\" suffix=\" \"/>\n          <date-part name=\"month\" suffix=\" \"/>\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else>\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"pages\">\n    <choose>\n      <if type=\"article-journal\">\n        <text variable=\"page\" prefix=\", \"/>\n      </if>\n      <else>\n        <choose>\n          <if variable=\"volume\">\n            <text variable=\"page\" prefix=\", \"/>\n          </if>\n          <else>\n            <label variable=\"page\" form=\"short\" prefix=\", \" suffix=\" \"/>\n            <text variable=\"page\"/>\n          </else>\n        </choose>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"point-locators\">\n    <text macro=\"pages\"/>\n    <choose>\n      <if variable=\"page\">\n        <group prefix=\" (\" suffix=\")\">\n          <label variable=\"locator\" form=\"short\" suffix=\" \"/>\n          <text variable=\"locator\"/>\n        </group>\n      </if>\n      <else>\n        <label variable=\"locator\" form=\"short\" prefix=\", \" suffix=\" \"/>\n        <text variable=\"locator\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"point-locators-subsequent\">\n    <label variable=\"locator\" form=\"short\" prefix=\", \" suffix=\" \"/>\n    <text variable=\"locator\"/>\n  </macro>\n  <macro name=\"archive-note\">\n    <group delimiter=\", \">\n      <text variable=\"archive_location\"/>\n      <text variable=\"archive\"/>\n      <text variable=\"archive-place\"/>\n    </group>\n  </macro>\n  <macro name=\"access-note\">\n    <group delimiter=\", \">\n      <choose>\n        <if type=\"article-journal bill chapter legal_case legislation paper-conference\" match=\"none\">\n          <text macro=\"archive-note\" prefix=\", \"/>\n        </if>\n      </choose>\n    </group>\n    <choose>\n      <if variable=\"DOI\">\n        <text variable=\"DOI\" prefix=\" &lt;doi:\" suffix=\"&gt;\"/>\n      </if>\n      <else>\n        <choose>\n          <if variable=\"URL\">\n            <text variable=\"URL\" prefix=\" &lt;\" suffix=\"&gt;\"/>\n            <group prefix=\" [\" suffix=\"]\">\n              <text term=\"accessed\" text-case=\"lowercase\"/>\n              <date variable=\"accessed\">\n                <date-part name=\"day\" prefix=\" \"/>\n                <date-part name=\"month\" prefix=\" \"/>\n                <date-part name=\"year\" prefix=\" \"/>\n              </date>\n            </group>\n          </if>\n        </choose>\n      </else>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\">\n    <layout prefix=\"\" suffix=\".\" delimiter=\"; \">\n      <choose>\n        <if position=\"subsequent\">\n          <group delimiter=\", \">\n            <text macro=\"contributors-short\"/>\n            <text macro=\"disambiguate\"/>\n            <text macro=\"locators-specific-note\"/>\n          </group>\n          <text macro=\"point-locators-subsequent\"/>\n        </if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"contributors-note\"/>\n            <text macro=\"title-note\"/>\n            <text macro=\"container-title-note\"/>\n            <text macro=\"editor-translator\"/>\n            <text macro=\"collection-title\"/>\n            <text macro=\"locators-note\"/>\n          </group>\n          <text macro=\"issue-note\"/>\n          <text macro=\"locators-specific-note\" prefix=\", \"/>\n          <text macro=\"locators-newspaper\" prefix=\", \"/>\n          <text macro=\"point-locators\"/>\n          <text macro=\"access-note\"/>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"7\" et-al-use-first=\"6\" subsequent-author-substitute=\"---\">\n    <sort>\n      <key macro=\"author\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout>\n      <group delimiter=\", \">\n        <text macro=\"author\"/>\n        <text macro=\"title-note\"/>\n        <text macro=\"container-title-note\"/>\n        <text macro=\"editor-translator\"/>\n        <text macro=\"collection-title\"/>\n        <text macro=\"volume\"/>\n      </group>\n      <text macro=\"issue-note\"/>\n      <text macro=\"locators-specific-note\" prefix=\", \"/>\n      <text macro=\"locators-newspaper\" prefix=\", \"/>\n      <text macro=\"pages\"/>\n      <text macro=\"access-note\"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/multiple-metadata-blocks.md",
    "content": "If multiple blocks define a field, the first is used.\n\n```\n% pandoc -s -t native\n---\nfoo: bar\n...\n\n---\nfoo: bim\n...\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList [ ( \"foo\" , MetaInlines [ Str \"bim\" ] ) ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/nested-spanlike.md",
    "content": "```\n% pandoc -f markdown -t html\n[test]{.foo .underline #bar .smallcaps .kbd}\n^D\n<p><kbd id=\"bar\"><u><span class=\"smallcaps\">test</span></u></kbd></p>\n```\n"
  },
  {
    "path": "test/command/nested-table-to-asciidoc-6942.md",
    "content": "A table within a table should be converted into a table within table\n\n```\n% pandoc -f html -t asciidoc\n<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title> NestedTables </title>\n</head>\n<body>\n<table>\n <tr>\n  <td >\n   <table>  <tr> <td> a1 </td> <td> a2 </td> </tr>  </table>\n  </td>\n  <td>b</td>\n </tr>\n <tr>\n   <td>c</td> <td>d </td>\n </tr>\n</table>\n</body>\n</html>\n^D\n[width=\"100%\",cols=\"50%,50%\",]\n|===\na|\n[cols=\",\",]\n!===\n!a1 !a2\n!===\n\n|b\n|c |d\n|===\n```\n\nA table within a table within a table cannot be converted because asciidoc only\nsupports two levels of tables.\nThe table on level 3 is thus converted to level 2 and a warning is produced\n```\n% pandoc -f html -t asciidoc --verbose\n<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title> NestedTables </title>\n</head>\n<body>\n<table>\n <tr>\n  <td>\n    <table>  <tr>\n\t<td> a1 </td>\n\t<td>\n\t  <table>  <tr> <td> 1 </td> <td> 2 </td> </tr>  </table>\n\t</td>\n    </tr>  </table>\n  </td>\n  <td>b</td>\n </tr>\n <tr>\n   <td>c</td> <td>d </td>\n </tr>\n</table>\n</body>\n</html>\n^D\n2> [INFO] Not rendering Table (\"\",[],[]) (Caption Nothing []) [(AlignDefault,ColWidth 0.5),(AlignDefault,ColWidth 0.5)] (TableHead (\"\",[],[]) []) [TableBody (\"\",[],[]) (RowHeadColumns 0) [] [Row (\"\",[],[]) [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"a1\"]],Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Table (\"\",[],[]) (Caption Nothing []) [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)] (TableHead (\"\",[],[]) []) [TableBody (\"\",[],[]) (RowHeadColumns 0) [] [Row (\"\",[],[]) [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"1\"]],Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"2\"]]]]] (TableFoot (\"\",[],[]) [])]]]] (TableFoot (\"\",[],[]) [])\n[width=\"100%\",cols=\"50%,50%\",]\n|===\na|\n[width=\"100%\",cols=\"50%,50%\",]\n!===\n!a1 !\n!===\n\n|b\n|c |d\n|===\n```\n"
  },
  {
    "path": "test/command/newif.md",
    "content": "```\n% pandoc -f latex -t plain\n\\iftrue\nshould print\n\\iftrue\nshould print\n\\else\nshould not print A\n\\fi\n\\else\nshould not print B\n\\fi\n\n\\iffalse\nshould not print C\n\\else\n\\iftrue\nshould print\n\\else\nshould not print D\n\\fi\n\\fi\n\n\\newif\\ifepub\n\n\\ifepub\nshould not print E\n\\fi\n\n\\epubtrue\n\n\\ifepub\nshould print\n\\else\nshould not print F\n\\fi\n\n\\epubfalse\n\n\\ifepub\nshould not print G\n\\else\nshould print\n\\fi\n^D\nshould print\n\nshould print\n\nshould print\n\nshould print\n\nshould print\n```\n"
  },
  {
    "path": "test/command/oscola.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"never\" default-locale=\"en-GB\">\n  <info>\n    <title>OSCOLA (Oxford University Standard for Citation of Legal Authorities)</title>\n    <title-short>OSCOLA</title-short>\n    <id>http://www.zotero.org/styles/oscola</id>\n    <link href=\"http://www.zotero.org/styles/oscola\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/australian-guide-to-legal-citation\" rel=\"template\"/>\n    <link href=\"http://www.law.ox.ac.uk/publications/oscola.php\" rel=\"documentation\"/>\n    <author>\n      <name>Sebastian Karcher</name>\n    </author>\n    <category citation-format=\"note\"/>\n    <category field=\"law\"/>\n    <summary>The OSCOLA Standards. For a Zotero Group showing data-entry in Zotero see: https://www.zotero.org/groups/oscola_samples/items/order/itemType</summary>\n    <updated>2013-11-15T01:14:57+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale>\n    <terms>\n      <term name=\"chapter\" form=\"short\">\n        <single>ch.</single>\n        <multiple>chs.</multiple>\n      </term>\n      <term name=\"section\" form=\"short\">\n        <single>s</single>\n        <multiple>ss</multiple>\n      </term>\n      <term name=\"paragraph\" form=\"short\">\n        <single>para</single>\n        <multiple>paras</multiple>\n      </term>\n      <term name=\"translator\" form=\"short\">\n        <single>tr.</single>\n        <multiple>trs.</multiple>\n      </term>\n      <term name=\"edition\" form=\"short\">edn.</term>\n      <term name=\"et-al\">and others</term>\n    </terms>\n  </locale>\n  <!--Authors and Persons-->\n  <macro name=\"author-note\">\n    <!--for bills & hearing this should start with jurisdiction once available-->\n    <choose>\n      <if type=\"interview\">\n        <group delimiter=\", \">\n          <names variable=\"interviewer\">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n          <names variable=\"author\" prefix=\"Interview with \">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n        </group>\n      </if>\n      <else-if type=\"personal_communication\">\n        <group delimiter=\" \">\n          <group delimiter=\" from \">\n            <text variable=\"genre\"/>\n            <names variable=\"author\">\n              <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n            </names>\n          </group>\n          <names variable=\"recipient\" prefix=\"to \">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"broadcast\">\n        <text variable=\"publisher\"/>\n      </else-if>\n      <else-if type=\"legal_case legislation\" match=\"any\"/>\n      <else>\n        <names variable=\"author\">\n          <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          <label form=\"short\" prefix=\" (\" suffix=\")\" strip-periods=\"true\"/>\n          <substitute>\n            <names variable=\"editor\"/>\n            <names variable=\"translator\"/>\n            <text macro=\"title\"/>\n          </substitute>\n        </names>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"author-short\">\n    <choose>\n      <if type=\"interview\">\n        <group delimiter=\", \">\n          <names variable=\"interviewer\">\n            <name delimiter-precedes-last=\"never\" and=\"text\" form=\"short\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n          <names variable=\"author\" prefix=\"Interview with \">\n            <name delimiter-precedes-last=\"never\" and=\"text\" form=\"short\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n        </group>\n      </if>\n      <else-if type=\"personal_communication\">\n        <group delimiter=\" \">\n          <group delimiter=\" from \">\n            <text variable=\"genre\"/>\n            <names variable=\"author\">\n              <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" form=\"short\" initialize=\"false\" initialize-with=\"\"/>\n            </names>\n          </group>\n          <names variable=\"recipient\" prefix=\"to \">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" form=\"short\" initialize-with=\"\"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"broadcast\">\n        <text variable=\"publisher\"/>\n      </else-if>\n      <else>\n        <names variable=\"author\">\n          <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\" form=\"short\"/>\n          <substitute>\n            <names variable=\"editor\"/>\n            <names variable=\"translator\"/>\n            <text macro=\"title\"/>\n          </substitute>\n        </names>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"author\">\n    <!--for bills & hearing this should start with jurisdiction once available-->\n    <choose>\n      <if type=\"interview\">\n        <group delimiter=\", \">\n          <names variable=\"interviewer\">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize-with=\"\" name-as-sort-order=\"all\" sort-separator=\" \"/>\n          </names>\n          <names variable=\"author\" prefix=\"Interview with \">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n        </group>\n      </if>\n      <else-if type=\"personal_communication\">\n        <group delimiter=\" \">\n          <group delimiter=\", \">\n            <names variable=\"author\">\n              <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize-with=\"\" name-as-sort-order=\"all\" sort-separator=\" \"/>\n            </names>\n            <text variable=\"genre\"/>\n          </group>\n          <names variable=\"recipient\" prefix=\"to \">\n            <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          </names>\n        </group>\n      </else-if>\n      <else-if type=\"broadcast\">\n        <text variable=\"publisher\"/>\n      </else-if>\n      <else-if type=\"legal_case legislation\" match=\"any\"/>\n      <else>\n        <names variable=\"author\">\n          <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" name-as-sort-order=\"all\" initialize-with=\"\" sort-separator=\" \"/>\n          <label form=\"short\" prefix=\" (\" suffix=\")\" strip-periods=\"true\"/>\n          <substitute>\n            <names variable=\"editor\"/>\n            <names variable=\"translator\"/>\n            <text macro=\"title\"/>\n          </substitute>\n        </names>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"editor\">\n    <choose>\n      <if type=\"chapter paper-conference entry-encyclopedia\" match=\"none\">\n        <names variable=\"editor translator container-author\" delimiter=\", \">\n          <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n          <label form=\"short\" prefix=\" \" strip-periods=\"true\"/>\n        </names>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"editor-chapter\">\n    <group>\n      <text term=\"in\" suffix=\" \"/>\n      <names variable=\"editor translator container-author\" delimiter=\", \">\n        <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n        <label form=\"short\" prefix=\" (\" suffix=\")\" strip-periods=\"true\"/>\n      </names>\n    </group>\n  </macro>\n  <!-- Titles -->\n  <macro name=\"title\">\n    <choose>\n      <if type=\"book motion_picture treaty\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\"/>\n      </if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <text variable=\"title\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <text variable=\"title\" font-style=\"italic\" strip-periods=\"true\"/>\n      </else-if>\n      <else>\n        <text variable=\"title\" quotes=\"true\" text-case=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title-short\">\n    <choose>\n      <if type=\"book motion_picture treaty\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\" text-case=\"title\" form=\"short\"/>\n      </if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <text variable=\"title\" form=\"short\"/>\n      </else-if>\n      <else-if type=\"legal_case\">\n        <choose>\n          <if variable=\"title-short\">\n            <text variable=\"title-short\" font-style=\"italic\"/>\n          </if>\n          <else>\n            <text variable=\"title\" font-style=\"italic\"/>\n          </else>\n        </choose>\n      </else-if>\n      <else>\n        <text variable=\"title\" quotes=\"true\" text-case=\"title\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <!--Dates-->\n  <macro name=\"issued-year\">\n    <date variable=\"issued\" form=\"text\" date-parts=\"year\"/>\n  </macro>\n  <macro name=\"issued-full\">\n    <date variable=\"issued\" form=\"text\"/>\n  </macro>\n  <macro name=\"date-parenthesis\">\n    <choose>\n      <if type=\"legal_case article-journal article-magazine\" match=\"any\">\n        <choose>\n          <if variable=\"number authority\" match=\"all\">\n            <text macro=\"issued-year\" prefix=\"[\" suffix=\"]\"/>\n          </if>\n          <else-if variable=\"volume\">\n            <text macro=\"issued-year\" prefix=\"(\" suffix=\")\"/>\n          </else-if>\n          <else-if variable=\"container-title volume number\" match=\"any\">\n            <!--no year in square brackets for unreported case w/o medium neutral citation-->\n            <text macro=\"issued-year\" prefix=\"[\" suffix=\"]\"/>\n          </else-if>\n        </choose>\n      </if>\n      <else-if type=\"legislation bill\" match=\"any\">\n        <text macro=\"issued-year\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!--publication info -->\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"book chapter broadcast personal_communication manuscript paper-conference article-newspaper report legislation motion_picture speech interview thesis entry-encyclopedia webpage post-weblog\" match=\"any\">\n        <group delimiter=\" \">\n          <group prefix=\"(\" suffix=\")\" delimiter=\", \">\n            <choose>\n              <if type=\"article-newspaper\">\n                <text variable=\"publisher-place\" strip-periods=\"true\"/>\n                <date variable=\"issued\" form=\"text\"/>\n              </if>\n              <else-if type=\"broadcast personal_communication treaty\" match=\"any\">\n                <date variable=\"issued\" form=\"text\"/>\n              </else-if>\n              <else-if type=\"legislation bill\" match=\"any\">\n                <!--this should be jurisdiction we use code instead-->\n                <text variable=\"container-title\" strip-periods=\"true\"/>\n              </else-if>\n              <else>\n                <!--this won't work in Zotero yet, but does no harm -->\n                <names variable=\"director\">\n                  <label form=\"verb\" text-case=\"capitalize-first\" suffix=\" \"/>\n                  <name delimiter-precedes-last=\"never\" and=\"text\" delimiter=\", \" initialize=\"false\" initialize-with=\"\"/>\n                </names>\n                <text macro=\"editor\"/>\n                <choose>\n                  <!--if none of these, this we don't want edition either. Might be Loose-Leaf-->\n                  <if variable=\"publisher issued genre container-title\" match=\"any\">\n                    <text macro=\"edition\"/>\n                  </if>\n                </choose>\n                <choose>\n                  <if type=\"speech\">\n                    <text variable=\"event\"/>\n                    <text variable=\"event-place\"/>\n                    <text macro=\"issued-full\"/>\n                  </if>\n                  <else-if type=\"thesis\" match=\"any\">\n                    <text variable=\"genre\" strip-periods=\"true\"/>\n                    <group delimiter=\" \">\n                      <text variable=\"publisher\" strip-periods=\"true\"/>\n                      <text macro=\"issued-year\"/>\n                    </group>\n                  </else-if>\n                  <else-if type=\"webpage post-weblog\" match=\"any\">\n                    <text variable=\"container-title\" font-style=\"italic\"/>\n                    <text macro=\"issued-full\"/>\n                  </else-if>\n                  <else-if type=\"interview\" match=\"any\">\n                    <text macro=\"issued-full\"/>\n                  </else-if>\n                  <else>\n                    <group delimiter=\" \">\n                      <text variable=\"publisher\" strip-periods=\"true\"/>\n                      <text macro=\"issued-year\"/>\n                    </group>\n                  </else>\n                </choose>\n              </else>\n            </choose>\n          </group>\n          <choose>\n            <if type=\"report interview manuscript\" match=\"any\">\n              <group delimiter=\" \">\n                <text variable=\"genre\" strip-periods=\"true\"/>\n                <text variable=\"number\"/>\n              </group>\n            </if>\n          </choose>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"looseleaf-note\">\n    <choose>\n      <if type=\"book\">\n        <choose>\n          <if variable=\"publisher issued\" match=\"none\">\n            <choose>\n              <if variable=\"locator\">\n                <group delimiter=\" \">\n                  <label variable=\"locator\" form=\"short\" strip-periods=\"true\"/>\n                  <text variable=\"locator\"/>\n                  <text variable=\"edition\" prefix=\"(\" suffix=\")\"/>\n                </group>\n              </if>\n            </choose>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"volume-book\">\n    <choose>\n      <if type=\"book chapter report\" match=\"any\">\n        <group delimiter=\" \">\n          <label variable=\"volume\" form=\"short\" strip-periods=\"true\"/>\n          <text variable=\"volume\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <number variable=\"edition\" form=\"ordinal\"/>\n          <label variable=\"edition\" form=\"short\" strip-periods=\"true\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" strip-periods=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"book-container\">\n    <choose>\n      <if type=\"chapter paper-conference entry-encyclopedia\" match=\"any\">\n        <group>\n          <text macro=\"editor-chapter\" prefix=\" \"/>\n          <text variable=\"container-title\" font-style=\"italic\" prefix=\", \"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"broadcast-container\">\n    <choose>\n      <if type=\"broadcast\" match=\"any\">\n        <text variable=\"container-title\" font-style=\"italic\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"bill-number\">\n    <choose>\n      <if type=\"bill\">\n        <text variable=\"number\" prefix=\"[\" suffix=\"]\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"article-case-info\">\n    <choose>\n      <if type=\"article-journal article-magazine article-newspaper legal_case\" match=\"any\">\n        <group delimiter=\", \">\n          <!--Assume that only cases with a Medium Neutral Citation have a docket number -->\n          <choose>\n            <if variable=\"authority number\" match=\"all\">\n              <group delimiter=\" \">\n                <text variable=\"authority\" form=\"short\" strip-periods=\"true\"/>\n                <text variable=\"number\"/>\n              </group>\n            </if>\n          </choose>\n          <group delimiter=\" \">\n            <text variable=\"volume\"/>\n            <choose>\n              <if type=\"legal_case\">\n                <choose>\n                  <if variable=\"container-title\">\n                    <text variable=\"container-title\" form=\"short\" strip-periods=\"true\"/>\n                  </if>\n                </choose>\n              </if>\n              <else-if type=\"article-magazine article-newspaper\" match=\"any\">\n                <text variable=\"container-title\" font-style=\"italic\"/>\n              </else-if>\n              <else>\n                <text variable=\"container-title\"/>\n              </else>\n            </choose>\n          </group>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"page-first\">\n    <choose>\n      <if type=\"chapter report paper-conference\" match=\"none\">\n        <text variable=\"page-first\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"court\">\n    <choose>\n      <if type=\"legal_case\">\n        <choose>\n          <if variable=\"number\" match=\"none\">\n            <text variable=\"authority\" prefix=\"(\" suffix=\")\" strip-periods=\"true\"/>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"locator-basic\">\n    <group delimiter=\" \">\n      <choose>\n        <if locator=\"page\" match=\"none\">\n          <label variable=\"locator\" form=\"short\" strip-periods=\"true\"/>\n        </if>\n      </choose>\n      <text variable=\"locator\"/>\n    </group>\n  </macro>\n  <macro name=\"locator-space\">\n    <choose>\n      <if type=\"legal_case\">\n        <choose>\n          <if locator=\"paragraph\">\n            <text variable=\"locator\" prefix=\"[\" suffix=\"]\"/>\n          </if>\n          <else-if variable=\"number container-title volume page\" match=\"all\"/>\n          <else-if variable=\"authority\">\n            <text variable=\"locator\"/>\n          </else-if>\n        </choose>\n      </if>\n      <else-if type=\"legislation book article-journal article-magazine\" match=\"none\">\n        <text macro=\"locator-basic\"/>\n      </else-if>\n      <else-if type=\"book\">\n        <choose>\n          <if variable=\"issued publisher\" match=\"any\">\n            <text macro=\"locator-basic\"/>\n          </if>\n        </choose>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"locator-comma\">\n    <choose>\n      <if type=\"legal_case\">\n        <choose>\n          <if locator=\"paragraph\" match=\"none\">\n            <choose>\n              <if variable=\"authority\" match=\"none\">\n                <text variable=\"locator\"/>\n              </if>\n              <else-if variable=\"number container-title volume page\" match=\"all\">\n                <text variable=\"locator\"/>\n              </else-if>\n            </choose>\n          </if>\n        </choose>\n      </if>\n      <else-if type=\"legislation article-journal article-magazine\" match=\"any\">\n        <text macro=\"locator-basic\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <!--Others -->\n  <macro name=\"treaty-catchall\">\n    <choose>\n      <if type=\"treaty\">\n        <text variable=\"genre\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"URL\">\n    <choose>\n      <if type=\"legal_case legislation bill\" match=\"none\">\n        <choose>\n          <if variable=\"URL\">\n            <group delimiter=\" \">\n              <text variable=\"URL\" prefix=\"&lt;\" suffix=\"&gt;\"/>\n              <group delimiter=\" \">\n                <text term=\"accessed\"/>\n                <date variable=\"accessed\" form=\"text\"/>\n              </group>\n            </group>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"author-count\">\n    <names variable=\"author\">\n      <name form=\"count\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"sort-type\">\n    <!--This should just sort secondary sources first. I'm leaving the rest from AGLC for simplicity-->\n    <choose>\n      <if type=\"book chapter paper-conference article-magazine article-newspaper article-journal manuscript report speech entry-encyclopedia\" match=\"any\">\n        <text value=\"1\"/>\n      </if>\n      <else-if type=\"legal_case\">\n        <text value=\"2\"/>\n        <text variable=\"title\"/>\n      </else-if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <text value=\"3\"/>\n        <choose>\n          <if type=\"legislation\">\n            <text variable=\"title\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else-if type=\"treaty\">\n        <text value=\"4\"/>\n      </else-if>\n      <else>\n        <text value=\"1\"/>\n      </else>\n    </choose>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\">\n    <layout suffix=\".\" delimiter=\"; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\" \">\n            <text term=\"ibid\" strip-periods=\"true\" text-case=\"lowercase\"/>\n            <text variable=\"locator\"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\" strip-periods=\"true\" text-case=\"lowercase\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <choose>\n            <if type=\"legal_case bill legislation treaty\" match=\"any\">\n              <!--don't use short form and above note for legal citations -->\n              <group delimiter=\" \">\n                <text macro=\"author-note\"/>\n                <text macro=\"title-short\"/>\n                <text macro=\"looseleaf-note\"/>\n                <text variable=\"first-reference-note-number\" prefix=\"(n \" suffix=\")\"/>\n                <text macro=\"locator-space\"/>\n              </group>\n            </if>\n            <else>\n              <group delimiter=\" \">\n                <group delimiter=\", \">\n                  <text macro=\"author-short\"/>\n                  <choose>\n                    <if disambiguate=\"true\">\n                      <text macro=\"title-short\"/>\n                    </if>\n                  </choose>\n                </group>\n                <text variable=\"first-reference-note-number\" prefix=\"(n \" suffix=\")\"/>\n                <text macro=\"locator-basic\"/>\n              </group>\n            </else>\n          </choose>\n        </else-if>\n        <else>\n          <!--general whole citation -->\n          <group delimiter=\" \">\n            <group delimiter=\", \">\n              <group delimiter=\" \">\n                <group delimiter=\", \">\n                  <text macro=\"author-note\"/>\n                  <group>\n                    <text macro=\"title\"/>\n                    <text macro=\"book-container\"/>\n                  </group>\n                  <text macro=\"broadcast-container\"/>\n                  <text macro=\"volume-book\"/>\n                  <text macro=\"looseleaf-note\"/>\n                </group>\n                <group delimiter=\" \">\n                  <text macro=\"date-parenthesis\"/>\n                  <text macro=\"bill-number\"/>\n                  <text macro=\"article-case-info\"/>\n                  <text macro=\"publisher\"/>\n                </group>\n              </group>\n              <text macro=\"treaty-catchall\"/>\n            </group>\n            <group delimiter=\", \">\n              <group delimiter=\" \">\n                <text macro=\"page-first\"/>\n                <text macro=\"court\"/>\n                <text macro=\"locator-space\"/>\n              </group>\n              <text macro=\"locator-comma\"/>\n            </group>\n            <text macro=\"URL\"/>\n          </group>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography et-al-min=\"4\" et-al-use-first=\"1\" subsequent-author-substitute=\"&#8212;&#8212;\">\n    <sort>\n      <key macro=\"sort-type\"/>\n      <key macro=\"author\" names-min=\"1\" names-use-first=\"1\"/>\n      <key macro=\"author-count\" names-min=\"2\" names-use-first=\"2\"/>\n      <key macro=\"author\"/>\n      <key variable=\"issued\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout>\n      <group delimiter=\" \">\n        <group delimiter=\", \">\n          <group delimiter=\" \">\n            <group delimiter=\", \">\n              <text macro=\"author\"/>\n              <group>\n                <text macro=\"title\"/>\n                <text macro=\"book-container\"/>\n              </group>\n              <text macro=\"broadcast-container\"/>\n              <text macro=\"volume-book\"/>\n              <text macro=\"looseleaf-note\"/>\n            </group>\n            <group delimiter=\" \">\n              <text macro=\"date-parenthesis\"/>\n              <text macro=\"bill-number\"/>\n              <text macro=\"article-case-info\"/>\n              <text macro=\"publisher\"/>\n            </group>\n          </group>\n          <text macro=\"treaty-catchall\"/>\n        </group>\n        <group delimiter=\" \">\n          <text macro=\"page-first\"/>\n          <text macro=\"court\"/>\n        </group>\n        <text macro=\"URL\"/>\n      </group>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/pandoc-citeproc-118.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- director:\n    family: Hitchcock\n    given: Alfred\n  id: nbn\n  issued:\n    year: 1959\n  language: 'en-US'\n  publisher: 'Metro-Goldwyn-Mayer'\n  publisher-place: USA\n  title: North by Northwest\n  type: motion_picture\n---\n\n[@nbn] is a spy thriller film.\n^D\n(Hitchcock 1959) is a spy thriller film.\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-nbn .csl-entry}\nHitchcock, Alfred, dir. 1959. *North by Northwest*. Metro-Goldwyn-Mayer.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-119.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nbibliography: 'command/averroes.bib'\ncsl: command/apa.csl\n---\n\n@averroes/bland; @averroes/hannes; @averroes/hercz\n\nReferences {#references .unnumbered}\n==========\n^D\nAverroes (1982); Averroes (1892); Averroes (1869)\n\n# References {#references .unnumbered}\n\n:::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\" line-spacing=\"2\"}\n::: {#ref-averroes/hercz .csl-entry}\nAverroes. (1869). *Drei Abhandlungen über die Conjunction des separaten\nIntellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem\nArabischen übersetzt von Samuel Ibn Tibbon*. (J. Hercz, Ed. & Trans.).\nBerlin: S. Hermann.\n:::\n\n::: {#ref-averroes/hannes .csl-entry}\nAverroes. (1892). *Des Averroës Abhandlung: \"Über die Möglichkeit der\nConjunktion\" oder \"Über den materiellen Intellekt\"*. (L. Hannes, Ed. &\nTrans.). Halle an der Saale: C. A. Kaemmerer.\n:::\n\n::: {#ref-averroes/bland .csl-entry}\nAverroes. (1982). *The epistle on the possibility of conjunction with\nthe active intellect by Ibn Rushd with the commentary of Moses Narboni*.\n(K. P. Bland, Ed. & Trans.). New York: Jewish Theological Seminary of\nAmerica.\n:::\n::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-13.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-note-bibliography.csl'\nreferences:\n- author:\n    family: Author\n    given:\n    - Ann\n  container-title: Journal\n  id: item1\n  issued:\n  - year: 2011\n  title: Title\n  type: 'article-newspaper'\n---\n\nFoo [@item1].\n^D\nFoo.[^1]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-item1 .csl-entry}\nAuthor, Ann. \"Title.\" *Journal*, 2011.\n:::\n::::\n\n[^1]: Author, \"Title.\"\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-136.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- id: stanze\n  type: book\n  issued:\n  - year: 1547\n  title: Stanze in lode della donna brutta\n  publisher-place: Florence\n  language: it-IT\n...\n\n@stanze is an anoynymous work.\n^D\n*Stanze in lode della donna brutta* (1547) is an anoynymous work.\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-stanze .csl-entry}\n*Stanze in lode della donna brutta*. 1547. Florence.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-14.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n    family: Pelikan\n    given: Jaroslav\n  container-title: 'The Christian tradition: A history of the\n    development of doctrine'\n  id: CTv1c2\n  issued:\n  - year: 1971\n  language: 'en-US'\n  page: '34-56'\n  publisher: University of Chicago Press\n  publisher-place: Chicago\n  title: Chapter two\n  type: chapter\n  volume: 1\n  volume-title: 'The emergence of the Catholic tradition (100--600)'\n- author:\n    family: Pelikan\n    given: Jaroslav\n  container-title: 'The Christian tradition: A history of the\n    development of doctrine'\n  id: CTv1\n  issued:\n  - year: 1971\n  language: 'en-US'\n  publisher: University of Chicago Press\n  publisher-place: Chicago\n  title: 'The emergence of the Catholic tradition (100--600)'\n  type: book\n  volume: 1\n- author:\n    family: Pelikan\n    given: Jaroslav\n  id: CT\n  issued:\n  - year: 1971\n  language: 'en-US'\n  publisher: University of Chicago Press\n  publisher-place: Chicago\n  title: 'The Christian tradition: A history of the development of\n    doctrine'\n  type: book\n---\n\nFoo [@CT, 1:12]. Bar [@CTv1, 12]. Baz [@CTv1c2, 12].\n\nReferences {#references .unnumbered}\n==========\n^D\nFoo (Pelikan 1971b, 1:12). Bar (Pelikan 1971c, 12). Baz (Pelikan 1971a,\n12).\n\n# References {#references .unnumbered}\n\n:::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-CTv1c2 .csl-entry}\nPelikan, Jaroslav. 1971a. \"Chapter Two.\" In *The Emergence of the\nCatholic Tradition (100--600)*, vol. 1 of *The Christian Tradition: A\nHistory of the Development of Doctrine*. University of Chicago Press.\n:::\n\n::: {#ref-CT .csl-entry}\nPelikan, Jaroslav. 1971b. *The Christian Tradition: A History of the\nDevelopment of Doctrine*. University of Chicago Press.\n:::\n\n::: {#ref-CTv1 .csl-entry}\nPelikan, Jaroslav. 1971c. *The Emergence of the Catholic Tradition\n(100--600)*. In *The Christian Tradition: A History of the Development\nof Doctrine*, vol. 1. University of Chicago Press.\n:::\n::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-152.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/apa.csl\nreferences:\n- URL: 'http://geekfeminism.wikia.com/wiki/Geek_Feminism'\n  accessed:\n    day: 10\n    month: 4\n    year: 2013\n  container-title: Geek Feminism\n  custom2: ok.mm\n  id: Feminism2013gf\n  issued:\n    day: 10\n    month: 4\n    year: 2013\n  keyword: gender\n  title: Geek Feminism\n  type: webpage\n- URL: 'http://geekfeminism.wikia.com/wiki/Category:Communities'\n  accessed:\n    day: 19\n    month: 10\n    year: 2011\n  container-title: Geek Feminism\n  custom2: gender.mm\n  id: Feminism2011ces\n  issued:\n    day: 14\n    month: 8\n    year: 2011\n  keyword: gender\n  title: Communities\n  type: 'entry-encyclopedia'\n---\n\nTest\n====\n\nI have two citations [@Feminism2013gf; @Feminism2011ces].\n\nReferences\n==========\n^D\n# Test\n\nI have two citations (\"Communities,\" 2011; \"Geek Feminism,\" 2013).\n\n# References {#references .unnumbered}\n\n::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\" line-spacing=\"2\"}\n::: {#ref-Feminism2011ces .csl-entry}\nCommunities. (2011, August 14). In *Geek Feminism*. Retrieved from\n<http://geekfeminism.wikia.com/wiki/Category:Communities>\n:::\n\n::: {#ref-Feminism2013gf .csl-entry}\nGeek Feminism. (2013, April 10). *Geek Feminism*. Retrieved April 10,\n2013, from <http://geekfeminism.wikia.com/wiki/Geek_Feminism>\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-160.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/issue160.csl\nreferences:\n- author:\n  - family: Doe\n    given: Jane\n  citation-label: Jane11\n  id: item1\n  issued:\n    year: 2011\n  title: A book\n  type: book\n---\n\nNo citation-label\n-----------------\n\nFoo [@item1].\n\nExpected\n--------\n\n> Foo \\[Jane11\\].\n>\n> \\[Jane11\\] Jane Doe. A book. 2011.\n^D\n## No citation-label\n\nFoo \\[Jane11\\].\n\n## Expected\n\n> Foo \\[Jane11\\].\n>\n> \\[Jane11\\] Jane Doe. A book. 2011.\n\n:::: {#refs .references .csl-bib-body}\n::: {#ref-item1 .csl-entry}\n\\[Jane11\\] Jane Doe. A book. 2011.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-175.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Doe\n    given: Jane\n  container-title: A magazine\n  id: item1\n  issued:\n  - month: 1\n    year: 2011\n  - month: 2\n    year: 2011\n  page: '33-44'\n  title: A title\n  type: 'article-magazine'\n---\n\nMissing en-dash between months\n------------------------------\n\nFoo [@item1].\n\nExpected\n--------\n\n> Doe, Jane. 2011. \"A Title.\" *A Magazine*, January--February.\n^D\n## Missing en-dash between months\n\nFoo (Doe 2011).\n\n## Expected\n\n> Doe, Jane. 2011. \"A Title.\" *A Magazine*, January--February.\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nDoe, Jane. 2011. \"A Title.\" *A Magazine*, January--February, 33--44.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-197.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-fullnote-bibliography.csl'\nnocite: '@test'\nreferences:\n- editor:\n  - family: Abelard\n    given: Peter\n  id: test\n  issued:\n    date-parts:\n    - - 1989\n  publisher: Clarendon Press\n  publisher-place: Oxford\n  title: Test\n  type: book\n---\n\nThis is a test [@test].\n^D\nThis is a test.[^1]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-test .csl-entry}\nAbelard, Peter, ed. *Test*. Oxford: Clarendon Press, 1989.\n:::\n::::\n\n[^1]: Peter Abelard, ed., *Test* (Oxford: Clarendon Press, 1989).\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-213.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/harvard-university-of-kent.csl'\nreferences:\n- author:\n  - family: Doe\n    given: Ann\n  collection-title: The collection title\n  dimensions: 789 pp.\n  id: doe1\n  issued:\n  - year: 1999\n  publisher: The publisher\n  title: Title\n  type: book\n---\n\nFoo [@doe1].\n\nReferences {#references .unnumbered}\n==========\n^D\nFoo (Doe 1999).\n\n# References {#references .unnumbered}\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-doe1 .csl-entry}\nDoe, A. (1999). *Title*. The collection title. The publisher. 789 pp.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-25.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Author\n    given: Al\n  id: item1\n  issued:\n    date-parts:\n    - - 1998\n  title: 'foo bar baz: bazbaz foo'\n  type: 'article-journal'\n---\n\nFoo [@item1].\n\nReferences {#references .unnumbered}\n==========\n^D\nFoo (Author 1998).\n\n# References {#references .unnumbered}\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nAuthor, Al. 1998. *Foo Bar Baz: Bazbaz Foo*.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-250.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nlink-citations: true\nreferences:\n- author:\n    family: Doe\n  id: doe\n  title: Title\n---\n\n[@doe]\n^D\n([Doe, n.d.](#ref-doe))\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-doe .csl-entry}\nDoe. n.d. *Title*.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-27.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/science.csl\nreferences:\n- author:\n  - family: AuthorOne\n    given: Joe\n  - family: AuthorTwo\n    given: Jill\n  container-title: Some Journal\n  id: AuthorOne2014\n  issue: X\n  issued:\n    date-parts:\n    - - 2014\n  page: 'XXXX-YYYY'\n  title: Sample Title\n  type: 'article-journal'\n  volume: XX\n---\n\nMinimal example\n===============\n\nHere is some text that needs a citation [@AuthorOne2014].\n^D\n# Minimal example\n\nHere is some text that needs a citation (*1*).\n\n:::: {#refs .references .csl-bib-body}\n::: {#ref-AuthorOne2014 .csl-entry}\n[1. ]{.csl-left-margin}[J. AuthorOne, J. AuthorTwo, *Some Journal*, in\npress.]{.csl-right-inline}\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-292.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/sage-harvard.csl'\nreferences:\n- author:\n    family: Doe\n  id: doe\n  issued:\n    year: 2007\n  type: article\n- author:\n    family: Zoe\n  id: zoe\n  issued:\n  - year: 2009\n  type: article\n- author:\n    family: Roe\n  id: roe\n  issued:\n  - year: 2007\n  type: article\n---\n\n[@zoe; @roe; see for comparison @doe, p. 3]\n^D\n(Roe, 2007; Zoe, 2009; see for comparison Doe, 2007: 3)\n\n:::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-doe .csl-entry}\nDoe (2007).\n:::\n\n::: {#ref-roe .csl-entry}\nRoe (2007).\n:::\n\n::: {#ref-zoe .csl-entry}\nZoe (2009).\n:::\n::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-301.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- id: test\n  title: Essays presented to N.R. Ker (On Art)\n- id: test2\n  title: '*Test:* An experiment: An abridgement'\n---\n\n@test; @test2\n^D\n*Essays Presented to N.R. Ker (On Art)* (n.d.); **Test:* An Experiment:\nAn Abridgement* (n.d.)\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-test .csl-entry}\n*Essays Presented to N.R. Ker (On Art)*. n.d.\n:::\n\n::: {#ref-test2 .csl-entry}\n**Test:* An Experiment: An Abridgement*. n.d.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-307.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nlang: 'fr-FR'\nreferences:\n- author:\n  - family: Bazin\n    given: André\n  container-title: Cahiers du cinéma\n  id: bazin_cybernetique_1954\n  issue: 36\n  issued:\n    date-parts:\n    - - 1954\n      - 6\n  page: '22-27'\n  title: 'La Cybernétique d''André Cayatte'\n  type: 'article-journal'\n---\n\nBonjour[@bazin_cybernetique_1954] !\n^D\nBonjour(Bazin 1954) !\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-bazin_cybernetique_1954 .csl-entry}\nBazin, André. 1954. « La Cybernétique d'André Cayatte ». *Cahiers du\ncinéma*, nᵒ 36 (juin): 22‑27.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-31.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/oscola.csl\nreferences:\n- DOI: 10.1086/504343\n  author:\n  - family: Olson\n    given: Hope A.\n  container-title: Library Quarterly\n  id: item1\n  issue: 1\n  issued:\n    date-parts:\n    - - 2006\n  page: '19-35'\n  title: 'Codes, costs, and critiques: The organization of information\n    in *Library Quarterly*, 1931--2004'\n  title-short: 'Codes, costs, and critiques'\n  type: 'article-magazine'\n  volume: 76\n- id: item2\n  title: Second title\n---\n\nFoo [@item1]. Bar [@item2]. Baz [@item1].\n^D\nFoo.[^1] Bar.[^2] Baz.[^3]\n\n::::: {#refs .references .csl-bib-body}\n::: {#ref-item1 .csl-entry}\nOlson HA, '[Codes, Costs, and Critiques: The Organization of Information\nin *Library Quarterly*, 1931--2004](https://doi.org/10.1086/504343)'\n(2006) 76 *Library Quarterly* 19\n:::\n\n::: {#ref-item2 .csl-entry}\n'Second Title'\n:::\n:::::\n\n[^1]: Hope A Olson, 'Codes, Costs, and Critiques: The Organization of\n    Information in *Library Quarterly*, 1931--2004' (2006) 76 *Library\n    Quarterly* 19.\n\n[^2]: 'Second Title'.\n\n[^3]: Olson (n 1).\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-312.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/apa.csl\nnocite: '@*'\nreferences:\n- author:\n  - literal: NN\n  id: 'Y'\n  issued:\n  - year: 1950\n  title: 'Date: Year'\n  title-short: Date\n  type: webpage\n- author:\n  - literal: NN\n  id: Y/Y\n  issued:\n  - year: 1951\n  - year: 1952\n  title: 'Date range: Year'\n  title-short: Date range\n  type: webpage\n- author:\n  - literal: NN\n  id: YM\n  issued:\n  - month: 1\n    year: 1953\n  title: 'Date: Year+month'\n  title-short: Date\n  type: webpage\n- author:\n  - literal: NN\n  id: YM/YM\n  issued:\n  - month: 1\n    year: 1954\n  - month: 2\n    year: 1955\n  title: 'Date range: Year+month'\n  title-short: Date range\n  type: webpage\n- author:\n  - literal: NN\n  id: YM/YM_same\n  issued:\n  - month: 1\n    year: 1956\n  - month: 2\n    year: 1956\n  title: 'Date range: Year+month, same year'\n  title-short: Date range\n  type: webpage\n- author:\n  - literal: NN\n  id: YMD\n  issued:\n  - day: 15\n    month: 1\n    year: 1958\n  title: 'Date: Year+month+day'\n  title-short: Date\n  type: webpage\n- author:\n  - literal: NN\n  id: YMD/YMD\n  issued:\n  - day: 15\n    month: 1\n    year: 1959\n  - day: 16\n    month: 2\n    year: 1960\n  title: 'Date range: Year+month+day'\n  title-short: Date range\n  type: webpage\n- author:\n  - literal: NN\n  id: YMD/YMD_same\n  issued:\n  - day: 15\n    month: 1\n    year: 1961\n  - day: 16\n    month: 1\n    year: 1962\n  title: 'Date range: Year+month+day, same month'\n  title-short: Date range\n  type: webpage\n- author:\n  - literal: NN\n  id: YS\n  issued:\n  - season: 3\n    year: 1963\n  title: 'Date: Year+season'\n  title-short: Date\n  type: webpage\n- author:\n  - literal: NN\n  id: YS/YS\n  issued:\n  - season: 1\n    year: 1964\n  - season: 4\n    year: 1965\n  title: 'Date range: Year+season'\n  title-short: Date range\n  type: webpage\n- author:\n  - literal: NN\n  id: YS/YS_same\n  issued:\n  - season: 2\n    year: 1966\n  - season: 4\n    year: 1966\n  title: 'Date range: Year+season, same year'\n  title-short: Date range\n  type: webpage\n---\n\n^D\n:::::::::::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\" line-spacing=\"2\"}\n::: {#ref-Y .csl-entry}\nNN. (1950). Date: Year.\n:::\n\n::: {#ref-Y/Y .csl-entry}\nNN. (1951--1952). Date range: Year.\n:::\n\n::: {#ref-YM .csl-entry}\nNN. (1953, January). Date: Year+month.\n:::\n\n::: {#ref-YM/YM .csl-entry}\nNN. (1954--1955, January--February). Date range: Year+month.\n:::\n\n::: {#ref-YM/YM_same .csl-entry}\nNN. (1956, January--February). Date range: Year+month, same year.\n:::\n\n::: {#ref-YMD .csl-entry}\nNN. (1958, January 15). Date: Year+month+day.\n:::\n\n::: {#ref-YMD/YMD .csl-entry}\nNN. (1959--1960, January 15--February 16). Date range: Year+month+day.\n:::\n\n::: {#ref-YMD/YMD_same .csl-entry}\nNN. (1961--1962, January 15--16). Date range: Year+month+day, same\nmonth.\n:::\n\n::: {#ref-YS .csl-entry}\nNN. (1963, Autumn). Date: Year+season.\n:::\n\n::: {#ref-YS/YS .csl-entry}\nNN. (1964--1965, Spring--Winter). Date range: Year+season.\n:::\n\n::: {#ref-YS/YS_same .csl-entry}\nNN. (1966, Summer--Winter). Date range: Year+season, same year.\n:::\n::::::::::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-320.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/apa.csl\nreferences:\n- author:\n  - family: Benjamin\n    given: A. S.\n  id: itemA1\n- author:\n  - family: Yaakov\n    given: D.\n    non-dropping-particle: ben\n  id: itemA2\n- author:\n  - family: Brown\n    given: J. R.\n  id: itemA3\n- author:\n  - family: Browning\n    given: A. R.\n  id: itemA4\n- author:\n  - family: Girard\n    given: 'J.-B.'\n  id: itemA5\n- author:\n  - family: 'Girard-Perregaux'\n    given: A. S.\n  id: itemA6\n- author:\n  - family: Ibn Abdulaziz\n    given: T.\n  id: itemA7\n- author:\n  - family: Ibn Nidal\n    given: A. K. M.\n  id: itemA8\n- author:\n  - family: López\n    given: M. E.\n  id: itemA9\n- author:\n  - family: López de Molina\n    given: G.\n  id: itemA10\n- author:\n  - family: Singh\n    given: Y.\n  id: itemA11\n- author:\n  - family: Singh Siddhu\n    given: N.\n  id: itemA12\n- author:\n  - family: Villafuerte\n    given: S. A.\n  id: itemA13\n- author:\n  - family: 'Villa-Lobos'\n    given: J.\n  id: itemA14\n- author:\n  - family: Macalister\n    given: Donald\n  id: itemB1\n- author:\n  - family: MacAlister\n    given: Paul\n  id: itemB2\n- author:\n  - family: Macauley\n    given: Catharine\n  id: itemB3\n- author:\n  - family: Macmillan\n    given: Harold\n  id: itemB4\n- author:\n  - family: Madison\n    given: James\n  id: itemB5\n- author:\n  - family: McAllister\n    given: Ward\n  id: itemB6\n- author:\n  - family: McAuley\n    given: Catherine\n  id: itemB7\n- author:\n  - family: McMillan\n    given: Edwin M.\n  id: itemB8\n- author:\n  - family: 'Sainte-Beuve'\n    given: 'Charles-Augustin'\n  id: itemC1\n- author:\n  - family: 'Saint-Gaudens'\n    given: Augustus\n  id: itemC2\n- author:\n  - family: 'Saint-Saëns'\n    given: Camille\n  id: itemC3\n- author:\n  - dropping-particle: de\n    family: San Martin\n    given: José\n  id: itemC4\n- author:\n  - family: St. Denis\n    given: Ruth\n  id: itemC5\n- author:\n  - family: St. Laurent\n    given: Louis Stephen\n  id: itemC6\n---\n\nFoo\n[@itemA1; @itemA2; @itemA3; @itemA4; @itemA5; @itemA6; @itemA7; @itemA8; @itemA9; @itemA10; @itemA11; @itemA12; @itemA13; @itemA14].\n\nFoo\n[@itemB1; @itemB2; @itemB3; @itemB4; @itemB5; @itemB6; @itemB7; @itemB8].\n\nFoo [@itemC1; @itemC2; @itemC3; @itemC4; @itemC5; @itemC6].\n^D\nFoo (ben Yaakov, n.d.; Benjamin, n.d.; Brown, n.d.; Browning, n.d.;\nGirard, n.d.; Girard-Perregaux, n.d.; Ibn Abdulaziz, n.d.; Ibn Nidal,\nn.d.; López de Molina, n.d.; López, n.d.; Singh Siddhu, n.d.; Singh,\nn.d.; Villafuerte, n.d.; Villa-Lobos, n.d.).\n\nFoo (Macalister, n.d.; MacAlister, n.d.; Macauley, n.d.; Macmillan,\nn.d.; Madison, n.d.; McAllister, n.d.; McAuley, n.d.; McMillan, n.d.).\n\nFoo (Sainte-Beuve, n.d.; Saint-Gaudens, n.d.; Saint-Saëns, n.d.; San\nMartin, n.d.; St. Denis, n.d.; St. Laurent, n.d.).\n\n::::::::::::::::::::::::::::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\" line-spacing=\"2\"}\n::: {#ref-itemA2 .csl-entry}\nben Yaakov, D. (n.d.).\n:::\n\n::: {#ref-itemA1 .csl-entry}\nBenjamin, A. S. (n.d.).\n:::\n\n::: {#ref-itemA3 .csl-entry}\nBrown, J. R. (n.d.).\n:::\n\n::: {#ref-itemA4 .csl-entry}\nBrowning, A. R. (n.d.).\n:::\n\n::: {#ref-itemA5 .csl-entry}\nGirard, J.-B. (n.d.).\n:::\n\n::: {#ref-itemA6 .csl-entry}\nGirard-Perregaux, A. S. (n.d.).\n:::\n\n::: {#ref-itemA7 .csl-entry}\nIbn Abdulaziz, T. (n.d.).\n:::\n\n::: {#ref-itemA8 .csl-entry}\nIbn Nidal, A. K. M. (n.d.).\n:::\n\n::: {#ref-itemA10 .csl-entry}\nLópez de Molina, G. (n.d.).\n:::\n\n::: {#ref-itemA9 .csl-entry}\nLópez, M. E. (n.d.).\n:::\n\n::: {#ref-itemB1 .csl-entry}\nMacalister, D. (n.d.).\n:::\n\n::: {#ref-itemB2 .csl-entry}\nMacAlister, P. (n.d.).\n:::\n\n::: {#ref-itemB3 .csl-entry}\nMacauley, C. (n.d.).\n:::\n\n::: {#ref-itemB4 .csl-entry}\nMacmillan, H. (n.d.).\n:::\n\n::: {#ref-itemB5 .csl-entry}\nMadison, J. (n.d.).\n:::\n\n::: {#ref-itemB6 .csl-entry}\nMcAllister, W. (n.d.).\n:::\n\n::: {#ref-itemB7 .csl-entry}\nMcAuley, C. (n.d.).\n:::\n\n::: {#ref-itemB8 .csl-entry}\nMcMillan, E. M. (n.d.).\n:::\n\n::: {#ref-itemC1 .csl-entry}\nSainte-Beuve, C.-A. (n.d.).\n:::\n\n::: {#ref-itemC2 .csl-entry}\nSaint-Gaudens, A. (n.d.).\n:::\n\n::: {#ref-itemC3 .csl-entry}\nSaint-Saëns, C. (n.d.).\n:::\n\n::: {#ref-itemC4 .csl-entry}\nSan Martin, J. de. (n.d.).\n:::\n\n::: {#ref-itemA12 .csl-entry}\nSingh Siddhu, N. (n.d.).\n:::\n\n::: {#ref-itemA11 .csl-entry}\nSingh, Y. (n.d.).\n:::\n\n::: {#ref-itemC5 .csl-entry}\nSt. Denis, R. (n.d.).\n:::\n\n::: {#ref-itemC6 .csl-entry}\nSt. Laurent, L. S. (n.d.).\n:::\n\n::: {#ref-itemA13 .csl-entry}\nVillafuerte, S. A. (n.d.).\n:::\n\n::: {#ref-itemA14 .csl-entry}\nVilla-Lobos, J. (n.d.).\n:::\n:::::::::::::::::::::::::::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-320a.md",
    "content": "```\n% pandoc --citeproc -t plain\n---\nreferences:\n- author:\n  - family: ʾUdhrī\n    given: Jamīl\n    non-dropping-particle: 'al-'\n  issued: 2000\n  title: hamza\n  id: item1\n- author:\n  - family: ʿUdhrī\n    given: Jamīl\n    non-dropping-particle: 'al-'\n  issued: 2000\n  title: ayn\n  id: item2\n- author:\n  - family: \"'Udhrī\"\n    given: Jamīl\n    non-dropping-particle: 'al-'\n  issued: 2000\n  title: straight apostrophe\n  id: item3\n- author:\n  - family: '‘Udhrī'\n    given: Jamīl\n    non-dropping-particle: 'al-'\n  issued: 2000\n  title: inverted curly apostrophe = opening single curly quote (for ayn)\n  id: item4\n- author:\n  - family: '’Udhrī'\n    given: Jamīl\n    non-dropping-particle: 'al-'\n  issued: 2000\n  title: curly apostrophe = closing single curly quote (for hamza)\n  id: item5\n- author:\n  - family: Uch\n    given: Ann\n  id: item6\n  issued: 2000\n- author:\n  - family: Uebel\n    given: Joe\n  id: item7\n  issued: 2000\n- author:\n  - family: Zzz\n    given: Zoe\n  id: item8\n  issued: 2000\n---\n\nFoo [@item1; @item2; @item3; @item4; @item5; @item6; @item7; @item8].\n^D\nFoo (al-ʾUdhrī 2000; al-ʿUdhrī 2000; al-’Udhrī 2000b, 2000a; al-‘Udhrī\n2000; Uch 2000; Uebel 2000; Zzz 2000).\n\nUch, Ann. 2000.\n\n‘Udhrī, Jamīl al-. 2000. Inverted Curly Apostrophe = Opening Single\nCurly Quote (for Ayn).\n\nʿUdhrī, Jamīl al-. 2000. Ayn.\n\n’Udhrī, Jamīl al-. 2000a. Curly Apostrophe = Closing Single Curly Quote\n(for Hamza).\n\nʾUdhrī, Jamīl al-. 2000. Hamza.\n\n’Udhrī, Jamīl al-. 2000b. Straight Apostrophe.\n\nUebel, Joe. 2000.\n\nZzz, Zoe. 2000.\n\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-322.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/annales.csl\nreferences:\n- author:\n  - family: Timmory\n    given: François\n  container-title: 'L''Écran français'\n  id: timmory\\_\\_justice_1950\n  issue: 272\n  issued:\n  - day: 25\n    month: 9\n    year: 1950\n  language: 'fr-FR'\n  page: 12\n  title: '*Justice est faite* : soyons justes'\n  type: 'article-journal'\n---\n\nFoo [@timmory__justice_1950].\n^D\nFoo.[^1]\n\n:::: {#refs .references .csl-bib-body}\n::: {#ref-timmory__justice_1950 .csl-entry}\nFrançois [Timmory]{.smallcaps}, « *Justice est faite* : soyons justes »,\n*L'Écran français*, 1950, nᵒ 272, p. 12.\n:::\n::::\n\n[^1]: François [Timmory]{.smallcaps}, « *Justice est faite* : soyons\n    justes », *L'Écran français*, 1950, nᵒ 272, p. 12.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-325.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Smith\n    given: John\n  id: item1\n  type: book\n- author:\n  - family: Smith\n    given: John\n  id: item2\n  type: book\n---\n\n[@item1; @item2]\n^D\n(Smith, n.d.-a, n.d.-b)\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nSmith, John. n.d.-a.\n:::\n\n::: {#ref-item2 .csl-entry}\nSmith, John. n.d.-b.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-327.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chinese-gb7714-2005-numeric.csl'\nreferences:\n- ISSN: '1003-1111'\n  URL: 'http://kns.cnki.net/kns/detail/detail.aspx?QueryID=4&CurRec=4&recid=&FileName=CHAN201706006&DbName=CJFDLAST2018&DbCode=CJFQ&yx=Y&pr=&URLID=21.1110.S.20171129.1725.006'\n  abstract: '为了解辽东湾海域底栖动物次级生产力水平和时空分布特点,根据2007年的4月和10月辽东湾海域大型底栖动物调查数据,运用Brey经验公式计算大型底栖动物次级生产力和P/B值,并结合海洋生物指数方法对辽东湾海域进行生境适宜性评价。分析结果表明,该海域大型底栖动物年平均次级生产力为5.59g/(m\\~2·年),年平均P/B值为3.16,辽东湾大型底栖动物次级生产力空间分布呈现出自沿岸向中部递增的趋势,P/B值空间分布与底栖动物次级生产力相反,呈现出自沿岸向中部递减的趋势,群落组成中以个体小、生活史短、代谢快的底栖动物为主。'\n  accessed:\n  - day: 27\n    month: 3\n    year: 2018\n  author:\n  - family: 李\n    given: 轶平\n  - family: 于\n    given: 旭光\n  - family: 孙\n    given: 明\n  - family: 郭\n    given: 栋\n  - family: 段\n    given: 妍\n  - family: 董\n    given: 婧\n  container-title: 水产科学\n  id: LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017\n  issue: 06\n  issued:\n  - year: 2017\n  keyword: '次级生产力,大型底栖动物,海洋生物指数方法,AMBI,macrozoobenthos,P/B\n    value,P/B值,secondary productivity'\n  language: 中文;\n  page: '728-734'\n  title: 辽东湾海域底栖动物次级生产力研究及生境适宜性评价\n  type: 'article-journal'\n---\n\nI referenced something here\n[@LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017]\n^D\nI referenced something here^\\[1\\]^\n\n:::: {#refs .references .csl-bib-body entry-spacing=\"0\"}\n::: {#ref-LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017 .csl-entry}\n[\\[1\\] ]{.csl-left-margin}[李轶平, 于旭光, 孙明, 等.\n[辽东湾海域底栖动物次级生产力研究及生境适宜性评价](http://kns.cnki.net/kns/detail/detail.aspx?QueryID=4&CurRec=4&recid=&FileName=CHAN201706006&DbName=CJFDLAST2018&DbCode=CJFQ&yx=Y&pr=&URLID=21.1110.S.20171129.1725.006)\\[J\\].\n水产科学, 2017(6): 728～734.]{.csl-right-inline}\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-338.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/din-1505-2.csl'\nlang: de\nnocite: '@*'\npagetitle: Citation\nreferences:\n- ISBN: '978-3-642-32078-1'\n  author:\n  - family: Wolfinger\n    given: Christine\n  edition: '11., vollst. überarb. Aufl.'\n  id: 'item-1'\n  issued:\n  - year: 2013\n  keyword: UNIX; LINUX\n  number-of-pages: 'XVIII, 529 S. : Ill., graph. Darst.'\n  publisher: Springer Vieweg\n  publisher-place: 'Berlin \\[u.a.\\]'\n  title: 'Keine Angst vor Linux, Unix: ein Lehrbuch für Linux- und\n    Unix-Anwender'\n  type: book\n---\n\n^D\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item-1 .csl-entry}\n[Wolfinger, Christine]{.smallcaps}: *Keine Angst vor Linux, Unix: ein\nLehrbuch für Linux- und Unix-Anwender*. 11., vollst. überarb. Aufl.\nAufl. Berlin \\[u.a.\\] : Springer Vieweg, 2013 --- ISBN 978-3-642-32078-1\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-351.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/zeitschrift-fur-kunstgeschichte.csl'\nreferences:\n- editor:\n  - family: Nietzsche\n    given: Friedrich\n  id: Nie72\n  issued:\n  - year: 1872\n  title: Die geburt\n  type: book\n---\n\n@Nie72\n^D\nFriedrich Nietzsche (ed.)[^1]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-Nie72 .csl-entry}\nNietzsche, Friedrich (ed.), *Die geburt*, 1872.\n:::\n::::\n\n[^1]: *Die geburt*, 1872.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-356.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Alice\n  id: foo\n  issued:\n  - year: 2042\n  other-ids:\n  - bar\n  - doz\n  type: book\n---\n\n[@bar]\n^D\n2> [WARNING] Citeproc: citation bar not found\n(**bar?**)\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-360.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-fullnote-bibliography.csl'\nreferences:\n- author:\n  - family: 'L''Estrange'\n    given: Michael\n  - family: Merchant\n    given: Stephen\n  id: lestrange2017\n  issued:\n  - day: 18\n    month: 7\n    year: 2017\n  language: 'en-US'\n  title: 2017 Independent Intelligence Review\n  title-short: Independent Intelligence Review\n  type: report\n---\n\n[@lestrange2017]\n^D\n[^1]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-lestrange2017 .csl-entry}\nL'Estrange, Michael, and Stephen Merchant. \"2017 Independent\nIntelligence Review,\" July 18, 2017.\n:::\n::::\n\n[^1]: Michael L'Estrange and Stephen Merchant, \"2017 Independent\n    Intelligence Review,\" July 18, 2017.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-361.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/locators.csl\nreferences:\n- id: citekey\n  title: Title\n  type: 'article-journal'\n- id: other\n  title: Other\n  type: 'article-journal'\nsuppress-bibliography: true\n---\n\nContent[@citekey]\n\nContent[@citekey, 1]\n\nContent[@citekey, 2]\n\nContent[@citekey, 2]\n\nContent[@citekey 2]\n\nContent[@citekey, p. 2]\n\nContent[@citekey p. 2]\n\nContent[@citekey]\n\nContent[@other]\n\nContent[@citekey, 3]\n\nContent[@citekey, 3]\n^D\nContent[^1]\n\nContent[^2]\n\nContent[^3]\n\nContent[^4]\n\nContent[^5]\n\nContent[^6]\n\nContent[^7]\n\nContent[^8]\n\nContent[^9]\n\nContent[^10]\n\nContent[^11]\n\n[^1]: Title.\n\n[^2]: Ibid-with-locator {1}.\n\n[^3]: Ibid-with-locator {2}.\n\n[^4]: Ibid.\n\n[^5]: Ibid.\n\n[^6]: Ibid.\n\n[^7]: Ibid.\n\n[^8]: Subsequent.\n\n[^9]: Other.\n\n[^10]: Subsequent {3}.\n\n[^11]: Ibid.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-365.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/le-tapuscrit-note.csl'\nreferences:\n- ISBN: '978-2-912573-52-0'\n  author:\n  - family: Le Gras\n    given: Gwénaëlle\n  call-number: 'Tolbiac - Rez de Jardin - Littérature et art - Magasin -\n    2010-82178'\n  collection-title: 'Jeux d''acteurs'\n  id: legras_michel_2010\n  issued:\n  - year: 2010\n  language: fre\n  number-of-pages: 128\n  publisher: Scope\n  publisher-place: Paris\n  source: 'BnF Catalogue général (http://catalogue.bnf.fr)'\n  title: 'Michel Simon : l''art de la disgrâce'\n  title-short: Michel Simon\n  type: book\n---\n\nFoo [@legras_michel_2010].\n^D\nFoo.[^1]\n\n:::: {#refs .references .csl-bib-body}\n::: {#ref-legras_michel_2010 .csl-entry}\n[Le Gras]{.smallcaps} Gwénaëlle, *Michel Simon : l'art de la disgrâce*,\nParis, Scope (coll. « Jeux d'acteurs »), 2010, 128 p.\n:::\n::::\n\n[^1]: Gwénaëlle Le Gras, *Michel Simon : l'art de la disgrâce*, Paris,\n    Scope, 2010, 128 p.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-371.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Doe\n    given: Jane\n  id: item1\n  status: in press\n  title: Title one\n  type: book\n- author:\n  - family: Doe\n    given: Jane\n  id: item2\n  issued:\n  - year: 2018\n  title: Title two\n  type: book\n---\n\nFoo [@item2; @item1].\n\nReferences {#references .unnumbered}\n==========\n^D\nFoo (Doe 2018, in press).\n\n# References {#references .unnumbered}\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item2 .csl-entry}\nDoe, Jane. 2018. *Title Two*.\n:::\n\n::: {#ref-item1 .csl-entry}\nDoe, Jane. In press. *Title One*.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-38.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Doe\n    given: Ann\n  - family: Doe\n    given: Ben\n  - family: Roe\n    given: Ron\n  id: a\n  issued:\n    date-parts:\n    - - 2007\n  title: Title\n  type: 'article-journal'\n---\n\n@a\n^D\nDoe et al. (2007)\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-a .csl-entry}\nDoe, Ann, Ben Doe, and Ron Roe. 2007. *Title*.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-386.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/advanced-optical-materials.csl'\nreferences:\n- DOI: 10.1038/lsa.2012.20\n  ISSN: '2047-7538'\n  author:\n  - family: Ding\n    given: K.\n  - family: Ning\n    given: C. Z.\n  container-title: Light Sci. Appl.\n  id: ding_metallic_2012\n  issue: 7\n  issued:\n  - month: 7\n    year: 2012\n  page: 'e20-e20'\n  title: 'Metallic subwavelength-cavity semiconductor nanolasers'\n  type: 'article-journal'\n  volume: 1\n---\n\n@ding_metallic_2012\n^D\n^\\[1\\]^\n\n:::: {#refs .references .csl-bib-body entry-spacing=\"0\" line-spacing=\"2\"}\n::: {#ref-ding_metallic_2012 .csl-entry}\n[\\[1\\] ]{.csl-left-margin}[[K. Ding, C. Z. Ning, *Light Sci. Appl.*\n**2012**, *1*,\ne20](https://doi.org/10.1038/lsa.2012.20).]{.csl-right-inline}\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-392.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/vancouver.csl\nreferences:\n- author:\n  - family: James\n    given: M.R.C.E.L.\n  id: james\n- author:\n  - family: MacFarlane\n    given: J. G.\n  id: macfarlane\n---\n\n@james; @macfarlane\n^D\n(1); (2)\n\n::::: {#refs .references .csl-bib-body}\n::: {#ref-james .csl-entry}\n[1. ]{.csl-left-margin}[James MRCEL. ]{.csl-right-inline}\n:::\n\n::: {#ref-macfarlane .csl-entry}\n[2. ]{.csl-left-margin}[MacFarlane JG. ]{.csl-right-inline}\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-399.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/style399.csl\nreferences:\n- author:\n  - family: One\n  id: one\n- author:\n  - family: Two\n  id: two\n- author:\n  - family: Three\n  id: three\n- author:\n  - family: Four\n  id: four\n- author:\n  - family: Five\n  id: five\n- author:\n  - family: Six\n  id: six\n- author:\n  - family: Seven\n  id: seven\n- author:\n  - family: Eight\n  id: eight\n- author:\n  - family: Nine\n  id: nine\n- author:\n  - family: Ten\n  id: ten\n- author:\n  - family: Eleven\n  id: eleven\n---\n\nInline citation\n[@one; @two; @three; @four; @five; @six; @seven; @eight; @nine; @ten; @eleven].\n^D\nInline citation \\[1,2,3,4,5,6,7,8,9,10,11\\].\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-401.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- id: haslanger2012SocialConstructionDebunking\n  type: chapter\n  author:\n  - family: Haslanger\n    given: Sally\n  issued:\n  - year: 2012\n  original-date:\n  - year: 2003\n  title: 'Social Construction: The ‘Debunking’ Project'\n  title-short: Social Construction\n  container-title: 'Resisting Reality: Social Construction and Social Critique'\n  publisher: Oxford University Press\n  publisher-place: Oxford\n  event-place: Oxford\n  page: 113–138\n  ISBN: 978-0-19-989262-4\n\n- id: haslanger2012FeminismMetaphysicsNegotiating\n  type: chapter\n  author:\n  - family: Haslanger\n    given: Sally\n  issued:\n  - year: 2012\n  original-date:\n  - year: 2000\n  title: 'Feminism in Metaphysics: Negotiating the Natural'\n  container-title: 'Resisting Reality: Social Construction and Social Critique'\n  publisher: Oxford University Press\n  publisher-place: Oxford\n  event-place: Oxford\n  page: 139–157\n  ISBN: 978-0-19-989262-4\n  language: en\n...\n\nHaslanger [-@haslanger2012SocialConstructionDebunking; @haslanger2012FeminismMetaphysicsNegotiating] says...\n^D\nHaslanger (\\[2003\\] 2012, \\[2000\\] 2012) says...\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-haslanger2012FeminismMetaphysicsNegotiating .csl-entry}\nHaslanger, Sally. (2000) 2012. \"Feminism in Metaphysics: Negotiating the\nNatural.\" In *Resisting Reality: Social Construction and Social\nCritique*. Oxford University Press.\n:::\n\n::: {#ref-haslanger2012SocialConstructionDebunking .csl-entry}\nHaslanger, Sally. (2003) 2012. \"Social Construction: The 'Debunking'\nProject.\" In *Resisting Reality: Social Construction and Social\nCritique*. Oxford University Press.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-408.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- id: smith1\n  type: article-journal\n  author:\n  - family: Smith\n    given: Mary\n  issued:\n  - year: 2019\n  title: Foo\n\n- id: smithsmith\n  type: article-journal\n  author:\n  - family: Smith\n    given: Mary\n  - family: Smith\n    given: John\n  issued:\n  - year: 2019\n  title: Foo bar\n...\n\n[@smithsmith; @smith1]\n^D\n(Smith and Smith 2019; Smith 2019)\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-smith1 .csl-entry}\nSmith, Mary. 2019. *Foo*.\n:::\n\n::: {#ref-smithsmith .csl-entry}\nSmith, Mary, and John Smith. 2019. *Foo Bar*.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-416.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\nBlah blah [@item1; @item2; @item3].\n\n# References {-}\n\n---\ntitle: The Title\nreferences:\n- id: item1\n  type: article-newspaper\n  author:\n  - family: Doe\n    given: J.\n  issued:\n  - year: 2010\n    month: 12\n    day: 13\n  title: The title\n- id: item2\n  type: article-newspaper\n  author:\n  - family: Doe\n    given: J.\n  issued:\n  - year: 2007\n    month: 12\n    day: 12\n  - year: 2007\n    month: 12\n    day: 13\n  title: The title\n- id: item3\n  type: article-newspaper\n  author:\n  - family: Doe\n    given: J.\n  issued:\n  - year: 2008\n  title: The title\n...\n^D\nBlah blah (Doe 2010, 2007, 2008).\n\n# References {#references .unnumbered}\n\n:::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item2 .csl-entry}\nDoe, J. 2007. *The Title*. December 12--13.\n:::\n\n::: {#ref-item3 .csl-entry}\nDoe, J. 2008. *The Title*.\n:::\n\n::: {#ref-item1 .csl-entry}\nDoe, J. 2010. *The Title*. December 13.\n:::\n::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-437.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/issue437.csl\nreferences:\n- author:\n  - family: Smith\n    given: John\n  id: hirt2009\n  issued:\n  - year: 2009\n  publisher: Publishing House\n  publisher-place: Lausanne\n  title: Some Book\n  type: book\n---\n\n> Here is a quote. [@hirt2009]\n^D\n> Here is a quote.[^1]\n\n[^1]: John Smith, Some Book, Lausanne, 2009\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-47.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Doe\n    given: A.\n  id: doe\n  issued:\n    date-parts:\n    - - 2000\n  title: Title\n  type: book\n- author:\n  - family: Doe\n    given: A.\n  - family: Poe\n    given: A.\n  id: doepoe\n  issued:\n    date-parts:\n    - - 2000\n  title: Title\n  type: book\n- editor:\n  - family: Doe\n    given: A.\n  id: 'doe-ed'\n  issued:\n    date-parts:\n    - - 2000\n  title: Title\n  type: book\n- author:\n  - family: Doe\n    given: A.\n  - family: Loe\n    given: A.\n  - family: Toe\n    given: A.\n  id: doeloetoe\n  issued:\n    date-parts:\n    - - 2000\n  title: Title\n  type: book\n---\n\nFoo [@doe]. Bar [@doepoe]. Foo [@doe-ed]. Bar [@doeloetoe].\n\nExpected output:\n\n> Doe, A. 2000a. Title.\n>\n> ---------, ed. 2000b. Title.\n>\n> Doe, A., A. Loe, and A. Toe. 2000. Title.\n>\n> Doe, A., and A. Poe. 2000. Title.\n\n(See CMoS, 16e, 15.16, \"Single author versus several authors---reference\nlist order\": \"Successive entries by two or more authors in which only\nthe first author's name is the same are alphabetized according to the\ncoauthors' last names (regardless of how many coauthors there are).\" and\n15.18, \"The 3-em dash with edited, translated, or compiled works\": \"The\nchronological order is maintained, regardless of the added abbreviation.\n\\[ed., trans., comp., or whatever\\]\"\n\nReferences {#references .unnumbered}\n==========\n^D\nFoo (Doe 2000a). Bar (Doe and Poe 2000). Foo (Doe 2000b). Bar (Doe et\nal. 2000).\n\nExpected output:\n\n> Doe, A. 2000a. Title.\n>\n> ---------, ed. 2000b. Title.\n>\n> Doe, A., A. Loe, and A. Toe. 2000. Title.\n>\n> Doe, A., and A. Poe. 2000. Title.\n\n(See CMoS, 16e, 15.16, \"Single author versus several authors---reference\nlist order\": \"Successive entries by two or more authors in which only\nthe first author's name is the same are alphabetized according to the\ncoauthors' last names (regardless of how many coauthors there are).\" and\n15.18, \"The 3-em dash with edited, translated, or compiled works\": \"The\nchronological order is maintained, regardless of the added abbreviation.\n\\[ed., trans., comp., or whatever\\]\"\n\n# References {#references .unnumbered}\n\n::::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-doe .csl-entry}\nDoe, A. 2000a. *Title*.\n:::\n\n::: {#ref-doe-ed .csl-entry}\nDoe, A., ed. 2000b. *Title*.\n:::\n\n::: {#ref-doeloetoe .csl-entry}\nDoe, A., A. Loe, and A. Toe. 2000. *Title*.\n:::\n\n::: {#ref-doepoe .csl-entry}\nDoe, A., and A. Poe. 2000. *Title*.\n:::\n:::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-51.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Doe\n    given: John\n  container-title: Journal of Something\n  id: item1\n  issued:\n    date-parts:\n    - - 1987\n    - - 1988\n  page: '12-34'\n  title: The title\n  type: 'article-journal'\n  volume: 3\n- author:\n  - family: Roe\n    given: Ron\n  container-title: Journal of Something\n  id: item2\n  issued:\n    date-parts:\n    - - 1987\n  page: '12-34'\n  title: The title\n  type: 'article-journal'\n  volume: 4\n---\n\n@item1; @item2\n^D\nDoe (1987--1988); Roe (1987)\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nDoe, John. 1987--1988. \"The Title.\" *Journal of Something* 3: 12--34.\n:::\n\n::: {#ref-item2 .csl-entry}\nRoe, Ron. 1987. \"The Title.\" *Journal of Something* 4: 12--34.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-53.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/archeologie-medievale.csl\nreferences:\n- title: Work A\n  id: a\n  issued:\n    date-parts:\n    - - 2000\n  author:\n  - given: John\n    family: Doe\n  type: book\n- title: Work B\n  id: b\n  issued:\n    date-parts:\n    - - 1990\n  author:\n  - given: Jane\n    family: Roe\n  type: book\n---\n@a @a @b @b @a @a @b @b\n^D\nDoe[^1] Doe[^2] Roe[^3] Roe[^4] Doe[^5] Doe[^6] Roe[^7] Roe[^8]\n\n::::: {#refs .references .csl-bib-body}\n::: {#ref-a .csl-entry}\n[[Doe J.]{.smallcaps} ]{.csl-block}\n[2000, *Work A*,.]{.csl-left-margin}\n:::\n\n::: {#ref-b .csl-entry}\n[[Roe J.]{.smallcaps} ]{.csl-block}\n[1990, *Work B*,.]{.csl-left-margin}\n:::\n:::::\n\n[^1]: 2000\n\n[^2]: *Ibid.*\n\n[^3]: 1990\n\n[^4]: *Ibid.*\n\n[^5]: 2000\n\n[^6]: *Ibid.*\n\n[^7]: 1990\n\n[^8]: *Ibid.*\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-57.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-author-date-with-original-date-and-status.csl'\nreferences:\n- author:\n  - family: Faraday\n    given: Carry\n  container-title: Seven Trips beyond the Asteroid Belt\n  editor:\n  - family: Oring\n    given: James\n  id: 'Faraday-forthcoming'\n  publisher: Launch Press\n  publisher-place: 'Cape Canaveral, FL'\n  status: forthcoming\n  title: Protean photography\n  type: chapter\n---\n\n[@Faraday-forthcoming]\n\nReferences\n==========\n^D\n(Faraday, forthcoming)\n\n# References {#references .unnumbered}\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-Faraday-forthcoming .csl-entry}\nFaraday, Carry. Forthcoming. \"Protean Photography.\" In *Seven Trips\nBeyond the Asteroid Belt*, edited by James Oring. Cape Canaveral, FL:\nLaunch Press.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-58.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/issue58.csl\nreferences:\n- id: stanze\n  issued:\n    date-parts:\n    - - 1547\n  language: 'it-IT'\n  publisher-place: Florence\n  title: Stanze in lode della donna brutta\n  type: book\n---\n\nIn this item, the title replaces the (unknown) author (see 14.79)\n[@stanze, p. 12].\n\nReferences\n==========\n^D\nIn this item, the title replaces the (unknown) author (see 14.79)\n(*Stanze in lode della donna brutta* 1547, 12).\n\n# References {#references .unnumbered}\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-stanze .csl-entry}\n*Stanze in lode della donna brutta*. 1547. Florence.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-61.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/modern-humanities-research-association.csl'\nreferences:\n- author:\n  - family: Doe\n    given: John\n  id: doe\n  issued:\n    date-parts:\n    - - 1985\n  publisher: Publisher\n  title: Title\n  type: book\n- author:\n  - family: Roe\n    given: Rob\n  id: roe\n  issued:\n    date-parts:\n    - - 1985\n  publisher: Publisher\n  title: Title\n  type: book\n---\n\nText\n====\n\nFoo [@doe, VIII, 89]\n\nFoo [@roe, III, 89]\n\nFoo [@doe, LVIII, 89]\n\nFoo [@roe, MVIII, 89]\n\nFoo [@doe, CL, 89]\n\nReferences\n==========\n^D\n# Text\n\nFoo[^1]\n\nFoo[^2]\n\nFoo[^3]\n\nFoo[^4]\n\nFoo[^5]\n\n# References {#references .unnumbered}\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-doe .csl-entry}\nDoe, John, *Title* (Publisher, 1985)\n:::\n\n::: {#ref-roe .csl-entry}\nRoe, Rob, *Title* (Publisher, 1985)\n:::\n:::::\n\n[^1]: John Doe, *Title* (Publisher, 1985), VIII, 89.\n\n[^2]: Rob Roe, *Title* (Publisher, 1985), III, 89.\n\n[^3]: Doe, LVIII, 89.\n\n[^4]: Roe, MVIII, 89.\n\n[^5]: Doe, CL, 89.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-64.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations --csl command/chicago-fullnote-bibliography.csl\n---\nbibliography:\n- command/biblio.bib\nnocite: '[@*]'\n---\n\n^D\n:::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-item2 .csl-entry}\nDoe, John. \"Article.\" *Journal of Generic Studies* 6 (2006): 33--34.\n:::\n\n::: {#ref-item1 .csl-entry}\n---------. *First Book*. Cambridge: Cambridge University Press, 2005.\n:::\n\n::: {#ref-пункт3 .csl-entry}\nDoe, John, and Jenny Roe. \"Why Water Is Wet.\" In *Third Book*, edited by\nSam Smith. Oxford: Oxford University Press, 2007.\n:::\n::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-65.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- ISBN: 3406493556\n  author:\n  - family: Stotz\n    given: Peter\n  call-number: 'PA25 PA2616 .H24 Abt. 2, T. 5, Bd. 2, etc'\n  collection-number: 2.5\n  collection-title: Handbuch der Altertumswissenschaft\n  event-place: Munich\n  first-reference-note-number: 1\n  id: 'stotz:1996handbuch'\n  issued:\n    literal: 1996_2004\n  language: de\n  number-of-volumes: 5\n  publisher: Beck\n  publisher-place: Munich\n  source: Library of Congress ISBN\n  title: Handbuch zur lateinischen Sprache des Mittelalters\n  title-short: Handbuch\n  type: book\n---\n\n[@stotz:1996handbuch]\n^D\n(Stotz 1996--2004)\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-stotz:1996handbuch .csl-entry}\nStotz, Peter. 1996--2004. *Handbuch zur lateinischen Sprache des\nMittelalters*. 5 vols. Handbuch der Altertumswissenschaft, 2.5. Beck.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-68.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-fullnote-bibliography.csl'\nreferences:\n- ISBN: 0888441088\n  author:\n  - family: Goering\n    given: Joseph\n  call-number: BV4009 .W55 1992\n  collection-number: 108\n  collection-title: Studies and Texts\n  event-place: Toronto\n  first-reference-note-number: 1\n  id: 'goering:1992william'\n  issued:\n    date-parts:\n    - - 1992\n  publisher: Pontifical Institute of Mediaeval Studies\n  publisher-place: Toronto\n  source: toroprod.library.utoronto.ca Library Catalog\n  title: 'William de Montibus (c. 1140--1213): The Schools and the\n    Literature of Pastoral Care'\n  title-short: William de Montibus\n  type: book\n---\n\n\\... a prose commentary [the text of fol. 9r is printed in\n@goering:1992william, pp. 501--3]. \\... a collection of verses with a\nformal prose commentary [excerpts from this text were previously printed\nin @goering:1992william, p. 508--14; it was also briefly described in\n@goering:1992william, pp. 141--42] \\... and finally a note starting with\na citation [@goering:1992william, pp. 141-42].\n^D\n\\... a prose commentary.[^1] \\... a collection of verses with a formal\nprose commentary[^2] \\... and finally a note starting with a\ncitation.[^3]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-goering:1992william .csl-entry}\nGoering, Joseph. *William de Montibus (c. 1140--1213): The Schools and\nthe Literature of Pastoral Care*. Studies and Texts 108. Toronto:\nPontifical Institute of Mediaeval Studies, 1992.\n:::\n::::\n\n[^1]: The text of fol. 9r is printed in Joseph Goering, *William de\n    Montibus (c. 1140--1213): The Schools and the Literature of Pastoral\n    Care*, Studies and Texts 108 (Toronto: Pontifical Institute of\n    Mediaeval Studies, 1992), 501--3.\n\n[^2]: Excerpts from this text were previously printed in Goering,\n    508--14; it was also briefly described in Goering, 141--42.\n\n[^3]: Goering, *William de Montibus*, 141--42.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-7.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n    family: Author\n    given:\n    - Ann\n  container-title: Journal\n  id: item1\n  issued:\n  - day: 24\n    month: 9\n    year: 2011\n  - day: 26\n    month: 9\n    year: 2011\n  title: Title\n  type: 'article-magazine'\n---\n\n@item1\n^D\nAuthor (2011)\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nAuthor, Ann. 2011. \"Title.\" *Journal*, September 24--26.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-70.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- ISBN: 9782503531465\n  author:\n  - family: 'Dinkova-Bruun'\n    given: Greti\n  call-number: CB351 .F564 2009\n  collection-number: 50\n  collection-title: Textes et études du moyen âge\n  container-title: 'Florilegium mediaevale: Études offertes à Jacqueline\n    Hamesse à l''occasion de son éméritat'\n  editor:\n  - family: Meirinhos\n    given: José Francisco\n  - family: Weijers\n    given: Olga\n  event-place: 'Louvain-la-Neuve'\n  first-reference-note-number: 1\n  id: 'bruun:2009samuel'\n  issued:\n    date-parts:\n    - - 2009\n  language: fr\n  page: '155--174'\n  publisher: 'Fédération Internationale des Instituts d''Études\n    Médiévales'\n  publisher-place: 'Louvain-la-Neuve'\n  source: Library of Congress ISBN\n  title: 'Samuel Presbyter and the Glosses to His Versification of Psalm\n    1: An Anti-Church Invective?'\n  title-short: Samuel Presbyter\n  type: chapter\n- ISSN: '0362-1529'\n  author:\n  - family: Thorndike\n    given: Lynn\n  container-title: Traditio\n  first-reference-note-number: 1\n  id: 'thorndike:1955unde'\n  issued:\n    date-parts:\n    - - 1955\n  language: la\n  note: 'ArticleType: research-article / Full publication date: 1955 /\n    Copyright © 1955 Fordham University'\n  page: '163--193'\n  source: JSTOR\n  title: Unde versus\n  type: 'article-journal'\n  volume: 11\n---\n\n[@thorndike:1955unde; @bruun:2009samuel]\n^D\n(Thorndike 1955; Dinkova-Bruun 2009)\n\n::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-bruun:2009samuel .csl-entry}\nDinkova-Bruun, Greti. 2009. \"Samuel Presbyter and the Glosses to His\nVersification of Psalm 1: An Anti-Church Invective?\" In *Florilegium\nmediaevale: Études offertes à Jacqueline Hamesse à l'occasion de son\néméritat*, edited by José Francisco Meirinhos and Olga Weijers. Textes\net études du moyen âge 50. Fédération Internationale des Instituts\nd'Études Médiévales.\n:::\n\n::: {#ref-thorndike:1955unde .csl-entry}\nThorndike, Lynn. 1955. \"Unde versus.\" *Traditio* 11: 163--93.\n:::\n:::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-75.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/apa.csl\nreferences:\n- author:\n  - family: Doe\n    given: John\n  id: test\n  issued:\n    date-parts:\n    - - 2006\n  title: Test\n  type: 'article-journal'\n  volume: 81\n---\n\n[@test, p. 6]\n\n[@test, chap. 6]\n\n[@test, n. 6]\n\n[@test, pp. 34-36, 38-39]\n\n[@test, sec. 3]\n\n[@test, p.3]\n\n[@test, 33-35, 38-39]\n\n[@test, 14]\n\n[@test bk. VI]\n\n[@test, no. 6]\n\n[@test, nos. 6 and 7]\n^D\n(Doe, 2006, p. 6)\n\n(Doe, 2006, Chapter 6)\n\n(Doe, 2006, n. 6)\n\n(Doe, 2006, pp. 34--36, 38--39)\n\n(Doe, 2006, sec. 3)\n\n(Doe, 2006, p. 3)\n\n(Doe, 2006, pp. 33--35, 38--39)\n\n(Doe, 2006, p. 14)\n\n(Doe, 2006, bk. VI)\n\n(Doe, 2006, no. 6)\n\n(Doe, 2006, no. 6 and 7)\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\" line-spacing=\"2\"}\n::: {#ref-test .csl-entry}\nDoe, J. (2006). Test, *81*.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-76.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n  - family: Author\n    given: Al\n  id: item1\n  issued:\n    date-parts:\n    - - 1998\n  title: 'foo bar baz: bazbaz bar foo'\n  type: 'article-journal'\n- author:\n  - family: Author\n    given: Al\n  id: item2\n  issued:\n    date-parts:\n    - - 1998\n  title: 'foo bar baz: the bazbaz bar foo'\n  type: 'article-journal'\n- author:\n  - family: Author\n    given: Al\n  id: item3\n  issued:\n    date-parts:\n    - - 1998\n  title: 'foo bar baz: a bazbaz bar foo'\n  type: 'article-journal'\n- author:\n  - family: Author\n    given: Al\n  id: item4\n  issued:\n    date-parts:\n    - - 1998\n  title: 'foo bar baz: an abazbaz bar foo'\n  type: 'article-journal'\n---\n\n@item1, @item2, @item3, @item4\n^D\nAuthor (1998c), Author (1998d), Author (1998a), Author (1998b)\n\n::::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item3 .csl-entry}\nAuthor, Al. 1998a. *Foo Bar Baz: A Bazbaz Bar Foo*.\n:::\n\n::: {#ref-item4 .csl-entry}\nAuthor, Al. 1998b. *Foo Bar Baz: An Abazbaz Bar Foo*.\n:::\n\n::: {#ref-item1 .csl-entry}\nAuthor, Al. 1998c. *Foo Bar Baz: Bazbaz Bar Foo*.\n:::\n\n::: {#ref-item2 .csl-entry}\nAuthor, Al. 1998d. *Foo Bar Baz: The Bazbaz Bar Foo*.\n:::\n:::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-77.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-fullnote-bibliography.csl'\nreferences:\n- author:\n  - family: Doe\n    given: 'John, III'\n    parse-names: true\n  id: item1\n  type: book\n- author:\n  - family: van Gogh\n    given: Vincent\n    parse-names: true\n  id: item2\n  type: book\n- author:\n  - family: Humboldt\n    given: Alexander von\n    parse-names: true\n  id: item3\n  type: book\n- author:\n  - family: Bennett\n    given: 'Frank G.,! Jr.'\n    parse-names: true\n  id: item4\n  type: book\n- author:\n  - family: Dumboldt\n    given: 'Ezekiel, III'\n    parse-names: true\n  id: item5\n  type: book\n---\n\n[@item1; @item2; @item3; @item4; @item5]\n^D\n[^1]\n\n:::::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-item4 .csl-entry}\nBennett, Frank G., Jr., n.d.\n:::\n\n::: {#ref-item1 .csl-entry}\nDoe, John, III, n.d.\n:::\n\n::: {#ref-item5 .csl-entry}\nDumboldt, Ezekiel, III, n.d.\n:::\n\n::: {#ref-item2 .csl-entry}\nGogh, Vincent van, n.d.\n:::\n\n::: {#ref-item3 .csl-entry}\nHumboldt, Alexander von, n.d.\n:::\n::::::::\n\n[^1]: John Doe III, n.d.; Vincent van Gogh, n.d.; Alexander von\n    Humboldt, n.d.; Frank G. Bennett, Jr., n.d.; Ezekiel Dumboldt III,\n    n.d.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-82.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-annotated-bibliography.csl'\nreferences:\n- URL: 'https://www.worldcat.org/'\n  accessed:\n    date-parts:\n    - - 2014\n      - 9\n      - 19\n  author:\n  - literal: OCLC\n  first-reference-note-number: 1\n  id: OCLC_i1099\n  title: WorldCat\n  type: webpage\n---\n\nTitle\n=====\n\nSome text.[^1]\n\n[^1]: Comment regarding text, supported by citation [@OCLC_i1099].\n^D\n# Title\n\nSome text.[^1]\n\n:::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-OCLC_i1099 .csl-entry}\nOCLC. \"WorldCat.\" Accessed September 19, 2014.\n<https://www.worldcat.org/>.\n:::\n::::\n\n[^1]: Comment regarding text, supported by citation (OCLC, \"WorldCat\").\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-87.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- URL: 'http://www.example.com'\n  author:\n  - family: Doe\n    given: John\n  container-title: The Web Site\n  id: item1\n  issued:\n    date-parts:\n    - - 2006\n      - 10\n      - 26\n  title: Title\n  type: webpage\n- URL: 'http://www.example.com'\n  author:\n  - family: Doe\n    given: John\n  container-title: The Web Site\n  id: item2\n  issued:\n    date-parts:\n    - - 2006\n      - 10\n      - 26\n    - - 2006\n      - 11\n      - 27\n  title: Title\n  type: webpage\n- URL: 'http://www.example.com'\n  author:\n  - family: Doe\n    given: John\n  container-title: The Web Site\n  id: item2a\n  issued:\n    date-parts:\n    - - 2006\n      - 10\n    - - 2006\n      - 11\n  title: Title\n  type: webpage\n- URL: 'http://www.example.com'\n  author:\n  - family: Doe\n    given: John\n  container-title: The Web Site\n  id: item2b\n  issued:\n    date-parts:\n    - - 2006\n      - 12\n      - 31\n    - - 2007\n      - 1\n      - 1\n  title: Title\n  type: webpage\n- URL: 'http://www.example.com'\n  author:\n  - family: Doe\n    given: John\n  container-title: The Newspaper\n  id: item3\n  issued:\n    date-parts:\n    - - 2006\n      - 10\n      - 26\n    - - 2006\n      - 11\n      - 27\n  title: Title\n  type: 'article-newspaper'\n- URL: 'http://www.example.com'\n  author:\n  - family: Doe\n    given: John\n  container-title: The Newspaper\n  id: item3b\n  issued:\n    date-parts:\n    - - 2006\n      - 10\n    - - 2006\n      - 11\n  title: Title\n  type: 'article-newspaper'\n---\n\n@item1 -- webpage, date\n\n@item2 -- webpage, date range\n\n@item2a -- webpage, date range YM\n\n@item2b -- webpage, date range across years\n\n@item3 -- article-newspaper\n\n@item3b -- article-newspaper YM\n\nReferences\n==========\n^D\nDoe (2006a) -- webpage, date\n\nDoe (2006c) -- webpage, date range\n\nDoe (2006b) -- webpage, date range YM\n\nDoe (2006--2007) -- webpage, date range across years\n\nDoe (2006e) -- article-newspaper\n\nDoe (2006d) -- article-newspaper YM\n\n# References {#references .unnumbered}\n\n::::::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nDoe, John. 2006a. \"Title.\" The Web Site, October 26.\n<http://www.example.com>.\n:::\n\n::: {#ref-item2a .csl-entry}\nDoe, John. 2006b. \"Title.\" The Web Site, October--November.\n<http://www.example.com>.\n:::\n\n::: {#ref-item2 .csl-entry}\nDoe, John. 2006c. \"Title.\" The Web Site, October 26--November 27.\n<http://www.example.com>.\n:::\n\n::: {#ref-item3b .csl-entry}\nDoe, John. 2006d. \"Title.\" *The Newspaper*, October--November.\n<http://www.example.com>.\n:::\n\n::: {#ref-item3 .csl-entry}\nDoe, John. 2006e. \"Title.\" *The Newspaper*, October 26--November 27.\n<http://www.example.com>.\n:::\n\n::: {#ref-item2b .csl-entry}\nDoe, John. 2006--2007. \"Title.\" The Web Site, December 31--January 1.\n<http://www.example.com>.\n:::\n:::::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-chicago-author-date.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nbibliography: command/biblio.bib\nlink-citations: true\n---\n\nPandoc with citeproc-hs\n=======================\n\n[@nonexistent]\n\n@nonexistent\n\n@item1 says blah.\n\n@item1 [p. 30] says blah.\n\n@item1 [p. 30, with suffix] says blah.\n\n@item1 [-@item2 p. 30; see also @пункт3] says blah.\n\nIn a note.[^1]\n\nA citation group [see @item1 chap. 3; also @пункт3 p. 34-35].\n\nAnother one [see @item1 p. 34-35].\n\nAnd another one in a note.[^2]\n\nCitation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere\nelse].\n\nCitation with suffix only [@item1 and nowhere else].\n\nNow some modifiers.[^3]\n\nWith some markup [*see* @item1 p. **32**].\n\nReferences {#references .unnumbered}\n==========\n\n[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].\n\n[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].\n\n[^3]: Like a citation without author: [-@item1], and now Doe with a\n    locator [-@item2 p. 44].\n^D\n2> [WARNING] Citeproc: citation nonexistent not found\n# Pandoc with citeproc-hs\n\n([**nonexistent?**](#ref-nonexistent))\n\n([**nonexistent?**](#ref-nonexistent))\n\nDoe ([2005](#ref-item1)) says blah.\n\nDoe ([2005, 30](#ref-item1)) says blah.\n\nDoe ([2005, 30](#ref-item1), with suffix) says blah.\n\nDoe ([2005](#ref-item1); [2006, 30](#ref-item2); see also [Doe and Roe\n2007](#ref-пункт3)) says blah.\n\nIn a note.[^1]\n\nA citation group (see [Doe 2005, chap. 3](#ref-item1); also [Doe and Roe\n2007, 34--35](#ref-пункт3)).\n\nAnother one (see [Doe 2005, 34--35](#ref-item1)).\n\nAnd another one in a note.[^2]\n\nCitation with a suffix and locator ([Doe 2005, 33, 35--37](#ref-item1),\nand nowhere else).\n\nCitation with suffix only ([Doe 2005](#ref-item1) and nowhere else).\n\nNow some modifiers.[^3]\n\nWith some markup (*see* [Doe 2005, 32](#ref-item1)).\n\n# References {#references .unnumbered}\n\n:::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nDoe, John. 2005. *First Book*. Cambridge University Press.\n:::\n\n::: {#ref-item2 .csl-entry}\nDoe, John. 2006. \"Article.\" *Journal of Generic Studies* 6: 33--34.\n:::\n\n::: {#ref-пункт3 .csl-entry}\nDoe, John, and Jenny Roe. 2007. \"Why Water Is Wet.\" In *Third Book*,\nedited by Sam Smith. Oxford University Press.\n:::\n::::::\n\n[^1]: Doe and Roe ([2007, 12](#ref-пункт3)) and a citation without\n    locators ([Doe and Roe 2007](#ref-пункт3)).\n\n[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1);\n    [2006](#ref-item2); [Doe and Roe 2007](#ref-пункт3)).\n\n[^3]: Like a citation without author: ([2005](#ref-item1)), and now Doe\n    with a locator ([2006, 44](#ref-item2)).\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-chicago-fullnote-bibliography.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nbibliography: command/biblio.bib\ncsl: 'command/chicago-fullnote-bibliography.csl'\nlink-citations: true\n---\n\nPandoc with citeproc-hs\n=======================\n\n[@nonexistent]\n\n@nonexistent\n\n@item1 says blah.\n\n@item1 [p. 30] says blah.\n\n@item1 [p. 30, with suffix] says blah.\n\n@item1 [-@item2 p. 30; see also @пункт3] says blah.\n\nIn a note.[^1]\n\nA citation group [see @item1 chap. 3; also @пункт3 p. 34-35].\n\nAnother one [see @item1 p. 34-35].\n\nAnd another one in a note.[^2]\n\nCitation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere\nelse].\n\nCitation with suffix only [@item1 and nowhere else].\n\nNow some modifiers.[^3]\n\nWith some markup [*see* @item1 p. **32**].\n\nReferences {#references .unnumbered}\n==========\n\n[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].\n\n[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].\n\n[^3]: Like a citation without author: [-@item1], and again\n    [-@item1], and now Doe with a locator [-@item2 p. 44].\n^D\n2> [WARNING] Citeproc: citation nonexistent not found\n# Pandoc with citeproc-hs\n\n[^1]\n\n[^2]\n\nJohn Doe[^3] says blah.\n\nDoe[^4] says blah.\n\nDoe[^5] says blah.\n\nDoe[^6] says blah.\n\nIn a note.[^7]\n\nA citation group.[^8]\n\nAnother one.[^9]\n\nAnd another one in a note.[^10]\n\nCitation with a suffix and locator.[^11]\n\nCitation with suffix only.[^12]\n\nNow some modifiers.[^13]\n\nWith some markup.[^14]\n\n# References {#references .unnumbered}\n\n:::::: {#refs .references .csl-bib-body .hanging-indent entry-spacing=\"0\"}\n::: {#ref-item2 .csl-entry}\nDoe, John. \"Article.\" *Journal of Generic Studies* 6 (2006): 33--34.\n:::\n\n::: {#ref-item1 .csl-entry}\n---------. *First Book*. Cambridge: Cambridge University Press, 2005.\n:::\n\n::: {#ref-пункт3 .csl-entry}\nDoe, John, and Jenny Roe. \"Why Water Is Wet.\" In *Third Book*, edited by\nSam Smith. Oxford: Oxford University Press, 2007.\n:::\n::::::\n\n[^1]: [**Nonexistent?**](#ref-nonexistent)\n\n[^2]: [**Nonexistent?**](#ref-nonexistent)\n\n[^3]: [*First Book* (Cambridge: Cambridge University Press,\n    2005)](#ref-item1).\n\n[^4]: [30](#ref-item1).\n\n[^5]: [30](#ref-item1), with suffix.\n\n[^6]: [*First Book*](#ref-item1); [\"Article,\" *Journal of Generic\n    Studies* 6 (2006): 30](#ref-item2); see also [John Doe and Jenny\n    Roe, \"Why Water Is Wet,\" in *Third Book*, ed. Sam Smith (Oxford:\n    Oxford University Press, 2007)](#ref-пункт3).\n\n[^7]: Doe and Roe, [\"Why Water Is Wet,\" 12](#ref-пункт3) and a citation\n    without locators ([Doe and Roe, \"Why Water Is Wet\"](#ref-пункт3)).\n\n[^8]: See [Doe, *First Book*, chap. 3](#ref-item1); also [Doe and Roe,\n    \"Why Water Is Wet,\" 34--35](#ref-пункт3).\n\n[^9]: See [Doe, *First Book*, 34--35](#ref-item1).\n\n[^10]: Some citations (see [Doe, chap. 3](#ref-item1); [Doe and Roe,\n    \"Why Water Is Wet\"](#ref-пункт3); [Doe, \"Article\"](#ref-item2)).\n\n[^11]: [Doe, *First Book*, 33, 35--37](#ref-item1), and nowhere else.\n\n[^12]: [Doe, *First Book*](#ref-item1) and nowhere else.\n\n[^13]: Like a citation without author: (), and again (), and now Doe\n    with a locator ([\"Article,\" 44](#ref-item2)).\n\n[^14]: *See* [Doe, *First Book*, 32](#ref-item1).\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-ieee.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nbibliography: command/biblio.bib\ncsl: command/ieee.csl\nlink-citations: true\n---\n\nPandoc with citeproc-hs\n=======================\n\n[@nonexistent]\n\n@nonexistent\n\n@item1 says blah.\n\n@item1 [p. 30] says blah.\n\n@item1 [p. 30, with suffix] says blah.\n\n@item1 [-@item2 p. 30; see also @пункт3] says blah.\n\nIn a note.[^1]\n\nA citation group [see @item1 chap. 3; also @пункт3 p. 34-35].\n\nAnother one [see @item1 p. 34-35].\n\nAnd another one in a note.[^2]\n\nCitation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere\nelse].\n\nCitation with suffix only [@item1 and nowhere else].\n\nNow some modifiers.[^3]\n\nWith some markup [*see* @item1 p. **32**].\n\nReferences {#references .unnumbered}\n==========\n\n[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].\n\n[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].\n\n[^3]: Like a citation without author: [-@item1], and now Doe with a\n    locator [-@item2 p. 44].\n^D\n2> [WARNING] Citeproc: citation nonexistent not found\n# Pandoc with citeproc-hs\n\n[**nonexistent?**](#ref-nonexistent)\n\n[**nonexistent?**](#ref-nonexistent)\n\n[\\[1\\]](#ref-item1) says blah.\n\n[\\[1, p. 30\\]](#ref-item1) says blah.\n\n[\\[1, p. 30\\]](#ref-item1), with suffix says blah.\n\n[\\[1\\]](#ref-item1), [\\[2, p. 30\\]](#ref-item2), see also\n[\\[3\\]](#ref-пункт3) says blah.\n\nIn a note.[^1]\n\nA citation group see [\\[1, Ch. 3\\]](#ref-item1), also [\\[3, pp.\n34--35\\]](#ref-пункт3).\n\nAnother one see [\\[1, pp. 34--35\\]](#ref-item1).\n\nAnd another one in a note.[^2]\n\nCitation with a suffix and locator [\\[1, pp. 33, 35--37\\]](#ref-item1),\nand nowhere else.\n\nCitation with suffix only [\\[1\\]](#ref-item1) and nowhere else.\n\nNow some modifiers.[^3]\n\nWith some markup *see* [\\[1, p. 32\\]](#ref-item1).\n\n# References {#references .unnumbered}\n\n:::::: {#refs .references .csl-bib-body entry-spacing=\"0\"}\n::: {#ref-item1 .csl-entry}\n[\\[1\\] ]{.csl-left-margin}[J. Doe, *First book*. Cambridge: Cambridge\nUniversity Press, 2005.]{.csl-right-inline}\n:::\n\n::: {#ref-item2 .csl-entry}\n[\\[2\\] ]{.csl-left-margin}[J. Doe, \"Article,\" *Journal of Generic\nStudies*, vol. 6, pp. 33--34, 2006.]{.csl-right-inline}\n:::\n\n::: {#ref-пункт3 .csl-entry}\n[\\[3\\] ]{.csl-left-margin}[J. Doe and J. Roe, \"Why water is wet,\" in\n*Third book*, S. Smith, Ed. Oxford: Oxford University Press,\n2007.]{.csl-right-inline}\n:::\n::::::\n\n[^1]: [\\[3, p. 12\\]](#ref-пункт3) and a citation without locators\n    [\\[3\\]](#ref-пункт3).\n\n[^2]: Some citations see [\\[1, Ch. 3\\]](#ref-item1),\n    [\\[2\\]](#ref-item2), [\\[3\\]](#ref-пункт3).\n\n[^3]: Like a citation without author: [\\[1\\]](#ref-item1), and now Doe\n    with a locator [\\[2, p. 44\\]](#ref-item2).\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-locators-delimited.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/locators.csl\nreferences:\n- id: citekey\n  title: Title\n  type: 'article-journal'\nsuppress-bibliography: true\n---\n\nSee <https://github.com/jgm/pandoc-citeproc/pull/362>.\n\nStandard page range[@citekey {35-89, 102}]\n\nAlphanumeric[@citekey {abcdefg1234}]\n\nKitchen sink[@citekey, {123(4)a-8(\\[a\\]12.398{8})}]\n\nEmpty braces inside[@citekey, {{}}]\n\nLabel specified[@citekey {p. a}]\n\nShould it work outside? No. [@citekey, p. {(a)}]\n\nEmpty locator [@citekey, {}]\n\nEmpty locator to force suffix[@citekey {} 123-35 numbers are suffix]\n\nSuffix generally [@citekey {123-35} numbers not, but text is suffix]\n\nWith preceding comma[@citekey, {p. VI}]\n\nNo commas before label[@citekey, {, p. (p. is not recognised)}]\n\nTrim white space[@citekey, { p. 9 }]\n\nWithout delimiters[@citekey, suffix]\n\nWith rendering label[@citekey {ss IV div 4 s 128L(7)(a)(i)-(iv), 129(5),\n130(b)}]\n\nThe text is apparently NOT verbatim; it is lightly processed as page\nnumbers. [@citekey {no comma, no label, no nothing}]\n\nAGLC-style page \\[para\\] [@citekey {584 \\[78\\]}]\n\nUnbalanced curly { breaks the parse[@citekey {p. suffix{suffix}suffix]\n\nUnbalanced curly } ends early[@citekey {green}suffix}suffix]\n^D\nSee <https://github.com/jgm/pandoc-citeproc/pull/362>.\n\nStandard page range[^1]\n\nAlphanumeric[^2]\n\nKitchen sink[^3]\n\nEmpty braces inside[^4]\n\nLabel specified[^5]\n\nShould it work outside? No.[^6]\n\nEmpty locator[^7]\n\nEmpty locator to force suffix[^8]\n\nSuffix generally[^9]\n\nWith preceding comma[^10]\n\nNo commas before label[^11]\n\nTrim white space[^12]\n\nWithout delimiters[^13]\n\nWith rendering label[^14]\n\nThe text is apparently NOT verbatim; it is lightly processed as page\nnumbers.[^15]\n\nAGLC-style page \\[para\\][^16]\n\nUnbalanced curly { breaks the parse[^17]\n\nUnbalanced curly } ends early[^18]\n\n[^1]: Title {35--89, 102}.\n\n[^2]: Ibid-with-locator {abcdefg1234}.\n\n[^3]: Ibid-with-locator {123(4)a--8(\\[a\\]12.398{8})}.\n\n[^4]: Ibid-with-locator {{}}.\n\n[^5]: Ibid-with-locator {a}.\n\n[^6]: Subsequent, p. {(a)}.\n\n[^7]: Ibid.\n\n[^8]: Ibid 123-35 numbers are suffix.\n\n[^9]: Ibid-with-locator {123--35} numbers not, but text is suffix.\n\n[^10]: Ibid-with-locator {VI}.\n\n[^11]: Ibid-with-locator {, p. (p. is not recognised)}.\n\n[^12]: Ibid-with-locator {9}.\n\n[^13]: Subsequent, suffix.\n\n[^14]: Ibid-with-locator ss {IV div 4 s 128L(7)(a)(i)--(iv), 129(5),\n    130(b)}.\n\n[^15]: Ibid-with-locator {no comma, no label, no nothing}.\n\n[^16]: Ibid-with-locator {584 \\[78\\]}.\n\n[^17]: Subsequent {p. suffix{suffix}suffix.\n\n[^18]: Ibid-with-locator {green}suffix}suffix.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-locators-integrated.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: command/locators.csl\nreferences:\n- id: citekey\n  title: Title\n  type: 'article-journal'\nsuppress-bibliography: true\n---\n\nSee <https://github.com/jgm/pandoc-citeproc/pull/362>.\n\n[@citekey, 89, and suffix]\n\n[@citekey, 89, perfect Ibid with suffix]\n\n[@citekey, 123-79, and suffix]\n\n[@citekey, xi, will be entirely suffix]\n\n[@citekey, p. xi, gives you a (page) locator xi]\n\n[@citekey, pp. VII, 89, gives you a (pages) locator VII, 89]\n\n[@citekey, p. VI, VII, VIII-IX, explicit romans]\n\n[@citekey \\[89\\]]\n\n[@citekey, p. \\[89\\]]\n\n[@citekey and nothing else]\n\n[@citekey, 123(4)\\[5\\]6, and suffix]\n\n[@citekey, 3(a), 4.4.8, \\[7.6\\], 7A(2)(a)(i)-(iv)]\n\n[@citekey, 4B.2a.i(3.4), and suffix]\n\n[@citekey, IV.2A, and suffix]\n\n[@citekey, \\[28\\], and suffix]\n\n[@citekey, \\[39-52\\], and suffix]\n\n[@citekey, \\[39\\]-\\[52\\], and suffix]\n\n[@citekey, s 123(4)(a)(iv), and suffix]\n\n[@citekey, ss 123(4)-(6), and suffix]\n\n[@citekey, \\[13\\], and suffix]\n\n[@citekey, p.3, and suffix]\n\n[@citekey, (13 entirely suffix]\n\n[@citekey, p.a entirely suffix]\n\n[@citekey, s (a) entirely suffix]\n^D\nSee <https://github.com/jgm/pandoc-citeproc/pull/362>.\n\n[^1]\n\n[^2]\n\n[^3]\n\n[^4]\n\n[^5]\n\n[^6]\n\n[^7]\n\n[^8]\n\n[^9]\n\n[^10]\n\n[^11]\n\n[^12]\n\n[^13]\n\n[^14]\n\n[^15]\n\n[^16]\n\n[^17]\n\n[^18]\n\n[^19]\n\n[^20]\n\n[^21]\n\n[^22]\n\n[^23]\n\n[^24]\n\n[^1]: Title {89}, and suffix.\n\n[^2]: Ibid, perfect Ibid with suffix.\n\n[^3]: Ibid-with-locator {123--79}, and suffix.\n\n[^4]: Subsequent, xi, will be entirely suffix.\n\n[^5]: Ibid-with-locator {xi}, gives you a (page) locator xi.\n\n[^6]: Ibid-with-locator {VII, 89}, gives you a (pages) locator VII, 89.\n\n[^7]: Ibid-with-locator {VI, VII, VIII--IX}, explicit romans.\n\n[^8]: Ibid-with-locator {\\[89\\]}.\n\n[^9]: Ibid.\n\n[^10]: Subsequent and nothing else.\n\n[^11]: Ibid-with-locator {123(4)\\[5\\]6}, and suffix.\n\n[^12]: Ibid-with-locator {3(a), 4.4.8, \\[7.6\\], 7A(2)(a)(i)--(iv)}.\n\n[^13]: Ibid-with-locator {4B.2a.i(3.4)}, and suffix.\n\n[^14]: Ibid-with-locator {IV.2A}, and suffix.\n\n[^15]: Ibid-with-locator {\\[28\\]}, and suffix.\n\n[^16]: Ibid-with-locator {\\[39--52\\]}, and suffix.\n\n[^17]: Ibid-with-locator {\\[39\\]--\\[52\\]}, and suffix.\n\n[^18]: Ibid-with-locator s {123(4)(a)(iv)}, and suffix.\n\n[^19]: Ibid-with-locator ss {123(4)--(6)}, and suffix.\n\n[^20]: Ibid-with-locator {\\[13\\]}, and suffix.\n\n[^21]: Ibid-with-locator {3}, and suffix.\n\n[^22]: Subsequent, (13 entirely suffix.\n\n[^23]: Ibid, p.a entirely suffix.\n\n[^24]: Ibid, s (a) entirely suffix.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-move-period-inside-quote.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-fullnote-bibliography.csl'\nreferences:\n- DOI: 10.1038/171737a0\n  URL: 'http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html'\n  accessed:\n    day: 17\n    month: 6\n    year: 2008\n  author:\n  - family: Watson\n    given: J. D.\n  - family: Crick\n    given: F. H. C.\n  container-title: Nature\n  custom4: custom4\n  id: WatsonCrick1953\n  issue: 4356\n  issued:\n    date-parts:\n    - - 1953\n      - 4\n      - 25\n  language: 'en-US'\n  note: this is a note\n  original-date:\n    year: 1951\n  page: '737-738'\n  title: 'Molecular structure of nucleic acids: a structure for\n    deoxyribose nucleic acid'\n  title-short: Molecular structure of nucleic acids\n  type: 'article-journal'\n  volume: 171\nsuppress-bibliography: true\n---\n\nHere is a \"test citation\" [@WatsonCrick1953].\n\nHere is a test citation [@WatsonCrick1953].\n^D\nHere is a \"test citation.\"[^1]\n\nHere is a test citation.[^2]\n\n[^1]: J. D. Watson and F. H. C. Crick, \"Molecular Structure of Nucleic\n    Acids: A Structure for Deoxyribose Nucleic Acid,\" *Nature* 171, no.\n    4356 (April 25, 1953): 737--38, <https://doi.org/10.1038/171737a0>.\n\n[^2]: Watson and Crick.\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-no-author.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- container-title: Magazine\n  id: item1\n  issued:\n    year: 2012\n  title: Title A\n  type: 'article-magazine'\n- container-title: Magazine\n  id: item2\n  issued:\n    year: 2012\n  title: Title B\n  type: 'article-magazine'\n- container-title: Magazine\n  id: item3\n  issued:\n    year: 2012\n  title: Title C\n  type: 'article-magazine'\n- container-title: Magazine\n  id: item4\n  issued:\n    year: 2012\n  title: Title D\n  type: 'article-magazine'\n- container-title: Newspaper\n  id: item5\n  issued:\n    year: 2012\n  title: Title E\n  type: 'article-magazine'\n- container-title: Newspaper\n  id: item6\n  issued:\n    year: 2012\n  title: Title F\n  type: 'article-magazine'\n---\n\n@item1 [p. 3], @item2, @item3, @item4, @item5, @item6\n^D\n*Magazine* (2012a, 3), *Magazine* (2012b), *Magazine* (2012c),\n*Magazine* (2012d), *Newspaper* (2012a), *Newspaper* (2012b)\n\n::::::::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\n*Magazine*. 2012a. \"Title A.\"\n:::\n\n::: {#ref-item2 .csl-entry}\n*Magazine*. 2012b. \"Title B.\"\n:::\n\n::: {#ref-item3 .csl-entry}\n*Magazine*. 2012c. \"Title C.\"\n:::\n\n::: {#ref-item4 .csl-entry}\n*Magazine*. 2012d. \"Title D.\"\n:::\n\n::: {#ref-item5 .csl-entry}\n*Newspaper*. 2012a. \"Title E.\"\n:::\n\n::: {#ref-item6 .csl-entry}\n*Newspaper*. 2012b. \"Title F.\"\n:::\n:::::::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-number-of-volumes.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\nreferences:\n- author:\n    family: Author\n    given:\n    - Al\n  id: item1\n  issued:\n    year: 2013\n  language: 'en-US'\n  number-of-volumes: 2\n  publisher: Publisher\n  publisher-place: Location\n  title: Title\n  type: book\n---\n\n@item1\n^D\nAuthor (2013)\n\n:::: {#refs .references .csl-bib-body .hanging-indent}\n::: {#ref-item1 .csl-entry}\nAuthor, Al. 2013. *Title*. 2 vols. Publisher.\n:::\n::::\n```\n"
  },
  {
    "path": "test/command/pandoc-citeproc-page-range.md",
    "content": "```\n% pandoc --citeproc -t markdown-citations\n---\ncsl: 'command/chicago-fullnote-bibliography.csl'\nreferences:\n- URL: 'https://johnmacfarlane.net/vagueness.pdf'\n  id: test1\n- URL: 'https://pandoc.org'\n  id: test2\n- URL: 'https://johnmacfarlane.net'\n  id: test3\nsuppress-bibliography: true\n---\n\nTest 1 [@test1, pp. 93--101].\n\nTest 2 [@test2, pp. 93--101].\n\nTest 3 [@test3, pp. 93-101].\n^D\nTest 1.[^1]\n\nTest 2.[^2]\n\nTest 3.[^3]\n\n[^1]: N.d., 93--101, <https://johnmacfarlane.net/vagueness.pdf>.\n\n[^2]: N.d., 93--101, <https://pandoc.org>.\n\n[^3]: N.d., 93--101, <https://johnmacfarlane.net>.\n```\n"
  },
  {
    "path": "test/command/parse-raw.md",
    "content": "```\n% pandoc -f latex+raw_tex -t markdown\n\\emph{Hi \\foo{there}}\n^D\n*Hi `\\foo{there}`{=latex}*\n```\n\n```\n% pandoc -f latex -t markdown\n\\emph{Hi \\foo{there}}\n^D\n*Hi*\n```\n\n```\n% pandoc -f html+raw_html -t markdown\n<em>Hi <blink>there</blink></em>\n^D\n*Hi `<blink>`{=html}there`</blink>`{=html}*\n```\n\n```\n% pandoc -f html -t markdown\n<em>Hi <blink>there</blink></em>\n^D\n*Hi there*\n```\n"
  },
  {
    "path": "test/command/pdfstandard.md",
    "content": "PDF standard support: basic PDF/A-2b test (infers version 1.7)\n```\n% pandoc -t latex -s\n---\npdfstandard: a-2b\nlang: en-US\n---\n\nTest document.\n^D\n\\DocumentMetadata{\n  pdfversion=1.7,\n  pdfstandard={a-2b},\n  lang=en-US,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  american,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en-US},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nTest document.\n\n\\end{document}\n```\n\nPDF standard support: PDF/UA-1 with tagging\n```\n% pandoc -t latex -s\n---\npdfstandard: ua-1\nlang: en-US\n---\n\nAccessible document.\n^D\n\\DocumentMetadata{\n  pdfstandard={ua-1},\n  tagging=on,\n  lang=en-US,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  american,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en-US},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nAccessible document.\n\n\\end{document}\n```\n\nPDF standard support: multiple standards with version\n```\n% pandoc -t latex -s\n---\npdfstandard:\n  - a-2b\n  - ua-1\n  - \"1.7\"\nlang: de-DE\n---\n\nMulti-standard document.\n^D\n\\DocumentMetadata{\n  pdfversion=1.7,\n  pdfstandard={a-2b,ua-1},\n  tagging=on,\n  lang=de-DE,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  ngerman,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={de-DE},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nMulti-standard document.\n\n\\end{document}\n```\n\nPDF standard support: PDF/A-1b infers version 1.4\n```\n% pandoc -t latex -s\n---\npdfstandard: a-1b\nlang: en-US\n---\n\nPDF/A-1 document.\n^D\n\\DocumentMetadata{\n  pdfversion=1.4,\n  pdfstandard={a-1b},\n  lang=en-US,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  american,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en-US},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nPDF/A-1 document.\n\n\\end{document}\n```\n\nPDF standard support: PDF/A-4 with no version inference (uses default 2.0)\n```\n% pandoc -t latex -s\n---\npdfstandard: a-4\nlang: en-US\n---\n\nPDF/A-4 document.\n^D\n\\DocumentMetadata{\n  pdfstandard={a-4},\n  lang=en-US,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  american,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en-US},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nPDF/A-4 document.\n\n\\end{document}\n```\n\nPDF standard support: numeric YAML version (2 becomes 2.0)\n```\n% pandoc -t latex -s\n---\npdfstandard:\n  - ua-1\n  - 2\nlang: en-US\n---\n\nPDF 2.0 document.\n^D\n\\DocumentMetadata{\n  pdfversion=2.0,\n  pdfstandard={ua-1},\n  tagging=on,\n  lang=en-US,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  american,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en-US},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nPDF 2.0 document.\n\n\\end{document}\n```\n\nPDF standard support: explicit version overrides inferred version\n```\n% pandoc -t latex -s\n---\npdfstandard:\n  - a-2b\n  - \"1.5\"\nlang: en-US\n---\n\nExplicit version document.\n^D\n\\DocumentMetadata{\n  pdfversion=1.5,\n  pdfstandard={a-2b},\n  lang=en-US,\n  xmp=true}\n% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  american,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en-US},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\nExplicit version document.\n\n\\end{document}\n```\n"
  },
  {
    "path": "test/command/refs.md",
    "content": "```\n% pandoc -f latex -t native\nFigure \\ref{fig:1}\n^D\n[ Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:1\" )\n          ]\n        )\n        [ Str \"[fig:1]\" ]\n        ( \"#fig:1\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nFigure \\cref{fig:1}\n^D\n[ Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref+label\" )\n          , ( \"reference\" , \"fig:1\" )\n          ]\n        )\n        [ Str \"[fig:1]\" ]\n        ( \"#fig:1\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nFigure \\vref{fig:1}\n^D\n[ Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:1\" )\n          ]\n        )\n        [ Str \"[fig:1]\" ]\n        ( \"#fig:1\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\autoref{fig:flowchart}\n^D\n[ Para\n    [ Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref+label\" )\n          , ( \"reference\" , \"fig:flowchart\" )\n          ]\n        )\n        [ Str \"[fig:flowchart]\" ]\n        ( \"#fig:flowchart\" , \"\" )\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\nAccuracy~\\eqref{eq:Accuracy} is the proportion, measuring true results among all results.\n\n\\begin{equation}\n  \\label{eq:Accuracy}\n  Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}\n\\end{equation}\n^D\n[ Para\n    [ Str \"Accuracy\\160\"\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"eqref\" )\n          , ( \"reference\" , \"eq:Accuracy\" )\n          ]\n        )\n        [ Str \"[eq:Accuracy]\" ]\n        ( \"#eq:Accuracy\" , \"\" )\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"proportion,\"\n    , Space\n    , Str \"measuring\"\n    , Space\n    , Str \"true\"\n    , Space\n    , Str \"results\"\n    , Space\n    , Str \"among\"\n    , Space\n    , Str \"all\"\n    , Space\n    , Str \"results.\"\n    ]\n, Para\n    [ Math\n        DisplayMath\n        \"\\\\begin{equation}\\n  \\\\label{eq:Accuracy}\\n  Accuracy = \\\\frac{t_p + t_n}{t_p + f_p + f_n + t_n}\\n\\\\end{equation}\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{figure}\n  \\includegraphics{command/SVG_logo.svg}\n  \\caption{Logo}\n  \\label{fig:Logo}\n\\end{figure}\n\nFigure \\ref{fig:Logo} illustrated the SVG logo\n^D\n[ Figure\n    ( \"fig:Logo\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Logo\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"command/SVG_logo.svg\" , \"\" )\n        ]\n    ]\n, Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:Logo\" )\n          ]\n        )\n        [ Str \"1\" ]\n        ( \"#fig:Logo\" , \"\" )\n    , Space\n    , Str \"illustrated\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"SVG\"\n    , Space\n    , Str \"logo\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\chapter{One}\n\\begin{figure}\n  \\includegraphics{command/SVG_logo.svg}\n  \\caption{Logo}\n  \\label{fig:Logo}\n\\end{figure}\n\n\\begin{figure}\n  \\includegraphics{command/SVG_logo2.svg}\n  \\caption{Logo2}\n  \\label{fig:Logo2}\n\\end{figure}\n\n\\chapter{Two}\n\n\\section{Subone}\n\n\\begin{figure}\n  \\includegraphics{command/SVG_logo3.svg}\n  \\caption{Logo3}\n  \\label{fig:Logo3}\n\\end{figure}\n\nFigure \\ref{fig:Logo} illustrated the SVG logo\n\nFigure \\ref{fig:Logo2} illustrated the SVG logo\n\nFigure \\ref{fig:Logo3} illustrated the SVG logo\n^D\n[ Header 1 ( \"one\" , [] , [] ) [ Str \"One\" ]\n, Figure\n    ( \"fig:Logo\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Logo\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"command/SVG_logo.svg\" , \"\" )\n        ]\n    ]\n, Figure\n    ( \"fig:Logo2\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Logo2\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"command/SVG_logo2.svg\" , \"\" )\n        ]\n    ]\n, Header 1 ( \"two\" , [] , [] ) [ Str \"Two\" ]\n, Header 2 ( \"subone\" , [] , [] ) [ Str \"Subone\" ]\n, Figure\n    ( \"fig:Logo3\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"Logo3\" ] ])\n    [ Plain\n        [ Image ( \"\" , [] , [] ) [] ( \"command/SVG_logo3.svg\" , \"\" )\n        ]\n    ]\n, Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:Logo\" )\n          ]\n        )\n        [ Str \"1.1\" ]\n        ( \"#fig:Logo\" , \"\" )\n    , Space\n    , Str \"illustrated\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"SVG\"\n    , Space\n    , Str \"logo\"\n    ]\n, Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:Logo2\" )\n          ]\n        )\n        [ Str \"1.2\" ]\n        ( \"#fig:Logo2\" , \"\" )\n    , Space\n    , Str \"illustrated\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"SVG\"\n    , Space\n    , Str \"logo\"\n    ]\n, Para\n    [ Str \"Figure\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"fig:Logo3\" )\n          ]\n        )\n        [ Str \"2.1\" ]\n        ( \"#fig:Logo3\" , \"\" )\n    , Space\n    , Str \"illustrated\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"SVG\"\n    , Space\n    , Str \"logo\"\n    ]\n]\n```\n\n\n```\n% pandoc -f latex -t native\n\\label{section} Section \\ref{section}\n^D\n[ Para\n    [ Span ( \"section\" , [] , [ ( \"label\" , \"section\" ) ] ) []\n    , Space\n    , Str \"Section\"\n    , Space\n    , Link\n        ( \"\"\n        , []\n        , [ ( \"reference-type\" , \"ref\" )\n          , ( \"reference\" , \"section\" )\n          ]\n        )\n        [ Str \"[section]\" ]\n        ( \"#section\" , \"\" )\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/reset-citation-positions.md",
    "content": "```\n% pandoc --citeproc -t plain --csl command/chicago-fullnote-bibliography.csl\n---\nsuppress-bibliography: true\nreferences:\n- id: foo\n  name: John doe\n  title: A Book\n  type: book\n  publisher: Oxford University Press\n  issued: 2010\n...\n\n# Chapter one\n\nBlah [@foo, p. 7].\n\nBlah [@foo, p. 8].\n\n# Chapter two {.reset-citation-positions}\n\nBlah [@foo, p. 57].\n^D\nChapter one\n\nBlah.[1]\n\nBlah.[2]\n\nChapter two\n\nBlah.[3]\n\n[1] A Book (Oxford University Press, 2010), 7.\n\n[2] A Book, 8.\n\n[3] A Book (Oxford University Press, 2010), 57.\n\n```\n\n"
  },
  {
    "path": "test/command/rst-links.md",
    "content": "```\n% pandoc -f rst\n`*ab*`_\n\n.. _`*ab*`: foo\n^D\n<p><a href=\"foo\">*ab*</a></p>\n```\n\n```\n% pandoc -f rst\n`A B\nc`_\n\n.. _A B C: foo\n^D\n<p><a href=\"foo\">A B c</a></p>\n```\n"
  },
  {
    "path": "test/command/rst-writer-gridtable-if-rowspans.md",
    "content": "```\n% pandoc -f native -t rst\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 2)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        [] []\n    ]\n    (TableFoot ( \"\" , [] , [] )\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 2)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            ]\n    ])\n]\n^D\n+---+---+---+\n| 1 | 2 | 3 |\n+---+   +---+\n| 1 |   | 3 |\n+---+---+---+\n| 1 | 2 | 3 |\n+---+---+---+\n\n+---+---+---+\n| 1 | 2 | 3 |\n+---+   +---+\n| 1 |   | 3 |\n+===+===+===+\n| 1 | 2 | 3 |\n+---+---+---+\n\n+===+===+===+\n| 1 | 2 | 3 |\n+---+   +---+\n| 1 |   | 3 |\n+---+---+---+\n| 1 | 2 | 3 |\n+===+===+===+\n```\n"
  },
  {
    "path": "test/command/rst_block_subst.md",
    "content": "```\n% pandoc -f rst -t native\n|figure05|\n\n.. |figure05| figure:: img/dummy.png\n\n   capt\n^D\n[ Figure\n    ( \"\" , [] , [] )\n    (Caption Nothing [ Plain [ Str \"capt\" ] ])\n    [ Plain\n        [ Image\n            ( \"\" , [] , [] ) [ Str \"capt\" ] ( \"img/dummy.png\" , \"\" )\n        ]\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/sage-harvard.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"never\" default-locale=\"en-GB\">\n  <info>\n    <title>SAGE - Harvard</title>\n    <id>http://www.zotero.org/styles/sage-harvard</id>\n    <link href=\"http://www.zotero.org/styles/sage-harvard\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/the-open-university-harvard\" rel=\"template\"/>\n    <link href=\"http://www.uk.sagepub.com/repository/binaries/pdf/SAGE_Harvard_reference_style.pdf\" rel=\"documentation\"/>\n    <author>\n      <name>Joseph Reagle</name>\n    </author>\n    <category citation-format=\"author-date\"/>\n    <category field=\"generic-base\"/>\n    <summary>The SAGE Harvard author-date style</summary>\n    <updated>2012-09-27T22:06:38+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en-GB\">\n    <terms>\n      <term name=\"editor\" form=\"short\">\n        <single>ed.</single>\n        <multiple>eds</multiple>\n      </term>\n    </terms>\n  </locale>\n  <macro name=\"editor\">\n    <names variable=\"editor\" delimiter=\", \">\n      <name and=\"text\" initialize-with=\"\" delimiter=\", \" sort-separator=\" \" name-as-sort-order=\"all\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n    </names>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name initialize-with=\"\" name-as-sort-order=\"all\" and=\"text\" sort-separator=\" \" delimiter=\", \" delimiter-precedes-last=\"never\" form=\"long\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text variable=\"container-title\" font-style=\"italic\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-count\">\n    <names variable=\"author\">\n      <name form=\"count\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" and=\"text\" delimiter=\", \" delimiter-precedes-last=\"never\" initialize-with=\"\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n        <names variable=\"translator\"/>\n        <text variable=\"container-title\" font-style=\"italic\"/>\n        <text macro=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if variable=\"URL\">\n        <text value=\"Available from: \"/>\n        <text variable=\"URL\"/>\n        <group prefix=\" (\" delimiter=\" \" suffix=\")\">\n          <text term=\"accessed\"/>\n          <date variable=\"accessed\">\n            <date-part name=\"day\" suffix=\" \"/>\n            <date-part name=\"month\" suffix=\" \"/>\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\": \">\n      <text variable=\"publisher-place\"/>\n      <text variable=\"publisher\"/>\n    </group>\n  </macro>\n  <macro name=\"year-date\">\n    <choose>\n      <if variable=\"issued\">\n        <date variable=\"issued\">\n          <date-part name=\"year\"/>\n        </date>\n      </if>\n      <else>\n        <text term=\"no date\" form=\"short\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"locator\">\n    <choose>\n      <if type=\"article-journal\">\n        <text variable=\"volume\"/>\n        <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"published-date\">\n    <choose>\n      <if type=\"article-newspaper\">\n        <date variable=\"issued\">\n          <date-part name=\"day\" form=\"ordinal\" suffix=\" \"/>\n          <date-part name=\"month\" form=\"long\"/>\n        </date>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"pages\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <group delimiter=\" \" prefix=\", \">\n          <label variable=\"page\" form=\"short\" suffix=\" \"/>\n          <text variable=\"page\"/>\n        </group>\n      </if>\n      <else-if type=\"article-journal\">\n        <text variable=\"page\" prefix=\": \"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <number variable=\"edition\" form=\"ordinal\"/>\n          <text term=\"edition\" form=\"short\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" suffix=\".\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"container-prefix\">\n    <choose>\n      <if type=\"chapter paper-conference\" match=\"any\">\n        <text term=\"in\" text-case=\"capitalize-first\" suffix=\": \"/>\n      </if>\n    </choose>\n  </macro>\n  <citation et-al-min=\"3\" et-al-use-first=\"1\" disambiguate-add-year-suffix=\"true\" disambiguate-add-names=\"true\" disambiguate-add-givenname=\"true\" collapse=\"year\">\n    <sort>\n      <key macro=\"author-short\"/>\n      <key macro=\"year-date\"/>\n    </sort>\n    <layout prefix=\"(\" suffix=\")\" delimiter=\"; \">\n      <group delimiter=\": \">\n        <group delimiter=\", \">\n          <text macro=\"author-short\"/>\n          <text macro=\"year-date\"/>\n        </group>\n        <text variable=\"locator\"/>\n      </group>\n    </layout>\n  </citation>\n  <bibliography hanging-indent=\"true\" et-al-min=\"4\" et-al-use-first=\"3\">\n    <sort>\n      <key macro=\"author\" names-min=\"1\" names-use-first=\"1\"/>\n      <key macro=\"author-count\" names-min=\"3\" names-use-first=\"3\"/>\n      <key macro=\"author\" names-min=\"3\" names-use-first=\"1\"/>\n      <key macro=\"year-date\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\" \">\n        <text macro=\"author\"/>\n        <text macro=\"year-date\" prefix=\"(\" suffix=\")\"/>\n        <text macro=\"title\" suffix=\".\"/>\n        <text macro=\"edition\"/>\n        <text macro=\"container-prefix\"/>\n        <group delimiter=\", \">\n          <text macro=\"editor\"/>\n          <text variable=\"container-title\" font-style=\"italic\"/>\n          <text variable=\"collection-title\"/>\n          <text variable=\"genre\"/>\n          <text macro=\"publisher\"/>\n          <text macro=\"published-date\"/>\n        </group>\n        <text macro=\"locator\"/>\n      </group>\n      <text macro=\"pages\"/>\n      <text macro=\"access\" prefix=\". \"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/science.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" default-locale=\"en-US\">\n  <info>\n    <title>Science</title>\n    <id>http://www.zotero.org/styles/science</id>\n    <link href=\"http://www.zotero.org/styles/science\" rel=\"self\"/>\n    <link href=\"http://www.sciencemag.org/about/authors/prep/res/refs.dtl\" rel=\"documentation\"/>\n    <author>\n      <name>Julian Onions</name>\n      <email>julian.onions@gmail.com</email>\n    </author>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <contributor>\n      <name>Greg Barendt</name>\n    </contributor>\n    <category citation-format=\"numeric\"/>\n    <category field=\"science\"/>\n    <issn>0036-8075</issn>\n    <eissn>1095-9203</eissn>\n    <summary>The Science journal style.</summary>\n    <updated>2014-06-18T08:06:38+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <macro name=\"editor\">\n    <names variable=\"editor\" delimiter=\", \">\n      <name initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"capitalize-first\"/>\n    </names>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name sort-separator=\", \" initialize-with=\". \" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"short\" prefix=\", \" text-case=\"capitalize-first\"/>\n      <et-al font-style=\"italic\"/>\n      <substitute>\n        <names variable=\"editor\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if variable=\"page\" match=\"none\">\n        <text macro=\"access-value\"/>\n      </if>\n      <else-if is-numeric=\"page\" match=\"none\">\n        <text macro=\"access-value\"/>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"access-value\">\n    <choose>\n      <if variable=\"DOI\">\n        <text variable=\"DOI\" prefix=\", doi:\"/>\n      </if>\n      <else>\n        <group prefix=\" (\" suffix=\")\">\n          <text value=\"available at \"/>\n          <text variable=\"URL\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case legislation motion_picture report song\" match=\"any\">\n        <text variable=\"title\" font-style=\"italic\"/>\n      </if>\n      <else>\n        <text variable=\"title\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"article-details\">\n    <group delimiter=\", \">\n      <group delimiter=\". \">\n        <text macro=\"title\"/>\n        <text form=\"short\" variable=\"container-title\" font-style=\"italic\"/>\n        <text variable=\"volume\" font-weight=\"bold\"/>\n      </group>\n      <text variable=\"page\"/>\n    </group>\n    <text macro=\"issued\" prefix=\" (\" suffix=\")\"/>\n    <text macro=\"access\"/>\n  </macro>\n  <macro name=\"publisher\">\n    <group delimiter=\", \">\n      <text variable=\"publisher\"/>\n      <text variable=\"publisher-place\"/>\n    </group>\n  </macro>\n  <macro name=\"volume\">\n    <text variable=\"volume\" prefix=\"vol. \"/>\n  </macro>\n  <macro name=\"pages\">\n    <label variable=\"page\" form=\"short\" suffix=\" \"/>\n    <text variable=\"page\" form=\"short\"/>\n  </macro>\n  <macro name=\"issued\">\n    <date variable=\"issued\" delimiter=\" \">\n      <date-part name=\"year\"/>\n    </date>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <text term=\"edition\" form=\"short\"/>\n          <number variable=\"edition\" form=\"numeric\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" suffix=\".\"/>\n      </else>\n    </choose>\n  </macro>\n  <citation collapse=\"citation-number\">\n    <sort>\n      <key variable=\"citation-number\"/>\n    </sort>\n    <layout prefix=\"(\" suffix=\")\" delimiter=\", \">\n      <text variable=\"citation-number\" font-style=\"italic\"/>\n    </layout>\n  </citation>\n  <bibliography et-al-min=\"6\" et-al-use-first=\"1\" second-field-align=\"flush\">\n    <layout suffix=\".\">\n      <text variable=\"citation-number\" suffix=\". \"/>\n      <group delimiter=\", \">\n        <text macro=\"author\"/>\n        <choose>\n          <if type=\"thesis\">\n            <group delimiter=\" \">\n              <group delimiter=\", \">\n                <group>\n                  <!-- Always print, even if no university given -->\n                  <text value=\"thesis\"/>\n                </group>\n                <text macro=\"publisher\"/>\n              </group>\n              <text macro=\"issued\" prefix=\"(\" suffix=\")\"/>\n            </group>\n          </if>\n          <else-if type=\"bill book graphic legal_case legislation motion_picture song chapter paper-conference\" match=\"any\">\n            <group delimiter=\" \">\n              <choose>\n                <if type=\"chapter paper-conference\" match=\"any\">\n                  <group delimiter=\", \">\n                    <group delimiter=\" \">\n                      <text term=\"in\"/>\n                      <text variable=\"container-title\" font-style=\"italic\"/>\n                    </group>\n                    <text macro=\"editor\"/>\n                  </group>\n                </if>\n                <else>\n                  <text macro=\"title\"/>\n                </else>\n              </choose>\n              <group prefix=\"(\" suffix=\")\" delimiter=\"; \">\n                <group delimiter=\", \">\n                  <text macro=\"publisher\"/>\n                  <text macro=\"edition\"/>\n                  <text macro=\"issued\"/>\n                </group>\n                <text variable=\"URL\"/>\n              </group>\n            </group>\n            <group delimiter=\" of \">\n              <group>\n                <label variable=\"volume\" form=\"short\" suffix=\" \"/>\n                <number variable=\"volume\"/>\n              </group>\n              <text variable=\"collection-title\" font-style=\"italic\"/>\n            </group>\n            <choose>\n              <if type=\"chapter paper-conference\" match=\"any\">\n                <text macro=\"pages\"/>\n              </if>\n            </choose>\n          </else-if>\n          <else-if type=\"article-journal\">\n            <choose>\n              <if variable=\"page\">\n                <choose>\n                  <if is-numeric=\"page\" match=\"none\">\n                    <group>\n                      <group delimiter=\", \">\n                        <text variable=\"container-title\" form=\"short\" font-style=\"italic\"/>\n                        <group>\n                          <text term=\"in press\"/>\n                        </group>\n                      </group>\n                      <text macro=\"access\"/>\n                    </group>\n                  </if>\n                  <else>\n                    <text macro=\"article-details\"/>\n                  </else>\n                </choose>\n              </if>\n              <else>\n                <text macro=\"article-details\"/>\n              </else>\n            </choose>\n          </else-if>\n          <else-if type=\"report\">\n            <group>\n              <group delimiter=\", \">\n                <text variable=\"title\" quotes=\"true\"/>\n                <text variable=\"collection-title\" font-style=\"italic\"/>\n              </group>\n              <group prefix=\" (\" suffix=\")\" delimiter=\", \">\n                <group delimiter=\" \">\n                  <text variable=\"genre\" form=\"short\"/>\n                  <number variable=\"number\"/>\n                </group>\n                <text variable=\"publisher\"/>\n                <text variable=\"publisher-place\"/>\n                <text macro=\"issued\"/>\n              </group>\n            </group>\n            <text macro=\"pages\"/>\n            <text macro=\"access\"/>\n          </else-if>\n          <else>\n            <group>\n              <group delimiter=\", \">\n                <text macro=\"editor\"/>\n                <group delimiter=\". \">\n                  <text macro=\"title\"/>\n                  <text form=\"short\" variable=\"container-title\" font-style=\"italic\"/>\n                  <text variable=\"volume\" font-weight=\"bold\"/>\n                </group>\n              </group>\n              <text macro=\"issued\" prefix=\" (\" suffix=\")\"/>\n            </group>\n            <text macro=\"pages\"/>\n            <text macro=\"access\"/>\n          </else>\n        </choose>\n      </group>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/section-divs.md",
    "content": "```\n% pandoc  --section-divs\n::: {#hi .section .level1}\n# Hi\n\n::: {#there .section .level2}\n## there\n:::\n:::\n\n::: {#ok .section .level1}\nOk\n==\n:::\n^D\n<section id=\"hi\" class=\"level1\">\n<h1>Hi</h1>\n<section id=\"there\" class=\"level2\">\n<h2>there</h2>\n</section>\n</section>\n<section id=\"ok\" class=\"level1\">\n<h1>Ok</h1>\n</section>\n```\n"
  },
  {
    "path": "test/command/setext-fenced-div.md",
    "content": "```\n% pandoc -t native\n::: {.cell}\n---\n:::\n^D\n[ Div ( \"\" , [ \"cell\" ] , [] ) [ HorizontalRule ] ]\n```\n"
  },
  {
    "path": "test/command/shift-heading-level-by.md",
    "content": "```\n% pandoc --shift-heading-level-by 1 -t native -s\n---\ntitle: My title\n...\n\n# First heading\n\n## Second\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"title\"\n            , MetaInlines [ Str \"My\" , Space , Str \"title\" ]\n            )\n          ]\n    }\n  [ Header\n      2\n      ( \"first-heading\" , [] , [] )\n      [ Str \"First\" , Space , Str \"heading\" ]\n  , Header 3 ( \"second\" , [] , [] ) [ Str \"Second\" ]\n  ]\n```\n\n```\n% pandoc --shift-heading-level-by -1 -t native -s\n---\ntitle: Old title\n...\n\n# First heading\n\n## Second\n\n# Another top-level heading\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"title\"\n            , MetaInlines [ Str \"First\" , Space , Str \"heading\" ]\n            )\n          ]\n    }\n  [ Header 1 ( \"second\" , [] , [] ) [ Str \"Second\" ]\n  , Para\n      [ Str \"Another\"\n      , Space\n      , Str \"top-level\"\n      , Space\n      , Str \"heading\"\n      ]\n  ]\n```\n\n"
  },
  {
    "path": "test/command/short-caption.md",
    "content": "```\n% pandoc -f latex -t native\n\\begin{table}\n\\caption[short caption]{long caption}\n\\begin{tabular}{ll}\nhi & hi \\\\\n\\end{tabular}\n\\end{table}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption\n       (Just [ Str \"short\" , Space , Str \"caption\" ])\n       [ Plain [ Str \"long\" , Space , Str \"caption\" ] ])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"hi\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"hi\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/sloppypar.md",
    "content": "```\n% pandoc -f latex+raw_tex -t native\n\\begin{sloppypar}\nSequi id qui facere et incidunt ut. Et fuga ut voluptate enim qui. Odit unde magni ipsam dicta modi. Modi soluta velit est aut aut possimus.\n\nQui et temporibus explicabo. Esse ab ut quidem. Vel qui perspiciatis quae odio consectetur alias non sed. Quo consectetur libero omnis quos eius ad vel.\n\\end{sloppypar}\n^D\n[ Para\n    [ Str \"Sequi\"\n    , Space\n    , Str \"id\"\n    , Space\n    , Str \"qui\"\n    , Space\n    , Str \"facere\"\n    , Space\n    , Str \"et\"\n    , Space\n    , Str \"incidunt\"\n    , Space\n    , Str \"ut.\"\n    , Space\n    , Str \"Et\"\n    , Space\n    , Str \"fuga\"\n    , Space\n    , Str \"ut\"\n    , Space\n    , Str \"voluptate\"\n    , Space\n    , Str \"enim\"\n    , Space\n    , Str \"qui.\"\n    , Space\n    , Str \"Odit\"\n    , Space\n    , Str \"unde\"\n    , Space\n    , Str \"magni\"\n    , Space\n    , Str \"ipsam\"\n    , Space\n    , Str \"dicta\"\n    , Space\n    , Str \"modi.\"\n    , Space\n    , Str \"Modi\"\n    , Space\n    , Str \"soluta\"\n    , Space\n    , Str \"velit\"\n    , Space\n    , Str \"est\"\n    , Space\n    , Str \"aut\"\n    , Space\n    , Str \"aut\"\n    , Space\n    , Str \"possimus.\"\n    ]\n, Para\n    [ Str \"Qui\"\n    , Space\n    , Str \"et\"\n    , Space\n    , Str \"temporibus\"\n    , Space\n    , Str \"explicabo.\"\n    , Space\n    , Str \"Esse\"\n    , Space\n    , Str \"ab\"\n    , Space\n    , Str \"ut\"\n    , Space\n    , Str \"quidem.\"\n    , Space\n    , Str \"Vel\"\n    , Space\n    , Str \"qui\"\n    , Space\n    , Str \"perspiciatis\"\n    , Space\n    , Str \"quae\"\n    , Space\n    , Str \"odio\"\n    , Space\n    , Str \"consectetur\"\n    , Space\n    , Str \"alias\"\n    , Space\n    , Str \"non\"\n    , Space\n    , Str \"sed.\"\n    , Space\n    , Str \"Quo\"\n    , Space\n    , Str \"consectetur\"\n    , Space\n    , Str \"libero\"\n    , Space\n    , Str \"omnis\"\n    , Space\n    , Str \"quos\"\n    , Space\n    , Str \"eius\"\n    , Space\n    , Str \"ad\"\n    , Space\n    , Str \"vel.\"\n    ]\n]\n```\n\n```\n% pandoc -f latex -t native\n\\begin{sloppypar}\nSequi id qui facere et incidunt ut. Et fuga ut voluptate enim qui. Odit unde magni ipsam dicta modi. Modi soluta velit est aut aut possimus.\n\nQui et temporibus explicabo. Esse ab ut quidem. Vel qui perspiciatis quae odio consectetur alias non sed. Quo consectetur libero omnis quos eius ad vel.\n\\end{sloppypar}\n^D\n[ Para\n    [ Str \"Sequi\"\n    , Space\n    , Str \"id\"\n    , Space\n    , Str \"qui\"\n    , Space\n    , Str \"facere\"\n    , Space\n    , Str \"et\"\n    , Space\n    , Str \"incidunt\"\n    , Space\n    , Str \"ut.\"\n    , Space\n    , Str \"Et\"\n    , Space\n    , Str \"fuga\"\n    , Space\n    , Str \"ut\"\n    , Space\n    , Str \"voluptate\"\n    , Space\n    , Str \"enim\"\n    , Space\n    , Str \"qui.\"\n    , Space\n    , Str \"Odit\"\n    , Space\n    , Str \"unde\"\n    , Space\n    , Str \"magni\"\n    , Space\n    , Str \"ipsam\"\n    , Space\n    , Str \"dicta\"\n    , Space\n    , Str \"modi.\"\n    , Space\n    , Str \"Modi\"\n    , Space\n    , Str \"soluta\"\n    , Space\n    , Str \"velit\"\n    , Space\n    , Str \"est\"\n    , Space\n    , Str \"aut\"\n    , Space\n    , Str \"aut\"\n    , Space\n    , Str \"possimus.\"\n    ]\n, Para\n    [ Str \"Qui\"\n    , Space\n    , Str \"et\"\n    , Space\n    , Str \"temporibus\"\n    , Space\n    , Str \"explicabo.\"\n    , Space\n    , Str \"Esse\"\n    , Space\n    , Str \"ab\"\n    , Space\n    , Str \"ut\"\n    , Space\n    , Str \"quidem.\"\n    , Space\n    , Str \"Vel\"\n    , Space\n    , Str \"qui\"\n    , Space\n    , Str \"perspiciatis\"\n    , Space\n    , Str \"quae\"\n    , Space\n    , Str \"odio\"\n    , Space\n    , Str \"consectetur\"\n    , Space\n    , Str \"alias\"\n    , Space\n    , Str \"non\"\n    , Space\n    , Str \"sed.\"\n    , Space\n    , Str \"Quo\"\n    , Space\n    , Str \"consectetur\"\n    , Space\n    , Str \"libero\"\n    , Space\n    , Str \"omnis\"\n    , Space\n    , Str \"quos\"\n    , Space\n    , Str \"eius\"\n    , Space\n    , Str \"ad\"\n    , Space\n    , Str \"vel.\"\n    ]\n]\n```\n"
  },
  {
    "path": "test/command/smart.md",
    "content": "```\n% pandoc -f markdown+smart -t markdown-smart\n\"hi\"...dog's breath---cat 5--6\n^D\n“hi”…dog’s breath—cat 5–6\n```\n\n```\n% pandoc -f markdown+smart -t markdown+smart\n\"hi\"...dog's breath---cat 5--6\n^D\n\"hi\"...dog's breath---cat 5--6\n```\n\nWhen we render literal quotes without smart, we need to escape:\n\n```\n% pandoc -f markdown-smart \\\n  -t markdown+smart\n\"hi\"...dog's breath---cat 5--6\n^D\n\\\"hi\\\"\\...dog\\'s breath\\-\\--cat 5\\--6\n```\n\n```\n% pandoc -f markdown+smart -t rst-smart\n\"hi\"...dog's breath---cat 5--6\n^D\n“hi”…dog’s breath—cat 5–6\n```\n\n```\n% pandoc -f markdown+smart -t rst+smart\n\"hi\"...dog's breath---cat 5--6\n^D\n\"hi\"...dog's breath---cat 5--6\n```\n\n```\n% pandoc -f markdown-smart -t rst+smart\n\"hi\"...dog's breath---cat 5--6\n^D\n\\\"hi\\\"\\...dog\\'s breath\\-\\--cat 5\\--6\n```\n\n"
  },
  {
    "path": "test/command/style399.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"never\" default-locale=\"en-US\">\n  <citation>\n    <sort>\n      <key variable=\"citation-number\"/>\n    </sort>\n    <layout prefix=\"[\" suffix=\"]\" delimiter=\",\">\n      <text variable=\"citation-number\"/>\n    </layout>\n  </citation>\n</style>\n\n"
  },
  {
    "path": "test/command/sub-file-chapter-1.tex",
    "content": "\\documentclass[main.tex]{subfiles}\n\\begin{document}\n\n\\section{Chapter 1}\n\nThis is Chapter 1, provided in a sub file. \n\n\\end{document}\n"
  },
  {
    "path": "test/command/sub-file-chapter-2.tex",
    "content": "\\documentclass[main.tex]{subfiles}\n\\begin{document}\n\n\\section{Chapter 2}\n\nThis is Chapter 2, provided in a second sub file. \n\n\\end{document}\n"
  },
  {
    "path": "test/command/svg.md",
    "content": "```\n% pandoc -f latex -t icml\n\\includegraphics{command/corrupt.svg}\n^D\n2> [WARNING] Could not determine image size for command/corrupt.svg: could not determine image type\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 150 -100\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-150 -100\" LeftDirection=\"-150 -100\" RightDirection=\"-150 -100\" />\n              <PathPointType Anchor=\"-150 100\" LeftDirection=\"-150 100\" RightDirection=\"-150 100\" />\n              <PathPointType Anchor=\"150 100\" LeftDirection=\"150 100\" RightDirection=\"150 100\" />\n              <PathPointType Anchor=\"150 -100\" LeftDirection=\"150 -100\" RightDirection=\"150 -100\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -150 -100\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"300\" Bottom=\"200\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:command/corrupt.svg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n```\n\n```\n% pandoc -f latex -t icml\n\\includegraphics{command/SVG_logo.svg}\n^D\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 37.5 -37.5\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-37.5 -37.5\" LeftDirection=\"-37.5 -37.5\" RightDirection=\"-37.5 -37.5\" />\n              <PathPointType Anchor=\"-37.5 37.5\" LeftDirection=\"-37.5 37.5\" RightDirection=\"-37.5 37.5\" />\n              <PathPointType Anchor=\"37.5 37.5\" LeftDirection=\"37.5 37.5\" RightDirection=\"37.5 37.5\" />\n              <PathPointType Anchor=\"37.5 -37.5\" LeftDirection=\"37.5 -37.5\" RightDirection=\"37.5 -37.5\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -37.5 -37.5\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"75\" Bottom=\"75\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:command/SVG_logo.svg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n```\n\n```\n% pandoc -f latex -t icml\n\\includegraphics{command/SVG_logo-without-xml-declaration.svg}\n^D\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 37.5 -37.5\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-37.5 -37.5\" LeftDirection=\"-37.5 -37.5\" RightDirection=\"-37.5 -37.5\" />\n              <PathPointType Anchor=\"-37.5 37.5\" LeftDirection=\"-37.5 37.5\" RightDirection=\"-37.5 37.5\" />\n              <PathPointType Anchor=\"37.5 37.5\" LeftDirection=\"37.5 37.5\" RightDirection=\"37.5 37.5\" />\n              <PathPointType Anchor=\"37.5 -37.5\" LeftDirection=\"37.5 -37.5\" RightDirection=\"37.5 -37.5\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -37.5 -37.5\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"75\" Bottom=\"75\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:command/SVG_logo-without-xml-declaration.svg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n```\n\n\n```\n% pandoc -f latex -t icml\n\\includegraphics{command/inkscape-cube.svg}\n^D\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 54.75 -65.25\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-54.75 -65.25\" LeftDirection=\"-54.75 -65.25\" RightDirection=\"-54.75 -65.25\" />\n              <PathPointType Anchor=\"-54.75 65.25\" LeftDirection=\"-54.75 65.25\" RightDirection=\"-54.75 65.25\" />\n              <PathPointType Anchor=\"54.75 65.25\" LeftDirection=\"54.75 65.25\" RightDirection=\"54.75 65.25\" />\n              <PathPointType Anchor=\"54.75 -65.25\" LeftDirection=\"54.75 -65.25\" RightDirection=\"54.75 -65.25\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -54.75 -65.25\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"109.5\" Bottom=\"130.5\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:command/inkscape-cube.svg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n```\n\n"
  },
  {
    "path": "test/command/table-with-cell-align.md",
    "content": "```\n% pandoc -f docbook -t native --quiet\n<informaltable frame=\"all\" rowsep=\"1\" colsep=\"1\">\n<tgroup cols=\"16\">\n<tbody>\n<row>\n<entry align=\"center\" valign=\"top\"><simpara>1</simpara></entry>\n<entry align=\"left\" valign=\"top\"><simpara>2</simpara></entry>\n<entry align=\"right\" valign=\"top\"><simpara>3</simpara></entry>\n<entry align=\"justify\" valign=\"top\"><simpara>4</simpara></entry>\n</row>\n</tbody>\n</tgroup>\n</informaltable>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignRight\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"4\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n```\n% pandoc -f native -t opendocument --quiet\n[Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n    [Para [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignLeft (RowSpan 1) (ColSpan 1)\n    [Para [Str \"2\"]]\n   ,Cell (\"\",[],[]) AlignRight (RowSpan 1) (ColSpan 1)\n    [Para [Str \"3\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"4\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-column table:style-name=\"Table1.C\" />\n  <table:table-column table:style-name=\"Table1.D\" />\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P1\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">2</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P2\">3</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">4</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n```\n"
  },
  {
    "path": "test/command/table-with-column-span.md",
    "content": "```\n% pandoc -f docbook -t native --quiet\n<informaltable frame=\"all\" rowsep=\"1\" colsep=\"1\">\n<tgroup cols=\"16\">\n<colspec colname=\"col_1\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_2\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_3\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_4\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_5\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_6\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_7\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_8\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_9\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_10\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_11\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_12\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_13\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_14\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_15\" colwidth=\"6.25*\"/>\n<colspec colname=\"col_16\" colwidth=\"6.25*\"/>\n<tbody>\n<row>\n<entry align=\"center\" valign=\"top\" namest=\"col_1\" nameend=\"col_8\"><simpara><emphasis role=\"strong\">Octet no. 1</emphasis></simpara></entry>\n<entry align=\"center\" valign=\"top\" namest=\"col_2\" nameend=\"col_9\"><simpara><emphasis role=\"strong\">Octet no. 2</emphasis></simpara></entry>\n</row>\n<row>\n<entry align=\"center\" valign=\"top\"><simpara>16</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>15</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>14</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>13</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>12</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>11</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>10</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>9</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>8</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>7</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>6</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>5</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>4</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>3</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>2</simpara></entry>\n<entry align=\"center\" valign=\"top\"><simpara>1</simpara></entry>\n</row>\n<row>\n<entry align=\"center\" valign=\"top\" namest=\"col_1\" nameend=\"col_8\"><simpara>Code A</simpara></entry>\n<entry align=\"center\" valign=\"top\" namest=\"col_2\" nameend=\"col_9\"><simpara>Code B</simpara></entry>\n</row>\n</tbody>\n</tgroup>\n</informaltable>\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    , ( AlignDefault , ColWidth 6.25e-2 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 8)\n                [ Para\n                    [ Strong\n                        [ Str \"Octet\"\n                        , Space\n                        , Str \"no.\"\n                        , Space\n                        , Str \"1\"\n                        ]\n                    ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 8)\n                [ Para\n                    [ Strong\n                        [ Str \"Octet\"\n                        , Space\n                        , Str \"no.\"\n                        , Space\n                        , Str \"2\"\n                        ]\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"16\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"15\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"14\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"13\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"11\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"10\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"9\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"8\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"1\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 8)\n                [ Para [ Str \"Code\" , Space , Str \"A\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignCenter\n                (RowSpan 1)\n                (ColSpan 8)\n                [ Para [ Str \"Code\" , Space , Str \"B\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n```\n% pandoc -f native -t opendocument --quiet\n[Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)\n ,(AlignDefault,ColWidth 6.25e-2)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)\n    [Para [Strong [Str \"Octet\",Space,Str \"no.\",Space,Str \"1\"]]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)\n    [Para [Strong [Str \"Octet\",Space,Str \"no.\",Space,Str \"2\"]]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"16\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"15\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"14\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"13\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"11\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"10\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"9\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"8\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"6\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"5\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"4\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"3\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"2\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"1\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)\n    [Para [Str \"Code\",Space,Str \"A\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)\n    [Para [Str \"Code\",Space,Str \"B\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n^D\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-column table:style-name=\"Table1.C\" />\n  <table:table-column table:style-name=\"Table1.D\" />\n  <table:table-column table:style-name=\"Table1.E\" />\n  <table:table-column table:style-name=\"Table1.F\" />\n  <table:table-column table:style-name=\"Table1.G\" />\n  <table:table-column table:style-name=\"Table1.H\" />\n  <table:table-column table:style-name=\"Table1.I\" />\n  <table:table-column table:style-name=\"Table1.J\" />\n  <table:table-column table:style-name=\"Table1.K\" />\n  <table:table-column table:style-name=\"Table1.L\" />\n  <table:table-column table:style-name=\"Table1.M\" />\n  <table:table-column table:style-name=\"Table1.N\" />\n  <table:table-column table:style-name=\"Table1.O\" />\n  <table:table-column table:style-name=\"Table1.P\" />\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\" table:number-columns-spanned=\"8\">\n      <text:p text:style-name=\"Table_20_Contents\"><text:span text:style-name=\"T1\">Octet\n      no. 1</text:span></text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\" table:number-columns-spanned=\"8\">\n      <text:p text:style-name=\"Table_20_Contents\"><text:span text:style-name=\"T1\">Octet\n      no. 2</text:span></text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">16</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">15</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">14</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">13</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">11</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">10</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">9</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">8</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">7</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">6</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">5</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">4</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">3</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">2</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\" table:number-columns-spanned=\"8\">\n      <text:p text:style-name=\"Table_20_Contents\">Code A</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\" table:number-columns-spanned=\"8\">\n      <text:p text:style-name=\"Table_20_Contents\">Code B</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n```\n"
  },
  {
    "path": "test/command/tabularx.md",
    "content": "```\n% pandoc -f latex -t native --quiet\n\\begin{tabularx}{\\linewidth}{|c|c|c|}\n\\hline\n  Column Heading 1\n  & Column Heading 2\n  & Column Heading 3 \\\\\n\\hline\n  Cell 1.1\n  & Cell 1.2\n  & Cell 1.3 \\\\\n\\hline\n  Cell 2.1\n  & Cell 2.2\n  & Cell 2.3 \\\\\n\\hline\n  Cell 3.1\n  & Cell 3.2\n  & Cell 3.3 \\\\\n\\hline\n\\end{tabularx}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"1\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"2\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"3\"\n                   ]\n               ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f latex -t native --quiet\n\\begin{tabularx}{\\linewidth}{|X|c|p{0.25\\linewidth}|}\n\\hline\n  Column Heading 1\n  & Column Heading 2\n  & Column Heading 3 \\\\\n\\hline\n  Cell 1.1\n  & Cell 1.2\n  & Cell 1.3 \\\\\n\\hline\n  Cell 2.1\n  & Cell 2.2\n  & Cell 2.3 \\\\\n\\hline\n  Cell 3.1\n  & Cell 3.2\n  & Cell 3.3 \\\\\n\\hline\n\\end{tabularx}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignLeft , ColWidth 0.25 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"1\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"2\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"3\"\n                   ]\n               ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n\n```\n% pandoc -f latex -t native --quiet\n\\begin{tabularx}{\\linewidth}{|b{0.25\\linewidth}|c|m{0.25\\linewidth}|}\n\\hline\n  Column Heading 1\n  & Column Heading 2\n  & Column Heading 3 \\\\\n\\hline\n  Cell 1.1\n  & Cell 1.2\n  & Cell 1.3 \\\\\n\\hline\n  Cell 2.1\n  & Cell 2.2\n  & Cell 2.3 \\\\\n\\hline\n  Cell 3.1\n  & Cell 3.2\n  & Cell 3.3 \\\\\n\\hline\n\\end{tabularx}\n^D\n[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidth 0.25 )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignLeft , ColWidth 0.25 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"1\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"2\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Column\"\n                   , Space\n                   , Str \"Heading\"\n                   , Space\n                   , Str \"3\"\n                   ]\n               ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"1.3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"2.3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Cell\" , Space , Str \"3.3\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n```\n"
  },
  {
    "path": "test/command/tasklist.md",
    "content": "tests adapted from <https://github.github.com/gfm/#task-list-items-extension->\n\n```\n% pandoc\n- [ ] foo\n- [x] bar\n^D\n<ul class=\"task-list\">\n<li><label><input type=\"checkbox\" />foo</label></li>\n<li><label><input type=\"checkbox\" checked=\"\" />bar</label></li>\n</ul>\n```\n\n\n```\n% pandoc\n- [x] foo\n  - [ ] bar\n  - [x] baz\n- [ ] bim\n^D\n<ul class=\"task-list\">\n<li><label><input type=\"checkbox\" checked=\"\" />foo</label>\n<ul class=\"task-list\">\n<li><label><input type=\"checkbox\" />bar</label></li>\n<li><label><input type=\"checkbox\" checked=\"\" />baz</label></li>\n</ul></li>\n<li><label><input type=\"checkbox\" />bim</label></li>\n</ul>\n```\n\n\ncustom html task list test:\n\n```\n% pandoc\n- [ ]  unchecked\n- plain item\n-  [x] checked\n\nparagraph\n\n1. [ ] ordered unchecked\n2. [] plain item\n3. [x] ordered checked\n\nparagraph\n\n- [ ] list item with a\n\n    second paragraph\n\n- [x] checked\n^D\n<ul>\n<li><label><input type=\"checkbox\" />unchecked</label></li>\n<li>plain item</li>\n<li><label><input type=\"checkbox\" checked=\"\" />checked</label></li>\n</ul>\n<p>paragraph</p>\n<ol type=\"1\">\n<li><label><input type=\"checkbox\" />ordered unchecked</label></li>\n<li>[] plain item</li>\n<li><label><input type=\"checkbox\" checked=\"\" />ordered\nchecked</label></li>\n</ol>\n<p>paragraph</p>\n<ul class=\"task-list\">\n<li><p><label><input type=\"checkbox\" />list item with a</label></p>\n<p>second paragraph</p></li>\n<li><p><label><input type=\"checkbox\"\nchecked=\"\" />checked</label></p></li>\n</ul>\n```\n\nlatex task list test:\n\n```\n% pandoc -t latex\n- [ ] foo bar\n\n  baz\n\n- [x] ok\n^D\n\\begin{itemize}\n\\item[$\\square$]\n  foo bar\n\n  baz\n\\item[$\\boxtimes$]\n  ok\n\\end{itemize}\n```\n\nround trip:\n\n```\n% pandoc -f markdown -t markdown\n- [ ] foo\n- [x] bar\n^D\n- [ ] foo\n- [x] bar\n```"
  },
  {
    "path": "test/command/tex-group.md",
    "content": "```\n% pandoc -f latex -t html\n\\newenvironment{foo}%\n{\\emph\\bgroup}%\n{\\egroup}\n\n\\begin{foo}\nhi\n\\end{foo}\n^D\n<p><span> <em>hi</em> </span></p>\n```\n"
  },
  {
    "path": "test/command/three.txt",
    "content": "1st line.\n2nd line.\n3rd line.\n"
  },
  {
    "path": "test/command/toc.md",
    "content": "```\n% pandoc -s --toc -t markdown\n# A\n## b\n# B\n## b\n\n::: interior\n# C\n## cc\n# D\n:::\n\n::: blue\n# E\n## e\n:::\n^D\n- [A](#a){#toc-a}\n  - [b](#b){#toc-b}\n- [B](#b-1){#toc-b-1}\n  - [b](#b-2){#toc-b-2}\n- [E](#e){#toc-e}\n  - [e](#e-1){#toc-e-1}\n\n# A\n\n## b\n\n# B\n\n## b\n\n::: interior\n# C\n\n## cc\n\n# D\n:::\n\n::: blue\n# E\n\n## e\n:::\n```\n"
  },
  {
    "path": "test/command/translations.md",
    "content": "```\n% pandoc -f latex -t native -M lang=en\n\\figurename\\ 2\n^D\n[ Para [ Str \"Figure\\160\\&2\" ] ]\n```\n\n```\n% pandoc -f latex -t native -M lang=de-DE\n\\figurename\\ 2\n^D\n[ Para [ Str \"Abbildung\\160\\&2\" ] ]\n```\n\n```\n% pandoc -f latex -t native -M lang=en\n\\setmainlanguage{german}\n\\figurename 2\n^D\n[ Para [ Str \"Abbildung2\" ] ]\n```\n\n```\n% pandoc -f latex -t native -M lang=sr-Latn\n\\figurename~2\n\\figurename.\n^D\n[ Para [ Str \"Slika\\160\\&2\" , SoftBreak , Str \"Slika.\" ] ]\n```\n"
  },
  {
    "path": "test/command/typst-hs-80.md",
    "content": "```\n% pandoc -f typst -t native -s\n#set document(\n  title: [My Title],\n)\n\n#title()\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"title\"\n            , MetaInlines [ Str \"My\" , Space , Str \"Title\" ]\n            )\n          ]\n    }\n  []\n```\n\n```\n% pandoc -f typst -t native -s\n#set document(\n  title: [ignored],\n)\n\n#title[My Title]\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"title\"\n            , MetaInlines [ Str \"My\" , Space , Str \"Title\" ]\n            )\n          ]\n    }\n  []\n```\n\n```\n% pandoc -f typst -t native -s\n#title[My Title]\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"title\"\n            , MetaInlines [ Str \"My\" , Space , Str \"Title\" ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/typst-image-alt.md",
    "content": "```\n% pandoc -f markdown-implicit_figures -t typst\n![Alt text from inlines](image.png)\n^D\n#box(image(\"image.png\", alt: \"Alt text from inlines\"))\n```\n\n```\n% pandoc -f markdown-implicit_figures -t typst\n![](image.png){alt=\"Explicit alt attribute\"}\n^D\n#box(image(\"image.png\", alt: \"Explicit alt attribute\"))\n```\n\n```\n% pandoc -f markdown-implicit_figures -t typst\n![Inlines ignored](image.png){alt=\"Explicit wins\"}\n^D\n#box(image(\"image.png\", alt: \"Explicit wins\"))\n```\n\n```\n% pandoc -f markdown-implicit_figures -t typst\n![](image.png)\n^D\n#box(image(\"image.png\"))\n```\n\n```\n% pandoc -f markdown-implicit_figures -t typst\n![Inlines ignored for decorative](image.png){alt=\"\"}\n^D\n#box(image(\"image.png\"))\n```\n\n```\n% pandoc -t typst\n![Caption text](image.png){alt=\"Alt text describing the image\"}\n\n^D\n#figure(image(\"image.png\", alt: \"Alt text describing the image\"),\n  caption: [\n    Caption text\n  ]\n)\n```\n\n```\n% pandoc -t typst\n![Caption only](image.png)\n\n^D\n#figure(image(\"image.png\", alt: \"Caption only\"),\n  caption: [\n    Caption only\n  ]\n)\n```\n\n```\n% pandoc -f markdown -t typst\n![Caption](test.png){alt=\"A \\\"quoted\\\" phrase and C:\\\\path\\\\file\"}\n^D\n#figure(image(\"test.png\", alt: \"A \\\"quoted\\\" phrase and C:\\\\path\\\\file\"),\n  caption: [\n    Caption\n  ]\n)\n\n```\n\n```\n% pandoc -f html -t typst\n<img src=\"data:image/png;base64,iVBORw0KGgo=\" alt=\"A small red dot\">\n^D\n#box(image(bytes((137,80,78,71,13,10,26,10)), alt: \"A small red dot\"))\n\n```\n"
  },
  {
    "path": "test/command/typst-images.md",
    "content": "```\n% pandoc -t typst\n![dot](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAC4jAAAuIwF4pT92AAAASUlEQVQYGa3OWwoAIAgEQNf739k0EjVCfxKCHtMqiEh0jcWjOKBAkQjPe7MFdun/IbRdDNb05nvolzWzEx0DdozK96W1PzjNHxcgphkBs9CoHwAAAABJRU5ErkJggg==){width=1in}\n^D\n#figure(image(bytes((137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,10,0,0,0,10,8,6,0,0,0,141,50,207,189,0,0,0,9,112,72,89,115,0,0,46,35,0,0,46,35,1,120,165,63,118,0,0,0,73,73,68,65,84,24,25,173,206,91,10,0,32,8,4,64,215,251,223,217,52,18,53,66,127,18,130,30,211,42,136,72,116,141,197,163,56,160,64,145,8,207,123,179,5,118,233,255,33,180,93,12,214,244,230,123,232,151,53,179,19,29,3,118,140,202,247,165,181,63,56,205,31,23,32,166,25,1,179,208,168,31,0,0,0,0,73,69,78,68,174,66,96,130)), width: 1in, alt: \"dot\"),\n  caption: [\n    dot\n  ]\n)\n```\n\n```\n% pandoc -t typst\n![dot](dot.png){width=\"1in\"}\n^D\n#figure(image(\"dot.png\", width: 1in, alt: \"dot\"),\n  caption: [\n    dot\n  ]\n)\n```\n\n```\n% pandoc -t typst\n![chicken](data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%20aria-label%3D%22Chicken%22%3E%20%3Cpath%20d%3D%22M76.5%2033.3l-8.3-6.6%204-5c-1.3-2-1.3-4.7.1-6.6%203.4-3.8%208.7-2%2010.2%202.2%204.5.7%207.5%205.4%204.4%209.4a5.7%205.7%200%2001-6.4%201.6zM73%2026.2l3%202.4%203.8-4.7c1.3%201%203.5%202%204.5.7%202.1-2.9-1.5-5.4-4.7-3.5%201.2-4.6-2.7-6.2-4.5-3.9-.7%202.2.2%203%201.7%204.2z%22%2F%3E%20%3Cpath%20d%3D%22M54%2072.3a19.1%2019.1%200%2001-19.2-17.8%2021.4%2021.4%200%20014.7-15.2c3.5-4.3%208.4-7.1%2013.7-8l3.1-.1c8.2-.9%2012.9-5.5%2013-5.6l1-1%208.2%206.5-1%201.3c-3.3%204-2.8%2011.3-2.5%2014.2a21.5%2021.5%200%2001-4.4%2017.5%2021.2%2021.2%200%2001-16.5%208.2zM70.6%2029a27%2027%200%2001-14%205.5l-3%20.2a18%2018%200%2000-11.3%206.7%2018%2018%200%2000-4%2012.8%2016%2016%200%200015.9%2014.7c5.4%200%2010.4-2.5%2014-6.9A18%2018%200%200072%2049.4c0-.8-.2-1.6-.3-2.2-.5-4-.7-10.7%202.1-15.5z%22%2F%3E%20%3Cpath%20d%3D%22M46%2087C22.6%2087%20.5%2087%20.5%2066.8c0-19%2020.4-34.6%2045.5-34.6%201.2%200%202.5%200%203.7.2%2010.1.6%209.7-.1.5%203.2a18.3%2018.3%200%2000-12%2018.6%2016%2016%200%200015.9%2014.7c5.4%200%2010.4-2.5%2014-6.9A18%2018%200%200072%2049.4c-.6-4-.4-7.4-.2-11.3a35.8%2035.8%200%200119.5%2026A11.7%2011.7%200%200187.8%2087H46zm-2.8-51.3c-22%201-39.4%2014.6-39.4%2031%200%2015.8%2016%2016.9%2042.2%2016.9h41.8c4.6%200%208.4-3.8%208.4-8.4-.4-4.8-3.2-7.7-8.1-8.4-.3-10.4-7.4-18.4-13.3-22.7.1%202%20.5%204.3.7%206.1%200%205-1.6%2010-4.8%2014A21.2%2021.2%200%200154%2072.3a19.1%2019.1%200%2001-19.3-17.8%2021.4%2021.4%200%20018.4-18.8z%22%2F%3E%20%3C%2Fsvg%3E)\n^D\n#figure(image(bytes(\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 100 100\\\" aria-label=\\\"Chicken\\\"> <path d=\\\"M76.5 33.3l-8.3-6.6 4-5c-1.3-2-1.3-4.7.1-6.6 3.4-3.8 8.7-2 10.2 2.2 4.5.7 7.5 5.4 4.4 9.4a5.7 5.7 0 01-6.4 1.6zM73 26.2l3 2.4 3.8-4.7c1.3 1 3.5 2 4.5.7 2.1-2.9-1.5-5.4-4.7-3.5 1.2-4.6-2.7-6.2-4.5-3.9-.7 2.2.2 3 1.7 4.2z\\\"/> <path d=\\\"M54 72.3a19.1 19.1 0 01-19.2-17.8 21.4 21.4 0 014.7-15.2c3.5-4.3 8.4-7.1 13.7-8l3.1-.1c8.2-.9 12.9-5.5 13-5.6l1-1 8.2 6.5-1 1.3c-3.3 4-2.8 11.3-2.5 14.2a21.5 21.5 0 01-4.4 17.5 21.2 21.2 0 01-16.5 8.2zM70.6 29a27 27 0 01-14 5.5l-3 .2a18 18 0 00-11.3 6.7 18 18 0 00-4 12.8 16 16 0 0015.9 14.7c5.4 0 10.4-2.5 14-6.9A18 18 0 0072 49.4c0-.8-.2-1.6-.3-2.2-.5-4-.7-10.7 2.1-15.5z\\\"/> <path d=\\\"M46 87C22.6 87 .5 87 .5 66.8c0-19 20.4-34.6 45.5-34.6 1.2 0 2.5 0 3.7.2 10.1.6 9.7-.1.5 3.2a18.3 18.3 0 00-12 18.6 16 16 0 0015.9 14.7c5.4 0 10.4-2.5 14-6.9A18 18 0 0072 49.4c-.6-4-.4-7.4-.2-11.3a35.8 35.8 0 0119.5 26A11.7 11.7 0 0187.8 87H46zm-2.8-51.3c-22 1-39.4 14.6-39.4 31 0 15.8 16 16.9 42.2 16.9h41.8c4.6 0 8.4-3.8 8.4-8.4-.4-4.8-3.2-7.7-8.1-8.4-.3-10.4-7.4-18.4-13.3-22.7.1 2 .5 4.3.7 6.1 0 5-1.6 10-4.8 14A21.2 21.2 0 0154 72.3a19.1 19.1 0 01-19.3-17.8 21.4 21.4 0 018.4-18.8z\\\"/> </svg>\"), alt: \"chicken\"),\n  caption: [\n    chicken\n  ]\n)\n```\n"
  },
  {
    "path": "test/command/typst-property-output.md",
    "content": "```\n% pandoc -f html -t typst\n<span typst:text:fill=\"orange\">foo</span>\n^D\n#text(fill: orange)[foo]\n```\n\n```\n% pandoc -f html -t typst\n<span>foo</span>\n^D\nfoo\n```\n\n```\n% pandoc -f html -t typst\n<div typst:inset=\"10pt\">foo</div>\n^D\n#block(inset: 10pt)[\nfoo\n]\n```\n\n```\n% pandoc -f html -t typst\n<div typst:text:fill=\"purple\">foo</div>\n^D\n#block[\n#set text(fill: purple); foo\n]\n```\n\n```\n% pandoc -f html -t typst\n<div>foo</div>\n^D\n#block[\nfoo\n]\n```\n\n```\n% pandoc -f html -t typst\n<table typst:fill=\"blue\">\n  <tr><td>A</td><td>B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,auto,),\n    fill: blue,\n    [A], [B],\n  )]\n  , kind: table\n  )\n```\n\n```\n% pandoc -f html -t typst\n<table typst:text:fill=\"orange\">\n  <tr><td>A</td><td>B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#set text(fill: orange); #table(\n    columns: 2,\n    align: (auto,auto,),\n    [A], [B],\n  )]\n  , kind: table\n  )\n```\n\n```\n% pandoc -f html -t typst\n<table>\n  <tr><td>A</td><td typst:fill=\"green\">B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,auto,),\n    [A], table.cell(fill: green)[B],\n  )]\n  , kind: table\n  )\n```\n\n```\n% pandoc -f html -t typst\n<table>\n  <tr><td>A</td><td typst:text:fill=\"fuchsia\">B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,auto,),\n    [A], [#set text(fill: fuchsia); B],\n  )]\n  , kind: table\n  )\n```\n\n```\n% pandoc -f html -t typst\n<table>\n  <tr><td>A</td><td typst:text:fill=\"maroon\" align=\"center\">B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,center,),\n    [A], table.cell(align: center)[#set text(fill: maroon); B],\n  )]\n  , kind: table\n  )\n```\n\n```\n% pandoc -f html -t typst\n<table>\n  <tr><td>A</td><td typst:align=\"horizon\" align=\"center\">B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,center,),\n    [A], table.cell(align: horizon + center)[B],\n  )]\n  , kind: table\n  )\n```\n\n\n```\n% pandoc -f html -t typst\n<table>\n  <tr><td>A</td><td>B</td></tr>\n</table>\n^D\n#figure(\n  align(center)[#table(\n    columns: 2,\n    align: (auto,auto,),\n    [A], [B],\n  )]\n  , kind: table\n  )\n```\n\n```\n% pandoc -f html -t typst\n<p>Paragraph before.</p>\n\n<table class=\"typst:no-figure\" typst:text:size=\"3em\">\n  <tr>\n    <td>A</td>\n    <td>B</td>\n    <td>C</td>\n  </tr>\n</table>\n\n<p>Paragraph after.</p>\n^D\nParagraph before.\n\n#{set text(size: 3em); table(\n  columns: 3,\n  align: (auto,auto,auto,),\n  [A], [B], [C],\n)}\nParagraph after.\n```\n\n\n```\n% pandoc -f html -t typst\n<p>Paragraph before.</p>\n\n<table typst:text:size=\"3em\">\n  <tr>\n    <td>A</td>\n    <td>B</td>\n    <td>C</td>\n  </tr>\n</table>\n\n<p>Paragraph after.</p>\n^D\nParagraph before.\n\n#figure(\n  align(center)[#set text(size: 3em); #table(\n    columns: 3,\n    align: (auto,auto,auto,),\n    [A], [B], [C],\n  )]\n  , kind: table\n  )\n\nParagraph after.\n```\n\n\n```\n% pandoc -f html -t typst\n<p>Paragraph before.</p>\n\n<table class=\"typst:no-figure\">\n  <tr>\n    <td>A</td>\n    <td>B</td>\n    <td>C</td>\n  </tr>\n</table>\n\n<p>Paragraph after.</p>\n^D\nParagraph before.\n\n#table(\n  columns: 3,\n  align: (auto,auto,auto,),\n  [A], [B], [C],\n)\nParagraph after.\n```"
  },
  {
    "path": "test/command/unicode-collation.md",
    "content": "```\n% pandoc --citeproc -t plain\n---\nlang: en-US\ncsl: command/apa.csl\nreferences:\n- id: a1\n  type: book\n  author:\n  - family: Ubina\n    given: A. John\n  issued: 1985\n- id: a2\n  type: book\n  author:\n  - family: Über\n    given: Aglaia\n  issued: 1996\n- id: a3\n  type: book\n  author:\n  - family: Oñate\n    given: José\n  issued: 1985\n- id: a4\n  type: book\n  author:\n  - family: Onush\n    given: Frank\n  issued: 2002\n- id: a5\n  type: book\n  author:\n  - family: O'Neil\n    given: Timothy\n  issued: 2010\n---\n\n[@a1;@a2;@a3;@a4;@a5]\n^D\n(O’Neil, 2010; Oñate, 1985; Onush, 2002; Über, 1996; Ubina, 1985)\n\nO’Neil, T. (2010).\n\nOñate, J. (1985).\n\nOnush, F. (2002).\n\nÜber, A. (1996).\n\nUbina, A. J. (1985).\n```\n\n```\n% pandoc --citeproc -t plain\n---\nlang: es\ncsl: command/apa.csl\nreferences:\n- id: a1\n  type: book\n  author:\n  - family: Ubina\n    given: A. John\n  issued: 1985\n- id: a2\n  type: book\n  author:\n  - family: Über\n    given: Aglaia\n  issued: 1996\n- id: a3\n  type: book\n  author:\n  - family: Oñate\n    given: José\n  issued: 1985\n- id: a4\n  type: book\n  author:\n  - family: Onush\n    given: Frank\n  issued: 2002\n- id: a5\n  type: book\n  author:\n  - family: O'Neil\n    given: Timothy\n  issued: 2010\n---\n\n[@a1;@a2;@a3;@a4;@a5]\n^D\n(O’Neil, 2010; Onush, 2002; Oñate, 1985; Über, 1996; Ubina, 1985)\n\nO’Neil, T. (2010).\n\nOnush, F. (2002).\n\nOñate, J. (1985).\n\nÜber, A. (1996).\n\nUbina, A. J. (1985).\n```\n\n```\n% pandoc -C -t plain\n---\nnocite: '@*'\nlang: fr-FR-u-kb-true\nreferences:\n- id: cote\n  author: cote\n- id: côte\n  author: côte\n- id: coté\n  author: coté\n- id: côté\n  author: côté\n...\n^D\ncote. s. d.\n\ncôte. s. d.\n\ncoté. s. d.\n\ncôté. s. d.\n```\n"
  },
  {
    "path": "test/command/vancouver.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"in-text\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\" page-range-format=\"minimal\">\n  <info>\n    <title>Vancouver</title>\n    <id>http://www.zotero.org/styles/vancouver</id>\n    <link href=\"http://www.zotero.org/styles/vancouver\" rel=\"self\"/>\n    <link href=\"http://www.nlm.nih.gov/bsd/uniform_requirements.html\" rel=\"documentation\"/>\n    <author>\n      <name>Michael Berkowitz</name>\n      <email>mberkowi@gmu.edu</email>\n    </author>\n    <contributor>\n      <name>Sean Takats</name>\n      <email>stakats@gmu.edu</email>\n    </contributor>\n    <contributor>\n      <name>Sebastian Karcher</name>\n    </contributor>\n    <category citation-format=\"numeric\"/>\n    <category field=\"medicine\"/>\n    <summary>Vancouver style as outlined by International Committee of Medical Journal Editors Uniform Requirements for Manuscripts Submitted to Biomedical Journals: Sample References</summary>\n    <updated>2014-09-06T16:03:01+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"en\">\n    <date form=\"text\" delimiter=\" \">\n      <date-part name=\"year\"/>\n      <date-part name=\"month\" form=\"short\" strip-periods=\"true\"/>\n      <date-part name=\"day\"/>\n    </date>\n    <terms>\n      <term name=\"collection-editor\" form=\"long\">\n        <single>editor</single>\n        <multiple>editors</multiple>\n      </term>\n      <term name=\"presented at\">presented at</term>\n      <term name=\"available at\">available from</term>\n      <term name=\"section\" form=\"short\">sect.</term>\n    </terms>\n  </locale>\n  <locale xml:lang=\"fr\">\n    <date form=\"text\" delimiter=\" \">\n      <date-part name=\"day\"/>\n      <date-part name=\"month\" form=\"short\" strip-periods=\"true\"/>\n      <date-part name=\"year\"/>\n    </date>\n  </locale>\n  <macro name=\"author\">\n    <names variable=\"author\">\n      <name sort-separator=\" \" initialize-with=\"\" name-as-sort-order=\"all\" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"long\" prefix=\", \"/>\n      <substitute>\n        <names variable=\"editor\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\" suffix=\".\">\n      <name sort-separator=\" \" initialize-with=\"\" name-as-sort-order=\"all\" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n      <label form=\"long\" prefix=\", \"/>\n    </names>\n  </macro>\n  <macro name=\"chapter-marker\">\n    <choose>\n      <if type=\"chapter paper-conference entry-dictionary entry-encyclopedia\" match=\"any\">\n        <text term=\"in\" text-case=\"capitalize-first\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <!--discard publisher info for articles-->\n      <if type=\"article-journal article-magazine article-newspaper\" match=\"none\">\n        <group delimiter=\": \" suffix=\";\">\n          <choose>\n            <if type=\"thesis\">\n              <text variable=\"publisher-place\" prefix=\"[\" suffix=\"]\"/>\n            </if>\n            <else-if type=\"speech\"/>\n            <else>\n              <text variable=\"publisher-place\"/>\n            </else>\n          </choose>\n          <text variable=\"publisher\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"access\">\n    <choose>\n      <if variable=\"URL\">\n        <group delimiter=\": \">\n          <text term=\"available at\" text-case=\"capitalize-first\"/>\n          <text variable=\"URL\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"accessed-date\">\n    <choose>\n      <if variable=\"URL\">\n        <group prefix=\"[\" suffix=\"]\" delimiter=\" \">\n          <text term=\"cited\" text-case=\"lowercase\"/>\n          <date variable=\"accessed\" form=\"text\"/>\n        </group>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"container-title\">\n    <choose>\n      <if type=\"article-journal article-magazine chapter paper-conference article-newspaper review review-book entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group suffix=\".\" delimiter=\" \">\n          <choose>\n            <if type=\"article-journal review review-book\" match=\"any\">\n              <text variable=\"container-title\" form=\"short\" strip-periods=\"true\"/>\n            </if>\n            <else>\n              <text variable=\"container-title\" strip-periods=\"true\"/>\n            </else>\n          </choose>\n          <choose>\n            <if variable=\"URL\">\n              <text term=\"internet\" prefix=\"[\" suffix=\"]\" text-case=\"capitalize-first\"/>\n            </if>\n          </choose>\n        </group>\n        <text macro=\"edition\" prefix=\" \"/>\n      </if>\n      <!--add event-name and event-place once they become available-->\n      <else-if type=\"bill legislation\" match=\"any\">\n        <group delimiter=\", \">\n          <group delimiter=\". \">\n            <text variable=\"container-title\"/>\n            <group delimiter=\" \">\n              <text term=\"section\" form=\"short\" text-case=\"capitalize-first\"/>\n              <text variable=\"section\"/>\n            </group>\n          </group>\n          <text variable=\"number\"/>\n        </group>\n      </else-if>\n      <else-if type=\"speech\">\n        <group delimiter=\": \" suffix=\";\">\n          <group delimiter=\" \">\n            <text variable=\"genre\" text-case=\"capitalize-first\"/>\n            <text term=\"presented at\"/>\n          </group>\n          <text variable=\"event\"/>\n        </group>\n      </else-if>\n      <else>\n        <group delimiter=\", \" suffix=\".\">\n          <choose>\n            <if variable=\"collection-title\" match=\"none\">\n              <group delimiter=\" \">\n                <label variable=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n                <text variable=\"volume\"/>\n              </group>\n            </if>\n          </choose>\n          <text variable=\"container-title\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"title\">\n    <text variable=\"title\"/>\n    <choose>\n      <if type=\"article-journal article-magazine chapter paper-conference article-newspaper review review-book entry-dictionary entry-encyclopedia\" match=\"none\">\n        <choose>\n          <if variable=\"URL\">\n            <text term=\"internet\" prefix=\" [\" suffix=\"]\" text-case=\"capitalize-first\"/>\n          </if>\n        </choose>\n        <text macro=\"edition\" prefix=\". \"/>\n      </if>\n    </choose>\n    <choose>\n      <if type=\"thesis\">\n        <text variable=\"genre\" prefix=\" [\" suffix=\"]\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if is-numeric=\"edition\">\n        <group delimiter=\" \">\n          <number variable=\"edition\" form=\"ordinal\"/>\n          <text term=\"edition\" form=\"short\"/>\n        </group>\n      </if>\n      <else>\n        <text variable=\"edition\" suffix=\".\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"date\">\n    <choose>\n      <if type=\"article-journal article-magazine article-newspaper review review-book\" match=\"any\">\n        <group suffix=\";\" delimiter=\" \">\n          <date variable=\"issued\" form=\"text\"/>\n          <text macro=\"accessed-date\"/>\n        </group>\n      </if>\n      <else-if type=\"bill legislation\" match=\"any\">\n        <group delimiter=\", \">\n          <date variable=\"issued\" delimiter=\" \">\n            <date-part name=\"month\" form=\"short\" strip-periods=\"true\"/>\n            <date-part name=\"day\"/>\n          </date>\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </else-if>\n      <else-if type=\"report\">\n        <date variable=\"issued\" delimiter=\" \">\n          <date-part name=\"year\"/>\n          <date-part name=\"month\" form=\"short\" strip-periods=\"true\"/>\n        </date>\n        <text macro=\"accessed-date\" prefix=\" \"/>\n      </else-if>\n      <else-if type=\"patent\">\n        <group suffix=\".\">\n          <group delimiter=\", \">\n            <text variable=\"number\"/>\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n          <text macro=\"accessed-date\" prefix=\" \"/>\n        </group>\n      </else-if>\n      <else-if type=\"speech\">\n        <group delimiter=\"; \">\n          <group delimiter=\" \">\n            <date variable=\"issued\" delimiter=\" \">\n              <date-part name=\"year\"/>\n              <date-part name=\"month\" form=\"short\" strip-periods=\"true\"/>\n              <date-part name=\"day\"/>\n            </date>\n            <text macro=\"accessed-date\"/>\n          </group>\n          <text variable=\"event-place\"/>\n        </group>\n      </else-if>\n      <else>\n        <group suffix=\".\">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n          <text macro=\"accessed-date\" prefix=\" \"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"pages\">\n    <choose>\n      <if type=\"article-journal article-magazine article-newspaper review review-book\" match=\"any\">\n        <text variable=\"page\" prefix=\":\"/>\n      </if>\n      <else-if type=\"book\" match=\"any\">\n        <text variable=\"number-of-pages\" prefix=\" \"/>\n        <choose>\n          <if is-numeric=\"number-of-pages\">\n            <label variable=\"number-of-pages\" form=\"short\" prefix=\" \" plural=\"never\"/>\n          </if>\n        </choose>\n      </else-if>\n      <else>\n        <group prefix=\" \" delimiter=\" \">\n          <label variable=\"page\" form=\"short\" plural=\"never\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"journal-location\">\n    <choose>\n      <if type=\"article-journal article-magazine review review-book\" match=\"any\">\n        <text variable=\"volume\"/>\n        <text variable=\"issue\" prefix=\"(\" suffix=\")\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"collection-details\">\n    <choose>\n      <if type=\"article-journal article-magazine article-newspaper review review-book\" match=\"none\">\n        <choose>\n          <if variable=\"collection-title\">\n            <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n              <names variable=\"collection-editor\" suffix=\".\">\n                <name sort-separator=\" \" initialize-with=\"\" name-as-sort-order=\"all\" delimiter=\", \" delimiter-precedes-last=\"always\"/>\n                <label form=\"long\" prefix=\", \"/>\n              </names>\n              <group delimiter=\"; \">\n                <text variable=\"collection-title\"/>\n                <group delimiter=\" \">\n                  <label variable=\"volume\" form=\"short\"/>\n                  <text variable=\"volume\"/>\n                </group>\n              </group>\n            </group>\n          </if>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"report-details\">\n    <choose>\n      <if type=\"report\">\n        <text variable=\"number\" prefix=\"Report No.: \"/>\n      </if>\n    </choose>\n  </macro>\n  <citation collapse=\"citation-number\">\n    <sort>\n      <key variable=\"citation-number\"/>\n    </sort>\n    <layout prefix=\"(\" suffix=\")\" delimiter=\",\">\n      <text variable=\"citation-number\"/>\n    </layout>\n  </citation>\n  <bibliography et-al-min=\"7\" et-al-use-first=\"6\" second-field-align=\"flush\">\n    <layout>\n      <text variable=\"citation-number\" suffix=\". \"/>\n      <group delimiter=\". \" suffix=\". \">\n        <text macro=\"author\"/>\n        <text macro=\"title\"/>\n      </group>\n      <group delimiter=\" \" suffix=\". \">\n        <group delimiter=\": \">\n          <text macro=\"chapter-marker\"/>\n          <group delimiter=\" \">\n            <text macro=\"editor\"/>\n            <text macro=\"container-title\"/>\n          </group>\n        </group>\n        <text macro=\"publisher\"/>\n        <group>\n          <text macro=\"date\"/>\n          <text macro=\"journal-location\"/>\n          <text macro=\"pages\"/>\n        </group>\n      </group>\n      <text macro=\"collection-details\" suffix=\". \"/>\n      <text macro=\"report-details\" suffix=\". \"/>\n      <text macro=\"access\"/>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/command/vars-and-metadata.md",
    "content": "Variables should not leak into metadata in the Markdown writer:\n\n```\n% pandoc -t markdown -Vfoo=1 -Vbar=2 -s\n---\nfoo: x\n...\nzib\n^D\n---\nfoo: x\n---\n\nzib\n```\n"
  },
  {
    "path": "test/command/video-audio.md",
    "content": "```\n% pandoc -f markdown-implicit_figures -t html\n![](./test.mp4)\n\n![Your browser does not support video.](foo/test.webm){width=300}\n\n![](test.mp3)\n\n![](./test.pdf)\n\n![](./test.jpg)\n^D\n<p><video src=\"./test.mp4\" controls=\"\"><a\nhref=\"./test.mp4\">Video</a></video></p>\n<p><video src=\"foo/test.webm\" width=\"300\" controls=\"\"><a\nhref=\"foo/test.webm\">Your browser does not support\nvideo.</a></video></p>\n<p><audio src=\"test.mp3\" controls=\"\"><a\nhref=\"test.mp3\">Audio</a></audio></p>\n<p><embed src=\"./test.pdf\" /></p>\n<p><img src=\"./test.jpg\" /></p>\n```\n\n"
  },
  {
    "path": "test/command/wikilinks_title_after_pipe.md",
    "content": "# CommonMark\n\n## Reader\n```\n% pandoc --from commonmark_x+wikilinks_title_after_pipe -t html --columns 90\n[[https://example.org]]\n\n[[https://example.org|title]]\n\n[[name of page]]\n\n[[name of page|title]]\n^D\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"name of page\" class=\"wikilink\">name of page</a></p>\n<p><a href=\"name of page\" class=\"wikilink\">title</a></p>\n```\n\n## Writer\n\n```\n% pandoc -t commonmark_x+wikilinks_title_after_pipe -f html\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"Home\" class=\"wikilink\">Home</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Title</a></p>\n^D\n[[https://example.org]]\n\n[[https://example.org|title]]\n\n[[Home]]\n\n[[Name%20of%20page|Title]]\n```\n\n# Markdown\n## Reader\n\n```\n% pandoc --from markdown+wikilinks_title_after_pipe -t html --columns 90\n[[https://example.org]]\n\n[[https://example.org|title]]\n\n[[name of page]]\n\n[[name of page|title]]\n^D\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"name of page\" class=\"wikilink\">name of page</a></p>\n<p><a href=\"name of page\" class=\"wikilink\">title</a></p>\n```\n\n## Writer\n\n```\n% pandoc -t markdown+wikilinks_title_after_pipe -f html\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"Home\" class=\"wikilink\">Home</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Title</a></p>\n^D\n[[https://example.org]]\n\n[[https://example.org|title]]\n\n[[Home]]\n\n[[Name%20of%20page|Title]]\n```\n"
  },
  {
    "path": "test/command/wikilinks_title_before_pipe.md",
    "content": "# CommonMark\n\n## Reader\n\n```\n% pandoc -f commonmark+wikilinks_title_before_pipe -t html --columns 90\n[[https://example.org]]\n\n[[title|https://example.org]]\n\n[[Name of page]]\n\n[[Title|Name of page]]\n^D\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Name of page</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Title</a></p>\n```\n\n## Writer\n\n```\n% pandoc -t commonmark_x+wikilinks_title_before_pipe -f html\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"Home\" class=\"wikilink\">Home</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Title</a></p>\n^D\n[[https://example.org]]\n\n[[title|https://example.org]]\n\n[[Home]]\n\n[[Title|Name%20of%20page]]\n```\n\n## Regular links should still work\n\n```\n% pandoc -f commonmark+wikilinks_title_before_pipe -t html\n[Title](Name%20of%20page)\n^D\n<p><a href=\"Name%20of%20page\">Title</a></p>\n```\n\n# Markdown\n\n## Reader\n\n```\n% pandoc -f markdown+wikilinks_title_before_pipe -t html --columns 90\n[[https://example.org]]\n\n[[title|https://example.org]]\n\n[[Name of page]]\n\n[[Title|Name of page]]\n^D\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Name of page</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Title</a></p>\n```\n\n## Writer\n\n```\n% pandoc -t markdown+wikilinks_title_before_pipe -f html\n<p><a href=\"https://example.org\" class=\"wikilink\">https://example.org</a></p>\n<p><a href=\"https://example.org\" class=\"wikilink\">title</a></p>\n<p><a href=\"Home\" class=\"wikilink\">Home</a></p>\n<p><a href=\"Name of page\" class=\"wikilink\">Title</a></p>\n^D\n[[https://example.org]]\n\n[[title|https://example.org]]\n\n[[Home]]\n\n[[Title|Name%20of%20page]]\n```\n"
  },
  {
    "path": "test/command/write18.md",
    "content": "Handle \\write18{..} as raw tex:\n```\n% pandoc -t native\n\\write18{git --version}\n^D\n[ RawBlock (Format \"tex\") \"\\\\write18{git --version}\" ]\n```\n\n```\n% pandoc -f latex+raw_tex -t native\n\\write18{git --version}\n^D\n[ RawBlock (Format \"latex\") \"\\\\write18{git --version}\" ]\n```\n"
  },
  {
    "path": "test/command/yaml-metadata-blocks.md",
    "content": "```\n% pandoc -s -t native\n---\nfoobar_: this should be ignored\nfoo:\n  bar_: as should this\n---\n^D\nPandoc\n  Meta\n    { unMeta = fromList [ ( \"foo\" , MetaMap (fromList []) ) ] }\n  []\n```\n```\n% pandoc -s -t native\n---\n# For precedence, see multiple-metadata-blocks.md and vars-and-metadata.md\n# For Bools, see also 4819.md\n# For Multiline strings, see yaml-with-chomp.md\nint: 7\nfloat: 1.5\nscientific: 3.7e-5\nbool: true\nmore: False\nnothing: null\nempty: []\nnested:\n  int: 8\n  float: 2.5\n  bool: true\n  more: False\n  nothing: null\n  empty: []\n  scientific: 3.7e-5\n---\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"bool\" , MetaBool True )\n          , ( \"empty\" , MetaList [] )\n          , ( \"float\" , MetaInlines [ Str \"1.5\" ] )\n          , ( \"int\" , MetaInlines [ Str \"7\" ] )\n          , ( \"more\" , MetaBool False )\n          , ( \"nested\"\n            , MetaMap\n                (fromList\n                   [ ( \"bool\" , MetaBool True )\n                   , ( \"empty\" , MetaList [] )\n                   , ( \"float\" , MetaInlines [ Str \"2.5\" ] )\n                   , ( \"int\" , MetaInlines [ Str \"8\" ] )\n                   , ( \"more\" , MetaBool False )\n                   , ( \"nothing\" , MetaString \"\" )\n                   , ( \"scientific\" , MetaInlines [ Str \"3.7e-5\" ] )\n                   ])\n            )\n          , ( \"nothing\" , MetaString \"\" )\n          , ( \"scientific\" , MetaInlines [ Str \"3.7e-5\" ] )\n          ]\n    }\n  []\n```\n```\n% pandoc -s -t native\n---\narray:\n  - foo: bar\n  - bool: True\n---\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"array\"\n            , MetaList\n                [ MetaMap\n                    (fromList [ ( \"foo\" , MetaInlines [ Str \"bar\" ] ) ])\n                , MetaMap (fromList [ ( \"bool\" , MetaBool True ) ])\n                ]\n            )\n          ]\n    }\n  []\n```\n```\n% pandoc -s -t native --metadata-file command/yaml-metadata.yaml\n---\ntitle: document\n---\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"other\"\n            , MetaInlines\n                [ Emph [ Str \"markdown\" ] , Space , Str \"value\" ]\n            )\n          , ( \"title\" , MetaInlines [ Str \"document\" ] )\n          ]\n    }\n  []\n```\n```\n% pandoc -s -t native --metadata-file command/yaml-metadata.yaml -M title=cmdline\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"other\"\n            , MetaInlines\n                [ Emph [ Str \"markdown\" ] , Space , Str \"value\" ]\n            )\n          , ( \"title\" , MetaString \"cmdline\" )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/yaml-metadata.yaml",
    "content": "---\ntitle: file\nother: _markdown_ value\n---\n"
  },
  {
    "path": "test/command/yaml-with-chomp.md",
    "content": "```\n% pandoc -s -t native\n---\nml: |-\n    TEST\n\n    BLOCK\n...\n^D\nPandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"ml\"\n            , MetaInlines [ Str \"TEST\" , LineBreak , Str \"BLOCK\" ]\n            )\n          ]\n    }\n  []\n```\n"
  },
  {
    "path": "test/command/zeitschrift-fur-kunstgeschichte.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" version=\"1.0\" demote-non-dropping-particle=\"sort-only\">\n  <info>\n    <title>Zeitschrift für Kunstgeschichte</title>\n    <title-short>ZfK</title-short>\n    <id>http://www.zotero.org/styles/zeitschrift-fur-kunstgeschichte</id>\n    <link href=\"http://www.zotero.org/styles/zeitschrift-fur-kunstgeschichte\" rel=\"self\"/>\n    <link href=\"http://www.zotero.org/styles/kritische-ausgabe\" rel=\"template\"/>\n    <link href=\"http://www.uni-bielefeld.de/geschichte/abteilung/arbeitsbereiche/bildwissenschaft/zfk/documents/Sylesheet-(ger)-Zeitschrift-fur-Kunstgeschichte.pdf\" rel=\"documentation\"/>\n    <link href=\"https://github.com/citation-style-language/styles/pull/1861\" rel=\"documentation\"/>\n    <author>\n      <name>Philipp Zumstein</name>\n      <uri>https://github.com/zuphilip/</uri>\n    </author>\n    <contributor>\n      <name>Anna Simon</name>\n      <email>simonanna@gmx.net</email>\n    </contributor>\n    <category citation-format=\"note\"/>\n    <category field=\"humanities\"/>\n    <category field=\"history\"/>\n    <issn>0044-2992</issn>\n    <summary>From the editors: \"Die Herausgeber werden im Falle von Editionen, Lexika und Ausstellungskatalogen dem Titel nachgestellt [use encyclopedia articles with or without container-title for that]. Bei gewöhnlichen Sammelbänden werden die Herausgeber dem Titel vorangestellt [use book for that].\" Multilingual style; the information for exhibition catalogues should be entered in the field collection-title; locators may use the word \"here\" or \"hier\" in front of the page referring to which must be entered individually (the style outputs the locator as it is entered w/o any label or additional text).</summary>\n    <updated>2016-02-03T17:41:02+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"de\">\n    <terms>\n      <term name=\"note\">wie Anm.</term>\n      <term name=\"et-al\">et al.</term>\n      <term name=\"editor\" form=\"short\">Hg.</term>\n      <term name=\"editortranslator\" form=\"verb-short\">hg. und übers. von</term>\n      <term name=\"accessed\">letzter Zugriff am</term>\n    </terms>\n  </locale>\n  <locale xml:lang=\"en\">\n    <terms>\n      <term name=\"note\">as note</term>\n      <term name=\"editortranslator\" form=\"verb-short\">ed. and trans. by</term>\n    </terms>\n  </locale>\n  <macro name=\"author-short\">\n    <names variable=\"author\">\n      <name form=\"short\" delimiter=\"/\" and=\"text\" delimiter-precedes-et-al=\"never\"/>\n      <substitute>\n        <choose>\n          <if type=\"entry-encyclopedia\" match=\"none\">\n            <names variable=\"editor\"/>\n          </if>\n        </choose>\n        <text variable=\"title\" form=\"short\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author\">\n    <names variable=\"author\" delimiter=\", \">\n      <name and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n      <substitute>\n        <choose>\n          <if type=\"entry-encyclopedia\" match=\"none\">\n            <names variable=\"editor\"/>\n          </if>\n        </choose>\n        <text variable=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"author-bibliography\">\n    <names variable=\"author\" delimiter=\", \">\n      <name and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\" name-as-sort-order=\"first\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n      <substitute>\n        <choose>\n          <if type=\"entry-encyclopedia\" match=\"none\">\n            <names variable=\"editor\"/>\n          </if>\n        </choose>\n        <text variable=\"title\"/>\n      </substitute>\n    </names>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor translator\" delimiter=\", \">\n      <name and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\"/>\n      <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n    </names>\n  </macro>\n  <macro name=\"editor-encyclopedia\">\n    <names variable=\"editor translator\" delimiter=\", \">\n      <label form=\"verb-short\" suffix=\" \"/>\n      <name and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\"/>\n    </names>\n  </macro>\n  <macro name=\"volume\">\n    <choose>\n      <if type=\"article-journal\">\n        <text variable=\"volume\" prefix=\" \"/>\n        <text variable=\"issue\" prefix=\"/\"/>\n      </if>\n      <else>\n        <choose>\n          <if variable=\"volume\">\n            <group delimiter=\" \">\n              <number variable=\"volume\" form=\"long-ordinal\" text-case=\"capitalize-first\"/>\n              <text term=\"volume\" form=\"short\" text-case=\"capitalize-first\"/>\n            </group>\n          </if>\n          <else>\n            <group>\n              <number variable=\"number-of-volumes\" form=\"numeric\"/>\n              <text term=\"volume\" form=\"short\" prefix=\" \" plural=\"true\"/>\n            </group>\n          </else>\n        </choose>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"year-date\">\n    <date variable=\"issued\" date-parts=\"year\" form=\"numeric\"/>\n  </macro>\n  <macro name=\"collection-with-number\">\n    <group delimiter=\", \" prefix=\"(\" suffix=\")\">\n      <text variable=\"collection-title\"/>\n      <text variable=\"collection-number\"/>\n    </group>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"editor translator\" delimiter=\", \">\n      <label form=\"verb-short\"/>\n      <name prefix=\" \" and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\"/>\n    </names>\n  </macro>\n  <citation et-al-min=\"3\" et-al-use-first=\"1\" disambiguate-add-names=\"true\">\n    <layout delimiter=\"; \" suffix=\".\">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\", \">\n            <text term=\"ibid\"/>\n            <text variable=\"locator\" prefix=\" \"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <group delimiter=\", \">\n            <group delimiter=\" \">\n              <text macro=\"author-short\"/>\n              <text macro=\"year-date\"/>\n              <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n                <text term=\"note\"/>\n                <text variable=\"first-reference-note-number\"/>\n              </group>\n            </group>\n            <text variable=\"locator\"/>\n          </group>\n        </else-if>\n        <else>\n          <group delimiter=\", \">\n            <text macro=\"author\"/>\n            <choose>\n              <if match=\"any\" variable=\"container-title\">\n                <text variable=\"title\"/>\n                <group delimiter=\" \">\n                  <text term=\"in\" suffix=\": \"/>\n                  <choose>\n                    <if type=\"entry-encyclopedia\" match=\"any\">\n                      <group delimiter=\", \">\n                        <group delimiter=\" \">\n                          <text variable=\"container-title\" font-style=\"italic\"/>\n                          <text macro=\"collection-with-number\"/>\n                          <text macro=\"volume\"/>\n                        </group>\n                        <text macro=\"editor-encyclopedia\"/>\n                      </group>\n                    </if>\n                    <else>\n                      <text macro=\"editor\" suffix=\",\"/>\n                      <text variable=\"container-title\" font-style=\"italic\"/>\n                      <text macro=\"collection-with-number\"/>\n                      <text macro=\"volume\"/>\n                    </else>\n                  </choose>\n                </group>\n              </if>\n              <else>\n                <choose>\n                  <if type=\"entry-encyclopedia\" match=\"any\">\n                    <group delimiter=\" \">\n                      <text variable=\"title\" font-style=\"italic\"/>\n                      <text macro=\"collection-with-number\"/>\n                    </group>\n                    <text macro=\"editor-encyclopedia\"/>\n                  </if>\n                  <else-if match=\"any\" variable=\"translator\">\n                    <choose>\n                      <if match=\"none\" variable=\"author\">\n                        <names variable=\"editor\">\n                          <name and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\"/>\n                          <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n                        </names>\n                      </if>\n                    </choose>\n                    <group delimiter=\" \">\n                      <text variable=\"title\" font-style=\"italic\" suffix=\",\"/>\n                      <text macro=\"collection-with-number\"/>\n                    </group>\n                  </else-if>\n                  <else>\n                    <choose>\n                      <if match=\"none\" variable=\"author\">\n                        <names variable=\"editor\">\n                          <name and=\"text\" delimiter-precedes-et-al=\"never\" delimiter-precedes-last=\"never\"/>\n                          <label form=\"short\" prefix=\" (\" suffix=\")\"/>\n                        </names>\n                      </if>\n                    </choose>\n                    <group delimiter=\" \">\n                      <group delimiter=\", \">\n                        <text variable=\"title\" font-style=\"italic\"/>\n                        <text macro=\"translator\"/>\n                      </group>\n                      <text macro=\"collection-with-number\"/>\n                    </group>\n                  </else>\n                </choose>\n              </else>\n            </choose>\n            <choose>\n              <if type=\"thesis\">\n                <text variable=\"publisher\" prefix=\"Diss., \"/>\n              </if>\n            </choose>\n            <group delimiter=\" \">\n              <text variable=\"publisher-place\"/>\n              <group>\n                <text variable=\"edition\" vertical-align=\"sup\"/>\n                <text macro=\"year-date\"/>\n              </group>\n            </group>\n            <text variable=\"page\" prefix=\" \"/>\n            <text variable=\"locator\" prefix=\" \"/>\n          </group>\n        </else>\n      </choose>\n      <choose>\n        <if variable=\"URL\" match=\"any\">\n          <group>\n            <text variable=\"URL\" prefix=\", \"/>\n            <text term=\"accessed\" prefix=\" (\"/>\n            <date variable=\"accessed\" prefix=\" \" delimiter=\".\" suffix=\")\">\n              <date-part name=\"day\"/>\n              <date-part name=\"month\" form=\"numeric\"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </if>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography et-al-min=\"3\" et-al-use-first=\"1\" subsequent-author-substitute=\"&#8212;&#8212;&#8212;\" entry-spacing=\"0\" hanging-indent=\"true\">\n    <sort>\n      <key macro=\"author-bibliography\"/>\n      <key macro=\"year-date\"/>\n      <key variable=\"title\"/>\n    </sort>\n    <layout suffix=\".\">\n      <group delimiter=\", \">\n        <text macro=\"author-bibliography\"/>\n        <choose>\n          <if match=\"any\" variable=\"container-title\">\n            <text variable=\"title\"/>\n            <group delimiter=\" \">\n              <text term=\"in\" suffix=\": \"/>\n              <choose>\n                <if type=\"entry-encyclopedia\" match=\"any\">\n                  <group delimiter=\", \">\n                    <group delimiter=\" \">\n                      <text variable=\"container-title\" font-style=\"italic\"/>\n                      <text macro=\"collection-with-number\"/>\n                      <text macro=\"volume\"/>\n                    </group>\n                    <text macro=\"editor-encyclopedia\"/>\n                  </group>\n                </if>\n                <else>\n                  <text macro=\"editor\" suffix=\",\"/>\n                  <text variable=\"container-title\" font-style=\"italic\"/>\n                  <text macro=\"collection-with-number\"/>\n                  <text macro=\"volume\"/>\n                </else>\n              </choose>\n            </group>\n          </if>\n          <else>\n            <choose>\n              <if type=\"entry-encyclopedia\" match=\"any\">\n                <group delimiter=\" \">\n                  <text variable=\"title\" font-style=\"italic\"/>\n                  <text macro=\"collection-with-number\"/>\n                </group>\n                <text macro=\"editor-encyclopedia\"/>\n              </if>\n              <else>\n                <group delimiter=\" \">\n                  <group delimiter=\", \">\n                    <text variable=\"title\" font-style=\"italic\"/>\n                    <text macro=\"editor\"/>\n                  </group>\n                  <text macro=\"collection-with-number\"/>\n                </group>\n              </else>\n            </choose>\n          </else>\n        </choose>\n        <choose>\n          <if type=\"thesis\">\n            <text variable=\"publisher\" prefix=\"Diss., \"/>\n          </if>\n        </choose>\n        <group delimiter=\" \">\n          <text variable=\"publisher-place\"/>\n          <group>\n            <text variable=\"edition\" vertical-align=\"sup\"/>\n            <text macro=\"year-date\"/>\n          </group>\n        </group>\n        <text variable=\"page\" prefix=\" \"/>\n      </group>\n      <choose>\n        <if variable=\"URL\" match=\"any\">\n          <group>\n            <text variable=\"URL\" prefix=\", \"/>\n            <text term=\"accessed\" prefix=\" (\"/>\n            <date variable=\"accessed\" prefix=\" \" delimiter=\".\" suffix=\")\">\n              <date-part name=\"day\"/>\n              <date-part name=\"month\" form=\"numeric\"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </if>\n      </choose>\n    </layout>\n  </bibliography>\n</style>\n"
  },
  {
    "path": "test/creole-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header 1 ( \"\" , [] , [] ) [ Str \"Top-level heading (1)\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"This a test for creole 0.1 (2)\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"This is a Subheading (3)\" ]\n  , Header 4 ( \"\" , [] , [] ) [ Str \"Subsub (4)\" ]\n  , Header 5 ( \"\" , [] , [] ) [ Str \"Subsubsub (5)\" ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"ending\"\n      , Space\n      , Str \"equal\"\n      , Space\n      , Str \"signs\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"displayed:\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Top-level heading (1)\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"This a test for creole 0.1 (2)\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"This is a Subheading (3)\" ]\n  , Header 4 ( \"\" , [] , [] ) [ Str \"Subsub (4)\" ]\n  , Header 5 ( \"\" , [] , [] ) [ Str \"Subsubsub (5)\" ]\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"make\"\n      , Space\n      , Str \"things\"\n      , Space\n      , Strong [ Str \"bold\" ]\n      , Space\n      , Str \"or\"\n      , Space\n      , Emph [ Str \"italic\" ]\n      , Space\n      , Str \"or\"\n      , Space\n      , Strong [ Emph [ Str \"both\" ] ]\n      , Space\n      , Str \"or\"\n      , Space\n      , Emph [ Strong [ Str \"both\" ] ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Character\"\n      , Space\n      , Str \"formatting\"\n      , Space\n      , Str \"extends\"\n      , Space\n      , Str \"across\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"breaks:\"\n      , Space\n      , Strong\n          [ Str \"bold,\"\n          , Space\n          , Str \"this\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"still\"\n          , Space\n          , Str \"bold.\"\n          , Space\n          , Str \"This\"\n          , Space\n          , Str \"line\"\n          , Space\n          , Str \"deliberately\"\n          , Space\n          , Str \"does\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Str \"end\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"star-star.\"\n          ]\n      ]\n  , Para\n      [ Str \"Not\"\n      , Space\n      , Str \"bold.\"\n      , Space\n      , Str \"Character\"\n      , Space\n      , Str \"formatting\"\n      , Space\n      , Str \"does\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"cross\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"boundaries.\"\n      ]\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"internal links\" ]\n          ( \"internal links\" , \"\" )\n      , Space\n      , Str \"or\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"external links\" ]\n          ( \"http://www.wikicreole.org\" , \"\" )\n      , Str \",\"\n      , Space\n      , Str \"give\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"different\" ]\n          ( \"internal links\" , \"\" )\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"sentence:\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"wisdom\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"taken\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"Ward Cunningham's\" ]\n          ( \"Ward Cunningham's\" , \"\" )\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"Presentation at the Wikisym 06\" ]\n          ( \"http://www.c2.com/doc/wikisym/WikiSym2006.pdf\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"external\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"description:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.wikicreole.org\" ]\n          ( \"http://www.wikicreole.org\" , \"\" )\n      ]\n  , Para\n      [ Str \"Be\"\n      , Space\n      , Str \"careful\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"italic\"\n      , Space\n      , Str \"links\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"rendered\"\n      , Space\n      , Str \"properly:\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"My Book Title\" ]\n              ( \"http://my.book.example/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Free\"\n      , Space\n      , Str \"links\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"braces\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"rendered\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"well,\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.wikicreole.org/\" ]\n          ( \"http://www.wikicreole.org/\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.wikicreole.org/users/~example\" ]\n          ( \"http://www.wikicreole.org/users/~example\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Creole1.0\"\n      , Space\n      , Str \"specifies\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"http://bar\" ] ( \"http://bar\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"ftp://bar\" ] ( \"ftp://bar\" , \"\" )\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"render\"\n      , Space\n      , Str \"italic,\"\n      , Space\n      , Str \"something\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"foo:\"\n      , Emph\n          [ Str \"bar\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"render\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"italic.\"\n          ]\n      ]\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"draw\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"separate\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"page:\"\n      ]\n  , HorizontalRule\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"lists,\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"first\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"now,\"\n      , Space\n      , Str \"please...\"\n      ]\n  , Para\n      [ Str \"unnumbered\"\n      , Space\n      , Str \"lists\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"like\"\n      ]\n  , BulletList\n      [ [ Plain [ Str \"item\" , Space , Str \"a\" ] ]\n      , [ Plain [ Str \"item\" , Space , Str \"b\" ] ]\n      , [ Plain\n            [ Strong\n                [ Str \"bold\" , Space , Str \"item\" , Space , Str \"c\" ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"blank\"\n      , Space\n      , Str \"space\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"permitted\"\n      , Space\n      , Str \"before\"\n      , Space\n      , Str \"lists\"\n      , Space\n      , Str \"like:\"\n      ]\n  , BulletList\n      [ [ Plain [ Str \"item\" , Space , Str \"a\" ] ]\n      , [ Plain [ Str \"item\" , Space , Str \"b\" ] ]\n      , [ Plain [ Str \"item\" , Space , Str \"c\" ]\n        , BulletList\n            [ [ Plain [ Str \"item\" , Space , Str \"c.a\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"or\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"number\"\n      , Space\n      , Str \"them\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Link ( \"\" , [] , [] ) [ Str \"item 1\" ] ( \"item 1\" , \"\" ) ]\n        ]\n      , [ Plain [ Str \"item\" , Space , Str \"2\" ] ]\n      , [ Plain\n            [ Emph\n                [ Space\n                , Str \"italic\"\n                , Space\n                , Str \"item\"\n                , Space\n                , Str \"3\"\n                , Space\n                ]\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain [ Str \"item\" , Space , Str \"3.1\" ] ]\n            , [ Plain [ Str \"item\" , Space , Str \"3.2\" ] ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"up\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"five\"\n      , Space\n      , Str \"levels\"\n      ]\n  , BulletList\n      [ [ Plain [ Str \"1\" ]\n        , BulletList\n            [ [ Plain [ Str \"2\" ]\n              , BulletList\n                  [ [ Plain [ Str \"3\" ]\n                    , BulletList\n                        [ [ Plain [ Str \"4\" ]\n                          , BulletList [ [ Plain [ Str \"5\" ] ] ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"You\"\n            , Space\n            , Str \"can\"\n            , Space\n            , Str \"have\"\n            , Space\n            , Str \"multiline\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"second\"\n            , Space\n            , Str \"multiline\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"nowiki\"\n      , Space\n      , Str \"syntax\"\n      , Space\n      , Str \"if\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"would\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"do\"\n      , Space\n      , Str \"stuff\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"this:\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"Guitar Chord C:\\n\\n||---|---|---|\\n||-0-|---|---|\\n||---|---|---|\\n||---|-0-|---|\\n||---|---|-0-|\\n||---|---|---|\"\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"nowiki\"\n      , Space\n      , Code ( \"\" , [] , [] ) \" in a sentence \"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"this.\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Escapes\" ]\n  , Para\n      [ Str \"Normal\"\n      , Space\n      , Str \"Link:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://wikicreole.org/\" ]\n          ( \"http://wikicreole.org/\" , \"\" )\n      , Space\n      , Str \"-\"\n      , Space\n      , Str \"now\"\n      , Space\n      , Str \"same\"\n      , Space\n      , Str \"link,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"escaped:\"\n      , Space\n      , Str \"http://wikicreole.org/\"\n      ]\n  , Para\n      [ Str \"Normal\"\n      , Space\n      , Str \"asterisks:\"\n      , Space\n      , Str \"**not\"\n      , Space\n      , Str \"bold**\"\n      ]\n  , Para\n      [ Str \"a\"\n      , Space\n      , Str \"tilde\"\n      , Space\n      , Str \"alone:\"\n      , Space\n      , Str \"~\"\n      ]\n  , Para\n      [ Str \"a\"\n      , Space\n      , Str \"tilde\"\n      , Space\n      , Str \"escapes\"\n      , Space\n      , Str \"itself:\"\n      , Space\n      , Str \"~xxx\"\n      ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Creole 0.2\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"flower\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"ALT\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"\\\"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"flower\\\"\"\n      , Space\n      , Str \"if\"\n      , Space\n      , Str \"your\"\n      , Space\n      , Str \"wiki\"\n      , Space\n      , Str \"supports\"\n      , Space\n      , Str \"ALT\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"images:\"\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] )\n          [ Str \"here is a red flower\" ]\n          ( \"Red-Flower.jpg\" , \"\" )\n      ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Creole 0.4\" ]\n  , Para\n      [ Str \"Tables\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"done\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"this:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"header\" , Space , Str \"col1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"header\" , Space , Str \"col2\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"col1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"col2\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"you\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"can\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"also\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"align\" , LineBreak , Str \"it.\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"You\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"format\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"address\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"simply\"\n      , Space\n      , Str \"forcing\"\n      , Space\n      , Str \"linebreaks:\"\n      ]\n  , Para\n      [ Str \"My\"\n      , Space\n      , Str \"contact\"\n      , Space\n      , Str \"dates:\"\n      , LineBreak\n      , Str \"Pone:\"\n      , Space\n      , Str \"xyz\"\n      , LineBreak\n      , Str \"Fax:\"\n      , Space\n      , Str \"+45\"\n      , LineBreak\n      , Str \"Mobile:\"\n      , Space\n      , Str \"abc\"\n      ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Creole 0.5\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Header\" , Space , Str \"title\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain\n                     [ Str \"Another\"\n                     , Space\n                     , Str \"header\"\n                     , Space\n                     , Str \"title\"\n                     ]\n                 ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Code ( \"\" , [] , [] ) \" //not italic text// \" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Code ( \"\" , [] , [] ) \" **not bold text** \" ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Emph [ Str \"italic\" , Space , Str \"text\" ] ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Strong\n                          [ Space\n                          , Str \"bold\"\n                          , Space\n                          , Str \"text\"\n                          , Space\n                          ]\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Creole 1.0\" ]\n  , Para\n      [ Str \"If\"\n      , Space\n      , Str \"interwiki\"\n      , Space\n      , Str \"links\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"setup\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"your\"\n      , Space\n      , Str \"wiki,\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"links\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"WikiCreole\"\n      , Space\n      , Str \"page\"\n      , Space\n      , Str \"about\"\n      , Space\n      , Str \"Creole\"\n      , Space\n      , Str \"1.0\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"cases:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"WikiCreole:Creole1.0TestCases\" ]\n          ( \"WikiCreole:Creole1.0TestCases\" , \"\" )\n      , Str \".\"\n      ]\n  , HorizontalRule\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"above\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"document\"\n      , Space\n      , Str \"was\"\n      , Space\n      , Str \"found\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.wikicreole.org/wiki/Creole1.0TestCases\" ]\n          ( \"http://www.wikicreole.org/wiki/Creole1.0TestCases\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"downloaded\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt\"\n          ]\n          ( \"http://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt\"\n          , \"\"\n          )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"Creole\"\n      , Space\n      , Str \"Wiki\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"licensed:\"\n      , Space\n      , Str \"Copyright\"\n      , Space\n      , Str \"(C)\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"contributors.\"\n      , Space\n      , Str \"Some\"\n      , Space\n      , Str \"rights\"\n      , Space\n      , Str \"reserved,\"\n      , Space\n      , Str \"license\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"https://creativecommons.org/licenses/by-sa/1.0/\" ]\n          ( \"BY-SA\" , \"\" )\n      , Str \".\"\n      ]\n  ]\n"
  },
  {
    "path": "test/creole-reader.txt",
    "content": "= Top-level heading (1)\n== This a test for creole 0.1 (2)\n=== This is a Subheading (3)\n==== Subsub (4)\n===== Subsubsub (5)\n\nThe ending equal signs should not be displayed:\n\n= Top-level heading (1) =\n== This a test for creole 0.1 (2) ==\n=== This is a Subheading (3) ===\n==== Subsub (4) ====\n===== Subsubsub (5) =====\n\n\nYou can make things **bold** or //italic// or **//both//** or //**both**//.\n\nCharacter formatting extends across line breaks: **bold,\nthis is still bold. This line deliberately does not end in star-star.\n\nNot bold. Character formatting does not cross paragraph boundaries.\n\nYou can use [[internal links]] or [[http://www.wikicreole.org|external links]],\ngive the link a [[internal links|different]] name.\n\nHere's another sentence: This wisdom is taken from [[Ward Cunningham's]]\n[[http://www.c2.com/doc/wikisym/WikiSym2006.pdf|Presentation at the Wikisym 06]].\n\nHere's a external link without a description: [[http://www.wikicreole.org]]\n\nBe careful that italic links are rendered properly:  //[[http://my.book.example/|My Book Title]]// \n\nFree links without braces should be rendered as well, like http://www.wikicreole.org/ and http://www.wikicreole.org/users/~example. \n\nCreole1.0 specifies that http://bar and ftp://bar should not render italic,\nsomething like foo://bar should render as italic.\n\nYou can use this to draw a line to separate the page:\n----\n\nYou can use lists, start it at the first column for now, please...\n\nunnumbered lists are like\n* item a\n* item b\n* **bold item c**\n\nblank space is also permitted before lists like:\n  *   item a\n * item b\n* item c\n ** item c.a\n\nor you can number them\n# [[item 1]]\n# item 2\n# // italic item 3 //\n    ## item 3.1\n  ## item 3.2\n\nup to five levels\n* 1\n** 2\n*** 3\n**** 4\n***** 5\n\n* You can have\nmultiline list items\n* this is a second multiline\nlist item\n\nYou can use nowiki syntax if you would like do stuff like this:\n\n{{{\nGuitar Chord C:\n\n||---|---|---|\n||-0-|---|---|\n||---|---|---|\n||---|-0-|---|\n||---|---|-0-|\n||---|---|---|\n}}}\n\nYou can also use it inline nowiki {{{ in a sentence }}} like this.\n\n= Escapes =\nNormal Link: http://wikicreole.org/ - now same link, but escaped: ~http://wikicreole.org/ \n\nNormal asterisks: ~**not bold~**\n\na tilde alone: ~\n\na tilde escapes itself: ~~xxx\n\n=== Creole 0.2 ===\n\nThis should be a flower with the ALT text \"this is a flower\" if your wiki supports ALT text on images:\n\n{{Red-Flower.jpg|here is a red flower}}\n\n=== Creole 0.4 ===\n\nTables are done like this:\n\n|=header col1|=header col2| \n|col1|col2| \n|you         |can         | \n|also        |align\\\\ it. | \n\nYou can format an address by simply forcing linebreaks:\n\nMy contact dates:\\\\\nPone: xyz\\\\\nFax: +45\\\\\nMobile: abc\n\n=== Creole 0.5 ===\n\n|= Header title               |= Another header title     |\n| {{{ //not italic text// }}} | {{{ **not bold text** }}} |\n| //italic text//             | **  bold text **          |\n\n=== Creole 1.0 ===\n\nIf interwiki links are setup in your wiki, this links to the WikiCreole page about Creole 1.0 test cases: [[WikiCreole:Creole1.0TestCases]].\n\n  ----\n\nThe above test document was found on\nhttp://www.wikicreole.org/wiki/Creole1.0TestCases and downloaded from\nhttp://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt.\n\nThe Creole Wiki is licensed: Copyright (C) by the contributors. Some\nrights reserved, license\n[[BY-SA|https://creativecommons.org/licenses/by-sa/1.0/]].\n"
  },
  {
    "path": "test/djot-reader.djot",
    "content": "# Pandoc Test Suite\n\nJohn MacFarlane\nAnonymous\n\nJuly 17, 2006\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n* * * *\n\n{#headers}\n# Headers\n\n{#level-2-with-an-embedded-link}\n## Level 2 with an [embedded link](/url)\n\n{#level-3-with-emphasis}\n### Level 3 with _emphasis_\n\n{#level-4}\n#### Level 4\n\n{#level-5}\n##### Level 5\n\n{#level-1}\n# Level 1\n\n{#level-2-with-emphasis}\n## Level 2 with _emphasis_\n\n{#level-3}\n### Level 3\n\nwith no blank line\n\n{#level-2}\n## Level 2\n\nwith no blank line\n\n* * * *\n\n{#paragraphs}\n# Paragraphs\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. \\* criminey.\n\nThere should be a hard line break\\\nhere.\n\n* * * *\n\n{#block-quotes}\n# Block Quotes\n\nE-mail style:\n\n> This is a block quote. It is pretty short.\n\n> Code in a block quote:\n>\n> ```\n> sub status {\n>     print \"working\";\n> }\n> ```\n>\n> A list:\n>\n> 1. item one\n> 2. item two\n>\n> Nested block quotes:\n>\n> > nested\n>\n> > nested\n\nThis should not be a block quote: 2 \\> 1.\n\nAnd a following paragraph.\n\n* * * *\n\n{#code-blocks}\n# Code Blocks\n\nCode:\n\n```\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n```\n\nAnd:\n\n```\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n```\n\n* * * *\n\n{#lists}\n# Lists\n\n{#unordered}\n## Unordered\n\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\n{#ordered}\n## Ordered\n\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n\n2. Second\n\n3. Third\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\n   Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n2. Item 2.\n\n3. Item 3.\n\n{#nested}\n## Nested\n\n- Tab\n\n  - Tab\n\n    - Tab\n\nHere's another:\n\n1. First\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n\n3. Third\n\n{#tabs-and-spaces}\n## Tabs and spaces\n\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\n{#fancy-list-markers}\n## Fancy list markers\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v. more items\n\n       (A) a subsublist\n       (B) a subsublist\n\nNesting:\n\nA. Upper Alpha\n\n   I. Upper Roman.\n\n      (6) Decimal start with 6\n\n          c) Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n2. More.\n\n   1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n* * * *\n\n{#definition-lists}\n# Definition Lists\n\nTight using spaces:\n\n: apple\n\n  red fruit\n: orange\n\n  orange fruit\n: banana\n\n  yellow fruit\n\nTight using tabs:\n\n: apple\n\n  red fruit\n: orange\n\n  orange fruit\n: banana\n\n  yellow fruit\n\nLoose:\n\n: apple\n\n  red fruit\n\n: orange\n\n  orange fruit\n\n: banana\n\n  yellow fruit\n\nMultiple blocks with italics:\n\n: _apple_\n\n  red fruit\n\n  contains seeds, crisp, pleasant to taste\n\n: _orange_\n\n  orange fruit\n\n  ```\n  { orange code block }\n  ```\n\n  > orange block quote\n\nMultiple definitions, tight:\n\n: apple\n\n  red fruit\n\n  computer\n: orange\n\n  orange fruit\n\n  bank\n\nMultiple definitions, loose:\n\n: apple\n\n  red fruit\n\n  computer\n\n: orange\n\n  orange fruit\n\n  bank\n\nBlank line after term, indented marker, alternate markers:\n\n: apple\n\n  red fruit\n\n  computer\n\n: orange\n\n  orange fruit\n\n  1. sublist\n  2. sublist\n\n{#html-blocks}\n# HTML Blocks\n\nSimple block on one line:\n\n:::\nfoo\n\n:::\n\nAnd nested without indentation:\n\n::::::\n::::\n:::\nfoo\n\n:::\n\n::::\n\n:::\nbar\n\n:::\n\n::::::\n\nInterpreted markdown in a table:\n\nThis is _emphasized_\n\nAnd this is *strong*\n\nHere's a simple block:\n\n:::\nfoo\n\n:::\n\nThis should be a code block, though:\n\n```\n<div>\n    foo\n</div>\n```\n\nAs should this:\n\n```\n<div>foo</div>\n```\n\nNow, nested:\n\n:::::\n::::\n:::\nfoo\n\n:::\n\n::::\n\n:::::\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n```\n<!-- Comment -->\n```\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n```\n<hr />\n```\n\nHr's:\n\n* * * *\n\n{#inline-markup}\n# Inline Markup\n\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _[emphasized link](/url)_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n{-This is _strikeout_.-}\n\nSuperscripts: a^bc^d a^_hello_^ a^hello there^.\n\nSubscripts: H~2~O, H~23~O, H~many of them~O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na\\^b c\\^d, a\\~b c\\~d.\n\n* * * *\n\n{#smart-quotes-ellipses-dashes}\n# Smart quotes, ellipses, dashes\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted '`code`' and a \"[quoted\nlink](http://example.com/?foo=1&bar=2)\".\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses...and...and....\n\n* * * *\n\n{#latex}\n# LaTeX\n\n- \n- $`2+2=4`\n- $`x \\in y`\n- $`\\alpha \\wedge \\omega`\n- $`223`\n- $`p`-Tree\n- Here's some display math:\n  $$`\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}`\n- Here's one that has a line break in it: $`\\alpha + \\omega \\times x^2`.\n\nThese shouldn't be math:\n\n- To get the famous equation, write `$e = mc^2$`.\n- $22,000 is a _lot_ of money. So is $34,000. (It worked if \"lot\" is\n  emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped `$`\\: $73 _this should be emphasized_ 23$.\n\nHere's a LaTeX table:\n\n* * * *\n\n{#special-characters}\n# Special Characters\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 \\< 5.\n\n6 \\> 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: \\>\n\nHash: #\n\nPeriod: .\n\nBang: \\!\n\nPlus: +\n\nMinus: -\n\n* * * *\n\n{#links}\n# Links\n\n{#explicit}\n## Explicit\n\nJust a [URL](/url/).\n\n[URL and title](/url/){title=\"title\"}.\n\n[URL and title](/url/){title=\"title preceded by two spaces\"}.\n\n[URL and title](/url/){title=\"title preceded by a tab\"}.\n\n[URL and title](/url/){title=\"title with \\\"quotes\\\" in it\"}\n\n[URL and title](/url/){title=\"title with single quotes\"}\n\n[with\\_underscore](/url/with_underscore)\n\n[Email link](mailto:nobody@nowhere.net)\n\n[Empty]().\n\n{#reference}\n## Reference\n\nFoo [bar](/url/).\n\nWith [embedded \\[brackets\\]](/url/).\n\n[b](/url/) by itself should be a link.\n\nIndented [once](/url).\n\nIndented [twice](/url).\n\nIndented [thrice](/url).\n\nThis should \\[not\\]\\[\\] be a link.\n\n```\n[not]: /url\n```\n\nFoo [bar](/url/){title=\"Title with \\\"quotes\\\" inside\"}.\n\nFoo [biz](/url/){title=\"Title with \\\"quote\\\" inside\"}.\n\n{#with-ampersands}\n## With ampersands\n\nHere's a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).\n\nHere's a link with an amersand in the link text:\n[AT&T](http://att.com/){title=\"AT&T\"}.\n\nHere's an [inline link](/script?foo=1&bar=2).\n\nHere's an [inline link in pointy braces](/script?foo=1&bar=2).\n\n{#autolinks}\n## Autolinks\n\nWith an ampersand: <http://example.com/?foo=1&bar=2>\n\n- In a list?\n- <http://example.com/>\n- It should.\n\nAn e-mail address: <nobody@nowhere.net>\n\n> Blockquoted: <http://example.com/>\n\nAuto-links should not occur here: `<http://example.com/>`\n\n```\nor here: <http://example.com/>\n```\n\n* * * *\n\n{#images}\n# Images\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n::::\n![lalune](lalune.jpg){title=\"Voyage dans la Lune\"}\n\n{.caption}\n:::\nlalune\n\n:::\n\n::::\n\nHere is a movie ![movie](movie.jpg) icon.\n\n* * * *\n\n{#footnotes}\n# Footnotes\n\nHere is a footnote reference,[^1] and another.[^2] This should _not_ be a\nfootnote reference, because it contains a space.\\[\\^my note\\] Here is an inline\nnote.[^3]\n\n> Notes can go in quotes.[^4]\n\n1. And in list items.[^5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[^1]: Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.\n\n[^2]: Here's the long note. This one contains multiple blocks.\n\n    Subsequent blocks are indented to show that they belong to the footnote (as\n    with list items).\n\n    ```\n      { <code> }\n    ```\n\n    If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.\n\n[^3]: This is _easier_ to type. Inline notes may contain\n    [links](http://google.com) and `]` verbatim characters, as well as\n    \\[bracketed text\\].\n\n[^4]: In quote.\n\n[^5]: In list.\n"
  },
  {
    "path": "test/djot-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Div\n      ( \"Pandoc-Test-Suite\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"Pandoc\" , Space , Str \"Test\" , Space , Str \"Suite\" ]\n      , Para\n          [ Str \"John\"\n          , Space\n          , Str \"MacFarlane\"\n          , SoftBreak\n          , Str \"Anonymous\"\n          ]\n      , Para\n          [ Str \"July\" , Space , Str \"17,\" , Space , Str \"2006\" ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"set\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"tests\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"pandoc.\"\n          , Space\n          , Str \"Most\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"them\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"adapted\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Str \"John\"\n          , Space\n          , Str \"Gruber\\8217s\"\n          , SoftBreak\n          , Str \"markdown\"\n          , Space\n          , Str \"test\"\n          , Space\n          , Str \"suite.\"\n          ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"headers\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"Headers\" ]\n      , Div\n          ( \"level-2-with-an-embedded-link\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"Level\"\n              , Space\n              , Str \"2\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"embedded\" , Space , Str \"link\" ]\n                  ( \"/url\" , \"\" )\n              ]\n          , Div\n              ( \"level-3-with-emphasis\" , [ \"section\" ] , [] )\n              [ Header\n                  3\n                  ( \"\" , [] , [] )\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"3\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Emph [ Str \"emphasis\" ]\n                  ]\n              , Div\n                  ( \"level-4\" , [ \"section\" ] , [] )\n                  [ Header\n                      4\n                      ( \"\" , [] , [] )\n                      [ Str \"Level\" , Space , Str \"4\" ]\n                  , Div\n                      ( \"level-5\" , [ \"section\" ] , [] )\n                      [ Header\n                          5\n                          ( \"\" , [] , [] )\n                          [ Str \"Level\" , Space , Str \"5\" ]\n                      ]\n                  ]\n              ]\n          ]\n      ]\n  , Div\n      ( \"level-1\" , [ \"section\" ] , [] )\n      [ Header\n          1 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n      , Div\n          ( \"level-2-with-emphasis\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"Level\"\n              , Space\n              , Str \"2\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Emph [ Str \"emphasis\" ]\n              ]\n          , Div\n              ( \"level-3\" , [ \"section\" ] , [] )\n              [ Header\n                  3 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n              , Para\n                  [ Str \"with\"\n                  , Space\n                  , Str \"no\"\n                  , Space\n                  , Str \"blank\"\n                  , Space\n                  , Str \"line\"\n                  ]\n              ]\n          ]\n      , Div\n          ( \"level-2\" , [ \"section\" ] , [] )\n          [ Header\n              2 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n          , Para\n              [ Str \"with\"\n              , Space\n              , Str \"no\"\n              , Space\n              , Str \"blank\"\n              , Space\n              , Str \"line\"\n              ]\n          , HorizontalRule\n          ]\n      ]\n  , Div\n      ( \"paragraphs\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"Paragraphs\" ]\n      , Para\n          [ Str \"Here\\8217s\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"regular\"\n          , Space\n          , Str \"paragraph.\"\n          ]\n      , Para\n          [ Str \"In\"\n          , Space\n          , Str \"Markdown\"\n          , Space\n          , Str \"1.0.0\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"earlier.\"\n          , Space\n          , Str \"Version\"\n          , Space\n          , Str \"8.\"\n          , Space\n          , Str \"This\"\n          , Space\n          , Str \"line\"\n          , Space\n          , Str \"turns\"\n          , Space\n          , Str \"into\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"list\"\n          , Space\n          , Str \"item.\"\n          , SoftBreak\n          , Str \"Because\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"hard-wrapped\"\n          , Space\n          , Str \"line\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"middle\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"paragraph\"\n          , Space\n          , Str \"looked\"\n          , Space\n          , Str \"like\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"list\"\n          , SoftBreak\n          , Str \"item.\"\n          ]\n      , Para\n          [ Str \"Here\\8217s\"\n          , Space\n          , Str \"one\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"bullet.\"\n          , Space\n          , Str \"*\"\n          , Space\n          , Str \"criminey.\"\n          ]\n      , Para\n          [ Str \"There\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"hard\"\n          , Space\n          , Str \"line\"\n          , Space\n          , Str \"break\"\n          , LineBreak\n          , Str \"here.\"\n          ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"block-quotes\" , [ \"section\" ] , [] )\n      [ Header\n          1 ( \"\" , [] , [] ) [ Str \"Block\" , Space , Str \"Quotes\" ]\n      , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n      , BlockQuote\n          [ Para\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"block\"\n              , Space\n              , Str \"quote.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"pretty\"\n              , Space\n              , Str \"short.\"\n              ]\n          ]\n      , BlockQuote\n          [ Para\n              [ Str \"Code\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"block\"\n              , Space\n              , Str \"quote:\"\n              ]\n          , CodeBlock\n              ( \"\" , [ \"\" ] , [] )\n              \"sub status {\\n    print \\\"working\\\";\\n}\\n\"\n          , Para [ Str \"A\" , Space , Str \"list:\" ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Plain [ Str \"item\" , Space , Str \"one\" ] ]\n              , [ Plain [ Str \"item\" , Space , Str \"two\" ] ]\n              ]\n          , Para\n              [ Str \"Nested\"\n              , Space\n              , Str \"block\"\n              , Space\n              , Str \"quotes:\"\n              ]\n          , BlockQuote [ Para [ Str \"nested\" ] ]\n          , BlockQuote [ Para [ Str \"nested\" ] ]\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          , Space\n          , Str \"2\"\n          , Space\n          , Str \">\"\n          , Space\n          , Str \"1.\"\n          ]\n      , Para\n          [ Str \"And\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"following\"\n          , Space\n          , Str \"paragraph.\"\n          ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"code-blocks\" , [ \"section\" ] , [] )\n      [ Header\n          1 ( \"\" , [] , [] ) [ Str \"Code\" , Space , Str \"Blocks\" ]\n      , Para [ Str \"Code:\" ]\n      , CodeBlock\n          ( \"\" , [ \"\" ] , [] )\n          \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\\n\"\n      , Para [ Str \"And:\" ]\n      , CodeBlock\n          ( \"\" , [ \"\" ] , [] )\n          \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\\n\"\n      , HorizontalRule\n      ]\n  , Div\n      ( \"lists\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"Lists\" ]\n      , Div\n          ( \"unordered\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Unordered\" ]\n          , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n          , BulletList\n              [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n              , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n              , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n              ]\n          , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n          , BulletList\n              [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n              , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n              , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n              ]\n          , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n          , BulletList\n              [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n              , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n              , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n              ]\n          , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n          , BulletList\n              [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n              , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n              , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n              ]\n          , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n          , BulletList\n              [ [ Plain [ Str \"Minus\" , Space , Str \"1\" ] ]\n              , [ Plain [ Str \"Minus\" , Space , Str \"2\" ] ]\n              , [ Plain [ Str \"Minus\" , Space , Str \"3\" ] ]\n              ]\n          , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n          , BulletList\n              [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n              , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n              , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n              ]\n          ]\n      , Div\n          ( \"ordered\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Ordered\" ]\n          , Para [ Str \"Tight:\" ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Plain [ Str \"First\" ] ]\n              , [ Plain [ Str \"Second\" ] ]\n              , [ Plain [ Str \"Third\" ] ]\n              ]\n          , Para [ Str \"and:\" ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Plain [ Str \"One\" ] ]\n              , [ Plain [ Str \"Two\" ] ]\n              , [ Plain [ Str \"Three\" ] ]\n              ]\n          , Para\n              [ Str \"Loose\"\n              , Space\n              , Str \"using\"\n              , Space\n              , Str \"tabs:\"\n              ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Para [ Str \"First\" ] ]\n              , [ Para [ Str \"Second\" ] ]\n              , [ Para [ Str \"Third\" ] ]\n              ]\n          , Para\n              [ Str \"and\"\n              , Space\n              , Str \"using\"\n              , Space\n              , Str \"spaces:\"\n              ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Para [ Str \"One\" ] ]\n              , [ Para [ Str \"Two\" ] ]\n              , [ Para [ Str \"Three\" ] ]\n              ]\n          , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Para\n                    [ Str \"Item\"\n                    , Space\n                    , Str \"1,\"\n                    , Space\n                    , Str \"graf\"\n                    , Space\n                    , Str \"one.\"\n                    ]\n                , Para\n                    [ Str \"Item\"\n                    , Space\n                    , Str \"1.\"\n                    , Space\n                    , Str \"graf\"\n                    , Space\n                    , Str \"two.\"\n                    , Space\n                    , Str \"The\"\n                    , Space\n                    , Str \"quick\"\n                    , Space\n                    , Str \"brown\"\n                    , Space\n                    , Str \"fox\"\n                    , Space\n                    , Str \"jumped\"\n                    , Space\n                    , Str \"over\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"lazy\"\n                    , Space\n                    , Str \"dog\\8217s\"\n                    , Space\n                    , Str \"back.\"\n                    ]\n                ]\n              , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n              , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n              ]\n          ]\n      , Div\n          ( \"nested\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Nested\" ]\n          , BulletList\n              [ [ Plain [ Str \"Tab\" ]\n                , BulletList\n                    [ [ Plain [ Str \"Tab\" ]\n                      , BulletList [ [ Plain [ Str \"Tab\" ] ] ]\n                      ]\n                    ]\n                ]\n              ]\n          , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Plain [ Str \"First\" ] ]\n              , [ Plain [ Str \"Second:\" ]\n                , BulletList\n                    [ [ Plain [ Str \"Fee\" ] ]\n                    , [ Plain [ Str \"Fie\" ] ]\n                    , [ Plain [ Str \"Foe\" ] ]\n                    ]\n                ]\n              , [ Plain [ Str \"Third\" ] ]\n              ]\n          , Para\n              [ Str \"Same\"\n              , Space\n              , Str \"thing\"\n              , Space\n              , Str \"but\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"paragraphs:\"\n              ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Para [ Str \"First\" ] ]\n              , [ Para [ Str \"Second:\" ]\n                , BulletList\n                    [ [ Plain [ Str \"Fee\" ] ]\n                    , [ Plain [ Str \"Fie\" ] ]\n                    , [ Plain [ Str \"Foe\" ] ]\n                    ]\n                ]\n              , [ Para [ Str \"Third\" ] ]\n              ]\n          ]\n      , Div\n          ( \"tabs-and-spaces\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n          , BulletList\n              [ [ Para\n                    [ Str \"this\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"list\"\n                    , Space\n                    , Str \"item\"\n                    , Space\n                    , Str \"indented\"\n                    , Space\n                    , Str \"with\"\n                    , Space\n                    , Str \"tabs\"\n                    ]\n                ]\n              , [ Para\n                    [ Str \"this\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"list\"\n                    , Space\n                    , Str \"item\"\n                    , Space\n                    , Str \"indented\"\n                    , Space\n                    , Str \"with\"\n                    , Space\n                    , Str \"spaces\"\n                    ]\n                , BulletList\n                    [ [ Para\n                          [ Str \"this\"\n                          , Space\n                          , Str \"is\"\n                          , Space\n                          , Str \"an\"\n                          , Space\n                          , Str \"example\"\n                          , Space\n                          , Str \"list\"\n                          , Space\n                          , Str \"item\"\n                          , Space\n                          , Str \"indented\"\n                          , Space\n                          , Str \"with\"\n                          , Space\n                          , Str \"tabs\"\n                          ]\n                      ]\n                    , [ Para\n                          [ Str \"this\"\n                          , Space\n                          , Str \"is\"\n                          , Space\n                          , Str \"an\"\n                          , Space\n                          , Str \"example\"\n                          , Space\n                          , Str \"list\"\n                          , Space\n                          , Str \"item\"\n                          , Space\n                          , Str \"indented\"\n                          , Space\n                          , Str \"with\"\n                          , Space\n                          , Str \"spaces\"\n                          ]\n                      ]\n                    ]\n                ]\n              ]\n          ]\n      , Div\n          ( \"fancy-list-markers\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"Fancy\"\n              , Space\n              , Str \"list\"\n              , Space\n              , Str \"markers\"\n              ]\n          , OrderedList\n              ( 2 , Decimal , TwoParens )\n              [ [ Para\n                    [ Str \"begins\"\n                    , Space\n                    , Str \"with\"\n                    , Space\n                    , Str \"2\"\n                    ]\n                ]\n              , [ Para\n                    [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n                , Para\n                    [ Str \"with\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"continuation\"\n                    ]\n                , OrderedList\n                    ( 4 , LowerRoman , Period )\n                    [ [ Plain\n                          [ Str \"sublist\"\n                          , Space\n                          , Str \"with\"\n                          , Space\n                          , Str \"roman\"\n                          , Space\n                          , Str \"numerals,\"\n                          , Space\n                          , Str \"starting\"\n                          , Space\n                          , Str \"with\"\n                          , Space\n                          , Str \"4\"\n                          ]\n                      ]\n                    , [ Plain [ Str \"more\" , Space , Str \"items\" ]\n                      , OrderedList\n                          ( 1 , UpperAlpha , TwoParens )\n                          [ [ Plain\n                                [ Str \"a\" , Space , Str \"subsublist\" ]\n                            ]\n                          , [ Plain\n                                [ Str \"a\" , Space , Str \"subsublist\" ]\n                            ]\n                          ]\n                      ]\n                    ]\n                ]\n              ]\n          , Para [ Str \"Nesting:\" ]\n          , OrderedList\n              ( 1 , UpperAlpha , Period )\n              [ [ Plain [ Str \"Upper\" , Space , Str \"Alpha\" ]\n                , OrderedList\n                    ( 1 , UpperRoman , Period )\n                    [ [ Plain [ Str \"Upper\" , Space , Str \"Roman.\" ]\n                      , OrderedList\n                          ( 6 , Decimal , TwoParens )\n                          [ [ Plain\n                                [ Str \"Decimal\"\n                                , Space\n                                , Str \"start\"\n                                , Space\n                                , Str \"with\"\n                                , Space\n                                , Str \"6\"\n                                ]\n                            , OrderedList\n                                ( 3 , LowerAlpha , OneParen )\n                                [ [ Plain\n                                      [ Str \"Lower\"\n                                      , Space\n                                      , Str \"alpha\"\n                                      , Space\n                                      , Str \"with\"\n                                      , Space\n                                      , Str \"paren\"\n                                      ]\n                                  ]\n                                ]\n                            ]\n                          ]\n                      ]\n                    ]\n                ]\n              ]\n          , Para [ Str \"Autonumbering:\" ]\n          , OrderedList\n              ( 1 , Decimal , Period )\n              [ [ Plain [ Str \"Autonumber.\" ] ]\n              , [ Plain [ Str \"More.\" ]\n                , OrderedList\n                    ( 1 , Decimal , Period )\n                    [ [ Plain [ Str \"Nested.\" ] ] ]\n                ]\n              ]\n          , Para\n              [ Str \"Should\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"list\"\n              , Space\n              , Str \"item:\"\n              ]\n          , Para [ Str \"M.A.\\160\\&2007\" ]\n          , OrderedList\n              ( 2 , UpperAlpha , Period )\n              [ [ Plain [ Str \"Williams\" ] ] ]\n          , HorizontalRule\n          ]\n      ]\n  , Div\n      ( \"definition-lists\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"Definition\" , Space , Str \"Lists\" ]\n      , Para\n          [ Str \"Tight\"\n          , Space\n          , Str \"using\"\n          , Space\n          , Str \"spaces:\"\n          ]\n      , DefinitionList\n          [ ( [ Str \"apple\" ]\n            , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n            )\n          , ( [ Str \"orange\" ]\n            , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n            )\n          , ( [ Str \"banana\" ]\n            , [ [ Plain [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n            )\n          ]\n      , Para\n          [ Str \"Tight\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n      , DefinitionList\n          [ ( [ Str \"apple\" ]\n            , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n            )\n          , ( [ Str \"orange\" ]\n            , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n            )\n          , ( [ Str \"banana\" ]\n            , [ [ Plain [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n            )\n          ]\n      , Para [ Str \"Loose:\" ]\n      , DefinitionList\n          [ ( [ Str \"apple\" ]\n            , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n            )\n          , ( [ Str \"orange\" ]\n            , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n            )\n          , ( [ Str \"banana\" ]\n            , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n            )\n          ]\n      , Para\n          [ Str \"Multiple\"\n          , Space\n          , Str \"blocks\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"italics:\"\n          ]\n      , DefinitionList\n          [ ( [ Emph [ Str \"apple\" ] ]\n            , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n                , Para\n                    [ Str \"contains\"\n                    , Space\n                    , Str \"seeds,\"\n                    , Space\n                    , Str \"crisp,\"\n                    , Space\n                    , Str \"pleasant\"\n                    , Space\n                    , Str \"to\"\n                    , Space\n                    , Str \"taste\"\n                    ]\n                ]\n              ]\n            )\n          , ( [ Emph [ Str \"orange\" ] ]\n            , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n                , CodeBlock\n                    ( \"\" , [ \"\" ] , [] ) \"{ orange code block }\\n\"\n                , BlockQuote\n                    [ Para\n                        [ Str \"orange\"\n                        , Space\n                        , Str \"block\"\n                        , Space\n                        , Str \"quote\"\n                        ]\n                    ]\n                ]\n              ]\n            )\n          ]\n      , Para\n          [ Str \"Multiple\"\n          , Space\n          , Str \"definitions,\"\n          , Space\n          , Str \"tight:\"\n          ]\n      , DefinitionList\n          [ ( [ Str \"apple\" ]\n            , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n                , Para [ Str \"computer\" ]\n                ]\n              ]\n            )\n          , ( [ Str \"orange\" ]\n            , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n                , Para [ Str \"bank\" ]\n                ]\n              ]\n            )\n          ]\n      , Para\n          [ Str \"Multiple\"\n          , Space\n          , Str \"definitions,\"\n          , Space\n          , Str \"loose:\"\n          ]\n      , DefinitionList\n          [ ( [ Str \"apple\" ]\n            , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n                , Para [ Str \"computer\" ]\n                ]\n              ]\n            )\n          , ( [ Str \"orange\" ]\n            , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n                , Para [ Str \"bank\" ]\n                ]\n              ]\n            )\n          ]\n      , Para\n          [ Str \"Blank\"\n          , Space\n          , Str \"line\"\n          , Space\n          , Str \"after\"\n          , Space\n          , Str \"term,\"\n          , Space\n          , Str \"indented\"\n          , Space\n          , Str \"marker,\"\n          , Space\n          , Str \"alternate\"\n          , Space\n          , Str \"markers:\"\n          ]\n      , DefinitionList\n          [ ( [ Str \"apple\" ]\n            , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n                , Para [ Str \"computer\" ]\n                ]\n              ]\n            )\n          , ( [ Str \"orange\" ]\n            , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n                , OrderedList\n                    ( 1 , Decimal , Period )\n                    [ [ Plain [ Str \"sublist\" ] ]\n                    , [ Plain [ Str \"sublist\" ] ]\n                    ]\n                ]\n              ]\n            )\n          ]\n      ]\n  , Div\n      ( \"html-blocks\" , [ \"section\" ] , [] )\n      [ Header\n          1 ( \"\" , [] , [] ) [ Str \"HTML\" , Space , Str \"Blocks\" ]\n      , Para\n          [ Str \"Simple\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"one\"\n          , Space\n          , Str \"line:\"\n          ]\n      , Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ]\n      , Para\n          [ Str \"And\"\n          , Space\n          , Str \"nested\"\n          , Space\n          , Str \"without\"\n          , Space\n          , Str \"indentation:\"\n          ]\n      , Div\n          ( \"\" , [] , [] )\n          [ Div\n              ( \"\" , [] , [] )\n              [ Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ] ]\n          , Div ( \"\" , [] , [] ) [ Para [ Str \"bar\" ] ]\n          ]\n      , Para\n          [ Str \"Interpreted\"\n          , Space\n          , Str \"markdown\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"table:\"\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"emphasized\" ]\n          ]\n      , Para\n          [ Str \"And\"\n          , Space\n          , Str \"this\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Strong [ Str \"strong\" ]\n          ]\n      , Para\n          [ Str \"Here\\8217s\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"simple\"\n          , Space\n          , Str \"block:\"\n          ]\n      , Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"code\"\n          , Space\n          , Str \"block,\"\n          , Space\n          , Str \"though:\"\n          ]\n      , CodeBlock ( \"\" , [ \"\" ] , [] ) \"<div>\\n    foo\\n</div>\\n\"\n      , Para\n          [ Str \"As\" , Space , Str \"should\" , Space , Str \"this:\" ]\n      , CodeBlock ( \"\" , [ \"\" ] , [] ) \"<div>foo</div>\\n\"\n      , Para [ Str \"Now,\" , Space , Str \"nested:\" ]\n      , Div\n          ( \"\" , [] , [] )\n          [ Div\n              ( \"\" , [] , [] )\n              [ Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ] ]\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"just\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"HTML\"\n          , Space\n          , Str \"comment:\"\n          ]\n      , Para [ Str \"Multiline:\" ]\n      , Para [ Str \"Code\" , Space , Str \"block:\" ]\n      , CodeBlock ( \"\" , [ \"\" ] , [] ) \"<!-- Comment -->\\n\"\n      , Para\n          [ Str \"Just\"\n          , Space\n          , Str \"plain\"\n          , Space\n          , Str \"comment,\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"trailing\"\n          , Space\n          , Str \"spaces\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"line:\"\n          ]\n      , Para [ Str \"Code:\" ]\n      , CodeBlock ( \"\" , [ \"\" ] , [] ) \"<hr />\\n\"\n      , Para [ Str \"Hr\\8217s:\" ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"inline-markup\" , [ \"section\" ] , [] )\n      [ Header\n          1 ( \"\" , [] , [] ) [ Str \"Inline\" , Space , Str \"Markup\" ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"emphasized\" ]\n          , Str \",\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"so\"\n          , Space\n          , Emph [ Str \"is\" , Space , Str \"this\" ]\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Strong [ Str \"strong\" ]\n          , Str \",\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"so\"\n          , Space\n          , Strong [ Str \"is\" , Space , Str \"this\" ]\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"An\"\n          , Space\n          , Emph\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"emphasized\" , Space , Str \"link\" ]\n                  ( \"/url\" , \"\" )\n              ]\n          , Str \".\"\n          ]\n      , Para\n          [ Strong\n              [ Emph\n                  [ Str \"This\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"strong\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"em.\"\n                  ]\n              ]\n          ]\n      , Para\n          [ Str \"So\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Strong [ Emph [ Str \"this\" ] ]\n          , Space\n          , Str \"word.\"\n          ]\n      , Para\n          [ Strong\n              [ Emph\n                  [ Str \"This\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"strong\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"em.\"\n                  ]\n              ]\n          ]\n      , Para\n          [ Str \"So\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Strong [ Emph [ Str \"this\" ] ]\n          , Space\n          , Str \"word.\"\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"code:\"\n          , Space\n          , Code ( \"\" , [] , [] ) \">\"\n          , Str \",\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"$\"\n          , Str \",\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"\\\\`, \"\n          , Str \"$\"\n          , Code ( \"\" , [] , [] ) \", \"\n          , Str \"<html>\"\n          , Code ( \"\" , [] , [] ) \".\"\n          ]\n      , Para\n          [ Span\n              ( \"\" , [ \"deleted\" ] , [] )\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Emph [ Str \"strikeout\" ]\n              , Str \".\"\n              ]\n          ]\n      , Para\n          [ Str \"Superscripts:\"\n          , Space\n          , Str \"a\"\n          , Superscript [ Str \"bc\" ]\n          , Str \"d\"\n          , Space\n          , Str \"a\"\n          , Superscript [ Emph [ Str \"hello\" ] ]\n          , Space\n          , Str \"a\"\n          , Superscript [ Str \"hello\\160there\" ]\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"Subscripts:\"\n          , Space\n          , Str \"H\"\n          , Subscript [ Str \"2\" ]\n          , Str \"O,\"\n          , Space\n          , Str \"H\"\n          , Subscript [ Str \"23\" ]\n          , Str \"O,\"\n          , Space\n          , Str \"H\"\n          , Subscript [ Str \"many\\160of\\160them\" ]\n          , Str \"O.\"\n          ]\n      , Para\n          [ Str \"These\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"superscripts\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Str \"subscripts,\"\n          , Space\n          , Str \"because\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"unescaped\"\n          , Space\n          , Str \"spaces:\"\n          , SoftBreak\n          , Str \"a^b\"\n          , Space\n          , Str \"c^d,\"\n          , Space\n          , Str \"a~b\"\n          , Space\n          , Str \"c~d.\"\n          ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"smart-quotes-ellipses-dashes\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"Smart\"\n          , Space\n          , Str \"quotes,\"\n          , Space\n          , Str \"ellipses,\"\n          , Space\n          , Str \"dashes\"\n          ]\n      , Para\n          [ Quoted DoubleQuote [ Str \"Hello,\" ]\n          , Space\n          , Str \"said\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"spider.\"\n          , Space\n          , Quoted\n              DoubleQuote\n              [ Quoted SingleQuote [ Str \"Shelob\" ]\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"my\"\n              , Space\n              , Str \"name.\"\n              ]\n          ]\n      , Para\n          [ Quoted SingleQuote [ Str \"A\" ]\n          , Str \",\"\n          , Space\n          , Quoted SingleQuote [ Str \"B\" ]\n          , Str \",\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Quoted SingleQuote [ Str \"C\" ]\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"letters.\"\n          ]\n      , Para\n          [ Quoted SingleQuote [ Str \"Oak,\" ]\n          , Space\n          , Quoted SingleQuote [ Str \"elm,\" ]\n          , Space\n          , Str \"and\"\n          , Space\n          , Quoted SingleQuote [ Str \"beech\" ]\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"names\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"trees.\"\n          , Space\n          , Str \"So\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Quoted SingleQuote [ Str \"pine.\" ]\n          ]\n      , Para\n          [ Quoted\n              SingleQuote\n              [ Str \"He\"\n              , Space\n              , Str \"said,\"\n              , Space\n              , Quoted\n                  DoubleQuote\n                  [ Str \"I\"\n                  , Space\n                  , Str \"want\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Str \"go.\"\n                  ]\n              ]\n          , Space\n          , Str \"Were\"\n          , Space\n          , Str \"you\"\n          , Space\n          , Str \"alive\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"70\\8217s?\"\n          ]\n      , Para\n          [ Str \"Here\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"some\"\n          , Space\n          , Str \"quoted\"\n          , Space\n          , Quoted SingleQuote [ Code ( \"\" , [] , [] ) \"code\" ]\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Quoted\n              DoubleQuote\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"quoted\" , SoftBreak , Str \"link\" ]\n                  ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n              ]\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"Some\"\n          , Space\n          , Str \"dashes:\"\n          , Space\n          , Str \"one\\8212two\"\n          , Space\n          , Str \"\\8212\"\n          , Space\n          , Str \"three\\8212four\"\n          , Space\n          , Str \"\\8212\"\n          , Space\n          , Str \"five.\"\n          ]\n      , Para\n          [ Str \"Dashes\"\n          , Space\n          , Str \"between\"\n          , Space\n          , Str \"numbers:\"\n          , Space\n          , Str \"5\\8211\\&7,\"\n          , Space\n          , Str \"255\\8211\\&66,\"\n          , Space\n          , Str \"1987\\8211\\&1999.\"\n          ]\n      , Para [ Str \"Ellipses\\8230and\\8230and\\8230.\" ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"latex\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"LaTeX\" ]\n      , BulletList\n          [ []\n          , [ Plain [ Math InlineMath \"2+2=4\" ] ]\n          , [ Plain [ Math InlineMath \"x \\\\in y\" ] ]\n          , [ Plain [ Math InlineMath \"\\\\alpha \\\\wedge \\\\omega\" ] ]\n          , [ Plain [ Math InlineMath \"223\" ] ]\n          , [ Plain [ Math InlineMath \"p\" , Str \"-Tree\" ] ]\n          , [ Plain\n                [ Str \"Here\\8217s\"\n                , Space\n                , Str \"some\"\n                , Space\n                , Str \"display\"\n                , Space\n                , Str \"math:\"\n                , SoftBreak\n                , Math\n                    DisplayMath\n                    \"\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to 0}\\\\frac{f(x+h)-f(x)}{h}\"\n                ]\n            ]\n          , [ Plain\n                [ Str \"Here\\8217s\"\n                , Space\n                , Str \"one\"\n                , Space\n                , Str \"that\"\n                , Space\n                , Str \"has\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"line\"\n                , Space\n                , Str \"break\"\n                , Space\n                , Str \"in\"\n                , Space\n                , Str \"it:\"\n                , Space\n                , Math InlineMath \"\\\\alpha + \\\\omega \\\\times x^2\"\n                , Str \".\"\n                ]\n            ]\n          ]\n      , Para\n          [ Str \"These\"\n          , Space\n          , Str \"shouldn\\8217t\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"math:\"\n          ]\n      , BulletList\n          [ [ Plain\n                [ Str \"To\"\n                , Space\n                , Str \"get\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"famous\"\n                , Space\n                , Str \"equation,\"\n                , Space\n                , Str \"write\"\n                , Space\n                , Code ( \"\" , [] , [] ) \"$e = mc^2$\"\n                , Str \".\"\n                ]\n            ]\n          , [ Plain\n                [ Str \"$22,000\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Emph [ Str \"lot\" ]\n                , Space\n                , Str \"of\"\n                , Space\n                , Str \"money.\"\n                , Space\n                , Str \"So\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"$34,000.\"\n                , Space\n                , Str \"(It\"\n                , Space\n                , Str \"worked\"\n                , Space\n                , Str \"if\"\n                , Space\n                , Quoted DoubleQuote [ Str \"lot\" ]\n                , Space\n                , Str \"is\"\n                , SoftBreak\n                , Str \"emphasized.)\"\n                ]\n            ]\n          , [ Plain\n                [ Str \"Shoes\"\n                , Space\n                , Str \"($20)\"\n                , Space\n                , Str \"and\"\n                , Space\n                , Str \"socks\"\n                , Space\n                , Str \"($5).\"\n                ]\n            ]\n          , [ Plain\n                [ Str \"Escaped\"\n                , Space\n                , Code ( \"\" , [] , [] ) \"$\"\n                , Str \":\"\n                , Space\n                , Str \"$73\"\n                , Space\n                , Emph\n                    [ Str \"this\"\n                    , Space\n                    , Str \"should\"\n                    , Space\n                    , Str \"be\"\n                    , Space\n                    , Str \"emphasized\"\n                    ]\n                , Space\n                , Str \"23$.\"\n                ]\n            ]\n          ]\n      , Para\n          [ Str \"Here\\8217s\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"LaTeX\"\n          , Space\n          , Str \"table:\"\n          ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"special-characters\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"Special\" , Space , Str \"Characters\" ]\n      , Para\n          [ Str \"Here\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"some\"\n          , Space\n          , Str \"unicode:\"\n          ]\n      , BulletList\n          [ [ Plain\n                [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n            ]\n          , [ Plain\n                [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n            ]\n          , [ Plain [ Str \"section:\" , Space , Str \"\\167\" ] ]\n          , [ Plain\n                [ Str \"set\"\n                , Space\n                , Str \"membership:\"\n                , Space\n                , Str \"\\8712\"\n                ]\n            ]\n          , [ Plain [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n          ]\n      , Para\n          [ Str \"AT&T\"\n          , Space\n          , Str \"has\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"their\"\n          , Space\n          , Str \"name.\"\n          ]\n      , Para\n          [ Str \"AT&T\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"another\"\n          , Space\n          , Str \"way\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"write\"\n          , Space\n          , Str \"it.\"\n          ]\n      , Para\n          [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n      , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n      , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n      , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n      , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n      , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n      , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n      , Para\n          [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n      , Para\n          [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n      , Para\n          [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n      , Para\n          [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n      , Para\n          [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n      , Para\n          [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n      , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n      , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n      , Para [ Str \"Period:\" , Space , Str \".\" ]\n      , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n      , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n      , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"links\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"Links\" ]\n      , Div\n          ( \"explicit\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Explicit\" ]\n          , Para\n              [ Str \"Just\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Link\n                  ( \"\" , [] , [ ( \"title\" , \"title\" ) ] )\n                  [ Str \"URL\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"title\"\n                  ]\n                  ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Link\n                  ( \"\"\n                  , []\n                  , [ ( \"title\" , \"title preceded by two spaces\" ) ]\n                  )\n                  [ Str \"URL\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"title\"\n                  ]\n                  ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Link\n                  ( \"\"\n                  , []\n                  , [ ( \"title\" , \"title preceded by a tab\" ) ]\n                  )\n                  [ Str \"URL\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"title\"\n                  ]\n                  ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Link\n                  ( \"\"\n                  , []\n                  , [ ( \"title\" , \"title with \\\"quotes\\\" in it\" ) ]\n                  )\n                  [ Str \"URL\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"title\"\n                  ]\n                  ( \"/url/\" , \"\" )\n              ]\n          , Para\n              [ Link\n                  ( \"\"\n                  , []\n                  , [ ( \"title\" , \"title with single quotes\" ) ]\n                  )\n                  [ Str \"URL\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"title\"\n                  ]\n                  ( \"/url/\" , \"\" )\n              ]\n          , Para\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"with_underscore\" ]\n                  ( \"/url/with_underscore\" , \"\" )\n              ]\n          , Para\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"Email\" , Space , Str \"link\" ]\n                  ( \"mailto:nobody@nowhere.net\" , \"\" )\n              ]\n          , Para\n              [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" )\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"reference\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Reference\" ]\n          , Para\n              [ Str \"Foo\"\n              , Space\n              , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"With\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n                  ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"itself\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"link.\"\n              ]\n          , Para\n              [ Str \"Indented\"\n              , Space\n              , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Indented\"\n              , Space\n              , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Indented\"\n              , Space\n              , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"[not][]\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"link.\"\n              ]\n          , CodeBlock ( \"\" , [ \"\" ] , [] ) \"[not]: /url\\n\"\n          , Para\n              [ Str \"Foo\"\n              , Space\n              , Link\n                  ( \"\"\n                  , []\n                  , [ ( \"title\" , \"Title with \\\"quotes\\\" inside\" ) ]\n                  )\n                  [ Str \"bar\" ]\n                  ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Foo\"\n              , Space\n              , Link\n                  ( \"\"\n                  , []\n                  , [ ( \"title\" , \"Title with \\\"quote\\\" inside\" ) ]\n                  )\n                  [ Str \"biz\" ]\n                  ( \"/url/\" , \"\" )\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"with-ampersands\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"With\" , Space , Str \"ampersands\" ]\n          , Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"link\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"ampersand\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"URL\"\n                  ]\n                  ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"link\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Str \"amersand\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"link\"\n              , Space\n              , Str \"text:\"\n              , SoftBreak\n              , Link\n                  ( \"\" , [] , [ ( \"title\" , \"AT&T\" ) ] )\n                  [ Str \"AT&T\" ]\n                  ( \"http://att.com/\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"inline\" , Space , Str \"link\" ]\n                  ( \"/script?foo=1&bar=2\" , \"\" )\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"inline\"\n                  , Space\n                  , Str \"link\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"pointy\"\n                  , Space\n                  , Str \"braces\"\n                  ]\n                  ( \"/script?foo=1&bar=2\" , \"\" )\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"autolinks\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Autolinks\" ]\n          , Para\n              [ Str \"With\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Str \"ampersand:\"\n              , Space\n              , Link\n                  ( \"\" , [ \"uri\" ] , [] )\n                  [ Str \"http://example.com/?foo=1&bar=2\" ]\n                  ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n              ]\n          , BulletList\n              [ [ Plain\n                    [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n                ]\n              , [ Plain\n                    [ Link\n                        ( \"\" , [ \"uri\" ] , [] )\n                        [ Str \"http://example.com/\" ]\n                        ( \"http://example.com/\" , \"\" )\n                    ]\n                ]\n              , [ Plain [ Str \"It\" , Space , Str \"should.\" ] ]\n              ]\n          , Para\n              [ Str \"An\"\n              , Space\n              , Str \"e-mail\"\n              , Space\n              , Str \"address:\"\n              , Space\n              , Link\n                  ( \"\" , [ \"email\" ] , [] )\n                  [ Str \"nobody@nowhere.net\" ]\n                  ( \"mailto:nobody@nowhere.net\" , \"\" )\n              ]\n          , BlockQuote\n              [ Para\n                  [ Str \"Blockquoted:\"\n                  , Space\n                  , Link\n                      ( \"\" , [ \"uri\" ] , [] )\n                      [ Str \"http://example.com/\" ]\n                      ( \"http://example.com/\" , \"\" )\n                  ]\n              ]\n          , Para\n              [ Str \"Auto-links\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"occur\"\n              , Space\n              , Str \"here:\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n              ]\n          , CodeBlock\n              ( \"\" , [ \"\" ] , [] ) \"or here: <http://example.com/>\\n\"\n          , HorizontalRule\n          ]\n      ]\n  , Div\n      ( \"images\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"Images\" ]\n      , Para\n          [ Str \"From\"\n          , Space\n          , Quoted\n              DoubleQuote\n              [ Str \"Voyage\"\n              , Space\n              , Str \"dans\"\n              , Space\n              , Str \"la\"\n              , Space\n              , Str \"Lune\"\n              ]\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"Georges\"\n          , Space\n          , Str \"Melies\"\n          , Space\n          , Str \"(1902):\"\n          ]\n      , Div\n          ( \"\" , [] , [] )\n          [ Para\n              [ Image\n                  ( \"\" , [] , [ ( \"title\" , \"Voyage dans la Lune\" ) ] )\n                  [ Str \"lalune\" ]\n                  ( \"lalune.jpg\" , \"\" )\n              ]\n          , Div ( \"\" , [ \"caption\" ] , [] ) [ Para [ Str \"lalune\" ] ]\n          ]\n      , Para\n          [ Str \"Here\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"movie\"\n          , Space\n          , Image\n              ( \"\" , [] , [] ) [ Str \"movie\" ] ( \"movie.jpg\" , \"\" )\n          , Space\n          , Str \"icon.\"\n          ]\n      , HorizontalRule\n      ]\n  , Div\n      ( \"footnotes\" , [ \"section\" ] , [] )\n      [ Header 1 ( \"\" , [] , [] ) [ Str \"Footnotes\" ]\n      , Para\n          [ Str \"Here\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"footnote\"\n          , Space\n          , Str \"reference,\"\n          , Note\n              [ Para\n                  [ Str \"Here\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"footnote.\"\n                  , Space\n                  , Str \"It\"\n                  , Space\n                  , Str \"can\"\n                  , Space\n                  , Str \"go\"\n                  , Space\n                  , Str \"anywhere\"\n                  , Space\n                  , Str \"after\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"footnote\"\n                  , Space\n                  , Str \"reference.\"\n                  , Space\n                  , Str \"It\"\n                  , SoftBreak\n                  , Str \"need\"\n                  , Space\n                  , Str \"not\"\n                  , Space\n                  , Str \"be\"\n                  , Space\n                  , Str \"placed\"\n                  , Space\n                  , Str \"at\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"end\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"document.\"\n                  ]\n              ]\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"another.\"\n          , Note\n              [ Para\n                  [ Str \"Here\\8217s\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"long\"\n                  , Space\n                  , Str \"note.\"\n                  , Space\n                  , Str \"This\"\n                  , Space\n                  , Str \"one\"\n                  , Space\n                  , Str \"contains\"\n                  , Space\n                  , Str \"multiple\"\n                  , Space\n                  , Str \"blocks.\"\n                  ]\n              , Para\n                  [ Str \"Subsequent\"\n                  , Space\n                  , Str \"blocks\"\n                  , Space\n                  , Str \"are\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Str \"show\"\n                  , Space\n                  , Str \"that\"\n                  , Space\n                  , Str \"they\"\n                  , Space\n                  , Str \"belong\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"footnote\"\n                  , Space\n                  , Str \"(as\"\n                  , SoftBreak\n                  , Str \"with\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"items).\"\n                  ]\n              , CodeBlock ( \"\" , [ \"\" ] , [] ) \"{ <code> }\\n\"\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"you\"\n                  , Space\n                  , Str \"want,\"\n                  , Space\n                  , Str \"you\"\n                  , Space\n                  , Str \"can\"\n                  , Space\n                  , Str \"indent\"\n                  , Space\n                  , Str \"every\"\n                  , Space\n                  , Str \"line,\"\n                  , Space\n                  , Str \"but\"\n                  , Space\n                  , Str \"you\"\n                  , Space\n                  , Str \"can\"\n                  , Space\n                  , Str \"also\"\n                  , Space\n                  , Str \"be\"\n                  , Space\n                  , Str \"lazy\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"just\"\n                  , SoftBreak\n                  , Str \"indent\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"first\"\n                  , Space\n                  , Str \"line\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"each\"\n                  , Space\n                  , Str \"block.\"\n                  ]\n              ]\n          , Space\n          , Str \"This\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Emph [ Str \"not\" ]\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"a\"\n          , SoftBreak\n          , Str \"footnote\"\n          , Space\n          , Str \"reference,\"\n          , Space\n          , Str \"because\"\n          , Space\n          , Str \"it\"\n          , Space\n          , Str \"contains\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"space.[^my\"\n          , Space\n          , Str \"note]\"\n          , Space\n          , Str \"Here\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"inline\"\n          , SoftBreak\n          , Str \"note.\"\n          , Note\n              [ Para\n                  [ Str \"This\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Emph [ Str \"easier\" ]\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Str \"type.\"\n                  , Space\n                  , Str \"Inline\"\n                  , Space\n                  , Str \"notes\"\n                  , Space\n                  , Str \"may\"\n                  , Space\n                  , Str \"contain\"\n                  , SoftBreak\n                  , Link\n                      ( \"\" , [] , [] )\n                      [ Str \"links\" ]\n                      ( \"http://google.com\" , \"\" )\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"]\"\n                  , Space\n                  , Str \"verbatim\"\n                  , Space\n                  , Str \"characters,\"\n                  , Space\n                  , Str \"as\"\n                  , Space\n                  , Str \"well\"\n                  , Space\n                  , Str \"as\"\n                  , SoftBreak\n                  , Str \"[bracketed\"\n                  , Space\n                  , Str \"text].\"\n                  ]\n              ]\n          ]\n      , BlockQuote\n          [ Para\n              [ Str \"Notes\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"go\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"quotes.\"\n              , Note [ Para [ Str \"In\" , Space , Str \"quote.\" ] ]\n              ]\n          ]\n      , OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Plain\n                [ Str \"And\"\n                , Space\n                , Str \"in\"\n                , Space\n                , Str \"list\"\n                , Space\n                , Str \"items.\"\n                , Note [ Para [ Str \"In\" , Space , Str \"list.\" ] ]\n                ]\n            ]\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"paragraph\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"part\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"note,\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"it\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Str \"indented.\"\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/docbook-chapter.docbook",
    "content": "<!DOCTYPE chapter PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\"\n          \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">\n<!-- This matches the example from\nhttps://tdg.docbook.org/tdg/4.5/section.html, sans sectioninfo and subtitle, as\nthey're currently not supported -->\n<chapter><title>Test Chapter</title>\n<para>This chapter uses recursive sections.</para>\n<section>\n<title>Like a Sect1</title>\n<para>This section is like a Sect1.</para>\n<section><title>Like a Sect2</title>\n<para>This section is like a Sect2.</para>\n<section><title>Like a Sect3</title>\n<para>This section is like a Sect3.</para>\n<section><title>Like a Sect4</title>\n<para>This section is like a Sect4.</para>\n<section><title>Like a Sect5</title>\n<para>This section is like a Sect5.</para>\n<section><title>Would be like a Sect6</title>\n<para>This section would be like a Sect6, if there was one.</para>\n<section><title>Would be like a Sect7</title>\n<para>This section would be like a Sect7, if there was one.</para>\n</section>\n</section>\n</section>\n</section>\n</section>\n</section>\n</section>\n</chapter>\n"
  },
  {
    "path": "test/docbook-chapter.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"Test\" , Space , Str \"Chapter\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"chapter\"\n      , Space\n      , Str \"uses\"\n      , Space\n      , Str \"recursive\"\n      , Space\n      , Str \"sections.\"\n      ]\n  , Header\n      2\n      ( \"\" , [] , [] )\n      [ Str \"Like\" , Space , Str \"a\" , Space , Str \"Sect1\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect1.\"\n      ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Like\" , Space , Str \"a\" , Space , Str \"Sect2\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect2.\"\n      ]\n  , Header\n      4\n      ( \"\" , [] , [] )\n      [ Str \"Like\" , Space , Str \"a\" , Space , Str \"Sect3\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect3.\"\n      ]\n  , Header\n      5\n      ( \"\" , [] , [] )\n      [ Str \"Like\" , Space , Str \"a\" , Space , Str \"Sect4\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect4.\"\n      ]\n  , Header\n      6\n      ( \"\" , [] , [] )\n      [ Str \"Like\" , Space , Str \"a\" , Space , Str \"Sect5\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect5.\"\n      ]\n  , Header\n      7\n      ( \"\" , [] , [] )\n      [ Str \"Would\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect6\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"would\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect6,\"\n      , Space\n      , Str \"if\"\n      , Space\n      , Str \"there\"\n      , Space\n      , Str \"was\"\n      , Space\n      , Str \"one.\"\n      ]\n  , Header\n      8\n      ( \"\" , [] , [] )\n      [ Str \"Would\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect7\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"would\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Sect7,\"\n      , Space\n      , Str \"if\"\n      , Space\n      , Str \"there\"\n      , Space\n      , Str \"was\"\n      , Space\n      , Str \"one.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/docbook-reader.docbook",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\"\n\"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"\n[\n<!ENTITY GHC \"GHC\" >\n<!ENTITY let \"LET\" >\n<!ENTITY case \"CASE\" >\n]>\n<article xmlns=\"http://docbook.org/ns/docbook\"\n         xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n         xmlns:mml=\"http://www.w3.org/1998/Math/MathML\">\n  <articleinfo>\n    <title>Pandoc Test Suite</title>\n    <authorgroup>\n      <author>\n        <firstname>John</firstname>\n        <surname>MacFarlane</surname>\n      </author>\n      <author>\n        <firstname></firstname>\n        <surname>Anonymous</surname>\n      </author>\n    </authorgroup>\n    <date>July 17, 2006</date>\n  </articleinfo>\n<para>\n  This is a set of tests for pandoc. Most of them are adapted from John\n  Gruber’s markdown test suite.\n</para>\n<sect1 id=\"headers\" role=\"sect1role\">\n  <title>Headers</title>\n  <sect2 id=\"level-2-with-an-embedded-link\" role=\"sect2role\">\n    <title>Level 2 with an <ulink url=\"/url\">embedded link</ulink></title>\n    <sect3 id=\"level-3-with-emphasis\">\n      <title>Level 3 with <emphasis>emphasis</emphasis></title>\n      <sect4 id=\"level-4\">\n        <title>Level 4</title>\n        <sect5 id=\"level-5\">\n          <title>Level 5</title>\n          <para>\n            Hi.\n          </para>\n        </sect5>\n      </sect4>\n    </sect3>\n  </sect2>\n</sect1>\n<sect1 id=\"level-1\">\n  <title>Level 1</title>\n  <sect2 id=\"level-2-with-emphasis\">\n    <title>Level 2 with <emphasis>emphasis</emphasis></title>\n    <sect3 id=\"level-3\">\n      <title>Level 3</title>\n      <para>\n        with no blank line\n      </para>\n      <simplesect>\n        <title>Level 4</title>\n        <para>\n        An unnumbered section.\n        </para>\n      </simplesect>\n    </sect3>\n  </sect2>\n  <sect2 id=\"level-2\">\n    <title>Level 2</title>\n    <para>\n      with no blank line\n    </para>\n  </sect2>\n</sect1>\n<sect1 id=\"paragraphs\">\n  <title>Paragraphs</title>\n  <para>\n    Here’s a regular paragraph.\n  </para>\n  <para role=\"pararole\">\n    And here’s a regular paragraph with a role.\n  </para>\n  <para>\n    In Markdown 1.0.0 and earlier. Version 8. This line turns into a list\n    item. Because a hard-wrapped line in the middle of a paragraph looked like\n    a list item.\n  </para>\n  <para>\n    Here’s one with a bullet. * criminey.\n  </para>\n</sect1>\n<sect1 id=\"block-quotes\">\n  <title>Block Quotes</title>\n  <para>\n    E-mail style:\n  </para>\n  <blockquote>\n    <para>\n      This is a block quote. It is pretty short.\n    </para>\n  </blockquote>\n  <blockquote role=\"roleblockquote\">\n    <para>\n      This is a block quote with a role.\n    </para>\n  </blockquote>\n  <blockquote>\n    <para>\n      Code in a block quote:\n    </para>\n    <programlisting>\nsub status {\n    print &quot;working&quot;;\n}\n</programlisting>\n    <programlisting linenumbering=\"numbered\">\nsub status {\n    print &quot;working with line numbers&quot;;\n}\n</programlisting>\n    <screen>\n% <command>ls</command>\n</screen>\n    <para>\n      A list:\n    </para>\n    <orderedlist numeration=\"arabic\">\n      <listitem>\n        <para>\n          item one\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          item two\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      Nested block quotes:\n    </para>\n    <blockquote>\n      <para>\n        nested\n      </para>\n    </blockquote>\n    <blockquote>\n      <para>\n        nested\n      </para>\n    </blockquote>\n  </blockquote>\n  <para>\n    This should not be a block quote: 2 &gt; 1.\n  </para>\n  <para>\n    And a following paragraph.\n  </para>\n</sect1>\n<sect1 id=\"code-blocks\">\n  <title>Code Blocks</title>\n  <para>\n    Code:\n  </para>\n  <programlisting>\n---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab\n</programlisting>\n  <para>\n    And:\n  </para>\n  <programlisting>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{\n</programlisting>\n</sect1>\n<sect1 id=\"lists\">\n  <title>Lists</title>\n  <sect2 id=\"unordered\">\n    <title>Unordered</title>\n    <para>\n      Asterisks loose:\n    </para>\n    <itemizedlist>\n      <listitem>\n        <para>\n          asterisk 1\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          asterisk 2\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          asterisk 3\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      Asterisks tight:\n    </para>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n          Plus 1\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Plus 2\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Plus 3\n        </para>\n      </listitem>\n    </itemizedlist>\n  </sect2>\n  <sect2 id=\"ordered\">\n    <title>Ordered</title>\n    <orderedlist numeration=\"arabic\">\n      <listitem>\n        <para>\n          First\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Second\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Third\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      with role:\n    </para>\n    <orderedlist role=\"listrole\" numeration=\"arabic\">\n      <listitem>\n        <para>\n          First\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Second\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Third\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      and tight:\n    </para>\n    <orderedlist spacing=\"compact\" numeration=\"arabic\">\n      <listitem>\n        <para>\n          One\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Two\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Three\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      Multiple paragraphs:\n    </para>\n    <orderedlist numeration=\"arabic\">\n      <listitem>\n        <para>\n          Item 1, graf one.\n        </para>\n        <para>\n          Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n          back.\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Item 2.\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Item 3.\n        </para>\n      </listitem>\n    </orderedlist>\n  </sect2>\n  <sect2 id=\"nested\">\n    <title>Nested</title>\n    <itemizedlist>\n      <listitem>\n        <para>\n          Tab\n        </para>\n        <itemizedlist>\n          <listitem>\n            <para>\n              Tab\n            </para>\n            <itemizedlist>\n              <listitem>\n                <para>\n                  Tab\n                </para>\n              </listitem>\n            </itemizedlist>\n          </listitem>\n        </itemizedlist>\n      </listitem>\n    </itemizedlist>\n    <para>\n      Here’s another:\n    </para>\n    <orderedlist numeration=\"arabic\">\n      <listitem>\n        <para>\n          First\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Second:\n        </para>\n        <itemizedlist>\n          <listitem>\n            <para>\n              Fee\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              Fie\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              Foe\n            </para>\n          </listitem>\n        </itemizedlist>\n      </listitem>\n      <listitem>\n        <para>\n          Third\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      Same thing but with paragraphs:\n    </para>\n    <orderedlist numeration=\"arabic\">\n      <listitem>\n        <para>\n          First\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Second:\n        </para>\n        <itemizedlist>\n          <listitem>\n            <para>\n              Fee\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              Fie\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              Foe\n            </para>\n          </listitem>\n        </itemizedlist>\n      </listitem>\n      <listitem>\n        <para>\n          Third\n        </para>\n      </listitem>\n    </orderedlist>\n  </sect2>\n  <sect2 id=\"tabs-and-spaces\">\n    <title>Tabs and spaces</title>\n    <itemizedlist>\n      <listitem>\n        <para>\n          this is a list item indented with tabs\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          this is a list item indented with spaces\n        </para>\n        <itemizedlist>\n          <listitem>\n            <para>\n              this is an example list item indented with tabs\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              this is an example list item indented with spaces\n            </para>\n          </listitem>\n        </itemizedlist>\n      </listitem>\n    </itemizedlist>\n  </sect2>\n  <sect2 id=\"fancy-list-markers\">\n    <title>Fancy list markers</title>\n    <orderedlist numeration=\"arabic\" startingnumber=\"2\">\n      <listitem>\n        <para>\n          begins with 2\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          and now 3\n        </para>\n        <para>\n          with a continuation\n        </para>\n        <orderedlist numeration=\"lowerroman\" startingnumber=\"4\">\n          <listitem>\n            <para>\n              sublist with roman numerals, starting with 4\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              more items\n            </para>\n            <orderedlist numeration=\"upperalpha\">\n              <listitem>\n                <para>\n                  a subsublist\n                </para>\n              </listitem>\n              <listitem>\n                <para>\n                  a subsublist\n                </para>\n              </listitem>\n            </orderedlist>\n          </listitem>\n        </orderedlist>\n      </listitem>\n    </orderedlist>\n    <para>\n      Nesting:\n    </para>\n    <orderedlist numeration=\"upperalpha\">\n      <listitem>\n        <para>\n          Upper Alpha\n        </para>\n        <orderedlist numeration=\"upperroman\">\n          <listitem>\n            <para>\n              Upper Roman.\n            </para>\n            <orderedlist numeration=\"arabic\" startingnumber=\"6\">\n              <listitem>\n                <para>\n                  Decimal start with 6\n                </para>\n                <orderedlist numeration=\"loweralpha\" startingnumber=\"3\">\n                  <listitem>\n                    <para>\n                      Lower alpha with paren\n                    </para>\n                  </listitem>\n                </orderedlist>\n              </listitem>\n            </orderedlist>\n          </listitem>\n        </orderedlist>\n      </listitem>\n    </orderedlist>\n    <para>\n      Autonumbering:\n    </para>\n    <orderedlist>\n      <listitem>\n        <para>\n          Autonumber.\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          More.\n        </para>\n        <orderedlist>\n          <listitem>\n            <para>\n              Nested.\n            </para>\n          </listitem>\n        </orderedlist>\n      </listitem>\n    </orderedlist>\n    <para>\n      Should not be a list item:\n    </para>\n    <para>\n      M.A. 2007\n    </para>\n    <para>\n      B. Williams\n    </para>\n  </sect2>\n  <sect2 id=\"callout\">\n    <title>Callout</title>\n    <para>Simple.</para>\n      <calloutlist>\n\t<callout arearefs=\"loop1-letrec-co\" id=\"loop1-letrec\">\n\t  <para id=\"x_QA1\">A <code>__letrec</code> is equivalent to a normal\n\t    Haskell &let;.</para>\n\t</callout>\n\t<callout arearefs=\"loop1-def-co\" id=\"loop1-def\">\n\t  <para id=\"x_RA1\">&GHC; compiled the body of our list comprehension into\n\t    a loop named <function>go_s1YC</function>.</para>\n\t</callout>\n\t<callout arearefs=\"loop1-pat-empty-co\" id=\"loop1-pat-empty\">\n\t  <para id=\"x_SA1\">If our &case; expression matches the empty list, we\n\t    return the empty list.  This is reassuringly\n\t    familiar.</para>\n\t</callout>\n      </calloutlist>\n  </sect2>\n</sect1>\n<sect1 id=\"definition-lists\">\n  <title>Definition Lists</title>\n  <variablelist>\n    <varlistentry>\n      <term>\n        apple\n      </term>\n      <listitem>\n        <para>\n          red fruit\n        </para>\n      </listitem>\n    </varlistentry>\n    <varlistentry>\n      <term>\n        orange\n      </term>\n      <listitem>\n        <para>\n          orange fruit\n        </para>\n      </listitem>\n    </varlistentry>\n    <varlistentry>\n      <term>\n        banana\n      </term>\n      <listitem>\n        <para>\n          yellow fruit\n        </para>\n      </listitem>\n    </varlistentry>\n  </variablelist>\n  <para>\n    Multiple blocks with italics:\n  </para>\n  <variablelist>\n    <varlistentry>\n      <term>\n        <emphasis>apple</emphasis>\n      </term>\n      <listitem>\n        <para>\n          red fruit\n        </para>\n        <para>\n          contains seeds, crisp, pleasant to taste\n        </para>\n      </listitem>\n    </varlistentry>\n    <varlistentry>\n      <term>\n        <emphasis>orange</emphasis>\n      </term>\n      <listitem>\n        <para>\n          orange fruit\n        </para>\n        <programlisting>\n{ orange code block }\n</programlisting>\n        <blockquote>\n          <para>\n            orange block quote\n          </para>\n        </blockquote>\n      </listitem>\n    </varlistentry>\n  </variablelist>\n  <para>\n    Multiple definitions, loose:\n  </para>\n  <variablelist>\n    <varlistentry>\n      <term>\n        apple\n      </term>\n      <listitem>\n        <para>\n          red fruit\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          computer\n        </para>\n      </listitem>\n    </varlistentry>\n    <varlistentry>\n      <term>\n        orange\n      </term>\n      <listitem>\n        <para>\n          orange fruit\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          bank\n        </para>\n      </listitem>\n    </varlistentry>\n  </variablelist>\n  <para>\n    Blank line after term, indented marker, alternate markers:\n  </para>\n  <variablelist>\n    <varlistentry>\n      <term>\n        apple\n      </term>\n      <listitem>\n        <para>\n          red fruit\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          computer\n        </para>\n      </listitem>\n    </varlistentry>\n    <varlistentry>\n      <term>\n        orange\n      </term>\n      <listitem>\n        <para>\n          orange fruit\n        </para>\n        <orderedlist numeration=\"arabic\">\n          <listitem>\n            <para>\n              sublist\n            </para>\n          </listitem>\n          <listitem>\n            <para>\n              sublist\n            </para>\n          </listitem>\n        </orderedlist>\n      </listitem>\n    </varlistentry>\n  </variablelist>\n</sect1>\n<sect1 id=\"inline-markup\">\n  <title>Inline Markup</title>\n  <para>\n    This is <emphasis>emphasized</emphasis>, and so <emphasis>is\n    this</emphasis>.\n  </para>\n  <para>\n    This is <emphasis role=\"strong\">strong</emphasis>, and so\n    <emphasis role=\"strong\">is this</emphasis>.\n  </para>\n  <para>\n    An <emphasis><ulink url=\"/url\">emphasized link</ulink></emphasis>.\n  </para>\n  <para>\n    <emphasis role=\"strong\"><emphasis>This is strong and\n    em.</emphasis></emphasis>\n  </para>\n  <para>\n    So is <emphasis role=\"strong\"><emphasis>this</emphasis></emphasis> word.\n  </para>\n  <para>\n    <emphasis role=\"strong\"><emphasis>This is strong and\n    em.</emphasis></emphasis>\n  </para>\n  <para>\n    So is <emphasis role=\"strong\"><emphasis>this</emphasis></emphasis> word.\n  </para>\n  <para>\n    So is <emphasis role=\"emphasisrole\"><emphasis>this</emphasis></emphasis> word with a role.\n  </para>\n  <para>\n    So is <phrase role=\"phraserole\"><phrase>this</phrase></phrase> phrase with a role.\n  </para>\n  <para>\n    This is code: <literal>&gt;</literal>, <literal>$</literal>,\n    <literal>\\</literal>, <literal>\\$</literal>,\n    <literal>&lt;html&gt;</literal>.\n  </para>\n  <para>\n    More code: <classname>Class</classname> and <type>Type</type>\n  </para>\n  <para>\n    Referencing a man page: <citerefentry><refentrytitle>nix.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>\n  </para>\n  <para>\n    <emphasis role=\"strikethrough\">This is\n    <emphasis>strikeout</emphasis>.</emphasis>\n  </para>\n  <para>\n    Superscripts: a<superscript>bc</superscript>d\n    a<superscript><emphasis>hello</emphasis></superscript>\n    a<superscript>hello there</superscript>.\n  </para>\n  <para>\n    Subscripts: H<subscript>2</subscript>O, H<subscript>23</subscript>O,\n    H<subscript>many of them</subscript>O.\n  </para>\n  <para>\n    These should not be superscripts or subscripts, because of the unescaped\n    spaces: a^b c^d, a~b c~d.\n  </para>\n</sect1>\n<sect1 id=\"smart-quotes-ellipses-dashes\">\n  <title>Smart quotes, ellipses, dashes</title>\n  <para>\n    <quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my\n    name.</quote>\n  </para>\n  <para>\n    <quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are letters.\n  </para>\n  <para>\n    <quote>He said, <quote>I want to go.</quote></quote> Were you alive in the\n    70’s?\n  </para>\n  <para>\n    Some dashes: one—two — three—four — five.\n  </para>\n  <para>\n    Dashes between numbers: 5–7, 255–66, 1987–1999.\n  </para>\n  <para>\n    Ellipses…and…and….\n  </para>\n</sect1>\n<sect1 id=\"math\">\n  <para>\n    <equation>\n      <mml:math>\n        <mml:mrow>\n          <mml:mi>e</mml:mi>\n          <mml:mo>=</mml:mo>\n          <mml:mi>m</mml:mi>\n          <mml:msup>\n            <mml:mi>c</mml:mi>\n            <mml:mn>2</mml:mn>\n          </mml:msup>\n        </mml:mrow>\n      </mml:math>\n      <mml:math>\n        <mrow>\n          <mn>1</mn>\n        </mrow>\n      </mml:math>\n    </equation>\n    <inlineequation>\n      <mml:math>\n        <mml:mrow>\n          <mml:mi>e</mml:mi>\n          <mml:mo>=</mml:mo>\n          <mml:mi>m</mml:mi>\n          <mml:msup>\n            <mml:mi>c</mml:mi>\n            <mml:mn>2</mml:mn>\n          </mml:msup>\n        </mml:mrow>\n      </mml:math>\n    </inlineequation>\n    <informalequation>\n      <mml:math>\n        <mml:mrow>\n          <mml:mi>e</mml:mi>\n          <mml:mo>=</mml:mo>\n          <mml:mi>m</mml:mi>\n          <mml:msup>\n            <mml:mi>c</mml:mi>\n            <mml:mn>2</mml:mn>\n          </mml:msup>\n        </mml:mrow>\n      </mml:math>\n    </informalequation>\n  </para>\n</sect1>\n<sect1 id=\"special-characters\">\n  <title>Special Characters</title>\n  <para>\n    Here is some unicode:\n  </para>\n  <itemizedlist>\n    <listitem>\n      <para>\n        I hat: Î\n      </para>\n    </listitem>\n    <listitem>\n      <para>\n        o umlaut: ö\n      </para>\n    </listitem>\n    <listitem>\n      <para>\n        section: §\n      </para>\n    </listitem>\n    <listitem>\n      <para>\n        set membership: ∈\n      </para>\n    </listitem>\n    <listitem>\n      <para>\n        copyright: ©\n      </para>\n    </listitem>\n  </itemizedlist>\n  <para>\n    AT&amp;T has an ampersand in their name.\n  </para>\n  <para>\n    AT&amp;T is another way to write it.\n  </para>\n  <para>\n    This &amp; that.\n  </para>\n  <para>\n    4 &lt; 5.\n  </para>\n  <para>\n    6 &gt; 5.\n  </para>\n  <para>\n    Backslash: \\\n  </para>\n  <para>\n    Backtick: `\n  </para>\n  <para>\n    Asterisk: *\n  </para>\n  <para>\n    Underscore: _\n  </para>\n  <para>\n    Left brace: {\n  </para>\n  <para>\n    Right brace: }\n  </para>\n  <para>\n    Left bracket: [\n  </para>\n  <para>\n    Right bracket: ]\n  </para>\n  <para>\n    Left paren: (\n  </para>\n  <para>\n    Right paren: )\n  </para>\n  <para>\n    Greater-than: &gt;\n  </para>\n  <para>\n    Hash: #\n  </para>\n  <para>\n    Period: .\n  </para>\n  <para>\n    Bang: !\n  </para>\n  <para>\n    Plus: +\n  </para>\n  <para>\n    Minus: -\n  </para>\n</sect1>\n<sect1 id=\"links\">\n  <title>Links</title>\n  <sect2 id=\"explicit\">\n    <title>Explicit</title>\n    <para>\n      Just a <ulink url=\"/url/\">URL</ulink>.\n    </para>\n    <para>\n      <ulink url=\"/url/\">URL and title</ulink>.\n    </para>\n    <para>\n      <ulink url=\"/url/\">URL and title</ulink>.\n    </para>\n    <para>\n      <ulink url=\"/url/\">URL and title</ulink>.\n    </para>\n    <para>\n      <ulink url=\"/url/\">URL and title</ulink>\n    </para>\n    <para>\n      <ulink url=\"/url/\">URL and title</ulink>\n    </para>\n    <para>\n      <ulink url=\"/url/with_underscore\">with_underscore</ulink>\n    </para>\n    <para>\n      <email>nobody@nowhere.net</email>\n    </para>\n    <para>\n      <ulink url=\"\">Empty</ulink>.\n    </para>\n  </sect2>\n  <sect2 id=\"reference\">\n    <title>Reference</title>\n    <para>\n      Foo <ulink url=\"/url/\">bar</ulink>.\n    </para>\n    <para>\n      Foo <ulink url=\"/url/\">bar</ulink>.\n    </para>\n    <para>\n      Foo <ulink url=\"/url/\">bar</ulink>.\n    </para>\n    <para>\n      With <ulink url=\"/url/\">embedded [brackets]</ulink>.\n    </para>\n    <para>\n      <ulink url=\"/url/\">b</ulink> by itself should be a link.\n    </para>\n    <para>\n      Indented <ulink url=\"/url\">once</ulink>.\n    </para>\n    <para>\n      Indented <ulink url=\"/url\">twice</ulink>.\n    </para>\n    <para>\n      Indented <ulink url=\"/url\">thrice</ulink>.\n    </para>\n    <para>\n      This should [not][] be a link.\n    </para>\n    <programlisting>\n[not]: /url\n</programlisting>\n    <para>\n      Foo <ulink url=\"/url/\">bar</ulink>.\n    </para>\n    <para>\n      Foo <ulink url=\"/url/\">biz</ulink>.\n    </para>\n  </sect2>\n  <sect2 id=\"with-ampersands\">\n    <title>With ampersands</title>\n    <para>\n      Here’s a <ulink url=\"http://example.com/?foo=1&amp;bar=2\">link with an\n      ampersand in the URL</ulink>.\n    </para>\n    <para>\n      Here’s a link with an amersand in the link text:\n      <ulink url=\"http://att.com/\">AT&amp;T</ulink>.\n    </para>\n    <para>\n      Here’s an <ulink url=\"/script?foo=1&amp;bar=2\">inline link</ulink>.\n    </para>\n    <para>\n      Here’s an <ulink url=\"/script?foo=1&amp;bar=2\">inline link in pointy\n      braces</ulink>.\n    </para>\n  </sect2>\n  <sect2 id=\"autolinks\">\n    <title>Autolinks</title>\n    <para>\n      With an ampersand:\n      <ulink url=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</ulink>\n    </para>\n    <itemizedlist>\n      <listitem>\n        <para>\n          In a list?\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <ulink url=\"http://example.com/\">http://example.com/</ulink>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          It should.\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      An e-mail address: <email>nobody@nowhere.net</email>\n    </para>\n    <blockquote>\n      <para>\n        Blockquoted:\n        <ulink url=\"http://example.com/\">http://example.com/</ulink>\n      </para>\n    </blockquote>\n    <para>\n      Auto-links should not occur here:\n      <literal>&lt;http://example.com/&gt;</literal>\n    </para>\n    <programlisting>\nor here: &lt;http://example.com/&gt;\n</programlisting>\n  </sect2>\n</sect1>\n<sect1 id=\"images\">\n  <title>Images</title>\n  <para>\n    From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):\n  </para>\n  <figure>\n    <title>lalune fig caption</title>\n    <mediaobject>\n      <imageobject>\n        <imagedata fileref=\"lalune.jpg\" />\n      </imageobject>\n      <textobject><phrase>lalune alt text shadowed by fig caption</phrase></textobject>\n    </mediaobject>\n  </figure>\n  <para>\n    Here is a movie <inlinemediaobject>\n      <imageobject>\n        <imagedata fileref=\"movie.jpg\" />\n      </imageobject>\n    </inlinemediaobject> icon.\n    And here a second movie <inlinemediaobject>\n      <alt>alt text</alt>\n      <imageobject>\n        <imagedata fileref=\"movie.jpg\" />\n      </imageobject>\n    </inlinemediaobject> icon.\n    And here a third movie <inlinemediaobject>\n      <textobject><phrase>alt text</phrase></textobject>\n      <imageobject>\n        <imagedata fileref=\"movie.jpg\" />\n      </imageobject>\n    </inlinemediaobject> icon.\n  </para>\n  <mediaobject>\n    <imageobject>\n      <imagedata fileref=\"lalune.jpg\" />\n    </imageobject>\n    <textobject><phrase>lalune no figure alt text</phrase></textobject>\n  </mediaobject>\n</sect1>\n<sect1 id=\"footnotes\">\n  <title>Footnotes</title>\n  <para>\n    Here is a footnote reference,<footnote>\n      <para>\n        Here is the footnote. It can go anywhere after the footnote reference.\n        It need not be placed at the end of the document.\n      </para>\n    </footnote> and another.<footnote>\n      <para>\n        Here’s the long note. This one contains multiple blocks.\n      </para>\n      <para>\n        Subsequent blocks are indented to show that they belong to the\n        footnote (as with list items).\n      </para>\n      <programlisting>\n  { &lt;code&gt; }\n</programlisting>\n      <para>\n        If you want, you can indent every line, but you can also be lazy and\n        just indent the first line of each block.\n      </para>\n    </footnote> This should <emphasis>not</emphasis> be a footnote reference,\n    because it contains a space.[^my note] Here is an inline note.<footnote>\n      <para>\n        This is <emphasis>easier</emphasis> to type. Inline notes may contain\n        <ulink url=\"http://google.com\">links</ulink> and <literal>]</literal>\n        verbatim characters, as well as [bracketed text].\n      </para>\n    </footnote>\n  </para>\n  <blockquote>\n    <para>\n      Notes can go in quotes.<footnote>\n        <para>\n          In quote.\n        </para>\n      </footnote>\n    </para>\n  </blockquote>\n  <orderedlist numeration=\"arabic\">\n    <listitem>\n      <para>\n        And in list items.<footnote>\n          <para>\n            In list.\n          </para>\n        </footnote>\n      </para>\n    </listitem>\n  </orderedlist>\n  <para>\n    This paragraph should not be part of the note, as it is not indented.\n  </para>\n</sect1>\n<sect1 id=\"tables\">\n  <title>Tables</title>\n  <para>\n    Simple table with caption:\n  </para>\n  <table>\n    <title>\n      Demonstration of simple table syntax.\n    </title>\n    <tgroup cols=\"4\">\n      <colspec align=\"right\" />\n      <colspec align=\"left\" />\n      <colspec align=\"center\" />\n      <colspec align=\"left\" />\n      <thead>\n        <row>\n          <entry>\n            Right\n          </entry>\n          <entry>\n            Left\n          </entry>\n          <entry>\n            Center\n          </entry>\n          <entry>\n            Default\n          </entry>\n        </row>\n      </thead>\n      <tbody>\n        <row>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n        </row>\n        <row>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n        </row>\n        <row>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </table>\n  <para>\n    Simple table without caption:\n  </para>\n  <informaltable>\n    <tgroup cols=\"4\">\n      <colspec align=\"right\" />\n      <colspec align=\"left\" />\n      <colspec align=\"center\" />\n      <colspec align=\"left\" />\n      <thead>\n        <row>\n          <entry>\n            Right\n          </entry>\n          <entry>\n            Left\n          </entry>\n          <entry>\n            Center\n          </entry>\n          <entry>\n            Default\n          </entry>\n        </row>\n      </thead>\n      <tbody>\n        <row>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n        </row>\n        <row>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n        </row>\n        <row>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </informaltable>\n  <para>\n    Simple table indented two spaces:\n  </para>\n  <table>\n    <title>\n      Demonstration of simple table syntax.\n    </title>\n    <tgroup cols=\"4\">\n      <colspec align=\"right\" />\n      <colspec align=\"left\" />\n      <colspec align=\"center\" />\n      <colspec align=\"left\" />\n      <thead>\n        <row>\n          <entry>\n            Right\n          </entry>\n          <entry>\n            Left\n          </entry>\n          <entry>\n            Center\n          </entry>\n          <entry>\n            Default\n          </entry>\n        </row>\n      </thead>\n      <tbody>\n        <row>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n        </row>\n        <row>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n        </row>\n        <row>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </table>\n  <para>\n    Multiline table with caption:\n  </para>\n  <table>\n    <title>\n      Here's the caption. It may span multiple lines.\n    </title>\n    <tgroup cols=\"4\">\n      <colspec colwidth=\"2*\" align=\"center\" />\n      <colspec colwidth=\"2*\" align=\"left\" />\n      <colspec colwidth=\"3*\" align=\"right\" />\n      <colspec colwidth=\"3*\" align=\"left\" />\n      <thead>\n        <row>\n          <entry>\n            Centered Header\n          </entry>\n          <entry>\n            Left Aligned\n          </entry>\n          <entry>\n            Right Aligned\n          </entry>\n          <entry>\n            Default aligned\n          </entry>\n        </row>\n      </thead>\n      <tbody>\n        <row>\n          <entry>\n            First\n          </entry>\n          <entry>\n            row\n          </entry>\n          <entry>\n            12.0\n          </entry>\n          <entry>\n            Example of a row that spans multiple lines.\n          </entry>\n        </row>\n        <row>\n          <entry>\n            Second\n          </entry>\n          <entry>\n            row\n          </entry>\n          <entry>\n            5.0\n          </entry>\n          <entry>\n            Here's another one. Note the blank line between rows.\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </table>\n  <para>\n    Table with attributes\n  </para>\n  <table xml:id=\"mytableid1\" class=\"mytableclass1 mytableclass2\" tabstyle=\"mytabstyle1\" role=\"tablerole1\">\n    <title>\n      Attribute table caption\n    </title>\n    <tgroup>\n      <thead>\n\t<th>\n\t  <para>\n\t    header cell 1\n\t  </para>\n\t</th>\n\t<th>\n\t  <para>\n\t    header cell 2\n\t  </para>\n\t</th>\n      </thead>\n      <tbody>\n\t<tr>\n\t  <td>\n\t    <para>\n\t      body cell 1\n\t    </para>\n\t  </td>\n\t  <td>\n\t    <para>\n\t      body cell 2\n\t    </para>\n\t  </td>\n\t</tr>\n      </tbody>\n    </tgroup>\n  </table>\n  <para>\n    Table with attributes, without caption\n  </para>\n  <informaltable xml:id=\"mytableid2\" class=\"mytableclass3 mytableclass4\" tabstyle=\"mytabstyle2\" role=\"tablerole2\">\n    <tgroup>\n      <thead>\n\t<th>\n\t  <para>\n\t    header cell 1\n\t  </para>\n\t</th>\n\t<th>\n\t  <para>\n\t    header cell 2\n\t  </para>\n\t</th>\n      </thead>\n      <tbody>\n\t<tr>\n\t  <td>\n\t    <para>\n\t      body cell 1\n\t    </para>\n\t  </td>\n\t  <td>\n\t    <para>\n\t      body cell 2\n\t    </para>\n\t  </td>\n\t</tr>\n      </tbody>\n    </tgroup>\n  </informaltable>\n  <para>\n    Multiline table without caption:\n  </para>\n  <informaltable>\n    <tgroup cols=\"4\">\n      <colspec colwidth=\"1*\" align=\"center\" />\n      <colspec colwidth=\"2*\" align=\"left\" />\n      <colspec colwidth=\"3*\" align=\"right\" />\n      <colspec colwidth=\"4*\" align=\"left\" />\n      <thead>\n        <row>\n          <entry>\n            Centered Header\n          </entry>\n          <entry>\n            Left Aligned\n          </entry>\n          <entry>\n            Right Aligned\n          </entry>\n          <entry>\n            Default aligned\n          </entry>\n        </row>\n      </thead>\n      <tbody>\n        <row>\n          <entry>\n            First\n          </entry>\n          <entry>\n            row\n          </entry>\n          <entry>\n            12.0\n          </entry>\n          <entry>\n            Example of a row that spans multiple lines.\n          </entry>\n        </row>\n        <row>\n          <entry>\n            Second\n          </entry>\n          <entry>\n            row\n          </entry>\n          <entry>\n            5.0\n          </entry>\n          <entry>\n            Here's another one. Note the blank line between rows.\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </informaltable>\n  <para>\n    Table without column headers:\n  </para>\n  <informaltable>\n    <tgroup cols=\"4\">\n      <colspec align=\"right\" />\n      <colspec align=\"left\" />\n      <colspec align=\"center\" />\n      <colspec align=\"right\" />\n      <tbody>\n        <row>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n          <entry>\n            12\n          </entry>\n        </row>\n        <row>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n          <entry>\n            123\n          </entry>\n        </row>\n        <row>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n          <entry>\n            1\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </informaltable>\n  <para>\n    Multiline table without column headers:\n  </para>\n  <informaltable>\n    <tgroup cols=\"4\">\n      <colspec colwidth=\"10*\" align=\"center\" />\n      <colspec colwidth=\"10*\" align=\"left\" />\n      <colspec colwidth=\"10*\" align=\"right\" />\n      <colspec colwidth=\"10*\" align=\"left\" />\n      <tbody>\n        <row>\n          <entry>\n            First\n          </entry>\n          <entry>\n            row\n          </entry>\n          <entry>\n            12.0\n          </entry>\n          <entry>\n            Example of a row that spans multiple lines.\n          </entry>\n        </row>\n        <row>\n          <entry>\n            Second\n          </entry>\n          <entry>\n            row\n          </entry>\n          <entry>\n            5.0\n          </entry>\n          <entry>\n            Here's another one. Note the blank line between rows.\n          </entry>\n        </row>\n      </tbody>\n    </tgroup>\n  </informaltable>\n  <para>\n    Multiline table with cells spanning multiple columns and rows without caption.\n  </para>\n  <informaltable>\n    <tgroup cols=\"3\">\n      <colspec align=\"left\" colname=\"c1\" />\n      <colspec align=\"left\" colname=\"c2\" />\n      <colspec align=\"left\" colname=\"c3\" />\n      <colspec align=\"left\" colname=\"c4\" />\n      <thead>\n  <tr>\n    <th namest=\"c1\" nameend=\"c3\">Columns</th>\n  </tr>\n  <tr>\n    <th>A</th>\n    <th>B</th>\n    <th>C</th>\n  </tr>\n      </thead>\n      <tbody>\n\t<tr>\n\t  <td namest=\"c1\" nameend=\"c2\">A1 + B1</td>\n\t  <td morerows=\"1\">C1 + C2</td>\n\t</tr>\n  <tr>\n\t  <td namest=\"c1\" nameend=\"c2\" morerows=\"1\">A2 + B2 + A3 + B3</td>\n\t</tr>\n  <tr>\n\t  <td>C3</td>\n\t</tr>\n      </tbody>\n    </tgroup>\n  </informaltable>\n  <procedure><title>An Example Procedure</title>\n    <step>\n      <para>\n        A Step\n      </para>\n    </step>\n    <step>\n      <para>\n        Another Step\n      </para>\n      <substeps>\n        <step>\n          <para>\n            Substeps can be nested indefinitely deep.\n          </para>\n        </step>\n      </substeps>\n    </step>\n    <step>\n      <para>\n        A Final Step\n      </para>\n    </step>\n  </procedure>\n</sect1>\n<sect1 id=\"indexterms\">\n  <title>Index terms</title>\n  <para>\n    In the simplest case, index terms<indexterm><primary>index term</primary></indexterm> consists of just a <code>&lt;primary&gt;</code> element, but <indexterm><primary>index term</primary><secondary>multi-level</secondary></indexterm> they can also consist of a <code>&lt;primary&gt;</code> <emph>and</emph> <code>&lt;secondary&gt;</code> element, and <indexterm><primary>index term</primary><secondary>multi-level</secondary><tertiary>3-level</tertiary></indexterm> can even include a <code>&lt;tertiary&gt;</code> term.\n  </para>\n  <para>\n    Index terms can also refer to other index terms: <indexterm><primary>index cross referencing</primary></indexterm><indexterm><primary>index term</primary><secondary>cross references</secondary><see>index cross referencing</see></indexterm>exclusively, using the <code>&lt;see&gt;</code> tag; or <indexterm><primary>index cross referencing</primary><seealso>cross referencing</seealso></indexterm> as a reference to related terms, using the <code>&lt;seealso&gt;</code> tag.\n  </para>\n  <para>\n    <indexterm><primary>food</primary><secondary>big <foreignphrase>baguette</foreignphrase> <strong>supreme</strong></secondary></indexterm>Nested content in index term elements is flattened.\n  </para>\n</sect1>\n<sect1 id=\"titleabbrev\">\n  <title>Abbreviated title</title>\n  <titleabbrev>Abbr. title</titleabbrev>\n</sect1>\n</article>\n"
  },
  {
    "path": "test/docbook-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n                , MetaInlines [ Str \"Anonymous\" ]\n                ]\n            )\n          , ( \"date\"\n            , MetaInlines\n                [ Str \"July\" , Space , Str \"17,\" , Space , Str \"2006\" ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\"\n                , Space\n                , Str \"Test\"\n                , Space\n                , Str \"Suite\"\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Str \"John\"\n      , SoftBreak\n      , Str \"Gruber\\8217s\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , Header\n      1\n      ( \"headers\" , [] , [ ( \"role\" , \"sect1role\" ) ] )\n      [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\"\n      , []\n      , [ ( \"role\" , \"sect2role\" ) ]\n      )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"level-4\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"level-5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Para [ Str \"Hi.\" ]\n  , Header\n      1 ( \"level-1\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"level-2-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      3 ( \"level-3\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header\n      4\n      ( \"\" , [ \"unnumbered\" ] , [] )\n      [ Str \"Level\" , Space , Str \"4\" ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"unnumbered\"\n      , Space\n      , Str \"section.\"\n      ]\n  , Header\n      2 ( \"level-2\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Div\n      ( \"\"\n      , []\n      , [ ( \"wrapper\" , \"1\" ) , ( \"role\" , \"pararole\" ) ]\n      )\n      [ Para\n          [ Str \"And\"\n          , Space\n          , Str \"here\\8217s\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"regular\"\n          , Space\n          , Str \"paragraph\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"role.\"\n          ]\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , Space\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , SoftBreak\n      , Str \"item.\"\n      , Space\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , SoftBreak\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , Space\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , Div\n      ( \"\"\n      , []\n      , [ ( \"wrapper\" , \"1\" ) , ( \"role\" , \"roleblockquote\" ) ]\n      )\n      [ BlockQuote\n          [ Para\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"block\"\n              , Space\n              , Str \"quote\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"role.\"\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , CodeBlock\n          ( \"\" , [ \"numberLines\" ] , [] )\n          \"sub status {\\n    print \\\"working with line numbers\\\";\\n}\"\n      , CodeBlock ( \"\" , [] , [] ) \"% ls\"\n      , Para [ Str \"A\" , Space , Str \"list:\" ]\n      , OrderedList\n          ( 1 , Decimal , DefaultDelim )\n          [ [ Para [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Para [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quotes:\"\n          ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \">\"\n      , Space\n      , Str \"1.\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"with\" , Space , Str \"role:\" ]\n  , Div\n      ( \"\"\n      , []\n      , [ ( \"wrapper\" , \"1\" ) , ( \"role\" , \"listrole\" ) ]\n      )\n      [ OrderedList\n          ( 1 , Decimal , DefaultDelim )\n          [ [ Para [ Str \"First\" ] ]\n          , [ Para [ Str \"Second\" ] ]\n          , [ Para [ Str \"Third\" ] ]\n          ]\n      ]\n  , Para [ Str \"and\" , Space , Str \"tight:\" ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Plain [ Str \"One\" ] ]\n      , [ Plain [ Str \"Two\" ] ]\n      , [ Plain [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog\\8217s\"\n            , SoftBreak\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Para [ Str \"Tab\" ]\n        , BulletList\n            [ [ Para [ Str \"Tab\" ]\n              , BulletList [ [ Para [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Same\"\n      , Space\n      , Str \"thing\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"paragraphs:\"\n      ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"tabs-and-spaces\" , [] , [] )\n      [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"tabs\"\n            ]\n        ]\n      , [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            ]\n        , BulletList\n            [ [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"tabs\"\n                  ]\n              ]\n            , [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"spaces\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , OrderedList\n      ( 2 , Decimal , DefaultDelim )\n      [ [ Para\n            [ Str \"begins\" , Space , Str \"with\" , Space , Str \"2\" ]\n        ]\n      , [ Para [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n        , Para\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"continuation\"\n            ]\n        , OrderedList\n            ( 4 , LowerRoman , DefaultDelim )\n            [ [ Para\n                  [ Str \"sublist\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"roman\"\n                  , Space\n                  , Str \"numerals,\"\n                  , Space\n                  , Str \"starting\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"4\"\n                  ]\n              ]\n            , [ Para [ Str \"more\" , Space , Str \"items\" ]\n              , OrderedList\n                  ( 1 , UpperAlpha , DefaultDelim )\n                  [ [ Para [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  , [ Para [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Nesting:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , DefaultDelim )\n      [ [ Para [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , DefaultDelim )\n            [ [ Para [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , DefaultDelim )\n                  [ [ Para\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , DefaultDelim )\n                        [ [ Para\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Para [ Str \"Autonumber.\" ] ]\n      , [ Para [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , Decimal , DefaultDelim )\n            [ [ Para [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"Should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item:\"\n      ]\n  , Para [ Str \"M.A.\\160\\&2007\" ]\n  , Para [ Str \"B.\" , Space , Str \"Williams\" ]\n  , Header 2 ( \"callout\" , [] , [] ) [ Str \"Callout\" ]\n  , Para [ Str \"Simple.\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"A\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"__letrec\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"equivalent\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"normal\"\n            , SoftBreak\n            , Str \"Haskell\"\n            , Space\n            , Str \"LET.\"\n            ]\n        ]\n      , [ Para\n            [ Str \"GHC\"\n            , Space\n            , Str \"compiled\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"body\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"our\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"comprehension\"\n            , Space\n            , Str \"into\"\n            , SoftBreak\n            , Str \"a\"\n            , Space\n            , Str \"loop\"\n            , Space\n            , Str \"named\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"go_s1YC\"\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"If\"\n            , Space\n            , Str \"our\"\n            , Space\n            , Str \"CASE\"\n            , Space\n            , Str \"expression\"\n            , Space\n            , Str \"matches\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"empty\"\n            , Space\n            , Str \"list,\"\n            , Space\n            , Str \"we\"\n            , SoftBreak\n            , Str \"return\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"empty\"\n            , Space\n            , Str \"list.\"\n            , Space\n            , Str \"This\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"reassuringly\"\n            , SoftBreak\n            , Str \"familiar.\"\n            ]\n        ]\n      ]\n  , Header\n      1\n      ( \"definition-lists\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"Lists\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"italics:\"\n      ]\n  , DefinitionList\n      [ ( [ Emph [ Str \"apple\" ] ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n            , Para\n                [ Str \"contains\"\n                , Space\n                , Str \"seeds,\"\n                , Space\n                , Str \"crisp,\"\n                , Space\n                , Str \"pleasant\"\n                , Space\n                , Str \"to\"\n                , Space\n                , Str \"taste\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Emph [ Str \"orange\" ] ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , CodeBlock ( \"\" , [] , [] ) \"{ orange code block }\"\n            , BlockQuote\n                [ Para\n                    [ Str \"orange\"\n                    , Space\n                    , Str \"block\"\n                    , Space\n                    , Str \"quote\"\n                    ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"definitions,\"\n      , Space\n      , Str \"loose:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"bank\" ] ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Blank\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"term,\"\n      , Space\n      , Str \"indented\"\n      , Space\n      , Str \"marker,\"\n      , Space\n      , Str \"alternate\"\n      , Space\n      , Str \"markers:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , OrderedList\n                ( 1 , Decimal , DefaultDelim )\n                [ [ Para [ Str \"sublist\" ] ]\n                , [ Para [ Str \"sublist\" ] ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , SoftBreak , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , SoftBreak\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , Space , Str \"link\" ]\n              ( \"/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , SoftBreak\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , SoftBreak\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"role.\"\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Span\n          ( \"\" , [ \"phraserole\" ] , [ ( \"role\" , \"phraserole\" ) ] )\n          [ Str \"this\" ]\n      , Space\n      , Str \"phrase\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"role.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"More\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"Class\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"Type\"\n      ]\n  , Para\n      [ Str \"Referencing\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"man\"\n      , Space\n      , Str \"page:\"\n      , Space\n      , Code ( \"\" , [ \"citerefentry\" ] , [] ) \"nix.conf(5)\"\n      ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , SoftBreak\n          , Emph [ Str \"strikeout\" ]\n          , Str \".\"\n          ]\n      ]\n  , Para\n      [ Str \"Superscripts:\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"bc\" ]\n      , Str \"d\"\n      , SoftBreak\n      , Str \"a\"\n      , Superscript [ Emph [ Str \"hello\" ] ]\n      , SoftBreak\n      , Str \"a\"\n      , Superscript [ Str \"hello\\160there\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Subscripts:\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"2\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"23\" ]\n      , Str \"O,\"\n      , SoftBreak\n      , Str \"H\"\n      , Subscript [ Str \"many\\160of\\160them\" ]\n      , Str \"O.\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"superscripts\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"subscripts,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"unescaped\"\n      , SoftBreak\n      , Str \"spaces:\"\n      , Space\n      , Str \"a^b\"\n      , Space\n      , Str \"c^d,\"\n      , Space\n      , Str \"a~b\"\n      , Space\n      , Str \"c~d.\"\n      ]\n  , Header\n      1\n      ( \"smart-quotes-ellipses-dashes\" , [] , [] )\n      [ Str \"Smart\"\n      , Space\n      , Str \"quotes,\"\n      , Space\n      , Str \"ellipses,\"\n      , Space\n      , Str \"dashes\"\n      ]\n  , Para\n      [ Quoted DoubleQuote [ Str \"Hello,\" ]\n      , Space\n      , Str \"said\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"spider.\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Quoted SingleQuote [ Str \"Shelob\" ]\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"my\"\n          , SoftBreak\n          , Str \"name.\"\n          ]\n      ]\n  , Para\n      [ Quoted DoubleQuote [ Str \"A\" ]\n      , Str \",\"\n      , Space\n      , Quoted DoubleQuote [ Str \"B\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted DoubleQuote [ Str \"C\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"letters.\"\n      ]\n  , Para\n      [ Quoted\n          DoubleQuote\n          [ Str \"He\"\n          , Space\n          , Str \"said,\"\n          , Space\n          , Quoted\n              SingleQuote\n              [ Str \"I\"\n              , Space\n              , Str \"want\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"go.\"\n              ]\n          ]\n      , Space\n      , Str \"Were\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"alive\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"70\\8217s?\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one\\8212two\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"three\\8212four\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"five.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"numbers:\"\n      , Space\n      , Str \"5\\8211\\&7,\"\n      , Space\n      , Str \"255\\8211\\&66,\"\n      , Space\n      , Str \"1987\\8211\\&1999.\"\n      ]\n  , Para [ Str \"Ellipses\\8230and\\8230and\\8230.\" ]\n  , Header 1 ( \"math\" , [] , [] ) []\n  , Para\n      [ Math DisplayMath \"e = mc^{2}\"\n      , Math DisplayMath \"1\"\n      , SoftBreak\n      , Math InlineMath \"e = mc^{2}\"\n      , SoftBreak\n      , Math DisplayMath \"e = mc^{2}\"\n      ]\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n        ]\n      , [ Para\n            [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Para [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Para\n            [ Str \"set\"\n            , Space\n            , Str \"membership:\"\n            , Space\n            , Str \"\\8712\"\n            ]\n        ]\n      , [ Para [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"with_underscore\" ]\n          ( \"/url/with_underscore\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"nobody@nowhere.net\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"reference\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"[not][]\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"[not]: /url\"\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"biz\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"with-ampersands\" , [] , [] )\n      [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , SoftBreak\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"AT&T\" ] ( \"http://att.com/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\" , Space , Str \"link\" ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"pointy\"\n          , SoftBreak\n          , Str \"braces\"\n          ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n        ]\n      , [ Para\n            [ Link\n                ( \"\" , [] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Para [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"nobody@nowhere.net\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , SoftBreak\n          , Link\n              ( \"\" , [] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Auto-links\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"occur\"\n      , Space\n      , Str \"here:\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] ) \"or here: <http://example.com/>\"\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"Voyage\"\n          , Space\n          , Str \"dans\"\n          , Space\n          , Str \"la\"\n          , Space\n          , Str \"Lune\"\n          ]\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"lalune\"\n             , Space\n             , Str \"fig\"\n             , Space\n             , Str \"caption\"\n             ]\n         ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] )\n              [ Str \"lalune\"\n              , Space\n              , Str \"alt\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"shadowed\"\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"fig\"\n              , Space\n              , Str \"caption\"\n              ]\n              ( \"lalune.jpg\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      , SoftBreak\n      , Str \"And\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"second\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image\n          ( \"\" , [] , [] )\n          [ Str \"alt\" , Space , Str \"text\" ]\n          ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      , SoftBreak\n      , Str \"And\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"third\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image\n          ( \"\" , [] , [] )\n          [ Str \"alt\" , Space , Str \"text\" ]\n          ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] )\n          [ Str \"lalune\"\n          , Space\n          , Str \"no\"\n          , Space\n          , Str \"figure\"\n          , Space\n          , Str \"alt\"\n          , Space\n          , Str \"text\"\n          ]\n          ( \"lalune.jpg\" , \"\" )\n      ]\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Note\n          [ Para\n              [ Str \"Here\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"go\"\n              , Space\n              , Str \"anywhere\"\n              , Space\n              , Str \"after\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote\"\n              , Space\n              , Str \"reference.\"\n              , SoftBreak\n              , Str \"It\"\n              , Space\n              , Str \"need\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"placed\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"end\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"document.\"\n              ]\n          ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"another.\"\n      , Note\n          [ Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"long\"\n              , Space\n              , Str \"note.\"\n              , Space\n              , Str \"This\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"contains\"\n              , Space\n              , Str \"multiple\"\n              , Space\n              , Str \"blocks.\"\n              ]\n          , Para\n              [ Str \"Subsequent\"\n              , Space\n              , Str \"blocks\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"indented\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"show\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"they\"\n              , Space\n              , Str \"belong\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"the\"\n              , SoftBreak\n              , Str \"footnote\"\n              , Space\n              , Str \"(as\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"list\"\n              , Space\n              , Str \"items).\"\n              ]\n          , CodeBlock ( \"\" , [] , [] ) \"  { <code> }\"\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"want,\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"every\"\n              , Space\n              , Str \"line,\"\n              , Space\n              , Str \"but\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"also\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"lazy\"\n              , Space\n              , Str \"and\"\n              , SoftBreak\n              , Str \"just\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"first\"\n              , Space\n              , Str \"line\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"each\"\n              , Space\n              , Str \"block.\"\n              ]\n          ]\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Emph [ Str \"not\" ]\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , SoftBreak\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"contains\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"space.[^my\"\n      , Space\n      , Str \"note]\"\n      , Space\n      , Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"note.\"\n      , Note\n          [ Para\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Emph [ Str \"easier\" ]\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"type.\"\n              , Space\n              , Str \"Inline\"\n              , Space\n              , Str \"notes\"\n              , Space\n              , Str \"may\"\n              , Space\n              , Str \"contain\"\n              , SoftBreak\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"links\" ]\n                  ( \"http://google.com\" , \"\" )\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"]\"\n              , SoftBreak\n              , Str \"verbatim\"\n              , Space\n              , Str \"characters,\"\n              , Space\n              , Str \"as\"\n              , Space\n              , Str \"well\"\n              , Space\n              , Str \"as\"\n              , Space\n              , Str \"[bracketed\"\n              , Space\n              , Str \"text].\"\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Notes\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"go\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"quotes.\"\n          , Note [ Para [ Str \"In\" , Space , Str \"quote.\" ] ]\n          ]\n      ]\n  , OrderedList\n      ( 1 , Decimal , DefaultDelim )\n      [ [ Para\n            [ Str \"And\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items.\"\n            , Note [ Para [ Str \"In\" , Space , Str \"list.\" ] ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"part\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"note,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"indented.\"\n      ]\n  , Header 1 ( \"tables\" , [] , [] ) [ Str \"Tables\" ]\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"caption:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"Demonstration\"\n             , Space\n             , Str \"of\"\n             , Space\n             , Str \"simple\"\n             , Space\n             , Str \"table\"\n             , Space\n             , Str \"syntax.\"\n             ]\n         ])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Center\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"caption:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Center\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"indented\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"spaces:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"Demonstration\"\n             , Space\n             , Str \"of\"\n             , Space\n             , Str \"simple\"\n             , Space\n             , Str \"table\"\n             , Space\n             , Str \"syntax.\"\n             ]\n         ])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Center\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Multiline\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"caption:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"Here's\"\n             , Space\n             , Str \"the\"\n             , Space\n             , Str \"caption.\"\n             , Space\n             , Str \"It\"\n             , Space\n             , Str \"may\"\n             , Space\n             , Str \"span\"\n             , Space\n             , Str \"multiple\"\n             , Space\n             , Str \"lines.\"\n             ]\n         ])\n      [ ( AlignCenter , ColWidth 0.2 )\n      , ( AlignLeft , ColWidth 0.2 )\n      , ( AlignRight , ColWidth 0.3 )\n      , ( AlignLeft , ColWidth 0.3 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Centered\" , Space , Str \"Header\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" , Space , Str \"Aligned\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" , Space , Str \"Aligned\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"First\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Example\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"spans\"\n                      , Space\n                      , Str \"multiple\"\n                      , Space\n                      , Str \"lines.\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Second\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Here's\"\n                      , Space\n                      , Str \"another\"\n                      , Space\n                      , Str \"one.\"\n                      , Space\n                      , Str \"Note\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"blank\"\n                      , Space\n                      , Str \"line\"\n                      , Space\n                      , Str \"between\"\n                      , Space\n                      , Str \"rows.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"attributes\"\n      ]\n  , Table\n      ( \"mytableid1\"\n      , [ \"mytableclass1\" , \"mytableclass2\" ]\n      , [ ( \"role\" , \"tablerole1\" )\n        , ( \"custom-style\" , \"mytabstyle1\" )\n        ]\n      )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"Attribute\"\n             , Space\n             , Str \"table\"\n             , Space\n             , Str \"caption\"\n             ]\n         ])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"body\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"1\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"body\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"attributes,\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"caption\"\n      ]\n  , Table\n      ( \"mytableid2\"\n      , [ \"mytableclass3\" , \"mytableclass4\" ]\n      , [ ( \"role\" , \"tablerole2\" )\n        , ( \"custom-style\" , \"mytabstyle2\" )\n        ]\n      )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"body\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"1\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para\n                      [ Str \"body\"\n                      , Space\n                      , Str \"cell\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Multiline\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"caption:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidth 0.1 )\n      , ( AlignLeft , ColWidth 0.2 )\n      , ( AlignRight , ColWidth 0.3 )\n      , ( AlignLeft , ColWidth 0.4 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Centered\" , Space , Str \"Header\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" , Space , Str \"Aligned\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" , Space , Str \"Aligned\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"First\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Example\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"spans\"\n                      , Space\n                      , Str \"multiple\"\n                      , Space\n                      , Str \"lines.\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Second\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Here's\"\n                      , Space\n                      , Str \"another\"\n                      , Space\n                      , Str \"one.\"\n                      , Space\n                      , Str \"Note\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"blank\"\n                      , Space\n                      , Str \"line\"\n                      , Space\n                      , Str \"between\"\n                      , Space\n                      , Str \"rows.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"headers:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignRight , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Multiline\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"headers:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidth 0.25 )\n      , ( AlignLeft , ColWidth 0.25 )\n      , ( AlignRight , ColWidth 0.25 )\n      , ( AlignLeft , ColWidth 0.25 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"First\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Example\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"spans\"\n                      , Space\n                      , Str \"multiple\"\n                      , Space\n                      , Str \"lines.\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Second\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Here's\"\n                      , Space\n                      , Str \"another\"\n                      , Space\n                      , Str \"one.\"\n                      , Space\n                      , Str \"Note\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"blank\"\n                      , Space\n                      , Str \"line\"\n                      , Space\n                      , Str \"between\"\n                      , Space\n                      , Str \"rows.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Multiline\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"cells\"\n      , Space\n      , Str \"spanning\"\n      , Space\n      , Str \"multiple\"\n      , Space\n      , Str \"columns\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"rows\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"caption.\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignLeft , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 3)\n                 [ Plain [ Str \"Columns\" ] ]\n             ]\n         , Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"A\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"B\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"C\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 2)\n                  [ Plain\n                      [ Str \"A1\" , Space , Str \"+\" , Space , Str \"B1\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 2)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"C1\" , Space , Str \"+\" , Space , Str \"C2\" ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 2)\n                  (ColSpan 2)\n                  [ Plain\n                      [ Str \"A2\"\n                      , Space\n                      , Str \"+\"\n                      , Space\n                      , Str \"B2\"\n                      , Space\n                      , Str \"+\"\n                      , Space\n                      , Str \"A3\"\n                      , Space\n                      , Str \"+\"\n                      , Space\n                      , Str \"B3\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"C3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"A\" , Space , Str \"Step\" ] ]\n      , [ Para [ Str \"Another\" , Space , Str \"Step\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Para\n                  [ Str \"Substeps\"\n                  , Space\n                  , Str \"can\"\n                  , Space\n                  , Str \"be\"\n                  , Space\n                  , Str \"nested\"\n                  , Space\n                  , Str \"indefinitely\"\n                  , Space\n                  , Str \"deep.\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Para\n            [ Str \"A\" , Space , Str \"Final\" , Space , Str \"Step\" ]\n        ]\n      ]\n  , Header\n      1\n      ( \"indexterms\" , [] , [] )\n      [ Str \"Index\" , Space , Str \"terms\" ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"simplest\"\n      , Space\n      , Str \"case,\"\n      , Space\n      , Str \"index\"\n      , Space\n      , Str \"terms\"\n      , Span\n          ( \"\" , [ \"indexterm\" ] , [ ( \"primary\" , \"index term\" ) ] )\n          []\n      , Space\n      , Str \"consists\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<primary>\"\n      , Space\n      , Str \"element,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Span\n          ( \"\"\n          , [ \"indexterm\" ]\n          , [ ( \"primary\" , \"index term\" )\n            , ( \"secondary\" , \"multi-level\" )\n            ]\n          )\n          []\n      , Space\n      , Str \"they\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"consist\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<primary>\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<secondary>\"\n      , Space\n      , Str \"element,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Span\n          ( \"\"\n          , [ \"indexterm\" ]\n          , [ ( \"primary\" , \"index term\" )\n            , ( \"secondary\" , \"multi-level\" )\n            , ( \"tertiary\" , \"3-level\" )\n            ]\n          )\n          []\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"even\"\n      , Space\n      , Str \"include\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<tertiary>\"\n      , Space\n      , Str \"term.\"\n      ]\n  , Para\n      [ Str \"Index\"\n      , Space\n      , Str \"terms\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"refer\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"index\"\n      , Space\n      , Str \"terms:\"\n      , Space\n      , Span\n          ( \"\"\n          , [ \"indexterm\" ]\n          , [ ( \"primary\" , \"index cross referencing\" ) ]\n          )\n          []\n      , Span\n          ( \"\"\n          , [ \"indexterm\" ]\n          , [ ( \"primary\" , \"index term\" )\n            , ( \"secondary\" , \"cross references\" )\n            , ( \"see\" , \"index cross referencing\" )\n            ]\n          )\n          []\n      , Str \"exclusively,\"\n      , Space\n      , Str \"using\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<see>\"\n      , Space\n      , Str \"tag;\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Span\n          ( \"\"\n          , [ \"indexterm\" ]\n          , [ ( \"primary\" , \"index cross referencing\" )\n            , ( \"seealso\" , \"cross referencing\" )\n            ]\n          )\n          []\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"reference\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"related\"\n      , Space\n      , Str \"terms,\"\n      , Space\n      , Str \"using\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<seealso>\"\n      , Space\n      , Str \"tag.\"\n      ]\n  , Para\n      [ Span\n          ( \"\"\n          , [ \"indexterm\" ]\n          , [ ( \"primary\" , \"food\" )\n            , ( \"secondary\" , \"big baguette supreme\" )\n            ]\n          )\n          []\n      , Str \"Nested\"\n      , Space\n      , Str \"content\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"index\"\n      , Space\n      , Str \"term\"\n      , Space\n      , Str \"elements\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"flattened.\"\n      ]\n  , Header\n      1\n      ( \"titleabbrev\"\n      , []\n      , [ ( \"titleabbrev\" , \"Abbr. title\" ) ]\n      )\n      [ Str \"Abbreviated\" , Space , Str \"title\" ]\n  ]\n"
  },
  {
    "path": "test/docbook-xref.docbook",
    "content": "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\"\n          \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">\n<book id='book01'><title>An Example Book</title>\n<chapter id=\"ch01\"><title>XRef Samples</title>\n<para>\nThis paragraph demonstrates several features of\n<sgmltag>XRef</sgmltag>.\n</para>\n<itemizedlist>\n<listitem><para>A straight link generates the\ncross-reference text: <xref linkend=\"ch02\"/>.\n</para></listitem>\n<listitem><para>A link to an element with an\n<sgmltag class=\"attribute\">XRefLabel</sgmltag>:\n<xref linkend=\"ch03\"/>.\n</para></listitem>\n<listitem><para>A link with an\n<sgmltag class=\"attribute\">EndTerm</sgmltag>:\n<xref linkend=\"ch04\" endterm=\"ch04short\"/>.\n</para></listitem>\n<listitem><para>A link to an\n<sgmltag>cmdsynopsis</sgmltag> element: <xref linkend=\"cmd01\"/>.\n</para></listitem>\n<listitem><para>A link to an\n<sgmltag>funcsynopsis</sgmltag> element: <xref linkend=\"func01\"/>.\n</para></listitem>\n<listitem><para>A link to a\n<sgmltag>figure</sgmltag> element: <xref linkend=\"fig01\"/>.\n</para></listitem>\n<listitem><para>A link to a\n<sgmltag>table</sgmltag> element: <xref linkend=\"table01\"/>.\n</para></listitem>\n<listitem><para>A link to a\n<sgmltag>part</sgmltag> element: <xref linkend=\"part01\"/>.\n</para></listitem>\n<listitem><para>A link to a\n<sgmltag>book</sgmltag> element: <xref linkend=\"book01\"/>.\n</para></listitem>\n</itemizedlist>\n</chapter>\n\n<chapter id=\"ch02\">\n  <title>The Second Chapter</title>\n  <para>Some content here</para>\n</chapter>\n\n<part id=\"part01\">\n  <title>Later Part</title>\n\n<chapter id=\"ch03\" xreflabel=\"Chapter the Third\">\n  <title>The Third Chapter</title>\n  <para>Some content here</para>\n</chapter>\n\n<chapter id=\"ch04\">\n  <title>The Fourth Chapter</title>\n  <titleabbrev id=\"ch04short\">Chapter 4</titleabbrev>\n  <para>Some content here</para>\n\n<cmdsynopsis id=\"cmd01\">\n  <command>chgrp</command>\n  <arg>-R\n    <group>\n      <arg>-H</arg>\n      <arg>-L</arg>\n      <arg>-P</arg>\n    </group>\n  </arg>\n  <arg>-f</arg>\n  <arg choice='plain'><replaceable>group</replaceable></arg>\n  <arg rep='repeat' choice='plain'><replaceable>file</replaceable></arg>\n</cmdsynopsis>\n\n\n<funcsynopsis id=\"func01\">\n<funcprototype>\n<funcdef>int <function>max</function></funcdef>\n<paramdef>int <parameter>int1</parameter></paramdef>\n<paramdef>int <parameter>int2</parameter></paramdef>\n</funcprototype>\n</funcsynopsis>\n\n<figure id=\"fig01\"><title>The Pythagorean Theorem Illustrated</title>\n<mediaobject>\n  <imageobject>\n    <imagedata fileref=\"figures/pythag.png\"/>\n  </imageobject>\n  <textobject><phrase>An illustration of the Pythagorean Theorem</phrase></textobject>\n</mediaobject>\n</figure>\n\n<table id=\"table01\" frame=\"all\" rowsep=\"1\" colsep=\"1\">\n  <title>Supported features by version</title>\n  <tgroup cols=\"2\">\n    <colspec colname=\"col_1\" colwidth=\"50*\"/>\n    <colspec colname=\"col_2\" colwidth=\"50*\"/>\n    <thead>\n      <row>\n        <entry>Version</entry>\n        <entry>Feat</entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>Free</entry>\n        <entry>no</entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n\n</chapter>\n</part>\n</book>\n"
  },
  {
    "path": "test/docbook-xref.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"title\"\n            , MetaInlines\n                [ Str \"An\"\n                , Space\n                , Str \"Example\"\n                , Space\n                , Str \"Book\"\n                ]\n            )\n          ]\n    }\n  [ Header\n      2\n      ( \"ch01\" , [] , [] )\n      [ Str \"XRef\" , Space , Str \"Samples\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"demonstrates\"\n      , Space\n      , Str \"several\"\n      , Space\n      , Str \"features\"\n      , Space\n      , Str \"of\"\n      , SoftBreak\n      , Str \"XRef.\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"straight\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"generates\"\n            , Space\n            , Str \"the\"\n            , SoftBreak\n            , Str \"cross-reference\"\n            , Space\n            , Str \"text:\"\n            , Space\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"The\"\n                , Space\n                , Str \"Second\"\n                , Space\n                , Str \"Chapter\"\n                ]\n                ( \"#ch02\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"an\"\n            , Space\n            , Str \"element\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"an\"\n            , SoftBreak\n            , Str \"XRefLabel:\"\n            , SoftBreak\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"Chapter\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"Third\"\n                ]\n                ( \"#ch03\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"an\"\n            , SoftBreak\n            , Str \"EndTerm:\"\n            , SoftBreak\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"Chapter\" , Space , Str \"4\" ]\n                ( \"#ch04\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"an\"\n            , SoftBreak\n            , Str \"cmdsynopsis\"\n            , Space\n            , Str \"element:\"\n            , Space\n            , Link ( \"\" , [] , [] ) [ Str \"chgrp\" ] ( \"#cmd01\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"an\"\n            , SoftBreak\n            , Str \"funcsynopsis\"\n            , Space\n            , Str \"element:\"\n            , Space\n            , Link ( \"\" , [] , [] ) [ Str \"max\" ] ( \"#func01\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"a\"\n            , SoftBreak\n            , Str \"figure\"\n            , Space\n            , Str \"element:\"\n            , Space\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"The\"\n                , Space\n                , Str \"Pythagorean\"\n                , Space\n                , Str \"Theorem\"\n                , Space\n                , Str \"Illustrated\"\n                ]\n                ( \"#fig01\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"a\"\n            , SoftBreak\n            , Str \"table\"\n            , Space\n            , Str \"element:\"\n            , Space\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"Supported\"\n                , Space\n                , Str \"features\"\n                , Space\n                , Str \"by\"\n                , Space\n                , Str \"version\"\n                ]\n                ( \"#table01\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"a\"\n            , SoftBreak\n            , Str \"part\"\n            , Space\n            , Str \"element:\"\n            , Space\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"Later\" , Space , Str \"Part\" ]\n                ( \"#part01\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"A\"\n            , Space\n            , Str \"link\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"a\"\n            , SoftBreak\n            , Str \"book\"\n            , Space\n            , Str \"element:\"\n            , Space\n            , Link\n                ( \"\" , [] , [] )\n                [ Str \"An\"\n                , Space\n                , Str \"Example\"\n                , Space\n                , Str \"Book\"\n                ]\n                ( \"#book01\" , \"\" )\n            , Str \".\"\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"ch02\" , [] , [] )\n      [ Str \"The\" , Space , Str \"Second\" , Space , Str \"Chapter\" ]\n  , Para\n      [ Str \"Some\" , Space , Str \"content\" , Space , Str \"here\" ]\n  , Header\n      1\n      ( \"part01\" , [] , [] )\n      [ Str \"Later\" , Space , Str \"Part\" ]\n  , Header\n      2\n      ( \"ch03\" , [] , [] )\n      [ Str \"The\" , Space , Str \"Third\" , Space , Str \"Chapter\" ]\n  , Para\n      [ Str \"Some\" , Space , Str \"content\" , Space , Str \"here\" ]\n  , Header\n      2\n      ( \"ch04\" , [] , [ ( \"titleabbrev\" , \"Chapter 4\" ) ] )\n      [ Str \"The\" , Space , Str \"Fourth\" , Space , Str \"Chapter\" ]\n  , Para\n      [ Str \"Some\" , Space , Str \"content\" , Space , Str \"here\" ]\n  , Plain [ Str \"chgrp\" ]\n  , Plain [ Str \"-R\" ]\n  , Plain [ Str \"-H\" ]\n  , Plain [ Str \"-L\" ]\n  , Plain [ Str \"-P\" ]\n  , Plain [ Str \"-f\" ]\n  , Plain [ Str \"group\" ]\n  , Plain [ Str \"file\" ]\n  , Plain [ Str \"int\" ]\n  , Plain [ Str \"max\" ]\n  , Plain [ Str \"int\" ]\n  , Plain [ Str \"int1\" ]\n  , Plain [ Str \"int\" ]\n  , Plain [ Str \"int2\" ]\n  , Figure\n      ( \"fig01\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"The\"\n             , Space\n             , Str \"Pythagorean\"\n             , Space\n             , Str \"Theorem\"\n             , Space\n             , Str \"Illustrated\"\n             ]\n         ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] )\n              [ Str \"An\"\n              , Space\n              , Str \"illustration\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"Pythagorean\"\n              , Space\n              , Str \"Theorem\"\n              ]\n              ( \"figures/pythag.png\" , \"\" )\n          ]\n      ]\n  , Table\n      ( \"table01\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"Supported\"\n             , Space\n             , Str \"features\"\n             , Space\n             , Str \"by\"\n             , Space\n             , Str \"version\"\n             ]\n         ])\n      [ ( AlignDefault , ColWidth 0.5 )\n      , ( AlignDefault , ColWidth 0.5 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Version\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Feat\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Free\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"no\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  ]\n"
  },
  {
    "path": "test/docx/0_level_headers.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.8615384615384616 ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"User\\8217s\" , Space , Str \"Guide\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"11\"\n                    , Space\n                    , Str \"August\"\n                    , Space\n                    , Str \"2017\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para [ Str \"CONTENTS\" ]\n, Para [ Strong [ Str \"Section\" , Space , Str \"Page\" ] ]\n, Para\n    [ Str \"FIGURES\"\n    , Space\n    , Link ( \"\" , [] , [] ) [ Str \"iv\" ] ( \"#figures\" , \"\" )\n    ]\n, Para\n    [ Str \"TABLES\"\n    , Space\n    , Link ( \"\" , [] , [] ) [ Str \"v\" ] ( \"#tables\" , \"\" )\n    ]\n, Para\n    [ Str \"SECTION\"\n    , Space\n    , Str \"1\"\n    , Space\n    , Str \"Introduction\"\n    , Space\n    , Link ( \"\" , [] , [] ) [ Str \"2\" ] ( \"#introduction\" , \"\" )\n    ]\n, Header\n    1 ( \"figures\" , [ \"Heading-0\" ] , [] ) [ Str \"FIGURES\" ]\n, Para [ Strong [ Str \"Figure\" , Space , Str \"Page\" ] ]\n, Para\n    [ Strong\n        [ Str \"No\"\n        , Space\n        , Str \"table\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"figures\"\n        , Space\n        , Str \"entries\"\n        , Space\n        , Str \"found.\"\n        ]\n    ]\n, Header\n    1 ( \"tables\" , [ \"Heading-0\" ] , [] ) [ Str \"TABLES\" ]\n, Para [ Strong [ Str \"Table\" , Space , Str \"Page\" ] ]\n, Para\n    [ Strong\n        [ Str \"No\"\n        , Space\n        , Str \"table\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"figures\"\n        , Space\n        , Str \"entries\"\n        , Space\n        , Str \"found.\"\n        ]\n    ]\n, Header\n    1 ( \"introduction\" , [] , [] ) [ Str \"Introduction\" ]\n, Para\n    [ Str \"Nothing\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"introduce,\"\n    , Space\n    , Str \"yet.\"\n    ]\n]"
  },
  {
    "path": "test/docx/adjacent_codeblocks.native",
    "content": "[Para [Str \"Next,\",Space,Str \"open\",Space,Str \"the\",Space,Str \"terminal\",Space,Str \"window.\",Space,Str \"Using\",Space,Str \"the\",Space,Str \"terminal\",Space,Str \"window,\",Space,Str \"run\",Space,Str \"the\",Space,Str \"\\\"ifconfig\",Space,Str \"-a\\\"\",Space,Str \"command\",Space,Str \"to\",Space,Str \"list\",Space,Str \"all\",Space,Str \"the\",Space,Str \"interfaces\",Space,Str \"on\",Space,Str \"your\",Space,Str \"system,\",Space,Str \"as\",Space,Str \"shown\",Space,Str \"here.\"]\n,CodeBlock (\"\",[],[]) \"# ifconfig -a\\neth0      Link encap:Ethernet  HWaddr 00:0c:29:69:12:7c  \\n          inet addr:172.16.0.108  Bcast:172.16.0.255  Mask:255.255.255.0\\n          inet6 addr: fc00:660:0:1:20c:29ff:fe69:127c/64 Scope:Global\\n          inet6 addr: fe80::20c:29ff:fe69:127c/64 Scope:Link\\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\\n          RX packets:9859 errors:0 dropped:0 overruns:0 frame:0\\n          TX packets:1399 errors:0 dropped:0 overruns:0 carrier:0\\n          collisions:0 txqueuelen:1000 \\n          RX bytes:1920894 (1.8 MiB)  TX bytes:233088 (227.6 KiB)\\n          Interrupt:19 Base address:0x2000 \\n\\nlo        Link encap:Local Loopback  \\n          inet addr:127.0.0.1  Mask:255.0.0.0\\n          inet6 addr: ::1/128 Scope:Host\\n          UP LOOPBACK RUNNING  MTU:65536  Metric:1\\n          RX packets:372 errors:0 dropped:0 overruns:0 frame:0\\n          TX packets:372 errors:0 dropped:0 overruns:0 carrier:0\\n          collisions:0 txqueuelen:0 \\n          RX bytes:22320 (21.7 KiB)  TX bytes:22320 (21.7 KiB)\\n\\nwlan0     Link encap:Ethernet  HWaddr 00:c0:ca:85:00:ba  \\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\\n          collisions:0 txqueuelen:1000 \\n          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)\"\n,Para [Str \"The\",Space,Str \"ALFA\",Space,Str \"wireless\",Space,Str \"card\",Space,Str \"is\",Space,Str \"represented\",Space,Str \"by\",Space,Str \"the\",Space,Str \"\\\"wlan0\\\"\",Space,Str \"interface.\"]\n,Para [Str \"In\",Space,Str \"addition\",Space,Str \"to\",Space,Str \"the\",Space,Str \"interfaces\",Space,Str \"shown\",Space,Str \"in\",Space,Str \"the\",Space,Str \"ifconfig\",Space,Str \"output,\",Space,Str \"there\",Space,Str \"is\",Space,Str \"another\",Space,Str \"interface\",Space,Str \"known\",Space,Str \"as\",Space,Str \"the\",Space,Emph [Str \"wireless\",Space,Str \"physical\",Space,Str \"interface\"],Str \".\",Space,Str \"We\",Space,Str \"can\",Space,Str \"identify\",Space,Str \"this\",Space,Str \"interface\",Space,Str \"by\",Space,Str \"listing\",Space,Str \"the\",Space,Str \"contents\",Space,Str \"of\",Space,Str \"the\",Space,Str \"/sys/class/ieee80211\",Space,Str \"directory,\",Space,Str \"as\",Space,Str \"shown.\"]\n,CodeBlock (\"\",[],[]) \"# ls /sys/class/ieee80211/\\nphy0\"\n,Para [Str \"The\",Space,Str \"\\\"phy0\\\"\",Space,Str \"interface\",Space,Str \"is\",Space,Str \"the\",Space,Str \"parent\",Space,Str \"interface\",Space,Str \"used\",Space,Str \"to\",Space,Str \"create\",Space,Str \"child\",Space,Str \"interfaces.\",Space,Str \"Note\",Space,Str \"that\",Space,Str \"if\",Space,Str \"you\",Space,Str \"unplug\",Space,Str \"and\",Space,Str \"replug\",Space,Str \"the\",Space,Str \"USB\",Space,Str \"interface,\",Space,Str \"the\",Space,Str \"\\\"phy\\\"\",Space,Str \"interface\",Space,Str \"number\",Space,Str \"will\",Space,Str \"increment\",Space,Str \"by\",Space,Str \"one\",Space,Str \"until\",Space,Str \"you\",Space,Str \"reboot\",Space,Str \"your\",Space,Str \"system.\"]]\n"
  },
  {
    "path": "test/docx/already_auto_ident.native",
    "content": "[Header 1 (\"anchor-header\",[],[]) [Str \"Anchor\",Space,Str \"Header\"]\n,Para [Str \"A\",Space,Link (\"\",[],[]) [Str \"link\"] (\"#anchor-header\",\"\")]]\n"
  },
  {
    "path": "test/docx/alternate_document_path.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Header 1 (\"test\",[],[]) [Str \"Test\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Emph [Str \"italic\"],Str \",\",Space,Strong [Str \"bold\"],Str \",\",Space,Underline [Str \"underlined\"],Str \",\",Space,Emph [Underline [Str \"italic\",Space,Str \"underlined\"]],Str \",\",Space,Strong [Underline [Str \"bold\",Space,Str \"underlined\"]],Str \",\",Space,Emph [Strong [Underline [Str \"bold\",Space,Str \"italic\",Space,Str \"underlined\"]]],Str \".\"]]\n"
  },
  {
    "path": "test/docx/anchor_header_after_anchor.native",
    "content": "[Para [Link (\"\",[],[]) [Str \"A\",Space,Str \"link\",Space,Str \"to\",Space,Str \"the\",Space,Str \"bookmark\"] (\"#referenced-title\" , \"\")]\n,Para [Strong [Str \"Accomplices:\"]]\n,Para [Str \"There\",Space,Str \"are\",Space,Str \"bookmarks\",Space,Str \"around\",Space,Str \"here.\"]\n,Para []\n,Header 1 (\"referenced-title\",[],[]) [Str \"Referenced\" ,Space ,Str \"title\"]\n,Para [Str \"Content\"]]\n"
  },
  {
    "path": "test/docx/block_quotes.native",
    "content": "[Header 2 (\"some-block-quotes-in-different-ways\",[],[]) [Str \"Some\",Space,Str \"block\",Space,Str \"quotes,\",Space,Str \"in\",Space,Str \"different\",Space,Str \"ways\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"proper\",Space,Str \"way,\",Space,Str \"with\",Space,Str \"a\",Space,Str \"style\"]\n,BlockQuote\n [Para [Str \"I\",Space,Str \"don\\8217t\",Space,Str \"know\",Space,Str \"why\",Space,Str \"this\",Space,Str \"would\",Space,Str \"be\",Space,Str \"in\",Space,Str \"italics,\",Space,Str \"but\",Space,Str \"so\",Space,Str \"it\",Space,Str \"appears\",Space,Str \"to\",Space,Str \"be\",Space,Str \"on\",Space,Str \"my\",Space,Str \"screen.\"]]\n,Para [Str \"And\",Space,Str \"this\",Space,Str \"is\",Space,Str \"also\",Space,Str \"a\",Space,Str \"proper\",Space,Str \"way,\",Space,Str \"with\",Space,Str \"a\",Space,Str \"different\", Space, Str \"style\"]\n,BlockQuote\n [Para [Str \"This\",Space,Str \"is\",Space,Str \"called\",Space,Str \"the\",Space,Str \"Intense\",Space,Str \"Quote\",Space,Str \"style.\"]]\n,Para [Str \"And\",Space,Str \"this\",Space,Str \"is\",Space,Str \"the\",Space,Str \"way\",Space,Str \"that\",Space,Str \"most\",Space,Str \"people\",Space,Str \"do\",Space,Str \"it:\"]\n,BlockQuote\n [Para [Str \"I\",Space,Str \"just\",Space,Str \"indented\",Space,Str \"this,\",Space,Str \"so\",Space,Str \"it\",Space,Str \"looks\",Space,Str \"like\",Space,Str \"a\",Space,Str \"block\",Space,Str \"quote.\",Space,Str \"I\",Space,Str \"think\",Space,Str \"this\",Space,Str \"is\",Space,Str \"how\",Space,Str \"most\",Space,Str \"people\",Space,Str \"do\",Space,Str \"block\",Space,Str \"quotes\",Space,Str \"in\",Space,Str \"their\",Space,Str \"documents.\"]]\n,Para [Str \"And\",Space,Str \"back\",Space,Str \"to\",Space,Str \"the\",Space,Str \"normal\",Space,Str \"style.\"]]\n"
  },
  {
    "path": "test/docx/char_styles.native",
    "content": "[Para [Emph [Str \"This\",Space,Str \"is\",Space,Str \"all\",Space,Str \"in\",Space,Str \"an\"],Space,Emph [Strong [Str \"italic\",Space,Str \"style\"],Str \".\"]]\n,Para [Emph [Str \"This\",Space,Str \"is\",Space,Str \"an\",Space,Str \"italic\"],Space,Str \"style\",Space,Emph [Str \"with\",Space,Str \"some\"],Space,Str \"words\",Space,Emph [Str \"unitalicized.\"]]\n,Para [Strong [Str \"This\",Space,Str \"is\",Space,Str \"all\",Space,Str \"in\",Space,Str \"a\",Space,Emph [Str \"strong\",Space,Str \"style\"],Str \".\"]]\n,Para [Strong [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"strong\"],Space,Str \"style\",Space,Strong [Str \"with\",Space,Str \"some\"],Space,Str \"words\",Space,Strong [Str \"ubolded.\"]]]\n"
  },
  {
    "path": "test/docx/codeblock.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"some\",Space,Str \"code:\"]\n,CodeBlock (\"\",[],[]) \"readDocx :: ReaderOptions\\n         -> B.ByteString\\n         -> Pandoc\"\n,Para [Str \"from\",Space,Str \"the\",Space,Str \"beginning\",Space,Str \"of\",Space,Str \"the\",Space,Str \"docx\",Space,Str \"reader.\"]]\n"
  },
  {
    "path": "test/docx/comments.native",
    "content": "[Para [Str \"I\",Space,Str \"want\",Space,Span (\"\",[\"comment-start\"],[(\"id\",\"0\"),(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-05-09T16:13:00Z\")]) [Str \"I\",Space,Str \"left\",Space,Str \"a\",Space,Str \"comment.\"],Str \"some\",Space,Str \"text\",Space,Str \"to\",Space,Str \"have\",Space,Str \"a\",Space,Str \"comment\",Space,Span (\"\",[\"comment-end\"],[(\"id\",\"0\")]) [],Str \"on\",Space,Str \"it.\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Span (\"\",[\"comment-start\"],[(\"id\",\"1\"),(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-05-09T16:13:00Z\")]) [Str \"A\",Space,Str \"comment\",Space,Str \"across\",Space,Str \"paragraphs.\"],Str \"a\",Space,Str \"new\",Space,Str \"paragraph.\"]\n,Para [Str \"And\",Space,Str \"so\",Span (\"\",[\"comment-end\"],[(\"id\",\"1\")]) [],Space,Str \"is\",Space,Str \"this.\"]\n,Para [Str \"One\",Space,Span (\"\",[\"comment-start\"],[(\"id\",\"2\"),(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-05-09T16:14:00Z\")]) [Str \"This\",Space,Str \"one\",Space,Str \"has\",Space,Str \"multiple\",Space,Str \"paragraphs.\",LineBreak, Str \"See?\"],Str \"more\",Span (\"\",[\"comment-end\"],[(\"id\",\"2\")]) [],Str \".\",Space,Str \"And\",Space,Str \"this\",Space,Str \"is\",Space,Str \"one\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[\"comment-start\"],[(\"id\",\"3\"),(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-06-22T14:35:00Z\")]) [Str \"Do\",Space,Str \"something.\"],Span (\"\",[\"comment-start\"],[(\"id\",\"4\"),(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-06-22T14:36:00Z\")]) [Str \"Do\",Space,Str \"something\",Space,Str \"else.\"],Str \"comment\",Space,Str \"in\",Space,Str \"a\",Space,Str \"comment\",Span (\"\",[\"comment-end\"],[(\"id\",\"3\")]) [Span (\"\",[\"comment-end\"],[(\"id\",\"4\")]) []],Str \".\"]]\n"
  },
  {
    "path": "test/docx/comments_no_comments.native",
    "content": "[Para [Str \"I\",Space,Str \"want\",Space,Str \"some\",Space,Str \"text\",Space,Str \"to\",Space,Str \"have\",Space,Str \"a\",Space,Str \"comment\",Space,Str \"on\",Space,Str \"it.\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"new\",Space,Str \"paragraph.\"]\n,Para [Str \"And\",Space,Str \"so\",Space,Str \"is\",Space,Str \"this.\"]\n,Para [Str \"One\",Space,Str \"more.\",Space,Str \"And\",Space,Str \"this\",Space,Str \"is\",Space,Str \"one\",Space,Str \"with\",Space,Str \"a\",Space,Str \"comment\",Space,Str \"in\",Space,Str \"a\",Space,Str \"comment.\"]]\n"
  },
  {
    "path": "test/docx/compact-style-removal.native",
    "content": "[OrderedList (1,Decimal,Period)\n [[Plain [Str \"One\"]]\n ,[Plain [Str \"Two\"]]\n ,[Plain [Str \"Three\"]]\n ,[Plain [Str \"Four\"]]]]\n"
  },
  {
    "path": "test/docx/cross_reference.native",
    "content": "[ Header 1 ( \"title\" , [] , [] ) [ Str \"TITLE\" ]\n, Para\n    [ Str \"Cross-reference:\"\n    , Space\n    , Link ( \"\" , [] , [] ) [ Str \"TITLE\" ] ( \"#title\" , \"\" )\n    ]\n]\n"
  },
  {
    "path": "test/docx/custom-style-no-styles.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"some\",Space,Str \"text.\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"text\",Space,Str \"with\",Space,Str \"an\",Space,Emph [Str \"emphasized\"],Space,Str \"text\",Space,Str \"style.\",Space,Str \"And\",Space,Str \"this\",Space,Str \"is\",Space,Str \"text\",Space,Str \"with\",Space,Str \"a\",Space,Strong [Str \"strengthened\"],Space,Str \"text\",Space,Str \"style.\"]\n,BlockQuote\n [Para [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"styled\",Space,Str \"paragraph\",Space,Str \"that\",Space,Str \"inherits\",Space,Str \"from\",Space,Str \"Block\",Space,Str \"Text.\"]]]\n"
  },
  {
    "path": "test/docx/custom-style-preserve.native",
    "content": "[Para [Span (\"\",[],[(\"custom-style\",\"MyStyle\")]) [Str \"This\",Space,Str \"span\",Note [Para [Str \"Neither\",Space,Str \"footnote\",Space,Str \"nor\",Space,Str \"footnote\",Space,Str \"reference\",Space,Str \"should\",Space,Str \"get\",Space,Str \"a\",Space,Str \"custom\",Space,Str \"style\",Space,Str \"from\",Space,Str \"its\",Space,Str \"span.\"]],Space,Str \"should\",Space,Str \"have\",Space,Str \"a\",Space,Str \"custom\",Space,Str \"style\",Space,Str \"(\",Link (\"\",[],[]) [Str \"link\"] (\"http://example.com/\",\"\"),Str \"),\"],Space,Str \"but\",Space,Str \"the\",Space,Str \"text\",Space,Str \"after\",Space,Str \"the\",Space,Str \"comma\",Space,Str \"shouldn\\8217t,\",Space,Str \"nor\",Space,Str \"should\",Space,Str \"the\",Space,Str \"link.\"]\n,Div (\"\",[],[(\"custom-style\",\"MyOtherStyle\")])\n [Para [Str \"The\",Space,Str \"contents\",Space,Str \"of\",Space,Str \"this\",Space,Str \"div\",Space,Str \"should\",Space,Str \"have\",Space,Str \"a\",Space,Str \"custom\",Space,Str \"style,\",Space,Str \"but\",Space,Link (\"\",[],[]) [Str \"this\",Space,Str \"link\",Space,Str \"should\",Space,Str \"not\"] (\"http://example.com/\",\"\"),Str \".\"]\n ,Header 2 (\"this-header-should-not-have-the-divs-custom-style\",[],[]) [Str \"This\",Space,Str \"header\",Space,Str \"should\",Space,Str \"not\",Space,Str \"have\",Space,Str \"the\",Space,Str \"div\\8217s\",Space,Str \"custom\",Space,Str \"style\"]\n ,BlockQuote\n  [Para [Str \"This\",Space,Str \"blockquote\",Space,Str \"should\",Space,Str \"not.\"]]\n ,CodeBlock (\"\",[],[]) \"# This code block should not.\"\n ,Para [Str \"But\",Space,Str \"this\",Space,Str \"paragraph\",Space,Str \"should.\",Note [Para [Str \"Neither\",Space,Str \"footnote\",Space,Str \"nor\",Space,Str \"footnote\",Space,Str \"reference\",Space,Str \"should\",Space,Str \"get\",Space,Str \"a\",Space,Str \"custom\",Space,Str \"style\",Space,Str \"from\",Space,Str \"its\",Space,Str \"div.\"]]]]\n,Div (\"\",[],[(\"custom-style\",\"MyOuterStyle\")])\n [Div (\"\",[],[(\"custom-style\",\"MyInnerStyle\")])\n  [Para [Str \"This\",Space,Str \"should\",Space,Str \"have\",Space,Str \"MyInnerStyle.\"]\n  ,Header 3 (\"this-heading-should-not\",[],[]) [Str \"This\",Space,Str \"heading\",Space,Str \"should\",Space,Str \"not\"]]\n ,Para [Str \"This\",Space,Str \"should\",Space,Str \"have\",Space,Str \"MyOuterStyle,\",Space,Str \"but\",Space,Str \"the\",Space,Str \"following\",Space,Str \"elision\",Space,Str \"should\",Space,Str \"have\",Space,Str \"its\",SoftBreak,Str \"own\",Space,Str \"style.\",Space,Span (\"\",[],[(\"custom-style\",\"Elision\")]) [Str \"...\"]]\n ,BlockQuote\n  [Para [Str \"This\",Space,Str \"blockquote\",Space,Str \"should\",Space,Str \"include\",Space,Strong [Str \"bold\",Space,Str \"text\",Space,Str \"with\",Space,Str \"an\",Space,Str \"elision:\",SoftBreak,Span (\"\",[],[(\"custom-style\",\"Elision\")]) [Str \"...\"]]]]]]\n"
  },
  {
    "path": "test/docx/custom-style-roundtrip-end.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"test\",Space,Str \"of\",Space,Str \"custom-styles.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"something\",Space,Emph [Str \"emphasized\"],Str \".\",Space,Str \"And\",Space,Str \"here\",Space,Str \"is\",Space,Str \"something\",Space,Strong [Str \"strong\"],Str \".\"]\n,BlockQuote\n [Para [Str \"One\",Space,Str \"paragraph\",Space,Str \"of\",Space,Str \"text.\"]\n ,Para [Str \"And\",Space,Str \"another\",Space,Str \"paragraph\",Space,Str \"of\",Space,Emph [Str \"really\",Space,Str \"cool\"],Space,Str \"text.\"]]]\n"
  },
  {
    "path": "test/docx/custom-style-with-styles.native",
    "content": "[Div (\"\",[],[(\"custom-style\",\"First Paragraph\")])\n [Para [Str \"This\",Space,Str \"is\",Space,Str \"some\",Space,Str \"text.\"]]\n,Div (\"\",[],[(\"custom-style\",\"Body Text\")])\n [Para [Str \"This\",Space,Str \"is\",Space,Str \"text\",Space,Str \"with\",Space,Str \"an\",Space,Span (\"\",[],[(\"custom-style\",\"Emphatic\")]) [Str \"emphasized\"],Space,Str \"text\",Space,Str \"style.\",Space,Str \"And\",Space,Str \"this\",Space,Str \"is\",Space,Str \"text\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[],[(\"custom-style\",\"Strengthened\")]) [Str \"strengthened\"],Space,Str \"text\",Space,Str \"style.\"]]\n,Div (\"\",[],[(\"custom-style\",\"My Block Style\")])\n [BlockQuote\n  [Para [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"styled\",Space,Str \"paragraph\",Space,Str \"that\",Space,Str \"inherits\",Space,Str \"from\",Space,Str \"Block\",Space,Str \"Text.\"]]]]\n"
  },
  {
    "path": "test/docx/custom_style.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"test\",Space,Str \"of\",Space,Str \"custom-styles.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"something\",Space,Span (\"\",[],[(\"custom-style\",\"Emphatic\")]) [Str \"emphasized\"],Str \".\",Space,Str \"And\",SoftBreak,Str \"here\",Space,Str \"is\",Space,Str \"something\",Space,Span (\"\",[],[(\"custom-style\",\"Strengthened\")]) [Str \"strong\"],Str \".\"]\n,Div (\"\",[],[(\"custom-style\",\"My Block Style\")])\n [Para [Str \"One\",Space,Str \"paragraph\",Space,Str \"of\",Space,Str \"text.\"]\n ,Para [Str \"And\",Space,Str \"another\",Space,Str \"paragraph\",Space,Str \"of\",Space,Span (\"\",[],[(\"custom-style\",\"Emphatic\")]) [Str \"really\",SoftBreak,Str \"cool\"],Space,Str \"text.\"]]]\n"
  },
  {
    "path": "test/docx/deep_normalize.native",
    "content": "[OrderedList (1,Decimal,OneParen)\n [[Para [Str \"This\",Space,Str \"is\",Space,Str \"at\",Space,Str \"the\",Space,Str \"first\",Space,Str \"level\"]\n  ,OrderedList (1,LowerAlpha,OneParen)\n   [[Para [Str \"This\",Space,Str \"is\",Space,Str \"at\",Space,Str \"the\",Space,Str \"second\",Space,Str \"level\"]\n    ,OrderedList (1,LowerRoman,OneParen)\n     [[Para [Str \"This\",Space,Str \"is\",Space,Emph [Str \"at\",Space,Strong [Str \"the\",Space,Span (\"\",[\"mark\"],[]) [Str \"th\"],Str \"i\",Span (\"\",[\"mark\"],[]) [Str \"rd\"],Space,Str \"level\"],Str \",\",Space,Str \"and\",Space,Str \"I\",Space,Str \"want\",Space,Str \"to\"],Space,Str \"test\",Space,Str \"normalization\",Space,Str \"here.\"]]]]]]]]\n"
  },
  {
    "path": "test/docx/definition_list.native",
    "content": "[ DefinitionList\n    [ ( [ Str \"Term\" , Space , Str \"1\" ]\n      , [ [ Para [ Str \"Definition\" , Space , Str \"1\" ] ] ]\n      )\n    , ( [ Str \"Term\"\n        , Space\n        , Str \"2\"\n        , Space\n        , Str \"with\"\n        , Space\n        , Emph [ Str \"inline\" , Space , Str \"markup\" ]\n        ]\n      , [ [ Para [ Str \"Definition\" , Space , Str \"2\" ]\n          , Para\n              [ Code\n                  ( \"\" , [] , [] ) \"{ some code, part of Definition 2 }\"\n              ]\n          , Para\n              [ Str \"Third\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"definition\"\n              , Space\n              , Str \"2.\"\n              ]\n          ]\n        ]\n      )\n    ]\n]\n"
  },
  {
    "path": "test/docx/diagram.native",
    "content": "[Header 1 (\"diagram-after\",[],[]) [Str \"Diagram\",Space,Str \"after:\"]\n,Para [Span (\"\",[\"diagram\"],[]) [Str \"[DIAGRAM]\"]]]\n"
  },
  {
    "path": "test/docx/document-properties-short-desc.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"author\",MetaList [MetaInlines [Str \"A.\",Space,Str \"M.\"]]),(\"description\",MetaInlines [Str \"Short\",Space,RawInline (Format \"html\") \"<i>\",Str \"description\",RawInline (Format \"html\") \"</i>\",Space,Str \"&.\"]),(\"keywords\",MetaList [MetaInlines [Str \"keyword\",Space,Str \"1\"],MetaInlines [Str \"keyword\",Space,Str \"2\"]]),(\"subject\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"subject\"]),(\"title\",MetaInlines [Str \"Testing\",Space,Str \"custom\",Space,Str \"properties\"])]})\r\n[Para [Str \"Testing\",Space,Str \"document\",Space,Str \"properties\"]]\r\n"
  },
  {
    "path": "test/docx/document-properties.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"Company\",MetaInlines [Str \"My\",Space,Str \"Company\"]),(\"Second Custom Property\",MetaInlines [Str \"Second\",Space,Str \"custom\",Space,Str \"property\",Space,Str \"value\"]),(\"abstract\",MetaBlocks [Plain [Str \"Quite\",Space,Str \"a\",Space,Str \"long\",Space,Str \"description\",SoftBreak,Str \"spanning\",Space,Str \"several\",Space,Str \"lines\"]]),(\"author\",MetaList [MetaInlines [Str \"A.\",Space,Str \"M.\"]]),(\"category\",MetaInlines [Str \"My\",Space,Str \"Category\"]),(\"custom1\",MetaInlines [Str \"First\",Space,Str \"custom\",Space,Str \"property\",Space,Str \"value\"]),(\"custom3\",MetaInlines [Str \"Escaping\",Space,Str \"amp\",Space,Str \"&\",Space,Str \".\"]),(\"custom4\",MetaInlines [Str \"Escaping\",Space,Str \"LT,GT\",Space,Str \"<\",Space,Str \"asdf\",Space,Str \">\",Space,Str \"<\"]),(\"custom5\",MetaInlines [Str \"Escaping\",Space,Str \"html\",Space,RawInline (Format \"html\") \"<i>\",Str \"asdf\",RawInline (Format \"html\") \"</i>\"]),(\"custom6\",MetaInlines [Str \"Escaping\",Space,Emph [Str \"MD\"],Space,Str \"\\225\",Space,Str \"a\"]),(\"custom9\",MetaInlines [Str \"Extended\",Space,Str \"chars:\",Space,Str \"\\8364\",Space,Str \"\\225\",Space,Str \"\\233\",Space,Str \"\\237\",Space,Str \"\\243\",Space,Str \"\\250\",Space,Str \"$\"]),(\"description\",MetaBlocks [Para [Str \"Long\",Space,Str \"description\",Space,Str \"spanning\",SoftBreak,Str \"several\",Space,Str \"lines.\"],Plain [Str \"This\",Space,Str \"is\",Space,Str \"\\225\",Space,Str \"second\",Space,RawInline (Format \"html\") \"<i>\",Str \"line\",RawInline (Format \"html\") \"</i>\",Str \".\"]]),(\"keywords\",MetaList [MetaInlines [Str \"keyword\",Space,Str \"1\"],MetaInlines [Str \"keyword\",Space,Str \"2\"]]),(\"lang\",MetaInlines [Str \"en-US\"]),(\"nested-custom\",MetaList [MetaMap (fromList [(\"custom 7\",MetaInlines [Str \"Nested\",Space,Str \"Custom\",Space,Str \"value\",Space,Str \"7\"])]),MetaMap (fromList [(\"custom 8\",MetaInlines [Str \"Nested\",Space,Str \"Custom\",Space,Str \"value\",Space,Str \"8\"])])]),(\"subject\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"subject\"]),(\"subtitle\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"subtitle\"]),(\"title\",MetaInlines [Str \"Testing\",Space,Str \"custom\",Space,Str \"properties\"])]})\r\n[Para [Str \"Testing\",Space,Str \"document\",Space,Str \"properties\"]]\r\n"
  },
  {
    "path": "test/docx/drop_cap.native",
    "content": "[Para [Str \"Drop\",Space,Str \"cap.\"]\n,Para [Str \"Next\",Space,Str \"paragraph.\"]\n,Para [Str \"Drop\",Space,Str \"cap\",Space,Str \"in\",Space,Str \"margin.\"]\n,Para [Str \"Drop\",Space,Str \"cap\",Space,Str \"(not\",Space,Str \"really).\"]]\n"
  },
  {
    "path": "test/docx/dummy_item_after_list_item.native",
    "content": "[OrderedList (1,Decimal,Period)\n [[Para [Str \"One\"]\n  ,Para [Str \"Two\",LineBreak,LineBreak,Str \"Three\"]]]]\n"
  },
  {
    "path": "test/docx/dummy_item_after_paragraph.native",
    "content": "[Para [Str \"First\",Space,Str \"bullet\",Space,Str \"point\",Space,Str \"created\",Space,Str \"and\",Space,Str \"then\",Space,Str \"deleted\"]\n,Para [Str \"A\",Space,Str \"normal\",Space,Str \"paragraph\"]\n,Para [Str \"First\",Space,Str \"bullet\",Space,Str \"point\",Space,Str \"created\",Space,Str \"and\",Space,Str \"then\",Space,Str \"deleted\",Space,Str \"after\",Space,Str \"the\",Space,Str \"normal\",Space,Str \"paragraph\"]]\n"
  },
  {
    "path": "test/docx/empty_field.native",
    "content": "[Para\n    [Str \"\\24076\\26395\\28145\\20837\\20102\\35299\\30340\\35835\\32773\\21487\\20197\\21435\\30475David\",Space,Str \"French\",Span ( \"\" , [ \"indexref\" ] , [ ( \"entry\" , \"French\" ) ] ) [],Space,Str \"Belding\\21644Kevin\",Space,Str \"J.\",Space,Str \"Mitchell\\30340\"\n    ,Link (\"\",[],[]) [Str \"Foundations\",Space,Str \"of\",Space,Str \"Analysis,\",Space,Str \"2nd\",Space,Str \"Edition\"] (\"https://books.google.com/books?id=sp_Zcb9ot90C&lpg=PR4&hl=zh-CN&pg=PA19#v=onepage&q&f=true\",\"\"),Str \",\\21487\\20174\\&19\\39029\\30475\\36215\\65292\\25110D.C.\",Space,Str \"Goldrei\\30340\",Space\n    ,Link (\"\",[],[]) [Str \"Classic\",Space,Str \"Set\",Space,Str \"Theory:\",Space,Str \"For\",Space,Str \"Guided\",Space,Str \"Independent\",Space,Str \"Study\"] (\"https://books.google.ae/books?id=dlc0DwAAQBAJ&lpg=PT29&hl=zh-CN&pg=PT26#v=onepage&q&f=true\",\"\")\n    ,Str \"\\65292\\20174\\31532\\20108\\31456\\30475\\36215\\65292\\38405\\35835\\26102\\35201\\27880\\24847\\26412\\25991\\19982\\36825\\20123\\20070\\25152\\19981\\21516\\30340\\26159\\24182\\27809\\26377\\25226\\23454\\25968\\30475\\20316\\26159\\26377\\29702\\25968\\38598\\30340\\20998\\21106\\12290\"]\n,Para [Str \"Index:\"]\n,Para [Str \"French,\",Space,Str \"1\"]]\n"
  },
  {
    "path": "test/docx/enumerated_headings.native",
    "content": "[Header 1 (\"h1\",[],[]) [Str \"H1\"]\n,Header 2 (\"h2\",[],[]) [Str \"H2\"]\n,Header 3 (\"h3\",[],[]) [Str \"H3\"]\n,Para [Str \"And\",Space,Str \"some\",Space,Str \"text\"]]\n"
  },
  {
    "path": "test/docx/german_styled_lists.native",
    "content": "[BulletList\n [[Para [Str \"One\",Space,Str \"level\",Space,Str \"of\",Space,Str \"the\",Space,Str \"list.\"]]\n ,[Para [Str \"Second\",Space,Str \"level\",Space,Str \"of\",Space,Str \"the\",Space,Str \"list.\"]\n  ,BulletList\n   [[Para [Str \"Next\",Space,Str \"level\",Space,Str \"of\",Space,Str \"the\",Space,Str \"list\"]]]]\n ,[Para [Str \"Back\",Space,Str \"to\",Space,Str \"the\",Space,Str \"top\",Space,Str \"level.\"]]]]\n"
  },
  {
    "path": "test/docx/hanging_indent.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"hanging\",Space,Str \"indent,\",Space,Str \"with\",Space,Str \"the\",Space,Str \"left\",Space,Str \"side\",Space,Str \"set\",Space,Str \"to\",Space,Str \"the\",Space,Str \"left\",Space,Str \"margin,\",Space,Str \"and\",Space,Str \"it\",Space,Str \"wraps\",Space,Str \"around\",Space,Str \"the\",Space,Str \"line.\"]\n,BlockQuote\n [Para [Str \"Five\",Space,Str \"years\",Space,Str \"have\",Space,Str \"passed,\",Space,Str \"five\",Space,Str \"summers\",Space,Str \"with\",Space,Str \"the\",Space,Str \"length\"]]]\n"
  },
  {
    "path": "test/docx/headers.native",
    "content": "[Header 1 (\"a-test-of-headers\",[],[]) [Str \"A\",Space,Str \"Test\",Space,Str \"of\",Space,Str \"Headers\"]\n,Header 2 (\"second-level\",[],[]) [Str \"Second\",Space,Str \"Level\"]\n,Para [Str \"Some\",Space,Str \"plain\",Space,Str \"text.\"]\n,Header 3 (\"third-level\",[],[]) [Str \"Third\",Space,Str \"level\"]\n,Para [Str \"Some\",Space,Str \"more\",Space,Str \"plain\",Space,Str \"text.\"]\n,Header 4 (\"fourth-level\",[],[]) [Str \"Fourth\",Space,Str \"level\"]\n,Para [Str \"Some\",Space,Str \"more\",Space,Str \"plain\",Space,Str \"text.\"]\n,Header 5 (\"fifth-level\",[],[]) [Str \"Fifth\",Space,Str \"level\"]\n,Para [Str \"Some\",Space,Str \"more\",Space,Str \"plain\",Space,Str \"text.\"]\n,Header 6 (\"sixth-level\",[],[]) [Str \"Sixth\",Space,Str \"level\"]\n,Para [Str \"Some\",Space,Str \"more\",Space,Str \"plain\",Space,Str \"text.\"]\n,Para [Str \"Seventh\",Space,Str \"level\"]\n,Para [Str \"Since\",Space,Str \"no\",Space,Str \"Heading\",Space,Str \"7\",Space,Str \"style\",Space,Str \"exists\",Space,Str \"in\",Space,Str \"styles.xml,\",Space,Str \"this\",Space,Str \"gets\",Space,Str \"converted\",Space,Str \"to\",Space,Str \"Span.\"]]\n"
  },
  {
    "path": "test/docx/i18n_blocks.native",
    "content": "[Header 1 (\"this-is-heading-1\",[],[]) [Str \"This\",Space,Str \"is\",Space,Str \"Heading\",Space,Str \"1\"]\n,Header 2 (\"this-is-heading-2\",[],[]) [Str \"This\",Space,Str \"is\",Space,Str \"Heading\",Space,Str \"2\"]\n,BlockQuote\n [Para [Str \"This\",Space,Str \"is\",Space,Str \"Quote\"]\n ,Para [Str \"This\",Space,Str \"is\",Space,Str \"Block\",Space,Str \"Text\"]]\n,BulletList\n [[Para [Str \"This\",Space,Str \"is\",Space,Str \"list\",Space,Str \"item\",Space,Str \"1\"]]\n ,[Para [Str \"This\",Space,Str \"is\",Space,Str \"list\",Space,Str \"item\",Space,Str \"2\"]]]]\n"
  },
  {
    "path": "test/docx/image_no_embed.native",
    "content": "[Para [Str \"An\",Space,Str \"image:\"]\n,Para [Image (\"\",[],[(\"width\",\"6.5in\"),(\"height\",\"5.508333333333334in\")]) [Str \"He\",Space,Str \"realizes\",Space,Str \"he's\",Space,Str \"making\",Space,Str \"the\",Space,Str \"file-size\",Space,Str \"too\",Space,Str \"big.\"] (\"media/image1.jpg\",\"An unhappy fish.\")]]\n"
  },
  {
    "path": "test/docx/image_no_embed_writer.native",
    "content": "[Para [Str \"An\",Space,Str \"image:\"]\n,Para [Image (\"\",[],[(\"width\",\"0.4166666666666667in\"),(\"height\",\"0.4166666666666667in\")]) [Str \"He\",Space,Str \"realizes\",Space,Str \"he's\",Space,Str \"making\",Space,Str \"the\",Space,Str \"file-size\",Space,Str \"too\",Space,Str \"big.\"] (\"media/rId25.jpg\",\"An unhappy fish.\")]]\n"
  },
  {
    "path": "test/docx/image_vml.native",
    "content": "[Header 1 (\"vml-image\",[],[]) [Strong [Str \"VML\",Space,Str \"Image\"]]\n,Para [Str \"It\",Space,Str \"should\",Space,Str \"follow\",Space,Str \"below:\"]\n,Para [Image (\"\",[],[]) [] (\"media/image4.jpeg\",\"\")]]\n"
  },
  {
    "path": "test/docx/image_vml_as_object.native",
    "content": "[Para [Str \"Test\",Space,Str \"with\",Space,Str \"object\",Space,Str \"as\",Space,Str \"image:\"]\n,Para [Image (\"\",[],[]) [] (\"media/image1.emf\",\"\")]]\n"
  },
  {
    "path": "test/docx/image_with_textbox_caption.native",
    "content": "[ Figure\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Para\n           [ Str \"1\"\n           , Space\n           , Str \"Daniel\"\n           , Space\n           , Str \"Schliebner:\"\n           , Space\n           , Str \"Cantor'sches\"\n           , Space\n           , Str \"Diagonalverfahren.\"\n           , Space\n           , Str \"Von\"\n           , Space\n           , Str \"Mengen,\"\n           , Space\n           , Str \"Unendlichkeiten\"\n           , Space\n           , Str \"und\"\n           , Space\n           , Str \"Wahnsinn,\"\n           , Space\n           , Str \"Pdf:\"\n           , Space\n           , Str\n               \"https://www2.informatik.hu-berlin.de/~kossahl/Uni/Ma1/Cantor.pdf\"\n           ]\n       ])\n    [ Plain\n        [ Image\n            ( \"\"\n            , []\n            , [ ( \"width\" , \"2.3680555555555554in\" )\n              , ( \"height\" , \"0.9340277777777778in\" )\n              ]\n            )\n            []\n            ( \"media/image1.emf\" , \"\" )\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/docx/image_writer_test.native",
    "content": "[Para [Str \"No\",Space,Str \"width\",Space,Str \"given:\"]\n,Para [Image (\"fig:testimg\",[],[]) [Str \"testimg\"] (\"lalune.jpg\",\"fig:\")]\n,Para [Str \"With\",Space,Str \"height\",Space,Str \"10cm:\"]\n,Para [Image (\"fig:2testimg\",[],[(\"height\",\"10cm\")]) [Str \"2testimg\"] (\"lalune.jpg\",\"fig:\")]\n,Para [Str \"With\",Space,Str \"width\",Space,Str \"6cm:\"]\n,Para [Image (\"\",[],[(\"width\",\"6cm\")]) [Str \"3testimg\"] (\"lalune.jpg\",\"fig:\")]\n,Header 1 (\"with-height-3in-and-width-6in\",[],[]) [Str \"With\",Space,Str \"height\",Space,Str \"3in\",Space,Str \"and\",Space,Str \"width\",Space,Str \"6in:\"]\n,Para [Image (\"\",[],[(\"width\",\"6in\"),(\"height\",\"3in\")]) [Str \"4testimg\"] (\"lalune.jpg\",\"fig:\")]\n,Para [RawInline (Format \"openxml\") \"<w:fldSimple w:instr=\\\"REF ref_fig:testimg\\\" />\"]\n,Para [RawInline (Format \"openxml\") \"<w:fldSimple w:instr=\\\"REF ref_fig:2testimg\\\" />\"]]\n"
  },
  {
    "path": "test/docx/inline_code.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"an\",Space,Str \"example\",Space,Str \"of\",Space,Code (\"\",[],[]) \"inline   code\",Space,Str \"with\",Space,Str \"three\",Space,Str \"spaces.\"]]\n"
  },
  {
    "path": "test/docx/inline_formatting.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Para [Str \"Regular\",Space,Str \"text\",Space,Emph [Str \"italics\"],Space,Strong [Str \"bold\",Space,Emph [Str \"bold\",Space,Str \"italics\"]],Str \".\"]\n,Para [Str \"This\",Space,Str \"is\",Space,SmallCaps [Str \"Small\",Space,Str \"Caps\"],Str \",\",Space,Str \"and\",Space,Str \"this\",Space,Str \"is\",Space,Strikeout [Str \"strikethrough\"],Str \".\"]\n,Para [Str \"Some\",Space,Str \"people\",Space,Str \"use\",Space,Underline [Str \"single\",Space,Str \"underlines\",Space,Str \"for\",Space,Emph [Str \"emphasis\"]],Str \".\"]\n,Para [Str \"Above\",Space,Str \"the\",Space,Str \"line\",Space,Str \"is\",Space,Superscript [Str \"superscript\"],Space,Str \"and\",Space,Str \"below\",Space,Str \"the\",Space,Str \"line\",Space,Str \"is\",Space,Subscript [Str \"subscript\"],Str \".\"]\n,Para [Str \"A\",Space,Str \"line\",LineBreak,Str \"break.\"]]\n"
  },
  {
    "path": "test/docx/inline_formatting_writer.native",
    "content": "[Para [Str \"Regular\",Space,Str \"text\",Space,Emph [Str \"italics\"],Space,Strong [Str \"bold\",Space,Emph [Str \"bold\",Space,Str \"italics\"]],Str \".\"]\n,Para [Str \"This\",Space,Str \"is\",Space,SmallCaps [Str \"Small\",Space,Str \"Caps\"],Str \",\",Space,Str \"and\",Space,Str \"this\",Space,Str \"is\",Space,Strikeout [Str \"strikethrough\"],Str \".\"]\n,Para [Str \"Some\",Space,Str \"people\",Space,Str \"use\",Space,Emph [Str \"single\",Space,Str \"underlines\",Space,Str \"for\",Space,Str \"emphasis\"],Str \".\"]\n,Para [Str \"Above\",Space,Str \"the\",Space,Str \"line\",Space,Str \"is\",Space,Superscript [Str \"superscript\"],Space,Str \"and\",Space,Str \"below\",Space,Str \"the\",Space,Str \"line\",Space,Str \"is\",Space,Subscript [Str \"subscript\"],Str \".\"]\n,Para [Str \"A\",Space,Str \"line\",LineBreak,Str \"break.\"]]\n"
  },
  {
    "path": "test/docx/inline_images.native",
    "content": "[Para [Str \"This\",Space,Str \"picture\",Space,Image (\"\",[],[(\"width\",\"0.8888888888888888in\"),(\"height\",\"0.8888888888888888in\")]) [Str \"This\",Space,Str \"one\",Space,Str \"is\",Space,Str \"green\",Space,Str \"and\",Space,Str \"looks\",Space,Str \"like\",Space,Str \"Sideshow\",Space,Str \"Bob.\"] (\"media/image1.jpg\",\"First identicon\"),Space,Str \"is\",Space,Str \"an\",Space,Str \"identicon.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Link (\"\",[],[]) [Str \"one\",Space,Image (\"\",[],[(\"width\",\"0.8888888888888888in\"),(\"height\",\"0.8888888888888888in\")]) [Str \"This\",Space,Str \"one\",Space,Str \"is\",Space,Str \"reddish,\",Space,Str \"and\",Space,Str \"looks\",Space,Str \"like\",Space,Str \"a\",Space,Str \"heart\",Space,Str \"that\",Space,Str \"has\",Space,Str \"leaked\",Space,Str \"out.\"] (\"media/image2.jpg\",\"Second identicon\"),Space,Str \"that\"] (\"http://www.google.com\",\"\"),Space,Str \"links.\"]]\n"
  },
  {
    "path": "test/docx/inline_images_writer.native",
    "content": "[Para [Str \"This\",Space,Str \"picture\",Space,Image (\"\",[],[(\"width\",\"0.4166666666666667in\"),(\"height\",\"0.4166666666666667in\")]) [] (\"media/rId26.jpg\",\"\"),Space,Str \"is\",Space,Str \"an\",Space,Str \"identicon.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Link (\"\",[],[]) [Str \"one\",Space,Image (\"\",[],[(\"width\",\"0.4166666666666667in\"),(\"height\",\"0.4166666666666667in\")]) [] (\"media/rId26.jpg\",\"\"),Space,Str \"that\"] (\"http://www.google.com\",\"\"),Space,Str \"links.\"]]\n"
  },
  {
    "path": "test/docx/inline_images_writer_test.native",
    "content": "[Para [Str \"This\",Space,Str \"picture\",Space,Image (\"\",[],[(\"width\",\"0.8888888888888888in\"),(\"height\",\"0.8888888888888888in\")]) [Str \"This\",Space,Str \"one\",Space,Str \"is\",Space,Str \"green\",Space,Str \"and\",Space,Str \"looks\",Space,Str \"like\",Space,Str \"Sideshow\",Space,Str \"Bob.\"] (\"lalune.jpg\",\"First identicon\"),Space,Str \"is\",Space,Str \"an\",Space,Str \"identicon.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Link (\"\",[],[]) [Str \"one\",Space,Image (\"\",[],[(\"width\",\"0.8888888888888888in\"),(\"height\",\"0.8888888888888888in\")]) [Str \"This\",Space,Str \"one\",Space,Str \"is\",Space,Str \"reddish,\",Space,Str \"and\",Space,Str \"looks\",Space,Str \"like\",Space,Str \"a\",Space,Str \"heart\",Space,Str \"that\",Space,Str \"has\",Space,Str \"leaked\",Space,Str \"out.\"] (\"lalune.jpg\",\"Second identicon\"),Space,Str \"that\"] (\"http://www.google.com\",\"\"),Space,Str \"links.\"]]\n"
  },
  {
    "path": "test/docx/instrText_hyperlink.native",
    "content": "[Para [Str \"\\24076\\26395\\28145\\20837\\20102\\35299\\30340\\35835\\32773\\21487\\20197\\21435\\30475David\",Space,Str \"French\",Space,Str \"Belding\\21644Kevin\",Space,Str \"J.\",Space,Str \"Mitchell\\30340\",Link (\"\",[],[]) [Str \"Foundations\",Space,Str \"of\",Space,Str \"Analysis,\",Space,Str \"2nd\",Space,Str \"Edition\"] (\"https://books.google.com/books?id=sp_Zcb9ot90C&lpg=PR4&hl=zh-CN&pg=PA19#v=onepage&q&f=true\",\"\"),Str \",\\21487\\20174\\&19\\39029\\30475\\36215\\65292\\25110D.C.\",Space,Str \"Goldrei\\30340\",Space,Link (\"\",[],[]) [Str \"Classic\",Space,Str \"Set\",Space,Str \"Theory:\",Space,Str \"For\",Space,Str \"Guided\",Space,Str \"Independent\",Space,Str \"Study\"] (\"https://books.google.ae/books?id=dlc0DwAAQBAJ&lpg=PT29&hl=zh-CN&pg=PT26#v=onepage&q&f=true\",\"\"),Str \"\\65292\\20174\\31532\\20108\\31456\\30475\\36215\\65292\\38405\\35835\\26102\\35201\\27880\\24847\\26412\\25991\\19982\\36825\\20123\\20070\\25152\\19981\\21516\\30340\\26159\\24182\\27809\\26377\\25226\\23454\\25968\\30475\\20316\\26159\\26377\\29702\\25968\\38598\\30340\\20998\\21106\\12290\"]]\n"
  },
  {
    "path": "test/docx/link_in_notes.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"test\",Note [Para [Link (\"\",[],[]) [Str \"http://wikipedia.org/\"] (\"http://wikipedia.org/\",\"\")]],Str \".\"]]\n"
  },
  {
    "path": "test/docx/links.native",
    "content": "[Header 2 (\"an-internal-link-and-an-external-link\",[],[]) [Str \"An\",Space,Str \"internal\",Space,Str \"link\",Space,Str \"and\",Space,Str \"an\",Space,Str \"external\",Space,Str \"link\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"external\",Space,Str \"link\"] (\"http://google.com\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"popular\",Space,Str \"website.\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"external\",Space,Str \"link\"] (\"http://pandoc.org/README.html#synopsis\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"website\",Space,Str \"with\",Space,Str \"an\",Space,Str \"anchor.\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"internal\",Space,Str \"link\"] (\"#a-section-for-testing-link-targets\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"section\",Space,Str \"header.\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"internal\",Space,Str \"link\"] (\"#my_bookmark\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"bookmark.\"]\n,Header 2 (\"a-section-for-testing-link-targets\",[],[]) [Str \"A\",Space,Str \"section\",Space,Str \"for\",Space,Str \"testing\",Space,Str \"link\",Space,Str \"targets\"]\n,Para [Str \"A\",Space,Str \"bookmark\",Space,Str \"right\",Space,Span (\"my_bookmark\",[\"anchor\"],[]) [],Str \"here\"]]\n"
  },
  {
    "path": "test/docx/links_writer.native",
    "content": "[Header 2 (\"an-internal-link-and-an-external-link\",[],[]) [Str \"An\",Space,Str \"internal\",Space,Str \"link\",Space,Str \"and\",Space,Str \"an\",Space,Str \"external\",Space,Str \"link\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"external\",Space,Str \"link\"] (\"http://google.com\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"popular\",Space,Str \"website.\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"external\",Space,Str \"link\"] (\"http://pandoc.org/README.html#synopsis\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"website\",Space,Str \"with\",Space,Str \"an\",Space,Str \"anchor.\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"internal\",Space,Str \"link\"] (\"#a-section-for-testing-link-targets\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"section\",Space,Str \"header.\"]\n,Para [Str \"An\",Space,Link (\"\",[],[]) [Str \"internal\",Space,Str \"link\"] (\"#my_bookmark\",\"\"),Space,Str \"to\",Space,Str \"a\",Space,Str \"bookmark.\"]\n,Header 2 (\"a-section-for-testing-link-targets\",[],[]) [Str \"A\",Space,Str \"section\",Space,Str \"for\",Space,Str \"testing\",Space,Str \"link\",Space,Str \"targets\"]]\n"
  },
  {
    "path": "test/docx/lists-compact.native",
    "content": "[OrderedList (1,Decimal,Period)\n [[Plain [Str \"One\"]]\n ,[Plain [Str \"Two\"]]\n ,[Plain [Str \"Three\"]]\n ,[Plain [Str \"Four\"]]]]\n"
  },
  {
    "path": "test/docx/lists.native",
    "content": "[Header 2 (\"some-nested-lists\",[],[]) [Str \"Some\",Space,Str \"nested\",Space,Str \"lists\"]\n,OrderedList (1,Decimal,Period)\n [[Para [Str \"one\"]]\n ,[Para [Str \"two\"]\n  ,OrderedList (1,LowerAlpha,Period)\n   [[Para [Str \"a\"]]\n   ,[Para [Str \"b\"]]]]]\n,BulletList\n [[Para [Str \"one\"]]\n ,[Para [Str \"two\"]\n  ,BulletList\n   [[Para [Str \"three\"]\n    ,BulletList\n     [[Para [Str \"four\"]\n      ,Para [Str \"Sub\",Space,Str \"paragraph\"]]]]]]\n ,[Para [Str \"Same\",Space,Str \"list\"]]]\n,BulletList\n [[Plain [Str \"Different\",Space,Str \"list\",Space,Str \"adjacent\",Space,Str \"to\",Space,Str \"the\",Space,Str \"one\",Space,Str \"above.\"]]]]\n"
  },
  {
    "path": "test/docx/lists_9994.native",
    "content": "[ OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Plain [ Str \"one\" ]\n      , BulletList [ [ Plain [ Str \"bul\" ] ] ]\n      ]\n    , [ Plain [ Str \"two\" ] ]\n    ]\n]\n"
  },
  {
    "path": "test/docx/lists_continuing.native",
    "content": "[OrderedList (1,Decimal,Period)\n [[Para [Str \"Foo\"]]\n ,[Para [Str \"Bar\"]]\n ,[Para [Str \"Baz\"]]]\n,Para [Str \"Interruption.\"]\n,OrderedList (4,Decimal,Period)\n [[Para [Str \"Bop\"]]]]\n"
  },
  {
    "path": "test/docx/lists_div_bullets.native",
    "content": "[ BulletList\n  [ [ Div ( \"\", [], []) [ Para [ Str \"one\" ], Para [ Str \"two\" ] ] ]\n  , [ Div ( \"refs\", [], []) [ Header 1 ( \"\" , [] , [] ) [ Str \"three\" ], Para [ Str \"four\" ] ] ]\n  ]\n]\n"
  },
  {
    "path": "test/docx/lists_level_override.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"For\"\n      , Space\n      , Str \"each\"\n      , Space\n      , Str \"initiative\"\n      , Space\n      , Str \"below\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"outlined\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"goals,\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"approximate\"\n      , Space\n      , Str \"roadmap\"\n      , Space\n      , Str \"which\"\n      , Space\n      , Str \"will\"\n      , Space\n      , Str \"likely\"\n      , Space\n      , Str \"change\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"we\"\n      , Space\n      , Str \"iterate,\"\n      , Space\n      , Str \"signals/metrics\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"measure\"\n      , Space\n      , Str \"success,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"initial\"\n      , Space\n      , Str \"workitems\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"rough\"\n      , Space\n      , Strong [ Str \"schedule\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"contacts\"\n      , Space\n      , Str \"where\"\n      , Space\n      , Str \"available:\"\n      ]\n  , Para [ Str \"\\160\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para\n            [ Str \"State\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"Documentation\"\n            ]\n        ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Strong\n              [ Str \"Goal:\"\n              , Space\n              , Str \"Baseline\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"ongoing\"\n              , Space\n              , Str \"metrics\"\n              , Space\n              , Str \"tracking\"\n              , Space\n              , Str \"doc\"\n              , Space\n              , Str \"usefulness\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"completeness.\"\n              ]\n          ]\n      , Para [ Str \"\\160\" ]\n      ]\n  , OrderedList\n      ( 2 , Decimal , Period )\n      [ [ Para [ Str \"Content\" , Space , Str \"Migration\" ] ] ]\n  , BlockQuote\n      [ Para\n          [ Str \"Goal:\"\n          , Space\n          , Str \"Content\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"accessible\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"new\"\n          , Space\n          , Str \"employees\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"better\"\n          , Space\n          , Str \"organized/archived.\"\n          ]\n      , Para [ Str \"\\160\" ]\n      ]\n  , OrderedList\n      ( 3 , Decimal , Period )\n      [ [ Para [ Str \"Wiki\" , Space , Str \"(xl)\" ] ] ]\n  , BlockQuote\n      [ Para\n          [ Strong\n              [ Str \"Goal:\"\n              , Space\n              , Str \"Useful\"\n              , Space\n              , Str \"documentation\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"archived,\"\n              , Space\n              , Str \"searchable\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"easy\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"create\"\n              ]\n          ]\n      , Para [ Str \"\\160\\160\" ]\n      ]\n  , OrderedList\n      ( 4 , Decimal , Period )\n      [ [ Para\n            [ Str \"XL\"\n            , Space\n            , Str \"Code\"\n            , Space\n            , Str \"Autoreview\"\n            , Space\n            , Str \"Bot\"\n            , Space\n            , Str \"(XLCRBot).\"\n            ]\n        ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Strong\n              [ Str \"Goal:\"\n              , Space\n              , Str \"Feedback\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"basic\"\n              , Space\n              , Str \"violations\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"seconds\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"minutes\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Str \"most\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"either\"\n              , Space\n              , Str \"VS\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"Codeflow.\"\n              ]\n          ]\n      ]\n  , OrderedList\n      ( 5 , Decimal , Period )\n      [ [ Para [ Str \"Code\" , Space , Str \"documentation\" ] ] ]\n  , BlockQuote\n      [ Para\n          [ Strong\n              [ Str \"Goal:\"\n              , Space\n              , Str \"Useful,\"\n              , Space\n              , Str \"consistent,\"\n              , Space\n              , Str \"tool\"\n              , Space\n              , Str \"supported\"\n              , Space\n              , Str \"comments\"\n              ]\n          ]\n      ]\n  , Para [ Strong [ Str \"\\160\" ] , Str \"\\160\" ]\n  , OrderedList\n      ( 6 , Decimal , Period )\n      [ [ Para [ Str \"Education\" , Space , Str \"efforts\" ] ] ]\n  , BlockQuote\n      [ Para\n          [ Strong\n              [ Str \"Goal:\"\n              , Space\n              , Str \"Broad,\"\n              , Space\n              , Str \"discoverable\"\n              , Space\n              , Str \"channels\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"updates\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"news\"\n              ]\n          ]\n      ]\n  , Para [ Strong [ Str \"\\160\" ] ]\n  ]\n"
  },
  {
    "path": "test/docx/lists_multiple_initial.native",
    "content": "[OrderedList (1,Decimal,Period)\n [[OrderedList (1,LowerAlpha,TwoParens)\n   [[Para [Str \"foo\"]]\n   ,[Para [Str \"bar\"]]]]]\n,BulletList\n [[BulletList\n   [[Para [Str \"foo\"]]\n   ,[Para [Str \"bar\"]]]]]]\n"
  },
  {
    "path": "test/docx/lists_restarting.native",
    "content": "[OrderedList (2,Decimal,Period)\n [[Para [Str \"Foo\"]]\n ,[Para [Str \"Bar\"]]\n ,[Para [Str \"Baz\"]]]\n,BlockQuote\n [Para [Str \"Interruption\"]]\n,OrderedList (1,Decimal,Period)\n [[Para [Str \"Bop.\"]]]]\n"
  },
  {
    "path": "test/docx/lists_sublist_reset.native",
    "content": "[OrderedList (1,Decimal,Period)\n [[Para [Str \"Head\",Space,Str \"1\"]\n  ,OrderedList (1,Decimal,DefaultDelim)\n   [[Para [Str \"Head\",Space,Str \"1.1\"]]\n   ,[Para [Str \"Head\",Space,Str \"1.2\"]]]]\n ,[Para [Str \"Head\",Space,Str \"2\"]\n  ,OrderedList (1,Decimal,DefaultDelim)\n   [[Para [Str \"Head\",Space,Str \"2.1\"]]]]]]\n"
  },
  {
    "path": "test/docx/lists_writer.native",
    "content": "[Header 2 (\"some-nested-lists\",[],[]) [Str \"Some\",Space,Str \"nested\",Space,Str \"lists\"]\n,OrderedList (1,Decimal,Period)\n [[Para [Str \"one\"]]\n ,[Para [Str \"two\"]\n  ,OrderedList (1,LowerAlpha,DefaultDelim)\n   [[Para [Str \"a\"]]\n   ,[Para [Str \"b\"]]]]]\n,BulletList\n [[Para [Str \"one\"]]\n ,[Para [Str \"two\"]\n  ,BulletList\n   [[Para [Str \"three\"]\n    ,BulletList\n     [[Para [Str \"four\"]]]]]]\n ,[Para [Str \"Same\",Space,Str \"list\"]]]\n,BulletList\n [[Para [Str \"Different\",Space,Str \"list\",Space,Str \"adjacent\",Space,Str \"to\",Space,Str \"the\",Space,Str \"one\",Space,Str \"above.\"]]]]\n"
  },
  {
    "path": "test/docx/mendeley_citations_minus.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Mendeley\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"(prefix\"\n      , Space\n      , Str \"Hadwen-Bennett\"\n      , Space\n      , Str \"et\"\n      , Space\n      , Str \"al.,\"\n      , Space\n      , Str \"2018,\"\n      , Space\n      , Str \"p.\"\n      , Space\n      , Str \"123\"\n      , Space\n      , Str \"suffix).\"\n      ]\n  , Para\n      [ Str \"Another\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"(prefix\"\n      , Space\n      , Str \"Seo,\"\n      , Space\n      , Str \"2019,\"\n      , Space\n      , Str \"pp.\"\n      , Space\n      , Str \"10\\8211\\&20\"\n      , Space\n      , Str \"suffix).\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"last\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"(Koh\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Abbas,\"\n      , Space\n      , Str \"2015;\"\n      , Space\n      , Str \"Lee\"\n      , Space\n      , Str \"et\"\n      , Space\n      , Str \"al.,\"\n      , Space\n      , Str \"2011).\"\n      ]\n  , Header 1 ( \"references\" , [] , [] ) [ Str \"References\" ]\n  , Para\n      [ Str \"Hadwen-Bennett,\"\n      , Space\n      , Str \"A.,\"\n      , Space\n      , Str \"Sentance,\"\n      , Space\n      , Str \"S.,\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Morrison,\"\n      , Space\n      , Str \"C.\"\n      , Space\n      , Str \"(2018).\"\n      , Space\n      , Str \"Making\"\n      , Space\n      , Str \"Programming\"\n      , Space\n      , Str \"Accessible\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"Learners\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"Visual\"\n      , Space\n      , Str \"Impairments:\"\n      , Space\n      , Str \"A\"\n      , Space\n      , Str \"Literature\"\n      , Space\n      , Str \"Review.\"\n      , Space\n      , Emph\n          [ Str \"International\"\n          , Space\n          , Str \"Journal\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"Computer\"\n          , Space\n          , Str \"Science\"\n          , Space\n          , Str \"Education\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"Schools\"\n          ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"2\" ]\n      , Str \"(2),\"\n      , Space\n      , Str \"3\\8211\\&13.\"\n      , Space\n      , Str\n          \"https://www.microsoft.com/en-us/research/publication/making-programming-accessible-to-learners-with-visual-impairments-a-literature-review/\"\n      ]\n  , Para\n      [ Str \"Koh,\"\n      , Space\n      , Str \"K.,\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Abbas,\"\n      , Space\n      , Str \"J.\"\n      , Space\n      , Str \"(2015).\"\n      , Space\n      , Str \"Future\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"library\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"museum\"\n      , Space\n      , Str \"services\"\n      , Space\n      , Str \"supporting\"\n      , Space\n      , Str \"teen\"\n      , Space\n      , Str \"learning:\"\n      , Space\n      , Str \"Perceptions\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"professionals\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"learning\"\n      , Space\n      , Str \"labs\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"makerspaces.\"\n      , Space\n      , Emph\n          [ Str \"Journal\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"Research\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"Libraries\"\n          , Space\n          , Str \"\\\\&\"\n          , Space\n          , Str \"Young\"\n          , Space\n          , Str \"Adults\"\n          ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"6\" ]\n      , Str \"(4).\"\n      ]\n  , Para\n      [ Str \"Lee,\"\n      , Space\n      , Str \"I.,\"\n      , Space\n      , Str \"Martin,\"\n      , Space\n      , Str \"F.,\"\n      , Space\n      , Str \"Denner,\"\n      , Space\n      , Str \"J.,\"\n      , Space\n      , Str \"Coulter,\"\n      , Space\n      , Str \"B.,\"\n      , Space\n      , Str \"Allan,\"\n      , Space\n      , Str \"W.,\"\n      , Space\n      , Str \"Erickson,\"\n      , Space\n      , Str \"J.,\"\n      , Space\n      , Str \"Malyn-Smith,\"\n      , Space\n      , Str \"J.,\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Werner,\"\n      , Space\n      , Str \"L.\"\n      , Space\n      , Str \"(2011).\"\n      , Space\n      , Str \"Computational\"\n      , Space\n      , Str \"Thinking\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"Youth\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"Practice.\"\n      , Space\n      , Emph [ Str \"ACM\" , Space , Str \"Inroads\" ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"2\" ]\n      , Str \"(1),\"\n      , Space\n      , Str \"32\\8211\\&37.\"\n      , Space\n      , Str \"https://doi.org/10.1145/1929887.1929902\"\n      ]\n  , Para\n      [ Str \"Seo,\"\n      , Space\n      , Str \"J.\"\n      , Space\n      , Str \"(2019).\"\n      , Space\n      , Str \"Is\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"Maker\"\n      , Space\n      , Str \"Movement\"\n      , Space\n      , Str \"Inclusive\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"{ANYONE}?:\"\n      , Space\n      , Str \"Three\"\n      , Space\n      , Str \"Accessibility\"\n      , Space\n      , Str \"Considerations\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"Invite\"\n      , Space\n      , Str \"Blind\"\n      , Space\n      , Str \"Makers\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"Making\"\n      , Space\n      , Str \"World.\"\n      , Space\n      , Emph [ Str \"TechTrends\" ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"63\" ]\n      , Str \"(5),\"\n      , Space\n      , Str \"514\\8211\\&520.\"\n      , Space\n      , Str \"https://doi.org/10.1007/s11528-019-00377-3\"\n      ]\n  ]\n"
  },
  {
    "path": "test/docx/mendeley_citations_plus.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"references\"\n            , MetaList\n                [ MetaMap\n                    (fromList\n                       [ ( \"DOI\"\n                         , MetaString \"10.1145/1929887.1929902\"\n                         )\n                       , ( \"ISSN\" , MetaString \"2153-2184\" )\n                       , ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Lee\" )\n                                    , ( \"given\" , MetaString \"Irene\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Martin\" )\n                                    , ( \"given\" , MetaString \"Fred\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Denner\" )\n                                    , ( \"given\" , MetaString \"Jill\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\"\n                                      , MetaString \"Coulter\"\n                                      )\n                                    , ( \"given\" , MetaString \"Bob\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Allan\" )\n                                    , ( \"given\" , MetaString \"Walter\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\"\n                                      , MetaString \"Erickson\"\n                                      )\n                                    , ( \"given\" , MetaString \"Jeri\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\"\n                                      , MetaString \"Malyn-Smith\"\n                                      )\n                                    , ( \"given\" , MetaString \"Joyce\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Werner\" )\n                                    , ( \"given\" , MetaString \"Linda\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines\n                             [ Str \"ACM\" , Space , Str \"Inroads\" ]\n                         )\n                       , ( \"id\" , MetaString \"ITEM-1\" )\n                       , ( \"issue\" , MetaInlines [ Str \"1\" ] )\n                       , ( \"issued\" , MetaString \"2011-02\" )\n                       , ( \"page\" , MetaInlines [ Str \"32-37\" ] )\n                       , ( \"publisher\" , MetaInlines [ Str \"ACM\" ] )\n                       , ( \"publisher-place\"\n                         , MetaInlines\n                             [ Str \"New\"\n                             , Space\n                             , Str \"York,\"\n                             , Space\n                             , Str \"NY,\"\n                             , Space\n                             , Str \"USA\"\n                             ]\n                         )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"Computational\"\n                             , Space\n                             , Str \"Thinking\"\n                             , Space\n                             , Str \"for\"\n                             , Space\n                             , Str \"Youth\"\n                             , Space\n                             , Str \"in\"\n                             , Space\n                             , Str \"Practice\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"2\" ] )\n                       ])\n                , MetaMap\n                    (fromList\n                       [ ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Koh\" )\n                                    , ( \"given\"\n                                      , MetaString \"Kyungwon\"\n                                      )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"family\" , MetaString \"Abbas\" )\n                                    , ( \"given\" , MetaString \"June\" )\n                                    , ( \"non-dropping-particle\"\n                                      , MetaString \"\"\n                                      )\n                                    , ( \"suffix\" , MetaString \"\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines\n                             [ Str \"Journal\"\n                             , Space\n                             , Str \"of\"\n                             , Space\n                             , Str \"Research\"\n                             , Space\n                             , Str \"on\"\n                             , Space\n                             , Str \"Libraries\"\n                             , Space\n                             , Str \"\\\\&\"\n                             , Space\n                             , Str \"Young\"\n                             , Space\n                             , Str \"Adults\"\n                             ]\n                         )\n                       , ( \"id\" , MetaString \"ITEM-2\" )\n                       , ( \"issue\" , MetaInlines [ Str \"4\" ] )\n                       , ( \"issued\" , MetaString \"2015\" )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"Future\"\n                             , Space\n                             , Str \"of\"\n                             , Space\n                             , Str \"library\"\n                             , Space\n                             , Str \"and\"\n                             , Space\n                             , Str \"museum\"\n                             , Space\n                             , Str \"services\"\n                             , Space\n                             , Str \"supporting\"\n                             , Space\n                             , Str \"teen\"\n                             , Space\n                             , Str \"learning:\"\n                             , Space\n                             , Str \"Perceptions\"\n                             , Space\n                             , Str \"of\"\n                             , Space\n                             , Str \"professionals\"\n                             , Space\n                             , Str \"in\"\n                             , Space\n                             , Str \"learning\"\n                             , Space\n                             , Str \"labs\"\n                             , Space\n                             , Str \"and\"\n                             , Space\n                             , Str \"makerspaces\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"6\" ] )\n                       ])\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"Mendeley\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"ITEM-1\"\n              , citationPrefix = [ Str \"prefix\" ]\n              , citationSuffix =\n                  [ Str \",\" , Space , Str \"123\" , Space , Str \"suffix\" ]\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          ]\n          [ Str \"(prefix\"\n          , Space\n          , Str \"Hadwen-Bennett\"\n          , Space\n          , Str \"et\"\n          , Space\n          , Str \"al.,\"\n          , Space\n          , Str \"2018,\"\n          , Space\n          , Str \"p.\"\n          , Space\n          , Str \"123\"\n          , Space\n          , Str \"suffix)\"\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Another\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"ITEM-1\"\n              , citationPrefix = [ Str \"prefix\" ]\n              , citationSuffix =\n                  [ Str \",\"\n                  , Space\n                  , Str \"10-20\"\n                  , Space\n                  , Str \"suffix\"\n                  ]\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          ]\n          [ Str \"(prefix\"\n          , Space\n          , Str \"Seo,\"\n          , Space\n          , Str \"2019,\"\n          , Space\n          , Str \"pp.\"\n          , Space\n          , Str \"10\\8211\\&20\"\n          , Space\n          , Str \"suffix)\"\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"last\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"ITEM-1\"\n              , citationPrefix = []\n              , citationSuffix = []\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          , Citation\n              { citationId = \"ITEM-2\"\n              , citationPrefix = []\n              , citationSuffix = []\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          ]\n          [ Str \"(Koh\"\n          , Space\n          , Str \"&\"\n          , Space\n          , Str \"Abbas,\"\n          , Space\n          , Str \"2015;\"\n          , Space\n          , Str \"Lee\"\n          , Space\n          , Str \"et\"\n          , Space\n          , Str \"al.,\"\n          , Space\n          , Str \"2011)\"\n          ]\n      , Str \".\"\n      ]\n  , Header 1 ( \"references\" , [] , [] ) [ Str \"References\" ]\n  ]\n"
  },
  {
    "path": "test/docx/metadata.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"abstract\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"test\",Space,Str \"of\",Space,Str \"how\",Space,Str \"this\",Space,Str \"all\",Space,Str \"works.\",Space,Str \"I\\8217ve\",Space,Str \"skipped\",Space,Str \"lines\",Space,Str \"here,\",Space,Str \"which\",Space,Str \"pandoc\",Space,Str \"doesn\\8217t\",Space,Str \"do,\",Space,Str \"but\",Space,Str \"which\",Space,Str \"shouldn\\8217t\",Space,Str \"make\",Space,Str \"a\",Space,Str \"difference.\"]),(\"author\",MetaList [MetaInlines [Str \"Mary\",Space,Str \"Ann\",Space,Str \"Evans\"],MetaInlines [Str \"Aurore\",Space,Str \"Dupin\"]]),(\"date\",MetaInlines [Str \"July\",Space,Str \"28,\",Space,Str \"2014\"]),(\"title\",MetaInlines [Str \"This\",Space,Str \"Is\",Space,Str \"the\",Space,Str \"Title\"])]})\n[Para [Str \"And\",Space,Str \"now\",Space,Str \"this\",Space,Str \"is\",Space,Str \"normal\",Space,Str \"text.\"]]\n"
  },
  {
    "path": "test/docx/metadata_after_normal.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"abstract\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"test\",Space,Str \"of\",Space,Str \"how\",Space,Str \"this\",Space,Str \"all\",Space,Str \"works.\",Space,Str \"I\\8217ve\",Space,Str \"skipped\",Space,Str \"lines\",Space,Str \"here,\",Space,Str \"which\",Space,Str \"pandoc\",Space,Str \"doesn\\8217t\",Space,Str \"do,\",Space,Str \"but\",Space,Str \"which\",Space,Str \"shouldn\\8217t\",Space,Str \"make\",Space,Str \"a\",Space,Str \"difference.\"]),(\"author\",MetaList [MetaInlines [Str \"Mary\",Space,Str \"Ann\",Space,Str \"Evans\"],MetaInlines [Str \"Aurore\",Space,Str \"Dupin\"]]),(\"date\",MetaInlines [Str \"July\",Space,Str \"28,\",Space,Str \"2014\"]),(\"title\",MetaInlines [Str \"This\",Space,Str \"Is\",Space,Str \"the\",Space,Str \"Title\"])]})\n[Para [Str \"And\",Space,Str \"now\",Space,Str \"this\",Space,Str \"is\",Space,Str \"normal\",Space,Str \"text.\"]\n,Para [Str \"This\",Space,Str \"Is\",Space,Str \"the\",Space,Str \"Title\"]\n,Para [Str \"Mary\",Space,Str \"Ann\",Space,Str \"Evans\"]\n,Para [Str \"Aurore\",Space,Str \"Dupin\"]\n,Para [Str \"July\",Space,Str \"28,\",Space,Str \"2014\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"test\",Space,Str \"of\",Space,Str \"how\",Space,Str \"this\",Space,Str \"all\",Space,Str \"works.\",Space,Str \"I\\8217ve\",Space,Str \"skipped\",Space,Str \"lines\",Space,Str \"here,\",Space,Str \"which\",Space,Str \"pandoc\",Space,Str \"doesn\\8217t\",Space,Str \"do,\",Space,Str \"but\",Space,Str \"which\",Space,Str \"shouldn\\8217t\",Space,Str \"make\",Space,Str \"a\",Space,Str \"difference.\"]]\n"
  },
  {
    "path": "test/docx/nested_anchors_in_header.native",
    "content": "[Header 1 (\"\\1086\\1075\\1083\\1072\\1074\\1083\\1077\\1085\\1080\\1077\",[\"TOC-Heading\"],[]) [Str \"\\1054\\1075\\1083\\1072\\1074\\1083\\1077\\1085\\1080\\1077\"]\n,Para [Link (\"\",[],[]) [Str \"Short\",Space,Str \"instructions\",Space,Link (\"\",[],[]) [Str \"1\"] (\"#short-instructions\",\"\")] (\"#short-instructions\",\"\")]\n,Para [Link (\"\",[],[]) [Str \"Some\",Space,Str \"instructions\",Space,Link (\"\",[],[]) [Str \"1\"] (\"#some-instructions\",\"\")] (\"#some-instructions\",\"\")]\n,Para [Link (\"\",[],[]) [Str \"Remote\",Space,Str \"folder\",Space,Str \"or\",Space,Str \"longlonglonglonglong\",Space,Str \"file\",Space,Str \"with\",Space,Str \"manymanymanymany\",Space,Str \"letters\",Space,Str \"inside\",Space,Str \"opening\",Space,Link (\"\",[],[]) [Str \"2\"] (\"#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening\",\"\")] (\"#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening\",\"\")]\n,Para [Link (\"\",[],[]) [Str \"Remote\",Space,Str \"folder\",Space,Str \"or\",Space,Str \"longlonglonglonglong\",Space,Str \"file\",Space,Str \"with\",Space,Str \"manymanymanymany\",Space,Str \"letters\",Space,Str \"inside\",Space,Str \"closing\",Space,Link (\"\",[],[]) [Str \"2\"] (\"#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing\",\"\")] (\"#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing\",\"\")]\n,Header 1 (\"short-instructions\",[],[]) [Str \"Short\",Space,Str \"instructions\"]\n,Para [Link (\"\",[],[]) [Str \"Open\",Space,Str \"remote\",Space,Str \"folder\"] (\"#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening\",\"\")]\n,Para [Str \"Do\",Space,Str \"staff\"]\n,Para [Link (\"\",[],[]) [Str \"Close\",Space,Str \"remote\",Space,Str \"folder\"] (\"#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing\",\"\")]\n,Header 1 (\"some-instructions\",[],[]) [Str \"Some\",Space,Str \"instructions\"]\n,Para [Str \"Lines\"]\n,Header 2 (\"remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening\",[],[]) [Str \"Remote\",Space,Str \"folder\",Space,Str \"or\",Space,Str \"longlonglonglonglong\",Space,Str \"file\",Space,Str \"with\",Space,Str \"manymanymanymany\",Space,Str \"letters\",Space,Str \"inside\",Space,Str \"opening\"]\n,Para [Str \"Open\",Space,Str \"folder\"]\n,Header 2 (\"remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing\",[],[]) [Str \"Remote\",Space,Str \"folder\",Space,Str \"or\",Space,Str \"longlonglonglonglong\",Space,Str \"file\",Space,Str \"with\",Space,Str \"manymanymanymany\",Space,Str \"letters\",Space,Str \"inside\",Space,Str \"closing\"]\n,Para [Str \"Close\",Space,Str \"folder\"]]\n"
  },
  {
    "path": "test/docx/nested_instrText.native",
    "content": "[Para [Str \"\\24076\\26395\\28145\\20837\\20102\\35299\\30340\\35835\\32773\\21487\\20197\\21435\\30475David\",Space,Str \"French\",Space,Str \"Belding\\21644Kevin\",Space,Str \"J.\",Space,Str \"Mitchell\\30340\"\n    ,Link (\"\",[],[]) [Str \"Foundations\",Space,Str \"of\",Space,Str \"Analysis,\",Space,Str \"1/16/18\",Space,Str \"8:40:00\",Space,Str \"AM,\",Space,Str \"2nd\",Space,Str \"Edition\"] (\"https://books.google.com/books?id=sp_Zcb9ot90C&lpg=PR4&hl=zh-CN&pg=PA19#v=onepage&q&f=true\",\"\")\n    ,Str \",\\21487\\20174\\&19\\39029\\30475\\36215\\65292\\25110D.C.\",Space,Str \"Goldrei\\30340\",Space\n    ,Link (\"\",[],[]) [Str \"Classic\",Space,Str \"Set\",Space,Str \"Theory:\",Space,Str \"For\",Space,Str \"Guided\",Space,Str \"Independent\",Space,Str \"Study\"] (\"https://books.google.ae/books?id=dlc0DwAAQBAJ&lpg=PT29&hl=zh-CN&pg=PT26#v=onepage&q&f=true\",\"\")\n    ,Str \"\\65292\\20174\\31532\\20108\\31456\\30475\\36215\\65292\\38405\\35835\\26102\\35201\\27880\\24847\\26412\\25991\\19982\\36825\\20123\\20070\\25152\\19981\\21516\\30340\\26159\\24182\\27809\\26377\\25226\\23454\\25968\\30475\\20316\\26159\\26377\\29702\\25968\\38598\\30340\\20998\\21106\\12290\"]]\n"
  },
  {
    "path": "test/docx/nested_sdt.native",
    "content": "[Para [Str \"Test\",Space,Str \"Paragraph1\"]\n,Para [Str \"Test\",Space,Str \"Paragraph2\"]\n,Para [Str \"Test\",Space,Str \"Paragraph3\"]]\n"
  },
  {
    "path": "test/docx/nested_smart_tags.native",
    "content": "[Header 2 (\"and-it-came-to-pass-in-the-course-of-those-many-days\",[\"Myheading2\"],[]) [Str \"159.\",Space,Str \"And\",Space,Str \"It\",Space,Str \"Came\",Space,Str \"to\",Space,Str \"Pass\",Space,Str \"in\",Space,Str \"the\",Space,Str \"Course\",Space,Str \"of\",Space,Str \"Those\",Space,Str \"Many\",Space,Str \"Days\"]\n,Para [Str \"I\",Space,Str \"heard\"]\n,Para [Str \"\\8220And\",Space,Str \"it\",Space,Str \"came\",Space,Str \"to\",Space,Str \"pass\",Space,Str \"in\",Space,Str \"the\",Space,Str \"course\",Space,Str \"of\",Space,Str \"those\",Space,Str \"many\",Space,Str \"days\",Space,Str \"that\",Space,Str \"the\",Space,Str \"king\",Space,Str \"of\",Space,Str \"Egypt\",Space,Str \"died;\",Space,Str \"and\",Space,Str \"the\",Space,Str \"children\",Space,Str \"of\",Space,Str \"Israel\",Space,Str \"sighed\",Space,Str \"by\",Space,Str \"reason\",Space,Str \"of\",Space,Str \"the\",Space,Str \"bondage,\",Space,Str \"and\",Space,Str \"they\",Space,Str \"cried,\",Space,Str \"and\",Space,Str \"their\",Space,Str \"cry\",Space,Str \"came\",Space,Str \"up\",Space,Str \"unto\",Space,Str \"God\",Space,Str \"by\",Space,Str \"reason\",Space,Str \"of\",Space,Str \"the\",Space,Str \"bondage.\",Space,Str \"And\",Space,Str \"God\",Space,Str \"heard\",Space,Str \"their\",Space,Str \"groaning\\8221\",Space,Str \"(Exodus\",Space,Str \"2:23-4).\",Space,Str \"This\",Space,Str \"means\",Space,Str \"that\",Space,Str \"they\",Space,Str \"suffered\",Space,Str \"so\",Space,Str \"much\",Space,Str \"that\",Space,Str \"they\",Space,Str \"could\",Space,Str \"not\",Space,Str \"bear\",Space,Str \"it\",Space,Str \"any\",Space,Str \"longer.\",Space,Str \"And\",Space,Str \"they\",Space,Str \"so\",Space,Str \"pleaded\",Space,Str \"with\",Space,Str \"prayer,\",Space,Str \"that\",Space,Str \"\\8220their\",Space,Str \"cry\",Space,Str \"came\",Space,Str \"up\",Space,Str \"unto\",Space,Str \"God.\\8221\"]\n,Para [Str \"But\",Space,Str \"we\",Space,Str \"can\",Space,Str \"see\",Space,Str \"that\",Space,Str \"they\",Space,Str \"were\",Space,Str \"saying,\",Space,Str \"\\8220Would\",Space,Str \"that\",Space,Str \"we\",Space,Str \"had\\8230\",Space,Str \"when\",Space,Str \"we\",Space,Str \"sat\",Space,Str \"by\",Space,Str \"the\",Space,Str \"flesh-pots,\",Space,Str \"when\",Space,Str \"we\",Space,Str \"did\",Space,Str \"eat\",Space,Str \"bread\",Space,Str \"to\",Space,Str \"the\",Space,Str \"full.\\8221\",Space,Str \"And\",Space,Str \"they\",Space,Str \"also\",Space,Str \"said,\",Space,Str \"\\8220We\",Space,Str \"remember\",Space,Str \"the\",Space,Str \"fish,\",Space,Str \"which\",Space,Str \"we\",Space,Str \"would\",Space,Str \"eat\",Space,Str \"in\",Space,Str \"Egypt\",Space,Str \"for\",Space,Str \"naught;\",Space,Str \"the\",Space,Str \"cucumbers,\",Space,Str \"and\",Space,Str \"the\",Space,Str \"melons,\",Space,Str \"and\",Space,Str \"the\",Space,Str \"leeks,\",Space,Str \"and\",Space,Str \"the\",Space,Str \"onions,\",Space,Str \"and\",Space,Str \"the\",Space,Str \"garlic.\\8221\"]\n,Para [Str \"The\",Space,Str \"thing\",Space,Str \"is\",Space,Str \"that,\",Space,Str \"indeed,\",Space,Str \"they\",Space,Str \"were\",Space,Str \"very\",Space,Str \"fond\",Space,Str \"of\",Space,Str \"the\",Space,Str \"work\",Space,Str \"in\",Space,Str \"Egypt.\",Space,Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"meaning\",Space,Str \"of\",Space,Str \"\\8220But\",Space,Str \"mingled\",Space,Str \"themselves\",Space,Str \"with\",Space,Str \"the\",Space,Str \"nations,\",Space,Str \"and\",Space,Str \"learned\",Space,Str \"their\",Space,Str \"works.\\8221\",Space,Str \"It\",Space,Str \"means\",Space,Str \"that\",Space,Str \"if\",Space,Str \"Israel\",Space,Str \"are\",Space,Str \"under\",Space,Str \"the\",Space,Str \"dominion\",Space,Str \"of\",Space,Str \"a\",Space,Str \"certain\",Space,Str \"nation,\",Space,Str \"that\",Space,Str \"nation\",Space,Str \"controls\",Space,Str \"them\",Space,Str \"and\",Space,Str \"they\",Space,Str \"cannot\",Space,Str \"retire\",Space,Str \"from\",Space,Str \"their\",Space,Str \"dominion.\",Space,Str \"Thus,\",Space,Str \"they\",Space,Str \"tasted\",Space,Str \"sufficient\",Space,Str \"flavor\",Space,Str \"in\",Space,Str \"that\",Space,Str \"work\",Space,Str \"and\",Space,Str \"could\",Space,Str \"not\",Space,Str \"be\",Space,Str \"redeemed.\"]\n,Para [Str \"So\",Space,Str \"what\",Space,Str \"did\",Space,Str \"the\",Space,Str \"Creator\",Space,Str \"do?\",Space,Str \"\\8220The\",Space,Str \"king\",Space,Str \"of\",Space,Str \"Egypt\",Space,Str \"died,\\8221\",Space,Str \"meaning\",Space,Str \"they\",Space,Str \"had\",Space,Str \"lost\",Space,Str \"this\",Space,Str \"servitude.\",Space,Str \"Thus\",Space,Str \"they\",Space,Str \"could\",Space,Str \"no\",Space,Str \"longer\",Space,Str \"work;\",Space,Str \"they\",Space,Str \"understood\",Space,Str \"that\",Space,Str \"if\",Space,Str \"there\",Space,Str \"is\",Space,Str \"no\",Space,Str \"perfection\",Space,Str \"of\",Space,Str \"the\",Space,Emph [Str \"Mochin\"],Str \",\",Space,Str \"the\",Space,Str \"servitude\",Space,Str \"is\",Space,Str \"also\",Space,Str \"incomplete.\",Space,Str \"Hence,\",Space,Str \"\\8220and\",Space,Str \"the\",Space,Str \"children\",Space,Str \"of\",Space,Str \"Israel\",Space,Str \"sighed\",Space,Str \"by\",Space,Str \"reason\",Space,Str \"of\",Space,Str \"the\",Space,Str \"bondage.\\8221\",Space,Str \"The\",Space,Str \"work\",Space,Str \"means\",Space,Str \"that\",Space,Str \"they\",Space,Str \"did\",Space,Str \"not\",Space,Str \"suffice\",Space,Str \"for\",Space,Str \"the\",Space,Str \"work,\",Space,Str \"that\",Space,Str \"they\",Space,Str \"had\",Space,Str \"no\",Space,Str \"liveliness\",Space,Str \"in\",Space,Str \"the\",Space,Str \"servitude.\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"meaning\",Space,Str \"of\",Space,Str \"\\8220the\",Space,Str \"king\",Space,Str \"of\",Space,Str \"Egypt\",Space,Str \"died,\\8221\",Space,Str \"that\",Space,Str \"all\",Space,Str \"the\",Space,Str \"dominations\",Space,Str \"of\",Space,Str \"the\",Space,Str \"king\",Space,Str \"of\",Space,Str \"Egypt,\",Space,Str \"which\",Space,Str \"he\",Space,Str \"was\",Space,Str \"providing\",Space,Str \"for\",Space,Str \"and\",Space,Str \"nourishing,\",Space,Str \"had\",Space,Str \"died.\",Space,Str \"This\",Space,Str \"is\",Space,Str \"why\",Space,Str \"they\",Space,Str \"had\",Space,Str \"room\",Space,Str \"for\",Space,Str \"prayer.\",Space,Str \"And\",Space,Str \"they\",Space,Str \"were\",Space,Str \"immediately\",Space,Str \"salvaged.\",Space,Str \"And\",Space,Str \"afterwards,\",Space,Str \"when\",Space,Str \"they\",Space,Str \"walked\",Space,Str \"in\",Space,Str \"the\",Space,Str \"desert\",Space,Str \"and\",Space,Str \"came\",Space,Str \"to\",Space,Str \"a\",Space,Str \"state\",Space,Str \"of\",Space,Emph [Str \"Katnut\"],Space,Str \"(smallness),\",Space,Str \"they\",Space,Str \"craved\",Space,Str \"the\",Space,Str \"servitude\",Space,Str \"that\",Space,Str \"they\",Space,Str \"had\",Space,Str \"had\",Space,Str \"prior\",Space,Str \"to\",Space,Str \"the\",Space,Str \"death\",Space,Str \"of\",Space,Str \"the\",Space,Str \"king\",Space,Str \"of\",Space,Str \"Egypt.\"]]\n"
  },
  {
    "path": "test/docx/normalize.native",
    "content": "[Para [Str \"These\",Space,Str \"are\",Space,Str \"different\",Space,Str \"fonts.\"]\n,Para [Strong [Str \"These\",Space,Emph [Str \"are\",Space,Strikeout [Str \"different\"]],Space,Str \"fonts.\"]]]\n"
  },
  {
    "path": "test/docx/notes.native",
    "content": "[Header 2 (\"a-footnote\",[],[]) [Str \"A\",Space,Str \"footnote\"]\n,Para [Str \"Test\",Space,Str \"footnote.\",Note [Para [Str \"My\",Space,Str \"note.\"]],Space,Str \"Test\",Space,Str \"endnote.\",Note [Para [Str \"This\",Space,Str \"is\",Space,Str \"an\",Space,Str \"endnote\",Space,Str \"at\",Space,Str \"the\",Space,Str \"end\",Space,Str \"of\",Space,Str \"the\",Space,Str \"document.\"]]]]\n"
  },
  {
    "path": "test/docx/numbered_header.native",
    "content": "[Header 1 (\"a-numbered-header.\",[],[]) [Str \"A\",Space,Str \"Numbered\",Space,Str \"Header.\"]]\n"
  },
  {
    "path": "test/docx/overlapping_targets.native",
    "content": "[Para [Link (\"\",[],[]) [Str \"One\",Space,Str \"link\",Space,Str \"to\",Space,Str \"one\",Space,Str \"target.\"] (\"#Fizz\",\"\")]\n,Para [Span (\"Fizz\",[\"anchor\"],[]) [],Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"target\",Space,Str \"with\",Space,Str \"two\",Space,Str \"names.\"]\n,Para [Link (\"\",[],[]) [Str \"Another\",Space,Str \"link\",Space,Str \"to\",Space,Str \"the\",Space,Str \"same\",Space,Str \"target.\"] (\"#Fizz\",\"\")]]\n"
  },
  {
    "path": "test/docx/pageref.native",
    "content": "[Para [Str \"Title\",Space,Link (\"\",[],[]) [Str \"2\"] (\"#title\",\"\")]\n,Para [Str \"Title2\",Space,Link (\"\",[],[]) [Str \"2\"] (\"#title2\",\"\")]\n,Header 1 (\"title\", [],[]) [Str \"Title\"]\n,Header 1 (\"title2\",[],[]) [Str \"Title2\"]]\n"
  },
  {
    "path": "test/docx/paragraph_insertion_deletion_accept.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\"]\n,Para [Str \"split\",Space,Str \"Paragraph.\"]]\n"
  },
  {
    "path": "test/docx/paragraph_insertion_deletion_all.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Span (\"\",[\"paragraph-insertion\"],[(\"author\",\"Seeley, Jason\"),(\"date\",\"2017-09-17T16:39:00Z\")]) []]\n,Para [Str \"split\",Span (\"\",[\"paragraph-deletion\"],[(\"author\",\"Seeley, Jason\"),(\"date\",\"2017-09-17T16:39:00Z\")]) []]\n,Para [Str \"Paragraph.\"]]\n"
  },
  {
    "path": "test/docx/paragraph_insertion_deletion_reject.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"split\"]\n,Para [Str \"Paragraph.\"]]\n"
  },
  {
    "path": "test/docx/raw-blocks.native",
    "content": "[Para [Str \"Cell\",Space,Str \"compartments\"]\n,RawBlock (Format \"openxml\") \"<w:tbl>\\n<w:tblPr>\\n<w:tblW w:w=\\\"2000\\\" w:type=\\\"pct\\\"/>\\n<w:tblBorders>\\n<w:top w:val=\\\"single\\\" w:sz=\\\"4\\\" w:color=\\\"198200\\\"/>\\n<w:start w:val=\\\"single\\\" w:sz=\\\"4\\\" w:color=\\\"198200\\\"/>\\n<w:bottom w:val=\\\"single\\\" w:sz=\\\"4\\\" w:color=\\\"198200\\\"/>\\n<w:end w:val=\\\"single\\\" w:sz=\\\"4\\\" w:color=\\\"198200\\\"/>\\n</w:tblBorders>\\n</w:tblPr>\\n<w:tblGrid>\\n<w:gridCol w:w=\\\"1871\\\" />\\n<w:gridCol w:w=\\\"1872\\\" />\\n</w:tblGrid>\\n<w:tr>\\n<w:tc>\"\n,Para [Str \"Ribosome\"]\n,RawBlock (Format \"openxml\") \"</w:tc>\\n<w:tc>\"\n,Para [Str \"Lysosome\"]\n,RawBlock (Format \"openxml\") \"</w:tc>\\n</w:tr>\\n</w:tbl>\"]\n"
  },
  {
    "path": "test/docx/raw-bookmarks.native",
    "content": "[Para [Str \"Manual\",Space,Str \"endnotes.\"]\n,Para [Str \"Nullam\",Space,Str \"eu\",Space,Str \"ante\",Space,Str \"vel\",Space,Str \"est\",Space,Str \"convallis\",Space,Str \"dignissim.\",Space,Str \"Nunc\",Space,Str \"porta\",Space,Str \"vulputate\",Space,Str \"tellus.\",Space,Str \"Nunc\",Space,Str \"rutrum\",Space,Str \"turpis\",Space,Str \"sed\",Space,Str \"pede.\",Space,Str \"Sed\",Space,Str \"bibendum.\",RawInline (Format \"openxml\") \"<w:bookmarkStart w:id=\\\"0\\\" w:name=\\\"Aliquam\\\"/>\",Str \"Aliquam\",Space,Str \"posuere.\"]\n,Para [Str \"Nunc\",Space,Str \"aliquet,\",Space,Str \"augue\",Space,Str \"nec\",Space,Str \"adipiscing\",Space,Str \"interdum,\",Space,Str \"lacus\",Space,Str \"tellus\",Space,Str \"malesuada\",Space,Str \"massa,\",Space,Str \"quis\",Space,Str \"varius\",Space,Str \"mi\",Space,Str \"purus\",Space,Str \"non\",Space,Str \"odio.\",RawInline (Format \"openxml\") \"<w:bookmarkEnd w:id=\\\"0\\\"/>\",Str \"Pellentesque\",Space,Str \"condimentum,\",Space,Str \"magna\",Space,Str \"ut\",Space,Str \"suscipit\",Space,Str \"hendrerit,\",Space,Str \"ipsum\",Space,Str \"augue\",Space,Str \"ornare\",Space,Str \"nulla,\",Space,Str \"non\",Space,Str \"luctus\",Space,Str \"diam\",Space,Str \"neque\",Space,Str \"sit\",Space,Str \"amet\",Space,Str \"urna.\",Space,Str \"Curabitur\",Space,Str \"vulputate\",Space,Str \"vestibulum\",Space,Str \"lorem.\"]]\n"
  },
  {
    "path": "test/docx/relative_indentation_blockquotes.native",
    "content": "[Header 1 (\"indentation-blockquotes\",[],[]) [Str \"Indentation\",Space,Str \"blockquotes\"]\n,Para [Str \"Foobar\"]\n,Para [Str \"First\",Space,Str \"line\",Space,Str \"indented.\"]\n,Para [Str \"Normal\",Space,Str \"list\",Space,Str \"paragraph\"]\n,Para [Str \"List\",Space,Str \"paragraph\",Space,Str \"with\",Space,Str \"less\",Space,Str \"indent\"]\n,BlockQuote [Para [Str \"List\",Space,Str \"paragraph\",Space,Str \"with\",Space,Str \"more\",Space,Str \"indent\"]]]\n"
  },
  {
    "path": "test/docx/sdt_elements.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.16167023554603854 )\n    , ( AlignDefault , ColWidth 0.16167023554603854 )\n    , ( AlignDefault , ColWidth 0.40920770877944324 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"col1Header\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"col2Header\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignCenter\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"col3Header\" ] ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"col1\" , Space , Str \"content\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Body\" , Space , Str \"copy\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"col3\" , Space , Str \"content\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/sdt_in_footnote.native",
    "content": "[Para [Str \"Lorem\",Space,Str \"ipsum\",Space,Str \"dolor\",Space,Str \"sit\",Space,Str \"amet.\",Note [Para [Str \"Vgl.\",Space,Emph [Str \"Bitzios\"],Space,Str \"u.\",Space,Str \"a.:\",Space,Str \"Dissonance\",Space,Str \"in\",Space,Str \"the\",Space,Str \"food\",Space,Str \"traceability\",Space,Str \"regulatory\",Space,Str \"environment\",Space,Str \"and\",Space,Str \"food\",Space,Str \"fraud,\",Space,Str \"in:\",Space,Str \"Dries\",Space,Str \"u.\",Space,Str \"a.\",Space,Str \"(Hrsg.):\",Space,Str \"It\\8217s\",Space,Str \"a\",Space,Str \"jungle\",Space,Str \"out\",Space,Str \"there\",Space,Str \"-\",Space,Str \"the\",Space,Str \"strange\",Space,Str \"animals\",Space,Str \"of\",Space,Str \"economic\",Space,Str \"organization\",Space,Str \"in\",Space,Str \"agri-food\",Space,Str \"value\",Space,Str \"chains,\",Space,Str \"Wageningen\",Space,Str \"im\",Space,Str \"Druck,\",Space,Str \"hier\",Space,Str \"S.\\160\\&100-105.\"]]]]\n"
  },
  {
    "path": "test/docx/special_punctuation.native",
    "content": "[Para [Str \"Soft\",Space,Str \"hyphen:\",Space,Str \"[\\173]\"]\n,Para [Str \"Non-breaking\",Space,Str \"hyphen:\",Space,Str \"[\\8209]\"]]\n"
  },
  {
    "path": "test/docx/table_captions_no_field.native",
    "content": "[ Para\n    [ Str \"See\" , Space , Str \"Table\" , Space , Str \"5.1.\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing [ Para [ Str \"Table\" , Space , Str \"5.1\" ] ])\n    [ ( AlignDefault , ColWidth 0.7605739372523824 )\n    , ( AlignDefault , ColWidth 0.11971303137380876 )\n    , ( AlignDefault , ColWidth 0.11971303137380876 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Count\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"%\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" , Space , Str \"option\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"242\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"45\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" , Space , Str \"option\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"99\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"18\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Header 2 ( \"section\" , [] , [] ) []\n]"
  },
  {
    "path": "test/docx/table_captions_with_field.native",
    "content": "[ Para\n    [ Str \"See\"\n    , Space\n    , Link\n        ( \"\" , [] , [] )\n        [ Str \"Table\" , Space , Str \"1\" ]\n        ( \"#_Ref71265628\" , \"\" )\n    , Str \".\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Para\n           [ Span ( \"_Ref71265628\" , [ \"anchor\" ] , [] ) []\n           , Str \"Table\"\n           , Space\n           , Str \"1\"\n           ]\n       ])\n    [ ( AlignDefault , ColWidth 0.7605739372523824 )\n    , ( AlignDefault , ColWidth 0.11971303137380876 )\n    , ( AlignDefault , ColWidth 0.11971303137380876 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Count\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"%\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" , Space , Str \"option\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"242\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"45\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" , Space , Str \"option\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"99\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"18\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Header 2 ( \"section\" , [] , [] ) []\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Para\n           [ Span ( \"_Ref71265695\" , [ \"anchor\" ] , [] ) []\n           , Str \"Table\"\n           , Space\n           , Str \"2\"\n           ]\n       ])\n    [ ( AlignDefault , ColWidth 0.33329636202307006 )\n    , ( AlignDefault , ColWidth 0.33329636202307006 )\n    , ( AlignDefault , ColWidth 0.33340727595385977 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"One\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Two\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Three\" ] ]\n           ]\n       ])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"See\"\n    , Space\n    , Link\n        ( \"\" , [] , [] )\n        [ Str \"Table\" , Space , Str \"2\" ]\n        ( \"#_Ref71265695\" , \"\" )\n    , Str \".\"\n    ]\n]\n"
  },
  {
    "path": "test/docx/table_gridbefore.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 7.883369330453563e-3 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 3.0669546436285097e-2 )\n    , ( AlignDefault , ColWidth 0.42861771058315334 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 8)\n               [ Plain [ Str \"Bits\" ] ]\n           , Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"TEXT\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"BINARY\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"HYPERLINKS\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"FILEURL\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"LOCATION\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"ENHANCED\" , Space , Str \"STATUS\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Value\"\n                    , Space\n                    , Str \"allocated\"\n                    , Space\n                    , Str \"for\"\n                    , Space\n                    , Str \"use\"\n                    , Space\n                    , Str \"in\"\n                    , Space\n                    , Str \"interworking\"\n                    , Space\n                    , Str \"(NOTE)\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"LOCATION\" , Space , Str \"ALTITUDE\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"LOCATION\" , Space , Str \"TIMESTAMP\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"CODED\" , Space , Str \"TEXT\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 10)\n                [ Plain\n                    [ Str \"All\"\n                    , Space\n                    , Str \"other\"\n                    , Space\n                    , Str \"values\"\n                    , Space\n                    , Str \"are\"\n                    , Space\n                    , Str \"reserved.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 10)\n                [ Plain\n                    [ Str \"NOTE:\"\n                    , Space\n                    , Str \"Usage\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"this\"\n                    , Space\n                    , Str \"value\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"described\"\n                    , Space\n                    , Str \"in\"\n                    , Space\n                    , Str \"3GPP\\160TS\\160\\&29.582\\160[48].\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n"
  },
  {
    "path": "test/docx/table_header_rowspan.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidth 0.30701754385964913 )\n    , ( AlignDefault , ColWidth 0.13645224171539963 )\n    , ( AlignDefault , ColWidth 0.10009746588693959 )\n    , ( AlignDefault , ColWidth 9.707602339181289e-2 )\n    , ( AlignDefault , ColWidth 7.719298245614035e-2 )\n    , ( AlignDefault , ColWidth 7.085769980506823e-2 )\n    , ( AlignDefault , ColWidth 7.09551656920078e-2 )\n    , ( AlignDefault , ColWidth 0.14035087719298248 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"B\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"C\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"D\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 3)\n               [ Plain [ Str \"E\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain [ Str \"F\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"G\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"H\" ] ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Strong [ Str \"I\" ] ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignLeft\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"6\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"7\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"8\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/table_one_header_row.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.3330243337195829 )\n    , ( AlignDefault , ColWidth 0.33325608342989577 )\n    , ( AlignDefault , ColWidth 0.33371958285052145 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"One\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Row\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Table\" ] ]\n           ]\n       ])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/table_one_row.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.33333333333333337 )\n    , ( AlignDefault , ColWidth 0.33333333333333337 )\n    , ( AlignDefault , ColWidth 0.33333333333333337 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"One\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Table\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/table_variable_width.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 1.9673503557974047e-2 )\n    , ( AlignDefault , ColWidth 1.946421096693177e-2 )\n    , ( AlignDefault , ColWidth 0.21735035579740478 )\n    , ( AlignDefault , ColWidth 0.4660946002511511 )\n    , ( AlignDefault , ColWidth 1.0464629552113855e-4 )\n    , ( AlignDefault , ColWidth 0.25627877773126834 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"h3\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"h4\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"h5\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 3)\n                [ Plain [ Str \"c11\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 2) []\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain [ Str \"c22\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"c23\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 2) []\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/table_with_list_cell.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.5 )\n    , ( AlignDefault , ColWidth 0.5 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Cell\"\n                   , Space\n                   , Str \"with\"\n                   , Space\n                   , Str \"text\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Cell\"\n                   , Space\n                   , Str \"with\"\n                   , Space\n                   , Str \"text\"\n                   ]\n               ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ BulletList\n                    [ [ Para [ Str \"Cell\" , Space , Str \"with\" ] ]\n                    , [ Para [ Str \"A\" ] ]\n                    , [ Para [ Str \"Bullet\" , Space , Str \"list\" ] ]\n                    ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ OrderedList\n                    ( 1 , Decimal , Period )\n                    [ [ Para [ Str \"Cell\" , Space , Str \"with\" ] ]\n                    , [ Para [ Str \"A\" ] ]\n                    , [ Para [ Str \"Numbered\" , Space , Str \"list.\" ] ]\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/tables-default-widths.native",
    "content": "[Header 2 (\"a-table-with-and-without-a-header-row\",[],[]) [Str \"A\",Space,Str \"table,\",Space,Str \"with\",Space,Str \"and\",Space,Str \"without\",Space,Str \"a\",Space,Str \"header\",Space,Str \"row\"]\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Name\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Game\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Fame\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Blame\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Lebron\",Space,Str \"James\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Basketball\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Very\",Space,Str \"High\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Leaving\",Space,Str \"Cleveland\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Ryan\",Space,Str \"Braun\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Baseball\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Moderate\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Steroids\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Russell\",Space,Str \"Wilson\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Football\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"High\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Tacky\",Space,Str \"uniform\"]]]])]\n (TableFoot (\"\",[],[])\n [])\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Sinple\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Table\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Without\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Header\"]]]])]\n (TableFoot (\"\",[],[])\n [])\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Simple\"]\n    ,Para [Str \"Multiparagraph\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Table\"]\n    ,Para [Str \"Full\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Of\"]\n    ,Para [Str \"Paragraphs\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"In\",Space,Str \"each\"]\n    ,Para [Str \"Cell.\"]]]])]\n (TableFoot (\"\",[],[])\n [])]"
  },
  {
    "path": "test/docx/tables.native",
    "content": "[ Header\n    2\n    ( \"a-table-with-and-without-a-header-row\" , [] , [] )\n    [ Str \"A\"\n    , Space\n    , Str \"table,\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"header\"\n    , Space\n    , Str \"row\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.25 )\n    , ( AlignDefault , ColWidth 0.25 )\n    , ( AlignDefault , ColWidth 0.25 )\n    , ( AlignDefault , ColWidth 0.25 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Name\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Game\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Fame\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Blame\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Lebron\" , Space , Str \"James\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Basketball\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Very\" , Space , Str \"High\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Leaving\" , Space , Str \"Cleveland\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Ryan\" , Space , Str \"Braun\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Baseball\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Moderate\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Steroids\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Russell\" , Space , Str \"Wilson\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Football\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"High\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Tacky\" , Space , Str \"uniform\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.5 )\n    , ( AlignDefault , ColWidth 0.5 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Sinple\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Table\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Without\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Header\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.5 )\n    , ( AlignDefault , ColWidth 0.5 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"Simple\" ]\n                , Para [ Str \"Multiparagraph\" ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"Table\" ] , Para [ Str \"Full\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"Of\" ] , Para [ Str \"Paragraphs\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Para [ Str \"In\" , Space , Str \"each\" ]\n                , Para [ Str \"Cell.\" ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]"
  },
  {
    "path": "test/docx/tables_separated_with_rawblock.native",
    "content": "[Table (\"\", [], []) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[]) [])\n [TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"a\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"b\"]]]]]\n (TableFoot (\"\",[],[]) [])\n,RawBlock (Format \"latex\") \"\"\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n   (TableHead (\"\",[],[]) [])\n   [TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"c\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"d\"]]]]]\n (TableFoot (\"\",[],[]) [])]\n"
  },
  {
    "path": "test/docx/tabs.native",
    "content": "[Para [Str \"Some\",Space,Str \"text\",Space,Str \"separated\",Space,Str \"by\",Space,Str \"a\",Space,Str \"tab.\"]\n,Para [Str \"Tab-indented\",Space,Str \"text.\"]]\n"
  },
  {
    "path": "test/docx/task_list.native",
    "content": "[ BulletList\n    [ [ Para [ Str \"\\9744\" , Space , Str \"Unchecked\" ] ]\n    , [ Para [ Str \"\\9746\" , Space , Str \"Checked\" ]\n      , Para\n          [ Str \"with\"\n          , Space\n          , Str \"continuation\"\n          , Space\n          , Str \"paragraph\"\n          ]\n      ]\n    , [ Para [ Str \"\\9744\" , Space , Str \"Unchecked\" ]\n      , BulletList\n          [ [ Plain\n                [ Str \"\\9746\"\n                , Space\n                , Str \"Checked\"\n                , Space\n                , Str \"sublist\"\n                ]\n            , BulletList\n                [ [ Plain\n                      [ Str \"\\9744\"\n                      , Space\n                      , Str \"Unchecked\"\n                      , Space\n                      , Str \"subsublist\"\n                      ]\n                  , OrderedList\n                      ( 1 , Decimal , Period )\n                      [ [ Plain [ Str \"Numbered\" , Space , Str \"child\" ]\n                        ]\n                      ]\n                  ]\n                ]\n            ]\n          ]\n      ]\n    ]\n]\n"
  },
  {
    "path": "test/docx/text_in_shape_format.native",
    "content": "[ Para\n    [ Str \"Last\"\n    , Space\n    , Str \"update:\"\n    , Space\n    , Str \"May\"\n    , Space\n    , Str \"1,\"\n    , Space\n    , Str \"2017\"\n    ]\n, Para\n    [ Str \"U\"\n    , Str \"sing\"\n    , Space\n    , Str \"Microsoft\"\n    , Space\n    , Str \"Word\"\n    , Space\n    , Str \"2007/2010\"\n    , LineBreak\n    , Str \"for\"\n    , Space\n    , Str \"Writing\"\n    , Space\n    , Str \"Technical\"\n    , Space\n    , Str \"Documents\"\n    ]\n, Para [ Str \"Valter\" , Space , Str \"Kiisk\" ]\n, Para [ Str \"Institute\" , Space , Str \"of\" , Space , Str \"Physics,\" , Space , Str \"University\" , Space , Str \"of\" , Space , Str \"Tartu\" ]\n, Para []\n]"
  },
  {
    "path": "test/docx/textbox_image.native",
    "content": "[ Para\n    [ Str \"The\"\n    , Space\n    , Str \"image\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"below.\"\n    ]\n, Para\n    [ Image\n        ( \"\"\n        , []\n        , [ ( \"width\" , \"4.543038057742782in\" )\n          , ( \"height\" , \"2.9166666666666665in\" )\n          ]\n        )\n        []\n        ( \"media/image1.png\" , \"\" )\n    ]\n, Para\n    [ Str \"The\"\n    , Space\n    , Str \"image\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"above.\"\n    ]\n]\n"
  },
  {
    "path": "test/docx/textbox_image_duplicate_encoding.native",
    "content": "[ Para\n    [ Str \"The\"\n    , Space\n    , Str \"image\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"below.\"\n    ]\n, Para\n    [ Image\n        ( \"\"\n        , []\n        , [ ( \"width\" , \"4.543038057742782in\" )\n          , ( \"height\" , \"2.9166666666666665in\" )\n          ]\n        )\n        []\n        ( \"media/image1.png\" , \"\" )\n    ]\n, Para\n    [ Str \"The\"\n    , Space\n    , Str \"image\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"above.\"\n    ]\n]\n"
  },
  {
    "path": "test/docx/track_changes_deletion_accept.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"text\",Space,Str \"with\",Space,Str \"a\",Space,Str \"deletion.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_deletion_all.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"text\",Space,Str \"with\",Space,Str \"a\",Span (\"\",[\"deletion\"],[(\"author\",\"eng-dept\"),(\"date\",\"2014-06-25T10:42:00Z\")]) [Str \"n\",Space,Str \"excessively\",Space,Str \"modified\"],Space,Str \"deletion.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_deletion_reject.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"text\",Space,Str \"with\",Space,Str \"an\",Space,Str \"excessively\",Space,Str \"modified\",Space,Str \"deletion.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_insertion_accept.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"text\",Space,Str \"with\",Space,Str \"two\",Space,Str \"exciting\",Space,Str \"insertions.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_insertion_all.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"text\",Space,Str \"with\",Space,Span (\"\",[\"insertion\"],[(\"author\",\"eng-dept\"),(\"date\",\"2014-06-25T10:40:00Z\")]) [Str \"two\",Space,Str \"exciting\"],Space,Str \"insertions.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_insertion_reject.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"text\",Space,Str \"with\",Space,Str \"insertions.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_move_accept.native",
    "content": "[Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"text.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"the\",Space,Str \"text\",Space,Str \"to\",Space,Str \"be\",Space,Str \"moved.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"more\",Space,Str \"text.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_move_all.native",
    "content": "[Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"text.\"]\n,Para [Span (\"\",[\"insertion\"],[(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-04-16T08:20:00Z\")]) [Str \"Here\",Space,Str \"is\",Space,Str \"the\",Space,Str \"text\",Space,Str \"to\",Space,Str \"be\",Space,Str \"moved.\"]]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"more\",Space,Str \"text.\"]\n,Para [Span (\"\",[\"deletion\"],[(\"author\",\"Jesse Rosenthal\"),(\"date\",\"2016-04-16T08:20:00Z\")]) [Str \"Here\",Space,Str \"is\",Space,Str \"the\",Space,Str \"text\",Space,Str \"to\",Space,Str \"be\",Space,Str \"moved.\"]]]\n"
  },
  {
    "path": "test/docx/track_changes_move_reject.native",
    "content": "[Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"text.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"more\",Space,Str \"text.\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Str \"the\",Space,Str \"text\",Space,Str \"to\",Space,Str \"be\",Space,Str \"moved.\"]]\n"
  },
  {
    "path": "test/docx/track_changes_scrubbed_metadata.native",
    "content": "[Para [ Str \"Here\", Space, Str \"is\", Space, Str \"a\", Space\n      , Span (\"\",[\"deletion\"],[(\"author\",\"Author\")]) [Str \"dummy\"]\n      , Span (\"\",[\"insertion\"],[(\"author\",\"Author\")]) [Str \"test\"]\n      , Space\n      , Span (\"\",[\"comment-start\"],[(\"id\",\"3\"),(\"author\",\"Author\")]) \n        [Str \"With\",Space,Str \"a\",Space,Str \"comment!\"]\n      , Str \"document\",Span (\"\",[\"comment-end\"],[(\"id\",\"3\")]) [],Str \".\"\n      ]\n]\n"
  },
  {
    "path": "test/docx/trailing_spaces_in_formatting.native",
    "content": "[Para [Str \"Turn\",Space,Str \"my\",Space,Emph [Str \"formatting\"],Space,Str \"off\",Space,Str \"after\",Space,Str \"the\",Space,Str \"spaces.\"]]\n"
  },
  {
    "path": "test/docx/trim_last_inline.native",
    "content": "[Para [Strong [Str \"Foo\",Space,Str \"bar.\"]]\n,Para [Str \"Fizz\",Space,Str \"pop.\"]]\n"
  },
  {
    "path": "test/docx/unicode.native",
    "content": "[Para [Str \"Hello,\",Space,Str \"\\19990\\30028.\",Space,Str \"This\",Space,Str \"costs\",Space,Str \"\\8364\\&10.\\8744\\8744(\"]]\n"
  },
  {
    "path": "test/docx/unused_anchors.native",
    "content": "[Header 1 (\"my-section\",[],[]) [Str \"My\",Space,Str \"Section\"]\n,Para [Link (\"\",[],[]) [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"link.\"] (\"#Foo\",\"\")]\n,Para [Span (\"Foo\",[\"anchor\"],[]) [],Str \"Here\",Space,Str \"is\",Space,Str \"the\",Space,Str \"target.\"]]\n"
  },
  {
    "path": "test/docx/verbatim_subsuper.native",
    "content": "[Para [Str \"m\",Superscript [Str \"2\"]]\n,Para [Str \"m\",Superscript [Code (\"\",[],[]) \"2\"]]\n,Para [Code (\"\",[],[]) \"m\",Superscript [Str \"2\"]]\n,Para [Code (\"\",[],[]) \"m\",Superscript [Code (\"\",[],[]) \"2\"]]\n,Para [Str \"m\",Subscript [Str \"2\"]]\n,Para [Str \"m\",Subscript [Code (\"\",[],[]) \"2\"]]\n,Para [Code (\"\",[],[]) \"m\",Subscript [Str \"2\"]]\n,Para [Code (\"\",[],[]) \"m\",Subscript [Code (\"\",[],[]) \"2\"]]]\n"
  },
  {
    "path": "test/docx/zotero_citations_minus.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      , Space\n      , Str \"(Smith\"\n      , Space\n      , Str \"et\"\n      , Space\n      , Str \"al.,\"\n      , Space\n      , Str \"2013)\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"sources\"\n      , Space\n      , Str \"(Boer\"\n      , Space\n      , Str \"et\"\n      , Space\n      , Str \"al.,\"\n      , Space\n      , Str \"2016;\"\n      , Space\n      , Str \"Smith\"\n      , Space\n      , Str \"et\"\n      , Space\n      , Str \"al.,\"\n      , Space\n      , Str \"2013).\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"additional\"\n      , Space\n      , Str \"prefix,\"\n      , Space\n      , Str \"suffix\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"page\"\n      , Space\n      , Str \"number\"\n      , Space\n      , Str \"(prefix\"\n      , Space\n      , Str \"Bellomo\"\n      , Space\n      , Str \"et\"\n      , Space\n      , Str \"al.,\"\n      , Space\n      , Str \"2016,\"\n      , Space\n      , Str \"p.\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"suffix).\"\n      ]\n  , Header\n      1\n      ( \"reference-list\" , [] , [] )\n      [ Str \"Reference\" , Space , Str \"list\" ]\n  , Para\n      [ Str \"Bellomo,\"\n      , Space\n      , Str \"K.,\"\n      , Space\n      , Str \"Clement,\"\n      , Space\n      , Str \"A.\"\n      , Space\n      , Str \"C.,\"\n      , Space\n      , Str \"Murphy,\"\n      , Space\n      , Str \"L.\"\n      , Space\n      , Str \"N.,\"\n      , Space\n      , Str \"Polvani,\"\n      , Space\n      , Str \"L.\"\n      , Space\n      , Str \"M.,\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Cane,\"\n      , Space\n      , Str \"M.\"\n      , Space\n      , Str \"A.\"\n      , Space\n      , Str \"(2016).\"\n      , Space\n      , Str \"New\"\n      , Space\n      , Str \"observational\"\n      , Space\n      , Str \"evidence\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"positive\"\n      , Space\n      , Str \"cloud\"\n      , Space\n      , Str \"feedback\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"amplifies\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"Atlantic\"\n      , Space\n      , Str \"Multidecadal\"\n      , Space\n      , Str \"Oscillation.\"\n      , Space\n      , Emph\n          [ Str \"Geophys.\"\n          , Space\n          , Str \"Res.\"\n          , Space\n          , Str \"Lett.\"\n          ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"43\" ]\n      , Str \"(18),\"\n      , Space\n      , Str \"9852\\8211\\&9859.\"\n      , Space\n      , Str \"https://doi.org/10.1002/2016GL069961\"\n      ]\n  , Para\n      [ Str \"Boer,\"\n      , Space\n      , Str \"G.\"\n      , Space\n      , Str \"J.,\"\n      , Space\n      , Str \"Smith,\"\n      , Space\n      , Str \"D.\"\n      , Space\n      , Str \"M.,\"\n      , Space\n      , Str \"Cassou,\"\n      , Space\n      , Str \"C.,\"\n      , Space\n      , Str \"Doblas-Reyes,\"\n      , Space\n      , Str \"F.,\"\n      , Space\n      , Str \"Danabasoglu,\"\n      , Space\n      , Str \"G.,\"\n      , Space\n      , Str \"Kirtman,\"\n      , Space\n      , Str \"B.,\"\n      , Space\n      , Str \"Kushnir,\"\n      , Space\n      , Str \"Y.,\"\n      , Space\n      , Str \"Kimoto,\"\n      , Space\n      , Str \"M.,\"\n      , Space\n      , Str \"Meehl,\"\n      , Space\n      , Str \"G.\"\n      , Space\n      , Str \"A.,\"\n      , Space\n      , Str \"Msadek,\"\n      , Space\n      , Str \"R.,\"\n      , Space\n      , Str \"M\\252ller,\"\n      , Space\n      , Str \"W.\"\n      , Space\n      , Str \"A.,\"\n      , Space\n      , Str \"Taylor,\"\n      , Space\n      , Str \"K.\"\n      , Space\n      , Str \"E.,\"\n      , Space\n      , Str \"Zwiers,\"\n      , Space\n      , Str \"F.,\"\n      , Space\n      , Str \"Rixen,\"\n      , Space\n      , Str \"M.,\"\n      , Space\n      , Str \"Ruprich-Robert,\"\n      , Space\n      , Str \"Y.,\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Eade,\"\n      , Space\n      , Str \"R.\"\n      , Space\n      , Str \"(2016).\"\n      , Space\n      , Str \"The\"\n      , Space\n      , Str \"Decadal\"\n      , Space\n      , Str \"Climate\"\n      , Space\n      , Str \"Prediction\"\n      , Space\n      , Str \"Project\"\n      , Space\n      , Str \"(DCPP).\"\n      , Space\n      , Emph\n          [ Str \"Geoscientific\"\n          , Space\n          , Str \"Model\"\n          , Space\n          , Str \"Development\"\n          ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"9\" ]\n      , Str \",\"\n      , Space\n      , Str \"3751\\8211\\&3777.\"\n      , Space\n      , Str \"https://doi.org/10.5194/gmd-9-3751-2016\"\n      ]\n  , Para\n      [ Str \"Smith,\"\n      , Space\n      , Str \"D.\"\n      , Space\n      , Str \"M.,\"\n      , Space\n      , Str \"Eade,\"\n      , Space\n      , Str \"R.,\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Pohlmann,\"\n      , Space\n      , Str \"H.\"\n      , Space\n      , Str \"(2013).\"\n      , Space\n      , Str \"A\"\n      , Space\n      , Str \"comparison\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"full-field\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"anomaly\"\n      , Space\n      , Str \"initialization\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"seasonal\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"decadal\"\n      , Space\n      , Str \"climate\"\n      , Space\n      , Str \"prediction.\"\n      , Space\n      , Emph [ Str \"Climate\" , Space , Str \"Dynamics\" ]\n      , Str \",\"\n      , Space\n      , Emph [ Str \"41\" ]\n      , Str \"(11\\8211\\&12),\"\n      , Space\n      , Str \"3325\\8211\\&3338.\"\n      , Space\n      , Str \"https://doi.org/10.1007/s00382-013-1683-2\"\n      ]\n  ]\n"
  },
  {
    "path": "test/docx/zotero_citations_plus.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"references\"\n            , MetaList\n                [ MetaMap\n                    (fromList\n                       [ ( \"DOI\" , MetaString \"10.1002/2016GL069961\" )\n                       , ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Bellomo\"\n                                      )\n                                    , ( \"given\" , MetaString \"K.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Clement\"\n                                      )\n                                    , ( \"given\" , MetaString \"A.C.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Murphy\" )\n                                    , ( \"given\" , MetaString \"L.N.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Polvani\"\n                                      )\n                                    , ( \"given\" , MetaString \"L.M.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Cane\" )\n                                    , ( \"given\" , MetaString \"M.A.\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines\n                             [ Str \"Geophys.\"\n                             , Space\n                             , Str \"Res.\"\n                             , Space\n                             , Str \"Lett.\"\n                             ]\n                         )\n                       , ( \"id\" , MetaString \"10\" )\n                       , ( \"issue\" , MetaInlines [ Str \"18\" ] )\n                       , ( \"issued\" , MetaString \"2016\" )\n                       , ( \"language\" , MetaInlines [ Str \"en\" ] )\n                       , ( \"page\"\n                         , MetaInlines [ Str \"9852\\8211\\&9859\" ]\n                         )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"New\"\n                             , Space\n                             , Str \"observational\"\n                             , Space\n                             , Str \"evidence\"\n                             , Space\n                             , Str \"for\"\n                             , Space\n                             , Str \"a\"\n                             , Space\n                             , Str \"positive\"\n                             , Space\n                             , Str \"cloud\"\n                             , Space\n                             , Str \"feedback\"\n                             , Space\n                             , Str \"that\"\n                             , Space\n                             , Str \"amplifies\"\n                             , Space\n                             , Str \"the\"\n                             , Space\n                             , Str \"Atlantic\"\n                             , Space\n                             , Str \"Multidecadal\"\n                             , Space\n                             , Str \"Oscillation\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"43\" ] )\n                       ])\n                , MetaMap\n                    (fromList\n                       [ ( \"DOI\"\n                         , MetaString \"10.1007/s00382-013-1683-2\"\n                         )\n                       , ( \"ISSN\" , MetaString \"0930-7575, 1432-0894\" )\n                       , ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Smith\" )\n                                    , ( \"given\" , MetaString \"Doug M.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Eade\" )\n                                    , ( \"given\" , MetaString \"Rosie\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Pohlmann\"\n                                      )\n                                    , ( \"given\" , MetaString \"Holger\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines\n                             [ Str \"Climate\" , Space , Str \"Dynamics\" ]\n                         )\n                       , ( \"id\" , MetaString \"109\" )\n                       , ( \"issue\" , MetaInlines [ Str \"11-12\" ] )\n                       , ( \"issued\" , MetaString \"2013-12\" )\n                       , ( \"language\" , MetaInlines [ Str \"en\" ] )\n                       , ( \"page\"\n                         , MetaInlines [ Str \"3325\\8211\\&3338\" ]\n                         )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"A\"\n                             , Space\n                             , Str \"comparison\"\n                             , Space\n                             , Str \"of\"\n                             , Space\n                             , Str \"full-field\"\n                             , Space\n                             , Str \"and\"\n                             , Space\n                             , Str \"anomaly\"\n                             , Space\n                             , Str \"initialization\"\n                             , Space\n                             , Str \"for\"\n                             , Space\n                             , Str \"seasonal\"\n                             , Space\n                             , Str \"to\"\n                             , Space\n                             , Str \"decadal\"\n                             , Space\n                             , Str \"climate\"\n                             , Space\n                             , Str \"prediction\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"41\" ] )\n                       ])\n                , MetaMap\n                    (fromList\n                       [ ( \"DOI\"\n                         , MetaString \"10.5194/gmd-9-3751-2016\"\n                         )\n                       , ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Boer\" )\n                                    , ( \"given\" , MetaString \"G.J.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Smith\" )\n                                    , ( \"given\" , MetaString \"D.M.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Cassou\" )\n                                    , ( \"given\" , MetaString \"C.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Doblas-Reyes\"\n                                      )\n                                    , ( \"given\" , MetaString \"F.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Danabasoglu\"\n                                      )\n                                    , ( \"given\" , MetaString \"G.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Kirtman\"\n                                      )\n                                    , ( \"given\" , MetaString \"B.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Kushnir\"\n                                      )\n                                    , ( \"given\" , MetaString \"Y.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Kimoto\" )\n                                    , ( \"given\" , MetaString \"M.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Meehl\" )\n                                    , ( \"given\" , MetaString \"G.A.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Msadek\" )\n                                    , ( \"given\" , MetaString \"R.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"M\\252ller\"\n                                      )\n                                    , ( \"given\" , MetaString \"W.A.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Taylor\" )\n                                    , ( \"given\" , MetaString \"K.E.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Zwiers\" )\n                                    , ( \"given\" , MetaString \"F.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Rixen\" )\n                                    , ( \"given\" , MetaString \"M.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Ruprich-Robert\"\n                                      )\n                                    , ( \"given\" , MetaString \"Y.\" )\n                                    ])\n                             , MetaMap\n                                 (fromList\n                                    [ ( \"family\" , MetaString \"Eade\" )\n                                    , ( \"given\" , MetaString \"R.\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines\n                             [ Str \"Geoscientific\"\n                             , Space\n                             , Str \"Model\"\n                             , Space\n                             , Str \"Development\"\n                             ]\n                         )\n                       , ( \"id\" , MetaString \"6\" )\n                       , ( \"issued\" , MetaString \"2016\" )\n                       , ( \"language\" , MetaInlines [ Str \"en\" ] )\n                       , ( \"page\"\n                         , MetaInlines [ Str \"3751\\8211\\&3777\" ]\n                         )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"The\"\n                             , Space\n                             , Str \"Decadal\"\n                             , Space\n                             , Str \"Climate\"\n                             , Space\n                             , Str \"Prediction\"\n                             , Space\n                             , Str \"Project\"\n                             , Space\n                             , Str \"(DCPP)\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"9\" ] )\n                       ])\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"109\"\n              , citationPrefix = []\n              , citationSuffix = []\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          ]\n          [ Str \"(Smith\"\n          , Space\n          , Str \"et\"\n          , Space\n          , Str \"al.,\"\n          , Space\n          , Str \"2013)\"\n          ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"sources\"\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"6\"\n              , citationPrefix = []\n              , citationSuffix = []\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          , Citation\n              { citationId = \"109\"\n              , citationPrefix = []\n              , citationSuffix = []\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          ]\n          [ Str \"(Boer\"\n          , Space\n          , Str \"et\"\n          , Space\n          , Str \"al.,\"\n          , Space\n          , Str \"2016;\"\n          , Space\n          , Str \"Smith\"\n          , Space\n          , Str \"et\"\n          , Space\n          , Str \"al.,\"\n          , Space\n          , Str \"2013)\"\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"additional\"\n      , Space\n      , Str \"prefix,\"\n      , Space\n      , Str \"suffix\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"page\"\n      , Space\n      , Str \"number\"\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"10\"\n              , citationPrefix = [ Str \"prefix\" ]\n              , citationSuffix =\n                  [ Str \",\" , Space , Str \"2\" , Space , Str \"suffix\" ]\n              , citationMode = NormalCitation\n              , citationNoteNum = 0\n              , citationHash = 0\n              }\n          ]\n          [ Str \"(prefix\"\n          , Space\n          , Str \"Bellomo\"\n          , Space\n          , Str \"et\"\n          , Space\n          , Str \"al.,\"\n          , Space\n          , Str \"2016,\"\n          , Space\n          , Str \"p.\"\n          , Space\n          , Str \"2\"\n          , Space\n          , Str \"suffix)\"\n          ]\n      , Str \".\"\n      ]\n  , Header\n      1\n      ( \"reference-list\" , [] , [] )\n      [ Str \"Reference\" , Space , Str \"list\" ]\n  ]\n"
  },
  {
    "path": "test/dokuwiki_external_images.dokuwiki",
    "content": "{{https://cooluri.com/image.png|HTTPS image}} {{http://cooluri.com/image.png|HTTP image}} {{ftp://ftp.cooluri.com/image.png|FTP image}} {{file:///tmp/coolimage.png|Filesystem image}} {{/image.jpg|Relative image 1}} {{image.jpg|Relative image 2}}\n"
  },
  {
    "path": "test/dokuwiki_external_images.native",
    "content": "[Para [Image (\"\",[],[]) [Str \"HTTPS\",Space,Str \"image\"] (\"https://cooluri.com/image.png\",\"\"),Space,Image (\"\",[],[]) [Str \"HTTP\",Space,Str \"image\"] (\"http://cooluri.com/image.png\",\"\"),Space,Image (\"\",[],[]) [Str \"FTP\",Space,Str \"image\"] (\"ftp://ftp.cooluri.com/image.png\",\"\"),Space,Image (\"\",[],[]) [Str \"Filesystem\",Space,Str \"image\"] (\"file:///tmp/coolimage.png\",\"\"),Space,Image (\"\",[],[]) [Str \"Relative\",Space,Str \"image\",Space,Str \"1\"] (\"/image.jpg\",\"\"),Space,Image (\"\",[],[]) [Str \"Relative\",Space,Str \"image\",Space,Str \"2\"] (\"image.jpg\",\"\")]]\n"
  },
  {
    "path": "test/dokuwiki_inline_formatting.dokuwiki",
    "content": "Regular text //italics// **bold //bold italics//**.\n\nThis is Small Caps, and this is <del>strikethrough</del>.\n\nSome people use single underlines for //emphasis//.\n\nAbove the line is <sup>superscript</sup> and below the line is <sub>subscript</sub>.\n\nA line\\\\\nbreak.\n\nhello %%//%% world %%**%% from %%__%% me\n\n''%%hello // world ** from __ me%%''\n"
  },
  {
    "path": "test/dokuwiki_inline_formatting.native",
    "content": "[Para [Str \"Regular\",Space,Str \"text\",Space,Emph [Str \"italics\"],Space,Strong [Str \"bold\",Space,Emph [Str \"bold\",Space,Str \"italics\"]],Str \".\"]\n,Para [Str \"This\",Space,Str \"is\",Space,SmallCaps [Str \"Small\",Space,Str \"Caps\"],Str \",\",Space,Str \"and\",Space,Str \"this\",Space,Str \"is\",Space,Strikeout [Str \"strikethrough\"],Str \".\"]\n,Para [Str \"Some\",Space,Str \"people\",Space,Str \"use\",Space,Span (\"\",[],[(\"underline\",\"single\")]) [Str \"single\",Space,Str \"underlines\",Space,Str \"for\",Space,Emph [Str \"emphasis\"]],Str \".\"]\n,Para [Str \"Above\",Space,Str \"the\",Space,Str \"line\",Space,Str \"is\",Space,Superscript [Str \"superscript\"],Space,Str \"and\",Space,Str \"below\",Space,Str \"the\",Space,Str \"line\",Space,Str \"is\",Space,Subscript [Str \"subscript\"],Str \".\"]\n,Para [Str \"A\",Space,Str \"line\",LineBreak,Str \"break.\"]\n,Para [Str \"hello\",Space,Str \"//\",Space,Str \"world\",Space,Str \"**\",Space,Str \"from\",Space,Str \"__\",Space,Str \"me\"]\n,Para [Code (\"\",[],[]) \"hello // world ** from __ me\"]]\n"
  },
  {
    "path": "test/dokuwiki_multiblock_table.dokuwiki",
    "content": "Sample grid table.\n^Fruit  ^Price^Advantages                         ^\n|Bananas|$1.34|built-in wrapper\\\\ \\\\ potassium    |\n|Oranges|$2.10|* cures scurvy\\\\ * tasty           |\n|Apples |$1.10|Some text\\\\ \\\\ after two linebreaks|\n"
  },
  {
    "path": "test/dokuwiki_multiblock_table.native",
    "content": "[Table (\"\",[],[]) (Caption Nothing\n [Para [Str \"Sample\",Space,Str \"grid\",Space,Str \"table.\"]])\n [(AlignDefault,ColWidth 0.2222222222222222)\n ,(AlignDefault,ColWidth 0.2222222222222222)\n ,(AlignDefault,ColWidth 0.2916666666666667)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Fruit\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Price\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Advantages\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Bananas\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"$1.34\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"built-in\",Space,Str \"wrapper\"]\n    ,Para [Str \"potassium\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Oranges\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"$2.10\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [BulletList\n     [[Plain [Str \"cures\",Space,Str \"scurvy\"]]\n     ,[Plain [Str \"tasty\"]]]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Apples\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"$1.10\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Para [Str \"Some\",Space,Str \"text\",LineBreak,LineBreak,Str \"after\",Space,Str \"two\",Space,Str \"linebreaks\"]]]])]\n (TableFoot (\"\",[],[])\n [])]"
  },
  {
    "path": "test/endnotexml-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"nocite\"\n            , MetaInlines\n                [ Cite\n                    [ Citation\n                        { citationId = \"*\"\n                        , citationPrefix = []\n                        , citationSuffix = []\n                        , citationMode = NormalCitation\n                        , citationNoteNum = 0\n                        , citationHash = 0\n                        }\n                    ]\n                    [ Str \"[@*]\" ]\n                ]\n            )\n          , ( \"references\"\n            , MetaList\n                [ MetaMap\n                    (fromList\n                       [ ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Chapman\"\n                                      )\n                                    , ( \"given\" , MetaString \"A. G.\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines [ Str \"Ecology\" ]\n                         )\n                       , ( \"id\" , MetaString \"13264\" )\n                       , ( \"isbn\" , MetaInlines [ Str \"0012-9658\" ] )\n                       , ( \"issued\" , MetaString \"1937\" )\n                       , ( \"number\" , MetaInlines [ Str \"1\" ] )\n                       , ( \"pages\" , MetaInlines [ Str \"93-105\" ] )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"An\"\n                             , SoftBreak\n                             , Str \"ecological\"\n                             , Space\n                             , Str \"basis\"\n                             , Space\n                             , Str \"for\"\n                             , Space\n                             , Str \"reforestation\"\n                             , Space\n                             , Str \"of\"\n                             , Space\n                             , Str \"submariginal\"\n                             , Space\n                             , Str \"lands\"\n                             , SoftBreak\n                             , Str \"in\"\n                             , Space\n                             , Str \"the\"\n                             , Space\n                             , Str \"Central\"\n                             , Space\n                             , Str \"Hardwood\"\n                             , Space\n                             , Str \"Region\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"18\" ] )\n                       ])\n                , MetaMap\n                    (fromList\n                       [ ( \"author\"\n                         , MetaList\n                             [ MetaMap\n                                 (fromList\n                                    [ ( \"family\"\n                                      , MetaString \"Strohecker\"\n                                      )\n                                    , ( \"given\" , MetaString \"H. F.\" )\n                                    ])\n                             ]\n                         )\n                       , ( \"container-title\"\n                         , MetaInlines [ Str \"Ecology\" ]\n                         )\n                       , ( \"id\" , MetaString \"13265\" )\n                       , ( \"isbn\" , MetaInlines [ Str \"0012-9658\" ] )\n                       , ( \"issued\" , MetaString \"1937\" )\n                       , ( \"number\" , MetaInlines [ Str \"1\" ] )\n                       , ( \"pages\" , MetaInlines [ Str \"162-168\" ] )\n                       , ( \"title\"\n                         , MetaInlines\n                             [ Str \"A\"\n                             , Space\n                             , Str \"survey\"\n                             , SoftBreak\n                             , Str \"of\"\n                             , Space\n                             , Str \"soil\"\n                             , Space\n                             , Str \"temperatures\"\n                             , Space\n                             , Str \"in\"\n                             , Space\n                             , Str \"the\"\n                             , Space\n                             , Str \"Chicago\"\n                             , Space\n                             , Str \"area\"\n                             ]\n                         )\n                       , ( \"type\" , MetaString \"article-journal\" )\n                       , ( \"volume\" , MetaInlines [ Str \"18\" ] )\n                       ])\n                ]\n            )\n          ]\n    }\n  []\n"
  },
  {
    "path": "test/endnotexml-reader.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xml>\n  <records>\n    <record>\n      <database name=\"EndNote Ecology.enl\"\n      path=\"/Users/LowDecarie/Dropbox/Meta presentation of stats/Data/EndNote Ecology.enl\">\n      EndNote Ecology.enl</database>\n      <source-app name=\"EndNote\" version=\"15.0\">\n      EndNote</source-app>\n      <rec-number>13264</rec-number>\n      <foreign-keys>\n        <key app=\"EN\" db-id=\"0xxzez5ectezp7e9zrnxp0dq5zrafepwxfe2\">\n        13264</key>\n      </foreign-keys>\n      <ref-type name=\"Journal Article\">17</ref-type>\n      <contributors>\n        <authors>\n          <author>\n            <style face=\"normal\" font=\"default\" size=\"100%\">\n            Chapman, A. G.</style>\n          </author>\n        </authors>\n      </contributors>\n      <auth-address>\n        <style face=\"normal\" font=\"default\" size=\"100%\">Cent States\n        Forest Expt Stn, Columbus, OH USA</style>\n      </auth-address>\n      <titles>\n        <title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">An\n          ecological basis for reforestation of submariginal lands\n          in the Central Hardwood Region</style>\n        </title>\n        <secondary-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </secondary-title>\n        <alt-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </alt-title>\n      </titles>\n      <periodical>\n        <full-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </full-title>\n        <abbr-1>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </abbr-1>\n      </periodical>\n      <alt-periodical>\n        <full-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </full-title>\n        <abbr-1>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </abbr-1>\n      </alt-periodical>\n      <pages>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        93-105</style>\n      </pages>\n      <volume>\n        <style face=\"normal\" font=\"default\" size=\"100%\">18</style>\n      </volume>\n      <number>\n        <style face=\"normal\" font=\"default\" size=\"100%\">1</style>\n      </number>\n      <dates>\n        <year>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          1937</style>\n        </year>\n        <pub-dates>\n          <date>\n            <style face=\"normal\" font=\"default\" size=\"100%\">\n            Jan</style>\n          </date>\n        </pub-dates>\n      </dates>\n      <isbn>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        0012-9658</style>\n      </isbn>\n      <accession-num>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        ISI:000200148800007</style>\n      </accession-num>\n      <notes>\n        <style face=\"normal\" font=\"default\" size=\"100%\">V02fg\rTimes\n        Cited:5\rCited References Count:2</style>\n      </notes>\n      <urls>\n        <related-urls>\n          <url>\n            <style face=\"normal\" font=\"default\" size=\"100%\">&lt;Go\n            to ISI&gt;://000200148800007</style>\n          </url>\n        </related-urls>\n      </urls>\n      <language>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        English</style>\n      </language>\n    </record>\n    <record>\n      <database name=\"EndNote Ecology.enl\"\n      path=\"/Users/LowDecarie/Dropbox/Meta presentation of stats/Data/EndNote Ecology.enl\">\n      EndNote Ecology.enl</database>\n      <source-app name=\"EndNote\" version=\"15.0\">\n      EndNote</source-app>\n      <rec-number>13265</rec-number>\n      <foreign-keys>\n        <key app=\"EN\" db-id=\"0xxzez5ectezp7e9zrnxp0dq5zrafepwxfe2\">\n        13265</key>\n      </foreign-keys>\n      <ref-type name=\"Journal Article\">17</ref-type>\n      <contributors>\n        <authors>\n          <author>\n            <style face=\"normal\" font=\"default\" size=\"100%\">\n            Strohecker, H. F.</style>\n          </author>\n        </authors>\n      </contributors>\n      <auth-address>\n        <style face=\"normal\" font=\"default\" size=\"100%\">Univ\n        Chicago, Chicago, IL USA</style>\n      </auth-address>\n      <titles>\n        <title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">A survey\n          of soil temperatures in the Chicago area</style>\n        </title>\n        <secondary-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </secondary-title>\n        <alt-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </alt-title>\n      </titles>\n      <periodical>\n        <full-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </full-title>\n        <abbr-1>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </abbr-1>\n      </periodical>\n      <alt-periodical>\n        <full-title>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </full-title>\n        <abbr-1>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          Ecology</style>\n        </abbr-1>\n      </alt-periodical>\n      <pages>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        162-168</style>\n      </pages>\n      <volume>\n        <style face=\"normal\" font=\"default\" size=\"100%\">18</style>\n      </volume>\n      <number>\n        <style face=\"normal\" font=\"default\" size=\"100%\">1</style>\n      </number>\n      <dates>\n        <year>\n          <style face=\"normal\" font=\"default\" size=\"100%\">\n          1937</style>\n        </year>\n        <pub-dates>\n          <date>\n            <style face=\"normal\" font=\"default\" size=\"100%\">\n            Jan</style>\n          </date>\n        </pub-dates>\n      </dates>\n      <isbn>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        0012-9658</style>\n      </isbn>\n      <accession-num>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        ISI:000200148800014</style>\n      </accession-num>\n      <notes>\n        <style face=\"normal\" font=\"default\" size=\"100%\">V02fg\rTimes\n        Cited:5\rCited References Count:14</style>\n      </notes>\n      <urls>\n        <related-urls>\n          <url>\n            <style face=\"normal\" font=\"default\" size=\"100%\">&lt;Go\n            to ISI&gt;://000200148800014</style>\n          </url>\n        </related-urls>\n      </urls>\n      <language>\n        <style face=\"normal\" font=\"default\" size=\"100%\">\n        English</style>\n      </language>\n    </record>\n  </records>\n</xml>\n"
  },
  {
    "path": "test/epub/features.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"Ori Idan\" ]\n                , MetaInlines [ Str \"Matt Garrish\" ]\n                , MetaInlines [ Str \"Marisa DeMeglio\" ]\n                , MetaInlines [ Str \"Toshiaki Koike\" ]\n                , MetaInlines [ Str \"Vincent Gros\" ]\n                , MetaInlines [ Str \"Markus Gylling\" ]\n                ]\n            )\n          , ( \"description\"\n            , MetaInlines\n                [ Str\n                    \"Tests for Content Documents in a reflowable context [UNDER CONSTRUCTION]\"\n                ]\n            )\n          , ( \"identifier\"\n            , MetaInlines\n                [ Str \"com.github.epub-testsuite.epub30-test-0100\" ]\n            )\n          , ( \"language\"\n            , MetaList\n                [ MetaInlines [ Str \"jp\" ] , MetaInlines [ Str \"en\" ] ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"EPUBTEST 0100 - Reflowable Content Tests\" ]\n            )\n          ]\n    }\n  [ Para [ Span ( \"front.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"Reflowable\"\n          , Space\n          , Str \"EPUB\"\n          , Space\n          , Str \"3\"\n          , Space\n          , Str \"Conformance\"\n          , Space\n          , Str \"Test\"\n          , Space\n          , Str \"Document:\"\n          , Space\n          , Str \"0100\"\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"Status\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"Document\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"currently\"\n              , Space\n              , Str \"considered\"\n              , Space\n              , Span\n                  ( \"\" , [ \"status\" ] , [] )\n                  [ Str \"[UNDER\" , Space , Str \"DEVELOPMENT]\" ]\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"IDPF.\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"part\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"version\"\n              , Space\n              , Span ( \"\" , [ \"version\" ] , [] ) [ Str \"X.X\" ]\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"EPUB\"\n              , Space\n              , Str \"3.0\"\n              , Space\n              , Str \"Compliance\"\n              , Space\n              , Str \"Test\"\n              , Space\n              , Str \"Suite\"\n              , Space\n              , Str \"released\"\n              , SoftBreak\n              , Str \"on\"\n              , Space\n              , RawInline (Format \"html\") \"<time class=\\\"release\\\">\"\n              , Str \"TBD\"\n              , RawInline (Format \"html\") \"</time>\"\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Before\"\n              , Space\n              , Str \"using\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"evaluate\"\n              , Space\n              , Str \"reading\"\n              , Space\n              , Str \"systems,\"\n              , Space\n              , Str \"testers\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"strongly\"\n              , Space\n              , Str \"encouraged\"\n              , Space\n              , Str \"to\"\n              , SoftBreak\n              , Str \"verify\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"they\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"latest\"\n              , Space\n              , Str \"release\"\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"checking\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"current\"\n              , Space\n              , Str \"release\"\n              , Space\n              , Str \"version\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"date\"\n              , Space\n              , Str \"of\"\n              , SoftBreak\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"suite\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"TBD\" ]\n                  ( \"http://idpf.org/\" , \"\" )\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"several\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"currently\"\n              , Space\n              , Str \"comprise\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"EPUB\"\n              , Space\n              , Str \"3\"\n              , Space\n              , Str \"conformance\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"suite\"\n              , SoftBreak\n              , Str \"for\"\n              , Space\n              , Str \"reflowable\"\n              , Space\n              , Str \"content.\"\n              , Space\n              , Str \"The\"\n              , Space\n              , Str \"complete\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"suite\"\n              , Space\n              , Str \"includes\"\n              , Space\n              , Str \"all\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"following\"\n              , Space\n              , Str \"publications:\"\n              ]\n          , OrderedList\n              ( 1 , DefaultStyle , DefaultDelim )\n              [ [ Plain [ Str \".\" ] ] ]\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"About\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"Document\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"document\"\n              , Space\n              , Str \"focuses\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"human-evaluated\"\n              , Space\n              , Str \"binary\"\n              , Space\n              , Str \"(pass/fail)\"\n              , Space\n              , Str \"tests\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"a\"\n              , SoftBreak\n              , Str \"reflowable\"\n              , Space\n              , Str \"context.\"\n              , Space\n              , Str \"Tests\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"fixed-layout\"\n              , Space\n              , Str \"content\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"other\"\n              , Space\n              , Str \"individual\"\n              , Space\n              , Str \"tests\"\n              , Space\n              , Str \"that\"\n              , SoftBreak\n              , Str \"require\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"dedicated\"\n              , Space\n              , Str \"epub\"\n              , Space\n              , Str \"file\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"available\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"additional\"\n              , Space\n              , Str \"sibling\"\n              , Space\n              , Str \"documents;\"\n              , Space\n              , Str \"refer\"\n              , Space\n              , Str \"to\"\n              , SoftBreak\n              , Str \"the\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"test\"\n                  , Space\n                  , Str \"suite\"\n                  , SoftBreak\n                  , Str \"wiki\"\n                  ]\n                  ( \"https://github.com/mgylling/epub-testsuite/wiki/Overview\"\n                  , \"\"\n                  )\n              , Space\n              , Str \"(\"\n              , Code\n                  ( \"\" , [] , [] )\n                  \"https://github.com/mgylling/epub-testsuite/wiki/Overview\"\n              , Str \")\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"additional\"\n              , SoftBreak\n              , Str \"information.\"\n              ]\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Conventions\" ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"following\"\n              , Space\n              , Str \"conventions\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"used\"\n              , Space\n              , Str \"throughout\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"document:\"\n              ]\n          , DefinitionList\n              [ ( [ Str \"1.\"\n                  , Space\n                  , Str \"Locating\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"test\"\n                  ]\n                , [ [ Div\n                        ( \"\" , [ \"ctest\" ] , [] )\n                        [ Para\n                            [ Str \"Tests\"\n                            , Space\n                            , Str \"for\"\n                            , Space\n                            , Emph [ Str \"required\" ]\n                            , Space\n                            , Str \"Reading\"\n                            , Space\n                            , Str \"System\"\n                            , Space\n                            , Str \"functionality\"\n                            , Space\n                            , Str \"are\"\n                            , SoftBreak\n                            , Str \"preceded\"\n                            , Space\n                            , Str \"by\"\n                            , Space\n                            , Str \"the\"\n                            , Space\n                            , Str \"label:\"\n                            , Space\n                            , Span\n                                ( \"\"\n                                , [ \"nature\" ]\n                                , [ ( \"style\"\n                                    , \"display: inline; font-size: 100%\"\n                                    )\n                                  ]\n                                )\n                                [ Str \"[REQUIRED]\" ]\n                            ]\n                        ]\n                    , Div\n                        ( \"\" , [ \"otest\" ] , [] )\n                        [ Para\n                            [ Str \"Tests\"\n                            , Space\n                            , Str \"for\"\n                            , Space\n                            , Emph [ Str \"optional\" ]\n                            , Space\n                            , Str \"Reading\"\n                            , Space\n                            , Str \"System\"\n                            , Space\n                            , Str \"functionality\"\n                            , Space\n                            , Str \"are\"\n                            , SoftBreak\n                            , Str \"preceded\"\n                            , Space\n                            , Str \"by\"\n                            , Space\n                            , Str \"the\"\n                            , Space\n                            , Str \"label:\"\n                            , Space\n                            , Span\n                                ( \"\"\n                                , [ \"nature\" ]\n                                , [ ( \"style\"\n                                    , \"display: inline; font-size: 100%\"\n                                    )\n                                  ]\n                                )\n                                [ Str \"[OPTIONAL]\" ]\n                            ]\n                        ]\n                    ]\n                  ]\n                )\n              , ( [ Str \"2.\"\n                  , Space\n                  , Str \"Performing\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  ]\n                , [ [ Plain\n                        [ Str \"Each\"\n                        , Space\n                        , Str \"test\"\n                        , Space\n                        , Str \"includes\"\n                        , Space\n                        , Str \"a\"\n                        , Space\n                        , Str \"description\"\n                        , Space\n                        , Str \"of\"\n                        , Space\n                        , Str \"its\"\n                        , Space\n                        , Str \"purpose\"\n                        , Space\n                        , Str \"followed\"\n                        , Space\n                        , Str \"by\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"actual\"\n                        , Space\n                        , Strong\n                            [ Str \"test\"\n                            , Space\n                            , Str \"statement,\"\n                            , SoftBreak\n                            , Str \"which\"\n                            , Space\n                            , Str \"can\"\n                            , Space\n                            , Str \"always\"\n                            , Space\n                            , Str \"be\"\n                            , Space\n                            , Str \"evaluated\"\n                            , Space\n                            , Str \"to\"\n                            , Space\n                            , Str \"true\"\n                            , Space\n                            , Str \"or\"\n                            , Space\n                            , Str \"false\"\n                            ]\n                        , Str \".\"\n                        , Space\n                        , Str \"These\"\n                        , Space\n                        , Str \"statements\"\n                        , Space\n                        , Str \"typically\"\n                        , Space\n                        , Str \"have\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"form:\"\n                        , SoftBreak\n                        , Str \"\\\"If\"\n                        , Space\n                        , Str \"[some\"\n                        , Space\n                        , Str \"condition],\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"test\"\n                        , Space\n                        , Str \"passes\\\".\"\n                        ]\n                    ]\n                  ]\n                )\n              , ( [ Str \"3.\"\n                  , Space\n                  , Str \"Scoring\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"results\"\n                  , Space\n                  , Str \"form\"\n                  ]\n                , [ [ Plain\n                        [ Str \"@@@TODO\"\n                        , Space\n                        , Str \"provide\"\n                        , Space\n                        , Str \"info\"\n                        , Space\n                        , Str \"on\"\n                        , Space\n                        , Str \"where\"\n                        , Space\n                        , Str \"to\"\n                        , Space\n                        , Str \"get\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"results\"\n                        , Space\n                        , Str \"form\"\n                        ]\n                    ]\n                  ]\n                )\n              ]\n          ]\n      ]\n  , Para [ Span ( \"content-mathml-001.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Header\n          2\n          ( \"content-mathml-001.xhtml_mathml\" , [] , [] )\n          [ Str \"MathML\" ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-010\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-010\" ]\n              , Space\n              , Str \"Rendering\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"equation\"\n              , Space\n              , Str \"rendering\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ Math\n                  DisplayMath\n                  \"\\\\int_{- \\\\infty}^{\\\\infty}e^{- x^{2}}\\\\, dx = \\\\sqrt{\\\\pi}\"\n              , SoftBreak\n              , Math\n                  DisplayMath\n                  \"\\\\sum\\\\limits_{n = 1}^{\\\\infty}\\\\frac{1}{n^{2}} = \\\\frac{\\\\pi^{2}}{6}\"\n              , SoftBreak\n              , Math\n                  DisplayMath\n                  \"x = \\\\frac{- b \\\\pm \\\\sqrt{b^{2} - 4ac}}{2a}\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"equations\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"presented\"\n              , Space\n              , Str \"as\"\n              , Space\n              , Str \"linear\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"(e.g.,\"\n              , Space\n              , Str \"x=-b\\177b2-4ac2a),\"\n              , SoftBreak\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-020\"\n          , [ \"section\" , \"otest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[OPTIONAL]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-020\" ]\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"Styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"math\"\n              , Space\n              , Str \"element\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"basic\"\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"math\"\n              , Space\n              , Str \"element.\"\n              ]\n          , Plain [ Math InlineMath \"{2x}{+ y - z}\" ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"equation\"\n              , Space\n              , Str \"has\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"yellow\"\n              , Space\n              , Str \"background\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"dashed\"\n              , Space\n              , Str \"border.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"reading\"\n              , Space\n              , Str \"system\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"viewport,\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"support\"\n              , SoftBreak\n              , Str \"CSS\"\n              , Space\n              , Str \"styles,\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"marked\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"Not Supported\"\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-021\"\n          , [ \"section\" , \"otest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[OPTIONAL]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-021\" ]\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"Styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mo\"\n              , Space\n              , Str \"element\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"basic\"\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mo\"\n              , Space\n              , Str \"element.\"\n              ]\n          , Plain [ Math InlineMath \"{2x}{+ y - z}\" ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"operators\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"enlarged\"\n              , Space\n              , Str \"relative\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"other\"\n              , Space\n              , Str \"symbols\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"numbers.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"reading\"\n              , Space\n              , Str \"system\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"viewport,\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"support\"\n              , SoftBreak\n              , Str \"CSS\"\n              , Space\n              , Str \"styles,\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"marked\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"Not Supported\"\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-022\"\n          , [ \"section\" , \"otest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[OPTIONAL]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-022\" ]\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"Styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mi\"\n              , Space\n              , Str \"element\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"basic\"\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mi\"\n              , Space\n              , Str \"element.\"\n              ]\n          , Plain [ Math InlineMath \"{2x}{+ y - z}\" ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"identifiers\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"bolded\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"blue.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"reading\"\n              , Space\n              , Str \"system\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"viewport,\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"support\"\n              , SoftBreak\n              , Str \"CSS\"\n              , Space\n              , Str \"styles,\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"marked\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"Not Supported\"\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-023\"\n          , [ \"section\" , \"otest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[OPTIONAL]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-023\" ]\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"Styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mn\"\n              , Space\n              , Str \"element\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"basic\"\n              , Space\n              , Str \"CSS\"\n              , Space\n              , Str \"styling\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mn\"\n              , Space\n              , Str \"element.\"\n              ]\n          , Plain [ Math InlineMath \"{2x}{+ y - z}\" ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"number\"\n              , Space\n              , Str \"2\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"italicized\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"blue.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"reading\"\n              , Space\n              , Str \"system\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"viewport,\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"does\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"support\"\n              , SoftBreak\n              , Str \"CSS\"\n              , Space\n              , Str \"styles,\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"marked\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"Not Supported\"\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-024\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-024\" ]\n              , Str \"Horizontal\"\n              , Space\n              , Str \"stretch,\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mover\"\n              , Str \",\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"munder\"\n              , Str \",\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mspace\"\n              , Space\n              , Str \"elements\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"horizontal\"\n              , Space\n              , Str \"stretch,\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mover\"\n              , Str \",\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"munder\"\n              , Str \",\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mspace\"\n              , Space\n              , Str \"elements\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ Math\n                  DisplayMath\n                  \"c = \\\\overset{\\\\text{complex number}}{\\\\overbrace{\\\\underset{\\\\text{real}}{\\\\underbrace{\\\\mspace{20mu} a\\\\mspace{20mu}}} + \\\\underset{\\\\text{imaginary}}{\\\\underbrace{\\\\quad b{\\\\mathbb{i}}\\\\quad}}}}\"\n              ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"rendering\"\n              , Space\n              , Str \"looks\"\n              , Space\n              , Str \"like\"\n              , Space\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-025\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-025\" ]\n              , Str \"Testing\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mtable\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"colspan\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"rowspan\"\n              , Space\n              , Str \"attributes,\"\n              , Space\n              , Str \"Hebrew\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"Script\"\n              , Space\n              , Str \"fonts\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mtable\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"colspan\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mspace\"\n              , Space\n              , Str \"attributes\"\n              , Space\n              , Str \"(column\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"row\"\n              , Space\n              , Str \"spanning)\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"supported;\"\n              , Space\n              , Str \"uses\"\n              , Space\n              , Str \"Hebrew\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"Script\"\n              , Space\n              , Str \"alphabets.\"\n              ]\n          , Plain\n              [ Math\n                  DisplayMath\n                  \"\\\\begin{matrix}\\n & {\\\\operatorname{cov}(\\\\mathcal{L})} & \\\\longrightarrow & {\\\\operatorname{non}(\\\\mathcal{K})} & \\\\longrightarrow & {\\\\operatorname{cof}(\\\\mathcal{K})} & \\\\longrightarrow & {\\\\operatorname{cof}(\\\\mathcal{L})} & \\\\longrightarrow & 2^{\\\\aleph_{0}} \\\\\\\\\\n & \\\\uparrow & & \\\\uparrow & & \\\\uparrow & & \\\\uparrow & & \\\\\\\\\\n & {\\\\mathfrak{b}} & \\\\longrightarrow & {\\\\mathfrak{d}} & & & & & & \\\\\\\\\\n & \\\\uparrow & & \\\\uparrow & & & & & & \\\\\\\\\\n\\\\aleph_{1} & \\\\longrightarrow & {\\\\operatorname{add}(\\\\mathcal{L})} & \\\\longrightarrow & {\\\\operatorname{add}(\\\\mathcal{K})} & \\\\longrightarrow & {\\\\operatorname{cov}(\\\\mathcal{K})} & \\\\longrightarrow & {\\\\operatorname{non}(\\\\mathcal{L})} & \\n\\\\end{matrix}\"\n              ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"rendering\"\n              , Space\n              , Str \"looks\"\n              , Space\n              , Str \"like\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"Cicho\\324's\" , Space , Str \"Diagram\" ]\n                  ( \"http://en.wikipedia.org/wiki/Cicho%C5%84's_diagram\"\n                  , \"\"\n                  )\n              , Str \":\"\n              , Space\n              , Str \".\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-026\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-026\" ]\n              , Str \"BiDi,\"\n              , Space\n              , Str \"RTL\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"Arabic\"\n              , Space\n              , Str \"alphabets\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"right-to-left\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"Arabic\"\n              , Space\n              , Str \"alphabets\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ Math\n                  DisplayMath\n                  \"{\\1583(\\1587)} = \\\\left\\\\{ \\\\begin{matrix}\\n{\\\\sum\\\\limits_{\\1646 = 1}^{\\1589}\\1587^{\\1646}} & {\\\\text{\\1573\\1584\\1575\\1603\\1575\\1606}\\1587 > 0} \\\\\\\\\\n{\\\\int_{1}^{\\1589}{\\1587^{\\1646}\\1569\\1587}} & {\\\\text{\\1573\\1584\\1575\\1603\\1575\\1606}\\1587 \\\\in \\1605} \\\\\\\\\\n{{\\1591\\1575}\\\\pi} & {\\\\text{\\1594\\1610\\1585\\1584\\1604\\1603}\\\\left( \\\\text{\\1605\\1593}\\\\pi \\\\simeq 3,141 \\\\right)}\\n\\\\end{matrix} \\\\right.\"\n              ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"rendering\"\n              , Space\n              , Str \"looks\"\n              , Space\n              , Str \"like\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"following\"\n              , Space\n              , Str \"image:\"\n              ]\n          ]\n      , Div\n          ( \"content-mathml-001.xhtml_mathml-027\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"mathml-027\" ]\n              , Str \"Elementary\"\n              , Space\n              , Str \"math:\"\n              , Space\n              , Str \"long\"\n              , Space\n              , Str \"division\"\n              , Space\n              , Str \"notation\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"mlongdiv\"\n              , Space\n              , Str \"elements\"\n              , Space\n              , Str \"(from\"\n              , Space\n              , Str \"elementary\"\n              , Space\n              , Str \"math)\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ Span\n                  ( \"\"\n                  , [ \"math\" ]\n                  , [ ( \"xmlns\" , \"http://www.w3.org/1998/Math/MathML\" )\n                    ]\n                  )\n                  [ SoftBreak\n                  , Str \"3\"\n                  , SoftBreak\n                  , Str \"435.3\"\n                  , SoftBreak\n                  , Str \"1306\"\n                  , SoftBreak\n                  , Str \"12\"\n                  , SoftBreak\n                  , Str \"10\"\n                  , SoftBreak\n                  , Str \"9\"\n                  , SoftBreak\n                  , Str \"16\"\n                  , SoftBreak\n                  , Str \"15\"\n                  , SoftBreak\n                  , Str \"1.0\"\n                  , SoftBreak\n                  , Str \"9\"\n                  , SoftBreak\n                  , Str \"1\"\n                  , SoftBreak\n                  ]\n              ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes\"\n              , Space\n              , Str \"if\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"rendering\"\n              , Space\n              , Str \"looks\"\n              , Space\n              , Str \"like\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"following\"\n              , Space\n              , Str \"image:\"\n              , Space\n              , Str \".\"\n              ]\n          ]\n      ]\n  , Para [ Span ( \"content-switch-001.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"content-switch-001.xhtml_epub-switch\"\n      , [ \"section\" ]\n      , []\n      )\n      [ Header\n          3 ( \"\" , [] , [] ) [ Code ( \"\" , [] , [] ) \"epub:switch\" ]\n      , Div\n          ( \"content-switch-001.xhtml_switch-010\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              4\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"switch-010\" ]\n              , Space\n              , Str \"Support\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Code ( \"\" , [] , [] ) \"epub:switch\" ]\n                  ( \"http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-content-switch\"\n                  , \"\"\n                  )\n              , Space\n              , Str \"element\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"PASS\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"only\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"word\"\n              , Space\n              , Str \"\\\"PASS\\\"\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"rendered\"\n              , Space\n              , Str \"before\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"paragraph,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              , Space\n              , Str \"If\"\n              , Space\n              , Str \"both\"\n              , Space\n              , Str \"\\\"PASS\\\"\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"\\\"FAIL\\\"\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"rendered,\"\n              , Space\n              , Str \"or\"\n              , Space\n              , Str \"neither\"\n              , SoftBreak\n              , Str \"\\\"PASS\\\"\"\n              , Space\n              , Str \"nor\"\n              , Space\n              , Str \"\\\"FAIL\\\"\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"rendered,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"content-switch-001.xhtml_switch-020\"\n          , [ \"section\" , \"otest\" ]\n          , []\n          )\n          [ Header\n              4\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[OPTIONAL]\" ]\n              , SoftBreak\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"switch-020\" ]\n              , SoftBreak\n              , Str \"MathML\"\n              , Space\n              , Str \"Embedding\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"namespace\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"recognized\"\n              , Space\n              , Str \"when\"\n              , Space\n              , Str \"used\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"an\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Code ( \"\" , [] , [] ) \"epub:case\" ]\n                  ( \"http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-epub-case\"\n                  , \"\"\n                  )\n              , Space\n              , Str \"element.\"\n              ]\n          , Para [ Math InlineMath \"{2x}{+ y - z}\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"MathML\"\n              , Space\n              , Str \"equation\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"rendered\"\n              , Space\n              , Str \"before\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"paragraph,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"switch-010\"\n              , Space\n              , Str \"did\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"pass,\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"should\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"marked\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"Not Supported\"\n              , Str \".\"\n              ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/epub/formatting.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"Ori Idan\" ]\n                , MetaInlines [ Str \"Matt Garrish\" ]\n                , MetaInlines [ Str \"Marisa DeMeglio\" ]\n                , MetaInlines [ Str \"Toshiaki Koike\" ]\n                , MetaInlines [ Str \"Vincent Gros\" ]\n                , MetaInlines [ Str \"Markus Gylling\" ]\n                ]\n            )\n          , ( \"description\"\n            , MetaInlines\n                [ Str \"Tests for Styling [UNDER CONSTRUCTION]\" ]\n            )\n          , ( \"identifier\"\n            , MetaInlines\n                [ Str \"com.github.epub-testsuite.epub30-test-0101\" ]\n            )\n          , ( \"language\" , MetaInlines [ Str \"en\" ] )\n          , ( \"title\"\n            , MetaInlines [ Str \"EPUBTEST 0101 - Styling Tests\" ]\n            )\n          ]\n    }\n  [ Para [ Span ( \"front.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"EPUB\"\n          , Space\n          , Str \"3\"\n          , Space\n          , Str \"Styling\"\n          , Space\n          , Str \"Test\"\n          , Space\n          , Str \"Document:\"\n          , Space\n          , Str \"0101\"\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"Status\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"Document\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"currently\"\n              , Space\n              , Str \"considered\"\n              , Space\n              , Span\n                  ( \"\" , [ \"status\" ] , [] )\n                  [ Str \"[UNDER\" , Space , Str \"DEVELOPMENT]\" ]\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"IDPF.\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"part\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"version\"\n              , Space\n              , Span ( \"\" , [ \"version\" ] , [] ) [ Str \"X.X\" ]\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"EPUB\"\n              , Space\n              , Str \"3.0\"\n              , Space\n              , Str \"Compliance\"\n              , Space\n              , Str \"Test\"\n              , Space\n              , Str \"Suite\"\n              , Space\n              , Str \"released\"\n              , SoftBreak\n              , Str \"on\"\n              , Space\n              , RawInline (Format \"html\") \"<time class=\\\"release\\\">\"\n              , Str \"TBD\"\n              , RawInline (Format \"html\") \"</time>\"\n              , Str \".\"\n              ]\n          , Para\n              [ Str \"Before\"\n              , Space\n              , Str \"using\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"evaluate\"\n              , Space\n              , Str \"reading\"\n              , Space\n              , Str \"systems,\"\n              , Space\n              , Str \"testers\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"strongly\"\n              , Space\n              , Str \"encouraged\"\n              , Space\n              , Str \"to\"\n              , SoftBreak\n              , Str \"verify\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"they\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"latest\"\n              , Space\n              , Str \"release\"\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"checking\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"current\"\n              , Space\n              , Str \"release\"\n              , Space\n              , Str \"version\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"date\"\n              , Space\n              , Str \"of\"\n              , SoftBreak\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"suite\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"TBD\" ]\n                  ( \"http://idpf.org/\" , \"\" )\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"publication\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"several\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"currently\"\n              , Space\n              , Str \"comprise\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"EPUB\"\n              , Space\n              , Str \"3\"\n              , Space\n              , Str \"conformance\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"suite\"\n              , SoftBreak\n              , Str \"for\"\n              , Space\n              , Str \"reflowable\"\n              , Space\n              , Str \"content.\"\n              , Space\n              , Str \"The\"\n              , Space\n              , Str \"complete\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"suite\"\n              , Space\n              , Str \"includes\"\n              , Space\n              , Str \"all\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"following\"\n              , Space\n              , Str \"publications:\"\n              ]\n          , OrderedList\n              ( 1 , DefaultStyle , DefaultDelim )\n              [ [ Plain [ Str \".\" ] ] ]\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"About\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"Document\"\n              ]\n          , Para\n              [ Str \"This\"\n              , Space\n              , Str \"document\"\n              , Space\n              , Str \"focuses\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"human-evaluated\"\n              , Space\n              , Str \"binary\"\n              , Space\n              , Str \"(pass/fail)\"\n              , Space\n              , Str \"tests\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"a\"\n              , SoftBreak\n              , Str \"reflowable\"\n              , Space\n              , Str \"context.\"\n              , Space\n              , Str \"Tests\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"fixed-layout\"\n              , Space\n              , Str \"content\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"other\"\n              , Space\n              , Str \"individual\"\n              , Space\n              , Str \"tests\"\n              , Space\n              , Str \"that\"\n              , SoftBreak\n              , Str \"require\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"dedicated\"\n              , Space\n              , Str \"epub\"\n              , Space\n              , Str \"file\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"available\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"additional\"\n              , Space\n              , Str \"sibling\"\n              , Space\n              , Str \"documents;\"\n              , Space\n              , Str \"refer\"\n              , Space\n              , Str \"to\"\n              , SoftBreak\n              , Str \"the\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"test\"\n                  , Space\n                  , Str \"suite\"\n                  , SoftBreak\n                  , Str \"wiki\"\n                  ]\n                  ( \"https://github.com/mgylling/epub-testsuite/wiki/Overview\"\n                  , \"\"\n                  )\n              , Space\n              , Str \"(\"\n              , Code\n                  ( \"\" , [] , [] )\n                  \"https://github.com/mgylling/epub-testsuite/wiki/Overview\"\n              , Str \")\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"additional\"\n              , SoftBreak\n              , Str \"information.\"\n              ]\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header 2 ( \"\" , [] , [] ) [ Str \"Conventions\" ]\n          , Para\n              [ Str \"The\"\n              , Space\n              , Str \"following\"\n              , Space\n              , Str \"conventions\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"used\"\n              , Space\n              , Str \"throughout\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"document:\"\n              ]\n          , DefinitionList\n              [ ( [ Str \"1.\"\n                  , Space\n                  , Str \"Locating\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"test\"\n                  ]\n                , [ [ Div\n                        ( \"\" , [ \"ctest\" ] , [] )\n                        [ Para\n                            [ Str \"Tests\"\n                            , Space\n                            , Str \"for\"\n                            , Space\n                            , Emph [ Str \"required\" ]\n                            , Space\n                            , Str \"Reading\"\n                            , Space\n                            , Str \"System\"\n                            , Space\n                            , Str \"functionality\"\n                            , Space\n                            , Str \"are\"\n                            , SoftBreak\n                            , Str \"preceded\"\n                            , Space\n                            , Str \"by\"\n                            , Space\n                            , Str \"the\"\n                            , Space\n                            , Str \"label:\"\n                            , Space\n                            , Span\n                                ( \"\"\n                                , [ \"nature\" ]\n                                , [ ( \"style\"\n                                    , \"display: inline; font-size: 100%\"\n                                    )\n                                  ]\n                                )\n                                [ Str \"[REQUIRED]\" ]\n                            ]\n                        ]\n                    , Div\n                        ( \"\" , [ \"otest\" ] , [] )\n                        [ Para\n                            [ Str \"Tests\"\n                            , Space\n                            , Str \"for\"\n                            , Space\n                            , Emph [ Str \"optional\" ]\n                            , Space\n                            , Str \"Reading\"\n                            , Space\n                            , Str \"System\"\n                            , Space\n                            , Str \"functionality\"\n                            , Space\n                            , Str \"are\"\n                            , SoftBreak\n                            , Str \"preceded\"\n                            , Space\n                            , Str \"by\"\n                            , Space\n                            , Str \"the\"\n                            , Space\n                            , Str \"label:\"\n                            , Space\n                            , Span\n                                ( \"\"\n                                , [ \"nature\" ]\n                                , [ ( \"style\"\n                                    , \"display: inline; font-size: 100%\"\n                                    )\n                                  ]\n                                )\n                                [ Str \"[OPTIONAL]\" ]\n                            ]\n                        ]\n                    ]\n                  ]\n                )\n              , ( [ Str \"2.\"\n                  , Space\n                  , Str \"Performing\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  ]\n                , [ [ Plain\n                        [ Str \"Each\"\n                        , Space\n                        , Str \"test\"\n                        , Space\n                        , Str \"includes\"\n                        , Space\n                        , Str \"a\"\n                        , Space\n                        , Str \"description\"\n                        , Space\n                        , Str \"of\"\n                        , Space\n                        , Str \"its\"\n                        , Space\n                        , Str \"purpose\"\n                        , Space\n                        , Str \"followed\"\n                        , Space\n                        , Str \"by\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"actual\"\n                        , Space\n                        , Strong\n                            [ Str \"test\"\n                            , Space\n                            , Str \"statement,\"\n                            , SoftBreak\n                            , Str \"which\"\n                            , Space\n                            , Str \"can\"\n                            , Space\n                            , Str \"always\"\n                            , Space\n                            , Str \"be\"\n                            , Space\n                            , Str \"evaluated\"\n                            , Space\n                            , Str \"to\"\n                            , Space\n                            , Str \"true\"\n                            , Space\n                            , Str \"or\"\n                            , Space\n                            , Str \"false\"\n                            ]\n                        , Str \".\"\n                        , Space\n                        , Str \"These\"\n                        , Space\n                        , Str \"statements\"\n                        , Space\n                        , Str \"typically\"\n                        , Space\n                        , Str \"have\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"form:\"\n                        , SoftBreak\n                        , Str \"\\\"If\"\n                        , Space\n                        , Str \"[some\"\n                        , Space\n                        , Str \"condition],\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"test\"\n                        , Space\n                        , Str \"passes\\\".\"\n                        ]\n                    ]\n                  ]\n                )\n              , ( [ Str \"3.\"\n                  , Space\n                  , Str \"Scoring\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"results\"\n                  , Space\n                  , Str \"form\"\n                  ]\n                , [ [ Plain\n                        [ Str \"@@@TODO\"\n                        , Space\n                        , Str \"provide\"\n                        , Space\n                        , Str \"info\"\n                        , Space\n                        , Str \"on\"\n                        , Space\n                        , Str \"where\"\n                        , Space\n                        , Str \"to\"\n                        , Space\n                        , Str \"get\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"results\"\n                        , Space\n                        , Str \"form\"\n                        ]\n                    ]\n                  ]\n                )\n              ]\n          ]\n      ]\n  , Para [ Span ( \"styling-xhtml-001.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"styling-xhtml-001.xhtml_epub-css\" , [ \"section\" ] , [] )\n      [ Header\n          1\n          ( \"\" , [] , [] )\n          [ Str \"EPUB\" , Space , Str \"Style\" , Space , Str \"Sheets\" ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"section\"\n          , Space\n          , Str \"contains\"\n          , Space\n          , Str \"tests\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"styling\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"layout.\"\n          ]\n      ]\n  , Para [ Span ( \"styling-xhtml-003.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"styling-xhtml-003.xhtml_style-110\"\n      , [ \"section\" , \"ctest\" ]\n      , []\n      )\n      [ Header\n          2\n          ( \"\" , [] , [] )\n          [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n          , Space\n          , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-110\" ]\n          , Space\n          , Str \"Multi-Column\"\n          , Space\n          , Str \"Layouts\"\n          ]\n      , Para\n          [ Str \"Tests\"\n          , Space\n          , Str \"whether\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Link\n              ( \"\" , [] , [] )\n              [ Code ( \"\" , [] , [] ) \"CSS Multi-Column Layout\" ]\n              ( \"http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-css-multi-column\"\n              , \"\"\n              )\n          , Space\n          , Str \"properties\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"supported.\"\n          ]\n      , Div\n          ( \"\" , [ \"multicol\" ] , [] )\n          [ Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          ]\n      , Para\n          [ Str \"If\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"preceding\"\n          , Space\n          , Str \"text\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"rendered\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"three\"\n          , Space\n          , Str \"columns,\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"test\"\n          , Space\n          , Str \"passes.\"\n          ]\n      ]\n  , Para [ Span ( \"styling-xhtml-002.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"styling-xhtml-002.xhtml_style-lists\"\n      , [ \"section\" ]\n      , []\n      )\n      [ Header 2 ( \"\" , [] , [] ) [ Str \"Lists\" ]\n      , Div\n          ( \"styling-xhtml-002.xhtml_style-list-style-type\"\n          , [ \"section\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Str \"The\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"list-style-type\"\n              , Space\n              , Str \"property\"\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-009\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-009\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"decimal\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"decimal\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"decimal\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-010\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-010\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"circle\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"circle\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ul\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , BulletList\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"circle\"\n                  , Space\n                  , Str \"markers,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-011\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-011\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"square\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"square\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ul\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , BulletList\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"square\"\n                  , Space\n                  , Str \"markers,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-012\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-012\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"disc\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"disc\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ul\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , BulletList\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"disc\"\n                  , Space\n                  , Str \"markers,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-013\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-013\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-latin\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-latin\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"lower-latin\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-014\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-014\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-roman\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-roman\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"lower-roman\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-015\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-015\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"upper-alpha\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"upper-alpha\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"upper-alpha\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-016\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-016\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"hiragana\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"hiragana\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"hiragana\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-017\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-017\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"hiragana-iroha\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"hiragana-iroha\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"hiragana-iroha\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-018\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-018\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"katakana\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"katakana\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"katakana\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-019\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-019\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"katakana-iroha\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"katakana-iroha\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"katakana-iroha\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-020\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-020\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"upper-roman\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"upper-roman\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"upper-roman\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-021\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-021\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"upper-latin\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"upper-latin\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"upper-latin\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-022\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-022\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-alpha\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-alpha\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"lower-alpha\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-023\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-023\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-greek\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"lower-greek\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"lower-greek\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-024\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-024\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"armenian\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"armenian\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"armenian\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-025\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-025\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"cjk-ideographic\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"cjk-ideographic\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"cjk-ideographic\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-026\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-026\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"decimal-leading-zero\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"decimal-leading-zero\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"decimal-leading-zero\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-027\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-027\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"georgian\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"georgian\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"georgian\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-028\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-028\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"hebrew\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"hebrew\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"hebrew\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"in\"\n                  , Space\n                  , Str \"ascending\"\n                  , Space\n                  , Str \"order,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-029\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-029\" ]\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"none\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"none\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"no\"\n                  , Space\n                  , Str \"markers,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-002.xhtml_style-list-style\"\n          , [ \"section\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Str \"The\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"list-style\"\n              , Space\n              , Str \"property\"\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-030\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-030\" ]\n                  , Space\n                  , Str \"images\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style\"\n                  , Space\n                  , Str \"shorthand\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"using\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"gif\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ul\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , BulletList\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"purple\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"aqua\"\n                  , Space\n                  , Str \"square\"\n                  , Space\n                  , Str \"bullet\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-002.xhtml_style-list-style-position\"\n          , [ \"section\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Str \"The\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"list-style-position\"\n              , Space\n              , Str \"property\"\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-040\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-040\" ]\n                  , Space\n                  , Str \"The\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-position\"\n                  , Space\n                  , Str \"property:\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"inside\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-position\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"inside\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ul\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"Lorem\"\n                        , Space\n                        , Str \"ipsum\"\n                        , Space\n                        , Str \"dolor\"\n                        , Space\n                        , Str \"sit\"\n                        , Space\n                        , Str \"amet,\"\n                        , Space\n                        , Str \"consectetur\"\n                        , Space\n                        , Str \"adipisicing\"\n                        , Space\n                        , Str \"elit,\"\n                        , Space\n                        , Str \"sed\"\n                        , Space\n                        , Str \"do\"\n                        , Space\n                        , Str \"eiusmod\"\n                        , Space\n                        , Str \"tempor\"\n                        , Space\n                        , Str \"incididunt\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"labore\"\n                        , Space\n                        , Str \"et\"\n                        , Space\n                        , Str \"dolore\"\n                        , Space\n                        , Str \"magna\"\n                        , Space\n                        , Str \"aliqua.\"\n                        , Space\n                        , Str \"Ut\"\n                        , Space\n                        , Str \"enim\"\n                        , Space\n                        , Str \"ad\"\n                        , Space\n                        , Str \"minim\"\n                        , Space\n                        , Str \"veniam,\"\n                        , Space\n                        , Str \"quis\"\n                        , Space\n                        , Str \"nostrud\"\n                        , Space\n                        , Str \"exercitation\"\n                        , Space\n                        , Str \"ullamco\"\n                        , Space\n                        , Str \"laboris\"\n                        , Space\n                        , Str \"nisi\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"aliquip\"\n                        , Space\n                        , Str \"ex\"\n                        , Space\n                        , Str \"ea\"\n                        , Space\n                        , Str \"commodo\"\n                        , Space\n                        , Str \"consequat.\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"Lorem\"\n                        , Space\n                        , Str \"ipsum\"\n                        , Space\n                        , Str \"dolor\"\n                        , Space\n                        , Str \"sit\"\n                        , Space\n                        , Str \"amet,\"\n                        , Space\n                        , Str \"consectetur\"\n                        , Space\n                        , Str \"adipisicing\"\n                        , Space\n                        , Str \"elit,\"\n                        , Space\n                        , Str \"sed\"\n                        , Space\n                        , Str \"do\"\n                        , Space\n                        , Str \"eiusmod\"\n                        , Space\n                        , Str \"tempor\"\n                        , Space\n                        , Str \"incididunt\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"labore\"\n                        , Space\n                        , Str \"et\"\n                        , Space\n                        , Str \"dolore\"\n                        , Space\n                        , Str \"magna\"\n                        , Space\n                        , Str \"aliqua.\"\n                        , Space\n                        , Str \"Ut\"\n                        , Space\n                        , Str \"enim\"\n                        , Space\n                        , Str \"ad\"\n                        , Space\n                        , Str \"minim\"\n                        , Space\n                        , Str \"veniam,\"\n                        , Space\n                        , Str \"quis\"\n                        , Space\n                        , Str \"nostrud\"\n                        , Space\n                        , Str \"exercitation\"\n                        , Space\n                        , Str \"ullamco\"\n                        , Space\n                        , Str \"laboris\"\n                        , Space\n                        , Str \"nisi\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"aliquip\"\n                        , Space\n                        , Str \"ex\"\n                        , Space\n                        , Str \"ea\"\n                        , Space\n                        , Str \"commodo\"\n                        , Space\n                        , Str \"consequat.\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"Lorem\"\n                        , Space\n                        , Str \"ipsum\"\n                        , Space\n                        , Str \"dolor\"\n                        , Space\n                        , Str \"sit\"\n                        , Space\n                        , Str \"amet,\"\n                        , Space\n                        , Str \"consectetur\"\n                        , Space\n                        , Str \"adipisicing\"\n                        , Space\n                        , Str \"elit,\"\n                        , Space\n                        , Str \"sed\"\n                        , Space\n                        , Str \"do\"\n                        , Space\n                        , Str \"eiusmod\"\n                        , Space\n                        , Str \"tempor\"\n                        , Space\n                        , Str \"incididunt\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"labore\"\n                        , Space\n                        , Str \"et\"\n                        , Space\n                        , Str \"dolore\"\n                        , Space\n                        , Str \"magna\"\n                        , Space\n                        , Str \"aliqua.\"\n                        , Space\n                        , Str \"Ut\"\n                        , Space\n                        , Str \"enim\"\n                        , Space\n                        , Str \"ad\"\n                        , Space\n                        , Str \"minim\"\n                        , Space\n                        , Str \"veniam,\"\n                        , Space\n                        , Str \"quis\"\n                        , Space\n                        , Str \"nostrud\"\n                        , Space\n                        , Str \"exercitation\"\n                        , Space\n                        , Str \"ullamco\"\n                        , Space\n                        , Str \"laboris\"\n                        , Space\n                        , Str \"nisi\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"aliquip\"\n                        , Space\n                        , Str \"ex\"\n                        , Space\n                        , Str \"ea\"\n                        , Space\n                        , Str \"commodo\"\n                        , Space\n                        , Str \"consequat.\"\n                        ]\n                    ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"markers\"\n                  , Space\n                  , Str \"inside\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"indentation,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-041\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-041\" ]\n                  , Space\n                  , Str \"The\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-position\"\n                  , Space\n                  , Str \"property:\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"outside\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-position\"\n                  , Space\n                  , Str \"property\"\n                  , Space\n                  , Str \"set\"\n                  , Space\n                  , Str \"to\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"outside\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ul\"\n                  , Space\n                  , Str \"element.\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"Lorem\"\n                        , Space\n                        , Str \"ipsum\"\n                        , Space\n                        , Str \"dolor\"\n                        , Space\n                        , Str \"sit\"\n                        , Space\n                        , Str \"amet,\"\n                        , Space\n                        , Str \"consectetur\"\n                        , Space\n                        , Str \"adipisicing\"\n                        , Space\n                        , Str \"elit,\"\n                        , Space\n                        , Str \"sed\"\n                        , Space\n                        , Str \"do\"\n                        , Space\n                        , Str \"eiusmod\"\n                        , Space\n                        , Str \"tempor\"\n                        , Space\n                        , Str \"incididunt\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"labore\"\n                        , Space\n                        , Str \"et\"\n                        , Space\n                        , Str \"dolore\"\n                        , Space\n                        , Str \"magna\"\n                        , Space\n                        , Str \"aliqua.\"\n                        , Space\n                        , Str \"Ut\"\n                        , Space\n                        , Str \"enim\"\n                        , Space\n                        , Str \"ad\"\n                        , Space\n                        , Str \"minim\"\n                        , Space\n                        , Str \"veniam,\"\n                        , Space\n                        , Str \"quis\"\n                        , Space\n                        , Str \"nostrud\"\n                        , Space\n                        , Str \"exercitation\"\n                        , Space\n                        , Str \"ullamco\"\n                        , Space\n                        , Str \"laboris\"\n                        , Space\n                        , Str \"nisi\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"aliquip\"\n                        , Space\n                        , Str \"ex\"\n                        , Space\n                        , Str \"ea\"\n                        , Space\n                        , Str \"commodo\"\n                        , Space\n                        , Str \"consequat.\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"Lorem\"\n                        , Space\n                        , Str \"ipsum\"\n                        , Space\n                        , Str \"dolor\"\n                        , Space\n                        , Str \"sit\"\n                        , Space\n                        , Str \"amet,\"\n                        , Space\n                        , Str \"consectetur\"\n                        , Space\n                        , Str \"adipisicing\"\n                        , Space\n                        , Str \"elit,\"\n                        , Space\n                        , Str \"sed\"\n                        , Space\n                        , Str \"do\"\n                        , Space\n                        , Str \"eiusmod\"\n                        , Space\n                        , Str \"tempor\"\n                        , Space\n                        , Str \"incididunt\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"labore\"\n                        , Space\n                        , Str \"et\"\n                        , Space\n                        , Str \"dolore\"\n                        , Space\n                        , Str \"magna\"\n                        , Space\n                        , Str \"aliqua.\"\n                        , Space\n                        , Str \"Ut\"\n                        , Space\n                        , Str \"enim\"\n                        , Space\n                        , Str \"ad\"\n                        , Space\n                        , Str \"minim\"\n                        , Space\n                        , Str \"veniam,\"\n                        , Space\n                        , Str \"quis\"\n                        , Space\n                        , Str \"nostrud\"\n                        , Space\n                        , Str \"exercitation\"\n                        , Space\n                        , Str \"ullamco\"\n                        , Space\n                        , Str \"laboris\"\n                        , Space\n                        , Str \"nisi\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"aliquip\"\n                        , Space\n                        , Str \"ex\"\n                        , Space\n                        , Str \"ea\"\n                        , Space\n                        , Str \"commodo\"\n                        , Space\n                        , Str \"consequat.\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"Lorem\"\n                        , Space\n                        , Str \"ipsum\"\n                        , Space\n                        , Str \"dolor\"\n                        , Space\n                        , Str \"sit\"\n                        , Space\n                        , Str \"amet,\"\n                        , Space\n                        , Str \"consectetur\"\n                        , Space\n                        , Str \"adipisicing\"\n                        , Space\n                        , Str \"elit,\"\n                        , Space\n                        , Str \"sed\"\n                        , Space\n                        , Str \"do\"\n                        , Space\n                        , Str \"eiusmod\"\n                        , Space\n                        , Str \"tempor\"\n                        , Space\n                        , Str \"incididunt\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"labore\"\n                        , Space\n                        , Str \"et\"\n                        , Space\n                        , Str \"dolore\"\n                        , Space\n                        , Str \"magna\"\n                        , Space\n                        , Str \"aliqua.\"\n                        , Space\n                        , Str \"Ut\"\n                        , Space\n                        , Str \"enim\"\n                        , Space\n                        , Str \"ad\"\n                        , Space\n                        , Str \"minim\"\n                        , Space\n                        , Str \"veniam,\"\n                        , Space\n                        , Str \"quis\"\n                        , Space\n                        , Str \"nostrud\"\n                        , Space\n                        , Str \"exercitation\"\n                        , Space\n                        , Str \"ullamco\"\n                        , Space\n                        , Str \"laboris\"\n                        , Space\n                        , Str \"nisi\"\n                        , Space\n                        , Str \"ut\"\n                        , Space\n                        , Str \"aliquip\"\n                        , Space\n                        , Str \"ex\"\n                        , Space\n                        , Str \"ea\"\n                        , Space\n                        , Str \"commodo\"\n                        , Space\n                        , Str \"consequat.\"\n                        ]\n                    ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"has\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"default\"\n                  , Space\n                  , Str \"setting\"\n                  , Space\n                  , Str \"(marker\"\n                  , Space\n                  , Str \"outside\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"indentation),\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-002.xhtml_style-list-start\"\n          , [ \"section\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Str \"The\"\n              , Space\n              , Str \"HTML\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"start\"\n              , Space\n              , Str \"attribute\"\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-050\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-050\" ]\n                  , Space\n                  , Str \"Without\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"set\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"start\"\n                  , Space\n                  , Str \"attribute\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"no\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property.\"\n                  ]\n              , OrderedList\n                  ( 25 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"starts\"\n                  , Space\n                  , Str \"at\"\n                  , Space\n                  , Str \"25,\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          , Div\n              ( \"styling-xhtml-002.xhtml_style-051\"\n              , [ \"section\" , \"ctest\" ]\n              , []\n              )\n              [ Header\n                  4\n                  ( \"\" , [] , [] )\n                  [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n                  , Space\n                  , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-051\" ]\n                  , Space\n                  , Str \"With\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"set\"\n                  ]\n              , Para\n                  [ Str \"Tests\"\n                  , Space\n                  , Str \"whether\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"start\"\n                  , Space\n                  , Str \"attribute\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"supported\"\n                  , Space\n                  , Str \"on\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"ol\"\n                  , Space\n                  , Str \"element\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"list-style-type\"\n                  , Space\n                  , Str \"property.\"\n                  ]\n              , OrderedList\n                  ( 50 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"Lorem\" ] ]\n                  , [ Plain [ Str \"Ipsum\" ] ]\n                  , [ Plain [ Str \"Dolor\" ] ]\n                  , [ Plain [ Str \"Sit\" ] ]\n                  , [ Plain [ Str \"Amet\" ] ]\n                  ]\n              , Para\n                  [ Str \"If\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"preceding\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"starts\"\n                  , Space\n                  , Str \"at\"\n                  , Space\n                  , Str \"'L'\"\n                  , Space\n                  , Str \"(50),\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"test\"\n                  , Space\n                  , Str \"passes.\"\n                  ]\n              ]\n          ]\n      ]\n  , Para [ Span ( \"styling-xhtml-004.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"styling-xhtml-004.xhtml_style-media-rules\"\n      , [ \"section\" ]\n      , []\n      )\n      [ Header\n          2\n          ( \"\" , [] , [] )\n          [ Code ( \"\" , [] , [] ) \"@media\" , Space , Str \"Rules\" ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-210\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-210\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"all\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"all\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-211\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-211\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"screen\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"screen\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-212\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-212\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"handheld\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"handheld\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-213\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-213\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"tv\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"tv\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-220\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-220\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"orientation:landscape\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"orientation:landscape\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\"\"\n              , Space\n              , Str \"when\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"device\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"held\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"landscape\"\n              , Space\n              , Str \"mode,\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"device\"\n              , Space\n              , Str \"supports\"\n              , Space\n              , Str \"multiple\"\n              , Space\n              , Str \"orientations,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-221\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-221\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"orientation:portrait\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"orientation:portrait\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\"\"\n              , Space\n              , Str \"when\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"device\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"held\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"portrait\"\n              , Space\n              , Str \"mode,\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"device\"\n              , Space\n              , Str \"supports\"\n              , Space\n              , Str \"multiple\"\n              , Space\n              , Str \"orientations,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-230\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-230\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"min-width\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"min-width:200px\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-231\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-231\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"max-width\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"max-width:2000px\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-240\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-240\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"min-device-width\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"min-device-width:200px\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-004.xhtml_style-241\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-241\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"max-device-width\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"@media\"\n              , Space\n              , Str \"rule\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"max-device-width:2000px\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para [ Str \"FAIL\" ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"reads\"\n              , Space\n              , Str \"\\\"FAIL\\\",\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"fails.\"\n              ]\n          ]\n      ]\n  , Para [ Span ( \"styling-xhtml-005.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"styling-xhtml-005.xhtml_style-text-xform\"\n      , [ \"section\" ]\n      , []\n      )\n      [ Header\n          2\n          ( \"\" , [] , [] )\n          [ Str \"The\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"text-transform\"\n          , Space\n          , Str \"property\"\n          ]\n      , Div\n          ( \"styling-xhtml-005.xhtml_style-310\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-310\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"uppercase\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"text-transform\"\n              , Space\n              , Str \"property\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"uppercase\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"upper\"\n              , Space\n              , Str \"case,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-005.xhtml_style-311\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-311\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"capitalize\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"text-transform\"\n              , Space\n              , Str \"property\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"capitalize\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"each\"\n              , Space\n              , Str \"first\"\n              , Space\n              , Str \"letter\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"each\"\n              , Space\n              , Str \"word\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"upper\"\n              , Space\n              , Str \"case,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-005.xhtml_style-312\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-312\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"lowercase\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"text-transform\"\n              , Space\n              , Str \"property\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"lowercase\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Para\n              [ Str \"Lorem\"\n              , Space\n              , Str \"ipsum\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"sit\"\n              , Space\n              , Str \"amet,\"\n              , Space\n              , Str \"consectetur\"\n              , Space\n              , Str \"adipisicing\"\n              , Space\n              , Str \"elit,\"\n              , Space\n              , Str \"sed\"\n              , Space\n              , Str \"do\"\n              , Space\n              , Str \"eiusmod\"\n              , Space\n              , Str \"tempor\"\n              , Space\n              , Str \"incididunt\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"labore\"\n              , Space\n              , Str \"et\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"magna\"\n              , Space\n              , Str \"aliqua.\"\n              , Space\n              , Str \"Ut\"\n              , Space\n              , Str \"enim\"\n              , Space\n              , Str \"ad\"\n              , Space\n              , Str \"minim\"\n              , Space\n              , Str \"veniam,\"\n              , Space\n              , Str \"quis\"\n              , Space\n              , Str \"nostrud\"\n              , Space\n              , Str \"exercitation\"\n              , Space\n              , Str \"ullamco\"\n              , Space\n              , Str \"laboris\"\n              , Space\n              , Str \"nisi\"\n              , Space\n              , Str \"ut\"\n              , Space\n              , Str \"aliquip\"\n              , Space\n              , Str \"ex\"\n              , Space\n              , Str \"ea\"\n              , Space\n              , Str \"commodo\"\n              , Space\n              , Str \"consequat.\"\n              , Space\n              , Str \"Duis\"\n              , Space\n              , Str \"aute\"\n              , Space\n              , Str \"irure\"\n              , Space\n              , Str \"dolor\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"reprehenderit\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"voluptate\"\n              , Space\n              , Str \"velit\"\n              , Space\n              , Str \"esse\"\n              , Space\n              , Str \"cillum\"\n              , Space\n              , Str \"dolore\"\n              , Space\n              , Str \"eu\"\n              , Space\n              , Str \"fugiat\"\n              , Space\n              , Str \"nulla\"\n              , Space\n              , Str \"pariatur.\"\n              , Space\n              , Str \"Excepteur\"\n              , Space\n              , Str \"sint\"\n              , Space\n              , Str \"occaecat\"\n              , Space\n              , Str \"cupidatat\"\n              , Space\n              , Str \"non\"\n              , Space\n              , Str \"proident,\"\n              , Space\n              , Str \"sunt\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"culpa\"\n              , Space\n              , Str \"qui\"\n              , Space\n              , Str \"officia\"\n              , Space\n              , Str \"deserunt\"\n              , Space\n              , Str \"mollit\"\n              , Space\n              , Str \"anim\"\n              , Space\n              , Str \"id\"\n              , Space\n              , Str \"est\"\n              , Space\n              , Str \"laborum.\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"preceding\"\n              , Space\n              , Str \"paragraph\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"lower\"\n              , Space\n              , Str \"case,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      ]\n  , Para [ Span ( \"styling-xhtml-006.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"styling-xhtml-006.xhtml_style-ruby\"\n      , [ \"section\" ]\n      , []\n      )\n      [ Header\n          2\n          ( \"\" , [] , [] )\n          [ Str \"The\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"epub-ruby-position\"\n          , Space\n          , Str \"property\"\n          ]\n      , Div\n          ( \"styling-xhtml-006.xhtml_style-410\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-410\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"over\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"-epub-ruby-position\"\n              , Space\n              , Str \"property\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"over\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ RawInline (Format \"html\") \"<ruby class=\\\"ruby-over\\\">\"\n              , Strong [ Str \"Lorem\" , Space , Str \"Ipsum\" ]\n              , Space\n              , RawInline (Format \"html\") \"<rp>\"\n              , Str \"(\"\n              , RawInline (Format \"html\") \"</rp>\"\n              , RawInline (Format \"html\") \"<rt>\"\n              , Str \"Lorem\"\n              , Space\n              , Str \"Ipsum\"\n              , RawInline (Format \"html\") \"</rt>\"\n              , RawInline (Format \"html\") \"<rp>\"\n              , Str \")\"\n              , RawInline (Format \"html\") \"</rp>\"\n              , RawInline (Format \"html\") \"</ruby>\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"Ruby\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"positioned\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"over\" ]\n                  ( \"http://www.w3.org/TR/css3-writing-modes/#over\"\n                  , \"\"\n                  )\n              , Space\n              , Str \"side\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"ruby\"\n              , Space\n              , Str \"base,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-006.xhtml_style-411\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-411\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"under\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"-epub-ruby-position\"\n              , Space\n              , Str \"property\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"under\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ RawInline (Format \"html\") \"<ruby class=\\\"ruby-under\\\">\"\n              , Strong [ Str \"Lorem\" , Space , Str \"Ipsum\" ]\n              , Space\n              , RawInline (Format \"html\") \"<rp>\"\n              , Str \"(\"\n              , RawInline (Format \"html\") \"</rp>\"\n              , RawInline (Format \"html\") \"<rt>\"\n              , Str \"Lorem\"\n              , Space\n              , Str \"Ipsum\"\n              , RawInline (Format \"html\") \"</rt>\"\n              , RawInline (Format \"html\") \"<rp>\"\n              , Str \")\"\n              , RawInline (Format \"html\") \"</rp>\"\n              , RawInline (Format \"html\") \"</ruby>\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"Ruby\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"positioned\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"under\" ]\n                  ( \"http://www.w3.org/TR/css3-writing-modes/#under\"\n                  , \"\"\n                  )\n              , Space\n              , Str \"side\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"ruby\"\n              , Space\n              , Str \"base,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      , Div\n          ( \"styling-xhtml-006.xhtml_style-412\"\n          , [ \"section\" , \"ctest\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Span ( \"\" , [ \"nature\" ] , [] ) [ Str \"[REQUIRED]\" ]\n              , Space\n              , Span ( \"\" , [ \"test-id\" ] , [] ) [ Str \"style-412\" ]\n              , Space\n              , Code ( \"\" , [] , [] ) \"inter-character\"\n              ]\n          , Para\n              [ Str \"Tests\"\n              , Space\n              , Str \"whether\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"-epub-ruby-position\"\n              , Space\n              , Str \"property\"\n              , Space\n              , Str \"set\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"inter-caracter\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"supported.\"\n              ]\n          , Plain\n              [ RawInline\n                  (Format \"html\")\n                  \"<ruby class=\\\"ruby-inter-character\\\">\"\n              , Strong [ Str \"Lorem\" , Space , Str \"Ipsum\" ]\n              , Space\n              , RawInline (Format \"html\") \"<rp>\"\n              , Str \"(\"\n              , RawInline (Format \"html\") \"</rp>\"\n              , RawInline (Format \"html\") \"<rt>\"\n              , Str \"Lorem\"\n              , Space\n              , Str \"Ipsum\"\n              , RawInline (Format \"html\") \"</rt>\"\n              , RawInline (Format \"html\") \"<rp>\"\n              , Str \")\"\n              , RawInline (Format \"html\") \"</rp>\"\n              , RawInline (Format \"html\") \"</ruby>\"\n              ]\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"Ruby\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"positioned\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"right\"\n              , Space\n              , Str \"side\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"base\"\n              , Space\n              , Str \"text,\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"test\"\n              , Space\n              , Str \"passes.\"\n              ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/epub/wasteland.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\" , MetaInlines [ Str \"T.S. Eliot\" ] )\n          , ( \"date\" , MetaInlines [ Str \"2011-09-01\" ] )\n          , ( \"identifier\"\n            , MetaInlines\n                [ Str \"code.google.com.epub-samples.wasteland-basic\" ]\n            )\n          , ( \"language\" , MetaInlines [ Str \"en-US\" ] )\n          , ( \"rights\"\n            , MetaInlines\n                [ Str\n                    \"This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.\"\n                ]\n            )\n          , ( \"title\" , MetaInlines [ Str \"The Waste Land\" ] )\n          ]\n    }\n  [ Para\n      [ Image ( \"\" , [] , [] ) [] ( \"wasteland-cover.jpg\" , \"\" ) ]\n  , Para [ Span ( \"wasteland-content.xhtml\" , [] , [] ) [] ]\n  , Div\n      ( \"wasteland-content.xhtml_frontmatter\"\n      , [ \"section\" , \"frontmatter\" ]\n      , []\n      )\n      []\n  , Div\n      ( \"wasteland-content.xhtml_bodymatter\"\n      , [ \"section\" , \"bodymatter\" ]\n      , []\n      )\n      [ Div\n          ( \"wasteland-content.xhtml_ch1\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"I.\"\n              , Space\n              , Str \"THE\"\n              , Space\n              , Str \"BURIAL\"\n              , Space\n              , Str \"OF\"\n              , Space\n              , Str \"THE\"\n              , Space\n              , Str \"DEAD\"\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"April\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"cruellest\"\n                      , Space\n                      , Str \"month,\"\n                      , Space\n                      , Str \"breeding\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Lilacs\"\n                      , Space\n                      , Str \"out\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"dead\"\n                      , Space\n                      , Str \"land,\"\n                      , Space\n                      , Str \"mixing\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Memory\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"desire,\"\n                      , Space\n                      , Str \"stirring\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Dull\"\n                      , Space\n                      , Str \"roots\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"spring\"\n                      , Space\n                      , Str \"rain.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Winter\"\n                      , Space\n                      , Str \"kept\"\n                      , Space\n                      , Str \"us\"\n                      , Space\n                      , Str \"warm,\"\n                      , Space\n                      , Str \"covering\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Earth\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"forgetful\"\n                      , Space\n                      , Str \"snow,\"\n                      , Space\n                      , Str \"feeding\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"A\"\n                      , Space\n                      , Str \"little\"\n                      , Space\n                      , Str \"life\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"dried\"\n                      , Space\n                      , Str \"tubers.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Summer\"\n                      , Space\n                      , Str \"surprised\"\n                      , Space\n                      , Str \"us,\"\n                      , Space\n                      , Str \"coming\"\n                      , Space\n                      , Str \"over\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Starnbergersee\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"With\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"shower\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"rain;\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"stopped\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"colonnade,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"went\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"sunlight,\"\n                      , Space\n                      , Str \"into\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Hofgarten,\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"10\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"drank\"\n                      , Space\n                      , Str \"coffee,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"talked\"\n                      , Space\n                      , Str \"for\"\n                      , Space\n                      , Str \"an\"\n                      , Space\n                      , Str \"hour.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [ ( \"lang\" , \"de\" ) ] )\n                  [ Plain\n                      [ Str \"Bin\"\n                      , Space\n                      , Str \"gar\"\n                      , Space\n                      , Str \"keine\"\n                      , Space\n                      , Str \"Russin,\"\n                      , Space\n                      , Str \"stamm'\"\n                      , Space\n                      , Str \"aus\"\n                      , Space\n                      , Str \"Litauen,\"\n                      , Space\n                      , Str \"echt\"\n                      , SoftBreak\n                      , Str \"deutsch.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"when\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"were\"\n                      , Space\n                      , Str \"children,\"\n                      , Space\n                      , Str \"staying\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"archduke's,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"My\"\n                      , Space\n                      , Str \"cousin's,\"\n                      , Space\n                      , Str \"he\"\n                      , Space\n                      , Str \"took\"\n                      , Space\n                      , Str \"me\"\n                      , Space\n                      , Str \"out\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"sled,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"was\"\n                      , Space\n                      , Str \"frightened.\"\n                      , Space\n                      , Str \"He\"\n                      , Space\n                      , Str \"said,\"\n                      , Space\n                      , Str \"Marie,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Marie,\"\n                      , Space\n                      , Str \"hold\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"tight.\"\n                      , Space\n                      , Str \"And\"\n                      , Space\n                      , Str \"down\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"went.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"In\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"mountains,\"\n                      , Space\n                      , Str \"there\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"feel\"\n                      , Space\n                      , Str \"free.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"read,\"\n                      , Space\n                      , Str \"much\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"night,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"go\"\n                      , Space\n                      , Str \"south\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"winter.\"\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"What\"\n                      , Space\n                      , Str \"are\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"roots\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"clutch,\"\n                      , Space\n                      , Str \"what\"\n                      , Space\n                      , Str \"branches\"\n                      , Space\n                      , Str \"grow\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln20\" , [] , [] )\n                  [ Plain\n                      [ Str \"Out\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"this\"\n                      , Space\n                      , Str \"stony\"\n                      , Space\n                      , Str \"rubbish?\"\n                      , Space\n                      , Str \"Son\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"man,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"Line\" , Space , Str \"20.\" ]\n                                  ( \"#wasteland-content.xhtml_ln20\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Ezekiel\"\n                              , Space\n                              , Str \"2:1.\"\n                              ]\n                          ]\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"20\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"You\"\n                      , Space\n                      , Str \"cannot\"\n                      , Space\n                      , Str \"say,\"\n                      , Space\n                      , Str \"or\"\n                      , Space\n                      , Str \"guess,\"\n                      , Space\n                      , Str \"for\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"know\"\n                      , Space\n                      , Str \"only\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"A\"\n                      , Space\n                      , Str \"heap\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"broken\"\n                      , Space\n                      , Str \"images,\"\n                      , Space\n                      , Str \"where\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"sun\"\n                      , Space\n                      , Str \"beats,\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln23\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"dead\"\n                      , Space\n                      , Str \"tree\"\n                      , Space\n                      , Str \"gives\"\n                      , Space\n                      , Str \"no\"\n                      , Space\n                      , Str \"shelter,\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"cricket\"\n                      , Space\n                      , Str \"no\"\n                      , Space\n                      , Str \"relief,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"23.\" ]\n                                  ( \"#wasteland-content.xhtml_ln23\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Ecclesiastes\"\n                              , Space\n                              , Str \"12:5.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"dry\"\n                      , Space\n                      , Str \"stone\"\n                      , Space\n                      , Str \"no\"\n                      , Space\n                      , Str \"sound\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"water.\"\n                      , Space\n                      , Str \"Only\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"There\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"shadow\"\n                      , Space\n                      , Str \"under\"\n                      , Space\n                      , Str \"this\"\n                      , Space\n                      , Str \"red\"\n                      , Space\n                      , Str \"rock,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"(Come\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"under\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"shadow\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"this\"\n                      , Space\n                      , Str \"red\"\n                      , Space\n                      , Str \"rock),\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"will\"\n                      , Space\n                      , Str \"show\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"something\"\n                      , Space\n                      , Str \"different\"\n                      , Space\n                      , Str \"from\"\n                      , Space\n                      , Str \"either\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Your\"\n                      , Space\n                      , Str \"shadow\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"morning\"\n                      , Space\n                      , Str \"striding\"\n                      , Space\n                      , Str \"behind\"\n                      , Space\n                      , Str \"you\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Or\"\n                      , Space\n                      , Str \"your\"\n                      , Space\n                      , Str \"shadow\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"evening\"\n                      , Space\n                      , Str \"rising\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"meet\"\n                      , Space\n                      , Str \"you;\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"will\"\n                      , Space\n                      , Str \"show\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"fear\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"handful\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"dust.\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"30\" ]\n                      ]\n                  ]\n              , BlockQuote\n                  [ Div\n                      ( \"\" , [] , [] )\n                      [ Div\n                          ( \"wasteland-content.xhtml_ln31\" , [] , [] )\n                          [ Plain\n                              [ Str \"Frisch\"\n                              , Space\n                              , Str \"weht\"\n                              , Space\n                              , Str \"der\"\n                              , Space\n                              , Str \"Wind\"\n                              , Note\n                                  [ Para\n                                      [ Link\n                                          ( \"\" , [] , [] )\n                                          [ Str \"31.\" ]\n                                          ( \"#wasteland-content.xhtml_ln31\"\n                                          , \"\"\n                                          )\n                                      , Space\n                                      , Str \"V.\"\n                                      , Space\n                                      , Str \"Tristan\"\n                                      , Space\n                                      , Str \"und\"\n                                      , Space\n                                      , Str \"Isolde,\"\n                                      , Space\n                                      , Str \"i,\"\n                                      , Space\n                                      , Str \"verses\"\n                                      , Space\n                                      , Str \"5-8.\"\n                                      ]\n                                  ]\n                              ]\n                          ]\n                      , Div\n                          ( \"\" , [] , [] )\n                          [ Plain\n                              [ Str \"Der\"\n                              , Space\n                              , Str \"Heimat\"\n                              , Space\n                              , Str \"zu\"\n                              ]\n                          ]\n                      , Div\n                          ( \"\" , [] , [] )\n                          [ Plain\n                              [ Str \"Mein\"\n                              , Space\n                              , Str \"Irisch\"\n                              , Space\n                              , Str \"Kind,\"\n                              ]\n                          ]\n                      , Div\n                          ( \"\" , [] , [] )\n                          [ Plain\n                              [ Str \"Wo\"\n                              , Space\n                              , Str \"weilest\"\n                              , Space\n                              , Str \"du?\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"You\"\n                      , Space\n                      , Str \"gave\"\n                      , Space\n                      , Str \"me\"\n                      , Space\n                      , Str \"hyacinths\"\n                      , Space\n                      , Str \"first\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"year\"\n                      , Space\n                      , Str \"ago;\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"They\"\n                      , Space\n                      , Str \"called\"\n                      , Space\n                      , Str \"me\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"hyacinth\"\n                      , Space\n                      , Str \"girl.\\\"\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\8213Yet\"\n                      , Space\n                      , Str \"when\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"came\"\n                      , Space\n                      , Str \"back,\"\n                      , Space\n                      , Str \"late,\"\n                      , Space\n                      , Str \"from\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Hyacinth\"\n                      , SoftBreak\n                      , Str \"garden,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Your\"\n                      , Space\n                      , Str \"arms\"\n                      , Space\n                      , Str \"full,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"your\"\n                      , Space\n                      , Str \"hair\"\n                      , Space\n                      , Str \"wet,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"could\"\n                      , Space\n                      , Str \"not\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Speak,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"my\"\n                      , Space\n                      , Str \"eyes\"\n                      , Space\n                      , Str \"failed,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"was\"\n                      , Space\n                      , Str \"neither\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Living\"\n                      , Space\n                      , Str \"nor\"\n                      , Space\n                      , Str \"dead,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"knew\"\n                      , Space\n                      , Str \"nothing,\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"40\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Looking\"\n                      , Space\n                      , Str \"into\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"heart\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"light,\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"silence.\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln42\"\n                  , []\n                  , [ ( \"lang\" , \"de\" ) ]\n                  )\n                  [ Plain\n                      [ Emph\n                          [ Str \"Od'\"\n                          , Space\n                          , Str \"und\"\n                          , Space\n                          , Str \"leer\"\n                          , Space\n                          , Str \"das\"\n                          , Space\n                          , Str \"Meer\"\n                          ]\n                      , Str \".\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"42.\" ]\n                                  ( \"#wasteland-content.xhtml_ln42\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Id.\"\n                              , Space\n                              , Str \"iii,\"\n                              , Space\n                              , Str \"verse\"\n                              , Space\n                              , Str \"24.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Madame\"\n                      , Space\n                      , Str \"Sosostris,\"\n                      , Space\n                      , Str \"famous\"\n                      , Space\n                      , Str \"clairvoyante,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Had\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"bad\"\n                      , Space\n                      , Str \"cold,\"\n                      , Space\n                      , Str \"nevertheless\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Is\"\n                      , Space\n                      , Str \"known\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"be\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"wisest\"\n                      , Space\n                      , Str \"woman\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"Europe,\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln46\" , [] , [] )\n                  [ Plain\n                      [ Str \"With\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"wicked\"\n                      , Space\n                      , Str \"pack\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"cards.\"\n                      , Space\n                      , Str \"Here,\"\n                      , Space\n                      , Str \"said\"\n                      , Space\n                      , Str \"she,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"46.\" ]\n                                  ( \"#wasteland-content.xhtml_ln46\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"I\"\n                              , Space\n                              , Str \"am\"\n                              , Space\n                              , Str \"not\"\n                              , Space\n                              , Str \"familiar\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"exact\"\n                              , Space\n                              , Str \"constitution\"\n                              , Space\n                              , Str \"of\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"Tarot\"\n                              , Space\n                              , Str \"pack\"\n                              , Space\n                              , Str \"of\"\n                              , SoftBreak\n                              , Str \"cards,\"\n                              , Space\n                              , Str \"from\"\n                              , Space\n                              , Str \"which\"\n                              , Space\n                              , Str \"I\"\n                              , Space\n                              , Str \"have\"\n                              , Space\n                              , Str \"obviously\"\n                              , Space\n                              , Str \"departed\"\n                              , Space\n                              , Str \"to\"\n                              , Space\n                              , Str \"suit\"\n                              , Space\n                              , Str \"my\"\n                              , Space\n                              , Str \"own\"\n                              , Space\n                              , Str \"convenience.\"\n                              , SoftBreak\n                              , Str \"The\"\n                              , Space\n                              , Str \"Hanged\"\n                              , Space\n                              , Str \"Man,\"\n                              , Space\n                              , Str \"a\"\n                              , Space\n                              , Str \"member\"\n                              , Space\n                              , Str \"of\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"traditional\"\n                              , Space\n                              , Str \"pack,\"\n                              , Space\n                              , Str \"fits\"\n                              , Space\n                              , Str \"my\"\n                              , Space\n                              , Str \"purpose\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"two\"\n                              , SoftBreak\n                              , Str \"ways:\"\n                              , Space\n                              , Str \"because\"\n                              , Space\n                              , Str \"he\"\n                              , Space\n                              , Str \"is\"\n                              , Space\n                              , Str \"associated\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"my\"\n                              , Space\n                              , Str \"mind\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"Hanged\"\n                              , Space\n                              , Str \"God\"\n                              , Space\n                              , Str \"of\"\n                              , Space\n                              , Str \"Frazer,\"\n                              , SoftBreak\n                              , Str \"and\"\n                              , Space\n                              , Str \"because\"\n                              , Space\n                              , Str \"I\"\n                              , Space\n                              , Str \"associate\"\n                              , Space\n                              , Str \"him\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"hooded\"\n                              , Space\n                              , Str \"figure\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"passage\"\n                              , Space\n                              , Str \"of\"\n                              , Space\n                              , Str \"the\"\n                              , SoftBreak\n                              , Str \"disciples\"\n                              , Space\n                              , Str \"to\"\n                              , Space\n                              , Str \"Emmaus\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"Part\"\n                              , Space\n                              , Str \"V.\"\n                              , Space\n                              , Str \"The\"\n                              , Space\n                              , Str \"Phoenician\"\n                              , Space\n                              , Str \"Sailor\"\n                              , Space\n                              , Str \"and\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"Merchant\"\n                              , SoftBreak\n                              , Str \"appear\"\n                              , Space\n                              , Str \"later;\"\n                              , Space\n                              , Str \"also\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"\\\"crowds\"\n                              , Space\n                              , Str \"of\"\n                              , Space\n                              , Str \"people,\\\"\"\n                              , Space\n                              , Str \"and\"\n                              , Space\n                              , Str \"Death\"\n                              , Space\n                              , Str \"by\"\n                              , Space\n                              , Str \"Water\"\n                              , Space\n                              , Str \"is\"\n                              , SoftBreak\n                              , Str \"executed\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"Part\"\n                              , Space\n                              , Str \"IV.\"\n                              , Space\n                              , Str \"The\"\n                              , Space\n                              , Str \"Man\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"Three\"\n                              , Space\n                              , Str \"Staves\"\n                              , Space\n                              , Str \"(an\"\n                              , Space\n                              , Str \"authentic\"\n                              , Space\n                              , Str \"member\"\n                              , Space\n                              , Str \"of\"\n                              , SoftBreak\n                              , Str \"the\"\n                              , Space\n                              , Str \"Tarot\"\n                              , Space\n                              , Str \"pack)\"\n                              , Space\n                              , Str \"I\"\n                              , Space\n                              , Str \"associate,\"\n                              , Space\n                              , Str \"quite\"\n                              , Space\n                              , Str \"arbitrarily,\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"Fisher\"\n                              , Space\n                              , Str \"King\"\n                              , SoftBreak\n                              , Str \"himself.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Is\"\n                      , Space\n                      , Str \"your\"\n                      , Space\n                      , Str \"card,\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"drowned\"\n                      , Space\n                      , Str \"Phoenician\"\n                      , Space\n                      , Str \"Sailor,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"(Those\"\n                      , Space\n                      , Str \"are\"\n                      , Space\n                      , Str \"pearls\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"were\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"eyes.\"\n                      , Space\n                      , Str \"Look!)\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Here\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"Belladonna,\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Lady\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Rocks,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"lady\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"situations.\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"50\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Here\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"man\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"three\"\n                      , Space\n                      , Str \"staves,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"here\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Wheel,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"here\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"one-eyed\"\n                      , Space\n                      , Str \"merchant,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"this\"\n                      , Space\n                      , Str \"card,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Which\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"blank,\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"something\"\n                      , Space\n                      , Str \"he\"\n                      , Space\n                      , Str \"carries\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"back,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Which\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"am\"\n                      , Space\n                      , Str \"forbidden\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"see.\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"do\"\n                      , Space\n                      , Str \"not\"\n                      , Space\n                      , Str \"find\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"Hanged\"\n                      , Space\n                      , Str \"Man.\"\n                      , Space\n                      , Str \"Fear\"\n                      , Space\n                      , Str \"death\"\n                      , Space\n                      , Str \"by\"\n                      , Space\n                      , Str \"water.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"see\"\n                      , Space\n                      , Str \"crowds\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"people,\"\n                      , Space\n                      , Str \"walking\"\n                      , Space\n                      , Str \"round\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"ring.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Thank\"\n                      , Space\n                      , Str \"you.\"\n                      , Space\n                      , Str \"If\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"see\"\n                      , Space\n                      , Str \"dear\"\n                      , Space\n                      , Str \"Mrs.\"\n                      , Space\n                      , Str \"Equitone,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Tell\"\n                      , Space\n                      , Str \"her\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"bring\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"horoscope\"\n                      , Space\n                      , Str \"myself:\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"One\"\n                      , Space\n                      , Str \"must\"\n                      , Space\n                      , Str \"be\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"careful\"\n                      , Space\n                      , Str \"these\"\n                      , Space\n                      , Str \"days.\"\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"wasteland-content.xhtml_ln60\" , [] , [] )\n                  [ Plain\n                      [ Str \"Unreal\"\n                      , Space\n                      , Str \"City,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"60.\" ]\n                                  ( \"#wasteland-content.xhtml_ln60\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Baudelaire:\"\n                              ]\n                          , BlockQuote\n                              [ Para\n                                  [ Str \"\\\"Fourmillante\"\n                                  , Space\n                                  , Str \"cite;,\"\n                                  , Space\n                                  , Str \"cite;\"\n                                  , Space\n                                  , Str \"pleine\"\n                                  , Space\n                                  , Str \"de\"\n                                  , Space\n                                  , Str \"reves,\"\n                                  , LineBreak\n                                  , Str \"Ou\"\n                                  , Space\n                                  , Str \"le\"\n                                  , Space\n                                  , Str \"spectre\"\n                                  , Space\n                                  , Str \"en\"\n                                  , SoftBreak\n                                  , Str \"plein\"\n                                  , Space\n                                  , Str \"jour\"\n                                  , Space\n                                  , Str \"raccroche\"\n                                  , Space\n                                  , Str \"le\"\n                                  , Space\n                                  , Str \"passant.\\\"\"\n                                  ]\n                              ]\n                          ]\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"60\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Under\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"brown\"\n                      , Space\n                      , Str \"fog\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"winter\"\n                      , Space\n                      , Str \"dawn,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"A\"\n                      , Space\n                      , Str \"crowd\"\n                      , Space\n                      , Str \"flowed\"\n                      , Space\n                      , Str \"over\"\n                      , Space\n                      , Str \"London\"\n                      , Space\n                      , Str \"Bridge,\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"many,\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln63\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"had\"\n                      , Space\n                      , Str \"not\"\n                      , Space\n                      , Str \"thought\"\n                      , Space\n                      , Str \"death\"\n                      , Space\n                      , Str \"had\"\n                      , Space\n                      , Str \"undone\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"many.\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"63.\" ]\n                                  ( \"#wasteland-content.xhtml_ln63\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Inferno,\"\n                              , Space\n                              , Str \"iii.\"\n                              , Space\n                              , Str \"55-7.\"\n                              ]\n                          , BlockQuote\n                              [ Para\n                                  [ Str \"\\\"si\"\n                                  , Space\n                                  , Str \"lunga\"\n                                  , Space\n                                  , Str \"tratta\"\n                                  , LineBreak\n                                  , Str \"di\"\n                                  , Space\n                                  , Str \"gente,\"\n                                  , Space\n                                  , Str \"ch'io\"\n                                  , Space\n                                  , Str \"non\"\n                                  , Space\n                                  , Str \"avrei\"\n                                  , Space\n                                  , Str \"mai\"\n                                  , Space\n                                  , Str \"creduto\"\n                                  , LineBreak\n                                  , Str \"che\"\n                                  , SoftBreak\n                                  , Str \"morte\"\n                                  , Space\n                                  , Str \"tanta\"\n                                  , Space\n                                  , Str \"n'avesse\"\n                                  , Space\n                                  , Str \"disfatta.\\\"\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln64\" , [] , [] )\n                  [ Plain\n                      [ Str \"Sighs,\"\n                      , Space\n                      , Str \"short\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"infrequent,\"\n                      , Space\n                      , Str \"were\"\n                      , Space\n                      , Str \"exhaled,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"64.\" ]\n                                  ( \"#wasteland-content.xhtml_ln64\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Inferno,\"\n                              , Space\n                              , Str \"iv.\"\n                              , Space\n                              , Str \"25-7:\"\n                              ]\n                          , BlockQuote\n                              [ Para\n                                  [ Str \"\\\"Quivi,\"\n                                  , Space\n                                  , Str \"secondo\"\n                                  , Space\n                                  , Str \"che\"\n                                  , Space\n                                  , Str \"per\"\n                                  , Space\n                                  , Str \"ascoltahre,\"\n                                  , LineBreak\n                                  , Str \"\\\"non\"\n                                  , Space\n                                  , Str \"avea\"\n                                  , Space\n                                  , Str \"pianto,\"\n                                  , Space\n                                  , Str \"ma'\"\n                                  , Space\n                                  , Str \"che\"\n                                  , Space\n                                  , Str \"di\"\n                                  , SoftBreak\n                                  , Str \"sospiri,\"\n                                  , LineBreak\n                                  , Str \"\\\"che\"\n                                  , Space\n                                  , Str \"l'aura\"\n                                  , Space\n                                  , Str \"eterna\"\n                                  , Space\n                                  , Str \"facevan\"\n                                  , Space\n                                  , Str \"tremare.\\\"\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"each\"\n                      , Space\n                      , Str \"man\"\n                      , Space\n                      , Str \"fixed\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"eyes\"\n                      , Space\n                      , Str \"before\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"feet.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Flowed\"\n                      , Space\n                      , Str \"up\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"hill\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"down\"\n                      , Space\n                      , Str \"King\"\n                      , Space\n                      , Str \"William\"\n                      , Space\n                      , Str \"Street,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"To\"\n                      , Space\n                      , Str \"where\"\n                      , Space\n                      , Str \"Saint\"\n                      , Space\n                      , Str \"Mary\"\n                      , Space\n                      , Str \"Woolnoth\"\n                      , Space\n                      , Str \"kept\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"hours\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln68\" , [] , [] )\n                  [ Plain\n                      [ Str \"With\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"dead\"\n                      , Space\n                      , Str \"sound\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"final\"\n                      , Space\n                      , Str \"stroke\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"nine.\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"68.\" ]\n                                  ( \"#wasteland-content.xhtml_ln68\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"A\"\n                              , Space\n                              , Str \"phenomenon\"\n                              , Space\n                              , Str \"which\"\n                              , Space\n                              , Str \"I\"\n                              , Space\n                              , Str \"have\"\n                              , Space\n                              , Str \"often\"\n                              , Space\n                              , Str \"noticed.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"There\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"saw\"\n                      , Space\n                      , Str \"one\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"knew,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"stopped\"\n                      , Space\n                      , Str \"him,\"\n                      , Space\n                      , Str \"crying\"\n                      , SoftBreak\n                      , Str \"\\\"Stetson!\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"You\"\n                      , Space\n                      , Str \"who\"\n                      , Space\n                      , Str \"were\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"me\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"ships\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"Mylae!\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"70\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"That\"\n                      , Space\n                      , Str \"corpse\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"planted\"\n                      , Space\n                      , Str \"last\"\n                      , Space\n                      , Str \"year\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"your\"\n                      , Space\n                      , Str \"garden,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"Has\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"begun\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"sprout?\"\n                      , Space\n                      , Str \"Will\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"bloom\"\n                      , Space\n                      , Str \"this\"\n                      , Space\n                      , Str \"year?\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"Or\"\n                      , Space\n                      , Str \"has\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"sudden\"\n                      , Space\n                      , Str \"frost\"\n                      , Space\n                      , Str \"disturbed\"\n                      , Space\n                      , Str \"its\"\n                      , Space\n                      , Str \"bed?\"\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"wasteland-content.xhtml_ln74\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"Oh\"\n                      , Space\n                      , Str \"keep\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"Dog\"\n                      , Space\n                      , Str \"far\"\n                      , Space\n                      , Str \"hence,\"\n                      , Space\n                      , Str \"that's\"\n                      , Space\n                      , Str \"friend\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"men,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"74.\" ]\n                                  ( \"#wasteland-content.xhtml_ln74\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"Dirge\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"Webster's\"\n                              , Space\n                              , Str \"White\"\n                              , Space\n                              , Str \"Devil\"\n                              , Space\n                              , Str \".\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"Or\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"nails\"\n                      , Space\n                      , Str \"he'll\"\n                      , Space\n                      , Str \"dig\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"up\"\n                      , Space\n                      , Str \"again!\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln76\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"You!\"\n                      , Space\n                      , Span\n                          ( \"\" , [] , [ ( \"lang\" , \"fr\" ) ] )\n                          [ Str \"hypocrite\"\n                          , Space\n                          , Str \"lecteur!\"\n                          , Space\n                          , Str \"-\"\n                          , Space\n                          , Str \"mon\"\n                          , Space\n                          , Str \"semblable,\"\n                          , Space\n                          , Str \"-\"\n                          , SoftBreak\n                          , Str \"mon\"\n                          , Space\n                          , Str \"frere\"\n                          ]\n                      , Space\n                      , Str \"!\\\"\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"76.\" ]\n                                  ( \"#wasteland-content.xhtml_ln76\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"V.\"\n                              , Space\n                              , Str \"Baudelaire,\"\n                              , Space\n                              , Str \"Preface\"\n                              , Space\n                              , Str \"to\"\n                              , Space\n                              , Str \"Fleurs\"\n                              , Space\n                              , Str \"du\"\n                              , Space\n                              , Str \"Mal.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n          ]\n      , Div\n          ( \"wasteland-content.xhtml_ch2\" , [ \"section\" ] , [] )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"II.\"\n              , Space\n              , Str \"A\"\n              , Space\n              , Str \"GAME\"\n              , Space\n              , Str \"OF\"\n              , Space\n              , Str \"CHESS\"\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"wasteland-content.xhtml_ln77\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"Chair\"\n                      , Space\n                      , Str \"she\"\n                      , Space\n                      , Str \"sat\"\n                      , Space\n                      , Str \"in,\"\n                      , Space\n                      , Str \"like\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"burnished\"\n                      , Space\n                      , Str \"throne,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"77.\" ]\n                                  ( \"#wasteland-content.xhtml_ln77\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Antony\"\n                              , Space\n                              , Str \"and\"\n                              , Space\n                              , Str \"Cleopatra,\"\n                              , Space\n                              , Str \"II.\"\n                              , Space\n                              , Str \"ii.,\"\n                              , Space\n                              , Str \"l.\"\n                              , Space\n                              , Str \"190.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Glowed\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"marble,\"\n                      , Space\n                      , Str \"where\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"glass\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Held\"\n                      , Space\n                      , Str \"up\"\n                      , Space\n                      , Str \"by\"\n                      , Space\n                      , Str \"standards\"\n                      , Space\n                      , Str \"wrought\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"fruited\"\n                      , Space\n                      , Str \"vines\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"From\"\n                      , Space\n                      , Str \"which\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"golden\"\n                      , Space\n                      , Str \"Cupidon\"\n                      , Space\n                      , Str \"peeped\"\n                      , Space\n                      , Str \"out\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"80\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"(Another\"\n                      , Space\n                      , Str \"hid\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"eyes\"\n                      , Space\n                      , Str \"behind\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"wing)\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Doubled\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"flames\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"sevenbranched\"\n                      , Space\n                      , Str \"candelabra\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Reflecting\"\n                      , Space\n                      , Str \"light\"\n                      , Space\n                      , Str \"upon\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"table\"\n                      , Space\n                      , Str \"as\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"glitter\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"her\"\n                      , Space\n                      , Str \"jewels\"\n                      , Space\n                      , Str \"rose\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"meet\"\n                      , Space\n                      , Str \"it,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"From\"\n                      , Space\n                      , Str \"satin\"\n                      , Space\n                      , Str \"cases\"\n                      , Space\n                      , Str \"poured\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"rich\"\n                      , Space\n                      , Str \"profusion;\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"In\"\n                      , Space\n                      , Str \"vials\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"ivory\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"coloured\"\n                      , Space\n                      , Str \"glass\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Unstoppered,\"\n                      , Space\n                      , Str \"lurked\"\n                      , Space\n                      , Str \"her\"\n                      , Space\n                      , Str \"strange\"\n                      , Space\n                      , Str \"synthetic\"\n                      , Space\n                      , Str \"perfumes,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Unguent,\"\n                      , Space\n                      , Str \"powdered,\"\n                      , Space\n                      , Str \"or\"\n                      , Space\n                      , Str \"liquid\"\n                      , Space\n                      , Str \"-\"\n                      , Space\n                      , Str \"troubled,\"\n                      , Space\n                      , Str \"confused\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"drowned\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"sense\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"odours;\"\n                      , Space\n                      , Str \"stirred\"\n                      , Space\n                      , Str \"by\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"air\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"That\"\n                      , Space\n                      , Str \"freshened\"\n                      , Space\n                      , Str \"from\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"window,\"\n                      , Space\n                      , Str \"these\"\n                      , Space\n                      , Str \"ascended\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"90\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"In\"\n                      , Space\n                      , Str \"fattening\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"prolonged\"\n                      , Space\n                      , Str \"candle-flames,\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln92\" , [] , [] )\n                  [ Plain\n                      [ Str \"Flung\"\n                      , Space\n                      , Str \"their\"\n                      , Space\n                      , Str \"smoke\"\n                      , Space\n                      , Str \"into\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"laquearia,\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"92.\" ]\n                                  ( \"#wasteland-content.xhtml_ln92\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Laquearia.\"\n                              , Space\n                              , Str \"V.\"\n                              , Space\n                              , Str \"Aeneid,\"\n                              , Space\n                              , Str \"I.\"\n                              , Space\n                              , Str \"726:\"\n                              ]\n                          , BlockQuote\n                              [ Para\n                                  [ Str \"dependent\"\n                                  , Space\n                                  , Str \"lychni\"\n                                  , Space\n                                  , Str \"laquearibus\"\n                                  , Space\n                                  , Str \"aureis\"\n                                  , Space\n                                  , Str \"incensi,\"\n                                  , Space\n                                  , Str \"et\"\n                                  , Space\n                                  , Str \"noctem\"\n                                  , SoftBreak\n                                  , Str \"flammis\"\n                                  , LineBreak\n                                  , Str \"funalia\"\n                                  , Space\n                                  , Str \"vincunt.\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Stirring\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"pattern\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"coffered\"\n                      , Space\n                      , Str \"ceiling.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Huge\"\n                      , Space\n                      , Str \"sea-wood\"\n                      , Space\n                      , Str \"fed\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"copper\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Burned\"\n                      , Space\n                      , Str \"green\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"orange,\"\n                      , Space\n                      , Str \"framed\"\n                      , Space\n                      , Str \"by\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"coloured\"\n                      , Space\n                      , Str \"stone,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"In\"\n                      , Space\n                      , Str \"which\"\n                      , Space\n                      , Str \"sad\"\n                      , Space\n                      , Str \"light\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"carved\"\n                      , Space\n                      , Str \"dolphin\"\n                      , Space\n                      , Str \"swam.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Above\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"antique\"\n                      , Space\n                      , Str \"mantel\"\n                      , Space\n                      , Str \"was\"\n                      , Space\n                      , Str \"displayed\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln98\" , [] , [] )\n                  [ Plain\n                      [ Str \"As\"\n                      , Space\n                      , Str \"though\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"window\"\n                      , Space\n                      , Str \"gave\"\n                      , Space\n                      , Str \"upon\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"sylvan\"\n                      , Space\n                      , Str \"scene\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"98.\" ]\n                                  ( \"#wasteland-content.xhtml_ln98\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Sylvan\"\n                              , Space\n                              , Str \"scene.\"\n                              , Space\n                              , Str \"V.\"\n                              , Space\n                              , Str \"Milton,\"\n                              , Space\n                              , Str \"Paradise\"\n                              , Space\n                              , Str \"Lost,\"\n                              , Space\n                              , Str \"iv.\"\n                              , Space\n                              , Str \"140.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln99\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"change\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"Philomel,\"\n                      , Space\n                      , Str \"by\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"barbarous\"\n                      , Space\n                      , Str \"king\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"99.\" ]\n                                  ( \"#wasteland-content.xhtml_ln99\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"V.\"\n                              , Space\n                              , Str \"Ovid,\"\n                              , Space\n                              , Str \"Metamorphoses,\"\n                              , Space\n                              , Str \"vi,\"\n                              , Space\n                              , Str \"Philomela.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln100\" , [] , [] )\n                  [ Plain\n                      [ Str \"So\"\n                      , Space\n                      , Str \"rudely\"\n                      , Space\n                      , Str \"forced;\"\n                      , Space\n                      , Str \"yet\"\n                      , Space\n                      , Str \"there\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"nightingale\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"100.\" ]\n                                  ( \"#wasteland-content.xhtml_ln100\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Part\"\n                              , Space\n                              , Str \"III,\"\n                              , Space\n                              , Str \"l.\"\n                              , Space\n                              , Str \"204.\"\n                              ]\n                          ]\n                      , SoftBreak\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"100\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Filled\"\n                      , Space\n                      , Str \"all\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"desert\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"inviolable\"\n                      , Space\n                      , Str \"voice\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"still\"\n                      , Space\n                      , Str \"she\"\n                      , Space\n                      , Str \"cried,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"still\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"world\"\n                      , Space\n                      , Str \"pursues,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"Jug\"\n                      , Space\n                      , Str \"Jug\\\"\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"dirty\"\n                      , Space\n                      , Str \"ears.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"other\"\n                      , Space\n                      , Str \"withered\"\n                      , Space\n                      , Str \"stumps\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"time\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Were\"\n                      , Space\n                      , Str \"told\"\n                      , Space\n                      , Str \"upon\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"walls;\"\n                      , Space\n                      , Str \"staring\"\n                      , Space\n                      , Str \"forms\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Leaned\"\n                      , Space\n                      , Str \"out,\"\n                      , Space\n                      , Str \"leaning,\"\n                      , Space\n                      , Str \"hushing\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"room\"\n                      , Space\n                      , Str \"enclosed.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Footsteps\"\n                      , Space\n                      , Str \"shuffled\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"stair.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Under\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"firelight,\"\n                      , Space\n                      , Str \"under\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"brush,\"\n                      , Space\n                      , Str \"her\"\n                      , Space\n                      , Str \"hair\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Spread\"\n                      , Space\n                      , Str \"out\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"fiery\"\n                      , Space\n                      , Str \"points\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Glowed\"\n                      , Space\n                      , Str \"into\"\n                      , Space\n                      , Str \"words,\"\n                      , Space\n                      , Str \"then\"\n                      , Space\n                      , Str \"would\"\n                      , Space\n                      , Str \"be\"\n                      , Space\n                      , Str \"savagely\"\n                      , Space\n                      , Str \"still.\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"110\" ]\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [ \"linegroup\" ] , [] )\n                  [ Div\n                      ( \"\" , [] , [] )\n                      [ Plain\n                          [ Str \"\\\"My\"\n                          , Space\n                          , Str \"nerves\"\n                          , Space\n                          , Str \"are\"\n                          , Space\n                          , Str \"bad\"\n                          , Space\n                          , Str \"to-night.\"\n                          , Space\n                          , Str \"Yes,\"\n                          , Space\n                          , Str \"bad.\"\n                          , Space\n                          , Str \"Stay\"\n                          , Space\n                          , Str \"with\"\n                          , Space\n                          , Str \"me.\"\n                          ]\n                      ]\n                  , Div\n                      ( \"\" , [] , [] )\n                      [ Plain\n                          [ Str \"\\\"Speak\"\n                          , Space\n                          , Str \"to\"\n                          , Space\n                          , Str \"me.\"\n                          , Space\n                          , Str \"Why\"\n                          , Space\n                          , Str \"do\"\n                          , Space\n                          , Str \"you\"\n                          , Space\n                          , Str \"never\"\n                          , Space\n                          , Str \"speak.\"\n                          , Space\n                          , Str \"Speak.\"\n                          ]\n                      ]\n                  , Div\n                      ( \"\" , [] , [] )\n                      [ Plain\n                          [ Str \"\\\"What\"\n                          , Space\n                          , Str \"are\"\n                          , Space\n                          , Str \"you\"\n                          , Space\n                          , Str \"thinking\"\n                          , Space\n                          , Str \"of?\"\n                          , Space\n                          , Str \"What\"\n                          , Space\n                          , Str \"thinking?\"\n                          , Space\n                          , Str \"What?\"\n                          ]\n                      ]\n                  , Div\n                      ( \"\" , [] , [] )\n                      [ Plain\n                          [ Str \"\\\"I\"\n                          , Space\n                          , Str \"never\"\n                          , Space\n                          , Str \"know\"\n                          , Space\n                          , Str \"what\"\n                          , Space\n                          , Str \"you\"\n                          , Space\n                          , Str \"are\"\n                          , Space\n                          , Str \"thinking.\"\n                          , Space\n                          , Str \"Think.\\\"\"\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [ \"linegroup\" ] , [] )\n                  [ Div\n                      ( \"wasteland-content.xhtml_ln115\" , [] , [] )\n                      [ Plain\n                          [ Str \"I\"\n                          , Space\n                          , Str \"think\"\n                          , Space\n                          , Str \"we\"\n                          , Space\n                          , Str \"are\"\n                          , Space\n                          , Str \"in\"\n                          , Space\n                          , Str \"rats'\"\n                          , Space\n                          , Str \"alley\"\n                          , Note\n                              [ Para\n                                  [ Link\n                                      ( \"\" , [] , [] )\n                                      [ Str \"115.\" ]\n                                      ( \"#wasteland-content.xhtml_ln115\"\n                                      , \"\"\n                                      )\n                                  , Space\n                                  , Str \"Cf.\"\n                                  , Space\n                                  , Str \"Part\"\n                                  , Space\n                                  , Str \"III,\"\n                                  , Space\n                                  , Str \"l.\"\n                                  , Space\n                                  , Str \"195.\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Div\n                      ( \"\" , [] , [] )\n                      [ Plain\n                          [ Str \"Where\"\n                          , Space\n                          , Str \"the\"\n                          , Space\n                          , Str \"dead\"\n                          , Space\n                          , Str \"men\"\n                          , Space\n                          , Str \"lost\"\n                          , Space\n                          , Str \"their\"\n                          , Space\n                          , Str \"bones.\"\n                          ]\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"What\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"noise?\\\"\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln118\"\n                  , [ \"indent\" ]\n                  , []\n                  )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"wind\"\n                      , Space\n                      , Str \"under\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"door.\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"118.\" ]\n                                  ( \"#wasteland-content.xhtml_ln118\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Webster:\"\n                              ]\n                          , BlockQuote\n                              [ Para\n                                  [ Str \"\\\"Is\"\n                                  , Space\n                                  , Str \"the\"\n                                  , Space\n                                  , Str \"wind\"\n                                  , Space\n                                  , Str \"in\"\n                                  , Space\n                                  , Str \"that\"\n                                  , Space\n                                  , Str \"door\"\n                                  , Space\n                                  , Str \"still?\\\"\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"What\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"noise\"\n                      , Space\n                      , Str \"now?\"\n                      , Space\n                      , Str \"What\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"wind\"\n                      , Space\n                      , Str \"doing?\\\"\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [ \"indent\" ] , [] )\n                  [ Plain\n                      [ Str \"Nothing\"\n                      , Space\n                      , Str \"again\"\n                      , Space\n                      , Str \"nothing.\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"120\" ]\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div ( \"\" , [] , [] ) [ Plain [ Str \"\\\"Do\" ] ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"You\"\n                      , Space\n                      , Str \"know\"\n                      , Space\n                      , Str \"nothing?\"\n                      , Space\n                      , Str \"Do\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"see\"\n                      , Space\n                      , Str \"nothing?\"\n                      , Space\n                      , Str \"Do\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"remember\"\n                      ]\n                  ]\n              , Div ( \"\" , [] , [] ) [ Plain [ Str \"\\\"Nothing?\\\"\" ] ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [] , [] )\n                  [ Plain [ Str \"I\" , Space , Str \"remember\" ] ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Those\"\n                      , Space\n                      , Str \"are\"\n                      , Space\n                      , Str \"pearls\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"were\"\n                      , Space\n                      , Str \"his\"\n                      , Space\n                      , Str \"eyes.\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln126\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"Are\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"alive,\"\n                      , Space\n                      , Str \"or\"\n                      , Space\n                      , Str \"not?\"\n                      , Space\n                      , Str \"Is\"\n                      , Space\n                      , Str \"there\"\n                      , Space\n                      , Str \"nothing\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"your\"\n                      , Space\n                      , Str \"head?\\\"\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"126.\" ]\n                                  ( \"#wasteland-content.xhtml_ln126\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"Part\"\n                              , Space\n                              , Str \"I,\"\n                              , Space\n                              , Str \"l.\"\n                              , Space\n                              , Str \"37,\"\n                              , Space\n                              , Str \"48.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              , Div ( \"\" , [] , [] ) [ Plain [ Str \"But\" ] ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"O\"\n                      , Space\n                      , Str \"O\"\n                      , Space\n                      , Str \"O\"\n                      , Space\n                      , Str \"O\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"Shakespeherian\"\n                      , Space\n                      , Str \"Rag\\8213\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"It's\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"elegant\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"So\"\n                      , Space\n                      , Str \"intelligent\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"130\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"What\"\n                      , Space\n                      , Str \"shall\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"do\"\n                      , Space\n                      , Str \"now?\"\n                      , Space\n                      , Str \"What\"\n                      , Space\n                      , Str \"shall\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"do?\\\"\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"shall\"\n                      , Space\n                      , Str \"rush\"\n                      , Space\n                      , Str \"out\"\n                      , Space\n                      , Str \"as\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"am,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"walk\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"street\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"With\"\n                      , Space\n                      , Str \"my\"\n                      , Space\n                      , Str \"hair\"\n                      , Space\n                      , Str \"down,\"\n                      , Space\n                      , Str \"so.\"\n                      , Space\n                      , Str \"What\"\n                      , Space\n                      , Str \"shall\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"do\"\n                      , Space\n                      , Str \"to-morrow?\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"\\\"What\"\n                      , Space\n                      , Str \"shall\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"ever\"\n                      , Space\n                      , Str \"do?\\\"\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"hot\"\n                      , Space\n                      , Str \"water\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"ten.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"if\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"rains,\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"closed\"\n                      , Space\n                      , Str \"car\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"four.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"we\"\n                      , Space\n                      , Str \"shall\"\n                      , Space\n                      , Str \"play\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"game\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"chess,\"\n                      ]\n                  ]\n              , Div\n                  ( \"wasteland-content.xhtml_ln138\" , [] , [] )\n                  [ Plain\n                      [ Str \"Pressing\"\n                      , Space\n                      , Str \"lidless\"\n                      , Space\n                      , Str \"eyes\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"waiting\"\n                      , Space\n                      , Str \"for\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"knock\"\n                      , Space\n                      , Str \"upon\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"door.\"\n                      , Note\n                          [ Para\n                              [ Link\n                                  ( \"\" , [] , [] )\n                                  [ Str \"138.\" ]\n                                  ( \"#wasteland-content.xhtml_ln138\"\n                                  , \"\"\n                                  )\n                              , Space\n                              , Str \"Cf.\"\n                              , Space\n                              , Str \"the\"\n                              , Space\n                              , Str \"game\"\n                              , Space\n                              , Str \"of\"\n                              , Space\n                              , Str \"chess\"\n                              , Space\n                              , Str \"in\"\n                              , Space\n                              , Str \"Middleton's\"\n                              , Space\n                              , Str \"Women\"\n                              , Space\n                              , Str \"beware\"\n                              , Space\n                              , Str \"Women.\"\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"linegroup\" ] , [] )\n              [ Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"When\"\n                      , Space\n                      , Str \"Lil's\"\n                      , Space\n                      , Str \"husband\"\n                      , Space\n                      , Str \"got\"\n                      , Space\n                      , Str \"demobbed,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said\"\n                      , Space\n                      , Str \"-\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"didn't\"\n                      , Space\n                      , Str \"mince\"\n                      , Space\n                      , Str \"my\"\n                      , Space\n                      , Str \"words,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"her\"\n                      , Space\n                      , Str \"myself,\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"140\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"HURRY\"\n                      , Space\n                      , Str \"UP\"\n                      , Space\n                      , Str \"PLEASE\"\n                      , Space\n                      , Str \"ITS\"\n                      , Space\n                      , Str \"TIME\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Now\"\n                      , Space\n                      , Str \"Albert's\"\n                      , Space\n                      , Str \"coming\"\n                      , Space\n                      , Str \"back,\"\n                      , Space\n                      , Str \"make\"\n                      , Space\n                      , Str \"yourself\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"bit\"\n                      , Space\n                      , Str \"smart.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"He'll\"\n                      , Space\n                      , Str \"want\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"know\"\n                      , Space\n                      , Str \"what\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"done\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"money\"\n                      , Space\n                      , Str \"he\"\n                      , Space\n                      , Str \"gave\"\n                      , SoftBreak\n                      , Str \"you\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"To\"\n                      , Space\n                      , Str \"get\"\n                      , Space\n                      , Str \"yourself\"\n                      , Space\n                      , Str \"some\"\n                      , Space\n                      , Str \"teeth.\"\n                      , Space\n                      , Str \"He\"\n                      , Space\n                      , Str \"did,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"was\"\n                      , Space\n                      , Str \"there.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"You\"\n                      , Space\n                      , Str \"have\"\n                      , Space\n                      , Str \"them\"\n                      , Space\n                      , Str \"all\"\n                      , Space\n                      , Str \"out,\"\n                      , Space\n                      , Str \"Lil,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"get\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"nice\"\n                      , Space\n                      , Str \"set,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"He\"\n                      , Space\n                      , Str \"said,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"swear,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"can't\"\n                      , Space\n                      , Str \"bear\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"look\"\n                      , Space\n                      , Str \"at\"\n                      , Space\n                      , Str \"you.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"no\"\n                      , Space\n                      , Str \"more\"\n                      , Space\n                      , Str \"can't\"\n                      , Space\n                      , Str \"I,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"think\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"poor\"\n                      , Space\n                      , Str \"Albert,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"He's\"\n                      , Space\n                      , Str \"been\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"army\"\n                      , Space\n                      , Str \"four\"\n                      , Space\n                      , Str \"years,\"\n                      , Space\n                      , Str \"he\"\n                      , Space\n                      , Str \"wants\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"good\"\n                      , Space\n                      , Str \"time,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"if\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"don't\"\n                      , Space\n                      , Str \"give\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"him,\"\n                      , Space\n                      , Str \"there's\"\n                      , Space\n                      , Str \"others\"\n                      , Space\n                      , Str \"will,\"\n                      , Space\n                      , Str \"I\"\n                      , SoftBreak\n                      , Str \"said.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Oh\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"there,\"\n                      , Space\n                      , Str \"she\"\n                      , Space\n                      , Str \"said.\"\n                      , Space\n                      , Str \"Something\"\n                      , Space\n                      , Str \"o'\"\n                      , Space\n                      , Str \"that,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said.\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"150\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Then\"\n                      , Space\n                      , Str \"I'll\"\n                      , Space\n                      , Str \"know\"\n                      , Space\n                      , Str \"who\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"thank,\"\n                      , Space\n                      , Str \"she\"\n                      , Space\n                      , Str \"said,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"give\"\n                      , Space\n                      , Str \"me\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"straight\"\n                      , SoftBreak\n                      , Str \"look.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"HURRY\"\n                      , Space\n                      , Str \"UP\"\n                      , Space\n                      , Str \"PLEASE\"\n                      , Space\n                      , Str \"ITS\"\n                      , Space\n                      , Str \"TIME\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"If\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"don't\"\n                      , Space\n                      , Str \"like\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"can\"\n                      , Space\n                      , Str \"get\"\n                      , Space\n                      , Str \"on\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"it,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Others\"\n                      , Space\n                      , Str \"can\"\n                      , Space\n                      , Str \"pick\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"choose\"\n                      , Space\n                      , Str \"if\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"can't.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"But\"\n                      , Space\n                      , Str \"if\"\n                      , Space\n                      , Str \"Albert\"\n                      , Space\n                      , Str \"makes\"\n                      , Space\n                      , Str \"off,\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"won't\"\n                      , Space\n                      , Str \"be\"\n                      , Space\n                      , Str \"for\"\n                      , Space\n                      , Str \"lack\"\n                      , Space\n                      , Str \"of\"\n                      , SoftBreak\n                      , Str \"telling.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"You\"\n                      , Space\n                      , Str \"ought\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"be\"\n                      , Space\n                      , Str \"ashamed,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said,\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"look\"\n                      , Space\n                      , Str \"so\"\n                      , Space\n                      , Str \"antique.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"(And\"\n                      , Space\n                      , Str \"her\"\n                      , Space\n                      , Str \"only\"\n                      , Space\n                      , Str \"thirty-one.)\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"can't\"\n                      , Space\n                      , Str \"help\"\n                      , Space\n                      , Str \"it,\"\n                      , Space\n                      , Str \"she\"\n                      , Space\n                      , Str \"said,\"\n                      , Space\n                      , Str \"pulling\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"long\"\n                      , Space\n                      , Str \"face,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"It's\"\n                      , Space\n                      , Str \"them\"\n                      , Space\n                      , Str \"pills\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"took,\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"bring\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"off,\"\n                      , Space\n                      , Str \"she\"\n                      , Space\n                      , Str \"said.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"(She's\"\n                      , Space\n                      , Str \"had\"\n                      , Space\n                      , Str \"five\"\n                      , Space\n                      , Str \"already,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"nearly\"\n                      , Space\n                      , Str \"died\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"young\"\n                      , Space\n                      , Str \"George.)\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"160\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"The\"\n                      , Space\n                      , Str \"chemist\"\n                      , Space\n                      , Str \"said\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"would\"\n                      , Space\n                      , Str \"be\"\n                      , Space\n                      , Str \"all\"\n                      , Space\n                      , Str \"right,\"\n                      , Space\n                      , Str \"but\"\n                      , Space\n                      , Str \"I've\"\n                      , Space\n                      , Str \"never\"\n                      , Space\n                      , Str \"been\"\n                      , Space\n                      , Str \"the\"\n                      , SoftBreak\n                      , Str \"same.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"You\"\n                      , Space\n                      , Emph [ Str \"are\" ]\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"proper\"\n                      , Space\n                      , Str \"fool,\"\n                      , Space\n                      , Str \"I\"\n                      , Space\n                      , Str \"said.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Well,\"\n                      , Space\n                      , Str \"if\"\n                      , Space\n                      , Str \"Albert\"\n                      , Space\n                      , Str \"won't\"\n                      , Space\n                      , Str \"leave\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"alone,\"\n                      , Space\n                      , Str \"there\"\n                      , Space\n                      , Str \"it\"\n                      , Space\n                      , Str \"is,\"\n                      , Space\n                      , Str \"I\"\n                      , SoftBreak\n                      , Str \"said,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"What\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"get\"\n                      , Space\n                      , Str \"married\"\n                      , Space\n                      , Str \"for\"\n                      , Space\n                      , Str \"if\"\n                      , Space\n                      , Str \"you\"\n                      , Space\n                      , Str \"don't\"\n                      , Space\n                      , Str \"want\"\n                      , Space\n                      , Str \"children?\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"HURRY\"\n                      , Space\n                      , Str \"UP\"\n                      , Space\n                      , Str \"PLEASE\"\n                      , Space\n                      , Str \"ITS\"\n                      , Space\n                      , Str \"TIME\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Well,\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"Sunday\"\n                      , Space\n                      , Str \"Albert\"\n                      , Space\n                      , Str \"was\"\n                      , Space\n                      , Str \"home,\"\n                      , Space\n                      , Str \"they\"\n                      , Space\n                      , Str \"had\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"hot\"\n                      , SoftBreak\n                      , Str \"gammon,\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"they\"\n                      , Space\n                      , Str \"asked\"\n                      , Space\n                      , Str \"me\"\n                      , Space\n                      , Str \"in\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"dinner,\"\n                      , Space\n                      , Str \"to\"\n                      , Space\n                      , Str \"get\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"beauty\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"it\"\n                      , SoftBreak\n                      , Str \"hot\\8213\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"HURRY\"\n                      , Space\n                      , Str \"UP\"\n                      , Space\n                      , Str \"PLEASE\"\n                      , Space\n                      , Str \"ITS\"\n                      , Space\n                      , Str \"TIME\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"HURRY\"\n                      , Space\n                      , Str \"UP\"\n                      , Space\n                      , Str \"PLEASE\"\n                      , Space\n                      , Str \"ITS\"\n                      , Space\n                      , Str \"TIME\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Goonight\"\n                      , Space\n                      , Str \"Bill.\"\n                      , Space\n                      , Str \"Goonight\"\n                      , Space\n                      , Str \"Lou.\"\n                      , Space\n                      , Str \"Goonight\"\n                      , Space\n                      , Str \"May.\"\n                      , Space\n                      , Str \"Goonight.\"\n                      , Span ( \"\" , [ \"lnum\" ] , [] ) [ Str \"170\" ]\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Ta\"\n                      , Space\n                      , Str \"ta.\"\n                      , Space\n                      , Str \"Goonight.\"\n                      , Space\n                      , Str \"Goonight.\"\n                      ]\n                  ]\n              , Div\n                  ( \"\" , [] , [] )\n                  [ Plain\n                      [ Str \"Good\"\n                      , Space\n                      , Str \"night,\"\n                      , Space\n                      , Str \"ladies,\"\n                      , Space\n                      , Str \"good\"\n                      , Space\n                      , Str \"night,\"\n                      , Space\n                      , Str \"sweet\"\n                      , Space\n                      , Str \"ladies,\"\n                      , Space\n                      , Str \"good\"\n                      , Space\n                      , Str \"night,\"\n                      , Space\n                      , Str \"good\"\n                      , SoftBreak\n                      , Str \"night.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n  , Div\n      ( \"wasteland-content.xhtml_backmatter\"\n      , [ \"section\" , \"backmatter\" ]\n      , []\n      )\n      [ Div\n          ( \"wasteland-content.xhtml_rearnotes\"\n          , [ \"rearnotes\" ]\n          , []\n          )\n          [ Header\n              2\n              ( \"\" , [] , [] )\n              [ Str \"NOTES\"\n              , Space\n              , Str \"ON\"\n              , Space\n              , Str \"\\\"THE\"\n              , Space\n              , Str \"WASTE\"\n              , Space\n              , Str \"LAND\\\"\"\n              ]\n          , Para\n              [ Str \"Not\"\n              , Space\n              , Str \"only\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"title,\"\n              , Space\n              , Str \"but\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"plan\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"good\"\n              , Space\n              , Str \"deal\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"incidental\"\n              , Space\n              , Str \"symbolism\"\n              , Space\n              , Str \"of\"\n              , SoftBreak\n              , Str \"the\"\n              , Space\n              , Str \"poem\"\n              , Space\n              , Str \"were\"\n              , Space\n              , Str \"suggested\"\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"Miss\"\n              , Space\n              , Str \"Jessie\"\n              , Space\n              , Str \"L.\"\n              , Space\n              , Str \"Weston's\"\n              , Space\n              , Str \"book\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"Grail\"\n              , Space\n              , Str \"legend:\"\n              , SoftBreak\n              , Str \"From\"\n              , Space\n              , Str \"Ritual\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"Romance\"\n              ]\n          , Para\n              [ Str \"Indeed,\"\n              , Space\n              , Str \"so\"\n              , Space\n              , Str \"deeply\"\n              , Space\n              , Str \"am\"\n              , Space\n              , Str \"I\"\n              , Space\n              , Str \"indebted,\"\n              , Space\n              , Str \"Miss\"\n              , Space\n              , Str \"Weston's\"\n              , Space\n              , Str \"book\"\n              , Space\n              , Str \"will\"\n              , Space\n              , Str \"elucidate\"\n              , Space\n              , Str \"the\"\n              , SoftBreak\n              , Str \"difficulties\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"poem\"\n              , Space\n              , Str \"much\"\n              , Space\n              , Str \"better\"\n              , Space\n              , Str \"than\"\n              , Space\n              , Str \"my\"\n              , Space\n              , Str \"notes\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"do;\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"I\"\n              , Space\n              , Str \"recommend\"\n              , Space\n              , Str \"it\"\n              , SoftBreak\n              , Str \"(apart\"\n              , Space\n              , Str \"from\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"great\"\n              , Space\n              , Str \"interest\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"book\"\n              , Space\n              , Str \"itself)\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"any\"\n              , Space\n              , Str \"who\"\n              , Space\n              , Str \"think\"\n              , Space\n              , Str \"such\"\n              , SoftBreak\n              , Str \"elucidation\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"poem\"\n              , Space\n              , Str \"worth\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"trouble.\"\n              , Space\n              , Str \"To\"\n              , Space\n              , Str \"another\"\n              , Space\n              , Str \"work\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"anthropology\"\n              , Space\n              , Str \"I\"\n              , Space\n              , Str \"am\"\n              , SoftBreak\n              , Str \"indebted\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"general,\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"which\"\n              , Space\n              , Str \"has\"\n              , Space\n              , Str \"influenced\"\n              , Space\n              , Str \"our\"\n              , Space\n              , Str \"generation\"\n              , Space\n              , Str \"profoundly;\"\n              , Space\n              , Str \"I\"\n              , Space\n              , Str \"mean\"\n              , SoftBreak\n              , Str \"The\"\n              , Space\n              , Str \"Golden\"\n              , Space\n              , Str \"Bough;\"\n              , Space\n              , Str \"I\"\n              , Space\n              , Str \"have\"\n              , Space\n              , Str \"used\"\n              , Space\n              , Str \"especially\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"two\"\n              , Space\n              , Str \"volumes\"\n              , Space\n              , Str \"Adonis,\"\n              , Space\n              , Str \"Attis,\"\n              , Space\n              , Str \"Osiris.\"\n              , SoftBreak\n              , Str \"Anyone\"\n              , Space\n              , Str \"who\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"acquainted\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"these\"\n              , Space\n              , Str \"works\"\n              , Space\n              , Str \"will\"\n              , Space\n              , Str \"immediately\"\n              , Space\n              , Str \"recognise\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"poem\"\n              , SoftBreak\n              , Str \"certain\"\n              , Space\n              , Str \"references\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"vegetation\"\n              , Space\n              , Str \"ceremonies.\"\n              ]\n          , Div\n              ( \"\" , [ \"section\" ] , [] )\n              [ Header\n                  3\n                  ( \"\" , [] , [] )\n                  [ Str \"I.\"\n                  , Space\n                  , Str \"THE\"\n                  , Space\n                  , Str \"BURIAL\"\n                  , Space\n                  , Str \"OF\"\n                  , Space\n                  , Str \"THE\"\n                  , Space\n                  , Str \"DEAD\"\n                  ]\n              ]\n          , Div\n              ( \"\" , [ \"section\" ] , [] )\n              [ Header\n                  3\n                  ( \"\" , [] , [] )\n                  [ Str \"II.\"\n                  , Space\n                  , Str \"A\"\n                  , Space\n                  , Str \"GAME\"\n                  , Space\n                  , Str \"OF\"\n                  , Space\n                  , Str \"CHESS\"\n                  ]\n              ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/fb2/basic.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n<description>\n<title-info>\n<genre>unrecognised</genre>\n</title-info>\n<document-info>\n<program-used>pandoc</program-used>\n</document-info>\n</description>\n<body>\n<title>\n<p />\n</title>\n<section id=\"top-level-title\">\n<title>\n<p>Top-level title</p>\n</title>\n<section id=\"section\">\n<title>\n<p>Section</p>\n</title>\n<section id=\"subsection\">\n<title>\n<p>Subsection</p>\n</title>\n<p>This <emphasis>emphasized</emphasis> <strong>strong</strong> <code>verbatim</code> markdown.\nSee this <a l:href=\"http://example.com/\">link</a>.</p>\n<p>Ordered list:</p>\n<p>1. one</p>\n<p>2. two</p>\n<p>3. three</p>\n<cite>\n<p>Blockquote\nis\nfor\ncitatons.</p>\n</cite>\n<empty-line />\n<p>\n<code>Code</code>\n</p>\n<p>\n<code>block</code>\n</p>\n<p>\n<code>is</code>\n</p>\n<p>\n<code>for</code>\n</p>\n<p>\n<code>code.</code>\n</p>\n<empty-line />\n<p>\n<strikethrough>Strikeout</strikethrough> is Pandoc’s extension.\nSuperscript and subscripts too: H<sub>2</sub>O is a liquid<a l:href=\"#n1\" type=\"note\">[1]</a>.\n2<sup>10</sup> is 1024.</p>\n<p>Math is another Pandoc extension: <code>E = m c^2</code>.</p>\n</section>\n</section>\n</section>\n</body>\n<body name=\"notes\">\n<section id=\"n1\">\n<title>\n<p>1</p>\n</title>\n<p>Sometimes.</p>\n</section>\n</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/basic.markdown",
    "content": "# Top-level title\n\n## Section\n\n### Subsection\n\nThis *emphasized* **strong** `verbatim` markdown.\nSee this [link](http://example.com/).\n\nOrdered list:\n\n  1. one\n  1. two\n  1. three\n\n> Blockquote\n> is\n> for\n> citatons.\n\n    Code\n    block\n    is\n    for\n    code.\n\n~~Strikeout~~ is Pandoc's extension.\nSuperscript and subscripts too: H~2~O is a liquid[^1].\n2^10^ is 1024.\n\nMath is another Pandoc extension: $E = m c^2$.\n\n[^1]: Sometimes.\n"
  },
  {
    "path": "test/fb2/images-embedded.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section><image l:href=\"#image1\" l:type=\"imageType\" alt=\"This image was embedded using data URI scheme\" /><p>This image was embedded using data URI scheme</p></section></body><binary id=\"image1\" content-type=\"image/png\">iVBORw0KGgoAAAANSUhEUgAAADAAAAAgCAIAAADbtmxLAAABmGlDQ1BpY2MAAHjapdG/axMBGMbxTy4tldJSwSAiHW4ootKCqIOrVShIkRIrJNUluUvaQi4Nd1dEXAQHF4cOXVRcLOLirJv4BygIggqCi7sUBRcpcbiDgtBBfOGF5/315eV9qR7qRUk2EpL087S+MB82mivh2BeBcUcddrwVZYOLS0uLDrRfH1Xgw1wvSjL/ZpNxJ4uohFiKBmlOZYC7t/JBTmUXtWitFROMYDZtNFcIzqDWLvRl1FYL3UAtXa5fIughXC30A4TtQr9AGK2lCcFbzMRJPybYxWScxDFVGE16m1G5ZwUTnf71aziPaXUsYB4h2tjEOnrIMVfG/QJyAC/GtKvYKFlRqQe4jbTkrGKtZM+WvZvI0CnjbtnfKb1XMtBoroR//yzrnjtbbDRxhdFvw+HP04w9Zu/+cPj76XC4t0P1M2+29+c3trnwnerWfm7mCVP3ePl6P9d+xqstjn0dtNIWitMG3S4/njPZ5Mh7xm/8b734Z1m384nlOyy+4+EjTnSZunkyzsP1ft5J+63eKWT1hXn4AzDofghlJQBJAAAACXBIWXMAAAsSAAALEgHS3X78AAACInpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjahVRJtiQhCNx7ijpCMIhyHNPU9/oGffxeaNY3p/5VC5IAQkAhtL9/evh8Pp+PiwaNKZubAYDuugNcMH4ZIAN6A6ATo68kdAA8VQ1DkoEIq2EILiBiALIQDTISWvz3SSQNJHwnilWTGgC/ZMSa1Fc8TDznZH4rgWOtRrwQKGh8VyNZ8bAY9Ccj1EGXUI0JwNE3n3itxrzis7Sq1TgBiNMwesKo1TjfcdZqXBaiWRpLrcbbEjBLU63G9QGv1bit+CSKWi2W8+3QLDluF/wIBgBEaNQWNSjFzHj7/zgOP92EBap3v2BqlNi2pEbGVi0yBNwkcRPiTVxIJDVLRgJxEXGLRgAgLBASkiIIwlIEYgyBJCnC4lKExN6yGSW6SD961nvvQaxhBZq4rbptbX1HlJPSokN37t9m9957a5utDux7Xwk06WnWWOJ2yqgkPqW4e2urnmNPK0HMtq0Hkkc7ZbSXUleHiNMIoGy7r/ppEwAIV+Amv1rS/3ghgCz23ns+m/HrASdJMWT2chsBiS2z73fcLGd+3E8hZ05nQ81zzOW2n8Saj1VzwTMHZ+g6xcPg5ozLASM7Z/hl9kaPnPFQmrcyvm8lFKbrAQwAoegtYFy34rEXRSFP/qEo4tmQ0wywlwPyG5G/BJQXvF5wOR4k7m9HjlupR/y6Mp42RjhWxm+Oh99BvMrwD3UCiGvkpxuRAAAACXZwQWcAAAAwAAAAIACELJ4GAAALGklEQVRYw11YW48dV1b+1tq7qs6t+/TldPsSx3bbcRwncWY0A4LMCOYFXpgHJCR4QvwAnpAQj/wB/gR/ACR4QUKDECMUEjLOZew4zsRxuu122+52n9Pnfuqy9/p4qNNtD1tLpVKpap/vrMu31rdl/nAgIjSpF0kAJAEHGJwAAIQheqeARVqomCQZGUkjSYLmTAyAkCJiESRVNYQAaL3h8k3SzPj6MjEzsr7SqyoAcRABQItRVZ14kqifmNEkTZNiUZiZ934xm4WE3mva8GYGAA5UJ8YYIyCipiKk1ZuTBAhQBGZQFRKvTAgBaQBIeOekBqpa+0gBxFgAlmhqhixJzUKMRVEUx/3RWmel3z9xzrVX2+tuRb3WnrDKVFUEgKlCVWI055WMZ76AieipX0AYzYwQUZqZqJD0tKCqFJAxhKiqSZKooirj06fPMt/odlezhngFYar+0e7jxWLR6/Vc7ubzpNnM4BlDSDLvvQ8hnAYFIlCFRUDEjASgIGFGEcBIoSrMCFAVhgiKTxJPkgJVSeBBhKqaTCb5Ip4cD/efPP/g9q2soSvdTp7nAuv2Vk/2BoHFyWgRYxVjbDezRiMDMicNxqCqqhIZVZxZVK3zaRkgXYaMdeDMoMoapSpo8GSE1t6ihaCqPs3WV/VwPpxOp8fHRw++cUmq7XYzSbLV1W5vu3fw7Emn0xwcD+ZzF8vKQtlI09R7J6SXOldgEDEwAmdguMyYV/lEVWEkARExEkoVBxHWxeUSFefK6fTJ48dlme/sXN7a3vjVnf8NIQ6Hk1ajOZ+Nf/3ZZ9Uij0V+fedqM0v2nz5ut7LtCz1GC2WVJqmry1KgZKLqlbo0qLPanJrAVKgSRX/LPElxQF0smiDy6Ojo7pd3qXLjxo2r1y8fnwxORpN8Nt/u9fLF5OTFcRVKDWE0HJZF2O71IsOzZ0+e7D3tdDo7168miU9SJ6IhBIGD2KuKMpHaPwoFXkXq9Aak+/u//TsFRCEgEAljjFtbW+UiHPb765sbJ8M+Y9HtdAbDgWs0pSge7O1u9Tar+Xwwmy0m03I0XpgbjydZlk2n43armaVOJIqQDEIIIKBABK/iBYuAnT4HwJrx1CkhRosAIRBBo93ImunO25dv/eBmb231+rUrRTH/we1ba+udhw/uSoZGOzt38Vx/1D85folYLhazqpg3mj5ruNWVTqPhxcEsAOa8ihJiAhMEQVChCgXmhKcWT41O6IGq5kCjqPOTk9F4PF7rrlvKRtQHjx/d2Lk+mgy+evrwhzs3Xuzv0tmbb5z79LNPzm9utdorEoNkzPPx+x+812o10tR7DyCqUwCMQUUIUqm2JOolbb/GjmbwoDGS9GZBnYM4IS0E5+TChS1Nk7Z28uPhW29euvPRf2fN1pdffNE1vXnzxsGgf/B036duvbce5tXG2uZkfnL79q3t8+sA4Rws0CJIAOI8LADUusLqeC0rTl4RJgyg1Fe+fB7yUrxTQoRWVoExbWTjl6P5fD7dO6yIF4P+bDK/92T3hzffLWGffPq5c7K1uf7hj3+PrLqbqxffuDQc9VdWVtY31846l1CFqJlalk8gr/UxAIzLLrZkbVK5WHgHhFIYmS+K6ZhFkY/Hi/5gPOhLUzvnu73L59KVxjyffXH314vFIsbYaTXeuXFtcHx4sPd9S+3l84PMwTsyBrMgQhUIgrEUREWUU4O8uhcLdW45BsWpiVRgoSyYTxYn/ee7e9/f/2Z8eOwYm8pko4EktDvpzOZXL5z3Dd3b2/vi/r1G0795cat//GxrvWPTaW+lvdVdXUkTCaVagAUrF6wKVSAGxIAQJEZYiVjSSrBSq4SVWCFWKINYpQzK4FHmhqjOgbF/+Hx0dJyXtv/46ZuXtrrd1V6ruRhNJqPZlfbq5999/Dt/+LNf/tf/nEyH585t73338OrVS3E8Pnl+MJnOi7i4fG1no7cJ79Sh7vPISwCwZYCERN3TjQCFZFxGE3FJV97iXCGIKBZlcyV799zbIdhsNnvyaP/x3r6Z+Tx02i6Kv/7WO8bFX/3ZT37xyZ2yf9Ta2n73vZ1vf/Xlv338+R/97MOVjc63X99fbXduvfuONBJTAlDxiBGAWKQZSVn2BZ4lDYwAlDQzkF7LEmYQyUSTdkvTzNuiZLz25vlOt3N0cPTwxcH7W2/9+NbN0Uef3Pvs6w/+9KcraePb3+z+6NKF+cHLvvN/89d/2SQsTSdr3clwMh0M1nvr0ki4yI0iQgBSu8dYOwxm4BIEyTrTEY1mHrNpZD3KiMIhlLEokljKWueyytsX3ji/2rqzuzt4Obh95eLd3+ztf7Xv1e2sp8OXw73h8Od//FNNtIh5Rqx322tZWoWimo1c7hQi4mgBxtPpA3VBkXQ0M8BOh5VoS3D8j3+CACqsR4EYzUyIalqaCqCxyIsB/uFf//lPfv93R/2jf/z4m0Zmf/6j977af/wXH/7B6ubK+dVV2+g6D0Yzg4OoA0kRrYoiEXcarFfzq7IueJKsYZktAXl7MRURiARakiQ08xAACHCGybj/i3v3ZoNyDa3/vPPg59cuf/fi4GKjPRmH99cuHT5+Ouv3ipV5b2ve2lxRdfPJLMa4ttKxEEl68ZH52bh4xkDhbLI2OYNiBpL+cHfmnKvfq2nf+eWXi2L+6PgQh42nk+GVc1uf7h9+f1T8ZOftXz76flu7L07Gs7FttCYvknH74PiDt24kjWa/PyvLElupJ2OMZFXBROS3hnoz8sxBS9+YYemhrw9L55xCFCYSalgR7Ehy/+DFnChC0kq3m37j9nr2L7uPnrw8UBb//t2emGsnybW8OW9M3uhc+fbprNWW0Qwh6MwKAQGEEIhlpccYSVLl/wkPM4unqEj6+7MyUZeIpj6pRxOJjDGO5qNpbNLsWTiSyt/dex5mR1Ui+9Phxe72w+moI1mmViSbG7xQNNpHlrhKBnkkcbIwi5WZGegpgMYYq6oCoKoiamZAfB1TWCoq+o/2DxzEiU/TNHXeBCGEqqqKGKGIDPOFTedDY8x8M5HEIRlXi5D7TtrsVpv5cDbZyB69eL7a6IjIfD6NNBHJy1A3tcRJCOV4Nmq1OiqZUgFznonzZVWIECoqXjWpijJGevVipFkZqipYKt6JE1XXjj5tJHk+n41jptrtrifqptNpq9WaTMcqyXon9VlqxHgyi5GjWa6qeZ5DJcsyM6OomVm04WQwnY3XIGkCQGEhzktjORoN8yp3zqVpI0lSUNXB59OhiChE1RdaSK0XSTNqoSSbmQe8F8Bi4jRN00WRr3TY7jSzJAEAQZIkCBUQo1aqmtSTHmJkrGApQtu7lodKKXDQGCyaaJo4mgeAEEPM667sd59/dyoQpUYDUQBCpZiqqmrNIgCEIKlgWS1OTl4OYl9gRoo40VgrRhGpP0G9qMZgFieTKgaKOFXQgolaCE7MBOrgnEO0aKWfLI7rWRaAnC4ATv3ZpiLiVQFYoCmzLAuhHI5eMsInIBkNUXTZUAERAVlvFSrziZoZFxOaaK3HAJOw1K9ArQXKMl/MJ7Ld6Z0l/1m86qMCGEXEe7+EW0+g4iFljCHxLQGcWq0NUp/Ur52K+Vc3ohrrFrs8PzhlJgBiKt7MYoxVKIpiIRudtdc9QSxheTPnHIAYCaNzTlXNzKg+YWRQpgKQRjGIB8Pyb0BJnv1ikFoYOwBEBKAEqFQlaRalFtqkc440n3IZrNp7Z4LExMpgy4SAVBaFVp9zhBCIaBQnDqhPSQgKIAJPksal+AG8ogpRnQCIUVRFoSEE9QIaLNCpqiPFQUK0/wPxadi/ncvxsAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMS0wMi0yOFQwMjo1NTowMiswMTowMGbLlncAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTEtMDItMjhUMDI6NTU6MDIrMDE6MDAXli7LAAAAEXRFWHRqcGVnOmNvbG9yc3BhY2UAMix1VZ8AAAAgdEVYdGpwZWc6c2FtcGxpbmctZmFjdG9yADF4MSwxeDEsMXgx6ZX8cAAAAABJRU5ErkJggg==</binary></FictionBook>\n"
  },
  {
    "path": "test/fb2/images-embedded.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <title></title>\n</head>\n<body>\n<div class=\"figure\">\n<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAgCAIAAADbtmxLAAABmGlDQ1BpY2MAAHjapdG/axMBGMbxTy4tldJSwSAiHW4ootKCqIOrVShIkRIrJNUluUvaQi4Nd1dEXAQHF4cOXVRcLOLirJv4BygIggqCi7sUBRcpcbiDgtBBfOGF5/315eV9qR7qRUk2EpL087S+MB82mivh2BeBcUcddrwVZYOLS0uLDrRfH1Xgw1wvSjL/ZpNxJ4uohFiKBmlOZYC7t/JBTmUXtWitFROMYDZtNFcIzqDWLvRl1FYL3UAtXa5fIughXC30A4TtQr9AGK2lCcFbzMRJPybYxWScxDFVGE16m1G5ZwUTnf71aziPaXUsYB4h2tjEOnrIMVfG/QJyAC/GtKvYKFlRqQe4jbTkrGKtZM+WvZvI0CnjbtnfKb1XMtBoroR//yzrnjtbbDRxhdFvw+HP04w9Zu/+cPj76XC4t0P1M2+29+c3trnwnerWfm7mCVP3ePl6P9d+xqstjn0dtNIWitMG3S4/njPZ5Mh7xm/8b734Z1m384nlOyy+4+EjTnSZunkyzsP1ft5J+63eKWT1hXn4AzDofghlJQBJAAAACXBIWXMAAAsSAAALEgHS3X78AAACInpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjahVRJtiQhCNx7ijpCMIhyHNPU9/oGffxeaNY3p/5VC5IAQkAhtL9/evh8Pp+PiwaNKZubAYDuugNcMH4ZIAN6A6ATo68kdAA8VQ1DkoEIq2EILiBiALIQDTISWvz3SSQNJHwnilWTGgC/ZMSa1Fc8TDznZH4rgWOtRrwQKGh8VyNZ8bAY9Ccj1EGXUI0JwNE3n3itxrzis7Sq1TgBiNMwesKo1TjfcdZqXBaiWRpLrcbbEjBLU63G9QGv1bit+CSKWi2W8+3QLDluF/wIBgBEaNQWNSjFzHj7/zgOP92EBap3v2BqlNi2pEbGVi0yBNwkcRPiTVxIJDVLRgJxEXGLRgAgLBASkiIIwlIEYgyBJCnC4lKExN6yGSW6SD961nvvQaxhBZq4rbptbX1HlJPSokN37t9m9957a5utDux7Xwk06WnWWOJ2yqgkPqW4e2urnmNPK0HMtq0Hkkc7ZbSXUleHiNMIoGy7r/ppEwAIV+Amv1rS/3ghgCz23ns+m/HrASdJMWT2chsBiS2z73fcLGd+3E8hZ05nQ81zzOW2n8Saj1VzwTMHZ+g6xcPg5ozLASM7Z/hl9kaPnPFQmrcyvm8lFKbrAQwAoegtYFy34rEXRSFP/qEo4tmQ0wywlwPyG5G/BJQXvF5wOR4k7m9HjlupR/y6Mp42RjhWxm+Oh99BvMrwD3UCiGvkpxuRAAAACXZwQWcAAAAwAAAAIACELJ4GAAALGklEQVRYw11YW48dV1b+1tq7qs6t+/TldPsSx3bbcRwncWY0A4LMCOYFXpgHJCR4QvwAnpAQj/wB/gR/ACR4QUKDECMUEjLOZew4zsRxuu122+52n9Pnfuqy9/p4qNNtD1tLpVKpap/vrMu31rdl/nAgIjSpF0kAJAEHGJwAAIQheqeARVqomCQZGUkjSYLmTAyAkCJiESRVNYQAaL3h8k3SzPj6MjEzsr7SqyoAcRABQItRVZ14kqifmNEkTZNiUZiZ934xm4WE3mva8GYGAA5UJ8YYIyCipiKk1ZuTBAhQBGZQFRKvTAgBaQBIeOekBqpa+0gBxFgAlmhqhixJzUKMRVEUx/3RWmel3z9xzrVX2+tuRb3WnrDKVFUEgKlCVWI055WMZ76AieipX0AYzYwQUZqZqJD0tKCqFJAxhKiqSZKooirj06fPMt/odlezhngFYar+0e7jxWLR6/Vc7ubzpNnM4BlDSDLvvQ8hnAYFIlCFRUDEjASgIGFGEcBIoSrMCFAVhgiKTxJPkgJVSeBBhKqaTCb5Ip4cD/efPP/g9q2soSvdTp7nAuv2Vk/2BoHFyWgRYxVjbDezRiMDMicNxqCqqhIZVZxZVK3zaRkgXYaMdeDMoMoapSpo8GSE1t6ihaCqPs3WV/VwPpxOp8fHRw++cUmq7XYzSbLV1W5vu3fw7Emn0xwcD+ZzF8vKQtlI09R7J6SXOldgEDEwAmdguMyYV/lEVWEkARExEkoVBxHWxeUSFefK6fTJ48dlme/sXN7a3vjVnf8NIQ6Hk1ajOZ+Nf/3ZZ9Uij0V+fedqM0v2nz5ut7LtCz1GC2WVJqmry1KgZKLqlbo0qLPanJrAVKgSRX/LPElxQF0smiDy6Ojo7pd3qXLjxo2r1y8fnwxORpN8Nt/u9fLF5OTFcRVKDWE0HJZF2O71IsOzZ0+e7D3tdDo7168miU9SJ6IhBIGD2KuKMpHaPwoFXkXq9Aak+/u//TsFRCEgEAljjFtbW+UiHPb765sbJ8M+Y9HtdAbDgWs0pSge7O1u9Tar+Xwwmy0m03I0XpgbjydZlk2n43armaVOJIqQDEIIIKBABK/iBYuAnT4HwJrx1CkhRosAIRBBo93ImunO25dv/eBmb231+rUrRTH/we1ba+udhw/uSoZGOzt38Vx/1D85folYLhazqpg3mj5ruNWVTqPhxcEsAOa8ihJiAhMEQVChCgXmhKcWT41O6IGq5kCjqPOTk9F4PF7rrlvKRtQHjx/d2Lk+mgy+evrwhzs3Xuzv0tmbb5z79LNPzm9utdorEoNkzPPx+x+812o10tR7DyCqUwCMQUUIUqm2JOolbb/GjmbwoDGS9GZBnYM4IS0E5+TChS1Nk7Z28uPhW29euvPRf2fN1pdffNE1vXnzxsGgf/B036duvbce5tXG2uZkfnL79q3t8+sA4Rws0CJIAOI8LADUusLqeC0rTl4RJgyg1Fe+fB7yUrxTQoRWVoExbWTjl6P5fD7dO6yIF4P+bDK/92T3hzffLWGffPq5c7K1uf7hj3+PrLqbqxffuDQc9VdWVtY31846l1CFqJlalk8gr/UxAIzLLrZkbVK5WHgHhFIYmS+K6ZhFkY/Hi/5gPOhLUzvnu73L59KVxjyffXH314vFIsbYaTXeuXFtcHx4sPd9S+3l84PMwTsyBrMgQhUIgrEUREWUU4O8uhcLdW45BsWpiVRgoSyYTxYn/ee7e9/f/2Z8eOwYm8pko4EktDvpzOZXL5z3Dd3b2/vi/r1G0795cat//GxrvWPTaW+lvdVdXUkTCaVagAUrF6wKVSAGxIAQJEZYiVjSSrBSq4SVWCFWKINYpQzK4FHmhqjOgbF/+Hx0dJyXtv/46ZuXtrrd1V6ruRhNJqPZlfbq5999/Dt/+LNf/tf/nEyH585t73338OrVS3E8Pnl+MJnOi7i4fG1no7cJ79Sh7vPISwCwZYCERN3TjQCFZFxGE3FJV97iXCGIKBZlcyV799zbIdhsNnvyaP/x3r6Z+Tx02i6Kv/7WO8bFX/3ZT37xyZ2yf9Ta2n73vZ1vf/Xlv338+R/97MOVjc63X99fbXduvfuONBJTAlDxiBGAWKQZSVn2BZ4lDYwAlDQzkF7LEmYQyUSTdkvTzNuiZLz25vlOt3N0cPTwxcH7W2/9+NbN0Uef3Pvs6w/+9KcraePb3+z+6NKF+cHLvvN/89d/2SQsTSdr3clwMh0M1nvr0ki4yI0iQgBSu8dYOwxm4BIEyTrTEY1mHrNpZD3KiMIhlLEokljKWueyytsX3ji/2rqzuzt4Obh95eLd3+ztf7Xv1e2sp8OXw73h8Od//FNNtIh5Rqx322tZWoWimo1c7hQi4mgBxtPpA3VBkXQ0M8BOh5VoS3D8j3+CACqsR4EYzUyIalqaCqCxyIsB/uFf//lPfv93R/2jf/z4m0Zmf/6j977af/wXH/7B6ubK+dVV2+g6D0Yzg4OoA0kRrYoiEXcarFfzq7IueJKsYZktAXl7MRURiARakiQ08xAACHCGybj/i3v3ZoNyDa3/vPPg59cuf/fi4GKjPRmH99cuHT5+Ouv3ipV5b2ve2lxRdfPJLMa4ttKxEEl68ZH52bh4xkDhbLI2OYNiBpL+cHfmnKvfq2nf+eWXi2L+6PgQh42nk+GVc1uf7h9+f1T8ZOftXz76flu7L07Gs7FttCYvknH74PiDt24kjWa/PyvLElupJ2OMZFXBROS3hnoz8sxBS9+YYemhrw9L55xCFCYSalgR7Ehy/+DFnChC0kq3m37j9nr2L7uPnrw8UBb//t2emGsnybW8OW9M3uhc+fbprNWW0Qwh6MwKAQGEEIhlpccYSVLl/wkPM4unqEj6+7MyUZeIpj6pRxOJjDGO5qNpbNLsWTiSyt/dex5mR1Ui+9Phxe72w+moI1mmViSbG7xQNNpHlrhKBnkkcbIwi5WZGegpgMYYq6oCoKoiamZAfB1TWCoq+o/2DxzEiU/TNHXeBCGEqqqKGKGIDPOFTedDY8x8M5HEIRlXi5D7TtrsVpv5cDbZyB69eL7a6IjIfD6NNBHJy1A3tcRJCOV4Nmq1OiqZUgFznonzZVWIECoqXjWpijJGevVipFkZqipYKt6JE1XXjj5tJHk+n41jptrtrifqptNpq9WaTMcqyXon9VlqxHgyi5GjWa6qeZ5DJcsyM6OomVm04WQwnY3XIGkCQGEhzktjORoN8yp3zqVpI0lSUNXB59OhiChE1RdaSK0XSTNqoSSbmQe8F8Bi4jRN00WRr3TY7jSzJAEAQZIkCBUQo1aqmtSTHmJkrGApQtu7lodKKXDQGCyaaJo4mgeAEEPM667sd59/dyoQpUYDUQBCpZiqqmrNIgCEIKlgWS1OTl4OYl9gRoo40VgrRhGpP0G9qMZgFieTKgaKOFXQgolaCE7MBOrgnEO0aKWfLI7rWRaAnC4ATv3ZpiLiVQFYoCmzLAuhHI5eMsInIBkNUXTZUAERAVlvFSrziZoZFxOaaK3HAJOw1K9ArQXKMl/MJ7Ld6Z0l/1m86qMCGEXEe7+EW0+g4iFljCHxLQGcWq0NUp/Ur52K+Vc3ohrrFrs8PzhlJgBiKt7MYoxVKIpiIRudtdc9QSxheTPnHIAYCaNzTlXNzKg+YWRQpgKQRjGIB8Pyb0BJnv1ikFoYOwBEBKAEqFQlaRalFtqkc440n3IZrNp7Z4LExMpgy4SAVBaFVp9zhBCIaBQnDqhPSQgKIAJPksal+AG8ogpRnQCIUVRFoSEE9QIaLNCpqiPFQUK0/wPxadi/ncvxsAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMS0wMi0yOFQwMjo1NTowMiswMTowMGbLlncAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTEtMDItMjhUMDI6NTU6MDIrMDE6MDAXli7LAAAAEXRFWHRqcGVnOmNvbG9yc3BhY2UAMix1VZ8AAAAgdEVYdGpwZWc6c2FtcGxpbmctZmFjdG9yADF4MSwxeDEsMXgx6ZX8cAAAAABJRU5ErkJggg==\" alt=\"This image was embedded using data URI scheme\" /><p class=\"caption\">This image was embedded using data URI scheme</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "test/fb2/images.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section><p>This example test if Pandoc correctly embeds images into FictionBook.</p><p>Small inline image: <image l:href=\"#image1\" l:type=\"inlineImageType\" alt=\"alt text a small PNG image\" />.</p><p>Paragraph image:</p><image l:href=\"#image2\" l:type=\"imageType\" alt=\"alt text of a big JPEG image\" title=\"image title text\" /><p>alt text of a big missing image</p><p>A missing image inline: alt text of missing image.</p></section></body><binary id=\"image2\" content-type=\"image/jpeg\">/9j/4AAQSkZJRgABAQEASABIAAD/4QOoRXhpZgAATU0AKgAAAAgAFgD+AAQAAAABAAAAAQEPAAIAAAAUAAABFgEQAAIAAAAUAAABKgESAAMAAAABAAEAAAExAAIAAAAdAAABPgEyAAIAAAAUAAABXEdGAAkAAAABAAAAAkdJAAkAAAABAAAAKIdpAAQAAAABAAACXMYSAAEAAAAEAQEAAMYTAAEAAAAEAQEAAMYUAAIAAAAMAAABcMYhAAoAAAAJAAABfMYiAAoAAAAJAAABxMYnAAUAAAADAAACDMYoAAUAAAADAAACJMYqAAoAAAABAAACPMYrAAUAAAABAAACRMYsAAUAAAABAAACTMYuAAUAAAABAAACVMZaAAMAAAABABEAAMZbAAMAAAABABUAAAAAAABQRU5UQVggICAgICAgICAgICAgAFBFTlRBWCBLMjBEICAgICAgICAAZGFya3RhYmxlIDAuNy4xKzkxM35nYTA5MzllYQAAMjAxMTowMjowNiAwNzoyOToxNgBQRU5UQVggSzIwRAAAAZM/AAEAAP//NuAAAQAA///jlgABAAD//2viAAEAAAABh0EAAQAAAABNLwABAAD//+62AAEAAAAAKd8AAQAAAAFHQAABAAAAASNbAAEAAP//py8AAQAA///Z7gABAAD//4X3AAEAAAABWGsAAQAAAAAZVgABAAD//9qsAAEAAAAAUBMAAQAAAACr2QABAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAEAAAABdAAAAQAAAAEAAAABAAAAAWX//4AAAAEAAAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAVgpoABQAAAAEAAANegp0ABQAAAAEAAANmiCIAAwAAAAEAAQAAiCcAAwAAAAEAyAAAkAMAAgAAABQAAANukAQAAgAAABQAAAOCkgQACgAAAAEAAAOWkgcAAwAAAAEABQAAkgkAAwAAAAEAEAAAkgoABQAAAAEAAAOeoAEAAwAAAAEAAQAAohcAAwAAAAEAAgAApAEAAwAAAAEAAAAApAIAAwAAAAEAAQAApAMAAwAAAAEAAAAApAUAAwAAAAEAhwAApAYAAwAAAAEAAAAApAgAAwAAAAEAAAAApAkAAwAAAAEAAAAApAoAAwAAAAEAAAAApAwAAwAAAAEAAwAAAAAAAAAAAAEAAAAyAAAAHAAAAAoyMDExOjAyOjA2IDA3OjI5OjE2ADIwMTE6MDI6MDYgMDc6Mjk6MTYAAAAACgAAAAoAAP/iAxhJQ0NfUFJPRklMRQABAQAAAwhsY21zBCAAAG1udHJSR0IgWFlaIAfbAAIACgAWABAAGmFjc3BBUFBMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAAANMtbGNtcwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADWRlc2MAAAEgAAAAUGNwcnQAAAFwAAAAgHd0cHQAAAHwAAAAFGNoYWQAAAIEAAAALHJYWVoAAAIwAAAAFGJYWVoAAAJEAAAAFGdYWVoAAAJYAAAAFHJUUkMAAAJsAAAAIGdUUkMAAAKMAAAAIGJUUkMAAAKsAAAAIGNocm0AAALMAAAAJGRtbmQAAALwAAAADWRtZGQAAAMAAAAABW1sdWMAAAAAAAAAAQAAAAxlblVTAAAANAAAABwAUgAAAEcAAABCAAAAIAAAAGIAAAB1AAAAaQAAAGwAAAB0AAAALQAAAGkAAABuAAAAAAAAbWx1YwAAAAAAAAABAAAADGVuVVMAAABkAAAAHABOAAAAbwAAACAAAABjAAAAbwAAAHAAAAB5AAAAcgAAAGkAAABnAAAAaAAAAHQAAAAsAAAAIAAAAHUAAABzAAAAZQAAACAAAABmAAAAcgAAAGUAAABlAAAAbAAAAHkAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLXNmMzIAAAAAAAEMSgAABeP///MqAAAHmwAA/Yf///ui///9owAAA9gAAMCUWFlaIAAAAAAAAG+UAAA47gAAA5BYWVogAAAAAAAAJJ0AAA+DAAC2vlhZWiAAAAAAAABipQAAt5AAABjecGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltwYXJhAAAAAAADAAAAAmZmAADypwAADVkAABPQAAAKW3BhcmEAAAAAAAMAAAACZmYAAPKnAAANWQAAE9AAAApbY2hybQAAAAAAAwAAAACj1wAAVHsAAEzNAACZmgAAJmYAAA9cKGR0IGludGVybmFsKQAAAHNSR0IAAAAA/9sAQwAbEhQXFBEbFxYXHhwbIChCKyglJShROj0wQmBVZWRfVV1baniZgWpxkHNbXYW1hpCeo6utq2eAvMm6pseZqKuk/9sAQwEcHh4oIyhOKytOpG5dbqSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSk/8AAEQgAgADAAwERAAIRAQMRAf/EABkAAAMBAQEAAAAAAAAAAAAAAAEAAwQCBf/EADIQAAEDAwMDAQYGAgMAAAAAAAEAAhEDEiExE1EEQWEiQpFxI4GxFFLwMqEF0eEkYsH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAQID/8QAGxEBAQEBAAMBAAAAAAAAAAAAABEBEgIxIUH/2gAMAwEAAhEDEQA/APehabMIGEDCBhAwgYQMoATGdQgQ4GI7oCgEIFAoGEAVAhAoAgYQBAECigqNCwhRSiFBw54aEUWvDhIKDpERqGDMqqg6rIsbr2Co7Y4lrc50Ed8qC4cDjugMogoFAECgUUEAhAoAgEKhQBBoWAoFAHCfiqMtZxaCKhjz2VGShXLPS6QQ3ug1N6gbgaQZicaICKm48lkY0M6oOOoDGupkyWE5xp+iiAWupsYHD1EAADlFdF74ggNdOkIKNJLrSSecILtUBhAECgCBQBAqgIAgCBQaFlCgCDJ1FdzMNJB4wqrhlZrzZVBDoiI1QZOrpOkOa8ENabCRM+CqE1A1jS4EEDMHA+iDU53oaYDT2jUf5UGZ1V0xJudaSD7JDhn9cKjS2s0VxcC5wAjnKg5fdV6p0uAa0DPYKjRRe1lIxmO/KhCOpaHkGdYQXDge6AoGEAQKAIAgUAQBAEGhZQoFBCo2nock9lVQNA33tdLRm3Uqo46mi1/TuioSw5k+yeUEqDTUZ8zBJ26k89j+uQipvApN/Duabg2WPHcDsgl1Nz6FOrTa6bXH08RP+EGiqW0unNYGXO9cHXJwPsglcRSD3ujxMl0qi7XAUjL4GjQ6JKgpSBj0tdkyC46oNNJrvaIlBaFAoFAECiggCBKAIAqLrLJQcvzgIoNZGpKI5exuvqEdwUGd729O4vvDmu/cMSPKqslaqyk8vJ/49QWuH5D2093uQ9KPO70oeS4GnrGsDBQZqrrehaWEQabmEf8Aa0/eFUFkGmKlYkuHpYzsTpJ5RVWU3Bw26bQ4CCT7I+PPj7IK0KT3m4YaDgnNyg2tptmXep3JQdhoGigKAIFFBAoAgUAQBAFRZZQzCDlzgAgQ7X4IIPebvVFvCqpWhziXMf4kf4QQqspNllgdRcYgey49vH68Koy9NVrs6mpRAc5zRJDtXdp90IJdU67pOlptxc4N8yJE/wAomrUKdT8W8UTdTZ6GnWwd/wCZRWi5oI6ZrvDiOOPiUVrY4N0LwYjtCgowOH7iZQWBwiFQKoVFBAoAilAEAQBUVlZZAnCKy1XuktbBPHCKl+IcwAvY4azkH7FUVaWuALXYJmRlB2RTAFznE83FSpGbqdupSfFQ3EYBP/qtIxMu6nrBd8vqqTDkcgj+DJV/Eef1dRzXFjwWPbUJI4mMq4mvV6YGh07KDQQ97cN5Pcnx/pRrMEDp6QABugF1xzn7ZRcaadakykJdaJ0/0oq9PqGVDgzGAiRYOlEgygZQCVFMoFAJQMooSgZQCVR1KyhJkIOQwNGNUHDgACYM+EVnqUHXBzKQBPMEfUK1GZ+410VDafyDv8Ciqsp06jMummYwMZ8oRne/Z/selc4Sc0y8e0IxPmVfxncms398xv4qi4NBLhHxz3V8U8saemfuPcX66uz7m/AKa3mNvUPLg2lSaHVHic+yOSpienNDotl0l7nuOpHpn3JuqtUokmWvLTyM/dKho3NJbUJ8HlFaAUDKhAlCGUIEoplCBKBlCBKLAlCDcoQbkIbkI5JzPCEcl0unhCOKoY8RUAI4KpGDqKh6T1seXUnDLXajyr7SRz1RNb+vp1Wj1sAqN76Jns3LlYeurs6ur04ozI9+VrMjHltkaw5tB220es4lx08lZ9unr439I9tMRfcXZLjqSppy1NqBxQg3IQCQTlCCHQhDcoQLkWG5CBchDchAuRYFyENyEC5UiW8FeWoO8FJpB3gk0h3gkIBqgDukIx9RVvBjLQJE5WsxNZWl7hEkjTOR9VYyFB1nyKl8tGCDqO2EiePz5rA+KXW/KcCA4QSr+OW/PL49I7TAHON9QnLu/wCvCjtMxQVWgztyfphSKvT6m15Gg7JFahVBCkWODW+aMwISI73UindCQDdHKQO4kA3PKQDcSB3UgG6kA3UgG6rBlFUcrpHPsdzykOhvKQ6O4kOk6tUuFo96Q6RqOhoaDMJGenDazGttkDukOk6lQ1HE0yL2SQQYlIm+VY5NSvI18qOdutTasumJI/hWN55K0nuyBE95KRrPJelJ/f7kjXTQHwNUi9OTU+Z9EidO9xIvQbiQ6O55SHTk1Y7pDo7iQ6O4kOg3PKQ6DcKQ6O4eUh0BqFInTFkFbcBDnA4JQd3P/MULoEuOpJQc2lBzUkDRBwAXGFEFzYHhFZSbapjGVn9RSnnAKuC4vGkiOFpape8QbihdHdf+YoXXO48u/cULpudyUKEnlCg57gNShXLajicklCu7jOqFC9w7lCg6s8DBKhdD8Q8nVC6O+7lC6d1x9pUup7zuVmhFZ3KtB33cpSnfdylKd535ilKTWJ1KUEVY0SgGpISjNVy6eVnUVoODW6K4K7ytUd5KBveEoG4JnKUdbyUDdSgGpIhKgMdalB3AlU3jlKOS4FKjlQHEaqgY5QQuKwG8oDeVQ3lShvPCoN6BvShvQckyoC10CFR1egb0DegbwgbwgbggbvKBvHKBuQN/lKG/ygF3lAl3lKOHunRQCFAIKA5QDKBQGUCqFAoplEMoplEFAoFAJQKBQP0QKBQBAoFB/9k=</binary><binary id=\"image1\" content-type=\"image/png\">iVBORw0KGgoAAAANSUhEUgAAADAAAAAgCAIAAADbtmxLAAABmGlDQ1BpY2MAAHjapdG/axMBGMbxTy4tldJSwSAiHW4ootKCqIOrVShIkRIrJNUluUvaQi4Nd1dEXAQHF4cOXVRcLOLirJv4BygIggqCi7sUBRcpcbiDgtBBfOGF5/315eV9qR7qRUk2EpL087S+MB82mivh2BeBcUcddrwVZYOLS0uLDrRfH1Xgw1wvSjL/ZpNxJ4uohFiKBmlOZYC7t/JBTmUXtWitFROMYDZtNFcIzqDWLvRl1FYL3UAtXa5fIughXC30A4TtQr9AGK2lCcFbzMRJPybYxWScxDFVGE16m1G5ZwUTnf71aziPaXUsYB4h2tjEOnrIMVfG/QJyAC/GtKvYKFlRqQe4jbTkrGKtZM+WvZvI0CnjbtnfKb1XMtBoroR//yzrnjtbbDRxhdFvw+HP04w9Zu/+cPj76XC4t0P1M2+29+c3trnwnerWfm7mCVP3ePl6P9d+xqstjn0dtNIWitMG3S4/njPZ5Mh7xm/8b734Z1m384nlOyy+4+EjTnSZunkyzsP1ft5J+63eKWT1hXn4AzDofghlJQBJAAAACXBIWXMAAAsSAAALEgHS3X78AAACInpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjahVRJtiQhCNx7ijpCMIhyHNPU9/oGffxeaNY3p/5VC5IAQkAhtL9/evh8Pp+PiwaNKZubAYDuugNcMH4ZIAN6A6ATo68kdAA8VQ1DkoEIq2EILiBiALIQDTISWvz3SSQNJHwnilWTGgC/ZMSa1Fc8TDznZH4rgWOtRrwQKGh8VyNZ8bAY9Ccj1EGXUI0JwNE3n3itxrzis7Sq1TgBiNMwesKo1TjfcdZqXBaiWRpLrcbbEjBLU63G9QGv1bit+CSKWi2W8+3QLDluF/wIBgBEaNQWNSjFzHj7/zgOP92EBap3v2BqlNi2pEbGVi0yBNwkcRPiTVxIJDVLRgJxEXGLRgAgLBASkiIIwlIEYgyBJCnC4lKExN6yGSW6SD961nvvQaxhBZq4rbptbX1HlJPSokN37t9m9957a5utDux7Xwk06WnWWOJ2yqgkPqW4e2urnmNPK0HMtq0Hkkc7ZbSXUleHiNMIoGy7r/ppEwAIV+Amv1rS/3ghgCz23ns+m/HrASdJMWT2chsBiS2z73fcLGd+3E8hZ05nQ81zzOW2n8Saj1VzwTMHZ+g6xcPg5ozLASM7Z/hl9kaPnPFQmrcyvm8lFKbrAQwAoegtYFy34rEXRSFP/qEo4tmQ0wywlwPyG5G/BJQXvF5wOR4k7m9HjlupR/y6Mp42RjhWxm+Oh99BvMrwD3UCiGvkpxuRAAAACXZwQWcAAAAwAAAAIACELJ4GAAALGklEQVRYw11YW48dV1b+1tq7qs6t+/TldPsSx3bbcRwncWY0A4LMCOYFXpgHJCR4QvwAnpAQj/wB/gR/ACR4QUKDECMUEjLOZew4zsRxuu122+52n9Pnfuqy9/p4qNNtD1tLpVKpap/vrMu31rdl/nAgIjSpF0kAJAEHGJwAAIQheqeARVqomCQZGUkjSYLmTAyAkCJiESRVNYQAaL3h8k3SzPj6MjEzsr7SqyoAcRABQItRVZ14kqifmNEkTZNiUZiZ934xm4WE3mva8GYGAA5UJ8YYIyCipiKk1ZuTBAhQBGZQFRKvTAgBaQBIeOekBqpa+0gBxFgAlmhqhixJzUKMRVEUx/3RWmel3z9xzrVX2+tuRb3WnrDKVFUEgKlCVWI055WMZ76AieipX0AYzYwQUZqZqJD0tKCqFJAxhKiqSZKooirj06fPMt/odlezhngFYar+0e7jxWLR6/Vc7ubzpNnM4BlDSDLvvQ8hnAYFIlCFRUDEjASgIGFGEcBIoSrMCFAVhgiKTxJPkgJVSeBBhKqaTCb5Ip4cD/efPP/g9q2soSvdTp7nAuv2Vk/2BoHFyWgRYxVjbDezRiMDMicNxqCqqhIZVZxZVK3zaRkgXYaMdeDMoMoapSpo8GSE1t6ihaCqPs3WV/VwPpxOp8fHRw++cUmq7XYzSbLV1W5vu3fw7Emn0xwcD+ZzF8vKQtlI09R7J6SXOldgEDEwAmdguMyYV/lEVWEkARExEkoVBxHWxeUSFefK6fTJ48dlme/sXN7a3vjVnf8NIQ6Hk1ajOZ+Nf/3ZZ9Uij0V+fedqM0v2nz5ut7LtCz1GC2WVJqmry1KgZKLqlbo0qLPanJrAVKgSRX/LPElxQF0smiDy6Ojo7pd3qXLjxo2r1y8fnwxORpN8Nt/u9fLF5OTFcRVKDWE0HJZF2O71IsOzZ0+e7D3tdDo7168miU9SJ6IhBIGD2KuKMpHaPwoFXkXq9Aak+/u//TsFRCEgEAljjFtbW+UiHPb765sbJ8M+Y9HtdAbDgWs0pSge7O1u9Tar+Xwwmy0m03I0XpgbjydZlk2n43armaVOJIqQDEIIIKBABK/iBYuAnT4HwJrx1CkhRosAIRBBo93ImunO25dv/eBmb231+rUrRTH/we1ba+udhw/uSoZGOzt38Vx/1D85folYLhazqpg3mj5ruNWVTqPhxcEsAOa8ihJiAhMEQVChCgXmhKcWT41O6IGq5kCjqPOTk9F4PF7rrlvKRtQHjx/d2Lk+mgy+evrwhzs3Xuzv0tmbb5z79LNPzm9utdorEoNkzPPx+x+812o10tR7DyCqUwCMQUUIUqm2JOolbb/GjmbwoDGS9GZBnYM4IS0E5+TChS1Nk7Z28uPhW29euvPRf2fN1pdffNE1vXnzxsGgf/B036duvbce5tXG2uZkfnL79q3t8+sA4Rws0CJIAOI8LADUusLqeC0rTl4RJgyg1Fe+fB7yUrxTQoRWVoExbWTjl6P5fD7dO6yIF4P+bDK/92T3hzffLWGffPq5c7K1uf7hj3+PrLqbqxffuDQc9VdWVtY31846l1CFqJlalk8gr/UxAIzLLrZkbVK5WHgHhFIYmS+K6ZhFkY/Hi/5gPOhLUzvnu73L59KVxjyffXH314vFIsbYaTXeuXFtcHx4sPd9S+3l84PMwTsyBrMgQhUIgrEUREWUU4O8uhcLdW45BsWpiVRgoSyYTxYn/ee7e9/f/2Z8eOwYm8pko4EktDvpzOZXL5z3Dd3b2/vi/r1G0795cat//GxrvWPTaW+lvdVdXUkTCaVagAUrF6wKVSAGxIAQJEZYiVjSSrBSq4SVWCFWKINYpQzK4FHmhqjOgbF/+Hx0dJyXtv/46ZuXtrrd1V6ruRhNJqPZlfbq5999/Dt/+LNf/tf/nEyH585t73338OrVS3E8Pnl+MJnOi7i4fG1no7cJ79Sh7vPISwCwZYCERN3TjQCFZFxGE3FJV97iXCGIKBZlcyV799zbIdhsNnvyaP/x3r6Z+Tx02i6Kv/7WO8bFX/3ZT37xyZ2yf9Ta2n73vZ1vf/Xlv338+R/97MOVjc63X99fbXduvfuONBJTAlDxiBGAWKQZSVn2BZ4lDYwAlDQzkF7LEmYQyUSTdkvTzNuiZLz25vlOt3N0cPTwxcH7W2/9+NbN0Uef3Pvs6w/+9KcraePb3+z+6NKF+cHLvvN/89d/2SQsTSdr3clwMh0M1nvr0ki4yI0iQgBSu8dYOwxm4BIEyTrTEY1mHrNpZD3KiMIhlLEokljKWueyytsX3ji/2rqzuzt4Obh95eLd3+ztf7Xv1e2sp8OXw73h8Od//FNNtIh5Rqx322tZWoWimo1c7hQi4mgBxtPpA3VBkXQ0M8BOh5VoS3D8j3+CACqsR4EYzUyIalqaCqCxyIsB/uFf//lPfv93R/2jf/z4m0Zmf/6j977af/wXH/7B6ubK+dVV2+g6D0Yzg4OoA0kRrYoiEXcarFfzq7IueJKsYZktAXl7MRURiARakiQ08xAACHCGybj/i3v3ZoNyDa3/vPPg59cuf/fi4GKjPRmH99cuHT5+Ouv3ipV5b2ve2lxRdfPJLMa4ttKxEEl68ZH52bh4xkDhbLI2OYNiBpL+cHfmnKvfq2nf+eWXi2L+6PgQh42nk+GVc1uf7h9+f1T8ZOftXz76flu7L07Gs7FttCYvknH74PiDt24kjWa/PyvLElupJ2OMZFXBROS3hnoz8sxBS9+YYemhrw9L55xCFCYSalgR7Ehy/+DFnChC0kq3m37j9nr2L7uPnrw8UBb//t2emGsnybW8OW9M3uhc+fbprNWW0Qwh6MwKAQGEEIhlpccYSVLl/wkPM4unqEj6+7MyUZeIpj6pRxOJjDGO5qNpbNLsWTiSyt/dex5mR1Ui+9Phxe72w+moI1mmViSbG7xQNNpHlrhKBnkkcbIwi5WZGegpgMYYq6oCoKoiamZAfB1TWCoq+o/2DxzEiU/TNHXeBCGEqqqKGKGIDPOFTedDY8x8M5HEIRlXi5D7TtrsVpv5cDbZyB69eL7a6IjIfD6NNBHJy1A3tcRJCOV4Nmq1OiqZUgFznonzZVWIECoqXjWpijJGevVipFkZqipYKt6JE1XXjj5tJHk+n41jptrtrifqptNpq9WaTMcqyXon9VlqxHgyi5GjWa6qeZ5DJcsyM6OomVm04WQwnY3XIGkCQGEhzktjORoN8yp3zqVpI0lSUNXB59OhiChE1RdaSK0XSTNqoSSbmQe8F8Bi4jRN00WRr3TY7jSzJAEAQZIkCBUQo1aqmtSTHmJkrGApQtu7lodKKXDQGCyaaJo4mgeAEEPM667sd59/dyoQpUYDUQBCpZiqqmrNIgCEIKlgWS1OTl4OYl9gRoo40VgrRhGpP0G9qMZgFieTKgaKOFXQgolaCE7MBOrgnEO0aKWfLI7rWRaAnC4ATv3ZpiLiVQFYoCmzLAuhHI5eMsInIBkNUXTZUAERAVlvFSrziZoZFxOaaK3HAJOw1K9ArQXKMl/MJ7Ld6Z0l/1m86qMCGEXEe7+EW0+g4iFljCHxLQGcWq0NUp/Ur52K+Vc3ohrrFrs8PzhlJgBiKt7MYoxVKIpiIRudtdc9QSxheTPnHIAYCaNzTlXNzKg+YWRQpgKQRjGIB8Pyb0BJnv1ikFoYOwBEBKAEqFQlaRalFtqkc440n3IZrNp7Z4LExMpgy4SAVBaFVp9zhBCIaBQnDqhPSQgKIAJPksal+AG8ogpRnQCIUVRFoSEE9QIaLNCpqiPFQUK0/wPxadi/ncvxsAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMS0wMi0yOFQwMjo1NTowMiswMTowMGbLlncAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTEtMDItMjhUMDI6NTU6MDIrMDE6MDAXli7LAAAAEXRFWHRqcGVnOmNvbG9yc3BhY2UAMix1VZ8AAAAgdEVYdGpwZWc6c2FtcGxpbmctZmFjdG9yADF4MSwxeDEsMXgx6ZX8cAAAAABJRU5ErkJggg==</binary></FictionBook>\n"
  },
  {
    "path": "test/fb2/images.markdown",
    "content": "This example test if Pandoc correctly embeds images into FictionBook.\n\nSmall inline image: ![alt text a small PNG image][inline-image].\n\nParagraph image:\n\n![alt text of a big JPEG image](fb2/test.jpg \"image title text\")\n\n![alt text of a big missing image](missing.jpg)\n\nA missing image inline: ![alt text of missing image](missing.jpg).\n\n[inline-image]: fb2/test-small.png\n"
  },
  {
    "path": "test/fb2/math.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section><p>List math:</p><p>• <code>E = m c^2</code></p><p>• <code>A = \\pi r^2</code></p><p>Inline math: <code>x=\\frac{-b \\pm \\sqrt {b^2-4ac}}{2a}</code>.</p><p>Display math:</p><code>\\int_a^b \\! f(x)\\,dx = F(b) - F(a).</code></section></body></FictionBook>\n"
  },
  {
    "path": "test/fb2/math.markdown",
    "content": "List math:\n\n-  $E = m c^2$\n-  $A = \\pi r^2$\n\nInline math: $x=\\frac{-b \\pm \\sqrt {b^2-4ac}}{2a}$.\n\nDisplay math:\n\n$$\\int_a^b \\! f(x)\\,dx = F(b) - F(a).$$\n"
  },
  {
    "path": "test/fb2/meta.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre><book-title>Book title</book-title><annotation><p>This is the abstract.</p><p>It consists of two paragraphs.</p></annotation></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p>Book title</p></title></body></FictionBook>\n\n"
  },
  {
    "path": "test/fb2/meta.markdown",
    "content": "---\ntitle: Book title\nabstract: |\n  This is the abstract.\n\n  It consists of two paragraphs.\n---\n"
  },
  {
    "path": "test/fb2/reader/emphasis.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n\t<body>\n\t\t<section>\n\t\t\t<p>Plain, <strong>strong</strong>, <emphasis>emphasis</emphasis>, <strong><emphasis>strong emphasis</emphasis></strong>, <emphasis><strong>emphasized strong</strong></emphasis>.</p>\n\t\t\t<p>Strikethrough: <strikethrough>deleted</strikethrough></p>\n\t\t\t<p><sub>Subscript</sub> and <sup>superscript</sup></p>\n\t\t\t<p>Some <code>code</code></p>\n\t\t</section>\n\t</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/reader/emphasis.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Para\n          [ Str \"Plain,\"\n          , Space\n          , Strong [ Str \"strong\" ]\n          , Str \",\"\n          , Space\n          , Emph [ Str \"emphasis\" ]\n          , Str \",\"\n          , Space\n          , Strong [ Emph [ Str \"strong\" , Space , Str \"emphasis\" ] ]\n          , Str \",\"\n          , Space\n          , Emph\n              [ Strong [ Str \"emphasized\" , Space , Str \"strong\" ] ]\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"Strikethrough:\"\n          , Space\n          , Strikeout [ Str \"deleted\" ]\n          ]\n      , Para\n          [ Subscript [ Str \"Subscript\" ]\n          , Space\n          , Str \"and\"\n          , Space\n          , Superscript [ Str \"superscript\" ]\n          ]\n      , Para [ Str \"Some\" , Space , Code ( \"\" , [] , [] ) \"code\" ]\n      ]\n  ]\n"
  },
  {
    "path": "test/fb2/reader/epigraph.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n\t<body>\n\t\t<epigraph>\n\t\t\t<p>Body epigraph</p>\n\t\t</epigraph>\n\t\t<section>\n\t\t\t<epigraph>\n\t\t\t\t<p>Section epigraph</p>\n\t\t\t</epigraph>\n\t\t\t<section>\n\t\t\t\t<epigraph>\n\t\t\t\t\t<p>Subsection epigraph</p>\n\t\t\t\t</epigraph>\n\t\t\t</section>\n\t\t</section>\n\t</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/reader/epigraph.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Div\n      ( \"\" , [ \"epigraph\" ] , [] )\n      [ Para [ Str \"Body\" , Space , Str \"epigraph\" ] ]\n  , Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Div\n          ( \"\" , [ \"epigraph\" ] , [] )\n          [ Para [ Str \"Section\" , Space , Str \"epigraph\" ] ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Div\n              ( \"\" , [ \"epigraph\" ] , [] )\n              [ Para [ Str \"Subsection\" , Space , Str \"epigraph\" ] ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/fb2/reader/meta.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n\t<description>\n\t\t<title-info>\n\t\t\t<author>\n\t\t\t\t<first-name>First</first-name>\n\t\t\t\t<middle-name>Middle</middle-name>\n\t\t\t\t<last-name>Last</last-name>\n\t\t\t</author>\n\t\t\t<author>\n\t\t\t\t<first-name>Another</first-name>\n\t\t\t\t<last-name>Author</last-name>\n\t\t\t</author>\n\t\t\t<book-title>Book title</book-title>\n\t\t\t<annotation>\n\t\t\t\t<p>Book annotation</p>\n\t\t\t\t<p>Second paragraph of book annotation</p>\n\t\t\t</annotation>\n\t\t\t<keywords>foo, bar, baz</keywords>\n\t\t\t<date>2018</date>\n\t\t</title-info>\n\t</description>\n\t<body>\n\t\t<title><p>Body title</p></title>\n\t</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/reader/meta.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"abstract\"\n            , MetaBlocks\n                [ Para [ Str \"Book\" , Space , Str \"annotation\" ]\n                , Para\n                    [ Str \"Second\"\n                    , Space\n                    , Str \"paragraph\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"book\"\n                    , Space\n                    , Str \"annotation\"\n                    ]\n                ]\n            )\n          , ( \"author\"\n            , MetaList\n                [ MetaInlines\n                    [ Str \"First\"\n                    , Space\n                    , Str \"Middle\"\n                    , Space\n                    , Str \"Last\"\n                    ]\n                , MetaInlines [ Str \"Another\" , Space , Str \"Author\" ]\n                ]\n            )\n          , ( \"date\" , MetaInlines [ Str \"2018\" ] )\n          , ( \"keywords\"\n            , MetaList\n                [ MetaString \"foo\"\n                , MetaString \"bar\"\n                , MetaString \"baz\"\n                ]\n            )\n          , ( \"title\"\n            , MetaInlines [ Str \"Book\" , Space , Str \"title\" ]\n            )\n          ]\n    }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"Body\" , Space , Str \"title\" ]\n  ]\n"
  },
  {
    "path": "test/fb2/reader/notes.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n\t<body>\n\t\t<section>\n\t\t\t<p>Note <a l:href=\"#n1\" type=\"note\">1</a>.</p>\n\t\t\t<p>Second note <a l:href=\"#n2\" type=\"note\">2</a>.</p>\n\t\t</section>\n\t</body>\n\t<body name=\"notes\">\n\t\t<section id=\"n1\">\n\t\t\t<title><p>1</p></title>\n\t\t\t<p>Note contents</p>\n\t\t</section>\n\t\t<section id=\"n2\">\n\t\t\t<title><p>2</p></title>\n\t\t\t<p>Second note contents.</p>\n\t\t</section>\n\t</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/reader/notes.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Para\n          [ Str \"Note\"\n          , Space\n          , Note [ Para [ Str \"Note\" , Space , Str \"contents\" ] ]\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"Second\"\n          , Space\n          , Str \"note\"\n          , Space\n          , Note\n              [ Para\n                  [ Str \"Second\"\n                  , Space\n                  , Str \"note\"\n                  , Space\n                  , Str \"contents.\"\n                  ]\n              ]\n          , Str \".\"\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/fb2/reader/poem.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n\t<body>\n\t\t<section>\n\t\t\t<poem>\n\t\t\t\t<title>\n\t\t\t\t\t<p>Poem title</p>\n\t\t\t\t</title>\n\t\t\t\t<epigraph>\n\t\t\t\t\t<p>Poem epigraph</p>\n\t\t\t\t</epigraph>\n\t\t\t\t<stanza>\n\t\t\t\t\t<subtitle>Subtitle</subtitle>\n\t\t\t\t\t<title>\n\t\t\t\t\t\t<p>First stanza title</p>\n\t\t\t\t\t</title>\n\t\t\t\t\t<v>Verse</v>\n\t\t\t\t\t<v><emphasis>More</emphasis> verse</v>\n\t\t\t\t</stanza>\n\t\t\t\t<stanza>\n\t\t\t\t\t<v>One more stanza</v>\n\t\t\t\t</stanza>\n\t\t\t\t<text-author>Author</text-author>\n\t\t\t\t<date>April 2018</date>\n\t\t\t</poem>\n\t\t</section>\n\t</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/reader/poem.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Header\n          2 ( \"\" , [] , [] ) [ Str \"Poem\" , Space , Str \"title\" ]\n      , Div\n          ( \"\" , [ \"epigraph\" ] , [] )\n          [ Para [ Str \"Poem\" , Space , Str \"epigraph\" ] ]\n      , Header 2 ( \"\" , [ \"unnumbered\" ] , [] ) [ Str \"Subtitle\" ]\n      , Header\n          2\n          ( \"\" , [] , [] )\n          [ Str \"First\" , Space , Str \"stanza\" , Space , Str \"title\" ]\n      , LineBlock\n          [ [ Str \"Verse\" ]\n          , [ Emph [ Str \"More\" ] , Space , Str \"verse\" ]\n          ]\n      , LineBlock\n          [ [ Str \"One\" , Space , Str \"more\" , Space , Str \"stanza\" ]\n          ]\n      , Para [ Str \"Author\" ]\n      , Para [ Str \"April\" , Space , Str \"2018\" ]\n      ]\n  ]\n"
  },
  {
    "path": "test/fb2/reader/titles.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n\t<body>\n\t\t<title><p>Body title</p></title>\n\t\t<section>\n\t\t\t<title><p>Section title</p></title>\n\t\t\t<section>\n\t\t\t\t<title>\n\t\t\t\t\t<p>Subsection title</p>\n\t\t\t\t\t<p>with multiple paragraphs</p>\n\t\t\t\t</title>\n\t\t\t</section>\n\t\t\t<section>\n\t\t\t\t<title><p>Another subsection title</p></title>\n\t\t\t</section>\n\t\t</section>\n\t</body>\n</FictionBook>\n"
  },
  {
    "path": "test/fb2/reader/titles.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"Body\" , Space , Str \"title\" ]\n  , Div\n      ( \"\" , [ \"section\" ] , [] )\n      [ Header\n          2 ( \"\" , [] , [] ) [ Str \"Section\" , Space , Str \"title\" ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Str \"Subsection\"\n              , Space\n              , Str \"title\"\n              , LineBreak\n              , Str \"with\"\n              , Space\n              , Str \"multiple\"\n              , Space\n              , Str \"paragraphs\"\n              ]\n          ]\n      , Div\n          ( \"\" , [ \"section\" ] , [] )\n          [ Header\n              3\n              ( \"\" , [] , [] )\n              [ Str \"Another\"\n              , Space\n              , Str \"subsection\"\n              , Space\n              , Str \"title\"\n              ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/fb2/titles.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section id=\"simple-title\"><title><p>Simple title</p></title><p>This example tests FictionBook titles.</p></section><section id=\"emphasized-strong-title\"><title><p><emphasis>Emphasized</emphasis> <strong>Strong</strong> Title</p></title></section></body></FictionBook>\n\n"
  },
  {
    "path": "test/fb2/titles.markdown",
    "content": "# Simple title\n\nThis example tests FictionBook titles.\n\n# *Emphasized* **Strong** Title\n\n"
  },
  {
    "path": "test/haddock-reader.haddock",
    "content": "This file tests the Pandoc reader for Haddock.\nWe've borrowed examples from Haddock's documentation: <http://www.haskell.org/haddock/doc/html/ch03s08.html>.\n\nThe following characters have special meanings in Haddock, \\/, \\', \\`, \\\", \\@, \\<, so they must be escaped.\n\n\\* This is a paragraph, not a list item.\n\\> This sentence is not code.\n\\>\\>\\> This is not an example.\n\nThe references &#x3BB;, &#x3bb; and &#955; all represent the lower-case letter lambda.\n\nThis is a code block:\n\n> map :: (a -> b) -> [a] -> [b]\n> map _ []     = []\n> map f (x:xs) = f x : map f xs\n\nThis is another code block:\n\n@\nf x = x + x.\nThe \\@...\\@ code block /interprets markup normally/.\n\"Module.Foo\"\n\\\"Hello World\\\"\n@\n\nHaddock supports REPL examples:\n\n>>> fib 10\n55\n>>> putStrLn \"foo\\nbar\"\nfoo\nbar\n\nThat was /really cool/!\nI had no idea @fib 10 = 55@.\n\nThis module defines the type 'T'.\nThe identifier 'M.T' is not in scope\nI don't have to escape my apostrophes; great, isn't it?\nThis is a reference to the \"Foo\" module.\n\nThis is a bulleted list:\n\n  * first item\n\n  * second item\n\nThis is an enumerated list:\n\n  (1) first item\n\n  2. second item\n\nThis is a definition list:\n\n  [@foo@] The description of @foo@.\n\n  [@bar@] The description of @bar@.\n\nHere is a link: <http://haskell.org>\n\n<http://haskell.org Haskell> is a fun language!\n\n<http://example.com Click Here!>\n"
  },
  {
    "path": "test/haddock-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"file\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"Pandoc\"\n      , Space\n      , Str \"reader\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"Haddock.\"\n      , SoftBreak\n      , Str \"We've\"\n      , Space\n      , Str \"borrowed\"\n      , Space\n      , Str \"examples\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Str \"Haddock's\"\n      , Space\n      , Str \"documentation:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.haskell.org/haddock/doc/html/ch03s08.html\"\n          ]\n          ( \"http://www.haskell.org/haddock/doc/html/ch03s08.html\"\n          , \"http://www.haskell.org/haddock/doc/html/ch03s08.html\"\n          )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"characters\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"special\"\n      , Space\n      , Str \"meanings\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"Haddock,\"\n      , Space\n      , Str \"/,\"\n      , Space\n      , Str \"',\"\n      , Space\n      , Str \"`,\"\n      , Space\n      , Str \"\\\",\"\n      , Space\n      , Str \"@,\"\n      , Space\n      , Str \"<,\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Str \"they\"\n      , Space\n      , Str \"must\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"escaped.\"\n      ]\n  , Para\n      [ Str \"*\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph,\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , SoftBreak\n      , Str \">\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"sentence\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"code.\"\n      , SoftBreak\n      , Str \">>>\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"example.\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"references\"\n      , Space\n      , Str \"\\955,\"\n      , Space\n      , Str \"\\955\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"\\955\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"represent\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"lower-case\"\n      , Space\n      , Str \"letter\"\n      , Space\n      , Str \"lambda.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"code\"\n      , Space\n      , Str \"block:\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"map :: (a -> b) -> [a] -> [b]\\nmap _ []     = []\\nmap f (x:xs) = f x : map f xs\"\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"code\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"f x = x + x.\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"The @...@ code block \"\n      , Emph\n          [ Code ( \"\" , [] , [] ) \"interprets markup normally\" ]\n      , Code ( \"\" , [] , [] ) \".\"\n      , Code ( \"\" , [ \"haskell\" , \"module\" ] , [] ) \"Module.Foo\"\n      , Code ( \"\" , [] , [] ) \"\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\\\"Hello World\\\"\"\n      ]\n  , Para\n      [ Str \"Haddock\"\n      , Space\n      , Str \"supports\"\n      , Space\n      , Str \"REPL\"\n      , Space\n      , Str \"examples:\"\n      ]\n  , Para\n      [ Code ( \"\" , [ \"prompt\" ] , [] ) \">>>\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" , \"expr\" ] , [] ) \"fib 10\"\n      , LineBreak\n      , Code ( \"\" , [ \"result\" ] , [] ) \"55\"\n      ]\n  , Para\n      [ Code ( \"\" , [ \"prompt\" ] , [] ) \">>>\"\n      , Space\n      , Code\n          ( \"\" , [ \"haskell\" , \"expr\" ] , [] )\n          \"putStrLn \\\"foo\\\\nbar\\\"\"\n      , LineBreak\n      , Code ( \"\" , [ \"result\" ] , [] ) \"foo\"\n      , LineBreak\n      , Code ( \"\" , [ \"result\" ] , [] ) \"bar\"\n      ]\n  , Para\n      [ Str \"That\"\n      , Space\n      , Str \"was\"\n      , Space\n      , Emph [ Str \"really\" , Space , Str \"cool\" ]\n      , Str \"!\"\n      , SoftBreak\n      , Str \"I\"\n      , Space\n      , Str \"had\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"idea\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"fib 10 = 55\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"module\"\n      , Space\n      , Str \"defines\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"type\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" , \"identifier\" ] , [] ) \"T\"\n      , Str \".\"\n      , SoftBreak\n      , Str \"The\"\n      , Space\n      , Str \"identifier\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" , \"identifier\" ] , [] ) \"M.T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"scope\"\n      , SoftBreak\n      , Str \"I\"\n      , Space\n      , Str \"don't\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"escape\"\n      , Space\n      , Str \"my\"\n      , Space\n      , Str \"apostrophes;\"\n      , Space\n      , Str \"great,\"\n      , Space\n      , Str \"isn't\"\n      , Space\n      , Str \"it?\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"reference\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" , \"module\" ] , [] ) \"Foo\"\n      , Space\n      , Str \"module.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bulleted\"\n      , Space\n      , Str \"list:\"\n      ]\n  , BulletList\n      [ [ Para [ Str \"first\" , Space , Str \"item\" ] ]\n      , [ Para [ Str \"second\" , Space , Str \"item\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"enumerated\"\n      , Space\n      , Str \"list:\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"first\" , Space , Str \"item\" ] ]\n      , [ Para [ Str \"second\" , Space , Str \"item\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"definition\"\n      , Space\n      , Str \"list:\"\n      ]\n  , DefinitionList\n      [ ( [ Code ( \"\" , [] , [] ) \"foo\" ]\n        , [ [ Para\n                [ Str \"The\"\n                , Space\n                , Str \"description\"\n                , Space\n                , Str \"of\"\n                , Space\n                , Code ( \"\" , [] , [] ) \"foo\"\n                , Str \".\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Code ( \"\" , [] , [] ) \"bar\" ]\n        , [ [ Para\n                [ Str \"The\"\n                , Space\n                , Str \"description\"\n                , Space\n                , Str \"of\"\n                , Space\n                , Code ( \"\" , [] , [] ) \"bar\"\n                , Str \".\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://haskell.org\" ]\n          ( \"http://haskell.org\" , \"http://haskell.org\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Haskell\" ]\n          ( \"http://haskell.org\" , \"http://haskell.org\" )\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"fun\"\n      , Space\n      , Str \"language!\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Click\" , Space , Str \"Here!\" ]\n          ( \"http://example.com\" , \"http://example.com\" )\n      ]\n  ]\n"
  },
  {
    "path": "test/html-reader.html",
    "content": "<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n<meta name=\"generator\" content=\"pandoc\" />\n<style type=\"text/css\">\ndiv.pandocNote { border-left: 1px solid grey; padding-left: 1em; }\nspan.pandocNoteRef { vertical-align: super; font-size: 80%; }\nspan.pandocNoteMarker { }\n</style>\n<title>Pandoc Test Suite</title>\n</head>\n<body>\n<h1 class=\"title\">Pandoc Test Suite</h1>\n<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.</p>\n<hr />\n<h1>Headers</h1>\n<h2>Level 2 with an <a href=\"/url\">embedded link</a></h2>\n<h3>Level 3 with <em>emphasis</em></h3>\n<h4>Level 4</h4>\n<h5>Level 5</h5>\n<h1>Level 1</h1>\n<h2>Level 2 with <em>emphasis</em></h2>\n<h3>Level 3</h3>\n<p>with no blank line</p>\n<h2>Level 2</h2>\n<p>with no blank line</p>\n<hr />\n<h1>Paragraphs</h1>\n<p>Here's a regular paragraph.</p>\n<p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.</p>\n<p>Here's one with a bullet. * criminey.</p>\n<p>There should be a hard line break<br />\n here.</p>\n<hr />\n<h1>Block Quotes</h1>\n<p>E-mail style:</p>\n<blockquote>\n<p>This is a block quote. It is pretty short.</p>\n</blockquote>\n<blockquote>\n<p>Code in a block quote:</p>\n<pre><code>sub status {\n    print \"working\";\n}\n</code></pre>\n<p>A list:</p>\n<ol>\n<li>item one</li>\n<li>item two</li>\n</ol>\n<p>Nested block quotes:</p>\n<blockquote>\n<p>nested</p>\n</blockquote>\n<blockquote>\n<p>nested</p>\n</blockquote>\n</blockquote>\n<p>This should not be a block quote: 2 &gt; 1.</p>\n<p>Box-style:</p>\n<blockquote>\n<p>Example:</p>\n<pre><code>sub status {\n    print \"working\";\n}\n</code></pre>\n</blockquote>\n<blockquote>\n<ol>\n<li>do laundry</li>\n<li>take out the trash</li>\n</ol>\n</blockquote>\n<p>Here's a nested one:</p>\n<blockquote>\n<p>Joe said:</p>\n<blockquote>\n<p>Don't quote me.</p>\n</blockquote>\n</blockquote>\n<p>And a following paragraph.</p>\n<hr />\n<h1>Inline quotes</h1>\n<p>Normal text but then a <q cite=\"https://www.imdb.com/title/tt0062622/quotes/qt0396921\">inline quote</q>.</p>\n<p><q>Missing a cite attribute means its just normal text</q></p>\n<hr />\n<h1>Code Blocks</h1>\n<p>Code:</p>\n<pre><code>---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n</code></pre>\n<p>And:</p>\n<pre><code>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n</code></pre>\n<hr />\n<h1>Lists</h1>\n<h2>Unordered</h2>\n<p>Asterisks tight:</p>\n<ul>\n<li>asterisk 1</li>\n<li>asterisk 2</li>\n<li>asterisk 3</li>\n</ul>\n<p>Asterisks loose:</p>\n<ul>\n<li><p>asterisk 1</p>\n</li>\n<li><p>asterisk 2</p>\n</li>\n<li><p>asterisk 3</p>\n</li>\n</ul>\n<p>Pluses tight:</p>\n<ul>\n<li>Plus 1</li>\n<li>Plus 2</li>\n<li>Plus 3</li>\n</ul>\n<p>Pluses loose:</p>\n<ul>\n<li><p>Plus 1</p>\n</li>\n<li><p>Plus 2</p>\n</li>\n<li><p>Plus 3</p>\n</li>\n</ul>\n<p>Minuses tight:</p>\n<ul>\n<li>Minus 1</li>\n<li>Minus 2</li>\n<li>Minus 3</li>\n</ul>\n<p>Minuses loose:</p>\n<ul>\n<li><p>Minus 1</p>\n</li>\n<li><p>Minus 2</p>\n</li>\n<li><p>Minus 3</p>\n</li>\n</ul>\n<h2>Ordered</h2>\n<p>Tight:</p>\n<ol>\n<li>First</li>\n<li>Second</li>\n<li>Third</li>\n</ol>\n<p>and:</p>\n<ol>\n<li>One</li>\n<li>Two</li>\n<li>Three</li>\n</ol>\n<p>Loose using tabs:</p>\n<ol>\n<li><p>First</p>\n</li>\n<li><p>Second</p>\n</li>\n<li><p>Third</p>\n</li>\n</ol>\n<p>and using spaces:</p>\n<ol>\n<li><p>One</p>\n</li>\n<li><p>Two</p>\n</li>\n<li><p>Three</p>\n</li>\n</ol>\n<p>Multiple paragraphs:</p>\n<ol>\n<li><p>Item 1, graf one.</p>\n<p>Item 1. graf two. The quick brown fox jumped over the lazy dog's back.</p>\n</li>\n<li><p>Item 2.</p>\n</li>\n<li><p>Item 3.</p>\n</li>\n</ol>\n<p>List styles:</p>\n<ol></ol>\n<ol type=\"i\"></ol>\n<ol class=\"lower-roman\"></ol>\n<ol style=\"lower-roman\"></ol>\n<ol style=\"list-style: lower-roman;\"></ol>\n<ol style=\"list-style-type: lower-roman;\"></ol>\n<h2>Nested</h2>\n<ul>\n<li>Tab<ul>\n<li>Tab<ul>\n<li>Tab</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<p>Here's another:</p>\n<ol>\n<li>First</li>\n<li>Second:<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul>\n</li>\n<li>Third</li>\n</ol>\n<p>Same thing but with paragraphs:</p>\n<ol>\n<li><p>First</p>\n</li>\n<li><p>Second:</p>\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul>\n</li>\n<li><p>Third</p>\n</li>\n</ol>\n<h2>Tabs and spaces</h2>\n<ul>\n<li><p>this is a list item indented with tabs</p>\n</li>\n<li><p>this is a list item indented with spaces</p>\n<ul>\n<li><p>this is an example list item indented with tabs</p>\n</li>\n<li><p>this is an example list item indented with spaces</p>\n</li>\n</ul>\n</li>\n</ul>\n<h2 id=\"fancy-list-markers\"\n    >Fancy list markers</h2\n    ><ol start=\"2\" class=\"decimal\"\n    ><li\n      >begins with 2</li\n      ><li\n      ><p\n\t>and now 3</p\n\t><p\n\t>with a continuation</p\n\t><ol start=\"4\" class=\"lower-roman\"\n\t><li\n\t  >sublist with roman numerals, starting with 4</li\n\t  ><li\n\t  >more items<ol class=\"upper-alpha\"\n\t    ><li\n\t      >a subsublist</li\n\t      ><li\n\t      >a subsublist</li\n\t      ></ol\n\t    ></li\n\t  ></ol\n\t></li\n      ></ol\n    ><p\n    >Nesting:</p\n    ><ol type=\"A\"\n    ><li\n      >Upper Alpha<ol class=\"upper-roman\"\n\t><li\n\t  >Upper Roman.<ol start=\"6\" class=\"decimal\"\n\t    ><li\n\t      >Decimal start with 6<ol start=\"3\" type=\"a\"\n\t\t><li\n\t\t  >Lower alpha with paren</li\n\t\t  ></ol\n\t\t></li\n\t      ></ol\n\t    ></li\n\t  ></ol\n\t></li\n      ></ol\n    ><p\n    >Autonumbering:</p\n    ><ol\n    ><li\n      >Autonumber.</li\n      ><li\n      >More.<ol\n\t><li\n\t  >Nested.</li\n\t  ></ol\n\t></li\n      ></ol\n    ><hr\n     />\n<h2>Definition</h2>\n<dl>\n  <dt>Violin</dt>\n  <dd>Stringed musical instrument.</dd>\n  <dd>Torture device.</dd>\n  <dt>Cello</dt>\n  <dt>Violoncello</dt>\n  <dd>Low-voiced stringed instrument.</dd>\n</dl>\n<hr />\n<h1>Inline Markup</h1>\n<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>\n<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>\n<p>Empty <strong></strong> and <em></em>.\n<p>An <em><a href=\"/url\">emphasized link</a></em>.</p>\n<p><strong><em>This is strong and em.</em></strong></p>\n<p>So is <strong><em>this</em></strong> word.</p>\n<p><strong><em>This is strong and em.</em></strong></p>\n<p>So is <strong><em>this</em></strong> word.</p>\n<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\\</code>, <code>\\$</code>, <code>&lt;html&gt;</code>.</p>\n<p>This is <span style=\"font-variant: small-caps;\">small caps</span>.</p>\n<p>These are all underlined: <u>foo</u> and <ins>bar</ins>.</p>\n<p>These are all strikethrough: <s>foo</s>, <strike>bar</strike>, and <del>baz</del>.</p>\n<hr />\n<h1>Smart quotes, ellipses, dashes</h1>\n<p>\"Hello,\" said the spider. \"'Shelob' is my name.\"</p>\n<p>'A', 'B', and 'C' are letters.</p>\n<p>'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'</p>\n<p>'He said, \"I want to go.\"' Were you alive in the 70's?</p>\n<p>Here is some quoted '<code>code</code>' and a \"<a href=\"http://example.com/?foo=1&amp;bar=2\">quoted link</a>\".</p>\n<p>Some dashes: one---two --- three--four -- five.</p>\n<p>Dashes between numbers: 5-7, 255-66, 1987-1999.</p>\n<p>Ellipses...and. . .and . . . .</p>\n<hr />\n<h1>LaTeX</h1>\n<ul>\n<li>\\cite[22-23]{smith.1899}</li>\n<li>\\doublespacing</li>\n<li>$2+2=4$</li>\n<li>$x \\in y$</li>\n<li>$\\alpha \\wedge \\omega$</li>\n<li>$223$</li>\n<li>$p$-Tree</li>\n<li>$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$</li>\n<li>Here's one that has a line break in it: $\\alpha + \\omega \\times x^2$.</li>\n</ul>\n<p>These shouldn't be math:</p>\n<ul>\n<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>\n<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if \"lot\" is emphasized.)</li>\n<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>\n</ul>\n<p>Here's a LaTeX table:</p>\n<p>\\begin{tabular}{|l|l|}\\hline Animal &amp; Number \\\\ \\hline Dog &amp; 2 \\\\ Cat &amp; 1 \\\\ \\hline \\end{tabular}</p>\n<hr />\n<h1>Special Characters</h1>\n<p>Here is some unicode:</p>\n<ul>\n<li>I hat: Î</li>\n<li>o umlaut: ö</li>\n<li>section: §</li>\n<li>set membership: ∈</li>\n<li>copyright: ©</li>\n</ul>\n<p>AT&amp;T has an ampersand in their name.</p>\n<p>AT&amp;T is another way to write it.</p>\n<p>This &amp; that.</p>\n<p>4 &lt; 5.</p>\n<p>6 &gt; 5.</p>\n<p>Backslash: \\</p>\n<p>Backtick: `</p>\n<p>Asterisk: *</p>\n<p>Underscore: _</p>\n<p>Left brace: {</p>\n<p>Right brace: }</p>\n<p>Left bracket: [</p>\n<p>Right bracket: ]</p>\n<p>Left paren: (</p>\n<p>Right paren: )</p>\n<p>Greater-than: &gt;</p>\n<p>Hash: #</p>\n<p>Period: .</p>\n<p>Bang: !</p>\n<p>Plus: +</p>\n<p>Minus: -</p>\n<hr />\n<h1>Links</h1>\n<h2>Explicit</h2>\n<p>Just a <a href=\"/url/\">URL</a>.</p>\n<p><a href=\"/url/\" title=\"title\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title preceded by two spaces\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title preceded by a tab\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title with &quot;quotes&quot; in it\">URL and title</a></p>\n<p><a href=\"/url/\" title=\"title with single quotes\">URL and title</a></p>\nEmail link (nobody [at] nowhere.net)<p><a href=\"\">Empty</a>.</p>\n<h2>Reference</h2>\n<p>Foo <a href=\"/url/\">bar</a>.</p>\n<p>Foo <a href=\"/url/\">bar</a>.</p>\n<p>Foo <a href=\"/url/\">bar</a>.</p>\n<p>With <a href=\"/url/\">embedded [brackets]</a>.</p>\n<p><a href=\"/url/\">b</a> by itself should be a link.</p>\n<p>Indented <a href=\"/url\">once</a>.</p>\n<p>Indented <a href=\"/url\">twice</a>.</p>\n<p>Indented <a href=\"/url\">thrice</a>.</p>\n<p>This should [not] be a link.</p>\n<pre><code>[not]: /url\n</code></pre>\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quotes&quot; inside\">bar</a>.</p>\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quote&quot; inside\">biz</a>.</p>\n<h2>With ampersands</h2>\n<p>Here's a <a href=\"http://example.com/?foo=1&amp;bar=2\">link with an ampersand in the URL</a>.</p>\n<p>Here's a link with an amersand in the link text: <a href=\"http://att.com/\" title=\"AT&T\">AT&amp;T</a>.</p>\n<p>Here's an <a href=\"/script?foo=1&amp;bar=2\">inline link</a>.</p>\n<p>Here's an <a href=\"/script?foo=1&amp;bar=2\">inline link in pointy braces</a>.</p>\n<h2>Autolinks</h2>\n<p>With an ampersand: <a href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</a></p>\n<ul>\n<li>In a list?</li>\n<li><a href=\"http://example.com/\">http://example.com/</a></li>\n<li>It should.</li>\n</ul>\nAn e-mail address: nobody [at] nowhere.net<blockquote>\n<p>Blockquoted: <a href=\"http://example.com/\">http://example.com/</a></p>\n</blockquote>\n<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>\n<pre><code>or here: &lt;http://example.com/&gt;\n</code></pre>\n<hr />\n<h1>Images</h1>\n<p>From \"Voyage dans la Lune\" by Georges Melies (1902):</p>\n<p><img src=\"lalune.jpg\" title=\"Voyage dans la Lune\" alt=\"lalune\"></p>\n<p>Here is a movie <img src=\"movie.jpg\" alt=\"movie\"> icon.</p>\n<hr />\n<h1>Footnotes</h1>\n<p>Here is a footnote reference<a href=\"#note_1\">(1)</a>, and another<a href=\"#note_longnote\">(longnote)</a>. This should <em>not</em> be a footnote reference, because it contains a space^(my note).</p>\n<p><a href=\"#ref_1\">(1)</a> Here is the footnote. It can go anywhere in the document, not just at the end.</p>\n<p><a href=\"#ref_longnote\">(longnote)</a> Here's the other note. This one contains multiple blocks.</p>\n<p>Caret characters are used to indicate that the blocks all belong to a single footnote (as with block quotes).</p>\n<pre><code>  { &lt;code> }\n</code></pre>\n<p>If you want, you can use a caret at the beginning of every line, as with blockquotes, but all that you need is a caret at the beginning of the first line of the block and any preceding blank lines.</p>\n<p>text<em> Leading space</em></p>\n<p><em>Trailing space </em>text</p>\n<p>text<em>   Leading spaces</em></p>\n<p><em>Trailing spaces    </em>text</p>\n<h1>Tables</h1>\n<h2>Tables with Headers</h2>\n<table>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n</table>\n<hr />\n<table>\n    <thead>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<p>Row headers</p>\n<table>\n    <thead>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n        <th>1</th>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <th>4</th>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<table>\n    <thead>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n        <th>1</th>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td colspan=\"3\">Details</td>\n    </tr>\n    </tbody>\n    <tfoot>\n    <tr>\n        <th>4</th>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tfoot>\n</table>\n<hr />\n<table>\n    <tbody>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td colspan=\"3\">Details</td>\n    </tr>\n    </tbody>\n    <tfoot>\n    <tr>\n        <th>4</th>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tfoot>\n</table>\n<hr />\n<table>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    <tr>\n        <th>1</th>\n        <th>2</th>\n        <th>3</th>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n</table>\n<hr />\n<table>\n    <tbody>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<table>\n    <thead>\n    </thead>\n    <tbody>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<table>\n    <thead>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    </tbody>\n    <tbody>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<table>\n    <thead>\n    <tr>\n        <th>X</th>\n        <th>Y</th>\n        <th>Z</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n        <td>1</td>\n        <td><p>2</p></td>\n        <td>3</td>\n    </tr>\n    </tbody>\n    <tbody>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<h2>Tables without Headers</h2>\n<table>\n    <tbody>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<p>tbody tags omitted</p>\n<table>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n</table>\n<hr />\n<p>empty head</p>\n<table>\n    <thead>\n    </thead>\n    <tbody>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<hr />\n<p>explicit body and foot</p>\n<table>\n    <tbody>\n    <tr>\n        <td>1</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    </tbody>\n    <tfoot>\n    <tr>\n        <td>4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tfoot>\n</table>\n<h2>Colspans and Rowspans</h2>\n<table>\n    <tr>\n        <td colspan=\"2\">1 and 2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td colspan=\"3\">4, 5, and 6</td>\n    </tr>\n</table>\n<hr/>\n<table>\n    <thead>\n    <tr>\n        <th colspan=\"3\">Numbers</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n        <td rowspan=\"2\">1 and 4</td>\n        <td>2</td>\n        <td>3</td>\n    </tr>\n    <tr>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tbody>\n</table>\n<h2>Attributes</h2>\n<table id=\"attrib-test-table\">\n  <thead class=\"table-head\">\n    <tr class=\"table-head-row\">\n      <th abbr=\"x\" colspan=\"3\">Cat X</th>\n    </tr>\n    <tbody data-part=\"body\" class=\"main\">\n    <tr data-part=\"row\">\n        <td data-part=\"cell\">1</td>\n        <td valign=\"bottom\">2</td>\n        <td style=\"color: #151950\">3</td>\n    </tr>\n    </tbody>\n    <tfoot class=\"summary\">\n    <tr bgcolor=\"#ccc\">\n        <td data-square=\"true\">4</td>\n        <td>5</td>\n        <td>6</td>\n    </tr>\n    </tfoot>\n</table>\n<h2>Tag omission</h2>\n<p>thead, tbody, and tfoot</p>\n<table>\n    <thead>\n        <tr>\n            <td>X</td>\n            <td>Y</td>\n            <td>Z</td>\n        </tr>\n    <tbody>\n        <tr>\n            <td>1</td>\n            <td>2</td>\n            <td>3</td>\n        </tr>\n    <tfoot>\n        <tr>\n            <td>4</td>\n            <td>5</td>\n            <td>6</td>\n        </tr>\n</table>\n<h2>Empty Tables</h2>\n<p>This section should be empty.</p>\n<table>\n    <tbody>\n    </tbody>\n</table>\n<table>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "test/html-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"generator\" , MetaInlines [ Str \"pandoc\" ] )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\"\n                , Space\n                , Str \"Test\"\n                , Space\n                , Str \"Suite\"\n                ]\n            )\n          ]\n    }\n  [ Header\n      1\n      ( \"pandoc-test-suite\" , [ \"title\" ] , [] )\n      [ Str \"Pandoc\" , Space , Str \"Test\" , Space , Str \"Suite\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Str \"John\"\n      , Space\n      , Str \"Gruber's\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"headers\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"level-4\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"level-5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1 ( \"level-1\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"level-2-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      3 ( \"level-3\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header\n      2 ( \"level-2\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , Space\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , Space\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"break\"\n      , LineBreak\n      , Str \"here.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , Space\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , Para [ Str \"A\" , Space , Str \"list:\" ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Plain [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Plain [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quotes:\"\n          ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \">\"\n      , Space\n      , Str \"1.\"\n      ]\n  , Para [ Str \"Box-style:\" ]\n  , BlockQuote\n      [ Para [ Str \"Example:\" ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      ]\n  , BlockQuote\n      [ OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Plain [ Str \"do\" , Space , Str \"laundry\" ] ]\n          , [ Plain\n                [ Str \"take\"\n                , Space\n                , Str \"out\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"trash\"\n                ]\n            ]\n          ]\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"one:\"\n      ]\n  , BlockQuote\n      [ Para [ Str \"Joe\" , Space , Str \"said:\" ]\n      , BlockQuote\n          [ Para\n              [ Str \"Don't\" , Space , Str \"quote\" , Space , Str \"me.\" ]\n          ]\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"inline-quotes\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"quotes\" ]\n  , Para\n      [ Str \"Normal\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"then\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Span\n              ( \"\"\n              , []\n              , [ ( \"cite\"\n                  , \"https://www.imdb.com/title/tt0062622/quotes/qt0396921\"\n                  )\n                ]\n              )\n              [ Str \"inline\" , Space , Str \"quote\" ]\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Quoted\n          DoubleQuote\n          [ Str \"Missing\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"cite\"\n          , Space\n          , Str \"attribute\"\n          , Space\n          , Str \"means\"\n          , Space\n          , Str \"its\"\n          , Space\n          , Str \"just\"\n          , Space\n          , Str \"normal\"\n          , Space\n          , Str \"text\"\n          ]\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , HorizontalRule\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second\" ] ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"One\" ] ]\n      , [ Plain [ Str \"Two\" ] ]\n      , [ Plain [ Str \"Three\" ] ]\n      ]\n  , Para\n      [ Str \"Loose\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"and\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog's\"\n            , Space\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Para [ Str \"List\" , Space , Str \"styles:\" ]\n  , OrderedList ( 1 , DefaultStyle , DefaultDelim ) []\n  , OrderedList ( 1 , LowerRoman , DefaultDelim ) []\n  , OrderedList ( 1 , LowerRoman , DefaultDelim ) []\n  , OrderedList ( 1 , DefaultStyle , DefaultDelim ) []\n  , OrderedList ( 1 , LowerRoman , DefaultDelim ) []\n  , OrderedList ( 1 , LowerRoman , DefaultDelim ) []\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Plain [ Str \"Tab\" ]\n        , BulletList\n            [ [ Plain [ Str \"Tab\" ]\n              , BulletList [ [ Plain [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here's\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second:\" ]\n        , BulletList\n            [ [ Plain [ Str \"Fee\" ] ]\n            , [ Plain [ Str \"Fie\" ] ]\n            , [ Plain [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Same\"\n      , Space\n      , Str \"thing\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"paragraphs:\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Plain [ Str \"Fee\" ] ]\n            , [ Plain [ Str \"Fie\" ] ]\n            , [ Plain [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"tabs-and-spaces\" , [] , [] )\n      [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"tabs\"\n            ]\n        ]\n      , [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            ]\n        , BulletList\n            [ [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"tabs\"\n                  ]\n              ]\n            , [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"spaces\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , OrderedList\n      ( 2 , Decimal , DefaultDelim )\n      [ [ Plain\n            [ Str \"begins\" , Space , Str \"with\" , Space , Str \"2\" ]\n        ]\n      , [ Para [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n        , Para\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"continuation\"\n            ]\n        , OrderedList\n            ( 4 , LowerRoman , DefaultDelim )\n            [ [ Plain\n                  [ Str \"sublist\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"roman\"\n                  , Space\n                  , Str \"numerals,\"\n                  , Space\n                  , Str \"starting\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"4\"\n                  ]\n              ]\n            , [ Plain [ Str \"more\" , Space , Str \"items\" ]\n              , OrderedList\n                  ( 1 , UpperAlpha , DefaultDelim )\n                  [ [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  , [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Nesting:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , DefaultDelim )\n      [ [ Plain [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , DefaultDelim )\n            [ [ Plain [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , DefaultDelim )\n                  [ [ Plain\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , DefaultDelim )\n                        [ [ Plain\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"Autonumber.\" ] ]\n      , [ Plain [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , HorizontalRule\n  , Header 2 ( \"definition\" , [] , [] ) [ Str \"Definition\" ]\n  , DefinitionList\n      [ ( [ Str \"Violin\" ]\n        , [ [ Plain\n                [ Str \"Stringed\"\n                , Space\n                , Str \"musical\"\n                , Space\n                , Str \"instrument.\"\n                ]\n            ]\n          , [ Plain [ Str \"Torture\" , Space , Str \"device.\" ] ]\n          ]\n        )\n      , ( [ Str \"Cello\" , LineBreak , Str \"Violoncello\" ]\n        , [ [ Plain\n                [ Str \"Low-voiced\"\n                , Space\n                , Str \"stringed\"\n                , Space\n                , Str \"instrument.\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Empty\"\n      , Space\n      , Strong []\n      , Space\n      , Str \"and\"\n      , Space\n      , Emph []\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , Space , Str \"link\" ]\n              ( \"/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , SmallCaps [ Str \"small\" , Space , Str \"caps\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"underlined:\"\n      , Space\n      , Underline [ Str \"foo\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Underline [ Str \"bar\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"strikethrough:\"\n      , Space\n      , Strikeout [ Str \"foo\" ]\n      , Str \",\"\n      , Space\n      , Strikeout [ Str \"bar\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Strikeout [ Str \"baz\" ]\n      , Str \".\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"smart-quotes-ellipses-dashes\" , [] , [] )\n      [ Str \"Smart\"\n      , Space\n      , Str \"quotes,\"\n      , Space\n      , Str \"ellipses,\"\n      , Space\n      , Str \"dashes\"\n      ]\n  , Para\n      [ Str \"\\\"Hello,\\\"\"\n      , Space\n      , Str \"said\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"spider.\"\n      , Space\n      , Str \"\\\"'Shelob'\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"my\"\n      , Space\n      , Str \"name.\\\"\"\n      ]\n  , Para\n      [ Str \"'A',\"\n      , Space\n      , Str \"'B',\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"'C'\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"letters.\"\n      ]\n  , Para\n      [ Str \"'Oak,'\"\n      , Space\n      , Str \"'elm,'\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"'beech'\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"names\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"trees.\"\n      , Space\n      , Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"'pine.'\"\n      ]\n  , Para\n      [ Str \"'He\"\n      , Space\n      , Str \"said,\"\n      , Space\n      , Str \"\\\"I\"\n      , Space\n      , Str \"want\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"go.\\\"'\"\n      , Space\n      , Str \"Were\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"alive\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"70's?\"\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"quoted\"\n      , Space\n      , Str \"'\"\n      , Code ( \"\" , [] , [] ) \"code\"\n      , Str \"'\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"\\\"\"\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"quoted\" , Space , Str \"link\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \"\\\".\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one---two\"\n      , Space\n      , Str \"---\"\n      , Space\n      , Str \"three--four\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"five.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"numbers:\"\n      , Space\n      , Str \"5-7,\"\n      , Space\n      , Str \"255-66,\"\n      , Space\n      , Str \"1987-1999.\"\n      ]\n  , Para\n      [ Str \"Ellipses...and.\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".and\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"latex\" , [] , [] ) [ Str \"LaTeX\" ]\n  , BulletList\n      [ [ Plain [ Str \"\\\\cite[22-23]{smith.1899}\" ] ]\n      , [ Plain [ Str \"\\\\doublespacing\" ] ]\n      , [ Plain [ Str \"$2+2=4$\" ] ]\n      , [ Plain\n            [ Str \"$x\" , Space , Str \"\\\\in\" , Space , Str \"y$\" ]\n        ]\n      , [ Plain\n            [ Str \"$\\\\alpha\"\n            , Space\n            , Str \"\\\\wedge\"\n            , Space\n            , Str \"\\\\omega$\"\n            ]\n        ]\n      , [ Plain [ Str \"$223$\" ] ]\n      , [ Plain [ Str \"$p$-Tree\" ] ]\n      , [ Plain\n            [ Str \"$\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to\"\n            , Space\n            , Str \"0}\\\\frac{f(x+h)-f(x)}{h}$\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Here's\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"that\"\n            , Space\n            , Str \"has\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"it:\"\n            , Space\n            , Str \"$\\\\alpha\"\n            , Space\n            , Str \"+\"\n            , Space\n            , Str \"\\\\omega\"\n            , Space\n            , Str \"\\\\times\"\n            , Space\n            , Str \"x^2$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"shouldn't\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"math:\"\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"To\"\n            , Space\n            , Str \"get\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"famous\"\n            , Space\n            , Str \"equation,\"\n            , Space\n            , Str \"write\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$e = mc^2$\"\n            , Str \".\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"$22,000\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Emph [ Str \"lot\" ]\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"money.\"\n            , Space\n            , Str \"So\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"$34,000.\"\n            , Space\n            , Str \"(It\"\n            , Space\n            , Str \"worked\"\n            , Space\n            , Str \"if\"\n            , Space\n            , Str \"\\\"lot\\\"\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"emphasized.)\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Escaped\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$\"\n            , Str \":\"\n            , Space\n            , Str \"$73\"\n            , Space\n            , Emph\n                [ Str \"this\"\n                , Space\n                , Str \"should\"\n                , Space\n                , Str \"be\"\n                , Space\n                , Str \"emphasized\"\n                ]\n            , Space\n            , Str \"23$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"LaTeX\"\n      , Space\n      , Str \"table:\"\n      ]\n  , Para\n      [ Str \"\\\\begin{tabular}{|l|l|}\\\\hline\"\n      , Space\n      , Str \"Animal\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Number\"\n      , Space\n      , Str \"\\\\\\\\\"\n      , Space\n      , Str \"\\\\hline\"\n      , Space\n      , Str \"Dog\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"\\\\\\\\\"\n      , Space\n      , Str \"Cat\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"1\"\n      , Space\n      , Str \"\\\\\\\\\"\n      , Space\n      , Str \"\\\\hline\"\n      , Space\n      , Str \"\\\\end{tabular}\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n        ]\n      , [ Plain\n            [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Plain [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Plain\n            [ Str \"set\"\n            , Space\n            , Str \"membership:\"\n            , Space\n            , Str \"\\8712\"\n            ]\n        ]\n      , [ Plain [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , HorizontalRule\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by two spaces\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by a tab\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with \\\"quotes\\\" in it\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with single quotes\" )\n      ]\n  , Para\n      [ Str \"Email\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"(nobody\"\n      , Space\n      , Str \"[at]\"\n      , Space\n      , Str \"nowhere.net)\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"reference\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"[not]\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"[not]: /url\"\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"bar\" ]\n          ( \"/url/\" , \"Title with \\\"quotes\\\" inside\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"biz\" ]\n          ( \"/url/\" , \"Title with \\\"quote\\\" inside\" )\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"with-ampersands\" , [] , [] )\n      [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"AT&T\" ]\n          ( \"http://att.com/\" , \"AT&T\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\" , Space , Str \"link\" ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"pointy\"\n          , Space\n          , Str \"braces\"\n          ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n        ]\n      , [ Plain\n            [ Link\n                ( \"\" , [] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Plain [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , Space\n      , Str \"nobody\"\n      , Space\n      , Str \"[at]\"\n      , Space\n      , Str \"nowhere.net\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , Space\n          , Link\n              ( \"\" , [] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Auto-links\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"occur\"\n      , Space\n      , Str \"here:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] ) \"or here: <http://example.com/>\"\n  , HorizontalRule\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Str \"\\\"Voyage\"\n      , Space\n      , Str \"dans\"\n      , Space\n      , Str \"la\"\n      , Space\n      , Str \"Lune\\\"\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] )\n          [ Str \"lalune\" ]\n          ( \"lalune.jpg\" , \"Voyage dans la Lune\" )\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image\n          ( \"\" , [] , [] ) [ Str \"movie\" ] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference\"\n      , Link ( \"\" , [] , [] ) [ Str \"(1)\" ] ( \"#note_1\" , \"\" )\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"another\"\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"(longnote)\" ]\n          ( \"#note_longnote\" , \"\" )\n      , Str \".\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Emph [ Str \"not\" ]\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"contains\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"space^(my\"\n      , Space\n      , Str \"note).\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"(1)\" ] ( \"#ref_1\" , \"\" )\n      , Space\n      , Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"footnote.\"\n      , Space\n      , Str \"It\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"go\"\n      , Space\n      , Str \"anywhere\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"document,\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"end.\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"(longnote)\" ]\n          ( \"#ref_longnote\" , \"\" )\n      , Space\n      , Str \"Here's\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"note.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"contains\"\n      , Space\n      , Str \"multiple\"\n      , Space\n      , Str \"blocks.\"\n      ]\n  , Para\n      [ Str \"Caret\"\n      , Space\n      , Str \"characters\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"used\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"indicate\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"belong\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"single\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"(as\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quotes).\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"  { <code> }\"\n  , Para\n      [ Str \"If\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"want,\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"caret\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"beginning\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"every\"\n      , Space\n      , Str \"line,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"blockquotes,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"need\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"caret\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"beginning\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"first\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"preceding\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"lines.\"\n      ]\n  , Para\n      [ Str \"text\"\n      , Space\n      , Emph [ Str \"Leading\" , Space , Str \"space\" ]\n      ]\n  , Para\n      [ Emph [ Str \"Trailing\" , Space , Str \"space\" ]\n      , Space\n      , Str \"text\"\n      ]\n  , Para\n      [ Str \"text\"\n      , Space\n      , Emph [ Str \"Leading\" , Space , Str \"spaces\" ]\n      ]\n  , Para\n      [ Emph [ Str \"Trailing\" , Space , Str \"spaces\" ]\n      , Space\n      , Str \"text\"\n      ]\n  , Header 1 ( \"tables\" , [] , [] ) [ Str \"Tables\" ]\n  , Header\n      2\n      ( \"tables-with-headers\" , [] , [] )\n      [ Str \"Tables\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"Headers\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Para [ Str \"Row\" , Space , Str \"headers\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 1)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 3)\n                  [ Plain [ Str \"Details\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"4\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"5\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"6\" ] ]\n             ]\n         ])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"X\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Y\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Z\" ] ]\n              ]\n          ]\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 3)\n                  [ Plain [ Str \"Details\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"4\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"5\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"6\" ] ]\n             ]\n         ])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          ]\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"X\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Y\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Z\" ] ]\n              ]\n          ]\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"X\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Y\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Z\" ] ]\n              ]\n          ]\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          ]\n      , TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          ]\n      , TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      2\n      ( \"tables-without-headers\" , [] , [] )\n      [ Str \"Tables\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"Headers\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Para\n      [ Str \"tbody\" , Space , Str \"tags\" , Space , Str \"omitted\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Para [ Str \"empty\" , Space , Str \"head\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Para\n      [ Str \"explicit\"\n      , Space\n      , Str \"body\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"foot\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"4\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"5\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"6\" ] ]\n             ]\n         ])\n  , Header\n      2\n      ( \"colspans-and-rowspans\" , [] , [] )\n      [ Str \"Colspans\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"Rowspans\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 2)\n                  [ Plain\n                      [ Str \"1\" , Space , Str \"and\" , Space , Str \"2\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 3)\n                  [ Plain\n                      [ Str \"4,\"\n                      , Space\n                      , Str \"5,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"6\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , HorizontalRule\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 3)\n                 [ Plain [ Str \"Numbers\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 2)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"1\" , Space , Str \"and\" , Space , Str \"4\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 2 ( \"attributes\" , [] , [] ) [ Str \"Attributes\" ]\n  , Table\n      ( \"attrib-test-table\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [ \"table-head\" ] , [] )\n         [ Row\n             ( \"\" , [ \"table-head-row\" ] , [] )\n             [ Cell\n                 ( \"\" , [] , [ ( \"abbr\" , \"x\" ) ] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 3)\n                 [ Plain [ Str \"Cat\" , Space , Str \"X\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [ \"main\" ] , [ ( \"part\" , \"body\" ) ] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [ ( \"part\" , \"row\" ) ] )\n              [ Cell\n                  ( \"\" , [] , [ ( \"part\" , \"cell\" ) ] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [ ( \"valign\" , \"bottom\" ) ] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [ ( \"style\" , \"color: #151950\" ) ] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [ \"summary\" ] , [] )\n         [ Row\n             ( \"\" , [] , [ ( \"bgcolor\" , \"#ccc\" ) ] )\n             [ Cell\n                 ( \"\" , [] , [ ( \"square\" , \"true\" ) ] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"4\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"5\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"6\" ] ]\n             ]\n         ])\n  , Header\n      2\n      ( \"tag-omission\" , [] , [] )\n      [ Str \"Tag\" , Space , Str \"omission\" ]\n  , Para\n      [ Str \"thead,\"\n      , Space\n      , Str \"tbody,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"tfoot\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"X\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Y\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Z\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"4\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"5\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"6\" ] ]\n             ]\n         ])\n  , Header\n      2\n      ( \"empty-tables\" , [] , [] )\n      [ Str \"Empty\" , Space , Str \"Tables\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"empty.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/insert",
    "content": "STUFF INSERTED\n"
  },
  {
    "path": "test/ipynb/mime.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"id\": \"0ad1fbe7-107b-4668-ae4d-8ce4ae9a4400\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from __future__ import annotations\\n\",\n    \"\\n\",\n    \"from dataclasses import dataclass\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"id\": \"c2d3a9f4-dfdb-4ced-bbcd-3dfd1780af80\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"7.29.0\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import IPython\\n\",\n    \"\\n\",\n    \"print(IPython.__version__)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"21e7a4a1-0cf8-48cc-823c-dca698ae6853\",\n   \"metadata\": {},\n   \"source\": [\n    \"Supported IPython display formatters:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"id\": \"053cdbc4-b157-4e3e-9c86-8f374770d006\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"text/plain\\n\",\n      \"text/html\\n\",\n      \"text/markdown\\n\",\n      \"image/svg+xml\\n\",\n      \"image/png\\n\",\n      \"application/pdf\\n\",\n      \"image/jpeg\\n\",\n      \"text/latex\\n\",\n      \"application/json\\n\",\n      \"application/javascript\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"ip = get_ipython()\\n\",\n    \"for mime in ip.display_formatter.formatters:\\n\",\n    \"    print(mime)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"d79b063d-ce81-497b-a0ea-5b2e2972e845\",\n   \"metadata\": {},\n   \"source\": [\n    \"Let's write a simple class that will output different mime:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"id\": \"c847636c-1c45-432e-9d8d-7310dd7f5637\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"@dataclass\\n\",\n    \"class Mime:\\n\",\n    \"    math: str\\n\",\n    \"\\n\",\n    \"    def _repr_mimebundle_(\\n\",\n    \"        self,\\n\",\n    \"        include: Container[str] | None = None,\\n\",\n    \"        exclude: Container[str] | None = None,\\n\",\n    \"        **kwargs,\\n\",\n    \"    ) -> dict[str, str]:\\n\",\n    \"        string = self.math\\n\",\n    \"        data = {\\n\",\n    \"            \\\"text/plain\\\": string,\\n\",\n    \"            \\\"text/html\\\": (latex := f\\\"\\\\\\\\[{string}\\\\\\\\]\\\"),\\n\",\n    \"            \\\"text/markdown\\\": f\\\"$${string}$$\\\",\\n\",\n    \"            # \\\"image/svg+xml\\\":,\\n\",\n    \"            # \\\"image/png\\\":,\\n\",\n    \"            # \\\"application/pdf\\\":,\\n\",\n    \"            # \\\"image/jpeg\\\":,\\n\",\n    \"            \\\"text/latex\\\": latex,\\n\",\n    \"            # \\\"application/json\\\":,\\n\",\n    \"            # \\\"application/javascript\\\":,\\n\",\n    \"        }\\n\",\n    \"        if include:\\n\",\n    \"            data = {k: v for k, v in data.items() if k in include}\\n\",\n    \"        if exclude:\\n\",\n    \"            data = {k: v for k, v in data.items() if k not in exclude}\\n\",\n    \"        return data\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"id\": \"4fa54f22-0c3a-4809-91f7-ea7101ff1907\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"mime = Mime(\\\"E = mc^2\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"id\": \"c419e6a6-240c-4af0-a244-5f1526705c30\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"data\": {\n      \"text/html\": [\n       \"\\\\[E = mc^2\\\\]\"\n      ],\n      \"text/latex\": [\n       \"\\\\[E = mc^2\\\\]\"\n      ],\n      \"text/markdown\": [\n       \"$$E = mc^2$$\"\n      ],\n      \"text/plain\": [\n       \"E = mc^2\"\n      ]\n     },\n     \"execution_count\": 6,\n     \"metadata\": {},\n     \"output_type\": \"execute_result\"\n    }\n   ],\n   \"source\": [\n    \"mime\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"bf140b8e-16ac-4670-9778-f1c1d9486f9d\",\n   \"metadata\": {},\n   \"source\": [\n    \"Note that #7561 made ipynb reader aware of this, and #7563 made ipynb writer aware of this.\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "test/ipynb/mime.native",
    "content": "[ Div\n    ( \"0ad1fbe7-107b-4668-ae4d-8ce4ae9a4400\"\n    , [ \"cell\" , \"code\" ]\n    , [ ( \"execution_count\" , \"1\" ) ]\n    )\n    [ CodeBlock\n        ( \"\" , [ \"python\" ] , [] )\n        \"from __future__ import annotations\\n\\nfrom dataclasses import dataclass\"\n    ]\n, Div\n    ( \"c2d3a9f4-dfdb-4ced-bbcd-3dfd1780af80\"\n    , [ \"cell\" , \"code\" ]\n    , [ ( \"execution_count\" , \"2\" ) ]\n    )\n    [ CodeBlock\n        ( \"\" , [ \"python\" ] , [] )\n        \"import IPython\\n\\nprint(IPython.__version__)\"\n    , Div\n        ( \"\" , [ \"output\" , \"stream\" , \"stdout\" ] , [] )\n        [ CodeBlock ( \"\" , [] , [] ) \"7.29.0\\n\" ]\n    ]\n, Div\n    ( \"21e7a4a1-0cf8-48cc-823c-dca698ae6853\"\n    , [ \"cell\" , \"markdown\" ]\n    , []\n    )\n    [ Para\n        [ Str \"Supported\"\n        , Space\n        , Str \"IPython\"\n        , Space\n        , Str \"display\"\n        , Space\n        , Str \"formatters:\"\n        ]\n    ]\n, Div\n    ( \"053cdbc4-b157-4e3e-9c86-8f374770d006\"\n    , [ \"cell\" , \"code\" ]\n    , [ ( \"execution_count\" , \"3\" ) ]\n    )\n    [ CodeBlock\n        ( \"\" , [ \"python\" ] , [] )\n        \"ip = get_ipython()\\nfor mime in ip.display_formatter.formatters:\\n    print(mime)\"\n    , Div\n        ( \"\" , [ \"output\" , \"stream\" , \"stdout\" ] , [] )\n        [ CodeBlock\n            ( \"\" , [] , [] )\n            \"text/plain\\ntext/html\\ntext/markdown\\nimage/svg+xml\\nimage/png\\napplication/pdf\\nimage/jpeg\\ntext/latex\\napplication/json\\napplication/javascript\\n\"\n        ]\n    ]\n, Div\n    ( \"d79b063d-ce81-497b-a0ea-5b2e2972e845\"\n    , [ \"cell\" , \"markdown\" ]\n    , []\n    )\n    [ Para\n        [ Str \"Let's\"\n        , Space\n        , Str \"write\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"simple\"\n        , Space\n        , Str \"class\"\n        , Space\n        , Str \"that\"\n        , Space\n        , Str \"will\"\n        , Space\n        , Str \"output\"\n        , Space\n        , Str \"different\"\n        , Space\n        , Str \"mime:\"\n        ]\n    ]\n, Div\n    ( \"c847636c-1c45-432e-9d8d-7310dd7f5637\"\n    , [ \"cell\" , \"code\" ]\n    , [ ( \"execution_count\" , \"4\" ) ]\n    )\n    [ CodeBlock\n        ( \"\" , [ \"python\" ] , [] )\n        \"@dataclass\\nclass Mime:\\n    math: str\\n\\n    def _repr_mimebundle_(\\n        self,\\n        include: Container[str] | None = None,\\n        exclude: Container[str] | None = None,\\n        **kwargs,\\n    ) -> dict[str, str]:\\n        string = self.math\\n        data = {\\n            \\\"text/plain\\\": string,\\n            \\\"text/html\\\": (latex := f\\\"\\\\\\\\[{string}\\\\\\\\]\\\"),\\n            \\\"text/markdown\\\": f\\\"$${string}$$\\\",\\n            # \\\"image/svg+xml\\\":,\\n            # \\\"image/png\\\":,\\n            # \\\"application/pdf\\\":,\\n            # \\\"image/jpeg\\\":,\\n            \\\"text/latex\\\": latex,\\n            # \\\"application/json\\\":,\\n            # \\\"application/javascript\\\":,\\n        }\\n        if include:\\n            data = {k: v for k, v in data.items() if k in include}\\n        if exclude:\\n            data = {k: v for k, v in data.items() if k not in exclude}\\n        return data\"\n    ]\n, Div\n    ( \"4fa54f22-0c3a-4809-91f7-ea7101ff1907\"\n    , [ \"cell\" , \"code\" ]\n    , [ ( \"execution_count\" , \"5\" ) ]\n    )\n    [ CodeBlock\n        ( \"\" , [ \"python\" ] , [] ) \"mime = Mime(\\\"E = mc^2\\\")\"\n    ]\n, Div\n    ( \"c419e6a6-240c-4af0-a244-5f1526705c30\"\n    , [ \"cell\" , \"code\" ]\n    , [ ( \"execution_count\" , \"6\" ) ]\n    )\n    [ CodeBlock ( \"\" , [ \"python\" ] , [] ) \"mime\"\n    , Div\n        ( \"\"\n        , [ \"output\" , \"execute_result\" ]\n        , [ ( \"execution_count\" , \"6\" ) ]\n        )\n        [ RawBlock (Format \"html\") \"\\\\[E = mc^2\\\\]\"\n        , RawBlock (Format \"latex\") \"\\\\[E = mc^2\\\\]\"\n        , RawBlock (Format \"markdown\") \"$$E = mc^2$$\"\n        , CodeBlock ( \"\" , [] , [] ) \"E = mc^2\"\n        ]\n    ]\n, Div\n    ( \"bf140b8e-16ac-4670-9778-f1c1d9486f9d\"\n    , [ \"cell\" , \"markdown\" ]\n    , []\n    )\n    [ Para\n        [ Str \"Note\"\n        , Space\n        , Str \"that\"\n        , Space\n        , Str \"#7561\"\n        , Space\n        , Str \"made\"\n        , Space\n        , Str \"ipynb\"\n        , Space\n        , Str \"reader\"\n        , Space\n        , Str \"aware\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"this,\"\n        , Space\n        , Str \"and\"\n        , Space\n        , Str \"#7563\"\n        , Space\n        , Str \"made\"\n        , Space\n        , Str \"ipynb\"\n        , Space\n        , Str \"writer\"\n        , Space\n        , Str \"aware\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"this.\"\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/ipynb/mime.out.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from __future__ import annotations\\n\",\n    \"\\n\",\n    \"from dataclasses import dataclass\"\n   ],\n   \"id\": \"0ad1fbe7-107b-4668-ae4d-8ce4ae9a4400\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"output_type\": \"stream\",\n     \"name\": \"stdout\",\n     \"text\": [\n      \"7.29.0\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import IPython\\n\",\n    \"\\n\",\n    \"print(IPython.__version__)\"\n   ],\n   \"id\": \"c2d3a9f4-dfdb-4ced-bbcd-3dfd1780af80\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Supported IPython display formatters:\"\n   ],\n   \"id\": \"21e7a4a1-0cf8-48cc-823c-dca698ae6853\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"output_type\": \"stream\",\n     \"name\": \"stdout\",\n     \"text\": [\n      \"text/plain\\n\",\n      \"text/html\\n\",\n      \"text/markdown\\n\",\n      \"image/svg+xml\\n\",\n      \"image/png\\n\",\n      \"application/pdf\\n\",\n      \"image/jpeg\\n\",\n      \"text/latex\\n\",\n      \"application/json\\n\",\n      \"application/javascript\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"ip = get_ipython()\\n\",\n    \"for mime in ip.display_formatter.formatters:\\n\",\n    \"    print(mime)\"\n   ],\n   \"id\": \"053cdbc4-b157-4e3e-9c86-8f374770d006\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Let's write a simple class that will output different mime:\"\n   ],\n   \"id\": \"d79b063d-ce81-497b-a0ea-5b2e2972e845\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"@dataclass\\n\",\n    \"class Mime:\\n\",\n    \"    math: str\\n\",\n    \"\\n\",\n    \"    def _repr_mimebundle_(\\n\",\n    \"        self,\\n\",\n    \"        include: Container[str] | None = None,\\n\",\n    \"        exclude: Container[str] | None = None,\\n\",\n    \"        **kwargs,\\n\",\n    \"    ) -> dict[str, str]:\\n\",\n    \"        string = self.math\\n\",\n    \"        data = {\\n\",\n    \"            \\\"text/plain\\\": string,\\n\",\n    \"            \\\"text/html\\\": (latex := f\\\"\\\\\\\\[{string}\\\\\\\\]\\\"),\\n\",\n    \"            \\\"text/markdown\\\": f\\\"$${string}$$\\\",\\n\",\n    \"            # \\\"image/svg+xml\\\":,\\n\",\n    \"            # \\\"image/png\\\":,\\n\",\n    \"            # \\\"application/pdf\\\":,\\n\",\n    \"            # \\\"image/jpeg\\\":,\\n\",\n    \"            \\\"text/latex\\\": latex,\\n\",\n    \"            # \\\"application/json\\\":,\\n\",\n    \"            # \\\"application/javascript\\\":,\\n\",\n    \"        }\\n\",\n    \"        if include:\\n\",\n    \"            data = {k: v for k, v in data.items() if k in include}\\n\",\n    \"        if exclude:\\n\",\n    \"            data = {k: v for k, v in data.items() if k not in exclude}\\n\",\n    \"        return data\"\n   ],\n   \"id\": \"c847636c-1c45-432e-9d8d-7310dd7f5637\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"mime = Mime(\\\"E = mc^2\\\")\"\n   ],\n   \"id\": \"4fa54f22-0c3a-4809-91f7-ea7101ff1907\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"output_type\": \"execute_result\",\n     \"execution_count\": 6,\n     \"metadata\": {},\n     \"data\": {\n      \"text/html\": [\n       \"\\\\[E = mc^2\\\\]\"\n      ],\n      \"text/latex\": [\n       \"\\\\[E = mc^2\\\\]\"\n      ],\n      \"text/markdown\": [\n       \"$$E = mc^2$$\"\n      ],\n      \"text/plain\": [\n       \"E = mc^2\"\n      ]\n     }\n    }\n   ],\n   \"source\": [\n    \"mime\"\n   ],\n   \"id\": \"c419e6a6-240c-4af0-a244-5f1526705c30\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Note that #7561 made ipynb reader aware of this, and #7563 made ipynb writer aware of this.\"\n   ],\n   \"id\": \"bf140b8e-16ac-4670-9778-f1c1d9486f9d\"\n  }\n ],\n \"nbformat\": 4,\n \"nbformat_minor\": 5,\n \"metadata\": {}\n}\n"
  },
  {
    "path": "test/ipynb/rank.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"id\": \"5cf8f54d-bf3c-4db2-996d-22662a86ad43\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import matplotlib.pyplot as plt\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"id\": \"a0228622-9ff8-4392-9ddd-f70a90f0e106\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"data\": {\n      \"text/html\": \"<p><em>you should see this when converting from ipynb to html instead of the image below.</em></p>\",\n      \"image/png\": \"iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAACdAAAAnQGPcuduAAAASUlEQVR4nGNkYGBgc1HM+/lfkI/hqQ0XAwsDAwPDzSphBi6h/wwlahsgAiJCHxkkBL4zWLA8YGBkYGBgZGBg4GRgYPjDwMDABADgfgxL+wQIRAAAAABJRU5ErkJggg==\\n\",\n      \"text/plain\": [\n       \"<Figure size 4x4 with 1 Axes>\"\n      ]\n     },\n     \"metadata\": {\n      \"needs_background\": \"light\"\n     },\n     \"output_type\": \"display_data\"\n    }\n   ],\n   \"source\": [\n    \"fig, ax = plt.subplots(figsize=(1, 1), dpi=4)\\n\",\n    \"ax.imshow([[0, 1], [2, 3]]);\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.10.0\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "test/ipynb/rank.out.html",
    "content": "<div id=\"5cf8f54d-bf3c-4db2-996d-22662a86ad43\" class=\"cell code\"\ndata-execution_count=\"1\">\n<div class=\"sourceCode\" id=\"cb1\"><pre\nclass=\"sourceCode python\"><code class=\"sourceCode python\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"im\">import</span> matplotlib.pyplot <span class=\"im\">as</span> plt</span></code></pre></div>\n</div>\n<div id=\"a0228622-9ff8-4392-9ddd-f70a90f0e106\" class=\"cell code\"\ndata-execution_count=\"2\">\n<div class=\"sourceCode\" id=\"cb2\"><pre\nclass=\"sourceCode python\"><code class=\"sourceCode python\"><span id=\"cb2-1\"><a href=\"#cb2-1\" aria-hidden=\"true\" tabindex=\"-1\"></a>fig, ax <span class=\"op\">=</span> plt.subplots(figsize<span class=\"op\">=</span>(<span class=\"dv\">1</span>, <span class=\"dv\">1</span>), dpi<span class=\"op\">=</span><span class=\"dv\">4</span>)</span>\n<span id=\"cb2-2\"><a href=\"#cb2-2\" aria-hidden=\"true\" tabindex=\"-1\"></a>ax.imshow([[<span class=\"dv\">0</span>, <span class=\"dv\">1</span>], [<span class=\"dv\">2</span>, <span class=\"dv\">3</span>]])<span class=\"op\">;</span></span></code></pre></div>\n<div class=\"output display_data\">\n<p><em>you should see this when converting from ipynb to html instead of the image below.</em></p>\n</div>\n</div>\n"
  },
  {
    "path": "test/ipynb/simple.in.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"jupyter\",MetaMap (fromList [(\"nbformat\",MetaInlines [Str \"4\"]),(\"nbformat_minor\",MetaInlines [Str \"5\"])]))]})\n[Div (\"uid1\",[\"cell\",\"markdown\"],[])\n [Header 1 (\"lorem-ipsum\",[],[]) [Str \"Lorem\",Space,Str \"ipsum\"]\n ,Para [Strong [Str \"Lorem\",Space,Str \"ipsum\"],Space,Str \"dolor\",Space,Str \"sit\",Space,Str \"amet,\",Space,Str \"consectetur\",Space,Str \"adipiscing\",Space,Str \"elit.\",Space,Str \"Nunc\",Space,Str \"luctus\",SoftBreak,Str \"bibendum\",Space,Str \"felis\",Space,Str \"dictum\",Space,Str \"sodales.\"]]\n,Div (\"uid2\",[\"cell\",\"code\"],[])\n [CodeBlock (\"\",[\"python\"],[]) \"print(\\\"hello\\\")\"]\n,Div (\"uid3\",[\"cell\",\"markdown\"],[])\n [Header 2 (\"pyout\",[],[]) [Str \"Pyout\"]]\n,Div (\"uid4\",[\"cell\",\"code\"],[(\"execution_count\",\"2\")])\n [CodeBlock (\"\",[\"python\"],[]) \"from IPython.display import HTML\\nHTML(\\\"\\\"\\\"\\n<script>\\nconsole.log(\\\"hello\\\");\\n</script>\\n<b>HTML</b>\\n\\\"\\\"\\\")\"\n ,Div (\"uid5\",[\"output\",\"execute_result\"],[(\"execution_count\",\"2\")])\n  [RawBlock (Format \"html\") \"<script>\\nconsole.log(\\\"hello\\\");\\n</script>\\n<b>HTML</b>\\nhello\"]]\n,Div (\"uid6\",[\"cell\",\"markdown\"],[(\"tags\",\"[\\\"foo\\\",\\\"bar\\\"]\")])\n [Header 2 (\"image\",[],[]) [Str \"Image\"]\n ,Para [Str \"This\",Space,Str \"image\",Space,Image (\"\",[],[]) [Str \"the\",Space,Str \"moon\"] (\"lalune.jpg\",\"\"),Space,Str \"will\",Space,Str \"be\",Space,Str \"included\",Space,Str \"as\",Space,Str \"a\",Space,Str \"cell\",SoftBreak,Str \"attachment.\"]]]\n"
  },
  {
    "path": "test/ipynb/simple.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Lorem ipsum\\n\",\n    \"===========\\n\",\n    \"\\n\",\n    \"**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\\n\",\n    \"bibendum felis dictum sodales.\"\n   ],\n   \"id\": \"uid1\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"print(\\\"hello\\\")\"\n   ],\n   \"id\": \"uid2\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Pyout\\n\",\n    \"-----\"\n   ],\n   \"id\": \"uid3\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"output_type\": \"execute_result\",\n     \"execution_count\": 2,\n     \"metadata\": {},\n     \"data\": {\n      \"text/html\": [\n       \"<script>\\n\",\n       \"console.log(\\\"hello\\\");\\n\",\n       \"</script>\\n\",\n       \"<b>HTML</b>\\n\",\n       \"hello\"\n      ]\n     }\n    }\n   ],\n   \"source\": [\n    \"from IPython.display import HTML\\n\",\n    \"HTML(\\\"\\\"\\\"\\n\",\n    \"<script>\\n\",\n    \"console.log(\\\"hello\\\");\\n\",\n    \"</script>\\n\",\n    \"<b>HTML</b>\\n\",\n    \"\\\"\\\"\\\")\"\n   ],\n   \"id\": \"uid4\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {\n    \"tags\": [\n     \"foo\",\n     \"bar\"\n    ]\n   },\n   \"source\": [\n    \"Image\\n\",\n    \"-----\\n\",\n    \"\\n\",\n    \"This image ![the moon](attachment:lalune.jpg) will be included as a cell\\n\",\n    \"attachment.\"\n   ],\n   \"attachments\": {\n    \"lalune.jpg\": {\n     \"image/jpeg\": \"/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU\\nFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgo\\nKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAD6APoDAREA\\nAhEBAxEB/8QAHAAAAAcBAQAAAAAAAAAAAAAAAQIDBAUGBwAI/8QAPhAAAgEDAwIEBAQFAgUFAAMA\\nAQIDAAQRBRIhBjETIkFRB2FxgRQykaEjQlKxwRXwFjNictEIJEPh8SZTgv/EABcBAQEBAQAAAAAA\\nAAAAAAAAAAABAgT/xAAbEQEBAQEAAwEAAAAAAAAAAAAAARECEiExQf/aAAwDAQACEQMRAD8A2t0Y\\noQpwT2qVzMV+N3UHgrDY2eoM0y58VEbgfp9K1yMRmnuJ5h40jyYHGSeKrWE8u2QAApOMdqGCsmT8\\nh70TAJwMAZx249aKBy4c9vTNUC0zDCgmmmG7Ockjkj1PrUTAjcy5XP0ouCgHae4IomOJHhgIc55P\\nHY0Uk5IXLMcUBQ27n96JYO2MYLebHtRBA7BcMx29sdxQJqwZRtIP+BQKpjHHc+xzigNGoAO/k+nP\\nAoAYlee5oBiGeWySO9AJCgY5PHagFCADzj2GaA2N2TkjA/U0HMwbPPeiyBLDfkkj04FCl1cBMgn6\\nURwYFGySR6D2oAeQDAxnHGKAhU4IbGc+tFwnwDj9aK7f8v2oNu+IHxNvJdXmt9EmKWSqArA/mPvx\\nUxMZNe3Ml1dvNcMzSSEsxPOferJhht/OWyAPc0UfdgDcuM8n50AMCykZFARsngcY/egTcbjnJz9O\\n9AB2kZGSQOcUCX8x83bntQCMruJ4B7D1oCyOGzxtJ9M80CAdg5UjFE0aFJrghLeNpHY4IRdx/QUN\\nWCw6D6q1EZttEvirHAZ4ig/U4qw1b9H+CHVN3Mq6hJaWMJ5ZjJ4hA/7R3P3q3ET+pf8Ap/lWNm03\\nXkkkA8qTW+3PHupP9qxopV78G+s7VSV0+OcAn/kzqSfscVvIKzqPTWu6XKE1LSL+Bhz5oDg/cd6l\\nEZzGwLrtPqrA8frUCJfcw9gfegUjZsEAffNADyHt78UAjCjzDJxRcO5Pw3gwCGOVJQp8ZncMGOeN\\noxwMY96GCbQffFFcUXKjDDt2NEo+N3yyM5z3okKuqJgIzONoJyuMGi4QfGcqSfXBoYHJx659qKIR\\nnnsfUGgJn/poJYoTIGLY+eDzQFlQK2G/KCTmgbspfO0qce/agPGcR7nHf9vnQFfBPlOc88Gg7uuc\\nc/M0Bd208YJJweKAYrea4kKQICRGW5IUYUZJ570DYqcknt3FE0VuVyDzj1oamOlulda6puvC0a0e\\nZVIWSbtGn1Y1NNbX0x8ENH0qL8X1NdtqDoNxiQbIh8u+WpqL70Tc6fcxypouiRadbW8hhLFFXcB7\\nEdz+tNFvEZxkmmgShbA9PlUA+Hgg/wBqDgmBkd6ArJuJBGR7VdEdqWgaVqMfh6hp9pcLj/5Ig2Ka\\nKJrvwW6S1EFoLaWwmPIe2fAz81ORTRm3UfwI1mzBbRL+K/ReyS/w3x/b+1Wexmev9O6xoE2zWdOu\\nbUDszr5T9G7H9auCJj2n3PPrUXTlGBB2kYx96GlQMjJJHuRRXBgDgk8DtRKH8w4OfYA0SUlIMsFX\\nJ4oujHH8ufnRRGOSNoJNAeFC77F2jPucfvQFEqgY3nj/AKaCUY58wwq54AoCzOmVMke9QeRnGR7Z\\noEIF7pnaTk49KDpSSwQntQJsGKjgggZ9uDQc4OOe1Am2UCkHOR7dqA8t/cSW8MEkrGGEsUTPCk4z\\nj9KJT3pzQtS6m1aPT9Jh8SVxlmJwqL/UfYURuuhfArR7f8NLrF1cXciKDJCrbI2b7c4+9NGtaRpt\\nrpdqltYW0VtAn5Y41wBUodvGjqUdQyn0YZqAIreOBFSFFRF7BQAKA1xcRwKplcJuOBn1NAR7y2ik\\nWMzoZnGVQHJNAuQcD3oBKkD2FBy8jnvQFxnjjmg4rxwKBMqCBtPNA3vbCC+tngvYo54HGGSRQQR9\\nDV0Y91n8DNOvFkuOmZmsrk5PgSNuiY98D1X+1XRhWu6DqWgX72er2j2069t/ZvmD2IoGG7jbnj1F\\nFlB224PB+VClN4DYJHyAojmPGCck8cetCAxgjPp6UaAGKtx6+9ATAXO7nFBw8HHLN+goJhBuj2Fe\\nAcnmgNazW8U0vjweODGyqpYrsYjytx3x3oGa5LEEjH9XvQGlgmjjMmQq4HBPfPYgevagG5nhe3tk\\nFuInQHxJQTmQntn0wKBKTlAeDx60DSY+U9zn+mgsnQvROr9Y3W2xi8KxV8SXUnCrjvj1Y/IUR6c6\\nA6H03o6wMVgrSXMoBmuX/NIf8Djt/eiLfjJwO9ZBiOfmKDhktzQAzYBLZ8oyaDF+rOptVv8AUjNZ\\nL4tjA/lT+kr3wvqTQX/pi3Y+DqFxKXurmFWAaPaVzg4I/b0oHlxqV7penRTXFu93dPLsESYB2k8n\\n7CgnradLq1WaIOFI/K42sPkRQCg3Kcd6Dgp3d6AdrGg5VxnjmgKWB8uQGxnFAUgKuSefSghuqNC0\\njXbAWGtxQyJKdsYc4YMf6T6GtDzR8S/hnqfSUz3NvuvNILYSZR5o+ezj/Pb6UGfLzyD/AJoFFySQ\\nVBHpQDJ5kGByPahAbWxn5+po0OF3D+XPtQJsNwOe+aAuygmMkebgHnHFALHYpJwSeGz2oGpOJWAI\\n49BQEZlYAHkg4oARVOMvtBIJJ7AUAX6xxSOsUgmjViFcKRuHviiVfvhT8NZuqpk1LVFeHRkPlHZp\\nznsP+n50qPS+mWVppdnFa2cEcFtGu1I41ChR8qyHVxK8cLPDD4kgGVQHBNAa0maaBJGTYzDJXOcU\\nCy5JOaA2OMfoaArkheM7vlQNYNOtoWLJCgLHJwo5NApPKLaNpGRQB6j2oGmnRvcyNd3O/DkeErLh\\nkWgklIdCyZOCRzxzQEeRxhdpUnncBkD5UCxXjJ7+tAlctMsIMLohz5mcZAH09aBQYdQwyAeaAuA7\\nMAQxHH0oG1481nbGVInuWU5Kr+bHrgepoKB1u+o6jqlvBH05NevEBPBK0pQR4I4BHZj+1Bb9IS7l\\nsFtNWtYwDGFYB/EXHqpJ7/WtQYx8VfhGbdZtV6Uh8gy81mpyR6koPb5UGKY4YkeYd88fbFAI5AC9\\n8c5oQBb+U9+9GnN5RgDgjOPWgAN3yMfWgAqc91/UUD2RSSRg9+49KCR6e0WfX9WS0icRwgb55WOF\\nijH5nP0FBYNRi6dSR7HRNPmu0hOW1GaXaZMdwBwAP3oynE0XRYrFtV02wS4ECj8dp1wcsE7eJEf3\\n9qlFZ616ZttPu7Kbp9Zbi0vYzNCcgjHqoHuKsEp8LPh7P1PqjXerxywaXaviRSu1pWH8g+XuflQe\\nmIIY7S3SK3hVIo12pGoAAA7AClEL1N1RH0/oTalcwx+IACLaSQKx59Ppmshv0D1jH1ZbTubU27xk\\nkAnKsuSMg/UUFluLlLaJXETyecKAg554zigXiubeRnSKeJ5FOGVXBIPsaBLULoWkIfw3kYsAqIOS\\nTQJMbpm3oqlmwACeF9yfn+1A+Bx34oE5IY5P+YFbnPIzQKAckHuRQCAQOO1AL8r9KDhkZOT9M8UC\\ncrxgAyYJzwD70CT3Itxm8kgi3fly+P7/AOKA9pskhEkZysnOfeg6RH8w3tgjAHtQRZ1uystSg0m5\\neRJ2UbHceV8fP3oJkBSAVII9xQFdSRwKDDvjN8L/AMSJte6chxcgFrm1QcSf9aj39x61YMH8Q+Ck\\nfhqpQncxBDH5H6VRwXJ/Ke1Am2QchuMYOaNFSAVznB9qAm8f10D2RmX8jDHP3oLbebtA6ej0m2Lr\\nfX6LcX7IMskf8kf6HcffIoG8yTadZxSTxCK3kRZUwSFfkruIJ78GhiS6Y1OS3160uZJFWO5bwZtx\\nzuQ8bcfPNMZXvo2wsLnQ9R0q/maJNNv5Yo3bjCuMAHPzqA2jdUan0lF0/ZXcElxp9zE+5WVd/DE7\\n1IPPB7H2po1bSNXsdYthLp1ykyEcj+ZT817ioITrnoux6vs1gv5JYnjz4ckZ/Ln5etA+6N0BemdB\\nttMina4WEFfFdQpIJJ7D60E5I4Vo9qnnsQO1A3k0yzeTxhCizZJ3qNpz9RQO449igMSxHGW5NAIw\\nBtUAUAMORkfegMhG3jtQD8+fvQGXJz7UAHuRQA5YDI5FB0qCQA5yaCs2/SFit/Jd3AmvJ2bO64ct\\nt5zwD2oLMilVAUDgcAelAJLbhgZz3oGN9HPIYmhtrWRw2czjt7Y+dA+h3mJS67W9gc0AvuLYANAD\\npkZABHY85oPOnxy+Hx06Z+odGjC2jt/7qBRwjH+cY9D6/OrKMebcceHwfaqCYIyDgZ96GhHOFJI4\\n/WjQpXnsaCz9J6fDqGvRC8OLO3Vri5PB/hqMkfc4H3oDT3UupapcXrKS9zISgDdhnAGPbsKC5aLL\\nBHq9p01c6bbagPE23kpJYhmz5IySAAMj6nNGdRnT2lu3V9vaQQrJDHfCMFj5kAfufsMUFogu5H0j\\nrLUYXK+Lq0aRse/lf/8AOKlFfudagvbnQpNQRmtILydCwPdCQcgMOMZFQanPoeiawBd9M6s9jeKP\\nK1vKQp+RFA4septa6fuFtuqbRrmzx5b+BAdo927A+vsflQXfTr2z1O3W5025juIW/mjOR9KAZI91\\n4khaRNo4XdwT9KAl3b2+oWpjMoZWbOVfnI9sUCrXUNssUU8w3sQoJH5jQLvwQQC3NAKvuUPtK54w\\naDg23v6UA7weBnNAIOBigMr+hoOjdZQdhBx3waAVG0Z7UBWfAOQSflQChyNxBAxQRutarb6bHALi\\n9trSW4kEcJnGd7ewFA/j8QEK/IA/MBjmgWDDBB7igj9dupLTTbiaHZ4oQ7A7bQW9ATVgwXSNV6on\\nl8azW6t45pWdxHIxWA/zNtz7A8Glg2S1u7fX+nt0J/H2c4MMhmQoW9GBUjj60g8sfEHpebpDqi4s\\nHLG2Y77eQ486E8fcdvtVFekGW4UfegKVAAKgnFGhuDzxQXbpDTZF6a13UnUqrCOzQ5wGZmXIJ+lE\\n0ppkEK6nJcRWcTW9hA08iKcjcowpye/mxQ0+6VRbC/jvLm48L8LG9y8pIOXxkDnuSTipqHXQMng3\\nes9S3fhn8DbvcZI5Mr/lH700dc3Dad8NtPs4nU6jeXD6nMCwBRF5XOfU8YHrTNJFF1X8RawW1jc4\\nGxTKNrZB385yPkBTFw1stSu7Ni9tPLGSQfK5Aphi8J8UNUm6fn0u72yvJ5fGbuF/39aYYtGgadp9\\n/axXnRetzaXqnhqZI3bEcj4547Ak/X6UxFisPiXe6NMdO65057eQAr+LhUlHHbOPX07UwWXpQ6Bq\\nMo1LpgW0sioVI8Qgxk+684qC028M5890Y3kHKbUwF+lA4LDOzu2M4FAOG3DaoI9cntQdJxzQEyR2\\n59f/AKoGl5fSQRFo7ZpB/MhYIR9zxQdayyXKb7gqox5Yo2yB9WHc0DPUIWnhWKxkuYFRs5gcKWbP\\nY59KBkx6isVeSGW31JNwHhyOUkA+o8v9qCfjkMo/LJFKqBmRvSgc2swnRyFcYODuXGfpQMtRsLK8\\nvYJL+wjuGiUtHK6hghz6Z7H6UEmCsig84I9RigiruC9t0DaaVmIIHhTOQMeuGwT9qCJ1ywv9T0U2\\n9xFFiaVBJGHz5M5ODgYPY/arKJPTtLW1t44i7SKq48w8x+ZPrTRJoipGFQAAdgKgzX47dMJrXSrX\\nkUe6807MykDkp/MP8/aro80FQyZ+tUJ7hvH0x270XQ7KGtXvIk0T4c9P2bIhkvpnvJVfjIxhf7qf\\ntRDXpu0/1DpzXltUlkvmWMBI+2zdnn64oYa6yX0XTm0i4jQ3t6wmuV53xov5UPpyeeKyLbpFtZ6X\\npmn6TqNq7/ic6pqQRR/DVf8Alq2fTOP0FXBnXU+ox32o3lzeW+JrxlMXHKR9wfbJ/tVWK5f3AnaA\\njafCTwwcY4BOM/qKKSjA4Dg8j37UHZKkE5P0olSFlcLDdJPbTNBOigjxOVZu3+80Rbbnrq9l0t9I\\n6isRd2rgKpPlZMdyre9An07oupoh1zo2+lea2fMlr+WZFx7ZwwqWDVug/ihDq7R6b1EPwmpMNokP\\nlVj8xng1BqEUe1EAJOMDOc5oDSxq6YYeuaAJF4oCBUQ7mJ45zQHYB14wR86AVjBXyjge1AEcRTHl\\nA9hQE8kbgEohJ5yQM0ETHNqMOr3IZQ9tIMQyEjKt7D3FBLqywRPJKTuxlj3zQI3Ut14e+yhWRj28\\nQ7RjH60EfpF3rU/jLqFrHbS4/hqpJXH19aCRa8jgiVr1xGwXzYyf99qA9tc29/aRXFnKs1vINyOO\\n2KByoxwe9AYocHGKBvdwLcWzxSLuR1KuD6gjBoPHXWujt071Nf6YSSkUnkJ4yp5H7f2rQgWAA3Y+\\n1An4j/1t+tBrHxKuYS+gx24LRx6ZFtI/lz60FY0+/v8ASphNpd68EpXY5AGNvzFF1YOirZbzVrvX\\n9dkNxZWH8eeaY5Lyj8qj7kcVlETqOqXd/HrPUNzcNE16Tbwxf1JkEgD2AA/etBte9R2Oq2cv+p6X\\nHJfBFjgmjkMaRgAAEqO5o1FWfbgjsR8+9AlI5CgEggeoNAq0iug8uD7g80KKmCcZ7fPmjJzJfT/h\\nWtjJvhOPK/OOe49u9A96X1W90/VrRtNkkSfxQF8I5yScdvX6UGidSLpfVFzcvbRiy6kgZBGysFW7\\nB9T7HHNSjU+o9S1iz0e2uNLmX8RYxJ+KgYeVwVGTn5d6gjug/iU3UOt/6TewQpP59skL5B29x/8A\\nYoNHPB78Ggb2l3bXO78PKsoyVyvIBHBFAoSkbfyhn4GfWgTnmWFN7ybAvc4Jz9hQRdx1dp0S3Dw+\\nJJHbDdPIUZUjX3yRz9Bmrgzbqb4x9Oxho4bB751O5HPkXPsc80wQHT/xrJ1IHUbGKO0kdRiBiAgz\\n+YjnsPpTKN/tLy3vLOK5t5klt5F3LKhyCPemAYLuK5XMDEj1OCP71ArGWLMPT0oIbU7h11u2t49O\\nllWWNm/FIRsjI4AI/egfQ2ktpbww2XgxoDl9wJ49cUCHUGv2GixM13Mkcm0squwUH5/SrgxDW/jF\\ncXOteHb3otrKEEiRISRM3zGc49v1qDT+gfiBpvV7y2unxTxywRhz4ozuHbOR2+9Bmf8A6kNIEWpa\\nZqiooEqtBIR6kHI/atfRjDEt3AKjgVQjug9j+lQWh72e/htTOzyeCnhHPomeMYoJvQum7vVD47K9\\njpsQBkvZ5NoAHcgUAa7rKamE0Lp9Xh0G1OZZTwZSO8jn9cCsivdS38F9cJDZIY7G2URxKe5x/MT7\\nnNaEKrENwAFPPlosFwS2cd/cc0UlIm3JOeKDo2LH+UA0SjgDk98URzPiJ2449e/NAbS7v8PdpKkp\\nikQ5WQLkqccGgmYNQmXWLeQLG9wVRQVPlcj+Yn3xQa98OviAjz3WjdXSpFdliEuJCNjDtsJ7enep\\nRdel+kdL0rqOTVdIsoYklV1dixO3nunpg9jUCnU3WMeka5b2EUcl3JInmigQs6ZPlJAHY8+vpQP9\\nO1m3nthNo0cTwM2JDwoVj6H5gd6CbhtUiVn8TcXO4ktkZ+We1BAf8Z6fZ2uqXWpyxQrbStGseQzM\\nB2IA961B59+IHXmodXal+HsPFh04HbHCo25+bY/zQWv4f/CCxvII73qC8iuXYb1tYZeF9txHf6U3\\nBatX+DvSl86x6cr2dwjbnEUmcj6Enj6U8hLdJdEX/SmowJp2tTT6Oc+La3HO0442+3NBf1LmRUjj\\nQAfmc+nyHvWQockYyQcY3CgaabaPZxGNnaUFi3mPb6f+KA2q3RstNurnBxDE0mPfCk1YPMemaP1L\\n8RtYN9fJPc2aMUaVmCKg54H0z6VRYendf6Z6T1W56a6j6fgfwJyguhGJmPzbIzjHtSjTn0zSunbi\\n01fSkt9Os5GAmWNCDOGxtXb6HnNZEZ8etOF90DPKFy1rKk3zAzg/3rXI8u7zvOTg4zVoTLDJ81QW\\nDTb2SwuvFgcrkbXwM5H0PFGqsjpd6+kcT61Nc2ieb8OikFc/9PA+WfSjKA1nWBzpFlZ/hLWM4KH8\\nzsPVj6mghN4IyQRk5NGo5BkFmyAfSgVjChdpGO/FAXYpOHLBe/FAQqoBJbA9sUBGxgtgEj/eaCf6\\nDGjt1TZf8RNGumKS7mQZQkDIB+WaMrf8Ub/ovV7V20JIYL62K4khhCLOCcEcAdu9BmCuEQvxvyFU\\ng42+v+/rQaj0zax/EXRY9Nns0t9TtM+BqCKAjEclXA98jn+1Si7Cz6u6O0tLjTrxLu2tQJJrDwcK\\nE/m2M2SfeoLrpupDV9Mh1OytUS2vIN8m4BZQf6T7+vPpj50GfdK9L6rJqk1y1y0elRDKRqdjHHoy\\nDhjx39e9BZr7fagW0j3kul3iETRqHkeF8ZBUjkZIxjtk5rQ86dW6r+O1OcW0UtvaRsY4oWfLKBxz\\n7k/5NA46P6X1rqS6WPS7V9v88rAqi/f3oN46X6C1DSotkus+BIwKl8hn2+3PapROXPT2t20bPY6k\\nJ5UGYmbIfIHGW5z68VBI6DrzzWSrrAjtrwFUbDja5OBlfuaCbluJLeNwIpLiVF3bVXAP0Pv8qBxL\\nO8cYcW7vnuqkAigNFKs8CyxlwG/lcYI+1A31ayF/pt1auSFmiaM/LIxVgwfoO413o3qqfSLyUSwo\\ndogAyZVGcbPTPr71aNDvendJ6wtbu7Fi1lezK0bS4VZMjtnFZE0bC5u9Jh0qRAr2yw4uWx59vBI4\\n4PegN1tpbap0lqOk2sipLPB4aFsnHbBNOR5A1exFhqFxbeKkngyMhdOxIPcVuhiZFz/zBUEwcKvY\\nnP6fWi0+6chjn6h062uATFLcRrIMnzAsO9EehNR+GvTV3GUh0+O2YsGaWHIf9amjIfib0no3S0Vt\\nFY3M000zMzLJtLKvvkenyx96oz0rwNjA8cj2osFLbVAbOc9jRQiXOAwxnj3oBlAxwDj37UDY+vHO\\nQeTQBIdqjcPMfnQwJclWyBgCjJBFeefw4VaVycBUGST2wAKD0L8H9C1rSIILjWLSCytY1lZASVnl\\nL4PI/wD8+vvUo1uwbxI5GkjdVc7isvOBjtj2qBWKFZiQ8CJCB5FHYj5jHFArDbQ20ey3RY1HOAOP\\nsKCH1u61CPSLt9MtlXUHUrbCbJBbPdtvYetXR5T1y2udD6lni1ErJdJLvlK4wWOCePvVgsV/8Sr6\\n7UW1vA0NiowIonMe4+7FeT9ARQRmodWa9EYpPBhs1Tygw26rk9xknkn70EjonxZ17TXjAeKTkZ3L\\n+YZ7N8vpSjX+lOpNM6umgkMG3EgBV1DYbG4kewz2NZGkC43CP8MPFBONysMAD50DaHVH8S6N1a+B\\naxMUjd280pA5wPb296DrXWLK9WNoJdtwybxDKPDcAnHIoJBifTBzzmgaz2UFzPFNNbwvLCcxuygl\\nT7igdRRKg8qAZ5JAAzQEnuYoHiSWQIZW2ID/ADH2H6UERr12BY6hueIQJaO7SK/nHfnHtx3pyPGW\\noN4jynuCfU963RF+DL/UtQWTkjaWY/8ATnHFGql+j1VerdJY8r+KiJz/ANwoy9C/EjqSbpbRY723\\nRJC8ojIcZ4IJ/wAVkecer9en1+9FzeLCCq4URjgDP7mtLhteadBY2kMczyHUpcO0YxtiUjgH/q9c\\nelAiLy1kjCX1ruyMLNGdrj0+h+lE0+t+kNQltJ7yKS3jgiTxUFw/hySp7qp70NV6YEBgWUNjBoaK\\neAODnHrRoVgDnBP0ozpxZ2f4y5trVeGuJFiBPpk4zQep9C0LTembS30fQbWP8ZsDyTugZgf6ix9f\\nYZpbgmbXSmXULaa6kMzpltzcjJ//AGpaLCY1CDsF74PrUCgHY0HbSx7Z96BGUfxB2xjtQZ11t0Tb\\n6jNfyw2wM18gV5AcBdpzyPnV0Yp1F0o/TEczXjXaTOQYpIk3QlT3B9Rj0zVl0VKbVppImheUSwbs\\ngFfXHc0De0tri/ujFYQSSyfmKopPHqaDV/g9p+padr/gkSRTzKu0kZRlPLYPbOPf2pg9GWzRCMJA\\nFxH5do4wayKX1z/G0CdzqLWRkiaTxQBLudclQvovbv3oMU/4Z67uwnUAt3u1Zw42yhmx3/Ln8v0o\\nN86L1d00i3i1UiGQIocNnEbnkqT2xgiguEbI4DIysp7EHNAZnxQQ/Usksej3EsCl5EUthR5sY52/\\nMjigr6Qrp3R15LqEcIlmgdpFGAsY2navPJApyPJtwd8rnGBuJz6Gt0MzGSTyf0qCwSKA5ZsAjnn2\\notTXQYj/AOMNIDqCrXUZwf8AuGDRG6fF6Gyfo6+ub0CR4EPgIScLIeAcfc1keatN0661a+S3sYTP\\nKzAbV9B7/StLrQ/iXp9pYLp8elWsUM11AzXMqt53I7g7j244oiB6W6Tn6j2TeAy2FspTeB+Z+/8A\\nmgtnWlvpdl1Dp1pq07Ja20GFQpuDHHAwPf39KDHriVTKSPOCeBnHHtQGsrG5v5pfwcTOIlMjgEeV\\nfck0XRIreS7uUigRpJXOEVe5PtRE/wBJ9HaxqvUcdhNFJp0lviaSWVcMgzxgdySeBipo9T6O8Npp\\nUJ1K4iW5KgSvIyqxb5jPH0paJm1NvKivE6Mp7MpyP1FQLRTwy58F0cjuAckfagOTtO3+Y8igMWCI\\nWbOPlzQNhNBOWEbq5Q+YKc4+tAD7JEZgQfXj0oI/VtIttXsZLW5hRopByCP/ADVlGRa78Erae63a\\nXK1tG3LAncM/Kmh10l8IZdBv4rxtTE0yggJsyoz6/P0po0zSNKEMdo9xGnjxuzkqMAEgjj7Gmial\\njWQMgyCRyQcGoITqHT7q/a30+G2jFmwLSzl8GPBGFA9c5NBPRwJDbpHCipEi4CjtigqfWltqCaG8\\nWhNbxyzOBIs8W8FcY4+dWQQ/wtuZdIGqadrknhy2u2QyOSEZOeRngY+XvTBZZevOmhC8janbqiZ5\\n3Zzj2FMFcs+sh1ZqsFrp8UkGkrlpbh+DNzhVX5Z5NQTfXyWUXSV2t+wW3EZ5I4HHt61eYPI0mA5C\\n9snFaoLsPv8AvUEk5JcA8cZG480WnOlXX4PVLO4yQ0cyP244Yf8AiiPUfUump1B0/c2O8xfi4v8A\\nmL3UcGpgw/SujNX0Trj8PpckimOMvHO/kEg9Rjs3PpV0aFq/Qqa1ZJ/qcrverEqNOwGM+uMfemiV\\ntrKbQdMNjp9rvtkhPht6mU5yT8u1BkvXg1qXUtOvddgRY1R3j2YHiMvZSD27CgzSCyuNQ1KK0giL\\n3Mz4VAOc/wDignoNNOnaHeiW8hgkku/Al2+Ziqgn09M0ETp0qpqSmGKOdFcEeLwMfPHag3JLuCRt\\nPmQWsDhNphtVAcn1w3BPFSwDdWGpX1/OYdOtbbSrlQ80szHdn0GR24/c1AbWemdatLbTJdGvJIJy\\npDQwMV3exwOPatSz9Ei/R+txy2mr3evyHV4miWIDhGwwyGA7nGRS2YNZAUBWYDdjGayEvxMYB3nY\\nu4KCfU+woG93c2enWs1xcPFDCp8zEgDPzq4GGgz22saS1zZSZhkdsFePXt86YHWmySeLNDMYikZ4\\nYNlvvUD+VARxQJqgwRQHUAAe2O1AWOFRM8mDlgB37fagb6reXFt4ItLZJnZsuWfaI0Hdjwcn2FAz\\n0nWX1i4u4xY3VpFbv4eZ1x4vGdy/KgkriN2aMRlQoOW3DOR/5qwYr1P1tp2pdS3WnanKkGh24kRl\\n2eaYgcb/AFxnnAqiv9Jno0dRLJPbtdQtkNPIALaMnODsPPpSjbdK0DTbWQXui+Gsco3BU5hPP5gP\\nT7VkU74t6PZHpq/1N5ZZbwrtRnmOwDPOFJwPsK1xR5ybudw788VaC5X2WoJRULSBpAe5PA/aiinA\\nZnHck4A70THq/Qr23/4Y0u4lmCpLBGA7epxjH60Du+WGOBvFlFuWOFcYyCfbPrUojri6k06xX8PF\\nNfBUJ3ltzM3scVBjfVvVXVNit5dapNDZGQGK3shjeAe7YHIwAOT3zVggNTiu+orrR4p7m+upJFR7\\nh3TPhggDaoBwRjnPH5hV0af0xotnoD3l5dWdrY2YjGLhwPEHoef996CC6m0HpuPpk3Wny2s9sJPH\\nJ3AeI2D39T37UGU9QTDULuGPSLPwIyoVIYk2lj6/X70G2/DPp0hVudRuBLcwxhRGkeEjB9M+p96D\\nSLprVHiieaAE+YxHkke4H1qUOIBawL4uAuc8nvj71AwjRtQ1eO78QNp9odyLju/qT8uf70Gb6r8S\\npLzryy0vp+4NxYSSCEswI2u2Rn3OOD9qC4dVamen9NlaC7tUaIFvCmnHiy4HJXJxnOeDVwed+rOv\\nLnqSyWO4jZSru/kc7ck+30GKosXw2+KmqaDJDY3jR3OmqNoRhtZAP6SP7Ggtmt63qbTJ1XLazJps\\nlwBFblypEOAA7L2OWANS+xrnR2vW3UmjJeWp8wJSRf6WHeoJdSPMCRmgMq8DmgBpNsgUIxBGSccD\\n70DczmS8MDWoe28MN4+f588rj980CktuJZYpFdlKZ4B4OfegQ1hpIrVjbsRMBhBj8x9qsHnX/hm3\\n6y1O/u9V1ddPmS6aD8OkQdyxOSe4OMmqLUvwQsYY4Xjv7m4YEEhwFyMY7fXB5pRbvhp0jqfSMV7b\\n6jqZvLGQAwxAEBDk54PuD6VkVb49a5DBpiaNaeF/FIaQDumOwpzMGDEZQZ5+VboR8In1I+9QWDY6\\ngFn7jjHpQhtJEFbAGBnijT0P8H7qPVOh47a42yNaymPBOcDupoykep+m73V7g/8Av2itQowvJIx6\\nj5/OpRjfUWrax051RPY6LqFy8YACkebO4Z7HjNWCY0ToW2utJbqPreW5na4O4R78cehY9+fQVKLX\\n05p1ro97awC4kX8VFmJLeEKdoyfOxJPbHbHYVAz0rqKPWNauri9t1ktJgILYgEiNFJ/Op9STmrBB\\ndeaFCo0y3jt444DI3jLE204Y5DD+9UPPhv0NaRtPq99mSLOy22nOfdh75oNC0vT7m1uJGvGiii3A\\nW8UDbQAeDu9zUohLlhouqap1VciF4I1FtbxSthtobBIPuTn7VBJ2vUth1TYk2ULi9iALwyKQYz6Z\\n9CM0Ft060/DWEcDHe2Mucdye9BFW3SekWt3LPb2cUTsd2UGCG9x7VYMzufhzdX/WmoXj+BPpx3I7\\nXZMmXYckc8EVRKaP8I+nXikLQuxOQSTnBzj6UEjonw90XSrq3S3s7dplJcl1EhGDx396lFx1TQ4N\\nVjaC7UNCU2lAO/8AvNWDCLp9X+E/WgWImXSp2LRq7eSRT3B9iP8AFSjd9P1+21TRodVsMS2rLmTb\\nyUGOePXFQSltcLcW0c1vh4mXcjDswoDLdRm4FvISsgXeTghDzjAPbPyzmgVFxCzuiOC0WN3sM+5o\\nDqySJmNg3rx7UFb60tNUubGJdFdEvhIdryflUFSM49TVgyTQenJemOorf/U4H1Fpp1edAh/hOQTu\\nQ9375JA4q0bnbPBcxxT20wkjKkqYzlT9ayGWu38um2MbLEJ7iRtoUds+/wAgBzQeW/iHqi6j1Pdz\\neL44HkL9txHtWhVUOVyvHNB2F9zQT8hUAhAdp5FCG0mSAzE4HGDRppvwL1bwOpJbEsFiuYyVX3de\\nR98Zoy2ZtRgmjkSRZocEp51K7se3vUow/rfpFE124mVpfD4mk2MWdCc4A+VWCH1281/UmFnpklzP\\nYRFBEG8uGC4yQfcn9alGgaJo95rRsbi53WaxwrHOm7BjYcHnvz/moJaw07pXSI5IW1K0CQnDhpAW\\nB9R796CudY62msTRW+gadI8KnDXMkLLv9MA8HGOKC3dAXF1dRfh75f41moi4G0AdwcfTj7UFhv7R\\njqMBV5AJFZHkR8FRjIx6CgpXVNjJ1JqNn07p26CztSJLlpIydyj2J+fGaC+afplrazqLa3SKNIgg\\nx3IHYUEsBk4wQc4oK11L1z070/M9rql6wuVA3QopLcjNBDwfFboqeSO2W7kQNxuaEhQfnQLt8Tui\\nreVoV1UeXnckTFT9DigHRuv+mbu9ZV1W3Nyc4IRlVl9O47/KgtU+s6baw+JcX1umRkAuM/p3oK/1\\nt0rYdX6cqXKESqN8Ug/Mp9P1qwZ702mo9GdUTWJsmOn3EY8CAORGXJAwScjJ5q0bJDNLb6YklxbK\\nsgA3wwndg9sDtWQN3aw3ZKTwLLEQOGORn6ehoG1vYAw3FikRt7JSuH3Hc/GSc5P0oHn4aO2uGuYy\\niose044wBQIm6F1dwfh5ARs8R8L2BHGfnQHv9PS4PjxrGLtFKxysm4qD3oCxboIIo7e1jhQHzAYU\\nJ8wP8VYM56j1ktaal1BMrS2sAaK1OQDD6eUepY9yfQVR5zv7hrmaSaRtzyHJY0DcE4BPIPb5UBwO\\nO4oJYzFvzEYHAH9XvQhNZN7AEgDOSDRo/wBA1SXRdVtNQgb/AJUgfBHcZ/8AGaGPVlhPbarZ2t5C\\nEeORBKje2RUrI1zYxTBhMinIwcjvUEcugWkO4AMisMEA8N69u3yoERrOhWNxNYy6hapcxAeJHM+D\\n8u9ASLStLlm/EWdpZyxy+Z3RQ3I5B44oJKTT4blFWSNBEOeBg5+goFYbOK1TKhIxnIbGMH50Cpcy\\no6AMrIcM2OD68Ggb6Lbbllu5Cd88hYBu6rztWglSNkfm4P70Gaat8Rba96w0vp3R2mhufxyi4kO3\\nYyDOV9+f8VYMw+P0cP8Ax4JVuEKzW8bEr5tuMj0+lUZ7Y2X4288GK+towRlZXYqv9uKCQi6YmbT2\\nu11GzaJWKnYxbBB49KCFnhubdiwL+U8OhP60ElpXUFxY6nDdXQF0qYbZKxwT9vWg3npb42aHcmC1\\n1C3uLSQjEkpIdQfr3xUondP6x6e6tv7e101hczRzrNtaFiFC/wAxPYHtUF+lj8bYCTgMG59cUC4O\\nBQQOo2eoXepFTeL/AKYQN1sEwWx6Fu+DQLX2kw3Ok3Vjas9qJ48Exd1PHb9KCE6R0G86Ut7mK71K\\nK4gklM7TyKRIBjtjtjj96AOreudJsrMJbXksk8jBCbVdzRjONxBHP/3QQ9x1jcWGkERWWqXdpMPC\\nt7x4wfFOOWPbA+fAqwZr8TJ9Qbp2ymvEjsrSTEVvawyHz45Lv6E4wPqaoyl8g91OKDlYEc8mgKW5\\nPH7UE80f8PPHl7gDFAZkUjawUIQG8w5ouknAUbl9Dg59KK1X4Z9XXFvo8mlRXax3KHfBG8Rk3qe6\\njHOc54+dMZO7jr/qK8vWtba4tYu38TwvDOMc8N60wPLbrW10PS7pnvrnUtbAKobgBUUk9jg8f/lM\\nC2rydMdRSaRqWoLEbx4UefwxkL2BVvvn9Klgv3Tp0lPxFno6wJ4IVmEOMEHsf2xUD2e4ks7n+NGD\\naCMu8q8lCMcEfPNA6tW/EwrMybEYZUHnI9Cf/FAzu7G4LXTWs38SRNqhs4Bz3z9KCO6x07UNT6al\\ntNMvEs7xkC7nPlI9R2/egwbrDT+r+kupLCeK9nu3KBYGRy+QvdWFWCU6avtA6h1iKDqLRhpmpvkx\\nz2p8JGb3z7k557VRX77TdHteuPBut401CAouyXGcdvmASaC069030brYaay/CwPFwWspRErfUN7U\\nGZX2hWSiY6ZrMc0CvhUlBUk/UcGgiLq2mtG8F54yDwfDfIoGkrRsSZXwOB2zmgsvw06XHVfUcFvI\\n22xQ753Ze4H8v3OBUo9a6XodjpltHbabDHZIhVsQqBuA9DxznFQTQUe5oDYGMnn7UEbpV3JqDyz+\\nBJFbBtsXiDBf/qx6CgDXL42cSRwGM3UzBQrHGFzy32oG2i2kKTSI80lzMow0rqQoyew+3tQO59Kt\\nJJRI9rEzgg7igz3z/egZ6paJdGGwW4eBXy7pGeXUdwT6A5qwebPjJrcOr9TvbWZQ2Onr+Gi2nIJH\\ncj7+vyqigOuRk+vtxQAqEk4BU0ABj7j96CzzKxYD0GeM0CQG3OMAjkfOgbSZwzE4PJyfWi6caTdz\\naffW95akrPFIrLg/tRHpGzs9C6t0W31FrO3Y43MrcbH9c/eloZ6v0JpWoKlrHHBbScSFEHYc5Pz7\\n1NDXUoJrK1g0dvw9qsspW3nXaN6KMrHnH5ieSfan0U3Rr1uidaRbiwk8BUSS6naQkjc3ZcHaRnn7\\n0wbja6lZX+nw3NvMksM+FXnPJ9DUCeoXj2hSG2t2km7op4U/f/FAvHaNePb3N0jRzRA7VD8Akc9u\\n/FAvcxnawZQ3HYtjJoKfDFAdeub6Vo1dSULIBtTbgYOfU8jNWUVvrm5ih0m1urixhlsI5HJliOwR\\n5/LkkHHJPamjHdQ0HWdemlutN0+YWBYtC0rHDhjwVz3zWgx1n4e9U6QE8XT5Zd//APR5se9XBXbj\\nS9S0zAvbO5tyWKAOhG4/KpQ3ZHXO5JFK98qRUGhfCbph77Uvx91pv463wVjR0LR7s483796WjW7r\\nTrXpHWrSW2YK7lmXTbaIFpCRjjHOOSeeBipaNLtXuIre3R43lnkGXYADZnnmoH6Dkbzn6UDGWe9a\\n/hKG3jsW8riQMJS3svp86B6zgMQmDtGT8qDNb6XUpOoPx72tzOkjFYowOduDwDjj70Gg6Wsq2KNe\\nAJKRuKk52fIn5DvVkENrvW+iaSAsl0txI2Asdud5Yk4A4pgzv4l9ST6JZSXbyyprWpw+FFa5G21g\\nz5icfzH3pgwCSQlh688+tUEwjjngZ7UHAHuWAHpn+1AXj5frQWXOGBZcKSe3c/rQIyAtnI27eBj/\\nADQIMAuH8vHBB9DQwVpPLjOckEZ/ahi9/Czqj/S9VhtLm6aG1uZFUsT5VOfX5Gpg9GiNJArxsrxs\\nv1BHypYGF7pljeG3kvLZSlqzNGGxhSRjP6GoG1yLUWiWc2nSPA4KJGItyYHYHHarop3wu0jWYNUv\\nzriNBp8ErraRMANxJ/N7nA7ZqDUHgSQLvAbacjI7H3oOuIFuYzGS68jJRyp4+lA0m0yDwGjiTw3b\\nzBwTuDe+TQVbV+mLmW1NtbSok9weZiC2zPLEZ+/FBM6Xo40/TYdL8Jr21G4vJcuCck55HbFWUKQ/\\nh4tR/DTz2o8TK21qmMgKOf8AfpmrokljG1i5BHI57D5VNorut9Lab1LA638W6H8sboNrqQckq3pn\\ntV0RWsfD6K7SGC3vTFahQJY2iVmkI9d+Mimie0Hp2DQ7AQacio3JZgqjcT3zxk1KHGldPWtnqMup\\nS5uNTmGGnk5KjGNqf0r8qgmkhVGcquGblm96BDUZZYLGVrdN8+MIvux7UGKTdXdbaRrFvbaxbWN4\\nd58BmwCjHPORycLx2q4LNe9S9TdN6I13qkWmzSXdwBCGlO4hiMKAB2A9ag0WySQwpLLtMjDcQBhV\\nz6CgoHxF17XbnUYunulgsUsu4TTvjIUAEhR+x4qwZwtkOi7651PXJobm4tohHbQhdgecjnaPZeOf\\neqMy1vWLvWNQlvb+ZpJpWyT2A9gB6Cgjy5AO4A5oAGRgBR39aA7Z8MkFtxPY0AbV9UGfpQWhj5Tk\\nBQGxuBoEGG1iQCyHvj1oELgSkK6oRnIBIxzRdJ28Q3+fHiAds96LoH3AF1wCfyijNbF8JviI1rbQ\\n6Pq/iSopxFOx5Uf0n3qUbWQk8II2SRyDPuCDUHMpSIiJQSBwDwKAgTxApnEbyIQ+APyn0+9A5B3A\\ngfmoEWgcb3VlMpGFYjt+negSs7zxH/C3RWO9UElM8SAHG5fl/agNdXcEbJAZ1WadvDQDJO7Gf7c0\\nED1dqWv2enzw6Rb24nZfJd3EwREHqxyMZHzOKBbT7H8PZWTK5uZ9o3Xm1SzEry5PsT7UFF+JnUez\\nSZ9LttRs2km2m5KSFWXDZI491AyBzVwK6J8T7CRtPjee0tbaGAtdNISdoXgLEo5JJxyfSmC6aF1f\\no2vELZXDJOxwkMybHYe4HtUFiJWJd8rKqjuTQcZV8SNI0dy43BlGVA+ZoBniE0RU7tp77Tg5zQUv\\n4hNrU2tdNWOhylPEnaS5UHGYlAzn5cn74oHGt6l0z07k6nJC123HhKPFlbPptGTj9q0Kx0XMvU+t\\ny6vqQtpWlZo4LOdGDWsak8Aflycgk+v2qC8a1q8OnaXLPOz2kCIWkZ+CqjgYx6n0xTBkmp9Sabp0\\nKdRyI5vJkaGw08MVKIDw8jA557896QY1q2o3eqXr3N7O8skjnlnzgn5e1UMCGV/MOM0BJFOVwfX0\\noFtgZTjkg8UBtpOeO1B3hg85FBZXVMM+VJAA2+h96BO4IMJ/p7qvuKBKacmOKB5CYYx5UzgDPfHz\\noGwD5OApJHAHrQEAk8NWdNpx+XdkA0AIGhkGWOQcgg8UGw/DP4kmwhi07WCTZqAiSbstGc4+pFKN\\nvs5o7q2Sa3kWaJxkOp4NZDOHUh/qL2k8LW78eG7kbZv+0+/yoEZp7fUpX/BXpgvYZTCSRtO7vtwe\\n/vQdY6jeyatPp91FEPw8aSNMoYbi2cADt6Z70DS60KW7luJdV1JniJzBtURG2b0KN7+/vQKSWUWn\\nLLqN3cSLP4ex5Y8jxiPykr23+nzzigpXUPVOu6Vqmmf8UWttb9OXDqkjRnfI3H849uRkDOKC0axL\\nFr+nLB0rrUMM0bqCIGGGX1AH09qsGc9UfBiTV9Vhu9Pu5oPGLNeG6bczN7jHvVEr058Gre3sLeDV\\nrmOdo3LmSFNjEH+XdntQXO51XQOl5YrCKGWa8SMYS3tzMyLjjJHb9alDqz1S5ktJ7nVdLmSVDiOO\\nNfEMiE4Xy+h9xUDm11CaTxEOn3VmpHFxKFCr9s5GPmKAus6jb9M6RJf3c88yxpjcxL7uM5OO3HrQ\\nVTSupoOuYdZMTSpptriNFtXKXDA/Pjhs9h2xQOJ7Xpnpa2S91WK2swqjbGw3ysfcnuxrQsGmapYv\\npwvra1FtDL52Mi+Gx49sZoMb+LXV0t+jWl3OYLGTO2zjx4h2nyszHsG4/Sgxt5ZJmEsjl3PB3GgS\\nlyXBxkDnNADseB2PsaA8SoXQyFgmQCV70B5R/EIjYmPJxnvigEKcYDfrQF2/X9aCwqC7l2zwfT/F\\nAJJ5747E5oGTqZArKOfccftQHZWwmOD23Z4NAEkTEBmwR7g5AoG7KSSE5HyFAMTyQsMHa/cEcEc5\\noL58P+v7rppdryPNAXx+GfsQe7Z9D2/Wg3zSdX0fqzT08F433eYwscOpHt9PcVkQPW632mX9vfWd\\nrbXiRgrIdu2eHIwGD57+nIoKdc/ELVdC0u5afp27SUtta5vJMMzk+UDjzYHtQWDpj4gxXmif/wAi\\ntXZkGZzFGW8MehZO+PmM0Fibr/poWQmF6xXA2xmFg59sKRk0C2nQP1KFvdb0vwIUJNtDKcsVP8zD\\n0Jx2oJDTNA0vR5p7qzs44pJOXkUc/SgNfa/pNvbF5L2JgTsCo2WJzjGKA1jcNcxOF/m/I0zbt4+g\\nxgenNA5s7CCxWWYQxpNLgyMiY3nt2oHajcuexAoEL1C1uyFkVHO1ixHb17/KgwT4rdXWep6oul2O\\npywaTYqVLxDyySDjaM9x6Z+tWDPdB1TW7Wa9sumpGlursqMQRlpXwd3BA4571RcdN0i41G7h/wBS\\nmNxqdkwn1O6u5/4cAXlYgcnngE/pQNvih8S211obHRyYbWInfJG/Ex9MD2+tBmNzcTXTtJcSSSSH\\nH5jngDAH0oEdxbg5A9wKAzPwO+fegSLfLJoFoR5fUfegXOcHGAT8qAM+XaBzQCCwGDuyPlQWJpV3\\n7Q5TIweM7u/f9qA9vNYpFML2KaR8YiaJgAh55PvQRvnYoqA+MThcDnPai4PKWQlH3K6tggjnPaiE\\nmz4ZznBPfFAVWG0AZDH1z2HzoE7lhv8AJIHI/mGRQI8AEeuOMGgndN6pu7V4RJLKY4WDLhypXj0o\\nNL6d+MMS4ttetDdQgDNwAPEwPRh2NZGkabrvTXVZiexvba5aI+ILWZQG3Y4IDdvtQScvTdjK8cht\\nFjkQ+VlYgqPXGKA17daV07apJrV9CsZbELTgbu3YY78UEHf9evJ4K9P6JqGoiR1XxjCUjAJ5OT3N\\nBM9YdSWPTenwy3t7bWbSuBunUthfUhRyT+1BA2vXnS/jGdeo9LnIHljeLwSCe5zgmgejrOz1S3kG\\nhazoaXYGAJ5Sw3e38uaCsJfX02rPD1XfXtvcCXdBJGjLbOO+EK88Y7nIoLB1H1Bb6WkN1ddSQ29i\\no/5MZEjzt7DGTjj2FXNGUfEH4wRaxCtnp2kwGGM7llvBvIOO4XOAe/fNMwZbqusalfLBHfzSvFH+\\nSIgKo+igYqiwWfWV30rpp03p6exJnUPJexQnxuR+Ulu2PkKCrT6jcSiTxZnbxCWcFidxPJJ96BBD\\nlQ35fbFAbahBHJIGO+KAIwg5YnB455oDkKcbW7UAOowSMjOORQcCVXPp+9AqDkHcDmgMNpHPcUBT\\nuzQWCJXcFvKR2Y0CMiqjnz4UcH/6oG8gKluwxyAfSjQ6ylEJBJfv37/OiYQMjbjkZXOSP/FEELAE\\nkNn1waBCXdjORnPoc80CZeTb5wQe2BQAm4y7jlhjvQcWO3cW4GB7ZpgGC5a3uUeNyGQ5GCR+45pg\\nt+l/EzqLTgxj1O5Zc4CSOXCj70wOE+Jd/Pq0V7qVvb3bISAWUBhnuc+/2pgvkHx0soLaNIdKkEiq\\nR5yDg47cYpgresfELSNc1n8VrFtAw2ZBiiywwcgeb14x2xTBYNA13ozUo/GOqWVizDc1nf6crIh/\\n7wOf1rOURvVupdE6ncpFeakiSWsZdbjSLfw1Zs+VVyMHA75xWsFDHU0idTJdf65rT28YKpPvHjKp\\n9Bk49qYK/rGpXF/qU9zPdyzyyMSJJAAx9ifnVlwNZ7vxYEh8GAEHO8DDH5H5U0IPK8jHxSzFQAMn\\nOKgJkFwPT6UBlAII5z3zQCjnA5OKBXeuAT9KABMA208DtxQHRhzgUC3KjJx9z2oAP6/L3NAHC8Hg\\n/XNAcNtGe4oEy5yeaCdLk7yx2qQCAO1AmXZSSexHbPNAhJuLJkgjvzRonuAJy2cd8UCbyOi453Dj\\n7GiYTZyVPPl74oYLJIyq68EH3Gf3oYTDEjLbiP1FEDHOUOdgOfXIBFAm77j5Mnng/WgLI5UE8Eg9\\niO9AnuJbuQx5wOBQFRxuIbOc54PrQK28ws76F722EyI4d4HJUOPb35yKBm8oeQsi4BPbPb71RyYI\\nHmPGRg00GRsbsHIPY0Bg52AEEseBUCQJyOPXtQDtcdvvjtQCQ/GBwKAuXU4PrQBvZE5IGeO1Affj\\nBJ57UBvEO045HagFWAAzktQKIzBeMg0C5kz5mOG/WgMrDJJ7jmgEnIyOccYoA3cEMRj05oC7/wDe\\nBQTduzEoNxwcZGaAJOWfPNAlISVOT60aIQfkj+amgJ3bnnigKeFGPQUCf/x0Smw4V8exogX/AOY3\\n+/SgKxKxeU459KAgJOckntQJkkcgkGgAAFFz/XQEmJaY7jnk96BM9yPQelAf/wCX7UBv/jagGP8A\\nKB6ZoDf00HMfO/0oAH5TQA/5moECSMDPFAvGASMjPP8AigVX+b60BW7/AHoHEJJD55oDd4snv70C\\nsSjCcDmgVAAbgYoGYJ3nk9qBUAYHAoP/2Q==\\n\"\n    }\n   },\n   \"id\": \"uid6\"\n  }\n ],\n \"nbformat\": 4,\n \"nbformat_minor\": 5,\n \"metadata\": {}\n}\n"
  },
  {
    "path": "test/ipynb/simple.out.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"jupyter\"\n            , MetaMap\n                (fromList\n                   [ ( \"nbformat\" , MetaString \"4\" )\n                   , ( \"nbformat_minor\" , MetaString \"5\" )\n                   ])\n            )\n          ]\n    }\n  [ Div\n      ( \"uid1\" , [ \"cell\" , \"markdown\" ] , [] )\n      [ Header\n          1\n          ( \"lorem-ipsum\" , [] , [] )\n          [ Str \"Lorem\" , Space , Str \"ipsum\" ]\n      , Para\n          [ Strong [ Str \"Lorem\" , Space , Str \"ipsum\" ]\n          , Space\n          , Str \"dolor\"\n          , Space\n          , Str \"sit\"\n          , Space\n          , Str \"amet,\"\n          , Space\n          , Str \"consectetur\"\n          , Space\n          , Str \"adipiscing\"\n          , Space\n          , Str \"elit.\"\n          , Space\n          , Str \"Nunc\"\n          , Space\n          , Str \"luctus\"\n          , SoftBreak\n          , Str \"bibendum\"\n          , Space\n          , Str \"felis\"\n          , Space\n          , Str \"dictum\"\n          , Space\n          , Str \"sodales.\"\n          ]\n      ]\n  , Div\n      ( \"uid2\" , [ \"cell\" , \"code\" ] , [] )\n      [ CodeBlock ( \"\" , [ \"python\" ] , [] ) \"print(\\\"hello\\\")\" ]\n  , Div\n      ( \"uid3\" , [ \"cell\" , \"markdown\" ] , [] )\n      [ Header 2 ( \"pyout\" , [] , [] ) [ Str \"Pyout\" ] ]\n  , Div\n      ( \"uid4\"\n      , [ \"cell\" , \"code\" ]\n      , [ ( \"execution_count\" , \"2\" ) ]\n      )\n      [ CodeBlock\n          ( \"\" , [ \"python\" ] , [] )\n          \"from IPython.display import HTML\\nHTML(\\\"\\\"\\\"\\n<script>\\nconsole.log(\\\"hello\\\");\\n</script>\\n<b>HTML</b>\\n\\\"\\\"\\\")\"\n      , Div\n          ( \"\"\n          , [ \"output\" , \"execute_result\" ]\n          , [ ( \"execution_count\" , \"2\" ) ]\n          )\n          [ RawBlock\n              (Format \"html\")\n              \"<script>\\nconsole.log(\\\"hello\\\");\\n</script>\\n<b>HTML</b>\\nhello\"\n          ]\n      ]\n  , Div\n      ( \"uid6\"\n      , [ \"cell\" , \"markdown\" ]\n      , [ ( \"tags\" , \"[\\\"foo\\\",\\\"bar\\\"]\" ) ]\n      )\n      [ Header 2 ( \"image\" , [] , [] ) [ Str \"Image\" ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"image\"\n          , Space\n          , Image\n              ( \"\" , [] , [] )\n              [ Str \"the\" , Space , Str \"moon\" ]\n              ( \"uid6-lalune.jpg\" , \"\" )\n          , Space\n          , Str \"will\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"included\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"cell\"\n          , SoftBreak\n          , Str \"attachment.\"\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/jats-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n                , MetaInlines [ Str \"Anonymous\" ]\n                ]\n            )\n          , ( \"copyright\"\n            , MetaMap\n                (fromList\n                   [ ( \"holder\" , MetaString \"MacFarlane et al\" )\n                   , ( \"statement\"\n                     , MetaString \"\\169 2023, MacFarlane et al\"\n                     )\n                   , ( \"year\" , MetaString \"2023\" )\n                   ])\n            )\n          , ( \"license\"\n            , MetaMap\n                (fromList\n                   [ ( \"link\"\n                     , MetaString\n                         \"https://creativecommons.org/licenses/by/4.0/\"\n                     )\n                   , ( \"text\"\n                     , MetaString\n                         \"This document is distributed under a Creative Commons Attribution 4.0 International license.\"\n                     )\n                   , ( \"type\" , MetaString \"open-access\" )\n                   ])\n            )\n          , ( \"references\"\n            , MetaList\n                [ MetaMap (fromList [ ( \"id\" , MetaString \"note_1\" ) ])\n                , MetaMap\n                    (fromList [ ( \"id\" , MetaString \"note_longnote\" ) ])\n                ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\"\n                , Space\n                , Str \"Test\"\n                , Space\n                , Str \"Suite\"\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Str \"John\"\n      , Space\n      , Str \"Gruber's\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , Header 1 ( \"headers\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , SoftBreak , Str \"link\" ]\n          ( \"/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"level-4\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"level-5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1 ( \"level-1\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"level-2-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      3 ( \"level-3\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header\n      2 ( \"level-2\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , Space\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , Space\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Strong\n          [ Str \"hard\"\n          , Space\n          , Str \"line\"\n          , Space\n          , Str \"break\"\n          , LineBreak\n          ]\n      , Str \"here.\"\n      ]\n  , Header 1 ( \"statements\" , [] , [] ) [ Str \"Statements\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"CAP\" , Space , Str \"TITLE\" ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"make\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"regular\"\n      ]\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , Space\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , Para [ Str \"A\" , Space , Str \"list:\" ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Para [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quotes:\"\n          ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \">\"\n      , Space\n      , Str \"1.\"\n      ]\n  , Para [ Str \"Box-style:\" ]\n  , BlockQuote\n      [ Para [ Str \"Example:\" ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      ]\n  , BlockQuote\n      [ OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"do\" , Space , Str \"laundry\" ] ]\n          , [ Para\n                [ Str \"take\"\n                , Space\n                , Str \"out\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"trash\"\n                ]\n            ]\n          ]\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"one:\"\n      ]\n  , BlockQuote\n      [ Para [ Str \"Joe\" , Space , Str \"said:\" ]\n      , BlockQuote\n          [ Para\n              [ Str \"Don't\" , Space , Str \"quote\" , Space , Str \"me.\" ]\n          ]\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote\"\n      , Space\n      , Str \"inside\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph.\"\n      , Space\n      , Str \"Start\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"here,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"quote\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"below:\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"My\" , Space , Str \"block\" , Space , Str \"quote\" ]\n      ]\n  , Para\n      [ Str \"End\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      ]\n  , Header 1 ( \"formulae\" , [] , [] ) [ Str \"Formulae\" ]\n  , Header\n      2\n      ( \"inline-formulae\" , [] , [] )\n      [ Str \"Inline\"\n      , Space\n      , Str \"formulae\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"inline-formula\" ]\n      ]\n  , Para\n      [ Strong\n          [ Str \"Inside\" , Space , Str \"a\" , Space , Str \"paragraph\" ]\n      , Str \",\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"natively\"\n      , Space\n      , Str \"coded\"\n      , Space\n      , Str \"inside\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"paragraph,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"show\"\n      , Space\n      , Str \"inline:\"\n      ]\n  , Para\n      [ Str \"Einstein\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Math InlineMath \"e=mc^2\"\n      , Str \".\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Header\n      2\n      ( \"disp-formulae\" , [] , [] )\n      [ Str \"Block\"\n      , Space\n      , Str \"formulae\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"disp-formula\" ]\n      ]\n  , Para\n      [ Strong\n          [ Str \"Inside\" , Space , Str \"a\" , Space , Str \"paragraph\" ]\n      , Str \",\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"natively\"\n      , Space\n      , Str \"coded\"\n      , Space\n      , Str \"inside\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"paragraph,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"show\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Para\n      [ Str \"Einstein\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Math DisplayMath \"e=mc^2\"\n      , Str \".\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Para\n      [ Strong\n          [ Str \"Outside\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"paragraph\"\n          ]\n      , Str \",\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"show\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Para\n      [ Str \"Einstein\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      ]\n  , Div\n      ( \"\" , [ \"disp-formula\" ] , [] )\n      [ Para [ Math DisplayMath \"e=mc^2\" ] ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Header\n      2\n      ( \"no-formula-wrapper\" , [] , [] )\n      [ Str \"Without\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"wrapper\"\n      ]\n  , Para\n      [ Strong\n          [ Str \"Inside\" , Space , Str \"a\" , Space , Str \"paragraph\" ]\n      , Str \",\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"show\"\n      , Space\n      , Str \"inline:\"\n      ]\n  , Para\n      [ Str \"Einstein\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Math InlineMath \"e=mc^2\"\n      , Str \".\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Para\n      [ Strong\n          [ Str \"Outside\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"paragraph\"\n          ]\n      , Str \",\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"show\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Para\n      [ Str \"Einstein\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      ]\n  , Para [ Math DisplayMath \"e=mc^2\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Header\n      2\n      ( \"misc-formulae\" , [] , [] )\n      [ Str \"Formulae\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"miscelaneus\"\n      , Space\n      , Str \"elements\"\n      ]\n  , Para\n      [ Str \"Regardless\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"whether\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"they\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"inside\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph,\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"wrapped\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"div,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"displayed\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Para\n      [ Strong\n          [ Str \"Inside\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"paragraph:\"\n          ]\n      ]\n  , Para\n      [ Str \"Einstein\"\n      , Space\n      , Str \"definitely\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      ]\n  , Div\n      ( \"\" , [ \"disp-formula\" ] , [] )\n      [ Para [ Str \"Abstract\" , Space , Str \"text\" ]\n      , Para\n          [ Image\n              ( \"graphic001\"\n              , [ \"This\"\n                , \"is\"\n                , \"the\"\n                , \"role\"\n                , \"of\"\n                , \"the\"\n                , \"graphic\"\n                ]\n              , []\n              )\n              [ Str \"Alternative\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"graphic\"\n              ]\n              ( \"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n              , \"This is the title of the graphic\"\n              )\n          ]\n      , Para [ Math DisplayMath \"e=mc^2\" ]\n      ]\n  , Para\n      [ Str \".\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Para\n      [ Strong\n          [ Str \"Outside\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"paragraph:\"\n          ]\n      ]\n  , Para\n      [ Str \"Paragraph\"\n      , Space\n      , Str \"before:\"\n      , Space\n      , Str \"Einstein\"\n      , Space\n      , Str \"showed\"\n      , Space\n      , Str \"that\"\n      ]\n  , Div\n      ( \"\" , [ \"disp-formula\" ] , [] )\n      [ Para [ Str \"Abstract\" , Space , Str \"text\" ]\n      , Para\n          [ Image\n              ( \"graphic003\" , [] , [] )\n              [ Str \"Alternative\"\n              , Space\n              , Str \"text\"\n              , Space\n              , Str \"1\"\n              ]\n              ( \"Title 3\" , \"\" )\n          ]\n      , Para [ Math DisplayMath \"e=mc^2\" ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"formula\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"important\"\n      , Space\n      , Str \"because\\8230\"\n      ]\n  , Figure\n      ( \"fig-1\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"bar\" ] ])\n      [ Plain [ Str \"alternative-decription\" ]\n      , Para [ Image ( \"\" , [] , [] ) [] ( \"foo.png\" , \"\" ) ]\n      ]\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para\n      [ Str \"Loose\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"and\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , SoftBreak\n            , Str \"dog's\"\n            , Space\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Para [ Str \"List\" , Space , Str \"styles:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"one\" ] ]\n      , [ Para [ Str \"two\" ] ]\n      , [ Para [ Str \"three\" ] ]\n      ]\n  , OrderedList\n      ( 1 , LowerRoman , DefaultDelim )\n      [ [ Para [ Str \"one\" ] ]\n      , [ Para [ Str \"two\" ] ]\n      , [ Para [ Str \"three\" ] ]\n      ]\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Para [ Str \"Tab\" ]\n        , BulletList\n            [ [ Para [ Str \"Tab\" ]\n              , BulletList [ [ Para [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here's\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Same\"\n      , Space\n      , Str \"thing\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"paragraphs:\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"tabs-and-spaces\" , [] , [] )\n      [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"tabs\"\n            ]\n        ]\n      , [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            ]\n        , BulletList\n            [ [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"tabs\"\n                  ]\n              ]\n            , [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"spaces\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Autonumber.\" ] ]\n      , [ Para [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Para [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , Header 2 ( \"definition\" , [] , [] ) [ Str \"Definition\" ]\n  , DefinitionList\n      [ ( [ Str \"Violin\" ]\n        , [ [ Para\n                [ Str \"Stringed\"\n                , Space\n                , Str \"musical\"\n                , Space\n                , Str \"instrument.\"\n                ]\n            , Para [ Str \"Torture\" , Space , Str \"device.\" ]\n            ]\n          ]\n        )\n      , ( [ Str \"Cello\"\n          , Strong [ LineBreak ]\n          , Str \"Violoncello\"\n          ]\n        , [ [ Para\n                [ Str \"Low-voiced\"\n                , Space\n                , Str \"stringed\"\n                , Space\n                , Str \"instrument.\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      2\n      ( \"list-inside-paragraph\" , [] , [] )\n      [ Str \"List\"\n      , Space\n      , Str \"inside\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      ]\n  , Para\n      [ Str \"Start\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , BulletList\n      [ [ Para [ Str \"Red\" ] ] , [ Para [ Str \"Blue\" ] ] ]\n  , Para\n      [ Str \"End\" , Space , Str \"of\" , Space , Str \"paragraph.\" ]\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , SoftBreak , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , SoftBreak\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Empty\"\n      , Space\n      , Strong []\n      , Space\n      , Str \"and\"\n      , Space\n      , Emph []\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , SoftBreak\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , SoftBreak , Str \"link\" ]\n              ( \"/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , SmallCaps [ Str \"small\" , Space , Str \"caps\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"underlined:\"\n      , Space\n      , Str \"foo\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"bar.\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"strikethrough:\"\n      , Space\n      , Strikeout [ Str \"foo\" ]\n      , Str \",\"\n      , SoftBreak\n      , Strikeout [ Str \"bar\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Strikeout [ Str \"baz\" ]\n      , Str \".\"\n      ]\n  , Header\n      1\n      ( \"smart-quotes-ellipses-dashes\" , [] , [] )\n      [ Str \"Smart\"\n      , Space\n      , Str \"quotes,\"\n      , Space\n      , Str \"ellipses,\"\n      , Space\n      , Str \"dashes\"\n      ]\n  , Para\n      [ Str \"\\\"Hello,\\\"\"\n      , Space\n      , Str \"said\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"spider.\"\n      , Space\n      , Str \"\\\"'Shelob'\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"my\"\n      , Space\n      , Str \"name.\\\"\"\n      ]\n  , Para\n      [ Str \"'A',\"\n      , Space\n      , Str \"'B',\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"'C'\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"letters.\"\n      ]\n  , Para\n      [ Str \"'Oak,'\"\n      , Space\n      , Str \"'elm,'\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"'beech'\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"names\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"trees.\"\n      , Space\n      , Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"'pine.'\"\n      ]\n  , Para\n      [ Str \"'He\"\n      , Space\n      , Str \"said,\"\n      , Space\n      , Str \"\\\"I\"\n      , Space\n      , Str \"want\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"go.\\\"'\"\n      , Space\n      , Str \"Were\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"alive\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"70's?\"\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"quoted\"\n      , Space\n      , Str \"'\"\n      , Code ( \"\" , [] , [] ) \"code\"\n      , Str \"'\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Str \"\\\"\"\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"quoted\" , SoftBreak , Str \"link\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \"\\\".\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one---two\"\n      , Space\n      , Str \"---\"\n      , Space\n      , Str \"three--four\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"five.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"numbers:\"\n      , Space\n      , Str \"5-7,\"\n      , Space\n      , Str \"255-66,\"\n      , Space\n      , Str \"1987-1999.\"\n      ]\n  , Para\n      [ Str \"Ellipses...and.\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".and\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".\"\n      , Space\n      , Str \".\"\n      ]\n  , Header 1 ( \"latex\" , [] , [] ) [ Str \"LaTeX\" ]\n  , BulletList\n      [ [ Para [ Str \"\\\\cite[22-23]{smith.1899}\" ] ]\n      , [ Para [ Str \"\\\\doublespacing\" ] ]\n      , [ Para [ Str \"$2+2=4$\" ] ]\n      , [ Para\n            [ Str \"$x\" , Space , Str \"\\\\in\" , Space , Str \"y$\" ]\n        ]\n      , [ Para\n            [ Str \"$\\\\alpha\"\n            , Space\n            , Str \"\\\\wedge\"\n            , Space\n            , Str \"\\\\omega$\"\n            ]\n        ]\n      , [ Para [ Str \"$223$\" ] ]\n      , [ Para [ Str \"$p$-Tree\" ] ]\n      , [ Para\n            [ Str \"$\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to\"\n            , Space\n            , Str \"0}\\\\frac{f(x+h)-f(x)}{h}$\"\n            ]\n        ]\n      , [ Para\n            [ Str \"Here's\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"that\"\n            , Space\n            , Str \"has\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"it:\"\n            , Space\n            , Str \"$\\\\alpha\"\n            , Space\n            , Str \"+\"\n            , Space\n            , Str \"\\\\omega\"\n            , Space\n            , Str \"\\\\times\"\n            , SoftBreak\n            , Str \"x^2$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"shouldn't\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"math:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"To\"\n            , Space\n            , Str \"get\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"famous\"\n            , Space\n            , Str \"equation,\"\n            , Space\n            , Str \"write\"\n            , SoftBreak\n            , Code ( \"\" , [] , [] ) \"$e = mc^2$\"\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"$22,000\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Emph [ Str \"lot\" ]\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"money.\"\n            , Space\n            , Str \"So\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"$34,000.\"\n            , Space\n            , Str \"(It\"\n            , SoftBreak\n            , Str \"worked\"\n            , Space\n            , Str \"if\"\n            , Space\n            , Str \"\\\"lot\\\"\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"emphasized.)\"\n            ]\n        ]\n      , [ Para\n            [ Str \"Escaped\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$\"\n            , Str \":\"\n            , Space\n            , Str \"$73\"\n            , Space\n            , Emph\n                [ Str \"this\"\n                , Space\n                , Str \"should\"\n                , Space\n                , Str \"be\"\n                , SoftBreak\n                , Str \"emphasized\"\n                ]\n            , Space\n            , Str \"23$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"LaTeX\"\n      , Space\n      , Str \"table:\"\n      ]\n  , Para\n      [ Str \"\\\\begin{tabular}{|l|l|}\\\\hline\"\n      , Space\n      , Str \"Animal\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"Number\"\n      , Space\n      , Str \"\\\\\\\\\"\n      , Space\n      , Str \"\\\\hline\"\n      , Space\n      , Str \"Dog\"\n      , Space\n      , Str \"&\"\n      , SoftBreak\n      , Str \"2\"\n      , Space\n      , Str \"\\\\\\\\\"\n      , Space\n      , Str \"Cat\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"1\"\n      , Space\n      , Str \"\\\\\\\\\"\n      , Space\n      , Str \"\\\\hline\"\n      , Space\n      , Str \"\\\\end{tabular}\"\n      ]\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n        ]\n      , [ Para\n            [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Para [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Para\n            [ Str \"set\"\n            , Space\n            , Str \"membership:\"\n            , Space\n            , Str \"elem\"\n            ]\n        ]\n      , [ Para [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , SoftBreak , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , SoftBreak , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by two spaces\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , SoftBreak , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by a tab\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , SoftBreak , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with \\\"quotes\\\" in it\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , SoftBreak , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with single quotes\" )\n      ]\n  , Para\n      [ Str \"Email\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"(nobody\"\n      , Space\n      , Str \"[at]\"\n      , Space\n      , Str \"nowhere.net)\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"reference\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"Foo\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , SoftBreak , Str \"[brackets]\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n      , Space\n      , Str \"by\"\n      , SoftBreak\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , SoftBreak\n      , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"[not]\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"[not]: /url\"\n  , Para\n      [ Str \"Foo\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"bar\" ]\n          ( \"/url/\" , \"Title with \\\"quotes\\\" inside\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"biz\" ]\n          ( \"/url/\" , \"Title with \\\"quote\\\" inside\" )\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"with-ampersands\" , [] , [] )\n      [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , SoftBreak\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"AT&T\" ]\n          ( \"http://att.com/\" , \"AT&T\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"an\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\" , SoftBreak , Str \"link\" ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"an\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\"\n          , SoftBreak\n          , Str \"link\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"pointy\"\n          , Space\n          , Str \"braces\"\n          ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n        ]\n      , [ Para\n            [ Link\n                ( \"\" , [] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Para [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , Space\n      , Str \"nobody\"\n      , Space\n      , Str \"[at]\"\n      , Space\n      , Str \"nowhere.net\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , SoftBreak\n          , Link\n              ( \"\" , [] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Auto-links\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"occur\"\n      , Space\n      , Str \"here:\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] ) \"or here: <http://example.com/>\"\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Str \"\\\"Voyage\"\n      , Space\n      , Str \"dans\"\n      , Space\n      , Str \"la\"\n      , Space\n      , Str \"Lune\\\"\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] ) [] ( \"lalune.jpg\" , \"Voyage dans la Lune\" )\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , SoftBreak\n      , Image ( \"\" , [] , [] ) [] ( \"movie.jpg\" , \"\" )\n      , SoftBreak\n      , Str \"icon.\"\n      ]\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference\"\n      , Link ( \"\" , [] , [] ) [ Str \"(1)\" ] ( \"#note_1\" , \"\" )\n      , Str \",\"\n      , SoftBreak\n      , Str \"and\"\n      , SoftBreak\n      , Str \"another\"\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"(longnote)\" ]\n          ( \"#note_longnote\" , \"\" )\n      , Str \".\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Emph [ Str \"not\" ]\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , SoftBreak\n      , Str \"contains\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"space^(my\"\n      , Space\n      , Str \"note).\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"(1)\" ] ( \"#ref_1\" , \"\" )\n      , Space\n      , Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"footnote.\"\n      , Space\n      , Str \"It\"\n      , Space\n      , Str \"can\"\n      , SoftBreak\n      , Str \"go\"\n      , Space\n      , Str \"anywhere\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"document,\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"end.\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"(longnote)\" ]\n          ( \"#ref_longnote\" , \"\" )\n      , Space\n      , Str \"Here's\"\n      , SoftBreak\n      , Str \"the\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"note.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"contains\"\n      , Space\n      , Str \"multiple\"\n      , Space\n      , Str \"blocks.\"\n      ]\n  , Para\n      [ Str \"Caret\"\n      , Space\n      , Str \"characters\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"used\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"indicate\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"belong\"\n      , Space\n      , Str \"to\"\n      , SoftBreak\n      , Str \"a\"\n      , Space\n      , Str \"single\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"(as\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quotes).\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"  { <code> }\"\n  , Para\n      [ Str \"If\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"want,\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"caret\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"beginning\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"every\"\n      , Space\n      , Str \"line,\"\n      , Space\n      , Str \"as\"\n      , SoftBreak\n      , Str \"with\"\n      , Space\n      , Str \"blockquotes,\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"need\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"caret\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"beginning\"\n      , SoftBreak\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"first\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"preceding\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"lines.\"\n      ]\n  , Para\n      [ Str \"text\"\n      , Space\n      , Emph [ Str \"Leading\" , Space , Str \"space\" ]\n      ]\n  , Para\n      [ Emph [ Str \"Trailing\" , Space , Str \"space\" ]\n      , Space\n      , Str \"text\"\n      ]\n  , Para\n      [ Str \"text\"\n      , Space\n      , Emph [ Str \"Leading\" , Space , Str \"spaces\" ]\n      ]\n  , Para\n      [ Emph [ Str \"Trailing\" , Space , Str \"spaces\" ]\n      , Space\n      , Str \"text\"\n      ]\n  , Header 1 ( \"tables\" , [] , [] ) [ Str \"Tables\" ]\n  , Header\n      2\n      ( \"tables-with-headers\" , [] , [] )\n      [ Str \"Tables\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"Headers\"\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"r1a\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"r1b\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"r1c\" ] ]\n                 ]\n             , Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"X\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Y\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"Z\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Header\n      2\n      ( \"tables-without-headers\" , [] , [] )\n      [ Str \"Tables\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"Headers\"\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Header\n      2\n      ( \"table-with-spans-and-alignments\" , [] , [] )\n      [ Str \"Tables\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"spans\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"alignments\"\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 2)\n                     [ Para [ Str \"1\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignRight\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"2\" ] ]\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 2)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignLeft\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 2)\n                      (ColSpan 1)\n                      [ Para [ Str \"4\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"6\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 2)\n                      [ Para [ Str \"7\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Header\n      2\n      ( \"table-with-footer\" , [] , [] )\n      [ Str \"Table\" , Space , Str \"with\" , Space , Str \"footer\" ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignRight\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"f1\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"f2\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"f3\" ] ]\n                 ]\n             , Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignRight\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"f4\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"f5\" ] ]\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     [ Para [ Str \"f6\" ] ]\n                 ]\n             ])\n      ]\n  , Header\n      2\n      ( \"table-with-multiple-bodies\" , [] , [] )\n      [ Str \"Table\"\n      , Space\n      , Str \"With\"\n      , Space\n      , Str \"Multiple\"\n      , Space\n      , Str \"Bodies\"\n      ]\n  , Div\n      ( \"\" , [ \"table-wrap\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          , ( AlignLeft , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignRight\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"a1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"a2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"a3\" ] ]\n                  ]\n              ]\n          , TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"b1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"b2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"b3\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Header\n      2\n      ( \"empty-tables\" , [] , [] )\n      [ Str \"Empty\" , Space , Str \"Tables\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"section\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"empty.\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"References\" ]\n  , Div ( \"refs\" , [] , [] ) []\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Notes\" ]\n  , Div ( \"refs\" , [] , [] ) []\n  ]\n"
  },
  {
    "path": "test/jats-reader.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<processing-meta base-tagset=\"archiving\" mathml-version=\"3.0\" table-model=\"xhtml\" tagset-family=\"jats\">\n    <restricted-by>pmc</restricted-by>\n</processing-meta>\n<front>\n<journal-meta>\n<journal-title-group>\n</journal-title-group>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>Pandoc Test Suite</article-title>\n</title-group>\n<contrib-group>\n  <contrib contrib-type=\"author\">\n    <name>\n      <surname>MacFarlane</surname>\n      <given-names>John</given-names>\n    </name>\n  </contrib>\n  <contrib contrib-type=\"author\">\n    <name>\n      <surname>Anonymous</surname>\n    </name>\n  </contrib>\n</contrib-group>\n<permissions>\n        <copyright-statement>© 2023, MacFarlane et al</copyright-statement>\n        <copyright-year>2023</copyright-year>\n        <copyright-holder>MacFarlane et al</copyright-holder>\n        <license license-type=\"open-access\">\n          <ali:license_ref xmlns:ali=\"http://www.niso.org/schemas/ali/1.0/\">https://creativecommons.org/licenses/by/4.0/</ali:license_ref>\n          <license-p>This document is distributed under a Creative Commons Attribution 4.0 International license.</license-p>\n        </license>\n      </permissions>\n</article-meta>\n</front>\n<body>\n<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.</p>\n<sec id=\"headers\">\n  <title>Headers</title>\n  <sec id=\"level-2-with-an-embedded-link\">\n    <title>Level 2 with an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">embedded\n    link</ext-link></title>\n    <sec id=\"level-3-with-emphasis\">\n      <title>Level 3 with <italic>emphasis</italic></title>\n      <sec id=\"level-4\">\n        <title>Level 4</title>\n        <sec id=\"level-5\">\n          <title>Level 5</title>\n        </sec>\n      </sec>\n    </sec>\n  </sec>\n</sec>\n<sec id=\"level-1\">\n  <title>Level 1</title>\n  <sec id=\"level-2-with-emphasis\">\n    <title>Level 2 with <italic>emphasis</italic></title>\n    <sec id=\"level-3\">\n      <title>Level 3</title>\n      <p>with no blank line</p>\n    </sec>\n  </sec>\n  <sec id=\"level-2\">\n    <title>Level 2</title>\n    <p>with no blank line</p>\n  </sec>\n</sec>\n<sec id=\"paragraphs\">\n  <title>Paragraphs</title>\n  <p>Here's a regular paragraph.</p>\n  <p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.</p>\n  <p>Here's one with a bullet. * criminey.</p>\n  <p>There should be a <bold>hard line break<break /></bold>here.</p>\n</sec>\n<sec id=\"statements\">\n  <title> Statements </title>\n  <statement>\n    <label> A label for a statement</label>\n    <title> CAP TITLE </title>\n    <p> Some text to make this regular </p>\n  </statement>\n</sec>\n<sec id=\"block-quotes\">\n  <title>Block Quotes</title>\n  <p>E-mail style:</p>\n  <disp-quote>\n    <p>This is a block quote. It is pretty short.</p>\n  </disp-quote>\n  <disp-quote>\n    <p>Code in a block quote:</p>\n    <preformat>sub status {\n    print &quot;working&quot;;\n}</preformat>\n    <p>A list:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>item one</p>\n      </list-item>\n      <list-item>\n        <p>item two</p>\n      </list-item>\n    </list>\n    <p>Nested block quotes:</p>\n    <disp-quote>\n      <p>nested</p>\n    </disp-quote>\n    <disp-quote>\n      <p>nested</p>\n    </disp-quote>\n  </disp-quote>\n  <p>This should not be a block quote: 2 &gt; 1.</p>\n  <p>Box-style:</p>\n  <disp-quote>\n    <p>Example:</p>\n    <preformat>sub status {\n    print &quot;working&quot;;\n}</preformat>\n  </disp-quote>\n  <disp-quote>\n    <list list-type=\"order\">\n      <list-item>\n        <p>do laundry</p>\n      </list-item>\n      <list-item>\n        <p>take out the trash</p>\n      </list-item>\n    </list>\n  </disp-quote>\n  <p>Here's a nested one:</p>\n  <disp-quote>\n    <p>Joe said:</p>\n    <disp-quote>\n      <p>Don't quote me.</p>\n    </disp-quote>\n  </disp-quote>\n  <p>And a following paragraph.</p>\n  <p>\n     Here is a block quote inside a paragraph. Start of a paragraph is here, and the quote is below:\n      <disp-quote>\n        <p>My block quote</p>\n      </disp-quote>\n     End of a paragraph\n  </p>\n</sec>\n<sec id=\"formulae\">\n  <title>Formulae</title>\n  <sec id=\"inline-formulae\">\n    <title>Inline formulae with <italic>inline-formula</italic></title>\n    <p><bold>Inside a paragraph</bold>, should be natively coded inside the paragraph, and show inline:</p>\n    <p>Einstein showed that <inline-formula><alternatives>\n      <tex-math><![CDATA[e=mc^2]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives></inline-formula>.\n      This formula is important because…</p>\n  </sec>\n  <sec id=\"disp-formulae\">\n    <title>Block formulae with <italic>disp-formula</italic></title>\n    <p><bold>Inside a paragraph</bold>, should be natively coded inside the paragraph, but show as block:</p>\n    <p>Einstein showed that <disp-formula><alternatives>\n      <tex-math><![CDATA[e=mc^2]]></tex-math>\n      <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives></disp-formula>.\n      This formula is important because…</p>\n    <p><bold>Outside a paragraph</bold>, should show as block:</p>\n    <p>Einstein showed that </p>\n    <disp-formula><alternatives>\n      <tex-math><![CDATA[e=mc^2]]></tex-math>\n      <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives></disp-formula>\n    <p>This formula is important because…</p>\n  </sec>\n  <sec id=\"no-formula-wrapper\">\n    <title>Without a formula wrapper</title>\n    <p><bold>Inside a paragraph</bold>, should show inline:</p>\n    <p>Einstein showed that <alternatives>\n      <tex-math><![CDATA[e=mc^2]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives>.\n      This formula is important because…</p>\n    <p><bold>Outside a paragraph</bold>, should show as block:</p>\n    <p>Einstein showed that </p>\n    <alternatives>\n      <tex-math><![CDATA[e=mc^2]]></tex-math>\n      <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives>\n    <p>This formula is important because…</p>\n  </sec>\n  <sec id=\"misc-formulae\">\n    <title>Formulae with miscelaneus elements</title>\n    <p>Regardless of whether or not they are inside a paragraph, should be wrapped in a div, and displayed in a block:</p>\n    <p><bold>Inside a paragraph:</bold></p>\n    <p>Einstein definitely showed that \n      <disp-formula>\n        <abstract>\n          <p>Abstract text</p>\n        </abstract>\n        <graphic id=\"graphic001\"\n        xlink:href=\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n        xlink:title=\"This is the title of the graphic\"\n        xlink:role=\"This is the role of the graphic\">\n          <alt-text>Alternative text of the graphic</alt-text>\n          <caption>\n            <title>This is the title of the caption</title>\n            <p>Google doodle from 14 March 2003</p></caption>\n        </graphic>\n        <alternatives>\n          <tex-math><![CDATA[e=mc^2]]></tex-math>\n          <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math>\n          <graphic id=\"graphic001\"\n          xlink:href=\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n          xlink:title=\"Title 2\">\n            <alt-text>Alternative text 2</alt-text>\n            <caption><p>Google doodle from 14 March 2003</p></caption>\n          </graphic>\n        </alternatives>\n      </disp-formula>.\n      This formula is important because…</p>\n    <p><bold>Outside of a paragraph:</bold></p>\n    <p>Paragraph before: Einstein showed that </p>\n    <disp-formula>\n      <abstract>\n        <p>Abstract text</p>\n      </abstract>\n      <graphic id=\"graphic003\"\n      xlink:href=\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n      xlink:href=\"Title 3\">\n        <alt-text>Alternative text 1</alt-text>\n        <caption><p>Google doodle from 14 March 2003</p></caption>\n      </graphic>\n      <alternatives>\n        <tex-math><![CDATA[e=mc^2]]></tex-math>\n        <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math>\n        <graphic id=\"graphic004\"\n        xlink:href=\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n        xlink:href=\"Title 4\">\n          <alt-text>Alternative text 2</alt-text>\n          <caption><p>Google doodle from 14 March 2003</p></caption>\n        </graphic>\n      </alternatives>\n    </disp-formula>\n    <p>This formula is important because…</p>\n  </sec>\n</sec>\n<sec id=\"figures\">\n  <fig id=\"fig-1\">\n    <caption>\n      <p>bar</p>\n    </caption>\n    <alt-text>alternative-decription</alt-text>\n    <graphic xlink:href=\"foo.png\" xlink:alt-text=\"baz\" />\n  </fig>\n</sec>\n<sec id=\"code-blocks\">\n  <title>Code Blocks</title>\n  <p>Code:</p>\n  <preformat>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</preformat>\n  <p>And:</p>\n  <preformat>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</preformat>\n</sec>\n<sec id=\"lists\">\n  <title>Lists</title>\n  <sec id=\"unordered\">\n    <title>Unordered</title>\n    <p>Asterisks tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Asterisks loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Pluses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Pluses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"ordered\">\n    <title>Ordered</title>\n    <p>Tight:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Loose using tabs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and using spaces:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Multiple paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Item 1, graf one.</p>\n        <p>Item 1. graf two. The quick brown fox jumped over the lazy\n          dog's back.</p>\n      </list-item>\n      <list-item>\n        <p>Item 2.</p>\n      </list-item>\n      <list-item>\n        <p>Item 3.</p>\n      </list-item>\n    </list>\n    <p>List styles:</p>\n    <list list-type=\"order\">\n      <list-item><p>one</p></list-item><x>,</x>\n      <list-item><p>two</p></list-item><x>,</x>\n      <list-item><p>three</p></list-item>\n    </list>\n    <list list-type=\"roman-lower\">\n      <list-item><p>one</p></list-item><x>,</x>\n      <list-item><p>two</p></list-item><x>,</x>\n      <list-item><p>three</p></list-item>\n    </list>\n  </sec>\n  <sec id=\"nested\">\n    <title>Nested</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Tab</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Tab</p>\n            <list list-type=\"bullet\">\n              <list-item>\n                <p>Tab</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Here's another:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>Same thing but with paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"tabs-and-spaces\">\n    <title>Tabs and spaces</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>this is a list item indented with tabs</p>\n      </list-item>\n      <list-item>\n        <p>this is a list item indented with spaces</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>this is an example list item indented with tabs</p>\n          </list-item>\n          <list-item>\n            <p>this is an example list item indented with spaces</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"fancy-list-markers\">\n    <title>Fancy list markers</title>\n    <p>Autonumbering:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Autonumber.</p>\n      </list-item>\n      <list-item>\n        <p>More.</p>\n        <list list-type=\"order\">\n          <list-item>\n            <p>Nested.</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"definition\">\n    <title>Definition</title>\n    <def-list>\n      <def-item>\n        <term>\n          Violin\n        </term>\n        <def>\n          <p>Stringed musical instrument.</p>\n          <p>Torture device.</p>\n        </def>\n      </def-item>\n      <def-item>\n        <term>\n          Cello<bold><break /></bold>Violoncello\n        </term>\n        <def>\n          <p>Low-voiced stringed instrument.</p>\n        </def>\n      </def-item>\n    </def-list>\n  </sec>\n  <sec id=\"list-inside-paragraph\">\n    <title>List inside a paragraph</title>\n    <p>\n      Start of a paragraph.\n      <list list-type=\"bullet\">\n        <list-item>\n          <label>&#8226;</label>\n          <p>Red</p>\n        </list-item>\n        <list-item>\n          <label>&#8226;</label>\n          <p>Blue</p>\n        </list-item>\n      </list>\n      End of paragraph.\n    </p>\n  </sec>\n</sec>\n<sec id=\"inline-markup\">\n  <title>Inline Markup</title>\n  <p>This is <italic>emphasized</italic>, and so <italic>is\n    this</italic>.</p>\n  <p>This is <bold>strong</bold>, and so\n    <bold>is this</bold>.</p>\n  <p>Empty <bold></bold> and <italic></italic>.</p>\n  <p>An\n    <italic><ext-link ext-link-type=\"uri\" xlink:href=\"/url\">emphasized\n    link</ext-link></italic>.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p>This is code: <monospace>&gt;</monospace>, <monospace>$</monospace>,\n    <monospace>\\</monospace>, <monospace>\\$</monospace>,\n    <monospace>&lt;html&gt;</monospace>.</p>\n  <p>This is <sc>small caps</sc>.</p>\n  <p>These are all underlined: foo and bar.</p>\n  <p>These are all strikethrough: <strike>foo</strike>,\n    <strike>bar</strike>, and <strike>baz</strike>.</p>\n</sec>\n<sec id=\"smart-quotes-ellipses-dashes\">\n  <title>Smart quotes, ellipses, dashes</title>\n  <p>&quot;Hello,&quot; said the spider. &quot;'Shelob' is my name.&quot;</p>\n  <p>'A', 'B', and 'C' are letters.</p>\n  <p>'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'</p>\n  <p>'He said, &quot;I want to go.&quot;' Were you alive in the 70's?</p>\n  <p>Here is some quoted '<monospace>code</monospace>' and a\n    &quot;<ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">quoted\n    link</ext-link>&quot;.</p>\n  <p>Some dashes: one---two --- three--four -- five.</p>\n  <p>Dashes between numbers: 5-7, 255-66, 1987-1999.</p>\n  <p>Ellipses...and. . .and . . . .</p>\n</sec>\n<sec id=\"latex\">\n  <title>LaTeX</title>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>\\cite[22-23]{smith.1899}</p>\n    </list-item>\n    <list-item>\n      <p>\\doublespacing</p>\n    </list-item>\n    <list-item>\n      <p>$2+2=4$</p>\n    </list-item>\n    <list-item>\n      <p>$x \\in y$</p>\n    </list-item>\n    <list-item>\n      <p>$\\alpha \\wedge \\omega$</p>\n    </list-item>\n    <list-item>\n      <p>$223$</p>\n    </list-item>\n    <list-item>\n      <p>$p$-Tree</p>\n    </list-item>\n    <list-item>\n      <p>$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$</p>\n    </list-item>\n    <list-item>\n      <p>Here's one that has a line break in it: $\\alpha + \\omega \\times\n        x^2$.</p>\n    </list-item>\n  </list>\n  <p>These shouldn't be math:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>To get the famous equation, write\n        <monospace>$e = mc^2$</monospace>.</p>\n    </list-item>\n    <list-item>\n      <p>$22,000 is a <italic>lot</italic> of money. So is $34,000. (It\n        worked if &quot;lot&quot; is emphasized.)</p>\n    </list-item>\n    <list-item>\n      <p>Escaped <monospace>$</monospace>: $73 <italic>this should be\n        emphasized</italic> 23$.</p>\n    </list-item>\n  </list>\n  <p>Here's a LaTeX table:</p>\n  <p>\\begin{tabular}{|l|l|}\\hline Animal &amp; Number \\\\ \\hline Dog &amp;\n    2 \\\\ Cat &amp; 1 \\\\ \\hline \\end{tabular}</p>\n</sec>\n<sec id=\"special-characters\">\n  <title>Special Characters</title>\n  <p>Here is some unicode:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>I hat: Î</p>\n    </list-item>\n    <list-item>\n      <p>o umlaut: ö</p>\n    </list-item>\n    <list-item>\n      <p>section: §</p>\n    </list-item>\n    <list-item>\n      <p>set membership: elem</p>\n    </list-item>\n    <list-item>\n      <p>copyright: ©</p>\n    </list-item>\n  </list>\n  <p>AT&amp;T has an ampersand in their name.</p>\n  <p>AT&amp;T is another way to write it.</p>\n  <p>This &amp; that.</p>\n  <p>4 &lt; 5.</p>\n  <p>6 &gt; 5.</p>\n  <p>Backslash: \\</p>\n  <p>Backtick: `</p>\n  <p>Asterisk: *</p>\n  <p>Underscore: _</p>\n  <p>Left brace: {</p>\n  <p>Right brace: }</p>\n  <p>Left bracket: [</p>\n  <p>Right bracket: ]</p>\n  <p>Left paren: (</p>\n  <p>Right paren: )</p>\n  <p>Greater-than: &gt;</p>\n  <p>Hash: #</p>\n  <p>Period: .</p>\n  <p>Bang: !</p>\n  <p>Plus: +</p>\n  <p>Minus: -</p>\n</sec>\n<sec id=\"links\">\n  <title>Links</title>\n  <sec id=\"explicit\">\n    <title>Explicit</title>\n    <p>Just a\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">URL</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title\">URL\n      and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by two spaces\">URL\n      and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by a tab\">URL\n      and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with &quot;quotes&quot; in it\">URL\n      and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with single quotes\">URL\n      and title</ext-link></p>\n    <p>Email link (nobody [at] nowhere.net)</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"\">Empty</ext-link>.</p>\n  </sec>\n  <sec id=\"reference\">\n    <title>Reference</title>\n    <p>Foo\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">bar</ext-link>.</p>\n    <p>Foo\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">bar</ext-link>.</p>\n    <p>Foo\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">bar</ext-link>.</p>\n    <p>With <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">embedded\n      [brackets]</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">b</ext-link> by\n      itself should be a link.</p>\n    <p>Indented\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">once</ext-link>.</p>\n    <p>Indented\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">twice</ext-link>.</p>\n    <p>Indented\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">thrice</ext-link>.</p>\n    <p>This should [not] be a link.</p>\n    <preformat>[not]: /url</preformat>\n    <p>Foo\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quotes&quot; inside\">bar</ext-link>.</p>\n    <p>Foo\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quote&quot; inside\">biz</ext-link>.</p>\n  </sec>\n  <sec id=\"with-ampersands\">\n    <title>With ampersands</title>\n    <p>Here's a\n      <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">link\n      with an ampersand in the URL</ext-link>.</p>\n    <p>Here's a link with an amersand in the link text:\n      <ext-link ext-link-type=\"uri\" xlink:href=\"http://att.com/\" xlink:title=\"AT&amp;T\">AT&amp;T</ext-link>.</p>\n    <p>Here's an\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n      link</ext-link>.</p>\n    <p>Here's an\n      <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n      link in pointy braces</ext-link>.</p>\n  </sec>\n  <sec id=\"autolinks\">\n    <title>Autolinks</title>\n    <p>With an ampersand:\n      <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</ext-link></p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>In a list?</p>\n      </list-item>\n      <list-item>\n        <p><ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n      </list-item>\n      <list-item>\n        <p>It should.</p>\n      </list-item>\n    </list>\n    <p>An e-mail address: nobody [at] nowhere.net</p>\n    <disp-quote>\n      <p>Blockquoted:\n        <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n    </disp-quote>\n    <p>Auto-links should not occur here:\n      <monospace>&lt;http://example.com/&gt;</monospace></p>\n    <preformat>or here: &lt;http://example.com/&gt;</preformat>\n  </sec>\n</sec>\n<sec id=\"images\">\n  <title>Images</title>\n  <p>From &quot;Voyage dans la Lune&quot; by Georges Melies (1902):</p>\n  <p><inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"lalune.jpg\" xlink:title=\"Voyage dans la Lune\" /></p>\n  <p>Here is a movie\n    <inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"movie.jpg\" />\n    icon.</p>\n</sec>\n<sec id=\"footnotes\">\n  <title>Footnotes</title>\n  <p>Here is a footnote reference<xref alt=\"(1)\" rid=\"note_1\">(1)</xref>,\n    and\n    another<xref alt=\"(longnote)\" rid=\"note_longnote\">(longnote)</xref>.\n    This should <italic>not</italic> be a footnote reference, because it\n    contains a space^(my note).</p>\n  <p><xref alt=\"(1)\" rid=\"ref_1\">(1)</xref> Here is the footnote. It can\n    go anywhere in the document, not just at the end.</p>\n  <p><xref alt=\"(longnote)\" rid=\"ref_longnote\">(longnote)</xref> Here's\n    the other note. This one contains multiple blocks.</p>\n  <p>Caret characters are used to indicate that the blocks all belong to\n    a single footnote (as with block quotes).</p>\n  <preformat>  { &lt;code&gt; }</preformat>\n  <p>If you want, you can use a caret at the beginning of every line, as\n    with blockquotes, but all that you need is a caret at the beginning\n    of the first line of the block and any preceding blank lines.</p>\n  <p>text <italic>Leading space</italic></p>\n  <p><italic>Trailing space</italic> text</p>\n  <p>text <italic>Leading spaces</italic></p>\n  <p><italic>Trailing spaces</italic> text</p>\n</sec>\n<sec id=\"tables\">\n  <title>Tables</title>\n  <sec id=\"tables-with-headers\">\n    <title>Tables with Headers</title>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>r1a</p>\n          </th>\n          <th>\n            <p>r1b</p>\n          </th>\n          <th>\n            <p>r1c</p>\n          </th>\n        </tr>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col width=\"33*\" align=\"left\" />\n      <col width=\"33*\" align=\"left\" />\n      <col width=\"33*\" align=\"left\" />\n      <thead>\n        <tr>\n          <th>\n            <p>X</p>\n          </th>\n          <th>\n            <p>Y</p>\n          </th>\n          <th>\n            <p>Z</p>\n          </th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n  </sec>\n  <sec id=\"tables-without-headers\">\n    <title>Tables without Headers</title>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <p>4</p>\n          </td>\n          <td>\n            <p>5</p>\n          </td>\n          <td>\n            <p>6</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n  </sec>\n  <sec id=\"table-with-spans-and-alignments\">\n    <title>Tables with spans and alignments</title>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <thead>\n        <tr>\n            <td colspan=\"2\">\n                <p>1</p>\n            </td>\n            <td align=\"right\">\n                <p>2</p>\n            </td>\n        </tr>\n      </thead>\n      <tbody>\n        <tr>\n        <td colspan=\"2\">\n            <p>1</p>\n        </td>\n        <td align=\"left\">\n            <p>2</p>\n        </td>\n        </tr>\n        <tr>\n        <td rowspan=\"2\">\n            <p>4</p>\n        </td>\n        <td>\n            <p>5</p>\n        </td>\n        <td>\n            <p>6</p>\n        </td>\n        </tr>\n        <tr>\n        <td colspan=\"2\">\n            <p>7</p>\n        </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n  </sec>\n  <sec id=\"table-with-footer\">\n    <title>Table with footer</title>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <tfoot>\n        <tr>\n          <td align=\"right\">\n            <p>f1</p>\n          </td>\n          <td>\n            <p>f2</p>\n          </td>\n          <td>\n            <p>f3</p>\n          </td>\n        </tr>\n        <tr>\n          <td align=\"right\">\n            <p>f4</p>\n          </td>\n          <td>\n            <p>f5</p>\n          </td>\n          <td>\n            <p>f6</p>\n          </td>\n        </tr>\n      </tfoot>\n      <tbody>\n        <tr>\n          <td>\n            <p>1</p>\n          </td>\n          <td>\n            <p>2</p>\n          </td>\n          <td>\n            <p>3</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n  </sec>\n  <sec id=\"table-with-multiple-bodies\">\n    <title>Table With Multiple Bodies</title>\n    <table-wrap><table>\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <col align=\"left\" />\n      <tbody>\n        <tr>\n          <td align=\"right\">\n            <p>a1</p>\n          </td>\n          <td>\n            <p>a2</p>\n          </td>\n          <td>\n            <p>a3</p>\n          </td>\n        </tr>\n      </tbody>\n      <tbody>\n        <tr>\n          <td>\n            <p>b1</p>\n          </td>\n          <td>\n            <p>b2</p>\n          </td>\n          <td>\n            <p>b3</p>\n          </td>\n        </tr>\n      </tbody>\n    </table></table-wrap>\n  </sec>\n  <sec id=\"empty-tables\">\n    <title>Empty Tables</title>\n    <p>This section should be empty.</p>\n  </sec>\n</sec>\n</body>\n<back>\n  <ref-list>\n    <title>References</title>\n    <ref id=\"ref_1\"><note><p>This is reference 1</p></note></ref>\n    <ref id=\"ref_longnote\"><note><p>This is a long note</p></note></ref>\n  </ref-list>\n  <ref-list>\n    <title>Notes</title>\n    <ref id=\"note_1\"><note><p>This is note 1</p></note></ref>\n    <ref id=\"note_longnote\"><note><p>This is another long note</p></note></ref>\n  </ref-list>\n</back>\n</article>\n"
  },
  {
    "path": "test/jira-reader.jira",
    "content": "h1. {anchor:headers}Headers\nh2. {anchor:level-2-with-an-embedded-link}Level 2 with an [embedded link|https://test.example/url]\nh3. {anchor:level-3-with-emphasis}Level 3 with _emphasis_\nh4. Level 4\nh5. Level 5\nh6. Level 6\n\nh0. this is not a header.\n\n----\nh1. Paragraphs\nHere’s a regular paragraph.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n----\nh1. Block Quotes\nE-mail style:\n\nbq. This is a block quote. It is pretty short.\n{quote}\nCode in a block quote:\n\n{code:java}\nsub status {\n    print \"working\";\n}\n{code}\n\nAn enumeration:\n\n# item one\n# item two\n{quote}\n\nA following paragraph.\n\n----\nh1. Code Blocks\n\nCode:\n\n{code:java}\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n{code}\nAnd:\n\n{code:java}\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n{code}\n\n----\nh1. {anchor:lists}Lists\nh2. {anchor:unordered}Unordered\nAsterisks:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nMinuses:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nh2. Ordered\n\n# First\n# Second\n# Third\n\nLinebreak in paragraph:\n\n# Item 1, line one.\nItem 1. line two. The quick brown fox jumped over the lazy dog’s back.\n# Item 2.\n# Item 3.\n\nh2. Nested\n* Tab\n** Tab\n*** Tab\n\nHere’s another:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\nNested enumerations:\n\n# Essential\n## Important\n### Relevant\n#### Insignificant\n\n----\nh1. Linebreaks and Markup in Lists\n\n* *apple*\nred fruit\n* *orange*\norange fruit\n* *banana*\nyellow fruit\n\nMultiple blocks with italics:\n\n* *_apple_*\nred fruit\ncontains seeds, crisp, pleasant to taste\n* *_orange_*\norange fruit\n{code:java}\n{ orange code block }\n{code}\nbq. orange block quote\n\n----\nh1. Colored Text Blocks\n{color:red}\nThis is red.\n{color}\n\nh2. Eiffel 65\n\n{color:blue}\nda ba dee\n{color}\n\n----\nh1. Inline Markup\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _[emphasized link|https://my.example/url]_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: {{>}}, {{$}}, {{&bsol;}}, {{&bsol;$}}, {{<html>}}.\n\n-This is _strikeout_.-\n\nSuperscripts: a{^}bc{^}d a{^}_hello_{^} a{^}hello there{^}.\n\nSubscripts: H{~}2{~}O, C{~}6{~}H{~}12{~}O{~}6{~}, C{~} n {~}H{~}_2n_{~}O{~}n{~}.\n\nThese should not be superscripts or subscripts, because of markers used within words: a^b c^d, a~b c~d.\n\n----\nh1. Dashes, and emoticons\n\nSome dashes: one -- two --- three.\n\nSure (/)\nNope (x)\n\nNice :D\n\nCapital d\\:D\n\n----\nh1. Math\n\n* 2 + 2 = 4\n* _x_ ∈ {_}y{_}\n* _α_ ∧ {_}ω{_}\n* _p_-Tree\n* Here’s one more: _α_ + {_}ω{_} × {_}x{_}^2^.\n\n\n----\nh1. Special Characters\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&amp;T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: &bsol;\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n----\nh1. Links\nh2. Explicit\nJust a [URL|https://example.org/url].\n\n[File URL|file://some/file/name/].\n\n[IRC link|irc://example.org/pandoc].\n\n[Email link|mailto:nobody@nowhere.invalid]\n\n[Not a link|not a URL].\n\nh2. Reference\nWith [embedded \\[brackets\\]|https://example.net/url/].\n\nhttps://pandoc.org by itself should be a link.\n\nh2. With ampersands\nHere’s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].\n\nHere’s a link with an ampersand in the link text: [AT&T|http://att.com/].\n\nh2. Autolinks\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n* In a list?\n* http://example.com/\n* It should.\n\nAn e-mail address: mailto:nobody@nowhere.invalid\n\nbq. Blockquoted: http://example.com/\n\n{code:java}\nAutolink should not occur here: <http://example.com/>\n{code}\n\n----\nh1. Images\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n!lalune.jpg!\n\nHere is a movie !movie.jpg! icon.\n"
  },
  {
    "path": "test/jira-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header\n      1\n      ( \"\" , [] , [] )\n      [ Span ( \"headers\" , [] , [] ) [] , Str \"Headers\" ]\n  , Header\n      2\n      ( \"\" , [] , [] )\n      [ Span ( \"level-2-with-an-embedded-link\" , [] , [] ) []\n      , Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"https://test.example/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Span ( \"level-3-with-emphasis\" , [] , [] ) []\n      , Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      6 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"6\" ]\n  , Para\n      [ Str \"h0.\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"break\"\n      , LineBreak\n      , Str \"here.\"\n      ]\n  , HorizontalRule\n  , Header\n      1 ( \"\" , [] , [] ) [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , Space\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [ \"java\" ] , [] )\n          \"sub status {\\n    print \\\"working\\\";\\n}\\n\"\n      , Para [ Str \"An\" , Space , Str \"enumeration:\" ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Para [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , HorizontalRule\n  , Header\n      1 ( \"\" , [] , [] ) [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [ \"java\" ] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [ \"java\" ] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\\n\"\n  , HorizontalRule\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Span ( \"lists\" , [] , [] ) [] , Str \"Lists\" ]\n  , Header\n      2\n      ( \"\" , [] , [] )\n      [ Span ( \"unordered\" , [] , [] ) [] , Str \"Unordered\" ]\n  , Para [ Str \"Asterisks:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Ordered\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Linebreak\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"paragraph:\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"one.\"\n            , LineBreak\n            , Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog\\8217s\"\n            , Space\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Para [ Str \"Tab\" ]\n        , BulletList\n            [ [ Para [ Str \"Tab\" ]\n              , BulletList [ [ Para [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"Nested\" , Space , Str \"enumerations:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Essential\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Para [ Str \"Important\" ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Para [ Str \"Relevant\" ]\n                    , OrderedList\n                        ( 1 , DefaultStyle , DefaultDelim )\n                        [ [ Para [ Str \"Insignificant\" ] ] ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Linebreaks\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"Markup\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"Lists\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Strong [ Str \"apple\" ]\n            , LineBreak\n            , Str \"red\"\n            , Space\n            , Str \"fruit\"\n            ]\n        ]\n      , [ Para\n            [ Strong [ Str \"orange\" ]\n            , LineBreak\n            , Str \"orange\"\n            , Space\n            , Str \"fruit\"\n            ]\n        ]\n      , [ Para\n            [ Strong [ Str \"banana\" ]\n            , LineBreak\n            , Str \"yellow\"\n            , Space\n            , Str \"fruit\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"italics:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Strong [ Emph [ Str \"apple\" ] ]\n            , LineBreak\n            , Str \"red\"\n            , Space\n            , Str \"fruit\"\n            , LineBreak\n            , Str \"contains\"\n            , Space\n            , Str \"seeds,\"\n            , Space\n            , Str \"crisp,\"\n            , Space\n            , Str \"pleasant\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"taste\"\n            ]\n        ]\n      , [ Para\n            [ Strong [ Emph [ Str \"orange\" ] ]\n            , LineBreak\n            , Str \"orange\"\n            , Space\n            , Str \"fruit\"\n            ]\n        , CodeBlock\n            ( \"\" , [ \"java\" ] , [] ) \"{ orange code block }\\n\"\n        , BlockQuote\n            [ Para\n                [ Str \"orange\"\n                , Space\n                , Str \"block\"\n                , Space\n                , Str \"quote\"\n                ]\n            ]\n        ]\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Colored\"\n      , Space\n      , Str \"Text\"\n      , Space\n      , Str \"Blocks\"\n      ]\n  , Div\n      ( \"\" , [] , [ ( \"color\" , \"red\" ) ] )\n      [ Para\n          [ LineBreak\n          , Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"red.\"\n          ]\n      ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"Eiffel\" , Space , Str \"65\" ]\n  , Div\n      ( \"\" , [] , [ ( \"color\" , \"blue\" ) ] )\n      [ Para\n          [ LineBreak\n          , Str \"da\"\n          , Space\n          , Str \"ba\"\n          , Space\n          , Str \"dee\"\n          ]\n      ]\n  , HorizontalRule\n  , Header\n      1 ( \"\" , [] , [] ) [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , Space , Str \"link\" ]\n              ( \"https://my.example/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"strikeout\" ]\n          , Str \".\"\n          ]\n      ]\n  , Para\n      [ Str \"Superscripts:\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"bc\" ]\n      , Str \"d\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Emph [ Str \"hello\" ] ]\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"hello\\160there\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Subscripts:\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"2\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"C\"\n      , Subscript [ Str \"6\" ]\n      , Str \"H\"\n      , Subscript [ Str \"12\" ]\n      , Str \"O\"\n      , Subscript [ Str \"6\" ]\n      , Str \",\"\n      , Space\n      , Str \"C\"\n      , Subscript [ Str \"\\160n\\160\" ]\n      , Str \"H\"\n      , Subscript [ Emph [ Str \"2n\" ] ]\n      , Str \"O\"\n      , Subscript [ Str \"n\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"superscripts\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"subscripts,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"markers\"\n      , Space\n      , Str \"used\"\n      , Space\n      , Str \"within\"\n      , Space\n      , Str \"words:\"\n      , Space\n      , Str \"a^b\"\n      , Space\n      , Str \"c^d,\"\n      , Space\n      , Str \"a~b\"\n      , Space\n      , Str \"c~d.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Dashes,\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"emoticons\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"\\8211\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"three.\"\n      ]\n  , Para\n      [ Str \"Sure\"\n      , Space\n      , Str \"\\10004\"\n      , LineBreak\n      , Str \"Nope\"\n      , Space\n      , Str \"\\10060\"\n      ]\n  , Para [ Str \"Nice\" , Space , Str \"\\128515\" ]\n  , Para [ Str \"Capital\" , Space , Str \"d:D\" ]\n  , HorizontalRule\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Math\" ]\n  , BulletList\n      [ [ Para [ Str \"2\\8197+\\8197\\&2\\8196=\\8196\\&4\" ] ]\n      , [ Para\n            [ Emph [ Str \"x\" ]\n            , Str \"\\8196\\8712\\8196\"\n            , Emph [ Str \"y\" ]\n            ]\n        ]\n      , [ Para\n            [ Emph [ Str \"\\945\" ]\n            , Str \"\\8197\\8743\\8197\"\n            , Emph [ Str \"\\969\" ]\n            ]\n        ]\n      , [ Para [ Emph [ Str \"p\" ] , Str \"-Tree\" ] ]\n      , [ Para\n            [ Str \"Here\\8217s\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"more:\"\n            , Space\n            , Emph [ Str \"\\945\" ]\n            , Str \"\\8197+\\8197\"\n            , Emph [ Str \"\\969\" ]\n            , Str \"\\8197\\215\\8197\"\n            , Emph [ Str \"x\" ]\n            , Superscript [ Str \"2\" ]\n            , Str \".\"\n            ]\n        ]\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n        ]\n      , [ Para\n            [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Para [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Para\n            [ Str \"set\"\n            , Space\n            , Str \"membership:\"\n            , Space\n            , Str \"\\8712\"\n            ]\n        ]\n      , [ Para [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , HorizontalRule\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" ]\n          ( \"https://example.org/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"File\" , Space , Str \"URL\" ]\n          ( \"file://some/file/name/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"IRC\" , Space , Str \"link\" ]\n          ( \"irc://example.org/pandoc\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Email\" , Space , Str \"link\" ]\n          ( \"mailto:nobody@nowhere.invalid\" , \"\" )\n      ]\n  , Para\n      [ Str \"[Not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link|not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"URL].\"\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n          ( \"https://example.net/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"https://pandoc.org\" ]\n          ( \"https://pandoc.org\" , \"\" )\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"AT&T\" ] ( \"http://att.com/\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n        ]\n      , [ Para\n            [ Link\n                ( \"\" , [] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Para [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:nobody@nowhere.invalid\" ]\n          ( \"mailto:nobody@nowhere.invalid\" , \"\" )\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , Space\n          , Link\n              ( \"\" , [] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , CodeBlock\n      ( \"\" , [ \"java\" ] , [] )\n      \"Autolink should not occur here: <http://example.com/>\\n\"\n  , HorizontalRule\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Str \"\\\"Voyage\"\n      , Space\n      , Str \"dans\"\n      , Space\n      , Str \"la\"\n      , Space\n      , Str \"Lune\\\"\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Para [ Image ( \"\" , [] , [] ) [] ( \"lalune.jpg\" , \"\" ) ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/latex-reader.latex",
    "content": "\\documentclass{article}\n\\usepackage[utf8x]{inputenc}\n\n\\usepackage{hyperref}\n\\usepackage[normalem]{ulem}\n\\usepackage{enumerate}\n\\usepackage{setspace}\n\\usepackage{fancyvrb}\n\\usepackage{graphicx}\n\\VerbatimFootnotes % allows verbatim text in footnotes\n\n\\title{Pandoc Test Suite}\n\\author{John MacFarlane \\and Anonymous}\n\\date{July 17, 2006}\n\n\\begin{document}\n\\maketitle\n\nThis is a set of tests for pandoc. Most of them are adapted from\nJohn Gruber's markdown test suite.\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Headers}\n\n\\subsection{Level 2 with an \\href{/url}{embedded link}}\n\n\\subsubsection{Level 3 with \\emph{emphasis}}\n\nLevel 4\n\nLevel 5\n\n\\section[alt title ignored]{Level 1}\n\n\\subsection{Level 2 with \\emph{emphasis}}\n\n\\subsubsection{Level 3}\n\nwith no blank line\n\n\\subsection{Level 2}\n\nwith no blank line\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Paragraphs}\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a\nlist item. Because a hard-wrapped line in the middle of a paragraph\nlooked like a list item.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break\\\\here.\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Block Quotes}\n\nE-mail style:\n\n\\begin{quote}\nThis is a block quote. It is pretty short.\n\n\\end{quote}\n\\begin {quote}\nCode in a block quote:\n\n\\begin{verbatim}\nsub status {\n    print \"working\";\n}\n\\end{verbatim}\nA list:\n\n\\begin{enumerate}[1.]\n\\item \n  item one\n\\item \n  item two\n\\end{enumerate}\nNested block quotes:\n\n\\begin{quote}\nnested\n\n\\end{quote}\n\\begin{quote}\nnested\n\n\\end{quote}\n\\end{quote}\nThis should not be a block quote: 2 \\textgreater{} 1.\n\nBox-style:\n\n\\begin{quote}\nExample:\n\n\\begin{verbatim}\nsub status {\n    print \"working\";\n}\n\\end{verbatim}\n\\end{quote}\n\\begin{quote}\n\\begin{enumerate}[1.]\n\\item \n  do laundry\n\\item \n  take out the trash\n\\end{enumerate}\n\\end{quote}\nHere's a nested one:\n\n\\begin{quote}\nJoe said:\n\n\\begin{quote}\nDon't quote me.\n\n\\end{quote}\n\\end{quote}\nAnd a following paragraph.\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Code Blocks}\n\nCode:\n\n\\begin{verbatim}\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n\\end{verbatim}\nAnd:\n\n\\begin{verbatim}\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\\end{verbatim}\n\n\\begin{obeylines}\nthis has \\emph{two\nlines}\n\\end{obeylines}\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Lists}\n\n\\subsection{Unordered}\n\nAsterisks tight:\n\n\\begin{itemize}\n\\item \n  asterisk 1\n\\item \n  asterisk 2\n\\item \n  asterisk 3\n\\end{itemize}\nAsterisks loose:\n\n\\begin{itemize}\n\\item \n  asterisk 1\n\n\\item \n  asterisk 2\n\n\\item \n  asterisk 3\n\n\\end{itemize}\nPluses tight:\n\n\\begin{itemize}\n\\item \n  Plus 1\n\\item \n  Plus 2\n\\item \n  Plus 3\n\\end{itemize}\nPluses loose:\n\n\\begin{itemize}\n\\item \n  Plus 1\n\n\\item \n  Plus 2\n\n\\item \n  Plus 3\n\n\\end{itemize}\nMinuses tight:\n\n\\begin{itemize}\n\\item \n  Minus 1\n\\item \n  Minus 2\n\\item \n  Minus 3\n\\end{itemize}\nMinuses loose:\n\n\\begin{itemize}\n\\item \n  Minus 1\n\n\\item \n  Minus 2\n\n\\item \n  Minus 3\n\n\\end{itemize}\n\\subsection{Ordered}\n\nTight:\n\n\\begin{enumerate}[1.]\n\\item \n  First\n\\item \n  Second\n\\item \n  Third\n\\end{enumerate}\nand:\n\n\\begin{enumerate}[1.]\n\\item \n  One\n\\item \n  Two\n\\item \n  Three\n\\end{enumerate}\nLoose using tabs:\n\n\\begin{enumerate}[1.]\n\\item \n  First\n\n\\item \n  Second\n\n\\item \n  Third\n\n\\end{enumerate}\nand using spaces:\n\n\\begin{enumerate}[1.]\n\\item \n  One\n\n\\item \n  Two\n\n\\item \n  Three\n\n\\end{enumerate}\nMultiple paragraphs:\n\n\\begin{enumerate}[1.]\n\\item \n  Item 1, graf one.\n\n  Item 1. graf two. The quick brown fox jumped over the lazy dog's\n  back.\n\n\\item \n  Item 2.\n\n\\item \n  Item 3.\n\n\\end{enumerate}\n\\subsection{Nested}\n\n\\begin{itemize}\n\\item \n  Tab\n  \\begin{itemize}\n  \\item \n    Tab\n    \\begin{itemize}\n    \\item \n      Tab\n    \\end{itemize}\n  \\end{itemize}\n\\end{itemize}\nHere's another:\n\n\\begin{enumerate}[1.]\n\\item \n  First\n\\item \n  Second:\n  \\begin{itemize}\n  \\item \n    Fee\n  \\item \n    Fie\n  \\item \n    Foe\n  \\end{itemize}\n\\item \n  Third\n\\end{enumerate}\nSame thing but with paragraphs:\n\n\\begin{enumerate}[1.]\n\\item \n  First\n\n\\item \n  Second:\n\n  \\begin{itemize}\n  \\item \n    Fee\n  \\item \n    Fie\n  \\item \n    Foe\n  \\end{itemize}\n\\item \n  Third\n\n\\end{enumerate}\n\\subsection{Tabs and spaces}\n\n\\begin{itemize}\n\\item \n  this is a list item indented with tabs\n\n\\item \n  this is a list item indented with spaces\n\n  \\begin{itemize}\n  \\item \n    this is an example list item indented with tabs\n\n  \\item \n    this is an example list item indented with spaces\n\n  \\end{itemize}\n\\end{itemize}\n\\subsection{Fancy list markers}\n\n\\begin{enumerate}[(1)]\n\\setcounter{enumi}{1}\n\\item \n  begins with 2\n\\item \n  and now 3\n\n  with a continuation\n\n  \\begin{enumerate}[i.]\n  \\setcounter{enumii}{3}\n  \\item \n    sublist with roman numerals, starting with 4\n  \\item \n    more items\n    \\begin{enumerate}[(A)]\n    \\item \n      a subsublist\n    \\item \n      a subsublist\n    \\end{enumerate}\n  \\end{enumerate}\n\\end{enumerate}\nNesting:\n\n\\begin{enumerate}[A.]\n\\item \n  Upper Alpha\n  \\begin{enumerate}[I.]\n  \\item \n    Upper Roman.\n    \\begin{enumerate}[(1)]\n    \\setcounter{enumiii}{5}\n    \\item \n      Decimal start with 6\n      \\begin{enumerate}[a)]\n      \\setcounter{enumiv}{2}\n      \\item \n        Lower alpha with paren\n      \\end{enumerate}\n    \\end{enumerate}\n  \\end{enumerate}\n\\end{enumerate}\nAutonumbering:\n\n\\begin{enumerate}\n\\item \n  Autonumber.\n\\item \n  More.\n  \\begin{enumerate}\n  \\item \n    Nested.\n  \\end{enumerate}\n\\end{enumerate}\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Definition Lists}\n\nTight using spaces:\n\n\\begin{description}\n\\item[apple]\nred fruit\n\\item[orange]\norange fruit\n\\item[banana]\nyellow fruit\n\\end{description}\nTight using tabs:\n\n\\begin{description}\n\\item[apple]\nred fruit\n\\item[orange]\norange fruit\n\\item[banana]\nyellow fruit\n\\end{description}\nLoose:\n\n\\begin{description}\n\\item[apple]\nred fruit\n\n\\item[orange]\norange fruit\n\n\\item[banana]\nyellow fruit\n\n\\end{description}\nMultiple blocks with italics:\n\n\\begin{description}\n\\item[\\emph{apple}]\nred fruit\n\ncontains seeds, crisp, pleasant to taste\n\n\\item[\\emph{orange}]\norange fruit\n\n\\begin{verbatim}\n{ orange code block }\n\\end{verbatim}\n\\begin{quote}\norange block quote\n\n\\end{quote}\n\\end{description}\n\\section{HTML Blocks}\n\nSimple block on one line:\n\nfoo\nAnd nested without indentation:\n\nfoo\nbar\nInterpreted markdown in a table:\n\nThis is \\emph{emphasized}\nAnd this is \\textbf{strong}\nHere's a simple block:\n\nfoo\nThis should be a code block, though:\n\n\\begin{verbatim}\n<div>\n    foo\n</div>\n\\end{verbatim}\nAs should this:\n\n\\begin{verbatim}\n<div>foo</div>\n\\end{verbatim}\nNow, nested:\n\nfoo\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n\\begin{verbatim}\n<!-- Comment -->\n\\end{verbatim}\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n\\begin{verbatim}\n<hr />\n\\end{verbatim}\nHr's:\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Inline Markup}\n\nThis is \\emph{emphasized}, and so \\emph{is this}.\n\nThis is \\textbf{strong}, and so \\textbf{is this}.\n\nAn \\emph{\\href{/url}{emphasized link}}.\n\n\\textbf{\\emph{This is strong and em.}}\n\nSo is \\textbf{\\emph{this}} word.\n\n\\textbf{\\emph{This is strong and em.}}\n\nSo is \\textbf{\\emph{this}} word.\n\nThis is code: \\verb!>!, \\verb!$!, \\verb!\\!, \\verb!\\$!,\n\\verb!<html>!.\n\n\\sout{This is \\emph{strikeout}.}\n\nSuperscripts: a\\textsuperscript{bc}d\na\\textsuperscript{\\emph{hello}} a\\textsuperscript{hello there}.\n\nSubscripts: H\\textsubscript{2}O, H\\textsubscript{23}O,\nH\\textsubscript{many of them}O.\n\nThese should not be superscripts or subscripts, because of the\nunescaped spaces: a\\^{}b c\\^{}d, a\\ensuremath{\\sim}b\nc\\ensuremath{\\sim}d.\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Smart quotes, ellipses, dashes}\n\n``Hello,'' said the spider. ``\\,`Shelob' is my name.''\n\n`A', `B', and `C' are letters.\n\n`Oak,' `elm,' and `beech' are names of trees. So is `pine.'\n\n`He said, ``I want to go.''\\,' Were you alive in the 70's?\n\nHere is some quoted `\\verb!code!' and a\n``\\href{http://example.com/?foo=1&bar=2}{quoted link}''.\n\nSome dashes: one---two---three---four---five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses\\ldots{}and\\ldots{}and\\ldots{}.\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{LaTeX}\n\n\\begin{itemize}\n\\item \n  \\cite[22-23]{smith.1899}\n\\item \n  \\doublespacing\n\\item \n  $2+2=4$\n\\item \n  $x \\in y$\n\\item \n  $\\alpha \\wedge \\omega$\n\\item \n  $223$\n\\item \n  $p$-Tree\n\\item \n  $\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$\n\\item \n  Here's one that has a line break in it:\n  $\\alpha + \\omega \\times x^2$.\n\\end{itemize}\nThese shouldn't be math:\n\n\\begin{itemize}\n\\item \n  To get the famous equation, write \\verb!$e = mc^2$!.\n\\item \n  \\$22,000 is a \\emph{lot} of money. So is \\$34,000. (It worked if\n  ``lot'' is emphasized.)\n\\item \n  Escaped \\verb!$!: \\$73 \\emph{this should be emphasized} 23\\$.\n\\end{itemize}\nHere's a LaTeX table:\n\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n\nA table with one column:\n\n\\begin{tabular}{c}\nAnimal \\\\\nVegetable\n\\end{tabular}\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Special Characters}\n\nHere is some unicode:\n\n\\begin{itemize}\n\\item \n  I hat: Î\n\\item \n  o umlaut: ö\n\\item \n  section: §\n\\item \n  set membership: ∈\n\\item \n  copyright: ©\n\\end{itemize}\nAT\\&T has an ampersand in their name.\n\nAT\\&T is another way to write it.\n\nThis \\& that.\n\n4 \\textless{} 5.\n\n6 \\textgreater{} 5.\n\nBackslash: \\textbackslash{}\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: \\textgreater{}\n\nHash: \\#\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Links}\n\n\\subsection{Explicit}\n\nJust a \\href{/url/}{URL}.\n\n\\href{/url/}{URL and title}.\n\n\\href{/url/}{URL and title}.\n\n\\href{/url/}{URL and title}.\n\n\\href{/url/}{URL and title}\n\n\\href{/url/}{URL and title}\n\n\\href{/url/with_underscore}{with\\_underscore}\n\n\\href{mailto:nobody@nowhere.net}{Email link}\n\n\\href{}{Empty}.\n\n\\subsection{Reference}\n\nFoo \\href{/url/}{bar}.\n\nFoo \\href{/url/}{bar}.\n\nFoo \\href{/url/}{bar}.\n\nWith \\href{/url/}{embedded [brackets]}.\n\n\\href{/url/}{b} by itself should be a link.\n\nIndented \\href{/url}{once}.\n\nIndented \\href{/url}{twice}.\n\nIndented \\href{/url}{thrice}.\n\nThis should [not][] be a link.\n\n\\begin{verbatim}\n[not]: /url\n\\end{verbatim}\nFoo \\href{/url/}{bar}.\n\nFoo \\href{/url/}{biz}.\n\n\\subsection{With ampersands}\n\nHere's a\n\\href{http://example.com/?foo=1&bar=2}{link with an ampersand in the URL}.\n\nHere's a link with an amersand in the link text:\n\\href{http://att.com/}{AT\\&T}.\n\nHere's an \\href{/script?foo=1&bar=2}{inline link}.\n\nHere's an\n\\href{/script?foo=1&bar=2}{inline link in pointy braces}.\n\n\\subsection{Autolinks}\n\nWith an ampersand: \\url{http://example.com/?foo=1&bar=2}\n\n\\begin{itemize}\n\\item \n  In a list?\n\\item \n  \\url{http://example.com/}\n\\item \n  It should.\n\\end{itemize}\nAn e-mail address:\n\\href{mailto:nobody@nowhere.net}{nobody@nowhere.net}\n\n\\begin{quote}\nBlockquoted: \\url{http://example.com/}\n\n\\end{quote}\nAuto-links should not occur here: \\verb!<http://example.com/>!\n\n\\begin{verbatim}\nor here: <http://example.com/>\n\\end{verbatim}\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Images}\n\nFrom ``Voyage dans la Lune'' by Georges Melies (1902):\n\n\\includegraphics{lalune.jpg}\n\nHere is a movie \\includegraphics{movie.jpg} icon.\n\n\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n\\section{Footnotes}\n\nHere is a footnote\nreference,\\footnote{ Here is the footnote. It can go anywhere after the footnote\nreference. It need not be placed at the end of the document.\n}\nand\nanother.\\footnote{ Here's the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the\nfootnote (as with list items).\n\n\\begin{Verbatim}\n  { <code> }\n\\end{Verbatim}\nIf you want, you can indent every line, but you can also be lazy\nand just indent the first line of each block.\n}\nThis should \\emph{not} be a footnote reference, because it contains\na space.[\\^{}my note] Here is an inline\nnote.\\footnote{ This is \\emph{easier} to type. Inline notes may contain\n\\href{http://google.com}{links} and \\verb!]! verbatim characters,\nas well as [bracketed text].\n}\n\n\\begin{quote}\nNotes can go in quotes.\\footnote{ In quote.\n}\n\n\\end{quote}\n\\begin{enumerate}[1.]\n\\item \n  And in list items.\\footnote{ In list.\n}\n\\end{enumerate}\nThis paragraph should not be part of the note, as it is not\nindented.\n\n\\section{Escaped characters}\n\n\\$ \\% \\& \\# \\_ \\{ \\}\n\n\\end{document}\n"
  },
  {
    "path": "test/latex-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n                , MetaInlines [ Str \"Anonymous\" ]\n                ]\n            )\n          , ( \"date\"\n            , MetaInlines\n                [ Str \"July\" , Space , Str \"17,\" , Space , Str \"2006\" ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\"\n                , Space\n                , Str \"Test\"\n                , Space\n                , Str \"Suite\"\n                ]\n            )\n          ]\n    }\n  [ RawBlock (Format \"latex\") \"\\\\maketitle\"\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , SoftBreak\n      , Str \"John\"\n      , Space\n      , Str \"Gruber\\8217s\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"headers\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Para [ Str \"Level\" , Space , Str \"4\" ]\n  , Para [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1 ( \"level-1\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"level-2-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      3 ( \"level-3\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header\n      2 ( \"level-2\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , Space\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , Space\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , SoftBreak\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"break\"\n      , LineBreak\n      , Str \"here.\"\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , Space\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , Para [ Str \"A\" , Space , Str \"list:\" ]\n      , OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Para [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Para [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quotes:\"\n          ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \">\"\n      , Space\n      , Str \"1.\"\n      ]\n  , Para [ Str \"Box-style:\" ]\n  , BlockQuote\n      [ Para [ Str \"Example:\" ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      ]\n  , BlockQuote\n      [ OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Para [ Str \"do\" , Space , Str \"laundry\" ] ]\n          , [ Para\n                [ Str \"take\"\n                , Space\n                , Str \"out\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"trash\"\n                ]\n            ]\n          ]\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"one:\"\n      ]\n  , BlockQuote\n      [ Para [ Str \"Joe\" , Space , Str \"said:\" ]\n      , BlockQuote\n          [ Para\n              [ Str \"Don\\8217t\"\n              , Space\n              , Str \"quote\"\n              , Space\n              , Str \"me.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , Para\n      [ Str \"this\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Emph [ Str \"two\" , LineBreak , Str \"lines\" ]\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para\n      [ Str \"Loose\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"and\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog\\8217s\"\n            , SoftBreak\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Para [ Str \"Tab\" ]\n        , BulletList\n            [ [ Para [ Str \"Tab\" ]\n              , BulletList [ [ Para [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Same\"\n      , Space\n      , Str \"thing\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"paragraphs:\"\n      ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"tabs-and-spaces\" , [] , [] )\n      [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"tabs\"\n            ]\n        ]\n      , [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            ]\n        , BulletList\n            [ [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"tabs\"\n                  ]\n              ]\n            , [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"spaces\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , OrderedList\n      ( 2 , Decimal , TwoParens )\n      [ [ Para\n            [ Str \"begins\" , Space , Str \"with\" , Space , Str \"2\" ]\n        ]\n      , [ Para [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n        , Para\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"continuation\"\n            ]\n        , OrderedList\n            ( 4 , LowerRoman , Period )\n            [ [ Para\n                  [ Str \"sublist\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"roman\"\n                  , Space\n                  , Str \"numerals,\"\n                  , Space\n                  , Str \"starting\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"4\"\n                  ]\n              ]\n            , [ Para [ Str \"more\" , Space , Str \"items\" ]\n              , OrderedList\n                  ( 1 , UpperAlpha , TwoParens )\n                  [ [ Para [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  , [ Para [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Nesting:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , Period )\n      [ [ Para [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , Period )\n            [ [ Para [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , TwoParens )\n                  [ [ Para\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , OneParen )\n                        [ [ Para\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Autonumber.\" ] ]\n      , [ Para [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Para [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"Should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item:\"\n      ]\n  , Para [ Str \"M.A.\" , Space , Str \"2007\" ]\n  , Para [ Str \"B.\" , Space , Str \"Williams\" ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header\n      1\n      ( \"definition-lists\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"Lists\" ]\n  , Para\n      [ Str \"Tight\"\n      , Space\n      , Str \"using\"\n      , Space\n      , Str \"spaces:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Tight\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para [ Str \"Loose:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"italics:\"\n      ]\n  , DefinitionList\n      [ ( [ Emph [ Str \"apple\" ] ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n            , Para\n                [ Str \"contains\"\n                , Space\n                , Str \"seeds,\"\n                , Space\n                , Str \"crisp,\"\n                , Space\n                , Str \"pleasant\"\n                , Space\n                , Str \"to\"\n                , Space\n                , Str \"taste\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Emph [ Str \"orange\" ] ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , CodeBlock ( \"\" , [] , [] ) \"{ orange code block }\"\n            , BlockQuote\n                [ Para\n                    [ Str \"orange\"\n                    , Space\n                    , Str \"block\"\n                    , Space\n                    , Str \"quote\"\n                    ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1\n      ( \"html-blocks\" , [] , [] )\n      [ Str \"HTML\" , Space , Str \"Blocks\" ]\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"line:\"\n      ]\n  , Para\n      [ Str \"foo\"\n      , SoftBreak\n      , Str \"And\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"indentation:\"\n      ]\n  , Para\n      [ Str \"foo\"\n      , SoftBreak\n      , Str \"bar\"\n      , SoftBreak\n      , Str \"Interpreted\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"table:\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , SoftBreak\n      , Str \"And\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , SoftBreak\n      , Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"simple\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Para\n      [ Str \"foo\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"code\"\n      , Space\n      , Str \"block,\"\n      , Space\n      , Str \"though:\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"<div>\\n    foo\\n</div>\"\n  , Para\n      [ Str \"As\" , Space , Str \"should\" , Space , Str \"this:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<div>foo</div>\"\n  , Para [ Str \"Now,\" , Space , Str \"nested:\" ]\n  , Para\n      [ Str \"foo\"\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"HTML\"\n      , Space\n      , Str \"comment:\"\n      ]\n  , Para [ Str \"Multiline:\" ]\n  , Para [ Str \"Code\" , Space , Str \"block:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<!-- Comment -->\"\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"plain\"\n      , Space\n      , Str \"comment,\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"trailing\"\n      , Space\n      , Str \"spaces\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line:\"\n      ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<hr />\"\n  , Para [ Str \"Hr\\8217s:\" ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , Space , Str \"link\" ]\n              ( \"/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , SoftBreak\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"strikeout\" ]\n          , Str \".\"\n          ]\n      ]\n  , Para\n      [ Str \"Superscripts:\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"bc\" ]\n      , Str \"d\"\n      , SoftBreak\n      , Str \"a\"\n      , Superscript [ Emph [ Str \"hello\" ] ]\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"hello\" , Space , Str \"there\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Subscripts:\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"2\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"23\" ]\n      , Str \"O,\"\n      , SoftBreak\n      , Str \"H\"\n      , Subscript\n          [ Str \"many\" , Space , Str \"of\" , Space , Str \"them\" ]\n      , Str \"O.\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"superscripts\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"subscripts,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"unescaped\"\n      , Space\n      , Str \"spaces:\"\n      , Space\n      , Str \"a^b\"\n      , Space\n      , Str \"c^d,\"\n      , Space\n      , Str \"a\"\n      , Math InlineMath \"\\\\sim\"\n      , Str \"b\"\n      , SoftBreak\n      , Str \"c\"\n      , Math InlineMath \"\\\\sim\"\n      , Str \"d.\"\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header\n      1\n      ( \"smart-quotes-ellipses-dashes\" , [] , [] )\n      [ Str \"Smart\"\n      , Space\n      , Str \"quotes,\"\n      , Space\n      , Str \"ellipses,\"\n      , Space\n      , Str \"dashes\"\n      ]\n  , Para\n      [ Quoted DoubleQuote [ Str \"Hello,\" ]\n      , Space\n      , Str \"said\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"spider.\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"\\8198\"\n          , Quoted SingleQuote [ Str \"Shelob\" ]\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"my\"\n          , Space\n          , Str \"name.\"\n          ]\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"A\" ]\n      , Str \",\"\n      , Space\n      , Quoted SingleQuote [ Str \"B\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted SingleQuote [ Str \"C\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"letters.\"\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"Oak,\" ]\n      , Space\n      , Quoted SingleQuote [ Str \"elm,\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted SingleQuote [ Str \"beech\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"names\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"trees.\"\n      , Space\n      , Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Quoted SingleQuote [ Str \"pine.\" ]\n      ]\n  , Para\n      [ Quoted\n          SingleQuote\n          [ Str \"He\"\n          , Space\n          , Str \"said,\"\n          , Space\n          , Quoted\n              DoubleQuote\n              [ Str \"I\"\n              , Space\n              , Str \"want\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"go.\"\n              ]\n          , Str \"\\8198\"\n          ]\n      , Space\n      , Str \"Were\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"alive\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"70\\8217s?\"\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"quoted\"\n      , Space\n      , Quoted SingleQuote [ Code ( \"\" , [] , [] ) \"code\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Quoted\n          DoubleQuote\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"quoted\" , Space , Str \"link\" ]\n              ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one\\8212two\\8212three\\8212four\\8212five.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"numbers:\"\n      , Space\n      , Str \"5\\8211\\&7,\"\n      , Space\n      , Str \"255\\8211\\&66,\"\n      , Space\n      , Str \"1987\\8211\\&1999.\"\n      ]\n  , Para [ Str \"Ellipses\\8230and\\8230and\\8230.\" ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"latex\" , [] , [] ) [ Str \"LaTeX\" ]\n  , BulletList\n      [ [ Para\n            [ Cite\n                [ Citation\n                    { citationId = \"smith.1899\"\n                    , citationPrefix = []\n                    , citationSuffix = [ Str \"22-23\" ]\n                    , citationMode = NormalCitation\n                    , citationNoteNum = 0\n                    , citationHash = 0\n                    }\n                ]\n                [ RawInline (Format \"latex\") \"\\\\cite[22-23]{smith.1899}\"\n                ]\n            ]\n        ]\n      , [ RawBlock (Format \"latex\") \"\\\\doublespacing\" ]\n      , [ Para [ Math InlineMath \"2+2=4\" ] ]\n      , [ Para [ Math InlineMath \"x \\\\in y\" ] ]\n      , [ Para [ Math InlineMath \"\\\\alpha \\\\wedge \\\\omega\" ] ]\n      , [ Para [ Math InlineMath \"223\" ] ]\n      , [ Para [ Math InlineMath \"p\" , Str \"-Tree\" ] ]\n      , [ Para\n            [ Math\n                InlineMath\n                \"\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to 0}\\\\frac{f(x+h)-f(x)}{h}\"\n            ]\n        ]\n      , [ Para\n            [ Str \"Here\\8217s\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"that\"\n            , Space\n            , Str \"has\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"it:\"\n            , SoftBreak\n            , Math InlineMath \"\\\\alpha + \\\\omega \\\\times x^2\"\n            , Str \".\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"shouldn\\8217t\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"math:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"To\"\n            , Space\n            , Str \"get\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"famous\"\n            , Space\n            , Str \"equation,\"\n            , Space\n            , Str \"write\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$e = mc^2$\"\n            , Str \".\"\n            ]\n        ]\n      , [ Para\n            [ Str \"$22,000\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Emph [ Str \"lot\" ]\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"money.\"\n            , Space\n            , Str \"So\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"$34,000.\"\n            , Space\n            , Str \"(It\"\n            , Space\n            , Str \"worked\"\n            , Space\n            , Str \"if\"\n            , SoftBreak\n            , Quoted DoubleQuote [ Str \"lot\" ]\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"emphasized.)\"\n            ]\n        ]\n      , [ Para\n            [ Str \"Escaped\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$\"\n            , Str \":\"\n            , Space\n            , Str \"$73\"\n            , Space\n            , Emph\n                [ Str \"this\"\n                , Space\n                , Str \"should\"\n                , Space\n                , Str \"be\"\n                , Space\n                , Str \"emphasized\"\n                ]\n            , Space\n            , Str \"23$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"LaTeX\"\n      , Space\n      , Str \"table:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignLeft , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Animal\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Number\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Dog\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cat\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"column:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault ) ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Animal\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Vegetable\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n        ]\n      , [ Para\n            [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Para [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Para\n            [ Str \"set\"\n            , Space\n            , Str \"membership:\"\n            , Space\n            , Str \"\\8712\"\n            ]\n        ]\n      , [ Para [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"\\8216\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"with_underscore\" ]\n          ( \"/url/with_underscore\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Email\" , Space , Str \"link\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"reference\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"[not][]\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"[not]: /url\"\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"biz\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"with-ampersands\" , [] , [] )\n      [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"AT&T\" ] ( \"http://att.com/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\" , Space , Str \"link\" ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"pointy\"\n          , Space\n          , Str \"braces\"\n          ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , Space\n      , Link\n          ( \"\" , [ \"uri\" ] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n        ]\n      , [ Para\n            [ Link\n                ( \"\" , [ \"uri\" ] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Para [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"nobody@nowhere.net\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , Space\n          , Link\n              ( \"\" , [ \"uri\" ] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Auto-links\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"occur\"\n      , Space\n      , Str \"here:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] ) \"or here: <http://example.com/>\"\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"Voyage\"\n          , Space\n          , Str \"dans\"\n          , Space\n          , Str \"la\"\n          , Space\n          , Str \"Lune\"\n          ]\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] ) [ Str \"image\" ] ( \"lalune.jpg\" , \"\" )\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image\n          ( \"\" , [] , [] ) [ Str \"image\" ] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  , Div ( \"\" , [ \"center\" ] , [] ) [ HorizontalRule ]\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , SoftBreak\n      , Str \"reference,\"\n      , Note\n          [ Para\n              [ Str \"Here\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"go\"\n              , Space\n              , Str \"anywhere\"\n              , Space\n              , Str \"after\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote\"\n              , SoftBreak\n              , Str \"reference.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"need\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"placed\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"end\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"document.\"\n              ]\n          ]\n      , SoftBreak\n      , Str \"and\"\n      , SoftBreak\n      , Str \"another.\"\n      , Note\n          [ Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"long\"\n              , Space\n              , Str \"note.\"\n              , Space\n              , Str \"This\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"contains\"\n              , Space\n              , Str \"multiple\"\n              , Space\n              , Str \"blocks.\"\n              ]\n          , Para\n              [ Str \"Subsequent\"\n              , Space\n              , Str \"blocks\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"indented\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"show\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"they\"\n              , Space\n              , Str \"belong\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"the\"\n              , SoftBreak\n              , Str \"footnote\"\n              , Space\n              , Str \"(as\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"list\"\n              , Space\n              , Str \"items).\"\n              ]\n          , CodeBlock ( \"\" , [] , [] ) \"  { <code> }\"\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"want,\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"every\"\n              , Space\n              , Str \"line,\"\n              , Space\n              , Str \"but\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"also\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"lazy\"\n              , SoftBreak\n              , Str \"and\"\n              , Space\n              , Str \"just\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"first\"\n              , Space\n              , Str \"line\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"each\"\n              , Space\n              , Str \"block.\"\n              ]\n          ]\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Emph [ Str \"not\" ]\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"contains\"\n      , SoftBreak\n      , Str \"a\"\n      , Space\n      , Str \"space.[^my\"\n      , Space\n      , Str \"note]\"\n      , Space\n      , Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"inline\"\n      , SoftBreak\n      , Str \"note.\"\n      , Note\n          [ Para\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Emph [ Str \"easier\" ]\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"type.\"\n              , Space\n              , Str \"Inline\"\n              , Space\n              , Str \"notes\"\n              , Space\n              , Str \"may\"\n              , Space\n              , Str \"contain\"\n              , SoftBreak\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"links\" ]\n                  ( \"http://google.com\" , \"\" )\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"]\"\n              , Space\n              , Str \"verbatim\"\n              , Space\n              , Str \"characters,\"\n              , SoftBreak\n              , Str \"as\"\n              , Space\n              , Str \"well\"\n              , Space\n              , Str \"as\"\n              , Space\n              , Str \"[bracketed\"\n              , Space\n              , Str \"text].\"\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Notes\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"go\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"quotes.\"\n          , Note [ Para [ Str \"In\" , Space , Str \"quote.\" ] ]\n          ]\n      ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para\n            [ Str \"And\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items.\"\n            , Note [ Para [ Str \"In\" , Space , Str \"list.\" ] ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"part\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"note,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , SoftBreak\n      , Str \"indented.\"\n      ]\n  , Header\n      1\n      ( \"escaped-characters\" , [] , [] )\n      [ Str \"Escaped\" , Space , Str \"characters\" ]\n  , Para\n      [ Str \"$\"\n      , Space\n      , Str \"%\"\n      , Space\n      , Str \"&\"\n      , Space\n      , Str \"#\"\n      , Space\n      , Str \"_\"\n      , Space\n      , Str \"{\"\n      , Space\n      , Str \"}\"\n      ]\n  ]\n"
  },
  {
    "path": "test/lhs-test-markdown.native",
    "content": "[ Header\n    1\n    ( \"lhs-test\" , [] , [] )\n    [ Str \"lhs\" , Space , Str \"test\" ]\n, Para\n    [ Code ( \"\" , [] , [] ) \"unsplit\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"an\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"that\"\n    , Space\n    , Str \"takes\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"pair\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"values\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"combines\"\n    , Space\n    , Str \"them\"\n    , Space\n    , Str \"to\"\n    , SoftBreak\n    , Str \"return\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"single\"\n    , Space\n    , Str \"value:\"\n    ]\n, CodeBlock\n    ( \"\" , [ \"haskell\" , \"literate\" ] , [] )\n    \"unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\\nunsplit = arr . uncurry\\n          -- arr (\\\\op (x,y) -> x `op` y)\"\n, Para\n    [ Code ( \"\" , [] , [] ) \"(***)\"\n    , Space\n    , Str \"combines\"\n    , Space\n    , Str \"two\"\n    , Space\n    , Str \"arrows\"\n    , Space\n    , Str \"into\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"new\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"running\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"two\"\n    , Space\n    , Str \"arrows\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"a\"\n    , SoftBreak\n    , Str \"pair\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"values\"\n    , Space\n    , Str \"(one\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"first\"\n    , Space\n    , Str \"item\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"pair\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"one\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"the\"\n    , SoftBreak\n    , Str \"second\"\n    , Space\n    , Str \"item\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"pair).\"\n    ]\n, CodeBlock\n    ( \"\" , [] , [] ) \"f *** g = first f >>> second g\"\n, Para [ Str \"Block\" , Space , Str \"quote:\" ]\n, BlockQuote [ Para [ Str \"foo\" , Space , Str \"bar\" ] ]\n]\n"
  },
  {
    "path": "test/lhs-test.fragment.html+lhs",
    "content": "<h1 id=\"lhs-test\">lhs test</h1>\n\n<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>\n\n<pre class=\"sourceCode haskell\"><code>&gt; <span class=\"ot\">unsplit </span><span class=\"ot\">::</span> (<span class=\"dt\">Arrow</span> a) <span class=\"ot\">=&gt;</span> (b <span class=\"ot\">-&gt;</span> c <span class=\"ot\">-&gt;</span> d) <span class=\"ot\">-&gt;</span> a (b, c) d<br/>&gt; unsplit <span class=\"fu\">=</span> arr <span class=\"fu\">.</span> <span class=\"fu\">uncurry</span>       <br/>&gt;           <span class=\"co\">-- arr (\\op (x,y) -&gt; x `op` y) </span></code></pre>\n\n<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p>\n\n<pre><code>f *** g = first f &gt;&gt;&gt; second g</code></pre>\n\n<p>Block quote:</p>\n\n<blockquote>\n<p>foo bar</p>\n</blockquote>\n"
  },
  {
    "path": "test/lhs-test.html",
    "content": "<h1 id=\"lhs-test\">lhs test</h1>\n<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to\nreturn a single value:</p>\n<div class=\"sourceCode\" id=\"cb1\"><pre class=\"sourceCode haskell literate\"><code class=\"sourceCode haskell\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"ot\">unsplit ::</span> (<span class=\"dt\">Arrow</span> a) <span class=\"ot\">=&gt;</span> (b <span class=\"ot\">-&gt;</span> c <span class=\"ot\">-&gt;</span> d) <span class=\"ot\">-&gt;</span> a (b, c) d</span>\n<span id=\"cb1-2\"><a href=\"#cb1-2\" aria-hidden=\"true\" tabindex=\"-1\"></a>unsplit <span class=\"ot\">=</span> arr <span class=\"op\">.</span> <span class=\"fu\">uncurry</span></span>\n<span id=\"cb1-3\"><a href=\"#cb1-3\" aria-hidden=\"true\" tabindex=\"-1\"></a>          <span class=\"co\">-- arr (\\op (x,y) -&gt; x `op` y)</span></span></code></pre></div>\n<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).</p>\n<pre><code>f *** g = first f &gt;&gt;&gt; second g</code></pre>\n<p>Block quote:</p>\n<blockquote>\n<p>foo bar</p>\n</blockquote>\n"
  },
  {
    "path": "test/lhs-test.html+lhs",
    "content": "<h1 id=\"lhs-test\">lhs test</h1>\n<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to\nreturn a single value:</p>\n<div class=\"sourceCode\" id=\"cb1\"><pre class=\"sourceCode literatehaskell literate\"><code class=\"sourceCode literatehaskell\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"ot\">&gt; unsplit ::</span> (<span class=\"dt\">Arrow</span> a) <span class=\"ot\">=&gt;</span> (b <span class=\"ot\">-&gt;</span> c <span class=\"ot\">-&gt;</span> d) <span class=\"ot\">-&gt;</span> a (b, c) d</span>\n<span id=\"cb1-2\"><a href=\"#cb1-2\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"ot\">&gt;</span> unsplit <span class=\"ot\">=</span> arr <span class=\"op\">.</span> <span class=\"fu\">uncurry</span></span>\n<span id=\"cb1-3\"><a href=\"#cb1-3\" aria-hidden=\"true\" tabindex=\"-1\"></a><span class=\"ot\">&gt;</span>           <span class=\"co\">-- arr (\\op (x,y) -&gt; x `op` y)</span></span></code></pre></div>\n<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).</p>\n<pre><code>f *** g = first f &gt;&gt;&gt; second g</code></pre>\n<p>Block quote:</p>\n<blockquote>\n<p>foo bar</p>\n</blockquote>\n"
  },
  {
    "path": "test/lhs-test.latex",
    "content": "\\section{lhs test}\\label{lhs-test}\n\n\\texttt{unsplit} is an arrow that takes a pair of values and combines them to\nreturn a single value:\n\n\\begin{Shaded}\n\\begin{Highlighting}[]\n\\OtherTok{unsplit ::}\\NormalTok{ (}\\DataTypeTok{Arrow}\\NormalTok{ a) }\\OtherTok{=\\textgreater{}}\\NormalTok{ (b }\\OtherTok{{-}\\textgreater{}}\\NormalTok{ c }\\OtherTok{{-}\\textgreater{}}\\NormalTok{ d) }\\OtherTok{{-}\\textgreater{}}\\NormalTok{ a (b, c) d}\n\\NormalTok{unsplit }\\OtherTok{=}\\NormalTok{ arr }\\OperatorTok{.} \\FunctionTok{uncurry}\n          \\CommentTok{{-}{-} arr (\\textbackslash{}op (x,y) {-}\\textgreater{} x \\textasciigrave{}op\\textasciigrave{} y)}\n\\end{Highlighting}\n\\end{Shaded}\n\n\\texttt{(***)} combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).\n\n\\begin{verbatim}\nf *** g = first f >>> second g\n\\end{verbatim}\n\nBlock quote:\n\n\\begin{quote}\nfoo bar\n\\end{quote}\n"
  },
  {
    "path": "test/lhs-test.latex+lhs",
    "content": "\\section{lhs test}\\label{lhs-test}\n\n\\texttt{unsplit} is an arrow that takes a pair of values and combines them to\nreturn a single value:\n\n\\begin{code}\nunsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n          -- arr (\\op (x,y) -> x `op` y)\n\\end{code}\n\n\\texttt{(***)} combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).\n\n\\begin{verbatim}\nf *** g = first f >>> second g\n\\end{verbatim}\n\nBlock quote:\n\n\\begin{quote}\nfoo bar\n\\end{quote}\n"
  },
  {
    "path": "test/lhs-test.markdown",
    "content": "lhs test\n========\n\n`unsplit` is an arrow that takes a pair of values and combines them to\nreturn a single value:\n\n``` {.haskell .literate}\nunsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n          -- arr (\\op (x,y) -> x `op` y)\n```\n\n`(***)` combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).\n\n    f *** g = first f >>> second g\n\nBlock quote:\n\n> foo bar\n"
  },
  {
    "path": "test/lhs-test.markdown+lhs",
    "content": "lhs test\n========\n\n`unsplit` is an arrow that takes a pair of values and combines them to\nreturn a single value:\n\n> unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\n> unsplit = arr . uncurry\n>           -- arr (\\op (x,y) -> x `op` y)\n\n`(***)` combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).\n\n    f *** g = first f >>> second g\n\nBlock quote:\n\n > foo bar\n"
  },
  {
    "path": "test/lhs-test.native",
    "content": "[ Header\n    1\n    ( \"lhs-test\" , [] , [] )\n    [ Str \"lhs\" , Space , Str \"test\" ]\n, Para\n    [ Code ( \"\" , [] , [] ) \"unsplit\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"an\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"that\"\n    , Space\n    , Str \"takes\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"pair\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"values\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"combines\"\n    , Space\n    , Str \"them\"\n    , Space\n    , Str \"to\"\n    , SoftBreak\n    , Str \"return\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"single\"\n    , Space\n    , Str \"value:\"\n    ]\n, CodeBlock\n    ( \"\" , [ \"haskell\" , \"literate\" ] , [] )\n    \"unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\\nunsplit = arr . uncurry\\n          -- arr (\\\\op (x,y) -> x `op` y)\"\n, Para\n    [ Code ( \"\" , [] , [] ) \"(***)\"\n    , Space\n    , Str \"combines\"\n    , Space\n    , Str \"two\"\n    , Space\n    , Str \"arrows\"\n    , Space\n    , Str \"into\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"new\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"by\"\n    , Space\n    , Str \"running\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"two\"\n    , Space\n    , Str \"arrows\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"a\"\n    , SoftBreak\n    , Str \"pair\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"values\"\n    , Space\n    , Str \"(one\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"first\"\n    , Space\n    , Str \"item\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"pair\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"one\"\n    , Space\n    , Str \"arrow\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"the\"\n    , SoftBreak\n    , Str \"second\"\n    , Space\n    , Str \"item\"\n    , Space\n    , Str \"of\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"pair).\"\n    ]\n, CodeBlock\n    ( \"\" , [] , [] ) \"f *** g = first f >>> second g\"\n, Para [ Str \"Block\" , Space , Str \"quote:\" ]\n, BlockQuote [ Para [ Str \"foo\" , Space , Str \"bar\" ] ]\n]\n"
  },
  {
    "path": "test/lhs-test.rst",
    "content": "lhs test\n========\n\n``unsplit`` is an arrow that takes a pair of values and combines them to\nreturn a single value:\n\n.. code:: haskell\n\n   unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\n   unsplit = arr . uncurry\n             -- arr (\\op (x,y) -> x `op` y)\n\n``(***)`` combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).\n\n::\n\n   f *** g = first f >>> second g\n\nBlock quote:\n\n   foo bar\n"
  },
  {
    "path": "test/lhs-test.rst+lhs",
    "content": "lhs test\n========\n\n``unsplit`` is an arrow that takes a pair of values and combines them to\nreturn a single value:\n\n> unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\n> unsplit = arr . uncurry\n>           -- arr (\\op (x,y) -> x `op` y)\n\n``(***)`` combines two arrows into a new arrow by running the two arrows on a\npair of values (one arrow on the first item of the pair and one arrow on the\nsecond item of the pair).\n\n::\n\n   f *** g = first f >>> second g\n\nBlock quote:\n\n   foo bar\n"
  },
  {
    "path": "test/man-reader.man",
    "content": ".TH \"PANDOC-MAN-TESTS\" \"1\" \"Oct 17, 2018\" \"v1.0.1\" \"Pandoc Tests\"\n.PP\nThis is a set of tests for pandoc.\n.PP\n   *   *   *   *   *\n.SH Headers\n.SH Level 1\n.SS Level 2\n\n   *   *   *   *   *\n.SH Paragraphs\n.PP\nHere's a regular paragraph.\n.PP\nAnother paragraph\nIn Markdown 1.0.0 and earlier.\nVersion 8.\nThis line turns into a list item.\nBecause a hard\\-wrapped line in the middle of a paragraph looked like a list\nitem.\n.PP\nThere should be a hard line break\n.PD 0\n.P\n.PD\nhere.\n.PP\n   *   *   *   *   *\n.SH Block Quotes\nCode in a block quote:\n.RS\n.nf\n\\f[C]\nsub\\ status\\ {\n\\ \\ \\ \\ print\\ \"working\";\n}\n\\f[]\n.fi\n.RE\n.PP\nA list:\n.IP \"1.\" 3\nitem one\n.IP \"2.\" 3\nitem two\n.PP\n.SH Code Blocks\n.PP\nCode:\n.IP\n.nf\n\\f[C]\n\\-\\-\\-\\- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\n\\f[]\n.fi\n.PP\nAnd:\n.IP\n.nf\n\\f[C]\n\\tthis code line is indented by one tab\n\\f[]\n.fi\n.PP\n   *   *   *   *   *\n.SH Lists\n.SS Unordered\n.PP\nAsterisks:\n.IP \\[bu] 2\nasterisk 1\n.IP \\[bu] 2\nasterisk 2\n.IP \\[bu] 2\nasterisk 3\n.PP\n.SS Ordered\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond\n.IP \"3.\" 3\nThird\n.PP\n.SS Nested\n.IP \\[bu] 2\nTab\n.RS 2\n.IP \\[bu] 2\nTab\n.RS 2\n.IP \\[bu] 2\nTab\n.RE\n.RE\n.PP\nHere's another:\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond:\n.RS 4\n.IP \\[bu] 2\nFee\n.IP \\[bu] 2\nFie\n.IP \\[bu] 2\nFoe\n.RE\n.IP \"3.\" 3\nThird\n.PP\nSame thing:\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond:\n.RS 4\n.IP \\[bu] 2\nFee\n.IP \\[bu] 2\nFie\n.IP \\[bu] 2\nFoe\n.RE\n.IP \"3.\" 3\nThird\n.SS different styles:\n.IP \"A.\" 3\nUpper Alpha\n.RS 4\n.IP \"I.\" 3\nUpper Roman.\n.RS 4\n.IP \"(6)\" 4\nDecimal start with 6\n.RS 4\n.IP \"c)\" 3\nLower alpha with paren\n.RE\n.RE\n.RE\n.SS Ordered\nDefinition lists\n.TP\n.B term1\ndefinition 1\n.RS\n.PP\ncontinued\n.RE\n.TP\n.B term2\ndefinition 2\n   *   *   *   *   *\n.SH Special Characters\nAT&T has an ampersand in their name.\n.PP\n4 < 5.\n.PP\n6 > 5.\n.PP\nBackslash: \\\\\n.PP\nBacktick: `\n.PP\nAsterisk: *\n.PP\nUnderscore: _\n.PP\nLeft brace: {\n.PP\nRight brace: }\n.PP\nLeft bracket: [\n.PP\nRight bracket: ]\n.PP\nLeft paren: (\n.PP\nRight paren: )\n.PP\nGreater\\-than: >\n.PP\nHash: #\n.PP\nPeriod: .\n.PP\nBang: !\n.PP\nPlus: +\n.PP\nMinus: \\-\n.PP\n.SH Links\n.PP\n.UR http://\\:example.com\nsome random\nsite\n.UE .\n.PP\n.MT me@example.com\nmy email address\n.ME .\n.SH Macros\n.de au\n.B\nMe Myself\n..\n.de auth !!\n.I\nThe author is \\\\$1.\n.!!\n.au\nand I.\n.auth \"John Jones\"\n.ds me The \\f[B]Author\\f[R]\nIt's \\*(me.\n.SH Tables\n.TS\ntab(@);\nr l c l.\nT{\nRight\nT}@T{\nLeft\nT}@T{\nCenter\nT}@T{\nDefault\nT}\n_\nT{\n12\nT}@T{\n12\nT}@T{\n12\nT}@T{\n12\nT}\nT{\n123\nT}@T{\n123\nT}@T{\n123\nT}@T{\n123\nT}\nT{\n1\nT}@T{\n1\nT}@T{\n1\nT}@T{\n1\nT}\n.TE\n.TS\nallbox tab(;);\nrlcl.\nT{\nRight\nT};T{\nLeft\nT};T{\nCenter\nT};T{\nLeft\n\\f[I]more\\f[R]\nT}\n_\nT{\n12\nT};T{\n12\nT};T{\n12\nT};T{\n12\nT}\nT{\n123\nT};T{\n123\nT};T{\n123\nT};T{\n123\nT}\nT{\n1\nT};T{\n1\nT};T{\n1\nT};T{\n1\nT}\n.TE\n.TS\ntab(@);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\nCentered Header\nT}@T{\nLeft Aligned\nT}@T{\nRight Aligned\nT}@T{\nDefault aligned\nT}\n_\nT{\nFirst\nT}@T{\nrow\nT}@T{\n12.0\nT}@T{\nExample of a row that spans multiple lines.\nT}\nT{\nSecond\nT}@T{\nrow\nT}@T{\n5.0\nT}@T{\nHere\\[cq]s another one.\nNote the blank line between rows.\nT}\n.TE\n.PP\nTable without column headers:\n.PP\n.TS\ntab(@);\nr l c r.\nT{\n12\nT}@T{\n12\nT}@T{\n12\nT}@T{\n12\nT}\nT{\n123\nT}@T{\n123\nT}@T{\n123\nT}@T{\n123\nT}\nT{\n1\nT}@T{\n1\nT}@T{\n1\nT}@T{\n1\nT}\n.TE\n.TS\ntab(@);\nrl.\na@b\nT{\n.PP\none\n.PP\ntwo\nT}@T{\n.nf\nsome\n   code\n.fi\nT}\n.TE\n\n"
  },
  {
    "path": "test/man-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"date\"\n            , MetaInlines\n                [ Str \"Oct\" , Space , Str \"17,\" , Space , Str \"2018\" ]\n            )\n          , ( \"footer\" , MetaInlines [ Str \"v1.0.1\" ] )\n          , ( \"header\"\n            , MetaInlines [ Str \"Pandoc\" , Space , Str \"Tests\" ]\n            )\n          , ( \"section\" , MetaInlines [ Str \"1\" ] )\n          , ( \"title\" , MetaInlines [ Str \"PANDOC-MAN-TESTS\" ] )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      ]\n  , Para\n      [ Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      1 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here's\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"Another\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , Space\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , Space\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"break\"\n      ]\n  , Para [ Str \"here.\" ]\n  , Para\n      [ Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      ]\n  , Header\n      1 ( \"\" , [] , [] ) [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para\n      [ Str \"Code\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      ]\n  , BlockQuote\n      [ CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      ]\n  , Para [ Str \"A\" , Space , Str \"list:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"item\" , Space , Str \"one\" ] ]\n      , [ Para [ Str \"item\" , Space , Str \"two\" ] ]\n      ]\n  , Header\n      1 ( \"\" , [] , [] ) [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] ) \"\\tthis code line is indented by one tab\"\n  , Para\n      [ Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      , Space\n      , Str \"*\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Ordered\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Para [ Str \"Tab\" ]\n        , BulletList\n            [ [ Para [ Str \"Tab\" ]\n              , BulletList [ [ Para [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here's\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"Same\" , Space , Str \"thing:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Para [ Str \"Fee\" ] ]\n            , [ Para [ Str \"Fie\" ] ]\n            , [ Para [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"\" , [] , [] )\n      [ Str \"different\" , Space , Str \"styles:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , Period )\n      [ [ Para [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , Period )\n            [ [ Para [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , TwoParens )\n                  [ [ Para\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , OneParen )\n                        [ [ Para\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Definition\" , Space , Str \"lists\" ]\n  , DefinitionList\n      [ ( [ Strong [ Str \"term1\" ] ]\n        , [ [ Para [ Str \"definition\" , Space , Str \"1\" ]\n            , Para [ Str \"continued\" ]\n            ]\n          ]\n        )\n      , ( [ Strong [ Str \"term2\" ] ]\n        , [ [ Para\n                [ Str \"definition\"\n                , Space\n                , Str \"2\"\n                , Space\n                , Str \"*\"\n                , Space\n                , Str \"*\"\n                , Space\n                , Str \"*\"\n                , Space\n                , Str \"*\"\n                , Space\n                , Str \"*\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Links\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"some\" , Space , Str \"randomsite\" ]\n          ( \"http://example.com\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"my\" , Space , Str \"email\" , Space , Str \"address\" ]\n          ( \"mailto:me@example.com\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Macros\" ]\n  , Para\n      [ Strong [ Str \"Me\" , Space , Str \"Myself\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"I.\"\n      , Space\n      , Emph\n          [ Str \"The\"\n          , Space\n          , Str \"author\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"John\"\n          , Space\n          , Str \"Jones.\"\n          ]\n      , Space\n      , Str \"It's\"\n      , Space\n      , Str \"The\"\n      , Space\n      , Strong [ Str \"Author\" ]\n      , Str \".\"\n      ]\n  , Header 1 ( \"\" , [] , [] ) [ Str \"Tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Center\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Center\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" , Space , Emph [ Str \"more\" ] ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Centered\" , Space , Str \"Header\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Left\" , Space , Str \"Aligned\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Right\" , Space , Str \"Aligned\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"First\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Example\"\n                      , Space\n                      , Str \"of\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"row\"\n                      , Space\n                      , Str \"that\"\n                      , Space\n                      , Str \"spans\"\n                      , Space\n                      , Str \"multiple\"\n                      , Space\n                      , Str \"lines.\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Second\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"row\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Here\\8217s\"\n                      , Space\n                      , Str \"another\"\n                      , Space\n                      , Str \"one.\"\n                      , Space\n                      , Str \"Note\"\n                      , Space\n                      , Str \"the\"\n                      , Space\n                      , Str \"blank\"\n                      , Space\n                      , Str \"line\"\n                      , Space\n                      , Str \"between\"\n                      , Space\n                      , Str \"rows.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"headers:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignRight , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"12\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"123\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidth 0.5 )\n      , ( AlignLeft , ColWidth 0.5 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"a\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"one\" ] , Para [ Str \"two\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ CodeBlock ( \"\" , [] , [] ) \"some\\n   code\" ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  ]\n"
  },
  {
    "path": "test/markdown-citations.native",
    "content": "[ Header\n    1\n    ( \"pandoc-with-citeproc-hs\" , [] , [] )\n    [ Str \"Pandoc\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"citeproc-hs\"\n    ]\n, BulletList\n    [ [ Para\n          [ Cite\n              [ Citation\n                  { citationId = \"nonexistent\"\n                  , citationPrefix = []\n                  , citationSuffix = []\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 1\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"[@nonexistent]\" ]\n          ]\n      ]\n    , [ Para\n          [ Cite\n              [ Citation\n                  { citationId = \"nonexistent\"\n                  , citationPrefix = []\n                  , citationSuffix = []\n                  , citationMode = AuthorInText\n                  , citationNoteNum = 2\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"@nonexistent\" ]\n          ]\n      ]\n    , [ Para\n          [ Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = []\n                  , citationSuffix = []\n                  , citationMode = AuthorInText\n                  , citationNoteNum = 3\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"@item1\" ]\n          , Space\n          , Str \"says\"\n          , Space\n          , Str \"blah.\"\n          ]\n      ]\n    , [ Para\n          [ Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = []\n                  , citationSuffix = [ Str \"p.\\160\\&30\" ]\n                  , citationMode = AuthorInText\n                  , citationNoteNum = 4\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"@item1\" , Space , Str \"[p.\" , Space , Str \"30]\" ]\n          , Space\n          , Str \"says\"\n          , Space\n          , Str \"blah.\"\n          ]\n      ]\n    , [ Para\n          [ Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = []\n                  , citationSuffix =\n                      [ Str \"p.\\160\\&30,\"\n                      , Space\n                      , Str \"with\"\n                      , Space\n                      , Str \"suffix\"\n                      ]\n                  , citationMode = AuthorInText\n                  , citationNoteNum = 5\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"@item1\"\n              , Space\n              , Str \"[p.\"\n              , Space\n              , Str \"30,\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"suffix]\"\n              ]\n          , Space\n          , Str \"says\"\n          , Space\n          , Str \"blah.\"\n          ]\n      ]\n    , [ Para\n          [ Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = []\n                  , citationSuffix = []\n                  , citationMode = AuthorInText\n                  , citationNoteNum = 6\n                  , citationHash = 0\n                  }\n              , Citation\n                  { citationId = \"item2\"\n                  , citationPrefix = []\n                  , citationSuffix = [ Space , Str \"p.\\160\\&30\" ]\n                  , citationMode = SuppressAuthor\n                  , citationNoteNum = 6\n                  , citationHash = 0\n                  }\n              , Citation\n                  { citationId = \"\\1087\\1091\\1085\\1082\\1090\\&3\"\n                  , citationPrefix = [ Str \"see\" , Space , Str \"also\" ]\n                  , citationSuffix = []\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 6\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"@item1\"\n              , Space\n              , Str \"[-@item2\"\n              , Space\n              , Str \"p.\"\n              , Space\n              , Str \"30;\"\n              , Space\n              , Str \"see\"\n              , Space\n              , Str \"also\"\n              , Space\n              , Str \"@\\1087\\1091\\1085\\1082\\1090\\&3]\"\n              ]\n          , Space\n          , Str \"says\"\n          , Space\n          , Str \"blah.\"\n          ]\n      ]\n    , [ Para\n          [ Str \"In\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"note.\"\n          , Note\n              [ Para\n                  [ Cite\n                      [ Citation\n                          { citationId = \"\\1087\\1091\\1085\\1082\\1090\\&3\"\n                          , citationPrefix = []\n                          , citationSuffix = [ Str \"p.\\160\\&12\" ]\n                          , citationMode = AuthorInText\n                          , citationNoteNum = 7\n                          , citationHash = 0\n                          }\n                      ]\n                      [ Str \"@\\1087\\1091\\1085\\1082\\1090\\&3\"\n                      , Space\n                      , Str \"[p.\"\n                      , Space\n                      , Str \"12]\"\n                      ]\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"citation\"\n                  , Space\n                  , Str \"without\"\n                  , Space\n                  , Str \"locators\"\n                  , Space\n                  , Cite\n                      [ Citation\n                          { citationId = \"\\1087\\1091\\1085\\1082\\1090\\&3\"\n                          , citationPrefix = []\n                          , citationSuffix = []\n                          , citationMode = NormalCitation\n                          , citationNoteNum = 7\n                          , citationHash = 0\n                          }\n                      ]\n                      [ Str \"[@\\1087\\1091\\1085\\1082\\1090\\&3]\" ]\n                  , Str \".\"\n                  ]\n              ]\n          ]\n      ]\n    , [ Para\n          [ Str \"A\"\n          , Space\n          , Str \"citation\"\n          , Space\n          , Str \"group\"\n          , Space\n          , Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = [ Str \"see\" ]\n                  , citationSuffix = [ Space , Str \"chap.\\160\\&3\" ]\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 8\n                  , citationHash = 0\n                  }\n              , Citation\n                  { citationId = \"\\1087\\1091\\1085\\1082\\1090\\&3\"\n                  , citationPrefix = [ Str \"also\" ]\n                  , citationSuffix = [ Space , Str \"p.\\160\\&34-35\" ]\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 8\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"[see\"\n              , Space\n              , Str \"@item1\"\n              , Space\n              , Str \"chap.\"\n              , Space\n              , Str \"3;\"\n              , Space\n              , Str \"also\"\n              , Space\n              , Str \"@\\1087\\1091\\1085\\1082\\1090\\&3\"\n              , Space\n              , Str \"p.\"\n              , Space\n              , Str \"34-35]\"\n              ]\n          , Str \".\"\n          ]\n      ]\n    , [ Para\n          [ Str \"Another\"\n          , Space\n          , Str \"one\"\n          , Space\n          , Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = [ Str \"see\" ]\n                  , citationSuffix = [ Space , Str \"p.\\160\\&34-35\" ]\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 9\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"[see\"\n              , Space\n              , Str \"@item1\"\n              , Space\n              , Str \"p.\"\n              , Space\n              , Str \"34-35]\"\n              ]\n          , Str \".\"\n          ]\n      ]\n    , [ Para\n          [ Str \"And\"\n          , Space\n          , Str \"another\"\n          , Space\n          , Str \"one\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"note.\"\n          , Note\n              [ Para\n                  [ Str \"Some\"\n                  , Space\n                  , Str \"citations\"\n                  , Space\n                  , Cite\n                      [ Citation\n                          { citationId = \"item1\"\n                          , citationPrefix = [ Str \"see\" ]\n                          , citationSuffix =\n                              [ Space , Str \"chap.\\160\\&3\" ]\n                          , citationMode = NormalCitation\n                          , citationNoteNum = 10\n                          , citationHash = 0\n                          }\n                      , Citation\n                          { citationId = \"\\1087\\1091\\1085\\1082\\1090\\&3\"\n                          , citationPrefix = []\n                          , citationSuffix = []\n                          , citationMode = NormalCitation\n                          , citationNoteNum = 10\n                          , citationHash = 0\n                          }\n                      , Citation\n                          { citationId = \"item2\"\n                          , citationPrefix = []\n                          , citationSuffix = []\n                          , citationMode = NormalCitation\n                          , citationNoteNum = 10\n                          , citationHash = 0\n                          }\n                      ]\n                      [ Str \"[see\"\n                      , Space\n                      , Str \"@item1\"\n                      , Space\n                      , Str \"chap.\"\n                      , Space\n                      , Str \"3;\"\n                      , Space\n                      , Str \"@\\1087\\1091\\1085\\1082\\1090\\&3;\"\n                      , Space\n                      , Str \"@item2]\"\n                      ]\n                  , Str \".\"\n                  ]\n              ]\n          ]\n      ]\n    , [ Para\n          [ Str \"Citation\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"suffix\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"locator\"\n          , Space\n          , Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = []\n                  , citationSuffix =\n                      [ Space\n                      , Str \"pp.\\160\\&33,\"\n                      , Space\n                      , Str \"35-37,\"\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"nowhere\"\n                      , Space\n                      , Str \"else\"\n                      ]\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 11\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"[@item1\"\n              , Space\n              , Str \"pp.\"\n              , Space\n              , Str \"33,\"\n              , Space\n              , Str \"35-37,\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"nowhere\"\n              , Space\n              , Str \"else]\"\n              ]\n          , Str \".\"\n          ]\n      ]\n    , [ Para\n          [ Str \"Citation\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"suffix\"\n          , Space\n          , Str \"only\"\n          , Space\n          , Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = []\n                  , citationSuffix =\n                      [ Space\n                      , Str \"and\"\n                      , Space\n                      , Str \"nowhere\"\n                      , Space\n                      , Str \"else\"\n                      ]\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 12\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"[@item1\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"nowhere\"\n              , Space\n              , Str \"else]\"\n              ]\n          , Str \".\"\n          ]\n      ]\n    , [ Para\n          [ Str \"Now\"\n          , Space\n          , Str \"some\"\n          , Space\n          , Str \"modifiers.\"\n          , Note\n              [ Para\n                  [ Str \"Like\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"citation\"\n                  , Space\n                  , Str \"without\"\n                  , Space\n                  , Str \"author:\"\n                  , Space\n                  , Cite\n                      [ Citation\n                          { citationId = \"item1\"\n                          , citationPrefix = []\n                          , citationSuffix = []\n                          , citationMode = SuppressAuthor\n                          , citationNoteNum = 13\n                          , citationHash = 0\n                          }\n                      ]\n                      [ Str \"[-@item1]\" ]\n                  , Str \",\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"now\"\n                  , Space\n                  , Str \"Doe\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"locator\"\n                  , Space\n                  , Cite\n                      [ Citation\n                          { citationId = \"item2\"\n                          , citationPrefix = []\n                          , citationSuffix =\n                              [ Space , Str \"p.\\160\\&44\" ]\n                          , citationMode = SuppressAuthor\n                          , citationNoteNum = 13\n                          , citationHash = 0\n                          }\n                      ]\n                      [ Str \"[-@item2\"\n                      , Space\n                      , Str \"p.\"\n                      , Space\n                      , Str \"44]\"\n                      ]\n                  , Str \".\"\n                  ]\n              ]\n          ]\n      ]\n    , [ Para\n          [ Str \"With\"\n          , Space\n          , Str \"some\"\n          , Space\n          , Str \"markup\"\n          , Space\n          , Cite\n              [ Citation\n                  { citationId = \"item1\"\n                  , citationPrefix = [ Emph [ Str \"see\" ] ]\n                  , citationSuffix =\n                      [ Space , Str \"p.\\160\" , Strong [ Str \"32\" ] ]\n                  , citationMode = NormalCitation\n                  , citationNoteNum = 14\n                  , citationHash = 0\n                  }\n              ]\n              [ Str \"[*see*\"\n              , Space\n              , Str \"@item1\"\n              , Space\n              , Str \"p.\"\n              , Space\n              , Str \"**32**]\"\n              ]\n          , Str \".\"\n          ]\n      ]\n    ]\n, Header 1 ( \"references\" , [] , [] ) [ Str \"References\" ]\n]\n"
  },
  {
    "path": "test/markdown-citations.txt",
    "content": "Pandoc with citeproc-hs\n=======================\n\n-   [@nonexistent]\n\n-   @nonexistent\n\n-   @item1 says blah.\n\n-   @item1 [p. 30] says blah.\n\n-   @item1 [p. 30, with suffix] says blah.\n\n-   @item1 [-@item2 p. 30; see also @пункт3] says blah.\n\n-   In a note.[^1]\n\n-   A citation group [see @item1 chap. 3; also @пункт3 p. 34-35].\n\n-   Another one [see @item1 p. 34-35].\n\n-   And another one in a note.[^2]\n\n-   Citation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere else].\n\n-   Citation with suffix only [@item1 and nowhere else].\n\n-   Now some modifiers.[^3]\n\n-   With some markup [*see* @item1 p. **32**].\n\nReferences\n==========\n\n[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].\n\n[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].\n\n[^3]: Like a citation without author: [-@item1], and now Doe with a locator [-@item2 p. 44].\n"
  },
  {
    "path": "test/markdown-reader-more.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"Author\" , Space , Str \"One\" ]\n                , MetaInlines [ Str \"Author\" , Space , Str \"Two\" ]\n                , MetaInlines [ Str \"Author\" , Space , Str \"Three\" ]\n                , MetaInlines [ Str \"Author\" , Space , Str \"Four\" ]\n                ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Title\"\n                , SoftBreak\n                , Str \"spanning\"\n                , Space\n                , Str \"multiple\"\n                , Space\n                , Str \"lines\"\n                ]\n            )\n          ]\n    }\n  [ Header\n      1\n      ( \"additional-markdown-reader-tests\" , [] , [] )\n      [ Str \"Additional\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"reader\"\n      , Space\n      , Str \"tests\"\n      ]\n  , Header\n      2\n      ( \"blank-line-before-url-in-link-reference\" , [] , [] )\n      [ Str \"Blank\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"before\"\n      , Space\n      , Str \"URL\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"reference\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"foo\" ] ( \"/url\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url\" , \"title\" )\n      ]\n  , Header\n      2\n      ( \"raw-context-environments\" , [] , [] )\n      [ Str \"Raw\"\n      , Space\n      , Str \"ConTeXt\"\n      , Space\n      , Str \"environments\"\n      ]\n  , RawBlock (Format \"tex\") \"\\\\placeformula \\\\startformula\"\n  , Para\n      [ Str \"L_{1}\"\n      , Space\n      , Str \"=\"\n      , Space\n      , Str \"L_{2}\"\n      , SoftBreak\n      , RawInline (Format \"tex\") \"\\\\stopformula\"\n      ]\n  , RawBlock\n      (Format \"tex\")\n      \"\\\\start[a2]\\n\\\\start[a2]\\n\\\\stop[a2]\\n\\\\stop[a2]\"\n  , Header\n      2\n      ( \"raw-latex-environments\" , [] , [] )\n      [ Str \"Raw\"\n      , Space\n      , Str \"LaTeX\"\n      , Space\n      , Str \"environments\"\n      ]\n  , RawBlock\n      (Format \"tex\")\n      \"\\\\begin{center}\\n\\\\begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt]\\n\\\\Tree [.{S} [.NP John\\\\index{i} ] [.VP [.V likes ] [.NP himself\\\\index{i,*j} ]]]\\n\\\\end{tikzpicture}\\n\\\\end{center}\"\n  , Header\n      2\n      ( \"urls-with-spaces-and-punctuation\" , [] , [] )\n      [ Str \"URLs\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"spaces\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"punctuation\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] ) [ Str \"foo\" ] ( \"/bar%20and%20baz\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"foo\" ] ( \"/bar%20and%20baz\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"foo\" ] ( \"/bar%20and%20baz\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"foo\" ] ( \"bar%20baz\" , \"title\" )\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"baz\" ] ( \"/foo%20foo\" , \"\" )\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bam\" ] ( \"/foo%20fee\" , \"\" )\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"bork\" ]\n          ( \"/foo/zee%20zob\" , \"title\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Ward\\8217s\" , Space , Str \"method.\" ]\n          ( \"http://en.wikipedia.org/wiki/Ward's_method\" , \"\" )\n      ]\n  , Header\n      2\n      ( \"horizontal-rules-with-spaces-at-end\" , [] , [] )\n      [ Str \"Horizontal\"\n      , Space\n      , Str \"rules\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"spaces\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"end\"\n      ]\n  , HorizontalRule\n  , HorizontalRule\n  , Header\n      2\n      ( \"raw-html-before-header\" , [] , [] )\n      [ Str \"Raw\"\n      , Space\n      , Str \"HTML\"\n      , Space\n      , Str \"before\"\n      , Space\n      , Str \"header\"\n      ]\n  , Para\n      [ RawInline (Format \"html\") \"<a>\"\n      , RawInline (Format \"html\") \"</a>\"\n      ]\n  , Header\n      3\n      ( \"my-header\" , [] , [] )\n      [ Str \"my\" , Space , Str \"header\" ]\n  , Header\n      2\n      ( \"in-math\" , [] , [] )\n      [ Str \"$\" , Space , Str \"in\" , Space , Str \"math\" ]\n  , Para [ Math InlineMath \"\\\\$2 + \\\\$3\" ]\n  , Para\n      [ Math InlineMath \"x = \\\\text{the $n$th root of $y$}\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"math:\"\n      ]\n  , Para\n      [ Str \"$PATH\" , Space , Str \"90\" , Space , Str \"$PATH\" ]\n  , Header\n      2\n      ( \"commented-out-list-item\" , [] , [] )\n      [ Str \"Commented-out\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item\"\n      ]\n  , BulletList\n      [ [ Plain [ Str \"one\" , SoftBreak , Str \"<!\\8211\" ] ]\n      , [ Plain [ Str \"two\" , SoftBreak , Str \"\\8211>\" ] ]\n      , [ Plain [ Str \"three\" ] ]\n      ]\n  , Header\n      2\n      ( \"indented-code-at-beginning-of-list\" , [] , [] )\n      [ Str \"Indented\"\n      , Space\n      , Str \"code\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"beginning\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"list\"\n      ]\n  , BulletList\n      [ [ CodeBlock ( \"\" , [] , [] ) \"code\\ncode\"\n        , OrderedList\n            ( 1 , Decimal , Period )\n            [ [ CodeBlock ( \"\" , [] , [] ) \"code\\ncode\" ]\n            , [ CodeBlock ( \"\" , [] , [] ) \"code\\ncode\" ]\n            ]\n        , BulletList\n            [ [ CodeBlock ( \"\" , [] , [] ) \"code\\ncode\" ]\n            , [ Plain [ Str \"no\" , Space , Str \"code\" ] ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"backslash-newline\" , [] , [] )\n      [ Str \"Backslash\" , Space , Str \"newline\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Header\n      2\n      ( \"code-spans\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"spans\" ]\n  , Para [ Code ( \"\" , [] , [] ) \"hi\\\\\" ]\n  , Para [ Code ( \"\" , [] , [] ) \"hi there\" ]\n  , Para [ Code ( \"\" , [] , [] ) \"hi````there\" ]\n  , Para [ Str \"`hi\" ]\n  , Para [ Str \"there`\" ]\n  , Header\n      2\n      ( \"multilingual-urls\" , [] , [] )\n      [ Str \"Multilingual\" , Space , Str \"URLs\" ]\n  , Para\n      [ Link\n          ( \"\" , [ \"uri\" ] , [] )\n          [ Str \"http://\\27979.com?\\27979=\\27979\" ]\n          ( \"http://\\27979.com?\\27979=\\27979\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"foo\" ]\n          ( \"/bar/\\27979?x=\\27979\" , \"title\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"email\" ] , [] )\n          [ Str \"\\27979@foo.\\27979.baz\" ]\n          ( \"mailto:\\27979@foo.\\27979.baz\" , \"\" )\n      ]\n  , Header\n      2\n      ( \"numbered-examples\" , [] , [] )\n      [ Str \"Numbered\" , Space , Str \"examples\" ]\n  , OrderedList\n      ( 1 , Example , TwoParens )\n      [ [ Plain [ Str \"First\" , Space , Str \"example.\" ] ]\n      , [ Plain [ Str \"Second\" , Space , Str \"example.\" ] ]\n      ]\n  , Para\n      [ Str \"Explanation\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"examples\"\n      , Space\n      , Str \"(2)\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"(3).\"\n      ]\n  , OrderedList\n      ( 3 , Example , TwoParens )\n      [ [ Plain [ Str \"Third\" , Space , Str \"example.\" ] ] ]\n  , Header 2 ( \"macros\" , [] , [] ) [ Str \"Macros\" ]\n  , RawBlock\n      (Format \"tex\")\n      \"\\\\newcommand{\\\\tuple}[1]{\\\\langle #1 \\\\rangle}\"\n  , Para [ Math InlineMath \"\\\\langle x,y \\\\rangle\" ]\n  , Header\n      2\n      ( \"case-insensitive-references\" , [] , [] )\n      [ Str \"Case-insensitive\" , Space , Str \"references\" ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Fum\" ] ( \"/fum\" , \"\" ) ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"FUM\" ] ( \"/fum\" , \"\" ) ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"bat\" ] ( \"/bat\" , \"\" ) ]\n  , Header\n      2\n      ( \"curly-smart-quotes\" , [] , [] )\n      [ Str \"Curly\" , Space , Str \"smart\" , Space , Str \"quotes\" ]\n  , Para [ Str \"\\8220Hi\\8221\" ]\n  , Para [ Str \"\\8216Hi\\8217\" ]\n  , Header\n      2\n      ( \"consecutive-lists\" , [] , [] )\n      [ Str \"Consecutive\" , Space , Str \"lists\" ]\n  , BulletList\n      [ [ Plain [ Str \"one\" ] ] , [ Plain [ Str \"two\" ] ] ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"one\" ] ] , [ Plain [ Str \"two\" ] ] ]\n  , OrderedList\n      ( 1 , LowerAlpha , Period )\n      [ [ Plain [ Str \"one\" ] ] , [ Plain [ Str \"two\" ] ] ]\n  , Header\n      2\n      ( \"implicit-header-references\" , [] , [] )\n      [ Str \"Implicit\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"references\"\n      ]\n  , Header\n      3\n      ( \"my-header-1\" , [] , [] )\n      [ Str \"My\" , Space , Str \"header\" ]\n  , Header\n      3\n      ( \"my-other-header\" , [] , [] )\n      [ Str \"My\" , Space , Str \"other\" , Space , Str \"header\" ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"My\" , Space , Str \"header\" ]\n          ( \"#my-header\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Another\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"it\" ] ( \"#my-header\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"case\" , Space , Str \"insensitive\" ]\n          ( \"#my-header\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Link\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"Explicit\"\n          , Space\n          , Str \"header\"\n          , Space\n          , Str \"attributes\"\n          ]\n          ( \"#foobar\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"But\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"My\" , Space , Str \"other\" , Space , Str \"header\" ]\n          ( \"/foo\" , \"\" )\n      , Str \",\"\n      , Space\n      , Str \"since\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"reference\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"defined.\"\n      ]\n  , Header\n      2\n      ( \"foobar\" , [ \"baz\" ] , [ ( \"key\" , \"val\" ) ] )\n      [ Str \"Explicit\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"attributes\"\n      ]\n  , BlockQuote\n      [ Header\n          2\n          ( \"foobar\" , [ \"baz\" ] , [ ( \"key\" , \"val\" ) ] )\n          [ Str \"Header\"\n          , Space\n          , Str \"attributes\"\n          , Space\n          , Str \"inside\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote\"\n          ]\n      ]\n  , Header\n      2\n      ( \"line-blocks\" , [] , [] )\n      [ Str \"Line\" , Space , Str \"blocks\" ]\n  , LineBlock\n      [ [ Str \"But\"\n        , Space\n        , Str \"can\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"bee\"\n        , Space\n        , Str \"be\"\n        , Space\n        , Str \"said\"\n        , Space\n        , Str \"to\"\n        , Space\n        , Str \"be\"\n        ]\n      , [ Str \"\\160\\160\\160\\160or\"\n        , Space\n        , Str \"not\"\n        , Space\n        , Str \"to\"\n        , Space\n        , Str \"be\"\n        , Space\n        , Str \"an\"\n        , Space\n        , Str \"entire\"\n        , Space\n        , Str \"bee,\"\n        ]\n      , [ Str \"\\160\\160\\160\\160\\160\\160\\160\\160when\"\n        , Space\n        , Str \"half\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"bee\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"not\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"bee,\"\n        ]\n      , [ Str\n            \"\\160\\160\\160\\160\\160\\160\\160\\160\\160\\160\\160\\160due\"\n        , Space\n        , Str \"to\"\n        , Space\n        , Str \"some\"\n        , Space\n        , Str \"ancient\"\n        , Space\n        , Str \"injury?\"\n        ]\n      , []\n      , [ Str \"Continuation\" , Space , Str \"line\" ]\n      , [ Str \"\\160\\160and\" , Space , Str \"another\" ]\n      ]\n  , Header\n      2\n      ( \"grid-tables\" , [] , [] )\n      [ Str \"Grid\" , Space , Str \"Tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2638888888888889 )\n      , ( AlignDefault , ColWidth 0.16666666666666666 )\n      , ( AlignDefault , ColWidth 0.18055555555555555 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"2\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"3\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"b\"\n                      , SoftBreak\n                      , Str \"b\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Str \"Headless\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2638888888888889 )\n      , ( AlignDefault , ColWidth 0.16666666666666666 )\n      , ( AlignDefault , ColWidth 0.18055555555555555 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"b\"\n                      , SoftBreak\n                      , Str \"b\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Str \"With\" , Space , Str \"alignments\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidth 0.2638888888888889 )\n      , ( AlignLeft , ColWidth 0.16666666666666666 )\n      , ( AlignCenter , ColWidth 0.18055555555555555 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"2\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"3\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"b\"\n                      , SoftBreak\n                      , Str \"b\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Headless\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"alignments\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidth 0.2638888888888889 )\n      , ( AlignLeft , ColWidth 0.16666666666666666 )\n      , ( AlignCenter , ColWidth 0.18055555555555555 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"b\"\n                      , SoftBreak\n                      , Str \"b\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Spaces\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"lines\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2638888888888889 )\n      , ( AlignDefault , ColWidth 0.16666666666666666 )\n      , ( AlignDefault , ColWidth 0.18055555555555555 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"b\"\n                      , SoftBreak\n                      , Str \"b\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"cell\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2638888888888889 )\n      , ( AlignDefault , ColWidth 0.16666666666666666 )\n      , ( AlignDefault , ColWidth 0.18055555555555555 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Header\n                      1\n                      ( \"col-1\" , [] , [] )\n                      [ Str \"col\" , Space , Str \"1\" ]\n                  , Para [ Str \"col\" , Space , Str \"1\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Header\n                      1\n                      ( \"col-2\" , [] , [] )\n                      [ Str \"col\" , Space , Str \"2\" ]\n                  , Para [ Str \"col\" , Space , Str \"2\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Header\n                      1\n                      ( \"col-3\" , [] , [] )\n                      [ Str \"col\" , Space , Str \"3\" ]\n                  , Para [ Str \"col\" , Space , Str \"3\" ]\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"r1\" , Space , Str \"a\" ]\n                  , Para [ Str \"r1\" , Space , Str \"bis\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ BulletList\n                      [ [ Plain [ Str \"b\" ] ]\n                      , [ Plain [ Str \"b\" , Space , Str \"2\" ] ]\n                      , [ Plain [ Str \"b\" , Space , Str \"2\" ] ]\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"East\"\n      , Space\n      , Str \"Asian\"\n      , Space\n      , Str \"characters\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"double\"\n      , Space\n      , Str \"width\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 4.1666666666666664e-2 )\n      , ( AlignDefault , ColWidth 6.944444444444445e-2 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"\\39770\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"fish\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Zero-width\"\n      , Space\n      , Str \"space\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"German\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.1111111111111111 )\n      , ( AlignDefault , ColWidth 0.1111111111111111 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"German\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"English\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Auf\\8204lage\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"edition\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Zero-width\"\n      , Space\n      , Str \"non-joiner\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"Persian\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.1111111111111111 )\n      , ( AlignDefault , ColWidth 0.1388888888888889 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"\\1605\\1740\\8204\\1582\\1608\\1575\\1607\\1605\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"I\"\n                      , Space\n                      , Str \"want\"\n                      , Space\n                      , Str \"to\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Str \"Empty\" , Space , Str \"cells\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 5.555555555555555e-2 )\n      , ( AlignDefault , ColWidth 5.555555555555555e-2 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"cells\"\n      , Space\n      , Str \"spanning\"\n      , Space\n      , Str \"multiple\"\n      , Space\n      , Str \"rows\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"columns:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.19444444444444445 )\n      , ( AlignDefault , ColWidth 0.1111111111111111 )\n      , ( AlignDefault , ColWidth 0.1527777777777778 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 2)\n                 [ Plain [ Str \"Property\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Earth\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 3)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Temperature\"\n                      , SoftBreak\n                      , Str \"1961-1990\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"min\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-89.2\" , Space , Str \"\\176C\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"mean\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"14\" , Space , Str \"\\176C\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"min\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"56.7\" , Space , Str \"\\176C\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"complex\"\n      , Space\n      , Str \"header:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.3055555555555556 )\n      , ( AlignDefault , ColWidth 0.1111111111111111 )\n      , ( AlignDefault , ColWidth 0.1111111111111111 )\n      , ( AlignDefault , ColWidth 0.1111111111111111 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 2)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Location\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 3)\n                 [ Plain\n                     [ Str \"Temperature\"\n                     , Space\n                     , Str \"1961-1990\"\n                     , SoftBreak\n                     , Str \"in\"\n                     , Space\n                     , Str \"degree\"\n                     , Space\n                     , Str \"Celsius\"\n                     ]\n                 ]\n             ]\n         , Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"min\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"mean\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"max\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Antarctica\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-89.2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"N/A\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"19.8\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Earth\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-89.2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"14\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"56.7\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      2\n      ( \"entities-in-links-and-titles\" , [] , [] )\n      [ Str \"Entities\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"links\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"titles\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] ) [ Str \"link\" ] ( \"/\\252rl\" , \"\\246\\246!\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"uri\" ] , [] )\n          [ Str \"http://g\\246\\246gle.com\" ]\n          ( \"http://g\\246\\246gle.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"email\" ] , [] )\n          [ Str \"me@ex\\228mple.com\" ]\n          ( \"mailto:me@ex\\228mple.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"foobar\" ]\n          ( \"/\\252rl\" , \"\\246\\246!\" )\n      ]\n  , Header\n      2\n      ( \"parentheses-in-urls\" , [] , [] )\n      [ Str \"Parentheses\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"URLs\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"link\" ] ( \"/hi(there)\" , \"\" )\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"link\" ] ( \"/hithere)\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"linky\" ]\n          ( \"hi_(there_(nested))\" , \"\" )\n      ]\n  , Header\n      2\n      ( \"backslashes-in-link-references\" , [] , [] )\n      [ Str \"Backslashes\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"references\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"*\" , RawInline (Format \"tex\") \"\\\\a\" ]\n          ( \"b\" , \"\" )\n      ]\n  , Header\n      2\n      ( \"reference-link-fallbacks\" , [] , [] )\n      [ Str \"Reference\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"fallbacks\"\n      ]\n  , Para\n      [ Str \"[\"\n      , Emph [ Str \"not\" , Space , Str \"a\" , Space , Str \"link\" ]\n      , Str \"]\"\n      , Space\n      , Str \"[\"\n      , Emph [ Str \"nope\" ]\n      , Str \"]\\8230\"\n      ]\n  , Header\n      2\n      ( \"reference-link-followed-by-a-citation\" , [] , [] )\n      [ Str \"Reference\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"followed\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"citation\"\n      ]\n  , Para\n      [ Str \"MapReduce\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paradigm\"\n      , Space\n      , Str \"popularized\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"Google\" ]\n          ( \"http://google.com\" , \"\" )\n      , Space\n      , Cite\n          [ Citation\n              { citationId = \"mapreduce\"\n              , citationPrefix = []\n              , citationSuffix = []\n              , citationMode = NormalCitation\n              , citationNoteNum = 2\n              , citationHash = 0\n              }\n          ]\n          [ Str \"[@mapreduce]\" ]\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"its\"\n      , SoftBreak\n      , Str \"most\"\n      , Space\n      , Str \"vocal\"\n      , Space\n      , Str \"proponent.\"\n      ]\n  , Header\n      2\n      ( \"empty-reference-links\" , [] , [] )\n      [ Str \"Empty\"\n      , Space\n      , Str \"reference\"\n      , Space\n      , Str \"links\"\n      ]\n  , Para [ Str \"bar\" ]\n  , Para [ Link ( \"\" , [] , [] ) [ Str \"foo2\" ] ( \"\" , \"\" ) ]\n  , Header\n      2\n      ( \"wrapping-shouldnt-introduce-new-list-items\" , [] , [] )\n      [ Str \"Wrapping\"\n      , Space\n      , Str \"shouldn\\8217t\"\n      , Space\n      , Str \"introduce\"\n      , Space\n      , Str \"new\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"items\"\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"blah\"\n            , Space\n            , Str \"2015.\"\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"bracketed-spans\" , [] , [] )\n      [ Str \"Bracketed\" , Space , Str \"spans\" ]\n  , Para\n      [ Span\n          ( \"id\" , [ \"class\" ] , [ ( \"key\" , \"val\" ) ] )\n          [ Emph [ Str \"foo\" ]\n          , Space\n          , Str \"bar\"\n          , Space\n          , Str \"baz\"\n          , Space\n          , Link ( \"\" , [] , [] ) [ Str \"link\" ] ( \"url\" , \"\" )\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/markdown-reader-more.txt",
    "content": "% Title\n  spanning multiple lines\n% Author One\n  Author Two; Author Three;\n  Author Four\n \n# Additional markdown reader tests\n\n## Blank line before URL in link reference\n\n[foo] and [bar]\n\n[foo]: \n  /url\n\n[bar]:\n/url\n\"title\"\n\n## Raw ConTeXt environments\n\n\\placeformula \\startformula\n   L_{1} = L_{2}\n   \\stopformula\n\n\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]\n\n## Raw LaTeX environments\n\n\\begin{center}\n\\begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt]\n\\Tree [.{S} [.NP John\\index{i} ] [.VP [.V likes ] [.NP himself\\index{i,*j} ]]]\n\\end{tikzpicture}\n\\end{center}\n\n## URLs with spaces and punctuation\n\n[foo](/bar and baz)\n[foo](/bar\n and baz )\n[foo]( /bar  and  baz  )\n[foo](bar baz  \"title\" )\n\n[baz][] [bam][] [bork][]\n\n[baz]: /foo foo\n[bam]:  /foo fee   \n[bork]:  /foo/zee zob   (title)\n\n[Ward's method.](http://en.wikipedia.org/wiki/Ward's_method)\n\n## Horizontal rules with spaces at end\n\n* * * * *  \n\n-- - -- -- -  \n\n## Raw HTML before header\n\n<a></a>\n\n### my header\n\n## $ in math\n\n$\\$2 + \\$3$\n\n$x = \\text{the $n$th root of $y$}$\n\nThis should not be math:\n\n$PATH 90 $PATH\n\n## Commented-out list item\n\n- one\n<!--\n- two\n-->\n- three\n\n## Indented code at beginning of list\n\n-     code\n      code\n\n  1.     code\n         code\n\n  12345678.     code\n                code\n\n  -     code\n        code\n\n  -    no code\n\n## Backslash newline\n\nhi\\\nthere\n\n## Code spans\n\n`hi\\`\n\n`hi\nthere`\n\n`` hi````there ``\n\n`hi\n\nthere`\n\n## Multilingual URLs\n\n<http://测.com?测=测>\n\n[foo](/bar/测?x=测 \"title\")\n\n<测@foo.测.baz>\n\n## Numbered examples\n\n(@) First example.\n(@foo) Second example.\n\nExplanation of examples (@foo) and (@bar).\n\n(@bar) Third example.\n\n## Macros\n\n\\newcommand{\\tuple}[1]{\\langle #1 \\rangle}\n\n$\\tuple{x,y}$\n\n## Case-insensitive references\n\n[Fum]\n\n[FUM]\n\n[bat]\n\n[fum]: /fum\n[BAT]: /bat\n\n## Curly smart quotes\n\n“Hi”\n\n‘Hi’\n\n## Consecutive lists\n\n- one\n- two\n1. one\n2. two\n\n a. one\n b. two\n\n## Implicit header references\n\n### My header\n\n### My other header\n\nA link to [My header].\n\nAnother link to [it][My header].\n\nShould be [case insensitive][my header].\n\nLink to [Explicit header attributes].\n\n[my other header]: /foo\n\nBut this is not a link to [My other header], since the reference is defined.\n\n## Explicit header attributes {#foobar .baz key=\"val\"}\n\n> ## Header attributes inside block quote {#foobar .baz key=\"val\"}\n\n## Line blocks\n\n| But can a bee be said to be\n|     or not to be an entire bee,\n|         when half the bee is not a bee,\n|             due to some ancient injury?\n|\n| Continuation\n line\n|   and\n       another\n\n## Grid Tables\n\n+------------------+-----------+------------+\n| col 1            | col 2     | col 3      |\n+==================+===========+============+\n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        |\n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nHeadless\n\n+------------------+-----------+------------+\n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        |\n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nWith alignments\n\n+------------------+-----------+------------+\n| col 1            | col 2     | col 3      |\n+=================:+:==========+:==========:+\n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        |\n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nHeadless with alignments\n\n+-----------------:+:----------+:----------:+\n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        |\n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nSpaces at ends of lines\n\n+------------------+-----------+------------+  \n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        | \n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nMultiple blocks in a cell\n\n+------------------+-----------+------------+\n| # col 1          | # col 2   | # col 3    |\n| col 1            | col 2     | col 3      |\n+------------------+-----------+------------+\n| r1 a             | - b       | c          |\n|                  | - b 2     | c 2        |\n| r1 bis           | - b 2     | c 2        |\n+------------------+-----------+------------+\n\nEast Asian characters have double width\n\n+--+----+\n|魚|fish|\n+--+----+\n\nZero-width space in German\n\n+-------+-------+\n|German |English|\n+-------+-------+\n|Auf‌lage|edition|\n+-------+-------+\n\nZero-width non-joiner in Persian\n\n+-------+---------+\n|می‌خواهم|I want to|\n+-------+---------+\n\nEmpty cells\n\n+---+---+\n|   |   |\n+---+---+\n\n\nTable with cells spanning multiple rows or columns:\n\n+---------------------+----------+\n| Property            | Earth    |\n+=============+=======+==========+\n|             | min   | -89.2 °C |\n| Temperature +-------+----------+\n| 1961-1990   | mean  | 14 °C    |\n|             +-------+----------+\n|             | min   | 56.7 °C  |\n+-------------+-------+----------+\n\nTable with complex header:\n\n+---------------------+-----------------------+\n| Location            | Temperature 1961-1990 |\n|                     | in degree Celsius     |\n|                     +-------+-------+-------+\n|                     | min   | mean  | max   |\n+=====================+=======+=======+=======+\n| Antarctica          | -89.2 | N/A   | 19.8  |\n+---------------------+-------+-------+-------+\n| Earth               | -89.2 | 14    | 56.7  |\n+---------------------+-------+-------+-------+\n\n## Entities in links and titles\n\n[link](/&uuml;rl \"&ouml;&ouml;!\")\n\n<http://g&ouml;&ouml;gle.com>\n\n<me@ex&auml;mple.com>\n\n[foobar]\n\n[foobar]: /&uuml;rl \"&ouml;&ouml;!\"\n\n## Parentheses in URLs\n\n[link](/hi(there))\n\n[link](/hithere\\))\n\n[linky]\n\n[linky]: hi_(there_(nested))\n\n## Backslashes in link references\n\n[\\*\\a](b)\n\n## Reference link fallbacks\n\n[*not a link*] [*nope*]...\n\n## Reference link followed by a citation\n\nMapReduce is a paradigm popularized by [Google] [@mapreduce] as its\nmost vocal proponent.\n\n[Google]: http://google.com\n\n## Empty reference links\n\n[foo2]:\n\nbar\n\n[foo2]\n\n## Wrapping shouldn't introduce new list items\n\n- blah blah blah blah blah blah blah blah blah blah blah blah blah blah 2015.\n\n## Bracketed spans\n\n[*foo* bar baz [link](url)]{.class #id key=val}\n"
  },
  {
    "path": "test/mediawiki-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header 1 ( \"header\" , [] , [] ) [ Str \"header\" ]\n  , Header\n      2\n      ( \"header_level_two\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"two\" ]\n  , Header\n      3\n      ( \"header_level_3\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"header_level_four\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Emph [ Str \"level\" ]\n      , Space\n      , Str \"four\"\n      ]\n  , Header\n      5\n      ( \"header_level_5\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"5\" ]\n  , Header\n      6\n      ( \"header_level_6\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"6\" ]\n  , Para\n      [ Str \"=======\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"========\"\n      ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"==\\160not\\160a\\160header\\160==\" ]\n  , Header\n      2\n      ( \"emph_and_strong\" , [] , [] )\n      [ Str \"emph\" , Space , Str \"and\" , Space , Str \"strong\" ]\n  , Para\n      [ Emph [ Str \"emph\" ] , Space , Strong [ Str \"strong\" ] ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"strong\" , Space , Str \"and\" , Space , Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Emph [ Str \"emph\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"strong\"\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Str \"strong\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Emph [ Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Emph\n          [ Strong [ Str \"strong\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"emph\"\n          ]\n      ]\n  , Header\n      2\n      ( \"horizontal_rule\" , [] , [] )\n      [ Str \"horizontal\" , Space , Str \"rule\" ]\n  , Para [ Str \"top\" ]\n  , HorizontalRule\n  , Para [ Str \"bottom\" ]\n  , HorizontalRule\n  , Header 2 ( \"nowiki\" , [] , [] ) [ Str \"nowiki\" ]\n  , Para [ Str \"''not\" , Space , Str \"emph''\" ]\n  , Header 2 ( \"strikeout\" , [] , [] ) [ Str \"strikeout\" ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"struck\" , Space , Str \"out\" ]\n          ]\n      ]\n  , Header 2 ( \"entities\" , [] , [] ) [ Str \"entities\" ]\n  , Para [ Str \"hi\" , Space , Str \"&\" , Space , Str \"low\" ]\n  , Para [ Str \"hi\" , Space , Str \"&\" , Space , Str \"low\" ]\n  , Para [ Str \"G\\246del\" ]\n  , Para [ Str \"\\777\\2730\" ]\n  , Header 2 ( \"comments\" , [] , [] ) [ Str \"comments\" ]\n  , Para [ Str \"inline\" , Space , Str \"comment\" ]\n  , Para [ Str \"between\" , Space , Str \"blocks\" ]\n  , Header 2 ( \"linebreaks\" , [] , [] ) [ Str \"linebreaks\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Header\n      2\n      ( \"indents\" , [] , [] )\n      [ Str \":\" , Space , Str \"indents\" ]\n  , Para [ Str \"hi\" ]\n  , DefinitionList [ ( [] , [ [ Plain [ Str \"there\" ] ] ] ) ]\n  , Para [ Str \"bud\" ]\n  , Para [ Str \"hi\" ]\n  , DefinitionList\n      [ ( []\n        , [ [ DefinitionList\n                [ ( [] , [ [ Plain [ Str \"there\" ] ] ] ) ]\n            ]\n          ]\n        )\n      ]\n  , Para [ Str \"bud\" ]\n  , Header\n      2 ( \"p_tags\" , [] , [] ) [ Str \"p\" , Space , Str \"tags\" ]\n  , Para [ Str \"hi\" , Space , Str \"there\" ]\n  , Para [ Str \"bud\" ]\n  , Para [ Str \"another\" ]\n  , Header\n      2\n      ( \"raw_html\" , [] , [] )\n      [ Str \"raw\" , Space , Str \"html\" ]\n  , Para\n      [ Str \"hi\"\n      , Space\n      , RawInline (Format \"html\") \"<span style=\\\"color:red\\\">\"\n      , Emph [ Str \"there\" ]\n      , RawInline (Format \"html\") \"</span>\"\n      , Str \".\"\n      ]\n  , Para\n      [ RawInline (Format \"html\") \"<ins>\"\n      , Str \"inserted\"\n      , RawInline (Format \"html\") \"</ins>\"\n      ]\n  , RawBlock (Format \"html\") \"<div class=\\\"special\\\">\"\n  , Para [ Str \"hi\" , Space , Emph [ Str \"there\" ] ]\n  , RawBlock (Format \"html\") \"</div>\"\n  , Header\n      2\n      ( \"sup_sub_del\" , [] , [] )\n      [ Str \"sup,\" , Space , Str \"sub,\" , Space , Str \"del\" ]\n  , Para\n      [ Str \"H\"\n      , Subscript [ Str \"2\" ]\n      , Str \"O\"\n      , Space\n      , Str \"base\"\n      , Superscript [ Emph [ Str \"exponent\" ] ]\n      , SoftBreak\n      , Strikeout [ Str \"hello\" ]\n      ]\n  , Header\n      2\n      ( \"inline_code\" , [] , [] )\n      [ Str \"inline\" , Space , Str \"code\" ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"*\\8594*\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"typed\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" ] , [] ) \">>=\"\n      ]\n  , Header\n      2\n      ( \"code_blocks\" , [] , [] )\n      [ Str \"code\" , Space , Str \"blocks\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"case xs of\\n     (_:_) -> reverse xs\\n     []    -> ['*']\"\n  , CodeBlock\n      ( \"\" , [ \"haskell\" ] , [] )\n      \"case xs of\\n     (_:_) -> reverse xs\\n     []    -> ['*']\"\n  , CodeBlock\n      ( \"\"\n      , [ \"ruby\" , \"numberLines\" ]\n      , [ ( \"startFrom\" , \"100\" ) ]\n      )\n      \"widgets.each do |w|\\n  print w.price\\nend\"\n  , Header\n      2\n      ( \"block_quotes\" , [] , [] )\n      [ Str \"block\" , Space , Str \"quotes\" ]\n  , Para [ Str \"Regular\" , Space , Str \"paragraph\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          ]\n      , Para\n          [ Str \"With\"\n          , Space\n          , Str \"two\"\n          , Space\n          , Str \"paragraphs.\"\n          ]\n      ]\n  , Para [ Str \"Nother\" , Space , Str \"paragraph.\" ]\n  , Header\n      2\n      ( \"external_links\" , [] , [] )\n      [ Str \"external\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Emph [ Str \"Google\" ]\n          , Space\n          , Str \"search\"\n          , Space\n          , Str \"engine\"\n          ]\n          ( \"http://google.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://pandoc.org\" ]\n          ( \"http://pandoc.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] ) [ Str \"1\" ] ( \"http://google.com\" , \"\" )\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"2\" ] ( \"http://yahoo.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"email\" , Space , Str \"me\" ]\n          ( \"mailto:info@example.org\" , \"\" )\n      ]\n  , Header\n      2\n      ( \"internal_links\" , [] , [] )\n      [ Str \"internal\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Help\" ]\n          ( \"Help\" , \"Help\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"the\" , Space , Str \"help\" , Space , Str \"page\" ]\n          ( \"Help\" , \"the help page\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Helpers\" ]\n          ( \"Help\" , \"Help\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Help\" ]\n          ( \"Help\" , \"Help\" )\n      , Str \"ers\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Contents\" ]\n          ( \"Help:Contents\" , \"Contents\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"#My\" , Space , Str \"anchor\" ]\n          ( \"#My_anchor\" , \"#My anchor\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"and\" , Space , Str \"text\" ]\n          ( \"Page#with_anchor\" , \"and text\" )\n      ]\n  , Header 2 ( \"images\" , [] , [] ) [ Str \"images\" ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"caption\" ] ])\n      [ Plain\n          [ Image ( \"\" , [] , [] ) [] ( \"example.jpg\" , \"caption\" ) ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain\n             [ Str \"the\"\n             , Space\n             , Emph [ Str \"caption\" ]\n             , Space\n             , Str \"with\"\n             , Space\n             , Link\n                 ( \"\" , [] , [] )\n                 [ Str \"external\" , Space , Str \"link\" ]\n                 ( \"http://google.com\" , \"\" )\n             ]\n         ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] )\n              []\n              ( \"example.jpg\" , \"the caption with external link\" )\n          ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"caption\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [ ( \"width\" , \"30\" ) , ( \"height\" , \"40\" ) ] )\n              []\n              ( \"example.jpg\" , \"caption\" )\n          ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"caption\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [ ( \"width\" , \"30\" ) ] )\n              []\n              ( \"example.jpg\" , \"caption\" )\n          ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"caption\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [ ( \"width\" , \"30\" ) ] )\n              []\n              ( \"example.jpg\" , \"caption\" )\n          ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"example.jpg\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] ) [] ( \"example.jpg\" , \"example.jpg\" )\n          ]\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"example_es.jpg\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] )\n              []\n              ( \"example_es.jpg\" , \"example_es.jpg\" )\n          ]\n      ]\n  , Header 2 ( \"lists\" , [] , [] ) [ Str \"lists\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Start\" , Space , Str \"each\" , Space , Str \"line\" ]\n        ]\n      , [ Plain\n            [ Str \"with\"\n            , Space\n            , Str \"an\"\n            , Space\n            , Str \"asterisk\"\n            , Space\n            , Str \"(*).\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"More\"\n                  , Space\n                  , Str \"asterisks\"\n                  , Space\n                  , Str \"gives\"\n                  , Space\n                  , Str \"deeper\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"and\"\n                        , Space\n                        , Str \"deeper\"\n                        , Space\n                        , Str \"levels.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Line\"\n            , Space\n            , Str \"breaks\"\n            , LineBreak\n            , Str \"don't\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"levels.\"\n            ]\n        , BulletList\n            [ [ BulletList\n                  [ [ Plain\n                        [ Str \"But\"\n                        , Space\n                        , Str \"jumping\"\n                        , Space\n                        , Str \"levels\"\n                        , Space\n                        , Str \"creates\"\n                        , Space\n                        , Str \"empty\"\n                        , Space\n                        , Str \"space.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"list.\"\n      ]\n  , BulletList\n      [ [ BulletList [ [ Plain [ Str \"two\" ] ] ] ]\n      , [ Plain [ Str \"one\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Start\" , Space , Str \"each\" , Space , Str \"line\" ]\n        ]\n      , [ Plain\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"number\"\n            , Space\n            , Str \"sign\"\n            , Space\n            , Str \"(#).\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"More\"\n                  , Space\n                  , Str \"number\"\n                  , Space\n                  , Str \"signs\"\n                  , Space\n                  , Str \"gives\"\n                  , Space\n                  , Str \"deeper\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"and\" , Space , Str \"deeper\" ] ]\n                  , [ Plain [ Str \"levels.\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Line\"\n            , Space\n            , Str \"breaks\"\n            , LineBreak\n            , Str \"don't\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"levels.\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain\n                        [ Str \"But\"\n                        , Space\n                        , Str \"jumping\"\n                        , Space\n                        , Str \"levels\"\n                        , Space\n                        , Str \"creates\"\n                        , Space\n                        , Str \"empty\"\n                        , Space\n                        , Str \"space.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"Blank\" , Space , Str \"lines\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"end\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"start\"\n            , Space\n            , Str \"another.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"also\"\n      , SoftBreak\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"list.\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"item\" , Space , Str \"1\" ]\n        , [ [ Plain [ Str \"definition\" , Space , Str \"1\" ] ] ]\n        )\n      , ( [ Str \"item\" , Space , Str \"2\" ]\n        , [ [ Plain [ Str \"definition\" , Space , Str \"2-1\" ] ]\n          , [ Plain [ Str \"definition\" , Space , Str \"2-2\" ] ]\n          ]\n        )\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"one\" ] ]\n      , [ Plain [ Str \"two\" ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"two\"\n                  , Space\n                  , Str \"point\"\n                  , Space\n                  , Str \"one\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"two\"\n                  , Space\n                  , Str \"point\"\n                  , Space\n                  , Str \"two\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"three\" ]\n        , DefinitionList\n            [ ( [ Str \"three\" , Space , Str \"item\" , Space , Str \"one\" ]\n              , [ [ Plain\n                      [ Str \"three\"\n                      , Space\n                      , Str \"def\"\n                      , Space\n                      , Str \"one\"\n                      ]\n                  ]\n                ]\n              )\n            ]\n        ]\n      , [ Plain [ Str \"four\" ]\n        , DefinitionList\n            [ ( []\n              , [ [ Plain\n                      [ Str \"four\"\n                      , Space\n                      , Str \"def\"\n                      , Space\n                      , Str \"one\"\n                      ]\n                  ]\n                , [ Plain\n                      [ Str \"this\"\n                      , Space\n                      , Str \"looks\"\n                      , Space\n                      , Str \"like\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"continuation\"\n                      ]\n                  ]\n                , [ Plain\n                      [ Str \"and\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"often\"\n                      , Space\n                      , Str \"used\"\n                      ]\n                  ]\n                , [ Plain\n                      [ Str \"instead\"\n                      , LineBreak\n                      , Str \"of\"\n                      , Space\n                      , Str \"<br/>\"\n                      ]\n                  ]\n                ]\n              )\n            ]\n        ]\n      , [ Plain\n            [ RawInline\n                (Format \"mediawiki\")\n                \"{{{template\\n|author=John\\n|title=My Book\\n}}}\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"five\" , Space , Str \"sub\" , Space , Str \"1\" ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain\n                        [ Str \"five\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"1\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"1\"\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"five\" , Space , Str \"sub\" , Space , Str \"2\" ]\n              ]\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Emph [ Str \"emph\" ]\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"list\" , Space , Str \"item\" , Space , Str \"B1\" ]\n              ]\n            , [ Plain\n                  [ Str \"list\" , Space , Str \"item\" , Space , Str \"B2\" ]\n              ]\n            ]\n        , Para\n            [ Str \"continuing\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"A1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"list\" , Space , Str \"item\" , Space , Str \"A2\" ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"abc\" ] ]\n      , [ Plain [ Str \"def\" ] ]\n      , [ Plain [ Str \"ghi\" ] ]\n      ]\n  , OrderedList\n      ( 9 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"Amsterdam\" ] ]\n      , [ Plain [ Str \"Rotterdam\" ] ]\n      , [ Plain [ Str \"The\" , Space , Str \"Hague\" ] ]\n      ]\n  , Header 2 ( \"math\" , [] , [] ) [ Str \"math\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Math InlineMath \"x=\\\\frac{y^\\\\pi}{z}\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"spaces:\"\n      , Space\n      , Math InlineMath \"x=\\\\frac{y^\\\\pi}{z}\"\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"preformatted_blocks\" , [] , [] )\n      [ Str \"preformatted\" , Space , Str \"blocks\" ]\n  , Para\n      [ Code\n          ( \"\" , [] , [] )\n          \"Start\\160each\\160line\\160with\\160a\\160space.\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"Text\\160is\\160\"\n      , Strong [ Code ( \"\" , [] , [] ) \"preformatted\" ]\n      , Code ( \"\" , [] , [] ) \"\\160and\"\n      , LineBreak\n      , Emph [ Code ( \"\" , [] , [] ) \"markups\" ]\n      , Code ( \"\" , [] , [] ) \"\\160\"\n      , Strong [ Emph [ Code ( \"\" , [] , [] ) \"can\" ] ]\n      , Code ( \"\" , [] , [] ) \"\\160be\\160done.\"\n      ]\n  , Para\n      [ Code\n          ( \"\" , [] , [] ) \"\\160hell\\160\\160\\160\\160\\160\\160yeah\"\n      ]\n  , Para\n      [ Code\n          ( \"\" , [] , [] )\n          \"Start\\160with\\160a\\160space\\160in\\160the\\160first\\160column,\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"(before\\160the\\160<nowiki>).\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\"\n      , LineBreak\n      , Code\n          ( \"\" , [] , [] )\n          \"Then\\160your\\160block\\160format\\160will\\160be\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\\160\\160\\160\\160maintained.\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\"\n      , LineBreak\n      , Code\n          ( \"\" , [] , [] )\n          \"This\\160is\\160good\\160for\\160copying\\160in\\160code\\160blocks:\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"def\\160function():\"\n      , LineBreak\n      , Code\n          ( \"\" , [] , [] )\n          \"\\160\\160\\160\\160\\\"\\\"\\\"documentation\\160string\\\"\\\"\\\"\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\\160\\160\\160\\160if\\160True:\"\n      , LineBreak\n      , Code\n          ( \"\" , [] , [] )\n          \"\\160\\160\\160\\160\\160\\160\\160\\160print\\160True\"\n      , LineBreak\n      , Code ( \"\" , [] , [] ) \"\\160\\160\\160\\160else:\"\n      , LineBreak\n      , Code\n          ( \"\" , [] , [] )\n          \"\\160\\160\\160\\160\\160\\160\\160\\160print\\160False\"\n      ]\n  , Para [ Str \"Not\" ]\n  , RawBlock (Format \"html\") \"<hr/>\"\n  , Para [ Str \"preformatted\" ]\n  , Para [ Str \"Don't\" , Space , Str \"need\" ]\n  , Para [ Code ( \"\" , [] , [] ) \"a\\160blank\\160line\" ]\n  , Para\n      [ Str \"around\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"preformatted\"\n      , Space\n      , Str \"block.\"\n      ]\n  , Header 2 ( \"templates\" , [] , [] ) [ Str \"templates\" ]\n  , RawBlock (Format \"mediawiki\") \"{{Welcome}}\"\n  , RawBlock (Format \"mediawiki\") \"{{Foo:Bar}}\"\n  , RawBlock\n      (Format \"mediawiki\") \"{{Thankyou|all your effort|Me}}\"\n  , Para\n      [ Str \"Written\"\n      , Space\n      , RawInline (Format \"mediawiki\") \"{{{date}}}\"\n      , Space\n      , Str \"by\"\n      , Space\n      , RawInline (Format \"mediawiki\") \"{{{name}}}\"\n      , Str \".\"\n      ]\n  , Header 2 ( \"tables\" , [] , [] ) [ Str \"tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Apple\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Pie\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain [ Str \"Food\" , Space , Str \"complements\" ] ])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Orange\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Apple\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Pie\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption\n         Nothing\n         [ Plain [ Str \"Food\" , Space , Str \"complements\" ] ])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Orange\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Apple\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Bread\" ]\n                  , Para [ Str \"and\" , Space , Str \"cheese\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Pie\" ]\n                  , OrderedList\n                      ( 1 , DefaultStyle , DefaultDelim )\n                      [ [ Plain [ Str \"apple\" ] ]\n                      , [ Plain [ Str \"carrot\" ] ]\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Apple\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"more\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Pie\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"more\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"and\" , Space , Str \"more\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignLeft , ColWidth 0.25 )\n      , ( AlignRight , ColWidth 0.125 )\n      , ( AlignCenter , ColWidth 0.125 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [ ( \"width\" , \"50%\" ) ] )\n                 AlignLeft\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Left\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignRight\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Right\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignCenter\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"Center\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"left\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"15.00\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"centered\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"more\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"2.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"more\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Apple\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Table\n                      ( \"\" , [] , [] )\n                      (Caption Nothing [])\n                      [ ( AlignDefault , ColWidthDefault )\n                      , ( AlignDefault , ColWidthDefault )\n                      ]\n                      (TableHead\n                         ( \"\" , [] , [] )\n                         [ Row\n                             ( \"\" , [] , [] )\n                             [ Cell\n                                 ( \"\" , [] , [] )\n                                 AlignDefault\n                                 (RowSpan 1)\n                                 (ColSpan 1)\n                                 [ Para [ Str \"fruit\" ] ]\n                             , Cell\n                                 ( \"\" , [] , [] )\n                                 AlignDefault\n                                 (RowSpan 1)\n                                 (ColSpan 1)\n                                 [ Para [ Str \"topping\" ] ]\n                             ]\n                         ])\n                      [ TableBody\n                          ( \"\" , [] , [] )\n                          (RowHeadColumns 0)\n                          []\n                          [ Row\n                              ( \"\" , [] , [] )\n                              [ Cell\n                                  ( \"\" , [] , [] )\n                                  AlignDefault\n                                  (RowSpan 1)\n                                  (ColSpan 1)\n                                  [ Para [ Str \"apple\" ] ]\n                              , Cell\n                                  ( \"\" , [] , [] )\n                                  AlignDefault\n                                  (RowSpan 1)\n                                  (ColSpan 1)\n                                  [ Para\n                                      [ Str \"ice\"\n                                      , Space\n                                      , Str \"cream\"\n                                      ]\n                                  ]\n                              ]\n                          ]\n                      ]\n                      (TableFoot ( \"\" , [] , [] ) [])\n                  ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault ) ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Orange\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Paragraph\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"table.\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"fruit\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Para [ Str \"topping\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"apple\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 2 ( \"notes\" , [] , [] ) [ Str \"notes\" ]\n  , Para\n      [ Str \"My\"\n      , Space\n      , Str \"note!\"\n      , Note [ Plain [ Str \"This.\" ] ]\n      ]\n  , Para\n      [ Str \"URL\"\n      , Space\n      , Str \"note.\"\n      , Note\n          [ Plain\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str\n                      \"http://docs.python.org/library/functions.html#range\"\n                  ]\n                  ( \"http://docs.python.org/library/functions.html#range\"\n                  , \"\"\n                  )\n              ]\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/mediawiki-reader.wiki",
    "content": "= header =\n\n== header level two ==\n\n===header level 3===\n\n====header ''level'' four====\n\n===== header level 5 =====\n\n====== header level 6 ======\n\n======= not a header ========\n\n == not a header ==\n\n== emph and strong ==\n\n''emph'' '''strong'''\n\n'''''strong and emph'''''\n\n'''''emph inside'' strong'''\n\n'''strong with ''emph'''''\n\n'''''strong inside''' emph''\n\n== horizontal rule ==\n\ntop\n----\nbottom\n\n----\n\n== nowiki ==\n\n<nowiki>''not emph''</nowiki>\n\n== strikeout ==\n\n<strike> This is ''struck out''</strike>\n\n== entities ==\n\nhi & low\n\nhi &amp; low\n\nG&ouml;del\n\n&#777;&#xAAA;\n\n== comments ==\n\ninline<!-- secret --> comment\n\n<!-- secret -->\n\nbetween blocks\n\n <!-- secret -->\n\n== linebreaks ==\n\nhi<br/>there\n\nhi<br>\nthere\n\n== : indents ==\n\nhi\n: there\nbud\n\nhi\n:: there\nbud\n\n== p tags ==\n\nhi there\n<p>\nbud\n<p>\nanother\n</p>\n\n== raw html ==\n\nhi <span style=\"color:red\">''there''</span>.\n\n<ins>inserted</ins>\n\n<div class=\"special\">\nhi ''there''\n</div>\n\n== sup, sub, del ==\n\nH<sub>2</sub>O base<sup>''exponent''</sup>\n<del>hello</del>\n\n== inline code ==\n\n<code>*→*</code> <tt>typed</tt> <hask>>>=</hask>\n\n== code blocks ==\n\n<pre>\ncase xs of\n     (_:_) -> reverse xs\n     []    -> ['*']\n</pre>\n\n<haskell>\ncase xs of\n     (_:_) -> reverse xs\n     []    -> ['*']\n</haskell>\n\n<syntaxhighlight lang=\"ruby\" line start=100>\nwidgets.each do |w|\n  print w.price\nend\n</syntaxhighlight>\n\n== block quotes ==\n\nRegular paragraph\n<blockquote>\nThis is a block quote.\n\nWith two paragraphs.\n</blockquote>\nNother paragraph.\n\n== external links ==\n\n[http://google.com ''Google'' search engine]\n\nhttp://pandoc.org\n\n[http://google.com] [http://yahoo.com]\n\n[mailto:info@example.org email me]\n\n== internal links ==\n\n[[Help]]\n\n[[Help|the help page]]\n\n[[Help]]ers\n\n[[Help]]<nowiki/>ers\n\n[[Help:Contents|]]\n\n[[#My anchor]]\n\n[[Page#with anchor|and text]]\n\n== images ==\n\n[[File:example.jpg|caption]]\n\n[[File:example.jpg|border|the ''caption'' with [http://google.com external link]]]\n\n[[File:example.jpg|frameless|border|30x40px|caption]]\n\n[[File:example.jpg|frameless|border|30px|caption]]\n\n[[File:example.jpg|page=4|30px|border|caption]]\n\n[[File:example.jpg]]\n\n[[Archivo:example_es.jpg]]\n\n== lists ==\n\n* Start each line\n* with an asterisk (*).\n** More asterisks gives deeper\n*** and deeper levels.\n* Line breaks<br/>don't break levels.\n*** But jumping levels creates empty space.\nAny other start ends the list.\n\n** two\n* one\n\n# Start each line\n# with a number sign (#).\n## More number signs gives deeper\n### and deeper\n### levels.\n# Line breaks<br/>don't break levels.\n### But jumping levels creates empty space.\n# Blank lines\n\n# end the list and start another.\nAny other start also\nends the list.\n\n;item 1\n: definition 1\n;item 2\n: definition 2-1\n: definition 2-2\n\n# one\n# two\n#* two point one\n#* two point two\n# three\n#; three item one\n#: three def one\n# four\n#: four def one\n#: this looks like a continuation\n#: and is often used\n#: instead<br/>of <nowiki><br/></nowiki>\n# {{{template\n|author=John\n|title=My Book\n}}}\n## five sub 1\n### five sub 1 sub 1\n## five sub 2\n\n<ol>\n  <li>list item ''emph''\n    <ol>\n      <li>list item B1</li>\n      <li>list item B2</li>\n    </ol>continuing list item A1\n  </li>\n  <li>list item A2</li>\n</ol>\n\n<ol>\n#abc\n#def\n#ghi\n</ol>\n\n<ol start=\"9\">\n<li>Amsterdam</li>\n<li>Rotterdam</li>\n<li>The Hague</li>\n</ol>\n\n== math ==\n\nHere is some <math>x=\\frac{y^\\pi}{z}</math>.\n\nWith spaces: <math> x=\\frac{y^\\pi}{z} </math>.\n\n== preformatted blocks ==\n\n Start each line with a space.\n Text is '''preformatted''' and\n ''markups'' '''''can''''' be done.\n\n  hell      yeah\n\n <nowiki>Start with a space in the first column,\n(before the <nowiki>).\n\nThen your block format will be\n    maintained.\n\nThis is good for copying in code blocks:\n\ndef function():\n    \"\"\"documentation string\"\"\"\n\n    if True:\n        print True\n    else:\n        print False</nowiki>\n\nNot<hr/> preformatted\n\nDon't need\n a blank line\naround a preformatted block.\n\n== templates ==\n\n{{Welcome}}\n\n{{Foo:Bar}}\n\n{{Thankyou|all your effort|Me}}\n\nWritten {{{date}}} by {{{name}}}.\n\n== tables ==\n\n{|\n|-\n|Orange\n|Apple\n|-\n|Bread\n|Pie\n|-\n|Butter\n|Ice cream\n|}\n\n{|\n|+Food complements\n!Orange\n!Apple\n|-\n|Bread\n|Pie\n|-\n!Butter\n|Ice cream\n|}\n\n{|\n|+Food complements\n!Orange\n!Apple\n|-\n|Bread\n\nand cheese\n|Pie\n\n# apple\n# carrot\n\n|}\n\n{|\n|  Orange    ||   Apple   ||   more\n|-\n|   Bread    ||   Pie     ||   more\n|-\n|   Butter   || Ice cream ||  and more\n|}\n\n{|width=50%\n! align=\"left\" width=\"50%\"| Left\n! align=\"right\"|Right\n! align=\"center\"|Center\n|-\n| left || 15.00 || centered\n|-\n| more || 2.0 || more\n|}\n\n{|\n|-\n|Orange\n|Apple\n|-\n|Bread\n|\n{|\n!fruit\n!topping\n|-\n|apple\n|ice cream\n|}\n|-\n|Butter\n|Ice cream\n|}\n\n{|\n|Orange\n|}Paragraph after the table.\n\n{|\n !fruit\n !topping\n |-\n |apple\n |ice cream\n |}\n\n== notes ==\n\nMy note!<ref>This.</ref>\n\nURL note.<ref>http://docs.python.org/library/functions.html#range</ref>\n"
  },
  {
    "path": "test/odt/markdown/blockquote2.md",
    "content": "Paragraph\n\n> A blockquote.\n"
  },
  {
    "path": "test/odt/markdown/bold.md",
    "content": "Here comes **bold** text"
  },
  {
    "path": "test/odt/markdown/citation.md",
    "content": "Some text[@Ex] with a citation."
  },
  {
    "path": "test/odt/markdown/endnote.md",
    "content": "Some text[^1] with an endnote.\n\n[^1]: Endnote text"
  },
  {
    "path": "test/odt/markdown/externalLink.md",
    "content": "Here comes an [external link](http://example.com/) to example.com."
  },
  {
    "path": "test/odt/markdown/footnote.md",
    "content": "Some text[^1] with a footnote.\n\n[^1]: Footnote text"
  },
  {
    "path": "test/odt/markdown/formula.md",
    "content": "$$E = {m \\cdot c^{2}}$$"
  },
  {
    "path": "test/odt/markdown/headers.md",
    "content": "# A header (Lv 1)\n\nA paragraph\n\n## Another header (Lv 2)\n\nAnother paragraph\n\n# Back to Level 1"
  },
  {
    "path": "test/odt/markdown/horizontalRule.md",
    "content": "---"
  },
  {
    "path": "test/odt/markdown/image.md",
    "content": "![](10000000000000FA000000FAD6A15225.jpg)"
  },
  {
    "path": "test/odt/markdown/imageIndex.md",
    "content": "# Abbildungsverzeichnis\n\nAbbildung 1: Image caption\n\n![Abbildung 1: Image caption](10000000000000FA000000FAD6A15225.jpg)\n\n"
  },
  {
    "path": "test/odt/markdown/imageWithCaption.md",
    "content": "![Abbildung 1: Image caption](10000000000000FA000000FAD6A15225.jpg)"
  },
  {
    "path": "test/odt/markdown/italic.md",
    "content": "Here comes *italic* text"
  },
  {
    "path": "test/odt/markdown/listBlocks.md",
    "content": "<text:list xml:id=\"list2666723676250588421\" text:style-name=\"L6\">\n<text:list-header>\n<text:p text:style-name=\"P1\">Indented text in a list.</text:p>\n</text:list-header>\n<text:list-item>\n<text:p text:style-name=\"P1\">This is a numbered block.<text:line-break/>It contains several paragraphs of text.<text:line-break/>Like this.</text:p></text:list-item><text:list-item><text:p text:style-name=\"P1\">Next item.</text:p></text:list-item></text:list></office:text></office:body></office:document-content>"
  },
  {
    "path": "test/odt/markdown/paragraph.md",
    "content": "This is a paragraph.\n\nThis is another paragraph.\n\nThis is a third one."
  },
  {
    "path": "test/odt/markdown/strikeout.md",
    "content": "Here comes text that was ~~striken out~~."
  },
  {
    "path": "test/odt/markdown/trackedChanges.md",
    "content": "Some text with and inserted text."
  },
  {
    "path": "test/odt/markdown/underlined.md",
    "content": "Here comes *underlined* text"
  },
  {
    "path": "test/odt/native/blockquote.native",
    "content": "[Para [Str \"Normal\"],BlockQuote [Para [Str \"Indented\",Space,Str \"(1cm)\"]]]"
  },
  {
    "path": "test/odt/native/image.native",
    "content": "[Para [Image (\"\",[],[(\"width\",\"5.292cm\"),(\"height\",\"5.292cm\")]) [] (\"Pictures/10000000000000FA000000FAD6A15225.jpg\",\"\")]]\n"
  },
  {
    "path": "test/odt/native/imageIndex.native",
    "content": "[ Figure\n  ( \"\" , [] , [] )\n  (Caption\n     Nothing\n     [ Plain\n         [ Str \"Image\"\n         , Space\n         , Str \"caption\"\n         ]\n     ])\n  [ Plain\n      [ Image\n          ( \"\"\n          , []\n          , [ ( \"width\" , \"5.292cm\" ) , ( \"height\" , \"5.292cm\" ) ]\n          )\n          [ Str \"Abbildung\"\n          , Space\n          , Str \"1:\"\n          , Space\n          , Str \"Image\"\n          , Space\n          , Str \"caption\"\n          ]\n          ( \"Pictures/10000000000000FA000000FAD6A15225.jpg\" , \"\" )\n      ]\n  ]\n]"
  },
  {
    "path": "test/odt/native/imageRelative.native",
    "content": "[ Para\n    [ Image\n        ( \"\"\n        , []\n        , [ ( \"width\" , \"5.292cm\" ) , ( \"height\" , \"5.292cm\" ) ]\n        )\n        []\n        ( \"../../lalune.jpg\" , \"\" )\n    ]\n]\n"
  },
  {
    "path": "test/odt/native/imageWithCaption.native",
    "content": "[ Figure\n  ( \"\" , [] , [] )\n  (Caption\n     Nothing\n     [ Plain\n         [ Str \"Image\"\n         , Space\n         , Str \"caption\"\n         ]\n     ])\n  [ Plain\n      [ Image\n          ( \"\"\n          , []\n          , [ ( \"width\" , \"5.292cm\" ) , ( \"height\" , \"5.292cm\" ) ]\n          )\n          [ Str \"Abbildung\"\n          , Space\n          , Str \"1:\"\n          , Space\n          , Str \"Image\"\n          , Space\n          , Str \"caption\"\n          ]\n          ( \"Pictures/10000000000000FA000000FAD6A15225.jpg\" , \"\" )\n      ]\n  ]\n]"
  },
  {
    "path": "test/odt/native/inlinedCode.native",
    "content": "[Para [Str \"Here\",Space,Str \"comes\",Space,Code (\"\",[],[]) \"inlined code\",Space,Str \"text\",Space,Str \"and\",Space,Code (\"\",[],[]) \"an another\",Space,Str \"one.\"]]\n"
  },
  {
    "path": "test/odt/native/listContinueNumbering.native",
    "content": "[ OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(1.)\" ]\n        ]\n    ]\n, Para []\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"between.\"\n    ]\n, Para []\n, OrderedList\n    ( 2 , Decimal , Period )\n    [ [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(2.)\" ]\n        ]\n    , [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(3.)\" ]\n        ]\n    ]\n, Para []\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"between.\"\n    ]\n, Para []\n, OrderedList\n    ( 4 , Decimal , Period )\n    [ [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(4.)\" ]\n        ]\n    ]\n, Para []\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"before\"\n    , Space\n    , Str \"starting\"\n    , Space\n    , Str \"new\"\n    , Space\n    , Str \"list\"\n    , Space\n    , Str \"from\"\n    , Space\n    , Str \"1.\"\n    ]\n, Para []\n, OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(1.)\" ]\n        ]\n    ]\n, Para []\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"between.\"\n    ]\n, Para []\n, OrderedList\n    ( 2 , Decimal , Period )\n    [ [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(2.)\" ]\n        ]\n    , [ Plain\n            [ Str \"Some\" , Space , Str \"text\" , Space , Str \"(3.)\" ]\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/odt/native/listContinueNumbering2.native",
    "content": "[ OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Para [ Str \"Top\" , Space , Str \"one\" ]\n      , OrderedList\n          ( 1 , LowerAlpha , Period )\n          [[ Plain\n             [ Str \"Sub\"\n             , Space\n             , Str \"item\"\n             , Space\n             , Str \"1.a\"\n             ]\n            ]\n          , [ Plain\n              [ Str \"Sub\"\n              , Space\n              , Str \"item\"\n              , Space\n              , Str \"1.b\"\n              ]\n            ]\n          ]\n      ]\n    ]\n, Para []\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"between.\"\n    ]\n, Para []\n, OrderedList\n    ( 2 , Decimal , Period )\n    [ [ Para [ Str \"Top\" , Space , Str \"two\" ]\n      , OrderedList\n          ( 1 , LowerAlpha , Period )\n          [ [ Plain\n              [ Str \"Sub\"\n              , Space\n              , Str \"item\"\n              , Space\n              , Str \"2.a\"\n              ]\n            ]\n          , [ Plain\n              [ Str \"Sub\"\n              , Space\n              , Str \"item\"\n              , Space\n              , Str \"2.b\"\n              ]\n            ]\n          ]\n      ]\n    ]\n, Para []\n, Para\n    [ Str \"Some\"\n    , Space\n    , Str \"text\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"between.\"\n    ]\n, Para []\n, OrderedList\n    ( 3 , Decimal , Period )\n    [ [ Para [ Str \"Top\" , Space , Str \"three\" ]\n      , OrderedList\n          ( 1 , LowerAlpha , Period )\n          [ [ Plain\n              [ Str \"Sub\"\n              , Space\n              , Str \"item\"\n              , Space\n              , Str \"3.a\"\n              ]\n            ]\n          , [ Plain\n              [ Str \"Sub\"\n              , Space\n              , Str \"item\"\n              , Space\n              , Str \"3.b\"\n              ]\n            ]\n          ]\n      ]\n    ]\n]\n"
  },
  {
    "path": "test/odt/native/orderedListHeader.native",
    "content": "[ OrderedList\n    ( 1 , Decimal , Period )\n    [ [ Plain\n          [ Str \"A\"\n          , Space\n          , Str \"list\"\n          , Space\n          , Str \"item\"\n          , Space\n          , Str \"(list-header)\"\n          ]\n      ]\n    , [ Plain [ Str \"A\" , Space , Str \"second\" ] ]\n    , [ Para [ Str \"A\" , Space , Str \"third\" ]\n      , OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Para\n                [ Str \"New\"\n                , Space\n                , Str \"level!\"\n                , Space\n                , Str \"(list-header)\"\n                ]\n            , OrderedList\n                ( 1 , Decimal , Period )\n                [ [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"another!\"\n                      , Space\n                      , Str \"(list-header)\"\n                      ]\n                  ]\n                , [ Plain\n                      [ Str \"It's\"\n                      , Space\n                      , Str \"great\"\n                      , Space\n                      , Str \"up\"\n                      , Space\n                      , Str \"here!\"\n                      ]\n                  ]\n                ]\n            ]\n          , [ Plain [ Str \"Oh\" , Space , Str \"noes\" ] ]\n          , [ Plain [ Str \"We\" , Space , Str \"fell!\" ] ]\n          ]\n      ]\n    , [ Plain [ Str \"Maybe\" , Space , Str \"someone\" ] ]\n    , [ Plain [ Str \"Pushed\" , Space , Str \"us?\" ] ]\n    ]\n, Para []\n, OrderedList\n    ( 4 , Decimal , Period )\n    [ [ Plain\n          [ Str \"Start\"\n          , Space\n          , Str \"new\"\n          , Space\n          , Str \"list,\"\n          , Space\n          , Str \"but\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"different\"\n          , Space\n          , Str \"starting\"\n          , Space\n          , Str \"point.\"\n          , Space\n          , Str \"(list-header)\"\n          ]\n      ]\n    , [ Plain\n          [ Str \"Because\" , Space , Str \"we\" , Space , Str \"can.\" ]\n      ]\n    ]\n]\n"
  },
  {
    "path": "test/odt/native/orderedListMixed.native",
    "content": "Pandoc (Meta {unMeta = fromList []}) [OrderedList (1,Decimal,Period) [[Plain [Str \"A\",Space,Str \"list\",Space,Str \"item\"]],[Plain [Str \"A\",Space,Str \"second\"]],[Para [Str \"A\",Space,Str \"third\"],OrderedList (1,Decimal,Period) [[Para [Str \"New\",Space,Str \"level!\"],OrderedList (1,LowerAlpha,OneParen) [[Plain [Str \"And\",Space,Str \"another!\"]],[Plain [Str \"It's\",Space,Str \"great\",Space,Str \"up\",Space,Str \"here!\"]]]],[Plain [Str \"Oh\",Space,Str \"noes\"]],[Plain [Str \"We\",Space,Str \"fell!\"]]]],[Plain [Str \"Maybe\",Space,Str \"someone\"]],[Plain [Str \"Pushed\",Space,Str \"us?\"]]],Para [],OrderedList (4,Decimal,Period) [[Plain [Str \"Start\",Space,Str \"new\",Space,Str \"list,\",Space,Str \"but\",Space,Str \"a\",Space,Str \"different\",Space,Str \"starting\",Space,Str \"point.\"]] ,[Plain [Str \"Because\",Space,Str \"we\",Space,Str \"can.\"]]]]"
  },
  {
    "path": "test/odt/native/orderedListRoman.native",
    "content": "Pandoc (Meta {unMeta = fromList []}) [OrderedList (1,UpperRoman,Period) [[Plain[Str \"A\",Space,Str \"list\",Space,Str \"item\"]],[Plain [Str \"A\",Space,Str \"second\"]],[Para [Str \"A\",Space,Str \"third\"],OrderedList (1,UpperRoman,Period) [[Para [Str \"New\",Space,Str \"level!\"],OrderedList (1,UpperRoman,Period) [[Plain [Str \"And\",Space,Str \"another!\"]],[Plain [Str \"It's\",Space,Str \"great\",Space,Str \"up\",Space,Str \"here!\"]]]],[Plain [Str \"Oh\",Space,Str \"noes\"]],[Plain [Str \"We\",Space,Str \"fell!\"]]]],[Plain [Str \"Maybe\",Space,Str \"someone\"]],[Plain [Str \"Pushed\",Space,Str \"us?\"]]],Para [],OrderedList (4,UpperRoman,Period) [[Plain [Str \"Start\",Space,Str \"new\",Space,Str \"list,\",Space,Str \"but\",Space,Str \"a\",Space,Str \"different\",Space,Str \"starting\",Space,Str \"point.\"]] ,[Plain [Str \"Because\",Space,Str \"we\",Space,Str \"can.\"]]]]"
  },
  {
    "path": "test/odt/native/orderedListSimple.native",
    "content": "Pandoc (Meta {unMeta = fromList []}) [OrderedList (1,Decimal,Period) [[Plain [Str \"A\",Space,Str \"list\",Space,Str \"item\"]],[Plain [Str \"A\",Space,Str \"second\"]],[Para [Str \"A\",Space,Str \"third\"],OrderedList (1,Decimal,Period) [[Para [Str \"New\",Space,Str \"level!\"],OrderedList (1,Decimal,Period) [[Plain [Str \"And\",Space,Str \"another!\"]],[Plain [Str \"It's\",Space,Str \"great\",Space,Str \"up\",Space,Str \"here!\"]]]],[Plain [Str \"Oh\",Space,Str \"noes\"]],[Plain [Str \"We\",Space,Str \"fell!\"]]]],[Plain [Str \"Maybe\",Space,Str \"someone\"]],[Plain [Str \"Pushed\",Space,Str \"us?\"]]],Para [],OrderedList (4,Decimal,Period) [[Plain [Str \"Start\",Space,Str \"new\",Space,Str \"list,\",Space,Str \"but\",Space,Str \"a\",Space,Str \"different\",Space,Str \"starting\",Space,Str \"point.\"]] ,[Plain [Str \"Because\",Space,Str \"we\",Space,Str \"can.\"]]]]"
  },
  {
    "path": "test/odt/native/preformattedText.native",
    "content": "[ CodeBlock\n    ( \"\" , [] , [] )\n    \"void main() {\\n    printf(\\\"Hello world\\\");\\n}\"\n]\n"
  },
  {
    "path": "test/odt/native/preformattedTextParentStyle.native",
    "content": "[ CodeBlock\n    ( \"\" , [] , [] )\n    \"void main() {\\n    printf(\\\"Hello world\\\");\\n}\"\n]\n"
  },
  {
    "path": "test/odt/native/referenceToChapter.native",
    "content": "[Header 1 (\"a-chapter\",[],[]) [Span (\"anchor\",[],[]) [],Str \"A\",Space,Str \"chapter\"],Para [Str \"Some\",Space,Str \"text.\"],Header 1 (\"another-chapter\",[],[]) [Str \"Another\",Space,Str \"chapter\"],Para [Str \"A\",Space,Str \"reference\",Space,Str \"to\",Space,Str \".\"],Para [Str \"A\",Space,Str \"reference\",Space,Str \"to\",Space,Link (\"\",[],[]) [Str \"A\",Space,Str \"chapter\"] (\"#anchor\",\"\"),Str \".\"]]\n"
  },
  {
    "path": "test/odt/native/referenceToListItem.native",
    "content": "[OrderedList (1,Decimal,Period) [[Plain [Span (\"anchor\",[],[]) [],Str \"A\",Space,Str \"list\",Space,Str \"item\"]],[Plain [Str \"Another\",Space,Str \"list\",Space,Str \"item\"]]],Para [Str \"A\",Space,Str \"reference\",Space,Str \"to\",Space,Str \"list\",Space,Str \"item\",Space,Link (\"\",[],[]) [Str \"1.\"] (\"#anchor\",\"\"),Str \".\"],Para [],Para []]\n"
  },
  {
    "path": "test/odt/native/referenceToText.native",
    "content": "[Para [Span (\"an anchor\",[],[]) [],Str \"Some\",Space,Str \"text.\"],Para [Str \"A\",Space,Str \"reference\",Space,Str \"to\",Space,Link (\"\",[],[]) [Str \"Some\",Space,Str \"text\"] (\"#an anchor\",\"\"),Str \".\"],Para [Str \"Some\",Space,Str \"text\",LineBreak,Str \"Another\",Space,Str \"one\",Space,Str \"with\",Space,Str \"a\",Space,Str \"link\",Span (\"anchor\",[],[]) []]]\n"
  },
  {
    "path": "test/odt/native/simpleTable.native",
    "content": "[Table (\"\",[],[]) (Caption Nothing []) [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)] (TableHead (\"\",[],[]) []) [TableBody (\"\",[],[]) (RowHeadColumns 0) [] [Row (\"\",[],[]) [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"Content\"]],Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"More\",Space,Str \"content\"]]]]] (TableFoot (\"\",[],[]) []),Para []]\n"
  },
  {
    "path": "test/odt/native/simpleTableWithCaption.native",
    "content": "[Table (\"\",[],[]) (Caption Nothing [Para [Str \"Table\",Space,Str \"1:\",Space,Str \"Some\",Space,Str \"caption\",Space,Str \"for\",Space,Str \"a\",Space,Str \"table\"]]) [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)] (TableHead (\"\",[],[]) []) [TableBody (\"\",[],[]) (RowHeadColumns 0) [] [Row (\"\",[],[]) [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"Content\"]],Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"More\",Space,Str \"content\"]]]]] (TableFoot (\"\",[],[]) []),Para []]\n"
  },
  {
    "path": "test/odt/native/simpleTableWithHeader.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"B\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"C\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [ Plain [] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [ Plain [] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [ Plain [] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [ Plain [] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [ Plain [] ]\n            , Cell\n                ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [ Plain [] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para []\n]\n"
  },
  {
    "path": "test/odt/native/simpleTableWithMultipleHeaderRows.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"A\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"B\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"C\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"I\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"II\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"II\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para []\n]\n\n"
  },
  {
    "path": "test/odt/native/sourceText.native",
    "content": "[ Header\n    1\n    ( \"test-foo\" , [] , [] )\n    [ Span ( \"anchor\" , [] , [] ) []\n    , Str \"Test\"\n    , Space\n    , Code ( \"\" , [] , [] ) \"foo\"\n    ]\n, Para\n    [ Str \"Hello\" , Space , Code ( \"\" , [] , [] ) \"world\" ]\n]\n"
  },
  {
    "path": "test/odt/native/tab.native",
    "content": "[Para [Str \"Three\",Space,Str \"tabs\",Space,Str \"between\",Space,Str \"A\",Space,Str \"and\",Space,Str \"B\",Space,Str \"will\",Space,Str \"be\",Space,Str \"converted\",Space,Str \"to\",Space,Str \"one\",Space,Str \"Space:\",Space,Str \"A\",Space,Str \"B.\"]]"
  },
  {
    "path": "test/odt/native/tableWithContents.native",
    "content": "[Table (\"\",[],[]) (Caption Nothing []) [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)] (TableHead (\"\",[],[]) []) [TableBody (\"\",[],[]) (RowHeadColumns 0) [] [Row (\"\",[],[]) [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"A\"]],Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"B\"]]],Row (\"\",[],[]) [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"C\"]],Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str \"D\"]]]]] (TableFoot (\"\",[],[]) []),Para []]\n"
  },
  {
    "path": "test/odt/native/tableWithSpans.native",
    "content": "[ Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 2)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"H1\"\n                   , Space\n                   , Str \"Rowspan\"\n                   , Space\n                   , Str \"2\"\n                   ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"H1-2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"H1-3\" ] ]\n           ]\n       , Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 2)\n               [ Plain [ Str \"H2-2/3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B1-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B1-2\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 3)\n                (ColSpan 1)\n                [ Plain [ Str \"Rowspan\" , Space , Str \"3\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B2-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B2-2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 2)\n                [ Plain [ Str \"Columnspan\" , Space , Str \"2\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B4-1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 2)\n                (ColSpan 2)\n                [ Plain\n                    [ Str \"Columnspan\"\n                    , Space\n                    , Str \"&\"\n                    , Space\n                    , Str \"Rowspan\"\n                    , Space\n                    , Str \"2\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"B5-1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para []\n]\n"
  },
  {
    "path": "test/odt/native/textMixedStyles.native",
    "content": "[Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"simple\",Space,Str \"text\"]\n,Para []\n,Para [Str \"that\",Space,Str \"is\",Space,Str \"both\",Space,Emph [Str \"italic\",Space],Strong [Str \"bold\",Space],Emph [Str \"underlined\",Space],Str \"and\",Space,Str \"the\",Space,Emph [Strong [Str \"first\",Space,Str \"two\"]],Space,Str \"and\",Space,Str \"the\",Space,Emph [Strong [Str \"last\",Space,Str \"two\",Space]],Space,Str \"and\",Space,Strong [Strikeout [Str \"bold\",Space,Str \"and\",Space,Str \"line\",Space,Str \"through\"]]]\n,Para []\n,Para [Str \"And\",Space,Str \"with\",Space,Superscript [Emph [Str \"superscripts\"]]]]\n"
  },
  {
    "path": "test/odt/native/unicode.native",
    "content": "[Para [Str \"\\8220\\8221\\8217\\231\\1256\\169\\188\\1074\\1073\\1060\\1064\\246\\201\\181\"]]"
  },
  {
    "path": "test/odt/native/unorderedList.native",
    "content": "[BulletList [[Plain [Str \"A\",Space,Str \"list\",Space,Str \"item\"]],[Plain [Str \"A\",Space,Str \"second\"]],[Para [Str \"A\",Space,Str \"third\"],BulletList [[Para [Str \"New\",Space,Str \"level!\"],BulletList [[Plain [Str \"And\",Space,Str \"another!\"]],[Plain [Str \"It's\",Space,Str \"great\",Space,Str \"up\",Space,Str \"here!\"]]]],[Plain [Str \"Oh\",Space,Str \"noes\"]],[Plain [Str \"We\",Space,Str \"fell!\"]]]],[Plain [Str \"Maybe\",Space,Str \"someone\"]],[Plain [Str \"Pushed\",Space,Str \"us?\"]]]]"
  },
  {
    "path": "test/odt/native/unorderedListHeader.native",
    "content": "[ BulletList\n    [ [ Plain\n          [ Str \"A\"\n          , Space\n          , Str \"list\"\n          , Space\n          , Str \"item\"\n          , Space\n          , Str \"(list-header)\"\n          ]\n      ]\n    , [ Plain [ Str \"A\" , Space , Str \"second\" ] ]\n    , [ Para [ Str \"A\" , Space , Str \"third\" ]\n      , BulletList\n          [ [ Para\n                [ Str \"New\"\n                , Space\n                , Str \"level!\"\n                , Space\n                , Str \"(list-header)\"\n                ]\n            , BulletList\n                [ [ Plain\n                      [ Str \"And\"\n                      , Space\n                      , Str \"another!\"\n                      , Space\n                      , Str \"(list-header)\"\n                      ]\n                  ]\n                , [ Plain\n                      [ Str \"It's\"\n                      , Space\n                      , Str \"great\"\n                      , Space\n                      , Str \"up\"\n                      , Space\n                      , Str \"here!\"\n                      ]\n                  ]\n                ]\n            ]\n          , [ Plain [ Str \"Oh\" , Space , Str \"noes\" ] ]\n          , [ Plain [ Str \"We\" , Space , Str \"fell!\" ] ]\n          ]\n      ]\n    , [ Plain [ Str \"Maybe\" , Space , Str \"someone\" ] ]\n    , [ Plain [ Str \"Pushed\" , Space , Str \"us?\" ] ]\n    ]\n]\n"
  },
  {
    "path": "test/opml-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"Dave\" , Space , Str \"Winer\" ] ]\n            )\n          , ( \"date\"\n            , MetaInlines\n                [ Str \"Thu,\"\n                , Space\n                , Str \"14\"\n                , Space\n                , Str \"Jul\"\n                , Space\n                , Str \"2005\"\n                , Space\n                , Str \"23:41:05\"\n                , Space\n                , Str \"GMT\"\n                ]\n            )\n          , ( \"title\" , MetaInlines [ Str \"States\" ] )\n          ]\n    }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"United\" , Space , Str \"States\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"Far\" , Space , Str \"West\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Alaska\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"California\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Hawaii\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Strong [ Str \"Nevada\" ] ]\n  , Para\n      [ Str \"I\"\n      , Space\n      , Str \"lived\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Emph [ Str \"once\" ]\n      , Str \".\"\n      ]\n  , Para [ Str \"Loved\" , Space , Str \"it.\" ]\n  , Header\n      4\n      ( \"\" , [] , [] )\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Reno\" ]\n          ( \"http://www.reno.gov\" , \"\" )\n      ]\n  , Header\n      4 ( \"\" , [] , [] ) [ Str \"Las\" , Space , Str \"Vegas\" ]\n  , Header 4 ( \"\" , [] , [] ) [ Str \"Ely\" ]\n  , Header 4 ( \"\" , [] , [] ) [ Str \"Gerlach\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Oregon\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Washington\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"Great\" , Space , Str \"Plains\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Kansas\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Nebraska\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"North\" , Space , Str \"Dakota\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Oklahoma\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"South\" , Space , Str \"Dakota\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Mid-Atlantic\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Delaware\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Maryland\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"New\" , Space , Str \"Jersey\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"New\" , Space , Str \"York\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Pennsylvania\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Midwest\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Illinois\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Indiana\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Iowa\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Kentucky\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Michigan\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Minnesota\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Missouri\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Ohio\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"West\" , Space , Str \"Virginia\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Wisconsin\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Mountains\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Colorado\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Idaho\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Montana\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Utah\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Wyoming\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"New\" , Space , Str \"England\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Connecticut\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Maine\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Massachusetts\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"New\" , Space , Str \"Hampshire\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"Rhode\" , Space , Str \"Island\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Vermont\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"South\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Alabama\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Arkansas\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Florida\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Georgia\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Louisiana\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Mississippi\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"North\" , Space , Str \"Carolina\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"South\" , Space , Str \"Carolina\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Tennessee\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Virginia\" ]\n  , Header 2 ( \"\" , [] , [] ) [ Str \"Southwest\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Arizona\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"New\" , Space , Str \"Mexico\" ]\n  , Header 3 ( \"\" , [] , [] ) [ Str \"Texas\" ]\n  ]\n"
  },
  {
    "path": "test/opml-reader.opml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<opml version=\"2.0\">\n  <head>\n    <title>States</title>\n    <dateModified>Thu, 14 Jul 2005 23:41:05 GMT</dateModified>\n    <ownerName>Dave Winer</ownerName>\n  </head>\n  <body>\n    <outline text=\"United States\">\n      <outline text=\"Far West\">\n        <outline text=\"Alaska\"/>\n        <outline text=\"California\"/>\n        <outline text=\"Hawaii\"/>\n          <outline text=\"&lt;strong&gt;Nevada&lt;/strong&gt;\" _note=\"I lived here *once*.&#10;&#10;Loved it.\">\n          <outline text=\"Reno\" created=\"Tue, 12 Jul 2005 23:56:35 GMT\" type=\"link\" url=\"http://www.reno.gov\"/>\n          <outline text=\"Las Vegas\" created=\"Tue, 12 Jul 2005 23:56:37 GMT\"/>\n          <outline text=\"Ely\" created=\"Tue, 12 Jul 2005 23:56:39 GMT\"/>\n          <outline text=\"Gerlach\" created=\"Tue, 12 Jul 2005 23:56:47 GMT\"/>\n          </outline>\n        <outline text=\"Oregon\"/>\n        <outline text=\"Washington\"/>\n        </outline>\n      <outline text=\"Great Plains\">\n        <outline text=\"Kansas\"/>\n        <outline text=\"Nebraska\"/>\n        <outline text=\"North Dakota\"/>\n        <outline text=\"Oklahoma\"/>\n        <outline text=\"South Dakota\"/>\n        </outline>\n      <outline text=\"Mid-Atlantic\">\n        <outline text=\"Delaware\"/>\n        <outline text=\"Maryland\"/>\n        <outline text=\"New Jersey\"/>\n        <outline text=\"New York\"/>\n        <outline text=\"Pennsylvania\"/>\n        </outline>\n      <outline text=\"Midwest\">\n        <outline text=\"Illinois\"/>\n        <outline text=\"Indiana\"/>\n        <outline text=\"Iowa\"/>\n        <outline text=\"Kentucky\"/>\n        <outline text=\"Michigan\"/>\n        <outline text=\"Minnesota\"/>\n        <outline text=\"Missouri\"/>\n        <outline text=\"Ohio\"/>\n        <outline text=\"West Virginia\"/>\n        <outline text=\"Wisconsin\"/>\n        </outline>\n      <outline text=\"Mountains\">\n        <outline text=\"Colorado\"/>\n        <outline text=\"Idaho\"/>\n        <outline text=\"Montana\"/>\n        <outline text=\"Utah\"/>\n        <outline text=\"Wyoming\"/>\n        </outline>\n      <outline text=\"New England\">\n        <outline text=\"Connecticut\"/>\n        <outline text=\"Maine\"/>\n        <outline text=\"Massachusetts\"/>\n        <outline text=\"New Hampshire\"/>\n        <outline text=\"Rhode Island\"/>\n        <outline text=\"Vermont\"/>\n        </outline>\n      <outline text=\"South\">\n        <outline text=\"Alabama\"/>\n        <outline text=\"Arkansas\"/>\n        <outline text=\"Florida\"/>\n        <outline text=\"Georgia\"/>\n        <outline text=\"Louisiana\"/>\n        <outline text=\"Mississippi\"/>\n        <outline text=\"North Carolina\"/>\n        <outline text=\"South Carolina\"/>\n        <outline text=\"Tennessee\"/>\n        <outline text=\"Virginia\"/>\n      </outline>\n      <outline text=\"Southwest\">\n        <outline text=\"Arizona\"/>\n        <outline text=\"New Mexico\"/>\n        <outline text=\"Texas\"/>\n      </outline>\n    </outline>\n  </body>\n</opml>\n"
  },
  {
    "path": "test/org-select-tags.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header\n      1\n      ( \"will-appear-because-it-is-the-ancestor-of-something-tagged-yes\"\n      , []\n      , []\n      )\n      [ Str \"Will\"\n      , Space\n      , Str \"appear\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"ancestor\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"something\"\n      , Space\n      , Str \"tagged\"\n      , Space\n      , Str \"\\\"yes\\\"\"\n      ]\n  , Header\n      2\n      ( \"will-appear\" , [] , [] )\n      [ Str \"Will\"\n      , Space\n      , Str \"appear\"\n      , Space\n      , Span\n          ( \"\" , [ \"tag\" ] , [ ( \"tag-name\" , \"yes\" ) ] )\n          [ SmallCaps [ Str \"yes\" ] ]\n      ]\n  , Header\n      3\n      ( \"will-appear-since-the-entire-subtree-of-something-selected-will-appear\"\n      , []\n      , []\n      )\n      [ Str \"Will\"\n      , Space\n      , Str \"appear\"\n      , Space\n      , Str \"since\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"entire\"\n      , Space\n      , Str \"subtree\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"something\"\n      , Space\n      , Str \"selected\"\n      , Space\n      , Str \"will\"\n      , Space\n      , Str \"appear\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Para [ Str \"Will\" , Space , Str \"appear\" ] ] ]\n  , Header\n      2\n      ( \"will-appear-because-it-is-the-ancestor-of-something-listed-in-select-tags\"\n      , []\n      , []\n      )\n      [ Str \"Will\"\n      , Space\n      , Str \"appear\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"ancestor\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"something\"\n      , Space\n      , Str \"listed\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"SELECT-TAGS\"\n      ]\n  ]\n"
  },
  {
    "path": "test/org-select-tags.org",
    "content": "#+select_tags: yes no\n#+exclude_tags: no\n\nIn a document containing one or more trees containing a tag\nlisted in SELECT_TAGS, only those trees and their ancestor nodes will appear;\nthis text and any other text preceding the first headline\nwon't appear for such documents.\n\n* Will appear because it is the ancestor of something tagged \"yes\"\n** Will appear                                                           :yes:\n*** Will appear since the entire subtree of something selected will appear\n**** Will appear\n*** Will not appear since this has tagged with something in EXCLUDE-TAGS :no:\n** Will not appear since it's not an ancestor of listed in SELECT-TAGS\n** Will appear because it is the ancestor of something listed in SELECT-TAGS\n*** Will not appear because it has an EXCLUDE-TAG, but since \"no\" is also listed as a SELECT-TAG, it will force its parent to appear :no:\n* Will not appear\n"
  },
  {
    "path": "test/pipe-tables.native",
    "content": "[ Para\n    [ Str \"Simplest\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Demonstration\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"simple\"\n           , Space\n           , Str \"table\"\n           , Space\n           , Str \"syntax.\"\n           ]\n       ])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Headerless\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Table\" , Space , Str \"without\" , Space , Str \"sides:\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Fruit\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Quantity\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"apple\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"orange\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"17\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"pear\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"302\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para [ Str \"One-column:\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"hi\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"lo\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para [ Str \"Header-less\" , Space , Str \"one-column:\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidthDefault ) ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"hi\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Indented\" , Space , Str \"left\" , Space , Str \"column:\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain\n                   [ Str \"Number\" , Space , Str \"of\" , Space , Str \"siblings\" ]\n               ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Salary\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"33\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"4\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"44\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Long\"\n    , Space\n    , Str \"pipe\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"relative\"\n    , Space\n    , Str \"widths:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.15517241379310345 )\n    , ( AlignDefault , ColWidth 0.1724137931034483 )\n    , ( AlignDefault , ColWidth 0.6724137931034483 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"this\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"table\"\n                    , Space\n                    , Str \"cell\"\n                    ]\n                ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"and\"\n                    , Space\n                    , Str \"this\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"really\"\n                    , Space\n                    , Str \"long\"\n                    , Space\n                    , Str \"table\"\n                    , Space\n                    , Str \"cell\"\n                    , Space\n                    , Str \"that\"\n                    , Space\n                    , Str \"will\"\n                    , Space\n                    , Str \"probably\"\n                    , Space\n                    , Str \"need\"\n                    , Space\n                    , Str \"wrapping\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Pipe\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"no\"\n    , Space\n    , Str \"body:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault ) ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Header\" ] ]\n           ]\n       ])\n    [ TableBody ( \"\" , [] , [] ) (RowHeadColumns 0) [] [] ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Pipe\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"tricky\"\n    , Space\n    , Str \"cell\"\n    , Space\n    , Str \"contents\"\n    , Space\n    , Str \"(see\"\n    , Space\n    , Str \"#2765):\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignLeft , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell ( \"\" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"IP_gene8-_1st\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"IP_gene8+_1st\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"IP_gene8-_1st\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1.0000000\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0.4357325\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"IP_gene8+_1st\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"0.4357325\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1.0000000\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"foo\" , Code ( \"\" , [] , [] ) \"bar|baz\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"and|escaped\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"3.0000000\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n"
  },
  {
    "path": "test/pipe-tables.txt",
    "content": "Simplest table without caption:\n\n| Default1 | Default2 | Default3 | \n |----------|----------|----------|\n|12|12|12|\n|123|123|123|\n|1|1|1|\n\nSimple table with caption:\n\n| Right | Left | Default | Center |\n| ----: | :--- | ------- | :----: |\n|   12  |  12  |    12   |    12  |\n|  123  |  123 |   123   |   123  |\n|    1  |    1 |     1   |     1  |\n\n  : Demonstration of simple table syntax.\n\nSimple table without caption:\n\n| Right | Left | Center | \n|------:|:-----|:------:|\n|12|12|12|\n|123|123|123|\n|1|1|1|\n\n\nHeaderless table without caption:\n\n|       |      |        |\n|------:|:-----|:------:|\n|12|12|12|\n|123|123|123|\n|1|1|1|\n\nTable without sides:\n\nFruit |Quantity\n------|-------:\napple |    5\norange|   17\npear  |  302\n\nOne-column:\n\n|hi|\n|--|\n|lo|\n\nHeader-less one-column:\n\n|   |\n|:-:|\n|hi|\n\nIndented left column:\n\nNumber of siblings | Salary\n------------------:|:------\n                 3 | 33\n                 4 | 44\n\nLong pipe table with relative widths:\n\n| Default1 | Default2 | Default3 |\n |---------|----------|---------------------------------------|\n|123|this is a table cell|and this is a really long table cell that will probably need wrapping|\n|123|123|123|\n\nPipe table with no body:\n\n| Header |\n| ------ |\n\nPipe table with tricky cell contents (see #2765):\n\n|               | IP_gene8-_1st| IP_gene8+_1st|\n|:--------------|-------------:|-------------:|\n|IP_gene8-_1st  |     1.0000000|     0.4357325|\n|IP_gene8+_1st  |     0.4357325|     1.0000000|\n|foo`bar|baz`   | and\\|escaped |     3.0000000|\n\n"
  },
  {
    "path": "test/pod-reader.native",
    "content": "[ Header\n    1\n    ( \"\" , [] , [] )\n    [ Str \"POD\" , Space , Str \"TEST\" , Space , Str \"SUITE\" ]\n, Para\n    [ Str \"This\"\n    , Space\n    , Str \"is\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"test\"\n    , Space\n    , Link\n        ( \"\" , [] , [] )\n        [ Str \"Pod\" ]\n        ( \"https://perldoc.pl/perlpod\" , \"\" )\n    , Space\n    , Str \"document\"\n    , Space\n    , Str \"for\"\n    , Space\n    , Str \"pandoc.\"\n    ]\n, Header 2 ( \"\" , [] , [] ) [ Str \"Head\" , Space , Str \"2\" ]\n, Header\n    3\n    ( \"\" , [] , [] )\n    [ Str \"Head\"\n    , Space\n    , Str \"3:\"\n    , Space\n    , Emph [ Str \"The>\" , Space , Str \"<Return\" ]\n    ]\n, Header\n    4\n    ( \"\" , [] , [] )\n    [ Str \"How\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"use\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Link\n        ( \"\" , [] , [ ( \"manual\" , \"ls(1)\" ) ] )\n        [ Str \"ls(1)\" ]\n        ( \"\" , \"\" )\n    , Space\n    , Str \"command,\"\n    , Space\n    , Str \"an\"\n    , Space\n    , Str \"introduction\"\n    ]\n, Header\n    5\n    ( \"\" , [] , [] )\n    [ Code ( \"\" , [] , [] ) \"Ricky Jay\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"his\"\n    , Space\n    , Str \"52\"\n    , Space\n    , Str \"assistants\"\n    ]\n, Header\n    6\n    ( \"\" , [] , [] )\n    [ Str \"The\"\n    , Space\n    , Str \"=head5\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"=head6\"\n    , Space\n    , Str \"commands\"\n    , Space\n    , Str \"are\"\n    , Space\n    , Str \"newer\"\n    , Space\n    , Str \"and\"\n    , Space\n    , Str \"my\"\n    , Space\n    , Str \"syntax\"\n    , Space\n    , Str \"highlighting\"\n    , Space\n    , Str \"doesn't\"\n    , Space\n    , Str \"recognize\"\n    , Space\n    , Str \"them.\"\n    , Space\n    , Str \"In\"\n    , Space\n    , Str \"any\"\n    , Space\n    , Str \"case,\"\n    , Space\n    , Str \"it\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"be\"\n    , Space\n    , Str \"possible\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"have\"\n    , Space\n    , Str \"a\"\n    , Space\n    , Str \"very\"\n    , Space\n    , Str \"long\"\n    , Space\n    , Str \"paragraph\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"heading.\"\n    ]\n, Header\n    6\n    ( \"\" , [] , [] )\n    [ Str \"It\"\n    , Space\n    , Str \"should\"\n    , Space\n    , Str \"also\"\n    , Space\n    , Str \"be\"\n    , Space\n    , Str \"possible\"\n    , Space\n    , Str \"to\"\n    , Space\n    , Str \"start\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"heading\"\n    , Space\n    , Str \"paragraph\"\n    , Space\n    , Str \"on\"\n    , Space\n    , Str \"the\"\n    , Space\n    , Str \"next\"\n    , Space\n    , Str \"line\"\n    ]\n, RawBlock\n    (Format \"html\")\n    \"<strong>This is a raw block destined for the HTML format</strong>\\n\\n\"\n, BulletList\n    [ [ Para [ Str \"Bulleted\" , Space , Str \"list\" ] ]\n    , [ Para [ Str \"Ordered\" , Space , Str \"list\" ]\n      , OrderedList\n          ( 1 , DefaultStyle , DefaultDelim )\n          [ [ Para\n                [ Str \"Here's\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"verbatim\"\n                , Space\n                , Str \"paragraph\"\n                , Space\n                , Str \"in\"\n                , Space\n                , Str \"this\"\n                , Space\n                , Str \"list\"\n                , Space\n                , Str \"item:\"\n                ]\n            , CodeBlock\n                ( \"\" , [] , [] )\n                \"    this is a code block\\nthis is still part of the code block\\n  so is this.\\nIt seems that the prefixed spaces in verbatim blocks in pod don't get stripped.\\n\\n This should continue the previous code block despite the intervening blank\\n line, because the first line starts with a space\\n\\n\\n\\n    the above blank lines with varying numbers of spaces should also be in\\n the code block\\n    pod formatters should (but not must) expand tabs by default\\nso we're not special casing pandoc's behavior there in any way\\n\"\n            , Para\n                [ Str \"Wow,\"\n                , Space\n                , Str \"that\"\n                , Space\n                , Str \"was\"\n                , Space\n                , Str \"fun.\"\n                ]\n            ]\n          , [ Para [ Str \"Definition\" , Space , Str \"list\" ]\n            , DefinitionList\n                [ ( [ Span\n                        ( \"\" , [] , [] )\n                        [ Str \"Marvin\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"Martian\"\n                        ]\n                    ]\n                  , [ [ Para\n                          [ Str \"A\"\n                          , Space\n                          , Str \"cartoon\"\n                          , Space\n                          , Str \"alien\"\n                          ]\n                      ]\n                    ]\n                  )\n                , ( [ Span\n                        ( \"\" , [] , [] )\n                        [ Emph\n                            [ Str \"The\"\n                            , Space\n                            , Str \"Sun\"\n                            , Space\n                            , Str \"Also\"\n                            , Space\n                            , Str \"Rises\"\n                            ]\n                        ]\n                    ]\n                  , [ [ Para\n                          [ Str \"A\"\n                          , Space\n                          , Str \"novel\"\n                          , Space\n                          , Str \"by\"\n                          , Space\n                          , Str \"Ernest\"\n                          , Space\n                          , Str \"Hemingway\"\n                          ]\n                      ]\n                    ]\n                  )\n                , ( [ Span\n                        ( \"\" , [] , [] )\n                        [ Code ( \"\" , [] , [] ) \"undefined\" ]\n                    ]\n                  , [ [] ]\n                  )\n                , ( [ Span\n                        ( \"\" , [] , [] )\n                        [ Str \"And\"\n                        , Space\n                        , Str \"now,\"\n                        , Space\n                        , Str \"a\"\n                        , Space\n                        , Str \"quotation\"\n                        ]\n                    ]\n                  , [ [ BlockQuote\n                          [ Para\n                              [ Str \"Where's\"\n                              , Space\n                              , Str \"my\"\n                              , Space\n                              , Str \"space\"\n                              , Space\n                              , Str \"modulator?\"\n                              ]\n                          ]\n                      ]\n                    ]\n                  )\n                ]\n            ]\n          , [ Para\n                [ Str \"And\"\n                , Space\n                , Str \"the\"\n                , Space\n                , Str \"list\"\n                , Space\n                , Str \"continues.\"\n                ]\n            ]\n          ]\n      ]\n    , [ Para\n          [ Str \"And\"\n          , Space\n          , Str \"so\"\n          , Space\n          , Str \"does\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"other\"\n          , Space\n          , Str \"one,\"\n          , Space\n          , Str \"even\"\n          , Space\n          , Str \"if\"\n          , Space\n          , Str \"I\"\n          , Space\n          , Str \"forget\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"asterisk.\"\n          ]\n      ]\n    ]\n, Div\n    ( \"\" , [ \"neat\" ] , [] )\n    [ Para\n        [ Str \"This\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"div\"\n        , Space\n        , Str \"for\"\n        , Space\n        , Str \"our\"\n        , Space\n        , Str \"purposes.\"\n        ]\n    , Para\n        [ Str \"It\"\n        , Space\n        , Str \"should\"\n        , Space\n        , Str \"parse\"\n        , Space\n        , Strong [ Str \"content\" ]\n        , Space\n        , Str \"inside\"\n        , Space\n        , Str \"of\"\n        , Space\n        , Str \"it.\"\n        ]\n    , BulletList\n        [ [ Para [ Str \"Like\" , Space , Str \"this\" ] ] ]\n    ]\n, Div\n    ( \"\" , [ \"excitement\" ] , [] )\n    [ Para\n        [ Str \"this\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"its\"\n        , Space\n        , Str \"own\"\n        , Space\n        , Str \"div\"\n        ]\n    ]\n, RawBlock\n    (Format \"html\") \" <p>and this is its own raw block</p>\\n\"\n, RawBlock (Format \"html\") \"\\n<p>so is this</p>\\n\"\n, Header\n    2\n    ( \"\" , [] , [] )\n    [ Code ( \"\" , [] , [] ) \"=cut\"\n    , Space\n    , Str \"before\"\n    , Space\n    , Str \"any\"\n    , Space\n    , Code ( \"\" , [] , [] ) \"=item\"\n    , Space\n    , Str \"in\"\n    , Space\n    , Code ( \"\" , [] , [] ) \"=over\"\n    ]\n, BulletList\n    [ [ Para [ Str \"a\" ] , Para [ Str \"b\" ] ]\n    , [ Para [ Str \"c\" ] ]\n    ]\n]\n"
  },
  {
    "path": "test/pod-reader.pod",
    "content": "text before any Pod commands is not parsed, which is unusual for formats\nsupported by pandoc, but \n\n=head1 POD TEST SUITE\n\nThis is a test L<Pod|https://perldoc.pl/perlpod> document for pandoc.\n\n=encoding utf8\n\n=head2 Head 2\n\n=head3 Head 3: I<< The> <Return >>\n\n=head4 How to use the L<ls(1)> command,\nan introduction\n\n=head5 C<Ricky Jay> and his 52 assistants\n\n=head6 The =head5 and =head6 commands are newer and my syntax highlighting\ndoesn't recognize them. In any case, it should be possible to have a very long\nparagraph in the heading.\n\n=head6\nIt should also be possible to start the heading paragraph on the next line\n\n=cut\n\nThis doesn't get parsed at all.\n\n=begin html\n\n<strong>This is a raw block destined for the HTML format</strong>\n\n=end html\n\n=over\n\n=item *\n\nBulleted list\n\n=item *\n\nOrdered list\n\n=over\n\n=item 1.\n\nHere's a verbatim paragraph in this list item:\n\n    this is a code block\nthis is still part of the code block\n  so is this.\nIt seems that the prefixed spaces in verbatim blocks in pod don't get stripped.\n\n This should continue the previous code block despite the intervening blank\n line, because the first line starts with a space\n    \n\n \n    the above blank lines with varying numbers of spaces should also be in\n the code block\n\tpod formatters should (but not must) expand tabs by default\nso we're not special casing pandoc's behavior there in any way\n\nWow, that was fun.\n\n=item 2.\n\nDefinition list\n\n=over\n\n=item Marvin the MZ<>artian\n\nA cartoon alien\n\n=item I<The Sun\nAlso Rises>\n\nA novel by Ernest Hemingway\n\n=item C<undefined>\n\n=item And now, a quotation\n\n=over\n\nWhere's my space modulator?\n\n=back\n\n=back\n\n=item 3.\n\nAnd the list continues.\n\n=back\n\n=item\n\nAnd so does the other one, even if I forget the asterisk.\n\n=back\n\n=begin :neat\n\nThis is a div for our purposes.\n\nIt should parse B<< content >> inside of it.\n\n=over\n\n=item\n\nLike this\n\n=back\n\n=end :neat\n\n=for :excitement this is its own div\n\n=for html <p>and this is its own raw block</p>\n\n=for html\n<p>so is this</p>\n\n=head2 C<=cut> before any C<=item> in C<=over>\n\n=over\n\n=cut\n\nblah\n\n=item *\n\na\n\n=cut\n\nblah blah\n\n=pod\n\nb\n\n=item *\n\nc\n\n=back\n"
  },
  {
    "path": "test/pptx/background-image/input.native",
    "content": "[Header 1 (\"section-header-with-background-image\",[],[(\"background-image\",\"movie.jpg\")]) [Str \"Section\",Space,Str \"Header\",Space,Str \"(with\",Space,Str \"background\",Space,Str \"image)\"]\n,Header 2 (\"slide-1\",[],[(\"background-image\",\"lalune.jpg\")]) [Str \"Slide\",Space,Str \"1\"]\n,Para [Str \"This\",Space,Str \"slide\",Space,Str \"has\",Space,Str \"a\",Space,Str \"moon\",Space,Str \"background.\"]\n,Header 2 (\"slide-2\",[],[(\"background-image\",\"movie.jpg\")]) [Str \"Slide\",Space,Str \"2\"]\n,Para [Str \"This\",Space,Str \"slide\",Space,Str \"has\",Space,Str \"a\",Space,Str \"movie\",Space,Str \"background.\"]\n,Header 2 (\"slide-3\",[],[(\"background-image\",\"movie.jpg\")]) [Str \"Slide\",Space,Str \"3\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"Background\",Space,Str \"images\",Space,Str \"work\",Space,Str \"in\",Space,Str \"two-column\",Space,Str \"layout.\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"hello\"]]]\n,Header 2 (\"slide-4\",[],[(\"background-image\",\"movie.jpg\")]) [Str \"Slide\",Space,Str \"4\"]\n,Para [Str \"You\",Space,Str \"can\",Space,Str \"have\",Space,Str \"images\",Space,Str \"on\",Space,Str \"slides\",Space,Str \"that\",Space,Str \"have\",Space,Str \"background\",Space,Str \"images:\"]\n,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]\n,Header 2 (\"section\",[],[(\"background-image\",\"lalune.jpg\")]) []\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"Blank\",Space,Str \"slides\",Space,Str \"can\",Space,Str \"have\",Space,Str \"background\",Space,Str \"images.\"]]]\n"
  },
  {
    "path": "test/pptx/blanks/just-speaker-notes/input.native",
    "content": "[Header 1 (\"first-slide\",[],[]) [Str \"First\",Space,Str \"slide\"]\n,Para [Str \"Nothing\",Space,Str \"to\",Space,Str \"see\",Space,Str \"here\"]\n,Header 1 (\"section\",[],[]) []\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"Some\",Space,Str \"notes\",Space,Str \"here:\",Space,Str \"this\",Space,Str \"first\",Space,Str \"slide\",Space,Str \"should\",Space,Str \"use\",Space,Str \"the\",Space,Str \"Blank\",Space,Str \"template\"]]\n,Header 1 (\"third-slide\",[],[]) [Str \"Third\",Space,Str \"slide\"]\n,Para [Str \"The\",Space,Str \"second\",Space,Str \"slide\",Space,Str \"should\",Space,Str \"be\",Space,Str \"blank\"]]\n"
  },
  {
    "path": "test/pptx/blanks/nbsp-in-body/input.native",
    "content": "[Header 1 (\"first-slide\",[],[]) [Str \"First\",Space,Str \"slide\"]\n,Para [Str \"Uninteresting,\",Space,Str \"normal\"]\n,Header 1 (\"section\",[],[]) []\n,Para [Str \"\\160\"]\n,Header 1 (\"third-slide\",[],[]) [Str \"Third\",Space,Str \"slide\"]\n,Para [Str \"Was\",Space,Str \"the\",Space,Str \"previous\",Space,Str \"one\",Space,Str \"blank?\"]]\n"
  },
  {
    "path": "test/pptx/blanks/nbsp-in-heading/input.native",
    "content": "[Header 1 (\"first-slide\",[],[]) [Str \"First\",Space,Str \"slide\"]\n,Para [Str \"Uninteresting,\",Space,Str \"normal\"]\n,Header 1 (\"section\",[],[]) [Str \"\\160\"]\n,Header 1 (\"third-slide\",[],[]) [Str \"Third\",Space,Str \"slide\"]\n,Para [Str \"Was\",Space,Str \"the\",Space,Str \"previous\",Space,Str \"one\",Space,Str \"blank?\"]]\n"
  },
  {
    "path": "test/pptx/code/input.native",
    "content": "[Header 1 (\"header-with-inline-code\",[],[]) [Str \"Header\",Space,Str \"with\",Space,Code (\"\",[],[]) \"inline code\"]\n,CodeBlock (\"\",[],[]) \"Code at level 0\"\n,BulletList\n [[Para [Str \"Bullet\",Space,Str \"item\",Space,Str \"with\",Space,Code (\"\",[],[]) \"inline code\"]\n  ,CodeBlock (\"\",[],[]) \"Code block at level 1\"\n  ,BulletList\n   [[Para [Str \"with\",Space,Code (\"\",[],[]) \"nested\"]\n    ,CodeBlock (\"\",[],[]) \"lvl2\\nlvl2\\nlvl2\"\n    ,Header 2 (\"second-heading-level-with-code\",[],[]) [Str \"Second\",Space,Str \"heading\",Space,Str \"level\",Space,Str \"with\",Space,Code (\"\",[],[]) \"code\"]]]]]\n,Header 1 (\"syntax-highlighting\",[],[]) [Str \"Syntax\",Space,Str \"highlighting\"]\n,CodeBlock (\"\",[\"haskell\"],[]) \"id :: a -> a\\nid x = x\"\n,BulletList\n [[Para [Str \"Nested\"]\n  ,CodeBlock (\"\",[\"haskell\"],[]) \"g :: Int -> Int\\ng x = x * 3\"]]\n,Header 1 (\"two-column-slide\",[],[]) [Str \"Two\",Space,Str \"column\",Space,Str \"slide\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[(\"width\",\"50%\")])\n  [BulletList\n   [[Plain [Str \"A\",Space,Str \"total\",Space,Str \"alternative\",Space,Str \"for\",Space,Code (\"\",[],[]) \"head\"]]]]\n ,Div (\"\",[\"column\"],[(\"width\",\"50%\")])\n  [CodeBlock (\"\",[],[]) \"safeHead :: [a] -> Maybe a\\nsafeHead [] = Nothing\\nsafeHead (x:_) = Just x\"]]]\n"
  },
  {
    "path": "test/pptx/comparison/both-columns/input.native",
    "content": "[Header 1 (\"a-slide\",[],[]) [Str \"A\",Space,Str \"slide\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 0.125)\n   ,(AlignDefault,ColWidth 0.125)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"plus\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"a\",Space,Str \"table\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])\n  ,Para [Str \"Then\",Space,Str \"some\",Space,Str \"more\",Space,Str \"text\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Para [Image (\"\",[],[]) [Str \"Plus\",Space,Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]]]\n"
  },
  {
    "path": "test/pptx/comparison/extra-image/input.native",
    "content": "[Header 1 (\"a-slide\",[],[]) [Str \"A\",Space,Str \"slide\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 0.125)\n   ,(AlignDefault,ColWidth 0.125)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"plus\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"a\",Space,Str \"table\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])\n  ,Para [Str \"Then\",Space,Str \"some\",Space,Str \"more\",Space,Str \"text\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Para [Image (\"\",[],[]) [Str \"Plus\",Space,Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]\n  ,Para [Image (\"\",[],[]) [Str \"And\",Space,Str \"another\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]]]\n"
  },
  {
    "path": "test/pptx/comparison/extra-text/input.native",
    "content": "[Header 1 (\"a-slide\",[],[]) [Str \"A\",Space,Str \"slide\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 0.125)\n   ,(AlignDefault,ColWidth 0.125)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"plus\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"a\",Space,Str \"table\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])\n  ,Para [Str \"Then\",Space,Str \"some\",Space,Str \"more\",Space,Str \"text\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Para [Image (\"\",[],[]) [Str \"Plus\",Space,Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]]]\n"
  },
  {
    "path": "test/pptx/comparison/non-text-first/input.native",
    "content": "[Header 1 (\"a-slide\",[],[]) [Str \"A\",Space,Str \"slide\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 0.125)\n   ,(AlignDefault,ColWidth 0.125)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"a\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"table\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])\n  ,Para [Str \"Plus\",Space,Str \"a\",Space,Str \"paragraph\",Space,Str \"here\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Image (\"\",[],[]) [Str \"Just\",Space,Str \"an\",Space,Str \"image\",Space,Str \"on\",Space,Str \"this\",Space,Str \"side\"] (\"lalune.jpg\",\"fig:\")]]]]\n"
  },
  {
    "path": "test/pptx/comparison/one-column/input.native",
    "content": "[Header 1 (\"a-slide\",[],[]) [Str \"A\",Space,Str \"slide\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"A\",Space,Str \"paragraph\",Space,Str \"here\"]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 0.125)\n   ,(AlignDefault,ColWidth 0.125)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"plus\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"a\",Space,Str \"table\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"Only\",Space,Str \"a\",Space,Str \"paragraph\",Space,Str \"here\"]]]]\n"
  },
  {
    "path": "test/pptx/content-with-caption/heading-text-image/input.native",
    "content": "[Header 1 (\"a-slide\",[],[]) [Str \"A\",Space,Str \"slide\"]\n,Para [Str \"Some\",Space,Str \"text\",Space,Str \"here\"]\n,Para [Image (\"\",[],[]) [Str \"Followed\",Space,Str \"by\",Space,Str \"a\",Space,Str \"picture\"] (\"lalune.jpg\",\"fig:\")]]\n"
  },
  {
    "path": "test/pptx/content-with-caption/image-text/input.native",
    "content": "[Para [Image (\"\",[],[]) [Str \"The\",Space,Str \"picture\",Space,Str \"first\"] (\"lalune.jpg\",\"fig:\")]\n,Para [Str \"Then\",Space,Str \"some\",Space,Str \"text\",Space,Str \"here\"]]\n"
  },
  {
    "path": "test/pptx/content-with-caption/text-image/input.native",
    "content": "[Para [Str \"Some\",Space,Str \"text\",Space,Str \"here\"]\n,Para [Image (\"\",[],[]) [Str \"Followed\",Space,Str \"by\",Space,Str \"a\",Space,Str \"picture\"] (\"lalune.jpg\",\"fig:\")]]\n"
  },
  {
    "path": "test/pptx/document-properties/input.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"Company\",MetaInlines [Str \"My\",Space,Str \"Company\"]),(\"Second Custom Property\",MetaInlines [Str \"Second\",Space,Str \"custom\",Space,Str \"property\",Space,Str \"value\"]),(\"abstract\",MetaBlocks [Plain [Str \"Quite\",Space,Str \"a\",Space,Str \"long\",Space,Str \"description\",SoftBreak,Str \"spanning\",Space,Str \"several\",Space,Str \"lines\"]]),(\"author\",MetaList [MetaInlines [Str \"A.\",Space,Str \"M.\"]]),(\"category\",MetaInlines [Str \"My\",Space,Str \"Category\"]),(\"custom1\",MetaInlines [Str \"First\",Space,Str \"custom\",Space,Str \"property\",Space,Str \"value\"]),(\"custom3\",MetaInlines [Str \"Escaping\",Space,Str \"amp\",Space,Str \"&\",Space,Str \".\"]),(\"custom4\",MetaInlines [Str \"Escaping\",Space,Str \"LT,GT\",Space,Str \"<\",Space,Str \"asdf\",Space,Str \">\",Space,Str \"<\"]),(\"custom5\",MetaInlines [Str \"Escaping\",Space,Str \"html\",Space,RawInline (Format \"html\") \"<i>\",Str \"asdf\",RawInline (Format \"html\") \"</i>\"]),(\"custom6\",MetaInlines [Str \"Escaping\",Space,Emph [Str \"MD\"],Space,Str \"\\225\",Space,Str \"a\"]),(\"custom9\",MetaInlines [Str \"Extended\",Space,Str \"chars:\",Space,Str \"\\8364\",Space,Str \"\\225\",Space,Str \"\\233\",Space,Str \"\\237\",Space,Str \"\\243\",Space,Str \"\\250\",Space,Str \"$\"]),(\"description\",MetaBlocks [Para [Str \"Long\",Space,Str \"description\",Space,Str \"spanning\",SoftBreak,Str \"several\",Space,Str \"lines.\"],Plain [Str \"This\",Space,Str \"is\",Space,Str \"\\225\",Space,Str \"second\",Space,RawInline (Format \"html\") \"<i>\",Str \"line\",RawInline (Format \"html\") \"</i>\",Str \".\"]]),(\"keywords\",MetaList [MetaInlines [Str \"keyword\",Space,Str \"1\"],MetaInlines [Str \"keyword\",Space,Str \"2\"]]),(\"lang\",MetaInlines [Str \"en-US\"]),(\"nested-custom\",MetaList [MetaMap (fromList [(\"custom 7\",MetaInlines [Str \"Nested\",Space,Str \"Custom\",Space,Str \"value\",Space,Str \"7\"])]),MetaMap (fromList [(\"custom 8\",MetaInlines [Str \"Nested\",Space,Str \"Custom\",Space,Str \"value\",Space,Str \"8\"])])]),(\"subject\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"subject\"]),(\"subtitle\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"subtitle\"]),(\"title\",MetaInlines [Str \"Testing\",Space,Str \"custom\",Space,Str \"properties\"])]})\r\n[Para [Str \"Testing\",Space,Str \"document\",Space,Str \"properties\"]]\r\n"
  },
  {
    "path": "test/pptx/document-properties-short-desc/input.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"author\",MetaList [MetaInlines [Str \"A.\",Space,Str \"M.\"]]),(\"description\",MetaInlines [Str \"Short\",Space,RawInline (Format \"html\") \"<i>\",Str \"description\",RawInline (Format \"html\") \"</i>\",Space,Str \"&.\"]),(\"keywords\",MetaList [MetaInlines [Str \"keyword\",Space,Str \"1\"],MetaInlines [Str \"keyword\",Space,Str \"2\"]]),(\"subject\",MetaInlines [Str \"This\",Space,Str \"is\",Space,Str \"the\",Space,Str \"subject\"]),(\"title\",MetaInlines [Str \"Testing\",Space,Str \"custom\",Space,Str \"properties\"])]})\r\n[Para [Str \"Testing\",Space,Str \"document\",Space,Str \"properties\"]]\r\n"
  },
  {
    "path": "test/pptx/endnotes/input.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Para [Str \"Here\",Space,Str \"is\",Space,Str \"one\",Space,Str \"note.\",Note [Para [Str \"Here\",Space,Str \"is\",Space,Str \"the\",Space,Str \"note.\"]],Space,Str \"And\",Space,Str \"one\",Space,Str \"more\",Space,Str \"note.\",Note [Para [Str \"And\",Space,Str \"another\",Space,Str \"note.\"]]]]\n"
  },
  {
    "path": "test/pptx/footer/input.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"author\",MetaInlines [Str \"Me\"]),(\"date\",MetaInlines [Str \"14/09/1995\"]),(\"title\",MetaInlines [Str \"Slides\"])]})\n[Header 2 (\"slide-1\",[],[]) [Str \"Slide\",Space,Str \"1\"]\n,Para [Str \"Hello\",Space,Str \"there\"]\n,Header 1 (\"layouts\",[],[]) [Str \"Layouts\"]\n,Header 2 (\"slide-3\",[],[]) [Str \"Slide\",Space,Str \"3\"]\n,Para [Str \"Does\",Space,Str \"it\",Space,Str \"work\",Space,Str \"on\",Space,Str \"other\",Space,Str \"layouts?\"]\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 5.555555555555555e-2)\n ,(AlignDefault,ColWidth 5.555555555555555e-2)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"2\"]]]])]\n (TableFoot (\"\",[],[])\n [])\n,Header 2 (\"slide-4\",[],[]) [Str \"Slide\",Space,Str \"4\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"hello\",Space,Str \"hello\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"goood\",Space,Str \"bye\"]]]\n,Header 2 (\"slide-5\",[],[]) [Str \"Slide\",Space,Str \"5\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"Hello\",Space,Str \"there\"]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 5.555555555555555e-2)\n   ,(AlignDefault,ColWidth 5.555555555555555e-2)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"1\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"2\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"oh\",Space,Str \"wait\"]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 5.555555555555555e-2)\n   ,(AlignDefault,ColWidth 5.555555555555555e-2)]\n   (TableHead (\"\",[],[])\n   [])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"1\"]]\n     ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"2\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])]]\n,Header 2 (\"section\",[],[]) []\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"blank\",Space,Str \"slide:\",Space,Str \"does\",Space,Str \"it\",Space,Str \"have\",Space,Str \"a\",Space,Str \"footer?\"]]]\n"
  },
  {
    "path": "test/pptx/images/input.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Para [Image (\"\",[],[]) [] (\"lalune.jpg\",\"\")]\n,Para [Image (\"\",[],[]) [Str \"The\",Space,Str \"Moon\"] (\"lalune.jpg\",\"fig:\")]\n,Header 1 (\"one-more\",[],[]) [Str \"One\",Space,Str \"More\"]\n,Para [Image (\"\",[],[]) [Str \"The\",Space,Str \"Moon\"] (\"lalune.jpg\",\"fig:\")]]\n"
  },
  {
    "path": "test/pptx/incremental-lists/with-flag/input.native",
    "content": "[Header 1 (\"slide-1-content\",[],[]) [Str \"Slide\",Space,Str \"1\",Space,Str \"(Content)\"]\n,BulletList\n [[Plain [Str \"These\"]]\n ,[Plain [Str \"bullets\"]]\n ,[Plain [Str \"should\"]]\n ,[Plain [Str \"be\"]]\n ,[Plain [Str \"incremental\"]]]\n,Header 1 (\"slide-2-content\",[],[]) [Str \"Slide\",Space,Str \"2\",Space,Str \"(Content)\"]\n,BulletList\n [[Para [Str \"as\"]]\n ,[Para [Str \"should\"]]\n ,[Para [Str \"these\"]]]\n,Header 1 (\"slide-3-content\",[],[]) [Str \"Slide\",Space,Str \"3\",Space,Str \"(Content)\"]\n,Para [Str \"Even\",Space,Str \"with\",Space,Str \"some\",Space,Str \"text\",Space,Str \"first,\",Space,Str \"these\",Space,Str \"should:\"]\n,BulletList\n [[Plain [Str \"also\"]]\n ,[Plain [Str \"be\"]]\n ,[Plain [Str \"incremental\"]]]\n,Header 1 (\"slide-4-content\",[],[]) [Str \"Slide\",Space,Str \"4\",Space,Str \"(Content)\"]\n,OrderedList (1,Decimal,Period)\n [[Plain [Str \"These\"]]\n ,[Plain [Str \"are\"]]\n ,[Plain [Str \"incremental\"]]]\n,Para [Str \"But\",Space,Str \"this\",Space,Str \"text\",Space,Str \"isn\\8217t\"]\n,BulletList\n [[Plain [Str \"But\"]]\n ,[Plain [Str \"these\"]]\n ,[Plain [Str \"are\"]]]\n,Header 1 (\"slide-5-two-content\",[],[]) [Str \"Slide\",Space,Str \"5\",Space,Str \"(Two\",Space,Str \"Content)\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"Incremental\",Space,Str \"on\",Space,Str \"the\",Space,Str \"left:\"]\n  ,BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"by\"]]\n   ,[Plain [Str \"one\"]]]\n  ,Para [Str \"With\",Space,Str \"something\",Space,Str \"below\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"Incremental\",Space,Str \"on\",Space,Str \"the\",Space,Str \"right:\"]\n  ,BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"by\"]]\n   ,[Plain [Str \"one\"]]]\n  ,Para [Str \"With\",Space,Str \"something\",Space,Str \"else\",Space,Str \"below\"]]]\n,Header 1 (\"slide-6-two-content-right\",[],[]) [Str \"Slide\",Space,Str \"6\",Space,Str \"(Two\",Space,Str \"Content\",Space,Str \"Right)\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Image (\"\",[],[]) [Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]\n ,Div (\"\",[\"column\"],[])\n  [BulletList\n   [[Plain [Str \"An\"]]\n   ,[Plain [Str \"Incremental\"]]\n   ,[Plain [Str \"List\"]]]]]\n,Header 1 (\"slide-7-content-with-caption\",[],[]) [Str \"Slide\",Space,Str \"7\",Space,Str \"(Content\",Space,Str \"with\",Space,Str \"Caption)\"]\n,Para [Str \"First,\",Space,Str \"we\",Space,Str \"have\",Space,Str \"some\",Space,Str \"incremental\",Space,Str \"bullets:\"]\n,BulletList\n [[Plain [Str \"one\"]]\n ,[Plain [Str \"two\"]]\n ,[Plain [Str \"three\"]]]\n,Para [Str \"Then,\",Space,Str \"a\",Space,Str \"picture:\"]\n,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"./lalune.jpg\",\"fig:\")]\n,Header 1 (\"slide-8-comparison\",[],[]) [Str \"Slide\",Space,Str \"8\",Space,Str \"(Comparison)\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"two\"]]\n   ,[Plain [Str \"three\"]]]\n  ,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"./lalune.jpg\",\"fig:\")]]\n ,Div (\"\",[\"column\"],[])\n  [OrderedList (1,Decimal,Period)\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"two\"]]\n   ,[Plain [Str \"three\"]]]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 5.555555555555555e-2)]\n   (TableHead (\"\",[],[])\n   [Row (\"\",[],[])\n    [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n     [Plain [Str \"1\"]]]])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"2\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])]]\n,Header 1 (\"slide-9-content\",[],[]) [Str \"Slide\",Space,Str \"9\",Space,Str \"(Content)\"]\n,Div (\"\",[\"nonincremental\"],[])\n [BulletList\n  [[Plain [Str \"these\"]]\n  ,[Plain [Str \"are\"]]\n  ,[Plain [Str \"not\"]]\n  ,[Plain [Str \"incremental\"]]]]\n,BulletList\n [[Plain [Str \"these\"]]\n ,[Plain [Str \"are\"]]]\n,Header 1 (\"slide-10-content\",[],[]) [Str \"Slide\",Space,Str \"10\",Space,Str \"(Content)\"]\n,Div (\"\",[\"incremental\",\"nonincremental\"],[])\n [BulletList\n  [[Plain [Str \"these\"]]\n  ,[Plain [Str \"are\"]]\n  ,[Plain [Str \"incremental\"]]\n  ,[Plain [Str \"(the\",Space,Str \"incremental\",Space,Str \"class\",Space,Str \"wins)\"]]]]\n,Header 1 (\"slide-11-content\",[],[]) [Str \"Slide\",Space,Str \"11\",Space,Str \"(Content)\"]\n,Para [Str \"These\",Space,Str \"bullets\",Space,Str \"are\",Space,Str \"not\",Space,Str \"incremental:\"]\n,BlockQuote\n [BulletList\n  [[Plain [Str \"one\"]]\n  ,[Plain [Str \"two\"]]\n  ,[Plain [Str \"three\"]]]]\n,Para [Str \"These\",Space,Str \"are:\"]\n,Div (\"\",[\"nonincremental\"],[])\n [BlockQuote\n  [BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"two\"]]\n   ,[Plain [Str \"three\"]]]]]\n,Para [Str \"These\",Space,Str \"are\",Space,Str \"not:\"]\n,BlockQuote\n [Div (\"\",[\"nonincremental\"],[])\n  [BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"two\"]]\n   ,[Plain [Str \"three\"]]]]]\n,Header 1 (\"slide-12-content\",[],[]) [Str \"Slide\",Space,Str \"12\",Space,Str \"(Content)\"]\n,Div (\"\",[\"nonincremental\"],[])\n [Div (\"\",[\"incremental\"],[])\n  [BulletList\n   [[Plain [Str \"these\"]]\n   ,[Plain [Str \"are\"]]\n   ,[Plain [Str \"incremental\"]]]]]\n,Div (\"\",[\"incremental\"],[])\n [Div (\"\",[\"nonincremental\"],[])\n  [BulletList\n   [[Plain [Str \"these\"]]\n   ,[Plain [Str \"are\"]]\n   ,[Plain [Str \"not\"]]]]]]\n"
  },
  {
    "path": "test/pptx/incremental-lists/without-flag/input.native",
    "content": "[Header 1 (\"slide-1-content\",[],[]) [Str \"Slide\",Space,Str \"1\",Space,Str \"(Content)\"]\n,Div (\"\",[\"incremental\"],[])\n [BulletList\n  [[Plain [Str \"These\"]]\n  ,[Plain [Str \"bullets\"]]\n  ,[Plain [Str \"should\"]]\n  ,[Plain [Str \"be\"]]\n  ,[Plain [Str \"incremental\"]]]]\n,Header 1 (\"slide-2-content\",[],[]) [Str \"Slide\",Space,Str \"2\",Space,Str \"(Content)\"]\n,BulletList\n [[Plain [Str \"These\"]]\n ,[Plain [Str \"are\"]]\n ,[Plain [Str \"not\"]]]\n,Header 1 (\"slide-3-content\",[],[]) [Str \"Slide\",Space,Str \"3\",Space,Str \"(Content)\"]\n,Para [Str \"Even\",Space,Str \"with\",Space,Str \"some\",Space,Str \"text\",Space,Str \"first,\",Space,Str \"these\",Space,Str \"should:\"]\n,Div (\"\",[\"incremental\"],[])\n [BulletList\n  [[Plain [Str \"also\"]]\n  ,[Plain [Str \"be\"]]\n  ,[Plain [Str \"incremental\"]]]]\n,Header 1 (\"slide-4-content\",[],[]) [Str \"Slide\",Space,Str \"4\",Space,Str \"(Content)\"]\n,Div (\"\",[\"incremental\"],[])\n [OrderedList (1,Decimal,Period)\n  [[Plain [Str \"These\"]]\n  ,[Plain [Str \"are\"]]\n  ,[Plain [Str \"incremental\"]]]]\n,Para [Str \"But\",Space,Str \"this\",Space,Str \"text\",Space,Str \"isn\\8217t\"]\n,Header 1 (\"slide-5-two-content\",[],[]) [Str \"Slide\",Space,Str \"5\",Space,Str \"(Two\",Space,Str \"Content)\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"Incremental\",Space,Str \"on\",Space,Str \"the\",Space,Str \"left:\"]\n  ,Div (\"\",[\"incremental\"],[])\n   [BulletList\n    [[Plain [Str \"one\"]]\n    ,[Plain [Str \"by\"]]\n    ,[Plain [Str \"one\"]]]]\n  ,Para [Str \"With\",Space,Str \"something\",Space,Str \"below\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"Incremental\",Space,Str \"on\",Space,Str \"the\",Space,Str \"right:\"]\n  ,Div (\"\",[\"incremental\"],[])\n   [BulletList\n    [[Plain [Str \"one\"]]\n    ,[Plain [Str \"by\"]]\n    ,[Plain [Str \"one\"]]]]\n  ,BulletList\n   [[Plain [Str \"already\"]]\n   ,[Plain [Str \"here\"]]\n   ,[Plain [Str \"though\"]]]]]\n,Header 1 (\"slide-6-two-content-right\",[],[]) [Str \"Slide\",Space,Str \"6\",Space,Str \"(Two\",Space,Str \"Content\",Space,Str \"Right)\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Image (\"\",[],[]) [Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]\n ,Div (\"\",[\"column\"],[])\n  [Div (\"\",[\"incremental\"],[])\n   [BulletList\n    [[Plain [Str \"An\"]]\n    ,[Plain [Str \"Incremental\"]]\n    ,[Plain [Str \"List\"]]]]]]\n,Header 1 (\"slide-7-content-with-caption\",[],[]) [Str \"Slide\",Space,Str \"7\",Space,Str \"(Content\",Space,Str \"with\",Space,Str \"Caption)\"]\n,Para [Str \"First,\",Space,Str \"we\",Space,Str \"have\",Space,Str \"some\",Space,Str \"incremental\",Space,Str \"bullets:\"]\n,Div (\"\",[\"incremental\"],[])\n [BulletList\n  [[Plain [Str \"one\"]]\n  ,[Plain [Str \"two\"]]\n  ,[Plain [Str \"three\"]]]]\n,Para [Str \"Then,\",Space,Str \"a\",Space,Str \"picture:\"]\n,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"./lalune.jpg\",\"fig:\")]\n,Header 1 (\"slide-8-comparison\",[],[]) [Str \"Slide\",Space,Str \"8\",Space,Str \"(Comparison)\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Div (\"\",[\"incremental\"],[])\n   [BulletList\n    [[Plain [Str \"one\"]]\n    ,[Plain [Str \"two\"]]\n    ,[Plain [Str \"three\"]]]]\n  ,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"./lalune.jpg\",\"fig:\")]]\n ,Div (\"\",[\"column\"],[])\n  [Div (\"\",[\"incremental\"],[])\n   [OrderedList (1,Decimal,Period)\n    [[Plain [Str \"one\"]]\n    ,[Plain [Str \"two\"]]\n    ,[Plain [Str \"three\"]]]]\n  ,Table (\"\",[],[]) (Caption Nothing\n   [])\n   [(AlignDefault,ColWidth 5.555555555555555e-2)]\n   (TableHead (\"\",[],[])\n   [Row (\"\",[],[])\n    [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n     [Plain [Str \"1\"]]]])\n   [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n    []\n    [Row (\"\",[],[])\n     [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n      [Plain [Str \"2\"]]]])]\n   (TableFoot (\"\",[],[])\n   [])]]\n,Header 1 (\"slide-10-content\",[],[]) [Str \"Slide\",Space,Str \"10\",Space,Str \"(Content)\"]\n,Div (\"\",[\"incremental\",\"nonincremental\"],[])\n [BulletList\n  [[Plain [Str \"these\"]]\n  ,[Plain [Str \"are\"]]\n  ,[Plain [Str \"incremental\"]]\n  ,[Plain [Str \"(the\",Space,Str \"incremental\",Space,Str \"class\",Space,Str \"wins)\"]]]]\n,Header 1 (\"slide-11-content\",[],[]) [Str \"Slide\",Space,Str \"11\",Space,Str \"(Content)\"]\n,Para [Str \"These\",Space,Str \"bullets\",Space,Str \"are\",Space,Str \"incremental:\"]\n,BlockQuote\n [BulletList\n  [[Plain [Str \"one\"]]\n  ,[Plain [Str \"two\"]]\n  ,[Plain [Str \"three\"]]]]\n,Para [Str \"These\",Space,Str \"are\",Space,Str \"not:\"]\n,Div (\"\",[\"incremental\"],[])\n [BlockQuote\n  [BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"two\"]]\n   ,[Plain [Str \"three\"]]]]]\n,Para [Str \"These\",Space,Str \"are:\"]\n,BlockQuote\n [Div (\"\",[\"incremental\"],[])\n  [BulletList\n   [[Plain [Str \"one\"]]\n   ,[Plain [Str \"two\"]]\n   ,[Plain [Str \"three\"]]]]]\n,Header 1 (\"slide-12-content\",[],[]) [Str \"Slide\",Space,Str \"12\",Space,Str \"(Content)\"]\n,Div (\"\",[\"nonincremental\"],[])\n [Div (\"\",[\"incremental\"],[])\n  [BulletList\n   [[Plain [Str \"these\"]]\n   ,[Plain [Str \"are\"]]\n   ,[Plain [Str \"incremental\"]]]]]\n,Div (\"\",[\"incremental\"],[])\n [Div (\"\",[\"nonincremental\"],[])\n  [BulletList\n   [[Plain [Str \"these\"]]\n   ,[Plain [Str \"are\"]]\n   ,[Plain [Str \"not\"]]]]]]\n"
  },
  {
    "path": "test/pptx/inline-formatting/input.native",
    "content": "[Para [Str \"Here\",Space,Str \"are\",Space,Str \"examples\",Space,Str \"of\",Space,Emph [Str \"italics\"],Str \",\",Space,Strong [Str \"bold\"],Str \",\",Space,Str \"and\",Space,Strong [Emph [Str \"bold\",Space,Str \"italics\"]],Str \".\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Strikeout [Str \"strook-three\"],Space,Str \"strike-through\",Space,Str \"and\",Space,SmallCaps [Str \"small\",Space,Str \"caps\"],Str \".\"]\n,Para [Str \"Here\",Space,Str \"is\",Space,Span (\"\",[\"underline\"],[]) [Str \"some\",Space,Emph [Str \"underlined\"],Space,Strong [Str \"text\"]],Str \".\"]\n,Para [Str \"We\",Space,Str \"can\",Space,Str \"also\",Space,Str \"do\",Space,Str \"subscripts\",Space,Str \"(H\",Subscript [Str \"2\"],Str \"0)\",Space,Str \"and\",Space,Str \"super\",Superscript [Str \"script\"],Str \".\"]\n,RawBlock (Format \"html\") \"<!-- Comments don't show up. -->\"]\n"
  },
  {
    "path": "test/pptx/layouts/input.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"title\",MetaInlines [Str \"Testing\",Space,Str \"Layouts\"])]})\n[Header 2 (\"slide-1\",[],[]) [Str \"Slide\",Space,Str \"1\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"title\",Space,Str \"and\",Space,Str \"content\",Space,Str \"slide\"]\n,Header 2 (\"slide-2\",[],[]) [Str \"Slide\",Space,Str \"2\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"This\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"\\8230is\",Space,Str \"a\",Space,Str \"two-column\",Space,Str \"slide\"]]]\n,Header 2 (\"slide-3\",[],[]) [Str \"Slide\",Space,Str \"3\"]\n,Para [Str \"This\",Space,Str \"slide\",Space,Str \"is\",Space,Str \"a\",Space,Str \"Content\",Space,Str \"with\",Space,Str \"Caption\",Space,Str \"slide\"]\n,Para [Image (\"\",[],[]) [Str \"Content\"] (\"lalune.jpg\",\"fig:\")]\n,Header 2 (\"slide-4\",[],[]) [Str \"Slide\",Space,Str \"4\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"This\",Space,Str \"slide\",Space,Str \"is\",Space,Str \"a\",Space,Str \"Comparison\",Space,Str \"slide:\"]\n  ,Para [Image (\"\",[],[]) [Str \"Content\"] (\"lalune.jpg\",\"fig:\")]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"other\",Space,Str \"text\"]]]\n,Header 1 (\"section-header\",[],[]) [Str \"Section\",Space,Str \"header\"]\n,Header 2 (\"section\",[],[]) []\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"blank\",Space,Str \"slide\"]]]\n"
  },
  {
    "path": "test/pptx/list-level/input.native",
    "content": "[Header 1 (\"slide\",[],[]) [Str \"Slide\"]\n,BulletList\n [[Para [Str \"Top-level\"]\n  ,Para [Str \"With\",Space,Str \"continuation\",Space,Str \"paragraph\"]]\n ,[Para [Str \"Then:\"]\n  ,BulletList\n   [[Plain [Str \"nested\"]]\n   ,[Plain [Str \"list\"]]\n   ,[Plain [Str \"items\"]]]]]\n,Header 1 (\"slide-1\",[],[]) [Str \"Slide\"]\n,Para [Str \"Paragraph.\"]\n,OrderedList (1,Decimal,Period)\n [[Para [Str \"Top-level\"]\n  ,Para [Str \"Continuation\"]\n  ,OrderedList (1,Decimal,Period)\n   [[Para [Str \"Sub-list\"]\n    ,Para [Str \"With\",Space,Str \"Continuation\"]]\n   ,[Para [Str \"(still\",Space,Str \"sub-list)\"]]]]\n ,[Para [Str \"(back\",Space,Str \"to\",Space,Str \"top-level)\"]]]\n,Para [Str \"Paragraph.\"]]\n"
  },
  {
    "path": "test/pptx/lists/input.native",
    "content": "[Header 1 (\"lists\",[],[]) [Str \"Lists\"]\n,BulletList\n [[Para [Str \"Bulleted\",Space,Str \"bulleted\",Space,Str \"lists.\"]]\n ,[Para [Str \"And\",Space,Str \"go\",Space,Str \"to\",Space,Str \"arbitrary\",Space,Str \"depth.\"]\n  ,BulletList\n   [[Para [Str \"Like\",Space,Str \"this\"]\n    ,BulletList\n     [[Plain [Str \"Or\",Space,Str \"this\"]]]]\n   ,[Para [Str \"Back\",Space,Str \"to\",Space,Str \"here.\"]]]]]\n,Header 1 (\"lists-continued\",[],[]) [Str \"Lists\",Space,Str \"(continued)\"]\n,Para [Str \"Lists\",Space,Str \"can\",Space,Str \"also\",Space,Str \"be\",Space,Str \"numbered:\"]\n,OrderedList (1,Decimal,Period)\n [[Para [Str \"Tomatoes\"]]\n ,[Para [Str \"Potatoes\",Space,Str \"of\",Space,Str \"various\",Space,Str \"sorts\"]\n  ,OrderedList (1,LowerAlpha,Period)\n   [[Para [Str \"sweet\",Space,Str \"potatoes\"]]\n   ,[Para [Str \"russet\",Space,Str \"potates\"]]]]\n ,[Para [Str \"Tornadoes,\",Space,Str \"for\",Space,Str \"the\",Space,Str \"rhyme.\"]]]]\n"
  },
  {
    "path": "test/pptx/metadata-speaker-notes/input.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"author\",MetaInlines [Str \"Jesse\",Space,Str \"Rosenthal\"]),(\"notes\",MetaBlocks [Para [Str \"These\",Space,Str \"are\",Space,Str \"speaker\",Space,Str \"notes\",Space,Str \"from\",Space,Str \"metadata.\"]]),(\"title\",MetaInlines [Str \"Testing\"])]})\n[Header 1 (\"a-header\",[],[]) [Str \"A\",Space,Str \"header\"]\n,Para [Str \"And\",Space,Str \"a\",Space,Str \"new\",Space,Str \"slide.\"]]\n"
  },
  {
    "path": "test/pptx/raw-ooxml/input.native",
    "content": "[Para [Str \"Here\",Space,Str \"is\",Space,Str \"some\",Space,Str \"text,\",Space,Str \"written\",Space,Str \"as\",Space,Str \"a\",Space,Str \"raw\",Space,Str \"inline:\",Space,RawInline (Format \"openxml\") \"<a:r><a:rPr /><a:t>Here are examples of </a:t></a:r><a:r><a:rPr i=\\\"1\\\" /><a:t>italics</a:t></a:r><a:r><a:rPr /><a:t>, </a:t></a:r><a:r><a:rPr b=\\\"1\\\" /><a:t>bold</a:t></a:r>\"]\n,HorizontalRule\n,RawBlock (Format \"openxml\") \"<p:sp>\\n        <p:nvSpPr>\\n          <p:cNvPr id=\\\"3\\\" name=\\\"Content Placeholder 2\\\" />\\n          <p:cNvSpPr>\\n            <a:spLocks noGrp=\\\"1\\\" />\\n          </p:cNvSpPr>\\n          <p:nvPr>\\n            <p:ph idx=\\\"1\\\" />\\n          </p:nvPr>\\n        </p:nvSpPr>\\n        <p:spPr />\\n        <p:txBody>\\n          <a:bodyPr />\\n          <a:lstStyle />\\n          <a:p>\\n            <a:pPr lvl=\\\"1\\\" />\\n            <a:r>\\n              <a:rPr />\\n              <a:t>Bulleted bulleted lists.</a:t>\\n            </a:r>\\n          </a:p>\\n          <a:p>\\n            <a:pPr lvl=\\\"1\\\" />\\n            <a:r>\\n              <a:rPr />\\n              <a:t>And go to arbitrary depth.</a:t>\\n            </a:r>\\n          </a:p>\\n          <a:p>\\n            <a:pPr lvl=\\\"2\\\" />\\n            <a:r>\\n              <a:rPr />\\n              <a:t>Like this</a:t>\\n            </a:r>\\n          </a:p>\\n          <a:p>\\n            <a:pPr lvl=\\\"3\\\" />\\n            <a:r>\\n              <a:rPr />\\n              <a:t>Or this</a:t>\\n            </a:r>\\n          </a:p>\\n          <a:p>\\n            <a:pPr lvl=\\\"2\\\" />\\n            <a:r>\\n              <a:rPr />\\n              <a:t>Back to here.</a:t>\\n            </a:r>\\n          </a:p>\\n        </p:txBody>\\n      </p:sp>\"]\n"
  },
  {
    "path": "test/pptx/reference-no-slides/add-slides/input.native",
    "content": "[ Header\n    2\n    ( \"first-slide\" , [] , [] )\n    [ Str \"First\" , Space , Str \"Slide\" ]\n, Para [ Str \"Title\" ]\n, Header\n    2\n    ( \"second-slide\" , [] , [] )\n    [ Str \"Second\" , Space , Str \"Slide\" ]\n, BulletList\n    [ [ Plain [ Str \"First\" , Space , Str \"item\" ] ]\n    , [ Plain [ Str \"Second\" , Space , Str \"item\" ] ]\n    ]\n]\n"
  },
  {
    "path": "test/pptx/reference-no-slides/with-notes/input.native",
    "content": "[ Header\n    2\n    ( \"first-slide\" , [] , [] )\n    [ Str \"First\" , Space , Str \"Slide\" ]\n, Para\n    [ Str \"First\"\n    , Space\n    , Str \"slide\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"notes\"\n    ]\n, Div\n    ( \"\" , [ \"notes\" ] , [] )\n    [ Para\n        [ Str \"Notes\"\n        , Space\n        , Str \"for\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"first\"\n        , Space\n        , Str \"slide\"\n        ]\n    ]\n, Header\n    2\n    ( \"second-slide\" , [] , [] )\n    [ Str \"Second\" , Space , Str \"Slide\" ]\n, Para\n    [ Str \"Slide\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"notes\"\n    ]\n, Header\n    2\n    ( \"third-slide\" , [] , [] )\n    [ Str \"Third\" , Space , Str \"Slide\" ]\n, Para\n    [ Str \"Slide\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"notes\"\n    , Space\n    , Str \"again\"\n    ]\n, BulletList\n    [ [ Plain [ Str \"First\" , Space , Str \"item\" ] ]\n    , [ Plain [ Str \"Second\" , Space , Str \"item\" ] ]\n    ]\n, Div\n    ( \"\" , [ \"notes\" ] , [] )\n    [ Para\n        [ Str \"Notes\"\n        , Space\n        , Str \"for\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"third\"\n        , Space\n        , Str \"slides\"\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/pptx/remove-empty-slides/input.native",
    "content": "[Para [Str \"Content\"]\n,Para [Image (\"\",[],[]) [] (\"lalune.jpg\",\"\"),Space,RawInline (Format \"html\") \"<!--  -->\"]\n,HorizontalRule\n,HorizontalRule\n,Para [Str \"More\",Space,Str \"content\"]]\n"
  },
  {
    "path": "test/pptx/single-column/image/input.native",
    "content": "[ Header\n    1\n    ( \"single-column\" , [] , [] )\n    [ Str \"Single\" , Space , Str \"column\" ]\n, Div\n    ( \"\" , [ \"columns\" ] , [] )\n    [ Div\n        ( \"\" , [ \"column\" ] , [] )\n        [ Figure\n            ( \"\" , [] , [] )\n            (Caption\n               Nothing [ Plain [ Str \"an\" , Space , Str \"image\" ] ])\n            [ Plain\n                [ Image\n                    ( \"\" , [] , [] )\n                    [ Str \"an\" , Space , Str \"image\" ]\n                    ( \"lalune.jpg\" , \"\" )\n                ]\n            ]\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/pptx/single-column/text/input.native",
    "content": "[ Header\n    1\n    ( \"single-column\" , [] , [] )\n    [ Str \"Single\" , Space , Str \"column\" ]\n, Div\n    ( \"\" , [ \"columns\" ] , [] )\n    [ Div\n        ( \"\" , [ \"column\" ] , [] )\n        [ Para [ Str \"One\" , Space , Str \"paragraph.\" ]\n        , Para [ Str \"Another\" , Space , Str \"paragraph.\" ]\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/pptx/slide-breaks/input.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Para [Str \"Break\",Space,Str \"with\",Space,Str \"a\",Space,Str \"new\",Space,Str \"section-level\",Space,Str \"header\"]\n,Header 1 (\"below-section-level\",[],[]) [Str \"Below\",Space,Str \"section-level\"]\n,Header 2 (\"section-level\",[],[]) [Str \"Section-level\"]\n,Para [Str \"Third\",Space,Str \"slide\",Space,Str \"(with\",Space,Str \"a\",Space,Str \"section-level\",Space,Str \"of\",Space,Str \"2)\"]\n,HorizontalRule\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"another\",Space,Str \"slide.\"]]\n"
  },
  {
    "path": "test/pptx/slide-level-0/h1-h2-with-table/input.native",
    "content": "[Header 1 (\"hello\",[],[]) [Str \"Hello\"]\n,Header 2 (\"there\",[],[]) [Str \"There\"]\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 5.555555555555555e-2)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n"
  },
  {
    "path": "test/pptx/slide-level-0/h1-with-image/input.native",
    "content": "[Header 1 (\"hello\",[],[]) [Str \"Hello\"]\n,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]\n"
  },
  {
    "path": "test/pptx/slide-level-0/h1-with-table/input.native",
    "content": "[Header 1 (\"hello\",[],[]) [Str \"Hello\"]\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignDefault,ColWidth 5.555555555555555e-2)]\n (TableHead (\"\",[],[])\n [])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n"
  },
  {
    "path": "test/pptx/slide-level-0/h2-with-image/input.native",
    "content": "[Header 2 (\"hello\",[],[]) [Str \"Hello\"]\n,Para [Image (\"\",[],[]) [Str \"An\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]\n"
  },
  {
    "path": "test/pptx/speaker-notes/input.native",
    "content": "[Para [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"slide.\"]\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"note.\"]\n ,Para [Str \"Here\",Space,Str \"is\",Space,Emph [Str \"some\"],Space,Strong [Str \"other\"],Space,Str \"formatting.\"]]\n,HorizontalRule\n,Para [Str \"A\",Space,Str \"page\",Space,Str \"with\",Space,Str \"no\",Space,Str \"speaker\",Space,Str \"notes\"]\n,HorizontalRule\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"The\",Space,Str \"first\",Space,Str \"note\",Space,Str \"div\"]]\n,Para [Str \"A\",Space,Str \"page\",Space,Str \"with\",Space,Str \"two\",Space,Str \"notes.\"]\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"The\",Space,Str \"second\",Space,Str \"note\",Space,Str \"div\"]]\n,HorizontalRule\n,Para [Str \"Strip\",Space,Str \"links\",Space,Str \"and\",Space,Str \"footnotes.\"]\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"No\",Space,Link (\"\",[],[]) [Str \"link\"] (\"https://www.google.com\",\"\"),Space,Str \"here.\"]\n ,Para [Str \"No\",Space,Str \"note\",Space,Str \"here.\",Note [Para [Str \"You\\8217ll\",Space,Str \"never\",Space,Str \"read\",Space,Str \"this\"]]]]]\n"
  },
  {
    "path": "test/pptx/speaker-notes-after-metadata/input.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"author\",MetaInlines [Str \"Jesse\",Space,Str \"Rosenthal\"]),(\"title\",MetaInlines [Str \"Testing\"])]})\n[Div (\"\",[\"notes\"],[])\n [Para [Str \"Some\",Space,Str \"speaker\",Space,Str \"notes\"]]\n,Header 1 (\"a-header\",[],[]) [Str \"A\",Space,Str \"header\"]\n,Para [Str \"And\",Space,Str \"a\",Space,Str \"new\",Space,Str \"slide.\"]]\n"
  },
  {
    "path": "test/pptx/speaker-notes-afterheader/input.native",
    "content": "[Header 1 (\"here-is-a-single-header\",[],[]) [Str \"Here\",Space,Str \"is\",Space,Str \"a\",Space,Str \"single\",Space,Str \"header\"]\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"and\",Space,Str \"here\",Space,Str \"are\",Space,Str \"some\",Space,Str \"notes\"]]]\n"
  },
  {
    "path": "test/pptx/speaker-notes-afterseps/input.native",
    "content": "[Para [Image (\"\",[],[]) [Str \"The\",Space,Str \"moon\"] (\"lalune.jpg\",\"fig:\")]\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"chicken\",Space,Str \"and\",Space,Str \"dumplings\"]]\n,Table (\"\",[],[]) (Caption Nothing\n [Para [Str \"Demonstration\",Space,Str \"of\",Space,Str \"simple\",Space,Str \"table\",Space,Str \"syntax,\",Space,Str \"with\",Space,Str \"alignment\"]])\n [(AlignRight,ColWidthDefault)\n ,(AlignLeft,ColWidthDefault)\n ,(AlignCenter,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Right\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Left\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Center\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Default\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]]])]\n (TableFoot (\"\",[],[])\n [])\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"foo\",Space,Str \"bar\"]]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [BulletList\n   [[Para [Str \"some\",Space,Str \"stuff\"]]\n   ,[Para [Str \"some\",Space,Str \"more\",Space,Str \"stuff\"]]]\n  ,Div (\"\",[\"notes\"],[])\n   [Para [Str \"Some\",Space,Str \"notes\",Space,Str \"inside\",Space,Str \"a\",Space,Str \"column\"]]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"Some\",Space,Str \"other\",Space,Emph [Str \"stuff\"]]]]\n,Div (\"\",[\"notes\"],[])\n [Para [Str \"Some\",Space,Str \"notes\",Space,Str \"outside\",Space,Str \"the\",Space,Str \"column\"]]]"
  },
  {
    "path": "test/pptx/start-numbering-at/input.native",
    "content": "[Header 2 (\"example-numbering-mwe\",[],[]) [Str \"Example\",Space,Str \"numbering\",Space,Str \"MWE\"]\n,Para [Str \"This\",Space,Str \"is\",Space,Str \"a\",Space,Str \"slide\",Space,Str \"with\",Space,Str \"examples\",Space,Str \"in\",Space,Str \"(1)\",Space,Str \"and\",Space,Str \"(2)\"]\n,OrderedList (1,Example,TwoParens)\n [[Plain [Str \"First\"]]\n ,[Plain [Str \"Second\"]]]\n,Header 2 (\"a-second-slide\",[],[]) [Str \"A\",Space,Str \"second\",Space,Str \"slide\"]\n,Para [Str \"This\",Space,Str \"second\",Space,Str \"slide\",Space,Str \"has\",Space,Str \"a\",Space,Str \"third\",Space,Str \"example\",Space,Str \"in\",Space,Str \"(3).\"]\n,OrderedList (3,Example,TwoParens)\n [[Plain [Str \"Third\"]]]]\n"
  },
  {
    "path": "test/pptx/tables/input.native",
    "content": "[Header 2 (\"a-table-with-a-caption\",[],[]) [Str \"A\",Space,Str \"Table,\",Space,Str \"with\",Space,Str \"a\",Space,Str \"caption\"]\n,Table (\"\",[],[]) (Caption Nothing\n [Para [Str \"Demonstration\",Space,Str \"of\",Space,Str \"simple\",Space,Str \"table\",Space,Str \"syntax,\",Space,Str \"with\",Space,Str \"alignment\"]])\n [(AlignRight,ColWidthDefault)\n ,(AlignLeft,ColWidthDefault)\n ,(AlignCenter,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Right\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Left\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Center\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Default\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]]])]\n (TableFoot (\"\",[],[])\n [])\n,Table (\"\",[],[]) (Caption Nothing\n [])\n [(AlignRight,ColWidthDefault)\n ,(AlignLeft,ColWidthDefault)\n ,(AlignCenter,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Right\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Left\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Center\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Default\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"123\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]]])]\n (TableFoot (\"\",[],[])\n [])]"
  },
  {
    "path": "test/pptx/two-column/all-text/input.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Header 1 (\"two-column-layout\",[],[]) [Str \"Two-Column\",Space,Str \"Layout\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"One\",Space,Str \"paragraph.\"]\n  ,Para [Str \"Another\",Space,Str \"paragraph.\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"Second\",Space,Str \"column\",Space,Str \"paragraph.\"]\n  ,Para [Str \"Another\",Space,Str \"second\",Space,Str \"paragraph.\"]]]]\n"
  },
  {
    "path": "test/pptx/two-column/text-and-image/input.native",
    "content": "[Header 1 (\"slide-1\",[],[]) [Str \"Slide\",Space,Str \"1\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Image (\"\",[],[]) [Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Str \"This\",Space,Str \"should\",Space,Str \"use\",Space,Str \"Two\",Space,Str \"Content,\",Space,Emph [Str \"not\"],Space,Str \"Comparison!\"]]]\n,Header 1 (\"slide-2\",[],[]) [Str \"Slide\",Space,Str \"2\"]\n,Div (\"\",[\"columns\"],[])\n [Div (\"\",[\"column\"],[])\n  [Para [Str \"This\",Space,Str \"should\",Space,Str \"also\",Space,Str \"use\",Space,Str \"Two\",Space,Str \"Content\"]]\n ,Div (\"\",[\"column\"],[])\n  [Para [Image (\"\",[],[]) [Str \"an\",Space,Str \"image\"] (\"lalune.jpg\",\"fig:\")]]]]\n"
  },
  {
    "path": "test/pptx-reader/basic.native",
    "content": "[ Header 2 ( \"slide-1\" , [] , [] ) [ Str \"LLMs\" ]\n, BulletList\n    [ [ Plain\n          [ Str\n              \"Provider  \\61664 Available LLMs \\8211 who manages? How?\"\n          ]\n      ]\n    , [ Plain\n          [ Str\n              \"EW maintained list of \\8220approved\\8221 LLMs for Universal workers\"\n          ]\n      ]\n    , [ Plain\n          [ Str\n              \"Rebuilding of UWs to the \\8220Newgen\\8221 thing completely\"\n          ]\n      ]\n    , [ Plain [ Str \"Streaming support\" ] ]\n    , [ Plain [ Str \"Multimodal (voice streaming) models?\" ] ]\n    ]\n, Header\n    2\n    ( \"slide-2\" , [] , [] )\n    [ Str \"Everworker   venn   diagram\" ]\n, Para [ Str \"SKILLS\" ]\n, Para [ Str \"\" ]\n, Para [ Str \"Specialized Workers / Workflows:\" ]\n, Para [ Str \"\" ]\n, Para [ Str \"n8n, UI Path, \" ]\n, Para [ Str \"other RPA\" ]\n, Para [ Str \"BRAINS\" ]\n, Para [ Str \"\" ]\n, Para [ Str \"Universal Workers / AI Agents:\" ]\n, Para [ Str \"\" ]\n, Para [ Str \"openai , anthropic,\" ]\n, Para [ Str \"Crew AI, other \" ]\n, Para [ Str \"\\8220AI natives\\8221\" ]\n, Para [ Str \"KNOWLEDGE \" ]\n, Para [ Str \"\" ]\n, Para [ Str \"Data / \" ]\n, Para [ Str \"RAG Pipelines\" ]\n, Para [ Str \"\" ]\n, Para\n    [ Str \"Vector DBs, specialized data prep vendors, \\8230\" ]\n, Para [ Str \"glean\" ]\n, Para [ Str \"EW\" ]\n, Header 2 ( \"slide-3\" , [] , [] ) [ Str \"Table\" ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Col1\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Col2\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Col3\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Name\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Anton\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Antich\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Age\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"23\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"years\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Image\n        ( \"\" , [] , [] ) [] ( \"ppt/media/image1.png\" , \"Picture 6\" )\n    ]\n, Header 2 ( \"slide-4\" , [] , [] ) [ Str \"Smart Art\" ]\n, Div\n    ( \"\"\n    , [ \"smartart\" , \"chevron2\" ]\n    , [ ( \"layout\" , \"chevron2\" ) ]\n    )\n    [ Para [ Strong [ Str \"First\" ] ]\n    , BulletList\n        [ [ Plain [ Str \"another\" ] ]\n        , [ Plain [ Str \"subtitle\" ] ]\n        ]\n    , Para [ Strong [ Str \"Second\" ] ]\n    , BulletList\n        [ [ Plain [ Str \"and yet again\" ] ]\n        , [ Plain [ Str \"yet more\" ] ]\n        ]\n    ]\n]\n"
  },
  {
    "path": "test/rst-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n                , MetaInlines [ Str \"Anonymous\" ]\n                ]\n            )\n          , ( \"date\"\n            , MetaInlines\n                [ Str \"July\" , Space , Str \"17,\" , Space , Str \"2006\" ]\n            )\n          , ( \"revision\" , MetaInlines [ Str \"3\" ] )\n          , ( \"subtitle\" , MetaInlines [ Str \"Subtitle\" ] )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\" , Space , Str \"Test\" , Space , Str \"Suite\" ]\n            )\n          ]\n    }\n  [ Header\n      1\n      ( \"level-one-header\" , [] , [] )\n      [ Str \"Level\" , Space , Str \"one\" , Space , Str \"header\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , SoftBreak\n      , Str \"John\"\n      , Space\n      , Str \"Gruber\\8217s\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , Header\n      2\n      ( \"level-two-header\" , [] , [] )\n      [ Str \"Level\" , Space , Str \"two\" , Space , Str \"header\" ]\n  , Header\n      3 ( \"level-three\" , [] , [] ) [ Str \"Level\" , Space , Str \"three\" ]\n  , Header\n      4\n      ( \"level-four-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"four\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      5 ( \"level-five\" , [] , [] ) [ Str \"Level\" , Space , Str \"five\" ]\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , SoftBreak\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , SoftBreak\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , SoftBreak\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para [ Str \"Horizontal\" , Space , Str \"rule:\" ]\n  , HorizontalRule\n  , Para [ Str \"Another:\" ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , SoftBreak\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"another,\"\n      , Space\n      , Str \"differently\"\n      , Space\n      , Str \"indented:\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , SoftBreak\n          , Str \"It\\8217s\"\n          , Space\n          , Str \"indented\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"tab.\"\n          ]\n      , Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , Para\n          [ Str \"List\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Plain [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Plain [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\" , Space , Str \"block\" , Space , Str \"quotes:\" ]\n      , BlockQuote\n          [ Para [ Str \"nested\" ] , BlockQuote [ Para [ Str \"nested\" ] ] ]\n      ]\n  , Header\n      1 ( \"code-blocks\" , [] , [] ) [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\"\n  , CodeBlock\n      ( \"\" , [] , [] ) \"this code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"this block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [ \"python\" ] , [] ) \"def my_function(x):\\n    return x + 1\"\n  , Para\n      [ Str \"If\"\n      , Space\n      , Str \"we\"\n      , Space\n      , Str \"use\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"highlight\"\n      , Space\n      , Str \"directive,\"\n      , Space\n      , Str \"we\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"specify\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"default\"\n      , Space\n      , Str \"language\"\n      , SoftBreak\n      , Str \"for\"\n      , Space\n      , Str \"literate\"\n      , Space\n      , Str \"blocks.\"\n      ]\n  , CodeBlock\n      ( \"\" , [ \"haskell\" ] , [] )\n      \"-- this code is in haskell\\ndata Tree = Leaf | Node Tree Tree\"\n  , CodeBlock\n      ( \"\" , [ \"haskell\" ] , [] )\n      \"-- this code is in haskell too\\ndata Nat = Zero | Succ Nat\"\n  , CodeBlock\n      ( \"\" , [ \"javascript\" ] , [] )\n      \"-- this code is in javascript\\nlet f = (x, y) => x + y\"\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second\" ] ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"One\" ] ]\n      , [ Plain [ Str \"Two\" ] ]\n      , [ Plain [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Loose\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second\" ] ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"One\" ] ]\n      , [ Plain [ Str \"Two\" ] ]\n      , [ Plain [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog\\8217s\"\n            , SoftBreak\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Para [ Str \"Nested:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Tab\" ]\n        , BulletList\n            [ [ Plain [ Str \"Tab\" ] , BulletList [ [ Plain [ Str \"Tab\" ] ] ] ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BlockQuote\n            [ BulletList\n                [ [ Plain [ Str \"Fee\" ] ]\n                , [ Plain [ Str \"Fie\" ] ]\n                , [ Plain [ Str \"Foe\" ] ]\n                ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , OrderedList\n      ( 2 , Decimal , TwoParens )\n      [ [ Para [ Str \"begins\" , Space , Str \"with\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n        , Para\n            [ Str \"with\" , Space , Str \"a\" , Space , Str \"continuation\" ]\n        , OrderedList\n            ( 4 , LowerRoman , Period )\n            [ [ Plain\n                  [ Str \"sublist\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"roman\"\n                  , Space\n                  , Str \"numerals,\"\n                  , Space\n                  , Str \"starting\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"4\"\n                  ]\n              ]\n            , [ Plain [ Str \"more\" , Space , Str \"items\" ]\n              , OrderedList\n                  ( 1 , UpperAlpha , TwoParens )\n                  [ [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  , [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Nesting:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , Period )\n      [ [ Plain [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , Period )\n            [ [ Plain [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , TwoParens )\n                  [ [ Plain\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , OneParen )\n                        [ [ Plain\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"Autonumber.\" ] ]\n      , [ Plain [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim ) [ [ Plain [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"Autonumbering\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"explicit\"\n      , Space\n      , Str \"start:\"\n      ]\n  , OrderedList\n      ( 4 , LowerAlpha , TwoParens )\n      [ [ Plain [ Str \"item\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"item\" , Space , Str \"2\" ] ]\n      ]\n  , Header 2 ( \"definition\" , [] , [] ) [ Str \"Definition\" ]\n  , DefinitionList\n      [ ( [ Str \"term\" , Space , Str \"1\" ]\n        , [ [ Para [ Str \"Definition\" , Space , Str \"1.\" ] ] ]\n        )\n      , ( [ Str \"term\" , Space , Str \"2\" ]\n        , [ [ Para\n                [ Str \"Definition\"\n                , Space\n                , Str \"2,\"\n                , Space\n                , Str \"paragraph\"\n                , Space\n                , Str \"1.\"\n                ]\n            , Para\n                [ Str \"Definition\"\n                , Space\n                , Str \"2,\"\n                , Space\n                , Str \"paragraph\"\n                , Space\n                , Str \"2.\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"term\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Emph [ Str \"emphasis\" ]\n          ]\n        , [ [ Para [ Str \"Definition\" , Space , Str \"3.\" ] ] ]\n        )\n      ]\n  , Header\n      1 ( \"field-lists\" , [] , [] ) [ Str \"Field\" , Space , Str \"Lists\" ]\n  , BlockQuote\n      [ DefinitionList\n          [ ( [ Str \"address\" ]\n            , [ [ Plain [ Str \"61\" , Space , Str \"Main\" , Space , Str \"St.\" ] ]\n              ]\n            )\n          , ( [ Str \"city\" ]\n            , [ [ Plain\n                    [ Emph [ Str \"Nowhere\" ]\n                    , Str \",\"\n                    , Space\n                    , Str \"MA,\"\n                    , SoftBreak\n                    , Str \"USA\"\n                    ]\n                ]\n              ]\n            )\n          , ( [ Str \"phone\" ] , [ [ Plain [ Str \"123-4567\" ] ] ] )\n          ]\n      ]\n  , DefinitionList\n      [ ( [ Str \"address\" ]\n        , [ [ Plain [ Str \"61\" , Space , Str \"Main\" , Space , Str \"St.\" ] ]\n          ]\n        )\n      , ( [ Str \"city\" ]\n        , [ [ Plain\n                [ Emph [ Str \"Nowhere\" ]\n                , Str \",\"\n                , Space\n                , Str \"MA,\"\n                , SoftBreak\n                , Str \"USA\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"phone\" ] , [ [ Plain [ Str \"123-4567\" ] ] ] )\n      ]\n  , Header\n      1 ( \"html-blocks\" , [] , [] ) [ Str \"HTML\" , Space , Str \"Blocks\" ]\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"line:\"\n      ]\n  , RawBlock (Format \"html\") \"<div>foo</div>\"\n  , Para [ Str \"Now,\" , Space , Str \"nested:\" ]\n  , RawBlock\n      (Format \"html\")\n      \"<div>\\n    <div>\\n        <div>\\n            foo\\n        </div>\\n    </div>\\n</div>\"\n  , Header\n      1 ( \"latex-block\" , [] , [] ) [ Str \"LaTeX\" , Space , Str \"Block\" ]\n  , RawBlock\n      (Format \"latex\")\n      \"\\\\begin{tabular}{|l|l|}\\\\hline\\nAnimal & Number \\\\\\\\ \\\\hline\\nDog    & 2      \\\\\\\\\\nCat    & 1      \\\\\\\\ \\\\hline\\n\\\\end{tabular}\"\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \".\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Subscript [ Str \"subscripted\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Superscript [ Str \"superscripted\" ]\n      , Str \".\"\n      ]\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Plain [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ] ]\n      , [ Plain [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Plain [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Plain\n            [ Str \"set\" , Space , Str \"membership:\" , Space , Str \"\\8712\" ]\n        ]\n      , [ Plain [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Para\n      [ Str \"Explicit:\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Explicit\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"label:\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"foo\" ] ( \"foo\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Two\"\n      , Space\n      , Str \"anonymous\"\n      , Space\n      , Str \"links:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"the\" , Space , Str \"first\" ]\n          ( \"/url1/\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"the\" , Space , Str \"second\" ]\n          ( \"/url2/\" , \"\" )\n      ]\n  , Para\n      [ Str \"Reference\"\n      , Space\n      , Str \"links:\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"link1\" ] ( \"/url1/\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"link2\" ] ( \"/url2/\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"link1\" ] ( \"/url1/\" , \"\" )\n      , Space\n      , Str \"again.\"\n      ]\n  , Para\n      [ Str \"Another\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"style\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"reference\"\n          , Space\n          , Str \"link\"\n          ]\n          ( \"/url1/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"AT&T\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Autolinks:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Space\n      , Str \"and\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"nobody@nowhere.net\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      , Str \".\"\n      ]\n  , Para [ Str \"But\" , Space , Str \"not\" , Space , Str \"here:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"http://example.com/\"\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"Voyage\"\n          , Space\n          , Str \"dans\"\n          , Space\n          , Str \"la\"\n          , Space\n          , Str \"Lune\"\n          ]\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Para\n      [ Image ( \"\" , [] , [] ) [ Str \"image\" ] ( \"lalune.jpg\" , \"\" ) ]\n  , Para\n      [ Image\n          ( \"\" , [] , [ ( \"height\" , \"2343px\" ) ] )\n          [ Str \"Voyage dans la Lune\" ]\n          ( \"lalune.jpg\" , \"\" )\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image ( \"\" , [] , [] ) [ Str \"movie\" ] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Image ( \"\" , [] , [] ) [ Str \"A movie\" ] ( \"movie.jpg\" , \"\" ) ]\n          ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 1 ( \"comments\" , [] , [] ) [ Str \"Comments\" ]\n  , Para [ Str \"First\" , Space , Str \"paragraph\" ]\n  , Para [ Str \"Another\" , Space , Str \"paragraph\" ]\n  , Para [ Str \"A\" , Space , Str \"third\" , Space , Str \"paragraph\" ]\n  , Header\n      1 ( \"line-blocks\" , [] , [] ) [ Str \"Line\" , Space , Str \"blocks\" ]\n  , LineBlock\n      [ [ Str \"But\"\n        , Space\n        , Str \"can\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"bee\"\n        , Space\n        , Str \"be\"\n        , Space\n        , Str \"said\"\n        , Space\n        , Str \"to\"\n        , Space\n        , Str \"be\"\n        ]\n      , [ Str \"\\160\\160\\160\\160or\"\n        , Space\n        , Str \"not\"\n        , Space\n        , Str \"to\"\n        , Space\n        , Str \"be\"\n        , Space\n        , Str \"an\"\n        , Space\n        , Str \"entire\"\n        , Space\n        , Str \"bee,\"\n        ]\n      , [ Str \"\\160\\160\\160\\160\\160\\160\\160\\160when\"\n        , Space\n        , Str \"half\"\n        , Space\n        , Str \"the\"\n        , Space\n        , Str \"bee\"\n        , Space\n        , Str \"is\"\n        , Space\n        , Str \"not\"\n        , Space\n        , Str \"a\"\n        , Space\n        , Str \"bee,\"\n        ]\n      , [ Str \"\\160\\160\\160\\160\\160\\160\\160\\160\\160\\160\\160\\160due\"\n        , Space\n        , Str \"to\"\n        , Space\n        , Str \"some\"\n        , Space\n        , Str \"ancient\"\n        , Space\n        , Str \"injury?\"\n        ]\n      , []\n      , [ Str \"Continuation\" , Space , Str \"line\" ]\n      , [ Str \"\\160\\160and\" , Space , Str \"another\" ]\n      ]\n  , Header\n      1\n      ( \"simple-tables\" , [] , [] )\n      [ Str \"Simple\" , Space , Str \"Tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"2\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"3\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r1\" , Space , Str \"a\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Str \"Headless\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r1\" , Space , Str \"a\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      1 ( \"grid-tables\" , [] , [] ) [ Str \"Grid\" , Space , Str \"Tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2375 )\n      , ( AlignDefault , ColWidth 0.15 )\n      , ( AlignDefault , ColWidth 0.1625 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"2\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"col\" , Space , Str \"3\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" , SoftBreak , Str \"b\" , Space , Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" , SoftBreak , Str \"c\" , Space , Str \"2\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Str \"Headless\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2375 )\n      , ( AlignDefault , ColWidth 0.15 )\n      , ( AlignDefault , ColWidth 0.1625 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" , SoftBreak , Str \"b\" , Space , Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" , SoftBreak , Str \"c\" , Space , Str \"2\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Spaces\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"lines\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2375 )\n      , ( AlignDefault , ColWidth 0.15 )\n      , ( AlignDefault , ColWidth 0.1625 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"r1\"\n                      , Space\n                      , Str \"a\"\n                      , SoftBreak\n                      , Str \"r1\"\n                      , Space\n                      , Str \"bis\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" , SoftBreak , Str \"b\" , Space , Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" , SoftBreak , Str \"c\" , Space , Str \"2\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"r2\" , Space , Str \"d\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"cell\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.2375 )\n      , ( AlignDefault , ColWidth 0.15 )\n      , ( AlignDefault , ColWidth 0.1625 )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"r1\" , Space , Str \"a\" ]\n                  , Para [ Str \"r1\" , Space , Str \"bis\" ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ BulletList\n                      [ [ Plain [ Str \"b\" ] ]\n                      , [ Plain [ Str \"b\" , Space , Str \"2\" ] ]\n                      , [ Plain [ Str \"b\" , Space , Str \"2\" ] ]\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"c\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      , SoftBreak\n                      , Str \"c\"\n                      , Space\n                      , Str \"2\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"cells\"\n      , Space\n      , Str \"spanning\"\n      , Space\n      , Str \"multiple\"\n      , Space\n      , Str \"rows\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"columns:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.175 )\n      , ( AlignDefault , ColWidth 0.1 )\n      , ( AlignDefault , ColWidth 0.1375 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 2)\n                 [ Plain [ Str \"Property\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Earth\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 3)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Temperature\" , SoftBreak , Str \"1961-1990\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"min\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-89.2\" , Space , Str \"\\176C\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"mean\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"14\" , Space , Str \"\\176C\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"min\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"56.7\" , Space , Str \"\\176C\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"Table\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"complex\"\n      , Space\n      , Str \"header:\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidth 0.275 )\n      , ( AlignDefault , ColWidth 0.1 )\n      , ( AlignDefault , ColWidth 0.1 )\n      , ( AlignDefault , ColWidth 0.1 )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 2)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Location\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 3)\n                 [ Plain\n                     [ Str \"Temperature\"\n                     , Space\n                     , Str \"1961-1990\"\n                     , SoftBreak\n                     , Str \"in\"\n                     , Space\n                     , Str \"degree\"\n                     , Space\n                     , Str \"Celsius\"\n                     ]\n                 ]\n             ]\n         , Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"min\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"mean\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"max\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Antarctica\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-89.2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"N/A\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"19.8\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Earth\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-89.2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"14\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"56.7\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Note\n          [ Para\n              [ Str \"Note\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"line.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Note\n          [ Para\n              [ Str \"Note\"\n              , Space\n              , Str \"with\"\n              , SoftBreak\n              , Str \"continuation\"\n              , Space\n              , Str \"line.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Note\n          [ Para [ Str \"Note\" , Space , Str \"with\" ]\n          , Para [ Str \"continuation\" , Space , Str \"block.\" ]\n          ]\n      ]\n  , Para\n      [ Note\n          [ Para\n              [ Str \"Note\"\n              , Space\n              , Str \"with\"\n              , SoftBreak\n              , Str \"continuation\"\n              , Space\n              , Str \"line\"\n              ]\n          , Para\n              [ Str \"and\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"second\"\n              , Space\n              , Str \"para.\"\n              ]\n          ]\n      ]\n  , Para [ Str \"Not\" , Space , Str \"in\" , Space , Str \"note.\" ]\n  , Header 1 ( \"math\" , [] , [] ) [ Str \"Math\" ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"math\"\n      , Space\n      , Math InlineMath \"E=mc^2\"\n      , Str \".\"\n      , Space\n      , Str \"Now\"\n      , Space\n      , Str \"some\"\n      , SoftBreak\n      , Str \"display\"\n      , Space\n      , Str \"math:\"\n      ]\n  , Para [ Math DisplayMath \"E=mc^2\" ]\n  , Para [ Math DisplayMath \"E = mc^2\" ]\n  , Para\n      [ Math DisplayMath \"E = mc^2\"\n      , Math DisplayMath \"\\\\alpha = \\\\beta\"\n      ]\n  , Para\n      [ Span\n          ( \"\" , [] , [ ( \"label\" , \"hithere\" ) , ( \"nowrap\" , \"\" ) ] )\n          [ Math\n              DisplayMath\n              \"\\\\begin{aligned}\\nE &= mc^2\\\\\\\\\\nF &= \\\\pi E\\n\\\\end{aligned}\"\n          , Math DisplayMath \"F &= \\\\gamma \\\\alpha^2\"\n          ]\n      ]\n  , Para [ Str \"All\" , Space , Str \"done.\" ]\n  , Header 1 ( \"default-role\" , [] , [] ) [ Str \"Default-Role\" ]\n  , Para\n      [ Str \"Try\"\n      , Space\n      , Str \"changing\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"default\"\n      , Space\n      , Str \"role\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"few\"\n      , Space\n      , Str \"different\"\n      , Space\n      , Str \"things.\"\n      ]\n  , Header\n      2\n      ( \"doesnt-break-title-parsing\" , [] , [] )\n      [ Str \"Doesn\\8217t\"\n      , Space\n      , Str \"Break\"\n      , Space\n      , Str \"Title\"\n      , Space\n      , Str \"Parsing\"\n      ]\n  , Para\n      [ Str \"Inline\"\n      , Space\n      , Str \"math:\"\n      , Space\n      , Math InlineMath \"E=mc^2\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Math InlineMath \"E=mc^2\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Math InlineMath \"E=mc^2\"\n      , Str \".\"\n      , SoftBreak\n      , Str \"Other\"\n      , Space\n      , Str \"roles:\"\n      , Space\n      , Superscript [ Str \"super\" ]\n      , Str \",\"\n      , Space\n      , Subscript [ Str \"sub\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Math DisplayMath \"\\\\alpha = beta\" , Math DisplayMath \"E = mc^2\" ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Superscript [ Str \"of\" ]\n      , Space\n      , Str \"these\"\n      , Space\n      , Superscript [ Str \"words\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Superscript [ Str \"superscript\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Reset\"\n      , Space\n      , Str \"default-role\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"default\"\n      , Space\n      , Str \"default.\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"now\"\n      , Space\n      , Span\n          ( \"\" , [ \"title-ref\" ] , [] ) [ Str \"some-invalid-string-3231231\" ]\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"nonsense.\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"now\"\n      , Space\n      , Str \"with\"\n      , Space\n      , RawInline\n          (Format \"html\") \"<b>inline</b> <span id=\\\"test\\\">HTML</span>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"haskell\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" ] , [] ) \"fmap id [1,2..10]\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indirect\"\n      , Space\n      , Str \"python\"\n      , Space\n      , Str \"role\"\n      , Space\n      , Code\n          ( \"\" , [ \"py\" , \"python\" , \"indirect\" ] , [] )\n          \"[x*x for x in [1,2,3,4,5]]\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Different\"\n      , Space\n      , Str \"indirect\"\n      , Space\n      , Str \"C\"\n      , Space\n      , Code ( \"\" , [ \"c\" , \"different-indirect\" ] , [] ) \"int x = 15;\"\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"literal-symbols\" , [] , [] )\n      [ Str \"Literal\" , Space , Str \"symbols\" ]\n  , Para [ Str \"2*2\" , Space , Str \"=\" , Space , Str \"4*1\" ]\n  ]\n"
  },
  {
    "path": "test/rst-reader.rst",
    "content": "Pandoc Test Suite\n#################\nSubtitle\n^^^^^^^^\n\n:Authors: John MacFarlane; Anonymous\n:Date: July 17, 2006\n:Revision: 3\n\nLevel one header\n================\n\nThis is a set of tests for pandoc.  Most of them are adapted from\nJohn Gruber's markdown test suite.\n\nLevel two header\n----------------\n\nLevel three\n+++++++++++\n\nLevel four with *emphasis*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nLevel five\n''''''''''\n\nParagraphs\n==========\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.\n\nHere's one with a bullet.\n* criminey.\n\nHorizontal rule:\n\n-----\n\nAnother:\n\n****\n\nBlock Quotes\n============\n\nHere's a block quote:\n\n  This is a block quote.\n  It is pretty short.\n\nHere's another, differently indented:\n\n    This is a block quote.\n    It's indented with a tab.\n\n    Code in a block quote:: \n\n        sub status {\n            print \"working\";\n        }\n\n    List in a block quote:\n\n    1. item one\n    2. item two\n\n    Nested block quotes:\n\n        nested\n\n            nested\n\nCode Blocks\n===========\n\nCode:\n\n::\n\n    ---- (should be four hyphens)\n\n    sub status {\n        print \"working\";\n    }\n\n::\n\n\tthis code block is indented by one tab\n\nAnd::\n\n\t\tthis block is indented by two tabs\n\n        These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\nAnd:\n\n.. code-block:: python\n\n   def my_function(x):\n       return x + 1\n\nIf we use the highlight directive, we can specify a default language\nfor literate blocks.\n\n.. highlight:: haskell\n\n::\n\n  -- this code is in haskell\n  data Tree = Leaf | Node Tree Tree\n\n::\n\n  -- this code is in haskell too\n  data Nat = Zero | Succ Nat\n\n.. highlight:: javascript\n\n::\n\n  -- this code is in javascript\n  let f = (x, y) => x + y\n\n.. highlight::\n\nLists\n=====\n\nUnordered\n---------\n\nAsterisks tight:\n\n*\tasterisk 1\n*\tasterisk 2\n*\tasterisk 3\n\nAsterisks loose:\n\n*\tasterisk 1\n\n*\tasterisk 2\n\n*\tasterisk 3\n\nPluses tight:\n\n+\tPlus 1\n+\tPlus 2\n+\tPlus 3\n\nPluses loose:\n\n+\tPlus 1\n\n+\tPlus 2\n\n+\tPlus 3\n\nMinuses tight:\n\n-\tMinus 1\n-\tMinus 2\n-\tMinus 3\n\nMinuses loose:\n\n-\tMinus 1\n\n-\tMinus 2\n\n-\tMinus 3\n\nOrdered\n-------\n\nTight:\n\n1.\tFirst\n2.\tSecond\n3.\tThird\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1.\tFirst\n\n2.\tSecond\n\n3.\tThird\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1.\tItem 1, graf one.\n\n\tItem 1. graf two. The quick brown fox jumped over the lazy dog's\n\tback.\n\n2.\tItem 2.\n\n3.\tItem 3.\n\nNested:\n\n*\tTab\n\n\t*\tTab\n\n\t\t*\tTab\n\nHere's another:\n\n1. First\n\n2. Second:\n\n\t* Fee\n\t* Fie\n\t* Foe\n\n3. Third \n\nFancy list markers\n------------------\n\n(2) begins with 2\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v.  more items\n        \n        (A) a subsublist\n        (B) a subsublist\n\nNesting:\n\nA.  Upper Alpha\n    \n    I.  Upper Roman.\n        \n        (6) Decimal start with 6\n            \n            c) Lower alpha with paren\n\nAutonumbering:\n\n#. Autonumber.\n#.  More.\n    \n    #. Nested.\n\nAutonumbering with explicit start:\n\n(d)  item 1\n(#)  item 2\n\nDefinition\n----------\n\nterm 1\n    Definition 1.\n\nterm 2\n    Definition 2, paragraph 1.\n\n    Definition 2, paragraph 2.\n\nterm with *emphasis* \n    Definition 3.\n\nField Lists\n===========\n\n :address:  61 Main St.\n :city:  *Nowhere*, MA,\n    USA\n :phone: 123-4567\n\n:address:  61 Main St.\n:city:  *Nowhere*, MA,\n    USA\n:phone:\n  123-4567\n\nHTML Blocks\n===========\n\nSimple block on one line:\n\n.. raw:: html\n\n    <div>foo</div>\n\nNow, nested:\n\n.. raw:: html\n\n    <div>\n\t    <div>\n\t\t    <div>\n\t\t\t    foo\n\t\t    </div>\n\t    </div>\n    </div>\n\nLaTeX Block\n===========\n\n.. raw:: latex\n\n   \\begin{tabular}{|l|l|}\\hline\n   Animal & Number \\\\ \\hline\n   Dog    & 2      \\\\\n   Cat    & 1      \\\\ \\hline\n   \\end{tabular}\n\nInline Markup\n=============\n\nThis is *emphasized*. This is **strong**.\n\nThis is code: ``>``, ``$``, ``\\``, ``\\$``, ``<html>``.\n\nThis is\\ :sub:`subscripted` and this is :sup:`superscripted`\\ .\n\nSpecial Characters\n==================\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: § \n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: \\(\n\nRight paren: \\)\n\nGreater-than: \\>\n\nHash: \\#\n\nPeriod: \\.\n\nBang: \\!\n\nPlus: \\+\n\nMinus: \\-\n\nLinks\n=====\n\nExplicit:  a `URL </url/>`_.\n\nExplicit with no label:  `<foo>`_.\n\nTwo anonymous links:  `the first`__ and `the second`__\n\n__ /url1/\n__ /url2/\n\nReference links:  `link1`_ and `link2`_ and link1_ again.\n\n.. _link1: /url1/\n.. _`link2`: /url2/\n\nAnother `style of reference link <link1_>`_.\n\nHere's a `link with an ampersand in the URL`_.\n\nHere's a link with an amersand in the link text: `AT&T </url/>`_.\n\n.. _link with an ampersand in the URL: http://example.com/?foo=1&bar=2\n\nAutolinks: http://example.com/?foo=1&bar=2 and nobody@nowhere.net.\n\nBut not here::\n\n    http://example.com/\n\nImages\n======\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n.. image:: lalune.jpg\n\n.. image:: lalune.jpg\n   :height: 2343\n   :alt: Voyage dans la Lune\n\nHere is a movie |movie| icon.\n\n.. |movie| image:: movie.jpg\n\nAnd an |image with a link|.\n\n.. |image with a link| image:: movie.jpg\n   :alt:  A movie\n   :target: /url\n\nComments\n========\n\nFirst paragraph\n\n.. comment\n\n..\n    Comment block, should not appear in output\n    as defined by reStructuredText\n\nAnother paragraph\n\n..\n    Another comment block.\n\n    This one spans several\n    text elements.\n\n    It doesn't end until\n    indentation is restored to the\n    preceding level.\n\nA third paragraph\n\nLine blocks\n===========\n\n| But can a bee be said to be\n|     or not to be an entire bee,\n|         when half the bee is not a bee,\n|             due to some ancient injury?\n|\n| Continuation\n line\n|   and\n       another\n\nSimple Tables\n=============\n\n==================  ===========  ==========\ncol 1               col 2        col 3 \n==================  ===========  ==========\nr1 a                b            c\nr2 d                e            f\n==================  ===========  ==========\n\nHeadless\n\n==================  ===========  ==========\nr1 a                b            c\nr2 d                e            f\n==================  ===========  ==========\n\n\nGrid Tables\n===========\n\n+------------------+-----------+------------+\n| col 1            | col 2     | col 3      |\n+==================+===========+============+\n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        |\n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nHeadless\n\n+------------------+-----------+------------+\n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        |\n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nSpaces at ends of lines\n\n+------------------+-----------+------------+  \n| r1 a             | b         | c          |\n| r1 bis           | b 2       | c 2        | \n+------------------+-----------+------------+\n| r2 d             | e         | f          |\n+------------------+-----------+------------+\n\nMultiple blocks in a cell\n\n+------------------+-----------+------------+  \n| r1 a             | - b       | c          |\n|                  | - b 2     | c 2        | \n| r1 bis           | - b 2     | c 2        | \n+------------------+-----------+------------+\n\nTable with cells spanning multiple rows or columns:\n\n+---------------------+----------+\n| Property            | Earth    |\n+=============+=======+==========+\n|             | min   | -89.2 °C |\n| Temperature +-------+----------+\n| 1961-1990   | mean  | 14 °C    |\n|             +-------+----------+\n|             | min   | 56.7 °C  |\n+-------------+-------+----------+\n\nTable with complex header:\n\n+---------------------+-----------------------+\n| Location            | Temperature 1961-1990 |\n|                     | in degree Celsius     |\n|                     +-------+-------+-------+\n|                     | min   | mean  | max   |\n+=====================+=======+=======+=======+\n| Antarctica          | -89.2 | N/A   | 19.8  |\n+---------------------+-------+-------+-------+\n| Earth               | -89.2 | 14    | 56.7  |\n+---------------------+-------+-------+-------+\n\nFootnotes\n=========\n\n[1]_\n\n[#]_\n\n[#]_\n\n[*]_\n\n.. [1] Note with one line.\n\n.. [#] Note with\n  continuation line.\n\n.. [#] Note with\n\n  continuation block.\n\n.. [*] Note with\n   continuation line\n\n   and a second para.\n\nNot in note.\n\nMath\n====\n\nSome inline math :math:`E=mc^2`\\ .  Now some\ndisplay math:\n\n.. math:: E=mc^2\n\n.. math::\n\n   E = mc^2\n\n.. math::\n\n   E = mc^2\n\n   \\alpha = \\beta\n\n.. math::\n   :label: hithere\n   :nowrap:\n\n   E &= mc^2\\\\\n   F &= \\pi E\n\n   F &= \\gamma \\alpha^2\n\nAll done.\n\nDefault-Role\n============\n\nTry changing the default role to a few different things.\n\n.. default-role:: math\n\nDoesn't Break Title Parsing\n---------------------------\n\nInline math: `E=mc^2` or :math:`E=mc^2` or `E=mc^2`:math:.\nOther roles: :sup:`super`, `sub`:sub:.\n\n.. math::\n    \\alpha = beta\n\n    E = mc^2\n\n.. default-role:: sup\n\nSome `of` these :sup:`words` are in `superscript`:sup:.\n\nReset default-role to the default default.\n\n.. default-role::\n\nAnd now `some-invalid-string-3231231` is nonsense.\n\n.. role:: html(raw)\n   :format: html\n\nAnd now with :html:`<b>inline</b> <span id=\"test\">HTML</span>`.\n\n.. role:: haskell(code)\n   :language: haskell\n\nAnd some inline haskell :haskell:`fmap id [1,2..10]`.\n\n.. role:: indirect(code)\n\n.. role:: py(indirect)\n   :language: python\n\nIndirect python role :py:`[x*x for x in [1,2,3,4,5]]`.\n\n.. role:: different-indirect(code)\n   :language: c\n\n.. role:: c(different-indirect)\n\nDifferent indirect C :c:`int x = 15;`.\n\nLiteral symbols\n---------------\n\n2*2 = 4*1\n"
  },
  {
    "path": "test/rtf/accent.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"le\"\n      , Space\n      , Str \"caf\\233\"\n      , Space\n      , Str \"o\\249\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"ne\"\n      , Space\n      , Str \"fume\"\n      , Space\n      , Str \"pas\"\n      ]\n  ]\n"
  },
  {
    "path": "test/rtf/accent.rtf",
    "content": "{\\rtf1\\ansi\n{ le caf\\'e9 o\\'f9 on ne fume pas }\n}\n"
  },
  {
    "path": "test/rtf/bookmark.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Span ( \"bookmark_1\" , [] , [] ) [ Str \"Bookmark_1\" ] ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"click\" , Space , Str \"me\" ]\n          ( \"#bookmark_1\" , \"\" )\n      ]\n  ]\n"
  },
  {
    "path": "test/rtf/bookmark.rtf",
    "content": "{\\rtf1\\ansi\n\\pard\n{\\*\\bkmkstart bookmark_1}Bookmark_1{\\*\\bkmkend bookmark_1}\n\\par\n\\pard\n{\\field{\\*\\fldinst { HYPERLINK  \\\\l \"bookmark_1\" }}{\\fldrslt{click me}}}\n\\par\n}\n"
  },
  {
    "path": "test/rtf/footnote.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"Mead's\"\n      , Space\n      , Str \"landmark\"\n      , Space\n      , Str \"study\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"been\"\n      , Space\n      , Str \"amply\"\n      , Space\n      , Str \"annotated.\"\n      , Note\n          [ Para\n              [ Str \"See\"\n              , Space\n              , Str \"Sahlins,\"\n              , Space\n              , Str \"Bateson,\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"Geertz\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"a\"\n              , Space\n              , Str \"complete\"\n              , Space\n              , Str \"bibliography.\"\n              ]\n          ]\n      , Space\n      , Str \"It\"\n      , Space\n      , Str \"was\"\n      , Space\n      , Str \"her\"\n      , Space\n      , Str \"work\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"America\"\n      , Space\n      , Str \"during\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"Second\"\n      , Space\n      , Str \"World\"\n      , Space\n      , Str \"War,\"\n      , Space\n      , Str \"however,\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"forms\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"basis\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"paper.\"\n      , Space\n      , Str \"As\"\n      , Space\n      , Str \"others\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"noted,\"\n      , Note\n          [ Para\n              [ Str \"A\"\n              , Space\n              , Str \"complete\"\n              , Space\n              , Str \"bibliography\"\n              , Space\n              , Str \"will\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"found\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"end\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"chapter.\"\n              ]\n          ]\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"period\"\n      , Space\n      , Str \"was\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"turning\"\n      , Space\n      , Str \"point\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"Margaret\"\n      , Space\n      , Str \"Mead.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/rtf/footnote.rtf",
    "content": "{\\rtf1\\ansi\n\\ftnbj\\ftnrestart \\sectd \\linemod0\\linex0\\endnhere \\pard\\plain\n\\ri1170 \\fs20 {\\pu6 Mead's landmark study has been amply annotated.\\chftn\n{\\footnote \\pard\\plain \\s246 \\fs20 {\\up6\\chftn }\nSee Sahlins, Bateson, and Geertz for a complete bibliography.} It was \nher work in America during the Second World War, however, that forms \nthe basis for the paper. As others have noted,\\chftn\n{\\footnote \\pard\\plain \\s246 \\fs20 {\\up6\\chftn}\nA complete bibliography will be found at the end of this chapter.} \nthis period was a turning point for Margaret Mead.}\n\\par}\n"
  },
  {
    "path": "test/rtf/formatting.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"operator\"\n            , MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"FORMATTING.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"hidden:\"\n      , Space\n      , Str \".\"\n      ]\n  , Para [ SmallCaps [ Str \"Small\" , Space , Str \"Caps\" ] ]\n  , Para [ Strong [ Str \"bold\" ] ]\n  , Para [ Emph [ Str \"italics\" ] ]\n  , Para\n      [ Strong\n          [ Str \"bold\"\n          , Space\n          , Emph [ Str \"and\" , Space , Str \"italics\" ]\n          ]\n      ]\n  , Para [ Underline [ Str \"underlined\" ] ]\n  , Para [ Strikeout [ Str \"strikeout\" ] ]\n  , Para [ Str \"x\" , Superscript [ Str \"superscript\" ] ]\n  , Para [ Str \"x\" , Subscript [ Str \"subscript\" ] ]\n  ]\n"
  },
  {
    "path": "test/rtf/formatting.rtf",
    "content": "{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1\\adeff31507\\deff0\\stshfdbch31505\\stshfloch31506\\stshfhich31506\\stshfbi31507\\deflang1033\\deflangfe1033\\themelang1033\\themelangfe0\\themelangcs0{\\fonttbl{\\f0\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f4\\fbidi \\fnil\\fcharset0\\fprq2{\\*\\panose 00000000000000000000}Helvetica;}\r\n{\\f34\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02040503050406030204}Cambria Math;}{\\flomajor\\f31500\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\r\n{\\fdbmajor\\f31501\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fhimajor\\f31502\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0302020204030204}Calibri Light;}\r\n{\\fbimajor\\f31503\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\flominor\\f31504\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\r\n{\\fdbminor\\f31505\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fhiminor\\f31506\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0502020204030204}Calibri;}\r\n{\\fbiminor\\f31507\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f1068\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\f1069\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\r\n{\\f1071\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\f1072\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\f1073\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\f1074\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\f1075\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\f1076\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\f1108\\fbidi \\fnil\\fcharset238\\fprq2 Helvetica CE;}\r\n{\\f1109\\fbidi \\fnil\\fcharset204\\fprq2 Helvetica Cyr;}{\\f1111\\fbidi \\fnil\\fcharset161\\fprq2 Helvetica Greek;}{\\f1112\\fbidi \\fnil\\fcharset162\\fprq2 Helvetica Tur;}{\\f1115\\fbidi \\fnil\\fcharset186\\fprq2 Helvetica Baltic;}\r\n{\\f1116\\fbidi \\fnil\\fcharset163\\fprq2 Helvetica (Vietnamese);}{\\f1408\\fbidi \\froman\\fcharset238\\fprq2 Cambria Math CE;}{\\f1409\\fbidi \\froman\\fcharset204\\fprq2 Cambria Math Cyr;}{\\f1411\\fbidi \\froman\\fcharset161\\fprq2 Cambria Math Greek;}\r\n{\\f1412\\fbidi \\froman\\fcharset162\\fprq2 Cambria Math Tur;}{\\f1415\\fbidi \\froman\\fcharset186\\fprq2 Cambria Math Baltic;}{\\f1416\\fbidi \\froman\\fcharset163\\fprq2 Cambria Math (Vietnamese);}\r\n{\\flomajor\\f31508\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\flomajor\\f31509\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\flomajor\\f31511\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\r\n{\\flomajor\\f31512\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\flomajor\\f31513\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\flomajor\\f31514\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\r\n{\\flomajor\\f31515\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\flomajor\\f31516\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fdbmajor\\f31518\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\r\n{\\fdbmajor\\f31519\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fdbmajor\\f31521\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fdbmajor\\f31522\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\r\n{\\fdbmajor\\f31523\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fdbmajor\\f31524\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fdbmajor\\f31525\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\r\n{\\fdbmajor\\f31526\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fhimajor\\f31528\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri Light CE;}{\\fhimajor\\f31529\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Light Cyr;}\r\n{\\fhimajor\\f31531\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Light Greek;}{\\fhimajor\\f31532\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Light Tur;}{\\fhimajor\\f31533\\fbidi \\fswiss\\fcharset177\\fprq2 Calibri Light (Hebrew);}\r\n{\\fhimajor\\f31534\\fbidi \\fswiss\\fcharset178\\fprq2 Calibri Light (Arabic);}{\\fhimajor\\f31535\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Light Baltic;}{\\fhimajor\\f31536\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri Light (Vietnamese);}\r\n{\\fbimajor\\f31538\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fbimajor\\f31539\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fbimajor\\f31541\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\r\n{\\fbimajor\\f31542\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fbimajor\\f31543\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fbimajor\\f31544\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\r\n{\\fbimajor\\f31545\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fbimajor\\f31546\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\flominor\\f31548\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\r\n{\\flominor\\f31549\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\flominor\\f31551\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\flominor\\f31552\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\r\n{\\flominor\\f31553\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\flominor\\f31554\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\flominor\\f31555\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\r\n{\\flominor\\f31556\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fdbminor\\f31558\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fdbminor\\f31559\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\r\n{\\fdbminor\\f31561\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fdbminor\\f31562\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fdbminor\\f31563\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\fdbminor\\f31564\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fdbminor\\f31565\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fdbminor\\f31566\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}\r\n{\\fhiminor\\f31568\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri CE;}{\\fhiminor\\f31569\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Cyr;}{\\fhiminor\\f31571\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Greek;}{\\fhiminor\\f31572\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Tur;}\r\n{\\fhiminor\\f31575\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Baltic;}{\\fbiminor\\f31578\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fbiminor\\f31579\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\r\n{\\fbiminor\\f31581\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fbiminor\\f31582\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fbiminor\\f31583\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\fbiminor\\f31584\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fbiminor\\f31585\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fbiminor\\f31586\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}}\r\n{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0;\r\n\\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;\\red0\\green0\\blue0;\\red0\\green0\\blue0;}{\\*\\defchp \\fs24\\loch\\af31506\\hich\\af31506\\dbch\\af31505 }{\\*\\defpap \r\n\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 }\\noqfpromote {\\stylesheet{\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31507\\afs24\\alang1025 \\ltrch\\fcs0 \r\n\\fs24\\lang1033\\langfe1033\\loch\\f31506\\hich\\af31506\\dbch\\af31505\\cgrid\\langnp1033\\langfenp1033 \\snext0 \\sqformat \\spriority0 Normal;}{\\*\\cs10 \\additive \\ssemihidden \\sunhideused \\spriority1 Default Paragraph Font;}{\\*\r\n\\ts11\\tsrowd\\trftsWidthB3\\trpaddl108\\trpaddr108\\trpaddfl3\\trpaddft3\\trpaddfb3\\trpaddfr3\\tblind0\\tblindtype3\\tsvertalt\\tsbrdrt\\tsbrdrl\\tsbrdrb\\tsbrdrr\\tsbrdrdgl\\tsbrdrdgr\\tsbrdrh\\tsbrdrv \r\n\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31507\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\lang1033\\langfe1033\\loch\\f31506\\hich\\af31506\\dbch\\af31505\\cgrid\\langnp1033\\langfenp1033 \r\n\\snext11 \\ssemihidden \\sunhideused Normal Table;}}{\\*\\rsidtbl \\rsid2168431\\rsid14113975}{\\mmathPr\\mmathFont34\\mbrkBin0\\mbrkBinSub0\\msmallFrac0\\mdispDef1\\mlMargin0\\mrMargin0\\mdefJc1\\mwrapIndent1440\\mintLim0\\mnaryLim1}{\\info{\\operator John MacFarlane}\r\n{\\creatim\\yr2021\\mo8\\dy4\\hr17\\min1}{\\revtim\\yr2021\\mo8\\dy4\\hr17\\min2}{\\version2}{\\edmins1}{\\nofpages1}{\\nofwords21}{\\nofchars120}{\\nofcharsws140}{\\vern6543}}{\\*\\xmlnstbl {\\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\r\n\\paperw12240\\paperh15840\\margl1440\\margr1440\\margt1440\\margb1440\\gutter0\\ltrsect \r\n\\widowctrl\\ftnbj\\aenddoc\\trackmoves0\\trackformatting1\\donotembedsysfont0\\relyonvml0\\donotembedlingdata1\\grfdocevents0\\validatexml0\\showplaceholdtext0\\ignoremixedcontent0\\saveinvalidxml0\\showxmlerrors0\\horzdoc\\dghspace120\\dgvspace120\\dghorigin1701\r\n\\dgvorigin1984\\dghshow0\\dgvshow3\\jcompress\\viewkind1\\viewscale100\\rsidroot2168431 \\fet0{\\*\\wgrffmtfilter 2450}\\ilfomacatclnup0\\ltrpar \\sectd \\ltrsect\\linex0\\sectdefaultcl\\sftnbj {\\*\\pnseclvl1\\pnucrm\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl2\r\n\\pnucltr\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl3\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl4\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxta )}}{\\*\\pnseclvl5\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl6\r\n\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl7\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl8\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl9\\pnlcrm\\pnstart1\\pnindent720\\pnhang \r\n{\\pntxtb (}{\\pntxta )}}\\pard\\plain \\ltrpar\\ql \\li0\\ri0\\nowidctlpar\\tx720\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\tx6480\\tx7200\\tx7920\\tx8640\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31507\\afs24\\alang1025 \\ltrch\\fcs0 \r\n\\fs24\\lang1033\\langfe1033\\loch\\af31506\\hich\\af31506\\dbch\\af31505\\cgrid\\langnp1033\\langfenp1033 {\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 This is a test of }{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \r\n\\caps\\f4\\insrsid14113975\\charrsid2168431 \\hich\\af4\\dbch\\af31505\\loch\\f4 formatting}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 .}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid2168431 \\hich\\af4\\dbch\\af31505\\loch\\f4   This is hidden: }{\\rtlch\\fcs1 \\af4 \r\n\\ltrch\\fcs0 \\v\\f4\\insrsid2168431\\charrsid2168431 \\hich\\af4\\dbch\\af31505\\loch\\f4 secret}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid2168431 .}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par }{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\scaps\\f4\\insrsid14113975\\charrsid2168431 \\hich\\af4\\dbch\\af31505\\loch\\f4 Small Caps\r\n\\par }{\\rtlch\\fcs1 \\ab\\af4 \\ltrch\\fcs0 \\b\\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 bold}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par }{\\rtlch\\fcs1 \\ai\\af4 \\ltrch\\fcs0 \\i\\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 italics}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par }{\\rtlch\\fcs1 \\ab\\af4 \\ltrch\\fcs0 \\b\\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 bold }{\\rtlch\\fcs1 \\ab\\ai\\af4 \\ltrch\\fcs0 \\b\\i\\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 and italics}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par }{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\ul\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 underlined}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par }{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\strike\\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 strikeout\r\n\\par }{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 x}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\super\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 superscript}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par \\hich\\af4\\dbch\\af31505\\loch\\f4 x}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\sub\\insrsid14113975 \\hich\\af4\\dbch\\af31505\\loch\\f4 subscript}{\\rtlch\\fcs1 \\af4 \\ltrch\\fcs0 \\f4\\insrsid14113975 \r\n\\par }{\\*\\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a\r\n9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad\r\n5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6\r\nb01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0\r\n0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6\r\na7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f\r\nc7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512\r\n0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462\r\na1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865\r\n6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b\r\n4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b\r\n4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b6f4679893070000c9200000160000007468656d652f7468656d652f\r\n7468656d65312e786d6cec59cd8b1bc915bf07f23f347d97f5d5ad8fc1f2a24fcfda33b6b164873dd648a5eef2547789aad28cc56208de532e81c026e49085bd\r\ned21842cecc22eb9e48f31d8249b3f22afaa5bdd5552c99e191c3061463074977eefd5afde7bf5de53d5ddcf5e26d4bbc05c1096f6fcfa9d9aefe174ce16248d\r\n7afeb3d9a4d2f13d2151ba4094a5b8e76fb0f03fbbf7eb5fdd454732c609f6403e1547a8e7c752ae8eaa5531876124eeb0154ee1bb25e30992f0caa3ea82a34b\r\nd09bd06aa3566b55134452df4b51026a1f2f97648ebd9952e9dfdb2a1f53784da5500373caa74a35b6243476715e5708b11143cabd0b447b3eccb3609733fc52\r\nfa1e4542c2173dbfa6fffceabdbb5574940b517940d6909be8bf5c2e17589c37f49c3c3a2b260d823068f50bfd1a40e53e6edc1eb7c6ad429f06a0f91c569a71\r\nb175b61bc320c71aa0ecd1a17bd41e35eb16ded0dfdce3dc0fd5c7c26b50a63fd8c34f2643b0a285d7a00c1feee1c3417730b2f56b50866fede1dbb5fe28685b\r\nfa3528a6243ddf43d7c25673b85d6d0159327aec8477c360d26ee4ca4b144443115d6a8a254be5a1584bd00bc6270050408a24493db959e1259a43140f112567\r\n9c7827248a21f056286502866b8ddaa4d684ffea13e827ed5174849121ad780113b137a4f87862cec94af6fc07a0d537206f7ffef9cdeb1fdfbcfee9cd575fbd\r\n79fdf77c6eadca923b466964cafdf2dd1ffef3cd6fbd7ffff0ed2f5fff319b7a172f4cfcbbbffdeedd3ffef93ef5b0e2d2146ffff4fdbb1fbf7ffbe7dfffebaf\r\n5f3bb4f7393a33e1339260e13dc297de5396c0021dfcf119bf9ec42c46c494e8a791402952b338f48f656ca11f6d10450edc00db767cce21d5b880f7d72f2cc2\r\nd398af2571687c182716f094313a60dc6985876a2ec3ccb3751ab927e76b13f714a10bd7dc43945a5e1eaf579063894be530c616cd2714a5124538c5d253dfb1\r\n738c1dabfb8210cbaea764ce99604be97d41bc01224e93ccc899154da5d03149c02f1b1741f0b7659bd3e7de8051d7aa47f8c246c2de40d4417e86a965c6fb68\r\n2d51e252394309350d7e8264ec2239ddf0b9891b0b099e8e3065de78818570c93ce6b05ec3e90f21cdb8dd7e4a37898de4929cbb749e20c64ce4889d0f6394ac\r\n5cd829496313fbb938871045de13265df05366ef10f50e7e40e941773f27d872f787b3c133c8b026a53240d4376beef0e57dccacf89d6ee8126157aae9f3c44a\r\nb17d4e9cd131584756689f604cd1255a60ec3dfbdcc160c05696cd4bd20f62c82ac7d815580f901dabea3dc5027a25d5dcece7c91322ac909de2881de073bad9\r\n493c1b9426881fd2fc08bc6eda7c0ca52e7105c0633a3f37818f08f480102f4ea33c16a0c308ee835a9fc4c82a60ea5db8e375c32dff5d658fc1be7c61d1b8c2\r\nbe04197c6d1948eca6cc7b6d3343d49aa00c9819822ec3956e41c4727f29a28aab165b3be596f6a62ddd00dd91d5f42424fd6007b4d3fb84ffbbde073a8cb77f\r\nf9c6b10f3e4ebfe3566c25ab6b763a8792c9f14e7f7308b7dbd50c195f904fbfa919a175fa04431dd9cf58b73dcd6d4fe3ffdff73487f6f36d2773a8dfb8ed64\r\n7ce8306e3b99fc70e5e3743265f3027d8d3af0c80e7af4b14f72f0d46749289dca0dc527421ffc08f83db398c0a092d3279eb838055cc5f0a8ca1c4c60e1228e\r\nb48cc799fc0d91f134462b381daafb4a492472d591f0564cc0a1911e76ea5678ba4e4ed9223becacd7d5c16656590592e5782d2cc6e1a04a66e856bb3cc02bd4\r\n6bb6913e68dd1250b2d721614c6693683a48b4b783ca48fa58178ce620a157f65158741d2c3a4afdd6557b2c805ae115f8c1edc1cff49e1f06200242701e07cd\r\nf942f92973f5d6bbda991fd3d3878c69450034d8db08283ddd555c0f2e4fad2e0bb52b78da2261849b4d425b46377822869fc17974aad1abd0b8aeafbba54b2d\r\n7aca147a3e08ad9246bbf33e1637f535c8ede6069a9a9982a6de65cf6f35430899395af5fc251c1ac363b282d811ea3717a211dcbccc25cf36fc4d32cb8a0b39\r\n4222ce0cae934e960d122231f728497abe5a7ee1069aea1ca2b9d51b90103e59725d482b9f1a3970baed64bc5ce2b934dd6e8c284b67af90e1b35ce1fc568bdf\r\n1cac24d91adc3d8d1797de195df3a708422c6cd795011744c0dd413db3e682c0655891c8caf8db294c79da356fa3740c65e388ae62945714339967709dca0b3a\r\nfaadb081f196af190c6a98242f8467912ab0a651ad6a5a548d8cc3c1aafb6121653923699635d3ca2aaa6abab39835c3b60cecd8f26645de60b53531e434b3c2\r\n67a97b37e576b7b96ea74f28aa0418bcb09fa3ea5ea12018d4cac92c6a8af17e1a56393b1fb56bc776811fa07695226164fdd656ed8edd8a1ae19c0e066f54f9\r\n416e376a6168b9ed2bb5a5f5adb979b1cdce5e40f2184197bba6526857c2c92e47d0104d754f92a50dd8222f65be35e0c95b73d2f3bfac85fd60d80887955a27\r\n1c57826650ab74c27eb3d20fc3667d1cd66ba341e31514161927f530bbb19fc00506dde4f7f67a7cefee3ed9ded1dc99b3a4caf4dd7c5513d777f7f5c6e1bb7b\r\n8f40d2f9b2d598749bdd41abd26df627956034e854bac3d6a0326a0ddba3c9681876ba9357be77a1c141bf390c5ae34ea5551f0e2b41aba6e877ba9576d068f4\r\n8376bf330efaaff23606569ea58fdc16605ecdebde7f010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d65\r\n2f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d36\r\n3f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e\r\n3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d985\r\n0528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000000000\r\n0000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000\r\n000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019020000\r\n7468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100b6f4679893070000c92000001600000000000000\r\n000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000\r\n000000000000000000009d0a00007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000980b00000000}\r\n{\\*\\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d\r\n617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169\r\n6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363\r\n656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}\r\n{\\*\\latentstyles\\lsdstimax376\\lsdlockeddef0\\lsdsemihiddendef0\\lsdunhideuseddef0\\lsdqformatdef0\\lsdprioritydef99{\\lsdlockedexcept \\lsdqformat1 \\lsdpriority0 \\lsdlocked0 Normal;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 1;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 4;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 7;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 9;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 1;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 5;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 9;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 6;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 9;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal Indent;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footnote text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 header;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footer;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index heading;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority35 \\lsdlocked0 caption;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 table of figures;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 envelope address;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 envelope return;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footnote reference;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation reference;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 line number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 page number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 endnote reference;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 endnote text;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 table of authorities;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 macro;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 toa heading;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 5;\\lsdqformat1 \\lsdpriority10 \\lsdlocked0 Title;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Closing;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Signature;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority1 \\lsdlocked0 Default Paragraph Font;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 4;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Message Header;\\lsdqformat1 \\lsdpriority11 \\lsdlocked0 Subtitle;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Salutation;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Date;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text First Indent;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text First Indent 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Note Heading;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Block Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Hyperlink;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 FollowedHyperlink;\\lsdqformat1 \\lsdpriority22 \\lsdlocked0 Strong;\r\n\\lsdqformat1 \\lsdpriority20 \\lsdlocked0 Emphasis;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Document Map;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Plain Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 E-mail Signature;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Top of Form;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Bottom of Form;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal (Web);\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Acronym;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Address;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Cite;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Code;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Definition;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Keyboard;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Preformatted;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Sample;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Typewriter;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Variable;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal Table;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation subject;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 No List;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Simple 1;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Simple 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Simple 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 2;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Colorful 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Colorful 2;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Colorful 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 2;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 6;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 2;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 6;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table 3D effects 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table 3D effects 2;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table 3D effects 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Contemporary;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Elegant;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Professional;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Subtle 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Subtle 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Web 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Web 2;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Web 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Balloon Text;\\lsdpriority39 \\lsdlocked0 Table Grid;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Theme;\\lsdsemihidden1 \\lsdlocked0 Placeholder Text;\r\n\\lsdqformat1 \\lsdpriority1 \\lsdlocked0 No Spacing;\\lsdpriority60 \\lsdlocked0 Light Shading;\\lsdpriority61 \\lsdlocked0 Light List;\\lsdpriority62 \\lsdlocked0 Light Grid;\\lsdpriority63 \\lsdlocked0 Medium Shading 1;\\lsdpriority64 \\lsdlocked0 Medium Shading 2;\r\n\\lsdpriority65 \\lsdlocked0 Medium List 1;\\lsdpriority66 \\lsdlocked0 Medium List 2;\\lsdpriority67 \\lsdlocked0 Medium Grid 1;\\lsdpriority68 \\lsdlocked0 Medium Grid 2;\\lsdpriority69 \\lsdlocked0 Medium Grid 3;\\lsdpriority70 \\lsdlocked0 Dark List;\r\n\\lsdpriority71 \\lsdlocked0 Colorful Shading;\\lsdpriority72 \\lsdlocked0 Colorful List;\\lsdpriority73 \\lsdlocked0 Colorful Grid;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 1;\\lsdpriority61 \\lsdlocked0 Light List Accent 1;\r\n\\lsdpriority62 \\lsdlocked0 Light Grid Accent 1;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 1;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 1;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 1;\\lsdsemihidden1 \\lsdlocked0 Revision;\r\n\\lsdqformat1 \\lsdpriority34 \\lsdlocked0 List Paragraph;\\lsdqformat1 \\lsdpriority29 \\lsdlocked0 Quote;\\lsdqformat1 \\lsdpriority30 \\lsdlocked0 Intense Quote;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 1;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 1;\r\n\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 1;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 1;\\lsdpriority70 \\lsdlocked0 Dark List Accent 1;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 1;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 1;\r\n\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 1;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 2;\\lsdpriority61 \\lsdlocked0 Light List Accent 2;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 2;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 2;\r\n\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 2;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 2;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 2;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 2;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 2;\r\n\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 2;\\lsdpriority70 \\lsdlocked0 Dark List Accent 2;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 2;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 2;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 2;\r\n\\lsdpriority60 \\lsdlocked0 Light Shading Accent 3;\\lsdpriority61 \\lsdlocked0 Light List Accent 3;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 3;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 3;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 3;\r\n\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 3;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 3;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 3;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 3;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 3;\r\n\\lsdpriority70 \\lsdlocked0 Dark List Accent 3;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 3;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 3;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 3;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 4;\r\n\\lsdpriority61 \\lsdlocked0 Light List Accent 4;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 4;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 4;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 4;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 4;\r\n\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 4;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 4;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 4;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 4;\\lsdpriority70 \\lsdlocked0 Dark List Accent 4;\r\n\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 4;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 4;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 4;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 5;\\lsdpriority61 \\lsdlocked0 Light List Accent 5;\r\n\\lsdpriority62 \\lsdlocked0 Light Grid Accent 5;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 5;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 5;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 5;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 5;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 5;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 5;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 5;\\lsdpriority70 \\lsdlocked0 Dark List Accent 5;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 5;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 5;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 5;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 6;\\lsdpriority61 \\lsdlocked0 Light List Accent 6;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 6;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 6;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 6;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 6;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 6;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 6;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 6;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 6;\\lsdpriority70 \\lsdlocked0 Dark List Accent 6;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 6;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 6;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 6;\\lsdqformat1 \\lsdpriority19 \\lsdlocked0 Subtle Emphasis;\\lsdqformat1 \\lsdpriority21 \\lsdlocked0 Intense Emphasis;\r\n\\lsdqformat1 \\lsdpriority31 \\lsdlocked0 Subtle Reference;\\lsdqformat1 \\lsdpriority32 \\lsdlocked0 Intense Reference;\\lsdqformat1 \\lsdpriority33 \\lsdlocked0 Book Title;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority37 \\lsdlocked0 Bibliography;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority39 \\lsdlocked0 TOC Heading;\\lsdpriority41 \\lsdlocked0 Plain Table 1;\\lsdpriority42 \\lsdlocked0 Plain Table 2;\\lsdpriority43 \\lsdlocked0 Plain Table 3;\\lsdpriority44 \\lsdlocked0 Plain Table 4;\r\n\\lsdpriority45 \\lsdlocked0 Plain Table 5;\\lsdpriority40 \\lsdlocked0 Grid Table Light;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light;\\lsdpriority47 \\lsdlocked0 Grid Table 2;\\lsdpriority48 \\lsdlocked0 Grid Table 3;\\lsdpriority49 \\lsdlocked0 Grid Table 4;\r\n\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 1;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 1;\r\n\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 1;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 1;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 1;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 1;\r\n\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 1;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 2;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 2;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 2;\r\n\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 2;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 2;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 2;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 2;\r\n\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 3;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 3;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 3;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 3;\r\n\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 3;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 3;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 3;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 4;\r\n\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 4;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 4;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 4;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 4;\r\n\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 4;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 4;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 5;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 5;\r\n\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 5;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 5;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 5;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 5;\r\n\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 5;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 6;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 6;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 6;\r\n\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 6;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 6;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 6;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 6;\r\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light;\\lsdpriority47 \\lsdlocked0 List Table 2;\\lsdpriority48 \\lsdlocked0 List Table 3;\\lsdpriority49 \\lsdlocked0 List Table 4;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark;\r\n\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 1;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 1;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 1;\r\n\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 1;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 1;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 1;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 1;\r\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 2;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 2;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 2;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 2;\r\n\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 2;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 2;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 2;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 3;\r\n\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 3;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 3;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 3;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 3;\r\n\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 3;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 3;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 4;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 4;\r\n\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 4;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 4;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 4;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 4;\r\n\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 4;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 5;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 5;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 5;\r\n\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 5;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 5;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 5;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 5;\r\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 6;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 6;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 6;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 6;\r\n\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 6;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 6;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Mention;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Smart Hyperlink;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Hashtag;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Unresolved Mention;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Smart Link;}}{\\*\\datastore }}"
  },
  {
    "path": "test/rtf/heading.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header\n      1 ( \"\" , [] , [] ) [ Str \"Heading\" , Space , Str \"1\" ]\n  , Header\n      2 ( \"\" , [] , [] ) [ Str \"Heading\" , Space , Str \"2\" ]\n  , Header\n      3 ( \"\" , [] , [] ) [ Str \"Heading\" , Space , Str \"3\" ]\n  , Para [ Str \"Paragraph\" ]\n  ]\n"
  },
  {
    "path": "test/rtf/heading.rtf",
    "content": "{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1\\adeff31507\\deff0\\stshfdbch31506\\stshfloch31506\\stshfhich31506\\stshfbi31507\\deflang1033\\deflangfe1033\\themelang1033\\themelangfe0\\themelangcs0{\\fonttbl{\\f0\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f34\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02040503050406030204}Cambria Math;}\n{\\f37\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0502020204030204}Calibri;}{\\f38\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0302020204030204}Calibri Light;}{\\flomajor\\f31500\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n{\\fdbmajor\\f31501\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fhimajor\\f31502\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0302020204030204}Calibri Light;}\n{\\fbimajor\\f31503\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\flominor\\f31504\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n{\\fdbminor\\f31505\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fhiminor\\f31506\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0502020204030204}Calibri;}\n{\\fbiminor\\f31507\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f44\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\f45\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\n{\\f47\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\f48\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\f49\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\f50\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\n{\\f51\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\f52\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\f384\\fbidi \\froman\\fcharset238\\fprq2 Cambria Math CE;}{\\f385\\fbidi \\froman\\fcharset204\\fprq2 Cambria Math Cyr;}\n{\\f387\\fbidi \\froman\\fcharset161\\fprq2 Cambria Math Greek;}{\\f388\\fbidi \\froman\\fcharset162\\fprq2 Cambria Math Tur;}{\\f391\\fbidi \\froman\\fcharset186\\fprq2 Cambria Math Baltic;}{\\f392\\fbidi \\froman\\fcharset163\\fprq2 Cambria Math (Vietnamese);}\n{\\f414\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri CE;}{\\f415\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Cyr;}{\\f417\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Greek;}{\\f418\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Tur;}\n{\\f419\\fbidi \\fswiss\\fcharset177\\fprq2 Calibri (Hebrew);}{\\f420\\fbidi \\fswiss\\fcharset178\\fprq2 Calibri (Arabic);}{\\f421\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Baltic;}{\\f422\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri (Vietnamese);}\n{\\f424\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri Light CE;}{\\f425\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Light Cyr;}{\\f427\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Light Greek;}{\\f428\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Light Tur;}\n{\\f429\\fbidi \\fswiss\\fcharset177\\fprq2 Calibri Light (Hebrew);}{\\f430\\fbidi \\fswiss\\fcharset178\\fprq2 Calibri Light (Arabic);}{\\f431\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Light Baltic;}{\\f432\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri Light (Vietnamese);}\n{\\flomajor\\f31508\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\flomajor\\f31509\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\flomajor\\f31511\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\n{\\flomajor\\f31512\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\flomajor\\f31513\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\flomajor\\f31514\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\n{\\flomajor\\f31515\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\flomajor\\f31516\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fdbmajor\\f31518\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\n{\\fdbmajor\\f31519\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fdbmajor\\f31521\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fdbmajor\\f31522\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\n{\\fdbmajor\\f31523\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fdbmajor\\f31524\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fdbmajor\\f31525\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\n{\\fdbmajor\\f31526\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fhimajor\\f31528\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri Light CE;}{\\fhimajor\\f31529\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Light Cyr;}\n{\\fhimajor\\f31531\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Light Greek;}{\\fhimajor\\f31532\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Light Tur;}{\\fhimajor\\f31533\\fbidi \\fswiss\\fcharset177\\fprq2 Calibri Light (Hebrew);}\n{\\fhimajor\\f31534\\fbidi \\fswiss\\fcharset178\\fprq2 Calibri Light (Arabic);}{\\fhimajor\\f31535\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Light Baltic;}{\\fhimajor\\f31536\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri Light (Vietnamese);}\n{\\fbimajor\\f31538\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fbimajor\\f31539\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fbimajor\\f31541\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\n{\\fbimajor\\f31542\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fbimajor\\f31543\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fbimajor\\f31544\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\n{\\fbimajor\\f31545\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fbimajor\\f31546\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\flominor\\f31548\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\n{\\flominor\\f31549\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\flominor\\f31551\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\flominor\\f31552\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\n{\\flominor\\f31553\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\flominor\\f31554\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\flominor\\f31555\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\n{\\flominor\\f31556\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fdbminor\\f31558\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fdbminor\\f31559\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\n{\\fdbminor\\f31561\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fdbminor\\f31562\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fdbminor\\f31563\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\n{\\fdbminor\\f31564\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fdbminor\\f31565\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fdbminor\\f31566\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}\n{\\fhiminor\\f31568\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri CE;}{\\fhiminor\\f31569\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Cyr;}{\\fhiminor\\f31571\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Greek;}{\\fhiminor\\f31572\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Tur;}\n{\\fhiminor\\f31573\\fbidi \\fswiss\\fcharset177\\fprq2 Calibri (Hebrew);}{\\fhiminor\\f31574\\fbidi \\fswiss\\fcharset178\\fprq2 Calibri (Arabic);}{\\fhiminor\\f31575\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Baltic;}\n{\\fhiminor\\f31576\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri (Vietnamese);}{\\fbiminor\\f31578\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fbiminor\\f31579\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\n{\\fbiminor\\f31581\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fbiminor\\f31582\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fbiminor\\f31583\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\n{\\fbiminor\\f31584\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fbiminor\\f31585\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fbiminor\\f31586\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}}\n{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0;\n\\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;\\red0\\green0\\blue0;\\red0\\green0\\blue0;\\caccentone\\ctint255\\cshade191\\red47\\green84\\blue150;\n\\caccentone\\ctint255\\cshade127\\red31\\green55\\blue99;}{\\*\\defchp \\f31506\\fs22 }{\\*\\defpap \\ql \\li0\\ri0\\sa160\\sl259\\slmult1\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 }\\noqfpromote {\\stylesheet{\\ql \\li0\\ri0\\sa160\\sl259\\slmult1\n\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31507\\afs22\\alang1025 \\ltrch\\fcs0 \\f31506\\fs22\\lang1033\\langfe1033\\cgrid\\langnp1033\\langfenp1033 \\snext0 \\sqformat \\spriority0 Normal;}{\n\\s1\\ql \\li0\\ri0\\sb240\\sl259\\slmult1\\keep\\keepn\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\outlinelevel0\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31503\\afs32\\alang1025 \\ltrch\\fcs0 \n\\fs32\\cf19\\lang1033\\langfe1033\\loch\\f31502\\hich\\af31502\\dbch\\af31501\\cgrid\\langnp1033\\langfenp1033 \\sbasedon0 \\snext0 \\slink15 \\sqformat \\spriority9 \\styrsid2496039 heading 1;}{\\s2\\ql \\li0\\ri0\\sb40\\sl259\\slmult1\n\\keep\\keepn\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\outlinelevel1\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31503\\afs26\\alang1025 \\ltrch\\fcs0\\b\\fs26\\cf19\\lang1033\\langfe1033\\loch\\f31502\\hich\\af31502\\dbch\\af31501\\cgrid\\langnp1033\\langfenp1033 \n\\sbasedon0 \\snext0 \\slink16 \\sunhideused \\sqformat \\spriority9 \\styrsid2496039 heading 2;}{\\s3\\ql \\li0\\ri0\\sb40\\sl259\\slmult1\\keep\\keepn\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\outlinelevel2\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \n\\af31503\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\cf20\\lang1033\\langfe1033\\loch\\f31502\\hich\\af31502\\dbch\\af31501\\cgrid\\langnp1033\\langfenp1033 \\sbasedon0 \\snext0 \\slink17 \\sunhideused \\sqformat \\spriority9 \\styrsid2496039 heading 3;}{\\*\\cs10 \\additive \n\\ssemihidden \\sunhideused \\spriority1 Default Paragraph Font;}{\\*\\ts11\\tsrowd\\trftsWidthB3\\trpaddl108\\trpaddr108\\trpaddfl3\\trpaddft3\\trpaddfb3\\trpaddfr3\\tblind0\\tblindtype3\\tsvertalt\\tsbrdrt\\tsbrdrl\\tsbrdrb\\tsbrdrr\\tsbrdrdgl\\tsbrdrdgr\\tsbrdrh\\tsbrdrv \n\\ql \\li0\\ri0\\sa160\\sl259\\slmult1\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31507\\afs22\\alang1025 \\ltrch\\fcs0 \\f31506\\fs22\\lang1033\\langfe1033\\cgrid\\langnp1033\\langfenp1033 \\snext11 \\ssemihidden \\sunhideused \nNormal Table;}{\\*\\cs15 \\additive \\rtlch\\fcs1 \\af31503\\afs32 \\ltrch\\fcs0 \\fs32\\cf19\\loch\\f31502\\hich\\af31502\\dbch\\af31501 \\sbasedon10 \\slink1 \\slocked \\spriority9 \\styrsid2496039 Heading 1 Char;}{\\*\\cs16 \\additive \\rtlch\\fcs1 \\af31503\\afs26 \\ltrch\\fcs0 \n\\fs26\\cf19\\loch\\f31502\\hich\\af31502\\dbch\\af31501 \\sbasedon10 \\slink2 \\slocked \\spriority9 \\styrsid2496039 Heading 2 Char;}{\\*\\cs17 \\additive \\rtlch\\fcs1 \\af31503\\afs24 \\ltrch\\fcs0 \\fs24\\cf20\\loch\\f31502\\hich\\af31502\\dbch\\af31501 \n\\sbasedon10 \\slink3 \\slocked \\spriority9 \\styrsid2496039 Heading 3 Char;}}{\\*\\rsidtbl \\rsid1718450\\rsid2496039\\rsid2631807\\rsid4616182\\rsid10489260}{\\mmathPr\\mmathFont34\\mbrkBin0\\mbrkBinSub0\\msmallFrac0\\mdispDef1\\mlMargin0\\mrMargin0\\mdefJc1\n\\mwrapIndent1440\\mintLim0\\mnaryLim1}\n{\\*\\xmlnstbl {\\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\\paperw12240\\paperh15840\\margl1440\\margr1440\\margt1440\\margb1440\\gutter0\\ltrsect \n\\widowctrl\\ftnbj\\aenddoc\\trackmoves0\\trackformatting1\\donotembedsysfont1\\relyonvml0\\donotembedlingdata0\\grfdocevents0\\validatexml1\\showplaceholdtext0\\ignoremixedcontent0\\saveinvalidxml0\\showxmlerrors1\\noxlattoyen\n\\expshrtn\\noultrlspc\\dntblnsbdb\\nospaceforul\\formshade\\horzdoc\\dgmargin\\dghspace180\\dgvspace180\\dghorigin1440\\dgvorigin1440\\dghshow1\\dgvshow1\n\\jexpand\\viewkind1\\viewscale100\\pgbrdrhead\\pgbrdrfoot\\splytwnine\\ftnlytwnine\\htmautsp\\nolnhtadjtbl\\useltbaln\\alntblind\\lytcalctblwd\\lyttblrtgr\\lnbrkrule\\nobrkwrptbl\\snaptogridincell\\allowfieldendsel\\wrppunct\n\\asianbrkrule\\rsidroot2496039\\newtblstyruls\\nogrowautofit\\usenormstyforlist\\noindnmbrts\\felnbrelev\\nocxsptable\\indrlsweleven\\noafcnsttbl\\afelev\\utinl\\hwelev\\spltpgpar\\notcvasp\\notbrkcnstfrctbl\\notvatxbx\\krnprsnet\\cachedcolbal \\nouicompat \\fet0\n{\\*\\wgrffmtfilter 2450}\\nofeaturethrottle1\\ilfomacatclnup0\\ltrpar \\sectd \\ltrsect\\linex0\\endnhere\\sectlinegrid360\\sectdefaultcl\\sftnbj {\\*\\pnseclvl1\\pnucrm\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl2\\pnucltr\\pnstart1\\pnindent720\\pnhang \n{\\pntxta .}}{\\*\\pnseclvl3\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl4\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxta )}}{\\*\\pnseclvl5\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl6\\pnlcltr\\pnstart1\\pnindent720\\pnhang \n{\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl7\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl8\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl9\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}\n\\pard\\plain \\ltrpar\\s1\\ql \\li0\\ri0\\sb240\\sl259\\slmult1\\keep\\keepn\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\outlinelevel0\\adjustright\\rin0\\lin0\\itap0\\pararsid2496039 \\rtlch\\fcs1 \\af31503\\afs32\\alang1025 \\ltrch\\fcs0 \n\\fs32\\cf19\\lang1033\\langfe1033\\loch\\af31502\\hich\\af31502\\dbch\\af31501\\cgrid\\langnp1033\\langfenp1033 {\\rtlch\\fcs1 \\af31503 \\ltrch\\fcs0 \\insrsid2496039 \\hich\\af31502\\dbch\\af31501\\loch\\f31502 H\\hich\\af31502\\dbch\\af31501\\loch\\f31502 eading 1}{\\rtlch\\fcs1 \n\\af31503 \\ltrch\\fcs0 \\insrsid2631807 \n\\par }\\pard\\plain \\ltrpar\\s2\\ql \\li0\\ri0\\sb40\\sl259\\slmult1\\keep\\keepn\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\outlinelevel1\\adjustright\\rin0\\lin0\\itap0\\pararsid2496039 \\rtlch\\fcs1 \\af31503\\afs26\\alang1025 \\ltrch\\fcs0 \n\\fs26\\cf19\\lang1033\\langfe1033\\loch\\af31502\\hich\\af31502\\dbch\\af31501\\cgrid\\langnp1033\\langfenp1033 {\\rtlch\\fcs1 \\af31503 \\ltrch\\fcs0 \\insrsid2496039 \\hich\\af31502\\dbch\\af31501\\loch\\f31502 H\\hich\\af31502\\dbch\\af31501\\loch\\f31502 eading }{\\rtlch\\fcs1 \n\\af31503 \\ltrch\\fcs0 \\insrsid2496039 \\hich\\af31502\\dbch\\af31501\\loch\\f31502 2}{\\rtlch\\fcs1 \\af31503 \\ltrch\\fcs0 \\insrsid2496039 \n\\par }\\pard\\plain \\ltrpar\\s3\\ql \\li0\\ri0\\sb40\\sl259\\slmult1\\keep\\keepn\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\outlinelevel2\\adjustright\\rin0\\lin0\\itap0\\pararsid2496039 \\rtlch\\fcs1 \\af31503\\afs24\\alang1025 \\ltrch\\fcs0 \n\\fs24\\cf20\\lang1033\\langfe1033\\loch\\af31502\\hich\\af31502\\dbch\\af31501\\cgrid\\langnp1033\\langfenp1033 {\\rtlch\\fcs1 \\af31503 \\ltrch\\fcs0 \\insrsid2496039 \\hich\\af31502\\dbch\\af31501\\loch\\f31502 H\\hich\\af31502\\dbch\\af31501\\loch\\f31502 eading }{\\rtlch\\fcs1 \n\\af31503 \\ltrch\\fcs0 \\insrsid2496039 \\hich\\af31502\\dbch\\af31501\\loch\\f31502 3}{\\rtlch\\fcs1 \\af31503 \\ltrch\\fcs0 \\insrsid2496039 \n\\par }\\pard\\plain \\ltrpar\\ql \\li0\\ri0\\sa160\\sl259\\slmult1\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af31507\\afs22\\alang1025 \\ltrch\\fcs0 \\f31506\\fs22\\lang1033\\langfe1033\\cgrid\\langnp1033\\langfenp1033 {\\rtlch\\fcs1 \n\\af31507 \\ltrch\\fcs0 \\insrsid2496039 Paragraph\n\\par }{\\*\\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a\n9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad\n5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6\nb01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0\n0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6\na7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f\nc7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512\n0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462\na1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865\n6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b\n4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b\n4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100d3130843c40600008b1a0000160000007468656d652f7468656d652f\n7468656d65312e786d6cec595d8bdb46147d2ff43f08bd3bfe92fcb1c41b6cd9ceb6d94d42eca4e4716c8fadc98e344633de8d0981923c160aa569e943037deb\n43691b48a02fe9afd936a54d217fa17746b63c638fbb9b2585a5640d8b343af7ce997bafce1d4997afdc8fa87384134e58dc708b970aae83e3211b9178d2706f\nf7bbb99aeb7081e211a22cc60d778eb97b65f7c30f2ea31d11e2083b601ff31dd4704321a63bf93c1fc230e297d814c7706dcc920809384d26f951828ec16f44\nf3a542a1928f10895d274611b8bd311e932176fad2a5bbbb74dea1701a0b2e078634e949d7d8b050d8d1615122f89c0734718e106db830cf881df7f17de13a14\n7101171a6e41fdb9f9ddcb79b4b330a2628bad66d7557f0bbb85c1e8b0a4e64c26836c52cff3bd4a33f3af00546ce23ad54ea553c9fc29001a0e61a52917d367\nb514780bac064a0f2dbedbd576b968e035ffe50dce4d5ffe0cbc02a5febd0d7cb71b40140dbc02a5787f03efb7eaadb6e95f81527c65035f2d34db5ed5f0af40\n2125f1e106bae057cac172b51964cce89e155ef7bd6eb5b470be42413564d525a718b3586cabb508dd6349170012489120b123e6533c4643a8e20051324888b3\n4f262114de14c58cc370a154e816caf05ffe3c75a4328a7630d2ac252f60c23786241f870f1332150df763f0ea6a90372f7f7cf3f2b973f2e8c5c9a35f4e1e3f\n3e79f473eac8b0da43f144b77afdfd177f3ffdd4f9ebf977af9f7c65c7731dfffb4f9ffdf6eb977620ac741582575f3ffbe3c5b357df7cfee70f4f2cf0668206\n3abc4f22cc9debf8d8b9c52258980a81c91c0f92b7b3e88788e816cd78c2518ce42c16ff1d111ae8eb73449105d7c26604ef24203136e0d5d93d83702f4c6682\n583c5e0b230378c0186db1c41a856b722e2dccfd593cb14f9ecc74dc2d848e6c73072836f2db994d415b89cd65106283e64d8a62812638c6c291d7d821c696d5\ndd25c488eb0119268cb3b170ee12a7858835247d3230aa6965b44722c8cbdc4610f26dc4e6e08ed362d4b6ea363e32917057206a21dfc7d408e355341328b2b9\neca388ea01df4722b491eccd93a18eeb7001999e60ca9cce08736eb3b991c07ab5a45f0379b1a7fd80ce231399087268f3b98f18d3916d761884289adab03d12\n873af6237e08258a9c9b4cd8e007ccbc43e439e401c55bd37d876023dda7abc16d50569dd2aa40e4955962c9e555cc8cfaedcde91861253520fc869e47243e55\ndcd764ddff6f651d84f4d5b74f2dabbaa882de4c88f58eda5b93f16db875f10e583222175fbbdb6816dfc470bb6c36b0f7d2fd5ebaddffbd746fbb9fdfbd60af\n341ae45b6e15d3adbadab8475bf7ed6342694fcc29dee76aebcea1338dba3028edd4332bce9ee3a6211cca3b192630709304291b2761e21322c25e88a6b0bf2f\nbad2c9842f5c4fb833651cb6fd6ad8ea5be2e92c3a60a3f471b558948fa6a978702456e3053f1b87470d91a22bd5d52358e65eb19da847e5250169fb3624b4c9\n4c12650b89ea725006493d9843d02c24d4cade098bba85454dba5fa66a830550cbb2025b2707365c0dd7f7c0048ce0890a513c92794a53bdccae4ae6bbccf4b6\n601a1500fb886505ac325d975cb72e4fae2e2db53364da20a1959b49424546f5301ea2115e54a71c3d0b8db7cd757d9552839e0c859a0f4a6b45a35afb3716e7\ncd35d8ad6b038d75a5a0b173dc702b651f4a6688a60d770c8ffd70184da176b8dcf2223a8177674391a437fc7994659a70d1463c4c03ae4427558388089c3894\n440d572e3f4b038d9586286ec51208c28525570759b968e420e96692f1788c87424fbb3622239d9e82c2a75a61bdaacccf0f96966c06e9ee85a363674067c92d\n0425e6578b328023c2e1ed4f318de688c0ebcc4cc856f5b7d69816b2abbf4f5435948e233a0dd1a2a3e8629ec295946774d4591603ed6cb16608a8169245231c\n4c6483d5836a74d3ac6ba41cb676ddd38d64e434d15cf54c435564d7b4ab9831c3b20dacc5f27c4d5e63b50c31689adee153e95e97dcfa52ebd6f60959978080\n67f1b374dd3334048dda6a32839a64bc29c352b317a366ef582ef0146a6769129aea57966ed7e296f508eb743078aece0f76eb550b43e3e5be52455a7df7d03f\n4db0c13d108f36bc049e51c1552ae1c343826043d4537b925436e016b92f16b7061c39b38434dc0705bfe905253fc8156a7e27e795bd42aee637cbb9a6ef978b\n1dbf5868b74a0fa1b188302afae937972ebc8aa2f3c5971735bef1f5255abe6dbb3464519ea9af2b79455c7d7d2996b67f7d710888ce834aa95b2fd75b955cbd\ndcece6bc76ab96ab079556ae5d09aaed6e3bf06bf5ee43d7395260af590ebc4aa796ab148320e7550a927ead9eab7aa552d3ab366b1daff970b18d8195a7f2b1\n88058457f1dafd070000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468\n656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969\nbb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38\na38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbaba\nc4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f\n54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72\n656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000190200007468656d652f7468656d652f746865\n6d654d616e616765722e786d6c504b01022d0014000600080000002100d3130843c40600008b1a00001600000000000000000000000000d60200007468656d65\n2f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b0100002700000000000000000000000000ce0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000c90a00000000}\n{\\*\\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d\n617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169\n6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363\n656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}\n{\\*\\latentstyles\\lsdstimax375\\lsdlockeddef0\\lsdsemihiddendef0\\lsdunhideuseddef0\\lsdqformatdef0\\lsdprioritydef99{\\lsdlockedexcept \\lsdqformat1 \\lsdpriority0 \\lsdlocked0 Normal;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 1;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 4;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 7;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 9;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 1;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 5;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 9;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 3;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 6;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 9;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal Indent;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footnote text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 header;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footer;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index heading;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority35 \\lsdlocked0 caption;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 table of figures;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 envelope address;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 envelope return;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footnote reference;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation reference;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 line number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 page number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 endnote reference;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 endnote text;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 table of authorities;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 macro;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 toa heading;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 3;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 3;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 3;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 5;\\lsdqformat1 \\lsdpriority10 \\lsdlocked0 Title;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Closing;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Signature;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority1 \\lsdlocked0 Default Paragraph Font;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 4;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Message Header;\\lsdqformat1 \\lsdpriority11 \\lsdlocked0 Subtitle;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Salutation;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Date;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text First Indent;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text First Indent 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Note Heading;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent 3;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Block Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Hyperlink;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 FollowedHyperlink;\\lsdqformat1 \\lsdpriority22 \\lsdlocked0 Strong;\n\\lsdqformat1 \\lsdpriority20 \\lsdlocked0 Emphasis;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Document Map;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Plain Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 E-mail Signature;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Top of Form;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Bottom of Form;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal (Web);\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Acronym;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Address;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Cite;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Code;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Definition;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Keyboard;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Preformatted;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Sample;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Typewriter;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Variable;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal Table;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation subject;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 No List;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Simple 1;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Simple 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Simple 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 2;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Classic 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Colorful 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Colorful 2;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Colorful 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 3;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Columns 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 2;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 6;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Grid 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 2;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 6;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table List 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table 3D effects 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table 3D effects 2;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table 3D effects 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Contemporary;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Elegant;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Professional;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Subtle 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Subtle 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Web 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Web 2;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Web 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Balloon Text;\\lsdpriority39 \\lsdlocked0 Table Grid;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Table Theme;\\lsdsemihidden1 \\lsdlocked0 Placeholder Text;\n\\lsdqformat1 \\lsdpriority1 \\lsdlocked0 No Spacing;\\lsdpriority60 \\lsdlocked0 Light Shading;\\lsdpriority61 \\lsdlocked0 Light List;\\lsdpriority62 \\lsdlocked0 Light Grid;\\lsdpriority63 \\lsdlocked0 Medium Shading 1;\\lsdpriority64 \\lsdlocked0 Medium Shading 2;\n\\lsdpriority65 \\lsdlocked0 Medium List 1;\\lsdpriority66 \\lsdlocked0 Medium List 2;\\lsdpriority67 \\lsdlocked0 Medium Grid 1;\\lsdpriority68 \\lsdlocked0 Medium Grid 2;\\lsdpriority69 \\lsdlocked0 Medium Grid 3;\\lsdpriority70 \\lsdlocked0 Dark List;\n\\lsdpriority71 \\lsdlocked0 Colorful Shading;\\lsdpriority72 \\lsdlocked0 Colorful List;\\lsdpriority73 \\lsdlocked0 Colorful Grid;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 1;\\lsdpriority61 \\lsdlocked0 Light List Accent 1;\n\\lsdpriority62 \\lsdlocked0 Light Grid Accent 1;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 1;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 1;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 1;\\lsdsemihidden1 \\lsdlocked0 Revision;\n\\lsdqformat1 \\lsdpriority34 \\lsdlocked0 List Paragraph;\\lsdqformat1 \\lsdpriority29 \\lsdlocked0 Quote;\\lsdqformat1 \\lsdpriority30 \\lsdlocked0 Intense Quote;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 1;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 1;\n\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 1;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 1;\\lsdpriority70 \\lsdlocked0 Dark List Accent 1;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 1;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 1;\n\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 1;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 2;\\lsdpriority61 \\lsdlocked0 Light List Accent 2;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 2;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 2;\n\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 2;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 2;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 2;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 2;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 2;\n\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 2;\\lsdpriority70 \\lsdlocked0 Dark List Accent 2;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 2;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 2;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 2;\n\\lsdpriority60 \\lsdlocked0 Light Shading Accent 3;\\lsdpriority61 \\lsdlocked0 Light List Accent 3;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 3;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 3;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 3;\n\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 3;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 3;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 3;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 3;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 3;\n\\lsdpriority70 \\lsdlocked0 Dark List Accent 3;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 3;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 3;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 3;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 4;\n\\lsdpriority61 \\lsdlocked0 Light List Accent 4;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 4;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 4;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 4;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 4;\n\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 4;\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 4;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 4;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 4;\\lsdpriority70 \\lsdlocked0 Dark List Accent 4;\n\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 4;\\lsdpriority72 \\lsdlocked0 Colorful List Accent 4;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 4;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 5;\\lsdpriority61 \\lsdlocked0 Light List Accent 5;\n\\lsdpriority62 \\lsdlocked0 Light Grid Accent 5;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 5;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 5;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 5;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 5;\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 5;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 5;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 5;\\lsdpriority70 \\lsdlocked0 Dark List Accent 5;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 5;\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 5;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 5;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 6;\\lsdpriority61 \\lsdlocked0 Light List Accent 6;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 6;\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 6;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 6;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 6;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 6;\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 6;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 6;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 6;\\lsdpriority70 \\lsdlocked0 Dark List Accent 6;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 6;\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 6;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 6;\\lsdqformat1 \\lsdpriority19 \\lsdlocked0 Subtle Emphasis;\\lsdqformat1 \\lsdpriority21 \\lsdlocked0 Intense Emphasis;\n\\lsdqformat1 \\lsdpriority31 \\lsdlocked0 Subtle Reference;\\lsdqformat1 \\lsdpriority32 \\lsdlocked0 Intense Reference;\\lsdqformat1 \\lsdpriority33 \\lsdlocked0 Book Title;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority37 \\lsdlocked0 Bibliography;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority39 \\lsdlocked0 TOC Heading;\\lsdpriority41 \\lsdlocked0 Plain Table 1;\\lsdpriority42 \\lsdlocked0 Plain Table 2;\\lsdpriority43 \\lsdlocked0 Plain Table 3;\\lsdpriority44 \\lsdlocked0 Plain Table 4;\n\\lsdpriority45 \\lsdlocked0 Plain Table 5;\\lsdpriority40 \\lsdlocked0 Grid Table Light;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light;\\lsdpriority47 \\lsdlocked0 Grid Table 2;\\lsdpriority48 \\lsdlocked0 Grid Table 3;\\lsdpriority49 \\lsdlocked0 Grid Table 4;\n\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 1;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 1;\n\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 1;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 1;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 1;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 1;\n\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 1;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 2;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 2;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 2;\n\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 2;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 2;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 2;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 2;\n\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 3;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 3;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 3;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 3;\n\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 3;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 3;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 3;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 4;\n\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 4;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 4;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 4;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 4;\n\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 4;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 4;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 5;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 5;\n\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 5;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 5;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 5;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 5;\n\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 5;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 6;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 6;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 6;\n\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 6;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 6;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 6;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 6;\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light;\\lsdpriority47 \\lsdlocked0 List Table 2;\\lsdpriority48 \\lsdlocked0 List Table 3;\\lsdpriority49 \\lsdlocked0 List Table 4;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark;\n\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 1;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 1;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 1;\n\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 1;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 1;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 1;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 1;\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 2;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 2;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 2;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 2;\n\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 2;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 2;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 2;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 3;\n\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 3;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 3;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 3;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 3;\n\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 3;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 3;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 4;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 4;\n\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 4;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 4;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 4;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 4;\n\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 4;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 5;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 5;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 5;\n\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 5;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 5;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 5;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 5;\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 6;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 6;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 6;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 6;\n\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 6;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 6;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Mention;\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Smart Hyperlink;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Hashtag;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Unresolved Mention;}}{\\*\\datastore 010500000200000018000000\n4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000\nd0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nfffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000b002\nc4a57123d401feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000\n000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000105000000000000}}\n"
  },
  {
    "path": "test/rtf/image.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Image\n          ( \"\"\n          , []\n          , [ ( \"width\" , \"2.0in\" ) , ( \"height\" , \"2.0in\" ) ]\n          )\n          [ Str \"image\" ]\n          ( \"f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg\" , \"\" )\n      ]\n  ]\n"
  },
  {
    "path": "test/rtf/image.rtf",
    "content": "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 \\fmodern Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\pict\\jpegblip\\picw250\\pich250\\picwgoal2880\\pichgoal2880 \\bin ffd8ffe000104a46494600010101007800780000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc000110800fa00fa03011100021101031101ffc4001c0000000701010000000000000000000000010203040506070008ffc4003e100002010303020404040502050500030001020300041105122106311322415107617181143291a1234252b1c115f016336272d1082443e1f1265382ffc40017010101010100000000000000000000000000010204ffc4001b11010101010003010000000000000000000001110212213141ffda000c03010002110311003f00dadd18a10a704f6a95ccc57e37750782b0d8d9ea0cd32e7c5446e07e9f4ad723119a7b89e61e348f260719278aad613cbb640002938c76a182b264fc87bd13009c0c019c76e3d68a072e1cf6f4cd502d330c28269a61bb39c923923d4fad44c08dccb95cfd28b8280769ee08a263891e1808739e4f1d8d149392172cc714050dbb9fde8960ed8c60b79b1ed44103b05c331dbdb1dc5026ac1946d20ff8140aa631c773ec738a0346a003bf93e9cf02801895e7b9a01886796c923bd0090a06393c76a0142003ce3d86680d8dd9392303f5341ccc1b3cf7a2c812c37e4923d381429757013209fa511c18146c9247a0f6a007900c0c671c6280854e086c673eb45c27c038fd68aedff2fda836ef881f136f25d5e6b7d1262964aa02b03f98fbf153131935edcc97576f35c33349212cc4f39f7ab26186dfce5b200f73451f7600dcb8cf27e7400c0b291914046c9e0718fde81371b8e7273f4ef4007691919240e714097f31f376e7b5008caee27807b0f5a02c8e1b3c6d27d33cd0201d839523144d1a149ae084b78da47638211771fd050d582c3a0faab5119b6d12f8ab1c06788a0fd4e2ac356fd1fe08754ddccaba849696309e598c9e2103fed1dcfdeadc44fea5ff00a7f956366d375e492403ca935bedcf1eea4ff6ac68a55efc1beb3b552574f8e7009ff933a927ec715bc82b3a8f4d6bba5ca1352d22fe061cf9a0383f71dea5119cc6c0baed3eaac0f1fad40897dcc3d81f7a052366c1007df3400f21edefc5008c28f30c9c5170ee4fc37830086395250a7c66770c18e78da31c0c63de8609b41f7c515c5172a30c3b76344a3e377cb2339cf7a242aea89808cce368272b8c1a2e107c672a49f5c1a181c9c7ae7da8a2119e7b1f5068099ffa68258a132062d8f9e0f34059502b61bf2824e681bb297ced2a71efda80f19c47b9c77fdbe74057c13e539cf3c1a0eeeb9c73f33405ddb4f18249c1e28062b79ae242902024465b9214614649e7bd0362a7249eddc513456e5720f38f5a1a98e96e95d6baa6ebc2d1ad1e65521649bb469f563534d6d7d31f04347d2a2fc5f535db6a0e83718906c887cbbe5a9a8bef44dce9f731ca9a2e89169d6d6f2184b1455dc07b11dcfeb4d16f119c649a681285b03d3e5500f87820ff006a0e098191de80ac9b8904647b55d11da9681a56a31f87a869f6970b8ffe4883629a289aefc16e92d441682da5b098f21ed9f033f353914d19b751fc08d66cc16d12fe2bf45ec92ff0df1fdbfb559ec667aff4eeb1a04db359d3ae6d40eccebe53f46ec7f5ab82263da7dcf3eb5174e5181076918c7de869503232491ee4515c1803824f03b51287f30e0e7d803449494832c157278a2e8c71fcb9f9d144639236824d01e142efb1768cfb9c7ef40512a818de78ff00a682518e7cc30ab9e00a02cce9953247bd41e467191ed9a04205ee99da4e4e3d283a524b0427b5026c18a8e082067db8341ce0e39ed409b6502907391edda80f2dfdc496f0c124ac6184b144cf0a4e338fd2894f7a7342d4ba9b568f4fd261f12571966270a8bfd47d8511bae85f02b47b7fc34bac5d5c5dc88a0c90ab6c8d9bedce3ef4d1ad691a6dae976a96d616d15b409f9638d70054a1dbc68ea51d4329f4619a8022b78e04548515117b05000a035c5c4702a995c26e3819f534047bcb68a458cce866719540724d02e41c0f7a012a40f6141cbc8e7bd01719e38e6838af1c0a04ca8206d3cd037bdb082fad9e0bd8a39e0718649141047d0d5d18f759fc0cd3af164b8e9999acae4e4f81236e898f7c0f55fed574615aee83a96817ef67abda3db4ebdb7f66f983d88a061bb8db9e3d45165076db83c1f950a53780d8247c80a2398f182724f1c7ad080c608cfa7a51a0062adc7afbd0130173bb9c5070f071cb37e82826106e8f615e01c9e680d6b35bc534be3c1e3831b2aa962bb188f2b71df1de819ae4b1048c7f57bd01a58268e332642ae0704f7cf6207af6a01b99e17b7b6416e227407c494139909ed9f4c0a04a4e501e0f1eb40d263e53dce7fa682c9d0bd13abf58dd6db18bc2b157c4975270ab8ef8f563f21447a73a03a1f4de8eb031582b497328066b97fcd21ff038edfde88b7e32703bd64188e7e6283864b73400cd804b67ca3268317eacea6d56ff005233592f8b6303f953fa4af7c2fa93417fe98b763e0ea171297bab98558068f695ce0e08fdbd281e5c6a57ba5e9d14d716ef7774f2ec112601da4f27ec2827ada74bab559a20e148fcae36b0f91140283729c77a0e0a7777a01dac68395719e39a029607cb901b19c501480ab9279f4a086ea8d0b48d76c0586b7143224a76c61ce1831fe93e86b43cd1f12fe19ea7d2533dcdbeebcd20b612651e68f9ece3fcf6fa5067cbcf20ff009a051724905411e94032799060723da8406d6c67e7ea68d0e1770fe5cfb5026c37039ef9a02eca098c91e6e01e71c500b1d8a49c12786cf6a06a4e256008e3d050119958007920e2801154e32fb4120927b014017eb1c523ac5209a356215c291b87be28957ef853f0d66eaa99352d515e1d190f947669ce7b0ffa7e74a8f4be996569a5d9c56b6704705b46bb5238d42851f2ac875712bc70b3c30f892019540704d01ad2669a0491936330c95ce7140b2e4939a03638c7e8680ae485e33bbe540d60d3ada162c90a02c7270a39340a4f28b68da4645007a8f6a069a746f73235ddcefc391e12b2e1916824948742c99382473c73404791c617695279dc0640f9502c578c9efeb4095cb4cb0830ba21cf999c6401f4f5a05061d430c8079a02e03b3004311c7d281b5e3cd676c65489ee594e4aafe6c7ae07a9a0a075bbea3a8ea96f047d3935ebc404f04ad29411e08e011d98fed416fd212ee5b05b4d5ad6300c615807f1171eaa49eff5ad418c7c55f8466dd66d57a521f20cbcd66a7247a9283dbe5418a63862479877cf1f6c5008e400bdf1ce684016fe53dfbd1a73794600e08ce3d6800377c8c7d6800a9cf75fd4503d91492460f7ee3d28247a7b459f5fd592d22711c206f9e563858a31f99cfd050583518ba75247b1d134f9aed21396d4669769931dc01c003f7a329c4d17458ac5b55d36c12e040a3f1da75c1cb04ede2447f7f6a94567ad7a66db4fbbb29ba7d65b8b4bd8ccd09c8231eaa07b8ab04a7c2cf87b3f53ea8d77abc72c1a5dabe2452bb5a561fc83e5ee7e541e988218ed2dd22b7855228d76a46a00000ec00a510bd4dd511f4fe84da95cc31f880022da4902b1e7d3e99ac86fd03d631f565b4ee6d4dbbc649009cab2e48c83f514165b8b94b6895c44f279c280839e78ce28178ae6de46748a789e453865570483ec6812d42e85a421fc37918b00a883924d024c6e99b7a2a966c0009e17dc9f9fed40f81c77e28139218e4ff9815b9cf23340a01c907b9140201038ed402fcafd28386464e4fd33c50272bc60032609cf00fbd024f722dc66f24822ddf972f8feff00e280f69b24844919cac9ce7de83a447f30ded823007b50459d6ecacb528349b979127651b1dc795f1f3f7a0990148054823dc5015d491c0a0c3be337c2ff00c489b5ee9c87172016b9b541c49ff5a8f7f71eb560c1fc43e0a47e1aa94277310431f91fa551c1727f29ed409b641c86e31839a3454805739c1f6a026f1fd740f64665fc8c31cfde82db79bb40e9e8f49b62eb7d7e8b717ec832c91ff247fa1dc7df2281bcc9369d671493c422b7911654c1215f92bb8827bf068624ba635392df5eb4b9924558ee5bc19b71cee43c6dc7cf34c657be8db0b0b9d0f51d2afe668934dbf9628ddb8c2b8c0073f3a80da37546a7d25174fd95dc125c69f7313ee5655dfc313bd483cf07b1f6a68d5b48d5ec758b612e9d7293211c8fe653f35ee2a084eb9e8bb1eafb3582fe496278f3e1c919fcb9f97ad03ee8dd017a6741b6d3229dae161057c5750a48249ec3eb4139238568f6a9e7b103b5037934cb3793c610a2cd9277a8da73f5140ee38f6280c4b11c65b934023006d50050030e4647de80c846de3b500fcf9fbd0197273ed4007b91400e580c8e45074a82400e72682b36fd2162b7f25ddc09af2766ceeb872db79cf00f6a0b3229550140e07007a50092db860673de818df473c862686dad6470d9cce3b7b63e740fa1de6252ebb5bd81cd00bee2d800d003a6464004763ce683ce9f1cbe1f1d3a67ea1d1a30b68edffba814708c7f9c63d0fafceaca31e6dc71e1f07daa82608c83819f7a1a11ce149238fd68d0a579ec682cfd27a7c3a86bd10bc38b3b756b8b93c1fe1a8c91f7381f7a034f752ea5aa5c5eb292f732128037619c018f6ec282e5a2cb047abda74d5ce9b6da80f136de4a496219b3e48c92000323ea73467519d3da5bb757dbda410ac90c77c23058f99007ee7ec31416882ee47d23acb5185caf8bab4691b1efe57fff0038a9457ee75a82f6e7429350466b482f2742c0f74241c80c38c64541a9cfa1e89ac0177d33ab3d8de28f2b5bca429f91140e2c7a9b5ae9fb85b6ea9b46b9b3c796fe040768f76ec0fafb1f9505df4ebdb3d4edd6e74db98ee216fe68ce47d280648f75e2485a44da385ddc13f4a025ddbdbea16a633286566ce55f9c8f6c502ad750db2c514f30dec428247e6340bbf04100b73402afb943ed2b9e30683836defe9403bc1e06734020e06280cafe8683a375941d841c77c1a0151b467b50159f00e4127e5402872371040c5046eb5aadbe9b1c02e2f6dad25b89047099c677b7b0140fe3f1010afc803f3018e68160c3041ee2823f5dba92d34db89a1d9e2843b03b6d05bd013560c1748d57aa2797c6b35bab78e6959dc47231580ff336dcfb03c1a58364b5bbb7d7fa7b7427f1f673830c8664285bd1815238fad20f2c7c41e979ba43aa2e2c1cb1b663bede438f3a13c7dc76fb5515e9065b851f7a02950002a09c51a1b83cf14176e90d3645e9ad7752752aac23b3439c066665c827e944d29a6410aea725c4567135bd840d3c88a723728c29c9efe6c50d3ee9545b0bf8ef2e6e3c2fc2c6f72f2920e5f19039ee4938a9a875d03278377acf52ddf867f036ef71923932bfe51fbd3475cdc369df0db4fb389d4ea37970fa9cc0b00511795ce7d4f181eb4cd2451755fc45ac16d637381b14ca36b641dfce723e4053170d6cb52bbb362f6d3cb19241f2b9029862f09f143549ba7e7d2eef6caf2797c66ee17fdfd69862d1a069da7dfdac579d17adcda5ea9e1a992376c4723e39e3b024fd7e94c458ac3e25dee8d31d3bae74e7b79002bf8b8549471db38f5f4ed4c165e943a06a328d4ba605b4b22a1523c420c64fbaf38a82d36f0ce7cf7463790729b53017e940e0b0ceceed8ce0500e1b70daa08f5c9ed41d271cd0132476e7d7ff00aa069797d2411168ed9a41fcc858211f73c5075acb25ca6fb82aa31e58a36c81f561dcd033d42169e158ac64b98151b3981c2966cf639f4a064c7a8ac55e4865b7d493701e1c8e52403ea3cbfda827e390ca3f2c914aa81991bd281cdacc2747215c60e0ee5c67e940cb51b0b2bcbd824bfb08ee1a252d1caea1821cfa67b1fa504982b2283ce08f518a08abb82f6dd0369a5662081e14ce40c7ae1b04fda82275cb0bfd4f4536f7114589a5412461f3e4ce4e0e060f63f6ab2893d3b4b5b5b78e22ed22aae3cc3cc7e64fad3449a22a461500007602a0cd7e3b74c26b5d2ad79147baf34eccca40e4a7f30ff3f6aba3cd0543267eb5427b86f1f4c76ef45d0eca1ad5ef224d13e1cf4fd9b22192fa67bc955f8c8c617fba9fb510d7a6ed3fd43a735e5b54964be658c048fb6cdd9e7eb8a186bac97d174e6d22e23437b7ac26b95e77c68bf950fa7279e2b22dba45b59e97a669fa4ea36aeff89cea9a90451fc355ff0096ad9f4ce3f41570675d4fa8c77da8de5cde5be26bc653171ca47dc1f6c9fed5562b97f70276808da7c24f0c1c63804e33fa8a2928c0e0383c8f7ed41d92a41393f4a2548595c2c37493db4cd04e8a08f139566edfef3445b6e7aeaf65d2df48ea2b11776ae02a93e564c772adef409f4ee8ba9a21d73a36fa579ad9f325afe599171ed9c30a960d5ba0fe2843abb47a6f510fc26a4c36890f9558fcc6783506a1147b510024e30339ce680d2c6ae9861eb9a009178a0205443b989e39cd01d8075e3047ce80563057ca381ed4011c4531e503d85013c91b804a21279c903341131cda8c3abdc8650f6d20c4321232adec3dc504bab2c113c9293bb1963df3408dd4b75e1efb2856463dbc43b4631fad047e9177ad4fe32ea16b1db4b8fe1aa92571f5f5a0916bc8e0895af5c46c17cd8c9ff7da80f6d736f7f6915c59cab35bc837238ed8a072a31c1ef4062870718a06f7702dc5b3c522ee4752ae0fa8230683c75d6ba3b74ef535fe984929149e4278ca9e47edfdab42058003763ed409f88ffd6dfad06b1f12ae612fa0c76e0b471e9916d23f973eb4158d3efeff004a984da5debc1295d8e4018dbf3145d583a2ad96f356bbd7f5d90dc59587f1e79a6392f28fcaa3ee47159444ea3aa5ddfc7acf50dcdc344d7a4dbc317f52641200f6000fdeb41b5ef51d8eab672ffa9e971c97c11638268e431a46000012a3b9a351567db823b11f3ef40948e428048207a8340ab48ae83cb83ee0f3428a982719edf3e68c9cc97d3fe15ad8c9be138f2bf38e7b8f6ef40f7a5f55bdd3f56b46d3649127f1405f08e7249c76f5fa50689d48ba5f545cdcbdb462cba9206411b2b055bb07d4fb1c73528d4fa8f52d62cf47b6b8d2e65fc458c49f8a818795c151939f977a823ba0fe253750eb7fe937b04293f9f6c90be41dbdc7ff006283473c1efc1a06f69776d73bbf0f2aca32572bc80470450284a46dfca19f819f5a04e799614def26c0bdce09cfd85045dc75769d12dc3c3e2491db0dd3c85195235f7c91cfd066ae0cdba9be31f4ec61a386c1ef9d4ee473e45cfb1cf34c101d3ff1ac9d481d46c628ed24751881880833f988e7b0fa5328dfed2f2def2ce2b9b79925b791772ca87208f7a60182ee2b95cc0c48f53823fbd40ac658b30f4f4a086d4ee1d75bb6b78f4e965596366fc5211b23238008fde81f43692da5bc30d97831a0397dc09e3d714087506bf61a2c4cd77324726d2caaec141f9fd2ae0c435bf8c57173ad7876f7a2daca10489121244cdf319ce3dbf5a834fe81f881a6f57bcb6ba7c53c72c11873e28cee1db391dbef4199ff00ea4348116a5a66a8a8a04aad04847a90723f6ad7d18c312ddc02a3815423ba0f63fa541687bd9efe1b533b3c9e0a78473e899e318a09bd0ba6eef543e3b2bd8e9b10064bd9e4da001dc81401aeeb29a984d0ba7d5e1d06d4e6594f06523bc8e7f5c0ac8af752dfc17d7090d9218ec6d9447129ee71fcc4fb9cd6842ab10dc0014f3e5a2c1704b671dfdc734525226dc939e283a362c7f940344a380393df144733e2276e38f5efcd01b4bbbfc3dda4a9298a44395902e4a9c70682660d4265d62de40b1bdc1545054f95c8fe627df141af7c3af8808f3dd68dd5d2a45765884b8908d8c3b6c27b7a77a945d7a5fa474bd2ba8e4d5748b28624955d5d8b13b79ee9e983d8d40a753758c7a46b96f6114725dc92279a2810b3a64f94900763cfafa503fd3b59b79ed84da34713c0cd890f0a158fa1f981de826e1b548959fc4dc5cee24b6467e59ed4101ff19e9f676baa5d6a72c50adb4ad1ac790ccc076200f7ad41e7df881d79a87576a5f87b0f161d381db1c2a36e7e6d8ff3416bf87ff082c6f208ef7a82f22b9761bd6d619785f6dc477fa53705ab57f83bd297ceb1e9caf67708db9c4526723e849e3e94f212dd25d117fd29a8c09a76b534fa39cf8b6b71ced38e36fb73417f52e64548e34007e673e9f21ef590a1c918c90718dc281a69b68f67118d9da5058b798f6fa7fe280daadd1b2d36eae70710c4d263df0a4d583cc7a668fd4bf11b5837d7c93dcd9a3146959822a0e781f4cfa55161e9dd7fa67a4f55b9e9aea3e9f81fc09ca0ba118998fcdb2338c7b528d39f4cd2ba76e2d357d292df4eb391809963420ce1b1b576fa1e7359119f1eb4e17dd033ca172d6b2a4df303383fdeb5c8f2eef3bce4e0e335684cb0c9f354160d36f64b0baf16072b91b5f03391f43c51aab23a5debe91c4fad4d73689e6fc3a290573ff4f03e59f4a3280d67581ce916567f84b58ce0a1fccec3d58fa9a084de08c90464e4d1a8e419059b201f4a05630a176918efc50176293872c17bf14042aa0125b03db14046c60b60123fde6827fa0c68edd5365ff11346ba6292ee64194240c807e59a32b7fc51bfe8bd5ed5db424860beb62b89218422ce09c11c01dbbd0660ae110bf1bf2154838dbebfefeb41a8f4cdac7f117458f4d9ecd2df53b4cf81a822808c47255c0f7c8e7fb54a2ec2cfabba3b4b4b8d3af12eedad40926b0f070a13f9b633649f7a82eba6ea4357d321d4ecad512daf20df26e016507fa4fbfaf3e98f9d067dd2bd2faac9aa4d72d72d1e9510ca46a7631c7a320e18f1dfd7bd059afb7da816d23de4ba5de211346a1e4785f190548e4648c63b64e6b43ce9d5baafe3b539c5b452dbda46c638a167cb281c73ee4ff9340e3a3fa5f5aea4ba58f4bb57dbfcf2b02a8bf7f7a0de3a5fa0b50d2a2d92eb3e048c0a97c867dbedcf6a944e5cf4f6b76d1b3d8ea42795066266c87c81c65b9cfaf15048e83af3cd64abac08edaf01546c38dae4e0657ee6826e5b892de3702292e2545ddb55700fd0fbfca81c4b3bc718716eef9eeaa402280d14ab3c0b2c65c06fe571823ed40df56b217fa6dd5ab9216689a33f2c8c558307e83b8d77a37aaa7d22f2512c28768800c9954671b3d33ebef568d0ef7a7749eb0b5bbbb162d657b32b46d2e1564c8ed9c5644d1b0b9bbd261d2a440af6cb0e2e5b1e7dbc1238e0f7a0375b696daa7496a3a4dac8a92cf078685b271db04d391e40d5ec4586a1716de2a49e0c8c85d3b120f715ba1899173ff305413070abd89cfe9f5a2d3ee9c8639fa874eb6b804c52dc46b20c9f302c3bd11e84d47e1af4d5dc6521d3e3b662c19a58721ff5a9a321f89bd27a374b456d158dccd34d333332c9b4b2afbe47a7cb1f7aa33d2bc0d8c0f1c8f6a2c14b6d501b39cf63450897380c319e3de8065031c038f7ed40d8faf1ce41e4d004876a8dc3cc7e743025c956c818028c904579e7f0e15695c9c0541924f6c00283d0bf07f42d6b48820b8d62d20b2b58d656404959e52f83c8ff00fcfafbd4a35bb06f12391a48dd55cee2b2f3818ed8f6a8158a159890f02242079147623e631c502b0db436d1ecb7458d4738038fb0a087d6eeb508f48bb7d32d95750752b6c26c905b3ddb6f61eb574794f5cb6b9d0fa9678b512b25d24bbe52b8c1638278fbd582c57ff12afaed45b5bc0d0d8a8c08a2731ee3eec5793f40450466a1d59af446293c186cd53ca0c36eab93dc649e49fbd048e89f1675ed35e301e293919dcbf9867b37cbe94a35fe94ea4d33aba6824306dc48015750d86c6e247b0cf63591a40b8dc23fc30f14138dcac3000f9d03687547f12e8dd5af816b13148dddbcd29039c0f6f6f7a0eb5d62caf5636825db70c9bc4328f0dc0271c8a090627d3073ce681acf6505ccf14d35bc2f2c2731bb28254fb8a075144a83ca806792400334049ee6281e2496408656d880ff0031f61fa50446bd76058ea1b9e21025a3bb48afe71df9c7b71de9c8f196a0de23ca7b827d4f7add117e0cbfd4b5059392369663ff004e71c51aa97e8f555eadd258f2bf8a889cff00dc28cbd0bf123a926e96d163bdb74490bca2321c678209ff001591e71eafd7a7d7ef45cde2c20aae144638033fb9ad2e1b5e69d058da431ccf21d4a5c3b4631b62523807feaf5c7a50222f2d648c25f5aeec8c2cd19dae3d3e87e944d3eb7e90d425b49ef2292de38224f1505c3f8724a9eeaa7bd0d57a60406059436306868a7803839c7ad1a158039c13f4a33a716767f8cb9b6b55e1ae2458813e9938cd07a9f42d0b4de99b4b7d1f41b58ff19b03c93ba06607fa8b1f5f619a5b8266d74a65d42da6ba90cce996dcdc8c9fff006a5a2c2635083b05ef83eb5028076341db4b1ed9f7a04651fc41db18ed419d75b744dbea335fcb0db0335f2057901c05da73c8f9d5d18a75174a3f4c47335e35da4ce418a489374254f707d463d33565d1529b569a489a17944b06ec8057d71dcd037b4b6b8bfba31584124b27e62a8a4f1ea68357f83da7ea5a76bfe0912453ccabb49194653cb60f6ce3dfda983d196cd108c2401711f9768e306b2297d73fc6d02773a8b591922693c5004bb9d72542fa2f6efde8314ff867aeeec27500b77bb5670e36ca19b1dff2e7f2fd2837ce8bd5dd348b78b552219022870d9c46e792a4f6c608a0b846c8e03232b29ec41cd0199f1410fd4b24b1e8f712c0a5e4452d851e6c639dbf3238a0afa42ba77475e4ba8470896681da45180b18da76af3c9029c8f26dc1df2b9c606e273e86b743331924f27f4a82c12280e59b008e79f6a2d4d74188ff00e30d203a82ad7519c1ff00b860d11ba7c5e86c9fa3afae6f4091e043e021270b21e01c7dcd6479ab4dd3aeb56be4b7b184cf2b301b57d07bfd2b4bad0fe25e9f6960ba7c7a55ac50cd750335ccaade7723b83b8f6e38a2207a5ba4e7ea3d93780cb616ca53781f99fbff009a0b675a5be9765d43a75a6ad3b25adb4185429b831c70303dfdfd2831eb8954ca48f3827819c71ed406b2b1b9bf9a5fc1c4ce2253238047957dc9345d122b792eee522811a495ce1157b93ed444ff0049f476b1aaf51c761345269d25be269259570c833c6077249e062a68f53e8ef0da69509d4ae225b92a04af232ab16f98cf1f4a5a266d4dbca8af13a329ecca723f51502d14f0cb9f05d1c8ee01c91f6a0393b4edfe63c8a031608859b38f97340d84d04e5846eae50f9829ce3eb400fb24466041f5e3d2823f56d22db57b192d6e61468a41c823ff0035651916bbf04ada7badda5cad6d1b72c09dc33f2a6875d25f0865d06fe2bc6d4c4d3282026cca8cfafcfd29a34cd234a10c768f711a78f1bb392a3001208e3ec69a26a58d640c832091c90706a084ea1d3eeafdadf4f86da3166c0b4b397c18f046140f5ce4d04f4702436e91c28a9122e028ed8a0a9f5a5b6a09a1bc5a135bc72cce048b3c5bc15c638f9d59043fc2db997481aa69dae49e1cb6bb643239211939e467818f97bd305965ebce9a10bc8da9dbaa2679dd9ce3d8530572cfac87566ab05ae9f1490692b9696e1f833738555f96793504df5f25945d2576b7ec16dc46792381c7b7ad5e60f234980e42f6c9c56a82ec3eff00bd4124e49700f1c646e3cd169ce9575f83d52cee324347323f6e3861ff008a23d47d4ba6a75074fdcd8ef317e2e2ff0098bdd4706a60c3f4ae8cd5f44eb8fc3e97248a638cbc73bf90483d463b373e9574685abf42a6b5649fea72bbdeac4a8d3b018cfae31f7a6895b6b29b41d30d8e9f6bbed9213e1b7a994e724fcbb5064bd7835a9752d3af75d8116354778f660788cbd9483dbb0a0cd20b2b8d43528ad2088bdcccf854039cff00e2827a0d34e9da1de896f2182492efc0976f998aa827d3d334113a74aa9a9298628e74570478bc0c7cf1da83724bb8246d3e6416b0384da61b5501c9f5c3704f152c037561a95f5fce61d3ad6db4ab950f34b331dd9f4191db8fdcd406d67a675ab4b6d325d1af248272a43430315ddec7038f6ad4b3f448bf47eb71cb69abddebf21d5e26896203846c30c8603b9c6452d9835901405660376319ac84bf13180779d8bb82827d4fb0a06f777367a75acd7170f1430a9f331200cfceae061a0cf6dac692d7365266191db0578f5edf3a6075a6c9278b3433188a467860d96fbd40fe540471409aa0c1140750001ed8ed4058e15133c983960077edf6a06faade5c5b7822d2d926766cb967da2341dd8f0727d85033d27597d62e2ee3163756915bbf8799d71e2f19dcbf2a092b88dd9a311950a0e5b70ce47fe6ac18af53f5b69da9752dd69da9ca906876e24465d9e69881c6ff005c679c0aa2bfd267a347512c93dbb5d42d90d3c800b68c9ce0ec3cfa528db74ad034db5905ee8be1ac728dc153984f3f980f4fb56453be2de8f647a6aff53796596f0aed46798ec033ce149c0fb0ad71479c9bb9dc3bf3c55a0b95f65a825150b481a407b93c0fda8a29c06671dc93803bd131eafd0af6dffe18d2ee25982a4b04603b7a9c631fad03bbe586381bc5945b96385718c827db3eb5288eb8ba934eb15fc3c535f05427796dcccdec7150637d5bd55d5362b7975aa4d0d919018adec8637807bb60723000e4f7cd58203538aefa8aeb478a7b9beba924547b8774cf8608036a80704639cf1f9855d1a7f4c68b67a03de5e5d59dad8d988c62e1c0f107a1e7fdf7a082ea6d07a6e3e99375a7cb6b3db093c727701e2360f7f53dfb50653d4130d42ee18f48b3f0232a15218936963ebf5fbd06dbf0cfa74855b9d46e04b730c6144691e12307d33ea7de8348ba6b5478a279a004f98c479247b81f5a9438805ac0be2e02e73c9ef8fbd40c2346d43578eefc40da7da1dc8b8eefea4fcb9fef419beabf12a4bcebcb2d2fa7ee0dc58492084b30236bb6467dce383f6a0b87556a67a7f4d95a0bbb5468816f0a69c78b2e072572719ce78357079dfab3af2e7a92c963b88d94abbbf91cedc93edf418aa2c5f0dbe2a6a9a0c90d8de34773a6a8da1186d6403fa48fec682d9adeb7a9b4c9d572dacc9a6c9700456e5ca910e000ecbd8e580352fb1ae7476bd6dd49a325e5a9f3025245fe961dea097523cc0919a032af039a006936c81423104649c703ef40dcce64bc3035a87b6f0c378f9fe7cf2b8fdf340a4b6e25962915d94a67807839f7a043586922b5636ec44c061063f31f6ab079d7fe19b7eb2d4efeef55d5d74f992e9a0fc3a441dcb13927b838c9aa2d4bf042c618e178efee6e18104870172318edf5c1e6945bbe1a748ea7d2315edbea3a99bcb190030c401010e4e783ee0fa56455be3d6b90c1a6268d69e17f1486900ee98ec29ccc183119419e7e55ba11f089f523ef5058363a8059fb8e31e9421b491056c01819e28d3d0ff07eea3d53a1e3b6b8db235aca63c139c0eea68ca47a9fa6ef757b83ff00bf68ad428c2f248c7a8f9fcea518df516adac74e7544f63a2ea172f1800291e6cee19ec78cd5826344e85b6bad25ba8fade5b99dae0ee11efc71e858f7e7d054a2d7d39a75ae8f7b6b00b8917f1516624b78429da327cec493db1db1d8540cf4aea28f58d6aeae2f6dd64b498082d880488d149fcea7d4939ab04175e6850a8d32de3b78e380c8de32c4db4e18e430fef543cf86fd0d691b4fabdf6648b3b2db69ce7dd87be68342d2f4fb9b5b891af1a28a2dc05bc5036d001e0eef7352884b961a2ea9aa7555c885e08d45b5bc52b61b686c120fb939fb541276bd4b61d53624d942e2f6200bc32290633e99f4233416dd3ad3f0d611c0c77b632e71dc9ef41156dd27a45addcb3dbd9c513b1dd941821bdc7b558333b9f873757fd69a85e3f813e9c7723b5d93265d872473c11544a68ff08fa75e290b42ec4e4124e70738fa5048e89f0f745d2aeadd2decedda6525c975121183c77f7a945c754d0e0d563682ed43425369403bff00bcd58308ba7d5fe13f5a05889974a9d8b46aede4914f707d88ff001528ddf4fd7edb54d1a1d56c312dab2e64dbc9418e78f5c541296d70b716d1cd6f8789977230ecc280cb7519b816f212b205de4e0843ce300f6cfcb39a0545c42cee88e0b458ddec33ee680eac92266360debc7b5056fad2d354b9b189745744be121daf27e550548ce3d4d58324d07a725e98ea2b7ff5381f5169a7579d021fe13904ee43ddfbe49038ab46e76cf05cc714f6d309232a4a98ce54fd6b2196bb7f2e9b631b2c427b891b6851db3eff002007341e5bf887aa2ea3d4f77378be381e42fdb711ed5a1554395caf1cd07617dcd04fc85402101da791421b49920331381c60d1a69bf02f56f03a925b12c162b98c955f775e47df19a32d99b518268e4491668704a79d4aeec7b7bd4a30feb7e9144d76e265697c3e2693631674273803e556087d76f35fd49859e9925ccf611141106f2e182e3241f727f5a94681a268f79ad1b1b8b9dd66b1c2b1ce9bb06361c1e7bf3fe6a096b0d3ba57488e485b52b40909c386901607d47bf7a0ae758eb69ac4d15be81a748f0a9c35cc90b2eff4c03c1c638a0b77405c5d5d45f87be5fe359a88b81b401dc1c7d38fb50586fed18ea3015790091591e447c1518c8c7a0a0a5754d8c9d49a8d9f4ee9dba0b3b5224b9692327728f627e7c6682f9a7e996b6b3a8b6b748a348820c7720761412c064e3041ce282b5d4bd73d3bd3f33daea97ac2e540dd0a292dc8cd043c1f15ba2a7923b65bb910371b9a12141f9d02edf13ba2ade56857551e5e77244c54fd0e280746ebfe99bbbd655d56dcdc9ce08465565f4ee3bfca82d53eb3a6dac3e25c5f5ba646402e33fa77a0aff5b74ad8757e9ca972844aa37c520fcca7d3f5ab067bd369a8f467544d626c98e9f7118f0200e4465c903049c8c9e6ad1b24334b6fa6249716cab20037c309dd83db03b5640dddac3764a4f02cb1103863919fa7a1a06d6f600c37162911b7b252b87dc773f1927393f4a079f868edae1ae6328a8b1ed38e30050226e85d5dc1f879011b3c47c2f604719f9d01eff4f4b83e3c6b18bb452b1cac9b8a83de80b16e8208a3b7b58e1407cc061427cc0ff1560ce7a8f592d69a97504cad2dac01a2b53900c3e9e51ea58f727d0551e73bfb86b99a49a46dcf21c96340dc13804f20f6f9501c0e3b8a0963316fcc4607007f57bd084d64dec01200ce483468ff0040d525d1755b4d4206ff0095207c11dc67ff0019a18f56584f6daad9dade4211e39104a8ded9152b235cd8c530613229c8c1c8ef50472e81690ee00322b0c100f0debdbb7ca8111ace856371358cba85aa5cc407891ccf83f2ef4048b4ad2e59bf116769672c72f99dd1437239078e2824a4d3e1b94559234110e781839fa0a0561b38ad532a12319c86c6307e740a9732a3a00cac870cd8e0faf0681be8b6db965bb909df3c85806eeabced5a09523647e6e0fef419a6adf116daf7ac34be9dd1da686e7f1ca2e243b76320ce57df9ff1560cc3e3f470ff00c78255b842b35bc6c4af9b6e323d3e95467b6365f8dbcf062beb68c119595d8aaff6e282422e9899b4f6bb5d46cda2562a76316c1078f4a0859e1b9b762c0bf94f0e84feb4125a57505c58ea70dd5d0174a986d92b1c13f6f5a0de7a5be366877260b5d42dee2d2423124a487507ebdf15289dd3fac7a7bab6feded74d61733473acdb5a162142ff00313d81ed505fa58fc6d809380c1b9f5c502e0e05040ea367a85dea454de2ff00a610375b04c16c7a16ef8340b5f6930dce9375636acf6a278f04c5dd4f1dbf4a084e91d06f3a52dee62bbd4a2b882494ced3c8a448063b63b638fde803ab7ae749b2b3096d792c93c8c109b55dcd18ce3710473ffdd043dc758dc5869044565aa5dda4c3c2b7bc78c1f14e3963db03e7c0ab066bf1327d41ba76ca6bc48ecad24c456f6b0c87cf8e4bbfa138c0fa9aa3297c83dd4e28395811cf2680a5b93c7ed413cd1ff0f3c797b8031406645236b0508406f30e68ba49c051b97d0e0e7d28ad57e19f575c5be8f269515dac772877c11bc464dea7ba8c739ce78f9d3193bb8ebfea2bcbd6b5b6b8b58bb7f13c2f0ce31cf0deb4c0f2dbad6d743d2ee99efae752d6c02a86e0054524f6383c7ff94c0b6af274c75149a46a5a82c46f1e1479fc3190bd8156fbe7f4a960bf74e9d253f1167a3ac09e0856610e3041ec7f6c540f67b892cee7f8d18368232ef2af2508c7047cf340ead5bf130accc9b1186541e723d09ffc5033bbb1b82d74d6b37f1244daa1b38073df3f4a08eeb1d3b50d4fa6a5b4d32f12cef1902ee73e523d476fde8306eb0d3fabfa4ba92c278af67bb7281606472f90bdd58558253a6afb40ea1d62283a8b461a66a6f931cf6a7c2466f7cfb939e7b5515fbed3747b5eb8f06eb78d35080a2ec9719c76f98049a0b4ebdd37d1bad869acbf0b03c5c16b29444adf50ded41995f68564a263a66b31cd02be152505493f51c1a088bab69ad1bc179e320f07c37c8a0692b46c4995f0381db39a0b2fc34e971d57d4705bc8db6c50ef9dd97b81fcbf7381528f5ae97a1d8e996d1db69b0c7648855b10a81b80f43c739c54134147b9a036063279fb5046e957726a0f2cfe04915b06db1788305ffeac7a0a00d72f8d9c491c06337533050ac7185cf2df6a06da2da4293488f34973328c34aea428c9ec3eded40ee7d2ad249448f6b133820ee2833df3fde819ea96897461b05b87815f2ee919e5d47704fa039ab079b3e326b70eafd4ef6d6650d8e9ebf868b69c8247723efebf2aa280eb9193ebedc5002a124e015340018fb8fde82cf32b1603d0678cd02406dce3008e47ce81b499c331383c9c9f5a2e9c69377369f7d6f796a4acf148acb83fb511e91b3b3d0bab745b7d45acedd8e3732b71b1fd73f7a5a19eafd09a56a0a96b1c705b49c48510761ce4fcfbd4d0d752826b2b583476fc3daacb295b79d768de8a32b1e71f989e49f6a7d14dd1af5ba275a45b8b093c054492ea769092373765c1da4679fbd306e36ba9595fe9f0dcdbcc92c33e1579cf27d0d409ea178f68521b6b76926ee8a7853f7ff140bc768d78f6f73748d1cd103b543f0091cf6efc502f7319dac194371d8b6326829f0c501d7ae6fa568d5d4942c806d4db81839f53c8cd59456fae6e628749b5bab8b1865b08e4726588ec11e7f2e49071c93da9a31dd4341d675e9a5bad374f9858162d0b4ac70e18f0573df35a0c759f87bd53a404f174f965dfff00f479b1ef570576e34bd4b4cc0bdb3b9b7258a00e846e3f2a94376475cee4914af7ca9150685f09ba61efb52fc7dd69bf8eb7c158d1d0b47bb38f37efde968d6eeb4eb5e91d6ad25b660aee59974db6881690918e31ce39279e062a5a34bb57b88adedd1e379679065d80036679e6a07e8391bce7e940c659ef5afe1286de3b16f2b8903094b7b2fa7ce81eb380c4260ed193f2a0cd6fa5d4a4ea0fc7bdadcce923158a3039db83c038e3ef41a0e96b2ad8a35e009291b8a939d9f227e43bd590436bbd6fa269202c974b7123602c76e779624e00e29833bf897d493e896525dbcb2a6b5a9c3e1456b91b6d60cf989c7f31f7a60c02490961ebcf3eb541308e39e067b507007b96007a67fb50178f97eb4165ce18165c2927b773fad023202d9c8dbb7818ff003408300b87f2f1c107d0d0c15a4f2e339c90467f6a18bdfc2cea8ff4bd561b4b9ba686d6e64552c4f954e7d7e46a60f4688d240af1b2bc6cbf5047ca960617ba658de1b792f2d94a5ab33461b18524633fa1a81b5c8b5168967369d23c0e0a24622dc981d81c76aba29df0bb48d660d52fceb88d069f04aeb69130037127f37b9c0ed9a8350781240bbc06da72323b1f7a0eb8816e633192ebc8c9472a78fa50349b4c83c068e24f0ddbcc1c13b837be4d055b57e98b996d4db5b4a893dc1e6620b6ccf2c467efc504ce97a38d3f4d874bf09af6d46e2f25cb82724e791db15650a43f878b51fc34f3da8f132b6d6a98c80a39ff007e99aba249631b58b9047239ec3e55368aeeb7d2da6f52c0eb7f16e87f2c6e836ba90724ab7a67b55d115ac7c3e8aed2182def4c56a14096368959a423d77e3229a27b41e9d8343b01069c8a8dc9660aa3713df3c64d4a1c695d3d6b67a8cba94b9b8d4e61869e4e4a8c636a7f4afcaa09a485519caae19b966f7a0435196582c656b74df3e308beec7b50629375775b691ac5bdb6b16d6378779f019b00a31cf391c9c2f1daae0b35ef52f5374de88d77aa45a6cd25ddc0108694ee2188c28007603d6a0d16c92430a4b2ed3230dc401855cfa0a0a07c45d7b5db9d462e9ee960b14b2ee134ef8c850012147ec78ab0670b643a2efae753d72686e6e2da211db42176079c8e768f65e39f7aa332d6f58bbd635096f6fe6692695b24f603d801e82823cb900ee00e68006460051dfd680ed9f0c905b713d8d006d5f5419fa505a18f94e40501b1b81a04186d62402c87be3d6810b81290aea8467201231cd1749dbc437f9f1e201db3de8ba07dc0175c027f28a335b17c26f888d6b6d0e8fabf892a29c453b1e547f49f7a946d6424f08236491c833ee0835073294888894120700f0280813c40a6711bc8843e00fca7d3ef40e41dc081f9a811681c6f7565329185623b7e9de812b3bcf11ff0b74563bd50494cf120071b97e5fda80d7577046c9019d5669dbc340324eec67fb734103d5da96bf67a7cf0e916f6e2765f25ddc4c11107ab1c8c647cce2816d3ec7f0f6564cae6e67da375e6d52cc4af2e4fb13ed4145f899d47b3499f4bb6d46cda49b69b92921565c3648e3dd40c81cd5c0ae89f13ec246d3e379ed2d6da180b5d34849da1780b128e49271c9f4a60ba685d5fa36bc42d95c324ec7090cc9b1d87b81ed50588958977cacaaa3b9341c655f12348d1dcb8dc1946540f99a019e2134454eeda7bed3839cd052fe2136b536b5d3563a1ca53c49da4b9507198940ce7e5c9fbe281c6b7a974cf4ee4ea7242d76dc784a3c595b3e9b464e3f6ad0ac745ccbd4fadcbabea42da56959a382ce7460d6b1a93c01f97272093ebf6a82f1ad6af0e9da5cb3cecf6902216919f82aa3818c7a9f4c530649a9f5269ba7429d472239bc991a1b0d3c3152880f0f23039e7bf3de90635ab6a377aa5ebdcdecef2c9239e59f3827e5ed54302195fcc38cd01245395c1f5f4a05b606538e483c501b6939e3b5077860f3914165754c33e549000dbe87de813b820c27fa7baafb8a04a69c98e281e42618c795338033df1f3a06c03e4e029247007ad010093c35674da71f977640340081a190658e41c820f141b0fc33f8926c218b4ed609366a02249bb2d19ce3ea4528dbece68eead926b7916689c643a9e0d643387521fea2f693c2d6efc786ee46d9bfed3eff2a04669edf5295ff057a60bd865309246d3bbbedc1efef41d63a8dec9ab4fa7dd4510fc3c69234ca186e2d9c003b7a67bd034bad0a5bb96e25d575267889cc1b54446d9bd0a37bfbfbd02925945a72cba8dddc48b3f87b1e58f23c623f292bdb7fa7cf38a0a5750f54ebba56a9a67fc516b6d6fd3970ea9234677c8dc7f38f6e4640ce282d1ac4b16bfa72c1d2bad430cd1ba822061865f5007d3daac19cf547c189357d561bbd3eee683c62cd786e9b73337b8c7bd512bd39f06adedec2de0d5ae639da372e6485363107f97767b505cee755d03a5e58ac228659af123184b7b733322e38c91dbf5a943ab3d52e64b49ee755d2e64950e238e35f10c884e17cbe87dc540e6d7509a4f110e9f7566a471712850abf6ce463e6280bacea36fd33a4497f773cf32c698dcc4beee33938edc7ad05534aea683ae61d64c4d2a69b6b88d16d5ca5c303f3e386cf61db140e27b5e99e96b64bdd562b6b30aa36c6c37cac7dc9eec6b42c1a66a962fa70beb6b516d0cbe76322f86c78f6c66831bf8b5d5d2dfa35a5dce60b1933b6ce3c788769f2b331ec1b8fd2831b79649984b239773c1dc68129725c1c640e73400ec781d8fb1a03c4a85d0c8582640257bd01e51fc42236263c9c67be280429c6037eb405dbf5fd682c2a0bb976cf07d3fc5009279ef8ec4e68193a9902b28e7dc71fb501d95b098e0f6dd9e0d0049131019b047b8390281bb292484e47c8500c4f242c3076bf704704739a0be7c3febfbae9a5daf23cd017c7e19fb107bb67d0f6fd6837cd2757d1fab34f4f05e37dde630b1c3a91edf4f7159103d6eb7da65fdbdf59dadb5e2460ac876ed9e1c8c060f9efe9c8a0a75cfc42d5742d2ee5a7e9dbb494b6d6b9bc930cce4f940e3cd81ed4160e98f88315e689fff0022b57664199cc5196f0c7a164ef8f98cd0589baffa68590985eb15c0db1985839f6c2919340b69d03f5285bdd6f4bf021424db4329cb153fccc3d09c76a090d3340d2f479a7bab3b38e2924e5e451cfd280d7dafe936f6c5e4bd89813b02a36589ce318a0358dc35cc4e17f9bf234cdbb78fa0c607a7340e6cec20b1596610c6934b8323226379edda81da8dcb9ec40a042f50b5bb21645473b58b11dbd7bfca8304f8add5d67a9ea8ba5d8ea72c1a4d8a952f10f2c920e368cf71e99fad5833dd0754d6ed66bdb2e9a91a5babb2a310465a57c1ddc1038e7bd5171d3748b8d46ee1ff005298dc6a764c27d4eeaee7fe1c01795881c9e7804fe940dbe287c4b6d75a1b1d1c986d62277c91bf131f4c0f6fad0663737135d3b497124924871f98e7803007d2811dc5b83903dc0a0333f03be7de8122df2c9a05a11e5f51f7a05ce7071804fca8033e5da0734020b0183bb23e5416269577ed0e5323078ceeefdff6a03dbcd62914c2f629a47c622689800879e4fbd046f9d8a2a03e31385c0e73da8b83ca590947dcaead8208e73da8849b3e19ce704f7c5015586d006431f5cf61f3a04ee586ff002481c8fe6191408f0011eb8e30682774dea9bbb5784492ca6385832e1ca95e3d2834be9df8c312e2db5eb4375080337000f1303d18763591a469baef4d755989ec6f6dae5a23e20b599406dd8e080ddbed41272f4dd8caf1c86d163910f9595882a3d718a035edd695d3b6a926b57d0ac65b10b4e06eedd863bf141077fd7af2782bd3fa26a1a8891d57c630948c0279393dcd04cf5875258f4de9f0cb7b7b6d66d2b81ba752d85f5214724fed41036bd79d2fe319d7a8f4b9c81e58de2f04827b9ce09a07a3acecf54b790685ace8697606009e52c377b7f2e682b097d7d36acf0f55df5edbdc0977412468cb6ce3be10af3c63b9c8a0b0751f505be9690dd5d752436f62a3fe4c6448f3b7b0c64e38f615734651f107e3045ac42b67a7693018633b965bc1bc838ee173807bf7cd33065baaeb1a95f2c11dfcd2bc51fe48880aa3e8a062a8b059f595df4ae9a74de9e9ec499d43c97b1427c6e47e525bb63e4282ad3ea3712893c599dbc4259c1627713c927de81043950df97db1406da8411c92063be280230839627078e79a0390a71b5bb5003a8c1232338e4507025573e9fbd02a0e41dc0e680c3691cf714053bb34160895dc16f291d98d02322aa39f3e14707ffaa06f202a5bb0c7201f4a343aca51090497efdfbfce89840c8db8e46573923ff14410b00490d9f5c1a0425dd8ce4673e873cd0265e4dbe7041ed814009b8cbb8e5863bd07163b7716e0607b6698060b96b7b9478dc8643918247ee39a60b7e97f133a8b4e0c63d4ee597380923970a3ef4c0e13e25dfcfab457ba95bdbddb212016501867b9cfbfda982f907c74b282da34874a9048aa479c83838edc62982b7ac7c42d235cd67f15ac5b40c366418a2cb0c1c81e6f5e31db14c160d035de8cd4a3f18ea96562cc37359dfe9cac887fef039fd6b39446f56ea5d13a9dca4579a922496b1975b8d22dfc3566cf9557230703be715ac1431d4d2275325d7fae6b4f6f182a93ef1e32a9f41938f6a60afeb1a95c5fea53dccf772cf2c8c489240031f627e7565c0d67bbf160487c1801073bc0c31f91f953420f2bc8c7c52cc540032738a809905c0f4fa501940208e73df34028e703938a0577ae013f4a001300db4f03b71407461ce0502dca8c9c7dcf6a003fafcbdcd0070bc1e0fd734070db467b8a04cb9c9e68274b93bcb1daa40200ed4099765249ec476cf340849b8b264823bf34689ee009cb671df1409bc8e8b8e770e3ec68984d9c953cf97be2860b248caaebc107dc67f7a184c31232db88fd451031ce50e76039f5c8045026efb8f93279e0fd680b239504f0483d88ef409ee25bb90c79c0e050151c6e21b39ce783eb40adbcc2cefa17bdb61322387781c950e3dbdf9c8a066f28790b22e013db3dbef54726081e63c6460d34191b1bb0720f634060e7600412c781502409c8e3d7b500ed71dbef8ed40243f181c0a02e5d4e0fad006f644e4819e3b501f7e3049e7b501bc43b4e391da80558003392d40a23305e320d02e64cf998e1bf5a032b0c927b8e68049c8c8e71c6280377043118f4e680bbff00de0504ddbb3128371c1c64668024e59f3cd02521254e4fad1a2107e48fe6a6809ddb9e78a029e1463d05027ffc744a6c3857c7b1a205ff00e637fbf4a02b12b1794e39f4a02024e7249ed409924720906800005173fd7404989698ee39e4f7a04cf723d07a501fff0097ed406ffe36a018ff00281e99a037f4d0731f3bfd28007e53400ff99a810248c0cf140bc60123233cff008a0557f9beb4056eff007a07109243e79a03778b27bfbd02b128c27039a054001b818a06609de793da815006070283ffd9}\\par}\n}\n"
  },
  {
    "path": "test/rtf/link.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"pandoc\" ]\n          ( \"http://pandoc.org\" , \"\" )\n      ]\n  ]\n"
  },
  {
    "path": "test/rtf/link.rtf",
    "content": "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 \\fmodern Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"http://pandoc.org\"}}{\\fldrslt{pandoc}}}\n\\par}\n}\n"
  },
  {
    "path": "test/rtf/list_complex.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaInlines [ Str \"Cynthia\" , Space , Str \"Johnson\" ]\n            )\n          , ( \"operator\"\n            , MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Text\"\n                , Space\n                , Str \"before\"\n                , Space\n                , Str \"list\"\n                ]\n            )\n          ]\n    }\n  [ OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ]\n        , OrderedList\n            ( 1 , LowerAlpha , Period )\n            [ [ Para [ Str \"Three\" ] ]\n            , [ Para [ Str \"Four\" ]\n              , OrderedList\n                  ( 1 , LowerRoman , Period )\n                  [ [ Para [ Str \"Five\" ] ]\n                  , [ Para [ Str \"Six\" ]\n                    , OrderedList\n                        ( 1 , UpperAlpha , Period )\n                        [ [ Para [ Str \"Seven\" ] ]\n                        , [ Para [ Str \"Eight\" ]\n                          , OrderedList\n                              ( 1 , UpperRoman , Period )\n                              [ [ Para [ Str \"Nine\" ] ]\n                              , [ Para [ Str \"Ten\" ]\n                                , BulletList\n                                    [ [ Para [ Str \"Eleven\" ] ]\n                                    , [ Para [ Str \"Twelve\" ] ]\n                                    ]\n                                ]\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Out\" , Space , Str \"of\" , Space , Str \"list!\" ]\n  , Para [ Str \"Start\" , Space , Str \"with\" ]\n  , OrderedList\n      ( 7 , Decimal , Period )\n      [ [ Para [ Str \"Seven\" , Space , Str \"Start\" ] ]\n      , [ Para [ Str \"Eight\" , Space , Str \"Continue\" ] ]\n      ]\n  ]\n"
  },
  {
    "path": "test/rtf/list_complex.rtf",
    "content": "{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1\\adeff45\\deff0\\stshfdbch31505\\stshfloch31506\\stshfhich31506\\stshfbi0\\deflang1033\\deflangfe1033\\themelang1033\\themelangfe0\\themelangcs0{\\fonttbl{\\f0\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f2\\fbidi \\fmodern\\fcharset0\\fprq1{\\*\\panose 02070309020205020404}Courier New;}\r\n{\\f3\\fbidi \\fdecor\\fcharset2\\fprq2{\\*\\panose 00000000000000000000}Symbol;}{\\f34\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02040503050406030204}Cambria Math;}{\\f45\\fbidi \\fnil\\fcharset0\\fprq2{\\*\\panose 00000000000000000000}Times;}\r\n{\\flomajor\\f31500\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fdbmajor\\f31501\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\r\n{\\fhimajor\\f31502\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0302020204030204}Calibri Light;}{\\fbimajor\\f31503\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\r\n{\\flominor\\f31504\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fdbminor\\f31505\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\r\n{\\fhiminor\\f31506\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0502020204030204}Calibri;}{\\fbiminor\\f31507\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f52\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\r\n{\\f53\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\f55\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\f56\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\f57\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\f58\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\f59\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\f60\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\f72\\fbidi \\fmodern\\fcharset238\\fprq1 Courier New CE;}\r\n{\\f73\\fbidi \\fmodern\\fcharset204\\fprq1 Courier New Cyr;}{\\f75\\fbidi \\fmodern\\fcharset161\\fprq1 Courier New Greek;}{\\f76\\fbidi \\fmodern\\fcharset162\\fprq1 Courier New Tur;}{\\f77\\fbidi \\fmodern\\fcharset177\\fprq1 Courier New (Hebrew);}\r\n{\\f78\\fbidi \\fmodern\\fcharset178\\fprq1 Courier New (Arabic);}{\\f79\\fbidi \\fmodern\\fcharset186\\fprq1 Courier New Baltic;}{\\f80\\fbidi \\fmodern\\fcharset163\\fprq1 Courier New (Vietnamese);}{\\f392\\fbidi \\froman\\fcharset238\\fprq2 Cambria Math CE;}\r\n{\\f393\\fbidi \\froman\\fcharset204\\fprq2 Cambria Math Cyr;}{\\f395\\fbidi \\froman\\fcharset161\\fprq2 Cambria Math Greek;}{\\f396\\fbidi \\froman\\fcharset162\\fprq2 Cambria Math Tur;}{\\f399\\fbidi \\froman\\fcharset186\\fprq2 Cambria Math Baltic;}\r\n{\\f400\\fbidi \\froman\\fcharset163\\fprq2 Cambria Math (Vietnamese);}{\\f502\\fbidi \\fnil\\fcharset238\\fprq2 Times CE;}{\\f503\\fbidi \\fnil\\fcharset204\\fprq2 Times Cyr;}{\\f505\\fbidi \\fnil\\fcharset161\\fprq2 Times Greek;}\r\n{\\f506\\fbidi \\fnil\\fcharset162\\fprq2 Times Tur;}{\\f509\\fbidi \\fnil\\fcharset186\\fprq2 Times Baltic;}{\\f510\\fbidi \\fnil\\fcharset163\\fprq2 Times (Vietnamese);}{\\flomajor\\f31508\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\r\n{\\flomajor\\f31509\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\flomajor\\f31511\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\flomajor\\f31512\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\r\n{\\flomajor\\f31513\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\flomajor\\f31514\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\flomajor\\f31515\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\r\n{\\flomajor\\f31516\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fdbmajor\\f31518\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fdbmajor\\f31519\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\r\n{\\fdbmajor\\f31521\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fdbmajor\\f31522\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fdbmajor\\f31523\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\fdbmajor\\f31524\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fdbmajor\\f31525\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fdbmajor\\f31526\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}\r\n{\\fhimajor\\f31528\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri Light CE;}{\\fhimajor\\f31529\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Light Cyr;}{\\fhimajor\\f31531\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Light Greek;}\r\n{\\fhimajor\\f31532\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Light Tur;}{\\fhimajor\\f31533\\fbidi \\fswiss\\fcharset177\\fprq2 Calibri Light (Hebrew);}{\\fhimajor\\f31534\\fbidi \\fswiss\\fcharset178\\fprq2 Calibri Light (Arabic);}\r\n{\\fhimajor\\f31535\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Light Baltic;}{\\fhimajor\\f31536\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri Light (Vietnamese);}{\\fbimajor\\f31538\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\r\n{\\fbimajor\\f31539\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fbimajor\\f31541\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fbimajor\\f31542\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\r\n{\\fbimajor\\f31543\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fbimajor\\f31544\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fbimajor\\f31545\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\r\n{\\fbimajor\\f31546\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\flominor\\f31548\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\flominor\\f31549\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\r\n{\\flominor\\f31551\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\flominor\\f31552\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\flominor\\f31553\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\flominor\\f31554\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\flominor\\f31555\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\flominor\\f31556\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}\r\n{\\fdbminor\\f31558\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fdbminor\\f31559\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fdbminor\\f31561\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\r\n{\\fdbminor\\f31562\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fdbminor\\f31563\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fdbminor\\f31564\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\r\n{\\fdbminor\\f31565\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fdbminor\\f31566\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fhiminor\\f31568\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri CE;}\r\n{\\fhiminor\\f31569\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Cyr;}{\\fhiminor\\f31571\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Greek;}{\\fhiminor\\f31572\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Tur;}\r\n{\\fhiminor\\f31575\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Baltic;}{\\fbiminor\\f31578\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fbiminor\\f31579\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\r\n{\\fbiminor\\f31581\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fbiminor\\f31582\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fbiminor\\f31583\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\r\n{\\fbiminor\\f31584\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fbiminor\\f31585\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fbiminor\\f31586\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}}\r\n{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0;\r\n\\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;\\red0\\green0\\blue0;\\red0\\green0\\blue0;}{\\*\\defchp \\fs24\\loch\\af31506\\hich\\af31506\\dbch\\af31505 }{\\*\\defpap \r\n\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 }\\noqfpromote {\\stylesheet{\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af45\\afs24\\alang1025 \\ltrch\\fcs0 \r\n\\fs24\\lang1033\\langfe1033\\loch\\f45\\hich\\af45\\dbch\\af31505\\cgrid\\langnp1033\\langfenp1033 \\snext0 \\sqformat \\spriority0 Normal;}{\\*\\cs10 \\additive Default Paragraph Font;}{\\*\r\n\\ts11\\tsrowd\\trftsWidthB3\\trpaddl108\\trpaddr108\\trpaddfl3\\trpaddft3\\trpaddfb3\\trpaddfr3\\trcbpat1\\trcfpat1\\tblind0\\tblindtype3\\tsvertalt\\tsbrdrt\\tsbrdrl\\tsbrdrb\\tsbrdrr\\tsbrdrdgl\\tsbrdrdgr\\tsbrdrh\\tsbrdrv \r\n\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af0\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\lang1033\\langfe1033\\loch\\f31506\\hich\\af31506\\dbch\\af31505\\cgrid\\langnp1033\\langfenp1033 \r\n\\snext11 \\ssemihidden \\sunhideused Normal Table;}}{\\*\\listtable{\\list\\listtemplateid2032649{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'01\\u-3913 _;}{\\levelnumbers;}\r\n\\fs28\\cf0\\loch\\af3\\hich\\af3\\dbch\\af0\\fbias0\\hres0\\chhres0 \\fi-360\\li360\\jclisttab\\tx360\\lin360 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'04\\'00.\\'01.;}{\\levelnumbers\\'01\\'03;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-432\\li792\\jclisttab\\tx792\\lin792 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'06\\'00.\\'01.\\'02.;}{\\levelnumbers\\'01\\'03\\'05;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-504\\li1224\\jclisttab\\tx1440\\lin1224 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'08\\'00.\\'01.\\'02.\\'03.;}{\\levelnumbers\r\n\\'01\\'03\\'05\\'07;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-648\\li1728\\jclisttab\\tx2160\\lin1728 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'0a\\'00.\\'01.\\'02.\\'03.\\'04.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-792\\li2232\\jclisttab\\tx2520\\lin2232 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0\r\n{\\leveltext\\'0c\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-936\\li2736\\jclisttab\\tx3240\\lin2736 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\'0e\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.\\'06.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b\\'0d;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-1080\\li3240\\jclisttab\\tx3600\\lin3240 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\r\n\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'10\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.\\'06.\\'07.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b\\'0d\\'0f;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-1224\\li3744\\jclisttab\\tx4320\\lin3744 }\r\n{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'12\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.\\'06.\\'07.\\'08.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b\\'0d\\'0f\\'11;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-1440\\li4320\\jclisttab\\tx4680\\lin4320 }{\\listname ;}\\listid161162663}{\\list\\listtemplateid-1055851588{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'01.;}{\\levelnumbers\\'01;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc3\\levelnfcn3\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\\'02\\'03.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }\r\n{\\listlevel\\levelnfc1\\levelnfcn1\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace540\\levelindent0{\\leveltext\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li3420\\lin3420 }{\\listlevel\\levelnfc23\\levelnfcn23\r\n\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\\'01o;}{\\levelnumbers;}\\f2\\fbias0\\hres0\\chhres0 \\fi-360\\li4500\\lin4500 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\r\n\\levelindent0{\\leveltext\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'08.;}{\\levelnumbers\\'01;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid180975272}{\\list\\listtemplateid-1055851588\\listhybrid{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\leveltemplateid67698703\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\leveltemplateid67698713\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\leveltemplateid67698715\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc3\\levelnfcn3\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\r\n\\leveltemplateid67698709\\'02\\'03.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc1\\levelnfcn1\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace540\\levelindent0{\\leveltext\r\n\\leveltemplateid67698707\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li3420\\lin3420 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\r\n\\leveltemplateid67698691\\'01o;}{\\levelnumbers;}\\f2\\fbias0\\hres0\\chhres0 \\fi-360\\li4500\\lin4500 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698703\r\n\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\r\n\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\r\n\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid581336416}{\\list\\listtemplateid-1516889114\\listhybrid{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698703\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698703\\'02\\'03.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li3600\\lin3600 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\\'02\\'05.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li4320\\lin4320 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698703\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\lvltentative\r\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid592708402}{\\list\\listtemplateid353931476{\\listlevel\\levelnfc0\\levelnfcn0\r\n\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\r\n\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0\r\n{\\leveltext\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc3\\levelnfcn3\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\\'02\\'03.;}{\\levelnumbers\r\n\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc1\\levelnfcn1\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace540\\levelindent0{\\leveltext\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-180\\li3420\\lin3420 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'05.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li4320\\lin4320 }\r\n{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\r\n\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid621182402}{\\list\\listtemplateid-37037068{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'03.;}{\\levelnumbers\\'01;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-360\\li3600\\lin3600 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'05.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li4320\\lin4320 }\r\n{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\r\n\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid982349901}{\\list\\listtemplateid-2094603378{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'03.;}{\\levelnumbers\\'01;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-360\\li3600\\lin3600 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'05.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li4320\\lin4320 }\r\n{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\r\n\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\r\n\\levelspace0\\levelindent0{\\leveltext\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid1082678316}{\\list\\listtemplateid166376406\\listhybrid{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\r\n\\leveljcn0\\levelfollow0\\levelstartat7\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid-1898031884\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698703\\'02\\'03.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li3600\\lin3600 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\\'02\\'05.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li4320\\lin4320 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698703\\'02\\'06.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698713\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\r\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67698715\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }{\\listname ;}\\listid1306352145}\r\n{\\list\\listtemplateid2032649{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li360\\jclisttab\\tx360\\lin360 }\r\n{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'04\\'00.\\'01.;}{\\levelnumbers\\'01\\'03;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-432\\li792\\jclisttab\\tx792\\lin792 }{\\listlevel\r\n\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'06\\'00.\\'01.\\'02.;}{\\levelnumbers\\'01\\'03\\'05;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-504\\li1224\\jclisttab\\tx1440\\lin1224 }{\\listlevel\r\n\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'08\\'00.\\'01.\\'02.\\'03.;}{\\levelnumbers\\'01\\'03\\'05\\'07;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-648\\li1728\\jclisttab\\tx2160\\lin1728 }\r\n{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'0a\\'00.\\'01.\\'02.\\'03.\\'04.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-792\\li2232\r\n\\jclisttab\\tx2520\\lin2232 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'0c\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-936\\li2736\\jclisttab\\tx3240\\lin2736 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'0e\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.\\'06.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b\\'0d;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-1080\\li3240\\jclisttab\\tx3600\\lin3240 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'10\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.\\'06.\\'07.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b\\'0d\\'0f;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-1224\\li3744\\jclisttab\\tx4320\\lin3744 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\r\n\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'12\\'00.\\'01.\\'02.\\'03.\\'04.\\'05.\\'06.\\'07.\\'08.;}{\\levelnumbers\\'01\\'03\\'05\\'07\\'09\\'0b\\'0d\\'0f\\'11;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-1440\\li4320\\jclisttab\\tx4680\\lin4320 }{\\listname \r\n;}\\listid1517575639}{\\list\\listtemplateid-2069710980{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'00.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\fbias0\\hres0\\chhres0 \r\n\\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'01.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li1440\\lin1440 }{\\listlevel\r\n\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'02.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li2160\\lin2160 }{\\listlevel\\levelnfc3\\levelnfcn3\\leveljc0\\leveljcn0\r\n\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\\'02\\'03.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\r\n\\levelindent0{\\leveltext\\'02\\'04.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li3600\\lin3600 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\r\n\\'02\\'05.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li4320\\lin4320 }{\\listlevel\\levelnfc0\\levelnfcn0\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'06.;}{\\levelnumbers\\'01;}\r\n\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc4\\levelnfcn4\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'07.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \r\n\\hres0\\chhres0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc2\\levelnfcn2\\leveljc2\\leveljcn2\\levelfollow0\\levelstartat1\\levelspace0\\levelindent0{\\leveltext\\'02\\'08.;}{\\levelnumbers\\'01;}\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\hres0\\chhres0 \\fi-180\\li6480\\lin6480 }\r\n{\\listname ;}\\listid1762801537}}{\\*\\listoverridetable{\\listoverride\\listid1517575639\\listoverridecount0\\ls1}{\\listoverride\\listid161162663\\listoverridecount0\\ls2}{\\listoverride\\listid581336416\\listoverridecount0\\ls3}{\\listoverride\\listid1082678316\r\n\\listoverridecount0\\ls4}{\\listoverride\\listid1762801537\\listoverridecount0\\ls5}{\\listoverride\\listid621182402\\listoverridecount0\\ls6}{\\listoverride\\listid592708402\\listoverridecount0\\ls7}{\\listoverride\\listid180975272\\listoverridecount0\\ls8}\r\n{\\listoverride\\listid1306352145\\listoverridecount0\\levelstartat7\\ls9}{\\listoverride\\listid982349901\\listoverridecount0\\ls10}}{\\*\\rsidtbl \\rsid329053\\rsid3617154\\rsid3749795\\rsid9258424}{\\mmathPr\\mmathFont34\\mbrkBin0\\mbrkBinSub0\\msmallFrac0\\mdispDef1\\mlMargin0\\mrMargin0\r\n\\mdefJc1\\mwrapIndent1440\\mintLim0\\mnaryLim1}{\\info{\\title Text before list}{\\author Cynthia Johnson}{\\operator John MacFarlane}{\\creatim\\yr2003\\mo10\\dy13\\hr19\\min55}{\\revtim\\yr2021\\mo8\\dy9\\hr10\\min28}{\\version4}{\\edmins6}{\\nofpages1}{\\nofwords15}\r\n{\\nofchars87}{\\nofcharsws101}{\\vern4617}}{\\*\\xmlnstbl {\\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\\paperw12240\\paperh15840\\margl1440\\margr1440\\margt1440\\margb1440\\gutter0\\ltrsect \r\n\\widowctrl\\ftnbj\\aenddoc\\trackmoves0\\trackformatting1\\donotembedsysfont0\\relyonvml0\\donotembedlingdata1\\grfdocevents0\\validatexml0\\showplaceholdtext0\\ignoremixedcontent0\\saveinvalidxml0\\showxmlerrors0\\noxlattoyen\r\n\\expshrtn\\noultrlspc\\dntblnsbdb\\nospaceforul\\formshade\\horzdoc\\dghspace180\\dgvspace180\\dghorigin1701\\dgvorigin1984\\dghshow0\\dgvshow0\r\n\\jexpand\\viewkind1\\viewscale154\\pgbrdrhead\\pgbrdrfoot\\splytwnine\\ftnlytwnine\\htmautsp\\nolnhtadjtbl\\useltbaln\\alntblind\\lytcalctblwd\\lyttblrtgr\\lnbrkrule\\rsidroot3749795 \\fet0{\\*\\wgrffmtfilter 2450}\\ilfomacatclnup0\\ltrpar \\sectd \\ltrsect\r\n\\linex0\\endnhere\\sectdefaultcl\\sftnbj {\\*\\pnseclvl1\\pnucrm\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl2\\pnucltr\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl3\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl4\r\n\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxta )}}{\\*\\pnseclvl5\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl6\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl7\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}\r\n{\\pntxta )}}{\\*\\pnseclvl8\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl9\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \r\n\\hich\\af45\\dbch\\af31505\\loch\\f45 1.\\tab}\\pard\\plain \\ltrpar\\ql \\fi-360\\li720\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls3\\adjustright\\rin0\\lin720\\itap0\\pararsid9258424 \\rtlch\\fcs1 \\af45\\afs24\\alang1025 \\ltrch\\fcs0 \r\n\\fs24\\lang1033\\langfe1033\\loch\\af45\\hich\\af45\\dbch\\af31505\\cgrid\\langnp1033\\langfenp1033 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 One}{\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid329053 \r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 2.\\tab}}{\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Two\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 a.\\tab}}\\pard \\ltrpar\r\n\\ql \\fi-360\\li1440\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls3\\ilvl1\\adjustright\\rin0\\lin1440\\itap0\\pararsid9258424 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Three\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 b.\\tab}\\hich\\af45\\dbch\\af31505\\loch\\f45 Four\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 i.\\tab}}\\pard \\ltrpar\r\n\\ql \\fi-180\\li2160\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls3\\ilvl2\\adjustright\\rin0\\lin2160\\itap0\\pararsid9258424 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Five\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 ii.\\tab}\\hich\\af45\\dbch\\af31505\\loch\\f45 Six\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 A.\\tab}}\\pard \\ltrpar\r\n\\ql \\fi-360\\li2880\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls3\\ilvl3\\adjustright\\rin0\\lin2880\\itap0\\pararsid9258424 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Seven\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 B.\\tab}\\hich\\af45\\dbch\\af31505\\loch\\f45 Eight\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 I.\\tab}}\\pard \\ltrpar\r\n\\ql \\fi-180\\li3420\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls3\\ilvl4\\adjustright\\rin0\\lin3420\\itap0\\pararsid9258424 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Nine\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f45\\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 II.\\tab}\\hich\\af45\\dbch\\af31505\\loch\\f45 Ten\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\f2\\insrsid9258424 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\\ql \\fi-360\\li4500\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls3\\ilvl5\\adjustright\\rin0\\lin4500\\itap0\\pararsid9258424 {\r\n\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Eleven\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\f2\\insrsid9258424 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}\\hich\\af45\\dbch\\af31505\\loch\\f45 Twelve\r\n\\par }\\pard \\ltrpar\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0\\pararsid9258424 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \\hich\\af45\\dbch\\af31505\\loch\\f45 Out of list!\r\n\\par }\\pard \\ltrpar\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0\\pararsid3617154 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid3617154 \\hich\\af45\\dbch\\af31505\\loch\\f45 Start with\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\f45\\insrsid3617154 \\hich\\af45\\dbch\\af31505\\loch\\f45 7.\\tab}}\\pard \\ltrpar\\ql \\fi-360\\li720\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\ls9\\adjustright\\rin0\\lin720\\itap0\\pararsid3617154 {\r\n\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid3617154 \\hich\\af45\\dbch\\af31505\\loch\\f45 Seven Start\r\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\f45\\insrsid3617154 \\hich\\af45\\dbch\\af31505\\loch\\f45 8.\\tab}\\hich\\af45\\dbch\\af31505\\loch\\f45 Eight Continue\r\n\\par }\\pard \\ltrpar\\ql \\li0\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0\\pararsid3617154 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid3617154 \r\n\\par }\\pard \\ltrpar\\ql \\li4140\\ri0\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin4140\\itap0\\pararsid9258424 {\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid9258424 \r\n\\par }{\\rtlch\\fcs1 \\af45 \\ltrch\\fcs0 \\insrsid3617154 \r\n\\par }{\\*\\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a\r\n9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad\r\n5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6\r\nb01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0\r\n0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6\r\na7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f\r\nc7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512\r\n0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462\r\na1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865\r\n6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b\r\n4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b\r\n4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b6f4679893070000c9200000160000007468656d652f7468656d652f\r\n7468656d65312e786d6cec59cd8b1bc915bf07f23f347d97f5d5ad8fc1f2a24fcfda33b6b164873dd648a5eef2547789aad28cc56208de532e81c026e49085bd\r\ned21842cecc22eb9e48f31d8249b3f22afaa5bdd5552c99e191c3061463074977eefd5afde7bf5de53d5ddcf5e26d4bbc05c1096f6fcfa9d9aefe174ce16248d\r\n7afeb3d9a4d2f13d2151ba4094a5b8e76fb0f03fbbf7eb5fdd454732c609f6403e1547a8e7c752ae8eaa5531876124eeb0154ee1bb25e30992f0caa3ea82a34b\r\nd09bd06aa3566b55134452df4b51026a1f2f97648ebd9952e9dfdb2a1f53784da5500373caa74a35b6243476715e5708b11143cabd0b447b3eccb3609733fc52\r\nfa1e4542c2173dbfa6fffceabdbb5574940b517940d6909be8bf5c2e17589c37f49c3c3a2b260d823068f50bfd1a40e53e6edc1eb7c6ad429f06a0f91c569a71\r\nb175b61bc320c71aa0ecd1a17bd41e35eb16ded0dfdce3dc0fd5c7c26b50a63fd8c34f2643b0a285d7a00c1feee1c3417730b2f56b50866fede1dbb5fe28685b\r\nfa3528a6243ddf43d7c25673b85d6d0159327aec8477c360d26ee4ca4b144443115d6a8a254be5a1584bd00bc6270050408a24493db959e1259a43140f112567\r\n9c7827248a21f056286502866b8ddaa4d684ffea13e827ed5174849121ad780113b137a4f87862cec94af6fc07a0d537206f7ffef9cdeb1fdfbcfee9cd575fbd\r\n79fdf77c6eadca923b466964cafdf2dd1ffef3cd6fbd7ffff0ed2f5fff319b7a172f4cfcbbbffdeedd3ffef93ef5b0e2d2146ffff4fdbb1fbf7ffbe7dfffebaf\r\n5f3bb4f7393a33e1339260e13dc297de5396c0021dfcf119bf9ec42c46c494e8a791402952b338f48f656ca11f6d10450edc00db767cce21d5b880f7d72f2cc2\r\nd398af2571687c182716f094313a60dc6985876a2ec3ccb3751ab927e76b13f714a10bd7dc43945a5e1eaf579063894be530c616cd2714a5124538c5d253dfb1\r\n738c1dabfb8210cbaea764ce99604be97d41bc01224e93ccc899154da5d03149c02f1b1741f0b7659bd3e7de8051d7aa47f8c246c2de40d4417e86a965c6fb68\r\n2d51e252394309350d7e8264ec2239ddf0b9891b0b099e8e3065de78818570c93ce6b05ec3e90f21cdb8dd7e4a37898de4929cbb749e20c64ce4889d0f6394ac\r\n5cd829496313fbb938871045de13265df05366ef10f50e7e40e941773f27d872f787b3c133c8b026a53240d4376beef0e57dccacf89d6ee8126157aae9f3c44a\r\nb17d4e9cd131584756689f604cd1255a60ec3dfbdcc160c05696cd4bd20f62c82ac7d815580f901dabea3dc5027a25d5dcece7c91322ac909de2881de073bad9\r\n493c1b9426881fd2fc08bc6eda7c0ca52e7105c0633a3f37818f08f480102f4ea33c16a0c308ee835a9fc4c82a60ea5db8e375c32dff5d658fc1be7c61d1b8c2\r\nbe04197c6d1948eca6cc7b6d3343d49aa00c9819822ec3956e41c4727f29a28aab165b3be596f6a62ddd00dd91d5f42424fd6007b4d3fb84ffbbde073a8cb77f\r\nf9c6b10f3e4ebfe3566c25ab6b763a8792c9f14e7f7308b7dbd50c195f904fbfa919a175fa04431dd9cf58b73dcd6d4fe3ffdff73487f6f36d2773a8dfb8ed64\r\n7ce8306e3b99fc70e5e3743265f3027d8d3af0c80e7af4b14f72f0d46749289dca0dc527421ffc08f83db398c0a092d3279eb838055cc5f0a8ca1c4c60e1228e\r\nb48cc799fc0d91f134462b381daafb4a492472d591f0564cc0a1911e76ea5678ba4e4ed9223becacd7d5c16656590592e5782d2cc6e1a04a66e856bb3cc02bd4\r\n6bb6913e68dd1250b2d721614c6693683a48b4b783ca48fa58178ce620a157f65158741d2c3a4afdd6557b2c805ae115f8c1edc1cff49e1f06200242701e07cd\r\nf942f92973f5d6bbda991fd3d3878c69450034d8db08283ddd555c0f2e4fad2e0bb52b78da2261849b4d425b46377822869fc17974aad1abd0b8aeafbba54b2d\r\n7aca147a3e08ad9246bbf33e1637f535c8ede6069a9a9982a6de65cf6f35430899395af5fc251c1ac363b282d811ea3717a211dcbccc25cf36fc4d32cb8a0b39\r\n4222ce0cae934e960d122231f728497abe5a7ee1069aea1ca2b9d51b90103e59725d482b9f1a3970baed64bc5ce2b934dd6e8c284b67af90e1b35ce1fc568bdf\r\n1cac24d91adc3d8d1797de195df3a708422c6cd795011744c0dd413db3e682c0655891c8caf8db294c79da356fa3740c65e388ae62945714339967709dca0b3a\r\nfaadb081f196af190c6a98242f8467912ab0a651ad6a5a548d8cc3c1aafb6121653923699635d3ca2aaa6abab39835c3b60cecd8f26645de60b53531e434b3c2\r\n67a97b37e576b7b96ea74f28aa0418bcb09fa3ea5ea12018d4cac92c6a8af17e1a56393b1fb56bc776811fa07695226164fdd656ed8edd8a1ae19c0e066f54f9\r\n416e376a6168b9ed2bb5a5f5adb979b1cdce5e40f2184197bba6526857c2c92e47d0104d754f92a50dd8222f65be35e0c95b73d2f3bfac85fd60d80887955a27\r\n1c57826650ab74c27eb3d20fc3667d1cd66ba341e31514161927f530bbb19fc00506dde4f7f67a7cefee3ed9ded1dc99b3a4caf4dd7c5513d777f7f5c6e1bb7b\r\n8f40d2f9b2d598749bdd41abd26df627956034e854bac3d6a0326a0ddba3c9681876ba9357be77a1c141bf390c5ae34ea5551f0e2b41aba6e877ba9576d068f4\r\n8376bf330efaaff23606569ea58fdc16605ecdebde7f010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d65\r\n2f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d36\r\n3f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e\r\n3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d985\r\n0528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000000000\r\n0000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000\r\n000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019020000\r\n7468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100b6f4679893070000c92000001600000000000000\r\n000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000\r\n000000000000000000009d0a00007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000980b00000000}\r\n{\\*\\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d\r\n617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169\r\n6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363\r\n656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}\r\n{\\*\\latentstyles\\lsdstimax376\\lsdlockeddef0\\lsdsemihiddendef0\\lsdunhideuseddef0\\lsdqformatdef0\\lsdprioritydef99{\\lsdlockedexcept \\lsdqformat1 \\lsdpriority0 \\lsdlocked0 Normal;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 1;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 4;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 7;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 9;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 1;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 5;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index 9;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 1;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 6;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 7;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 8;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority39 \\lsdlocked0 toc 9;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal Indent;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footnote text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 header;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footer;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 index heading;\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority35 \\lsdlocked0 caption;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 table of figures;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 envelope address;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 envelope return;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 footnote reference;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation reference;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 line number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 page number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 endnote reference;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 endnote text;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 table of authorities;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 macro;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 toa heading;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Bullet 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 4;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Number 5;\\lsdqformat1 \\lsdpriority10 \\lsdlocked0 Title;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Closing;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Signature;\\lsdsemihidden1 \\lsdlocked0 Default Paragraph Font;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 4;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 List Continue 5;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Message Header;\\lsdqformat1 \\lsdpriority11 \\lsdlocked0 Subtitle;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Salutation;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Date;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text First Indent;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text First Indent 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Note Heading;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Body Text Indent 3;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Block Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Hyperlink;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 FollowedHyperlink;\\lsdqformat1 \\lsdpriority22 \\lsdlocked0 Strong;\r\n\\lsdqformat1 \\lsdpriority20 \\lsdlocked0 Emphasis;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Document Map;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Plain Text;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 E-mail Signature;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Top of Form;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Bottom of Form;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Normal (Web);\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Acronym;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Address;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Cite;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Code;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Definition;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Keyboard;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Preformatted;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Sample;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Typewriter;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 HTML Variable;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 annotation subject;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 No List;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 1;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 2;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Outline List 3;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Balloon Text;\\lsdpriority39 \\lsdlocked0 Table Grid;\r\n\\lsdsemihidden1 \\lsdlocked0 Placeholder Text;\\lsdqformat1 \\lsdpriority1 \\lsdlocked0 No Spacing;\\lsdpriority60 \\lsdlocked0 Light Shading;\\lsdpriority61 \\lsdlocked0 Light List;\\lsdpriority62 \\lsdlocked0 Light Grid;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1;\\lsdpriority64 \\lsdlocked0 Medium Shading 2;\\lsdpriority65 \\lsdlocked0 Medium List 1;\\lsdpriority66 \\lsdlocked0 Medium List 2;\\lsdpriority67 \\lsdlocked0 Medium Grid 1;\\lsdpriority68 \\lsdlocked0 Medium Grid 2;\r\n\\lsdpriority69 \\lsdlocked0 Medium Grid 3;\\lsdpriority70 \\lsdlocked0 Dark List;\\lsdpriority71 \\lsdlocked0 Colorful Shading;\\lsdpriority72 \\lsdlocked0 Colorful List;\\lsdpriority73 \\lsdlocked0 Colorful Grid;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 1;\r\n\\lsdpriority61 \\lsdlocked0 Light List Accent 1;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 1;\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 1;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 1;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 1;\r\n\\lsdsemihidden1 \\lsdlocked0 Revision;\\lsdqformat1 \\lsdpriority34 \\lsdlocked0 List Paragraph;\\lsdqformat1 \\lsdpriority29 \\lsdlocked0 Quote;\\lsdqformat1 \\lsdpriority30 \\lsdlocked0 Intense Quote;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 1;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 1;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 1;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 1;\\lsdpriority70 \\lsdlocked0 Dark List Accent 1;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 1;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 1;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 1;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 2;\\lsdpriority61 \\lsdlocked0 Light List Accent 2;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 2;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 2;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 2;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 2;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 2;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 2;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 2;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 2;\\lsdpriority70 \\lsdlocked0 Dark List Accent 2;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 2;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 2;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 2;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 3;\\lsdpriority61 \\lsdlocked0 Light List Accent 3;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 3;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 3;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 3;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 3;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 3;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 3;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 3;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 3;\\lsdpriority70 \\lsdlocked0 Dark List Accent 3;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 3;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 3;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 3;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 4;\\lsdpriority61 \\lsdlocked0 Light List Accent 4;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 4;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 4;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 4;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 4;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 4;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 4;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 4;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 4;\\lsdpriority70 \\lsdlocked0 Dark List Accent 4;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 4;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 4;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 4;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 5;\\lsdpriority61 \\lsdlocked0 Light List Accent 5;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 5;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 5;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 5;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 5;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 5;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 5;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 5;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 5;\\lsdpriority70 \\lsdlocked0 Dark List Accent 5;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 5;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 5;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 5;\\lsdpriority60 \\lsdlocked0 Light Shading Accent 6;\\lsdpriority61 \\lsdlocked0 Light List Accent 6;\\lsdpriority62 \\lsdlocked0 Light Grid Accent 6;\r\n\\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 6;\\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 6;\\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 6;\\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 6;\r\n\\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 6;\\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 6;\\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 6;\\lsdpriority70 \\lsdlocked0 Dark List Accent 6;\\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 6;\r\n\\lsdpriority72 \\lsdlocked0 Colorful List Accent 6;\\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 6;\\lsdqformat1 \\lsdpriority19 \\lsdlocked0 Subtle Emphasis;\\lsdqformat1 \\lsdpriority21 \\lsdlocked0 Intense Emphasis;\r\n\\lsdqformat1 \\lsdpriority31 \\lsdlocked0 Subtle Reference;\\lsdqformat1 \\lsdpriority32 \\lsdlocked0 Intense Reference;\\lsdqformat1 \\lsdpriority33 \\lsdlocked0 Book Title;\\lsdsemihidden1 \\lsdunhideused1 \\lsdpriority37 \\lsdlocked0 Bibliography;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdqformat1 \\lsdpriority39 \\lsdlocked0 TOC Heading;\\lsdpriority41 \\lsdlocked0 Plain Table 1;\\lsdpriority42 \\lsdlocked0 Plain Table 2;\\lsdpriority43 \\lsdlocked0 Plain Table 3;\\lsdpriority44 \\lsdlocked0 Plain Table 4;\r\n\\lsdpriority45 \\lsdlocked0 Plain Table 5;\\lsdpriority40 \\lsdlocked0 Grid Table Light;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light;\\lsdpriority47 \\lsdlocked0 Grid Table 2;\\lsdpriority48 \\lsdlocked0 Grid Table 3;\\lsdpriority49 \\lsdlocked0 Grid Table 4;\r\n\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 1;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 1;\r\n\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 1;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 1;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 1;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 1;\r\n\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 1;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 2;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 2;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 2;\r\n\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 2;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 2;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 2;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 2;\r\n\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 3;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 3;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 3;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 3;\r\n\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 3;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 3;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 3;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 4;\r\n\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 4;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 4;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 4;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 4;\r\n\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 4;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 4;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 5;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 5;\r\n\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 5;\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 5;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 5;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 5;\r\n\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 5;\\lsdpriority46 \\lsdlocked0 Grid Table 1 Light Accent 6;\\lsdpriority47 \\lsdlocked0 Grid Table 2 Accent 6;\\lsdpriority48 \\lsdlocked0 Grid Table 3 Accent 6;\r\n\\lsdpriority49 \\lsdlocked0 Grid Table 4 Accent 6;\\lsdpriority50 \\lsdlocked0 Grid Table 5 Dark Accent 6;\\lsdpriority51 \\lsdlocked0 Grid Table 6 Colorful Accent 6;\\lsdpriority52 \\lsdlocked0 Grid Table 7 Colorful Accent 6;\r\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light;\\lsdpriority47 \\lsdlocked0 List Table 2;\\lsdpriority48 \\lsdlocked0 List Table 3;\\lsdpriority49 \\lsdlocked0 List Table 4;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark;\r\n\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 1;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 1;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 1;\r\n\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 1;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 1;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 1;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 1;\r\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 2;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 2;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 2;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 2;\r\n\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 2;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 2;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 2;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 3;\r\n\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 3;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 3;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 3;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 3;\r\n\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 3;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 3;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 4;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 4;\r\n\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 4;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 4;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 4;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 4;\r\n\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 4;\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 5;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 5;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 5;\r\n\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 5;\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 5;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 5;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 5;\r\n\\lsdpriority46 \\lsdlocked0 List Table 1 Light Accent 6;\\lsdpriority47 \\lsdlocked0 List Table 2 Accent 6;\\lsdpriority48 \\lsdlocked0 List Table 3 Accent 6;\\lsdpriority49 \\lsdlocked0 List Table 4 Accent 6;\r\n\\lsdpriority50 \\lsdlocked0 List Table 5 Dark Accent 6;\\lsdpriority51 \\lsdlocked0 List Table 6 Colorful Accent 6;\\lsdpriority52 \\lsdlocked0 List Table 7 Colorful Accent 6;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Mention;\r\n\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Smart Hyperlink;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Hashtag;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Unresolved Mention;\\lsdsemihidden1 \\lsdunhideused1 \\lsdlocked0 Smart Link;}}{\\*\\datastore }}\r\n"
  },
  {
    "path": "test/rtf/list_simple.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ BulletList\n      [ [ Para [ Str \"one\" ] ]\n      , [ Para [ Str \"two\" ]\n        , BulletList [ [ Para [ Str \"sub\" ] ] ]\n        ]\n      ]\n  , BulletList [ [ Para [ Str \"new\" , Space , Str \"list\" ] ] ]\n  ]\n"
  },
  {
    "path": "test/rtf/list_simple.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2513\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n{\\*\\listtable{\\list\\listtemplateid1\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{disc\\}}{\\leveltext\\leveltemplateid1\\'01\\uc0\\u8226 ;}{\\levelnumbers;}\\fi-360\\li720\\lin720 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{hyphen\\}}{\\leveltext\\leveltemplateid2\\'01\\uc0\\u8259 ;}{\\levelnumbers;}\\fi-360\\li1440\\lin1440 }{\\listname ;}\\listid1}\n{\\list\\listtemplateid2\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{disc\\}}{\\leveltext\\leveltemplateid101\\'01\\uc0\\u8226 ;}{\\levelnumbers;}\\fi-360\\li720\\lin720 }{\\listname ;}\\listid2}}\n{\\*\\listoverridetable{\\listoverride\\listid1\\listoverridecount0\\ls1}{\\listoverride\\listid2\\listoverridecount0\\ls2}}\n\\margl1440\\margr1440\\vieww11520\\viewh8400\\viewkind0\n\\pard\\tx220\\tx720\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\tx6480\\tx7200\\tx7920\\tx8640\\li720\\fi-720\\pardirnatural\\partightenfactor0\n\\ls1\\ilvl0\n\\f0\\fs24 \\cf0 {\\listtext\t\\uc0\\u8226 \t}one\\\n{\\listtext\t\\uc0\\u8226 \t}two\\\n\\pard\\tx940\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\tx6480\\tx7200\\tx7920\\tx8640\\li1440\\fi-1440\\pardirnatural\\partightenfactor0\n\\ls1\\ilvl1\\cf0 {\\listtext\t\\uc0\\u8259 \t}sub\\\n\\pard\\tx220\\tx720\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\tx6480\\tx7200\\tx7920\\tx8640\\li720\\fi-720\\pardirnatural\\partightenfactor0\n\\ls2\\ilvl0\\cf0 {\\listtext\t\\uc0\\u8226 \t}new list\\\n}"
  },
  {
    "path": "test/rtf/table_error_codes.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Code\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"Error\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocFailOnWarningError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocAppError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocTemplateError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"6\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocOptionError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"21\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocUnknownReaderError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"22\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocUnknownWriterError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"23\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocUnsupportedExtensionError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"24\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocCiteprocError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"31\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocEpubSubdirectoryError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"43\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocPDFError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"44\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocXMLError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"47\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocPDFProgramNotFoundError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"61\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocHttpError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"62\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocShouldNeverHappenError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"63\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocSomeError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"64\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocParseError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"65\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocParsecError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"66\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocMakePDFError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"67\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocSyntaxMapError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"83\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocFilterError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"91\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocMacroLoop\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"92\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocUTF8DecodingError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"93\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocIpynbDecodingError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"94\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocUnsupportedCharsetError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"97\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocCouldNotFindDataFileError\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"99\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"PandocResourceNotFound\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  ]\n"
  },
  {
    "path": "test/rtf/table_error_codes.rtf",
    "content": "{\\rtf1\\ansi\n{\n\\trowd \\trgaph120\n\\clbrdrb\\brdrs\\cellx4320\\clbrdrb\\brdrs\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 Code\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Error\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 3\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocFailOnWarningError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 4\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocAppError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 5\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocTemplateError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 6\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocOptionError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 21\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocUnknownReaderError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 22\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocUnknownWriterError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 23\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocUnsupportedExtensionError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 24\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocCiteprocError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 31\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocEpubSubdirectoryError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 43\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocPDFError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 44\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocXMLError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 47\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocPDFProgramNotFoundError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 61\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocHttpError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 62\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocShouldNeverHappenError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 63\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocSomeError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 64\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocParseError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 65\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocParsecError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 66\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocMakePDFError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 67\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocSyntaxMapError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 83\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocFilterError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 91\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocMacroLoop\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 92\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocUTF8DecodingError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 93\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocIpynbDecodingError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 94\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocUnsupportedCharsetError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 97\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocCouldNotFindDataFileError\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx4320\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 99\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 PandocResourceNotFound\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n}\n"
  },
  {
    "path": "test/rtf/table_simple.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"A\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"B\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"C\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"D\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"E\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"F\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"G\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Para [ Str \"H\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  ]\n"
  },
  {
    "path": "test/rtf/table_simple.rtf",
    "content": "{\\rtf1\\ansi\n\\par\n\\trowd\n\\cellx10836\n\\pard \\intbl A \\cell\n\\pard \\intbl B \\cell\n\\pard \\intbl C \\cell\n\\pard \\intbl D \\cell\n\\row\n\\trowd\n\\cellx10836\n\\pard \\intbl E \\cell\n\\pard \\intbl F \\cell\n\\pard \\intbl G \\cell\n\\pard \\intbl H \\cell\n\\row\n\\pard\n}\n\n"
  },
  {
    "path": "test/rtf/unicode.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para [ Str \"\\8220hi\\8221\\8216hi\\8217\\61623\\945\\228\" ] ]\n"
  },
  {
    "path": "test/rtf/unicode.rtf",
    "content": "{\\rtf1\\ansi\n\\pard\n\\'93hi\\'94\n\\u8216\\'93hi\\u8217\\'94\n\\u-3913?\n\\u945a\n{\\uc2\\u228\\'E8a}\n\\par\n}\n"
  },
  {
    "path": "test/s5-basic.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"version\" content=\"S5 1.1\" />\n  <meta name=\"author\" content=\"Sam Smith\" />\n  <meta name=\"version\" content=\"S5 1.1\" />\n  <meta name=\"author\" content=\"Jen Jones\" />\n  <meta name=\"date\" content=\"2006-07-15\" />\n  <title>My S5 Document</title>\n  <style type=\"text/css\">\n    /* Default styles provided by pandoc.\n    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.\n    */\n    span.smallcaps{font-variant: small-caps;}\n    div.columns{display: flex; gap: min(4vw, 1.5em);}\n    div.column{flex: auto; overflow-x: auto;}\n    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\n    /* The extra [class] is a hack that increases specificity enough to\n       override a similar rule in reveal.js */\n    ul.task-list[class]{list-style: none;}\n    ul.task-list li input[type=\"checkbox\"] {\n      font-size: inherit;\n      width: 0.8em;\n      margin: 0 0.8em 0.2em -1.6em;\n      vertical-align: middle;\n    }\n    .display.math{display: block; text-align: center; margin: 0.5rem auto;}\n  </style>\n  <!-- configuration parameters -->\n  <meta name=\"defaultView\" content=\"slideshow\" />\n  <meta name=\"controlVis\" content=\"hidden\" />\n  <!-- style sheet links -->\n  <link rel=\"stylesheet\" href=\"s5/default/slides.css\" type=\"text/css\" media=\"projection\" id=\"slideProj\" />\n  <link rel=\"stylesheet\" href=\"s5/default/outline.css\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" />\n  <link rel=\"stylesheet\" href=\"s5/default/print.css\" type=\"text/css\" media=\"print\" id=\"slidePrint\" />\n  <link rel=\"stylesheet\" href=\"s5/default/opera.css\" type=\"text/css\" media=\"projection\" id=\"operaFix\" />\n  <!-- S5 JS -->\n  <script src=\"s5/default/slides.js\" type=\"text/javascript\"></script>\n</head>\n<body>\n<div class=\"layout\">\n<div id=\"controls\"></div>\n<div id=\"currentSlide\"></div>\n<div id=\"header\"></div>\n<div id=\"footer\">\n  <h1>July 15, 2006</h1>\n  <h2>My S5 Document</h2>\n</div>\n</div>\n<div class=\"presentation\">\n<div class=\"title-slide slide\">\n  <h1 class=\"title\">My S5 Document</h1>\n  <h3 class=\"author\">Sam Smith<br/>Jen Jones</h3>\n  <h4 class=\"date\">July 15, 2006</h4>\n</div>\n<div id=\"first-slide\" class=\"slide section level1\">\n<h1>First slide</h1>\n<ul>\n<li>first bullet</li>\n<li>second bullet</li>\n</ul>\n</div>\n<div id=\"math\" class=\"slide section level1\">\n<h1>Math</h1>\n<ul>\n<li><span class=\"math inline\">$\\frac{d}{dx}f(x)=\\lim_{h\\to\n0}\\frac{f(x+h)-f(x)}{h}$</span></li>\n</ul>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "test/s5-fancy.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"version\" content=\"S5 1.1\" />\n  <meta name=\"author\" content=\"Sam Smith\" />\n  <meta name=\"version\" content=\"S5 1.1\" />\n  <meta name=\"author\" content=\"Jen Jones\" />\n  <meta name=\"date\" content=\"2006-07-15\" />\n  <title>My S5 Document</title>\n  <style type=\"text/css\">\n    /* Default styles provided by pandoc.\n    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.\n    */\n    span.smallcaps{font-variant: small-caps;}\n    div.columns{display: flex; gap: min(4vw, 1.5em);}\n    div.column{flex: auto; overflow-x: auto;}\n    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\n    /* The extra [class] is a hack that increases specificity enough to\n       override a similar rule in reveal.js */\n    ul.task-list[class]{list-style: none;}\n    ul.task-list li input[type=\"checkbox\"] {\n      font-size: inherit;\n      width: 0.8em;\n      margin: 0 0.8em 0.2em -1.6em;\n      vertical-align: middle;\n    }\n  </style>\n  <!-- configuration parameters -->\n  <meta name=\"defaultView\" content=\"slideshow\" />\n  <meta name=\"controlVis\" content=\"hidden\" />\n  <!-- style sheet links -->\n  <link rel=\"stylesheet\" href=\"s5/default/slides.css\" type=\"text/css\" media=\"projection\" id=\"slideProj\" />\n  <link rel=\"stylesheet\" href=\"s5/default/outline.css\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" />\n  <link rel=\"stylesheet\" href=\"s5/default/print.css\" type=\"text/css\" media=\"print\" id=\"slidePrint\" />\n  <link rel=\"stylesheet\" href=\"s5/default/opera.css\" type=\"text/css\" media=\"projection\" id=\"operaFix\" />\n  <!-- S5 JS -->\n  <script src=\"s5/default/slides.js\" type=\"text/javascript\"></script>\n  <script defer=\"\"\n  src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js\"\n  type=\"text/javascript\"></script>\n</head>\n<body>\n<div class=\"layout\">\n<div id=\"controls\"></div>\n<div id=\"currentSlide\"></div>\n<div id=\"header\"></div>\n<div id=\"footer\">\n  <h1>July 15, 2006</h1>\n  <h2>My S5 Document</h2>\n</div>\n</div>\n<div class=\"presentation\">\n<div class=\"title-slide slide\">\n  <h1 class=\"title\">My S5 Document</h1>\n  <h3 class=\"author\">Sam Smith<br/>Jen Jones</h3>\n  <h4 class=\"date\">July 15, 2006</h4>\n</div>\n<div id=\"first-slide\" class=\"slide section level1\">\n<h1>First slide</h1>\n<ul class=\"incremental\">\n<li>first bullet</li>\n<li>second bullet</li>\n</ul>\n</div>\n<div id=\"math\" class=\"slide section level1\">\n<h1>Math</h1>\n<ul class=\"incremental\">\n<li><span class=\"math inline\">\\(\\frac{d}{dx}f(x)=\\lim_{h\\to\n0}\\frac{f(x+h)-f(x)}{h}\\)</span></li>\n</ul>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "test/s5-fragment.html",
    "content": "<h1 id=\"first-slide\">First slide</h1>\n<ul>\n<li>first bullet</li>\n<li>second bullet</li>\n</ul>\n<h1 id=\"math\">Math</h1>\n<ul>\n<li><span class=\"math inline\">$\\frac{d}{dx}f(x)=\\lim_{h\\to\n0}\\frac{f(x+h)-f(x)}{h}$</span></li>\n</ul>\n"
  },
  {
    "path": "test/s5-inserts.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"author\" content=\"Sam Smith\" />\n  <meta name=\"author\" content=\"Jen Jones\" />\n  <meta name=\"date\" content=\"2006-07-15\" />\n  <title>My S5 Document</title>\n  <style type=\"text/css\">\n    /* Default styles provided by pandoc.\n    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.\n    */\n    span.smallcaps{font-variant: small-caps;}\n    div.columns{display: flex; gap: min(4vw, 1.5em);}\n    div.column{flex: auto; overflow-x: auto;}\n    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\n    /* The extra [class] is a hack that increases specificity enough to\n       override a similar rule in reveal.js */\n    ul.task-list[class]{list-style: none;}\n    ul.task-list li input[type=\"checkbox\"] {\n      font-size: inherit;\n      width: 0.8em;\n      margin: 0 0.8em 0.2em -1.6em;\n      vertical-align: middle;\n    }\n    .display.math{display: block; text-align: center; margin: 0.5rem auto;}\n  </style>\n  <link rel=\"stylesheet\" href=\"main.css\" type=\"text/css\" />\n  STUFF INSERTED\n</head>\n<body>\nSTUFF INSERTED\n<div id=\"header\">\n<h1 class=\"title\">My S5 Document</h1>\n<h2 class=\"author\">Sam Smith</h2>\n<h2 class=\"author\">Jen Jones</h2>\n<h3 class=\"date\">July 15, 2006</h3>\n</div>\n<h1 id=\"first-slide\">First slide</h1>\n<ul>\n<li>first bullet</li>\n<li>second bullet</li>\n</ul>\n<h1 id=\"math\">Math</h1>\n<ul>\n<li><span class=\"math inline\">$\\frac{d}{dx}f(x)=\\lim_{h\\to\n0}\\frac{f(x+h)-f(x)}{h}$</span></li>\n</ul>\nSTUFF INSERTED\n</body>\n</html>\n"
  },
  {
    "path": "test/s5.native",
    "content": "Pandoc (Meta {unMeta = fromList [(\"author\",MetaList [MetaInlines [Str \"Sam\",Space,Str \"Smith\"],MetaInlines [Str \"Jen\",Space,Str \"Jones\"]]),(\"date\",MetaInlines [Str \"July\",Space,Str \"15,\",Space,Str \"2006\"]),(\"title\",MetaInlines [Str \"My\",Space,Str \"S5\",Space,Str \"Document\"])]})\n[Header 1 (\"first-slide\",[],[]) [Str \"First\",Space,Str \"slide\"]\n,BulletList\n [[Plain [Str \"first\",Space,Str \"bullet\"]]\n ,[Plain [Str \"second\",Space,Str \"bullet\"]]]\n,Header 1 (\"math\",[],[]) [Str \"Math\"]\n,BulletList\n [[Plain [Math InlineMath \"\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to 0}\\\\frac{f(x+h)-f(x)}{h}\"]]]]\n"
  },
  {
    "path": "test/tables/nordics.html4",
    "content": "<table id=\"nordics\" source=\"wikipedia\">\n<caption><p>States belonging to the <em>Nordics.</em></p></caption>\n<colgroup>\n<col width=\"30%\" />\n<col width=\"30%\" />\n<col width=\"20%\" />\n<col width=\"20%\" />\n</colgroup>\n<thead class=\"simple-head\">\n<tr>\n<th align=\"center\">Name</th>\n<th align=\"center\">Capital</th>\n<th align=\"center\">Population<br />\n(in 2018)</th>\n<th align=\"center\">Area<br />\n(in km<sup>2</sup>)</th>\n</tr>\n</thead>\n<tbody class=\"souvereign-states\">\n<tr class=\"country\">\n<th align=\"center\">Denmark</th>\n<td align=\"left\">Copenhagen</td>\n<td align=\"left\">5,809,502</td>\n<td align=\"left\">43,094</td>\n</tr>\n<tr class=\"country\">\n<th align=\"center\">Finland</th>\n<td align=\"left\">Helsinki</td>\n<td align=\"left\">5,537,364</td>\n<td align=\"left\">338,145</td>\n</tr>\n<tr class=\"country\">\n<th align=\"center\">Iceland</th>\n<td align=\"left\">Reykjavik</td>\n<td align=\"left\">343,518</td>\n<td align=\"left\">103,000</td>\n</tr>\n<tr class=\"country\">\n<th align=\"center\">Norway</th>\n<td align=\"left\">Oslo</td>\n<td align=\"left\">5,372,191</td>\n<td align=\"left\">323,802</td>\n</tr>\n<tr class=\"country\">\n<th align=\"center\">Sweden</th>\n<td align=\"left\">Stockholm</td>\n<td align=\"left\">10,313,447</td>\n<td align=\"left\">450,295</td>\n</tr>\n</tbody><tfoot>\n<tr id=\"summary\">\n<td align=\"center\">Total</td>\n<td align=\"left\"></td>\n<td id=\"total-population\" align=\"left\">27,376,022</td>\n<td id=\"total-area\" align=\"left\">1,258,336</td>\n</tr>\n</tfoot>\n\n</table>\n"
  },
  {
    "path": "test/tables/nordics.html5",
    "content": "<table id=\"nordics\" data-source=\"wikipedia\">\n<caption><p>States belonging to the <em>Nordics.</em></p></caption>\n<colgroup>\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 20%\" />\n<col style=\"width: 20%\" />\n</colgroup>\n<thead class=\"simple-head\">\n<tr>\n<th style=\"text-align: center;\">Name</th>\n<th style=\"text-align: center;\">Capital</th>\n<th style=\"text-align: center;\">Population<br />\n(in 2018)</th>\n<th style=\"text-align: center;\">Area<br />\n(in km<sup>2</sup>)</th>\n</tr>\n</thead>\n<tbody class=\"souvereign-states\">\n<tr class=\"country\">\n<th style=\"text-align: center;\">Denmark</th>\n<td style=\"text-align: left;\">Copenhagen</td>\n<td style=\"text-align: left;\">5,809,502</td>\n<td style=\"text-align: left;\">43,094</td>\n</tr>\n<tr class=\"country\">\n<th style=\"text-align: center;\">Finland</th>\n<td style=\"text-align: left;\">Helsinki</td>\n<td style=\"text-align: left;\">5,537,364</td>\n<td style=\"text-align: left;\">338,145</td>\n</tr>\n<tr class=\"country\">\n<th style=\"text-align: center;\">Iceland</th>\n<td style=\"text-align: left;\">Reykjavik</td>\n<td style=\"text-align: left;\">343,518</td>\n<td style=\"text-align: left;\">103,000</td>\n</tr>\n<tr class=\"country\">\n<th style=\"text-align: center;\">Norway</th>\n<td style=\"text-align: left;\">Oslo</td>\n<td style=\"text-align: left;\">5,372,191</td>\n<td style=\"text-align: left;\">323,802</td>\n</tr>\n<tr class=\"country\">\n<th style=\"text-align: center;\">Sweden</th>\n<td style=\"text-align: left;\">Stockholm</td>\n<td style=\"text-align: left;\">10,313,447</td>\n<td style=\"text-align: left;\">450,295</td>\n</tr>\n</tbody><tfoot>\n<tr id=\"summary\">\n<td style=\"text-align: center;\">Total</td>\n<td style=\"text-align: left;\"></td>\n<td id=\"total-population\" style=\"text-align: left;\">27,376,022</td>\n<td id=\"total-area\" style=\"text-align: left;\">1,258,336</td>\n</tr>\n</tfoot>\n\n</table>\n"
  },
  {
    "path": "test/tables/nordics.jats_archiving",
    "content": "<table-wrap>\n  <caption>\n    <p>States belonging to the <italic>Nordics.</italic></p>\n  </caption>\n  <table id=\"nordics\">\n    <colgroup>\n      <col width=\"30%\" />\n      <col width=\"30%\" />\n      <col width=\"20%\" />\n      <col width=\"20%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Name</th>\n        <th align=\"center\">Capital</th>\n        <th align=\"center\">Population<break/>(in 2018)</th>\n        <th align=\"center\">Area<break/>(in km<sup>2</sup>)</th>\n      </tr>\n    </thead>\n    <tfoot>\n      <tr id=\"summary\">\n        <td align=\"center\">Total</td>\n        <td align=\"left\"></td>\n        <td align=\"left\" id=\"total-population\">27,376,022</td>\n        <td align=\"left\" id=\"total-area\">1,258,336</td>\n      </tr>\n    </tfoot>\n    <tbody>\n      <tr>\n        <th align=\"center\">Denmark</th><td align=\"left\">Copenhagen</td>\n        <td align=\"left\">5,809,502</td>\n        <td align=\"left\">43,094</td>\n      </tr>\n      <tr>\n        <th align=\"center\">Finland</th><td align=\"left\">Helsinki</td>\n        <td align=\"left\">5,537,364</td>\n        <td align=\"left\">338,145</td>\n      </tr>\n      <tr>\n        <th align=\"center\">Iceland</th><td align=\"left\">Reykjavik</td>\n        <td align=\"left\">343,518</td>\n        <td align=\"left\">103,000</td>\n      </tr>\n      <tr>\n        <th align=\"center\">Norway</th><td align=\"left\">Oslo</td>\n        <td align=\"left\">5,372,191</td>\n        <td align=\"left\">323,802</td>\n      </tr>\n      <tr>\n        <th align=\"center\">Sweden</th><td align=\"left\">Stockholm</td>\n        <td align=\"left\">10,313,447</td>\n        <td align=\"left\">450,295</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n"
  },
  {
    "path": "test/tables/nordics.latex",
    "content": "\\begin{longtable}[]{@{}\n  >{\\centering\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.3000}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.3000}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.2000}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.2000}}@{}}\n\\caption[Nordic countries]{States belonging to the\n\\emph{Nordics.}}\\label{nordics}\\tabularnewline\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nName\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nCapital\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nPopulation\\\\\n(in 2018)\\strut\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nArea\\\\\n(in km\\textsuperscript{2})\\strut\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nName\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nCapital\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nPopulation\\\\\n(in 2018)\\strut\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nArea\\\\\n(in km\\textsuperscript{2})\\strut\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endhead\n\\midrule\\noalign{}\nTotal & & 27,376,022 & 1,258,336 \\\\\n\\bottomrule\\noalign{}\n\\endlastfoot\nDenmark & Copenhagen & 5,809,502 & 43,094 \\\\\nFinland & Helsinki & 5,537,364 & 338,145 \\\\\nIceland & Reykjavik & 343,518 & 103,000 \\\\\nNorway & Oslo & 5,372,191 & 323,802 \\\\\nSweden & Stockholm & 10,313,447 & 450,295 \\\\\n\\end{longtable}\n"
  },
  {
    "path": "test/tables/nordics.markdown",
    "content": "+-----------------------+-----------------------+---------------+---------------+\n| Name                  | Capital               | Population\\   | Area\\         |\n|                       |                       | (in 2018)     | (in km^2^)    |\n+:=====================:+:======================+:==============+:==============+\n| Denmark               | Copenhagen            | 5,809,502     | 43,094        |\n+-----------------------+-----------------------+---------------+---------------+\n| Finland               | Helsinki              | 5,537,364     | 338,145       |\n+-----------------------+-----------------------+---------------+---------------+\n| Iceland               | Reykjavik             | 343,518       | 103,000       |\n+-----------------------+-----------------------+---------------+---------------+\n| Norway                | Oslo                  | 5,372,191     | 323,802       |\n+-----------------------+-----------------------+---------------+---------------+\n| Sweden                | Stockholm             | 10,313,447    | 450,295       |\n+=======================+=======================+===============+===============+\n| Total                 |                       | 27,376,022    | 1,258,336     |\n+=======================+=======================+===============+===============+\n\n: States belonging to the *Nordics.* {#nordics source=\"wikipedia\"}\n"
  },
  {
    "path": "test/tables/nordics.mediawiki",
    "content": "{| id=\"nordics\" class=\"wikitable\" source=\"wikipedia\"\n|+ States belonging to the ''Nordics.''\n|-\n! style=\"text-align: center;\"| Name\n! style=\"text-align: center;\"| Capital\n! style=\"text-align: center;\"| Population<br />\n(in 2018)\n! style=\"text-align: center;\"| Area<br />\n(in km<sup>2</sup>)\n|- class=\"country\"\n! style=\"text-align: center;\"| Denmark\n| style=\"text-align: left;\"| Copenhagen\n| style=\"text-align: left;\"| 5,809,502\n| style=\"text-align: left;\"| 43,094\n|- class=\"country\"\n! style=\"text-align: center;\"| Finland\n| style=\"text-align: left;\"| Helsinki\n| style=\"text-align: left;\"| 5,537,364\n| style=\"text-align: left;\"| 338,145\n|- class=\"country\"\n! style=\"text-align: center;\"| Iceland\n| style=\"text-align: left;\"| Reykjavik\n| style=\"text-align: left;\"| 343,518\n| style=\"text-align: left;\"| 103,000\n|- class=\"country\"\n! style=\"text-align: center;\"| Norway\n| style=\"text-align: left;\"| Oslo\n| style=\"text-align: left;\"| 5,372,191\n| style=\"text-align: left;\"| 323,802\n|- class=\"country\"\n! style=\"text-align: center;\"| Sweden\n| style=\"text-align: left;\"| Stockholm\n| style=\"text-align: left;\"| 10,313,447\n| style=\"text-align: left;\"| 450,295\n|- id=\"summary\"\n! style=\"text-align: center;\"| Total\n! style=\"text-align: left;\"|\n! id=\"total-population\" style=\"text-align: left;\"| 27,376,022\n! id=\"total-area\" style=\"text-align: left;\"| 1,258,336\n|}\n"
  },
  {
    "path": "test/tables/nordics.native",
    "content": "[Table (\"nordics\",[],[(\"source\",\"wikipedia\")]) (Caption (Just [Str \"Nordic\",Space,Str \"countries\"])\n [Para [Str \"States\",Space,Str \"belonging\",Space,Str \"to\",Space,Str \"the\",Space,Emph [Str \"Nordics.\"]]])\n [(AlignCenter,ColWidth 0.3)\n ,(AlignLeft,ColWidth 0.3)\n ,(AlignLeft,ColWidth 0.2)\n ,(AlignLeft,ColWidth 0.2)]\n (TableHead (\"\",[\"simple-head\"],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Name\"]]\n  ,Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Capital\"]]\n  ,Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Population\",LineBreak,Str \"(in\",Space,Str \"2018)\"]]\n  ,Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Area\",LineBreak,Str \"(in\",Space,Str \"km\",Superscript [Str \"2\"],Str \")\"]]]])\n [(TableBody (\"\",[\"souvereign-states\"],[]) (RowHeadColumns 1)\n  []\n  [Row (\"\",[\"country\"],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Denmark\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Copenhagen\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5,809,502\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"43,094\"]]]\n  ,Row (\"\",[\"country\"],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Finland\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Helsinki\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5,537,364\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"338,145\"]]]\n  ,Row (\"\",[\"country\"],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Iceland\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Reykjavik\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"343,518\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"103,000\"]]]\n  ,Row (\"\",[\"country\"],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Norway\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Oslo\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5,372,191\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"323,802\"]]]\n  ,Row (\"\",[\"country\"],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Sweden\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Stockholm\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"10,313,447\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"450,295\"]]]])]\n (TableFoot (\"\",[],[])\n [Row (\"summary\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Total\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   []\n  ,Cell (\"total-population\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"27,376,022\"]]\n  ,Cell (\"total-area\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"1,258,336\"]]]])]\n"
  },
  {
    "path": "test/tables/nordics.typst",
    "content": "#figure(\n  align(center)[#table(\n    columns: (30%, 30%, 20%, 20%),\n    align: (center,left,left,left,),\n    table.header(table.cell(align: center)[Name], table.cell(align: center)[Capital], table.cell(align: center)[Population\n      \\ (in 2018)], table.cell(align: center)[Area \\ (in km#super[2])],),\n    table.hline(),\n    [Denmark], [Copenhagen], [5,809,502], [43,094],\n    [Finland], [Helsinki], [5,537,364], [338,145],\n    [Iceland], [Reykjavik], [343,518], [103,000],\n    [Norway], [Oslo], [5,372,191], [323,802],\n    [Sweden], [Stockholm], [10,313,447], [450,295],\n    table.hline(),\n    table.footer([Total], [], [27,376,022], [1,258,336],),\n  )]\n  , caption: [States belonging to the #emph[Nordics.]\n\n  ]\n  , kind: table\n  )\n<nordics>\n"
  },
  {
    "path": "test/tables/planets.html4",
    "content": "<table>\n<caption><p>Data about the planets of our solar system.</p></caption>\n<thead>\n<tr>\n<th colspan=\"2\" align=\"center\"></th>\n<th>Name</th>\n<th align=\"right\">Mass (10^24kg)</th>\n<th align=\"right\">Diameter (km)</th>\n<th align=\"right\">Density (kg/m^3)</th>\n<th align=\"right\">Gravity (m/s^2)</th>\n<th align=\"right\">Length of day (hours)</th>\n<th align=\"right\">Distance from Sun (10^6km)</th>\n<th align=\"right\">Mean temperature (C)</th>\n<th align=\"right\">Number of moons</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<th colspan=\"2\" rowspan=\"4\" align=\"center\">Terrestrial planets</th>\n<th>Mercury</th>\n<td align=\"right\">0.330</td>\n<td align=\"right\">4,879</td>\n<td align=\"right\">5427</td>\n<td align=\"right\">3.7</td>\n<td align=\"right\">4222.6</td>\n<td align=\"right\">57.9</td>\n<td align=\"right\">167</td>\n<td align=\"right\">0</td>\n<td>Closest to the Sun</td>\n</tr>\n<tr>\n<th>Venus</th>\n<td align=\"right\">4.87</td>\n<td align=\"right\">12,104</td>\n<td align=\"right\">5243</td>\n<td align=\"right\">8.9</td>\n<td align=\"right\">2802.0</td>\n<td align=\"right\">108.2</td>\n<td align=\"right\">464</td>\n<td align=\"right\">0</td>\n<td></td>\n</tr>\n<tr>\n<th>Earth</th>\n<td align=\"right\">5.97</td>\n<td align=\"right\">12,756</td>\n<td align=\"right\">5514</td>\n<td align=\"right\">9.8</td>\n<td align=\"right\">24.0</td>\n<td align=\"right\">149.6</td>\n<td align=\"right\">15</td>\n<td align=\"right\">1</td>\n<td>Our world</td>\n</tr>\n<tr>\n<th>Mars</th>\n<td align=\"right\">0.642</td>\n<td align=\"right\">6,792</td>\n<td align=\"right\">3933</td>\n<td align=\"right\">3.7</td>\n<td align=\"right\">24.7</td>\n<td align=\"right\">227.9</td>\n<td align=\"right\">-65</td>\n<td align=\"right\">2</td>\n<td>The red planet</td>\n</tr>\n<tr>\n<th rowspan=\"4\" align=\"center\">Jovian planets</th>\n<th rowspan=\"2\" align=\"center\">Gas giants</th>\n<th>Jupiter</th>\n<td align=\"right\">1898</td>\n<td align=\"right\">142,984</td>\n<td align=\"right\">1326</td>\n<td align=\"right\">23.1</td>\n<td align=\"right\">9.9</td>\n<td align=\"right\">778.6</td>\n<td align=\"right\">-110</td>\n<td align=\"right\">67</td>\n<td>The largest planet</td>\n</tr>\n<tr>\n<th>Saturn</th>\n<td align=\"right\">568</td>\n<td align=\"right\">120,536</td>\n<td align=\"right\">687</td>\n<td align=\"right\">9.0</td>\n<td align=\"right\">10.7</td>\n<td align=\"right\">1433.5</td>\n<td align=\"right\">-140</td>\n<td align=\"right\">62</td>\n<td></td>\n</tr>\n<tr>\n<th rowspan=\"2\" align=\"center\">Ice giants</th>\n<th>Uranus</th>\n<td align=\"right\">86.8</td>\n<td align=\"right\">51,118</td>\n<td align=\"right\">1271</td>\n<td align=\"right\">8.7</td>\n<td align=\"right\">17.2</td>\n<td align=\"right\">2872.5</td>\n<td align=\"right\">-195</td>\n<td align=\"right\">27</td>\n<td></td>\n</tr>\n<tr>\n<th>Neptune</th>\n<td align=\"right\">102</td>\n<td align=\"right\">49,528</td>\n<td align=\"right\">1638</td>\n<td align=\"right\">11.0</td>\n<td align=\"right\">16.1</td>\n<td align=\"right\">4495.1</td>\n<td align=\"right\">-200</td>\n<td align=\"right\">14</td>\n<td></td>\n</tr>\n<tr>\n<th colspan=\"2\" align=\"center\">Dwarf planets</th>\n<th>Pluto</th>\n<td align=\"right\">0.0146</td>\n<td align=\"right\">2,370</td>\n<td align=\"right\">2095</td>\n<td align=\"right\">0.7</td>\n<td align=\"right\">153.3</td>\n<td align=\"right\">5906.4</td>\n<td align=\"right\">-225</td>\n<td align=\"right\">5</td>\n<td>Declassified as a planet in 2006.</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables/planets.html5",
    "content": "<table>\n<caption><p>Data about the planets of our solar system.</p></caption>\n<thead>\n<tr>\n<th colspan=\"2\" style=\"text-align: center;\"></th>\n<th>Name</th>\n<th style=\"text-align: right;\">Mass (10^24kg)</th>\n<th style=\"text-align: right;\">Diameter (km)</th>\n<th style=\"text-align: right;\">Density (kg/m^3)</th>\n<th style=\"text-align: right;\">Gravity (m/s^2)</th>\n<th style=\"text-align: right;\">Length of day (hours)</th>\n<th style=\"text-align: right;\">Distance from Sun (10^6km)</th>\n<th style=\"text-align: right;\">Mean temperature (C)</th>\n<th style=\"text-align: right;\">Number of moons</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<th colspan=\"2\" rowspan=\"4\" style=\"text-align: center;\">Terrestrial planets</th>\n<th>Mercury</th>\n<td style=\"text-align: right;\">0.330</td>\n<td style=\"text-align: right;\">4,879</td>\n<td style=\"text-align: right;\">5427</td>\n<td style=\"text-align: right;\">3.7</td>\n<td style=\"text-align: right;\">4222.6</td>\n<td style=\"text-align: right;\">57.9</td>\n<td style=\"text-align: right;\">167</td>\n<td style=\"text-align: right;\">0</td>\n<td>Closest to the Sun</td>\n</tr>\n<tr>\n<th>Venus</th>\n<td style=\"text-align: right;\">4.87</td>\n<td style=\"text-align: right;\">12,104</td>\n<td style=\"text-align: right;\">5243</td>\n<td style=\"text-align: right;\">8.9</td>\n<td style=\"text-align: right;\">2802.0</td>\n<td style=\"text-align: right;\">108.2</td>\n<td style=\"text-align: right;\">464</td>\n<td style=\"text-align: right;\">0</td>\n<td></td>\n</tr>\n<tr>\n<th>Earth</th>\n<td style=\"text-align: right;\">5.97</td>\n<td style=\"text-align: right;\">12,756</td>\n<td style=\"text-align: right;\">5514</td>\n<td style=\"text-align: right;\">9.8</td>\n<td style=\"text-align: right;\">24.0</td>\n<td style=\"text-align: right;\">149.6</td>\n<td style=\"text-align: right;\">15</td>\n<td style=\"text-align: right;\">1</td>\n<td>Our world</td>\n</tr>\n<tr>\n<th>Mars</th>\n<td style=\"text-align: right;\">0.642</td>\n<td style=\"text-align: right;\">6,792</td>\n<td style=\"text-align: right;\">3933</td>\n<td style=\"text-align: right;\">3.7</td>\n<td style=\"text-align: right;\">24.7</td>\n<td style=\"text-align: right;\">227.9</td>\n<td style=\"text-align: right;\">-65</td>\n<td style=\"text-align: right;\">2</td>\n<td>The red planet</td>\n</tr>\n<tr>\n<th rowspan=\"4\" style=\"text-align: center;\">Jovian planets</th>\n<th rowspan=\"2\" style=\"text-align: center;\">Gas giants</th>\n<th>Jupiter</th>\n<td style=\"text-align: right;\">1898</td>\n<td style=\"text-align: right;\">142,984</td>\n<td style=\"text-align: right;\">1326</td>\n<td style=\"text-align: right;\">23.1</td>\n<td style=\"text-align: right;\">9.9</td>\n<td style=\"text-align: right;\">778.6</td>\n<td style=\"text-align: right;\">-110</td>\n<td style=\"text-align: right;\">67</td>\n<td>The largest planet</td>\n</tr>\n<tr>\n<th>Saturn</th>\n<td style=\"text-align: right;\">568</td>\n<td style=\"text-align: right;\">120,536</td>\n<td style=\"text-align: right;\">687</td>\n<td style=\"text-align: right;\">9.0</td>\n<td style=\"text-align: right;\">10.7</td>\n<td style=\"text-align: right;\">1433.5</td>\n<td style=\"text-align: right;\">-140</td>\n<td style=\"text-align: right;\">62</td>\n<td></td>\n</tr>\n<tr>\n<th rowspan=\"2\" style=\"text-align: center;\">Ice giants</th>\n<th>Uranus</th>\n<td style=\"text-align: right;\">86.8</td>\n<td style=\"text-align: right;\">51,118</td>\n<td style=\"text-align: right;\">1271</td>\n<td style=\"text-align: right;\">8.7</td>\n<td style=\"text-align: right;\">17.2</td>\n<td style=\"text-align: right;\">2872.5</td>\n<td style=\"text-align: right;\">-195</td>\n<td style=\"text-align: right;\">27</td>\n<td></td>\n</tr>\n<tr>\n<th>Neptune</th>\n<td style=\"text-align: right;\">102</td>\n<td style=\"text-align: right;\">49,528</td>\n<td style=\"text-align: right;\">1638</td>\n<td style=\"text-align: right;\">11.0</td>\n<td style=\"text-align: right;\">16.1</td>\n<td style=\"text-align: right;\">4495.1</td>\n<td style=\"text-align: right;\">-200</td>\n<td style=\"text-align: right;\">14</td>\n<td></td>\n</tr>\n<tr>\n<th colspan=\"2\" style=\"text-align: center;\">Dwarf planets</th>\n<th>Pluto</th>\n<td style=\"text-align: right;\">0.0146</td>\n<td style=\"text-align: right;\">2,370</td>\n<td style=\"text-align: right;\">2095</td>\n<td style=\"text-align: right;\">0.7</td>\n<td style=\"text-align: right;\">153.3</td>\n<td style=\"text-align: right;\">5906.4</td>\n<td style=\"text-align: right;\">-225</td>\n<td style=\"text-align: right;\">5</td>\n<td>Declassified as a planet in 2006.</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables/planets.jats_archiving",
    "content": "<table-wrap>\n  <caption>\n    <p>Data about the planets of our solar system.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"center\" colspan=\"2\"></th>\n        <th>Name</th>\n        <th align=\"right\">Mass (10^24kg)</th>\n        <th align=\"right\">Diameter (km)</th>\n        <th align=\"right\">Density (kg/m^3)</th>\n        <th align=\"right\">Gravity (m/s^2)</th>\n        <th align=\"right\">Length of day (hours)</th>\n        <th align=\"right\">Distance from Sun (10^6km)</th>\n        <th align=\"right\">Mean temperature (C)</th>\n        <th align=\"right\">Number of moons</th>\n        <th>Notes</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <th align=\"center\" rowspan=\"4\" colspan=\"2\">Terrestrial planets</th>\n        <th>Mercury</th><td align=\"right\">0.330</td>\n        <td align=\"right\">4,879</td>\n        <td align=\"right\">5427</td>\n        <td align=\"right\">3.7</td>\n        <td align=\"right\">4222.6</td>\n        <td align=\"right\">57.9</td>\n        <td align=\"right\">167</td>\n        <td align=\"right\">0</td>\n        <td>Closest to the Sun</td>\n      </tr>\n      <tr>\n        <th>Venus</th><td align=\"right\">4.87</td>\n        <td align=\"right\">12,104</td>\n        <td align=\"right\">5243</td>\n        <td align=\"right\">8.9</td>\n        <td align=\"right\">2802.0</td>\n        <td align=\"right\">108.2</td>\n        <td align=\"right\">464</td>\n        <td align=\"right\">0</td>\n        <td></td>\n      </tr>\n      <tr>\n        <th>Earth</th><td align=\"right\">5.97</td>\n        <td align=\"right\">12,756</td>\n        <td align=\"right\">5514</td>\n        <td align=\"right\">9.8</td>\n        <td align=\"right\">24.0</td>\n        <td align=\"right\">149.6</td>\n        <td align=\"right\">15</td>\n        <td align=\"right\">1</td>\n        <td>Our world</td>\n      </tr>\n      <tr>\n        <th>Mars</th><td align=\"right\">0.642</td>\n        <td align=\"right\">6,792</td>\n        <td align=\"right\">3933</td>\n        <td align=\"right\">3.7</td>\n        <td align=\"right\">24.7</td>\n        <td align=\"right\">227.9</td>\n        <td align=\"right\">-65</td>\n        <td align=\"right\">2</td>\n        <td>The red planet</td>\n      </tr>\n      <tr>\n        <th align=\"center\" rowspan=\"4\">Jovian planets</th>\n        <th align=\"center\" rowspan=\"2\">Gas giants</th>\n        <th>Jupiter</th><td align=\"right\">1898</td>\n        <td align=\"right\">142,984</td>\n        <td align=\"right\">1326</td>\n        <td align=\"right\">23.1</td>\n        <td align=\"right\">9.9</td>\n        <td align=\"right\">778.6</td>\n        <td align=\"right\">-110</td>\n        <td align=\"right\">67</td>\n        <td>The largest planet</td>\n      </tr>\n      <tr>\n        <th>Saturn</th><td align=\"right\">568</td>\n        <td align=\"right\">120,536</td>\n        <td align=\"right\">687</td>\n        <td align=\"right\">9.0</td>\n        <td align=\"right\">10.7</td>\n        <td align=\"right\">1433.5</td>\n        <td align=\"right\">-140</td>\n        <td align=\"right\">62</td>\n        <td></td>\n      </tr>\n      <tr>\n        <th align=\"center\" rowspan=\"2\">Ice giants</th>\n        <th>Uranus</th><td align=\"right\">86.8</td>\n        <td align=\"right\">51,118</td>\n        <td align=\"right\">1271</td>\n        <td align=\"right\">8.7</td>\n        <td align=\"right\">17.2</td>\n        <td align=\"right\">2872.5</td>\n        <td align=\"right\">-195</td>\n        <td align=\"right\">27</td>\n        <td></td>\n      </tr>\n      <tr>\n        <th>Neptune</th><td align=\"right\">102</td>\n        <td align=\"right\">49,528</td>\n        <td align=\"right\">1638</td>\n        <td align=\"right\">11.0</td>\n        <td align=\"right\">16.1</td>\n        <td align=\"right\">4495.1</td>\n        <td align=\"right\">-200</td>\n        <td align=\"right\">14</td>\n        <td></td>\n      </tr>\n      <tr>\n        <th align=\"center\" colspan=\"2\">Dwarf planets</th>\n        <th>Pluto</th><td align=\"right\">0.0146</td>\n        <td align=\"right\">2,370</td>\n        <td align=\"right\">2095</td>\n        <td align=\"right\">0.7</td>\n        <td align=\"right\">153.3</td>\n        <td align=\"right\">5906.4</td>\n        <td align=\"right\">-225</td>\n        <td align=\"right\">5</td>\n        <td>Declassified as a planet in 2006.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n"
  },
  {
    "path": "test/tables/planets.latex",
    "content": "\\begin{longtable}[]{@{}cclrrrrrrrrl@{}}\n\\caption{Data about the planets of our solar system.}\\tabularnewline\n\\toprule\\noalign{}\n\\multicolumn{2}{@{}c}{%\n} & Name & Mass (10\\^{}24kg) & Diameter (km) & Density (kg/m\\^{}3) & Gravity\n(m/s\\^{}2) & Length of day (hours) & Distance from Sun (10\\^{}6km) & Mean\ntemperature (C) & Number of moons & Notes \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\n\\multicolumn{2}{@{}c}{%\n} & Name & Mass (10\\^{}24kg) & Diameter (km) & Density (kg/m\\^{}3) & Gravity\n(m/s\\^{}2) & Length of day (hours) & Distance from Sun (10\\^{}6km) & Mean\ntemperature (C) & Number of moons & Notes \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n\\multicolumn{2}{@{}c}{%\n\\multirow{4}{*}{\\centering\\arraybackslash Terrestrial planets}} & Mercury &\n0.330 & 4,879 & 5427 & 3.7 & 4222.6 & 57.9 & 167 & 0 & Closest to the Sun \\\\\n& & Venus & 4.87 & 12,104 & 5243 & 8.9 & 2802.0 & 108.2 & 464 & 0 & \\\\\n& & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our world \\\\\n& & Mars & 0.642 & 6,792 & 3933 & 3.7 & 24.7 & 227.9 & -65 & 2 & The red\nplanet \\\\\n\\multirow{4}{*}{\\centering\\arraybackslash Jovian planets} &\n\\multirow{2}{*}{\\centering\\arraybackslash Gas giants} & Jupiter & 1898 & 142,984\n& 1326 & 23.1 & 9.9 & 778.6 & -110 & 67 & The largest planet \\\\\n& & Saturn & 568 & 120,536 & 687 & 9.0 & 10.7 & 1433.5 & -140 & 62 & \\\\\n& \\multirow{2}{*}{\\centering\\arraybackslash Ice giants} & Uranus & 86.8 & 51,118\n& 1271 & 8.7 & 17.2 & 2872.5 & -195 & 27 & \\\\\n& & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14 & \\\\\n\\multicolumn{2}{@{}c}{%\nDwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 & 153.3 & 5906.4 & -225 & 5\n& Declassified as a planet in 2006. \\\\\n\\end{longtable}\n"
  },
  {
    "path": "test/tables/planets.markdown",
    "content": "+------------------+---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|                  | Name    | Mass       | Diameter | Density   | Gravity  | Length  | Distance  | Mean        | Number | Notes        |\n|                  |         | (10\\^24kg) | (km)     | (kg/m\\^3) | (m/s\\^2) | of day  | from Sun  | temperature | of     |              |\n|                  |         |            |          |           |          | (hours) | (10\\^6km) | (C)         | moons  |              |\n+:=======:+:======:+=========+===========:+=========:+==========:+=========:+========:+==========:+============:+=======:+==============+\n| Terrestrial      | Mercury | 0.330      | 4,879    | 5427      | 3.7      | 4222.6  | 57.9      | 167         | 0      | Closest to   |\n| planets          |         |            |          |           |          |         |           |             |        | the Sun      |\n|                  +---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|                  | Venus   | 4.87       | 12,104   | 5243      | 8.9      | 2802.0  | 108.2     | 464         | 0      |              |\n|                  +---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|                  | Earth   | 5.97       | 12,756   | 5514      | 9.8      | 24.0    | 149.6     | 15          | 1      | Our world    |\n|                  +---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|                  | Mars    | 0.642      | 6,792    | 3933      | 3.7      | 24.7    | 227.9     | -65         | 2      | The red      |\n|                  |         |            |          |           |          |         |           |             |        | planet       |\n+---------+--------+---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n| Jovian  | Gas    | Jupiter | 1898       | 142,984  | 1326      | 23.1     | 9.9     | 778.6     | -110        | 67     | The largest  |\n| planets | giants |         |            |          |           |          |         |           |             |        | planet       |\n|         |        +---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|         |        | Saturn  | 568        | 120,536  | 687       | 9.0      | 10.7    | 1433.5    | -140        | 62     |              |\n|         +--------+---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|         | Ice    | Uranus  | 86.8       | 51,118   | 1271      | 8.7      | 17.2    | 2872.5    | -195        | 27     |              |\n|         | giants |         |            |          |           |          |         |           |             |        |              |\n|         |        +---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n|         |        | Neptune | 102        | 49,528   | 1638      | 11.0     | 16.1    | 4495.1    | -200        | 14     |              |\n+---------+--------+---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n| Dwarf planets    | Pluto   | 0.0146     | 2,370    | 2095      | 0.7      | 153.3   | 5906.4    | -225        | 5      | Declassified |\n|                  |         |            |          |           |          |         |           |             |        | as a planet  |\n|                  |         |            |          |           |          |         |           |             |        | in 2006.     |\n+------------------+---------+------------+----------+-----------+----------+---------+-----------+-------------+--------+--------------+\n\n: Data about the planets of our solar system.\n"
  },
  {
    "path": "test/tables/planets.mediawiki",
    "content": "{| class=\"wikitable\"\n|+ Data about the planets of our solar system.\n|-\n! colspan=\"2\" style=\"text-align: center;\"|\n! Name\n! style=\"text-align: right;\"| Mass (10^24kg)\n! style=\"text-align: right;\"| Diameter (km)\n! style=\"text-align: right;\"| Density (kg/m^3)\n! style=\"text-align: right;\"| Gravity (m/s^2)\n! style=\"text-align: right;\"| Length of day (hours)\n! style=\"text-align: right;\"| Distance from Sun (10^6km)\n! style=\"text-align: right;\"| Mean temperature (C)\n! style=\"text-align: right;\"| Number of moons\n! Notes\n|-\n! rowspan=\"4\" colspan=\"2\" style=\"text-align: center;\"| Terrestrial planets\n! Mercury\n| style=\"text-align: right;\"| 0.330\n| style=\"text-align: right;\"| 4,879\n| style=\"text-align: right;\"| 5427\n| style=\"text-align: right;\"| 3.7\n| style=\"text-align: right;\"| 4222.6\n| style=\"text-align: right;\"| 57.9\n| style=\"text-align: right;\"| 167\n| style=\"text-align: right;\"| 0\n| Closest to the Sun\n|-\n! Venus\n| style=\"text-align: right;\"| 4.87\n| style=\"text-align: right;\"| 12,104\n| style=\"text-align: right;\"| 5243\n| style=\"text-align: right;\"| 8.9\n| style=\"text-align: right;\"| 2802.0\n| style=\"text-align: right;\"| 108.2\n| style=\"text-align: right;\"| 464\n| style=\"text-align: right;\"| 0\n|\n|-\n! Earth\n| style=\"text-align: right;\"| 5.97\n| style=\"text-align: right;\"| 12,756\n| style=\"text-align: right;\"| 5514\n| style=\"text-align: right;\"| 9.8\n| style=\"text-align: right;\"| 24.0\n| style=\"text-align: right;\"| 149.6\n| style=\"text-align: right;\"| 15\n| style=\"text-align: right;\"| 1\n| Our world\n|-\n! Mars\n| style=\"text-align: right;\"| 0.642\n| style=\"text-align: right;\"| 6,792\n| style=\"text-align: right;\"| 3933\n| style=\"text-align: right;\"| 3.7\n| style=\"text-align: right;\"| 24.7\n| style=\"text-align: right;\"| 227.9\n| style=\"text-align: right;\"| -65\n| style=\"text-align: right;\"| 2\n| The red planet\n|-\n! rowspan=\"4\" style=\"text-align: center;\"| Jovian planets\n! rowspan=\"2\" style=\"text-align: center;\"| Gas giants\n! Jupiter\n| style=\"text-align: right;\"| 1898\n| style=\"text-align: right;\"| 142,984\n| style=\"text-align: right;\"| 1326\n| style=\"text-align: right;\"| 23.1\n| style=\"text-align: right;\"| 9.9\n| style=\"text-align: right;\"| 778.6\n| style=\"text-align: right;\"| -110\n| style=\"text-align: right;\"| 67\n| The largest planet\n|-\n! Saturn\n| style=\"text-align: right;\"| 568\n| style=\"text-align: right;\"| 120,536\n| style=\"text-align: right;\"| 687\n| style=\"text-align: right;\"| 9.0\n| style=\"text-align: right;\"| 10.7\n| style=\"text-align: right;\"| 1433.5\n| style=\"text-align: right;\"| -140\n| style=\"text-align: right;\"| 62\n|\n|-\n! rowspan=\"2\" style=\"text-align: center;\"| Ice giants\n! Uranus\n| style=\"text-align: right;\"| 86.8\n| style=\"text-align: right;\"| 51,118\n| style=\"text-align: right;\"| 1271\n| style=\"text-align: right;\"| 8.7\n| style=\"text-align: right;\"| 17.2\n| style=\"text-align: right;\"| 2872.5\n| style=\"text-align: right;\"| -195\n| style=\"text-align: right;\"| 27\n|\n|-\n! Neptune\n| style=\"text-align: right;\"| 102\n| style=\"text-align: right;\"| 49,528\n| style=\"text-align: right;\"| 1638\n| style=\"text-align: right;\"| 11.0\n| style=\"text-align: right;\"| 16.1\n| style=\"text-align: right;\"| 4495.1\n| style=\"text-align: right;\"| -200\n| style=\"text-align: right;\"| 14\n|\n|-\n! colspan=\"2\" style=\"text-align: center;\"| Dwarf planets\n! Pluto\n| style=\"text-align: right;\"| 0.0146\n| style=\"text-align: right;\"| 2,370\n| style=\"text-align: right;\"| 2095\n| style=\"text-align: right;\"| 0.7\n| style=\"text-align: right;\"| 153.3\n| style=\"text-align: right;\"| 5906.4\n| style=\"text-align: right;\"| -225\n| style=\"text-align: right;\"| 5\n| Declassified as a planet in 2006.\n|}\n"
  },
  {
    "path": "test/tables/planets.native",
    "content": "[Table (\"\",[],[]) (Caption Nothing\n [Para [Str \"Data\",Space,Str \"about\",Space,Str \"the\",Space,Str \"planets\",Space,Str \"of\",Space,Str \"our\",Space,Str \"solar\",Space,Str \"system.\"]])\n [(AlignCenter,ColWidthDefault)\n ,(AlignCenter,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignRight,ColWidthDefault)\n ,(AlignDefault,ColWidthDefault)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 2)\n   []\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Name\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Mass\",Space,Str \"(10^24kg)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Diameter\",Space,Str \"(km)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Density\",Space,Str \"(kg/m^3)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Gravity\",Space,Str \"(m/s^2)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Length\",Space,Str \"of\",Space,Str \"day\",Space,Str \"(hours)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Distance\",Space,Str \"from\",Space,Str \"Sun\",Space,Str \"(10^6km)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Mean\",Space,Str \"temperature\",Space,Str \"(C)\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Number\",Space,Str \"of\",Space,Str \"moons\"]]\n  ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Notes\"]]]])\n [(TableBody (\"\",[],[]) (RowHeadColumns 3)\n  []\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 4) (ColSpan 2)\n    [Plain [Str \"Terrestrial\",Space,Str \"planets\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Mercury\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0.330\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4,879\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5427\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"3.7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4222.6\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"57.9\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"167\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Closest\",Space,Str \"to\",Space,Str \"the\",Space,Str \"Sun\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Venus\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4.87\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12,104\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5243\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"8.9\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"2802.0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"108.2\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"464\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Earth\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5.97\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"12,756\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5514\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"9.8\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"24.0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"149.6\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"15\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Our\",Space,Str \"world\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Mars\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0.642\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"6,792\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"3933\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"3.7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"24.7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"227.9\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"-65\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"2\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"The\",Space,Str \"red\",Space,Str \"planet\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 4) (ColSpan 1)\n    [Plain [Str \"Jovian\",Space,Str \"planets\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 2) (ColSpan 1)\n    [Plain [Str \"Gas\",Space,Str \"giants\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Jupiter\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1898\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"142,984\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1326\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"23.1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"9.9\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"778.6\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"-110\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"67\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"The\",Space,Str \"largest\",Space,Str \"planet\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Saturn\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"568\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"120,536\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"687\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"9.0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"10.7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1433.5\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"-140\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"62\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 2) (ColSpan 1)\n    [Plain [Str \"Ice\",Space,Str \"giants\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Uranus\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"86.8\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"51,118\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1271\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"8.7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"17.2\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"2872.5\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"-195\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"27\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Neptune\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"102\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"49,528\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"1638\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"11.0\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"16.1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4495.1\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"-200\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"14\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    []]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 2)\n    [Plain [Str \"Dwarf\",Space,Str \"planets\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Pluto\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0.0146\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"2,370\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"2095\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"0.7\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"153.3\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5906.4\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"-225\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Declassified\",Space,Str \"as\",Space,Str \"a\",Space,Str \"planet\",Space,Str \"in\",Space,Str \"2006.\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n"
  },
  {
    "path": "test/tables/planets.typst",
    "content": "#figure(\n  align(center)[#table(\n    columns: 12,\n    align: (center,center,auto,right,right,right,right,right,right,right,right,auto,),\n    table.header(table.cell(colspan: 2)[], [Name], [Mass (10^24kg)], [Diameter\n      (km)], [Density (kg/m^3)], [Gravity (m/s^2)], [Length of day\n      (hours)], [Distance from Sun (10^6km)], [Mean temperature (C)], [Number of\n      moons], [Notes],),\n    table.hline(),\n    table.cell(rowspan: 4, colspan: 2)[Terrestrial\n    planets], [Mercury], [0.330], [4,879], [5427], [3.7], [4222.6], [57.9], [167], [0], [Closest\n    to the Sun],\n    [Venus], [4.87], [12,104], [5243], [8.9], [2802.0], [108.2], [464], [0], [],\n    [Earth], [5.97], [12,756], [5514], [9.8], [24.0], [149.6], [15], [1], [Our\n    world],\n    [Mars], [0.642], [6,792], [3933], [3.7], [24.7], [227.9], [-65], [2], [The\n    red planet],\n    table.cell(rowspan: 4)[Jovian planets], table.cell(rowspan: 2)[Gas\n    giants], [Jupiter], [1898], [142,984], [1326], [23.1], [9.9], [778.6], [-110], [67], [The\n    largest planet],\n    [Saturn], [568], [120,536], [687], [9.0], [10.7], [1433.5], [-140], [62], [],\n    table.cell(rowspan: 2)[Ice\n    giants], [Uranus], [86.8], [51,118], [1271], [8.7], [17.2], [2872.5], [-195], [27], [],\n    [Neptune], [102], [49,528], [1638], [11.0], [16.1], [4495.1], [-200], [14], [],\n    table.cell(colspan: 2)[Dwarf\n    planets], [Pluto], [0.0146], [2,370], [2095], [0.7], [153.3], [5906.4], [-225], [5], [Declassified\n    as a planet in 2006.],\n  )]\n  , caption: [Data about the planets of our solar system.\n\n  ]\n  , kind: table\n  )\n"
  },
  {
    "path": "test/tables/students.html4",
    "content": "<table id=\"students\" source=\"mdn\">\n<caption><p>List of Students</p></caption>\n<colgroup>\n<col width=\"50%\" />\n<col width=\"50%\" />\n</colgroup>\n<thead>\n<tr>\n<th align=\"center\">Student ID</th>\n<th align=\"center\">Name</th>\n</tr>\n</thead>\n<tbody class=\"souvereign-states\">\n<tr>\n<th colspan=\"2\" align=\"left\">Computer Science</th>\n</tr>\n\n<tr>\n<td align=\"left\">3741255</td>\n<td align=\"left\">Jones, Martha</td>\n</tr>\n<tr>\n<td align=\"left\">4077830</td>\n<td align=\"left\">Pierce, Benjamin</td>\n</tr>\n<tr>\n<td align=\"left\">5151701</td>\n<td align=\"left\">Kirk, James</td>\n</tr>\n</tbody>\n<tbody>\n<tr>\n<th colspan=\"2\" align=\"left\">Russian Literature</th>\n</tr>\n\n<tr>\n<td align=\"left\">3971244</td>\n<td align=\"left\">Nim, Victor</td>\n</tr>\n</tbody>\n<tbody>\n<tr>\n<th colspan=\"2\" align=\"left\">Astrophysics</th>\n</tr>\n\n<tr>\n<td align=\"left\">4100332</td>\n<td align=\"left\">Petrov, Alexandra</td>\n</tr>\n<tr>\n<td align=\"left\">4100332</td>\n<td align=\"left\">Toyota, Hiroko</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables/students.html5",
    "content": "<table id=\"students\" data-source=\"mdn\">\n<caption><p>List of Students</p></caption>\n<colgroup>\n<col style=\"width: 50%\" />\n<col style=\"width: 50%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Student ID</th>\n<th style=\"text-align: center;\">Name</th>\n</tr>\n</thead>\n<tbody class=\"souvereign-states\">\n<tr>\n<th colspan=\"2\" style=\"text-align: left;\">Computer Science</th>\n</tr>\n\n<tr>\n<td style=\"text-align: left;\">3741255</td>\n<td style=\"text-align: left;\">Jones, Martha</td>\n</tr>\n<tr>\n<td style=\"text-align: left;\">4077830</td>\n<td style=\"text-align: left;\">Pierce, Benjamin</td>\n</tr>\n<tr>\n<td style=\"text-align: left;\">5151701</td>\n<td style=\"text-align: left;\">Kirk, James</td>\n</tr>\n</tbody>\n<tbody>\n<tr>\n<th colspan=\"2\" style=\"text-align: left;\">Russian Literature</th>\n</tr>\n\n<tr>\n<td style=\"text-align: left;\">3971244</td>\n<td style=\"text-align: left;\">Nim, Victor</td>\n</tr>\n</tbody>\n<tbody>\n<tr>\n<th colspan=\"2\" style=\"text-align: left;\">Astrophysics</th>\n</tr>\n\n<tr>\n<td style=\"text-align: left;\">4100332</td>\n<td style=\"text-align: left;\">Petrov, Alexandra</td>\n</tr>\n<tr>\n<td style=\"text-align: left;\">4100332</td>\n<td style=\"text-align: left;\">Toyota, Hiroko</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables/students.jats_archiving",
    "content": "<table-wrap>\n  <caption>\n    <p>List of Students</p>\n  </caption>\n  <table id=\"students\">\n    <colgroup>\n      <col width=\"50%\" />\n      <col width=\"50%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Student ID</th>\n        <th align=\"center\">Name</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <th align=\"left\" colspan=\"2\">Computer Science</th>\n      </tr>\n      <tr>\n        <td align=\"left\">3741255</td>\n        <td align=\"left\">Jones, Martha</td>\n      </tr>\n      <tr>\n        <td align=\"left\">4077830</td>\n        <td align=\"left\">Pierce, Benjamin</td>\n      </tr>\n      <tr>\n        <td align=\"left\">5151701</td>\n        <td align=\"left\">Kirk, James</td>\n      </tr>\n    </tbody>\n    <tbody>\n      <tr>\n        <th align=\"left\" colspan=\"2\">Russian Literature</th>\n      </tr>\n      <tr>\n        <td align=\"left\">3971244</td>\n        <td align=\"left\">Nim, Victor</td>\n      </tr>\n    </tbody>\n    <tbody>\n      <tr>\n        <th align=\"left\" colspan=\"2\">Astrophysics</th>\n      </tr>\n      <tr>\n        <td align=\"left\">4100332</td>\n        <td align=\"left\">Petrov, Alexandra</td>\n      </tr>\n      <tr>\n        <td align=\"left\">4100332</td>\n        <td align=\"left\">Toyota, Hiroko</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n"
  },
  {
    "path": "test/tables/students.latex",
    "content": "\\begin{longtable}[]{@{}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 2\\tabcolsep) * \\real{0.5000}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 2\\tabcolsep) * \\real{0.5000}}@{}}\n\\caption{List of Students}\\label{students}\\tabularnewline\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nStudent ID\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nName\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nStudent ID\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\centering\nName\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n\\multicolumn{2}{@{}>{\\raggedright\\arraybackslash}p{(\\linewidth - 2\\tabcolsep) * \\real{1.0000} + 2\\tabcolsep}@{}}{%\nComputer Science} \\\\\n3741255 & Jones, Martha \\\\\n4077830 & Pierce, Benjamin \\\\\n5151701 & Kirk, James \\\\\n\\multicolumn{2}{@{}>{\\raggedright\\arraybackslash}p{(\\linewidth - 2\\tabcolsep) * \\real{1.0000} + 2\\tabcolsep}@{}}{%\nRussian Literature} \\\\\n3971244 & Nim, Victor \\\\\n\\multicolumn{2}{@{}>{\\raggedright\\arraybackslash}p{(\\linewidth - 2\\tabcolsep) * \\real{1.0000} + 2\\tabcolsep}@{}}{%\nAstrophysics} \\\\\n4100332 & Petrov, Alexandra \\\\\n4100332 & Toyota, Hiroko \\\\\n\\end{longtable}\n"
  },
  {
    "path": "test/tables/students.markdown",
    "content": "+-----------------------------------------+-----------------------------------------+\n| Student ID                              | Name                                    |\n+:========================================+:========================================+\n| Computer Science                                                                  |\n+-----------------------------------------+-----------------------------------------+\n| 3741255                                 | Jones, Martha                           |\n+-----------------------------------------+-----------------------------------------+\n| 4077830                                 | Pierce, Benjamin                        |\n+-----------------------------------------+-----------------------------------------+\n| 5151701                                 | Kirk, James                             |\n+-----------------------------------------+-----------------------------------------+\n| Russian Literature                                                                |\n+-----------------------------------------+-----------------------------------------+\n| 3971244                                 | Nim, Victor                             |\n+-----------------------------------------+-----------------------------------------+\n| Astrophysics                                                                      |\n+-----------------------------------------+-----------------------------------------+\n| 4100332                                 | Petrov, Alexandra                       |\n+-----------------------------------------+-----------------------------------------+\n| 4100332                                 | Toyota, Hiroko                          |\n+-----------------------------------------+-----------------------------------------+\n\n: List of Students {#students source=\"mdn\"}\n"
  },
  {
    "path": "test/tables/students.mediawiki",
    "content": "{| id=\"students\" class=\"wikitable\" source=\"mdn\"\n|+ List of Students\n|-\n! style=\"text-align: center;\"| Student ID\n! style=\"text-align: center;\"| Name\n|-\n! colspan=\"2\" style=\"text-align: left;\"| Computer Science\n|-\n| style=\"text-align: left;\"| 3741255\n| style=\"text-align: left;\"| Jones, Martha\n|-\n| style=\"text-align: left;\"| 4077830\n| style=\"text-align: left;\"| Pierce, Benjamin\n|-\n| style=\"text-align: left;\"| 5151701\n| style=\"text-align: left;\"| Kirk, James\n|-\n! colspan=\"2\" style=\"text-align: left;\"| Russian Literature\n|-\n| style=\"text-align: left;\"| 3971244\n| style=\"text-align: left;\"| Nim, Victor\n|-\n! colspan=\"2\" style=\"text-align: left;\"| Astrophysics\n|-\n| style=\"text-align: left;\"| 4100332\n| style=\"text-align: left;\"| Petrov, Alexandra\n|-\n| style=\"text-align: left;\"| 4100332\n| style=\"text-align: left;\"| Toyota, Hiroko\n|}\n"
  },
  {
    "path": "test/tables/students.native",
    "content": "[Table (\"students\",[],[(\"source\",\"mdn\")]) (Caption Nothing\n [Para [Str \"List\",Space,Str \"of\",Space,Str \"Students\"]])\n [(AlignLeft,ColWidth 0.5)\n ,(AlignLeft,ColWidth 0.5)]\n (TableHead (\"\",[],[])\n [Row (\"\",[],[])\n  [Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Student\",Space,Str \"ID\"]]\n  ,Cell (\"\",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)\n   [Plain [Str \"Name\"]]]])\n [(TableBody (\"\",[\"souvereign-states\"],[]) (RowHeadColumns 0)\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 2)\n    [Plain [Str \"Computer\",Space,Str \"Science\"]]]]\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"3741255\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Jones,\",Space,Str \"Martha\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4077830\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Pierce,\",Space,Str \"Benjamin\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"5151701\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Kirk,\",Space,Str \"James\"]]]])\n ,(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 2)\n    [Plain [Str \"Russian\",Space,Str \"Literature\"]]]]\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"3971244\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Nim,\",Space,Str \"Victor\"]]]])\n ,(TableBody (\"\",[],[]) (RowHeadColumns 0)\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 2)\n    [Plain [Str \"Astrophysics\"]]]]\n  [Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4100332\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Petrov,\",Space,Str \"Alexandra\"]]]\n  ,Row (\"\",[],[])\n   [Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"4100332\"]]\n   ,Cell (\"\",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)\n    [Plain [Str \"Toyota,\",Space,Str \"Hiroko\"]]]])]\n (TableFoot (\"\",[],[])\n [])]\n"
  },
  {
    "path": "test/tables/students.typst",
    "content": "#figure(\n  align(center)[#table(\n    columns: (50%, 50%),\n    align: (left,left,),\n    table.header(table.cell(align: center)[Student\n      ID], table.cell(align: center)[Name],),\n    table.hline(),\n    table.cell(colspan: 2)[Computer Science],\n    table.hline(),\n    [3741255], [Jones, Martha],\n    [4077830], [Pierce, Benjamin],\n    [5151701], [Kirk, James],\n    table.cell(colspan: 2)[Russian Literature],\n    table.hline(),\n    [3971244], [Nim, Victor],\n    table.cell(colspan: 2)[Astrophysics],\n    table.hline(),\n    [4100332], [Petrov, Alexandra],\n    [4100332], [Toyota, Hiroko],\n  )]\n  , caption: [List of Students\n\n  ]\n  , kind: table\n  )\n<students>\n"
  },
  {
    "path": "test/tables-rstsubset.native",
    "content": "[ Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Demonstration\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"simple\"\n           , Space\n           , Str \"table\"\n           , Space\n           , Str \"syntax.\"\n           ]\n       ])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"indented\"\n    , Space\n    , Str \"two\"\n    , Space\n    , Str \"spaces:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Demonstration\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"simple\"\n           , Space\n           , Str \"table\"\n           , Space\n           , Str \"syntax.\"\n           ]\n       ])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Multiline\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Here\\8217s\"\n           , Space\n           , Str \"the\"\n           , Space\n           , Str \"caption.\"\n           , Space\n           , Str \"It\"\n           , Space\n           , Str \"may\"\n           , Space\n           , Str \"span\"\n           , Space\n           , Str \"multiple\"\n           , Space\n           , Str \"lines.\"\n           ]\n       ])\n    [ ( AlignDefault , ColWidth 0.15 )\n    , ( AlignDefault , ColWidth 0.1375 )\n    , ( AlignDefault , ColWidth 0.1625 )\n    , ( AlignDefault , ColWidth 0.35 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Centered\" , SoftBreak , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Example\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"row\"\n                    , Space\n                    , Str \"that\"\n                    , SoftBreak\n                    , Str \"spans\"\n                    , Space\n                    , Str \"multiple\"\n                    , Space\n                    , Str \"lines.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Here\\8217s\"\n                    , Space\n                    , Str \"another\"\n                    , Space\n                    , Str \"one.\"\n                    , Space\n                    , Str \"Note\"\n                    , SoftBreak\n                    , Str \"the\"\n                    , Space\n                    , Str \"blank\"\n                    , Space\n                    , Str \"line\"\n                    , Space\n                    , Str \"between\"\n                    , SoftBreak\n                    , Str \"rows.\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Multiline\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.15 )\n    , ( AlignDefault , ColWidth 0.1375 )\n    , ( AlignDefault , ColWidth 0.1625 )\n    , ( AlignDefault , ColWidth 0.35 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Centered\" , SoftBreak , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Example\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"row\"\n                    , Space\n                    , Str \"that\"\n                    , SoftBreak\n                    , Str \"spans\"\n                    , Space\n                    , Str \"multiple\"\n                    , Space\n                    , Str \"lines.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Here\\8217s\"\n                    , Space\n                    , Str \"another\"\n                    , Space\n                    , Str \"one.\"\n                    , Space\n                    , Str \"Note\"\n                    , SoftBreak\n                    , Str \"the\"\n                    , Space\n                    , Str \"blank\"\n                    , Space\n                    , Str \"line\"\n                    , Space\n                    , Str \"between\"\n                    , SoftBreak\n                    , Str \"rows.\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"column\"\n    , Space\n    , Str \"headers:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Multiline\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"column\"\n    , Space\n    , Str \"headers:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignDefault , ColWidth 0.15 )\n    , ( AlignDefault , ColWidth 0.1375 )\n    , ( AlignDefault , ColWidth 0.1625 )\n    , ( AlignDefault , ColWidth 0.35 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Example\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"row\"\n                    , Space\n                    , Str \"that\"\n                    , SoftBreak\n                    , Str \"spans\"\n                    , Space\n                    , Str \"multiple\"\n                    , Space\n                    , Str \"lines.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Here\\8217s\"\n                    , Space\n                    , Str \"another\"\n                    , Space\n                    , Str \"one.\"\n                    , Space\n                    , Str \"Note\"\n                    , SoftBreak\n                    , Str \"the\"\n                    , Space\n                    , Str \"blank\"\n                    , Space\n                    , Str \"line\"\n                    , Space\n                    , Str \"between\"\n                    , SoftBreak\n                    , Str \"rows.\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n"
  },
  {
    "path": "test/tables.asciidoc",
    "content": "Simple table with caption:\n\n.Demonstration of simple table syntax.\n[cols=\">,<,^,\",options=\"header\",]\n|===\n|Right |Left |Center |Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nSimple table without caption:\n\n[cols=\">,<,^,\",options=\"header\",]\n|===\n|Right |Left |Center |Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nSimple table indented two spaces:\n\n.Demonstration of simple table syntax.\n[cols=\">,<,^,\",options=\"header\",]\n|===\n|Right |Left |Center |Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nMultiline table with caption:\n\n.Here’s the caption. It may span multiple lines.\n[width=\"80%\",cols=\"^20%,<17%,>20%,<43%\",options=\"header\",]\n|===\n|Centered Header |Left Aligned |Right Aligned |Default aligned\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n|===\n\nMultiline table without caption:\n\n[width=\"80%\",cols=\"^20%,<17%,>20%,<43%\",options=\"header\",]\n|===\n|Centered Header |Left Aligned |Right Aligned |Default aligned\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n|===\n\nTable without column headers:\n\n[cols=\">,<,^,>\",]\n|===\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nMultiline table without column headers:\n\n[width=\"80%\",cols=\"^20%,<17%,>20%,43%\",]\n|===\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n|===\n"
  },
  {
    "path": "test/tables.asciidoc_legacy",
    "content": "Simple table with caption:\n\n.Demonstration of simple table syntax.\n[cols=\">,<,^,\",options=\"header\",]\n|===\n|Right |Left |Center |Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nSimple table without caption:\n\n[cols=\">,<,^,\",options=\"header\",]\n|===\n|Right |Left |Center |Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nSimple table indented two spaces:\n\n.Demonstration of simple table syntax.\n[cols=\">,<,^,\",options=\"header\",]\n|===\n|Right |Left |Center |Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nMultiline table with caption:\n\n.Here’s the caption. It may span multiple lines.\n[width=\"80%\",cols=\"^20%,<17%,>20%,<43%\",options=\"header\",]\n|===\n|Centered Header |Left Aligned |Right Aligned |Default aligned\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n|===\n\nMultiline table without caption:\n\n[width=\"80%\",cols=\"^20%,<17%,>20%,<43%\",options=\"header\",]\n|===\n|Centered Header |Left Aligned |Right Aligned |Default aligned\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n|===\n\nTable without column headers:\n\n[cols=\">,<,^,>\",]\n|===\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n|===\n\nMultiline table without column headers:\n\n[width=\"80%\",cols=\"^20%,<17%,>20%,43%\",]\n|===\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n|===\n"
  },
  {
    "path": "test/tables.bbcode",
    "content": "Simple table with caption:\n\nDemonstration of simple table syntax.\n[table]\n[tr][th]Right[/th][th]Left[/th][th]Center[/th][th]Default[/th][/tr]\n[tr][td]12[/td][td]12[/td][td]12[/td][td]12[/td][/tr]\n[tr][td]123[/td][td]123[/td][td]123[/td][td]123[/td][/tr]\n[tr][td]1[/td][td]1[/td][td]1[/td][td]1[/td][/tr]\n[/table]\n\nSimple table without caption:\n\n[table]\n[tr][th]Right[/th][th]Left[/th][th]Center[/th][th]Default[/th][/tr]\n[tr][td]12[/td][td]12[/td][td]12[/td][td]12[/td][/tr]\n[tr][td]123[/td][td]123[/td][td]123[/td][td]123[/td][/tr]\n[tr][td]1[/td][td]1[/td][td]1[/td][td]1[/td][/tr]\n[/table]\n\nSimple table indented two spaces:\n\nDemonstration of simple table syntax.\n[table]\n[tr][th]Right[/th][th]Left[/th][th]Center[/th][th]Default[/th][/tr]\n[tr][td]12[/td][td]12[/td][td]12[/td][td]12[/td][/tr]\n[tr][td]123[/td][td]123[/td][td]123[/td][td]123[/td][/tr]\n[tr][td]1[/td][td]1[/td][td]1[/td][td]1[/td][/tr]\n[/table]\n\nMultiline table with caption:\n\nHere's the caption. It may span multiple lines.\n[table]\n[tr][th]Centered Header[/th][th]Left Aligned[/th][th]Right Aligned[/th][th]Default aligned[/th][/tr]\n[tr][td]First[/td][td]row[/td][td]12.0[/td][td]Example of a row that spans multiple lines.[/td][/tr]\n[tr][td]Second[/td][td]row[/td][td]5.0[/td][td]Here's another one. Note the blank line between rows.[/td][/tr]\n[/table]\n\nMultiline table without caption:\n\n[table]\n[tr][th]Centered Header[/th][th]Left Aligned[/th][th]Right Aligned[/th][th]Default aligned[/th][/tr]\n[tr][td]First[/td][td]row[/td][td]12.0[/td][td]Example of a row that spans multiple lines.[/td][/tr]\n[tr][td]Second[/td][td]row[/td][td]5.0[/td][td]Here's another one. Note the blank line between rows.[/td][/tr]\n[/table]\n\nTable without column headers:\n\n[table]\n[tr][td]12[/td][td]12[/td][td]12[/td][td]12[/td][/tr]\n[tr][td]123[/td][td]123[/td][td]123[/td][td]123[/td][/tr]\n[tr][td]1[/td][td]1[/td][td]1[/td][td]1[/td][/tr]\n[/table]\n\nMultiline table without column headers:\n\n[table]\n[tr][td]First[/td][td]row[/td][td]12.0[/td][td]Example of a row that spans multiple lines.[/td][/tr]\n[tr][td]Second[/td][td]row[/td][td]5.0[/td][td]Here's another one. Note the blank line between rows.[/td][/tr]\n[/table]\n"
  },
  {
    "path": "test/tables.context",
    "content": "Simple table with caption:\n\n\\startplacetable[title={Demonstration of simple table syntax.}]\n\\startxtable\n\\startxtablehead[head]\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] Right \\stopxcell\n\\startxcell[align=right] Left \\stopxcell\n\\startxcell[align=middle] Center \\stopxcell\n\\startxcell Default \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=left] 12 \\stopxcell\n\\startxcell[align=right] 12 \\stopxcell\n\\startxcell[align=middle] 12 \\stopxcell\n\\startxcell 12 \\stopxcell\n\\stopxrow\n\\startxrow\n\\startxcell[align=left] 123 \\stopxcell\n\\startxcell[align=right] 123 \\stopxcell\n\\startxcell[align=middle] 123 \\stopxcell\n\\startxcell 123 \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] 1 \\stopxcell\n\\startxcell[align=right] 1 \\stopxcell\n\\startxcell[align=middle] 1 \\stopxcell\n\\startxcell 1 \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n\nSimple table without caption:\n\n\\startplacetable[location=none]\n\\startxtable\n\\startxtablehead[head]\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] Right \\stopxcell\n\\startxcell[align=right] Left \\stopxcell\n\\startxcell[align=middle] Center \\stopxcell\n\\startxcell Default \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=left] 12 \\stopxcell\n\\startxcell[align=right] 12 \\stopxcell\n\\startxcell[align=middle] 12 \\stopxcell\n\\startxcell 12 \\stopxcell\n\\stopxrow\n\\startxrow\n\\startxcell[align=left] 123 \\stopxcell\n\\startxcell[align=right] 123 \\stopxcell\n\\startxcell[align=middle] 123 \\stopxcell\n\\startxcell 123 \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] 1 \\stopxcell\n\\startxcell[align=right] 1 \\stopxcell\n\\startxcell[align=middle] 1 \\stopxcell\n\\startxcell 1 \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n\nSimple table indented two spaces:\n\n\\startplacetable[title={Demonstration of simple table syntax.}]\n\\startxtable\n\\startxtablehead[head]\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] Right \\stopxcell\n\\startxcell[align=right] Left \\stopxcell\n\\startxcell[align=middle] Center \\stopxcell\n\\startxcell Default \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=left] 12 \\stopxcell\n\\startxcell[align=right] 12 \\stopxcell\n\\startxcell[align=middle] 12 \\stopxcell\n\\startxcell 12 \\stopxcell\n\\stopxrow\n\\startxrow\n\\startxcell[align=left] 123 \\stopxcell\n\\startxcell[align=right] 123 \\stopxcell\n\\startxcell[align=middle] 123 \\stopxcell\n\\startxcell 123 \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] 1 \\stopxcell\n\\startxcell[align=right] 1 \\stopxcell\n\\startxcell[align=middle] 1 \\stopxcell\n\\startxcell 1 \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n\nMultiline table with caption:\n\n\\startplacetable[title={Here's the caption. It may span multiple lines.}]\n\\startxtable\n\\startxtablehead[head]\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] Centered Header \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] Left Aligned \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] Right Aligned \\stopxcell\n\\startxcell[align=right,width={0.35\\textwidth}] Default aligned \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] First \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] row \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] 12.0 \\stopxcell\n\\startxcell[align=right,width={0.35\\textwidth}] Example of a row that spans\nmultiple lines. \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] Second \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] row \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] 5.0 \\stopxcell\n\\startxcell[align=right,width={0.35\\textwidth}] Here's another one. Note the\nblank line between rows. \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n\nMultiline table without caption:\n\n\\startplacetable[location=none]\n\\startxtable\n\\startxtablehead[head]\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] Centered Header \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] Left Aligned \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] Right Aligned \\stopxcell\n\\startxcell[align=right,width={0.35\\textwidth}] Default aligned \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] First \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] row \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] 12.0 \\stopxcell\n\\startxcell[align=right,width={0.35\\textwidth}] Example of a row that spans\nmultiple lines. \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] Second \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] row \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] 5.0 \\stopxcell\n\\startxcell[align=right,width={0.35\\textwidth}] Here's another one. Note the\nblank line between rows. \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n\nTable without column headers:\n\n\\startplacetable[location=none]\n\\startxtable\n\\startxtablehead[head]\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=left] 12 \\stopxcell\n\\startxcell[align=right] 12 \\stopxcell\n\\startxcell[align=middle] 12 \\stopxcell\n\\startxcell[align=left] 12 \\stopxcell\n\\stopxrow\n\\startxrow\n\\startxcell[align=left] 123 \\stopxcell\n\\startxcell[align=right] 123 \\stopxcell\n\\startxcell[align=middle] 123 \\stopxcell\n\\startxcell[align=left] 123 \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=left] 1 \\stopxcell\n\\startxcell[align=right] 1 \\stopxcell\n\\startxcell[align=middle] 1 \\stopxcell\n\\startxcell[align=left] 1 \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n\nMultiline table without column headers:\n\n\\startplacetable[location=none]\n\\startxtable\n\\startxtablehead[head]\n\\stopxtablehead\n\\startxtablebody[body]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] First \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] row \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] 12.0 \\stopxcell\n\\startxcell[width={0.35\\textwidth}] Example of a row that spans multiple\nlines. \\stopxcell\n\\stopxrow\n\\startxrowgroup[lastrow]\n\\startxrow\n\\startxcell[align=middle,width={0.15\\textwidth}] Second \\stopxcell\n\\startxcell[align=right,width={0.14\\textwidth}] row \\stopxcell\n\\startxcell[align=left,width={0.16\\textwidth}] 5.0 \\stopxcell\n\\startxcell[width={0.35\\textwidth}] Here's another one. Note the blank line\nbetween rows. \\stopxcell\n\\stopxrow\n\\stopxrowgroup\n\\stopxtablebody\n\\startxtablefoot[foot]\n\\stopxtablefoot\n\\stopxtable\n\\stopplacetable\n"
  },
  {
    "path": "test/tables.djot",
    "content": "Simple table with caption:\n\n| Right | Left | Center | Default |\n|------:|:-----|:------:|-------|\n|    12 | 12   |   12   | 12      |\n|   123 | 123  |  123   | 123     |\n|     1 | 1    |   1    | 1       |\n\n^ Demonstration of simple table syntax.\n\nSimple table without caption:\n\n| Right | Left | Center | Default |\n|------:|:-----|:------:|-------|\n|    12 | 12   |   12   | 12      |\n|   123 | 123  |  123   | 123     |\n|     1 | 1    |   1    | 1       |\n\nSimple table indented two spaces:\n\n| Right | Left | Center | Default |\n|------:|:-----|:------:|-------|\n|    12 | 12   |   12   | 12      |\n|   123 | 123  |  123   | 123     |\n|     1 | 1    |   1    | 1       |\n\n^ Demonstration of simple table syntax.\n\nMultiline table with caption:\n\n| Centered Header | Left Aligned | Right Aligned | Default aligned                                       |\n|:---------------:|:-------------|--------------:|:------------------------------------------------------|\n|      First      | row          |          12.0 | Example of a row that spans multiple lines.           |\n|     Second      | row          |           5.0 | Here's another one. Note the blank line between rows. |\n\n^ Here's the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n| Centered Header | Left Aligned | Right Aligned | Default aligned                                       |\n|:---------------:|:-------------|--------------:|:------------------------------------------------------|\n|      First      | row          |          12.0 | Example of a row that spans multiple lines.           |\n|     Second      | row          |           5.0 | Here's another one. Note the blank line between rows. |\n\nTable without column headers:\n\n|----:|:----|:---:|----:|\n|  12 | 12  | 12  |  12 |\n| 123 | 123 | 123 | 123 |\n|   1 | 1   |  1  |   1 |\n\nMultiline table without column headers:\n\n|:------:|:----|-----:|-----------------------------------------------------|\n| First  | row | 12.0 | Example of a row that spans multiple lines.           |\n| Second | row |  5.0 | Here's another one. Note the blank line between rows. |\n"
  },
  {
    "path": "test/tables.docbook4",
    "content": "<para>\n  Simple table with caption:\n</para>\n<table>\n  <title>Demonstration of simple table syntax.</title>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Right\n        </entry>\n        <entry>\n          Left\n        </entry>\n        <entry>\n          Center\n        </entry>\n        <entry>\n          Default\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n<para>\n  Simple table without caption:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Right\n        </entry>\n        <entry>\n          Left\n        </entry>\n        <entry>\n          Center\n        </entry>\n        <entry>\n          Default\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n<para>\n  Simple table indented two spaces:\n</para>\n<table>\n  <title>Demonstration of simple table syntax.</title>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Right\n        </entry>\n        <entry>\n          Left\n        </entry>\n        <entry>\n          Center\n        </entry>\n        <entry>\n          Default\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n<para>\n  Multiline table with caption:\n</para>\n<table>\n  <title>Here’s the caption. It may span multiple lines.</title>\n  <tgroup cols=\"4\">\n    <colspec colwidth=\"15*\" align=\"center\" />\n    <colspec colwidth=\"13*\" align=\"left\" />\n    <colspec colwidth=\"16*\" align=\"right\" />\n    <colspec colwidth=\"35*\" align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Centered Header\n        </entry>\n        <entry>\n          Left Aligned\n        </entry>\n        <entry>\n          Right Aligned\n        </entry>\n        <entry>\n          Default aligned\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          First\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          12.0\n        </entry>\n        <entry>\n          Example of a row that spans multiple lines.\n        </entry>\n      </row>\n      <row>\n        <entry>\n          Second\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          5.0\n        </entry>\n        <entry>\n          Here’s another one. Note the blank line between rows.\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n<para>\n  Multiline table without caption:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec colwidth=\"15*\" align=\"center\" />\n    <colspec colwidth=\"13*\" align=\"left\" />\n    <colspec colwidth=\"16*\" align=\"right\" />\n    <colspec colwidth=\"35*\" align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Centered Header\n        </entry>\n        <entry>\n          Left Aligned\n        </entry>\n        <entry>\n          Right Aligned\n        </entry>\n        <entry>\n          Default aligned\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          First\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          12.0\n        </entry>\n        <entry>\n          Example of a row that spans multiple lines.\n        </entry>\n      </row>\n      <row>\n        <entry>\n          Second\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          5.0\n        </entry>\n        <entry>\n          Here’s another one. Note the blank line between rows.\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n<para>\n  Table without column headers:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"right\" />\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n<para>\n  Multiline table without column headers:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec colwidth=\"15*\" align=\"center\" />\n    <colspec colwidth=\"13*\" align=\"left\" />\n    <colspec colwidth=\"16*\" align=\"right\" />\n    <colspec colwidth=\"35*\" align=\"left\" />\n    <tbody>\n      <row>\n        <entry>\n          First\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          12.0\n        </entry>\n        <entry>\n          Example of a row that spans multiple lines.\n        </entry>\n      </row>\n      <row>\n        <entry>\n          Second\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          5.0\n        </entry>\n        <entry>\n          Here’s another one. Note the blank line between rows.\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n"
  },
  {
    "path": "test/tables.docbook5",
    "content": "<para>\n  Simple table with caption:\n</para>\n<table>\n  <title>Demonstration of simple table syntax.</title>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Right\n        </entry>\n        <entry>\n          Left\n        </entry>\n        <entry>\n          Center\n        </entry>\n        <entry>\n          Default\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n<para>\n  Simple table without caption:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Right\n        </entry>\n        <entry>\n          Left\n        </entry>\n        <entry>\n          Center\n        </entry>\n        <entry>\n          Default\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n<para>\n  Simple table indented two spaces:\n</para>\n<table>\n  <title>Demonstration of simple table syntax.</title>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Right\n        </entry>\n        <entry>\n          Left\n        </entry>\n        <entry>\n          Center\n        </entry>\n        <entry>\n          Default\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n<para>\n  Multiline table with caption:\n</para>\n<table>\n  <title>Here’s the caption. It may span multiple lines.</title>\n  <tgroup cols=\"4\">\n    <colspec colwidth=\"15*\" align=\"center\" />\n    <colspec colwidth=\"13*\" align=\"left\" />\n    <colspec colwidth=\"16*\" align=\"right\" />\n    <colspec colwidth=\"35*\" align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Centered Header\n        </entry>\n        <entry>\n          Left Aligned\n        </entry>\n        <entry>\n          Right Aligned\n        </entry>\n        <entry>\n          Default aligned\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          First\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          12.0\n        </entry>\n        <entry>\n          Example of a row that spans multiple lines.\n        </entry>\n      </row>\n      <row>\n        <entry>\n          Second\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          5.0\n        </entry>\n        <entry>\n          Here’s another one. Note the blank line between rows.\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</table>\n<para>\n  Multiline table without caption:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec colwidth=\"15*\" align=\"center\" />\n    <colspec colwidth=\"13*\" align=\"left\" />\n    <colspec colwidth=\"16*\" align=\"right\" />\n    <colspec colwidth=\"35*\" align=\"left\" />\n    <thead>\n      <row>\n        <entry>\n          Centered Header\n        </entry>\n        <entry>\n          Left Aligned\n        </entry>\n        <entry>\n          Right Aligned\n        </entry>\n        <entry>\n          Default aligned\n        </entry>\n      </row>\n    </thead>\n    <tbody>\n      <row>\n        <entry>\n          First\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          12.0\n        </entry>\n        <entry>\n          Example of a row that spans multiple lines.\n        </entry>\n      </row>\n      <row>\n        <entry>\n          Second\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          5.0\n        </entry>\n        <entry>\n          Here’s another one. Note the blank line between rows.\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n<para>\n  Table without column headers:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec align=\"right\" />\n    <colspec align=\"left\" />\n    <colspec align=\"center\" />\n    <colspec align=\"right\" />\n    <tbody>\n      <row>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n        <entry>\n          12\n        </entry>\n      </row>\n      <row>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n        <entry>\n          123\n        </entry>\n      </row>\n      <row>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n        <entry>\n          1\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n<para>\n  Multiline table without column headers:\n</para>\n<informaltable>\n  <tgroup cols=\"4\">\n    <colspec colwidth=\"15*\" align=\"center\" />\n    <colspec colwidth=\"13*\" align=\"left\" />\n    <colspec colwidth=\"16*\" align=\"right\" />\n    <colspec colwidth=\"35*\" align=\"left\" />\n    <tbody>\n      <row>\n        <entry>\n          First\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          12.0\n        </entry>\n        <entry>\n          Example of a row that spans multiple lines.\n        </entry>\n      </row>\n      <row>\n        <entry>\n          Second\n        </entry>\n        <entry>\n          row\n        </entry>\n        <entry>\n          5.0\n        </entry>\n        <entry>\n          Here’s another one. Note the blank line between rows.\n        </entry>\n      </row>\n    </tbody>\n  </tgroup>\n</informaltable>\n"
  },
  {
    "path": "test/tables.dokuwiki",
    "content": "Simple table with caption:\n\nDemonstration of simple table syntax.\n^  Right^Left  ^  Center  ^Default^\n|     12|12    |    12    |12     |\n|    123|123   |   123    |123    |\n|      1|1     |    1     |1      |\n\nSimple table without caption:\n\n^  Right^Left  ^  Center  ^Default^\n|     12|12    |    12    |12     |\n|    123|123   |   123    |123    |\n|      1|1     |    1     |1      |\n\nSimple table indented two spaces:\n\nDemonstration of simple table syntax.\n^  Right^Left  ^  Center  ^Default^\n|     12|12    |    12    |12     |\n|    123|123   |   123    |123    |\n|      1|1     |    1     |1      |\n\nMultiline table with caption:\n\nHere’s the caption. It may span multiple lines.\n^  Centered Header  ^Left Aligned  ^  Right Aligned^Default aligned                                        ^\n|       First       |row           |           12.0|Example of a row that spans multiple lines.            |\n|      Second       |row           |            5.0|Here’s another one. Note the blank line between rows.  |\n\nMultiline table without caption:\n\n^  Centered Header  ^Left Aligned  ^  Right Aligned^Default aligned                                        ^\n|       First       |row           |           12.0|Example of a row that spans multiple lines.            |\n|      Second       |row           |            5.0|Here’s another one. Note the blank line between rows.  |\n\nTable without column headers:\n\n|   12|12   |  12   |   12|\n|  123|123  |  123  |  123|\n|    1|1    |   1   |    1|\n\nMultiline table without column headers:\n\n|  First   |row  |  12.0|Example of a row that spans multiple lines.          |\n|  Second  |row  |   5.0|Here’s another one. Note the blank line between rows.|\n"
  },
  {
    "path": "test/tables.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\"><description><title-info><genre>unrecognised</genre></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p /></title><section><p>Simple table with caption:</p><table><tr><th align=\"right\">Right</th><th align=\"left\">Left</th><th align=\"center\">Center</th><th align=\"left\">Default</th></tr><tr><td align=\"right\">12</td><td align=\"left\">12</td><td align=\"center\">12</td><td align=\"left\">12</td></tr><tr><td align=\"right\">123</td><td align=\"left\">123</td><td align=\"center\">123</td><td align=\"left\">123</td></tr><tr><td align=\"right\">1</td><td align=\"left\">1</td><td align=\"center\">1</td><td align=\"left\">1</td></tr></table><p><emphasis>Demonstration of simple table syntax.</emphasis></p><p>Simple table without caption:</p><table><tr><th align=\"right\">Right</th><th align=\"left\">Left</th><th align=\"center\">Center</th><th align=\"left\">Default</th></tr><tr><td align=\"right\">12</td><td align=\"left\">12</td><td align=\"center\">12</td><td align=\"left\">12</td></tr><tr><td align=\"right\">123</td><td align=\"left\">123</td><td align=\"center\">123</td><td align=\"left\">123</td></tr><tr><td align=\"right\">1</td><td align=\"left\">1</td><td align=\"center\">1</td><td align=\"left\">1</td></tr></table><p><emphasis /></p><p>Simple table indented two spaces:</p><table><tr><th align=\"right\">Right</th><th align=\"left\">Left</th><th align=\"center\">Center</th><th align=\"left\">Default</th></tr><tr><td align=\"right\">12</td><td align=\"left\">12</td><td align=\"center\">12</td><td align=\"left\">12</td></tr><tr><td align=\"right\">123</td><td align=\"left\">123</td><td align=\"center\">123</td><td align=\"left\">123</td></tr><tr><td align=\"right\">1</td><td align=\"left\">1</td><td align=\"center\">1</td><td align=\"left\">1</td></tr></table><p><emphasis>Demonstration of simple table syntax.</emphasis></p><p>Multiline table with caption:</p><table><tr><th align=\"center\">Centered\nHeader</th><th align=\"left\">Left\nAligned</th><th align=\"right\">Right\nAligned</th><th align=\"left\">Default aligned</th></tr><tr><td align=\"center\">First</td><td align=\"left\">row</td><td align=\"right\">12.0</td><td align=\"left\">Example of a row that spans\nmultiple lines.</td></tr><tr><td align=\"center\">Second</td><td align=\"left\">row</td><td align=\"right\">5.0</td><td align=\"left\">Here’s another one. Note\nthe blank line between rows.</td></tr></table><p><emphasis>Here’s the caption.\nIt may span multiple lines.</emphasis></p><p>Multiline table without caption:</p><table><tr><th align=\"center\">Centered\nHeader</th><th align=\"left\">Left\nAligned</th><th align=\"right\">Right\nAligned</th><th align=\"left\">Default aligned</th></tr><tr><td align=\"center\">First</td><td align=\"left\">row</td><td align=\"right\">12.0</td><td align=\"left\">Example of a row that spans\nmultiple lines.</td></tr><tr><td align=\"center\">Second</td><td align=\"left\">row</td><td align=\"right\">5.0</td><td align=\"left\">Here’s another one. Note\nthe blank line between rows.</td></tr></table><p><emphasis /></p><p>Table without column headers:</p><table><tr><td align=\"right\">12</td><td align=\"left\">12</td><td align=\"center\">12</td><td align=\"right\">12</td></tr><tr><td align=\"right\">123</td><td align=\"left\">123</td><td align=\"center\">123</td><td align=\"right\">123</td></tr><tr><td align=\"right\">1</td><td align=\"left\">1</td><td align=\"center\">1</td><td align=\"right\">1</td></tr></table><p><emphasis /></p><p>Multiline table without column headers:</p><table><tr><td align=\"center\">First</td><td align=\"left\">row</td><td align=\"right\">12.0</td><td align=\"left\">Example of a row that spans\nmultiple lines.</td></tr><tr><td align=\"center\">Second</td><td align=\"left\">row</td><td align=\"right\">5.0</td><td align=\"left\">Here’s another one. Note\nthe blank line between rows.</td></tr></table><p><emphasis /></p></section></body></FictionBook>\n"
  },
  {
    "path": "test/tables.haddock",
    "content": "Simple table with caption:\n\n+-------+------+--------+---------+\n| Right | Left | Center | Default |\n+======:+:=====+:======:+=========+\n| 12    | 12   | 12     | 12      |\n+-------+------+--------+---------+\n| 123   | 123  | 123    | 123     |\n+-------+------+--------+---------+\n| 1     | 1    | 1      | 1       |\n+-------+------+--------+---------+\n\nDemonstration of simple table syntax.\n\nSimple table without caption:\n\n+-------+------+--------+---------+\n| Right | Left | Center | Default |\n+======:+:=====+:======:+=========+\n| 12    | 12   | 12     | 12      |\n+-------+------+--------+---------+\n| 123   | 123  | 123    | 123     |\n+-------+------+--------+---------+\n| 1     | 1    | 1      | 1       |\n+-------+------+--------+---------+\n\nSimple table indented two spaces:\n\n+-------+------+--------+---------+\n| Right | Left | Center | Default |\n+======:+:=====+:======:+=========+\n| 12    | 12   | 12     | 12      |\n+-------+------+--------+---------+\n| 123   | 123  | 123    | 123     |\n+-------+------+--------+---------+\n| 1     | 1    | 1      | 1       |\n+-------+------+--------+---------+\n\nDemonstration of simple table syntax.\n\nMultiline table with caption:\n\n+-----------+----------+------------+---------------------------+\n| Centered  | Left     | Right      | Default aligned           |\n| Header    | Aligned  | Aligned    |                           |\n+:=========:+:=========+===========:+:==========================+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\n\nHere’s the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n+-----------+----------+------------+---------------------------+\n| Centered  | Left     | Right      | Default aligned           |\n| Header    | Aligned  | Aligned    |                           |\n+:=========:+:=========+===========:+:==========================+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\n\nTable without column headers:\n\n+----:+:----+:---:+----:+\n| 12  | 12  | 12  | 12  |\n+-----+-----+-----+-----+\n| 123 | 123 | 123 | 123 |\n+-----+-----+-----+-----+\n| 1   | 1   | 1   | 1   |\n+-----+-----+-----+-----+\n\nMultiline table without column headers:\n\n+:---------:+:---------+-----------:+---------------------------+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\n"
  },
  {
    "path": "test/tables.html4",
    "content": "<p>Simple table with caption:</p>\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td>12</td>\n</tr>\n<tr>\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td>123</td>\n</tr>\n<tr>\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td>1</td>\n</tr>\n</tbody>\n</table>\n<p>Simple table without caption:</p>\n<table>\n<thead>\n<tr>\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td>12</td>\n</tr>\n<tr>\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td>123</td>\n</tr>\n<tr>\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td>1</td>\n</tr>\n</tbody>\n</table>\n<p>Simple table indented two spaces:</p>\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td>12</td>\n</tr>\n<tr>\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td>123</td>\n</tr>\n<tr>\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td>1</td>\n</tr>\n</tbody>\n</table>\n<p>Multiline table with caption:</p>\n<table style=\"width:80%;\">\n<caption>Here’s the caption. It may span multiple lines.</caption>\n<colgroup>\n<col width=\"15%\" />\n<col width=\"13%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n</colgroup>\n<thead>\n<tr>\n<th align=\"center\">Centered Header</th>\n<th align=\"left\">Left Aligned</th>\n<th align=\"right\">Right Aligned</th>\n<th align=\"left\">Default aligned</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here’s another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n<p>Multiline table without caption:</p>\n<table style=\"width:80%;\">\n<colgroup>\n<col width=\"15%\" />\n<col width=\"13%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n</colgroup>\n<thead>\n<tr>\n<th align=\"center\">Centered Header</th>\n<th align=\"left\">Left Aligned</th>\n<th align=\"right\">Right Aligned</th>\n<th align=\"left\">Default aligned</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here’s another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n<p>Table without column headers:</p>\n<table>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"right\">12</td>\n</tr>\n<tr>\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"right\">123</td>\n</tr>\n<tr>\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"right\">1</td>\n</tr>\n</tbody>\n</table>\n<p>Multiline table without column headers:</p>\n<table style=\"width:80%;\">\n<colgroup>\n<col width=\"15%\" />\n<col width=\"13%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n</colgroup>\n<tbody>\n<tr>\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td>Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td>Here’s another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables.html5",
    "content": "<p>Simple table with caption:</p>\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th style=\"text-align: right;\">Right</th>\n<th style=\"text-align: left;\">Left</th>\n<th style=\"text-align: center;\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: right;\">12</td>\n<td style=\"text-align: left;\">12</td>\n<td style=\"text-align: center;\">12</td>\n<td>12</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">123</td>\n<td style=\"text-align: left;\">123</td>\n<td style=\"text-align: center;\">123</td>\n<td>123</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">1</td>\n<td style=\"text-align: left;\">1</td>\n<td style=\"text-align: center;\">1</td>\n<td>1</td>\n</tr>\n</tbody>\n</table>\n<p>Simple table without caption:</p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: right;\">Right</th>\n<th style=\"text-align: left;\">Left</th>\n<th style=\"text-align: center;\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: right;\">12</td>\n<td style=\"text-align: left;\">12</td>\n<td style=\"text-align: center;\">12</td>\n<td>12</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">123</td>\n<td style=\"text-align: left;\">123</td>\n<td style=\"text-align: center;\">123</td>\n<td>123</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">1</td>\n<td style=\"text-align: left;\">1</td>\n<td style=\"text-align: center;\">1</td>\n<td>1</td>\n</tr>\n</tbody>\n</table>\n<p>Simple table indented two spaces:</p>\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th style=\"text-align: right;\">Right</th>\n<th style=\"text-align: left;\">Left</th>\n<th style=\"text-align: center;\">Center</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: right;\">12</td>\n<td style=\"text-align: left;\">12</td>\n<td style=\"text-align: center;\">12</td>\n<td>12</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">123</td>\n<td style=\"text-align: left;\">123</td>\n<td style=\"text-align: center;\">123</td>\n<td>123</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">1</td>\n<td style=\"text-align: left;\">1</td>\n<td style=\"text-align: center;\">1</td>\n<td>1</td>\n</tr>\n</tbody>\n</table>\n<p>Multiline table with caption:</p>\n<table style=\"width:80%;\">\n<caption>Here’s the caption. It may span multiple lines.</caption>\n<colgroup>\n<col style=\"width: 15%\" />\n<col style=\"width: 13%\" />\n<col style=\"width: 16%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Centered Header</th>\n<th style=\"text-align: left;\">Left Aligned</th>\n<th style=\"text-align: right;\">Right Aligned</th>\n<th style=\"text-align: left;\">Default aligned</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">First</td>\n<td style=\"text-align: left;\">row</td>\n<td style=\"text-align: right;\">12.0</td>\n<td style=\"text-align: left;\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td style=\"text-align: center;\">Second</td>\n<td style=\"text-align: left;\">row</td>\n<td style=\"text-align: right;\">5.0</td>\n<td style=\"text-align: left;\">Here’s another one. Note the blank line between\nrows.</td>\n</tr>\n</tbody>\n</table>\n<p>Multiline table without caption:</p>\n<table style=\"width:80%;\">\n<colgroup>\n<col style=\"width: 15%\" />\n<col style=\"width: 13%\" />\n<col style=\"width: 16%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Centered Header</th>\n<th style=\"text-align: left;\">Left Aligned</th>\n<th style=\"text-align: right;\">Right Aligned</th>\n<th style=\"text-align: left;\">Default aligned</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">First</td>\n<td style=\"text-align: left;\">row</td>\n<td style=\"text-align: right;\">12.0</td>\n<td style=\"text-align: left;\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td style=\"text-align: center;\">Second</td>\n<td style=\"text-align: left;\">row</td>\n<td style=\"text-align: right;\">5.0</td>\n<td style=\"text-align: left;\">Here’s another one. Note the blank line between\nrows.</td>\n</tr>\n</tbody>\n</table>\n<p>Table without column headers:</p>\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: right;\">12</td>\n<td style=\"text-align: left;\">12</td>\n<td style=\"text-align: center;\">12</td>\n<td style=\"text-align: right;\">12</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">123</td>\n<td style=\"text-align: left;\">123</td>\n<td style=\"text-align: center;\">123</td>\n<td style=\"text-align: right;\">123</td>\n</tr>\n<tr>\n<td style=\"text-align: right;\">1</td>\n<td style=\"text-align: left;\">1</td>\n<td style=\"text-align: center;\">1</td>\n<td style=\"text-align: right;\">1</td>\n</tr>\n</tbody>\n</table>\n<p>Multiline table without column headers:</p>\n<table style=\"width:80%;\">\n<colgroup>\n<col style=\"width: 15%\" />\n<col style=\"width: 13%\" />\n<col style=\"width: 16%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">First</td>\n<td style=\"text-align: left;\">row</td>\n<td style=\"text-align: right;\">12.0</td>\n<td>Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td style=\"text-align: center;\">Second</td>\n<td style=\"text-align: left;\">row</td>\n<td style=\"text-align: right;\">5.0</td>\n<td>Here’s another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables.icml",
    "content": "<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Simple table with caption:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"1\" BodyRowCount=\"3\" ColumnCount=\"4\">\n  <Column Name=\"0\" />\n  <Column Name=\"1\" />\n  <Column Name=\"2\" />\n  <Column Name=\"3\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Right</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Left</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Center</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Default</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Demonstration of simple table syntax.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Simple table without caption:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"1\" BodyRowCount=\"3\" ColumnCount=\"4\">\n  <Column Name=\"0\" />\n  <Column Name=\"1\" />\n  <Column Name=\"2\" />\n  <Column Name=\"3\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Right</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Left</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Center</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Default</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Simple table indented two spaces:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"1\" BodyRowCount=\"3\" ColumnCount=\"4\">\n  <Column Name=\"0\" />\n  <Column Name=\"1\" />\n  <Column Name=\"2\" />\n  <Column Name=\"3\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Right</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Left</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Center</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Default</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:3\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Demonstration of simple table syntax.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiline table with caption:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"1\" BodyRowCount=\"2\" ColumnCount=\"4\">\n  <Column Name=\"0\" SingleColumnWidth=\"75.0\" />\n  <Column Name=\"1\" SingleColumnWidth=\"68.75\" />\n  <Column Name=\"2\" SingleColumnWidth=\"81.25\" />\n  <Column Name=\"3\" SingleColumnWidth=\"175.0\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Centered Header</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Left Aligned</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Right Aligned</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Default aligned</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>First</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>row</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12.0</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Example of a row that spans multiple lines.</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Second</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>row</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>5.0</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Here’s another one. Note the blank line between rows.</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s the caption. It may span multiple lines.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiline table without caption:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"1\" BodyRowCount=\"2\" ColumnCount=\"4\">\n  <Column Name=\"0\" SingleColumnWidth=\"75.0\" />\n  <Column Name=\"1\" SingleColumnWidth=\"68.75\" />\n  <Column Name=\"2\" SingleColumnWidth=\"81.25\" />\n  <Column Name=\"3\" SingleColumnWidth=\"175.0\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Centered Header</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Left Aligned</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Right Aligned</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; TableHeader &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Default aligned</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>First</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>row</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12.0</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Example of a row that spans multiple lines.</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Second</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>row</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>5.0</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Here’s another one. Note the blank line between rows.</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Table without column headers:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"0\" BodyRowCount=\"3\" ColumnCount=\"4\">\n  <Column Name=\"0\" />\n  <Column Name=\"1\" />\n  <Column Name=\"2\" />\n  <Column Name=\"3\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>123</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:2\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>1</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiline table without column headers:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<Table AppliedTableStyle=\"TableStyle/Table\" HeaderRowCount=\"0\" BodyRowCount=\"2\" ColumnCount=\"4\">\n  <Column Name=\"0\" SingleColumnWidth=\"75.0\" />\n  <Column Name=\"1\" SingleColumnWidth=\"68.75\" />\n  <Column Name=\"2\" SingleColumnWidth=\"81.25\" />\n  <Column Name=\"3\" SingleColumnWidth=\"175.0\" />\n  <Cell Name=\"0:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>First</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>row</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>12.0</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:0\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Example of a row that spans multiple lines.</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"0:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; CenterAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Second</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"1:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; LeftAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>row</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"2:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar &gt; RightAlign\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>5.0</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n  <Cell Name=\"3:1\" AppliedCellStyle=\"CellStyle/Cell\">\n    <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TablePar\">\n      <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n        <Content>Here’s another one. Note the blank line between rows.</Content>\n      </CharacterStyleRange>\n    </ParagraphStyleRange>\n  </Cell>\n</Table>\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/TableCaption\">\n</ParagraphStyleRange>\n"
  },
  {
    "path": "test/tables.jats_archiving",
    "content": "<p>Simple table with caption:</p>\n<table-wrap>\n  <caption>\n    <p>Demonstration of simple table syntax.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Simple table without caption:</p>\n<table-wrap>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Simple table indented two spaces:</p>\n<table-wrap>\n  <caption>\n    <p>Demonstration of simple table syntax.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table with caption:</p>\n<table-wrap>\n  <caption>\n    <p>Here’s the caption. It may span multiple lines.</p>\n  </caption>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Centered Header</th>\n        <th align=\"left\">Left Aligned</th>\n        <th align=\"right\">Right Aligned</th>\n        <th align=\"left\">Default aligned</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td align=\"left\">Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td align=\"left\">Here’s another one. Note the blank line between\n        rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table without caption:</p>\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Centered Header</th>\n        <th align=\"left\">Left Aligned</th>\n        <th align=\"right\">Right Aligned</th>\n        <th align=\"left\">Default aligned</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td align=\"left\">Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td align=\"left\">Here’s another one. Note the blank line between\n        rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Table without column headers:</p>\n<table-wrap>\n  <table>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td align=\"right\">12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td align=\"right\">123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td align=\"right\">1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table without column headers:</p>\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td>Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td>Here’s another one. Note the blank line between rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n"
  },
  {
    "path": "test/tables.jats_articleauthoring",
    "content": "<p>Simple table with caption:</p>\n<table-wrap>\n  <caption>\n    <p>Demonstration of simple table syntax.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Simple table without caption:</p>\n<table-wrap>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Simple table indented two spaces:</p>\n<table-wrap>\n  <caption>\n    <p>Demonstration of simple table syntax.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table with caption:</p>\n<table-wrap>\n  <caption>\n    <p>Here’s the caption. It may span multiple lines.</p>\n  </caption>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Centered Header</th>\n        <th align=\"left\">Left Aligned</th>\n        <th align=\"right\">Right Aligned</th>\n        <th align=\"left\">Default aligned</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td align=\"left\">Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td align=\"left\">Here’s another one. Note the blank line between\n        rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table without caption:</p>\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Centered Header</th>\n        <th align=\"left\">Left Aligned</th>\n        <th align=\"right\">Right Aligned</th>\n        <th align=\"left\">Default aligned</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td align=\"left\">Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td align=\"left\">Here’s another one. Note the blank line between\n        rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Table without column headers:</p>\n<table-wrap>\n  <table>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td align=\"right\">12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td align=\"right\">123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td align=\"right\">1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table without column headers:</p>\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td>Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td>Here’s another one. Note the blank line between rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n"
  },
  {
    "path": "test/tables.jats_publishing",
    "content": "<p>Simple table with caption:</p>\n<table-wrap>\n  <caption>\n    <p>Demonstration of simple table syntax.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Simple table without caption:</p>\n<table-wrap>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Simple table indented two spaces:</p>\n<table-wrap>\n  <caption>\n    <p>Demonstration of simple table syntax.</p>\n  </caption>\n  <table>\n    <thead>\n      <tr>\n        <th align=\"right\">Right</th>\n        <th align=\"left\">Left</th>\n        <th align=\"center\">Center</th>\n        <th>Default</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td>12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td>123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td>1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table with caption:</p>\n<table-wrap>\n  <caption>\n    <p>Here’s the caption. It may span multiple lines.</p>\n  </caption>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Centered Header</th>\n        <th align=\"left\">Left Aligned</th>\n        <th align=\"right\">Right Aligned</th>\n        <th align=\"left\">Default aligned</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td align=\"left\">Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td align=\"left\">Here’s another one. Note the blank line between\n        rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table without caption:</p>\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <thead>\n      <tr>\n        <th align=\"center\">Centered Header</th>\n        <th align=\"left\">Left Aligned</th>\n        <th align=\"right\">Right Aligned</th>\n        <th align=\"left\">Default aligned</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td align=\"left\">Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td align=\"left\">Here’s another one. Note the blank line between\n        rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Table without column headers:</p>\n<table-wrap>\n  <table>\n    <tbody>\n      <tr>\n        <td align=\"right\">12</td>\n        <td align=\"left\">12</td>\n        <td align=\"center\">12</td>\n        <td align=\"right\">12</td>\n      </tr>\n      <tr>\n        <td align=\"right\">123</td>\n        <td align=\"left\">123</td>\n        <td align=\"center\">123</td>\n        <td align=\"right\">123</td>\n      </tr>\n      <tr>\n        <td align=\"right\">1</td>\n        <td align=\"left\">1</td>\n        <td align=\"center\">1</td>\n        <td align=\"right\">1</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n<p>Multiline table without column headers:</p>\n<table-wrap>\n  <table>\n    <colgroup>\n      <col width=\"15%\" />\n      <col width=\"14%\" />\n      <col width=\"16%\" />\n      <col width=\"35%\" />\n    </colgroup>\n    <tbody>\n      <tr>\n        <td align=\"center\">First</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">12.0</td>\n        <td>Example of a row that spans multiple lines.</td>\n      </tr>\n      <tr>\n        <td align=\"center\">Second</td>\n        <td align=\"left\">row</td>\n        <td align=\"right\">5.0</td>\n        <td>Here’s another one. Note the blank line between rows.</td>\n      </tr>\n    </tbody>\n  </table>\n</table-wrap>\n"
  },
  {
    "path": "test/tables.jira",
    "content": "Simple table with caption:\n\n|| Right || Left || Center || Default ||\n| 12 | 12 | 12 | 12 |\n| 123 | 123 | 123 | 123 |\n| 1 | 1 | 1 | 1 |\n\nSimple table without caption:\n\n|| Right || Left || Center || Default ||\n| 12 | 12 | 12 | 12 |\n| 123 | 123 | 123 | 123 |\n| 1 | 1 | 1 | 1 |\n\nSimple table indented two spaces:\n\n|| Right || Left || Center || Default ||\n| 12 | 12 | 12 | 12 |\n| 123 | 123 | 123 | 123 |\n| 1 | 1 | 1 | 1 |\n\nMultiline table with caption:\n\n|| Centered Header || Left Aligned || Right Aligned || Default aligned ||\n| First | row | 12.0 | Example of a row that spans multiple lines. |\n| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |\n\nMultiline table without caption:\n\n|| Centered Header || Left Aligned || Right Aligned || Default aligned ||\n| First | row | 12.0 | Example of a row that spans multiple lines. |\n| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |\n\nTable without column headers:\n\n| 12 | 12 | 12 | 12 |\n| 123 | 123 | 123 | 123 |\n| 1 | 1 | 1 | 1 |\n\nMultiline table without column headers:\n\n| First | row | 12.0 | Example of a row that spans multiple lines. |\n| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |\n"
  },
  {
    "path": "test/tables.latex",
    "content": "Simple table with caption:\n\n\\begin{longtable}[]{@{}rlcl@{}}\n\\caption{Demonstration of simple table syntax.}\\tabularnewline\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n\nSimple table without caption:\n\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}rlcl@{}}\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n}\n\nSimple table indented two spaces:\n\n\\begin{longtable}[]{@{}rlcl@{}}\n\\caption{Demonstration of simple table syntax.}\\tabularnewline\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\nRight & Left & Center & Default \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n\nMultiline table with caption:\n\n\\begin{longtable}[]{@{}\n  >{\\centering\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1500}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1375}}\n  >{\\raggedleft\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1625}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.3500}}@{}}\n\\caption{Here's the caption. It may span multiple lines.}\\tabularnewline\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nCentered Header\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedright\nLeft Aligned\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedleft\nRight Aligned\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedright\nDefault aligned\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endfirsthead\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nCentered Header\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedright\nLeft Aligned\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedleft\nRight Aligned\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedright\nDefault aligned\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\nFirst & row & 12.0 & Example of a row that spans multiple lines. \\\\\nSecond & row & 5.0 & Here's another one. Note the blank line between rows. \\\\\n\\end{longtable}\n\nMultiline table without caption:\n\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}\n  >{\\centering\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1500}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1375}}\n  >{\\raggedleft\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1625}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.3500}}@{}}\n\\toprule\\noalign{}\n\\begin{minipage}[b]{\\linewidth}\\centering\nCentered Header\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedright\nLeft Aligned\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedleft\nRight Aligned\n\\end{minipage} & \\begin{minipage}[b]{\\linewidth}\\raggedright\nDefault aligned\n\\end{minipage} \\\\\n\\midrule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\nFirst & row & 12.0 & Example of a row that spans multiple lines. \\\\\nSecond & row & 5.0 & Here's another one. Note the blank line between rows. \\\\\n\\end{longtable}\n}\n\nTable without column headers:\n\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}rlcr@{}}\n\\toprule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\n12 & 12 & 12 & 12 \\\\\n123 & 123 & 123 & 123 \\\\\n1 & 1 & 1 & 1 \\\\\n\\end{longtable}\n}\n\nMultiline table without column headers:\n\n{\\def\\LTcaptype{none} % do not increment counter\n\\begin{longtable}[]{@{}\n  >{\\centering\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1500}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1375}}\n  >{\\raggedleft\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.1625}}\n  >{\\raggedright\\arraybackslash}p{(\\linewidth - 6\\tabcolsep) * \\real{0.3500}}@{}}\n\\toprule\\noalign{}\n\\endhead\n\\bottomrule\\noalign{}\n\\endlastfoot\nFirst & row & 12.0 & Example of a row that spans multiple lines. \\\\\nSecond & row & 5.0 & Here's another one. Note the blank line between rows. \\\\\n\\end{longtable}\n}\n"
  },
  {
    "path": "test/tables.man",
    "content": ".PP\nSimple table with caption:\n.PP\nDemonstration of simple table syntax.\n.TS\ntab(@);\nr l c l.\nT{\nRight\nT}@T{\nLeft\nT}@T{\nCenter\nT}@T{\nDefault\nT}\n_\nT{\n12\nT}@T{\n12\nT}@T{\n12\nT}@T{\n12\nT}\nT{\n123\nT}@T{\n123\nT}@T{\n123\nT}@T{\n123\nT}\nT{\n1\nT}@T{\n1\nT}@T{\n1\nT}@T{\n1\nT}\n.TE\n.PP\nSimple table without caption:\n.PP\n.TS\ntab(@);\nr l c l.\nT{\nRight\nT}@T{\nLeft\nT}@T{\nCenter\nT}@T{\nDefault\nT}\n_\nT{\n12\nT}@T{\n12\nT}@T{\n12\nT}@T{\n12\nT}\nT{\n123\nT}@T{\n123\nT}@T{\n123\nT}@T{\n123\nT}\nT{\n1\nT}@T{\n1\nT}@T{\n1\nT}@T{\n1\nT}\n.TE\n.PP\nSimple table indented two spaces:\n.PP\nDemonstration of simple table syntax.\n.TS\ntab(@);\nr l c l.\nT{\nRight\nT}@T{\nLeft\nT}@T{\nCenter\nT}@T{\nDefault\nT}\n_\nT{\n12\nT}@T{\n12\nT}@T{\n12\nT}@T{\n12\nT}\nT{\n123\nT}@T{\n123\nT}@T{\n123\nT}@T{\n123\nT}\nT{\n1\nT}@T{\n1\nT}@T{\n1\nT}@T{\n1\nT}\n.TE\n.PP\nMultiline table with caption:\n.PP\nHere\\(cqs the caption. It may span multiple lines.\n.TS\ntab(@);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\nCentered Header\nT}@T{\nLeft Aligned\nT}@T{\nRight Aligned\nT}@T{\nDefault aligned\nT}\n_\nT{\nFirst\nT}@T{\nrow\nT}@T{\n12.0\nT}@T{\nExample of a row that spans multiple lines.\nT}\nT{\nSecond\nT}@T{\nrow\nT}@T{\n5.0\nT}@T{\nHere\\(cqs another one.\nNote the blank line between rows.\nT}\n.TE\n.PP\nMultiline table without caption:\n.PP\n.TS\ntab(@);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\nCentered Header\nT}@T{\nLeft Aligned\nT}@T{\nRight Aligned\nT}@T{\nDefault aligned\nT}\n_\nT{\nFirst\nT}@T{\nrow\nT}@T{\n12.0\nT}@T{\nExample of a row that spans multiple lines.\nT}\nT{\nSecond\nT}@T{\nrow\nT}@T{\n5.0\nT}@T{\nHere\\(cqs another one.\nNote the blank line between rows.\nT}\n.TE\n.PP\nTable without column headers:\n.PP\n.TS\ntab(@);\nr l c r.\nT{\n12\nT}@T{\n12\nT}@T{\n12\nT}@T{\n12\nT}\nT{\n123\nT}@T{\n123\nT}@T{\n123\nT}@T{\n123\nT}\nT{\n1\nT}@T{\n1\nT}@T{\n1\nT}@T{\n1\nT}\n.TE\n.PP\nMultiline table without column headers:\n.PP\n.TS\ntab(@);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\nFirst\nT}@T{\nrow\nT}@T{\n12.0\nT}@T{\nExample of a row that spans multiple lines.\nT}\nT{\nSecond\nT}@T{\nrow\nT}@T{\n5.0\nT}@T{\nHere\\(cqs another one.\nNote the blank line between rows.\nT}\n.TE\n"
  },
  {
    "path": "test/tables.markdown",
    "content": "Simple table with caption:\n\n    Right Left    Center  Default\n  ------- ------ -------- ---------\n       12 12        12    12\n      123 123      123    123\n        1 1         1     1\n\n  : Demonstration of simple table syntax.\n\nSimple table without caption:\n\n    Right Left    Center  Default\n  ------- ------ -------- ---------\n       12 12        12    12\n      123 123      123    123\n        1 1         1     1\n\nSimple table indented two spaces:\n\n    Right Left    Center  Default\n  ------- ------ -------- ---------\n       12 12        12    12\n      123 123      123    123\n        1 1         1     1\n\n  : Demonstration of simple table syntax.\n\nMultiline table with caption:\n\n  ---------------------------------------------------------------\n   Centered   Left              Right Default aligned\n    Header    Aligned         Aligned \n  ----------- ---------- ------------ ---------------------------\n     First    row                12.0 Example of a row that spans\n                                      multiple lines.\n\n    Second    row                 5.0 Here's another one. Note\n                                      the blank line between\n                                      rows.\n  ---------------------------------------------------------------\n\n  : Here's the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n  ---------------------------------------------------------------\n   Centered   Left              Right Default aligned\n    Header    Aligned         Aligned \n  ----------- ---------- ------------ ---------------------------\n     First    row                12.0 Example of a row that spans\n                                      multiple lines.\n\n    Second    row                 5.0 Here's another one. Note\n                                      the blank line between\n                                      rows.\n  ---------------------------------------------------------------\n\nTable without column headers:\n\n  ----- ----- ----- -----\n     12 12     12      12\n    123 123    123    123\n      1 1       1       1\n  ----- ----- ----- -----\n\nMultiline table without column headers:\n\n  ----------- ---------- ------------ ---------------------------\n     First    row                12.0 Example of a row that spans\n                                      multiple lines.\n\n    Second    row                 5.0 Here's another one. Note\n                                      the blank line between\n                                      rows.\n  ----------- ---------- ------------ ---------------------------\n"
  },
  {
    "path": "test/tables.markua",
    "content": "Simple table with caption:\n\n| Right | Left | Center | Default |\n|------:|:-----|:------:|---------|\n|    12 | 12   |   12   | 12      |\n|   123 | 123  |  123   | 123     |\n|     1 | 1    |   1    | 1       |\n\nDemonstration of simple table syntax.\n\nSimple table without caption:\n\n| Right | Left | Center | Default |\n|------:|:-----|:------:|---------|\n|    12 | 12   |   12   | 12      |\n|   123 | 123  |  123   | 123     |\n|     1 | 1    |   1    | 1       |\n\nSimple table indented two spaces:\n\n| Right | Left | Center | Default |\n|------:|:-----|:------:|---------|\n|    12 | 12   |   12   | 12      |\n|   123 | 123  |  123   | 123     |\n|     1 | 1    |   1    | 1       |\n\nDemonstration of simple table syntax.\n\nMultiline table with caption:\n\n| Centered Header | Left Aligned | Right Aligned | Default aligned |\n|:--:|:---|---:|:---|\n| First | row | 12.0 | Example of a row that spans multiple lines. |\n| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |\n\nHere’s the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n| Centered Header | Left Aligned | Right Aligned | Default aligned |\n|:--:|:---|---:|:---|\n| First | row | 12.0 | Example of a row that spans multiple lines. |\n| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |\n\nTable without column headers:\n\n|     |     |     |     |\n|----:|:----|:---:|----:|\n|  12 | 12  | 12  |  12 |\n| 123 | 123 | 123 | 123 |\n|   1 | 1   |  1  |   1 |\n\nMultiline table without column headers:\n\n|        |     |      |                                                       |\n|:------:|:----|-----:|-------------------------------------------------------|\n| First  | row | 12.0 | Example of a row that spans multiple lines.           |\n| Second | row |  5.0 | Here’s another one. Note the blank line between rows. |\n"
  },
  {
    "path": "test/tables.mediawiki",
    "content": "Simple table with caption:\n\n{| class=\"wikitable\"\n|+ Demonstration of simple table syntax.\n|-\n! style=\"text-align: right;\"| Right\n! style=\"text-align: left;\"| Left\n! style=\"text-align: center;\"| Center\n! Default\n|-\n| style=\"text-align: right;\"| 12\n| style=\"text-align: left;\"| 12\n| style=\"text-align: center;\"| 12\n| 12\n|-\n| style=\"text-align: right;\"| 123\n| style=\"text-align: left;\"| 123\n| style=\"text-align: center;\"| 123\n| 123\n|-\n| style=\"text-align: right;\"| 1\n| style=\"text-align: left;\"| 1\n| style=\"text-align: center;\"| 1\n| 1\n|}\n\nSimple table without caption:\n\n{| class=\"wikitable\"\n|-\n! style=\"text-align: right;\"| Right\n! style=\"text-align: left;\"| Left\n! style=\"text-align: center;\"| Center\n! Default\n|-\n| style=\"text-align: right;\"| 12\n| style=\"text-align: left;\"| 12\n| style=\"text-align: center;\"| 12\n| 12\n|-\n| style=\"text-align: right;\"| 123\n| style=\"text-align: left;\"| 123\n| style=\"text-align: center;\"| 123\n| 123\n|-\n| style=\"text-align: right;\"| 1\n| style=\"text-align: left;\"| 1\n| style=\"text-align: center;\"| 1\n| 1\n|}\n\nSimple table indented two spaces:\n\n{| class=\"wikitable\"\n|+ Demonstration of simple table syntax.\n|-\n! style=\"text-align: right;\"| Right\n! style=\"text-align: left;\"| Left\n! style=\"text-align: center;\"| Center\n! Default\n|-\n| style=\"text-align: right;\"| 12\n| style=\"text-align: left;\"| 12\n| style=\"text-align: center;\"| 12\n| 12\n|-\n| style=\"text-align: right;\"| 123\n| style=\"text-align: left;\"| 123\n| style=\"text-align: center;\"| 123\n| 123\n|-\n| style=\"text-align: right;\"| 1\n| style=\"text-align: left;\"| 1\n| style=\"text-align: center;\"| 1\n| 1\n|}\n\nMultiline table with caption:\n\n{| class=\"wikitable\"\n|+ Here’s the caption. It may span multiple lines.\n|-\n! style=\"text-align: center;\"| Centered Header\n! style=\"text-align: left;\"| Left Aligned\n! style=\"text-align: right;\"| Right Aligned\n! style=\"text-align: left;\"| Default aligned\n|-\n| style=\"text-align: center;\"| First\n| style=\"text-align: left;\"| row\n| style=\"text-align: right;\"| 12.0\n| style=\"text-align: left;\"| Example of a row that spans multiple lines.\n|-\n| style=\"text-align: center;\"| Second\n| style=\"text-align: left;\"| row\n| style=\"text-align: right;\"| 5.0\n| style=\"text-align: left;\"| Here’s another one. Note the blank line between rows.\n|}\n\nMultiline table without caption:\n\n{| class=\"wikitable\"\n|-\n! style=\"text-align: center;\"| Centered Header\n! style=\"text-align: left;\"| Left Aligned\n! style=\"text-align: right;\"| Right Aligned\n! style=\"text-align: left;\"| Default aligned\n|-\n| style=\"text-align: center;\"| First\n| style=\"text-align: left;\"| row\n| style=\"text-align: right;\"| 12.0\n| style=\"text-align: left;\"| Example of a row that spans multiple lines.\n|-\n| style=\"text-align: center;\"| Second\n| style=\"text-align: left;\"| row\n| style=\"text-align: right;\"| 5.0\n| style=\"text-align: left;\"| Here’s another one. Note the blank line between rows.\n|}\n\nTable without column headers:\n\n{| class=\"wikitable\"\n|-\n| style=\"text-align: right;\"| 12\n| style=\"text-align: left;\"| 12\n| style=\"text-align: center;\"| 12\n| style=\"text-align: right;\"| 12\n|-\n| style=\"text-align: right;\"| 123\n| style=\"text-align: left;\"| 123\n| style=\"text-align: center;\"| 123\n| style=\"text-align: right;\"| 123\n|-\n| style=\"text-align: right;\"| 1\n| style=\"text-align: left;\"| 1\n| style=\"text-align: center;\"| 1\n| style=\"text-align: right;\"| 1\n|}\n\nMultiline table without column headers:\n\n{| class=\"wikitable\"\n|-\n| style=\"text-align: center;\"| First\n| style=\"text-align: left;\"| row\n| style=\"text-align: right;\"| 12.0\n| Example of a row that spans multiple lines.\n|-\n| style=\"text-align: center;\"| Second\n| style=\"text-align: left;\"| row\n| style=\"text-align: right;\"| 5.0\n| Here’s another one. Note the blank line between rows.\n|}\n"
  },
  {
    "path": "test/tables.ms",
    "content": ".LP\nSimple table with caption:\n.PP\nDemonstration of simple table syntax.\n.na\n.TS\ndelim(@@) tab(\t);\nr l c l.\nT{\nRight\nT}\tT{\nLeft\nT}\tT{\nCenter\nT}\tT{\nDefault\nT}\n_\nT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\nT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\nT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\n.TE\n.ad\n.LP\nSimple table without caption:\n.PP\n.na\n.TS\ndelim(@@) tab(\t);\nr l c l.\nT{\nRight\nT}\tT{\nLeft\nT}\tT{\nCenter\nT}\tT{\nDefault\nT}\n_\nT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\nT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\nT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\n.TE\n.ad\n.LP\nSimple table indented two spaces:\n.PP\nDemonstration of simple table syntax.\n.na\n.TS\ndelim(@@) tab(\t);\nr l c l.\nT{\nRight\nT}\tT{\nLeft\nT}\tT{\nCenter\nT}\tT{\nDefault\nT}\n_\nT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\nT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\nT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\n.TE\n.ad\n.LP\nMultiline table with caption:\n.PP\nHere\\(cqs the caption. It may span multiple lines.\n.na\n.nr LLold \\n[LL]\n.TS\ndelim(@@) tab(\t);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\nCentered Header\nT}\tT{\nLeft Aligned\nT}\tT{\nRight Aligned\nT}\tT{\nDefault aligned\nT}\n_\nT{\n.nr LL 10.5n\nFirst\nT}\tT{\n.nr LL 9.6n\nrow\nT}\tT{\n.nr LL 11.4n\n12.0\nT}\tT{\n.nr LL 24.5n\nExample of a row that spans multiple lines.\nT}\nT{\n.nr LL 10.5n\nSecond\nT}\tT{\n.nr LL 9.6n\nrow\nT}\tT{\n.nr LL 11.4n\n5.0\nT}\tT{\n.nr LL 24.5n\nHere\\(cqs another one.\nNote the blank line between rows.\nT}\n.TE\n.nr LL \\n[LLold]\n.ad\n.LP\nMultiline table without caption:\n.PP\n.na\n.nr LLold \\n[LL]\n.TS\ndelim(@@) tab(\t);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\nCentered Header\nT}\tT{\nLeft Aligned\nT}\tT{\nRight Aligned\nT}\tT{\nDefault aligned\nT}\n_\nT{\n.nr LL 10.5n\nFirst\nT}\tT{\n.nr LL 9.6n\nrow\nT}\tT{\n.nr LL 11.4n\n12.0\nT}\tT{\n.nr LL 24.5n\nExample of a row that spans multiple lines.\nT}\nT{\n.nr LL 10.5n\nSecond\nT}\tT{\n.nr LL 9.6n\nrow\nT}\tT{\n.nr LL 11.4n\n5.0\nT}\tT{\n.nr LL 24.5n\nHere\\(cqs another one.\nNote the blank line between rows.\nT}\n.TE\n.nr LL \\n[LLold]\n.ad\n.LP\nTable without column headers:\n.PP\n.na\n.TS\ndelim(@@) tab(\t);\nr l c r.\nT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\tT{\n12\nT}\nT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\tT{\n123\nT}\nT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\tT{\n1\nT}\n.TE\n.ad\n.LP\nMultiline table without column headers:\n.PP\n.na\n.nr LLold \\n[LL]\n.TS\ndelim(@@) tab(\t);\ncw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).\nT{\n.nr LL 10.5n\nFirst\nT}\tT{\n.nr LL 9.6n\nrow\nT}\tT{\n.nr LL 11.4n\n12.0\nT}\tT{\n.nr LL 24.5n\nExample of a row that spans multiple lines.\nT}\nT{\n.nr LL 10.5n\nSecond\nT}\tT{\n.nr LL 9.6n\nrow\nT}\tT{\n.nr LL 11.4n\n5.0\nT}\tT{\n.nr LL 24.5n\nHere\\(cqs another one.\nNote the blank line between rows.\nT}\n.TE\n.nr LL \\n[LLold]\n.ad\n"
  },
  {
    "path": "test/tables.muse",
    "content": "Simple table with caption:\n\n Right || Left || Center || Default\n 12    |  12   |  12     |  12\n 123   |  123  |  123    |  123\n 1     |  1    |  1      |  1\n |+ Demonstration of simple table syntax. +|\n\nSimple table without caption:\n\n Right || Left || Center || Default\n 12    |  12   |  12     |  12\n 123   |  123  |  123    |  123\n 1     |  1    |  1      |  1\n\nSimple table indented two spaces:\n\n Right || Left || Center || Default\n 12    |  12   |  12     |  12\n 123   |  123  |  123    |  123\n 1     |  1    |  1      |  1\n |+ Demonstration of simple table syntax. +|\n\nMultiline table with caption:\n\n+:---------:+:---------+-----------:+:--------------------------+\n| Centered  | Left     | Right      | Default aligned           |\n| Header    | Aligned  | Aligned    |                           |\n+-----------+----------+------------+---------------------------+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\nMultiline table without caption:\n\n+:---------:+:---------+-----------:+:--------------------------+\n| Centered  | Left     | Right      | Default aligned           |\n| Header    | Aligned  | Aligned    |                           |\n+-----------+----------+------------+---------------------------+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\nTable without column headers:\n\n 12  | 12  | 12  | 12\n 123 | 123 | 123 | 123\n 1   | 1   | 1   | 1\n\nMultiline table without column headers:\n\n+:---------:+:---------+-----------:+---------------------------+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\n"
  },
  {
    "path": "test/tables.native",
    "content": "[ Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Demonstration\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"simple\"\n           , Space\n           , Str \"table\"\n           , Space\n           , Str \"syntax.\"\n           ]\n       ])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Simple\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"indented\"\n    , Space\n    , Str \"two\"\n    , Space\n    , Str \"spaces:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Demonstration\"\n           , Space\n           , Str \"of\"\n           , Space\n           , Str \"simple\"\n           , Space\n           , Str \"table\"\n           , Space\n           , Str \"syntax.\"\n           ]\n       ])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignDefault , ColWidthDefault )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Center\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Multiline\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"with\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption\n       Nothing\n       [ Plain\n           [ Str \"Here\\8217s\"\n           , Space\n           , Str \"the\"\n           , Space\n           , Str \"caption.\"\n           , SoftBreak\n           , Str \"It\"\n           , Space\n           , Str \"may\"\n           , Space\n           , Str \"span\"\n           , Space\n           , Str \"multiple\"\n           , Space\n           , Str \"lines.\"\n           ]\n       ])\n    [ ( AlignCenter , ColWidth 0.15 )\n    , ( AlignLeft , ColWidth 0.1375 )\n    , ( AlignRight , ColWidth 0.1625 )\n    , ( AlignLeft , ColWidth 0.35 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Centered\" , SoftBreak , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Example\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"row\"\n                    , Space\n                    , Str \"that\"\n                    , Space\n                    , Str \"spans\"\n                    , SoftBreak\n                    , Str \"multiple\"\n                    , Space\n                    , Str \"lines.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Here\\8217s\"\n                    , Space\n                    , Str \"another\"\n                    , Space\n                    , Str \"one.\"\n                    , Space\n                    , Str \"Note\"\n                    , SoftBreak\n                    , Str \"the\"\n                    , Space\n                    , Str \"blank\"\n                    , Space\n                    , Str \"line\"\n                    , Space\n                    , Str \"between\"\n                    , Space\n                    , Str \"rows.\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Multiline\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"caption:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidth 0.15 )\n    , ( AlignLeft , ColWidth 0.1375 )\n    , ( AlignRight , ColWidth 0.1625 )\n    , ( AlignLeft , ColWidth 0.35 )\n    ]\n    (TableHead\n       ( \"\" , [] , [] )\n       [ Row\n           ( \"\" , [] , [] )\n           [ Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Centered\" , SoftBreak , Str \"Header\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Left\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Right\" , SoftBreak , Str \"Aligned\" ] ]\n           , Cell\n               ( \"\" , [] , [] )\n               AlignDefault\n               (RowSpan 1)\n               (ColSpan 1)\n               [ Plain [ Str \"Default\" , Space , Str \"aligned\" ] ]\n           ]\n       ])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Example\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"row\"\n                    , Space\n                    , Str \"that\"\n                    , Space\n                    , Str \"spans\"\n                    , SoftBreak\n                    , Str \"multiple\"\n                    , Space\n                    , Str \"lines.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Here\\8217s\"\n                    , Space\n                    , Str \"another\"\n                    , Space\n                    , Str \"one.\"\n                    , Space\n                    , Str \"Note\"\n                    , SoftBreak\n                    , Str \"the\"\n                    , Space\n                    , Str \"blank\"\n                    , Space\n                    , Str \"line\"\n                    , Space\n                    , Str \"between\"\n                    , Space\n                    , Str \"rows.\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"column\"\n    , Space\n    , Str \"headers:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignRight , ColWidthDefault )\n    , ( AlignLeft , ColWidthDefault )\n    , ( AlignCenter , ColWidthDefault )\n    , ( AlignRight , ColWidthDefault )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"123\" ] ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"1\" ] ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n, Para\n    [ Str \"Multiline\"\n    , Space\n    , Str \"table\"\n    , Space\n    , Str \"without\"\n    , Space\n    , Str \"column\"\n    , Space\n    , Str \"headers:\"\n    ]\n, Table\n    ( \"\" , [] , [] )\n    (Caption Nothing [])\n    [ ( AlignCenter , ColWidth 0.15 )\n    , ( AlignLeft , ColWidth 0.1375 )\n    , ( AlignRight , ColWidth 0.1625 )\n    , ( AlignDefault , ColWidth 0.35 )\n    ]\n    (TableHead ( \"\" , [] , [] ) [])\n    [ TableBody\n        ( \"\" , [] , [] )\n        (RowHeadColumns 0)\n        []\n        [ Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"First\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"12.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Example\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Str \"a\"\n                    , Space\n                    , Str \"row\"\n                    , Space\n                    , Str \"that\"\n                    , Space\n                    , Str \"spans\"\n                    , SoftBreak\n                    , Str \"multiple\"\n                    , Space\n                    , Str \"lines.\"\n                    ]\n                ]\n            ]\n        , Row\n            ( \"\" , [] , [] )\n            [ Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"Second\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"row\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain [ Str \"5.0\" ] ]\n            , Cell\n                ( \"\" , [] , [] )\n                AlignDefault\n                (RowSpan 1)\n                (ColSpan 1)\n                [ Plain\n                    [ Str \"Here\\8217s\"\n                    , Space\n                    , Str \"another\"\n                    , Space\n                    , Str \"one.\"\n                    , Space\n                    , Str \"Note\"\n                    , SoftBreak\n                    , Str \"the\"\n                    , Space\n                    , Str \"blank\"\n                    , Space\n                    , Str \"line\"\n                    , Space\n                    , Str \"between\"\n                    , Space\n                    , Str \"rows.\"\n                    ]\n                ]\n            ]\n        ]\n    ]\n    (TableFoot ( \"\" , [] , [] ) [])\n]\n"
  },
  {
    "path": "test/tables.opendocument",
    "content": "<text:p text:style-name=\"Text_20_body\">Simple table with caption:</text:p>\n<text:p text:style-name=\"TableCaption\">Demonstration of simple table\nsyntax.</text:p>\n<table:table table:name=\"Table1\" table:style-name=\"Table1\">\n  <table:table-column table:style-name=\"Table1.A\" />\n  <table:table-column table:style-name=\"Table1.B\" />\n  <table:table-column table:style-name=\"Table1.C\" />\n  <table:table-column table:style-name=\"Table1.D\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P1\">Right</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P2\">Center</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Default</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P3\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P4\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P3\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P4\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P3\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P4\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"First_20_paragraph\">Simple table without\ncaption:</text:p>\n<table:table table:name=\"Table2\" table:style-name=\"Table2\">\n  <table:table-column table:style-name=\"Table2.A\" />\n  <table:table-column table:style-name=\"Table2.B\" />\n  <table:table-column table:style-name=\"Table2.C\" />\n  <table:table-column table:style-name=\"Table2.D\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P5\">Right</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P6\">Center</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Default</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P7\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P8\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P7\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P8\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P7\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P8\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"First_20_paragraph\">Simple table indented two\nspaces:</text:p>\n<text:p text:style-name=\"TableCaption\">Demonstration of simple table\nsyntax.</text:p>\n<table:table table:name=\"Table3\" table:style-name=\"Table3\">\n  <table:table-column table:style-name=\"Table3.A\" />\n  <table:table-column table:style-name=\"Table3.B\" />\n  <table:table-column table:style-name=\"Table3.C\" />\n  <table:table-column table:style-name=\"Table3.D\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P9\">Right</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P10\">Center</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Default</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P11\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P12\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P11\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P12\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P11\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P12\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"First_20_paragraph\">Multiline table with\ncaption:</text:p>\n<text:p text:style-name=\"TableCaption\">Here’s the caption. It may span multiple\nlines.</text:p>\n<table:table table:name=\"Table4\" table:style-name=\"Table4\">\n  <table:table-column table:style-name=\"Table4.A\" />\n  <table:table-column table:style-name=\"Table4.B\" />\n  <table:table-column table:style-name=\"Table4.C\" />\n  <table:table-column table:style-name=\"Table4.D\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P13\">Centered Header</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left Aligned</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P14\">Right Aligned</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Default aligned</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P15\">First</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">row</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P16\">12.0</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Example of a row that spans\n      multiple lines.</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P15\">Second</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">row</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P16\">5.0</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Here’s another one. Note the\n      blank line between rows.</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"First_20_paragraph\">Multiline table without\ncaption:</text:p>\n<table:table table:name=\"Table5\" table:style-name=\"Table5\">\n  <table:table-column table:style-name=\"Table5.A\" />\n  <table:table-column table:style-name=\"Table5.B\" />\n  <table:table-column table:style-name=\"Table5.C\" />\n  <table:table-column table:style-name=\"Table5.D\" />\n  <table:table-header-rows>\n    <table:table-row>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P17\">Centered Header</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Left Aligned</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"P18\">Right Aligned</text:p>\n      </table:table-cell>\n      <table:table-cell table:style-name=\"TableHeaderRowCell\" office:value-type=\"string\">\n        <text:p text:style-name=\"Table_20_Heading\">Default aligned</text:p>\n      </table:table-cell>\n    </table:table-row>\n  </table:table-header-rows>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P19\">First</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">row</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P20\">12.0</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Example of a row that spans\n      multiple lines.</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P19\">Second</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">row</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P20\">5.0</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Here’s another one. Note the\n      blank line between rows.</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"First_20_paragraph\">Table without column\nheaders:</text:p>\n<table:table table:name=\"Table6\" table:style-name=\"Table6\">\n  <table:table-column table:style-name=\"Table6.A\" />\n  <table:table-column table:style-name=\"Table6.B\" />\n  <table:table-column table:style-name=\"Table6.C\" />\n  <table:table-column table:style-name=\"Table6.D\" />\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P24\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P25\">12</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P26\">12</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P24\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P25\">123</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P26\">123</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P24\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P25\">1</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P26\">1</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n<text:p text:style-name=\"First_20_paragraph\">Multiline table without column\nheaders:</text:p>\n<table:table table:name=\"Table7\" table:style-name=\"Table7\">\n  <table:table-column table:style-name=\"Table7.A\" />\n  <table:table-column table:style-name=\"Table7.B\" />\n  <table:table-column table:style-name=\"Table7.C\" />\n  <table:table-column table:style-name=\"Table7.D\" />\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P29\">First</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">row</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P30\">12.0</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Example of a row that spans\n      multiple lines.</text:p>\n    </table:table-cell>\n  </table:table-row>\n  <table:table-row>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P29\">Second</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">row</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"P30\">5.0</text:p>\n    </table:table-cell>\n    <table:table-cell table:style-name=\"TableRowCell\" office:value-type=\"string\">\n      <text:p text:style-name=\"Table_20_Contents\">Here’s another one. Note the\n      blank line between rows.</text:p>\n    </table:table-cell>\n  </table:table-row>\n</table:table>\n"
  },
  {
    "path": "test/tables.org",
    "content": "Simple table with caption:\n\n| Right | Left | Center | Default |\n|-------+------+--------+---------|\n| 12    | 12   | 12     | 12      |\n| 123   | 123  | 123    | 123     |\n| 1     | 1    | 1      | 1       |\n#+caption: Demonstration of simple table syntax.\n\nSimple table without caption:\n\n| Right | Left | Center | Default |\n|-------+------+--------+---------|\n| 12    | 12   | 12     | 12      |\n| 123   | 123  | 123    | 123     |\n| 1     | 1    | 1      | 1       |\n\nSimple table indented two spaces:\n\n| Right | Left | Center | Default |\n|-------+------+--------+---------|\n| 12    | 12   | 12     | 12      |\n| 123   | 123  | 123    | 123     |\n| 1     | 1    | 1      | 1       |\n#+caption: Demonstration of simple table syntax.\n\nMultiline table with caption:\n\n| Centered Header | Left Aligned | Right Aligned | Default aligned                                       |\n|-----------------+--------------+---------------+-------------------------------------------------------|\n| First           | row          | 12.0          | Example of a row that spans multiple lines.           |\n| Second          | row          | 5.0           | Here's another one. Note the blank line between rows. |\n#+caption: Here's the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n| Centered Header | Left Aligned | Right Aligned | Default aligned                                       |\n|-----------------+--------------+---------------+-------------------------------------------------------|\n| First           | row          | 12.0          | Example of a row that spans multiple lines.           |\n| Second          | row          | 5.0           | Here's another one. Note the blank line between rows. |\n\nTable without column headers:\n\n| 12  | 12  | 12  | 12  |\n| 123 | 123 | 123 | 123 |\n| 1   | 1   | 1   | 1   |\n\nMultiline table without column headers:\n\n| First  | row | 12.0 | Example of a row that spans multiple lines.           |\n| Second | row | 5.0  | Here's another one. Note the blank line between rows. |\n"
  },
  {
    "path": "test/tables.plain",
    "content": "Simple table with caption:\n\n    Right Left    Center  Default\n  ------- ------ -------- ---------\n       12 12        12    12\n      123 123      123    123\n        1 1         1     1\n\n  : Demonstration of simple table syntax.\n\nSimple table without caption:\n\n    Right Left    Center  Default\n  ------- ------ -------- ---------\n       12 12        12    12\n      123 123      123    123\n        1 1         1     1\n\nSimple table indented two spaces:\n\n    Right Left    Center  Default\n  ------- ------ -------- ---------\n       12 12        12    12\n      123 123      123    123\n        1 1         1     1\n\n  : Demonstration of simple table syntax.\n\nMultiline table with caption:\n\n  ---------------------------------------------------------------\n   Centered   Left              Right Default aligned\n    Header    Aligned         Aligned \n  ----------- ---------- ------------ ---------------------------\n     First    row                12.0 Example of a row that spans\n                                      multiple lines.\n\n    Second    row                 5.0 Here’s another one. Note\n                                      the blank line between\n                                      rows.\n  ---------------------------------------------------------------\n\n  : Here’s the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n  ---------------------------------------------------------------\n   Centered   Left              Right Default aligned\n    Header    Aligned         Aligned \n  ----------- ---------- ------------ ---------------------------\n     First    row                12.0 Example of a row that spans\n                                      multiple lines.\n\n    Second    row                 5.0 Here’s another one. Note\n                                      the blank line between\n                                      rows.\n  ---------------------------------------------------------------\n\nTable without column headers:\n\n  ----- ----- ----- -----\n     12 12     12      12\n    123 123    123    123\n      1 1       1       1\n  ----- ----- ----- -----\n\nMultiline table without column headers:\n\n  ----------- ---------- ------------ ---------------------------\n     First    row                12.0 Example of a row that spans\n                                      multiple lines.\n\n    Second    row                 5.0 Here’s another one. Note\n                                      the blank line between\n                                      rows.\n  ----------- ---------- ------------ ---------------------------\n"
  },
  {
    "path": "test/tables.rst",
    "content": "Simple table with caption:\n\n.. table:: Demonstration of simple table syntax.\n\n   ===== ==== ====== =======\n   Right Left Center Default\n   ===== ==== ====== =======\n   12    12   12     12\n   123   123  123    123\n   1     1    1      1\n   ===== ==== ====== =======\n\nSimple table without caption:\n\n===== ==== ====== =======\nRight Left Center Default\n===== ==== ====== =======\n12    12   12     12\n123   123  123    123\n1     1    1      1\n===== ==== ====== =======\n\nSimple table indented two spaces:\n\n.. table:: Demonstration of simple table syntax.\n\n   ===== ==== ====== =======\n   Right Left Center Default\n   ===== ==== ====== =======\n   12    12   12     12\n   123   123  123    123\n   1     1    1      1\n   ===== ==== ====== =======\n\nMultiline table with caption:\n\n.. table:: Here’s the caption. It may span multiple lines.\n\n   +-----------+----------+------------+---------------------------+\n   | Centered  | Left     | Right      | Default aligned           |\n   | Header    | Aligned  | Aligned    |                           |\n   +===========+==========+============+===========================+\n   | First     | row      | 12.0       | Example of a row that     |\n   |           |          |            | spans multiple lines.     |\n   +-----------+----------+------------+---------------------------+\n   | Second    | row      | 5.0        | Here’s another one. Note  |\n   |           |          |            | the blank line between    |\n   |           |          |            | rows.                     |\n   +-----------+----------+------------+---------------------------+\n\nMultiline table without caption:\n\n+-----------+----------+------------+---------------------------+\n| Centered  | Left     | Right      | Default aligned           |\n| Header    | Aligned  | Aligned    |                           |\n+===========+==========+============+===========================+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\n\nTable without column headers:\n\n=== === === ===\n12  12  12  12\n123 123 123 123\n1   1   1   1\n=== === === ===\n\nMultiline table without column headers:\n\n+-----------+----------+------------+---------------------------+\n| First     | row      | 12.0       | Example of a row that     |\n|           |          |            | spans multiple lines.     |\n+-----------+----------+------------+---------------------------+\n| Second    | row      | 5.0        | Here’s another one. Note  |\n|           |          |            | the blank line between    |\n|           |          |            | rows.                     |\n+-----------+----------+------------+---------------------------+\n"
  },
  {
    "path": "test/tables.rtf",
    "content": "{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Simple table with caption:\\par}\n{\n\\trowd \\trgaph120\n\\clbrdrb\\brdrs\\cellx2160\\clbrdrb\\brdrs\\cellx4320\\clbrdrb\\brdrs\\cellx6480\\clbrdrb\\brdrs\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 Right\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Left\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Center\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Default\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Demonstration of simple table syntax.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Simple table without caption:\\par}\n{\n\\trowd \\trgaph120\n\\clbrdrb\\brdrs\\cellx2160\\clbrdrb\\brdrs\\cellx4320\\clbrdrb\\brdrs\\cellx6480\\clbrdrb\\brdrs\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 Right\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Left\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Center\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Default\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Simple table indented two spaces:\\par}\n{\n\\trowd \\trgaph120\n\\clbrdrb\\brdrs\\cellx2160\\clbrdrb\\brdrs\\cellx4320\\clbrdrb\\brdrs\\cellx6480\\clbrdrb\\brdrs\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 Right\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Left\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Center\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Default\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Demonstration of simple table syntax.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiline table with caption:\\par}\n{\n\\trowd \\trgaph120\n\\clbrdrb\\brdrs\\cellx1296\\clbrdrb\\brdrs\\cellx2484\\clbrdrb\\brdrs\\cellx3888\\clbrdrb\\brdrs\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Centered Header\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Left Aligned\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 Right Aligned\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Default aligned\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx1296\\cellx2484\\cellx3888\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 First\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 row\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12.0\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Example of a row that spans multiple lines.\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx1296\\cellx2484\\cellx3888\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Second\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 row\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 5.0\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Here\\u8217's another one. Note the blank line between rows.\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's the caption. It may span multiple lines.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiline table without caption:\\par}\n{\n\\trowd \\trgaph120\n\\clbrdrb\\brdrs\\cellx1296\\clbrdrb\\brdrs\\cellx2484\\clbrdrb\\brdrs\\cellx3888\\clbrdrb\\brdrs\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Centered Header\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Left Aligned\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 Right Aligned\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Default aligned\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx1296\\cellx2484\\cellx3888\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 First\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 row\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12.0\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Example of a row that spans multiple lines.\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx1296\\cellx2484\\cellx3888\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Second\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 row\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 5.0\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Here\\u8217's another one. Note the blank line between rows.\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Table without column headers:\\par}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 123\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx2160\\cellx4320\\cellx6480\\cellx8640\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 1\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiline table without column headers:\\par}\n{\n\\trowd \\trgaph120\n\\cellx1296\\cellx2484\\cellx3888\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 First\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 row\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 12.0\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Example of a row that spans multiple lines.\\par}\n\\cell}\n}\n\\intbl\\row}\n{\n\\trowd \\trgaph120\n\\cellx1296\\cellx2484\\cellx3888\\cellx6912\n\\trkeep\\intbl\n{\n{{\\pard\\intbl \\qc \\f0 \\sa0 \\li0 \\fi0 Second\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 row\\par}\n\\cell}\n{{\\pard\\intbl \\qr \\f0 \\sa0 \\li0 \\fi0 5.0\\par}\n\\cell}\n{{\\pard\\intbl \\ql \\f0 \\sa0 \\li0 \\fi0 Here\\u8217's another one. Note the blank line between rows.\\par}\n\\cell}\n}\n\\intbl\\row}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n"
  },
  {
    "path": "test/tables.tei",
    "content": "<p>Simple table with caption:</p>\n<table>\n  <row role=\"label\">\n    <cell><p>Right</p></cell>\n    <cell><p>Left</p></cell>\n    <cell><p>Center</p></cell>\n    <cell><p>Default</p></cell>\n  </row>\n  <row>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n  </row>\n  <row>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n  </row>\n  <row>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n  </row>\n</table>\n<p>Simple table without caption:</p>\n<table>\n  <row role=\"label\">\n    <cell><p>Right</p></cell>\n    <cell><p>Left</p></cell>\n    <cell><p>Center</p></cell>\n    <cell><p>Default</p></cell>\n  </row>\n  <row>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n  </row>\n  <row>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n  </row>\n  <row>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n  </row>\n</table>\n<p>Simple table indented two spaces:</p>\n<table>\n  <row role=\"label\">\n    <cell><p>Right</p></cell>\n    <cell><p>Left</p></cell>\n    <cell><p>Center</p></cell>\n    <cell><p>Default</p></cell>\n  </row>\n  <row>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n  </row>\n  <row>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n  </row>\n  <row>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n  </row>\n</table>\n<p>Multiline table with caption:</p>\n<table>\n  <row role=\"label\">\n    <cell><p>Centered Header</p></cell>\n    <cell><p>Left Aligned</p></cell>\n    <cell><p>Right Aligned</p></cell>\n    <cell><p>Default aligned</p></cell>\n  </row>\n  <row>\n    <cell><p>First</p></cell>\n    <cell><p>row</p></cell>\n    <cell><p>12.0</p></cell>\n    <cell><p>Example of a row that spans multiple lines.</p></cell>\n  </row>\n  <row>\n    <cell><p>Second</p></cell>\n    <cell><p>row</p></cell>\n    <cell><p>5.0</p></cell>\n    <cell><p>Here’s another one. Note the blank line between rows.</p></cell>\n  </row>\n</table>\n<p>Multiline table without caption:</p>\n<table>\n  <row role=\"label\">\n    <cell><p>Centered Header</p></cell>\n    <cell><p>Left Aligned</p></cell>\n    <cell><p>Right Aligned</p></cell>\n    <cell><p>Default aligned</p></cell>\n  </row>\n  <row>\n    <cell><p>First</p></cell>\n    <cell><p>row</p></cell>\n    <cell><p>12.0</p></cell>\n    <cell><p>Example of a row that spans multiple lines.</p></cell>\n  </row>\n  <row>\n    <cell><p>Second</p></cell>\n    <cell><p>row</p></cell>\n    <cell><p>5.0</p></cell>\n    <cell><p>Here’s another one. Note the blank line between rows.</p></cell>\n  </row>\n</table>\n<p>Table without column headers:</p>\n<table>\n  <row>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n    <cell><p>12</p></cell>\n  </row>\n  <row>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n    <cell><p>123</p></cell>\n  </row>\n  <row>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n    <cell><p>1</p></cell>\n  </row>\n</table>\n<p>Multiline table without column headers:</p>\n<table>\n  <row>\n    <cell><p>First</p></cell>\n    <cell><p>row</p></cell>\n    <cell><p>12.0</p></cell>\n    <cell><p>Example of a row that spans multiple lines.</p></cell>\n  </row>\n  <row>\n    <cell><p>Second</p></cell>\n    <cell><p>row</p></cell>\n    <cell><p>5.0</p></cell>\n    <cell><p>Here’s another one. Note the blank line between rows.</p></cell>\n  </row>\n</table>\n"
  },
  {
    "path": "test/tables.texinfo",
    "content": "@node Top\n@top Top\n\nSimple table with caption:\n\n@float Table\n@multitable {Right} {Left} {Center} {Default} \n@headitem \nRight\n @tab Left\n @tab Center\n @tab Default\n@item \n12\n @tab 12\n @tab 12\n @tab 12\n@item \n123\n @tab 123\n @tab 123\n @tab 123\n@item \n1\n @tab 1\n @tab 1\n @tab 1\n@end multitable\n@caption{Demonstration of simple table syntax.}\n@end float\nSimple table without caption:\n\n@multitable {Right} {Left} {Center} {Default} \n@headitem \nRight\n @tab Left\n @tab Center\n @tab Default\n@item \n12\n @tab 12\n @tab 12\n @tab 12\n@item \n123\n @tab 123\n @tab 123\n @tab 123\n@item \n1\n @tab 1\n @tab 1\n @tab 1\n@end multitable\n\nSimple table indented two spaces:\n\n@float Table\n@multitable {Right} {Left} {Center} {Default} \n@headitem \nRight\n @tab Left\n @tab Center\n @tab Default\n@item \n12\n @tab 12\n @tab 12\n @tab 12\n@item \n123\n @tab 123\n @tab 123\n @tab 123\n@item \n1\n @tab 1\n @tab 1\n @tab 1\n@end multitable\n@caption{Demonstration of simple table syntax.}\n@end float\nMultiline table with caption:\n\n@float Table\n@multitable @columnfractions 0.15 0.14 0.16 0.35 \n@headitem \nCentered Header\n @tab Left Aligned\n @tab Right Aligned\n @tab Default aligned\n@item \nFirst\n @tab row\n @tab 12.0\n @tab Example of a row that spans multiple lines.\n@item \nSecond\n @tab row\n @tab 5.0\n @tab Here's another one. Note the blank line between rows.\n@end multitable\n@caption{Here's the caption. It may span multiple lines.}\n@end float\nMultiline table without caption:\n\n@multitable @columnfractions 0.15 0.14 0.16 0.35 \n@headitem \nCentered Header\n @tab Left Aligned\n @tab Right Aligned\n @tab Default aligned\n@item \nFirst\n @tab row\n @tab 12.0\n @tab Example of a row that spans multiple lines.\n@item \nSecond\n @tab row\n @tab 5.0\n @tab Here's another one. Note the blank line between rows.\n@end multitable\n\nTable without column headers:\n\n@multitable {123} {123} {123} {123} \n@item \n12\n @tab 12\n @tab 12\n @tab 12\n@item \n123\n @tab 123\n @tab 123\n @tab 123\n@item \n1\n @tab 1\n @tab 1\n @tab 1\n@end multitable\n\nMultiline table without column headers:\n\n@multitable @columnfractions 0.15 0.14 0.16 0.35 \n@item \nFirst\n @tab row\n @tab 12.0\n @tab Example of a row that spans multiple lines.\n@item \nSecond\n @tab row\n @tab 5.0\n @tab Here's another one. Note the blank line between rows.\n@end multitable\n"
  },
  {
    "path": "test/tables.textile",
    "content": "Simple table with caption:\n\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th align=\"left\">Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"left\">12</td>\n</tr>\n<tr>\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"left\">123</td>\n</tr>\n<tr>\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"left\">1</td>\n</tr>\n</tbody>\n</table>\n\nSimple table without caption:\n\n|_. Right|_. Left|_. Center|_. Default|\n|>. 12|<. 12|=. 12|12|\n|>. 123|<. 123|=. 123|123|\n|>. 1|<. 1|=. 1|1|\n\nSimple table indented two spaces:\n\n<table>\n<caption>Demonstration of simple table syntax.</caption>\n<thead>\n<tr>\n<th align=\"right\">Right</th>\n<th align=\"left\">Left</th>\n<th align=\"center\">Center</th>\n<th align=\"left\">Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\">12</td>\n<td align=\"left\">12</td>\n<td align=\"center\">12</td>\n<td align=\"left\">12</td>\n</tr>\n<tr>\n<td align=\"right\">123</td>\n<td align=\"left\">123</td>\n<td align=\"center\">123</td>\n<td align=\"left\">123</td>\n</tr>\n<tr>\n<td align=\"right\">1</td>\n<td align=\"left\">1</td>\n<td align=\"center\">1</td>\n<td align=\"left\">1</td>\n</tr>\n</tbody>\n</table>\n\nMultiline table with caption:\n\n<table>\n<caption>Here's the caption. It may span multiple lines.</caption>\n<col width=\"15%\" />\n<col width=\"13%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n<thead>\n<tr>\n<th align=\"center\">Centered Header</th>\n<th align=\"left\">Left Aligned</th>\n<th align=\"right\">Right Aligned</th>\n<th align=\"left\">Default aligned</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here's another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n\nMultiline table without caption:\n\n<table>\n<col width=\"15%\" />\n<col width=\"13%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n<thead>\n<tr>\n<th align=\"center\">Centered Header</th>\n<th align=\"left\">Left Aligned</th>\n<th align=\"right\">Right Aligned</th>\n<th align=\"left\">Default aligned</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here's another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n\nTable without column headers:\n\n|>. 12|<. 12|=. 12|>. 12|\n|>. 123|<. 123|=. 123|>. 123|\n|>. 1|<. 1|=. 1|>. 1|\n\nMultiline table without column headers:\n\n<table>\n<col width=\"15%\" />\n<col width=\"13%\" />\n<col width=\"16%\" />\n<col width=\"35%\" />\n<tbody>\n<tr>\n<td align=\"center\">First</td>\n<td align=\"left\">row</td>\n<td align=\"right\">12.0</td>\n<td align=\"left\">Example of a row that spans multiple lines.</td>\n</tr>\n<tr>\n<td align=\"center\">Second</td>\n<td align=\"left\">row</td>\n<td align=\"right\">5.0</td>\n<td align=\"left\">Here's another one. Note the blank line between rows.</td>\n</tr>\n</tbody>\n</table>\n"
  },
  {
    "path": "test/tables.txt",
    "content": "Simple table with caption:\n\n  Right     Left     Center     Default   \n-------     ------ ----------   -------   \n     12     12        12            12    \n    123     123       123          123    \n      1     1          1             1    \n\nTable:  Demonstration of simple table syntax.\n\nSimple table without caption:\n\n  Right     Left     Center     Default   \n-------     ------ ----------   -------   \n     12     12        12            12    \n    123     123       123          123    \n      1     1          1             1    \n\nSimple table indented two spaces:\n\n    Right     Left     Center     Default   \n  -------     ------ ----------   -------   \n       12     12        12            12    \n      123     123       123          123    \n        1     1          1             1    \n\n  :  Demonstration of simple table syntax.\n\nMultiline table with caption:\n\n:  Here's the caption.\nIt may span multiple lines.\n\n---------------------------------------------------------------\n Centered   Left             Right\n  Header    Aligned        Aligned  Default aligned\n----------  ---------  -----------  ---------------------------\n   First    row               12.0  Example of a row that spans\n                                    multiple lines.\n\n   Second   row                5.0  Here's another one.  Note\n                                    the blank line between rows.\n---------------------------------------------------------------\n\nMultiline table without caption:\n\n---------------------------------------------------------------\n Centered   Left             Right\n  Header    Aligned        Aligned  Default aligned\n----------  ---------  -----------  ---------------------------\n   First    row               12.0  Example of a row that spans\n                                    multiple lines.\n\n   Second   row                5.0  Here's another one.  Note\n                                    the blank line between rows.\n---------------------------------------------------------------\n\nTable without column headers:\n\n-------     ------ ----------   -------\n     12     12        12             12\n    123     123       123           123\n      1     1          1              1\n-------     ------ ----------   -------\n\nMultiline table without column headers:\n\n----------  ---------  -----------  ---------------------------\n   First    row               12.0  Example of a row that spans\n                                    multiple lines.\n\n   Second   row                5.0  Here's another one.  Note\n                                    the blank line between rows.\n----------  ---------  -----------  ---------------------------\n"
  },
  {
    "path": "test/tables.typst",
    "content": "Simple table with caption:\n\n#figure(\n  align(center)[#table(\n    columns: 4,\n    align: (right,left,center,auto,),\n    table.header([Right], [Left], [Center], [Default],),\n    table.hline(),\n    [12], [12], [12], [12],\n    [123], [123], [123], [123],\n    [1], [1], [1], [1],\n  )]\n  , caption: [Demonstration of simple table syntax.]\n  , kind: table\n  )\n\nSimple table without caption:\n\n#figure(\n  align(center)[#table(\n    columns: 4,\n    align: (right,left,center,auto,),\n    table.header([Right], [Left], [Center], [Default],),\n    table.hline(),\n    [12], [12], [12], [12],\n    [123], [123], [123], [123],\n    [1], [1], [1], [1],\n  )]\n  , kind: table\n  )\n\nSimple table indented two spaces:\n\n#figure(\n  align(center)[#table(\n    columns: 4,\n    align: (right,left,center,auto,),\n    table.header([Right], [Left], [Center], [Default],),\n    table.hline(),\n    [12], [12], [12], [12],\n    [123], [123], [123], [123],\n    [1], [1], [1], [1],\n  )]\n  , caption: [Demonstration of simple table syntax.]\n  , kind: table\n  )\n\nMultiline table with caption:\n\n#figure(\n  align(center)[#table(\n    columns: (15%, 13.75%, 16.25%, 35%),\n    align: (center,left,right,left,),\n    table.header([Centered Header], [Left Aligned], [Right Aligned], [Default\n      aligned],),\n    table.hline(),\n    [First], [row], [12.0], [Example of a row that spans multiple lines.],\n    [Second], [row], [5.0], [Here's another one. Note the blank line between\n    rows.],\n  )]\n  , caption: [Here's the caption. It may span multiple lines.]\n  , kind: table\n  )\n\nMultiline table without caption:\n\n#figure(\n  align(center)[#table(\n    columns: (15%, 13.75%, 16.25%, 35%),\n    align: (center,left,right,left,),\n    table.header([Centered Header], [Left Aligned], [Right Aligned], [Default\n      aligned],),\n    table.hline(),\n    [First], [row], [12.0], [Example of a row that spans multiple lines.],\n    [Second], [row], [5.0], [Here's another one. Note the blank line between\n    rows.],\n  )]\n  , kind: table\n  )\n\nTable without column headers:\n\n#figure(\n  align(center)[#table(\n    columns: 4,\n    align: (right,left,center,right,),\n    [12], [12], [12], [12],\n    [123], [123], [123], [123],\n    [1], [1], [1], [1],\n  )]\n  , kind: table\n  )\n\nMultiline table without column headers:\n\n#figure(\n  align(center)[#table(\n    columns: (15%, 13.75%, 16.25%, 35%),\n    align: (center,left,right,auto,),\n    [First], [row], [12.0], [Example of a row that spans multiple lines.],\n    [Second], [row], [5.0], [Here's another one. Note the blank line between\n    rows.],\n  )]\n  , kind: table\n  )\n"
  },
  {
    "path": "test/tables.vimdoc",
    "content": "Simple table with caption:\n\n      Right Left    Center  Default ~\n         12 12        12    12\n        123 123      123    123\n          1 1         1     1\n\n    Demonstration of simple table syntax.\n\nSimple table without caption:\n\n      Right Left    Center  Default ~\n         12 12        12    12\n        123 123      123    123\n          1 1         1     1\n\nSimple table indented two spaces:\n\n      Right Left    Center  Default ~\n         12 12        12    12\n        123 123      123    123\n          1 1         1     1\n\n    Demonstration of simple table syntax.\n\nMultiline table with caption:\n\n     Centered  Left           Right Default aligned\n      Header   Aligned      Aligned  ~\n\n      First    row             12.0 Example of a row that\n                                    spans multiple lines.\n\n      Second   row              5.0 Here's another one.\n                                    Note the blank line\n                                    between rows.\n\n    Here's the caption. It may span multiple lines.\n\nMultiline table without caption:\n\n     Centered  Left           Right Default aligned\n      Header   Aligned      Aligned  ~\n\n      First    row             12.0 Example of a row that\n                                    spans multiple lines.\n\n      Second   row              5.0 Here's another one.\n                                    Note the blank line\n                                    between rows.\n\nTable without column headers:\n\n       12 12     12      12\n      123 123    123    123\n        1 1       1       1\n\nMultiline table without column headers:\n\n      First   row            12.0 Example of a row that\n                                  spans multiple lines.\n\n     Second   row             5.0 Here's another one.\n                                  Note the blank line\n                                  between rows.\n"
  },
  {
    "path": "test/tables.xwiki",
    "content": "Simple table with caption:\n\n|=Right |=Left |=Center |=Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n\nSimple table without caption:\n\n|=Right |=Left |=Center |=Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n\nSimple table indented two spaces:\n\n|=Right |=Left |=Center |=Default\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n\nMultiline table with caption:\n\n|=Centered Header |=Left Aligned |=Right Aligned |=Default aligned\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n\nMultiline table without caption:\n\n|=Centered Header |=Left Aligned |=Right Aligned |=Default aligned\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n\nTable without column headers:\n\n|= |= |= |=\n|12 |12 |12 |12\n|123 |123 |123 |123\n|1 |1 |1 |1\n\nMultiline table without column headers:\n\n|= |= |= |=\n|First |row |12.0 |Example of a row that spans multiple lines.\n|Second |row |5.0 |Here’s another one. Note the blank line between rows.\n"
  },
  {
    "path": "test/tables.zimwiki",
    "content": "Simple table with caption:\n\nDemonstration of simple table syntax.\n|Right|Left |Center |Default|\n|----:|:----|:-----:|-------|\n|   12|12   |  12   |12     |\n|  123|123  |  123  |123    |\n|    1|1    |   1   |1      |\n\nSimple table without caption:\n\n|Right|Left |Center |Default|\n|----:|:----|:-----:|-------|\n|   12|12   |  12   |12     |\n|  123|123  |  123  |123    |\n|    1|1    |   1   |1      |\n\nSimple table indented two spaces:\n\nDemonstration of simple table syntax.\n|Right|Left |Center |Default|\n|----:|:----|:-----:|-------|\n|   12|12   |  12   |12     |\n|  123|123  |  123  |123    |\n|    1|1    |   1   |1      |\n\nMultiline table with caption:\n\nHere’s the caption. It may span multiple lines.\n|Centered Header|Left Aligned|Right Aligned|Default aligned                                        |\n|:-------------:|:-----------|------------:|:------------------------------------------------------|\n|     First     |row         |         12.0|Example of a row that spans multiple lines.            |\n|    Second     |row         |          5.0|Here’s another one. Note the blank line between rows.  |\n\nMultiline table without caption:\n\n|Centered Header|Left Aligned|Right Aligned|Default aligned                                        |\n|:-------------:|:-----------|------------:|:------------------------------------------------------|\n|     First     |row         |         12.0|Example of a row that spans multiple lines.            |\n|    Second     |row         |          5.0|Here’s another one. Note the blank line between rows.  |\n\nTable without column headers:\n\n|   12|12   |  12   |   12|\n|----:|:----|:-----:|----:|\n|   12|12   |  12   |   12|\n|  123|123  |  123  |  123|\n|    1|1    |   1   |    1|\n\nMultiline table without column headers:\n\n|  First   |row  |  12.0|Example of a row that spans multiple lines.          |\n|:--------:|:----|-----:|-----------------------------------------------------|\n|  First   |row  |  12.0|Example of a row that spans multiple lines.          |\n|  Second  |row  |   5.0|Here’s another one. Note the blank line between rows.|\n"
  },
  {
    "path": "test/test-pandoc.hs",
    "content": "module Main (main) where\n\nimport System.Environment (getArgs, getExecutablePath)\nimport qualified Control.Exception as E\nimport Text.Pandoc.App (convertWithOpts, handleOptInfo, defaultOpts, options,\n                        parseOptionsFromArgs)\nimport Text.Pandoc.Error (handleError)\nimport Text.Pandoc.Scripting (noEngine)\nimport GHC.IO.Encoding\nimport Test.Tasty\nimport qualified Tests.Command\nimport qualified Tests.Old\nimport qualified Tests.Readers.Creole\nimport qualified Tests.Readers.Docx\nimport qualified Tests.Readers.Pptx\nimport qualified Tests.Readers.Xlsx\nimport qualified Tests.Readers.DokuWiki\nimport qualified Tests.Readers.EPUB\nimport qualified Tests.Readers.FB2\nimport qualified Tests.Readers.HTML\nimport qualified Tests.Readers.JATS\nimport qualified Tests.Readers.Jira\nimport qualified Tests.Readers.LaTeX\nimport qualified Tests.Readers.Markdown\nimport qualified Tests.Readers.Muse\nimport qualified Tests.Readers.ODT\nimport qualified Tests.Readers.Org\nimport qualified Tests.Readers.RST\nimport qualified Tests.Readers.RTF\nimport qualified Tests.Readers.Txt2Tags\nimport qualified Tests.Readers.Man\nimport qualified Tests.Readers.Mdoc\nimport qualified Tests.Readers.Pod\nimport qualified Tests.Shared\nimport qualified Tests.Writers.AsciiDoc\nimport qualified Tests.Writers.ConTeXt\nimport qualified Tests.Writers.DocBook\nimport qualified Tests.Writers.Docx\nimport qualified Tests.Writers.FB2\nimport qualified Tests.Writers.HTML\nimport qualified Tests.Writers.JATS\nimport qualified Tests.Writers.Jira\nimport qualified Tests.Writers.LaTeX\nimport qualified Tests.Writers.Markdown\nimport qualified Tests.Writers.Ms\nimport qualified Tests.Writers.Muse\nimport qualified Tests.Writers.Native\nimport qualified Tests.Writers.Org\nimport qualified Tests.Writers.Plain\nimport qualified Tests.Writers.Powerpoint\nimport qualified Tests.Writers.RST\nimport qualified Tests.Writers.AnnotatedTable\nimport qualified Tests.Writers.TEI\nimport qualified Tests.Writers.Markua\nimport qualified Tests.Writers.BBCode\nimport qualified Tests.XML\nimport qualified Tests.MediaBag\nimport Text.Pandoc.Shared (inDirectory)\n\ntests :: FilePath -> TestTree\ntests pandocPath = testGroup \"pandoc tests\"\n        [ Tests.Command.tests\n        , testGroup \"Old\" (Tests.Old.tests pandocPath)\n        , testGroup \"Shared\" Tests.Shared.tests\n        , testGroup \"MediaBag\" Tests.MediaBag.tests\n        , testGroup \"XML\" Tests.XML.tests\n        , testGroup \"Writers\"\n          [ testGroup \"Native\" Tests.Writers.Native.tests\n          , testGroup \"ConTeXt\" Tests.Writers.ConTeXt.tests\n          , testGroup \"LaTeX\" Tests.Writers.LaTeX.tests\n          , testGroup \"HTML\" Tests.Writers.HTML.tests\n          , testGroup \"JATS\" Tests.Writers.JATS.tests\n          , testGroup \"Jira\" Tests.Writers.Jira.tests\n          , testGroup \"Docbook\" Tests.Writers.DocBook.tests\n          , testGroup \"Markdown\" Tests.Writers.Markdown.tests\n          , testGroup \"Org\" Tests.Writers.Org.tests\n          , testGroup \"Plain\" Tests.Writers.Plain.tests\n          , testGroup \"AsciiDoc\" Tests.Writers.AsciiDoc.tests\n          , testGroup \"Docx\" Tests.Writers.Docx.tests\n          , testGroup \"RST\" Tests.Writers.RST.tests\n          , testGroup \"TEI\" Tests.Writers.TEI.tests\n          , testGroup \"markua\" Tests.Writers.Markua.tests\n          , testGroup \"Muse\" Tests.Writers.Muse.tests\n          , testGroup \"FB2\" Tests.Writers.FB2.tests\n          , testGroup \"PowerPoint\" Tests.Writers.Powerpoint.tests\n          , testGroup \"Ms\" Tests.Writers.Ms.tests\n          , testGroup \"AnnotatedTable\" Tests.Writers.AnnotatedTable.tests\n          , testGroup \"BBCode\" Tests.Writers.BBCode.tests\n          ]\n        , testGroup \"Readers\"\n          [ testGroup \"LaTeX\" Tests.Readers.LaTeX.tests\n          , testGroup \"Markdown\" Tests.Readers.Markdown.tests\n          , testGroup \"HTML\" Tests.Readers.HTML.tests\n          , testGroup \"JATS\" Tests.Readers.JATS.tests\n          , testGroup \"Jira\" Tests.Readers.Jira.tests\n          , testGroup \"Org\" Tests.Readers.Org.tests\n          , testGroup \"RST\" Tests.Readers.RST.tests\n          , testGroup \"RTF\" Tests.Readers.RTF.tests\n          , testGroup \"Docx\" Tests.Readers.Docx.tests\n          , testGroup \"Pptx\" Tests.Readers.Pptx.tests\n          , testGroup \"Xlsx\" Tests.Readers.Xlsx.tests\n          , testGroup \"ODT\" Tests.Readers.ODT.tests\n          , testGroup \"Txt2Tags\" Tests.Readers.Txt2Tags.tests\n          , testGroup \"EPUB\" Tests.Readers.EPUB.tests\n          , testGroup \"Muse\" Tests.Readers.Muse.tests\n          , testGroup \"Creole\" Tests.Readers.Creole.tests\n          , testGroup \"Man\" Tests.Readers.Man.tests\n          , testGroup \"Mdoc\" Tests.Readers.Mdoc.tests\n          , testGroup \"FB2\" Tests.Readers.FB2.tests\n          , testGroup \"DokuWiki\" Tests.Readers.DokuWiki.tests\n          , testGroup \"Pod\" Tests.Readers.Pod.tests\n          ]\n        ]\n\nmain :: IO ()\nmain = do\n  setLocaleEncoding utf8\n  args <- getArgs\n  case args of\n    \"--emulate\":args' -> -- emulate pandoc executable\n          E.catch\n            (do\n              res <- parseOptionsFromArgs options defaultOpts \"pandoc\" args'\n              case res of\n                Left e -> handleOptInfo noEngine e\n                Right opts -> convertWithOpts noEngine opts)\n            (handleError . Left)\n    _ -> inDirectory \"test\" $ do\n           fp <- getExecutablePath\n           -- putStrLn $ \"Using pandoc executable at \" ++ fp\n           defaultMain $ tests fp\n"
  },
  {
    "path": "test/testsuite.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n                , MetaInlines [ Str \"Anonymous\" ]\n                ]\n            )\n          , ( \"date\"\n            , MetaInlines\n                [ Str \"July\" , Space , Str \"17,\" , Space , Str \"2006\" ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\"\n                , Space\n                , Str \"Test\"\n                , Space\n                , Str \"Suite\"\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , SoftBreak\n      , Str \"John\"\n      , Space\n      , Str \"Gruber\\8217s\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"headers\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"level-4\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"level-5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1 ( \"level-1\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"level-2-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      3 ( \"level-3\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header\n      2 ( \"level-2\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , SoftBreak\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , SoftBreak\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , SoftBreak\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"break\"\n      , LineBreak\n      , Str \"here.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , SoftBreak\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , Para [ Str \"A\" , Space , Str \"list:\" ]\n      , OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Plain [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Plain [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quotes:\"\n          ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      , Space\n      , Str \"2\"\n      , SoftBreak\n      , Str \">\"\n      , Space\n      , Str \"1.\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , HorizontalRule\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second\" ] ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"One\" ] ]\n      , [ Plain [ Str \"Two\" ] ]\n      , [ Plain [ Str \"Three\" ] ]\n      ]\n  , Para\n      [ Str \"Loose\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"and\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog\\8217s\"\n            , SoftBreak\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Plain [ Str \"Tab\" ]\n        , BulletList\n            [ [ Plain [ Str \"Tab\" ]\n              , BulletList [ [ Plain [ Str \"Tab\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second:\" ]\n        , BulletList\n            [ [ Plain [ Str \"Fee\" ] ]\n            , [ Plain [ Str \"Fie\" ] ]\n            , [ Plain [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Same\"\n      , Space\n      , Str \"thing\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"paragraphs:\"\n      ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Plain [ Str \"Fee\" ] ]\n            , [ Plain [ Str \"Fie\" ] ]\n            , [ Plain [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"tabs-and-spaces\" , [] , [] )\n      [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , SoftBreak\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"tabs\"\n            ]\n        ]\n      , [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , SoftBreak\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            ]\n        , BulletList\n            [ [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , SoftBreak\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"tabs\"\n                  ]\n              ]\n            , [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , SoftBreak\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"spaces\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , OrderedList\n      ( 2 , Decimal , TwoParens )\n      [ [ Para\n            [ Str \"begins\" , Space , Str \"with\" , Space , Str \"2\" ]\n        ]\n      , [ Para [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n        , Para\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"continuation\"\n            ]\n        , OrderedList\n            ( 4 , LowerRoman , Period )\n            [ [ Plain\n                  [ Str \"sublist\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"roman\"\n                  , Space\n                  , Str \"numerals,\"\n                  , SoftBreak\n                  , Str \"starting\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"4\"\n                  ]\n              ]\n            , [ Plain [ Str \"more\" , Space , Str \"items\" ]\n              , OrderedList\n                  ( 1 , UpperAlpha , TwoParens )\n                  [ [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  , [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Nesting:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , Period )\n      [ [ Plain [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , Period )\n            [ [ Plain [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , TwoParens )\n                  [ [ Plain\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , OneParen )\n                        [ [ Plain\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"Autonumber.\" ] ]\n      , [ Plain [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"Should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item:\"\n      ]\n  , Para [ Str \"M.A.\\160\\&2007\" ]\n  , Para [ Str \"B.\" , Space , Str \"Williams\" ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"definition-lists\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"Lists\" ]\n  , Para\n      [ Str \"Tight\"\n      , Space\n      , Str \"using\"\n      , Space\n      , Str \"spaces:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Plain [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Tight\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Plain [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para [ Str \"Loose:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"italics:\"\n      ]\n  , DefinitionList\n      [ ( [ Emph [ Str \"apple\" ] ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n            , Para\n                [ Str \"contains\"\n                , Space\n                , Str \"seeds,\"\n                , SoftBreak\n                , Str \"crisp,\"\n                , Space\n                , Str \"pleasant\"\n                , Space\n                , Str \"to\"\n                , Space\n                , Str \"taste\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Emph [ Str \"orange\" ] ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , CodeBlock ( \"\" , [] , [] ) \"{ orange code block }\"\n            , BlockQuote\n                [ Para\n                    [ Str \"orange\"\n                    , Space\n                    , Str \"block\"\n                    , Space\n                    , Str \"quote\"\n                    ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"definitions,\"\n      , Space\n      , Str \"tight:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Plain [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ]\n          , [ Plain [ Str \"bank\" ] ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"definitions,\"\n      , Space\n      , Str \"loose:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"bank\" ] ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Blank\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"term,\"\n      , Space\n      , Str \"indented\"\n      , Space\n      , Str \"marker,\"\n      , Space\n      , Str \"alternate\"\n      , Space\n      , Str \"markers:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , OrderedList\n                ( 1 , Decimal , Period )\n                [ [ Plain [ Str \"sublist\" ] ]\n                , [ Plain [ Str \"sublist\" ] ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1\n      ( \"html-blocks\" , [] , [] )\n      [ Str \"HTML\" , Space , Str \"Blocks\" ]\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"line:\"\n      ]\n  , Div ( \"\" , [] , [] ) [ Plain [ Str \"foo\" ] ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"indentation:\"\n      ]\n  , Div\n      ( \"\" , [] , [] )\n      [ Div\n          ( \"\" , [] , [] )\n          [ Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ] ]\n      , Div ( \"\" , [] , [] ) [ Plain [ Str \"bar\" ] ]\n      ]\n  , Para\n      [ Str \"Interpreted\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"table:\"\n      ]\n  , RawBlock (Format \"html\") \"<table>\"\n  , RawBlock (Format \"html\") \"<tr>\"\n  , RawBlock (Format \"html\") \"<td>\"\n  , Plain\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      ]\n  , RawBlock (Format \"html\") \"</td>\"\n  , RawBlock (Format \"html\") \"<td>\"\n  , Plain\n      [ Str \"And\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      ]\n  , RawBlock (Format \"html\") \"</td>\"\n  , RawBlock (Format \"html\") \"</tr>\"\n  , RawBlock (Format \"html\") \"</table>\"\n  , RawBlock\n      (Format \"html\")\n      \"<script type=\\\"text/javascript\\\">document.write('This *should not* be interpreted as markdown');</script>\"\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"simple\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"code\"\n      , Space\n      , Str \"block,\"\n      , Space\n      , Str \"though:\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"<div>\\n    foo\\n</div>\"\n  , Para\n      [ Str \"As\" , Space , Str \"should\" , Space , Str \"this:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<div>foo</div>\"\n  , Para [ Str \"Now,\" , Space , Str \"nested:\" ]\n  , Div\n      ( \"\" , [] , [] )\n      [ Div\n          ( \"\" , [] , [] )\n          [ Div ( \"\" , [] , [] ) [ Plain [ Str \"foo\" ] ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"HTML\"\n      , Space\n      , Str \"comment:\"\n      ]\n  , RawBlock (Format \"html\") \"<!-- Comment -->\"\n  , Para [ Str \"Multiline:\" ]\n  , RawBlock (Format \"html\") \"<!--\\nBlah\\nBlah\\n-->\"\n  , RawBlock\n      (Format \"html\") \"<!--\\n    This is another comment.\\n-->\"\n  , Para [ Str \"Code\" , Space , Str \"block:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<!-- Comment -->\"\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"plain\"\n      , Space\n      , Str \"comment,\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"trailing\"\n      , Space\n      , Str \"spaces\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line:\"\n      ]\n  , RawBlock (Format \"html\") \"<!-- foo -->\"\n  , Para [ Str \"Code:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<hr />\"\n  , Para [ Str \"Hr\\8217s:\" ]\n  , RawBlock (Format \"html\") \"<hr>\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr>\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr class=\\\"foo\\\" id=\\\"bar\\\" />\"\n  , RawBlock (Format \"html\") \"<hr class=\\\"foo\\\" id=\\\"bar\\\" />\"\n  , RawBlock (Format \"html\") \"<hr class=\\\"foo\\\" id=\\\"bar\\\">\"\n  , HorizontalRule\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , Space , Str \"link\" ]\n              ( \"/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"strikeout\" ]\n          , Str \".\"\n          ]\n      ]\n  , Para\n      [ Str \"Superscripts:\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"bc\" ]\n      , Str \"d\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Emph [ Str \"hello\" ] ]\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"hello\\160there\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Subscripts:\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"2\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"23\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"many\\160of\\160them\" ]\n      , Str \"O.\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"superscripts\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"subscripts,\"\n      , SoftBreak\n      , Str \"because\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"unescaped\"\n      , Space\n      , Str \"spaces:\"\n      , Space\n      , Str \"a^b\"\n      , Space\n      , Str \"c^d,\"\n      , Space\n      , Str \"a~b\"\n      , Space\n      , Str \"c~d.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"smart-quotes-ellipses-dashes\" , [] , [] )\n      [ Str \"Smart\"\n      , Space\n      , Str \"quotes,\"\n      , Space\n      , Str \"ellipses,\"\n      , Space\n      , Str \"dashes\"\n      ]\n  , Para\n      [ Quoted DoubleQuote [ Str \"Hello,\" ]\n      , Space\n      , Str \"said\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"spider.\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Quoted SingleQuote [ Str \"Shelob\" ]\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"my\"\n          , Space\n          , Str \"name.\"\n          ]\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"A\" ]\n      , Str \",\"\n      , Space\n      , Quoted SingleQuote [ Str \"B\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted SingleQuote [ Str \"C\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"letters.\"\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"Oak,\" ]\n      , Space\n      , Quoted SingleQuote [ Str \"elm,\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted SingleQuote [ Str \"beech\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"names\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"trees.\"\n      , SoftBreak\n      , Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Quoted SingleQuote [ Str \"pine.\" ]\n      ]\n  , Para\n      [ Quoted\n          SingleQuote\n          [ Str \"He\"\n          , Space\n          , Str \"said,\"\n          , Space\n          , Quoted\n              DoubleQuote\n              [ Str \"I\"\n              , Space\n              , Str \"want\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"go.\"\n              ]\n          ]\n      , Space\n      , Str \"Were\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"alive\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"70\\8217s?\"\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"quoted\"\n      , Space\n      , Quoted SingleQuote [ Code ( \"\" , [] , [] ) \"code\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"quoted\" , Space , Str \"link\" ]\n              ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one\\8212two\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"three\\8212four\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"five.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"numbers:\"\n      , Space\n      , Str \"5\\8211\\&7,\"\n      , Space\n      , Str \"255\\8211\\&66,\"\n      , Space\n      , Str \"1987\\8211\\&1999.\"\n      ]\n  , Para [ Str \"Ellipses\\8230and\\8230and\\8230.\" ]\n  , HorizontalRule\n  , Header 1 ( \"latex\" , [] , [] ) [ Str \"LaTeX\" ]\n  , BulletList\n      [ [ Plain\n            [ RawInline (Format \"tex\") \"\\\\cite[22-23]{smith.1899}\" ]\n        ]\n      , [ Plain [ Math InlineMath \"2+2=4\" ] ]\n      , [ Plain [ Math InlineMath \"x \\\\in y\" ] ]\n      , [ Plain [ Math InlineMath \"\\\\alpha \\\\wedge \\\\omega\" ] ]\n      , [ Plain [ Math InlineMath \"223\" ] ]\n      , [ Plain [ Math InlineMath \"p\" , Str \"-Tree\" ] ]\n      , [ Plain\n            [ Str \"Here\\8217s\"\n            , Space\n            , Str \"some\"\n            , Space\n            , Str \"display\"\n            , Space\n            , Str \"math:\"\n            , SoftBreak\n            , Math\n                DisplayMath\n                \"\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to 0}\\\\frac{f(x+h)-f(x)}{h}\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Here\\8217s\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"that\"\n            , Space\n            , Str \"has\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"it:\"\n            , Space\n            , Math InlineMath \"\\\\alpha + \\\\omega \\\\times x^2\"\n            , Str \".\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"shouldn\\8217t\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"math:\"\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"To\"\n            , Space\n            , Str \"get\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"famous\"\n            , Space\n            , Str \"equation,\"\n            , Space\n            , Str \"write\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$e = mc^2$\"\n            , Str \".\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"$22,000\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Emph [ Str \"lot\" ]\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"money.\"\n            , Space\n            , Str \"So\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"$34,000.\"\n            , SoftBreak\n            , Str \"(It\"\n            , Space\n            , Str \"worked\"\n            , Space\n            , Str \"if\"\n            , Space\n            , Quoted DoubleQuote [ Str \"lot\" ]\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"emphasized.)\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Shoes\"\n            , Space\n            , Str \"($20)\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"socks\"\n            , Space\n            , Str \"($5).\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Escaped\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$\"\n            , Str \":\"\n            , Space\n            , Str \"$73\"\n            , Space\n            , Emph\n                [ Str \"this\"\n                , Space\n                , Str \"should\"\n                , Space\n                , Str \"be\"\n                , Space\n                , Str \"emphasized\"\n                ]\n            , Space\n            , Str \"23$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"LaTeX\"\n      , Space\n      , Str \"table:\"\n      ]\n  , RawBlock\n      (Format \"tex\")\n      \"\\\\begin{tabular}{|l|l|}\\\\hline\\nAnimal & Number \\\\\\\\ \\\\hline\\nDog    & 2      \\\\\\\\\\nCat    & 1      \\\\\\\\ \\\\hline\\n\\\\end{tabular}\"\n  , HorizontalRule\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ]\n        ]\n      , [ Plain\n            [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Plain [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Plain\n            [ Str \"set\"\n            , Space\n            , Str \"membership:\"\n            , Space\n            , Str \"\\8712\"\n            ]\n        ]\n      , [ Plain [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para\n      [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para\n      [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , HorizontalRule\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by two spaces\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by a tab\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with \\\"quotes\\\" in it\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with single quotes\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"with_underscore\" ]\n          ( \"/url/with_underscore\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Email\" , Space , Str \"link\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"reference\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"[not][]\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"[not]: /url\"\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"bar\" ]\n          ( \"/url/\" , \"Title with \\\"quotes\\\" inside\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"biz\" ]\n          ( \"/url/\" , \"Title with \\\"quote\\\" inside\" )\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"with-ampersands\" , [] , [] )\n      [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"AT&T\" ]\n          ( \"http://att.com/\" , \"AT&T\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\" , Space , Str \"link\" ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"pointy\"\n          , Space\n          , Str \"braces\"\n          ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , Space\n      , Link\n          ( \"\" , [ \"uri\" ] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ]\n        ]\n      , [ Plain\n            [ Link\n                ( \"\" , [ \"uri\" ] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Plain [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , Space\n      , Link\n          ( \"\" , [ \"email\" ] , [] )\n          [ Str \"nobody@nowhere.net\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , Space\n          , Link\n              ( \"\" , [ \"uri\" ] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Auto-links\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"occur\"\n      , Space\n      , Str \"here:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] ) \"or here: <http://example.com/>\"\n  , HorizontalRule\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"Voyage\"\n          , Space\n          , Str \"dans\"\n          , Space\n          , Str \"la\"\n          , Space\n          , Str \"Lune\"\n          ]\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"lalune\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] )\n              [ Str \"lalune\" ]\n              ( \"lalune.jpg\" , \"Voyage dans la Lune\" )\n          ]\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image\n          ( \"\" , [] , [] ) [ Str \"movie\" ] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Note\n          [ Para\n              [ Str \"Here\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"go\"\n              , Space\n              , Str \"anywhere\"\n              , Space\n              , Str \"after\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote\"\n              , SoftBreak\n              , Str \"reference.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"need\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"placed\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"end\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"document.\"\n              ]\n          ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"another.\"\n      , Note\n          [ Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"long\"\n              , Space\n              , Str \"note.\"\n              , Space\n              , Str \"This\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"contains\"\n              , Space\n              , Str \"multiple\"\n              , SoftBreak\n              , Str \"blocks.\"\n              ]\n          , Para\n              [ Str \"Subsequent\"\n              , Space\n              , Str \"blocks\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"indented\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"show\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"they\"\n              , Space\n              , Str \"belong\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"the\"\n              , SoftBreak\n              , Str \"footnote\"\n              , Space\n              , Str \"(as\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"list\"\n              , Space\n              , Str \"items).\"\n              ]\n          , CodeBlock ( \"\" , [] , [] ) \"  { <code> }\"\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"want,\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"every\"\n              , Space\n              , Str \"line,\"\n              , Space\n              , Str \"but\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"also\"\n              , Space\n              , Str \"be\"\n              , SoftBreak\n              , Str \"lazy\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"just\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"first\"\n              , Space\n              , Str \"line\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"each\"\n              , Space\n              , Str \"block.\"\n              ]\n          ]\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Emph [ Str \"not\" ]\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , SoftBreak\n      , Str \"contains\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"space.[^my\"\n      , Space\n      , Str \"note]\"\n      , Space\n      , Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"note.\"\n      , Note\n          [ Para\n              [ Str \"This\"\n              , SoftBreak\n              , Str \"is\"\n              , Space\n              , Emph [ Str \"easier\" ]\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"type.\"\n              , Space\n              , Str \"Inline\"\n              , Space\n              , Str \"notes\"\n              , Space\n              , Str \"may\"\n              , Space\n              , Str \"contain\"\n              , SoftBreak\n              , Link\n                  ( \"\" , [] , [] )\n                  [ Str \"links\" ]\n                  ( \"http://google.com\" , \"\" )\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"]\"\n              , Space\n              , Str \"verbatim\"\n              , Space\n              , Str \"characters,\"\n              , SoftBreak\n              , Str \"as\"\n              , Space\n              , Str \"well\"\n              , Space\n              , Str \"as\"\n              , Space\n              , Str \"[bracketed\"\n              , Space\n              , Str \"text].\"\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Notes\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"go\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"quotes.\"\n          , Note [ Para [ Str \"In\" , Space , Str \"quote.\" ] ]\n          ]\n      ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain\n            [ Str \"And\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items.\"\n            , Note [ Para [ Str \"In\" , Space , Str \"list.\" ] ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"part\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"note,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"indented.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/testsuite.txt",
    "content": "% Pandoc Test Suite\n% John MacFarlane; Anonymous\n% July 17, 2006\n\nThis is a set of tests for pandoc.  Most of them are adapted from\nJohn Gruber's markdown test suite.\n\n-----\n\n# Headers\n\n## Level 2 with an [embedded link](/url)\n\n### Level 3 with *emphasis*\n\n#### Level 4\n\n##### Level 5\n\nLevel 1\n=======\n\nLevel 2 with *emphasis*\n-----------------------\n\n### Level 3\nwith no blank line\n\nLevel 2\n-------\nwith no blank line\n\n----------\n\n# Paragraphs\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.\n\nHere's one with a bullet.\n* criminey.\n\nThere should be a hard line break  \nhere.\n\n---\n\n# Block Quotes\n\nE-mail style:\n\n> This is a block quote.\n> It is pretty short.\n\n> Code in a block quote: \n> \n>     sub status {\n>         print \"working\";\n>     }\n> \n> A list: \n> \n> 1. item one\n> 2. item two\n>\n> Nested block quotes:\n>\n> > nested\n>\n>>  nested\n>\n\nThis should not be a block quote: 2\n> 1.\n\nAnd a following paragraph.\n\n* * * *\n\n# Code Blocks\n\nCode:\n\n    ---- (should be four hyphens)\n\n    sub status {\n        print \"working\";\n    }\n\n\tthis code block is indented by one tab\n\nAnd:\n\n\t\tthis code block is indented by two tabs\n\n    These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\n___________\n\n# Lists\n\n## Unordered\n\nAsterisks tight:\n\n*\tasterisk 1\n*\tasterisk 2\n*\tasterisk 3\n\nAsterisks loose:\n\n*\tasterisk 1\n\n*\tasterisk 2\n\n*\tasterisk 3\n\nPluses tight:\n\n+\tPlus 1\n+\tPlus 2\n+\tPlus 3\n\nPluses loose:\n\n+\tPlus 1\n\n+\tPlus 2\n\n+\tPlus 3\n\nMinuses tight:\n\n-\tMinus 1\n-\tMinus 2\n-\tMinus 3\n\nMinuses loose:\n\n-\tMinus 1\n\n-\tMinus 2\n\n-\tMinus 3\n\n## Ordered\n\nTight:\n\n1.\tFirst\n2.\tSecond\n3.\tThird\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1.\tFirst\n\n2.\tSecond\n\n3.\tThird\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1.\tItem 1, graf one.\n\n\tItem 1. graf two. The quick brown fox jumped over the lazy dog's\n\tback.\n\t\n2.\tItem 2.\n\n3.\tItem 3.\n\n## Nested\n\n*\tTab\n\t*\tTab\n\t\t*\tTab\n\nHere's another:\n\n1. First\n2. Second:\n\t* Fee\n\t* Fie\n\t* Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n\t* Fee\n\t* Fie\n\t* Foe\n\n3. Third \n\n## Tabs and spaces\n\n+\tthis is a list item\n\tindented with tabs\n\n+   this is a list item\n    indented with spaces\n\n\t+\tthis is an example list item\n\t\tindented with tabs\n\t\n\t+   this is an example list item\n\t    indented with spaces\n\n## Fancy list markers\n\n(2) begins with 2\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals,\n        starting with 4\n    v.  more items\n        (A)  a subsublist\n        (B)  a subsublist\n\nNesting:\n\nA.  Upper Alpha\n    I.  Upper Roman.\n        (6) Decimal start with 6\n            c)  Lower alpha with paren\n\nAutonumbering:\n\n #.  Autonumber.\n #.  More.\n     #.  Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n  *   *   *   *   *\n\n# Definition Lists\n\nTight using spaces:\n\napple\n:   red fruit\n\norange\n:   orange fruit\n\nbanana\n:   yellow fruit\n\nTight using tabs:\n\napple\n:\tred fruit\n\norange\n:\torange fruit\n\nbanana\n:\tyellow fruit\n\nLoose:\n\napple\n\n:   red fruit\n\norange\n\n:   orange fruit\n\nbanana\n\n:   yellow fruit\n\nMultiple blocks with italics:\n\n*apple*\n\n:   red fruit\n\n    contains seeds,\n    crisp, pleasant to taste\n\n*orange*\n\n:   orange fruit\n\n        { orange code block }\n\n    > orange block quote\n\nMultiple definitions, tight:\n\napple\n:   red fruit\n:   computer\n\norange\n:   orange fruit\n:   bank\n\nMultiple definitions, loose:\n\napple\n\n:   red fruit\n\n:   computer\n\norange\n\n:   orange fruit\n\n:   bank\n\nBlank line after term, indented marker, alternate markers:\n\napple\n\n  ~ red fruit\n\n  ~ computer\n\norange\n\n  ~ orange fruit\n\n    1. sublist\n    2. sublist\n\n# HTML Blocks\n\nSimple block on one line:\n\n<div>foo</div>\n\nAnd nested without indentation:\n\n<div>\n<div>\n<div>\nfoo\n</div>\n</div>\n<div>bar</div>\n</div>\n\nInterpreted markdown in a table:\n\n<table>\n<tr>\n<td>This is *emphasized*</td>\n<td>And this is **strong**</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n\nHere's a simple block:\n\n<div>\nfoo\n</div>\n\nThis should be a code block, though:\n\n\t<div>\n\t\tfoo\n\t</div>\n\nAs should this:\n\n\t<div>foo</div>\n\nNow, nested:\n\n<div>\n <div>\n  <div>\n  foo\n  </div>\n </div>\n</div>\n\nThis should just be an HTML comment:\n\n<!-- Comment -->\n\nMultiline:\n\n<!--\nBlah\nBlah\n-->\n\n<!--\n\tThis is another comment.\n-->\n\nCode block:\n\n\t<!-- Comment -->\n\nJust plain comment, with trailing spaces on the line:\n\n<!-- foo -->   \n\nCode:\n\n\t<hr />\n\t\nHr's:\n\n<hr>\n\n<hr />\n\n<hr />\n\n<hr>   \n\n<hr />  \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n\n-----\n\n# Inline Markup\n\nThis is *emphasized*, and so _is this_.\n\nThis is **strong**, and so __is this__.\n\nAn *[emphasized link](/url)*.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\n___This is strong and em.___\n\nSo is ___this___ word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n~~This is *strikeout*.~~\n\nSuperscripts:  a^bc^d a^*hello*^ a^hello\\ there^.\n\nSubscripts: H~2~O, H~23~O, H~many\\ of\\ them~O.\n\nThese should not be superscripts or subscripts,\nbecause of the unescaped spaces:  a^b c^d, a~b c~d.\n\n-----\n\n# Smart quotes, ellipses, dashes\n\n\"Hello,\" said the spider.  \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees.\nSo is 'pine.'\n\n'He said, \"I want to go.\"'  Were you alive in the\n70's?\n\nHere is some quoted '`code`' and a \"[quoted link][1]\".\n\nSome dashes:  one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999. \n\nEllipses...and...and....\n\n-----\n\n# LaTeX\n\n- \\cite[22-23]{smith.1899}\n- $2+2=4$\n- $x \\in y$\n- $\\alpha \\wedge \\omega$\n- $223$ \n- $p$-Tree\n- Here's some display math:\n  $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n- Here's one that has a line break in it:  $\\alpha + \\omega \\times x^2$.  \n\nThese shouldn't be math:\n\n- To get the famous equation, write `$e = mc^2$`.\n- $22,000 is a *lot* of money.  So is $34,000.\n  (It worked if \"lot\" is emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped `$`:  $73 *this should be emphasized* 23\\$.\n\nHere's a LaTeX table:\n\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n\n* * * * *\n\n# Special Characters\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: § \n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&amp;T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: \\(\n\nRight paren: \\)\n\nGreater-than: \\>\n\nHash: \\#\n\nPeriod: \\.\n\nBang: \\!\n\nPlus: \\+\n\nMinus: \\-\n\n- - - - - - - - - - - - -\n\n# Links\n\n## Explicit\n\nJust a [URL](/url/).\n\n[URL and title](/url/ \"title\").\n\n[URL and title](/url/  \"title preceded by two spaces\").\n\n[URL and title](/url/\t\"title preceded by a tab\").\n\n[URL and title](/url/ \"title with \"quotes\" in it\")\n\n[URL and title](/url/ 'title with single quotes')\n\n[with\\_underscore](/url/with_underscore)\n\n[Email link](mailto:nobody@nowhere.net)\n\n[Empty]().\n\n## Reference\n\nFoo [bar][a].\n\n[a]: /url/\n\nWith [embedded [brackets]][b].\n\n[b] by itself should be a link.\n\nIndented [once][].\n\nIndented [twice][].\n\nIndented [thrice][].\n\nThis should [not][] be a link.\n\n [once]: /url\n  [twice]: /url\n\n   [thrice]: /url\n\n    [not]: /url\n\n[b]: /url/\n\nFoo [bar][].\n\nFoo [biz](/url/ \"Title with \"quote\" inside\").\n\n  [bar]: /url/ \"Title with \"quotes\" inside\"\n\n## With ampersands\n\nHere's a [link with an ampersand in the URL][1].\n\nHere's a link with an amersand in the link text: [AT&T][2].\n\nHere's an [inline link](/script?foo=1&bar=2).\n\nHere's an [inline link in pointy braces](</script?foo=1&bar=2>).\n\n[1]: http://example.com/?foo=1&bar=2\n[2]: http://att.com/  \"AT&T\" \n\n## Autolinks\n\nWith an ampersand: <http://example.com/?foo=1&bar=2>\n\n* In a list?\n* <http://example.com/>\n* It should.\n\nAn e-mail address:  <nobody@nowhere.net>\n\n> Blockquoted: <http://example.com/>\n\nAuto-links should not occur here: `<http://example.com/>`\n\n\tor here: <http://example.com/>\n\n----\n\n# Images\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n![lalune][]\n\n   [lalune]: lalune.jpg \"Voyage dans la Lune\"\n\nHere is a movie ![movie](movie.jpg) icon.\n\n----\n\n# Footnotes\n\nHere is a footnote reference,[^1] and another.[^longnote]\nThis should *not* be a footnote reference, because it \ncontains a space.[^my note]  Here is an inline note.^[This\nis *easier* to type.  Inline notes may contain\n[links](http://google.com) and `]` verbatim characters,\nas well as [bracketed text].]\n\n> Notes can go in quotes.^[In quote.]\n\n1.  And in list items.^[In list.]\n\n[^longnote]: Here's the long note.  This one contains multiple\nblocks.  \n\n    Subsequent blocks are indented to show that they belong to the\nfootnote (as with list items).\n\n          { <code> }\n\n    If you want, you can indent every line, but you can also be\n    lazy and just indent the first line of each block.\n\nThis paragraph should not be part of the note, as it is not indented.\n\n  [^1]: Here is the footnote.  It can go anywhere after the footnote\n  reference.  It need not be placed at the end of the document.\n"
  },
  {
    "path": "test/textile-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc\"\n      , Space\n      , Str \"Textile\"\n      , Space\n      , Str \"Reader.\"\n      , Space\n      , Str \"Part\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"comes\"\n      , LineBreak\n      , Str \"from\"\n      , Space\n      , Str \"John\"\n      , Space\n      , Str \"Gruber\\8217s\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"headers\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"http://www.example.com\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Strong [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"level-4\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"level-5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      6 ( \"level-6\" , [] , [] ) [ Str \"Level\" , Space , Str \"6\" ]\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"Line\"\n      , Space\n      , Str \"breaks\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"preserved\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"textile,\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"wrap\"\n      , Space\n      , Str \"your\"\n      , Space\n      , Str \"very\"\n      , LineBreak\n      , Str \"long\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"your\"\n      , Space\n      , Str \"favourite\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"editor\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"rendered\"\n      , LineBreak\n      , Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"break.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      ]\n  , BulletList [ [ Plain [ Str \"criminey.\" ] ] ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"break\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"here\"\n      ]\n  , Para [ Str \"and\" , Space , Str \"here.\" ]\n  , Para\n      [ Str \"pandoc\"\n      , Space\n      , Str \"converts\"\n      , Space\n      , Str \"textile.\"\n      ]\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"famous\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Str \"somebody.\"\n          , Space\n          , Str \"He\"\n          , Space\n          , Str \"had\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"lot\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"things\"\n          , Space\n          , Str \"to\"\n          , LineBreak\n          , Str \"say,\"\n          , Space\n          , Str \"so\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"text\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"really\"\n          , Space\n          , Str \"really\"\n          , Space\n          , Str \"long\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"spans\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"multiple\"\n          , Space\n          , Str \"lines.\"\n          ]\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    ---- (should be four hyphens)\\n\\n    sub status {\\n        print \\\"working\\\";\\n    }\\n\\n    this code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"        this code block is indented by two tabs\\n\\n    These should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"Code block with .bc\\n        continued\\n    @</\\\\\"\n  , CodeBlock\n      ( \"\" , [] , [] ) \"extended code block\\n\\n        continued\"\n  , Para\n      [ Str \"ended\" , Space , Str \"by\" , Space , Str \"paragraph\" ]\n  , Para\n      [ Str \"Inline\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<tt>\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"@\"\n      , Str \".\"\n      ]\n  , Header 1 ( \"notextile\" , [] , [] ) [ Str \"Notextile\" ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"protected\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"notextile\"\n      , Space\n      , Str \":\"\n      ]\n  , Para [ Str \"\\nNo *bold* and\\n* no bullet\\n\" ]\n  , Para\n      [ Str \"and\"\n      , Space\n      , Str \"inlines\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"protected\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"double *equals (=)* markup.\"\n      ]\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para\n      [ Str \"With\" , Space , Str \"line\" , Space , Str \"breaks:\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"asterisk\"\n            , Space\n            , Str \"1\"\n            , LineBreak\n            , Str \"newline\"\n            ]\n        ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second\" ] ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Plain [ Str \"ui\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Plain [ Str \"ui\" , Space , Str \"1.1\" ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"oi\" , Space , Str \"1.1.1\" ] ]\n                  , [ Plain [ Str \"oi\" , Space , Str \"1.1.2\" ] ]\n                  ]\n              ]\n            , [ Plain [ Str \"ui\" , Space , Str \"1.2\" ] ]\n            ]\n        ]\n      , [ Plain [ Str \"ui\" , Space , Str \"2\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain [ Str \"oi\" , Space , Str \"2.1\" ]\n              , BulletList\n                  [ [ Plain [ Str \"ui\" , Space , Str \"2.1.1\" ] ]\n                  , [ Plain [ Str \"ui\" , Space , Str \"2.1.2\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"issue-1500\" , [] , [] )\n      [ Str \"Issue\" , Space , Str \"#1500\" ]\n  , BulletList\n      [ [ Plain [ Str \"one\" ] ]\n      , [ Plain\n            [ Str \"two\"\n            , LineBreak\n            , Str \"->\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"more\"\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"issue-1513\" , [] , [] )\n      [ Str \"Issue\" , Space , Str \"#1513\" ]\n  , Para [ Str \"List:\" ]\n  , BulletList\n      [ [ Plain [ Str \"one\" ] ] , [ Plain [ Str \"two\" ] ] ]\n  , Header\n      2\n      ( \"definition-list\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"List\" ]\n  , DefinitionList\n      [ ( [ Str \"coffee\" ]\n        , [ [ Plain\n                [ Str \"Hot\" , Space , Str \"and\" , Space , Str \"black\" ]\n            ]\n          ]\n        )\n      , ( [ Str \"tea\" ]\n        , [ [ Plain\n                [ Str \"Also\"\n                , Space\n                , Str \"hot,\"\n                , Space\n                , Str \"but\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"little\"\n                , Space\n                , Str \"less\"\n                , Space\n                , Str \"black\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"milk\" ]\n        , [ [ Para\n                [ Str \"Nourishing\"\n                , Space\n                , Str \"beverage\"\n                , Space\n                , Str \"for\"\n                , Space\n                , Str \"baby\"\n                , Space\n                , Str \"cows.\"\n                ]\n            , Para\n                [ Str \"Cold\"\n                , Space\n                , Str \"drink\"\n                , Space\n                , Str \"that\"\n                , Space\n                , Str \"goes\"\n                , Space\n                , Str \"great\"\n                , Space\n                , Str \"with\"\n                , Space\n                , Str \"cookies.\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"beer\" ]\n        , [ [ Plain\n                [ Str \"fresh\"\n                , Space\n                , Str \"and\"\n                , Space\n                , Str \"bitter\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      , LineBreak\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      , LineBreak\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Underline [ Str \"inserted\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strikeout [ Str \"deleted\" ]\n      , Str \".\"\n      , LineBreak\n      , Str \"Hyphenated-words-are-ok,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"well\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"strange_underscore_notation.\"\n      , LineBreak\n      , Str \"A\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Strong [ Str \"strong\" , Space , Str \"link\" ] ]\n          ( \"http://www.foobar.com\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Emph\n          [ Strong\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      , LineBreak\n      , Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Emph [ Strong [ Str \"that\" , Space , Str \"one\" ] ]\n      , Str \".\"\n      , LineBreak\n      , Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"strikeout\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Strong [ Str \"strong\" ]\n          ]\n      ]\n  , Para\n      [ Str \"Superscripts:\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"bc\" ]\n      , Str \"d\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Superscript [ Strong [ Str \"hello\" ] ]\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"hello\" , Space , Str \"there\" ]\n      , Str \".\"\n      , LineBreak\n      , Str \"Subscripts:\"\n      , Space\n      , Subscript [ Str \"here\" ]\n      , Space\n      , Str \"H\"\n      , Space\n      , Subscript [ Str \"2\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Space\n      , Subscript [ Str \"23\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Space\n      , Subscript\n          [ Str \"many\" , Space , Str \"of\" , Space , Str \"them\" ]\n      , Str \"O.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \":\"\n      , Space\n      , Str \"How\"\n      , Space\n      , Str \"cool\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"automatic\"\n      , Space\n      , Str \"dashes.\"\n      ]\n  , Para\n      [ Str \"Ellipses\"\n      , Space\n      , Str \":\"\n      , Space\n      , Str \"He\"\n      , Space\n      , Str \"thought\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"thought\"\n      , Space\n      , Str \"\\8230\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"then\"\n      , Space\n      , Str \"thought\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"more.\"\n      ]\n  , Para\n      [ Str \"Quotes\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"apostrophes\"\n      , Space\n      , Str \":\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"I\\8217d\"\n          , Space\n          , Str \"like\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"thank\"\n          , Space\n          , Str \"you\"\n          ]\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"example.\"\n      ]\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"url\" ] ( \"http://www.url.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Email\" , Space , Str \"link\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , Para\n      [ Quoted\n          DoubleQuote\n          [ Str \"not\" , Space , Str \"a\" , Space , Str \"link\" ]\n      , Str \":\"\n      , Space\n      , Str \"foo\"\n      ]\n  , Para\n      [ Str \"Automatic\"\n      , Space\n      , Str \"linking\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.example.com\" ]\n          ( \"http://www.example.com\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Example\" ]\n          ( \"http://www.example.com/\" , \"\" )\n      , Str \":\"\n      , Space\n      , Str \"Example\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"followed\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"colon.\"\n      ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"link\"\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"with\" , Space , Str \"brackets\" ]\n          ( \"http://www.example.com\" , \"\" )\n      , Str \"and\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"spaces.\"\n      ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"link\" ] ( \"ftp://example.com\" , \"\" )\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"named\"\n      , Space\n      , Str \"target\"\n      ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"link\" ] ( \"missing\" , \"\" )\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"missing\"\n      , Space\n      , Str \"target\"\n      ]\n  , Header 1 ( \"tables\" , [] , [] ) [ Str \"Tables\" ]\n  , Para\n      [ Str \"Textile\"\n      , Space\n      , Str \"allows\"\n      , Space\n      , Str \"tables\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"headers\"\n      , Space\n      , Str \":\"\n      ]\n  , Header\n      2\n      ( \"without-headers\" , [] , [] )\n      [ Str \"Without\" , Space , Str \"headers\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"name\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"age\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"sex\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"joan\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"24\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"archie\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"29\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"m\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"bella\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"45\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"and\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"\\8230\"\n      ]\n  , Header\n      2\n      ( \"with-headers\" , [] , [] )\n      [ Str \"With\" , Space , Str \"headers\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"name\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"age\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"sex\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"joan\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"24\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"archie\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"29\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"m\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"bella\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"45\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"Textile\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"image\"\n      , Space\n      , Str \"syntax,\"\n      , Space\n      , Str \"like\"\n      , LineBreak\n      , Str \"here\"\n      , Space\n      , Image\n          ( \"\" , [] , [] )\n          [ Str \"this is the alt text\" ]\n          ( \"this_is_an_image.png\" , \"this is the alt text\" )\n      , LineBreak\n      , Str \"and\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Image\n          ( \"\" , [] , [] ) [ Str \"\" ] ( \"this_is_an_image.png\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 1 ( \"attributes\" , [] , [] ) [ Str \"Attributes\" ]\n  , Header\n      2\n      ( \"ident\"\n      , [ \"bar\" , \"foo\" ]\n      , [ ( \"style\" , \"color:red;\" ) , ( \"lang\" , \"en\" ) ]\n      )\n      [ Str \"HTML\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"CSS\"\n      , Space\n      , Str \"attributes\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"parsed\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"headers.\"\n      ]\n  , Header\n      2\n      ( \"centered\" , [] , [ ( \"style\" , \"text-align:center;\" ) ] )\n      [ Str \"Centered\" ]\n  , Header\n      2\n      ( \"right\" , [] , [ ( \"style\" , \"text-align:right;\" ) ] )\n      [ Str \"Right\" ]\n  , Header\n      2\n      ( \"justified\"\n      , []\n      , [ ( \"lang\" , \"en\" )\n        , ( \"style\" , \"color:blue;text-align:justify;\" )\n        ]\n      )\n      [ Str \"Justified\" ]\n  , Para\n      [ Str \"as\"\n      , Space\n      , Str \"well\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Strong\n          [ Span\n              ( \"\" , [ \"foo\" ] , [] )\n              [ Str \"inline\" , Space , Str \"attributes\" ]\n          ]\n      , Space\n      , Str \"of\"\n      , Space\n      , Span\n          ( \"\" , [] , [ ( \"style\" , \"color:red;\" ) ] )\n          [ Str \"all\" , Space , Str \"kind\" ]\n      ]\n  , Div\n      ( \"\" , [] , [ ( \"style\" , \"color:green;\" ) ] )\n      [ Para\n          [ Str \"and\"\n          , Space\n          , Str \"paragraph\"\n          , Space\n          , Str \"attributes,\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"table\"\n          , Space\n          , Str \"attributes.\"\n          ]\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"name\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"age\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"sex\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"joan\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"24\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Emph [ Str \"(class#id)\" , Space , Str \"emph\" ] ]\n  , Para\n      [ Emph\n          [ Str \"(no\" , Space , Str \"class#id)\" , Space , Str \"emph\" ]\n      ]\n  , Header 1 ( \"entities\" , [] , [] ) [ Str \"Entities\" ]\n  , Para [ Str \"*\" , LineBreak , Str \"&\" ]\n  , Header\n      1\n      ( \"raw-html\" , [] , [] )\n      [ Str \"Raw\" , Space , Str \"HTML\" ]\n  , Para\n      [ Str \"However,\"\n      , Space\n      , RawInline (Format \"html\") \"<strong>\"\n      , Space\n      , Str \"raw\"\n      , Space\n      , Str \"HTML\"\n      , Space\n      , Str \"inlines\"\n      , Space\n      , RawInline (Format \"html\") \"</strong>\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"accepted,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"well\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \":\"\n      ]\n  , RawBlock (Format \"html\") \"<div class=\\\"foobar\\\">\"\n  , Para\n      [ Str \"any\"\n      , Space\n      , Strong\n          [ Str \"Raw\" , Space , Str \"HTML\" , Space , Str \"Block\" ]\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"bold\"\n      ]\n  , RawBlock (Format \"html\") \"</div>\"\n  , Para\n      [ Str \"Html\" , Space , Str \"blocks\" , Space , Str \"can\" ]\n  , RawBlock (Format \"html\") \"<div>\"\n  , Para [ Str \"interrupt\" , Space , Str \"paragraphs\" ]\n  , RawBlock (Format \"html\") \"</div>\"\n  , Para [ Str \"as\" , Space , Str \"well.\" ]\n  , Para\n      [ Str \"Can\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"prove\"\n      , Space\n      , Str \"that\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"<\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"?\"\n      ]\n  , Header\n      1\n      ( \"acronyms-and-marks\" , [] , [] )\n      [ Str \"Acronyms\" , Space , Str \"and\" , Space , Str \"marks\" ]\n  , Para [ Str \"PBS (Public Broadcasting System)\" ]\n  , Para [ Str \"Hi\\8482\" ]\n  , Para [ Str \"Hi\" , Space , Str \"\\8482\" ]\n  , Para [ Str \"\\174\" , Space , Str \"Hi\\174\" ]\n  , Para\n      [ Str \"Hi\\169\\&2008\"\n      , Space\n      , Str \"\\169\"\n      , Space\n      , Str \"2008\"\n      ]\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"note.\"\n      , Note\n          [ Para\n              [ Str \"The\"\n              , Space\n              , Str \"note\"\n              , LineBreak\n              , Str \"is\"\n              , Space\n              , Str \"here!\"\n              ]\n          ]\n      , Space\n      , Str \"Another\"\n      , Space\n      , Str \"note\"\n      , Note [ Para [ Str \"Other\" , Space , Str \"note.\" ] ]\n      , Str \".\"\n      ]\n  , Header\n      1\n      ( \"comment-blocks\" , [] , [] )\n      [ Str \"Comment\" , Space , Str \"blocks\" ]\n  , Para\n      [ Str \"not\" , Space , Str \"a\" , Space , Str \"comment.\" ]\n  ]\n"
  },
  {
    "path": "test/textile-reader.textile",
    "content": "This is a set of tests for pandoc Textile Reader. Part of it comes\nfrom John Gruber's markdown test suite.\n\n-----\n\nh1. Headers\n\nh2. Level 2 with an \"embedded link\":http://www.example.com\n\nh3. Level 3 with *emphasis*\n\nh4. Level 4\n\nh5. Level 5\n\nh6. Level 6\n\n\nh1. Paragraphs\n\nHere's a regular paragraph.\n\nLine breaks are preserved in textile, so you can not wrap your very\nlong paragraph with your favourite text editor and have it rendered\nwith no break.\n\n\nHere's one with a bullet.\n\n* criminey.\n\nThere should be a paragraph break between here\n\nand here.\n\npandoc converts textile.\n\nh1. Block Quotes\n\nbq. This is a famous quote from somebody. He had a lot of things to\nsay, so the text is really really long and spans on multiple lines.\n\nAnd a following paragraph.\n\nh1. Code Blocks\n\nCode:\n\n<pre>\n    ---- (should be four hyphens)\n\n    sub status {\n        print \"working\";\n    }\n\n\tthis code block is indented by one tab\n</pre>\n\nAnd:\n\n<pre>\n\t\tthis code block is indented by two tabs\n\n    These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n</pre>\n\nbc. Code block with .bc\n        continued\n    @</\\\n\nbc.. extended code block\n\n        continued\np. ended by paragraph\n\nInline code: @<tt>@, <tt>@</tt>.\n\nh1. Notextile\n\nA block of text can be protected with notextile :\n\n<notextile>\nNo *bold* and\n* no bullet\n</notextile>\n\nand inlines can be protected with ==double *equals (=)* markup==.\n\nh1. Lists\n\nh2. Unordered\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nWith line breaks:\n\n* asterisk 1\nnewline\n* asterisk 2\n\nh2. Ordered\n\nTight:\n\n# First\n# Second\n# Third\n\nh2. Nested\n\n* ui 1\n** ui 1.1\n### oi 1.1.1\n### oi 1.1.2\n** ui 1.2\n* ui 2\n## oi 2.1\n*** ui 2.1.1\n*** ui 2.1.2\n\nh2. Issue #1500\n\n* one\n* two\n-> and more\n\nh2.  Issue #1513\n\nList:\n* one\n* two\n\nh2. Definition List\n\n- coffee := Hot and black\n- tea := Also hot, but a little less black\n- milk :=\nNourishing beverage for baby cows.\n\nCold drink that goes great with cookies.=:\n- beer := fresh and bitter\n\n\nh1. Inline Markup\n\nThis is _emphasized_, and so __is this__.\nThis is *strong*, and so **is this**.\nThis is +inserted+, and this is -deleted-.\nHyphenated-words-are-ok, as well as strange_underscore_notation.\nA \"*strong link*\":http://www.foobar.com.\n\n_*This is strong and em.*_\nSo is *_this_* word and __**that one**__.\n-This is strikeout and *strong*-\n\nSuperscripts: a[^bc^]d a ^*hello*^ a[^hello there^].\nSubscripts: ~here~ H[ ~2~]O, H[ ~23~]O, H[ ~many of them~]O.\n\nDashes : How cool -- automatic dashes.\n\nEllipses : He thought and thought ... and then thought some more.\n\nQuotes and apostrophes : \"I'd like to thank you\" for example.\n\n\nh1. Links\n\nh2. Explicit\n\nJust a \"url\":http://www.url.com\n\n\"Email link\":mailto:nobody@nowhere.net\n\n\"not a link\": foo\n\nAutomatic linking to \"$\":http://www.example.com.\n\n\"Example\":http://www.example.com/: Example of a link followed by a colon.\n\nA link[\"with brackets\":http://www.example.com]and no spaces.\n\nA \"link\":link-target to a named target\n\nA \"link\":missing to a missing target\n\nh1. Tables\n\nTextile allows tables with and without headers :\n\nh2. Without headers\n\n| name   | age | sex |\n| joan   | 24  | f   |\n| archie | 29  | m   |\n| bella  | 45  | f   |\n\nand some text following ...\n\nh2. With headers\n\n|_. name |_. age |_. sex |\n| joan   | 24    | f     |\n| archie | 29    | m     |\n| bella  | 45    | f     |\n\n\n\nh1. Images\n\nTextile inline image syntax, like\nhere !this_is_an_image.png(this is the alt text)!\nand here !this_is_an_image.png!.\n\nh1. Attributes\n\nh2[en]{color:red}(foo bar #ident). HTML and CSS attributes are parsed in headers.\n\nh2=. Centered\n\nh2>. Right\n\nh2<>{color:blue}[en]. Justified\n\nas well as *(foo)inline attributes* of %{color:red}all kind%\n\np{color:green}. and paragraph attributes, and table attributes.\n\ntable{foo:bar}.\n| name   | age | sex |\n| joan   | 24  | f   |\n\n_(class#id) emph_\n\n_(no class#id) emph_\n\nh1. Entities\n\n&#42;\n&amp;\n\nh1. Raw HTML\n\nHowever, <strong> raw HTML inlines </strong> are accepted, as well as :\n\n<div class=\"foobar\">\n  any *Raw HTML Block* with bold\n</div>\n\nHtml blocks can <div>interrupt paragraphs</div> as well.\n\nCan you prove that 2 < 3 ?\n\nh1. Acronyms and marks\n\nPBS(Public Broadcasting System)\n\nHi(tm)\n\nHi (TM)\n\n(r) Hi(r)\n\nHi(c)2008 (C) 2008\n\nh1. Footnotes\n\nA note.[1]  Another note[2].\n\nfn1. The note\nis here!\n\nfn2^. Other note.\n\nh1. Comment blocks\n\n###. my comment\nis here.\n\nnot a comment.\n\n[link-target]ftp://example.com\n"
  },
  {
    "path": "test/tikiwiki-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header 1 ( \"header\" , [] , [] ) [ Str \"header\" ]\n  , Header\n      2\n      ( \"header-level-two\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"two\" ]\n  , Header\n      3\n      ( \"header-level-3\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"header-_level_-four\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Str \"_level_\"\n      , Space\n      , Str \"four\"\n      ]\n  , Header\n      5\n      ( \"header-level-5\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"5\" ]\n  , Header\n      6\n      ( \"header-level-6\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"6\" ]\n  , Para\n      [ Str \"!!!!!!!\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      ]\n  , Para\n      [ Str \"--++\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      ]\n  , Header\n      1\n      ( \"emph-and-strong\" , [] , [] )\n      [ Str \"emph\" , Space , Str \"and\" , Space , Str \"strong\" ]\n  , Para\n      [ Emph [ Str \"emph\" ] , Space , Strong [ Str \"strong\" ] ]\n  , Para\n      [ Emph\n          [ Strong\n              [ Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"emph\"\n              , Space\n              , Str \"1\"\n              ]\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"emph\"\n              , Space\n              , Str \"2\"\n              ]\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Emph [ Str \"emph\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"strong\"\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Str \"strong\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Emph [ Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Emph\n          [ Strong [ Str \"strong\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"emph\"\n          ]\n      ]\n  , Header\n      1\n      ( \"other-inlines\" , [] , [] )\n      [ Str \"other\" , Space , Str \"inlines\" ]\n  , Para\n      [ Underline [ Str \"underlined\" , Space , Str \"text\" ] ]\n  , Para [ Strikeout [ Str \"strikeout\" ] ]\n  , Header\n      1\n      ( \"horizontal-rule\" , [] , [] )\n      [ Str \"horizontal\" , Space , Str \"rule\" ]\n  , Para [ Str \"top\" ]\n  , HorizontalRule\n  , Para [ Str \"bottom\" ]\n  , HorizontalRule\n  , Header 1 ( \"nop\" , [] , [] ) [ Str \"nop\" ]\n  , Para [ Str \"__not emph__\" ]\n  , Header 1 ( \"entities\" , [] , [] ) [ Str \"entities\" ]\n  , Para [ Str \"hi\" , Space , Str \"&\" , Space , Str \"low\" ]\n  , Para [ Str \"hi\" , Space , Str \"&\" , Space , Str \"low\" ]\n  , Para [ Str \"G\\246del\" ]\n  , Para [ Str \"\\777\\2730\" ]\n  , Header 1 ( \"linebreaks\" , [] , [] ) [ Str \"linebreaks\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Header\n      1\n      ( \"inline-code\" , [] , [] )\n      [ Str \"inline\" , Space , Str \"code\" ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"*\\8594*\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"typed\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">>=\"\n      ]\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"code\" , Space , Str \"blocks\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"\\ncase xs of\\n     (_:_) -> reverse xs\\n     []    -> ['*']\\n\"\n  , CodeBlock\n      ( \"\"\n      , [ \"haskell\" ]\n      , [ ( \"colors\" , \"haskell\" ) , ( \"ln\" , \"0\" ) ]\n      )\n      \"\\ncase xs of\\n     (_:_) -> reverse xs\\n     []    -> ['*']\\n\"\n  , Header\n      1\n      ( \"external-links\" , [] , [] )\n      [ Str \"external\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Emph [ Str \"Google\" ]\n          , Space\n          , Str \"search\"\n          , Space\n          , Str \"engine\"\n          ]\n          ( \"http://google.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://pandoc.org\" ]\n          ( \"http://pandoc.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://google.com\" ]\n          ( \"http://google.com\" , \"\" )\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://yahoo.com\" ]\n          ( \"http://yahoo.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"email\" , Space , Str \"me\" ]\n          ( \"mailto:info@example.org\" , \"\" )\n      ]\n  , Para [ Str \"http://google.com\" ]\n  , Para [ Str \"info@example.org\" ]\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"lists\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Start\" , Space , Str \"each\" , Space , Str \"line\" ]\n        ]\n      , [ Plain\n            [ Str \"with\"\n            , Space\n            , Str \"an\"\n            , Space\n            , Str \"asterisk\"\n            , Space\n            , Str \"(*).\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"More\"\n                  , Space\n                  , Str \"asterisks\"\n                  , Space\n                  , Str \"gives\"\n                  , Space\n                  , Str \"deeper\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"and\"\n                        , Space\n                        , Str \"deeper\"\n                        , Space\n                        , Str \"levels.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Line\"\n            , Space\n            , Str \"breaks\"\n            , LineBreak\n            , Str \"don't\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"levels.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Continuations\"\n            , Space\n            , Str \"are\"\n            , Space\n            , Str \"also\"\n            , Space\n            , Str \"possible\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"and\"\n                  , Space\n                  , Str \"do\"\n                  , Space\n                  , Str \"not\"\n                  , Space\n                  , Str \"break\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"flow\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"Level\" , Space , Str \"one\" ] ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"list.\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Start\" , Space , Str \"each\" , Space , Str \"line\" ]\n        ]\n      , [ Plain\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"number\"\n            , Space\n            , Str \"(1.).\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"More\"\n                  , Space\n                  , Str \"number\"\n                  , Space\n                  , Str \"signs\"\n                  , Space\n                  , Str \"gives\"\n                  , Space\n                  , Str \"deeper\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"and\" , Space , Str \"deeper\" ] ]\n                  , [ Plain [ Str \"levels.\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Line\"\n            , Space\n            , Str \"breaks\"\n            , LineBreak\n            , Str \"don't\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"levels.\"\n            ]\n        ]\n      , [ Plain [ Str \"Blank\" , Space , Str \"lines\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"end\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"start\"\n            , Space\n            , Str \"another.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"list.\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"item\" , Space , Str \"1\" ]\n        , [ [ Plain [ Str \"definition\" , Space , Str \"1\" ] ] ]\n        )\n      , ( [ Str \"item\" , Space , Str \"2\" ]\n        , [ [ Plain\n                [ Str \"definition\"\n                , Space\n                , Str \"2-1\"\n                , Space\n                , Str \"definition\"\n                , Space\n                , Str \"2-2\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"item\" , Space , Emph [ Str \"3\" ] ]\n        , [ [ Plain [ Str \"definition\" , Space , Emph [ Str \"3\" ] ]\n            ]\n          ]\n        )\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"one\" ] ]\n      , [ Plain [ Str \"two\" ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"two\"\n                  , Space\n                  , Str \"point\"\n                  , Space\n                  , Str \"one\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"two\"\n                  , Space\n                  , Str \"point\"\n                  , Space\n                  , Str \"two\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"three\" ] ]\n      , [ Plain [ Str \"four\" ] ]\n      , [ Plain [ Str \"five\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"five\" , Space , Str \"sub\" , Space , Str \"1\" ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain\n                        [ Str \"five\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"1\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"1\"\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"five\" , Space , Str \"sub\" , Space , Str \"2\" ]\n              ]\n            ]\n        ]\n      ]\n  , Header 1 ( \"tables\" , [] , [] ) [ Str \"tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Apple\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Pie\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Apple\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Pie\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Strong [ Str \"Butter\" ] ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Apple\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Bread\"\n                      , LineBreak\n                      , LineBreak\n                      , Str \"and\"\n                      , Space\n                      , Str \"cheese\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Pie\"\n                      , LineBreak\n                      , LineBreak\n                      , Strong [ Str \"apple\" ]\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Emph [ Str \"carrot\" ]\n                      , Space\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"Orange\" , Space ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"Apple\" , Space ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"more\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"Bread\" , Space ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"Pie\" , Space ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"more\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Space , Str \"Butter\" , Space ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Space\n                      , Str \"Ice\"\n                      , Space\n                      , Str \"cream\"\n                      , Space\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Space , Str \"and\" , Space , Str \"more\" , Space ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  ]\n"
  },
  {
    "path": "test/tikiwiki-reader.tikiwiki",
    "content": "! header\n\n!! header level two\n\n!!! header level 3\n\n!!!! header _level_ four\n\n!!!!! header level 5\n\n!!!!!! header level 6\n\n!!!!!!! not a header\n\n --++ not a header\n\n! emph and strong\n\n''emph'' __strong__\n\n''__strong and emph 1__''\n\n__''strong and emph 2''__\n\n__''emph inside'' strong__\n\n__strong with ''emph''__\n\n''__strong inside__ emph''\n\n! other inlines\n\n===underlined text===\n\n--strikeout--\n\n! horizontal rule\n\ntop\n----\nbottom\n\n----\n\n! nop\n\n~np~__not emph__~/np~\n\n! entities\n\nhi & low\n\nhi &amp; low\n\nG&ouml;del\n\n&#777;&#xAAA;\n\n! linebreaks\n\nhi%%%there\n\nhi%%%\nthere\n\n! inline code\n\n-+*→*+- -+typed+- -+>>=+-\n\n! code blocks\n\n{CODE()}\ncase xs of\n     (_:_) -> reverse xs\n     []    -> ['*']\n{CODE}\n\n{CODE(colors=\"haskell\" ln=0)}\ncase xs of\n     (_:_) -> reverse xs\n     []    -> ['*']\n{CODE}\n\n! external links\n\n[http://google.com|''Google'' search engine]\n\n[http://pandoc.org]\n\n[http://google.com] [http://yahoo.com]\n\n[mailto:info@example.org|email me]\n\nhttp://google.com\n\ninfo@example.org\n\n! lists\n\n* Start each line\n* with an asterisk (*).\n** More asterisks gives deeper\n*** and deeper levels.\n* Line breaks%%%don't break levels.\n* Continuations\n+ are also possible\n** and do not break the list flow\n* Level one\nAny other start ends the list.\n\n# Start each line\n# with a number (1.).\n## More number signs gives deeper\n### and deeper\n### levels.\n# Line breaks%%%don't break levels.\n# Blank lines\n\n# end the list and start another.\nAny other start also\nends the list.\n\n;item 1: definition 1\n;item 2: definition 2-1\n+ definition 2-2\n;item ''3'': definition ''3''\n\n# one\n# two\n** two point one\n** two point two\n# three\n# four\n# five\n## five sub 1\n### five sub 1 sub 1\n## five sub 2\n\n! tables\n\n||Orange|Apple\nBread|Pie\nButter|Ice cream||\n\n||Orange|Apple\nBread|Pie\n__Butter__|Ice cream||\n\n||Orange|Apple\nBread%%%%%%and cheese|Pie%%%%%%__apple__ and ''carrot'' ||\n\n|| Orange | Apple     | more\n Bread  | Pie       | more\n Butter | Ice cream | and more ||\n"
  },
  {
    "path": "test/twiki-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header 1 ( \"header\" , [] , [] ) [ Str \"header\" ]\n  , Header\n      2\n      ( \"header-level-two\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"two\" ]\n  , Header\n      3\n      ( \"header-level-3\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"header-level-four\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Emph [ Str \"level\" ]\n      , Space\n      , Str \"four\"\n      ]\n  , Header\n      5\n      ( \"header-level-5\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"5\" ]\n  , Header\n      6\n      ( \"header-level-6\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"6\" ]\n  , Para\n      [ Str \"---+++++++\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      ]\n  , Para\n      [ Str \"--++\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      ]\n  , Header\n      1\n      ( \"emph-and-strong\" , [] , [] )\n      [ Str \"emph\" , Space , Str \"and\" , Space , Str \"strong\" ]\n  , Para\n      [ Emph [ Str \"emph\" ] , Space , Strong [ Str \"strong\" ] ]\n  , Para\n      [ Emph\n          [ Strong\n              [ Str \"strong\" , Space , Str \"and\" , Space , Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Emph [ Str \"emph\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"strong\"\n          ]\n      ]\n  , Para\n      [ Strong\n          [ Str \"strong\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Emph [ Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Emph\n          [ Strong [ Str \"strong\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"emph\"\n          ]\n      ]\n  , Header\n      1\n      ( \"horizontal-rule\" , [] , [] )\n      [ Str \"horizontal\" , Space , Str \"rule\" ]\n  , Para [ Str \"top\" ]\n  , HorizontalRule\n  , Para [ Str \"bottom\" ]\n  , HorizontalRule\n  , Header 1 ( \"nop\" , [] , [] ) [ Str \"nop\" ]\n  , Para [ Str \"_not\" , Space , Str \"emph_\" ]\n  , Header 1 ( \"entities\" , [] , [] ) [ Str \"entities\" ]\n  , Para [ Str \"hi\" , Space , Str \"&\" , Space , Str \"low\" ]\n  , Para [ Str \"hi\" , Space , Str \"&\" , Space , Str \"low\" ]\n  , Para [ Str \"G\\246del\" ]\n  , Para [ Str \"\\777\\2730\" ]\n  , Header 1 ( \"comments\" , [] , [] ) [ Str \"comments\" ]\n  , Para [ Str \"inline\" , Space , Str \"comment\" ]\n  , Para [ Str \"between\" , Space , Str \"blocks\" ]\n  , Header 1 ( \"linebreaks\" , [] , [] ) [ Str \"linebreaks\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Para [ Str \"hi\" , LineBreak , Str \"there\" ]\n  , Header\n      1\n      ( \"inline-code\" , [] , [] )\n      [ Str \"inline\" , Space , Str \"code\" ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"*\\8594*\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"typed\"\n      , Space\n      , Code ( \"\" , [ \"haskell\" ] , [] ) \">>=\"\n      ]\n  , Header\n      1\n      ( \"code-blocks\" , [] , [] )\n      [ Str \"code\" , Space , Str \"blocks\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"case xs of\\n     (_:_) -> reverse xs\\n     []    -> ['*']\"\n  , CodeBlock\n      ( \"\" , [ \"haskell\" ] , [] )\n      \"case xs of\\n     (_:_) -> reverse xs\\n     []    -> ['*']\"\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"block\" , Space , Str \"quotes\" ]\n  , Para [ Str \"Regular\" , Space , Str \"paragraph\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          ]\n      , Para\n          [ Str \"With\"\n          , Space\n          , Str \"two\"\n          , Space\n          , Str \"paragraphs.\"\n          ]\n      ]\n  , Para [ Str \"Nother\" , Space , Str \"paragraph.\" ]\n  , Header\n      1\n      ( \"internal-links\" , [] , [] )\n      [ Str \"internal\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"MySimplePage\" ]\n          ( \"MySimplePage\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"My23Page23\" ]\n          ( \"My23Page23\" , \"\" )\n      ]\n  , Header\n      1\n      ( \"external-links\" , [] , [] )\n      [ Str \"external\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Emph [ Str \"Google\" ]\n          , Space\n          , Str \"search\"\n          , Space\n          , Str \"engine\"\n          ]\n          ( \"http://google.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://pandoc.org\" ]\n          ( \"http://pandoc.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://google.com\" ]\n          ( \"http://google.com\" , \"\" )\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://yahoo.com\" ]\n          ( \"http://yahoo.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"email\" , Space , Str \"me\" ]\n          ( \"mailto:info@example.org\" , \"\" )\n      ]\n  , Para [ Str \"http://google.com\" ]\n  , Para [ Str \"http://google.com\" ]\n  , Para [ Str \"http://google.com\" ]\n  , Para [ Str \"info@example.org\" ]\n  , Para [ Str \"info@example.org\" ]\n  , Para [ Str \"info@example.org\" ]\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"lists\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Start\" , Space , Str \"each\" , Space , Str \"line\" ]\n        ]\n      , [ Plain\n            [ Str \"with\"\n            , Space\n            , Str \"an\"\n            , Space\n            , Str \"asterisk\"\n            , Space\n            , Str \"(*).\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"More\"\n                  , Space\n                  , Str \"asterisks\"\n                  , Space\n                  , Str \"gives\"\n                  , Space\n                  , Str \"deeper\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"and\"\n                        , Space\n                        , Str \"deeper\"\n                        , Space\n                        , Str \"levels.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Line\"\n            , Space\n            , Str \"breaks\"\n            , LineBreak\n            , Str \"don't\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"levels.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Continuations\"\n            , Space\n            , Str \"are\"\n            , Space\n            , Str \"also\"\n            , Space\n            , Str \"possible\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"and\"\n                  , Space\n                  , Str \"do\"\n                  , Space\n                  , Str \"not\"\n                  , Space\n                  , Str \"break\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"flow\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"Level\" , Space , Str \"one\" ] ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"list.\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Start\" , Space , Str \"each\" , Space , Str \"line\" ]\n        ]\n      , [ Plain\n            [ Str \"with\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"number\"\n            , Space\n            , Str \"(1.).\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"More\"\n                  , Space\n                  , Str \"number\"\n                  , Space\n                  , Str \"signs\"\n                  , Space\n                  , Str \"gives\"\n                  , Space\n                  , Str \"deeper\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain [ Str \"and\" , Space , Str \"deeper\" ] ]\n                  , [ Plain [ Str \"levels.\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Line\"\n            , Space\n            , Str \"breaks\"\n            , LineBreak\n            , Str \"don't\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"levels.\"\n            ]\n        ]\n      , [ Plain [ Str \"Blank\" , Space , Str \"lines\" ] ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"end\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"start\"\n            , Space\n            , Str \"another.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"start\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"list.\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"item\" , Space , Str \"1\" ]\n        , [ [ Plain [ Str \"definition\" , Space , Str \"1\" ] ] ]\n        )\n      , ( [ Str \"item\" , Space , Str \"2\" ]\n        , [ [ Plain\n                [ Str \"definition\"\n                , Space\n                , Str \"2-1\"\n                , Space\n                , Str \"definition\"\n                , Space\n                , Str \"2-2\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"item\" , Space , Emph [ Str \"3\" ] ]\n        , [ [ Plain [ Str \"definition\" , Space , Emph [ Str \"3\" ] ]\n            ]\n          ]\n        )\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"one\" ] ]\n      , [ Plain [ Str \"two\" ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"two\"\n                  , Space\n                  , Str \"point\"\n                  , Space\n                  , Str \"one\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"two\"\n                  , Space\n                  , Str \"point\"\n                  , Space\n                  , Str \"two\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"three\" ]\n        , DefinitionList\n            [ ( [ Str \"three\" , Space , Str \"item\" , Space , Str \"one\" ]\n              , [ [ Plain\n                      [ Str \"three\"\n                      , Space\n                      , Str \"def\"\n                      , Space\n                      , Str \"one\"\n                      ]\n                  ]\n                ]\n              )\n            ]\n        ]\n      , [ Plain [ Str \"four\" ]\n        , DefinitionList\n            [ ( [ Str \"four\" , Space , Str \"def\" , Space , Str \"one\" ]\n              , [ [ Plain\n                      [ Str \"this\"\n                      , Space\n                      , Str \"is\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"continuation\"\n                      ]\n                  ]\n                ]\n              )\n            ]\n        ]\n      , [ Plain [ Str \"five\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"five\" , Space , Str \"sub\" , Space , Str \"1\" ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain\n                        [ Str \"five\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"1\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"1\"\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"five\" , Space , Str \"sub\" , Space , Str \"2\" ]\n              ]\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"other\" ]\n        , OrderedList\n            ( 1 , UpperRoman , DefaultDelim )\n            [ [ Plain [ Str \"list\" ] ] , [ Plain [ Str \"styles\" ] ] ]\n        ]\n      , [ Plain [ Str \"are\" ]\n        , OrderedList\n            ( 1 , LowerRoman , DefaultDelim )\n            [ [ Plain [ Str \"also\" ] ] , [ Plain [ Str \"possible\" ] ] ]\n        ]\n      , [ Plain [ Str \"all\" ]\n        , OrderedList\n            ( 1 , LowerAlpha , DefaultDelim )\n            [ [ Plain [ Str \"the\" ] ]\n            , [ Plain [ Str \"different\" ] ]\n            , [ Plain [ Str \"styles\" ] ]\n            ]\n        ]\n      , [ Plain [ Str \"are\" ]\n        , OrderedList\n            ( 1 , UpperAlpha , DefaultDelim )\n            [ [ Plain [ Str \"implemented\" ] ]\n            , [ Plain [ Str \"and\" ] ]\n            , [ Plain [ Str \"supported\" ] ]\n            ]\n        ]\n      ]\n  , Header 1 ( \"tables\" , [] , [] ) [ Str \"tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Apple\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Pie\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignLeft , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Orange\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Apple\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Pie\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Strong [ Str \"Butter\" ] ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignLeft , ColWidthDefault )\n      , ( AlignLeft , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Orange\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Apple\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Bread\"\n                      , LineBreak\n                      , LineBreak\n                      , Str \"and\"\n                      , Space\n                      , Str \"cheese\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Pie\"\n                      , LineBreak\n                      , LineBreak\n                      , Strong [ Str \"apple\" ]\n                      , Space\n                      , Str \"and\"\n                      , Space\n                      , Emph [ Str \"carrot\" ]\n                      ]\n                  ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Orange\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Apple\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"more\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Bread\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Pie\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"more\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Butter\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Ice\" , Space , Str \"cream\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"and\" , Space , Str \"more\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 1 ( \"macros\" , [] , [] ) [ Str \"macros\" ]\n  , Para [ Span ( \"\" , [ \"twiki-macro\" , \"TEST\" ] , [] ) [] ]\n  , Para\n      [ Span ( \"\" , [ \"twiki-macro\" , \"TEST\" ] , [] ) [ Str \"\" ] ]\n  , Para\n      [ Span\n          ( \"\" , [ \"twiki-macro\" , \"TEST\" ] , [] )\n          [ Str \"content with spaces\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\" , [ \"twiki-macro\" , \"TEST\" ] , [] )\n          [ Str \"content with spaces\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\"\n          , [ \"twiki-macro\" , \"TEST\" ]\n          , [ ( \"ARG1\" , \"test\" ) ]\n          )\n          [ Str \"content with spaces\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\" , [ \"twiki-macro\" , \"TEST\" ] , [] )\n          [ Str \"content with spaces ARG1=test\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\"\n          , [ \"twiki-macro\" , \"TEST\" ]\n          , [ ( \"ARG1\" , \"test\" ) ]\n          )\n          [ Str \"content with spaces\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\"\n          , [ \"twiki-macro\" , \"TEST\" ]\n          , [ ( \"ARG1\" , \"test\" ) , ( \"ARG2\" , \"test2\" ) ]\n          )\n          [ Str \"\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\"\n          , [ \"twiki-macro\" , \"TEST\" ]\n          , [ ( \"ARG1\" , \"test\" ) , ( \"ARG2\" , \"test2\" ) ]\n          )\n          [ Str \"\" ]\n      ]\n  , Para\n      [ Span\n          ( \"\"\n          , [ \"twiki-macro\" , \"TEST\" ]\n          , [ ( \"ARG1\" , \"test\" ) , ( \"ARG2\" , \"test2\" ) ]\n          )\n          [ Str \"multiline\\ndoes also work\" ]\n      ]\n  ]\n"
  },
  {
    "path": "test/twiki-reader.twiki",
    "content": "---+ header\n\n---++ header level two\n\n---+++ header level 3\n\n---++++ header _level_ four\n\n---+++++ header level 5\n\n---++++++ header level 6\n\n---+++++++ not a header\n\n --++ not a header\n\n---+ emph and strong\n\n_emph_ *strong*\n\n__strong and emph__\n\n*<i>emph inside</i> strong*\n\n*strong with <i>emph</i>*\n\n_<b>strong inside</b> emph_\n\n---+ horizontal rule\n\ntop\n---\nbottom\n\n---\n\n---+ nop\n\n<nop>_not emph_\n\n---+ entities\n\nhi & low\n\nhi &amp; low\n\nG&ouml;del\n\n&#777;&#xAAA;\n\n---+ comments\n\ninline <!-- secret --> comment\n\n<!-- secret -->\n\nbetween blocks\n\n <!-- secret -->\n\n---+ linebreaks\n\nhi%BR%there\n\nhi%BR%\nthere\n\n---+ inline code\n\n<code>*→*</code> =typed= <code class=\"haskell\">>>=</code>\n\n---+ code blocks\n\n<verbatim>\ncase xs of\n     (_:_) -> reverse xs\n     []    -> ['*']\n</verbatim>\n\n<verbatim class=\"haskell\">\ncase xs of\n     (_:_) -> reverse xs\n     []    -> ['*']\n</verbatim>\n\n---+ block quotes\n\nRegular paragraph\n<blockquote>\nThis is a block quote.\n\nWith two paragraphs.\n</blockquote>\nNother paragraph.\n\n---+ internal links\n\nMySimplePage\n\nMy23Page23\n\n---+ external links\n\n[[http://google.com][<i>Google</i> search engine]]\n\nhttp://pandoc.org\n\n[[http://google.com]] [[http://yahoo.com]]\n\n[[mailto:info@example.org][email me]]\n\n!http://google.com\n\n<nop>http://google.com\n\n<noautolink>\nhttp://google.com\n</noautolink>\n\n!info@example.org\n\n<nop>info@example.org\n\n<noautolink>\ninfo@example.org\n</noautolink>\n\n---+ lists\n\n   * Start each line\n   * with an asterisk (*).\n      * More asterisks gives deeper\n         * and deeper levels.\n   * Line breaks%BR%don't break levels.\n   * Continuations\n     are also possible\n      * and do not break the list flow\n   * Level one\nAny other start ends the list.\n\n   1. Start each line\n   1. with a number (1.).\n      1. More number signs gives deeper\n         1. and deeper\n         1. levels.\n   1. Line breaks%BR%don't break levels.\n   1. Blank lines\n\n   1. end the list and start another.\nAny other start also\nends the list.\n\n   $ item 1: definition 1\n   $ item 2: definition 2-1\n      definition 2-2\n   $ item _3_: definition _3_\n\n   1. one\n   1. two\n      * two point one\n      * two point two\n   1. three\n      $ three item one: three def one\n   1. four\n      $ four def one: this\n         is a continuation\n   1. five\n      1. five sub 1\n         1. five sub 1 sub 1\n      1. five sub 2\n\n   1. other\n      I. list\n      I. styles\n   1. are\n      i. also\n      i. possible\n   1. all\n      a. the\n      a. different\n      a. styles\n   1. are\n      A. implemented\n      A. and\n      A. supported\n\n---+ tables\n\n|Orange|Apple|\n|Bread|Pie|\n|Butter|Ice cream|\n\n|*Orange*|*Apple*|\n|Bread|Pie|\n|*Butter*|Ice cream|\n\n|*Orange*|*Apple*|\n|Bread%BR%%BR%and cheese|Pie%BR%%BR%*apple* and <i>carrot</i>|\n\n| Orange | Apple     | more     |\n| Bread  | Pie       | more     |\n| Butter | Ice cream | and more |\n\n---+ macros\n\n%TEST%\n\n%TEST{}%\n\n%TEST{content with spaces}%\n\n%TEST{\"content with spaces\"}%\n\n%TEST{\"content with spaces\" ARG1=\"test\"}%\n\n%TEST{content with spaces ARG1=test}%\n\n%TEST{ARG1=test content with spaces}%\n\n%TEST{ARG1=test ARG2=test2}%\n\n%TEST{ARG1=\"test\" ARG2=\"test2\"}%\n\n%TEST{ARG1=\"test\"\nARG2=\"test2\"\nmultiline\ndoes also work}%\n"
  },
  {
    "path": "test/txt2tags.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\" , MetaList [ MetaInlines [ Str \"author\" ] ] )\n          , ( \"date\" , MetaInlines [ Str \"date\" ] )\n          , ( \"includeconf\" , MetaString \"rules.conf\" )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Txt2tags\"\n                , Space\n                , Str \"Markup\"\n                , Space\n                , Str \"Rules\"\n                ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"document\"\n      , Space\n      , Str \"describes\"\n      , Space\n      , Str \"all\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"details\"\n      , Space\n      , Str \"about\"\n      , Space\n      , Str \"each\"\n      , Space\n      , Str \"txt2tags\"\n      , Space\n      , Str \"mark.\"\n      , SoftBreak\n      , Str \"The\"\n      , Space\n      , Str \"target\"\n      , Space\n      , Str \"audience\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Strong [ Str \"experienced\" ]\n      , Space\n      , Str \"users.\"\n      , Space\n      , Str \"You\"\n      , Space\n      , Str \"may\"\n      , Space\n      , Str \"find\"\n      , Space\n      , Str \"it\"\n      , SoftBreak\n      , Str \"useful\"\n      , Space\n      , Str \"if\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"want\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"master\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"marks\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"solve\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"specific\"\n      , Space\n      , Str \"problem\"\n      , SoftBreak\n      , Str \"about\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"mark.\"\n      ]\n  , Para\n      [ Str \"If\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"new\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"txt2tags\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"want\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"know\"\n      , Space\n      , Str \"which\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"available\"\n      , Space\n      , Str \"marks,\"\n      , Space\n      , Str \"please\"\n      , Space\n      , Str \"read\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"Markup\" , Space , Str \"Demo\" ]\n          ( \"MARKUPDEMO\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Note\"\n      , Space\n      , Str \"1:\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"document\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"generated\"\n      , Space\n      , Str \"directly\"\n      , Space\n      , Str \"from\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"txt2tags\"\n      , SoftBreak\n      , Str \"test-suite.\"\n      , Space\n      , Str \"All\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"rules\"\n      , Space\n      , Str \"mentioned\"\n      , Space\n      , Str \"here\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"100%\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"sync\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"current\"\n      , Space\n      , Str \"program\"\n      , Space\n      , Str \"code.\"\n      ]\n  , Para\n      [ Str \"Note\"\n      , Space\n      , Str \"2:\"\n      , Space\n      , Str \"A\"\n      , Space\n      , Str \"good\"\n      , Space\n      , Str \"practice\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"consult\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"the\" , Space , Str \"sources\" ]\n          ( \"rules.t2t\" , \"\" )\n      , Space\n      , Str \"when\"\n      , SoftBreak\n      , Str \"reading,\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"see\"\n      , Space\n      , Str \"how\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"texts\"\n      , Space\n      , Str \"were\"\n      , Space\n      , Str \"made.\"\n      ]\n  , Para\n      [ Str \"Table\" , Space , Str \"of\" , Space , Str \"Contents:\" ]\n  , HorizontalRule\n  , Header 1 ( \"paragraph\" , [] , [] ) [ Str \"Paragraph\" ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"composed\"\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"more\"\n      , Space\n      , Str \"lines.\"\n      , SoftBreak\n      , Str \"A\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"(or\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"table,\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list)\"\n      , Space\n      , Str \"ends\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"current\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"Leading\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"trailing\"\n      , Space\n      , Str \"spaces\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"ignored.\"\n      ]\n  , Para\n      [ Str \"A\"\n      , Space\n      , Str \"comment\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"placed\"\n      , Space\n      , Str \"inside\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph.\"\n      , SoftBreak\n      , Str \"It\"\n      , Space\n      , Str \"will\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"affect\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"end\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"file\"\n      , Space\n      , Str \"(EOF)\"\n      , Space\n      , Str \"closes\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"currently\"\n      , Space\n      , Str \"open\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Header 1 ( \"comment\" , [] , [] ) [ Str \"Comment\" ]\n  , Para\n      [ Str \"%\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"beginning\"\n      , Space\n      , Str \"(at\"\n      , Space\n      , Str \"column\"\n      , Space\n      , Str \"2)\"\n      ]\n  , Para\n      [ Str \"some\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"%\"\n      , Space\n      , Str \"half\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"comments\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"allowed\"\n      ]\n  , Header 1 ( \"line\" , [] , [] ) [ Str \"Line\" ]\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , HorizontalRule\n  , Para\n      [ Strikeout [ Str \"-----\" ]\n      , SoftBreak\n      , Strikeout [ Str \"-------\" , Space , Str \"--------\" ]\n      ]\n  , Para [ Strikeout [ Str \"-------+--------\" ] ]\n  , Para\n      [ Str \"(\"\n      , Space\n      , Strikeout [ Str \"----------------\" ]\n      , Space\n      , Str \")\"\n      ]\n  , Header 1 ( \"inline\" , [] , [] ) [ Str \"Inline\" ]\n  , Para\n      [ Str \"i)\"\n      , Space\n      , Strong [ Str \"b\" ]\n      , Space\n      , Emph [ Str \"i\" ]\n      , Space\n      , Underline [ Str \"u\" ]\n      , Space\n      , Strikeout [ Str \"s\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"m\"\n      , Space\n      , Str \"r\"\n      , Space\n      , RawInline (Format \"html\") \"t\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"bo\" ]\n      , Space\n      , Emph [ Str \"it\" ]\n      , Space\n      , Underline [ Str \"un\" ]\n      , Space\n      , Strikeout [ Str \"st\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"mo\"\n      , Space\n      , Str \"ra\"\n      , Space\n      , RawInline (Format \"html\") \"tg\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"bold\" ]\n      , Space\n      , Emph [ Str \"ital\" ]\n      , Space\n      , Underline [ Str \"undr\" ]\n      , Space\n      , Strikeout [ Str \"strk\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"mono\"\n      , Space\n      , Str \"raw\"\n      , Space\n      , RawInline (Format \"html\") \"tggd\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"bo\" , Space , Str \"ld\" ]\n      , Space\n      , Emph [ Str \"it\" , Space , Str \"al\" ]\n      , Space\n      , Underline [ Str \"un\" , Space , Str \"dr\" ]\n      , Space\n      , Strikeout [ Str \"st\" , Space , Str \"rk\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"mo no\"\n      , Space\n      , Str \"r\"\n      , Space\n      , Str \"aw\"\n      , Space\n      , RawInline (Format \"html\") \"tg gd\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"bo\" , Space , Str \"*\" , Space , Str \"ld\" ]\n      , Space\n      , Emph [ Str \"it\" , Space , Str \"/\" , Space , Str \"al\" ]\n      , Space\n      , Underline\n          [ Str \"un\" , Space , Str \"_\" , Space , Str \"dr\" ]\n      , Space\n      , Strikeout\n          [ Str \"st\" , Space , Str \"-\" , Space , Str \"rk\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"mo ` no\"\n      , Space\n      , Str \"r\"\n      , Space\n      , Str \"\\\"\"\n      , Space\n      , Str \"aw\"\n      , Space\n      , RawInline (Format \"html\") \"tg ' gd\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"bo\" , Space , Str \"**ld\" ]\n      , Space\n      , Emph [ Str \"it\" , Space , Str \"//al\" ]\n      , Space\n      , Underline [ Str \"un\" , Space , Str \"__dr\" ]\n      , Space\n      , Strikeout [ Str \"st\" , Space , Str \"--rk\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"mo ``no\"\n      , Space\n      , Str \"r\"\n      , Space\n      , Str \"\\\"\\\"aw\"\n      , Space\n      , RawInline (Format \"html\") \"tg ''gd\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"bo\" , Space , Str \"**\" , Space , Str \"ld\" ]\n      , Space\n      , Emph [ Str \"it\" , Space , Str \"//\" , Space , Str \"al\" ]\n      , Space\n      , Underline\n          [ Str \"un\" , Space , Str \"__\" , Space , Str \"dr\" ]\n      , Space\n      , Strikeout\n          [ Str \"st\" , Space , Str \"--\" , Space , Str \"rk\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"mo `` no\"\n      , Space\n      , Str \"r\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"aw\"\n      , Space\n      , RawInline (Format \"html\") \"tg '' gd\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"**bold**\" ]\n      , Space\n      , Emph [ Str \"//ital//\" ]\n      , Space\n      , Underline [ Str \"__undr__\" ]\n      , Space\n      , Strikeout [ Str \"--strk--\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"``mono``\"\n      , Space\n      , Str \"\\\"\\\"raw\\\"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"''tggd''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"*bold*\" ]\n      , Space\n      , Emph [ Str \"/ital/\" ]\n      , Space\n      , Underline [ Str \"_undr_\" ]\n      , Space\n      , Strikeout [ Str \"-strk-\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"`mono`\"\n      , Space\n      , Str \"\\\"raw\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"'tggd'\"\n      ]\n  , Para\n      [ Str \"i)\"\n      , Space\n      , Strong [ Str \"*\" ]\n      , Space\n      , Emph [ Str \"/\" ]\n      , Space\n      , Underline [ Str \"_\" ]\n      , Space\n      , Strikeout [ Str \"-\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"`\"\n      , Space\n      , Str \"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"'\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"**\" ]\n      , Space\n      , Emph [ Str \"//\" ]\n      , Space\n      , Underline [ Str \"__\" ]\n      , Space\n      , Strikeout [ Str \"--\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"``\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"***\" ]\n      , Space\n      , Emph [ Str \"///\" ]\n      , Space\n      , Underline [ Str \"___\" ]\n      , Space\n      , Strikeout [ Str \"---\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"```\"\n      , Space\n      , Str \"\\\"\\\"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"'''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"****\" ]\n      , Space\n      , Emph [ Str \"////\" ]\n      , Space\n      , Underline [ Str \"____\" ]\n      , Space\n      , Strikeout [ Str \"----\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"````\"\n      , Space\n      , Str \"\\\"\\\"\\\"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"''''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"*****\" ]\n      , Space\n      , Emph [ Str \"/////\" ]\n      , Space\n      , Underline [ Str \"_____\" ]\n      , Space\n      , Strikeout [ Str \"-----\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"`````\"\n      , Space\n      , Str \"\\\"\\\"\\\"\\\"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"'''''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Strong [ Str \"******\" ]\n      , Space\n      , Emph [ Str \"//////\" ]\n      , Space\n      , Underline [ Str \"______\" ]\n      , Space\n      , Strikeout [ Str \"------\" ]\n      , Space\n      , Code ( \"\" , [] , [] ) \"``````\"\n      , Space\n      , Str \"\\\"\\\"\\\"\\\"\\\"\\\"\"\n      , Space\n      , RawInline (Format \"html\") \"''''''\"\n      ]\n  , Para\n      [ Str \"i)\"\n      , Space\n      , Str \"****\"\n      , Space\n      , Str \"////\"\n      , Space\n      , Str \"____\"\n      , Space\n      , Str \"----\"\n      , Space\n      , Str \"````\"\n      , Space\n      , Str \"\\\"\\\"\\\"\\\"\"\n      , Space\n      , Str \"''''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Str \"**\"\n      , Space\n      , Str \"**\"\n      , Space\n      , Str \"//\"\n      , Space\n      , Str \"//\"\n      , Space\n      , Str \"__\"\n      , Space\n      , Str \"__\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"``\"\n      , Space\n      , Str \"``\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"''\"\n      , Space\n      , Str \"''\"\n      ]\n  , Para\n      [ Str \"i)\"\n      , Space\n      , Str \"**\"\n      , Space\n      , Str \"bold**\"\n      , Space\n      , Str \"//\"\n      , Space\n      , Str \"ital//\"\n      , Space\n      , Str \"__\"\n      , Space\n      , Str \"undr__\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"strk--\"\n      , Space\n      , Str \"``\"\n      , Space\n      , Str \"mono``\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"raw\\\"\\\"\"\n      , Space\n      , Str \"''\"\n      , Space\n      , Str \"tggd''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Str \"**bold\"\n      , Space\n      , Str \"**\"\n      , Space\n      , Str \"//ital\"\n      , Space\n      , Str \"//\"\n      , Space\n      , Str \"__undr\"\n      , Space\n      , Str \"__\"\n      , Space\n      , Str \"--strk\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"``mono\"\n      , Space\n      , Str \"``\"\n      , Space\n      , Str \"\\\"\\\"raw\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"''tggd\"\n      , Space\n      , Str \"''\"\n      , SoftBreak\n      , Str \"i)\"\n      , Space\n      , Str \"**\"\n      , Space\n      , Str \"bold\"\n      , Space\n      , Str \"**\"\n      , Space\n      , Str \"//\"\n      , Space\n      , Str \"ital\"\n      , Space\n      , Str \"//\"\n      , Space\n      , Str \"__\"\n      , Space\n      , Str \"undr\"\n      , Space\n      , Str \"__\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"strk\"\n      , Space\n      , Str \"--\"\n      , Space\n      , Str \"``\"\n      , Space\n      , Str \"mono\"\n      , Space\n      , Str \"``\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"raw\"\n      , Space\n      , Str \"\\\"\\\"\"\n      , Space\n      , Str \"''\"\n      , Space\n      , Str \"tggd\"\n      , Space\n      , Str \"''\"\n      ]\n  , Header 1 ( \"link\" , [] , [] ) [ Str \"Link\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com\" ]\n          ( \"user@domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com\" ]\n          ( \"user@domain.com\" , \"\" )\n      , Str \".\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com\" ]\n          ( \"user@domain.com\" , \"\" )\n      , Str \".\"\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com\" ]\n          ( \"user@domain.com\" , \"\" )\n      , Str \".\"\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"label\" ] ( \"user@domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com?subject=bla\" ]\n          ( \"user@domain.com?subject=bla\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com?subject=bla\" ]\n          ( \"user@domain.com?subject=bla\" , \"\" )\n      , Str \".\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:user@domain.com?subject=bla\" ]\n          ( \"user@domain.com?subject=bla\" , \"\" )\n      , Str \",\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"mailto:user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          ]\n          ( \"user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"mailto:user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          ]\n          ( \"user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          , \"\"\n          )\n      , Str \".\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"mailto:user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          ]\n          ( \"user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          , \"\"\n          )\n      , Str \",\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"label\" ]\n          ( \"user@domain.com?subject=bla&cc=otheruser@domain.com\"\n          , \"\"\n          )\n      , Str \".\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"label\" ]\n          ( \"user@domain.com?subject=bla&cc=otheruser@domain.com.\"\n          , \"\"\n          )\n      , Str \".\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com\" ]\n          ( \"http://www.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/\" ]\n          ( \"http://www.domain.com/dir/\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir///\" ]\n          ( \"http://www.domain.com/dir///\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com.\" ]\n          ( \"http://www.domain.com.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com,\" ]\n          ( \"http://www.domain.com,\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com.\" ]\n          ( \"http://www.domain.com.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com,\" ]\n          ( \"http://www.domain.com,\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/.\" ]\n          ( \"http://www.domain.com/dir/.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com.\" ]\n          ( \"http://www.domain.com.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/.\" ]\n          ( \"http://www.domain.com/dir/.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/index.html.\" ]\n          ( \"http://www.domain.com/dir/index.html.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/index.html,\" ]\n          ( \"http://www.domain.com/dir/index.html,\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/#anchor\" ]\n          ( \"http://www.domain.com/dir/#anchor\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/index.html#anchor\" ]\n          ( \"http://www.domain.com/dir/index.html#anchor\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/index.html#anchor.\" ]\n          ( \"http://www.domain.com/dir/index.html#anchor.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/#anchor.\" ]\n          ( \"http://www.domain.com/dir/#anchor.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/index.html#anchor.\" ]\n          ( \"http://www.domain.com/dir/index.html#anchor.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/#anchor.\" ]\n          ( \"http://www.domain.com/dir/#anchor.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Str \"any\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://www.domain.com/dir/index.html#anchor.\" ]\n          ( \"http://www.domain.com/dir/index.html#anchor.\" , \"\" )\n      , Space\n      , Str \"any\"\n      , Space\n      , Str \"text.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com?a=a@a.a&b=a+b+c.\" ]\n          ( \"http://domain.com?a=a@a.a&b=a+b+c.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com?a=a@a.a&b=a+b+c,\" ]\n          ( \"http://domain.com?a=a@a.a&b=a+b+c,\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.\" ]\n          ( \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.\" ]\n          ( \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com?a=a@a.a&b=a+b+c.#anchor\" ]\n          ( \"http://domain.com?a=a@a.a&b=a+b+c.#anchor\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\" ]\n          ( \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor\" ]\n          ( \"http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://user:password@domain.com/bla.html.\" ]\n          ( \"http://user:password@domain.com/bla.html.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://user:password@domain.com/dir/.\" ]\n          ( \"http://user:password@domain.com/dir/.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://user:password@domain.com.\" ]\n          ( \"http://user:password@domain.com.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://user:@domain.com.\" ]\n          ( \"http://user:@domain.com.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://user@domain.com.\" ]\n          ( \"http://user@domain.com.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\"\n          ]\n          ( \"http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor\"\n          ]\n          ( \"http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"label\" ] ( \"www.domain.com\" , \"\" )\n      , SoftBreak\n      , Str \"[\"\n      , Space\n      , Str \"label\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"www.domain.com\" ]\n          ( \"www.domain.com\" , \"\" )\n      , Str \"]\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"label\" , Space ]\n          ( \"www.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"anchor\" , Space ]\n          ( \"http://www.domain.com/dir/index.html#anchor.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"login\" , Space ]\n          ( \"http://user:password@domain.com/bla.html\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"form\" , Space ]\n          ( \"http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"form\" , Space , Str \"&\" , Space , Str \"anchor\" ]\n          ( \"http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"login\"\n          , Space\n          , Str \"&\"\n          , Space\n          , Str \"form\"\n          , Space\n          ]\n          ( \"http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"local\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"up\"\n          , Space\n          ]\n          ( \"..\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"local\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"file\"\n          , Space\n          ]\n          ( \"bla.html\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"local\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"anchor\"\n          , Space\n          ]\n          ( \"#anchor\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"local\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"file/anchor\"\n          ]\n          ( \"bla.html#anchor\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"local\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"file/anchor\"\n          ]\n          ( \"bla.html#anchor.\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"local\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"img\"\n          , Space\n          ]\n          ( \"abc.gif\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"www.fake.com\" ]\n          ( \"www.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm\"\n          ]\n          ( \"http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-\"\n          ]\n          ( \"http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-\"\n          , \"\"\n          )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_\"\n          ]\n          ( \"http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_\"\n          , \"\"\n          )\n      , Str \"-1%.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str\n              \"http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_\"\n          ]\n          ( \"http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_\"\n          , \"\"\n          )\n      , Str \"-1%.\"\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"http://L1.com\" ]\n          ( \"http://L1.com\" , \"\" )\n      , Space\n      , Str \"!\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:L2@www.com\" ]\n          ( \"L2@www.com\" , \"\" )\n      , Space\n      , Str \"!\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"L3\" ] ( \"www.com\" , \"\" )\n      , Space\n      , Str \"!\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"L4\" ] ( \"w@ww.com\" , \"\" )\n      , Space\n      , Str \"!\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"www.L5.com\" ] ( \"www.L5.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"www.domain.com\" ]\n          ( \"www.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"www2.domain.com\" ]\n          ( \"www2.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"ftp.domain.com\" ]\n          ( \"ftp.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"WWW.DOMAIN.COM\" ]\n          ( \"WWW.DOMAIN.COM\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"FTP.DOMAIN.COM\" ]\n          ( \"FTP.DOMAIN.COM\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"label\" ] ( \"www.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"label\" ] ( \"ftp.domain.com\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"label\" ] ( \"WWW.DOMAIN.COM\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [] , [] ) [ Str \"label\" ] ( \"FTP.DOMAIN.COM\" , \"\" )\n      , SoftBreak\n      , Str \"[label\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"www.domain.com\" ]\n          ( \"www.domain.com\" , \"\" )\n      , Space\n      , Str \"]\"\n      , SoftBreak\n      , Str \"[label]\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"www.domain.com\" ]\n          ( \"www.domain.com\" , \"\" )\n      , Str \"]\"\n      ]\n  , Header 1 ( \"image\" , [] , [] ) [ Str \"Image\" ]\n  , Para [ Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" ) ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" ) ]\n          ( \"https://txt2tags.org\" , \"\" )\n      ]\n  , Para\n      [ Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Space\n      , Str \"Image\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"beginning.\"\n      ]\n  , Para\n      [ Str \"Image\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"middle\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line.\"\n      ]\n  , Para\n      [ Str \"Image\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"end.\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      ]\n  , Para\n      [ Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , SoftBreak\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , SoftBreak\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      ]\n  , Para\n      [ Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      ]\n  , Para\n      [ Str \"Images\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Space\n      , Str \"mixed\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Space\n      , Str \"with\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Space\n      , Str \"text.\"\n      ]\n  , Para\n      [ Str \"Images\"\n      , Space\n      , Str \"glued\"\n      , Space\n      , Str \"together:\"\n      , Space\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Image ( \"\" , [] , [] ) [] ( \"img.png\" , \"\" )\n      , Str \".\"\n      ]\n  , Para [ Str \"[img.png\" , Space , Str \"]\" ]\n  , Para [ Str \"[\" , Space , Str \"img.png]\" ]\n  , Para [ Str \"[\" , Space , Str \"img.png\" , Space , Str \"]\" ]\n  , Header\n      1\n      ( \"numtitle\" , [] , [] )\n      [ Str \"Numbered\" , Space , Str \"Title\" ]\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"2\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1\n      ( \"lab_el-1\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"lab_el-2\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"2\" ]\n  , Header\n      3\n      ( \"lab_el-3\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"lab_el-4\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5\n      ( \"lab_el-5\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"lab_el-9\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Para [ Str \"+Not\" , Space , Str \"Title\" ]\n  , Para [ Str \"++Not\" , Space , Str \"Title+\" ]\n  , Para\n      [ Str \"+++Not\"\n      , Space\n      , Str \"Title++++\"\n      , SoftBreak\n      , Str \"++++++Not\"\n      , Space\n      , Str \"Title\"\n      , Space\n      , Str \"6++++++\"\n      ]\n  , Para\n      [ Str \"+++++++Not\"\n      , Space\n      , Str \"Title\"\n      , Space\n      , Str \"7+++++++\"\n      , SoftBreak\n      , Str \"+Not\"\n      , Space\n      , Str \"Title+\"\n      , Space\n      , Str \"[label1]\"\n      , SoftBreak\n      , Str \"+Not\"\n      , Space\n      , Str \"Title+[\"\n      , Space\n      , Str \"label\"\n      , Space\n      , Str \"]\"\n      , SoftBreak\n      , Str \"+Not\"\n      , Space\n      , Str \"Title+[la/bel]\"\n      ]\n  , Header 1 ( \"title\" , [] , [] ) [ Str \"Title\" ]\n  , Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"2\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1\n      ( \"lab_el-1\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"lab_el-2\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"2\" ]\n  , Header\n      3\n      ( \"lab_el-3\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      4\n      ( \"lab_el-4\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5\n      ( \"lab_el-5\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Header\n      3\n      ( \"lab_el-9\" , [] , [] )\n      [ Str \"Title\" , Space , Str \"Level\" , Space , Str \"3\" ]\n  , Para [ Str \"=Not\" , Space , Str \"Title\" ]\n  , Para [ Str \"==Not\" , Space , Str \"Title=\" ]\n  , Para\n      [ Str \"===Not\"\n      , Space\n      , Str \"Title====\"\n      , SoftBreak\n      , Str \"======Not\"\n      , Space\n      , Str \"Title\"\n      , Space\n      , Str \"6======\"\n      ]\n  , Para\n      [ Str \"=======Not\"\n      , Space\n      , Str \"Title\"\n      , Space\n      , Str \"7=======\"\n      , SoftBreak\n      , Str \"=Not\"\n      , Space\n      , Str \"Title=\"\n      , Space\n      , Str \"[label1]\"\n      , SoftBreak\n      , Str \"=Not\"\n      , Space\n      , Str \"Title=[\"\n      , Space\n      , Str \"label\"\n      , Space\n      , Str \"]\"\n      , SoftBreak\n      , Str \"=Not\"\n      , Space\n      , Str \"Title=[la/bel]\"\n      ]\n  , Header 1 ( \"quote\" , [] , [] ) [ Str \"Quote\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"To\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"paragraph,\"\n          , Space\n          , Str \"just\"\n          , Space\n          , Str \"prefix\"\n          , Space\n          , Str \"it\"\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"TAB\"\n          , SoftBreak\n          , Str \"character.\"\n          , Space\n          , Str \"All\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"lines\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"paragraph\"\n          , Space\n          , Str \"must\"\n          , SoftBreak\n          , Str \"begin\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"TAB.\"\n          ]\n      ]\n  , Para\n      [ Str \"Any\"\n      , Space\n      , Str \"non-tabbed\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"closes\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"quote\"\n      , Space\n      , Str \"block.\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"The\"\n          , Space\n          , Str \"number\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"leading\"\n          , Space\n          , Str \"TABs\"\n          , Space\n          , Str \"identifies\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"quote\"\n          , SoftBreak\n          , Str \"block\"\n          , Space\n          , Str \"depth.\"\n          , Space\n          , Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"level\"\n          , Space\n          , Str \"1.\"\n          ]\n      , BlockQuote\n          [ Para\n              [ Str \"With\"\n              , Space\n              , Str \"two\"\n              , Space\n              , Str \"TABs,\"\n              , Space\n              , Str \"we\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"on\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"quote\"\n              , SoftBreak\n              , Str \"level\"\n              , Space\n              , Str \"2.\"\n              ]\n          , BlockQuote\n              [ Para\n                  [ Str \"The\"\n                  , Space\n                  , Str \"more\"\n                  , Space\n                  , Str \"TABs,\"\n                  , Space\n                  , Str \"more\"\n                  , Space\n                  , Str \"deep\"\n                  , Space\n                  , Str \"is\"\n                  , SoftBreak\n                  , Str \"the\"\n                  , Space\n                  , Str \"quote\"\n                  , Space\n                  , Str \"level.\"\n                  ]\n              , BlockQuote\n                  [ Para\n                      [ Str \"There\"\n                      , Space\n                      , Str \"isn't\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"limit.\"\n                      ]\n                  ]\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ BlockQuote\n          [ BlockQuote\n              [ BlockQuote\n                  [ Para\n                      [ Str \"This\"\n                      , Space\n                      , Str \"quote\"\n                      , Space\n                      , Str \"starts\"\n                      , Space\n                      , Str \"at\"\n                      , SoftBreak\n                      , Str \"level\"\n                      , Space\n                      , Str \"4.\"\n                      ]\n                  ]\n              , Para\n                  [ Str \"Then\"\n                  , Space\n                  , Str \"its\"\n                  , Space\n                  , Str \"depth\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"decreased.\"\n                  ]\n              ]\n          , Para\n              [ Str \"Counting\"\n              , Space\n              , Str \"down,\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"by\"\n              , Space\n              , Str \"one.\"\n              ]\n          ]\n      , Para\n          [ Str \"Until\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"level\"\n          , Space\n          , Str \"1.\"\n          ]\n      ]\n  , BlockQuote\n      [ BlockQuote\n          [ BlockQuote\n              [ Para\n                  [ Str \"Unlike\"\n                  , Space\n                  , Str \"lists,\"\n                  , Space\n                  , Str \"any\"\n                  , Space\n                  , Str \"quote\"\n                  , Space\n                  , Str \"block\"\n                  , Space\n                  , Str \"is\"\n                  , SoftBreak\n                  , Str \"independent,\"\n                  , Space\n                  , Str \"not\"\n                  , Space\n                  , Str \"part\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"tree.\"\n                  ]\n              ]\n          ]\n      , Para\n          [ Str \"The\"\n          , Space\n          , Str \"TAB\"\n          , Space\n          , Str \"count\"\n          , Space\n          , Str \"don't\"\n          , Space\n          , Str \"need\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"incremental\"\n          , SoftBreak\n          , Str \"by\"\n          , Space\n          , Str \"one.\"\n          ]\n      , BlockQuote\n          [ BlockQuote\n              [ BlockQuote\n                  [ Para\n                      [ Str \"The\"\n                      , Space\n                      , Str \"nesting\"\n                      , Space\n                      , Str \"don't\"\n                      , Space\n                      , Str \"need\"\n                      , SoftBreak\n                      , Str \"to\"\n                      , Space\n                      , Str \"follow\"\n                      , Space\n                      , Str \"any\"\n                      , Space\n                      , Str \"rule.\"\n                      ]\n                  ]\n              ]\n          , Para\n              [ Str \"Quotes\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"opened\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"closed\"\n              , SoftBreak\n              , Str \"in\"\n              , Space\n              , Str \"any\"\n              , Space\n              , Str \"way.\"\n              ]\n          , BlockQuote\n              [ BlockQuote\n                  [ BlockQuote\n                      [ Para [ Str \"You\" , Space , Str \"choose.\" ] ]\n                  ]\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Some\"\n          , Space\n          , Str \"targets\"\n          , Space\n          , Str \"(as\"\n          , Space\n          , Str \"sgml)\"\n          , Space\n          , Str \"don't\"\n          , Space\n          , Str \"support\"\n          , Space\n          , Str \"the\"\n          , SoftBreak\n          , Str \"nesting\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"quotes.\"\n          , Space\n          , Str \"There\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"only\"\n          , Space\n          , Str \"one\"\n          , Space\n          , Str \"quote\"\n          , SoftBreak\n          , Str \"level.\"\n          ]\n      , BlockQuote\n          [ Para\n              [ Str \"In\"\n              , Space\n              , Str \"this\"\n              , Space\n              , Str \"case,\"\n              , Space\n              , Str \"no\"\n              , Space\n              , Str \"matter\"\n              , Space\n              , Str \"how\"\n              , Space\n              , Str \"much\"\n              , SoftBreak\n              , Str \"TABs\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"used\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"define\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"quote\"\n              , SoftBreak\n              , Str \"block,\"\n              , Space\n              , Str \"it\"\n              , Space\n              , Str \"always\"\n              , Space\n              , Str \"will\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"level\"\n              , Space\n              , Str \"1.\"\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Spaces\"\n          , Space\n          , Str \"AFTER\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"TAB\"\n          , Space\n          , Str \"character\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"allowed.\"\n          , SoftBreak\n          , Str \"But\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"careful,\"\n          , Space\n          , Str \"it\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"confusing.\"\n          ]\n      ]\n  , Para\n      [ Str \"Spaces\"\n      , Space\n      , Str \"BEFORE\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"TAB\"\n      , Space\n      , Str \"character\"\n      , SoftBreak\n      , Str \"invalidate\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"mark.\"\n      , Space\n      , Str \"It's\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"quote.\"\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Paragraph\"\n          , Space\n          , Str \"breaks\"\n          , Space\n          , Str \"inside\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"aren't\"\n          , SoftBreak\n          , Str \"possible.\"\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"sample\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"two\"\n          , Space\n          , Str \"separated\"\n          , Space\n          , Str \"quoted\"\n          , SoftBreak\n          , Str \"paragraphs,\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"with\"\n          , SoftBreak\n          , Str \"two\"\n          , Space\n          , Str \"paragraphs\"\n          , Space\n          , Str \"inside.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"The\"\n          , Space\n          , Str \"end\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"file\"\n          , Space\n          , Str \"(EOF)\"\n          , Space\n          , Str \"closes\"\n          , Space\n          , Str \"the\"\n          , SoftBreak\n          , Str \"currently\"\n          , Space\n          , Str \"open\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"block.\"\n          ]\n      ]\n  , Header 1 ( \"raw\" , [] , [] ) [ Str \"Raw\" ]\n  , Para [ Str \"A raw line.\\n\" ]\n  , Para [ Str \"  Another raw line, with leading spaces.\\n\" ]\n  , Para\n      [ Str \"A raw area delimited\\n       by lines with marks.\\n\"\n      ]\n  , Para\n      [ Str\n          \"Trailing spaces and TABs after the area marks\\nare allowed, but not encouraged nor documented.\\n\"\n      ]\n  , Para\n      [ Str \"\\\"\\\"\\\"Not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"raw\"\n      , Space\n      , Str \"line,\"\n      , Space\n      , Str \"need\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"space\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"mark.\"\n      ]\n  , Para\n      [ Str \"\\\"\\\"\\\"\"\n      , SoftBreak\n      , Str \"Not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"raw\"\n      , Space\n      , Str \"area.\"\n      , SoftBreak\n      , Str \"The\"\n      , Space\n      , Str \"marks\"\n      , Space\n      , Str \"must\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"beginning,\"\n      , SoftBreak\n      , Str \"no\"\n      , Space\n      , Str \"leading\"\n      , Space\n      , Str \"spaces.\"\n      , SoftBreak\n      , Str \"\\\"\\\"\\\"\"\n      ]\n  , Para\n      [ Str\n          \"The end of the file (EOF) closes\\nthe currently open raw area.\\n\"\n      ]\n  , Header 1 ( \"verbatim\" , [] , [] ) [ Str \"Verbatim\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"A verbatim line.\\n\"\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"  Another verbatim line, with leading spaces.\\n\"\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"A verbatim area delimited\\n       by lines with marks.\\n\"\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"Trailing spaces and TABs after the area marks\\nare allowed, but not encouraged nor documented.\\n\"\n  , Para\n      [ Str \"```Not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"verbatim\"\n      , Space\n      , Str \"line,\"\n      , Space\n      , Str \"need\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"space\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"mark.\"\n      ]\n  , Para\n      [ Str \"```\"\n      , SoftBreak\n      , Str \"Not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"verbatim\"\n      , Space\n      , Str \"area.\"\n      , SoftBreak\n      , Str \"The\"\n      , Space\n      , Str \"marks\"\n      , Space\n      , Str \"must\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"at\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"beginning,\"\n      , SoftBreak\n      , Str \"no\"\n      , Space\n      , Str \"leading\"\n      , Space\n      , Str \"spaces.\"\n      , SoftBreak\n      , Str \"```\"\n      ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"The end of the file (EOF) closes\\nthe currently open verbatim area.\\n\"\n  , Header\n      1\n      ( \"deflist\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"List\" ]\n  , DefinitionList\n      [ ( [ Str \"Definition\" , Space , Str \"list\" ]\n        , [ [ Plain\n                [ Str \"A\"\n                , Space\n                , Str \"list\"\n                , Space\n                , Str \"with\"\n                , Space\n                , Str \"terms\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"Start\"\n          , Space\n          , Str \"term\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"colon\"\n          ]\n        , [ [ Plain\n                [ Str \"And\"\n                , Space\n                , Str \"its\"\n                , Space\n                , Str \"definition\"\n                , Space\n                , Str \"follows\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1\n      ( \"numlist\" , [] , [] )\n      [ Str \"Numbered\" , Space , Str \"List\" ]\n  , Para\n      [ Str \"See\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"List\" ] ( \"#list\" , \"\" )\n      , Str \",\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"same\"\n      , Space\n      , Str \"rules\"\n      , Space\n      , Str \"apply.\"\n      ]\n  , Header 1 ( \"list\" , [] , [] ) [ Str \"List\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Use\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"hyphen\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"prefix\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"There\"\n            , Space\n            , Str \"must\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"space\"\n            , Space\n            , Str \"after\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"hyphen.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"The\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"closed\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"two\"\n            , Space\n            , Str \"consecutive\"\n            , Space\n            , Str \"blank\"\n            , Space\n            , Str \"lines.\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"The\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"can\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"indented\"\n            , Space\n            , Str \"on\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"source\"\n            , Space\n            , Str \"document.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"You\"\n            , Space\n            , Str \"can\"\n            , Space\n            , Str \"use\"\n            , Space\n            , Str \"any\"\n            , Space\n            , Str \"number\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"spaces.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"The\"\n            , Space\n            , Str \"result\"\n            , Space\n            , Str \"will\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"same.\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Para\n            [ Str \"Let\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"blank\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"between\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items.\"\n            ]\n        ]\n      , [ Para\n            [ Str \"It\"\n            , Space\n            , Str \"will\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"maintained\"\n            , Space\n            , Str \"on\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"conversion.\"\n            ]\n        ]\n      , [ Para\n            [ Str \"Some\"\n            , Space\n            , Str \"targets\"\n            , Space\n            , Str \"don't\"\n            , Space\n            , Str \"support\"\n            , Space\n            , Str \"this\"\n            , Space\n            , Str \"behavior.\"\n            ]\n        ]\n      , [ Para\n            [ Str \"This\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"was\"\n            , Space\n            , Str \"separated\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"blanks.\"\n            , SoftBreak\n            , Str \"You\"\n            , Space\n            , Str \"can\"\n            , Space\n            , Str \"also\"\n            , Space\n            , Str \"put\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"blank\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"inside\"\n            ]\n        , Para\n            [ Str \"the\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"contents\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"it\"\n            , Space\n            , Str \"will\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"preserved.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"-This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"(no\"\n      , Space\n      , Str \"space)\"\n      ]\n  , Para\n      [ Str \"-\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"(more\"\n      , Space\n      , Str \"than\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"space)\"\n      ]\n  , Para\n      [ Str \"-\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"(a\"\n      , Space\n      , Str \"TAB\"\n      , Space\n      , Str \"instead\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"space)\"\n      ]\n  , BulletList\n      [ [ BulletList\n            [ [ Plain\n                  [ Str \"This\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"list\"\n                  ]\n              ]\n            ]\n        ]\n      , [ OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"This\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"list\"\n                  ]\n              ]\n            ]\n        ]\n      , [ DefinitionList\n            [ ( [ Str \"This\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"list\"\n                ]\n              , [ [] ]\n              )\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"This\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"\\\"mother\\\"\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"first\"\n            , Space\n            , Str \"item.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Here\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"second,\"\n            , Space\n            , Str \"but\"\n            , Space\n            , Str \"inside\"\n            , Space\n            , Str \"this\"\n            , Space\n            , Str \"item,\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"there\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"a\"\n                  , Space\n                  , Str \"sublist,\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"its\"\n                  , Space\n                  , Str \"own\"\n                  , Space\n                  , Str \"items.\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"Note\"\n                  , Space\n                  , Str \"that\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"items\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"same\"\n                  , Space\n                  , Str \"sublist\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"must\"\n                  , Space\n                  , Str \"have\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"same\"\n                  , Space\n                  , Str \"indentation.\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"And\"\n                        , Space\n                        , Str \"this\"\n                        , Space\n                        , Str \"can\"\n                        , Space\n                        , Str \"go\"\n                        , Space\n                        , Str \"on,\"\n                        , Space\n                        , Str \"opening\"\n                        , Space\n                        , Str \"sublists.\"\n                        ]\n                    , BulletList\n                        [ [ Plain\n                              [ Str \"Just\"\n                              , Space\n                              , Str \"add\"\n                              , Space\n                              , Str \"leading\"\n                              , Space\n                              , Str \"spaces\"\n                              , Space\n                              , Str \"before\"\n                              , Space\n                              , Str \"the\"\n                              ]\n                          ]\n                        , [ Plain\n                              [ Str \"hyphen\"\n                              , Space\n                              , Str \"and\"\n                              , Space\n                              , Str \"sublists\"\n                              , Space\n                              , Str \"will\"\n                              , Space\n                              , Str \"be\"\n                              , Space\n                              , Str \"opened.\"\n                              ]\n                          ]\n                        , [ Plain\n                              [ Str \"The\"\n                              , Space\n                              , Str \"two\"\n                              , Space\n                              , Str \"blank\"\n                              , Space\n                              , Str \"lines\"\n                              , Space\n                              , Str \"closes\"\n                              , Space\n                              , Str \"them\"\n                              , Space\n                              , Str \"all.\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"When\"\n            , Space\n            , Str \"nesting\"\n            , Space\n            , Str \"lists,\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"additional\"\n            , Space\n            , Str \"spaces\"\n            , Space\n            , Str \"are\"\n            , Space\n            , Str \"free.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"You\"\n            , Space\n            , Str \"can\"\n            , Space\n            , Str \"add\"\n            , Space\n            , Str \"just\"\n            , Space\n            , Str \"one,\"\n            ]\n        , BulletList\n            [ [ Plain [ Str \"or\" , Space , Str \"many.\" ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"What\"\n                        , Space\n                        , Str \"matters\"\n                        , Space\n                        , Str \"is\"\n                        , Space\n                        , Str \"to\"\n                        , Space\n                        , Str \"put\"\n                        , Space\n                        , Str \"more\"\n                        , Space\n                        , Str \"than\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"previous.\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"But\"\n                        , Space\n                        , Str \"remember\"\n                        , Space\n                        , Str \"that\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"other\"\n                        , Space\n                        , Str \"items\"\n                        , Space\n                        , Str \"of\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"same\"\n                        , Space\n                        , Str \"list\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"must\"\n                        , Space\n                        , Str \"use\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"same\"\n                        , Space\n                        , Str \"indentation.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"There\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"not\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"depth\"\n            , Space\n            , Str \"limit,\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"you\"\n                  , Space\n                  , Str \"can\"\n                  , Space\n                  , Str \"go\"\n                  , Space\n                  , Str \"deeper\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"deeper.\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"But\"\n                        , Space\n                        , Str \"some\"\n                        , Space\n                        , Str \"targets\"\n                        , Space\n                        , Str \"may\"\n                        , Space\n                        , Str \"have\"\n                        , Space\n                        , Str \"restrictions.\"\n                        ]\n                    , BulletList\n                        [ [ Plain\n                              [ Str \"The\"\n                              , Space\n                              , Str \"LaTeX\"\n                              , Space\n                              , Str \"maximum\"\n                              , Space\n                              , Str \"is\"\n                              , Space\n                              , Str \"here,\"\n                              , Space\n                              , Str \"4\"\n                              , Space\n                              , Str \"levels.\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Reverse\"\n            , Space\n            , Str \"nesting\"\n            , Space\n            , Str \"doesn't\"\n            , Space\n            , Str \"work.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Because\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"sublist\"\n            , Space\n            , Str \"*must*\"\n            , Space\n            , Str \"have\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"mother\"\n            , Space\n            , Str \"list.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"It's\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"concept,\"\n            , Space\n            , Str \"not\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"txt2tags\"\n            , Space\n            , Str \"limitation.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"All\"\n            , Space\n            , Str \"this\"\n            , Space\n            , Str \"sublists\"\n            , Space\n            , Str \"will\"\n            , Space\n            , Str \"be\"\n            , Space\n            , Str \"bumped\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"mother\"\n            , Space\n            , Str \"lists.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"At\"\n            , Space\n            , Str \"level\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"like\"\n            , Space\n            , Str \"this\"\n            , Space\n            , Str \"one.\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain [ Str \"Level\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Plain [ Str \"Level\" , Space , Str \"2\" ]\n              , BulletList\n                  [ [ Plain [ Str \"Level\" , Space , Str \"3\" ]\n                    , BulletList\n                        [ [ Plain [ Str \"Level\" , Space , Str \"4\" ] ] ]\n                    ]\n                  , [ Plain\n                        [ Str \"Level\"\n                        , Space\n                        , Str \"3\"\n                        , Space\n                        , Str \"--\"\n                        , Space\n                        , Str \"(closed\"\n                        , Space\n                        , Str \"Level\"\n                        , Space\n                        , Str \"4)\"\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"2\"\n                  , Space\n                  , Str \"--\"\n                  , Space\n                  , Str \"(closed\"\n                  , Space\n                  , Str \"Level\"\n                  , Space\n                  , Str \"3)\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Level\"\n            , Space\n            , Str \"1\"\n            , Space\n            , Str \"--\"\n            , Space\n            , Str \"(closed\"\n            , Space\n            , Str \"Level\"\n            , Space\n            , Str \"2)\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain [ Str \"Level\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Plain [ Str \"Level\" , Space , Str \"2\" ]\n              , BulletList\n                  [ [ Plain [ Str \"Level\" , Space , Str \"3\" ]\n                    , BulletList\n                        [ [ Plain [ Str \"Level\" , Space , Str \"4\" ] ] ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Level\"\n            , Space\n            , Str \"1\"\n            , Space\n            , Str \"--\"\n            , Space\n            , Str \"(closed\"\n            , Space\n            , Str \"Level\"\n            , Space\n            , Str \"4,\"\n            , Space\n            , Str \"Level\"\n            , Space\n            , Str \"3\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"Level\"\n            , Space\n            , Str \"2)\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Para [ Str \"Level\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Para\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"2\"\n                  , Space\n                  , Str \"--\"\n                  , Space\n                  , Str \"blank\"\n                  , Space\n                  , Str \"BEFORE\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"AFTER\"\n                  , Space\n                  , Str \"(in)\"\n                  ]\n              , BulletList\n                  [ [ Plain [ Str \"Level\" , Space , Str \"3\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList [ [ Plain [ Str \"Level\" , Space , Str \"4\" ] ] ]\n  , BulletList\n      [ [ Para [ Str \"Level\" , Space , Str \"3\" ] ]\n      , [ Para\n            [ Str \"Level\"\n            , Space\n            , Str \"2\"\n            , Space\n            , Str \"--\"\n            , Space\n            , Str \"blank\"\n            , Space\n            , Str \"BEFORE\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"AFTER\"\n            , Space\n            , Str \"(out)\"\n            ]\n        ]\n      , [ Para [ Str \"Level\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Para\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"2\"\n                  , Space\n                  , Str \"--\"\n                  , Space\n                  , Str \"blank\"\n                  , Space\n                  , Str \"BEFORE\"\n                  , Space\n                  , Str \"(spaces)\"\n                  , Space\n                  , Str \"and\"\n                  , Space\n                  , Str \"AFTER\"\n                  , Space\n                  , Str \"(TAB)\"\n                  ]\n              , BulletList\n                  [ [ Plain [ Str \"Level\" , Space , Str \"3\" ] ] ]\n              ]\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain [ Str \"Level\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Plain [ Str \"Level\" , Space , Str \"2\" ]\n              , BulletList\n                  [ [ Plain [ Str \"Level\" , Space , Str \"3\" ]\n                    , BulletList\n                        [ [ Plain [ Str \"Level\" , Space , Str \"4\" ] ]\n                        , [ Plain\n                              [ Str \"Level\"\n                              , Space\n                              , Str \"3.5\"\n                              , Space\n                              , Str \"???\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  , [ Plain [ Str \"Level\" , Space , Str \"3\" ] ]\n                  , [ Plain\n                        [ Str \"Level\"\n                        , Space\n                        , Str \"2.5\"\n                        , Space\n                        , Str \"???\"\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Plain [ Str \"Level\" , Space , Str \"2\" ] ]\n            , [ Plain\n                  [ Str \"Level\"\n                  , Space\n                  , Str \"1.5\"\n                  , Space\n                  , Str \"???\"\n                  ]\n              ]\n            ]\n        ]\n      , [ Plain [ Str \"Level\" , Space , Str \"1\" ] ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"This\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"closed\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"other\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"TABs\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"This\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"NOT\"\n            , Space\n            , Str \"closed\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"two\"\n            , Space\n            , Str \"comment\"\n            , Space\n            , Str \"lines\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"This\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"closed\"\n            , Space\n            , Str \"by\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"TAB,\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"then\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"comment\"\n            , Space\n            , Str \"line,\"\n            , Space\n            , Str \"then\"\n            , Space\n            , Str \"an\"\n            , Space\n            , Str \"empty\"\n            , Space\n            , Str \"line.\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain [ Str \"Level\" , Space , Str \"1\" ]\n        , BulletList\n            [ [ Plain [ Str \"Level\" , Space , Str \"2\" ]\n              , BulletList\n                  [ [ Plain [ Str \"Level\" , Space , Str \"3\" ] ] ]\n              , Plain\n                  [ Str \"-\"\n                  , SoftBreak\n                  , Str \"Level\"\n                  , Space\n                  , Str \"2\"\n                  ]\n              ]\n            ]\n        , Plain\n            [ Str \"-\" , SoftBreak , Str \"Level\" , Space , Str \"1\" ]\n        ]\n      ]\n  , Para [ Str \"-\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Empty\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"trailing\"\n            , Space\n            , Str \"spaces.\"\n            ]\n        ]\n      ]\n  , Para [ Str \"-\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Empty\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"trailing\"\n            , Space\n            , Str \"TAB.\"\n            ]\n        ]\n      ]\n  , Para [ Str \"-\" ]\n  , BulletList\n      [ [ Plain\n            [ Str \"If\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"end\"\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"file\"\n            , Space\n            , Str \"(EOF)\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"hit,\"\n            ]\n        , BulletList\n            [ [ Plain\n                  [ Str \"all\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"currently\"\n                  , Space\n                  , Str \"opened\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"are\"\n                  , Space\n                  , Str \"closed,\"\n                  ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"just\"\n                        , Space\n                        , Str \"like\"\n                        , Space\n                        , Str \"when\"\n                        , Space\n                        , Str \"using\"\n                        , Space\n                        , Str \"the\"\n                        , Space\n                        , Str \"two\"\n                        , Space\n                        , Str \"blank\"\n                        , Space\n                        , Str \"lines.\"\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header 1 ( \"table\" , [] , [] ) [ Str \"Table\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignRight , ColWidthDefault ) ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"1\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignRight , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para\n      [ Str \"||\"\n      , Space\n      , Str \"Cell\"\n      , Space\n      , Str \"1\"\n      , Space\n      , Str \"|\"\n      , Space\n      , Str \"Cell\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"|\"\n      , Space\n      , Str \"Cell\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"|\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Cell\" , Space , Str \"3\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Heading\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Heading\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Heading\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"<-\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"--\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"->\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"--\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"--\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"--\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"->\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"--\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"<-\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"1\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"2\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"3+4\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1+2+3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2+3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1+2+3+4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"7\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"8\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"A\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"B\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"D\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"E\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"F\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Jan\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Fev\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Mar\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Apr\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"May\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"20%\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"40%\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"60%\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"80%\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"100%\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"/\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      , Space\n                      , Str \"/\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"o\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"o\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \".\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"=\"\n                      , Space\n                      , Str \"=\"\n                      , Space\n                      , Str \"=\"\n                      , Space\n                      , Str \"=\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"01\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"02\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"05\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"07\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"11\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"13\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"16\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"17\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"19\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"20\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"23\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"25\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"26\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"29\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"30\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"32\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"35\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"37\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"39\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"40\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      , ( AlignCenter , ColWidthDefault )\n      ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"7\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"8\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"9\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"A\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"B\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"C\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"D\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"E\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"F\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"3\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"4\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"5\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"6\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"7\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"8\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"9\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"A\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"B\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"C\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"D\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"E\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"F\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignCenter , ColWidthDefault ) ]\n      (TableHead ( \"\" , [] , [] ) [])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  []\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Para [ Str \"|this|is|not|a|table|\" ]\n  , Para\n      [ Str \"|this|\"\n      , Space\n      , Str \"is|\"\n      , Space\n      , Str \"not|\"\n      , Space\n      , Str \"a|\"\n      , Space\n      , Str \"table|\"\n      ]\n  , Para\n      [ Str \"|this\"\n      , Space\n      , Str \"|is\"\n      , Space\n      , Str \"|not\"\n      , Space\n      , Str \"|a\"\n      , Space\n      , Str \"|table\"\n      , Space\n      , Str \"|\"\n      ]\n  , Para\n      [ Str \"|\"\n      , Space\n      , Str \"this\\t|\"\n      , Space\n      , Str \"is\\t|\"\n      , Space\n      , Str \"not\\t|\"\n      , Space\n      , Str \"a\\t|\"\n      , Space\n      , Str \"table\\t|\"\n      ]\n  , HorizontalRule\n  , Para [ Str \"The\" , Space , Str \"End.\" ]\n  ]\n"
  },
  {
    "path": "test/txt2tags.t2t",
    "content": "Txt2tags Markup Rules\nauthor\ndate\n%!includeconf: rules.conf\n\nThis document describes all the details about each txt2tags mark.\nThe target audience are **experienced** users. You may find it\nuseful if you want to master the marks or solve a specific problem\nabout a mark.\n\nIf you are new to txt2tags or just want to know which are the\navailable marks, please read the [Markup Demo MARKUPDEMO].\n\nNote 1: This document is generated directly from the txt2tags\ntest-suite. All the rules mentioned here are 100% in sync with the\ncurrent program code.\n\nNote 2: A good practice is to consult [the sources rules.t2t] when\nreading, to see how the texts were made.\n\nTable of Contents:\n\n%%TOC\n\n-------------------------------------------------------------\n\n= Paragraph =[paragraph]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/paragraph.t2t\n\n\n%%% Syntax: Lines grouped together\nA paragraph is composed by one or more lines.\nA blank line (or a table, or a list) ends the\ncurrent paragraph.\n\n%%% Syntax: Leading and trailing spaces are ignored\n   Leading and trailing spaces are ignored.   \n\n%%% Syntax: A comment don't close a paragraph\nA comment line can be placed inside a paragraph.\n% this comment will be ignored\nIt will not affect it.\n\n%%% Closing: EOF closes the open paragraph\nThe end of the file (EOF) closes the\ncurrently open paragraph.\n\n= Comment =[comment]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/comment.t2t\n\n\n%%% Syntax: The % character at the line beginning (column 1)\n%glued with the % mark\n% separated from the % mark\n%      very distant from the % mark\n%%%%%%% lots of % marks\n% a blank comment, used for vertical spacing:\n%\n% NOTE: what matters is the first % being at the line beginning,\n%       the rest of the line is just ignored.\n\n%%% Syntax: Area (block)\n%%%\nYou're not seeing this.\n%%%\n\n%%% Syntax: Area (block) with trailing spaces\n%%% \t \nYou're not seeing this.\n%%%\t \n\n%%% Invalid: The % in any other position\n % not on the line beginning (at column 2)\n\nsome text     % half line comments are not allowed\n\n\n= Line =[line]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/line.t2t\n\n\n%%% Syntax: At least 20 chars of - = _\n--------------------\n====================\n____________________\n%%% Syntax: Any kind of mixing is allowed\n%% Free mixing is allowed to make the line,\n%% but the first char is the identifier for\n%% the difference between separator ( - _ )\n%% and strong ( = ) lines.\n=========-----------\n-_-_-_-_-_-_-_-_-_-_\n=-=-=-=-=-=-=-=-=-=-\n=------------------=\n--------====--------\n%%% Syntax: Leading and/or trailing spaces are allowed\n   --------------------\n--------------------   \n   --------------------   \n%%% Invalid: Less than 20 chars (but strike matches)\n---------\n%%% Invalid: Strange chars (but strike matches)\n--------- ----------\n\n---------+----------\n\n( -------------------- )\n\n= Inline =[inline]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/inline.t2t\n\n\n%%% Syntax: Marks are greedy and must be \"glued\" with contents\n%% GLUED: The contents must be glued with the marks, no spaces\n%% between them. Right after the opening mark there must be a\n%% non-blank character, as well as right before the closing mark.\n%% \n%% GREEDY: If the contents boundary character is the same as\n%% the mark character, it is considered contents, not mark.\n%% So \"\"****bold****\"\" turns to \"\"<B>**bold**</B>\"\" in HTML.\n\ni) **b**         //i//         __u__         --s--         ``m``         \"\"r\"\"        ''t''\ni) **bo**        //it//        __un__        --st--        ``mo``        \"\"ra\"\"       ''tg''\ni) **bold**      //ital//      __undr__      --strk--      ``mono``      \"\"raw\"\"      ''tggd''\ni) **bo ld**     //it al//     __un dr__     --st rk--     ``mo no``     \"\"r aw\"\"     ''tg gd''\ni) **bo * ld**   //it / al//   __un _ dr__   --st - rk--   ``mo ` no``   \"\"r \" aw\"\"   ''tg ' gd''\ni) **bo **ld**   //it //al//   __un __dr__   --st --rk--   ``mo ``no``   \"\"r \"\"aw\"\"   ''tg ''gd''\ni) **bo ** ld**  //it // al//  __un __ dr__  --st -- rk--  ``mo `` no``  \"\"r \"\" aw\"\"  ''tg '' gd''\ni) ****bold****  ////ital////  ____undr____  ----strk----  ````mono````  \"\"\"\"raw\"\"\"\"  ''''tggd''''\ni) ***bold***    ///ital///    ___undr___    ---strk---    ```mono```    \"\"\"raw\"\"\"    '''tggd'''\n\n%%% Syntax: Repetition is greedy\n%% When the mark character is repeated many times,\n%% the contents are expanded to the largest possible.\n%% That's why they are greedy, the outer marks are\n%% the ones used.\n\ni)  *****         /////         _____         -----         `````        \"\"\"\"\"        '''''\ni)  ******        //////        ______        ------        ``````       \"\"\"\"\"\"       ''''''\ni)  *******       ///////       _______       -------       ```````      \"\"\"\"\"\"\"      '''''''\ni)  ********      ////////      ________      --------      ````````     \"\"\"\"\"\"\"\"     ''''''''\ni)  *********     /////////     _________     ---------     `````````    \"\"\"\"\"\"\"\"\"    '''''''''\ni)  **********    //////////    __________    ----------    ``````````   \"\"\"\"\"\"\"\"\"\"   ''''''''''\n\n%%% Invalid: No contents\n\ni)     ****          ////          ____          ----          ````       \"\"\"\"       ''''\ni)     ** **         // //         __ __         -- --         `` ``      \"\" \"\"      '' ''\n\n%%% Invalid: Contents not \"glued\" with marks\n%% Spaces between the marks and the contents in any side\n%% invalidate the mark.\n\ni)  ** bold**     // ital//     __ undr__     -- strk--     `` mono``     \"\" raw\"\"     '' tggd''\ni)  **bold **     //ital //     __undr __     --strk --     ``mono ``     \"\"raw \"\"     ''tggd ''\ni)  ** bold **    // ital //    __ undr __    -- strk --    `` mono ``    \"\" raw \"\"    '' tggd ''\n\n= Link =[link]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/link.t2t\n\n\n%%% Syntax: E-mail\nuser@domain.com\nuser@domain.com.\nuser@domain.com. any text.\nany text: user@domain.com. any text.\n[label user@domain.com]\n%%% Syntax: E-mail with form data\nuser@domain.com?subject=bla\nuser@domain.com?subject=bla.\nuser@domain.com?subject=bla,\nuser@domain.com?subject=bla&cc=otheruser@domain.com\nuser@domain.com?subject=bla&cc=otheruser@domain.com.\nuser@domain.com?subject=bla&cc=otheruser@domain.com,\n[label user@domain.com?subject=bla&cc=otheruser@domain.com].\n[label user@domain.com?subject=bla&cc=otheruser@domain.com.].\n%%% Syntax: URL\nhttp://www.domain.com\nhttp://www.domain.com/dir/\nhttp://www.domain.com/dir///\nhttp://www.domain.com.\nhttp://www.domain.com,\nhttp://www.domain.com. any text.\nhttp://www.domain.com, any text.\nhttp://www.domain.com/dir/. any text.\nany text: http://www.domain.com. any text.\nany text: http://www.domain.com/dir/. any text.\nany text: http://www.domain.com/dir/index.html. any text.\nany text: http://www.domain.com/dir/index.html, any text.\n%%% Syntax: URL with anchor\nhttp://www.domain.com/dir/#anchor\nhttp://www.domain.com/dir/index.html#anchor\nhttp://www.domain.com/dir/index.html#anchor.\nhttp://www.domain.com/dir/#anchor. any text.\nhttp://www.domain.com/dir/index.html#anchor. any text.\nany text: http://www.domain.com/dir/#anchor. any text.\nany text: http://www.domain.com/dir/index.html#anchor. any text.\n%%% Syntax: URL with form data\nhttp://domain.com?a=a@a.a&b=a+b+c.\nhttp://domain.com?a=a@a.a&b=a+b+c,\nhttp://domain.com/bla.cgi?a=a@a.a&b=a+b+c.\nhttp://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.\n%%% Syntax: URL with form data and anchor\nhttp://domain.com?a=a@a.a&b=a+b+c.#anchor\nhttp://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\nhttp://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor\n%%% Syntax: URL with login data\nhttp://user:password@domain.com/bla.html.\nhttp://user:password@domain.com/dir/.\nhttp://user:password@domain.com.\nhttp://user:@domain.com.\nhttp://user@domain.com.\n%%% Syntax: URL with login, form and anchor\nhttp://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor\nhttp://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor\n%%% Syntax: URL with label\n[label www.domain.com]\n%%% Syntax: URL with label (trailing spaces are discarded, leading are maintained)\n%TODO normalize this behavior\n[  label www.domain.com]\n[label   www.domain.com]\n%%% Syntax: URL with label, stressing\n[anchor        http://www.domain.com/dir/index.html#anchor.]\n[login         http://user:password@domain.com/bla.html]\n[form          http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.]\n[form & anchor http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor]\n[login & form  http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.]\n%%% Syntax: Link with label for local files\n[local link up          ..]\n[local link file        bla.html]\n[local link anchor      #anchor]\n[local link file/anchor bla.html#anchor]\n[local link file/anchor bla.html#anchor.]\n[local link img         abc.gif]\n%%% Syntax: Another link as a label\n[www.fake.com www.domain.com]\n%%% Syntax: URL with funny chars\nhttp://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm\nhttp://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-\nhttp://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_-1%.\nhttp://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_-1%.\n%%% Test: Various per line\nhttp://L1.com ! L2@www.com ! [L3 www.com] ! [L4 w@ww.com] ! www.L5.com\n%%% Feature: Guessed link, adding protocol automatically\nwww.domain.com\nwww2.domain.com\nftp.domain.com\nWWW.DOMAIN.COM\nFTP.DOMAIN.COM\n[label www.domain.com]\n[label ftp.domain.com]\n[label WWW.DOMAIN.COM]\n[label FTP.DOMAIN.COM]\n%%% Invalid: Trailing space on link\n[label www.domain.com ]\n%%% Invalid: Label with ] char (use postproc)\n[label] www.domain.com]\n\n= Image =[image]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/image.t2t\n\n\n%%% Syntax: Image name inside brackets: [img]\n[img.png]\n\n%%% Syntax: Image pointing to a link: [[img] link]\n[[img.png] https://txt2tags.org]\n\n%%% Align: Image position is preserved when inside paragraph\n[img.png] Image at the line beginning.\n\nImage in the middle [img.png] of the line.\n\nImage at the line end. [img.png]\n\n%%% Align: Image alone with spaces around is aligned\n[img.png]   \n                [img.png]  \n                                    [img.png]\n\n%%% Test: Two glued images with no spaces (left & right)\n[img.png][img.png]\n\n%%% Test: Various per line\nImages [img.png] mixed [img.png] with [img.png] text.\n\nImages glued together: [img.png][img.png][img.png].\n\n%%% Invalid: Spaces inside are not allowed\n[img.png ]\n\n[ img.png]\n\n[ img.png ]\n\n% Ignored as they change every time when run\n\n= Numbered Title =[numtitle]\n\n%%% Syntax: Balanced equal signs (from 1 to 5)\n+ Title Level 1 +\n++ Title Level 2 ++\n+++ Title Level 3 +++\n++++ Title Level 4 ++++\n+++++ Title Level 5 +++++\n%%% Label: Between brackets, alphanumeric [A-Za-z0-9_-]\n+ Title Level 1 +[lab_el-1]\n++ Title Level 2 ++[lab_el-2]\n+++ Title Level 3 +++[lab_el-3]\n++++ Title Level 4 ++++[lab_el-4]\n+++++ Title Level 5 +++++[lab_el-5]\n%%% Syntax: Spaces around and/or inside are allowed (and ignored)\n     +++Title Level 3+++    \n    +++ Title Level 3 +++    \n   +++  Title Level 3  +++   \n+++     Title Level 3      +++\n+++          Title Level 3 +++\n   +++  Title Level 3  +++[lab_el-9]   \n%%% Invalid: Unbalanced equal signs\n      +Not Title\n\n     ++Not Title+\n\n    +++Not Title++++\n%%% Invalid: Level deeper than 5\n ++++++Not Title 6++++++\n\n+++++++Not Title 7+++++++\n%%% Invalid: Space between title and label\n+Not Title+ [label1]\n%%% Invalid: Space inside label\n+Not Title+[ label ]\n%%% Invalid: Strange chars inside label\n+Not Title+[la/bel]\n\n= Title =[title]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/title.t2t\n\n\n%%% Syntax: Balanced equal signs (from 1 to 5)\n= Title Level 1 =\n== Title Level 2 ==\n=== Title Level 3 ===\n==== Title Level 4 ====\n===== Title Level 5 =====\n%%% Label: Between brackets, alphanumeric [A-Za-z0-9_-]\n= Title Level 1 =[lab_el-1]\n== Title Level 2 ==[lab_el-2]\n=== Title Level 3 ===[lab_el-3]\n==== Title Level 4 ====[lab_el-4]\n===== Title Level 5 =====[lab_el-5]\n%%% Syntax: Spaces around and/or inside are allowed (and ignored)\n     ===Title Level 3===    \n    === Title Level 3 ===    \n   ===  Title Level 3  ===   \n===     Title Level 3      ===\n===          Title Level 3 ===\n   ===  Title Level 3  ===[lab_el-9]   \n%%% Invalid: Unbalanced equal signs\n      =Not Title\n\n     ==Not Title=\n\n    ===Not Title====\n%%% Invalid: Level deeper than 5\n ======Not Title 6======\n\n=======Not Title 7=======\n%%% Invalid: Space between title and label\n=Not Title= [label1]\n%%% Invalid: Space inside label\n=Not Title=[ label ]\n%%% Invalid: Strange chars inside label\n=Not Title=[la/bel]\n\n= Quote =[quote]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/quote.t2t\n\n\n\tTo quote a paragraph, just prefix it by a TAB\n\tcharacter. All the lines of the paragraph must\n\tbegin with a TAB.\nAny non-tabbed line closes the quote block.\n\n%%% Nesting: Creating deeper quotes\n\tThe number of leading TABs identifies the quote\n\tblock depth. This is quote level 1.\n\t\tWith two TABs, we are on the quote\n\t\tlevel 2.\n\t\t\tThe more TABs, more deep is\n\t\t\tthe quote level.\n\t\t\t\tThere isn't a limit.\n\n%%% Nesting: Reverse nesting works\n\t\t\t\tThis quote starts at\n\t\t\t\tlevel 4.\n\t\t\tThen its depth is decreased.\n\t\tCounting down, one by one.\n\tUntil the level 1.\n\n%%% Nesting: Random count\n\t\t\tUnlike lists, any quote block is\n\t\t\tindependent, not part of a tree.\n\tThe TAB count don't need to be incremental\n\tby one.\n\t\t\t\tThe nesting don't need\n\t\t\t\tto follow any rule.\n\t\tQuotes can be opened and closed\n\t\tin any way.\n\t\t\t\t\tYou choose.\n\n%%% Nesting: When not supported\n\tSome targets (as sgml) don't support the\n\tnesting of quotes. There is only one quote\n\tlevel.\n\t\tIn this case, no matter how much\n\t\tTABs are used to define the quote\n\t\tblock, it always will be level 1.\n\n%%% Syntax: Spaces after TAB\n\t  Spaces AFTER the TAB character are allowed.\n\t  But be careful, it can be confusing.\n\n%%% Invalid: Spaces before TAB\n  \tSpaces BEFORE the TAB character\n  \tinvalidate the mark. It's not quote.\n\n%%% Invalid: Paragraphs inside\n\tParagraph breaks inside a quote aren't\n\tpossible.\n\t\n\tThis sample are two separated quoted\n\tparagraphs, not a quote block with\n\ttwo paragraphs inside.\n\n%%% Closing: EOF closes the open block\n\tThe end of the file (EOF) closes the\n\tcurrently open quote block.\n\n= Raw =[raw]\n\n%%% Syntax: A single line \n\"\"\" A raw line.\n\n%%% Syntax: A single line with leading spaces\n\"\"\"   Another raw line, with leading spaces.\n\n%%% Syntax: Area (block)\n\"\"\"\nA raw area delimited\n       by lines with marks.\n\"\"\"\n\n%%% Syntax: Area (block) with trailing spaces\n\"\"\" \t \nTrailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n\"\"\"\t \n\n%%% Invalid: No space between mark and contents\n\"\"\"Not a raw line, need one space after mark.\n\n%%% Invalid: Leading spaces on block marks\n  \"\"\"\n  Not a raw area.\n  The marks must be at the line beginning,\n  no leading spaces.\n  \"\"\"\n\n%%% Closing: EOF closes the open block\n\"\"\"\nThe end of the file (EOF) closes\nthe currently open raw area.\n\"\"\"\n\n= Verbatim =[verbatim]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/verbatim.t2t\n\n\n%%% Syntax: A single line \n``` A verbatim line.\n\n%%% Syntax: A single line with leading spaces\n```   Another verbatim line, with leading spaces.\n\n%%% Syntax: Area (block)\n```\nA verbatim area delimited\n       by lines with marks.\n```\n\n%%% Syntax: Area (block) with trailing spaces\n``` \t \nTrailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n```\t \n\n%%% Invalid: No space between mark and contents\n```Not a verbatim line, need one space after mark.\n\n%%% Invalid: Leading spaces on block marks\n  ```\n  Not a verbatim area.\n  The marks must be at the line beginning,\n  no leading spaces.\n  ```\n\n%%% Closing: EOF closes the open block\n```\nThe end of the file (EOF) closes\nthe currently open verbatim area.\n```\n\n= Definition List =[deflist]\n\n: Definition list\n  A list with terms\n: Start term with colon\n  And its definition follows\n\n\n= Numbered List =[numlist]\n\nSee [List #list], the same rules apply.\n\n= List =[list]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/list.t2t\n\n\n%%% Items: Prefixed by hyphen\n- Use the hyphen to prefix list items.\n- There must be one space after the hyphen.\n- The list is closed by two consecutive blank lines.\n\n\n%%% Items: Free leading spacing (indentation)\n     - The list can be indented on the source document.\n     - You can use any number of spaces.\n     - The result will be the same.\n\n\n%%% Items: Vertical spacing between items\n- Let one blank line between the list items.\n\n- It will be maintained on the conversion.\n\n- Some targets don't support this behavior.\n\t   \t  \n- This one was separated by a line with blanks.\n  You can also put a blank line inside\n\n  the item contents and it will be preserved.\n\n\n%%% Items: Exactly ONE space after the hyphen\n-This is not a list (no space)\n\n-    This is not a list (more than one space)\n\n-\tThis is not a list (a TAB instead the space)\n\n\n%%% Items: Catchy cases\n- - This is a list\n- + This is a list\n- : This is a list\n\n\n%%% Nesting: Creating sublists\n- This is the \"mother\" list first item.\n- Here is the second, but inside this item,\n  - there is a sublist, with its own items.\n  - Note that the items of the same sublist\n  - must have the same indentation.\n    - And this can go on, opening sublists.\n      - Just add leading spaces before the\n      - hyphen and sublists will be opened.\n      - The two blank lines closes them all.\n\n\n%%% Nesting: Free leading spacing (indentation)\n- When nesting lists, the additional spaces are free.\n - You can add just one,\n        - or many.\n          - What matters is to put more than the previous.\n          - But remember that the other items of the same list\n          - must use the same indentation.\n\n\n%%% Nesting: Maximum depth\n- There is not a depth limit,\n  - you can go deeper and deeper.\n    - But some targets may have restrictions.\n      - The LaTeX maximum is here, 4 levels.\n\n\n%%% Nesting: Reverse doesn't work\n        - Reverse nesting doesn't work.\n      - Because a sublist *must* have a mother list.\n    - It's the list concept, not a txt2tags limitation.\n  - All this sublists will be bumped to mother lists.\n- At level 1, like this one.\n\n\n%%% Nesting: Going deeper and back\n\n%% When nesting back to an upper level, the previous sublist\n%% is automatically closed.\n- Level 1\n  - Level 2\n    - Level 3\n      - Level 4\n    - Level 3 -- (closed Level 4)\n  - Level 2 -- (closed Level 3)\n- Level 1 -- (closed Level 2)\n\n\n%% More than one list can be closed when nesting back.\n- Level 1\n  - Level 2\n    - Level 3\n      - Level 4\n- Level 1 -- (closed Level 4, Level 3 and Level 2)\n\n\n%%% Nesting: Vertical spacing between lists\n- Level 1\n\n  - Level 2 -- blank BEFORE and AFTER (in)\n\n    - Level 3\n% comment lines are NOT considered blank lines\n      - Level 4\n% comment lines are NOT considered blank lines\n    - Level 3\n\n  - Level 2 -- blank BEFORE and AFTER (out)\n\n- Level 1\n        \n  - Level 2 -- blank BEFORE (spaces) and AFTER (TAB)\n\t\n    - Level 3\n\n\n%%% Nesting: Messing up\n%% Be careful when going back on the nesting,\n%% it must be on a valid level! If not, it will\n%% be bumped up to the previous valid level.\n- Level 1\n    - Level 2\n        - Level 3\n            - Level 4\n          - Level 3.5 ???\n        - Level 3\n      - Level 2.5 ???\n    - Level 2\n  - Level 1.5 ???\n- Level 1\n\n\n%%% Closing: Two (not so) empty lines\n- This list is closed by a line with spaces and other with TABs\n        \n\t\n- This list is NOT closed by two comment lines\n% comment lines are NOT considered blank lines\n% comment lines are NOT considered blank lines\n- This list is closed by a line with spaces and TAB,\n- then a comment line, then an empty line.\n\t      \t\n% comment lines are NOT considered blank lines\n\n%%% Closing: Empty item closes current (sub)list\n\n%% The two blank lines closes ALL the lists.\n%% To close just the current, use an empty item.\n- Level 1\n  - Level 2\n    - Level 3\n    -\n    Level 2\n  -  \n  Level 1\n-\n\n%% The empty item can have trailing blanks.\n- Empty item with trailing spaces.\n-    \n\n- Empty item with trailing TAB.\n-\t\n\n%%% Closing: EOF closes the lists\n- If the end of the file (EOF) is hit,\n  - all the currently opened list are closed,\n    - just like when using the two blank lines.\n\n\n= Table =[table]\n\n%INCLUDED(t2t) starts here: ../../../test/marks/table.t2t\n\n%%% Syntax: Lines starting with a pipe |\n| Cell 1\n\n%%% Syntax: Extra pipes separate cells\n| Cell 1 | Cell 2 | Cell 3\n\n%%% Syntax: With a trailing pipe, make border\n| Cell 1 | Cell 2 | Cell 3 |\n\n%%% Syntax: Table lines starting with double pipe are heading\n|| Cell 1 | Cell 2 | Cell 3 |\n\n%%% Align: Spaces before the leading pipe centralize the table\n   | Cell 1 | Cell 2 | Cell 3 |\n\n%%% Align: Spaces inside the cell denote its alignment\n   || Heading | Heading | Heading |\n% comments don't close an opened table   \n   | <-     |   --   |     -> |\n   |   --   |   --   |   --   |\n   |     -> |   --   | <-     |\n\n%%% Span: Column span is defined by extra pipes at cell closing\n   || 1  |  2  |    3+4   ||\n   |  1  |  2  |  3  |  4  |\n   |      1+2+3    |||  4  |\n   |  1  |    2+3   ||  4  |\n   |        1+2+3+4     ||||\n\n%%% Test: Empty cells are placed as expected\n   | 0 | 1 | 2 |   |\n   | 4 | 5 |   | 7 |\n   | 8 |   | A | B |\n   |   | D | E | F |\n\n%%% Test: Lines with different number of cells\n   | 1 |\n   | 1 | 2 |\n   | 1 | 2 | 3 |\n   | 1 | 2 | 3 | 4 |\n   | 1 | 2 | 3 | 4 | 5 |\n\n%%% Test: Empty cells + Span + Messy cell number = Fun!\n   |   Jan |\n   |   Fev ||\n   |   Mar |||\n   |   Apr ||||\n   |   May |||||\n   |  20%  |  40%  |  60%  |  80%  |  100%  |\n\n   |   |     |  /  |     |    |\n   |   |   / / / / /     |||  |\n   |  / / / / / / / / /  |||||\n   |   |  o  |     |  o  |    |\n   |   |     |   . |     |    |\n   |   |    = = = =    |||    |\n\n   | 01 | 02 |    |    | 05 |    | 07 |    |\n   |    |    | 11 |    | 13 |    |    | 16 |\n   | 17 |    | 19 | 20 |    |    | 23 |    |\n   | 25 | 26 |    |    | 29 | 30 |    | 32 |\n   |    |    | 35 |    | 37 |    | 39 | 40 |\n\n%%% Test: Lots of cells at the same line\n| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |\n\n%%% Test: Empty lines\n|   |\n|  |\n| |\n\n%%% Invalid: There must be at least one space around the pipe\n|this|is|not|a|table|\n\n|this| is| not| a| table|\n\n|this |is |not |a |table |\n\n%%% Invalid: You must use spaces, not TABs\n|\tthis\t|\tis\t|\tnot\t|\ta\t|\ttable\t|\n\n------------------------------------------------------------\n\nThe End.\n"
  },
  {
    "path": "test/typst-reader.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header\n      1\n      ( \"\" , [] , [] )\n      [ Str \"Fibonacci\" , Space , Str \"sequence\" ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"Fibonacci\"\n      , Space\n      , Str \"sequence\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"defined\"\n      , Space\n      , Str \"through\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"recurrence\"\n      , Space\n      , Str \"relation\"\n      , Space\n      , Math InlineMath \"F_{n} = F_{n - 1} + F_{n - 2}\"\n      , Str \".\"\n      , SoftBreak\n      , Str \"It\"\n      , Space\n      , Str \"can\"\n      , Space\n      , Str \"also\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"expressed\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Emph [ Str \"closed\" , Space , Str \"form:\" ]\n      ]\n  , Para\n      [ Math\n          DisplayMath\n          \"F_{n} = \\\\left\\\\lfloor {\\\\frac{1}{\\\\sqrt{5}}\\\\phi^{n}} \\\\right\\\\rceil,\\\\quad\\\\phi = \\\\frac{1 + \\\\sqrt{5}}{2}\"\n      ]\n  , Para\n      [ Str \"The\"\n      , Space\n      , Str \"first\"\n      , Space\n      , Str \"8\"\n      , Space\n      , Str \"numbers\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"sequence\"\n      , Space\n      , Str \"are:\"\n      ]\n  , Div\n      ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{1}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{2}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{3}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{4}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{5}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{6}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{7}\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Math InlineMath \"F_{8}\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"1\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"2\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"3\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"5\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"8\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"13\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para [ Str \"21\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Div\n      ( \"\" , [ \"columns-flow\" ] , [ ( \"count\" , \"2\" ) ] )\n      [ Para\n          [ Span\n              ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ SoftBreak\n                  , Strong\n                      [ Str \"Typst\"\n                      , Space\n                      , Str \"Math\"\n                      , Space\n                      , Str \"for\"\n                      , Space\n                      , Str \"Undergrads\"\n                      ]\n                  , SoftBreak\n                  ]\n                  ( \"https://github.com/johanvx/typst-undergradmath\"\n                  , \"\"\n                  )\n              ]\n          ]\n      , Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"Typst\"\n          , Space\n          , Str \"port\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Emph\n              [ Span\n                  ( \"\" , [ \"box\" ] , [] )\n                  [ Str \"L\\8202A\\8202\"\n                  , Span ( \"\" , [ \"box\" ] , [] ) [ Str \"T\\8202E\\8202X\" ]\n                  ]\n              , Space\n              , Str \"Math\"\n              , Space\n              , Str \"for\"\n              , Space\n              , Str \"Undergrads\"\n              ]\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"Jim\"\n          , Space\n          , Str \"Hefferon.\"\n          , SoftBreak\n          , Str \"The\"\n          , Space\n          , Str \"original\"\n          , Space\n          , Str \"version\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"available\"\n          , Space\n          , Str \"at\"\n          , Space\n          , Underline\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"https://gitlab.com/jim.hefferon/undergradmath\"\n                  ]\n                  ( \"https://gitlab.com/jim.hefferon/undergradmath\"\n                  , \"\"\n                  )\n              ]\n          , Str \".\"\n          ]\n      , Para\n          [ Strong\n              [ Str \"Meaning\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"annotations\\8192\\160\"\n              ]\n          ]\n      , Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidth 0.3333333333333333 )\n          , ( AlignLeft , ColWidth 0.6666666666666666 )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para\n                          [ Span\n                              ( \"\" , [ \"box\" ] , [] )\n                              [ Str \"2023-05-22\"\n                              , Space\n                              , Str \"\\10060\"\n                              ]\n                          ]\n                      ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para\n                          [ Str \"This\"\n                          , Space\n                          , Str \"is\"\n                          , Space\n                          , Str \"unavailable.\"\n                          , Space\n                          , Str \"Last\"\n                          , Space\n                          , Str \"check\"\n                          , Space\n                          , Str \"date\"\n                          , Space\n                          , Str \"is\"\n                          , Space\n                          , Str \"2023-05-22.\"\n                          ]\n                      ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      , Para [ Span ( \"unavailable\" , [] , [] ) [] ]\n      , Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidth 0.3333333333333333 )\n          , ( AlignLeft , ColWidth 0.6666666666666666 )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para\n                          [ Span\n                              ( \"\" , [ \"box\" ] , [] ) [ Str \"\\128166\" ]\n                          ]\n                      ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para\n                          [ Str \"Get\"\n                          , Space\n                          , Str \"this\"\n                          , Space\n                          , Str \"in\"\n                          , Space\n                          , Str \"a\"\n                          , Space\n                          , Str \"tricky\"\n                          , Space\n                          , Str \"way.\"\n                          , Space\n                          , Str \"Need\"\n                          , Space\n                          , Str \"a\"\n                          , Space\n                          , Str \"simpler\"\n                          , Space\n                          , Str \"method.\"\n                          ]\n                      ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      , Para [ Span ( \"tricky\" , [] , [] ) [] ]\n      , Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignLeft , ColWidth 0.3333333333333333 )\n          , ( AlignLeft , ColWidth 0.6666666666666666 )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para\n                          [ Span\n                              ( \"\" , [ \"box\" ] , [] )\n                              [ Str \"No\"\n                              , Space\n                              , Str \"idea\"\n                              , Space\n                              , Str \"\\128533\"\n                              ]\n                          ]\n                      ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Para\n                          [ Str \"Don\\8217t\"\n                          , Space\n                          , Str \"know\"\n                          , Space\n                          , Str \"how\"\n                          , Space\n                          , Str \"to\"\n                          , Space\n                          , Str \"get\"\n                          , Space\n                          , Str \"this.\"\n                          ]\n                      ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      , Para [ Span ( \"noidea\" , [] , [] ) [] ]\n      , Para\n          [ Strong [ Str \"Rule\" , Space , Str \"One\\8192\\160\" ]\n          , Str \"Any\"\n          , Space\n          , Str \"mathematics\"\n          , Space\n          , Str \"at\"\n          , Space\n          , Str \"all,\"\n          , Space\n          , Str \"even\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"single\"\n          , Space\n          , Str \"character,\"\n          , Space\n          , Str \"gets\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"mathematical\"\n          , Space\n          , Str \"setting.\"\n          , SoftBreak\n          , Str \"Thus,\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"\\8220the\"\n          , Space\n          , Str \"value\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Math InlineMath \"x\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Math InlineMath \"7\"\n          , Str \"\\8221\"\n          , Space\n          , Str \"enter\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"the value of $x$ is $7$\"\n          , Str \".\"\n          ]\n      , Para\n          [ Strong [ Str \"Template\\8192\\160\" ]\n          , Str \"Your\"\n          , Space\n          , Str \"document\"\n          , Space\n          , Str \"should\"\n          , Space\n          , Str \"contain\"\n          , Space\n          , Str \"at\"\n          , Space\n          , Str \"least\"\n          , Space\n          , Str \"this.\"\n          ]\n      , Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      []\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ CodeBlock\n                          ( \"\" , [] , [] ) \"-- document body here --\"\n                      ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      , Para\n          [ Strong\n              [ Str \"Common\" , Space , Str \"constructs\\8192\\160\" ]\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"x^{2}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"x^2\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sqrt{2}\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\sqrt[n]{3}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sqrt(2)\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"root(n, 3)\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"x_{i,j}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"x_(i, j)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\frac{2}{3}\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"2/3\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"2 / 3\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"2 \\\\/ 3\"\n                                  , Space\n                                  , Str \"or\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"2 slash 3\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Strong\n              [ Str \"Calligraphic\" , Space , Str \"letters\\8192\\160\" ]\n          , Str \"Use\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"$cal(A)$\"\n          , Str \".\"\n          ]\n      , Para\n          [ Math DisplayMath \"\\\\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\" ]\n      , Para\n          [ Str \"Getting\"\n          , Space\n          , Str \"script\"\n          , Space\n          , Str \"letters\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Link\n              ( \"\" , [ \"ref\" ] , [] )\n              [ Str \"[unavailable]\" ]\n              ( \"#unavailable\" , \"\" )\n          , Str \".\"\n          ]\n      , Para [ Strong [ Str \"Greek\\8192\\160\" ] ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\alpha\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"alpha\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\xi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Xi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"xi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Xi\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\beta\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"beta\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\959\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"omicron\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\gamma\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Gamma\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"gamma\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Gamma\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\pi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Pi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"pi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Pi\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\delta\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Delta\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"delta\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Delta\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varpi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"pi.alt\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\epsilon\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"epsilon.alt\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\rho\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"rho\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varepsilon\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"epsilon\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varrho\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"rho.alt\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\zeta\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"zeta\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sigma\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Sigma\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sigma\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Sigma\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\eta\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"eta\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varsigma\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"\\\\u{03C2}\"\n                                  , Space\n                                  , Link\n                                      ( \"\" , [ \"ref\" ] , [] )\n                                      [ Str \"[tricky]\" ]\n                                      ( \"#tricky\" , \"\" )\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\theta\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Theta\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"theta\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Theta\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\tau\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tau\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\vartheta\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"theta.alt\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\upsilon\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Upsilon\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"upsilon\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Upsilon\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\iota\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"iota\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\phi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Phi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"phi.alt\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Phi\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\kappa\"\n                                  , Str \"\\8192\"\n                                  , Math InlineMath \"\\922\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varphi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"phi\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\lambda\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Lambda\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"lambda\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Lambda\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\chi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"chi\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mu\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"mu\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\psi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Psi\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"psi\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Psi\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\nu\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"nu\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\omega\"\n                                  , Str \",\"\n                                  , Space\n                                  , Math InlineMath \"\\\\Omega\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"omega\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"Omega\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Strong\n              [ Str \"Sets\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"logic\\8192\\160\"\n              ]\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cup\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"union\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mathbb{R}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"RR\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"bb(R)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\forall\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"forall\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cap\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sect\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mathbb{Z}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"ZZ\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"bb(Z)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\exists\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"exists\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\subset\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"subset\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mathbb{Q}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"QQ\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"bb(Q)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\neg\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"not\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\subseteq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"subset.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mathbb{N}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"NN\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"bb(N)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\vee\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"or\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\supset\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"supset\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mathbb{C}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"CC\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"bb(C)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\land\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"and\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\supseteq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"supset.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varnothing\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"diameter\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\vdash\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tack.r\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\in\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"in\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\varnothing\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"nothing\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\models\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"models\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\notin\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"in.not\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\1488\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"alef\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\smallsetminus\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"without\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"Negate\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"operator,\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Math InlineMath \"\\8836\"\n          , Str \",\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"subset.not\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"Get\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"set\"\n          , Space\n          , Str \"complement\"\n          , Space\n          , Math InlineMath \"A^{\\\\mathsf{c}}\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"A^(sans(c))\"\n          , Space\n          , Str \"(or\"\n          , Space\n          , Math InlineMath \"A^{\\\\complement}\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"A^(complement)\"\n          , Str \",\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Math InlineMath \"\\\\overline{A}\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"overline(A)\"\n          , Str \").\"\n          ]\n      , DefinitionList\n          [ ( [ Str \"Remark\" ]\n            , [ [ Para\n                    [ Str \"Using\"\n                    , Space\n                    , Code ( \"\" , [] , [] ) \"diameter\"\n                    , Space\n                    , Str \"for\"\n                    , Space\n                    , Code ( \"\" , [] , [] ) \"\\\\varnothing\"\n                    , Space\n                    , Str \"may\"\n                    , Space\n                    , Str \"cause\"\n                    , Space\n                    , Str \"some\"\n                    , Space\n                    , Str \"confusion.\"\n                    , Space\n                    , Str \"However,\"\n                    , Space\n                    , Span\n                        ( \"\" , [ \"box\" ] , [] )\n                        [ Str \"L\\8202A\\8202\"\n                        , Span\n                            ( \"\" , [ \"box\" ] , [] )\n                            [ Str \"T\\8202E\\8202X\" ]\n                        ]\n                    , Space\n                    , Str \"also\"\n                    , Space\n                    , Str \"uses\"\n                    , Space\n                    , Math InlineMath \"\\\\varnothing\"\n                    , Space\n                    , Str \"(\"\n                    , Code ( \"\" , [] , [] ) \"\\\\u{2300}\"\n                    , Str \")\"\n                    , Space\n                    , Str \"instead\"\n                    , Space\n                    , Str \"of\"\n                    , Space\n                    , Math InlineMath \"\\\\varnothing\"\n                    , Space\n                    , Str \"(\"\n                    , Code ( \"\" , [] , [] ) \"\\\\u{2205}\"\n                    , Str \"),\"\n                    , Space\n                    , Str \"see\"\n                    , Space\n                    , Underline\n                        [ Link\n                            ( \"\" , [] , [] )\n                            [ Str \"newcm\"\n                            , Space\n                            , Math InlineMath \"\\167\"\n                            , Str \"13.3\"\n                            ]\n                            ( \"https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf\"\n                            , \"\"\n                            )\n                        ]\n                    , Str \".\"\n                    , SoftBreak\n                    , Str \"Another\"\n                    , Space\n                    , Str \"solution\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"to\"\n                    , Space\n                    , Str \"use\"\n                    , Space\n                    , Code\n                        ( \"\" , [] , [] )\n                        \"text(font: \\\"Fira Sans\\\", nothing)\"\n                    , Str \",\"\n                    , Space\n                    , Str \"but\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"resultant\"\n                    , Space\n                    , Str \"glyph\"\n                    , Space\n                    , Math InlineMath \"\\\\varnothing\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"subtly\"\n                    , Space\n                    , Str \"different\"\n                    , Space\n                    , Str \"from\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"widely\"\n                    , Space\n                    , Str \"used\"\n                    , Space\n                    , Str \"one.\"\n                    , SoftBreak\n                    , Str \"Ultimately,\"\n                    , Space\n                    , Str \"the\"\n                    , Space\n                    , Str \"choice\"\n                    , Space\n                    , Str \"is\"\n                    , Space\n                    , Str \"always\"\n                    , Space\n                    , Strong [ Str \"your\" , Space , Str \"decision\" ]\n                    , Str \".\"\n                    ]\n                ]\n              ]\n            )\n          ]\n      , Para [ Strong [ Str \"Decorations\\8192\\160\" ] ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"f'\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"f'\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"f prime\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\dot{a}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"dot(a)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\widetilde{a}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tilde(a)\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"f''\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"f prime.double\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ddot{a}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"diaer(a)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\overline{a}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"macron(a)\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\Sigma^{\\\\ast}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"Sigma^*\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\hat{a}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"hat(a)\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath\n                                      \"\\\\overset{\\\\rightarrow}{a}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arrow(a)\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"If\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"decorated\"\n          , Space\n          , Str \"letter\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Math InlineMath \"i\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Math InlineMath \"j\"\n          , Space\n          , Str \"then\"\n          , Space\n          , Str \"some\"\n          , Space\n          , Str \"decorations\"\n          , Space\n          , Str \"need\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"\\\\u{1D6A4}\"\n          , Space\n          , Link\n              ( \"\" , [ \"ref\" ] , [] )\n              [ Str \"[tricky]\" ]\n              ( \"#tricky\" , \"\" )\n          , Space\n          , Str \"and\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"\\\\u{1D6A5}\"\n          , Space\n          , Link\n              ( \"\" , [ \"ref\" ] , [] )\n              [ Str \"[tricky]\" ]\n              ( \"#tricky\" , \"\" )\n          , Str \",\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Math InlineMath \"\\\\overset{\\\\rightarrow}{\\\\imath}\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"arrow(\\\\u{1D6A4})\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"Some\"\n          , Space\n          , Str \"authors\"\n          , Space\n          , Str \"use\"\n          , Space\n          , Str \"boldface\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"vectors:\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"bold(x)\"\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"Entering\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"overline(x + y)\"\n          , Space\n          , Str \"produces\"\n          , Space\n          , Math InlineMath \"\\\\overline{x + y}\"\n          , Str \",\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"hat(x + y)\"\n          , Space\n          , Str \"gives\"\n          , Space\n          , Math InlineMath \"\\\\hat{x + y}\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"Comment\"\n          , Space\n          , Str \"on\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"expression\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"here\"\n          , Space\n          , Str \"(there\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"also\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"overbrace(..)\"\n          , Str \").\"\n          ]\n      , Para\n          [ Span\n              ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n              [ Span\n                  ( \"\" , [ \"box\" ] , [] )\n                  [ Math\n                      InlineMath \"\\\\underset{|A|}{\\\\underbrace{x + y}}\"\n                  , Str \"\\8192\"\n                  , Code ( \"\" , [] , [] ) \"underbrace(x + y, |A|)\"\n                  ]\n              ]\n          ]\n      , Para\n          [ Strong [ Str \"Dots\\8192\\160\" ]\n          , Str \"Use\"\n          , Space\n          , Str \"low\"\n          , Space\n          , Str \"dots\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"list\"\n          , Space\n          , Math InlineMath \"\\\\left\\\\{ 0,1,2,\\\\ldots \\\\right\\\\}\"\n          , Str \",\"\n          , Space\n          , Str \"entered\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"{0, 1, 2, ...}\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"Use\"\n          , Space\n          , Str \"centered\"\n          , Space\n          , Str \"dots\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"sum\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Str \"product\"\n          , Space\n          , Math InlineMath \"1 + \\\\cdots + 100\"\n          , Str \",\"\n          , Space\n          , Str \"entered\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"1 + dots.h.c + 100\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"You\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"also\"\n          , Space\n          , Str \"get\"\n          , Space\n          , Str \"vertical\"\n          , Space\n          , Str \"dots\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"dots.v\"\n          , Str \",\"\n          , Space\n          , Str \"diagonal\"\n          , Space\n          , Str \"dots\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"dots.down\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"anti-diagonal\"\n          , Space\n          , Str \"dots\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"dots.up\"\n          , Str \".\"\n          ]\n      , Para\n          [ Strong [ Str \"Roman\" , Space , Str \"names\\8192\\160\" ]\n          , Str \"Just\"\n          , Space\n          , Str \"type\"\n          , Space\n          , Str \"them!\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sin\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sin\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sinh\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sinh\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\arcsin\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arcsin\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cos\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"cos\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cosh\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"cosh\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\arccos\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arccos\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\tan\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tan\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\tanh\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tanh\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\arctan\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arctan\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sec\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sec\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\coth\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"coth\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\min\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"min\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\csc\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"csc\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\det\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"det\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\max\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"max\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cot\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"cot\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\dim\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"dim\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\inf\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"inf\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\exp\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"exp\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ker\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"ker\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sup\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sup\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\log\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"log\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\deg\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"deg\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\liminf\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"liminf\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ln\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"ln\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\arg\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arg\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\limsup\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"limsup\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\lg\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"lg\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\gcd\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"gcd\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\lim\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"lim\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Strong [ Str \"Other\" , Space , Str \"symbols\\8192\\160\" ] ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"<\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"<\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"lt\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\angle\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"angle\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cdot\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"dot\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\leq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"<=\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"lt.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\measuredangle\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"angle.arc\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\pm\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"plus.minus\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \">\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \">\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"gt\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ell\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"ell\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mp\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"minus.plus\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\geq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \">=\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"gt.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\parallel\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"parallel\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\times\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"times\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\neq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"!=\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"eq.not\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"45{^\\\\circ}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"45 degree\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\div\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"div\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ll\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"<<\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"lt.double\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\cong\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tilde.equiv\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ast\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"*\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"ast\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\gg\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \">>\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"gt.double\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ncong\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"tilde.equiv.not\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mid\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"divides\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\approx\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"approx\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sim\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tilde\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\nmid\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"divides.not\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\asymp\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"\\\\u{224D}\"\n                                  , Space\n                                  , Link\n                                      ( \"\" , [ \"ref\" ] , [] )\n                                      [ Str \"[tricky]\" ]\n                                      ( \"#tricky\" , \"\" )\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\simeq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tilde.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"n!\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"n!\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\equiv\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"equiv\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\nsim\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"tilde.not\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\partial\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"diff\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\prec\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"prec\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\oplus\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"plus.circle\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\nabla\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"nabla\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\preceq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"prec.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\ominus\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"minus.circle\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\295\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"planck.reduce\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\succ\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"succ\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\odot\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"dot.circle\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\circ\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] )\n                                      \"circle.stroked.tiny\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\succeq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"succ.eq\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\otimes\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"times.circle\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\star\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"star\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\propto\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"prop\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\oslash\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"\\\\u{2298}\"\n                                  , Space\n                                  , Link\n                                      ( \"\" , [ \"ref\" ] , [] )\n                                      [ Str \"[tricky]\" ]\n                                      ( \"#tricky\" , \"\" )\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\sqrt{}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sqrt(\\\"\\\")\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\doteq\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"\\\\u{2250}\"\n                                  , Space\n                                  , Link\n                                      ( \"\" , [ \"ref\" ] , [] )\n                                      [ Str \"[tricky]\" ]\n                                      ( \"#tricky\" , \"\" )\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\upharpoonright\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"harpoon.tr\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\10003\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"checkmark\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"Use\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"a divides b\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"divides\"\n          , Space\n          , Str \"relation,\"\n          , Space\n          , Math InlineMath \"a \\\\mid b\"\n          , Str \",\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"a divides.not b\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"negation,\"\n          , Space\n          , Math InlineMath \"a \\\\nmid b\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"Use\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"|\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"get\"\n          , Space\n          , Str \"set\"\n          , Space\n          , Str \"builder\"\n          , Space\n          , Str \"notation\"\n          , Space\n          , Math\n              InlineMath\n              \"\\\\left\\\\{ a \\\\in S~|~a\\\\text{ is odd} \\\\right\\\\}\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"{a in S | a \\\"is odd\\\"}\"\n          , Str \".\"\n          ]\n      , Para [ Strong [ Str \"Arrows\\8192\\160\" ] ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\rightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"->\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"arrow.r\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\mapsto\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"|->\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"arrow.r.bar\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\nrightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arrow.r.not\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\longmapsto\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] )\n                                      \"arrow.r.long.bar\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\longrightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arrow.r.long\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\leftarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"<-\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code ( \"\" , [] , [] ) \"arrow.l\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\Rightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"=>\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code\n                                      ( \"\" , [] , [] ) \"arrow.r.double\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath \"\\\\longleftrightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"<-->\"\n                                  , Str \",\"\n                                  , Space\n                                  , Code\n                                      ( \"\" , [] , [] ) \"arrow.l.r.long\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\nRightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] )\n                                      \"arrow.r.double.not\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\downarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arrow.b\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\Longrightarrow\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] )\n                                      \"arrow.r.double.long\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\uparrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arrow.t\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\rightsquigarrow\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"arrow.squiggly\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\updownarrow\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"arrow.t.b\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"The\"\n          , Space\n          , Str \"right\"\n          , Space\n          , Str \"arrows\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"first\"\n          , Space\n          , Str \"column\"\n          , Space\n          , Str \"have\"\n          , Space\n          , Str \"matching\"\n          , Space\n          , Str \"left\"\n          , Space\n          , Str \"arrows,\"\n          , Space\n          , Str \"such\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"arrow.l.not\"\n          , Str \",\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"there\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"some\"\n          , Space\n          , Str \"other\"\n          , Space\n          , Str \"matches\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Str \"down\"\n          , Space\n          , Str \"arrows,\"\n          , Space\n          , Str \"etc.\"\n          ]\n      , Para\n          [ Strong\n              [ Str \"Variable-sized\"\n              , Space\n              , Str \"operators\\8192\\160\"\n              ]\n          , Str \"The\"\n          , Space\n          , Str \"summation\"\n          , Space\n          , Math InlineMath \"\\\\sum_{j = 0}^{3}j^{2}\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"sum_(j = 0)^3 j^2\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"integral\"\n          , Space\n          , Math InlineMath \"\\\\int_{x = 0}^{3}x^{2}dx\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"integral_(x = 0)^3 x^2 dif x\"\n          , Space\n          , Str \"expand\"\n          , Space\n          , Str \"when\"\n          , Space\n          , Str \"displayed.\"\n          ]\n      , Para\n          [ Math\n              DisplayMath\n              \"\\\\sum_{j = 0}^{3}j^{2}\\\\qquad\\\\int_{x = 0}^{3}x^{2}dx\"\n          ]\n      , Para\n          [ Str \"These\"\n          , Space\n          , Str \"do\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"same.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\int\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"integral\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\iiint\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"integral.triple\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\bigcup\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"union.big\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\iint\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"integral.double\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\oint\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"integral.cont\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\bigcap\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"sect.big\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para [ Strong [ Str \"Fences\\8192\\160\" ] ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"()\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"()\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\langle\\\\rangle\"\n                                  , Str \"\\8192\"\n                                  , Code\n                                      ( \"\" , [] , [] ) \"angle.l angle.r\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath \"\\\\left| {} \\\\right|\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"abs(\\\"\\\")\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math InlineMath \"\\\\lbrack\\\\rbrack\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"[]\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath\n                                      \"\\\\left\\\\lfloor {} \\\\right\\\\rfloor\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"floor(\\\"\\\")\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath\n                                      \"\\\\left\\\\| {} \\\\right\\\\|\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"norm(\\\"\\\")\"\n                                  ]\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath \"\\\\left\\\\{ \\\\right\\\\}\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"{}\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Span\n                                  ( \"\" , [ \"box\" ] , [] )\n                                  [ Math\n                                      InlineMath\n                                      \"\\\\left\\\\lceil {} \\\\right\\\\rceil\"\n                                  , Str \"\\8192\"\n                                  , Code ( \"\" , [] , [] ) \"ceil(\\\"\\\")\"\n                                  ]\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          []\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"Fix\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"size\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"lr\"\n          , Space\n          , Str \"function.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\left. \\\\left\\\\lbrack \\\\sum_{k = 0}^{n}e^{k^{2}} \\\\right\\\\rbrack \\\\right.\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"lr([sum_(k = 0)^n e^(k^2)], size: #50%)\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"To\"\n          , Space\n          , Str \"have\"\n          , Space\n          , Str \"them\"\n          , Space\n          , Str \"grow\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"enclosed\"\n          , Space\n          , Str \"formula,\"\n          , Space\n          , Str \"also\"\n          , Space\n          , Str \"use\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"lr\"\n          , Space\n          , Str \"function.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\left\\\\langle i,2^{2^{i}} \\\\right\\\\rangle\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"lr(angle.l i, 2^(2^i) angle.r)\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"Fences\"\n          , Space\n          , Str \"scale\"\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"default\"\n          , Space\n          , Str \"if\"\n          , Space\n          , Str \"entered\"\n          , Space\n          , Str \"directly\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"codepoints,\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"don\\8217t\"\n          , Space\n          , Str \"scale\"\n          , Space\n          , Str \"automatically\"\n          , Space\n          , Str \"if\"\n          , Space\n          , Str \"entered\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"symbol\"\n          , Space\n          , Str \"notation.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\left( \\\\frac{1}{n^{\\\\alpha}} \\\\right)\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock ( \"\" , [] , [] ) \"(1 / n^(alpha))\"\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath \"(\\\\frac{1}{n^{\\\\alpha}})\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"paren.l 1 / n^(alpha) paren.r\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"The\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"lr\"\n          , Space\n          , Str \"function\"\n          , Space\n          , Str \"also\"\n          , Space\n          , Str \"allows\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"scale\"\n          , Space\n          , Str \"unmatched\"\n          , Space\n          , Str \"delimiters\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"one-side\"\n          , Space\n          , Str \"fences.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\left. \\\\frac{df}{dx} \\\\right|_{x_{0}}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"lr(frac(dif f, dif x) |)_(x_0)\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Strong [ Str \"Arrays,\" , Space , Str \"Matrices\\8192\\160\" ]\n          , Str \"Get\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"matrix\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"mat\"\n          , Space\n          , Str \"function.\"\n          , Space\n          , Str \"You\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"pass\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"array\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"it.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\begin{pmatrix}\\na & b \\\\\\\\\\nc & d\\n\\\\end{pmatrix}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] ) \"$ mat(a, b; c, d) $\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"In\"\n          , Space\n          , Str \"Typst,\"\n          , Space\n          , Underline\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"array\" ]\n                  ( \"https://typst.app/docs/reference/typst/array\"\n                  , \"\"\n                  )\n              ]\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"sequence\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"values,\"\n          , SoftBreak\n          , Str \"while\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Span\n              ( \"\" , [ \"box\" ] , [] )\n              [ Str \"L\\8202A\\8202\"\n              , Span ( \"\" , [ \"box\" ] , [] ) [ Str \"T\\8202E\\8202X\" ]\n              ]\n          , Str \",\"\n          , Space\n          , Str \"array\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"matrix\"\n          , Space\n          , Str \"without\"\n          , Space\n          , Str \"fences,\"\n          , Space\n          , Str \"which\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"$mat(delim: #none, ..)$\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"Typst.\"\n          ]\n      , Para\n          [ Str \"For\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"determinant\"\n          , Space\n          , Str \"use\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"|A|\"\n          , Str \",\"\n          , Space\n          , Str \"text\"\n          , Space\n          , Str \"operator\"\n          , Space\n          , Math InlineMath \"\\\\det\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"det\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"mat(delim: \\\"|\\\", ..)\"\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"Definition\"\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"cases\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"easily\"\n          , Space\n          , Str \"obtained\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"cases\"\n          , Space\n          , Str \"function.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"f_{n} = \\\\begin{cases}\\na & \\\\text{if }n = 0 \\\\\\\\\\nr \\\\cdot f_{n - 1} & \\\\text{else }\\n\\\\end{cases}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"$ f_n = cases(\\n  a &\\\"if\\\" n = 0,\\n  r dot f_(n - 1) &\\\"else\\\"\\n) $\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Strong\n              [ Str \"Spacing\"\n              , Space\n              , Str \"in\"\n              , Space\n              , Str \"mathematics\\8192\\160\"\n              ]\n          , Str \"Improve\"\n          , Space\n          , Math InlineMath \"\\\\sqrt{2}x\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Math InlineMath \"\\\\sqrt{2}\\\\, x\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"thin\"\n          , Space\n          , Str \"space,\"\n          , Space\n          , Str \"as\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"sqrt(2) thin x\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"Slightly\"\n          , Space\n          , Str \"wider\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"medium\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"thick\"\n          , Space\n          , Str \"(the\"\n          , Space\n          , Str \"three\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"ratio\"\n          , Space\n          , Math InlineMath \"3:4:5\"\n          , Str \").\"\n          , SoftBreak\n          , Str \"Bigger\"\n          , Space\n          , Str \"space\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"quad\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Math InlineMath \"\\\\rightarrow \\\\quad \\\\leftarrow\"\n          , Str \",\"\n          , Space\n          , Str \"which\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"useful\"\n          , Space\n          , Str \"between\"\n          , Space\n          , Str \"parts\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"display.\"\n          , SoftBreak\n          , Str \"Get\"\n          , Space\n          , Str \"arbitrary\"\n          , Space\n          , Str \"space\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"h\"\n          , Space\n          , Str \"function.\"\n          , SoftBreak\n          , Str \"For\"\n          , Space\n          , Str \"example,\"\n          , Space\n          , Str \"use\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"#h(2em)\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"\\\\qquad\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Span\n              ( \"\" , [ \"box\" ] , [] )\n              [ Str \"L\\8202A\\8202\"\n              , Span ( \"\" , [ \"box\" ] , [] ) [ Str \"T\\8202E\\8202X\" ]\n              ]\n          , Space\n          , Str \"and\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"#h(-0.1667em)\"\n          , Space\n          , Str \"for\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"\\\\!\"\n          , Str \".\"\n          ]\n      , Para\n          [ Strong\n              [ Str \"Displayed\" , Space , Str \"equations\\8192\\160\" ]\n          , Str \"Display\"\n          , Space\n          , Str \"equations\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"level\"\n          , Space\n          , Str \"using\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"$ ... $\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"at\"\n          , Space\n          , Str \"least\"\n          , Space\n          , Str \"one\"\n          , Space\n          , Str \"space\"\n          , Space\n          , Str \"separating\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"math\"\n          , Space\n          , Str \"content\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"$\"\n          , Str \".\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math DisplayMath \"S = k \\\\cdot \\\\lg W\" ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] ) \"$ S = k dot lg W $\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"You\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"break\"\n          , Space\n          , Str \"into\"\n          , Space\n          , Str \"multiple\"\n          , Space\n          , Str \"lines.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\begin{array}{r}\\n\\\\sin(x) = x - \\\\frac{x^{3}}{3!} \\\\\\\\\\n + \\\\frac{x^{5}}{5!} - \\\\cdots\\n\\\\end{array}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"$ sin(x) = x - x^3 / 3! \\\\\\n    + x^5 / 5! - dots.h.c $\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"Align\"\n          , Space\n          , Str \"equations\"\n          , Space\n          , Str \"using\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"&\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignLeft , ColWidthDefault )\n              , ( AlignLeft , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\begin{aligned}\\n\\\\nabla \\\\cdot \\\\mathbf{D} & = \\\\rho \\\\\\\\\\n\\\\nabla \\\\cdot \\\\mathbf{B} & = 0\\n\\\\end{aligned}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"$ nabla dot bold(D) &= rho \\\\\\n  nabla dot bold(B) &= 0 $\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"(the\"\n          , Space\n          , Str \"left\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Str \"right\"\n          , Space\n          , Str \"side\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"alignment\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"empty).\"\n          , SoftBreak\n          , Str \"Get\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"numbered\"\n          , Space\n          , Str \"version\"\n          , Space\n          , Str \"by\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"#set math.equation(numbering: ..)\"\n          , Str \".\"\n          ]\n      , Para\n          [ Strong\n              [ Str \"Calculus\" , Space , Str \"examples\\8192\\160\" ]\n          , Str \"The\"\n          , Space\n          , Str \"last\"\n          , Space\n          , Str \"three\"\n          , Space\n          , Str \"here\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"display\"\n          , Space\n          , Str \"style.\"\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignDefault , ColWidthDefault )\n              , ( AlignDefault , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  InlineMath\n                                  \"f:{\\\\mathbb{R}} \\\\rightarrow {\\\\mathbb{R}}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock ( \"\" , [] , [] ) \"f: RR -> RR\" ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math InlineMath \"9.8\\\\ \\\\text{ m/s}^{2}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Code\n                                  ( \"\" , [] , [] ) \"\\\"9.8\\\" \\\"m/s\\\"^2\"\n                              , Space\n                              , Link\n                                  ( \"\" , [ \"ref\" ] , [] )\n                                  [ Str \"[tricky]\" ]\n                                  ( \"#tricky\" , \"\" )\n                              ]\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\lim\\\\limits_{h \\\\rightarrow 0}\\\\frac{f(x + h) - f(x)}{h}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"lim_(h -> 0) (f(x + h) - f(x)) / h\"\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\int x^{2}dx = x^{3}/3 + C\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"integral x^2 dif x = x^3 \\\\/ 3 + C\"\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  DisplayMath\n                                  \"\\\\nabla = \\\\mathbf{i}\\\\frac{d}{dx} + \\\\mathbf{j}\\\\frac{d}{dy} + \\\\mathbf{k}\\\\frac{d}{dz}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z)\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Strong\n              [ Str \"Discrete\"\n              , Space\n              , Str \"mathematics\"\n              , Space\n              , Str \"examples\\8192\\160\"\n              ]\n          , Str \"For\"\n          , Space\n          , Str \"modulo,\"\n          , Space\n          , Str \"there\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"symbol\"\n          , Space\n          , Math InlineMath \"\\\\equiv\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"equiv\"\n          , Space\n          , Str \"and\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"text\"\n          , Space\n          , Str \"operator\"\n          , Space\n          , Math InlineMath \"\\\\operatorname{mod}\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"mod\"\n          , Str \".\"\n          ]\n      , Para\n          [ Str \"For\"\n          , Space\n          , Str \"combinations\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"binomial\"\n          , Space\n          , Str \"symbol\"\n          , Space\n          , Math InlineMath \"\\\\binom{n}{k}\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"binom(n, k)\"\n          , Str \".\"\n          , SoftBreak\n          , Str \"This\"\n          , Space\n          , Str \"resizes\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"bigger\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"display.\"\n          ]\n      , Para\n          [ Str \"For\"\n          , Space\n          , Str \"permutations\"\n          , Space\n          , Str \"use\"\n          , Space\n          , Math InlineMath \"n^{\\\\underline{r}}\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"n^(underline(r))\"\n          , Space\n          , Str \"(some\"\n          , Space\n          , Str \"authors\"\n          , Space\n          , Str \"use\"\n          , Space\n          , Math InlineMath \"P(n,r)\"\n          , Str \",\"\n          , Space\n          , Str \"or\"\n          , Space\n          , Math InlineMath \"{}_{n}P_{r}\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Code ( \"\" , [] , [] ) \"\\\"\\\"_n P_r\"\n          , Str \").\"\n          ]\n      , Para\n          [ Strong\n              [ Str \"Statistics\" , Space , Str \"examples\\8192\\160\" ]\n          ]\n      , Div\n          ( \"\" , [] , [ ( \"align\" , \"center\" ) ] )\n          [ Table\n              ( \"\" , [] , [] )\n              (Caption Nothing [])\n              [ ( AlignDefault , ColWidthDefault )\n              , ( AlignDefault , ColWidthDefault )\n              ]\n              (TableHead ( \"\" , [] , [] ) [])\n              [ TableBody\n                  ( \"\" , [] , [] )\n                  (RowHeadColumns 0)\n                  []\n                  [ Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  InlineMath\n                                  \"\\\\sigma^{2} = \\\\sqrt{{\\\\sum(x_{i} - \\\\mu)}^{2}/N}\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"sigma^2 = sqrt(sum(x_i - mu)^2 \\\\/ N)\"\n                          ]\n                      ]\n                  , Row\n                      ( \"\" , [] , [] )\n                      [ Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ Para\n                              [ Math\n                                  InlineMath\n                                  \"E(X) = \\\\mu_{X} = \\\\sum(x_{i} - P\\\\left( x_{i} \\\\right))\"\n                              ]\n                          ]\n                      , Cell\n                          ( \"\" , [] , [] )\n                          AlignDefault\n                          (RowSpan 1)\n                          (ColSpan 1)\n                          [ CodeBlock\n                              ( \"\" , [] , [] )\n                              \"E(X) = mu_X = sum(x_i - P(x_i))\"\n                          ]\n                      ]\n                  ]\n              ]\n              (TableFoot ( \"\" , [] , [] ) [])\n          ]\n      , Para\n          [ Str \"The\"\n          , Space\n          , Str \"probability\"\n          , Space\n          , Str \"density\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"normal\"\n          , Space\n          , Str \"distribution\"\n          ]\n      , Para\n          [ Math\n              DisplayMath\n              \"\\\\frac{1}{\\\\sqrt{2\\\\sigma^{2}\\\\pi}}e^{- \\\\frac{(x - \\\\mu)^{2}}{2\\\\sigma^{2}}}\"\n          ]\n      , Para\n          [ Str \"comes\" , Space , Str \"from\" , Space , Str \"this.\" ]\n      , Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          ]\n          (TableHead ( \"\" , [] , [] ) [])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      []\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ CodeBlock\n                          ( \"\" , [] , [] )\n                          \"1 / sqrt(2 sigma^2 pi)\\n  e^(- (x - mu)^2 / (2 sigma^2))\"\n                      ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      , Para\n          [ Strong [ Str \"For\" , Space , Str \"more\\8192\\160\" ]\n          , Str \"See\"\n          , Space\n          , Str \"also\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"Typst\"\n          , Space\n          , Str \"Documentation\"\n          , Space\n          , Str \"at\"\n          , Space\n          , Underline\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"https://typst.app/docs\" ]\n                  ( \"https://typst.app/docs\" , \"\" )\n              ]\n          , Str \".\"\n          ]\n      , HorizontalRule\n      , Para\n          [ Str \"johanvx\"\n          , Space\n          , Str \"(\"\n          , Underline\n              [ Link\n                  ( \"\" , [] , [] )\n                  [ Str \"https://github.com/johanvx\" ]\n                  ( \"https://github.com/johanvx\" , \"\" )\n              ]\n          , Str \")\"\n          , Space\n          , Str \"\\8202\\8193\"\n          , Space\n          , Str \"2023-05-22\"\n          ]\n      ]\n  ]\n"
  },
  {
    "path": "test/typst-reader.typ",
    "content": "#set page(width: 10cm, height: auto)\n#set heading(numbering: \"1.\")\n\n= Fibonacci sequence\nThe Fibonacci sequence is defined through the\nrecurrence relation $F_n = F_(n-1) + F_(n-2)$.\nIt can also be expressed in _closed form:_\n\n$ F_n = round(1 / sqrt(5) phi.alt^n), quad\n  phi.alt = (1 + sqrt(5)) / 2 $\n\n#let count = 8\n#let nums = range(1, count + 1)\n#let fib(n) = (\n  if n <= 2 { 1 }\n  else { fib(n - 1) + fib(n - 2) }\n)\n\nThe first #count numbers of the sequence are:\n\n#align(center, table(\n  columns: count,\n  ..nums.map(n => $F_#n$),\n  ..nums.map(n => str(fib(n))),\n))\n\n#include \"undergradmath.typ\"\n\n"
  },
  {
    "path": "test/undergradmath.typ",
    "content": "// Licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.\n// https://creativecommons.org/licenses/by-sa/4.0/\n\n// Meta data\n#set document(title: \"Typst Math for Undergrads\", author: \"johanvx\")\n\n// Margin\n#set page(margin: 0.5in)\n\n// Font size\n#let scriptsize = 7pt\n#let normalsize = 10pt\n#let large = 12pt\n#set text(size: normalsize, lang: \"en\")\n\n// Some horizontal spacing\n#let kern(length) = h(length, weak: true)\n#let enspace = kern(0.5em)\n#let qquad = h(2em)\n\n// For table/grid, something like \"lhs \\enspace rhs\"\n#let cell(lhs, rhs) = box(lhs + enspace + rhs)\n// Grid for code blocks\n#set grid(columns: (2em, auto))\n// Table for math-code listing\n#set table(stroke: none, align: horizon + left, inset: 0pt, row-gutter: 0.45em)\n\n// LaTeX and TeX logos\n#let TeX = style(styles => {\n  let e = measure(text(normalsize, \"E\"), styles)\n  let T = \"T\"\n  let E = text(normalsize, baseline: e.height / 2, \"E\")\n  let X = \"X\"\n  box(T + kern(-0.1667em) + E + kern(-0.125em) + X)\n})\n#let LaTeX = style(styles => {\n  let l = measure(text(10pt, \"L\"), styles)\n  let a = measure(text(7pt, \"A\"), styles)\n  let L = \"L\"\n  let A = text(7pt, baseline: a.height - l.height, \"A\")\n  box(L + kern(-0.36em) + A + kern(-0.15em) + TeX)\n})\n\n// Update date\n#let date = \"2023-05-22\"\n\n// Unavailable (last check date)\n#show \"??\": box(text(red, [#date #emoji.crossmark]))\n// Tricky\n#show \"!!\": box(text(blue, emoji.drops))\n// No idea\n#show \"?!\": box(text(orange, [No idea #emoji.face.unhappy]))\n// Tricky figure numbering\n#set figure(numbering: n => {\n  ([??], [!!], [?!]).at(n - 1)\n})\n// No prefix\n#set ref(supplement: \"\")\n\n// Justified paragraphs\n#set par(justify: true)\n\n// Two-column body\n#show: rest => columns(2, rest)\n\n// headcolor\n#let headcolor = rgb(\"004225\")\n\n// Run-in sections, like LaTeX \\paragraph\n#show heading.where(\n  level: 1\n): it => text(\n  size: normalsize,\n  weight: \"bold\",\n  fill: headcolor,\n  it.body + h(0.67em)\n)\n\n// Black raw code\n// #show raw.where(block: false): it => { it.text }\n\n// Title\n#align(center, link(\"https://github.com/johanvx/typst-undergradmath\")[\n  #text(large, headcolor)[*Typst Math for Undergrads*]\n])\n\n// Put this here to avoid affecting the title\n#show link: underline\n\nThis is a Typst port of _#LaTeX Math for Undergrads_ by Jim Hefferon.\nThe original version is available at #link(\"https://gitlab.com/jim.hefferon/undergradmath\").\n\n= Meaning of annotations\n#figure(\n  table(\n    columns: (1fr, 2fr),\n    [??], [This is unavailable. Last check date is #date.],\n  )\n) <unavailable>\n#figure(\n  table(\n    columns: (1fr, 2fr),\n    [!!], [Get this in a tricky way. Need a simpler method.],\n  )\n) <tricky>\n#figure(\n  table(\n    columns: (1fr, 2fr),\n    [?!], [Don't know how to get this.],\n  )\n) <noidea>\n\n= Rule One\nAny mathematics at all, even a single character, gets a mathematical setting.\nThus, for \"the value of $x$ is $7$\" enter `the value of $x$ is $7$`.\n\n= Template\nYour document should contain at least this.\n\n#grid(\n  \"\",\n  ```\n  -- document body here --\n  ```\n)\n\n= Common constructs\n#align(center, table(\n  columns: 2,\n  column-gutter: 1.5em,\n  cell($x^2$, `x^2`),\n  cell([$sqrt(2)$, $root(n, 3)$], [`sqrt(2)`, `root(n, 3)`]),\n  cell($x_(i, j)$, `x_(i, j)`),\n  cell([$2 / 3$, $2 \\/ 3$], [`2 / 3`, `2 \\/ 3` or `2 slash 3`]), // Maybe use `slash`?\n))\n\n= Calligraphic letters\nUse as in `$cal(A)$`.\n\n$ cal(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) $\n\nGetting script letters is @unavailable.\n\n= Greek\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  cell($alpha$, `alpha`), cell([$xi$, $Xi$], [`xi`, `Xi`]),\n  cell($beta$, `beta`), cell($omicron$, `omicron`),\n  cell([$gamma$, $Gamma$], [`gamma`, `Gamma`]), cell([$pi$, $Pi$], [`pi`, `Pi`]),\n  cell([$delta$, $Delta$], [`delta`, `Delta`]), cell($pi.alt$, `pi.alt`),\n  cell($epsilon.alt$, `epsilon.alt`), cell($rho$, `rho`),\n  cell($epsilon$, `epsilon`), cell($rho.alt$, `rho.alt`),\n  cell($zeta$, `zeta`), cell([$sigma$, $Sigma$], [`sigma`, `Sigma`]),\n  cell($eta$, `eta`), cell($\\u{03C2}$, [`\\u{03C2}` @tricky]),\n  cell([$theta$, $Theta$], [`theta`, `Theta`]), cell($tau$, `tau`),\n  cell($theta.alt$, `theta.alt`), cell([$upsilon$, $Upsilon$], [`upsilon`, `Upsilon`]),\n  cell($iota$, `iota`), cell([$phi.alt$, $Phi$], [`phi.alt`, `Phi`]),\n  cell($kappa$, $Kappa$), cell($phi$, `phi`),\n  cell([$lambda$, $Lambda$], [`lambda`, `Lambda`]), cell($chi$, `chi`),\n  cell($mu$, `mu`), cell([$psi$, $Psi$], [`psi`, `Psi`]),\n  cell($nu$, `nu`), cell([$omega$, $Omega$], [`omega`, `Omega`]),\n))\n\n= Sets and logic\n#align(center, table(\n  columns: 3,\n  column-gutter: 1em,\n  cell($union$, `union`), cell($RR$, [`RR`, `bb(R)`]), cell($forall$, `forall`),\n  cell($sect$, `sect`), cell($bb(Z)$, [`ZZ`, `bb(Z)`]), cell($exists$, `exists`),\n  cell($subset$, `subset`), cell($bb(Q)$, [`QQ`, `bb(Q)`]), cell($not$, `not`),\n  cell($subset.eq$, `subset.eq`), cell($bb(N)$, [`NN`, `bb(N)`]), cell($or$, `or`),\n  cell($supset$, `supset`), cell($bb(C)$, [`CC`, `bb(C)`]), cell($and$, `and`),\n  cell($supset.eq$, `supset.eq`), cell($diameter$, [`diameter`]), cell($tack.r$, `tack.r`),\n  cell($in$, `in`), cell($nothing$, `nothing`), cell($models$, `models`),\n  cell($in.not$, `in.not`), cell($alef$, `alef`), cell($without$, `without`),\n))\n\nNegate an operator, as in $subset.not$, with `subset.not`.\nGet the set complement $A^(sans(c))$ with `A^(sans(c))` (or $A^(complement)$ with `A^(complement)`, or $overline(A)$ with `overline(A)`).\n\n// https://www.ctan.org/tex-archive/fonts/newcomputermodern\n//\n// README\n//\n//     Version 3.93\n//\n//       Provides access to Russian and Greek guillemotleft and guillemotright\n//     using the character variant tables cv3 and cv4 respectively.\n//\n//       The Math fonts provide the character \\varnothing, an alternative to \\emptyset,\n//     through Character Variant cv01. The fontsetup package provides the option\n//     'varnothing' to easily switch to the alternative character.\n\n// https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf\n// The NewComputerModern FontFamily §13.3\n// The Math fonts provide the character \\varnothing (⌀, U+2300), as an alternative to \\emptyset (a slashed zero), through Character Variant cv01.\n// The fontsetup package provides the option ‘varnothing’ to easily switch to the alternative character.\n\n/ Remark: Using `diameter` for `\\varnothing` may cause some confusion. However, #LaTeX also uses $diameter$ (`\\u{2300}`) instead of $\\u{2205}$ (`\\u{2205}`), see #link(\"https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf\")[newcm $section$13.3].\n  Another solution is to use `text(font: \"Fira Sans\", nothing)`, but the resultant glyph $text(font: \"Fira Sans\", nothing)$ is subtly different from the widely used one.\n  Ultimately, the choice is always *your decision*.\n\n= Decorations\n#align(center, table(\n  columns: 3,\n  column-gutter: 1em,\n  cell($f'$, [`f'`, `f prime`]), cell($dot(a)$, `dot(a)`), cell($tilde(a)$, `tilde(a)`),\n  cell($f prime.double$, `f prime.double`), cell($diaer(a)$, `diaer(a)`), cell($macron(a)$, `macron(a)`),\n  cell($Sigma^*$, `Sigma^*`), cell($hat(a)$, `hat(a)`), cell($arrow(a)$, `arrow(a)`),\n))\n\nIf the decorated letter is $i$ or $j$ then some decorations need `\\u{1D6A4}` @tricky and `\\u{1D6A5}` @tricky, as in $arrow(\\u{1D6A4})$ with `arrow(\\u{1D6A4})`.\nSome authors use boldface for vectors: `bold(x)`.\n\nEntering `overline(x + y)` produces $overline(x + y)$, and `hat(x + y)` gives $hat(x + y)$.\nComment on an expression as here (there is also `overbrace(..)`).\n\n#align(center, cell(\n  $underbrace(x + y, |A|)$,\n  `underbrace(x + y, |A|)`,\n))\n\n= Dots\nUse low dots in a list ${0, 1, 2, ...}$, entered as `{0, 1, 2, ...}`.\nUse centered dots in a sum or product $1 + dots.h.c + 100$, entered as  `1 + dots.h.c + 100`.\nYou can also get vertical dots `dots.v`, diagonal dots `dots.down` and anti-diagonal dots `dots.up`.\n\n= Roman names\nJust type them!\n\n#align(center, table(\n  columns: 3,\n  column-gutter: 1.5em,\n  cell($sin$, `sin`), cell($sinh$, `sinh`), cell($arcsin$, `arcsin`),\n  cell($cos$, `cos`), cell($cosh$, `cosh`), cell($arccos$, `arccos`),\n  cell($tan$, `tan`), cell($tanh$, `tanh`), cell($arctan$, `arctan`),\n  cell($sec$, `sec`), cell($coth$, `coth`), cell($min$, `min`),\n  cell($csc$, `csc`), cell($det$, `det`), cell($max$, `max`),\n  cell($cot$, `cot`), cell($dim$, `dim`), cell($inf$, `inf`),\n  cell($exp$, `exp`), cell($ker$, `ker`), cell($sup$, `sup`),\n  cell($log$, `log`), cell($deg$, `deg`), cell($liminf$, `liminf`),\n  cell($ln$, `ln`), cell($arg$, `arg`), cell($limsup$, `limsup`),\n  cell($lg$, `lg`), cell($gcd$, `gcd`), cell($lim$, `lim`),\n))\n\n= Other symbols\n#align(center, table(\n  columns: 3,\n  column-gutter: 1.2em,\n  cell($<$, [`<`, `lt`]), cell($angle$, `angle`), cell($dot$, [`dot`]),\n  cell($<=$, [`<=`, `lt.eq`]), cell($angle.arc$, `angle.arc`), cell($plus.minus$, `plus.minus`),\n  cell($>$, [`>`, `gt`]), cell($ell$, `ell`), cell($minus.plus$, `minus.plus`),\n  cell($>=$, [`>=`, `gt.eq`]), cell($parallel$, `parallel`), cell($times$, `times`),\n  cell($!=$, [`!=`, `eq.not`]), cell($45 degree$, `45 degree`), cell($div$, `div`),\n  cell($<<$, [`<<`, `lt.double`]), cell($tilde.equiv$, `tilde.equiv`), cell($*$, [`*`, `ast`]),\n  cell($>>$, [`>>`, `gt.double`]), cell($tilde.equiv.not$, `tilde.equiv.not`), cell($divides$, `divides`),\n  cell($approx$, `approx`), cell($tilde$, `tilde`), cell($divides.not$, `divides.not`),\n  cell($\\u{224D}$, [`\\u{224D}` @tricky]), cell($tilde.eq$, `tilde.eq`), cell($n!$, `n!`),\n  cell($equiv$, `equiv`), cell($tilde.not$, `tilde.not`), cell($diff$, `diff`),\n  cell($prec$, `prec`), cell($plus.circle$, `plus.circle`), cell($nabla$, `nabla`),\n  cell($prec.eq$, `prec.eq`), cell($minus.circle$, `minus.circle`), cell($planck.reduce$, `planck.reduce`),\n  cell($succ$, `succ`), cell($dot.circle$, `dot.circle`), cell($circle.stroked.tiny$, `circle.stroked.tiny`),\n  cell($succ.eq$, `succ.eq`), cell($times.circle$, `times.circle`), cell($star$, `star`),\n  cell($prop$, `prop`), cell($\\u{2298}$, [`\\u{2298}` @tricky]), cell($sqrt(\"\")$, `sqrt(\"\")`),\n  cell($\\u{2250}$, [`\\u{2250}` @tricky]), cell($harpoon.tr$, `harpoon.tr`), cell($checkmark$, `checkmark`),\n))\n\nUse `a divides b` for the divides relation, $a divides b$, and `a divides.not b` for the negation, $a divides.not b$.\nUse `|` to get set builder notation ${a in S | a \"is odd\"}$ with `{a in S | a \"is odd\"}`.\n\n= Arrows\n#align(center, table(\n  columns: 2,\n  column-gutter: 1.5em,\n  cell($->$, [`->`, `arrow.r`]), cell($|->$, [`|->`, `arrow.r.bar`]),\n  cell($arrow.r.not$, `arrow.r.not`), cell($arrow.r.long.bar$, `arrow.r.long.bar`),\n  cell($arrow.r.long$, `arrow.r.long`), cell($<-$, [`<-`, `arrow.l`]),\n  cell($=>$, [`=>`, `arrow.r.double`]), cell($<-->$, [`<-->`, `arrow.l.r.long`]),\n  cell($arrow.r.double.not$, `arrow.r.double.not`), cell($arrow.b$, `arrow.b`),\n  cell($arrow.r.double.long$, `arrow.r.double.long`), cell($arrow.t$, `arrow.t`),\n  cell($arrow.squiggly$, `arrow.squiggly`), cell($arrow.t.b$, `arrow.t.b`),\n))\n\nThe right arrows in the first column have matching left arrows, such as `arrow.l.not`, and there are some other matches for down arrows, etc.\n\n= Variable-sized operators\nThe summation $sum_(j = 0)^3 j^2$ `sum_(j = 0)^3 j^2` and the integral $integral_(x = 0)^3 x^2 dif x$ `integral_(x = 0)^3 x^2 dif x` expand when displayed.\n\n$ sum_(j = 0)^3 j^2 qquad integral_(x = 0)^3 x^2 dif x $\n\nThese do the same.\n\n#align(center, table(\n  columns: 3,\n  cell($integral$, `integral`), cell($integral.triple$, `integral.triple`), cell($union.big$, `union.big`),\n  cell($integral.double$, `integral.double`), cell($integral.cont$, `integral.cont`), cell($sect.big$, `sect.big`),\n))\n\n= Fences\n#align(center, table(\n  columns: 3,\n  column-gutter: 1.5em,\n  cell($()$, `()`), cell($angle.l angle.r$, `angle.l angle.r`), cell($abs(\"\")$, `abs(\"\")`),\n  cell($[]$, `[]`), cell($floor(\"\")$, `floor(\"\")`), cell($norm(\"\")$, `norm(\"\")`),\n  cell(${}$, `{}`), cell($ceil(\"\")$, `ceil(\"\")`),\n))\n\nFix the size with the `lr` function.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 0.5em,\n  $ lr([sum_(k = 0)^n e^(k^2)], size: #50%) $,\n  ```\n  lr([sum_(k = 0)^n e^(k^2)], size: #50%)\n  ```,\n))\n\nTo have them grow with the enclosed formula, also use the `lr` function.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ lr(angle.l i, 2^(2^i) angle.r) $,\n  ```\n  lr(angle.l i, 2^(2^i) angle.r)\n  ```,\n))\n\nFences scale by default if entered directly as codepoints, and don't scale automatically if entered as symbol notation.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ (1 / n^(alpha)) $,\n  ```\n  (1 / n^(alpha))\n  ```,\n  $ paren.l 1 / n^(alpha) paren.r $,\n  ```\n  paren.l 1 / n^(alpha) paren.r\n  ```,\n))\n\nThe `lr` function also allows to scale unmatched delimiters and one-side fences.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ lr(frac(dif f, dif x) |)_(x_0) $,\n  ```\n  lr(frac(dif f, dif x) |)_(x_0)\n  ```,\n))\n\n= Arrays, Matrices\nGet a matrix with the `mat` function. You can pass an array to it.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ mat(a, b; c, d) $,\n  ```\n  $ mat(a, b; c, d) $\n  ```\n))\n\nIn Typst, #link(\"https://typst.app/docs/reference/typst/array\")[array] is a sequence of values,\nwhile in #LaTeX, array is a matrix without fences, which is `$mat(delim: #none, ..)$` in Typst.\n\nFor the determinant use `|A|`, text operator $det$ `det` or `mat(delim: \"|\", ..)`.\n\nDefinition by cases can be easily obtained with the `cases` function.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ f_n = cases(\n    a &\"if\" n = 0,\n    r dot f_(n - 1) &\"else\"\n  ) $,\n  ```\n  $ f_n = cases(\n    a &\"if\" n = 0,\n    r dot f_(n - 1) &\"else\"\n  ) $\n  ```\n))\n\n= Spacing in mathematics\nImprove $sqrt(2) x$ to $sqrt(2) thin x$ with a thin space, as in `sqrt(2) thin x`.\nSlightly wider are `medium` and `thick` (the three are in ratio $3 : 4 : 5$).\nBigger space is `quad` for $arrow.r quad arrow.l$, which is useful between parts of a display.\nGet arbitrary space with the `h` function.\nFor example, use `#h(2em)` for `\\qquad` in #LaTeX and `#h(-0.1667em)` for `\\!`.\n\n= Displayed equations\nDisplay equations in a block level using `$ ... $` with at least one space separating the math content and the `$`.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ S = k dot lg W $,\n  ```\n  $ S = k dot lg W $\n  ```,\n))\n\nYou can break into multiple lines.\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ sin(x) = x - x^3 / 3! \\\n      + x^5 / 5! - dots.h.c $,\n  ```\n  $ sin(x) = x - x^3 / 3! \\\n      + x^5 / 5! - dots.h.c $\n  ```,\n))\n\nAlign equations using `&`\n\n#align(center, table(\n  columns: 2,\n  column-gutter: 1em,\n  $ nabla dot bold(D) &= rho \\\n    nabla dot bold(B) &= 0 $,\n  ```\n  $ nabla dot bold(D) &= rho \\\n    nabla dot bold(B) &= 0 $\n  ```,\n))\n\n(the left or right side of an alignment can be empty).\nGet a numbered version by `#set math.equation(numbering: ..)`.\n\n= Calculus examples\nThe last three here are display style.\n\n#align(center, table(\n  align: horizon,\n  columns: 2,\n  column-gutter: 1em,\n  block($f: RR -> RR$),\n  ```\n  f: RR -> RR\n  ```,\n  block($\"9.8\" \"m/s\"^2$),\n  block([`\"9.8\" \"m/s\"^2` @tricky]),\n  $ lim_(h->0) (f(x+h)-f(x))/h $,\n  ```\n  lim_(h -> 0) (f(x + h) - f(x)) / h\n  ```,\n  $ integral x^2 dif x = x^3 \\/ 3 + C $,\n  ```\n  integral x^2 dif x = x^3 \\/ 3 + C\n  ```,\n  $ nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z) $,\n  ```\n  nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z)\n  ```,\n))\n\n= Discrete mathematics examples\nFor modulo, there is a symbol $equiv$ from `equiv` and a text operator $mod$ from `mod`.\n\nFor combinations the binomial symbol $binom(n, k)$ is from `binom(n, k)`.\nThis resizes to be bigger in a display.\n\nFor permutations use $n^(underline(r))$ from `n^(underline(r))` (some authors use $P(n, r)$, or $\"\"_n P_r$ from `\"\"_n P_r`).\n\n= Statistics examples\n#align(center, table(\n  align: horizon,\n  columns: 2,\n  block($sigma^2 = sqrt(sum(x_i - mu)^2 \\/ N)$),\n  ```\n  sigma^2 = sqrt(sum(x_i - mu)^2 \\/ N)\n  ```,\n  block($E(X) = mu_X = sum(x_i - P(x_i))$),\n  ```\n  E(X) = mu_X = sum(x_i - P(x_i))\n  ```,\n))\n\nThe probability density of the normal distribution\n\n$ 1 / sqrt(2 sigma^2 pi) e^(- (x - mu)^2 / (2 sigma^2)) $\n\ncomes from this.\n\n#grid(\n  \"\",\n  ```\n  1 / sqrt(2 sigma^2 pi)\n    e^(- (x - mu)^2 / (2 sigma^2))\n  ```\n)\n\n= For more\nSee also the Typst Documentation at #link(\"https://typst.app/docs\").\n\n#v(1fr)\n\n#block(\n  line(length: 100%, stroke: headcolor) +\n  text(headcolor)[johanvx (https://github.com/johanvx) #h(1fr) #date]\n)"
  },
  {
    "path": "test/vimdoc/definition-lists.markdown",
    "content": "---\nvimdoc-prefix: pandoc\nabstract: \"A short description\"\nfilename: \"definition-lists.txt\"\nauthor: Author\ntitle: Title\n---\n\n## Basic\n\nTerm 1\n:   Definition I\n\nTerm 2\n:   Definition II\n\nTerm 3\n:   Definition III\n\n## Code\n\n<!-- Source: <https://github.com/ggandor/leap.nvim/blob/c4a215acef90749851d85ddba08bc282867b50eb/doc/leap.txt#L283-L294> -->\n\n`leap.opts.keys.next_target`\n: Jump to the next available target (use the previous search pattern if no input\n  has been given). `:h leap-repeat`\n\n`leap.opts.keys.prev_target`\n: Jump to the previous target (revert `next_target`).\n\n`leap.opts.keys.next_group`\n: Shift to the next group of labeled targets.\n\n`leap.opts.keys.prev_group`\n: Shift to the previous group of labeled targets (revert `next_group`).\n\n## Span\n\n[Important concept]{#important-concept}\n: Definition\n\n[I am too long to fit on the same line as a reference, so reference is put above me!]{#i-am-too-long}\n: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n  tempor incididunt ut labore et dolore magna aliqua.\n\n## Commands\n\nIn markdown vim commands are represented as inline code starting with colon (ie.\n`:MyCommand`), but writer strips the backticks\n\n`:FnlCompileBuffer`{#:FnlCompileBuffer}\n\n:   Compiles current active fennel buffer\n\n`:FnlCompile[!]`{#:FnlCompile}\n\n:   Diff compiles all indexed fennel files\n    If bang! is present then forcefully compiles all `source` files\n\n`:[range]Fnl {expr}`{#:Fnl}\n\n:    Evaluates {expr} or range\n\n     ```\n     :'<,'>Fnl\n\n     :Fnl (print \"Hello World\")\n\n     :Fnl (values some_var)\n     ```\n"
  },
  {
    "path": "test/vimdoc/definition-lists.vimdoc",
    "content": "*definition-lists.txt*\tA short description\n\n                               Title by Author\n\n\n                                       Type |gO| to see the table of contents.\n\nBasic ........................................................... |pandoc-basic|\nCode ............................................................. |pandoc-code|\nSpan ............................................................. |pandoc-span|\nCommands ..................................................... |pandoc-commands|\n\n------------------------------------------------------------------------------\nBasic                                                             *pandoc-basic*\n\nTerm 1\n    Definition I\nTerm 2\n    Definition II\nTerm 3\n    Definition III\n\n------------------------------------------------------------------------------\nCode                                                               *pandoc-code*\n\n`leap.opts.keys.next_target`\n    Jump to the next available target (use the previous search pattern if no\n    input has been given). |leap-repeat|\n`leap.opts.keys.prev_target`\n    Jump to the previous target (revert `next_target`).\n`leap.opts.keys.next_group`\n    Shift to the next group of labeled targets.\n`leap.opts.keys.prev_group`\n    Shift to the previous group of labeled targets (revert `next_group`).\n\n------------------------------------------------------------------------------\nSpan                                                               *pandoc-span*\n\nImportant concept                                     *pandoc-important-concept*\n    Definition\n                                                          *pandoc-i-am-too-long*\nI am too long to fit on the same line as a reference, so reference is put\nabove me!\n    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n    tempor incididunt ut labore et dolore magna aliqua.\n\n------------------------------------------------------------------------------\nCommands                                                       *pandoc-commands*\n\nIn markdown vim commands are represented as inline code starting with colon\n(ie. `:MyCommand`), but writer strips the backticks\n\n:FnlCompileBuffer                                            *:FnlCompileBuffer*\n    Compiles current active fennel buffer\n\n:FnlCompile[!]                                                     *:FnlCompile*\n    Diff compiles all indexed fennel files If bang! is present then forcefully\n    compiles all `source` files\n\n:[range]Fnl {expr}                                                        *:Fnl*\n    Evaluates {expr} or range\n\n    >\n        :'<,'>Fnl\n\n        :Fnl (print \"Hello World\")\n\n        :Fnl (values some_var)\n<\n\n vim:tw=78:sw=4:ts=4:ft=help:norl:et:\n"
  },
  {
    "path": "test/vimdoc/headers-numbered.vimdoc",
    "content": "                                       Type |gO| to see the table of contents.\n\n1. unremarkable header 1 ............................... |unremarkable-header-1|\n  1.1 unremarkable header 2 ............................ |unremarkable-header-2|\n      1.1.1 unremarkable header 3 ...................... |unremarkable-header-3|\n      1.1.2 unremarkable header 3 .................... |unremarkable-header-3-1|\n  unremarkable header 2 .............................. |unremarkable-header-2-1|\n    unremarkable header 3 ............................ |unremarkable-header-3-2|\n    unremarkable header 3 ............................ |unremarkable-header-3-3|\n2. bold italic underline strikethrough ............................... |short11|\n  2.1 superscript2 subscript3 ........................................ |short21|\n      2.1.1 smallcaps code inline math display math .................. |short31|\n      2.1.2 link image ............................................... |short32|\n3. Long header 1 long header 1 long header 1 long header 1 long heade... |long1|\n  3.1 Long header 2 long header 2 long header 2 long header 2 long h... |long21|\n      3.1.1 Long header 3 long header 3 long header 3 long header 3.... |long31|\n      3.1.2 Long header 3 long header 3 long header 3 long header 3.... |long32|\n  3.2 Long header 2 long header 2 long header 2 long header 2 long h... |long22|\n      3.2.1 Long header 3 long header 3 long header 3 long header 3.... |long33|\n      3.2.2 Long header 3 long header 3 long header 3 long header 3.... |long34|\n4. ... |long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1|\n  4.1 ... |long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2|\n      4.1.1 ... |long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3|\n      4.1.2 ... |long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-1|\n  4.2 ... |long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-1|\n      4.2.1 ... |long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-2|\n      4.2.2 ... |long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-3|\n\n\nHeaders with a short title and implicit ref. Last 3 headers are unnumbered.\n\n==============================================================================\nunremarkable header 1                                    *unremarkable-header-1*\n\n------------------------------------------------------------------------------\nunremarkable header 2                                    *unremarkable-header-2*\n\nUNREMARKABLE HEADER 3                                    *unremarkable-header-3*\n\nUNREMARKABLE HEADER 3                                  *unremarkable-header-3-1*\n\n------------------------------------------------------------------------------\nunremarkable header 2                                  *unremarkable-header-2-1*\n\nUNREMARKABLE HEADER 3                                  *unremarkable-header-3-2*\n\nUNREMARKABLE HEADER 3                                  *unremarkable-header-3-3*\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\nHeaders with various inline elements\n\n==============================================================================\nbold italic underline strikethrough                                    *short11*\n\n------------------------------------------------------------------------------\nsuperscript2 subscript3                                                *short21*\n\nSMALLCAPS `code` `$inline math$` `$display math$`                      *short31*\n\nLINK example.com                                                       *short32*\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\nHeaders with a long name and explicit short ref\n\n==============================================================================\nLong header 1 long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 *long1*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long21*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long31*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long32*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long22*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long33*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long34*\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\nHeaders with a long name and implicit ref.\n\nSince implicit ref is very lengthy, there is no way to fit it. Therefore title\nis not rendered and the references exceed the columns (textwidth) limit\n\n==============================================================================\nLong header 1 long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 *long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-1*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-1*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-2*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-3*\n\n vim:tw=78:sw=4:ts=4:ft=help:norl:et:\n"
  },
  {
    "path": "test/vimdoc/headers.markdown",
    "content": "Headers with a short title and implicit ref. Last 3 headers are unnumbered.\n\n# unremarkable header 1\n## unremarkable header 2\n### unremarkable header 3\n### unremarkable header 3\n## unremarkable header 2 {.unnumbered}\n### unremarkable header 3 {.unnumbered}\n### unremarkable header 3 {.unnumbered}\n\n---\n\nHeaders with various inline elements\n\n# **bold** *italic* [underline]{.underline} ~strikethrough~ {#short11}\n## superscript^2^ subscript~3~ {#short21}\n### [smallcaps]{.smallcaps} `code` $inline math$ $$display math$$ {#short31}\n### [link](example.com) ![image](https://duckduckgo.com/favicon.ico) {#short32}\n\n---\n\nHeaders with a long name and explicit short ref\n\n# Long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 {#long1}\n## Long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 {#long21}\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 {#long31}\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 {#long32}\n## Long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 {#long22}\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 {#long33}\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 {#long34}\n\n---\n\nHeaders with a long name and implicit ref.\n\nSince implicit ref is very lengthy, there is no way to fit it. Therefore title\nis not rendered and the references exceed the columns (textwidth) limit\n\n# Long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 long header 1\n## Long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3\n## Long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3\n### Long header 3 long header 3 long header 3 long header 3 long header 3 long header 3 long header 3\n"
  },
  {
    "path": "test/vimdoc/headers.vimdoc",
    "content": "                                       Type |gO| to see the table of contents.\n\nunremarkable header 1 .................................. |unremarkable-header-1|\n  unremarkable header 2 ................................ |unremarkable-header-2|\n  unremarkable header 2 .............................. |unremarkable-header-2-1|\nbold italic underline strikethrough .................................. |short11|\n  superscript2 subscript3 ............................................ |short21|\nLong header 1 long header 1 long header 1 long header 1 long header 1... |long1|\n  Long header 2 long header 2 long header 2 long header 2 long heade... |long21|\n  Long header 2 long header 2 long header 2 long header 2 long heade... |long22|\n... |long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1|\n  ... |long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2|\n  ... |long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-1|\n\n\nHeaders with a short title and implicit ref. Last 3 headers are unnumbered.\n\n==============================================================================\nunremarkable header 1                                    *unremarkable-header-1*\n\n------------------------------------------------------------------------------\nunremarkable header 2                                    *unremarkable-header-2*\n\nUNREMARKABLE HEADER 3                                    *unremarkable-header-3*\n\nUNREMARKABLE HEADER 3                                  *unremarkable-header-3-1*\n\n------------------------------------------------------------------------------\nunremarkable header 2                                  *unremarkable-header-2-1*\n\nUNREMARKABLE HEADER 3                                  *unremarkable-header-3-2*\n\nUNREMARKABLE HEADER 3                                  *unremarkable-header-3-3*\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\nHeaders with various inline elements\n\n==============================================================================\nbold italic underline strikethrough                                    *short11*\n\n------------------------------------------------------------------------------\nsuperscript2 subscript3                                                *short21*\n\nSMALLCAPS `code` `$inline math$` `$display math$`                      *short31*\n\nLINK example.com                                                       *short32*\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\nHeaders with a long name and explicit short ref\n\n==============================================================================\nLong header 1 long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 *long1*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long21*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long31*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long32*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long22*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long33*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long34*\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\nHeaders with a long name and implicit ref.\n\nSince implicit ref is very lengthy, there is no way to fit it. Therefore title\nis not rendered and the references exceed the columns (textwidth) limit\n\n==============================================================================\nLong header 1 long header 1 long header 1 long header 1 long header 1 long header 1 long header 1 *long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1-long-header-1*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-1*\n\n------------------------------------------------------------------------------\nLong header 2 long header 2 long header 2 long header 2 long header 2 long header 2 long header 2 *long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-long-header-2-1*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-2*\n\nLONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 LONG HEADER 3 *long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-long-header-3-3*\n\n vim:tw=78:sw=4:ts=4:ft=help:norl:et:\n"
  },
  {
    "path": "test/vimdoc/vim-online-doc.markdown",
    "content": "# Online vim documentation\n\nWhile vim documentation can be accessed with `:help`, it may be beneficial to\nlink to the websites inside readme/markdown docs. Two most common websites are:\n\n- <https://vimhelp.org/> and\n- <https://neovim.io/doc/user>\n\nAlso it is not uncommon to reference documentation as `:h <topic>`\n\n## Links to vimhelp.org {#vimhelp-links}\n\nFor introduction to writing help files see\n<https://vimhelp.org/helphelp.txt.html#help-writing>\n\nNamed link: [vimhelp link](https://vimhelp.org/helphelp.txt.html#help-writing)\n\n## Links to neo.vimhelp.org {#neo-vimhelp-links}\n\nFor introduction to writing help files see\n<https://neo.vimhelp.org/helphelp.txt.html#help-writing>\n\nNamed link: [vimhelp link](https://neo.vimhelp.org/helphelp.txt.html#help-writing)\n\n## Links to neovim.io {#neovim-io-links}\n\nFor introduction to writing help files see\n<https://neovim.io/doc/user/helphelp.html#help-writing>\n\nNamed link: [neovim.io link](https://neovim.io/doc/user/helphelp.html#help-writing)\n\nYou can also reference whole files with topic omitted:\n<https://neovim.io/doc/user/vim_diff.html>\n\n## :h-style documentation {#colon-h-docs}\n\nFor introduction to writing help files see\n`:h help-writing`\n\nLong name for `:help` is also supported: `:help help-writing`\n\nThis is malformed: `:help help-writing `, but this is not: `:help  help-writing`\n"
  },
  {
    "path": "test/vimdoc/vim-online-doc.vimdoc",
    "content": "                                       Type |gO| to see the table of contents.\n\nOnline vim documentation ............................ |online-vim-documentation|\n  Links to vimhelp.org ......................................... |vimhelp-links|\n  Links to neo.vimhelp.org ................................. |neo-vimhelp-links|\n  Links to neovim.io ......................................... |neovim-io-links|\n  :h-style documentation ........................................ |colon-h-docs|\n\n==============================================================================\nOnline vim documentation                              *online-vim-documentation*\n\nWhile vim documentation can be accessed with `:help`, it may be beneficial to\nlink to the websites inside readme/markdown docs. Two most common websites\nare:\n\n- https://vimhelp.org/ and\n- https://neovim.io/doc/user\n\nAlso it is not uncommon to reference documentation as |<topic>|\n\n------------------------------------------------------------------------------\nLinks to vimhelp.org                                             *vimhelp-links*\n\nFor introduction to writing help files see |help-writing|\n\nNamed link: vimhelp link |help-writing|\n\n------------------------------------------------------------------------------\nLinks to neo.vimhelp.org                                     *neo-vimhelp-links*\n\nFor introduction to writing help files see |help-writing|\n\nNamed link: vimhelp link |help-writing|\n\n------------------------------------------------------------------------------\nLinks to neovim.io                                             *neovim-io-links*\n\nFor introduction to writing help files see |help-writing|\n\nNamed link: neovim.io link |help-writing|\n\nYou can also reference whole files with topic omitted: |vim_diff.txt|\n\n------------------------------------------------------------------------------\n:h-style documentation                                            *colon-h-docs*\n\nFor introduction to writing help files see |help-writing|\n\nLong name for `:help` is also supported: |help-writing|\n\nThis is malformed: |help-writing|, but this is not: |help-writing|\n\n vim:tw=78:sw=4:ts=4:ft=help:norl:et:\n"
  },
  {
    "path": "test/vimwiki-reader.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"date\" , MetaInlines [ Str \"2017-05-01\" ] )\n          , ( \"title\" , MetaInlines [ Str \"title\" ] )\n          ]\n    }\n  [ Header\n      1\n      ( \"implemented\" , [] , [] )\n      [ Emph\n          [ Span ( \"implemented\" , [] , [] ) []\n          , Strong [ Str \"implemented\" ]\n          ]\n      ]\n  , Header 1 ( \"header\" , [] , [] ) [ Str \"header\" ]\n  , Header\n      2\n      ( \"header level two\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"two\" ]\n  , Header\n      3\n      ( \"header level 3\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"level\"\n      , Space\n      , Str \"3\"\n      ]\n  , Header\n      4\n      ( \"header level four\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Strikeout [ Str \"level\" ]\n      , Space\n      , Str \"four\"\n      ]\n  , Header\n      5\n      ( \"header level 5\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Emph\n          [ Span ( \"level\" , [] , [] ) []\n          , Strong [ Str \"level\" ]\n          , Space\n          , Str \"5\"\n          ]\n      ]\n  , Header\n      6\n      ( \"header level 6\" , [] , [] )\n      [ Str \"header\" , Space , Str \"level\" , Space , Str \"6\" ]\n  , Para\n      [ Str \"=======\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"========\"\n      ]\n  , Para\n      [ Str \"hi==\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"==\"\n      ]\n  , Para\n      [ Str \"===\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"==\"\n      ]\n  , Para\n      [ Str \"===\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"===-\"\n      ]\n  , Para\n      [ Str \"not\" , Space , Str \"a\" , Space , Str \"header:\" ]\n  , Para [ Str \"=n=\" ]\n  , Para\n      [ Str \"===\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"header\"\n      , Space\n      , Str \"====\"\n      ]\n  , Header\n      2\n      ( \"centred header\" , [ \"justcenter\" ] , [] )\n      [ Str \"centred\" , Space , Str \"header\" ]\n  , Header\n      2\n      ( \"header with some == in between\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"==\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"between\"\n      ]\n  , Header\n      2\n      ( \"header with some == in between\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"==\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"between\"\n      ]\n  , Header\n      2\n      ( \"header with some ==in between\" , [] , [] )\n      [ Str \"header\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"==in\"\n      , Space\n      , Str \"between\"\n      ]\n  , Header\n      2\n      ( \"emph strong and strikeout\" , [] , [] )\n      [ Str \"emph\"\n      , Space\n      , Str \"strong\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"strikeout\"\n      ]\n  , Para\n      [ Emph [ Str \"emph\" ]\n      , Space\n      , Span ( \"strong\" , [] , [] ) []\n      , Strong [ Str \"strong\" ]\n      ]\n  , Para\n      [ Span ( \"strong and emph\" , [] , [] ) []\n      , Strong\n          [ Emph\n              [ Str \"strong\" , Space , Str \"and\" , Space , Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Emph\n          [ Span ( \"emph and strong\" , [] , [] ) []\n          , Strong\n              [ Str \"emph\" , Space , Str \"and\" , Space , Str \"strong\" ]\n          ]\n      ]\n  , Para\n      [ Span ( \"emph inside strong\" , [] , [] ) []\n      , Strong\n          [ Emph [ Str \"emph\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"strong\"\n          ]\n      ]\n  , Para\n      [ Span ( \"strong with emph\" , [] , [] ) []\n      , Strong\n          [ Str \"strong\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Emph [ Str \"emph\" ]\n          ]\n      ]\n  , Para\n      [ Emph\n          [ Span ( \"strong inside\" , [] , [] ) []\n          , Strong [ Str \"strong\" , Space , Str \"inside\" ]\n          , Space\n          , Str \"emph\"\n          ]\n      ]\n  , Para\n      [ Emph\n          [ Strikeout [ Str \"strikeout\" ]\n          , Space\n          , Str \"inside\"\n          , Space\n          , Str \"emph\"\n          ]\n      ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"struck\" , Space , Str \"out\" ]\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"emph\"\n          ]\n      ]\n  , Para [ Str \"*not\" , SoftBreak , Str \"strong*\" ]\n  , Para\n      [ Str \"just\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"stars:\"\n      , Space\n      , Str \"**\"\n      ]\n  , Para\n      [ Str \"just\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"underscores:\"\n      , Space\n      , Str \"__\"\n      ]\n  , Para\n      [ Str \"just\"\n      , Space\n      , Str \"four\"\n      , Space\n      , Str \"~s:\"\n      , Space\n      , Str \"~~~~\"\n      ]\n  , Para [ Str \"_not\" , SoftBreak , Str \"emph_\" ]\n  , Para [ Str \"~~not\" , SoftBreak , Str \"strikeout~~\" ]\n  , Header\n      2\n      ( \"horizontal rule\" , [] , [] )\n      [ Str \"horizontal\" , Space , Str \"rule\" ]\n  , Para [ Str \"top\" ]\n  , HorizontalRule\n  , Para [ Str \"middle\" ]\n  , HorizontalRule\n  , Para\n      [ Str \"not\" , Space , Str \"a\" , Space , Str \"rule-----\" ]\n  , Para\n      [ Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"rule\"\n      , Space\n      , Str \"(trailing\"\n      , Space\n      , Str \"spaces):\"\n      , SoftBreak\n      , Str \"-----\"\n      ]\n  , Para\n      [ Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"rule\"\n      , Space\n      , Str \"(leading\"\n      , Space\n      , Str \"spaces):\"\n      , SoftBreak\n      , Str \"----\"\n      ]\n  , Header 2 ( \"comments\" , [] , [] ) [ Str \"comments\" ]\n  , Para\n      [ Str \"this\"\n      , SoftBreak\n      , Str \"is\"\n      , Space\n      , Str \"%%\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"secret\"\n      ]\n  , Header\n      2\n      ( \"inline code\" , [] , [] )\n      [ Str \"inline\" , Space , Str \"code\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"inline code\"\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"backticks:\"\n      , Space\n      , Str \"``\"\n      ]\n  , Header\n      2\n      ( \"preformatted text\" , [] , [] )\n      [ Str \"preformatted\" , Space , Str \"text\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"  Tyger! Tyger! burning bright\\n   In the forests of the night,\\n    What immortal hand or eye\\n     Could frame thy fearful symmetry?\\n  In what distant deeps or skies\\n   Burnt the fire of thine eyes?\\n    On what wings dare he aspire?\\n     What the hand dare sieze the fire?\"\n  , Header\n      3\n      ( \"preformatted text with attributes\" , [] , [] )\n      [ Str \"preformatted\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"attributes\"\n      ]\n  , CodeBlock\n      ( \"\"\n      , []\n      , [ ( \"class\" , \"python\" ) , ( \"style\" , \"color:blue\" ) ]\n      )\n      \" for i in range(1, 5):\\n     print(i)\"\n  , Header\n      3\n      ( \"preformatted text with nested syntax\" , [] , [] )\n      [ Str \"preformatted\"\n      , Space\n      , Str \"text\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"syntax\"\n      ]\n  , CodeBlock ( \"\" , [ \"sql\" ] , [] ) \"SELECT * FROM table\"\n  , Header\n      3\n      ( \"empty preformatted text\" , [] , [] )\n      [ Str \"empty\"\n      , Space\n      , Str \"preformatted\"\n      , Space\n      , Str \"text\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"\"\n  , Header\n      2\n      ( \"block quotes\" , [] , [] )\n      [ Str \"block\" , Space , Str \"quotes\" ]\n  , BlockQuote\n      [ Plain\n          [ Str \"(indentation\"\n          , Space\n          , Str \"4\"\n          , Space\n          , Str \"spaces)\"\n          , Space\n          , Str \"This\"\n          , Space\n          , Str \"would\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"blockquote\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"Vimwiki.\"\n          , Space\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"not\"\n          , Space\n          , Span ( \"highlighted\" , [] , [] ) []\n          , Strong [ Str \"highlighted\" ]\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"Vim\"\n          , Space\n          , Str \"but\"\n          , SoftBreak\n          , Str \"(indentation\"\n          , Space\n          , Str \"1\"\n          , Space\n          , Str \"space\"\n          , Space\n          , Str \"followed\"\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"1\"\n          , Space\n          , Str \"tab\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"width\"\n          , Space\n          , Str \"4)\"\n          , Space\n          , Str \"could\"\n          , Space\n          , Str \"be\"\n          , Space\n          , Str \"styled\"\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"CSS\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"HTML.\"\n          , Space\n          , Str \"Blockquotes\"\n          , Space\n          , Str \"are\"\n          , Space\n          , Str \"usually\"\n          , Space\n          , Str \"used\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"quote\"\n          , Space\n          , Str \"a\"\n          , SoftBreak\n          , Str \"(indentation\"\n          , Space\n          , Str \"1\"\n          , Space\n          , Str \"tab\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"width\"\n          , Space\n          , Str \"4)\"\n          , Space\n          , Str \"long\"\n          , Space\n          , Str \"piece\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"text\"\n          , Space\n          , Str \"from\"\n          , Space\n          , Str \"another\"\n          , Space\n          , Str \"source.\"\n          , Space\n          , Strikeout [ Str \"blah\" , Space , Str \"blah\" ]\n          , Space\n          , Span ( \"-blockquote\" , [] , [] ) [ Str \"\" ]\n          , Span\n              ( \"blockquote\" , [ \"tag\" ] , [] ) [ Str \"blockquote\" ]\n          ]\n      ]\n  , Header\n      2\n      ( \"external links\" , [] , [] )\n      [ Str \"external\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Emph [ Str \"Google\" ]\n          , Space\n          , Str \"search\"\n          , Space\n          , Str \"engine\"\n          ]\n          ( \"http://google.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://pandoc.org\" ]\n          ( \"http://pandoc.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"ftp://vim.org\" ]\n          ( \"ftp://vim.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"http://google.com\" ]\n          ( \"http://google.com\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"email\" , Space , Str \"me\" ]\n          ( \"mailto:info@example.org\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"mailto:hello@bye.com\" ]\n          ( \"mailto:hello@bye.com\" , \"\" )\n      ]\n  , Header\n      2\n      ( \"internal links\" , [] , [] )\n      [ Str \"internal\" , Space , Str \"links\" ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"This is a link\" ]\n          ( \"This is a link\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Description\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"link\"\n          ]\n          ( \"This is a link source\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"projects/Important Project 1\" ]\n          ( \"projects/Important Project 1\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"../index\" ]\n          ( \"../index\" , \"\" )\n      , SoftBreak\n      , Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Other\" , Space , Str \"files\" ]\n          ( \"a subdirectory/\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"try\"\n          , Space\n          , Str \"me\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"test\"\n          , Space\n          , Str \"tag\"\n          , Space\n          , Str \"anchors\"\n          ]\n          ( \"#tag-one\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"try\"\n          , Space\n          , Str \"me\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"test\"\n          , Space\n          , Str \"header\"\n          , Space\n          , Str \"anchors\"\n          ]\n          ( \"#block quotes\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"try\"\n          , Space\n          , Str \"me\"\n          , Space\n          , Str \"to\"\n          , Space\n          , Str \"test\"\n          , Space\n          , Str \"strong\"\n          , Space\n          , Str \"anchors\"\n          ]\n          ( \"#strong\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"Tasks\" , Space , Str \"for\" , Space , Str \"tomorrow\" ]\n          ( \"Todo List#Tomorrow\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [ \"wikilink\" ] , [] )\n          [ Str \"diary:2017-05-01\" ]\n          ( \"diary/2017-05-01\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Important\" , Space , Str \"Data\" ]\n          ( \"file:../assets/data.csv\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"links with thumbnails\" , [] , [] )\n      [ Str \"links\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"thumbnails\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Image ( \"\" , [] , [] ) [ Str \"\" ] ( \"./movie.jpg\" , \"\" ) ]\n          ( \"http://www.google.com\" , \"\" )\n      ]\n  , Header 2 ( \"images\" , [] , [] ) [ Str \"images\" ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] ) [ Str \"\" ] ( \"file:./lalune.jpg\" , \"\" )\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [] )\n          [ Str \"Vimwiki\" ]\n          ( \"http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png\"\n          , \"\"\n          )\n      , SoftBreak\n      , Image\n          ( \"\" , [] , [] ) [ Str \"\" ] ( \"file:./movie.jpg\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"image with attributes\" , [] , [] )\n      [ Str \"image\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"attributes\"\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [ ( \"style\" , \"width:150px;height:120px;\" ) ] )\n          [ Emph [ Str \"cool\" , Space , Str \"stuff\" ] ]\n          ( \"lalune.jpg\" , \"\" )\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [ ( \"style\" , \"font-color:red\" ) ] )\n          [ Span ( \"Non-existing\" , [] , [] ) []\n          , Strong [ Str \"Non-existing\" ]\n          , Space\n          , Str \"image\"\n          ]\n          ( \"nonexist.jpg\" , \"\" )\n      ]\n  , Para\n      [ Image\n          ( \"\" , [] , [ ( \"style\" , \"width:150px;height:120px;\" ) ] )\n          [ Emph [ Str \"cool\" , Space , Str \"stuff\" ] ]\n          ( \"lalune.jpg\" , \"\" )\n      ]\n  , Header 2 ( \"lists\" , [] , [] ) [ Str \"lists\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"ordered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"here\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"some\"\n            , Space\n            , Str \"math\"\n            , Space\n            , Str \"belonging\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        , Para [ Math DisplayMath \"a^2 + b^2 = c^2\" ]\n        , Plain\n            [ Str \"and\"\n            , Space\n            , Str \"some\"\n            , Space\n            , Str \"preformatted\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"tables\"\n            , Space\n            , Str \"belonging\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            , Space\n            , Str \"as\"\n            , Space\n            , Str \"well\"\n            ]\n        , CodeBlock ( \"\" , [] , [] ) \"I'm part of item 1.\"\n        , Table\n            ( \"\" , [] , [] )\n            (Caption Nothing [])\n            [ ( AlignDefault , ColWidthDefault )\n            , ( AlignDefault , ColWidthDefault )\n            ]\n            (TableHead\n               ( \"\" , [] , [] )\n               [ Row\n                   ( \"\" , [] , [] )\n                   [ Cell\n                       ( \"\" , [] , [] )\n                       AlignDefault\n                       (RowSpan 1)\n                       (ColSpan 1)\n                       []\n                   , Cell\n                       ( \"\" , [] , [] )\n                       AlignDefault\n                       (RowSpan 1)\n                       (ColSpan 1)\n                       []\n                   ]\n               ])\n            [ TableBody\n                ( \"\" , [] , [] )\n                (RowHeadColumns 0)\n                []\n                [ Row\n                    ( \"\" , [] , [] )\n                    [ Cell\n                        ( \"\" , [] , [] )\n                        AlignDefault\n                        (RowSpan 1)\n                        (ColSpan 1)\n                        [ Plain [ Str \"this\" , Space , Str \"table\" ] ]\n                    , Cell\n                        ( \"\" , [] , [] )\n                        AlignDefault\n                        (RowSpan 1)\n                        (ColSpan 1)\n                        [ Plain [ Str \"is\" ] ]\n                    ]\n                , Row\n                    ( \"\" , [] , [] )\n                    [ Cell\n                        ( \"\" , [] , [] )\n                        AlignDefault\n                        (RowSpan 1)\n                        (ColSpan 1)\n                        [ Plain\n                            [ Str \"also\"\n                            , Space\n                            , Str \"a\"\n                            , Space\n                            , Str \"part\"\n                            ]\n                        ]\n                    , Cell\n                        ( \"\" , [] , [] )\n                        AlignDefault\n                        (RowSpan 1)\n                        (ColSpan 1)\n                        [ Plain\n                            [ Str \"of\"\n                            , Space\n                            , Str \"item\"\n                            , Space\n                            , Str \"1\"\n                            ]\n                        ]\n                    ]\n                ]\n            ]\n            (TableFoot ( \"\" , [] , [] ) [])\n        , Plain\n            [ Str \"and\"\n            , Space\n            , Str \"some\"\n            , Space\n            , Str \"more\"\n            , Space\n            , Str \"text\"\n            , Space\n            , Str \"belonging\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1.\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"ordered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"the\"\n            , Space\n            , Str \"#\"\n            , Space\n            , Str \"become\"\n            , Space\n            , Str \"numbers\"\n            , Space\n            , Str \"when\"\n            , Space\n            , Str \"converted\"\n            , Space\n            , Str \"to\"\n            , Space\n            , Str \"HTML\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain [ Str \"Item\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Item\" , Space , Str \"2\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"Sub\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"1\"\n                  , Space\n                  , Str \"(indentation\"\n                  , Space\n                  , Str \"4\"\n                  , Space\n                  , Str \"spaces)\"\n                  , SoftBreak\n                  , Str \"Sub\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"1\"\n                  , Space\n                  , Str \"continued\"\n                  , Space\n                  , Str \"line.\"\n                  , SoftBreak\n                  , Str \"Sub\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"1\"\n                  , Space\n                  , Str \"next\"\n                  , Space\n                  , Str \"continued\"\n                  , Space\n                  , Str \"line.\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"Sub\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"2,\"\n                  , Space\n                  , Str \"as\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"ordered\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"even\"\n                  , Space\n                  , Str \"though\"\n                  , Space\n                  , Str \"the\"\n                  , Space\n                  , Str \"identifier\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Code ( \"\" , [] , [] ) \"*\"\n                  , Space\n                  , Str \"(indentation\"\n                  , Space\n                  , Str \"2\"\n                  , Space\n                  , Str \"spaces\"\n                  , Space\n                  , Str \"followed\"\n                  , Space\n                  , Str \"by\"\n                  , Space\n                  , Str \"one\"\n                  , Space\n                  , Str \"tab\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"width\"\n                  , Space\n                  , Str \"4)\"\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"etc.\"\n                  , SoftBreak\n                  , Str \"Continuation\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"Item\"\n                  , Space\n                  , Str \"2\"\n                  , SoftBreak\n                  , Str \"Next\"\n                  , Space\n                  , Str \"continuation\"\n                  , Space\n                  , Str \"of\"\n                  , Space\n                  , Str \"Item\"\n                  , Space\n                  , Str \"2\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"But\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"new\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"1\" ]\n        , BulletList [ [ Plain [ Code ( \"\" , [] , [] ) \"1.1\" ] ] ]\n        ]\n      , [ Plain [ Str \"2\" ]\n        , BulletList [ [ Plain [ Str \"2.1\" ] ] ]\n        ]\n      ]\n  , BulletList [ [ Plain [ Str \"3\" ] ] ]\n  , Header\n      3\n      ( \"ordered lists with non-# identifiers\" , [] , [] )\n      [ Str \"ordered\"\n      , Space\n      , Str \"lists\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"non-#\"\n      , Space\n      , Str \"identifiers\"\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Numbered\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"1\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"2\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Str \"Numbered\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"sub\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"1\"\n                  ]\n              ]\n            , [ Plain [ Str \"more\" , Space , Str \"...\" ]\n              , BulletList\n                  [ [ Plain\n                        [ Str \"and\"\n                        , Space\n                        , Str \"more\"\n                        , Space\n                        , Str \"...\"\n                        ]\n                    ]\n                  , [ Plain [ Str \"...\" ] ]\n                  ]\n              ]\n            , [ Plain\n                  [ Str \"Numbered\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"sub\"\n                  , Space\n                  , Str \"item\"\n                  , Space\n                  , Str \"3\"\n                  ]\n              , OrderedList\n                  ( 1 , DefaultStyle , DefaultDelim )\n                  [ [ Plain\n                        [ Str \"Numbered\"\n                        , Space\n                        , Str \"list\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"item\"\n                        , Space\n                        , Str \"1\"\n                        ]\n                    ]\n                  , [ Plain\n                        [ Str \"Numbered\"\n                        , Space\n                        , Str \"list\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"sub\"\n                        , Space\n                        , Str \"item\"\n                        , Space\n                        , Str \"2\"\n                        ]\n                    ]\n                  ]\n              ]\n            , [ Plain [ Str \"etc.\" ] ]\n            ]\n        ]\n      , [ Plain\n            [ Str \"Bulleted\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , Space\n            , Str \"3\"\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"todo lists\" , [] , [] )\n      [ Str \"todo\" , Space , Str \"lists\" ]\n  , BulletList\n      [ [ Plain\n            [ Span ( \"\" , [ \"done0\" ] , [] ) []\n            , Str \"task\"\n            , Space\n            , Str \"1\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain [ Span ( \"\" , [ \"done1\" ] , [] ) [] , Str \"5\" ] ]\n            ]\n        ]\n      , [ Plain [ Span ( \"\" , [ \"done2\" ] , [] ) [] , Str \"3\" ] ]\n      , [ Plain\n            [ Str \"[]\"\n            , Space\n            , Str \"not\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"todo\"\n            , Space\n            , Str \"item\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"[\"\n            , Space\n            , Str \"]not\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"todo\"\n            , Space\n            , Str \"item\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"[r]\"\n            , Space\n            , Str \"not\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"todo\"\n            , Space\n            , Str \"item\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"[\"\n            , Space\n            , Str \"]\"\n            , Space\n            , Str \"not\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"todo\"\n            , Space\n            , Str \"item\"\n            ]\n        ]\n      , [ Plain\n            [ Span ( \"\" , [ \"done2\" ] , [] ) []\n            , Str \"a\"\n            , Space\n            , Str \"tab\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"todo\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"marker\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"[ ]\"\n            ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim )\n            [ [ Plain\n                  [ Span ( \"\" , [ \"done3\" ] , [] ) []\n                  , Str \"4\"\n                  , SoftBreak\n                  , Str \"5\"\n                  ]\n              ]\n            , [ Plain [ Span ( \"\" , [ \"done4\" ] , [] ) [] ]\n              , Table\n                  ( \"\" , [] , [] )\n                  (Caption Nothing [])\n                  [ ( AlignDefault , ColWidthDefault )\n                  , ( AlignDefault , ColWidthDefault )\n                  ]\n                  (TableHead\n                     ( \"\" , [] , [] )\n                     [ Row\n                         ( \"\" , [] , [] )\n                         [ Cell\n                             ( \"\" , [] , [] )\n                             AlignDefault\n                             (RowSpan 1)\n                             (ColSpan 1)\n                             []\n                         , Cell\n                             ( \"\" , [] , [] )\n                             AlignDefault\n                             (RowSpan 1)\n                             (ColSpan 1)\n                             []\n                         ]\n                     ])\n                  [ TableBody\n                      ( \"\" , [] , [] )\n                      (RowHeadColumns 0)\n                      []\n                      [ Row\n                          ( \"\" , [] , [] )\n                          [ Cell\n                              ( \"\" , [] , [] )\n                              AlignDefault\n                              (RowSpan 1)\n                              (ColSpan 1)\n                              [ Plain [ Str \"a\" ] ]\n                          , Cell\n                              ( \"\" , [] , [] )\n                              AlignDefault\n                              (RowSpan 1)\n                              (ColSpan 1)\n                              [ Plain [ Str \"b\" ] ]\n                          ]\n                      ]\n                  ]\n                  (TableFoot ( \"\" , [] , [] ) [])\n              ]\n            ]\n        ]\n      , [ Plain\n            [ Span ( \"\" , [ \"done4\" ] , [] ) []\n            , Str \"task\"\n            , Space\n            , Str \"2\"\n            ]\n        ]\n      ]\n  , Header 2 ( \"math\" , [] , [] ) [ Str \"math\" ]\n  , Para [ Math InlineMath \" \\\\sum_i a_i^2 = 1 \" ]\n  , Para [ Math DisplayMath \"\\\\sum_i a_i^2\\n=\\n1\" ]\n  , Para\n      [ Math\n          DisplayMath\n          \"\\\\begin{aligned}\\n\\\\sum_i a_i^2 &= 1 + 1 \\\\\\\\\\n&= 2.\\n\\\\end{aligned}\"\n      ]\n  , Para\n      [ Str \"edge\"\n      , Space\n      , Str \"case\"\n      , Space\n      , Str \"(the\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"c^2 + \"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"multline\"\n      , Space\n      , Str \"tag\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"equation):\"\n      ]\n  , Para\n      [ Math\n          DisplayMath\n          \"\\\\begin{gathered}\\nc^2 + \\na^2 + b^2\\n\\\\end{gathered}\"\n      ]\n  , Para\n      [ Str \"edge\"\n      , Space\n      , Str \"case\"\n      , Space\n      , Str \"(the\"\n      , Space\n      , Str \"tag\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"hello%bye\"\n      , Str \")\"\n      ]\n  , Para\n      [ Math\n          DisplayMath\n          \"\\\\begin{hello%bye}\\n\\\\int_a^b f(x) dx\\n\\\\end{hello%bye}\"\n      ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"dollar\"\n      , Space\n      , Str \"signs:\"\n      , Space\n      , Str \"$$\"\n      ]\n  , Para\n      [ Str \"[not\"\n      , Space\n      , Str \"math]\"\n      , Space\n      , Str \"You\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"$1\"\n      , SoftBreak\n      , Str \"and\"\n      , Space\n      , Str \"I\"\n      , Space\n      , Str \"have\"\n      , Space\n      , Str \"$1.\"\n      ]\n  , Header 2 ( \"tags\" , [] , [] ) [ Str \"tags\" ]\n  , Para\n      [ Span ( \"-tag-one\" , [] , [] ) [ Str \"\" ]\n      , Span ( \"tag-one\" , [ \"tag\" ] , [] ) [ Str \"tag-one\" ]\n      , Space\n      , Span ( \"-tag-two\" , [] , [] ) [ Str \"\" ]\n      , Span ( \"tag-two\" , [ \"tag\" ] , [] ) [ Str \"tag-two\" ]\n      ]\n  , Header 2 ( \"tables\" , [] , [] ) [ Str \"tables\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Year\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Temperature\" , Space , Str \"(low)\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Temperature\" , Space , Str \"(high)\" ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1900\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-10\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"25\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1910\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-15\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"30\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1920\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-10\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"32\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1930\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Emph [ Str \"N/A\" ] ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Emph [ Str \"N/A\" ] ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"1940\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"-2\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"40\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      3\n      ( \"centered headerless tables\" , [] , [] )\n      [ Str \"centered\"\n      , Space\n      , Str \"headerless\"\n      , Space\n      , Str \"tables\"\n      ]\n  , Div\n      ( \"\" , [ \"center\" ] , [] )\n      [ Table\n          ( \"\" , [] , [] )\n          (Caption Nothing [])\n          [ ( AlignDefault , ColWidthDefault )\n          , ( AlignDefault , ColWidthDefault )\n          ]\n          (TableHead\n             ( \"\" , [] , [] )\n             [ Row\n                 ( \"\" , [] , [] )\n                 [ Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     []\n                 , Cell\n                     ( \"\" , [] , [] )\n                     AlignDefault\n                     (RowSpan 1)\n                     (ColSpan 1)\n                     []\n                 ]\n             ])\n          [ TableBody\n              ( \"\" , [] , [] )\n              (RowHeadColumns 0)\n              []\n              [ Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Plain [ Str \"a\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Plain [ Str \"b\" ] ]\n                  ]\n              , Row\n                  ( \"\" , [] , [] )\n                  [ Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Plain [ Str \"c\" ] ]\n                  , Cell\n                      ( \"\" , [] , [] )\n                      AlignDefault\n                      (RowSpan 1)\n                      (ColSpan 1)\n                      [ Plain [ Str \"d\" ] ]\n                  ]\n              ]\n          ]\n          (TableFoot ( \"\" , [] , [] ) [])\n      ]\n  , Header 2 ( \"paragraphs\" , [] , [] ) [ Str \"paragraphs\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"first\"\n      , Space\n      , Str \"paragraph\"\n      , SoftBreak\n      , Str \"with\"\n      , Space\n      , Str \"two\"\n      , Space\n      , Str \"lines.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"second\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"with\"\n      , SoftBreak\n      , Str \"two\"\n      , Space\n      , Str \"lines\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"many\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"lines.\"\n      ]\n  , Header\n      2\n      ( \"definition list\" , [] , [] )\n      [ Str \"definition\" , Space , Str \"list\" ]\n  , DefinitionList\n      [ ( [ Str \"Term\" , Space , Str \"1\" ]\n        , [ [ Plain [ Str \"Definition\" , Space , Str \"1\" ] ] ]\n        )\n      , ( [ Str \"Term\" , Space , Str \"2\" ]\n        , [ [ Plain [ Str \"Definition\" , Space , Str \"2\" ] ]\n          , [ Plain [ Str \"Definition\" , Space , Str \"3\" ] ]\n          ]\n        )\n      , ( [ Str \"Term\"\n          , Space\n          , Str \"::\"\n          , Space\n          , Span ( \"separated\" , [] , [] ) []\n          , Strong [ Str \"separated\" ]\n          , Space\n          , Str \"by\"\n          , Space\n          , Str \"::\"\n          , Space\n          , Emph [ Str \"double\" , Space , Str \"colons\" ]\n          ]\n        , [ [ Plain [ Str \"Def1\" ] ] , [ Plain [ Str \"Def2\" ] ] ]\n        )\n      , ( [ Str \"Term\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"lots\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"trailing\"\n          , Space\n          , Str \"colons:::::::\"\n          ]\n        , [ [ Plain [ Str \"Definition\" ] ] ]\n        )\n      , ( [ Str \"::\"\n          , Space\n          , Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"::\"\n          , Space\n          , Str \"A\"\n          , Space\n          , Str \"term\"\n          , Space\n          , Str \"(rather\"\n          , Space\n          , Str \"than\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"definition)\"\n          ]\n        , [ [ Plain\n                [ Str \"and\"\n                , Space\n                , Str \"this\"\n                , Space\n                , Str \"is\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"definition\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Str \"Term\"\n          , Space\n          , Str \"Without\"\n          , Space\n          , Str \"definitions\"\n          ]\n        , [ [] ]\n        )\n      , ( [ Str \"Part\"\n          , Space\n          , Str \"::\"\n          , Space\n          , Str \"of\"\n          , Space\n          , Str \"::\"\n          , Space\n          , Str \"dt\"\n          ]\n        , [ [ Plain\n                [ Str \"part\" , Space , Str \"of\" , Space , Str \"::dd\" ]\n            ]\n          ]\n        )\n      ]\n  , DefinitionList\n      [ ( []\n        , [ [ Plain\n                [ Str \"Definition\"\n                , Space\n                , Str \"1\"\n                , Space\n                , Str \"without\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"term\"\n                ]\n            ]\n          , [ Plain\n                [ Str \"Definition\"\n                , Space\n                , Str \"2\"\n                , Space\n                , Str \"without\"\n                , Space\n                , Str \"a\"\n                , Space\n                , Str \"term\"\n                ]\n            ]\n          ]\n        )\n      ]\n  , DefinitionList\n      [ ( [ Str \"T1\" ] , [ [ Plain [ Str \"D1\" ] ] ] ) ]\n  , Para [ Str \"new\" , Space , Str \"paragraph\" ]\n  , DefinitionList\n      [ ( [ Str \"T1\" ] , [ [ Plain [ Str \"D1\" ] ] ] ) ]\n  , Para [ Str \"Not::Definition\" ]\n  , Para [ Str \"Not\" , Space , Str \"::Definition\" ]\n  , Para [ Str \"::Not\" , Space , Str \"definition\" ]\n  , BlockQuote\n      [ Plain [ Str \"::\" , Space , Str \"blockquote\" ] ]\n  , BlockQuote\n      [ Plain\n          [ Str \"block\" , Space , Str \"::\" , Space , Str \"quote\" ]\n      ]\n  , Header\n      2\n      ( \"metadata placeholders\" , [] , [] )\n      [ Str \"metadata\" , Space , Str \"placeholders\" ]\n  , Para\n      [ Str \"%this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"placeholder\"\n      ]\n  , Para\n      [ Str \"placeholders\"\n      , SoftBreak\n      , Str \"serves\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"space\"\n      , Space\n      , Str \"/\"\n      , Space\n      , Str \"softbreak\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"paragraphs\"\n      ]\n  , Header\n      2\n      ( \"sup, sub\" , [] , [] )\n      [ Str \"sup,\" , Space , Str \"sub\" ]\n  , Para [ Str \"super\" , Superscript [ Str \"script\" ] ]\n  , Para [ Str \"sub\" , Subscript [ Str \"script\" ] ]\n  , Header\n      2\n      ( \"the todo mark\" , [] , [] )\n      [ Str \"the\" , Space , Str \"todo\" , Space , Str \"mark\" ]\n  , Para [ Span ( \"\" , [ \"todo\" ] , [] ) [ Str \"TODO:\" ] ]\n  , Header\n      1\n      ( \"not implemented yet\" , [] , [] )\n      [ Emph\n          [ Span ( \"not implemented yet\" , [] , [] ) []\n          , Strong\n              [ Str \"not\"\n              , Space\n              , Str \"implemented\"\n              , Space\n              , Str \"yet\"\n              ]\n          ]\n      ]\n  , Header\n      2\n      ( \"tables with spans\" , [] , [] )\n      [ Str \"tables\" , Space , Str \"with\" , Space , Str \"spans\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"a\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"d\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"\\\\/\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"e\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \">\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"f\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"\\\\/\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"\\\\/\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \">\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"g\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"h\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \">\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \">\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \">\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      2\n      ( \"tables with multiple lines of headers\" , [] , [] )\n      [ Str \"tables\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"multiple\"\n      , Space\n      , Str \"lines\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"headers\"\n      ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 []\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"a\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"b\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"c\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"d\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"---\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"---\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header\n      2\n      ( \"some other placeholders\" , [] , [] )\n      [ Str \"some\"\n      , Space\n      , Str \"other\"\n      , Space\n      , Str \"placeholders\"\n      ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"template\"\n      , Space\n      , Str \"placeholder\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"ignored.\"\n      ]\n  , Para\n      [ Code ( \"\" , [] , [] ) \"nohtml\"\n      , Space\n      , Str \"placeholder\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"ignored.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/vimwiki-reader.wiki",
    "content": "= _*implemented*_ =\n= header =\n\n== header level two ==\n\n=== header `level` 3 ===\n\n==== header ~~level~~ four ====\n\n===== header _*level* 5_ =====\n\n====== header level 6 ======\n\n======= not a header ========\n\nhi== not a header ==\n\n=== not a header ==\n\n=== not a header ===-\n\nnot a header:\n\n=n=\n\n=== not a header ====\n\n == centred header ==\n \n== header with some `==` in between ==\n== header with some == in between ==\n== header with some ==in between ==\n\n== emph strong and strikeout ==\n\n_emph_ *strong*\n\n*_strong and emph_*\n\n_*emph and strong*_\n\n*_emph inside_ strong*\n\n*strong with _emph_*\n\n_*strong inside* emph_\n\n_~~strikeout~~ inside emph_\n\n~~This is _struck out_ with emph~~ \n\n*not\nstrong*\n\njust two stars: **\n\njust two underscores: __\n\njust four ~s: ~~~~\n\n_not\n%%comment\nemph_\n\n~~not\n    %%comment\n  %%comment\nstrikeout~~\n\n== horizontal rule ==\n\ntop\n----\nmiddle\n\n-------\n\nnot a rule-----\n\nnot a rule (trailing spaces):\n----- \n\nnot a rule (leading spaces):\n  ----\n\n== comments ==\n\n%% you can't see me.\n\nthis \n%% secret\nis %% not secret\n\n== inline code ==\n\nHere is some `inline code`.\n\nJust two backticks: ``\n\n== preformatted text ==\n\n{{{\n  Tyger! Tyger! burning bright\n   In the forests of the night,\n    What immortal hand or eye\n     Could frame thy fearful symmetry?\n  In what distant deeps or skies\n   Burnt the fire of thine eyes?\n    On what wings dare he aspire?\n     What the hand dare sieze the fire?\n}}}\n\n=== preformatted text with attributes ===\n\n {{{class=\"python\" style=\"color:blue\"\n for i in range(1, 5):\n     print(i)\n }}}\n\n=== preformatted text with nested syntax ===\n\n{{{sql\nSELECT * FROM table\n}}}\n\n=== empty preformatted text ===\n\n{{{\n}}}\n\n== block quotes ==\n\n    (indentation 4 spaces) This would be a blockquote in Vimwiki. It is not *highlighted* in Vim but\n    (indentation 1 space followed by 1 tab of width 4) could be styled by CSS in HTML. Blockquotes are usually used to quote a\n    (indentation 1 tab of width 4) long piece of text from another source. ~~blah blah~~ :blockquote:\n\n== external links ==\n\n[[http://google.com|_Google_ search engine]]\n\nhttp://pandoc.org\n\nftp://vim.org\n\n[[http://google.com]] \n\n[[mailto:info@example.org|email me]]\n\nmailto:hello@bye.com\n\n== internal links ==\n\n[[This is a link]]\n\n[[This is a link source|Description of the link]]\n\n[[projects/Important Project 1]]\n   \n[[../index]]\n  \n[[a subdirectory/|Other files]]\n\n[[#tag-one|try me to test tag anchors]]\n\n[[#block quotes|try me to test header anchors]]\n\n[[#strong|try me to test strong anchors]]\n\n[[Todo List#Tomorrow|Tasks for tomorrow]]\n\n[[diary:2017-05-01]]\n\n[[file:../assets/data.csv|Important Data]]\n\n=== links with thumbnails ===\n[[http://www.google.com|{{./movie.jpg}}]]\n\n== images ==\n\n{{file:./lalune.jpg}}\n\n{{http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png|Vimwiki}}\n  \n{{local:./movie.jpg}}  \n\n\n=== image with attributes ===\n{{lalune.jpg|_cool stuff_|style=\"width:150px;height:120px;\"}}\n\n{{nonexist.jpg|*Non-existing* image|class=\"center flow blabla\" style=\"font-color:red\"}}\n\n{{lalune.jpg|_cool stuff_|style=\"width:150px;height:120px;\"|anything in this segment is ignored}}\n\n\n== lists ==\n\n\n# ordered list item 1, and here is some math belonging to list item 1\n {{$\n a^2 + b^2 = c^2\n }}$\n  and some preformatted and tables belonging to item 1 as well\n{{{\nI'm part of item 1.\n}}}\n| this table  | is        |\n| also a part | of item 1 |\n and some more text belonging to item 1.\n# ordered list item 2\n\n\n* Bulleted list item 1\n* Bulleted list item 2\n\n\n# Bulleted list item 1\n# the # become numbers when converted to HTML\n\n- Bulleted list item 1\n- Bulleted list item 2\n\n* Item 1\n* Item 2\n    # Sub item 1 (indentation 4 spaces)\n  Sub item 1 continued line.\n%%comments\n    Sub item 1 next continued line.\n    * Sub item 2, as an ordered list item even though the identifier is `*` (indentation 2 spaces followed by one tab of width 4)\n    * etc.\n Continuation of Item 2\n Next continuation of Item 2\nBut this is a new paragraph.\n\n# 1\n    * `1.1`\n  * 2\n      * 2.1\n * 3\n\n=== ordered lists with non-# identifiers ===\n1. Numbered list item 1\n2. Numbered list item 2\n3. Numbered list item 3\n\n4. Numbered list item 1\n5. Numbered list item 2\n6. Numbered list item 3\n\n1) Numbered list item 1\n2) Numbered list item 2\n3) Numbered list item 3\n\na) Numbered list item 1\nb) Numbered list item 2\nc) Numbered list item 3\n\nA) Numbered list item 1\nB) Numbered list item 2\nC) Numbered list item 3\n\ni) Numbered list item 1\nii) Numbered list item 2\niii) Numbered list item 3\n\nI) Numbered list item 1\nII) Numbered list item 2\nIII) Numbered list item 3\n\n- Bulleted list item 1\n- Bulleted list item 2\n  a) Numbered list sub item 1\n  b) more ...\n    * and more ...\n    * ...\n  c) Numbered list sub item 3\n    1. Numbered list sub sub item 1\n    2. Numbered list sub sub item 2\n  d) etc.\n- Bulleted list item 3\n\n== todo lists ==\n* [ ] task 1\n    1. [.] 5\n* [o] 3\n* [] not a todo item\n* [ ]not a todo item\n* [r] not a todo item\n* [     ] not a todo item\n* [o] a tab in the todo list marker `[ ]`\n    III) [O] 4\n      5\n    i) [X] \n| a | b |\n* [X] task 2\n\n== math ==\n\n$ \\sum_i a_i^2 = 1 $\n\n{{$\n\\sum_i a_i^2\n=\n1\n}}$\n\n{{$%align%\n\\sum_i a_i^2 &= 1 + 1 \\\\\n&= 2.\n}}$\n\nedge case (the `c^2 + ` after the multline tag is in the equation):\n{{$%multline%c^2 + \na^2 + b^2\n}}$\n\nedge case (the tag is `hello%bye`)\n{{$%hello%bye%\n\\int_a^b f(x) dx\n}}$\n\nJust two dollar signs: $$\n\n[not math] You have $1\nand I have $1.\n\n== tags ==\n\n:tag-one:tag-two:\n\n== tables ==\n \n| Year | Temperature (low) | Temperature (high) |\n|------|-------------------|--------------------|\n| 1900 | -10               | 25                 |\n| 1910 | -15               | 30                 |\n| 1920 | -10               | 32                 |\n| 1930 | _N/A_             | _N/A_              |\n| 1940 | -2                | 40                 |\n\n\n=== centered headerless tables ===\n | a | b |\n | c | d |\n \n \n== paragraphs ==\n\nThis is first paragraph\nwith two lines.\n\n\n\n\n\n\n\n\nThis is a second paragraph with\ntwo lines after many blank lines.\n\n== definition list ==\n\nTerm 1:: Definition 1\nTerm 2::\n:: Definition 2\n  :: Definition 3\nTerm :: *separated* by :: _double colons_ :: Def1\n:: Def2\nTerm with lots of trailing colons::::::::: Definition\n:: This is :: A term (rather than a definition) :: and this is a definition\nTerm Without definitions ::\n::\nPart :: of :: dt :: part of ::dd\n\n:: Definition 1 without a term\n:: Definition 2 without a term\n\nT1 :: D1\nnew paragraph\nT1 :: D1\n\nNot::Definition\n\nNot ::Definition\n\n::Not definition\n\n    :: blockquote\n    \n    block :: quote\n\n== metadata placeholders ==\n%title title\n%date 2017-05-01\n\n%title second title is ignored\n%date second date is ignored\n\n%this is not a placeholder\n\nplaceholders\n%title another title\n%date 2017-04-23\nserves as space / softbreak in paragraphs\n\n\n== sup, sub ==\n\nsuper^script^\n\nsub,,script,,\n\n== the todo mark ==\nTODO:\n\n= _*not implemented yet*_ =\n== tables with spans ==\n| a  | b  | c | d |\n| \\/ | e  | > | f |\n| \\/ | \\/ | > | g |\n| h  | >  | > | > |\n\n== tables with multiple lines of headers ==\n| a | b |\n| c | d |\n|---|---|\n\n== some other placeholders ==\n`template` placeholder is ignored.\n%template template\n\n`nohtml` placeholder is ignored.\n%nohtml\n\n\n"
  },
  {
    "path": "test/writer.asciidoc",
    "content": "= Pandoc Test Suite\nJohn MacFarlane; Anonymous\nJuly 17, 2006\n:stem: latexmath\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n'''''\n\n== Headers\n\n=== Level 2 with an link:/url[embedded link]\n\n==== Level 3 with _emphasis_\n\n===== Level 4\n\n====== Level 5\n\n== Level 1\n\n=== Level 2 with _emphasis_\n\n==== Level 3\n\nwith no blank line\n\n=== Level 2\n\nwith no blank line\n\n'''''\n\n== Paragraphs\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. ++*++ criminey.\n\nThere should be a hard line break +\nhere.\n\n'''''\n\n== Block Quotes\n\nE-mail style:\n\n____\nThis is a block quote. It is pretty short.\n____\n\n____\n--\nCode in a block quote:\n\n....\nsub status {\n    print \"working\";\n}\n....\n\nA list:\n\n[arabic]\n. item one\n. item two\n\nNested block quotes:\n\n____\nnested\n____\n\n____\nnested\n____\n\n--\n____\n\nThis should not be a block quote: 2 ++>++ 1.\n\nAnd a following paragraph.\n\n'''''\n\n== Code Blocks\n\nCode:\n\n....\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n....\n\nAnd:\n\n....\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n....\n\n'''''\n\n== Lists\n\n=== Unordered\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\n=== Ordered\n\nTight:\n\n[arabic]\n. First\n. Second\n. Third\n\nand:\n\n[arabic]\n. One\n. Two\n. Three\n\nLoose using tabs:\n\n[arabic]\n. First\n. Second\n. Third\n\nand using spaces:\n\n[arabic]\n. One\n. Two\n. Three\n\nMultiple paragraphs:\n\n[arabic]\n. Item 1, graf one.\n+\nItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n. Item 2.\n. Item 3.\n\n=== Nested\n\n* Tab\n** Tab\n*** Tab\n\nHere’s another:\n\n[arabic]\n. First\n. Second:\n* Fee\n* Fie\n* Foe\n. Third\n\nSame thing but with paragraphs:\n\n[arabic]\n. First\n. Second:\n* Fee\n* Fie\n* Foe\n. Third\n\n=== Tabs and spaces\n\n* this is a list item indented with tabs\n* this is a list item indented with spaces\n** this is an example list item indented with tabs\n** this is an example list item indented with spaces\n\n=== Fancy list markers\n\n[arabic, start=2]\n. begins with 2\n. and now 3\n+\nwith a continuation\n[lowerroman, start=4]\n.. sublist with roman numerals, starting with 4\n.. more items\n[upperalpha]\n... a subsublist\n... a subsublist\n\nNesting:\n\n[upperalpha]\n. Upper Alpha\n[upperroman]\n.. Upper Roman.\n[arabic, start=6]\n... Decimal start with 6\n[loweralpha, start=3]\n.... Lower alpha with paren\n\nAutonumbering:\n\n. Autonumber.\n. More.\n.. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n'''''\n\n== Definition Lists\n\nTight using spaces:\n\napple::\n  red fruit\norange::\n  orange fruit\nbanana::\n  yellow fruit\n\nTight using tabs:\n\napple::\n  red fruit\norange::\n  orange fruit\nbanana::\n  yellow fruit\n\nLoose:\n\napple::\n  red fruit\norange::\n  orange fruit\nbanana::\n  yellow fruit\n\nMultiple blocks with italics:\n\n_apple_::\n  red fruit\n  +\n  contains seeds, crisp, pleasant to taste\n_orange_::\n  orange fruit\n  +\n....\n{ orange code block }\n....\n  +\n  ____\n  orange block quote\n  ____\n\nMultiple definitions, tight:\n\napple::\n  red fruit\n  +\n  computer\norange::\n  orange fruit\n  +\n  bank\n\nMultiple definitions, loose:\n\napple::\n  red fruit\n  +\n  computer\norange::\n  orange fruit\n  +\n  bank\n\nBlank line after term, indented marker, alternate markers:\n\napple::\n  red fruit\n  +\n  computer\norange::\n  orange fruit\n  +\n  [arabic]\n  . sublist\n  . sublist\n\n== HTML Blocks\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is _emphasized_\n\nAnd this is *strong*\n\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n....\n<div>\n    foo\n</div>\n....\n\nAs should this:\n\n....\n<div>foo</div>\n....\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n....\n<!-- Comment -->\n....\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n....\n<hr />\n....\n\nHr’s:\n\n'''''\n\n== Inline Markup\n\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _link:/url[emphasized link]_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: `++>++`, `$`, `++\\++`, `++\\++$`, `++<++html++>++`.\n\n[line-through]#This is _strikeout_.#\n\nSuperscripts: a^bc^d a^_hello_^ a^hello there^.\n\nSubscripts: H~2~O, H~23~O, H~many of them~O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n'''''\n\n== Smart quotes, ellipses, dashes\n\n\"`Hello,`\" said the spider. \"`'`Shelob`' is my name.`\"\n\n'`A`', '`B`', and '`C`' are letters.\n\n'`Oak,`' '`elm,`' and '`beech`' are names of trees. So is '`pine.`'\n\n'`He said, \"`I want to go.`\"`' Were you alive in the 70’s?\n\nHere is some quoted '``code``' and a \"`http://example.com/?foo=1&bar=2[quoted\nlink]`\".\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n'''''\n\n== LaTeX\n\n* \n* latexmath:[2+2=4]\n* latexmath:[x \\in y]\n* latexmath:[\\alpha \\wedge \\omega]\n* latexmath:[223]\n* latexmath:[p]-Tree\n* Here’s some display math:\n+\n[latexmath]\n++++\n\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\n++++\n* Here’s one that has a line break in it:\nlatexmath:[\\alpha + \\omega \\times x^2].\n\nThese shouldn’t be math:\n\n* To get the famous equation, write `$e = mc^2$`.\n* $22,000 is a _lot_ of money. So is $34,000. (It worked if \"`lot`\" is\nemphasized.)\n* Shoes ($20) and socks ($5).\n* Escaped `$`: $73 _this should be emphasized_ 23$.\n\nHere’s a LaTeX table:\n\n'''''\n\n== Special Characters\n\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 ++<++ 5.\n\n6 ++>++ 5.\n\nBackslash: ++\\++\n\nBacktick: ++`++\n\nAsterisk: ++*++\n\nUnderscore: ++_++\n\nLeft brace: ++{++\n\nRight brace: }\n\nLeft bracket: ++[++\n\nRight bracket: ++]++\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: ++>++\n\nHash: ++#++\n\nPeriod: .\n\nBang: !\n\nPlus: {plus}\n\nMinus: -\n\n'''''\n\n== Links\n\n=== Explicit\n\nJust a link:/url/[URL].\n\nlink:/url/[URL and title].\n\nlink:/url/[URL and title].\n\nlink:/url/[URL and title].\n\nlink:/url/[URL and title]\n\nlink:/url/[URL and title]\n\nlink:/url/with_underscore[with++_++underscore]\n\nmailto:nobody@nowhere.net[Email link]\n\nlink:[Empty].\n\n=== Reference\n\nFoo link:/url/[bar].\n\nWith link:/url/[embedded ++[++brackets++]++].\n\nlink:/url/[b] by itself should be a link.\n\nIndented link:/url[once].\n\nIndented link:/url[twice].\n\nIndented link:/url[thrice].\n\nThis should ++[++not++][]++ be a link.\n\n....\n[not]: /url\n....\n\nFoo link:/url/[bar].\n\nFoo link:/url/[biz].\n\n=== With ampersands\n\nHere’s a http://example.com/?foo=1&bar=2[link with an ampersand in the URL].\n\nHere’s a link with an amersand in the link text: http://att.com/[AT&T].\n\nHere’s an link:/script?foo=1&bar=2[inline link].\n\nHere’s an link:/script?foo=1&bar=2[inline link in pointy braces].\n\n=== Autolinks\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n* In a list?\n* http://example.com/\n* It should.\n\nAn e-mail address: nobody@nowhere.net\n\n____\nBlockquoted: http://example.com/\n____\n\nAuto-links should not occur here: `++<++http://example.com/++>++`\n\n....\nor here: <http://example.com/>\n....\n\n'''''\n\n== Images\n\nFrom \"`Voyage dans la Lune`\" by Georges Melies (1902):\n\n.lalune\nimage::lalune.jpg[lalune,title=\"Voyage dans la Lune\"]\n\nHere is a movie image:movie.jpg[movie] icon.\n\n'''''\n\n== Footnotes\n\nHere is a footnote reference,footnote:[Here is the footnote. It can go anywhere\nafter the footnote reference. It need not be placed at the end of the document.]\nand another.[multiblock footnote omitted] This should _not_ be a footnote\nreference, because it contains a space.++[++^my note++]++ Here is an inline\nnote.footnote:[This is _easier_ to type. Inline notes may contain\nhttp://google.com[links] and `++]++` verbatim characters, as well as\n++[++bracketed text++]++.]\n\n____\nNotes can go in quotes.footnote:[In quote.]\n____\n\n[arabic]\n. And in list items.footnote:[In list.]\n\nThis paragraph should not be part of the note, as it is not indented.\n"
  },
  {
    "path": "test/writer.asciidoc_legacy",
    "content": "= Pandoc Test Suite\nJohn MacFarlane; Anonymous\nJuly 17, 2006\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n'''''\n\n== Headers\n\n=== Level 2 with an link:/url[embedded link]\n\n==== Level 3 with _emphasis_\n\n===== Level 4\n\n====== Level 5\n\n== Level 1\n\n=== Level 2 with _emphasis_\n\n==== Level 3\n\nwith no blank line\n\n=== Level 2\n\nwith no blank line\n\n'''''\n\n== Paragraphs\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. ++*++ criminey.\n\nThere should be a hard line break +\nhere.\n\n'''''\n\n== Block Quotes\n\nE-mail style:\n\n____\nThis is a block quote. It is pretty short.\n____\n\n____\n--\nCode in a block quote:\n\n....\nsub status {\n    print \"working\";\n}\n....\n\nA list:\n\n[arabic]\n. item one\n. item two\n\nNested block quotes:\n\n____\nnested\n____\n\n____\nnested\n____\n\n--\n____\n\nThis should not be a block quote: 2 ++>++ 1.\n\nAnd a following paragraph.\n\n'''''\n\n== Code Blocks\n\nCode:\n\n....\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n....\n\nAnd:\n\n....\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n....\n\n'''''\n\n== Lists\n\n=== Unordered\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\n=== Ordered\n\nTight:\n\n[arabic]\n. First\n. Second\n. Third\n\nand:\n\n[arabic]\n. One\n. Two\n. Three\n\nLoose using tabs:\n\n[arabic]\n. First\n. Second\n. Third\n\nand using spaces:\n\n[arabic]\n. One\n. Two\n. Three\n\nMultiple paragraphs:\n\n[arabic]\n. Item 1, graf one.\n+\nItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n. Item 2.\n. Item 3.\n\n=== Nested\n\n* Tab\n** Tab\n*** Tab\n\nHere’s another:\n\n[arabic]\n. First\n. Second:\n* Fee\n* Fie\n* Foe\n. Third\n\nSame thing but with paragraphs:\n\n[arabic]\n. First\n. Second:\n* Fee\n* Fie\n* Foe\n. Third\n\n=== Tabs and spaces\n\n* this is a list item indented with tabs\n* this is a list item indented with spaces\n** this is an example list item indented with tabs\n** this is an example list item indented with spaces\n\n=== Fancy list markers\n\n[arabic, start=2]\n. begins with 2\n. and now 3\n+\nwith a continuation\n[lowerroman, start=4]\n.. sublist with roman numerals, starting with 4\n.. more items\n[upperalpha]\n... a subsublist\n... a subsublist\n\nNesting:\n\n[upperalpha]\n. Upper Alpha\n[upperroman]\n.. Upper Roman.\n[arabic, start=6]\n... Decimal start with 6\n[loweralpha, start=3]\n.... Lower alpha with paren\n\nAutonumbering:\n\n. Autonumber.\n. More.\n.. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n'''''\n\n== Definition Lists\n\nTight using spaces:\n\napple::\n  red fruit\norange::\n  orange fruit\nbanana::\n  yellow fruit\n\nTight using tabs:\n\napple::\n  red fruit\norange::\n  orange fruit\nbanana::\n  yellow fruit\n\nLoose:\n\napple::\n  red fruit\norange::\n  orange fruit\nbanana::\n  yellow fruit\n\nMultiple blocks with italics:\n\n_apple_::\n  red fruit\n  +\n  contains seeds, crisp, pleasant to taste\n_orange_::\n  orange fruit\n  +\n....\n{ orange code block }\n....\n  +\n  ____\n  orange block quote\n  ____\n\nMultiple definitions, tight:\n\napple::\n  red fruit\n  +\n  computer\norange::\n  orange fruit\n  +\n  bank\n\nMultiple definitions, loose:\n\napple::\n  red fruit\n  +\n  computer\norange::\n  orange fruit\n  +\n  bank\n\nBlank line after term, indented marker, alternate markers:\n\napple::\n  red fruit\n  +\n  computer\norange::\n  orange fruit\n  +\n  [arabic]\n  . sublist\n  . sublist\n\n== HTML Blocks\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is _emphasized_\n\nAnd this is *strong*\n\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n....\n<div>\n    foo\n</div>\n....\n\nAs should this:\n\n....\n<div>foo</div>\n....\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n....\n<!-- Comment -->\n....\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n....\n<hr />\n....\n\nHr’s:\n\n'''''\n\n== Inline Markup\n\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _link:/url[emphasized link]_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n[line-through]#This is _strikeout_.#\n\nSuperscripts: a^bc^d a^_hello_^ a^hello there^.\n\nSubscripts: H~2~O, H~23~O, H~many of them~O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n'''''\n\n== Smart quotes, ellipses, dashes\n\n``Hello,'' said the spider. ```Shelob' is my name.''\n\n`A', `B', and `C' are letters.\n\n`Oak,' `elm,' and `beech' are names of trees. So is `pine.'\n\n`He said, ``I want to go.''' Were you alive in the 70’s?\n\nHere is some quoted ``code`' and a ``http://example.com/?foo=1&bar=2[quoted\nlink]''.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n'''''\n\n== LaTeX\n\n* \n* latexmath:[$2+2=4$]\n* latexmath:[$x \\in y$]\n* latexmath:[$\\alpha \\wedge \\omega$]\n* latexmath:[$223$]\n* latexmath:[$p$]-Tree\n* Here’s some display math:\n+\n[latexmath]\n++++\n\\[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\\]\n++++\n* Here’s one that has a line break in it:\nlatexmath:[$\\alpha + \\omega \\times x^2$].\n\nThese shouldn’t be math:\n\n* To get the famous equation, write `$e = mc^2$`.\n* $22,000 is a _lot_ of money. So is $34,000. (It worked if ``lot'' is\nemphasized.)\n* Shoes ($20) and socks ($5).\n* Escaped `$`: $73 _this should be emphasized_ 23$.\n\nHere’s a LaTeX table:\n\n'''''\n\n== Special Characters\n\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 ++<++ 5.\n\n6 ++>++ 5.\n\nBackslash: ++\\++\n\nBacktick: ++`++\n\nAsterisk: ++*++\n\nUnderscore: ++_++\n\nLeft brace: ++{++\n\nRight brace: }\n\nLeft bracket: ++[++\n\nRight bracket: ++]++\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: ++>++\n\nHash: ++#++\n\nPeriod: .\n\nBang: !\n\nPlus: {plus}\n\nMinus: -\n\n'''''\n\n== Links\n\n=== Explicit\n\nJust a link:/url/[URL].\n\nlink:/url/[URL and title].\n\nlink:/url/[URL and title].\n\nlink:/url/[URL and title].\n\nlink:/url/[URL and title]\n\nlink:/url/[URL and title]\n\nlink:/url/with_underscore[with++_++underscore]\n\nmailto:nobody@nowhere.net[Email link]\n\nlink:[Empty].\n\n=== Reference\n\nFoo link:/url/[bar].\n\nWith link:/url/[embedded ++[++brackets++]++].\n\nlink:/url/[b] by itself should be a link.\n\nIndented link:/url[once].\n\nIndented link:/url[twice].\n\nIndented link:/url[thrice].\n\nThis should ++[++not++][]++ be a link.\n\n....\n[not]: /url\n....\n\nFoo link:/url/[bar].\n\nFoo link:/url/[biz].\n\n=== With ampersands\n\nHere’s a http://example.com/?foo=1&bar=2[link with an ampersand in the URL].\n\nHere’s a link with an amersand in the link text: http://att.com/[AT&T].\n\nHere’s an link:/script?foo=1&bar=2[inline link].\n\nHere’s an link:/script?foo=1&bar=2[inline link in pointy braces].\n\n=== Autolinks\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n* In a list?\n* http://example.com/\n* It should.\n\nAn e-mail address: nobody@nowhere.net\n\n____\nBlockquoted: http://example.com/\n____\n\nAuto-links should not occur here: `<http://example.com/>`\n\n....\nor here: <http://example.com/>\n....\n\n'''''\n\n== Images\n\nFrom ``Voyage dans la Lune'' by Georges Melies (1902):\n\n.lalune\nimage::lalune.jpg[lalune,title=\"Voyage dans la Lune\"]\n\nHere is a movie image:movie.jpg[movie] icon.\n\n'''''\n\n== Footnotes\n\nHere is a footnote reference,footnote:[Here is the footnote. It can go anywhere\nafter the footnote reference. It need not be placed at the end of the document.]\nand another.[multiblock footnote omitted] This should _not_ be a footnote\nreference, because it contains a space.++[++^my note++]++ Here is an inline\nnote.footnote:[This is _easier_ to type. Inline notes may contain\nhttp://google.com[links] and `]` verbatim characters, as well as ++[++bracketed\ntext++]++.]\n\n____\nNotes can go in quotes.footnote:[In quote.]\n____\n\n[arabic]\n. And in list items.footnote:[In list.]\n\nThis paragraph should not be part of the note, as it is not indented.\n"
  },
  {
    "path": "test/writer.bbcode",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.\n\n* * *\n\n[u][b]Headers[/b][/u]\n\n[b]Level 2 with an [url=/url]embedded link[/url][/b]\n\n[u]Level 3 with [i]emphasis[/i][/u]\n\nLevel 4\n\nLevel 5\n\n[u][b]Level 1[/b][/u]\n\n[b]Level 2 with [i]emphasis[/i][/b]\n\n[u]Level 3[/u]\n\nwith no blank line\n\n[b]Level 2[/b]\n\nwith no blank line\n\n* * *\n\n[u][b]Paragraphs[/b][/u]\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n* * *\n\n[u][b]Block Quotes[/b][/u]\n\nE-mail style:\n\n[quote]\nThis is a block quote. It is pretty short.\n[/quote]\n\n[quote]\nCode in a block quote:\n\n[code]sub status {\n    print \"working\";\n}\n[/code]\n\nA list:\n\n[list=1]\n[*]item one\n[*]item two\n[/list]\n\nNested block quotes:\n\n[quote]\nnested\n[/quote]\n\n[quote]\nnested\n[/quote]\n[/quote]\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n* * *\n\n[u][b]Code Blocks[/b][/u]\n\nCode:\n\n[code]---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n[/code]\n\nAnd:\n\n[code]    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n[/code]\n\n* * *\n\n[u][b]Lists[/b][/u]\n\n[b]Unordered[/b]\n\nAsterisks tight:\n\n[list]\n[*]asterisk 1\n[*]asterisk 2\n[*]asterisk 3\n[/list]\n\nAsterisks loose:\n\n[list]\n[*]asterisk 1\n[*]asterisk 2\n[*]asterisk 3\n[/list]\n\nPluses tight:\n\n[list]\n[*]Plus 1\n[*]Plus 2\n[*]Plus 3\n[/list]\n\nPluses loose:\n\n[list]\n[*]Plus 1\n[*]Plus 2\n[*]Plus 3\n[/list]\n\nMinuses tight:\n\n[list]\n[*]Minus 1\n[*]Minus 2\n[*]Minus 3\n[/list]\n\nMinuses loose:\n\n[list]\n[*]Minus 1\n[*]Minus 2\n[*]Minus 3\n[/list]\n\n[b]Ordered[/b]\n\nTight:\n\n[list=1]\n[*]First\n[*]Second\n[*]Third\n[/list]\n\nand:\n\n[list=1]\n[*]One\n[*]Two\n[*]Three\n[/list]\n\nLoose using tabs:\n\n[list=1]\n[*]First\n[*]Second\n[*]Third\n[/list]\n\nand using spaces:\n\n[list=1]\n[*]One\n[*]Two\n[*]Three\n[/list]\n\nMultiple paragraphs:\n\n[list=1]\n[*]Item 1, graf one.\n\nItem 1. graf two. The quick brown fox jumped over the lazy dog's back.\n[*]Item 2.\n[*]Item 3.\n[/list]\n\n[b]Nested[/b]\n\n[list]\n[*]Tab\n\n[list]\n[*]Tab\n\n[list]\n[*]Tab\n[/list]\n[/list]\n[/list]\n\nHere's another:\n\n[list=1]\n[*]First\n[*]Second:\n\n[list]\n[*]Fee\n[*]Fie\n[*]Foe\n[/list]\n[*]Third\n[/list]\n\nSame thing but with paragraphs:\n\n[list=1]\n[*]First\n[*]Second:\n\n[list]\n[*]Fee\n[*]Fie\n[*]Foe\n[/list]\n[*]Third\n[/list]\n\n[b]Tabs and spaces[/b]\n\n[list]\n[*]this is a list item indented with tabs\n[*]this is a list item indented with spaces\n\n[list]\n[*]this is an example list item indented with tabs\n[*]this is an example list item indented with spaces\n[/list]\n[/list]\n\n[b]Fancy list markers[/b]\n\n[list=1]\n[*]begins with 2\n[*]and now 3\n\nwith a continuation\n\n[list=i]\n[*]sublist with roman numerals, starting with 4\n[*]more items\n\n[list=A]\n[*]a subsublist\n[*]a subsublist\n[/list]\n[/list]\n[/list]\n\nNesting:\n\n[list=A]\n[*]Upper Alpha\n\n[list=I]\n[*]Upper Roman.\n\n[list=1]\n[*]Decimal start with 6\n\n[list=a]\n[*]Lower alpha with paren\n[/list]\n[/list]\n[/list]\n[/list]\n\nAutonumbering:\n\n[list=1]\n[*]Autonumber.\n[*]More.\n\n[list=1]\n[*]Nested.\n[/list]\n[/list]\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n* * *\n\n[u][b]Definition Lists[/b][/u]\n\nTight using spaces:\n\napple\n[list]\n[*]red fruit\n[/list]\norange\n[list]\n[*]orange fruit\n[/list]\nbanana\n[list]\n[*]yellow fruit\n[/list]\n\nTight using tabs:\n\napple\n[list]\n[*]red fruit\n[/list]\norange\n[list]\n[*]orange fruit\n[/list]\nbanana\n[list]\n[*]yellow fruit\n[/list]\n\nLoose:\n\napple\n[list]\n[*]red fruit\n[/list]\norange\n[list]\n[*]orange fruit\n[/list]\nbanana\n[list]\n[*]yellow fruit\n[/list]\n\nMultiple blocks with italics:\n\n[i]apple[/i]\n[list]\n[*]red fruit\n\ncontains seeds, crisp, pleasant to taste\n[/list]\n[i]orange[/i]\n[list]\n[*]orange fruit\n\n[code]{ orange code block }\n[/code]\n\n[quote]\norange block quote\n[/quote]\n[/list]\n\nMultiple definitions, tight:\n\napple\n[list]\n[*]red fruit\n[*]computer\n[/list]\norange\n[list]\n[*]orange fruit\n[*]bank\n[/list]\n\nMultiple definitions, loose:\n\napple\n[list]\n[*]red fruit\n[*]computer\n[/list]\norange\n[list]\n[*]orange fruit\n[*]bank\n[/list]\n\nBlank line after term, indented marker, alternate markers:\n\napple\n[list]\n[*]red fruit\n[*]computer\n[/list]\norange\n[list]\n[*]orange fruit\n\n[list=1]\n[*]sublist\n[*]sublist\n[/list]\n[/list]\n\n[u][b]HTML Blocks[/b][/u]\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is [i]emphasized[/i]\n\nAnd this is [b]strong[/b]\n\nHere's a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n[code]<div>\n    foo\n</div>\n[/code]\n\nAs should this:\n\n[code]<div>foo</div>\n[/code]\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n[code]<!-- Comment -->\n[/code]\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n[code]<hr />\n[/code]\n\nHr's:\n\n* * *\n\n[u][b]Inline Markup[/b][/u]\n\nThis is [i]emphasized[/i], and so [i]is this[/i].\n\nThis is [b]strong[/b], and so [b]is this[/b].\n\nAn [i][url=/url]emphasized link[/url][/i].\n\n[b][i]This is strong and em.[/i][/b]\n\nSo is [b][i]this[/i][/b] word.\n\n[b][i]This is strong and em.[/i][/b]\n\nSo is [b][i]this[/i][/b] word.\n\nThis is code: >, $, \\, \\$, <html>.\n\n[s]This is [i]strikeout[/i].[/s]\n\nSuperscripts: abcd a[i]hello[/i] ahello there.\n\nSubscripts: H2O, H23O, Hmany of themO.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\n\n* * *\n\n[u][b]Smart quotes, ellipses, dashes[/b][/u]\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted 'code' and a \"[url=http://example.com/?foo=1&bar=2]quoted link[/url]\".\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses...and...and....\n\n* * *\n\n[u][b]LaTeX[/b][/u]\n\n[list]\n[*]\n[*]$2+2=4$\n[*]$x \\in y$\n[*]$\\alpha \\wedge \\omega$\n[*]$223$\n[*]$p$-Tree\n[*]Here's some display math: [code=latex]$$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n[/code]\n[*]Here's one that has a line break in it: $\\alpha + \\omega \\times x^2$.\n[/list]\n\nThese shouldn't be math:\n\n[list]\n[*]To get the famous equation, write $e = mc^2$.\n[*]$22,000 is a [i]lot[/i] of money. So is $34,000. (It worked if \"lot\" is emphasized.)\n[*]Shoes ($20) and socks ($5).\n[*]Escaped $: $73 [i]this should be emphasized[/i] 23$.\n[/list]\n\nHere's a LaTeX table:\n\n* * *\n\n[u][b]Special Characters[/b][/u]\n\nHere is some unicode:\n\n[list]\n[*]I hat: Î\n[*]o umlaut: ö\n[*]section: §\n[*]set membership: ∈\n[*]copyright: ©\n[/list]\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n* * *\n\n[u][b]Links[/b][/u]\n\n[b]Explicit[/b]\n\nJust a [url=/url/]URL[/url].\n\n[url=/url/]URL and title[/url].\n\n[url=/url/]URL and title[/url].\n\n[url=/url/]URL and title[/url].\n\n[url=/url/]URL and title[/url]\n\n[url=/url/]URL and title[/url]\n\n[url=/url/with_underscore]with_underscore[/url]\n\n[email=nobody@nowhere.net]Email link[/email]\n\n[url]Empty[/url].\n\n[b]Reference[/b]\n\nFoo [url=/url/]bar[/url].\n\nWith [url=/url/]embedded [brackets][/url].\n\n[url=/url/]b[/url] by itself should be a link.\n\nIndented [url=/url]once[/url].\n\nIndented [url=/url]twice[/url].\n\nIndented [url=/url]thrice[/url].\n\nThis should [not][] be a link.\n\n[code][not]: /url\n[/code]\n\nFoo [url=/url/]bar[/url].\n\nFoo [url=/url/]biz[/url].\n\n[b]With ampersands[/b]\n\nHere's a [url=http://example.com/?foo=1&bar=2]link with an ampersand in the URL[/url].\n\nHere's a link with an amersand in the link text: [url=http://att.com/]AT&T[/url].\n\nHere's an [url=/script?foo=1&bar=2]inline link[/url].\n\nHere's an [url=/script?foo=1&bar=2]inline link in pointy braces[/url].\n\n[b]Autolinks[/b]\n\nWith an ampersand: [url]http://example.com/?foo=1&bar=2[/url]\n\n[list]\n[*]In a list?\n[*][url]http://example.com/[/url]\n[*]It should.\n[/list]\n\nAn e-mail address: [email]nobody@nowhere.net[/email]\n\n[quote]\nBlockquoted: [url]http://example.com/[/url]\n[/quote]\n\nAuto-links should not occur here: <http://example.com/>\n\n[code]or here: <http://example.com/>\n[/code]\n\n* * *\n\n[u][b]Images[/b][/u]\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n[img alt=\"lalune\" title=\"Voyage dans la Lune\"]lalune.jpg[/img]\nlalune\n\nHere is a movie [img alt=\"movie\"]movie.jpg[/img] icon.\n\n* * *\n\n[u][b]Footnotes[/b][/u]\n\nHere is a footnote reference,(1) and another.(2) This should [i]not[/i] be a footnote reference, because it contains a space.[^my note] Here is an inline note.(3)\n\n[quote]\nNotes can go in quotes.(4)\n[/quote]\n\n[list=1]\n[*]And in list items.(5)\n[/list]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n* * *\n\n(1) Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\n\n(2) Here's the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with list items).\n\n[code]  { <code> }\n[/code]\n\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.\n\n(3) This is [i]easier[/i] to type. Inline notes may contain [url=http://google.com]links[/url] and ] verbatim characters, as well as [bracketed text].\n\n(4) In quote.\n\n(5) In list.\n"
  },
  {
    "path": "test/writer.context",
    "content": "% Enable hyperlinks\n\\setupinteraction\n  [state=start,\n  title={Pandoc Test Suite},\n  author={John MacFarlane; Anonymous},\n  style=,\n  color=,\n  contrastcolor=]\n\\setupurl[style=]\n\n% make chapter, section bookmarks visible when opening document\n\\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]\n\\setupinteractionscreen[option={bookmark,title}]\n\n\\setuppagenumbering[location={footer,middle}]\n\\setupstructure[state=start,method=auto]\n\n% use microtypography\n\\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]\n\\definefontfeature[default:tnum][default][tnum=yes, pnum=no]\n\\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]\n\\setupalign[hz,hanging]\n\\setupitaliccorrection[global, always]\n\n\\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted\n\n\\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]\n\\definefontfamily[mainface][rm][Latin Modern Roman]\n\\definefontfamily[mainface][mm][Latin Modern Math]\n\\definefontfamily[mainface][ss][Latin Modern Sans]\n\\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]\n\\setupbodyfont[mainface]\n\n\\setupwhitespace[medium]\n\n\\setuphead[chapter]            [style=\\tfd\\setupinterlinespace,header=empty]\n\\setuphead[section]            [style=\\tfc\\setupinterlinespace]\n\\setuphead[subsection]         [style=\\tfb\\setupinterlinespace]\n\\setuphead[subsubsection]      [style=\\bf]\n\\setuphead[subsubsubsection]   [style=\\sc]\n\\setuphead[subsubsubsubsection][style=\\it]\n\n\\definesectionlevels\n   [default]\n   [section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]\n\n\\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]\n\n\\definedescription\n  [description]\n  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]\n\n\\setupitemize[autointro]    % prevent orphan list intro\n\\setupitemize[indentnext=no]\n\n\\defineitemgroup[enumerate]\n\\setupenumerate[each][fit][itemalign=left,distance=.5em,style={\\feature[+][default:tnum]}]\n\n\\setupfloat[figure][default={here,nonumber}]\n\\setupfloat[table][default={here,nonumber}]\n\n\\setupxtable[frame=off]\n\\setupxtable[head][topframe=on]\n\\setupxtable[body][]\n\\setupxtable[foot][]\n\\setupxtable[lastrow][bottomframe=on]\n\n\n\\starttext\n\\startalignment[middle]\n  {\\tfd\\setupinterlinespace Pandoc Test Suite}\n  \\smallskip\n  {\\tfa\\setupinterlinespace John MacFarlane\\crlf Anonymous}\n  \\smallskip\n  {\\tfa\\setupinterlinespace July 17, 2006}\n  \\bigskip\n\\stopalignment\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n\\thinrule\n\n\\startsectionlevel[title={Headers},reference={headers}]\n\n\\startsectionlevel[title={Level 2 with an \\goto{embedded\nlink}[url(/url)]},reference={level-2-with-an-embedded-link}]\n\n\\startsectionlevel[title={Level 3 with {\\em\nemphasis}},reference={level-3-with-emphasis}]\n\n\\startsectionlevel[title={Level 4},reference={level-4}]\n\n\\startsectionlevel[title={Level 5},reference={level-5}]\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Level 1},reference={level-1}]\n\n\\startsectionlevel[title={Level 2 with {\\em\nemphasis}},reference={level-2-with-emphasis}]\n\n\\startsectionlevel[title={Level 3},reference={level-3}]\n\nwith no blank line\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Level 2},reference={level-2}]\n\nwith no blank line\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Paragraphs},reference={paragraphs}]\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break\\crlf\nhere.\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Block Quotes},reference={block-quotes}]\n\nE-mail style:\n\n\\startblockquote\nThis is a block quote. It is pretty short.\n\\stopblockquote\n\n\\startblockquote\nCode in a block quote:\n\n\\starttyping\nsub status {\n    print \"working\";\n}\n\\stoptyping\n\nA list:\n\n\\startenumerate[n,packed][stopper=.]\n\\item\n  item one\n\\item\n  item two\n\\stopenumerate\n\nNested block quotes:\n\n\\startblockquote\nnested\n\\stopblockquote\n\n\\startblockquote\nnested\n\\stopblockquote\n\\stopblockquote\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Code Blocks},reference={code-blocks}]\n\nCode:\n\n\\starttyping\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n\\stoptyping\n\nAnd:\n\n\\starttyping\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\\stoptyping\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Lists},reference={lists}]\n\n\\startsectionlevel[title={Unordered},reference={unordered}]\n\nAsterisks tight:\n\n\\startitemize[packed]\n\\item\n  asterisk 1\n\\item\n  asterisk 2\n\\item\n  asterisk 3\n\\stopitemize\n\nAsterisks loose:\n\n\\startitemize\n\\item\n  asterisk 1\n\\item\n  asterisk 2\n\\item\n  asterisk 3\n\\stopitemize\n\nPluses tight:\n\n\\startitemize[packed]\n\\item\n  Plus 1\n\\item\n  Plus 2\n\\item\n  Plus 3\n\\stopitemize\n\nPluses loose:\n\n\\startitemize\n\\item\n  Plus 1\n\\item\n  Plus 2\n\\item\n  Plus 3\n\\stopitemize\n\nMinuses tight:\n\n\\startitemize[packed]\n\\item\n  Minus 1\n\\item\n  Minus 2\n\\item\n  Minus 3\n\\stopitemize\n\nMinuses loose:\n\n\\startitemize\n\\item\n  Minus 1\n\\item\n  Minus 2\n\\item\n  Minus 3\n\\stopitemize\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Ordered},reference={ordered}]\n\nTight:\n\n\\startenumerate[n,packed][stopper=.]\n\\item\n  First\n\\item\n  Second\n\\item\n  Third\n\\stopenumerate\n\nand:\n\n\\startenumerate[n,packed][stopper=.]\n\\item\n  One\n\\item\n  Two\n\\item\n  Three\n\\stopenumerate\n\nLoose using tabs:\n\n\\startenumerate[n][stopper=.]\n\\item\n  First\n\\item\n  Second\n\\item\n  Third\n\\stopenumerate\n\nand using spaces:\n\n\\startenumerate[n][stopper=.]\n\\item\n  One\n\\item\n  Two\n\\item\n  Three\n\\stopenumerate\n\nMultiple paragraphs:\n\n\\startenumerate[n][stopper=.]\n\\item\n  Item 1, graf one.\n\n  Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\\item\n  Item 2.\n\\item\n  Item 3.\n\\stopenumerate\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Nested},reference={nested}]\n\n\\startitemize[packed]\n\\item\n  Tab\n  \\startitemize[packed]\n  \\item\n    Tab\n    \\startitemize[packed]\n    \\item\n      Tab\n    \\stopitemize\n  \\stopitemize\n\\stopitemize\n\nHere's another:\n\n\\startenumerate[n,packed][stopper=.]\n\\item\n  First\n\\item\n  Second:\n  \\startitemize[packed]\n  \\item\n    Fee\n  \\item\n    Fie\n  \\item\n    Foe\n  \\stopitemize\n\\item\n  Third\n\\stopenumerate\n\nSame thing but with paragraphs:\n\n\\startenumerate[n][stopper=.]\n\\item\n  First\n\\item\n  Second:\n\n  \\startitemize[packed]\n  \\item\n    Fee\n  \\item\n    Fie\n  \\item\n    Foe\n  \\stopitemize\n\\item\n  Third\n\\stopenumerate\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Tabs and spaces},reference={tabs-and-spaces}]\n\n\\startitemize\n\\item\n  this is a list item indented with tabs\n\\item\n  this is a list item indented with spaces\n\n  \\startitemize\n  \\item\n    this is an example list item indented with tabs\n  \\item\n    this is an example list item indented with spaces\n  \\stopitemize\n\\stopitemize\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Fancy list markers},reference={fancy-list-markers}]\n\n\\startenumerate[n][start=2,left=(,stopper=)]\n\\item\n  begins with 2\n\\item\n  and now 3\n\n  with a continuation\n\n  \\startenumerate[r,packed][start=4,stopper=.]\n  \\item\n    sublist with roman numerals, starting with 4\n  \\item\n    more items\n    \\startenumerate[A,packed][left=(,stopper=)]\n    \\item\n      a subsublist\n    \\item\n      a subsublist\n    \\stopenumerate\n  \\stopenumerate\n\\stopenumerate\n\nNesting:\n\n\\startenumerate[A,packed][stopper=.]\n\\item\n  Upper Alpha\n  \\startenumerate[R,packed][stopper=.]\n  \\item\n    Upper Roman.\n    \\startenumerate[n,packed][start=6,left=(,stopper=)]\n    \\item\n      Decimal start with 6\n      \\startenumerate[a,packed][start=3,stopper=)]\n      \\item\n        Lower alpha with paren\n      \\stopenumerate\n    \\stopenumerate\n  \\stopenumerate\n\\stopenumerate\n\nAutonumbering:\n\n\\startenumerate[n,packed]\n\\item\n  Autonumber.\n\\item\n  More.\n  \\startenumerate[a,packed]\n  \\item\n    Nested.\n  \\stopenumerate\n\\stopenumerate\n\nShould not be a list item:\n\nM.A.~2007\n\nB. Williams\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Definition Lists},reference={definition-lists}]\n\nTight using spaces:\n\n\\startdescription{apple}\n  red fruit\n\\stopdescription\n\n\\startdescription{orange}\n  orange fruit\n\\stopdescription\n\n\\startdescription{banana}\n  yellow fruit\n\\stopdescription\n\nTight using tabs:\n\n\\startdescription{apple}\n  red fruit\n\\stopdescription\n\n\\startdescription{orange}\n  orange fruit\n\\stopdescription\n\n\\startdescription{banana}\n  yellow fruit\n\\stopdescription\n\nLoose:\n\n\\startdescription{apple}\n  red fruit\n\\stopdescription\n\n\\startdescription{orange}\n  orange fruit\n\\stopdescription\n\n\\startdescription{banana}\n  yellow fruit\n\\stopdescription\n\nMultiple blocks with italics:\n\n\\startdescription{{\\em apple}}\n  red fruit\n\n  contains seeds, crisp, pleasant to taste\n\\stopdescription\n\n\\startdescription{{\\em orange}}\n  orange fruit\n\n\\starttyping\n{ orange code block }\n\\stoptyping\n\n  \\startblockquote\n  orange block quote\n  \\stopblockquote\n\\stopdescription\n\nMultiple definitions, tight:\n\n\\startdescription{apple}\n  red fruit\n\n  computer\n\\stopdescription\n\n\\startdescription{orange}\n  orange fruit\n\n  bank\n\\stopdescription\n\nMultiple definitions, loose:\n\n\\startdescription{apple}\n  red fruit\n\n  computer\n\\stopdescription\n\n\\startdescription{orange}\n  orange fruit\n\n  bank\n\\stopdescription\n\nBlank line after term, indented marker, alternate markers:\n\n\\startdescription{apple}\n  red fruit\n\n  computer\n\\stopdescription\n\n\\startdescription{orange}\n  orange fruit\n\n  \\startenumerate[n,packed][stopper=.]\n  \\item\n    sublist\n  \\item\n    sublist\n  \\stopenumerate\n\\stopdescription\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={HTML Blocks},reference={html-blocks}]\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is {\\em emphasized}\nAnd this is {\\bf strong}\nHere's a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n\\starttyping\n<div>\n    foo\n</div>\n\\stoptyping\n\nAs should this:\n\n\\starttyping\n<div>foo</div>\n\\stoptyping\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n\\starttyping\n<!-- Comment -->\n\\stoptyping\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n\\starttyping\n<hr />\n\\stoptyping\n\nHr's:\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Inline Markup},reference={inline-markup}]\n\nThis is {\\em emphasized}, and so {\\em is this}.\n\nThis is {\\bf strong}, and so {\\bf is this}.\n\nAn {\\em \\goto{emphasized link}[url(/url)]}.\n\n{\\bf {\\em This is strong and em.}}\n\nSo is {\\bf {\\em this}} word.\n\n{\\bf {\\em This is strong and em.}}\n\nSo is {\\bf {\\em this}} word.\n\nThis is code: \\type{>}, \\type{$}, \\type{\\}, \\type{\\$}, \\type{<html>}.\n\n\\overstrikes{This is {\\em strikeout}.}\n\nSuperscripts: a\\high{bc}d a\\high{{\\em hello}} a\\high{hello~there}.\n\nSubscripts: H\\low{2}O, H\\low{23}O, H\\low{many~of~them}O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a\\lettertilde{}b c\\lettertilde{}d.\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Smart quotes, ellipses,\ndashes},reference={smart-quotes-ellipses-dashes}]\n\n\\quotation{Hello,} said the spider. \\quotation{\\quote{Shelob} is my name.}\n\n\\quote{A}, \\quote{B}, and \\quote{C} are letters.\n\n\\quote{Oak,} \\quote{elm,} and \\quote{beech} are names of trees. So is\n\\quote{pine.}\n\n\\quote{He said, \\quotation{I want to go.}} Were you alive in the 70's?\n\nHere is some quoted \\quote{\\type{code}} and a \\quotation{\\goto{quoted\nlink}[url(http://example.com/?foo=1&bar=2)]}.\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses\\ldots{}and\\ldots{}and\\ldots{}.\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={LaTeX},reference={latex}]\n\n\\startitemize[packed]\n\\item\n  \\cite[22-23]{smith.1899}\n\\item\n  $2+2=4$\n\\item\n  $x \\in y$\n\\item\n  $\\alpha \\wedge \\omega$\n\\item\n  $223$\n\\item\n  $p$-Tree\n\\item\n  Here's some display math:\n  \\startformula \\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h} \\stopformula\n\\item\n  Here's one that has a line break in it: $\\alpha + \\omega \\times x^2$.\n\\stopitemize\n\nThese shouldn't be math:\n\n\\startitemize[packed]\n\\item\n  To get the famous equation, write \\type{$e = mc^2$}.\n\\item\n  \\$22,000 is a {\\em lot} of money. So is \\$34,000. (It worked if\n  \\quotation{lot} is emphasized.)\n\\item\n  Shoes (\\$20) and socks (\\$5).\n\\item\n  Escaped \\type{$}: \\$73 {\\em this should be emphasized} 23\\$.\n\\stopitemize\n\nHere's a LaTeX table:\n\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Special Characters},reference={special-characters}]\n\nHere is some unicode:\n\n\\startitemize[packed]\n\\item\n  I hat: Î\n\\item\n  o umlaut: ö\n\\item\n  section: §\n\\item\n  set membership: ∈\n\\item\n  copyright: ©\n\\stopitemize\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\letterbackslash{}\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: {[}\n\nRight bracket: {]}\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: \\#\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Links},reference={links}]\n\n\\startsectionlevel[title={Explicit},reference={explicit}]\n\nJust a \\goto{URL}[url(/url/)].\n\n\\goto{URL and title}[url(/url/)].\n\n\\goto{URL and title}[url(/url/)].\n\n\\goto{URL and title}[url(/url/)].\n\n\\goto{URL and title}[url(/url/)]\n\n\\goto{URL and title}[url(/url/)]\n\n\\goto{with_underscore}[url(/url/with_underscore)]\n\n\\goto{Email link}[url(mailto:nobody@nowhere.net)]\n\n\\goto{Empty}[url()].\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Reference},reference={reference}]\n\nFoo \\goto{bar}[url(/url/)].\n\nWith \\goto{embedded {[}brackets{]}}[url(/url/)].\n\n\\goto{b}[url(/url/)] by itself should be a link.\n\nIndented \\goto{once}[url(/url)].\n\nIndented \\goto{twice}[url(/url)].\n\nIndented \\goto{thrice}[url(/url)].\n\nThis should {[}not{]}{[}{]} be a link.\n\n\\starttyping\n[not]: /url\n\\stoptyping\n\nFoo \\goto{bar}[url(/url/)].\n\nFoo \\goto{biz}[url(/url/)].\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={With ampersands},reference={with-ampersands}]\n\nHere's a \\goto{link with an ampersand in the\nURL}[url(http://example.com/?foo=1&bar=2)].\n\nHere's a link with an amersand in the link text:\n\\goto{AT&T}[url(http://att.com/)].\n\nHere's an \\goto{inline link}[url(/script?foo=1&bar=2)].\n\nHere's an \\goto{inline link in pointy braces}[url(/script?foo=1&bar=2)].\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Autolinks},reference={autolinks}]\n\nWith an ampersand: \\useURL[url1][http://example.com/?foo=1&bar=2]\\from[url1]\n\n\\startitemize[packed]\n\\item\n  In a list?\n\\item\n  \\useURL[url2][http://example.com/]\\from[url2]\n\\item\n  It should.\n\\stopitemize\n\nAn e-mail address: \\goto{nobody@nowhere.net}[url(mailto:nobody@nowhere.net)]\n\n\\startblockquote\nBlockquoted: \\useURL[url3][http://example.com/]\\from[url3]\n\\stopblockquote\n\nAuto-links should not occur here: \\type{<http://example.com/>}\n\n\\starttyping\nor here: <http://example.com/>\n\\stoptyping\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Images},reference={images}]\n\nFrom \\quotation{Voyage dans la Lune} by Georges Melies (1902):\n\n\\startplacefigure[title={lalune}]\n{\\externalfigure[lalune.jpg]}\n\\stopplacefigure\n\nHere is a movie {\\externalfigure[movie.jpg]} icon.\n\n\\thinrule\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Footnotes},reference={footnotes}]\n\nHere is a footnote reference,\\footnote{Here is the footnote. It can go anywhere\n  after the footnote reference. It need not be placed at the end of the\n  document.} and another.\\startbuffer Here's the long note. This one contains\n  multiple blocks.\n\n  Subsequent blocks are indented to show that they belong to the footnote (as\n  with list items).\n\n\\starttyping\n  { <code> }\n\\stoptyping\n\n  If you want, you can indent every line, but you can also be lazy and just\n  indent the first line of each block.\\stopbuffer\\footnote{\\getbuffer} This\nshould {\\em not} be a footnote reference, because it contains a space.{[}^my\nnote{]} Here is an inline note.\\footnote{This is {\\em easier} to type. Inline\n  notes may contain \\goto{links}[url(http://google.com)] and \\type{]} verbatim\n  characters, as well as {[}bracketed text{]}.}\n\n\\startblockquote\nNotes can go in quotes.\\footnote{In quote.}\n\\stopblockquote\n\n\\startenumerate[n,packed][stopper=.]\n\\item\n  And in list items.\\footnote{In list.}\n\\stopenumerate\n\nThis paragraph should not be part of the note, as it is not indented.\n\n\\stopsectionlevel\n\n\\stoptext\n"
  },
  {
    "path": "test/writer.djot",
    "content": "# Pandoc Test Suite\n\nJohn MacFarlane\nAnonymous\n\nJuly 17, 2006\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n* * * *\n\n{#headers}\n# Headers\n\n{#level-2-with-an-embedded-link}\n## Level 2 with an [embedded link](/url)\n\n{#level-3-with-emphasis}\n### Level 3 with _emphasis_\n\n{#level-4}\n#### Level 4\n\n{#level-5}\n##### Level 5\n\n{#level-1}\n# Level 1\n\n{#level-2-with-emphasis}\n## Level 2 with _emphasis_\n\n{#level-3}\n### Level 3\n\nwith no blank line\n\n{#level-2}\n## Level 2\n\nwith no blank line\n\n* * * *\n\n{#paragraphs}\n# Paragraphs\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. \\* criminey.\n\nThere should be a hard line break\\\nhere.\n\n* * * *\n\n{#block-quotes}\n# Block Quotes\n\nE-mail style:\n\n> This is a block quote. It is pretty short.\n\n> Code in a block quote:\n>\n> ```\n> sub status {\n>     print \"working\";\n> }\n> ```\n>\n> A list:\n>\n> 1. item one\n> 2. item two\n>\n> Nested block quotes:\n>\n> > nested\n>\n> > nested\n\nThis should not be a block quote: 2 \\> 1.\n\nAnd a following paragraph.\n\n* * * *\n\n{#code-blocks}\n# Code Blocks\n\nCode:\n\n```\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n```\n\nAnd:\n\n```\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n```\n\n* * * *\n\n{#lists}\n# Lists\n\n{#unordered}\n## Unordered\n\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\n{#ordered}\n## Ordered\n\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n\n2. Second\n\n3. Third\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\n   Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n2. Item 2.\n\n3. Item 3.\n\n{#nested}\n## Nested\n\n- Tab\n\n  - Tab\n\n    - Tab\n\nHere's another:\n\n1. First\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n\n3. Third\n\n{#tabs-and-spaces}\n## Tabs and spaces\n\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\n{#fancy-list-markers}\n## Fancy list markers\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v. more items\n\n       (A) a subsublist\n       (B) a subsublist\n\nNesting:\n\nA. Upper Alpha\n\n   I. Upper Roman.\n\n      (6) Decimal start with 6\n\n          c) Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n2. More.\n\n   1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n* * * *\n\n{#definition-lists}\n# Definition Lists\n\nTight using spaces:\n\n: apple\n\n  red fruit\n: orange\n\n  orange fruit\n: banana\n\n  yellow fruit\n\nTight using tabs:\n\n: apple\n\n  red fruit\n: orange\n\n  orange fruit\n: banana\n\n  yellow fruit\n\nLoose:\n\n: apple\n\n  red fruit\n\n: orange\n\n  orange fruit\n\n: banana\n\n  yellow fruit\n\nMultiple blocks with italics:\n\n: _apple_\n\n  red fruit\n\n  contains seeds, crisp, pleasant to taste\n\n: _orange_\n\n  orange fruit\n\n  ```\n  { orange code block }\n  ```\n\n  > orange block quote\n\nMultiple definitions, tight:\n\n: apple\n\n  red fruit\n\n  computer\n: orange\n\n  orange fruit\n\n  bank\n\nMultiple definitions, loose:\n\n: apple\n\n  red fruit\n\n  computer\n\n: orange\n\n  orange fruit\n\n  bank\n\nBlank line after term, indented marker, alternate markers:\n\n: apple\n\n  red fruit\n\n  computer\n\n: orange\n\n  orange fruit\n\n  1. sublist\n  2. sublist\n\n{#html-blocks}\n# HTML Blocks\n\nSimple block on one line:\n\n:::\nfoo\n\n:::\n\nAnd nested without indentation:\n\n::::::\n::::\n:::\nfoo\n\n:::\n\n::::\n\n:::\nbar\n\n:::\n\n::::::\n\nInterpreted markdown in a table:\n\nThis is _emphasized_\n\nAnd this is *strong*\n\nHere's a simple block:\n\n:::\nfoo\n\n:::\n\nThis should be a code block, though:\n\n```\n<div>\n    foo\n</div>\n```\n\nAs should this:\n\n```\n<div>foo</div>\n```\n\nNow, nested:\n\n:::::\n::::\n:::\nfoo\n\n:::\n\n::::\n\n:::::\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n```\n<!-- Comment -->\n```\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n```\n<hr />\n```\n\nHr's:\n\n* * * *\n\n{#inline-markup}\n# Inline Markup\n\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _[emphasized link](/url)_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n{-This is _strikeout_.-}\n\nSuperscripts: a^bc^d a^_hello_^ a^hello there^.\n\nSubscripts: H~2~O, H~23~O, H~many of them~O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na\\^b c\\^d, a\\~b c\\~d.\n\n* * * *\n\n{#smart-quotes-ellipses-dashes}\n# Smart quotes, ellipses, dashes\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted '`code`' and a \"[quoted\nlink](http://example.com/?foo=1&bar=2)\".\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses...and...and....\n\n* * * *\n\n{#latex}\n# LaTeX\n\n-\n- $`2+2=4`\n- $`x \\in y`\n- $`\\alpha \\wedge \\omega`\n- $`223`\n- $`p`-Tree\n- Here's some display math:\n  $$`\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}`\n- Here's one that has a line break in it: $`\\alpha + \\omega \\times x^2`.\n\nThese shouldn't be math:\n\n- To get the famous equation, write `$e = mc^2$`.\n- $22,000 is a _lot_ of money. So is $34,000. (It worked if \"lot\" is\n  emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped `$`\\: $73 _this should be emphasized_ 23$.\n\nHere's a LaTeX table:\n\n* * * *\n\n{#special-characters}\n# Special Characters\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 \\< 5.\n\n6 \\> 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: \\>\n\nHash: #\n\nPeriod: .\n\nBang: \\!\n\nPlus: +\n\nMinus: -\n\n* * * *\n\n{#links}\n# Links\n\n{#explicit}\n## Explicit\n\nJust a [URL](/url/).\n\n[URL and title](/url/){title=\"title\"}.\n\n[URL and title](/url/){title=\"title preceded by two spaces\"}.\n\n[URL and title](/url/){title=\"title preceded by a tab\"}.\n\n[URL and title](/url/){title=\"title with \\\"quotes\\\" in it\"}\n\n[URL and title](/url/){title=\"title with single quotes\"}\n\n[with\\_underscore](/url/with_underscore)\n\n[Email link](mailto:nobody@nowhere.net)\n\n[Empty]().\n\n{#reference}\n## Reference\n\nFoo [bar](/url/).\n\nWith [embedded \\[brackets\\]](/url/).\n\n[b](/url/) by itself should be a link.\n\nIndented [once](/url).\n\nIndented [twice](/url).\n\nIndented [thrice](/url).\n\nThis should \\[not\\]\\[\\] be a link.\n\n```\n[not]: /url\n```\n\nFoo [bar](/url/){title=\"Title with \\\"quotes\\\" inside\"}.\n\nFoo [biz](/url/){title=\"Title with \\\"quote\\\" inside\"}.\n\n{#with-ampersands}\n## With ampersands\n\nHere's a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).\n\nHere's a link with an amersand in the link text:\n[AT&T](http://att.com/){title=\"AT&T\"}.\n\nHere's an [inline link](/script?foo=1&bar=2).\n\nHere's an [inline link in pointy braces](/script?foo=1&bar=2).\n\n{#autolinks}\n## Autolinks\n\nWith an ampersand: <http://example.com/?foo=1&bar=2>\n\n- In a list?\n- <http://example.com/>\n- It should.\n\nAn e-mail address: <nobody@nowhere.net>\n\n> Blockquoted: <http://example.com/>\n\nAuto-links should not occur here: `<http://example.com/>`\n\n```\nor here: <http://example.com/>\n```\n\n* * * *\n\n{#images}\n# Images\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n::::\n![lalune](lalune.jpg){title=\"Voyage dans la Lune\"}\n\n{.caption}\n:::\nlalune\n\n:::\n\n::::\n\nHere is a movie ![movie](movie.jpg) icon.\n\n* * * *\n\n{#footnotes}\n# Footnotes\n\nHere is a footnote reference,[^1] and another.[^2] This should _not_ be a\nfootnote reference, because it contains a space.\\[\\^my note\\] Here is an inline\nnote.[^3]\n\n> Notes can go in quotes.[^4]\n\n1. And in list items.[^5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[^1]: Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.\n\n[^2]: Here's the long note. This one contains multiple blocks.\n\n    Subsequent blocks are indented to show that they belong to the footnote (as\n    with list items).\n\n    ```\n      { <code> }\n    ```\n\n    If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.\n\n[^3]: This is _easier_ to type. Inline notes may contain\n    [links](http://google.com) and `]` verbatim characters, as well as\n    \\[bracketed text\\].\n\n[^4]: In quote.\n\n[^5]: In list.\n"
  },
  {
    "path": "test/writer.docbook4",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.5//EN\"\n                  \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\">\n<article>\n  <articleinfo>\n    <title>Pandoc Test Suite</title>\n    <authorgroup>\n      <author>\n        <personname>\n          <firstname>John</firstname>\n          <surname>MacFarlane</surname>\n        </personname>\n      </author>\n      <author>\n        <personname>\n          <firstname></firstname>\n          <surname>Anonymous</surname>\n        </personname>\n      </author>\n    </authorgroup>\n    <date>July 17, 2006</date>\n  </articleinfo>\n  <para>\n    This is a set of tests for pandoc. Most of them are adapted from John\n    Gruber’s markdown test suite.\n  </para>\n  <sect1 id=\"headers\">\n    <title>Headers</title>\n    <sect2 id=\"level-2-with-an-embedded-link\">\n      <title>Level 2 with an <ulink url=\"/url\">embedded link</ulink></title>\n      <sect3 id=\"level-3-with-emphasis\">\n        <title>Level 3 with <emphasis>emphasis</emphasis></title>\n        <sect4 id=\"level-4\">\n          <title>Level 4</title>\n          <sect5 id=\"level-5\">\n            <title>Level 5</title>\n            <para>\n            </para>\n          </sect5>\n        </sect4>\n      </sect3>\n    </sect2>\n  </sect1>\n  <sect1 id=\"level-1\">\n    <title>Level 1</title>\n    <sect2 id=\"level-2-with-emphasis\">\n      <title>Level 2 with <emphasis>emphasis</emphasis></title>\n      <sect3 id=\"level-3\">\n        <title>Level 3</title>\n        <para>\n          with no blank line\n        </para>\n      </sect3>\n    </sect2>\n    <sect2 id=\"level-2\">\n      <title>Level 2</title>\n      <para>\n        with no blank line\n      </para>\n    </sect2>\n  </sect1>\n  <sect1 id=\"paragraphs\">\n    <title>Paragraphs</title>\n    <para>\n      Here’s a regular paragraph.\n    </para>\n    <para>\n      In Markdown 1.0.0 and earlier. Version 8. This line turns into a list\n      item. Because a hard-wrapped line in the middle of a paragraph looked like\n      a list item.\n    </para>\n    <para>\n      Here’s one with a bullet. * criminey.\n    </para>\n<literallayout>There should be a hard line break\nhere.</literallayout>\n  </sect1>\n  <sect1 id=\"block-quotes\">\n    <title>Block Quotes</title>\n    <para>\n      E-mail style:\n    </para>\n    <blockquote>\n      <para>\n        This is a block quote. It is pretty short.\n      </para>\n    </blockquote>\n    <blockquote>\n      <para>\n        Code in a block quote:\n      </para>\n      <programlisting>\nsub status {\n    print &quot;working&quot;;\n}\n</programlisting>\n      <para>\n        A list:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            item one\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            item two\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Nested block quotes:\n      </para>\n      <blockquote>\n        <para>\n          nested\n        </para>\n      </blockquote>\n      <blockquote>\n        <para>\n          nested\n        </para>\n      </blockquote>\n    </blockquote>\n    <para>\n      This should not be a block quote: 2 &gt; 1.\n    </para>\n    <para>\n      And a following paragraph.\n    </para>\n  </sect1>\n  <sect1 id=\"code-blocks\">\n    <title>Code Blocks</title>\n    <para>\n      Code:\n    </para>\n    <programlisting>\n---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab\n</programlisting>\n    <para>\n      And:\n    </para>\n    <programlisting>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{\n</programlisting>\n  </sect1>\n  <sect1 id=\"lists\">\n    <title>Lists</title>\n    <sect2 id=\"unordered\">\n      <title>Unordered</title>\n      <para>\n        Asterisks tight:\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            asterisk 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Asterisks loose:\n      </para>\n      <itemizedlist>\n        <listitem>\n          <para>\n            asterisk 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Pluses tight:\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Plus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Pluses loose:\n      </para>\n      <itemizedlist>\n        <listitem>\n          <para>\n            Plus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Minuses tight:\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Minus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Minuses loose:\n      </para>\n      <itemizedlist>\n        <listitem>\n          <para>\n            Minus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n    </sect2>\n    <sect2 id=\"ordered\">\n      <title>Ordered</title>\n      <para>\n        Tight:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        and:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            One\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Two\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Three\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Loose using tabs:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        and using spaces:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            One\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Two\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Three\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Multiple paragraphs:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            Item 1, graf one.\n          </para>\n          <para>\n            Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n            back.\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Item 2.\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Item 3.\n          </para>\n        </listitem>\n      </orderedlist>\n    </sect2>\n    <sect2 id=\"nested\">\n      <title>Nested</title>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Tab\n          </para>\n          <itemizedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Tab\n              </para>\n              <itemizedlist spacing=\"compact\">\n                <listitem>\n                  <para>\n                    Tab\n                  </para>\n                </listitem>\n              </itemizedlist>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Here’s another:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second:\n          </para>\n          <itemizedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Fee\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Fie\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Foe\n              </para>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Same thing but with paragraphs:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second:\n          </para>\n          <itemizedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Fee\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Fie\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Foe\n              </para>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n    </sect2>\n    <sect2 id=\"tabs-and-spaces\">\n      <title>Tabs and spaces</title>\n      <itemizedlist>\n        <listitem>\n          <para>\n            this is a list item indented with tabs\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            this is a list item indented with spaces\n          </para>\n          <itemizedlist>\n            <listitem>\n              <para>\n                this is an example list item indented with tabs\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                this is an example list item indented with spaces\n              </para>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n      </itemizedlist>\n    </sect2>\n    <sect2 id=\"fancy-list-markers\">\n      <title>Fancy list markers</title>\n      <orderedlist numeration=\"arabic\" startingnumber=\"2\">\n        <listitem>\n          <para>\n            begins with 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            and now 3\n          </para>\n          <para>\n            with a continuation\n          </para>\n          <orderedlist numeration=\"lowerroman\" spacing=\"compact\" startingnumber=\"4\">\n            <listitem>\n              <para>\n                sublist with roman numerals, starting with 4\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                more items\n              </para>\n              <orderedlist numeration=\"upperalpha\" spacing=\"compact\">\n                <listitem>\n                  <para>\n                    a subsublist\n                  </para>\n                </listitem>\n                <listitem>\n                  <para>\n                    a subsublist\n                  </para>\n                </listitem>\n              </orderedlist>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </orderedlist>\n      <para>\n        Nesting:\n      </para>\n      <orderedlist numeration=\"upperalpha\" spacing=\"compact\">\n        <listitem>\n          <para>\n            Upper Alpha\n          </para>\n          <orderedlist numeration=\"upperroman\" spacing=\"compact\">\n            <listitem>\n              <para>\n                Upper Roman.\n              </para>\n              <orderedlist numeration=\"arabic\" spacing=\"compact\" startingnumber=\"6\">\n                <listitem>\n                  <para>\n                    Decimal start with 6\n                  </para>\n                  <orderedlist numeration=\"loweralpha\" spacing=\"compact\" startingnumber=\"3\">\n                    <listitem>\n                      <para>\n                        Lower alpha with paren\n                      </para>\n                    </listitem>\n                  </orderedlist>\n                </listitem>\n              </orderedlist>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </orderedlist>\n      <para>\n        Autonumbering:\n      </para>\n      <orderedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Autonumber.\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            More.\n          </para>\n          <orderedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Nested.\n              </para>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </orderedlist>\n      <para>\n        Should not be a list item:\n      </para>\n      <para>\n        M.A. 2007\n      </para>\n      <para>\n        B. Williams\n      </para>\n    </sect2>\n  </sect1>\n  <sect1 id=\"definition-lists\">\n    <title>Definition Lists</title>\n    <para>\n      Tight using spaces:\n    </para>\n    <variablelist spacing=\"compact\">\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          banana\n        </term>\n        <listitem>\n          <para>\n            yellow fruit\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Tight using tabs:\n    </para>\n    <variablelist spacing=\"compact\">\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          banana\n        </term>\n        <listitem>\n          <para>\n            yellow fruit\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Loose:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          banana\n        </term>\n        <listitem>\n          <para>\n            yellow fruit\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Multiple blocks with italics:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          <emphasis>apple</emphasis>\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            contains seeds, crisp, pleasant to taste\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          <emphasis>orange</emphasis>\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <programlisting>\n{ orange code block }\n</programlisting>\n          <blockquote>\n            <para>\n              orange block quote\n            </para>\n          </blockquote>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Multiple definitions, tight:\n    </para>\n    <variablelist spacing=\"compact\">\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            computer\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <para>\n            bank\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Multiple definitions, loose:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            computer\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <para>\n            bank\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Blank line after term, indented marker, alternate markers:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            computer\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <orderedlist numeration=\"arabic\" spacing=\"compact\">\n            <listitem>\n              <para>\n                sublist\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                sublist\n              </para>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n  </sect1>\n  <sect1 id=\"html-blocks\">\n    <title>HTML Blocks</title>\n    <para>\n      Simple block on one line:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      And nested without indentation:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      bar\n    </para>\n    <para>\n      Interpreted markdown in a table:\n    </para>\n    <table>\n    <tr>\n    <td>\n    This is <emphasis>emphasized</emphasis>\n    </td>\n    <td>\n    And this is <emphasis role=\"strong\">strong</emphasis>\n    </td>\n    </tr>\n    </table>\n    <script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n    <para>\n      Here’s a simple block:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      This should be a code block, though:\n    </para>\n    <programlisting>\n&lt;div&gt;\n    foo\n&lt;/div&gt;\n</programlisting>\n    <para>\n      As should this:\n    </para>\n    <programlisting>\n&lt;div&gt;foo&lt;/div&gt;\n</programlisting>\n    <para>\n      Now, nested:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      This should just be an HTML comment:\n    </para>\n    <!-- Comment -->\n    <para>\n      Multiline:\n    </para>\n    <!--\n    Blah\n    Blah\n    -->\n    <!--\n        This is another comment.\n    -->\n    <para>\n      Code block:\n    </para>\n    <programlisting>\n&lt;!-- Comment --&gt;\n</programlisting>\n    <para>\n      Just plain comment, with trailing spaces on the line:\n    </para>\n    <!-- foo -->\n    <para>\n      Code:\n    </para>\n    <programlisting>\n&lt;hr /&gt;\n</programlisting>\n    <para>\n      Hr’s:\n    </para>\n    <hr>\n    <hr />\n    <hr />\n    <hr>\n    <hr />\n    <hr />\n    <hr class=\"foo\" id=\"bar\" />\n    <hr class=\"foo\" id=\"bar\" />\n    <hr class=\"foo\" id=\"bar\">\n  </sect1>\n  <sect1 id=\"inline-markup\">\n    <title>Inline Markup</title>\n    <para>\n      This is <emphasis>emphasized</emphasis>, and so <emphasis>is\n      this</emphasis>.\n    </para>\n    <para>\n      This is <emphasis role=\"strong\">strong</emphasis>, and so\n      <emphasis role=\"strong\">is this</emphasis>.\n    </para>\n    <para>\n      An <emphasis><ulink url=\"/url\">emphasized link</ulink></emphasis>.\n    </para>\n    <para>\n      <emphasis role=\"strong\"><emphasis>This is strong and\n      em.</emphasis></emphasis>\n    </para>\n    <para>\n      So is <emphasis role=\"strong\"><emphasis>this</emphasis></emphasis> word.\n    </para>\n    <para>\n      <emphasis role=\"strong\"><emphasis>This is strong and\n      em.</emphasis></emphasis>\n    </para>\n    <para>\n      So is <emphasis role=\"strong\"><emphasis>this</emphasis></emphasis> word.\n    </para>\n    <para>\n      This is code: <literal>&gt;</literal>, <literal>$</literal>,\n      <literal>\\</literal>, <literal>\\$</literal>,\n      <literal>&lt;html&gt;</literal>.\n    </para>\n    <para>\n      <emphasis role=\"strikethrough\">This is\n      <emphasis>strikeout</emphasis>.</emphasis>\n    </para>\n    <para>\n      Superscripts: a<superscript>bc</superscript>d\n      a<superscript><emphasis>hello</emphasis></superscript>\n      a<superscript>hello there</superscript>.\n    </para>\n    <para>\n      Subscripts: H<subscript>2</subscript>O, H<subscript>23</subscript>O,\n      H<subscript>many of them</subscript>O.\n    </para>\n    <para>\n      These should not be superscripts or subscripts, because of the unescaped\n      spaces: a^b c^d, a~b c~d.\n    </para>\n  </sect1>\n  <sect1 id=\"smart-quotes-ellipses-dashes\">\n    <title>Smart quotes, ellipses, dashes</title>\n    <para>\n      <quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my\n      name.</quote>\n    </para>\n    <para>\n      <quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are letters.\n    </para>\n    <para>\n      <quote>Oak,</quote> <quote>elm,</quote> and <quote>beech</quote> are names\n      of trees. So is <quote>pine.</quote>\n    </para>\n    <para>\n      <quote>He said, <quote>I want to go.</quote></quote> Were you alive in the\n      70’s?\n    </para>\n    <para>\n      Here is some quoted <quote><literal>code</literal></quote> and a\n      <quote><ulink url=\"http://example.com/?foo=1&amp;bar=2\">quoted\n      link</ulink></quote>.\n    </para>\n    <para>\n      Some dashes: one—two — three—four — five.\n    </para>\n    <para>\n      Dashes between numbers: 5–7, 255–66, 1987–1999.\n    </para>\n    <para>\n      Ellipses…and…and….\n    </para>\n  </sect1>\n  <sect1 id=\"latex\">\n    <title>LaTeX</title>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          2 + 2 = 4\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <emphasis>x</emphasis> ∈ <emphasis>y</emphasis>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <emphasis>α</emphasis> ∧ <emphasis>ω</emphasis>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          223\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <emphasis>p</emphasis>-Tree\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Here’s some display math:\n          $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Here’s one that has a line break in it:\n          <emphasis>α</emphasis> + <emphasis>ω</emphasis> × <emphasis>x</emphasis><superscript>2</superscript>.\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      These shouldn’t be math:\n    </para>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n          To get the famous equation, write <literal>$e = mc^2$</literal>.\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          $22,000 is a <emphasis>lot</emphasis> of money. So is $34,000. (It\n          worked if <quote>lot</quote> is emphasized.)\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Shoes ($20) and socks ($5).\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Escaped <literal>$</literal>: $73 <emphasis>this should be\n          emphasized</emphasis> 23$.\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      Here’s a LaTeX table:\n    </para>\n  </sect1>\n  <sect1 id=\"special-characters\">\n    <title>Special Characters</title>\n    <para>\n      Here is some unicode:\n    </para>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n          I hat: Î\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          o umlaut: ö\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          section: §\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          set membership: ∈\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          copyright: ©\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      AT&amp;T has an ampersand in their name.\n    </para>\n    <para>\n      AT&amp;T is another way to write it.\n    </para>\n    <para>\n      This &amp; that.\n    </para>\n    <para>\n      4 &lt; 5.\n    </para>\n    <para>\n      6 &gt; 5.\n    </para>\n    <para>\n      Backslash: \\\n    </para>\n    <para>\n      Backtick: `\n    </para>\n    <para>\n      Asterisk: *\n    </para>\n    <para>\n      Underscore: _\n    </para>\n    <para>\n      Left brace: {\n    </para>\n    <para>\n      Right brace: }\n    </para>\n    <para>\n      Left bracket: [\n    </para>\n    <para>\n      Right bracket: ]\n    </para>\n    <para>\n      Left paren: (\n    </para>\n    <para>\n      Right paren: )\n    </para>\n    <para>\n      Greater-than: &gt;\n    </para>\n    <para>\n      Hash: #\n    </para>\n    <para>\n      Period: .\n    </para>\n    <para>\n      Bang: !\n    </para>\n    <para>\n      Plus: +\n    </para>\n    <para>\n      Minus: -\n    </para>\n  </sect1>\n  <sect1 id=\"links\">\n    <title>Links</title>\n    <sect2 id=\"explicit\">\n      <title>Explicit</title>\n      <para>\n        Just a <ulink url=\"/url/\">URL</ulink>.\n      </para>\n      <para>\n        <ulink url=\"/url/\">URL and title</ulink>.\n      </para>\n      <para>\n        <ulink url=\"/url/\">URL and title</ulink>.\n      </para>\n      <para>\n        <ulink url=\"/url/\">URL and title</ulink>.\n      </para>\n      <para>\n        <ulink url=\"/url/\">URL and title</ulink>\n      </para>\n      <para>\n        <ulink url=\"/url/\">URL and title</ulink>\n      </para>\n      <para>\n        <ulink url=\"/url/with_underscore\">with_underscore</ulink>\n      </para>\n      <para>\n        Email link (<email>nobody@nowhere.net</email>)\n      </para>\n      <para>\n        <ulink url=\"\">Empty</ulink>.\n      </para>\n    </sect2>\n    <sect2 id=\"reference\">\n      <title>Reference</title>\n      <para>\n        Foo <ulink url=\"/url/\">bar</ulink>.\n      </para>\n      <para>\n        With <ulink url=\"/url/\">embedded [brackets]</ulink>.\n      </para>\n      <para>\n        <ulink url=\"/url/\">b</ulink> by itself should be a link.\n      </para>\n      <para>\n        Indented <ulink url=\"/url\">once</ulink>.\n      </para>\n      <para>\n        Indented <ulink url=\"/url\">twice</ulink>.\n      </para>\n      <para>\n        Indented <ulink url=\"/url\">thrice</ulink>.\n      </para>\n      <para>\n        This should [not][] be a link.\n      </para>\n      <programlisting>\n[not]: /url\n</programlisting>\n      <para>\n        Foo <ulink url=\"/url/\">bar</ulink>.\n      </para>\n      <para>\n        Foo <ulink url=\"/url/\">biz</ulink>.\n      </para>\n    </sect2>\n    <sect2 id=\"with-ampersands\">\n      <title>With ampersands</title>\n      <para>\n        Here’s a <ulink url=\"http://example.com/?foo=1&amp;bar=2\">link with an\n        ampersand in the URL</ulink>.\n      </para>\n      <para>\n        Here’s a link with an amersand in the link text:\n        <ulink url=\"http://att.com/\">AT&amp;T</ulink>.\n      </para>\n      <para>\n        Here’s an <ulink url=\"/script?foo=1&amp;bar=2\">inline link</ulink>.\n      </para>\n      <para>\n        Here’s an <ulink url=\"/script?foo=1&amp;bar=2\">inline link in pointy\n        braces</ulink>.\n      </para>\n    </sect2>\n    <sect2 id=\"autolinks\">\n      <title>Autolinks</title>\n      <para>\n        With an ampersand:\n        <ulink url=\"http://example.com/?foo=1&amp;bar=2\" role=\"uri\">http://example.com/?foo=1&amp;bar=2</ulink>\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            In a list?\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            <ulink url=\"http://example.com/\" role=\"uri\">http://example.com/</ulink>\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            It should.\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        An e-mail address: <email>nobody@nowhere.net</email>\n      </para>\n      <blockquote>\n        <para>\n          Blockquoted:\n          <ulink url=\"http://example.com/\" role=\"uri\">http://example.com/</ulink>\n        </para>\n      </blockquote>\n      <para>\n        Auto-links should not occur here:\n        <literal>&lt;http://example.com/&gt;</literal>\n      </para>\n      <programlisting>\nor here: &lt;http://example.com/&gt;\n</programlisting>\n    </sect2>\n  </sect1>\n  <sect1 id=\"images\">\n    <title>Images</title>\n    <para>\n      From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):\n    </para>\n    <figure>\n      <title>lalune</title>\n      <mediaobject>\n        <imageobject>\n          <imagedata fileref=\"lalune.jpg\" />\n        </imageobject>\n        <textobject><phrase>lalune</phrase></textobject>\n      </mediaobject>\n    </figure>\n    <para>\n      Here is a movie <inlinemediaobject>\n        <imageobject>\n          <imagedata fileref=\"movie.jpg\" />\n        </imageobject>\n        <textobject>\n          <phrase>movie</phrase>\n        </textobject>\n      </inlinemediaobject> icon.\n    </para>\n  </sect1>\n  <sect1 id=\"footnotes\">\n    <title>Footnotes</title>\n    <para>\n      Here is a footnote reference,<footnote>\n        <para>\n          Here is the footnote. It can go anywhere after the footnote reference.\n          It need not be placed at the end of the document.\n        </para>\n      </footnote> and another.<footnote>\n        <para>\n          Here’s the long note. This one contains multiple blocks.\n        </para>\n        <para>\n          Subsequent blocks are indented to show that they belong to the\n          footnote (as with list items).\n        </para>\n        <programlisting>\n  { &lt;code&gt; }\n</programlisting>\n        <para>\n          If you want, you can indent every line, but you can also be lazy and\n          just indent the first line of each block.\n        </para>\n      </footnote> This should <emphasis>not</emphasis> be a footnote reference,\n      because it contains a space.[^my note] Here is an inline note.<footnote>\n        <para>\n          This is <emphasis>easier</emphasis> to type. Inline notes may contain\n          <ulink url=\"http://google.com\">links</ulink> and <literal>]</literal>\n          verbatim characters, as well as [bracketed text].\n        </para>\n      </footnote>\n    </para>\n    <blockquote>\n      <para>\n        Notes can go in quotes.<footnote>\n          <para>\n            In quote.\n          </para>\n        </footnote>\n      </para>\n    </blockquote>\n    <orderedlist numeration=\"arabic\" spacing=\"compact\">\n      <listitem>\n        <para>\n          And in list items.<footnote>\n            <para>\n              In list.\n            </para>\n          </footnote>\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      This paragraph should not be part of the note, as it is not indented.\n    </para>\n  </sect1>\n</article>\n"
  },
  {
    "path": "test/writer.docbook5",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article>\n<article\n  xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\"\n  xmlns:xlink=\"http://www.w3.org/1999/xlink\" >\n  <info>\n    <title>Pandoc Test Suite</title>\n    <authorgroup>\n      <author>\n        <personname>\n          <firstname>John</firstname>\n          <surname>MacFarlane</surname>\n        </personname>\n      </author>\n      <author>\n        <personname>\n          <firstname></firstname>\n          <surname>Anonymous</surname>\n        </personname>\n      </author>\n    </authorgroup>\n    <date>July 17, 2006</date>\n  </info>\n  <para>\n    This is a set of tests for pandoc. Most of them are adapted from John\n    Gruber’s markdown test suite.\n  </para>\n  <section xml:id=\"headers\">\n    <title>Headers</title>\n    <section xml:id=\"level-2-with-an-embedded-link\">\n      <title>Level 2 with an <link xlink:href=\"/url\">embedded\n      link</link></title>\n      <section xml:id=\"level-3-with-emphasis\">\n        <title>Level 3 with <emphasis>emphasis</emphasis></title>\n        <section xml:id=\"level-4\">\n          <title>Level 4</title>\n          <section xml:id=\"level-5\">\n            <title>Level 5</title>\n            <para>\n            </para>\n          </section>\n        </section>\n      </section>\n    </section>\n  </section>\n  <section xml:id=\"level-1\">\n    <title>Level 1</title>\n    <section xml:id=\"level-2-with-emphasis\">\n      <title>Level 2 with <emphasis>emphasis</emphasis></title>\n      <section xml:id=\"level-3\">\n        <title>Level 3</title>\n        <para>\n          with no blank line\n        </para>\n      </section>\n    </section>\n    <section xml:id=\"level-2\">\n      <title>Level 2</title>\n      <para>\n        with no blank line\n      </para>\n    </section>\n  </section>\n  <section xml:id=\"paragraphs\">\n    <title>Paragraphs</title>\n    <para>\n      Here’s a regular paragraph.\n    </para>\n    <para>\n      In Markdown 1.0.0 and earlier. Version 8. This line turns into a list\n      item. Because a hard-wrapped line in the middle of a paragraph looked like\n      a list item.\n    </para>\n    <para>\n      Here’s one with a bullet. * criminey.\n    </para>\n<literallayout>There should be a hard line break\nhere.</literallayout>\n  </section>\n  <section xml:id=\"block-quotes\">\n    <title>Block Quotes</title>\n    <para>\n      E-mail style:\n    </para>\n    <blockquote>\n      <para>\n        This is a block quote. It is pretty short.\n      </para>\n    </blockquote>\n    <blockquote>\n      <para>\n        Code in a block quote:\n      </para>\n      <programlisting>\nsub status {\n    print &quot;working&quot;;\n}\n</programlisting>\n      <para>\n        A list:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            item one\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            item two\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Nested block quotes:\n      </para>\n      <blockquote>\n        <para>\n          nested\n        </para>\n      </blockquote>\n      <blockquote>\n        <para>\n          nested\n        </para>\n      </blockquote>\n    </blockquote>\n    <para>\n      This should not be a block quote: 2 &gt; 1.\n    </para>\n    <para>\n      And a following paragraph.\n    </para>\n  </section>\n  <section xml:id=\"code-blocks\">\n    <title>Code Blocks</title>\n    <para>\n      Code:\n    </para>\n    <programlisting>\n---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab\n</programlisting>\n    <para>\n      And:\n    </para>\n    <programlisting>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{\n</programlisting>\n  </section>\n  <section xml:id=\"lists\">\n    <title>Lists</title>\n    <section xml:id=\"unordered\">\n      <title>Unordered</title>\n      <para>\n        Asterisks tight:\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            asterisk 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Asterisks loose:\n      </para>\n      <itemizedlist>\n        <listitem>\n          <para>\n            asterisk 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            asterisk 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Pluses tight:\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Plus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Pluses loose:\n      </para>\n      <itemizedlist>\n        <listitem>\n          <para>\n            Plus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Plus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Minuses tight:\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Minus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Minuses loose:\n      </para>\n      <itemizedlist>\n        <listitem>\n          <para>\n            Minus 1\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Minus 3\n          </para>\n        </listitem>\n      </itemizedlist>\n    </section>\n    <section xml:id=\"ordered\">\n      <title>Ordered</title>\n      <para>\n        Tight:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        and:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            One\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Two\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Three\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Loose using tabs:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        and using spaces:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            One\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Two\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Three\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Multiple paragraphs:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            Item 1, graf one.\n          </para>\n          <para>\n            Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n            back.\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Item 2.\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Item 3.\n          </para>\n        </listitem>\n      </orderedlist>\n    </section>\n    <section xml:id=\"nested\">\n      <title>Nested</title>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Tab\n          </para>\n          <itemizedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Tab\n              </para>\n              <itemizedlist spacing=\"compact\">\n                <listitem>\n                  <para>\n                    Tab\n                  </para>\n                </listitem>\n              </itemizedlist>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n      </itemizedlist>\n      <para>\n        Here’s another:\n      </para>\n      <orderedlist numeration=\"arabic\" spacing=\"compact\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second:\n          </para>\n          <itemizedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Fee\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Fie\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Foe\n              </para>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n      <para>\n        Same thing but with paragraphs:\n      </para>\n      <orderedlist numeration=\"arabic\">\n        <listitem>\n          <para>\n            First\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            Second:\n          </para>\n          <itemizedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Fee\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Fie\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                Foe\n              </para>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n        <listitem>\n          <para>\n            Third\n          </para>\n        </listitem>\n      </orderedlist>\n    </section>\n    <section xml:id=\"tabs-and-spaces\">\n      <title>Tabs and spaces</title>\n      <itemizedlist>\n        <listitem>\n          <para>\n            this is a list item indented with tabs\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            this is a list item indented with spaces\n          </para>\n          <itemizedlist>\n            <listitem>\n              <para>\n                this is an example list item indented with tabs\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                this is an example list item indented with spaces\n              </para>\n            </listitem>\n          </itemizedlist>\n        </listitem>\n      </itemizedlist>\n    </section>\n    <section xml:id=\"fancy-list-markers\">\n      <title>Fancy list markers</title>\n      <orderedlist numeration=\"arabic\" startingnumber=\"2\">\n        <listitem>\n          <para>\n            begins with 2\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            and now 3\n          </para>\n          <para>\n            with a continuation\n          </para>\n          <orderedlist numeration=\"lowerroman\" spacing=\"compact\" startingnumber=\"4\">\n            <listitem>\n              <para>\n                sublist with roman numerals, starting with 4\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                more items\n              </para>\n              <orderedlist numeration=\"upperalpha\" spacing=\"compact\">\n                <listitem>\n                  <para>\n                    a subsublist\n                  </para>\n                </listitem>\n                <listitem>\n                  <para>\n                    a subsublist\n                  </para>\n                </listitem>\n              </orderedlist>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </orderedlist>\n      <para>\n        Nesting:\n      </para>\n      <orderedlist numeration=\"upperalpha\" spacing=\"compact\">\n        <listitem>\n          <para>\n            Upper Alpha\n          </para>\n          <orderedlist numeration=\"upperroman\" spacing=\"compact\">\n            <listitem>\n              <para>\n                Upper Roman.\n              </para>\n              <orderedlist numeration=\"arabic\" spacing=\"compact\" startingnumber=\"6\">\n                <listitem>\n                  <para>\n                    Decimal start with 6\n                  </para>\n                  <orderedlist numeration=\"loweralpha\" spacing=\"compact\" startingnumber=\"3\">\n                    <listitem>\n                      <para>\n                        Lower alpha with paren\n                      </para>\n                    </listitem>\n                  </orderedlist>\n                </listitem>\n              </orderedlist>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </orderedlist>\n      <para>\n        Autonumbering:\n      </para>\n      <orderedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            Autonumber.\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            More.\n          </para>\n          <orderedlist spacing=\"compact\">\n            <listitem>\n              <para>\n                Nested.\n              </para>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </orderedlist>\n      <para>\n        Should not be a list item:\n      </para>\n      <para>\n        M.A. 2007\n      </para>\n      <para>\n        B. Williams\n      </para>\n    </section>\n  </section>\n  <section xml:id=\"definition-lists\">\n    <title>Definition Lists</title>\n    <para>\n      Tight using spaces:\n    </para>\n    <variablelist spacing=\"compact\">\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          banana\n        </term>\n        <listitem>\n          <para>\n            yellow fruit\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Tight using tabs:\n    </para>\n    <variablelist spacing=\"compact\">\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          banana\n        </term>\n        <listitem>\n          <para>\n            yellow fruit\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Loose:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          banana\n        </term>\n        <listitem>\n          <para>\n            yellow fruit\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Multiple blocks with italics:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          <emphasis>apple</emphasis>\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            contains seeds, crisp, pleasant to taste\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          <emphasis>orange</emphasis>\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <programlisting>\n{ orange code block }\n</programlisting>\n          <blockquote>\n            <para>\n              orange block quote\n            </para>\n          </blockquote>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Multiple definitions, tight:\n    </para>\n    <variablelist spacing=\"compact\">\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            computer\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <para>\n            bank\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Multiple definitions, loose:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            computer\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <para>\n            bank\n          </para>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n    <para>\n      Blank line after term, indented marker, alternate markers:\n    </para>\n    <variablelist>\n      <varlistentry>\n        <term>\n          apple\n        </term>\n        <listitem>\n          <para>\n            red fruit\n          </para>\n          <para>\n            computer\n          </para>\n        </listitem>\n      </varlistentry>\n      <varlistentry>\n        <term>\n          orange\n        </term>\n        <listitem>\n          <para>\n            orange fruit\n          </para>\n          <orderedlist numeration=\"arabic\" spacing=\"compact\">\n            <listitem>\n              <para>\n                sublist\n              </para>\n            </listitem>\n            <listitem>\n              <para>\n                sublist\n              </para>\n            </listitem>\n          </orderedlist>\n        </listitem>\n      </varlistentry>\n    </variablelist>\n  </section>\n  <section xml:id=\"html-blocks\">\n    <title>HTML Blocks</title>\n    <para>\n      Simple block on one line:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      And nested without indentation:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      bar\n    </para>\n    <para>\n      Interpreted markdown in a table:\n    </para>\n    This is <emphasis>emphasized</emphasis>\n    And this is <emphasis role=\"strong\">strong</emphasis>\n    <para>\n      Here’s a simple block:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      This should be a code block, though:\n    </para>\n    <programlisting>\n&lt;div&gt;\n    foo\n&lt;/div&gt;\n</programlisting>\n    <para>\n      As should this:\n    </para>\n    <programlisting>\n&lt;div&gt;foo&lt;/div&gt;\n</programlisting>\n    <para>\n      Now, nested:\n    </para>\n    <para>\n      foo\n    </para>\n    <para>\n      This should just be an HTML comment:\n    </para>\n    <para>\n      Multiline:\n    </para>\n    <para>\n      Code block:\n    </para>\n    <programlisting>\n&lt;!-- Comment --&gt;\n</programlisting>\n    <para>\n      Just plain comment, with trailing spaces on the line:\n    </para>\n    <para>\n      Code:\n    </para>\n    <programlisting>\n&lt;hr /&gt;\n</programlisting>\n    <para>\n      Hr’s:\n    </para>\n  </section>\n  <section xml:id=\"inline-markup\">\n    <title>Inline Markup</title>\n    <para>\n      This is <emphasis>emphasized</emphasis>, and so <emphasis>is\n      this</emphasis>.\n    </para>\n    <para>\n      This is <emphasis role=\"strong\">strong</emphasis>, and so\n      <emphasis role=\"strong\">is this</emphasis>.\n    </para>\n    <para>\n      An <emphasis><link xlink:href=\"/url\">emphasized link</link></emphasis>.\n    </para>\n    <para>\n      <emphasis role=\"strong\"><emphasis>This is strong and\n      em.</emphasis></emphasis>\n    </para>\n    <para>\n      So is <emphasis role=\"strong\"><emphasis>this</emphasis></emphasis> word.\n    </para>\n    <para>\n      <emphasis role=\"strong\"><emphasis>This is strong and\n      em.</emphasis></emphasis>\n    </para>\n    <para>\n      So is <emphasis role=\"strong\"><emphasis>this</emphasis></emphasis> word.\n    </para>\n    <para>\n      This is code: <literal>&gt;</literal>, <literal>$</literal>,\n      <literal>\\</literal>, <literal>\\$</literal>,\n      <literal>&lt;html&gt;</literal>.\n    </para>\n    <para>\n      <emphasis role=\"strikethrough\">This is\n      <emphasis>strikeout</emphasis>.</emphasis>\n    </para>\n    <para>\n      Superscripts: a<superscript>bc</superscript>d\n      a<superscript><emphasis>hello</emphasis></superscript>\n      a<superscript>hello there</superscript>.\n    </para>\n    <para>\n      Subscripts: H<subscript>2</subscript>O, H<subscript>23</subscript>O,\n      H<subscript>many of them</subscript>O.\n    </para>\n    <para>\n      These should not be superscripts or subscripts, because of the unescaped\n      spaces: a^b c^d, a~b c~d.\n    </para>\n  </section>\n  <section xml:id=\"smart-quotes-ellipses-dashes\">\n    <title>Smart quotes, ellipses, dashes</title>\n    <para>\n      <quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my\n      name.</quote>\n    </para>\n    <para>\n      <quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are letters.\n    </para>\n    <para>\n      <quote>Oak,</quote> <quote>elm,</quote> and <quote>beech</quote> are names\n      of trees. So is <quote>pine.</quote>\n    </para>\n    <para>\n      <quote>He said, <quote>I want to go.</quote></quote> Were you alive in the\n      70’s?\n    </para>\n    <para>\n      Here is some quoted <quote><literal>code</literal></quote> and a\n      <quote><link xlink:href=\"http://example.com/?foo=1&amp;bar=2\">quoted\n      link</link></quote>.\n    </para>\n    <para>\n      Some dashes: one—two — three—four — five.\n    </para>\n    <para>\n      Dashes between numbers: 5–7, 255–66, 1987–1999.\n    </para>\n    <para>\n      Ellipses…and…and….\n    </para>\n  </section>\n  <section xml:id=\"latex\">\n    <title>LaTeX</title>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          2 + 2 = 4\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <emphasis>x</emphasis> ∈ <emphasis>y</emphasis>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <emphasis>α</emphasis> ∧ <emphasis>ω</emphasis>\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          223\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          <emphasis>p</emphasis>-Tree\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Here’s some display math:\n          $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Here’s one that has a line break in it:\n          <emphasis>α</emphasis> + <emphasis>ω</emphasis> × <emphasis>x</emphasis><superscript>2</superscript>.\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      These shouldn’t be math:\n    </para>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n          To get the famous equation, write <literal>$e = mc^2$</literal>.\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          $22,000 is a <emphasis>lot</emphasis> of money. So is $34,000. (It\n          worked if <quote>lot</quote> is emphasized.)\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Shoes ($20) and socks ($5).\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          Escaped <literal>$</literal>: $73 <emphasis>this should be\n          emphasized</emphasis> 23$.\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      Here’s a LaTeX table:\n    </para>\n  </section>\n  <section xml:id=\"special-characters\">\n    <title>Special Characters</title>\n    <para>\n      Here is some unicode:\n    </para>\n    <itemizedlist spacing=\"compact\">\n      <listitem>\n        <para>\n          I hat: Î\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          o umlaut: ö\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          section: §\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          set membership: ∈\n        </para>\n      </listitem>\n      <listitem>\n        <para>\n          copyright: ©\n        </para>\n      </listitem>\n    </itemizedlist>\n    <para>\n      AT&amp;T has an ampersand in their name.\n    </para>\n    <para>\n      AT&amp;T is another way to write it.\n    </para>\n    <para>\n      This &amp; that.\n    </para>\n    <para>\n      4 &lt; 5.\n    </para>\n    <para>\n      6 &gt; 5.\n    </para>\n    <para>\n      Backslash: \\\n    </para>\n    <para>\n      Backtick: `\n    </para>\n    <para>\n      Asterisk: *\n    </para>\n    <para>\n      Underscore: _\n    </para>\n    <para>\n      Left brace: {\n    </para>\n    <para>\n      Right brace: }\n    </para>\n    <para>\n      Left bracket: [\n    </para>\n    <para>\n      Right bracket: ]\n    </para>\n    <para>\n      Left paren: (\n    </para>\n    <para>\n      Right paren: )\n    </para>\n    <para>\n      Greater-than: &gt;\n    </para>\n    <para>\n      Hash: #\n    </para>\n    <para>\n      Period: .\n    </para>\n    <para>\n      Bang: !\n    </para>\n    <para>\n      Plus: +\n    </para>\n    <para>\n      Minus: -\n    </para>\n  </section>\n  <section xml:id=\"links\">\n    <title>Links</title>\n    <section xml:id=\"explicit\">\n      <title>Explicit</title>\n      <para>\n        Just a <link xlink:href=\"/url/\">URL</link>.\n      </para>\n      <para>\n        <link xlink:href=\"/url/\">URL and title</link>.\n      </para>\n      <para>\n        <link xlink:href=\"/url/\">URL and title</link>.\n      </para>\n      <para>\n        <link xlink:href=\"/url/\">URL and title</link>.\n      </para>\n      <para>\n        <link xlink:href=\"/url/\">URL and title</link>\n      </para>\n      <para>\n        <link xlink:href=\"/url/\">URL and title</link>\n      </para>\n      <para>\n        <link xlink:href=\"/url/with_underscore\">with_underscore</link>\n      </para>\n      <para>\n        Email link (<email>nobody@nowhere.net</email>)\n      </para>\n      <para>\n        <link xlink:href=\"\">Empty</link>.\n      </para>\n    </section>\n    <section xml:id=\"reference\">\n      <title>Reference</title>\n      <para>\n        Foo <link xlink:href=\"/url/\">bar</link>.\n      </para>\n      <para>\n        With <link xlink:href=\"/url/\">embedded [brackets]</link>.\n      </para>\n      <para>\n        <link xlink:href=\"/url/\">b</link> by itself should be a link.\n      </para>\n      <para>\n        Indented <link xlink:href=\"/url\">once</link>.\n      </para>\n      <para>\n        Indented <link xlink:href=\"/url\">twice</link>.\n      </para>\n      <para>\n        Indented <link xlink:href=\"/url\">thrice</link>.\n      </para>\n      <para>\n        This should [not][] be a link.\n      </para>\n      <programlisting>\n[not]: /url\n</programlisting>\n      <para>\n        Foo <link xlink:href=\"/url/\">bar</link>.\n      </para>\n      <para>\n        Foo <link xlink:href=\"/url/\">biz</link>.\n      </para>\n    </section>\n    <section xml:id=\"with-ampersands\">\n      <title>With ampersands</title>\n      <para>\n        Here’s a <link xlink:href=\"http://example.com/?foo=1&amp;bar=2\">link\n        with an ampersand in the URL</link>.\n      </para>\n      <para>\n        Here’s a link with an amersand in the link text:\n        <link xlink:href=\"http://att.com/\">AT&amp;T</link>.\n      </para>\n      <para>\n        Here’s an <link xlink:href=\"/script?foo=1&amp;bar=2\">inline link</link>.\n      </para>\n      <para>\n        Here’s an <link xlink:href=\"/script?foo=1&amp;bar=2\">inline link in\n        pointy braces</link>.\n      </para>\n    </section>\n    <section xml:id=\"autolinks\">\n      <title>Autolinks</title>\n      <para>\n        With an ampersand:\n        <link xlink:href=\"http://example.com/?foo=1&amp;bar=2\" role=\"uri\">http://example.com/?foo=1&amp;bar=2</link>\n      </para>\n      <itemizedlist spacing=\"compact\">\n        <listitem>\n          <para>\n            In a list?\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            <link xlink:href=\"http://example.com/\" role=\"uri\">http://example.com/</link>\n          </para>\n        </listitem>\n        <listitem>\n          <para>\n            It should.\n          </para>\n        </listitem>\n      </itemizedlist>\n      <para>\n        An e-mail address: <email>nobody@nowhere.net</email>\n      </para>\n      <blockquote>\n        <para>\n          Blockquoted:\n          <link xlink:href=\"http://example.com/\" role=\"uri\">http://example.com/</link>\n        </para>\n      </blockquote>\n      <para>\n        Auto-links should not occur here:\n        <literal>&lt;http://example.com/&gt;</literal>\n      </para>\n      <programlisting>\nor here: &lt;http://example.com/&gt;\n</programlisting>\n    </section>\n  </section>\n  <section xml:id=\"images\">\n    <title>Images</title>\n    <para>\n      From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):\n    </para>\n    <figure>\n      <title>lalune</title>\n      <mediaobject>\n        <imageobject>\n          <imagedata fileref=\"lalune.jpg\" />\n        </imageobject>\n        <textobject><phrase>lalune</phrase></textobject>\n      </mediaobject>\n    </figure>\n    <para>\n      Here is a movie <inlinemediaobject>\n        <imageobject>\n          <imagedata fileref=\"movie.jpg\" />\n        </imageobject>\n        <textobject>\n          <phrase>movie</phrase>\n        </textobject>\n      </inlinemediaobject> icon.\n    </para>\n  </section>\n  <section xml:id=\"footnotes\">\n    <title>Footnotes</title>\n    <para>\n      Here is a footnote reference,<footnote>\n        <para>\n          Here is the footnote. It can go anywhere after the footnote reference.\n          It need not be placed at the end of the document.\n        </para>\n      </footnote> and another.<footnote>\n        <para>\n          Here’s the long note. This one contains multiple blocks.\n        </para>\n        <para>\n          Subsequent blocks are indented to show that they belong to the\n          footnote (as with list items).\n        </para>\n        <programlisting>\n  { &lt;code&gt; }\n</programlisting>\n        <para>\n          If you want, you can indent every line, but you can also be lazy and\n          just indent the first line of each block.\n        </para>\n      </footnote> This should <emphasis>not</emphasis> be a footnote reference,\n      because it contains a space.[^my note] Here is an inline note.<footnote>\n        <para>\n          This is <emphasis>easier</emphasis> to type. Inline notes may contain\n          <link xlink:href=\"http://google.com\">links</link> and\n          <literal>]</literal> verbatim characters, as well as [bracketed text].\n        </para>\n      </footnote>\n    </para>\n    <blockquote>\n      <para>\n        Notes can go in quotes.<footnote>\n          <para>\n            In quote.\n          </para>\n        </footnote>\n      </para>\n    </blockquote>\n    <orderedlist numeration=\"arabic\" spacing=\"compact\">\n      <listitem>\n        <para>\n          And in list items.<footnote>\n            <para>\n              In list.\n            </para>\n          </footnote>\n        </para>\n      </listitem>\n    </orderedlist>\n    <para>\n      This paragraph should not be part of the note, as it is not indented.\n    </para>\n  </section>\n</article>\n"
  },
  {
    "path": "test/writer.dokuwiki",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.\n\n\n----\n\n====== Headers ======\n\n===== Level 2 with an embedded link =====\n\n==== Level 3 with emphasis ====\n\n=== Level 4 ===\n\n== Level 5 ==\n\n====== Level 1 ======\n\n===== Level 2 with emphasis =====\n\n==== Level 3 ====\n\nwith no blank line\n\n===== Level 2 =====\n\nwith no blank line\n\n\n----\n\n====== Paragraphs ======\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\\\\\nhere.\n\n\n----\n\n====== Block Quotes ======\n\nE-mail style:\n\n> This is a block quote. It is pretty short.\n\n> Code in a block quote:\n\n> <code>\nsub status {\n    print \"working\";\n}\n</code>\n\n> A list:\n\n>   - item one\n>   - item two\n\n> Nested block quotes:\n\n>> nested\n\n>> nested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n\n----\n\n====== Code Blocks ======\n\nCode:\n\n<code>\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n</code>\n\nAnd:\n\n<code>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n</code>\n\n\n----\n\n====== Lists ======\n\n===== Unordered =====\n\nAsterisks tight:\n\n  * asterisk 1\n  * asterisk 2\n  * asterisk 3\n\nAsterisks loose:\n\n  * asterisk 1\n  * asterisk 2\n  * asterisk 3\n\nPluses tight:\n\n  * Plus 1\n  * Plus 2\n  * Plus 3\n\nPluses loose:\n\n  * Plus 1\n  * Plus 2\n  * Plus 3\n\nMinuses tight:\n\n  * Minus 1\n  * Minus 2\n  * Minus 3\n\nMinuses loose:\n\n  * Minus 1\n  * Minus 2\n  * Minus 3\n\n===== Ordered =====\n\nTight:\n\n  - First\n  - Second\n  - Third\n\nand:\n\n  - One\n  - Two\n  - Three\n\nLoose using tabs:\n\n  - First\n  - Second\n  - Third\n\nand using spaces:\n\n  - One\n  - Two\n  - Three\n\nMultiple paragraphs:\n\n  - <WRAP>\nItem 1, graf one.\nItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n</WRAP>\n  - Item 2.\n  - Item 3.\n\n===== Nested =====\n\n  * Tab\n    * Tab\n      * Tab\n\nHere’s another:\n\n  - First\n  - Second:\n    * Fee\n    * Fie\n    * Foe\n  - Third\n\nSame thing but with paragraphs:\n\n  - First\n  - Second:\n    * Fee\n    * Fie\n    * Foe\n  - Third\n\n===== Tabs and spaces =====\n\n  * this is a list item indented with tabs\n  * this is a list item indented with spaces\n    * this is an example list item indented with tabs\n    * this is an example list item indented with spaces\n\n===== Fancy list markers =====\n\n  - begins with 2\n  - <WRAP>\nand now 3\nwith a continuation\n    - sublist with roman numerals, starting with 4\n    - more items\n      - a subsublist\n      - a subsublist\n</WRAP>\n\nNesting:\n\n  - <WRAP>\nUpper Alpha\n    - <WRAP>\nUpper Roman.\n      - <WRAP>\nDecimal start with 6\n        - Lower alpha with paren\n</WRAP>\n</WRAP>\n</WRAP>\n\nAutonumbering:\n\n  - Autonumber.\n  - More.\n    - Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n\n----\n\n====== Definition Lists ======\n\nTight using spaces:\n\n  * **apple** red fruit\n  * **orange** orange fruit\n  * **banana** yellow fruit\n\nTight using tabs:\n\n  * **apple** red fruit\n  * **orange** orange fruit\n  * **banana** yellow fruit\n\nLoose:\n\n  * **apple** red fruit\n  * **orange** orange fruit\n  * **banana** yellow fruit\n\nMultiple blocks with italics:\n\n  * **//apple//** <WRAP>\nred fruit\ncontains seeds, crisp, pleasant to taste\n</WRAP>\n  * **//orange//** <WRAP>\norange fruit\n<code>\n{ orange code block }\n</code>\n\n> orange block quote\n</WRAP>\n\nMultiple definitions, tight:\n\n  * **apple** red fruit; computer\n  * **orange** orange fruit; bank\n\nMultiple definitions, loose:\n\n  * **apple** red fruit; computer\n  * **orange** orange fruit; bank\n\nBlank line after term, indented marker, alternate markers:\n\n  * **apple** red fruit; computer\n  * **orange** orange fruit\n    - sublist\n    - sublist\n\n====== HTML Blocks ======\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\n\n\nbar\n\n\nInterpreted markdown in a table:\n\n\nThis is //emphasized//\n\nAnd this is **strong**\n\nHere’s a simple block:\n\nfoo\n\n\nThis should be a code block, though:\n\n<code>\n<div>\n    foo\n</div>\n</code>\n\nAs should this:\n\n<code>\n<div>foo</div>\n</code>\n\nNow, nested:\n\nfoo\n\n\n\nThis should just be an HTML comment:\n\n\nMultiline:\n\n\nCode block:\n\n<code>\n<!-- Comment -->\n</code>\n\nJust plain comment, with trailing spaces on the line:\n\n\nCode:\n\n<code>\n<hr />\n</code>\n\nHr’s:\n\n\n\n----\n\n====== Inline Markup ======\n\nThis is //emphasized//, and so //is this//.\n\nThis is **strong**, and so **is this**.\n\nAn //[[url|emphasized link]]//.\n\n**//This is strong and em.//**\n\nSo is **//this//** word.\n\n**//This is strong and em.//**\n\nSo is **//this//** word.\n\nThis is code: ''%%>%%'', ''%%$%%'', ''%%\\%%'', ''%%\\$%%'', ''%%<html>%%''.\n\n<del>This is //strikeout//.</del>\n\nSuperscripts: a<sup>bc</sup>d a<sup>//hello//</sup> a<sup>hello there</sup>.\n\nSubscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\n\n\n----\n\n====== Smart quotes, ellipses, dashes ======\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘''%%code%%''’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n\n----\n\n====== LaTeX ======\n\n  * \n  * $2+2=4$\n  * $x \\in y$\n  * $\\alpha \\wedge \\omega$\n  * $223$\n  * $p$-Tree\n  * Here’s some display math: $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n  * Here’s one that has a line break in it: $\\alpha + \\omega \\times x^2$.\n\nThese shouldn’t be math:\n\n  * To get the famous equation, write ''%%$e = mc^2$%%''.\n  * $22,000 is a //lot// of money. So is $34,000. (It worked if “lot” is emphasized.)\n  * Shoes ($20) and socks ($5).\n  * Escaped ''%%$%%'': $73 //this should be emphasized// 23$.\n\nHere’s a LaTeX table:\n\n\n\n----\n\n====== Special Characters ======\n\nHere is some unicode:\n\n  * I hat: Î\n  * o umlaut: ö\n  * section: §\n  * set membership: ∈\n  * copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n\n----\n\n====== Links ======\n\n===== Explicit =====\n\nJust a [[url/|URL]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]]\n\n[[url/|URL and title]]\n\n[[url/with_underscore|with_underscore]]\n\n[[mailto:nobody@nowhere.net|Email link]]\n\n[[|Empty]].\n\n===== Reference =====\n\nFoo [[url/|bar]].\n\nWith [[url/|embedded [brackets]]].\n\n[[url/|b]] by itself should be a link.\n\nIndented [[url|once]].\n\nIndented [[url|twice]].\n\nIndented [[url|thrice]].\n\nThis should [not][] be a link.\n\n<code>\n[not]: /url\n</code>\n\nFoo [[url/|bar]].\n\nFoo [[url/|biz]].\n\n===== With ampersands =====\n\nHere’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].\n\nHere’s a link with an amersand in the link text: [[http://att.com/|AT&T]].\n\nHere’s an [[script?foo=1&bar=2|inline link]].\n\nHere’s an [[script?foo=1&bar=2|inline link in pointy braces]].\n\n===== Autolinks =====\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n  * In a list?\n  * http://example.com/\n  * It should.\n\nAn e-mail address: <nobody@nowhere.net>\n\n> Blockquoted: http://example.com/\n\nAuto-links should not occur here: ''%%<http://example.com/>%%''\n\n<code>\nor here: <http://example.com/>\n</code>\n\n\n----\n\n====== Images ======\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n{{lalune.jpg|Voyage dans la Lune}}\nlalune\n\n\nHere is a movie {{movie.jpg|movie}} icon.\n\n\n----\n\n====== Footnotes ======\n\nHere is a footnote reference,((Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\n)) and another.((Here’s the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with list items).\n\n<code>\n  { <code> }\n</code>\n\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.\n)) This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.((This is //easier// to type. Inline notes may contain [[http://google.com|links]] and ''%%]%%'' verbatim characters, as well as [bracketed text].\n))\n\n> Notes can go in quotes.((In quote.\n))\n\n  - And in list items.((In list.))\n\nThis paragraph should not be part of the note, as it is not indented.\n"
  },
  {
    "path": "test/writer.fb2",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FictionBook xmlns=\"http://www.gribuser.ru/xml/fictionbook/2.0\" xmlns:l=\"http://www.w3.org/1999/xlink\">\n<description>\n<title-info>\n<genre>unrecognised</genre>\n<author>\n<first-name>John</first-name>\n<last-name>MacFarlane</last-name>\n</author>\n<author>\n<nickname>Anonymous</nickname>\n</author>\n<book-title>Pandoc Test Suite</book-title>\n<date>July 17, 2006</date>\n</title-info>\n<document-info>\n<program-used>pandoc</program-used>\n</document-info>\n</description>\n<body>\n<title>\n<p>Pandoc Test Suite</p>\n</title>\n<section>\n<p>This is a set of tests for pandoc. Most of them are adapted from\nJohn Gruber’s markdown test suite.</p>\n<empty-line />\n</section>\n<section id=\"headers\">\n<title>\n<p>Headers</p>\n</title>\n<section id=\"level-2-with-an-embedded-link\">\n<title>\n<p>Level 2 with an <a l:href=\"/url\">embedded link</a>\n</p>\n</title>\n<section id=\"level-3-with-emphasis\">\n<title>\n<p>Level 3 with <emphasis>emphasis</emphasis>\n</p>\n</title>\n<section id=\"level-4\">\n<title>\n<p>Level 4</p>\n</title>\n<section id=\"level-5\">\n<title>\n<p>Level 5</p>\n</title>\n</section>\n</section>\n</section>\n</section>\n</section>\n<section id=\"level-1\">\n<title>\n<p>Level 1</p>\n</title>\n<section id=\"level-2-with-emphasis\">\n<title>\n<p>Level 2 with <emphasis>emphasis</emphasis>\n</p>\n</title>\n<section id=\"level-3\">\n<title>\n<p>Level 3</p>\n</title>\n<p>with no blank line</p>\n</section>\n</section>\n<section id=\"level-2\">\n<title>\n<p>Level 2</p>\n</title>\n<p>with no blank line</p>\n<empty-line />\n</section>\n</section>\n<section id=\"paragraphs\">\n<title>\n<p>Paragraphs</p>\n</title>\n<p>Here’s a regular paragraph.</p>\n<p>In Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.</p>\n<p>Here’s one with a bullet.\n* criminey.</p>\n<p>There should be a hard line break\nhere.</p>\n<empty-line />\n</section>\n<section id=\"block-quotes\">\n<title>\n<p>Block Quotes</p>\n</title>\n<p>E-mail style:</p>\n<cite>\n<p>This is a block quote.\nIt is pretty short.</p>\n</cite>\n<cite>\n<p>Code in a block quote:</p>\n<empty-line />\n<p>\n<code>sub status {</code>\n</p>\n<p>\n<code>    print &quot;working&quot;;</code>\n</p>\n<p>\n<code>}</code>\n</p>\n<empty-line />\n<p>A list:</p>\n<p>1. item one</p>\n<p>2. item two</p>\n<p>Nested block quotes:</p>\n<cite>\n<p>nested</p>\n</cite>\n<cite>\n<p>nested</p>\n</cite>\n</cite>\n<p>This should not be a block quote: 2\n&gt; 1.</p>\n<p>And a following paragraph.</p>\n<empty-line />\n</section>\n<section id=\"code-blocks\">\n<title>\n<p>Code Blocks</p>\n</title>\n<p>Code:</p>\n<empty-line />\n<p>\n<code>---- (should be four hyphens)</code>\n</p>\n<p>\n<code>\n</code>\n</p>\n<p>\n<code>sub status {</code>\n</p>\n<p>\n<code>    print &quot;working&quot;;</code>\n</p>\n<p>\n<code>}</code>\n</p>\n<p>\n<code>\n</code>\n</p>\n<p>\n<code>this code block is indented by one tab</code>\n</p>\n<empty-line />\n<p>And:</p>\n<empty-line />\n<p>\n<code>    this code block is indented by two tabs</code>\n</p>\n<p>\n<code>\n</code>\n</p>\n<p>\n<code>These should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</code>\n</p>\n<empty-line />\n<empty-line />\n</section>\n<section id=\"lists\">\n<title>\n<p>Lists</p>\n</title>\n<section id=\"unordered\">\n<title>\n<p>Unordered</p>\n</title>\n<p>Asterisks tight:</p>\n<p>• asterisk 1</p>\n<p>• asterisk 2</p>\n<p>• asterisk 3</p>\n<p>Asterisks loose:</p>\n<p>• asterisk 1</p>\n<empty-line />\n<p>• asterisk 2</p>\n<empty-line />\n<p>• asterisk 3</p>\n<empty-line />\n<p>Pluses tight:</p>\n<p>• Plus 1</p>\n<p>• Plus 2</p>\n<p>• Plus 3</p>\n<p>Pluses loose:</p>\n<p>• Plus 1</p>\n<empty-line />\n<p>• Plus 2</p>\n<empty-line />\n<p>• Plus 3</p>\n<empty-line />\n<p>Minuses tight:</p>\n<p>• Minus 1</p>\n<p>• Minus 2</p>\n<p>• Minus 3</p>\n<p>Minuses loose:</p>\n<p>• Minus 1</p>\n<empty-line />\n<p>• Minus 2</p>\n<empty-line />\n<p>• Minus 3</p>\n<empty-line />\n</section>\n<section id=\"ordered\">\n<title>\n<p>Ordered</p>\n</title>\n<p>Tight:</p>\n<p>1. First</p>\n<p>2. Second</p>\n<p>3. Third</p>\n<p>and:</p>\n<p>1. One</p>\n<p>2. Two</p>\n<p>3. Three</p>\n<p>Loose using tabs:</p>\n<p>1. First</p>\n<empty-line />\n<p>2. Second</p>\n<empty-line />\n<p>3. Third</p>\n<empty-line />\n<p>and using spaces:</p>\n<p>1. One</p>\n<empty-line />\n<p>2. Two</p>\n<empty-line />\n<p>3. Three</p>\n<empty-line />\n<p>Multiple paragraphs:</p>\n<p>1. Item 1, graf one.</p>\n<empty-line />\n<p>   Item 1. graf two. The quick brown fox jumped over the lazy dog’s\nback.</p>\n<empty-line />\n<p>2. Item 2.</p>\n<empty-line />\n<p>3. Item 3.</p>\n<empty-line />\n</section>\n<section id=\"nested\">\n<title>\n<p>Nested</p>\n</title>\n<p>• Tab</p>\n<p>• • Tab</p>\n<p>• • • Tab</p>\n<p>Here’s another:</p>\n<p>1. First</p>\n<p>2. Second:</p>\n<p>2. • Fee</p>\n<p>2. • Fie</p>\n<p>2. • Foe</p>\n<p>3. Third</p>\n<p>Same thing but with paragraphs:</p>\n<p>1. First</p>\n<empty-line />\n<p>2. Second:</p>\n<empty-line />\n<p>2. • Fee</p>\n<p>2. • Fie</p>\n<p>2. • Foe</p>\n<p>3. Third</p>\n<empty-line />\n</section>\n<section id=\"tabs-and-spaces\">\n<title>\n<p>Tabs and spaces</p>\n</title>\n<p>• this is a list item\nindented with tabs</p>\n<empty-line />\n<p>• this is a list item\nindented with spaces</p>\n<empty-line />\n<p>• • this is an example list item\nindented with tabs</p>\n<empty-line />\n<p>• • this is an example list item\nindented with spaces</p>\n<empty-line />\n</section>\n<section id=\"fancy-list-markers\">\n<title>\n<p>Fancy list markers</p>\n</title>\n<p>(2) begins with 2</p>\n<empty-line />\n<p>(3) and now 3</p>\n<empty-line />\n<p>    with a continuation</p>\n<empty-line />\n<p>(3) iv. sublist with roman numerals,\nstarting with 4</p>\n<p>(3) v. more items</p>\n<p>(3) v. (A) a subsublist</p>\n<p>(3) v. (B) a subsublist</p>\n<p>Nesting:</p>\n<p>A. Upper Alpha</p>\n<p>A. I. Upper Roman.</p>\n<p>A. I. (6) Decimal start with 6</p>\n<p>A. I. (6) c) Lower alpha with paren</p>\n<p>Autonumbering:</p>\n<p>1. Autonumber.</p>\n<p>2. More.</p>\n<p>2. 1. Nested.</p>\n<p>Should not be a list item:</p>\n<p>M.A. 2007</p>\n<p>B. Williams</p>\n<empty-line />\n</section>\n</section>\n<section id=\"definition-lists\">\n<title>\n<p>Definition Lists</p>\n</title>\n<p>Tight using spaces:</p>\n<p>\n<strong>apple</strong>\n</p>\n<p>    red fruit</p>\n<p>\n<strong>orange</strong>\n</p>\n<p>    orange fruit</p>\n<p>\n<strong>banana</strong>\n</p>\n<p>    yellow fruit</p>\n<p>Tight using tabs:</p>\n<p>\n<strong>apple</strong>\n</p>\n<p>    red fruit</p>\n<p>\n<strong>orange</strong>\n</p>\n<p>    orange fruit</p>\n<p>\n<strong>banana</strong>\n</p>\n<p>    yellow fruit</p>\n<p>Loose:</p>\n<p>\n<strong>apple</strong>\n</p>\n<p>    red fruit</p>\n<empty-line />\n<p>\n<strong>orange</strong>\n</p>\n<p>    orange fruit</p>\n<empty-line />\n<p>\n<strong>banana</strong>\n</p>\n<p>    yellow fruit</p>\n<empty-line />\n<p>Multiple blocks with italics:</p>\n<p>\n<strong>\n<emphasis>apple</emphasis>\n</strong>\n</p>\n<p>    red fruit</p>\n<empty-line />\n<p>    contains seeds,\ncrisp, pleasant to taste</p>\n<empty-line />\n<p>\n<strong>\n<emphasis>orange</emphasis>\n</strong>\n</p>\n<p>    orange fruit</p>\n<empty-line />\n<empty-line />\n<p>\n<code>    { orange code block }</code>\n</p>\n<empty-line />\n<cite>\n<p>    orange block quote</p>\n</cite>\n<p>Multiple definitions, tight:</p>\n<p>\n<strong>apple</strong>\n</p>\n<p>    red fruit</p>\n<p>    computer</p>\n<p>\n<strong>orange</strong>\n</p>\n<p>    orange fruit</p>\n<p>    bank</p>\n<p>Multiple definitions, loose:</p>\n<p>\n<strong>apple</strong>\n</p>\n<p>    red fruit</p>\n<empty-line />\n<p>    computer</p>\n<empty-line />\n<p>\n<strong>orange</strong>\n</p>\n<p>    orange fruit</p>\n<empty-line />\n<p>    bank</p>\n<empty-line />\n<p>Blank line after term, indented marker, alternate markers:</p>\n<p>\n<strong>apple</strong>\n</p>\n<p>    red fruit</p>\n<empty-line />\n<p>    computer</p>\n<empty-line />\n<p>\n<strong>orange</strong>\n</p>\n<p>    orange fruit</p>\n<empty-line />\n<p>1. sublist</p>\n<p>2. sublist</p>\n</section>\n<section id=\"html-blocks\">\n<title>\n<p>HTML Blocks</p>\n</title>\n<p>Simple block on one line:</p>foo<p>And nested without indentation:</p>\n<p>foo</p>bar<p>Interpreted markdown in a table:</p>This is <emphasis>emphasized</emphasis>And this is <strong>strong</strong>\n<p>Here’s a simple block:</p>\n<p>foo</p>\n<p>This should be a code block, though:</p>\n<empty-line />\n<p>\n<code>&lt;div&gt;</code>\n</p>\n<p>\n<code>    foo</code>\n</p>\n<p>\n<code>&lt;/div&gt;</code>\n</p>\n<empty-line />\n<p>As should this:</p>\n<empty-line />\n<p>\n<code>&lt;div&gt;foo&lt;/div&gt;</code>\n</p>\n<empty-line />\n<p>Now, nested:</p>foo<p>This should just be an HTML comment:</p>\n<p>Multiline:</p>\n<p>Code block:</p>\n<empty-line />\n<p>\n<code>&lt;!-- Comment --&gt;</code>\n</p>\n<empty-line />\n<p>Just plain comment, with trailing spaces on the line:</p>\n<p>Code:</p>\n<empty-line />\n<p>\n<code>&lt;hr /&gt;</code>\n</p>\n<empty-line />\n<p>Hr’s:</p>\n<empty-line />\n</section>\n<section id=\"inline-markup\">\n<title>\n<p>Inline Markup</p>\n</title>\n<p>This is <emphasis>emphasized</emphasis>, and so <emphasis>is this</emphasis>.</p>\n<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>\n<p>An <emphasis>\n<a l:href=\"/url\">emphasized link</a>\n</emphasis>.</p>\n<p>\n<strong>\n<emphasis>This is strong and em.</emphasis>\n</strong>\n</p>\n<p>So is <strong>\n<emphasis>this</emphasis>\n</strong> word.</p>\n<p>\n<strong>\n<emphasis>This is strong and em.</emphasis>\n</strong>\n</p>\n<p>So is <strong>\n<emphasis>this</emphasis>\n</strong> word.</p>\n<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\\</code>, <code>\\$</code>, <code>&lt;html&gt;</code>.</p>\n<p>\n<strikethrough>This is <emphasis>strikeout</emphasis>.</strikethrough>\n</p>\n<p>Superscripts: a<sup>bc</sup>d a<sup>\n<emphasis>hello</emphasis>\n</sup> a<sup>hello there</sup>.</p>\n<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n<p>These should not be superscripts or subscripts,\nbecause of the unescaped spaces: a^b c^d, a~b c~d.</p>\n<empty-line />\n</section>\n<section id=\"smart-quotes-ellipses-dashes\">\n<title>\n<p>Smart quotes, ellipses, dashes</p>\n</title>\n<p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>\n<p>‘A’, ‘B’, and ‘C’ are letters.</p>\n<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees.\nSo is ‘pine.’</p>\n<p>‘He said, “I want to go.”’ Were you alive in the\n70’s?</p>\n<p>Here is some quoted ‘<code>code</code>’ and a “<a l:href=\"http://example.com/?foo=1&amp;bar=2\">quoted link</a>”.</p>\n<p>Some dashes: one—two — three—four — five.</p>\n<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n<p>Ellipses…and…and….</p>\n<empty-line />\n</section>\n<section id=\"latex\">\n<title>\n<p>LaTeX</p>\n</title>\n<p>• </p>\n<p>• <code>2+2=4</code>\n</p>\n<p>• <code>x \\in y</code>\n</p>\n<p>• <code>\\alpha \\wedge \\omega</code>\n</p>\n<p>• <code>223</code>\n</p>\n<p>• <code>p</code>-Tree</p>\n<p>• Here’s some display math:\n<code>\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}</code>\n</p>\n<p>• Here’s one that has a line break in it: <code>\\alpha + \\omega \\times x^2</code>.</p>\n<p>These shouldn’t be math:</p>\n<p>• To get the famous equation, write <code>$e = mc^2$</code>.</p>\n<p>• $22,000 is a <emphasis>lot</emphasis> of money. So is $34,000.\n(It worked if “lot” is emphasized.)</p>\n<p>• Shoes ($20) and socks ($5).</p>\n<p>• Escaped <code>$</code>: $73 <emphasis>this should be emphasized</emphasis> 23$.</p>\n<p>Here’s a LaTeX table:</p>\n<empty-line />\n</section>\n<section id=\"special-characters\">\n<title>\n<p>Special Characters</p>\n</title>\n<p>Here is some unicode:</p>\n<p>• I hat: Î</p>\n<p>• o umlaut: ö</p>\n<p>• section: §</p>\n<p>• set membership: ∈</p>\n<p>• copyright: ©</p>\n<p>AT&amp;T has an ampersand in their name.</p>\n<p>AT&amp;T is another way to write it.</p>\n<p>This &amp; that.</p>\n<p>4 &lt; 5.</p>\n<p>6 &gt; 5.</p>\n<p>Backslash: \\</p>\n<p>Backtick: `</p>\n<p>Asterisk: *</p>\n<p>Underscore: _</p>\n<p>Left brace: {</p>\n<p>Right brace: }</p>\n<p>Left bracket: [</p>\n<p>Right bracket: ]</p>\n<p>Left paren: (</p>\n<p>Right paren: )</p>\n<p>Greater-than: &gt;</p>\n<p>Hash: #</p>\n<p>Period: .</p>\n<p>Bang: !</p>\n<p>Plus: +</p>\n<p>Minus: -</p>\n<empty-line />\n</section>\n<section id=\"links\">\n<title>\n<p>Links</p>\n</title>\n<section id=\"explicit\">\n<title>\n<p>Explicit</p>\n</title>\n<p>Just a <a l:href=\"/url/\">URL</a>.</p>\n<p>\n<a l:href=\"/url/\">URL and title</a>.</p>\n<p>\n<a l:href=\"/url/\">URL and title</a>.</p>\n<p>\n<a l:href=\"/url/\">URL and title</a>.</p>\n<p>\n<a l:href=\"/url/\">URL and title</a>\n</p>\n<p>\n<a l:href=\"/url/\">URL and title</a>\n</p>\n<p>\n<a l:href=\"/url/with_underscore\">with_underscore</a>\n</p>\n<p>\n<a l:href=\"mailto:nobody@nowhere.net\">Email link</a>\n</p>\n<p>\n<a l:href=\"\">Empty</a>.</p>\n</section>\n<section id=\"reference\">\n<title>\n<p>Reference</p>\n</title>\n<p>Foo <a l:href=\"/url/\">bar</a>.</p>\n<p>With <a l:href=\"/url/\">embedded [brackets]</a>.</p>\n<p>\n<a l:href=\"/url/\">b</a> by itself should be a link.</p>\n<p>Indented <a l:href=\"/url\">once</a>.</p>\n<p>Indented <a l:href=\"/url\">twice</a>.</p>\n<p>Indented <a l:href=\"/url\">thrice</a>.</p>\n<p>This should [not][] be a link.</p>\n<empty-line />\n<p>\n<code>[not]: /url</code>\n</p>\n<empty-line />\n<p>Foo <a l:href=\"/url/\">bar</a>.</p>\n<p>Foo <a l:href=\"/url/\">biz</a>.</p>\n</section>\n<section id=\"with-ampersands\">\n<title>\n<p>With ampersands</p>\n</title>\n<p>Here’s a <a l:href=\"http://example.com/?foo=1&amp;bar=2\">link with an ampersand in the URL</a>.</p>\n<p>Here’s a link with an amersand in the link text: <a l:href=\"http://att.com/\">AT&amp;T</a>.</p>\n<p>Here’s an <a l:href=\"/script?foo=1&amp;bar=2\">inline link</a>.</p>\n<p>Here’s an <a l:href=\"/script?foo=1&amp;bar=2\">inline link in pointy braces</a>.</p>\n</section>\n<section id=\"autolinks\">\n<title>\n<p>Autolinks</p>\n</title>\n<p>With an ampersand: <a l:href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</a>\n</p>\n<p>• In a list?</p>\n<p>• <a l:href=\"http://example.com/\">http://example.com/</a>\n</p>\n<p>• It should.</p>\n<p>An e-mail address: <a l:href=\"mailto:nobody@nowhere.net\">nobody@nowhere.net</a>\n</p>\n<cite>\n<p>Blockquoted: <a l:href=\"http://example.com/\">http://example.com/</a>\n</p>\n</cite>\n<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>\n</p>\n<empty-line />\n<p>\n<code>or here: &lt;http://example.com/&gt;</code>\n</p>\n<empty-line />\n<empty-line />\n</section>\n</section>\n<section id=\"images\">\n<title>\n<p>Images</p>\n</title>\n<p>From “Voyage dans la Lune” by Georges Melies (1902):</p>\n<image l:href=\"#image1\" l:type=\"imageType\" alt=\"lalune\" title=\"Voyage dans la Lune\" />\n<p>Here is a movie <image l:href=\"#image2\" l:type=\"inlineImageType\" alt=\"movie\" /> icon.</p>\n<empty-line />\n</section>\n<section id=\"footnotes\">\n<title>\n<p>Footnotes</p>\n</title>\n<p>Here is a footnote reference,<a l:href=\"#n1\" type=\"note\">[1]</a> and another.<a l:href=\"#n2\" type=\"note\">[2]</a>\nThis should <emphasis>not</emphasis> be a footnote reference, because it\ncontains a space.[^my note] Here is an inline note.<a l:href=\"#n3\" type=\"note\">[3]</a>\n</p>\n<cite>\n<p>Notes can go in quotes.<a l:href=\"#n4\" type=\"note\">[4]</a>\n</p>\n</cite>\n<p>1. And in list items.<a l:href=\"#n5\" type=\"note\">[5]</a>\n</p>\n<p>This paragraph should not be part of the note, as it is not indented.</p>\n</section>\n</body>\n<body name=\"notes\">\n<section id=\"n1\">\n<title>\n<p>1</p>\n</title>\n<p>Here is the footnote. It can go anywhere after the footnote\nreference. It need not be placed at the end of the document.</p>\n</section>\n<section id=\"n2\">\n<title>\n<p>2</p>\n</title>\n<p>Here’s the long note. This one contains multiple\nblocks.</p>\n<p>Subsequent blocks are indented to show that they belong to the\nfootnote (as with list items).</p>\n<empty-line />\n<p>\n<code>  { &lt;code&gt; }</code>\n</p>\n<empty-line />\n<p>If you want, you can indent every line, but you can also be\nlazy and just indent the first line of each block.</p>\n</section>\n<section id=\"n3\">\n<title>\n<p>3</p>\n</title>\n<p>This\nis <emphasis>easier</emphasis> to type. Inline notes may contain\n<a l:href=\"http://google.com\">links</a> and <code>]</code> verbatim characters,\nas well as [bracketed text].</p>\n</section>\n<section id=\"n4\">\n<title>\n<p>4</p>\n</title>\n<p>In quote.</p>\n</section>\n<section id=\"n5\">\n<title>\n<p>5</p>\n</title>\n<p>In list.</p>\n</section>\n</body>\n</FictionBook>\n"
  },
  {
    "path": "test/writer.haddock",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n________________________________________________________________________________\n\n= Headers\n#headers#\n\n== Level 2 with an </url embedded link>\n#level-2-with-an-embedded-link#\n\n=== Level 3 with /emphasis/\n#level-3-with-emphasis#\n\n==== Level 4\n#level-4#\n\n===== Level 5\n#level-5#\n\n= Level 1\n#level-1#\n\n== Level 2 with /emphasis/\n#level-2-with-emphasis#\n\n=== Level 3\n#level-3#\n\nwith no blank line\n\n== Level 2\n#level-2#\n\nwith no blank line\n\n________________________________________________________________________________\n\n= Paragraphs\n#paragraphs#\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n________________________________________________________________________________\n\n= Block Quotes\n#block-quotes#\n\nE-mail style:\n\nThis is a block quote. It is pretty short.\n\nCode in a block quote:\n\n> sub status {\n>     print \"working\";\n> }\n\nA list:\n\n1.  item one\n2.  item two\n\nNested block quotes:\n\nnested\n\nnested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n________________________________________________________________________________\n\n= Code Blocks\n#code-blocks#\n\nCode:\n\n> ---- (should be four hyphens)\n>\n> sub status {\n>     print \"working\";\n> }\n>\n> this code block is indented by one tab\n\nAnd:\n\n>     this code block is indented by two tabs\n>\n> These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\n________________________________________________________________________________\n\n= Lists\n#lists#\n\n== Unordered\n#unordered#\n\nAsterisks tight:\n\n-   asterisk 1\n-   asterisk 2\n-   asterisk 3\n\nAsterisks loose:\n\n-   asterisk 1\n\n-   asterisk 2\n\n-   asterisk 3\n\nPluses tight:\n\n-   Plus 1\n-   Plus 2\n-   Plus 3\n\nPluses loose:\n\n-   Plus 1\n\n-   Plus 2\n\n-   Plus 3\n\nMinuses tight:\n\n-   Minus 1\n-   Minus 2\n-   Minus 3\n\nMinuses loose:\n\n-   Minus 1\n\n-   Minus 2\n\n-   Minus 3\n\n== Ordered\n#ordered#\n\nTight:\n\n1.  First\n2.  Second\n3.  Third\n\nand:\n\n1.  One\n2.  Two\n3.  Three\n\nLoose using tabs:\n\n1.  First\n\n2.  Second\n\n3.  Third\n\nand using spaces:\n\n1.  One\n\n2.  Two\n\n3.  Three\n\nMultiple paragraphs:\n\n1.  Item 1, graf one.\n\n    Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n\n2.  Item 2.\n\n3.  Item 3.\n\n== Nested\n#nested#\n\n-   Tab\n    -   Tab\n        -   Tab\n\nHere’s another:\n\n1.  First\n2.  Second:\n    -   Fee\n    -   Fie\n    -   Foe\n3.  Third\n\nSame thing but with paragraphs:\n\n1.  First\n\n2.  Second:\n\n    -   Fee\n    -   Fie\n    -   Foe\n\n3.  Third\n\n== Tabs and spaces\n#tabs-and-spaces#\n\n-   this is a list item indented with tabs\n\n-   this is a list item indented with spaces\n\n    -   this is an example list item indented with tabs\n\n    -   this is an example list item indented with spaces\n\n== Fancy list markers\n#fancy-list-markers#\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    4.  sublist with roman numerals, starting with 4\n    5.  more items\n        (1) a subsublist\n        (2) a subsublist\n\nNesting:\n\n1.  Upper Alpha\n    1.  Upper Roman.\n        (6) Decimal start with 6\n            3)  Lower alpha with paren\n\nAutonumbering:\n\n1.  Autonumber.\n2.  More.\n    1.  Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n________________________________________________________________________________\n\n= Definition Lists\n#definition-lists#\n\nTight using spaces:\n\n[apple]\n    red fruit\n[orange]\n    orange fruit\n[banana]\n    yellow fruit\n\nTight using tabs:\n\n[apple]\n    red fruit\n[orange]\n    orange fruit\n[banana]\n    yellow fruit\n\nLoose:\n\n[apple]\n    red fruit\n\n[orange]\n    orange fruit\n\n[banana]\n    yellow fruit\n\nMultiple blocks with italics:\n\n[/apple/]\n    red fruit\n\n    contains seeds, crisp, pleasant to taste\n\n[/orange/]\n    orange fruit\n\n    > { orange code block }\n\n    orange block quote\n\nMultiple definitions, tight:\n\n[apple]\n    red fruit\n    computer\n[orange]\n    orange fruit\n    bank\n\nMultiple definitions, loose:\n\n[apple]\n    red fruit\n\n    computer\n\n[orange]\n    orange fruit\n\n    bank\n\nBlank line after term, indented marker, alternate markers:\n\n[apple]\n    red fruit\n\n    computer\n\n[orange]\n    orange fruit\n\n    1.  sublist\n    2.  sublist\n\n= HTML Blocks\n#html-blocks#\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is /emphasized/\nAnd this is __strong__\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n> <div>\n>     foo\n> </div>\n\nAs should this:\n\n> <div>foo</div>\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n> <!-- Comment -->\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n> <hr />\n\nHr’s:\n\n________________________________________________________________________________\n\n= Inline Markup\n#inline-markup#\n\nThis is /emphasized/, and so /is this/.\n\nThis is __strong__, and so __is this__.\n\nAn /</url emphasized link>/.\n\n__/This is strong and em./__\n\nSo is __/this/__ word.\n\n__/This is strong and em./__\n\nSo is __/this/__ word.\n\nThis is code: @>@, @$@, @\\\\@, @\\\\$@, @\\<html>@.\n\n~~This is /strikeout/.~~\n\nSuperscripts: abcd a/hello/ ahello there.\n\nSubscripts: H2O, H23O, Hmany of themO.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n________________________________________________________________________________\n\n= Smart quotes, ellipses, dashes\n#smart-quotes-ellipses-dashes#\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘@code@’ and a\n“<http://example.com/?foo=1&bar=2 quoted link>”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n________________________________________________________________________________\n\n= LaTeX\n#latex#\n\n-   \n-   \\(2+2=4\\)\n-   \\(x \\in y\\)\n-   \\(\\alpha \\wedge \\omega\\)\n-   \\(223\\)\n-   \\(p\\)-Tree\n-   Here’s some display math:\n    \\[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\\]\n-   Here’s one that has a line break in it: \\(\\alpha + \\omega \\times x^2\\).\n\nThese shouldn’t be math:\n\n-   To get the famous equation, write @$e = mc^2$@.\n-   $22,000 is a /lot/ of money. So is $34,000. (It worked if “lot” is\n    emphasized.)\n-   Shoes ($20) and socks ($5).\n-   Escaped @$@: $73 /this should be emphasized/ 23$.\n\nHere’s a LaTeX table:\n\n________________________________________________________________________________\n\n= Special Characters\n#special-characters#\n\nHere is some unicode:\n\n-   I hat: Î\n-   o umlaut: ö\n-   section: §\n-   set membership: ∈\n-   copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 \\< 5.\n\n6 > 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n________________________________________________________________________________\n\n= Links\n#links#\n\n== Explicit\n#explicit#\n\nJust a </url/ URL>.\n\n</url/ URL and title>.\n\n</url/ URL and title>.\n\n</url/ URL and title>.\n\n</url/ URL and title>\n\n</url/ URL and title>\n\n</url/with_underscore with_underscore>\n\n<mailto:nobody@nowhere.net Email link>\n\n< Empty>.\n\n== Reference\n#reference#\n\nFoo </url/ bar>.\n\nWith </url/ embedded [brackets]>.\n\n</url/ b> by itself should be a link.\n\nIndented </url once>.\n\nIndented </url twice>.\n\nIndented </url thrice>.\n\nThis should [not][] be a link.\n\n> [not]: /url\n\nFoo </url/ bar>.\n\nFoo </url/ biz>.\n\n== With ampersands\n#with-ampersands#\n\nHere’s a <http://example.com/?foo=1&bar=2 link with an ampersand in the URL>.\n\nHere’s a link with an amersand in the link text: <http://att.com/ AT&T>.\n\nHere’s an </script?foo=1&bar=2 inline link>.\n\nHere’s an </script?foo=1&bar=2 inline link in pointy braces>.\n\n== Autolinks\n#autolinks#\n\nWith an ampersand: <http://example.com/?foo=1&bar=2>\n\n-   In a list?\n-   <http://example.com/>\n-   It should.\n\nAn e-mail address: <mailto:nobody@nowhere.net nobody\\@nowhere.net>\n\nBlockquoted: <http://example.com/>\n\nAuto-links should not occur here: @\\<http:\\/\\/example.com\\/>@\n\n> or here: <http://example.com/>\n\n________________________________________________________________________________\n\n= Images\n#images#\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n<<lalune.jpg lalune>>\nlalune\n\nHere is a movie <<movie.jpg movie>> icon.\n\n________________________________________________________________________________\n\n= Footnotes\n#footnotes#\n\nHere is a footnote reference,<#notes [1]> and another.<#notes [2]> This should\n/not/ be a footnote reference, because it contains a space.[^my note] Here is an\ninline note.<#notes [3]>\n\nNotes can go in quotes.<#notes [4]>\n\n1.  And in list items.<#notes [5]>\n\nThis paragraph should not be part of the note, as it is not indented.\n\n#notes#\n\n1.  Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.\n\n2.  Here’s the long note. This one contains multiple blocks.\n\n    Subsequent blocks are indented to show that they belong to the footnote (as\n    with list items).\n\n    >   { <code> }\n\n    If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.\n\n3.  This is /easier/ to type. Inline notes may contain <http://google.com links>\n    and @]@ verbatim characters, as well as [bracketed text].\n\n4.  In quote.\n\n5.  In list.\n"
  },
  {
    "path": "test/writer.html4",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"author\" content=\"John MacFarlane\" />\n  <meta name=\"author\" content=\"Anonymous\" />\n  <meta name=\"date\" content=\"2006-07-17\" />\n  <title>Pandoc Test Suite</title>\n  <style type=\"text/css\">\n    /* Default styles provided by pandoc.\n    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.\n    */\n    html {\n      color: #1a1a1a;\n      background-color: #fdfdfd;\n    }\n    body {\n      margin: 0 auto;\n      max-width: 36em;\n      padding-left: 50px;\n      padding-right: 50px;\n      padding-top: 50px;\n      padding-bottom: 50px;\n      hyphens: auto;\n      overflow-wrap: break-word;\n      text-rendering: optimizeLegibility;\n      font-kerning: normal;\n    }\n    @media (max-width: 600px) {\n      body {\n        font-size: 0.9em;\n        padding: 12px;\n      }\n      h1 {\n        font-size: 1.8em;\n      }\n    }\n    @media print {\n      html {\n        background-color: white;\n      }\n      body {\n        background-color: transparent;\n        color: black;\n        font-size: 12pt;\n      }\n      p, h2, h3 {\n        orphans: 3;\n        widows: 3;\n      }\n      h2, h3, h4 {\n        page-break-after: avoid;\n      }\n    }\n    p {\n      margin: 1em 0;\n    }\n    a {\n      color: #1a1a1a;\n    }\n    a:visited {\n      color: #1a1a1a;\n    }\n    img {\n      max-width: 100%;\n    }\n    svg {\n      height: auto;\n      max-width: 100%;\n    }\n    h1, h2, h3, h4, h5, h6 {\n      margin-top: 1.4em;\n    }\n    h5, h6 {\n      font-size: 1em;\n      font-style: italic;\n    }\n    h6 {\n      font-weight: normal;\n    }\n    ol, ul {\n      padding-left: 1.7em;\n      margin-top: 1em;\n    }\n    li > ol, li > ul {\n      margin-top: 0;\n    }\n    blockquote {\n      margin: 1em 0 1em 1.7em;\n      padding-left: 1em;\n      border-left: 2px solid #e6e6e6;\n      color: #606060;\n    }\n    code {\n      white-space: pre-wrap;\n      font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;\n      font-size: 85%;\n      margin: 0;\n      hyphens: manual;\n    }\n    pre {\n      margin: 1em 0;\n      overflow: auto;\n    }\n    pre code {\n      padding: 0;\n      overflow: visible;\n      overflow-wrap: normal;\n    }\n    .sourceCode {\n     background-color: transparent;\n     overflow: visible;\n    }\n    hr {\n      border: none;\n      border-top: 1px solid #1a1a1a;\n      height: 1px;\n      margin: 1em 0;\n    }\n    table {\n      margin: 1em 0;\n      border-collapse: collapse;\n      width: 100%;\n      overflow-x: auto;\n      display: block;\n      font-variant-numeric: lining-nums tabular-nums;\n    }\n    table caption {\n      margin-bottom: 0.75em;\n    }\n    tbody {\n      margin-top: 0.5em;\n      border-top: 1px solid #1a1a1a;\n      border-bottom: 1px solid #1a1a1a;\n    }\n    th {\n      border-top: 1px solid #1a1a1a;\n      padding: 0.25em 0.5em 0.25em 0.5em;\n    }\n    td {\n      padding: 0.125em 0.5em 0.25em 0.5em;\n    }\n    header {\n      margin-bottom: 4em;\n      text-align: center;\n    }\n    #TOC li {\n      list-style: none;\n    }\n    #TOC ul {\n      padding-left: 1.3em;\n    }\n    #TOC > ul {\n      padding-left: 0;\n    }\n    #TOC a:not(:hover) {\n      text-decoration: none;\n    }\n    span.smallcaps{font-variant: small-caps;}\n    div.columns{display: flex; gap: min(4vw, 1.5em);}\n    div.column{flex: auto; overflow-x: auto;}\n    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\n    /* The extra [class] is a hack that increases specificity enough to\n       override a similar rule in reveal.js */\n    ul.task-list[class]{list-style: none;}\n    ul.task-list li input[type=\"checkbox\"] {\n      font-size: inherit;\n      width: 0.8em;\n      margin: 0 0.8em 0.2em -1.6em;\n      vertical-align: middle;\n    }\n    .display.math{display: block; text-align: center; margin: 0.5rem auto;}\n  </style>\n</head>\n<body>\n<div id=\"header\">\n<h1 class=\"title\">Pandoc Test Suite</h1>\n<h2 class=\"author\">John MacFarlane</h2>\n<h2 class=\"author\">Anonymous</h2>\n<h3 class=\"date\">July 17, 2006</h3>\n</div>\n<p>This is a set of tests for pandoc. Most of them are adapted from John\nGruber’s markdown test suite.</p>\n<hr />\n<h1 id=\"headers\">Headers</h1>\n<h2 id=\"level-2-with-an-embedded-link\">Level 2 with an <a href=\"/url\">embedded\nlink</a></h2>\n<h3 id=\"level-3-with-emphasis\">Level 3 with <em>emphasis</em></h3>\n<h4 id=\"level-4\">Level 4</h4>\n<h5 id=\"level-5\">Level 5</h5>\n<h1 id=\"level-1\">Level 1</h1>\n<h2 id=\"level-2-with-emphasis\">Level 2 with <em>emphasis</em></h2>\n<h3 id=\"level-3\">Level 3</h3>\n<p>with no blank line</p>\n<h2 id=\"level-2\">Level 2</h2>\n<p>with no blank line</p>\n<hr />\n<h1 id=\"paragraphs\">Paragraphs</h1>\n<p>Here’s a regular paragraph.</p>\n<p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.</p>\n<p>Here’s one with a bullet. * criminey.</p>\n<p>There should be a hard line break<br />\nhere.</p>\n<hr />\n<h1 id=\"block-quotes\">Block Quotes</h1>\n<p>E-mail style:</p>\n<blockquote>\n<p>This is a block quote. It is pretty short.</p>\n</blockquote>\n<blockquote>\n<p>Code in a block quote:</p>\n<pre><code>sub status {\n    print &quot;working&quot;;\n}</code></pre>\n<p>A list:</p>\n<ol style=\"list-style-type: decimal\">\n<li>item one</li>\n<li>item two</li>\n</ol>\n<p>Nested block quotes:</p>\n<blockquote>\n<p>nested</p>\n</blockquote>\n<blockquote>\n<p>nested</p>\n</blockquote>\n</blockquote>\n<p>This should not be a block quote: 2 &gt; 1.</p>\n<p>And a following paragraph.</p>\n<hr />\n<h1 id=\"code-blocks\">Code Blocks</h1>\n<p>Code:</p>\n<pre><code>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</code></pre>\n<p>And:</p>\n<pre><code>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</code></pre>\n<hr />\n<h1 id=\"lists\">Lists</h1>\n<h2 id=\"unordered\">Unordered</h2>\n<p>Asterisks tight:</p>\n<ul>\n<li>asterisk 1</li>\n<li>asterisk 2</li>\n<li>asterisk 3</li>\n</ul>\n<p>Asterisks loose:</p>\n<ul>\n<li><p>asterisk 1</p></li>\n<li><p>asterisk 2</p></li>\n<li><p>asterisk 3</p></li>\n</ul>\n<p>Pluses tight:</p>\n<ul>\n<li>Plus 1</li>\n<li>Plus 2</li>\n<li>Plus 3</li>\n</ul>\n<p>Pluses loose:</p>\n<ul>\n<li><p>Plus 1</p></li>\n<li><p>Plus 2</p></li>\n<li><p>Plus 3</p></li>\n</ul>\n<p>Minuses tight:</p>\n<ul>\n<li>Minus 1</li>\n<li>Minus 2</li>\n<li>Minus 3</li>\n</ul>\n<p>Minuses loose:</p>\n<ul>\n<li><p>Minus 1</p></li>\n<li><p>Minus 2</p></li>\n<li><p>Minus 3</p></li>\n</ul>\n<h2 id=\"ordered\">Ordered</h2>\n<p>Tight:</p>\n<ol style=\"list-style-type: decimal\">\n<li>First</li>\n<li>Second</li>\n<li>Third</li>\n</ol>\n<p>and:</p>\n<ol style=\"list-style-type: decimal\">\n<li>One</li>\n<li>Two</li>\n<li>Three</li>\n</ol>\n<p>Loose using tabs:</p>\n<ol style=\"list-style-type: decimal\">\n<li><p>First</p></li>\n<li><p>Second</p></li>\n<li><p>Third</p></li>\n</ol>\n<p>and using spaces:</p>\n<ol style=\"list-style-type: decimal\">\n<li><p>One</p></li>\n<li><p>Two</p></li>\n<li><p>Three</p></li>\n</ol>\n<p>Multiple paragraphs:</p>\n<ol style=\"list-style-type: decimal\">\n<li><p>Item 1, graf one.</p>\n<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\nback.</p></li>\n<li><p>Item 2.</p></li>\n<li><p>Item 3.</p></li>\n</ol>\n<h2 id=\"nested\">Nested</h2>\n<ul>\n<li>Tab\n<ul>\n<li>Tab\n<ul>\n<li>Tab</li>\n</ul></li>\n</ul></li>\n</ul>\n<p>Here’s another:</p>\n<ol style=\"list-style-type: decimal\">\n<li>First</li>\n<li>Second:\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li>Third</li>\n</ol>\n<p>Same thing but with paragraphs:</p>\n<ol style=\"list-style-type: decimal\">\n<li><p>First</p></li>\n<li><p>Second:</p>\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li><p>Third</p></li>\n</ol>\n<h2 id=\"tabs-and-spaces\">Tabs and spaces</h2>\n<ul>\n<li><p>this is a list item indented with tabs</p></li>\n<li><p>this is a list item indented with spaces</p>\n<ul>\n<li><p>this is an example list item indented with tabs</p></li>\n<li><p>this is an example list item indented with spaces</p></li>\n</ul></li>\n</ul>\n<h2 id=\"fancy-list-markers\">Fancy list markers</h2>\n<ol start=\"2\" style=\"list-style-type: decimal\">\n<li><p>begins with 2</p></li>\n<li><p>and now 3</p>\n<p>with a continuation</p>\n<ol start=\"4\" style=\"list-style-type: lower-roman\">\n<li>sublist with roman numerals, starting with 4</li>\n<li>more items\n<ol style=\"list-style-type: upper-alpha\">\n<li>a subsublist</li>\n<li>a subsublist</li>\n</ol></li>\n</ol></li>\n</ol>\n<p>Nesting:</p>\n<ol style=\"list-style-type: upper-alpha\">\n<li>Upper Alpha\n<ol style=\"list-style-type: upper-roman\">\n<li>Upper Roman.\n<ol start=\"6\" style=\"list-style-type: decimal\">\n<li>Decimal start with 6\n<ol start=\"3\" style=\"list-style-type: lower-alpha\">\n<li>Lower alpha with paren</li>\n</ol></li>\n</ol></li>\n</ol></li>\n</ol>\n<p>Autonumbering:</p>\n<ol>\n<li>Autonumber.</li>\n<li>More.\n<ol>\n<li>Nested.</li>\n</ol></li>\n</ol>\n<p>Should not be a list item:</p>\n<p>M.A. 2007</p>\n<p>B. Williams</p>\n<hr />\n<h1 id=\"definition-lists\">Definition Lists</h1>\n<p>Tight using spaces:</p>\n<dl>\n<dt>apple</dt>\n<dd>\nred fruit\n</dd>\n<dt>orange</dt>\n<dd>\norange fruit\n</dd>\n<dt>banana</dt>\n<dd>\nyellow fruit\n</dd>\n</dl>\n<p>Tight using tabs:</p>\n<dl>\n<dt>apple</dt>\n<dd>\nred fruit\n</dd>\n<dt>orange</dt>\n<dd>\norange fruit\n</dd>\n<dt>banana</dt>\n<dd>\nyellow fruit\n</dd>\n</dl>\n<p>Loose:</p>\n<dl>\n<dt>apple</dt>\n<dd>\n<p>red fruit</p>\n</dd>\n<dt>orange</dt>\n<dd>\n<p>orange fruit</p>\n</dd>\n<dt>banana</dt>\n<dd>\n<p>yellow fruit</p>\n</dd>\n</dl>\n<p>Multiple blocks with italics:</p>\n<dl>\n<dt><em>apple</em></dt>\n<dd>\n<p>red fruit</p>\n<p>contains seeds, crisp, pleasant to taste</p>\n</dd>\n<dt><em>orange</em></dt>\n<dd>\n<p>orange fruit</p>\n<pre><code>{ orange code block }</code></pre>\n<blockquote>\n<p>orange block quote</p>\n</blockquote>\n</dd>\n</dl>\n<p>Multiple definitions, tight:</p>\n<dl>\n<dt>apple</dt>\n<dd>\nred fruit\n</dd>\n<dd>\ncomputer\n</dd>\n<dt>orange</dt>\n<dd>\norange fruit\n</dd>\n<dd>\nbank\n</dd>\n</dl>\n<p>Multiple definitions, loose:</p>\n<dl>\n<dt>apple</dt>\n<dd>\n<p>red fruit</p>\n</dd>\n<dd>\n<p>computer</p>\n</dd>\n<dt>orange</dt>\n<dd>\n<p>orange fruit</p>\n</dd>\n<dd>\n<p>bank</p>\n</dd>\n</dl>\n<p>Blank line after term, indented marker, alternate markers:</p>\n<dl>\n<dt>apple</dt>\n<dd>\n<p>red fruit</p>\n</dd>\n<dd>\n<p>computer</p>\n</dd>\n<dt>orange</dt>\n<dd>\n<p>orange fruit</p>\n<ol style=\"list-style-type: decimal\">\n<li>sublist</li>\n<li>sublist</li>\n</ol>\n</dd>\n</dl>\n<h1 id=\"html-blocks\">HTML Blocks</h1>\n<p>Simple block on one line:</p>\n<div>\nfoo\n</div>\n<p>And nested without indentation:</p>\n<div>\n<div>\n<div>\n<p>foo</p>\n</div>\n</div>\n<div>\nbar\n</div>\n</div>\n<p>Interpreted markdown in a table:</p>\n<table>\n<tr>\n<td>\nThis is <em>emphasized</em>\n</td>\n<td>\nAnd this is <strong>strong</strong>\n</td>\n</tr>\n</table>\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n<p>Here’s a simple block:</p>\n<div>\n<p>foo</p>\n</div>\n<p>This should be a code block, though:</p>\n<pre><code>&lt;div&gt;\n    foo\n&lt;/div&gt;</code></pre>\n<p>As should this:</p>\n<pre><code>&lt;div&gt;foo&lt;/div&gt;</code></pre>\n<p>Now, nested:</p>\n<div>\n<div>\n<div>\nfoo\n</div>\n</div>\n</div>\n<p>This should just be an HTML comment:</p>\n<!-- Comment -->\n<p>Multiline:</p>\n<!--\nBlah\nBlah\n-->\n<!--\n    This is another comment.\n-->\n<p>Code block:</p>\n<pre><code>&lt;!-- Comment --&gt;</code></pre>\n<p>Just plain comment, with trailing spaces on the line:</p>\n<!-- foo -->\n<p>Code:</p>\n<pre><code>&lt;hr /&gt;</code></pre>\n<p>Hr’s:</p>\n<hr>\n<hr />\n<hr />\n<hr>\n<hr />\n<hr />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\">\n<hr />\n<h1 id=\"inline-markup\">Inline Markup</h1>\n<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>\n<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>\n<p>An <em><a href=\"/url\">emphasized link</a></em>.</p>\n<p><strong><em>This is strong and em.</em></strong></p>\n<p>So is <strong><em>this</em></strong> word.</p>\n<p><strong><em>This is strong and em.</em></strong></p>\n<p>So is <strong><em>this</em></strong> word.</p>\n<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\\</code>,\n<code>\\$</code>, <code>&lt;html&gt;</code>.</p>\n<p><del>This is <em>strikeout</em>.</del></p>\n<p>Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup>\na<sup>hello there</sup>.</p>\n<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n<p>These should not be superscripts or subscripts, because of the unescaped\nspaces: a^b c^d, a~b c~d.</p>\n<hr />\n<h1 id=\"smart-quotes-ellipses-dashes\">Smart quotes, ellipses, dashes</h1>\n<p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>\n<p>‘A’, ‘B’, and ‘C’ are letters.</p>\n<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p>\n<p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p>\n<p>Here is some quoted ‘<code>code</code>’ and a “<a\nhref=\"http://example.com/?foo=1&amp;bar=2\">quoted link</a>”.</p>\n<p>Some dashes: one—two — three—four — five.</p>\n<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n<p>Ellipses…and…and….</p>\n<hr />\n<h1 id=\"latex\">LaTeX</h1>\n<ul>\n<li></li>\n<li><span class=\"math inline\">2 + 2 = 4</span></li>\n<li><span class=\"math inline\"><em>x</em> ∈ <em>y</em></span></li>\n<li><span class=\"math inline\"><em>α</em> ∧ <em>ω</em></span></li>\n<li><span class=\"math inline\">223</span></li>\n<li><span class=\"math inline\"><em>p</em></span>-Tree</li>\n<li>Here’s some display math: <span\nclass=\"math display\">$$\\frac{d}{dx}f(x)=\\lim_{h\\to\n0}\\frac{f(x+h)-f(x)}{h}$$</span></li>\n<li>Here’s one that has a line break in it: <span\nclass=\"math inline\"><em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup></span>.</li>\n</ul>\n<p>These shouldn’t be math:</p>\n<ul>\n<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>\n<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if “lot” is\nemphasized.)</li>\n<li>Shoes ($20) and socks ($5).</li>\n<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>\n</ul>\n<p>Here’s a LaTeX table:</p>\n<hr />\n<h1 id=\"special-characters\">Special Characters</h1>\n<p>Here is some unicode:</p>\n<ul>\n<li>I hat: Î</li>\n<li>o umlaut: ö</li>\n<li>section: §</li>\n<li>set membership: ∈</li>\n<li>copyright: ©</li>\n</ul>\n<p>AT&amp;T has an ampersand in their name.</p>\n<p>AT&amp;T is another way to write it.</p>\n<p>This &amp; that.</p>\n<p>4 &lt; 5.</p>\n<p>6 &gt; 5.</p>\n<p>Backslash: \\</p>\n<p>Backtick: `</p>\n<p>Asterisk: *</p>\n<p>Underscore: _</p>\n<p>Left brace: {</p>\n<p>Right brace: }</p>\n<p>Left bracket: [</p>\n<p>Right bracket: ]</p>\n<p>Left paren: (</p>\n<p>Right paren: )</p>\n<p>Greater-than: &gt;</p>\n<p>Hash: #</p>\n<p>Period: .</p>\n<p>Bang: !</p>\n<p>Plus: +</p>\n<p>Minus: -</p>\n<hr />\n<h1 id=\"links\">Links</h1>\n<h2 id=\"explicit\">Explicit</h2>\n<p>Just a <a href=\"/url/\">URL</a>.</p>\n<p><a href=\"/url/\" title=\"title\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title preceded by two spaces\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title preceded by a tab\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title with &quot;quotes&quot; in it\">URL and\ntitle</a></p>\n<p><a href=\"/url/\" title=\"title with single quotes\">URL and title</a></p>\n<p><a href=\"/url/with_underscore\">with_underscore</a></p>\n<p><a href=\"mailto:nobody@nowhere.net\">Email link</a></p>\n<p><a href=\"\">Empty</a>.</p>\n<h2 id=\"reference\">Reference</h2>\n<p>Foo <a href=\"/url/\">bar</a>.</p>\n<p>With <a href=\"/url/\">embedded [brackets]</a>.</p>\n<p><a href=\"/url/\">b</a> by itself should be a link.</p>\n<p>Indented <a href=\"/url\">once</a>.</p>\n<p>Indented <a href=\"/url\">twice</a>.</p>\n<p>Indented <a href=\"/url\">thrice</a>.</p>\n<p>This should [not][] be a link.</p>\n<pre><code>[not]: /url</code></pre>\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quotes&quot; inside\">bar</a>.</p>\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quote&quot; inside\">biz</a>.</p>\n<h2 id=\"with-ampersands\">With ampersands</h2>\n<p>Here’s a <a href=\"http://example.com/?foo=1&amp;bar=2\">link with an ampersand\nin the URL</a>.</p>\n<p>Here’s a link with an amersand in the link text: <a href=\"http://att.com/\"\ntitle=\"AT&amp;T\">AT&amp;T</a>.</p>\n<p>Here’s an <a href=\"/script?foo=1&amp;bar=2\">inline link</a>.</p>\n<p>Here’s an <a href=\"/script?foo=1&amp;bar=2\">inline link in pointy\nbraces</a>.</p>\n<h2 id=\"autolinks\">Autolinks</h2>\n<p>With an ampersand: <a href=\"http://example.com/?foo=1&amp;bar=2\"\nclass=\"uri\">http://example.com/?foo=1&amp;bar=2</a></p>\n<ul>\n<li>In a list?</li>\n<li><a href=\"http://example.com/\" class=\"uri\">http://example.com/</a></li>\n<li>It should.</li>\n</ul>\n<p>An e-mail address: <a href=\"mailto:nobody@nowhere.net\"\nclass=\"email\">nobody@nowhere.net</a></p>\n<blockquote>\n<p>Blockquoted: <a href=\"http://example.com/\"\nclass=\"uri\">http://example.com/</a></p>\n</blockquote>\n<p>Auto-links should not occur here:\n<code>&lt;http://example.com/&gt;</code></p>\n<pre><code>or here: &lt;http://example.com/&gt;</code></pre>\n<hr />\n<h1 id=\"images\">Images</h1>\n<p>From “Voyage dans la Lune” by Georges Melies (1902):</p>\n<div class=\"float\">\n<img src=\"lalune.jpg\" title=\"Voyage dans la Lune\" alt=\"lalune\" />\n<div class=\"figcaption\">lalune</div>\n</div>\n<p>Here is a movie <img src=\"movie.jpg\" alt=\"movie\" /> icon.</p>\n<hr />\n<h1 id=\"footnotes\">Footnotes</h1>\n<p>Here is a footnote reference,<a href=\"#fn1\" class=\"footnote-ref\"\nid=\"fnref1\"><sup>1</sup></a> and another.<a href=\"#fn2\" class=\"footnote-ref\"\nid=\"fnref2\"><sup>2</sup></a> This should <em>not</em> be a footnote reference,\nbecause it contains a space.[^my note] Here is an inline note.<a href=\"#fn3\"\nclass=\"footnote-ref\" id=\"fnref3\"><sup>3</sup></a></p>\n<blockquote>\n<p>Notes can go in quotes.<a href=\"#fn4\" class=\"footnote-ref\"\nid=\"fnref4\"><sup>4</sup></a></p>\n</blockquote>\n<ol style=\"list-style-type: decimal\">\n<li>And in list items.<a href=\"#fn5\" class=\"footnote-ref\"\nid=\"fnref5\"><sup>5</sup></a></li>\n</ol>\n<p>This paragraph should not be part of the note, as it is not indented.</p>\n<div class=\"footnotes footnotes-end-of-document\">\n<hr />\n<ol>\n<li id=\"fn1\"><p>Here is the footnote. It can go anywhere after the footnote\nreference. It need not be placed at the end of the document.<a href=\"#fnref1\"\nclass=\"footnote-back\">↩︎</a></p></li>\n<li id=\"fn2\"><p>Here’s the long note. This one contains multiple blocks.</p>\n<p>Subsequent blocks are indented to show that they belong to the footnote (as\nwith list items).</p>\n<pre><code>  { &lt;code&gt; }</code></pre>\n<p>If you want, you can indent every line, but you can also be lazy and just\nindent the first line of each block.<a href=\"#fnref2\"\nclass=\"footnote-back\">↩︎</a></p></li>\n<li id=\"fn3\"><p>This is <em>easier</em> to type. Inline notes may contain <a\nhref=\"http://google.com\">links</a> and <code>]</code> verbatim characters, as\nwell as [bracketed text].<a href=\"#fnref3\" class=\"footnote-back\">↩︎</a></p></li>\n<li id=\"fn4\"><p>In quote.<a href=\"#fnref4\" class=\"footnote-back\">↩︎</a></p></li>\n<li id=\"fn5\"><p>In list.<a href=\"#fnref5\" class=\"footnote-back\">↩︎</a></p></li>\n</ol>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "test/writer.html5",
    "content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\" />\n  <meta name=\"author\" content=\"John MacFarlane\" />\n  <meta name=\"author\" content=\"Anonymous\" />\n  <meta name=\"dcterms.date\" content=\"2006-07-17\" />\n  <title>Pandoc Test Suite</title>\n  <style>\n    /* Default styles provided by pandoc.\n    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.\n    */\n    html {\n      color: #1a1a1a;\n      background-color: #fdfdfd;\n    }\n    body {\n      margin: 0 auto;\n      max-width: 36em;\n      padding-left: 50px;\n      padding-right: 50px;\n      padding-top: 50px;\n      padding-bottom: 50px;\n      hyphens: auto;\n      overflow-wrap: break-word;\n      text-rendering: optimizeLegibility;\n      font-kerning: normal;\n    }\n    @media (max-width: 600px) {\n      body {\n        font-size: 0.9em;\n        padding: 12px;\n      }\n      h1 {\n        font-size: 1.8em;\n      }\n    }\n    @media print {\n      html {\n        background-color: white;\n      }\n      body {\n        background-color: transparent;\n        color: black;\n        font-size: 12pt;\n      }\n      p, h2, h3 {\n        orphans: 3;\n        widows: 3;\n      }\n      h2, h3, h4 {\n        page-break-after: avoid;\n      }\n    }\n    p {\n      margin: 1em 0;\n    }\n    a {\n      color: #1a1a1a;\n    }\n    a:visited {\n      color: #1a1a1a;\n    }\n    img {\n      max-width: 100%;\n    }\n    svg {\n      height: auto;\n      max-width: 100%;\n    }\n    h1, h2, h3, h4, h5, h6 {\n      margin-top: 1.4em;\n    }\n    h5, h6 {\n      font-size: 1em;\n      font-style: italic;\n    }\n    h6 {\n      font-weight: normal;\n    }\n    ol, ul {\n      padding-left: 1.7em;\n      margin-top: 1em;\n    }\n    li > ol, li > ul {\n      margin-top: 0;\n    }\n    blockquote {\n      margin: 1em 0 1em 1.7em;\n      padding-left: 1em;\n      border-left: 2px solid #e6e6e6;\n      color: #606060;\n    }\n    code {\n      white-space: pre-wrap;\n      font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;\n      font-size: 85%;\n      margin: 0;\n      hyphens: manual;\n    }\n    pre {\n      margin: 1em 0;\n      overflow: auto;\n    }\n    pre code {\n      padding: 0;\n      overflow: visible;\n      overflow-wrap: normal;\n    }\n    .sourceCode {\n     background-color: transparent;\n     overflow: visible;\n    }\n    hr {\n      border: none;\n      border-top: 1px solid #1a1a1a;\n      height: 1px;\n      margin: 1em 0;\n    }\n    table {\n      margin: 1em 0;\n      border-collapse: collapse;\n      width: 100%;\n      overflow-x: auto;\n      display: block;\n      font-variant-numeric: lining-nums tabular-nums;\n    }\n    table caption {\n      margin-bottom: 0.75em;\n    }\n    tbody {\n      margin-top: 0.5em;\n      border-top: 1px solid #1a1a1a;\n      border-bottom: 1px solid #1a1a1a;\n    }\n    th {\n      border-top: 1px solid #1a1a1a;\n      padding: 0.25em 0.5em 0.25em 0.5em;\n    }\n    td {\n      padding: 0.125em 0.5em 0.25em 0.5em;\n    }\n    header {\n      margin-bottom: 4em;\n      text-align: center;\n    }\n    #TOC li {\n      list-style: none;\n    }\n    #TOC ul {\n      padding-left: 1.3em;\n    }\n    #TOC > ul {\n      padding-left: 0;\n    }\n    #TOC a:not(:hover) {\n      text-decoration: none;\n    }\n    span.smallcaps{font-variant: small-caps;}\n    div.columns{display: flex; gap: min(4vw, 1.5em);}\n    div.column{flex: auto; overflow-x: auto;}\n    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}\n    /* The extra [class] is a hack that increases specificity enough to\n       override a similar rule in reveal.js */\n    ul.task-list[class]{list-style: none;}\n    ul.task-list li input[type=\"checkbox\"] {\n      font-size: inherit;\n      width: 0.8em;\n      margin: 0 0.8em 0.2em -1.6em;\n      vertical-align: middle;\n    }\n    .display.math{display: block; text-align: center; margin: 0.5rem auto;}\n  </style>\n</head>\n<body>\n<header id=\"title-block-header\">\n<h1 class=\"title\">Pandoc Test Suite</h1>\n<p class=\"author\">John MacFarlane</p>\n<p class=\"author\">Anonymous</p>\n<p class=\"date\">July 17, 2006</p>\n</header>\n<p>This is a set of tests for pandoc. Most of them are adapted from John\nGruber’s markdown test suite.</p>\n<hr />\n<h1 id=\"headers\">Headers</h1>\n<h2 id=\"level-2-with-an-embedded-link\">Level 2 with an <a href=\"/url\">embedded\nlink</a></h2>\n<h3 id=\"level-3-with-emphasis\">Level 3 with <em>emphasis</em></h3>\n<h4 id=\"level-4\">Level 4</h4>\n<h5 id=\"level-5\">Level 5</h5>\n<h1 id=\"level-1\">Level 1</h1>\n<h2 id=\"level-2-with-emphasis\">Level 2 with <em>emphasis</em></h2>\n<h3 id=\"level-3\">Level 3</h3>\n<p>with no blank line</p>\n<h2 id=\"level-2\">Level 2</h2>\n<p>with no blank line</p>\n<hr />\n<h1 id=\"paragraphs\">Paragraphs</h1>\n<p>Here’s a regular paragraph.</p>\n<p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.</p>\n<p>Here’s one with a bullet. * criminey.</p>\n<p>There should be a hard line break<br />\nhere.</p>\n<hr />\n<h1 id=\"block-quotes\">Block Quotes</h1>\n<p>E-mail style:</p>\n<blockquote>\n<p>This is a block quote. It is pretty short.</p>\n</blockquote>\n<blockquote>\n<p>Code in a block quote:</p>\n<pre><code>sub status {\n    print &quot;working&quot;;\n}</code></pre>\n<p>A list:</p>\n<ol type=\"1\">\n<li>item one</li>\n<li>item two</li>\n</ol>\n<p>Nested block quotes:</p>\n<blockquote>\n<p>nested</p>\n</blockquote>\n<blockquote>\n<p>nested</p>\n</blockquote>\n</blockquote>\n<p>This should not be a block quote: 2 &gt; 1.</p>\n<p>And a following paragraph.</p>\n<hr />\n<h1 id=\"code-blocks\">Code Blocks</h1>\n<p>Code:</p>\n<pre><code>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</code></pre>\n<p>And:</p>\n<pre><code>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</code></pre>\n<hr />\n<h1 id=\"lists\">Lists</h1>\n<h2 id=\"unordered\">Unordered</h2>\n<p>Asterisks tight:</p>\n<ul>\n<li>asterisk 1</li>\n<li>asterisk 2</li>\n<li>asterisk 3</li>\n</ul>\n<p>Asterisks loose:</p>\n<ul>\n<li><p>asterisk 1</p></li>\n<li><p>asterisk 2</p></li>\n<li><p>asterisk 3</p></li>\n</ul>\n<p>Pluses tight:</p>\n<ul>\n<li>Plus 1</li>\n<li>Plus 2</li>\n<li>Plus 3</li>\n</ul>\n<p>Pluses loose:</p>\n<ul>\n<li><p>Plus 1</p></li>\n<li><p>Plus 2</p></li>\n<li><p>Plus 3</p></li>\n</ul>\n<p>Minuses tight:</p>\n<ul>\n<li>Minus 1</li>\n<li>Minus 2</li>\n<li>Minus 3</li>\n</ul>\n<p>Minuses loose:</p>\n<ul>\n<li><p>Minus 1</p></li>\n<li><p>Minus 2</p></li>\n<li><p>Minus 3</p></li>\n</ul>\n<h2 id=\"ordered\">Ordered</h2>\n<p>Tight:</p>\n<ol type=\"1\">\n<li>First</li>\n<li>Second</li>\n<li>Third</li>\n</ol>\n<p>and:</p>\n<ol type=\"1\">\n<li>One</li>\n<li>Two</li>\n<li>Three</li>\n</ol>\n<p>Loose using tabs:</p>\n<ol type=\"1\">\n<li><p>First</p></li>\n<li><p>Second</p></li>\n<li><p>Third</p></li>\n</ol>\n<p>and using spaces:</p>\n<ol type=\"1\">\n<li><p>One</p></li>\n<li><p>Two</p></li>\n<li><p>Three</p></li>\n</ol>\n<p>Multiple paragraphs:</p>\n<ol type=\"1\">\n<li><p>Item 1, graf one.</p>\n<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\nback.</p></li>\n<li><p>Item 2.</p></li>\n<li><p>Item 3.</p></li>\n</ol>\n<h2 id=\"nested\">Nested</h2>\n<ul>\n<li>Tab\n<ul>\n<li>Tab\n<ul>\n<li>Tab</li>\n</ul></li>\n</ul></li>\n</ul>\n<p>Here’s another:</p>\n<ol type=\"1\">\n<li>First</li>\n<li>Second:\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li>Third</li>\n</ol>\n<p>Same thing but with paragraphs:</p>\n<ol type=\"1\">\n<li><p>First</p></li>\n<li><p>Second:</p>\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li><p>Third</p></li>\n</ol>\n<h2 id=\"tabs-and-spaces\">Tabs and spaces</h2>\n<ul>\n<li><p>this is a list item indented with tabs</p></li>\n<li><p>this is a list item indented with spaces</p>\n<ul>\n<li><p>this is an example list item indented with tabs</p></li>\n<li><p>this is an example list item indented with spaces</p></li>\n</ul></li>\n</ul>\n<h2 id=\"fancy-list-markers\">Fancy list markers</h2>\n<ol start=\"2\" type=\"1\">\n<li><p>begins with 2</p></li>\n<li><p>and now 3</p>\n<p>with a continuation</p>\n<ol start=\"4\" type=\"i\">\n<li>sublist with roman numerals, starting with 4</li>\n<li>more items\n<ol type=\"A\">\n<li>a subsublist</li>\n<li>a subsublist</li>\n</ol></li>\n</ol></li>\n</ol>\n<p>Nesting:</p>\n<ol type=\"A\">\n<li>Upper Alpha\n<ol type=\"I\">\n<li>Upper Roman.\n<ol start=\"6\" type=\"1\">\n<li>Decimal start with 6\n<ol start=\"3\" type=\"a\">\n<li>Lower alpha with paren</li>\n</ol></li>\n</ol></li>\n</ol></li>\n</ol>\n<p>Autonumbering:</p>\n<ol>\n<li>Autonumber.</li>\n<li>More.\n<ol>\n<li>Nested.</li>\n</ol></li>\n</ol>\n<p>Should not be a list item:</p>\n<p>M.A. 2007</p>\n<p>B. Williams</p>\n<hr />\n<h1 id=\"definition-lists\">Definition Lists</h1>\n<p>Tight using spaces:</p>\n<dl>\n<dt>apple</dt>\n<dd>\nred fruit\n</dd>\n<dt>orange</dt>\n<dd>\norange fruit\n</dd>\n<dt>banana</dt>\n<dd>\nyellow fruit\n</dd>\n</dl>\n<p>Tight using tabs:</p>\n<dl>\n<dt>apple</dt>\n<dd>\nred fruit\n</dd>\n<dt>orange</dt>\n<dd>\norange fruit\n</dd>\n<dt>banana</dt>\n<dd>\nyellow fruit\n</dd>\n</dl>\n<p>Loose:</p>\n<dl>\n<dt>apple</dt>\n<dd>\n<p>red fruit</p>\n</dd>\n<dt>orange</dt>\n<dd>\n<p>orange fruit</p>\n</dd>\n<dt>banana</dt>\n<dd>\n<p>yellow fruit</p>\n</dd>\n</dl>\n<p>Multiple blocks with italics:</p>\n<dl>\n<dt><em>apple</em></dt>\n<dd>\n<p>red fruit</p>\n<p>contains seeds, crisp, pleasant to taste</p>\n</dd>\n<dt><em>orange</em></dt>\n<dd>\n<p>orange fruit</p>\n<pre><code>{ orange code block }</code></pre>\n<blockquote>\n<p>orange block quote</p>\n</blockquote>\n</dd>\n</dl>\n<p>Multiple definitions, tight:</p>\n<dl>\n<dt>apple</dt>\n<dd>\nred fruit\n</dd>\n<dd>\ncomputer\n</dd>\n<dt>orange</dt>\n<dd>\norange fruit\n</dd>\n<dd>\nbank\n</dd>\n</dl>\n<p>Multiple definitions, loose:</p>\n<dl>\n<dt>apple</dt>\n<dd>\n<p>red fruit</p>\n</dd>\n<dd>\n<p>computer</p>\n</dd>\n<dt>orange</dt>\n<dd>\n<p>orange fruit</p>\n</dd>\n<dd>\n<p>bank</p>\n</dd>\n</dl>\n<p>Blank line after term, indented marker, alternate markers:</p>\n<dl>\n<dt>apple</dt>\n<dd>\n<p>red fruit</p>\n</dd>\n<dd>\n<p>computer</p>\n</dd>\n<dt>orange</dt>\n<dd>\n<p>orange fruit</p>\n<ol type=\"1\">\n<li>sublist</li>\n<li>sublist</li>\n</ol>\n</dd>\n</dl>\n<h1 id=\"html-blocks\">HTML Blocks</h1>\n<p>Simple block on one line:</p>\n<div>\nfoo\n</div>\n<p>And nested without indentation:</p>\n<div>\n<div>\n<div>\n<p>foo</p>\n</div>\n</div>\n<div>\nbar\n</div>\n</div>\n<p>Interpreted markdown in a table:</p>\n<table>\n<tr>\n<td>\nThis is <em>emphasized</em>\n</td>\n<td>\nAnd this is <strong>strong</strong>\n</td>\n</tr>\n</table>\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n<p>Here’s a simple block:</p>\n<div>\n<p>foo</p>\n</div>\n<p>This should be a code block, though:</p>\n<pre><code>&lt;div&gt;\n    foo\n&lt;/div&gt;</code></pre>\n<p>As should this:</p>\n<pre><code>&lt;div&gt;foo&lt;/div&gt;</code></pre>\n<p>Now, nested:</p>\n<div>\n<div>\n<div>\nfoo\n</div>\n</div>\n</div>\n<p>This should just be an HTML comment:</p>\n<!-- Comment -->\n<p>Multiline:</p>\n<!--\nBlah\nBlah\n-->\n<!--\n    This is another comment.\n-->\n<p>Code block:</p>\n<pre><code>&lt;!-- Comment --&gt;</code></pre>\n<p>Just plain comment, with trailing spaces on the line:</p>\n<!-- foo -->\n<p>Code:</p>\n<pre><code>&lt;hr /&gt;</code></pre>\n<p>Hr’s:</p>\n<hr>\n<hr />\n<hr />\n<hr>\n<hr />\n<hr />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\">\n<hr />\n<h1 id=\"inline-markup\">Inline Markup</h1>\n<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>\n<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>\n<p>An <em><a href=\"/url\">emphasized link</a></em>.</p>\n<p><strong><em>This is strong and em.</em></strong></p>\n<p>So is <strong><em>this</em></strong> word.</p>\n<p><strong><em>This is strong and em.</em></strong></p>\n<p>So is <strong><em>this</em></strong> word.</p>\n<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\\</code>,\n<code>\\$</code>, <code>&lt;html&gt;</code>.</p>\n<p><del>This is <em>strikeout</em>.</del></p>\n<p>Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup>\na<sup>hello there</sup>.</p>\n<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n<p>These should not be superscripts or subscripts, because of the unescaped\nspaces: a^b c^d, a~b c~d.</p>\n<hr />\n<h1 id=\"smart-quotes-ellipses-dashes\">Smart quotes, ellipses, dashes</h1>\n<p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>\n<p>‘A’, ‘B’, and ‘C’ are letters.</p>\n<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p>\n<p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p>\n<p>Here is some quoted ‘<code>code</code>’ and a “<a\nhref=\"http://example.com/?foo=1&amp;bar=2\">quoted link</a>”.</p>\n<p>Some dashes: one—two — three—four — five.</p>\n<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n<p>Ellipses…and…and….</p>\n<hr />\n<h1 id=\"latex\">LaTeX</h1>\n<ul>\n<li></li>\n<li><span class=\"math inline\">2 + 2 = 4</span></li>\n<li><span class=\"math inline\"><em>x</em> ∈ <em>y</em></span></li>\n<li><span class=\"math inline\"><em>α</em> ∧ <em>ω</em></span></li>\n<li><span class=\"math inline\">223</span></li>\n<li><span class=\"math inline\"><em>p</em></span>-Tree</li>\n<li>Here’s some display math: <span\nclass=\"math display\">$$\\frac{d}{dx}f(x)=\\lim_{h\\to\n0}\\frac{f(x+h)-f(x)}{h}$$</span></li>\n<li>Here’s one that has a line break in it: <span\nclass=\"math inline\"><em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup></span>.</li>\n</ul>\n<p>These shouldn’t be math:</p>\n<ul>\n<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>\n<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if “lot” is\nemphasized.)</li>\n<li>Shoes ($20) and socks ($5).</li>\n<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>\n</ul>\n<p>Here’s a LaTeX table:</p>\n<hr />\n<h1 id=\"special-characters\">Special Characters</h1>\n<p>Here is some unicode:</p>\n<ul>\n<li>I hat: Î</li>\n<li>o umlaut: ö</li>\n<li>section: §</li>\n<li>set membership: ∈</li>\n<li>copyright: ©</li>\n</ul>\n<p>AT&amp;T has an ampersand in their name.</p>\n<p>AT&amp;T is another way to write it.</p>\n<p>This &amp; that.</p>\n<p>4 &lt; 5.</p>\n<p>6 &gt; 5.</p>\n<p>Backslash: \\</p>\n<p>Backtick: `</p>\n<p>Asterisk: *</p>\n<p>Underscore: _</p>\n<p>Left brace: {</p>\n<p>Right brace: }</p>\n<p>Left bracket: [</p>\n<p>Right bracket: ]</p>\n<p>Left paren: (</p>\n<p>Right paren: )</p>\n<p>Greater-than: &gt;</p>\n<p>Hash: #</p>\n<p>Period: .</p>\n<p>Bang: !</p>\n<p>Plus: +</p>\n<p>Minus: -</p>\n<hr />\n<h1 id=\"links\">Links</h1>\n<h2 id=\"explicit\">Explicit</h2>\n<p>Just a <a href=\"/url/\">URL</a>.</p>\n<p><a href=\"/url/\" title=\"title\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title preceded by two spaces\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title preceded by a tab\">URL and title</a>.</p>\n<p><a href=\"/url/\" title=\"title with &quot;quotes&quot; in it\">URL and\ntitle</a></p>\n<p><a href=\"/url/\" title=\"title with single quotes\">URL and title</a></p>\n<p><a href=\"/url/with_underscore\">with_underscore</a></p>\n<p><a href=\"mailto:nobody@nowhere.net\">Email link</a></p>\n<p><a href=\"\">Empty</a>.</p>\n<h2 id=\"reference\">Reference</h2>\n<p>Foo <a href=\"/url/\">bar</a>.</p>\n<p>With <a href=\"/url/\">embedded [brackets]</a>.</p>\n<p><a href=\"/url/\">b</a> by itself should be a link.</p>\n<p>Indented <a href=\"/url\">once</a>.</p>\n<p>Indented <a href=\"/url\">twice</a>.</p>\n<p>Indented <a href=\"/url\">thrice</a>.</p>\n<p>This should [not][] be a link.</p>\n<pre><code>[not]: /url</code></pre>\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quotes&quot; inside\">bar</a>.</p>\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quote&quot; inside\">biz</a>.</p>\n<h2 id=\"with-ampersands\">With ampersands</h2>\n<p>Here’s a <a href=\"http://example.com/?foo=1&amp;bar=2\">link with an ampersand\nin the URL</a>.</p>\n<p>Here’s a link with an amersand in the link text: <a href=\"http://att.com/\"\ntitle=\"AT&amp;T\">AT&amp;T</a>.</p>\n<p>Here’s an <a href=\"/script?foo=1&amp;bar=2\">inline link</a>.</p>\n<p>Here’s an <a href=\"/script?foo=1&amp;bar=2\">inline link in pointy\nbraces</a>.</p>\n<h2 id=\"autolinks\">Autolinks</h2>\n<p>With an ampersand: <a href=\"http://example.com/?foo=1&amp;bar=2\"\nclass=\"uri\">http://example.com/?foo=1&amp;bar=2</a></p>\n<ul>\n<li>In a list?</li>\n<li><a href=\"http://example.com/\" class=\"uri\">http://example.com/</a></li>\n<li>It should.</li>\n</ul>\n<p>An e-mail address: <a href=\"mailto:nobody@nowhere.net\"\nclass=\"email\">nobody@nowhere.net</a></p>\n<blockquote>\n<p>Blockquoted: <a href=\"http://example.com/\"\nclass=\"uri\">http://example.com/</a></p>\n</blockquote>\n<p>Auto-links should not occur here:\n<code>&lt;http://example.com/&gt;</code></p>\n<pre><code>or here: &lt;http://example.com/&gt;</code></pre>\n<hr />\n<h1 id=\"images\">Images</h1>\n<p>From “Voyage dans la Lune” by Georges Melies (1902):</p>\n<figure>\n<img src=\"lalune.jpg\" title=\"Voyage dans la Lune\" alt=\"lalune\" />\n<figcaption aria-hidden=\"true\">lalune</figcaption>\n</figure>\n<p>Here is a movie <img src=\"movie.jpg\" alt=\"movie\" /> icon.</p>\n<hr />\n<h1 id=\"footnotes\">Footnotes</h1>\n<p>Here is a footnote reference,<a href=\"#fn1\" class=\"footnote-ref\" id=\"fnref1\"\nrole=\"doc-noteref\"><sup>1</sup></a> and another.<a href=\"#fn2\"\nclass=\"footnote-ref\" id=\"fnref2\" role=\"doc-noteref\"><sup>2</sup></a> This should\n<em>not</em> be a footnote reference, because it contains a space.[^my note]\nHere is an inline note.<a href=\"#fn3\" class=\"footnote-ref\" id=\"fnref3\"\nrole=\"doc-noteref\"><sup>3</sup></a></p>\n<blockquote>\n<p>Notes can go in quotes.<a href=\"#fn4\" class=\"footnote-ref\" id=\"fnref4\"\nrole=\"doc-noteref\"><sup>4</sup></a></p>\n</blockquote>\n<ol type=\"1\">\n<li>And in list items.<a href=\"#fn5\" class=\"footnote-ref\" id=\"fnref5\"\nrole=\"doc-noteref\"><sup>5</sup></a></li>\n</ol>\n<p>This paragraph should not be part of the note, as it is not indented.</p>\n<section id=\"footnotes\" class=\"footnotes footnotes-end-of-document\"\nrole=\"doc-endnotes\">\n<hr />\n<ol>\n<li id=\"fn1\"><p>Here is the footnote. It can go anywhere after the footnote\nreference. It need not be placed at the end of the document.<a href=\"#fnref1\"\nclass=\"footnote-back\" role=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn2\"><p>Here’s the long note. This one contains multiple blocks.</p>\n<p>Subsequent blocks are indented to show that they belong to the footnote (as\nwith list items).</p>\n<pre><code>  { &lt;code&gt; }</code></pre>\n<p>If you want, you can indent every line, but you can also be lazy and just\nindent the first line of each block.<a href=\"#fnref2\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn3\"><p>This is <em>easier</em> to type. Inline notes may contain <a\nhref=\"http://google.com\">links</a> and <code>]</code> verbatim characters, as\nwell as [bracketed text].<a href=\"#fnref3\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn4\"><p>In quote.<a href=\"#fnref4\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n<li id=\"fn5\"><p>In list.<a href=\"#fnref5\" class=\"footnote-back\"\nrole=\"doc-backlink\">↩︎</a></p></li>\n</ol>\n</section>\n</body>\n</html>\n"
  },
  {
    "path": "test/writer.icml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$ID/NormalCharacterStyle\" Name=\"Default\" />\n      <CharacterStyle Self=\"CharacterStyle/\" Name=\"\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Bold\" Name=\"Bold\" FontStyle=\"Bold\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Bold Italic\" Name=\"Bold Italic\" FontStyle=\"Bold Italic\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Code\" Name=\"Code\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n          <AppliedFont type=\"string\">Courier New</AppliedFont>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Italic\" Name=\"Italic\" FontStyle=\"Italic\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Italic Link\" Name=\"Italic Link\" FontStyle=\"Italic\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Italic Strikeout\" Name=\"Italic Strikeout\" FontStyle=\"Italic\" StrikeThru=\"true\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Italic Superscript\" Name=\"Italic Superscript\" FontStyle=\"Italic\" Position=\"Superscript\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Link\" Name=\"Link\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Strikeout\" Name=\"Strikeout\" StrikeThru=\"true\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Subscript\" Name=\"Subscript\" Position=\"Subscript\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n      <CharacterStyle Self=\"CharacterStyle/Superscript\" Name=\"Superscript\" Position=\"Superscript\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalCharacterStyle</BasedOn>\n        </Properties>\n      </CharacterStyle>\n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$ID/NormalParagraphStyle\" Name=\"$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/\" Name=\"\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Blockquote &gt; Blockquote &gt; Paragraph\" Name=\"Blockquote &gt; Blockquote &gt; Paragraph\" LeftIndent=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Blockquote &gt; CodeBlock\" Name=\"Blockquote &gt; CodeBlock\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <AppliedFont type=\"string\">Courier New</AppliedFont>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Blockquote &gt; NumList\" Name=\"Blockquote &gt; NumList\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Blockquote &gt; NumList &gt; first\" Name=\"Blockquote &gt; NumList &gt; first\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Blockquote &gt; Paragraph\" Name=\"Blockquote &gt; Paragraph\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList\" Name=\"BulList\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">10</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; BulList &gt; BulList &gt; first\" Name=\"BulList &gt; BulList &gt; BulList &gt; first\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">30</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; BulList &gt; Paragraph\" Name=\"BulList &gt; BulList &gt; Paragraph\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">20</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; BulList &gt; first\" Name=\"BulList &gt; BulList &gt; first\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">20</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; BulList &gt; first &gt; Paragraph\" Name=\"BulList &gt; BulList &gt; first &gt; Paragraph\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">20</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; Paragraph\" Name=\"BulList &gt; Paragraph\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">10</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; first\" Name=\"BulList &gt; first\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">10</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/BulList &gt; first &gt; Paragraph\" Name=\"BulList &gt; first &gt; Paragraph\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">10</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Caption\" Name=\"Caption\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/CodeBlock\" Name=\"CodeBlock\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <AppliedFont type=\"string\">Courier New</AppliedFont>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListDef\" Name=\"DefListDef\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListDef &gt; Blockquote &gt; Paragraph\" Name=\"DefListDef &gt; Blockquote &gt; Paragraph\" LeftIndent=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListDef &gt; CodeBlock\" Name=\"DefListDef &gt; CodeBlock\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <AppliedFont type=\"string\">Courier New</AppliedFont>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListDef &gt; NumList\" Name=\"DefListDef &gt; NumList\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListDef &gt; NumList &gt; first\" Name=\"DefListDef &gt; NumList &gt; first\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListDef &gt; Paragraph\" Name=\"DefListDef &gt; Paragraph\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/DefListTerm\" Name=\"DefListTerm\" LeftIndent=\"0\" BulletsAndNumberingListType=\"BulletList\" FontStyle=\"Bold\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Figure\" Name=\"Figure\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Footnote &gt; CodeBlock\" Name=\"Footnote &gt; CodeBlock\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <AppliedFont type=\"string\">Courier New</AppliedFont>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Footnote &gt; Paragraph\" Name=\"Footnote &gt; Paragraph\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header1\" Name=\"Header1\" LeftIndent=\"0\" PointSize=\"36\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header2\" Name=\"Header2\" LeftIndent=\"0\" PointSize=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header3\" Name=\"Header3\" LeftIndent=\"0\" PointSize=\"24\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header4\" Name=\"Header4\" LeftIndent=\"0\" PointSize=\"18\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Header5\" Name=\"Header5\" LeftIndent=\"0\" PointSize=\"14\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList\" Name=\"NumList\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; BulList\" Name=\"NumList &gt; BulList\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">20</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; BulList &gt; first\" Name=\"NumList &gt; BulList &gt; first\" BulletsAndNumberingListType=\"BulletList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\" />\n              <Position type=\"unit\">20</Position>\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; NumList &gt; first &gt; beginsWith-3 &gt; lowerAlpha\" Name=\"NumList &gt; NumList &gt; NumList &gt; NumList &gt; first &gt; beginsWith-3 &gt; lowerAlpha\" NumberingExpression=\"^#.^t\" NumberingLevel=\"4\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"30\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">a, b, c, d...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; first &gt; beginsWith-6\" Name=\"NumList &gt; NumList &gt; NumList &gt; first &gt; beginsWith-6\" NumberingExpression=\"^#.^t\" NumberingLevel=\"3\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; first &gt; upperAlpha\" Name=\"NumList &gt; NumList &gt; NumList &gt; first &gt; upperAlpha\" NumberingExpression=\"^#.^t\" NumberingLevel=\"3\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">A, B, C, D...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; upperAlpha\" Name=\"NumList &gt; NumList &gt; NumList &gt; upperAlpha\" NumberingExpression=\"^#.^t\" NumberingLevel=\"3\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"20\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">A, B, C, D...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; beginsWith-4 &gt; lowerRoman\" Name=\"NumList &gt; NumList &gt; beginsWith-4 &gt; lowerRoman\" NumberingExpression=\"^#.^t\" NumberingLevel=\"2\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">i, ii, iii, iv...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; first\" Name=\"NumList &gt; NumList &gt; first\" NumberingExpression=\"^#.^t\" NumberingLevel=\"2\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; first &gt; beginsWith-4 &gt; lowerRoman\" Name=\"NumList &gt; NumList &gt; first &gt; beginsWith-4 &gt; lowerRoman\" NumberingExpression=\"^#.^t\" NumberingLevel=\"2\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">i, ii, iii, iv...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; NumList &gt; first &gt; upperRoman\" Name=\"NumList &gt; NumList &gt; first &gt; upperRoman\" NumberingExpression=\"^#.^t\" NumberingLevel=\"2\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"10\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">I, II, III, IV...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; Paragraph\" Name=\"NumList &gt; Paragraph\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; beginsWith-2 &gt; Paragraph\" Name=\"NumList &gt; beginsWith-2 &gt; Paragraph\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; first\" Name=\"NumList &gt; first\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; first &gt; Paragraph\" Name=\"NumList &gt; first &gt; Paragraph\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; first &gt; beginsWith-2 &gt; Paragraph\" Name=\"NumList &gt; first &gt; beginsWith-2 &gt; Paragraph\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; first &gt; upperAlpha\" Name=\"NumList &gt; first &gt; upperAlpha\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" BulletsAndNumberingListType=\"NumberedList\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n          <NumberingFormat type=\"string\">A, B, C, D...</NumberingFormat>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/NumList &gt; subParagraph &gt; Paragraph\" Name=\"NumList &gt; subParagraph &gt; Paragraph\" NumberingExpression=\"^#.^t\" NumberingLevel=\"1\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n      <ParagraphStyle Self=\"ParagraphStyle/Paragraph\" Name=\"Paragraph\" LeftIndent=\"0\">\n        <Properties>\n          <BasedOn type=\"object\">$ID/NormalParagraphStyle</BasedOn>\n        </Properties>\n      </ParagraphStyle>\n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#headers\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Headers</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-2-with-an-embedded-link\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 2 with an </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-1\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-2-with-an-embedded-link\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n      <Content>embedded link</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header3\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-3-with-emphasis\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 3 with </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-3-with-emphasis\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>emphasis</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header4\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-4\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 4</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header5\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-5\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 5</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-1\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-2-with-emphasis\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 2 with </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-2-with-emphasis\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>emphasis</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header3\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-3\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>with no blank line</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#level-2\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Level 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>with no blank line</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#paragraphs\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Paragraphs</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s a regular paragraph.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s one with a bullet. * criminey.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>There should be a hard line break</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>&#x2028;</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>here.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#block-quotes\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Block Quotes</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>E-mail style:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This is a block quote. It is pretty short.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Code in a block quote:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>sub status {\n    print &quot;working&quot;;\n}</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>A list:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>item one</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>item two</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Nested block quotes:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>nested</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>nested</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This should not be a block quote: 2 &gt; 1.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>And a following paragraph.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#code-blocks\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Code Blocks</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Code:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>And:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#lists\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Lists</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#unordered\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Unordered</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Asterisks tight:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>asterisk 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>asterisk 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>asterisk 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Asterisks loose:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>asterisk 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>asterisk 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>asterisk 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Pluses tight:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Pluses loose:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minuses tight:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minuses loose:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus 1</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#ordered\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Ordered</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Tight:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>First</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Second</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Third</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>and:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>One</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Two</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Three</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Loose using tabs:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>First</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Second</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Third</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>and using spaces:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>One</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Two</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Three</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiple paragraphs:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Item 1, graf one.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; subParagraph &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>\tItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Item 2.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Item 3.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#nested\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Nested</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Tab</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Tab</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; BulList &gt; BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Tab</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s another:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>First</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Second:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Fee</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Fie</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Foe</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Third</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Same thing but with paragraphs:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>First</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Second:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Fee</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Fie</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Foe</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Third</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#tabs-and-spaces\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Tabs and spaces</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is a list item indented with tabs</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is a list item indented with spaces</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; BulList &gt; first &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is an example list item indented with tabs</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; BulList &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>this is an example list item indented with spaces</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#fancy-list-markers\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Fancy list markers</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange NumberingStartAt=\"2\" AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first &gt; beginsWith-2 &gt; Paragraph\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>begins with 2</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; beginsWith-2 &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>and now 3</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; subParagraph &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>\twith a continuation</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange NumberingStartAt=\"4\" AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; first &gt; beginsWith-4 &gt; lowerRoman\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>sublist with roman numerals, starting with 4</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; beginsWith-4 &gt; lowerRoman\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>more items</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; first &gt; upperAlpha\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>a subsublist</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; upperAlpha\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>a subsublist</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Nesting:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first &gt; upperAlpha\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Upper Alpha</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; first &gt; upperRoman\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Upper Roman.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange NumberingStartAt=\"6\" AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; first &gt; beginsWith-6\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Decimal start with 6</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange NumberingStartAt=\"3\" AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; NumList &gt; NumList &gt; first &gt; beginsWith-3 &gt; lowerAlpha\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Lower alpha with paren</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Autonumbering:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Autonumber.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>More.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Nested.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Should not be a list item:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>M.A. 2007</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>B. Williams</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#definition-lists\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Definition Lists</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Tight using spaces:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>banana</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>yellow fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Tight using tabs:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>banana</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>yellow fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Loose:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>banana</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>yellow fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiple blocks with italics:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>contains seeds, crisp, pleasant to taste</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>{ orange code block }</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange block quote</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiple definitions, tight:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>computer</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>bank</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiple definitions, loose:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>computer</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>bank</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Blank line after term, indented marker, alternate markers:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>apple</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>red fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>computer</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListTerm\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>orange fruit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>sublist</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/DefListDef &gt; NumList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>sublist</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#html-blocks\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>HTML Blocks</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Simple block on one line:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>foo</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>And nested without indentation:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>foo</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>bar</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Interpreted markdown in a table:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>emphasized</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>And this is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold\">\n    <Content>strong</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s a simple block:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>foo</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This should be a code block, though:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>&lt;div&gt;\n    foo\n&lt;/div&gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>As should this:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>&lt;div&gt;foo&lt;/div&gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Now, nested:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>foo</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This should just be an HTML comment:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Multiline:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Code block:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>&lt;!-- Comment --&gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Just plain comment, with trailing spaces on the line:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Code:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>&lt;hr /&gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Hr’s:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#inline-markup\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Inline Markup</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>emphasized</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, and so </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>is this</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold\">\n    <Content>strong</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, and so </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold\">\n    <Content>is this</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>An </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-2\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic Link\">\n      <Content>emphasized link</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold Italic\">\n    <Content>This is strong and em.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>So is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold Italic\">\n    <Content>this</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> word.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold Italic\">\n    <Content>This is strong and em.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>So is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Bold Italic\">\n    <Content>this</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> word.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This is code: </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>&gt;</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>$</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>\\</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>\\$</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>&lt;html&gt;</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Strikeout\">\n    <Content>This is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic Strikeout\">\n    <Content>strikeout</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Strikeout\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Superscripts: a</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Superscript\">\n    <Content>bc</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>d a</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic Superscript\">\n    <Content>hello</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> a</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Superscript\">\n    <Content>hello there</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Subscripts: H</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Subscript\">\n    <Content>2</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>O, H</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Subscript\">\n    <Content>23</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>O, H</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Subscript\">\n    <Content>many of them</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>O.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#smart-quotes-ellipses-dashes\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Smart quotes, ellipses, dashes</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>“Hello,”</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> said the spider. </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>“</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘Shelob’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> is my name.”</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘A’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘B’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>, and </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘C’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> are letters.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘Oak,’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘elm,’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> and </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘beech’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> are names of trees. So is </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘pine.’</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘He said, </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>“I want to go.”</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> Were you alive in the 70’s?</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here is some quoted </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>‘</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>code</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>’</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> and a </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>“</Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-3\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>quoted link</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>”</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Some dashes: one—two — three—four — five.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Dashes between numbers: 5–7, 255–66, 1987–1999.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Ellipses…and…and….</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#latex\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>LaTeX</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>2</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>+</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>2</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>=</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>4</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>x</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>∈</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>y</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>α</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>∧</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>ω</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>223</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>p</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>-Tree</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s some display math: </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>$$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s one that has a line break in it: </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>α</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>+</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>ω</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>×</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> </Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>x</Content>\n  </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Superscript\">\n    <Content>2</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>These shouldn’t be math:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>To get the famous equation, write </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>$e = mc^2$</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>$22,000 is a </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>lot</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> of money. So is $34,000. (It worked if </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>“lot”</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> is emphasized.)</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Shoes ($20) and socks ($5).</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Escaped </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>$</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>: $73 </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>this should be emphasized</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> 23$.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s a LaTeX table:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#special-characters\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Special Characters</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here is some unicode:</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>I hat: Î</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>o umlaut: ö</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>section: §</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>set membership: ∈</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>copyright: ©</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>AT&amp;T has an ampersand in their name.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>AT&amp;T is another way to write it.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This &amp; that.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>4 &lt; 5.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>6 &gt; 5.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Backslash: \\</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Backtick: `</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Asterisk: *</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Underscore: _</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Left brace: {</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Right brace: }</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Left bracket: [</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Right bracket: ]</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Left paren: (</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Right paren: )</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Greater-than: &gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Hash: #</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Period: .</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Bang: !</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Plus: +</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Minus: -</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#links\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Links</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#explicit\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Explicit</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Just a </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-4\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>URL</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-5\" Name=\"title\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>URL and title</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-6\" Name=\"title preceded by two spaces\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>URL and title</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-7\" Name=\"title preceded by a tab\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>URL and title</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-8\" Name=\"title with &quot;quotes&quot; in it\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>URL and title</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-9\" Name=\"title with single quotes\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>URL and title</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-10\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>with_underscore</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-11\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>Email link</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-12\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>Empty</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#reference\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Reference</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Foo </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-13\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>bar</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>With </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-14\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>embedded [brackets]</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <HyperlinkTextSource Self=\"htss-15\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>b</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> by itself should be a link.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Indented </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-16\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>once</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Indented </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-17\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>twice</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Indented </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-18\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>thrice</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This should [not][] be a link.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>[not]: /url</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Foo </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-19\" Name=\"Title with &quot;quotes&quot; inside\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>bar</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Foo </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-20\" Name=\"Title with &quot;quote&quot; inside\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>biz</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#with-ampersands\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>With ampersands</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s a </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-21\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>link with an ampersand in the URL</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s a link with an amersand in the link text: </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-22\" Name=\"AT&amp;T\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>AT&amp;T</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s an </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-23\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>inline link</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here’s an </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-24\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>inline link in pointy braces</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header2\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#autolinks\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Autolinks</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>With an ampersand: </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-25\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>http://example.com/?foo=1&amp;bar=2</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>In a list?</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <HyperlinkTextSource Self=\"htss-26\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>http://example.com/</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/BulList\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>It should.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>An e-mail address: </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-27\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>nobody@nowhere.net</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Blockquoted: </Content>\n  </CharacterStyleRange>\n  <HyperlinkTextSource Self=\"htss-28\" Name=\"\" Hidden=\"false\">\n    <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n      <Content>http://example.com/</Content>\n    </CharacterStyleRange>\n  </HyperlinkTextSource>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Auto-links should not occur here: </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n    <Content>&lt;http://example.com/&gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/CodeBlock\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>or here: &lt;http://example.com/&gt;</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#images\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Images</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>From </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>“Voyage dans la Lune”</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> by Georges Melies (1902):</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Figure\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 75 -75\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-75 -75\" LeftDirection=\"-75 -75\" RightDirection=\"-75 -75\" />\n              <PathPointType Anchor=\"-75 75\" LeftDirection=\"-75 75\" RightDirection=\"-75 75\" />\n              <PathPointType Anchor=\"75 75\" LeftDirection=\"75 75\" RightDirection=\"75 75\" />\n              <PathPointType Anchor=\"75 -75\" LeftDirection=\"75 -75\" RightDirection=\"75 -75\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -75 -75\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"150\" Bottom=\"150\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:lalune.jpg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Caption\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>lalune</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here is a movie </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Rectangle Self=\"uec\" StrokeWeight=\"0\" ItemTransform=\"1 0 0 1 10 -11\">\n      <Properties>\n        <PathGeometry>\n          <GeometryPathType PathOpen=\"false\">\n            <PathPointArray>\n              <PathPointType Anchor=\"-10 -11\" LeftDirection=\"-10 -11\" RightDirection=\"-10 -11\" />\n              <PathPointType Anchor=\"-10 11\" LeftDirection=\"-10 11\" RightDirection=\"-10 11\" />\n              <PathPointType Anchor=\"10 11\" LeftDirection=\"10 11\" RightDirection=\"10 11\" />\n              <PathPointType Anchor=\"10 -11\" LeftDirection=\"10 -11\" RightDirection=\"10 -11\" />\n            </PathPointArray>\n          </GeometryPathType>\n        </PathGeometry>\n      </Properties>\n      <Image Self=\"ue6\" ItemTransform=\"1 0 0 1 -10 -11\">\n        <Properties>\n          <Profile type=\"string\">\n            $ID/Embedded\n          </Profile>\n          <GraphicBounds Left=\"0\" Top=\"0\" Right=\"20\" Bottom=\"22\" />\n        </Properties>\n        <Link Self=\"ueb\" LinkResourceURI=\"file:movie.jpg\" />\n      </Image>\n    </Rectangle>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> icon.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Header1\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <HyperlinkTextDestination Self=\"HyperlinkTextDestination/#footnotes\" Name=\"Destination\" DestinationUniqueKey=\"1\" />\n    <Content>Footnotes</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Here is a footnote reference,</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\" Position=\"Superscript\">\n    <Footnote>\n      <ParagraphStyleRange>\n        <CharacterStyleRange>\n          <Content><?ACE 4?></Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tHere is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n    </Footnote>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> and another.</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\" Position=\"Superscript\">\n    <Footnote>\n      <ParagraphStyleRange>\n        <CharacterStyleRange>\n          <Content><?ACE 4?></Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tHere’s the long note. This one contains multiple blocks.</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <Br />\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tSubsequent blocks are indented to show that they belong to the footnote (as with list items).</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <Br />\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; CodeBlock\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>  { &lt;code&gt; }</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <Br />\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n    </Footnote>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> This should </Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n    <Content>not</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content> be a footnote reference, because it contains a space.[^my note] Here is an inline note.</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\" Position=\"Superscript\">\n    <Footnote>\n      <ParagraphStyleRange>\n        <CharacterStyleRange>\n          <Content><?ACE 4?></Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tThis is </Content>\n        </CharacterStyleRange>\n        <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Italic\">\n          <Content>easier</Content>\n        </CharacterStyleRange>\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content> to type. Inline notes may contain </Content>\n        </CharacterStyleRange>\n        <HyperlinkTextSource Self=\"htss-29\" Name=\"\" Hidden=\"false\">\n          <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Link\">\n            <Content>links</Content>\n          </CharacterStyleRange>\n        </HyperlinkTextSource>\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content> and </Content>\n        </CharacterStyleRange>\n        <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/Code\">\n          <Content>]</Content>\n        </CharacterStyleRange>\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content> verbatim characters, as well as [bracketed text].</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n    </Footnote>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Blockquote &gt; Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>Notes can go in quotes.</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\" Position=\"Superscript\">\n    <Footnote>\n      <ParagraphStyleRange>\n        <CharacterStyleRange>\n          <Content><?ACE 4?></Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tIn quote.</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n    </Footnote>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/NumList &gt; first\" NumberingContinue=\"false\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>And in list items.</Content>\n  </CharacterStyleRange>\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\" Position=\"Superscript\">\n    <Footnote>\n      <ParagraphStyleRange>\n        <CharacterStyleRange>\n          <Content><?ACE 4?></Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n      <ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Footnote &gt; Paragraph\">\n        <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n          <Content>\tIn list.</Content>\n        </CharacterStyleRange>\n      </ParagraphStyleRange>\n    </Footnote>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n<Br />\n<ParagraphStyleRange AppliedParagraphStyle=\"ParagraphStyle/Paragraph\">\n  <CharacterStyleRange AppliedCharacterStyle=\"$ID/NormalCharacterStyle\">\n    <Content>This paragraph should not be part of the note, as it is not indented.</Content>\n  </CharacterStyleRange>\n</ParagraphStyleRange>\n\n  </Story>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//google.com\" Name=\"link\" DestinationURL=\"http://google.com\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-29\" Name=\"http://google.com\" Source=\"htss-29\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//google.com</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//example.com/\" Name=\"link\" DestinationURL=\"http://example.com/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-28\" Name=\"http://example.com/\" Source=\"htss-28\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//example.com/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/mailto%3anobody@nowhere.net\" Name=\"link\" DestinationURL=\"mailto:nobody@nowhere.net\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-27\" Name=\"mailto:nobody@nowhere.net\" Source=\"htss-27\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/mailto%3anobody@nowhere.net</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//example.com/\" Name=\"link\" DestinationURL=\"http://example.com/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-26\" Name=\"http://example.com/\" Source=\"htss-26\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//example.com/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2\" Name=\"link\" DestinationURL=\"http://example.com/?foo=1&amp;bar=2\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-25\" Name=\"http://example.com/?foo=1&amp;bar=2\" Source=\"htss-25\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//script?foo=1&amp;bar=2\" Name=\"link\" DestinationURL=\"/script?foo=1&amp;bar=2\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-24\" Name=\"/script?foo=1&amp;bar=2\" Source=\"htss-24\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//script?foo=1&amp;bar=2</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//script?foo=1&amp;bar=2\" Name=\"link\" DestinationURL=\"/script?foo=1&amp;bar=2\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-23\" Name=\"/script?foo=1&amp;bar=2\" Source=\"htss-23\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//script?foo=1&amp;bar=2</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//att.com/\" Name=\"link\" DestinationURL=\"http://att.com/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-22\" Name=\"http://att.com/\" Source=\"htss-22\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//att.com/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2\" Name=\"link\" DestinationURL=\"http://example.com/?foo=1&amp;bar=2\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-21\" Name=\"http://example.com/?foo=1&amp;bar=2\" Source=\"htss-21\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-20\" Name=\"/url/\" Source=\"htss-20\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-19\" Name=\"/url/\" Source=\"htss-19\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url\" Name=\"link\" DestinationURL=\"/url\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-18\" Name=\"/url\" Source=\"htss-18\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url\" Name=\"link\" DestinationURL=\"/url\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-17\" Name=\"/url\" Source=\"htss-17\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url\" Name=\"link\" DestinationURL=\"/url\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-16\" Name=\"/url\" Source=\"htss-16\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-15\" Name=\"/url/\" Source=\"htss-15\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-14\" Name=\"/url/\" Source=\"htss-14\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-13\" Name=\"/url/\" Source=\"htss-13\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/\" Name=\"link\" DestinationURL=\"\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-12\" Name=\"\" Source=\"htss-12\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/mailto%3anobody@nowhere.net\" Name=\"link\" DestinationURL=\"mailto:nobody@nowhere.net\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-11\" Name=\"mailto:nobody@nowhere.net\" Source=\"htss-11\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/mailto%3anobody@nowhere.net</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/with_underscore\" Name=\"link\" DestinationURL=\"/url/with_underscore\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-10\" Name=\"/url/with_underscore\" Source=\"htss-10\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/with_underscore</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-9\" Name=\"/url/\" Source=\"htss-9\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-8\" Name=\"/url/\" Source=\"htss-8\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-7\" Name=\"/url/\" Source=\"htss-7\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-6\" Name=\"/url/\" Source=\"htss-6\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-5\" Name=\"/url/\" Source=\"htss-5\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url/\" Name=\"link\" DestinationURL=\"/url/\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-4\" Name=\"/url/\" Source=\"htss-4\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url/</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2\" Name=\"link\" DestinationURL=\"http://example.com/?foo=1&amp;bar=2\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-3\" Name=\"http://example.com/?foo=1&amp;bar=2\" Source=\"htss-3\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url\" Name=\"link\" DestinationURL=\"/url\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-2\" Name=\"/url\" Source=\"htss-2\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url</Destination>\n    </Properties>\n  </Hyperlink>\n  <HyperlinkURLDestination Self=\"HyperlinkURLDestination//url\" Name=\"link\" DestinationURL=\"/url\" DestinationUniqueKey=\"1\" />\n  <Hyperlink Self=\"uf-1\" Name=\"/url\" Source=\"htss-1\" Visible=\"false\" DestinationUniqueKey=\"1\">\n    <Properties>\n      <BorderColor type=\"enumeration\">Black</BorderColor>\n      <Destination type=\"object\">HyperlinkURLDestination//url</Destination>\n    </Properties>\n  </Hyperlink>\n</Document>\n"
  },
  {
    "path": "test/writer.jats_archiving",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN\"\n                  \"JATS-archivearticle1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>Pandoc Test Suite</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>John MacFarlane</string-name>\n</contrib>\n<contrib contrib-type=\"author\">\n<string-name>Anonymous</string-name>\n</contrib>\n</contrib-group>\n<pub-date date-type=\"pub\" publication-format=\"electronic\" iso-8601-date=\"2006-07-17\">\n<day>17</day>\n<month>7</month>\n<year>2006</year>\n</pub-date>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<p>This is a set of tests for pandoc. Most of them are adapted from John\nGruber’s markdown test suite.</p>\n<sec id=\"headers\">\n  <title>Headers</title>\n  <sec id=\"level-2-with-an-embedded-link\">\n    <title>Level 2 with an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">embedded\n    link</ext-link></title>\n    <sec id=\"level-3-with-emphasis\">\n      <title>Level 3 with <italic>emphasis</italic></title>\n      <sec id=\"level-4\">\n        <title>Level 4</title>\n        <sec id=\"level-5\">\n          <title>Level 5</title>\n        </sec>\n      </sec>\n    </sec>\n  </sec>\n</sec>\n<sec id=\"level-1\">\n  <title>Level 1</title>\n  <sec id=\"level-2-with-emphasis\">\n    <title>Level 2 with <italic>emphasis</italic></title>\n    <sec id=\"level-3\">\n      <title>Level 3</title>\n      <p>with no blank line</p>\n    </sec>\n  </sec>\n  <sec id=\"level-2\">\n    <title>Level 2</title>\n    <p>with no blank line</p>\n  </sec>\n</sec>\n<sec id=\"paragraphs\">\n  <title>Paragraphs</title>\n  <p>Here’s a regular paragraph.</p>\n  <p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\n  Because a hard-wrapped line in the middle of a paragraph looked like a list\n  item.</p>\n  <p>Here’s one with a bullet. * criminey.</p>\n  <p>There should be a hard line break\n  here.</p>\n</sec>\n<sec id=\"block-quotes\">\n  <title>Block Quotes</title>\n  <p>E-mail style:</p>\n  <disp-quote>\n    <p>This is a block quote. It is pretty short.</p>\n  </disp-quote>\n  <disp-quote>\n    <p>Code in a block quote:</p>\n    <preformat>sub status {\n    print &quot;working&quot;;\n}</preformat>\n    <p>A list:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>item one</p>\n      </list-item>\n      <list-item>\n        <p>item two</p>\n      </list-item>\n    </list>\n    <p>Nested block quotes:</p>\n    <disp-quote>\n      <p>nested</p>\n    </disp-quote>\n    <disp-quote>\n      <p>nested</p>\n    </disp-quote>\n  </disp-quote>\n  <p>This should not be a block quote: 2 &gt; 1.</p>\n  <p>And a following paragraph.</p>\n</sec>\n<sec id=\"code-blocks\">\n  <title>Code Blocks</title>\n  <p>Code:</p>\n  <preformat>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</preformat>\n  <p>And:</p>\n  <preformat>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</preformat>\n</sec>\n<sec id=\"lists\">\n  <title>Lists</title>\n  <sec id=\"unordered\">\n    <title>Unordered</title>\n    <p>Asterisks tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Asterisks loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Pluses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Pluses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"ordered\">\n    <title>Ordered</title>\n    <p>Tight:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Loose using tabs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and using spaces:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Multiple paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Item 1, graf one.</p>\n        <p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n        back.</p>\n      </list-item>\n      <list-item>\n        <p>Item 2.</p>\n      </list-item>\n      <list-item>\n        <p>Item 3.</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"nested\">\n    <title>Nested</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Tab</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Tab</p>\n            <list list-type=\"bullet\">\n              <list-item>\n                <p>Tab</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Here’s another:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>Same thing but with paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"tabs-and-spaces\">\n    <title>Tabs and spaces</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>this is a list item indented with tabs</p>\n      </list-item>\n      <list-item>\n        <p>this is a list item indented with spaces</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>this is an example list item indented with tabs</p>\n          </list-item>\n          <list-item>\n            <p>this is an example list item indented with spaces</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"fancy-list-markers\">\n    <title>Fancy list markers</title>\n    <list list-type=\"order\">\n      <list-item>\n        <label>(2)</label>\n        <p>begins with 2</p>\n      </list-item>\n      <list-item>\n        <label>(3)</label>\n        <p>and now 3</p>\n        <p>with a continuation</p>\n        <list list-type=\"roman-lower\">\n          <list-item>\n            <label>iv.</label>\n            <p>sublist with roman numerals, starting with 4</p>\n          </list-item>\n          <list-item>\n            <label>v.</label>\n            <p>more items</p>\n            <list list-type=\"alpha-upper\">\n              <list-item>\n                <label>(A)</label>\n                <p>a subsublist</p>\n              </list-item>\n              <list-item>\n                <label>(B)</label>\n                <p>a subsublist</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Nesting:</p>\n    <list list-type=\"alpha-upper\">\n      <list-item>\n        <p>Upper Alpha</p>\n        <list list-type=\"roman-upper\">\n          <list-item>\n            <p>Upper Roman.</p>\n            <list list-type=\"order\">\n              <list-item>\n                <label>(6)</label>\n                <p>Decimal start with 6</p>\n                <list list-type=\"alpha-lower\">\n                  <list-item>\n                    <label>c)</label>\n                    <p>Lower alpha with paren</p>\n                  </list-item>\n                </list>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Autonumbering:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Autonumber.</p>\n      </list-item>\n      <list-item>\n        <p>More.</p>\n        <list list-type=\"order\">\n          <list-item>\n            <p>Nested.</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Should not be a list item:</p>\n    <p>M.A. 2007</p>\n    <p>B. Williams</p>\n  </sec>\n</sec>\n<sec id=\"definition-lists\">\n  <title>Definition Lists</title>\n  <p>Tight using spaces:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Tight using tabs:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Loose:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple blocks with italics:</p>\n  <def-list>\n    <def-item>\n      <term><italic>apple</italic></term>\n      <def>\n        <p>red fruit</p>\n        <p>contains seeds, crisp, pleasant to taste</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term><italic>orange</italic></term>\n      <def>\n        <p>orange fruit</p>\n        <p specific-use=\"wrapper\">\n          <preformat>{ orange code block }</preformat>\n        </p>\n        <p specific-use=\"wrapper\">\n          <disp-quote>\n            <p>orange block quote</p>\n          </disp-quote>\n        </p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple definitions, tight:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p>bank</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple definitions, loose:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p>bank</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Blank line after term, indented marker, alternate markers:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p specific-use=\"wrapper\">\n          <list list-type=\"order\">\n            <list-item>\n              <p>sublist</p>\n            </list-item>\n            <list-item>\n              <p>sublist</p>\n            </list-item>\n          </list>\n        </p>\n      </def>\n    </def-item>\n  </def-list>\n</sec>\n<sec id=\"html-blocks\">\n  <title>HTML Blocks</title>\n  <p>Simple block on one line:</p>\n  <p>foo</p>\n  <p>And nested without indentation:</p>\n  <p>foo</p>\n  <p>bar</p>\n  <p>Interpreted markdown in a table:</p>\n  <p>This is <italic>emphasized</italic></p>\n  <p>And this is <bold>strong</bold></p>\n  <p>Here’s a simple block:</p>\n  <p>foo</p>\n  <p>This should be a code block, though:</p>\n  <preformat>&lt;div&gt;\n    foo\n&lt;/div&gt;</preformat>\n  <p>As should this:</p>\n  <preformat>&lt;div&gt;foo&lt;/div&gt;</preformat>\n  <p>Now, nested:</p>\n  <p>foo</p>\n  <p>This should just be an HTML comment:</p>\n  <p>Multiline:</p>\n  <p>Code block:</p>\n  <preformat>&lt;!-- Comment --&gt;</preformat>\n  <p>Just plain comment, with trailing spaces on the line:</p>\n  <p>Code:</p>\n  <preformat>&lt;hr /&gt;</preformat>\n  <p>Hr’s:</p>\n</sec>\n<sec id=\"inline-markup\">\n  <title>Inline Markup</title>\n  <p>This is <italic>emphasized</italic>, and so <italic>is this</italic>.</p>\n  <p>This is <bold>strong</bold>, and so <bold>is this</bold>.</p>\n  <p>An <italic><ext-link ext-link-type=\"uri\" xlink:href=\"/url\">emphasized\n  link</ext-link></italic>.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p>This is code: <monospace>&gt;</monospace>, <monospace>$</monospace>,\n  <monospace>\\</monospace>, <monospace>\\$</monospace>,\n  <monospace>&lt;html&gt;</monospace>.</p>\n  <p><strike>This is <italic>strikeout</italic>.</strike></p>\n  <p>Superscripts: a<sup>bc</sup>d a<sup><italic>hello</italic></sup>\n  a<sup>hello there</sup>.</p>\n  <p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n  <p>These should not be superscripts or subscripts, because of the unescaped\n  spaces: a^b c^d, a~b c~d.</p>\n</sec>\n<sec id=\"smart-quotes-ellipses-dashes\">\n  <title>Smart quotes, ellipses, dashes</title>\n  <p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>\n  <p>‘A’, ‘B’, and ‘C’ are letters.</p>\n  <p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p>\n  <p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p>\n  <p>Here is some quoted ‘<monospace>code</monospace>’ and a\n  “<ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">quoted\n  link</ext-link>”.</p>\n  <p>Some dashes: one—two — three—four — five.</p>\n  <p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n  <p>Ellipses…and…and….</p>\n</sec>\n<sec id=\"latex\">\n  <title>LaTeX</title>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[2+2=4]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mn>2</mml:mn><mml:mo>+</mml:mo><mml:mn>2</mml:mn><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[x \\in y]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[\\alpha \\wedge \\omega]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>α</mml:mi><mml:mo>∧</mml:mo><mml:mi>ω</mml:mi></mml:mrow></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[223]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mn>223</mml:mn></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[p]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mi>p</mml:mi></mml:math></alternatives></inline-formula>-Tree</p>\n    </list-item>\n    <list-item>\n      <p>Here’s some display math: <disp-formula><alternatives>\n      <tex-math><![CDATA[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}]]></tex-math>\n      <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mfrac><mml:mi>d</mml:mi><mml:mrow><mml:mi>d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mfrac><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mi mathvariant=\"normal\">lim</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mo>→</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:munder><mml:mfrac><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo><mml:mo>−</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo></mml:mrow><mml:mi>h</mml:mi></mml:mfrac></mml:mrow></mml:math></alternatives></disp-formula></p>\n    </list-item>\n    <list-item>\n      <p>Here’s one that has a line break in it: <inline-formula><alternatives>\n      <tex-math><![CDATA[\\alpha + \\omega \\times x^2]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>α</mml:mi><mml:mo>+</mml:mo><mml:mi>ω</mml:mi><mml:mo>×</mml:mo><mml:msup><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives></inline-formula>.</p>\n    </list-item>\n  </list>\n  <p>These shouldn’t be math:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>To get the famous equation, write\n      <monospace>$e = mc^2$</monospace>.</p>\n    </list-item>\n    <list-item>\n      <p>$22,000 is a <italic>lot</italic> of money. So is $34,000. (It worked\n      if “lot” is emphasized.)</p>\n    </list-item>\n    <list-item>\n      <p>Shoes ($20) and socks ($5).</p>\n    </list-item>\n    <list-item>\n      <p>Escaped <monospace>$</monospace>: $73 <italic>this should be\n      emphasized</italic> 23$.</p>\n    </list-item>\n  </list>\n  <p>Here’s a LaTeX table:</p>\n</sec>\n<sec id=\"special-characters\">\n  <title>Special Characters</title>\n  <p>Here is some unicode:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>I hat: Î</p>\n    </list-item>\n    <list-item>\n      <p>o umlaut: ö</p>\n    </list-item>\n    <list-item>\n      <p>section: §</p>\n    </list-item>\n    <list-item>\n      <p>set membership: ∈</p>\n    </list-item>\n    <list-item>\n      <p>copyright: ©</p>\n    </list-item>\n  </list>\n  <p>AT&amp;T has an ampersand in their name.</p>\n  <p>AT&amp;T is another way to write it.</p>\n  <p>This &amp; that.</p>\n  <p>4 &lt; 5.</p>\n  <p>6 &gt; 5.</p>\n  <p>Backslash: \\</p>\n  <p>Backtick: `</p>\n  <p>Asterisk: *</p>\n  <p>Underscore: _</p>\n  <p>Left brace: {</p>\n  <p>Right brace: }</p>\n  <p>Left bracket: [</p>\n  <p>Right bracket: ]</p>\n  <p>Left paren: (</p>\n  <p>Right paren: )</p>\n  <p>Greater-than: &gt;</p>\n  <p>Hash: #</p>\n  <p>Period: .</p>\n  <p>Bang: !</p>\n  <p>Plus: +</p>\n  <p>Minus: -</p>\n</sec>\n<sec id=\"links\">\n  <title>Links</title>\n  <sec id=\"explicit\">\n    <title>Explicit</title>\n    <p>Just a\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">URL</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by two spaces\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by a tab\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with &quot;quotes&quot; in it\">URL\n    and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with single quotes\">URL\n    and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/with_underscore\">with_underscore</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"mailto:nobody@nowhere.net\">Email\n    link</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"\">Empty</ext-link>.</p>\n  </sec>\n  <sec id=\"reference\">\n    <title>Reference</title>\n    <p>Foo <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">bar</ext-link>.</p>\n    <p>With <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">embedded\n    [brackets]</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">b</ext-link> by itself\n    should be a link.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">once</ext-link>.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">twice</ext-link>.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">thrice</ext-link>.</p>\n    <p>This should [not][] be a link.</p>\n    <preformat>[not]: /url</preformat>\n    <p>Foo\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quotes&quot; inside\">bar</ext-link>.</p>\n    <p>Foo\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quote&quot; inside\">biz</ext-link>.</p>\n  </sec>\n  <sec id=\"with-ampersands\">\n    <title>With ampersands</title>\n    <p>Here’s a\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">link\n    with an ampersand in the URL</ext-link>.</p>\n    <p>Here’s a link with an amersand in the link text:\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://att.com/\" xlink:title=\"AT&amp;T\">AT&amp;T</ext-link>.</p>\n    <p>Here’s an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n    link</ext-link>.</p>\n    <p>Here’s an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n    link in pointy braces</ext-link>.</p>\n  </sec>\n  <sec id=\"autolinks\">\n    <title>Autolinks</title>\n    <p>With an ampersand:\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</ext-link></p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>In a list?</p>\n      </list-item>\n      <list-item>\n        <p><ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n      </list-item>\n      <list-item>\n        <p>It should.</p>\n      </list-item>\n    </list>\n    <p>An e-mail address: <email>nobody@nowhere.net</email></p>\n    <disp-quote>\n      <p>Blockquoted:\n      <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n    </disp-quote>\n    <p>Auto-links should not occur here:\n    <monospace>&lt;http://example.com/&gt;</monospace></p>\n    <preformat>or here: &lt;http://example.com/&gt;</preformat>\n  </sec>\n</sec>\n<sec id=\"images\">\n  <title>Images</title>\n  <p>From “Voyage dans la Lune” by Georges Melies (1902):</p>\n  <fig>\n    <caption><p>lalune</p></caption>\n    <graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"lalune.jpg\" xlink:title=\"Voyage dans la Lune\" />\n  </fig>\n  <p>Here is a movie\n  <inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"movie.jpg\">\n    <alt-text>movie</alt-text>\n  </inline-graphic> icon.</p>\n</sec>\n<sec id=\"footnotes\">\n  <title>Footnotes</title>\n  <p>Here is a footnote reference,<xref ref-type=\"fn\" rid=\"fn1\">1</xref> and\n  another.<xref ref-type=\"fn\" rid=\"fn2\">2</xref> This should\n  <italic>not</italic> be a footnote reference, because it contains a space.[^my\n  note] Here is an inline note.<xref ref-type=\"fn\" rid=\"fn3\">3</xref></p>\n  <disp-quote>\n    <p>Notes can go in quotes.<xref ref-type=\"fn\" rid=\"fn4\">4</xref></p>\n  </disp-quote>\n  <list list-type=\"order\">\n    <list-item>\n      <p>And in list items.<xref ref-type=\"fn\" rid=\"fn5\">5</xref></p>\n    </list-item>\n  </list>\n  <p>This paragraph should not be part of the note, as it is not indented.</p>\n</sec>\n</body>\n<back>\n<fn-group>\n  <fn id=\"fn1\">\n    <label>1</label><p>Here is the footnote. It can go anywhere after the\n    footnote reference. It need not be placed at the end of the document.</p>\n  </fn>\n  <fn id=\"fn2\">\n    <label>2</label><p>Here’s the long note. This one contains multiple\n    blocks.</p>\n    <p>Subsequent blocks are indented to show that they belong to the footnote\n    (as with list items).</p>\n    <p specific-use=\"wrapper\">\n      <preformat>  { &lt;code&gt; }</preformat>\n    </p>\n    <p>If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.</p>\n  </fn>\n  <fn id=\"fn3\">\n    <label>3</label><p>This is <italic>easier</italic> to type. Inline notes may\n    contain\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://google.com\">links</ext-link>\n    and <monospace>]</monospace> verbatim characters, as well as [bracketed\n    text].</p>\n  </fn>\n  <fn id=\"fn4\">\n    <label>4</label><p>In quote.</p>\n  </fn>\n  <fn id=\"fn5\">\n    <label>5</label><p>In list.</p>\n  </fn>\n</fn-group>\n</back>\n</article>\n"
  },
  {
    "path": "test/writer.jats_articleauthoring",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Article Authoring DTD v1.2 20190208//EN\"\n                  \"JATS-articleauthoring1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<article-meta>\n<title-group>\n<article-title>Pandoc Test Suite</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>John MacFarlane</string-name>\n</contrib>\n<contrib contrib-type=\"author\">\n<string-name>Anonymous</string-name>\n</contrib>\n</contrib-group>\n<permissions>\n</permissions>\n<abstract>\n\n</abstract>\n</article-meta>\n</front>\n<body>\n<p>This is a set of tests for pandoc. Most of them are adapted from John\nGruber’s markdown test suite.</p>\n<sec id=\"headers\">\n  <title>Headers</title>\n  <sec id=\"level-2-with-an-embedded-link\">\n    <title>Level 2 with an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">embedded\n    link</ext-link></title>\n    <sec id=\"level-3-with-emphasis\">\n      <title>Level 3 with <italic>emphasis</italic></title>\n      <sec id=\"level-4\">\n        <title>Level 4</title>\n        <sec id=\"level-5\">\n          <title>Level 5</title>\n        </sec>\n      </sec>\n    </sec>\n  </sec>\n</sec>\n<sec id=\"level-1\">\n  <title>Level 1</title>\n  <sec id=\"level-2-with-emphasis\">\n    <title>Level 2 with <italic>emphasis</italic></title>\n    <sec id=\"level-3\">\n      <title>Level 3</title>\n      <p>with no blank line</p>\n    </sec>\n  </sec>\n  <sec id=\"level-2\">\n    <title>Level 2</title>\n    <p>with no blank line</p>\n  </sec>\n</sec>\n<sec id=\"paragraphs\">\n  <title>Paragraphs</title>\n  <p>Here’s a regular paragraph.</p>\n  <p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\n  Because a hard-wrapped line in the middle of a paragraph looked like a list\n  item.</p>\n  <p>Here’s one with a bullet. * criminey.</p>\n  <p>There should be a hard line break\n  here.</p>\n</sec>\n<sec id=\"block-quotes\">\n  <title>Block Quotes</title>\n  <p>E-mail style:</p>\n  <disp-quote>\n    <p>This is a block quote. It is pretty short.</p>\n  </disp-quote>\n  <disp-quote>\n    <p>Code in a block quote:</p>\n    <p specific-use=\"wrapper\">\n      <preformat>sub status {\n    print &quot;working&quot;;\n}</preformat>\n    </p>\n    <p>A list:</p>\n    <p specific-use=\"wrapper\">\n      <list list-type=\"order\">\n        <list-item>\n          <p>item one</p>\n        </list-item>\n        <list-item>\n          <p>item two</p>\n        </list-item>\n      </list>\n    </p>\n    <p>Nested block quotes:</p>\n    <p specific-use=\"wrapper\">\n      <disp-quote>\n        <p>nested</p>\n      </disp-quote>\n    </p>\n    <p specific-use=\"wrapper\">\n      <disp-quote>\n        <p>nested</p>\n      </disp-quote>\n    </p>\n  </disp-quote>\n  <p>This should not be a block quote: 2 &gt; 1.</p>\n  <p>And a following paragraph.</p>\n</sec>\n<sec id=\"code-blocks\">\n  <title>Code Blocks</title>\n  <p>Code:</p>\n  <preformat>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</preformat>\n  <p>And:</p>\n  <preformat>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</preformat>\n</sec>\n<sec id=\"lists\">\n  <title>Lists</title>\n  <sec id=\"unordered\">\n    <title>Unordered</title>\n    <p>Asterisks tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Asterisks loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Pluses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Pluses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"ordered\">\n    <title>Ordered</title>\n    <p>Tight:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Loose using tabs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and using spaces:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Multiple paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Item 1, graf one.</p>\n        <p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n        back.</p>\n      </list-item>\n      <list-item>\n        <p>Item 2.</p>\n      </list-item>\n      <list-item>\n        <p>Item 3.</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"nested\">\n    <title>Nested</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Tab</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Tab</p>\n            <list list-type=\"bullet\">\n              <list-item>\n                <p>Tab</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Here’s another:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>Same thing but with paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"tabs-and-spaces\">\n    <title>Tabs and spaces</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>this is a list item indented with tabs</p>\n      </list-item>\n      <list-item>\n        <p>this is a list item indented with spaces</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>this is an example list item indented with tabs</p>\n          </list-item>\n          <list-item>\n            <p>this is an example list item indented with spaces</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"fancy-list-markers\">\n    <title>Fancy list markers</title>\n    <list list-type=\"order\">\n      <list-item>\n        <label>(2)</label>\n        <p>begins with 2</p>\n      </list-item>\n      <list-item>\n        <label>(3)</label>\n        <p>and now 3</p>\n        <p>with a continuation</p>\n        <list list-type=\"order\">\n          <list-item>\n            <label>iv.</label>\n            <p>sublist with roman numerals, starting with 4</p>\n          </list-item>\n          <list-item>\n            <label>v.</label>\n            <p>more items</p>\n            <list list-type=\"order\">\n              <list-item>\n                <label>(A)</label>\n                <p>a subsublist</p>\n              </list-item>\n              <list-item>\n                <label>(B)</label>\n                <p>a subsublist</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Nesting:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Upper Alpha</p>\n        <list list-type=\"order\">\n          <list-item>\n            <p>Upper Roman.</p>\n            <list list-type=\"order\">\n              <list-item>\n                <label>(6)</label>\n                <p>Decimal start with 6</p>\n                <list list-type=\"order\">\n                  <list-item>\n                    <label>c)</label>\n                    <p>Lower alpha with paren</p>\n                  </list-item>\n                </list>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Autonumbering:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Autonumber.</p>\n      </list-item>\n      <list-item>\n        <p>More.</p>\n        <list list-type=\"order\">\n          <list-item>\n            <p>Nested.</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Should not be a list item:</p>\n    <p>M.A. 2007</p>\n    <p>B. Williams</p>\n  </sec>\n</sec>\n<sec id=\"definition-lists\">\n  <title>Definition Lists</title>\n  <p>Tight using spaces:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Tight using tabs:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Loose:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple blocks with italics:</p>\n  <def-list>\n    <def-item>\n      <term><italic>apple</italic></term>\n      <def>\n        <p>red fruit</p>\n        <p>contains seeds, crisp, pleasant to taste</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term><italic>orange</italic></term>\n      <def>\n        <p>orange fruit</p>\n        <p specific-use=\"wrapper\">\n          <preformat>{ orange code block }</preformat>\n        </p>\n        <p specific-use=\"wrapper\">\n          <disp-quote>\n            <p>orange block quote</p>\n          </disp-quote>\n        </p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple definitions, tight:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p>bank</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple definitions, loose:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p>bank</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Blank line after term, indented marker, alternate markers:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p specific-use=\"wrapper\">\n          <list list-type=\"order\">\n            <list-item>\n              <p>sublist</p>\n            </list-item>\n            <list-item>\n              <p>sublist</p>\n            </list-item>\n          </list>\n        </p>\n      </def>\n    </def-item>\n  </def-list>\n</sec>\n<sec id=\"html-blocks\">\n  <title>HTML Blocks</title>\n  <p>Simple block on one line:</p>\n  <p>foo</p>\n  <p>And nested without indentation:</p>\n  <p>foo</p>\n  <p>bar</p>\n  <p>Interpreted markdown in a table:</p>\n  <p>This is <italic>emphasized</italic></p>\n  <p>And this is <bold>strong</bold></p>\n  <p>Here’s a simple block:</p>\n  <p>foo</p>\n  <p>This should be a code block, though:</p>\n  <preformat>&lt;div&gt;\n    foo\n&lt;/div&gt;</preformat>\n  <p>As should this:</p>\n  <preformat>&lt;div&gt;foo&lt;/div&gt;</preformat>\n  <p>Now, nested:</p>\n  <p>foo</p>\n  <p>This should just be an HTML comment:</p>\n  <p>Multiline:</p>\n  <p>Code block:</p>\n  <preformat>&lt;!-- Comment --&gt;</preformat>\n  <p>Just plain comment, with trailing spaces on the line:</p>\n  <p>Code:</p>\n  <preformat>&lt;hr /&gt;</preformat>\n  <p>Hr’s:</p>\n</sec>\n<sec id=\"inline-markup\">\n  <title>Inline Markup</title>\n  <p>This is <italic>emphasized</italic>, and so <italic>is this</italic>.</p>\n  <p>This is <bold>strong</bold>, and so <bold>is this</bold>.</p>\n  <p>An <italic><ext-link ext-link-type=\"uri\" xlink:href=\"/url\">emphasized\n  link</ext-link></italic>.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p>This is code: <monospace>&gt;</monospace>, <monospace>$</monospace>,\n  <monospace>\\</monospace>, <monospace>\\$</monospace>,\n  <monospace>&lt;html&gt;</monospace>.</p>\n  <p><strike>This is <italic>strikeout</italic>.</strike></p>\n  <p>Superscripts: a<sup>bc</sup>d a<sup><italic>hello</italic></sup>\n  a<sup>hello there</sup>.</p>\n  <p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n  <p>These should not be superscripts or subscripts, because of the unescaped\n  spaces: a^b c^d, a~b c~d.</p>\n</sec>\n<sec id=\"smart-quotes-ellipses-dashes\">\n  <title>Smart quotes, ellipses, dashes</title>\n  <p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>\n  <p>‘A’, ‘B’, and ‘C’ are letters.</p>\n  <p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p>\n  <p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p>\n  <p>Here is some quoted ‘<monospace>code</monospace>’ and a\n  “<ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">quoted\n  link</ext-link>”.</p>\n  <p>Some dashes: one—two — three—four — five.</p>\n  <p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n  <p>Ellipses…and…and….</p>\n</sec>\n<sec id=\"latex\">\n  <title>LaTeX</title>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mn>2</mml:mn><mml:mo>+</mml:mo><mml:mn>2</mml:mn><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:math></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:math></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>α</mml:mi><mml:mo>∧</mml:mo><mml:mi>ω</mml:mi></mml:mrow></mml:math></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mn>223</mml:mn></mml:math></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mi>p</mml:mi></mml:math></inline-formula>-Tree</p>\n    </list-item>\n    <list-item>\n      <p>Here’s some display math:\n      <disp-formula><mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mfrac><mml:mi>d</mml:mi><mml:mrow><mml:mi>d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mfrac><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mi mathvariant=\"normal\">lim</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mo>→</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:munder><mml:mfrac><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo><mml:mo>−</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo></mml:mrow><mml:mi>h</mml:mi></mml:mfrac></mml:mrow></mml:math></disp-formula></p>\n    </list-item>\n    <list-item>\n      <p>Here’s one that has a line break in it:\n      <inline-formula><mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>α</mml:mi><mml:mo>+</mml:mo><mml:mi>ω</mml:mi><mml:mo>×</mml:mo><mml:msup><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>.</p>\n    </list-item>\n  </list>\n  <p>These shouldn’t be math:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>To get the famous equation, write\n      <monospace>$e = mc^2$</monospace>.</p>\n    </list-item>\n    <list-item>\n      <p>$22,000 is a <italic>lot</italic> of money. So is $34,000. (It worked\n      if “lot” is emphasized.)</p>\n    </list-item>\n    <list-item>\n      <p>Shoes ($20) and socks ($5).</p>\n    </list-item>\n    <list-item>\n      <p>Escaped <monospace>$</monospace>: $73 <italic>this should be\n      emphasized</italic> 23$.</p>\n    </list-item>\n  </list>\n  <p>Here’s a LaTeX table:</p>\n</sec>\n<sec id=\"special-characters\">\n  <title>Special Characters</title>\n  <p>Here is some unicode:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>I hat: Î</p>\n    </list-item>\n    <list-item>\n      <p>o umlaut: ö</p>\n    </list-item>\n    <list-item>\n      <p>section: §</p>\n    </list-item>\n    <list-item>\n      <p>set membership: ∈</p>\n    </list-item>\n    <list-item>\n      <p>copyright: ©</p>\n    </list-item>\n  </list>\n  <p>AT&amp;T has an ampersand in their name.</p>\n  <p>AT&amp;T is another way to write it.</p>\n  <p>This &amp; that.</p>\n  <p>4 &lt; 5.</p>\n  <p>6 &gt; 5.</p>\n  <p>Backslash: \\</p>\n  <p>Backtick: `</p>\n  <p>Asterisk: *</p>\n  <p>Underscore: _</p>\n  <p>Left brace: {</p>\n  <p>Right brace: }</p>\n  <p>Left bracket: [</p>\n  <p>Right bracket: ]</p>\n  <p>Left paren: (</p>\n  <p>Right paren: )</p>\n  <p>Greater-than: &gt;</p>\n  <p>Hash: #</p>\n  <p>Period: .</p>\n  <p>Bang: !</p>\n  <p>Plus: +</p>\n  <p>Minus: -</p>\n</sec>\n<sec id=\"links\">\n  <title>Links</title>\n  <sec id=\"explicit\">\n    <title>Explicit</title>\n    <p>Just a\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">URL</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by two spaces\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by a tab\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with &quot;quotes&quot; in it\">URL\n    and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with single quotes\">URL\n    and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/with_underscore\">with_underscore</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"mailto:nobody@nowhere.net\">Email\n    link</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"\">Empty</ext-link>.</p>\n  </sec>\n  <sec id=\"reference\">\n    <title>Reference</title>\n    <p>Foo <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">bar</ext-link>.</p>\n    <p>With <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">embedded\n    [brackets]</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">b</ext-link> by itself\n    should be a link.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">once</ext-link>.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">twice</ext-link>.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">thrice</ext-link>.</p>\n    <p>This should [not][] be a link.</p>\n    <preformat>[not]: /url</preformat>\n    <p>Foo\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quotes&quot; inside\">bar</ext-link>.</p>\n    <p>Foo\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quote&quot; inside\">biz</ext-link>.</p>\n  </sec>\n  <sec id=\"with-ampersands\">\n    <title>With ampersands</title>\n    <p>Here’s a\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">link\n    with an ampersand in the URL</ext-link>.</p>\n    <p>Here’s a link with an amersand in the link text:\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://att.com/\" xlink:title=\"AT&amp;T\">AT&amp;T</ext-link>.</p>\n    <p>Here’s an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n    link</ext-link>.</p>\n    <p>Here’s an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n    link in pointy braces</ext-link>.</p>\n  </sec>\n  <sec id=\"autolinks\">\n    <title>Autolinks</title>\n    <p>With an ampersand:\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</ext-link></p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>In a list?</p>\n      </list-item>\n      <list-item>\n        <p><ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n      </list-item>\n      <list-item>\n        <p>It should.</p>\n      </list-item>\n    </list>\n    <p>An e-mail address: <email>nobody@nowhere.net</email></p>\n    <disp-quote>\n      <p>Blockquoted:\n      <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n    </disp-quote>\n    <p>Auto-links should not occur here:\n    <monospace>&lt;http://example.com/&gt;</monospace></p>\n    <preformat>or here: &lt;http://example.com/&gt;</preformat>\n  </sec>\n</sec>\n<sec id=\"images\">\n  <title>Images</title>\n  <p>From “Voyage dans la Lune” by Georges Melies (1902):</p>\n  <fig>\n    <caption><p>lalune</p></caption>\n    <graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"lalune.jpg\" xlink:title=\"Voyage dans la Lune\" />\n  </fig>\n  <p>Here is a movie\n  <inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"movie.jpg\">\n    <alt-text>movie</alt-text>\n  </inline-graphic> icon.</p>\n</sec>\n<sec id=\"footnotes\">\n  <title>Footnotes</title>\n  <p>Here is a footnote reference,<fn>\n    <p>Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.</p>\n  </fn> and another.<fn>\n    <p>Here’s the long note. This one contains multiple blocks.</p>\n    <p>Subsequent blocks are indented to show that they belong to the footnote\n    (as with list items).</p>\n    <p specific-use=\"wrapper\">\n      <preformat>  { &lt;code&gt; }</preformat>\n    </p>\n    <p>If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.</p>\n  </fn> This should <italic>not</italic> be a footnote reference, because it\n  contains a space.[^my note] Here is an inline note.<fn>\n    <p>This is <italic>easier</italic> to type. Inline notes may contain\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://google.com\">links</ext-link>\n    and <monospace>]</monospace> verbatim characters, as well as [bracketed\n    text].</p>\n  </fn></p>\n  <disp-quote>\n    <p>Notes can go in quotes.<fn>\n      <p>In quote.</p>\n    </fn></p>\n  </disp-quote>\n  <list list-type=\"order\">\n    <list-item>\n      <p>And in list items.<fn>\n        <p>In list.</p>\n      </fn></p>\n    </list-item>\n  </list>\n  <p>This paragraph should not be part of the note, as it is not indented.</p>\n</sec>\n</body>\n<back>\n</back>\n</article>\n"
  },
  {
    "path": "test/writer.jats_publishing",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE article PUBLIC \"-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN\"\n                  \"JATS-publishing1.dtd\">\n<article xmlns:mml=\"http://www.w3.org/1998/Math/MathML\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" dtd-version=\"1.2\" article-type=\"other\">\n<front>\n<journal-meta>\n<journal-id></journal-id>\n<journal-title-group>\n</journal-title-group>\n<issn></issn>\n<publisher>\n<publisher-name></publisher-name>\n</publisher>\n</journal-meta>\n<article-meta>\n<title-group>\n<article-title>Pandoc Test Suite</article-title>\n</title-group>\n<contrib-group>\n<contrib contrib-type=\"author\">\n<string-name>John MacFarlane</string-name>\n</contrib>\n<contrib contrib-type=\"author\">\n<string-name>Anonymous</string-name>\n</contrib>\n</contrib-group>\n<pub-date date-type=\"pub\" publication-format=\"electronic\" iso-8601-date=\"2006-07-17\">\n<day>17</day>\n<month>7</month>\n<year>2006</year>\n</pub-date>\n<permissions>\n</permissions>\n</article-meta>\n</front>\n<body>\n<p>This is a set of tests for pandoc. Most of them are adapted from John\nGruber’s markdown test suite.</p>\n<sec id=\"headers\">\n  <title>Headers</title>\n  <sec id=\"level-2-with-an-embedded-link\">\n    <title>Level 2 with an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">embedded\n    link</ext-link></title>\n    <sec id=\"level-3-with-emphasis\">\n      <title>Level 3 with <italic>emphasis</italic></title>\n      <sec id=\"level-4\">\n        <title>Level 4</title>\n        <sec id=\"level-5\">\n          <title>Level 5</title>\n        </sec>\n      </sec>\n    </sec>\n  </sec>\n</sec>\n<sec id=\"level-1\">\n  <title>Level 1</title>\n  <sec id=\"level-2-with-emphasis\">\n    <title>Level 2 with <italic>emphasis</italic></title>\n    <sec id=\"level-3\">\n      <title>Level 3</title>\n      <p>with no blank line</p>\n    </sec>\n  </sec>\n  <sec id=\"level-2\">\n    <title>Level 2</title>\n    <p>with no blank line</p>\n  </sec>\n</sec>\n<sec id=\"paragraphs\">\n  <title>Paragraphs</title>\n  <p>Here’s a regular paragraph.</p>\n  <p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\n  Because a hard-wrapped line in the middle of a paragraph looked like a list\n  item.</p>\n  <p>Here’s one with a bullet. * criminey.</p>\n  <p>There should be a hard line break\n  here.</p>\n</sec>\n<sec id=\"block-quotes\">\n  <title>Block Quotes</title>\n  <p>E-mail style:</p>\n  <disp-quote>\n    <p>This is a block quote. It is pretty short.</p>\n  </disp-quote>\n  <disp-quote>\n    <p>Code in a block quote:</p>\n    <preformat>sub status {\n    print &quot;working&quot;;\n}</preformat>\n    <p>A list:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>item one</p>\n      </list-item>\n      <list-item>\n        <p>item two</p>\n      </list-item>\n    </list>\n    <p>Nested block quotes:</p>\n    <disp-quote>\n      <p>nested</p>\n    </disp-quote>\n    <disp-quote>\n      <p>nested</p>\n    </disp-quote>\n  </disp-quote>\n  <p>This should not be a block quote: 2 &gt; 1.</p>\n  <p>And a following paragraph.</p>\n</sec>\n<sec id=\"code-blocks\">\n  <title>Code Blocks</title>\n  <p>Code:</p>\n  <preformat>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</preformat>\n  <p>And:</p>\n  <preformat>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</preformat>\n</sec>\n<sec id=\"lists\">\n  <title>Lists</title>\n  <sec id=\"unordered\">\n    <title>Unordered</title>\n    <p>Asterisks tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Asterisks loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>asterisk 1</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 2</p>\n      </list-item>\n      <list-item>\n        <p>asterisk 3</p>\n      </list-item>\n    </list>\n    <p>Pluses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Pluses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Plus 1</p>\n      </list-item>\n      <list-item>\n        <p>Plus 2</p>\n      </list-item>\n      <list-item>\n        <p>Plus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses tight:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n    <p>Minuses loose:</p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Minus 1</p>\n      </list-item>\n      <list-item>\n        <p>Minus 2</p>\n      </list-item>\n      <list-item>\n        <p>Minus 3</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"ordered\">\n    <title>Ordered</title>\n    <p>Tight:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Loose using tabs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second</p>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>and using spaces:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>One</p>\n      </list-item>\n      <list-item>\n        <p>Two</p>\n      </list-item>\n      <list-item>\n        <p>Three</p>\n      </list-item>\n    </list>\n    <p>Multiple paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Item 1, graf one.</p>\n        <p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n        back.</p>\n      </list-item>\n      <list-item>\n        <p>Item 2.</p>\n      </list-item>\n      <list-item>\n        <p>Item 3.</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"nested\">\n    <title>Nested</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>Tab</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Tab</p>\n            <list list-type=\"bullet\">\n              <list-item>\n                <p>Tab</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Here’s another:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n    <p>Same thing but with paragraphs:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>First</p>\n      </list-item>\n      <list-item>\n        <p>Second:</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>Fee</p>\n          </list-item>\n          <list-item>\n            <p>Fie</p>\n          </list-item>\n          <list-item>\n            <p>Foe</p>\n          </list-item>\n        </list>\n      </list-item>\n      <list-item>\n        <p>Third</p>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"tabs-and-spaces\">\n    <title>Tabs and spaces</title>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>this is a list item indented with tabs</p>\n      </list-item>\n      <list-item>\n        <p>this is a list item indented with spaces</p>\n        <list list-type=\"bullet\">\n          <list-item>\n            <p>this is an example list item indented with tabs</p>\n          </list-item>\n          <list-item>\n            <p>this is an example list item indented with spaces</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n  </sec>\n  <sec id=\"fancy-list-markers\">\n    <title>Fancy list markers</title>\n    <list list-type=\"order\">\n      <list-item>\n        <label>(2)</label>\n        <p>begins with 2</p>\n      </list-item>\n      <list-item>\n        <label>(3)</label>\n        <p>and now 3</p>\n        <p>with a continuation</p>\n        <list list-type=\"roman-lower\">\n          <list-item>\n            <label>iv.</label>\n            <p>sublist with roman numerals, starting with 4</p>\n          </list-item>\n          <list-item>\n            <label>v.</label>\n            <p>more items</p>\n            <list list-type=\"alpha-upper\">\n              <list-item>\n                <label>(A)</label>\n                <p>a subsublist</p>\n              </list-item>\n              <list-item>\n                <label>(B)</label>\n                <p>a subsublist</p>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Nesting:</p>\n    <list list-type=\"alpha-upper\">\n      <list-item>\n        <p>Upper Alpha</p>\n        <list list-type=\"roman-upper\">\n          <list-item>\n            <p>Upper Roman.</p>\n            <list list-type=\"order\">\n              <list-item>\n                <label>(6)</label>\n                <p>Decimal start with 6</p>\n                <list list-type=\"alpha-lower\">\n                  <list-item>\n                    <label>c)</label>\n                    <p>Lower alpha with paren</p>\n                  </list-item>\n                </list>\n              </list-item>\n            </list>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Autonumbering:</p>\n    <list list-type=\"order\">\n      <list-item>\n        <p>Autonumber.</p>\n      </list-item>\n      <list-item>\n        <p>More.</p>\n        <list list-type=\"order\">\n          <list-item>\n            <p>Nested.</p>\n          </list-item>\n        </list>\n      </list-item>\n    </list>\n    <p>Should not be a list item:</p>\n    <p>M.A. 2007</p>\n    <p>B. Williams</p>\n  </sec>\n</sec>\n<sec id=\"definition-lists\">\n  <title>Definition Lists</title>\n  <p>Tight using spaces:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Tight using tabs:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Loose:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>banana</term>\n      <def>\n        <p>yellow fruit</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple blocks with italics:</p>\n  <def-list>\n    <def-item>\n      <term><italic>apple</italic></term>\n      <def>\n        <p>red fruit</p>\n        <p>contains seeds, crisp, pleasant to taste</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term><italic>orange</italic></term>\n      <def>\n        <p>orange fruit</p>\n        <p specific-use=\"wrapper\">\n          <preformat>{ orange code block }</preformat>\n        </p>\n        <p specific-use=\"wrapper\">\n          <disp-quote>\n            <p>orange block quote</p>\n          </disp-quote>\n        </p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple definitions, tight:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p>bank</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Multiple definitions, loose:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p>bank</p>\n      </def>\n    </def-item>\n  </def-list>\n  <p>Blank line after term, indented marker, alternate markers:</p>\n  <def-list>\n    <def-item>\n      <term>apple</term>\n      <def>\n        <p>red fruit</p>\n        <p>computer</p>\n      </def>\n    </def-item>\n    <def-item>\n      <term>orange</term>\n      <def>\n        <p>orange fruit</p>\n        <p specific-use=\"wrapper\">\n          <list list-type=\"order\">\n            <list-item>\n              <p>sublist</p>\n            </list-item>\n            <list-item>\n              <p>sublist</p>\n            </list-item>\n          </list>\n        </p>\n      </def>\n    </def-item>\n  </def-list>\n</sec>\n<sec id=\"html-blocks\">\n  <title>HTML Blocks</title>\n  <p>Simple block on one line:</p>\n  <p>foo</p>\n  <p>And nested without indentation:</p>\n  <p>foo</p>\n  <p>bar</p>\n  <p>Interpreted markdown in a table:</p>\n  <p>This is <italic>emphasized</italic></p>\n  <p>And this is <bold>strong</bold></p>\n  <p>Here’s a simple block:</p>\n  <p>foo</p>\n  <p>This should be a code block, though:</p>\n  <preformat>&lt;div&gt;\n    foo\n&lt;/div&gt;</preformat>\n  <p>As should this:</p>\n  <preformat>&lt;div&gt;foo&lt;/div&gt;</preformat>\n  <p>Now, nested:</p>\n  <p>foo</p>\n  <p>This should just be an HTML comment:</p>\n  <p>Multiline:</p>\n  <p>Code block:</p>\n  <preformat>&lt;!-- Comment --&gt;</preformat>\n  <p>Just plain comment, with trailing spaces on the line:</p>\n  <p>Code:</p>\n  <preformat>&lt;hr /&gt;</preformat>\n  <p>Hr’s:</p>\n</sec>\n<sec id=\"inline-markup\">\n  <title>Inline Markup</title>\n  <p>This is <italic>emphasized</italic>, and so <italic>is this</italic>.</p>\n  <p>This is <bold>strong</bold>, and so <bold>is this</bold>.</p>\n  <p>An <italic><ext-link ext-link-type=\"uri\" xlink:href=\"/url\">emphasized\n  link</ext-link></italic>.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p><bold><italic>This is strong and em.</italic></bold></p>\n  <p>So is <bold><italic>this</italic></bold> word.</p>\n  <p>This is code: <monospace>&gt;</monospace>, <monospace>$</monospace>,\n  <monospace>\\</monospace>, <monospace>\\$</monospace>,\n  <monospace>&lt;html&gt;</monospace>.</p>\n  <p><strike>This is <italic>strikeout</italic>.</strike></p>\n  <p>Superscripts: a<sup>bc</sup>d a<sup><italic>hello</italic></sup>\n  a<sup>hello there</sup>.</p>\n  <p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>\n  <p>These should not be superscripts or subscripts, because of the unescaped\n  spaces: a^b c^d, a~b c~d.</p>\n</sec>\n<sec id=\"smart-quotes-ellipses-dashes\">\n  <title>Smart quotes, ellipses, dashes</title>\n  <p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>\n  <p>‘A’, ‘B’, and ‘C’ are letters.</p>\n  <p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p>\n  <p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p>\n  <p>Here is some quoted ‘<monospace>code</monospace>’ and a\n  “<ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">quoted\n  link</ext-link>”.</p>\n  <p>Some dashes: one—two — three—four — five.</p>\n  <p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n  <p>Ellipses…and…and….</p>\n</sec>\n<sec id=\"latex\">\n  <title>LaTeX</title>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[2+2=4]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mn>2</mml:mn><mml:mo>+</mml:mo><mml:mn>2</mml:mn><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[x \\in y]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[\\alpha \\wedge \\omega]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>α</mml:mi><mml:mo>∧</mml:mo><mml:mi>ω</mml:mi></mml:mrow></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[223]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mn>223</mml:mn></mml:math></alternatives></inline-formula></p>\n    </list-item>\n    <list-item>\n      <p><inline-formula><alternatives>\n      <tex-math><![CDATA[p]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mi>p</mml:mi></mml:math></alternatives></inline-formula>-Tree</p>\n    </list-item>\n    <list-item>\n      <p>Here’s some display math: <disp-formula><alternatives>\n      <tex-math><![CDATA[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}]]></tex-math>\n      <mml:math display=\"block\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mfrac><mml:mi>d</mml:mi><mml:mrow><mml:mi>d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mfrac><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mi mathvariant=\"normal\">lim</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mo>→</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:munder><mml:mfrac><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo><mml:mo>−</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy=\"false\" form=\"prefix\">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy=\"false\" form=\"postfix\">)</mml:mo></mml:mrow><mml:mi>h</mml:mi></mml:mfrac></mml:mrow></mml:math></alternatives></disp-formula></p>\n    </list-item>\n    <list-item>\n      <p>Here’s one that has a line break in it: <inline-formula><alternatives>\n      <tex-math><![CDATA[\\alpha + \\omega \\times x^2]]></tex-math>\n      <mml:math display=\"inline\" xmlns:mml=\"http://www.w3.org/1998/Math/MathML\"><mml:mrow><mml:mi>α</mml:mi><mml:mo>+</mml:mo><mml:mi>ω</mml:mi><mml:mo>×</mml:mo><mml:msup><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></alternatives></inline-formula>.</p>\n    </list-item>\n  </list>\n  <p>These shouldn’t be math:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>To get the famous equation, write\n      <monospace>$e = mc^2$</monospace>.</p>\n    </list-item>\n    <list-item>\n      <p>$22,000 is a <italic>lot</italic> of money. So is $34,000. (It worked\n      if “lot” is emphasized.)</p>\n    </list-item>\n    <list-item>\n      <p>Shoes ($20) and socks ($5).</p>\n    </list-item>\n    <list-item>\n      <p>Escaped <monospace>$</monospace>: $73 <italic>this should be\n      emphasized</italic> 23$.</p>\n    </list-item>\n  </list>\n  <p>Here’s a LaTeX table:</p>\n</sec>\n<sec id=\"special-characters\">\n  <title>Special Characters</title>\n  <p>Here is some unicode:</p>\n  <list list-type=\"bullet\">\n    <list-item>\n      <p>I hat: Î</p>\n    </list-item>\n    <list-item>\n      <p>o umlaut: ö</p>\n    </list-item>\n    <list-item>\n      <p>section: §</p>\n    </list-item>\n    <list-item>\n      <p>set membership: ∈</p>\n    </list-item>\n    <list-item>\n      <p>copyright: ©</p>\n    </list-item>\n  </list>\n  <p>AT&amp;T has an ampersand in their name.</p>\n  <p>AT&amp;T is another way to write it.</p>\n  <p>This &amp; that.</p>\n  <p>4 &lt; 5.</p>\n  <p>6 &gt; 5.</p>\n  <p>Backslash: \\</p>\n  <p>Backtick: `</p>\n  <p>Asterisk: *</p>\n  <p>Underscore: _</p>\n  <p>Left brace: {</p>\n  <p>Right brace: }</p>\n  <p>Left bracket: [</p>\n  <p>Right bracket: ]</p>\n  <p>Left paren: (</p>\n  <p>Right paren: )</p>\n  <p>Greater-than: &gt;</p>\n  <p>Hash: #</p>\n  <p>Period: .</p>\n  <p>Bang: !</p>\n  <p>Plus: +</p>\n  <p>Minus: -</p>\n</sec>\n<sec id=\"links\">\n  <title>Links</title>\n  <sec id=\"explicit\">\n    <title>Explicit</title>\n    <p>Just a\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">URL</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by two spaces\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title preceded by a tab\">URL\n    and title</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with &quot;quotes&quot; in it\">URL\n    and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"title with single quotes\">URL\n    and title</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/with_underscore\">with_underscore</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"mailto:nobody@nowhere.net\">Email\n    link</ext-link></p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"\">Empty</ext-link>.</p>\n  </sec>\n  <sec id=\"reference\">\n    <title>Reference</title>\n    <p>Foo <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">bar</ext-link>.</p>\n    <p>With <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">embedded\n    [brackets]</ext-link>.</p>\n    <p><ext-link ext-link-type=\"uri\" xlink:href=\"/url/\">b</ext-link> by itself\n    should be a link.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">once</ext-link>.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">twice</ext-link>.</p>\n    <p>Indented\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url\">thrice</ext-link>.</p>\n    <p>This should [not][] be a link.</p>\n    <preformat>[not]: /url</preformat>\n    <p>Foo\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quotes&quot; inside\">bar</ext-link>.</p>\n    <p>Foo\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/url/\" xlink:title=\"Title with &quot;quote&quot; inside\">biz</ext-link>.</p>\n  </sec>\n  <sec id=\"with-ampersands\">\n    <title>With ampersands</title>\n    <p>Here’s a\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">link\n    with an ampersand in the URL</ext-link>.</p>\n    <p>Here’s a link with an amersand in the link text:\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://att.com/\" xlink:title=\"AT&amp;T\">AT&amp;T</ext-link>.</p>\n    <p>Here’s an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n    link</ext-link>.</p>\n    <p>Here’s an\n    <ext-link ext-link-type=\"uri\" xlink:href=\"/script?foo=1&amp;bar=2\">inline\n    link in pointy braces</ext-link>.</p>\n  </sec>\n  <sec id=\"autolinks\">\n    <title>Autolinks</title>\n    <p>With an ampersand:\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</ext-link></p>\n    <list list-type=\"bullet\">\n      <list-item>\n        <p>In a list?</p>\n      </list-item>\n      <list-item>\n        <p><ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n      </list-item>\n      <list-item>\n        <p>It should.</p>\n      </list-item>\n    </list>\n    <p>An e-mail address: <email>nobody@nowhere.net</email></p>\n    <disp-quote>\n      <p>Blockquoted:\n      <ext-link ext-link-type=\"uri\" xlink:href=\"http://example.com/\">http://example.com/</ext-link></p>\n    </disp-quote>\n    <p>Auto-links should not occur here:\n    <monospace>&lt;http://example.com/&gt;</monospace></p>\n    <preformat>or here: &lt;http://example.com/&gt;</preformat>\n  </sec>\n</sec>\n<sec id=\"images\">\n  <title>Images</title>\n  <p>From “Voyage dans la Lune” by Georges Melies (1902):</p>\n  <fig>\n    <caption><p>lalune</p></caption>\n    <graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"lalune.jpg\" xlink:title=\"Voyage dans la Lune\" />\n  </fig>\n  <p>Here is a movie\n  <inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"movie.jpg\">\n    <alt-text>movie</alt-text>\n  </inline-graphic> icon.</p>\n</sec>\n<sec id=\"footnotes\">\n  <title>Footnotes</title>\n  <p>Here is a footnote reference,<xref ref-type=\"fn\" rid=\"fn1\">1</xref> and\n  another.<xref ref-type=\"fn\" rid=\"fn2\">2</xref> This should\n  <italic>not</italic> be a footnote reference, because it contains a space.[^my\n  note] Here is an inline note.<xref ref-type=\"fn\" rid=\"fn3\">3</xref></p>\n  <disp-quote>\n    <p>Notes can go in quotes.<xref ref-type=\"fn\" rid=\"fn4\">4</xref></p>\n  </disp-quote>\n  <list list-type=\"order\">\n    <list-item>\n      <p>And in list items.<xref ref-type=\"fn\" rid=\"fn5\">5</xref></p>\n    </list-item>\n  </list>\n  <p>This paragraph should not be part of the note, as it is not indented.</p>\n</sec>\n</body>\n<back>\n<fn-group>\n  <fn id=\"fn1\">\n    <label>1</label><p>Here is the footnote. It can go anywhere after the\n    footnote reference. It need not be placed at the end of the document.</p>\n  </fn>\n  <fn id=\"fn2\">\n    <label>2</label><p>Here’s the long note. This one contains multiple\n    blocks.</p>\n    <p>Subsequent blocks are indented to show that they belong to the footnote\n    (as with list items).</p>\n    <p specific-use=\"wrapper\">\n      <preformat>  { &lt;code&gt; }</preformat>\n    </p>\n    <p>If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.</p>\n  </fn>\n  <fn id=\"fn3\">\n    <label>3</label><p>This is <italic>easier</italic> to type. Inline notes may\n    contain\n    <ext-link ext-link-type=\"uri\" xlink:href=\"http://google.com\">links</ext-link>\n    and <monospace>]</monospace> verbatim characters, as well as [bracketed\n    text].</p>\n  </fn>\n  <fn id=\"fn4\">\n    <label>4</label><p>In quote.</p>\n  </fn>\n  <fn id=\"fn5\">\n    <label>5</label><p>In list.</p>\n  </fn>\n</fn-group>\n</back>\n</article>\n"
  },
  {
    "path": "test/writer.jira",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.\n\n----\nh1. {anchor:headers}Headers\nh2. {anchor:level-2-with-an-embedded-link}Level 2 with an [embedded link|/url]\nh3. {anchor:level-3-with-emphasis}Level 3 with _emphasis_\nh4. {anchor:level-4}Level 4\nh5. {anchor:level-5}Level 5\nh1. {anchor:level-1}Level 1\nh2. {anchor:level-2-with-emphasis}Level 2 with _emphasis_\nh3. {anchor:level-3}Level 3\nwith no blank line\n\nh2. {anchor:level-2}Level 2\nwith no blank line\n\n----\nh1. {anchor:paragraphs}Paragraphs\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n----\nh1. {anchor:block-quotes}Block Quotes\nE-mail style:\n\nbq. This is a block quote. It is pretty short.\n{quote}\nCode in a block quote:\n\n{noformat}\nsub status {\n    print \"working\";\n}{noformat}\nA list:\n\n# item one\n# item two\n\nNested block quotes:\n\nbq. nested\nbq. nested{quote}\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n----\nh1. {anchor:code-blocks}Code Blocks\nCode:\n\n{noformat}\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab{noformat}\nAnd:\n\n{noformat}\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{{noformat}\n----\nh1. {anchor:lists}Lists\nh2. {anchor:unordered}Unordered\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nh2. {anchor:ordered}Ordered\nTight:\n\n# First\n# Second\n# Third\n\nand:\n\n# One\n# Two\n# Three\n\nLoose using tabs:\n\n# First\n# Second\n# Third\n\nand using spaces:\n\n# One\n# Two\n# Three\n\nMultiple paragraphs:\n\n# Item 1, graf one.\nItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n# Item 2.\n# Item 3.\n\nh2. {anchor:nested}Nested\n* Tab\n** Tab\n*** Tab\n\nHere’s another:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\nSame thing but with paragraphs:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\nh2. {anchor:tabs-and-spaces}Tabs and spaces\n* this is a list item indented with tabs\n* this is a list item indented with spaces\n** this is an example list item indented with tabs\n** this is an example list item indented with spaces\n\nh2. {anchor:fancy-list-markers}Fancy list markers\n# begins with 2\n# and now 3\nwith a continuation\n## sublist with roman numerals, starting with 4\n## more items\n### a subsublist\n### a subsublist\n\nNesting:\n\n# Upper Alpha\n## Upper Roman.\n### Decimal start with 6\n#### Lower alpha with paren\n\nAutonumbering:\n\n# Autonumber.\n# More.\n## Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n----\nh1. {anchor:definition-lists}Definition Lists\nTight using spaces:\n\n* *apple*\nred fruit\n* *orange*\norange fruit\n* *banana*\nyellow fruit\n\nTight using tabs:\n\n* *apple*\nred fruit\n* *orange*\norange fruit\n* *banana*\nyellow fruit\n\nLoose:\n\n* *apple*\nred fruit\n* *orange*\norange fruit\n* *banana*\nyellow fruit\n\nMultiple blocks with italics:\n\n* *_apple_*\nred fruit\ncontains seeds, crisp, pleasant to taste\n* *_orange_*\norange fruit\n{noformat}\n{ orange code block }{noformat}\nbq. orange block quote\n\nMultiple definitions, tight:\n\n* *apple*\nred fruit\ncomputer\n* *orange*\norange fruit\nbank\n\nMultiple definitions, loose:\n\n* *apple*\nred fruit\ncomputer\n* *orange*\norange fruit\nbank\n\nBlank line after term, indented marker, alternate markers:\n\n* *apple*\nred fruit\ncomputer\n* *orange*\norange fruit\n*# sublist\n*# sublist\n\nh1. {anchor:html-blocks}HTML Blocks\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is _emphasized_\n\nAnd this is *strong*\n\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n{noformat}\n<div>\n    foo\n</div>{noformat}\nAs should this:\n\n{noformat}\n<div>foo</div>{noformat}\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n{noformat}\n<!-- Comment -->{noformat}\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n{noformat}\n<hr />{noformat}\nHr’s:\n\n----\nh1. {anchor:inline-markup}Inline Markup\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _[emphasized link|/url]_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: {{>}}, {{$}}, {{&bsol;}}, {{&bsol;$}}, {{<html>}}.\n\n-This is _strikeout_.-\n\nSuperscripts: a{^}bc{^}d a{^}_hello_{^} a{^}hello there{^}.\n\nSubscripts: H{~}2{~}O, H{~}23{~}O, H{~}many of them{~}O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\n\n----\nh1. {anchor:smart-quotes-ellipses-dashes}Smart quotes, ellipses, dashes\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70’s?\n\nHere is some quoted '{{code}}' and a \"[quoted link|http://example.com/?foo=1&bar=2]\".\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n----\nh1. {anchor:latex}LaTeX\n* \n* 2 + 2 = 4\n* _x_ ∈ {_}y{_}\n* _α_ ∧ {_}ω{_}\n* 223\n* _p_\\-Tree\n* Here’s some display math: \n$$\\frac\\{d\\}\\{dx\\}f\\(x)=\\lim\\_\\{h\\to 0\\}&bsol;frac\\{f(x+h)-f\\(x)\\}\\{h\\}$$\n\n* Here’s one that has a line break in it: _α_ + {_}ω{_} × {_}x{_}^2^.\n\nThese shouldn’t be math:\n\n* To get the famous equation, write {{$e = mc^2$}}.\n* $22,000 is a _lot_ of money. So is $34,000. \\(It worked if \"lot\" is emphasized.)\n* Shoes \\($20) and socks \\($5).\n* Escaped {{$}}: $73 _this should be emphasized_ 23$.\n\nHere’s a LaTeX table:\n\n----\nh1. {anchor:special-characters}Special Characters\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: &bsol;\n\nBacktick: `\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: \\(\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: \\!\n\nPlus: \\+\n\nMinus: \\-\n\n----\nh1. {anchor:links}Links\nh2. {anchor:explicit}Explicit\nJust a [URL|/url/].\n\n[URL and title|/url/].\n\n[URL and title|/url/].\n\n[URL and title|/url/].\n\n[URL and title|/url/]\n\n[URL and title|/url/]\n\n[with_underscore|/url/with_underscore]\n\n[Email link|mailto:nobody@nowhere.net]\n\n[Empty|].\n\nh2. {anchor:reference}Reference\nFoo [bar|/url/].\n\nWith [embedded \\[brackets\\]|/url/].\n\n[b|/url/] by itself should be a link.\n\nIndented [once|/url].\n\nIndented [twice|/url].\n\nIndented [thrice|/url].\n\nThis should \\[not\\]\\[\\] be a link.\n\n{noformat}\n[not]: /url{noformat}\nFoo [bar|/url/].\n\nFoo [biz|/url/].\n\nh2. {anchor:with-ampersands}With ampersands\nHere’s a [link with an ampersand in the URL|http://example.com/?foo=1&bar=2].\n\nHere’s a link with an amersand in the link text: [AT&T|http://att.com/].\n\nHere’s an [inline link|/script?foo=1&bar=2].\n\nHere’s an [inline link in pointy braces|/script?foo=1&bar=2].\n\nh2. {anchor:autolinks}Autolinks\nWith an ampersand: [http://example.com/?foo=1&bar=2]\n\n* In a list?\n* [http://example.com/]\n* It should.\n\nAn e-mail address: [mailto:nobody@nowhere.net]\n\nbq. Blockquoted: [http://example.com/]\nAuto-links should not occur here: {{<http://example.com/>}}\n\n{noformat}\nor here: <http://example.com/>{noformat}\n----\nh1. {anchor:images}Images\nFrom \"Voyage dans la Lune\" by Georges Melies \\(1902):\n\n!lalune.jpg|title=Voyage dans la Lune, alt=lalune!\n\nHere is a movie !movie.jpg|alt=movie! icon.\n\n----\nh1. {anchor:footnotes}Footnotes\nHere is a footnote reference,[1] and another.[2] This should _not_ be a footnote reference, because it contains a space.\\[\\^my note\\] Here is an inline note.[3]\n\nbq. Notes can go in quotes.[4]\n# And in list items.[5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n\n\\[1] Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\n\n\n\\[2] Here’s the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote \\(as with list items).\n\n{noformat}\n  { <code> }{noformat}\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.\n\n\n\\[3] This is _easier_ to type. Inline notes may contain [links|http://google.com] and {{\\]}} verbatim characters, as well as \\[bracketed text].\n\n\n\\[4] In quote.\n\n\n\\[5] In list.\n"
  },
  {
    "path": "test/writer.latex",
    "content": "% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\usepackage{fancyvrb}\n\\usepackage{graphicx}\n\\makeatletter\n\\newsavebox\\pandoc@box\n\\newcommand*\\pandocbounded[1]{% scales image to fit in text height/width\n  \\sbox\\pandoc@box{#1}%\n  \\Gscale@div\\@tempa{\\textheight}{\\dimexpr\\ht\\pandoc@box+\\dp\\pandoc@box\\relax}%\n  \\Gscale@div\\@tempb{\\linewidth}{\\wd\\pandoc@box}%\n  \\ifdim\\@tempb\\p@<\\@tempa\\p@\\let\\@tempa\\@tempb\\fi% select the smaller of both\n  \\ifdim\\@tempa\\p@<\\p@\\scalebox{\\@tempa}{\\usebox\\pandoc@box}%\n  \\else\\usebox{\\pandoc@box}%\n  \\fi%\n}\n% Set default figure placement to htbp\n\\def\\fps@figure{htbp}\n\\makeatother\n\\ifLuaTeX\n  \\usepackage{luacolor}\n  \\usepackage[soul]{lua-ul}\n\\else\n  \\usepackage{soul}\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\VerbatimFootnotes % allow verbatim text in footnotes\n\\hypersetup{\n  pdftitle={Pandoc Test Suite},\n  pdfauthor={John MacFarlane; Anonymous},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\title{Pandoc Test Suite}\n\\author{John MacFarlane \\and Anonymous}\n\\date{July 17, 2006}\n\n\\begin{document}\n\\maketitle\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Headers}\\label{headers}\n\n\\subsection{\\texorpdfstring{Level 2 with an \\href{/url}{embedded\nlink}}{Level 2 with an embedded link}}\\label{level-2-with-an-embedded-link}\n\n\\subsubsection{\\texorpdfstring{Level 3 with\n\\emph{emphasis}}{Level 3 with emphasis}}\\label{level-3-with-emphasis}\n\n\\paragraph{Level 4}\\label{level-4}\n\n\\subparagraph{Level 5}\\label{level-5}\n\n\\section{Level 1}\\label{level-1}\n\n\\subsection{\\texorpdfstring{Level 2 with\n\\emph{emphasis}}{Level 2 with emphasis}}\\label{level-2-with-emphasis}\n\n\\subsubsection{Level 3}\\label{level-3}\n\nwith no blank line\n\n\\subsection{Level 2}\\label{level-2}\n\nwith no blank line\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Paragraphs}\\label{paragraphs}\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break\\\\\nhere.\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Block Quotes}\\label{block-quotes}\n\nE-mail style:\n\n\\begin{quote}\nThis is a block quote. It is pretty short.\n\\end{quote}\n\n\\begin{quote}\nCode in a block quote:\n\n\\begin{verbatim}\nsub status {\n    print \"working\";\n}\n\\end{verbatim}\n\nA list:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  item one\n\\item\n  item two\n\\end{enumerate}\n\nNested block quotes:\n\n\\begin{quote}\nnested\n\\end{quote}\n\n\\begin{quote}\nnested\n\\end{quote}\n\\end{quote}\n\nThis should not be a block quote: 2 \\textgreater{} 1.\n\nAnd a following paragraph.\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Code Blocks}\\label{code-blocks}\n\nCode:\n\n\\begin{verbatim}\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n\\end{verbatim}\n\nAnd:\n\n\\begin{verbatim}\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\\end{verbatim}\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Lists}\\label{lists}\n\n\\subsection{Unordered}\\label{unordered}\n\nAsterisks tight:\n\n\\begin{itemize}\n\\tightlist\n\\item\n  asterisk 1\n\\item\n  asterisk 2\n\\item\n  asterisk 3\n\\end{itemize}\n\nAsterisks loose:\n\n\\begin{itemize}\n\\item\n  asterisk 1\n\\item\n  asterisk 2\n\\item\n  asterisk 3\n\\end{itemize}\n\nPluses tight:\n\n\\begin{itemize}\n\\tightlist\n\\item\n  Plus 1\n\\item\n  Plus 2\n\\item\n  Plus 3\n\\end{itemize}\n\nPluses loose:\n\n\\begin{itemize}\n\\item\n  Plus 1\n\\item\n  Plus 2\n\\item\n  Plus 3\n\\end{itemize}\n\nMinuses tight:\n\n\\begin{itemize}\n\\tightlist\n\\item\n  Minus 1\n\\item\n  Minus 2\n\\item\n  Minus 3\n\\end{itemize}\n\nMinuses loose:\n\n\\begin{itemize}\n\\item\n  Minus 1\n\\item\n  Minus 2\n\\item\n  Minus 3\n\\end{itemize}\n\n\\subsection{Ordered}\\label{ordered}\n\nTight:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  First\n\\item\n  Second\n\\item\n  Third\n\\end{enumerate}\n\nand:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  One\n\\item\n  Two\n\\item\n  Three\n\\end{enumerate}\n\nLoose using tabs:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\item\n  First\n\\item\n  Second\n\\item\n  Third\n\\end{enumerate}\n\nand using spaces:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\item\n  One\n\\item\n  Two\n\\item\n  Three\n\\end{enumerate}\n\nMultiple paragraphs:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\item\n  Item 1, graf one.\n\n  Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\\item\n  Item 2.\n\\item\n  Item 3.\n\\end{enumerate}\n\n\\subsection{Nested}\\label{nested}\n\n\\begin{itemize}\n\\tightlist\n\\item\n  Tab\n\n  \\begin{itemize}\n  \\tightlist\n  \\item\n    Tab\n\n    \\begin{itemize}\n    \\tightlist\n    \\item\n      Tab\n    \\end{itemize}\n  \\end{itemize}\n\\end{itemize}\n\nHere's another:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  First\n\\item\n  Second:\n\n  \\begin{itemize}\n  \\tightlist\n  \\item\n    Fee\n  \\item\n    Fie\n  \\item\n    Foe\n  \\end{itemize}\n\\item\n  Third\n\\end{enumerate}\n\nSame thing but with paragraphs:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\item\n  First\n\\item\n  Second:\n\n  \\begin{itemize}\n  \\tightlist\n  \\item\n    Fee\n  \\item\n    Fie\n  \\item\n    Foe\n  \\end{itemize}\n\\item\n  Third\n\\end{enumerate}\n\n\\subsection{Tabs and spaces}\\label{tabs-and-spaces}\n\n\\begin{itemize}\n\\item\n  this is a list item indented with tabs\n\\item\n  this is a list item indented with spaces\n\n  \\begin{itemize}\n  \\item\n    this is an example list item indented with tabs\n  \\item\n    this is an example list item indented with spaces\n  \\end{itemize}\n\\end{itemize}\n\n\\subsection{Fancy list markers}\\label{fancy-list-markers}\n\n\\begin{enumerate}\n\\def\\labelenumi{(\\arabic{enumi})}\n\\setcounter{enumi}{1}\n\\item\n  begins with 2\n\\item\n  and now 3\n\n  with a continuation\n\n  \\begin{enumerate}\n  \\def\\labelenumii{\\roman{enumii}.}\n  \\setcounter{enumii}{3}\n  \\tightlist\n  \\item\n    sublist with roman numerals, starting with 4\n  \\item\n    more items\n\n    \\begin{enumerate}\n    \\def\\labelenumiii{(\\Alph{enumiii})}\n    \\tightlist\n    \\item\n      a subsublist\n    \\item\n      a subsublist\n    \\end{enumerate}\n  \\end{enumerate}\n\\end{enumerate}\n\nNesting:\n\n\\begin{enumerate}\n\\def\\labelenumi{\\Alph{enumi}.}\n\\tightlist\n\\item\n  Upper Alpha\n\n  \\begin{enumerate}\n  \\def\\labelenumii{\\Roman{enumii}.}\n  \\tightlist\n  \\item\n    Upper Roman.\n\n    \\begin{enumerate}\n    \\def\\labelenumiii{(\\arabic{enumiii})}\n    \\setcounter{enumiii}{5}\n    \\tightlist\n    \\item\n      Decimal start with 6\n\n      \\begin{enumerate}\n      \\def\\labelenumiv{\\alph{enumiv})}\n      \\setcounter{enumiv}{2}\n      \\tightlist\n      \\item\n        Lower alpha with paren\n      \\end{enumerate}\n    \\end{enumerate}\n  \\end{enumerate}\n\\end{enumerate}\n\nAutonumbering:\n\n\\begin{enumerate}\n\\tightlist\n\\item\n  Autonumber.\n\\item\n  More.\n\n  \\begin{enumerate}\n  \\tightlist\n  \\item\n    Nested.\n  \\end{enumerate}\n\\end{enumerate}\n\nShould not be a list item:\n\nM.A.~2007\n\nB. Williams\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Definition Lists}\\label{definition-lists}\n\nTight using spaces:\n\n\\begin{description}\n\\tightlist\n\\item[apple]\nred fruit\n\\item[orange]\norange fruit\n\\item[banana]\nyellow fruit\n\\end{description}\n\nTight using tabs:\n\n\\begin{description}\n\\tightlist\n\\item[apple]\nred fruit\n\\item[orange]\norange fruit\n\\item[banana]\nyellow fruit\n\\end{description}\n\nLoose:\n\n\\begin{description}\n\\item[apple]\nred fruit\n\\item[orange]\norange fruit\n\\item[banana]\nyellow fruit\n\\end{description}\n\nMultiple blocks with italics:\n\n\\begin{description}\n\\item[\\emph{apple}]\nred fruit\n\ncontains seeds, crisp, pleasant to taste\n\\item[\\emph{orange}]\norange fruit\n\n\\begin{verbatim}\n{ orange code block }\n\\end{verbatim}\n\n\\begin{quote}\norange block quote\n\\end{quote}\n\\end{description}\n\nMultiple definitions, tight:\n\n\\begin{description}\n\\tightlist\n\\item[apple]\nred fruit\n\ncomputer\n\\item[orange]\norange fruit\n\nbank\n\\end{description}\n\nMultiple definitions, loose:\n\n\\begin{description}\n\\item[apple]\nred fruit\n\ncomputer\n\\item[orange]\norange fruit\n\nbank\n\\end{description}\n\nBlank line after term, indented marker, alternate markers:\n\n\\begin{description}\n\\item[apple]\nred fruit\n\ncomputer\n\\item[orange]\norange fruit\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  sublist\n\\item\n  sublist\n\\end{enumerate}\n\\end{description}\n\n\\section{HTML Blocks}\\label{html-blocks}\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is \\emph{emphasized}\n\nAnd this is \\textbf{strong}\n\nHere's a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n\\begin{verbatim}\n<div>\n    foo\n</div>\n\\end{verbatim}\n\nAs should this:\n\n\\begin{verbatim}\n<div>foo</div>\n\\end{verbatim}\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n\\begin{verbatim}\n<!-- Comment -->\n\\end{verbatim}\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n\\begin{verbatim}\n<hr />\n\\end{verbatim}\n\nHr's:\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Inline Markup}\\label{inline-markup}\n\nThis is \\emph{emphasized}, and so \\emph{is this}.\n\nThis is \\textbf{strong}, and so \\textbf{is this}.\n\nAn \\emph{\\href{/url}{emphasized link}}.\n\n\\textbf{\\emph{This is strong and em.}}\n\nSo is \\textbf{\\emph{this}} word.\n\n\\textbf{\\emph{This is strong and em.}}\n\nSo is \\textbf{\\emph{this}} word.\n\nThis is code: \\texttt{\\textgreater{}}, \\texttt{\\$}, \\texttt{\\textbackslash{}},\n\\texttt{\\textbackslash{}\\$}, \\texttt{\\textless{}html\\textgreater{}}.\n\n\\st{This is \\emph{strikeout}.}\n\nSuperscripts: a\\textsuperscript{bc}d a\\textsuperscript{\\emph{hello}}\na\\textsuperscript{hello~there}.\n\nSubscripts: H\\textsubscript{2}O, H\\textsubscript{23}O,\nH\\textsubscript{many~of~them}O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na\\^{}b c\\^{}d, a\\textasciitilde b c\\textasciitilde d.\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Smart quotes, ellipses, dashes}\\label{smart-quotes-ellipses-dashes}\n\n``Hello,'' said the spider. ``\\,`Shelob' is my name.''\n\n`A', `B', and `C' are letters.\n\n`Oak,' `elm,' and `beech' are names of trees. So is `pine.'\n\n`He said, ``I want to go.''\\,' Were you alive in the 70's?\n\nHere is some quoted `\\texttt{code}' and a\n``\\href{http://example.com/?foo=1&bar=2}{quoted link}''.\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses\\ldots and\\ldots and\\ldots.\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{LaTeX}\\label{latex}\n\n\\begin{itemize}\n\\tightlist\n\\item\n  \\cite[22-23]{smith.1899}\n\\item\n  \\(2+2=4\\)\n\\item\n  \\(x \\in y\\)\n\\item\n  \\(\\alpha \\wedge \\omega\\)\n\\item\n  \\(223\\)\n\\item\n  \\(p\\)-Tree\n\\item\n  Here's some display math:\n  \\[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\\]\n\\item\n  Here's one that has a line break in it: \\(\\alpha + \\omega \\times x^2\\).\n\\end{itemize}\n\nThese shouldn't be math:\n\n\\begin{itemize}\n\\tightlist\n\\item\n  To get the famous equation, write \\texttt{\\$e\\ =\\ mc\\^{}2\\$}.\n\\item\n  \\$22,000 is a \\emph{lot} of money. So is \\$34,000. (It worked if ``lot'' is\n  emphasized.)\n\\item\n  Shoes (\\$20) and socks (\\$5).\n\\item\n  Escaped \\texttt{\\$}: \\$73 \\emph{this should be emphasized} 23\\$.\n\\end{itemize}\n\nHere's a LaTeX table:\n\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Special Characters}\\label{special-characters}\n\nHere is some unicode:\n\n\\begin{itemize}\n\\tightlist\n\\item\n  I hat: Î\n\\item\n  o umlaut: ö\n\\item\n  section: §\n\\item\n  set membership: ∈\n\\item\n  copyright: ©\n\\end{itemize}\n\nAT\\&T has an ampersand in their name.\n\nAT\\&T is another way to write it.\n\nThis \\& that.\n\n4 \\textless{} 5.\n\n6 \\textgreater{} 5.\n\nBackslash: \\textbackslash{}\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: {[}\n\nRight bracket: {]}\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: \\textgreater{}\n\nHash: \\#\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Links}\\label{links}\n\n\\subsection{Explicit}\\label{explicit}\n\nJust a \\href{/url/}{URL}.\n\n\\href{/url/}{URL and title}.\n\n\\href{/url/}{URL and title}.\n\n\\href{/url/}{URL and title}.\n\n\\href{/url/}{URL and title}\n\n\\href{/url/}{URL and title}\n\n\\href{/url/with_underscore}{with\\_underscore}\n\n\\href{mailto:nobody@nowhere.net}{Email link}\n\n\\href{}{Empty}.\n\n\\subsection{Reference}\\label{reference}\n\nFoo \\href{/url/}{bar}.\n\nWith \\href{/url/}{embedded {[}brackets{]}}.\n\n\\href{/url/}{b} by itself should be a link.\n\nIndented \\href{/url}{once}.\n\nIndented \\href{/url}{twice}.\n\nIndented \\href{/url}{thrice}.\n\nThis should {[}not{]}{[}{]} be a link.\n\n\\begin{verbatim}\n[not]: /url\n\\end{verbatim}\n\nFoo \\href{/url/}{bar}.\n\nFoo \\href{/url/}{biz}.\n\n\\subsection{With ampersands}\\label{with-ampersands}\n\nHere's a \\href{http://example.com/?foo=1&bar=2}{link with an ampersand in the\nURL}.\n\nHere's a link with an amersand in the link text: \\href{http://att.com/}{AT\\&T}.\n\nHere's an \\href{/script?foo=1&bar=2}{inline link}.\n\nHere's an \\href{/script?foo=1&bar=2}{inline link in pointy braces}.\n\n\\subsection{Autolinks}\\label{autolinks}\n\nWith an ampersand: \\url{http://example.com/?foo=1&bar=2}\n\n\\begin{itemize}\n\\tightlist\n\\item\n  In a list?\n\\item\n  \\url{http://example.com/}\n\\item\n  It should.\n\\end{itemize}\n\nAn e-mail address:\n\\href{mailto:nobody@nowhere.net}{\\nolinkurl{nobody@nowhere.net}}\n\n\\begin{quote}\nBlockquoted: \\url{http://example.com/}\n\\end{quote}\n\nAuto-links should not occur here:\n\\texttt{\\textless{}http://example.com/\\textgreater{}}\n\n\\begin{verbatim}\nor here: <http://example.com/>\n\\end{verbatim}\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Images}\\label{images}\n\nFrom ``Voyage dans la Lune'' by Georges Melies (1902):\n\n\\begin{figure}\n\\centering\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={lalune}]{lalune.jpg}}\n\\caption{lalune}\n\\end{figure}\n\nHere is a movie\n\\pandocbounded{\\includegraphics[keepaspectratio,alt={movie}]{movie.jpg}} icon.\n\n\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\n\n\\section{Footnotes}\\label{footnotes}\n\nHere is a footnote reference,\\footnote{Here is the footnote. It can go anywhere\n  after the footnote reference. It need not be placed at the end of the\n  document.} and another.\\footnote{Here's the long note. This one contains\n  multiple blocks.\n\n  Subsequent blocks are indented to show that they belong to the footnote (as\n  with list items).\n\n\\begin{Verbatim}\n  { <code> }\n\\end{Verbatim}\n\n  If you want, you can indent every line, but you can also be lazy and just\n  indent the first line of each block.} This should \\emph{not} be a footnote\nreference, because it contains a space.{[}\\^{}my note{]} Here is an inline\nnote.\\footnote{This is \\emph{easier} to type. Inline notes may contain\n  \\href{http://google.com}{links} and \\texttt{{]}} verbatim characters, as well\n  as {[}bracketed text{]}.}\n\n\\begin{quote}\nNotes can go in quotes.\\footnote{In quote.}\n\\end{quote}\n\n\\begin{enumerate}\n\\def\\labelenumi{\\arabic{enumi}.}\n\\tightlist\n\\item\n  And in list items.\\footnote{In list.}\n\\end{enumerate}\n\nThis paragraph should not be part of the note, as it is not indented.\n\n\\end{document}\n"
  },
  {
    "path": "test/writer.man",
    "content": ".TH \"Pandoc Test Suite\" \"\" \"July 17, 2006\" \"\"\n.PP\nThis is a set of tests for pandoc.\nMost of them are adapted from John Gruber\\(cqs markdown test suite.\n.PP\n   *   *   *   *   *\n.SH Headers\n.SS Level 2 with an embedded link\n.SS Level 3 with \\f[I]emphasis\\f[R]\n.SS Level 4\n.SS Level 5\n.SH Level 1\n.SS Level 2 with \\f[I]emphasis\\f[R]\n.SS Level 3\nwith no blank line\n.SS Level 2\nwith no blank line\n.PP\n   *   *   *   *   *\n.SH Paragraphs\nHere\\(cqs a regular paragraph.\n.PP\nIn Markdown 1.0.0 and earlier.\nVersion 8.\nThis line turns into a list item.\nBecause a hard\\-wrapped line in the middle of a paragraph looked like a list\nitem.\n.PP\nHere\\(cqs one with a bullet.\n* criminey.\n.PP\nThere should be a hard line break\n.PD 0\n.P\n.PD\nhere.\n.PP\n   *   *   *   *   *\n.SH Block Quotes\nE\\-mail style:\n.RS\n.PP\nThis is a block quote.\nIt is pretty short.\n.RE\n.RS\n.PP\nCode in a block quote:\n.IP\n.EX\nsub status {\n    print \\(dqworking\\(dq;\n}\n.EE\n.PP\nA list:\n.IP \"1.\" 3\nitem one\n.IP \"2.\" 3\nitem two\n.PP\nNested block quotes:\n.RS\n.PP\nnested\n.RE\n.RS\n.PP\nnested\n.RE\n.RE\n.PP\nThis should not be a block quote: 2 > 1.\n.PP\nAnd a following paragraph.\n.PP\n   *   *   *   *   *\n.SH Code Blocks\nCode:\n.IP\n.EX\n\\-\\-\\-\\- (should be four hyphens)\n\nsub status {\n    print \\(dqworking\\(dq;\n}\n\nthis code block is indented by one tab\n.EE\n.PP\nAnd:\n.IP\n.EX\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\(rs$ \\(rs\\(rs \\(rs> \\(rs[ \\(rs{\n.EE\n.PP\n   *   *   *   *   *\n.SH Lists\n.SS Unordered\nAsterisks tight:\n.IP \\(bu 2\nasterisk 1\n.IP \\(bu 2\nasterisk 2\n.IP \\(bu 2\nasterisk 3\n.PP\nAsterisks loose:\n.IP \\(bu 2\nasterisk 1\n.IP \\(bu 2\nasterisk 2\n.IP \\(bu 2\nasterisk 3\n.PP\nPluses tight:\n.IP \\(bu 2\nPlus 1\n.IP \\(bu 2\nPlus 2\n.IP \\(bu 2\nPlus 3\n.PP\nPluses loose:\n.IP \\(bu 2\nPlus 1\n.IP \\(bu 2\nPlus 2\n.IP \\(bu 2\nPlus 3\n.PP\nMinuses tight:\n.IP \\(bu 2\nMinus 1\n.IP \\(bu 2\nMinus 2\n.IP \\(bu 2\nMinus 3\n.PP\nMinuses loose:\n.IP \\(bu 2\nMinus 1\n.IP \\(bu 2\nMinus 2\n.IP \\(bu 2\nMinus 3\n.SS Ordered\nTight:\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond\n.IP \"3.\" 3\nThird\n.PP\nand:\n.IP \"1.\" 3\nOne\n.IP \"2.\" 3\nTwo\n.IP \"3.\" 3\nThree\n.PP\nLoose using tabs:\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond\n.IP \"3.\" 3\nThird\n.PP\nand using spaces:\n.IP \"1.\" 3\nOne\n.IP \"2.\" 3\nTwo\n.IP \"3.\" 3\nThree\n.PP\nMultiple paragraphs:\n.IP \"1.\" 3\nItem 1, graf one.\n.RS 4\n.PP\nItem 1.\ngraf two.\nThe quick brown fox jumped over the lazy dog\\(cqs back.\n.RE\n.IP \"2.\" 3\nItem 2.\n.IP \"3.\" 3\nItem 3.\n.SS Nested\n.IP \\(bu 2\nTab\n.RS 2\n.IP \\(bu 2\nTab\n.RS 2\n.IP \\(bu 2\nTab\n.RE\n.RE\n.PP\nHere\\(cqs another:\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond:\n.RS 4\n.IP \\(bu 2\nFee\n.IP \\(bu 2\nFie\n.IP \\(bu 2\nFoe\n.RE\n.IP \"3.\" 3\nThird\n.PP\nSame thing but with paragraphs:\n.IP \"1.\" 3\nFirst\n.IP \"2.\" 3\nSecond:\n.RS 4\n.IP \\(bu 2\nFee\n.IP \\(bu 2\nFie\n.IP \\(bu 2\nFoe\n.RE\n.IP \"3.\" 3\nThird\n.SS Tabs and spaces\n.IP \\(bu 2\nthis is a list item indented with tabs\n.IP \\(bu 2\nthis is a list item indented with spaces\n.RS 2\n.IP \\(bu 2\nthis is an example list item indented with tabs\n.IP \\(bu 2\nthis is an example list item indented with spaces\n.RE\n.SS Fancy list markers\n.IP \"(2)\" 4\nbegins with 2\n.IP \"(3)\" 4\nand now 3\n.RS 4\n.PP\nwith a continuation\n.IP \"iv.\" 4\nsublist with roman numerals, starting with 4\n.IP \" v.\" 4\nmore items\n.RS 4\n.IP \"(A)\" 4\na subsublist\n.IP \"(B)\" 4\na subsublist\n.RE\n.RE\n.PP\nNesting:\n.IP \"A.\" 3\nUpper Alpha\n.RS 4\n.IP \"I.\" 3\nUpper Roman.\n.RS 4\n.IP \"(6)\" 4\nDecimal start with 6\n.RS 4\n.IP \"c)\" 3\nLower alpha with paren\n.RE\n.RE\n.RE\n.PP\nAutonumbering:\n.IP \"1.\" 3\nAutonumber.\n.IP \"2.\" 3\nMore.\n.RS 4\n.IP \"1.\" 3\nNested.\n.RE\n.PP\nShould not be a list item:\n.PP\nM.A.\\ 2007\n.PP\nB. Williams\n.PP\n   *   *   *   *   *\n.SH Definition Lists\nTight using spaces:\n.TP\napple\nred fruit\n.TP\norange\norange fruit\n.TP\nbanana\nyellow fruit\n.PP\nTight using tabs:\n.TP\napple\nred fruit\n.TP\norange\norange fruit\n.TP\nbanana\nyellow fruit\n.PP\nLoose:\n.TP\napple\nred fruit\n.TP\norange\norange fruit\n.TP\nbanana\nyellow fruit\n.PP\nMultiple blocks with italics:\n.TP\n\\f[I]apple\\f[R]\nred fruit\n.RS\n.PP\ncontains seeds, crisp, pleasant to taste\n.RE\n.TP\n\\f[I]orange\\f[R]\norange fruit\n.RS\n.IP\n.EX\n{ orange code block }\n.EE\n.RS\n.PP\norange block quote\n.RE\n.RE\n.PP\nMultiple definitions, tight:\n.TP\napple\nred fruit\ncomputer\n.TP\norange\norange fruit\nbank\n.PP\nMultiple definitions, loose:\n.TP\napple\nred fruit\ncomputer\n.TP\norange\norange fruit\nbank\n.PP\nBlank line after term, indented marker, alternate markers:\n.TP\napple\nred fruit\ncomputer\n.TP\norange\norange fruit\n.RS\n.IP \"1.\" 3\nsublist\n.IP \"2.\" 3\nsublist\n.RE\n.SH HTML Blocks\nSimple block on one line:\nfoo\n.PP\nAnd nested without indentation:\n.PP\nfoo\nbar\n.PP\nInterpreted markdown in a table:\nThis is \\f[I]emphasized\\f[R]\nAnd this is \\f[B]strong\\f[R]\n.PP\nHere\\(cqs a simple block:\n.PP\nfoo\n.PP\nThis should be a code block, though:\n.IP\n.EX\n<div>\n    foo\n</div>\n.EE\n.PP\nAs should this:\n.IP\n.EX\n<div>foo</div>\n.EE\n.PP\nNow, nested:\nfoo\n.PP\nThis should just be an HTML comment:\n.PP\nMultiline:\n.PP\nCode block:\n.IP\n.EX\n<!\\-\\- Comment \\-\\->\n.EE\n.PP\nJust plain comment, with trailing spaces on the line:\n.PP\nCode:\n.IP\n.EX\n<hr />\n.EE\n.PP\nHr\\(cqs:\n.PP\n   *   *   *   *   *\n.SH Inline Markup\nThis is \\f[I]emphasized\\f[R], and so \\f[I]is this\\f[R].\n.PP\nThis is \\f[B]strong\\f[R], and so \\f[B]is this\\f[R].\n.PP\nAn \\f[I]emphasized link\\f[R].\n.PP\n\\f[B]\\f[BI]This is strong and em.\\f[B]\\f[R]\n.PP\nSo is \\f[B]\\f[BI]this\\f[B]\\f[R] word.\n.PP\n\\f[B]\\f[BI]This is strong and em.\\f[B]\\f[R]\n.PP\nSo is \\f[B]\\f[BI]this\\f[B]\\f[R] word.\n.PP\nThis is code: \\f[CR]>\\f[R], \\f[CR]$\\f[R], \\f[CR]\\(rs\\f[R], \\f[CR]\\(rs$\\f[R],\n\\f[CR]<html>\\f[R].\n.PP\n[STRIKEOUT:This is \\f[I]strikeout\\f[R].]\n.PP\nSuperscripts: a^bc^d a^\\f[I]hello\\f[R]^ a^hello\\ there^.\n.PP\nSubscripts: H~2~O, H~23~O, H~many\\ of\\ them~O.\n.PP\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na\\(hab c\\(had, a\\(tib c\\(tid.\n.PP\n   *   *   *   *   *\n.SH Smart quotes, ellipses, dashes\n\\(lqHello,\\(rq said the spider.\n\\(lq`Shelob' is my name.\\(rq\n.PP\n`A', `B', and `C' are letters.\n.PP\n`Oak,' `elm,' and `beech' are names of trees.\nSo is `pine.'\n.PP\n`He said, \\(lqI want to go.\\(rq' Were you alive in the 70\\(cqs?\n.PP\nHere is some quoted `\\f[CR]code\\f[R]' and a \\(lq\\c\n.UR http://example.com/?foo=1&bar=2\nquoted link\n.UE \\c\n\\(rq.\n.PP\nSome dashes: one\\(emtwo \\(em three\\(emfour \\(em five.\n.PP\nDashes between numbers: 5\\(en7, 255\\(en66, 1987\\(en1999.\n.PP\nEllipses\\&...and\\&...and\\&....\n.PP\n   *   *   *   *   *\n.SH LaTeX\n.IP \\(bu 2\n.IP \\(bu 2\n2 + 2 = 4\n.IP \\(bu 2\n\\f[I]x\\f[R] ∈ \\f[I]y\\f[R]\n.IP \\(bu 2\n\\f[I]α\\f[R] ∧ \\f[I]ω\\f[R]\n.IP \\(bu 2\n223\n.IP \\(bu 2\n\\f[I]p\\f[R]\\-Tree\n.IP \\(bu 2\nHere\\(cqs some display math:\n.RS\n$$\\(rsfrac{d}{dx}f(x)=\\(rslim_{h\\(rsto 0}\\(rsfrac{f(x+h)\\-f(x)}{h}$$\n.RE\n.IP \\(bu 2\nHere\\(cqs one that has a line break in it:\n\\f[I]α\\f[R] + \\f[I]ω\\f[R] × \\f[I]x\\f[R]^2^.\n.PP\nThese shouldn\\(cqt be math:\n.IP \\(bu 2\nTo get the famous equation, write \\f[CR]$e = mc\\(ha2$\\f[R].\n.IP \\(bu 2\n$22,000 is a \\f[I]lot\\f[R] of money.\nSo is $34,000.\n(It worked if \\(lqlot\\(rq is emphasized.)\n.IP \\(bu 2\nShoes ($20) and socks ($5).\n.IP \\(bu 2\nEscaped \\f[CR]$\\f[R]: $73 \\f[I]this should be emphasized\\f[R] 23$.\n.PP\nHere\\(cqs a LaTeX table:\n.PP\n   *   *   *   *   *\n.SH Special Characters\nHere is some unicode:\n.IP \\(bu 2\nI hat: Î\n.IP \\(bu 2\no umlaut: ö\n.IP \\(bu 2\nsection: §\n.IP \\(bu 2\nset membership: ∈\n.IP \\(bu 2\ncopyright: ©\n.PP\nAT&T has an ampersand in their name.\n.PP\nAT&T is another way to write it.\n.PP\nThis & that.\n.PP\n4 < 5.\n.PP\n6 > 5.\n.PP\nBackslash: \\(rs\n.PP\nBacktick: \\(ga\n.PP\nAsterisk: *\n.PP\nUnderscore: _\n.PP\nLeft brace: {\n.PP\nRight brace: }\n.PP\nLeft bracket: [\n.PP\nRight bracket: ]\n.PP\nLeft paren: (\n.PP\nRight paren: )\n.PP\nGreater\\-than: >\n.PP\nHash: #\n.PP\nPeriod: .\n.PP\nBang: !\n.PP\nPlus: +\n.PP\nMinus: \\-\n.PP\n   *   *   *   *   *\n.SH Links\n.SS Explicit\nJust a URL.\n.PP\nURL and title.\n.PP\nURL and title.\n.PP\nURL and title.\n.PP\nURL and title\n.PP\nURL and title\n.PP\nwith_underscore\n.PP\n\\c\n.MT nobody@nowhere.net\nEmail link\n.ME \\c\n.PP\nEmpty.\n.SS Reference\nFoo bar.\n.PP\nWith embedded [brackets].\n.PP\nb by itself should be a link.\n.PP\nIndented once.\n.PP\nIndented twice.\n.PP\nIndented thrice.\n.PP\nThis should [not][] be a link.\n.IP\n.EX\n[not]: /url\n.EE\n.PP\nFoo bar.\n.PP\nFoo biz.\n.SS With ampersands\nHere\\(cqs a \\c\n.UR http://example.com/?foo=1&bar=2\nlink with an ampersand in the URL\n.UE \\c\n\\&.\n.PP\nHere\\(cqs a link with an amersand in the link text: \\c\n.UR http://att.com/\nAT&T\n.UE \\c\n\\&.\n.PP\nHere\\(cqs an inline link.\n.PP\nHere\\(cqs an inline link in pointy braces.\n.SS Autolinks\nWith an ampersand: \\c\n.UR http://example.com/?foo=1&bar=2\n.UE \\c\n.IP \\(bu 2\nIn a list?\n.IP \\(bu 2\n\\c\n.UR http://example.com/\n.UE \\c\n.IP \\(bu 2\nIt should.\n.PP\nAn e\\-mail address: \\c\n.MT nobody@nowhere.net\n.ME \\c\n.RS\n.PP\nBlockquoted: \\c\n.UR http://example.com/\n.UE \\c\n.RE\n.PP\nAuto\\-links should not occur here: \\f[CR]<http://example.com/>\\f[R]\n.IP\n.EX\nor here: <http://example.com/>\n.EE\n.PP\n   *   *   *   *   *\n.SH Images\nFrom \\(lqVoyage dans la Lune\\(rq by Georges Melies (1902):\n[IMAGE: lalune]\nlalune\n.PP\nHere is a movie [IMAGE: movie] icon.\n.PP\n   *   *   *   *   *\n.SH Footnotes\nHere is a footnote reference,[1] and another.[2] This should \\f[I]not\\f[R] be a\nfootnote reference, because it contains a space.[\\(hamy note] Here is an inline\nnote.[3]\n.RS\n.PP\nNotes can go in quotes.[4]\n.RE\n.IP \"1.\" 3\nAnd in list items.[5]\n.PP\nThis paragraph should not be part of the note, as it is not indented.\n.SH NOTES\n.SS [1]\n.PP\nHere is the footnote.\nIt can go anywhere after the footnote reference.\nIt need not be placed at the end of the document.\n.SS [2]\n.PP\nHere\\(cqs the long note.\nThis one contains multiple blocks.\n.PP\nSubsequent blocks are indented to show that they belong to the footnote (as with\nlist items).\n.IP\n.EX\n  { <code> }\n.EE\n.PP\nIf you want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.\n.SS [3]\n.PP\nThis is \\f[I]easier\\f[R] to type.\nInline notes may contain \\c\n.UR http://google.com\nlinks\n.UE \\c\n\\ and \\f[CR]]\\f[R] verbatim characters, as well as [bracketed text].\n.SS [4]\n.PP\nIn quote.\n.SS [5]\n.PP\nIn list.\n.SH AUTHORS\nJohn MacFarlane; Anonymous.\n"
  },
  {
    "path": "test/writer.markdown",
    "content": "---\nauthor:\n- John MacFarlane\n- Anonymous\ndate: July 17, 2006\ntitle: Pandoc Test Suite\n---\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n--------------------------------------------------------------------------------\n\n# Headers\n\n## Level 2 with an [embedded link](/url)\n\n### Level 3 with *emphasis*\n\n#### Level 4\n\n##### Level 5\n\n# Level 1\n\n## Level 2 with *emphasis*\n\n### Level 3\n\nwith no blank line\n\n## Level 2\n\nwith no blank line\n\n--------------------------------------------------------------------------------\n\n# Paragraphs\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. \\* criminey.\n\nThere should be a hard line break\\\nhere.\n\n--------------------------------------------------------------------------------\n\n# Block Quotes\n\nE-mail style:\n\n> This is a block quote. It is pretty short.\n\n> Code in a block quote:\n>\n>     sub status {\n>         print \"working\";\n>     }\n>\n> A list:\n>\n> 1.  item one\n> 2.  item two\n>\n> Nested block quotes:\n>\n> > nested\n>\n> > nested\n\nThis should not be a block quote: 2 \\> 1.\n\nAnd a following paragraph.\n\n--------------------------------------------------------------------------------\n\n# Code Blocks\n\nCode:\n\n    ---- (should be four hyphens)\n\n    sub status {\n        print \"working\";\n    }\n\n    this code block is indented by one tab\n\nAnd:\n\n        this code block is indented by two tabs\n\n    These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\n--------------------------------------------------------------------------------\n\n# Lists\n\n## Unordered\n\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\n## Ordered\n\nTight:\n\n1.  First\n2.  Second\n3.  Third\n\nand:\n\n1.  One\n2.  Two\n3.  Three\n\nLoose using tabs:\n\n1.  First\n\n2.  Second\n\n3.  Third\n\nand using spaces:\n\n1.  One\n\n2.  Two\n\n3.  Three\n\nMultiple paragraphs:\n\n1.  Item 1, graf one.\n\n    Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n2.  Item 2.\n\n3.  Item 3.\n\n## Nested\n\n- Tab\n  - Tab\n    - Tab\n\nHere's another:\n\n1.  First\n2.  Second:\n    - Fee\n    - Fie\n    - Foe\n3.  Third\n\nSame thing but with paragraphs:\n\n1.  First\n\n2.  Second:\n\n    - Fee\n    - Fie\n    - Foe\n\n3.  Third\n\n## Tabs and spaces\n\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\n## Fancy list markers\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v.  more items\n        (A) a subsublist\n        (B) a subsublist\n\nNesting:\n\nA.  Upper Alpha\n    I.  Upper Roman.\n        (6) Decimal start with 6\n            c)  Lower alpha with paren\n\nAutonumbering:\n\n1.  Autonumber.\n2.  More.\n    1.  Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n--------------------------------------------------------------------------------\n\n# Definition Lists\n\nTight using spaces:\n\napple\n:   red fruit\n\norange\n:   orange fruit\n\nbanana\n:   yellow fruit\n\nTight using tabs:\n\napple\n:   red fruit\n\norange\n:   orange fruit\n\nbanana\n:   yellow fruit\n\nLoose:\n\napple\n\n:   red fruit\n\norange\n\n:   orange fruit\n\nbanana\n\n:   yellow fruit\n\nMultiple blocks with italics:\n\n*apple*\n\n:   red fruit\n\n    contains seeds, crisp, pleasant to taste\n\n*orange*\n\n:   orange fruit\n\n        { orange code block }\n\n    > orange block quote\n\nMultiple definitions, tight:\n\napple\n:   red fruit\n:   computer\n\norange\n:   orange fruit\n:   bank\n\nMultiple definitions, loose:\n\napple\n\n:   red fruit\n\n:   computer\n\norange\n\n:   orange fruit\n\n:   bank\n\nBlank line after term, indented marker, alternate markers:\n\napple\n\n:   red fruit\n\n:   computer\n\norange\n\n:   orange fruit\n\n    1.  sublist\n    2.  sublist\n\n# HTML Blocks\n\nSimple block on one line:\n\n::: {}\nfoo\n:::\n\nAnd nested without indentation:\n\n:::::: {}\n:::: {}\n::: {}\nfoo\n:::\n::::\n\n::: {}\nbar\n:::\n::::::\n\nInterpreted markdown in a table:\n\n<table>\n<tr>\n<td>\nThis is *emphasized*\n</td>\n<td>\nAnd this is **strong**\n</td>\n</tr>\n</table>\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n\nHere's a simple block:\n\n::: {}\nfoo\n:::\n\nThis should be a code block, though:\n\n    <div>\n        foo\n    </div>\n\nAs should this:\n\n    <div>foo</div>\n\nNow, nested:\n\n::::: {}\n:::: {}\n::: {}\nfoo\n:::\n::::\n:::::\n\nThis should just be an HTML comment:\n\n<!-- Comment -->\n\nMultiline:\n\n<!--\nBlah\nBlah\n-->\n<!--\n    This is another comment.\n-->\n\nCode block:\n\n    <!-- Comment -->\n\nJust plain comment, with trailing spaces on the line:\n\n<!-- foo -->\n\nCode:\n\n    <hr />\n\nHr's:\n\n<hr>\n<hr />\n<hr />\n<hr>\n<hr />\n<hr />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\">\n\n--------------------------------------------------------------------------------\n\n# Inline Markup\n\nThis is *emphasized*, and so *is this*.\n\nThis is **strong**, and so **is this**.\n\nAn *[emphasized link](/url)*.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n~~This is *strikeout*.~~\n\nSuperscripts: a^bc^d a^*hello*^ a^hello there^.\n\nSubscripts: H~2~O, H~23~O, H~many of them~O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na\\^b c\\^d, a\\~b c\\~d.\n\n--------------------------------------------------------------------------------\n\n# Smart quotes, ellipses, dashes\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted '`code`' and a \"[quoted\nlink](http://example.com/?foo=1&bar=2)\".\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses...and...and....\n\n--------------------------------------------------------------------------------\n\n# LaTeX\n\n- `\\cite[22-23]{smith.1899}`{=tex}\n- $2+2=4$\n- $x \\in y$\n- $\\alpha \\wedge \\omega$\n- $223$\n- $p$-Tree\n- Here's some display math:\n  $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n- Here's one that has a line break in it: $\\alpha + \\omega \\times x^2$.\n\nThese shouldn't be math:\n\n- To get the famous equation, write `$e = mc^2$`.\n- \\$22,000 is a *lot* of money. So is \\$34,000. (It worked if \"lot\" is\n  emphasized.)\n- Shoes (\\$20) and socks (\\$5).\n- Escaped `$`: \\$73 *this should be emphasized* 23\\$.\n\nHere's a LaTeX table:\n\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n\n--------------------------------------------------------------------------------\n\n# Special Characters\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 \\< 5.\n\n6 \\> 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: \\>\n\nHash: \\#\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n--------------------------------------------------------------------------------\n\n# Links\n\n## Explicit\n\nJust a [URL](/url/).\n\n[URL and title](/url/ \"title\").\n\n[URL and title](/url/ \"title preceded by two spaces\").\n\n[URL and title](/url/ \"title preceded by a tab\").\n\n[URL and title](/url/ \"title with \"quotes\" in it\")\n\n[URL and title](/url/ \"title with single quotes\")\n\n[with_underscore](/url/with_underscore)\n\n[Email link](mailto:nobody@nowhere.net)\n\n[Empty]().\n\n## Reference\n\nFoo [bar](/url/).\n\nWith [embedded \\[brackets\\]](/url/).\n\n[b](/url/) by itself should be a link.\n\nIndented [once](/url).\n\nIndented [twice](/url).\n\nIndented [thrice](/url).\n\nThis should \\[not\\]\\[\\] be a link.\n\n    [not]: /url\n\nFoo [bar](/url/ \"Title with \"quotes\" inside\").\n\nFoo [biz](/url/ \"Title with \"quote\" inside\").\n\n## With ampersands\n\nHere's a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).\n\nHere's a link with an amersand in the link text: [AT&T](http://att.com/ \"AT&T\").\n\nHere's an [inline link](/script?foo=1&bar=2).\n\nHere's an [inline link in pointy braces](/script?foo=1&bar=2).\n\n## Autolinks\n\nWith an ampersand: <http://example.com/?foo=1&bar=2>\n\n- In a list?\n- <http://example.com/>\n- It should.\n\nAn e-mail address: <nobody@nowhere.net>\n\n> Blockquoted: <http://example.com/>\n\nAuto-links should not occur here: `<http://example.com/>`\n\n    or here: <http://example.com/>\n\n--------------------------------------------------------------------------------\n\n# Images\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n![lalune](lalune.jpg \"Voyage dans la Lune\")\n\nHere is a movie ![movie](movie.jpg) icon.\n\n--------------------------------------------------------------------------------\n\n# Footnotes\n\nHere is a footnote reference,[^1] and another.[^2] This should *not* be a\nfootnote reference, because it contains a space.\\[\\^my note\\] Here is an inline\nnote.[^3]\n\n> Notes can go in quotes.[^4]\n\n1.  And in list items.[^5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[^1]: Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.\n\n[^2]: Here's the long note. This one contains multiple blocks.\n\n    Subsequent blocks are indented to show that they belong to the footnote (as\n    with list items).\n\n          { <code> }\n\n    If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.\n\n[^3]: This is *easier* to type. Inline notes may contain\n    [links](http://google.com) and `]` verbatim characters, as well as\n    \\[bracketed text\\].\n\n[^4]: In quote.\n\n[^5]: In list.\n"
  },
  {
    "path": "test/writer.markua",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n* * *\n\n{id: headers}\n# Headers\n\n{id: level-2-with-an-embedded-link}\n## Level 2 with an [embedded link](/url)\n\n{id: level-3-with-emphasis}\n### Level 3 with *emphasis*\n\n{id: level-4}\n#### Level 4\n\n{id: level-5}\n##### Level 5\n\n{id: level-1}\n# Level 1\n\n{id: level-2-with-emphasis}\n## Level 2 with *emphasis*\n\n{id: level-3}\n### Level 3\n\nwith no blank line\n\n{id: level-2}\n## Level 2\n\nwith no blank line\n\n* * *\n\n{id: paragraphs}\n# Paragraphs\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n* * *\n\n{id: block-quotes}\n# Block Quotes\n\nE-mail style:\n\n> This is a block quote. It is pretty short.\n\n> Code in a block quote:\n>\n> ```\n> sub status {\n>     print \"working\";\n> }\n> ```\n>\n> A list:\n>\n> 1. item one\n> 2. item two\n>\n> Nested block quotes:\n>\n> > nested\n>\n> > nested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n* * *\n\n{id: code-blocks}\n# Code Blocks\n\nCode:\n\n```\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n```\n\nAnd:\n\n```\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n```\n\n* * *\n\n{id: lists}\n# Lists\n\n{id: unordered}\n## Unordered\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n\n* asterisk 2\n\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n\n* Plus 2\n\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n\n* Minus 2\n\n* Minus 3\n\n{id: ordered}\n## Ordered\n\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n\n2. Second\n\n3. Third\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\n    Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n\n2. Item 2.\n\n3. Item 3.\n\n{id: nested}\n## Nested\n\n* Tab\n  * Tab\n    * Tab\n\nHere’s another:\n\n1. First\n2. Second:\n    * Fee\n    * Fie\n    * Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n    * Fee\n    * Fie\n    * Foe\n\n3. Third\n\n{id: tabs-and-spaces}\n## Tabs and spaces\n\n* this is a list item indented with tabs\n\n* this is a list item indented with spaces\n\n  * this is an example list item indented with tabs\n\n  * this is an example list item indented with spaces\n\n{id: fancy-list-markers}\n## Fancy list markers\n\n2) begins with 2\n\n3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v. more items\n        A) a subsublist\n        B) a subsublist\n\nNesting:\n\nA. Upper Alpha\n    I. Upper Roman.\n        6) Decimal start with 6\n            c) Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n2. More.\n    1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n* * *\n\n{id: definition-lists}\n# Definition Lists\n\nTight using spaces:\n\napple\n: red fruit\n\norange\n: orange fruit\n\nbanana\n: yellow fruit\n\nTight using tabs:\n\napple\n: red fruit\n\norange\n: orange fruit\n\nbanana\n: yellow fruit\n\nLoose:\n\napple\n\n: red fruit\n\norange\n\n: orange fruit\n\nbanana\n\n: yellow fruit\n\nMultiple blocks with italics:\n\n*apple*\n\n: red fruit\n\n  contains seeds, crisp, pleasant to taste\n\n*orange*\n\n: orange fruit\n\n  ```\n  { orange code block }\n  ```\n\n  > orange block quote\n\nMultiple definitions, tight:\n\napple\n: red fruit\n: computer\n\norange\n: orange fruit\n: bank\n\nMultiple definitions, loose:\n\napple\n\n: red fruit\n\n: computer\n\norange\n\n: orange fruit\n\n: bank\n\nBlank line after term, indented marker, alternate markers:\n\napple\n\n: red fruit\n\n: computer\n\norange\n\n: orange fruit\n\n  1. sublist\n  2. sublist\n\n{id: html-blocks}\n# HTML Blocks\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is *emphasized*\nAnd this is **strong**\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n```\n<div>\n    foo\n</div>\n```\n\nAs should this:\n\n```\n<div>foo</div>\n```\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n```\n<!-- Comment -->\n```\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n```\n<hr />\n```\n\nHr’s:\n\n* * *\n\n{id: inline-markup}\n# Inline Markup\n\nThis is *emphasized*, and so *is this*.\n\nThis is **strong**, and so **is this**.\n\nAn *[emphasized link](/url)*.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n~~This is *strikeout*.~~\n\nSuperscripts: a^bc^d a^*hello*^ a^hello there^.\n\nSubscripts: H~2~O, H~23~O, H~many of them~O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n* * *\n\n{id: smart-quotes-ellipses-dashes}\n# Smart quotes, ellipses, dashes\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70’s?\n\nHere is some quoted '`code`' and a \"[quoted\nlink](http://example.com/?foo=1&bar=2)\".\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n* * *\n\n{id: latex}\n# LaTeX\n\n* \n* `2+2=4`$\n* `x \\in y`$\n* `\\alpha \\wedge \\omega`$\n* `223`$\n* `p`$-Tree\n* Here’s some display math:\n\n  {format: latex}\n  ```\n  \\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\n  ```\n* Here’s one that has a line break in it: `\\alpha + \\omega \\times x^2`$.\n\nThese shouldn’t be math:\n\n* To get the famous equation, write `$e = mc^2$`.\n* $22,000 is a *lot* of money. So is $34,000. (It worked if \"lot\" is\n  emphasized.)\n* Shoes ($20) and socks ($5).\n* Escaped `$`: $73 *this should be emphasized* 23$.\n\nHere’s a LaTeX table:\n\n* * *\n\n{id: special-characters}\n# Special Characters\n\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n* * *\n\n{id: links}\n# Links\n\n{id: explicit}\n## Explicit\n\nJust a [URL](/url/).\n\n[URL and title](/url/){title: \"title\"}.\n\n[URL and title](/url/){title: \"title preceded by two spaces\"}.\n\n[URL and title](/url/){title: \"title preceded by a tab\"}.\n\n[URL and title](/url/){title: \"title with \"quotes\" in it\"}\n\n[URL and title](/url/){title: \"title with single quotes\"}\n\n[with_underscore](/url/with_underscore)\n\n[Email link](mailto:nobody@nowhere.net)\n\n[Empty]().\n\n{id: reference}\n## Reference\n\nFoo [bar](/url/).\n\nWith [embedded [brackets]](/url/).\n\n[b](/url/) by itself should be a link.\n\nIndented [once](/url).\n\nIndented [twice](/url).\n\nIndented [thrice](/url).\n\nThis should [not][] be a link.\n\n```\n[not]: /url\n```\n\nFoo [bar](/url/){title: \"Title with \"quotes\" inside\"}.\n\nFoo [biz](/url/){title: \"Title with \"quote\" inside\"}.\n\n{id: with-ampersands}\n## With ampersands\n\nHere’s a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).\n\nHere’s a link with an amersand in the link text:\n[AT&T](http://att.com/){title: \"AT&T\"}.\n\nHere’s an [inline link](/script?foo=1&bar=2).\n\nHere’s an [inline link in pointy braces](/script?foo=1&bar=2).\n\n{id: autolinks}\n## Autolinks\n\nWith an ampersand:\n[http:~/~/example.com/?foo=1&bar=2](http://example.com/?foo=1&bar=2){class: uri}\n\n* In a list?\n* [http:~/~/example.com/](http://example.com/){class: uri}\n* It should.\n\nAn e-mail address: [nobody@nowhere.net](mailto:nobody@nowhere.net){class: email}\n\n> Blockquoted: [http:~/~/example.com/](http://example.com/){class: uri}\n\nAuto-links should not occur here: `<http://example.com/>`\n\n```\nor here: <http://example.com/>\n```\n\n* * *\n\n{id: images}\n# Images\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n{alt: \"lalune\", title: \"Voyage dans la Lune\"}\n![](lalune.jpg)\n\nlalune\n\nHere is a movie\n{alt: \"movie\"}\n![](movie.jpg)\nicon.\n\n* * *\n\n{id: footnotes}\n# Footnotes\n\nHere is a footnote reference,[^1] and another.[^2] This should *not* be a\nfootnote reference, because it contains a space.[^my note] Here is an inline\nnote.[^3]\n\n> Notes can go in quotes.[^4]\n\n1. And in list items.[^5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[^1]: Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.\n\n[^2]: Here’s the long note. This one contains multiple blocks.\n\n    Subsequent blocks are indented to show that they belong to the footnote (as\n    with list items).\n\n    ```\n      { <code> }\n    ```\n\n    If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.\n\n[^3]: This is *easier* to type. Inline notes may contain\n    [links](http://google.com) and `]` verbatim characters, as well as\n    [bracketed text].\n\n[^4]: In quote.\n\n[^5]: In list.\n"
  },
  {
    "path": "test/writer.mediawiki",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.\n\n-----\n\n<span id=\"headers\"></span>\n= Headers =\n\n<span id=\"level-2-with-an-embedded-link\"></span>\n== Level 2 with an [[url|embedded link]] ==\n\n<span id=\"level-3-with-emphasis\"></span>\n=== Level 3 with ''emphasis'' ===\n\n<span id=\"level-4\"></span>\n==== Level 4 ====\n\n<span id=\"level-5\"></span>\n===== Level 5 =====\n\n<span id=\"level-1\"></span>\n= Level 1 =\n\n<span id=\"level-2-with-emphasis\"></span>\n== Level 2 with ''emphasis'' ==\n\n<span id=\"level-3\"></span>\n=== Level 3 ===\n\nwith no blank line\n\n<span id=\"level-2\"></span>\n== Level 2 ==\n\nwith no blank line\n\n-----\n\n<span id=\"paragraphs\"></span>\n= Paragraphs =\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break<br />\nhere.\n\n-----\n\n<span id=\"block-quotes\"></span>\n= Block Quotes =\n\nE-mail style:\n\n<blockquote>This is a block quote. It is pretty short.\n</blockquote>\n<blockquote>Code in a block quote:\n\n<pre>sub status {\n    print &quot;working&quot;;\n}</pre>\nA list:\n\n# item one\n# item two\n\nNested block quotes:\n\n<blockquote>nested\n</blockquote>\n<blockquote>nested\n</blockquote>\n</blockquote>\nThis should not be a block quote: 2 &gt; 1.\n\nAnd a following paragraph.\n\n-----\n\n<span id=\"code-blocks\"></span>\n= Code Blocks =\n\nCode:\n\n<pre>---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab</pre>\nAnd:\n\n<pre>    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{</pre>\n\n-----\n\n<span id=\"lists\"></span>\n= Lists =\n\n<span id=\"unordered\"></span>\n== Unordered ==\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\n<span id=\"ordered\"></span>\n== Ordered ==\n\nTight:\n\n# First\n# Second\n# Third\n\nand:\n\n# One\n# Two\n# Three\n\nLoose using tabs:\n\n# First\n# Second\n# Third\n\nand using spaces:\n\n# One\n# Two\n# Three\n\nMultiple paragraphs:\n\n<ol style=\"list-style-type: decimal;\">\n<li><p>Item 1, graf one.</p>\n<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.</p></li>\n<li><p>Item 2.</p></li>\n<li><p>Item 3.</p></li></ol>\n\n<span id=\"nested\"></span>\n== Nested ==\n\n* Tab\n** Tab\n*** Tab\n\nHere’s another:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\nSame thing but with paragraphs:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\n<span id=\"tabs-and-spaces\"></span>\n== Tabs and spaces ==\n\n* this is a list item indented with tabs\n* this is a list item indented with spaces\n** this is an example list item indented with tabs\n** this is an example list item indented with spaces\n\n<span id=\"fancy-list-markers\"></span>\n== Fancy list markers ==\n\n<ol start=\"2\" style=\"list-style-type: decimal;\">\n<li><p>begins with 2</p></li>\n<li><p>and now 3</p>\n<p>with a continuation</p>\n<ol start=\"4\" style=\"list-style-type: lower-roman;\">\n<li>sublist with roman numerals, starting with 4</li>\n<li>more items\n<ol style=\"list-style-type: upper-alpha;\">\n<li>a subsublist</li>\n<li>a subsublist</li></ol></li></ol></li></ol>\n\nNesting:\n\n<ol style=\"list-style-type: upper-alpha;\">\n<li>Upper Alpha\n<ol style=\"list-style-type: upper-roman;\">\n<li>Upper Roman.\n<ol start=\"6\" style=\"list-style-type: decimal;\">\n<li>Decimal start with 6\n<ol start=\"3\" style=\"list-style-type: lower-alpha;\">\n<li>Lower alpha with paren</li></ol></li></ol></li></ol></li></ol>\n\nAutonumbering:\n\n# Autonumber.\n# More.\n## Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n-----\n\n<span id=\"definition-lists\"></span>\n= Definition Lists =\n\nTight using spaces:\n\n; apple\n: red fruit\n; orange\n: orange fruit\n; banana\n: yellow fruit\n\nTight using tabs:\n\n; apple\n: red fruit\n; orange\n: orange fruit\n; banana\n: yellow fruit\n\nLoose:\n\n; apple\n: red fruit\n; orange\n: orange fruit\n; banana\n: yellow fruit\n\nMultiple blocks with italics:\n\n<dl>\n<dt>''apple''</dt>\n<dd><p>red fruit</p>\n<p>contains seeds, crisp, pleasant to taste</p></dd>\n<dt>''orange''</dt>\n<dd><p>orange fruit</p>\n<pre>{ orange code block }</pre>\n<blockquote><p>orange block quote</p>\n</blockquote></dd></dl>\n\nMultiple definitions, tight:\n\n; apple\n: red fruit\n: computer\n; orange\n: orange fruit\n: bank\n\nMultiple definitions, loose:\n\n; apple\n: red fruit\n: computer\n; orange\n: orange fruit\n: bank\n\nBlank line after term, indented marker, alternate markers:\n\n; apple\n: red fruit\n: computer\n; orange\n: orange fruit\n;# sublist\n;# sublist\n\n<span id=\"html-blocks\"></span>\n= HTML Blocks =\n\nSimple block on one line:\n\n<div>\nfoo\n</div>\n\nAnd nested without indentation:\n\n<div>\n<div>\n<div>\nfoo\n\n</div>\n\n</div>\n\n<div>\nbar\n</div>\n\n</div>\n\nInterpreted markdown in a table:\n\n<table>\n<tr>\n<td>\nThis is ''emphasized''\n</td>\n<td>\nAnd this is '''strong'''\n</td>\n</tr>\n</table>\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\nHere’s a simple block:\n\n<div>\nfoo\n\n</div>\n\nThis should be a code block, though:\n\n<pre>&lt;div&gt;\n    foo\n&lt;/div&gt;</pre>\nAs should this:\n\n<pre>&lt;div&gt;foo&lt;/div&gt;</pre>\nNow, nested:\n\n<div>\n<div>\n<div>\nfoo\n</div>\n\n</div>\n\n</div>\n\nThis should just be an HTML comment:\n\n<!-- Comment -->\nMultiline:\n\n<!--\nBlah\nBlah\n-->\n<!--\n    This is another comment.\n-->\nCode block:\n\n<pre>&lt;!-- Comment --&gt;</pre>\nJust plain comment, with trailing spaces on the line:\n\n<!-- foo -->\nCode:\n\n<pre>&lt;hr /&gt;</pre>\nHr’s:\n\n<hr>\n<hr />\n<hr />\n<hr>\n<hr />\n<hr />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\">\n\n-----\n\n<span id=\"inline-markup\"></span>\n= Inline Markup =\n\nThis is ''emphasized'', and so ''is this''.\n\nThis is '''strong''', and so '''is this'''.\n\nAn ''[[url|emphasized link]]''.\n\n'''''This is strong and em.'''''\n\nSo is '''''this''''' word.\n\n'''''This is strong and em.'''''\n\nSo is '''''this''''' word.\n\nThis is code: <code>&gt;</code>, <code>$</code>, <code>\\</code>, <code>\\$</code>, <code>&lt;html&gt;</code>.\n\n<s>This is ''strikeout''.</s>\n\nSuperscripts: a<sup>bc</sup>d a<sup>''hello''</sup> a<sup>hello there</sup>.\n\nSubscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\n\n-----\n\n<span id=\"smart-quotes-ellipses-dashes\"></span>\n= Smart quotes, ellipses, dashes =\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘<code>code</code>’ and a “[http://example.com/?foo=1&bar=2 quoted link]”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n-----\n\n<span id=\"latex\"></span>\n= LaTeX =\n\n*\n* <math display=\"inline\">2+2=4</math>\n* <math display=\"inline\">x \\in y</math>\n* <math display=\"inline\">\\alpha \\wedge \\omega</math>\n* <math display=\"inline\">223</math>\n* <math display=\"inline\">p</math>-Tree\n* Here’s some display math: <math display=\"block\">\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}</math>\n* Here’s one that has a line break in it: <math display=\"inline\">\\alpha + \\omega \\times x^2</math>.\n\nThese shouldn’t be math:\n\n* To get the famous equation, write <code>$e = mc^2$</code>.\n* $22,000 is a ''lot'' of money. So is $34,000. (It worked if “lot” is emphasized.)\n* Shoes ($20) and socks ($5).\n* Escaped <code>$</code>: $73 ''this should be emphasized'' 23$.\n\nHere’s a LaTeX table:\n\n-----\n\n<span id=\"special-characters\"></span>\n= Special Characters =\n\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&amp;T has an ampersand in their name.\n\nAT&amp;T is another way to write it.\n\nThis &amp; that.\n\n4 &lt; 5.\n\n6 &gt; 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: &gt;\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n-----\n\n<span id=\"links\"></span>\n= Links =\n\n<span id=\"explicit\"></span>\n== Explicit ==\n\nJust a [[url/|URL]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]]\n\n[[url/|URL and title]]\n\n[[url/with_underscore|with_underscore]]\n\n[mailto:nobody@nowhere.net Email link]\n\n[[|Empty]].\n\n<span id=\"reference\"></span>\n== Reference ==\n\nFoo [[url/|bar]].\n\nWith [[url/|embedded [brackets]]].\n\n[[url/|b]] by itself should be a link.\n\nIndented [[url|once]].\n\nIndented [[url|twice]].\n\nIndented [[url|thrice]].\n\nThis should [not][] be a link.\n\n<pre>[not]: /url</pre>\nFoo [[url/|bar]].\n\nFoo [[url/|biz]].\n\n<span id=\"with-ampersands\"></span>\n== With ampersands ==\n\nHere’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL].\n\nHere’s a link with an amersand in the link text: [http://att.com/ AT&amp;T].\n\nHere’s an [[script?foo=1&bar=2|inline link]].\n\nHere’s an [[script?foo=1&bar=2|inline link in pointy braces]].\n\n<span id=\"autolinks\"></span>\n== Autolinks ==\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n* In a list?\n* http://example.com/\n* It should.\n\nAn e-mail address: [mailto:nobody@nowhere.net nobody@nowhere.net]\n\n<blockquote>Blockquoted: http://example.com/\n</blockquote>\nAuto-links should not occur here: <code>&lt;http://example.com/&gt;</code>\n\n<pre>or here: &lt;http://example.com/&gt;</pre>\n\n-----\n\n<span id=\"images\"></span>\n= Images =\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n<div class=\"figure\">\n[[File:lalune.jpg|lalune]]\n</div>\n\nHere is a movie [[File:movie.jpg|movie]] icon.\n\n-----\n\n<span id=\"footnotes\"></span>\n= Footnotes =\n\nHere is a footnote reference,<ref>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with list items).\n\n<pre>  { &lt;code&gt; }</pre>\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</ref> This should ''not'' be a footnote reference, because it contains a space.[^my note] Here is an inline note.<ref>This is ''easier'' to type. Inline notes may contain [http://google.com links] and <code>]</code> verbatim characters, as well as [bracketed text].</ref>\n\n<blockquote>Notes can go in quotes.<ref>In quote.</ref>\n</blockquote>\n# And in list items.<ref>In list.</ref>\n\nThis paragraph should not be part of the note, as it is not indented.\n\n<references />\n"
  },
  {
    "path": "test/writer.ms",
    "content": ".\\\" **** Custom macro definitions *********************************\n.\\\" * Super/subscript\n.\\\" (https://lists.gnu.org/archive/html/groff/2012-07/msg00046.html)\n.ds { \\v'-0.3m'\\\\s[\\\\n[.s]*9u/12u]\n.ds } \\s0\\v'0.3m'\n.ds < \\v'0.3m'\\s[\\\\n[.s]*9u/12u]\n.ds > \\s0\\v'-0.3m'\n.\\\" * Horizontal line\n.de HLINE\n.LP\n.ce\n\\l'20'\n..\n.\\\" **** Settings *************************************************\n.\\\" text width\n.nr LL 5.5i\n.\\\" left margin\n.nr PO 1.25i\n.\\\" top margin\n.nr HM 1.25i\n.\\\" bottom margin\n.nr FM 1.25i\n.\\\" header/footer width\n.nr LT \\n[LL]\n.\\\" point size\n.nr PS 10p\n.\\\" line height\n.nr VS 12p\n.\\\" font family: A, BM, H, HN, N, P, T, ZCM\n.fam T\n.\\\" paragraph indent\n.nr PI 0m\n.\\\" interparagraph space\n.nr PD 0.4v\n.\\\" footnote width\n.nr FL \\n[LL]\n.\\\" footnote point size\n.nr FPS (\\n[PS] - 2000)\n.\\\" color used for strikeout\n.defcolor strikecolor rgb 0.7 0.7 0.7\n.\\\" point size difference between heading levels\n.nr PSINCR 1p\n.\\\" heading level above which point size no longer changes\n.nr GROWPS 2\n.\\\" comment these out if you want a dot after section numbers:\n.als SN SN-NO-DOT\n.als SN-STYLE SN-NO-DOT\n.\\\" page numbers in footer, centered\n.ds CH\n.ds CF %\n.hy\n.EQ\ndelim @@\n.EN\n.\\\" color for links (rgb)\n.ds PDFHREF.COLOUR   0.35 0.00 0.60\n.\\\" border for links (default none)\n.ds PDFHREF.BORDER   0 0 0\n.\\\" pdf outline fold level\n.nr PDFOUTLINE.FOLDLEVEL 3\n.\\\" start out in outline view\n.pdfview /PageMode /UseOutlines\n.\\\" ***************************************************************\n.\\\" PDF metadata\n.pdfinfo /Title \"Pandoc Test Suite\"\n.pdfinfo /Author \"John MacFarlane; Anonymous\"\n.TL\nPandoc Test Suite\n.AU\nJohn MacFarlane\n.AU\nAnonymous\n.AU\n.sp 0.5\n.ft R\nJuly 17, 2006\n.\\\" 1 column (use .2C for two column)\n.1C\n.LP\nThis is a set of tests for pandoc.\nMost of them are adapted from John Gruber\\(cqs markdown test suite.\n.HLINE\n.SH 1\nHeaders\n.pdfhref O 1 \"Headers\"\n.pdfhref M \"headers\"\n.SH 2\nLevel 2 with an \\c\n.pdfhref W -D \"/url\" -A \"\\c\" \\\n -- \"embedded link\"\n\\&\n.pdfhref O 2 \"Level 2 with an embedded link\"\n.pdfhref M \"level-2-with-an-embedded-link\"\n.SH 3\nLevel 3 with \\f[BI]emphasis\\f[B]\n.pdfhref O 3 \"Level 3 with emphasis\"\n.pdfhref M \"level-3-with-emphasis\"\n.SH 4\nLevel 4\n.pdfhref O 4 \"Level 4\"\n.pdfhref M \"level-4\"\n.SH 5\nLevel 5\n.pdfhref O 5 \"Level 5\"\n.pdfhref M \"level-5\"\n.SH 1\nLevel 1\n.pdfhref O 1 \"Level 1\"\n.pdfhref M \"level-1\"\n.SH 2\nLevel 2 with \\f[BI]emphasis\\f[B]\n.pdfhref O 2 \"Level 2 with emphasis\"\n.pdfhref M \"level-2-with-emphasis\"\n.SH 3\nLevel 3\n.pdfhref O 3 \"Level 3\"\n.pdfhref M \"level-3\"\n.LP\nwith no blank line\n.SH 2\nLevel 2\n.pdfhref O 2 \"Level 2\"\n.pdfhref M \"level-2\"\n.LP\nwith no blank line\n.HLINE\n.SH 1\nParagraphs\n.pdfhref O 1 \"Paragraphs\"\n.pdfhref M \"paragraphs\"\n.LP\nHere\\(cqs a regular paragraph.\n.PP\nIn Markdown 1.0.0 and earlier.\nVersion 8.\nThis line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n.PP\nHere\\(cqs one with a bullet.\n* criminey.\n.PP\nThere should be a hard line break\n.br\nhere.\n.HLINE\n.SH 1\nBlock Quotes\n.pdfhref O 1 \"Block Quotes\"\n.pdfhref M \"block-quotes\"\n.LP\nE-mail style:\n.QS\n.LP\nThis is a block quote.\nIt is pretty short.\n.QE\n.QS\n.LP\nCode in a block quote:\n.IP\n.nf\n\\f[C]\nsub status {\n    print \\(dqworking\\(dq;\n}\n\\f[]\n.fi\n.LP\nA list:\n.IP \" 1.\" 4\nitem one\n.IP \" 2.\" 4\nitem two\n.LP\nNested block quotes:\n.QS\n.LP\nnested\n.QE\n.QS\n.LP\nnested\n.QE\n.QE\n.LP\nThis should not be a block quote: 2 > 1.\n.PP\nAnd a following paragraph.\n.HLINE\n.SH 1\nCode Blocks\n.pdfhref O 1 \"Code Blocks\"\n.pdfhref M \"code-blocks\"\n.LP\nCode:\n.IP\n.nf\n\\f[C]\n---- (should be four hyphens)\n\nsub status {\n    print \\(dqworking\\(dq;\n}\n\nthis code block is indented by one tab\n\\f[]\n.fi\n.LP\nAnd:\n.IP\n.nf\n\\f[C]\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\(rs$ \\(rs\\(rs \\(rs> \\(rs[ \\(rs{\n\\f[]\n.fi\n.HLINE\n.SH 1\nLists\n.pdfhref O 1 \"Lists\"\n.pdfhref M \"lists\"\n.SH 2\nUnordered\n.pdfhref O 2 \"Unordered\"\n.pdfhref M \"unordered\"\n.LP\nAsterisks tight:\n.IP \\(bu 3\nasterisk 1\n.IP \\(bu 3\nasterisk 2\n.IP \\(bu 3\nasterisk 3\n.LP\nAsterisks loose:\n.IP \\(bu 3\nasterisk 1\n.IP \\(bu 3\nasterisk 2\n.IP \\(bu 3\nasterisk 3\n.LP\nPluses tight:\n.IP \\(bu 3\nPlus 1\n.IP \\(bu 3\nPlus 2\n.IP \\(bu 3\nPlus 3\n.LP\nPluses loose:\n.IP \\(bu 3\nPlus 1\n.IP \\(bu 3\nPlus 2\n.IP \\(bu 3\nPlus 3\n.LP\nMinuses tight:\n.IP \\(bu 3\nMinus 1\n.IP \\(bu 3\nMinus 2\n.IP \\(bu 3\nMinus 3\n.LP\nMinuses loose:\n.IP \\(bu 3\nMinus 1\n.IP \\(bu 3\nMinus 2\n.IP \\(bu 3\nMinus 3\n.SH 2\nOrdered\n.pdfhref O 2 \"Ordered\"\n.pdfhref M \"ordered\"\n.LP\nTight:\n.IP \" 1.\" 4\nFirst\n.IP \" 2.\" 4\nSecond\n.IP \" 3.\" 4\nThird\n.LP\nand:\n.IP \" 1.\" 4\nOne\n.IP \" 2.\" 4\nTwo\n.IP \" 3.\" 4\nThree\n.LP\nLoose using tabs:\n.IP \" 1.\" 4\nFirst\n.IP \" 2.\" 4\nSecond\n.IP \" 3.\" 4\nThird\n.LP\nand using spaces:\n.IP \" 1.\" 4\nOne\n.IP \" 2.\" 4\nTwo\n.IP \" 3.\" 4\nThree\n.LP\nMultiple paragraphs:\n.IP \" 1.\" 4\nItem 1, graf one.\n.RS 4\n.PP\nItem 1.\ngraf two.\nThe quick brown fox jumped over the lazy dog\\(cqs back.\n.RE\n.IP \" 2.\" 4\nItem 2.\n.IP \" 3.\" 4\nItem 3.\n.SH 2\nNested\n.pdfhref O 2 \"Nested\"\n.pdfhref M \"nested\"\n.IP \\(bu 3\nTab\n.RS 3\n.IP \\(bu 3\nTab\n.RS 3\n.IP \\(bu 3\nTab\n.RE\n.RE\n.LP\nHere\\(cqs another:\n.IP \" 1.\" 4\nFirst\n.IP \" 2.\" 4\nSecond:\n.RS 4\n.IP \\(bu 3\nFee\n.IP \\(bu 3\nFie\n.IP \\(bu 3\nFoe\n.RE\n.IP \" 3.\" 4\nThird\n.LP\nSame thing but with paragraphs:\n.IP \" 1.\" 4\nFirst\n.IP \" 2.\" 4\nSecond:\n.RS 4\n.IP \\(bu 3\nFee\n.IP \\(bu 3\nFie\n.IP \\(bu 3\nFoe\n.RE\n.IP \" 3.\" 4\nThird\n.SH 2\nTabs and spaces\n.pdfhref O 2 \"Tabs and spaces\"\n.pdfhref M \"tabs-and-spaces\"\n.IP \\(bu 3\nthis is a list item indented with tabs\n.IP \\(bu 3\nthis is a list item indented with spaces\n.RS 3\n.IP \\(bu 3\nthis is an example list item indented with tabs\n.IP \\(bu 3\nthis is an example list item indented with spaces\n.RE\n.SH 2\nFancy list markers\n.pdfhref O 2 \"Fancy list markers\"\n.pdfhref M \"fancy-list-markers\"\n.IP \" (2)\" 5\nbegins with 2\n.IP \" (3)\" 5\nand now 3\n.RS 5\n.LP\nwith a continuation\n.IP \" iv.\" 5\nsublist with roman numerals, starting with 4\n.IP \"  v.\" 5\nmore items\n.RS 5\n.IP \" (A)\" 5\na subsublist\n.IP \" (B)\" 5\na subsublist\n.RE\n.RE\n.LP\nNesting:\n.IP \" A.\" 4\nUpper Alpha\n.RS 4\n.IP \" I.\" 4\nUpper Roman.\n.RS 4\n.IP \" (6)\" 5\nDecimal start with 6\n.RS 5\n.IP \" c)\" 4\nLower alpha with paren\n.RE\n.RE\n.RE\n.LP\nAutonumbering:\n.IP \" 1.\" 4\nAutonumber.\n.IP \" 2.\" 4\nMore.\n.RS 4\n.IP \" 1.\" 4\nNested.\n.RE\n.LP\nShould not be a list item:\n.PP\nM.A.\\ 2007\n.PP\nB. Williams\n.HLINE\n.SH 1\nDefinition Lists\n.pdfhref O 1 \"Definition Lists\"\n.pdfhref M \"definition-lists\"\n.LP\nTight using spaces:\n.IP \"\\f[B]apple\\f[R]\" 3\nred fruit\n.RS 3\n.RE\n.IP \"\\f[B]orange\\f[R]\" 3\norange fruit\n.RS 3\n.RE\n.IP \"\\f[B]banana\\f[R]\" 3\nyellow fruit\n.RS 3\n.RE\n.LP\nTight using tabs:\n.IP \"\\f[B]apple\\f[R]\" 3\nred fruit\n.RS 3\n.RE\n.IP \"\\f[B]orange\\f[R]\" 3\norange fruit\n.RS 3\n.RE\n.IP \"\\f[B]banana\\f[R]\" 3\nyellow fruit\n.RS 3\n.RE\n.LP\nLoose:\n.IP \"\\f[B]apple\\f[R]\" 3\nred fruit\n.RS 3\n.RE\n.IP \"\\f[B]orange\\f[R]\" 3\norange fruit\n.RS 3\n.RE\n.IP \"\\f[B]banana\\f[R]\" 3\nyellow fruit\n.RS 3\n.RE\n.LP\nMultiple blocks with italics:\n.IP \"\\f[B]\\f[BI]apple\\f[B]\\f[R]\" 3\nred fruit\n.RS 3\n.PP\ncontains seeds, crisp, pleasant to taste\n.RE\n.IP \"\\f[B]\\f[BI]orange\\f[B]\\f[R]\" 3\norange fruit\n.RS 3\n.IP\n.nf\n\\f[C]\n{ orange code block }\n\\f[]\n.fi\n.QS\n.LP\norange block quote\n.QE\n.RE\n.LP\nMultiple definitions, tight:\n.IP \"\\f[B]apple\\f[R]\" 3\nred fruit\n.RS 3\n.RE\ncomputer\n.RS 3\n.RE\n.IP \"\\f[B]orange\\f[R]\" 3\norange fruit\n.RS 3\n.RE\nbank\n.RS 3\n.RE\n.LP\nMultiple definitions, loose:\n.IP \"\\f[B]apple\\f[R]\" 3\nred fruit\n.RS 3\n.RE\ncomputer\n.RS 3\n.RE\n.IP \"\\f[B]orange\\f[R]\" 3\norange fruit\n.RS 3\n.RE\nbank\n.RS 3\n.RE\n.LP\nBlank line after term, indented marker, alternate markers:\n.IP \"\\f[B]apple\\f[R]\" 3\nred fruit\n.RS 3\n.RE\ncomputer\n.RS 3\n.RE\n.IP \"\\f[B]orange\\f[R]\" 3\norange fruit\n.RS 3\n.IP \" 1.\" 4\nsublist\n.IP \" 2.\" 4\nsublist\n.RE\n.SH 1\nHTML Blocks\n.pdfhref O 1 \"HTML Blocks\"\n.pdfhref M \"html-blocks\"\n.LP\nSimple block on one line:\nfoo\n.LP\nAnd nested without indentation:\n.LP\nfoo\nbar\n.LP\nInterpreted markdown in a table:\nThis is \\f[I]emphasized\\f[R]\nAnd this is \\f[B]strong\\f[R]\n.PP\nHere\\(cqs a simple block:\n.LP\nfoo\n.LP\nThis should be a code block, though:\n.IP\n.nf\n\\f[C]\n<div>\n    foo\n</div>\n\\f[]\n.fi\n.LP\nAs should this:\n.IP\n.nf\n\\f[C]\n<div>foo</div>\n\\f[]\n.fi\n.LP\nNow, nested:\nfoo\n.LP\nThis should just be an HTML comment:\n.PP\nMultiline:\n.PP\nCode block:\n.IP\n.nf\n\\f[C]\n<!-- Comment -->\n\\f[]\n.fi\n.LP\nJust plain comment, with trailing spaces on the line:\n.PP\nCode:\n.IP\n.nf\n\\f[C]\n<hr />\n\\f[]\n.fi\n.LP\nHr\\(cqs:\n.HLINE\n.SH 1\nInline Markup\n.pdfhref O 1 \"Inline Markup\"\n.pdfhref M \"inline-markup\"\n.LP\nThis is \\f[I]emphasized\\f[R], and so \\f[I]is this\\f[R].\n.PP\nThis is \\f[B]strong\\f[R], and so \\f[B]is this\\f[R].\n.PP\nAn \\f[I]\\c\n.pdfhref W -D \"/url\" -A \"\\c\" \\\n -- \"emphasized link\"\n\\&\\f[R].\n.PP\n\\f[B]\\f[BI]This is strong and em.\\f[B]\\f[R]\n.PP\nSo is \\f[B]\\f[BI]this\\f[B]\\f[R] word.\n.PP\n\\f[B]\\f[BI]This is strong and em.\\f[B]\\f[R]\n.PP\nSo is \\f[B]\\f[BI]this\\f[B]\\f[R] word.\n.PP\nThis is code: \\f[CR]>\\f[R], \\f[CR]$\\f[R], \\f[CR]\\(rs\\f[R], \\f[CR]\\(rs$\\f[R],\n\\f[CR]<html>\\f[R].\n.PP\n\\m[strikecolor]This is \\f[I]strikeout\\f[R].\\m[]\n.PP\nSuperscripts: a\\*{bc\\*}d a\\*{\\f[I]hello\\f[R]\\*} a\\*{hello\\ there\\*}.\n.PP\nSubscripts: H\\*<2\\*>O, H\\*<23\\*>O, H\\*<many\\ of\\ them\\*>O.\n.PP\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na\\(hab c\\(had, a\\(tib c\\(tid.\n.HLINE\n.SH 1\nSmart quotes, ellipses, dashes\n.pdfhref O 1 \"Smart quotes, ellipses, dashes\"\n.pdfhref M \"smart-quotes-ellipses-dashes\"\n.LP\n\\(lqHello,\\(rq said the spider.\n\\(lq`Shelob' is my name.\\(rq\n.PP\n`A', `B', and `C' are letters.\n.PP\n`Oak,' `elm,' and `beech' are names of trees.\nSo is `pine.'\n.PP\n`He said, \\(lqI want to go.\\(rq' Were you alive in the 70\\(cqs?\n.PP\nHere is some quoted `\\f[CR]code\\f[R]' and a \\(lq\\c\n.pdfhref W -D \"http://example.com/?foo=1&bar=2\" -A \"\\c\" \\\n -- \"quoted link\"\n\\&\\(rq.\n.PP\nSome dashes: one\\(emtwo \\(em three\\(emfour \\(em five.\n.PP\nDashes between numbers: 5\\(en7, 255\\(en66, 1987\\(en1999.\n.PP\nEllipses\\&...and\\&...and\\&....\n.HLINE\n.SH 1\nLaTeX\n.pdfhref O 1 \"LaTeX\"\n.pdfhref M \"latex\"\n.IP \\(bu 3\n.IP \\(bu 3\n@2 + 2 = 4@\n.IP \\(bu 3\n@x \\[u2208] y@\n.IP \\(bu 3\n@alpha \\[u2227] omega@\n.IP \\(bu 3\n@223@\n.IP \\(bu 3\n@p@-Tree\n.IP \\(bu 3\nHere\\(cqs some display math:\n.EQ\nd over {d x} f ( x ) = lim from {h -> 0} {f ( x + h ) - f ( x )} over h\n.EN\n.IP \\(bu 3\nHere\\(cqs one that has a line break in it: @alpha + omega times x sup 2@.\n.LP\nThese shouldn\\(cqt be math:\n.IP \\(bu 3\nTo get the famous equation, write \\f[CR]$e = mc\\(ha2$\\f[R].\n.IP \\(bu 3\n$22,000 is a \\f[I]lot\\f[R] of money.\nSo is $34,000.\n(It worked if \\(lqlot\\(rq is emphasized.)\n.IP \\(bu 3\nShoes ($20) and socks ($5).\n.IP \\(bu 3\nEscaped \\f[CR]$\\f[R]: $73 \\f[I]this should be emphasized\\f[R] 23$.\n.LP\nHere\\(cqs a LaTeX table:\n.HLINE\n.SH 1\nSpecial Characters\n.pdfhref O 1 \"Special Characters\"\n.pdfhref M \"special-characters\"\n.LP\nHere is some unicode:\n.IP \\(bu 3\nI hat: Î\n.IP \\(bu 3\no umlaut: ö\n.IP \\(bu 3\nsection: §\n.IP \\(bu 3\nset membership: ∈\n.IP \\(bu 3\ncopyright: ©\n.LP\nAT&T has an ampersand in their name.\n.PP\nAT&T is another way to write it.\n.PP\nThis & that.\n.PP\n4 < 5.\n.PP\n6 > 5.\n.PP\nBackslash: \\(rs\n.PP\nBacktick: \\(ga\n.PP\nAsterisk: *\n.PP\nUnderscore: _\n.PP\nLeft brace: {\n.PP\nRight brace: }\n.PP\nLeft bracket: [\n.PP\nRight bracket: ]\n.PP\nLeft paren: (\n.PP\nRight paren: )\n.PP\nGreater-than: >\n.PP\nHash: #\n.PP\nPeriod: .\n.PP\nBang: !\n.PP\nPlus: +\n.PP\nMinus: -\n.HLINE\n.SH 1\nLinks\n.pdfhref O 1 \"Links\"\n.pdfhref M \"links\"\n.SH 2\nExplicit\n.pdfhref O 2 \"Explicit\"\n.pdfhref M \"explicit\"\n.LP\nJust a \\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"URL\"\n\\&.\n.PP\n\\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"URL and title\"\n\\&.\n.PP\n\\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"URL and title\"\n\\&.\n.PP\n\\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"URL and title\"\n\\&.\n.PP\n\\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"URL and title\"\n\\&\n.PP\n\\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"URL and title\"\n\\&\n.PP\n\\c\n.pdfhref W -D \"/url/with_underscore\" -A \"\\c\" \\\n -- \"with_underscore\"\n\\&\n.PP\n\\c\n.pdfhref W -D \"mailto:nobody%40nowhere.net\" -A \"\\c\" \\\n -- \"Email link\"\n\\&\n.PP\n\\c\n.pdfhref W -D \"\" -A \"\\c\" \\\n -- \"Empty\"\n\\&.\n.SH 2\nReference\n.pdfhref O 2 \"Reference\"\n.pdfhref M \"reference\"\n.LP\nFoo \\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"bar\"\n\\&.\n.PP\nWith \\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"embedded [brackets]\"\n\\&.\n.PP\n\\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"b\"\n\\& by itself should be a link.\n.PP\nIndented \\c\n.pdfhref W -D \"/url\" -A \"\\c\" \\\n -- \"once\"\n\\&.\n.PP\nIndented \\c\n.pdfhref W -D \"/url\" -A \"\\c\" \\\n -- \"twice\"\n\\&.\n.PP\nIndented \\c\n.pdfhref W -D \"/url\" -A \"\\c\" \\\n -- \"thrice\"\n\\&.\n.PP\nThis should [not][] be a link.\n.IP\n.nf\n\\f[C]\n[not]: /url\n\\f[]\n.fi\n.LP\nFoo \\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"bar\"\n\\&.\n.PP\nFoo \\c\n.pdfhref W -D \"/url/\" -A \"\\c\" \\\n -- \"biz\"\n\\&.\n.SH 2\nWith ampersands\n.pdfhref O 2 \"With ampersands\"\n.pdfhref M \"with-ampersands\"\n.LP\nHere\\(cqs a \\c\n.pdfhref W -D \"http://example.com/?foo=1&bar=2\" -A \"\\c\" \\\n -- \"link with an ampersand in the URL\"\n\\&.\n.PP\nHere\\(cqs a link with an amersand in the link text: \\c\n.pdfhref W -D \"http://att.com/\" -A \"\\c\" \\\n -- \"AT&T\"\n\\&.\n.PP\nHere\\(cqs an \\c\n.pdfhref W -D \"/script?foo=1&bar=2\" -A \"\\c\" \\\n -- \"inline link\"\n\\&.\n.PP\nHere\\(cqs an \\c\n.pdfhref W -D \"/script?foo=1&bar=2\" -A \"\\c\" \\\n -- \"inline link in pointy braces\"\n\\&.\n.SH 2\nAutolinks\n.pdfhref O 2 \"Autolinks\"\n.pdfhref M \"autolinks\"\n.LP\nWith an ampersand: \\c\n.pdfhref W -D \"http://example.com/?foo=1&bar=2\" -A \"\\c\" \\\n -- \"http://example.com/?foo=1&bar=2\"\n\\&\n.IP \\(bu 3\nIn a list?\n.IP \\(bu 3\n\\c\n.pdfhref W -D \"http://example.com/\" -A \"\\c\" \\\n -- \"http://example.com/\"\n\\&\n.IP \\(bu 3\nIt should.\n.LP\nAn e-mail address: \\c\n.pdfhref W -D \"mailto:nobody%40nowhere.net\" -A \"\\c\" \\\n -- \"nobody\\(atnowhere.net\"\n\\&\n.QS\n.LP\nBlockquoted: \\c\n.pdfhref W -D \"http://example.com/\" -A \"\\c\" \\\n -- \"http://example.com/\"\n\\&\n.QE\n.LP\nAuto-links should not occur here: \\f[CR]<http://example.com/>\\f[R]\n.IP\n.nf\n\\f[C]\nor here: <http://example.com/>\n\\f[]\n.fi\n.HLINE\n.SH 1\nImages\n.pdfhref O 1 \"Images\"\n.pdfhref M \"images\"\n.LP\nFrom \\(lqVoyage dans la Lune\\(rq by Georges Melies (1902):\n\\\" .IMAGE \"lalune.jpg\"\n.ce 1\nlalune\n.sp 1\n.LP\nHere is a movie\n[IMAGE: movie] \\\" \"movie.jpg\"\nicon.\n.HLINE\n.SH 1\nFootnotes\n.pdfhref O 1 \"Footnotes\"\n.pdfhref M \"footnotes\"\n.LP\nHere is a footnote reference,\\**\n.FS\nHere is the footnote.\nIt can go anywhere after the footnote reference.\nIt need not be placed at the end of the document.\n.FE\nand another.\\**\n.FS\nHere\\(cqs the long note.\nThis one contains multiple blocks.\n.PP\nSubsequent blocks are indented to show that they belong to the footnote (as with\nlist items).\n.IP\n.nf\n\\f[C]\n  { <code> }\n\\f[]\n.fi\n.LP\nIf you want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.\n.FE\nThis should \\f[I]not\\f[R] be a footnote reference, because it contains a\nspace.[\\(hamy note] Here is an inline note.\\**\n.FS\nThis is \\f[I]easier\\f[R] to type.\nInline notes may contain \\c\n.pdfhref W -D \"http://google.com\" -A \"\\c\" \\\n -- \"links\"\n\\& and \\f[CR]]\\f[R] verbatim characters, as well as [bracketed text].\n.FE\n.QS\n.LP\nNotes can go in quotes.\\**\n.FS\nIn quote.\n.FE\n.QE\n.IP \" 1.\" 4\nAnd in list items.\\**\n.FS\nIn list.\n.FE\n.LP\nThis paragraph should not be part of the note, as it is not indented.\n.pdfsync\n"
  },
  {
    "path": "test/writer.muse",
    "content": "#author John MacFarlane; Anonymous\n#title Pandoc Test Suite\n#date July 17, 2006\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n----\n\n* Headers\n\n** Level 2 with an [[/url][embedded link]]\n\n*** Level 3 with *emphasis*\n\n**** Level 4\n\n***** Level 5\n\n* Level 1\n\n** Level 2 with *emphasis*\n\n*** Level 3\n\nwith no blank line\n\n** Level 2\n\nwith no blank line\n\n----\n\n* Paragraphs\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. <verbatim>*</verbatim> criminey.\n\nThere should be a hard line break<br>\nhere.\n\n----\n\n* Block Quotes\n\nE-mail style:\n\n<quote>\nThis is a block quote. It is pretty short.\n</quote>\n\n<quote>\nCode in a block quote:\n\n<example>\nsub status {\n    print \"working\";\n}\n</example>\n\nA list:\n\n 1. item one\n 2. item two\n\nNested block quotes:\n\n<quote>\nnested\n</quote>\n\n<quote>\nnested\n</quote>\n</quote>\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n----\n\n* Code Blocks\n\nCode:\n\n<example>\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n</example>\n\nAnd:\n\n<example>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n</example>\n\n----\n\n* Lists\n\n** Unordered\n\nAsterisks tight:\n\n - asterisk 1\n - asterisk 2\n - asterisk 3\n\nAsterisks loose:\n\n - asterisk 1\n - asterisk 2\n - asterisk 3\n\nPluses tight:\n\n - Plus 1\n - Plus 2\n - Plus 3\n\nPluses loose:\n\n - Plus 1\n - Plus 2\n - Plus 3\n\nMinuses tight:\n\n - Minus 1\n - Minus 2\n - Minus 3\n\nMinuses loose:\n\n - Minus 1\n - Minus 2\n - Minus 3\n\n** Ordered\n\nTight:\n\n 1. First\n 2. Second\n 3. Third\n\nand:\n\n 1. One\n 2. Two\n 3. Three\n\nLoose using tabs:\n\n 1. First\n 2. Second\n 3. Third\n\nand using spaces:\n\n 1. One\n 2. Two\n 3. Three\n\nMultiple paragraphs:\n\n 1. Item 1, graf one.\n\n    Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n 2. Item 2.\n 3. Item 3.\n\n** Nested\n\n - Tab\n   - Tab\n     - Tab\n\nHere’s another:\n\n 1. First\n 2. Second:\n    - Fee\n    - Fie\n    - Foe\n 3. Third\n\nSame thing but with paragraphs:\n\n 1. First\n 2. Second:\n\n    - Fee\n    - Fie\n    - Foe\n 3. Third\n\n** Tabs and spaces\n\n - this is a list item indented with tabs\n - this is a list item indented with spaces\n\n   - this is an example list item indented with tabs\n   - this is an example list item indented with spaces\n\n** Fancy list markers\n\n 2. begins with 2\n 3. and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v. more items\n       A. a subsublist\n       B. a subsublist\n\nNesting:\n\n A. Upper Alpha\n    I. Upper Roman.\n       6. Decimal start with 6\n          c. Lower alpha with paren\n\nAutonumbering:\n\n 1. Autonumber.\n 2. More.\n    1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n----\n\n* Definition Lists\n\nTight using spaces:\n\n apple :: red fruit\n orange :: orange fruit\n banana :: yellow fruit\n\nTight using tabs:\n\n apple :: red fruit\n orange :: orange fruit\n banana :: yellow fruit\n\nLoose:\n\n apple :: red fruit\n orange :: orange fruit\n banana :: yellow fruit\n\nMultiple blocks with italics:\n\n *apple* :: red fruit\n\n            contains seeds, crisp, pleasant to taste\n *orange* :: orange fruit\n\n             <example>\n             { orange code block }\n             </example>\n\n             <quote>\n             orange block quote\n             </quote>\n\nMultiple definitions, tight:\n\n apple :: red fruit\n       :: computer\n orange :: orange fruit\n        :: bank\n\nMultiple definitions, loose:\n\n apple :: red fruit\n       :: computer\n orange :: orange fruit\n        :: bank\n\nBlank line after term, indented marker, alternate markers:\n\n apple :: red fruit\n       :: computer\n orange :: orange fruit\n\n           1. sublist\n           2. sublist\n\n* HTML Blocks\n\nSimple block on one line:\n\nfoo\nAnd nested without indentation:\n\nfoo\n\nbar\nInterpreted markdown in a table:\n\n<literal style=\"html\">\n<table>\n</literal>\n\n<literal style=\"html\">\n<tr>\n</literal>\n\n<literal style=\"html\">\n<td>\n</literal>\n\nThis is *emphasized*\n\n<literal style=\"html\">\n</td>\n</literal>\n\n<literal style=\"html\">\n<td>\n</literal>\n\nAnd this is **strong**\n\n<literal style=\"html\">\n</td>\n</literal>\n\n<literal style=\"html\">\n</tr>\n</literal>\n\n<literal style=\"html\">\n</table>\n</literal>\n\n<literal style=\"html\">\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n</literal>\n\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n<example>\n<div>\n    foo\n</div>\n</example>\n\nAs should this:\n\n<example>\n<div>foo</div>\n</example>\n\nNow, nested:\n\nfoo\nThis should just be an HTML comment:\n\n<literal style=\"html\">\n<!-- Comment -->\n</literal>\n\nMultiline:\n\n<literal style=\"html\">\n<!--\nBlah\nBlah\n-->\n</literal>\n\n<literal style=\"html\">\n<!--\n    This is another comment.\n-->\n</literal>\n\nCode block:\n\n<example>\n<!-- Comment -->\n</example>\n\nJust plain comment, with trailing spaces on the line:\n\n<literal style=\"html\">\n<!-- foo -->\n</literal>\n\nCode:\n\n<example>\n<hr />\n</example>\n\nHr’s:\n\n<literal style=\"html\">\n<hr>\n</literal>\n\n<literal style=\"html\">\n<hr />\n</literal>\n\n<literal style=\"html\">\n<hr />\n</literal>\n\n<literal style=\"html\">\n<hr>\n</literal>\n\n<literal style=\"html\">\n<hr />\n</literal>\n\n<literal style=\"html\">\n<hr />\n</literal>\n\n<literal style=\"html\">\n<hr class=\"foo\" id=\"bar\" />\n</literal>\n\n<literal style=\"html\">\n<hr class=\"foo\" id=\"bar\" />\n</literal>\n\n<literal style=\"html\">\n<hr class=\"foo\" id=\"bar\">\n</literal>\n\n----\n\n* Inline Markup\n\nThis is *emphasized*, and so *is this*.\n\nThis is **strong**, and so **is this**.\n\nAn *[[/url][emphasized link]]*.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\n***This is strong and em.***\n\nSo is ***this*** word.\n\nThis is code: =>=, =$=, =\\=, =\\$=, =<html>=.\n\n<del>This is *strikeout*.</del>\n\nSuperscripts: a<sup>bc</sup>d a<sup>*hello*</sup> a<sup>hello there</sup>.\n\nSubscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n----\n\n* Smart quotes, ellipses, dashes\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘=code=’ and a “[[http://example.com/?foo=1&bar=2][quoted\nlink]]”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n----\n\n* LaTeX\n\n - <literal style=\"tex\">\\cite[22-23]{smith.1899}</literal>\n - <verbatim>2 + 2 = 4</verbatim>\n - *x* ∈ *y*\n - *α* ∧ *ω*\n - 223\n - *p*-Tree\n - Here’s some display math:\n   <verbatim>$$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$</verbatim>\n - Here’s one that has a line break in it: *α* + *ω* × *x*<sup>2</sup>.\n\nThese shouldn’t be math:\n\n - To get the famous equation, write <code>$e = mc^2$</code>.\n - $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is\n   emphasized.)\n - Shoes ($20) and socks ($5).\n - Escaped =$=: $73 *this should be emphasized* 23$.\n\nHere’s a LaTeX table:\n\n<literal style=\"tex\">\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n</literal>\n\n----\n\n* Special Characters\n\nHere is some unicode:\n\n - I hat: Î\n - o umlaut: ö\n - section: §\n - set membership: ∈\n - copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 <verbatim><</verbatim> 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: <verbatim>*</verbatim>\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: <verbatim>#</verbatim>\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n----\n\n* Links\n\n** Explicit\n\nJust a [[/url/][URL]].\n\n[[/url/][URL and title]].\n\n[[/url/][URL and title]].\n\n[[/url/][URL and title]].\n\n[[/url/][URL and title]]\n\n[[/url/][URL and title]]\n\n[[/url/with_underscore][with_underscore]]\n\n[[mailto:nobody@nowhere.net][Email link]]\n\n[[][Empty]].\n\n** Reference\n\nFoo [[/url/][bar]].\n\nWith [[/url/][embedded <verbatim>[brackets]</verbatim>]].\n\n[[/url/][b]] by itself should be a link.\n\nIndented [[/url][once]].\n\nIndented [[/url][twice]].\n\nIndented [[/url][thrice]].\n\nThis should [not][] be a link.\n\n<example>\n[not]: /url\n</example>\n\nFoo [[/url/][bar]].\n\nFoo [[/url/][biz]].\n\n** With ampersands\n\nHere’s a [[http://example.com/?foo=1&bar=2][link with an ampersand in the URL]].\n\nHere’s a link with an amersand in the link text: [[http://att.com/][AT&T]].\n\nHere’s an [[/script?foo=1&bar=2][inline link]].\n\nHere’s an [[/script?foo=1&bar=2][inline link in pointy braces]].\n\n** Autolinks\n\nWith an ampersand: [[http://example.com/?foo=1&bar=2]]\n\n - In a list?\n - [[http://example.com/]]\n - It should.\n\nAn e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]\n\n<quote>\nBlockquoted: [[http://example.com/]]\n</quote>\n\nAuto-links should not occur here: =<http://example.com/>=\n\n<example>\nor here: <http://example.com/>\n</example>\n\n----\n\n* Images\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n[[lalune.jpg][Voyage dans la Lune]]\nlalune\nHere is a movie [[movie.jpg][movie]] icon.\n\n----\n\n* Footnotes\n\nHere is a footnote reference,[1] and another.[2] This should *not* be a footnote\nreference, because it contains a space.[^my note] Here is an inline note.[3]\n\n<quote>\nNotes can go in quotes.[4]\n</quote>\n\n 1. And in list items.[5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[1] Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.\n\n[2] Here’s the long note. This one contains multiple blocks.\n\n    Subsequent blocks are indented to show that they belong to the footnote (as\n    with list items).\n\n    <example>\n      { <code> }\n    </example>\n\n    If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.\n\n[3] This is *easier* to type. Inline notes may contain\n    [[http://google.com][links]] and =]= verbatim characters, as well as\n    [bracketed text].\n\n[4] In quote.\n\n[5] In list.\n"
  },
  {
    "path": "test/writer.native",
    "content": "Pandoc\n  Meta\n    { unMeta =\n        fromList\n          [ ( \"author\"\n            , MetaList\n                [ MetaInlines [ Str \"John\" , Space , Str \"MacFarlane\" ]\n                , MetaInlines [ Str \"Anonymous\" ]\n                ]\n            )\n          , ( \"date\"\n            , MetaInlines\n                [ Str \"July\" , Space , Str \"17,\" , Space , Str \"2006\" ]\n            )\n          , ( \"title\"\n            , MetaInlines\n                [ Str \"Pandoc\" , Space , Str \"Test\" , Space , Str \"Suite\" ]\n            )\n          ]\n    }\n  [ Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"set\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"tests\"\n      , Space\n      , Str \"for\"\n      , Space\n      , Str \"pandoc.\"\n      , Space\n      , Str \"Most\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"them\"\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"adapted\"\n      , Space\n      , Str \"from\"\n      , SoftBreak\n      , Str \"John\"\n      , Space\n      , Str \"Gruber\\8217s\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"test\"\n      , Space\n      , Str \"suite.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"headers\" , [] , [] ) [ Str \"Headers\" ]\n  , Header\n      2\n      ( \"level-2-with-an-embedded-link\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"link\" ]\n          ( \"/url\" , \"\" )\n      ]\n  , Header\n      3\n      ( \"level-3-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"3\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      4 ( \"level-4\" , [] , [] ) [ Str \"Level\" , Space , Str \"4\" ]\n  , Header\n      5 ( \"level-5\" , [] , [] ) [ Str \"Level\" , Space , Str \"5\" ]\n  , Header\n      1 ( \"level-1\" , [] , [] ) [ Str \"Level\" , Space , Str \"1\" ]\n  , Header\n      2\n      ( \"level-2-with-emphasis\" , [] , [] )\n      [ Str \"Level\"\n      , Space\n      , Str \"2\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Emph [ Str \"emphasis\" ]\n      ]\n  , Header\n      3 ( \"level-3\" , [] , [] ) [ Str \"Level\" , Space , Str \"3\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , Header\n      2 ( \"level-2\" , [] , [] ) [ Str \"Level\" , Space , Str \"2\" ]\n  , Para\n      [ Str \"with\"\n      , Space\n      , Str \"no\"\n      , Space\n      , Str \"blank\"\n      , Space\n      , Str \"line\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"paragraphs\" , [] , [] ) [ Str \"Paragraphs\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"regular\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , Para\n      [ Str \"In\"\n      , Space\n      , Str \"Markdown\"\n      , Space\n      , Str \"1.0.0\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"earlier.\"\n      , Space\n      , Str \"Version\"\n      , SoftBreak\n      , Str \"8.\"\n      , Space\n      , Str \"This\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"turns\"\n      , Space\n      , Str \"into\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      , SoftBreak\n      , Str \"Because\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard-wrapped\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"middle\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"looked\"\n      , Space\n      , Str \"like\"\n      , Space\n      , Str \"a\"\n      , SoftBreak\n      , Str \"list\"\n      , Space\n      , Str \"item.\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"bullet.\"\n      , SoftBreak\n      , Str \"*\"\n      , Space\n      , Str \"criminey.\"\n      ]\n  , Para\n      [ Str \"There\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"hard\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"break\"\n      , LineBreak\n      , Str \"here.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"block-quotes\" , [] , [] )\n      [ Str \"Block\" , Space , Str \"Quotes\" ]\n  , Para [ Str \"E-mail\" , Space , Str \"style:\" ]\n  , BlockQuote\n      [ Para\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote.\"\n          , SoftBreak\n          , Str \"It\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"pretty\"\n          , Space\n          , Str \"short.\"\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Code\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"a\"\n          , Space\n          , Str \"block\"\n          , Space\n          , Str \"quote:\"\n          ]\n      , CodeBlock\n          ( \"\" , [] , [] ) \"sub status {\\n    print \\\"working\\\";\\n}\"\n      , Para [ Str \"A\" , Space , Str \"list:\" ]\n      , OrderedList\n          ( 1 , Decimal , Period )\n          [ [ Plain [ Str \"item\" , Space , Str \"one\" ] ]\n          , [ Plain [ Str \"item\" , Space , Str \"two\" ] ]\n          ]\n      , Para\n          [ Str \"Nested\" , Space , Str \"block\" , Space , Str \"quotes:\" ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      , BlockQuote [ Para [ Str \"nested\" ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"quote:\"\n      , Space\n      , Str \"2\"\n      , SoftBreak\n      , Str \">\"\n      , Space\n      , Str \"1.\"\n      ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"following\"\n      , Space\n      , Str \"paragraph.\"\n      ]\n  , HorizontalRule\n  , Header\n      1 ( \"code-blocks\" , [] , [] ) [ Str \"Code\" , Space , Str \"Blocks\" ]\n  , Para [ Str \"Code:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"---- (should be four hyphens)\\n\\nsub status {\\n    print \\\"working\\\";\\n}\\n\\nthis code block is indented by one tab\"\n  , Para [ Str \"And:\" ]\n  , CodeBlock\n      ( \"\" , [] , [] )\n      \"    this code block is indented by two tabs\\n\\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\{\"\n  , HorizontalRule\n  , Header 1 ( \"lists\" , [] , [] ) [ Str \"Lists\" ]\n  , Header 2 ( \"unordered\" , [] , [] ) [ Str \"Unordered\" ]\n  , Para [ Str \"Asterisks\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Asterisks\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"asterisk\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"asterisk\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Pluses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Plus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Plus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"tight:\" ]\n  , BulletList\n      [ [ Plain [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Plain [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Para [ Str \"Minuses\" , Space , Str \"loose:\" ]\n  , BulletList\n      [ [ Para [ Str \"Minus\" , Space , Str \"1\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"Minus\" , Space , Str \"3\" ] ]\n      ]\n  , Header 2 ( \"ordered\" , [] , [] ) [ Str \"Ordered\" ]\n  , Para [ Str \"Tight:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second\" ] ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"One\" ] ]\n      , [ Plain [ Str \"Two\" ] ]\n      , [ Plain [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Loose\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second\" ] ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Para [ Str \"and\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"One\" ] ]\n      , [ Para [ Str \"Two\" ] ]\n      , [ Para [ Str \"Three\" ] ]\n      ]\n  , Para [ Str \"Multiple\" , Space , Str \"paragraphs:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1,\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"one.\"\n            ]\n        , Para\n            [ Str \"Item\"\n            , Space\n            , Str \"1.\"\n            , Space\n            , Str \"graf\"\n            , Space\n            , Str \"two.\"\n            , Space\n            , Str \"The\"\n            , Space\n            , Str \"quick\"\n            , Space\n            , Str \"brown\"\n            , Space\n            , Str \"fox\"\n            , Space\n            , Str \"jumped\"\n            , Space\n            , Str \"over\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"lazy\"\n            , Space\n            , Str \"dog\\8217s\"\n            , SoftBreak\n            , Str \"back.\"\n            ]\n        ]\n      , [ Para [ Str \"Item\" , Space , Str \"2.\" ] ]\n      , [ Para [ Str \"Item\" , Space , Str \"3.\" ] ]\n      ]\n  , Header 2 ( \"nested\" , [] , [] ) [ Str \"Nested\" ]\n  , BulletList\n      [ [ Plain [ Str \"Tab\" ]\n        , BulletList\n            [ [ Plain [ Str \"Tab\" ] , BulletList [ [ Plain [ Str \"Tab\" ] ] ] ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Here\\8217s\" , Space , Str \"another:\" ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain [ Str \"First\" ] ]\n      , [ Plain [ Str \"Second:\" ]\n        , BulletList\n            [ [ Plain [ Str \"Fee\" ] ]\n            , [ Plain [ Str \"Fie\" ] ]\n            , [ Plain [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Plain [ Str \"Third\" ] ]\n      ]\n  , Para\n      [ Str \"Same\"\n      , Space\n      , Str \"thing\"\n      , Space\n      , Str \"but\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"paragraphs:\"\n      ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Para [ Str \"First\" ] ]\n      , [ Para [ Str \"Second:\" ]\n        , BulletList\n            [ [ Plain [ Str \"Fee\" ] ]\n            , [ Plain [ Str \"Fie\" ] ]\n            , [ Plain [ Str \"Foe\" ] ]\n            ]\n        ]\n      , [ Para [ Str \"Third\" ] ]\n      ]\n  , Header\n      2\n      ( \"tabs-and-spaces\" , [] , [] )\n      [ Str \"Tabs\" , Space , Str \"and\" , Space , Str \"spaces\" ]\n  , BulletList\n      [ [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , SoftBreak\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"tabs\"\n            ]\n        ]\n      , [ Para\n            [ Str \"this\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"item\"\n            , SoftBreak\n            , Str \"indented\"\n            , Space\n            , Str \"with\"\n            , Space\n            , Str \"spaces\"\n            ]\n        , BulletList\n            [ [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , SoftBreak\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"tabs\"\n                  ]\n              ]\n            , [ Para\n                  [ Str \"this\"\n                  , Space\n                  , Str \"is\"\n                  , Space\n                  , Str \"an\"\n                  , Space\n                  , Str \"example\"\n                  , Space\n                  , Str \"list\"\n                  , Space\n                  , Str \"item\"\n                  , SoftBreak\n                  , Str \"indented\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"spaces\"\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Header\n      2\n      ( \"fancy-list-markers\" , [] , [] )\n      [ Str \"Fancy\" , Space , Str \"list\" , Space , Str \"markers\" ]\n  , OrderedList\n      ( 2 , Decimal , TwoParens )\n      [ [ Para [ Str \"begins\" , Space , Str \"with\" , Space , Str \"2\" ] ]\n      , [ Para [ Str \"and\" , Space , Str \"now\" , Space , Str \"3\" ]\n        , Para\n            [ Str \"with\" , Space , Str \"a\" , Space , Str \"continuation\" ]\n        , OrderedList\n            ( 4 , LowerRoman , Period )\n            [ [ Plain\n                  [ Str \"sublist\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"roman\"\n                  , Space\n                  , Str \"numerals,\"\n                  , SoftBreak\n                  , Str \"starting\"\n                  , Space\n                  , Str \"with\"\n                  , Space\n                  , Str \"4\"\n                  ]\n              ]\n            , [ Plain [ Str \"more\" , Space , Str \"items\" ]\n              , OrderedList\n                  ( 1 , UpperAlpha , TwoParens )\n                  [ [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  , [ Plain [ Str \"a\" , Space , Str \"subsublist\" ] ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Nesting:\" ]\n  , OrderedList\n      ( 1 , UpperAlpha , Period )\n      [ [ Plain [ Str \"Upper\" , Space , Str \"Alpha\" ]\n        , OrderedList\n            ( 1 , UpperRoman , Period )\n            [ [ Plain [ Str \"Upper\" , Space , Str \"Roman.\" ]\n              , OrderedList\n                  ( 6 , Decimal , TwoParens )\n                  [ [ Plain\n                        [ Str \"Decimal\"\n                        , Space\n                        , Str \"start\"\n                        , Space\n                        , Str \"with\"\n                        , Space\n                        , Str \"6\"\n                        ]\n                    , OrderedList\n                        ( 3 , LowerAlpha , OneParen )\n                        [ [ Plain\n                              [ Str \"Lower\"\n                              , Space\n                              , Str \"alpha\"\n                              , Space\n                              , Str \"with\"\n                              , Space\n                              , Str \"paren\"\n                              ]\n                          ]\n                        ]\n                    ]\n                  ]\n              ]\n            ]\n        ]\n      ]\n  , Para [ Str \"Autonumbering:\" ]\n  , OrderedList\n      ( 1 , DefaultStyle , DefaultDelim )\n      [ [ Plain [ Str \"Autonumber.\" ] ]\n      , [ Plain [ Str \"More.\" ]\n        , OrderedList\n            ( 1 , DefaultStyle , DefaultDelim ) [ [ Plain [ Str \"Nested.\" ] ] ]\n        ]\n      ]\n  , Para\n      [ Str \"Should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"list\"\n      , Space\n      , Str \"item:\"\n      ]\n  , Para [ Str \"M.A.\\160\\&2007\" ]\n  , Para [ Str \"B.\" , Space , Str \"Williams\" ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"definition-lists\" , [] , [] )\n      [ Str \"Definition\" , Space , Str \"Lists\" ]\n  , Para\n      [ Str \"Tight\" , Space , Str \"using\" , Space , Str \"spaces:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Plain [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para [ Str \"Tight\" , Space , Str \"using\" , Space , Str \"tabs:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Plain [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para [ Str \"Loose:\" ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ] ]\n        )\n      , ( [ Str \"banana\" ]\n        , [ [ Para [ Str \"yellow\" , Space , Str \"fruit\" ] ] ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"blocks\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"italics:\"\n      ]\n  , DefinitionList\n      [ ( [ Emph [ Str \"apple\" ] ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ]\n            , Para\n                [ Str \"contains\"\n                , Space\n                , Str \"seeds,\"\n                , SoftBreak\n                , Str \"crisp,\"\n                , Space\n                , Str \"pleasant\"\n                , Space\n                , Str \"to\"\n                , Space\n                , Str \"taste\"\n                ]\n            ]\n          ]\n        )\n      , ( [ Emph [ Str \"orange\" ] ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , CodeBlock ( \"\" , [] , [] ) \"{ orange code block }\"\n            , BlockQuote\n                [ Para\n                    [ Str \"orange\" , Space , Str \"block\" , Space , Str \"quote\" ]\n                ]\n            ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"definitions,\"\n      , Space\n      , Str \"tight:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Plain [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Plain [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Plain [ Str \"orange\" , Space , Str \"fruit\" ] ]\n          , [ Plain [ Str \"bank\" ] ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Multiple\"\n      , Space\n      , Str \"definitions,\"\n      , Space\n      , Str \"loose:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"bank\" ] ]\n          ]\n        )\n      ]\n  , Para\n      [ Str \"Blank\"\n      , Space\n      , Str \"line\"\n      , Space\n      , Str \"after\"\n      , Space\n      , Str \"term,\"\n      , Space\n      , Str \"indented\"\n      , Space\n      , Str \"marker,\"\n      , Space\n      , Str \"alternate\"\n      , Space\n      , Str \"markers:\"\n      ]\n  , DefinitionList\n      [ ( [ Str \"apple\" ]\n        , [ [ Para [ Str \"red\" , Space , Str \"fruit\" ] ]\n          , [ Para [ Str \"computer\" ] ]\n          ]\n        )\n      , ( [ Str \"orange\" ]\n        , [ [ Para [ Str \"orange\" , Space , Str \"fruit\" ]\n            , OrderedList\n                ( 1 , Decimal , Period )\n                [ [ Plain [ Str \"sublist\" ] ] , [ Plain [ Str \"sublist\" ] ] ]\n            ]\n          ]\n        )\n      ]\n  , Header\n      1 ( \"html-blocks\" , [] , [] ) [ Str \"HTML\" , Space , Str \"Blocks\" ]\n  , Para\n      [ Str \"Simple\"\n      , Space\n      , Str \"block\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"one\"\n      , Space\n      , Str \"line:\"\n      ]\n  , Div ( \"\" , [] , [] ) [ Plain [ Str \"foo\" ] ]\n  , Para\n      [ Str \"And\"\n      , Space\n      , Str \"nested\"\n      , Space\n      , Str \"without\"\n      , Space\n      , Str \"indentation:\"\n      ]\n  , Div\n      ( \"\" , [] , [] )\n      [ Div\n          ( \"\" , [] , [] ) [ Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ] ]\n      , Div ( \"\" , [] , [] ) [ Plain [ Str \"bar\" ] ]\n      ]\n  , Para\n      [ Str \"Interpreted\"\n      , Space\n      , Str \"markdown\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"table:\"\n      ]\n  , RawBlock (Format \"html\") \"<table>\"\n  , RawBlock (Format \"html\") \"<tr>\"\n  , RawBlock (Format \"html\") \"<td>\"\n  , Plain\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      ]\n  , RawBlock (Format \"html\") \"</td>\"\n  , RawBlock (Format \"html\") \"<td>\"\n  , Plain\n      [ Str \"And\"\n      , Space\n      , Str \"this\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      ]\n  , RawBlock (Format \"html\") \"</td>\"\n  , RawBlock (Format \"html\") \"</tr>\"\n  , RawBlock (Format \"html\") \"</table>\"\n  , RawBlock\n      (Format \"html\")\n      \"<script type=\\\"text/javascript\\\">document.write('This *should not* be interpreted as markdown');</script>\"\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"simple\"\n      , Space\n      , Str \"block:\"\n      ]\n  , Div ( \"\" , [] , [] ) [ Para [ Str \"foo\" ] ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"code\"\n      , Space\n      , Str \"block,\"\n      , Space\n      , Str \"though:\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"<div>\\n    foo\\n</div>\"\n  , Para [ Str \"As\" , Space , Str \"should\" , Space , Str \"this:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<div>foo</div>\"\n  , Para [ Str \"Now,\" , Space , Str \"nested:\" ]\n  , Div\n      ( \"\" , [] , [] )\n      [ Div\n          ( \"\" , [] , [] ) [ Div ( \"\" , [] , [] ) [ Plain [ Str \"foo\" ] ] ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"just\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"HTML\"\n      , Space\n      , Str \"comment:\"\n      ]\n  , RawBlock (Format \"html\") \"<!-- Comment -->\"\n  , Para [ Str \"Multiline:\" ]\n  , RawBlock (Format \"html\") \"<!--\\nBlah\\nBlah\\n-->\"\n  , RawBlock\n      (Format \"html\") \"<!--\\n    This is another comment.\\n-->\"\n  , Para [ Str \"Code\" , Space , Str \"block:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<!-- Comment -->\"\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"plain\"\n      , Space\n      , Str \"comment,\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"trailing\"\n      , Space\n      , Str \"spaces\"\n      , Space\n      , Str \"on\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"line:\"\n      ]\n  , RawBlock (Format \"html\") \"<!-- foo -->\"\n  , Para [ Str \"Code:\" ]\n  , CodeBlock ( \"\" , [] , [] ) \"<hr />\"\n  , Para [ Str \"Hr\\8217s:\" ]\n  , RawBlock (Format \"html\") \"<hr>\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr>\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr />\"\n  , RawBlock (Format \"html\") \"<hr class=\\\"foo\\\" id=\\\"bar\\\" />\"\n  , RawBlock (Format \"html\") \"<hr class=\\\"foo\\\" id=\\\"bar\\\" />\"\n  , RawBlock (Format \"html\") \"<hr class=\\\"foo\\\" id=\\\"bar\\\">\"\n  , HorizontalRule\n  , Header\n      1\n      ( \"inline-markup\" , [] , [] )\n      [ Str \"Inline\" , Space , Str \"Markup\" ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Emph [ Str \"emphasized\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Emph [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Str \"strong\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"so\"\n      , Space\n      , Strong [ Str \"is\" , Space , Str \"this\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Emph\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"emphasized\" , Space , Str \"link\" ]\n              ( \"/url\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Strong\n          [ Emph\n              [ Str \"This\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"strong\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"em.\"\n              ]\n          ]\n      ]\n  , Para\n      [ Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Strong [ Emph [ Str \"this\" ] ]\n      , Space\n      , Str \"word.\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"code:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \">\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"\\\\$\"\n      , Str \",\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<html>\"\n      , Str \".\"\n      ]\n  , Para\n      [ Strikeout\n          [ Str \"This\"\n          , Space\n          , Str \"is\"\n          , Space\n          , Emph [ Str \"strikeout\" ]\n          , Str \".\"\n          ]\n      ]\n  , Para\n      [ Str \"Superscripts:\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"bc\" ]\n      , Str \"d\"\n      , Space\n      , Str \"a\"\n      , Superscript [ Emph [ Str \"hello\" ] ]\n      , Space\n      , Str \"a\"\n      , Superscript [ Str \"hello\\160there\" ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Subscripts:\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"2\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"23\" ]\n      , Str \"O,\"\n      , Space\n      , Str \"H\"\n      , Subscript [ Str \"many\\160of\\160them\" ]\n      , Str \"O.\"\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"superscripts\"\n      , Space\n      , Str \"or\"\n      , Space\n      , Str \"subscripts,\"\n      , SoftBreak\n      , Str \"because\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"unescaped\"\n      , Space\n      , Str \"spaces:\"\n      , Space\n      , Str \"a^b\"\n      , Space\n      , Str \"c^d,\"\n      , Space\n      , Str \"a~b\"\n      , Space\n      , Str \"c~d.\"\n      ]\n  , HorizontalRule\n  , Header\n      1\n      ( \"smart-quotes-ellipses-dashes\" , [] , [] )\n      [ Str \"Smart\"\n      , Space\n      , Str \"quotes,\"\n      , Space\n      , Str \"ellipses,\"\n      , Space\n      , Str \"dashes\"\n      ]\n  , Para\n      [ Quoted DoubleQuote [ Str \"Hello,\" ]\n      , Space\n      , Str \"said\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"spider.\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Quoted SingleQuote [ Str \"Shelob\" ]\n          , Space\n          , Str \"is\"\n          , Space\n          , Str \"my\"\n          , Space\n          , Str \"name.\"\n          ]\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"A\" ]\n      , Str \",\"\n      , Space\n      , Quoted SingleQuote [ Str \"B\" ]\n      , Str \",\"\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted SingleQuote [ Str \"C\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"letters.\"\n      ]\n  , Para\n      [ Quoted SingleQuote [ Str \"Oak,\" ]\n      , Space\n      , Quoted SingleQuote [ Str \"elm,\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Quoted SingleQuote [ Str \"beech\" ]\n      , Space\n      , Str \"are\"\n      , Space\n      , Str \"names\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"trees.\"\n      , SoftBreak\n      , Str \"So\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Quoted SingleQuote [ Str \"pine.\" ]\n      ]\n  , Para\n      [ Quoted\n          SingleQuote\n          [ Str \"He\"\n          , Space\n          , Str \"said,\"\n          , Space\n          , Quoted\n              DoubleQuote\n              [ Str \"I\"\n              , Space\n              , Str \"want\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"go.\"\n              ]\n          ]\n      , Space\n      , Str \"Were\"\n      , Space\n      , Str \"you\"\n      , Space\n      , Str \"alive\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , SoftBreak\n      , Str \"70\\8217s?\"\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"quoted\"\n      , Space\n      , Quoted SingleQuote [ Code ( \"\" , [] , [] ) \"code\" ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Link\n              ( \"\" , [] , [] )\n              [ Str \"quoted\" , Space , Str \"link\" ]\n              ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n          ]\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Some\"\n      , Space\n      , Str \"dashes:\"\n      , Space\n      , Str \"one\\8212two\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"three\\8212four\"\n      , Space\n      , Str \"\\8212\"\n      , Space\n      , Str \"five.\"\n      ]\n  , Para\n      [ Str \"Dashes\"\n      , Space\n      , Str \"between\"\n      , Space\n      , Str \"numbers:\"\n      , Space\n      , Str \"5\\8211\\&7,\"\n      , Space\n      , Str \"255\\8211\\&66,\"\n      , Space\n      , Str \"1987\\8211\\&1999.\"\n      ]\n  , Para [ Str \"Ellipses\\8230and\\8230and\\8230.\" ]\n  , HorizontalRule\n  , Header 1 ( \"latex\" , [] , [] ) [ Str \"LaTeX\" ]\n  , BulletList\n      [ [ Plain [ RawInline (Format \"tex\") \"\\\\cite[22-23]{smith.1899}\" ]\n        ]\n      , [ Plain [ Math InlineMath \"2+2=4\" ] ]\n      , [ Plain [ Math InlineMath \"x \\\\in y\" ] ]\n      , [ Plain [ Math InlineMath \"\\\\alpha \\\\wedge \\\\omega\" ] ]\n      , [ Plain [ Math InlineMath \"223\" ] ]\n      , [ Plain [ Math InlineMath \"p\" , Str \"-Tree\" ] ]\n      , [ Plain\n            [ Str \"Here\\8217s\"\n            , Space\n            , Str \"some\"\n            , Space\n            , Str \"display\"\n            , Space\n            , Str \"math:\"\n            , SoftBreak\n            , Math\n                DisplayMath\n                \"\\\\frac{d}{dx}f(x)=\\\\lim_{h\\\\to 0}\\\\frac{f(x+h)-f(x)}{h}\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Here\\8217s\"\n            , Space\n            , Str \"one\"\n            , Space\n            , Str \"that\"\n            , Space\n            , Str \"has\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Str \"line\"\n            , Space\n            , Str \"break\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"it:\"\n            , Space\n            , Math InlineMath \"\\\\alpha + \\\\omega \\\\times x^2\"\n            , Str \".\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"These\"\n      , Space\n      , Str \"shouldn\\8217t\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"math:\"\n      ]\n  , BulletList\n      [ [ Plain\n            [ Str \"To\"\n            , Space\n            , Str \"get\"\n            , Space\n            , Str \"the\"\n            , Space\n            , Str \"famous\"\n            , Space\n            , Str \"equation,\"\n            , Space\n            , Str \"write\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$e = mc^2$\"\n            , Str \".\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"$22,000\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"a\"\n            , Space\n            , Emph [ Str \"lot\" ]\n            , Space\n            , Str \"of\"\n            , Space\n            , Str \"money.\"\n            , Space\n            , Str \"So\"\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"$34,000.\"\n            , SoftBreak\n            , Str \"(It\"\n            , Space\n            , Str \"worked\"\n            , Space\n            , Str \"if\"\n            , Space\n            , Quoted DoubleQuote [ Str \"lot\" ]\n            , Space\n            , Str \"is\"\n            , Space\n            , Str \"emphasized.)\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Shoes\"\n            , Space\n            , Str \"($20)\"\n            , Space\n            , Str \"and\"\n            , Space\n            , Str \"socks\"\n            , Space\n            , Str \"($5).\"\n            ]\n        ]\n      , [ Plain\n            [ Str \"Escaped\"\n            , Space\n            , Code ( \"\" , [] , [] ) \"$\"\n            , Str \":\"\n            , Space\n            , Str \"$73\"\n            , Space\n            , Emph\n                [ Str \"this\"\n                , Space\n                , Str \"should\"\n                , Space\n                , Str \"be\"\n                , Space\n                , Str \"emphasized\"\n                ]\n            , Space\n            , Str \"23$.\"\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"LaTeX\"\n      , Space\n      , Str \"table:\"\n      ]\n  , RawBlock\n      (Format \"tex\")\n      \"\\\\begin{tabular}{|l|l|}\\\\hline\\nAnimal & Number \\\\\\\\ \\\\hline\\nDog    & 2      \\\\\\\\\\nCat    & 1      \\\\\\\\ \\\\hline\\n\\\\end{tabular}\"\n  , HorizontalRule\n  , Header\n      1\n      ( \"special-characters\" , [] , [] )\n      [ Str \"Special\" , Space , Str \"Characters\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"some\"\n      , Space\n      , Str \"unicode:\"\n      ]\n  , BulletList\n      [ [ Plain [ Str \"I\" , Space , Str \"hat:\" , Space , Str \"\\206\" ] ]\n      , [ Plain [ Str \"o\" , Space , Str \"umlaut:\" , Space , Str \"\\246\" ]\n        ]\n      , [ Plain [ Str \"section:\" , Space , Str \"\\167\" ] ]\n      , [ Plain\n            [ Str \"set\" , Space , Str \"membership:\" , Space , Str \"\\8712\" ]\n        ]\n      , [ Plain [ Str \"copyright:\" , Space , Str \"\\169\" ] ]\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"has\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"their\"\n      , Space\n      , Str \"name.\"\n      ]\n  , Para\n      [ Str \"AT&T\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"another\"\n      , Space\n      , Str \"way\"\n      , Space\n      , Str \"to\"\n      , Space\n      , Str \"write\"\n      , Space\n      , Str \"it.\"\n      ]\n  , Para [ Str \"This\" , Space , Str \"&\" , Space , Str \"that.\" ]\n  , Para [ Str \"4\" , Space , Str \"<\" , Space , Str \"5.\" ]\n  , Para [ Str \"6\" , Space , Str \">\" , Space , Str \"5.\" ]\n  , Para [ Str \"Backslash:\" , Space , Str \"\\\\\" ]\n  , Para [ Str \"Backtick:\" , Space , Str \"`\" ]\n  , Para [ Str \"Asterisk:\" , Space , Str \"*\" ]\n  , Para [ Str \"Underscore:\" , Space , Str \"_\" ]\n  , Para [ Str \"Left\" , Space , Str \"brace:\" , Space , Str \"{\" ]\n  , Para [ Str \"Right\" , Space , Str \"brace:\" , Space , Str \"}\" ]\n  , Para [ Str \"Left\" , Space , Str \"bracket:\" , Space , Str \"[\" ]\n  , Para [ Str \"Right\" , Space , Str \"bracket:\" , Space , Str \"]\" ]\n  , Para [ Str \"Left\" , Space , Str \"paren:\" , Space , Str \"(\" ]\n  , Para [ Str \"Right\" , Space , Str \"paren:\" , Space , Str \")\" ]\n  , Para [ Str \"Greater-than:\" , Space , Str \">\" ]\n  , Para [ Str \"Hash:\" , Space , Str \"#\" ]\n  , Para [ Str \"Period:\" , Space , Str \".\" ]\n  , Para [ Str \"Bang:\" , Space , Str \"!\" ]\n  , Para [ Str \"Plus:\" , Space , Str \"+\" ]\n  , Para [ Str \"Minus:\" , Space , Str \"-\" ]\n  , HorizontalRule\n  , Header 1 ( \"links\" , [] , [] ) [ Str \"Links\" ]\n  , Header 2 ( \"explicit\" , [] , [] ) [ Str \"Explicit\" ]\n  , Para\n      [ Str \"Just\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"URL\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by two spaces\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title preceded by a tab\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with \\\"quotes\\\" in it\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"URL\" , Space , Str \"and\" , Space , Str \"title\" ]\n          ( \"/url/\" , \"title with single quotes\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"with_underscore\" ]\n          ( \"/url/with_underscore\" , \"\" )\n      ]\n  , Para\n      [ Link\n          ( \"\" , [] , [] )\n          [ Str \"Email\" , Space , Str \"link\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"Empty\" ] ( \"\" , \"\" ) , Str \".\" ]\n  , Header 2 ( \"reference\" , [] , [] ) [ Str \"Reference\" ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"bar\" ] ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"embedded\" , Space , Str \"[brackets]\" ]\n          ( \"/url/\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Link ( \"\" , [] , [] ) [ Str \"b\" ] ( \"/url/\" , \"\" )\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"itself\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"once\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"twice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Indented\"\n      , Space\n      , Link ( \"\" , [] , [] ) [ Str \"thrice\" ] ( \"/url\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"[not][]\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link.\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"[not]: /url\"\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"bar\" ]\n          ( \"/url/\" , \"Title with \\\"quotes\\\" inside\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Foo\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"biz\" ]\n          ( \"/url/\" , \"Title with \\\"quote\\\" inside\" )\n      , Str \".\"\n      ]\n  , Header\n      2\n      ( \"with-ampersands\" , [] , [] )\n      [ Str \"With\" , Space , Str \"ampersands\" ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"link\"\n          , Space\n          , Str \"with\"\n          , Space\n          , Str \"an\"\n          , Space\n          , Str \"ampersand\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"the\"\n          , Space\n          , Str \"URL\"\n          ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"with\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"amersand\"\n      , Space\n      , Str \"in\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"link\"\n      , Space\n      , Str \"text:\"\n      , Space\n      , Link\n          ( \"\" , [] , [] ) [ Str \"AT&T\" ] ( \"http://att.com/\" , \"AT&T\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\" , Space , Str \"link\" ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Para\n      [ Str \"Here\\8217s\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Link\n          ( \"\" , [] , [] )\n          [ Str \"inline\"\n          , Space\n          , Str \"link\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"pointy\"\n          , Space\n          , Str \"braces\"\n          ]\n          ( \"/script?foo=1&bar=2\" , \"\" )\n      , Str \".\"\n      ]\n  , Header 2 ( \"autolinks\" , [] , [] ) [ Str \"Autolinks\" ]\n  , Para\n      [ Str \"With\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"ampersand:\"\n      , Space\n      , Link\n          ( \"\" , [ \"uri\" ] , [] )\n          [ Str \"http://example.com/?foo=1&bar=2\" ]\n          ( \"http://example.com/?foo=1&bar=2\" , \"\" )\n      ]\n  , BulletList\n      [ [ Plain [ Str \"In\" , Space , Str \"a\" , Space , Str \"list?\" ] ]\n      , [ Plain\n            [ Link\n                ( \"\" , [ \"uri\" ] , [] )\n                [ Str \"http://example.com/\" ]\n                ( \"http://example.com/\" , \"\" )\n            ]\n        ]\n      , [ Plain [ Str \"It\" , Space , Str \"should.\" ] ]\n      ]\n  , Para\n      [ Str \"An\"\n      , Space\n      , Str \"e-mail\"\n      , Space\n      , Str \"address:\"\n      , Space\n      , Link\n          ( \"\" , [ \"email\" ] , [] )\n          [ Str \"nobody@nowhere.net\" ]\n          ( \"mailto:nobody@nowhere.net\" , \"\" )\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Blockquoted:\"\n          , Space\n          , Link\n              ( \"\" , [ \"uri\" ] , [] )\n              [ Str \"http://example.com/\" ]\n              ( \"http://example.com/\" , \"\" )\n          ]\n      ]\n  , Para\n      [ Str \"Auto-links\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"occur\"\n      , Space\n      , Str \"here:\"\n      , Space\n      , Code ( \"\" , [] , [] ) \"<http://example.com/>\"\n      ]\n  , CodeBlock ( \"\" , [] , [] ) \"or here: <http://example.com/>\"\n  , HorizontalRule\n  , Header 1 ( \"images\" , [] , [] ) [ Str \"Images\" ]\n  , Para\n      [ Str \"From\"\n      , Space\n      , Quoted\n          DoubleQuote\n          [ Str \"Voyage\"\n          , Space\n          , Str \"dans\"\n          , Space\n          , Str \"la\"\n          , Space\n          , Str \"Lune\"\n          ]\n      , Space\n      , Str \"by\"\n      , Space\n      , Str \"Georges\"\n      , Space\n      , Str \"Melies\"\n      , Space\n      , Str \"(1902):\"\n      ]\n  , Figure\n      ( \"\" , [] , [] )\n      (Caption Nothing [ Plain [ Str \"lalune\" ] ])\n      [ Plain\n          [ Image\n              ( \"\" , [] , [] )\n              [ Str \"lalune\" ]\n              ( \"lalune.jpg\" , \"Voyage dans la Lune\" )\n          ]\n      ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"movie\"\n      , Space\n      , Image ( \"\" , [] , [] ) [ Str \"movie\" ] ( \"movie.jpg\" , \"\" )\n      , Space\n      , Str \"icon.\"\n      ]\n  , HorizontalRule\n  , Header 1 ( \"footnotes\" , [] , [] ) [ Str \"Footnotes\" ]\n  , Para\n      [ Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Note\n          [ Para\n              [ Str \"Here\"\n              , Space\n              , Str \"is\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"go\"\n              , Space\n              , Str \"anywhere\"\n              , Space\n              , Str \"after\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"footnote\"\n              , SoftBreak\n              , Str \"reference.\"\n              , Space\n              , Str \"It\"\n              , Space\n              , Str \"need\"\n              , Space\n              , Str \"not\"\n              , Space\n              , Str \"be\"\n              , Space\n              , Str \"placed\"\n              , Space\n              , Str \"at\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"end\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"document.\"\n              ]\n          ]\n      , Space\n      , Str \"and\"\n      , Space\n      , Str \"another.\"\n      , Note\n          [ Para\n              [ Str \"Here\\8217s\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"long\"\n              , Space\n              , Str \"note.\"\n              , Space\n              , Str \"This\"\n              , Space\n              , Str \"one\"\n              , Space\n              , Str \"contains\"\n              , Space\n              , Str \"multiple\"\n              , SoftBreak\n              , Str \"blocks.\"\n              ]\n          , Para\n              [ Str \"Subsequent\"\n              , Space\n              , Str \"blocks\"\n              , Space\n              , Str \"are\"\n              , Space\n              , Str \"indented\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"show\"\n              , Space\n              , Str \"that\"\n              , Space\n              , Str \"they\"\n              , Space\n              , Str \"belong\"\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"the\"\n              , SoftBreak\n              , Str \"footnote\"\n              , Space\n              , Str \"(as\"\n              , Space\n              , Str \"with\"\n              , Space\n              , Str \"list\"\n              , Space\n              , Str \"items).\"\n              ]\n          , CodeBlock ( \"\" , [] , [] ) \"  { <code> }\"\n          , Para\n              [ Str \"If\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"want,\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"every\"\n              , Space\n              , Str \"line,\"\n              , Space\n              , Str \"but\"\n              , Space\n              , Str \"you\"\n              , Space\n              , Str \"can\"\n              , Space\n              , Str \"also\"\n              , Space\n              , Str \"be\"\n              , SoftBreak\n              , Str \"lazy\"\n              , Space\n              , Str \"and\"\n              , Space\n              , Str \"just\"\n              , Space\n              , Str \"indent\"\n              , Space\n              , Str \"the\"\n              , Space\n              , Str \"first\"\n              , Space\n              , Str \"line\"\n              , Space\n              , Str \"of\"\n              , Space\n              , Str \"each\"\n              , Space\n              , Str \"block.\"\n              ]\n          ]\n      , SoftBreak\n      , Str \"This\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Emph [ Str \"not\" ]\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"footnote\"\n      , Space\n      , Str \"reference,\"\n      , Space\n      , Str \"because\"\n      , Space\n      , Str \"it\"\n      , SoftBreak\n      , Str \"contains\"\n      , Space\n      , Str \"a\"\n      , Space\n      , Str \"space.[^my\"\n      , Space\n      , Str \"note]\"\n      , Space\n      , Str \"Here\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"an\"\n      , Space\n      , Str \"inline\"\n      , Space\n      , Str \"note.\"\n      , Note\n          [ Para\n              [ Str \"This\"\n              , SoftBreak\n              , Str \"is\"\n              , Space\n              , Emph [ Str \"easier\" ]\n              , Space\n              , Str \"to\"\n              , Space\n              , Str \"type.\"\n              , Space\n              , Str \"Inline\"\n              , Space\n              , Str \"notes\"\n              , Space\n              , Str \"may\"\n              , Space\n              , Str \"contain\"\n              , SoftBreak\n              , Link\n                  ( \"\" , [] , [] ) [ Str \"links\" ] ( \"http://google.com\" , \"\" )\n              , Space\n              , Str \"and\"\n              , Space\n              , Code ( \"\" , [] , [] ) \"]\"\n              , Space\n              , Str \"verbatim\"\n              , Space\n              , Str \"characters,\"\n              , SoftBreak\n              , Str \"as\"\n              , Space\n              , Str \"well\"\n              , Space\n              , Str \"as\"\n              , Space\n              , Str \"[bracketed\"\n              , Space\n              , Str \"text].\"\n              ]\n          ]\n      ]\n  , BlockQuote\n      [ Para\n          [ Str \"Notes\"\n          , Space\n          , Str \"can\"\n          , Space\n          , Str \"go\"\n          , Space\n          , Str \"in\"\n          , Space\n          , Str \"quotes.\"\n          , Note [ Para [ Str \"In\" , Space , Str \"quote.\" ] ]\n          ]\n      ]\n  , OrderedList\n      ( 1 , Decimal , Period )\n      [ [ Plain\n            [ Str \"And\"\n            , Space\n            , Str \"in\"\n            , Space\n            , Str \"list\"\n            , Space\n            , Str \"items.\"\n            , Note [ Para [ Str \"In\" , Space , Str \"list.\" ] ]\n            ]\n        ]\n      ]\n  , Para\n      [ Str \"This\"\n      , Space\n      , Str \"paragraph\"\n      , Space\n      , Str \"should\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"be\"\n      , Space\n      , Str \"part\"\n      , Space\n      , Str \"of\"\n      , Space\n      , Str \"the\"\n      , Space\n      , Str \"note,\"\n      , Space\n      , Str \"as\"\n      , Space\n      , Str \"it\"\n      , Space\n      , Str \"is\"\n      , Space\n      , Str \"not\"\n      , Space\n      , Str \"indented.\"\n      ]\n  ]\n"
  },
  {
    "path": "test/writer.opendocument",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\" xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" office:version=\"1.3\">\n  <office:font-face-decls>\n    <style:font-face style:name=\"Courier New\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\" svg:font-family=\"'Courier New'\" />\n  </office:font-face-decls>\n  <office:automatic-styles>\n    <text:list-style style:name=\"L1\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L2\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L3\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L4\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L5\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L6\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L7\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L8\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L9\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L10\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L11\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L12\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L13\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L14\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L15\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L16\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L17\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L18\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L19\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L20\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L21\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L22\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"2\" style:num-prefix=\"(\" style:num-suffix=\")\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"i\" text:start-value=\"4\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"A\" text:start-value=\"1\" style:num-prefix=\"(\" style:num-suffix=\")\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L23\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"A\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"I\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"3\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"6\" style:num-prefix=\"(\" style:num-suffix=\")\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"4\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"a\" text:start-value=\"3\" style:num-suffix=\")\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L24\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n      <text:list-level-style-number text:level=\"2\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L25\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <text:list-style style:name=\"L26\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L27\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L28\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L29\">\n      <text:list-level-style-bullet text:level=\"1\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"2\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"3\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"4\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"5\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"6\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"1.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"1.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"7\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.0in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.0in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"8\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"◦\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.25in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.25in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"9\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"▪\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n      <text:list-level-style-bullet text:level=\"10\" text:style-name=\"Bullet_20_Symbols\" style:num-suffix=\".\" text:bullet-char=\"•\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"2.75in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"2.75in\" />\n        </style:list-level-properties>\n      </text:list-level-style-bullet>\n    </text:list-style>\n    <text:list-style style:name=\"L30\">\n      <text:list-level-style-number text:level=\"1\" text:style-name=\"Numbering_20_Symbols\" style:num-format=\"1\" text:start-value=\"1\" style:num-suffix=\".\">\n        <style:list-level-properties text:list-level-position-and-space-mode=\"label-alignment\" fo:text-align=\"right\">\n          <style:list-level-label-alignment text:label-followed-by=\"listtab\" text:list-tab-stop-position=\"0.5in\" fo:text-indent=\"-0.25in\" fo:margin-left=\"0.5in\" />\n        </style:list-level-properties>\n      </text:list-level-style-number>\n    </text:list-style>\n    <style:style style:name=\"T1\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" style:font-style-asian=\"italic\" style:font-style-complex=\"italic\" /></style:style>\n    <style:style style:name=\"T2\" style:family=\"text\"><style:text-properties fo:font-weight=\"bold\" style:font-weight-asian=\"bold\" style:font-weight-complex=\"bold\" /></style:style>\n    <style:style style:name=\"T3\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" fo:font-weight=\"bold\" style:font-style-asian=\"italic\" style:font-style-complex=\"italic\" style:font-weight-asian=\"bold\" style:font-weight-complex=\"bold\" /></style:style>\n    <style:style style:name=\"T4\" style:family=\"text\"><style:text-properties style:text-line-through-style=\"solid\" /></style:style>\n    <style:style style:name=\"T5\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" style:font-style-asian=\"italic\" style:font-style-complex=\"italic\" style:text-line-through-style=\"solid\" /></style:style>\n    <style:style style:name=\"T6\" style:family=\"text\"><style:text-properties style:text-position=\"super 58%\" /></style:style>\n    <style:style style:name=\"T7\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" style:font-style-asian=\"italic\" style:font-style-complex=\"italic\" style:text-position=\"super 58%\" /></style:style>\n    <style:style style:name=\"T8\" style:family=\"text\"><style:text-properties style:text-position=\"sub 58%\" /></style:style>\n    <style:style style:name=\"fr2\" style:family=\"graphic\" style:parent-style-name=\"Formula\"><style:graphic-properties style:vertical-pos=\"middle\" style:vertical-rel=\"text\" style:horizontal-pos=\"center\" style:horizontal-rel=\"paragraph-content\" style:wrap=\"none\" /></style:style>\n    <style:style style:name=\"fr1\" style:family=\"graphic\" style:parent-style-name=\"Formula\"><style:graphic-properties style:vertical-pos=\"middle\" style:vertical-rel=\"text\" /></style:style>\n    <style:style style:name=\"P1\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P2\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P3\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P4\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P5\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P6\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L1\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P7\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"1.0in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P8\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"1.0in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P9\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P10\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P11\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P12\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P13\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P14\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P15\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P16\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P17\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P18\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P19\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L2\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P20\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L3\">\n    </style:style>\n    <style:style style:name=\"P21\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L4\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P22\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L5\">\n    </style:style>\n    <style:style style:name=\"P23\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L6\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P24\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L7\">\n    </style:style>\n    <style:style style:name=\"P25\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L8\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P26\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L9\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P27\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L10\">\n    </style:style>\n    <style:style style:name=\"P28\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L11\">\n    </style:style>\n    <style:style style:name=\"P29\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L12\">\n    </style:style>\n    <style:style style:name=\"P30\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L13\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P31\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L14\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P32\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L15\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P33\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L16\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P34\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L17\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P35\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L18\">\n    </style:style>\n    <style:style style:name=\"P36\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L19\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P37\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L20\">\n    </style:style>\n    <style:style style:name=\"P38\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L21\">\n    </style:style>\n    <style:style style:name=\"P39\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L22\">\n    </style:style>\n    <style:style style:name=\"P40\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L23\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P41\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L24\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P42\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P43\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P44\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L25\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P45\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P46\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P47\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P48\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P49\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P50\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P51\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L26\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P52\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L27\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P53\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L28\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P54\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P55\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L29\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n    <style:style style:name=\"P56\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P57\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P58\" style:family=\"paragraph\" style:parent-style-name=\"Preformatted_20_Text\">\n    </style:style>\n    <style:style style:name=\"P59\" style:family=\"paragraph\" style:parent-style-name=\"Quotations\">\n      <style:paragraph-properties fo:margin-left=\"0.5in\" fo:margin-right=\"0in\" fo:text-indent=\"0in\" style:auto-text-indent=\"false\" />\n    </style:style>\n    <style:style style:name=\"P60\" style:family=\"paragraph\" style:parent-style-name=\"Text_20_body\" style:list-style-name=\"L30\">\n      <style:paragraph-properties fo:margin-top=\"0in\" fo:margin-bottom=\"0in\" />\n    </style:style>\n  </office:automatic-styles>\n<office:body>\n<office:text>\n<text:p text:style-name=\"Title\">Pandoc Test Suite</text:p>\n<text:p text:style-name=\"Author\">John MacFarlane</text:p>\n<text:p text:style-name=\"Author\">Anonymous</text:p>\n<text:p text:style-name=\"Date\">July 17, 2006</text:p>\n<text:p text:style-name=\"Text_20_body\">This is a set of tests for pandoc. Most\nof them are adapted from John Gruber’s markdown test suite.</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"headers\" />Headers<text:bookmark-end text:name=\"headers\" /></text:h>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"level-2-with-an-embedded-link\" />Level\n2 with an\n<text:a xlink:type=\"simple\" xlink:href=\"/url\" office:name=\"\"><text:span text:style-name=\"Definition\">embedded\nlink</text:span></text:a><text:bookmark-end text:name=\"level-2-with-an-embedded-link\" /></text:h>\n<text:h text:style-name=\"Heading_20_3\" text:outline-level=\"3\"><text:bookmark-start text:name=\"level-3-with-emphasis\" />Level\n3 with\n<text:span text:style-name=\"T1\">emphasis</text:span><text:bookmark-end text:name=\"level-3-with-emphasis\" /></text:h>\n<text:h text:style-name=\"Heading_20_4\" text:outline-level=\"4\"><text:bookmark-start text:name=\"level-4\" />Level\n4<text:bookmark-end text:name=\"level-4\" /></text:h>\n<text:h text:style-name=\"Heading_20_5\" text:outline-level=\"5\"><text:bookmark-start text:name=\"level-5\" />Level\n5<text:bookmark-end text:name=\"level-5\" /></text:h>\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"level-1\" />Level\n1<text:bookmark-end text:name=\"level-1\" /></text:h>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"level-2-with-emphasis\" />Level\n2 with\n<text:span text:style-name=\"T1\">emphasis</text:span><text:bookmark-end text:name=\"level-2-with-emphasis\" /></text:h>\n<text:h text:style-name=\"Heading_20_3\" text:outline-level=\"3\"><text:bookmark-start text:name=\"level-3\" />Level\n3<text:bookmark-end text:name=\"level-3\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">with no blank line</text:p>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"level-2\" />Level\n2<text:bookmark-end text:name=\"level-2\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">with no blank line</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"paragraphs\" />Paragraphs<text:bookmark-end text:name=\"paragraphs\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Here’s a regular\nparagraph.</text:p>\n<text:p text:style-name=\"Text_20_body\">In Markdown 1.0.0 and earlier. Version 8.\nThis line turns into a list item. Because a hard-wrapped line in the middle of a\nparagraph looked like a list item.</text:p>\n<text:p text:style-name=\"Text_20_body\">Here’s one with a bullet. *\ncriminey.</text:p>\n<text:p text:style-name=\"Text_20_body\">There should be a hard line\nbreak<text:line-break />here.</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"block-quotes\" />Block\nQuotes<text:bookmark-end text:name=\"block-quotes\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">E-mail style:</text:p>\n<text:p text:style-name=\"P1\">This is a block quote. It is pretty short.</text:p>\n<text:p text:style-name=\"P2\">Code in a block quote:</text:p>\n<text:p text:style-name=\"P3\">sub status {</text:p>\n<text:p text:style-name=\"P4\"><text:s text:c=\"4\" />print &quot;working&quot;;</text:p>\n<text:p text:style-name=\"P5\">}</text:p>\n<text:p text:style-name=\"P2\">A list:</text:p>\n<text:list text:style-name=\"L1\">\n  <text:list-item>\n    <text:p text:style-name=\"P6\">item one</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P6\">item two</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"P2\">Nested block quotes:</text:p>\n<text:p text:style-name=\"P7\">nested</text:p>\n<text:p text:style-name=\"P8\">nested</text:p>\n<text:p text:style-name=\"First_20_paragraph\">This should not be a block quote: 2\n&gt; 1.</text:p>\n<text:p text:style-name=\"Text_20_body\">And a following paragraph.</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"code-blocks\" />Code\nBlocks<text:bookmark-end text:name=\"code-blocks\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Code:</text:p>\n<text:p text:style-name=\"P9\">---- (should be four hyphens)</text:p>\n<text:p text:style-name=\"P10\"></text:p>\n<text:p text:style-name=\"P11\">sub status {</text:p>\n<text:p text:style-name=\"P12\"><text:s text:c=\"4\" />print &quot;working&quot;;</text:p>\n<text:p text:style-name=\"P13\">}</text:p>\n<text:p text:style-name=\"P14\"></text:p>\n<text:p text:style-name=\"P15\">this code block is indented by one tab</text:p>\n<text:p text:style-name=\"First_20_paragraph\">And:</text:p>\n<text:p text:style-name=\"P16\"><text:s text:c=\"4\" />this code block is indented by two tabs</text:p>\n<text:p text:style-name=\"P17\"></text:p>\n<text:p text:style-name=\"P18\">These should not be escaped: <text:s text:c=\"1\" />\\$ \\\\ \\&gt; \\[ \\{</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"lists\" />Lists<text:bookmark-end text:name=\"lists\" /></text:h>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"unordered\" />Unordered<text:bookmark-end text:name=\"unordered\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Asterisks tight:</text:p>\n<text:list text:style-name=\"L2\">\n  <text:list-item>\n    <text:p text:style-name=\"P19\">asterisk 1</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P19\">asterisk 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P19\">asterisk 3</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Asterisks loose:</text:p>\n<text:list text:style-name=\"L3\">\n  <text:list-item>\n    <text:p text:style-name=\"P20\">asterisk 1</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P20\">asterisk 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P20\">asterisk 3</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Pluses tight:</text:p>\n<text:list text:style-name=\"L4\">\n  <text:list-item>\n    <text:p text:style-name=\"P21\">Plus 1</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P21\">Plus 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P21\">Plus 3</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Pluses loose:</text:p>\n<text:list text:style-name=\"L5\">\n  <text:list-item>\n    <text:p text:style-name=\"P22\">Plus 1</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P22\">Plus 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P22\">Plus 3</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Minuses tight:</text:p>\n<text:list text:style-name=\"L6\">\n  <text:list-item>\n    <text:p text:style-name=\"P23\">Minus 1</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P23\">Minus 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P23\">Minus 3</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Minuses loose:</text:p>\n<text:list text:style-name=\"L7\">\n  <text:list-item>\n    <text:p text:style-name=\"P24\">Minus 1</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P24\">Minus 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P24\">Minus 3</text:p>\n  </text:list-item>\n</text:list>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"ordered\" />Ordered<text:bookmark-end text:name=\"ordered\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Tight:</text:p>\n<text:list text:style-name=\"L8\">\n  <text:list-item>\n    <text:p text:style-name=\"P25\">First</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P25\">Second</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P25\">Third</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">and:</text:p>\n<text:list text:style-name=\"L9\">\n  <text:list-item>\n    <text:p text:style-name=\"P26\">One</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P26\">Two</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P26\">Three</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Loose using tabs:</text:p>\n<text:list text:style-name=\"L10\">\n  <text:list-item>\n    <text:p text:style-name=\"P27\">First</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P27\">Second</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P27\">Third</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">and using spaces:</text:p>\n<text:list text:style-name=\"L11\">\n  <text:list-item>\n    <text:p text:style-name=\"P28\">One</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P28\">Two</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P28\">Three</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Multiple paragraphs:</text:p>\n<text:list text:style-name=\"L12\">\n  <text:list-item>\n    <text:p text:style-name=\"P29\">Item 1, graf one.</text:p>\n    <text:p text:style-name=\"P29\">Item 1. graf two. The quick brown fox jumped\n    over the lazy dog’s back.</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P29\">Item 2.</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P29\">Item 3.</text:p>\n  </text:list-item>\n</text:list>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"nested\" />Nested<text:bookmark-end text:name=\"nested\" /></text:h>\n<text:list text:style-name=\"L13\">\n  <text:list-item>\n    <text:p text:style-name=\"P30\">Tab</text:p><text:list text:style-name=\"L14\">\n      <text:list-item>\n        <text:p text:style-name=\"P31\">Tab</text:p><text:list text:style-name=\"L15\">\n          <text:list-item>\n            <text:p text:style-name=\"P32\">Tab</text:p>\n          </text:list-item>\n        </text:list>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Here’s another:</text:p>\n<text:list text:style-name=\"L16\">\n  <text:list-item>\n    <text:p text:style-name=\"P33\">First</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P33\">Second:</text:p>\n    <text:list text:style-name=\"L17\">\n      <text:list-item>\n        <text:p text:style-name=\"P34\">Fee</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P34\">Fie</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P34\">Foe</text:p>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P33\">Third</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Same thing but with\nparagraphs:</text:p>\n<text:list text:style-name=\"L18\">\n  <text:list-item>\n    <text:p text:style-name=\"P35\">First</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P35\">Second:</text:p>\n    <text:list text:style-name=\"L19\">\n      <text:list-item>\n        <text:p text:style-name=\"P36\">Fee</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P36\">Fie</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P36\">Foe</text:p>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P35\">Third</text:p>\n  </text:list-item>\n</text:list>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"tabs-and-spaces\" />Tabs\nand spaces<text:bookmark-end text:name=\"tabs-and-spaces\" /></text:h>\n<text:list text:style-name=\"L20\">\n  <text:list-item>\n    <text:p text:style-name=\"P37\">this is a list item indented with\n    tabs</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P37\">this is a list item indented with\n    spaces</text:p><text:list text:style-name=\"L21\">\n      <text:list-item>\n        <text:p text:style-name=\"P38\">this is an example list item indented with\n        tabs</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P38\">this is an example list item indented with\n        spaces</text:p>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n</text:list>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"fancy-list-markers\" />Fancy\nlist markers<text:bookmark-end text:name=\"fancy-list-markers\" /></text:h>\n<text:list text:style-name=\"L22\">\n  <text:list-item>\n    <text:p text:style-name=\"P39\">begins with 2</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P39\">and now 3</text:p>\n    <text:p text:style-name=\"P39\">with a continuation</text:p>\n    <text:list>\n      <text:list-item>\n        <text:p text:style-name=\"P39\">sublist with roman numerals, starting with\n        4</text:p>\n      </text:list-item>\n      <text:list-item>\n        <text:p text:style-name=\"P39\">more items</text:p>\n        <text:list>\n          <text:list-item>\n            <text:p text:style-name=\"P39\">a subsublist</text:p>\n          </text:list-item>\n          <text:list-item>\n            <text:p text:style-name=\"P39\">a subsublist</text:p>\n          </text:list-item>\n        </text:list>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Nesting:</text:p>\n<text:list text:style-name=\"L23\">\n  <text:list-item>\n    <text:p text:style-name=\"P40\">Upper Alpha</text:p>\n    <text:list>\n      <text:list-item>\n        <text:p text:style-name=\"P40\">Upper Roman.</text:p>\n        <text:list>\n          <text:list-item>\n            <text:p text:style-name=\"P40\">Decimal start with 6</text:p>\n            <text:list>\n              <text:list-item>\n                <text:p text:style-name=\"P40\">Lower alpha with paren</text:p>\n              </text:list-item>\n            </text:list>\n          </text:list-item>\n        </text:list>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Autonumbering:</text:p>\n<text:list text:style-name=\"L24\">\n  <text:list-item>\n    <text:p text:style-name=\"P41\">Autonumber.</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P41\">More.</text:p>\n    <text:list>\n      <text:list-item>\n        <text:p text:style-name=\"P41\">Nested.</text:p>\n      </text:list-item>\n    </text:list>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Should not be a list item:</text:p>\n<text:p text:style-name=\"Text_20_body\">M.A. 2007</text:p>\n<text:p text:style-name=\"Text_20_body\">B. Williams</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"definition-lists\" />Definition\nLists<text:bookmark-end text:name=\"definition-lists\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Tight using spaces:</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">apple</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">red fruit</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">orange</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">orange\nfruit</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">banana</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">yellow\nfruit</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Tight using tabs:</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">apple</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">red fruit</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">orange</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">orange\nfruit</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">banana</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">yellow\nfruit</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Loose:</text:p>\n<text:p text:style-name=\"Definition_20_Term\">apple</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">red fruit</text:p>\n<text:p text:style-name=\"Definition_20_Term\">orange</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">orange fruit</text:p>\n<text:p text:style-name=\"Definition_20_Term\">banana</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">yellow fruit</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Multiple blocks with\nitalics:</text:p>\n<text:p text:style-name=\"Definition_20_Term\"><text:span text:style-name=\"T1\">apple</text:span></text:p>\n<text:p text:style-name=\"Definition_20_Definition\">red\nfruit</text:p><text:p text:style-name=\"Definition_20_Definition\">contains seeds,\ncrisp, pleasant to taste</text:p>\n<text:p text:style-name=\"Definition_20_Term\"><text:span text:style-name=\"T1\">orange</text:span></text:p>\n<text:p text:style-name=\"Definition_20_Definition\">orange\nfruit</text:p><text:p text:style-name=\"P42\">{ orange code block }</text:p><text:p text:style-name=\"P43\">orange\nblock quote</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Multiple definitions,\ntight:</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">apple</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">red fruit</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">computer</text:p>\n<text:p text:style-name=\"Definition_20_Term_20_Tight\">orange</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">orange\nfruit</text:p>\n<text:p text:style-name=\"Definition_20_Definition_20_Tight\">bank</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Multiple definitions,\nloose:</text:p>\n<text:p text:style-name=\"Definition_20_Term\">apple</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">red fruit</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">computer</text:p>\n<text:p text:style-name=\"Definition_20_Term\">orange</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">orange fruit</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">bank</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Blank line after term, indented\nmarker, alternate markers:</text:p>\n<text:p text:style-name=\"Definition_20_Term\">apple</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">red fruit</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">computer</text:p>\n<text:p text:style-name=\"Definition_20_Term\">orange</text:p>\n<text:p text:style-name=\"Definition_20_Definition\">orange\nfruit</text:p><text:list text:style-name=\"L25\">\n  <text:list-item>\n    <text:p text:style-name=\"P44\">sublist</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P44\">sublist</text:p>\n  </text:list-item>\n</text:list>\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"html-blocks\" />HTML\nBlocks<text:bookmark-end text:name=\"html-blocks\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Simple block on one line:</text:p>\n<text:p text:style-name=\"Text_20_body\">foo</text:p>\n<text:p text:style-name=\"Text_20_body\">And nested without indentation:</text:p>\n<text:p text:style-name=\"Text_20_body\">foo</text:p>\n<text:p text:style-name=\"Text_20_body\">bar</text:p>\n<text:p text:style-name=\"Text_20_body\">Interpreted markdown in a table:</text:p>\n<text:p text:style-name=\"Text_20_body\">This is\n<text:span text:style-name=\"T1\">emphasized</text:span></text:p>\n<text:p text:style-name=\"Text_20_body\">And this is\n<text:span text:style-name=\"T2\">strong</text:span></text:p>\n<text:p text:style-name=\"Text_20_body\">Here’s a simple block:</text:p>\n<text:p text:style-name=\"Text_20_body\">foo</text:p>\n<text:p text:style-name=\"Text_20_body\">This should be a code block,\nthough:</text:p>\n<text:p text:style-name=\"P45\">&lt;div&gt;</text:p>\n<text:p text:style-name=\"P46\"><text:s text:c=\"4\" />foo</text:p>\n<text:p text:style-name=\"P47\">&lt;/div&gt;</text:p>\n<text:p text:style-name=\"First_20_paragraph\">As should this:</text:p>\n<text:p text:style-name=\"P48\">&lt;div&gt;foo&lt;/div&gt;</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Now, nested:</text:p>\n<text:p text:style-name=\"Text_20_body\">foo</text:p>\n<text:p text:style-name=\"Text_20_body\">This should just be an HTML\ncomment:</text:p>\n<text:p text:style-name=\"Text_20_body\">Multiline:</text:p>\n<text:p text:style-name=\"Text_20_body\">Code block:</text:p>\n<text:p text:style-name=\"P49\">&lt;!-- Comment --&gt;</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Just plain comment, with trailing\nspaces on the line:</text:p>\n<text:p text:style-name=\"Text_20_body\">Code:</text:p>\n<text:p text:style-name=\"P50\">&lt;hr /&gt;</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Hr’s:</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"inline-markup\" />Inline\nMarkup<text:bookmark-end text:name=\"inline-markup\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">This is\n<text:span text:style-name=\"T1\">emphasized</text:span>, and so\n<text:span text:style-name=\"T1\">is this</text:span>.</text:p>\n<text:p text:style-name=\"Text_20_body\">This is\n<text:span text:style-name=\"T2\">strong</text:span>, and so\n<text:span text:style-name=\"T2\">is this</text:span>.</text:p>\n<text:p text:style-name=\"Text_20_body\">An\n<text:a xlink:type=\"simple\" xlink:href=\"/url\" office:name=\"\"><text:span text:style-name=\"Definition\"><text:span text:style-name=\"T1\">emphasized\nlink</text:span></text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:span text:style-name=\"T3\">This is\nstrong and em.</text:span></text:p>\n<text:p text:style-name=\"Text_20_body\">So is\n<text:span text:style-name=\"T3\">this</text:span> word.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:span text:style-name=\"T3\">This is\nstrong and em.</text:span></text:p>\n<text:p text:style-name=\"Text_20_body\">So is\n<text:span text:style-name=\"T3\">this</text:span> word.</text:p>\n<text:p text:style-name=\"Text_20_body\">This is code:\n<text:span text:style-name=\"Source_20_Text\">&gt;</text:span>,\n<text:span text:style-name=\"Source_20_Text\">$</text:span>,\n<text:span text:style-name=\"Source_20_Text\">\\</text:span>,\n<text:span text:style-name=\"Source_20_Text\">\\$</text:span>,\n<text:span text:style-name=\"Source_20_Text\">&lt;html&gt;</text:span>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:span text:style-name=\"T4\">This is\n</text:span><text:span text:style-name=\"T5\">strikeout</text:span><text:span text:style-name=\"T4\">.</text:span></text:p>\n<text:p text:style-name=\"Text_20_body\">Superscripts:\na<text:span text:style-name=\"T6\">bc</text:span>d\na<text:span text:style-name=\"T7\">hello</text:span>\na<text:span text:style-name=\"T6\">hello there</text:span>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Subscripts:\nH<text:span text:style-name=\"T8\">2</text:span>O,\nH<text:span text:style-name=\"T8\">23</text:span>O,\nH<text:span text:style-name=\"T8\">many of them</text:span>O.</text:p>\n<text:p text:style-name=\"Text_20_body\">These should not be superscripts or\nsubscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"smart-quotes-ellipses-dashes\" />Smart\nquotes, ellipses,\ndashes<text:bookmark-end text:name=\"smart-quotes-ellipses-dashes\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">“Hello,” said the spider. “‘Shelob’\nis my name.”</text:p>\n<text:p text:style-name=\"Text_20_body\">‘A’, ‘B’, and ‘C’ are letters.</text:p>\n<text:p text:style-name=\"Text_20_body\">‘Oak,’ ‘elm,’ and ‘beech’ are names of\ntrees. So is ‘pine.’</text:p>\n<text:p text:style-name=\"Text_20_body\">‘He said, “I want to go.”’ Were you alive\nin the 70’s?</text:p>\n<text:p text:style-name=\"Text_20_body\">Here is some quoted\n‘<text:span text:style-name=\"Source_20_Text\">code</text:span>’ and a\n“<text:a xlink:type=\"simple\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\" office:name=\"\"><text:span text:style-name=\"Definition\">quoted\nlink</text:span></text:a>”.</text:p>\n<text:p text:style-name=\"Text_20_body\">Some dashes: one—two — three—four —\nfive.</text:p>\n<text:p text:style-name=\"Text_20_body\">Dashes between numbers: 5–7, 255–66,\n1987–1999.</text:p>\n<text:p text:style-name=\"Text_20_body\">Ellipses…and…and….</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"latex\" />LaTeX<text:bookmark-end text:name=\"latex\" /></text:h>\n<text:list text:style-name=\"L26\">\n  <text:list-item>\n    <text:p text:style-name=\"P51\"></text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\">2 + 2 = 4</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\"><text:span text:style-name=\"T1\">x</text:span> ∈ <text:span text:style-name=\"T1\">y</text:span></text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\"><text:span text:style-name=\"T1\">α</text:span> ∧ <text:span text:style-name=\"T1\">ω</text:span></text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\">223</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\"><text:span text:style-name=\"T1\">p</text:span>-Tree</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\">Here’s some display math:\n    $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P51\">Here’s one that has a line break in it:\n    <text:span text:style-name=\"T1\">α</text:span> + <text:span text:style-name=\"T1\">ω</text:span> × <text:span text:style-name=\"T1\">x</text:span><text:span text:style-name=\"T6\">2</text:span>.</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">These shouldn’t be math:</text:p>\n<text:list text:style-name=\"L27\">\n  <text:list-item>\n    <text:p text:style-name=\"P52\">To get the famous equation, write\n    <text:span text:style-name=\"Source_20_Text\">$e = mc^2$</text:span>.</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P52\">$22,000 is a\n    <text:span text:style-name=\"T1\">lot</text:span> of money. So is $34,000. (It\n    worked if “lot” is emphasized.)</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P52\">Shoes ($20) and socks ($5).</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P52\">Escaped\n    <text:span text:style-name=\"Source_20_Text\">$</text:span>: $73\n    <text:span text:style-name=\"T1\">this should be emphasized</text:span>\n    23$.</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">Here’s a LaTeX table:</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"special-characters\" />Special\nCharacters<text:bookmark-end text:name=\"special-characters\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Here is some unicode:</text:p>\n<text:list text:style-name=\"L28\">\n  <text:list-item>\n    <text:p text:style-name=\"P53\">I hat: Î</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P53\">o umlaut: ö</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P53\">section: §</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P53\">set membership: ∈</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P53\">copyright: ©</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">AT&amp;T has an ampersand in their\nname.</text:p>\n<text:p text:style-name=\"Text_20_body\">AT&amp;T is another way to write\nit.</text:p>\n<text:p text:style-name=\"Text_20_body\">This &amp; that.</text:p>\n<text:p text:style-name=\"Text_20_body\">4 &lt; 5.</text:p>\n<text:p text:style-name=\"Text_20_body\">6 &gt; 5.</text:p>\n<text:p text:style-name=\"Text_20_body\">Backslash: \\</text:p>\n<text:p text:style-name=\"Text_20_body\">Backtick: `</text:p>\n<text:p text:style-name=\"Text_20_body\">Asterisk: *</text:p>\n<text:p text:style-name=\"Text_20_body\">Underscore: _</text:p>\n<text:p text:style-name=\"Text_20_body\">Left brace: {</text:p>\n<text:p text:style-name=\"Text_20_body\">Right brace: }</text:p>\n<text:p text:style-name=\"Text_20_body\">Left bracket: [</text:p>\n<text:p text:style-name=\"Text_20_body\">Right bracket: ]</text:p>\n<text:p text:style-name=\"Text_20_body\">Left paren: (</text:p>\n<text:p text:style-name=\"Text_20_body\">Right paren: )</text:p>\n<text:p text:style-name=\"Text_20_body\">Greater-than: &gt;</text:p>\n<text:p text:style-name=\"Text_20_body\">Hash: #</text:p>\n<text:p text:style-name=\"Text_20_body\">Period: .</text:p>\n<text:p text:style-name=\"Text_20_body\">Bang: !</text:p>\n<text:p text:style-name=\"Text_20_body\">Plus: +</text:p>\n<text:p text:style-name=\"Text_20_body\">Minus: -</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"links\" />Links<text:bookmark-end text:name=\"links\" /></text:h>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"explicit\" />Explicit<text:bookmark-end text:name=\"explicit\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Just a\n<text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"\"><text:span text:style-name=\"Definition\">URL</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"title\"><text:span text:style-name=\"Definition\">URL\nand title</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"title preceded by two spaces\"><text:span text:style-name=\"Definition\">URL\nand title</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"title preceded by a tab\"><text:span text:style-name=\"Definition\">URL\nand title</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"title with &quot;quotes&quot; in it\"><text:span text:style-name=\"Definition\">URL\nand title</text:span></text:a></text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"title with single quotes\"><text:span text:style-name=\"Definition\">URL\nand title</text:span></text:a></text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/with_underscore\" office:name=\"\"><text:span text:style-name=\"Definition\">with_underscore</text:span></text:a></text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"mailto:nobody@nowhere.net\" office:name=\"\"><text:span text:style-name=\"Definition\">Email\nlink</text:span></text:a></text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"\" office:name=\"\"><text:span text:style-name=\"Definition\">Empty</text:span></text:a>.</text:p>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"reference\" />Reference<text:bookmark-end text:name=\"reference\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Foo\n<text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"\"><text:span text:style-name=\"Definition\">bar</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">With\n<text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"\"><text:span text:style-name=\"Definition\">embedded\n[brackets]</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\"><text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"\"><text:span text:style-name=\"Definition\">b</text:span></text:a>\nby itself should be a link.</text:p>\n<text:p text:style-name=\"Text_20_body\">Indented\n<text:a xlink:type=\"simple\" xlink:href=\"/url\" office:name=\"\"><text:span text:style-name=\"Definition\">once</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Indented\n<text:a xlink:type=\"simple\" xlink:href=\"/url\" office:name=\"\"><text:span text:style-name=\"Definition\">twice</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Indented\n<text:a xlink:type=\"simple\" xlink:href=\"/url\" office:name=\"\"><text:span text:style-name=\"Definition\">thrice</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">This should [not][] be a link.</text:p>\n<text:p text:style-name=\"P54\">[not]: /url</text:p>\n<text:p text:style-name=\"First_20_paragraph\">Foo\n<text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"Title with &quot;quotes&quot; inside\"><text:span text:style-name=\"Definition\">bar</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Foo\n<text:a xlink:type=\"simple\" xlink:href=\"/url/\" office:name=\"Title with &quot;quote&quot; inside\"><text:span text:style-name=\"Definition\">biz</text:span></text:a>.</text:p>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"with-ampersands\" />With\nampersands<text:bookmark-end text:name=\"with-ampersands\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Here’s a\n<text:a xlink:type=\"simple\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\" office:name=\"\"><text:span text:style-name=\"Definition\">link\nwith an ampersand in the URL</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Here’s a link with an amersand in the\nlink text:\n<text:a xlink:type=\"simple\" xlink:href=\"http://att.com/\" office:name=\"AT&amp;T\"><text:span text:style-name=\"Definition\">AT&amp;T</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Here’s an\n<text:a xlink:type=\"simple\" xlink:href=\"/script?foo=1&amp;bar=2\" office:name=\"\"><text:span text:style-name=\"Definition\">inline\nlink</text:span></text:a>.</text:p>\n<text:p text:style-name=\"Text_20_body\">Here’s an\n<text:a xlink:type=\"simple\" xlink:href=\"/script?foo=1&amp;bar=2\" office:name=\"\"><text:span text:style-name=\"Definition\">inline\nlink in pointy braces</text:span></text:a>.</text:p>\n<text:h text:style-name=\"Heading_20_2\" text:outline-level=\"2\"><text:bookmark-start text:name=\"autolinks\" />Autolinks<text:bookmark-end text:name=\"autolinks\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">With an ampersand:\n<text:a xlink:type=\"simple\" xlink:href=\"http://example.com/?foo=1&amp;bar=2\" office:name=\"\"><text:span text:style-name=\"Definition\">http://example.com/?foo=1&amp;bar=2</text:span></text:a></text:p>\n<text:list text:style-name=\"L29\">\n  <text:list-item>\n    <text:p text:style-name=\"P55\">In a list?</text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P55\"><text:a xlink:type=\"simple\" xlink:href=\"http://example.com/\" office:name=\"\"><text:span text:style-name=\"Definition\">http://example.com/</text:span></text:a></text:p>\n  </text:list-item>\n  <text:list-item>\n    <text:p text:style-name=\"P55\">It should.</text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">An e-mail address:\n<text:a xlink:type=\"simple\" xlink:href=\"mailto:nobody@nowhere.net\" office:name=\"\"><text:span text:style-name=\"Definition\">nobody@nowhere.net</text:span></text:a></text:p>\n<text:p text:style-name=\"P56\">Blockquoted:\n<text:a xlink:type=\"simple\" xlink:href=\"http://example.com/\" office:name=\"\"><text:span text:style-name=\"Definition\">http://example.com/</text:span></text:a></text:p>\n<text:p text:style-name=\"First_20_paragraph\">Auto-links should not occur here:\n<text:span text:style-name=\"Source_20_Text\">&lt;http://example.com/&gt;</text:span></text:p>\n<text:p text:style-name=\"P57\">or here: &lt;http://example.com/&gt;</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"images\" />Images<text:bookmark-end text:name=\"images\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">From “Voyage dans la Lune” by\nGeorges Melies (1902):</text:p>\n<text:p text:style-name=\"FigureWithCaption\"><draw:frame draw:name=\"img1\"><draw:image xlink:href=\"lalune.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame></text:p>\n<text:p text:style-name=\"FigureCaption\">lalune</text:p>\n<text:p text:style-name=\"Text_20_body\">Here is a movie\n<draw:frame draw:name=\"img2\"><draw:image xlink:href=\"movie.jpg\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" /></draw:frame>\nicon.</text:p>\n<text:p text:style-name=\"Horizontal_20_Line\" />\n<text:h text:style-name=\"Heading_20_1\" text:outline-level=\"1\"><text:bookmark-start text:name=\"footnotes\" />Footnotes<text:bookmark-end text:name=\"footnotes\" /></text:h>\n<text:p text:style-name=\"First_20_paragraph\">Here is a footnote\nreference,<text:note text:id=\"ftn0\" text:note-class=\"footnote\"><text:note-citation>1</text:note-citation><text:note-body><text:p text:style-name=\"Footnote\">Here\nis the footnote. It can go anywhere after the footnote reference. It need not be\nplaced at the end of the document.</text:p></text:note-body></text:note> and\nanother.<text:note text:id=\"ftn1\" text:note-class=\"footnote\"><text:note-citation>2</text:note-citation><text:note-body><text:p text:style-name=\"Footnote\">Here’s\nthe long note. This one contains multiple\nblocks.</text:p><text:p text:style-name=\"Footnote\">Subsequent blocks are\nindented to show that they belong to the footnote (as with list\nitems).</text:p><text:p text:style-name=\"P58\"><text:s text:c=\"2\" />{ &lt;code&gt; }</text:p><text:p text:style-name=\"Footnote\">If\nyou want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.</text:p></text:note-body></text:note> This should\n<text:span text:style-name=\"T1\">not</text:span> be a footnote reference, because\nit contains a space.[^my note] Here is an inline\nnote.<text:note text:id=\"ftn2\" text:note-class=\"footnote\"><text:note-citation>3</text:note-citation><text:note-body><text:p text:style-name=\"Footnote\">This\nis <text:span text:style-name=\"T1\">easier</text:span> to type. Inline notes may\ncontain\n<text:a xlink:type=\"simple\" xlink:href=\"http://google.com\" office:name=\"\"><text:span text:style-name=\"Definition\">links</text:span></text:a>\nand <text:span text:style-name=\"Source_20_Text\">]</text:span> verbatim\ncharacters, as well as [bracketed\ntext].</text:p></text:note-body></text:note></text:p>\n<text:p text:style-name=\"P59\">Notes can go in\nquotes.<text:note text:id=\"ftn3\" text:note-class=\"footnote\"><text:note-citation>4</text:note-citation><text:note-body><text:p text:style-name=\"Footnote\">In\nquote.</text:p></text:note-body></text:note></text:p>\n<text:list text:style-name=\"L30\">\n  <text:list-item>\n    <text:p text:style-name=\"P60\">And in list\n    items.<text:note text:id=\"ftn4\" text:note-class=\"footnote\"><text:note-citation>5</text:note-citation><text:note-body><text:p text:style-name=\"Footnote\">In\n    list.</text:p></text:note-body></text:note></text:p>\n  </text:list-item>\n</text:list>\n<text:p text:style-name=\"First_20_paragraph\">This paragraph should not be part\nof the note, as it is not indented.</text:p>\n</office:text>\n</office:body>\n</office:document-content>\n"
  },
  {
    "path": "test/writer.opml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<opml version=\"2.0\">\n  <head>\n    <title>Pandoc Test Suite</title>\n    <dateModified>Mon, 17 Jul 2006 00:00:00 UTC</dateModified>\n    <ownerName>John MacFarlane; Anonymous</ownerName>\n  </head>\n  <body>\n<outline text=\"Headers\">\n  <outline text=\"Level 2 with an &lt;a href=&quot;/url&quot;&gt;embedded link&lt;/a&gt;\">\n    <outline text=\"Level 3 with &lt;em&gt;emphasis&lt;/em&gt;\">\n      <outline text=\"Level 4\">\n        <outline text=\"Level 5\">\n        </outline>\n      </outline>\n    </outline>\n  </outline>\n</outline>\n<outline text=\"Level 1\">\n  <outline text=\"Level 2 with &lt;em&gt;emphasis&lt;/em&gt;\">\n    <outline text=\"Level 3\" _note=\"with no blank line\">\n    </outline>\n  </outline>\n  <outline text=\"Level 2\" _note=\"with no blank line&#10;&#10;--------------------------------------------------------------------------------\">\n  </outline>\n</outline>\n<outline text=\"Paragraphs\" _note=\"Here's a regular paragraph.&#10;&#10;In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.&#10;Because a hard-wrapped line in the middle of a paragraph looked like a list&#10;item.&#10;&#10;Here's one with a bullet. \\* criminey.&#10;&#10;There should be a hard line break\\&#10;here.&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Block Quotes\" _note=\"E-mail style:&#10;&#10;&gt; This is a block quote. It is pretty short.&#10;&#10;&gt; Code in a block quote:&#10;&gt;&#10;&gt;     sub status {&#10;&gt;         print &quot;working&quot;;&#10;&gt;     }&#10;&gt;&#10;&gt; A list:&#10;&gt;&#10;&gt; 1.  item one&#10;&gt; 2.  item two&#10;&gt;&#10;&gt; Nested block quotes:&#10;&gt;&#10;&gt; &gt; nested&#10;&gt;&#10;&gt; &gt; nested&#10;&#10;This should not be a block quote: 2 \\&gt; 1.&#10;&#10;And a following paragraph.&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Code Blocks\" _note=\"Code:&#10;&#10;    ---- (should be four hyphens)&#10;&#10;    sub status {&#10;        print &quot;working&quot;;&#10;    }&#10;&#10;    this code block is indented by one tab&#10;&#10;And:&#10;&#10;        this code block is indented by two tabs&#10;&#10;    These should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Lists\">\n  <outline text=\"Unordered\" _note=\"Asterisks tight:&#10;&#10;- asterisk 1&#10;- asterisk 2&#10;- asterisk 3&#10;&#10;Asterisks loose:&#10;&#10;- asterisk 1&#10;&#10;- asterisk 2&#10;&#10;- asterisk 3&#10;&#10;Pluses tight:&#10;&#10;- Plus 1&#10;- Plus 2&#10;- Plus 3&#10;&#10;Pluses loose:&#10;&#10;- Plus 1&#10;&#10;- Plus 2&#10;&#10;- Plus 3&#10;&#10;Minuses tight:&#10;&#10;- Minus 1&#10;- Minus 2&#10;- Minus 3&#10;&#10;Minuses loose:&#10;&#10;- Minus 1&#10;&#10;- Minus 2&#10;&#10;- Minus 3\">\n  </outline>\n  <outline text=\"Ordered\" _note=\"Tight:&#10;&#10;1.  First&#10;2.  Second&#10;3.  Third&#10;&#10;and:&#10;&#10;1.  One&#10;2.  Two&#10;3.  Three&#10;&#10;Loose using tabs:&#10;&#10;1.  First&#10;&#10;2.  Second&#10;&#10;3.  Third&#10;&#10;and using spaces:&#10;&#10;1.  One&#10;&#10;2.  Two&#10;&#10;3.  Three&#10;&#10;Multiple paragraphs:&#10;&#10;1.  Item 1, graf one.&#10;&#10;    Item 1. graf two. The quick brown fox jumped over the lazy dog's back.&#10;&#10;2.  Item 2.&#10;&#10;3.  Item 3.\">\n  </outline>\n  <outline text=\"Nested\" _note=\"- Tab&#10;  - Tab&#10;    - Tab&#10;&#10;Here's another:&#10;&#10;1.  First&#10;2.  Second:&#10;    - Fee&#10;    - Fie&#10;    - Foe&#10;3.  Third&#10;&#10;Same thing but with paragraphs:&#10;&#10;1.  First&#10;&#10;2.  Second:&#10;&#10;    - Fee&#10;    - Fie&#10;    - Foe&#10;&#10;3.  Third\">\n  </outline>\n  <outline text=\"Tabs and spaces\" _note=\"- this is a list item indented with tabs&#10;&#10;- this is a list item indented with spaces&#10;&#10;  - this is an example list item indented with tabs&#10;&#10;  - this is an example list item indented with spaces\">\n  </outline>\n  <outline text=\"Fancy list markers\" _note=\"(2) begins with 2&#10;&#10;(3) and now 3&#10;&#10;    with a continuation&#10;&#10;    iv. sublist with roman numerals, starting with 4&#10;    v.  more items&#10;        (A) a subsublist&#10;        (B) a subsublist&#10;&#10;Nesting:&#10;&#10;A.  Upper Alpha&#10;    I.  Upper Roman.&#10;        (6) Decimal start with 6&#10;            c)  Lower alpha with paren&#10;&#10;Autonumbering:&#10;&#10;1.  Autonumber.&#10;2.  More.&#10;    1.  Nested.&#10;&#10;Should not be a list item:&#10;&#10;M.A. 2007&#10;&#10;B. Williams&#10;&#10;--------------------------------------------------------------------------------\">\n  </outline>\n</outline>\n<outline text=\"Definition Lists\" _note=\"Tight using spaces:&#10;&#10;apple&#10;:   red fruit&#10;&#10;orange&#10;:   orange fruit&#10;&#10;banana&#10;:   yellow fruit&#10;&#10;Tight using tabs:&#10;&#10;apple&#10;:   red fruit&#10;&#10;orange&#10;:   orange fruit&#10;&#10;banana&#10;:   yellow fruit&#10;&#10;Loose:&#10;&#10;apple&#10;&#10;:   red fruit&#10;&#10;orange&#10;&#10;:   orange fruit&#10;&#10;banana&#10;&#10;:   yellow fruit&#10;&#10;Multiple blocks with italics:&#10;&#10;*apple*&#10;&#10;:   red fruit&#10;&#10;    contains seeds, crisp, pleasant to taste&#10;&#10;*orange*&#10;&#10;:   orange fruit&#10;&#10;        { orange code block }&#10;&#10;    &gt; orange block quote&#10;&#10;Multiple definitions, tight:&#10;&#10;apple&#10;:   red fruit&#10;:   computer&#10;&#10;orange&#10;:   orange fruit&#10;:   bank&#10;&#10;Multiple definitions, loose:&#10;&#10;apple&#10;&#10;:   red fruit&#10;&#10;:   computer&#10;&#10;orange&#10;&#10;:   orange fruit&#10;&#10;:   bank&#10;&#10;Blank line after term, indented marker, alternate markers:&#10;&#10;apple&#10;&#10;:   red fruit&#10;&#10;:   computer&#10;&#10;orange&#10;&#10;:   orange fruit&#10;&#10;    1.  sublist&#10;    2.  sublist\">\n</outline>\n<outline text=\"HTML Blocks\" _note=\"Simple block on one line:&#10;&#10;::: {}&#10;foo&#10;:::&#10;&#10;And nested without indentation:&#10;&#10;:::::: {}&#10;:::: {}&#10;::: {}&#10;foo&#10;:::&#10;::::&#10;&#10;::: {}&#10;bar&#10;:::&#10;::::::&#10;&#10;Interpreted markdown in a table:&#10;&#10;&lt;table&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&#10;This is *emphasized*&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;And this is **strong**&#10;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&lt;script type=&quot;text/javascript&quot;&gt;document.write('This *should not* be interpreted as markdown');&lt;/script&gt;&#10;&#10;Here's a simple block:&#10;&#10;::: {}&#10;foo&#10;:::&#10;&#10;This should be a code block, though:&#10;&#10;    &lt;div&gt;&#10;        foo&#10;    &lt;/div&gt;&#10;&#10;As should this:&#10;&#10;    &lt;div&gt;foo&lt;/div&gt;&#10;&#10;Now, nested:&#10;&#10;::::: {}&#10;:::: {}&#10;::: {}&#10;foo&#10;:::&#10;::::&#10;:::::&#10;&#10;This should just be an HTML comment:&#10;&#10;&lt;!-- Comment --&gt;&#10;&#10;Multiline:&#10;&#10;&lt;!--&#10;Blah&#10;Blah&#10;--&gt;&#10;&lt;!--&#10;    This is another comment.&#10;--&gt;&#10;&#10;Code block:&#10;&#10;    &lt;!-- Comment --&gt;&#10;&#10;Just plain comment, with trailing spaces on the line:&#10;&#10;&lt;!-- foo --&gt;&#10;&#10;Code:&#10;&#10;    &lt;hr /&gt;&#10;&#10;Hr's:&#10;&#10;&lt;hr&gt;&#10;&lt;hr /&gt;&#10;&lt;hr /&gt;&#10;&lt;hr&gt;&#10;&lt;hr /&gt;&#10;&lt;hr /&gt;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;&gt;&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Inline Markup\" _note=\"This is *emphasized*, and so *is this*.&#10;&#10;This is **strong**, and so **is this**.&#10;&#10;An *[emphasized link](/url)*.&#10;&#10;***This is strong and em.***&#10;&#10;So is ***this*** word.&#10;&#10;***This is strong and em.***&#10;&#10;So is ***this*** word.&#10;&#10;This is code: `&gt;`, `$`, `\\`, `\\$`, `&lt;html&gt;`.&#10;&#10;~~This is *strikeout*.~~&#10;&#10;Superscripts: a^bc^d a^*hello*^ a^hello there^.&#10;&#10;Subscripts: H~2~O, H~23~O, H~many of them~O.&#10;&#10;These should not be superscripts or subscripts, because of the unescaped spaces:&#10;a\\^b c\\^d, a\\~b c\\~d.&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Smart quotes, ellipses, dashes\" _note=\"&quot;Hello,&quot; said the spider. &quot;'Shelob' is my name.&quot;&#10;&#10;'A', 'B', and 'C' are letters.&#10;&#10;'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'&#10;&#10;'He said, &quot;I want to go.&quot;' Were you alive in the 70's?&#10;&#10;Here is some quoted '`code`' and a &quot;[quoted&#10;link](http://example.com/?foo=1&amp;bar=2)&quot;.&#10;&#10;Some dashes: one---two --- three---four --- five.&#10;&#10;Dashes between numbers: 5--7, 255--66, 1987--1999.&#10;&#10;Ellipses...and...and....&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"LaTeX\" _note=\"- `\\cite[22-23]{smith.1899}`{=tex}&#10;- $2+2=4$&#10;- $x \\in y$&#10;- $\\alpha \\wedge \\omega$&#10;- $223$&#10;- $p$-Tree&#10;- Here's some display math:&#10;  $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$&#10;- Here's one that has a line break in it: $\\alpha + \\omega \\times x^2$.&#10;&#10;These shouldn't be math:&#10;&#10;- To get the famous equation, write `$e = mc^2$`.&#10;- \\$22,000 is a *lot* of money. So is \\$34,000. (It worked if &quot;lot&quot; is&#10;  emphasized.)&#10;- Shoes (\\$20) and socks (\\$5).&#10;- Escaped `$`: \\$73 *this should be emphasized* 23\\$.&#10;&#10;Here's a LaTeX table:&#10;&#10;\\begin{tabular}{|l|l|}\\hline&#10;Animal &amp; Number \\\\ \\hline&#10;Dog    &amp; 2      \\\\&#10;Cat    &amp; 1      \\\\ \\hline&#10;\\end{tabular}&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Special Characters\" _note=\"Here is some unicode:&#10;&#10;- I hat: Î&#10;- o umlaut: ö&#10;- section: §&#10;- set membership: ∈&#10;- copyright: ©&#10;&#10;AT&amp;T has an ampersand in their name.&#10;&#10;AT&amp;T is another way to write it.&#10;&#10;This &amp; that.&#10;&#10;4 \\&lt; 5.&#10;&#10;6 \\&gt; 5.&#10;&#10;Backslash: \\\\&#10;&#10;Backtick: \\`&#10;&#10;Asterisk: \\*&#10;&#10;Underscore: \\_&#10;&#10;Left brace: {&#10;&#10;Right brace: }&#10;&#10;Left bracket: \\[&#10;&#10;Right bracket: \\]&#10;&#10;Left paren: (&#10;&#10;Right paren: )&#10;&#10;Greater-than: \\&gt;&#10;&#10;Hash: \\#&#10;&#10;Period: .&#10;&#10;Bang: !&#10;&#10;Plus: +&#10;&#10;Minus: -&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Links\">\n  <outline text=\"Explicit\" _note=\"Just a [URL](/url/).&#10;&#10;[URL and title](/url/ &quot;title&quot;).&#10;&#10;[URL and title](/url/ &quot;title preceded by two spaces&quot;).&#10;&#10;[URL and title](/url/ &quot;title preceded by a tab&quot;).&#10;&#10;[URL and title](/url/ &quot;title with &quot;quotes&quot; in it&quot;)&#10;&#10;[URL and title](/url/ &quot;title with single quotes&quot;)&#10;&#10;[with_underscore](/url/with_underscore)&#10;&#10;[Email link](mailto:nobody@nowhere.net)&#10;&#10;[Empty]().\">\n  </outline>\n  <outline text=\"Reference\" _note=\"Foo [bar](/url/).&#10;&#10;With [embedded \\[brackets\\]](/url/).&#10;&#10;[b](/url/) by itself should be a link.&#10;&#10;Indented [once](/url).&#10;&#10;Indented [twice](/url).&#10;&#10;Indented [thrice](/url).&#10;&#10;This should \\[not\\]\\[\\] be a link.&#10;&#10;    [not]: /url&#10;&#10;Foo [bar](/url/ &quot;Title with &quot;quotes&quot; inside&quot;).&#10;&#10;Foo [biz](/url/ &quot;Title with &quot;quote&quot; inside&quot;).\">\n  </outline>\n  <outline text=\"With ampersands\" _note=\"Here's a [link with an ampersand in the URL](http://example.com/?foo=1&amp;bar=2).&#10;&#10;Here's a link with an amersand in the link text: [AT&amp;T](http://att.com/ &quot;AT&amp;T&quot;).&#10;&#10;Here's an [inline link](/script?foo=1&amp;bar=2).&#10;&#10;Here's an [inline link in pointy braces](/script?foo=1&amp;bar=2).\">\n  </outline>\n  <outline text=\"Autolinks\" _note=\"With an ampersand: &lt;http://example.com/?foo=1&amp;bar=2&gt;&#10;&#10;- In a list?&#10;- &lt;http://example.com/&gt;&#10;- It should.&#10;&#10;An e-mail address: &lt;nobody@nowhere.net&gt;&#10;&#10;&gt; Blockquoted: &lt;http://example.com/&gt;&#10;&#10;Auto-links should not occur here: `&lt;http://example.com/&gt;`&#10;&#10;    or here: &lt;http://example.com/&gt;&#10;&#10;--------------------------------------------------------------------------------\">\n  </outline>\n</outline>\n<outline text=\"Images\" _note=\"From &quot;Voyage dans la Lune&quot; by Georges Melies (1902):&#10;&#10;![lalune](lalune.jpg &quot;Voyage dans la Lune&quot;)&#10;&#10;Here is a movie ![movie](movie.jpg) icon.&#10;&#10;--------------------------------------------------------------------------------\">\n</outline>\n<outline text=\"Footnotes\" _note=\"Here is a footnote reference,[^1] and another.[^2] This should *not* be a&#10;footnote reference, because it contains a space.\\[\\^my note\\] Here is an inline&#10;note.[^3]&#10;&#10;&gt; Notes can go in quotes.[^4]&#10;&#10;1.  And in list items.[^5]&#10;&#10;This paragraph should not be part of the note, as it is not indented.&#10;&#10;[^1]: Here is the footnote. It can go anywhere after the footnote reference. It&#10;    need not be placed at the end of the document.&#10;&#10;[^2]: Here's the long note. This one contains multiple blocks.&#10;&#10;    Subsequent blocks are indented to show that they belong to the footnote (as&#10;    with list items).&#10;&#10;          { &lt;code&gt; }&#10;&#10;    If you want, you can indent every line, but you can also be lazy and just&#10;    indent the first line of each block.&#10;&#10;[^3]: This is *easier* to type. Inline notes may contain&#10;    [links](http://google.com) and `]` verbatim characters, as well as&#10;    \\[bracketed text\\].&#10;&#10;[^4]: In quote.&#10;&#10;[^5]: In list.\">\n</outline>\n  </body>\n</opml>\n"
  },
  {
    "path": "test/writer.org",
    "content": "#+title: Pandoc Test Suite\n\n#+author: John MacFarlane; Anonymous\n#+date: July 17, 2006\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n--------------\n\n* Headers\n:PROPERTIES:\n:CUSTOM_ID: headers\n:END:\n** Level 2 with an [[/url][embedded link]]\n:PROPERTIES:\n:CUSTOM_ID: level-2-with-an-embedded-link\n:END:\n*** Level 3 with /emphasis/\n:PROPERTIES:\n:CUSTOM_ID: level-3-with-emphasis\n:END:\n**** Level 4\n:PROPERTIES:\n:CUSTOM_ID: level-4\n:END:\n***** Level 5\n:PROPERTIES:\n:CUSTOM_ID: level-5\n:END:\n* Level 1\n:PROPERTIES:\n:CUSTOM_ID: level-1\n:END:\n** Level 2 with /emphasis/\n:PROPERTIES:\n:CUSTOM_ID: level-2-with-emphasis\n:END:\n*** Level 3\n:PROPERTIES:\n:CUSTOM_ID: level-3\n:END:\nwith no blank line\n\n** Level 2\n:PROPERTIES:\n:CUSTOM_ID: level-2\n:END:\nwith no blank line\n\n--------------\n\n* Paragraphs\n:PROPERTIES:\n:CUSTOM_ID: paragraphs\n:END:\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break\\\\\nhere.\n\n--------------\n\n* Block Quotes\n:PROPERTIES:\n:CUSTOM_ID: block-quotes\n:END:\nE-mail style:\n\n#+begin_quote\nThis is a block quote. It is pretty short.\n#+end_quote\n\n#+begin_quote\nCode in a block quote:\n\n#+begin_example\nsub status {\n    print \"working\";\n}\n#+end_example\n\nA list:\n\n1. item one\n2. item two\n\nNested block quotes:\n\n#+begin_quote\nnested\n#+end_quote\n\n#+begin_quote\nnested\n#+end_quote\n#+end_quote\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n--------------\n\n* Code Blocks\n:PROPERTIES:\n:CUSTOM_ID: code-blocks\n:END:\nCode:\n\n#+begin_example\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n#+end_example\n\nAnd:\n\n#+begin_example\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n#+end_example\n\n--------------\n\n* Lists\n:PROPERTIES:\n:CUSTOM_ID: lists\n:END:\n** Unordered\n:PROPERTIES:\n:CUSTOM_ID: unordered\n:END:\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\n** Ordered\n:PROPERTIES:\n:CUSTOM_ID: ordered\n:END:\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n\n2. Second\n\n3. Third\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\n   Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n2. Item 2.\n\n3. Item 3.\n\n** Nested\n:PROPERTIES:\n:CUSTOM_ID: nested\n:END:\n- Tab\n  - Tab\n    - Tab\n\nHere's another:\n\n1. First\n2. Second:\n   - Fee\n   - Fie\n   - Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n\n3. Third\n\n** Tabs and spaces\n:PROPERTIES:\n:CUSTOM_ID: tabs-and-spaces\n:END:\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\n** Fancy list markers\n:PROPERTIES:\n:CUSTOM_ID: fancy-list-markers\n:END:\n2) [@2] begins with 2\n\n3) and now 3\n\n   with a continuation\n\n   4. [@4] sublist with roman numerals, starting with 4\n   5. more items\n      1) a subsublist\n      2) a subsublist\n\nNesting:\n\n1. Upper Alpha\n   1. Upper Roman.\n      6) [@6] Decimal start with 6\n         3) [@3] Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n2. More.\n   1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n--------------\n\n* Definition Lists\n:PROPERTIES:\n:CUSTOM_ID: definition-lists\n:END:\nTight using spaces:\n\n- apple :: red fruit\n- orange :: orange fruit\n- banana :: yellow fruit\n\nTight using tabs:\n\n- apple :: red fruit\n- orange :: orange fruit\n- banana :: yellow fruit\n\nLoose:\n\n- apple :: red fruit\n\n- orange :: orange fruit\n\n- banana :: yellow fruit\n\nMultiple blocks with italics:\n\n- /apple/ :: red fruit\n\n  contains seeds, crisp, pleasant to taste\n\n- /orange/ :: orange fruit\n\n  #+begin_example\n  { orange code block }\n  #+end_example\n\n  #+begin_quote\n  orange block quote\n  #+end_quote\n\nMultiple definitions, tight:\n\n- apple :: red fruit\n  computer\n- orange :: orange fruit\n  bank\n\nMultiple definitions, loose:\n\n- apple :: red fruit\n\n  computer\n\n- orange :: orange fruit\n\n  bank\n\nBlank line after term, indented marker, alternate markers:\n\n- apple :: red fruit\n\n  computer\n\n- orange :: orange fruit\n\n  1. sublist\n  2. sublist\n\n* HTML Blocks\n:PROPERTIES:\n:CUSTOM_ID: html-blocks\n:END:\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\n#+begin_html\n  <table>\n#+end_html\n\n#+begin_html\n  <tr>\n#+end_html\n\n#+begin_html\n  <td>\n#+end_html\n\nThis is /emphasized/\n\n#+begin_html\n  </td>\n#+end_html\n\n#+begin_html\n  <td>\n#+end_html\n\nAnd this is *strong*\n\n#+begin_html\n  </td>\n#+end_html\n\n#+begin_html\n  </tr>\n#+end_html\n\n#+begin_html\n  </table>\n#+end_html\n\n#+begin_html\n  <script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n#+end_html\n\nHere's a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n#+begin_example\n<div>\n    foo\n</div>\n#+end_example\n\nAs should this:\n\n#+begin_example\n<div>foo</div>\n#+end_example\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\n#+begin_html\n  <!-- Comment -->\n#+end_html\n\nMultiline:\n\n#+begin_html\n  <!--\n  Blah\n  Blah\n  -->\n#+end_html\n\n#+begin_html\n  <!--\n      This is another comment.\n  -->\n#+end_html\n\nCode block:\n\n#+begin_example\n<!-- Comment -->\n#+end_example\n\nJust plain comment, with trailing spaces on the line:\n\n#+begin_html\n  <!-- foo -->\n#+end_html\n\nCode:\n\n#+begin_example\n<hr />\n#+end_example\n\nHr's:\n\n#+begin_html\n  <hr>\n#+end_html\n\n#+begin_html\n  <hr />\n#+end_html\n\n#+begin_html\n  <hr />\n#+end_html\n\n#+begin_html\n  <hr>\n#+end_html\n\n#+begin_html\n  <hr />\n#+end_html\n\n#+begin_html\n  <hr />\n#+end_html\n\n#+begin_html\n  <hr class=\"foo\" id=\"bar\" />\n#+end_html\n\n#+begin_html\n  <hr class=\"foo\" id=\"bar\" />\n#+end_html\n\n#+begin_html\n  <hr class=\"foo\" id=\"bar\">\n#+end_html\n\n--------------\n\n* Inline Markup\n:PROPERTIES:\n:CUSTOM_ID: inline-markup\n:END:\nThis is /emphasized/, and so /is this/.\n\nThis is *strong*, and so *is this*.\n\nAn /[[/url][emphasized link]]/.\n\n*/This is strong and em./*\n\nSo is */this/* word.\n\n*/This is strong and em./*\n\nSo is */this/* word.\n\nThis is code: =>=, =$=, =\\=, =\\$=, =<html>=.\n\n+This is /strikeout/.+\n\nSuperscripts: a^{bc}d a^{/hello/} a^{hello there}.\n\nSubscripts: H_{2}O, H_{23}O, H_{many of them}O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n--------------\n\n* Smart quotes, ellipses, dashes\n:PROPERTIES:\n:CUSTOM_ID: smart-quotes-ellipses-dashes\n:END:\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70's?\n\nHere is some quoted ‘=code=’ and a\n“[[http://example.com/?foo=1&bar=2][quoted link]]”.\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses...and...and....\n\n--------------\n\n* LaTeX\n:PROPERTIES:\n:CUSTOM_ID: latex\n:END:\n- \\cite[22-23]{smith.1899}\n- \\(2+2=4\\)\n- \\(x \\in y\\)\n- \\(\\alpha \\wedge \\omega\\)\n- \\(223\\)\n- \\(p\\)-Tree\n- Here's some display math:\n  \\[\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\\]\n- Here's one that has a line break in it: \\(\\alpha + \\omega \\times x^2\\).\n\nThese shouldn't be math:\n\n- To get the famous equation, write =$e = mc^2$=.\n- $22,000 is a /lot/ of money. So is $34,000. (It worked if “lot” is\n  emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped =$=: $73 /this should be emphasized/ 23$.\n\nHere's a LaTeX table:\n\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n\n--------------\n\n* Special Characters\n:PROPERTIES:\n:CUSTOM_ID: special-characters\n:END:\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n--------------\n\n* Links\n:PROPERTIES:\n:CUSTOM_ID: links\n:END:\n** Explicit\n:PROPERTIES:\n:CUSTOM_ID: explicit\n:END:\nJust a [[/url/][URL]].\n\n[[/url/][URL and title]].\n\n[[/url/][URL and title]].\n\n[[/url/][URL and title]].\n\n[[/url/][URL and title]]\n\n[[/url/][URL and title]]\n\n[[/url/with_underscore][with_underscore]]\n\n[[mailto:nobody@nowhere.net][Email link]]\n\n[[][Empty]].\n\n** Reference\n:PROPERTIES:\n:CUSTOM_ID: reference\n:END:\nFoo [[/url/][bar]].\n\nWith [[/url/][embedded [brackets]]].\n\n[[/url/][b]] by itself should be a link.\n\nIndented [[/url][once]].\n\nIndented [[/url][twice]].\n\nIndented [[/url][thrice]].\n\nThis should [not][] be a link.\n\n#+begin_example\n[not]: /url\n#+end_example\n\nFoo [[/url/][bar]].\n\nFoo [[/url/][biz]].\n\n** With ampersands\n:PROPERTIES:\n:CUSTOM_ID: with-ampersands\n:END:\nHere's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the URL]].\n\nHere's a link with an amersand in the link text: [[http://att.com/][AT&T]].\n\nHere's an [[/script?foo=1&bar=2][inline link]].\n\nHere's an [[/script?foo=1&bar=2][inline link in pointy braces]].\n\n** Autolinks\n:PROPERTIES:\n:CUSTOM_ID: autolinks\n:END:\nWith an ampersand: [[http://example.com/?foo=1&bar=2]]\n\n- In a list?\n- [[http://example.com/]]\n- It should.\n\nAn e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]\n\n#+begin_quote\nBlockquoted: [[http://example.com/]]\n#+end_quote\n\nAuto-links should not occur here: =<http://example.com/>=\n\n#+begin_example\nor here: <http://example.com/>\n#+end_example\n\n--------------\n\n* Images\n:PROPERTIES:\n:CUSTOM_ID: images\n:END:\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n#+caption: lalune\n[[file:lalune.jpg]]\n\nHere is a movie [[file:movie.jpg]] icon.\n\n--------------\n\n* Footnotes\n:PROPERTIES:\n:CUSTOM_ID: footnotes\n:END:\nHere is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a\nfootnote reference, because it contains a space.[^my note] Here is an inline\nnote.[fn:3]\n\n#+begin_quote\nNotes can go in quotes.[fn:4]\n#+end_quote\n\n1. And in list items.[fn:5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[fn:1] Here is the footnote. It can go anywhere after the footnote reference. It\n       need not be placed at the end of the document.\n\n[fn:2] Here's the long note. This one contains multiple blocks.\n\n       Subsequent blocks are indented to show that they belong to the footnote\n       (as with list items).\n\n       #+begin_example\n         { <code> }\n       #+end_example\n\n       If you want, you can indent every line, but you can also be lazy and just\n       indent the first line of each block.\n\n[fn:3] This is /easier/ to type. Inline notes may contain\n       [[http://google.com][links]] and =]= verbatim characters, as well as\n       [bracketed text].\n\n[fn:4] In quote.\n\n[fn:5] In list.\n"
  },
  {
    "path": "test/writer.plain",
    "content": "Pandoc Test Suite\nJohn MacFarlane; Anonymous\nJuly 17, 2006\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n--------------------------------------------------------------------------------\n\nHeaders\n\nLevel 2 with an embedded link\n\nLevel 3 with emphasis\n\nLevel 4\n\nLevel 5\n\nLevel 1\n\nLevel 2 with emphasis\n\nLevel 3\n\nwith no blank line\n\nLevel 2\n\nwith no blank line\n\n--------------------------------------------------------------------------------\n\nParagraphs\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n--------------------------------------------------------------------------------\n\nBlock Quotes\n\nE-mail style:\n\n  This is a block quote. It is pretty short.\n\n  Code in a block quote:\n\n      sub status {\n          print \"working\";\n      }\n\n  A list:\n\n  1.  item one\n  2.  item two\n\n  Nested block quotes:\n\n    nested\n\n    nested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n--------------------------------------------------------------------------------\n\nCode Blocks\n\nCode:\n\n    ---- (should be four hyphens)\n\n    sub status {\n        print \"working\";\n    }\n\n    this code block is indented by one tab\n\nAnd:\n\n        this code block is indented by two tabs\n\n    These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\n--------------------------------------------------------------------------------\n\nLists\n\nUnordered\n\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\nOrdered\n\nTight:\n\n1.  First\n2.  Second\n3.  Third\n\nand:\n\n1.  One\n2.  Two\n3.  Three\n\nLoose using tabs:\n\n1.  First\n\n2.  Second\n\n3.  Third\n\nand using spaces:\n\n1.  One\n\n2.  Two\n\n3.  Three\n\nMultiple paragraphs:\n\n1.  Item 1, graf one.\n\n    Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n\n2.  Item 2.\n\n3.  Item 3.\n\nNested\n\n- Tab\n  - Tab\n    - Tab\n\nHere’s another:\n\n1.  First\n2.  Second:\n    - Fee\n    - Fie\n    - Foe\n3.  Third\n\nSame thing but with paragraphs:\n\n1.  First\n\n2.  Second:\n\n    - Fee\n    - Fie\n    - Foe\n\n3.  Third\n\nTabs and spaces\n\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\nFancy list markers\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v.  more items\n        (A) a subsublist\n        (B) a subsublist\n\nNesting:\n\nA.  Upper Alpha\n    I.  Upper Roman.\n        (6) Decimal start with 6\n            c)  Lower alpha with paren\n\nAutonumbering:\n\n1.  Autonumber.\n2.  More.\n    1.  Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n--------------------------------------------------------------------------------\n\nDefinition Lists\n\nTight using spaces:\n\napple\n    red fruit\n\norange\n    orange fruit\n\nbanana\n    yellow fruit\n\nTight using tabs:\n\napple\n    red fruit\n\norange\n    orange fruit\n\nbanana\n    yellow fruit\n\nLoose:\n\napple\n\n    red fruit\n\norange\n\n    orange fruit\n\nbanana\n\n    yellow fruit\n\nMultiple blocks with italics:\n\napple\n\n    red fruit\n\n    contains seeds, crisp, pleasant to taste\n\norange\n\n    orange fruit\n\n        { orange code block }\n\n      orange block quote\n\nMultiple definitions, tight:\n\napple\n    red fruit\n    computer\n\norange\n    orange fruit\n    bank\n\nMultiple definitions, loose:\n\napple\n\n    red fruit\n\n    computer\n\norange\n\n    orange fruit\n\n    bank\n\nBlank line after term, indented marker, alternate markers:\n\napple\n\n    red fruit\n\n    computer\n\norange\n\n    orange fruit\n\n    1.  sublist\n    2.  sublist\n\nHTML Blocks\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\nbar\n\nInterpreted markdown in a table:\n\nThis is emphasized\nAnd this is strong\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n    <div>\n        foo\n    </div>\n\nAs should this:\n\n    <div>foo</div>\n\nNow, nested:\n\nfoo\n\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n    <!-- Comment -->\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n    <hr />\n\nHr’s:\n\n--------------------------------------------------------------------------------\n\nInline Markup\n\nThis is emphasized, and so is this.\n\nThis is strong, and so is this.\n\nAn emphasized link.\n\nThis is strong and em.\n\nSo is this word.\n\nThis is strong and em.\n\nSo is this word.\n\nThis is code: >, $, \\, \\$, <html>.\n\n~~This is strikeout.~~\n\nSuperscripts: a^(bc)d a^(hello) a^(hello there).\n\nSubscripts: H₂O, H₂₃O, H_(many of them)O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n--------------------------------------------------------------------------------\n\nSmart quotes, ellipses, dashes\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘code’ and a “quoted link”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n--------------------------------------------------------------------------------\n\nLaTeX\n\n- \n- 2 + 2 = 4\n- x ∈ y\n- α ∧ ω\n- 223\n- p-Tree\n- Here’s some display math:\n  $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n- Here’s one that has a line break in it: α + ω × x².\n\nThese shouldn’t be math:\n\n- To get the famous equation, write $e = mc^2$.\n- $22,000 is a lot of money. So is $34,000. (It worked if “lot” is emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped $: $73 this should be emphasized 23$.\n\nHere’s a LaTeX table:\n\n--------------------------------------------------------------------------------\n\nSpecial Characters\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n--------------------------------------------------------------------------------\n\nLinks\n\nExplicit\n\nJust a URL.\n\nURL and title.\n\nURL and title.\n\nURL and title.\n\nURL and title\n\nURL and title\n\nwith_underscore\n\nEmail link\n\nEmpty.\n\nReference\n\nFoo bar.\n\nWith embedded [brackets].\n\nb by itself should be a link.\n\nIndented once.\n\nIndented twice.\n\nIndented thrice.\n\nThis should [not][] be a link.\n\n    [not]: /url\n\nFoo bar.\n\nFoo biz.\n\nWith ampersands\n\nHere’s a link with an ampersand in the URL.\n\nHere’s a link with an amersand in the link text: AT&T.\n\nHere’s an inline link.\n\nHere’s an inline link in pointy braces.\n\nAutolinks\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n- In a list?\n- http://example.com/\n- It should.\n\nAn e-mail address: nobody@nowhere.net\n\n  Blockquoted: http://example.com/\n\nAuto-links should not occur here: <http://example.com/>\n\n    or here: <http://example.com/>\n\n--------------------------------------------------------------------------------\n\nImages\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n[lalune]\n\nHere is a movie [movie] icon.\n\n--------------------------------------------------------------------------------\n\nFootnotes\n\nHere is a footnote reference,[1] and another.[2] This should not be a footnote\nreference, because it contains a space.[^my note] Here is an inline note.[3]\n\n  Notes can go in quotes.[4]\n\n1.  And in list items.[5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n[1] Here is the footnote. It can go anywhere after the footnote reference. It\nneed not be placed at the end of the document.\n\n[2] Here’s the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with\nlist items).\n\n      { <code> }\n\nIf you want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.\n\n[3] This is easier to type. Inline notes may contain links and ] verbatim\ncharacters, as well as [bracketed text].\n\n[4] In quote.\n\n[5] In list.\n"
  },
  {
    "path": "test/writer.rst",
    "content": "=================\nPandoc Test Suite\n=================\n\n:Author: John MacFarlane\n:Author: Anonymous\n:Date: July 17, 2006\n\n.. role:: raw-latex(raw)\n   :format: latex\n..\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber’s\nmarkdown test suite.\n\n--------------\n\nHeaders\n=======\n\nLevel 2 with an `embedded link </url>`__\n----------------------------------------\n\nLevel 3 with *emphasis*\n~~~~~~~~~~~~~~~~~~~~~~~\n\nLevel 4\n^^^^^^^\n\nLevel 5\n'''''''\n\nLevel 1\n=======\n\nLevel 2 with *emphasis*\n-----------------------\n\nLevel 3\n~~~~~~~\n\nwith no blank line\n\nLevel 2\n-------\n\nwith no blank line\n\n--------------\n\nParagraphs\n==========\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere’s one with a bullet. \\* criminey.\n\n| There should be a hard line break\n| here.\n\n--------------\n\nBlock Quotes\n============\n\nE-mail style:\n\n   This is a block quote. It is pretty short.\n\n..\n\n   Code in a block quote:\n\n   ::\n\n      sub status {\n          print \"working\";\n      }\n\n   A list:\n\n   1. item one\n   2. item two\n\n   Nested block quotes:\n\n      nested\n\n   ..\n\n      nested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n--------------\n\nCode Blocks\n===========\n\nCode:\n\n::\n\n   ---- (should be four hyphens)\n\n   sub status {\n       print \"working\";\n   }\n\n   this code block is indented by one tab\n\nAnd:\n\n::\n\n       this code block is indented by two tabs\n\n   These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n\n--------------\n\nLists\n=====\n\nUnordered\n---------\n\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\nOrdered\n-------\n\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n\n2. Second\n\n3. Third\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\n   Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n\n2. Item 2.\n\n3. Item 3.\n\nNested\n------\n\n- Tab\n\n  - Tab\n\n    - Tab\n\nHere’s another:\n\n1. First\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n\n3. Third\n\nTabs and spaces\n---------------\n\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\nFancy list markers\n------------------\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v.  more items\n\n        (A) a subsublist\n        (B) a subsublist\n\nNesting:\n\nA. Upper Alpha\n\n   I. Upper Roman.\n\n      (6) Decimal start with 6\n\n          c) Lower alpha with paren\n\nAutonumbering:\n\n#. Autonumber.\n#. More.\n\n   #. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n--------------\n\nDefinition Lists\n================\n\nTight using spaces:\n\napple\n   red fruit\norange\n   orange fruit\nbanana\n   yellow fruit\n\nTight using tabs:\n\napple\n   red fruit\norange\n   orange fruit\nbanana\n   yellow fruit\n\nLoose:\n\napple\n   red fruit\n\norange\n   orange fruit\n\nbanana\n   yellow fruit\n\nMultiple blocks with italics:\n\n*apple*\n   red fruit\n\n   contains seeds, crisp, pleasant to taste\n\n*orange*\n   orange fruit\n\n   ::\n\n      { orange code block }\n\n   ..\n\n      orange block quote\n\nMultiple definitions, tight:\n\napple\n   red fruit\n   computer\norange\n   orange fruit\n   bank\n\nMultiple definitions, loose:\n\napple\n   red fruit\n\n   computer\n\norange\n   orange fruit\n\n   bank\n\nBlank line after term, indented marker, alternate markers:\n\napple\n   red fruit\n\n   computer\n\norange\n   orange fruit\n\n   1. sublist\n   2. sublist\n\nHTML Blocks\n===========\n\nSimple block on one line:\n\n.. container::\n\n   foo\n\nAnd nested without indentation:\n\n.. container::\n\n   .. container::\n\n      .. container::\n\n         foo\n\n   .. container::\n\n      bar\n\nInterpreted markdown in a table:\n\n.. raw:: html\n\n   <table>\n\n.. raw:: html\n\n   <tr>\n\n.. raw:: html\n\n   <td>\n\nThis is *emphasized*\n\n.. raw:: html\n\n   </td>\n\n.. raw:: html\n\n   <td>\n\nAnd this is **strong**\n\n.. raw:: html\n\n   </td>\n\n.. raw:: html\n\n   </tr>\n\n.. raw:: html\n\n   </table>\n\n.. raw:: html\n\n   <script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n\nHere’s a simple block:\n\n.. container::\n\n   foo\n\nThis should be a code block, though:\n\n::\n\n   <div>\n       foo\n   </div>\n\nAs should this:\n\n::\n\n   <div>foo</div>\n\nNow, nested:\n\n.. container::\n\n   .. container::\n\n      .. container::\n\n         foo\n\nThis should just be an HTML comment:\n\n.. raw:: html\n\n   <!-- Comment -->\n\nMultiline:\n\n.. raw:: html\n\n   <!--\n   Blah\n   Blah\n   -->\n\n.. raw:: html\n\n   <!--\n       This is another comment.\n   -->\n\nCode block:\n\n::\n\n   <!-- Comment -->\n\nJust plain comment, with trailing spaces on the line:\n\n.. raw:: html\n\n   <!-- foo -->\n\nCode:\n\n::\n\n   <hr />\n\nHr’s:\n\n.. raw:: html\n\n   <hr>\n\n.. raw:: html\n\n   <hr />\n\n.. raw:: html\n\n   <hr />\n\n.. raw:: html\n\n   <hr>\n\n.. raw:: html\n\n   <hr />\n\n.. raw:: html\n\n   <hr />\n\n.. raw:: html\n\n   <hr class=\"foo\" id=\"bar\" />\n\n.. raw:: html\n\n   <hr class=\"foo\" id=\"bar\" />\n\n.. raw:: html\n\n   <hr class=\"foo\" id=\"bar\">\n\n--------------\n\nInline Markup\n=============\n\nThis is *emphasized*, and so *is this*.\n\nThis is **strong**, and so **is this**.\n\nAn `emphasized link </url>`__.\n\n**This is strong and em.**\n\nSo is **this** word.\n\n**This is strong and em.**\n\nSo is **this** word.\n\nThis is code: ``>``, ``$``, ``\\``, ``\\$``, ``<html>``.\n\n[STRIKEOUT:This is strikeout.]\n\nSuperscripts: a\\ :sup:`bc`\\ d a\\ :sup:`hello` a\\ :sup:`hello there`.\n\nSubscripts: H\\ :sub:`2`\\ O, H\\ :sub:`23`\\ O, H\\ :sub:`many of them`\\ O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n--------------\n\nSmart quotes, ellipses, dashes\n==============================\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘``code``’ and a “`quoted\nlink <http://example.com/?foo=1&bar=2>`__”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n--------------\n\nLaTeX\n=====\n\n- :raw-latex:`\\cite[22-23]{smith.1899}`\n- :math:`2+2=4`\n- :math:`x \\in y`\n- :math:`\\alpha \\wedge \\omega`\n- :math:`223`\n- :math:`p`-Tree\n- Here’s some display math:\n\n  .. math:: \\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}\n- Here’s one that has a line break in it: :math:`\\alpha + \\omega \\times x^2`.\n\nThese shouldn’t be math:\n\n- To get the famous equation, write ``$e = mc^2$``.\n- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is\n  emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped ``$``: $73 *this should be emphasized* 23$.\n\nHere’s a LaTeX table:\n\n.. raw:: latex\n\n   \\begin{tabular}{|l|l|}\\hline\n   Animal & Number \\\\ \\hline\n   Dog    & 2      \\\\\n   Cat    & 1      \\\\ \\hline\n   \\end{tabular}\n\n--------------\n\nSpecial Characters\n==================\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n--------------\n\nLinks\n=====\n\nExplicit\n--------\n\nJust a `URL </url/>`__.\n\n`URL and title </url/>`__.\n\n`URL and title </url/>`__.\n\n`URL and title </url/>`__.\n\n`URL and title </url/>`__\n\n`URL and title </url/>`__\n\n`with_underscore </url/with_underscore>`__\n\n`Email link <mailto:nobody@nowhere.net>`__\n\n`Empty <>`__.\n\nReference\n---------\n\nFoo `bar </url/>`__.\n\nWith `embedded [brackets] </url/>`__.\n\n`b </url/>`__ by itself should be a link.\n\nIndented `once </url>`__.\n\nIndented `twice </url>`__.\n\nIndented `thrice </url>`__.\n\nThis should [not][] be a link.\n\n::\n\n   [not]: /url\n\nFoo `bar </url/>`__.\n\nFoo `biz </url/>`__.\n\nWith ampersands\n---------------\n\nHere’s a `link with an ampersand in the\nURL <http://example.com/?foo=1&bar=2>`__.\n\nHere’s a link with an amersand in the link text: `AT&T <http://att.com/>`__.\n\nHere’s an `inline link </script?foo=1&bar=2>`__.\n\nHere’s an `inline link in pointy braces </script?foo=1&bar=2>`__.\n\nAutolinks\n---------\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n- In a list?\n- http://example.com/\n- It should.\n\nAn e-mail address: nobody@nowhere.net\n\n   Blockquoted: http://example.com/\n\nAuto-links should not occur here: ``<http://example.com/>``\n\n::\n\n   or here: <http://example.com/>\n\n--------------\n\nImages\n======\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n.. figure:: lalune.jpg\n   :alt: lalune\n\n   lalune\n\nHere is a movie |movie| icon.\n\n--------------\n\nFootnotes\n=========\n\nHere is a footnote reference, [1]_ and another. [2]_ This should *not* be a\nfootnote reference, because it contains a space.[^my note] Here is an inline\nnote. [3]_\n\n   Notes can go in quotes. [4]_\n\n1. And in list items. [5]_\n\nThis paragraph should not be part of the note, as it is not indented.\n\n.. [1]\n   Here is the footnote. It can go anywhere after the footnote reference. It\n   need not be placed at the end of the document.\n\n.. [2]\n   Here’s the long note. This one contains multiple blocks.\n\n   Subsequent blocks are indented to show that they belong to the footnote (as\n   with list items).\n\n   ::\n\n        { <code> }\n\n   If you want, you can indent every line, but you can also be lazy and just\n   indent the first line of each block.\n\n.. [3]\n   This is *easier* to type. Inline notes may contain\n   `links <http://google.com>`__ and ``]`` verbatim characters, as well as\n   [bracketed text].\n\n.. [4]\n   In quote.\n\n.. [5]\n   In list.\n\n.. |movie| image:: movie.jpg\n"
  },
  {
    "path": "test/writer.rtf",
    "content": "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 \\fmodern Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\b \\fs36 Pandoc Test Suite\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  John MacFarlane\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  Anonymous\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  July 17, 2006\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This is a set of tests for pandoc. Most of them are adapted from John Gruber\\u8217's markdown test suite.\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Headers\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Level 2 with an {\\field{\\*\\fldinst{HYPERLINK \"/url\"}}{\\fldrslt{\\ul\nembedded link\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel2 \\b \\fs28 Level 3 with {\\i emphasis}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel3 \\b \\fs24 Level 4\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel4 \\b \\fs20 Level 5\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Level 1\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Level 2 with {\\i emphasis}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel2 \\b \\fs28 Level 3\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 with no blank line\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Level 2\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 with no blank line\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Paragraphs\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's a regular paragraph.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's one with a bullet. * criminey.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 There should be a hard line break\\line here.\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Block Quotes\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 E-mail style:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 This is a block quote. It is pretty short.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 Code in a block quote:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 \\f1 sub status \\{\\line\n    print \"working\";\\line\n\\}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 A list:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1080 \\fi-360 1.\\tx360\\tab item one\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1080 \\fi-360 2.\\tx360\\tab item two\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 Nested block quotes:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li1440 \\fi0 nested\\par}\n{\\pard \\ql \\f0 \\sa180 \\li1440 \\fi0 nested\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This should not be a block quote: 2 > 1.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 And a following paragraph.\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Code Blocks\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Code:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 ---- (should be four hyphens)\\line\n\\line\nsub status \\{\\line\n    print \"working\";\\line\n\\}\\line\n\\line\nthis code block is indented by one tab\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 And:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1     this code block is indented by two tabs\\line\n\\line\nThese should not be escaped:  \\\\$ \\\\\\\\ \\\\> \\\\[ \\\\\\{\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Lists\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Unordered\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Asterisks tight:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab asterisk 1\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab asterisk 2\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab asterisk 3\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Asterisks loose:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab asterisk 1\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab asterisk 2\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab asterisk 3\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Pluses tight:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Plus 1\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Plus 2\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Plus 3\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Pluses loose:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab Plus 1\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab Plus 2\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab Plus 3\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Minuses tight:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Minus 1\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Minus 2\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Minus 3\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Minuses loose:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab Minus 1\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab Minus 2\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab Minus 3\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Ordered\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Tight:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 1.\\tx360\\tab First\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 2.\\tx360\\tab Second\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 3.\\tx360\\tab Third\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 and:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 1.\\tx360\\tab One\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 2.\\tx360\\tab Two\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 3.\\tx360\\tab Three\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Loose using tabs:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 1.\\tx360\\tab First\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 2.\\tx360\\tab Second\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 3.\\tx360\\tab Third\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 and using spaces:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 1.\\tx360\\tab One\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 2.\\tx360\\tab Two\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 3.\\tx360\\tab Three\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiple paragraphs:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 1.\\tx360\\tab Item 1, graf one.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 Item 1. graf two. The quick brown fox jumped over the lazy dog\\u8217's back.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 2.\\tx360\\tab Item 2.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 3.\\tx360\\tab Item 3.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Nested\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Tab\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Tab\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1080 \\fi-360 \\bullet \\tx360\\tab Tab\\sa180\\sa180\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's another:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 1.\\tx360\\tab First\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 2.\\tx360\\tab Second:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Fee\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Fie\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Foe\\sa180\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 3.\\tx360\\tab Third\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Same thing but with paragraphs:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 1.\\tx360\\tab First\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 2.\\tx360\\tab Second:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Fee\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Fie\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 \\endash \\tx360\\tab Foe\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 3.\\tx360\\tab Third\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Tabs and spaces\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab this is a list item indented with tabs\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 \\bullet \\tx360\\tab this is a list item indented with spaces\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi-360 \\endash \\tx360\\tab this is an example list item indented with tabs\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi-360 \\endash \\tx360\\tab this is an example list item indented with spaces\\sa180\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Fancy list markers\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 (2)\\tx360\\tab begins with 2\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi-360 (3)\\tx360\\tab and now 3\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 with a continuation\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 iv.\\tx360\\tab sublist with roman numerals, starting with 4\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 v.\\tx360\\tab more items\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1080 \\fi-360 (A)\\tx360\\tab a subsublist\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1080 \\fi-360 (B)\\tx360\\tab a subsublist\\sa180\\sa180\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Nesting:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 A.\\tx360\\tab Upper Alpha\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 I.\\tx360\\tab Upper Roman.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1080 \\fi-360 (6)\\tx360\\tab Decimal start with 6\\par}\n{\\pard \\ql \\f0 \\sa0 \\li1440 \\fi-360 c)\\tx360\\tab Lower alpha with paren\\sa180\\sa180\\sa180\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Autonumbering:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 1.\\tx360\\tab Autonumber.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 2.\\tx360\\tab More.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 a.\\tx360\\tab Nested.\\sa180\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Should not be a list item:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 M.A.\\u160 ?2007\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 B. Williams\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Definition Lists\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Tight using spaces:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 apple\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 orange\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 banana\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 yellow fruit\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Tight using tabs:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 apple\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 orange\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 banana\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 yellow fruit\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Loose:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 apple\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 orange\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 banana\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 yellow fruit\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiple blocks with italics:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 {\\i apple}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 contains seeds, crisp, pleasant to taste\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 {\\i orange}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 \\f1 \\{ orange code block \\}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li1080 \\fi0 orange block quote\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiple definitions, tight:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 apple\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 computer\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 orange\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi0 bank\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiple definitions, loose:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 apple\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 computer\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 orange\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 bank\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Blank line after term, indented marker, alternate markers:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 apple\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 red fruit\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 computer\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 orange\\par}\n{\\pard \\ql \\f0 \\sa180 \\li360 \\fi0 orange fruit\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 1.\\tx360\\tab sublist\\par}\n{\\pard \\ql \\f0 \\sa0 \\li720 \\fi-360 2.\\tx360\\tab sublist\\sa180\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 HTML Blocks\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Simple block on one line:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 foo\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 And nested without indentation:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 foo\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 bar\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Interpreted markdown in a table:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 This is {\\i emphasized}\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 And this is {\\b strong}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's a simple block:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 foo\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This should be a code block, though:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 <div>\\line\n    foo\\line\n</div>\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 As should this:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 <div>foo</div>\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Now, nested:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 foo\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This should just be an HTML comment:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Multiline:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Code block:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 <!-- Comment -->\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Just plain comment, with trailing spaces on the line:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Code:\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 <hr />\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Hr\\u8217's:\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Inline Markup\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This is {\\i emphasized}, and so {\\i is this}.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This is {\\b strong}, and so {\\b is this}.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 An {\\i {\\field{\\*\\fldinst{HYPERLINK \"/url\"}}{\\fldrslt{\\ul\nemphasized link\n}}}\n}.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\b {\\i This is strong and em.}}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 So is {\\b {\\i this}} word.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\b {\\i This is strong and em.}}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 So is {\\b {\\i this}} word.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This is code: {\\f1 >}, {\\f1 $}, {\\f1 \\\\}, {\\f1 \\\\$}, {\\f1 <html>}.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\strike This is {\\i strikeout}.}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Superscripts: a{\\super bc}d a{\\super {\\i hello}} a{\\super hello\\u160 ?there}.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Subscripts: H{\\sub 2}O, H{\\sub 23}O, H{\\sub many\\u160 ?of\\u160 ?them}O.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Smart quotes, ellipses, dashes\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8220\"Hello,\\u8221\" said the spider. \\u8220\"\\u8216'Shelob\\u8217' is my name.\\u8221\"\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8216'A\\u8217', \\u8216'B\\u8217', and \\u8216'C\\u8217' are letters.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8216'Oak,\\u8217' \\u8216'elm,\\u8217' and \\u8216'beech\\u8217' are names of trees. So is \\u8216'pine.\\u8217'\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\u8216'He said, \\u8220\"I want to go.\\u8221\"\\u8217' Were you alive in the 70\\u8217's?\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here is some quoted \\u8216'{\\f1 code}\\u8217' and a \\u8220\"{\\field{\\*\\fldinst{HYPERLINK \"http://example.com/?foo=1&bar=2\"}}{\\fldrslt{\\ul\nquoted link\n}}}\n\\u8221\".\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Some dashes: one\\u8212-two \\u8212- three\\u8212-four \\u8212- five.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Dashes between numbers: 5\\u8211-7, 255\\u8211-66, 1987\\u8211-1999.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Ellipses\\u8230 ?and\\u8230 ?and\\u8230 ?.\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 LaTeX\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab \\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab 2\\u8197 ?+\\u8197 ?2\\u8196 ?=\\u8196 ?4\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab {\\i x}\\u8196 ?\\u8712 ?\\u8196 ?{\\i y}\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab {\\i \\u945 ?}\\u8197 ?\\u8743 ?\\u8197 ?{\\i \\u969 ?}\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab 223\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab {\\i p}-Tree\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Here\\u8217's some display math: $$\\\\frac\\{d\\}\\{dx\\}f(x)=\\\\lim_\\{h\\\\to 0\\}\\\\frac\\{f(x+h)-f(x)\\}\\{h\\}$$\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Here\\u8217's one that has a line break in it: {\\i \\u945 ?}\\u8197 ?+\\u8197 ?{\\i \\u969 ?}\\u8197 ?\\u215 ?\\u8197 ?{\\i x}{\\super 2}.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 These shouldn\\u8217't be math:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab To get the famous equation, write {\\f1 $e = mc^2$}.\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab $22,000 is a {\\i lot} of money. So is $34,000. (It worked if \\u8220\"lot\\u8221\" is emphasized.)\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Shoes ($20) and socks ($5).\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab Escaped {\\f1 $}: $73 {\\i this should be emphasized} 23$.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's a LaTeX table:\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Special Characters\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here is some unicode:\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab I hat: \\u206 ?\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab o umlaut: \\u246 ?\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab section: \\u167 ?\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab set membership: \\u8712 ?\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab copyright: \\u169 ?\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 AT&T has an ampersand in their name.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 AT&T is another way to write it.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This & that.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 4 < 5.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 6 > 5.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Backslash: \\\\\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Backtick: `\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Asterisk: *\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Underscore: _\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Left brace: \\{\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Right brace: \\}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Left bracket: [\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Right bracket: ]\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Left paren: (\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Right paren: )\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Greater-than: >\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Hash: #\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Period: .\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Bang: !\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Plus: +\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Minus: -\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Links\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Explicit\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Just a {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nURL\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nURL and title\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nURL and title\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nURL and title\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nURL and title\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nURL and title\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/with_underscore\"}}{\\fldrslt{\\ul\nwith_underscore\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"mailto:nobody@nowhere.net\"}}{\\fldrslt{\\ul\nEmail link\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"\"}}{\\fldrslt{\\ul\nEmpty\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Reference\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Foo {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nbar\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 With {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nembedded [brackets]\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nb\n}}}\n by itself should be a link.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Indented {\\field{\\*\\fldinst{HYPERLINK \"/url\"}}{\\fldrslt{\\ul\nonce\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Indented {\\field{\\*\\fldinst{HYPERLINK \"/url\"}}{\\fldrslt{\\ul\ntwice\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Indented {\\field{\\*\\fldinst{HYPERLINK \"/url\"}}{\\fldrslt{\\ul\nthrice\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This should [not][] be a link.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 [not]: /url\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Foo {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nbar\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Foo {\\field{\\*\\fldinst{HYPERLINK \"/url/\"}}{\\fldrslt{\\ul\nbiz\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 With ampersands\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's a {\\field{\\*\\fldinst{HYPERLINK \"http://example.com/?foo=1&bar=2\"}}{\\fldrslt{\\ul\nlink with an ampersand in the URL\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's a link with an amersand in the link text: {\\field{\\*\\fldinst{HYPERLINK \"http://att.com/\"}}{\\fldrslt{\\ul\nAT&T\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's an {\\field{\\*\\fldinst{HYPERLINK \"/script?foo=1&bar=2\"}}{\\fldrslt{\\ul\ninline link\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's an {\\field{\\*\\fldinst{HYPERLINK \"/script?foo=1&bar=2\"}}{\\fldrslt{\\ul\ninline link in pointy braces\n}}}\n.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel1 \\b \\fs32 Autolinks\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 With an ampersand: {\\field{\\*\\fldinst{HYPERLINK \"http://example.com/?foo=1&bar=2\"}}{\\fldrslt{\\ul\nhttp://example.com/?foo=1&bar=2\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab In a list?\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab {\\field{\\*\\fldinst{HYPERLINK \"http://example.com/\"}}{\\fldrslt{\\ul\nhttp://example.com/\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 \\bullet \\tx360\\tab It should.\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 An e-mail address: {\\field{\\*\\fldinst{HYPERLINK \"mailto:nobody@nowhere.net\"}}{\\fldrslt{\\ul\nnobody@nowhere.net\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 Blockquoted: {\\field{\\*\\fldinst{HYPERLINK \"http://example.com/\"}}{\\fldrslt{\\ul\nhttp://example.com/\n}}}\n\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Auto-links should not occur here: {\\f1 <http://example.com/>}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1 or here: <http://example.com/>\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Images\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 From \\u8220\"Voyage dans la Lune\\u8221\" by Georges Melies (1902):\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 {\\pict\\jpegblip\\picw250\\pich250\\picwgoal3000\\pichgoal3000 ffd8ffe000104a46494600010101007800780000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc000110800fa00fa03011100021101031101ffc4001c0000000701010000000000000000000000010203040506070008ffc4003e100002010303020404040502050500030001020300041105122106311322415107617181143291a1234252b1c115f016336272d1082443e1f1265382ffc40017010101010100000000000000000000000000010204ffc4001b11010101010003010000000000000000000001110212213141ffda000c03010002110311003f00dadd18a10a704f6a95ccc57e37750782b0d8d9ea0cd32e7c5446e07e9f4ad723119a7b89e61e348f260719278aad613cbb640002938c76a182b264fc87bd13009c0c019c76e3d68a072e1cf6f4cd502d330c28269a61bb39c923923d4fad44c08dccb95cfd28b8280769ee08a263891e1808739e4f1d8d149392172cc714050dbb9fde8960ed8c60b79b1ed44103b05c331dbdb1dc5026ac1946d20ff8140aa631c773ec738a0346a003bf93e9cf02801895e7b9a01886796c923bd0090a06393c76a0142003ce3d86680d8dd9392303f5341ccc1b3cf7a2c812c37e4923d381429757013209fa511c18146c9247a0f6a007900c0c671c6280854e086c673eb45c27c038fd68aedff2fda836ef881f136f25d5e6b7d1262964aa02b03f98fbf153131935edcc97576f35c33349212cc4f39f7ab26186dfce5b200f73451f7600dcb8cf27e7400c0b291914046c9e0718fde81371b8e7273f4ef4007691919240e714097f31f376e7b5008caee27807b0f5a02c8e1b3c6d27d33cd0201d839523144d1a149ae084b78da47638211771fd050d582c3a0faab5119b6d12f8ab1c06788a0fd4e2ac356fd1fe08754ddccaba849696309e598c9e2103fed1dcfdeadc44fea5ff00a7f956366d375e492403ca935bedcf1eea4ff6ac68a55efc1beb3b552574f8e7009ff933a927ec715bc82b3a8f4d6bba5ca1352d22fe061cf9a0383f71dea5119cc6c0baed3eaac0f1fad40897dcc3d81f7a052366c1007df3400f21edefc5008c28f30c9c5170ee4fc37830086395250a7c66770c18e78da31c0c63de8609b41f7c515c5172a30c3b76344a3e377cb2339cf7a242aea89808cce368272b8c1a2e107c672a49f5c1a181c9c7ae7da8a2119e7b1f5068099ffa68258a132062d8f9e0f34059502b61bf2824e681bb297ced2a71efda80f19c47b9c77fdbe74057c13e539cf3c1a0eeeb9c73f33405ddb4f18249c1e28062b79ae242902024465b9214614649e7bd0362a7249eddc513456e5720f38f5a1a98e96e95d6baa6ebc2d1ad1e65521649bb469f563534d6d7d31f04347d2a2fc5f535db6a0e83718906c887cbbe5a9a8bef44dce9f731ca9a2e89169d6d6f2184b1455dc07b11dcfeb4d16f119c649a681285b03d3e5500f87820ff006a0e098191de80ac9b8904647b55d11da9681a56a31f87a869f6970b8ffe4883629a289aefc16e92d441682da5b098f21ed9f033f353914d19b751fc08d66cc16d12fe2bf45ec92ff0df1fdbfb559ec667aff4eeb1a04db359d3ae6d40eccebe53f46ec7f5ab82263da7dcf3eb5174e5181076918c7de869503232491ee4515c1803824f03b51287f30e0e7d803449494832c157278a2e8c71fcb9f9d144639236824d01e142efb1768cfb9c7ef40512a818de78ff00a682518e7cc30ab9e00a02cce9953247bd41e467191ed9a04205ee99da4e4e3d283a524b0427b5026c18a8e082067db8341ce0e39ed409b6502907391edda80f2dfdc496f0c124ac6184b144cf0a4e338fd2894f7a7342d4ba9b568f4fd261f12571966270a8bfd47d8511bae85f02b47b7fc34bac5d5c5dc88a0c90ab6c8d9bedce3ef4d1ad691a6dae976a96d616d15b409f9638d70054a1dbc68ea51d4329f4619a8022b78e04548515117b05000a035c5c4702a995c26e3819f534047bcb68a458cce866719540724d02e41c0f7a012a40f6141cbc8e7bd01719e38e6838af1c0a04ca8206d3cd037bdb082fad9e0bd8a39e0718649141047d0d5d18f759fc0cd3af164b8e9999acae4e4f81236e898f7c0f55fed574615aee83a96817ef67abda3db4ebdb7f66f983d88a061bb8db9e3d45165076db83c1f950a53780d8247c80a2398f182724f1c7ad080c608cfa7a51a0062adc7afbd0130173bb9c5070f071cb37e82826106e8f615e01c9e680d6b35bc534be3c1e3831b2aa962bb188f2b71df1de819ae4b1048c7f57bd01a58268e332642ae0704f7cf6207af6a01b99e17b7b6416e227407c494139909ed9f4c0a04a4e501e0f1eb40d263e53dce7fa682c9d0bd13abf58dd6db18bc2b157c4975270ab8ef8f563f21447a73a03a1f4de8eb031582b497328066b97fcd21ff038edfde88b7e32703bd64188e7e6283864b73400cd804b67ca3268317eacea6d56ff005233592f8b6303f953fa4af7c2fa93417fe98b763e0ea171297bab98558068f695ce0e08fdbd281e5c6a57ba5e9d14d716ef7774f2ec112601da4f27ec2827ada74bab559a20e148fcae36b0f91140283729c77a0e0a7777a01dac68395719e39a029607cb901b19c501480ab9279f4a086ea8d0b48d76c0586b7143224a76c61ce1831fe93e86b43cd1f12fe19ea7d2533dcdbeebcd20b612651e68f9ece3fcf6fa5067cbcf20ff009a051724905411e94032799060723da8406d6c67e7ea68d0e1770fe5cfb5026c37039ef9a02eca098c91e6e01e71c500b1d8a49c12786cf6a06a4e256008e3d050119958007920e2801154e32fb4120927b014017eb1c523ac5209a356215c291b87be28957ef853f0d66eaa99352d515e1d190f947669ce7b0ffa7e74a8f4be996569a5d9c56b6704705b46bb5238d42851f2ac875712bc70b3c30f892019540704d01ad2669a0491936330c95ce7140b2e4939a03638c7e8680ae485e33bbe540d60d3ada162c90a02c7270a39340a4f28b68da4645007a8f6a069a746f73235ddcefc391e12b2e1916824948742c99382473c73404791c617695279dc0640f9502c578c9efeb4095cb4cb0830ba21cf999c6401f4f5a05061d430c8079a02e03b3004311c7d281b5e3cd676c65489ee594e4aafe6c7ae07a9a0a075bbea3a8ea96f047d3935ebc404f04ad29411e08e011d98fed416fd212ee5b05b4d5ad6300c615807f1171eaa49eff5ad418c7c55f8466dd66d57a521f20cbcd66a7247a9283dbe5418a63862479877cf1f6c5008e400bdf1ce684016fe53dfbd1a73794600e08ce3d6800377c8c7d6800a9cf75fd4503d91492460f7ee3d28247a7b459f5fd592d22711c206f9e563858a31f99cfd050583518ba75247b1d134f9aed21396d4669769931dc01c003f7a329c4d17458ac5b55d36c12e040a3f1da75c1cb04ede2447f7f6a94567ad7a66db4fbbb29ba7d65b8b4bd8ccd09c8231eaa07b8ab04a7c2cf87b3f53ea8d77abc72c1a5dabe2452bb5a561fc83e5ee7e541e988218ed2dd22b7855228d76a46a00000ec00a510bd4dd511f4fe84da95cc31f880022da4902b1e7d3e99ac86fd03d631f565b4ee6d4dbbc649009cab2e48c83f514165b8b94b6895c44f279c280839e78ce28178ae6de46748a789e453865570483ec6812d42e85a421fc37918b00a883924d024c6e99b7a2a966c0009e17dc9f9fed40f81c77e28139218e4ff9815b9cf23340a01c907b9140201038ed402fcafd28386464e4fd33c50272bc60032609cf00fbd024f722dc66f24822ddf972f8feff00e280f69b24844919cac9ce7de83a447f30ded823007b50459d6ecacb528349b979127651b1dc795f1f3f7a0990148054823dc5015d491c0a0c3be337c2ff00c489b5ee9c87172016b9b541c49ff5a8f7f71eb560c1fc43e0a47e1aa94277310431f91fa551c1727f29ed409b641c86e31839a3454805739c1f6a026f1fd740f64665fc8c31cfde82db79bb40e9e8f49b62eb7d7e8b717ec832c91ff247fa1dc7df2281bcc9369d671493c422b7911654c1215f92bb8827bf068624ba635392df5eb4b9924558ee5bc19b71cee43c6dc7cf34c657be8db0b0b9d0f51d2afe668934dbf9628ddb8c2b8c0073f3a80da37546a7d25174fd95dc125c69f7313ee5655dfc313bd483cf07b1f6a68d5b48d5ec758b612e9d7293211c8fe653f35ee2a084eb9e8bb1eafb3582fe496278f3e1c919fcb9f97ad03ee8dd017a6741b6d3229dae161057c5750a48249ec3eb4139238568f6a9e7b103b5037934cb3793c610a2cd9277a8da73f5140ee38f6280c4b11c65b934023006d50050030e4647de80c846de3b500fcf9fbd0197273ed4007b91400e580c8e45074a82400e72682b36fd2162b7f25ddc09af2766ceeb872db79cf00f6a0b3229550140e07007a50092db860673de818df473c862686dad6470d9cce3b7b63e740fa1de6252ebb5bd81cd00bee2d800d003a6464004763ce683ce9f1cbe1f1d3a67ea1d1a30b68edffba814708c7f9c63d0fafceaca31e6dc71e1f07daa82608c83819f7a1a11ce149238fd68d0a579ec682cfd27a7c3a86bd10bc38b3b756b8b93c1fe1a8c91f7381f7a034f752ea5aa5c5eb292f732128037619c018f6ec282e5a2cb047abda74d5ce9b6da80f136de4a496219b3e48c92000323ea73467519d3da5bb757dbda410ac90c77c23058f99007ee7ec31416882ee47d23acb5185caf8bab4691b1efe57fff0038a9457ee75a82f6e7429350466b482f2742c0f74241c80c38c64541a9cfa1e89ac0177d33ab3d8de28f2b5bca429f91140e2c7a9b5ae9fb85b6ea9b46b9b3c796fe040768f76ec0fafb1f9505df4ebdb3d4edd6e74db98ee216fe68ce47d280648f75e2485a44da385ddc13f4a025ddbdbea16a633286566ce55f9c8f6c502ad750db2c514f30dec428247e6340bbf04100b73402afb943ed2b9e30683836defe9403bc1e06734020e06280cafe8683a375941d841c77c1a0151b467b50159f00e4127e5402872371040c5046eb5aadbe9b1c02e2f6dad25b89047099c677b7b0140fe3f1010afc803f3018e68160c3041ee2823f5dba92d34db89a1d9e2843b03b6d05bd013560c1748d57aa2797c6b35bab78e6959dc47231580ff336dcfb03c1a58364b5bbb7d7fa7b7427f1f673830c8664285bd1815238fad20f2c7c41e979ba43aa2e2c1cb1b663bede438f3a13c7dc76fb5515e9065b851f7a02950002a09c51a1b83cf14176e90d3645e9ad7752752aac23b3439c066665c827e944d29a6410aea725c4567135bd840d3c88a723728c29c9efe6c50d3ee9545b0bf8ef2e6e3c2fc2c6f72f2920e5f19039ee4938a9a875d03278377acf52ddf867f036ef71923932bfe51fbd3475cdc369df0db4fb389d4ea37970fa9cc0b00511795ce7d4f181eb4cd2451755fc45ac16d637381b14ca36b641dfce723e4053170d6cb52bbb362f6d3cb19241f2b9029862f09f143549ba7e7d2eef6caf2797c66ee17fdfd69862d1a069da7dfdac579d17adcda5ea9e1a992376c4723e39e3b024fd7e94c458ac3e25dee8d31d3bae74e7b79002bf8b8549471db38f5f4ed4c165e943a06a328d4ba605b4b22a1523c420c64fbaf38a82d36f0ce7cf7463790729b53017e940e0b0ceceed8ce0500e1b70daa08f5c9ed41d271cd0132476e7d7ff00aa069797d2411168ed9a41fcc858211f73c5075acb25ca6fb82aa31e58a36c81f561dcd033d42169e158ac64b98151b3981c2966cf639f4a064c7a8ac55e4865b7d493701e1c8e52403ea3cbfda827e390ca3f2c914aa81991bd281cdacc2747215c60e0ee5c67e940cb51b0b2bcbd824bfb08ee1a252d1caea1821cfa67b1fa504982b2283ce08f518a08abb82f6dd0369a5662081e14ce40c7ae1b04fda82275cb0bfd4f4536f7114589a5412461f3e4ce4e0e060f63f6ab2893d3b4b5b5b78e22ed22aae3cc3cc7e64fad3449a22a461500007602a0cd7e3b74c26b5d2ad79147baf34eccca40e4a7f30ff3f6aba3cd0543267eb5427b86f1f4c76ef45d0eca1ad5ef224d13e1cf4fd9b22192fa67bc955f8c8c617fba9fb510d7a6ed3fd43a735e5b54964be658c048fb6cdd9e7eb8a186bac97d174e6d22e23437b7ac26b95e77c68bf950fa7279e2b22dba45b59e97a669fa4ea36aeff89cea9a90451fc355ff0096ad9f4ce3f41570675d4fa8c77da8de5cde5be26bc653171ca47dc1f6c9fed5562b97f70276808da7c24f0c1c63804e33fa8a2928c0e0383c8f7ed41d92a41393f4a2548595c2c37493db4cd04e8a08f139566edfef3445b6e7aeaf65d2df48ea2b11776ae02a93e564c772adef409f4ee8ba9a21d73a36fa579ad9f325afe599171ed9c30a960d5ba0fe2843abb47a6f510fc26a4c36890f9558fcc6783506a1147b510024e30339ce680d2c6ae9861eb9a009178a0205443b989e39cd01d8075e3047ce80563057ca381ed4011c4531e503d85013c91b804a21279c903341131cda8c3abdc8650f6d20c4321232adec3dc504bab2c113c9293bb1963df3408dd4b75e1efb2856463dbc43b4631fad047e9177ad4fe32ea16b1db4b8fe1aa92571f5f5a0916bc8e0895af5c46c17cd8c9ff7da80f6d736f7f6915c59cab35bc837238ed8a072a31c1ef4062870718a06f7702dc5b3c522ee4752ae0fa8230683c75d6ba3b74ef535fe984929149e4278ca9e47edfdab42058003763ed409f88ffd6dfad06b1f12ae612fa0c76e0b471e9916d23f973eb4158d3efeff004a984da5debc1295d8e4018dbf3145d583a2ad96f356bbd7f5d90dc59587f1e79a6392f28fcaa3ee47159444ea3aa5ddfc7acf50dcdc344d7a4dbc317f52641200f6000fdeb41b5ef51d8eab672ffa9e971c97c11638268e431a46000012a3b9a351567db823b11f3ef40948e428048207a8340ab48ae83cb83ee0f3428a982719edf3e68c9cc97d3fe15ad8c9be138f2bf38e7b8f6ef40f7a5f55bdd3f56b46d3649127f1405f08e7249c76f5fa50689d48ba5f545cdcbdb462cba9206411b2b055bb07d4fb1c73528d4fa8f52d62cf47b6b8d2e65fc458c49f8a818795c151939f977a823ba0fe253750eb7fe937b04293f9f6c90be41dbdc7ff006283473c1efc1a06f69776d73bbf0f2aca32572bc80470450284a46dfca19f819f5a04e799614def26c0bdce09cfd85045dc75769d12dc3c3e2491db0dd3c85195235f7c91cfd066ae0cdba9be31f4ec61a386c1ef9d4ee473e45cfb1cf34c101d3ff1ac9d481d46c628ed24751881880833f988e7b0fa5328dfed2f2def2ce2b9b79925b791772ca87208f7a60182ee2b95cc0c48f53823fbd40ac658b30f4f4a086d4ee1d75bb6b78f4e965596366fc5211b23238008fde81f43692da5bc30d97831a0397dc09e3d714087506bf61a2c4cd77324726d2caaec141f9fd2ae0c435bf8c57173ad7876f7a2daca10489121244cdf319ce3dbf5a834fe81f881a6f57bcb6ba7c53c72c11873e28cee1db391dbef4199ff00ea4348116a5a66a8a8a04aad04847a90723f6ad7d18c312ddc02a3815423ba0f63fa541687bd9efe1b533b3c9e0a78473e899e318a09bd0ba6eef543e3b2bd8e9b10064bd9e4da001dc81401aeeb29a984d0ba7d5e1d06d4e6594f06523bc8e7f5c0ac8af752dfc17d7090d9218ec6d9447129ee71fcc4fb9cd6842ab10dc0014f3e5a2c1704b671dfdc734525226dc939e283a362c7f940344a380393df144733e2276e38f5efcd01b4bbbfc3dda4a9298a44395902e4a9c70682660d4265d62de40b1bdc1545054f95c8fe627df141af7c3af8808f3dd68dd5d2a45765884b8908d8c3b6c27b7a77a945d7a5fa474bd2ba8e4d5748b28624955d5d8b13b79ee9e983d8d40a753758c7a46b96f6114725dc92279a2810b3a64f94900763cfafa503fd3b59b79ed84da34713c0cd890f0a158fa1f981de826e1b548959fc4dc5cee24b6467e59ed4101ff19e9f676baa5d6a72c50adb4ad1ac790ccc076200f7ad41e7df881d79a87576a5f87b0f161d381db1c2a36e7e6d8ff3416bf87ff082c6f208ef7a82f22b9761bd6d619785f6dc477fa53705ab57f83bd297ceb1e9caf67708db9c4526723e849e3e94f212dd25d117fd29a8c09a76b534fa39cf8b6b71ced38e36fb73417f52e64548e34007e673e9f21ef590a1c918c90718dc281a69b68f67118d9da5058b798f6fa7fe280daadd1b2d36eae70710c4d263df0a4d583cc7a668fd4bf11b5837d7c93dcd9a3146959822a0e781f4cfa55161e9dd7fa67a4f55b9e9aea3e9f81fc09ca0ba118998fcdb2338c7b528d39f4cd2ba76e2d357d292df4eb391809963420ce1b1b576fa1e7359119f1eb4e17dd033ca172d6b2a4df303383fdeb5c8f2eef3bce4e0e335684cb0c9f354160d36f64b0baf16072b91b5f03391f43c51aab23a5debe91c4fad4d73689e6fc3a290573ff4f03e59f4a3280d67581ce916567f84b58ce0a1fccec3d58fa9a084de08c90464e4d1a8e419059b201f4a05630a176918efc50176293872c17bf14042aa0125b03db14046c60b60123fde6827fa0c68edd5365ff11346ba6292ee64194240c807e59a32b7fc51bfe8bd5ed5db424860beb62b89218422ce09c11c01dbbd0660ae110bf1bf2154838dbebfefeb41a8f4cdac7f117458f4d9ecd2df53b4cf81a822808c47255c0f7c8e7fb54a2ec2cfabba3b4b4b8d3af12eedad40926b0f070a13f9b633649f7a82eba6ea4357d321d4ecad512daf20df26e016507fa4fbfaf3e98f9d067dd2bd2faac9aa4d72d72d1e9510ca46a7631c7a320e18f1dfd7bd059afb7da816d23de4ba5de211346a1e4785f190548e4648c63b64e6b43ce9d5baafe3b539c5b452dbda46c638a167cb281c73ee4ff9340e3a3fa5f5aea4ba58f4bb57dbfcf2b02a8bf7f7a0de3a5fa0b50d2a2d92eb3e048c0a97c867dbedcf6a944e5cf4f6b76d1b3d8ea42795066266c87c81c65b9cfaf15048e83af3cd64abac08edaf01546c38dae4e0657ee6826e5b892de3702292e2545ddb55700fd0fbfca81c4b3bc718716eef9eeaa402280d14ab3c0b2c65c06fe571823ed40df56b217fa6dd5ab9216689a33f2c8c558307e83b8d77a37aaa7d22f2512c28768800c9954671b3d33ebef568d0ef7a7749eb0b5bbbb162d657b32b46d2e1564c8ed9c5644d1b0b9bbd261d2a440af6cb0e2e5b1e7dbc1238e0f7a0375b696daa7496a3a4dac8a92cf078685b271db04d391e40d5ec4586a1716de2a49e0c8c85d3b120f715ba1899173ff305413070abd89cfe9f5a2d3ee9c8639fa874eb6b804c52dc46b20c9f302c3bd11e84d47e1af4d5dc6521d3e3b662c19a58721ff5a9a321f89bd27a374b456d158dccd34d333332c9b4b2afbe47a7cb1f7aa33d2bc0d8c0f1c8f6a2c14b6d501b39cf63450897380c319e3de8065031c038f7ed40d8faf1ce41e4d004876a8dc3cc7e743025c956c818028c904579e7f0e15695c9c0541924f6c00283d0bf07f42d6b48820b8d62d20b2b58d656404959e52f83c8ff00fcfafbd4a35bb06f12391a48dd55cee2b2f3818ed8f6a8158a159890f02242079147623e631c502b0db436d1ecb7458d4738038fb0a087d6eeb508f48bb7d32d95750752b6c26c905b3ddb6f61eb574794f5cb6b9d0fa9678b512b25d24bbe52b8c1638278fbd582c57ff12afaed45b5bc0d0d8a8c08a2731ee3eec5793f40450466a1d59af446293c186cd53ca0c36eab93dc649e49fbd048e89f1675ed35e301e293919dcbf9867b37cbe94a35fe94ea4d33aba6824306dc48015750d86c6e247b0cf63591a40b8dc23fc30f14138dcac3000f9d03687547f12e8dd5af816b13148dddbcd29039c0f6f6f7a0eb5d62caf5636825db70c9bc4328f0dc0271c8a090627d3073ce681acf6505ccf14d35bc2f2c2731bb28254fb8a075144a83ca806792400334049ee6281e2496408656d880ff0031f61fa50446bd76058ea1b9e21025a3bb48afe71df9c7b71de9c8f196a0de23ca7b827d4f7add117e0cbfd4b5059392369663ff004e71c51aa97e8f555eadd258f2bf8a889cff00dc28cbd0bf123a926e96d163bdb74490bca2321c678209ff001591e71eafd7a7d7ef45cde2c20aae144638033fb9ad2e1b5e69d058da431ccf21d4a5c3b4631b62523807feaf5c7a50222f2d648c25f5aeec8c2cd19dae3d3e87e944d3eb7e90d425b49ef2292de38224f1505c3f8724a9eeaa7bd0d57a60406059436306868a7803839c7ad1a158039c13f4a33a716767f8cb9b6b55e1ae2458813e9938cd07a9f42d0b4de99b4b7d1f41b58ff19b03c93ba06607fa8b1f5f619a5b8266d74a65d42da6ba90cce996dcdc8c9fff006a5a2c2635083b05ef83eb5028076341db4b1ed9f7a04651fc41db18ed419d75b744dbea335fcb0db0335f2057901c05da73c8f9d5d18a75174a3f4c47335e35da4ce418a489374254f707d463d33565d1529b569a489a17944b06ec8057d71dcd037b4b6b8bfba31584124b27e62a8a4f1ea68357f83da7ea5a76bfe0912453ccabb49194653cb60f6ce3dfda983d196cd108c2401711f9768e306b2297d73fc6d02773a8b591922693c5004bb9d72542fa2f6efde8314ff867aeeec27500b77bb5670e36ca19b1dff2e7f2fd2837ce8bd5dd348b78b552219022870d9c46e792a4f6c608a0b846c8e03232b29ec41cd0199f1410fd4b24b1e8f712c0a5e4452d851e6c639dbf3238a0afa42ba77475e4ba8470896681da45180b18da76af3c9029c8f26dc1df2b9c606e273e86b743331924f27f4a82c12280e59b008e79f6a2d4d74188ff00e30d203a82ad7519c1ff00b860d11ba7c5e86c9fa3afae6f4091e043e021270b21e01c7dcd6479ab4dd3aeb56be4b7b184cf2b301b57d07bfd2b4bad0fe25e9f6960ba7c7a55ac50cd750335ccaade7723b83b8f6e38a2207a5ba4e7ea3d93780cb616ca53781f99fbff009a0b675a5be9765d43a75a6ad3b25adb4185429b831c70303dfdfd2831eb8954ca48f3827819c71ed406b2b1b9bf9a5fc1c4ce2253238047957dc9345d122b792eee522811a495ce1157b93ed444ff0049f476b1aaf51c761345269d25be269259570c833c6077249e062a68f53e8ef0da69509d4ae225b92a04af232ab16f98cf1f4a5a266d4dbca8af13a329ecca723f51502d14f0cb9f05d1c8ee01c91f6a0393b4edfe63c8a031608859b38f97340d84d04e5846eae50f9829ce3eb400fb24466041f5e3d2823f56d22db57b192d6e61468a41c823ff0035651916bbf04ada7badda5cad6d1b72c09dc33f2a6875d25f0865d06fe2bc6d4c4d3282026cca8cfafcfd29a34cd234a10c768f711a78f1bb392a3001208e3ec69a26a58d640c832091c90706a084ea1d3eeafdadf4f86da3166c0b4b397c18f046140f5ce4d04f4702436e91c28a9122e028ed8a0a9f5a5b6a09a1bc5a135bc72cce048b3c5bc15c638f9d59043fc2db997481aa69dae49e1cb6bb643239211939e467818f97bd305965ebce9a10bc8da9dbaa2679dd9ce3d8530572cfac87566ab05ae9f1490692b9696e1f833738555f96793504df5f25945d2576b7ec16dc46792381c7b7ad5e60f234980e42f6c9c56a82ec3eff00bd4124e49700f1c646e3cd169ce9575f83d52cee324347323f6e3861ff008a23d47d4ba6a75074fdcd8ef317e2e2ff0098bdd4706a60c3f4ae8cd5f44eb8fc3e97248a638cbc73bf90483d463b373e9574685abf42a6b5649fea72bbdeac4a8d3b018cfae31f7a6895b6b29b41d30d8e9f6bbed9213e1b7a994e724fcbb5064bd7835a9752d3af75d8116354778f660788cbd9483dbb0a0cd20b2b8d43528ad2088bdcccf854039cff00e2827a0d34e9da1de896f2182492efc0976f998aa827d3d334113a74aa9a9298628e74570478bc0c7cf1da83724bb8246d3e6416b0384da61b5501c9f5c3704f152c037561a95f5fce61d3ad6db4ab950f34b331dd9f4191db8fdcd406d67a675ab4b6d325d1af248272a43430315ddec7038f6ad4b3f448bf47eb71cb69abddebf21d5e26896203846c30c8603b9c6452d9835901405660376319ac84bf13180779d8bb82827d4fb0a06f777367a75acd7170f1430a9f331200cfceae061a0cf6dac692d7365266191db0578f5edf3a6075a6c9278b3433188a467860d96fbd40fe540471409aa0c1140750001ed8ed4058e15133c983960077edf6a06faade5c5b7822d2d926766cb967da2341dd8f0727d85033d27597d62e2ee3163756915bbf8799d71e2f19dcbf2a092b88dd9a311950a0e5b70ce47fe6ac18af53f5b69da9752dd69da9ca906876e24465d9e69881c6ff005c679c0aa2bfd267a347512c93dbb5d42d90d3c800b68c9ce0ec3cfa528db74ad034db5905ee8be1ac728dc153984f3f980f4fb56453be2de8f647a6aff53796596f0aed46798ec033ce149c0fb0ad71479c9bb9dc3bf3c55a0b95f65a825150b481a407b93c0fda8a29c06671dc93803bd131eafd0af6dffe18d2ee25982a4b04603b7a9c631fad03bbe586381bc5945b96385718c827db3eb5288eb8ba934eb15fc3c535f05427796dcccdec7150637d5bd55d5362b7975aa4d0d919018adec8637807bb60723000e4f7cd58203538aefa8aeb478a7b9beba924547b8774cf8608036a80704639cf1f9855d1a7f4c68b67a03de5e5d59dad8d988c62e1c0f107a1e7fdf7a082ea6d07a6e3e99375a7cb6b3db093c727701e2360f7f53dfb50653d4130d42ee18f48b3f0232a15218936963ebf5fbd06dbf0cfa74855b9d46e04b730c6144691e12307d33ea7de8348ba6b5478a279a004f98c479247b81f5a9438805ac0be2e02e73c9ef8fbd40c2346d43578eefc40da7da1dc8b8eefea4fcb9fef419beabf12a4bcebcb2d2fa7ee0dc58492084b30236bb6467dce383f6a0b87556a67a7f4d95a0bbb5468816f0a69c78b2e072572719ce78357079dfab3af2e7a92c963b88d94abbbf91cedc93edf418aa2c5f0dbe2a6a9a0c90d8de34773a6a8da1186d6403fa48fec682d9adeb7a9b4c9d572dacc9a6c9700456e5ca910e000ecbd8e580352fb1ae7476bd6dd49a325e5a9f3025245fe961dea097523cc0919a032af039a006936c81423104649c703ef40dcce64bc3035a87b6f0c378f9fe7cf2b8fdf340a4b6e25962915d94a67807839f7a043586922b5636ec44c061063f31f6ab079d7fe19b7eb2d4efeef55d5d74f992e9a0fc3a441dcb13927b838c9aa2d4bf042c618e178efee6e18104870172318edf5c1e6945bbe1a748ea7d2315edbea3a99bcb190030c401010e4e783ee0fa56455be3d6b90c1a6268d69e17f1486900ee98ec29ccc183119419e7e55ba11f089f523ef5058363a8059fb8e31e9421b491056c01819e28d3d0ff07eea3d53a1e3b6b8db235aca63c139c0eea68ca47a9fa6ef757b83ff00bf68ad428c2f248c7a8f9fcea518df516adac74e7544f63a2ea172f1800291e6cee19ec78cd5826344e85b6bad25ba8fade5b99dae0ee11efc71e858f7e7d054a2d7d39a75ae8f7b6b00b8917f1516624b78429da327cec493db1db1d8540cf4aea28f58d6aeae2f6dd64b498082d880488d149fcea7d4939ab04175e6850a8d32de3b78e380c8de32c4db4e18e430fef543cf86fd0d691b4fabdf6648b3b2db69ce7dd87be68342d2f4fb9b5b891af1a28a2dc05bc5036d001e0eef7352884b961a2ea9aa7555c885e08d45b5bc52b61b686c120fb939fb541276bd4b61d53624d942e2f6200bc32290633e99f4233416dd3ad3f0d611c0c77b632e71dc9ef41156dd27a45addcb3dbd9c513b1dd941821bdc7b558333b9f873757fd69a85e3f813e9c7723b5d93265d872473c11544a68ff08fa75e290b42ec4e4124e70738fa5048e89f0f745d2aeadd2decedda6525c975121183c77f7a945c754d0e0d563682ed43425369403bff00bcd58308ba7d5fe13f5a05889974a9d8b46aede4914f707d88ff001528ddf4fd7edb54d1a1d56c312dab2e64dbc9418e78f5c541296d70b716d1cd6f8789977230ecc280cb7519b816f212b205de4e0843ce300f6cfcb39a0545c42cee88e0b458ddec33ee680eac92266360debc7b5056fad2d354b9b189745744be121daf27e550548ce3d4d58324d07a725e98ea2b7ff5381f5169a7579d021fe13904ee43ddfbe49038ab46e76cf05cc714f6d309232a4a98ce54fd6b2196bb7f2e9b631b2c427b891b6851db3eff002007341e5bf887aa2ea3d4f77378be381e42fdb711ed5a1554395caf1cd07617dcd04fc85402101da791421b49920331381c60d1a69bf02f56f03a925b12c162b98c955f775e47df19a32d99b518268e4491668704a79d4aeec7b7bd4a30feb7e9144d76e265697c3e2693631674273803e556087d76f35fd49859e9925ccf611141106f2e182e3241f727f5a94681a268f79ad1b1b8b9dd66b1c2b1ce9bb06361c1e7bf3fe6a096b0d3ba57488e485b52b40909c386901607d47bf7a0ae758eb69ac4d15be81a748f0a9c35cc90b2eff4c03c1c638a0b77405c5d5d45f87be5fe359a88b81b401dc1c7d38fb50586fed18ea3015790091591e447c1518c8c7a0a0a5754d8c9d49a8d9f4ee9dba0b3b5224b9692327728f627e7c6682f9a7e996b6b3a8b6b748a348820c7720761412c064e3041ce282b5d4bd73d3bd3f33daea97ac2e540dd0a292dc8cd043c1f15ba2a7923b65bb910371b9a12141f9d02edf13ba2ade56857551e5e77244c54fd0e280746ebfe99bbbd655d56dcdc9ce08465565f4ee3bfca82d53eb3a6dac3e25c5f5ba646402e33fa77a0aff5b74ad8757e9ca972844aa37c520fcca7d3f5ab067bd369a8f467544d626c98e9f7118f0200e4465c903049c8c9e6ad1b24334b6fa6249716cab20037c309dd83db03b5640dddac3764a4f02cb1103863919fa7a1a06d6f600c37162911b7b252b87dc773f1927393f4a079f868edae1ae6328a8b1ed38e30050226e85d5dc1f879011b3c47c2f604719f9d01eff4f4b83e3c6b18bb452b1cac9b8a83de80b16e8208a3b7b58e1407cc061427cc0ff1560ce7a8f592d69a97504cad2dac01a2b53900c3e9e51ea58f727d0551e73bfb86b99a49a46dcf21c96340dc13804f20f6f9501c0e3b8a0963316fcc4607007f57bd084d64dec01200ce483468ff0040d525d1755b4d4206ff0095207c11dc67ff0019a18f56584f6daad9dade4211e39104a8ded9152b235cd8c530613229c8c1c8ef50472e81690ee00322b0c100f0debdbb7ca8111ace856371358cba85aa5cc407891ccf83f2ef4048b4ad2e59bf116769672c72f99dd1437239078e2824a4d3e1b94559234110e781839fa0a0561b38ad532a12319c86c6307e740a9732a3a00cac870cd8e0faf0681be8b6db965bb909df3c85806eeabced5a09523647e6e0fef419a6adf116daf7ac34be9dd1da686e7f1ca2e243b76320ce57df9ff1560cc3e3f470ff00c78255b842b35bc6c4af9b6e323d3e95467b6365f8dbcf062beb68c119595d8aaff6e282422e9899b4f6bb5d46cda2562a76316c1078f4a0859e1b9b762c0bf94f0e84feb4125a57505c58ea70dd5d0174a986d92b1c13f6f5a0de7a5be366877260b5d42dee2d2423124a487507ebdf15289dd3fac7a7bab6feded74d61733473acdb5a162142ff00313d81ed505fa58fc6d809380c1b9f5c502e0e05040ea367a85dea454de2ff00a610375b04c16c7a16ef8340b5f6930dce9375636acf6a278f04c5dd4f1dbf4a084e91d06f3a52dee62bbd4a2b882494ced3c8a448063b63b638fde803ab7ae749b2b3096d792c93c8c109b55dcd18ce3710473ffdd043dc758dc5869044565aa5dda4c3c2b7bc78c1f14e3963db03e7c0ab066bf1327d41ba76ca6bc48ecad24c456f6b0c87cf8e4bbfa138c0fa9aa3297c83dd4e28395811cf2680a5b93c7ed413cd1ff0f3c797b8031406645236b0508406f30e68ba49c051b97d0e0e7d28ad57e19f575c5be8f269515dac772877c11bc464dea7ba8c739ce78f9d3193bb8ebfea2bcbd6b5b6b8b58bb7f13c2f0ce31cf0deb4c0f2dbad6d743d2ee99efae752d6c02a86e0054524f6383c7ff94c0b6af274c75149a46a5a82c46f1e1479fc3190bd8156fbe7f4a960bf74e9d253f1167a3ac09e0856610e3041ec7f6c540f67b892cee7f8d18368232ef2af2508c7047cf340ead5bf130accc9b1186541e723d09ffc5033bbb1b82d74d6b37f1244daa1b38073df3f4a08eeb1d3b50d4fa6a5b4d32f12cef1902ee73e523d476fde8306eb0d3fabfa4ba92c278af67bb7281606472f90bdd58558253a6afb40ea1d62283a8b461a66a6f931cf6a7c2466f7cfb939e7b5515fbed3747b5eb8f06eb78d35080a2ec9719c76f98049a0b4ebdd37d1bad869acbf0b03c5c16b29444adf50ded41995f68564a263a66b31cd02be152505493f51c1a088bab69ad1bc179e320f07c37c8a0692b46c4995f0381db39a0b2fc34e971d57d4705bc8db6c50ef9dd97b81fcbf7381528f5ae97a1d8e996d1db69b0c7648855b10a81b80f43c739c54134147b9a036063279fb5046e957726a0f2cfe04915b06db1788305ffeac7a0a00d72f8d9c491c06337533050ac7185cf2df6a06da2da4293488f34973328c34aea428c9ec3eded40ee7d2ad249448f6b133820ee2833df3fde819ea96897461b05b87815f2ee919e5d47704fa039ab079b3e326b70eafd4ef6d6650d8e9ebf868b69c8247723efebf2aa280eb9193ebedc5002a124e015340018fb8fde82cf32b1603d0678cd02406dce3008e47ce81b499c331383c9c9f5a2e9c69377369f7d6f796a4acf148acb83fb511e91b3b3d0bab745b7d45acedd8e3732b71b1fd73f7a5a19eafd09a56a0a96b1c705b49c48510761ce4fcfbd4d0d752826b2b583476fc3daacb295b79d768de8a32b1e71f989e49f6a7d14dd1af5ba275a45b8b093c054492ea769092373765c1da4679fbd306e36ba9595fe9f0dcdbcc92c33e1579cf27d0d409ea178f68521b6b76926ee8a7853f7ff140bc768d78f6f73748d1cd103b543f0091cf6efc502f7319dac194371d8b6326829f0c501d7ae6fa568d5d4942c806d4db81839f53c8cd59456fae6e628749b5bab8b1865b08e4726588ec11e7f2e49071c93da9a31dd4341d675e9a5bad374f9858162d0b4ac70e18f0573df35a0c759f87bd53a404f174f965dfff00f479b1ef570576e34bd4b4cc0bdb3b9b7258a00e846e3f2a94376475cee4914af7ca9150685f09ba61efb52fc7dd69bf8eb7c158d1d0b47bb38f37efde968d6eeb4eb5e91d6ad25b660aee59974db6881690918e31ce39279e062a5a34bb57b88adedd1e379679065d80036679e6a07e8391bce7e940c659ef5afe1286de3b16f2b8903094b7b2fa7ce81eb380c4260ed193f2a0cd6fa5d4a4ea0fc7bdadcce923158a3039db83c038e3ef41a0e96b2ad8a35e009291b8a939d9f227e43bd590436bbd6fa269202c974b7123602c76e779624e00e29833bf897d493e896525dbcb2a6b5a9c3e1456b91b6d60cf989c7f31f7a60c02490961ebcf3eb541308e39e067b507007b96007a67fb50178f97eb4165ce18165c2927b773fad023202d9c8dbb7818ff003408300b87f2f1c107d0d0c15a4f2e339c90467f6a18bdfc2cea8ff4bd561b4b9ba686d6e64552c4f954e7d7e46a60f4688d240af1b2bc6cbf5047ca960617ba658de1b792f2d94a5ab33461b18524633fa1a81b5c8b5168967369d23c0e0a24622dc981d81c76aba29df0bb48d660d52fceb88d069f04aeb69130037127f37b9c0ed9a8350781240bbc06da72323b1f7a0eb8816e633192ebc8c9472a78fa50349b4c83c068e24f0ddbcc1c13b837be4d055b57e98b996d4db5b4a893dc1e6620b6ccf2c467efc504ce97a38d3f4d874bf09af6d46e2f25cb82724e791db15650a43f878b51fc34f3da8f132b6d6a98c80a39ff007e99aba249631b58b9047239ec3e55368aeeb7d2da6f52c0eb7f16e87f2c6e836ba90724ab7a67b55d115ac7c3e8aed2182def4c56a14096368959a423d77e3229a27b41e9d8343b01069c8a8dc9660aa3713df3c64d4a1c695d3d6b67a8cba94b9b8d4e61869e4e4a8c636a7f4afcaa09a485519caae19b966f7a0435196582c656b74df3e308beec7b50629375775b691ac5bdb6b16d6378779f019b00a31cf391c9c2f1daae0b35ef52f5374de88d77aa45a6cd25ddc0108694ee2188c28007603d6a0d16c92430a4b2ed3230dc401855cfa0a0a07c45d7b5db9d462e9ee960b14b2ee134ef8c850012147ec78ab0670b643a2efae753d72686e6e2da211db42176079c8e768f65e39f7aa332d6f58bbd635096f6fe6692695b24f603d801e82823cb900ee00e68006460051dfd680ed9f0c905b713d8d006d5f5419fa505a18f94e40501b1b81a04186d62402c87be3d6810b81290aea8467201231cd1749dbc437f9f1e201db3de8ba07dc0175c027f28a335b17c26f888d6b6d0e8fabf892a29c453b1e547f49f7a946d6424f08236491c833ee0835073294888894120700f0280813c40a6711bc8843e00fca7d3ef40e41dc081f9a811681c6f7565329185623b7e9de812b3bcf11ff0b74563bd50494cf120071b97e5fda80d7577046c9019d5669dbc340324eec67fb734103d5da96bf67a7cf0e916f6e2765f25ddc4c11107ab1c8c647cce2816d3ec7f0f6564cae6e67da375e6d52cc4af2e4fb13ed4145f899d47b3499f4bb6d46cda49b69b92921565c3648e3dd40c81cd5c0ae89f13ec246d3e379ed2d6da180b5d34849da1780b128e49271c9f4a60ba685d5fa36bc42d95c324ec7090cc9b1d87b81ed50588958977cacaaa3b9341c655f12348d1dcb8dc1946540f99a019e2134454eeda7bed3839cd052fe2136b536b5d3563a1ca53c49da4b9507198940ce7e5c9fbe281c6b7a974cf4ee4ea7242d76dc784a3c595b3e9b464e3f6ad0ac745ccbd4fadcbabea42da56959a382ce7460d6b1a93c01f97272093ebf6a82f1ad6af0e9da5cb3cecf6902216919f82aa3818c7a9f4c530649a9f5269ba7429d472239bc991a1b0d3c3152880f0f23039e7bf3de90635ab6a377aa5ebdcdecef2c9239e59f3827e5ed54302195fcc38cd01245395c1f5f4a05b606538e483c501b6939e3b5077860f3914165754c33e549000dbe87de813b820c27fa7baafb8a04a69c98e281e42618c795338033df1f3a06c03e4e029247007ad010093c35674da71f977640340081a190658e41c820f141b0fc33f8926c218b4ed609366a02249bb2d19ce3ea4528dbece68eead926b7916689c643a9e0d643387521fea2f693c2d6efc786ee46d9bfed3eff2a04669edf5295ff057a60bd865309246d3bbbedc1efef41d63a8dec9ab4fa7dd4510fc3c69234ca186e2d9c003b7a67bd034bad0a5bb96e25d575267889cc1b54446d9bd0a37bfbfbd02925945a72cba8dddc48b3f87b1e58f23c623f292bdb7fa7cf38a0a5750f54ebba56a9a67fc516b6d6fd3970ea9234677c8dc7f38f6e4640ce282d1ac4b16bfa72c1d2bad430cd1ba822061865f5007d3daac19cf547c189357d561bbd3eee683c62cd786e9b73337b8c7bd512bd39f06adedec2de0d5ae639da372e6485363107f97767b505cee755d03a5e58ac228659af123184b7b733322e38c91dbf5a943ab3d52e64b49ee755d2e64950e238e35f10c884e17cbe87dc540e6d7509a4f110e9f7566a471712850abf6ce463e6280bacea36fd33a4497f773cf32c698dcc4beee33938edc7ad05534aea683ae61d64c4d2a69b6b88d16d5ca5c303f3e386cf61db140e27b5e99e96b64bdd562b6b30aa36c6c37cac7dc9eec6b42c1a66a962fa70beb6b516d0cbe76322f86c78f6c66831bf8b5d5d2dfa35a5dce60b1933b6ce3c788769f2b331ec1b8fd2831b79649984b239773c1dc68129725c1c640e73400ec781d8fb1a03c4a85d0c8582640257bd01e51fc42236263c9c67be280429c6037eb405dbf5fd682c2a0bb976cf07d3fc5009279ef8ec4e68193a9902b28e7dc71fb501d95b098e0f6dd9e0d0049131019b047b8390281bb292484e47c8500c4f242c3076bf704704739a0be7c3febfbae9a5daf23cd017c7e19fb107bb67d0f6fd6837cd2757d1fab34f4f05e37dde630b1c3a91edf4f7159103d6eb7da65fdbdf59dadb5e2460ac876ed9e1c8c060f9efe9c8a0a75cfc42d5742d2ee5a7e9dbb494b6d6b9bc930cce4f940e3cd81ed4160e98f88315e689fff0022b57664199cc5196f0c7a164ef8f98cd0589baffa68590985eb15c0db1985839f6c2919340b69d03f5285bdd6f4bf021424db4329cb153fccc3d09c76a090d3340d2f479a7bab3b38e2924e5e451cfd280d7dafe936f6c5e4bd89813b02a36589ce318a0358dc35cc4e17f9bf234cdbb78fa0c607a7340e6cec20b1596610c6934b8323226379edda81da8dcb9ec40a042f50b5bb21645473b58b11dbd7bfca8304f8add5d67a9ea8ba5d8ea72c1a4d8a952f10f2c920e368cf71e99fad5833dd0754d6ed66bdb2e9a91a5babb2a310465a57c1ddc1038e7bd5171d3748b8d46ee1ff005298dc6a764c27d4eeaee7fe1c01795881c9e7804fe940dbe287c4b6d75a1b1d1c986d62277c91bf131f4c0f6fad0663737135d3b497124924871f98e7803007d2811dc5b83903dc0a0333f03be7de8122df2c9a05a11e5f51f7a05ce7071804fca8033e5da0734020b0183bb23e5416269577ed0e5323078ceeefdff6a03dbcd62914c2f629a47c622689800879e4fbd046f9d8a2a03e31385c0e73da8b83ca590947dcaead8208e73da8849b3e19ce704f7c5015586d006431f5cf61f3a04ee586ff002481c8fe6191408f0011eb8e30682774dea9bbb5784492ca6385832e1ca95e3d2834be9df8c312e2db5eb4375080337000f1303d18763591a469baef4d755989ec6f6dae5a23e20b599406dd8e080ddbed41272f4dd8caf1c86d163910f9595882a3d718a035edd695d3b6a926b57d0ac65b10b4e06eedd863bf141077fd7af2782bd3fa26a1a8891d57c630948c0279393dcd04cf5875258f4de9f0cb7b7b6d66d2b81ba752d85f5214724fed41036bd79d2fe319d7a8f4b9c81e58de2f04827b9ce09a07a3acecf54b790685ace8697606009e52c377b7f2e682b097d7d36acf0f55df5edbdc0977412468cb6ce3be10af3c63b9c8a0b0751f505be9690dd5d752436f62a3fe4c6448f3b7b0c64e38f615734651f107e3045ac42b67a7693018633b965bc1bc838ee173807bf7cd33065baaeb1a95f2c11dfcd2bc51fe48880aa3e8a062a8b059f595df4ae9a74de9e9ec499d43c97b1427c6e47e525bb63e4282ad3ea3712893c599dbc4259c1627713c927de81043950df97db1406da8411c92063be280230839627078e79a0390a71b5bb5003a8c1232338e4507025573e9fbd02a0e41dc0e680c3691cf714053bb34160895dc16f291d98d02322aa39f3e14707ffaa06f202a5bb0c7201f4a343aca51090497efdfbfce89840c8db8e46573923ff14410b00490d9f5c1a0425dd8ce4673e873cd0265e4dbe7041ed814009b8cbb8e5863bd07163b7716e0607b6698060b96b7b9478dc8643918247ee39a60b7e97f133a8b4e0c63d4ee597380923970a3ef4c0e13e25dfcfab457ba95bdbddb212016501867b9cfbfda982f907c74b282da34874a9048aa479c83838edc62982b7ac7c42d235cd67f15ac5b40c366418a2cb0c1c81e6f5e31db14c160d035de8cd4a3f18ea96562cc37359dfe9cac887fef039fd6b39446f56ea5d13a9dca4579a922496b1975b8d22dfc3566cf9557230703be715ac1431d4d2275325d7fae6b4f6f182a93ef1e32a9f41938f6a60afeb1a95c5fea53dccf772cf2c8c489240031f627e7565c0d67bbf160487c1801073bc0c31f91f953420f2bc8c7c52cc540032738a809905c0f4fa501940208e73df34028e703938a0577ae013f4a001300db4f03b71407461ce0502dca8c9c7dcf6a003fafcbdcd0070bc1e0fd734070db467b8a04cb9c9e68274b93bcb1daa40200ed4099765249ec476cf340849b8b264823bf34689ee009cb671df1409bc8e8b8e770e3ec68984d9c953cf97be2860b248caaebc107dc67f7a184c31232db88fd451031ce50e76039f5c8045026efb8f93279e0fd680b239504f0483d88ef409ee25bb90c79c0e050151c6e21b39ce783eb40adbcc2cefa17bdb61322387781c950e3dbdf9c8a066f28790b22e013db3dbef54726081e63c6460d34191b1bb0720f634060e7600412c781502409c8e3d7b500ed71dbef8ed40243f181c0a02e5d4e0fad006f644e4819e3b501f7e3049e7b501bc43b4e391da80558003392d40a23305e320d02e64cf998e1bf5a032b0c927b8e68049c8c8e71c6280377043118f4e680bbff00de0504ddbb3128371c1c64668024e59f3cd02521254e4fad1a2107e48fe6a6809ddb9e78a029e1463d05027ffc744a6c3857c7b1a205ff00e637fbf4a02b12b1794e39f4a02024e7249ed409924720906800005173fd7404989698ee39e4f7a04cf723d07a501fff0097ed406ffe36a018ff00281e99a037f4d0731f3bfd28007e53400ff99a810248c0cf140bc60123233cff008a0557f9beb4056eff007a07109243e79a03778b27bfbd02b128c27039a054001b818a06609de793da815006070283ffd9}\\par}\n{\\pard \\ql \\f0 \\sa0 \\li0 \\fi0 lalune\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here is a movie {\\pict\\jpegblip\\picw20\\pich22\\picwgoal400\\pichgoal440 ffd8ffe000104a46494600010101004800480000fffe0050546869732061727420697320696e20746865207075626c696320646f6d61696e2e204b6576696e204875676865732c206b6576696e68406569742e636f6d2c2053657074656d6265722031393935ffdb00430001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffdb00430101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffc00011080016001403012200021101031101ffc4001a000100020301000000000000000000000000080905060a07ffc400231000010501000300010500000000000000060304050708020001090a11153976b7ffc400160101010100000000000000000000000000060800ffc400261101000102050109000000000000000000010200030405061121b33134365154717475b4ffda000c03010002110311003f00a90cf388f366a62aa720ed6ae07f96901f3831d973452b8cf36fe3570fc908e46d466433e5dd954f2e96992d9e498c7753faa44916e016ca91cc7d88b38fe60a5b97737defcbcc539c98d336a57f4fc2ca9a486bf07ab575ad9a3af4df221d8215e36df86c4504ff0024574551b3d687ee0575757b3ad64e311ee62bd94158d37e24198c43973099f1fc0c41614d950246513a081abf76cfe7061f6863281e6352fd1670949c148dd6dfb0d25f5b3689b1d5c965b0eacbf4e0932ad28e22ab9ae945633f4744bd3c8cee0a7fdf085b9000f449c5f7afa30b83e0b6fd7b0c8429c9467ff9715347c891e25fa24a205861aa715e6a09bd0488237dc2723414d9891381524e8ca7c0894664f835653631ab55ee7e3de433e4ff001b30949124e4c10c8b6ad0a479b3f9c937b2cf5bc0095ad600a0a41a0e9faee174a1c605e161c6c7a313539650b0113190f1a8368e60d5b24f30ff008ea7f0bf867fa6595feeb6978f1fe0f9c26177f4d63a51a9235184750e7d18811339cd000000c75f000e00380380ae390c350def826ed42ad051fa6f501c50f9b699c3b69cbeb76476d202bf3ac985b6e0e968be66572893e6a744540bd9722e5c87956848629bc2559306bd113e8653d3b6aff651dfad7a3ac8b02958cba02a93ccf525757039bae6cff090e1d90688e8aa233ee86a4c4a3e0586d6b2340522e47dcb7d0046d8a5acb05a123ee25d2b230b2ada6e2e2f9ede3c05202520ec2487b0d56562529d8b3393bca76adca4ec1bca508abb001babc007915d84fe3dd14e207e3c62f8379da2a3b861fb6629d28dba53b6ea388ebfed866bf6dfb553455e91ed547ae92e9445253a4fdf3efb4f8ebdfbe7d3c78f1ee0bb9e13e358e942a4ed49e22cff00eeb35fdd7ebfffd9} icon.\\par}\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\emdash\\emdash\\emdash\\emdash\\emdash\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\outlinelevel0 \\b \\fs36 Footnotes\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here is a footnote reference,{\\super\\chftn}{\\*\\footnote\\chftn\\~\\plain\\pard {\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\\par}\n} and another.{\\super\\chftn}{\\*\\footnote\\chftn\\~\\plain\\pard {\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Here\\u8217's the long note. This one contains multiple blocks.\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 Subsequent blocks are indented to show that they belong to the footnote (as with list items).\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\f1   \\{ <code> \\}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.\\par}\n} This should {\\i not} be a footnote reference, because it contains a space.[^my note] Here is an inline note.{\\super\\chftn}{\\*\\footnote\\chftn\\~\\plain\\pard {\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This is {\\i easier} to type. Inline notes may contain {\\field{\\*\\fldinst{HYPERLINK \"http://google.com\"}}{\\fldrslt{\\ul\nlinks\n}}}\n and {\\f1 ]} verbatim characters, as well as [bracketed text].\\par}\n}\\par}\n{\\pard \\ql \\f0 \\sa180 \\li720 \\fi0 Notes can go in quotes.{\\super\\chftn}{\\*\\footnote\\chftn\\~\\plain\\pard {\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 In quote.\\par}\n}\\par}\n{\\pard \\ql \\f0 \\sa0 \\li360 \\fi-360 1.\\tx360\\tab And in list items.{\\super\\chftn}{\\*\\footnote\\chftn\\~\\plain\\pard {\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 In list.\\par}\n}\\sa180\\par}\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 This paragraph should not be part of the note, as it is not indented.\\par}\n}\n"
  },
  {
    "path": "test/writer.tei",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TEI xmlns=\"http://www.tei-c.org/ns/1.0\">\n<teiHeader>\n  <fileDesc>\n    <titleStmt>\n      <title>Pandoc Test Suite</title>\n      <author>John MacFarlane</author>\n      <author>Anonymous</author>\n    </titleStmt>\n    <publicationStmt>\n      <date>July 17, 2006</date>\n    </publicationStmt>\n    <sourceDesc>\n      <p>Produced by pandoc.</p>\n    </sourceDesc>\n  </fileDesc>\n</teiHeader>\n<text>\n<body>\n<p>This is a set of tests for pandoc. Most of them are adapted from John\nGruber’s markdown test suite.</p>\n<milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n<div type=\"level1\" xml:id=\"headers\">\n  <head>Headers</head>\n  <div type=\"level2\" xml:id=\"level-2-with-an-embedded-link\">\n    <head>Level 2 with an <ref target=\"/url\">embedded link</ref></head>\n    <div type=\"level3\" xml:id=\"level-3-with-emphasis\">\n      <head>Level 3 with <hi rendition=\"simple:italic\">emphasis</hi></head>\n      <div type=\"level4\" xml:id=\"level-4\">\n        <head>Level 4</head>\n        <div type=\"level5\" xml:id=\"level-5\">\n          <head>Level 5</head>\n          <p></p>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n<div type=\"level1\" xml:id=\"level-1\">\n  <head>Level 1</head>\n  <div type=\"level2\" xml:id=\"level-2-with-emphasis\">\n    <head>Level 2 with <hi rendition=\"simple:italic\">emphasis</hi></head>\n    <div type=\"level3\" xml:id=\"level-3\">\n      <head>Level 3</head>\n      <p>with no blank line</p>\n    </div>\n  </div>\n  <div type=\"level2\" xml:id=\"level-2\">\n    <head>Level 2</head>\n    <p>with no blank line</p>\n    <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n  </div>\n</div>\n<div type=\"level1\" xml:id=\"paragraphs\">\n  <head>Paragraphs</head>\n  <p>Here’s a regular paragraph.</p>\n  <p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\n  Because a hard-wrapped line in the middle of a paragraph looked like a list\n  item.</p>\n  <p>Here’s one with a bullet. * criminey.</p>\n  <p>There should be a hard line break<lb />here.</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"block-quotes\">\n  <head>Block Quotes</head>\n  <p>E-mail style:</p>\n  <quote>\n    <p>This is a block quote. It is pretty short.</p>\n  </quote>\n  <quote>\n    <p>Code in a block quote:</p>\n    <ab type='codeblock '>\nsub status {\n    print &quot;working&quot;;\n}\n</ab>\n    <p>A list:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>item one</p>\n      </item>\n      <item>\n        <p>item two</p>\n      </item>\n    </list>\n    <p>Nested block quotes:</p>\n    <quote>\n      <p>nested</p>\n    </quote>\n    <quote>\n      <p>nested</p>\n    </quote>\n  </quote>\n  <p>This should not be a block quote: 2 &gt; 1.</p>\n  <p>And a following paragraph.</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"code-blocks\">\n  <head>Code Blocks</head>\n  <p>Code:</p>\n  <ab type='codeblock '>\n---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab\n</ab>\n  <p>And:</p>\n  <ab type='codeblock '>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{\n</ab>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"lists\">\n  <head>Lists</head>\n  <div type=\"level2\" xml:id=\"unordered\">\n    <head>Unordered</head>\n    <p>Asterisks tight:</p>\n    <list type=\"unordered\">\n      <item>\n        <p>asterisk 1</p>\n      </item>\n      <item>\n        <p>asterisk 2</p>\n      </item>\n      <item>\n        <p>asterisk 3</p>\n      </item>\n    </list>\n    <p>Asterisks loose:</p>\n    <list type=\"unordered\">\n      <item>\n        <p>asterisk 1</p>\n      </item>\n      <item>\n        <p>asterisk 2</p>\n      </item>\n      <item>\n        <p>asterisk 3</p>\n      </item>\n    </list>\n    <p>Pluses tight:</p>\n    <list type=\"unordered\">\n      <item>\n        <p>Plus 1</p>\n      </item>\n      <item>\n        <p>Plus 2</p>\n      </item>\n      <item>\n        <p>Plus 3</p>\n      </item>\n    </list>\n    <p>Pluses loose:</p>\n    <list type=\"unordered\">\n      <item>\n        <p>Plus 1</p>\n      </item>\n      <item>\n        <p>Plus 2</p>\n      </item>\n      <item>\n        <p>Plus 3</p>\n      </item>\n    </list>\n    <p>Minuses tight:</p>\n    <list type=\"unordered\">\n      <item>\n        <p>Minus 1</p>\n      </item>\n      <item>\n        <p>Minus 2</p>\n      </item>\n      <item>\n        <p>Minus 3</p>\n      </item>\n    </list>\n    <p>Minuses loose:</p>\n    <list type=\"unordered\">\n      <item>\n        <p>Minus 1</p>\n      </item>\n      <item>\n        <p>Minus 2</p>\n      </item>\n      <item>\n        <p>Minus 3</p>\n      </item>\n    </list>\n  </div>\n  <div type=\"level2\" xml:id=\"ordered\">\n    <head>Ordered</head>\n    <p>Tight:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>First</p>\n      </item>\n      <item>\n        <p>Second</p>\n      </item>\n      <item>\n        <p>Third</p>\n      </item>\n    </list>\n    <p>and:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>One</p>\n      </item>\n      <item>\n        <p>Two</p>\n      </item>\n      <item>\n        <p>Three</p>\n      </item>\n    </list>\n    <p>Loose using tabs:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>First</p>\n      </item>\n      <item>\n        <p>Second</p>\n      </item>\n      <item>\n        <p>Third</p>\n      </item>\n    </list>\n    <p>and using spaces:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>One</p>\n      </item>\n      <item>\n        <p>Two</p>\n      </item>\n      <item>\n        <p>Three</p>\n      </item>\n    </list>\n    <p>Multiple paragraphs:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>Item 1, graf one.</p>\n        <p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s\n        back.</p>\n      </item>\n      <item>\n        <p>Item 2.</p>\n      </item>\n      <item>\n        <p>Item 3.</p>\n      </item>\n    </list>\n  </div>\n  <div type=\"level2\" xml:id=\"nested\">\n    <head>Nested</head>\n    <list type=\"unordered\">\n      <item>\n        <p>Tab</p>\n        <list type=\"unordered\">\n          <item>\n            <p>Tab</p>\n            <list type=\"unordered\">\n              <item>\n                <p>Tab</p>\n              </item>\n            </list>\n          </item>\n        </list>\n      </item>\n    </list>\n    <p>Here’s another:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>First</p>\n      </item>\n      <item>\n        <p>Second:</p>\n        <list type=\"unordered\">\n          <item>\n            <p>Fee</p>\n          </item>\n          <item>\n            <p>Fie</p>\n          </item>\n          <item>\n            <p>Foe</p>\n          </item>\n        </list>\n      </item>\n      <item>\n        <p>Third</p>\n      </item>\n    </list>\n    <p>Same thing but with paragraphs:</p>\n    <list type=\"ordered:arabic\">\n      <item>\n        <p>First</p>\n      </item>\n      <item>\n        <p>Second:</p>\n        <list type=\"unordered\">\n          <item>\n            <p>Fee</p>\n          </item>\n          <item>\n            <p>Fie</p>\n          </item>\n          <item>\n            <p>Foe</p>\n          </item>\n        </list>\n      </item>\n      <item>\n        <p>Third</p>\n      </item>\n    </list>\n  </div>\n  <div type=\"level2\" xml:id=\"tabs-and-spaces\">\n    <head>Tabs and spaces</head>\n    <list type=\"unordered\">\n      <item>\n        <p>this is a list item indented with tabs</p>\n      </item>\n      <item>\n        <p>this is a list item indented with spaces</p>\n        <list type=\"unordered\">\n          <item>\n            <p>this is an example list item indented with tabs</p>\n          </item>\n          <item>\n            <p>this is an example list item indented with spaces</p>\n          </item>\n        </list>\n      </item>\n    </list>\n  </div>\n  <div type=\"level2\" xml:id=\"fancy-list-markers\">\n    <head>Fancy list markers</head>\n    <list type=\"ordered:arabic\">\n      <item n=\"2\">\n        <p>begins with 2</p>\n      </item>\n      <item>\n        <p>and now 3</p>\n        <p>with a continuation</p>\n        <list type=\"ordered:lowerroman\">\n          <item n=\"4\">\n            <p>sublist with roman numerals, starting with 4</p>\n          </item>\n          <item>\n            <p>more items</p>\n            <list type=\"ordered:upperalpha\">\n              <item>\n                <p>a subsublist</p>\n              </item>\n              <item>\n                <p>a subsublist</p>\n              </item>\n            </list>\n          </item>\n        </list>\n      </item>\n    </list>\n    <p>Nesting:</p>\n    <list type=\"ordered:upperalpha\">\n      <item>\n        <p>Upper Alpha</p>\n        <list type=\"ordered:upperroman\">\n          <item>\n            <p>Upper Roman.</p>\n            <list type=\"ordered:arabic\">\n              <item n=\"6\">\n                <p>Decimal start with 6</p>\n                <list type=\"ordered:loweralpha\">\n                  <item n=\"3\">\n                    <p>Lower alpha with paren</p>\n                  </item>\n                </list>\n              </item>\n            </list>\n          </item>\n        </list>\n      </item>\n    </list>\n    <p>Autonumbering:</p>\n    <list>\n      <item>\n        <p>Autonumber.</p>\n      </item>\n      <item>\n        <p>More.</p>\n        <list>\n          <item>\n            <p>Nested.</p>\n          </item>\n        </list>\n      </item>\n    </list>\n    <p>Should not be a list item:</p>\n    <p>M.A. 2007</p>\n    <p>B. Williams</p>\n    <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n  </div>\n</div>\n<div type=\"level1\" xml:id=\"definition-lists\">\n  <head>Definition Lists</head>\n  <p>Tight using spaces:</p>\n  <list type=\"definition\">\n    <label>\n      apple\n    </label>\n    <item>\n      <p>red fruit</p>\n    </item>\n    <label>\n      orange\n    </label>\n    <item>\n      <p>orange fruit</p>\n    </item>\n    <label>\n      banana\n    </label>\n    <item>\n      <p>yellow fruit</p>\n    </item>\n  </list>\n  <p>Tight using tabs:</p>\n  <list type=\"definition\">\n    <label>\n      apple\n    </label>\n    <item>\n      <p>red fruit</p>\n    </item>\n    <label>\n      orange\n    </label>\n    <item>\n      <p>orange fruit</p>\n    </item>\n    <label>\n      banana\n    </label>\n    <item>\n      <p>yellow fruit</p>\n    </item>\n  </list>\n  <p>Loose:</p>\n  <list type=\"definition\">\n    <label>\n      apple\n    </label>\n    <item>\n      <p>red fruit</p>\n    </item>\n    <label>\n      orange\n    </label>\n    <item>\n      <p>orange fruit</p>\n    </item>\n    <label>\n      banana\n    </label>\n    <item>\n      <p>yellow fruit</p>\n    </item>\n  </list>\n  <p>Multiple blocks with italics:</p>\n  <list type=\"definition\">\n    <label>\n      <hi rendition=\"simple:italic\">apple</hi>\n    </label>\n    <item>\n      <p>red fruit</p>\n      <p>contains seeds, crisp, pleasant to taste</p>\n    </item>\n    <label>\n      <hi rendition=\"simple:italic\">orange</hi>\n    </label>\n    <item>\n      <p>orange fruit</p>\n      <ab type='codeblock '>\n{ orange code block }\n</ab>\n      <quote>\n        <p>orange block quote</p>\n      </quote>\n    </item>\n  </list>\n  <p>Multiple definitions, tight:</p>\n  <list type=\"definition\">\n    <label>\n      apple\n    </label>\n    <item>\n      <p>red fruit</p>\n      <p>computer</p>\n    </item>\n    <label>\n      orange\n    </label>\n    <item>\n      <p>orange fruit</p>\n      <p>bank</p>\n    </item>\n  </list>\n  <p>Multiple definitions, loose:</p>\n  <list type=\"definition\">\n    <label>\n      apple\n    </label>\n    <item>\n      <p>red fruit</p>\n      <p>computer</p>\n    </item>\n    <label>\n      orange\n    </label>\n    <item>\n      <p>orange fruit</p>\n      <p>bank</p>\n    </item>\n  </list>\n  <p>Blank line after term, indented marker, alternate markers:</p>\n  <list type=\"definition\">\n    <label>\n      apple\n    </label>\n    <item>\n      <p>red fruit</p>\n      <p>computer</p>\n    </item>\n    <label>\n      orange\n    </label>\n    <item>\n      <p>orange fruit</p>\n      <list type=\"ordered:arabic\">\n        <item>\n          <p>sublist</p>\n        </item>\n        <item>\n          <p>sublist</p>\n        </item>\n      </list>\n    </item>\n  </list>\n</div>\n<div type=\"level1\" xml:id=\"html-blocks\">\n  <head>HTML Blocks</head>\n  <p>Simple block on one line:</p>\n  <p>foo</p>\n  <p>And nested without indentation:</p>\n  <p>foo</p>\n  <p>bar</p>\n  <p>Interpreted markdown in a table:</p>\n  <p>This is <hi rendition=\"simple:italic\">emphasized</hi></p>\n  <p>And this is <hi rendition=\"simple:bold\">strong</hi></p>\n  <p>Here’s a simple block:</p>\n  <p>foo</p>\n  <p>This should be a code block, though:</p>\n  <ab type='codeblock '>\n&lt;div&gt;\n    foo\n&lt;/div&gt;\n</ab>\n  <p>As should this:</p>\n  <ab type='codeblock '>\n&lt;div&gt;foo&lt;/div&gt;\n</ab>\n  <p>Now, nested:</p>\n  <p>foo</p>\n  <p>This should just be an HTML comment:</p>\n  <p>Multiline:</p>\n  <p>Code block:</p>\n  <ab type='codeblock '>\n&lt;!-- Comment --&gt;\n</ab>\n  <p>Just plain comment, with trailing spaces on the line:</p>\n  <p>Code:</p>\n  <ab type='codeblock '>\n&lt;hr /&gt;\n</ab>\n  <p>Hr’s:</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"inline-markup\">\n  <head>Inline Markup</head>\n  <p>This is <hi rendition=\"simple:italic\">emphasized</hi>, and so\n  <hi rendition=\"simple:italic\">is this</hi>.</p>\n  <p>This is <hi rendition=\"simple:bold\">strong</hi>, and so\n  <hi rendition=\"simple:bold\">is this</hi>.</p>\n  <p>An <hi rendition=\"simple:italic\"><ref target=\"/url\">emphasized\n  link</ref></hi>.</p>\n  <p><hi rendition=\"simple:bold\"><hi rendition=\"simple:italic\">This is strong\n  and em.</hi></hi></p>\n  <p>So is\n  <hi rendition=\"simple:bold\"><hi rendition=\"simple:italic\">this</hi></hi>\n  word.</p>\n  <p><hi rendition=\"simple:bold\"><hi rendition=\"simple:italic\">This is strong\n  and em.</hi></hi></p>\n  <p>So is\n  <hi rendition=\"simple:bold\"><hi rendition=\"simple:italic\">this</hi></hi>\n  word.</p>\n  <p>This is code: <seg type=\"code\">&gt;</seg>, <seg type=\"code\">$</seg>,\n  <seg type=\"code\">\\</seg>, <seg type=\"code\">\\$</seg>,\n  <seg type=\"code\">&lt;html&gt;</seg>.</p>\n  <p><hi rendition=\"simple:strikethrough\">This is\n  <hi rendition=\"simple:italic\">strikeout</hi>.</hi></p>\n  <p>Superscripts: a<hi rendition=\"simple:superscript\">bc</hi>d\n  a<hi rendition=\"simple:superscript\"><hi rendition=\"simple:italic\">hello</hi></hi>\n  a<hi rendition=\"simple:superscript\">hello there</hi>.</p>\n  <p>Subscripts: H<hi rendition=\"simple:subscript\">2</hi>O,\n  H<hi rendition=\"simple:subscript\">23</hi>O,\n  H<hi rendition=\"simple:subscript\">many of them</hi>O.</p>\n  <p>These should not be superscripts or subscripts, because of the unescaped\n  spaces: a^b c^d, a~b c~d.</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"smart-quotes-ellipses-dashes\">\n  <head>Smart quotes, ellipses, dashes</head>\n  <p><quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my\n  name.</quote></p>\n  <p><quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are letters.</p>\n  <p><quote>Oak,</quote> <quote>elm,</quote> and <quote>beech</quote> are names\n  of trees. So is <quote>pine.</quote></p>\n  <p><quote>He said, <quote>I want to go.</quote></quote> Were you alive in the\n  70’s?</p>\n  <p>Here is some quoted <quote><seg type=\"code\">code</seg></quote> and a\n  <quote><ref target=\"http://example.com/?foo=1&amp;bar=2\">quoted\n  link</ref></quote>.</p>\n  <p>Some dashes: one—two — three—four — five.</p>\n  <p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>\n  <p>Ellipses…and…and….</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"latex\">\n  <head>LaTeX</head>\n  <list type=\"unordered\">\n    <item>\n      <p></p>\n    </item>\n    <item>\n      <p><formula notation=\"TeX\">2+2=4</formula></p>\n    </item>\n    <item>\n      <p><formula notation=\"TeX\">x \\in y</formula></p>\n    </item>\n    <item>\n      <p><formula notation=\"TeX\">\\alpha \\wedge \\omega</formula></p>\n    </item>\n    <item>\n      <p><formula notation=\"TeX\">223</formula></p>\n    </item>\n    <item>\n      <p><formula notation=\"TeX\">p</formula>-Tree</p>\n    </item>\n    <item>\n      <p>Here’s some display math: <figure type=\"math\">\n        <formula notation=\"TeX\">\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}</formula>\n      </figure></p>\n    </item>\n    <item>\n      <p>Here’s one that has a line break in it:\n      <formula notation=\"TeX\">\\alpha + \\omega \\times x^2</formula>.</p>\n    </item>\n  </list>\n  <p>These shouldn’t be math:</p>\n  <list type=\"unordered\">\n    <item>\n      <p>To get the famous equation, write\n      <seg type=\"code\">$e = mc^2$</seg>.</p>\n    </item>\n    <item>\n      <p>$22,000 is a <hi rendition=\"simple:italic\">lot</hi> of money. So is\n      $34,000. (It worked if <quote>lot</quote> is emphasized.)</p>\n    </item>\n    <item>\n      <p>Shoes ($20) and socks ($5).</p>\n    </item>\n    <item>\n      <p>Escaped <seg type=\"code\">$</seg>: $73\n      <hi rendition=\"simple:italic\">this should be emphasized</hi> 23$.</p>\n    </item>\n  </list>\n  <p>Here’s a LaTeX table:</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"special-characters\">\n  <head>Special Characters</head>\n  <p>Here is some unicode:</p>\n  <list type=\"unordered\">\n    <item>\n      <p>I hat: Î</p>\n    </item>\n    <item>\n      <p>o umlaut: ö</p>\n    </item>\n    <item>\n      <p>section: §</p>\n    </item>\n    <item>\n      <p>set membership: ∈</p>\n    </item>\n    <item>\n      <p>copyright: ©</p>\n    </item>\n  </list>\n  <p>AT&amp;T has an ampersand in their name.</p>\n  <p>AT&amp;T is another way to write it.</p>\n  <p>This &amp; that.</p>\n  <p>4 &lt; 5.</p>\n  <p>6 &gt; 5.</p>\n  <p>Backslash: \\</p>\n  <p>Backtick: `</p>\n  <p>Asterisk: *</p>\n  <p>Underscore: _</p>\n  <p>Left brace: {</p>\n  <p>Right brace: }</p>\n  <p>Left bracket: [</p>\n  <p>Right bracket: ]</p>\n  <p>Left paren: (</p>\n  <p>Right paren: )</p>\n  <p>Greater-than: &gt;</p>\n  <p>Hash: #</p>\n  <p>Period: .</p>\n  <p>Bang: !</p>\n  <p>Plus: +</p>\n  <p>Minus: -</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"links\">\n  <head>Links</head>\n  <div type=\"level2\" xml:id=\"explicit\">\n    <head>Explicit</head>\n    <p>Just a <ref target=\"/url/\">URL</ref>.</p>\n    <p><ref target=\"/url/\">URL and title</ref>.</p>\n    <p><ref target=\"/url/\">URL and title</ref>.</p>\n    <p><ref target=\"/url/\">URL and title</ref>.</p>\n    <p><ref target=\"/url/\">URL and title</ref></p>\n    <p><ref target=\"/url/\">URL and title</ref></p>\n    <p><ref target=\"/url/with_underscore\">with_underscore</ref></p>\n    <p>Email link (nobody@nowhere.net)</p>\n    <p><ref target=\"\">Empty</ref>.</p>\n  </div>\n  <div type=\"level2\" xml:id=\"reference\">\n    <head>Reference</head>\n    <p>Foo <ref target=\"/url/\">bar</ref>.</p>\n    <p>With <ref target=\"/url/\">embedded [brackets]</ref>.</p>\n    <p><ref target=\"/url/\">b</ref> by itself should be a link.</p>\n    <p>Indented <ref target=\"/url\">once</ref>.</p>\n    <p>Indented <ref target=\"/url\">twice</ref>.</p>\n    <p>Indented <ref target=\"/url\">thrice</ref>.</p>\n    <p>This should [not][] be a link.</p>\n    <ab type='codeblock '>\n[not]: /url\n</ab>\n    <p>Foo <ref target=\"/url/\">bar</ref>.</p>\n    <p>Foo <ref target=\"/url/\">biz</ref>.</p>\n  </div>\n  <div type=\"level2\" xml:id=\"with-ampersands\">\n    <head>With ampersands</head>\n    <p>Here’s a <ref target=\"http://example.com/?foo=1&amp;bar=2\">link with an\n    ampersand in the URL</ref>.</p>\n    <p>Here’s a link with an amersand in the link text:\n    <ref target=\"http://att.com/\">AT&amp;T</ref>.</p>\n    <p>Here’s an <ref target=\"/script?foo=1&amp;bar=2\">inline link</ref>.</p>\n    <p>Here’s an <ref target=\"/script?foo=1&amp;bar=2\">inline link in pointy\n    braces</ref>.</p>\n  </div>\n  <div type=\"level2\" xml:id=\"autolinks\">\n    <head>Autolinks</head>\n    <p>With an ampersand:\n    <ref target=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</ref></p>\n    <list type=\"unordered\">\n      <item>\n        <p>In a list?</p>\n      </item>\n      <item>\n        <p><ref target=\"http://example.com/\">http://example.com/</ref></p>\n      </item>\n      <item>\n        <p>It should.</p>\n      </item>\n    </list>\n    <p>An e-mail address: nobody@nowhere.net</p>\n    <quote>\n      <p>Blockquoted:\n      <ref target=\"http://example.com/\">http://example.com/</ref></p>\n    </quote>\n    <p>Auto-links should not occur here:\n    <seg type=\"code\">&lt;http://example.com/&gt;</seg></p>\n    <ab type='codeblock '>\nor here: &lt;http://example.com/&gt;\n</ab>\n    <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n  </div>\n</div>\n<div type=\"level1\" xml:id=\"images\">\n  <head>Images</head>\n  <p>From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):</p>\n  <p><figure>\n    <head>lalune</head>\n    <graphic url=\"lalune.jpg\" />\n    <figDesc>Voyage dans la Lune</figDesc>\n  </figure></p>\n  <p>lalune</p>\n  <p>Here is a movie <figure>\n    <head>movie</head>\n    <graphic url=\"movie.jpg\" />\n  </figure> icon.</p>\n  <milestone unit=\"undefined\" type=\"separator\" rendition=\"line\" />\n</div>\n<div type=\"level1\" xml:id=\"footnotes\">\n  <head>Footnotes</head>\n  <p>Here is a footnote reference,<note>\n    <p>Here is the footnote. It can go anywhere after the footnote reference. It\n    need not be placed at the end of the document.</p>\n  </note> and another.<note>\n    <p>Here’s the long note. This one contains multiple blocks.</p>\n    <p>Subsequent blocks are indented to show that they belong to the footnote\n    (as with list items).</p>\n    <ab type='codeblock '>\n  { &lt;code&gt; }\n</ab>\n    <p>If you want, you can indent every line, but you can also be lazy and just\n    indent the first line of each block.</p>\n  </note> This should <hi rendition=\"simple:italic\">not</hi> be a footnote\n  reference, because it contains a space.[^my note] Here is an inline\n  note.<note>\n    <p>This is <hi rendition=\"simple:italic\">easier</hi> to type. Inline notes\n    may contain <ref target=\"http://google.com\">links</ref> and\n    <seg type=\"code\">]</seg> verbatim characters, as well as [bracketed\n    text].</p>\n  </note></p>\n  <quote>\n    <p>Notes can go in quotes.<note>\n      <p>In quote.</p>\n    </note></p>\n  </quote>\n  <list type=\"ordered:arabic\">\n    <item>\n      <p>And in list items.<note>\n        <p>In list.</p>\n      </note></p>\n    </item>\n  </list>\n  <p>This paragraph should not be part of the note, as it is not indented.</p>\n</div>\n</body>\n</text>\n</TEI>\n"
  },
  {
    "path": "test/writer.texinfo",
    "content": "\\input texinfo  @c -*-texinfo-*-\n@settitle Pandoc Test Suite\n\n@documentencoding UTF-8\n\n@macro textstrikeout{text}\n~~\\text\\~~\n@end macro\n\n@ifnottex\n@paragraphindent 0\n@end ifnottex\n@titlepage\n@title Pandoc Test Suite\n@author John MacFarlane\n@author Anonymous\nJuly 17, 2006\n@end titlepage\n\n@node Top\n@top Pandoc Test Suite\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@menu\n* Headers::\n* Level 1::\n* Paragraphs::\n* Block Quotes::\n* Code Blocks::\n* Lists::\n* Definition Lists::\n* HTML Blocks::\n* Inline Markup::\n* Smart quotes ellipses dashes::\n* LaTeX::\n* Special Characters::\n* Links::\n* Images::\n* Footnotes::\n@end menu\n\n@node Headers\n@chapter Headers\n\n@menu\n* Level 2 with an @uref{/url,embedded link}::\n@end menu\n\n@node Level 2 with an @uref{/url,embedded link}\n@section Level 2 with an @uref{/url,embedded link}\n\n@menu\n* Level 3 with @emph{emphasis}::\n@end menu\n\n@node Level 3 with @emph{emphasis}\n@subsection Level 3 with @emph{emphasis}\n\n@menu\n* Level 4::\n@end menu\n\n@node Level 4\n@subsubsection Level 4\nLevel 5\n\n@node Level 1\n@chapter Level 1\n\n@menu\n* Level 2 with @emph{emphasis}::\n* Level 2::\n@end menu\n\n@node Level 2 with @emph{emphasis}\n@section Level 2 with @emph{emphasis}\n\n@menu\n* Level 3::\n@end menu\n\n@node Level 3\n@subsection Level 3\nwith no blank line\n\n@node Level 2\n@section Level 2\nwith no blank line\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Paragraphs\n@chapter Paragraphs\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break@*\nhere.\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Block Quotes\n@chapter Block Quotes\nE-mail style:\n\n@quotation\nThis is a block quote. It is pretty short.\n@end quotation\n@quotation\nCode in a block quote:\n\n@verbatim\nsub status {\n    print \"working\";\n}\n@end verbatim\n\nA list:\n\n@enumerate \n@item\nitem one\n@item\nitem two\n@end enumerate\n\nNested block quotes:\n\n@quotation\nnested\n@end quotation\n@quotation\nnested\n@end quotation\n@end quotation\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Code Blocks\n@chapter Code Blocks\nCode:\n\n@verbatim\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n@end verbatim\n\nAnd:\n\n@verbatim\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n@end verbatim\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Lists\n@chapter Lists\n\n@menu\n* Unordered::\n* Ordered::\n* Nested::\n* Tabs and spaces::\n* Fancy list markers::\n@end menu\n\n@node Unordered\n@section Unordered\nAsterisks tight:\n\n@itemize\n@item\nasterisk 1\n@item\nasterisk 2\n@item\nasterisk 3\n@end itemize\n\nAsterisks loose:\n\n@itemize\n@item\nasterisk 1\n\n@item\nasterisk 2\n\n@item\nasterisk 3\n\n@end itemize\n\nPluses tight:\n\n@itemize\n@item\nPlus 1\n@item\nPlus 2\n@item\nPlus 3\n@end itemize\n\nPluses loose:\n\n@itemize\n@item\nPlus 1\n\n@item\nPlus 2\n\n@item\nPlus 3\n\n@end itemize\n\nMinuses tight:\n\n@itemize\n@item\nMinus 1\n@item\nMinus 2\n@item\nMinus 3\n@end itemize\n\nMinuses loose:\n\n@itemize\n@item\nMinus 1\n\n@item\nMinus 2\n\n@item\nMinus 3\n\n@end itemize\n\n@node Ordered\n@section Ordered\nTight:\n\n@enumerate \n@item\nFirst\n@item\nSecond\n@item\nThird\n@end enumerate\n\nand:\n\n@enumerate \n@item\nOne\n@item\nTwo\n@item\nThree\n@end enumerate\n\nLoose using tabs:\n\n@enumerate \n@item\nFirst\n\n@item\nSecond\n\n@item\nThird\n\n@end enumerate\n\nand using spaces:\n\n@enumerate \n@item\nOne\n\n@item\nTwo\n\n@item\nThree\n\n@end enumerate\n\nMultiple paragraphs:\n\n@enumerate \n@item\nItem 1, graf one.\n\nItem 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n@item\nItem 2.\n\n@item\nItem 3.\n\n@end enumerate\n\n@node Nested\n@section Nested\n@itemize\n@item\nTab\n@itemize\n@item\nTab\n@itemize\n@item\nTab\n@end itemize\n\n@end itemize\n\n@end itemize\n\nHere's another:\n\n@enumerate \n@item\nFirst\n@item\nSecond:\n@itemize\n@item\nFee\n@item\nFie\n@item\nFoe\n@end itemize\n\n@item\nThird\n@end enumerate\n\nSame thing but with paragraphs:\n\n@enumerate \n@item\nFirst\n\n@item\nSecond:\n\n@itemize\n@item\nFee\n@item\nFie\n@item\nFoe\n@end itemize\n\n@item\nThird\n\n@end enumerate\n\n@node Tabs and spaces\n@section Tabs and spaces\n@itemize\n@item\nthis is a list item indented with tabs\n\n@item\nthis is a list item indented with spaces\n\n@itemize\n@item\nthis is an example list item indented with tabs\n\n@item\nthis is an example list item indented with spaces\n\n@end itemize\n\n@end itemize\n\n@node Fancy list markers\n@section Fancy list markers\n@enumerate 2\n@item\nbegins with 2\n\n@item\nand now 3\n\nwith a continuation\n\n@enumerate 4\n@item\nsublist with roman numerals, starting with 4\n@item\nmore items\n@enumerate A\n@item\na subsublist\n@item\na subsublist\n@end enumerate\n\n@end enumerate\n\n@end enumerate\n\nNesting:\n\n@enumerate A\n@item\nUpper Alpha\n@enumerate \n@item\nUpper Roman.\n@enumerate 6\n@item\nDecimal start with 6\n@enumerate c\n@item\nLower alpha with paren\n@end enumerate\n\n@end enumerate\n\n@end enumerate\n\n@end enumerate\n\nAutonumbering:\n\n@enumerate \n@item\nAutonumber.\n@item\nMore.\n@enumerate \n@item\nNested.\n@end enumerate\n\n@end enumerate\n\nShould not be a list item:\n\nM.A.@ 2007\n\nB. Williams\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Definition Lists\n@chapter Definition Lists\nTight using spaces:\n\n@table @asis\n@item apple\n\nred fruit\n@item orange\n\norange fruit\n@item banana\n\nyellow fruit\n@end table\n\nTight using tabs:\n\n@table @asis\n@item apple\n\nred fruit\n@item orange\n\norange fruit\n@item banana\n\nyellow fruit\n@end table\n\nLoose:\n\n@table @asis\n@item apple\n\nred fruit\n\n@item orange\n\norange fruit\n\n@item banana\n\nyellow fruit\n\n@end table\n\nMultiple blocks with italics:\n\n@table @asis\n@item @emph{apple}\n\nred fruit\n\ncontains seeds, crisp, pleasant to taste\n\n@item @emph{orange}\n\norange fruit\n\n@verbatim\n{ orange code block }\n@end verbatim\n\n@quotation\norange block quote\n@end quotation\n@end table\n\nMultiple definitions, tight:\n\n@table @asis\n@item apple\n\nred fruit\ncomputer\n@item orange\n\norange fruit\nbank\n@end table\n\nMultiple definitions, loose:\n\n@table @asis\n@item apple\n\nred fruit\n\ncomputer\n\n@item orange\n\norange fruit\n\nbank\n\n@end table\n\nBlank line after term, indented marker, alternate markers:\n\n@table @asis\n@item apple\n\nred fruit\n\ncomputer\n\n@item orange\n\norange fruit\n\n@enumerate \n@item\nsublist\n@item\nsublist\n@end enumerate\n\n@end table\n\n@node HTML Blocks\n@chapter HTML Blocks\nSimple block on one line:\n\nfoo\nAnd nested without indentation:\n\nfoo\nbar\nInterpreted markdown in a table:\n\nThis is @emph{emphasized}\nAnd this is @strong{strong}\nHere's a simple block:\n\nfoo\nThis should be a code block, though:\n\n@verbatim\n<div>\n    foo\n</div>\n@end verbatim\n\nAs should this:\n\n@verbatim\n<div>foo</div>\n@end verbatim\n\nNow, nested:\n\nfoo\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n@verbatim\n<!-- Comment -->\n@end verbatim\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n@verbatim\n<hr />\n@end verbatim\n\nHr's:\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Inline Markup\n@chapter Inline Markup\nThis is @emph{emphasized}, and so @emph{is this}.\n\nThis is @strong{strong}, and so @strong{is this}.\n\nAn @emph{@uref{/url,emphasized link}}.\n\n@strong{@emph{This is strong and em.}}\n\nSo is @strong{@emph{this}} word.\n\n@strong{@emph{This is strong and em.}}\n\nSo is @strong{@emph{this}} word.\n\nThis is code: @code{>}, @code{$}, @code{\\}, @code{\\$}, @code{<html>}.\n\n@textstrikeout{This is @emph{strikeout}.}\n\nSuperscripts: a@sup{bc}d a@sup{@emph{hello}} a@sup{hello@ there}.\n\nSubscripts: H@sub{2}O, H@sub{23}O, H@sub{many@ of@ them}O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Smart quotes ellipses dashes\n@chapter Smart quotes, ellipses, dashes\n``Hello,'' said the spider. ```Shelob' is my name.''\n\n`A', `B', and `C' are letters.\n\n`Oak,' `elm,' and `beech' are names of trees. So is `pine.'\n\n`He said, ``I want to go.''' Were you alive in the 70's?\n\nHere is some quoted `@code{code}' and a\n``@uref{http://example.com/?foo=1&bar=2,quoted link}''.\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses@dots{}and@dots{}and@dots{}.\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node LaTeX\n@chapter LaTeX\n@itemize\n@item\n@tex\n\\cite[22-23]{smith.1899}\n@end tex\n@item\n@math{2+2=4}\n@item\n@math{x \\in y}\n@item\n@math{\\alpha \\wedge \\omega}\n@item\n@math{223}\n@item\n@math{p}-Tree\n@item\nHere's some display math:\n@math{\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}}\n@item\nHere's one that has a line break in it: @math{\\alpha + \\omega \\times x^2}.\n@end itemize\n\nThese shouldn't be math:\n\n@itemize\n@item\nTo get the famous equation, write @code{$e = mc^2$}.\n@item\n$22,000 is a @emph{lot} of money. So is $34,000. (It worked if ``lot'' is\nemphasized.)\n@item\nShoes ($20) and socks ($5).\n@item\nEscaped @code{$}: $73 @emph{this should be emphasized} 23$.\n@end itemize\n\nHere's a LaTeX table:\n\n@tex\n\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog    & 2      \\\\\nCat    & 1      \\\\ \\hline\n\\end{tabular}\n@end tex\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Special Characters\n@chapter Special Characters\nHere is some unicode:\n\n@itemize\n@item\nI hat: Î\n@item\no umlaut: ö\n@item\nsection: §\n@item\nset membership: ∈\n@item\ncopyright: ©\n@end itemize\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: @{\n\nRight brace: @}\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Links\n@chapter Links\n\n@menu\n* Explicit::\n* Reference::\n* With ampersands::\n* Autolinks::\n@end menu\n\n@node Explicit\n@section Explicit\nJust a @uref{/url/,URL}.\n\n@uref{/url/,URL and title}.\n\n@uref{/url/,URL and title}.\n\n@uref{/url/,URL and title}.\n\n@uref{/url/,URL and title}\n\n@uref{/url/,URL and title}\n\n@uref{/url/with_underscore,with_underscore}\n\n@uref{mailto:nobody@@nowhere.net,Email link}\n\n@uref{,Empty}.\n\n@node Reference\n@section Reference\nFoo @uref{/url/,bar}.\n\nWith @uref{/url/,embedded [brackets]}.\n\n@uref{/url/,b} by itself should be a link.\n\nIndented @uref{/url,once}.\n\nIndented @uref{/url,twice}.\n\nIndented @uref{/url,thrice}.\n\nThis should [not][] be a link.\n\n@verbatim\n[not]: /url\n@end verbatim\n\nFoo @uref{/url/,bar}.\n\nFoo @uref{/url/,biz}.\n\n@node With ampersands\n@section With ampersands\nHere's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the\nURL}.\n\nHere's a link with an amersand in the link text: @uref{http://att.com/,AT&T}.\n\nHere's an @uref{/script?foo=1&bar=2,inline link}.\n\nHere's an @uref{/script?foo=1&bar=2,inline link in pointy braces}.\n\n@node Autolinks\n@section Autolinks\nWith an ampersand: @url{http://example.com/?foo=1&bar=2}\n\n@itemize\n@item\nIn a list?\n@item\n@url{http://example.com/}\n@item\nIt should.\n@end itemize\n\nAn e-mail address: @uref{mailto:nobody@@nowhere.net,nobody@@nowherenet}\n\n@quotation\nBlockquoted: @url{http://example.com/}\n@end quotation\nAuto-links should not occur here: @code{<http://example.com/>}\n\n@verbatim\nor here: <http://example.com/>\n@end verbatim\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Images\n@chapter Images\nFrom ``Voyage dans la Lune'' by Georges Melies (1902):\n\n@float\n@image{lalune,,,lalune,jpg}\n@caption{lalune}\n@end float\nHere is a movie @image{movie,,,movie,jpg} icon.\n\n@iftex\n@bigskip@hrule@bigskip\n@end iftex\n@ifnottex\n------------------------------------------------------------------------\n@end ifnottex\n\n@node Footnotes\n@chapter Footnotes\nHere is a footnote reference,@footnote{Here is the footnote. It can go anywhere\nafter the footnote reference. It need not be placed at the end of the document.}\nand another.@footnote{Here's the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with\nlist items).\n\n@verbatim\n  { <code> }\n@end verbatim\n\nIf you want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.} This should @emph{not} be a footnote reference,\nbecause it contains a space.[^my note] Here is an inline note.@footnote{This is\n@emph{easier} to type. Inline notes may contain @uref{http://google.com,links}\nand @code{]} verbatim characters, as well as [bracketed text].}\n\n@quotation\nNotes can go in quotes.@footnote{In quote.}\n@end quotation\n@enumerate \n@item\nAnd in list items.@footnote{In list.}\n@end enumerate\n\nThis paragraph should not be part of the note, as it is not indented.\n\n@bye\n"
  },
  {
    "path": "test/writer.textile",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.\n\n<hr />\n\nh1(#headers). Headers\n\nh2(#level-2-with-an-embedded-link). Level 2 with an \"embedded link\":/url\n\nh3(#level-3-with-emphasis). Level 3 with _emphasis_\n\nh4(#level-4). Level 4\n\nh5(#level-5). Level 5\n\nh1(#level-1). Level 1\n\nh2(#level-2-with-emphasis). Level 2 with _emphasis_\n\nh3(#level-3). Level 3\n\nwith no blank line\n\nh2(#level-2). Level 2\n\nwith no blank line\n\n<hr />\n\nh1(#paragraphs). Paragraphs\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard&#45;wrapped line in the middle of a paragraph looked like a list item.\n\nHere's one with a bullet. &#42; criminey.\n\nThere should be a hard line break\nhere.\n\n<hr />\n\nh1(#block-quotes). Block Quotes\n\nE&#45;mail style:\n\nbq. This is a block quote. It is pretty short.\n\n\n\n<blockquote>\n\nCode in a block quote:\n\nbc. sub status {\n    print \"working\";\n}\n\n\nA list:\n\n# item one\n# item two\n\nNested block quotes:\n\nbq. nested\n\n\n\nbq. nested\n\n\n\n</blockquote>\n\nThis should not be a block quote: 2 &gt; 1.\n\nAnd a following paragraph.\n\n<hr />\n\nh1(#code-blocks). Code Blocks\n\nCode:\n\n<pre>\n---- (should be four hyphens)\n\nsub status {\n    print &quot;working&quot;;\n}\n\nthis code block is indented by one tab\n</pre>\n\nAnd:\n\n<pre>\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\&gt; \\[ \\{\n</pre>\n\n<hr />\n\nh1(#lists). Lists\n\nh2(#unordered). Unordered\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nh2(#ordered). Ordered\n\nTight:\n\n# First\n# Second\n# Third\n\nand:\n\n# One\n# Two\n# Three\n\nLoose using tabs:\n\n# First\n# Second\n# Third\n\nand using spaces:\n\n# One\n# Two\n# Three\n\nMultiple paragraphs:\n\n<ol style=\"list-style-type: decimal;\">\n<li><p>Item 1, graf one.</p>\n<p>Item 1. graf two. The quick brown fox jumped over the lazy dog's back.</p></li>\n<li><p>Item 2.</p></li>\n<li><p>Item 3.</p></li>\n</ol>\n\nh2(#nested). Nested\n\n* Tab\n** Tab\n*** Tab\n\nHere's another:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\nSame thing but with paragraphs:\n\n# First\n# Second:\n#* Fee\n#* Fie\n#* Foe\n# Third\n\nh2(#tabs-and-spaces). Tabs and spaces\n\n* this is a list item indented with tabs\n* this is a list item indented with spaces\n** this is an example list item indented with tabs\n** this is an example list item indented with spaces\n\nh2(#fancy-list-markers). Fancy list markers\n\n<ol start=\"2\" style=\"list-style-type: decimal;\">\n<li><p>begins with 2</p></li>\n<li><p>and now 3</p>\n<p>with a continuation</p>\n<ol start=\"4\" style=\"list-style-type: lower-roman;\">\n<li>sublist with roman numerals, starting with 4</li>\n<li>more items\n<ol style=\"list-style-type: upper-alpha;\">\n<li>a subsublist</li>\n<li>a subsublist</li>\n</ol>\n</li>\n</ol>\n</li>\n</ol>\n\nNesting:\n\n<ol style=\"list-style-type: upper-alpha;\">\n<li>Upper Alpha\n<ol style=\"list-style-type: upper-roman;\">\n<li>Upper Roman.\n<ol start=\"6\" style=\"list-style-type: decimal;\">\n<li>Decimal start with 6\n<ol start=\"3\" style=\"list-style-type: lower-alpha;\">\n<li>Lower alpha with paren</li>\n</ol>\n</li>\n</ol>\n</li>\n</ol>\n</li>\n</ol>\n\nAutonumbering:\n\n# Autonumber.\n# More.\n## Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n<hr />\n\nh1(#definition-lists). Definition Lists\n\nTight using spaces:\n\n<dl>\n<dt>apple</dt>\n<dd>red fruit</dd>\n<dt>orange</dt>\n<dd>orange fruit</dd>\n<dt>banana</dt>\n<dd>yellow fruit</dd>\n</dl>\n\nTight using tabs:\n\n<dl>\n<dt>apple</dt>\n<dd>red fruit</dd>\n<dt>orange</dt>\n<dd>orange fruit</dd>\n<dt>banana</dt>\n<dd>yellow fruit</dd>\n</dl>\n\nLoose:\n\n<dl>\n<dt>apple</dt>\n<dd><p>red fruit</p></dd>\n<dt>orange</dt>\n<dd><p>orange fruit</p></dd>\n<dt>banana</dt>\n<dd><p>yellow fruit</p></dd>\n</dl>\n\nMultiple blocks with italics:\n\n<dl>\n<dt>_apple_</dt>\n<dd><p>red fruit</p>\n<p>contains seeds, crisp, pleasant to taste</p></dd>\n<dt>_orange_</dt>\n<dd><p>orange fruit</p>\nbc. { orange code block }\n\n\nbq. <p>orange block quote</p>\n\n</dd>\n</dl>\n\nMultiple definitions, tight:\n\n<dl>\n<dt>apple</dt>\n<dd>red fruit</dd>\n<dd>computer</dd>\n<dt>orange</dt>\n<dd>orange fruit</dd>\n<dd>bank</dd>\n</dl>\n\nMultiple definitions, loose:\n\n<dl>\n<dt>apple</dt>\n<dd><p>red fruit</p></dd>\n<dd><p>computer</p></dd>\n<dt>orange</dt>\n<dd><p>orange fruit</p></dd>\n<dd><p>bank</p></dd>\n</dl>\n\nBlank line after term, indented marker, alternate markers:\n\n<dl>\n<dt>apple</dt>\n<dd><p>red fruit</p></dd>\n<dd><p>computer</p></dd>\n<dt>orange</dt>\n<dd><p>orange fruit</p>\n<ol style=\"list-style-type: decimal;\">\n<li>sublist</li>\n<li>sublist</li>\n</ol>\n</dd>\n</dl>\n\nh1(#html-blocks). HTML Blocks\n\nSimple block on one line:\n\n<div>\n\nfoo\n\n</div>\n\nAnd nested without indentation:\n\n<div>\n\n<div>\n\n<div>\n\nfoo\n\n\n</div>\n\n\n</div>\n\n<div>\n\nbar\n\n</div>\n\n\n</div>\n\nInterpreted markdown in a table:\n\n<table>\n<tr>\n<td>\nThis is _emphasized_\n</td>\n<td>\nAnd this is *strong*\n</td>\n</tr>\n</table>\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\nHere's a simple block:\n\n<div>\n\nfoo\n\n\n</div>\n\nThis should be a code block, though:\n\nbc. <div>\n    foo\n</div>\n\n\nAs should this:\n\nbc. <div>foo</div>\n\n\nNow, nested:\n\n<div>\n\n<div>\n\n<div>\n\nfoo\n\n</div>\n\n\n</div>\n\n\n</div>\n\nThis should just be an HTML comment:\n\n<!-- Comment -->\nMultiline:\n\n<!--\nBlah\nBlah\n-->\n<!--\n    This is another comment.\n-->\nCode block:\n\nbc. <!-- Comment -->\n\n\nJust plain comment, with trailing spaces on the line:\n\n<!-- foo -->\nCode:\n\nbc. <hr />\n\n\nHr's:\n\n<hr>\n<hr />\n<hr />\n<hr>\n<hr />\n<hr />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\" />\n<hr class=\"foo\" id=\"bar\">\n<hr />\n\nh1(#inline-markup). Inline Markup\n\nThis is _emphasized_, and so _is this_.\n\nThis is *strong*, and so *is this*.\n\nAn _\"emphasized link\":/url_.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\n*_This is strong and em._*\n\nSo is *_this_* word.\n\nThis is code: @>@, @$@, @\\@, @\\$@, @<html>@.\n\n-This is _strikeout_.-\n\nSuperscripts: a[^bc^]d a[^_hello_^] a[^hello there^].\n\nSubscripts: H[~2~]O, H[~23~]O, H[~many of them~]O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\n\n<hr />\n\nh1(#smart-quotes-ellipses-dashes). Smart quotes, ellipses, dashes\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted '@code@' and a \"\"quoted link\":http://example.com/?foo=1&bar=2\".\n\nSome dashes: one -- two  --  three -- four  --  five.\n\nDashes between numbers: 5 - 7, 255 - 66, 1987 - 1999.\n\nEllipses...and...and....\n\n<hr />\n\nh1(#latex). LaTeX\n\n* \n* <span class=\"math\">2+2=4</span>\n* <span class=\"math\">x \\in y</span>\n* <span class=\"math\">\\alpha \\wedge \\omega</span>\n* <span class=\"math\">223</span>\n* <span class=\"math\">p</span>&#45;Tree\n* Here's some display math: <span class=\"math\">\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}</span>\n* Here's one that has a line break in it: <span class=\"math\">\\alpha + \\omega \\times x^2</span>.\n\nThese shouldn't be math:\n\n* To get the famous equation, write @$e = mc^2$@.\n* $22,000 is a _lot_ of money. So is $34,000. (It worked if \"lot\" is emphasized.)\n* Shoes ($20) and socks ($5).\n* Escaped @$@: $73 _this should be emphasized_ 23$.\n\nHere's a LaTeX table:\n\n\n<hr />\n\nh1(#special-characters). Special Characters\n\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&amp;T has an ampersand in their name.\n\nAT&amp;T is another way to write it.\n\nThis &amp; that.\n\n4 &lt; 5.\n\n6 &gt; 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: &#42;\n\nUnderscore: &#95;\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater&#45;than: &gt;\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: &#43;\n\nMinus: &#45;\n\n<hr />\n\nh1(#links). Links\n\nh2(#explicit). Explicit\n\nJust a \"URL\":/url/.\n\n\"URL and title\":/url/.\n\n\"URL and title\":/url/.\n\n\"URL and title\":/url/.\n\n\"URL and title\":/url/\n\n\"URL and title\":/url/\n\n\"with&#95;underscore\":/url/with_underscore\n\n\"Email link\":mailto:nobody@nowhere.net\n\n\"Empty\":.\n\nh2(#reference). Reference\n\nFoo \"bar\":/url/.\n\nWith \"embedded [brackets]\":/url/.\n\n\"b\":/url/ by itself should be a link.\n\nIndented \"once\":/url.\n\nIndented \"twice\":/url.\n\nIndented \"thrice\":/url.\n\nThis should [not][] be a link.\n\nbc. [not]: /url\n\n\nFoo \"bar\":/url/.\n\nFoo \"biz\":/url/.\n\nh2(#with-ampersands). With ampersands\n\nHere's a \"link with an ampersand in the URL\":http://example.com/?foo=1&bar=2.\n\nHere's a link with an amersand in the link text: \"AT&amp;T\":http://att.com/.\n\nHere's an \"inline link\":/script?foo=1&bar=2.\n\nHere's an \"inline link in pointy braces\":/script?foo=1&bar=2.\n\nh2(#autolinks). Autolinks\n\nWith an ampersand: \"$\":http://example.com/?foo=1&bar=2\n\n* In a list?\n* \"$\":http://example.com/\n* It should.\n\nAn e&#45;mail address: \"(email)nobody&#64;nowhere.net\":mailto:nobody@nowhere.net\n\nbq. Blockquoted: \"$\":http://example.com/\n\n\n\nAuto&#45;links should not occur here: @<http://example.com/>@\n\nbc. or here: <http://example.com/>\n\n\n<hr />\n\nh1(#images). Images\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n<figure>\n\n<figcaption>\n\nlalune\n\n</figcaption>\n\n!lalune.jpg(Voyage dans la Lune)!\n\n</figure>\n\nHere is a movie !movie.jpg(movie)! icon.\n\n<hr />\n\nh1(#footnotes). Footnotes\n\nHere is a footnote reference,[1] and another.[2] This should _not_ be a footnote reference, because it contains a space.[^my note] Here is an inline note.[3]\n\nbq. Notes can go in quotes.[4]\n\n\n\n# And in list items.[5]\n\nThis paragraph should not be part of the note, as it is not indented.\n\n\nfn1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\n\n\nfn2. Here's the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with list items).\n\nbc.   { <code> }\n\n\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.\n\n\nfn3. This is _easier_ to type. Inline notes may contain \"links\":http://google.com and @]@ verbatim characters, as well as [bracketed text].\n\n\nfn4. In quote.\n\n\nfn5. In list.\n"
  },
  {
    "path": "test/writer.typst",
    "content": "#let horizontalrule = line(start: (25%,0%), end: (75%,0%))\n\n#show terms.item: it => block(breakable: false)[\n  #text(weight: \"bold\")[#it.term]\n  #block(inset: (left: 1.5em, top: -0.4em))[#it.description]\n]\n\n#set table(\n  inset: 6pt,\n  stroke: none\n)\n\n#show figure.where(\n  kind: table\n): set figure.caption(position: top)\n\n#show figure.where(\n  kind: image\n): set figure.caption(position: bottom)\n\n#let content-to-string(content) = {\n  if content.has(\"text\") {\n    content.text\n  } else if content.has(\"children\") {\n    content.children.map(content-to-string).join(\"\")\n  } else if content.has(\"body\") {\n    content-to-string(content.body)\n  } else if content == [ ] {\n    \" \"\n  }\n}\n#let conf(\n  title: none,\n  subtitle: none,\n  authors: (),\n  keywords: (),\n  date: none,\n  abstract-title: none,\n  abstract: none,\n  thanks: none,\n  cols: 1,\n  margin: (x: 1.25in, y: 1.25in),\n  paper: \"us-letter\",\n  lang: \"en\",\n  region: \"US\",\n  font: none,\n  fontsize: 11pt,\n  mathfont: none,\n  codefont: none,\n  linestretch: 1,\n  sectionnumbering: none,\n  linkcolor: none,\n  citecolor: none,\n  filecolor: none,\n  pagenumbering: \"1\",\n  doc,\n) = {\n  set document(\n    title: title,\n    keywords: keywords,\n  )\n  set document(\n      author: authors.map(author => content-to-string(author.name)).join(\", \", last: \" & \"),\n  ) if authors != none and authors != ()\n  set page(\n    paper: paper,\n    margin: margin,\n    numbering: pagenumbering,\n    columns: cols\n  )\n\n  set par(\n    justify: true,\n    leading: linestretch * 0.65em\n  )\n  set text(lang: lang,\n           region: region,\n           size: fontsize)\n\n  set text(font: font) if font != none\n  show math.equation: set text(font: mathfont) if mathfont != none\n  show raw: set text(font: codefont) if codefont != none\n\n  set heading(numbering: sectionnumbering)\n\n  show link: set text(fill: rgb(content-to-string(linkcolor))) if linkcolor != none\n  show ref: set text(fill: rgb(content-to-string(citecolor))) if citecolor != none\n  show link: this => {\n    if filecolor != none and type(this.dest) == label {\n      text(this, fill: rgb(content-to-string(filecolor)))\n    } else {\n      text(this)\n    }\n  }\n\n  if title != none {\n    place(top, float: true, scope: \"parent\", clearance: 4mm, block(below: 1em, width: 100%)[\n      #if title != none {\n        align(center, block[\n            #text(weight: \"bold\", size: 1.5em, hyphenate: false)[#title #if thanks != none {\n                footnote(thanks, numbering: \"*\")\n                counter(footnote).update(n => n - 1)\n              }]\n            #(\n              if subtitle != none {\n                parbreak()\n                text(weight: \"bold\", size: 1.25em, hyphenate: false)[#subtitle]\n              }\n             )])\n      }\n\n      #if authors != none and authors != [] {\n        let count = authors.len()\n        let ncols = calc.min(count, 3)\n        grid(\n          columns: (1fr,) * ncols,\n          row-gutter: 1.5em,\n          ..authors.map(author => align(center)[\n            #author.name \\\n            #author.affiliation \\\n            #author.email\n          ])\n        )\n      }\n\n      #if date != none {\n        align(center)[#block(inset: 1em)[\n            #date\n          ]]\n      }\n\n      #if abstract != none {\n        block(inset: 2em)[\n          #text(weight: \"semibold\")[#abstract-title] #h(1em) #abstract\n        ]\n      }\n    ])\n  }\n  doc\n}\n#show: doc => conf(\n  title: [Pandoc Test Suite],\n  authors: (\n    ( name: [John MacFarlane],\n      affiliation: \"\",\n      email: \"\" ),\n    ( name: [Anonymous],\n      affiliation: \"\",\n      email: \"\" ),\n    ),\n  date: [July 17, 2006],\n  abstract-title: [Abstract],\n  pagenumbering: \"1\",\n  cols: 1,\n  doc,\n)\n\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n#horizontalrule\n\n= Headers\n<headers>\n== Level 2 with an #link(\"/url\")[embedded link]\n<level-2-with-an-embedded-link>\n=== Level 3 with #emph[emphasis]\n<level-3-with-emphasis>\n==== Level 4\n<level-4>\n===== Level 5\n<level-5>\n= Level 1\n<level-1>\n== Level 2 with #emph[emphasis]\n<level-2-with-emphasis>\n=== Level 3\n<level-3>\nwith no blank line\n\n== Level 2\n<level-2>\nwith no blank line\n\n#horizontalrule\n\n= Paragraphs\n<paragraphs>\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. \\* criminey.\n\nThere should be a hard line break \\ here.\n\n#horizontalrule\n\n= Block Quotes\n<block-quotes>\nE-mail style:\n\n#quote(block: true)[\nThis is a block quote. It is pretty short.\n]\n\n#quote(block: true)[\nCode in a block quote:\n\n```\nsub status {\n    print \"working\";\n}\n```\n\nA list:\n\n+ item one\n+ item two\n\nNested block quotes:\n\n#quote(block: true)[\nnested\n]\n\n#quote(block: true)[\nnested\n]\n]\n\nThis should not be a block quote: 2 \\> 1.\n\nAnd a following paragraph.\n\n#horizontalrule\n\n= Code Blocks\n<code-blocks>\nCode:\n\n```\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n```\n\nAnd:\n\n```\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n```\n\n#horizontalrule\n\n= Lists\n<lists>\n== Unordered\n<unordered>\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\n== Ordered\n<ordered>\nTight:\n\n+ First\n+ Second\n+ Third\n\nand:\n\n+ One\n+ Two\n+ Three\n\nLoose using tabs:\n\n+ First\n\n+ Second\n\n+ Third\n\nand using spaces:\n\n+ One\n\n+ Two\n\n+ Three\n\nMultiple paragraphs:\n\n+ Item 1, graf one.\n\n  Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n+ Item 2.\n\n+ Item 3.\n\n== Nested\n<nested>\n- Tab\n  - Tab\n    - Tab\n\nHere's another:\n\n+ First\n+ Second:\n  - Fee\n  - Fie\n  - Foe\n+ Third\n\nSame thing but with paragraphs:\n\n+ First\n\n+ Second:\n\n  - Fee\n  - Fie\n  - Foe\n\n+ Third\n\n== Tabs and spaces\n<tabs-and-spaces>\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\n== Fancy list markers\n<fancy-list-markers>\n#block[\n#set enum(numbering: \"(1)\", start: 2)\n+ begins with 2\n\n+ and now 3\n\n  with a continuation\n\n  #block[\n  #set enum(numbering: \"i.\", start: 4)\n  + sublist with roman numerals, starting with 4\n  + more items\n    #block[\n    #set enum(numbering: \"(A)\", start: 1)\n    + a subsublist\n    + a subsublist\n    ]\n  ]\n]\n\nNesting:\n\n#block[\n#set enum(numbering: \"A.\", start: 1)\n+ Upper Alpha\n  #block[\n  #set enum(numbering: \"I.\", start: 1)\n  + Upper Roman.\n    #block[\n    #set enum(numbering: \"(1)\", start: 6)\n    + Decimal start with 6\n      #block[\n      #set enum(numbering: \"a)\", start: 3)\n      + Lower alpha with paren\n      ]\n    ]\n  ]\n]\n\nAutonumbering:\n\n+ Autonumber.\n+ More.\n  + Nested.\n\nShould not be a list item:\n\nM.A.~2007\n\nB. Williams\n\n#horizontalrule\n\n= Definition Lists\n<definition-lists>\nTight using spaces:\n\n/ apple: #block[\nred fruit\n]\n\n/ orange: #block[\norange fruit\n]\n\n/ banana: #block[\nyellow fruit\n]\n\nTight using tabs:\n\n/ apple: #block[\nred fruit\n]\n\n/ orange: #block[\norange fruit\n]\n\n/ banana: #block[\nyellow fruit\n]\n\nLoose:\n\n/ apple: #block[\nred fruit\n]\n\n/ orange: #block[\norange fruit\n]\n\n/ banana: #block[\nyellow fruit\n]\n\nMultiple blocks with italics:\n\n/ #emph[apple]: #block[\nred fruit\n\ncontains seeds, crisp, pleasant to taste\n]\n\n/ #emph[orange]: #block[\norange fruit\n\n```\n{ orange code block }\n```\n\n#quote(block: true)[\norange block quote\n]\n]\n\nMultiple definitions, tight:\n\n/ apple: #block[\nred fruit\n\ncomputer\n]\n\n/ orange: #block[\norange fruit\n\nbank\n]\n\nMultiple definitions, loose:\n\n/ apple: #block[\nred fruit\n\ncomputer\n]\n\n/ orange: #block[\norange fruit\n\nbank\n]\n\nBlank line after term, indented marker, alternate markers:\n\n/ apple: #block[\nred fruit\n\ncomputer\n]\n\n/ orange: #block[\norange fruit\n\n+ sublist\n+ sublist\n]\n\n= HTML Blocks\n<html-blocks>\nSimple block on one line:\n\n#block[\nfoo\n]\nAnd nested without indentation:\n\n#block[\n#block[\n#block[\nfoo\n\n]\n]\n#block[\nbar\n]\n]\nInterpreted markdown in a table:\n\nThis is #emph[emphasized]\nAnd this is #strong[strong]\nHere's a simple block:\n\n#block[\nfoo\n\n]\nThis should be a code block, though:\n\n```\n<div>\n    foo\n</div>\n```\n\nAs should this:\n\n```\n<div>foo</div>\n```\n\nNow, nested:\n\n#block[\n#block[\n#block[\nfoo\n]\n]\n]\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n```\n<!-- Comment -->\n```\n\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n```\n<hr />\n```\n\nHr's:\n\n#horizontalrule\n\n= Inline Markup\n<inline-markup>\nThis is #emph[emphasized], and so #emph[is this].\n\nThis is #strong[strong], and so #strong[is this].\n\nAn #emph[#link(\"/url\")[emphasized link]].\n\n#strong[#emph[This is strong and em.]]\n\nSo is #strong[#emph[this]] word.\n\n#strong[#emph[This is strong and em.]]\n\nSo is #strong[#emph[this]] word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\n#strike[This is #emph[strikeout].]\n\nSuperscripts: a#super[bc]d a#super[#emph[hello]] a#super[hello~there].\n\nSubscripts: H#sub[2]O, H#sub[23]O, H#sub[many~of~them]O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a\\~b c\\~d.\n\n#horizontalrule\n\n= Smart quotes, ellipses, dashes\n<smart-quotes-ellipses-dashes>\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted '`code`' and a\n\"#link(\"http://example.com/?foo=1&bar=2\")[quoted link]\".\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses…and…and….\n\n#horizontalrule\n\n= LaTeX\n<latex>\n-\n- $2 + 2 = 4$\n- $x in y$\n- $alpha and omega$\n- $223$\n- $p$-Tree\n- Here's some display math:\n  $ frac(d, d x) f\\(x\\)= lim_(h arrow.r 0) frac(f\\(x + h\\)- f\\(x\\), h) $\n- Here's one that has a line break in it: $alpha + omega times x^2$.\n\nThese shouldn't be math:\n\n- To get the famous equation, write `$e = mc^2$`.\n- \\$22,000 is a #emph[lot] of money. So is \\$34,000. (It worked if \"lot\" is\n  emphasized.)\n- Shoes (\\$20) and socks (\\$5).\n- Escaped `$`: \\$73 #emph[this should be emphasized] 23\\$.\n\nHere's a LaTeX table:\n\n#horizontalrule\n\n= Special Characters\n<special-characters>\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 \\< 5.\n\n6 \\> 5.\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: \\>\n\nHash: \\#\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n#horizontalrule\n\n= Links\n<links>\n== Explicit\n<explicit>\nJust a #link(\"/url/\")[URL].\n\n#link(\"/url/\")[URL and title].\n\n#link(\"/url/\")[URL and title].\n\n#link(\"/url/\")[URL and title].\n\n#link(\"/url/\")[URL and title]\n\n#link(\"/url/\")[URL and title]\n\n#link(\"/url/with_underscore\")[with\\_underscore]\n\n#link(\"mailto:nobody@nowhere.net\")[Email link]\n\n#link(\"\")[Empty].\n\n== Reference\n<reference>\nFoo #link(\"/url/\")[bar].\n\nWith #link(\"/url/\")[embedded \\[brackets\\]].\n\n#link(\"/url/\")[b] by itself should be a link.\n\nIndented #link(\"/url\")[once].\n\nIndented #link(\"/url\")[twice].\n\nIndented #link(\"/url\")[thrice].\n\nThis should \\[not\\]\\[\\] be a link.\n\n```\n[not]: /url\n```\n\nFoo #link(\"/url/\")[bar].\n\nFoo #link(\"/url/\")[biz].\n\n== With ampersands\n<with-ampersands>\nHere's a\n#link(\"http://example.com/?foo=1&bar=2\")[link with an ampersand in the URL].\n\nHere's a link with an amersand in the link text: #link(\"http://att.com/\")[AT&T].\n\nHere's an #link(\"/script?foo=1&bar=2\")[inline link].\n\nHere's an #link(\"/script?foo=1&bar=2\")[inline link in pointy braces].\n\n== Autolinks\n<autolinks>\nWith an ampersand: #link(\"http://example.com/?foo=1&bar=2\")\n\n- In a list?\n- #link(\"http://example.com/\")\n- It should.\n\nAn e-mail address: #link(\"mailto:nobody@nowhere.net\")[nobody\\@nowhere.net]\n\n#quote(block: true)[\nBlockquoted: #link(\"http://example.com/\")\n]\n\nAuto-links should not occur here: `<http://example.com/>`\n\n```\nor here: <http://example.com/>\n```\n\n#horizontalrule\n\n= Images\n<images>\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\n#figure(image(\"lalune.jpg\", alt: \"lalune\"),\n  caption: [\n    lalune\n  ]\n)\n\nHere is a movie #box(image(\"movie.jpg\", alt: \"movie\")) icon.\n\n#horizontalrule\n\n= Footnotes\n<footnotes>\nHere is a footnote reference,#footnote[Here is the footnote. It can go anywhere\nafter the footnote reference. It need not be placed at the end of the document.]\nand another.#footnote[Here's the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with\nlist items).\n\n```\n  { <code> }\n```\n\nIf you want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.] This should #emph[not] be a footnote reference,\nbecause it contains a space.\\[^my note\\] Here is an inline note.#footnote[This\nis #emph[easier] to type. Inline notes may contain\n#link(\"http://google.com\")[links] and `]` verbatim characters, as well as\n\\[bracketed text\\].]\n\n#quote(block: true)[\nNotes can go in quotes.#footnote[In quote.]\n]\n\n+ And in list items.#footnote[In list.]\n\nThis paragraph should not be part of the note, as it is not indented.\n"
  },
  {
    "path": "test/writer.vimdoc",
    "content": "                Pandoc Test Suite by John MacFarlane, Anonymous\n\n\n                                         Type |gO| to see the table of contents.\n\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber's\nmarkdown test suite.\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nHeaders                                                                  *headers*\n\n--------------------------------------------------------------------------------\nLevel 2 with an embedded link /url                 *level-2-with-an-embedded-link*\n\nLEVEL 3 WITH EMPHASIS                                      *level-3-with-emphasis*\n\nLevel 4                                                                  *level-4*\n\nLevel 5                                                                  *level-5*\n\n================================================================================\nLevel 1                                                                  *level-1*\n\n--------------------------------------------------------------------------------\nLevel 2 with emphasis                                      *level-2-with-emphasis*\n\nLEVEL 3                                                                  *level-3*\n\nwith no blank line\n\n--------------------------------------------------------------------------------\nLevel 2                                                                  *level-2*\n\nwith no blank line\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nParagraphs                                                            *paragraphs*\n\nHere's a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.\nBecause a hard-wrapped line in the middle of a paragraph looked like a list\nitem.\n\nHere's one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nBlock Quotes                                                        *block-quotes*\n\nE-mail style:\n\n  This is a block quote. It is pretty short.\n\n  Code in a block quote:\n\n  >\n      sub status {\n          print \"working\";\n      }\n<\n  A list:\n\n  1. item one\n  2. item two\n\n  Nested block quotes:\n\n    nested\n\n    nested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nCode Blocks                                                          *code-blocks*\n\nCode:\n\n>\n    ---- (should be four hyphens)\n\n    sub status {\n        print \"working\";\n    }\n\n    this code block is indented by one tab\n<\nAnd:\n\n>\n        this code block is indented by two tabs\n\n    These should not be escaped:  \\$ \\\\ \\> \\[ \\{\n<\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nLists                                                                      *lists*\n\n--------------------------------------------------------------------------------\nUnordered                                                              *unordered*\n\nAsterisks tight:\n\n- asterisk 1\n- asterisk 2\n- asterisk 3\n\nAsterisks loose:\n\n- asterisk 1\n\n- asterisk 2\n\n- asterisk 3\n\nPluses tight:\n\n- Plus 1\n- Plus 2\n- Plus 3\n\nPluses loose:\n\n- Plus 1\n\n- Plus 2\n\n- Plus 3\n\nMinuses tight:\n\n- Minus 1\n- Minus 2\n- Minus 3\n\nMinuses loose:\n\n- Minus 1\n\n- Minus 2\n\n- Minus 3\n\n--------------------------------------------------------------------------------\nOrdered                                                                  *ordered*\n\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n\n2. Second\n\n3. Third\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\n   Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\n\n2. Item 2.\n\n3. Item 3.\n\n--------------------------------------------------------------------------------\nNested                                                                    *nested*\n\n- Tab\n  - Tab\n    - Tab\n\nHere's another:\n\n1. First\n2. Second:\n   - Fee\n   - Fie\n   - Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\n   - Fee\n   - Fie\n   - Foe\n\n3. Third\n\n--------------------------------------------------------------------------------\nTabs and spaces                                                  *tabs-and-spaces*\n\n- this is a list item indented with tabs\n\n- this is a list item indented with spaces\n\n  - this is an example list item indented with tabs\n\n  - this is an example list item indented with spaces\n\n--------------------------------------------------------------------------------\nFancy list markers                                            *fancy-list-markers*\n\n(2) begins with 2\n\n(3) and now 3\n\n    with a continuation\n\n    iv. sublist with roman numerals, starting with 4\n    v. more items\n       (A) a subsublist\n       (B) a subsublist\n\nNesting:\n\nA. Upper Alpha\n   I. Upper Roman.\n      (6) Decimal start with 6\n          c) Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n2. More.\n   1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nDefinition Lists                                                *definition-lists*\n\nTight using spaces:\n\napple\n    red fruit\norange\n    orange fruit\nbanana\n    yellow fruit\n\nTight using tabs:\n\napple\n    red fruit\norange\n    orange fruit\nbanana\n    yellow fruit\n\nLoose:\n\napple\n    red fruit\n\norange\n    orange fruit\n\nbanana\n    yellow fruit\n\nMultiple blocks with italics:\n\napple\n    red fruit\n\n    contains seeds, crisp, pleasant to taste\n\norange\n    orange fruit\n\n    >\n        { orange code block }\n<\n      orange block quote\n\nMultiple definitions, tight:\n\napple\n    red fruit\n    computer\norange\n    orange fruit\n    bank\n\nMultiple definitions, loose:\n\napple\n    red fruit\n\n    computer\n\norange\n    orange fruit\n\n    bank\n\nBlank line after term, indented marker, alternate markers:\n\napple\n    red fruit\n\n    computer\n\norange\n    orange fruit\n\n    1. sublist\n    2. sublist\n\n================================================================================\nHTML Blocks                                                          *html-blocks*\n\nSimple block on one line:\n\nfoo\nAnd nested without indentation:\n\nfoo\n\nbar\nInterpreted markdown in a table:\n\nThis is emphasized\nAnd this is strong\nHere's a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n>\n    <div>\n        foo\n    </div>\n<\nAs should this:\n\n>\n    <div>foo</div>\n<\nNow, nested:\n\nfoo\nThis should just be an HTML comment:\n\nMultiline:\n\nCode block:\n\n>\n    <!-- Comment -->\n<\nJust plain comment, with trailing spaces on the line:\n\nCode:\n\n>\n    <hr />\n<\nHr's:\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nInline Markup                                                      *inline-markup*\n\nThis is emphasized, and so is this.\n\nThis is strong, and so is this.\n\nAn emphasized link /url.\n\nThis is strong and em.\n\nSo is this word.\n\nThis is strong and em.\n\nSo is this word.\n\nThis is code: `>`, `$`, `\\`, `\\$`, `<html>`.\n\nThis is strikeout.\n\nSuperscripts: abcd ahello ahello there.\n\nSubscripts: H2O, H23O, Hmany of themO.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces:\na^b c^d, a~b c~d.\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nSmart quotes, ellipses, dashes                      *smart-quotes-ellipses-dashes*\n\n\"Hello,\" said the spider. \"'Shelob' is my name.\"\n\n'A', 'B', and 'C' are letters.\n\n'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\n\n'He said, \"I want to go.\"' Were you alive in the 70's?\n\nHere is some quoted '`code`' and a \"quoted link\nhttp://example.com/?foo=1&bar=2\".\n\nSome dashes: one---two --- three---four --- five.\n\nDashes between numbers: 5--7, 255--66, 1987--1999.\n\nEllipses...and...and....\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nLaTeX                                                                      *latex*\n\n- \n- `$2+2=4$`\n- `$x \\in y$`\n- `$\\alpha \\wedge \\omega$`\n- `$223$`\n- `$p$`-Tree\n- Here's some display math:\n  `$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$`\n- Here's one that has a line break in it: `$\\alpha + \\omega \\times x^2$`.\n\nThese shouldn't be math:\n\n- To get the famous equation, write `$e = mc^2$`.\n- $22,000 is a lot of money. So is $34,000. (It worked if \"lot\" is emphasized.)\n- Shoes ($20) and socks ($5).\n- Escaped `$`: $73 this should be emphasized 23$.\n\nHere's a LaTeX table:\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nSpecial Characters                                            *special-characters*\n\nHere is some unicode:\n\n- I hat: Î\n- o umlaut: ö\n- section: §\n- set membership: ∈\n- copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nLinks                                                                      *links*\n\n--------------------------------------------------------------------------------\nExplicit                                                                *explicit*\n\nJust a URL /url/.\n\nURL and title /url/.\n\nURL and title /url/.\n\nURL and title /url/.\n\nURL and title /url/\n\nURL and title /url/\n\nwith_underscore /url/with_underscore\n\nEmail link nobody@nowhere.net\n\nEmpty .\n\n--------------------------------------------------------------------------------\nReference                                                              *reference*\n\nFoo bar /url/.\n\nWith embedded [brackets] /url/.\n\nb /url/ by itself should be a link.\n\nIndented once /url.\n\nIndented twice /url.\n\nIndented thrice /url.\n\nThis should [not][] be a link.\n\n>\n    [not]: /url\n<\nFoo bar /url/.\n\nFoo biz /url/.\n\n--------------------------------------------------------------------------------\nWith ampersands                                                  *with-ampersands*\n\nHere's a link with an ampersand in the URL http://example.com/?foo=1&bar=2.\n\nHere's a link with an amersand in the link text: AT&T http://att.com/.\n\nHere's an inline link /script?foo=1&bar=2.\n\nHere's an inline link in pointy braces /script?foo=1&bar=2.\n\n--------------------------------------------------------------------------------\nAutolinks                                                              *autolinks*\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n- In a list?\n- http://example.com/\n- It should.\n\nAn e-mail address: nobody@nowhere.net\n\n  Blockquoted: http://example.com/\n\nAuto-links should not occur here: `<http://example.com/>`\n\n>\n    or here: <http://example.com/>\n<\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nImages                                                                    *images*\n\nFrom \"Voyage dans la Lune\" by Georges Melies (1902):\n\nHere is a movie icon.\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n================================================================================\nFootnotes                                                              *footnotes*\n\nHere is a footnote reference, |footnote1| and another. |footnote2| This should\nnot be a footnote reference, because it contains a space.[^my note] Here is an\ninline note. |footnote3|\n\n  Notes can go in quotes. |footnote4|\n\n1. And in list items. |footnote5|\n\nThis paragraph should not be part of the note, as it is not indented.\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n                                                                       *footnote1*\nHere is the footnote. It can go anywhere after the footnote reference. It need\nnot be placed at the end of the document.\n\n                                                                       *footnote2*\nHere's the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with\nlist items).\n\n>\n      { <code> }\n<\nIf you want, you can indent every line, but you can also be lazy and just indent\nthe first line of each block.\n\n                                                                       *footnote3*\nThis is easier to type. Inline notes may contain links http://google.com and `]`\nverbatim characters, as well as [bracketed text].\n\n                                                                       *footnote4*\nIn quote.\n\n                                                                       *footnote5*\nIn list.\n\n vim:tw=80:sw=4:ts=4:ft=help:norl:et:\n"
  },
  {
    "path": "test/writer.xwiki",
    "content": "This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.\n\n\n----\n\n= Headers {{id name=\"headers\" /}}=\n\n== Level 2 with an [[embedded link>>/url]] {{id name=\"level-2-with-an-embedded-link\" /}}==\n\n=== Level 3 with //emphasis// {{id name=\"level-3-with-emphasis\" /}}===\n\n==== Level 4 {{id name=\"level-4\" /}}====\n\n===== Level 5 {{id name=\"level-5\" /}}=====\n\n= Level 1 {{id name=\"level-1\" /}}=\n\n== Level 2 with //emphasis// {{id name=\"level-2-with-emphasis\" /}}==\n\n=== Level 3 {{id name=\"level-3\" /}}===\n\nwith no blank line\n\n== Level 2 {{id name=\"level-2\" /}}==\n\nwith no blank line\n\n\n----\n\n= Paragraphs {{id name=\"paragraphs\" /}}=\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\\\\here.\n\n\n----\n\n= Block Quotes {{id name=\"block-quotes\" /}}=\n\nE-mail style:\n\n>This is a block quote. It is pretty short.\n>\n>Code in a block quote:\n>\n>\n>{{code}}\n>sub status {\n>    print \"working\";\n>}\n>{{/code}}\n>\n>A list:\n>\n>1. item one\n>1. item two\n>\n>Nested block quotes:\n>\n>>nested\n>>\n>>nested\n>>\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n\n----\n\n= Code Blocks {{id name=\"code-blocks\" /}}=\n\nCode:\n\n\n{{code}}\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n{{/code}}\n\nAnd:\n\n\n{{code}}\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n{{/code}}\n\n\n----\n\n= Lists {{id name=\"lists\" /}}=\n\n== Unordered {{id name=\"unordered\" /}}==\n\nAsterisks tight:\n\n*. asterisk 1\n*. asterisk 2\n*. asterisk 3\n\nAsterisks loose:\n\n*. asterisk 1\n*. asterisk 2\n*. asterisk 3\n\nPluses tight:\n\n*. Plus 1\n*. Plus 2\n*. Plus 3\n\nPluses loose:\n\n*. Plus 1\n*. Plus 2\n*. Plus 3\n\nMinuses tight:\n\n*. Minus 1\n*. Minus 2\n*. Minus 3\n\nMinuses loose:\n\n*. Minus 1\n*. Minus 2\n*. Minus 3\n\n== Ordered {{id name=\"ordered\" /}}==\n\nTight:\n\n1. First\n1. Second\n1. Third\n\nand:\n\n1. One\n1. Two\n1. Three\n\nLoose using tabs:\n\n1. First\n1. Second\n1. Third\n\nand using spaces:\n\n1. One\n1. Two\n1. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\n\nItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n1. Item 2.\n1. Item 3.\n\n== Nested {{id name=\"nested\" /}}==\n\n*. Tab\n**. Tab\n***. Tab\n\nHere’s another:\n\n1. First\n1. Second:\n1*. Fee\n1*. Fie\n1*. Foe\n1. Third\n\nSame thing but with paragraphs:\n\n1. First\n1. Second:\n\n1*. Fee\n1*. Fie\n1*. Foe\n1. Third\n\n== Tabs and spaces {{id name=\"tabs-and-spaces\" /}}==\n\n*. this is a list item indented with tabs\n*. this is a list item indented with spaces\n\n**. this is an example list item indented with tabs\n**. this is an example list item indented with spaces\n\n== Fancy list markers {{id name=\"fancy-list-markers\" /}}==\n\n1. begins with 2\n1. and now 3\n\nwith a continuation\n\n11. sublist with roman numerals, starting with 4\n11. more items\n111. a subsublist\n111. a subsublist\n\nNesting:\n\n1. Upper Alpha\n11. Upper Roman.\n111. Decimal start with 6\n1111. Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n1. More.\n11. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n\n----\n\n= Definition Lists {{id name=\"definition-lists\" /}}=\n\nTight using spaces:\n\n; apple\n: red fruit\n; orange\n: orange fruit\n; banana\n: yellow fruit\n\nTight using tabs:\n\n; apple\n: red fruit\n; orange\n: orange fruit\n; banana\n: yellow fruit\n\nLoose:\n\n; apple\n: red fruit\n\n; orange\n: orange fruit\n\n; banana\n: yellow fruit\n\n\nMultiple blocks with italics:\n\n; //apple//\n: red fruit\n\ncontains seeds, crisp, pleasant to taste\n\n; //orange//\n: orange fruit\n\n\n{{code}}\n{ orange code block }\n{{/code}}\n\n>orange block quote\n>\n\nMultiple definitions, tight:\n\n; apple\n: red fruit\n: computer\n; orange\n: orange fruit\n: bank\n\nMultiple definitions, loose:\n\n; apple\n: red fruit\n\n: computer\n\n; orange\n: orange fruit\n\n: bank\n\n\nBlank line after term, indented marker, alternate markers:\n\n; apple\n: red fruit\n\n: computer\n\n; orange\n: orange fruit\n\n;1. sublist\n;1. sublist\n\n= HTML Blocks {{id name=\"html-blocks\" /}}=\n\nSimple block on one line:\n\nfoo\nAnd nested without indentation:\n\nfoo\n\nbar\nInterpreted markdown in a table:\n\n\n\n\nThis is //emphasized//\n\n\nAnd this is **strong**\n\n\n\n\nHere’s a simple block:\n\nfoo\n\nThis should be a code block, though:\n\n\n{{code}}\n<div>\n    foo\n</div>\n{{/code}}\n\nAs should this:\n\n\n{{code}}\n<div>foo</div>\n{{/code}}\n\nNow, nested:\n\nfoo\nThis should just be an HTML comment:\n\n\nMultiline:\n\n\n\nCode block:\n\n\n{{code}}\n<!-- Comment -->\n{{/code}}\n\nJust plain comment, with trailing spaces on the line:\n\n\nCode:\n\n\n{{code}}\n<hr />\n{{/code}}\n\nHr’s:\n\n\n\n\n\n\n\n\n\n\n\n----\n\n= Inline Markup {{id name=\"inline-markup\" /}}=\n\nThis is //emphasized//, and so //is this//.\n\nThis is **strong**, and so **is this**.\n\nAn //[[emphasized link>>/url]]//.\n\n**//This is strong and em.//**\n\nSo is **//this//** word.\n\n**//This is strong and em.//**\n\nSo is **//this//** word.\n\nThis is code: {{code}}>{{/code}}, {{code}}${{/code}}, {{code}}\\{{/code}}, {{code}}\\${{/code}}, {{code}}<html>{{/code}}.\n\n--This is //strikeout//.--\n\nSuperscripts: a^^bc^^d a^^//hello//^^ a^^hello there^^.\n\nSubscripts: H,,2,,O, H,,23,,O, H,,many of them,,O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~~b c~~d.\n\n\n----\n\n= Smart quotes, ellipses, dashes {{id name=\"smart-quotes-ellipses-dashes\" /}}=\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘{{code}}code{{/code}}’ and a “[[quoted link>>http://example.com/?foo=1&bar=2]]”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n\n----\n\n= LaTeX {{id name=\"latex\" /}}=\n\n*. \n*. {{formula}}2+2=4{{/formula}}\n*. {{formula}}x \\in y{{/formula}}\n*. {{formula}}\\alpha \\wedge \\omega{{/formula}}\n*. {{formula}}223{{/formula}}\n*. {{formula}}p{{/formula}}-Tree\n*. Here’s some display math: {{formula}}\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}{{/formula}}\n*. Here’s one that has a line break in it: {{formula}}\\alpha + \\omega \\times x^2{{/formula}}.\n\nThese shouldn’t be math:\n\n*. To get the famous equation, write {{code}}$e = mc^2${{/code}}.\n*. $22,000 is a //lot// of money. So is $34,000. (It worked if “lot” is emphasized.)\n*. Shoes ($20) and socks ($5).\n*. Escaped {{code}}${{/code}}: $73 //this should be emphasized// 23$.\n\nHere’s a LaTeX table:\n\n\n\n----\n\n= Special Characters {{id name=\"special-characters\" /}}=\n\nHere is some unicode:\n\n*. I hat: Î\n*. o umlaut: ö\n*. section: §\n*. set membership: ∈\n*. copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n\n----\n\n= Links {{id name=\"links\" /}}=\n\n== Explicit {{id name=\"explicit\" /}}==\n\nJust a [[URL>>/url/]].\n\n[[URL and title>>/url/]].\n\n[[URL and title>>/url/]].\n\n[[URL and title>>/url/]].\n\n[[URL and title>>/url/]]\n\n[[URL and title>>/url/]]\n\n[[with_underscore>>/url/with_underscore]]\n\n[[Email link>>mailto:nobody@nowhere.net]]\n\n[[Empty>>]].\n\n== Reference {{id name=\"reference\" /}}==\n\nFoo [[bar>>/url/]].\n\nWith [[embedded [brackets]>>/url/]].\n\n[[b>>/url/]] by itself should be a link.\n\nIndented [[once>>/url]].\n\nIndented [[twice>>/url]].\n\nIndented [[thrice>>/url]].\n\nThis should [not][] be a link.\n\n\n{{code}}\n[not]: /url\n{{/code}}\n\nFoo [[bar>>/url/]].\n\nFoo [[biz>>/url/]].\n\n== With ampersands {{id name=\"with-ampersands\" /}}==\n\nHere’s a [[link with an ampersand in the URL>>http://example.com/?foo=1&bar=2]].\n\nHere’s a link with an amersand in the link text: [[AT&T>>http://att.com/]].\n\nHere’s an [[inline link>>/script?foo=1&bar=2]].\n\nHere’s an [[inline link in pointy braces>>/script?foo=1&bar=2]].\n\n== Autolinks {{id name=\"autolinks\" /}}==\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n*. In a list?\n*. http://example.com/\n*. It should.\n\nAn e-mail address: [[nobody@nowhere.net>>mailto:nobody@nowhere.net]]\n\n>Blockquoted: http://example.com/\n>\nAuto-links should not occur here: {{code}}<http://example.com/>{{/code}}\n\n\n{{code}}\nor here: <http://example.com/>\n{{/code}}\n\n\n----\n\n= Images {{id name=\"images\" /}}=\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n(((\n[[image:lalune.jpg||alt=\"lalune\" title=\"Voyage dans la Lune\"]]\n)))\nHere is a movie [[image:movie.jpg||alt=\"movie\"]] icon.\n\n\n----\n\n= Footnotes {{id name=\"footnotes\" /}}=\n\nHere is a footnote reference,{{footnote}}Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.{{/footnote}} and another.{{footnote}}Here’s the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with list items).\n\n\n{{code}}\n  { <code> }\n{{/code}}\n\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.{{/footnote}} This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.{{footnote}}This is //easier// to type. Inline notes may contain [[links>>http://google.com]] and {{code}}]{{/code}} verbatim characters, as well as [bracketed text].{{/footnote}}\n\n>Notes can go in quotes.{{footnote}}In quote.{{/footnote}}\n>\n1. And in list items.{{footnote}}In list.{{/footnote}}\n\nThis paragraph should not be part of the note, as it is not indented.\n"
  },
  {
    "path": "test/writer.zimwiki",
    "content": "Content-Type: text/x-zim-wiki\nWiki-Format: zim 0.4\n\nThis is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.\n\n\n----\n\n====== Headers ======\n\n===== Level 2 with an [[url|embedded link]] =====\n\n==== Level 3 with //emphasis// ====\n\n=== Level 4 ===\n\n== Level 5 ==\n\n====== Level 1 ======\n\n===== Level 2 with //emphasis// =====\n\n==== Level 3 ====\n\nwith no blank line\n\n===== Level 2 =====\n\nwith no blank line\n\n\n----\n\n====== Paragraphs ======\n\nHere’s a regular paragraph.\n\nIn Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\n\nHere’s one with a bullet. * criminey.\n\nThere should be a hard line break\nhere.\n\n\n----\n\n====== Block Quotes ======\n\nE-mail style:\n\n> This is a block quote. It is pretty short.\n\n> Code in a block quote:\n> \n> '''\n> sub status {\n>     print \"working\";\n> }\n> '''\n> \n> A list:\n> \n> 1. item one\n> 2. item two\n> \n> Nested block quotes:\n> \n> > nested\n> \n> > nested\n\nThis should not be a block quote: 2 > 1.\n\nAnd a following paragraph.\n\n\n----\n\n====== Code Blocks ======\n\nCode:\n\n'''\n---- (should be four hyphens)\n\nsub status {\n    print \"working\";\n}\n\nthis code block is indented by one tab\n'''\n\nAnd:\n\n'''\n    this code block is indented by two tabs\n\nThese should not be escaped:  \\$ \\\\ \\> \\[ \\{\n'''\n\n\n----\n\n====== Lists ======\n\n===== Unordered =====\n\nAsterisks tight:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nAsterisks loose:\n\n* asterisk 1\n* asterisk 2\n* asterisk 3\n\nPluses tight:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nPluses loose:\n\n* Plus 1\n* Plus 2\n* Plus 3\n\nMinuses tight:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\nMinuses loose:\n\n* Minus 1\n* Minus 2\n* Minus 3\n\n===== Ordered =====\n\nTight:\n\n1. First\n2. Second\n3. Third\n\nand:\n\n1. One\n2. Two\n3. Three\n\nLoose using tabs:\n\n1. First\n2. Second\n3. Third\n\nand using spaces:\n\n1. One\n2. Two\n3. Three\n\nMultiple paragraphs:\n\n1. Item 1, graf one.\nItem 1. graf two. The quick brown fox jumped over the lazy dog’s back.\n2. Item 2.\n3. Item 3.\n\n===== Nested =====\n\n* Tab\n\t* Tab\n\t\t* Tab\n\nHere’s another:\n\n1. First\n2. Second:\n\t* Fee\n\t* Fie\n\t* Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n2. Second:\n\t* Fee\n\t* Fie\n\t* Foe\n3. Third\n\n===== Tabs and spaces =====\n\n* this is a list item indented with tabs\n* this is a list item indented with spaces\n\t* this is an example list item indented with tabs\n\t* this is an example list item indented with spaces\n\n===== Fancy list markers =====\n\n1. begins with 2\n2. and now 3\nwith a continuation\n\t1. sublist with roman numerals, starting with 4\n\t2. more items\n\t\t1. a subsublist\n\t\t2. a subsublist\n\nNesting:\n\n1. Upper Alpha\n\t1. Upper Roman.\n\t\t1. Decimal start with 6\n\t\t\t1. Lower alpha with paren\n\nAutonumbering:\n\n1. Autonumber.\n2. More.\n\t1. Nested.\n\nShould not be a list item:\n\nM.A. 2007\n\nB. Williams\n\n\n----\n\n====== Definition Lists ======\n\nTight using spaces:\n\n* **apple** red fruit\n* **orange** orange fruit\n* **banana** yellow fruit\nTight using tabs:\n\n* **apple** red fruit\n* **orange** orange fruit\n* **banana** yellow fruit\nLoose:\n\n* **apple** red fruit\n\n* **orange** orange fruit\n\n* **banana** yellow fruit\n\nMultiple blocks with italics:\n\n* **//apple//** red fruit\n\ncontains seeds, crisp, pleasant to taste\n\n* **//orange//** orange fruit\n\n'''\n{ orange code block }\n'''\n\n> orange block quote\n\nMultiple definitions, tight:\n\n* **apple** red fruitcomputer\n* **orange** orange fruitbank\nMultiple definitions, loose:\n\n* **apple** red fruit\ncomputer\n\n* **orange** orange fruit\nbank\n\nBlank line after term, indented marker, alternate markers:\n\n* **apple** red fruit\ncomputer\n\n* **orange** orange fruit\n\n1. sublist\n2. sublist\n\n====== HTML Blocks ======\n\nSimple block on one line:\n\nfoo\n\nAnd nested without indentation:\n\nfoo\n\n\n\nbar\n\n\nInterpreted markdown in a table:\n\n\n\n\nThis is //emphasized//\n\n\nAnd this is **strong**\n\n\n\n\nHere’s a simple block:\n\nfoo\n\n\nThis should be a code block, though:\n\n'''\n<div>\n    foo\n</div>\n'''\n\nAs should this:\n\n'''\n<div>foo</div>\n'''\n\nNow, nested:\n\nfoo\n\n\n\nThis should just be an HTML comment:\n\n\nMultiline:\n\n\n\nCode block:\n\n'''\n<!-- Comment -->\n'''\n\nJust plain comment, with trailing spaces on the line:\n\n\nCode:\n\n'''\n<hr />\n'''\n\nHr’s:\n\n\n\n\n\n\n\n\n\n\n\n----\n\n====== Inline Markup ======\n\nThis is //emphasized//, and so //is this//.\n\nThis is **strong**, and so **is this**.\n\nAn //[[url|emphasized link]]//.\n\n**//This is strong and em.//**\n\nSo is **//this//** word.\n\n**//This is strong and em.//**\n\nSo is **//this//** word.\n\nThis is code: ''>'', ''$'', ''\\'', ''\\$'', ''<html>''.\n\n~~This is //strikeout//.~~\n\nSuperscripts: a^{bc}d a^{//hello//} a^{hello there}.\n\nSubscripts: H_{2}O, H_{23}O, H_{many of them}O.\n\nThese should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\n\n\n----\n\n====== Smart quotes, ellipses, dashes ======\n\n“Hello,” said the spider. “‘Shelob’ is my name.”\n\n‘A’, ‘B’, and ‘C’ are letters.\n\n‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’\n\n‘He said, “I want to go.”’ Were you alive in the 70’s?\n\nHere is some quoted ‘''code''’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.\n\nSome dashes: one—two — three—four — five.\n\nDashes between numbers: 5–7, 255–66, 1987–1999.\n\nEllipses…and…and….\n\n\n----\n\n====== LaTeX ======\n\n* \n* $2+2=4$\n* $x \\in y$\n* $\\alpha \\wedge \\omega$\n* $223$\n* $p$-Tree\n* Here’s some display math: $$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$$\n* Here’s one that has a line break in it: $\\alpha + \\omega \\times x^2$.\n\nThese shouldn’t be math:\n\n* To get the famous equation, write ''$e = mc^2$''.\n* $22,000 is a //lot// of money. So is $34,000. (It worked if “lot” is emphasized.)\n* Shoes ($20) and socks ($5).\n* Escaped ''$'': $73 //this should be emphasized// 23$.\n\nHere’s a LaTeX table:\n\n\n\n----\n\n====== Special Characters ======\n\nHere is some unicode:\n\n* I hat: Î\n* o umlaut: ö\n* section: §\n* set membership: ∈\n* copyright: ©\n\nAT&T has an ampersand in their name.\n\nAT&T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nBackslash: \\\n\nBacktick: `\n\nAsterisk: *\n\nUnderscore: _\n\nLeft brace: {\n\nRight brace: }\n\nLeft bracket: [\n\nRight bracket: ]\n\nLeft paren: (\n\nRight paren: )\n\nGreater-than: >\n\nHash: #\n\nPeriod: .\n\nBang: !\n\nPlus: +\n\nMinus: -\n\n\n----\n\n====== Links ======\n\n===== Explicit =====\n\nJust a [[url/|URL]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]].\n\n[[url/|URL and title]]\n\n[[url/|URL and title]]\n\n[[url/with_underscore|with_underscore]]\n\n[[mailto:nobody@nowhere.net|Email link]]\n\n[[|Empty]].\n\n===== Reference =====\n\nFoo [[url/|bar]].\n\nWith [[url/|embedded [brackets]]].\n\n[[url/|b]] by itself should be a link.\n\nIndented [[url|once]].\n\nIndented [[url|twice]].\n\nIndented [[url|thrice]].\n\nThis should [not][] be a link.\n\n'''\n[not]: /url\n'''\n\nFoo [[url/|bar]].\n\nFoo [[url/|biz]].\n\n===== With ampersands =====\n\nHere’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].\n\nHere’s a link with an amersand in the link text: [[http://att.com/|AT&T]].\n\nHere’s an [[script?foo=1&bar=2|inline link]].\n\nHere’s an [[script?foo=1&bar=2|inline link in pointy braces]].\n\n===== Autolinks =====\n\nWith an ampersand: http://example.com/?foo=1&bar=2\n\n* In a list?\n* http://example.com/\n* It should.\n\nAn e-mail address: <nobody@nowhere.net>\n\n> Blockquoted: http://example.com/\n\nAuto-links should not occur here: ''<http://example.com/>''\n\n'''\nor here: <http://example.com/>\n'''\n\n\n----\n\n====== Images ======\n\nFrom “Voyage dans la Lune” by Georges Melies (1902):\n\n{{lalune.jpg|Voyage dans la Lune}}\nlalune\n\n\nHere is a movie {{movie.jpg|movie}} icon.\n\n\n----\n\n====== Footnotes ======\n\nHere is a footnote reference, **{Note:** Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.**}** and another. **{Note:** Here’s the long note. This one contains multiple blocks.\n\nSubsequent blocks are indented to show that they belong to the footnote (as with list items).\n\n'''\n  { <code> }\n'''\n\nIf you want, you can indent every line, but you can also be lazy and just indent the first line of each block.**}** This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note. **{Note:** This is //easier// to type. Inline notes may contain [[http://google.com|links]] and '']'' verbatim characters, as well as [bracketed text].**}**\n\n> Notes can go in quotes. **{Note:** In quote.**}**\n\n1. And in list items. **{Note:** In list.**}**\n\nThis paragraph should not be part of the note, as it is not indented.\n"
  },
  {
    "path": "test/writers-lang-and-dir.context",
    "content": "% Enable hyperlinks\n\\setupinteraction\n  [state=start,\n  style=,\n  color=,\n  contrastcolor=]\n\\setupurl[style=]\n\n% make chapter, section bookmarks visible when opening document\n\\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]\n\\setupinteractionscreen[option={bookmark,title}]\n\n\\setuppagenumbering[location={footer,middle}]\n\\setupstructure[state=start,method=auto]\n\n% use microtypography\n\\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]\n\\definefontfeature[default:tnum][default][tnum=yes, pnum=no]\n\\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]\n\\setupalign[hz,hanging]\n\\setupitaliccorrection[global, always]\n\n\\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted\n\n\\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]\n\\definefontfamily[mainface][rm][Latin Modern Roman]\n\\definefontfamily[mainface][mm][Latin Modern Math]\n\\definefontfamily[mainface][ss][Latin Modern Sans]\n\\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]\n\\setupbodyfont[mainface]\n\n\\setupwhitespace[medium]\n\n\\setuphead[chapter]            [style=\\tfd\\setupinterlinespace,header=empty]\n\\setuphead[section]            [style=\\tfc\\setupinterlinespace]\n\\setuphead[subsection]         [style=\\tfb\\setupinterlinespace]\n\\setuphead[subsubsection]      [style=\\bf]\n\\setuphead[subsubsubsection]   [style=\\sc]\n\\setuphead[subsubsubsubsection][style=\\it]\n\n\\definesectionlevels\n   [default]\n   [section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]\n\n\\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]\n\n\\definedescription\n  [description]\n  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]\n\n\\setupitemize[autointro]    % prevent orphan list intro\n\\setupitemize[indentnext=no]\n\n\\defineitemgroup[enumerate]\n\\setupenumerate[each][fit][itemalign=left,distance=.5em,style={\\feature[+][default:tnum]}]\n\n\\setupfloat[figure][default={here,nonumber}]\n\\setupfloat[table][default={here,nonumber}]\n\n\\setupxtable[frame=off]\n\\setupxtable[head][topframe=on]\n\\setupxtable[body][]\n\\setupxtable[foot][]\n\\setupxtable[lastrow][bottomframe=on]\n\n\n\\starttext\n\n\\startsectionlevel[title={Empty Divs and\nSpans},reference={empty-divs-and-spans}]\n\nSome text and\n\ndiv contents\n\nand more text.\n\nNext paragraph with a span and a word-thatincludesaspanright?\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Directionality},reference={directionality}]\n\nSome text and\n\n\\startalignment[righttoleft]\nrtl div contents\n\n\\stopalignment\n\nand more text.\n\n\\startalignment[lefttoright]\nand a ltr div. with a {\\righttoleft rtl span}.\n\n\\stopalignment\n\nNext paragraph with a {\\righttoleft rtl span} and a\nword-that-includesa{\\lefttoright ltrspan}right?\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Languages},reference={languages}]\n\nSome text and\n\n\\start\\language[de]\nGerman div contents\n\n\\stop\n\nand more text.\n\nNext paragraph with a {\\language[en-gb]British span} and a\nword-that-includesa{\\language[de-ch]Swiss German span}right?\n\nSome {\\language[es]Spanish text}.\n\n\\stopsectionlevel\n\n\\startsectionlevel[title={Combined},reference={combined}]\n\nSome text and\n\n\\start\\language[fr]\n\\startalignment[righttoleft]\nFrench rtl div contents\n\n\\stopalignment\n\\stop\n\nand more text.\n\nNext paragraph with a {\\language[en-gb]{\\lefttoright British ltr span}}\nand a word-that-includesa{\\language[de-ch]{\\lefttoright Swiss German ltr\nspan}}right?\n\n\\stopsectionlevel\n\n\\stoptext\n"
  },
  {
    "path": "test/writers-lang-and-dir.latex",
    "content": "% Options for packages loaded elsewhere\n\\PassOptionsToPackage{unicode}{hyperref}\n\\PassOptionsToPackage{hyphens}{url}\n\\documentclass[\n  ngerman,\n  british,\n  nswissgerman,\n  spanish,\n  french,\n  english,\n]{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath,amssymb}\n\\setcounter{secnumdepth}{-\\maxdimen} % remove section numbering\n\\usepackage{iftex}\n\\ifPDFTeX\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n  \\usepackage{textcomp} % provide euro and other symbols\n\\else % if luatex or xetex\n  \\usepackage{unicode-math} % this also loads fontspec\n  \\defaultfontfeatures{Scale=MatchLowercase}\n  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX,Scale=1}\n\\fi\n\\usepackage{lmodern}\n\\ifPDFTeX\\else\n  % xetex/luatex font selection\n\\fi\n% Use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\IfFileExists{microtype.sty}{% use microtype if available\n  \\usepackage[]{microtype}\n  \\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n\\makeatletter\n\\@ifundefined{KOMAClassName}{% if non-KOMA class\n  \\IfFileExists{parskip.sty}{%\n    \\usepackage{parskip}\n  }{% else\n    \\setlength{\\parindent}{0pt}\n    \\setlength{\\parskip}{6pt plus 2pt minus 1pt}}\n}{% if KOMA class\n  \\KOMAoptions{parskip=half}}\n\\makeatother\n\\ifLuaTeX\n\\usepackage[bidi=basic,shorthands=off]{babel}\n\\else\n\\usepackage[bidi=default,shorthands=off]{babel}\n\\fi\n\\ifLuaTeX\n  \\usepackage{selnolig} % disable illegal ligatures\n\\fi\n\\setlength{\\emergencystretch}{3em} % prevent overfull lines\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\\ifPDFTeX\n  \\TeXXeTstate=1\n  \\newcommand{\\RL}[1]{\\beginR #1\\endR}\n  \\newcommand{\\LR}[1]{\\beginL #1\\endL}\n  \\newenvironment{RTL}{\\beginR}{\\endR}\n  \\newenvironment{LTR}{\\beginL}{\\endL}\n\\fi\n\\ifluatex\n  \\newcommand{\\RL}[1]{\\bgroup\\textdir TRT#1\\egroup}\n  \\newcommand{\\LR}[1]{\\bgroup\\textdir TLT#1\\egroup}\n  \\newenvironment{RTL}{\\textdir TRT\\pardir TRT\\bodydir TRT}{}\n  \\newenvironment{LTR}{\\textdir TLT\\pardir TLT\\bodydir TLT}{}\n\\fi\n\\usepackage{bookmark}\n\\IfFileExists{xurl.sty}{\\usepackage{xurl}}{} % add URL line breaks if available\n\\urlstyle{same}\n\\hypersetup{\n  pdflang={en},\n  hidelinks,\n  pdfcreator={LaTeX via pandoc}}\n\n\\author{}\n\\date{}\n\n\\begin{document}\n\n\\section{Empty Divs and Spans}\\label{empty-divs-and-spans}\n\nSome text and\n\ndiv contents\n\nand more text.\n\nNext paragraph with a {span} and a word-thatincludesa{span}right?\n\n\\section{Directionality}\\label{directionality}\n\nSome text and\n\n\\begin{RTL}\nrtl div contents\n\\end{RTL}\n\nand more text.\n\n\\begin{LTR}\nand a ltr div. with a \\RL{rtl span}.\n\\end{LTR}\n\nNext paragraph with a \\RL{rtl span} and a\nword-that-includesa\\LR{ltrspan}right?\n\n\\section{Languages}\\label{languages}\n\nSome text and\n\n\\begin{otherlanguage}{ngerman}\n\nGerman div contents\n\n\\end{otherlanguage}\n\nand more text.\n\nNext paragraph with a \\foreignlanguage{british}{British span} and a\nword-that-includesa\\foreignlanguage{nswissgerman}{Swiss German\nspan}right?\n\nSome \\foreignlanguage{spanish}{Spanish text}.\n\n\\section{Combined}\\label{combined}\n\nSome text and\n\n\\begin{RTL}\n\\begin{otherlanguage}{french}\n\nFrench rtl div contents\n\n\\end{otherlanguage}\n\\end{RTL}\n\nand more text.\n\nNext paragraph with a \\LR{\\foreignlanguage{british}{British ltr span}}\nand a word-that-includesa\\LR{\\foreignlanguage{nswissgerman}{Swiss German\nltr span}}right?\n\n\\end{document}\n"
  },
  {
    "path": "test/writers-lang-and-dir.native",
    "content": "Pandoc (Meta {unMeta = fromList []})\n[Header 1 (\"empty-divs-and-spans\",[],[]) [Str \"Empty\",Space,Str \"Divs\",Space,Str \"and\",Space,Str \"Spans\"]\n,Plain [Str \"Some\",Space,Str \"text\",Space,Str \"and\"]\n,Div (\"\",[],[]) [Para [Str \"div\",Space,Str \"contents\"]]\n,Para [Str \"and\",Space,Str \"more\",Space,Str \"text.\"]\n,Para [Str \"Next\",Space,Str \"paragraph\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[],[]) [Str \"span\"],Space,Str \"and\",Space,Str \"a\",Space,Str \"word-thatincludesa\",Span (\"\",[],[]) [Str \"span\"],Str \"right?\"]\n,Header 1 (\"directionality\",[],[]) [Str \"Directionality\"]\n,Plain [Str \"Some\",Space,Str \"text\",Space,Str \"and\"]\n,Div (\"\",[],[(\"dir\",\"rtl\")]) [Para [Str \"rtl\",Space,Str \"div\",Space,Str \"contents\"]]\n,Para [Str \"and\",Space,Str \"more\",Space,Str \"text.\"]\n,Div (\"\",[],[(\"dir\",\"ltr\")]) [Para [Str \"and\",Space,Str \"a\",Space,Str \"ltr\",Space,Str \"div.\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[],[(\"dir\",\"rtl\")]) [Str \"rtl\",Space,Str \"span\"],Str \".\"]]\n,Para [Str \"Next\",Space,Str \"paragraph\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[],[(\"dir\",\"rtl\")]) [Str \"rtl\",Space,Str \"span\"],Space,Str \"and\",Space,Str \"a\",Space,Str \"word-that-includesa\",Span (\"\",[],[(\"dir\",\"ltr\")]) [Str \"ltrspan\"],Str \"right?\"]\n,Header 1 (\"languages\",[],[]) [Str \"Languages\"]\n,Plain [Str \"Some\",Space,Str \"text\",Space,Str \"and\"]\n,Div (\"\",[],[(\"lang\",\"de\")]) [Para [Str \"German\",Space,Str \"div\",Space,Str \"contents\"]]\n,Para [Str \"and\",Space,Str \"more\",Space,Str \"text.\"]\n,Para [Str \"Next\",Space,Str \"paragraph\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[],[(\"lang\",\"en-GB\")]) [Str \"British\",Space,Str \"span\"],Space,Str \"and\",Space,Str \"a\",Space,Str \"word-that-includesa\",Span (\"\",[],[(\"lang\",\"de-CH\")]) [Str \"Swiss\",Space,Str \"German\",Space,Str \"span\"],Str \"right?\"]\n,Para [Str \"Some\",Space,Span (\"\",[],[(\"lang\",\"es\")]) [Str \"Spanish\",Space,Str \"text\"],Str \".\"]\n,Header 1 (\"combined\",[],[]) [Str \"Combined\"]\n,Plain [Str \"Some\",Space,Str \"text\",Space,Str \"and\"]\n,Div (\"\",[],[(\"lang\",\"fr\"),(\"dir\",\"rtl\")]) [Para [Str \"French\",Space,Str \"rtl\",Space,Str \"div\",Space,Str \"contents\"]]\n,Para [Str \"and\",Space,Str \"more\",Space,Str \"text.\"]\n,Para [Str \"Next\",Space,Str \"paragraph\",Space,Str \"with\",Space,Str \"a\",Space,Span (\"\",[],[(\"lang\",\"en-GB\"),(\"dir\",\"ltr\")]) [Str \"British\",Space,Str \"ltr\",Space,Str \"span\"],Space,Str \"and\",Space,Str \"a\",Space,Str \"word-that-includesa\",Span (\"\",[],[(\"lang\",\"de-CH\"),(\"dir\",\"ltr\")]) [Str \"Swiss\",Space,Str \"German\",Space,Str \"ltr\",Space,Str \"span\"],Str \"right?\"]]\n"
  },
  {
    "path": "test/xlsx-reader/basic.native",
    "content": "Pandoc\n  Meta { unMeta = fromList [] }\n  [ Header 2 ( \"sheet-1\" , [] , [] ) [ Str \"Main\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Strong [ Str \"Person\" ] ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Strong [ Str \"Age\" ] ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Strong [ Str \"Location\" ] ] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Anton\" , Space , Str \"Antich\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"23.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Switzerland\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"James\" , Space , Str \"Bond\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"35.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Moscow\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain\n                      [ Str \"Just\"\n                      , Space\n                      , Str \"a\"\n                      , Space\n                      , Str \"random\"\n                      , Space\n                      , Str \"cell\"\n                      ]\n                  ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  , Header 2 ( \"sheet-2\" , [] , [] ) [ Str \"Secondary\" ]\n  , Table\n      ( \"\" , [] , [] )\n      (Caption Nothing [])\n      [ ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      , ( AlignDefault , ColWidthDefault )\n      ]\n      (TableHead\n         ( \"\" , [] , [] )\n         [ Row\n             ( \"\" , [] , [] )\n             [ Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain\n                     [ Str \"Sum\"\n                     , Space\n                     , Str \"of\"\n                     , Space\n                     , Str \"Age\"\n                     ]\n                 ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [ Str \"Column\" , Space , Str \"Labels\" ] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [] ]\n             , Cell\n                 ( \"\" , [] , [] )\n                 AlignDefault\n                 (RowSpan 1)\n                 (ColSpan 1)\n                 [ Plain [] ]\n             ]\n         ])\n      [ TableBody\n          ( \"\" , [] , [] )\n          (RowHeadColumns 0)\n          []\n          [ Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Row\" , Space , Str \"Labels\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Moscow\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Switzerland\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"(blank)\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Grand\" , Space , Str \"Total\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Anton\" , Space , Str \"Antich\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"23.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"23.0\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"James\" , Space , Str \"Bond\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"35.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"35.0\" ] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"(blank)\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              ]\n          , Row\n              ( \"\" , [] , [] )\n              [ Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"Grand\" , Space , Str \"Total\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"35.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"23.0\" ] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [] ]\n              , Cell\n                  ( \"\" , [] , [] )\n                  AlignDefault\n                  (RowSpan 1)\n                  (ColSpan 1)\n                  [ Plain [ Str \"58.0\" ] ]\n              ]\n          ]\n      ]\n      (TableFoot ( \"\" , [] , [] ) [])\n  ]\n"
  },
  {
    "path": "tools/.editorconfig",
    "content": "[*.py]\nindent_size = 4\n"
  },
  {
    "path": "tools/build-and-upload-api-docs.sh",
    "content": "#!/bin/sh\nset -e\n\ndir=$(mktemp -d dist-docs.XXXXXX)\ntrap 'rm -r \"$dir\"' EXIT\n\ncabal v2-haddock --builddir=\"$dir\" --haddock-for-hackage\ncabal upload -d --publish $dir/*-docs.tar.gz\n"
  },
  {
    "path": "tools/build-arm.sh",
    "content": "#!/bin/sh\n\n#old version:\n#IMAGE_ID=ami-0fa8979d18f69948b\nIMAGE_ID=ami-0cd6b53a434812702\nINSTANCE_TYPE=t4g.2xlarge\nKEY_NAME=debian-arm-us-east-2\nSECURITY_GROUP_ID=sg-086ffbadc286c5c00\nARTIFACTS=\"${ARTIFACTS:-build-artifacts-$(date +%s)}\"\n\nSTARTTIME=$(date +%H:%M)\n\n# Spin up an ARM build machine using aws cli, build pandoc, and\n# download the artifact.\n#\n# We need to use us-east-2; since my us-west-1 has EC2-classic.\n# docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-classic-platform.html\n\naws configure set default.region us-east-2\n\necho \"Creating instance...\"\n\naws ec2 run-instances --image-id \"$IMAGE_ID\" --count 1 --instance-type \"$INSTANCE_TYPE\" --block-device-mapping 'DeviceName=/dev/xvda,Ebs={VolumeSize=16}' --key-name \"$KEY_NAME\" --security-group-ids \"$SECURITY_GROUP_ID\" > ec2.json\n\njq < ec2.json\n\n# Now get the public IP address.\n\nINSTANCEID=$(jq '.Instances[0].InstanceId' ec2.json | sed -e 's/\"//g')\nIPADDR=$(aws ec2 describe-instances --instance-ids=\"$INSTANCEID\" --query 'Reservations[0].Instances[0].PublicIpAddress' | sed -e 's/\"//g')\n\necho \"IP address is $IPADDR\"\n\nclean_up() {\n  echo \"Terminating the instance in 20 seconds...\"\n  echo \"Ctrl-C to preserve it.\"\n  sleep 20 && aws ec2 terminate-instances --instance-ids \"$INSTANCEID\"\n}\ntrap clean_up EXIT\n\necho \"Waiting for instance to start up...\"\n\nSTATUS=none\nwhile [ \"$STATUS\" != \"running\" ]\ndo\n  sleep 20\n  STATUS=$(aws ec2 describe-instance-status --instance-id \"$INSTANCEID\" | jq '.InstanceStatuses[0].InstanceState.Name' | sed -e 's/\"//g')\n  echo \"...$STATUS\"\ndone\n\n# At this point you can connect via SSH, or run this script:\n# $ ssh -i ~/.ssh/debian-arm-us-east-2.pem admin@$IPADDR\n\nssh -o \"StrictHostKeyChecking=no\" -i \"~/.ssh/$KEY_NAME.pem\" admin@$IPADDR uname -a\n\nSSH=\"ssh -i ~/.ssh/$KEY_NAME.pem admin@$IPADDR\"\n\necho \"Provisioning...\"\n\n$SSH <<EOF\nsudo apt-get update\nsudo apt-get upgrade -y\nsudo apt-get install -y apt-transport-https  ca-certificates curl gnupg git make\ncurl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg\necho \\\n  \"deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \\\n  \\$(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list\nsudo apt-get update\nsudo apt-get install -y docker-ce docker-ce-cli containerd.io\nsudo groupadd docker\nsudo usermod -aG docker admin\nEOF\n\necho \"Building...\"\n\n($SSH <<EOF\nmkdir src\ncd src || exit\ngit clone https://github.com/jgm/pandoc\ncd pandoc || exit\nmake debpkg\nEOF\n) &\n\n# Now we need to wait for the build to complete (this can take 3 hours).\n\nwhile true\ndo\n  sleep 20\n  # print free memory\n  $SSH \"free -h | grep Mem\"\n  # Check to see if the artifact has been produced\n  $SSH \"ls -l src/pandoc/linux/artifacts/DONE 2>/dev/null\" && break\ndone\n\n# Retrieve the artifacts\n\necho \"Successful build. Retrieving artifacts...\"\n\nscp -i \"$HOME/.ssh/$KEY_NAME.pem\" -r \"admin@$IPADDR:src/pandoc/linux/artifacts\" \"$ARTIFACTS\"\n\necho \"Artifacts saved in $ARTIFACTS\"\nls \"$ARTIFACTS\"\n\nENDTIME=$(date +%H:%M)\n\necho \"Started:  $STARTTIME\"\necho \"Finished: $ENDTIME\"\n\nexit 0\n"
  },
  {
    "path": "tools/changelog-helper.sh",
    "content": "#!/bin/sh\n# generate preliminary list of changes since changelog\n# was last modified\n\nlastmod=`git log -n1 --format=oneline changelog.md | awk '{print $1;}'`\nfiles=`git ls-tree -r master --name-only | grep --invert-match '^test\\/\\|^data\\/docx\\/\\|^data\\/odt\\/\\|^data\\/pptx\\/\\|^citeproc\\/\\|^data\\/translations\\/'`\nfor x in $files\ndo\n    echo $x 1>&2\n    commits=`git log -n1 $lastmod..HEAD $x`\n    if [ ! -z \"$commits\" ]\n    then\n        if echo $x | grep -q \"src\\/.*\\.hs\"\n        then\n            file=`echo $x | sed -e 's/src\\///' | sed -e 's/\\//\\./g' | sed -e 's/\\.hs$//'`\n        else\n            file=$x\n        fi\n        echo \"  * $file\"\n        git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" \"$x\"\n    fi\ndone\necho \"test/\" 1>&2\ngit log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" test/\ngit log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" data/docx/\ngit log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" data/odt/\ngit log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" data/pptx/\ngit log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" data/translations/\ngit log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' \"$lastmod..HEAD\" citeproc/\n\n"
  },
  {
    "path": "tools/changes_template.html",
    "content": "<details>\n  <summary>Click to expand changelog</summary>\n\n$body$\n\n</details>\n"
  },
  {
    "path": "tools/cliptree.gvpr",
    "content": "/* Construct subgraph reachable from node ARGV[0] by forward edges */\nBEG_G {\n  node_t r = node($,ARGV[0]);\n\n  $tvroot = r;\n  $tvtype = TV_fwd;\n  //print (\"//  Staring node: \", r.name);\n}\nN{\n  print (\"// subgraph node: \", $.name);\n  $tvroot=NULL;\n  subnode($T,$);\n}\nE{\n  print (\"// subgraph edge: \", $.name);\n  subedge($T,$);\n}\n"
  },
  {
    "path": "tools/diff-zip.sh",
    "content": "#!/bin/sh\n\n# This script allows you to compare two epub, odt, or docx\n# containers, ignoring insignificant formatting differences\n# in the XML contents.\n\nUNAME=$(uname)\nif [ \"$UNAME\" = \"Darwin\" ]; then\n    FIND=\"find -E\"\nelse\n    FIND=\"find -regextype posix-extended\"\nfi\n\nf1=\"$1\"\nf2=\"$2\"\ntest -f \"$f1\" -a -f \"$f2\" || {\n    echo \"Usage: diff-zip firstfile secondfile\" && exit 1\n}\nWORKDIR=$(mktemp -d -t diff-zip.XXX)\ntrap \"{ rm -r $WORKDIR; }\" EXIT\nunzip -q -d \"$WORKDIR/a\" \"$f1\"\nunzip -q -d \"$WORKDIR/b\" \"$f2\"\ncd \"$WORKDIR\"\nmkdir tidy\nfor x in a b; do\n    cp -r $x tidy/\n    $FIND $x -iregex '.*\\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p \"$(dirname tidy/$1)\" && tidy -q -xml -utf8 -i \"$1\" > \"tidy/$1\"' _ {} \\;\ndone\ncd tidy\nmkdir c\ncp -r a/* c/\ncp -r b/* c/\nfind c -type f -exec sh -c 'echo -e \"\\033[1m=== ${1#*/} ===\\033[0m\" ; diff -u \"a/${1#*/}\" \"b/${1#*/}\" 2>&1' _ {} \\;\n"
  },
  {
    "path": "tools/extract-changes.lua",
    "content": "-- Extract changes from latest version in changelog.\n\nfunction Pandoc(el)\n  local newblocks = {}\n  i = 1\n  while i <= #el.blocks and\n      not (el.blocks[i].t == \"Header\" and el.blocks[i].level == 2) do\n    i = i+1\n  end\n  while i <= #el.blocks do\n    i = i+1\n    if el.blocks[i].t == \"Header\" and el.blocks[i].level == 2 then\n      break\n    end\n    table.insert(newblocks, el.blocks[i])\n  end\n  return pandoc.Pandoc(newblocks)\nend\n"
  },
  {
    "path": "tools/github-upload.sh",
    "content": "#!/bin/bash\n\nVERSION=$1\nFULLNAME=pandoc-$VERSION\nread -s -p \"Token (https://github.com/settings/applications): \"  TOKEN\n\ncurl -H \"Authorization: token $TOKEN\" \\\n     -H \"Accept: application/vnd.github.manifold-preview\" \\\n     -H \"Content-Type: application/x-apple-diskimage\" \\\n     --data-binary @$FULLNAME.pkg.zip \\\n     \"https://uploads.github.com/repos/jgm/pandoc/releases/$VERSION/assets?name=$FULLNAME.pkg.zip\"\n\ncurl -H \"Authorization: token $TOKEN\" \\\n     -H \"Accept: application/vnd.github.manifold-preview\" \\\n     -H \"Content-Type: application/x-msi\" \\\n     --data-binary @$FULLNAME.msi \\\n     \"https://uploads.github.com/repos/jgm/pandoc/releases/$VERSION/assets?name=$FULLNAME.msi\"\n\n"
  },
  {
    "path": "tools/latex-package-dependencies.lua",
    "content": "-- Print latex packages needed by pandoc's default latex template.\n-- Usage: pandoc lua tools/latex-package-dependencies.lua\n\nlocal templ = pandoc.template.default(\"latex\")\n\nlocal packages = {}\n\ntempl:gsub(\"\\\\usepackage *%b[] *%{([^}]*)%}\", function(capt)\n  capt:gsub(\"([^,]+)\", function (pkg)\n    if not pkg:find(\"%$\") then\n      packages[pkg] = true\n    end\n  end)\nend)\n\ntempl:gsub(\"\\\\usepackage *%{([^}]*)%}\", function(capt)\n  capt:gsub(\"([^,]+)\", function (pkg)\n    if not pkg:find(\"%$\") then\n      packages[pkg] = true\n    end\n  end)\nend)\n\nfor pkg,_ in pairs(packages) do\n  print(pkg)\nend\n"
  },
  {
    "path": "tools/moduledeps.lua",
    "content": "-- Construct module dependency tree from modules.csv\n\nlocal dependencies = {}\n\nlocal csv = io.open(\"modules.csv\")\nlocal lines = csv:lines()\nlocal mode = arg[1]\nlocal roots = {}\nlocal i = 2\nwhile i <= #arg do\n  roots[i - 1] = arg[i]\n  i = i + 1\nend\n\nif not (mode == \"tree\" or mode == \"transitive\") then\n  io.write(\"Usage: lua moduledeps (tree|transitive) modulename\\n\")\n  io.exit(1)\nend\n\nif #roots == 0 then\n  io.write(\"Usage: lua moduledeps modulename+\\n\")\n  io.exit(1)\nend\n\nfor line in lines do\n  local _,_,mod,dep = string.find(line, \"([^,]+),([^,]+)\")\n  if not dependencies[mod] then\n    dependencies[mod] = {}\n  end\n  if not dependencies[dep] then\n    dependencies[dep] = {}\n  end\n  dependencies[mod][dep] = true\nend\n\nlocal transitive = {}\n\nfunction prind(ind, s)\n  io.write(string.rep(\" \",ind) .. s .. \"\\n\")\nend\n\nfunction add_transitive_deps(mod)\n  if transitive[mod] then\n    return\n  end\n  transitive[mod] = {}\n  for dep,_ in pairs(dependencies[mod]) do\n    transitive[mod][dep] = true\n    add_transitive_deps(dep)\n    for indirectdep,_ in pairs(transitive[dep]) do\n      transitive[mod][indirectdep] = true\n    end\n  end\nend\n\nfunction print_direct_deps(mod, ind)\n  ind = ind or 0\n  prind(ind, mod)\n  for dep,_ in pairs(dependencies[mod]) do\n    print_direct_deps(dep, ind + 2)\n  end\nend\n\nlocal seen = {}\nfor _,root in ipairs(roots) do\n  if mode == \"transitive\" then\n      add_transitive_deps(root)\n      for dep,_ in pairs(transitive[root]) do\n        if not seen[dep] then\n          prind(2,dep)\n          seen[dep] = true\n        end\n      end\n  elseif mode == \"tree\" then\n    print_direct_deps(root, 0)\n  end\nend\n"
  },
  {
    "path": "tools/pandoc-template-mode.el",
    "content": " ;;; pandoc-template-mode.el --- Pandoc-Template major mode\n\n;; Copyright (C) 2017\n\n;; Author: Václav Haisman\n;; Keywords: extensions\n\n;; This file is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 2, or (at your option)\n;; any later version.\n\n;; This file is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n;; GNU General Public License for more details.\n\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING.  If not, write to\n;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n;; Boston, MA 02111-1307, USA.\n\n ;;; Commentary:\n\n;;\n\n ;;; Code:\n\n(defvar pandoc-template-font-lock-keywords\n  '((\"\\\\(\\\\$--.*\\\\)$\"\n      (1 font-lock-comment-face))\n    (\"\\\\(\\\\$\\\\)\\\\(if\\\\|for\\\\)(\\\\([^)]+\\\\))\\\\(\\\\$\\\\)\"\n      (1 font-lock-preprocessor-face)\n      (2 font-lock-keyword-face)\n      (3 font-lock-variable-name-face)\n      (4 font-lock-preprocessor-face))\n     (\"\\\\(\\\\$\\\\)\\\\(endif\\\\|endfor\\\\|else\\\\)\\\\(\\\\$\\\\)\"\n      (1 font-lock-preprocessor-face)\n      (2 font-lock-keyword-face)\n      (3 font-lock-preprocessor-face))\n     (\"\\\\(\\\\$\\\\)\\\\(sep\\\\)\\\\(\\\\$\\\\)\"\n      (1 font-lock-preprocessor-face)\n      (2 font-lock-builtin-face)\n      (3 font-lock-preprocessor-face))\n     (\"\\\\(\\\\$\\\\)\\\\([^$]+\\\\)\\\\(\\\\$\\\\)\"\n      (1 font-lock-preprocessor-face)\n      (2 font-lock-variable-name-face)\n      (3 font-lock-preprocessor-face))\n     )\n  \"Keyword highlighting specification for `pandoc-template-mode'.\")\n\n ;;;###autoload\n(define-derived-mode pandoc-template-mode fundamental-mode \"Pandoc-Template\"\n  \"A major mode for editing Pandoc-Template files.\"\n  :syntax-table text-mode-syntax-table\n  (setq-local font-lock-defaults\n              '(pandoc-template-font-lock-keywords))\n  (setq-local comment-start \"$--\")\n  (setq-local comment-start-skip \"\\\\$--[ \\t]*\")\n  (setq-local comment-end \"\")\n  (setq-local comment-end-skip \"[ \\t]*$\"))\n\n(provide 'pandoc-template-mode)\n ;;; pandoc-template.el ends here\n"
  },
  {
    "path": "tools/pandoc-xml.dtd",
    "content": "<!--\nA DTD for Pandoc XML format.\nCopyright   : Copyright (C) 2025- Massimiliano Farinella\nLicense     : GNU GPL, version 2 or above\nMaintainer  : Massimiliano Farinella <massifrg@gmail.com>\n\nThis is a DTD for the XML representation of Pandoc AST.\nIt's an equivalent of native and JSON formats, but modeled as XML.\nYou can validate Pandoc XML documents with this DTD,\nbut there are some limitations:\n- a Pandoc Attr can contain arbitrary attributes, but it looks like you can't tell\n  an element has arbitrary attributes in a DTD\n- some Pandoc attributes have constraints that can't be specified with a DTD\nThe Relax-NG and XML Schema translations of this specification overcome\nsome of those limitations (see pandoc-xml.rng and pandoc-xml.xsd).\n-->\n<!ELEMENT Pandoc (meta, blocks)>\n<!ATTLIST Pandoc api-version CDATA #REQUIRED>\n\n<!ENTITY % block \"Para | Plain | Header | Div | BlockQuote | HorizontalRule | BulletList | OrderedList | DefinitionList | Table | Figure | LineBlock | CodeBlock | RawBlock\">\n\n<!ENTITY % inline_element \"Str | Space | Emph | Strong | Underline | Strikeout | Superscript | Subscript | SmallCaps | Quoted | Cite | Code | SoftBreak | LineBreak | Math | RawInline | Link | Image | Note | Span\">\n<!ENTITY % inline \"#PCDATA | %inline_element;\">\n\n<!ENTITY % attr \"id ID #IMPLIED class CDATA #IMPLIED\">\n\n<!ENTITY % metavalue \"MetaMap | MetaList | MetaBool | MetaString | MetaInlines | MetaBlocks\">\n\n<!ELEMENT meta (entry*)>\n<!ELEMENT MetaMap (entry*)>\n\n<!ELEMENT entry (%metavalue;)*>\n<!ATTLIST entry key CDATA #REQUIRED>\n\n<!ELEMENT MetaList (%metavalue;)*>\n\n<!ELEMENT MetaBool EMPTY>\n<!ATTLIST MetaBool value (true | false) #REQUIRED>\n\n<!ELEMENT MetaString (#PCDATA)>\n\n<!ELEMENT MetaInlines (%inline;)*>\n\n<!ELEMENT MetaBlocks (%block;)*>\n\n<!ELEMENT blocks (%block;)*>\n\n<!ELEMENT Para (%inline;)*>\n\n<!ELEMENT Plain (%inline;)*>\n\n<!ELEMENT Header (%inline;)*>\n<!ATTLIST Header\n  level CDATA \"1\"\n  %attr;>\n\n<!ELEMENT Div (%block;)* >\n<!ATTLIST Div\n  custom-style CDATA #IMPLIED\n  %attr;>\n\n<!ELEMENT BlockQuote (%block;)*>\n\n<!ELEMENT HorizontalRule EMPTY>\n\n<!ELEMENT BulletList (item)+>\n\n<!ELEMENT OrderedList (item)+>\n<!ATTLIST OrderedList\n  start CDATA \"1\"\n  number-style (DefaultStyle | Example | Decimal | LowerRoman | UpperRoman | LowerAlpha | UpperAlpha) \"DefaultStyle\"\n  number-delim (DefaultDelim | Period | OneParen | TwoParens) \"DefaultDelim\">\n\n<!ELEMENT DefinitionList (item)+>\n\n<!ELEMENT item ((%block;)*|(term,def+))>\n<!ELEMENT term (%inline;)*>\n<!ELEMENT def (%block;)*>\n\n<!ELEMENT Table (Caption, colspecs, TableHead, TableBody+, TableFoot)>\n<!ATTLIST Table\n  custom-style CDATA #IMPLIED\n  %attr;>\n<!ELEMENT Caption (ShortCaption?, (%block;)*)>\n<!ELEMENT ShortCaption (%inline;)*>\n<!ELEMENT colspecs (ColSpec+)>\n<!ELEMENT ColSpec EMPTY>\n<!ATTLIST ColSpec\n  alignment (AlignLeft | AlignRight | AlignCenter | AlignDefault) \"AlignDefault\"\n  col-width CDATA \"0\">\n<!ELEMENT TableHead (Row*)>\n<!ATTLIST TableHead %attr;>\n<!ELEMENT TableFoot (Row*)>\n<!ATTLIST TableFoot %attr;>\n<!ELEMENT TableBody (header, body)>\n<!ATTLIST TableBody\n  row-head-columns CDATA \"0\"\n  %attr;>\n<!ELEMENT header (Row*)>\n<!ELEMENT body (Row*)>\n<!ELEMENT Row (Cell*)>\n<!ATTLIST Row %attr;>\n<!ELEMENT Cell (%block;)*>\n<!ATTLIST Cell\n  alignment (AlignLeft | AlignRight | AlignCenter | AlignDefault) \"AlignDefault\"\n  row-span CDATA \"1\"\n  col-span CDATA \"1\"\n  %attr; >\n\n<!ELEMENT Figure (Caption,(%block;)*)>\n<!ATTLIST Figure %attr;>\n\n<!ELEMENT LineBlock (line+)>\n<!ELEMENT line (%inline;)*>\n\n<!ELEMENT CodeBlock (#PCDATA)>\n<!ATTLIST CodeBlock %attr;>\n\n<!ELEMENT RawBlock (#PCDATA)>\n<!ATTLIST RawBlock format CDATA #REQUIRED>\n\n<!ELEMENT Space EMPTY>\n<!ATTLIST Space count CDATA \"1\">\n\n<!ELEMENT Str EMPTY>\n<!ATTLIST Str content CDATA \"\">\n\n<!ELEMENT Emph (%inline;)*>\n<!ELEMENT Strong (%inline;)*>\n<!ELEMENT Underline (%inline;)*>\n<!ELEMENT Strikeout (%inline;)*>\n<!ELEMENT Superscript (%inline;)*>\n<!ELEMENT Subscript (%inline;)*>\n<!ELEMENT SmallCaps (%inline;)*>\n\n<!ELEMENT Span (%inline;)*>\n<!ATTLIST Span\n  custom-style CDATA #IMPLIED\n  %attr;>\n\n<!ELEMENT Quoted (%inline;)*>\n<!ATTLIST Quoted quote-type (SingleQuote | DoubleQuote) \"DoubleQuote\">\n\n<!ELEMENT Math (#PCDATA)>\n<!ATTLIST Math math-type (DisplayMath\t| InlineMath) \"InlineMath\">\n\n<!ELEMENT RawInline (#PCDATA)>\n<!ATTLIST RawInline format CDATA #REQUIRED>\n\n<!ELEMENT Cite (#PCDATA | citations | %inline_element;)*>\n<!ELEMENT citations (Citation)+>\n<!ELEMENT Citation (prefix?, suffix?)>\n<!ELEMENT prefix (%inline;)*>\n<!ELEMENT suffix (%inline;)*>\n<!ATTLIST Citation\n  id CDATA #IMPLIED\n  note-num CDATA #IMPLIED\n  hash CDATA \"0\"\n  mode (AuthorInText\t| SuppressAuthor | NormalCitation) \"AuthorInText\">\n\n<!ELEMENT Code (#PCDATA)>\n<!ATTLIST Code %attr;>\n\n<!ENTITY % target \"title CDATA #IMPLIED url CDATA #IMPLIED\">\n\n<!ELEMENT Image (%inline;)*>\n<!ATTLIST Image\n  title CDATA #IMPLIED\n  src CDATA #IMPLIED\n  %attr;>\n\n<!ELEMENT Link (%inline;)*>\n<!ATTLIST Link\n  title CDATA #IMPLIED\n  href CDATA #IMPLIED\n  %attr;>\n\n<!ELEMENT SoftBreak EMPTY>\n<!ELEMENT LineBreak EMPTY>\n\n<!ELEMENT Note (%block;)*>\n"
  },
  {
    "path": "tools/pandoc-xml.rnc",
    "content": "# A RELAX NG schema for Pandoc XML format.\n# Copyright   : Copyright (C) 2025- Massimiliano Farinella\n# License     : GNU GPL, version 2 or above\n# Maintainer  : Massimiliano Farinella <massifrg@gmail.com>\n# \n# This is a RELAX NG schema for the XML representation of Pandoc AST.\n# It's an equivalent of native and JSON formats, but modeled as XML.\n# You can use this schema to validate Pandoc XML documents.\n# It's translated from pandoc-xml.dtd with the \"Trang\" software by James Clark,\n# and adjusted manually to add some constraints:\n# - elements with Attr can have arbitrary attributes (this is not possible with a DTD)\n# - Header's \"level\", OrderedList's \"start\" and Cell's \"rowspan\" and \"colspan\" attributes\n#   must be a positive integer and are equal to 1 if not specified\n# - column widths in ColSpec must be between 0 and 1 (inclusive, with 0=ColWidthDefault)\n# - the \"count\" attribute in the \"<Space>\" element must be positive and equal to 1 if not specified\n\nnamespace a = \"http://relaxng.org/ns/compatibility/annotations/1.0\"\n\nPandoc = element Pandoc { attlist_Pandoc, meta, blocks }\nattlist_Pandoc &= attribute api-version { text }\nblock =\n  Para\n  | Plain\n  | Header\n  | Div\n  | BlockQuote\n  | HorizontalRule\n  | BulletList\n  | OrderedList\n  | DefinitionList\n  | Table\n  | Figure\n  | LineBlock\n  | CodeBlock\n  | RawBlock\ninline_element =\n  Str\n  | Space\n  | Emph\n  | Strong\n  | Underline\n  | Strikeout\n  | Superscript\n  | Subscript\n  | SmallCaps\n  | Quoted\n  | Cite\n  | Code\n  | SoftBreak\n  | LineBreak\n  | Math\n  | RawInline\n  | Link\n  | Image\n  | Note\n  | Span\ninline = text | inline_element\nattr =\n  attribute id { xsd:ID }?,\n  attribute class { text }?,\n  attribute * { text }*\nmetavalue =\n  MetaMap | MetaList | MetaBool | MetaString | MetaInlines | MetaBlocks\nmeta = element meta { attlist_meta, entry* }\nattlist_meta &= empty\nMetaMap = element MetaMap { attlist_MetaMap, entry* }\nattlist_MetaMap &= empty\nentry = element entry { attlist_entry, metavalue* }\nattlist_entry &= attribute key { text }\nMetaList = element MetaList { attlist_MetaList, metavalue* }\nattlist_MetaList &= empty\nMetaBool = element MetaBool { attlist_MetaBool, empty }\nattlist_MetaBool &= attribute value { \"true\" | \"false\" }\nMetaString = element MetaString { attlist_MetaString, text }\nattlist_MetaString &= empty\nMetaInlines = element MetaInlines { attlist_MetaInlines, inline* }\nattlist_MetaInlines &= empty\nMetaBlocks = element MetaBlocks { attlist_MetaBlocks, block* }\nattlist_MetaBlocks &= empty\nblocks = element blocks { attlist_blocks, block* }\nattlist_blocks &= empty\nPara = element Para { attlist_Para, inline* }\nattlist_Para &= empty\nPlain = element Plain { attlist_Plain, inline* }\nattlist_Plain &= empty\nHeader = element Header { attlist_Header, inline* }\nattlist_Header &=\n  [ a:defaultValue = \"1\" ] attribute level { xsd:positiveInteger }?,\n  attr\nDiv = element Div { attlist_Div, block* }\nattlist_Div &= attr\nBlockQuote = element BlockQuote { attlist_BlockQuote, block* }\nattlist_BlockQuote &= empty\nHorizontalRule =\n  element HorizontalRule { attlist_HorizontalRule, empty }\nattlist_HorizontalRule &= empty\nBulletList = element BulletList { attlist_BulletList, item+ }\nattlist_BulletList &= empty\nOrderedList = element OrderedList { attlist_OrderedList, item+ }\nattlist_OrderedList &=\n  [ a:defaultValue = \"1\" ] attribute start { xsd:positiveInteger }?,\n  [ a:defaultValue = \"DefaultStyle\" ]\n  attribute number-style {\n    \"DefaultStyle\"\n    | \"Example\"\n    | \"Decimal\"\n    | \"LowerRoman\"\n    | \"UpperRoman\"\n    | \"LowerAlpha\"\n    | \"UpperAlpha\"\n  }?,\n  [ a:defaultValue = \"DefaultDelim\" ]\n  attribute number-delim {\n    \"DefaultDelim\" | \"Period\" | \"OneParen\" | \"TwoParens\"\n  }?\nDefinitionList =\n  element DefinitionList { attlist_DefinitionList, item+ }\nattlist_DefinitionList &= empty\nitem =\n  element item {\n    attlist_item,\n    (block* | (term, def+))\n  }\nattlist_item &= empty\nterm = element term { attlist_term, inline* }\nattlist_term &= empty\ndef = element def { attlist_def, block* }\nattlist_def &= empty\nTable =\n  element Table {\n    attlist_Table, Caption, colspecs, TableHead, TableBody+, TableFoot\n  }\nattlist_Table &= attr\nCaption = element Caption { attlist_Caption, ShortCaption?, block* }\nattlist_Caption &= empty\nShortCaption = element ShortCaption { attlist_ShortCaption, inline* }\nattlist_ShortCaption &= empty\ncolspecs = element colspecs { attlist_colspecs, ColSpec+ }\nattlist_colspecs &= empty\nColSpec = element ColSpec { attlist_ColSpec, empty }\nattlist_ColSpec &=\n  [ a:defaultValue = \"AlignDefault\" ]\n  attribute alignment {\n    \"AlignLeft\" | \"AlignRight\" | \"AlignCenter\" | \"AlignDefault\"\n  }?,\n  [ a:defaultValue = \"0\" ]\n  attribute col-width {\n    xsd:double { minInclusive = \"0\" maxInclusive = \"1\" }\n  }?\nTableHead = element TableHead { attlist_TableHead, Row* }\nattlist_TableHead &= attr\nTableFoot = element TableFoot { attlist_TableFoot, Row* }\nattlist_TableFoot &= attr\nTableBody = element TableBody { attlist_TableBody, header, body }\nattlist_TableBody &=\n  [ a:defaultValue = \"0\" ] attribute row-head-columns { text }?,\n  attr\nheader = element header { attlist_header, Row* }\nattlist_header &= empty\nbody = element body { attlist_body, Row* }\nattlist_body &= empty\nRow = element Row { attlist_Row, Cell* }\nattlist_Row &= attr\nCell = element Cell { attlist_Cell, block* }\nattlist_Cell &=\n  [ a:defaultValue = \"AlignDefault\" ]\n  attribute alignment {\n    \"AlignLeft\" | \"AlignRight\" | \"AlignCenter\" | \"AlignDefault\"\n  }?,\n  [ a:defaultValue = \"1\" ] attribute row-span { xsd:positiveInteger }?,\n  [ a:defaultValue = \"1\" ] attribute col-span { xsd:positiveInteger }?,\n  attr\nFigure = element Figure { attlist_Figure, Caption, block* }\nattlist_Figure &= attr\nLineBlock = element LineBlock { attlist_LineBlock, line+ }\nattlist_LineBlock &= empty\nline = element line { attlist_line, inline* }\nattlist_line &= empty\nCodeBlock = element CodeBlock { attlist_CodeBlock, text }\nattlist_CodeBlock &= attr\nRawBlock = element RawBlock { attlist_RawBlock, text }\nattlist_RawBlock &= attribute format { text }\nSpace = element Space { attlist_Space, empty }\nattlist_Space &=\n  [ a:defaultValue = \"1\" ] attribute count { xsd:positiveInteger }?\nStr = element Str { attlist_Str, empty }\nattlist_Str &= [ a:defaultValue = \"\" ] attribute content { text }?\nEmph = element Emph { attlist_Emph, inline* }\nattlist_Emph &= empty\nStrong = element Strong { attlist_Strong, inline* }\nattlist_Strong &= empty\nUnderline = element Underline { attlist_Underline, inline* }\nattlist_Underline &= empty\nStrikeout = element Strikeout { attlist_Strikeout, inline* }\nattlist_Strikeout &= empty\nSuperscript = element Superscript { attlist_Superscript, inline* }\nattlist_Superscript &= empty\nSubscript = element Subscript { attlist_Subscript, inline* }\nattlist_Subscript &= empty\nSmallCaps = element SmallCaps { attlist_SmallCaps, inline* }\nattlist_SmallCaps &= empty\nSpan = element Span { attlist_Span, inline* }\nattlist_Span &= attr\nQuoted = element Quoted { attlist_Quoted, inline* }\nattlist_Quoted &=\n  [ a:defaultValue = \"DoubleQuote\" ]\n  attribute quote-type { \"SingleQuote\" | \"DoubleQuote\" }?\nMath = element Math { attlist_Math, text }\nattlist_Math &=\n  [ a:defaultValue = \"InlineMath\" ]\n  attribute math-type { \"DisplayMath\" | \"InlineMath\" }?\nRawInline = element RawInline { attlist_RawInline, text }\nattlist_RawInline &= attribute format { text }\nCite =\n  element Cite { attlist_Cite, (text | citations | inline_element)* }\nattlist_Cite &= empty\ncitations = element citations { attlist_citations, Citation+ }\nattlist_citations &= empty\nCitation = element Citation { attlist_Citation, prefix?, suffix? }\nprefix = element prefix { attlist_prefix, inline* }\nattlist_prefix &= empty\nsuffix = element suffix { attlist_suffix, inline* }\nattlist_suffix &= empty\nattlist_Citation &=\n  attribute id { text }?,\n  attribute note-num { text }?,\n  [ a:defaultValue = \"0\" ] attribute hash { text }?,\n  [ a:defaultValue = \"AuthorInText\" ]\n  attribute mode {\n    \"AuthorInText\" | \"SuppressAuthor\" | \"NormalCitation\"\n  }?\nCode = element Code { attlist_Code, text }\nattlist_Code &= attr\nImage = element Image { attlist_Image, inline* }\nattlist_Image &=\n  attribute title { text }?,\n  attribute src { text }?,\n  attr\nLink = element Link { attlist_Link, inline* }\nattlist_Link &=\n  attribute title { text }?,\n  attribute href { text }?,\n  attr\nSoftBreak = element SoftBreak { attlist_SoftBreak, empty }\nattlist_SoftBreak &= empty\nLineBreak = element LineBreak { attlist_LineBreak, empty }\nattlist_LineBreak &= empty\nNote = element Note { attlist_Note, block* }\nattlist_Note &= empty\nstart = Pandoc\n"
  },
  {
    "path": "tools/pandoc-xml.rng",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\nA RELAX NG schema for Pandoc XML format.\nCopyright   : Copyright (C) 2025- Massimiliano Farinella\nLicense     : GNU GPL, version 2 or above\nMaintainer  : Massimiliano Farinella <massifrg@gmail.com>\n\nThis is a RELAX NG schema for the XML representation of Pandoc AST.\nIt's an equivalent of native and JSON formats, but modeled as XML.\nYou can use this schema to validate Pandoc XML documents.\nIt's translated from pandoc-xml.dtd with the \"Trang\" software by James Clark,\nand adjusted manually to add some constraints:\n- elements with Attr can have arbitrary attributes (this is not possible with a DTD)\n- Header's \"level\", OrderedList's \"start\" and Cell's \"rowspan\" and \"colspan\" attributes\n  must be a positive integer and are equal to 1 if not specified\n- column widths in ColSpec must be between 0 and 1 (inclusive, with 0=ColWidthDefault)\n- the \"count\" attribute in the \"<Space>\" element must be positive and equal to 1 if not specified\n-->\n<grammar xmlns:a=\"http://relaxng.org/ns/compatibility/annotations/1.0\"\n  xmlns=\"http://relaxng.org/ns/structure/1.0\" datatypeLibrary=\"http://www.w3.org/2001/XMLSchema-datatypes\">\n  <define name=\"Pandoc\">\n    <element name=\"Pandoc\">\n      <ref name=\"attlist_Pandoc\" />\n      <ref name=\"meta\" />\n      <ref name=\"blocks\" />\n    </element>\n  </define>\n  <define name=\"attlist_Pandoc\" combine=\"interleave\">\n    <attribute name=\"api-version\" />\n  </define>\n  <define name=\"block\">\n    <choice>\n      <ref name=\"Para\" />\n      <ref name=\"Plain\" />\n      <ref name=\"Header\" />\n      <ref name=\"Div\" />\n      <ref name=\"BlockQuote\" />\n      <ref name=\"HorizontalRule\" />\n      <ref name=\"BulletList\" />\n      <ref name=\"OrderedList\" />\n      <ref name=\"DefinitionList\" />\n      <ref name=\"Table\" />\n      <ref name=\"Figure\" />\n      <ref name=\"LineBlock\" />\n      <ref name=\"CodeBlock\" />\n      <ref name=\"RawBlock\" />\n    </choice>\n  </define>\n  <define name=\"inline_element\">\n    <choice>\n      <ref name=\"Str\" />\n      <ref name=\"Space\" />\n      <ref name=\"Emph\" />\n      <ref name=\"Strong\" />\n      <ref name=\"Underline\" />\n      <ref name=\"Strikeout\" />\n      <ref name=\"Superscript\" />\n      <ref name=\"Subscript\" />\n      <ref name=\"SmallCaps\" />\n      <ref name=\"Quoted\" />\n      <ref name=\"Cite\" />\n      <ref name=\"Code\" />\n      <ref name=\"SoftBreak\" />\n      <ref name=\"LineBreak\" />\n      <ref name=\"Math\" />\n      <ref name=\"RawInline\" />\n      <ref name=\"Link\" />\n      <ref name=\"Image\" />\n      <ref name=\"Note\" />\n      <ref name=\"Span\" />\n    </choice>\n  </define>\n  <define name=\"inline\">\n    <choice>\n      <text />\n      <ref name=\"inline_element\" />\n    </choice>\n  </define>\n  <define name=\"attr\">\n    <optional>\n      <attribute name=\"id\">\n        <data type=\"ID\" />\n      </attribute>\n    </optional>\n    <optional>\n      <attribute name=\"class\" />\n    </optional>\n    <zeroOrMore>\n      <attribute>\n        <anyName />\n      </attribute>\n    </zeroOrMore>\n  </define>\n  <define name=\"metavalue\">\n    <choice>\n      <ref name=\"MetaMap\" />\n      <ref name=\"MetaList\" />\n      <ref name=\"MetaBool\" />\n      <ref name=\"MetaString\" />\n      <ref name=\"MetaInlines\" />\n      <ref name=\"MetaBlocks\" />\n    </choice>\n  </define>\n  <define name=\"meta\">\n    <element name=\"meta\">\n      <ref name=\"attlist_meta\" />\n      <zeroOrMore>\n        <ref name=\"entry\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_meta\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"MetaMap\">\n    <element name=\"MetaMap\">\n      <ref name=\"attlist_MetaMap\" />\n      <zeroOrMore>\n        <ref name=\"entry\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_MetaMap\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"entry\">\n    <element name=\"entry\">\n      <ref name=\"attlist_entry\" />\n      <zeroOrMore>\n        <ref name=\"metavalue\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_entry\" combine=\"interleave\">\n    <attribute name=\"key\" />\n  </define>\n  <define name=\"MetaList\">\n    <element name=\"MetaList\">\n      <ref name=\"attlist_MetaList\" />\n      <zeroOrMore>\n        <ref name=\"metavalue\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_MetaList\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"MetaBool\">\n    <element name=\"MetaBool\">\n      <ref name=\"attlist_MetaBool\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_MetaBool\" combine=\"interleave\">\n    <attribute name=\"value\">\n      <choice>\n        <value>true</value>\n        <value>false</value>\n      </choice>\n    </attribute>\n  </define>\n  <define name=\"MetaString\">\n    <element name=\"MetaString\">\n      <ref name=\"attlist_MetaString\" />\n      <text />\n    </element>\n  </define>\n  <define name=\"attlist_MetaString\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"MetaInlines\">\n    <element name=\"MetaInlines\">\n      <ref name=\"attlist_MetaInlines\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_MetaInlines\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"MetaBlocks\">\n    <element name=\"MetaBlocks\">\n      <ref name=\"attlist_MetaBlocks\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_MetaBlocks\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"blocks\">\n    <element name=\"blocks\">\n      <ref name=\"attlist_blocks\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_blocks\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Para\">\n    <element name=\"Para\">\n      <ref name=\"attlist_Para\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Para\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Plain\">\n    <element name=\"Plain\">\n      <ref name=\"attlist_Plain\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Plain\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Header\">\n    <element name=\"Header\">\n      <ref name=\"attlist_Header\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Header\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"level\" a:defaultValue=\"1\">\n        <data type=\"positiveInteger\" />\n      </attribute>\n    </optional>\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"Div\">\n    <element name=\"Div\">\n      <ref name=\"attlist_Div\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Div\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"BlockQuote\">\n    <element name=\"BlockQuote\">\n      <ref name=\"attlist_BlockQuote\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_BlockQuote\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"HorizontalRule\">\n    <element name=\"HorizontalRule\">\n      <ref name=\"attlist_HorizontalRule\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_HorizontalRule\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"BulletList\">\n    <element name=\"BulletList\">\n      <ref name=\"attlist_BulletList\" />\n      <oneOrMore>\n        <ref name=\"item\" />\n      </oneOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_BulletList\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"OrderedList\">\n    <element name=\"OrderedList\">\n      <ref name=\"attlist_OrderedList\" />\n      <oneOrMore>\n        <ref name=\"item\" />\n      </oneOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_OrderedList\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"start\" a:defaultValue=\"1\">\n        <data type=\"positiveInteger\" />\n      </attribute>\n    </optional>\n    <optional>\n      <attribute name=\"number-style\" a:defaultValue=\"DefaultStyle\">\n        <choice>\n          <value>DefaultStyle</value>\n          <value>Example</value>\n          <value>Decimal</value>\n          <value>LowerRoman</value>\n          <value>UpperRoman</value>\n          <value>LowerAlpha</value>\n          <value>UpperAlpha</value>\n        </choice>\n      </attribute>\n    </optional>\n    <optional>\n      <attribute name=\"number-delim\" a:defaultValue=\"DefaultDelim\">\n        <choice>\n          <value>DefaultDelim</value>\n          <value>Period</value>\n          <value>OneParen</value>\n          <value>TwoParens</value>\n        </choice>\n      </attribute>\n    </optional>\n  </define>\n  <define name=\"DefinitionList\">\n    <element name=\"DefinitionList\">\n      <ref name=\"attlist_DefinitionList\" />\n      <oneOrMore>\n        <ref name=\"item\" />\n      </oneOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_DefinitionList\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"item\">\n    <element name=\"item\">\n      <ref name=\"attlist_item\" />\n      <choice>\n        <zeroOrMore>\n          <ref name=\"block\" />\n        </zeroOrMore>\n        <group>\n          <ref name=\"term\" />\n          <oneOrMore>\n            <ref name=\"def\" />\n          </oneOrMore>\n        </group>\n      </choice>\n    </element>\n  </define>\n  <define name=\"attlist_item\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"term\">\n    <element name=\"term\">\n      <ref name=\"attlist_term\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_term\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"def\">\n    <element name=\"def\">\n      <ref name=\"attlist_def\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_def\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Table\">\n    <element name=\"Table\">\n      <ref name=\"attlist_Table\" />\n      <ref name=\"Caption\" />\n      <ref name=\"colspecs\" />\n      <ref name=\"TableHead\" />\n      <oneOrMore>\n        <ref name=\"TableBody\" />\n      </oneOrMore>\n      <ref name=\"TableFoot\" />\n    </element>\n  </define>\n  <define name=\"attlist_Table\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"Caption\">\n    <element name=\"Caption\">\n      <ref name=\"attlist_Caption\" />\n      <optional>\n        <ref name=\"ShortCaption\" />\n      </optional>\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Caption\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"ShortCaption\">\n    <element name=\"ShortCaption\">\n      <ref name=\"attlist_ShortCaption\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_ShortCaption\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"colspecs\">\n    <element name=\"colspecs\">\n      <ref name=\"attlist_colspecs\" />\n      <oneOrMore>\n        <ref name=\"ColSpec\" />\n      </oneOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_colspecs\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"ColSpec\">\n    <element name=\"ColSpec\">\n      <ref name=\"attlist_ColSpec\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_ColSpec\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"alignment\" a:defaultValue=\"AlignDefault\">\n        <choice>\n          <value>AlignLeft</value>\n          <value>AlignRight</value>\n          <value>AlignCenter</value>\n          <value>AlignDefault</value>\n        </choice>\n      </attribute>\n    </optional>\n    <optional>\n      <attribute name=\"col-width\" a:defaultValue=\"0\">\n        <data type=\"double\">\n          <param name=\"minInclusive\">0</param>\n          <param name=\"maxInclusive\">1</param>\n        </data>\n      </attribute>\n    </optional>\n  </define>\n  <define name=\"TableHead\">\n    <element name=\"TableHead\">\n      <ref name=\"attlist_TableHead\" />\n      <zeroOrMore>\n        <ref name=\"Row\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_TableHead\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"TableFoot\">\n    <element name=\"TableFoot\">\n      <ref name=\"attlist_TableFoot\" />\n      <zeroOrMore>\n        <ref name=\"Row\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_TableFoot\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"TableBody\">\n    <element name=\"TableBody\">\n      <ref name=\"attlist_TableBody\" />\n      <ref name=\"header\" />\n      <ref name=\"body\" />\n    </element>\n  </define>\n  <define name=\"attlist_TableBody\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"row-head-columns\" a:defaultValue=\"0\" />\n    </optional>\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"header\">\n    <element name=\"header\">\n      <ref name=\"attlist_header\" />\n      <zeroOrMore>\n        <ref name=\"Row\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_header\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"body\">\n    <element name=\"body\">\n      <ref name=\"attlist_body\" />\n      <zeroOrMore>\n        <ref name=\"Row\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_body\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Row\">\n    <element name=\"Row\">\n      <ref name=\"attlist_Row\" />\n      <zeroOrMore>\n        <ref name=\"Cell\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Row\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"Cell\">\n    <element name=\"Cell\">\n      <ref name=\"attlist_Cell\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Cell\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"alignment\" a:defaultValue=\"AlignDefault\">\n        <choice>\n          <value>AlignLeft</value>\n          <value>AlignRight</value>\n          <value>AlignCenter</value>\n          <value>AlignDefault</value>\n        </choice>\n      </attribute>\n    </optional>\n    <optional>\n      <attribute name=\"row-span\" a:defaultValue=\"1\">\n        <data type=\"positiveInteger\" />\n      </attribute>\n    </optional>\n    <optional>\n      <attribute name=\"col-span\" a:defaultValue=\"1\">\n        <data type=\"positiveInteger\" />\n      </attribute>\n    </optional>\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"Figure\">\n    <element name=\"Figure\">\n      <ref name=\"attlist_Figure\" />\n      <ref name=\"Caption\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Figure\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"LineBlock\">\n    <element name=\"LineBlock\">\n      <ref name=\"attlist_LineBlock\" />\n      <oneOrMore>\n        <ref name=\"line\" />\n      </oneOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_LineBlock\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"line\">\n    <element name=\"line\">\n      <ref name=\"attlist_line\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_line\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"CodeBlock\">\n    <element name=\"CodeBlock\">\n      <ref name=\"attlist_CodeBlock\" />\n      <text />\n    </element>\n  </define>\n  <define name=\"attlist_CodeBlock\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"RawBlock\">\n    <element name=\"RawBlock\">\n      <ref name=\"attlist_RawBlock\" />\n      <text />\n    </element>\n  </define>\n  <define name=\"attlist_RawBlock\" combine=\"interleave\">\n    <attribute name=\"format\" />\n  </define>\n  <define name=\"Space\">\n    <element name=\"Space\">\n      <ref name=\"attlist_Space\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_Space\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"count\" a:defaultValue=\"1\">\n        <data type=\"positiveInteger\" />\n      </attribute>\n    </optional>\n  </define>\n  <define name=\"Str\">\n    <element name=\"Str\">\n      <ref name=\"attlist_Str\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_Str\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"content\" a:defaultValue=\"\" />\n    </optional>\n  </define>\n  <define name=\"Emph\">\n    <element name=\"Emph\">\n      <ref name=\"attlist_Emph\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Emph\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Strong\">\n    <element name=\"Strong\">\n      <ref name=\"attlist_Strong\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Strong\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Underline\">\n    <element name=\"Underline\">\n      <ref name=\"attlist_Underline\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Underline\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Strikeout\">\n    <element name=\"Strikeout\">\n      <ref name=\"attlist_Strikeout\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Strikeout\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Superscript\">\n    <element name=\"Superscript\">\n      <ref name=\"attlist_Superscript\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Superscript\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Subscript\">\n    <element name=\"Subscript\">\n      <ref name=\"attlist_Subscript\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Subscript\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"SmallCaps\">\n    <element name=\"SmallCaps\">\n      <ref name=\"attlist_SmallCaps\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_SmallCaps\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Span\">\n    <element name=\"Span\">\n      <ref name=\"attlist_Span\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Span\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"Quoted\">\n    <element name=\"Quoted\">\n      <ref name=\"attlist_Quoted\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Quoted\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"quote-type\" a:defaultValue=\"DoubleQuote\">\n        <choice>\n          <value>SingleQuote</value>\n          <value>DoubleQuote</value>\n        </choice>\n      </attribute>\n    </optional>\n  </define>\n  <define name=\"Math\">\n    <element name=\"Math\">\n      <ref name=\"attlist_Math\" />\n      <text />\n    </element>\n  </define>\n  <define name=\"attlist_Math\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"math-type\" a:defaultValue=\"InlineMath\">\n        <choice>\n          <value>DisplayMath</value>\n          <value>InlineMath</value>\n        </choice>\n      </attribute>\n    </optional>\n  </define>\n  <define name=\"RawInline\">\n    <element name=\"RawInline\">\n      <ref name=\"attlist_RawInline\" />\n      <text />\n    </element>\n  </define>\n  <define name=\"attlist_RawInline\" combine=\"interleave\">\n    <attribute name=\"format\" />\n  </define>\n  <define name=\"Cite\">\n    <element name=\"Cite\">\n      <ref name=\"attlist_Cite\" />\n      <zeroOrMore>\n        <choice>\n          <text />\n          <ref name=\"citations\" />\n          <ref name=\"inline_element\" />\n        </choice>\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Cite\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"citations\">\n    <element name=\"citations\">\n      <ref name=\"attlist_citations\" />\n      <oneOrMore>\n        <ref name=\"Citation\" />\n      </oneOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_citations\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Citation\">\n    <element name=\"Citation\">\n      <ref name=\"attlist_Citation\" />\n      <optional>\n        <ref name=\"prefix\" />\n      </optional>\n      <optional>\n        <ref name=\"suffix\" />\n      </optional>\n    </element>\n  </define>\n  <define name=\"prefix\">\n    <element name=\"prefix\">\n      <ref name=\"attlist_prefix\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_prefix\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"suffix\">\n    <element name=\"suffix\">\n      <ref name=\"attlist_suffix\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_suffix\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"attlist_Citation\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"id\" />\n    </optional>\n    <optional>\n      <attribute name=\"note-num\" />\n    </optional>\n    <optional>\n      <attribute name=\"hash\" a:defaultValue=\"0\" />\n    </optional>\n    <optional>\n      <attribute name=\"mode\" a:defaultValue=\"AuthorInText\">\n        <choice>\n          <value>AuthorInText</value>\n          <value>SuppressAuthor</value>\n          <value>NormalCitation</value>\n        </choice>\n      </attribute>\n    </optional>\n  </define>\n  <define name=\"Code\">\n    <element name=\"Code\">\n      <ref name=\"attlist_Code\" />\n      <text />\n    </element>\n  </define>\n  <define name=\"attlist_Code\" combine=\"interleave\">\n    <ref name=\"attr\" />\n  </define>\n  <define name=\"Image\">\n    <element name=\"Image\">\n      <ref name=\"attlist_Image\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Image\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"title\"/>\n    </optional>\n    <optional>\n      <attribute name=\"src\"/>\n    </optional>\n    <ref name=\"attr\"/>\n  </define>\n  <define name=\"Link\">\n    <element name=\"Link\">\n      <ref name=\"attlist_Link\" />\n      <zeroOrMore>\n        <ref name=\"inline\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Link\" combine=\"interleave\">\n    <optional>\n      <attribute name=\"title\"/>\n    </optional>\n    <optional>\n      <attribute name=\"href\"/>\n    </optional>\n    <ref name=\"attr\"/>\n  </define>\n  <define name=\"SoftBreak\">\n    <element name=\"SoftBreak\">\n      <ref name=\"attlist_SoftBreak\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_SoftBreak\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"LineBreak\">\n    <element name=\"LineBreak\">\n      <ref name=\"attlist_LineBreak\" />\n      <empty />\n    </element>\n  </define>\n  <define name=\"attlist_LineBreak\" combine=\"interleave\">\n    <empty />\n  </define>\n  <define name=\"Note\">\n    <element name=\"Note\">\n      <ref name=\"attlist_Note\" />\n      <zeroOrMore>\n        <ref name=\"block\" />\n      </zeroOrMore>\n    </element>\n  </define>\n  <define name=\"attlist_Note\" combine=\"interleave\">\n    <empty />\n  </define>\n  <start>\n    <choice>\n      <ref name=\"Pandoc\" />\n    </choice>\n  </start>\n</grammar>\n"
  },
  {
    "path": "tools/pandoc-xml.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\nA XML Schema definition for Pandoc XML format.\nCopyright   : Copyright (C) 2025- Massimiliano Farinella\nLicense     : GNU GPL, version 2 or above\nMaintainer  : Massimiliano Farinella <massifrg@gmail.com>\n\nThis is a XML Schema schema for the XML representation of Pandoc AST.\nIt's an equivalent of native and JSON formats, but modeled as XML.\nYou can use this schema to validate Pandoc XML documents.\nIt's translated from pandoc-xml.dtd with the \"Trang\" software by James Clark,\nand adjusted manually to add some constraints:\n- elements with Attr can have arbitrary attributes (this is not possible with a DTD)\n- Header's \"level\", OrderedList's \"start\" and Cell's \"rowspan\" and \"colspan\" attributes\n  must be a positive integer and are equal to 1 if not specified\n- column widths in ColSpec must be between 0 and 1 (inclusive, with 0=ColWidthDefault)\n- the \"count\" attribute in the \"<Space>\" element must be a positive integer,\n  equal to 1 if not specified\n- OrderedList's number style and delimiter, ColSpec's and Cell's alignment,\n  Quoted's QuoteType and Math's Mathtype\n  can only take the values specified in pandoc-types\n- TableBody's row-head-columns must be zero (default, when not specified) or a positive integer\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\">\n  <xs:element name=\"Pandoc\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"meta\"/>\n        <xs:element ref=\"blocks\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Pandoc\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Pandoc\">\n    <xs:attribute name=\"api-version\" use=\"required\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"block\" abstract=\"true\"/>\n  <xs:element name=\"inline_element\" abstract=\"true\"/>\n  <xs:group name=\"inline\">\n    <xs:sequence>\n      <xs:element minOccurs=\"0\" ref=\"inline_element\"/>\n    </xs:sequence>\n  </xs:group>\n  <xs:attributeGroup name=\"attr\">\n    <xs:attribute name=\"id\" type=\"xs:ID\"/>\n    <xs:attribute name=\"class\"/>\n    <xs:anyAttribute processContents=\"skip\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"metavalue\" abstract=\"true\"/>\n  <xs:element name=\"meta\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"entry\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"MetaMap\" substitutionGroup=\"metavalue\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"entry\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"entry\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"metavalue\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_entry\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_entry\">\n    <xs:attribute name=\"key\" use=\"required\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"MetaList\" substitutionGroup=\"metavalue\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"metavalue\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"MetaBool\" substitutionGroup=\"metavalue\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attlist_MetaBool\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_MetaBool\">\n    <xs:attribute name=\"value\" use=\"required\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"true\"/>\n          <xs:enumeration value=\"false\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"MetaString\" substitutionGroup=\"metavalue\" type=\"xs:string\"/>\n  <xs:element name=\"MetaInlines\" substitutionGroup=\"metavalue\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"MetaBlocks\" substitutionGroup=\"metavalue\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"blocks\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Para\" substitutionGroup=\"block\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Plain\" substitutionGroup=\"block\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Header\" substitutionGroup=\"block\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n      <xs:attributeGroup ref=\"attlist_Header\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Header\">\n    <xs:attribute name=\"level\" default=\"1\" type=\"xs:positiveInteger\"/>\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Div\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Div\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Div\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"BlockQuote\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"HorizontalRule\" substitutionGroup=\"block\">\n    <xs:complexType/>\n  </xs:element>\n  <xs:element name=\"BulletList\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element maxOccurs=\"unbounded\" ref=\"item\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"OrderedList\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element maxOccurs=\"unbounded\" ref=\"item\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_OrderedList\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_OrderedList\">\n    <xs:attribute name=\"start\" default=\"1\" type=\"xs:positiveInteger\"/>\n    <xs:attribute name=\"number-style\" default=\"DefaultStyle\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"DefaultStyle\"/>\n          <xs:enumeration value=\"Example\"/>\n          <xs:enumeration value=\"Decimal\"/>\n          <xs:enumeration value=\"LowerRoman\"/>\n          <xs:enumeration value=\"UpperRoman\"/>\n          <xs:enumeration value=\"LowerAlpha\"/>\n          <xs:enumeration value=\"UpperAlpha\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n    <xs:attribute name=\"number-delim\" default=\"DefaultDelim\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"DefaultDelim\"/>\n          <xs:enumeration value=\"Period\"/>\n          <xs:enumeration value=\"OneParen\"/>\n          <xs:enumeration value=\"TwoParens\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"DefinitionList\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element maxOccurs=\"unbounded\" ref=\"item\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"item\">\n    <xs:complexType>\n      <xs:choice>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n        <xs:sequence>\n          <xs:element ref=\"term\"/>\n          <xs:element maxOccurs=\"unbounded\" ref=\"def\"/>\n        </xs:sequence>\n      </xs:choice>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"term\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"def\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Table\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"Caption\"/>\n        <xs:element ref=\"colspecs\"/>\n        <xs:element ref=\"TableHead\"/>\n        <xs:element maxOccurs=\"unbounded\" ref=\"TableBody\"/>\n        <xs:element ref=\"TableFoot\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Table\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Table\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Caption\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" ref=\"ShortCaption\"/>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"ShortCaption\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"colspecs\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element maxOccurs=\"unbounded\" ref=\"ColSpec\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"ColSpec\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attlist_ColSpec\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_ColSpec\">\n    <xs:attribute name=\"alignment\" default=\"AlignDefault\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"AlignLeft\"/>\n          <xs:enumeration value=\"AlignRight\"/>\n          <xs:enumeration value=\"AlignCenter\"/>\n          <xs:enumeration value=\"AlignDefault\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n    <xs:attribute name=\"col-width\" default=\"0\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:double\">\n          <xs:minInclusive value=\"0\"/>\n          <xs:maxInclusive value=\"1\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"TableHead\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"Row\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_TableHead\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_TableHead\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"TableFoot\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"Row\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_TableFoot\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_TableFoot\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"TableBody\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"header\"/>\n        <xs:element ref=\"body\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_TableBody\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_TableBody\">\n    <xs:attribute name=\"row-head-columns\" default=\"0\"/>\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"header\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"Row\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"body\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"Row\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Row\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"Cell\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Row\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Row\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Cell\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Cell\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Cell\">\n    <xs:attribute name=\"alignment\" default=\"AlignDefault\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"AlignLeft\"/>\n          <xs:enumeration value=\"AlignRight\"/>\n          <xs:enumeration value=\"AlignCenter\"/>\n          <xs:enumeration value=\"AlignDefault\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n    <xs:attribute name=\"row-span\" default=\"1\" type=\"xs:positiveInteger\"/>\n    <xs:attribute name=\"col-span\" default=\"1\" type=\"xs:positiveInteger\"/>\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Figure\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"Caption\"/>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Figure\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Figure\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"LineBlock\" substitutionGroup=\"block\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element maxOccurs=\"unbounded\" ref=\"line\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"line\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"CodeBlock\" substitutionGroup=\"block\">\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attlist_CodeBlock\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_CodeBlock\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"RawBlock\" substitutionGroup=\"block\">\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attlist_RawBlock\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_RawBlock\">\n    <xs:attribute name=\"format\" use=\"required\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Space\" substitutionGroup=\"inline_element\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attlist_Space\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Space\">\n    <xs:attribute name=\"count\" default=\"1\" type=\"xs:positiveInteger\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Str\" substitutionGroup=\"inline_element\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attlist_Str\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Str\">\n    <xs:attribute name=\"content\" default=\"\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Emph\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Strong\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Underline\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Strikeout\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Superscript\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Subscript\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"SmallCaps\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Span\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n      <xs:attributeGroup ref=\"attlist_Span\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Span\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Quoted\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n      <xs:attributeGroup ref=\"attlist_Quoted\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Quoted\">\n    <xs:attribute name=\"quote-type\" default=\"DoubleQuote\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"SingleQuote\"/>\n          <xs:enumeration value=\"DoubleQuote\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"Math\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attlist_Math\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Math\">\n    <xs:attribute name=\"math-type\" default=\"InlineMath\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"DisplayMath\"/>\n          <xs:enumeration value=\"InlineMath\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"RawInline\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attlist_RawInline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_RawInline\">\n    <xs:attribute name=\"format\" use=\"required\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Cite\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n        <xs:element ref=\"citations\"/>\n        <xs:element ref=\"inline_element\"/>\n      </xs:choice>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"citations\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element maxOccurs=\"unbounded\" ref=\"Citation\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"Citation\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" ref=\"prefix\"/>\n        <xs:element minOccurs=\"0\" ref=\"suffix\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attlist_Citation\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"prefix\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"suffix\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Citation\">\n    <xs:attribute name=\"id\"/>\n    <xs:attribute name=\"note-num\"/>\n    <xs:attribute name=\"hash\" default=\"0\"/>\n    <xs:attribute name=\"mode\" default=\"AuthorInText\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"AuthorInText\"/>\n          <xs:enumeration value=\"SuppressAuthor\"/>\n          <xs:enumeration value=\"NormalCitation\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"Code\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attlist_Code\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Code\">\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Image\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n      <xs:attributeGroup ref=\"attlist_Image\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Image\">\n    <xs:attribute name=\"title\"/>\n    <xs:attribute name=\"src\"/>\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"Link\" substitutionGroup=\"inline_element\">\n    <xs:complexType mixed=\"true\">\n      <xs:group minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"inline\"/>\n      <xs:attributeGroup ref=\"attlist_Link\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:attributeGroup name=\"attlist_Link\">\n    <xs:attribute name=\"title\"/>\n    <xs:attribute name=\"href\"/>\n    <xs:attributeGroup ref=\"attr\"/>\n  </xs:attributeGroup>\n  <xs:element name=\"SoftBreak\" substitutionGroup=\"inline_element\">\n    <xs:complexType/>\n  </xs:element>\n  <xs:element name=\"LineBreak\" substitutionGroup=\"inline_element\">\n    <xs:complexType/>\n  </xs:element>\n  <xs:element name=\"Note\" substitutionGroup=\"inline_element\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element minOccurs=\"0\" maxOccurs=\"unbounded\" ref=\"block\"/>\n      </xs:sequence>\n    </xs:complexType>\n  </xs:element>\n</xs:schema>\n"
  },
  {
    "path": "tools/parseTimings.pl",
    "content": "#!/usr/bin/env perl\n\n# Breaks down compilation time and memory usage by module.\n# To use this script, do\n#\n# stack clean\n# stack build --ghc-options='-dshow-passes' 2>output.txt\n# perl parseTimings.pl output.txt\n\nwhile (<>) {\n  if (/!!! (.*) \\[(.*)\\]: finished in (.*) milliseconds, allocated (.*) megabytes/) {\n      $phase = $1;\n      $module = $2;\n      $milliseconds = $3;\n      $megabytes = $4;\n      if (!$timings{$module}) {\n        $timings{$module} = {'milliseconds' => 0, 'megabytes' => 0};\n      };\n      $timings{$module}{'milliseconds'} += $milliseconds;\n      $timings{$module}{'megabytes'} += $megabytes;\n    }\n  }\n  printf(\"%10s %10s %s\\n\", \"Time (ms)\", \"Alloc (Mb)\", \"LOC\", \"Module\");\n  for (keys %timings) {\n    $path = $_;\n    $path =~ s/\\./\\//g;\n    $path = \"src/$path.hs\";\n    $loc = `wc -l $path 2>/dev/null`;\n    if ($loc) {\n      $loc =~ s/^\\s*(\\d+).*/\\1/;\n      printf(\"%10d %10d %6d %s\\n\", $timings{$_}{'milliseconds'}, $timings{$_}{'megabytes'}, $loc, $_);\n    }\n}\n"
  },
  {
    "path": "tools/update-lua-module-docs.lua",
    "content": "--- Generate documentation for a pandoc Lua module.\n-- Copyright: © 2022-2024 Albert Krewinkel\n-- License: MIT\n--\n-- This script can be used as either a custom reader, or as a standalone\n-- pandoc Lua script. In the latter case, it expects a module name as\n-- argument.\n\nlocal ipairs, next, pairs, print, tostring, type, warn =\n  ipairs, next, pairs, print, tostring, type, warn\nlocal string, table = string, table\nlocal pandoc = require 'pandoc'\nlocal utils = require 'pandoc.utils'\nlocal read, write = pandoc.read, pandoc.write\nlocal Pandoc = pandoc.Pandoc\nlocal Blocks, Inlines, List = pandoc.Blocks, pandoc.Inlines, pandoc.List\nlocal Code, Emph, Link, Span, Str =\n  pandoc.Code, pandoc.Emph, pandoc.Link, pandoc.Span, pandoc.Str\nlocal BulletList, DefinitionList, Header, Para, Plain, RawBlock =\n  pandoc.BulletList, pandoc.DefinitionList, pandoc.Header, pandoc.Para,\n  pandoc.Plain, pandoc.RawBlock\n\nlocal registry = debug.getregistry()\n\n--- Retrieves the documentation object for the given value.\nlocal function documentation (value)\n  local docobj = registry['HsLua docs'][value]\n  if type(docobj) == 'userdata' then\n    -- Get the table representation by calling the object\n    return docobj()\n  else\n    return docobj\n  end\nend\n\n--- Table containing all known modules\nlocal modules = {}\nfor k, v in pairs(pandoc) do\n  local docs = documentation(v)\n  if docs and docs.fields then\n    modules[k] = v\n  end\nend\nmodules['pandoc'] = pandoc\n\n--- Creates an iterator triple that will return values sorted by key names.\n-- @param tbl  table with string keys\n-- @return iterator triple to be used in a `for` loop.\nlocal function sorted (tbl)\n  local keys = {}\n  for key in pairs(tbl) do\n    table.insert(keys, key)\n  end\n  table.sort(keys)\n  local i = 0\n  local iter = function (_state, ctrl)\n    if i > 0 and ctrl == nil then\n      return nil\n    else\n      i = i + 1\n      return keys[i], tbl[keys[i]]\n    end\n  end\n  return iter, nil, nil\nend\n\n--- Parses text to a list of Block values.\n-- @param txt  string value\n-- @return {Block,...}\nlocal function read_blocks (txt)\n  return read(txt, 'commonmark+smart+wikilinks_title_before_pipe').blocks\nend\n\n--- Parses text to a list of Inline values.\n-- @param txt  string value\n-- @return {Inline,...}\nlocal function read_inlines (txt)\n  return utils.blocks_to_inlines(read_blocks(txt))\nend\n\n--- Map of all known data types to a heading ID. Used to create hyperlinks.\nlocal known_types = {\n  Alignment = 'type-alignment',\n  Attr = 'type-attr',\n  AttributeList = 'type-attributes',\n  Block = 'type-block',\n  Blocks = 'type-blocks',\n  Caption = 'type-caption',\n  Cell = 'type-cell',\n  ColSpec = 'type-colspec',\n  Doc = 'type-doc',\n  ChunkedDoc = 'type-chunkeddoc',\n  Figure = 'type-figure',\n  Inline = 'type-inline',\n  Inlines = 'type-inlines',\n  ListAttributes = 'type-listattributes',\n  Meta = 'type-meta',\n  MetaValue = 'type-metavalue',\n  Pandoc = 'type-pandoc',\n  ReaderOptions = 'type-readeroptions',\n  Row = 'type-row',\n  SimpleTable = 'type-simpletable',\n  Source = 'type-pandoc.types.Source',\n  Sources = 'pandoc.types.Sources',\n  Span = 'type-span',\n  Str = 'type-str',\n  Table = 'type-table',\n  TableBody = 'type-tablebody',\n  TableHead = 'type-tablehead',\n  TableFoot = 'type-tablefoot',\n  Template = 'type-template',\n  WriterOptions = 'type-writeroptions',\n  Version = 'type-version',\n}\n\nlocal function render_typespec (typespec)\n  if typespec.basic then\n    return Inlines(Span(typespec.basic, {class=\"builtin-lua-type\"}))\n  elseif typespec.named then\n    return Inlines(Span(typespec.named, {['unknown-type'] = typespec.named}))\n  elseif typespec.sequence then\n    local typeinlns = render_typespec(typespec.sequence)\n    return Inlines({'{'} .. typeinlns .. {',...}'})\n  elseif typespec.sum then\n    local result = Inlines{}\n    for i, tspec in pairs(List.map(typespec.sum, render_typespec)) do\n      if i >= 2 then\n        result:insert(Str '|')\n      end\n      result:extend(tspec)\n    end\n    return result\n  elseif typespec.any then\n    return Inlines('any')\n  end\n  warn(\"falling back to string representation for type \" .. tostring(typespec))\n  return Inlines(tostring(typespec))\nend\n\n--- Render a type marker.\n-- E.g., the type of a parameter.\nlocal function type_to_inlines (typeobj)\n  return Inlines ' ('  .. render_typespec(typeobj) .. Inlines ')'\nend\n\n--- Append inlines to the last block if possible, or append a new Plain.\nlocal function append_inlines (blocks, inlines)\n  local last = blocks[#blocks]\n  if last and (last.t == 'Plain' or last.t == 'Para') then\n    blocks[#blocks] = Plain(last.content .. inlines)\n  else\n    table.insert(blocks, Plain(inlines))\n  end\n  return blocks\nend\n\n--- Returns a list of function arguments.\n--\n-- The parameters are comma-separated; optional arguments are put in brackets.\n--\n-- @param parameters  list of function parameters\n-- @return string\nlocal function argslist (parameters)\n  local required = List{}\n  local optional = List{}\n  for _, param in ipairs(parameters) do\n    if param.optional then\n      optional:insert(param.name)\n    else\n      required:extend(optional)\n      required:insert(param.name)\n      optional = List{}\n    end\n  end\n  if #optional == 0 then\n    return table.concat(required, ', ')\n  end\n  return table.concat(required, ', ') ..\n    (#required > 0 and '[, ' or '[') ..\n    table.concat(optional, '[, ') .. string.rep(']', #optional)\nend\n\n--- Generates rendered documentation for the return values of a function.\n-- @param results     list of function results\n-- @return {Block,...}\nlocal function render_results (results)\n  if type(results) == 'string' then\n    return read_blocks(results)\n  elseif type(results) == 'table' then\n    return {BulletList(\n      List(results):map(\n        function (res)\n          return append_inlines(\n            read_blocks(res.description),\n            type_to_inlines(res.type)\n          )\n        end\n      )\n    )}\n  else\n    return Blocks{}\n  end\nend\n\n--- Renders function documentation.\n--\n-- @param doc         documentation object\n-- @param level       the current heading level in the document\n-- @param modulename  name of the module that contains this function\n-- @return Documentation rendered as list of Blocks\nlocal function render_function (doc, level, modulename)\n  local name = doc.name:match('[^%.]*$')\n  level = level or 1\n  local args = argslist(doc.parameters)\n  local paramlist = DefinitionList(\n    List(doc.parameters):map(\n      function (p)\n        return {\n          Inlines{Code(p.name)},\n          {append_inlines(\n            read_blocks(p.description),\n            type_to_inlines(p.type)\n          )}\n        }\n      end\n    )\n  )\n  return Blocks{\n    Header(level, name, {doc.name}),\n    Plain{Code(string.format('%s (%s)', name, args))},\n  } .. read_blocks(doc.description)\n    .. List(#doc.parameters > 0 and {Para 'Parameters:'} or {})\n    .. List{paramlist}\n    .. List(#doc.results > 0 and {Para 'Returns:'} or {})\n    .. render_results(doc.results)\n    .. Blocks(doc.since and {Para{Emph{'Since: ' .. doc.since}}} or {})\nend\n\n--- Renders documentation of a module field.\n--\n-- @param field       field documentation object\n-- @param level       the current heading level in the document\n-- @param modulename  name of the module that contains this function\n-- @return {Block,...}\nlocal function render_field (field, level, modulename)\n  local name = field.name:match('[^.]*$')\n  return Blocks{Header(level, name, {field.name})} ..\n    {Plain(read_inlines(field.description) .. type_to_inlines(field.type))}\nend\n\n--- Renders documentation of a data type associated with a module.\n--\n-- @param name        data type name\n-- @param level       the current heading level in the document\n-- @param modulename  name of the module that contains this function\n-- @return {Block,...}\nlocal function render_type (name, level, modulename)\n  -- FIXME: SPECIAL CASE\n  -- Ignore Template type in `pandoc.template` module, as the automatic\n  -- content doesn't describe it yet.\n  if name == 'pandoc Template' then\n    return {}\n  end\n  -- We just want the modulename prefix, as the type names should already\n  -- contain the module name to some extend.\n  local nameprefix = modulename and\n    modulename:match('(.*)%.[a-z]*$') or\n    'pandoc'\n  local id = nameprefix .. '.' .. name\n  local metatable = registry[name]\n\n  local properties = Blocks{}\n  if next(metatable.docs.properties) then\n    local propattr = {'type-' .. id .. '-properties'}\n    local attr\n    properties:insert(Header(level + 1, \"Properties\", propattr))\n    for propname, prop in sorted(metatable.docs.properties) do\n      attr = {'type-' .. nameprefix .. '.' .. name .. '.' .. propname}\n      properties:insert(Header(level + 2, propname, attr))\n      properties:insert(\n        Plain(read_inlines(prop.description) ..\n              type_to_inlines(prop.type))\n      )\n    end\n  end\n\n  local methods = Blocks{}\n  if next(metatable.methods) then\n    local attr = {'type-' .. id .. '-methods'}\n    methods:insert(Header(level + 1, \"Methods\", attr))\n    for _, method in sorted(metatable.methods) do\n      -- attr = {'type-' .. modulename .. '.' .. name .. '.' .. name}\n      -- methods:insert(Header(level + 2, name, attr))\n      methods:extend(render_function(documentation(method), level+2, id))\n    end\n  end\n\n  local type_description = properties .. methods\n  if name == 'Doc' then\n    type_description = Blocks{\n      Para {\"See the description \", Link(\"above\", \"#type-doc\"), \".\"}\n    }\n  end\n  local header_id = 'type-' .. nameprefix .. '.' .. name\n  known_types[name] = known_types[name] or header_id\n  return {Header(level, name, {header_id})} ..\n    type_description\nend\n\n--- Renders module documentation.\n--\n-- @param doc         documentation object of the module\n-- @return {Block,...}\nlocal function render_module (doc)\n  local fields = Blocks{}\n  if #doc.fields > 0 then\n    fields:insert(Header(2, 'Fields', {doc.name .. '-' .. 'fields'}))\n    for _, fld in ipairs(doc.fields) do\n      fields:extend(render_field(fld, 3, doc.name))\n    end\n  end\n\n  local functions = Blocks{}\n  if #doc.functions > 0 then\n    functions:insert(Header(2, 'Functions', {doc.name .. '-' .. 'functions'}))\n    for _, fun in ipairs(doc.functions) do\n      functions:extend(render_function(fun, 3, doc.name))\n    end\n  end\n\n  local typedocs = Blocks{}\n  local types = type(doc.types) == 'function' and doc.types() or {}\n  for _, ty in ipairs(types) do\n    typedocs:extend(render_type(ty, 3, doc.name))\n  end\n  if #typedocs > 0 then\n    typedocs:insert(1, Header(2, 'Types', {doc.name .. '-' .. 'types'}))\n  end\n\n  return Blocks{\n    Header(1, Inlines('Module ' .. doc.name), {'module-' .. doc.name})} ..\n    read_blocks(doc.description) ..\n    fields ..\n    functions ..\n    typedocs\nend\n\n--- Renders the documentation of the main \"pandoc\" module.\n-- FIXME: This function shouldn't exist.\nlocal function render_main_pandoc_module (doc)\n  local constants_section = Blocks{Header(2, \"Constants\")}\n  local fields = List{}\n  for _, field in ipairs(doc.fields) do\n    if tostring(field.type) == 'string' then\n      constants_section:extend(render_field(field, 2, \"pandoc\"))\n    elseif field.name:match '^pandoc%.[A-Z]' then\n      -- Ignore (these are the `Block` and `Inline` tables)\n    else\n      fields:insert(field)\n    end\n  end\n  local stop_rendering = false\n  local functions = List{}\n  for _, fn in ipairs(doc.functions) do\n    if stop_rendering then\n      pandoc.log.info(\"Not rendered in module pandoc: \" .. fn.name .. '\\n')\n    else\n      functions:insert(fn)\n    end\n    if fn.name == 'pandoc.SimpleTable' then\n      stop_rendering = true\n    end\n  end\n  doc.fields = fields\n  doc.functions = functions\n  -- product types don't render well, so we document those manually\n  doc.types = {}\n  return render_module(doc)\nend\n\nlocal autogen_start =\n  '\\n<!%-%- BEGIN: AUTOGENERATED CONTENT for module ([a-z%.]+) %-%->'\nlocal autogen_end =\n  '<!%-%- END: AUTOGENERATED CONTENT %-%->\\n'\nlocal reflinks_marker =\n  '<!%-%- BEGIN: GENERATED REFERENCE LINKS %-%->\\n'\n\n--- Create a raw Markdown block.\n-- @param str  Markdown text\n-- @return Block\nlocal rawmd = function (str)\n  return RawBlock('markdown', str)\nend\n\n--- Generate documentation for content marked for auto-generation.\n-- Skips all other contents and includes it as raw Markdown.\nlocal function process_document (input, blocks, start)\n  local mstart, mstop, module_name = input:find(autogen_start, start)\n  if mstart and mstop and module_name then\n    print('Generating docs for module ' .. module_name)\n    blocks:insert(rawmd(input:sub(start, mstop)))\n    local object = require(module_name)\n    local docblocks = (object == pandoc)\n      and render_main_pandoc_module(documentation(object))\n      or pandoc.utils.documentation(object, 'blocks')\n    blocks:extend(docblocks)\n    return process_document(input, blocks, input:find(autogen_end, mstop) or -1)\n  else\n    local reflinks_stop = select(2, input:find(reflinks_marker, start))\n    blocks:insert(rawmd(input:sub(start, reflinks_stop)))\n    return blocks\n  end\nend\n\n--- Custom reader function\n-- Processes all markers for auto-generated contents, ignores the rest.\nfunction Reader (inputs)\n  local blocks = process_document(tostring(inputs), Blocks{}, 1)\n  blocks = blocks:walk {\n    Link = function (link)\n      if link.classes == pandoc.List{'documented-type'} or\n         link.classes == pandoc.List{'wikilink'} then\n        link.classes = {}\n        local ident = link.target:gsub('^#', '')\n        if known_types[ident] then\n          link.target = '#' .. known_types[ident]\n        else\n          link.target = '#' .. ident\n          warn('Unknown type: ' .. ident)\n        end\n        return link\n      end\n    end,\n    Span = function (span)\n      local unknown_type = span.attributes['unknown-type']\n      if unknown_type and known_types[unknown_type] then\n        return Link(span.content, '#' .. known_types[unknown_type])\n      elseif span.classes:includes 'builtin-lua-type' then\n        return span.content  -- unwrap\n      end\n    end,\n  }\n  return Pandoc(blocks)\nend\n"
  },
  {
    "path": "tools/update-readme.lua",
    "content": "-- update README.md based on MANUAL.txt\n-- inserts contents of input-formats and output-formats\n\nlocal f = assert(io.open(\"MANUAL.txt\", \"r\"))\nlocal manual = f:read(\"*all\")\nmdoc = pandoc.read(manual, \"markdown\")\nf:close()\nresult = {}\n\nfunction Div(elem)\n  local ident = elem.identifier or \"\"\n  local fixrel = function(el)\n    if el.target:match(\"^#\") then\n      el.target = \"https://pandoc.org/MANUAL.html\" .. el.target\n    end\n    return el\n  end\n  local get = function(el)\n    if el.identifier == ident then\n      result = pandoc.walk_block(el, { Link = fixrel  })\n    end\n  end\n  if ident == 'input-formats' or ident == 'output-formats' then\n    pandoc.walk_block(pandoc.Div(mdoc.blocks), { Div = get })\n    return result\n  end\nend\n\n"
  },
  {
    "path": "tools/update-translations.py",
    "content": "#!/usr/bin/env python3\n# Update translations in data/translations\n# based on data from Polyglossia and Babel.\n#\n# usage: python tools/update-translations.py\n\nimport json\nimport re\nimport subprocess\nimport sys\nfrom configparser import ConfigParser\nfrom importlib.util import module_from_spec, spec_from_file_location\nfrom pathlib import Path\nfrom shutil import rmtree\n\nYAML = dict[str, str]\nAST = dict[str, \"AST\"] | list[\"AST\"] | str\n\n# missing Listing\nBABEL_KEYS = {\n    \"abstract\": \"Abstract\",\n    \"also\": \"SeeAlso\",\n    \"appendix\": \"Appendix\",\n    # \"appendix.template\",\n    # [chapter].[ ][[appendix]], take appendix\n    \"bib\": \"Bibliography\",\n    \"cc\": \"Cc\",\n    \"chapter\": \"Chapter\",\n    # \"chapter.template\",\n    # [chapter].[ ][[chapter]], take chapter\n    # [[prechapter]] [chapter] [[postchapter]], take postchapter (cjk)\n    \"contents\": \"Contents\",\n    \"encl\": \"Encl\",\n    \"figure\": \"Figure\",\n    # \"figure.template\",\n    # [figure].[ ][[figure]], take figure\n    \"glossary\": \"Glossary\",\n    \"headto\": \"To\",\n    \"index\": \"Index\",\n    \"listfigure\": \"ListOfFigures\",\n    \"listtable\": \"ListOfTables\",\n    \"page\": \"Page\",\n    \"part\": \"Part\",\n    # \"part.template\",\n    # [part][ ][[part]], take part\n    # [[prepart]] [part] [[postpart]], take postpart (cjk)\n    # \"postchapter\",  # see chapter.template\n    # \"postpart\",  # see part.template\n    # \"prechapter\",  # see chapter.template\n    \"preface\": \"Preface\",\n    # \"prepart\",  # see part.template\n    \"proof\": \"Proof\",\n    \"ref\": \"References\",\n    \"see\": \"See\",\n    \"table\": \"Table\",\n    # \"table.template\",\n    # [table].[ ][[table]], take table\n}\n\nPOLYGLOSSIA_KEYS = {\n    \"abstract\": \"Abstract\",\n    \"also\": \"SeeAlso\",\n    \"appendix\": \"Appendix\",\n    \"bib\": \"Bibliography\",\n    \"cc\": \"Cc\",\n    \"chapter\": \"Chapter\",\n    \"contents\": \"Contents\",\n    \"encl\": \"Encl\",\n    \"figure\": \"Figure\",\n    \"glossary\": \"Glossary\",\n    \"headto\": \"To\",\n    \"index\": \"Index\",\n    \"listfigure\": \"ListOfFigures\",\n    \"listtable\": \"ListOfTables\",\n    \"page\": \"Page\",\n    \"part\": \"Part\",\n    \"preface\": \"Preface\",\n    \"proof\": \"Proof\",\n    \"ref\": \"References\",\n    \"see\": \"See\",\n    \"table\": \"Table\",\n}\n\n\ndef git_clone(url: str, branch: str | None = None) -> Path:\n    \"\"\"Download the Git repository at the provided url.\"\"\"\n    return Path(\n        subprocess.run(\n            [\"git\", \"clone\", \"--depth\", \"1\", url]\n            + ([] if branch is None else [\"--branch\", branch]),\n            capture_output=True,\n            text=True,\n        ).stderr.split(\"'\")[1]\n    )\n\n\ndef parse_ast(tree: AST, is_map: bool = False):\n    \"\"\"Parse the pandoc value into a string.\"\"\"\n    if isinstance(tree, dict) and is_map:\n        return {key: parse_ast(value) for key, value in tree.items()}\n    elif isinstance(tree, list):\n        return [parse_ast(value) for value in tree]\n    elif isinstance(tree, str):\n        return tree\n    ast_type = tree[\"t\"]\n    assert ast_type in [\n        \"MetaInlines\",\n        \"MetaString\",\n        \"Str\",\n        \"Space\",\n    ], f\"Type {ast_type} is unsupported.\"\n    if ast_type == \"MetaInlines\":\n        return \"\".join(map(parse_ast, tree[\"c\"]))\n    elif ast_type == \"Space\":\n        return \" \"\n    else:\n        return parse_ast(tree[\"c\"])\n\n\ndef pandoc_parse(src: Path) -> YAML:\n    \"\"\"Parse YAML with pandoc's metadata parser.\"\"\"\n    with src.open() as f:\n        data = f.read()\n    try:\n        # HACK: disable (most) markdown parsing of strings\n        # TODO: commonmark, with unicode normalization disabled\n        # https://github.com/jgm/pandoc/issues/8341\n        format = \"markdown-smart-subscript\"\n        pandoc_ast = json.loads(\n            subprocess.run(\n                [\"pandoc\", f\"--from={format}\", \"--to=json\"],\n                input=f\"---\\n{data}\\n---\",\n                capture_output=True,\n                text=True,\n                check=True,\n            ).stdout\n        )\n    except subprocess.CalledProcessError as error:\n        raise ValueError(error.stderr.strip())\n    return parse_ast(pandoc_ast[\"meta\"], is_map=True)  # type: ignore\n\n\ndef read_yaml(src: Path) -> YAML:\n    \"\"\"Read the YAML data with an ad hoc reader.\"\"\"\n    with src.open() as f:\n        return {\n            (tokens := line.split(\": \"))[0]: (\n                value\n                if not (value := \": \".join(tokens[1:]).strip()).startswith(\"'\")\n                or not value.endswith(\"'\")\n                else value[1:-1]\n            )\n            for line in f.readlines()\n        }\n\n\ndef save_yaml(data: YAML, dst: Path) -> None:\n    \"\"\"Save the YAML data with an ad hoc writer.\"\"\"\n    with dst.open(\"w\") as f:\n        f.write(\n            \"\\n\".join(\n                f\"{key}: {value}\"\n                for key, value in sorted(data.items(), key=lambda x: x[0])\n            ) + \"\\n\"\n        )\n    assert pandoc_parse(dst) == data, \"Serialized different from expected.\"\n\n\ndef parse_babel(src: Path) -> tuple[str, set[str], YAML]:\n    \"\"\"Parse Babel's language files.\"\"\"\n    # TODO: strict=True once https://github.com/latex3/babel/pull/303 lands\n    config = ConfigParser(strict=False)\n    config.read(src)\n    bcp47tag = config[\"identification\"][\"tag.bcp47\"]\n    captions = config[\"captions\"]\n    # HACK: manual modifications (see BABEL_KEYS)\n    if \"postchapter\" in captions:\n        captions[\"chapter\"] = captions[\"postchapter\"]\n    if \"postpart\" in captions:\n        captions[\"part\"] = captions[\"postpart\"]\n    data = {\n        BABEL_KEYS[key]: value if not value.endswith(\":\") else value[:-1]\n        for key, value in captions.items()\n        if key in BABEL_KEYS and len(value) > 0 and value != \"<++>\"\n    }\n    return bcp47tag, set(captions.keys()), data\n\n\ndef parse_braces(s: str, i: int) -> str:\n    \"\"\"Return the contiguous block starting at index i defined by braces.\"\"\"\n    assert s[i] == \"{\", f\"{s} at character {i} does not start with a brace.\"\n    left = 0\n    for j in range(i, len(s)):\n        ch = s[j]\n        if ch == \"{\":\n            left += 1\n        elif ch == \"}\":\n            left -= 1\n            if left == 0:\n                return s[i : j + 1]\n    raise ValueError(f\"{s} is mismatched.\")\n\n\ndef parse_polyglossia_value(value: str) -> str:\n    \"\"\"Parse the Polyglossia value.\"\"\"\n    patterns = [\n        re.compile(r\"\\\\@ensure@RTL\\{(.*)\\}\"),\n        re.compile(r\".*##1##2\\s*(.*)\"),\n        re.compile(r\"\\\\textsc\\{(.*)\\}\"),\n    ]\n    for pattern in patterns:\n        match = pattern.match(value)\n        if match is not None:\n            return match.group(1)\n    if \"xpg@hr@digraph\" in value:\n        value = re.sub(\n            r\"\\\\xpg@hr@digraph\\{(.)\\}\\{(.)\\}\",\n            lambda match: match.group(1) + match.group(2),\n            value,\n        )\n    return value.replace(\"\\\\\", \"\").replace(\":\", \"\").strip()\n\n\ndef parse_polyglossia(data: list[tuple[str, str]]) -> YAML:\n    \"\"\"Process the Polyglossia data.\"\"\"\n    return {\n        POLYGLOSSIA_KEYS[key]: parse_polyglossia_value(value)\n        for key, value in data\n        if key in POLYGLOSSIA_KEYS\n        and value not in [\"\", r\"$\\rightarrow$\", r\"$\\Rightarrow$\"]\n    }\n\n\ndef parse_ldf(src: Path) -> list[tuple[str, dict[str, str], YAML]]:\n    \"\"\"Parse Polyglossia's language definition files.\"\"\"\n    with src.open() as f:\n        data = f.read()\n    # HACK: regex parsing of latex\n    pattern = re.compile(r\"(?m:^)[^%]*\\\\def\\\\([^\\{]+)name[^\\{]*\\{(.*)\\}\")\n    languages = []\n    extra = []\n    for match in re.finditer(\n        r\"\\\\def\\\\captions@?([^@\\{]*)@?([^@\\{]*)@?([^@\\{]*)\\{\", data\n    ):\n        language, variant, script = match.groups()\n        options = {}\n        if len(variant) > 0:\n            options[\"variant\"] = variant\n        if len(script) > 0:\n            options[\"script\"] = script\n        body = parse_braces(data, match.end() - 1)\n        matches = pattern.findall(body)\n        lines = [\n            line\n            for line in body.strip().splitlines()\n            if \"def\" in line\n            and \"name\" in line\n            and not line.strip().startswith(\"%\")\n        ]\n        assert len(lines) == len(matches), \"Missing matches.\"\n        captions = parse_polyglossia(matches)\n        languages.append((language, options, captions))\n        if len(options) == 1 and \"variant\" in options:\n            extra.append((language, {\"script\": options[\"variant\"]}, captions))\n    assert len(languages) == data.count(r\"\\def\\captions\"), \"Missing captions.\"\n    return languages + extra\n\n\ndef get_tags(\n    bcp472lang: dict[str, str], bcp472opts: dict[str, str], language: str\n) -> dict[str, dict[str, str]]:\n    \"\"\"Get the bcp47 tags and options matching the language.\"\"\"\n    bcp47tags = {}\n    for bcp47tag, name in bcp472lang.items():\n        if name == language:\n            options = (\n                bcp472opts[bcp47tag].lower().split(\",\")\n                if bcp47tag in bcp472opts\n                else ()\n            )\n            bcp47tags[bcp47tag] = {\n                s[0]: s[1] for s in map(lambda s: s.split(\"=\"), options)\n            }\n    return bcp47tags\n\n\nif __name__ == \"__main__\":\n    translations = Path(\"data/translations\")\n    translations.mkdir(parents=True, exist_ok=True)\n    for translation in translations.rglob(\"*.yaml\"):\n        assert read_yaml(translation) == pandoc_parse(\n            translation\n        ), f\"Pandoc parsing doesn't match on {translation}.\"\n\n    # original repository: https://github.com/latex3/babel/\n    babel = git_clone(\n        \"https://github.com/stephen-huan/babel/\", branch=\"pandoc\"\n    )\n    # original repository: https://github.com/reutenauer/polyglossia/\n    polyglossia = git_clone(\n        \"https://github.com/stephen-huan/polyglossia/\", branch=\"pandoc\"\n    )\n\n    babel_data = {}\n    babel_keys = set()\n    for path in (babel / \"locale\").glob(\"*/*.ini\"):\n        bcp47tag, keys, data = parse_babel(path)\n        babel_keys |= keys\n        babel_data[bcp47tag] = data\n    # print(f\"Babel keys: {babel_keys}\")\n\n    # https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly\n    spec = spec_from_file_location(\"bcp47\", polyglossia / \"tools\" / \"bcp47.py\")\n    assert spec is not None and spec.loader is not None, \"Can't find bcp47.py.\"\n    bcp47 = module_from_spec(spec)\n    sys.modules[\"bcp47\"] = bcp47\n    spec.loader.exec_module(bcp47)\n\n    # check coverage of bcp47.bcp472lang against actual polyglossia/tex/*.ldf\n    known = bcp47.bcp472lang.keys()\n    assert set(bcp47.babelname2bcp47.values()) <= known, \"Some values missing.\"\n    known |= bcp47.babelname2bcp47.keys()\n    known |= set(bcp47.bcp472lang.values())\n    for path in (polyglossia / \"tex\").glob(\"*.ldf\"):\n        name = path.stem.split(\"-\")[1]\n        assert name in known or name == \"latex\", f\"{name} not found.\"\n\n    polyglossia_data = {}\n    polyglossia_keys = set()\n    for name in sorted(set(bcp47.bcp472lang.values())):\n        bcp47tags = get_tags(bcp47.bcp472lang, bcp47.bcp472opts, name)\n        ldf = parse_ldf(polyglossia / \"tex\" / f\"gloss-{name}.ldf\")\n        if len(ldf) > 0:\n            languages, _, entries = zip(*ldf)\n            for data in entries:\n                polyglossia_keys |= data.keys()\n            assert {name} == set(languages), \"Languages don't match.\"\n        for bcp47tag, options in bcp47tags.items():\n            polyglossia_data[bcp47tag] = {}\n            # go in order of specificity and only apply if more general\n            for language, opt, data in sorted(ldf, key=lambda x: len(x[1])):\n                if opt.keys() <= options.keys() and all(\n                    value == options[key] for key, value in opt.items()\n                ):\n                    polyglossia_data[bcp47tag] |= data\n    # print(f\"Polyglossia keys: {polyglossia_keys}\")\n\n    # bcp47tag unique to either Babel or Polyglossia\n    unique = babel_data.keys() ^ polyglossia_data.keys()\n    shared = babel_data.keys() & polyglossia_data.keys()\n    assert (\n        unique | shared == babel_data.keys() | polyglossia_data.keys()\n    ), \"Missing keys.\"\n    for bcp47tag in unique:\n        data, other_data = (\n            (babel_data, polyglossia_data)\n            if bcp47tag in babel_data\n            else (polyglossia_data, babel_data)\n        )\n        assert bcp47tag not in other_data, \"Shared key.\"\n        captions = data[bcp47tag]\n        if len(captions) > 0:\n            save_yaml(captions, translations / f\"{bcp47tag}.yaml\")\n    # merge Babel and Polyglossia data\n    for bcp47tag in shared:\n        data, other_data = (\n            (babel_data, polyglossia_data)\n            if len(babel_data[bcp47tag]) >= len(polyglossia_data[bcp47tag])\n            else (polyglossia_data, babel_data)\n        )\n        # prefer values from data over other_data\n        captions = other_data[bcp47tag] | data[bcp47tag]\n        if len(captions) > 0:\n            save_yaml(captions, translations / f\"{bcp47tag}.yaml\")\n\n    # clean up after ourselves\n    rmtree(babel)\n    rmtree(polyglossia)\n"
  },
  {
    "path": "tools/validate-docx.sh",
    "content": "#!/bin/sh\n# Modified by edwintorok from https://github.com/devoidfury/docx-validator\n# to look at more files than just document.xml.\n# Further modified by jgm for portability.\ntmpdir=$(mktemp -d)\nerror_files=\"\"\nerrors=0\nfor file in \"$@\"; do\n  file_errors=0\n  echo \"*** Checking $file\"\n  rm -rf \"$tmpdir\"\n  unzip -q -o -j \"$file\" \"word/*.xml\" -d \"$tmpdir\"\n  for i in \"$tmpdir\"/*.xml ; do\n    xmllint --format \"${i}\" > \"${i}.pretty.xml\"\n  done\n  XSD=\"./docx-validator/schemas/microsoft/wml-2010.xsd\"\n  for i in \"$tmpdir\"/*.pretty.xml; do\n    xmllint -noout -nonet \\\n      -schema \"${XSD}\" \\\n      \"${i}\" 2>&1 || file_errors=$((file_errors + 1))\n  done\n  if [ $file_errors -gt 0 ]; then\n      errors=$((file_errors + errors))\n      error_files=\"$error_files\\n$file\"\n  fi\ndone\nif [ $errors -gt 0 ]; then\n   echo \"These files failed validation:$error_files\"\nfi\nexit $errors\n"
  },
  {
    "path": "tools/validate-docx2.sh",
    "content": "#!/bin/bash\n\nset -eu\n\n(for i in \"$@\"; do\n  dotnet run --configuration=Release --framework=net8.0 --no-build --no-restore --project OOXML-Validator/OOXMLValidatorCLI -- \"${i}\" -r\ndone) >validation\njq <validation\n\n[ $(cat validation | wc -c) = 2 ]\n"
  },
  {
    "path": "wasm/LICENSE",
    "content": "MIT License\n\nCopyright (c) Tweag I/O Limited.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "wasm/Makefile",
    "content": "SHA1_PANDOC_WASM=$(shell openssl sha1 -r pandoc.wasm | sed 's/ .*$$//')\nSHA1_PANDOC_JS=$(shell openssl sha1 -r pandoc.js | sed 's/ .*$$//')\nSHA1_INDEX_JS=$(shell openssl sha1 -r index.js | sed 's/ .*$$//')\nEXAMPLES=$(patsubst %,site/%.zip,$(shell find examples -mindepth 1 -type d))\nSHA1_EXAMPLES=$(shell cat $(EXAMPLES) | openssl sha1 -r | sed 's/ .*$$//')\n\nsite: site/examples $(EXAMPLES) site/pandoc.js site/index.js site/index.html site/pandoc.wasm\n\nsite/examples:\n\tmkdir -p $@\n\nsite/pandoc.js: pandoc.js\n\tperl -p -e \"s/SHA1_PANDOC_WASM/$(SHA1_PANDOC_WASM)/g\" $< > $@\n\nsite/index.js: index.js\n\tperl -p -e \"s/SHA1_PANDOC_JS/$(SHA1_PANDOC_JS)/g; s/SHA1_EXAMPLES/$(SHA1_EXAMPLES)/g\" $< > $@\n\nsite/%.html: %.html\n\tperl -p -e \"s/SHA1_INDEX_JS/$(SHA1_INDEX_JS)/g\" $< > $@\n\nsite/examples/%.zip: examples/% $(wildcard examples/%/*)\n\tcd \"$<\" && zip -r \"$(CURDIR)/$@\" .\n\nsite/%: %\n\tcp $< $@\n\nupload: site\n\trsync -av site/ website:pandoc.org/app\n.PHONY: upload\n\nserve: site\n\tcd site && python3 -m http.server\n.PHONY: serve\n"
  },
  {
    "path": "wasm/examples/bibtex-to-csljson/options.json",
    "content": "{\n \"from\": \"bibtex\",\n \"to\": \"csljson\"\n}"
  },
  {
    "path": "wasm/examples/bibtex-to-csljson/stdin",
    "content": "@BOOK{Wurm2011-ho,\n  title     = \"{Substanz und Qualität : Ein Beitrag zur Interpretation der\n               plotinischen Traktate VI,1, 2 und 3}\",\n  author    = \"Wurm, Klaus\",\n  publisher = \"De Gruyter\",\n  series    = \"Quellen und Studien zur Philosophie\",\n  edition   = \"Reprint 2011\",\n  year      =  2011,\n  address   = \"Berlin\",\n  keywords  = \"!!! Plotinus translation\",\n  language  = \"de\"\n}"
  },
  {
    "path": "wasm/examples/csv-table-to-org/options.json",
    "content": "{\n \"from\": \"csv\",\n \"to\": \"org\"\n}"
  },
  {
    "path": "wasm/examples/csv-table-to-org/stdin",
    "content": "\"Year\", \"Score\", \"Title\"\n1968,  86, \"Greetings\"\n1970,  17, \"Bloody Mama\"\n1970,  73, \"Hi, Mom!\"\n1971,  40, \"Born to Win\"\n1973,  98, \"Mean Streets\"\n1973,  88, \"Bang the Drum Slowly\"\n1974,  97, \"The Godfather, Part II\"\n1976,  41, \"The Last Tycoon\"\n1976,  99, \"Taxi Driver\""
  },
  {
    "path": "wasm/examples/custom-template/custom.tpl",
    "content": "<h1>$title$</h1>\n<p>by $author$</p>\n<p>Keywords: $for(keywords)$$it$$sep$; $endfor$</p>\n<main>\n$body$\n</main>\n"
  },
  {
    "path": "wasm/examples/custom-template/options.json",
    "content": "{\n \"from\": \"markdown\",\n \"to\": \"html\",\n \"template\": \"custom.tpl\",\n \"standalone\": true\n}"
  },
  {
    "path": "wasm/examples/custom-template/stdin",
    "content": "---\nkeywords:\n- bee\n- ant\n- ladybug\nauthor: E. N. Tymologist\ntitle: Some bugs\n...\n\nThis is a book about bugs.\n"
  },
  {
    "path": "wasm/examples/docx-with-equations-to-latex/options.json",
    "content": "{\n \"from\": \"docx\",\n \"to\": \"latex\",\n \"standalone\": true,\n \"input-files\": [\"equations.docx\"]\n}\n"
  },
  {
    "path": "wasm/examples/hello-world/options.json",
    "content": "{\n \"from\": \"markdown\",\n \"to\": \"html5\"\n}"
  },
  {
    "path": "wasm/examples/hello-world/stdin",
    "content": "*Hello* world!"
  },
  {
    "path": "wasm/examples/highlighted-code-to-html/options.json",
    "content": "{\n \"to\": \"html\",\n \"from\": \"markdown\",\n \"standalone\": true,\n \"embed-resources\": false,\n \"table-of-contents\": false,\n \"number-sections\": false,\n \"citeproc\": false,\n \"html-math-method\": \"plain\",\n \"wrap\": \"preserve\",\n \"highlight-style\": \"kate\",\n \"template\": null\n}"
  },
  {
    "path": "wasm/examples/highlighted-code-to-html/stdin",
    "content": "---\ntitle: Code with syntax highlighting\nlang: en-US\n...\n\nHere's some code with syntax highlighting:\n\n``` haskell\n-- | Inefficient quicksort in haskell.\nqsort :: (Enum a) => [a] -> [a]\nqsort []     = []\nqsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++\n               qsort (filter (>= x) xs) \n```\n\nTry changing the highlighting style to see what effect this has.\n\nHere's some python, with numbered lines:\n\n``` python {.numberLines}\nclass FSM(object):\n\n\"\"\"This is a Finite State Machine (FSM).\n\"\"\"\n\ndef __init__(self, initial_state, memory=None):\n\n    \"\"\"This creates the FSM. You set the initial state here. The \"memory\"\n    attribute is any object that you want to pass along to the action\n    functions. It is not used by the FSM. For parsing you would typically\n    pass a list to be used as a stack. \"\"\"\n\n    # Map (input_symbol, current_state) --> (action, next_state).\n    self.state_transitions = {}\n    # Map (current_state) --> (action, next_state).\n    self.state_transitions_any = {}\n    self.default_transition = None\n    ...\n```\n"
  },
  {
    "path": "wasm/examples/ipynb-to-rtf/options.json",
    "content": "{\n \"from\": \"ipynb\",\n \"to\": \"rtf\",\n \"standalone\": true\n}"
  },
  {
    "path": "wasm/examples/ipynb-to-rtf/stdin",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Lorem ipsum\\n\",\n    \"\\n\",\n    \"**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\\n\",\n    \"bibendum felis dictum sodales.\"\n   ],\n   \"id\": \"42a14256-91c8-446e-92a7-ab6bf11055d3\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"print(\\\"hello\\\")\"\n   ],\n   \"id\": \"98ee7437-e11a-4c16-b642-9e7911f32cd2\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Pyout\"\n   ],\n   \"id\": \"2df739f6-1afd-400b-845c-ad1efebc209f\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from IPython.display import HTML\\n\",\n    \"HTML(\\\"\\\"\\\"\\n\",\n    \"<script>\\n\",\n    \"console.log(\\\"hello\\\");\\n\",\n    \"</script>\\n\",\n    \"<b>HTML</b>\\n\",\n    \"\\\"\\\"\\\")\"\n   ],\n   \"id\": \"622b77f5-76e7-46cb-a694-56007ed6adbe\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Image\\n\",\n    \"\\n\",\n    \"This image ![the moon](attachment:lalune.jpg) will be included as a cell\\n\",\n    \"attachment.\"\n   ],\n   \"attachments\": {\n    \"lalune.jpg\": {\n     \"image/jpeg\": \"/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU\\nFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/wAALCAD6APoBAREA/8QAHAAAAAcBAQAA\\nAAAAAAAAAAAAAQIDBAUGBwAI/8QAPxAAAgEDAwIEBAQEBQMEAgMAAQIDAAQRBRIhBjETQVFhByJx\\ngRQykaFCUrHBFRYjM/BictEIJOHxQ1MmgpL/2gAIAQEAAD8A1x0YoQpwT2rFfjf1B4Kw2NnqDNMu\\nfFRG4H6fSsVmluJ5h40jyYHGSeKTw7ZAACk4x2pNosn2HrQpwMAZx2486By4c9vLNC0jDCgmmrE5\\nJHJHmfOjhWZcrn6UmEO09wRRiR4YCHOeTx2NJOSFyzHFJn5uf3oWxjBb5selEDsFwzHb2x3FJqwZ\\nRtIP9hSqYxx3Poc4o0agA7+T5c8CgYlee5oYhnlskjvQkKBjk8dqFCADzj0GaNjdk5IwP1NGGGzz\\n3oXYb8kkeXApVXATIJ+lcGBRskkeQ9KB5AMDGccYoDGcENjOfOi8A4/Wu3+37VtnxA+Jl5Lq81vo\\nkxSyVQFYH8x9eKya9nkurt5rhmaSQlmJ5z60h/GWyAPU0fdgDcuM8n3oGBZSMiiNk8DjH70m43HO\\nTn6d6A7SMjJIHOKS/iPzdue1CMruJ4B7Dzosjhs8bSfLPNNhKwcqRijQia4IS3jaR2OCEXcf0FWC\\nw6E6q1EZttEvirHAZ4ig/U4q26N8D+qbuZV1CS0sYTyzGTxCB/2jufvU/qX/AKfpVjZtN15JJAPl\\nSa32549VJ/pVKvfg11naqSunxzgE/wCzOpJ+xxVZ1HprXdLlCalpF/Aw5+aA4P3HeozmNgXXafNW\\nB4/WkS+5h6A+tKRs2CAPvmgeQ9vXijhQo+YZOKdyLbeDAIY5UlCnxmdwwY542jHAxj1oNoPriiui\\n5UYYduxoUG72yM5z3pd40TARmcbQTlcYNIOozlST54NHyceefSiEZ57HzBomf+mpYoTIGLY98Hmi\\nyoFbDflBJzTdlL52lTj17UeM4j3OO/7e9FfBPynOeeDXd1zjn3NF3bTxgknB4oYbea4kKQICRGW5\\nIUYUZJ5700Ocknt3FFZsrkHnHnUx0r0vrXVN14WjWjzKpCyTdo0+rGtp6X+B+j6VF+L6mu21B0G4\\nxINkQ9u+Wq+9EXOn3McqaLokWnW1vIYSxRV3AehHc/rVvEZxkmhKFsDy9qHw8EH+lcEwMjvRWTcS\\nCMj0qO1LQNK1GPw9Q0+0uFx/+SINiqJrvwV6S1EFoLaWwmPIe2fAz7qcis26j+A+s2YLaJfxX6L2\\nSX/TfH9P6Vmev9O6xoE2zWdOubUDszr8p+jdj+tRcbKfU8+dOUkBB2kYx96XAyMkkepFFLAHBJ4H\\nagRtw4OfQA0SQ5YKuTxShx/Dn3ojHJG0EmjwoXfYu0Z9Tj96JvUfxn//ADUqxz8wwq54AoszplTJ\\nHvUHkZxkemaQgXumdpOTjyrpSSwQntSbBio4IIGfTg1zg457Um2UCkHOR6dqGe/uJLeGCSVjDCWK\\nJnhScZx+lO+m9C1LqbVo9P0mHxJXGWYnCov8x9BW66F8CdHt/wANLrF1cXciKDJCrbI2b7c4+9a1\\npGm2ul2qW1hbRW0CfljjXAFO3jR1KOoZT5MM0EVvHAipCioi9goAFGuLiOBVMrhNxwM+Zoj3ltFI\\nsZnQzOMqgOSaXIOB60JUgegrl5HPei4zxxzXFeOBSZUEDaeab3thBfWzwXsUc8DjDJIoII+hrHus\\n/gXp14slx0zM1lcnJ8CRt0THvgea/wBKwrXdB1LQL97PV7R7ade2/s3uD2IpkknG3PHmKBuNuDwf\\najbwGwSPYCuB4wTknjjzo+MEZ8vKgDFW48/WiYC53c4oP9L+Zv0FTKDdHsK8A5PNGtZreKaXx4PH\\nBjZVUsV2MR8rcd8d6ZrksQSMfzetGlgmjjMmQq4HBPfPYgefahuZ4Xt7ZBbiJ0B8SUE5kJ7Z8sCk\\npOUB4PHnTSY/Ke5z/LVi6E6I1frG622MXhWKviS6k4Vcd8ebH2Femvh/0NpvR1gYrBWkuZQDNcv+\\naQ/2HHb+tW/GTgd6MRz7iuGS3NAzYBLZ+UZNYv1Z1Nqt/qRmsl8Wxgf5U/lK98L5k1f+l7dj4OoX\\nEpe6uYVYBo9pXODgj9vKnlxqV7penRTXFu93dPLsESYB2k8n7Cp62nS6tVmiDhSPyuNrD2IoUG5T\\njvXBTu70O1jXKuM8c0UsD8uQGxnFFICrknnyqG6o0LSNdsBYa3FDIkp2xhzhgx/lPka80fEv4Zan\\n0lM9zb7rzSC2EmUfNHz2cf37fSs+XnkH+9KLkkgqCPKhPzIMDkelH2tjPv5mjhdw/hz6Umw3A575\\nouypjJHzcA844oWOxSTgk8NntTUnErAEceQojMrAA8kHFAiqcZfaCQST2AomorHFI6xSCaNWIVwp\\nG4euKvnwo+Gk3VUyalqivDoyH5R2ac57D/p969L6ZZWml2cVrZwRwW0a7UjjUKFHtTq4leOFnhh8\\nSQDKoDgmjWkzTQJIybGYZK5zillySc0bHGP0NFckLxnd7U1g062hYskKAscnCjk0pPKLaNpGRQB5\\nj0ppp0b3MjXdzvw5HhKy4ZFqSUh0LJk4JHPHNEeRxhdpUnncBkD2pYrxk9/OkrlplhBhdEOfmZxk\\nAfTzpQYdQwyAeaLgOzAEMRx9KbXjzWdsZUie5ZTkqv5seeB5mqB1u+o6jqlvBH05NevEBPBK0pQR\\n4I4BHZj+1W/SEu5bBbTVrWMAxhWAfxFx5qSe/wBaxj4q/CI26zar0pD8gy81mpyR5koPT2rFMcMS\\nPmHfPH2xQx8gBe+Oc0ct/Ce/eub5RgDgjOPOgDd8jH1rtp9V/UU8kUkkYPfuPKpHp3RZ9f1ZLSJx\\nHCBvnlY4WKMfmc/QVOajF06kj2OiafNdpCctqM0u0yY7gDgAfvU4mi6LFYtqum2CXAgUfjtOuDlg\\nnbxIj+/pVZ616ZttPu7Kbp9Zbi0vYzNCcgjHmoHqKlPhX8PZ+p9Ua71eOWDS7V8SKV2tKw/gHt6n\\n2r0xBDHaW6RW8KpFGu1I1AAAHYAVC9TdUR9P6E2pXMMfiAAi2kkCsefL6Zpv0B1jH1ZbTubU27xk\\nkAnKsuSMg/UVZbi5S2iVxE8nzhQEHPPGcUvFc28jOkU8TyKcMquCQfQ0lqF0LSEP4byMWAVEHJJp\\nJjdM29FUs2AATwvqT7/tT4HHfik5IY5P9wK3OeRmlAOSD3IoQCBx2oX5X6VwyMnJ+meKTleMAGTB\\nOeAfWknuRbjN5JBFu/Ll8f1/tR7TZJCJIzlZOc+tdIj/ADDe2CMAelRZ1uystSg0m5eRJ2UbHcfK\\n+Pf1qZAUgFSCPUUV1JHArDvjN8LvxIm17pyHFyAWubVBxJ/1qPX1HnWD+IfBSPw1UoTuYghj7H6V\\nwXJ/Ke1c2QchuMYOaVIBXOcH0om8fz09kZl/Iwxz96tt5u0Dp6PSbYut9fotxfsgyyR/wR/odx9c\\nim80U2nWcUk8Qit5EWVMEhX5K7iCe/Bp90vqclvr1pcySKsdy3gzbjnch424981e+jLCwudD1HSr\\n+Zok02/lijduMK4wAc+9G0bqjU+koun7K7gkuNPuYn3Kyrv4YnepB54PY+latpGr2OsWwl065SZC\\nOR/Ep917ioTrnoqx6vs1gv5JYnjz4ckZ/Ln286fdGaAvTOg22mRTtcLCCviuoUkEk9h9anJHCtHt\\nU89iB2pvJplm8njCFFmyTvUbTn6inccexQGJYjjLcmhGANqgCgYcjI+9GQjbx2offn70ZcnPpQHu\\nRQOWAyORXSoJADnJqs2/SFit/Jd3AmvJ2bO64ctt5zwD2qzIpVQFA4HAHlQktuGBnPemN9HPIYmh\\ntrWRw2czjt6Y96fQ7zEpddregOaF9xbABoHTIyACOx5zXnT45/D06dM/UOjRhbR2/wDdQKOEY/xj\\nHkfP3rHm3HHh8H0omSMg4GfWlV5wpJHH61232NWXpLT4dQ16IXhxZ26tcXJ4P+moyR9zgfejT3Uu\\npapcXrKS9zISgDdhnAGPTsKt2izwR6vadNXOm22oDxNt5KSWIZs/JGSQABkfU5qM6d0t26vt7SCF\\nZIY74RgsfmQB+5+wxVogu5H0jrPUYXK+Lq0aRse/yv8A/XFV+51qC9udCk1BGa0gvJ0LA90JByAw\\n4xkVqc+h6JrAF30zqz2N4o+VreUhT7EU4septa6fuFtuqbRrmzx8t/AgO0erdgfP0PtV3069s9Tt\\n1udNuY7iFv4ozkfShkj3XiSFpE2jhd3BP0ol3b2+oWpjMoZWbOVfnI9MUq11DbLFFPMN7EKCR+Y0\\nu/BBALc0KvuUPtK54wa4Nt7+VDvB4Gc0IOBijK/ka6N1lB2EHHfBoVG0Z7UVnwDkEn2oUORuIIGK\\njda1W302OAXF7bWktxII4TOM729AKfx+ICFfkAfmAxzSwYYIPcVH67dSWmm3E0OzxQh2B22gt5Am\\nsF0fVeqJ5fGs1ureOaVncRyMVgP8Tbc+gPBrZLW7t9f6e3Qn8fZzgwyGZChbyYFSOPrXlj4g9Lzd\\nIdUXFg5Y2zHfbyHHzoTx9x2+1V6QZbhR96MVAAKgnFG3D2q6dH6fIvTWu6k6lVYR2aHOAzMy5BP0\\npTTIoV1OS4is4mt7CBp5EU5G5RhTk9/mxTzpRFsL+O8ubjwvwsb3Lykg5fGQOe5JOKddASeDd6z1\\nLd+GfwNu9xkjkyv+UfvXTTNp3w20+zidTqN5cPqcwLAFEXlc58zxgedUfVVuLWC2sbnA2KZRtbIO\\n/nOR7AU1stQu7Ni9tPLGSQflcgVeE+J+qTdPz6Xd7ZXk+Xxm7hf+fWrNoGnaff2sV50Xrc2l6p4a\\nmSN2xHI+OeOwJP1+lWKw+Jl7o0x07rnTnt5ACv4uFSUcds48/LtVl6TOgajKNS6YFtLIqFSPEIMZ\\nPqvOKtNvDOfnujG8g5TamAv0pwWGdndsZwKHDbhtUEeeT2rpOOaJkjtz5/8AxTS8vpIIi0ds0g/i\\nQsEI+54rrWWS5TfcFVGPlijbIH1YdzTPUIWnhWKxkuYFRs5gcKWbPY58qZMeorFXkhlt9STcB4cj\\nlJAPqPl/pU/HIZR+WSKVUDMjeVObWYTo5CuMHB3LjP0plqNhZXl7BJf2Edw0Slo5XUMEOfLPY/Sp\\nMFZFB5wR5jFRV3Be26BtNKzEEDwpnIGPPDYJ+1ROuWF/qeim3uIosTSoJIw+fkzk4OBg9j9qk9O0\\ntbW3jiLtIqrj5h8x9yfOpNEVIwqAADsBWa/HfphNa6Va8ij3XmnZmUgclP4h/f7V5oKhkz9aL4g3\\nj6Y7d6HHtWq3kSaJ8Oen7NkQyX0z3kqvxkYwv9VP2pr01Zf4h05r62qSyXzLGAkfbZuzz9cU11kv\\nounNpFxGhvb1hNcrzvjRfyofLk88VbdItrPS9M0/SdRtXf8AE51TUgij/TVf9tWz5Zx+grPOpdRj\\nvtRvbm8t8TXjKYuOUj7g+mT/AEqvX9wJ2gI2nwk8MHGOATjP6ikowOA4PI9e1FYlSCcn6U+srhYb\\npJ7aZoJ0UEeJyrN2/wCZq23PXV7Lpb6R1FYi7tXAVSflZMdyretJ9OaLqaIdc6NvpXmtnzJa/lmR\\ncemcMK1boL4ow6u0em9RD8JqTDaJD8qsfcZ4NahFHtRACTjAznOaNLGrphh55oJF4ogVEO5ieOc0\\ndgHXjBHvQrGCvyjgelBHEUx8oHoKJ8kbgEohJ5yQM1ExzajDq9yGUPbSDEMhIyreg9RUurLBE8kp\\nO7GWPfNI3Ut14e+yhWRj28Q7RjH61H6Rd61P4y6hax20uP8ATVSSuPr51IteRwRK164jYL82Mn/n\\naj21zb39pFcWcqzW8g3I47Ypyoxwe9GKHBxim93AtxbPFIu5HUq4PmCMGvHXWujt071Nf6YSSkUn\\nyE8ZU8j9v6VAsABux9qT8R/52/WtY+JVzCX0GO3BaOPTItpH8OfOq1p+o3+lTCbS714JSuxyAMbf\\ncVPdE2y3mrXev67IbiysP9eeaY5Lyj8qj7kcVE6jql3fx6z1Dc3DRNek28MX8yZBIA9AAP3pK66j\\nsdVs5v8AE9LjkvgixwTRyGNIwAACVHc1Vn24I7Ee/ekpHIUAkEDzBpWSRXQfLg+oPNIpgnGe3vzT\\nmS+n/CtbGTfCcfK/OOe49O9PeltVvdP1a0bTZJEn8UBfCOcknHbz+laJ1Iul9UXNy9tGLLqSBkEb\\nKwVbsHzPocc1qfUepaxZ6PbXGlzL+IsYk/FQMPlcFRk59u9R3QXxLbqHW/8ACb2CFJ/n2yQvkHb3\\nH/yK0c8Hvwab2l3bXO78PKsoyVyvIBHBFKEpG38IZ+BnzpOeZYU3vJsC9zgnP2FRdx1dp0S3Dw+J\\nJHbDdPIUZUjX1yRz9Bms26m+MnTsYaOGwe+dTuRz8i59DnmoDp742E6kDqNjFHaSOoxAxAQZ/MRz\\n2H0rf7S8t7yziubeZJbeRdyyocgj1oYLuK5XMDEjzOCP60rGWLMPLyqG1O4ddbtrePTpZVljZvxS\\nEbIyOACP3p9DaS2lvDDZeDGgOX3AnjzxSHUGv2GixM13Mkcm0squwUH3+lYhrfxjuLnWvDt70W1l\\nCCRIkJImb3Gc49P1rT+gPiDpvV7y2unxTxywRhz4ozuHbOR2+9Zn/wCpHSBFqWmaoqKBKrQSEeZB\\nyP2rGGJbuAVHApHdB6H9KtD3s9/Damdnk8FPCOfJM8YxU3oXTd3qh8dlex02IAyXs8m0ADuQKDXd\\nZTUwmhdPq8Og2pzLKeDKR3kc/rgVXupb+C+uEhskMdjbKI4lPc4/iJ9TmoeJiG4ACnn5a7BLZx39\\nRzSUibck54oqsWP8IBoQBye+K5nxE7cceffmjaXd/h7tJUlMUiHKyBclTjg1MwahMusW8gWN7gqi\\ngqflcj+In1xWvfDn4go891o3V0qRXZYhLiQjYw7bCe3l3q69LdI6XpXUcmq6RZQxJKrq7FidvPdP\\nLB7GlOpusY9I1y3sIo5LuSRPmigQs6ZPykgDsefPyp/p2s289sJtGjieBmxIeFCsfI+4HepuG1SJ\\nWfxNxc7iS2Rn2z2qA/znp9na6pdanLFCttK0ax5DMwHYgD1rz78QOvNQ6u1L8PYeLDpwO2OFRtz7\\ntj+9Wv4ffB+xvII73qC8iuXYb1tYZeF9NxHf6VatX+DnSl86x6cr2dwjbnEUmcj6Enj6VLdI9EX/\\nAEpqMCadrU0+jnPi2txztOONvpzV/UuZFSONAB+Zz5ew9aUOSMZIOMbhTTTbR7OIxs7SgsW+Y9vp\\n/wCKNqt0bLTbq5wcQxNJj1wpNeY9M0fqX4jawb6+Se5s0Yo0rMEVBzwPpnyqw9Oa/wBM9J6rc9Nd\\nR9PwP4E5QXQjEzH3bIzjHpWnPpmldO3Fpq+lJb6dZyMBMsaEGcNjau3yPOajPj3pwvugZ5QuWtZU\\nm9wM4P8AWvLu87zk4OM0QsM/mqx6feyWF14sDlcja+BnI+h4qwOl3r6RxPrU1zaJ834dFIK5/wCn\\nge2fKoDWdYHOkWVn+EtYzgofzOw82PmaiEcEZIIycmuQZBZsgHypWMKF2kY78UXYpOHLBe/FEKqA\\nSWwPTFEbGC2ASP8Amam+gho7dU2X+YmjXTFJdzIMoSBkA+2at/xRv+i9XtXbQkhgvrYriSGEIs4J\\nwRwB271mCuEQvxvyFUg42+f/AD61qPTFrH8RdFj02ezS31O0z4GoIoCMRyVcD1yOf6VdhZ9XdHaW\\nlxp14l3bWoEk1h4OFCfxbGbJPrV103Uhq+mQ6nZWqJbXkG+TcAsoP8p9fPnyx71n3SnS+qyapNct\\nctHpUQykanYxx5Mg4Y8d/PvVmvt9qBbSPeS6XeIRNGoeR4XxkFSORkjGO2TmvOnVuq/jtTnFtFLb\\n2kbGOKFnyygcc+pP9zTjo7pfWupLpY9LtX2/xysCqL9/Wt46W6C1DSotkus+BIwKl8hn2+nPapy5\\n6e1u2jZ7HUhPKgzEzZD5A4y3OfPipHQNeeayVdYEdteAqjYcbXJwMr9zU3LcSW8bgRSXEqLu2quA\\nfofX2pxLO8cYcW7vnuqkAijRSrPAssZcBv4XGCPtTfVrIX+m3Vq5IWaJoz7ZGKwfoK413o3qqfSL\\nyUSwodogAyZVGcbPLPn61od707pPWFrd3YsWsr2ZWjaXCrJkds4qaNhc3ekw6VIgV7ZYcXLY+fbw\\nSOOD3o3W2ltqnSWo6TayKks8HhoWycdsE15A1exFhqFxbeKkngyMhdOxIPcUz8Rf/wBgqYfCr2Jz\\n+n1p503DHP1Dp1tcAmKW4jWQZPzAsO9ehNR+GnTV3GUh0+O2YsGaWHIf9ayH4m9J6N0tFbRWNzNN\\nNMzMyybSyr65Hl7Y+9Z+q8DYwPHI9K4ttUBs5z2NCJc4DDGePWhlAxwDj17U2PnxzkHk0Eg2qNw+\\nY+9ELkq2QMAUgivPP4cKtK5OAqDJJ7YAFehfg9oWtaRBBcaxaQWVrGsrICSs8pfB5H/9fP1rW7Bv\\nEjkaSN1VzuKy84GO2PSlYoVmJDwIkIHyKOxHuMcUrDbQ20ey3RY1HOAOPsKh9butQj0i7fTLZV1B\\n1K2wmyQWz3bb2HnXlPXLa50PqWeLUSsl0ku+UrjBY4J4+9WK/wDiXfXai2t4GhsVGBFE5j3H1Yry\\nfoCKjNQ6s16IxSeDDZqnygw26rk9xknkn71I6J8Wte014wHik5Gdy/mGeze30rX+k+pNM6umgkMG\\n3EgBV1DYbG4kegz2NaQLjcI/ww8UE43KwwAPem0OqP4l0bq18C1iYpG7t80pA5wPT09a611iyvVj\\naCXbcMm8Qyjw3AJxyKkGJ8sHPOaaz2UFzPFNNbwvLCcxuyglT6inUUSoPlQDPJIAGaJPcxQPEksg\\nQytsQH+I+g/SojXrsCx1Dc8QgS0d2kV/nHfnHpx3rxlqDeI8p7gnzPeovwZf5lq0NkjaWY/9OccV\\nJ9HKq9W6Sx5X8VETn/uFehfiR1JN0tosd7bokheURkOM8EE/2rzn1frk+v3oubxYQVXCiMcAZ/c0\\n2vNOgsbSGOZ5DqUuHaMY2xKRwD/1eePKm4vrWSMJfWu7Iws0Z2uPL6H6U+t+ktQltJ7yKS3jgiTx\\nUFw/hySp6qp71XpiQGBZQ2MGjHgDg5x50ixBzgn6U4s7P8Zc21qvDXEixAnyycZr1PoOhab0zaW+\\nj6Dax/jNgeSd0DMD/MWPn6DNTNrpTLqFtNdSGZ0y25uRk/8A3VhMahB2C98HzpQDsa7aWPbPrSMo\\n/wBQdsY7VnXW3RNvqM1/LDbAzXyBXkBwF2nPI96xTqLpR+mI5mvGu0mcgxSRJuhKnuD5jHlmqlNq\\n00kTQvKJYN2QCvnjuab2ltcX90YrCCSWT8xVFJ48zWr/AAd0/UtO1/wSJIp5lXaSMoynlsHtnHr6\\nV6MtmiEYSALiP5do4wapfXP+toE7nUWsjJE0nigCXc65KhfJe3fvWKf5Z67uwnUAt3u1Zw42yhmx\\n3/Ln8v0rfOitXdNIt4tVIhkCKHDZxG55Kk9sYIq4RsjgMjKynsQc0ZnxUP1LJLHo9xLApeRFLYUf\\nNjHO33I4qvpCundHXkuoRwiWaB2kUYCxjadq88kCvJtwd8rnGBuJz5Gmmw+p/SrDMoDlmwCOefSp\\njoIR/wCcNIDqCrXUZwf+4YNbp8XobJ+jr65vQJHgQ+AhJwsh4Bx9zXmzTbC61a+S3sYTPKzAbV8h\\n6/StB+Jen2lgunx6VaxQzXUDNcyq3zuR3B3HtxxUD0r0nP1Hsm8BlsLZSm8D8z9/71bOtLfS7LqH\\nTrTVp2S1toMKhTcGOOBgevr5Vj1xKplJHzgngZxx6UpZWdzfzS/g4mcRKZHAI+VfUk0lFbyXdykU\\nCNJK5wir3J9Kn+kujtY1XqOOwmik06S3xNJLKuGQZ4wO5JPAxXqfRnhtNKhOpXES3JUCV5GVWLe4\\nzx9KmbU28qK8ToynsynI/UUtFPDLnwXRyO4ByR9qOTtO3+I8ijFgiFmzj25psJoJywjdXKH5gpzj\\n60D7JEZgQfPjyqP1bSLbV7GS1uYUaKQcgj/zWRa78Ebae63aXK1tG3LAncM+1OukfhBLoN/FeNqY\\nmmUEBNmVGfP38q0zSNKEMdo9xGnjxuzkqMAEgjj7GpqWNZAyDIJHJBwahOodPur9rfT4baMWbAtL\\nOXwY8EYUDzzk1PRwJDbpHCipEi4Cjtiqn1pbagmhvFoTW8cszgSLPFvBXGOPeof4WXMukDVdO1yT\\nw5bXbIZHJCMnPIzwMe3rVll686aELyNqduqJnndnOPQVXLPrIdWarBa6fFJBpK5aW4fgzc4VV9s8\\nmpvr5LKLpK7W/YLbiM8kcDj0868jSYDkL2ycUXYfX96lJSS4B44yNx5pfSrr8HqlncZIaOZH7ccM\\nP/Feo+pdNTqDp+5sd5i/Fxf7i91HBrD9K6M1fROuPw+lySKY4y8c7/IJB5jHZufKtC1foVNask/x\\nOV3vViVGnYDGfPGPvUrbWU2g6YbHT7XfbJCfDbzMpzkn27VkvXg1qXUtOvddgRY1R3j2YHiMvZSD\\n27Cs0gsrjUNSitIIi9zM+FQDnP8A4qeg006dod6JbyGCSS78CXb8zFVBPl5ZqJ06VU1JTDFHOiuC\\nPF4GPfHatyS7gkbT5kFrA4TaYbVQHJ88NwTxQ3VhqV9fzmHTrW20q5UPNLMx3Z8hkduP3NG1npnW\\nrS20yXRrySCcqQ0MDFd3ocDj0qRfo/W45bTV7vX5Dq8TRLEBwjYYZDAdzjIrWQFAVmA3YxmkvxMY\\nB3nYu4KCfM+gpvd3Nnp1rNcXDxQwqfmYkAZ96YaBPbaxpLXNlJmGR2wV48+3vTrTZJPFmhmMRSM8\\nMGy33p/KgI4pNUGCKOoAA9MdqLHComeTBywA79vtTfVby4tvBFpbJM7Nlyz7RGg7seDk+gpnpOsv\\nrFxdxixurSK3fw8zrjxeM7l9qkriN2aMRlQoOW3DOR/5rFep+ttO1LqW607U5Ug0O3EiMuz5piBx\\nv88Z5wKr/SR6NHUSyT27XULZDTyAC2jJzg7Dz5Vtuk6BptrIL3RfDWOUbgqcwnn8wHl9qp3xb0ey\\nPTV/qbyyy3hXajPMdgGecKTgfYV5ybudw788UXK+i1LKhaQNID3J4H7UmVAZnHck4A716v0G9t/8\\nsaXcSzBUlgjAdvM4xj9ad3ywxwN4sotyxwrjGQT6Z86jri6k06xX8PFNfBUJ3ltzM3ocVjfVvVXV\\nNit5dapNDZGQGK3shjeAe7YHIwAOT3zUBqcV31FdaPFPc311JIqPcO6Z8MEAbVAOCMc54/MK0/pf\\nRbPQHvLy6s7WxsxGMXDgeIPI8/8AO9QXU2g9Nx9Mm60+W1nthJ45O4DxGwe/me/asp6gmGoXcMek\\nWfgRlQqQxJtLHz+v3rbfhl06Qq3Oo3AluYYwojSPCRg+WfM+taRdNao8UTzQAn5jEeSR6gfWnEAt\\nYF8XAXOeT3x96YRo2oavHd+IG0+0O5Fx3fzJ9uf61m+q/EqS868stL6fuDcWEkghLMCNrtkZ9Tjg\\n/arh1VqZ6f02VoLu1RogW8KaceLLgclcnGc54Ned+rOvLnqSyWO4jZSru/yOduSfT6DFWL4a/FXV\\nNBkhsbxo7nTVG0Iw2sgH8pH9DVs1vW9TaZOq5bWZNNkuAIrcuVIhwAHZexywBrXOjdetupNGS8tT\\n8wJSRf5WHepdSPmBIzRlXgc0DSbZAoRiCMk44H3puZzJeGBrUPbeGG8fP8eeVx++aUltxLLFIrsp\\nTPAPBz60hrDSRWrG3YiYDCDH5j6V51/yzb9Zanf3eq6uunzJdNB+HSIO5YnJPcHGTVqX4H2MMcLx\\n39zcMCCQ4C5GMdvrg81bvhn0jqfSMV7b6jqZvLGQAwxAEBDk54PqD5VVvj3rkMGmJo1p4X+qQ0gH\\ndMdhWDEZQZ59qR8M+/61YER1GWfuOMeVJSRBWwBgZ4r0H8HrqPVOh47a42yNaymPBOcDupqR6n6b\\nvdXuD/79orUKMLySMeY9/esb6i1bWOnOqJ7HRdQuXjAAUj5s7hnseM1MaJ0JbXWkt1H1vLcztcHc\\nI9+OPIse/PkKtfTenWuj3trALiRfxUWYkt4Qp2jJ+diSe2O2OwpnpPUUesa1dXF7brJaTAQWxAJE\\naKT+dT5knNQXXmhQqNMt47eOOAyN4yxNtOGOQw/rTz4bdDWkbT6vfZkizsttpzn1Yeua0LS9PubW\\n4ka8aKKLcBbxQNtAB4O71NQlyw0XVNU6quRC8Eai2t4pWw20NgkH1Jz9qk7XqWw6psSbKFxexAF4\\nZFIMZ8s+RGatum2n4awjgY72xlzjuT3qKtuk9ItbuWe3s4onY7soMEN6j0rM7n4cXV/1pqF4/gT6\\ncdyO12TJl2HJHPBFSmj/AAi6deKQtC7E5BJOcHOPpUjonw90XSrq3S3s7dplJcl1EhGDx39auOqa\\nHBqsbQXahoSm0oB3/wCZrCLp9X+E/WgWImXSp2LRq7fJIp7g+hH9q3fT9fttU0aHVbDEtqy5k28l\\nBjnjzxUpbXC3FtHNb4eJl3Iw7MKMt1GbgW8hKyBd5OCEPOMA9s+2c0qLiFndEcFosbvQZ9TR1ZJE\\nzGwbz49KrfWlpqlzYxLorol8JDteT8qgqRnHmayTQOnJemOorf8AxOB9RaadXnQIf9JyCdyHu/fJ\\nIHFbnbPBcxxT20wkjKkqYzlT9aZa7fy6bYxssQnuJG2hR2z6+wA5ry38Q9UXUep7ubxfHA+Qv23E\\nelVVDlcrxzXYX1NT5KhSEB2nkUlJkgMxOBxg1pPwK1bwOpJbEsFiuYyVX1deR98ZrZm1GCaORJFm\\nhwSnzqV3Y9PWsP636RRNduJlaXw+JpNjFnQnOAPaofXbzX9SYWemSXM9hEUEQb5cMFxkg+pP61oG\\nh6Pea0bG4ud1mscKxzpuwY2HB578/wB6lrDTuldIjkhbUrQJCcOGkBYHzHr3qudY62msTRW+gadI\\n8KnDXMkLLv8ALAPBxjird8P7i6uovw98v+tZqIuBtAHcHH04+1WG/tGOowFXkAkVkeRHwVGMjHkK\\npXVNjJ1JqNn07p26CztSJLlpIydyj0J9+M1fNP0y1tZ1FtbpFGkQQY7kDsKlgMnGCDnFVrqXrnp3\\np+Z7XVL1hcqBuhRSW5Gah4Piv0VPJHbLdyIG43NCQoPvS7fE/oq3laFdVHy87kiYqfocUOi9f9M3\\nd6yrqtubk5wQjKrL5dx39qtU+s6baw+JcX1umRkAuM/p3qv9bdK2HV+nKlyhEqjfFIPzKfL9az3p\\ntNR6M6omsTZMdPuIx4EAciMuSBgk5GTzWyQzS2+mJJcWyrIAN8MJ3YPbA7UN3aw3ZKTwLLEQOGOR\\nn6eRptb2AMNxYpEbeyUrh9x3PxknOT9Kefho7a4a5jKKix7TjjAFIm6F1dwfh5ARs8R8L2BHGfej\\n3+npcHx41jF2ilY5WTcVB70WLdBBFHb2scKA/MBhQnuB/as56j1ktaal1BMrS2sAaK1OQDD5fKPM\\nse5PkK8539w1zNJNI255DksabgnAJ5B7e1Gx7ipdZiwO4jA4A/m9a5ZN7AEgDOSDT/p/UpdF1W01\\nCBv9qQPgjuM/+M16osJ7bVbO1vIQjxyIJUb0yKNc2MUwYTIpyMHI71HLoFpDuADIrDBAPDefbt7U\\niNZ0KxuJrGXULVLmIDxI5nwfbvRItK0uWb8RZ2lnLHL8zuihuRyDxxUlJp8NyirJGgiHPAwc/QUr\\nDZxWqZUJGM5DYxg+9KlzKjoAyshwzY4Pnwab6Jbbllu5Cd88hYBu6rztWpUjZH83B/es01b4i217\\n1hpfTujtNDc/jlFxIduxkGcr68/2rMPj/HD/AJ8Eq3CFZreNiV+bbjI8vpWe2Nl+NvPBivraMEZW\\nV2Kr/TipCLpiZtPa7XUbNolYqdjFsEHjyqFnhubdiwL/ACnh0J/WpLSuoLix1OG6ugLpUw2yVjgn\\n7edbz0r8bdDuTBa6hb3FpIRiSUkOoP174qd0/rHp7q2/t7XTWFzNHOs21oWIUL/ET2B7VfpY/G2A\\nk4DBufPFLg4FQOo2eoXepFTeL/hhA3WwTBbHkW74NLX2kw3Ok3Vjas9qJ48Exd1PHb9KhOkNBvOl\\nLe5iu9SiuIJJTO08ikSAY7Y7Y4/eg6t650myswlteSyTyMEJtV3NGM43EEc//NQ9x1jcWGkERWWq\\nXdpMPCt7x4wfFOOWPbA9+BWa/EyfUG6dsprxI7K0kxFb2sMh+fHJd/InGB9TWUvkHupxXKwI55NB\\nu9v2qdaP/Tzx8vcAYpRgpG1goQgN8w5ojgKNy+Rwc+Vaj8Murri30eTSortY7lDvgjeIyb1PdRjn\\nOc8e9O7j4gdRXl61rbXFrF2/1PC8M4xzw3nTy261tdD0u6Z7651LWwCqG4AVFJPY4PH/ANUtq8nT\\nHUUmkalqCxG8eFHn8MZC9gVb75/Sr904dJT8RZ6OsCeCFZhDjBB7H9sU9nuJLO5/1owbQRl3lXko\\nRjgj3zTq1b8TCszJsRhlQecjyJ/8Uzu7G4LXTWs3+pIm1Q2cA575+lR3WOnahqfTUtppl4lneMgX\\nc5+UjzHb96wbrDT+r+kupLCeK9nu3KBYGRy+QvdWFSnTN9oHUOsRQdRaMNM1N8mOe1PhIzeufUnP\\nPaq/fabo9r1x4N1vGmoQFF2S4zjt7gEmrTr3TfRuthprL8LA8XBaylESt9Q3pWZX2hWSiY6ZrMc0\\nCvhUlBUk/UcGoi6tprRvBeeMg8Hw3yKaStGxJlfA4HbOasvwz6XHVfUcFvI22xQ753Ze4H8P3OBX\\nrXS9DsdMto7bTYY7JEKtiFQNwHkeOc4qaCj1NGwMZPP2qN0q7k1B5Z/Akitg22LxBgv/ANWPIUGu\\nXxs4kjgMZupmChWOMLnlvtTbRbSFJpEeaS5mUYaV1IUZPYfb0p3PpVpJKJHtYmcEHcUGe+f60z1S\\n0S6MNgtw8Cvl3SM8uo7gnyBzXmz4y63Dq/U721mUNjp6/hotpyCR3I+/n7VQHXIyfP04oFQknAKm\\ni7j6j96tEysWA8hnjNJAbc4wCOR70hIxwzE4PJyfOltJu5tPvre8tSVnikVlwf2r0jZ2ehdW6Lb6\\ni1nbscbmVuNj+efvTPV+g9K1BUtY44LaTiQog7DnJ9+9NdSgmsrWDR2/D2qyylbeddo3ooysecfm\\nJ5J9KpujXrdE60i3FhJ4Cokl1O0hJG5uy4O0jPP3rcbXUrK/0+G5t5klhnwq855PkaT1C8e0KQ21\\nu0k3dFPCn7/2peO0a8e3ubpGjmiB2qH4BI57d+KXuYztYMobjsWxk1T4YoDr1zfStGrqShZANqbc\\nDBz5nkZqt9c3MUOk2t1cWMMthHI5MsR2CPP5ckg45J7VjuoaDrOvTS3Wm6fMLAsWhaVjhwx4K575\\npjrPw86p0gJ4unyy7/8A9HzY9artxpepaZgXtnc25LFAHQjcfam7I653JIpXvlSK0L4S9MPfal+P\\nutN/HW+CsaOhaPdnHzfv3rW7rTrXpHWrSW2YK7lmXTbaIFpCRjjHOOSeeBitLtXuIre3R43lnkGX\\nYADZnnmn6Dkbzn6UxlnvWv4Sht47FvlcSBhKW9F8venrOAxCYO0ZPtWa30upSdQfj3tbmdJGKxRg\\nc7cHgHHH3rQdLWVbFGvAElI3FSc7PYn2HeobXet9E0kBZLpbiRsBY7c7yxJwBxWd/EvqSfRLKS7e\\nWVNa1OHworXI22sGfmJx/EfWsAkkJYefPPnRMI454Ge1cAe5YAeWf6UXj2/WrLnDAsuFJPbuf1pG\\nQFs5G3bwMf3pBkC4f5eOCD5Gis3y4znJBGf2q9/Cvqj/AAvVYbS5umhtbmRVLE/Kpz5+xr0aI0kC\\nvGyvGy/UEe1ML3TLG8NvJeWylLVmaMNjCkjGf0NNrkWotEs5tOkeBwUSMRbkwOwOO1U74W6RrMGq\\nX51xGg0+CV1tImAG4k/m9Tgds1qDwJIF3gNtORkdj611xAtzGYyXXkZKOVPH0ppNpkHgNHEnhu3z\\nBwTuDeuTVW1fpi5ltTbW0qJPcHmYgtszyxGfvxUzpejjT9Nh0vwmvbUbi8ly4JyTnkdsUpD+Hi1H\\n8NPPajxMrbWqYyAo5/55ZqSWMbWLkEcjnsPaq7rfS2m9SwOt/Fuh/LG6Da6kHJKt5Z7VFax8Port\\nIYLe9MVqFAljaJWaQjz34yKntA6dg0OwEGnIqNyWYKo3E988ZNONK6etbPUZdSlzcanMMNPJyVGM\\nbU/lX2qaSFUZyq4ZuWb1pDUZZYLGVrdN8+MIvqx7Vik3V3W2kaxb22sW1jeHefAZsAoxzzkcnC8d\\nqs171L1N03ojXeqRabNJd3AEIaU7iGIwoAHYDzrRbJJDCksu0yMNxAGFXPkKoHxF17XbnUYunulg\\nsUsu4TTvjIUAEhR+x4rOFsh0XfXOp65NDc3FtEI7aELsDzkc7R6Lxz61mWt6xd6xqEt7fzNJNK2S\\newHoAPIVHlyAdwBzQDIwAo7+dHbPhkgtuJ7Gg2/9A/SrQx+U5AUBsbgaQYbWJALIe+POkrgykK6o\\nRnIBIxzRbdBv+fHiAds96Sl3BS64BP5RWxfCX4iNa20Oj6v4kqKcRTseVH8p9a2shJ4QRskjkGfU\\nEGuZSkRESgkDgHgUQJ4gUziN5EIfAH5T5fenIO4ED81ItA43urKZSMKxHb9O9JWd54j/AIW6Kx3q\\ngkpniQA43L7f0o11dwRskBnVZp28NAMk7sZ/pzUD1dqWv2enzw6Rb24nZfku7iYIiDzY5GMj3OKW\\n0+x/D2VkyubmfaN15tUsxK8uT6E+lUX4mdR7NJn0u21GzaSbabkpIVZcNkjj1UDIHNK6H8ULCRtP\\njee0tbaGAtdNISdoXgLEo5JJxyfKrpoPV+ja8QtlcMk7HCQzJsdh6gelWIlYl3ysqqO5NcZV8SNI\\n0dy43BlGVA9zQzxCaIqd2099pwc5ql/EJtam1rpqx0OUp4k7SXKg4zEoGc+3J++Kca3qXTPTuTqc\\nkLXbceEo8WVs+W0ZOP2qsdFTL1Prcur6kLaVpWaOCznRg1rGpPAH5cnIJPn9qvGtavDp2lyzzs9p\\nAiFpGfgqo4GMeZ8sVkmp9Sabp0KdRyI5vJkaGw08MVKIDw8jA557896xrVtRu9UvXub2d5ZJHPLP\\nnBPt6UwIZX+YcZokinK4Pn5UtsDKcckHijbSc8dqHaPUVZHVMM+VJAA2+R9aTuCDCf5e6r6ikppy\\nY4oHkJhjHypnAGe+PemwD5OApJHAHnRAJPDVnTacfl3ZANAgaGQZY5ByCDxWw/DL4kmwhi07WCTZ\\nqAiSbstGc4+pFbfZzR3Vsk1vIs0TjIdTwaZw6kP8Re0nha3fjw3cjbN/2n19qRmnt9Slf8FemC9h\\nlMJJG07u+3B7+tdY6jeyatPp91FEPw8aSNMoYbi2cADt5Z700utClu5biXVdSZ4icwbVERtm8ije\\nvr60pJZRacsuo3dxIs/h7HljyPGI/KSvbf5e+cVSuoeqdd0rVNM/zRa21v05cOqSNGd8jcfxj05G\\nQM4q0axLFr+nLB0rrUMM0bqCIGGGXzAH09Kznqj4LyavqsN3p93NB4xZrw3TbmZvUY9alenPgzb2\\n9hbwatcxztG5cyQpsYg/w7s9qudzqugdLyxWEUMs14kYwlvbmZkXHGSO3606s9UuZLSe51XS5klQ\\n4jjjXxDIhOF+XyPqKc2uoTSeIh0+6s1I4uJQoVftnIx7ii6zqNv0zpEl/dzzzLGmNzEvu4zk47ce\\ndVTSupoOuYdZMTSpptriNFtXKXDA+/HDZ7DtinE9r0z0tbJe6rFbWYVRtjYb5WPqT3Y1YNM1SxfT\\nhfW1qLaGX52Mi+Gx49MZrG/i11dLfo1pdzmCxkzts48eIdp+VmY9g3H6VjbyyTMJZHLueDuNJS5L\\ng4yBzmgdjwOx9DR4lQuhkLBMgEr3o8o/1CI2JjycZ74oQpxgN+tF2/X9asKgu5ds8Hy/tQknnvjs\\nTmmTqZArKOfUcftR2VsJjg9t2eDQSRMQGbBHqDkCm7KSSE5HsKGJ5IWGDtfuCOCOc1fPh98QLrpp\\ndryPNAXx+GfsQe7Z8j2/Wt80nV9H6s09PBeN93zGFjh1I9Pp6ioHrdb7TL+3vrO1trxIwVkO3bPD\\nkYDB89/LkVTrn4h6roWl3LT9O3aSltrXN5Jhmcn5QOPmwPSrB0v8QorzRP8A+RWrsyDM5ijLeGPI\\nsnfHuM1Ym6/6aFkJhesVwNsZhYOfTCkZNLadA/UoW91vS/AhQk20MpyxU/xMPInHapDS9A0vR5p7\\nqzs44pJOXkUc/SjX2v6Tb2xeS9iYE7AqNlic4xijWNw1zE4X+L8jTNu3j6DGB5c05s7CCxWWYQxp\\nNLgyMiY3nt2p2o3LnsQKQvULW7IWRUc7WLEdvPv7VgnxW6us9T1RdLsdTlg0mxUqXiHyySDjaM9x\\n5Z+tZ7oGqa3azXtl01I0t1dlRiCMtK+Du4IHHPerjpukXGo3cP8AiUxuNTsmE+p3V3P/AKcAXlYg\\ncnngE/pTb4ofExtdaGx0cmG1iJ3yRvxMfLA9PrWY3NxNdO0lxJJJIcfmOeAMAfSkdxbg5A9QKMz8\\nDvn1pIt7ZNLQj5fMfelznBxgE+1Bn5doHNdhxx836VY2lXftDlMjB4zu79/2o9vNYpFML2KaR8Yi\\naJgAh55PrUftdiioD4xOFwOc9qGUshKPuV1bBBHOe1JNnwznOCe+KKrDaAMhj557D3pO5Yb/AJJA\\n5H8QyKR4AI88cYNTum9U3dq8IkllMcLBlw5Urx5VpfTnxiiXFtr1obqEAZuAB4mB5MOxrSNN13pr\\nqsxPY3ttctEfEFrMoDbscEBu32qTl6bsZXjkNosciH5WViCo88Yo17daV07apJrV9CsZbELTgbu3\\nYY78VB3/AF68ngr0/omoaiJHVfGMJSMAnk5Pc1M9YdSWPTenwy3t7bWbSuBunUthfMhRyT+1QNr1\\n50v4xnXqPS5yB8sbxeCQT3OcE09HWdnqlvINC1nQ0uwMATylhu9P4c1WEvr6bVnh6rvr23uBLugk\\njRltnHfCFeeMdzkVYOo+oLfS0hurrqSG3sVH+zGRI87egxk449BWUfEH4wxaxCtnp2kwGGM7llvB\\nvIOO4XOAe/fNZbqusalfLBHfzSvFH+SIgKo+igYqwWfWV30rpp03p6exJnUPJexQnxuR+Ulu2PYV\\nVp9RuJRJ4szt4hLOCxO4nkk+tIIcqG/L6Yo21CCOSQMd8UEYQcsTg8c80chTja3agdRgkZGcciuB\\nKrny/elQcg7gc0YbSOe4oPmqfiV3Bb5SOzGkZFVHPz4UcH/4pOQFS3YY5APlQq5RCQSX79+/vTYy\\nNuORlc5I/wDFELAEkNnzwaQl3YzkZz5HPNJl5Nvzgg9sCgTcZdxywx3rix27i3AwPTNDBctb3KPG\\n5DIcjBI/cc1b9L+JvUWnBjHqdyy5wEkcuFH3pwnxMv59WivdSt7e7ZCQCygMM9zn1+1XyD462UFt\\nGkOlSCRVI+cg4OO3GKresfELSNc1n8VrFtAw2ZBiiywwcgfN58Y7YqwaBrvRmpR+MdUsrFmG5rO/\\n05WRD/3gc/rUb1bqXROp3KRXmpIklrGXW40i38NWbPyquRg4HfOKoY6mkTqZLr/HNae3jBVJ948Z\\nVPkMnHpVf1jUri/1Ke5nu5Z5ZGJEkgAY+hPvTWe78WBIfBgBBzvAwx9j7Ug8ryMfFLMVAAyc4omQ\\nXA8vpRlAII5z3zQo5wOTild64BP0oBMA208DtxR0Yc4FLcqMnH3PagP6+3qaDheDwfrmjhtoz3FE\\n3n1qcLk7yx2qQCAO1Jl2UknsR2zzRJNxZMkEd+aT3AE5bOO+KRdnRcc7hx9jSbElTz8vfFFkZlV1\\n4IPqM/vSIYkZbcR+ooY5yhzsBz55AIpN33H5Mnng/WiyOVBPBIPYjvSe4lu5DHnA4FFRxuIbOc54\\nPnStvMLO+he9thMiOHeByVDj09ecimbyh5CyLgE9s9vvXJggfMeMjBoyNjdg5B7GjBzsAIJY8Ckg\\nTkcefah2uO33x2oSH4wOBRcupwfOg3sickDPHaj78YJPPajeIdpxyO1CrAAZyWpRGYLxkGlzJn5m\\nOG/WjKwySe45oScjI5xxig3cEMRjy5ou/wD5gVOQM23G44486LN+Z6Gb8p+tNoPyL/2miNy3PpRV\\n/Kv0pFv9umiflf6Ghf8A3G/55VwOIuOOfKkyTzz6UmCQ/BNEP5F/7665OZjnnk96SP5ceVG//L9q\\nMP8Abahi/wBr70b+Whb87/Sij8poH/M1JD8gpReSM+v9qWX+L60Vu/3p1H2eub8ufOlIgMDgUqgw\\n3FNQTvPJ7UYAelf/2Q==\\n\"\n    }\n   },\n   \"id\": \"0db42901-5dc0-4fd3-b2db-b83b3c584437\"\n  }\n ],\n \"nbformat\": 4,\n \"nbformat_minor\": 5,\n \"metadata\": {}\n}"
  },
  {
    "path": "wasm/examples/latex-to-docbook-with-mathml/options.json",
    "content": "{\n \"from\": \"latex\",\n \"to\": \"docbook5\",\n \"html-math-method\": \"mathml\",\n \"standalone\": true\n}"
  },
  {
    "path": "wasm/examples/latex-to-docbook-with-mathml/stdin",
    "content": "\\newtheorem{theorem}{Theorem}\n\\newtheorem{corollary}[theorem]{Corollary}\n\\newtheorem{lemma}[theorem]{Lemma}\n\\theoremstyle{definition}\n\\newtheorem{definition}[theorem]{Definition}\n\\theoremstyle{remark}\n\\newtheorem{remark}{Remark}\n\n\\begin{definition}[right-angled triangles] \\label{def:tri}\nA \\emph{right-angled triangle} is a triangle whose sides of length~\\(a\\), \\(b\\) and~\\(c\\), in some permutation of order, satisfies \\(a^2+b^2=c^2\\).\n\\end{definition}\n\n\\begin{lemma}\nThe triangle with sides of length~\\(3\\), \\(4\\) and~\\(5\\) is right-angled.\n\\end{lemma}\n\n\\begin{proof}\nThis lemma follows from \\cref{def:tri} since \\(3^2+4^2=9+16=25=5^2\\).\n\\end{proof}\n\n\\begin{theorem}[Pythagorean triplets] \\label{thm:py}\nTriangles with sides of length \\(a=p^2-q^2\\), \\(b=2pq\\) and \\(c=p^2+q^2\\) are right-angled triangles.\n\\end{theorem}\n\n\\begin{remark}\nThese are all pretty interesting facts.\n\\end{remark}\n"
  },
  {
    "path": "wasm/examples/latex-with-macros-to-restructured-text/options.json",
    "content": "{\n \"from\": \"latex\",\n \"to\": \"rst\",\n \"standalone\": true,\n \"citeproc\": false\n}"
  },
  {
    "path": "wasm/examples/latex-with-macros-to-restructured-text/stdin",
    "content": "% from https://en.wikibooks.org/wiki/LaTeX/Macros\n\\newcommand{\\wbalTwo}[2][Wikimedia]{\nThis is the Wikibook about LaTeX\nsupported by {#1} and {#2}!}\n\n\\begin{itemize}\n\\item \\wbalTwo{John Doe}\n\\item \\wbalTwo[lots of users]{John Doe}\n\\end{itemize}"
  },
  {
    "path": "wasm/examples/lua-filters/count_words.lua",
    "content": "-- counts words in a document\n\nwords = 0\ncharacters = 0\ncharacters_and_spaces = 0\nprocess_anyway = false\n\nwordcount = {\n  Str = function(el)\n    -- we don't count a word if it's entirely punctuation:\n    if el.text:match(\"%P\") then\n        words = words + 1\n    end\n    characters = characters + utf8.len(el.text)\n    characters_and_spaces = characters_and_spaces + utf8.len(el.text)\n  end,\n\n  Space = function(el)\n    characters_and_spaces = characters_and_spaces + 1\n  end,\n\n  Code = function(el)\n    _,n = el.text:gsub(\"%S+\",\"\")\n    words = words + n\n    text_nospace = el.text:gsub(\"%s\", \"\")\n    characters = characters + utf8.len(text_nospace)\n    characters_and_spaces = characters_and_spaces + utf8.len(el.text)\n  end,\n\n  CodeBlock = function(el)\n    _,n = el.text:gsub(\"%S+\",\"\")\n    words = words + n\n    text_nospace = el.text:gsub(\"%s\", \"\")\n    characters = characters + utf8.len(text_nospace)\n    characters_and_spaces = characters_and_spaces + utf8.len(el.text)\n  end\n}\n\nfunction Pandoc(el)\n    -- skip metadata, just count body:\n    pandoc.walk_block(pandoc.Div(el.blocks), wordcount)\n    el.blocks = el.blocks .. { pandoc.Para(words .. \" words in body.\") }\n    return el\nend\n"
  },
  {
    "path": "wasm/examples/lua-filters/emph_to_allcaps.lua",
    "content": "function Emph(el)\n  return el:walk({\n    Str = function(el)\n      el.text = pandoc.text.upper(el.text)\n      return el\n    end })\nend\n"
  },
  {
    "path": "wasm/examples/lua-filters/options.json",
    "content": "{\n  \"from\": \"markdown\",\n  \"to\": \"html5\",\n  \"standalone\": false,\n  \"wrap\": \"preserve\",\n  \"filters\": [\"emph_to_allcaps.lua\", \"count_words.lua\"]\n}\n"
  },
  {
    "path": "wasm/examples/lua-filters/stdin",
    "content": "The first filter turns all *emphasized text* into\nALL CAPS, even when it is [*embedded* in a *link*](https://pandoc.org).\n\nThe second filter adds a word count to the end of the document.\n\n"
  },
  {
    "path": "wasm/examples/man-page-to-context/options.json",
    "content": "{\n \"from\": \"man\",\n \"to\": \"context\"\n}"
  },
  {
    "path": "wasm/examples/man-page-to-context/stdin",
    "content": ".TP\n\\f[C]-L\\f[R] \\f[I]SCRIPT\\f[R], \\f[C]--lua-filter=\\f[R]\\f[I]SCRIPT\\f[R]\nTransform the document in a similar fashion as JSON filters (see\n\\f[C]--filter\\f[R]), but use pandoc\\[cq]s built-in Lua filtering system.\nThe given Lua script is expected to return a list of Lua filters which\nwill be applied in order.\nEach Lua filter must contain element-transforming functions indexed by\nthe name of the AST element on which the filter function should be\napplied.\n.RS\n.PP\nThe \\f[C]pandoc\\f[R] Lua module provides helper functions for element\ncreation.\nIt is always loaded into the script\\[cq]s Lua environment.\n.PP\nSee the Lua filters documentation for further details.\n.PP\nIn order of preference, pandoc will look for Lua filters in\n.IP \"1.\" 3\na specified full or relative path,\n.IP \"2.\" 3\n\\f[C]$DATADIR/filters\\f[R] where \\f[C]$DATADIR\\f[R] is the user data\ndirectory (see \\f[C]--data-dir\\f[R], above).\n.PP\nFilters, Lua filters, and citeproc processing are applied in the order\nspecified on the command line.\n.RE\n.TP\n\\f[C]-M\\f[R] \\f[I]KEY\\f[R][\\f[C]=\\f[R]\\f[I]VAL\\f[R]], \\f[C]--metadata=\\f[R]\\f[I]KEY\\f[R][\\f[C]:\\f[R]\\f[I]VAL\\f[R]]\nSet the metadata field \\f[I]KEY\\f[R] to the value \\f[I]VAL\\f[R].\nA value specified on the command line overrides a value specified in the\ndocument using YAML metadata blocks.\nValues will be parsed as YAML boolean or string values.\nIf no value is specified, the value will be treated as Boolean true.\nLike \\f[C]--variable\\f[R], \\f[C]--metadata\\f[R] causes template\nvariables to be set.\nBut unlike \\f[C]--variable\\f[R], \\f[C]--metadata\\f[R] affects the\nmetadata of the underlying document (which is accessible from filters\nand may be printed in some output formats) and metadata values will be\nescaped when inserted into the template."
  },
  {
    "path": "wasm/examples/markdown-citations-to-plain-with-csl-style/le-tapuscrit-note.csl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" class=\"note\" default-locale=\"fr-FR\" version=\"1.0\" page-range-format=\"expanded\">\n  <info>\n    <title>Le tapuscrit (École des hautes études en sciences sociales) (note, French)</title>\n    <title-short>Tapuscrit-EHESS</title-short>\n    <id>http://www.zotero.org/styles/le-tapuscrit-note</id>\n    <link href=\"http://www.zotero.org/styles/le-tapuscrit-note\" rel=\"self\"/>\n    <link href=\"http://www.editions.ehess.fr/ouvrages/ouvrage/le-tapuscrit/\" rel=\"documentation\"/>\n    <author>\n      <name>Franziska Heimburger</name>\n      <email>zotero@franziska.fr</email>\n    </author>\n    <category citation-format=\"note\"/>\n    <category field=\"social_science\"/>\n    <category field=\"generic-base\"/>\n    <updated>2018-07-12T11:20:37+00:00</updated>\n    <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n  </info>\n  <locale xml:lang=\"fr\">\n    <terms>\n      <term name=\"ordinal-01\">ère</term>\n      <term name=\"ordinal-02\">e</term>\n      <term name=\"ordinal-03\">e</term>\n      <term name=\"ordinal-04\">e</term>\n      <term name=\"cited\">op.&#160;cit.</term>\n      <term name=\"page\" form=\"short\">p.</term>\n      <term name=\"editor\" form=\"short\">\n        <single>ed.</single>\n        <multiple>eds.</multiple>\n      </term>\n      <term name=\"in\">dans</term>\n    </terms>\n  </locale>\n  <macro name=\"author\">\n    <choose>\n      <if variable=\"author\">\n        <names variable=\"author\">\n          <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n        </names>\n      </if>\n      <else-if variable=\"editor\">\n        <names variable=\"editor\">\n          <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n          <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n        </names>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"author-bib\">\n    <choose>\n      <if variable=\"author\">\n        <names variable=\"author\">\n          <name name-as-sort-order=\"all\" form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \">\n            <name-part name=\"family\" font-variant=\"small-caps\"/>\n          </name>\n        </names>\n      </if>\n      <else-if variable=\"editor\">\n        <names variable=\"editor\">\n          <name name-as-sort-order=\"all\" form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \">\n            <name-part name=\"family\" font-variant=\"small-caps\"/>\n          </name>\n          <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n        </names>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"author-ibid\">\n    <choose>\n      <if variable=\"author\">\n        <names variable=\"author\">\n          <name and=\"text\" initialize=\"true\" initialize-with=\".\" delimiter-precedes-last=\"never\" sort-separator=\" \" font-style=\"normal\"/>\n        </names>\n      </if>\n      <else-if variable=\"editor\">\n        <names variable=\"editor\">\n          <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n          <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n        </names>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"editor\">\n    <names variable=\"editor\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \"/>\n      <label form=\"short\" prefix=\"&#160;(\" suffix=\".)\"/>\n    </names>\n  </macro>\n  <macro name=\"translator\">\n    <names variable=\"translator\">\n      <name form=\"long\" and=\"text\" delimiter-precedes-last=\"never\" sort-separator=\" \" prefix=\" traduit par \"/>\n    </names>\n  </macro>\n  <macro name=\"title\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song\" match=\"any\">\n        <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n      </if>\n      <else-if type=\"article-journal article-newspaper article-magazine\" match=\"any\">\n        <group delimiter=\", \">\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\"/>\n          <text variable=\"container-title\" font-style=\"italic\"/>\n        </group>\n      </else-if>\n      <else-if type=\"thesis\" match=\"any\">\n        <group delimiter=\"\">\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\",\"/>\n          <text variable=\"genre\" suffix=\", \" prefix=\" \"/>\n          <text variable=\"publisher\"/>\n        </group>\n      </else-if>\n      <else-if type=\"manuscript\" match=\"any\">\n        <group delimiter=\",\">\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n          <text variable=\"genre\" prefix=\" [\" suffix=\"]\"/>\n        </group>\n      </else-if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\"\">\n          <text variable=\"title\" text-case=\"capitalize-first\" quotes=\"true\"/>\n          <text value=\"dans\" suffix=\" \" prefix=\" \"/>\n          <text macro=\"editor\" suffix=\", \"/>\n          <text variable=\"container-title\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </group>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\"\">\n          <text variable=\"title\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\", \"/>\n          <text variable=\"URL\"/>\n          <group prefix=\" , \">\n            <date variable=\"issued\">\n              <date-part name=\"day\" suffix=\" \"/>\n              <date-part name=\"month\" suffix=\" \"/>\n              <date-part name=\"year\"/>\n            </date>\n          </group>\n        </group>\n      </else-if>\n      <else>\n        <text variable=\"title\" quotes=\"true\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"pub-place\">\n    <choose>\n      <if type=\"bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song\" match=\"any\">\n        <choose>\n          <if variable=\"publisher-place\" match=\"any\">\n            <text variable=\"publisher-place\"/>\n          </if>\n          <else>\n            <text value=\"s.l.\"/>\n          </else>\n        </choose>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"publisher\">\n    <choose>\n      <if type=\"bill book chapter entry-dictionary entry-encyclopedia graphic legal_case motion_picture paper-conference report song\" match=\"any\">\n        <text variable=\"publisher\"/>\n      </if>\n    </choose>\n  </macro>\n  <macro name=\"yearpage\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture paper-conference manuscript report song thesis\" match=\"any\">\n        <group delimiter=\", \">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <text variable=\"number-of-pages\" suffix=\"&#160;p\"/>\n            </else-if>\n          </choose>\n        </group>\n      </if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\" \">\n          <date variable=\"issued\">\n            <date-part name=\"year\" suffix=\", \"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\" suffix=\",\"/>\n          </group>\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <label variable=\"page\" form=\"short\"/>\n              <text variable=\"page\"/>\n            </else-if>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"article-journal\" match=\"any\">\n        <group delimiter=\" \" font-style=\"normal\">\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <label variable=\"page\" form=\"short\"/>\n              <text variable=\"page\"/>\n            </else-if>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine\" match=\"any\">\n        <date variable=\"issued\">\n          <date-part name=\"day\" suffix=\" \"/>\n          <date-part name=\"month\" form=\"short\" suffix=\" \"/>\n          <date-part name=\"year\"/>\n        </date>\n        <group delimiter=\" \" font-style=\"normal\">\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n        <group delimiter=\" \" font-style=\"normal\">\n          <choose>\n            <if variable=\"locator\" match=\"any\">\n              <group delimiter=\"&#8239;\">\n                <label variable=\"locator\" form=\"short\"/>\n                <text variable=\"locator\"/>\n              </group>\n            </if>\n            <else-if variable=\"locator\" match=\"none\">\n              <label variable=\"page\" form=\"short\"/>\n            </else-if>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\" \" prefix=\"(\" suffix=\")\">\n          <text value=\"consulté le\" suffix=\" \" prefix=\" \"/>\n          <date variable=\"accessed\" form=\"text\">\n            <date-part name=\"day\"/>\n            <date-part name=\"month\"/>\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"yearpage-bib\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture paper-conference report song thesis\" match=\"any\">\n        <group delimiter=\", \">\n          <group delimiter=\", \">\n            <date variable=\"issued\">\n              <date-part name=\"year\"/>\n            </date>\n            <group>\n              <text term=\"volume\" form=\"short\" suffix=\".\"/>\n              <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n              <text variable=\"volume\"/>\n            </group>\n            <text variable=\"number-of-pages\" suffix=\"&#160;p\"/>\n          </group>\n          <group>\n            <label variable=\"locator\" form=\"short\"/>\n            <text variable=\"locator\"/>\n          </group>\n        </group>\n      </if>\n      <else-if type=\"chapter entry-dictionary entry-encyclopedia\" match=\"any\">\n        <group delimiter=\", \">\n          <date variable=\"issued\">\n            <date-part name=\"year\"/>\n          </date>\n          <group>\n            <text term=\"volume\" form=\"short\" suffix=\".\"/>\n            <text variable=\"number-of-volumes\" prefix=\". \" suffix=\"/\"/>\n            <text variable=\"volume\"/>\n          </group>\n          <group>\n            <label variable=\"page\" form=\"short\"/>\n            <text variable=\"page\" prefix=\"&#160;\"/>\n          </group>\n        </group>\n      </else-if>\n      <else-if type=\"article-journal chapter\" match=\"any\">\n        <group delimiter=\" \">\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"article-newspaper article-magazine\" match=\"any\">\n        <group delimiter=\" \">\n          <date variable=\"issued\">\n            <date-part name=\"day\" suffix=\" \"/>\n            <date-part name=\"month\" form=\"short\" suffix=\" \"/>\n            <date-part name=\"year\"/>\n          </date>\n          <label variable=\"page\" form=\"short\"/>\n          <text variable=\"page\"/>\n        </group>\n      </else-if>\n      <else-if type=\"manuscript\">\n        <group delimiter=\"\" font-style=\"normal\">\n          <choose>\n            <if variable=\"issued\">\n              <date variable=\"issued\">\n                <date-part name=\"day\" suffix=\" \"/>\n                <date-part name=\"month\" suffix=\" \"/>\n                <date-part name=\"year\"/>\n              </date>\n            </if>\n            <else>\n              <text value=\"s. d.\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n      <else-if type=\"webpage post-weblog\" match=\"any\">\n        <group delimiter=\" \">\n          <text value=\"consulté le\" suffix=\" \" prefix=\" \"/>\n          <date variable=\"accessed\" form=\"text\">\n            <date-part name=\"day\"/>\n            <date-part name=\"month\"/>\n            <date-part name=\"year\"/>\n          </date>\n        </group>\n      </else-if>\n    </choose>\n  </macro>\n  <macro name=\"edition\">\n    <choose>\n      <if type=\"bill book graphic legal_case motion_picture report song chapter paper-conference\" match=\"any\">\n        <choose>\n          <if is-numeric=\"edition\">\n            <group delimiter=\" \">\n              <number variable=\"edition\" form=\"ordinal\"/>\n              <text term=\"edition\" form=\"short\"/>\n            </group>\n          </if>\n          <else>\n            <text variable=\"edition\" text-case=\"capitalize-first\" suffix=\".\"/>\n          </else>\n        </choose>\n      </if>\n      <else-if type=\"article-journal article-magazine\" match=\"any\">\n        <group delimiter=\"\">\n          <choose>\n            <if variable=\"issued\">\n              <date variable=\"issued\">\n                <date-part name=\"day\" suffix=\" \"/>\n                <date-part name=\"month\" suffix=\" \"/>\n                <date-part name=\"year\"/>\n              </date>\n              <text macro=\"volume\" prefix=\", \"/>\n            </if>\n            <else>\n              <text macro=\"volume\" text-case=\"capitalize-first\"/>\n            </else>\n          </choose>\n        </group>\n      </else-if>\n    </choose>\n    <text macro=\"issue\" prefix=\", \"/>\n  </macro>\n  <macro name=\"volume\">\n    <choose>\n      <if is-numeric=\"volume\">\n        <text term=\"volume\" form=\"short\" suffix=\".&#160;\"/>\n        <text variable=\"volume\"/>\n      </if>\n      <else>\n        <text variable=\"volume\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"issue\">\n    <choose>\n      <if is-numeric=\"issue\">\n        <text term=\"issue\" form=\"short\" suffix=\"&#160;\"/>\n        <text variable=\"issue\"/>\n      </if>\n      <else>\n        <text variable=\"issue\"/>\n      </else>\n    </choose>\n  </macro>\n  <macro name=\"collection\">\n    <text variable=\"collection-title\" quotes=\"true\" prefix=\" (coll.&#160;\" suffix=\")\"/>\n  </macro>\n  <citation et-al-min=\"4\" et-al-use-first=\"1\">\n    <layout suffix=\".\" delimiter=\"&#160;; \">\n      <choose>\n        <if position=\"ibid-with-locator\">\n          <group delimiter=\", \">\n            <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\" suffix=\".\"/>\n            <text variable=\"locator\" prefix=\"p.&#160;\"/>\n          </group>\n        </if>\n        <else-if position=\"ibid\">\n          <text term=\"ibid\" text-case=\"capitalize-first\" font-style=\"italic\"/>\n        </else-if>\n        <else-if position=\"subsequent\">\n          <group delimiter=\", \">\n            <text macro=\"author-ibid\"/>\n            <choose>\n              <if type=\"bill book graphic legal_case motion_picture report song thesis manuscript\" match=\"any\">\n                <text variable=\"title\" form=\"short\" font-style=\"italic\"/>\n                <text term=\"cited\" font-style=\"italic\" suffix=\".\"/>\n              </if>\n              <else>\n                <text variable=\"title\" text-case=\"capitalize-first\" form=\"short\" quotes=\"true\"/>\n                <text value=\"art cit\"/>\n              </else>\n            </choose>\n            <text variable=\"locator\" prefix=\"p.&#160;\"/>\n          </group>\n        </else-if>\n        <else>\n          <choose>\n            <if type=\"manuscript\">\n              <group delimiter=\", \">\n                <text variable=\"archive\"/>\n                <text variable=\"archive_location\"/>\n                <text variable=\"call-number\"/>\n                <text macro=\"title\"/>\n                <text macro=\"yearpage-bib\"/>\n              </group>\n            </if>\n            <else-if type=\"bill chapter article-journal article-newspaper interview book graphic legal_case motion_picture paper-conference report song thesis webpage post-weblog article-magazine\" match=\"any\">\n              <group delimiter=\", \">\n                <text macro=\"author\"/>\n                <text macro=\"title\"/>\n                <text macro=\"translator\"/>\n                <text macro=\"edition\"/>\n                <text macro=\"pub-place\"/>\n                <text macro=\"publisher\"/>\n                <text macro=\"yearpage\"/>\n              </group>\n            </else-if>\n          </choose>\n        </else>\n      </choose>\n    </layout>\n  </citation>\n  <bibliography>\n    <sort>\n      <key macro=\"author\" names-min=\"3\" names-use-first=\"3\"/>\n      <key variable=\"issued\" sort=\"descending\"/>\n    </sort>\n    <layout suffix=\".\">\n      <choose>\n        <if type=\"manuscript\">\n          <group delimiter=\", \">\n            <text variable=\"archive\"/>\n            <text variable=\"archive_location\"/>\n            <text variable=\"call-number\"/>\n            <text macro=\"title\"/>\n            <text macro=\"yearpage-bib\"/>\n          </group>\n        </if>\n        <else-if type=\"bill chapter article-journal article-newspaper interview book graphic legal_case motion_picture paper-conference report song thesis webpage post-weblog article-magazine\" match=\"any\">\n          <group delimiter=\", \">\n            <text macro=\"author-bib\"/>\n            <text macro=\"title\"/>\n            <text macro=\"translator\"/>\n            <text macro=\"edition\"/>\n            <text macro=\"pub-place\"/>\n            <group delimiter=\" \">\n              <text macro=\"publisher\"/>\n              <text macro=\"collection\"/>\n            </group>\n            <text macro=\"yearpage-bib\"/>\n          </group>\n        </else-if>\n      </choose>\n    </layout>\n  </bibliography>\n</style>"
  },
  {
    "path": "wasm/examples/markdown-citations-to-plain-with-csl-style/options.json",
    "content": "{\n  \"from\": \"markdown\",\n  \"to\": \"plain\",\n  \"citeproc\": true,\n  \"csl\": \"le-tapuscrit-note.csl\",\n  \"bibliography\": \"refs.bib\"\n}\n"
  },
  {
    "path": "wasm/examples/markdown-citations-to-plain-with-csl-style/refs.bib",
    "content": "@book{legras_michel_2010,\n  author = {Le~Gras, Gwénaëlle},\n  publisher = {Scope},\n  title = {Michel Simon~: l’art de la disgrâce},\n  series = {Jeux d’acteurs},\n  date = {2010},\n  address = {Paris},\n  isbn = {978-2-912573-52-0},\n  langid = {fre}}"
  },
  {
    "path": "wasm/examples/markdown-citations-to-plain-with-csl-style/stdin",
    "content": "---\ncsl: 'le-tapuscrit-note.csl'\nlang: fr-FR\nbibliography: refs.bib\n---\n\nFoo [@legras_michel_2010]."
  },
  {
    "path": "wasm/examples/markdown-to-docbook-with-citations/options.json",
    "content": "{\n \"from\": \"markdown\",\n \"to\": \"docbook5\",\n \"standalone\": true,\n \"citeproc\": true\n}"
  },
  {
    "path": "wasm/examples/markdown-to-docbook-with-citations/stdin",
    "content": "---\nreferences:\n- author:\n  - family: Salam\n    given: Abdus\n  container-title: \"Elementary particle theory: Relativistic groups and\n    analyticity. Proceedings of the eighth Nobel symposium\"\n  editor:\n  - family: Svartholm\n    given: Nils\n  event-date: 1968-05-19/1968-05-25\n  event-place: Aspenäsgarden, Lerum\n  id: salam\n  issued: 1968\n  page: 367-377\n  publisher: Almquist & Wiksell\n  publisher-place: Stockholm\n  title: Weak and electromagnetic interactions\n  type: paper-conference\n---\n\n@salam [p. 370] says some interesting things."
  },
  {
    "path": "wasm/examples/markdown-to-revealjs-slides/options.json",
    "content": "{\n \"to\": \"revealjs\",\n \"from\": \"markdown\",\n \"standalone\": true,\n \"citeproc\": false,\n \"html-math-method\": \"mathjax\",\n \"highlight-style\": \"pygments\",\n \"template\": null\n}"
  },
  {
    "path": "wasm/examples/markdown-to-revealjs-slides/stdin",
    "content": "---\ntitle: Pandoc for TeXnicians\nauthor: John MacFarlane\ndate: TUG 2020, 2020-07-26\ntheme: solarized\nheader-includes: |\n    <style>\n      .reveal {\n      font-size: 20pt;\n      line-height: 1.2em;\n    }\n     .reveal pre code {\n      font-size: 16pt;\n      line-height: 1.2em;\n    }\n    </style>\n...\n\n# Overview\n\n##\n\n- What is pandoc?\n- Using pandoc to convert to and from LaTeX\n- Why write in Markdown?\n- Overcoming Markdown's limitations\n\n# What is pandoc?\n\n##\n\n<https://pandoc.org>\n\n## Let's take it for a spin\n\n```\n% cat simple.tex\n\\section{On $e=mc^2$}\\label{einstein}\n```\n\n```\n% pandoc -f latex -t native simple.tex\n% pandoc -f latex -t html simple.tex\n% pandoc -t html --mathml simple.tex\n% pandoc -t html --mathjax simple.tex\n% pandoc -t -html --mathjax -s simple.tex\n% pandoc -t ms simple.tex\n% pandoc -t gfm simple.tex\n% pandoc -t context simple.tex\n% pandoc -t jats simple.tex\n```\n\n\n## Some math\n\nLet's try with a sample TeX document by Professor A.J. Roberts\nat the University of Adelaide (CC licensed).\n\n<http://www.maths.adelaide.edu.au/anthony.roberts/LaTeX/Src/maths.tex>\n\n## Some math\n\n```\n% pandoc maths.tex -o maths.docx\n```\n\n. . .\n\nTwo problems:\n\n- the use of a low-level TeX primitive `\\mathcode`.\n- the use of `\\parbox` (line 288)\n\nFix by removing the `\\mathcode` stuff and\nredefining the `\\parmath` macro as a no-op:\n\n```latex\n\\newcommand{\\parmath}[2][]{#2}\n```\n\n## Take two\n\n```\n% pandoc maths.tex --number-sections -o maths.docx\n% open maths.docx\n```\n\n- AMS theorem environments come out right, including references.\n- Math is translated into native Word equation objects, which\n  can be edited and which match the font, rather than images.\n- Still missing: equation numbers.\n\n## Going the other way\n\n```\n% pandoc maths.docx -o newmaths.tex -s\n% xelatex newmaths\n% xelatex newmaths\n```\n\n## Converting to HTML\n\n```\n% pandoc maths.tex -s -o maths.html --mathml \\\n  --number-sections --toc\n% open maths.html\n```\n\n## Comparison with latex2rtf\n\n```\n% latex2rtf maths.tex\n% open -a \"Microsoft Word\" maths.rtf\n```\n\n- References not resolved in Section 1\n- Accents in Section 2 not above the letters, math generally\n  ugly\n- Arrays in Section 8 totally broken; same with subequations in\n  Section 9\n- But at least we do get equation numbers in Section 9\n\n## Comparison with tex4ht\n\n```\n% make4ht maths\n% open maths.html\n```\n\n- Theorem environments not handled in Section 1 (except for one?).\n- Missing accents in Section 2.\n- Ugly equations that incorporate both text and images in\n  different fonts.\n\n## Comparison with Word from PDF\n\n```\n% pdflatex maths\n% pdflatex maths\n% open -a \"Microsoft Word\" maths.pdf\n```\n\n- Section 2, accents messed up.\n- Some formulas are rendered with images, others with\n  regular characters, in non-matching font.\n- The 'where' in Section 6 is badly mispleacd.\n- The integral is missing in Section 7\n- The diagonal ellipses are missing in the arrays\n\n\n## Pandoc can interpret TeX macros\n\n```\n% cat macros.tex\n\\newcommand{\\nec}{\\Box}\n\\newcommand{\\if}[2]{#1 \\rightarrow #2}\n\\newenvironment{warning}%\n {\\begin{quote}\\textbf{WARNING!}}%\n {\\end{quote}}\n\n$\\if{\\nec \\phi}{\\phi}$\n\\begin{warning}\nDon't try this at home.\n\\end{warning}\n```\n\n```\n% pandoc macros.tex -t html\n```\n\n## Pandoc can resolve bibtex citations\n\nWith the help of the `pandoc-citeproc` filter\n(included in the released binaries).\n\n```\n% pandoc --filter pandoc-citeproc bib.tex \\\n  -t plain --csl ieee.csl\n```\n\n## Limitations\n\nPandoc is far from being able\nto convert arbitrary tex files with high accuracy.\n\nLet's try with a real-world example I got at random from arxiv.\n\n```\n% cd arxiv.2007.07694v1\n% pandoc arxiv.tex -o arxiv.docx\n```\n\n# An alternative\n\n## An alternative\n\nSo you can't just write in LaTeX and expect to convert at the\nlast minute to docx (for a publisher) or epub (for your\nstudents) or HTML (for your website).\n\nAn alternative: write your document\nin pandoc's extended version of Markdown, which pandoc\ncan convert with complete accuracy to any of its\noutput formats.\n\n\n## What is Markdown?\n\nMarkdown is a set of conventions for indicating document\nformatting in plain text, mostly inherited from the pre-internet\ndays of bulletin boards and email.\n\nIt was designed in 2004 by John Gruber with help from Aaron\nSchwartz, and it is currently much used by programmers,\nand on forums like stackoverflow and reddit, and by\ndata scientists via Jupyter notebooks and RMarkdown.\n\n<https://daringfireball.net/projects/markdown/>\n\n## Appealing things about Markdown\n\nThe source text is readable as it is.\nWhen writing and revising, you don't have\nto parse through command-words which aren't part\nof the content.\n\n. . .\n\nIf you're writing in a language other than English, you\ndon't have to have English words sprinkled in the text.\n\n. . .\n\nThere's no boilerplate at the beginning. The document\njust starts with the text.\n\n## Real separation of content from formatting.\n\n\\vspace{1em}\n\n> The paucity of means is the greatest virtue of markdown and\n> pandoc markdown.\n>\n> It is strangely difficult to get people to see the point, but the\n> defects of LaTeX for concentration, writing and thought, are at least\n> as great as those of Word, for the simple reason that it gives the\n> writer too much power; there is always another package to call in the\n> preamble, as there is always another drop down menu in Word.\n> ...\n>\n> In markdown - not to put too fine a point on it - the writer is only\n> ever faced with one question, and it is the right one: what the next\n> sentence should be.\n>\n> --- Michael Thompson, pandoc-discuss mailing list\n\n\n## Appealing things about Markdown\n\nUsing Markdown makes it possible to collaborate with\nothers who don't know LaTeX.\n\n## Appealing things about Markdown\n\nMarkdown can be converted with complete, reliable accuracy\ninto many different formats.\n\nIt's often not enough just to produce a PDF.\n\n- JATS for publication or archiving\n- EPUB for convenient reading on mobile devices\n- Docx or ICML for a publisher\n- HTML for a website (or accessibility)\n- Jupyter notebook for research\n- Beamer or reveal.js slides for presentation\n\nTeX is a great assembly language for publication-quality\ndocuments.\n\n## Limitations of Markdown\n\nJohn Gruber's original markdown syntax lacks support for:\n\n- [ ] tables\n- [ ] figures\n- [ ] footnotes\n- [ ] definition lists\n- [ ] ordered lists other than decimal-numbered\n- [ ] super/subscript\n- [ ] math\n- [ ] document metadata\n- [ ] attributes or metadata on individual elements like sections\n- [ ] labels and cross-references\n- [ ] numbering for running examples or equations\n\n## Limitations of Markdown\n\nWe couldn't live without these things in academic writing.\n\nAnd we definitely couldn't live without\n\n- [ ] bibtex/biblatex\n- [ ] macros\n\nHow can we overcome these limitations?\n\n# Overcoming Markdown's limitations\n\n## Pandoc's extended Markdown syntax\n\n- [x] tables (limited)\n- [x] figures (limited)\n- [x] math\n- [x] footnotes\n- [x] definition lists\n- [x] more flexible ordered lists\n- [x] running example lists\n- [x] super/subscript\n- [x] strikeout\n- [x] metadata\n- [x] attributes\n- [x] generic containers\n\n##\n\nPandoc also understands LaTeX macro definitions, which\nyou can use for math (no matter what the output format).\n\n##\n\nLabels and cross-references are still a work in progress,\nbut you can get good support for them using an external\nfilter, `pandoc-crossref`, by pandoc contributor\nNikolay Yakimov.\n\n##\n\nYou can use the `--citeproc` filter to resolve citations\nin this syntax:\n\n```\nBlah blah [@putnam:empirical, p. 33; see also\n@dummett:empirical].\n```\n\nChange the style by specifying a CSL stylesheet.\n(You can even change between author-date, numerical,\nand footnote sytles with no modifications to the source.)\n\nYou can use your existing bibtex or biblatex bibliography\nfile, or a CSL JSON bibliography such as can be produced\nby Zotero.\n\n##\n\nLaTeX macros allow you to define new constructions\nthat exactly fit what you're writing about.  Can\nwe recover this flexibility?\n\n## Raw TeX in Markdown\n\nOne approach is to just include bits of raw TeX in\nyour markdown file. Pandoc allows that.\n\n- There is a special syntax for indicating chunks of raw TeX,\n  but pandoc will also recognize obvious bits of raw TeX\n  and pass them through as such.\n\n- The raw TeX chunks will be passed on unchanged if the output format\n  is `latex`, `beamer`, or `context`, and otherwise simply omitted.\n\n##\n\n```\n% cat raw.md\n% pandoc raw.md -o raw.pdf\n% open raw.pdf\n```\nBut:\n```\n% pandoc raw.md -s -o raw.html\n% open raw.html\n```\n\n\n##\n\nDrawbacks:\n\n- With this approach you lose the ability to\n  target multiple formats.\n- Your source is now an ugly mix of Markdown and\n  TeX, compromising readability.\n\n\n## A better approach\n\n1.  Adopt the convention that\n    a certain thing representable in pandoc's markdown\n    should be interpreted as, say, a dropped capital letter.\n\n2.  Write a filter that does the interpretation.\n\n## Example: drop caps\n\nIn LaTeX we can use the `lettrine` package to\nget dropped capitals at the beginning of chapters:\n\n```latex\n\\lettrine{T}{his} is a pulley\n```\n\nWe will use a generic bracketed span with a class\nto represent this in Markdown:\n\n```\n[This]{.dropcap} is a pulley.\n\n```\n\n## Example: drop caps\n\nNow we need a filter that replaces\n`Span` elements with class `dropcap` in the Pandoc AST\nwith something appropriate for the output format.\n\n![](pandoc-architecture.pdf){height=3in}\n\n## Two kinds of filters\n\n- **JSON filters** operate on a serialized JSON\nrepresentation of the pandoc AST.  They\ncan be written in any language that can consume\nand produce JSON.\n\n- **Lua filters** use a Lua interpreter\nand environment built into pandoc.\nNo external software need be installed, and\nthe filters are more efficient,\nbecause we don't need to serialize and deserialize\nas JSON.\n\nDocumentation: https://pandoc.org/lua-filters.html\n\n## Example: drop caps\n\nIn a Lua filter we define functions that match\ndifferent kinds of AST elements. Here we want to\nmatch a Span.  Create a file `dropcap.lua`:\n\n```lua\nfunction Span(el)\n  -- do something with the Span (el)\n  -- return the transformed element or a new element\nend\n```\n\n## Example: drop caps\n\nWe only want to do something if the Span has the\nclass `dropcap` and its contents begin with a Str\nelement.\n\n```lua\nfunction Span(el)\n  if el.classes:includes('dropcap') then\n    return make_dropcap(el.content)\n  end\nend\n```\n\n## Example: drop caps\n\nNow we just have to define `make_dropcap`.  It takes\na list of Inline elements (`el.content`) and returns\na list of Inline elements.\n\n\\small\n\n```lua\nlocal function make_dropcap(els)\n  if els[1] and els[1].t == 'Str' then  -- arrays start at 1!\n    local first_letter, rest = els[1].text:match('(%a)(.*)')\n    if FORMAT == 'latex' then\n      els[1] = pandoc.RawInline('latex',\n                 '\\\\lettrine{' ..  first_letter ..\n                 '}{' .. rest .. '}')\n    elseif FORMAT:match('html') then\n      els[1] = pandoc.Span({\n                   pandoc.Span(pandoc.Str(first_letter),\n                    {class='dropcap-first'}),\n                   pandoc.Span(pandoc.Str(rest),\n                {class='dropcap-rest'})})\n    end\n    return els\n  end\nend\n```\n\n## Example: drop caps\n\n```\n% pandoc -L dropcap.lua -t latex -o dropcap.pdf\n% pandoc -L dropcap.lua -t html -s --css dropcap.css \\\n    dropcap.md -o dropcap.html\n```\n\n## Example: tikz diagrams\n\nTo get a tikz diagram, we could have a filter turn\nspecially marked code blocks into images.\n\nIn fact, there is already a very nice general\ndiagram filter at https://github.com/pandoc/lua-filters.\n\n```\n% cat diagram.md\n% pandoc diagram.md -L diagram-generator.lua -s \\\n  --extract-media=media -o diagram.html\n% pandoc diagram.md -L diagram-generator.lua \\\n  -o diagram.docx\n```\n\n## Example: theorems\n\nHow to reproduce LaTeX `theorem` environments?\n\nMarkdown version:\n```\n::: {.theorem #pythagoras}\n#### Pythagoras's Theorem\nIn a right triangle, the lengths of the two shorter sides\n$a$, $b$ and the longer side $c$ stand in the relation\n$$\na^2 + b^2 = c^2.\n$$\n:::\n```\n\n## Example: theorems\n\n```\n% cat theorem.lua\n% cat theorem.md\n% pandoc -L theorem.lua theorem.md -t latex\n% pandoc theorem.md -L theorem.lua -t plain\n% pandoc theorem.md -L theorem.lua -t rst\n% pandoc theorem.md -L theorem.lua -t html\n```\n\n## The end\n\n- For pandoc questions, come to pandoc-discuss on google groups:\n  <https://groups.google.com/g/pandoc-discuss>\n- For bug reports, the tracker at https://github.com/jgm/pandoc\n- If you'd like to improve pandoc's handling of LaTeX,\n  we can always use new contributors!\n\nQuestions?\n\n"
  },
  {
    "path": "wasm/examples/markdown-to-rst/options.json",
    "content": "{\n \"to\": \"rst\",\n \"from\": \"markdown\",\n \"standalone\": true,\n \"embed-resources\": false,\n \"citeproc\": false,\n \"html-math-method\": \"plain\",\n \"wrap\": \"auto\",\n \"template\": null\n}"
  },
  {
    "path": "wasm/examples/markdown-to-rst/stdin",
    "content": "---\nauthor:\n- Albert Krewinkel\n- John MacFarlane\ndate: 'January 10, 2020'\ntitle: Pandoc Lua Filters\n---\n\n# Introduction\n\nPandoc has long supported filters, which allow the pandoc\nabstract syntax tree (AST) to be manipulated between the parsing\nand the writing phase. [Traditional pandoc\nfilters](https://pandoc.org/filters.html) accept a JSON\nrepresentation of the pandoc AST and produce an altered JSON\nrepresentation of the AST. They may be written in any\nprogramming language, and invoked from pandoc using the\n`--filter` option.\n\nAlthough traditional filters are very flexible, they have a\ncouple of disadvantages. First, there is some overhead in\nwriting JSON to stdout and reading it from stdin (twice, once on\neach side of the filter). Second, whether a filter will work\nwill depend on details of the user's environment. A filter may\nrequire an interpreter for a certain programming language to be\navailable, as well as a library for manipulating the pandoc AST\nin JSON form. One cannot simply provide a filter that can be\nused by anyone who has a certain version of the pandoc\nexecutable.\n\nStarting with version 2.0, pandoc makes it possible to write\nfilters in Lua without any external dependencies at all. A Lua\ninterpreter (version 5.3) and a Lua library for creating pandoc\nfilters is built into the pandoc executable. Pandoc data types\nare marshaled to Lua directly, avoiding the overhead of writing\nJSON to stdout and reading it from stdin.\n\nHere is an example of a Lua filter that converts strong emphasis\nto small caps:\n\n``` lua\nreturn {\n  {\n    Strong = function (elem)\n      return pandoc.SmallCaps(elem.c)\n    end,\n  }\n}\n```\n\nor equivalently,\n\n``` lua\nfunction Strong(elem)\n  return pandoc.SmallCaps(elem.c)\nend\n```\n\nThis says: walk the AST, and when you find a Strong element,\nreplace it with a SmallCaps element with the same content.\n\nTo run it, save it in a file, say `smallcaps.lua`, and invoke\npandoc with `--lua-filter=smallcaps.lua`.\n\nHere's a quick performance comparison, converting the pandoc\nmanual (MANUAL.txt) to HTML, with versions of the same JSON\nfilter written in compiled Haskell (`smallcaps`) and interpreted\nPython (`smallcaps.py`):\n\n  Command                                 Time\n  --------------------------------------- -------\n  `pandoc`                                1.01s\n  `pandoc --filter ./smallcaps`           1.36s\n  `pandoc --filter ./smallcaps.py`        1.40s\n  `pandoc --lua-filter ./smallcaps.lua`   1.03s\n\nAs you can see, the Lua filter avoids the substantial overhead\nassociated with marshaling to and from JSON over a pipe.\n\n# Lua filter structure\n\nLua filters are tables with element names as keys and values\nconsisting of functions acting on those elements.\n\nFilters are expected to be put into separate files and are\npassed via the `--lua-filter` command-line argument. For\nexample, if a filter is defined in a file `current-date.lua`,\nthen it would be applied like this:\n\n    pandoc --lua-filter=current-date.lua -f markdown MANUAL.txt\n\nThe `--lua-filter` option may be supplied multiple times. Pandoc\napplies all filters (including JSON filters specified via\n`--filter` and Lua filters specified via `--lua-filter`) in the\norder they appear on the command line.\n\nPandoc expects each Lua file to return a list of filters. The\nfilters in that list are called sequentially, each on the result\nof the previous filter. If there is no value returned by the\nfilter script, then pandoc will try to generate a single filter\nby collecting all top-level functions whose names correspond to\nthose of pandoc elements (e.g., `Str`, `Para`, `Meta`, or\n`Pandoc`). (That is why the two examples above are equivalent.)\n\nFor each filter, the document is traversed and each element\nsubjected to the filter. Elements for which the filter contains\nan entry (i.e. a function of the same name) are passed to Lua\nelement filtering function. In other words, filter entries will\nbe called for each corresponding element in the document,\ngetting the respective element as input.\n\nThe return value of a filter function must be one of the\nfollowing:\n\n-   nil: this means that the object should remain unchanged.\n-   a pandoc object: this must be of the same type as the input\n    and will replace the original object.\n-   a list of pandoc objects: these will replace the original\n    object; the list is merged with the neighbors of the\n    original objects (spliced into the list the original object\n    belongs to); returning an empty list deletes the object.\n\nThe function's output must result in an element of the same type\nas the input. This means a filter function acting on an inline\nelement must return either nil, an inline, or a list of inlines,\nand a function filtering a block element must return one of nil,\na block, or a list of block elements. Pandoc will throw an error\nif this condition is violated.\n\nIf there is no function matching the element's node type, then\nthe filtering system will look for a more general fallback\nfunction. Two fallback functions are supported, `Inline` and\n`Block`. Each matches elements of the respective type.\n\nElements without matching functions are left untouched.\n\nSee [module documentation](#module-pandoc) for a list of pandoc\nelements.\n\n## Filters on element sequences\n\nFor some filtering tasks, it is necessary to know the order\nin which elements occur in the document. It is not enough then to\ninspect a single element at a time.\n\nThere are two special function names, which can be used to define\nfilters on lists of blocks or lists of inlines.\n\n[`Inlines (inlines)`]{#inlines-filter}\n:   If present in a filter, this function will be called on all\n    lists of inline elements, like the content of a [Para]\n    (paragraph) block, or the description of an [Image]. The\n    `inlines` argument passed to the function will be a [List] of\n    [Inline] elements for each call.\n\n[`Blocks (blocks)`]{#blocks-filter}\n:   If present in a filter, this function will be called on all\n    lists of block elements, like the content of a [MetaBlocks]\n    meta element block, on each item of a list, and the main\n    content of the [Pandoc] document. The `blocks` argument\n    passed to the function will be a [List] of [Block] elements\n    for each call.\n\nThese filter functions are special in that the result must either\nbe nil, in which case the list is left unchanged, or must be a\nlist of the correct type, i.e., the same type as the input\nargument. Single elements are **not** allowed as return values,\nas a single element in this context usually hints at a bug.\n\nSee [\"Remove spaces before normal citations\"][Inlines filter\nexample] for an example.\n\nThis functionality has been added in pandoc 2.9.2.\n\n[Inlines filter example]: #remove-spaces-before-citations\n\n## Traversal order\n\nThe traversal order of filters can be selected by setting the key\n`traverse` to either `'topdown'` or `'typewise'`; the default is\n`'typewise'`.\n\nExample:\n\n``` lua\nlocal filter = {\n  traverse = 'topdown',\n  -- ... filter functions ...\n}\nreturn {filter}\n```\n\nSupport for this was added in pandoc 2.17; previous versions\nignore the `traverse` setting.\n\n### Typewise traversal\n\nElement filter functions within a filter set are called in a\nfixed order, skipping any which are not present:\n\n  1. functions for [*Inline* elements](#type-inline),\n  2. the [`Inlines`](#inlines-filter) filter function,\n  2. functions for [*Block* elements](#type-block) ,\n  2. the [`Blocks`](#inlines-filter) filter function,\n  3. the [`Meta`](#type-meta) filter function, and last\n  4. the [`Pandoc`](#type-pandoc) filter function.\n\nIt is still possible to force a different order by explicitly\nreturning multiple filter sets. For example, if the filter for\n*Meta* is to be run before that for *Str*, one can write\n\n``` lua\n-- ... filter definitions ...\n\nreturn {\n  { Meta = Meta },  -- (1)\n  { Str = Str }     -- (2)\n}\n```\n\nFilter sets are applied in the order in which they are returned.\nAll functions in set (1) are thus run before those in (2),\ncausing the filter function for *Meta* to be run before the\nfiltering of *Str* elements is started.\n\n### Topdown traversal\n\nIt is sometimes more natural to traverse the document tree\ndepth-first from the root towards the leaves, and all in a single\nrun.\n\nFor example, a block list `[Plain [Str \"a\"], Para [Str\n\"b\"]]`{.haskell} will try the following filter functions, in\norder: `Blocks`, `Plain`, `Inlines`, `Str`, `Para`, `Inlines`,\n`Str`.\n\nTopdown traversals can be cut short by returning `false` as a\nsecond value from the filter function. No child-element of\nthe returned element is processed in that case.\n\nFor example, to exclude the contents of a footnote from being\nprocessed, one might write\n\n``` lua\ntraverse = 'topdown'\nfunction Note (n)\n  return n, false\nend\n```\n\n"
  },
  {
    "path": "wasm/examples/mediawiki-to-docx-with-equations/options.json",
    "content": "{\n \"from\": \"mediawiki\",\n \"to\": \"docx\",\n \"output-file\": \"vectors.docx\",\n \"standalone\": true\n}\n"
  },
  {
    "path": "wasm/examples/mediawiki-to-docx-with-equations/stdin",
    "content": "Just as the components of a vector change when we change the [[basis (linear algebra)|basis]] of the vector space, the components of a tensor also change under such a transformation.  Each type of tensor comes equipped with a ''transformation law'' that details how the components of the tensor respond to a [[change of basis]].  The components of a vector can respond in two distinct ways to a [[change of basis]] (see [[covariance and contravariance of vectors]]), where the new [[basis vectors]] <math>\\mathbf{\\hat{e}}_i</math> are expressed in terms of the old basis vectors <math>\\mathbf{e}_j</math> as,\n:<math>\\mathbf{\\hat{e}}_i = \\sum_{j=1}^n \\mathbf{e}_j R^j_i = \\mathbf{e}_j R^j_i .</math>\n\nHere ''R''<sup>'' j''</sup><sub>''i''</sub> are the entries of the change of basis matrix, and in the rightmost expression the [[summation]] sign was suppressed: this is the [[Einstein summation convention]], which will be used throughout this article.<ref group=\"Note\">The Einstein summation convention, in brief, requires the sum to be taken over all values of the index whenever the same symbol appears as a subscript and superscript in the same term.  For example, under this convention <math>B_i C^i = B_1 C^1 + B_2 C^2 + \\cdots B_n C^n</math></ref>  The components ''v''<sup>''i''</sup> of a column vector '''v''' transform with the [[matrix inverse|inverse]] of the matrix ''R'',\n:<math>\\hat{v}^i = \\left(R^{-1}\\right)^i_j v^j,</math>\n\nwhere the hat denotes the components in the new basis.  This is called a ''contravariant'' transformation law, because the vector components transform by the ''inverse'' of the change of basis.  In contrast, the components, ''w''<sub>''i''</sub>, of a covector (or row vector), '''w''', transform with the matrix ''R'' itself,\n:<math>\\hat{w}_i = w_j R^j_i .</math>"
  },
  {
    "path": "wasm/examples/ris-to-formatted-markdown-bibliography/options.json",
    "content": "{\n \"to\": \"markdown_strict\",\n \"from\": \"ris\",\n \"standalone\": false,\n \"embed-resources\": false,\n \"citeproc\": true,\n \"html-math-method\": \"mathml\",\n \"wrap\": \"auto\"\n}\n"
  },
  {
    "path": "wasm/examples/ris-to-formatted-markdown-bibliography/stdin",
    "content": "TY  - JOUR\nT1  - On computable numbers, with an application to the Entscheidungsproblem\nA1  - Turing, Alan Mathison\nJO  - Proceedings of London Mathematical Society\nVL  - 47\nIS  - 1\nSP  - 230\nEP  - 265\nY1  - 1937\nER  -\nTY  - JOUR\nAU  - Shannon, Claude E.\nPY  - 1948\nDA  - July\nTI  - A Mathematical Theory of Communication\nT2  - Bell System Technical Journal\nSP  - 379\nEP  - 423\nVL  - 27\nER  - \n"
  },
  {
    "path": "wasm/examples/rst-table-from-yaml-data/custom.rst",
    "content": "+------------------+----------+-----------------------------------------------+\n| Species          | Calories | Location                                      |\n+==================+==========+===============================================+\n$for(fish)$\n${ it:species()/left 16 \"| \" \" | \"}${ it.calories/right 8 \"\" \" | \" }${ it.location/left 45 \"\" \" |\"}\n+------------------+----------+-----------------------------------------------+\n$endfor$"
  },
  {
    "path": "wasm/examples/rst-table-from-yaml-data/options.json",
    "content": "{\n \"to\": \"rst\",\n \"from\": \"markdown\",\n \"standalone\": true,\n \"citeproc\": false,\n \"html-math-method\": \"plain\",\n \"template\": \"custom.rst\"\n}\n"
  },
  {
    "path": "wasm/examples/rst-table-from-yaml-data/species.rst",
    "content": "${ it.species_name/uppercase }\n*${ it.scientific_name }*\n"
  },
  {
    "path": "wasm/examples/rst-table-from-yaml-data/stdin",
    "content": "---\n# Data from https://www.fishwatch.gov\nfish:\n- calories: 92\n  human_health:\n  texture: Firm and meaty.\n  environmental_considerations:\n  species_name: Shortfin Squid\n  diseases_in_salmon:\n  path: |\n    /profiles/shortfin-squid\n  habitat_impacts: |\n    Fishing gears used to harvest shortfin squid have minimal impacts on\n    habitat.\n  location: |\n    -   Shortfin squid inhabits the continental shelf and slope waters of\n        the Northwest Atlantic Ocean, from Newfoundland to the central east\n        coast of Florida.\n    -   In the northwest Atlantic Ocean, shortfin squid are most often\n        caught along the continental shelf break in depths between 150 to\n        275 meters.\n  color: |\n    Raw squid is ivory colored with orange speckling and a brown stripe that\n    runs down the mantle. Cooked squid is opaque white.\n  species_aliases: |\n    [Illex squid](/species-aliases/illex-squid), [Summer\n    squid](/species-aliases/summer-squid)\n  image_gallery:\n  harvest_type: Wild\n  selenium: 44.8 mcg\n  management:\n  scientific_name: Illex illecebrosus\n  production:\n  fat_total: 1.38 g\n  bycatch: |\n    Regulations are in place to minimize bycatch.\n  availability: |\n    Summer and fall.\n  research:\n  fishing_rate: |\n    At recommended level.\n  sugars_total: |\n    0 g\n  taste: |\n    Mild, and subtly sweet.\n\n     \n  health_benefits: |\n    Squid are an excellent source of selenium, riboflavin, and vitamin B12.\n  disease_treatment_and_prevention:\n  species_illustration_photo:\n    src: |\n      https://www.fishwatch.gov/sites/default/files/Squid\\_Illex\\_NB\\_W.png\n    title: |\n      Shortfin Squid\n    alt: |\n      shortfin squid\n  saturated_fatty_acids_total: |\n    0.358 g\n  quote: |\n    U.S. wild-caught shortfin squid is a smart seafood choice because it is\n    sustainably managed and responsibly harvested under U.S. regulations.\n  carbohydrate: |\n    3.08 g\n  serving_weight: |\n    100 g\n  ecosystem_services:\n  source: |\n    U.S. wild-caught from Maine to North Carolina.\n  noaa_fisheries_region: |\n    Greater Atlantic\n  animal_health:\n  population_status: |\n    -   According to the latest assessment, shortfin squid is not subject to\n        overfishing. There is currently not enough information to determine\n        the population size, so it is unknown.\n  population: |\n    The population level is unknown. The species has a lifespan of less than\n    one year.\n  protein: |\n    15.58 g\n  environmental_effects:\n    \n  cholesterol: |\n    233 mg\n  displayed_seafood_profile_illustration:\n  fiber_total_dietary: |\n    0 g\n  sodium: |\n    44 mg\n  feeds:\n  servings: |\n    1\n- calories: 90\n  human_health:\n  texture: The meat is firm and somewhat fibrous. The tail meat is firmer than the\n    meat from the claws.\n  environmental_considerations:\n  species_name: American Lobster\n  diseases_in_salmon:\n  path: |\n    /profiles/american-lobster\n  habitat_impacts: |\n    Fishing gears used to harvest American lobster have minimal impacts on\n    habitat.\n  location: |\n    -   American lobsters are found in the northwest Atlantic Ocean from\n        Labrador to Cape Hatteras. They’re most abundant in coastal waters\n        from Maine through New Jersey, and are also common offshore to\n        depths of 2,300 feet from Maine through North Carolina.\n  color: |\n    The meat is white with red tinges.\n  species_aliases: |\n    [Lobster](/species-aliases/lobster)\n  image_gallery:\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/1.JPG\n    title: |\n      American Lobster\n    alt: |\n      American Lobster\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/2\\_6.jpg\n    title: |\n      American Lobster\n    alt: |\n      American Lobster\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/3\\_5.jpg\n    title: |\n      American Lobster\n    alt: |\n      American Lobster\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/4\\_0.png\n    title: |\n      American Lobster\n    alt: |\n      American Lobster\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/5\\_3.jpg\n    title: |\n      American Lobster\n    alt: |\n      American Lobster\n  harvest_type: Wild\n  selenium: 41.4 mcg\n  management:\n  scientific_name: Homarus americanus\n  production:\n  fat_total: 0.9 g\n  bycatch: |\n    Regulations are in place to minimize bycatch.\n  availability: |\n    Year-round. In New England, where most lobsters are landed, the peak\n    harvest season extends from May to November.\n  research: |\n    -   State scientists, in cooperation with the lobster industry, are\n        conducting projects to assist with the effective management of the\n        lobster resource. Many states have established [ventless trap\n        survey](http://www.asmfc.org/fisheries-science/surveys)s to quantify\n        the abundance of juvenile lobsters. By removing escape vents from\n        the lobster traps and randomly placing those traps within certain\n        depth categories and geographic areas, researchers can assess the\n        abundance of juvenile lobsters and the potential for young lobsters\n        to reach a size or life stage that can be caught by the fishing gear\n        (recruitment) in the future. These surveys complement longstanding\n        fishery-independent bottom trawl surveys conducted by NOAA Fisheries\n        and the states. Because trawl gear cannot effectively sample rocky\n        or shallow coastal bottom types, the ventless trap surveys attempt\n        to fill this data gap by using fixed lobster gear without escape\n        vents.\n  fishing_rate: |\n    At recommended levels.\n  sugars_total: |\n    0 g\n  taste: |\n    Mild and sweet.\n  health_benefits: |\n    Lobster is low in saturated fat and is a very good source of protein and\n    selenium. The FDA\n    [advises](https://www.fda.gov/downloads/food/guidanceregulation/ucm252395.pdf)\n    consumers to not eat the tomalley, the light-green substance found in\n    the lobster.\n  disease_treatment_and_prevention:\n  species_illustration_photo:\n    src: |\n      https://www.fishwatch.gov/sites/default/files/Lobster\\_American\\_NB\\_Web.png\n    title: |\n      American Lobster\n    alt: |\n      American Lobster\n  saturated_fatty_acids_total: |\n    0.18 g\n  quote: |\n    U.S. wild-caught American lobster is a smart seafood choice because it\n    is sustainably managed and responsibly harvested under U.S. regulations.\n  carbohydrate: |\n    0.5 g\n  serving_weight: |\n    100 g (raw)\n  ecosystem_services:\n  source: |\n    U.S. wild-caught from Maine to North Carolina.\n  noaa_fisheries_region: |\n    Greater Atlantic\n  animal_health:\n  population_status: |\n    -   According to the [2015 stock\n        assessment](http://www.asmfc.org/uploads/file/55d61d73AmLobsterStockAssmt_PeerReviewReport_Aug2015_red2.pdf)\n        conducted by the [Atlantic States Marine Fisheries\n        Commission](http://www.asmfc.org/) (ASMFC), there is record high\n        stock abundance and recruitment in the Gulf of Maine and Georges\n        Bank, and record low abundance and recruitment failure in Southern\n        New England. The Gulf of Maine and Georges Bank stock is not\n        overfished. However, the ASMFC considers the Southern New England\n        stock severely depleted due to environmental factors and fishing\n        pressure. Neither stock is subject to overfishing.\n    -   Since 2012, [Young of Year\n        surveys](http://umaine.edu/wahlelab/american-lobster-settlement-index-alsi/american-lobster-settlement-index/)\n        in the Gulf of Maine and George’s Bank stock have shown consistent\n        declines, which could indicate future declines in recruitment and\n        landings.\n  population: |\n    Above target population levels in the Gulf of Maine and Georges Bank.\n    Significantly below target levels in Southern New England.\n  protein: |\n    18.80 g\n  environmental_effects:\n  cholesterol: |\n    95 mg\n  displayed_seafood_profile_illustration:\n  fiber_total_dietary: |\n    0 g\n  sodium: |\n    296 mg\n  feeds:\n  servings: |\n    1\n- calories: 90\n  human_health:\n  texture: Very lean with medium to firm texture and medium sized flakes.\n  environmental_considerations:\n  species_name: Yellowtail rockfish\n  diseases_in_salmon:\n  path: |\n    /profiles/yellowtail-rockfish\n  habitat_impacts: |\n    Most fishing gear used to harvest yellowtail rockfish rarely contacts\n    the ocean floor and has minimal impacts on habitat. Area closures and\n    gear restrictions protect sensitive rocky, cold-water coral and sponge\n    habitats from bottom trawl gear.\n  location: |\n    -   Yellowtail rockfish are found along the Pacific coast of North\n        America and range from Kodiak Island, Alaska to Baja California,\n        Mexico.\n  color: |\n    Meat is glistening bright white with a pinkish sheen.\n  species_aliases: |\n    [Yellowtail rockfish](/species-aliases/yellowtail-rockfish),\n    [Greenie](/species-aliases/greenie), [Yellow sea\n    perch](/species-aliases/yellow-sea-perch), [Rock\n    Cod](/species-aliases/rock-cod), [Pacific\n    Snapper](/species-aliases/pacific-snapper)\n  image_gallery:\n  harvest_type: Wild\n  selenium: 63 mcg\n  management:\n  scientific_name: Sebastes flavidus\n  production:\n  fat_total: 1.34 g\n  bycatch: |\n    Regulations are in place to minimize bycatch of overfished and protected\n    species.\n  availability: |\n    Year-round.\n  research: |\n    -   NOAA’s [Northwest](https://www.nwfsc.noaa.gov/) and [Alaska](Alaska)\n        Fisheries Science Centers survey the abundance of yellowtail\n        rockfish off the West Coast and Alaska.\n    -   Yellowtail rockfish is not typically assessed as part of a\n        single-species abundance survey. It is more commonly assessed along\n        with other groundfish.\n  fishing_rate: |\n    At recommended levels.\n  sugars_total: |\n    0\n  taste: |\n    Very mild, slightly sweet flavor.\n  health_benefits: |\n    Rockfish are high in selenium.\n  disease_treatment_and_prevention:\n  species_illustration_photo:\n    src: |\n      https://www.fishwatch.gov/sites/default/files/Rockfish\\_Yellowtail\\_NB\\_W.png\n    title: |\n      Yellowtail rockfish\n    alt: |\n      Yellowtail rockfish\n  saturated_fatty_acids_total: |\n    0.34 g\n  quote: |\n    U.S. wild-caught Yellowtail rockfish is a smart seafood choice because\n    it is sustainably managed and responsibly harvested under U.S.\n    regulations.\n  carbohydrate: |\n    0\n  serving_weight: |\n    100 g (raw)\n  ecosystem_services:\n  source: |\n    U.S. wild-caught from Kodiak Island Alaska to Baja California.\n  noaa_fisheries_region: |\n    West Coast, Alaska\n  animal_health:\n  population_status: |\n    -   According to the [2017 stock\n        assessment](https://www.pcouncil.org/wp-content/uploads/2018/01/YTRK_2017_Final.pdf),\n        the northern Pacific coast stock of yellowtail rockfish is not\n        overfished and not subject to overfishing.\n    -   The yellowtail rockfish stock on the West Coast is part of the\n        southern Pacific coast minor shelf rockfish complex. The overfished\n        status of this complex is unknown. The stock complex is not subject\n        to overfishing based on [2016 catch\n        data](https://www.nwfsc.noaa.gov/research/divisions/fram/observation/pdf/Groundfish_Mortality_2016.pdf).\n  population: |\n    The northern Pacific coast stock is above its target population level.\n    The southern Pacific coast stock is unknown.\n  protein: |\n    18.36 g\n  environmental_effects:\n  cholesterol: |\n    50 mg\n  displayed_seafood_profile_illustration:\n  fiber_total_dietary: |\n    0\n  sodium: |\n    74 mg\n  feeds:\n  servings: |\n    1\n- calories: 90\n  human_health:\n  texture: Lean and medium-firm, with a fine flake.\n  environmental_considerations:\n  species_name: Bocaccio\n  diseases_in_salmon:\n  path: |\n    /profiles/bocaccio\n  habitat_impacts: |\n    Area closures and gear restrictions protect sensitive rocky, cold-water\n    coral and sponge habitats from bottom trawl gear.\n  location: |\n    -   Bocaccio are found between Punta Blanca, Baja California, and the\n        Gulf of Alaska off Krozoff and Kodiak Islands. Within this range,\n        bocaccio is most common between Oregon and northern Baja California.\n    -   There are two partially isolated populations; one southern\n        population centered in California, and one northern population\n        centered in British Columbia. \n  color: |\n    Whole fish should have shiny and bright skin. The raw flesh is white,\n    but turns opaque white when cooked.\n  species_aliases: |\n    [Bocaccio](/species-aliases/bocaccio), [Rock\n    Salmon](/species-aliases/rock-salmon), [Salmon\n    Rockfish](/species-aliases/salmon-rockfish), [Pacific Red\n    Snapper](/species-aliases/pacific-red-snapper), [Pacific\n    Snapper](/species-aliases/pacific-snapper), [Oregon Red\n    Snapper](/species-aliases/oregon-red-snapper), [Oregon\n    Snapper](/species-aliases/oregon-snapper),\n    [Longjaw](/species-aliases/longjaw), [Merou](/species-aliases/merou),\n    [Jack](/species-aliases/jack), [Snapper](/species-aliases/snapper),\n    [Rock Cod](/species-aliases/rock-cod),\n    [Rockfish](/species-aliases/rockfish)\n  image_gallery:\n  harvest_type: Wild\n  selenium: 63 mcg\n  management:\n  scientific_name: Sebastes paucispinis\n  production:\n  fat_total: 1.34 g\n  bycatch: |\n    Regulations are in place to minimize bycatch.\n  availability: |\n    Year-round.\n  research: |\n    -   [New Fishing Opportunities Emerge from Resurgence of West Coast\n        Groundfish](https://www.fisheries.noaa.gov/feature-story/new-fishing-opportunities-emerge-resurgence-west-coast-groundfish)\n    -   [Rebuilding success continues for West Coast\n        groundfish](https://www.westcoast.fisheries.noaa.gov/stories/2017/19_06192017_.html)\n    -   [Threatened Yelloweye and Endangered Bocaccio in Puget Sound/Georgia\n        Basin](https://www.westcoast.fisheries.noaa.gov/protected_species/rockfish/rockfish_in_puget_sound.html)\n  fishing_rate: |\n    At recommended level.\n  sugars_total: |\n    0\n  taste: |\n    Delicate, nutty, sweet flavor.\n  health_benefits: |\n    Low in saturated fat and very high in selenium, phosphorus, and\n    potassium.\n  disease_treatment_and_prevention:\n  species_illustration_photo:\n    src: |\n      https://www.fishwatch.gov/sites/default/files/Bocaccio\\_NB\\_W.png\n    title: |\n      Bocaccio rockfish.\n    alt: |\n      Illustration of a Bocaccio rockfish.\n  saturated_fatty_acids_total: |\n    0.34 g\n  quote: |\n    U.S. wild-caught bocaccio is a smart seafood choice because it is\n    sustainably managed and responsibly harvested under U.S. regulations.\n  carbohydrate: |\n    0\n  serving_weight: |\n    100 g (raw)\n  ecosystem_services:\n  source: |\n    U.S. wild-caught from California to Alaska.\n  noaa_fisheries_region: |\n    West Coast, Alaska\n  animal_health:\n  population_status: |\n    -   According to the [2018 stock\n        assessment](https://www.pcouncil.org/wp-content/uploads/2018/02/FINAL_2017_Bocaccio_Update_Assessment_February_2_2018.pdf),\n        the bocaccio stock on the southern Pacific coast is not overfished,\n        and is not subject to overfishing. The stock rebuilt in 2017, faster\n        than estimated in the rebuilding plan, due in large part to several\n        strong year classes and an improved understanding of the\n        productivity of this stock.\n    -   Along the northern Pacific coast, bocaccio is part of the northern\n        Pacific coast minor shelf rockfish complex and the status of this\n        complex is unknown.\n    -   In the Gulf of Alaska, bocaccio is part of the other rockfish\n        complex.\n        -   According to the [2017 stock\n            assessment](https://www.afsc.noaa.gov/REFM/Docs/2017/GOAorock.pdf),\n            the status of this complex is unknown.\n  population: |\n    Above target population levels.\n  protein: |\n    18.36 g\n  environmental_effects:\n  cholesterol: |\n    50 mg\n  displayed_seafood_profile_illustration:\n  fiber_total_dietary: |\n    0\n  sodium: |\n    74 mg\n  feeds:\n  servings: |\n    1\n- calories: 110\n  human_health:\n  texture: A lean fish with fine-grained, dense meat. When cooked, the meat is firm\n    yet flaky and tender.\n  environmental_considerations:\n  species_name: Atlantic Halibut\n  diseases_in_salmon:\n  path: |\n    /profiles/atlantic-halibut\n  habitat_impacts: |\n    Trawl gear used to harvest Atlantic halibut have minimal or temporary\n    effects on habitat. Area closures and gear restrictions protect\n    sensitive habitats from bottom trawl gear. Hook and line gear has little\n    or no impact on habitat.\n  location: |\n    -   Atlantic halibut are found from Labrador and Greenland to Iceland,\n        and from the Barents Sea south to the Bay of Biscay and Virginia.\n    -   In U.S. waters, halibut is most common in the Gulf of Maine.\n  color: |\n    Uncooked, white and almost translucent. It should not look dull,\n    yellowish or dried out. When cooked, the meat is white.\n  species_aliases: |\n    [Atlantic halibut](/species-aliases/atlantic-halibut),\n    [Halibut](/species-aliases/halibut)\n  image_gallery:\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/1%20-%20atl\\_halibut\\_noa.jpg\n    title: |\n      Atlantic halibut face and mouth. Photo credit: NOAA.\n    alt: |\n      Picture of an Atlantic halibut face and mouth.\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/2%20-%20nefsc.jpg\n    title: |\n      Atlantic halibut. Photo credit: NOAA.\n    alt: |\n      Picture of Atlantic halibut.\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/3%20-%20halibut2\\_fullsize.jpg\n    title: |\n      Picture of Atlantic halibut. Photo credit: NOAA.\n    alt: |\n      Picture of Atlantic halibut.\n  harvest_type: Wild\n  selenium: 36.5 mcg\n  management:\n  scientific_name: Hippoglossus hippoglossus\n  production:\n  fat_total: 2.29 g\n  bycatch: |\n    Regulations are in place to minimize bycatch.\n  availability: |\n    Year-round.\n  research: |\n    -   Scientists at NOAA’s [Northeast Fisheries Science\n        Center](https://www.nefsc.noaa.gov/) conduct research bottom trawl\n        surveys throughout the Northeast continental shelf every year during\n        the fall and spring. These surveys collect data on the environment\n        as well as biological samples from fish caught during research\n        trawling. The data from these and other sources are used by\n        scientists in stock assessments to estimate population size and\n        fishing pressure.\n  fishing_rate: |\n    At recommended levels.\n  sugars_total: |\n    0\n  taste: |\n    Halibut has a very mild, sweet taste.\n  health_benefits: |\n    Halibut is low in saturated fat and sodium, and is a very good source of\n    protein, niacin, phosphorus, and selenium.\n  disease_treatment_and_prevention:\n  species_illustration_photo:\n    src: |\n      https://www.fishwatch.gov/sites/default/files/atlantic-halibut-illustration.png\n    title: |\n      Illustration of Atlantic Halibut.\n    alt: |\n      Illustration of Atlantic Halibut.\n  saturated_fatty_acids_total: |\n    0.325 g\n  quote: |\n    Although populations are well below target levels, U.S. wild-caught\n    Atlantic halibut is still a smart seafood choice because it is\n    sustainably managed under a rebuilding plan that allows limited harvest\n    by U.S. fishermen.\n  carbohydrate: |\n    0\n  serving_weight: |\n    100 g (raw)\n  ecosystem_services:\n  source: |\n    Wild-caught from Maine to Connecticut.\n  noaa_fisheries_region: |\n    Greater Atlantic\n  animal_health:\n  population_status: |\n    -   The Atlantic halibut stock is at a very low level. Fishing is still\n        allowed, but at reduced levels.\n    -   According to the [2012 stock\n        assessment](https://www.nefsc.noaa.gov/publications/crd/crd1206/),\n        the Atlantic halibut stock is overfished, but is not subject to\n        overfishing. The estimated biomass is only 3 percent of its target\n        level. It will remain in a rebuilding plan for the foreseeable\n        future.\n  population: |\n    Significantly below target population levels.\n  protein: |\n    20.81 g\n  environmental_effects:\n  cholesterol: |\n    32 mg\n  displayed_seafood_profile_illustration:\n  fiber_total_dietary: |\n    0\n  sodium: |\n    54 mg\n  feeds:\n  servings: |\n    1\n- calories: 90\n  human_health:\n  texture: Firm, coarse flake.\n  environmental_considerations:\n  species_name: Shortspine Thornyhead\n  diseases_in_salmon:\n  path: |\n    /profiles/shortspine-thornyhead\n  habitat_impacts: |\n    The trawl, longline, and pot gear used to harvest shortspine thornyhead\n    have minimal or temporary effects on habitat. Area closures and gear\n    restrictions protect sensitive rocky, cold-water coral, and sponge\n    habitats from bottom trawl gear.\n  location: |\n    -   Shortspine thornyhead are found from the Bering Sea to Baja\n        California, Mexico.\n  color: |\n    White.\n  species_aliases: |\n    [Thornyhead](/species-aliases/thornyhead), [Idiot\n    fish](/species-aliases/idiot-fish), [Idiot\n    cod](/species-aliases/idiot-cod), [Rockfish](/species-aliases/rockfish)\n  image_gallery:\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/1%20photo-west-coast-region-photo-gallery.jpg\n    title: |\n      Close-up photo of a shortspine thornyhead. (Photo credit: NOAA)\n    alt: |\n      Close-up photo of a shortspine thornyhead. (Photo credit: NOAA)\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/2%20basket%20of%20shortspine%20thornyhead.jpg\n    title: |\n      Basket of shortspine thornyhead. (Photo credit: NOAA)\n    alt: |\n      Basket of shortspine thornyhead. (Photo credit: NOAA)\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/3%20graphic%20with%20morphology%20ID\\_large.jpg\n    title: |\n      Shortspine thornyhead graphic identifying several physical\n      characteristics, including head spines, pelvic and anal fins. (Photo\n      credit: NOAA)\n    alt: |\n      Shortspine thornyhead graphic identifying several physical\n      characteristics, including head spines, pelvic and anal fins. (Photo\n      credit: NOAA)\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/4%20Head-on%20view%20of%20shortspine%20thornyhead.jpg\n    title: |\n      Head-on view of shortspine thornyhead. (Photo credit: NOAA)\n    alt: |\n      Head-on view of shortspine thornyhead. (Photo credit: NOAA)\n  - src: |\n      https://www.fishwatch.gov/sites/default/files/5%20shortspine%20thornyhead%20amongst%20its%20habitat.jpg\n    title: |\n      Shortspine thornyhead rockfish snuggled amongst a sea star, smaller\n      brittle stars, and sea cucumbers with white tentacles on a mixed rocky\n      and mud-covered habitat. (Photo credit: NOAA/OER)\n    alt: |\n      Shortspine thornyhead rockfish snuggled amongst a sea star, smaller\n      brittle stars, and sea cucumbers with white tentacles on a mixed rocky\n      and mud-covered habitat. (Photo credit: NOAA/OER)\n  harvest_type: Wild\n  selenium: 63 mcg\n  management:\n  scientific_name: Sebastolobus alascanus\n  production:\n  fat_total: 1.34 g\n  bycatch: |\n    Regulations are in place to minimize bycatch of overfished and protected\n    species.\n  availability: |\n    Year-round.\n  research: |\n    [Tagging study of shortspine thornyhead in\n    Alaska](http://agris.fao.org/agris-search/search.do?recordID=US201700202112)\n    confirms that the management range is appropriate.\n  fishing_rate: |\n    At recommended levels.\n  sugars_total: |\n    0\n  taste: |\n    Sweet and mild.\n  health_benefits: |\n    Rockfish are high in selenium.\n  disease_treatment_and_prevention:\n  species_illustration_photo:\n    src: |\n      https://www.fishwatch.gov/sites/default/files/shortspine-thornyhead-illustration.png\n    title: |\n      Illustration of shortspine thornyhead.\n    alt: |\n      Illustration of shortspine thornyhead.\n  saturated_fatty_acids_total: |\n    0.34 g\n  quote: |\n    U.S. wild-caught shortspine thornyhead is a smart seafood choice because\n    it is sustainably managed and responsibly harvested under U.S.\n    regulations.\n  carbohydrate: |\n    0\n  serving_weight: |\n    100 g (raw)\n  ecosystem_services:\n  source: |\n    U.S. wild-caught from the Bering Sea to Baja California, Mexico.\n  noaa_fisheries_region: |\n    West Coast\n  animal_health:\n  population_status: |\n    -   According to the [2013 stock\n        assessment](https://www.pcouncil.org/wp-content/uploads/Shortspine_2013_Assessment.pdf),\n        shortspine thornyhead on the Pacific Coast are not overfished and\n        are not subject to overfishing based on the [2016 catch\n        data](https://www.nwfsc.noaa.gov/research/divisions/fram/observation/pdf/Groundfish_Mortality_2016.pdf).\n    -   In the Gulf of Alaska, shortspine thornyhead are part of the\n        thornyhead rockfish complex, which also contains longspine and\n        broadfin thornyhead.\n        -   According to the [2018 stock\n            assessment](https://www.fisheries.noaa.gov/resource/data/2018-assessment-thornyhead-stock-complex-gulf-alaska),\n            the status of this complex is unknown.\n        -   According to the 2017 catch data, the complex was not subject to\n            overfishing, and the fishery’s total allowable catch has not\n            been attained since 1995.\n    -   In the Bering Sea and Aleutian Islands, shortspine thornyhead are\n        part of the other rockfish complex.\n        -   According to the [2018 stock\n            assessment](https://www.fisheries.noaa.gov/resource/data/2018-assessment-other-rockfish-stock-complex-bering-sea-and-aleutian-islands),\n            the status of this complex is unknown.\n        -   According to the 2017 catch data, the complex was not subject to\n            overfishing.\n  population: |\n    Above target population levels on the Pacific Coast.\n  protein: |\n    18.36 g\n  environmental_effects:\n  cholesterol: |\n    50 mg\n  displayed_seafood_profile_illustration:\n  fiber_total_dietary: |\n    0\n  sodium: |\n    74 mg\n  feeds:\n  servings: |\n    1\n...\n"
  },
  {
    "path": "wasm/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>pandoc for the people</title>\n  <script src=\"https://unpkg.com/petite-vue\" defer></script>\n  <script type=\"module\">\n    import { zipSync, unzipSync, strToU8, strFromU8 } from 'https://esm.sh/fflate@0.8.2';\n    window.fflate = { zipSync, unzipSync, strToU8, strFromU8 };\n  </script>\n  <style>\n    :root {\n      --primary: #2563eb;\n      --primary-hover: #1d4ed8;\n      --success: #16a34a;\n      --warning: #d97706;\n      --danger: #dc2626;\n      --gray-50: #f9fafb;\n      --gray-100: #f3f4f6;\n      --gray-200: #e5e7eb;\n      --gray-300: #d1d5db;\n      --gray-400: #9ca3af;\n      --gray-500: #6b7280;\n      --gray-600: #4b5563;\n      --gray-700: #374151;\n      --gray-800: #1f2937;\n      --gray-900: #111827;\n      --radius: 8px;\n      --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);\n      --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);\n    }\n\n    * { box-sizing: border-box; }\n\n    body {\n      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n      background: var(--gray-100);\n      color: var(--gray-800);\n      margin: 0;\n      padding: 0;\n      line-height: 1.5;\n    }\n\n    footer {\n      margin: 6pt;\n      font-size: 0.8rem;\n      text-align: center;\n    }\n    .header {\n      background: var(--gray-900);\n      color: white;\n      padding: 0.5rem 1.5rem;\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n    }\n\n    .header h1 { margin: 0; font-size: 1.1rem; font-weight: 600; }\n    .header .tagline { color: var(--gray-400); font-size: 0.8rem; }\n    .header .help-link { color: var(--gray-400); font-size: 0.85rem; text-decoration: none; }\n    .header .help-link:hover { color: white; }\n\n    .container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }\n\n    .card {\n      background: white;\n      border-radius: var(--radius);\n      box-shadow: var(--shadow);\n      margin-bottom: 1rem;\n      overflow: hidden;\n    }\n\n    .card-header {\n      background: var(--gray-50);\n      border-bottom: 1px solid var(--gray-200);\n      padding: 1rem 1.5rem;\n      font-weight: 600;\n      font-size: 1rem;\n      display: flex;\n      align-items: center;\n      gap: 0.5rem;\n    }\n\n    .card-body { padding: 1rem; }\n    .card-body.compact { padding: 0.75rem; }\n\n    .include-fieldset {\n      border: 1px solid var(--gray-300);\n      border-radius: 4px;\n      padding: 1rem;\n      margin: 0;\n    }\n    .include-fieldset legend { padding: 0 0.5rem; font-weight: 500; }\n    .include-fieldset-content { display: flex; flex-wrap: wrap; gap: 2rem; }\n\n    .drop-zone {\n      border: 2px dashed var(--gray-300);\n      border-radius: var(--radius);\n      padding: 1rem;\n      text-align: center;\n      cursor: pointer;\n      transition: all 0.2s;\n      background: var(--gray-50);\n      height: 120px;\n      display: flex;\n      flex-direction: column;\n      justify-content: center;\n    }\n\n    .drop-zone:hover, .drop-zone.drag-over {\n      border-color: var(--primary);\n      background: #eff6ff;\n    }\n\n    .drop-zone-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.5; }\n    .drop-zone-text { color: var(--gray-600); margin-bottom: 0.25rem; font-size: 0.9rem; }\n    .drop-zone-hint { color: var(--gray-400); font-size: 0.8rem; }\n\n    .file-list { margin-top: 1rem; }\n\n    .file-item {\n      display: flex;\n      align-items: center;\n      gap: 0.75rem;\n      padding: 0.75rem 1rem;\n      background: var(--gray-50);\n      border-radius: var(--radius);\n      margin-bottom: 0.5rem;\n      cursor: grab;\n      user-select: none;\n    }\n\n    .file-item:active { cursor: grabbing; }\n    .file-item.dragging { opacity: 0.5; }\n    .file-item.drag-over { border-top: 2px solid var(--primary); margin-top: -2px; }\n    .file-item .file-icon { font-size: 1.25rem; }\n    .file-item .file-name { flex: 1; font-size: 0.9rem; word-break: break-all; }\n    .file-item a.file-name { color: var(--primary); text-decoration: none; cursor: pointer; }\n    .file-item a.file-name:hover { text-decoration: underline; }\n    .resource-item a { color: var(--primary); text-decoration: none; cursor: pointer; }\n    .resource-item a:hover { text-decoration: underline; }\n    .file-item .file-size { color: var(--gray-500); font-size: 0.8rem; }\n\n    .file-item .file-remove {\n      color: var(--gray-400);\n      cursor: pointer;\n      padding: 0.25rem;\n      border-radius: 4px;\n      transition: all 0.2s;\n    }\n\n    .file-item .file-remove:hover { color: var(--danger); background: #fef2f2; }\n\n    .auxiliary-section { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--gray-200); }\n    .auxiliary-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }\n    .auxiliary-label { font-size: 0.8rem; color: var(--gray-600); }\n\n    .upload-btn-small {\n      padding: 0.35rem 0.75rem;\n      font-size: 0.8rem;\n      background: var(--gray-100);\n      border: 1px solid var(--gray-300);\n      border-radius: var(--radius);\n      cursor: pointer;\n      transition: all 0.2s;\n    }\n\n    .upload-btn-small:hover { background: var(--gray-200); }\n\n    .file-list-small .file-item { padding: 0.5rem 0.75rem; }\n    .file-list-small .file-item .file-icon { font-size: 1rem; }\n    .file-list-small .file-item .file-name { font-size: 0.85rem; }\n\n    .input-mode-toggle {\n      display: inline-flex;\n      background: var(--gray-100);\n      border-radius: var(--radius);\n      padding: 3px;\n    }\n\n    .input-mode-btn {\n      padding: 0.35rem 0.75rem;\n      border: none;\n      background: transparent;\n      border-radius: calc(var(--radius) - 2px);\n      cursor: pointer;\n      font-size: 0.85rem;\n      transition: all 0.2s;\n      color: var(--gray-600);\n    }\n\n    .input-mode-btn:hover:not(.active) { color: var(--gray-800); }\n\n    .input-mode-btn.active {\n      background: white;\n      color: var(--gray-900);\n      box-shadow: 0 1px 3px rgba(0,0,0,0.1);\n    }\n\n    .text-input-area textarea {\n      width: 100%;\n      height: 120px;\n      padding: 1rem;\n      border: 1px solid var(--gray-300);\n      border-radius: var(--radius);\n      font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n      font-size: 0.9rem;\n      resize: vertical;\n    }\n\n    .input-header {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      gap: 1rem;\n      margin-bottom: 0.75rem;\n      flex-wrap: wrap;\n    }\n\n    .input-controls { display: flex; align-items: center; gap: 0.75rem; }\n\n    .format-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }\n    .format-bar .form-group { flex-direction: row; align-items: center; gap: 0.5rem; }\n    .format-bar .form-group label { white-space: nowrap; }\n    .format-bar .form-group select { padding: 0.5rem 0.75rem; font-size: 0.85rem; width: 11.5em; }\n    .format-bar .form-group input[type=\"text\"] { padding: 0.5rem 0.75rem; font-size: 0.85rem; width: 140px; }\n\n    .examples-toggle { margin-bottom: 0.5rem; }\n    .examples-toggle a { font-size: 0.85rem; color: var(--gray-600); text-decoration: none; }\n    .examples-toggle a:hover { color: var(--primary); }\n    .examples-bar { display: flex; align-items: center; gap: 0.5rem; }\n    .examples-bar label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }\n    .examples-bar select { padding: 0.25rem 0.5rem; font-size: 0.8rem; border: 1px solid var(--gray-300); border-radius: 4px; background: white; }\n\n    .extensions-row { display: flex; gap: 2rem; flex-wrap: wrap; }\n    .extensions-group { flex: 1; min-width: 200px; }\n    .extensions-group-header {\n      font-size: 0.75rem;\n      font-weight: 600;\n      color: var(--gray-500);\n      margin-bottom: 0.35rem;\n      text-transform: uppercase;\n      letter-spacing: 0.03em;\n    }\n\n    .extensions-list {\n      columns: 3;\n      column-gap: 1rem;\n      max-height: 200px;\n      overflow-y: auto;\n    }\n\n    .extension-item {\n      display: flex;\n      align-items: center;\n      gap: 0.2rem;\n      font-size: 0.8rem;\n      break-inside: avoid;\n    }\n\n    .extension-item input[type=\"checkbox\"] { width: 0.85rem; height: 0.85rem; }\n    .extension-item label { cursor: pointer; color: var(--gray-600); }\n    .extension-item.default-on label { font-weight: 500; }\n    .extension-item.toggled label { color: var(--primary); }\n\n    .custom-metadata { margin-top: 0.5rem; }\n\n    .custom-meta-row {\n      display: flex;\n      gap: 0.5rem;\n      align-items: center;\n      margin-bottom: 0.5rem;\n    }\n\n    .custom-meta-row input[type=\"text\"] {\n      padding: 0.5rem 0.75rem;\n      border: 1px solid var(--gray-300);\n      border-radius: var(--radius);\n      font-size: 0.9rem;\n    }\n\n    .custom-meta-row input[name=\"key\"] { width: 180px; }\n    .custom-meta-row input[name=\"value\"] { flex: 1; }\n\n    .custom-meta-row .remove-meta {\n      padding: 0.25rem 0.5rem;\n      background: none;\n      border: none;\n      color: var(--gray-400);\n      cursor: pointer;\n      font-size: 1rem;\n    }\n\n    .custom-meta-row .remove-meta:hover { color: var(--danger); }\n\n    .add-metadata-btn {\n      margin-top: 0.5rem;\n      padding: 0.35rem 0.75rem;\n      font-size: 0.8rem;\n      background: var(--gray-100);\n      border: 1px solid var(--gray-300);\n      border-radius: var(--radius);\n      cursor: pointer;\n      color: var(--gray-600);\n    }\n\n    .add-metadata-btn:hover { background: var(--gray-200); }\n\n    .variables-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }\n    .variables-section > label {\n      display: block;\n      font-size: 0.9rem;\n      font-weight: 500;\n      color: var(--gray-700);\n      margin-bottom: 0.5rem;\n    }\n\n    .form-group { display: flex; flex-direction: column; gap: 0.5rem; }\n    .form-group label { font-weight: 500; font-size: 0.9rem; color: var(--gray-700); }\n\n    .form-group select, .form-group input[type=\"text\"] {\n      padding: 0.75rem 1rem;\n      border: 1px solid var(--gray-300);\n      border-radius: var(--radius);\n      font-size: 0.95rem;\n      background: white;\n      transition: border-color 0.2s;\n    }\n\n    .form-group select:focus, .form-group input[type=\"text\"]:focus {\n      outline: none;\n      border-color: var(--primary);\n      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n    }\n\n    .form-group .hint { font-size: 0.8rem; color: var(--gray-500); }\n\n    .options-tabs {\n      display: flex;\n      flex-wrap: wrap;\n      gap: 0.25rem;\n      border-bottom: 1px solid var(--gray-200);\n      margin-bottom: 0.75rem;\n    }\n\n    .options-tab {\n      padding: 0.4rem 0.6rem;\n      font-size: 0.85rem;\n      background: none;\n      border: none;\n      border-bottom: 2px solid transparent;\n      cursor: pointer;\n      color: var(--gray-600);\n      transition: all 0.2s;\n      white-space: nowrap;\n    }\n\n    .options-tab:hover { color: var(--gray-800); background: var(--gray-50); }\n    .options-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }\n\n    .options-grid {\n      display: grid;\n      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n      gap: 1rem;\n    }\n\n    #panel-format .options-grid {\n      grid-template-columns: repeat(auto-fill, minmax(165px, max-content));\n      justify-content: start;\n      gap: 0.75rem 1.5rem;\n    }\n\n    #panel-format .form-group select { width: auto; min-width: 6em; }\n\n    .checkbox-group { display: flex; align-items: center; gap: 0.5rem; }\n    .checkbox-group input[type=\"checkbox\"] { width: 1.1rem; height: 1.1rem; cursor: pointer; }\n    .checkbox-group label { font-size: 0.9rem; cursor: pointer; }\n\n    .resource-upload { margin-top: 1rem; }\n\n    .resource-item {\n      display: flex;\n      align-items: center;\n      gap: 0.75rem;\n      padding: 0.5rem;\n      background: var(--gray-50);\n      border-radius: var(--radius);\n      margin-bottom: 0.5rem;\n      font-size: 0.85rem;\n    }\n\n    .upload-btn {\n      display: inline-flex;\n      align-items: center;\n      gap: 0.5rem;\n      padding: 0.5rem 1rem;\n      background: var(--gray-100);\n      border: 1px solid var(--gray-300);\n      border-radius: var(--radius);\n      cursor: pointer;\n      font-size: 0.85rem;\n      transition: all 0.2s;\n    }\n\n    .upload-btn:hover { background: var(--gray-200); }\n\n    .convert-btn {\n      padding: 0.4rem 1rem;\n      font-size: 0.85rem;\n      font-weight: 600;\n      background: var(--primary);\n      color: white;\n      border: none;\n      border-radius: var(--radius);\n      cursor: pointer;\n      transition: all 0.2s;\n    }\n\n    .convert-btn:hover:not(:disabled) { background: var(--primary-hover); }\n    .convert-btn:disabled { background: var(--gray-400); cursor: not-allowed; }\n\n    .output-preview {\n      background: var(--gray-900);\n      color: #e5e7eb;\n      padding: 1rem;\n      border-radius: var(--radius);\n      font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n      font-size: 0.85rem;\n      max-height: 400px;\n      overflow: auto;\n      white-space: pre-wrap;\n      word-wrap: break-word;\n    }\n\n    .output-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }\n    .verbosity-control { flex-direction: row; margin-left: auto; }\n    .verbosity-control label { font-size: 0.85rem; margin-right: 0.5rem; }\n    .verbosity-control select { padding: 0.5rem; font-size: 0.85rem; }\n\n    .download-btn {\n      display: inline-flex;\n      align-items: center;\n      gap: 0.5rem;\n      padding: 0.75rem 1.5rem;\n      background: var(--success);\n      color: white;\n      border: none;\n      border-radius: var(--radius);\n      cursor: pointer;\n      font-size: 0.95rem;\n      transition: all 0.2s;\n    }\n\n    .download-btn:hover { background: #15803d; }\n\n    .copy-btn {\n      padding: 0.75rem 1.5rem;\n      background: var(--gray-600);\n      color: white;\n      border: none;\n      border-radius: var(--radius);\n      cursor: pointer;\n      font-size: 0.95rem;\n      transition: all 0.2s;\n    }\n\n    .copy-btn:hover { background: var(--gray-700); }\n\n    .messages { margin-top: 1rem; }\n\n    .message {\n      padding: 0.75rem 1rem;\n      border-radius: var(--radius);\n      margin-bottom: 0.5rem;\n      font-size: 0.9rem;\n    }\n\n    .message.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }\n    .message.warning { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }\n    .message.info { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }\n\n    .loading { text-align: center; padding: 2rem; }\n\n    .spinner {\n      width: 40px;\n      height: 40px;\n      border: 4px solid var(--gray-200);\n      border-top-color: var(--primary);\n      border-radius: 50%;\n      animation: spin 1s linear infinite;\n      margin: 0 auto 1rem;\n    }\n\n    button { line-height: 1.1; }\n\n    @keyframes spin { to { transform: rotate(360deg); } }\n\n    .loading-overlay {\n      position: fixed;\n      top: 0; left: 0; right: 0; bottom: 0;\n      background: rgba(255, 255, 255, 0.5);\n      backdrop-filter: blur(4px);\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      z-index: 1000;\n    }\n\n    .loading-box {\n      background: white;\n      padding: 2rem 3rem;\n      border-radius: var(--radius);\n      box-shadow: var(--shadow-lg);\n      text-align: center;\n    }\n\n    .loading-box p { margin: 0; color: var(--gray-600); font-size: 0.95rem; }\n\n    @media (max-width: 640px) {\n      .container { padding: 0.75rem; }\n      .input-header { flex-direction: column; align-items: stretch; }\n      .input-controls { justify-content: space-between; }\n      .format-bar { flex-direction: column; align-items: stretch; }\n      .format-bar .form-group { flex-direction: column; align-items: stretch; }\n      .format-bar .form-group input[type=\"text\"] { width: 100%; }\n      .options-grid { grid-template-columns: 1fr; }\n    }\n\n    .hidden { display: none !important; }\n  </style>\n</head>\n<body>\n  <div class=\"header\">\n    <h1>pandoc for the people</h1>\n    <span class=\"tagline\">Convert documents without leaving the browser</span>\n    <a href=\"https://pandoc.org/MANUAL.html\" class=\"help-link\" target=\"_blank\">Help</a>\n  </div>\n\n  <div id=\"app\" v-scope=\"pandocApp()\" @vue:mounted=\"init()\">\n    <div class=\"container\" @input=\"hasChanges = true\" @change=\"hasChanges = true\">\n      <!-- Input Section -->\n      <div class=\"examples-toggle\">\n        <a href=\"#\" @click.prevent=\"showExamplesBar = !showExamplesBar\">\n          {{ showExamplesBar ? '&#9660;' : '&#9654;' }} Examples\n        </a>\n      </div>\n      <div class=\"card\" v-show=\"showExamplesBar\">\n        <div class=\"card-body\">\n            <div class=\"examples-bar\">\n              <label for=\"examples-select\">Load:</label>\n              <select id=\"examples-select\" v-model=\"selectedExample\" @change=\"loadExample\">\n                <option value=\"\">Select example...</option>\n                <option value=\"examples/bibtex-to-csljson.zip\">BibTeX to CSL JSON</option>\n                <option value=\"examples/csv-table-to-org.zip\">CSV table to Org</option>\n                <option value=\"examples/custom-template.zip\">Custom template</option>\n                <option value=\"examples/docx-with-equations-to-latex.zip\">DOCX with equations to LaTeX</option>\n                <option value=\"examples/hello-world.zip\">Hello world</option>\n                <option value=\"examples/lua-filters.zip\">Lua filters</option>\n                <option value=\"examples/highlighted-code-to-html.zip\">Highlighted code to HTML</option>\n                <option value=\"examples/ipynb-to-rtf.zip\">Jupyter notebook to RTF</option>\n                <option value=\"examples/latex-to-docbook-with-mathml.zip\">LaTeX to DocBook with MathML</option>\n                <option value=\"examples/latex-with-macros-to-restructured-text.zip\">LaTeX with macros to RST</option>\n                <option value=\"examples/man-page-to-context.zip\">Man page to ConTeXt</option>\n                <option value=\"examples/markdown-citations-to-plain-with-csl-style.zip\">Markdown citations to plain</option>\n                <option value=\"examples/markdown-to-docbook-with-citations.zip\">Markdown to DocBook with citations</option>\n                <option value=\"examples/markdown-to-revealjs-slides.zip\">Markdown to reveal.js slides</option>\n                <option value=\"examples/markdown-to-rst.zip\">Markdown to RST</option>\n                <option value=\"examples/mediawiki-to-docx-with-equations.zip\">MediaWiki to DOCX with equations</option>\n                <option value=\"examples/ris-to-formatted-markdown-bibliography.zip\">RIS to Markdown bibliography</option>\n                <option value=\"examples/rst-table-from-yaml-data.zip\">RST table from YAML data</option>\n              </select>\n              <button class=\"upload-btn-small\" @click=\"downloadAsExample\">Download as example</button>\n              <button class=\"upload-btn-small\" @click.stop=\"$refs.exampleInput.click()\">Upload example</button>\n              <input type=\"file\" ref=\"exampleInput\" class=\"hidden\" accept=\".zip\" @change.stop=\"uploadExample($event)\" />\n            </div>\n        </div>\n      </div>\n      <div class=\"card\">\n        <div class=\"card-body\">\n          <div class=\"input-header\">\n            <div class=\"input-controls\">\n              <div class=\"input-mode-toggle\">\n                <button class=\"input-mode-btn\" :class=\"{ active: inputMode === 'file' }\" @click=\"inputMode = 'file'; hasChanges = true\">Upload Files</button>\n                <button class=\"input-mode-btn\" :class=\"{ active: inputMode === 'text' }\" @click=\"inputMode = 'text'; hasChanges = true\">Paste Text</button>\n              </div>\n              <button class=\"convert-btn\" :disabled=\"!canConvert\" @click=\"convert\">Convert</button>\n            </div>\n            <div class=\"format-bar\">\n              <div class=\"form-group\">\n                <label for=\"input-format\">From:</label>\n                <select id=\"input-format\" v-model=\"inputFormat\" @change=\"onInputFormatChange\" :disabled=\"!formatsLoaded\">\n                  <option value=\"auto\">{{ formatsLoaded ? 'Auto-detect' : 'Loading formats...' }}</option>\n                  <option v-for=\"fmt in inputFormats\" :key=\"fmt\" :value=\"fmt\">{{ getFormatLabel(fmt, 'input') }}</option>\n                </select>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"output-format\">To:</label>\n                <select id=\"output-format\" v-model=\"outputFormat\" @change=\"onOutputFormatChange\" :disabled=\"!formatsLoaded\">\n                  <option value=\"auto\">{{ formatsLoaded ? 'Auto-detect' : 'Loading formats...' }}</option>\n                  <option v-for=\"fmt in outputFormats\" :key=\"fmt\" :value=\"fmt\">{{ getFormatLabel(fmt, 'output') }}</option>\n                </select>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"output-filename\">Output:</label>\n                <input type=\"text\" id=\"output-filename\" v-model=\"outputFilename\" :placeholder=\"outputFilenamePlaceholder\" />\n              </div>\n            </div>\n          </div>\n\n          <!-- File input area -->\n          <div v-show=\"inputMode === 'file'\">\n            <div class=\"drop-zone\" @click=\"$refs.fileInput.click()\" @dragover.prevent=\"dragOver = true\" @dragleave=\"dragOver = false\" @drop.prevent=\"handleDrop($event)\" :class=\"{ 'drag-over': dragOver }\">\n              <div class=\"drop-zone-icon\">&#128196;</div>\n              <div class=\"drop-zone-text\">Drop files here or click to browse</div>\n              <div class=\"drop-zone-hint\">Supports: .md, .docx, .html, .tex, .rst, .epub, .odt, and more</div>\n            </div>\n            <input type=\"file\" ref=\"fileInput\" class=\"hidden\" multiple @change=\"handleFileInput($event)\" />\n            <div class=\"file-list\" v-if=\"fileOrder.length > 0\">\n              <div class=\"file-item\" v-for=\"(name, idx) in fileOrder\" :key=\"name\" v-show=\"files[name]\" draggable=\"true\" @dragstart=\"onFileDragStart(idx, $event)\" @dragover.prevent=\"onFileDragOver(idx)\" @dragleave=\"fileDragOverIdx = -1\" @drop.prevent=\"onFileDrop(idx)\" @dragend=\"fileDraggingIdx = -1\" :class=\"{ dragging: fileDraggingIdx === idx, 'drag-over': fileDragOverIdx === idx && fileDraggingIdx !== idx }\">\n                <span class=\"file-icon\">&#128196;</span>\n                <a class=\"file-name\" href=\"#\" @click.prevent.stop=\"downloadFile(files[name], name)\">{{ name }}</a>\n                <span class=\"file-size\">{{ formatFileSize(files[name].size) }}</span>\n                <span class=\"file-remove\" @click.stop=\"removeFile(name)\">&#10005;</span>\n              </div>\n            </div>\n          </div>\n\n          <!-- Text input area -->\n          <div class=\"text-input-area\" v-show=\"inputMode === 'text'\">\n            <textarea v-model=\"textInput\" placeholder=\"Paste or type your content here...\"></textarea>\n          </div>\n\n          <!-- Auxiliary files -->\n          <div class=\"auxiliary-section\">\n            <div class=\"auxiliary-header\">\n              <span class=\"auxiliary-label\">Additional files (images, includes, etc.)</span>\n              <button class=\"upload-btn-small\" @click=\"$refs.auxFileInput.click()\">+ Add Files...</button>\n              <input type=\"file\" ref=\"auxFileInput\" class=\"hidden\" multiple @change=\"handleAuxFiles($event)\" />\n              <button class=\"upload-btn-small\" @click=\"$refs.auxDirInput.click()\">+ Add Directory...</button>\n              <input type=\"file\" ref=\"auxDirInput\" class=\"hidden\" webkitdirectory @change=\"handleAuxDir($event)\" />\n            </div>\n            <div class=\"file-list file-list-small\" v-if=\"Object.keys(auxFiles).length > 0\">\n              <div class=\"file-item\" v-for=\"(file, name) in auxFiles\" :key=\"name\">\n                <span class=\"file-icon\">&#128444;</span>\n                <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, name)\">{{ name }}</a>\n                <span class=\"file-size\">{{ formatFileSize(file.size) }}</span>\n                <span class=\"file-remove\" @click=\"removeAuxFile(name)\">&#10005;</span>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <!-- Options -->\n      <div class=\"card\">\n        <div class=\"card-body compact\">\n          <div class=\"options-tabs\">\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'general' }\" @click=\"activeTab = 'general'\">General</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'headings' }\" @click=\"activeTab = 'headings'\">Headings</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'media' }\" @click=\"activeTab = 'media'\">Media</button>\n            <button class=\"options-tab\" v-show=\"showTrackChangesTab\" :class=\"{ active: activeTab === 'track-changes' }\" @click=\"activeTab = 'track-changes'\">Track changes</button>\n            <button class=\"options-tab\" v-show=\"showExtensionsTab\" :class=\"{ active: activeTab === 'extensions' }\" @click=\"activeTab = 'extensions'\">Extensions</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'citations' }\" @click=\"activeTab = 'citations'\">Citations</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'math' }\" @click=\"activeTab = 'math'\">Math</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'code' }\" @click=\"activeTab = 'code'\">Code</button>\n            <button class=\"options-tab\" v-show=\"showFormatTab\" :class=\"{ active: activeTab === 'format' }\" @click=\"activeTab = 'format'\">{{ formatTabName }}</button>\n            <button class=\"options-tab\" v-show=\"showChunkedTab\" :class=\"{ active: activeTab === 'chunked' }\" @click=\"activeTab = 'chunked'\">Chunked</button>\n            <button class=\"options-tab\" v-show=\"showIpynbTab\" :class=\"{ active: activeTab === 'ipynb' }\" @click=\"activeTab = 'ipynb'\">Notebook</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'template' }\" @click=\"activeTab = 'template'\">Template</button>\n            <button class=\"options-tab\" v-show=\"showSlidesTab\" :class=\"{ active: activeTab === 'slides' }\" @click=\"activeTab = 'slides'\">Slides</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'metadata' }\" @click=\"activeTab = 'metadata'\">Metadata</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'filters' }\" @click=\"activeTab = 'filters'\">Filters</button>\n            <button class=\"options-tab\" :class=\"{ active: activeTab === 'wrapping' }\" @click=\"activeTab = 'wrapping'\">Wrapping</button>\n          </div>\n\n          <!-- General -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'general'\">\n            <div class=\"options-grid\">\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-standalone\" v-model=\"opts.standalone\" />\n                <label for=\"opt-standalone\">Standalone document</label>\n              </div>\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-file-scope\" v-model=\"opts.fileScope\" />\n                <label for=\"opt-file-scope\">File scope (parse files separately)</label>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-tab-stop\">Tab stop</label>\n                <select id=\"opt-tab-stop\" v-model=\"opts.tabStop\" style=\"width: 70px;\">\n                  <option v-for=\"n in 8\" :key=\"n\" :value=\"n\">{{ n }}</option>\n                </select>\n              </div>\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-preserve-tabs\" v-model=\"opts.preserveTabs\" />\n                <label for=\"opt-preserve-tabs\">Preserve tabs</label>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-eol\">Line endings</label>\n                <select id=\"opt-eol\" v-model=\"opts.eol\" style=\"width: 120px;\">\n                  <option value=\"\">Native</option>\n                  <option value=\"lf\">LF (Unix)</option>\n                  <option value=\"crlf\">CRLF (Windows)</option>\n                </select>\n              </div>\n            </div>\n          </div>\n\n          <!-- Headings -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'headings'\">\n            <div class=\"options-grid\">\n              <div class=\"form-group\">\n                <label for=\"opt-shift-heading\">Shift heading level by</label>\n                <select id=\"opt-shift-heading\" v-model=\"opts.shiftHeading\">\n                  <option value=\"-2\">-2</option>\n                  <option value=\"-1\">-1</option>\n                  <option value=\"0\">0</option>\n                  <option value=\"1\">+1</option>\n                  <option value=\"2\">+2</option>\n                </select>\n              </div>\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-number-sections\" v-model=\"opts.numberSections\" />\n                <label for=\"opt-number-sections\">Number sections</label>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-number-offset\">Number offset</label>\n                <input type=\"text\" id=\"opt-number-offset\" v-model=\"opts.numberOffset\" placeholder=\"0,0,0\" style=\"width: 100px;\" />\n              </div>\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-toc\" v-model=\"opts.toc\" />\n                <label for=\"opt-toc\">Table of contents</label>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-toc-depth\">TOC depth</label>\n                <select id=\"opt-toc-depth\" v-model=\"opts.tocDepth\">\n                  <option value=\"1\">1</option>\n                  <option value=\"2\">2</option>\n                  <option value=\"3\">3</option>\n                  <option value=\"4\">4</option>\n                  <option value=\"5\">5</option>\n                  <option value=\"6\">6</option>\n                </select>\n              </div>\n            </div>\n          </div>\n\n          <!-- Media -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'media'\">\n            <div class=\"options-grid\">\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-extract-media\" v-model=\"opts.extractMedia\" />\n                <label for=\"opt-extract-media\">Extract media</label>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-dpi\">DPI (for images)</label>\n                <input type=\"number\" id=\"opt-dpi\" v-model=\"opts.dpi\" placeholder=\"96\" min=\"1\" style=\"width: 80px;\" />\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-resource-path\">Resource path</label>\n                <input type=\"text\" id=\"opt-resource-path\" v-model=\"opts.resourcePath\" placeholder=\".:images\" style=\"width: 240px;\" />\n              </div>\n            </div>\n          </div>\n\n          <!-- Track Changes -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'track-changes'\">\n            <div class=\"form-group\" style=\"max-width: 250px;\">\n              <label for=\"opt-track-changes\">Handle tracked changes</label>\n              <select id=\"opt-track-changes\" v-model=\"opts.trackChanges\">\n                <option value=\"\">Default (accept)</option>\n                <option value=\"accept\">Accept all changes</option>\n                <option value=\"reject\">Reject all changes</option>\n                <option value=\"all\">Include all (insertions, deletions, comments)</option>\n              </select>\n            </div>\n            <p style=\"color: var(--gray-500); font-size: 0.85rem; margin-top: 0.75rem;\">\n              Controls how tracked changes and comments in Word documents are handled during conversion.\n            </p>\n          </div>\n\n          <!-- Extensions -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'extensions'\">\n            <div class=\"extensions-row\">\n              <div class=\"extensions-group\" v-show=\"inputFormat !== 'auto'\">\n                <div class=\"extensions-group-header\">From ({{ inputFormat }})</div>\n                <div class=\"extensions-list\">\n                  <div class=\"extension-item\" v-for=\"ext in inputExtensionsList\" :key=\"'in-' + ext.name\" :class=\"{ 'default-on': ext.defaultOn, toggled: inputExtensions[ext.name] !== undefined }\">\n                    <input type=\"checkbox\" :id=\"'ext-in-' + ext.name\" :checked=\"getExtensionChecked('input', ext)\" @change=\"toggleExtension('input', ext, $event)\" />\n                    <label :for=\"'ext-in-' + ext.name\">{{ ext.name }}</label>\n                  </div>\n                </div>\n              </div>\n              <div class=\"extensions-group\" v-show=\"outputFormat !== 'auto'\">\n                <div class=\"extensions-group-header\">To ({{ effectiveOutputFormat }})</div>\n                <div class=\"extensions-list\">\n                  <div class=\"extension-item\" v-for=\"ext in outputExtensionsList\" :key=\"'out-' + ext.name\" :class=\"{ 'default-on': ext.defaultOn, toggled: outputExtensions[ext.name] !== undefined }\">\n                    <input type=\"checkbox\" :id=\"'ext-out-' + ext.name\" :checked=\"getExtensionChecked('output', ext)\" @change=\"toggleExtension('output', ext, $event)\" />\n                    <label :for=\"'ext-out-' + ext.name\">{{ ext.name }}</label>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <!-- Citations -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'citations'\">\n            <div class=\"form-group\" style=\"max-width: 200px;\">\n              <label for=\"opt-citation-method\">Citation processing</label>\n              <select id=\"opt-citation-method\" v-model=\"opts.citationMethod\">\n                <option value=\"\">None</option>\n                <option value=\"citeproc\">Citeproc</option>\n                <option v-if=\"isLatexLikeFormat\" value=\"natbib\">Natbib</option>\n                <option v-if=\"isLatexLikeFormat\" value=\"biblatex\">BibLaTeX</option>\n              </select>\n            </div>\n            <div class=\"resource-upload\" v-show=\"opts.citationMethod\">\n              <label>Bibliography file (.bib, .json, .yaml)</label>\n              <input type=\"file\" ref=\"bibInput\" class=\"hidden\" accept=\".bib,.bibtex,.json,.yaml,.yml\" @change=\"handleBibFile($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.bibInput.click()\">Upload Bibliography</button>\n              <div v-if=\"bibFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(bibFile, bibFile.name)\">{{ bibFile.name }}</a> <span class=\"file-remove\" @click=\"bibFile = null; hasChanges = true\">&#10005;</span></div>\n            </div>\n            <div v-show=\"opts.citationMethod === 'citeproc'\">\n              <div class=\"resource-upload\">\n                <label>Citation style (.csl)</label>\n                <div class=\"options-grid\" style=\"margin-top: 0.5rem;\">\n                  <div>\n                    <input type=\"file\" ref=\"cslInput\" class=\"hidden\" accept=\".csl\" @change=\"handleCslFile($event)\" />\n                    <button class=\"upload-btn\" @click=\"$refs.cslInput.click()\">Upload CSL Style</button>\n                  </div>\n                  <div style=\"display: flex; gap: 0.5rem; align-items: flex-start;\">\n                    <input type=\"text\" v-model=\"cslStyleName\" list=\"csl-styles-list\" placeholder=\"Or select/type style name...\" style=\"flex: 1;\" @focus=\"loadCslStyles\" />\n                    <button class=\"upload-btn\" @click=\"fetchCslStyle\">Fetch</button>\n                  </div>\n                </div>\n                <datalist id=\"csl-styles-list\">\n                  <option v-for=\"style in cslStylesList\" :key=\"style\" :value=\"style\"></option>\n                </datalist>\n                <div v-if=\"cslFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(cslFile, cslFile.name)\">{{ cslFile.name }}</a> <span class=\"file-remove\" @click=\"cslFile = null; hasChanges = true\">&#10005;</span></div>\n              </div>\n              <div class=\"resource-upload\">\n                <label>Citation abbreviations (.json)</label>\n                <input type=\"file\" ref=\"abbrevInput\" class=\"hidden\" accept=\".json\" @change=\"handleAbbrevFile($event)\" />\n                <button class=\"upload-btn\" @click=\"$refs.abbrevInput.click()\">Upload Abbreviations</button>\n                <div v-if=\"abbrevFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(abbrevFile, abbrevFile.name)\">{{ abbrevFile.name }}</a> <span class=\"file-remove\" @click=\"abbrevFile = null; hasChanges = true\">&#10005;</span></div>\n              </div>\n            </div>\n          </div>\n\n          <!-- Math -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'math'\">\n            <div class=\"form-group\">\n              <label for=\"opt-math\">Math rendering method</label>\n              <select id=\"opt-math\" v-model=\"opts.mathMethod\">\n                <option value=\"\">Default (plain)</option>\n                <option value=\"mathjax\">MathJax</option>\n                <option value=\"katex\">KaTeX</option>\n                <option value=\"mathml\">MathML</option>\n                <option value=\"webtex\">WebTeX (images)</option>\n                <option value=\"gladtex\">GladTeX</option>\n              </select>\n            </div>\n          </div>\n\n          <!-- Code -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'code'\">\n            <div class=\"options-grid\">\n              <div class=\"form-group\">\n                <label for=\"opt-highlight-style\">Syntax highlight style</label>\n                <select id=\"opt-highlight-style\" v-model=\"opts.highlightStyle\">\n                  <option value=\"\">Default</option>\n                  <option value=\"idiomatic\">Idiomatic</option>\n                  <option value=\"none\">None</option>\n                  <option value=\"pygments\">Pygments</option>\n                  <option value=\"kate\">Kate</option>\n                  <option value=\"monochrome\">Monochrome</option>\n                  <option value=\"breezedark\">Breeze Dark</option>\n                  <option value=\"espresso\">Espresso</option>\n                  <option value=\"zenburn\">Zenburn</option>\n                  <option value=\"haddock\">Haddock</option>\n                  <option value=\"tango\">Tango</option>\n                  <option value=\"custom\">Custom...</option>\n                </select>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-indented-code-classes\">Indented code classes</label>\n                <input type=\"text\" id=\"opt-indented-code-classes\" v-model=\"opts.indentedCodeClasses\" placeholder=\"e.g., haskell, python\" />\n              </div>\n            </div>\n            <div class=\"resource-upload\" v-show=\"opts.highlightStyle === 'custom'\" style=\"margin-top: 0.75rem;\">\n              <label>Custom highlight theme (.theme)</label>\n              <input type=\"file\" ref=\"highlightThemeInput\" class=\"hidden\" accept=\".theme\" @change=\"handleHighlightTheme($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.highlightThemeInput.click()\">Upload Theme</button>\n              <div v-if=\"highlightThemeFile\" class=\"resource-item\">&#127912; <a href=\"#\" @click.prevent=\"downloadFile(highlightThemeFile, highlightThemeFile.name)\">{{ highlightThemeFile.name }}</a> <span class=\"file-remove\" @click=\"highlightThemeFile = null; hasChanges = true\">&#10005;</span></div>\n            </div>\n            <div class=\"resource-upload\" style=\"margin-top: 0.75rem;\">\n              <label>Custom syntax definitions (.xml)</label>\n              <input type=\"file\" ref=\"syntaxDefInput\" class=\"hidden\" accept=\".xml\" multiple @change=\"handleSyntaxDefs($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.syntaxDefInput.click()\">Add Syntax Definitions</button>\n              <div class=\"file-list file-list-small\" v-if=\"syntaxDefinitions.length > 0\">\n                <div class=\"file-item\" v-for=\"file in syntaxDefinitions\" :key=\"file.name\">\n                  <span class=\"file-icon\">&#128196;</span>\n                  <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                  <span class=\"file-remove\" @click=\"removeSyntaxDef(file.name)\">&#10005;</span>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <!-- Format-specific Options -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'format'\">\n            <!-- Reader options for markdown/textile/latex -->\n            <div v-show=\"showStripComments || showDefaultImageExtension || showAbbreviations\">\n              <div class=\"options-grid\">\n                <div class=\"checkbox-group\" v-show=\"showStripComments\">\n                  <input type=\"checkbox\" id=\"opt-strip-comments\" v-model=\"opts.stripComments\" />\n                  <label for=\"opt-strip-comments\">Strip HTML comments (input)</label>\n                </div>\n                <div class=\"form-group\" v-show=\"showDefaultImageExtension\">\n                  <label for=\"opt-default-image-extension\">Default image extension</label>\n                  <input type=\"text\" id=\"opt-default-image-extension\" v-model=\"opts.defaultImageExtension\" placeholder=\".png\" style=\"width: 80px;\" />\n                </div>\n                <div class=\"resource-upload\" v-show=\"showAbbreviations\">\n                  <label>Abbreviations file</label>\n                  <input type=\"file\" ref=\"abbreviationsInput\" class=\"hidden\" @change=\"handleAbbreviationsFile($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.abbreviationsInput.click()\">Upload Abbreviations</button>\n                  <div v-if=\"abbreviationsFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(abbreviationsFile, abbreviationsFile.name)\">{{ abbreviationsFile.name }}</a> <span class=\"file-remove\" @click=\"abbreviationsFile = null; hasChanges = true\">&#10005;</span></div>\n                </div>\n              </div>\n            </div>\n            <!-- HTML options -->\n            <div v-show=\"isHtmlFormat\">\n              <div class=\"options-grid\">\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-self-contained\" v-model=\"opts.selfContained\" />\n                  <label for=\"opt-self-contained\">Embed resources</label>\n                </div>\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-html-q-tags\" v-model=\"opts.htmlQTags\" />\n                  <label for=\"opt-html-q-tags\">Use &lt;q&gt; tags for quotes</label>\n                </div>\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-section-divs\" v-model=\"opts.sectionDivs\" />\n                  <label for=\"opt-section-divs\">Wrap sections in &lt;section&gt; tags</label>\n                </div>\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-ascii-html\" v-model=\"opts.asciiHtml\" />\n                  <label for=\"opt-ascii-html\">ASCII only</label>\n                </div>\n              </div>\n              <div class=\"options-grid\" style=\"margin-top: 0.75rem;\">\n                <div class=\"form-group\">\n                  <label for=\"opt-title-prefix\">Title prefix</label>\n                  <input type=\"text\" id=\"opt-title-prefix\" v-model=\"opts.titlePrefix\" placeholder=\"Prefix\" />\n                </div>\n                <div class=\"form-group\">\n                  <label for=\"opt-id-prefix\">ID prefix</label>\n                  <input type=\"text\" id=\"opt-id-prefix\" v-model=\"opts.idPrefix\" placeholder=\"Prefix\" />\n                </div>\n                <div class=\"form-group\">\n                  <label for=\"opt-email-obfuscation\">Email obfuscation</label>\n                  <select id=\"opt-email-obfuscation\" v-model=\"opts.emailObfuscation\">\n                    <option value=\"\">None</option>\n                    <option value=\"javascript\">JavaScript</option>\n                    <option value=\"references\">Character references</option>\n                  </select>\n                </div>\n              </div>\n              <div class=\"resource-upload\" style=\"margin-top: 0.75rem;\">\n                <label>Custom CSS</label>\n                <input type=\"file\" ref=\"cssInput\" class=\"hidden\" accept=\".css\" multiple @change=\"handleCssFiles($event)\" />\n                <button class=\"upload-btn\" @click=\"$refs.cssInput.click()\">Add CSS Files</button>\n                <div class=\"file-list file-list-small\" v-if=\"cssFiles.length > 0\">\n                  <div class=\"file-item\" v-for=\"file in cssFiles\" :key=\"file.name\">\n                    <span class=\"file-icon\">&#127912;</span>\n                    <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                    <span class=\"file-remove\" @click=\"removeCssFile(file.name)\">&#10005;</span>\n                  </div>\n                </div>\n              </div>\n            </div>\n            <!-- Markdown options -->\n            <div v-show=\"isMarkdownFormat\">\n              <div class=\"options-grid\">\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-reference-links\" v-model=\"opts.referenceLinks\" />\n                  <label for=\"opt-reference-links\">Use reference-style links</label>\n                </div>\n                <div class=\"form-group\">\n                  <label for=\"opt-reference-location\">Reference location</label>\n                  <select id=\"opt-reference-location\" v-model=\"opts.referenceLocation\">\n                    <option value=\"\">Default (document)</option>\n                    <option value=\"block\">Block</option>\n                    <option value=\"section\">Section</option>\n                    <option value=\"document\">Document</option>\n                  </select>\n                </div>\n                <div class=\"form-group\">\n                  <label for=\"opt-markdown-headings\">Heading style</label>\n                  <select id=\"opt-markdown-headings\" v-model=\"opts.markdownHeadings\">\n                    <option value=\"\">Default (ATX)</option>\n                    <option value=\"atx\">ATX (#)</option>\n                    <option value=\"setext\">Setext (underlined)</option>\n                  </select>\n                </div>\n              </div>\n            </div>\n            <!-- RST options -->\n            <div v-show=\"effectiveOutputFormat === 'rst'\">\n              <div class=\"options-grid\">\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-reference-links-rst\" v-model=\"opts.referenceLinksRst\" />\n                  <label for=\"opt-reference-links-rst\">Use reference-style links</label>\n                </div>\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-list-tables\" v-model=\"opts.listTables\" />\n                  <label for=\"opt-list-tables\">Use list tables</label>\n                </div>\n              </div>\n            </div>\n            <!-- LaTeX options -->\n            <div v-show=\"supportsListOf\">\n              <div class=\"options-grid\">\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-lof\" v-model=\"opts.lof\" />\n                  <label for=\"opt-lof\">List of figures</label>\n                </div>\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-lot\" v-model=\"opts.lot\" />\n                  <label for=\"opt-lot\">List of tables</label>\n                </div>\n              </div>\n            </div>\n            <!-- Typst PDF note -->\n            <div v-show=\"effectiveOutputFormat === 'pdf-typst'\">\n              <p style=\"color: var(--gray-500); font-size: 0.85rem; margin: 0;\">\n                Output will be generated as Typst markup, then compiled to PDF.\n              </p>\n            </div>\n            <!-- Caption position and top-level division -->\n            <div v-show=\"supportsCaptionPosition || supportsTopLevelDivision\" style=\"margin-top: 0.75rem;\">\n              <div class=\"options-grid\">\n                <div class=\"form-group\" v-show=\"supportsCaptionPosition\">\n                  <label for=\"opt-figure-caption-position\">Figure caption</label>\n                  <select id=\"opt-figure-caption-position\" v-model=\"opts.figureCaptionPosition\" style=\"width: 100px;\">\n                    <option value=\"\">Default</option>\n                    <option value=\"above\">Above</option>\n                    <option value=\"below\">Below</option>\n                  </select>\n                </div>\n                <div class=\"form-group\" v-show=\"supportsCaptionPosition\">\n                  <label for=\"opt-table-caption-position\">Table caption</label>\n                  <select id=\"opt-table-caption-position\" v-model=\"opts.tableCaptionPosition\" style=\"width: 100px;\">\n                    <option value=\"\">Default</option>\n                    <option value=\"above\">Above</option>\n                    <option value=\"below\">Below</option>\n                  </select>\n                </div>\n                <div class=\"form-group\" v-show=\"supportsTopLevelDivision\">\n                  <label for=\"opt-top-level-division\">Top-level division</label>\n                  <select id=\"opt-top-level-division\" v-model=\"opts.topLevelDivision\" style=\"width: 100px;\">\n                    <option value=\"\">Default</option>\n                    <option value=\"section\">Section</option>\n                    <option value=\"chapter\">Chapter</option>\n                    <option value=\"part\">Part</option>\n                  </select>\n                </div>\n              </div>\n            </div>\n            <!-- ASCII (non-HTML) -->\n            <div v-show=\"supportsAscii && !isHtmlFormat\" style=\"margin-top: 0.75rem;\">\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-ascii\" v-model=\"opts.ascii\" />\n                <label for=\"opt-ascii\">ASCII output only (escape non-ASCII characters)</label>\n              </div>\n            </div>\n            <!-- ODT options -->\n            <div v-show=\"effectiveOutputFormat === 'odt'\" style=\"margin-top: 0.75rem;\">\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-link-images\" v-model=\"opts.linkImages\" />\n                <label for=\"opt-link-images\">Link images (reference instead of embed)</label>\n              </div>\n            </div>\n            <!-- EPUB options -->\n            <div v-show=\"isEpubFormat\" style=\"margin-top: 0.75rem;\">\n              <div class=\"options-grid\">\n                <div class=\"resource-upload\">\n                  <label>Cover image</label>\n                  <input type=\"file\" ref=\"epubCoverInput\" class=\"hidden\" accept=\"image/*\" @change=\"handleEpubCover($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.epubCoverInput.click()\">Upload Cover Image</button>\n                  <div v-if=\"epubCoverImage\" class=\"resource-item\">&#128444; <a href=\"#\" @click.prevent=\"downloadFile(epubCoverImage, epubCoverImage.name)\">{{ epubCoverImage.name }}</a> <span class=\"file-remove\" @click=\"epubCoverImage = null; hasChanges = true\">&#10005;</span></div>\n                </div>\n                <div class=\"resource-upload\">\n                  <label>Embed fonts</label>\n                  <input type=\"file\" ref=\"epubFontInput\" class=\"hidden\" accept=\".ttf,.otf,.woff,.woff2\" multiple @change=\"handleEpubFonts($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.epubFontInput.click()\">Upload Fonts</button>\n                  <div class=\"file-list file-list-small\" v-if=\"epubFonts.length > 0\">\n                    <div class=\"file-item\" v-for=\"file in epubFonts\" :key=\"file.name\">\n                      <span class=\"file-icon\">&#128288;</span>\n                      <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                      <span class=\"file-remove\" @click=\"removeEpubFont(file.name)\">&#10005;</span>\n                    </div>\n                  </div>\n                </div>\n                <div class=\"resource-upload\">\n                  <label>EPUB metadata (XML)</label>\n                  <input type=\"file\" ref=\"epubMetadataInput\" class=\"hidden\" accept=\".xml\" @change=\"handleEpubMetadata($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.epubMetadataInput.click()\">Upload Metadata</button>\n                  <div v-if=\"epubMetadataFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(epubMetadataFile, epubMetadataFile.name)\">{{ epubMetadataFile.name }}</a> <span class=\"file-remove\" @click=\"epubMetadataFile = null; hasChanges = true\">&#10005;</span></div>\n                </div>\n                <div class=\"checkbox-group\">\n                  <input type=\"checkbox\" id=\"opt-epub-title-page\" v-model=\"opts.epubTitlePage\" />\n                  <label for=\"opt-epub-title-page\">Include title page</label>\n                </div>\n                <div class=\"form-group\">\n                  <label for=\"opt-epub-subdirectory\">EPUB subdirectory</label>\n                  <input type=\"text\" id=\"opt-epub-subdirectory\" v-model=\"opts.epubSubdirectory\" placeholder=\"EPUB (default)\" />\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <!-- Chunked HTML -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'chunked'\">\n            <div class=\"options-grid\">\n              <div class=\"form-group\">\n                <label for=\"opt-split-level\">Split level (heading depth)</label>\n                <select id=\"opt-split-level\" v-model=\"opts.splitLevel\">\n                  <option value=\"\">Default (1)</option>\n                  <option value=\"1\">1</option>\n                  <option value=\"2\">2</option>\n                  <option value=\"3\">3</option>\n                  <option value=\"4\">4</option>\n                </select>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-chunk-template\">Chunk filename template</label>\n                <input type=\"text\" id=\"opt-chunk-template\" v-model=\"opts.chunkTemplate\" placeholder=\"%s-%i.html\" />\n              </div>\n            </div>\n          </div>\n\n          <!-- Notebook -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'ipynb'\">\n            <div class=\"options-grid\">\n              <div class=\"form-group\">\n                <label for=\"opt-ipynb-output\">Output cell handling</label>\n                <select id=\"opt-ipynb-output\" v-model=\"opts.ipynbOutput\">\n                  <option value=\"\">Default (best)</option>\n                  <option value=\"all\">All outputs</option>\n                  <option value=\"none\">No outputs</option>\n                  <option value=\"best\">Best output only</option>\n                </select>\n              </div>\n            </div>\n          </div>\n\n          <!-- Template -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'template'\">\n            <div class=\"resource-upload\">\n              <label>Custom template</label>\n              <input type=\"file\" ref=\"templateInput\" class=\"hidden\" @change=\"handleTemplateFile($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.templateInput.click()\">Upload Custom Template</button>\n              <div v-if=\"templateFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(templateFile, templateFile.name)\">{{ templateFile.name }}</a> <span class=\"file-remove\" @click=\"templateFile = null; hasChanges = true\">&#10005;</span></div>\n            </div>\n            <div class=\"resource-upload\" v-show=\"showReferenceDoc\">\n              <label>Reference document (for styles in docx/odt/pptx)</label>\n              <input type=\"file\" ref=\"referenceDocInput\" class=\"hidden\" accept=\".docx,.odt,.pptx\" @change=\"handleReferenceDoc($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.referenceDocInput.click()\">Upload Reference Document</button>\n              <div v-if=\"referenceDoc\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(referenceDoc, referenceDoc.name)\">{{ referenceDoc.name }}</a> <span class=\"file-remove\" @click=\"referenceDoc = null; hasChanges = true\">&#10005;</span></div>\n            </div>\n            <fieldset class=\"include-fieldset\">\n              <legend>Files to include</legend>\n              <div class=\"include-fieldset-content\">\n                <div class=\"resource-upload\">\n                  <label>In header</label>\n                  <input type=\"file\" ref=\"headerInput\" class=\"hidden\" multiple @change=\"handleHeaderFiles($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.headerInput.click()\">Add Header Files</button>\n                  <div class=\"file-list file-list-small\" v-if=\"headerFiles.length > 0\">\n                    <div class=\"file-item\" v-for=\"file in headerFiles\" :key=\"file.name\">\n                      <span class=\"file-icon\">&#128196;</span>\n                      <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                      <span class=\"file-remove\" @click=\"removeHeaderFile(file.name)\">&#10005;</span>\n                    </div>\n                  </div>\n                </div>\n                <div class=\"resource-upload\">\n                  <label>Before body</label>\n                  <input type=\"file\" ref=\"beforeBodyInput\" class=\"hidden\" multiple @change=\"handleBeforeBodyFiles($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.beforeBodyInput.click()\">Add Before-Body Files</button>\n                  <div class=\"file-list file-list-small\" v-if=\"beforeBodyFiles.length > 0\">\n                    <div class=\"file-item\" v-for=\"file in beforeBodyFiles\" :key=\"file.name\">\n                      <span class=\"file-icon\">&#128196;</span>\n                      <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                      <span class=\"file-remove\" @click=\"removeBeforeBodyFile(file.name)\">&#10005;</span>\n                    </div>\n                  </div>\n                </div>\n                <div class=\"resource-upload\">\n                  <label>After body</label>\n                  <input type=\"file\" ref=\"afterBodyInput\" class=\"hidden\" multiple @change=\"handleAfterBodyFiles($event)\" />\n                  <button class=\"upload-btn\" @click=\"$refs.afterBodyInput.click()\">Add After-Body Files</button>\n                  <div class=\"file-list file-list-small\" v-if=\"afterBodyFiles.length > 0\">\n                    <div class=\"file-item\" v-for=\"file in afterBodyFiles\" :key=\"file.name\">\n                      <span class=\"file-icon\">&#128196;</span>\n                      <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                      <span class=\"file-remove\" @click=\"removeAfterBodyFile(file.name)\">&#10005;</span>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </fieldset>\n            <div class=\"variables-section\">\n              <label>Variables</label>\n              <datalist id=\"variable-suggestions\">\n                <option v-for=\"varName in suggestedVariables\" :key=\"varName\" :value=\"varName\"></option>\n              </datalist>\n              <div class=\"custom-metadata\">\n                <div class=\"custom-meta-row\" v-for=\"(v, idx) in customVariables\" :key=\"idx\">\n                  <input type=\"text\" name=\"key\" v-model=\"v.key\" placeholder=\"variable name\" list=\"variable-suggestions\" @input=\"onVariableInput()\" />\n                  <input type=\"text\" name=\"value\" v-model=\"v.value\" placeholder=\"value\" @input=\"onVariableInput()\" />\n                  <button type=\"button\" class=\"remove-meta\" @click=\"removeVariable(idx)\" v-show=\"customVariables.length > 1 || v.key || v.value\">&#10005;</button>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <!-- Slides -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'slides'\">\n            <div class=\"options-grid\">\n              <div class=\"form-group\">\n                <label for=\"opt-slide-level\">Slide level (heading depth)</label>\n                <select id=\"opt-slide-level\" v-model=\"opts.slideLevel\">\n                  <option value=\"\">Auto</option>\n                  <option value=\"1\">1</option>\n                  <option value=\"2\">2</option>\n                  <option value=\"3\">3</option>\n                </select>\n              </div>\n              <div class=\"checkbox-group\">\n                <input type=\"checkbox\" id=\"opt-incremental\" v-model=\"opts.incremental\" />\n                <label for=\"opt-incremental\">Incremental lists</label>\n              </div>\n            </div>\n          </div>\n\n          <!-- Metadata -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'metadata'\">\n            <div class=\"resource-upload\" style=\"margin-bottom: 0.75rem;\">\n              <label>Metadata file (.yaml, .json)</label>\n              <input type=\"file\" ref=\"metadataFileInput\" class=\"hidden\" accept=\".yaml,.yml,.json\" @change=\"handleMetadataFile($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.metadataFileInput.click()\">Upload Metadata File</button>\n              <div v-if=\"metadataFile\" class=\"resource-item\">&#128196; <a href=\"#\" @click.prevent=\"downloadFile(metadataFile, metadataFile.name)\">{{ metadataFile.name }}</a> <span class=\"file-remove\" @click=\"metadataFile = null; hasChanges = true\">&#10005;</span></div>\n            </div>\n            <datalist id=\"metadata-suggestions\">\n              <option value=\"title\"></option>\n              <option value=\"author\"></option>\n              <option value=\"date\"></option>\n              <option value=\"lang\"></option>\n            </datalist>\n            <div class=\"custom-metadata\">\n              <div class=\"custom-meta-row\" v-for=\"(m, idx) in customMetadata\" :key=\"idx\">\n                <input type=\"text\" name=\"key\" v-model=\"m.key\" placeholder=\"field name\" list=\"metadata-suggestions\" @input=\"onMetadataInput()\" />\n                <input type=\"text\" name=\"value\" v-model=\"m.value\" placeholder=\"value\" @input=\"onMetadataInput()\" />\n                <button type=\"button\" class=\"remove-meta\" @click=\"removeMetadata(idx)\" v-show=\"customMetadata.length > 1 || m.key || m.value\">&#10005;</button>\n              </div>\n            </div>\n          </div>\n\n          <!-- Filters -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'filters'\">\n            <div class=\"resource-upload\">\n              <label>Lua filters (.lua)</label>\n              <input type=\"file\" ref=\"luaFilterInput\" class=\"hidden\" accept=\".lua\" multiple @change=\"handleLuaFilters($event)\" />\n              <button class=\"upload-btn\" @click=\"$refs.luaFilterInput.click()\">Add Lua Filters</button>\n              <div class=\"file-list file-list-small\" v-if=\"luaFilters.length > 0\">\n                <div class=\"file-item\" v-for=\"(file, idx) in luaFilters\" :key=\"file.name\" draggable=\"true\" @dragstart=\"onFilterDragStart(idx, $event)\" @dragover.prevent=\"onFilterDragOver(idx)\" @dragleave=\"filterDragOverIdx = -1\" @drop.prevent=\"onFilterDrop(idx)\" @dragend=\"filterDraggingIdx = -1\" :class=\"{ dragging: filterDraggingIdx === idx, 'drag-over': filterDragOverIdx === idx && filterDraggingIdx !== idx }\">\n                  <span class=\"file-icon\">&#128196;</span>\n                  <a class=\"file-name\" href=\"#\" @click.prevent=\"downloadFile(file, file.name)\">{{ file.name }}</a>\n                  <span class=\"file-remove\" @click=\"removeLuaFilter(file.name)\">&#10005;</span>\n                </div>\n              </div>\n              <p v-if=\"luaFilters.length > 1\" style=\"color: var(--gray-500); font-size: 0.8rem; margin-top: 0.5rem;\">\n                Drag to reorder. Filters are applied in order from top to bottom.\n              </p>\n            </div>\n          </div>\n\n          <!-- Wrapping -->\n          <div class=\"tab-panel\" v-show=\"activeTab === 'wrapping'\">\n            <div class=\"options-grid\">\n              <div class=\"form-group\">\n                <label for=\"opt-wrap\">Wrap mode</label>\n                <select id=\"opt-wrap\" v-model=\"opts.wrap\">\n                  <option value=\"auto\">Auto</option>\n                  <option value=\"none\">None</option>\n                  <option value=\"preserve\">Preserve</option>\n                </select>\n              </div>\n              <div class=\"form-group\">\n                <label for=\"opt-columns\">Line width (columns)</label>\n                <input type=\"text\" id=\"opt-columns\" v-model=\"opts.columns\" placeholder=\"72\" />\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <!-- Loading -->\n      <div class=\"loading\" v-show=\"isConverting\">\n        <div class=\"spinner\"></div>\n        <p>Converting...</p>\n      </div>\n\n      <!-- Output Section -->\n      <div class=\"card\" v-show=\"showOutput\">\n        <div class=\"card-body\">\n          <div class=\"output-actions\">\n            <button class=\"download-btn\" v-show=\"output\" @click=\"download\">&#128229; Download {{ outputFilenameActual }}</button>\n            <button class=\"copy-btn\" v-show=\"output && !isBinaryOutput\" @click=\"copyToClipboard\">{{ copyBtnText }}</button>\n            <button class=\"download-btn\" v-show=\"mediaZip\" @click=\"downloadMedia\">&#128247; Download Media</button>\n            <div class=\"form-group verbosity-control\" v-show=\"messages.length > 0\">\n              <label for=\"opt-verbosity\">Verbosity:</label>\n              <select id=\"opt-verbosity\" v-model=\"verbosity\">\n                <option value=\"info\">Info</option>\n                <option value=\"warning\">Warning</option>\n                <option value=\"error\">Error</option>\n              </select>\n            </div>\n          </div>\n          <div class=\"messages\">\n            <div v-for=\"(msg, idx) in filteredMessages\" :key=\"idx\" class=\"message\" :class=\"msg.type\">{{ msg.text }}</div>\n          </div>\n          <div class=\"output-preview\" v-show=\"!isBinaryOutput && outputPreview\">{{ outputPreview }}</div>\n        </div>\n      </div>\n    </div>\n\n    <!-- Loading Overlay - shows when user action requires pandoc but it's still loading -->\n    <div class=\"loading-overlay\" v-show=\"waitingForPandoc\">\n      <div class=\"loading-box\">\n        <div class=\"spinner\"></div>\n        <p>Loading pandoc.wasm...</p>\n      </div>\n    </div>\n  </div>\n  <footer>\n    This is <tt>pandoc.wasm</tt> <span id=\"pandoc-version\"></span>\n    running in your browser.\n    Nothing is being transmitted to the server!<br>\n    Copyright &copy; 2026 John MacFarlane\n  </footer>\n  <script type=\"module\" src=\"index.js?sha1=SHA1_INDEX_JS\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "wasm/index.js",
    "content": "import { zipSync, unzipSync, strToU8, strFromU8 } from 'https://esm.sh/fflate@0.8.2';\n\n// Make fflate available globally\nwindow.fflate = { zipSync, unzipSync, strToU8, strFromU8 };\n\n// Pandoc loading - starts immediately in background, but doesn't block UI\nlet pandocReadyPromise = null;\nlet onFormatsLoaded = null; // Callback to update Vue app when formats load\n\nfunction loadPandoc() {\n  // Only load once\n  if (pandocReadyPromise) return pandocReadyPromise;\n\n  pandocReadyPromise = (async () => {\n    // Dynamic import so WASM loading happens in background\n    const { convert, query } = await import(\"./pandoc.js?sha1=SHA1_PANDOC_JS\");\n    window.pandocModule = { convert, query };\n\n    // Query version and formats\n    const pandocVersion = await query({ query: \"version\" });\n    document.getElementById(\"pandoc-version\").innerText = pandocVersion;\n\n    const inputFormats = await query({ query: \"input-formats\" });\n    const outputFormats = await query({ query: \"output-formats\" });\n\n    // Update Vue app if callback is registered\n    if (onFormatsLoaded) {\n      onFormatsLoaded(inputFormats, outputFormats);\n    }\n  })();\n\n  return pandocReadyPromise;\n}\n\n// Start loading immediately in background (fire and forget)\nloadPandoc().catch(err => console.error(\"Failed to load pandoc:\", err));\n\n// Lazy-load typst library only when needed\nlet typstLoaded = false;\nlet typstLoadingPromise = null;\n\nwindow.loadTypst = async function() {\n  if (typstLoaded && typeof $typst !== 'undefined') return;\n  if (typstLoadingPromise) return typstLoadingPromise;\n\n  typstLoadingPromise = new Promise((resolve, reject) => {\n    const typstScript = document.createElement('script');\n    typstScript.type = 'module';\n    typstScript.src = 'https://cdn.jsdelivr.net/npm/@myriaddreamin/typst-all-in-one.ts@0.7.0-rc2/dist/esm/index.js';\n    typstScript.onload = () => {\n      const checkTypst = () => {\n        if (typeof $typst !== 'undefined') {\n          typstLoaded = true;\n          resolve();\n        } else {\n          setTimeout(checkTypst, 100);\n        }\n      };\n      checkTypst();\n    };\n    typstScript.onerror = () => reject(new Error('Failed to load Typst library'));\n    document.head.appendChild(typstScript);\n  });\n  return typstLoadingPromise;\n};\n\n// Petite Vue app definition\nwindow.pandocApp = function() {\n  return {\n    // State\n    pandocReady: false,\n    waitingForPandoc: false,\n    selectedExample: '',\n    showExamplesBar: false,\n    inputMode: 'file',\n    files: {},\n    fileOrder: [],\n    auxFiles: {},\n    textInput: '',\n    inputFormat: 'auto',\n    outputFormat: 'auto',\n    outputFilename: '',\n    activeTab: 'general',\n    dragOver: false,\n    fileDraggingIdx: -1,\n    fileDragOverIdx: -1,\n\n    // Options\n    opts: {\n      standalone: true,\n      toc: false,\n      numberSections: false,\n      fileScope: false,\n      extractMedia: false,\n      tocDepth: '3',\n      shiftHeading: '0',\n      tabStop: '4',\n      preserveTabs: false,\n      eol: '',\n      dpi: '',\n      numberOffset: '',\n      resourcePath: '',\n      defaultImageExtension: '',\n      stripComments: false,\n      trackChanges: '',\n      citationMethod: '',\n      mathMethod: '',\n      highlightStyle: '',\n      indentedCodeClasses: '',\n      selfContained: false,\n      htmlQTags: false,\n      sectionDivs: false,\n      asciiHtml: false,\n      titlePrefix: '',\n      idPrefix: '',\n      emailObfuscation: '',\n      referenceLinks: false,\n      referenceLocation: '',\n      markdownHeadings: '',\n      referenceLinksRst: false,\n      listTables: false,\n      lof: false,\n      lot: false,\n      figureCaptionPosition: '',\n      tableCaptionPosition: '',\n      topLevelDivision: '',\n      ascii: false,\n      epubTitlePage: true,\n      epubSubdirectory: '',\n      splitLevel: '',\n      chunkTemplate: '',\n      ipynbOutput: '',\n      slideLevel: '',\n      incremental: false,\n      wrap: 'auto',\n      columns: '',\n      linkImages: false\n    },\n\n    // Metadata\n    customMetadata: [{ key: '', value: '' }],\n    customVariables: [{ key: '', value: '' }],\n\n    // Resource files\n    bibFile: null,\n    cslFile: null,\n    abbrevFile: null,\n    abbreviationsFile: null,\n    cssFiles: [],\n    highlightThemeFile: null,\n    syntaxDefinitions: [],\n    templateFile: null,\n    referenceDoc: null,\n    metadataFile: null,\n    epubCoverImage: null,\n    epubMetadataFile: null,\n    epubFonts: [],\n    headerFiles: [],\n    beforeBodyFiles: [],\n    afterBodyFiles: [],\n    luaFilters: [],\n    filterDraggingIdx: -1,\n    filterDragOverIdx: -1,\n\n    // CSL\n    cslStyleName: '',\n    cslStylesList: [],\n    cslStylesLoaded: false,\n\n    // Extensions\n    inputExtensions: {},\n    outputExtensions: {},\n    inputExtensionsList: [],\n    outputExtensionsList: [],\n\n    // Output\n    hasChanges: false,\n    isConverting: false,\n    showOutput: false,\n    output: null,\n    outputFilenameActual: '',\n    outputPreview: '',\n    messages: [],\n    verbosity: 'info',\n    copyBtnText: '📋 Copy to Clipboard',\n    mediaZip: null,\n\n    // Format names: maps format ID to human-readable name\n    // Some formats have different names for input vs output\n    formatNames: {\n      ansi: 'ANSI terminal',\n      asciidoc: 'modern AsciiDoc',\n      asciidoc_legacy: 'AsciiDoc for asciidoc-py',\n      asciidoctor: 'AsciiDoctor (= modern AsciiDoc)',\n      bbcode: 'BBCode',\n      beamer: 'LaTeX Beamer slides',\n      biblatex: 'BibLaTeX bibliography',\n      bibtex: 'BibTeX bibliography',\n      bits: 'BITS XML, alias for jats',\n      chunkedhtml: 'zip of linked HTML files',\n      commonmark: 'CommonMark Markdown',\n      commonmark_x: 'CommonMark with extensions',\n      context: 'ConTeXt',\n      creole: 'Creole 1.0',\n      csljson: 'CSL JSON bibliography',\n      csv: 'CSV table',\n      djot: 'Djot markup',\n      docbook: 'DocBook v4',\n      docbook5: 'DocBook v5',\n      docx: 'Word',\n      dokuwiki: 'DokuWiki markup',\n      dzslides: 'DZSlides HTML slides',\n      endnotexml: 'EndNote XML bibliography',\n      epub: 'EPUB v3',\n      epub2: 'EPUB v2',\n      epub3: 'EPUB v3',\n      fb2: 'FictionBook2',\n      gfm: 'GitHub-Flavored Markdown',\n      haddock: 'Haddock markup',\n      html: 'HTML',\n      html4: 'XHTML 1.0 Transitional',\n      html5: 'HTML',\n      icml: 'InDesign ICML',\n      ipynb: 'Jupyter notebook',\n      jats: 'JATS XML',\n      jira: 'Jira/Confluence wiki markup',\n      json: 'JSON version of native AST',\n      latex: 'LaTeX',\n      man: 'roff man',\n      markdown: \"Pandoc's Markdown\",\n      markdown_mmd: 'MultiMarkdown',\n      markdown_phpextra: 'PHP Markdown Extra',\n      markdown_strict: 'original unextended Markdown',\n      markua: 'Markua',\n      mdoc: 'mdoc manual page markup',\n      mediawiki: 'MediaWiki markup',\n      ms: 'roff ms',\n      muse: 'Muse',\n      native: 'native Haskell',\n      odt: 'OpenDocument text',\n      opendocument: 'OpenDocument XML',\n      opml: 'OPML',\n      org: 'Emacs Org mode',\n      pdf: 'PDF via Typst',\n      plain: 'plain text',\n      pod: 'Perl POD',\n      pptx: 'PowerPoint',\n      revealjs: 'reveal.js HTML slides',\n      ris: 'RIS bibliography',\n      rst: 'reStructuredText',\n      rtf: 'Rich Text Format',\n      s5: 'S5 HTML slides',\n      slideous: 'Slideous HTML slides',\n      slidy: 'Slidy HTML slides',\n      t2t: 'txt2tags',\n      tei: 'TEI Simple',\n      texinfo: 'GNU Texinfo',\n      textile: 'Textile',\n      tikiwiki: 'TikiWiki markup',\n      tsv: 'TSV table',\n      twiki: 'TWiki markup',\n      typst: 'Typst',\n      vimdoc: 'Vimdoc',\n      vimwiki: 'Vimwiki',\n      xlsx: 'Excel spreadsheet',\n      xml: 'XML version of native AST',\n      xwiki: 'XWiki markup',\n      zimwiki: 'ZimWiki markup'\n    },\n\n    // List of supported formats (populated when pandoc loads)\n    inputFormats: [],\n    outputFormats: [],\n    formatsLoaded: false,\n\n    // Format constants\n    formatByExtension: {\n      'md': 'markdown', 'markdown': 'markdown', 'mkd': 'markdown',\n      'html': 'html', 'htm': 'html',\n      'tex': 'latex', 'latex': 'latex',\n      'rst': 'rst', 'org': 'org', 'docx': 'docx', 'odt': 'odt',\n      'epub': 'epub', 'txt': 'markdown', 'json': 'json', 'ipynb': 'ipynb',\n      'xml': 'docbook', 'wiki': 'mediawiki', 'textile': 'textile',\n      'rtf': 'rtf', 'bib': 'bibtex', 'csv': 'csv', 'tsv': 'tsv',\n      'typ': 'typst', 'typst': 'typst', 'pptx': 'pptx'\n    },\n\n    extensionByFormat: {\n      'html': 'html', 'html5': 'html', 'html4': 'html', 'chunkedhtml': 'zip',\n      'markdown': 'md', 'markdown_strict': 'md', 'markdown_mmd': 'md', 'markdown_phpextra': 'md',\n      'gfm': 'md', 'commonmark': 'md', 'commonmark_x': 'md',\n      'latex': 'tex', 'beamer': 'tex', 'context': 'tex',\n      'pdf': 'pdf', 'docx': 'docx', 'odt': 'odt',\n      'epub': 'epub', 'epub2': 'epub', 'epub3': 'epub',\n      'rst': 'rst', 'org': 'org', 'plain': 'txt',\n      'json': 'json', 'native': 'native',\n      'docbook': 'xml', 'docbook4': 'xml', 'docbook5': 'xml',\n      'jats': 'xml', 'tei': 'xml', 'man': '1', 'rtf': 'rtf',\n      'textile': 'textile', 'mediawiki': 'wiki',\n      'asciidoc': 'adoc', 'asciidoctor': 'adoc', 'asciidoc_legacy': 'adoc',\n      'revealjs': 'html', 'slidy': 'html', 'slideous': 'html', 'dzslides': 'html', 's5': 'html',\n      'ipynb': 'ipynb', 'typst': 'typ', 'texinfo': 'texi', 'ms': 'ms', 'icml': 'icml',\n      'opml': 'opml', 'bibtex': 'bib', 'biblatex': 'bib', 'csljson': 'json',\n      'pptx': 'pptx', 'djot': 'dj', 'fb2': 'fb2', 'opendocument': 'xml', 'vimdoc': 'txt'\n    },\n\n    slideFormats: ['revealjs', 'slidy', 'slideous', 'dzslides', 's5', 'beamer', 'pptx'],\n    htmlFormats: ['html', 'html4', 'html5', 'revealjs', 'slidy', 'slideous', 'dzslides', 's5', 'epub', 'epub2', 'epub3', 'chunkedhtml'],\n    docFormats: ['docx', 'odt', 'pptx'],\n    binaryFormats: ['docx', 'odt', 'pptx', 'epub', 'epub2', 'epub3', 'pdf', 'chunkedhtml'],\n    markdownFormats: ['markdown', 'markdown_strict', 'markdown_mmd', 'markdown_phpextra', 'gfm', 'commonmark', 'commonmark_x'],\n    captionPositionFormats: ['html', 'html4', 'html5', 'latex', 'beamer', 'docx', 'odt', 'typst', 'pdf'],\n    asciiFormats: ['html', 'html4', 'html5', 'markdown', 'markdown_strict', 'markdown_mmd', 'markdown_phpextra', 'gfm', 'commonmark', 'commonmark_x', 'docbook', 'docbook4', 'docbook5', 'jats', 'man', 'ms', 'latex', 'beamer'],\n    topLevelDivisionFormats: ['latex', 'beamer', 'context', 'docbook', 'docbook4', 'docbook5', 'tei'],\n    listOfFormats: ['latex', 'beamer', 'context'],\n    latexCitationFormats: ['latex', 'beamer', 'context'],\n\n    // Template variables by category\n    templateVariablesByCategory: {\n      all: ['title', 'author', 'date', 'subtitle', 'abstract', 'abstract-title', 'keywords', 'subject', 'description', 'category', 'lang', 'dir', 'header-includes', 'include-before', 'include-after', 'toc-title'],\n      html: ['document-css', 'mainfont', 'fontsize', 'fontcolor', 'linkcolor', 'monofont', 'monobackgroundcolor', 'linestretch', 'maxwidth', 'backgroundcolor', 'margin-left', 'margin-right', 'margin-top', 'margin-bottom'],\n      htmlSlides: ['institute', 'revealjs-url', 's5-url', 'slidy-url', 'slideous-url', 'title-slide-attributes'],\n      beamer: ['aspectratio', 'beameroption', 'institute', 'logo', 'navigation', 'section-titles', 'theme', 'colortheme', 'fonttheme', 'innertheme', 'outertheme', 'themeoptions', 'titlegraphic'],\n      latex: ['block-headings', 'classoption', 'documentclass', 'geometry', 'hyperrefoptions', 'indent', 'linestretch', 'margin-left', 'margin-right', 'margin-top', 'margin-bottom', 'pagestyle', 'papersize', 'secnumdepth', 'fontenc', 'fontfamily', 'fontfamilyoptions', 'fontsize', 'mainfont', 'sansfont', 'monofont', 'mathfont', 'CJKmainfont', 'mainfontoptions', 'sansfontoptions', 'monofontoptions', 'colorlinks', 'linkcolor', 'filecolor', 'citecolor', 'urlcolor', 'toccolor', 'links-as-notes', 'lof', 'lot', 'thanks', 'toc-depth', 'biblatexoptions', 'biblio-style', 'biblio-title', 'natbiboptions'],\n      context: ['fontsize', 'headertext', 'footertext', 'indenting', 'interlinespace', 'layout', 'linkcolor', 'contrastcolor', 'linkstyle', 'lof', 'lot', 'mainfont', 'sansfont', 'monofont', 'mathfont', 'margin-left', 'margin-right', 'margin-top', 'margin-bottom', 'pagenumbering', 'papersize', 'whitespace'],\n      typst: ['papersize', 'mainfont', 'fontsize', 'section-numbering', 'page-numbering', 'columns', 'thanks', 'mathfont', 'codefont', 'linestretch', 'linkcolor', 'filecolor', 'citecolor', 'margin'],\n      ms: ['fontfamily', 'indent', 'lineheight', 'pointsize'],\n      man: ['adjusting', 'footer', 'header', 'section'],\n      epub: ['cover-image', 'epub-title-page'],\n      docx: ['reference-doc'],\n      pptx: ['monofont'],\n      odt: ['reference-doc']\n    },\n\n    // Format to variable categories mapping\n    formatVariableCategories: {\n      html: ['all', 'html'],\n      html4: ['all', 'html'],\n      html5: ['all', 'html'],\n      revealjs: ['all', 'html', 'htmlSlides'],\n      slidy: ['all', 'html', 'htmlSlides'],\n      slideous: ['all', 'html', 'htmlSlides'],\n      dzslides: ['all', 'html', 'htmlSlides'],\n      s5: ['all', 'html', 'htmlSlides'],\n      epub: ['all', 'html', 'epub'],\n      epub2: ['all', 'html', 'epub'],\n      epub3: ['all', 'html', 'epub'],\n      chunkedhtml: ['all', 'html'],\n      latex: ['all', 'latex'],\n      beamer: ['all', 'latex', 'beamer'],\n      context: ['all', 'context'],\n      typst: ['all', 'typst'],\n      pdf: ['all', 'typst'],\n      ms: ['all', 'ms'],\n      man: ['all', 'man'],\n      docx: ['all', 'docx'],\n      pptx: ['all', 'pptx'],\n      odt: ['all', 'odt'],\n      opendocument: ['all', 'odt']\n    },\n\n    // Computed-like getters\n    get canConvert() {\n      const hasInput = this.inputMode === 'file' ? this.fileOrder.length > 0 : this.textInput.trim().length > 0;\n      return hasInput && this.hasChanges;\n    },\n\n    get effectiveOutputFormat() {\n      if (this.outputFormat !== 'auto') return this.outputFormat;\n      const outFile = this.outputFilename.trim() || this.outputFilenamePlaceholder;\n      if (outFile && outFile !== '(preview)') {\n        const ext = outFile.split('.').pop().toLowerCase();\n        const formatByOutputExtension = {\n          'html': 'html', 'htm': 'html', 'md': 'markdown', 'markdown': 'markdown',\n          'tex': 'latex', 'pdf': 'pdf', 'docx': 'docx', 'odt': 'odt',\n          'epub': 'epub', 'rst': 'rst', 'org': 'org', 'txt': 'plain',\n          'json': 'json', 'native': 'native', 'xml': 'docbook', 'rtf': 'rtf',\n          'adoc': 'asciidoc', 'ipynb': 'ipynb', 'typ': 'typst', 'pptx': 'pptx',\n          'dj': 'djot', 'man': 'man', '1': 'man', 'ms': 'ms', 'texi': 'texinfo',\n          'icml': 'icml', 'opml': 'opml', 'bib': 'bibtex', 'wiki': 'mediawiki'\n        };\n        return formatByOutputExtension[ext] || 'html';\n      }\n      return 'html';\n    },\n\n    get outputFilenamePlaceholder() {\n      if (this.outputFormat !== 'auto') {\n        const outExt = this.extensionByFormat[this.outputFormat] || this.outputFormat;\n        if (this.fileOrder.length > 0) {\n          const baseName = this.fileOrder[0].replace(/\\.[^.]+$/, '');\n          return `${baseName}.${outExt}`;\n        }\n        return `output.${outExt}`;\n      }\n      return '(preview)';\n    },\n\n    get isHtmlFormat() { return this.htmlFormats.includes(this.effectiveOutputFormat); },\n    get isMarkdownFormat() { return this.markdownFormats.includes(this.effectiveOutputFormat); },\n    get isLatexLikeFormat() { return this.latexCitationFormats.includes(this.effectiveOutputFormat); },\n    get supportsCaptionPosition() { return this.captionPositionFormats.includes(this.effectiveOutputFormat); },\n    get supportsAscii() { return this.asciiFormats.includes(this.effectiveOutputFormat); },\n    get supportsTopLevelDivision() { return this.topLevelDivisionFormats.includes(this.effectiveOutputFormat); },\n    get supportsListOf() { return this.listOfFormats.includes(this.effectiveOutputFormat); },\n    get isBinaryOutput() { return this.binaryFormats.includes(this.effectiveOutputFormat); },\n    get filteredMessages() {\n      if (this.verbosity === 'error') {\n        return this.messages.filter(m => m.type === 'error');\n      } else if (this.verbosity === 'warning') {\n        return this.messages.filter(m => m.type === 'error' || m.type === 'warning');\n      }\n      return this.messages;\n    },\n\n    get suggestedVariables() {\n      const fmt = this.effectiveOutputFormat;\n      const categories = this.formatVariableCategories[fmt] || ['all'];\n      const vars = new Set();\n      for (const cat of categories) {\n        const catVars = this.templateVariablesByCategory[cat] || [];\n        for (const v of catVars) vars.add(v);\n      }\n      return Array.from(vars).sort();\n    },\n\n    get effectiveInputFormat() {\n      let inFmt = this.inputFormat;\n      if (inFmt === 'auto' && this.fileOrder.length > 0) {\n        const ext = this.fileOrder[0].split('.').pop().toLowerCase();\n        inFmt = this.formatByExtension[ext] || '';\n      }\n      return inFmt;\n    },\n\n    get showTrackChangesTab() {\n      return this.effectiveInputFormat === 'docx';\n    },\n\n    get showStripComments() {\n      const fmt = this.effectiveInputFormat;\n      return fmt === 'auto' || this.markdownFormats.includes(fmt) || fmt === 'textile';\n    },\n\n    get showDefaultImageExtension() {\n      const fmt = this.effectiveInputFormat;\n      return fmt === 'auto' || this.markdownFormats.includes(fmt) || fmt === 'latex';\n    },\n\n    get showAbbreviations() {\n      const fmt = this.effectiveInputFormat;\n      return fmt === 'auto' || fmt === 'markdown';\n    },\n\n    get showExtensionsTab() {\n      return (this.inputFormat !== 'auto' && this.inputExtensionsList.length > 0) ||\n        (this.outputFormat !== 'auto' && this.outputExtensionsList.length > 0);\n    },\n\n    get showFormatTab() {\n      const fmt = this.effectiveOutputFormat;\n      return this.showStripComments || this.showDefaultImageExtension || this.showAbbreviations ||\n        this.isHtmlFormat || this.isMarkdownFormat || fmt === 'rst' ||\n        ['latex', 'beamer'].includes(fmt) || ['typst', 'pdf'].includes(fmt) ||\n        this.supportsCaptionPosition || this.supportsAscii || this.supportsTopLevelDivision ||\n        this.supportsListOf || this.docFormats.includes(fmt);\n    },\n\n    get formatTabName() {\n      return 'Format-specific';\n    },\n\n    get isEpubFormat() { return ['epub', 'epub2', 'epub3'].includes(this.effectiveOutputFormat); },\n    get showChunkedTab() { return this.effectiveOutputFormat === 'chunkedhtml'; },\n    get showIpynbTab() { return this.effectiveOutputFormat === 'ipynb'; },\n    get showSlidesTab() { return this.slideFormats.includes(this.effectiveOutputFormat); },\n    get showReferenceDoc() { return this.docFormats.includes(this.effectiveOutputFormat); },\n\n    // Methods\n    getFormatLabel(fmt, direction) {\n      const name = this.formatNames[fmt] || fmt;\n      return `${fmt} (${name})`;\n    },\n\n    init() {\n      // Register callback to populate formats when pandoc loads\n      onFormatsLoaded = (inputFmts, outputFmts) => {\n        this.inputFormats = inputFmts;\n        this.outputFormats = outputFmts;\n        this.formatsLoaded = true;\n      };\n      console.log('Pandoc converter initialized (pandoc.wasm loading in background)');\n    },\n\n    async ensurePandocLoaded() {\n      if (this.pandocReady) return;\n      this.waitingForPandoc = true;\n      try {\n        await loadPandoc();\n        this.pandocReady = true;\n      } finally {\n        this.waitingForPandoc = false;\n      }\n    },\n\n    async loadExample() {\n      const zipPath = this.selectedExample;\n      if (!zipPath) return;\n\n      try {\n        // Fetch the example first\n        const response = await fetch(zipPath + \"?sha1=SHA1_EXAMPLES\");\n        const arrayBuffer = await response.arrayBuffer();\n\n        // Ensure pandoc is loaded before processing (which auto-converts)\n        await this.ensurePandocLoaded();\n\n        await this.loadExampleFromBuffer(arrayBuffer, zipPath.split('/').pop());\n      } catch (err) {\n        this.messages.push({ type: 'error', text: `Failed to load example: ${err.message}` });\n      }\n    },\n\n    async uploadExample(e) {\n      const file = e.target.files[0];\n      if (!file) return;\n\n      try {\n        const arrayBuffer = await file.arrayBuffer();\n        e.target.value = '';\n\n        // Ensure pandoc is loaded before processing (which auto-converts)\n        await this.ensurePandocLoaded();\n\n        await this.loadExampleFromBuffer(arrayBuffer, file.name);\n      } catch (err) {\n        this.showOutput = true;\n        this.messages.push({ type: 'error', text: `Failed to load example: ${err.message}` });\n      }\n    },\n\n    async loadExampleFromBuffer(arrayBuffer, filename) {\n      const zipData = fflate.unzipSync(new Uint8Array(arrayBuffer));\n\n      // Clear existing state\n      this.files = {};\n      this.fileOrder = [];\n      this.auxFiles = {};\n      this.textInput = '';\n      this.templateFile = null;\n      this.referenceDoc = null;\n      this.bibFile = null;\n      this.cslFile = null;\n      this.cslStyleName = '';\n      this.cssFiles = [];\n      this.headerFiles = [];\n      this.beforeBodyFiles = [];\n      this.afterBodyFiles = [];\n      this.highlightThemeFile = null;\n      this.syntaxDefinitions = [];\n      this.abbrevFile = null;\n      this.abbreviationsFile = null;\n      this.metadataFile = null;\n      this.epubCoverImage = null;\n      this.epubMetadataFile = null;\n      this.epubFonts = [];\n      this.luaFilters = [];\n\n      let optionsJson = null;\n      let stdinContent = null;\n      const extractedFiles = {};\n\n      // First pass: extract all files\n      for (const [name, data] of Object.entries(zipData)) {\n        if (name.endsWith('/') || data.length === 0) continue;\n        const fname = name.split('/').pop();\n\n        if (fname === 'options.json') {\n          const txt = fflate.strFromU8(data);\n          optionsJson = JSON.parse(txt);\n        } else if (fname === 'stdin') {\n          stdinContent = fflate.strFromU8(data);\n        } else {\n          extractedFiles[fname] = new File([data], fname);\n        }\n      }\n\n      // Helper to get file and remove from extractedFiles\n      const takeFile = (name) => {\n        if (name && extractedFiles[name]) {\n          const f = extractedFiles[name];\n          delete extractedFiles[name];\n          return f;\n        }\n        return null;\n      };\n\n      // Helper for arrays of filenames\n      const takeFiles = (names) => {\n        if (!names) return [];\n        const arr = Array.isArray(names) ? names : [names];\n        return arr.map(takeFile).filter(f => f);\n      };\n\n      // Route files based on options.json\n      if (optionsJson) {\n        // Template\n        this.templateFile = takeFile(optionsJson.template);\n\n        // Reference doc\n        this.referenceDoc = takeFile(optionsJson['reference-doc']);\n\n        // Bibliography\n        const bibFiles = takeFiles(optionsJson.bibliography);\n        if (bibFiles.length > 0) this.bibFile = bibFiles[0];\n\n        // CSL style\n        this.cslFile = takeFile(optionsJson.csl);\n\n        // CSS files\n        this.cssFiles = takeFiles(optionsJson.css);\n\n        // Include files\n        this.headerFiles = takeFiles(optionsJson['include-in-header']);\n        this.beforeBodyFiles = takeFiles(optionsJson['include-before-body']);\n        this.afterBodyFiles = takeFiles(optionsJson['include-after-body']);\n\n        // Highlight theme (if it's a file)\n        const hlStyle = optionsJson['highlight-style'];\n        if (hlStyle && extractedFiles[hlStyle]) {\n          this.highlightThemeFile = takeFile(hlStyle);\n          this.opts.highlightStyle = 'custom';\n        } else if (hlStyle) {\n          this.opts.highlightStyle = hlStyle;\n        }\n\n        // Syntax definitions\n        this.syntaxDefinitions = takeFiles(optionsJson['syntax-definition']);\n\n        // Abbreviations\n        this.abbrevFile = takeFile(optionsJson.abbreviations);\n\n        // Metadata file\n        this.metadataFile = takeFile(optionsJson['metadata-file']);\n\n        // EPUB cover image\n        this.epubCoverImage = takeFile(optionsJson['epub-cover-image']);\n\n        // EPUB fonts\n        this.epubFonts = takeFiles(optionsJson['epub-fonts']);\n\n        // Lua filters\n        this.luaFilters = takeFiles(optionsJson.filters);\n\n        // Input files go to main files area\n        const inputFileNames = optionsJson['input-files'];\n        if (inputFileNames) {\n          const inputArr = Array.isArray(inputFileNames) ? inputFileNames : [inputFileNames];\n          for (const name of inputArr) {\n            const f = takeFile(name);\n            if (f) {\n              this.files[name] = f;\n              this.fileOrder.push(name);\n            }\n          }\n        }\n\n        // Set input format\n        if (optionsJson.from) {\n          this.inputFormat = optionsJson.from.split(/[+-]/)[0];\n        }\n        // Set output format\n        if (optionsJson.to) {\n          this.outputFormat = optionsJson.to.split(/[+-]/)[0];\n        }\n        // Set standalone\n        if (optionsJson.standalone !== undefined) {\n          this.opts.standalone = optionsJson.standalone;\n        }\n        // Other options\n        if (optionsJson['wrap']) this.opts.wrap = optionsJson['wrap'];\n        if (optionsJson['table-of-contents']) this.opts.toc = true;\n        if (optionsJson['number-sections']) this.opts.numberSections = true;\n        if (optionsJson.citeproc) this.opts.citationMethod = 'citeproc';\n        if (optionsJson['embed-resources']) this.opts.selfContained = true;\n        if (optionsJson['mathml']) this.opts.mathMethod = 'mathml';\n      }\n\n      // Remaining files go to auxiliary files\n      for (const [name, file] of Object.entries(extractedFiles)) {\n        this.auxFiles[name] = file;\n      }\n\n      // Handle stdin content\n      if (stdinContent) {\n        this.inputMode = 'text';\n        this.textInput = stdinContent;\n      } else if (this.fileOrder.length > 0) {\n        this.inputMode = 'file';\n      }\n\n      // Auto-convert after loading example\n      await this.convert();\n\n      // Update extensions UI after conversion completes\n      this.onInputFormatChange();\n      this.onOutputFormatChange();\n    },\n\n    async downloadAsExample() {\n      const zipFiles = {};\n\n      // Build options for the example\n      const opts = {};\n      if (this.inputFormat !== 'auto') opts.from = this.inputFormat;\n      if (this.outputFormat !== 'auto') opts.to = this.outputFormat;\n      if (this.opts.standalone) opts.standalone = true;\n      if (this.opts.toc) opts['table-of-contents'] = true;\n      if (this.opts.numberSections) opts['number-sections'] = true;\n      if (this.opts.fileScope) opts['file-scope'] = true;\n      if (this.opts.citationMethod === 'citeproc') opts.citeproc = true;\n      if (this.opts.mathMethod === 'mathml') opts.mathml = true;\n      if (this.opts.selfContained) opts['embed-resources'] = true;\n      if (this.opts.highlightStyle && this.opts.highlightStyle !== 'custom') {\n        opts['highlight-style'] = this.opts.highlightStyle;\n      }\n\n      // Helper to add a file to the zip\n      const addFile = async (file, name) => {\n        const arrayBuffer = await file.arrayBuffer();\n        zipFiles[name] = new Uint8Array(arrayBuffer);\n      };\n\n      // Input files or stdin\n      if (this.inputMode === 'text' && this.textInput.trim()) {\n        zipFiles['stdin'] = fflate.strToU8(this.textInput);\n      } else if (this.inputMode === 'file' && this.fileOrder.length > 0) {\n        opts['input-files'] = this.fileOrder;\n        for (const name of this.fileOrder) {\n          if (this.files[name]) await addFile(this.files[name], name);\n        }\n      }\n\n      // Auxiliary files\n      for (const [name, file] of Object.entries(this.auxFiles)) {\n        await addFile(file, name);\n      }\n\n      // Resource files\n      if (this.templateFile) {\n        opts.template = this.templateFile.name;\n        await addFile(this.templateFile, this.templateFile.name);\n      }\n      if (this.referenceDoc) {\n        opts['reference-doc'] = this.referenceDoc.name;\n        await addFile(this.referenceDoc, this.referenceDoc.name);\n      }\n      if (this.bibFile) {\n        opts.bibliography = this.bibFile.name;\n        await addFile(this.bibFile, this.bibFile.name);\n      }\n      if (this.cslFile) {\n        opts.csl = this.cslFile.name;\n        await addFile(this.cslFile, this.cslFile.name);\n      }\n      if (this.abbrevFile) {\n        opts['citation-abbreviations'] = this.abbrevFile.name;\n        await addFile(this.abbrevFile, this.abbrevFile.name);\n      }\n      if (this.abbreviationsFile) {\n        opts.abbreviations = this.abbreviationsFile.name;\n        await addFile(this.abbreviationsFile, this.abbreviationsFile.name);\n      }\n      if (this.metadataFile) {\n        opts['metadata-file'] = this.metadataFile.name;\n        await addFile(this.metadataFile, this.metadataFile.name);\n      }\n      if (this.highlightThemeFile) {\n        opts['highlight-style'] = this.highlightThemeFile.name;\n        await addFile(this.highlightThemeFile, this.highlightThemeFile.name);\n      }\n      if (this.cssFiles.length > 0) {\n        opts.css = this.cssFiles.map(f => f.name);\n        for (const file of this.cssFiles) await addFile(file, file.name);\n      }\n      if (this.syntaxDefinitions.length > 0) {\n        opts['syntax-definition'] = this.syntaxDefinitions.map(f => f.name);\n        for (const file of this.syntaxDefinitions) await addFile(file, file.name);\n      }\n      if (this.headerFiles.length > 0) {\n        opts['include-in-header'] = this.headerFiles.map(f => f.name);\n        for (const file of this.headerFiles) await addFile(file, file.name);\n      }\n      if (this.beforeBodyFiles.length > 0) {\n        opts['include-before-body'] = this.beforeBodyFiles.map(f => f.name);\n        for (const file of this.beforeBodyFiles) await addFile(file, file.name);\n      }\n      if (this.afterBodyFiles.length > 0) {\n        opts['include-after-body'] = this.afterBodyFiles.map(f => f.name);\n        for (const file of this.afterBodyFiles) await addFile(file, file.name);\n      }\n      if (this.epubCoverImage) {\n        opts['epub-cover-image'] = this.epubCoverImage.name;\n        await addFile(this.epubCoverImage, this.epubCoverImage.name);\n      }\n      if (this.epubFonts.length > 0) {\n        opts['epub-fonts'] = this.epubFonts.map(f => f.name);\n        for (const file of this.epubFonts) await addFile(file, file.name);\n      }\n      if (this.luaFilters.length > 0) {\n        opts.filters = this.luaFilters.map(f => f.name);\n        for (const file of this.luaFilters) await addFile(file, file.name);\n      }\n\n      // Add options.json\n      zipFiles['options.json'] = fflate.strToU8(JSON.stringify(opts, null, 2));\n\n      // Create zip and download\n      const zipData = fflate.zipSync(zipFiles);\n      const blob = new Blob([zipData], { type: 'application/zip' });\n      const url = URL.createObjectURL(blob);\n      const a = document.createElement('a');\n      a.href = url;\n      a.download = 'example.zip';\n      document.body.appendChild(a);\n      a.click();\n      document.body.removeChild(a);\n      URL.revokeObjectURL(url);\n    },\n\n    formatFileSize(bytes) {\n      if (bytes < 1024) return bytes + ' B';\n      if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';\n      return (bytes / (1024 * 1024)).toFixed(1) + ' MB';\n    },\n\n    downloadFile(file, name) {\n      const url = URL.createObjectURL(file);\n      const a = document.createElement('a');\n      a.href = url;\n      a.download = name;\n      document.body.appendChild(a);\n      a.click();\n      document.body.removeChild(a);\n      URL.revokeObjectURL(url);\n    },\n\n    handleDrop(e) {\n      this.dragOver = false;\n      this.handleFiles(Array.from(e.dataTransfer.files));\n    },\n\n    handleFileInput(e) {\n      this.handleFiles(Array.from(e.target.files));\n      e.target.value = '';\n    },\n\n    handleFiles(fileList) {\n      fileList.forEach(file => {\n        if (!this.files[file.name]) {\n          this.fileOrder.push(file.name);\n        }\n        this.files[file.name] = file;\n      });\n      this.updateExtensions();\n      this.hasChanges = true;\n    },\n\n    removeFile(name) {\n      delete this.files[name];\n      this.fileOrder = this.fileOrder.filter(n => n !== name);\n      this.hasChanges = true;\n    },\n\n    onFileDragStart(idx, e) {\n      this.fileDraggingIdx = idx;\n      e.dataTransfer.effectAllowed = 'move';\n    },\n\n    onFileDragOver(idx) {\n      this.fileDragOverIdx = idx;\n    },\n\n    onFileDrop(idx) {\n      this.fileDragOverIdx = -1;\n      if (this.fileDraggingIdx !== -1 && this.fileDraggingIdx !== idx) {\n        const draggedName = this.fileOrder[this.fileDraggingIdx];\n        this.fileOrder.splice(this.fileDraggingIdx, 1);\n        this.fileOrder.splice(idx, 0, draggedName);\n        this.hasChanges = true;\n      }\n    },\n\n    handleAuxFiles(e) {\n      Array.from(e.target.files).forEach(file => { this.auxFiles[file.name] = file; });\n      e.target.value = '';\n      this.hasChanges = true;\n    },\n\n    handleAuxDir(e) {\n      Array.from(e.target.files).forEach(file => {\n        const path = file.webkitRelativePath || file.name;\n        this.auxFiles[path] = file;\n      });\n      e.target.value = '';\n      this.hasChanges = true;\n    },\n\n    removeAuxFile(name) { delete this.auxFiles[name]; this.hasChanges = true; },\n\n    // Resource file handlers\n    handleBibFile(e) { if (e.target.files[0]) { this.bibFile = e.target.files[0]; this.hasChanges = true; } },\n    handleCslFile(e) { if (e.target.files[0]) { this.cslFile = e.target.files[0]; this.cslStyleName = ''; this.hasChanges = true; } },\n    handleAbbrevFile(e) { if (e.target.files[0]) { this.abbrevFile = e.target.files[0]; this.hasChanges = true; } },\n    handleAbbreviationsFile(e) { if (e.target.files[0]) { this.abbreviationsFile = e.target.files[0]; this.hasChanges = true; } },\n    handleHighlightTheme(e) { if (e.target.files[0]) { this.highlightThemeFile = e.target.files[0]; this.hasChanges = true; } },\n    handleTemplateFile(e) { if (e.target.files[0]) { this.templateFile = e.target.files[0]; this.hasChanges = true; } },\n    handleReferenceDoc(e) { if (e.target.files[0]) { this.referenceDoc = e.target.files[0]; this.hasChanges = true; } },\n    handleMetadataFile(e) { if (e.target.files[0]) { this.metadataFile = e.target.files[0]; this.hasChanges = true; } },\n    handleEpubCover(e) { if (e.target.files[0]) { this.epubCoverImage = e.target.files[0]; this.hasChanges = true; } },\n    handleEpubMetadata(e) { if (e.target.files[0]) { this.epubMetadataFile = e.target.files[0]; this.hasChanges = true; } },\n\n    // Generic file list handlers\n    addFilesToList(e, list) {\n      Array.from(e.target.files).forEach(file => {\n        if (!list.find(f => f.name === file.name)) list.push(file);\n      });\n      e.target.value = '';\n      this.hasChanges = true;\n    },\n    removeFileFromList(name, list) {\n      const idx = list.findIndex(f => f.name === name);\n      if (idx !== -1) list.splice(idx, 1);\n      this.hasChanges = true;\n    },\n\n    handleCssFiles(e) { this.addFilesToList(e, this.cssFiles); },\n    removeCssFile(name) { this.removeFileFromList(name, this.cssFiles); },\n    handleSyntaxDefs(e) { this.addFilesToList(e, this.syntaxDefinitions); },\n    removeSyntaxDef(name) { this.removeFileFromList(name, this.syntaxDefinitions); },\n    handleEpubFonts(e) { this.addFilesToList(e, this.epubFonts); },\n    removeEpubFont(name) { this.removeFileFromList(name, this.epubFonts); },\n    handleHeaderFiles(e) { this.addFilesToList(e, this.headerFiles); },\n    removeHeaderFile(name) { this.removeFileFromList(name, this.headerFiles); },\n    handleBeforeBodyFiles(e) { this.addFilesToList(e, this.beforeBodyFiles); },\n    removeBeforeBodyFile(name) { this.removeFileFromList(name, this.beforeBodyFiles); },\n    handleAfterBodyFiles(e) { this.addFilesToList(e, this.afterBodyFiles); },\n    removeAfterBodyFile(name) { this.removeFileFromList(name, this.afterBodyFiles); },\n    handleLuaFilters(e) { this.addFilesToList(e, this.luaFilters); },\n    removeLuaFilter(name) { this.removeFileFromList(name, this.luaFilters); },\n\n    onFilterDragStart(idx, e) {\n      this.filterDraggingIdx = idx;\n      e.dataTransfer.effectAllowed = 'move';\n    },\n\n    onFilterDragOver(idx) {\n      this.filterDragOverIdx = idx;\n    },\n\n    onFilterDrop(idx) {\n      this.filterDragOverIdx = -1;\n      if (this.filterDraggingIdx !== -1 && this.filterDraggingIdx !== idx) {\n        const draggedFilter = this.luaFilters[this.filterDraggingIdx];\n        this.luaFilters.splice(this.filterDraggingIdx, 1);\n        this.luaFilters.splice(idx, 0, draggedFilter);\n        this.hasChanges = true;\n      }\n    },\n\n    // Metadata auto-add row\n    onMetadataInput() {\n      const last = this.customMetadata[this.customMetadata.length - 1];\n      if (last && (last.key || last.value)) {\n        this.customMetadata.push({ key: '', value: '' });\n      }\n      this.hasChanges = true;\n    },\n    removeMetadata(idx) {\n      this.customMetadata.splice(idx, 1);\n      if (this.customMetadata.length === 0) {\n        this.customMetadata.push({ key: '', value: '' });\n      }\n      this.hasChanges = true;\n    },\n\n    // Variables auto-add row\n    onVariableInput() {\n      const last = this.customVariables[this.customVariables.length - 1];\n      if (last && (last.key || last.value)) {\n        this.customVariables.push({ key: '', value: '' });\n      }\n      this.hasChanges = true;\n    },\n    removeVariable(idx) {\n      this.customVariables.splice(idx, 1);\n      if (this.customVariables.length === 0) {\n        this.customVariables.push({ key: '', value: '' });\n      }\n      this.hasChanges = true;\n    },\n\n    // CSL styles\n    async loadCslStyles() {\n      if (this.cslStylesLoaded) return;\n      try {\n        const response = await fetch('https://data.jsdelivr.com/v1/package/gh/citation-style-language/styles@master/flat');\n        if (!response.ok) throw new Error('Failed to fetch styles list');\n        const data = await response.json();\n        this.cslStylesList = data.files\n          .map(f => f.name)\n          .filter(name => name.endsWith('.csl') && name.lastIndexOf('/') === 0)\n          .map(name => name.slice(1, -4))\n          .sort();\n        this.cslStylesLoaded = true;\n      } catch (err) {\n        console.error('Failed to load CSL styles list:', err);\n        this.cslStylesList = ['apa', 'chicago-author-date', 'ieee', 'modern-language-association', 'vancouver', 'harvard-cite-them-right', 'nature', 'science'];\n      }\n    },\n\n    async fetchCslStyle() {\n      if (!this.cslStyleName.trim()) {\n        alert('Please enter or select a style name');\n        return;\n      }\n      try {\n        const url = `https://cdn.jsdelivr.net/gh/citation-style-language/styles@master/${this.cslStyleName}.csl`;\n        const response = await fetch(url);\n        if (!response.ok) throw new Error(`Style \"${this.cslStyleName}\" not found`);\n        const cslContent = await response.text();\n        const blob = new Blob([cslContent], { type: 'application/xml' });\n        this.cslFile = new File([blob], `${this.cslStyleName}.csl`, { type: 'application/xml' });\n        this.hasChanges = true;\n      } catch (err) {\n        alert(`Failed to fetch style: ${err.message}`);\n      }\n    },\n\n    // Extensions\n    async updateExtensions() {\n      this.inputExtensions = {};\n      this.outputExtensions = {};\n      this.inputExtensionsList = [];\n      this.outputExtensionsList = [];\n\n      if (this.inputFormat !== 'auto') {\n        try {\n          const extData = await window.pandocModule.query({ query: \"extensions-for-format\", format: this.inputFormat });\n          this.inputExtensionsList = Object.entries(extData)\n            .map(([name, defaultOn]) => ({ name, defaultOn }))\n            .sort((a, b) => a.name.localeCompare(b.name));\n        } catch (e) { console.warn('Could not get input extensions:', e); }\n      }\n\n      const outFmt = this.outputFormat === 'pdf' ? 'typst' : this.outputFormat;\n      if (outFmt !== 'auto') {\n        try {\n          const extData = await window.pandocModule.query({ query: \"extensions-for-format\", format: outFmt});\n          this.outputExtensionsList = Object.entries(extData)\n            .map(([name, defaultOn]) => ({ name, defaultOn }))\n            .sort((a, b) => a.name.localeCompare(b.name));\n        } catch (e) { console.warn('Could not get output extensions:', e); }\n      }\n    },\n\n    getExtensionChecked(direction, ext) {\n      const extState = direction === 'input' ? this.inputExtensions : this.outputExtensions;\n      if (extState[ext.name] !== undefined) return extState[ext.name];\n      return ext.defaultOn;\n    },\n\n    toggleExtension(direction, ext, e) {\n      const extState = direction === 'input' ? this.inputExtensions : this.outputExtensions;\n      if (e.target.checked) {\n        extState[ext.name] = true;\n      } else {\n        if (ext.defaultOn) {\n          extState[ext.name] = false;\n        } else {\n          delete extState[ext.name];\n        }\n      }\n    },\n\n    onInputFormatChange() { this.updateExtensions(); },\n    onOutputFormatChange() { this.updateExtensions(); },\n\n    buildFormatWithExtensions(baseFormat, extensions) {\n      if (!baseFormat || baseFormat === 'auto') return baseFormat;\n      let formatStr = baseFormat;\n      for (const [ext, enabled] of Object.entries(extensions)) {\n        if (enabled === true) formatStr += `+${ext}`;\n        else if (enabled === false) formatStr += `-${ext}`;\n      }\n      return formatStr;\n    },\n\n    buildOptions() {\n      const opts = {};\n\n      // Input format\n      if (this.inputFormat !== 'auto') {\n        opts.from = this.buildFormatWithExtensions(this.inputFormat, this.inputExtensions);\n      } else if (this.inputMode === 'file' && this.fileOrder.length > 0) {\n        const ext = this.fileOrder[0].split('.').pop().toLowerCase();\n        if (this.formatByExtension[ext]) {\n          opts.from = this.buildFormatWithExtensions(this.formatByExtension[ext], this.inputExtensions);\n        }\n      }\n\n      // Output format\n      if (this.outputFormat !== 'auto') {\n        opts.to = this.buildFormatWithExtensions(this.outputFormat, this.outputExtensions);\n      }\n\n      // Output file\n      let finalOutFile = this.outputFilename.trim() || this.outputFilenamePlaceholder;\n      if (!finalOutFile || finalOutFile === '(preview)') {\n        const effectiveFmt = this.effectiveOutputFormat || 'html';\n        const defaultExt = this.extensionByFormat[effectiveFmt] || 'html';\n        finalOutFile = `output.${defaultExt}`;\n      }\n      opts['output-file'] = finalOutFile;\n      this.outputFilenameActual = finalOutFile;\n\n      // Input files\n      if (this.inputMode === 'file') {\n        opts['input-files'] = this.fileOrder;\n      }\n\n      // General options\n      if (this.opts.standalone) opts.standalone = true;\n      if (this.opts.toc) {\n        opts['table-of-contents'] = true;\n        opts['toc-depth'] = parseInt(this.opts.tocDepth);\n      }\n      if (this.opts.numberSections) opts['number-sections'] = true;\n      if (this.opts.fileScope) opts['file-scope'] = true;\n      const shiftHeading = parseInt(this.opts.shiftHeading);\n      if (shiftHeading !== 0) opts['shift-heading-level-by'] = shiftHeading;\n      if (this.opts.preserveTabs) opts['preserve-tabs'] = true;\n      const tabStop = parseInt(this.opts.tabStop);\n      if (tabStop !== 4) opts['tab-stop'] = tabStop;\n      if (this.opts.eol) opts.eol = this.opts.eol;\n      if (this.opts.dpi) opts.dpi = parseInt(this.opts.dpi);\n      if (this.opts.numberOffset.trim()) {\n        opts['number-offset'] = this.opts.numberOffset.trim().split(',').map(n => parseInt(n.trim()) || 0);\n      }\n      if (this.opts.resourcePath.trim()) opts['resource-path'] = this.opts.resourcePath.trim();\n      if (this.opts.stripComments) opts['strip-comments'] = true;\n      if (this.opts.defaultImageExtension.trim()) opts['default-image-extension'] = this.opts.defaultImageExtension.trim();\n      if (this.abbreviationsFile) opts.abbreviations = this.abbreviationsFile.name;\n\n      // Track changes\n      if (this.opts.trackChanges) opts['track-changes'] = this.opts.trackChanges;\n\n      // Citations\n      if (this.opts.citationMethod === 'citeproc') opts.citeproc = true;\n      else if (this.opts.citationMethod === 'natbib') opts.natbib = true;\n      else if (this.opts.citationMethod === 'biblatex') opts.biblatex = true;\n      if (this.bibFile) opts.bibliography = this.bibFile.name;\n      if (this.opts.citationMethod === 'citeproc') {\n        if (this.cslFile) opts.csl = this.cslFile.name;\n        if (this.abbrevFile) opts['citation-abbreviations'] = this.abbrevFile.name;\n      }\n\n      // Math\n      if (this.opts.mathMethod) opts['html-math-method'] = this.opts.mathMethod;\n\n      // Code highlighting\n      if (this.opts.highlightStyle === 'custom' && this.highlightThemeFile) {\n        opts['highlight-style'] = this.highlightThemeFile.name;\n      } else if (this.opts.highlightStyle && this.opts.highlightStyle !== 'custom') {\n        opts['highlight-style'] = this.opts.highlightStyle;\n      }\n      if (this.syntaxDefinitions.length > 0) {\n        opts['syntax-definition'] = this.syntaxDefinitions.map(f => f.name);\n      }\n      if (this.opts.indentedCodeClasses.trim()) {\n        opts['indented-code-classes'] = this.opts.indentedCodeClasses.trim();\n      }\n\n      const baseOutFmt = this.effectiveOutputFormat;\n\n      // HTML options\n      if (this.htmlFormats.includes(baseOutFmt)) {\n        if (this.opts.selfContained) opts['embed-resources'] = true;\n        if (this.opts.htmlQTags) opts['html-q-tags'] = true;\n        if (this.opts.sectionDivs) opts['section-divs'] = true;\n        if (this.opts.titlePrefix.trim()) opts['title-prefix'] = this.opts.titlePrefix.trim();\n        if (this.opts.emailObfuscation) opts['email-obfuscation'] = this.opts.emailObfuscation;\n        if (this.opts.idPrefix.trim()) opts['id-prefix'] = this.opts.idPrefix.trim();\n        if (this.cssFiles.length > 0) opts.css = this.cssFiles.map(f => f.name);\n      }\n\n      // Markdown options\n      if (this.markdownFormats.includes(baseOutFmt)) {\n        if (this.opts.referenceLinks) opts['reference-links'] = true;\n        if (this.opts.referenceLocation) opts['reference-location'] = this.opts.referenceLocation;\n        if (this.opts.markdownHeadings) opts['markdown-headings'] = this.opts.markdownHeadings;\n      }\n\n      // RST options\n      if (baseOutFmt === 'rst') {\n        if (this.opts.referenceLinksRst) opts['reference-links'] = true;\n        if (this.opts.listTables) opts['list-tables'] = true;\n      }\n\n      // Caption position\n      if (this.captionPositionFormats.includes(baseOutFmt)) {\n        if (this.opts.figureCaptionPosition) opts['figure-caption-position'] = this.opts.figureCaptionPosition;\n        if (this.opts.tableCaptionPosition) opts['table-caption-position'] = this.opts.tableCaptionPosition;\n      }\n\n      // ASCII\n      if (this.asciiFormats.includes(baseOutFmt)) {\n        const asciiChecked = this.htmlFormats.includes(baseOutFmt) ? this.opts.asciiHtml : this.opts.ascii;\n        if (asciiChecked) opts.ascii = true;\n      }\n\n      // List of figures/tables\n      if (this.listOfFormats.includes(baseOutFmt)) {\n        if (this.opts.lof) opts['list-of-figures'] = true;\n        if (this.opts.lot) opts['list-of-tables'] = true;\n      }\n\n      // Top-level division\n      if (this.topLevelDivisionFormats.includes(baseOutFmt) && this.opts.topLevelDivision) {\n        opts['top-level-division'] = this.opts.topLevelDivision;\n      }\n\n      // EPUB options\n      if (['epub', 'epub2', 'epub3'].includes(baseOutFmt)) {\n        if (this.epubCoverImage) opts['epub-cover-image'] = this.epubCoverImage.name;\n        if (this.epubMetadataFile) opts['epub-metadata'] = this.epubMetadataFile.name;\n        if (this.epubFonts.length > 0) opts['epub-fonts'] = this.epubFonts.map(f => f.name);\n        if (!this.opts.epubTitlePage) opts['epub-title-page'] = false;\n        if (this.opts.epubSubdirectory.trim()) opts['epub-subdirectory'] = this.opts.epubSubdirectory.trim();\n      }\n\n      // ODT options\n      if (baseOutFmt === 'odt') {\n        if (this.opts.linkImages) opts['link-images'] = true;\n      }\n\n      // Template\n      if (this.templateFile) opts.template = this.templateFile.name;\n\n      // Include files\n      if (this.headerFiles.length > 0) opts['include-in-header'] = this.headerFiles.map(f => f.name);\n      if (this.beforeBodyFiles.length > 0) opts['include-before-body'] = this.beforeBodyFiles.map(f => f.name);\n      if (this.afterBodyFiles.length > 0) opts['include-after-body'] = this.afterBodyFiles.map(f => f.name);\n\n      // Variables\n      const variables = {};\n      this.customVariables.forEach(v => {\n        if (v.key.trim() && v.value.trim()) variables[v.key.trim()] = v.value.trim();\n      });\n      if (Object.keys(variables).length > 0) opts.variables = variables;\n\n      // Chunked HTML\n      if (baseOutFmt === 'chunkedhtml') {\n        if (this.opts.splitLevel) opts['split-level'] = parseInt(this.opts.splitLevel);\n        if (this.opts.chunkTemplate.trim()) opts['chunk-template'] = this.opts.chunkTemplate.trim();\n      }\n\n      // Notebook\n      if (baseOutFmt === 'ipynb' && this.opts.ipynbOutput) {\n        opts['ipynb-output'] = this.opts.ipynbOutput;\n      }\n\n      // Reference doc\n      if (this.docFormats.includes(baseOutFmt) && this.referenceDoc) {\n        opts['reference-doc'] = this.referenceDoc.name;\n      }\n\n      // Slides\n      if (this.slideFormats.includes(baseOutFmt)) {\n        if (this.opts.slideLevel) opts['slide-level'] = parseInt(this.opts.slideLevel);\n        if (this.opts.incremental) opts.incremental = true;\n      }\n\n      // Metadata file\n      if (this.metadataFile) opts['metadata-file'] = this.metadataFile.name;\n\n      // Metadata\n      const metadata = {};\n      this.customMetadata.forEach(m => {\n        if (m.key.trim() && m.value.trim()) {\n          const key = m.key.trim();\n          const value = m.value.trim();\n          // author should be an array\n          if (key === 'author') {\n            metadata[key] = [value];\n          } else {\n            metadata[key] = value;\n          }\n        }\n      });\n      if (Object.keys(metadata).length > 0) opts.metadata = metadata;\n\n      // Wrapping\n      if (this.opts.wrap !== 'auto') opts.wrap = this.opts.wrap;\n      if (this.opts.columns.trim()) opts.columns = parseInt(this.opts.columns);\n\n      // Extract media\n      if (this.opts.extractMedia) opts['extract-media'] = 'media.zip';\n\n      // Lua filters\n      if (this.luaFilters.length > 0) {\n        opts.filters = this.luaFilters.map(f => f.name);\n      }\n\n      return opts;\n    },\n\n    async convert() {\n      // Ensure pandoc is loaded before converting\n      await this.ensurePandocLoaded();\n\n      this.isConverting = true;\n      this.showOutput = false;\n      this.messages = [];\n      this.output = null;\n      this.outputPreview = '';\n      this.mediaZip = null;\n\n      try {\n        const options = this.buildOptions();\n\n        // Build files object\n        const files = { ...this.files, ...this.auxFiles };\n        if (this.bibFile) files[this.bibFile.name] = this.bibFile;\n        if (this.cslFile) files[this.cslFile.name] = this.cslFile;\n        if (this.abbrevFile) files[this.abbrevFile.name] = this.abbrevFile;\n        if (this.abbreviationsFile) files[this.abbreviationsFile.name] = this.abbreviationsFile;\n        this.cssFiles.forEach(file => { files[file.name] = file; });\n        if (this.highlightThemeFile) files[this.highlightThemeFile.name] = this.highlightThemeFile;\n        this.syntaxDefinitions.forEach(file => { files[file.name] = file; });\n        if (this.templateFile) files[this.templateFile.name] = this.templateFile;\n        if (this.referenceDoc) files[this.referenceDoc.name] = this.referenceDoc;\n        if (this.metadataFile) files[this.metadataFile.name] = this.metadataFile;\n        if (this.epubCoverImage) files[this.epubCoverImage.name] = this.epubCoverImage;\n        if (this.epubMetadataFile) files[this.epubMetadataFile.name] = this.epubMetadataFile;\n        this.epubFonts.forEach(font => { files[font.name] = font; });\n        this.headerFiles.forEach(file => { files[file.name] = file; });\n        this.beforeBodyFiles.forEach(file => { files[file.name] = file; });\n        this.afterBodyFiles.forEach(file => { files[file.name] = file; });\n        this.luaFilters.forEach(file => { files[file.name] = file; });\n\n        const stdin = this.inputMode === 'text' ? this.textInput : null;\n        const isPdfTypst = this.outputFormat === 'pdf';\n\n        if (isPdfTypst) {\n          await window.loadTypst();\n          const typstOptions = { ...options };\n          typstOptions.to = this.buildFormatWithExtensions('typst', this.outputExtensions);\n          typstOptions.standalone = true;\n          delete typstOptions['output-file'];\n\n          const typstResult = await window.pandocModule.convert(typstOptions, stdin, files);\n          if (typstResult.stderr && typstResult.stderr.includes('ERROR')) {\n            throw new Error(typstResult.stderr);\n          }\n\n          const typstContent = typstResult.stdout;\n          let pdfData;\n          try {\n            $typst.resetShadow();\n            for (const [path, file] of Object.entries(files)) {\n              const arrayBuffer = await file.arrayBuffer();\n              const uint8Array = new Uint8Array(arrayBuffer);\n              $typst.mapShadow('/' + path, uint8Array);\n              if (!path.startsWith('/')) $typst.mapShadow(path, uint8Array);\n            }\n            const mainTypstPath = '/main.typ';\n            const typstBytes = new TextEncoder().encode(typstContent);\n            $typst.mapShadow(mainTypstPath, typstBytes);\n            pdfData = await $typst.pdf({ mainFilePath: mainTypstPath });\n          } catch (typstError) {\n            const errorStr = String(typstError);\n            const messageMatch = errorStr.match(/message:\\s*\"([^\"]+)\"/);\n            let errorMsg = messageMatch ? messageMatch[1] : errorStr;\n            throw new Error(`Typst: ${errorMsg}`);\n          }\n\n          if (!pdfData || pdfData.length === 0) {\n            throw new Error('Typst produced empty PDF output');\n          }\n\n          const pdfBlob = new Blob([pdfData], { type: 'application/pdf' });\n          this.output = pdfBlob;\n          this.displayResults(typstResult, options, files);\n        } else {\n          const result = await window.pandocModule.convert(options, stdin, files);\n          this.displayResults(result, options, files);\n        }\n      } catch (err) {\n        this.showOutput = true;\n        this.messages.push({ type: 'error', text: `Conversion failed: ${err.message}` });\n      } finally {\n        this.isConverting = false;\n      }\n    },\n\n    displayResults(result, options, files) {\n      this.showOutput = true;\n\n      if (result.warnings && result.warnings.length > 0) {\n        result.warnings.forEach(w => {\n          const msgType = w.verbosity === 'INFO' ? 'info' : 'warning';\n          this.messages.push({ type: msgType, text: w.pretty || w.message || JSON.stringify(w) });\n        });\n      }\n\n      if (result.stderr && result.stderr.includes('ERROR')) {\n        this.messages.push({ type: 'error', text: result.stderr });\n        return;\n      }\n\n      const isBinary = this.binaryFormats.includes(options.to);\n\n      if (this.output) {\n        // Already set (e.g., pdf via typst)\n      } else if (options['output-file'] && files[options['output-file']]) {\n        this.output = files[options['output-file']];\n        if (!isBinary) {\n          const reader = new FileReader();\n          reader.onload = () => {\n            this.outputPreview = reader.result.substring(0, 50000);\n            if (reader.result.length > 50000) {\n              this.outputPreview += '\\n\\n... (truncated)';\n            }\n          };\n          reader.readAsText(this.output);\n        }\n      } else if (result.stdout) {\n        this.output = new Blob([result.stdout], { type: 'text/plain' });\n        if (!isBinary) {\n          this.outputPreview = result.stdout;\n        }\n      }\n\n      // Check for extracted media\n      if (files['media.zip'] && files['media.zip'].size > 0) {\n        this.mediaZip = files['media.zip'];\n      }\n\n      // Disable convert button until next change\n      this.hasChanges = false;\n    },\n\n    download() {\n      if (!this.output) return;\n      const url = URL.createObjectURL(this.output);\n      const a = document.createElement('a');\n      a.href = url;\n      a.download = this.outputFilenameActual || 'output';\n      a.click();\n      URL.revokeObjectURL(url);\n    },\n\n    downloadMedia() {\n      if (!this.mediaZip) return;\n      const url = URL.createObjectURL(this.mediaZip);\n      const a = document.createElement('a');\n      a.href = url;\n      a.download = 'media.zip';\n      a.click();\n      URL.revokeObjectURL(url);\n    },\n\n    async copyToClipboard() {\n      try {\n        await navigator.clipboard.writeText(this.outputPreview);\n        this.copyBtnText = '✓ Copied!';\n        setTimeout(() => { this.copyBtnText = '📋 Copy to Clipboard'; }, 2000);\n      } catch (err) {\n        this.messages.push({ type: 'error', text: 'Failed to copy to clipboard' });\n      }\n    }\n  };\n};\n\n// Mount Petite Vue after module loads (pandoc.wasm is ready)\n// Using mount() without selector scans DOM for v-scope attributes\nPetiteVue.createApp().mount();\n"
  },
  {
    "path": "wasm/pandoc.js",
    "content": "/* pandoc.js: JavaScript interface to pandoc.wasm.\n   Copyright (c) 2025 Tweag I/O Limited and John MacFarlane. MIT License.\n\n   Interface:\n\n   await convert(options, stdin, files)\n\n   - options is a JavaScript object representing pandoc options: this should\n     correspond to the format used in pandoc's default files.\n   - stdin is a string or nil\n   - files is a JavaScript object whose keys are filenames and whose values\n     are the data in the corresponding file, as Blobs.\n\n   The return value is a JavaScript object with 3 properties, stdout,\n   stderr, and warnings, all strings. warnings is a JSON-encoded\n   version of the warnings produced by pandoc. If the pandoc process\n   produces an output file, it will be added to files.\n\n   await query(options)\n\n    - options is a JavaScript object with a 'query' property and in\n      some cases a 'format' property. Possible queries include\n      'version', 'highlight-styles', 'highlight-languages', 'input-formats',\n      'output-formats', 'default-template' (requires 'format'),\n      and 'extensions-for-format' (requires 'format').\n\n   The return value is a JavaScript string or in some cases a list\n   of strings.\n*/\n\nimport {\n  WASI,\n  OpenFile,\n  File,\n  ConsoleStdout,\n  PreopenDirectory,\n} from \"https://cdn.jsdelivr.net/npm/@bjorn3/browser_wasi_shim@0.3.0/dist/index.js\";\n\nconst args = [\"pandoc.wasm\", \"+RTS\", \"-H64m\", \"-RTS\"];\nconst env = [];\nconst in_file = new File(new Uint8Array(), { readonly: true });\nconst out_file = new File(new Uint8Array(), { readonly: false });\nconst err_file = new File(new Uint8Array(), { readonly: false });\nconst warnings_file = new File(new Uint8Array(), { readonly: false });\nconst fileSystem = new Map();\nconst fds = [\n  new OpenFile(new File(new Uint8Array(), { readonly: true })),\n  ConsoleStdout.lineBuffered((msg) => console.log(`[WASI stdout] ${msg}`)),\n  ConsoleStdout.lineBuffered((msg) => console.warn(`[WASI stderr] ${msg}`)),\n  new PreopenDirectory(\"/\", fileSystem),\n];\nconst options = { debug: false };\nconst wasi = new WASI(args, env, fds, options);\nconst { instance } = await WebAssembly.instantiateStreaming(\n  fetch(\"./pandoc.wasm?sha1=SHA1_PANDOC_WASM\"),\n  {\n    wasi_snapshot_preview1: wasi.wasiImport,\n  }\n);\n\nwasi.initialize(instance);\ninstance.exports.__wasm_call_ctors();\n\nfunction memory_data_view() {\n  return new DataView(instance.exports.memory.buffer);\n}\n\nconst argc_ptr = instance.exports.malloc(4);\nmemory_data_view().setUint32(argc_ptr, args.length, true);\nconst argv = instance.exports.malloc(4 * (args.length + 1));\nfor (let i = 0; i < args.length; ++i) {\n  const arg = instance.exports.malloc(args[i].length + 1);\n  new TextEncoder().encodeInto(\n    args[i],\n    new Uint8Array(instance.exports.memory.buffer, arg, args[i].length)\n  );\n  memory_data_view().setUint8(arg + args[i].length, 0);\n  memory_data_view().setUint32(argv + 4 * i, arg, true);\n}\nmemory_data_view().setUint32(argv + 4 * args.length, 0, true);\nconst argv_ptr = instance.exports.malloc(4);\nmemory_data_view().setUint32(argv_ptr, argv, true);\n\ninstance.exports.hs_init_with_rtsopts(argc_ptr, argv_ptr);\n\nexport async function query(options) {\n  const opts_str = JSON.stringify(options);\n  const opts_bytes = new TextEncoder().encode(opts_str);\n  const opts_ptr = instance.exports.malloc(opts_bytes.length);\n  new Uint8Array(instance.exports.memory.buffer, opts_ptr, opts_bytes.length)\n    .set(opts_bytes);\n  // add input files to fileSystem\n  fileSystem.clear()\n  const out_file = new File(new Uint8Array(), { readonly: false });\n  const err_file = new File(new Uint8Array(), { readonly: false });\n  fileSystem.set(\"stdout\", out_file);\n  fileSystem.set(\"stderr\", err_file);\n  instance.exports.query(opts_ptr, opts_bytes.length);\n\n  const err_text = new TextDecoder(\"utf-8\", { fatal: true }).decode(err_file.data);\n  if (err_text) console.log(err_text);\n  const out_text = new TextDecoder(\"utf-8\", { fatal: true }).decode(out_file.data);\n  return JSON.parse(out_text);\n}\n\n\nexport async function convert(options, stdin, files) {\n  const opts_str = JSON.stringify(options);\n  const opts_bytes = new TextEncoder().encode(opts_str);\n  const opts_ptr = instance.exports.malloc(opts_bytes.length);\n  new Uint8Array(instance.exports.memory.buffer, opts_ptr, opts_bytes.length)\n    .set(opts_bytes);\n  // add input files to fileSystem\n  fileSystem.clear()\n  const in_file = new File(new Uint8Array(), { readonly: true });\n  const out_file = new File(new Uint8Array(), { readonly: false });\n  const err_file = new File(new Uint8Array(), { readonly: false });\n  const warnings_file = new File(new Uint8Array(), { readonly: false });\n  fileSystem.set(\"stdin\", in_file);\n  fileSystem.set(\"stdout\", out_file);\n  fileSystem.set(\"stderr\", err_file);\n  fileSystem.set(\"warnings\", warnings_file);\n  for (const file in files) {\n    await addFile(file, files[file], true);\n  }\n  // add output file if any\n  if (options[\"output-file\"]) {\n    await addFile(options[\"output-file\"], new Blob(), false);\n  }\n  // add media file for extracted media\n  if (options[\"extract-media\"]) {\n    await addFile(options[\"extract-media\"], new Blob(), false);\n  }\n  if (stdin) {\n    in_file.data = new TextEncoder().encode(stdin);\n  }\n  instance.exports.convert(opts_ptr, opts_bytes.length);\n\n  if (options[\"output-file\"]) {\n    files[options[\"output-file\"]] =\n       new Blob([fileSystem.get(options[\"output-file\"]).data]);\n  }\n  if (options[\"extract-media\"]) {\n    const mediaFile = fileSystem.get(options[\"extract-media\"]);\n    if (mediaFile && mediaFile.data && mediaFile.data.length > 0) {\n      files[options[\"extract-media\"]] =\n         new Blob([mediaFile.data], { type: 'application/zip' });\n    }\n  }\n  const rawWarnings = new TextDecoder(\"utf-8\", { fatal: true })\n                          .decode(warnings_file.data);\n  let warnings = [];\n  if (rawWarnings) {\n    warnings = JSON.parse(rawWarnings);\n  }\n  return {\n    stdout: new TextDecoder(\"utf-8\", { fatal: true }).decode(out_file.data),\n    stderr: new TextDecoder(\"utf-8\", { fatal: true }).decode(err_file.data),\n    warnings: warnings\n  };\n}\n\nasync function addFile(filename, blob, readonly) {\n  const buffer = await blob.arrayBuffer();\n  const file = new File(new Uint8Array(buffer), { readonly: readonly });\n  fileSystem.set(filename, file);\n}\n"
  },
  {
    "path": "wasm/patches/conduit-extra.patch",
    "content": "--- a/conduit-extra/conduit-extra.cabal\n+++ b/conduit-extra/conduit-extra.cabal\n@@ -26,9 +26,6 @@ Library\n                        Data.Conduit.Filesystem\n                        Data.Conduit.Foldl\n                        Data.Conduit.Lazy\n-                       Data.Conduit.Network\n-                       Data.Conduit.Network.UDP\n-                       Data.Conduit.Network.Unix\n                        Data.Conduit.Process\n                        Data.Conduit.Process.Typed\n                        Data.Conduit.Text\n@@ -38,6 +35,12 @@ Library\n       -- These architectures are able to perform unaligned memory accesses\n       cpp-options: -DALLOW_UNALIGNED_ACCESS\n\n+  if !arch(wasm32)\n+      Exposed-modules: Data.Conduit.Network\n+                       Data.Conduit.Network.UDP\n+  if !os(windows) && !arch(wasm32)\n+      Exposed-modules: Data.Conduit.Network.Unix\n+\n   Build-depends:       base                     >= 4.12         && < 5\n                      , conduit                  >= 1.3          && < 1.4\n\n@@ -49,7 +52,6 @@ Library\n                      , async\n                      , attoparsec               >= 0.10\n                      , directory\n                      , filepath\n-                     , network                  >= 2.3\n                      , primitive                >= 0.5\n                      , process\n                      , resourcet                >= 1.1\n@@ -58,6 +60,9 @@ Library\n                      , unliftio-core\n                      , typed-process            >= 0.2.6\n\n+  if !arch(wasm32)\n+      Build-depends: network >= 2.3\n+\n   ghc-options:     -Wall\n\n test-suite test\n"
  },
  {
    "path": "wasm/patches/lua.patch",
    "content": "--- a/lua/cbits/lua-5.4.8/liolib.c\n+++ b/lua/cbits/lua-5.4.8/liolib.c\n@@ -301,10 +301,14 @@\n\n\n static int io_tmpfile (lua_State *L) {\n+#if defined(LUA_STUB_TMPFILE)\n+  return 1;\n+#else\n   LStream *p = newfile(L);\n   errno = 0;\n   p->f = tmpfile();\n   return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1;\n+#endif\n }\n\n\n--- a/lua/cbits/lua-5.4.8/loslib.c\n+++ b/lua/cbits/lua-5.4.8/loslib.c\n@@ -101,7 +101,12 @@\n */\n #if !defined(lua_tmpnam)\t/* { */\n\n-#if defined(LUA_USE_POSIX)\t/* { */\n+#if defined(LUA_STUB_TMPNAM) /* { */\n+\n+#define LUA_TMPNAMBUFSIZE\t32\n+#define lua_tmpnam(b,e) { e = 1; }\n+\n+#elif defined(LUA_USE_POSIX)\t/* }{ */\n\n #include <unistd.h>\n\n@@ -131,7 +136,7 @@\n /* }================================================================== */\n\n\n-#if !defined(l_system)\n+#if !defined(l_system) && !defined(LUA_STUB_SYSTEM)\n #if defined(LUA_USE_IOS)\n /* Despite claiming to be ISO C, iOS does not implement 'system'. */\n #define l_system(cmd) ((cmd) == NULL ? 0 : -1)\n@@ -142,6 +147,9 @@\n\n\n static int os_execute (lua_State *L) {\n+#if defined(LUA_STUB_SYSTEM)\n+  return 1;\n+#else\n   const char *cmd = luaL_optstring(L, 1, NULL);\n   int stat;\n   errno = 0;\n@@ -152,6 +160,7 @@\n     lua_pushboolean(L, stat);  /* true if there is a shell */\n     return 1;\n   }\n+#endif\n }\n"
  },
  {
    "path": "wasm/patches/memory.patch",
    "content": "--- a/Data/Memory/MemMap/Posix.hsc\n+++ b/Data/Memory/MemMap/Posix.hsc\n@@ -17,7 +17,9 @@\n --\n -----------------------------------------------------------------------------\n \n+#if !defined(wasm32_HOST_ARCH)\n #include <sys/mman.h>\n+#endif\n #include <unistd.h>\n \n {-# LANGUAGE ForeignFunctionInterface #-}\n@@ -117,18 +119,26 @@\n     deriving (Show,Read,Eq)\n \n cvalueOfMemoryProts :: [MemoryProtection] -> CInt\n+#if defined(wasm32_HOST_ARCH)\n+cvalueOfMemoryProts _ = error \"Data.Memory.MemMap.cvalueOfMemoryProts\"\n+#else\n cvalueOfMemoryProts = foldl (.|.) 0 . map toProt\n   where toProt :: MemoryProtection -> CInt\n         toProt MemoryProtectionNone    = (#const PROT_NONE)\n         toProt MemoryProtectionRead    = (#const PROT_READ)\n         toProt MemoryProtectionWrite   = (#const PROT_WRITE)\n         toProt MemoryProtectionExecute = (#const PROT_EXEC)\n+#endif\n \n cvalueOfMemorySync :: [MemorySyncFlag] -> CInt\n+#if defined(wasm32_HOST_ARCH)\n+cvalueOfMemorySync _ = error \"Data.Memory.MemMap.cvalueOfMemorySync\"\n+#else\n cvalueOfMemorySync = foldl (.|.) 0 . map toSync\n   where toSync MemorySyncAsync      = (#const MS_ASYNC)\n         toSync MemorySyncSync       = (#const MS_SYNC)\n         toSync MemorySyncInvalidate = (#const MS_INVALIDATE)\n+#endif\n \n -- | Map pages of memory.\n --\n@@ -139,10 +149,13 @@\n memoryMap :: Maybe (Ptr a)      -- ^ The address to map to if MapFixed is used.\n           -> CSize              -- ^ The length of the mapping\n           -> [MemoryProtection] -- ^ the memory protection associated with the mapping\n-          -> MemoryMapFlag      -- ^ \n+          -> MemoryMapFlag      -- ^\n           -> Maybe Fd\n           -> COff\n           -> IO (Ptr a)\n+#if defined(wasm32_HOST_ARCH)\n+memoryMap _ _ _ _ _ _ = error \"Data.Memory.MemMap.memoryMap\"\n+#else\n memoryMap initPtr sz prots flag mfd off =\n     throwErrnoIf (== m1ptr) \"mmap\" (c_mmap (maybe nullPtr id initPtr) sz cprot cflags fd off)\n   where m1ptr  = nullPtr `plusPtr` (-1)\n@@ -161,6 +174,7 @@\n \n         toMapFlag MemoryMapShared  = (#const MAP_SHARED)\n         toMapFlag MemoryMapPrivate = (#const MAP_PRIVATE)\n+#endif\n \n -- | Unmap pages of memory\n --\n@@ -172,6 +186,9 @@\n --\n -- call 'madvise'\n memoryAdvise :: Ptr a -> CSize -> MemoryAdvice -> IO ()\n+#if defined(wasm32_HOST_ARCH)\n+memoryAdvise _ _ _ = error \"Data.Memory.MemMap.memoryAdvise\"\n+#else\n memoryAdvise ptr sz adv = throwErrnoIfMinus1_ \"madvise\" (c_madvise ptr sz cadv)\n   where cadv = toAdvice adv\n #if defined(POSIX_MADV_NORMAL)\n@@ -187,6 +204,7 @@\n         toAdvice MemoryAdviceWillNeed = (#const MADV_WILLNEED)\n         toAdvice MemoryAdviceDontNeed = (#const MADV_DONTNEED)\n #endif\n+#endif\n \n -- | lock a range of process address space\n --\n--- a/Data/Memory/PtrMethods.hs\n+++ b/Data/Memory/PtrMethods.hs\n@@ -35,7 +35,7 @@\n memCreateTemporary size f = allocaBytesAligned size 8 f\n \n -- | xor bytes from source1 and source2 to destination\n--- \n+--\n -- d = s1 xor s2\n --\n -- s1, nor s2 are modified unless d point to s1 or s2\n@@ -63,7 +63,7 @@\n \n -- | Copy a set number of bytes from @src to @dst\n memCopy :: Ptr Word8 -> Ptr Word8 -> Int -> IO ()\n-memCopy dst src n = c_memcpy dst src (fromIntegral n)\n+memCopy dst src n = c_memcpy dst src (fromIntegral n) >>= \\_ -> return ()\n {-# INLINE memCopy #-}\n \n -- | Set @n number of bytes to the same value @v\n@@ -114,7 +114,7 @@\n             loop (i+1) (acc .|. e)\n \n foreign import ccall unsafe \"memset\"\n-    c_memset :: Ptr Word8 -> Word8 -> CSize -> IO ()\n+    c_memset :: Ptr Word8 -> Word8 -> CSize -> IO (Ptr Word8)\n \n foreign import ccall unsafe \"memcpy\"\n-    c_memcpy :: Ptr Word8 -> Ptr Word8 -> CSize -> IO ()\n+    c_memcpy :: Ptr Word8 -> Ptr Word8 -> CSize -> IO (Ptr Word8)\n"
  },
  {
    "path": "wasm/patches/splitmix.patch",
    "content": "--- /dev/null\n+++ b/cbits-wasi/init.c\n@@ -0,0 +1,8 @@\n+#include <stdint.h>\n+#include <sys/random.h>\n+\n+uint64_t splitmix_init() {\n+  uint64_t result;\n+  int r = getentropy(&result, sizeof(uint64_t));\n+  return r == 0 ? result : 0xfeed1000;\n+}\n--- a/splitmix.cabal\n+++ b/splitmix.cabal\n@@ -80,7 +80,10 @@ library\n         frameworks: Security\n\n       else\n-        c-sources: cbits-unix/init.c\n+        if arch(wasm32)\n+          c-sources: cbits-wasi/init.c\n+        else\n+          c-sources: cbits-unix/init.c\n\n     else\n       cpp-options:   -DSPLITMIX_INIT_COMPAT=1\n"
  },
  {
    "path": "wasm/patches/streaming-commons.patch",
    "content": "--- a/streaming-commons.cabal\n+++ b/streaming-commons.cabal\n@@ -30,20 +30,21 @@ library\n                        Data.Streaming.ByteString.Builder.Buffer\n                        Data.Streaming.FileRead\n                        Data.Streaming.Filesystem\n-                       Data.Streaming.Network\n-                       Data.Streaming.Network.Internal\n                        Data.Streaming.Process\n                        Data.Streaming.Process.Internal\n                        Data.Streaming.Text\n                        Data.Streaming.Zlib\n                        Data.Streaming.Zlib.Lowlevel\n\n+  if !arch(wasm32)\n+      exposed-modules: Data.Streaming.Network\n+                       Data.Streaming.Network.Internal\n+\n   build-depends:       base >= 4.12 && < 5\n                      , array\n                      , async\n                      , bytestring\n                      , directory\n-                     , network >= 2.4.0.0\n                      , random\n                      , process\n                      , stm\n@@ -51,6 +52,9 @@ library\n                      , transformers\n                      , zlib\n\n+  if !arch(wasm32)\n+      build-depends: network >= 2.4.0.0\n+\n   c-sources:           cbits/zlib-helper.c\n                        cbits/text-helper.c\n   include-dirs:        include\n"
  },
  {
    "path": "wasm/patches/xml-conduit.patch",
    "content": "--- a/xml-conduit/xml-conduit.cabal\n+++ b/xml-conduit/xml-conduit.cabal\n@@ -12,13 +12,10 @@ description:     Hackage documentation generation is not reliable. For up to dat\n category:        XML, Conduit\n stability:       Stable\n-build-type:      Custom\n+build-type:      Simple\n homepage:        http://github.com/snoyberg/xml\n extra-source-files: README.md\n                     ChangeLog.md\n-tested-with:     GHC >=8.0 && <9.12\n-\n-custom-setup\n-    setup-depends:   base >= 4 && <5, Cabal <4, cabal-doctest >= 1 && <1.1\n+tested-with:     GHC >=8.0 && <9.14\n\n library\n     build-depends:   base                      >= 4.12     && < 5\n"
  },
  {
    "path": "weeder.toml",
    "content": "roots = [ \"^Main.main$\", \"^Paths_.*$\" ]\ntype-class-roots = true\n"
  },
  {
    "path": "windows/AdvancedWelcomeEulaDlg_Custom.wxs",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  <copyright file=\"AdvancedWelcomeEulaDlg.wxs\" company=\"Outercurve Foundation\">\n    Copyright (c) 2004, Outercurve Foundation.\n    This software is released under Microsoft Reciprocal License (MS-RL).\n    The license and further copyright text can be found in the file\n    LICENSE.TXT at the root directory of the distribution.\n  </copyright>\n-->\n<Wix xmlns=\"http://schemas.microsoft.com/wix/2006/wi\">\n    <Fragment>\n        <UI>\n            <Dialog Id=\"AdvancedWelcomeEulaDlg_Custom\" Width=\"370\" Height=\"270\" Title=\"!(loc.AdvancedWelcomeEulaDlg_Title)\">\n              \n                <Control Id=\"BannerBitmap\" Type=\"Bitmap\" X=\"0\" Y=\"0\" Width=\"370\" Height=\"44\" TabSkip=\"no\" Text=\"!(loc.AdvancedWelcomeEulaDlgBannerBitmap)\" />\n                <Control Id=\"BottomLine\" Type=\"Line\" X=\"0\" Y=\"234\" Width=\"370\" Height=\"0\" />\n                <Control Id=\"Title\" Type=\"Text\" X=\"20\" Y=\"10\" Width=\"300\" Height=\"24\" Transparent=\"yes\" NoPrefix=\"yes\" Text=\"!(loc.AdvancedWelcomeEulaDlgTitle)\" />\n              \n                <Control Id=\"LicenseAcceptedCheckBox\" Type=\"CheckBox\" X=\"20\" Y=\"140\" Width=\"226\" Height=\"19\" CheckBoxValue=\"1\" Property=\"LicenseAccepted\" Text=\"!(loc.WelcomeEulaDlgLicenseAcceptedCheckBox)\" />\n\n                <Control Id=\"ScopeGroupBox\" Type=\"GroupBox\" X=\"20\" Y=\"155\" Height=\"70\" Width=\"330\" />\n              \n                <Control Id=\"AllUsersCheckBox\" Type=\"CheckBox\" X=\"88\" Y=\"200\" Width=\"226\" Height=\"18\" CheckBoxValue=\"1\" Property=\"ALLUSERS\" Text=\"!(loc.InstallScopeDlgPerMachine)\">\n                  <Condition Action=\"enable\">LicenseAccepted AND (WixUISupportPerUser = 1)</Condition>\n                  <Condition Action=\"disable\">(NOT LicenseAccepted) OR (WixUISupportPerUser = 0)</Condition>                \n                </Control>\n                           \n                <Control Id=\"PerUserDescription\" Type=\"Text\" X=\"30\" Y=\"167\" Width=\"300\" Height=\"36\" NoPrefix=\"yes\" Text=\"!(loc.InstallScopeDlgPerUserDescription)\">\n                  <Condition Action=\"hide\">ALLUSERS</Condition>\n                  <Condition Action=\"show\">NOT (ALLUSERS = 1)</Condition>\n                  <Condition Action=\"disable\">NOT LicenseAccepted</Condition>\n                  <Condition Action=\"enable\">LicenseAccepted</Condition>\n                </Control>\n\n                <Control Id=\"PerMachineDescription\" Type=\"Text\" X=\"30\" Y=\"167\" Width=\"300\" Height=\"36\" Hidden=\"yes\" NoPrefix=\"yes\" Text=\"!(loc.InstallScopeDlgPerMachineDescription)\">\n                  <Condition Action=\"hide\">NOT (ALLUSERS = 1)</Condition>\n                  <Condition Action=\"show\">ALLUSERS = 1</Condition>\n                  <Condition Action=\"disable\">NOT LicenseAccepted</Condition>\n                  <Condition Action=\"enable\">LicenseAccepted</Condition>\n                </Control>\n              \n                <Control Id=\"Print\" Type=\"PushButton\" X=\"88\" Y=\"243\" Width=\"56\" Height=\"17\" Text=\"!(loc.WixUIPrint)\">\n                    <Publish Event=\"DoAction\" Value=\"WixUIPrintEula\">1</Publish>\n                </Control>\n              \n                <Control Id=\"Advanced\" Type=\"PushButton\" X=\"156\" Y=\"243\" Width=\"56\" Height=\"17\" Text=\"!(loc.AdvancedWelcomeEulaDlgAdvanced)\">\n                    <Condition Action=\"disable\">NOT LicenseAccepted OR NOT (ALLUSERS = 1)</Condition>\n                    <Condition Action=\"enable\">(LicenseAccepted = \"1\") AND (ALLUSERS = 1)</Condition>\n                </Control>\n              \n                <Control Id=\"Install\" Type=\"PushButton\" ElevationShield=\"yes\" X=\"212\" Y=\"243\" Width=\"80\" Height=\"17\" Default=\"yes\" Text=\"!(loc.AdvancedWelcomeEulaDlgInstall)\" Hidden=\"yes\">\n                    <Publish Event=\"SpawnWaitDialog\" Value=\"WaitForCostingDlg\">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>\n                    <Publish Event=\"EndDialog\" Value=\"Return\"><![CDATA[OutOfDiskSpace <> 1]]></Publish>\n                    <Publish Event=\"SpawnDialog\" Value=\"OutOfRbDiskDlg\">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST=\"P\" OR NOT PROMPTROLLBACKCOST)</Publish>\n                    <Publish Event=\"EndDialog\" Value=\"Return\">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST=\"D\"</Publish>\n                    <Publish Event=\"EnableRollback\" Value=\"False\">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST=\"D\"</Publish>\n                    <Publish Event=\"SpawnDialog\" Value=\"OutOfDiskDlg\">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST=\"F\")</Publish>\n                    <Condition Action=\"disable\">NOT LicenseAccepted</Condition>\n                    <Condition Action=\"enable\">LicenseAccepted = \"1\"</Condition>\n                    <Condition Action=\"show\">ALLUSERS = 1</Condition>\n                    <Condition Action=\"hide\">NOT (ALLUSERS = 1)</Condition>\n                </Control>\n                <Control Id=\"InstallNoShield\" Type=\"PushButton\" ElevationShield=\"no\" X=\"212\" Y=\"243\" Width=\"80\" Height=\"17\" Default=\"yes\" Text=\"!(loc.AdvancedWelcomeEulaDlgInstall)\" Hidden=\"yes\">\n                    <Publish Event=\"SpawnWaitDialog\" Value=\"WaitForCostingDlg\">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>\n                    <Publish Event=\"EndDialog\" Value=\"Return\"><![CDATA[OutOfDiskSpace <> 1]]></Publish>\n                    <Publish Event=\"SpawnDialog\" Value=\"OutOfRbDiskDlg\">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST=\"P\" OR NOT PROMPTROLLBACKCOST)</Publish>\n                    <Publish Event=\"EndDialog\" Value=\"Return\">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST=\"D\"</Publish>\n                    <Publish Event=\"EnableRollback\" Value=\"False\">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST=\"D\"</Publish>\n                    <Publish Event=\"SpawnDialog\" Value=\"OutOfDiskDlg\">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST=\"F\")</Publish>\n                    <Condition Action=\"disable\">NOT LicenseAccepted</Condition>\n                    <Condition Action=\"enable\">LicenseAccepted = \"1\"</Condition>\n                    <Condition Action=\"show\">NOT (ALLUSERS = 1)</Condition>\n                    <Condition Action=\"hide\">ALLUSERS = 1</Condition>\n                </Control>\n              \n                <Control Id=\"Cancel\" Type=\"PushButton\" X=\"304\" Y=\"243\" Width=\"56\" Height=\"17\" Cancel=\"yes\" Text=\"!(loc.WixUICancel)\">\n                    <Publish Event=\"SpawnDialog\" Value=\"CancelDlg\">1</Publish>\n                </Control>\n                <Control Id=\"LicenseText\" Type=\"ScrollableText\" X=\"20\" Y=\"55\" Width=\"330\" Height=\"80\" Sunken=\"yes\" TabSkip=\"no\">\n                  <!--<Text SourceFile=\"!(wix.WixUILicenseRtf=$(var.licenseRtf))\" />-->\n                  <Text SourceFile=\"!(loc.LicenseRtf)\" />\n                </Control>\n            </Dialog>\n        </UI>\n\n        <InstallUISequence>\n            <Show Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Before=\"ProgressDlg\">NOT Installed</Show>\n        </InstallUISequence>\n    </Fragment>\n</Wix>"
  },
  {
    "path": "windows/Makefile",
    "content": "UNSIGNED=$(wildcard pandoc-*-UNSIGNED.msi)\nSIGNED=$(patsubst %-UNSIGNED.msi, %.msi, $(UNSIGNED))\n\nall: $(SIGNED)\n\n.PHONY: all\n\npandoc-%.msi: pandoc-%-UNSIGNED.msi\n\tosslsigncode sign -pkcs12 $$HOME/Private/SectigoCodeSigning.exp2026.pfx -in $< -i https://johnmacfarlane.net/ -t http://timestamp.comodoca.com/ -out $@ -askpass && rm $<\n\n"
  },
  {
    "path": "windows/Pandoc-en-us.wxl",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<WixLocalization Culture=\"en-us\" Codepage=\"1252\" xmlns=\"http://schemas.microsoft.com/wix/2006/localization\">\n  <String Id=\"Language\">1033</String>\n  <!-- Supported language and codepage codes can be found here: http://www.tramontana.co.hu/wix/lesson2.php#2.4 -->\n  \n  <String Id=\"LicenseRtf\" Overridable=\"yes\">COPYING.rtf</String>\n  \n    <String Id=\"ExitDialogText\">[ProductName] was installed in \n\n[APPLICATIONFOLDER]. \n    \nYou may need to restart Cmd/Powershell Windows before using it.</String>\n\n</WixLocalization>\n"
  },
  {
    "path": "windows/WixUI_Advanced_Custom.wxs",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?if $(sys.BUILDARCH)=x64?>\n<?define ProgFilesFolder=\"ProgramFiles64Folder\"?>\n<?else?>\n<?define ProgFilesFolder=\"ProgramFilesFolder\"?>\n<?endif?>\n<!--\n  <copyright file=\"WixUI_Advanced_Custom.wxs\" company=\"Outercurve Foundation\">\n    Copyright (c) 2004, Outercurve Foundation.\n    This software is released under Microsoft Reciprocal License (MS-RL).\n    The license and further copyright text can be found in the file\n    LICENSE.TXT at the root directory of the distribution.\n  </copyright>\n-->\n\n<!--\nWixUI_Advanced_Custom offers a two-click install (EULA checkbox and Install button)\nand offers an Advanced button that lets users choose per-machine or per-user\ninstalls, install path, and features.\n\nWiX variables used:\n - WixUISupportPerMachine\n - WixUISupportPerUser\n \nTodo:\n - Clicking Install doesn't work! - APPLICATIONFOLDER isn't set; need to accept another \"incoming\" property.\n - Replace this dialog set UI fragment with the UI extension.\n = This set is still in active development.\n = Future releases are likely to be incompatible.\n = Future releases are likely to be much easier to use.\n = Use at your own risk.\n\n-->\n\n<Wix xmlns=\"http://schemas.microsoft.com/wix/2006/wi\">\n    <Fragment>\n        <WixVariable Id=\"WixUISupportPerUser\" Value=\"1\" Overridable=\"yes\" />\n        <WixVariable Id=\"WixUISupportPerMachine\" Value=\"1\" Overridable=\"yes\" />\n\n        <PropertyRef Id=\"ApplicationFolderName\" />\n\n        <CustomAction Id=\"WixSetDefaultPerUserFolder2\" Property=\"WixPerUserFolder\" Value=\"[LocalAppDataFolder][ApplicationFolderName]\" Execute=\"immediate\" />\n        <CustomAction Id=\"WixSetDefaultPerMachineFolder2\" Property=\"WixPerMachineFolder\" Value=\"[$(var.ProgFilesFolder)][ApplicationFolderName]\" Execute=\"immediate\" />\n        <CustomAction Id=\"WixSetPerUserFolder2\" Property=\"APPLICATIONFOLDER\" Value=\"[WixPerUserFolder]\" Execute=\"immediate\" />\n        <CustomAction Id=\"WixSetPerMachineFolder2\" Property=\"APPLICATIONFOLDER\" Value=\"[WixPerMachineFolder]\" Execute=\"immediate\" />\n\n        <InstallExecuteSequence>\n            <Custom Action=\"WixSetDefaultPerUserFolder2\" Before=\"CostFinalize\" />\n            <Custom Action=\"WixSetDefaultPerMachineFolder2\" After=\"WixSetDefaultPerUserFolder2\" />\n            <Custom Action=\"WixSetPerUserFolder2\" After=\"WixSetDefaultPerMachineFolder2\">ACTION=\"INSTALL\" AND APPLICATIONFOLDER=\"\" AND (ALLUSERS=\"\" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>\n            <Custom Action=\"WixSetPerMachineFolder2\" After=\"WixSetPerUserFolder2\">ACTION=\"INSTALL\" AND APPLICATIONFOLDER=\"\" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>\n        </InstallExecuteSequence>\n        <InstallUISequence>\n            <Custom Action=\"WixSetDefaultPerUserFolder2\" Before=\"CostFinalize\" />\n            <Custom Action=\"WixSetDefaultPerMachineFolder2\" After=\"WixSetDefaultPerUserFolder2\" />\n            <Custom Action=\"WixSetPerUserFolder2\" After=\"WixSetDefaultPerMachineFolder2\">ACTION=\"INSTALL\" AND APPLICATIONFOLDER=\"\" AND (ALLUSERS=\"\" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>\n            <Custom Action=\"WixSetPerMachineFolder2\" After=\"WixSetPerUserFolder2\">ACTION=\"INSTALL\" AND APPLICATIONFOLDER=\"\" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>\n        </InstallUISequence>\n\n        <UI Id=\"WixUI_Advanced_Custom\">\n            <TextStyle Id=\"WixUI_Font_Normal\" FaceName=\"!(loc.Advanced_Font_FaceName)\" Size=\"!(loc.Advanced_Font_Normal_Size)\" />\n            <TextStyle Id=\"WixUI_Font_Bigger\" FaceName=\"!(loc.Advanced_Font_FaceName)\" Size=\"!(loc.Advanced_Font_Bigger_Size)\" />\n            <TextStyle Id=\"WixUI_Font_Title\" FaceName=\"!(loc.Advanced_Font_FaceName)\" Size=\"!(loc.Advanced_Font_Title_Size)\" Bold=\"yes\" />\n            <TextStyle Id=\"WixUI_Font_Emphasized\" FaceName=\"!(loc.Advanced_Font_FaceName)\" Size=\"!(loc.Advanced_Font_Emphasized_Size)\" Bold=\"yes\" />\n\n            <Property Id=\"DefaultUIFont\" Value=\"WixUI_Font_Normal\" />\n            <Property Id=\"WixUI_Mode\" Value=\"Advanced\" />\n\n            <DialogRef Id=\"BrowseDlg\" />\n            <DialogRef Id=\"DiskCostDlg\" />\n            <DialogRef Id=\"ErrorDlg\" />\n            <DialogRef Id=\"FatalError\" />\n            <DialogRef Id=\"FilesInUse\" />\n            <DialogRef Id=\"MsiRMFilesInUse\" />\n            <DialogRef Id=\"PrepareDlg\" />\n            <DialogRef Id=\"ProgressDlg\" />\n            <DialogRef Id=\"ResumeDlg\" />\n            <DialogRef Id=\"UserExit\" />\n            <DialogRef Id=\"WelcomeDlg\"/>\n\n            <Publish Dialog=\"ExitDialog\" Control=\"Finish\" Event=\"EndDialog\" Value=\"Return\" Order=\"999\">1</Publish>\n            \n            <Publish Dialog=\"BrowseDlg\" Control=\"OK\" Event=\"DoAction\" Value=\"WixUIValidatePath\" Order=\"1\">1</Publish>\n            <Publish Dialog=\"BrowseDlg\" Control=\"OK\" Event=\"SpawnDialog\" Value=\"InvalidDirDlg\" Order=\"2\"><![CDATA[WIXUI_INSTALLDIR_VALID<>\"1\"]]></Publish>\n\n            <!--<Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"Advanced\" Event=\"NewDialog\" Value=\"InstallScopeDlg\" Order=\"1\">!(wix.WixUISupportPerMachine) AND !(wix.WixUISupportPerUser)</Publish>-->\n            <!--<Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"Advanced\" Event=\"NewDialog\" Value=\"FeaturesDlg\" Order=\"2\">NOT !(wix.WixUISupportPerMachine)</Publish>-->\n            <!--<Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"Advanced\" Event=\"NewDialog\" Value=\"InstallDirDlg\" Order=\"3\">!(wix.WixUISupportPerMachine) AND NOT !(wix.WixUISupportPerUser)</Publish>-->\n\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"Advanced\" Property=\"WixAppFolder\" Value=\"WixPerMachineFolder\" Order=\"1\">ALLUSERS = 1</Publish>\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"Advanced\" Property=\"APPLICATIONFOLDER\" Value=\"[$(var.ProgFilesFolder)][ApplicationFolderName]\" Order=\"2\">ALLUSERS = 1</Publish>\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"Advanced\" Event=\"NewDialog\" Value=\"InstallDirDlg\" Order=\"3\">!(wix.WixUISupportPerMachine) AND  !(wix.WixUISupportPerUser)</Publish>\n\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"AllUsersCheckBox\" Property=\"WixAppFolder\" Value=\"WixPerMachineFolder\" Order=\"1\">ALLUSERS = 1</Publish>\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"AllUsersCheckBox\" Property=\"APPLICATIONFOLDER\" Value=\"[$(var.ProgFilesFolder)][ApplicationFolderName]\" Order=\"2\">ALLUSERS = 1</Publish>\n\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"AllUsersCheckBox\" Property=\"WixAppFolder\" Value=\"WixPerUserFolder\" Order=\"1\">NOT (ALLUSERS = 1)</Publish>\n            <Publish Dialog=\"AdvancedWelcomeEulaDlg_Custom\" Control=\"AllUsersCheckBox\" Property=\"APPLICATIONFOLDER\" Value=\"[LocalAppDataFolder][ApplicationFolderName]\" Order=\"2\">NOT (ALLUSERS = 1)</Publish>\n\n          <!--<Publish Dialog=\"InstallScopeDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"AdvancedWelcomeEulaDlg_Custom\">1</Publish>-->\n          <!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder -->\n          \n            <!--<Publish Dialog=\"InstallScopeDlg\" Control=\"Next\" Property=\"WixAppFolder\" Value=\"WixPerUserFolder\" Order=\"1\">!(wix.WixUISupportPerUser) AND NOT Privileged</Publish>-->\n\n            \n\n            <!--<Publish Dialog=\"InstallScopeDlg\" Control=\"Next\" Event=\"NewDialog\" Value=\"FeaturesDlg\" Order=\"6\">WixAppFolder = \"WixPerUserFolder\"</Publish>\n            <Publish Dialog=\"InstallScopeDlg\" Control=\"Next\" Event=\"NewDialog\" Value=\"InstallDirDlg\" Order=\"7\">WixAppFolder = \"WixPerMachineFolder\"</Publish>-->\n\n            <!--<Publish Dialog=\"InstallDirDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"InstallScopeDlg\">!(wix.WixUISupportPerUser)</Publish>-->\n            <Publish Dialog=\"InstallDirDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"AdvancedWelcomeEulaDlg_Custom\">1</Publish>\n            <Publish Dialog=\"InstallDirDlg\" Control=\"Next\" Event=\"SetTargetPath\" Value=\"[WIXUI_INSTALLDIR]\" Order=\"1\">1</Publish>\n            <Publish Dialog=\"InstallDirDlg\" Control=\"Next\" Event=\"DoAction\" Value=\"WixUIValidatePath\" Order=\"2\">NOT WIXUI_DONTVALIDATEPATH</Publish>\n            <Publish Dialog=\"InstallDirDlg\" Control=\"Next\" Event=\"SpawnDialog\" Value=\"InvalidDirDlg\" Order=\"3\"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>\"1\"]]></Publish>\n            <Publish Dialog=\"InstallDirDlg\" Control=\"Next\" Event=\"NewDialog\" Value=\"VerifyReadyDlg\" Order=\"4\">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID=\"1\"</Publish>\n            <Publish Dialog=\"InstallDirDlg\" Control=\"ChangeFolder\" Property=\"_BrowseProperty\" Value=\"[WIXUI_INSTALLDIR]\" Order=\"1\">1</Publish>\n            <Publish Dialog=\"InstallDirDlg\" Control=\"ChangeFolder\" Event=\"SpawnDialog\" Value=\"BrowseDlg\" Order=\"2\">1</Publish>\n\n            <!--<Publish Dialog=\"FeaturesDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"InstallScopeDlg\">NOT Installed AND WixAppFolder = \"WixPerUserFolder\"</Publish>-->\n            <Publish Dialog=\"FeaturesDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"InstallDirDlg\">NOT Installed AND WixAppFolder = \"WixPerMachineFolder\"</Publish>\n            <Publish Dialog=\"FeaturesDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"MaintenanceTypeDlg\">Installed</Publish>\n\n            <Publish Dialog=\"MaintenanceWelcomeDlg\" Control=\"Next\" Event=\"NewDialog\" Value=\"MaintenanceTypeDlg\">1</Publish>\n\n            <Publish Dialog=\"MaintenanceTypeDlg\" Control=\"RepairButton\" Event=\"NewDialog\" Value=\"VerifyReadyDlg\">1</Publish>\n            <Publish Dialog=\"MaintenanceTypeDlg\" Control=\"RemoveButton\" Event=\"NewDialog\" Value=\"VerifyReadyDlg\">1</Publish>\n            <Publish Dialog=\"MaintenanceTypeDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"MaintenanceWelcomeDlg\">1</Publish>\n\n            <Publish Dialog=\"VerifyReadyDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"MaintenanceTypeDlg\" Order=\"2\">Installed AND NOT PATCH</Publish>\n            <Publish Dialog=\"VerifyReadyDlg\" Control=\"Back\" Event=\"NewDialog\" Value=\"WelcomeDlg\" Order=\"3\">Installed AND PATCH</Publish>\n\n            <Publish Dialog=\"WelcomeDlg\" Control=\"Next\" Event=\"NewDialog\" Value=\"VerifyReadyDlg\">Installed AND PATCH</Publish>\n        </UI>\n\n        <InstallUISequence>\n            <Show Dialog=\"WelcomeDlg\" Before=\"AdvancedWelcomeEulaDlg_Custom\" >Installed AND PATCH</Show>\n        </InstallUISequence>\n\n        <Property Id=\"WIXUI_INSTALLDIR\" Value=\"APPLICATIONFOLDER\" />\n        <UIRef Id=\"WixUI_Common\" />\n    </Fragment>\n</Wix>"
  },
  {
    "path": "windows/pandoc.wxs",
    "content": "<?define UpgradeCode = \"A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562\" ?>\n<?if $(sys.BUILDARCH)=x64?>\n<?define ProgFilesFolder=\"ProgramFiles64Folder\"?>\n<?else?>\n<?define ProgFilesFolder=\"ProgramFilesFolder\"?>\n<?endif?>\n<Wix xmlns=\"http://schemas.microsoft.com/wix/2006/wi\">\n  <Product Id=\"*\"\n  UpgradeCode=\"$(var.UpgradeCode)\" Name=\"Pandoc $(var.VERSION)\"\n  Version=\"$(var.VERSION)\" Manufacturer=\"John MacFarlane\"\n  Language=\"1033\">\n\n    <Package InstallerVersion=\"301\" Compressed=\"yes\"\n    Comments=\"Windows Installer Package\" />\n    <Media Id=\"1\" Cabinet=\"product.cab\" EmbedCab=\"yes\" />\n    <Property Id=\"PREVIOUSVERSIONSINSTALLED\" Secure=\"yes\" />\n    <Upgrade Id=\"$(var.UpgradeCode)\">\n      <UpgradeVersion Property='PREVIOUSVERSIONSINSTALLED'\n        Minimum='0.0.0.0'  IncludeMinimum='yes'\n        Maximum=\"99.0.0.0\" IncludeMaximum=\"no\" />\n    </Upgrade>\n\n    <InstallExecuteSequence>\n      <RemoveExistingProducts After=\"InstallFinalize\"/>\n    </InstallExecuteSequence>\n\n    <Property Id=\"DISABLEADVTSHORTCUTS\" Value=\"1\" />\n\n    <Directory Id=\"TARGETDIR\" Name=\"SourceDir\">\n\n      <Directory Id=\"$(var.ProgFilesFolder)\">\n        <Directory Id=\"APPLICATIONFOLDER\" Name=\"Pandoc\">\n          <Component Id=\"MainExecutable\"\n                     Guid=\"ECD35082-4C28-49E1-977E-B90FC7C400C7\">\n            <RegistryValue Root=\"HKMU\"\n                           Key=\"Software\\John MacFarlane\\Pandoc\"\n                           Name=\"Version\" Type=\"string\" Value=\"[ProductVersion]\"\n                           KeyPath=\"yes\"/>\n            <RemoveFolder Id=\"APPLICATIONFOLDER\" On=\"uninstall\"/>\n            <File Id=\"pandocEXE\" Name=\"pandoc.exe\"\n                  Source=\"$(var.BINPATH)\\pandoc.exe\" />\n            <File Id=\"pandocCOPYRIGHT\" Name=\"COPYRIGHT.txt\"\n                  Source=\"$(var.BINPATH)\\COPYRIGHT.txt\" />\n            <File Id=\"pandocCOPYING\" Name=\"COPYING.rtf\"\n                  Source=\"$(var.BINPATH)\\COPYING.rtf\" />\n          </Component>\n\n          <Component Id=\"CitationSupport\"\n                     Guid=\"0A214839-2E69-4026-8DBB-0F0A9DB75C12\">\n            <RegistryValue Root=\"HKMU\"\n                           Key=\"Software\\John MacFarlane\\Pandoc\"\n                           Name=\"Version\" Type=\"string\" Value=\"[ProductVersion]\"\n                           KeyPath=\"yes\"/>\n          </Component>\n\n          <Component Id=\"Documentation\"\n                     Guid=\"A8D54A76-1A3D-4647-8327-81B69D39D8A3\">\n            <File Id=\"pandocMANUAL\" Name=\"Pandoc User's Guide.html\"\n                  Source=\"$(var.BINPATH)\\MANUAL.html\" KeyPath=\"yes\">\n              <Shortcut Id=\"ApplicationStartMenuShortcut\"\n                        Directory=\"ApplicationProgramsFolder\"\n                        Name=\"Pandoc User’s Guide\" Advertise=\"yes\" />\n            </File>\n          </Component>\n\n\n          <Component Id=\"UpdateUserPath\"\n                     Guid=\"7ECEAD05-CA5C-4147-82CB-F7CADABAC7F3\"\n                     KeyPath=\"yes\">\n            <Condition>ALLUSERS = \"\" OR ALLUSERS = 2</Condition>\n            <Environment Id='SetUserPath' Name='PATH' Action='set'\n                       Permanent='no' System='no' Part='last'\n                       Value='[APPLICATIONFOLDER]' />\n          </Component>\n\n          <Component Id=\"UpdateSystemPath\"\n                     Guid=\"F8AC4135-C0AE-48C7-BAC5-311DAC97CFD8\"\n                     KeyPath=\"yes\">\n            <Condition>ALLUSERS = 1</Condition>\n            <Environment Id='SetSystemPath' Name='PATH' Action='set'\n                       Permanent='no' System='yes' Part='last'\n                       Value='[APPLICATIONFOLDER]' />\n          </Component>\n\n        </Directory>\n      </Directory>\n\n      <Directory Id=\"ProgramMenuFolder\">\n        <Directory Id=\"ApplicationProgramsFolder\" Name=\"Pandoc\">\n          <Component Id=\"ApplicationShortcut\"\n                     Guid=\"7F807DD5-CC54-474A-B571-89630893F563\">\n            <RemoveFolder Id=\"ApplicationProgramsFolder\"\n                          On=\"uninstall\"/>\n            <RegistryValue Root=\"HKMU\" Key=\"Software\\John MacFarlane\\Pandoc\"\n                           Name=\"ShortcutInstalled\" Type=\"integer\" Value=\"1\"\n                           KeyPath=\"yes\"/>\n          </Component>\n        </Directory>\n      </Directory>\n\n    </Directory>\n\n    <Feature Id=\"Complete\" Level=\"1\" Title=\"Pandoc $(var.VERSION)\"\n             Description=\"Complete package\"  Display=\"expand\"\n             ConfigurableDirectory=\"APPLICATIONFOLDER\">\n      <Feature Id=\"MainProgram\"\n               Title=\"Program\"\n               Description=\"The main executable.\"\n               Level=\"1\">\n        <ComponentRef Id=\"MainExecutable\" />\n        <ComponentRef Id=\"UpdateUserPath\" />\n        <ComponentRef Id=\"UpdateSystemPath\" />\n      </Feature>\n      <Feature Id=\"Manual\" Title=\"Manual\">\n        <ComponentRef Id=\"Documentation\" />\n        <ComponentRef Id=\"ApplicationShortcut\" />\n      </Feature>\n      <Feature Id=\"Citation\" Title=\"Citation Support\"\n               Description=\"Citation support.\">\n        <ComponentRef Id=\"CitationSupport\" />\n      </Feature>\n    </Feature>\n\n\n    <!-- Set properties for add/remove programs -->\n    <Property Id=\"ARPURLINFOABOUT\" Value=\"https://pandoc.org\" />\n    <Property Id=\"ARPHELPLINK\" Value=\"https://pandoc.org\" />\n    <Property Id=\"ARPNOREPAIR\" Value=\"yes\" Secure=\"yes\" />    <!-- Remove repair -->\n    <Property Id=\"ARPNOMODIFY\" Value=\"yes\" Secure=\"yes\" />    <!-- Remove modify -->\n\n\n    <!--Needed for WixUI_Advanced-->\n    <Property Id=\"ApplicationFolderName\" Value=\"Pandoc\" />\n    <Property Id=\"WixAppFolder\" Value=\"WixPerUserFolder\" />\n\n    <!--For Single Package for dual purpose i.e. per User/Machine-->\n    <!--<Property Id=\"ALLUSERS\" Value=\"2\" Secure=\"yes\" />-->\n    <Property Id=\"MSIINSTALLPERUSER\" Value=\"1\" />\n\n    <!--Inform about installed location-->\n    <SetProperty Id=\"ARPINSTALLLOCATION\" Value=\"[APPLICATIONFOLDER]\"\n                 After=\"CostFinalize\" />\n    <CustomAction Id=\"SetExitDialogOptText\"\n                      Property=\"WIXUI_EXITDIALOGOPTIONALTEXT\"\n                      Value=\"!(loc.ExitDialogText)\" />\n\n    <!--Offer Per User installs only on workstations (block on servers)-->\n    <!--Unless ALLUSERS=1 is specified on command line-->\n    <SetProperty Id=\"WixUISupportPerUser\" Value=\"0\" Before=\"FindRelatedProducts\">\n      <!--https://msdn.microsoft.com/en-us/library/windows/desktop/aa370329(v=vs.85).aspx-->\n      MsiNTProductType > 1\n    </SetProperty>\n    <SetProperty Id=\"WixUISupportPerUser\" Value=\"1\" Before=\"FindRelatedProducts\" Action=\"CASupportPerUser\">\n      MsiNTProductType = 1\n    </SetProperty>\n    <SetProperty Id=\"ALLUSERS\" Value=\"1\" Before=\"FindRelatedProducts\">\n      MsiNTProductType > 1\n    </SetProperty>\n    <SetProperty Id=\"ALLUSERS\" Value=\"{}\" Before=\"FindRelatedProducts\" Action=\"CASetPuaPackage\">\n      (NOT ALLUSERS = 1) AND MsiNTProductType = 1\n    </SetProperty>\n    <SetProperty Id=\"MSIINSTALLPERUSER\" Value=\"1\" Before=\"FindRelatedProducts\">\n      (NOT ALLUSERS = 1) AND MsiNTProductType = 1\n    </SetProperty>\n    <SetProperty Id=\"WixAppFolder\" Value=\"WixPerMachineFolder\" Before=\"FindRelatedProducts\">\n      MsiNTProductType > 1\n    </SetProperty>\n\n    <!--Make changes to PATH visible immeidiately-->\n    <CustomActionRef Id=\"WixBroadcastSettingChange\" />\n    <CustomActionRef Id=\"WixBroadcastEnvironmentChange\" />\n\n    <InstallUISequence>\n      <Custom Action=\"SetExitDialogOptText\" Before=\"ExecuteAction\">\n        NOT Installed\n      </Custom>\n    </InstallUISequence>\n\n    <UIRef Id=\"WixUI_Advanced_Custom\"/>\n    <!--Enable better description when debug logging-->\n    <UIRef Id=\"WixUI_ErrorProgressText\" />\n\n  </Product>\n\n\n</Wix>\n"
  },
  {
    "path": "xml-light/Text/Pandoc/XML/Light/Output.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.XML.Light.Output\n   Copyright   : Copyright (C) 2007 Galois, Inc., 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\n   This code is based on code from xml-light, released under the BSD3 license.\n   We use a text Builder instead of ShowS.\n-}\nmodule Text.Pandoc.XML.Light.Output\n  ( -- * Replacement for xml-light's Text.XML.Output\n    ppTopElement\n  , ppElement\n  , ppContent\n  , ppcElement\n  , ppcContent\n  , showTopElement\n  , showElement\n  , showContent\n  , useShortEmptyTags\n  , defaultConfigPP\n  , ConfigPP(..)\n  ) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport Data.Text.Lazy.Builder (Builder, singleton, fromText, toLazyText)\nimport Text.Pandoc.XML.Light.Types\n\n--\n-- duplicates functions from Text.XML.Output\n--\n\n-- | The XML 1.0 header\nxmlHeader :: Text\nxmlHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"\n\n\n--------------------------------------------------------------------------------\ndata ConfigPP = ConfigPP\n  { shortEmptyTag :: QName -> Bool\n  , prettify      :: Bool\n  }\n\n-- | Default pretty orinting configuration.\n--  * Always use abbreviate empty tags.\ndefaultConfigPP :: ConfigPP\ndefaultConfigPP = ConfigPP { shortEmptyTag = const True\n                           , prettify      = False\n                           }\n\n-- | The predicate specifies for which empty tags we should use XML's\n-- abbreviated notation <TAG />.  This is useful if we are working with\n-- some XML-ish standards (such as certain versions of HTML) where some\n-- empty tags should always be displayed in the <TAG></TAG> form.\nuseShortEmptyTags :: (QName -> Bool) -> ConfigPP -> ConfigPP\nuseShortEmptyTags p c = c { shortEmptyTag = p }\n\n\n-- | Specify if we should use extra white-space to make document more readable.\n-- WARNING: This adds additional white-space to text elements,\n-- and so it may change the meaning of the document.\nuseExtraWhiteSpace :: Bool -> ConfigPP -> ConfigPP\nuseExtraWhiteSpace p c  = c { prettify = p }\n\n-- | A configuration that tries to make things pretty\n-- (possibly at the cost of changing the semantics a bit\n-- through adding white space.)\nprettyConfigPP     :: ConfigPP\nprettyConfigPP      = useExtraWhiteSpace True defaultConfigPP\n\n\n--------------------------------------------------------------------------------\n\n\n-- | Pretty printing renders XML documents faithfully,\n-- with the exception that whitespace may be added\\/removed\n-- in non-verbatim character data.\nppTopElement       :: Element -> Text\nppTopElement        = ppcTopElement prettyConfigPP\n\n-- | Pretty printing elements\nppElement          :: Element -> Text\nppElement           = ppcElement prettyConfigPP\n\n-- | Pretty printing content\nppContent          :: Content -> Text\nppContent           = ppcContent prettyConfigPP\n\n-- | Pretty printing renders XML documents faithfully,\n-- with the exception that whitespace may be added\\/removed\n-- in non-verbatim character data.\nppcTopElement      :: ConfigPP -> Element -> Text\nppcTopElement c e   = T.unlines [xmlHeader,ppcElement c e]\n\n-- | Pretty printing elements\nppcElement         :: ConfigPP -> Element -> Text\nppcElement c        = TL.toStrict . toLazyText . ppElementS c mempty\n\n-- | Pretty printing content\nppcContent         :: ConfigPP -> Content -> Text\nppcContent c        = TL.toStrict . toLazyText . ppContentS c mempty\n\nppcCData           :: ConfigPP -> CData -> Text\nppcCData c         = TL.toStrict . toLazyText . ppCDataS c mempty\n\ntype Indent = Builder\n\n-- | Pretty printing content using ShowT\nppContentS         :: ConfigPP -> Indent -> Content -> Builder\nppContentS c i x = case x of\n                     Elem e -> ppElementS c i e\n                     Text t -> ppCDataS c i t\n                     CRef r -> showCRefS r\n\nppElementS         :: ConfigPP -> Indent -> Element -> Builder\nppElementS c i e = i <> tagStart (elName e) (elAttribs e) <>\n  (case elContent e of\n    [] | \"?\" `T.isPrefixOf` qName name -> fromText \" ?>\"\n       | shortEmptyTag c name  -> fromText \" />\"\n    [Text t] -> singleton '>' <> ppCDataS c mempty t <> tagEnd name\n    cs -> singleton '>' <> nl <>\n          mconcat (map ((<> nl) . ppContentS c (sp <> i)) cs) <>\n          i <> tagEnd name\n      where (nl,sp)  = if prettify c then (\"\\n\",\"  \") else (\"\",\"\")\n  )\n  where name = elName e\n\nppCDataS           :: ConfigPP -> Indent -> CData -> Builder\nppCDataS c i t     = i <> if cdVerbatim t /= CDataText || not (prettify c)\n                             then showCDataS t\n                             else foldr cons mempty (T.unpack (showCData t))\n  where cons         :: Char -> Builder -> Builder\n        cons '\\n' ys  = singleton '\\n' <> i <> ys\n        cons y ys     = singleton y <> ys\n\n\n\n--------------------------------------------------------------------------------\n\n-- | Adds the <?xml?> header.\nshowTopElement     :: Element -> Text\nshowTopElement c    = xmlHeader <> showElement c\n\nshowContent        :: Content -> Text\nshowContent         = ppcContent defaultConfigPP\n\nshowElement        :: Element -> Text\nshowElement         = ppcElement defaultConfigPP\n\nshowCData          :: CData -> Text\nshowCData           = ppcCData defaultConfigPP\n\n-- Note: crefs should not contain '&', ';', etc.\nshowCRefS          :: Text -> Builder\nshowCRefS r         = singleton '&' <> fromText r <> singleton ';'\n\n-- | Convert a text element to characters.\nshowCDataS         :: CData -> Builder\nshowCDataS cd =\n case cdVerbatim cd of\n   CDataText     -> escStr (cdData cd)\n   CDataVerbatim -> fromText \"<![CDATA[\" <> escCData (cdData cd) <>\n                    fromText \"]]>\"\n   CDataRaw      -> fromText (cdData cd)\n\n--------------------------------------------------------------------------------\nescCData           :: Text -> Builder\nescCData t\n  | \"]]>\" `T.isPrefixOf` t =\n     fromText \"]]]]><![CDATA[>\" <> fromText (T.drop 3 t)\nescCData t\n  = case T.uncons t of\n      Nothing     -> mempty\n      Just (c,t') -> singleton c <> escCData t'\n\nescChar            :: Char -> Builder\nescChar c = case c of\n  '<'   -> fromText \"&lt;\"\n  '>'   -> fromText \"&gt;\"\n  '&'   -> fromText \"&amp;\"\n  '\"'   -> fromText \"&quot;\"\n  -- we use &#39 instead of &apos; because IE apparently has difficulties\n  -- rendering &apos; in xhtml.\n  -- Reported by Rohan Drape <rohan.drape@gmail.com>.\n  '\\''  -> fromText \"&#39;\"\n  _     -> singleton c\n\n  {- original xml-light version:\n  -- NOTE: We escape '\\r' explicitly because otherwise they get lost\n  -- when parsed back in because of then end-of-line normalization rules.\n  _ | isPrint c || c == '\\n' -> singleton c\n    | otherwise -> showText \"&#\" . showsT oc . singleton ';'\n      where oc = ord c\n  -}\n\nescStr             :: Text -> Builder\nescStr cs          = if T.any needsEscape cs\n                        then mconcat (map escChar (T.unpack cs))\n                        else fromText cs\n where\n  needsEscape '<' = True\n  needsEscape '>' = True\n  needsEscape '&' = True\n  needsEscape '\"' = True\n  needsEscape '\\'' = True\n  needsEscape _ = False\n\ntagEnd             :: QName -> Builder\ntagEnd qn           = fromText \"</\" <> showQName qn <> singleton '>'\n\ntagStart           :: QName -> [Attr] -> Builder\ntagStart qn as      = singleton '<' <> showQName qn <> as_str\n where as_str       = if null as\n                         then mempty\n                         else mconcat (map showAttr as)\n\nshowAttr           :: Attr -> Builder\nshowAttr (Attr qn v) = singleton ' ' <> showQName qn <>\n                       singleton '=' <>\n                       singleton '\"' <> escStr v <> singleton '\"'\n\nshowQName          :: QName -> Builder\nshowQName q         =\n  case qPrefix q of\n    Nothing -> fromText (qName q)\n    Just p  -> fromText p <> singleton ':' <> fromText (qName q)\n"
  },
  {
    "path": "xml-light/Text/Pandoc/XML/Light/Proc.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{- |\n   Module      : Text.Pandoc.XML.Light.Proc\n   Copyright   : Copyright (C) 2007 Galois, Inc., 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\n   This code is taken from xml-light, released under the BSD3 license.\n-}\nmodule Text.Pandoc.XML.Light.Proc\n  (\n    -- * Replacement for xml-light's Text.XML.Proc\n    strContent\n  , onlyElems\n  , elChildren\n  , onlyText\n  , findChildren\n  , filterChildren\n  , filterChildrenName\n  , findChild\n  , filterChild\n  , filterChildName\n  , findElement\n  , filterElement\n  , filterElementName\n  , findElements\n  , filterElements\n  , filterElementsName\n  , findAttr\n  , lookupAttr\n  , lookupAttrBy\n  , findAttrBy\n  ) where\n\nimport Data.Text (Text)\nimport Data.Maybe (listToMaybe)\nimport Data.List(find)\nimport Text.Pandoc.XML.Light.Types\n\n--\n-- copied from xml-light Text.XML.Proc\n--\n\n-- | Get the text value of an XML element.  This function\n-- ignores non-text elements, and concatenates all text elements.\nstrContent         :: Element -> Text\nstrContent          = mconcat . map cdData . onlyText . elContent\n\n-- | Select only the elements from a list of XML content.\nonlyElems          :: [Content] -> [Element]\nonlyElems xs        = [ x | Elem x <- xs ]\n\n-- | Select only the elements from a parent.\nelChildren         :: Element -> [Element]\nelChildren e        = [ x | Elem x <- elContent e ]\n\n-- | Select only the text from a list of XML content.\nonlyText           :: [Content] -> [CData]\nonlyText xs         = [ x | Text x <- xs ]\n\n-- | Find all immediate children with the given name.\nfindChildren       :: QName -> Element -> [Element]\nfindChildren q e    = filterChildren ((q ==) . elName) e\n\n-- | Filter all immediate children wrt a given predicate.\nfilterChildren       :: (Element -> Bool) -> Element -> [Element]\nfilterChildren p e    = filter p (onlyElems (elContent e))\n\n\n-- | Filter all immediate children wrt a given predicate over their names.\nfilterChildrenName      :: (QName -> Bool) -> Element -> [Element]\nfilterChildrenName p e   = filter (p.elName) (onlyElems (elContent e))\n\n\n-- | Find an immediate child with the given name.\nfindChild          :: QName -> Element -> Maybe Element\nfindChild q e       = listToMaybe (findChildren q e)\n\n-- | Find an immediate child with the given name.\nfilterChild          :: (Element -> Bool) -> Element -> Maybe Element\nfilterChild p e       = listToMaybe (filterChildren p e)\n\n-- | Find an immediate child with name matching a predicate.\nfilterChildName      :: (QName -> Bool) -> Element -> Maybe Element\nfilterChildName p e   = listToMaybe (filterChildrenName p e)\n\n-- | Find the left-most occurrence of an element matching given name.\nfindElement        :: QName -> Element -> Maybe Element\nfindElement q e     = listToMaybe (findElements q e)\n\n-- | Filter the left-most occurrence of an element wrt. given predicate.\nfilterElement        :: (Element -> Bool) -> Element -> Maybe Element\nfilterElement p e     = listToMaybe (filterElements p e)\n\n-- | Filter the left-most occurrence of an element wrt. given predicate.\nfilterElementName     :: (QName -> Bool) -> Element -> Maybe Element\nfilterElementName p e  = listToMaybe (filterElementsName p e)\n\n-- | Find all non-nested occurrences of an element.\n-- (i.e., once we have found an element, we do not search\n-- for more occurrences among the element's children).\nfindElements       :: QName -> Element -> [Element]\nfindElements qn e = filterElementsName (qn==) e\n\n-- | Find all non-nested occurrences of an element wrt. given predicate.\n-- (i.e., once we have found an element, we do not search\n-- for more occurrences among the element's children).\nfilterElements       :: (Element -> Bool) -> Element -> [Element]\nfilterElements p e\n | p e        = [e]\n | otherwise  = concatMap (filterElements p) $ onlyElems $ elContent e\n\n-- | Find all non-nested occurrences of an element wrt a predicate over element names.\n-- (i.e., once we have found an element, we do not search\n-- for more occurrences among the element's children).\nfilterElementsName       :: (QName -> Bool) -> Element -> [Element]\nfilterElementsName p e = filterElements (p.elName) e\n\n-- | Lookup the value of an attribute.\nfindAttr          :: QName -> Element -> Maybe Text\nfindAttr x e       = lookupAttr x (elAttribs e)\n\n-- | Lookup attribute name from list.\nlookupAttr        :: QName -> [Attr] -> Maybe Text\nlookupAttr x       = lookupAttrBy (x ==)\n\n-- | Lookup the first attribute whose name satisfies the given predicate.\nlookupAttrBy       :: (QName -> Bool) -> [Attr] -> Maybe Text\nlookupAttrBy p as   = attrVal `fmap` find (p . attrKey) as\n\n-- | Lookup the value of the first attribute whose name\n-- satisfies the given predicate.\nfindAttrBy         :: (QName -> Bool) -> Element -> Maybe Text\nfindAttrBy p e      = lookupAttrBy p (elAttribs e)\n"
  },
  {
    "path": "xml-light/Text/Pandoc/XML/Light/Types.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE DeriveDataTypeable #-}\n{- |\n   Module      : Text.Pandoc.XML.Light.Types\n   Copyright   : Copyright (C) 2007 Galois, Inc., 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\n   This code is taken from xml-light, released under the BSD3 license.\n   It has been modified to use Text instead of String, and the fromXL*\n   functions have been added.\n-}\nmodule Text.Pandoc.XML.Light.Types\n  ( -- * Basic types, duplicating those from xml-light but with Text\n    -- instead of String\n    Line\n  , Content(..)\n  , Element(..)\n  , Attr(..)\n  , CData(..)\n  , CDataKind(..)\n  , QName(..)\n  , Node(..)\n  , unode\n  , unqual\n  , add_attr\n  , add_attrs\n  -- * Conversion functions from xml-light types\n  , fromXLQName\n  , fromXLCData\n  , fromXLElement\n  , fromXLAttr\n  , fromXLContent\n  ) where\n\nimport Data.Text (Text)\nimport qualified Data.Text as T\nimport Data.Data (Data)\nimport Data.Typeable (Typeable)\nimport qualified Text.XML.Light as XL\n\n--\n-- type definitions lightly modified from xml-light\n--\n\n-- | A line is an Integer\ntype Line     = Integer\n\n-- | XML content\ndata Content  = Elem Element\n              | Text CData\n              | CRef Text\n                deriving (Show, Typeable, Data, Ord, Eq)\n\n-- | XML elements\ndata Element  = Element {\n                  elName      :: QName,\n                  elAttribs   :: [Attr],\n                  elContent   :: [Content],\n                  elLine      :: Maybe Line\n                } deriving (Show, Typeable, Data, Ord, Eq)\n\n-- | XML attributes\ndata Attr     = Attr {\n                  attrKey :: QName,\n                  attrVal :: Text\n                } deriving (Eq, Ord, Show, Typeable, Data)\n\n-- | XML CData\ndata CData    = CData {\n                  cdVerbatim  :: CDataKind,\n                  cdData      :: Text,\n                  cdLine      :: Maybe Line\n                } deriving (Show, Typeable, Data, Ord, Eq)\n\ndata CDataKind\n = CDataText      -- ^ Ordinary character data; pretty printer escapes &, < etc.\n | CDataVerbatim  -- ^ Unescaped character data; pretty printer embeds it in <![CDATA[..\n | CDataRaw       -- ^ As-is character data; pretty printer passes it along without any escaping or CDATA wrap-up.\n   deriving ( Eq, Ord, Show, Typeable, Data )\n\n-- | XML qualified names\ndata QName    = QName {\n                  qName   :: Text,\n                  qURI    :: Maybe Text,\n                  qPrefix :: Maybe Text\n                } deriving (Show, Typeable, Data)\n\n\ninstance Eq QName where\n  q1 == q2  = compare q1 q2 == EQ\n\ninstance Ord QName where\n  compare q1 q2 =\n    case compare (qName q1) (qName q2) of\n      EQ  -> case (qURI q1, qURI q2) of\n               (Nothing,Nothing) -> compare (qPrefix q1) (qPrefix q2)\n               (u1,u2)           -> compare u1 u2\n      x   -> x\n\nclass Node t where\n node :: QName -> t -> Element\n\ninstance Node ([Attr],[Content]) where\n  node n (attrs,cont) = Element { elName     = n\n                                , elAttribs  = attrs\n                                , elContent  = cont\n                                , elLine     = Nothing\n                                }\n\ninstance Node [Attr]             where node n as   = node n (as,[]::[Content])\ninstance Node Attr               where node n a    = node n [a]\ninstance Node ()                 where node n ()   = node n ([]::[Attr])\n\ninstance Node [Content]          where node n cs     = node n ([]::[Attr],cs)\ninstance Node Content            where node n c      = node n [c]\ninstance Node ([Attr],Content)   where node n (as,c) = node n (as,[c])\ninstance Node (Attr,Content)     where node n (a,c)  = node n ([a],[c])\n\ninstance Node ([Attr],[Element]) where\n  node n (as,cs) = node n (as,map Elem cs)\n\ninstance Node ([Attr],Element)   where node n (as,c) = node n (as,[c])\ninstance Node (Attr,Element)     where node n (a,c)  = node n ([a],c)\ninstance Node [Element]          where node n es     = node n ([]::[Attr],es)\ninstance Node Element            where node n e      = node n [e]\n\ninstance Node ([Attr],[CData])   where\n  node n (as,cs) = node n (as,map Text cs)\n\ninstance Node ([Attr],CData)     where node n (as,c) = node n (as,[c])\ninstance Node (Attr,CData)       where node n (a,c)  = node n ([a],c)\ninstance Node [CData]            where node n es     = node n ([]::[Attr],es)\ninstance Node CData              where node n e      = node n [e]\n\ninstance Node ([Attr],Text)      where\n  node n (as,t) = node n (as, CData { cdVerbatim = CDataText\n                                    , cdData = t\n                                    , cdLine = Nothing })\n\ninstance Node (Attr,Text )       where node n (a,t)  = node n ([a],t)\ninstance Node Text               where node n t      = node n ([]::[Attr],t)\n\n-- | Create node with unqualified name\nunode :: Node t => Text -> t -> Element\nunode = node . unqual\n\nunqual :: Text -> QName\nunqual x = QName x Nothing Nothing\n\n-- | Add an attribute to an element.\nadd_attr :: Attr -> Element -> Element\nadd_attr a e = add_attrs [a] e\n\n-- | Add some attributes to an element.\nadd_attrs :: [Attr] -> Element -> Element\nadd_attrs as e = e { elAttribs = as ++ elAttribs e }\n\n--\n-- conversion from xml-light\n--\n\nfromXLQName :: XL.QName -> QName\nfromXLQName qn = QName { qName = T.pack $ XL.qName qn\n                       , qURI = T.pack <$> XL.qURI qn\n                       , qPrefix = T.pack <$> XL.qPrefix qn }\n\nfromXLCData :: XL.CData -> CData\nfromXLCData cd = CData { cdVerbatim = case XL.cdVerbatim cd of\n                                        XL.CDataText -> CDataText\n                                        XL.CDataVerbatim -> CDataVerbatim\n                                        XL.CDataRaw -> CDataRaw\n                       , cdData = T.pack $ XL.cdData cd\n                       , cdLine = XL.cdLine cd }\n\nfromXLElement :: XL.Element -> Element\nfromXLElement el = Element { elName = fromXLQName $ XL.elName el\n                           , elAttribs = map fromXLAttr $ XL.elAttribs el\n                           , elContent = map fromXLContent $ XL.elContent el\n                           , elLine = XL.elLine el }\n\nfromXLAttr :: XL.Attr -> Attr\nfromXLAttr (XL.Attr qn s) = Attr (fromXLQName qn) (T.pack s)\n\nfromXLContent :: XL.Content -> Content\nfromXLContent (XL.Elem el) = Elem $ fromXLElement el\nfromXLContent (XL.Text cd) = Text $ fromXLCData cd\nfromXLContent (XL.CRef s)  = CRef (T.pack s)\n"
  },
  {
    "path": "xml-light/Text/Pandoc/XML/Light.hs",
    "content": "{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE OverloadedStrings #-}\n{- |\n   Module      : Text.Pandoc.XML.Light\n   Copyright   : Copyright (C) 2021-2024 John MacFarlane\n   License     : GNU GPL, version 2 or above\n\n   Maintainer  : John MacFarlane <jgm@berkeley.edu>\n   Stability   : alpha\n   Portability : portable\n\nxml-light, which we used in pandoc's the XML-based readers, has\nsome limitations: in particular, it produces nodes with String\ninstead of Text, and the parser falls over on processing instructions\n(see #7091).\n\nThis module exports much of the API of xml-light, but using Text instead\nof String. In addition, the xml-light parsers are replaced by xml-conduit's\nwell-tested parser.  (The xml-conduit types are mapped to types\nisomorphic to xml-light's, to avoid the need for massive code modifications\nelsewhere.)  Bridge functions to map xml-light types to this module's\ntypes are also provided (since libraries like texmath still use xml-light).\n\nAnother advantage of the xml-conduit parser is that it gives us\ndetailed information on xml parse errors.\n\nIn the future we may want to move to using xml-conduit or another\nxml library in the code base, but this change gives us\nbetter performance and accuracy without much change in the\ncode that used xml-light.\n-}\nmodule Text.Pandoc.XML.Light\n  ( module Text.Pandoc.XML.Light.Types\n  , module Text.Pandoc.XML.Light.Proc\n  , module Text.Pandoc.XML.Light.Output\n    -- * Replacement for xml-light's Text.XML.Input\n  , parseXMLElement\n  , parseXMLContents\n    --  * Versions that allow passing in a custom entity table\n  , parseXMLElementWithEntities\n  , parseXMLContentsWithEntities\n  ) where\n\nimport qualified Control.Exception as E\nimport qualified Text.XML as Conduit\nimport Text.XML.Unresolved (InvalidEventStream(..))\nimport qualified Data.Text as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Map as M\nimport Data.Maybe (mapMaybe)\nimport Text.Pandoc.XML.Light.Types\nimport Text.Pandoc.XML.Light.Proc\nimport Text.Pandoc.XML.Light.Output\nimport qualified Data.XML.Types as XML\n\n-- Drop in replacement for parseXMLDoc in xml-light.\nparseXMLElement :: TL.Text -> Either T.Text Element\nparseXMLElement = parseXMLElementWithEntities mempty\n\n-- Drop in replacement for parseXMLDoc in xml-light.\nparseXMLElementWithEntities :: M.Map T.Text T.Text\n                            -> TL.Text -> Either T.Text Element\nparseXMLElementWithEntities entityMap t =\n  elementToElement .  Conduit.documentRoot <$>\n    either (Left . T.pack . E.displayException) Right\n    (Conduit.parseText Conduit.def{ Conduit.psRetainNamespaces = True\n                                  , Conduit.psDecodeEntities = decodeEnts } t)\n where\n   decodeEnts ref = case M.lookup ref entityMap of\n                      Nothing -> XML.ContentEntity ref\n                      Just t' -> XML.ContentText t'\n\nparseXMLContents :: TL.Text -> Either T.Text [Content]\nparseXMLContents = parseXMLContentsWithEntities mempty\n\nparseXMLContentsWithEntities :: M.Map T.Text T.Text\n                             -> TL.Text -> Either T.Text [Content]\nparseXMLContentsWithEntities entityMap t =\n  case Conduit.parseText Conduit.def{ Conduit.psRetainNamespaces = True\n                                    , Conduit.psDecodeEntities = decodeEnts\n                                    } t of\n    Left e ->\n      case E.fromException e of\n        Just (ContentAfterRoot _) ->\n          elContent <$> parseXMLElementWithEntities entityMap\n                          (\"<wrapper>\" <> t <> \"</wrapper>\")\n        _ -> Left . T.pack . E.displayException $ e\n    Right x -> Right [Elem . elementToElement . Conduit.documentRoot $ x]\n where\n   decodeEnts ref = case M.lookup ref entityMap of\n                      Nothing -> XML.ContentEntity ref\n                      Just t' -> XML.ContentText t'\n\nelementToElement :: Conduit.Element -> Element\nelementToElement (Conduit.Element name attribMap nodes) =\n  Element (nameToQname name) attrs (mapMaybe nodeToContent nodes) Nothing\n where\n  attrs = map (\\(n,v) -> Attr (nameToQname n) v) $\n              M.toList attribMap\n  nameToQname (Conduit.Name localName mbns mbpref) =\n    case mbpref of\n      Nothing ->\n        case T.stripPrefix \"xmlns:\" localName of\n          Just rest -> QName rest mbns (Just \"xmlns\")\n          Nothing   -> QName localName mbns mbpref\n      _ -> QName localName mbns mbpref\n\nnodeToContent :: Conduit.Node -> Maybe Content\nnodeToContent (Conduit.NodeElement el) =\n  Just (Elem (elementToElement el))\nnodeToContent (Conduit.NodeContent t) =\n  Just (Text (CData CDataText t Nothing))\nnodeToContent _ = Nothing\n"
  }
]